From c9836c63aa11d409c2085a12701acf6aff20f642 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 16 Sep 2018 22:38:15 +0200 Subject: Initial commit --- .gitignore | 23 +++++++++++++++++++++++ LICENSE | 21 +++++++++++++++++++++ README.md | 2 ++ 3 files changed, 46 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..a1c2a238a9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..ab602974d2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000000..7734188f28 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# bartworks +A Gregtech addon. -- cgit From c05995f211407bc8538b35695254e6934d90c054 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 16 Sep 2018 22:44:58 +0200 Subject: Source Upload --- .gitignore | 5 + ID Range.txt | 6 + build.gradle | 111 ++++++ build.properties | 5 + gradlew | 164 +++++++++ gradlew.bat | 90 +++++ .../github/bartimaeusnek/bartworks/GuiHandler.java | 26 ++ .../github/bartimaeusnek/bartworks/MainMod.java | 66 ++++ .../bartworks/client/creativetabs/GT2Tab.java | 17 + .../client/gui/GT_GUIContainer_Destructopack.java | 31 ++ .../bartworks/client/gui/GT_GUIContainer_LESU.java | 60 +++ .../bartworks/common/ConfigHandler.java | 31 ++ .../bartworks/common/blocks/BW_Blocks.java | 63 ++++ .../bartworks/common/items/BW_ItemBlocks.java | 60 +++ .../common/items/GT_Destructopack_Item.java | 35 ++ .../bartworks/common/items/GT_Rockcutter_Item.java | 145 ++++++++ .../bartworks/common/items/GT_Teslastaff_Item.java | 122 +++++++ .../bartworks/common/items/SimpleIconItem.java | 21 ++ .../bartworks/common/loaders/ItemRegistry.java | 48 +++ .../bartworks/common/loaders/LoaderRegistry.java | 14 + .../bartworks/common/loaders/RecipeLoader.java | 149 ++++++++ .../GT_MetaTileEntity_EnergyDistributor.java | 53 +++ .../common/tileentities/GT_TileEntity_LESU.java | 403 +++++++++++++++++++++ .../container/GT_Container_Item_Destructopack.java | 58 +++ .../server/container/GT_Container_LESU.java | 37 ++ .../bartworks/util/ChatColorHelper.java | 27 ++ .../bartworks/util/ConnectedBlocksChecker.java | 171 +++++++++ .../bartworks/util/NEIbartworksConfig.java | 30 ++ .../resources/assets/bartworks/lang/en_US.lang | 8 + .../bartworks/textures/GT2/gui/Destructopack.png | Bin 0 -> 3569 bytes .../assets/bartworks/textures/GT2/gui/LESU.png | Bin 0 -> 2266 bytes .../bartworks/textures/blocks/EtchedLapisCell.png | Bin 0 -> 471 bytes .../bartworks/textures/blocks/LESU_CASING_0.png | Bin 0 -> 666 bytes .../bartworks/textures/blocks/LESU_CASING_1.png | Bin 0 -> 680 bytes .../bartworks/textures/blocks/LESU_CASING_2.png | Bin 0 -> 680 bytes .../bartworks/textures/blocks/LESU_CASING_3.png | Bin 0 -> 682 bytes .../assets/bartworks/textures/blocks/LESU_CELL.png | Bin 0 -> 795 bytes .../bartworks/textures/blocks/PlatedLapisCell.png | Bin 0 -> 623 bytes .../assets/bartworks/textures/items/GT2Coin.png | Bin 0 -> 259 bytes .../bartworks/textures/items/GT_Rockcutter.png | Bin 0 -> 353 bytes .../bartworks/textures/items/GT_Teslastaff.png | Bin 0 -> 362 bytes .../textures/items/gt.GT2Destructopack.png | Bin 0 -> 284 bytes src/main/resources/mcmod.info | 16 + 43 files changed, 2072 insertions(+) create mode 100644 ID Range.txt create mode 100644 build.gradle create mode 100644 build.properties create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java create mode 100644 src/main/resources/assets/bartworks/lang/en_US.lang create mode 100644 src/main/resources/assets/bartworks/textures/GT2/gui/Destructopack.png create mode 100644 src/main/resources/assets/bartworks/textures/GT2/gui/LESU.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/EtchedLapisCell.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/LESU_CASING_0.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/LESU_CASING_1.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/LESU_CASING_2.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/LESU_CASING_3.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/LESU_CELL.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/PlatedLapisCell.png create mode 100644 src/main/resources/assets/bartworks/textures/items/GT2Coin.png create mode 100644 src/main/resources/assets/bartworks/textures/items/GT_Rockcutter.png create mode 100644 src/main/resources/assets/bartworks/textures/items/GT_Teslastaff.png create mode 100644 src/main/resources/assets/bartworks/textures/items/gt.GT2Destructopack.png create mode 100644 src/main/resources/mcmod.info diff --git a/.gitignore b/.gitignore index a1c2a238a9..5f699efc89 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,11 @@ # BlueJ files *.ctxt +# IDEA files +*.iml +*.ipr +*.iws + # Mobile Tools for Java (J2ME) .mtj.tmp/ diff --git a/ID Range.txt b/ID Range.txt new file mode 100644 index 0000000000..07d3e9079a --- /dev/null +++ b/ID Range.txt @@ -0,0 +1,6 @@ +12500-13000 + +12500-12600 are occupied by Crops++ +12900-13000 are occupied by EMT + +12600-12700 are aviable for bartworks \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000000..21d3faeed4 --- /dev/null +++ b/build.gradle @@ -0,0 +1,111 @@ +buildscript { + repositories { + mavenCentral() + maven { + name = "forge" + url = "http://files.minecraftforge.net/maven" + } + maven { + name = "sonatype" + url = "https://oss.sonatype.org/content/repositories/snapshots/" + } + } + dependencies { + classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' + classpath "de.undercouch:gradle-download-task:3.1.2" + } +} + +apply plugin: 'forge' +apply plugin: 'idea' +apply plugin: 'signing' +import de.undercouch.gradle.tasks.download.Download + +sourceCompatibility = JavaVersion.VERSION_1_8 +targetCompatibility = JavaVersion.VERSION_1_8 +sourceCompatibility = 1.8 +targetCompatibility = 1.8 + + +ext.configFile = file "build.properties" +configFile.withReader { + def prop = new Properties() + prop.load(it) + project.ext.config = new ConfigSlurper().parse prop +} + + +version = config.mod_version +group= "com.github.bartimaeusnek.bartworks" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +archivesBaseName = "bartworks"+ "[" + config.mc_version + "]" + + + +minecraft { + version = "1.7.10-10.13.4.1614-1.7.10" + replaceIn "MainMod.java" + replace "@version@", project.version + runDir = "run" +} + +repositories { + mavenLocal() + maven { + name = "ic2" + url = "http://maven.ic2.player.to/" + } +} + +dependencies { + compile "net.industrial-craft:industrialcraft-2:${config.ic2.version}:dev" +} + +//task getGregTech(type: Download) { +// onlyIf { +// !file("libs/gregtech-${config.gregtech.version}-dev.jar").exists() +// } +// src "http://jenkins.usrv.eu:8080/job/Gregtech-5-Unofficial/${config.gregtech.jenkinsbuild}/artifact/build/libs/gregtech-${config.gregtech.version}-dev.jar" +// dest file("libs/gregtech-${config.gregtech.version}-dev.jar") +// mustRunAfter "deobfBinJar" +// mustRunAfter "repackMinecraft" +//} + +tasks.setupCIWorkspace.dependsOn getGregTech +tasks.setupDevWorkspace.dependsOn getGregTech +tasks.setupDecompWorkspace.dependsOn getGregTech +tasks.compileJava.dependsOn getGregTech + +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 'version':project.version, 'mcversion':project.minecraft.version + } + + // copy everything else, thats not the mcmod.info + from(sourceSets.main.resources.srcDirs) { + exclude 'mcmod.info' + } +} + +task signJar(dependsOn: 'reobf'){ + doLast { + ant.signjar( + destDir: jar.destinationDir, + jar: jar.getArchivePath(), + alias: findProperty('keyStoreAlias') ?: '', + keystore: findProperty('keyStore') ?: '', + storepass: findProperty('keyStorePass') ?: '', + digestalg: findProperty('signDigestAlg') ?: '', + tsaurl: findProperty('signTSAurl') ?: '', + verbose: true + ) + } +} diff --git a/build.properties b/build.properties new file mode 100644 index 0000000000..d52a4ddb8b --- /dev/null +++ b/build.properties @@ -0,0 +1,5 @@ +mc_version=1.7.10 +mod_version=0.0.1 +ic2.version=2.2.828-experimental +gregtech.version=5.09.32.36 +gregtech.jenkinsbuild=143 diff --git a/gradlew b/gradlew new file mode 100644 index 0000000000..91a7e269e1 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# 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"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000000..8a0b282aa6 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@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= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java new file mode 100644 index 0000000000..1a19fa32d6 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -0,0 +1,26 @@ +package com.github.bartimaeusnek.bartworks; + +import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_Destructopack; +import com.github.bartimaeusnek.bartworks.server.container.GT_Container_Item_Destructopack; +import cpw.mods.fml.common.network.IGuiHandler; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class GuiHandler implements IGuiHandler { + + @Override + public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { + switch (ID){ + case 0: return new GT_Container_Item_Destructopack(player.inventory); + } + return null; + } + + @Override + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { + switch (ID){ + case 0: return new GT_GUIContainer_Destructopack(player.inventory); + } + return null; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java new file mode 100644 index 0000000000..8e7bb21122 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -0,0 +1,66 @@ +package com.github.bartimaeusnek.bartworks; + + +import codechicken.nei.NEIActions; +import codechicken.nei.NEIClientUtils; +import codechicken.nei.NEIServerUtils; +import codechicken.nei.asm.NEICorePlugin; +import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; +import com.github.bartimaeusnek.bartworks.common.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_EnergyDistributor; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.network.IGuiHandler; +import cpw.mods.fml.common.network.NetworkRegistry; +import gregtech.api.enums.GT_Values; +import gregtech.nei.NEI_GT_Config; +import net.minecraft.creativetab.CreativeTabs; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@Mod( + modid = MainMod.modID, name = MainMod.name, version = MainMod.version, + dependencies = "required-after:IC2; " + + "required-after:gregtech; " + ) +public final class MainMod { + public static final String name = "BartWorks"; + public static final String version = "@version@"; + public static final String modID = "bartworks"; + public static final Logger logger = LogManager.getLogger(name); + public static boolean GTNH = false; + public static final CreativeTabs GT2 = new GT2Tab("GT2C"); + public static final IGuiHandler GH = new GuiHandler(); + @Mod.Instance(modID) + public static MainMod instance; + public static ConfigHandler CHandler; + + + @Mod.EventHandler + public void preInit(FMLPreInitializationEvent preinit) { + if(Loader.isModLoaded("dreamcraft")) { + GTNH = true; + } + CHandler= new ConfigHandler(preinit); + if (GTNH) + logger.info("GTNH-Detected . . . ACTIVATE HARDMODE."); + } + @Mod.EventHandler + public void init(FMLInitializationEvent init) { + new LoaderRegistry().run(); + } + + @Mod.EventHandler + public void postInit(FMLPostInitializationEvent postinit) { + NetworkRegistry.INSTANCE.registerGuiHandler(instance,GH); + } + + + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java new file mode 100644 index 0000000000..82188db9c5 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java @@ -0,0 +1,17 @@ +package com.github.bartimaeusnek.bartworks.client.creativetabs; + +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; + +public class GT2Tab extends CreativeTabs { + + public GT2Tab (String lable) { + super(lable); + } + + @Override + public Item getTabIconItem() { + return ItemRegistry.tab; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java new file mode 100644 index 0000000000..4946bdb328 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java @@ -0,0 +1,31 @@ +package com.github.bartimaeusnek.bartworks.client.gui; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.server.container.GT_Container_Item_Destructopack; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class GT_GUIContainer_Destructopack extends GuiContainer +{ + public GT_GUIContainer_Destructopack(InventoryPlayer inventory) { + super(new GT_Container_Item_Destructopack(inventory)); + } + public static final ResourceLocation texture = new ResourceLocation(MainMod.modID, "textures/GT2/gui/Destructopack.png"); + + @Override + public void drawGuiContainerBackgroundLayer(float f, int j, int i) { + GL11.glColor4f(1F, 1F, 1F, 1F); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, 175, 165); + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + } + + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java new file mode 100644 index 0000000000..574bc89536 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -0,0 +1,60 @@ +package com.github.bartimaeusnek.bartworks.client.gui; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; +import com.github.bartimaeusnek.bartworks.server.container.GT_Container_LESU; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import gregtech.api.gui.GT_GUIContainer; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +public class GT_GUIContainer_LESU extends GT_GUIContainer { + + protected GT_Container_LESU mContainer; + + public static final ResourceLocation texture = new ResourceLocation(MainMod.modID, "textures/GT2/gui/LESU.png"); + private GT_TileEntity_LESU c; + + public GT_GUIContainer_LESU(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(new GT_Container_LESU(aInventoryPlayer, aTileEntity), texture.getResourceDomain()); + mContainer = ((GT_Container_LESU)this.inventorySlots); + c = ((GT_TileEntity_LESU)(this.mContainer.mTileEntity.getMetaTileEntity())); + } + + @Override + protected void drawGuiContainerForegroundLayer(final int par1, final int par2) { + this.drawString(this.fontRendererObj,"L.E.S.U.", 11, 8, 16448255); + if (this.mContainer != null) { + String percell = String.valueOf(c.energyPerCell).substring(1); + this.drawString(this.fontRendererObj,"EU: " + String.valueOf(this.mContainer.mEnergy), 11, 16, 16448255); + this.drawString(this.fontRendererObj,"MAX: " + (this.c.getBaseMetaTileEntity().isActive() ? String.valueOf(this.mContainer.mOutput)+ percell : Integer.toString(0)), 11, 24, 16448255); + this.drawString(this.fontRendererObj,"MAX EU/t IN: " + String.valueOf(this.mContainer.mInput), 11, 32, 16448255); + this.drawString(this.fontRendererObj,"EU/t OUT: " + String.valueOf(this.mContainer.mOutput), 11, 40, 16448255); + this.drawString(this.fontRendererObj,"AMP/t IN/OUT: " + String.valueOf(c.getBaseMetaTileEntity().getInputAmperage()), 11, 48, 16448255); + if (c.maxEUStore() >= Long.MAX_VALUE-1) { + this.drawString(this.fontRendererObj, "Maximum Capacity!", 11, 56, Color.YELLOW.getRGB()); + } + if (!this.c.getBaseMetaTileEntity().isActive()) { + this.drawString(this.fontRendererObj,"Multiple Controllers!", 11, 56, Color.RED.getRGB()); + } + } + } + + @Override + protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + final int x = (this.width - this.xSize) / 2; + final int y = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); + if (this.mContainer != null) { + final long tScale = this.mContainer.mEnergy / Math.max(1, c.maxEUStore() / 116); + this.drawTexturedModalRect(x + 8, y + 73, 0, 251, (int) tScale, 5); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java new file mode 100644 index 0000000000..e1dbebf049 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java @@ -0,0 +1,31 @@ +package com.github.bartimaeusnek.bartworks.common; + + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import gregtech.api.enums.GT_Values; +import net.minecraftforge.common.config.Configuration; + +import java.io.File; + +public class ConfigHandler { + public static int IDOffset = 12500; + public static final int IDU=1+ GT_Values.VN.length; + public static boolean ezmode = false; + public static boolean teslastaff = false; + public final Configuration c; + public ConfigHandler(FMLPreInitializationEvent e){ + c = new Configuration(new File(e.getModConfigurationDirectory().toString()+"/"+MainMod.modID+".cfg")); + + IDOffset=c.get("System","ID Offset",12500,"ID Offset for this mod. This Mod uses "+IDU+" IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12500); + GT_TileEntity_LESU.energyPerCell=c.get("Multiblocks","energyPerLESUCell",1000000,"This will set Up the Energy per LESU Cell",1000000,Integer.MAX_VALUE).getInt(1000000); + ezmode=c.get("System","Mode switch",false,"If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false); + MainMod.GTNH = ezmode ? !MainMod.GTNH : MainMod.GTNH; + teslastaff=c.get("System","Enable Teslastaff",false,"Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); + + if (c.hasChanged()) + c.save(); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java new file mode 100644 index 0000000000..983ec42653 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java @@ -0,0 +1,63 @@ +package com.github.bartimaeusnek.bartworks.common.blocks; + +import com.github.bartimaeusnek.bartworks.MainMod; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +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 java.util.List; + +public class BW_Blocks extends Block { + + public BW_Blocks(String name, String[] texture) { + super(Material.anvil); + this.setHardness(15.0F); + this.setResistance(30.0F); + this.name = name; + this.textureNames=texture; + this.setCreativeTab(MainMod.GT2); + } + + @SideOnly(Side.CLIENT) + private IIcon[] texture; + private String[] textureNames; + private String name; + + @Override + public int damageDropped(final int meta) { + return meta; + } + + @Override + public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) { + for (int i = 0; i < textureNames.length; i ++) { + list.add(new ItemStack(item, 1, i)); + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + return meta < texture.length ? texture[meta] : texture[0]; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister){ + texture = new IIcon[textureNames.length]; + for (int i = 0; i < textureNames.length; i++) { + texture[i] = par1IconRegister.registerIcon(textureNames[i]); + } + } + + @Override + public String getUnlocalizedName(){ + return name; + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java new file mode 100644 index 0000000000..959a67014e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -0,0 +1,60 @@ +package com.github.bartimaeusnek.bartworks.common.items; + +import com.github.bartimaeusnek.bartworks.MainMod; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.util.GT_LanguageManager; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +import java.util.List; + +public class BW_ItemBlocks extends ItemBlock { + + public BW_ItemBlocks(final Block par1){ + super(par1); + this.setMaxDamage(0); + this.setHasSubtypes(true); + this.setCreativeTab(MainMod.GT2); + } + + protected final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + protected final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + + @Override + public int getMetadata(final int aMeta) { + return aMeta; + } + + @Override + public String getUnlocalizedName(final ItemStack aStack) { + return this.field_150939_a.getUnlocalizedName() + "." + this.getDamage(aStack); + } + + @Override + public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { + aList.add(this.mNoMobsToolTip); + aList.add(this.mNoTileEntityToolTip); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(ItemStack stack, int pass) { + return this.field_150939_a.getIcon(0,stack.getItemDamage()); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { + return getIcon(stack, renderPass); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) { + return this.field_150939_a.getIcon(0,p_77618_2_); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java new file mode 100644 index 0000000000..3747bb2141 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -0,0 +1,35 @@ +package com.github.bartimaeusnek.bartworks.common.items; + +import com.github.bartimaeusnek.bartworks.MainMod; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.items.GT_Generic_Item; +import gregtech.api.util.GT_Config; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import sun.applet.Main; + +public class GT_Destructopack_Item extends GT_Generic_Item +{ + + public GT_Destructopack_Item() { + super("GT2Destructopack","Destructopack","Mobile Trash Bin"); + this.setMaxStackSize(1); + this.setNoRepair(); + this.setHasSubtypes(false); + this.setCreativeTab(MainMod.GT2); + } + + @Override + public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { + aPlayer.openGui(MainMod.instance, 0, aWorld, 0, 0, 0); + return aStack; + } + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aIconRegister) { + this.mIcon = aIconRegister.registerIcon("bartworks:gt.GT2Destructopack"); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java new file mode 100644 index 0000000000..7e4ef6c05c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -0,0 +1,145 @@ +package com.github.bartimaeusnek.bartworks.common.items; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.google.common.collect.Sets; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import ic2.api.item.ElectricItem; +import ic2.api.item.IElectricItem; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +public class GT_Rockcutter_Item extends ItemTool implements IElectricItem +{ + @SideOnly(Side.CLIENT) + private IIcon icon; + + public int mCharge; + public int mTransfer; + public int mTier; + public static Set mineableBlocks = Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); + private int multi; + public GT_Rockcutter_Item(int aTier) { + super(2*aTier, ToolMaterial.EMERALD, mineableBlocks); + this.mTier = aTier; + multi = (int) Math.pow(10,(mTier-1)); + this.mineableBlocks = new HashSet(); + this.maxStackSize=1; + this.mCharge = 10000 * multi; + this.mTransfer = (int) GT_Values.V[mTier]; + this.efficiencyOnProperMaterial = 2.0f*mTier; + this.setCreativeTab(MainMod.GT2); + this.setMaxDamage(27+ 10*multi); + this.setNoRepair(); + this.setUnlocalizedName("GT_Rockcutter_Item_"+ GT_Values.VN[mTier]); + } + + public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { + aList.add("Tier: " + GT_Values.VN[this.mTier]); + } + + public void onUpdate(ItemStack aStack, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { + if (!ElectricItem.manager.canUse(aStack, 500*multi)) { + if (aStack.isItemEnchanted()) { + aStack.getTagCompound().removeTag("ench"); + } + } + else if (!aStack.isItemEnchanted()) { + aStack.addEnchantment(Enchantment.silkTouch,3); + } + } + + public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + ElectricItem.manager.use(aStack, 0, aPlayer); + return false; + } + + public boolean onBlockDestroyed(final ItemStack var1, final World var2, final Block var3, final int var4, final int var5, final int var6, final EntityLivingBase var7) { + ElectricItem.manager.use(var1, 0, var7); + if (ElectricItem.manager.canUse(var1, 500*multi)) { + ElectricItem.manager.use(var1, 500*multi, var7); + } + else{ + ElectricItem.manager.discharge(var1, Integer.MAX_VALUE, Integer.MAX_VALUE, true,true, false); + } + return true; + } + + @Override + public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) { + return par1Block.getMaterial().equals(Material.glass) || par1Block.getMaterial().equals(Material.clay) || par1Block.getMaterial().equals(Material.packedIce) || par1Block.getMaterial().equals(Material.ice) || par1Block.getMaterial().equals(Material.sand) || par1Block.getMaterial().equals(Material.ground) || par1Block.getMaterial().equals(Material.rock) || this.mineableBlocks.contains(par1Block); + } + + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { + ItemStack itemStack = new ItemStack(this, 1); + if (getChargedItem(itemStack) == this) { + ItemStack charged = new ItemStack(this, 1); + ElectricItem.manager.charge(charged, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false); + itemList.add(charged); + } + if (getEmptyItem(itemStack) == this) { + itemList.add(new ItemStack(this, 1, getMaxDamage())); + } + } + + + @Override + public boolean canProvideEnergy(ItemStack itemStack) { + return false; + } + + @Override + public Item getChargedItem(ItemStack itemStack) { + return this; + } + + @Override + public Item getEmptyItem(ItemStack itemStack) { + return this; + } + + @Override + public double getMaxCharge(ItemStack itemStack) { + return this.mCharge; + } + + @Override + public int getTier(ItemStack itemStack) { + return this.mTier; + } + + @Override + public double getTransferLimit(ItemStack itemStack) { + return this.mTransfer; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + this.icon = iconRegister.registerIcon("bartworks:GT_Rockcutter"); + } + + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) { + return this.icon; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java new file mode 100644 index 0000000000..addc694783 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -0,0 +1,122 @@ +package com.github.bartimaeusnek.bartworks.common.items; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.google.common.collect.Sets; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import ic2.api.item.ElectricItem; +import ic2.api.item.IElectricItem; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.util.IIcon; + +import java.util.List; +import java.util.Set; + +public class GT_Teslastaff_Item extends ItemTool implements ic2.api.item.IElectricItem +{ + public double mCharge; + public double mTransfer; + public int mTier; + private static Set effective = Sets.newHashSet(Blocks.web); + + @SideOnly(Side.CLIENT) + private IIcon icon; + + public GT_Teslastaff_Item() { + super(0, ToolMaterial.GOLD, effective); + this.setCreativeTab(MainMod.GT2); + this.setNoRepair(); + this.mCharge = 10000000D; + this.mTransfer = 8192D; + this.mTier = 4; + this.setMaxStackSize(1); + this.setMaxDamage(27); + this.setUnlocalizedName("GT_Teslastaff_Item"); + } + + @Override + public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { + aList.add("No warranty!"); + } + + public boolean hitEntity(ItemStack aStack, EntityLivingBase aTarget, EntityLivingBase aPlayer) { + if (aTarget instanceof EntityLiving && ElectricItem.manager.canUse(aStack, 9000000)) { + final EntityLiving tTarget = (EntityLiving)aTarget; + final EntityLivingBase tPlayer = (EntityLivingBase)aPlayer; + ElectricItem.manager.use(aStack, 9000000, tPlayer); + for (int i = 1; i < 5; ++i) { + if (tTarget.getEquipmentInSlot(i) != null && tTarget.getEquipmentInSlot(i).getItem() instanceof IElectricItem) { + tTarget.setCurrentItemOrArmor(i,null); + } + } + } + return true; + } + + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { + ItemStack itemStack = new ItemStack(this, 1); + if (getChargedItem(itemStack) == this) { + ItemStack charged = new ItemStack(this, 1); + ElectricItem.manager.charge(charged, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false); + itemList.add(charged); + } + if (getEmptyItem(itemStack) == this) { + itemList.add(new ItemStack(this, 1, getMaxDamage())); + } + } + + @Override + public boolean canProvideEnergy(ItemStack itemStack) { + return false; + } + + @Override + public Item getChargedItem(ItemStack itemStack) { + return this; + } + + @Override + public Item getEmptyItem(ItemStack itemStack) { + return this; + } + + @Override + public double getMaxCharge(ItemStack itemStack) { + return this.mCharge; + } + + @Override + public boolean isRepairable() { + return false; + } + + @Override + public int getTier(ItemStack itemStack) { + return this.mTier; + } + + @Override + public double getTransferLimit(ItemStack itemStack) { + return this.mTransfer; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + this.icon = iconRegister.registerIcon("bartworks:GT_Teslastaff"); + } + + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) { + return this.icon; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java new file mode 100644 index 0000000000..41b72f6369 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java @@ -0,0 +1,21 @@ +package com.github.bartimaeusnek.bartworks.common.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.Item; + +public class SimpleIconItem extends Item { + + String tex; + + public SimpleIconItem(String tex){ + super(); + this.tex=tex; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + itemIcon=iconRegister.registerIcon("bartworks:"+tex); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java new file mode 100644 index 0000000000..0ceeb19d1c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -0,0 +1,48 @@ +package com.github.bartimaeusnek.bartworks.common.loaders; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; +import com.github.bartimaeusnek.bartworks.common.items.*; +import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraft.block.Block; +import net.minecraft.item.Item; + +public class ItemRegistry implements Runnable { + + public static final Item Destructopack = new GT_Destructopack_Item(); + public static final Item Teslastaff = new GT_Teslastaff_Item(); + public static final Item RockcutterLV = new GT_Rockcutter_Item(1); + public static final Item RockcutterMV = new GT_Rockcutter_Item(2); + public static final Item RockcutterHV = new GT_Rockcutter_Item(3); + public static final Item tab = new SimpleIconItem("GT2Coin"); + public static final Block[] BW_BLOCKS = { + new BW_Blocks("BW_ItemBlocks", new String[] + { + MainMod.modID+":EtchedLapisCell", + MainMod.modID+":PlatedLapisCell", + }), + + new BW_Blocks("GT_LESU_CASING", new String[]{ + MainMod.modID+":LESU_CELL", + }), + + }; + + + @Override + public void run() { + + GameRegistry.registerBlock(BW_BLOCKS[0], BW_ItemBlocks.class,"BW_ItemBlocks"); + + GameRegistry.registerBlock(BW_BLOCKS[1],BW_ItemBlocks.class,"GT_LESU_CASING"); + + if (ConfigHandler.teslastaff) + GameRegistry.registerItem(Teslastaff,Teslastaff.getUnlocalizedName()); + + GameRegistry.registerItem(RockcutterLV,RockcutterLV.getUnlocalizedName()); + GameRegistry.registerItem(RockcutterMV,RockcutterMV.getUnlocalizedName()); + GameRegistry.registerItem(RockcutterHV,RockcutterHV.getUnlocalizedName()); + GameRegistry.registerItem(tab,"tabIconGT2"); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java new file mode 100644 index 0000000000..199f4068bf --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java @@ -0,0 +1,14 @@ +package com.github.bartimaeusnek.bartworks.common.loaders; + +public class LoaderRegistry implements Runnable { + public ItemRegistry items = new ItemRegistry(); + public RecipeLoader recipes = new RecipeLoader(); + + @Override + public void run() { + items.run(); + recipes.run(); + } + + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java new file mode 100644 index 0000000000..dc7a7acda8 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -0,0 +1,149 @@ +package com.github.bartimaeusnek.bartworks.common.loaders; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_EnergyDistributor; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; + +public class RecipeLoader implements Runnable { + + private final static long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE; + + @Override + public void run() { + + if(MainMod.GTNH) { + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(Blocks.lapis_block),Materials.Iron.getMolten(1296L),new ItemStack(ItemRegistry.BW_BLOCKS[0],1,0),100,(int) (GT_Values.V[3]-(GT_Values.V[3]/10))); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0],1,0), Materials.Lapis.getPlates(9), GT_OreDictUnificator.get(OrePrefixes.circuit,Materials.Advanced,2L), GT_Utility.getIntegratedCircuit(17)}, FluidRegistry.getFluidStack("ic2coolant",1000),new ItemStack(ItemRegistry.BW_BLOCKS[0],1,1),100,(int) (GT_Values.V[3]-(GT_Values.V[3]/10))); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0],1,1), Materials.Lapis.getBlocks(8), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]),100,(int) (GT_Values.V[3]-(GT_Values.V[3]/10))); + } + else { + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{Materials.Lapis.getBlocks(8), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100,(int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.BW_BLOCKS[1]), + bitsd, + new Object[]{ + "LLL", + "LCL", + "LLL", + 'L', Materials.Lapis.getBlocks(1), + 'C', "circuitBasic" + }); + + GT_Values.RA.addCutterRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[1]),new ItemStack(ItemRegistry.BW_BLOCKS[0],9,1),GT_Values.NI,100,(int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); + GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0],9,1),new ItemStack(ItemRegistry.BW_BLOCKS[1]),100,(int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); + GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0],9,0),new ItemStack(ItemRegistry.BW_BLOCKS[1]),100,(int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); + GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0],1,0),bitsd,new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0],1,1)}); + GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0],1,1),bitsd,new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0],1,0)}); + } + + GT_ModHandler.addCraftingRecipe( + new GT_TileEntity_LESU(ConfigHandler.IDOffset,"LESU","LESU").getStackForm(1L), + bitsd, + new Object[]{ + "CDC", + "SBS", + "CFC", + 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, MainMod.GTNH ? Materials.Advanced : Materials.Basic,1L), + 'D', ItemList.Cover_Screen.get(1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.cableGt12, MainMod.GTNH ? Materials.Platinum : Materials.AnnealedCopper,1L), + 'B', new ItemStack(ItemRegistry.BW_BLOCKS[1]), + 'F', MainMod.GTNH ? ItemList.Field_Generator_HV.get(1L) : ItemList.Field_Generator_LV.get(1L) + }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.Destructopack), + bitsd, + new Object[]{ + "CPC", + "PLP", + "CPC", + 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced,1L), + 'P', GT_OreDictUnificator.get(MainMod.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, Materials.Aluminium,1L), + 'L', new ItemStack(Items.lava_bucket) + }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.Destructopack), + bitsd, + new Object[]{ + "CPC", + "PLP", + "CPC", + 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced,1L), + 'P', GT_OreDictUnificator.get(MainMod.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, MainMod.GTNH ? Materials.Steel : Materials.Iron,1L), + 'L', new ItemStack(Items.lava_bucket) + }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.RockcutterMV), + bitsd, + new Object[]{ + "DS ", + "DP ", + "DCB", + 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond,1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.stick,Materials.TungstenSteel,1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate,Materials.TungstenSteel,1L), + 'C', "circuitGood", + 'B', ItemList.IC2_AdvBattery.get(1L) + }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.RockcutterLV), + bitsd, + new Object[]{ + "DS ", + "DP ", + "DCB", + 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond,1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.stick,Materials.Titanium,1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate,Materials.Titanium,1L), + 'C', "circuitBasic", + 'B', ItemList.IC2_ReBattery.get(1L) + }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.RockcutterHV), + bitsd, + new Object[]{ + "DS ", + "DP ", + "DCB", + 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond,1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.stick,Materials.Iridium,1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate,Materials.Iridium,1L), + 'C', "circuitAdvanced", + 'B', ItemList.IC2_EnergyCrystal.get(1L) + }); + + if (ConfigHandler.teslastaff) + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.Teslastaff), + bitsd, + new Object[]{ + "BO ", + "OP ", + " P", + 'O', GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Superconductor,1L), + 'B', ItemList.Energy_LapotronicOrb.get(1L), + 'P', "plateAlloyIridium", + }); + + for (int i = 0; i < GT_Values.VN.length; i++) { + new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset+1+i,"Energy Distributor "+GT_Values.VN[i], "Energy Distributor "+GT_Values.VN[i], i, "Splits Amperage into several Sides"); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java new file mode 100644 index 0000000000..fd5e1a60bb --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java @@ -0,0 +1,53 @@ +package com.github.bartimaeusnek.bartworks.common.tileentities; + +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Transformer; + +public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Transformer { + + public GT_MetaTileEntity_EnergyDistributor(int aID, String aName, String aNameRegional, int aTier, String aDescription) { + super(aID, aName, aNameRegional, aTier, aDescription); + } + + public GT_MetaTileEntity_EnergyDistributor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + public GT_MetaTileEntity_EnergyDistributor(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_EnergyDistributor(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + + public long maxEUInput() { + return GT_Values.V[this.mTier]; + } + + public long maxEUOutput() { + return GT_Values.V[this.mTier]; + } + + public long maxAmperesOut() { + return 64*5; + } + + public long maxAmperesIn() { + return 256; + } + + @Override + public long maxEUStore() { + return 512L + (GT_Values.V[this.mTier ] * 256L); + } + + public String[] getDescription() { + return new String[] {mDescription,"Voltage: "+ ChatColorHelper.YELLOW +GT_Values.V[this.mTier],"Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(),"Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut()}; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java new file mode 100644 index 0000000000..f4dca5cb4c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java @@ -0,0 +1,403 @@ +package com.github.bartimaeusnek.bartworks.common.tileentities; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_LESU; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.server.container.GT_Container_LESU; +import com.github.bartimaeusnek.bartworks.util.ConnectedBlocksChecker; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + + +public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { + + @SideOnly(Side.CLIENT) + static IIcon[] iIcons = new IIcon[4]; + @SideOnly(Side.CLIENT) + static IIconContainer[] iIconContainers = new IIconContainer[4]; + @SideOnly(Side.CLIENT) + static ITexture[][] iTextures = new ITexture[4][1]; + @SideOnly(Side.CLIENT) + static final byte TEXID_SIDE = 0; + @SideOnly(Side.CLIENT) + static final byte TEXID_CHARGING = 1; + @SideOnly(Side.CLIENT) + static final byte TEXID_IDLE = 2; + @SideOnly(Side.CLIENT) + static final byte TEXID_EMPTY = 3; + + public static long energyPerCell = 100000L; + + private long mStorage; + public ConnectedBlocksChecker connectedcells; + public ItemStack[] circuits = new ItemStack[5]; + + public GT_TileEntity_LESU(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + this.mStorage = energyPerCell; + } + + public GT_TileEntity_LESU(String aName){ + super(aName); + } + + + @Override + public boolean isEnetOutput() { + return true; + } + + @Override + public boolean isEnetInput() { + return true; + } + + @Override + public long maxEUStore() { + return (this.mStorage >= Long.MAX_VALUE-1 || this.mStorage < 0) ? Long.MAX_VALUE-1 : this.mStorage; + } + + @Override + public long maxAmperesIn() { + int ret = 0; + for (int i = 0 ; i < 5; ++i) + if (this.circuits[i] != null && this.circuits[i].getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) + ret += this.circuits[i].getItemDamage(); + return ret > 0 ? ret : 1; + } + + @Override + public long maxAmperesOut() { + return maxAmperesIn(); + } + + @Override + public long maxEUInput() { + + for (int i = 1; i < GT_Values.V.length; i++) { + if (maxEUOutput() <= GT_Values.V[i] && maxEUOutput() > GT_Values.V[i-1]) + return Math.min(GT_Values.V[i],32768L); + } + + return 8; + } + + @Override + public long maxEUOutput() { + return Math.min(Math.max(this.mStorage / energyPerCell, 1L), 32768L); + } + + @Override + public int rechargerSlotStartIndex() { + return 0; + } + + @Override + public int rechargerSlotCount() { + return 1; + } + + @Override + public int dechargerSlotStartIndex() { + return 1; + } + + @Override + public int dechargerSlotCount() { + return 1; + } + + @Override + public boolean isTeleporterCompatible() { + return true; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_LESU(mName); + } + + @Override + public String[] getDescription() { + return new String[]{ + + }; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + for (int i = 0; i < iTextures.length; i++) { + iIcons[i]=aBlockIconRegister.registerIcon(MainMod.modID+":LESU_CASING_"+i); + final int finalI = i; + iIconContainers[i]=new IIconContainer() { + @Override + public IIcon getIcon() { + return iIcons[finalI]; + } + + @Override + public IIcon getOverlayIcon() { + return iIcons[finalI]; + } + + @Override + public ResourceLocation getTextureFile() { + return new ResourceLocation(MainMod.modID+":LESU_CASING_"+ finalI); + } + }; + } + + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_LESU(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_LESU(aPlayerInventory, aBaseMetaTileEntity); + } + + public boolean isServerSide() { + return !isClientSide(); + } + + public boolean isClientSide() { + if (getWorld() != null) + return getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; + return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; + } + + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + + ITexture[] ret = new ITexture[0]; + + if(this.isClientSide()) { + for (int i = 0; i < iTextures.length; i++) { + iTextures[i][0] = new GT_RenderedTexture(iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); + } + + if (aSide == aFacing && this.getBaseMetaTileEntity().getUniversalEnergyStored() <= 0) + ret = iTextures[TEXID_EMPTY]; + else if (aSide == aFacing && !aActive) + ret = iTextures[TEXID_IDLE]; + else if (aSide == aFacing && aActive) + ret = iTextures[TEXID_CHARGING]; + else + ret = iTextures[TEXID_SIDE]; + } + + return ret; + } + + @Override + public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) { + return true; + } + + @Override + public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) { + return true; + } + + @Override + public int getSizeInventory() { + return 6; + } + + @Override + public ItemStack getStackInSlot(int p_70301_1_) { + if (p_70301_1_ > 1) + return this.circuits[(p_70301_1_-2)]; + return this.mInventory[p_70301_1_]; + } + + @Override + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + if (p_70299_1_ < 2) + this.mInventory[p_70299_1_]=p_70299_2_; + else + this.circuits[(p_70299_1_-2)]=p_70299_2_; + } + + @Override + public String getInventoryName() { + return "L.E.S.U."; + } + + @Override + public boolean hasCustomInventoryName() { + return true; + } + + @Override + public int getInventoryStackLimit() { + return 1; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return true; + } + + @Override + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + + switch (p_94041_1_){ + case 0: case 1: + return true; + default: + return p_94041_2_.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); + } + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + return true; + } + + @Override + public boolean isInputFacing(byte aSide) { + return aSide != this.getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public boolean isOutputFacing(byte aSide) { + return aSide == this.getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + checkMachine(aBaseMetaTileEntity, null); + super.onFirstTick(aBaseMetaTileEntity); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + this.mMaxProgresstime = 1; + if (aTick % 20 == 0) + checkMachine(aBaseMetaTileEntity, null); + this.mWrench = true; + this.mScrewdriver = true; + this.mSoftHammer = true; + this.mHardHammer = true; + this.mSolderingTool = true; + this.mCrowbar = true; + } + } + + @Override + public long getMinimumStoredEU() { + return 0; + } + + @Override + public boolean onRunningTick(ItemStack aStack){ + this.mMaxProgresstime=1; + + return true; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setIntArray("customCircuitInv",GT_Utility.stacksToIntArray(this.circuits)); + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + int[] stacks = aNBT.getIntArray("customCircuitInv"); + for (int i = 0; i < stacks.length ; i++) { + this.circuits[i]=GT_Utility.intToStack(stacks[i]); + } + super.loadNBTData(aNBT); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + connectedcells = new ConnectedBlocksChecker(); + connectedcells.get_connected(aBaseMetaTileEntity.getWorld(),aBaseMetaTileEntity.getXCoord(),aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord(), ItemRegistry.BW_BLOCKS[1]); + + if (connectedcells.get_meta_of_sideblocks(aBaseMetaTileEntity.getWorld(),this.getBaseMetaTileEntity().getMetaTileID(),new int[]{aBaseMetaTileEntity.getXCoord(),aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord()},true)) + { + this.getBaseMetaTileEntity().disableWorking(); + this.getBaseMetaTileEntity().setActive(false); + this.mStorage=0; + this.mMaxProgresstime=0; + this.mProgresstime=0; + return false; + } + + this.mEfficiency=this.getMaxEfficiency(null); + this.mStorage=(energyPerCell * connectedcells.hashset.size() >= Long.MAX_VALUE-1 || energyPerCell * connectedcells.hashset.size() < 0) ? Long.MAX_VALUE-1 : energyPerCell * connectedcells.hashset.size() ; + this.mMaxProgresstime=1; + this.mProgresstime=0; + + this.mCrowbar=true; + this.mHardHammer=true; + this.mScrewdriver=true; + this.mSoftHammer=true; + this.mSolderingTool=true; + this.mWrench=true; + + this.getBaseMetaTileEntity().enableWorking(); + this.getBaseMetaTileEntity().setActive(true); + + return true; + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + public World getWorld() { + return this.getBaseMetaTileEntity().getWorld(); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java new file mode 100644 index 0000000000..0de2b8b98f --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java @@ -0,0 +1,58 @@ +package com.github.bartimaeusnek.bartworks.server.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class GT_Container_Item_Destructopack extends Container { + + public GT_Container_Item_Destructopack(InventoryPlayer inventory) { + + addSlotToContainer(new delslot()); + + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 9; j++) { + addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + for (int i = 0; i < 9; i++) { + addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); + } + } + @Override + public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int aSlotIndex) { + final Slot slotObject = (Slot) this.inventorySlots.get(aSlotIndex); + slotObject.putStack(null); + return null; + } + + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return true; + } + @Override + public void onCraftMatrixChanged(IInventory p_75130_1_) + { + final Slot slotObject = (Slot) this.inventorySlots.get(0); + slotObject.decrStackSize(0); + } + + + class delslot extends Slot{ + public delslot() + { + super(new InventoryPlayer(null), 0, 80, 17); + } + + public void putStack(ItemStack p_75215_1_) + { + p_75215_1_=null; + this.onSlotChanged(); + } + + + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java new file mode 100644 index 0000000000..8b91ccf315 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java @@ -0,0 +1,37 @@ +package com.github.bartimaeusnek.bartworks.server.container; + +import gregtech.api.gui.GT_Container_MultiMachine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class GT_Container_LESU extends GT_Container_MultiMachine { + + public GT_Container_LESU(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + public GT_Container_LESU(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, boolean bindInventory) { + super(aInventoryPlayer, aTileEntity, bindInventory); + } + + public void addSlots(InventoryPlayer aInventoryPlayer) { + this.addSlotToContainer(new Slot(this.mTileEntity, 1, 128, 14)); + this.addSlotToContainer(new Slot(this.mTileEntity, 0, 128, 50)); + this.addSlotToContainer(new Slot(this.mTileEntity, 2, 152, 5)); + this.addSlotToContainer(new Slot(this.mTileEntity, 3, 152, 23)); + this.addSlotToContainer(new Slot(this.mTileEntity, 4, 152, 41)); + this.addSlotToContainer(new Slot(this.mTileEntity, 5, 152, 59)); + } + + public int getSlotCount() { + return 6; + } + + public int getShiftClickSlotCount() { + return 6; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java new file mode 100644 index 0000000000..456a98cf76 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java @@ -0,0 +1,27 @@ +package com.github.bartimaeusnek.bartworks.util; + +public class ChatColorHelper { + + public static final String BLACK = (char) 167 + "0"; + public static final String DARKBLUE = (char) 167 + "1"; + public static final String DARKGREEN = (char) 167 + "2"; + public static final String DARKAQUA = (char) 167 + "3"; + public static final String DARKRED = (char) 167 + "4"; + public static final String DARKPURPLE = (char) 167 + "5"; + public static final String GOLD = (char) 167 + "6"; + public static final String GRAY = (char) 167 + "7"; + public static final String DARKGRAY = (char) 167 + "8"; + public static final String BLUE = (char) 167 + "9"; + public static final String GREEN = (char) 167 + "a"; + public static final String AQUA = (char) 167 + "b"; + public static final String RED = (char) 167 + "c"; + public static final String LIGHT_PURPLE = (char) 167 + "d"; + public static final String YELLOW = (char) 167 + "e"; + public static final String WHITE = (char) 167 + "f"; + public static final String OBFUSCATED = (char) 167 + "k"; + public static final String BOLD = (char) 167 + "l"; + public static final String STRIKETHROUGH = (char) 167 + "m"; + public static final String UNDERLINE = (char) 167 + "n"; + public static final String ITALIC = (char) 167 + "o"; + public static final String RESET = (char) 167 + "r"; +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java new file mode 100644 index 0000000000..71a158463c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java @@ -0,0 +1,171 @@ +package com.github.bartimaeusnek.bartworks.util; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.block.Block; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +import java.util.HashSet; +import java.util.Objects; + +public class ConnectedBlocksChecker { + + public final HashSet hashset = new HashSet(); + + public int get_connected(World w, int x, int y, int z, Block b){ + int ret = 0; + + byte sides = check_sourroundings(w, x, y, z, b); + + if (((sides | 0b111110) == 0b111111) && !hashset.contains(new Coords(x,y+1,z))) { + ret++; + ret += get_connected(w, x, y + 1, z,b); + } + + if (( (sides | 0b111101) == 0b111111) && !hashset.contains(new Coords(x,y-1,z))) { + ret++; + ret += get_connected(w, x, y - 1, z,b); + } + + if (( (sides | 0b111011) == 0b111111) && !hashset.contains(new Coords(x+1,y,z))) { + ret++; + ret += get_connected(w, x+1, y, z,b); + } + + if (( (sides | 0b110111) == 0b111111) && !hashset.contains(new Coords(x-1,y,z))) { + ret++; + ret += get_connected(w, x-1, y, z,b); + } + + if (( (sides | 0b101111) == 0b111111) && !hashset.contains(new Coords(x,y,z+1))) { + ret++; + ret += get_connected(w, x, y, z+1,b); + } + + if (( (sides | 0b011111) == 0b111111) && !hashset.contains(new Coords(x,y,z-1))) { + ret++; + ret += get_connected(w, x, y, z-1,b); + } + + return ret; + } + + + public byte check_sourroundings(World w, int x, int y, int z,Block b){ + + byte ret = 0; + + if (hashset.contains(new Coords(x,y,z))) + return ret; + + hashset.add(new Coords(x,y,z)); + + if (w.getBlock(x,y+1,z).equals(b)) + ret = (byte) (ret | 0b000001); + + if (w.getBlock(x,y-1,z).equals(b)) + ret = (byte) (ret | 0b000010); + + if (w.getBlock(x+1,y,z).equals(b)) + ret = (byte) (ret | 0b000100); + + if (w.getBlock(x-1,y,z).equals(b)) + ret = (byte) (ret | 0b001000); + + if (w.getBlock(x,y,z+1).equals(b)) + ret = (byte) (ret | 0b010000); + + if (w.getBlock(x,y,z-1).equals(b)) + ret = (byte) (ret | 0b100000); + + return ret; + } + + public boolean get_meta_of_sideblocks(World w, int n, int[] xyz, boolean GT){ + + Coords Controller = new Coords(xyz[0],xyz[1],xyz[2]); + + for (Coords C : hashset){ + if (GT) { + TileEntity t; + t = w.getTileEntity(C.x, C.y + 1, C.z); + if (t != null && !new Coords(C.x, C.y + 1, C.z).equals(Controller)) { + if (t instanceof IGregTechTileEntity) + if (((IGregTechTileEntity) t).getMetaTileID() == n) + return true; + } + t = w.getTileEntity(C.x, C.y - 1, C.z); + if (t != null && !new Coords(C.x, C.y - 1, C.z).equals(Controller)) { + if (t instanceof IGregTechTileEntity) + if (((IGregTechTileEntity) t).getMetaTileID() == n) + return true; + } + t = w.getTileEntity(C.x + 1, C.y, C.z); + if (t != null && !new Coords(C.x + 1, C.y, C.z).equals(Controller)) { + if (t instanceof IGregTechTileEntity) + if (((IGregTechTileEntity) t).getMetaTileID() == n) + return true; + } + t = w.getTileEntity(C.x - 1, C.y, C.z); + if (t != null && !new Coords(C.x - 1, C.y, C.z).equals(Controller)) { + if (t instanceof IGregTechTileEntity) + if (((IGregTechTileEntity) t).getMetaTileID() == n) + return true; + } + t = w.getTileEntity(C.x, C.y, C.z + 1); + if (t != null && !new Coords(C.x, C.y, C.z + 1).equals(Controller)) { + if (t instanceof IGregTechTileEntity) + if (((IGregTechTileEntity) t).getMetaTileID() == n) + return true; + } + t = w.getTileEntity(C.x, C.y, C.z - 1); + if (t != null && !new Coords(C.x, C.y, C.z - 1).equals(Controller)) { + if (t instanceof IGregTechTileEntity) + if (((IGregTechTileEntity) t).getMetaTileID() == n) + return true; + } + }else { + if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) && !new Coords(C.x, C.y + 1, C.z).equals(Controller)) + return true; + if (n == w.getBlockMetadata(C.x, C.y - 1, C.z) && !new Coords(C.x, C.y - 1, C.z).equals(Controller)) + return true; + if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) && !new Coords(C.x + 1, C.y, C.z).equals(Controller)) + return true; + if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) && !new Coords(C.x - 1, C.y, C.z).equals(Controller)) + return true; + if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) && !new Coords(C.x, C.y, C.z + 1).equals(Controller)) + return true; + if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) && !new Coords(C.x, C.y, C.z - 1).equals(Controller)) + return true; + } + } + return false; + } + + + class Coords { + + public int x,y,z; + + public Coords(int x, int y, int z){ + this.x=x; + this.y=y; + this.z=z; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Coords coords = (Coords) o; + return x == coords.x && + y == coords.y && + z == coords.z; + } + + @Override + public int hashCode() { + return Objects.hash(x, y, z); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java new file mode 100644 index 0000000000..2b634986d2 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java @@ -0,0 +1,30 @@ +package com.github.bartimaeusnek.bartworks.util; + +import codechicken.nei.api.API; +import codechicken.nei.api.IConfigureNEI; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import cpw.mods.fml.common.Optional; +import net.minecraft.item.ItemStack; + +@Optional.Interface(iface = "codechicken.nei.api.API", modid = "NotEnoughItems") +public class NEIbartworksConfig implements IConfigureNEI { + + @Optional.Method(modid="NotEnoughItems") + @Override + public String getName() { + return MainMod.name; + } + + @Optional.Method(modid="NotEnoughItems") + @Override + public String getVersion() { + return MainMod.version; + } + + @Optional.Method(modid="NotEnoughItems") + @Override + public void loadConfig() { + API.hideItem(new ItemStack(ItemRegistry.tab)); + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang new file mode 100644 index 0000000000..ebb7c3ff15 --- /dev/null +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -0,0 +1,8 @@ +item.GT_Rockcutter_Item_LV.name=Rockcutter LV +item.GT_Rockcutter_Item_MV.name=Rockcutter MV +item.GT_Rockcutter_Item_HV.name=Rockcutter HV +item.GT_Teslastaff_Item.name=Teslastaff +BW_ItemBlocks.0.name=Etched Lapis Cell +BW_ItemBlocks.1.name=Plated Lapis Cell +GT_LESU_CASING.0.name=LESU Casing +itemGroup.GT2C=Gregtech 2 Compat diff --git a/src/main/resources/assets/bartworks/textures/GT2/gui/Destructopack.png b/src/main/resources/assets/bartworks/textures/GT2/gui/Destructopack.png new file mode 100644 index 0000000000..b4a5e95cfe Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GT2/gui/Destructopack.png differ diff --git a/src/main/resources/assets/bartworks/textures/GT2/gui/LESU.png b/src/main/resources/assets/bartworks/textures/GT2/gui/LESU.png new file mode 100644 index 0000000000..d295b015f6 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GT2/gui/LESU.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/EtchedLapisCell.png b/src/main/resources/assets/bartworks/textures/blocks/EtchedLapisCell.png new file mode 100644 index 0000000000..8922a3d4e2 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/EtchedLapisCell.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/LESU_CASING_0.png b/src/main/resources/assets/bartworks/textures/blocks/LESU_CASING_0.png new file mode 100644 index 0000000000..0fd516231e Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/LESU_CASING_0.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/LESU_CASING_1.png b/src/main/resources/assets/bartworks/textures/blocks/LESU_CASING_1.png new file mode 100644 index 0000000000..acdb3b4e6a Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/LESU_CASING_1.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/LESU_CASING_2.png b/src/main/resources/assets/bartworks/textures/blocks/LESU_CASING_2.png new file mode 100644 index 0000000000..1feeb1fd92 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/LESU_CASING_2.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/LESU_CASING_3.png b/src/main/resources/assets/bartworks/textures/blocks/LESU_CASING_3.png new file mode 100644 index 0000000000..c6de6719e9 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/LESU_CASING_3.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/LESU_CELL.png b/src/main/resources/assets/bartworks/textures/blocks/LESU_CELL.png new file mode 100644 index 0000000000..f41b59f820 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/LESU_CELL.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/PlatedLapisCell.png b/src/main/resources/assets/bartworks/textures/blocks/PlatedLapisCell.png new file mode 100644 index 0000000000..336a7a5b4e Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/PlatedLapisCell.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/GT2Coin.png b/src/main/resources/assets/bartworks/textures/items/GT2Coin.png new file mode 100644 index 0000000000..c590469aed Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/GT2Coin.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/GT_Rockcutter.png b/src/main/resources/assets/bartworks/textures/items/GT_Rockcutter.png new file mode 100644 index 0000000000..b04bb30f5c Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/GT_Rockcutter.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/GT_Teslastaff.png b/src/main/resources/assets/bartworks/textures/items/GT_Teslastaff.png new file mode 100644 index 0000000000..fd8185056b Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/GT_Teslastaff.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/gt.GT2Destructopack.png b/src/main/resources/assets/bartworks/textures/items/gt.GT2Destructopack.png new file mode 100644 index 0000000000..6de5748e32 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/gt.GT2Destructopack.png differ diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info new file mode 100644 index 0000000000..6d2fc25463 --- /dev/null +++ b/src/main/resources/mcmod.info @@ -0,0 +1,16 @@ +[ +{ + "modid": "bartworks", + "name": "BartWorks", + "description": "A Gregtech Addon.", + "version": "${version}", + "mcversion": "${mcversion}", + "url": "", + "updateUrl": "", + "authorList": ["bartimaeusnek"], + "credits": "Gregorius Techneticies for making gregtech and allowing me to port his old stuff.", + "logoFile": "", + "screenshots": [], + "dependencies": [] +} +] -- cgit From 44f6b8316644d6d4c1289d737c01978aacd74879 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 17 Sep 2018 00:35:47 +0200 Subject: fixed ID range added EnergyDistributor Recipe --- ID Range.txt | 6 ++-- .../github/bartimaeusnek/bartworks/MainMod.java | 9 ----- .../client/gui/GT_GUIContainer_Destructopack.java | 1 - .../bartworks/client/gui/GT_GUIContainer_LESU.java | 1 - .../bartworks/common/ConfigHandler.java | 4 +-- .../common/items/GT_Destructopack_Item.java | 3 -- .../bartworks/common/items/GT_Rockcutter_Item.java | 1 - .../bartworks/common/items/GT_Teslastaff_Item.java | 1 - .../bartworks/common/loaders/RecipeLoader.java | 38 ++++++++++++++++++++-- .../common/tileentities/GT_TileEntity_LESU.java | 3 -- .../server/container/GT_Container_LESU.java | 2 -- 11 files changed, 41 insertions(+), 28 deletions(-) diff --git a/ID Range.txt b/ID Range.txt index 07d3e9079a..264b4c9661 100644 --- a/ID Range.txt +++ b/ID Range.txt @@ -1,6 +1,6 @@ -12500-13000 +12501-13000 -12500-12600 are occupied by Crops++ +12501-12600 are occupied by Crops++ 12900-13000 are occupied by EMT -12600-12700 are aviable for bartworks \ No newline at end of file +12600-12900 are aviable for bartworks \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 8e7bb21122..2c431d3d1d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -1,16 +1,9 @@ package com.github.bartimaeusnek.bartworks; -import codechicken.nei.NEIActions; -import codechicken.nei.NEIClientUtils; -import codechicken.nei.NEIServerUtils; -import codechicken.nei.asm.NEICorePlugin; import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; import com.github.bartimaeusnek.bartworks.common.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_EnergyDistributor; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -18,8 +11,6 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; -import gregtech.api.enums.GT_Values; -import gregtech.nei.NEI_GT_Config; import net.minecraft.creativetab.CreativeTabs; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java index 4946bdb328..68e2516979 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java @@ -5,7 +5,6 @@ import com.github.bartimaeusnek.bartworks.server.container.GT_Container_Item_Des import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java index 574bc89536..89198f35d3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -3,7 +3,6 @@ package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_LESU; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.gui.GT_GUIContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.client.Minecraft; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java index e1dbebf049..45cfd43cbb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java @@ -10,7 +10,7 @@ import net.minecraftforge.common.config.Configuration; import java.io.File; public class ConfigHandler { - public static int IDOffset = 12500; + public static int IDOffset = 12600; public static final int IDU=1+ GT_Values.VN.length; public static boolean ezmode = false; public static boolean teslastaff = false; @@ -18,7 +18,7 @@ public class ConfigHandler { public ConfigHandler(FMLPreInitializationEvent e){ c = new Configuration(new File(e.getModConfigurationDirectory().toString()+"/"+MainMod.modID+".cfg")); - IDOffset=c.get("System","ID Offset",12500,"ID Offset for this mod. This Mod uses "+IDU+" IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12500); + IDOffset=c.get("System","ID Offset",12600,"ID Offset for this mod. This Mod uses "+IDU+" IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600); GT_TileEntity_LESU.energyPerCell=c.get("Multiblocks","energyPerLESUCell",1000000,"This will set Up the Energy per LESU Cell",1000000,Integer.MAX_VALUE).getInt(1000000); ezmode=c.get("System","Mode switch",false,"If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false); MainMod.GTNH = ezmode ? !MainMod.GTNH : MainMod.GTNH; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java index 3747bb2141..f3976ad979 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -4,13 +4,10 @@ import com.github.bartimaeusnek.bartworks.MainMod; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.items.GT_Generic_Item; -import gregtech.api.util.GT_Config; import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import sun.applet.Main; public class GT_Destructopack_Item extends GT_Generic_Item { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index 7e4ef6c05c..939659c332 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -4,7 +4,6 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.google.common.collect.Sets; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java index addc694783..b1fc581475 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -4,7 +4,6 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.google.common.collect.Sets; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; import net.minecraft.client.renderer.texture.IIconRegister; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index dc7a7acda8..50de3bd0f0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -24,11 +24,20 @@ public class RecipeLoader implements Runnable { public void run() { if(MainMod.GTNH) { + /* + * GTNH "hardmode" Recipes + */ + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(Blocks.lapis_block),Materials.Iron.getMolten(1296L),new ItemStack(ItemRegistry.BW_BLOCKS[0],1,0),100,(int) (GT_Values.V[3]-(GT_Values.V[3]/10))); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0],1,0), Materials.Lapis.getPlates(9), GT_OreDictUnificator.get(OrePrefixes.circuit,Materials.Advanced,2L), GT_Utility.getIntegratedCircuit(17)}, FluidRegistry.getFluidStack("ic2coolant",1000),new ItemStack(ItemRegistry.BW_BLOCKS[0],1,1),100,(int) (GT_Values.V[3]-(GT_Values.V[3]/10))); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0],1,1), Materials.Lapis.getBlocks(8), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]),100,(int) (GT_Values.V[3]-(GT_Values.V[3]/10))); } else { + /* + * Vanilla Recipes + */ + + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{Materials.Lapis.getBlocks(8), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100,(int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); GT_ModHandler.addCraftingRecipe( @@ -49,6 +58,10 @@ public class RecipeLoader implements Runnable { GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0],1,1),bitsd,new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0],1,0)}); } + /* + * Common Recipes + */ + GT_ModHandler.addCraftingRecipe( new GT_TileEntity_LESU(ConfigHandler.IDOffset,"LESU","LESU").getStackForm(1L), bitsd, @@ -142,8 +155,29 @@ public class RecipeLoader implements Runnable { 'P', "plateAlloyIridium", }); + + Materials[] cables = {Materials.Lead, Materials.Tin,Materials.AnnealedCopper,Materials.Gold,Materials.Aluminium,Materials.Tungsten, Materials.VanadiumGallium,Materials.Naquadah, Materials.Naquadah, Materials.Superconductor}; + Materials[] hulls = {Materials.WroughtIron, Materials.Steel,Materials.Aluminium,Materials.StainlessSteel,Materials.Titanium,Materials.TungstenSteel, Materials.Chrome,Materials.Iridium, Materials.Osmium, Materials.NaquadahAlloy}; + for (int i = 0; i < GT_Values.VN.length; i++) { - new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset+1+i,"Energy Distributor "+GT_Values.VN[i], "Energy Distributor "+GT_Values.VN[i], i, "Splits Amperage into several Sides"); + try{ + Materials cable = cables[i]; + Materials hull = hulls[i]; + ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); + GT_ModHandler.addCraftingRecipe( + new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset+1+i,"Energy Distributor "+GT_Values.VN[i], "Energy Distributor "+GT_Values.VN[i], i, "Splits Amperage into several Sides").getStackForm(1L), + bitsd, + new Object[]{ + "PWP", + "WCW", + "PWP", + 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16,cable,1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), + 'C', machinehull + }); + }catch(ArrayIndexOutOfBoundsException e){ + //e.printStackTrace(); + } + } } - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java index f4dca5cb4c..0441e7ebce 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java @@ -18,11 +18,8 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IIcon; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java index 8b91ccf315..3e28f36d0b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java @@ -2,10 +2,8 @@ package com.github.bartimaeusnek.bartworks.server.container; import gregtech.api.gui.GT_Container_MultiMachine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; public class GT_Container_LESU extends GT_Container_MultiMachine { -- cgit From be890c12a3bf60ef8d7802064f9602cb58b06f79 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 17 Sep 2018 03:21:06 +0200 Subject: added description for the LESU fixed derps --- .../bartimaeusnek/bartworks/common/loaders/RecipeLoader.java | 10 +++++----- .../tileentities/GT_MetaTileEntity_EnergyDistributor.java | 6 +++--- .../bartworks/common/tileentities/GT_TileEntity_LESU.java | 12 +++++++++++- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 50de3bd0f0..54bcf4fe5c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -156,15 +156,15 @@ public class RecipeLoader implements Runnable { }); - Materials[] cables = {Materials.Lead, Materials.Tin,Materials.AnnealedCopper,Materials.Gold,Materials.Aluminium,Materials.Tungsten, Materials.VanadiumGallium,Materials.Naquadah, Materials.Naquadah, Materials.Superconductor}; - Materials[] hulls = {Materials.WroughtIron, Materials.Steel,Materials.Aluminium,Materials.StainlessSteel,Materials.Titanium,Materials.TungstenSteel, Materials.Chrome,Materials.Iridium, Materials.Osmium, Materials.NaquadahAlloy}; + Materials[] cables = {Materials.Lead, Materials.Tin,Materials.AnnealedCopper,Materials.Gold,Materials.Aluminium,Materials.Tungsten, Materials.VanadiumGallium,Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; + Materials[] hulls = {Materials.WroughtIron, Materials.Steel,Materials.Aluminium,Materials.StainlessSteel,Materials.Titanium,Materials.TungstenSteel, Materials.Chrome,Materials.Iridium, Materials.Osmium, Materials.Naquadah}; for (int i = 0; i < GT_Values.VN.length; i++) { try{ Materials cable = cables[i]; Materials hull = hulls[i]; ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); - GT_ModHandler.addCraftingRecipe( + GT_ModHandler.addCraftingRecipe( new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset+1+i,"Energy Distributor "+GT_Values.VN[i], "Energy Distributor "+GT_Values.VN[i], i, "Splits Amperage into several Sides").getStackForm(1L), bitsd, new Object[]{ @@ -175,8 +175,8 @@ public class RecipeLoader implements Runnable { 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), 'C', machinehull }); - }catch(ArrayIndexOutOfBoundsException e){ - //e.printStackTrace(); + }catch(ArrayIndexOutOfBoundsException e){ + //e.printStackTrace(); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java index fd5e1a60bb..a122310393 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java @@ -34,16 +34,16 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans } public long maxAmperesOut() { - return 64*5; + return 320; } public long maxAmperesIn() { - return 256; + return 320; } @Override public long maxEUStore() { - return 512L + (GT_Values.V[this.mTier ] * 256L); + return 512L + (GT_Values.V[this.mTier ] * 320L); } public String[] getDescription() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java index 0441e7ebce..ef60d24828 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java @@ -2,8 +2,10 @@ package com.github.bartimaeusnek.bartworks.common.tileentities; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_LESU; +import com.github.bartimaeusnek.bartworks.common.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_LESU; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.ConnectedBlocksChecker; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; @@ -138,7 +140,15 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public String[] getDescription() { return new String[]{ - + "Controller Block for the GT2-Styled L.E.S.U.", + "Size: ANY", + "Storage per LESU Casing: " + this.energyPerCell+"EU", + "Output EU: LESU Casings amount"+ + "Input EU: Next Voltage Tier to Output EU", + "Input/Output Amps can be configured via 4 Circuits in GUI", + "Output Side has a dot on it.", + ChatColorHelper.RED+"Only one Controller allowed, no Wallsharing!", + "Added by bartimaeusnek via BartWorks" }; } -- cgit From 55e33d2071504bc7bcdfdaef638dc96e4d4ca970 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 24 Nov 2018 18:37:20 +0100 Subject: Update #3 +added Diode +added WiP stuff --- .gitignore | 7 + build.gradle | 8 +- gradle/wrapper/gradle-wrapper.properties | 6 + .../github/bartimaeusnek/bartworks/MainMod.java | 11 ++ .../client/creativetabs/bartworksTab.java | 18 ++ .../bartworks/common/blocks/BW_Blocks.java | 8 + .../bartworks/common/loaders/ItemRegistry.java | 27 ++- .../bartworks/common/loaders/RecipeLoader.java | 139 ++++++++++++++ .../tileentities/GT_MetaTileEntity_Diode.java | 40 +++++ .../GT_MetaTileEntity_EnergyDistributor.java | 2 +- .../common/tileentities/GT_TileEntity_DEHP.java | 65 +++++++ .../tileentities/GT_TileEntity_ManualTrafo.java | 200 +++++++++++++++++++++ 12 files changed, 523 insertions(+), 8 deletions(-) create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java diff --git a/.gitignore b/.gitignore index 5f699efc89..181e20b1b3 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,13 @@ *.zip *.tar.gz *.rar +*.bin +*.lock + # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* +/eclipse +/build +/out +/.gradle \ No newline at end of file diff --git a/build.gradle b/build.gradle index 21d3faeed4..c20193c1ec 100644 --- a/build.gradle +++ b/build.gradle @@ -70,10 +70,10 @@ dependencies { // mustRunAfter "repackMinecraft" //} -tasks.setupCIWorkspace.dependsOn getGregTech -tasks.setupDevWorkspace.dependsOn getGregTech -tasks.setupDecompWorkspace.dependsOn getGregTech -tasks.compileJava.dependsOn getGregTech +//tasks.setupCIWorkspace.dependsOn getGregTech +//tasks.setupDevWorkspace.dependsOn getGregTech +//tasks.setupDecompWorkspace.dependsOn getGregTech +//tasks.compileJava.dependsOn getGregTech processResources { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..daad77681b --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Jul 02 15:54:47 CDT 2014 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 2c431d3d1d..cb5ab327f3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -2,6 +2,7 @@ package com.github.bartimaeusnek.bartworks; import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; +import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab; import com.github.bartimaeusnek.bartworks.common.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; import cpw.mods.fml.common.Loader; @@ -11,10 +12,16 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; + @Mod( modid = MainMod.modID, name = MainMod.name, version = MainMod.version, dependencies = "required-after:IC2; " @@ -27,6 +34,7 @@ public final class MainMod { public static final Logger logger = LogManager.getLogger(name); public static boolean GTNH = false; public static final CreativeTabs GT2 = new GT2Tab("GT2C"); + public static final CreativeTabs BWT = new bartworksTab("bartworks"); public static final IGuiHandler GH = new GuiHandler(); @Mod.Instance(modID) public static MainMod instance; @@ -50,6 +58,9 @@ public final class MainMod { @Mod.EventHandler public void postInit(FMLPostInitializationEvent postinit) { NetworkRegistry.INSTANCE.registerGuiHandler(instance,GH); + + + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java new file mode 100644 index 0000000000..30449b88de --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java @@ -0,0 +1,18 @@ +package com.github.bartimaeusnek.bartworks.client.creativetabs; + +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; + +public class bartworksTab extends CreativeTabs { + + public bartworksTab (String lable) { + super(lable); + } + + @Override + public Item getTabIconItem() { + return ItemRegistry.RockcutterHV; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java index 983ec42653..a838e52125 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java @@ -23,6 +23,14 @@ public class BW_Blocks extends Block { this.textureNames=texture; this.setCreativeTab(MainMod.GT2); } + public BW_Blocks(String name, String[] texture, CreativeTabs tabs) { + super(Material.anvil); + this.setHardness(15.0F); + this.setResistance(30.0F); + this.name = name; + this.textureNames=texture; + this.setCreativeTab(tabs); + } @SideOnly(Side.CLIENT) private IIcon[] texture; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 0ceeb19d1c..ea3d2f27f7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -5,8 +5,16 @@ import com.github.bartimaeusnek.bartworks.common.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; import com.github.bartimaeusnek.bartworks.common.items.*; import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.block.Block; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +import static com.github.bartimaeusnek.bartworks.MainMod.BWT; +import static com.github.bartimaeusnek.bartworks.MainMod.GT2; public class ItemRegistry implements Runnable { @@ -15,17 +23,28 @@ public class ItemRegistry implements Runnable { public static final Item RockcutterLV = new GT_Rockcutter_Item(1); public static final Item RockcutterMV = new GT_Rockcutter_Item(2); public static final Item RockcutterHV = new GT_Rockcutter_Item(3); + public static ItemStack[] Diode2A= new ItemStack[GT_Values.VN.length]; + public static ItemStack[] Diode4A= new ItemStack[GT_Values.VN.length]; + public static ItemStack[] Diode8A= new ItemStack[GT_Values.VN.length]; + public static ItemStack[] Diode12A= new ItemStack[GT_Values.VN.length]; + public static ItemStack[] Diode16A= new ItemStack[GT_Values.VN.length]; public static final Item tab = new SimpleIconItem("GT2Coin"); public static final Block[] BW_BLOCKS = { new BW_Blocks("BW_ItemBlocks", new String[] { MainMod.modID+":EtchedLapisCell", MainMod.modID+":PlatedLapisCell", - }), + },GT2), new BW_Blocks("GT_LESU_CASING", new String[]{ MainMod.modID+":LESU_CELL", - }), + },GT2), + new BW_Blocks("BW_Machinery_Casings",new String[]{ + MainMod.modID+":NickelFerriteBlocks", + MainMod.modID+":TransformerCoil", + MainMod.modID+":DEHP_Casing", + MainMod.modID+":DEHP_Casing_Base" + },BWT), }; @@ -34,8 +53,10 @@ public class ItemRegistry implements Runnable { public void run() { GameRegistry.registerBlock(BW_BLOCKS[0], BW_ItemBlocks.class,"BW_ItemBlocks"); + GameRegistry.registerBlock(BW_BLOCKS[1], BW_ItemBlocks.class,"GT_LESU_CASING"); + GameRegistry.registerBlock(BW_BLOCKS[2], BW_ItemBlocks.class,"BW_Machinery_Casings"); - GameRegistry.registerBlock(BW_BLOCKS[1],BW_ItemBlocks.class,"GT_LESU_CASING"); + GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite,new ItemStack(BW_BLOCKS[2])); if (ConfigHandler.teslastaff) GameRegistry.registerItem(Teslastaff,Teslastaff.getUnlocalizedName()); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 54bcf4fe5c..b7a992f2e5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -2,8 +2,10 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_Diode; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_EnergyDistributor; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_ManualTrafo; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -164,6 +166,7 @@ public class RecipeLoader implements Runnable { Materials cable = cables[i]; Materials hull = hulls[i]; ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); + GT_ModHandler.addCraftingRecipe( new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset+1+i,"Energy Distributor "+GT_Values.VN[i], "Energy Distributor "+GT_Values.VN[i], i, "Splits Amperage into several Sides").getStackForm(1L), bitsd, @@ -175,9 +178,145 @@ public class RecipeLoader implements Runnable { 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), 'C', machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode12A[i]=new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset+GT_Values.VN.length*4+1+i,"Cable Diode 12A "+GT_Values.VN[i], "Cable Diode 12A "+GT_Values.VN[i], i,12).getStackForm(1L), + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_Diode.get(1L,ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12,cable,1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode12A[i], + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L,ItemList.Circuit_Parts_Diode.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12,cable,1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode8A[i]=new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset+GT_Values.VN.length*3+1+i,"Cable Diode 8A "+GT_Values.VN[i], "Cable Diode 8A "+GT_Values.VN[i], i,8).getStackForm(1L), + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_Diode.get(1L,ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08,cable,1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode8A[i], + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L,ItemList.Circuit_Parts_Diode.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08,cable,1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode4A[i]=new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset+GT_Values.VN.length*2+1+i,"Cable Diode 4A "+GT_Values.VN[i], "Cable Diode 4A "+GT_Values.VN[i], i,4).getStackForm(1L), + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_Diode.get(1L,ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04,cable,1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode4A[i], + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L,ItemList.Circuit_Parts_Diode.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04,cable,1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode2A[i]=new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset+GT_Values.VN.length+1+i,"Cable Diode 2A "+GT_Values.VN[i], "Cable Diode 2A "+GT_Values.VN[i], i,2).getStackForm(1L), + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_Diode.get(1L,ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02,cable,1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode2A[i], + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L,ItemList.Circuit_Parts_Diode.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02,cable,1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode16A[i]=new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset+GT_Values.VN.length*5+5+i,"Cable Diode 16A "+GT_Values.VN[i], "Cable Diode 16A "+GT_Values.VN[i], i,16).getStackForm(1L), + bitsd, + new Object[]{ + "WHW", + "DCD", + "PDP", + 'H', ItemList.Circuit_Parts_Coil.get(1L), + 'D', ItemList.Circuit_Parts_Diode.get(1L,ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16,cable,1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode16A[i], + bitsd, + new Object[]{ + "WHW", + "DCD", + "PDP", + 'H', ItemList.Circuit_Parts_Coil.get(1L), + 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L,ItemList.Circuit_Parts_Diode.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16,cable,1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), + 'C', machinehull + } + ); + }catch(ArrayIndexOutOfBoundsException e){ //e.printStackTrace(); } } + + new GT_TileEntity_ManualTrafo(ConfigHandler.IDOffset+GT_Values.VN.length*6+1,"ManualTravo","ManualTravo"); + //current ID: ConfigHandler.IDOffset+GT_Values.VN.length*6+1 } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java new file mode 100644 index 0000000000..0ad4ec3142 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java @@ -0,0 +1,40 @@ +package com.github.bartimaeusnek.bartworks.common.tileentities; + +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull; + +public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { + + private long amps; + + public GT_MetaTileEntity_Diode(int aID, String aName, String aNameRegional, int aTier, int amps) { + super(aID, aName, aNameRegional, aTier, "A Simple diode that will allow Energy Flow in only one direction.", null); + this.amps=amps; + } + + public GT_MetaTileEntity_Diode(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aInvSlotCount, aDescription, aTextures); + } + + @Override + public long maxAmperesOut() { + return amps; + } + + @Override + public long maxAmperesIn() { + return amps; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Diode(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); + } + public String[] getDescription() { + return new String[] {mDescription,"Voltage: "+ ChatColorHelper.YELLOW + GT_Values.V[this.mTier],"Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(),"Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via BartWorks"}; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java index a122310393..239484460e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java @@ -47,7 +47,7 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans } public String[] getDescription() { - return new String[] {mDescription,"Voltage: "+ ChatColorHelper.YELLOW +GT_Values.V[this.mTier],"Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(),"Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut()}; + return new String[] {mDescription,"Voltage: "+ ChatColorHelper.YELLOW +GT_Values.V[this.mTier],"Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(),"Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java new file mode 100644 index 0000000000..150678ea23 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java @@ -0,0 +1,65 @@ +package com.github.bartimaeusnek.bartworks.common.tileentities; + +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { + + public GT_TileEntity_DEHP(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_DEHP(String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return null; + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "DrillingRig.png"); + } + + @Override + public String[] getDescription() { + return new String[0]; + } + + @Override + protected ItemList getCasingBlockItem() { + return null; + } + + @Override + protected Materials getFrameMaterial() { + return null; + } + + @Override + protected int getCasingTextureIndex() { + return 0; + } + + @Override + protected int getMinTier() { + return 0; + } + + @Override + protected boolean checkHatches() { + return false; + } + + @Override + protected void setElectricityStats() { + + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java new file mode 100644 index 0000000000..2c0c255ce8 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java @@ -0,0 +1,200 @@ +package com.github.bartimaeusnek.bartworks.common.tileentities; + +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + +import static gregtech.api.enums.GT_Values.V; + +public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase { + + private byte texid = 2; + private long mCoilWicks = 0; + private boolean upstep = true; + + public GT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_ManualTrafo(String aName) { + super(aName); + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return false; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity,aTick); + } + + @Override + public boolean onRunningTick(ItemStack aStack){ + if (this.mEfficiency < this.getMaxEfficiency(null)) + this.mEfficiency += 100; + else + this.mEfficiency = this.getMaxEfficiency(null); + + return this.drainEnergyInput((long)this.mEUt * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput((long)this.mEUt * 2 * this.mEnergyHatches.size() * (long)this.mEfficiency / 10000L); + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + this.upstep= !(this.mInventory[1] != null && this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")); + this.mMaxProgresstime=1; + this.mProgresstime=0; + this.mEfficiency=1000; + this.mEUt= (int) V[this.mEnergyHatches.get(0).mTier]; + return this.upstep ? this.getOutputTier() - this.getInputTier() == mCoilWicks : this.getInputTier() - this.getOutputTier() == mCoilWicks; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + + //check height + int y = 1; + boolean stillcoil = true; + while (stillcoil) { + for (int x = -1; x <= 1; ++x) { + for (int z = -1; z <= 1; ++z) { + if (x != 0 || z != 0) { + stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; + if (stillcoil) { + if (mCoilWicks != 0 && mCoilWicks % 8 == 0) { + ++y; + continue; + } + this.mCoilWicks++; + } else + break; + } + } + if (!stillcoil) + break; + } + } + if (mCoilWicks % 8 != 0) + return false; + + this.mCoilWicks = this.mCoilWicks / 8; + + //check interior (NiFeZn02 Core) + for (int i = 1; i <= this.mCoilWicks; ++i) { + if (!aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir) == 0) { + return false; + } + } + + //check Bottom + for (int x = -1; x <= 1; ++x) + for (int z = -1; z <= 1; ++z) + if (xDir + x != 0 || zDir + z != 0) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { + return false; + } + /* + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { + return false; + } + */ + } + } + + //check Top + for (int x = -1; x <= 1; ++x) + for (int z = -1; z <= 1; ++z) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks+1, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addDynamoToMachineList(tTileEntity, texid)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks+1, zDir + z) != GregTech_API.sBlockCasings1) { + return false; + } + /* + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { + return false; + } + */ + } + } + + if (this.mDynamoHatches.size() <= 0 || this.mEnergyHatches.size() <= 0 || this.mDynamoHatches.size() > this.mEnergyHatches.size() ) + return false; + + // check dynamos and energy hatches for the same tier + byte outtier = this.mDynamoHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches){ + if (out.mTier!=outtier) + return false; + } + + byte intier = this.mEnergyHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches){ + if (in.mTier!=intier) + return false; + } + + return true; + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return true; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_ManualTrafo(mName); + } + + @Override + public String[] getDescription() { + return new String[]{"blalbabla"}; + } + + @Override + public void saveNBTData(NBTTagCompound ntag){ + ntag.setLong("mCoilWicks",mCoilWicks); + super.saveNBTData(ntag); + } + + @Override + public void loadNBTData(NBTTagCompound ntag){ + super.loadNBTData(ntag); + mCoilWicks = ntag.getLong("mCoilWicks"); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[texid], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[texid]}; + } +} -- cgit From c27b9a2f34029b6af977317688caef7a315625e7 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 16 Dec 2018 17:59:04 +0100 Subject: Version 0.1.0 out of Techdemo stage +Added all missing texts and textures +Added Circuit Programmer +Hopefully fixed the ManualTrafo in Single Modes --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/GuiHandler.java | 4 + .../github/bartimaeusnek/bartworks/MainMod.java | 4 +- .../gui/GT_GUIContainer_CircuitProgrammer.java | 23 ++ .../bartworks/client/gui/GT_GUIContainer_LESU.java | 3 +- .../bartworks/common/ConfigHandler.java | 7 +- .../bartworks/common/items/Circuit_Programmer.java | 90 +++++ .../common/items/GT_Destructopack_Item.java | 10 + .../bartworks/common/items/GT_Rockcutter_Item.java | 2 + .../bartworks/common/items/GT_Teslastaff_Item.java | 4 +- .../bartworks/common/loaders/ItemRegistry.java | 17 +- .../bartworks/common/loaders/RecipeLoader.java | 391 +++++++++++---------- .../tileentities/GT_MetaTileEntity_Diode.java | 2 +- .../GT_MetaTileEntity_EnergyDistributor.java | 2 +- .../common/tileentities/GT_TileEntity_DEHP.java | 14 +- .../common/tileentities/GT_TileEntity_LESU.java | 35 +- .../tileentities/GT_TileEntity_ManualTrafo.java | 351 ++++++++++++++---- .../container/GT_Container_CircuitProgrammer.java | 176 ++++++++++ .../resources/assets/bartworks/lang/en_US.lang | 3 + .../assets/bartworks/textures/GUI/GUI_CircuitP.png | Bin 0 -> 2856 bytes .../textures/blocks/NickelFerriteBlocks.png | Bin 0 -> 382 bytes .../bartworks/textures/blocks/TransformerCoil.png | Bin 0 -> 2415 bytes .../bartworks/textures/items/CircuitProgrammer.png | Bin 0 -> 253 bytes 23 files changed, 844 insertions(+), 296 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java create mode 100644 src/main/resources/assets/bartworks/textures/GUI/GUI_CircuitP.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/NickelFerriteBlocks.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/TransformerCoil.png create mode 100644 src/main/resources/assets/bartworks/textures/items/CircuitProgrammer.png diff --git a/build.properties b/build.properties index d52a4ddb8b..07ea335ab8 100644 --- a/build.properties +++ b/build.properties @@ -1,5 +1,5 @@ mc_version=1.7.10 -mod_version=0.0.1 +mod_version=0.1.0 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java index 1a19fa32d6..7d2f2d4628 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -1,6 +1,8 @@ package com.github.bartimaeusnek.bartworks; +import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_CircuitProgrammer; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_Destructopack; +import com.github.bartimaeusnek.bartworks.server.container.GT_Container_CircuitProgrammer; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_Item_Destructopack; import cpw.mods.fml.common.network.IGuiHandler; import net.minecraft.entity.player.EntityPlayer; @@ -12,6 +14,7 @@ public class GuiHandler implements IGuiHandler { public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch (ID){ case 0: return new GT_Container_Item_Destructopack(player.inventory); + case 1: return new GT_Container_CircuitProgrammer(player.inventory); } return null; } @@ -20,6 +23,7 @@ public class GuiHandler implements IGuiHandler { public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch (ID){ case 0: return new GT_GUIContainer_Destructopack(player.inventory); + case 1: return new GT_GUIContainer_CircuitProgrammer(player.inventory); } return null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index cb5ab327f3..a2fc611223 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -36,6 +36,7 @@ public final class MainMod { public static final CreativeTabs GT2 = new GT2Tab("GT2C"); public static final CreativeTabs BWT = new bartworksTab("bartworks"); public static final IGuiHandler GH = new GuiHandler(); + @Mod.Instance(modID) public static MainMod instance; public static ConfigHandler CHandler; @@ -58,9 +59,6 @@ public final class MainMod { @Mod.EventHandler public void postInit(FMLPostInitializationEvent postinit) { NetworkRegistry.INSTANCE.registerGuiHandler(instance,GH); - - - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java new file mode 100644 index 0000000000..d511369435 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java @@ -0,0 +1,23 @@ +package com.github.bartimaeusnek.bartworks.client.gui; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.server.container.GT_Container_CircuitProgrammer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class GT_GUIContainer_CircuitProgrammer extends GuiContainer { + + public GT_GUIContainer_CircuitProgrammer(InventoryPlayer p_i1072_1_) { + super(new GT_Container_CircuitProgrammer(p_i1072_1_)); + } + public static final ResourceLocation texture = new ResourceLocation(MainMod.modID, "textures/GUI/GUI_CircuitP.png"); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1F, 1F, 1F, 1F); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft-79, guiTop, 0, 0, 256, 165); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java index 89198f35d3..4a0b1ada5b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -1,6 +1,7 @@ package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_LESU; import gregtech.api.gui.GT_GUIContainer; @@ -29,7 +30,7 @@ public class GT_GUIContainer_LESU extends GT_GUIContainer { protected void drawGuiContainerForegroundLayer(final int par1, final int par2) { this.drawString(this.fontRendererObj,"L.E.S.U.", 11, 8, 16448255); if (this.mContainer != null) { - String percell = String.valueOf(c.energyPerCell).substring(1); + String percell = String.valueOf(ConfigHandler.energyPerCell).substring(1); this.drawString(this.fontRendererObj,"EU: " + String.valueOf(this.mContainer.mEnergy), 11, 16, 16448255); this.drawString(this.fontRendererObj,"MAX: " + (this.c.getBaseMetaTileEntity().isActive() ? String.valueOf(this.mContainer.mOutput)+ percell : Integer.toString(0)), 11, 24, 16448255); this.drawString(this.fontRendererObj,"MAX EU/t IN: " + String.valueOf(this.mContainer.mInput), 11, 32, 16448255); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java index 45cfd43cbb..33999f71d4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java @@ -2,7 +2,6 @@ package com.github.bartimaeusnek.bartworks.common; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import gregtech.api.enums.GT_Values; import net.minecraftforge.common.config.Configuration; @@ -14,18 +13,22 @@ public class ConfigHandler { public static final int IDU=1+ GT_Values.VN.length; public static boolean ezmode = false; public static boolean teslastaff = false; + public static long energyPerCell = 100000L; + public static boolean newStuff = true; public final Configuration c; public ConfigHandler(FMLPreInitializationEvent e){ c = new Configuration(new File(e.getModConfigurationDirectory().toString()+"/"+MainMod.modID+".cfg")); IDOffset=c.get("System","ID Offset",12600,"ID Offset for this mod. This Mod uses "+IDU+" IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600); - GT_TileEntity_LESU.energyPerCell=c.get("Multiblocks","energyPerLESUCell",1000000,"This will set Up the Energy per LESU Cell",1000000,Integer.MAX_VALUE).getInt(1000000); + energyPerCell=c.get("Multiblocks","energyPerLESUCell",1000000,"This will set Up the Energy per LESU Cell",1000000,Integer.MAX_VALUE).getInt(1000000); ezmode=c.get("System","Mode switch",false,"If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false); MainMod.GTNH = ezmode ? !MainMod.GTNH : MainMod.GTNH; teslastaff=c.get("System","Enable Teslastaff",false,"Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); + newStuff=!c.get("System","Disable non-original-GT-stuff",false,"This switch disables my new content, that is not part of the GT2 compat").getBoolean(false); if (c.hasChanged()) c.save(); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java new file mode 100644 index 0000000000..42167e7209 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -0,0 +1,90 @@ +package com.github.bartimaeusnek.bartworks.common.items; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.GT_Values; +import gregtech.api.items.GT_Generic_Item; +import ic2.api.item.ElectricItem; +import ic2.api.item.IElectricItem; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import java.util.List; + +public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem { + + public Circuit_Programmer() { + super("BWCircuitProgrammer","Circuit Programmer","Programs Integrated Circuits"); + this.setMaxStackSize(1); + this.setNoRepair(); + this.setHasSubtypes(false); + this.setCreativeTab(MainMod.BWT); + } + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + super.addInformation(aStack,aPlayer,aList,aF3_H); + aList.add("Has Circuit inside? "+ (aStack.getTagCompound().getBoolean("HasChip") ? "Yes" : "No")); + aList.add("Added by"+ ChatColorHelper.DARKGREEN +" BartWorks"); + } + + @Override + public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { + if (ElectricItem.manager.use(aStack,100,aPlayer)) { + aPlayer.openGui(MainMod.instance, 1, aWorld, 0, 0, 0); + } + return aStack; + } + + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { + ItemStack itemStack = new ItemStack(this, 1); + if (getChargedItem(itemStack) == this) { + ItemStack charged = new ItemStack(this, 1); + ElectricItem.manager.charge(charged, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false); + itemList.add(charged); + } + if (getEmptyItem(itemStack) == this) { + itemList.add(new ItemStack(this, 1, getMaxDamage())); + } + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aIconRegister) { + this.mIcon = aIconRegister.registerIcon("bartworks:CircuitProgrammer"); + } + public int getTier(ItemStack var1){ + return 1; + } + + @Override + public boolean canProvideEnergy(ItemStack itemStack) { + return false; + } + + @Override + public Item getChargedItem(ItemStack itemStack) { + return this; + } + + @Override + public Item getEmptyItem(ItemStack itemStack) { + return this; + } + + @Override + public double getMaxCharge(ItemStack itemStack) { + return 10000; + } + + @Override + public double getTransferLimit(ItemStack itemStack) { + return GT_Values.V[1]; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java index f3976ad979..88883a039c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -1,6 +1,7 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.items.GT_Generic_Item; @@ -9,6 +10,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import java.util.List; + public class GT_Destructopack_Item extends GT_Generic_Item { @@ -20,11 +23,18 @@ public class GT_Destructopack_Item extends GT_Generic_Item this.setCreativeTab(MainMod.GT2); } + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + super.addInformation(aStack,aPlayer,aList,aF3_H); + aList.add("Added by"+ ChatColorHelper.DARKGREEN +" BartWorks"); + } + @Override public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { aPlayer.openGui(MainMod.instance, 0, aWorld, 0, 0, 0); return aStack; } + @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aIconRegister) { this.mIcon = aIconRegister.registerIcon("bartworks:gt.GT2Destructopack"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index 939659c332..3148281c38 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -1,6 +1,7 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.google.common.collect.Sets; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -53,6 +54,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { aList.add("Tier: " + GT_Values.VN[this.mTier]); + aList.add("Added by"+ ChatColorHelper.DARKGREEN +" BartWorks"); } public void onUpdate(ItemStack aStack, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java index b1fc581475..59f8ac5835 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -1,6 +1,7 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.google.common.collect.Sets; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -20,7 +21,7 @@ import net.minecraft.util.IIcon; import java.util.List; import java.util.Set; -public class GT_Teslastaff_Item extends ItemTool implements ic2.api.item.IElectricItem +public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { public double mCharge; public double mTransfer; @@ -45,6 +46,7 @@ public class GT_Teslastaff_Item extends ItemTool implements ic2.api.item.IElectr @Override public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { aList.add("No warranty!"); + aList.add("Added by"+ ChatColorHelper.DARKGREEN +" BartWorks"); } public boolean hitEntity(ItemStack aStack, EntityLivingBase aTarget, EntityLivingBase aPlayer) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index ea3d2f27f7..11567daeee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -15,6 +15,7 @@ import net.minecraft.item.ItemStack; import static com.github.bartimaeusnek.bartworks.MainMod.BWT; import static com.github.bartimaeusnek.bartworks.MainMod.GT2; +import static com.github.bartimaeusnek.bartworks.common.ConfigHandler.newStuff; public class ItemRegistry implements Runnable { @@ -23,6 +24,7 @@ public class ItemRegistry implements Runnable { public static final Item RockcutterLV = new GT_Rockcutter_Item(1); public static final Item RockcutterMV = new GT_Rockcutter_Item(2); public static final Item RockcutterHV = new GT_Rockcutter_Item(3); + public static final Item CircuitProgrammer = new Circuit_Programmer(); public static ItemStack[] Diode2A= new ItemStack[GT_Values.VN.length]; public static ItemStack[] Diode4A= new ItemStack[GT_Values.VN.length]; public static ItemStack[] Diode8A= new ItemStack[GT_Values.VN.length]; @@ -42,8 +44,8 @@ public class ItemRegistry implements Runnable { new BW_Blocks("BW_Machinery_Casings",new String[]{ MainMod.modID+":NickelFerriteBlocks", MainMod.modID+":TransformerCoil", - MainMod.modID+":DEHP_Casing", - MainMod.modID+":DEHP_Casing_Base" + // MainMod.modID+":DEHP_Casing", + // MainMod.modID+":DEHP_Casing_Base" },BWT), }; @@ -52,12 +54,15 @@ public class ItemRegistry implements Runnable { @Override public void run() { - GameRegistry.registerBlock(BW_BLOCKS[0], BW_ItemBlocks.class,"BW_ItemBlocks"); - GameRegistry.registerBlock(BW_BLOCKS[1], BW_ItemBlocks.class,"GT_LESU_CASING"); - GameRegistry.registerBlock(BW_BLOCKS[2], BW_ItemBlocks.class,"BW_Machinery_Casings"); + if (newStuff) { + GameRegistry.registerBlock(BW_BLOCKS[2], BW_ItemBlocks.class, "BW_Machinery_Casings"); + GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(BW_BLOCKS[2])); + } - GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite,new ItemStack(BW_BLOCKS[2])); + //GT2 stuff + GameRegistry.registerBlock(BW_BLOCKS[0], BW_ItemBlocks.class,"BW_ItemBlocks"); + GameRegistry.registerBlock(BW_BLOCKS[1], BW_ItemBlocks.class,"GT_LESU_CASING"); if (ConfigHandler.teslastaff) GameRegistry.registerItem(Teslastaff,Teslastaff.getUnlocalizedName()); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index b7a992f2e5..9dd005076f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -2,6 +2,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.items.Circuit_Programmer; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_Diode; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_EnergyDistributor; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; @@ -18,6 +19,8 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; +import static com.github.bartimaeusnek.bartworks.common.ConfigHandler.newStuff; + public class RecipeLoader implements Runnable { private final static long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE; @@ -25,22 +28,21 @@ public class RecipeLoader implements Runnable { @Override public void run() { - if(MainMod.GTNH) { + if (MainMod.GTNH) { /* * GTNH "hardmode" Recipes */ - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(Blocks.lapis_block),Materials.Iron.getMolten(1296L),new ItemStack(ItemRegistry.BW_BLOCKS[0],1,0),100,(int) (GT_Values.V[3]-(GT_Values.V[3]/10))); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0],1,0), Materials.Lapis.getPlates(9), GT_OreDictUnificator.get(OrePrefixes.circuit,Materials.Advanced,2L), GT_Utility.getIntegratedCircuit(17)}, FluidRegistry.getFluidStack("ic2coolant",1000),new ItemStack(ItemRegistry.BW_BLOCKS[0],1,1),100,(int) (GT_Values.V[3]-(GT_Values.V[3]/10))); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0],1,1), Materials.Lapis.getBlocks(8), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]),100,(int) (GT_Values.V[3]-(GT_Values.V[3]/10))); - } - else { + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(Blocks.lapis_block), Materials.Iron.getMolten(1296L), new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), 100, (int) (GT_Values.V[3] - (GT_Values.V[3] / 10))); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), Materials.Lapis.getPlates(9), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2L), GT_Utility.getIntegratedCircuit(17)}, FluidRegistry.getFluidStack("ic2coolant", 1000), new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), 100, (int) (GT_Values.V[3] - (GT_Values.V[3] / 10))); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), Materials.Lapis.getBlocks(8), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, (int) (GT_Values.V[3] - (GT_Values.V[3] / 10))); + } else { /* * Vanilla Recipes */ - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{Materials.Lapis.getBlocks(8), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100,(int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{Materials.Lapis.getBlocks(8), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, (int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.BW_BLOCKS[1]), @@ -53,11 +55,11 @@ public class RecipeLoader implements Runnable { 'C', "circuitBasic" }); - GT_Values.RA.addCutterRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[1]),new ItemStack(ItemRegistry.BW_BLOCKS[0],9,1),GT_Values.NI,100,(int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); - GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0],9,1),new ItemStack(ItemRegistry.BW_BLOCKS[1]),100,(int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); - GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0],9,0),new ItemStack(ItemRegistry.BW_BLOCKS[1]),100,(int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); - GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0],1,0),bitsd,new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0],1,1)}); - GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0],1,1),bitsd,new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0],1,0)}); + GT_Values.RA.addCutterRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[1]), new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), GT_Values.NI, 100, (int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); + GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, (int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); + GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 0), new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, (int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); + GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), bitsd, new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1)}); + GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), bitsd, new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0)}); } /* @@ -65,15 +67,15 @@ public class RecipeLoader implements Runnable { */ GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_LESU(ConfigHandler.IDOffset,"LESU","LESU").getStackForm(1L), + new GT_TileEntity_LESU(ConfigHandler.IDOffset, "LESU", "LESU").getStackForm(1L), bitsd, new Object[]{ "CDC", "SBS", "CFC", - 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, MainMod.GTNH ? Materials.Advanced : Materials.Basic,1L), + 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, MainMod.GTNH ? Materials.Advanced : Materials.Basic, 1L), 'D', ItemList.Cover_Screen.get(1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.cableGt12, MainMod.GTNH ? Materials.Platinum : Materials.AnnealedCopper,1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.cableGt12, MainMod.GTNH ? Materials.Platinum : Materials.AnnealedCopper, 1L), 'B', new ItemStack(ItemRegistry.BW_BLOCKS[1]), 'F', MainMod.GTNH ? ItemList.Field_Generator_HV.get(1L) : ItemList.Field_Generator_LV.get(1L) }); @@ -85,8 +87,8 @@ public class RecipeLoader implements Runnable { "CPC", "PLP", "CPC", - 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced,1L), - 'P', GT_OreDictUnificator.get(MainMod.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, Materials.Aluminium,1L), + 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1L), + 'P', GT_OreDictUnificator.get(MainMod.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, Materials.Aluminium, 1L), 'L', new ItemStack(Items.lava_bucket) }); @@ -97,8 +99,8 @@ public class RecipeLoader implements Runnable { "CPC", "PLP", "CPC", - 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced,1L), - 'P', GT_OreDictUnificator.get(MainMod.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, MainMod.GTNH ? Materials.Steel : Materials.Iron,1L), + 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1L), + 'P', GT_OreDictUnificator.get(MainMod.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, MainMod.GTNH ? Materials.Steel : Materials.Iron, 1L), 'L', new ItemStack(Items.lava_bucket) }); @@ -109,9 +111,9 @@ public class RecipeLoader implements Runnable { "DS ", "DP ", "DCB", - 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond,1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.stick,Materials.TungstenSteel,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,Materials.TungstenSteel,1L), + 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.stick, Materials.TungstenSteel, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 1L), 'C', "circuitGood", 'B', ItemList.IC2_AdvBattery.get(1L) }); @@ -123,9 +125,9 @@ public class RecipeLoader implements Runnable { "DS ", "DP ", "DCB", - 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond,1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.stick,Materials.Titanium,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,Materials.Titanium,1L), + 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Titanium, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), 'C', "circuitBasic", 'B', ItemList.IC2_ReBattery.get(1L) }); @@ -137,9 +139,9 @@ public class RecipeLoader implements Runnable { "DS ", "DP ", "DCB", - 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond,1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.stick,Materials.Iridium,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,Materials.Iridium,1L), + 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Iridium, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), 'C', "circuitAdvanced", 'B', ItemList.IC2_EnergyCrystal.get(1L) }); @@ -152,171 +154,194 @@ public class RecipeLoader implements Runnable { "BO ", "OP ", " P", - 'O', GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Superconductor,1L), + 'O', GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Superconductor, 1L), 'B', ItemList.Energy_LapotronicOrb.get(1L), 'P', "plateAlloyIridium", }); + if (newStuff) { + Materials[] cables = {Materials.Lead, Materials.Tin, Materials.AnnealedCopper, Materials.Gold, Materials.Aluminium, Materials.Tungsten, Materials.VanadiumGallium, Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; + Materials[] hulls = {Materials.WroughtIron, Materials.Steel, Materials.Aluminium, Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, Materials.Chrome, Materials.Iridium, Materials.Osmium, Materials.Naquadah}; - Materials[] cables = {Materials.Lead, Materials.Tin,Materials.AnnealedCopper,Materials.Gold,Materials.Aluminium,Materials.Tungsten, Materials.VanadiumGallium,Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; - Materials[] hulls = {Materials.WroughtIron, Materials.Steel,Materials.Aluminium,Materials.StainlessSteel,Materials.Titanium,Materials.TungstenSteel, Materials.Chrome,Materials.Iridium, Materials.Osmium, Materials.Naquadah}; - - for (int i = 0; i < GT_Values.VN.length; i++) { - try{ - Materials cable = cables[i]; - Materials hull = hulls[i]; - ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); + for (int i = 0; i < GT_Values.VN.length; i++) { + try { + Materials cable = cables[i]; + Materials hull = hulls[i]; + ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); - GT_ModHandler.addCraftingRecipe( - new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset+1+i,"Energy Distributor "+GT_Values.VN[i], "Energy Distributor "+GT_Values.VN[i], i, "Splits Amperage into several Sides").getStackForm(1L), - bitsd, - new Object[]{ - "PWP", - "WCW", - "PWP", - 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode12A[i]=new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset+GT_Values.VN.length*4+1+i,"Cable Diode 12A "+GT_Values.VN[i], "Cable Diode 12A "+GT_Values.VN[i], i,12).getStackForm(1L), - bitsd, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_Diode.get(1L,ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode12A[i], - bitsd, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L,ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode8A[i]=new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset+GT_Values.VN.length*3+1+i,"Cable Diode 8A "+GT_Values.VN[i], "Cable Diode 8A "+GT_Values.VN[i], i,8).getStackForm(1L), - bitsd, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_Diode.get(1L,ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode8A[i], - bitsd, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L,ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode4A[i]=new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset+GT_Values.VN.length*2+1+i,"Cable Diode 4A "+GT_Values.VN[i], "Cable Diode 4A "+GT_Values.VN[i], i,4).getStackForm(1L), - bitsd, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_Diode.get(1L,ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode4A[i], - bitsd, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L,ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode2A[i]=new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset+GT_Values.VN.length+1+i,"Cable Diode 2A "+GT_Values.VN[i], "Cable Diode 2A "+GT_Values.VN[i], i,2).getStackForm(1L), - bitsd, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_Diode.get(1L,ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode2A[i], - bitsd, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L,ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode16A[i]=new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset+GT_Values.VN.length*5+5+i,"Cable Diode 16A "+GT_Values.VN[i], "Cable Diode 16A "+GT_Values.VN[i], i,16).getStackForm(1L), - bitsd, - new Object[]{ - "WHW", - "DCD", - "PDP", - 'H', ItemList.Circuit_Parts_Coil.get(1L), - 'D', ItemList.Circuit_Parts_Diode.get(1L,ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode16A[i], - bitsd, - new Object[]{ - "WHW", - "DCD", - "PDP", - 'H', ItemList.Circuit_Parts_Coil.get(1L), - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L,ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16,cable,1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate,hull,1L), - 'C', machinehull - } - ); + GT_ModHandler.addCraftingRecipe( + new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset + 1 + i, "Energy Distributor " + GT_Values.VN[i], "Energy Distributor " + GT_Values.VN[i], i, "Splits Amperage into several Sides").getStackForm(1L), + bitsd, + new Object[]{ + "PWP", + "WCW", + "PWP", + 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode12A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, "Cable Diode 12A " + GT_Values.VN[i], "Cable Diode 12A " + GT_Values.VN[i], i, 12).getStackForm(1L), + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode12A[i], + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode8A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, "Cable Diode 8A " + GT_Values.VN[i], "Cable Diode 8A " + GT_Values.VN[i], i, 8).getStackForm(1L), + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode8A[i], + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "Cable Diode 4A " + GT_Values.VN[i], "Cable Diode 4A " + GT_Values.VN[i], i, 4).getStackForm(1L), + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode4A[i], + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "Cable Diode 2A " + GT_Values.VN[i], "Cable Diode 2A " + GT_Values.VN[i], i, 2).getStackForm(1L), + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode2A[i], + bitsd, + new Object[]{ + "WDW", + "DCD", + "PDP", + 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode16A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 5 + i, "Cable Diode 16A " + GT_Values.VN[i], "Cable Diode 16A " + GT_Values.VN[i], i, 16).getStackForm(1L), + bitsd, + new Object[]{ + "WHW", + "DCD", + "PDP", + 'H', ItemList.Circuit_Parts_Coil.get(1L), + 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.Diode16A[i], + bitsd, + new Object[]{ + "WHW", + "DCD", + "PDP", + 'H', ItemList.Circuit_Parts_Coil.get(1L), + 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'C', machinehull + } + ); - }catch(ArrayIndexOutOfBoundsException e){ - //e.printStackTrace(); + } catch (ArrayIndexOutOfBoundsException e) { + //e.printStackTrace(); } } - new GT_TileEntity_ManualTrafo(ConfigHandler.IDOffset+GT_Values.VN.length*6+1,"ManualTravo","ManualTravo"); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), GT_Utility.getIntegratedCircuit(17)}, + Materials.Plastic.getMolten(1152L), + new ItemStack(ItemRegistry.BW_BLOCKS[2]), + 20, + (int) (GT_Values.V[3] - (GT_Values.V[3] / 10)) + ); + + GT_ModHandler.addCraftingRecipe( + new GT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "Manual Travo", "Manual Travo").getStackForm(1L), + bitsd, + new Object[]{ + "SCS", + "CHC", + "ZCZ", + 'S', GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L), + 'C', new ItemStack(ItemRegistry.BW_BLOCKS[2]), + 'H', ItemList.Hull_HV.get(1L), + 'Z', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1L) + } + ); + + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.circuit,Materials.Good,1L),Materials.Aluminium.getPlates(1),ItemList.Circuit_Board_Plastic.get(1L), ItemList.Battery_RE_LV_Lithium.get(1L)}, Materials.SolderingAlloy.getMolten(288L),new ItemStack(ItemRegistry.CircuitProgrammer),600,(int) (GT_Values.V[2] - (GT_Values.V[2] / 10))); //current ID: ConfigHandler.IDOffset+GT_Values.VN.length*6+1 } + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java index 0ad4ec3142..b2775252c9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java @@ -35,6 +35,6 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { return new GT_MetaTileEntity_Diode(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } public String[] getDescription() { - return new String[] {mDescription,"Voltage: "+ ChatColorHelper.YELLOW + GT_Values.V[this.mTier],"Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(),"Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via BartWorks"}; + return new String[] {mDescription,"Voltage: "+ ChatColorHelper.YELLOW + GT_Values.V[this.mTier],"Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(),"Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via "+ChatColorHelper.DARKGREEN+"BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java index 239484460e..218f8f0d50 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java @@ -47,7 +47,7 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans } public String[] getDescription() { - return new String[] {mDescription,"Voltage: "+ ChatColorHelper.YELLOW +GT_Values.V[this.mTier],"Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(),"Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via BartWorks"}; + return new String[] {mDescription,"Voltage: "+ ChatColorHelper.YELLOW +GT_Values.V[this.mTier],"Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(),"Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via "+ChatColorHelper.DARKGREEN+"BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java index 150678ea23..1b2a2934fb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java @@ -20,7 +20,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return null; + return new GT_TileEntity_DEHP(this.mName); } @Override @@ -35,31 +35,33 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override protected ItemList getCasingBlockItem() { - return null; + return ItemList.Casing_HeatProof; } @Override protected Materials getFrameMaterial() { - return null; + return Materials.Tungsten; } @Override protected int getCasingTextureIndex() { - return 0; + return 13; } @Override protected int getMinTier() { - return 0; + return 5; } @Override protected boolean checkHatches() { - return false; + return !this.mMaintenanceHatches.isEmpty() && !this.mOutputHatches.isEmpty() && !this.mInputHatches.isEmpty(); } @Override protected void setElectricityStats() { + + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java index ef60d24828..501849bfcb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java @@ -31,22 +31,14 @@ import net.minecraft.world.World; public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { - @SideOnly(Side.CLIENT) - static IIcon[] iIcons = new IIcon[4]; - @SideOnly(Side.CLIENT) - static IIconContainer[] iIconContainers = new IIconContainer[4]; - @SideOnly(Side.CLIENT) - static ITexture[][] iTextures = new ITexture[4][1]; - @SideOnly(Side.CLIENT) - static final byte TEXID_SIDE = 0; - @SideOnly(Side.CLIENT) - static final byte TEXID_CHARGING = 1; - @SideOnly(Side.CLIENT) - static final byte TEXID_IDLE = 2; - @SideOnly(Side.CLIENT) - static final byte TEXID_EMPTY = 3; - public static long energyPerCell = 100000L; + private static IIcon[] iIcons = new IIcon[4]; + private static IIconContainer[] iIconContainers = new IIconContainer[4]; + private static ITexture[][] iTextures = new ITexture[4][1]; + private static final byte TEXID_SIDE = 0; + private static final byte TEXID_CHARGING = 1; + private static final byte TEXID_IDLE = 2; + private static final byte TEXID_EMPTY = 3; private long mStorage; public ConnectedBlocksChecker connectedcells; @@ -54,7 +46,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public GT_TileEntity_LESU(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - this.mStorage = energyPerCell; + this.mStorage = ConfigHandler.energyPerCell; } public GT_TileEntity_LESU(String aName){ @@ -104,7 +96,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public long maxEUOutput() { - return Math.min(Math.max(this.mStorage / energyPerCell, 1L), 32768L); + return Math.min(Math.max(this.mStorage / ConfigHandler.energyPerCell, 1L), 32768L); } @Override @@ -142,18 +134,19 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { return new String[]{ "Controller Block for the GT2-Styled L.E.S.U.", "Size: ANY", - "Storage per LESU Casing: " + this.energyPerCell+"EU", + "Storage per LESU Casing: " + ConfigHandler.energyPerCell+"EU", "Output EU: LESU Casings amount"+ "Input EU: Next Voltage Tier to Output EU", "Input/Output Amps can be configured via 4 Circuits in GUI", "Output Side has a dot on it.", ChatColorHelper.RED+"Only one Controller allowed, no Wallsharing!", - "Added by bartimaeusnek via BartWorks" + "Added by bartimaeusnek via "+ChatColorHelper.DARKGREEN+"BartWorks" }; } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { + for (int i = 0; i < iTextures.length; i++) { iIcons[i]=aBlockIconRegister.registerIcon(MainMod.modID+":LESU_CASING_"+i); final int finalI = i; @@ -204,6 +197,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { ITexture[] ret = new ITexture[0]; if(this.isClientSide()) { + for (int i = 0; i < iTextures.length; i++) { iTextures[i][0] = new GT_RenderedTexture(iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); } @@ -331,7 +325,6 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean onRunningTick(ItemStack aStack){ this.mMaxProgresstime=1; - return true; } @@ -366,7 +359,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } this.mEfficiency=this.getMaxEfficiency(null); - this.mStorage=(energyPerCell * connectedcells.hashset.size() >= Long.MAX_VALUE-1 || energyPerCell * connectedcells.hashset.size() < 0) ? Long.MAX_VALUE-1 : energyPerCell * connectedcells.hashset.size() ; + this.mStorage=(ConfigHandler.energyPerCell * connectedcells.hashset.size() >= Long.MAX_VALUE-1 || ConfigHandler.energyPerCell * connectedcells.hashset.size() < 0) ? Long.MAX_VALUE-1 : ConfigHandler.energyPerCell * connectedcells.hashset.size() ; this.mMaxProgresstime=1; this.mProgresstime=0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java index 2c0c255ce8..369a69ba38 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java @@ -1,27 +1,34 @@ package com.github.bartimaeusnek.bartworks.common.tileentities; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; -import static gregtech.api.enums.GT_Values.V; - public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase { + private byte mode = 0; private byte texid = 2; private long mCoilWicks = 0; private boolean upstep = true; + private static final byte SINGLE_UPSTEP = 0; + private static final byte SINGLE_DOWNSTEP = 1; + private static final byte MULTI_UPSTEP = 2; + private static final byte MULTI_DOWNSTEP = 3; + public GT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -32,80 +39,134 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase @Override public boolean isCorrectMachinePart(ItemStack itemStack) { - return false; + return true; } @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (!this.getBaseMetaTileEntity().isAllowedToWork()) + this.stopMachine(); super.onPostTick(aBaseMetaTileEntity,aTick); } @Override public boolean onRunningTick(ItemStack aStack){ - if (this.mEfficiency < this.getMaxEfficiency(null)) - this.mEfficiency += 100; - else - this.mEfficiency = this.getMaxEfficiency(null); + if (this.mode > SINGLE_DOWNSTEP){ + return false; + } + + if (!this.getBaseMetaTileEntity().isAllowedToWork()) { + this.stopMachine(); + return false; + } + this.mProgresstime=0; + this.mMaxProgresstime=1; + if (this.getBaseMetaTileEntity().getTimer() % 40 == 0) + if (this.mEfficiency < this.getMaxEfficiency(null)) + this.mEfficiency += 100; + else + this.mEfficiency = this.getMaxEfficiency(null); + + boolean ret = this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput(this.getInputTier() * 2 * this.mEnergyHatches.size() * (long)this.mEfficiency / this.getMaxEfficiency(null)); - return this.drainEnergyInput((long)this.mEUt * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput((long)this.mEUt * 2 * this.mEnergyHatches.size() * (long)this.mEfficiency / 10000L); + return ret; } - + + public long getInputTier() { + if (this.mEnergyHatches.size()>0) + return (long) GT_Utility.getTier(this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); + else return 0; + } + + public long getOutputTier() { + if (this.mDynamoHatches.size()>0) + return (long) GT_Utility.getTier(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); + else return 0; + } + @Override public boolean checkRecipe(ItemStack itemStack) { - this.upstep= !(this.mInventory[1] != null && this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")); - this.mMaxProgresstime=1; + + if (!this.getBaseMetaTileEntity().isAllowedToWork()) { + this.stopMachine(); + return false; + } + this.mode = this.mInventory[1] == null ? 0 : this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit") ? this.mInventory[1].getItemDamage() > 4 ? (byte) this.mInventory[1].getItemDamage() : 0 : 0; + this.upstep= (this.mode == 0 || this.mode == 2); this.mProgresstime=0; - this.mEfficiency=1000; - this.mEUt= (int) V[this.mEnergyHatches.get(0).mTier]; + this.mMaxProgresstime=1; + this.mEfficiency= this.mEfficiency > 100 ? this.mEfficiency : 100; return this.upstep ? this.getOutputTier() - this.getInputTier() == mCoilWicks : this.getInputTier() - this.getOutputTier() == mCoilWicks; } @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; - - //check height - int y = 1; - boolean stillcoil = true; - while (stillcoil) { - for (int x = -1; x <= 1; ++x) { - for (int z = -1; z <= 1; ++z) { - if (x != 0 || z != 0) { - stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; - if (stillcoil) { - if (mCoilWicks != 0 && mCoilWicks % 8 == 0) { - ++y; - continue; - } - this.mCoilWicks++; - } else - break; + + this.mode = this.mInventory[1] == null ? 0 : this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit") ? this.mInventory[1].getItemDamage() > 4 ? (byte) this.mInventory[1].getItemDamage() : 0 : 0; + + if(this.mode <= 1){ + + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + + //check height + int y = 1; + boolean stillcoil = true; + while (stillcoil) { + for (int x = -1; x <= 1; ++x) { + for (int z = -1; z <= 1; ++z) { + if (x != 0 || z != 0) { + stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; + if (stillcoil) { + ++this.mCoilWicks; + if (mCoilWicks % 8 == 0) { + ++y; + continue; + } + } else + break; + } } + if (!stillcoil) + break; } - if (!stillcoil) - break; } - } - if (mCoilWicks % 8 != 0) - return false; + System.out.println(mCoilWicks); + if (mCoilWicks % 8 != 0) + return false; - this.mCoilWicks = this.mCoilWicks / 8; + this.mCoilWicks = this.mCoilWicks / 8; - //check interior (NiFeZn02 Core) - for (int i = 1; i <= this.mCoilWicks; ++i) { - if (!aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir) == 0) { - return false; + //check interior (NiFeZn02 Core) + for (int i = 1; i <= this.mCoilWicks; ++i) { + if (!aBaseMetaTileEntity.getBlockOffset(xDir, i, zDir).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir, i, zDir) == 0) { + return false; + } } - } - //check Bottom - for (int x = -1; x <= 1; ++x) - for (int z = -1; z <= 1; ++z) - if (xDir + x != 0 || zDir + z != 0) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { + //check Bottom + for (int x = -1; x <= 1; ++x) + for (int z = -1; z <= 1; ++z) + if (xDir + x != 0 || zDir + z != 0) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { + return false; + } + /* + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { + return false; + } + */ + } + } + + //check Top + for (int x = -1; x <= 1; ++x) + for (int z = -1; z <= 1; ++z) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addDynamoToMachineList(tTileEntity, texid)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { return false; } /* @@ -116,37 +177,132 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase } } - //check Top - for (int x = -1; x <= 1; ++x) - for (int z = -1; z <= 1; ++z) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks+1, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addDynamoToMachineList(tTileEntity, texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks+1, zDir + z) != GregTech_API.sBlockCasings1) { + // check dynamos and energy hatches for the same tier + byte outtier = this.mDynamoHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { + if (out.mTier != outtier) + return false; + } + + byte intier = this.mEnergyHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) { + if (in.mTier != intier) return false; + } + } else { + + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; + int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY * 2; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; + //check height + int y = 1; + boolean stillcoil = true; + while (stillcoil) { + for (int x = -1; x <= 1; ++x) { + for (int z = -1; z <= 1; ++z) { + if (x != 0 || z != 0) { + stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; + if (stillcoil) { + ++this.mCoilWicks; + if (mCoilWicks % 8 == 0) { + ++y; + continue; + } + } else + break; + } + } + if (!stillcoil) + break; } + } + + if (mCoilWicks % 8 != 0) + return false; + + this.mCoilWicks = this.mCoilWicks / 8; + + //check interior (NiFeZn02 Core) + for (int i = 1; i <= this.mCoilWicks; ++i) { + if (!aBaseMetaTileEntity.getBlockOffset(xDir, i, zDir).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir, i, zDir) == 0) { + return false; + } + } + + //check Bottom + for (int x = -2; x <= 2; ++x) + for (int z = -2; z <= 2; ++z) + if (xDir + x != 0 || zDir + z != 0) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { + return false; + } /* if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { return false; } */ + } + } + + //check Top + for (int x = -2; x <= 2; ++x) + for (int z = -2; z <= 2; ++z) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addDynamoToMachineList(tTileEntity, texid)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { + return false; + } + /* + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { + return false; + } + */ + } + } + + if (this.mDynamoHatches.size() <= 0 || this.mEnergyHatches.size() <= 0) + return false; + + byte outtier = this.mDynamoHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { + if (out.mTier != outtier) + return false; } - } - if (this.mDynamoHatches.size() <= 0 || this.mEnergyHatches.size() <= 0 || this.mDynamoHatches.size() > this.mEnergyHatches.size() ) - return false; + byte intier = this.mEnergyHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) { + if (in.mTier != intier) + return false; + } - // check dynamos and energy hatches for the same tier - byte outtier = this.mDynamoHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches){ - if (out.mTier!=outtier) - return false; - } - byte intier = this.mEnergyHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches){ - if (in.mTier!=intier) + //check tap hull + for (int ty = 1; ty <= y; ++ty) { + + byte leveltier = 0; + if (this.mInventory[1].getItemDamage() == 2) + leveltier = ((byte) (intier - ty)); + else if (this.mInventory[1].getItemDamage() == 3) + leveltier = ((byte) (intier + ty)); + else + return false; + + for (int x = -2; x <= 2; ++x) + for (int z = -2; z <= 2; ++z) + if (x == -2 || z == -2 || x == 2 || z == 2) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, ty, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid, leveltier) && !this.addDynamoToMachineList(tTileEntity, texid, leveltier)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, ty, zDir + z) != GregTech_API.sBlockCasings1) { + return false; + } + } + } + } + } + if (this.mDynamoHatches.size() <= 0 || this.mEnergyHatches.size() <= 0) return false; - } return true; } @@ -178,7 +334,23 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase @Override public String[] getDescription() { - return new String[]{"blalbabla"}; + return new String[]{ + "Controller Block for the Manual Trafo", + //"Operates in 4 Differents Modes:", + "Operates currently in 2 Differents Modes:", + "Mode 1: Circuit 0 in controller: Direct-Upstep", + "Mode 2: Circuit 1 in controller: Direct-Downstep", + //"Mode 3: Circuit 2 in controller: Tapped-Upstep", + //"Mode 4: Circuit 3 in controller: Tapped-Downstep", + "For direct Modes: 3xHx3", + "Base Contains at least 1 Energy Hatch", + "1 Layer of Dynamo Coils for each Tier transformed", + "Middle of Dynamo Coils needs to be a NickelFerrite Core", + "Top Contains at least 1 Dynamo Hatch", + "Maintenance Hatch can be placed anywhere", + "Added by bartimaeusnek via "+ ChatColorHelper.DARKGREEN+"BartWorks" + //"Tapped Mode is disabled." + }; } @Override @@ -197,4 +369,43 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[texid], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[texid]}; } + + public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex, short tier) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { + if (tier == ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mTier) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); + } + return false; + } else { + return false; + } + } + } + + public boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex, short tier) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { + if (tier == ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mTier) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo)aMetaTileEntity); + } + return false; + } else { + return false; + } + } + } + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java new file mode 100644 index 0000000000..aa2f248fec --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -0,0 +1,176 @@ +package com.github.bartimaeusnek.bartworks.server.container; + +import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class GT_Container_CircuitProgrammer extends Container { + + public GT_Container_CircuitProgrammer(InventoryPlayer inventory){ + + IInventory inv = new pinv(inventory.player); + + addSlotToContainer(new Slot(inv,0,44,61));//-45, 84)); + + for (int i = 1; i < 13; i++) { + addSlotToContainer(new GT_Slot_Holo(inv, i, -64+i*18, 22, false, false, 1)); + } + for (int i = 0; i < 12; i++) { + addSlotToContainer(new GT_Slot_Holo(inv, i+12, -46+i*18, 40, false, false, 1)); + } + + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 9; j++) { + addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + for (int i = 0; i < 9; i++) { + addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); + } + + } + + @Override + public ItemStack slotClick(int slot, int button, int aShifthold, EntityPlayer entityPlayer){ + if (slot > 0 && slot < 25 && ((Slot)this.inventorySlots.get(0)).getStack() != null){ + ((Slot)this.inventorySlots.get(0)).getStack().setItemDamage(slot); + detectAndSendChanges(); + return ( (Slot) this.inventorySlots.get(0)).getStack(); + } + return super.slotClick(slot, button, aShifthold, entityPlayer);//( (Slot) this.inventorySlots.get(slot)).getStack(); + } + + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return true; + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int SlotNR) + { + Slot chipslot = (Slot)this.inventorySlots.get(0); + if (SlotNR > 24) { + Slot slot = (Slot) this.inventorySlots.get(SlotNR); + if (slot != null && slot.getStack().getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())){ + if ( chipslot.getStack()== null ){ + chipslot.putStack(slot.getStack()); + slot.decrStackSize(1); + } + } + }else if (SlotNR == 0 && chipslot.getStack() != null){ + for (int i = 25; i < this.inventorySlots.size(); i++) { + if (((Slot)this.inventorySlots.get(i)).getStack() == null){ + Slot empty = ( (Slot) this.inventorySlots.get(i)); + empty.putStack(chipslot.getStack()); + chipslot.decrStackSize(1); + break; + } + } + } + return null; + } + + class pinv implements IInventory { + + public pinv(EntityPlayer Player){ + super(); + this.Player=Player; + this.toBind=Player.inventory.getCurrentItem(); + NBTTagCompound tag = this.toBind.getTagCompound(); + if (tag.getBoolean("HasChip")) + Slot = GT_Utility.getIntegratedCircuit(tag.getByte("ChipConfig")); + } + + ItemStack toBind; + EntityPlayer Player; + ItemStack Slot; + + @Override + public int getSizeInventory() { + return 1; + } + + @Override + public ItemStack getStackInSlot(int slot) { + return slot == 0 ? Slot : null; + } + + @Override + public ItemStack decrStackSize(int slotNR, int count) { + ItemStack ret = Slot.copy(); + Slot = null; + NBTTagCompound tag = toBind.getTagCompound(); + tag.setBoolean("HasChip",false); + toBind.setTagCompound(tag); + Player.inventory.setInventorySlotContents(Player.inventory.currentItem,toBind); + return ret; + } + + @Override + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + return Slot; + } + + @Override + public void setInventorySlotContents(int slotNR, ItemStack itemStack) { + if (itemStack != null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) { + Slot = itemStack.copy().splitStack(1); + itemStack.stackSize--; + NBTTagCompound tag = toBind.getTagCompound(); + tag.setBoolean("HasChip",true); + tag.setByte("ChipConfig", (byte) itemStack.getItemDamage()); + toBind.setTagCompound(tag); + Player.inventory.setInventorySlotContents(Player.inventory.currentItem,toBind); + } + } + + @Override + public String getInventoryName() { + return null; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return 1; + } + + @Override + public void markDirty() { + + } + + @Override + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return true; + } + + @Override + public void openInventory() { + + } + + @Override + public void closeInventory() { + + } + + @Override + public boolean isItemValidForSlot(int p_94041_1_, ItemStack itemStack) { + if (itemStack!= null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) + return true; + return false; + } + } + +} diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index ebb7c3ff15..f726682955 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -6,3 +6,6 @@ BW_ItemBlocks.0.name=Etched Lapis Cell BW_ItemBlocks.1.name=Plated Lapis Cell GT_LESU_CASING.0.name=LESU Casing itemGroup.GT2C=Gregtech 2 Compat +itemGroup.bartworks=BartWorks Inter Temporal +BW_Machinery_Casings.0.name=Nickel-Zinc Ferrite Block +BW_Machinery_Casings.1.name=Transformer-Winding Block diff --git a/src/main/resources/assets/bartworks/textures/GUI/GUI_CircuitP.png b/src/main/resources/assets/bartworks/textures/GUI/GUI_CircuitP.png new file mode 100644 index 0000000000..29cb0caf40 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/GUI_CircuitP.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/NickelFerriteBlocks.png b/src/main/resources/assets/bartworks/textures/blocks/NickelFerriteBlocks.png new file mode 100644 index 0000000000..f5976c093b Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/NickelFerriteBlocks.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/TransformerCoil.png b/src/main/resources/assets/bartworks/textures/blocks/TransformerCoil.png new file mode 100644 index 0000000000..349709d3ee Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/TransformerCoil.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/CircuitProgrammer.png b/src/main/resources/assets/bartworks/textures/items/CircuitProgrammer.png new file mode 100644 index 0000000000..5021c2834e Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/CircuitProgrammer.png differ -- cgit From 8892a0249d81b578eb12db2c3b26ab7a296a8980 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 17 Dec 2018 16:25:40 +0100 Subject: fixed a recipe Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> --- build.properties | 2 +- .../com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.properties b/build.properties index 07ea335ab8..bde9b6d663 100644 --- a/build.properties +++ b/build.properties @@ -1,5 +1,5 @@ mc_version=1.7.10 -mod_version=0.1.0 +mod_version=0.1.1 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 9dd005076f..a6db1925a9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -321,7 +321,7 @@ public class RecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe( new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), GT_Utility.getIntegratedCircuit(17)}, Materials.Plastic.getMolten(1152L), - new ItemStack(ItemRegistry.BW_BLOCKS[2]), + new ItemStack(ItemRegistry.BW_BLOCKS[2],1,1), 20, (int) (GT_Values.V[3] - (GT_Values.V[3] / 10)) ); -- cgit From ddfae9c6ecf6fb42ba352cca6dd6afd4a17bdb1c Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 19 Dec 2018 15:45:04 +0100 Subject: fixed a crash in NEI - version update - added bartworks logo Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> --- BWLogo.png | Bin 0 -> 3972 bytes build.properties | 2 +- .../bartworks/common/items/Circuit_Programmer.java | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 BWLogo.png diff --git a/BWLogo.png b/BWLogo.png new file mode 100644 index 0000000000..79d6679842 Binary files /dev/null and b/BWLogo.png differ diff --git a/build.properties b/build.properties index bde9b6d663..1d08c15676 100644 --- a/build.properties +++ b/build.properties @@ -1,5 +1,5 @@ mc_version=1.7.10 -mod_version=0.1.1 +mod_version=0.1.2 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index 42167e7209..a8df28c5aa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -29,7 +29,8 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack,aPlayer,aList,aF3_H); - aList.add("Has Circuit inside? "+ (aStack.getTagCompound().getBoolean("HasChip") ? "Yes" : "No")); + if (aStack != null && aStack.getTagCompound() != null) + aList.add("Has Circuit inside? "+ (aStack.getTagCompound().getBoolean("HasChip") ? "Yes" : "No")); aList.add("Added by"+ ChatColorHelper.DARKGREEN +" BartWorks"); } -- cgit From b2f8f479060bfe6c3adc8dd70edaeecda903adbc Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 25 Dec 2018 22:58:41 +0100 Subject: added Windmill +added a shitton of Recipes and Items for it +added GUI's for them aswell --- .../github/bartimaeusnek/bartworks/MainMod.java | 13 +- .../client/gui/BW_GUIContainer_RotorBlock.java | 55 ++ .../client/gui/BW_GUIContainer_Windmill.java | 45 ++ .../common/blocks/BW_TileEntityContainer.java | 81 +++ .../bartworks/common/items/BW_Stonage_Rotors.java | 90 +++ .../bartworks/common/items/SimpleSubItemClass.java | 58 ++ .../bartworks/common/loaders/ItemRegistry.java | 22 + .../bartworks/common/loaders/RecipeLoader.java | 206 ++++++- .../common/tileentities/BW_RotorBlock.java | 27 + .../tileentities/GT_TileEntity_Windmill.java | 608 +++++++++++++++++++++ .../resources/assets/bartworks/lang/en_US.lang | 12 + .../bartworks/textures/GUI/GUIPrimitiveKUBox.png | Bin 0 -> 1717 bytes .../assets/bartworks/textures/GUI/GUI_Windmill.png | Bin 0 -> 2046 bytes .../bartworks/textures/blocks/BWRotorBlock.png | Bin 0 -> 559 bytes .../bartworks/textures/blocks/GrindstoneL.png | Bin 0 -> 835 bytes .../assets/bartworks/textures/blocks/brick.png | Bin 0 -> 506 bytes .../bartworks/textures/blocks/windmill_top.png | Bin 0 -> 591 bytes .../textures/items/completed_grindstone.png | Bin 0 -> 932 bytes .../bartworks/textures/items/grindstone_bottom.png | Bin 0 -> 823 bytes .../bartworks/textures/items/grindstone_top.png | Bin 0 -> 822 bytes .../textures/items/rotors/combinedParts.png | Bin 0 -> 699 bytes .../textures/items/rotors/itemRotorCombined.png | Bin 0 -> 407 bytes .../textures/items/rotors/itemRotorLeather.png | Bin 0 -> 441 bytes .../textures/items/rotors/itemRotorPaper.png | Bin 0 -> 472 bytes .../textures/items/rotors/itemRotorWool.png | Bin 0 -> 382 bytes .../textures/items/rotors/leatherParts.png | Bin 0 -> 600 bytes .../bartworks/textures/items/rotors/paperParts.png | Bin 0 -> 546 bytes .../textures/items/rotors/rotorCombined.png | Bin 0 -> 2892 bytes .../textures/items/rotors/rotorLeather.png | Bin 0 -> 2230 bytes .../bartworks/textures/items/rotors/rotorPaper.png | Bin 0 -> 1238 bytes .../bartworks/textures/items/rotors/rotorWool.png | Bin 0 -> 1911 bytes .../bartworks/textures/items/rotors/woolParts.png | Bin 0 -> 601 bytes 32 files changed, 1181 insertions(+), 36 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BW_RotorBlock.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java create mode 100644 src/main/resources/assets/bartworks/textures/GUI/GUIPrimitiveKUBox.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BWRotorBlock.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/GrindstoneL.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/brick.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/windmill_top.png create mode 100644 src/main/resources/assets/bartworks/textures/items/completed_grindstone.png create mode 100644 src/main/resources/assets/bartworks/textures/items/grindstone_bottom.png create mode 100644 src/main/resources/assets/bartworks/textures/items/grindstone_top.png create mode 100644 src/main/resources/assets/bartworks/textures/items/rotors/combinedParts.png create mode 100644 src/main/resources/assets/bartworks/textures/items/rotors/itemRotorCombined.png create mode 100644 src/main/resources/assets/bartworks/textures/items/rotors/itemRotorLeather.png create mode 100644 src/main/resources/assets/bartworks/textures/items/rotors/itemRotorPaper.png create mode 100644 src/main/resources/assets/bartworks/textures/items/rotors/itemRotorWool.png create mode 100644 src/main/resources/assets/bartworks/textures/items/rotors/leatherParts.png create mode 100644 src/main/resources/assets/bartworks/textures/items/rotors/paperParts.png create mode 100644 src/main/resources/assets/bartworks/textures/items/rotors/rotorCombined.png create mode 100644 src/main/resources/assets/bartworks/textures/items/rotors/rotorLeather.png create mode 100644 src/main/resources/assets/bartworks/textures/items/rotors/rotorPaper.png create mode 100644 src/main/resources/assets/bartworks/textures/items/rotors/rotorWool.png create mode 100644 src/main/resources/assets/bartworks/textures/items/rotors/woolParts.png diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index a2fc611223..0219ef93bd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -4,7 +4,10 @@ package com.github.bartimaeusnek.bartworks; import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab; import com.github.bartimaeusnek.bartworks.common.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; +import com.github.bartimaeusnek.bartworks.common.tileentities.BW_RotorBlock; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_Windmill; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -12,16 +15,12 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_OreDictUnificator; +import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; - @Mod( modid = MainMod.modID, name = MainMod.name, version = MainMod.version, dependencies = "required-after:IC2; " @@ -53,7 +52,7 @@ public final class MainMod { } @Mod.EventHandler public void init(FMLInitializationEvent init) { - new LoaderRegistry().run(); + new LoaderRegistry().run(); } @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java new file mode 100644 index 0000000000..1311c291ac --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java @@ -0,0 +1,55 @@ +package com.github.bartimaeusnek.bartworks.client.gui; + +import com.github.bartimaeusnek.bartworks.MainMod; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.block.kineticgenerator.container.ContainerWindKineticGenerator; +import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator; +import ic2.core.util.GuiTooltipHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator +{ + public ContainerWindKineticGenerator container; + public String name; + + public BW_GUIContainer_RotorBlock(ContainerWindKineticGenerator container1) { + super(container1); + this.container = container1; + this.name = StatCollector.translateToLocal("tile.BWRotorBlock.name"); + } + + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { + this.fontRendererObj.drawString(this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 6, 2157374); + if (this.container.base.checkrotor()) { + if (!this.container.base.rotorspace()) { + this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotorspace"), 27, 52, 2157374); + } else if (this.container.base.checkrotor() && !this.container.base.guiisminWindStrength()) { + this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.windweak1"), 27, 52, 2157374); + } else { + this.fontRendererObj.drawString(this.container.base.getRotorhealth() + " %", 46, 52, 2157374); + if (this.container.base.guiisoverload()) { + GuiTooltipHelper.drawAreaTooltip(p_146979_1_ - this.guiLeft, p_146979_2_ - this.guiTop, StatCollector.translateToLocal("ic2.WindKineticGenerator.error.overload"), 44, 27, 79, 52); + } + } + } else { + this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotormiss"), 27, 52, 2157374); + } + + } + + protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { + GL11.glColor3f(0.5f,0.25f,0.07f); + this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.modID, "textures/GUI/GUIPrimitiveKUBox.png")); + int j = (this.width - this.xSize) / 2; + int k = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize); + if (this.container.base.guiisoverload() && this.container.base.checkrotor()) { + this.drawTexturedModalRect(j + 44, k + 20, 176, 0, 30, 26); + this.drawTexturedModalRect(j + 102, k + 20, 176, 0, 30, 26); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java new file mode 100644 index 0000000000..76cd7d2998 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java @@ -0,0 +1,45 @@ +package com.github.bartimaeusnek.bartworks.client.gui; + +import com.github.bartimaeusnek.bartworks.MainMod; +import gregtech.api.gui.GT_Container_MultiMachine; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class BW_GUIContainer_Windmill extends GT_GUIContainer_MultiMachine { + + public BW_GUIContainer_Windmill(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { + super(aInventoryPlayer, aTileEntity, aName, null); + } + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + if (!(this.mContainer instanceof GT_Container_MultiMachine)) + return; + + if ((((GT_Container_MultiMachine)this.mContainer).mDisplayErrorCode & 64) != 0) + this.fontRendererObj.drawString(this.trans("138", "Incomplete Structure."), 92, 22, 16448255); + } + + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + GL11.glColor3f(0.5f,0.25f,0.07f); + this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.modID, "textures/GUI/GUI_Windmill.png")); + + int x = (this.width - this.xSize) / 2; + int y = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); + if (this.mContainer.mMaxProgressTime > 0){ + this.drawTexturedModalRect(x+152, y+5,176,0,16,15); + this.drawTexturedModalRect(x+53, y+63,176,16,13,17); + } + + if (((GT_Container_MultiMachine)this.mContainer).mDisplayErrorCode == 0) { + if (((GT_Container_MultiMachine) this.mContainer).mActive == 0) { + GL11.glColor3f(1f,1f,1f); + this.drawTexturedModalRect(x+66, y+66,176,33,15,15); + } + } + + + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java new file mode 100644 index 0000000000..b90bfeeec9 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -0,0 +1,81 @@ +package com.github.bartimaeusnek.bartworks.common.blocks; + +import com.github.bartimaeusnek.bartworks.MainMod; +import ic2.api.tile.IWrenchable; +import ic2.core.IC2; +import ic2.core.IHasGui; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BW_TileEntityContainer extends BlockContainer { + + Class tileEntity = null; + + public BW_TileEntityContainer(Material p_i45386_1_,Class tileEntity, String blockName) { + super(p_i45386_1_); + this.tileEntity=tileEntity; + this.setCreativeTab(MainMod.BWT); + this.setBlockName(blockName); + this.setBlockTextureName(MainMod.modID+":"+blockName); + } + + + @Override + public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (worldObj.isRemote) { + return true; + } + if (!player.isSneaking()) { + final TileEntity tile = worldObj.getTileEntity(x, y, z); + if (tile instanceof IHasGui) { + return worldObj.isRemote || IC2.platform.launchGui(player, (IHasGui)tile); + } + } + + return false; + } + + + public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack itemStack) { + final TileEntity tile = world.getTileEntity(x, y, z); + if (tile instanceof IWrenchable && itemStack != null) { + final IWrenchable tile2 = (IWrenchable)tile; + int meta = itemStack.getItemDamage(); + world.setBlockMetadataWithNotify(x, y, z, meta, 2); + if (entity != null) { + final int face = MathHelper.floor_double(entity.rotationYaw * 4.0f / 360.0f + 0.5) & 0x3; + switch (face) { + case 0: + tile2.setFacing((short)2); + break; + case 1: + tile2.setFacing((short)5); + break; + case 2: + tile2.setFacing((short)3); + break; + case 3: + tile2.setFacing((short)4); + break; + } + } + } + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + try { + return this.tileEntity.newInstance(); + } catch (InstantiationException | IllegalAccessException e) { + e.printStackTrace(); + } + return null; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java new file mode 100644 index 0000000000..3fb86d4963 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -0,0 +1,90 @@ +package com.github.bartimaeusnek.bartworks.common.items; + +import com.github.bartimaeusnek.bartworks.MainMod; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.item.IKineticRotor; +import ic2.core.block.kineticgenerator.gui.GuiWaterKineticGenerator; +import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +import java.util.List; + +import static ic2.api.item.IKineticRotor.GearboxType.WATER; +import static ic2.api.item.IKineticRotor.GearboxType.WIND; + +public class BW_Stonage_Rotors extends Item implements IKineticRotor { + + private int[] DiaMinMax = new int[3]; + private float eff; + private GearboxType type; + private ResourceLocation tex; + private String itemTex; + + public BW_Stonage_Rotors(int diameter, float eff, int min, int max,int durability, GearboxType type,ResourceLocation tex, String Name, String itemTex){ + this.DiaMinMax[0]=diameter; + this.DiaMinMax[1]=min; + this.DiaMinMax[2]=max; + this.eff=eff; + this.type=type; + this.tex=tex; + this.setMaxDamage(durability); + this.setUnlocalizedName(Name); + this.setCreativeTab(MainMod.BWT); + this.itemTex=itemTex; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(MainMod.modID+":"+itemTex); + } + + public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { + info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", this.DiaMinMax[1], this.DiaMinMax[2])); + GearboxType type = null; + if (Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator) { + type = WATER; + } else if (Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator) { + type = WIND; + } + if (type != null) { + info.add(StatCollector.translateToLocal(("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type)))); + } + } + + @Override + public int getDiameter(ItemStack itemStack) { + return this.DiaMinMax[0]; + } + + @Override + public ResourceLocation getRotorRenderTexture(ItemStack itemStack) { + return this.tex; + } + + @Override + public float getEfficiency(ItemStack itemStack) { + return this.eff; + } + + @Override + public int getMinWindStrength(ItemStack itemStack) { + return this.DiaMinMax[1]; + } + + @Override + public int getMaxWindStrength(ItemStack itemStack) { + return this.DiaMinMax[2]; + } + + @Override + public boolean isAcceptedType(ItemStack itemStack, GearboxType gearboxType) { + return gearboxType.equals(this.type); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java new file mode 100644 index 0000000000..76b0d79b78 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -0,0 +1,58 @@ +package com.github.bartimaeusnek.bartworks.common.items; + +import com.github.bartimaeusnek.bartworks.MainMod; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +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 java.util.List; + +public class SimpleSubItemClass extends Item { + String[] tex; + @SideOnly(Side.CLIENT) + protected IIcon[] itemIcon; + + public SimpleSubItemClass(String[] tex){ + this.tex=tex; + this.hasSubtypes=true; + this.setCreativeTab(MainMod.BWT); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + itemIcon = new IIcon[tex.length]; + for (int i = 0; i < tex.length; i++) { + itemIcon[i]=iconRegister.registerIcon(MainMod.modID+":"+tex[i]); + } + + } + + @Override + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { + for (int i = 0; i < tex.length; i++) { + p_150895_3_.add(new ItemStack(p_150895_1_, 1, i)); + } + } + + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int p_77617_1_) + { + if (p_77617_1_ tedList = new ArrayList(); + private BW_RotorBlock rotorBlock; + private byte hasDoor; + + public GT_TileEntity_Windmill(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + private GT_TileEntity_Windmill(String aName) { + super(aName); + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + public boolean onRunningTick(ItemStack aStack) { + if (this.mMaxProgresstime > 0) + this.mProgresstime += this.rotorBlock.getGrindPower(); + return this.rotorBlock.getGrindPower() > 0; + } + + public boolean doRandomMaintenanceDamage() { + return true; + } + + public boolean recipe_fallback(ItemStack aStack){ + //sight... fallback to the macerator recipes + GT_Recipe.GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; + if (tMap == null) + return false; + GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), false, false, V[1], null, aStack); + if (tRecipe == null) + return false; + if (tRecipe.getOutput(0) != null) { + aStack.stackSize--; + mOutputItems[0] = tRecipe.getOutput(0); + if (new XSTR().nextInt(2) == 0){ + if (tRecipe.getOutput(1) != null) + mOutputItems[1] = tRecipe.getOutput(1); + else + mOutputItems[1] = tRecipe.getOutput(0); + } + } + this.mMaxProgresstime = (tRecipe.mDuration * 2 *100); + return true; + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + + if (itemStack == null || itemStack.getItem() == null) + return false; + + if (this.mOutputItems == null) + this.mOutputItems = new ItemStack[2]; + + //Override Recipes that doesnt quite work well with OreUnificator + //Items + if (itemStack.getItem().equals(Items.wheat)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 15 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 1L)); + this.mOutputItems[1] = (GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wheat, 1L)); + return true; + } else if (itemStack.getItem().equals(Items.bone)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 15 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = new ItemStack(Items.dye, 4, 15); + else + this.mOutputItems[0] = new ItemStack(Items.dye, 3, 15); + return true; + } + //Blocks + else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.gravel)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 30 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = new ItemStack(Items.flint, 2); + else + this.mOutputItems[0] = new ItemStack(Items.flint); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.cobblestone) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stone)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 2L); + else + this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.sandstone)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 45 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = new ItemStack(Blocks.sand, 3); + else + this.mOutputItems[0] = new ItemStack(Blocks.sand, 2); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.hardened_clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stained_hardened_clay)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + this.mOutputItems[0] = Materials.Clay.getDust(1); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.redstone_block)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + this.mOutputItems[0] = Materials.Redstone.getDust(9); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glass)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glass, 1L)); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.wool)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = new ItemStack(Items.string, 3); + else + this.mOutputItems[0] = new ItemStack(Items.string, 2); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glowstone)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = new ItemStack(Items.glowstone_dust, 4); + else + this.mOutputItems[0] = new ItemStack(Items.glowstone_dust, 3); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.netherrack)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Netherrack, 2L)); + else + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Netherrack, 1L)); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L)); + else + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L)); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log2)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L)); + else + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L)); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.pumpkin)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 15 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = new ItemStack(Items.pumpkin_seeds, 2); + else + this.mOutputItems[0] = new ItemStack(Items.pumpkin_seeds, 1); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.melon_block)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 15 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = new ItemStack(Items.melon_seeds, 2); + else + this.mOutputItems[0] = new ItemStack(Items.melon_seeds, 1); + return true; + } + + //null checks for GT shit + if (GT_OreDictUnificator.getAssociation(itemStack) == null || + GT_OreDictUnificator.getAssociation(itemStack).mPrefix == null || + GT_OreDictUnificator.getAssociation(itemStack).mMaterial == null || + GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial == null || + GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.getDust(1) == null + ) + return recipe_fallback(itemStack); //fallback for all non-unificated Items + + //Ore Unificator shit for balance + if (OrePrefixes.ingot.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.gem.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 45 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); + return true; + } else if (OrePrefixes.ore.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.crushed, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); + return true; + } else if (OrePrefixes.crushed.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 30 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dustImpure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); + return true; + } else if (OrePrefixes.crushedPurified.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 30 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dustPure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); + return true; + } else if (OrePrefixes.crushedCentrifuged.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 30 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); + return true; + } else if (OrePrefixes.block.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, (GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL)) ? 9L : 1L)); + return true; + } else if ( + OrePrefixes.stone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || + OrePrefixes.stoneBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || + OrePrefixes.stoneChiseled.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || + OrePrefixes.stoneCobble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || + OrePrefixes.stoneCracked.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || + OrePrefixes.stoneMossy.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || + OrePrefixes.stoneMossyBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || + OrePrefixes.stoneSmooth.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || + OrePrefixes.cobblestone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + ) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 2L)); + else + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); + return true; + } + return recipe_fallback(itemStack); //2nd fallback + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new BW_GUIContainer_Windmill(aPlayerInventory, aBaseMetaTileEntity,this.getLocalName()); + } + + public boolean addDispenserToOutputSet(TileEntity aTileEntity) { + if (aTileEntity instanceof TileEntityDispenser) { + this.tedList.add((TileEntityDispenser) aTileEntity); + return true; + } + return false; + } + + public boolean addOutput(ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) + return false; + + for (TileEntityDispenser tHatch : this.tedList) { + for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) { + if (tHatch.getStackInSlot(i) == null || GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack) && aStack.stackSize + tHatch.getStackInSlot(i).stackSize <= 64) { + if (GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack)) { + ItemStack merge = tHatch.getStackInSlot(i).copy(); + merge.stackSize = aStack.stackSize + tHatch.getStackInSlot(i).stackSize; + tHatch.setInventorySlotContents(i, merge); + } else { + tHatch.setInventorySlotContents(i, aStack.copy()); + } + + if (GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack)) { + aStack = null; + return true; + } else { + tHatch.setInventorySlotContents(i, null); + aStack = null; + return false; + } + } + } + } + return false; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + + /* + * offset x1 = 3x3 + * offset x2 = 5x5 + * offset x3 = 7x7 + * etc. + */ + + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 3; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 3; + + //floor + for (int x = -3; x <= 3; x++) { + for (int z = -3; z <= 3; z++) { + if (!((Math.abs(x) == 3 && Math.abs(z) == 3) || (xDir + x == 0 && zDir + z == 0))) + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != Blocks.brick_block) { + return false; + } + } + } + + //h_clay shaft + for (int y = 1; y <= 4; y++) + for (int x = -2; x <= 2; x++) + for (int z = -2; z <= 2; z++) { + if (!((Math.abs(x) == 2 && Math.abs(z) == 2) || (Math.abs(x) < 2 && Math.abs(z) != 2))) + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) != Blocks.hardened_clay && !this.addDispenserToOutputSet(aBaseMetaTileEntity.getTileEntityOffset(xDir + x, y, zDir + z))) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == Blocks.wooden_door && this.hasDoor < 3) { + this.hasDoor++; + continue; + } + return false; + } + } + + //plank layer 1 + for (int x = -2; x <= 2; x++) + for (int z = -2; z <= 2; z++) { + if (!(Math.abs(x) < 2 && Math.abs(z) != 2)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 5, zDir + z) != Blocks.planks) + return false; + } + } + + //plank layer 2-4 + for (int x = -3; x <= 3; x++) + for (int y = 6; y <= 8; y++) + for (int z = -3; z <= 3; z++) + if (!(((Math.abs(x) == 3 && Math.abs(z) == 3) || (Math.abs(x) < 3 && (Math.abs(z) != 2 || Math.abs(z) != 1))) || (xDir + x == 0 && zDir + z == 0 && y == 7))) + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) != Blocks.planks) + return false; + + //plank layer 5 + for (int x = -2; x <= 2; x++) + for (int z = -2; z <= 2; z++) + if (!(Math.abs(x) < 2 && (Math.abs(z) != 2))) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 9, zDir + z) != Blocks.planks) + return false; + } + //plank layer 6 + for (int x = -1; x <= 1; x++) + for (int z = -1; z <= 1; z++) + if (!(Math.abs(x) < 1 && (Math.abs(z) != 1))) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 10, zDir + z) != Blocks.planks) + return false; + } + //plank layer 7 + if (aBaseMetaTileEntity.getBlockOffset(xDir, 11, zDir) != Blocks.planks) + return false; + + //Rotor Block + TileEntity te = this.getBaseMetaTileEntity().getWorld().getTileEntity(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord() + 7, this.getBaseMetaTileEntity().getZCoord()); + + if (te instanceof BW_RotorBlock) + this.rotorBlock = (BW_RotorBlock) te; + else + return false; + + //check for outputs + if (this.tedList.isEmpty()) + return false; + + this.mWrench = true; + this.mScrewdriver = true; + this.mSoftHammer = true; + this.mHardHammer = true; + this.mSolderingTool = true; + this.mCrowbar = true; + + //reset door cause bugs >_> + this.hasDoor = 0; + + return true; + } + + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + if (this.mEfficiency < 0) + this.mEfficiency = 0; + if (--this.mUpdate == 0 || --this.mStartUpCheck == 0) { + this.hasDoor = 0; + this.tedList.clear(); + this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); + } + if (this.mStartUpCheck < 0) { + if (this.mMachine) { + if (this.mMaxProgresstime > 0) { + if (this.onRunningTick(this.mInventory[1])) { + if (this.mMaxProgresstime > 0 && this.mProgresstime >= this.mMaxProgresstime) { + if (this.mOutputItems != null) + for (ItemStack tStack : this.mOutputItems) + if (tStack != null) { + this.addOutput(tStack); + } + this.mEfficiency = 10000; + this.mOutputItems = new ItemStack[2]; + this.mProgresstime = 0; + this.mMaxProgresstime = 0; + this.mEfficiencyIncrease = 0; + if (aBaseMetaTileEntity.isAllowedToWork()) { + if (this.checkRecipe(this.mInventory[1])) + this.updateSlots(); + } + } + } + } else { + if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) { + if (aBaseMetaTileEntity.isAllowedToWork()) { + if (this.checkRecipe(this.mInventory[1])) + this.updateSlots(); + } + } + } + } else { + this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); + return; + } + } else { + this.stopMachine(); + } + } + aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (this.mWrench ? 0 : 1) | (this.mScrewdriver ? 0 : 2) | (this.mSoftHammer ? 0 : 4) | (this.mHardHammer ? 0 : 8) | (this.mSolderingTool ? 0 : 16) | (this.mCrowbar ? 0 : 32) | (this.mMachine ? 0 : 64)); + aBaseMetaTileEntity.setActive(this.mMaxProgresstime > 0); + } + + @Override + public int getCurrentEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public void updateSlots() { + if (this.mInventory[1] != null && this.mInventory[1].stackSize <= 0) { + this.mInventory[1] = null; + } + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_Windmill(this.mName); + } + + @Override + public String[] getDescription() { + return new String[]{ + "A primitive Grinder powered by Kinetic energy.", + "WxHxL: 7x12x7", + "Layer 1: 7x7 Bricks, corners are air, controller at front centered.", + "Layer 2-4: 5x5 Hardened Clay, corners are air, can contain one door,", + " must contain at least one Dispenser", + "Layer 5: 5x5 Wood Planks. Corners are filled.", + "Layer 6: 7x7 Wood Planks. Corners are air.", + "Layer 8: 7x7 Wood Planks. Corners are air,", + " front centered must be a Primitive Kinetic Shaftbox", + "Layer 9: 7x7 Wood Planks. Corners are air.", + "Layer 10: 5x5 Wood Planks. Corners are filled.", + "Layer 11: 3x3 Wood Planks. Corners are filled.", + "Layer 12: 1x1 Wood Plank.", + "Needs a Wind Mill Rotor in the Shaftbox to operate", + "Input items in Controller", + "Output items will appear in the dispensers", + "Added by bartimaeusnek via "+ ChatColorHelper.DARKGREEN+"BartWorks" + }; + } + + @Override + public String[] getInfoData() { + return new String[]{"Progress:", this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", Integer.toString(this.rotorBlock.getGrindPower()) + "KU/t"}; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + iIcons[0]=aBlockIconRegister.registerIcon("brick"); + iIconContainers[0]=new IIconContainer() { + @Override + public IIcon getIcon() { + return iIcons[0]; + } + + @Override + public IIcon getOverlayIcon() { + return iIcons[0]; + } + + @Override + public ResourceLocation getTextureFile() { + return new ResourceLocation("brick"); + } + }; + + iIcons[1]=aBlockIconRegister.registerIcon(MainMod.modID+":windmill_top"); + iIconContainers[1]=new IIconContainer() { + @Override + public IIcon getIcon() { + return iIcons[1]; + } + + @Override + public IIcon getOverlayIcon() { + return iIcons[1]; + } + + @Override + public ResourceLocation getTextureFile() { + return new ResourceLocation(MainMod.modID+":windmill_top"); + } + }; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + + ITexture[] ret = new ITexture[0]; + + if (isClientSide()) { + iTextures[0] = new GT_RenderedTexture(iIconContainers[0], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); + + ret = new ITexture[6]; + for (int i = 0; i < 6; i++) { + ret[i] = iTextures[0]; + } + if (aSide == 1){ + iTextures[1] = new GT_RenderedTexture(iIconContainers[1], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); + + ret = new ITexture[6]; + for (int i = 0; i < 6; i++) { + ret[i] = iTextures[1]; + } + } + + } + + + return ret; + } + + public boolean isClientSide() { + if (this.getBaseMetaTileEntity().getWorld() != null) + return this.getBaseMetaTileEntity().getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; + return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; + } +} diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index f726682955..400cf182fc 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -9,3 +9,15 @@ itemGroup.GT2C=Gregtech 2 Compat itemGroup.bartworks=BartWorks Inter Temporal BW_Machinery_Casings.0.name=Nickel-Zinc Ferrite Block BW_Machinery_Casings.1.name=Transformer-Winding Block +item.BW_PaperRotor.name=Primitive Paper Rotor (Wind only) +item.BW_LeatherRotor.name=Primitive Leather Rotor (Wind only) +item.BW_WoolRotor.name=Primitive Wool Rotor (Wind only) +item.BW_CombinedRotor.name=Combined Primitive Rotor (Wind only) +tile.BWRotorBlock.name=Primitive Kinetic Shaftbox +item.grindstone_top.name=Grindstone Top Piece +item.grindstone_bottom.name=Grindstone Bottom Piece +item.completed_grindstone.name=Grindstone +item.rotors.leatherParts.name=Leather Covered Wood Frame +item.rotors.woolParts.name=Wool Covered Wood Frame +item.rotors.paperParts.name=Paper Covered Wood Frame +item.rotors.combinedParts.name=Multiple Material Covered Wood Frame \ No newline at end of file diff --git a/src/main/resources/assets/bartworks/textures/GUI/GUIPrimitiveKUBox.png b/src/main/resources/assets/bartworks/textures/GUI/GUIPrimitiveKUBox.png new file mode 100644 index 0000000000..0e329e4ea3 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/GUIPrimitiveKUBox.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png b/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png new file mode 100644 index 0000000000..d71477e9da Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BWRotorBlock.png b/src/main/resources/assets/bartworks/textures/blocks/BWRotorBlock.png new file mode 100644 index 0000000000..fc0872b45f Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BWRotorBlock.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/GrindstoneL.png b/src/main/resources/assets/bartworks/textures/blocks/GrindstoneL.png new file mode 100644 index 0000000000..6e2e7dfe4e Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/GrindstoneL.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/brick.png b/src/main/resources/assets/bartworks/textures/blocks/brick.png new file mode 100644 index 0000000000..fd6959c2f5 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/brick.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/windmill_top.png b/src/main/resources/assets/bartworks/textures/blocks/windmill_top.png new file mode 100644 index 0000000000..8f49c6b2f3 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/windmill_top.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/completed_grindstone.png b/src/main/resources/assets/bartworks/textures/items/completed_grindstone.png new file mode 100644 index 0000000000..a02ee7ad6a Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/completed_grindstone.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/grindstone_bottom.png b/src/main/resources/assets/bartworks/textures/items/grindstone_bottom.png new file mode 100644 index 0000000000..33b1e96bda Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/grindstone_bottom.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/grindstone_top.png b/src/main/resources/assets/bartworks/textures/items/grindstone_top.png new file mode 100644 index 0000000000..0be37504b5 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/grindstone_top.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/rotors/combinedParts.png b/src/main/resources/assets/bartworks/textures/items/rotors/combinedParts.png new file mode 100644 index 0000000000..bdb4aafc04 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/rotors/combinedParts.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/rotors/itemRotorCombined.png b/src/main/resources/assets/bartworks/textures/items/rotors/itemRotorCombined.png new file mode 100644 index 0000000000..13ae5461e8 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/rotors/itemRotorCombined.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/rotors/itemRotorLeather.png b/src/main/resources/assets/bartworks/textures/items/rotors/itemRotorLeather.png new file mode 100644 index 0000000000..a11f72b76d Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/rotors/itemRotorLeather.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/rotors/itemRotorPaper.png b/src/main/resources/assets/bartworks/textures/items/rotors/itemRotorPaper.png new file mode 100644 index 0000000000..56863186ac Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/rotors/itemRotorPaper.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/rotors/itemRotorWool.png b/src/main/resources/assets/bartworks/textures/items/rotors/itemRotorWool.png new file mode 100644 index 0000000000..a5bb68bb43 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/rotors/itemRotorWool.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/rotors/leatherParts.png b/src/main/resources/assets/bartworks/textures/items/rotors/leatherParts.png new file mode 100644 index 0000000000..824697ab3d Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/rotors/leatherParts.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/rotors/paperParts.png b/src/main/resources/assets/bartworks/textures/items/rotors/paperParts.png new file mode 100644 index 0000000000..5b09228578 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/rotors/paperParts.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/rotors/rotorCombined.png b/src/main/resources/assets/bartworks/textures/items/rotors/rotorCombined.png new file mode 100644 index 0000000000..4e97c01705 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/rotors/rotorCombined.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/rotors/rotorLeather.png b/src/main/resources/assets/bartworks/textures/items/rotors/rotorLeather.png new file mode 100644 index 0000000000..388b43bd56 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/rotors/rotorLeather.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/rotors/rotorPaper.png b/src/main/resources/assets/bartworks/textures/items/rotors/rotorPaper.png new file mode 100644 index 0000000000..e9d1767a42 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/rotors/rotorPaper.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/rotors/rotorWool.png b/src/main/resources/assets/bartworks/textures/items/rotors/rotorWool.png new file mode 100644 index 0000000000..d62caeba27 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/rotors/rotorWool.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/rotors/woolParts.png b/src/main/resources/assets/bartworks/textures/items/rotors/woolParts.png new file mode 100644 index 0000000000..24c6cb0573 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/rotors/woolParts.png differ -- cgit From fbf1ef62f7fab7a70b4bff37f20503ffb121999f Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 25 Dec 2018 22:59:21 +0100 Subject: version increase --- build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.properties b/build.properties index 1d08c15676..e745864b67 100644 --- a/build.properties +++ b/build.properties @@ -1,5 +1,5 @@ mc_version=1.7.10 -mod_version=0.1.2 +mod_version=0.2.0 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 -- cgit From b1e249a5d28a0fcc72943042866580147b6efb40 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 26 Dec 2018 02:04:56 +0100 Subject: fixed tooltip +version increase --- build.properties | 2 +- .../tileentities/GT_TileEntity_Windmill.java | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build.properties b/build.properties index e745864b67..20a4db092d 100644 --- a/build.properties +++ b/build.properties @@ -1,5 +1,5 @@ mc_version=1.7.10 -mod_version=0.2.0 +mod_version=0.2.1 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java index aa7cfcff98..bea3a91279 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java @@ -510,18 +510,18 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { public String[] getDescription() { return new String[]{ "A primitive Grinder powered by Kinetic energy.", - "WxHxL: 7x12x7", - "Layer 1: 7x7 Bricks, corners are air, controller at front centered.", + "WxHxL: 7x12x7", + "Layer 1: 7x7 Bricks, corners are air, controller at front centered.", "Layer 2-4: 5x5 Hardened Clay, corners are air, can contain one door,", - " must contain at least one Dispenser", - "Layer 5: 5x5 Wood Planks. Corners are filled.", - "Layer 6: 7x7 Wood Planks. Corners are air.", - "Layer 8: 7x7 Wood Planks. Corners are air,", - " front centered must be a Primitive Kinetic Shaftbox", - "Layer 9: 7x7 Wood Planks. Corners are air.", - "Layer 10: 5x5 Wood Planks. Corners are filled.", - "Layer 11: 3x3 Wood Planks. Corners are filled.", - "Layer 12: 1x1 Wood Plank.", + "hollow, must contain at least one Dispenser", + "Layer 5: 5x5 Wood Planks. Corners are filled, hollow.", + "Layer 6: 7x7 Wood Planks. Corners are air, hollow.", + "Layer 8: 7x7 Wood Planks. Corners are air, hollow,", + "front centered must be a Primitive Kinetic Shaftbox", + "Layer 9: 7x7 Wood Planks. Corners are air, hollow.", + "Layer 10: 5x5 Wood Planks. Corners are filled, hollow.", + "Layer 11: 3x3 Wood Planks. Corners are filled, hollow.", + "Layer 12: 1x1 Wood Plank.", "Needs a Wind Mill Rotor in the Shaftbox to operate", "Input items in Controller", "Output items will appear in the dispensers", -- cgit From 82bd52008b663bd38e96472c5d12a3db8bca63b3 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 9 Jan 2019 19:17:23 +0100 Subject: Bio Cultre System! -Added the Bio Cultre System -Added the Bio Vat, Bio Lab and custom Glas types -Updated Copyright on the Files -Added a shitton of ressources -Added an API to for the Bio Cultre System -Added a Phyton Script for the ease of adding Glas Types to the Bio Vat -Fixed Spawning on custom blocks -Fixed Nuggets giving out boni in the windmill -Fixed tooltip again for the Windmill -Added dimensionsIDs to the BlockCoord class -Added apiJar, sourceJar, devJar to the grandlew output --- .gitignore | 5 +- BlockAdderGenerator/biovatgen.py | 68 +++ BlockAdderGenerator/csv.csv | 28 + buid.bat | 2 + build.gradle | 25 + build.properties | 24 +- .../bartimaeusnek/bartworks/API/API_REFERENCE.java | 27 + .../bartworks/API/BioObjectAdder.java | 125 ++++ .../bartworks/API/BioObjectGetter.java | 122 ++++ .../bartworks/API/BioRecipeAdder.java | 124 ++++ .../bartworks/API/BioVatLogicAdder.java | 197 ++++++ .../github/bartimaeusnek/bartworks/GuiHandler.java | 53 +- .../github/bartimaeusnek/bartworks/MainMod.java | 62 +- .../bartworks/client/creativetabs/BioTab.java | 39 ++ .../bartworks/client/creativetabs/GT2Tab.java | 24 +- .../client/creativetabs/bartworksTab.java | 24 +- .../client/gui/BW_GUIContainer_RadLevel.java | 60 ++ .../client/gui/BW_GUIContainer_RotorBlock.java | 27 +- .../client/gui/BW_GUIContainer_Windmill.java | 39 +- .../gui/GT_GUIContainer_CircuitProgrammer.java | 28 +- .../client/gui/GT_GUIContainer_Destructopack.java | 28 +- .../bartworks/client/gui/GT_GUIContainer_LESU.java | 47 +- .../client/gui/GT_GUIContainer_RadioHatch.java | 77 +++ .../renderer/RendererSwitchingColorFluid.java | 298 +++++++++ .../bartworks/common/ConfigHandler.java | 34 -- .../bartworks/common/blocks/BW_Blocks.java | 68 ++- .../bartworks/common/blocks/BW_GlasBlocks.java | 65 ++ .../common/blocks/BW_TileEntityContainer.java | 41 +- .../bartworks/common/blocks/BioFluidBlock.java | 98 +++ .../bartworks/common/configs/ConfigHandler.java | 65 ++ .../bartworks/common/items/BW_ItemBlocks.java | 36 +- .../bartworks/common/items/BW_Stonage_Rotors.java | 42 +- .../bartworks/common/items/Circuit_Programmer.java | 36 +- .../common/items/GT_Destructopack_Item.java | 31 +- .../bartworks/common/items/GT_Rockcutter_Item.java | 72 ++- .../bartworks/common/items/GT_Teslastaff_Item.java | 38 +- .../bartworks/common/items/LabModule.java | 46 ++ .../bartworks/common/items/LabParts.java | 135 +++++ .../bartworks/common/items/SimpleIconItem.java | 28 +- .../bartworks/common/items/SimpleSubItemClass.java | 52 +- .../bartworks/common/loaders/BioCultureLoader.java | 60 ++ .../bartworks/common/loaders/BioItemList.java | 140 +++++ .../bartworks/common/loaders/BioLabLoader.java | 42 ++ .../bartworks/common/loaders/BioRecipeLoader.java | 375 ++++++++++++ .../bartworks/common/loaders/FluidLoader.java | 85 +++ .../bartworks/common/loaders/GTNHBlocks.java | 96 +++ .../bartworks/common/loaders/ItemRegistry.java | 117 ++-- .../bartworks/common/loaders/LoaderRegistry.java | 34 +- .../bartworks/common/loaders/RecipeLoader.java | 190 +++--- .../bartworks/common/net/BW_Network.java | 128 ++++ .../bartworks/common/net/RendererPacket.java | 112 ++++ .../tileentities/BWTileEntityDimIDBridge.java | 28 + .../common/tileentities/BW_RotorBlock.java | 26 +- .../tileentities/GT_MetaTileEntity_BioLab.java | 263 ++++++++ .../tileentities/GT_MetaTileEntity_Diode.java | 29 +- .../GT_MetaTileEntity_EnergyDistributor.java | 26 +- .../tileentities/GT_MetaTileEntity_RadioHatch.java | 315 ++++++++++ .../common/tileentities/GT_TileEntity_BioVat.java | 674 +++++++++++++++++++++ .../common/tileentities/GT_TileEntity_DEHP.java | 23 +- .../common/tileentities/GT_TileEntity_LESU.java | 115 ++-- .../tileentities/GT_TileEntity_ManualTrafo.java | 295 +++++---- .../tileentities/GT_TileEntity_Windmill.java | 90 ++- .../server/container/BW_Container_RadioHatch.java | 216 +++++++ .../container/GT_Container_CircuitProgrammer.java | 83 ++- .../container/GT_Container_Item_Destructopack.java | 37 +- .../server/container/GT_Container_LESU.java | 22 + .../server/container/GT_Container_RadioHatch.java | 155 +++++ .../bartimaeusnek/bartworks/util/BWRecipes.java | 580 ++++++++++++++++++ .../bartimaeusnek/bartworks/util/BW_Util.java | 122 ++++ .../bartimaeusnek/bartworks/util/BioCulture.java | 189 ++++++ .../bartimaeusnek/bartworks/util/BioDNA.java | 63 ++ .../bartimaeusnek/bartworks/util/BioData.java | 171 ++++++ .../bartimaeusnek/bartworks/util/BioPlasmid.java | 62 ++ .../bartworks/util/ChatColorHelper.java | 22 + .../bartworks/util/ConnectedBlocksChecker.java | 129 ++-- .../bartimaeusnek/bartworks/util/Coords.java | 63 ++ .../bartworks/util/NEIbartworksConfig.java | 30 +- .../resources/assets/bartworks/lang/en_US.lang | 27 +- .../assets/bartworks/textures/GUI/GUI_RSC.png | Bin 0 -> 2599 bytes .../assets/bartworks/textures/GUI/RadHatch.png | Bin 0 -> 2270 bytes .../textures/blocks/BoronSilicateGlassBlock.png | Bin 0 -> 177 bytes .../blocks/BoronSilicateGlassBlockRand.png | Bin 0 -> 184 bytes .../ChromeReinforcedBoronSilicateGlassBlock.png | Bin 0 -> 199 bytes .../IridiumReinforcedBoronSilicateGlassBlock.png | Bin 0 -> 196 bytes .../NickelReinforcedBoronSilicateGlassBlock.png | Bin 0 -> 201 bytes .../OsmiumReinforcedBoronSilicateGlassBlock.png | Bin 0 -> 211 bytes .../TungstenReinforcedBoronSilicateGlassBlock.png | Bin 0 -> 198 bytes .../assets/bartworks/textures/blocks/brick.png | Bin 506 -> 0 bytes .../assets/bartworks/textures/items/Agarose.png | Bin 0 -> 259 bytes .../items/ClonalCellularSynthesisModule.png | Bin 0 -> 481 bytes .../textures/items/DNAExtractionModule.png | Bin 0 -> 525 bytes .../bartworks/textures/items/DNASampleFlask.png | Bin 0 -> 253 bytes .../bartworks/textures/items/DetergentPowder.png | Bin 0 -> 261 bytes .../bartworks/textures/items/IncubationModule.png | Bin 0 -> 623 bytes .../textures/items/PCRThermoclyclingModule.png | Bin 0 -> 566 bytes .../bartworks/textures/items/PlasmaMembrane.png | Bin 0 -> 2522 bytes .../bartworks/textures/items/PlasmidCell.png | Bin 0 -> 288 bytes .../textures/items/PlasmidSynthesisModule.png | Bin 0 -> 499 bytes .../textures/items/TransformationModule.png | Bin 0 -> 529 bytes .../assets/bartworks/textures/items/petriDish.png | Bin 0 -> 3033 bytes .../textures/GUI/basicmachines/BW.GUI.BioLab.png | Bin 0 -> 3151 bytes 101 files changed, 7040 insertions(+), 634 deletions(-) create mode 100644 BlockAdderGenerator/biovatgen.py create mode 100644 BlockAdderGenerator/csv.csv create mode 100644 buid.bat create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BWTileEntityDimIDBridge.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_BioLab.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_RadioHatch.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_BioVat.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java create mode 100644 src/main/resources/assets/bartworks/textures/GUI/GUI_RSC.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/RadHatch.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRand.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/ChromeReinforcedBoronSilicateGlassBlock.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/IridiumReinforcedBoronSilicateGlassBlock.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/NickelReinforcedBoronSilicateGlassBlock.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/OsmiumReinforcedBoronSilicateGlassBlock.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/TungstenReinforcedBoronSilicateGlassBlock.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/brick.png create mode 100644 src/main/resources/assets/bartworks/textures/items/Agarose.png create mode 100644 src/main/resources/assets/bartworks/textures/items/ClonalCellularSynthesisModule.png create mode 100644 src/main/resources/assets/bartworks/textures/items/DNAExtractionModule.png create mode 100644 src/main/resources/assets/bartworks/textures/items/DNASampleFlask.png create mode 100644 src/main/resources/assets/bartworks/textures/items/DetergentPowder.png create mode 100644 src/main/resources/assets/bartworks/textures/items/IncubationModule.png create mode 100644 src/main/resources/assets/bartworks/textures/items/PCRThermoclyclingModule.png create mode 100644 src/main/resources/assets/bartworks/textures/items/PlasmaMembrane.png create mode 100644 src/main/resources/assets/bartworks/textures/items/PlasmidCell.png create mode 100644 src/main/resources/assets/bartworks/textures/items/PlasmidSynthesisModule.png create mode 100644 src/main/resources/assets/bartworks/textures/items/TransformationModule.png create mode 100644 src/main/resources/assets/bartworks/textures/items/petriDish.png create mode 100644 src/main/resources/assets/gregtech/textures/GUI/basicmachines/BW.GUI.BioLab.png diff --git a/.gitignore b/.gitignore index 181e20b1b3..317f54dbb6 100644 --- a/.gitignore +++ b/.gitignore @@ -25,11 +25,12 @@ *.rar *.bin *.lock - +*.sqlite # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* /eclipse /build /out -/.gradle \ No newline at end of file +/.gradle +/venv \ No newline at end of file diff --git a/BlockAdderGenerator/biovatgen.py b/BlockAdderGenerator/biovatgen.py new file mode 100644 index 0000000000..650cc52de7 --- /dev/null +++ b/BlockAdderGenerator/biovatgen.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +""" +Created on Wed Jan 2 19:11:07 2019 + +Copyright (c) 2019 boubou_19, bartimaeusnek +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +@author: boubou_19, bartimaeusnek +""" + +import os +import datetime +import time +name="GTNHBlocks" #change the name of the output file here +ending=".java" +csv_path = os.getcwd()+os.sep+"csv.csv" # change the name of the csv here +output_file_path = os.getcwd()+os.sep+name+ending +code_list = [] #will store all the lines of code +max_meta = [] +with open(csv_path, "r") as file:#open the file and automatically close it when it leaves the scope + code_list.append("import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder;\n") + code_list.append("\n") + code_list.append("//Autogenerated run file, script Created on Wed Jan 2 19:11:07 2019 by boubou_19 and bartimaeusnek\n") + code_list.append("//Executed on "+datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H:%M:%S')+"\n") + code_list.append("public class "+name+" implements Runnable {\n") + code_list.append("\n") + code_list.append(" @Override\n") + code_list.append(" public void run(){\n") + file.readline() #skip the first line of the file + + for line in file: + line = line.split(";") #turns the string into a list of strings using the ";" separator + line[4] = line[4].strip("\n") #it remove the \n at the end of a csv line otherwise it will do shit in the string later + if line[3] == "-1" or line[3] == "0": + code_list.append(" BioVatLogicAdder.BioVatGlass.addCustomGlass(\"{0}\",\"{1}\",{2},{3});\n".format(line[0],line[1],line[2],line[4])) + else: + if line[3] == "15" and line[2] == "0": + max_meta.append(" BioVatLogicAdder.BioVatGlass.addCustomGlass(\"{0}\",\"{1}\",i,{3});\n".format(line[0],line[1],line[2],line[4])) + else: + code_list.append("\n for (int i = {0}; i <= {1};++i)\n".format(line[2],line[3])) + code_list.append(" BioVatLogicAdder.BioVatGlass.addCustomGlass(\"{0}\",\"{1}\",i,{3});\n\n".format(line[0],line[1],line[2],line[4])) + + # for i in range(int(line[2]),int(line[3])+1): #the +1 is here because range instruction always exclude the last number + code_list.append("\n for (int i = 0; i <= 15;++i;){\n") + for line in max_meta: + code_list.append(line) + code_list.append(" }\n") + code_list.append(" }\n") + code_list.append("}\n") +with open(output_file_path,"w") as out: + out.writelines(code_list) + diff --git a/BlockAdderGenerator/csv.csv b/BlockAdderGenerator/csv.csv new file mode 100644 index 0000000000..2f1ee7ef53 --- /dev/null +++ b/BlockAdderGenerator/csv.csv @@ -0,0 +1,28 @@ +mod;unlocalised name;meta start;meta end;tier +minecraft;stained_glass;0;15;3 +minecraft;glass;0;-1;3 +BloodArsenal;blood_stained_glass;0;-1;3 +Botany;stained;0;0;3 +EnderIO;blockFusedQuartz;0;5;3 +ExtraUtilities;decorativeBlock1;9;-1;3 +ExtraUtilities;decorativeBlock2;0;11;3 +ExtraUtilities;etherealglass;0;5;3 +GalaxySpace;futureglasses;0;15;3 +GalaxySpace;futureglass;0;-1;3 +HardcoreEnderExpension;laboratory_glass;0;-1;3 +IC2;blockAlloyGlass;0;-1;4 +Natura;NetherGlass;0;1;3 +Railcraft;glass;0;15;3 +RandomThings;spectreGlass;0;-1;3 +TConstruct;GlassBlock;0;-1;3 +TConstruct;GlassBlock.StainedClear;0;15;3 +Ztones;tile.glaxx;0;15;3 +chisel;glass;0;15;3 +chisel;stained_glass_white;0;15;3 +chisel;stained_glass_yellow;0;15;3 +chisel;stained_glass_lightgray;0;15;3 +chisel;stained_glass_brown;0;15;3 +chisel;glass2;0;-1;3 +chisel;stained_glass_forestry;0;15;3 +tectech;tile.quantumGlass;0;-1;5 +witchery;shadedglass;0;15;3 diff --git a/buid.bat b/buid.bat new file mode 100644 index 0000000000..3c93bfe30e --- /dev/null +++ b/buid.bat @@ -0,0 +1,2 @@ +call gradlew.bat build +pause \ No newline at end of file diff --git a/build.gradle b/build.gradle index c20193c1ec..0c65172e39 100644 --- a/build.gradle +++ b/build.gradle @@ -19,6 +19,7 @@ buildscript { apply plugin: 'forge' apply plugin: 'idea' apply plugin: 'signing' + import de.undercouch.gradle.tasks.download.Download sourceCompatibility = JavaVersion.VERSION_1_8 @@ -44,6 +45,7 @@ archivesBaseName = "bartworks"+ "[" + config.mc_version + "]" minecraft { version = "1.7.10-10.13.4.1614-1.7.10" replaceIn "MainMod.java" + replaceIn "API_REFERENCE.java" replace "@version@", project.version runDir = "run" } @@ -95,6 +97,29 @@ processResources } } +task apiJar(type: Jar){ + from(sourceSets.main.output) { + include 'com/github/bartimaeusnek/bartworks/API/**' + } + classifier = 'API' +} + +task sourceJar(type: Jar) { + from sourceSets.main.allSource + classifier = 'sources' +} + +task devJar(type: Jar) { + from sourceSets.main.output + classifier = 'dev' +} + +artifacts { + archives devJar + archives sourceJar + archives apiJar +} + task signJar(dependsOn: 'reobf'){ doLast { ant.signjar( diff --git a/build.properties b/build.properties index 20a4db092d..6427c44557 100644 --- a/build.properties +++ b/build.properties @@ -1,5 +1,27 @@ +# +# Copyright (c) 2019 bartimaeusnek +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + mc_version=1.7.10 -mod_version=0.2.1 +mod_version=0.3.11 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java new file mode 100644 index 0000000000..2767d56168 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +public final class API_REFERENCE { + public static final String VERSION = "@version@"; +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java new file mode 100644 index 0000000000..e0e332fab1 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +import com.github.bartimaeusnek.bartworks.util.BioCulture; +import com.github.bartimaeusnek.bartworks.util.BioDNA; +import com.github.bartimaeusnek.bartworks.util.BioData; +import com.github.bartimaeusnek.bartworks.util.BioPlasmid; +import net.minecraft.item.EnumRarity; + +import java.awt.*; + +public final class BioObjectAdder { + +// @Deprecated +// public static BioCulture createAndRegisterBioCulture(Color color, String name, long ID, BioPlasmid plasmid, BioDNA dna, EnumRarity rarity){ +// return BioCulture.createAndRegisterBioCulture(color,name,ID,plasmid,dna,rarity); +// } + + /** + * @param color the color of the Culture + * @param name the name of the Culture + * @param plasmid the cultures plasmid, get it from createAndRegisterBioPlasmid + * @param dna the cultures dna, get it from createAndRegisterBioDNA + * @param breedable if the culture can be inserted into the BacterialVat + * @param rarity visual + * @return + */ + public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, EnumRarity rarity, boolean breedable) { + return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, rarity, breedable); + } + + /** + * rarity inherits from dna + * + * @param color the color of the Culture + * @param name the name of the Culture + * @param plasmid the cultures plasmid, get it from createAndRegisterBioPlasmid + * @param dna the cultures dna, get it from createAndRegisterBioDNA + * @param breedable if the culture can be inserted into the BacterialVat + * @return + */ + public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, boolean breedable) { + return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, breedable); + } + + /** + * unspecific Biodata that can be converted into DNA and Plasmid with the propper methodes + * + * @param aName the name of the Biodata + * @param rarity visual only + * @param chance the chanche to extract this BioData + * @param tier the tier of this BioData 0=HV, 1=EV etc. + * @return + */ + public static BioData createAndRegisterBioData(String aName, EnumRarity rarity, int chance, int tier) { + return BioData.createAndRegisterBioData(aName, rarity, chance, tier); + } + + /** + * Default Constructor for HV Tier DNA with 75% extraction rate + * + * @param aName Name of the DNA String + * @param rarity visual + * @return + */ + public static BioDNA createAndRegisterBioDNA(String aName, EnumRarity rarity) { + return BioDNA.createAndRegisterBioDNA(aName, rarity); + } + + /** + * Default Constructor for HV Tier Plasmid with 75% extraction rate + * + * @param aName Name of the Plasmid + * @param rarity visual + * @return + */ + public static BioPlasmid createAndRegisterBioPlasmid(String aName, EnumRarity rarity) { + return BioPlasmid.createAndRegisterBioPlasmid(aName, rarity); + } + + /** + * @param aName Name of the DNA String + * @param rarity visual + * @param chance chanche of extracting + * @param tier tier needed to extract 0=HV, 1=EV etc. + * @return + */ + public static BioDNA createAndRegisterBioDNA(String aName, EnumRarity rarity, int chance, int tier) { + return BioDNA.createAndRegisterBioDNA(aName, rarity, chance, tier); + } + + /** + * @param aName Name of the Plasmid + * @param rarity visual + * @param chance chanche of extracting + * @param tier tier needed to extract 0=HV, 1=EV etc. + * @return + */ + public static BioPlasmid createAndRegisterBioPlasmid(String aName, EnumRarity rarity, int chance, int tier) { + return BioPlasmid.createAndRegisterBioPlasmid(aName, rarity, chance, tier); + } + + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java new file mode 100644 index 0000000000..86ec61c138 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import com.github.bartimaeusnek.bartworks.util.BioCulture; +import com.github.bartimaeusnek.bartworks.util.BioDNA; +import com.github.bartimaeusnek.bartworks.util.BioData; +import com.github.bartimaeusnek.bartworks.util.BioPlasmid; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import java.util.Collection; + +public final class BioObjectGetter { + + public static BioCulture getBioCulture(String aName) { + return BioCulture.getBioCulture(aName); + } + + public static NBTTagCompound getNBTTagFromCulture(BioCulture bioCulture) { + return BioCulture.getNBTTagFromCulture(bioCulture); + } + + public static NBTTagCompound getNBTTagFromBioPlasmid(BioPlasmid bioPlasmid) { + return getNBTTagFromBioData(convertBioPlasmidToData(bioPlasmid)); + } + + public static NBTTagCompound getNBTTagFromBioDNA(BioDNA bioDNA) { + return getNBTTagFromBioData(convertBioDNAtoData(bioDNA)); + } + + public static NBTTagCompound getNBTTagFromBioData(BioData bioData) { + return BioData.getNBTTagFromBioData(bioData); + } + + public static BioDNA convertDataToDNA(BioData bioData) { + return BioDNA.convertDataToDNA(bioData); + } + + public static BioPlasmid convertDataToPlasmid(BioData bioData) { + return BioPlasmid.convertDataToPlasmid(bioData); + } + + public static BioData convertBioPlasmidToData(BioPlasmid bioPlasmid) { + return BioData.convertBioPlasmidToBioData(bioPlasmid); + } + + public static BioData convertDataToDNA(BioDNA bioData) { + return BioData.convertBioDNAToBioData(bioData); + } + + public static BioData convertBioDNAtoData(BioDNA bioDNA) { + return BioData.convertBioDNAToBioData(bioDNA); + } + + public static BioPlasmid convertBioDNAtoBioPlasmid(BioDNA bioDNA) { + return convertDataToPlasmid(convertBioDNAtoData(bioDNA)); + } + + public static BioDNA convertBioPlasmidtoBioDNA(BioPlasmid bioPlasmid) { + return convertDataToDNA(convertBioPlasmidToData(bioPlasmid)); + } + + public static Collection getAllPetriDishes() { + return BioItemList.getAllPetriDishes(); + } + + public static Collection getAllDNASampleFlasks() { + return BioItemList.getAllDNASampleFlasks(); + } + + public static Collection getAllPlasmidCells() { + return BioItemList.getAllPlasmidCells(); + } + + public static ItemStack getDNASampleFlask(BioDNA dna) { + return BioItemList.getDNASampleFlask(dna); + } + + public static ItemStack getPetriDish(BioCulture culture) { + return BioItemList.getPetriDish(culture); + } + + public static ItemStack getPlasmidCell(BioPlasmid plasmid) { + return BioItemList.getPlasmidCell(plasmid); + } + + /** + * 1 - DetergentPowder + * 2 - Agarose + * 3 - IncubationModule + * 4 - Plasma Membrane + * + * @param selection + * @return the selected Item + */ + public static ItemStack getOther(int selection) { + return BioItemList.getOther(selection); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java new file mode 100644 index 0000000000..0f81d266f0 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.BioCulture; +import gregtech.api.enums.Materials; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import javax.annotation.Nonnegative; +import javax.annotation.Nonnull; + +public final class BioRecipeAdder { + + public static final int STANDART = 0; + public static final int LOWGRAVITY = -100; + public static final int CLEANROOM = -200; + + public static boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return BWRecipes.instance.addBioLabRecipe(aInputs, aOutput, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + } + + /** + * Adds a Incubation Recipe for the BioLab. + * + * @param aInput any item that will be added with a petri dish + * @param aOutput must be a BioCulture + * @param aChances + * @param aFluidInputs + * @param aDuration + * @param aEUt use BW_Util.getMachineVoltageFromTier(tier) to get optimal EU/t + * @param aSpecialValue 0 = STANDART, -100 = LowGravity, -200 = Cleanroom + * @return if the recipe was added. + */ + public static boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { + return BWRecipes.instance.addBioLabRecipeIncubation(aInput, aOutput, aChances, aFluidInputs, aDuration, aEUt, aSpecialValue); + } + + /** + * @param aInputs Item Inputs, DO NOT PUT INTEGRATED CIRCUITS IN HERE! THEY WILL GET ADDED AUTOMATICALLY!, can be null + * @param aCulture the bio culture + * @param aFluidInputs may not be null + * @param aFluidOutputs may not be null + * @param aDuration + * @param aEUt + * @param Sv Manual Sv entry i.e. for custom items + * @param glasTier the glass tier + * @param aSpecialValue Space or Cleanroom, Not yet implemented + * @param exactSv if the recipe needs EXACTLY the Sv or can use less... + * @return + */ + public static boolean addBacterialVatRecipe(ItemStack[] aInputs, @Nonnull BioCulture aCulture, @Nonnull FluidStack[] aFluidInputs, @Nonnull FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, int Sv, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { + return BWRecipes.instance.addBacterialVatRecipe(aInputs, aCulture, aFluidInputs, aFluidOutputs, aDuration, aEUt, Sv, glasTier, aSpecialValue, exactSv); + } + + /** + * @param aInputs Item Inputs, DO NOT PUT INTEGRATED CIRCUITS IN HERE! THEY WILL GET ADDED AUTOMATICALLY!, can be null + * @param aCulture the bio culture + * @param aFluidInputs may not be null + * @param aFluidOutputs may not be null + * @param aDuration + * @param aEUt + * @param material may be null. used for auto Sv calculation + * @param glasTier the glass tier + * @param aSpecialValue Space or Cleanroom, Not yet implemented + * @param exactSv if the recipe needs EXACTLY the Sv or can use less... + * @return + */ + public static boolean addBacterialVatRecipe(ItemStack[] aInputs, @Nonnull BioCulture aCulture, @Nonnull FluidStack[] aFluidInputs, @Nonnull FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, Materials material, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { + return BWRecipes.instance.addBacterialVatRecipe(aInputs, aCulture, aFluidInputs, aFluidOutputs, aDuration, aEUt, material, glasTier, aSpecialValue, exactSv); + } + +// public static boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSievert) { +// return BWRecipes.instance.addBacterialVatRecipe(aInputs, aOutputs, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert); +// } + +// @Deprecated +// public static boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ +// return BWRecipes.instance.addBioLabRecipeDNAExtraction(aInputs, aOutput, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); +// } +// +// @Deprecated +// public static boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ +// return BWRecipes.instance.addBioLabRecipePCRThermoclycling(aInputs, aOutput, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); +// } +// +// @Deprecated +// public static boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ +// return BWRecipes.instance.addBioLabRecipePlasmidSynthesis(aInputs, aOutput, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); +// } +// +// @Deprecated +// public static boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ +// return BWRecipes.instance.addBioLabRecipeTransformation(aInputs, aOutput, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); +// } +// +// @Deprecated +// public static boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ +// return BWRecipes.instance.addBioLabRecipeClonalCellularSynthesis(aInputs, aOutput, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); +// } + + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java new file mode 100644 index 0000000000..483b4a67e2 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +import com.github.bartimaeusnek.bartworks.MainMod; +import gregtech.api.enums.Materials; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + +import javax.annotation.Nonnegative; +import javax.annotation.Nonnull; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Objects; + +import static cpw.mods.fml.common.registry.GameRegistry.findBlock; + +public final class BioVatLogicAdder { + + + public static class RadioHatch { + + private static final HashSet MaSv = new HashSet<>(); + private static final HashMap IsSv = new HashMap<>(); + + public static HashSet getMaSv() { + return RadioHatch.MaSv; + } + + public static HashMap getIsSv() { + return RadioHatch.IsSv; + } + + public static void setOverrideSvForMaterial(Materials m, Integer sv) { + MaSv.add(new BioVatLogicAdder.MaterialSvPair(m, sv)); + } + + public static void giveItemStackRadioHatchAbilites(ItemStack stack, Integer sv) { + IsSv.put(stack, sv); + } + + public static int getMaxSv() { + int ret = 150; + Iterator it = BioVatLogicAdder.RadioHatch.getMaSv().iterator(); + while (it.hasNext()) { + BioVatLogicAdder.MaterialSvPair pair = (BioVatLogicAdder.MaterialSvPair) it.next(); + if (pair.getSievert() > ret) + ret = pair.getSievert(); + } + for (ItemStack is : RadioHatch.IsSv.keySet()) { + if (RadioHatch.IsSv.get(is) > ret) + ret = RadioHatch.IsSv.get(is); + } + return ret; + } + + } + + public static class BioVatGlass { + + private static final HashMap glasses = new HashMap<>(); + + /** + * @param sModname The modid owning the block + * @param sUnlocBlockName The name of the block itself + * @param meta The meta of the block + * @param tier the glasses Tier = Voltage tier (MIN 3) + * @return if the block was found in the Block registry + */ + public static boolean addCustomGlass(String sModname, String sUnlocBlockName, int meta, int tier) { + Block block = findBlock(sModname, sUnlocBlockName); + boolean ret = block != null; + if (ret) + BioVatGlass.glasses.put(new BlockMetaPair(block, (byte) meta), (byte) tier); + else + MainMod.logger.warn("Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!"); + block = null; + return ret; + } + + /** + * @param block the block to add + * @param meta the meta of the block (0-15) + * @param tier the glasses Tier = Voltage tier (MIN 3) + */ + public static void addCustomGlass(@Nonnull Block block, @Nonnegative int meta, @Nonnegative int tier) { + BioVatGlass.glasses.put(new BlockMetaPair(block, (byte) meta), (byte) tier); + } + + /** + * @param block the block to add + * @param tier the glasses Tier = Voltage tier (MIN 3) + */ + public static void addCustomGlass(@Nonnull Block block, @Nonnegative int tier) { + BioVatGlass.glasses.put(new BlockMetaPair(block, (byte) 0), (byte) tier); + } + + /** + * @param blockBytePair the block to add and its meta as a javafx.util Pair + * @param tier the glasses Tier = Voltage tier (MIN 3) + */ + public static void addCustomGlass(@Nonnull BlockMetaPair blockBytePair, @Nonnegative byte tier) { + BioVatGlass.glasses.put(blockBytePair, tier); + } + + public static HashMap getGlassMap() { + return BioVatGlass.glasses; + } + } + + public static class MaterialSvPair { + final Materials materials; + final Integer sievert; + + public MaterialSvPair(Materials materials, Integer sievert) { + this.materials = materials; + this.sievert = sievert; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + BioVatLogicAdder.MaterialSvPair that = (BioVatLogicAdder.MaterialSvPair) o; + return Objects.equals(this.getMaterials(), that.getMaterials()) && + Objects.equals(this.getSievert(), that.getSievert()); + } + + @Override + public int hashCode() { + return Objects.hash(this.getMaterials(), this.getSievert()); + } + + public Materials getMaterials() { + return this.materials; + } + + public Integer getSievert() { + return this.sievert; + } + + + } + + public static class BlockMetaPair { + final Block block; + final Byte aByte; + + public BlockMetaPair(Block block, Byte aByte) { + this.block = block; + this.aByte = aByte; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + BioVatLogicAdder.BlockMetaPair that = (BioVatLogicAdder.BlockMetaPair) o; + return Objects.equals(this.getBlock(), that.getBlock()) && + Objects.equals(this.getaByte(), that.getaByte()); + } + + @Override + public int hashCode() { + return Objects.hash(this.getBlock(), this.getaByte()); + } + + public Block getBlock() { + return this.block; + } + + public Byte getaByte() { + return this.aByte; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java index 7d2f2d4628..f45ac86579 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -1,10 +1,35 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks; +import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_RadLevel; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_CircuitProgrammer; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_Destructopack; +import com.github.bartimaeusnek.bartworks.server.container.BW_Container_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_CircuitProgrammer; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_Item_Destructopack; import cpw.mods.fml.common.network.IGuiHandler; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; @@ -12,18 +37,34 @@ public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - switch (ID){ - case 0: return new GT_Container_Item_Destructopack(player.inventory); - case 1: return new GT_Container_CircuitProgrammer(player.inventory); + switch (ID) { + case 0: + return new GT_Container_Item_Destructopack(player.inventory); + case 1: + return new GT_Container_CircuitProgrammer(player.inventory); + case 2: { + if (world.getTileEntity(x, y, z) instanceof IGregTechTileEntity) { + IGregTechTileEntity te = (IGregTechTileEntity) world.getTileEntity(x, y, z); + return new BW_Container_RadioHatch(player.inventory, te.getMetaTileEntity()); + } + } } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - switch (ID){ - case 0: return new GT_GUIContainer_Destructopack(player.inventory); - case 1: return new GT_GUIContainer_CircuitProgrammer(player.inventory); + switch (ID) { + case 0: + return new GT_GUIContainer_Destructopack(player.inventory); + case 1: + return new GT_GUIContainer_CircuitProgrammer(player.inventory); + case 2: { + if (world.getTileEntity(x, y, z) instanceof IGregTechTileEntity) { + IGregTechTileEntity te = (IGregTechTileEntity) world.getTileEntity(x, y, z); + return new BW_GUIContainer_RadLevel(new BW_Container_RadioHatch(player.inventory, te.getMetaTileEntity())); + } + } } return null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 0219ef93bd..c2a42579df 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -1,13 +1,35 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks; +import com.github.bartimaeusnek.bartworks.client.creativetabs.BioTab; import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab; -import com.github.bartimaeusnek.bartworks.common.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; -import com.github.bartimaeusnek.bartworks.common.tileentities.BW_RotorBlock; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_Windmill; +import com.github.bartimaeusnek.bartworks.common.net.BW_Network; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -15,51 +37,59 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import static com.github.bartimaeusnek.bartworks.API.API_REFERENCE.VERSION; + @Mod( modid = MainMod.modID, name = MainMod.name, version = MainMod.version, - dependencies = "required-after:IC2; " - + "required-after:gregtech; " - ) + dependencies = "required-after:IC2; " + + "required-after:gregtech; " +) public final class MainMod { public static final String name = "BartWorks"; public static final String version = "@version@"; public static final String modID = "bartworks"; public static final Logger logger = LogManager.getLogger(name); - public static boolean GTNH = false; public static final CreativeTabs GT2 = new GT2Tab("GT2C"); + public static final CreativeTabs BioTab = new BioTab("BioTab"); public static final CreativeTabs BWT = new bartworksTab("bartworks"); public static final IGuiHandler GH = new GuiHandler(); + public static boolean GTNH = false; @Mod.Instance(modID) public static MainMod instance; public static ConfigHandler CHandler; - + public static BW_Network BW_Network_instance = new BW_Network(); @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { - if(Loader.isModLoaded("dreamcraft")) { + if (!(VERSION.equals(version))) { + logger.error("Something has loaded an old API. Please contact the Mod authors to update!"); + } + + if (Loader.isModLoaded("dreamcraft")) { GTNH = true; } - CHandler= new ConfigHandler(preinit); + CHandler = new ConfigHandler(preinit); if (GTNH) logger.info("GTNH-Detected . . . ACTIVATE HARDMODE."); + } + @Mod.EventHandler public void init(FMLInitializationEvent init) { - new LoaderRegistry().run(); + new LoaderRegistry().run(); } @Mod.EventHandler public void postInit(FMLPostInitializationEvent postinit) { - NetworkRegistry.INSTANCE.registerGuiHandler(instance,GH); + NetworkRegistry.INSTANCE.registerGuiHandler(instance, GH); + if (ConfigHandler.BioLab) + new GTNHBlocks().run(); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java new file mode 100644 index 0000000000..2057052be3 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.client.creativetabs; + +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; + +public class BioTab extends CreativeTabs { + + public BioTab(String lable) { + super(lable); + } + + @Override + public Item getTabIconItem() { + return BioItemList.getPetriDish(null).getItem(); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java index 82188db9c5..1d403a93d9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.client.creativetabs; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; @@ -6,7 +28,7 @@ import net.minecraft.item.Item; public class GT2Tab extends CreativeTabs { - public GT2Tab (String lable) { + public GT2Tab(String lable) { super(lable); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java index 30449b88de..f3e5e15882 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.client.creativetabs; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; @@ -6,7 +28,7 @@ import net.minecraft.item.Item; public class bartworksTab extends CreativeTabs { - public bartworksTab (String lable) { + public bartworksTab(String lable) { super(lable); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java new file mode 100644 index 0000000000..91dfa14c28 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.client.gui; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.server.container.BW_Container_RadioHatch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.inventory.Container; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class BW_GUIContainer_RadLevel extends GuiContainer { + final BW_Container_RadioHatch container; + + public BW_GUIContainer_RadLevel(Container p_i1072_1_) { + super(p_i1072_1_); + container = (BW_Container_RadioHatch) p_i1072_1_; + } + + + @Override + protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { + GL11.glColor3f(1, 1, 1); + this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.modID, "textures/GUI/GUI_RSC.png")); + drawTexturedModalRect(guiLeft - 79, guiTop, 0, 0, 256, 165); + } + + @Override + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { + int y = 51 + (container.coverage / 2 - 3); + int x = -63; + if (container.coverage != 100 && container.coverage != 0) + drawRect(x, y, x + 51, y + 1, 0xFF60D82E); + drawRect(x, 48, x + 51, y, 0xFF8B8B8B); + this.fontRendererObj.drawString(Byte.toString(container.coverage), 88 - 79, 50, 16448255); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java index 1311c291ac..61b87019e3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; @@ -11,8 +33,7 @@ import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) -public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator -{ +public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator { public ContainerWindKineticGenerator container; public String name; @@ -42,7 +63,7 @@ public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator } protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GL11.glColor3f(0.5f,0.25f,0.07f); + GL11.glColor3f(0.5f, 0.25f, 0.07f); this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.modID, "textures/GUI/GUIPrimitiveKUBox.png")); int j = (this.width - this.xSize) / 2; int k = (this.height - this.ySize) / 2; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java index 76cd7d2998..09dec26e2b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; @@ -13,30 +35,31 @@ public class BW_GUIContainer_Windmill extends GT_GUIContainer_MultiMachine { public BW_GUIContainer_Windmill(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { super(aInventoryPlayer, aTileEntity, aName, null); } + protected void drawGuiContainerForegroundLayer(int par1, int par2) { if (!(this.mContainer instanceof GT_Container_MultiMachine)) return; - if ((((GT_Container_MultiMachine)this.mContainer).mDisplayErrorCode & 64) != 0) + if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) this.fontRendererObj.drawString(this.trans("138", "Incomplete Structure."), 92, 22, 16448255); } protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor3f(0.5f,0.25f,0.07f); + GL11.glColor3f(0.5f, 0.25f, 0.07f); this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.modID, "textures/GUI/GUI_Windmill.png")); int x = (this.width - this.xSize) / 2; int y = (this.height - this.ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - if (this.mContainer.mMaxProgressTime > 0){ - this.drawTexturedModalRect(x+152, y+5,176,0,16,15); - this.drawTexturedModalRect(x+53, y+63,176,16,13,17); + if (this.mContainer.mMaxProgressTime > 0) { + this.drawTexturedModalRect(x + 152, y + 5, 176, 0, 16, 15); + this.drawTexturedModalRect(x + 53, y + 63, 176, 16, 13, 17); } - if (((GT_Container_MultiMachine)this.mContainer).mDisplayErrorCode == 0) { + if (((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode == 0) { if (((GT_Container_MultiMachine) this.mContainer).mActive == 0) { - GL11.glColor3f(1f,1f,1f); - this.drawTexturedModalRect(x+66, y+66,176,33,15,15); + GL11.glColor3f(1f, 1f, 1f); + this.drawTexturedModalRect(x + 66, y + 66, 176, 33, 15, 15); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java index d511369435..2a699035f4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; @@ -10,14 +32,16 @@ import org.lwjgl.opengl.GL11; public class GT_GUIContainer_CircuitProgrammer extends GuiContainer { + public static final ResourceLocation texture = new ResourceLocation(MainMod.modID, "textures/GUI/GUI_CircuitP.png"); + public GT_GUIContainer_CircuitProgrammer(InventoryPlayer p_i1072_1_) { super(new GT_Container_CircuitProgrammer(p_i1072_1_)); } - public static final ResourceLocation texture = new ResourceLocation(MainMod.modID, "textures/GUI/GUI_CircuitP.png"); + @Override protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { GL11.glColor4f(1F, 1F, 1F, 1F); Minecraft.getMinecraft().getTextureManager().bindTexture(texture); - drawTexturedModalRect(guiLeft-79, guiTop, 0, 0, 256, 165); + drawTexturedModalRect(guiLeft - 79, guiTop, 0, 0, 256, 165); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java index 68e2516979..feaf22fcc1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; @@ -8,12 +30,12 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; -public class GT_GUIContainer_Destructopack extends GuiContainer -{ +public class GT_GUIContainer_Destructopack extends GuiContainer { + public static final ResourceLocation texture = new ResourceLocation(MainMod.modID, "textures/GT2/gui/Destructopack.png"); + public GT_GUIContainer_Destructopack(InventoryPlayer inventory) { super(new GT_Container_Item_Destructopack(inventory)); } - public static final ResourceLocation texture = new ResourceLocation(MainMod.modID, "textures/GT2/gui/Destructopack.png"); @Override public void drawGuiContainerBackgroundLayer(float f, int j, int i) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java index 4a0b1ada5b..1378d9e943 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -1,7 +1,29 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_LESU; import gregtech.api.gui.GT_GUIContainer; @@ -15,32 +37,31 @@ import java.awt.*; public class GT_GUIContainer_LESU extends GT_GUIContainer { - protected GT_Container_LESU mContainer; - public static final ResourceLocation texture = new ResourceLocation(MainMod.modID, "textures/GT2/gui/LESU.png"); + protected GT_Container_LESU mContainer; private GT_TileEntity_LESU c; public GT_GUIContainer_LESU(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_LESU(aInventoryPlayer, aTileEntity), texture.getResourceDomain()); - mContainer = ((GT_Container_LESU)this.inventorySlots); - c = ((GT_TileEntity_LESU)(this.mContainer.mTileEntity.getMetaTileEntity())); + mContainer = ((GT_Container_LESU) this.inventorySlots); + c = ((GT_TileEntity_LESU) (this.mContainer.mTileEntity.getMetaTileEntity())); } @Override protected void drawGuiContainerForegroundLayer(final int par1, final int par2) { - this.drawString(this.fontRendererObj,"L.E.S.U.", 11, 8, 16448255); + this.drawString(this.fontRendererObj, "L.E.S.U.", 11, 8, 16448255); if (this.mContainer != null) { String percell = String.valueOf(ConfigHandler.energyPerCell).substring(1); - this.drawString(this.fontRendererObj,"EU: " + String.valueOf(this.mContainer.mEnergy), 11, 16, 16448255); - this.drawString(this.fontRendererObj,"MAX: " + (this.c.getBaseMetaTileEntity().isActive() ? String.valueOf(this.mContainer.mOutput)+ percell : Integer.toString(0)), 11, 24, 16448255); - this.drawString(this.fontRendererObj,"MAX EU/t IN: " + String.valueOf(this.mContainer.mInput), 11, 32, 16448255); - this.drawString(this.fontRendererObj,"EU/t OUT: " + String.valueOf(this.mContainer.mOutput), 11, 40, 16448255); - this.drawString(this.fontRendererObj,"AMP/t IN/OUT: " + String.valueOf(c.getBaseMetaTileEntity().getInputAmperage()), 11, 48, 16448255); - if (c.maxEUStore() >= Long.MAX_VALUE-1) { + this.drawString(this.fontRendererObj, "EU: " + String.valueOf(this.mContainer.mEnergy), 11, 16, 16448255); + this.drawString(this.fontRendererObj, "MAX: " + (this.c.getBaseMetaTileEntity().isActive() ? String.valueOf(this.mContainer.mOutput) + percell : Integer.toString(0)), 11, 24, 16448255); + this.drawString(this.fontRendererObj, "MAX EU/t IN: " + String.valueOf(this.mContainer.mInput), 11, 32, 16448255); + this.drawString(this.fontRendererObj, "EU/t OUT: " + String.valueOf(this.mContainer.mOutput), 11, 40, 16448255); + this.drawString(this.fontRendererObj, "AMP/t IN/OUT: " + String.valueOf(c.getBaseMetaTileEntity().getInputAmperage()), 11, 48, 16448255); + if (c.maxEUStore() >= Long.MAX_VALUE - 1) { this.drawString(this.fontRendererObj, "Maximum Capacity!", 11, 56, Color.YELLOW.getRGB()); } if (!this.c.getBaseMetaTileEntity().isActive()) { - this.drawString(this.fontRendererObj,"Multiple Controllers!", 11, 56, Color.RED.getRGB()); + this.drawString(this.fontRendererObj, "Multiple Controllers!", 11, 56, Color.RED.getRGB()); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java new file mode 100644 index 0000000000..220d88d7a9 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.client.gui; + +import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_RadioHatch; +import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.nio.ByteBuffer; + +public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine { + private static int maxSv; + private final String mName; + + public GT_GUIContainer_RadioHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { + super(new GT_Container_RadioHatch(aInventoryPlayer, aTileEntity), MainMod.modID + ":textures/GUI/RadHatch.png"); + this.mName = "Radio Hatch"; + this.mContainer.detectAndSendChanges(); + maxSv = BioVatLogicAdder.RadioHatch.getMaxSv(); + } + + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + long timer = ByteBuffer.wrap(((GT_Container_RadioHatch) mContainer).teTimer).getLong(); + double maxT = ((GT_Container_RadioHatch) mContainer).mass * (GT_MetaTileEntity_RadioHatch.calcDecayTicks(((GT_Container_RadioHatch) mContainer).sievert)); + double rem = maxT - timer % maxT; + + this.fontRendererObj.drawString(this.mName, 8, 4, 4210752); + this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.modID + ":textures/GUI/RadHatch.png")); + if (((GT_Container_RadioHatch) mContainer).mass > 0) { + GL11.glColor3f(((GT_Container_RadioHatch) mContainer).r / 255f, ((GT_Container_RadioHatch) mContainer).g / 255f, ((GT_Container_RadioHatch) mContainer).b / 255f); + this.drawTexturedModalRect(124, 18, 124, 18, 16, 48); + } + GL11.glColor3f(1f, 1f, 1f); + this.drawTexturedModalRect(124, 18, 176, 0, 16, 48 - (int) Math.ceil(48 * (rem / maxT))); + this.drawTexturedModalRect(65, 13, 192, 0, (48 * (((GT_Container_RadioHatch) mContainer).sv)) / (maxSv), 16); + + this.fontRendererObj.drawString("Sv: " + ((GT_Container_RadioHatch) mContainer).sievert, 8, 50, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); + this.fontRendererObj.drawString("Kg: " + ((GT_Container_RadioHatch) mContainer).mass, 8, 68, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); + this.fontRendererObj.drawString("Time: " + timer, 8, 76, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); + + } + + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (this.width - this.xSize) / 2; + int y = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java new file mode 100644 index 0000000000..15523b68f6 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java @@ -0,0 +1,298 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.client.renderer; + +import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock; +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_BioVat; +import com.github.bartimaeusnek.bartworks.util.Coords; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.fluids.BlockFluidBase; +import net.minecraftforge.fluids.IFluidBlock; + + +public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler { + private static final float LIGHT_Y_NEG = 0.5f; + private static final float LIGHT_Y_POS = 1f; + private static final float LIGHT_XZ_NEG = 0.8f; + private static final float LIGHT_XZ_POS = 0.6f; + private static final float THREE_QUARTERS_FILLED = 0.875f; + private static final double RENDER_OFFSET = 0.0010000000474974513; + + public static RendererSwitchingColorFluid instance = new RendererSwitchingColorFluid(); + + private float getFluidHeightAverage(float[] flow) { + float total = 0.0f; + int count = 0; + float end = 0.0f; + for (float aFlow : flow) { + if (aFlow >= RendererSwitchingColorFluid.THREE_QUARTERS_FILLED && end != RendererSwitchingColorFluid.LIGHT_Y_POS) { + end = aFlow; + } + if (aFlow >= 0.0f) { + total += aFlow; + ++count; + } + } + if (end == 0.0f) { + end = total / count; + } + return end; + } + + private float getFluidHeightForRender(IBlockAccess world, int x, int y, int z, BlockFluidBase block) { + + if (world.getBlock(x, y, z) == block) { + Block vOrigin = world.getBlock(x, y + 1, z); + if (vOrigin.getMaterial().isLiquid() || vOrigin instanceof IFluidBlock) { + return RendererSwitchingColorFluid.LIGHT_Y_POS; + } + if (world.getBlockMetadata(x, y, z) == block.getMaxRenderHeightMeta()) { + return RendererSwitchingColorFluid.THREE_QUARTERS_FILLED; + } + } + return (!world.getBlock(x, y, z).getMaterial().isSolid() && world.getBlock(x, y + 1, z) == block) ? RendererSwitchingColorFluid.LIGHT_Y_POS : (block.getQuantaPercentage(world, x, y, z) * RendererSwitchingColorFluid.THREE_QUARTERS_FILLED); + } + + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { + } + + + @SideOnly(Side.CLIENT) + public boolean renderWorldBlock(IBlockAccess iBlockAccess, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + if ((!(block instanceof BioFluidBlock))) + return false; + Tessellator tessellator = Tessellator.instance; + Coords blockat = new Coords(x, y, z, iBlockAccess.getTileEntity(x, y, z).getWorldObj().provider.dimensionId); + Integer rgb = GT_TileEntity_BioVat.staticColorMap.get(blockat); + + int r, g, b; + + if (rgb != null) { + r = (rgb >> 16) & 0xFF; + g = (rgb >> 8) & 0xFF; + b = rgb & 0xFF; + } else { + r = 0; + g = 0; + b = 255; + } + float red = ((float) r) / 255f, green = ((float) g) / 255f, blue = ((float) b) / 255f; + + BlockFluidBase blockFluidBase = (BlockFluidBase) block; + boolean renderTop = iBlockAccess.getBlock(x, y + 1, z) != blockFluidBase; + boolean renderBottom = + block.shouldSideBeRendered(iBlockAccess, x, y - 1, z, 0) + && iBlockAccess.getBlock(x, y - 1, z) != blockFluidBase; + boolean[] renderSides = { + block.shouldSideBeRendered(iBlockAccess, x, y, z - 1, 2), + block.shouldSideBeRendered(iBlockAccess, x, y, z + 1, 3), + block.shouldSideBeRendered(iBlockAccess, x - 1, y, z, 4), + block.shouldSideBeRendered(iBlockAccess, x + 1, y, z, 5) + }; + if (!renderTop && !renderBottom && !renderSides[0] && !renderSides[1] && !renderSides[2] && !renderSides[3]) { + return false; + } + boolean rendered = false; + float fluidHeightForRender = this.getFluidHeightForRender(iBlockAccess, x, y, z, blockFluidBase); + double heightNW, heightSW, heightSE, heightNE; + + if (fluidHeightForRender != RendererSwitchingColorFluid.LIGHT_Y_POS) { + float fluidHeightForRender1 = this.getFluidHeightForRender(iBlockAccess, x - 1, y, z - 1, blockFluidBase); + float fluidHeightForRender2 = this.getFluidHeightForRender(iBlockAccess, x - 1, y, z, blockFluidBase); + float fluidHeightForRender3 = this.getFluidHeightForRender(iBlockAccess, x - 1, y, z + 1, blockFluidBase); + float fluidHeightForRender4 = this.getFluidHeightForRender(iBlockAccess, x, y, z - 1, blockFluidBase); + float fluidHeightForRender5 = this.getFluidHeightForRender(iBlockAccess, x, y, z + 1, blockFluidBase); + float fluidHeightForRender6 = this.getFluidHeightForRender(iBlockAccess, x + 1, y, z - 1, blockFluidBase); + float fluidHeightForRender7 = this.getFluidHeightForRender(iBlockAccess, x + 1, y, z, blockFluidBase); + float fluidHeightForRender8 = this.getFluidHeightForRender(iBlockAccess, x + 1, y, z + 1, blockFluidBase); + heightNW = this.getFluidHeightAverage(new float[]{fluidHeightForRender1, fluidHeightForRender2, fluidHeightForRender4, fluidHeightForRender}); + heightSW = this.getFluidHeightAverage(new float[]{fluidHeightForRender2, fluidHeightForRender3, fluidHeightForRender5, fluidHeightForRender}); + heightSE = this.getFluidHeightAverage(new float[]{fluidHeightForRender5, fluidHeightForRender7, fluidHeightForRender8, fluidHeightForRender}); + heightNE = this.getFluidHeightAverage(new float[]{fluidHeightForRender4, fluidHeightForRender6, fluidHeightForRender7, fluidHeightForRender}); + } else { + heightNW = fluidHeightForRender; + heightSW = fluidHeightForRender; + heightSE = fluidHeightForRender; + heightNE = fluidHeightForRender; + } + + if (renderer.renderAllFaces || renderTop) { + rendered = true; + IIcon iconStill = this.getNullCheckedIiconOrFallbackTexture(); + float flowDir = (float) BlockFluidBase.getFlowDirection(iBlockAccess, x, y, z); + + heightNW -= RendererSwitchingColorFluid.RENDER_OFFSET; + heightSW -= RendererSwitchingColorFluid.RENDER_OFFSET; + heightSE -= RendererSwitchingColorFluid.RENDER_OFFSET; + heightNE -= RendererSwitchingColorFluid.RENDER_OFFSET; + + double dInterpolatedU, dInterpolatedV, dInterpolatedU2, dInterpolatedV2, dInterpolatedU3, dInterpolatedV3, dInterpolatedU4, dInterpolatedV4; + + if (flowDir < -999.0f) { + dInterpolatedU = iconStill.getInterpolatedU(0.0); + dInterpolatedV = iconStill.getInterpolatedV(0.0); + dInterpolatedU2 = dInterpolatedU; + dInterpolatedV2 = iconStill.getInterpolatedV(16.0); + dInterpolatedU3 = iconStill.getInterpolatedU(16.0); + dInterpolatedV3 = dInterpolatedV2; + dInterpolatedU4 = dInterpolatedU3; + dInterpolatedV4 = dInterpolatedV; + } else { + float xFlow = MathHelper.sin(flowDir) * 0.25f, zFlow = MathHelper.cos(flowDir) * 0.25f; + dInterpolatedU = iconStill.getInterpolatedU((double) (8.0f + (-zFlow - xFlow) * 16.0f)); + dInterpolatedV = iconStill.getInterpolatedV((double) (8.0f + (-zFlow + xFlow) * 16.0f)); + dInterpolatedU2 = iconStill.getInterpolatedU((double) (8.0f + (-zFlow + xFlow) * 16.0f)); + dInterpolatedV2 = iconStill.getInterpolatedV((double) (8.0f + (zFlow + xFlow) * 16.0f)); + dInterpolatedU3 = iconStill.getInterpolatedU((double) (8.0f + (zFlow + xFlow) * 16.0f)); + dInterpolatedV3 = iconStill.getInterpolatedV((double) (8.0f + (zFlow - xFlow) * 16.0f)); + dInterpolatedU4 = iconStill.getInterpolatedU((double) (8.0f + (zFlow - xFlow) * 16.0f)); + dInterpolatedV4 = iconStill.getInterpolatedV((double) (8.0f + (-zFlow - xFlow) * 16.0f)); + } + + tessellator.setBrightness(block.getMixedBrightnessForBlock(iBlockAccess, x, y, z)); + tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_POS * red, RendererSwitchingColorFluid.LIGHT_Y_POS * green, RendererSwitchingColorFluid.LIGHT_Y_POS * blue); + + tessellator.addVertexWithUV((double) x, y + heightNW, (double) z, dInterpolatedU, dInterpolatedV); + tessellator.addVertexWithUV((double) x, y + heightSW, (double) (z + 1), dInterpolatedU2, dInterpolatedV2); + tessellator.addVertexWithUV((double) (x + 1), y + heightSE, (double) (z + 1), dInterpolatedU3, dInterpolatedV3); + tessellator.addVertexWithUV((double) (x + 1), y + heightNE, (double) z, dInterpolatedU4, dInterpolatedV4); + tessellator.addVertexWithUV((double) x, y + heightNW, (double) z, dInterpolatedU, dInterpolatedV); + tessellator.addVertexWithUV((double) (x + 1), y + heightNE, (double) z, dInterpolatedU4, dInterpolatedV4); + tessellator.addVertexWithUV((double) (x + 1), y + heightSE, (double) (z + 1), dInterpolatedU3, dInterpolatedV3); + tessellator.addVertexWithUV((double) x, y + heightSW, (double) (z + 1), dInterpolatedU2, dInterpolatedV2); + + } + + if (renderer.renderAllFaces || renderBottom) { + rendered = true; + tessellator.setBrightness(block.getMixedBrightnessForBlock(iBlockAccess, x, y - 1, z)); + tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_NEG * red, RendererSwitchingColorFluid.LIGHT_Y_NEG * green, RendererSwitchingColorFluid.LIGHT_Y_NEG * blue); + renderer.renderFaceYNeg(block, (double) x, y + RendererSwitchingColorFluid.RENDER_OFFSET, (double) z, this.getNullCheckedIiconOrFallbackTexture()); + } + + for (int side = 0; side < 4; ++side) { + int x2 = x, z2 = z; + + switch (side) { + case 0: + --z2; + break; + case 1: + ++z2; + break; + case 2: + --x2; + break; + case 3: + ++x2; + break; + default: + break; + } + + IIcon iconFlow = this.getNullCheckedIiconOrFallbackTexture(); + + if (renderer.renderAllFaces || renderSides[side]) { + rendered = true; + double dHeight1, dHeight2, dXcoord1, dXcoord2, dZcoord1, dZcoord2; + if (side == 0) { + dHeight1 = heightNW; + dHeight2 = heightNE; + dXcoord1 = x; + dXcoord2 = x + 1; + dZcoord1 = z + RendererSwitchingColorFluid.RENDER_OFFSET; + dZcoord2 = z + RendererSwitchingColorFluid.RENDER_OFFSET; + } else if (side == 1) { + dHeight1 = heightSE; + dHeight2 = heightSW; + dXcoord1 = x + 1; + dXcoord2 = x; + dZcoord1 = z + 1 - RendererSwitchingColorFluid.RENDER_OFFSET; + dZcoord2 = z + 1 - RendererSwitchingColorFluid.RENDER_OFFSET; + } else if (side == 2) { + dHeight1 = heightSW; + dHeight2 = heightNW; + dXcoord1 = x + RendererSwitchingColorFluid.RENDER_OFFSET; + dXcoord2 = x + RendererSwitchingColorFluid.RENDER_OFFSET; + dZcoord1 = z + 1; + dZcoord2 = z; + } else { + dHeight1 = heightNE; + dHeight2 = heightSE; + dXcoord1 = x + 1 - RendererSwitchingColorFluid.RENDER_OFFSET; + dXcoord2 = x + 1 - RendererSwitchingColorFluid.RENDER_OFFSET; + dZcoord1 = z; + dZcoord2 = z + 1; + } + float u1Flow = iconFlow.getInterpolatedU(0.0); + float u2Flow = iconFlow.getInterpolatedU(8.0); + float v1Flow = iconFlow.getInterpolatedV((1.0 - dHeight1) * 16.0 * 0.5); + float v2Flow = iconFlow.getInterpolatedV((1.0 - dHeight2) * 16.0 * 0.5); + float v3Flow = iconFlow.getInterpolatedV(8.0); + tessellator.setBrightness(block.getMixedBrightnessForBlock(iBlockAccess, x2, y, z2)); + float sideLighting; + if (side < 2) { + sideLighting = RendererSwitchingColorFluid.LIGHT_XZ_NEG; + } else { + sideLighting = RendererSwitchingColorFluid.LIGHT_XZ_POS; + } + tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * red, RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * green, RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * blue); + + tessellator.addVertexWithUV(dXcoord1, y + dHeight1, dZcoord1, (double) u1Flow, (double) v1Flow); + tessellator.addVertexWithUV(dXcoord2, y + dHeight2, dZcoord2, (double) u2Flow, (double) v2Flow); + tessellator.addVertexWithUV(dXcoord2, (double) y, dZcoord2, (double) u2Flow, (double) v3Flow); + tessellator.addVertexWithUV(dXcoord1, (double) y, dZcoord1, (double) u1Flow, (double) v3Flow); + tessellator.addVertexWithUV(dXcoord1, y + dHeight1, dZcoord1, (double) u1Flow, (double) v1Flow); + tessellator.addVertexWithUV(dXcoord1, (double) y, dZcoord1, (double) u1Flow, (double) v3Flow); + tessellator.addVertexWithUV(dXcoord2, (double) y, dZcoord2, (double) u2Flow, (double) v3Flow); + tessellator.addVertexWithUV(dXcoord2, y + dHeight2, dZcoord2, (double) u2Flow, (double) v2Flow); + } + } + renderer.renderMinY = 0.0; + renderer.renderMaxY = 1.0; + return rendered; + } + + public boolean shouldRender3DInInventory(int modelId) { + return false; + } + + public int getRenderId() { + return FluidLoader.renderID; + } + + private IIcon getNullCheckedIiconOrFallbackTexture() { + return FluidLoader.autogenIIcon != null ? FluidLoader.autogenIIcon : ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java deleted file mode 100644 index 33999f71d4..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.github.bartimaeusnek.bartworks.common; - - -import com.github.bartimaeusnek.bartworks.MainMod; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import gregtech.api.enums.GT_Values; -import net.minecraftforge.common.config.Configuration; - -import java.io.File; - -public class ConfigHandler { - public static int IDOffset = 12600; - public static final int IDU=1+ GT_Values.VN.length; - public static boolean ezmode = false; - public static boolean teslastaff = false; - public static long energyPerCell = 100000L; - public static boolean newStuff = true; - public final Configuration c; - public ConfigHandler(FMLPreInitializationEvent e){ - c = new Configuration(new File(e.getModConfigurationDirectory().toString()+"/"+MainMod.modID+".cfg")); - - IDOffset=c.get("System","ID Offset",12600,"ID Offset for this mod. This Mod uses "+IDU+" IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600); - energyPerCell=c.get("Multiblocks","energyPerLESUCell",1000000,"This will set Up the Energy per LESU Cell",1000000,Integer.MAX_VALUE).getInt(1000000); - ezmode=c.get("System","Mode switch",false,"If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false); - MainMod.GTNH = ezmode ? !MainMod.GTNH : MainMod.GTNH; - teslastaff=c.get("System","Enable Teslastaff",false,"Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); - newStuff=!c.get("System","Disable non-original-GT-stuff",false,"This switch disables my new content, that is not part of the GT2 compat").getBoolean(false); - - if (c.hasChanged()) - c.save(); - - } - -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java index a838e52125..ea7869c982 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.blocks; import com.github.bartimaeusnek.bartworks.MainMod; @@ -7,35 +29,48 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EnumCreatureType; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; import java.util.List; public class BW_Blocks extends Block { + @SideOnly(Side.CLIENT) + private IIcon[] texture; + private String[] textureNames; + private String name; + public BW_Blocks(String name, String[] texture) { super(Material.anvil); this.setHardness(15.0F); this.setResistance(30.0F); this.name = name; - this.textureNames=texture; + this.textureNames = texture; this.setCreativeTab(MainMod.GT2); } + public BW_Blocks(String name, String[] texture, CreativeTabs tabs) { super(Material.anvil); this.setHardness(15.0F); this.setResistance(30.0F); this.name = name; - this.textureNames=texture; + this.textureNames = texture; this.setCreativeTab(tabs); } - @SideOnly(Side.CLIENT) - private IIcon[] texture; - private String[] textureNames; - private String name; + public BW_Blocks(String name, String[] texture, CreativeTabs tabs, Material material) { + super(material); + this.setHardness(15.0F); + this.setResistance(30.0F); + this.name = name; + this.textureNames = texture; + this.setCreativeTab(tabs); + } @Override public int damageDropped(final int meta) { @@ -44,7 +79,7 @@ public class BW_Blocks extends Block { @Override public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) { - for (int i = 0; i < textureNames.length; i ++) { + for (int i = 0; i < textureNames.length; i++) { list.add(new ItemStack(item, 1, i)); } } @@ -57,7 +92,7 @@ public class BW_Blocks extends Block { @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister){ + public void registerBlockIcons(IIconRegister par1IconRegister) { texture = new IIcon[textureNames.length]; for (int i = 0; i < textureNames.length; i++) { texture[i] = par1IconRegister.registerIcon(textureNames[i]); @@ -65,7 +100,22 @@ public class BW_Blocks extends Block { } @Override - public String getUnlocalizedName(){ + public String getUnlocalizedName() { return name; } + + @Override + public boolean canBeReplacedByLeaves(IBlockAccess world, int x, int y, int z) { + return false; + } + + @Override + public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) { + return false; + } + + @Override + public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { + return false; + } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java new file mode 100644 index 0000000000..db93c1cfe6 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.world.IBlockAccess; + +public class BW_GlasBlocks extends BW_Blocks { + + public BW_GlasBlocks(String name, String[] texture, CreativeTabs tabs) { + super(name, texture, tabs, Material.glass); + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldClient, int xCoord, int yCoord, int zCoord, int aSide) { + if (worldClient.getBlock(xCoord, yCoord, zCoord) instanceof BW_GlasBlocks) + return false; + return super.shouldSideBeRendered(worldClient, xCoord, yCoord, zCoord, aSide); + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() { + return 1; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + protected boolean canSilkHarvest() { + return false; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index b90bfeeec9..b0be51a5c0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.blocks; import com.github.bartimaeusnek.bartworks.MainMod; @@ -17,15 +39,14 @@ public class BW_TileEntityContainer extends BlockContainer { Class tileEntity = null; - public BW_TileEntityContainer(Material p_i45386_1_,Class tileEntity, String blockName) { + public BW_TileEntityContainer(Material p_i45386_1_, Class tileEntity, String blockName) { super(p_i45386_1_); - this.tileEntity=tileEntity; + this.tileEntity = tileEntity; this.setCreativeTab(MainMod.BWT); this.setBlockName(blockName); - this.setBlockTextureName(MainMod.modID+":"+blockName); + this.setBlockTextureName(MainMod.modID + ":" + blockName); } - @Override public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { if (worldObj.isRemote) { @@ -34,7 +55,7 @@ public class BW_TileEntityContainer extends BlockContainer { if (!player.isSneaking()) { final TileEntity tile = worldObj.getTileEntity(x, y, z); if (tile instanceof IHasGui) { - return worldObj.isRemote || IC2.platform.launchGui(player, (IHasGui)tile); + return worldObj.isRemote || IC2.platform.launchGui(player, (IHasGui) tile); } } @@ -45,23 +66,23 @@ public class BW_TileEntityContainer extends BlockContainer { public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack itemStack) { final TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof IWrenchable && itemStack != null) { - final IWrenchable tile2 = (IWrenchable)tile; + final IWrenchable tile2 = (IWrenchable) tile; int meta = itemStack.getItemDamage(); world.setBlockMetadataWithNotify(x, y, z, meta, 2); if (entity != null) { final int face = MathHelper.floor_double(entity.rotationYaw * 4.0f / 360.0f + 0.5) & 0x3; switch (face) { case 0: - tile2.setFacing((short)2); + tile2.setFacing((short) 2); break; case 1: - tile2.setFacing((short)5); + tile2.setFacing((short) 5); break; case 2: - tile2.setFacing((short)3); + tile2.setFacing((short) 3); break; case 3: - tile2.setFacing((short)4); + tile2.setFacing((short) 4); break; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java new file mode 100644 index 0000000000..3a17a3759b --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.blocks; + +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; +import com.github.bartimaeusnek.bartworks.common.tileentities.BWTileEntityDimIDBridge; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.fluids.BlockFluidBase; +import net.minecraftforge.fluids.FluidStack; + +public class BioFluidBlock extends BlockFluidBase implements ITileEntityProvider { + + public BioFluidBlock() { + super(FluidLoader.ff, Material.water); + this.setBlockName("BioFluidBlock"); + //this.setCreativeTab(MainMod.BioTab); + this.textureName = "gregtech:fluids/fluid.molten.autogenerated"; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister p_149651_1_) { + FluidLoader.autogenIIcon = this.blockIcon = p_149651_1_.registerIcon(this.getTextureName()); + } + + @Override + public int getQuantaValue(IBlockAccess world, int x, int y, int z) { + return 0; + } + + @Override + public boolean canCollideCheck(int meta, boolean fullHit) { + return false; + } + + @Override + public int getMaxRenderHeightMeta() { + return 0; + } + + public int getRenderType() { + return FluidLoader.renderID; + } + + @Override + public FluidStack drain(World world, int x, int y, int z, boolean doDrain) { + return null; + } + + @Override + public boolean canDrain(World world, int x, int y, int z) { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) { + return FluidLoader.autogenIIcon; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return FluidLoader.autogenIIcon; + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new BWTileEntityDimIDBridge(); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java new file mode 100644 index 0000000000..69621bc1b5 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.configs; + + +import com.github.bartimaeusnek.bartworks.MainMod; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import gregtech.api.enums.GT_Values; +import net.minecraftforge.common.config.Configuration; + +import javax.annotation.Nonnull; +import java.io.File; + +public class ConfigHandler { + private static final int IDU = GT_Values.VN.length * 8 - 3; + public static int IDOffset = 12600; + public static boolean teslastaff = false; + public static long energyPerCell = 100000L; + public static boolean newStuff = true; + public static boolean BioLab = true; + public static Configuration c; + private static boolean ezmode = false; + + public ConfigHandler(@Nonnull FMLPreInitializationEvent e) { + c = new Configuration(new File(e.getModConfigurationDirectory().toString() + "/" + MainMod.modID + ".cfg")); + + IDOffset = c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600); + energyPerCell = c.get("Multiblocks", "energyPerLESUCell", 1000000, "This will set Up the Energy per LESU Cell", 1000000, Integer.MAX_VALUE).getInt(1000000); + ezmode = c.get("System", "Mode switch", false, "If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false); + MainMod.GTNH = ezmode ? !MainMod.GTNH : MainMod.GTNH; + teslastaff = c.get("System", "Enable Teslastaff", false, "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); + newStuff = !c.get("System", "Disable non-original-GT-stuff", false, "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false); + BioLab = !c.get("System", "Disable BioLab", false, "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!").getBoolean(false); + + if (ConfigHandler.IDOffset == 0) { + ConfigHandler.IDOffset = 12600; + c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600); + } + + if (c.hasChanged()) + c.save(); + + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index 959a67014e..2066ac3b8e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -1,6 +1,29 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.util.GT_LanguageManager; @@ -14,16 +37,16 @@ import java.util.List; public class BW_ItemBlocks extends ItemBlock { - public BW_ItemBlocks(final Block par1){ + protected final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + protected final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + + public BW_ItemBlocks(final Block par1) { super(par1); this.setMaxDamage(0); this.setHasSubtypes(true); this.setCreativeTab(MainMod.GT2); } - protected final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); - protected final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); - @Override public int getMetadata(final int aMeta) { return aMeta; @@ -38,12 +61,13 @@ public class BW_ItemBlocks extends ItemBlock { public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { aList.add(this.mNoMobsToolTip); aList.add(this.mNoTileEntityToolTip); + aList.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); } @Override @SideOnly(Side.CLIENT) public IIcon getIcon(ItemStack stack, int pass) { - return this.field_150939_a.getIcon(0,stack.getItemDamage()); + return this.field_150939_a.getIcon(0, stack.getItemDamage()); } @Override @@ -55,6 +79,6 @@ public class BW_ItemBlocks extends ItemBlock { @Override @SideOnly(Side.CLIENT) public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) { - return this.field_150939_a.getIcon(0,p_77618_2_); + return this.field_150939_a.getIcon(0, p_77618_2_); } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index 3fb86d4963..edb2f32e77 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -1,6 +1,29 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ic2.api.item.IKineticRotor; @@ -27,22 +50,22 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { private ResourceLocation tex; private String itemTex; - public BW_Stonage_Rotors(int diameter, float eff, int min, int max,int durability, GearboxType type,ResourceLocation tex, String Name, String itemTex){ - this.DiaMinMax[0]=diameter; - this.DiaMinMax[1]=min; - this.DiaMinMax[2]=max; - this.eff=eff; - this.type=type; - this.tex=tex; + public BW_Stonage_Rotors(int diameter, float eff, int min, int max, int durability, GearboxType type, ResourceLocation tex, String Name, String itemTex) { + this.DiaMinMax[0] = diameter; + this.DiaMinMax[1] = min; + this.DiaMinMax[2] = max; + this.eff = eff; + this.type = type; + this.tex = tex; this.setMaxDamage(durability); this.setUnlocalizedName(Name); this.setCreativeTab(MainMod.BWT); - this.itemTex=itemTex; + this.itemTex = itemTex; } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(MainMod.modID+":"+itemTex); + this.itemIcon = iconRegister.registerIcon(MainMod.modID + ":" + itemTex); } public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { @@ -56,6 +79,7 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { if (type != null) { info.add(StatCollector.translateToLocal(("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type)))); } + info.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index a8df28c5aa..6f8fe09229 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; @@ -20,23 +42,24 @@ import java.util.List; public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem { public Circuit_Programmer() { - super("BWCircuitProgrammer","Circuit Programmer","Programs Integrated Circuits"); + super("BWCircuitProgrammer", "Circuit Programmer", "Programs Integrated Circuits"); this.setMaxStackSize(1); this.setNoRepair(); this.setHasSubtypes(false); this.setCreativeTab(MainMod.BWT); } + @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { - super.addInformation(aStack,aPlayer,aList,aF3_H); + super.addInformation(aStack, aPlayer, aList, aF3_H); if (aStack != null && aStack.getTagCompound() != null) - aList.add("Has Circuit inside? "+ (aStack.getTagCompound().getBoolean("HasChip") ? "Yes" : "No")); - aList.add("Added by"+ ChatColorHelper.DARKGREEN +" BartWorks"); + aList.add("Has Circuit inside? " + (aStack.getTagCompound().getBoolean("HasChip") ? "Yes" : "No")); + aList.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); } @Override public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { - if (ElectricItem.manager.use(aStack,100,aPlayer)) { + if (ElectricItem.manager.use(aStack, 100, aPlayer)) { aPlayer.openGui(MainMod.instance, 1, aWorld, 0, 0, 0); } return aStack; @@ -59,7 +82,8 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem public void registerIcons(IIconRegister aIconRegister) { this.mIcon = aIconRegister.registerIcon("bartworks:CircuitProgrammer"); } - public int getTier(ItemStack var1){ + + public int getTier(ItemStack var1) { return 1; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java index 88883a039c..04fa57efdd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; @@ -12,11 +34,10 @@ import net.minecraft.world.World; import java.util.List; -public class GT_Destructopack_Item extends GT_Generic_Item -{ +public class GT_Destructopack_Item extends GT_Generic_Item { public GT_Destructopack_Item() { - super("GT2Destructopack","Destructopack","Mobile Trash Bin"); + super("GT2Destructopack", "Destructopack", "Mobile Trash Bin"); this.setMaxStackSize(1); this.setNoRepair(); this.setHasSubtypes(false); @@ -25,8 +46,8 @@ public class GT_Destructopack_Item extends GT_Generic_Item @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { - super.addInformation(aStack,aPlayer,aList,aF3_H); - aList.add("Added by"+ ChatColorHelper.DARKGREEN +" BartWorks"); + super.addInformation(aStack, aPlayer, aList, aF3_H); + aList.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index 3148281c38..38873cd04a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; @@ -27,67 +49,63 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -public class GT_Rockcutter_Item extends ItemTool implements IElectricItem -{ - @SideOnly(Side.CLIENT) - private IIcon icon; - +public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { + public static Set mineableBlocks = Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); public int mCharge; public int mTransfer; public int mTier; - public static Set mineableBlocks = Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); + @SideOnly(Side.CLIENT) + private IIcon icon; private int multi; + public GT_Rockcutter_Item(int aTier) { - super(2*aTier, ToolMaterial.EMERALD, mineableBlocks); + super(2 * aTier, ToolMaterial.EMERALD, mineableBlocks); this.mTier = aTier; - multi = (int) Math.pow(10,(mTier-1)); + multi = (int) Math.pow(10, (mTier - 1)); this.mineableBlocks = new HashSet(); - this.maxStackSize=1; + this.maxStackSize = 1; this.mCharge = 10000 * multi; this.mTransfer = (int) GT_Values.V[mTier]; - this.efficiencyOnProperMaterial = 2.0f*mTier; + this.efficiencyOnProperMaterial = 2.0f * mTier; this.setCreativeTab(MainMod.GT2); - this.setMaxDamage(27+ 10*multi); + this.setMaxDamage(27 + 10 * multi); this.setNoRepair(); - this.setUnlocalizedName("GT_Rockcutter_Item_"+ GT_Values.VN[mTier]); + this.setUnlocalizedName("GT_Rockcutter_Item_" + GT_Values.VN[mTier]); } public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { aList.add("Tier: " + GT_Values.VN[this.mTier]); - aList.add("Added by"+ ChatColorHelper.DARKGREEN +" BartWorks"); + aList.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); } public void onUpdate(ItemStack aStack, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { - if (!ElectricItem.manager.canUse(aStack, 500*multi)) { + if (!ElectricItem.manager.canUse(aStack, 500 * multi)) { if (aStack.isItemEnchanted()) { aStack.getTagCompound().removeTag("ench"); } - } - else if (!aStack.isItemEnchanted()) { - aStack.addEnchantment(Enchantment.silkTouch,3); + } else if (!aStack.isItemEnchanted()) { + aStack.addEnchantment(Enchantment.silkTouch, 3); } } - public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) - { + public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { ElectricItem.manager.use(aStack, 0, aPlayer); return false; } - + public boolean onBlockDestroyed(final ItemStack var1, final World var2, final Block var3, final int var4, final int var5, final int var6, final EntityLivingBase var7) { ElectricItem.manager.use(var1, 0, var7); - if (ElectricItem.manager.canUse(var1, 500*multi)) { - ElectricItem.manager.use(var1, 500*multi, var7); - } - else{ - ElectricItem.manager.discharge(var1, Integer.MAX_VALUE, Integer.MAX_VALUE, true,true, false); + if (ElectricItem.manager.canUse(var1, 500 * multi)) { + ElectricItem.manager.use(var1, 500 * multi, var7); + } else { + ElectricItem.manager.discharge(var1, Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, false); } return true; } @Override public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) { - return par1Block.getMaterial().equals(Material.glass) || par1Block.getMaterial().equals(Material.clay) || par1Block.getMaterial().equals(Material.packedIce) || par1Block.getMaterial().equals(Material.ice) || par1Block.getMaterial().equals(Material.sand) || par1Block.getMaterial().equals(Material.ground) || par1Block.getMaterial().equals(Material.rock) || this.mineableBlocks.contains(par1Block); + return par1Block.getMaterial().equals(Material.glass) || par1Block.getMaterial().equals(Material.clay) || par1Block.getMaterial().equals(Material.packedIce) || par1Block.getMaterial().equals(Material.ice) || par1Block.getMaterial().equals(Material.sand) || par1Block.getMaterial().equals(Material.ground) || par1Block.getMaterial().equals(Material.rock) || this.mineableBlocks.contains(par1Block); } @SideOnly(Side.CLIENT) @@ -102,7 +120,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem itemList.add(new ItemStack(this, 1, getMaxDamage())); } } - + @Override public boolean canProvideEnergy(ItemStack itemStack) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java index 59f8ac5835..de59f9cec0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; @@ -21,16 +43,14 @@ import net.minecraft.util.IIcon; import java.util.List; import java.util.Set; -public class GT_Teslastaff_Item extends ItemTool implements IElectricItem -{ +public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { + private static Set effective = Sets.newHashSet(Blocks.web); public double mCharge; public double mTransfer; public int mTier; - private static Set effective = Sets.newHashSet(Blocks.web); - @SideOnly(Side.CLIENT) private IIcon icon; - + public GT_Teslastaff_Item() { super(0, ToolMaterial.GOLD, effective); this.setCreativeTab(MainMod.GT2); @@ -46,17 +66,17 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem @Override public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { aList.add("No warranty!"); - aList.add("Added by"+ ChatColorHelper.DARKGREEN +" BartWorks"); + aList.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); } public boolean hitEntity(ItemStack aStack, EntityLivingBase aTarget, EntityLivingBase aPlayer) { if (aTarget instanceof EntityLiving && ElectricItem.manager.canUse(aStack, 9000000)) { - final EntityLiving tTarget = (EntityLiving)aTarget; - final EntityLivingBase tPlayer = (EntityLivingBase)aPlayer; + final EntityLiving tTarget = (EntityLiving) aTarget; + final EntityLivingBase tPlayer = (EntityLivingBase) aPlayer; ElectricItem.manager.use(aStack, 9000000, tPlayer); for (int i = 1; i < 5; ++i) { if (tTarget.getEquipmentInSlot(i) != null && tTarget.getEquipmentInSlot(i).getItem() instanceof IElectricItem) { - tTarget.setCurrentItemOrArmor(i,null); + tTarget.setCurrentItemOrArmor(i, null); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java new file mode 100644 index 0000000000..f434fd5d5f --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.items; + +import com.github.bartimaeusnek.bartworks.MainMod; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +import java.util.List; + +public class LabModule extends SimpleSubItemClass { + public LabModule(String[] tex) { + super(tex); + this.setCreativeTab(MainMod.BioTab); + } + + public String getUnlocalizedName(ItemStack p_77667_1_) { + return "labModule." + super.getUnlocalizedName(p_77667_1_); + } + + @Override + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { + aList.add("A Module used to change the BioLab's working Mode"); + super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java new file mode 100644 index 0000000000..5fa2064026 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.items; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +import java.util.List; + +import static com.github.bartimaeusnek.bartworks.common.loaders.BioItemList.*; + +public class LabParts extends SimpleSubItemClass { + + public LabParts(String[] tex) { + super(tex); + this.setCreativeTab(MainMod.BioTab); + } + + @Override + public EnumRarity getRarity(ItemStack itemStack) { + + if (itemStack == null || itemStack.getTagCompound() == null) + return EnumRarity.common; + + switch (itemStack.getItemDamage()) { + case 0: + return BW_Util.getRarityFromByte(itemStack.getTagCompound().getCompoundTag("DNA").getByte("Rarity")); + case 1: + case 2: + return BW_Util.getRarityFromByte(itemStack.getTagCompound().getByte("Rarity")); + default: + return EnumRarity.common; + } + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int p_82790_2_) { + if (stack.getItemDamage() == 0 && stack.getTagCompound() != null && stack.getTagCompound().getIntArray("Color") != null && stack.getTagCompound().getIntArray("Color").length > 0) { + int[] rgb = stack.getTagCompound().getIntArray("Color"); + return BW_Util.getColorFromArray(rgb); + } + return super.getColorFromItemStack(stack, p_82790_2_); + } + + @Override + public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean b) { + if (itemStack == null || itemStack.getTagCompound() == null) { + switch (itemStack.getItemDamage()) { + case 0: + list.add("An empty Sterilized Petri Dish."); + break; + case 1: + list.add("An empty DNA Flask."); + break; + case 2: + list.add("An empty Plasmid Cell."); + break; + case 3: + list.add("A special washing power for Bio Engineering."); + break; + case 4: + list.add("A powder for the separation of DNA by electrophoresis."); + break; + default: + break; + } + super.addInformation(itemStack, entityPlayer, list, b); + return; + } + + + switch (itemStack.getItemDamage()) { + case 0: + list.add("A Petri Dish containing: " + itemStack.getTagCompound().getString("Name")); + if (!itemStack.getTagCompound().getBoolean("Breedable")) { + list.add("This is a weak culture, it can not be bred in the Bacterial Vat"); + } + break; + case 1: + list.add("A DNA Flask containing: " + itemStack.getTagCompound().getString("Name")); + break; + case 2: + list.add("A Plasmid Cell containing: " + itemStack.getTagCompound().getString("Name")); + break; + default: + break; + } + super.addInformation(itemStack, entityPlayer, list, b); + } + + @Override + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { + for (ItemStack stack : getAllPetriDishes()) + list.add(stack); + for (ItemStack stack : getAllDNASampleFlasks()) + list.add(stack); + for (ItemStack stack : getAllPlasmidCells()) + list.add(stack); + super.getSubItems(item, creativeTabs, list); + } + + public String getUnlocalizedName(ItemStack itemStack) { + if (itemStack.getItemDamage() == 0 && itemStack.getTagCompound() != null) + return "filled.item." + this.tex[itemStack.getItemDamage()].replaceAll("/", "."); + return super.getUnlocalizedName(itemStack); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java index 41b72f6369..c38be6c6c0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.items; import cpw.mods.fml.relauncher.Side; @@ -9,13 +31,13 @@ public class SimpleIconItem extends Item { String tex; - public SimpleIconItem(String tex){ + public SimpleIconItem(String tex) { super(); - this.tex=tex; + this.tex = tex; } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { - itemIcon=iconRegister.registerIcon("bartworks:"+tex); + itemIcon = iconRegister.registerIcon("bartworks:" + tex); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java index 76b0d79b78..365efb5c81 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -1,10 +1,34 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; @@ -12,13 +36,13 @@ import net.minecraft.util.IIcon; import java.util.List; public class SimpleSubItemClass extends Item { - String[] tex; @SideOnly(Side.CLIENT) protected IIcon[] itemIcon; + String[] tex; - public SimpleSubItemClass(String[] tex){ - this.tex=tex; - this.hasSubtypes=true; + public SimpleSubItemClass(String[] tex) { + this.tex = tex; + this.hasSubtypes = true; this.setCreativeTab(MainMod.BWT); } @@ -26,11 +50,17 @@ public class SimpleSubItemClass extends Item { public void registerIcons(IIconRegister iconRegister) { itemIcon = new IIcon[tex.length]; for (int i = 0; i < tex.length; i++) { - itemIcon[i]=iconRegister.registerIcon(MainMod.modID+":"+tex[i]); + itemIcon[i] = iconRegister.registerIcon(MainMod.modID + ":" + tex[i]); } } + @Override + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { + super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); + aList.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); + } + @Override public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { for (int i = 0; i < tex.length; i++) { @@ -39,18 +69,16 @@ public class SimpleSubItemClass extends Item { } @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int p_77617_1_) - { - if (p_77617_1_ getAllPetriDishes() { + HashSet ret = new HashSet<>(); + for (BioCulture Culture : BioCulture.BIO_CULTURE_ARRAY_LIST) { + ret.add(getPetriDish(Culture)); + } + return ret; + } + + public static Collection getAllDNASampleFlasks() { + HashSet ret = new HashSet<>(); + for (BioData dna : BioData.BIO_DATA_ARRAY_LIST) { + ret.add(getDNASampleFlask(BioDNA.convertDataToDNA(dna))); + } + return ret; + } + + public static Collection getAllPlasmidCells() { + HashSet ret = new HashSet<>(); + for (BioData dna : BioData.BIO_DATA_ARRAY_LIST) { + ret.add(getPlasmidCell(BioPlasmid.convertDataToPlasmid(dna))); + } + return ret; + } + + public static ItemStack getPetriDish(BioCulture Culture) { + if (Culture == null) + return new ItemStack(vanillaBioLabParts); + ItemStack ret = new ItemStack(vanillaBioLabParts); + ret.setTagCompound(BioCulture.getNBTTagFromCulture(Culture)); + return ret; + } + + public static ItemStack getDNASampleFlask(BioDNA dna) { + if (dna == null) + return new ItemStack(vanillaBioLabParts, 1, 1); + + ItemStack ret = new ItemStack(vanillaBioLabParts, 1, 1); + ret.setTagCompound(BioData.getNBTTagFromBioData(dna)); + return ret; + } + + public static ItemStack getPlasmidCell(BioPlasmid plasmid) { + if (plasmid == null) + return new ItemStack(vanillaBioLabParts, 1, 2); + ItemStack ret = new ItemStack(vanillaBioLabParts, 1, 2); + ret.setTagCompound(BioData.getNBTTagFromBioData(plasmid)); + return ret; + } + + /** + * 1 - Detergent Powder + * 2 - Agarose + * 3 - Incubation Module + * 4 - Plasma Membrane + * others are null + * + * @param selection see above + * @return the selected Item + */ + public static ItemStack getOther(int selection) { + if (selection < 1 || selection > 4) + return null; + + return new ItemStack(vanillaBioLabParts, 1, 2 + selection); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java new file mode 100644 index 0000000000..04221196ce --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.loaders; + +public class BioLabLoader implements Runnable { + + BioCultureLoader bioCultureLoader; + FluidLoader fluidLoader; + BioItemList bioItemList; + BioRecipeLoader bioRecipeLoader; + + @Override + public void run() { + bioCultureLoader = new BioCultureLoader(); + bioCultureLoader.run(); + fluidLoader = new FluidLoader(); + fluidLoader.run(); + bioItemList = new BioItemList(); + bioRecipeLoader = new BioRecipeLoader(); + bioRecipeLoader.run(); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java new file mode 100644 index 0000000000..5fc32bcfc8 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -0,0 +1,375 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.loaders; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_BioLab; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_RadioHatch; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_BioVat; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.BioCulture; +import cpw.mods.fml.common.Loader; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + +public class BioRecipeLoader extends RecipeLoader { + + @Override + public void run() { + + //DNAExtractionModule + GT_ModHandler.addCraftingRecipe( + BioItemList.mBioLabParts[0], + RecipeLoader.BITSD, + new Object[]{ + "TET", + "CFC", + "TST", + 'T', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), + 'E', ItemList.Emitter_EV.get(1L), + 'C', GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), + 'S', ItemList.Sensor_EV.get(1L), + 'F', ItemList.Field_Generator_EV.get(1L) + } + ); + + //PCRThermoclyclingModule + GT_ModHandler.addCraftingRecipe( + BioItemList.mBioLabParts[1], + RecipeLoader.BITSD, + new Object[]{ + "NEN", + "CFC", + "NSN", + 'N', GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), + 'E', ItemList.Emitter_EV.get(1L), + 'C', GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), + 'S', ItemList.Sensor_EV.get(1L), + 'F', ItemList.Field_Generator_EV.get(1L) + } + ); + + //PlasmidSynthesisModule + GT_ModHandler.addCraftingRecipe( + BioItemList.mBioLabParts[2], + RecipeLoader.BITSD, + new Object[]{ + "SFE", + "CPC", + "NFN", + 'N', GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), + 'C', "circuit" + Materials.Data, + 'F', ItemList.Field_Generator_EV.get(1L), + 'E', ItemList.Emitter_EV.get(1L), + 'S', ItemList.Sensor_EV.get(1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), + } + ); + //TransformationModule + GT_ModHandler.addCraftingRecipe( + BioItemList.mBioLabParts[3], + RecipeLoader.BITSD, + new Object[]{ + "SFE", + "CPC", + "NFN", + 'N', GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), + 'C', "circuit" + Materials.Master, + 'F', ItemList.Field_Generator_LuV.get(1L), + 'E', ItemList.Emitter_LuV.get(1L), + 'S', ItemList.Sensor_LuV.get(1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), + } + ); + + //ClonalCellularSynthesisModule + GT_ModHandler.addCraftingRecipe( + BioItemList.mBioLabParts[4], + RecipeLoader.BITSD, + new Object[]{ + "FEF", + "CPC", + "FSF", + 'N', GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), + 'C', "circuit" + Materials.Master, + 'F', ItemList.Field_Generator_LuV.get(1L), + 'E', ItemList.Emitter_LuV.get(1L), + 'S', ItemList.Sensor_LuV.get(1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), + } + ); + + if (Loader.isModLoaded("croploadcore")) + for (int i = 0; i < OreDictionary.getOres("cropVine").size(); i++) { + GT_Values.RA.addExtractorRecipe(OreDictionary.getOres("cropVine").get(i).splitStack(12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3)); + } + else + GT_Values.RA.addExtractorRecipe(new ItemStack(Blocks.vine, 12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3)); + + GT_Values.RA.addExtractorRecipe(ItemList.Circuit_Chip_Stemcell.get(1L), BioItemList.getOther(4), 500, BW_Util.getMachineVoltageFromTier(6)); + + FluidStack dnaFluid = Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); + GT_Values.RA.addMixerRecipe(GT_Utility.getIntegratedCircuit(17), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Radon, 1L), null, null, dnaFluid, new FluidStack(FluidLoader.BioLabFluidMaterials[0], 2000), Materials.Empty.getCells(1), 500, BW_Util.getMachineVoltageFromTier(3)); + + GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(17), null, new FluidStack(BioCultureLoader.eColi.getFluid(), 1000), new FluidStack(FluidLoader.BioLabFluidMaterials[1], 10), BioItemList.getOther(4), null, null, null, null, null, new int[]{1000}, 60 * 20, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(17), null, new FluidStack(FluidLoader.BioLabFluidMaterials[1], 1000), new FluidStack(FluidLoader.BioLabFluidMaterials[3], 250), null, null, null, null, null, null, null, 60 * 20, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(17), null, new FluidStack(BioCultureLoader.CommonYeast.getFluid(), 1000), new FluidStack(FluidLoader.BioLabFluidMaterials[2], 10), null, null, null, null, null, null, null, 60 * 20, BW_Util.getMachineVoltageFromTier(3)); + + + ItemStack[] Pistons = {ItemList.Electric_Piston_HV.get(1L), ItemList.Electric_Piston_EV.get(1L), ItemList.Electric_Piston_IV.get(1L), ItemList.Electric_Piston_LuV.get(1L), ItemList.Electric_Piston_ZPM.get(1L), ItemList.Electric_Piston_UV.get(1L)}; + ItemStack[] BioLab = new ItemStack[GT_Values.VN.length - 3]; + ItemStack[] RadioHatch = new ItemStack[GT_Values.VN.length - 3]; + Materials[] cables = {Materials.Gold, Materials.Aluminium, Materials.Tungsten, Materials.VanadiumGallium, Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; + Materials[] hulls = {Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, Materials.Chrome, Materials.Iridium, Materials.Osmium, Materials.Naquadah}; + Materials[] wireMat = {Materials.Kanthal, Materials.Nichrome, Materials.TungstenSteel, Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; + Materials[] circuits = {Materials.Advanced, Materials.Data, Materials.Elite, Materials.Master, Materials.Ultimate, Materials.Superconductor}; + for (int i = 3; i < GT_Values.VN.length; i++) { + //12625 + BioLab[(i - 3)] = new GT_MetaTileEntity_BioLab(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i, GT_Values.VN[i] + " Bio Lab", GT_Values.VN[i] + " Bio Lab", i, "The BioLab, a Multi-Use Bioengineering Station").getStackForm(1L); + RadioHatch[(i - 3)] = new GT_MetaTileEntity_RadioHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i, GT_Values.VN[i] + " Radio Hatch", GT_Values.VN[i] + " Radio Hatch", i).getStackForm(1L); + try { + ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); + GT_ModHandler.addCraftingRecipe( + BioLab[(i - 3)], + RecipeLoader.BITSD, + new Object[]{ + "PFP", + "WCW", + "OGO", + 'F', GT_OreDictUnificator.get(OrePrefixes.frameGt, hulls[(i - 3)], 1L), + 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt01, wireMat[(i - 3)], 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), + 'O', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), + 'G', "circuit" + circuits[(i - 3)], + 'C', machinehull + } + ); + GT_ModHandler.addCraftingRecipe( + RadioHatch[(i - 3)], + RecipeLoader.BITSD, + new Object[]{ + "DPD", + "DCD", + "DKD", + 'D', GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), + 'C', machinehull, + 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cables[(i - 3)], 1L), + 'P', Pistons[(i - 3)] + } + ); + } catch (ArrayIndexOutOfBoundsException e) { + //e.printStackTrace(); + } + } + GT_ModHandler.addCraftingRecipe( + new GT_TileEntity_BioVat(ConfigHandler.IDOffset + GT_Values.VN.length * 7, "BioVat", "BioVat").getStackForm(1L), + RecipeLoader.BITSD, + new Object[]{ + "GCG", + "KHK", + "GCG", + 'G', new ItemStack(BioItemList.bw_glasses[0], 1, 1), + 'C', "circuit" + Materials.Data, + 'K', GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Silver, 1L), + 'H', ItemList.MACHINE_HULLS[3].get(1L) + } + ); + + + Materials[] sterilizers = {Materials.Ammonia, Materials.Chlorine, Materials.Ethanol, Materials.Methanol}; + for (Materials used : sterilizers) { + GT_Values.RA.addAutoclaveRecipe( + ItemList.Circuit_Parts_PetriDish.get(1L), + used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L), + BioItemList.getPetriDish(null), + 10000, + 100, + BW_Util.getMachineVoltageFromTier(1) + ); + + GT_Values.RA.addAutoclaveRecipe( + new ItemStack(Items.glass_bottle), + used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L), + BioItemList.getDNASampleFlask(null), + 10000, + 100, + BW_Util.getMachineVoltageFromTier(1) + ); + } + + GT_Values.RA.addLaserEngraverRecipe( + new ItemStack(Items.emerald), + GT_Utility.getIntegratedCircuit(17), + BioItemList.getPlasmidCell(null), + 100, + BW_Util.getMachineVoltageFromTier(1) + + ); + + + FluidStack[] easyFluids = {Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000)}; + for (FluidStack fluidStack : easyFluids) { + + BWRecipes.instance.addBioLabRecipeIncubation( + new ItemStack(Items.rotten_flesh), + BioCultureLoader.rottenFleshBacteria, + new int[]{3300}, + new FluidStack[]{fluidStack}, + 500, + BW_Util.getMachineVoltageFromTier(3), + BW_Util.STANDART + ); + + BWRecipes.instance.addBioLabRecipeIncubation( + new ItemStack(Items.fermented_spider_eye), + BioCultureLoader.eColi, + new int[]{4500}, + new FluidStack[]{fluidStack}, + 500, + BW_Util.getMachineVoltageFromTier(3), + BW_Util.STANDART + ); + + BWRecipes.instance.addBioLabRecipeIncubation( + ItemList.Food_Dough.get(1L), + BioCultureLoader.CommonYeast, + new int[]{7500}, + new FluidStack[]{fluidStack}, + 500, + BW_Util.getMachineVoltageFromTier(3), + BW_Util.STANDART + ); + + BWRecipes.instance.addBioLabRecipeIncubation( + ItemList.Food_Dough_Sugar.get(1L), + BioCultureLoader.WhineYeast, + new int[]{2500}, + new FluidStack[]{fluidStack}, + 500, + BW_Util.getMachineVoltageFromTier(3), + BW_Util.STANDART + ); + + BWRecipes.instance.addBioLabRecipeIncubation( + ItemList.Bottle_Wine.get(1L), + BioCultureLoader.WhineYeast, + new int[]{3300}, + new FluidStack[]{fluidStack}, + 500, + BW_Util.getMachineVoltageFromTier(3), + BW_Util.STANDART + ); + + BWRecipes.instance.addBioLabRecipeIncubation( + ItemList.Bottle_Beer.get(1L), + BioCultureLoader.BeerYeast, + new int[]{2500}, + new FluidStack[]{fluidStack}, + 500, + BW_Util.getMachineVoltageFromTier(3), + BW_Util.STANDART + ); + + BWRecipes.instance.addBioLabRecipeIncubation( + ItemList.Bottle_Dark_Beer.get(1L), + BioCultureLoader.BeerYeast, + new int[]{3300}, + new FluidStack[]{fluidStack}, + 500, + BW_Util.getMachineVoltageFromTier(3), + BW_Util.STANDART + ); + + BWRecipes.instance.addBacterialVatRecipe( + new ItemStack[]{new ItemStack(Items.sugar, 64)}, + new FluidStack[]{new FluidStack(fluidStack, 100)}, + BioCulture.BIO_CULTURE_ARRAY_LIST.get(1), + new FluidStack[]{(Loader.isModLoaded("berriespp") ? FluidRegistry.getFluidStack("potion.GHP", 1) : Materials.Ethanol.getFluid(1L))}, + 350, + BW_Util.getMachineVoltageFromTier(4) + ); + + BWRecipes.instance.addBacterialVatRecipe( + new ItemStack[]{ItemList.Crop_Drop_Grapes.get(16)}, + new FluidStack[]{new FluidStack(fluidStack, 100)}, + BioCulture.BIO_CULTURE_ARRAY_LIST.get(2), + new FluidStack[]{FluidRegistry.getFluidStack("potion.wine", 12)}, + 200, + BW_Util.getMachineVoltageFromTier(2) + ); + + BWRecipes.instance.addBacterialVatRecipe( + new ItemStack[]{new ItemStack(Items.sugar, 4), ItemList.IC2_Hops.get(16L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 8L)}, + new FluidStack[]{new FluidStack(fluidStack, 100)}, + BioCulture.BIO_CULTURE_ARRAY_LIST.get(3), + new FluidStack[]{FluidRegistry.getFluidStack("potion.beer", 5)}, + 600, + BW_Util.getMachineVoltageFromTier(1) + ); + BWRecipes.instance.addBacterialVatRecipe( + new ItemStack[]{ItemList.IC2_Hops.get(32L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 16L)}, + new FluidStack[]{new FluidStack(fluidStack, 100)}, + BioCulture.BIO_CULTURE_ARRAY_LIST.get(3), + new FluidStack[]{FluidRegistry.getFluidStack("potion.darkbeer", 10)}, + 600, + BW_Util.getMachineVoltageFromTier(1) + ); + + } + + BWRecipes.instance.addBacterialVatRecipe( + null, + new FluidStack[]{FluidRegistry.getFluidStack("potion.grapejuice", 100)}, + BioCulture.BIO_CULTURE_ARRAY_LIST.get(2), + new FluidStack[]{FluidRegistry.getFluidStack("potion.wine", 12)}, + 400, + BW_Util.getMachineVoltageFromTier(1) + ); + + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Materials.Nickel.getMolten(5184), new ItemStack(BioItemList.bw_glasses[0], 1, 1), 800, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 1), Materials.Tungsten.getMolten(1296), new ItemStack(BioItemList.bw_glasses[0], 1, 2), 800, BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 2), Materials.Chrome.getMolten(1296), new ItemStack(BioItemList.bw_glasses[0], 1, 3), 800, BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 3), Materials.Iridium.getMolten(3888), new ItemStack(BioItemList.bw_glasses[0], 1, 4), 800, BW_Util.getMachineVoltageFromTier(7)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 4), Materials.Osmium.getMolten(1296), new ItemStack(BioItemList.bw_glasses[0], 1, 5), 800, BW_Util.getMachineVoltageFromTier(8)); + + //and reverse recipes... cause im nice :P + GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 1), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nickel.getDust(36)}, null, 800, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 2), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nickel.getDust(36), Materials.Tungsten.getDust(9)}, null, 800, BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 3), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9)}, null, 800, BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 4), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9), Materials.Iridium.getDust(27)}, null, 800, BW_Util.getMachineVoltageFromTier(7)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 5), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9), Materials.Osmiridium.getDust(36)}, null, 800, BW_Util.getMachineVoltageFromTier(8)); + + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java new file mode 100644 index 0000000000..b060002b38 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.loaders; + +import com.github.bartimaeusnek.bartworks.client.renderer.RendererSwitchingColorFluid; +import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock; +import com.github.bartimaeusnek.bartworks.common.tileentities.BWTileEntityDimIDBridge; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.BioCulture; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.objects.GT_Fluid; +import ic2.core.item.ItemFluidCell; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import java.util.Arrays; + +public class FluidLoader implements Runnable { + + public static IIcon autogenIIcon; + public static Fluid ff; + public static int renderID; + public static Block bioFluidBlock; + public static Fluid[] BioLabFluidMaterials; + public static ItemStack[] BioLabFluidCells; + + @Override + public void run() { + FluidLoader.renderID = RenderingRegistry.getNextAvailableRenderId(); + short[] rgb = new short[3]; + Arrays.fill(rgb, (short) 255); + FluidLoader.ff = new GT_Fluid("BWfakeFluid", "molten.autogenerated", rgb); + BioLabFluidMaterials = new Fluid[]{ + new GT_Fluid("FluorecentdDNA", "molten.autogenerated", new short[]{125, 50, 170, 0}), + new GT_Fluid("EnzymesSollution", "molten.autogenerated", new short[]{240, 200, 125, 0}), + new GT_Fluid("Penicillin", "molten.autogenerated", new short[]{255, 255, 255, 0}), + new GT_Fluid("Polymerase", "molten.autogenerated", new short[]{110, 180, 110, 0}), + }; + + BioLabFluidCells = new ItemStack[BioLabFluidMaterials.length]; + for (int i = 0; i < BioLabFluidMaterials.length; i++) { + FluidRegistry.registerFluid(BioLabFluidMaterials[i]); + BioLabFluidCells[i] = ItemFluidCell.getUniversalFluidCell(new FluidStack(BioLabFluidMaterials[i], 1000)); + } + + BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", BW_Util.splitColortoArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB()))); + + for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { + if (B.isBreedable()) { + B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()})); + FluidRegistry.registerFluid(B.getFluid()); + } + } + + bioFluidBlock = new BioFluidBlock(); + GameRegistry.registerBlock(bioFluidBlock, "coloredFluidBlock"); + GameRegistry.registerTileEntity(BWTileEntityDimIDBridge.class, "bwTEDimIDBridge"); + RenderingRegistry.registerBlockHandler(RendererSwitchingColorFluid.instance); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java new file mode 100644 index 0000000000..8d54f44d8a --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.loaders; + +import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import cpw.mods.fml.common.Loader; + +/** + * Autogenerated run file, script Created on Wed Jan 2 19:11:07 2019 by boubou_19 and bartimaeusnek + * Executed on 2019-01-03 02:08:43 + * modified by bartimaeusnek to only add blocks that mods are loaded + */ +public class GTNHBlocks implements Runnable { + + @Override + public void run() { + BioVatLogicAdder.BioVatGlass.addCustomGlass("minecraft", "glass", 0, 3); + BioVatLogicAdder.BioVatGlass.addCustomGlass("IC2", "blockAlloyGlass", 0, 4); + + if (Loader.isModLoaded("BloodArsenal")) + BioVatLogicAdder.BioVatGlass.addCustomGlass("BloodArsenal", "blood_stained_glass", 0, 3); + if (Loader.isModLoaded("Botany")) + BioVatLogicAdder.BioVatGlass.addCustomGlass("Botany", "stained", 0, 3); + if (Loader.isModLoaded("EnderIO")) + for (int i = 0; i <= 5; ++i) + BioVatLogicAdder.BioVatGlass.addCustomGlass("EnderIO", "blockFusedQuartz", i, 3); + + if (Loader.isModLoaded("ExtraUtilities")) { + BioVatLogicAdder.BioVatGlass.addCustomGlass("ExtraUtilities", "decorativeBlock1", 9, 3); + for (int i = 0; i <= 11; ++i) + BioVatLogicAdder.BioVatGlass.addCustomGlass("ExtraUtilities", "decorativeBlock2", i, 3); + for (int i = 0; i <= 5; ++i) + BioVatLogicAdder.BioVatGlass.addCustomGlass("ExtraUtilities", "etherealglass", i, 3); + } + if (Loader.isModLoaded("GalaxySpace")) + BioVatLogicAdder.BioVatGlass.addCustomGlass("GalaxySpace", "futureglass", 0, 3); + if (Loader.isModLoaded("HardcoreEnderExpension")) + BioVatLogicAdder.BioVatGlass.addCustomGlass("HardcoreEnderExpension", "laboratory_glass", 0, 3); + + if (Loader.isModLoaded("Natura")) + for (int i = 0; i <= 1; ++i) + BioVatLogicAdder.BioVatGlass.addCustomGlass("Natura", "NetherGlass", i, 3); + + if (Loader.isModLoaded("RandomThings")) + BioVatLogicAdder.BioVatGlass.addCustomGlass("RandomThings", "spectreGlass", 0, 3); + if (Loader.isModLoaded("TConstruct")) + BioVatLogicAdder.BioVatGlass.addCustomGlass("TConstruct", "GlassBlock", 0, 3); + if (Loader.isModLoaded("tectech")) + BioVatLogicAdder.BioVatGlass.addCustomGlass("tectech", "tile.quantumGlass", 0, 5); + + if (Loader.isModLoaded("chisel")) + BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "glass2", 0, 3); + + for (int i = 0; i <= 15; ++i) { + BioVatLogicAdder.BioVatGlass.addCustomGlass("minecraft", "stained_glass", i, 3); + if (Loader.isModLoaded("GalaxySpace")) + BioVatLogicAdder.BioVatGlass.addCustomGlass("GalaxySpace", "futureglasses", i, 3); + if (Loader.isModLoaded("Railcraft")) + BioVatLogicAdder.BioVatGlass.addCustomGlass("Railcraft", "glass", i, 3); + if (Loader.isModLoaded("TConstruct")) + BioVatLogicAdder.BioVatGlass.addCustomGlass("TConstruct", "GlassBlock.StainedClear", i, 3); + if (Loader.isModLoaded("Ztones")) + BioVatLogicAdder.BioVatGlass.addCustomGlass("Ztones", "tile.glaxx", i, 3); + if (Loader.isModLoaded("chisel")) { + BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "glass", i, 3); + BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_white", i, 3); + BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_yellow", i, 3); + BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_lightgray", i, 3); + BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_brown", i, 3); + BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_forestry", i, 3); + } + if (Loader.isModLoaded("witchery")) + BioVatLogicAdder.BioVatGlass.addCustomGlass("witchery", "shadedglass", i, 3); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 161f6111bb..fffcf974de 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -1,11 +1,35 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.loaders; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.items.*; import com.github.bartimaeusnek.bartworks.common.tileentities.BW_RotorBlock; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_Diode; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_EnergyDistributor; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -20,7 +44,7 @@ import net.minecraft.util.ResourceLocation; import static com.github.bartimaeusnek.bartworks.MainMod.BWT; import static com.github.bartimaeusnek.bartworks.MainMod.GT2; -import static com.github.bartimaeusnek.bartworks.common.ConfigHandler.newStuff; +import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; public class ItemRegistry implements Runnable { @@ -30,40 +54,38 @@ public class ItemRegistry implements Runnable { public static final Item RockcutterMV = new GT_Rockcutter_Item(2); public static final Item RockcutterHV = new GT_Rockcutter_Item(3); public static final Item CircuitProgrammer = new Circuit_Programmer(); - public static ItemStack[] Diode2A= new ItemStack[GT_Values.VN.length]; - public static ItemStack[] Diode4A= new ItemStack[GT_Values.VN.length]; - public static ItemStack[] Diode8A= new ItemStack[GT_Values.VN.length]; - public static ItemStack[] Diode12A= new ItemStack[GT_Values.VN.length]; - public static ItemStack[] Diode16A= new ItemStack[GT_Values.VN.length]; - public static final Block ROTORBLOCK = new BW_TileEntityContainer(Material.wood, BW_RotorBlock.class,"BWRotorBlock"); - - public static final Item LeatherRotor = new BW_Stonage_Rotors(5, 0.15f, 15, 30,2400, IKineticRotor.GearboxType.WIND,new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorLeather.png"),"BW_LeatherRotor","rotors/itemRotorLeather"); - public static final Item WoolRotor = new BW_Stonage_Rotors(7, 0.18f, 10, 20,1600, IKineticRotor.GearboxType.WIND,new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorWool.png"),"BW_WoolRotor","rotors/itemRotorWool"); - public static final Item PaperRotor = new BW_Stonage_Rotors(9, 0.2f, 1, 10,800, IKineticRotor.GearboxType.WIND,new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorPaper.png"),"BW_PaperRotor","rotors/itemRotorPaper"); - public static final Item CombinedRotor = new BW_Stonage_Rotors(11, 0.22f, 1, 50,5800, IKineticRotor.GearboxType.WIND,new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorCombined.png"),"BW_CombinedRotor","rotors/itemRotorCombined"); - public static final Item craftingParts = new SimpleSubItemClass(new String[]{"grindstone_top","grindstone_bottom","completed_grindstone","rotors/leatherParts","rotors/woolParts","rotors/paperParts","rotors/combinedParts"}); - - + public static final Block ROTORBLOCK = new BW_TileEntityContainer(Material.wood, BW_RotorBlock.class, "BWRotorBlock"); + public static final Item LeatherRotor = new BW_Stonage_Rotors(5, 0.15f, 15, 30, 2400, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorLeather.png"), "BW_LeatherRotor", "rotors/itemRotorLeather"); + public static final Item WoolRotor = new BW_Stonage_Rotors(7, 0.18f, 10, 20, 1600, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorWool.png"), "BW_WoolRotor", "rotors/itemRotorWool"); + public static final Item PaperRotor = new BW_Stonage_Rotors(9, 0.2f, 1, 10, 800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorPaper.png"), "BW_PaperRotor", "rotors/itemRotorPaper"); + public static final Item CombinedRotor = new BW_Stonage_Rotors(11, 0.22f, 1, 50, 5800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorCombined.png"), "BW_CombinedRotor", "rotors/itemRotorCombined"); + public static final Item craftingParts = new SimpleSubItemClass(new String[]{"grindstone_top", "grindstone_bottom", "completed_grindstone", "rotors/leatherParts", "rotors/woolParts", "rotors/paperParts", "rotors/combinedParts"}); public static final Item tab = new SimpleIconItem("GT2Coin"); public static final Block[] BW_BLOCKS = { new BW_Blocks("BW_ItemBlocks", new String[] - { - MainMod.modID+":EtchedLapisCell", - MainMod.modID+":PlatedLapisCell", - },GT2), + { + MainMod.modID + ":EtchedLapisCell", + MainMod.modID + ":PlatedLapisCell", + }, GT2), new BW_Blocks("GT_LESU_CASING", new String[]{ - MainMod.modID+":LESU_CELL", - },GT2), - new BW_Blocks("BW_Machinery_Casings",new String[]{ - MainMod.modID+":NickelFerriteBlocks", - MainMod.modID+":TransformerCoil", - // MainMod.modID+":DEHP_Casing", - // MainMod.modID+":DEHP_Casing_Base" - },BWT), + MainMod.modID + ":LESU_CELL", + }, GT2), + new BW_Blocks("BW_Machinery_Casings", new String[]{ + MainMod.modID + ":NickelFerriteBlocks", + MainMod.modID + ":TransformerCoil", + // MainMod.modID+":DEHP_Casing", + // MainMod.modID+":DEHP_Casing_Base" + }, BWT), }; + public static ItemStack[] Diode2A = new ItemStack[GT_Values.VN.length]; + public static ItemStack[] Diode4A = new ItemStack[GT_Values.VN.length]; + public static ItemStack[] Diode8A = new ItemStack[GT_Values.VN.length]; + public static ItemStack[] Diode12A = new ItemStack[GT_Values.VN.length]; + public static ItemStack[] Diode16A = new ItemStack[GT_Values.VN.length]; + public static ItemStack[] EnergyDistributor = new ItemStack[GT_Values.VN.length]; @Override public void run() { @@ -71,26 +93,35 @@ public class ItemRegistry implements Runnable { if (newStuff) { GameRegistry.registerBlock(BW_BLOCKS[2], BW_ItemBlocks.class, "BW_Machinery_Casings"); GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(BW_BLOCKS[2])); - - GameRegistry.registerItem(LeatherRotor,"BW_LeatherRotor"); - GameRegistry.registerItem(WoolRotor,"BW_WoolRotor"); - GameRegistry.registerItem(PaperRotor,"BW_PaperRotor"); - GameRegistry.registerItem(CombinedRotor,"BW_CombinedRotor"); - GameRegistry.registerItem(craftingParts,"craftingParts"); - GameRegistry.registerTileEntity(BW_RotorBlock.class,"BWRotorBlockTE"); - GameRegistry.registerBlock(ROTORBLOCK,"BWRotorBlock"); + GameRegistry.registerItem(LeatherRotor, "BW_LeatherRotor"); + GameRegistry.registerItem(WoolRotor, "BW_WoolRotor"); + GameRegistry.registerItem(PaperRotor, "BW_PaperRotor"); + GameRegistry.registerItem(CombinedRotor, "BW_CombinedRotor"); + GameRegistry.registerItem(craftingParts, "craftingParts"); + GameRegistry.registerTileEntity(BW_RotorBlock.class, "BWRotorBlockTE"); + GameRegistry.registerBlock(ROTORBLOCK, "BWRotorBlock"); + + for (int i = 0; i < GT_Values.VN.length; i++) { + ItemRegistry.Diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "Cable Diode 2A " + GT_Values.VN[i], "Cable Diode 2A " + GT_Values.VN[i], i, 2).getStackForm(1L); + ItemRegistry.Diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "Cable Diode 4A " + GT_Values.VN[i], "Cable Diode 4A " + GT_Values.VN[i], i, 4).getStackForm(1L); + ItemRegistry.Diode8A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, "Cable Diode 8A " + GT_Values.VN[i], "Cable Diode 8A " + GT_Values.VN[i], i, 8).getStackForm(1L); + ItemRegistry.Diode12A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, "Cable Diode 12A " + GT_Values.VN[i], "Cable Diode 12A " + GT_Values.VN[i], i, 12).getStackForm(1L); + ItemRegistry.Diode16A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, "Cable Diode 16A " + GT_Values.VN[i], "Cable Diode 16A " + GT_Values.VN[i], i, 16).getStackForm(1L); + ItemRegistry.EnergyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset + 1 + i, "Energy Distributor " + GT_Values.VN[i], "Energy Distributor " + GT_Values.VN[i], i, "Splits Amperage into several Sides").getStackForm(1L); + + } } //GT2 stuff - GameRegistry.registerBlock(BW_BLOCKS[0], BW_ItemBlocks.class,"BW_ItemBlocks"); - GameRegistry.registerBlock(BW_BLOCKS[1], BW_ItemBlocks.class,"GT_LESU_CASING"); + GameRegistry.registerBlock(BW_BLOCKS[0], BW_ItemBlocks.class, "BW_ItemBlocks"); + GameRegistry.registerBlock(BW_BLOCKS[1], BW_ItemBlocks.class, "GT_LESU_CASING"); if (ConfigHandler.teslastaff) - GameRegistry.registerItem(Teslastaff,Teslastaff.getUnlocalizedName()); + GameRegistry.registerItem(Teslastaff, Teslastaff.getUnlocalizedName()); - GameRegistry.registerItem(RockcutterLV,RockcutterLV.getUnlocalizedName()); - GameRegistry.registerItem(RockcutterMV,RockcutterMV.getUnlocalizedName()); - GameRegistry.registerItem(RockcutterHV,RockcutterHV.getUnlocalizedName()); - GameRegistry.registerItem(tab,"tabIconGT2"); + GameRegistry.registerItem(RockcutterLV, RockcutterLV.getUnlocalizedName()); + GameRegistry.registerItem(RockcutterMV, RockcutterMV.getUnlocalizedName()); + GameRegistry.registerItem(RockcutterHV, RockcutterHV.getUnlocalizedName()); + GameRegistry.registerItem(tab, "tabIconGT2"); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java index 199f4068bf..7b21cfaef0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java @@ -1,14 +1,38 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.loaders; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; + public class LoaderRegistry implements Runnable { - public ItemRegistry items = new ItemRegistry(); - public RecipeLoader recipes = new RecipeLoader(); @Override public void run() { - items.run(); - recipes.run(); + new ItemRegistry().run(); + new RecipeLoader().run(); + if (ConfigHandler.BioLab) { + new BioLabLoader().run(); + } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index a467af62bd..43619f7d7c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -1,8 +1,32 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.loaders; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.tileentities.*; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_ManualTrafo; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_Windmill; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -17,11 +41,11 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.oredict.OreDictionary; -import static com.github.bartimaeusnek.bartworks.common.ConfigHandler.newStuff; +import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; public class RecipeLoader implements Runnable { - private static final long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE; + protected static final long BITSD = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE; @Override public void run() { @@ -44,7 +68,7 @@ public class RecipeLoader implements Runnable { GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.BW_BLOCKS[1]), - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "LLL", "LCL", @@ -56,8 +80,8 @@ public class RecipeLoader implements Runnable { GT_Values.RA.addCutterRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[1]), new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), GT_Values.NI, 100, (int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, (int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 0), new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, (int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); - GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), RecipeLoader.bitsd, new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1)}); - GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), RecipeLoader.bitsd, new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0)}); + GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), RecipeLoader.BITSD, new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1)}); + GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), RecipeLoader.BITSD, new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0)}); } /* @@ -66,7 +90,7 @@ public class RecipeLoader implements Runnable { GT_ModHandler.addCraftingRecipe( new GT_TileEntity_LESU(ConfigHandler.IDOffset, "LESU", "LESU").getStackForm(1L), - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "CDC", "SBS", @@ -80,7 +104,7 @@ public class RecipeLoader implements Runnable { GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.Destructopack), - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "CPC", "PLP", @@ -92,7 +116,7 @@ public class RecipeLoader implements Runnable { GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.Destructopack), - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "CPC", "PLP", @@ -104,7 +128,7 @@ public class RecipeLoader implements Runnable { GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.RockcutterMV), - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "DS ", "DP ", @@ -118,7 +142,7 @@ public class RecipeLoader implements Runnable { GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.RockcutterLV), - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "DS ", "DP ", @@ -132,7 +156,7 @@ public class RecipeLoader implements Runnable { GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.RockcutterHV), - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "DS ", "DP ", @@ -147,7 +171,7 @@ public class RecipeLoader implements Runnable { if (ConfigHandler.teslastaff) GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.Teslastaff), - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "BO ", "OP ", @@ -161,6 +185,7 @@ public class RecipeLoader implements Runnable { Materials[] cables = {Materials.Lead, Materials.Tin, Materials.AnnealedCopper, Materials.Gold, Materials.Aluminium, Materials.Tungsten, Materials.VanadiumGallium, Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; Materials[] hulls = {Materials.WroughtIron, Materials.Steel, Materials.Aluminium, Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, Materials.Chrome, Materials.Iridium, Materials.Osmium, Materials.Naquadah}; + for (int i = 0; i < GT_Values.VN.length; i++) { try { Materials cable = cables[i]; @@ -168,8 +193,8 @@ public class RecipeLoader implements Runnable { ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); GT_ModHandler.addCraftingRecipe( - new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset + 1 + i, "Energy Distributor " + GT_Values.VN[i], "Energy Distributor " + GT_Values.VN[i], i, "Splits Amperage into several Sides").getStackForm(1L), - RecipeLoader.bitsd, + ItemRegistry.EnergyDistributor[i], + RecipeLoader.BITSD, new Object[]{ "PWP", "WCW", @@ -179,8 +204,8 @@ public class RecipeLoader implements Runnable { 'C', machinehull }); GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode12A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, "Cable Diode 12A " + GT_Values.VN[i], "Cable Diode 12A " + GT_Values.VN[i], i, 12).getStackForm(1L), - RecipeLoader.bitsd, + ItemRegistry.Diode12A[i], + RecipeLoader.BITSD, new Object[]{ "WDW", "DCD", @@ -193,7 +218,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( ItemRegistry.Diode12A[i], - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "WDW", "DCD", @@ -205,8 +230,8 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode8A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, "Cable Diode 8A " + GT_Values.VN[i], "Cable Diode 8A " + GT_Values.VN[i], i, 8).getStackForm(1L), - RecipeLoader.bitsd, + ItemRegistry.Diode8A[i], + RecipeLoader.BITSD, new Object[]{ "WDW", "DCD", @@ -219,7 +244,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( ItemRegistry.Diode8A[i], - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "WDW", "DCD", @@ -231,8 +256,8 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "Cable Diode 4A " + GT_Values.VN[i], "Cable Diode 4A " + GT_Values.VN[i], i, 4).getStackForm(1L), - RecipeLoader.bitsd, + ItemRegistry.Diode4A[i], + RecipeLoader.BITSD, new Object[]{ "WDW", "DCD", @@ -245,7 +270,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( ItemRegistry.Diode4A[i], - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "WDW", "DCD", @@ -257,8 +282,8 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "Cable Diode 2A " + GT_Values.VN[i], "Cable Diode 2A " + GT_Values.VN[i], i, 2).getStackForm(1L), - RecipeLoader.bitsd, + ItemRegistry.Diode2A[i], + RecipeLoader.BITSD, new Object[]{ "WDW", "DCD", @@ -271,7 +296,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( ItemRegistry.Diode2A[i], - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "WDW", "DCD", @@ -283,8 +308,8 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode16A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 5 + i, "Cable Diode 16A " + GT_Values.VN[i], "Cable Diode 16A " + GT_Values.VN[i], i, 16).getStackForm(1L), - RecipeLoader.bitsd, + ItemRegistry.Diode16A[i], + RecipeLoader.BITSD, new Object[]{ "WHW", "DCD", @@ -298,7 +323,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( ItemRegistry.Diode16A[i], - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "WHW", "DCD", @@ -319,30 +344,30 @@ public class RecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe( new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), GT_Utility.getIntegratedCircuit(17)}, Materials.Plastic.getMolten(1152L), - new ItemStack(ItemRegistry.BW_BLOCKS[2],1,1), + new ItemStack(ItemRegistry.BW_BLOCKS[2], 1, 1), 20, (int) (GT_Values.V[3] - (GT_Values.V[3] / 10)) ); GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "Manual Travo", "Manual Travo").getStackForm(1L), - RecipeLoader.bitsd, - new Object[]{ - "SCS", - "CHC", - "ZCZ", - 'S', GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L), - 'C', new ItemStack(ItemRegistry.BW_BLOCKS[2]), - 'H', ItemList.Hull_HV.get(1L), - 'Z', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1L) - } + new GT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "Manual Travo", "Manual Travo").getStackForm(1L), + RecipeLoader.BITSD, + new Object[]{ + "SCS", + "CHC", + "ZCZ", + 'S', GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L), + 'C', new ItemStack(ItemRegistry.BW_BLOCKS[2]), + 'H', ItemList.Hull_HV.get(1L), + 'Z', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1L) + } ); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.circuit,Materials.Good,1L),Materials.Aluminium.getPlates(1),ItemList.Circuit_Board_Plastic.get(1L), ItemList.Battery_RE_LV_Lithium.get(1L)}, Materials.SolderingAlloy.getMolten(288L),new ItemStack(ItemRegistry.CircuitProgrammer),600,(int) (GT_Values.V[2] - (GT_Values.V[2] / 10))); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), Materials.Aluminium.getPlates(1), ItemList.Circuit_Board_Plastic.get(1L), ItemList.Battery_RE_LV_Lithium.get(1L)}, Materials.SolderingAlloy.getMolten(288L), new ItemStack(ItemRegistry.CircuitProgrammer), 600, (int) (GT_Values.V[2] - (GT_Values.V[2] / 10))); GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_Windmill(ConfigHandler.IDOffset+GT_Values.VN.length*6+2,"Windmill","Windmill").getStackForm(1L), - RecipeLoader.bitsd, + new GT_TileEntity_Windmill(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 2, "Windmill", "Windmill").getStackForm(1L), + RecipeLoader.BITSD, new Object[]{ "BHB", "WGW", @@ -350,140 +375,140 @@ public class RecipeLoader implements Runnable { 'B', new ItemStack(Blocks.brick_block), 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), 'H', new ItemStack(Blocks.hopper), - 'G', new ItemStack(ItemRegistry.craftingParts,1,2), + 'G', new ItemStack(ItemRegistry.craftingParts, 1, 2), } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts,1,0), - RecipeLoader.bitsd, + new ItemStack(ItemRegistry.craftingParts, 1, 0), + RecipeLoader.BITSD, new Object[]{ "SSS", "DfD", " h ", 'S', new ItemStack(Blocks.stone), - 'D', new ItemStack(GregTech_API.sBlockGranites,1,OreDictionary.WILDCARD_VALUE), + 'D', new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts,1,1), - RecipeLoader.bitsd, + new ItemStack(ItemRegistry.craftingParts, 1, 1), + RecipeLoader.BITSD, new Object[]{ "hDf", "SSS", 'S', new ItemStack(Blocks.stone), - 'D', new ItemStack(GregTech_API.sBlockGranites,1, OreDictionary.WILDCARD_VALUE), + 'D', new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts,1,2), - RecipeLoader.bitsd, + new ItemStack(ItemRegistry.craftingParts, 1, 2), + RecipeLoader.BITSD, new Object[]{ "STS", "h f", "SBS", - 'S', new ItemStack(GregTech_API.sBlockGranites,1, OreDictionary.WILDCARD_VALUE), + 'S', new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), 'T', new ItemStack(ItemRegistry.craftingParts, 1, 0), 'B', new ItemStack(ItemRegistry.craftingParts, 1, 1), } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts,1,3), - RecipeLoader.bitsd, + new ItemStack(ItemRegistry.craftingParts, 1, 3), + RecipeLoader.BITSD, new Object[]{ "WLs", "WLh", "WLf", 'L', new ItemStack(Items.leather), - 'W', new ItemStack(Blocks.log,1,OreDictionary.WILDCARD_VALUE), + 'W', new ItemStack(Blocks.log, 1, OreDictionary.WILDCARD_VALUE), } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts,1,4), - RecipeLoader.bitsd, + new ItemStack(ItemRegistry.craftingParts, 1, 4), + RecipeLoader.BITSD, new Object[]{ "WLs", "WLh", "WLf", 'L', new ItemStack(Blocks.carpet), - 'W', new ItemStack(Blocks.log,1,OreDictionary.WILDCARD_VALUE), + 'W', new ItemStack(Blocks.log, 1, OreDictionary.WILDCARD_VALUE), } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts,1,5), - RecipeLoader.bitsd, + new ItemStack(ItemRegistry.craftingParts, 1, 5), + RecipeLoader.BITSD, new Object[]{ "WLs", "WLh", "WLf", 'L', new ItemStack(Items.paper), - 'W', new ItemStack(Blocks.log,1,OreDictionary.WILDCARD_VALUE), + 'W', new ItemStack(Blocks.log, 1, OreDictionary.WILDCARD_VALUE), } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts,1,6), - RecipeLoader.bitsd, + new ItemStack(ItemRegistry.craftingParts, 1, 6), + RecipeLoader.BITSD, new Object[]{ "WEs", "WZh", "WDf", - 'E', new ItemStack(ItemRegistry.craftingParts,1,3), - 'Z', new ItemStack(ItemRegistry.craftingParts,1,4), - 'D', new ItemStack(ItemRegistry.craftingParts,1,5), - 'W', new ItemStack(Blocks.log,1,OreDictionary.WILDCARD_VALUE), + 'E', new ItemStack(ItemRegistry.craftingParts, 1, 3), + 'Z', new ItemStack(ItemRegistry.craftingParts, 1, 4), + 'D', new ItemStack(ItemRegistry.craftingParts, 1, 5), + 'W', new ItemStack(Blocks.log, 1, OreDictionary.WILDCARD_VALUE), } ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.LeatherRotor), - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "hPf", "PWP", "sPr", - 'P', new ItemStack(ItemRegistry.craftingParts,1,3), + 'P', new ItemStack(ItemRegistry.craftingParts, 1, 3), 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), } ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.WoolRotor), - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "hPf", "PWP", "sPr", - 'P', new ItemStack(ItemRegistry.craftingParts,1,4), + 'P', new ItemStack(ItemRegistry.craftingParts, 1, 4), 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), } ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.PaperRotor), - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "hPf", "PWP", "sPr", - 'P', new ItemStack(ItemRegistry.craftingParts,1,5), + 'P', new ItemStack(ItemRegistry.craftingParts, 1, 5), 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), } ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CombinedRotor), - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "hPf", "PWP", "sPr", - 'P', new ItemStack(ItemRegistry.craftingParts,1,6), + 'P', new ItemStack(ItemRegistry.craftingParts, 1, 6), 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), } ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.ROTORBLOCK), - RecipeLoader.bitsd, + RecipeLoader.BITSD, new Object[]{ "WRW", "RGR", "WRW", - 'R',GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Iron, 1L), + 'R', GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Iron, 1L), 'W', new ItemStack(Blocks.planks), 'G', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), } @@ -491,5 +516,8 @@ public class RecipeLoader implements Runnable { //next free ID: ConfigHandler.IDOffset+GT_Values.VN.length*6+3 } + + } + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java new file mode 100644 index 0000000000..af2a08d3e8 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.net; + +import com.google.common.io.ByteArrayDataInput; +import com.google.common.io.ByteStreams; +import cpw.mods.fml.common.network.FMLEmbeddedChannel; +import cpw.mods.fml.common.network.FMLOutboundHandler; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.internal.FMLProxyPacket; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.server.FMLServerHandler; +import gregtech.api.enums.GT_Values; +import gregtech.api.net.GT_Packet; +import gregtech.api.net.IGT_NetworkHandler; +import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelHandler; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.handler.codec.MessageToMessageCodec; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; + +import javax.annotation.Nonnull; +import java.util.EnumMap; +import java.util.Iterator; +import java.util.List; + +/* + * Original GT File slightly Modified + */ +@ChannelHandler.Sharable +public class BW_Network extends MessageToMessageCodec implements IGT_NetworkHandler { + + private EnumMap mChannel; + private GT_Packet[] mSubChannels; + + public BW_Network() { + this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", new ChannelHandler[]{this, new HandlerShared()}); + this.mSubChannels = new GT_Packet[]{new RendererPacket()}; + } + + protected void encode(ChannelHandlerContext aContext, GT_Packet aPacket, List aOutput) throws Exception { + aOutput.add(new FMLProxyPacket(Unpooled.buffer().writeByte(aPacket.getPacketID()).writeBytes(aPacket.encode()).copy(), (String) aContext.channel().attr(NetworkRegistry.FML_CHANNEL).get())); + } + + protected void decode(ChannelHandlerContext aContext, FMLProxyPacket aPacket, List aOutput) throws Exception { + ByteArrayDataInput aData = ByteStreams.newDataInput(aPacket.payload().array()); + aOutput.add(this.mSubChannels[aData.readByte()].decode(aData)); + } + + public void sendToPlayer(@Nonnull GT_Packet aPacket, @Nonnull EntityPlayerMP aPlayer) { + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPlayer); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket); + } + + public void sendToAllPlayersinWorld(@Nonnull GT_Packet aPacket, World world) { + for (String name : FMLServerHandler.instance().getServer().getAllUsernames()) { + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(world.getPlayerEntityByName(name)); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket); + } + } + + public void sendToAllAround(@Nonnull GT_Packet aPacket, NetworkRegistry.TargetPoint aPosition) { + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPosition); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket); + } + + public void sendToServer(@Nonnull GT_Packet aPacket) { + ((FMLEmbeddedChannel) this.mChannel.get(Side.CLIENT)).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER); + ((FMLEmbeddedChannel) this.mChannel.get(Side.CLIENT)).writeAndFlush(aPacket); + } + + public void sendPacketToAllPlayersInRange(World aWorld, @Nonnull GT_Packet aPacket, int aX, int aZ) { + if (!aWorld.isRemote) { + Iterator var5 = aWorld.playerEntities.iterator(); + + while (var5.hasNext()) { + Object tObject = var5.next(); + if (!(tObject instanceof EntityPlayerMP)) { + break; + } + + EntityPlayerMP tPlayer = (EntityPlayerMP) tObject; + Chunk tChunk = aWorld.getChunkFromBlockCoords(aX, aZ); + if (tPlayer.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { + this.sendToPlayer(aPacket, tPlayer); + } + } + } + } + + @Sharable + static final class HandlerShared extends SimpleChannelInboundHandler { + HandlerShared() { + } + + protected void channelRead0(ChannelHandlerContext ctx, GT_Packet aPacket) throws Exception { + EntityPlayer aPlayer = GT_Values.GT.getThePlayer(); + aPacket.process(aPlayer == null ? null : GT_Values.GT.getThePlayer().worldObj); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java new file mode 100644 index 0000000000..1427cc291b --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.net; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_BioVat; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.Coords; +import com.google.common.io.ByteArrayDataInput; +import cpw.mods.fml.common.FMLCommonHandler; +import gregtech.api.net.GT_Packet; +import net.minecraft.world.IBlockAccess; + +import java.nio.ByteBuffer; + +public class RendererPacket extends GT_Packet { + + private Coords coords; + private int integer; + private byte removal; + + public RendererPacket() { + super(true); + + } + + public RendererPacket(Coords coords, int integer, boolean removal) { + super(false); + this.coords = coords; + this.integer = integer; + this.removal = (byte) (removal ? 1 : 0); + } + + @Override + public byte getPacketID() { + return 0; + } + + @Override + public byte[] encode() { + + byte r = (byte) (((integer >> 16) & 0xFF) + Byte.MIN_VALUE); + byte g = (byte) (((integer >> 8) & 0xFF) + Byte.MIN_VALUE); + byte b = (byte) (((integer >> 0) & 0xFF) + Byte.MIN_VALUE); + byte checksum = (byte) (coords.x % 25 + coords.y % 25 + coords.z % 25 + coords.wID % 25 + integer % 25 + removal); + return ByteBuffer.allocate(19).putInt(0, coords.x).putShort(4, (short) coords.y).putInt(6, coords.z).putInt(10, coords.wID).put(14, r).put(15, g).put(16, b).put(17, removal).put(18, checksum).array(); + } + +// /** +// * only use in a debug enviroment, does not do anything on its own. +// * @param buffer +// */ +// public void decodetest (byte[] buffer){ +// this.coords=new Coords(ByteBuffer.wrap(buffer).getInt(0),ByteBuffer.wrap(buffer).getShort(4),ByteBuffer.wrap(buffer).getInt(6),ByteBuffer.wrap(buffer).getInt(10)); +// int[] rgb = {ByteBuffer.wrap(buffer).get(14)-Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(15)-Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(16)-Byte.MIN_VALUE}; +// this.integer= BW_Util.getColorFromArray(rgb); +// this.removal=ByteBuffer.wrap(buffer).get(17); +// +// byte checksum = (byte) (coords.x%25+coords.y%25+coords.z%25+coords.wID%25+integer%25+removal); +// } + + @Override + public GT_Packet decode(ByteArrayDataInput dataInput) { + + byte[] buffer = new byte[19]; + dataInput.readFully(buffer); + + this.coords = new Coords(ByteBuffer.wrap(buffer).getInt(0), ByteBuffer.wrap(buffer).getShort(4), ByteBuffer.wrap(buffer).getInt(6), ByteBuffer.wrap(buffer).getInt(10)); + int[] rgb = {ByteBuffer.wrap(buffer).get(14) - Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(15) - Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(16) - Byte.MIN_VALUE}; + this.integer = BW_Util.getColorFromArray(rgb); + this.removal = ByteBuffer.wrap(buffer).get(17); + + byte checksum = (byte) (coords.x % 25 + coords.y % 25 + coords.z % 25 + coords.wID % 25 + integer % 25 + removal); + + if (checksum != ByteBuffer.wrap(buffer).get(18)) { + MainMod.logger.error("BW Packet was corrupted or modified!"); + return null; + } + + return new RendererPacket(coords, integer, removal == 1); + } + + @Override + public void process(IBlockAccess iBlockAccess) { + if (FMLCommonHandler.instance().getSide().isClient()) { + if (removal == 0) + GT_TileEntity_BioVat.staticColorMap.put(coords, integer); + else + GT_TileEntity_BioVat.staticColorMap.remove(coords); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BWTileEntityDimIDBridge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BWTileEntityDimIDBridge.java new file mode 100644 index 0000000000..d403b54079 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BWTileEntityDimIDBridge.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities; + +import net.minecraft.tileentity.TileEntity; + +public class BWTileEntityDimIDBridge extends TileEntity { +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BW_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BW_RotorBlock.java index de252a5c67..ee35c37433 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BW_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BW_RotorBlock.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.tileentities; import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_RotorBlock; @@ -10,8 +32,8 @@ import net.minecraft.entity.player.EntityPlayer; public class BW_RotorBlock extends TileEntityWindKineticGenerator { - public int getGrindPower(){ - return super.getKuOutput(); + public int getGrindPower() { + return super.getKuOutput(); } public int getKuOutput() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_BioLab.java new file mode 100644 index 0000000000..b68e399511 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_BioLab.java @@ -0,0 +1,263 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities; + +import com.github.bartimaeusnek.bartworks.common.items.LabModule; +import com.github.bartimaeusnek.bartworks.common.items.LabParts; +import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; +import com.github.bartimaeusnek.bartworks.util.*; +import cpw.mods.fml.common.Loader; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.XSTR; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.items.behaviors.Behaviour_DataOrb; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { + + private static final String MGUINAME = "BW.GUI.BioLab.png"; + + public GT_MetaTileEntity_BioLab(int aID, String aName, String aNameRegional, int aTier, String aDescription) { + super(aID, aName, aNameRegional, aTier, 1, aDescription, 6, 2, MGUINAME, null, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")/*this is topactive*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")/*this is top*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM"))); + } + + public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, String aNEIName) { + super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2, MGUINAME, aNEIName); + } + + public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String[] aDescription, ITexture[][][] aTextures, String aNEIName) { + super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2, MGUINAME, aNEIName); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_MetaTileEntity_BioLab(this.mName, this.mTier, this.mAmperage, this.mDescriptionArray, this.mTextures, this.mNEIName); + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeList() { + return BWRecipes.instance.getMappingsFor(BWRecipes.BIOLABBYTE); + } + + @Override + public int getCapacity() { + return this.mTier * 1000; + } + + @Override + public int checkRecipe(boolean skipOC) { + + int rTier = 3; + FluidStack dnaFluid = Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); + + if (this.getSpecialSlot() != null && this.getSpecialSlot().getItem() instanceof LabModule) { + int damage = getSpecialSlot().getItemDamage() + 1; + switch (damage) { + case 0: + if (GT_Utility.isStackValid(this.mInventory[4]) && this.mInventory[4].getItem() instanceof LabParts && this.mInventory[4].getItemDamage() == 0 && this.mInventory[4].getTagCompound() != null && //checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[5]) && this.mInventory[5].getItem() instanceof LabParts && this.mInventory[5].getItemDamage() == 1 && this.mInventory[5].getTagCompound() == null && + GT_Utility.isStackValid(this.mInventory[6]) && this.mInventory[6].getItem() instanceof LabParts && this.mInventory[6].getItemDamage() == 3 && + GT_Utility.areStacksEqual(this.mInventory[7], Materials.Ethanol.getCells(1)) && + this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000 + ) { + + NBTTagCompound DNABioDataTag = this.mInventory[4].getTagCompound().getCompoundTag("DNA"); + if (DNABioDataTag == null) + return super.checkRecipe(skipOC); + BioData cultureDNABioData = BioData.getBioDataFromName(this.mInventory[4].getTagCompound().getCompoundTag("DNA").getString("Name")); + if (cultureDNABioData == null) + return super.checkRecipe(skipOC); + + if (this.mTier < rTier + cultureDNABioData.getTier()) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + + for (int i = 4; i < 8; i++) { + if (this.mInventory[i] != null) + this.mInventory[i].stackSize--; + } + + this.mFluid.amount -= 1000; + + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + this.mOutputItems[0] = BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(cultureDNABioData)); + } + this.mOutputItems[1] = GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L); + this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(rTier + cultureDNABioData.getTier()), 500); + + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + } + break; + case 1: { + if (GT_Utility.isStackValid(this.mInventory[4]) && this.mInventory[4].getItem() instanceof LabParts && this.mInventory[4].getItemDamage() == 1 && this.mInventory[4].getTagCompound() != null && //checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[7]) && GT_Utility.areStacksEqual(this.mInventory[7], ItemList.Tool_DataOrb.get(1L)) && + GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], FluidLoader.BioLabFluidCells[0]) && + GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], FluidLoader.BioLabFluidCells[3]) && + this.mFluid.isFluidEqual(dnaFluid) && this.mFluid.amount >= 1000) { + NBTTagCompound DNABioDataTag = this.mInventory[4].getTagCompound(); + if (DNABioDataTag == null) + return super.checkRecipe(skipOC); + BioData cultureDNABioData = BioData.getBioDataFromName(DNABioDataTag.getString("Name")); + + if (cultureDNABioData == null) + return super.checkRecipe(skipOC); + + if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + + for (int i = 4; i < 8; i++) { + if (this.mInventory[i] != null) + this.mInventory[i].stackSize--; + } + + this.mFluid.amount -= 1000; + + ItemStack Outp = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); + Behaviour_DataOrb.setDataName(Outp, cultureDNABioData.getName()); + + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + this.mOutputItems[0] = Outp; + } else + this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L); + this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(2L); + + this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); + + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + + } + } + break; + case 2: { + ItemStack inp2 = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); + Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); + if ( + GT_Utility.isStackValid(this.mInventory[4]) && GT_Utility.areStacksEqual(FluidLoader.BioLabFluidCells[1], this.mInventory[4]) && //checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getPlasmidCell(null)) && + GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], ItemList.Tool_DataOrb.get(1L), true) && + Behaviour_DataOrb.getDataTitle(this.mInventory[6]).equals("DNA Sample") && (!(Behaviour_DataOrb.getDataName(this.mInventory[6]).isEmpty())) && + GT_Utility.isStackValid(this.mInventory[7]) && GT_Utility.areStacksEqual(this.mInventory[7], inp2) && + this.mFluid.isFluidEqual(dnaFluid) && (this.mFluid.amount >= 1000)) { + BioData cultureDNABioData = BioData.getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[6])); + if (cultureDNABioData == null) + return super.checkRecipe(skipOC); + if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + for (int i = 4; i < 6; i++) { + if (this.mInventory[i] != null) + this.mInventory[i].stackSize--; + } + this.mFluid.amount -= 1000; + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + this.mOutputItems[0] = BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + } + this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); + this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + } + + } + break; + + case 3: { + if ( + GT_Utility.isStackValid(this.mInventory[4]) && GT_Utility.areStacksEqual(this.mInventory[4], BioItemList.getPetriDish(null), true) && this.mInventory[4].getTagCompound() != null && + GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getPlasmidCell(null), true) && this.mInventory[5].getTagCompound() != null && + GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], FluidLoader.BioLabFluidCells[2]) && + this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000) { + BioData cultureDNABioData = BioData.getBioDataFromNBTTag(this.mInventory[5].getTagCompound()); + BioCulture bioCulture = BioCulture.getBioCultureFromNBTTag(this.mInventory[4].getTagCompound()); + if (cultureDNABioData == null || bioCulture == null) + return super.checkRecipe(skipOC); + if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + for (int i = 4; i < 7; i++) { + if (this.mInventory[i] != null) + this.mInventory[i].stackSize--; + } + this.mFluid.amount -= 1000; + bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + this.mOutputItems[0] = BioItemList.getPetriDish(bioCulture); + } + this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); + this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + } + } + break; + case 4: { + + ItemStack Outp = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); + + if ( + GT_Utility.isStackValid(this.mInventory[4]) && GT_Utility.areStacksEqual(this.mInventory[4], BioItemList.getPetriDish(null)) && + GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getOther(4)) && + GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], ItemList.Circuit_Chip_Stemcell.get(2L)) && + GT_Utility.isStackValid(this.mInventory[7]) && GT_Utility.areStacksEqual(this.mInventory[7], ItemList.Tool_DataOrb.get(1L), true) && + Behaviour_DataOrb.getDataTitle(this.mInventory[7]).equals("DNA Sample") && this.mFluid.isFluidEqual(dnaFluid) && (this.mFluid.amount >= 8000)) { + + BioData cultureDNABioData = BioData.getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[7])); + if (cultureDNABioData == null) + return super.checkRecipe(skipOC); + if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + for (int i = 4; i < 7; i++) { + if (this.mInventory[i] != null) + this.mInventory[i].stackSize--; + } + this.mFluid.amount -= 8000; + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + BioCulture out = BioCulture.getBioCulture(BioDNA.convertDataToDNA(cultureDNABioData)); + out.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + this.mOutputItems[0] = BioItemList.getPetriDish(out); + } + this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + } + } + break; + default: + return super.checkRecipe(skipOC); + } + } + return super.checkRecipe(skipOC); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java index b2775252c9..ab8ceacff9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.tileentities; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; @@ -12,8 +34,8 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { private long amps; public GT_MetaTileEntity_Diode(int aID, String aName, String aNameRegional, int aTier, int amps) { - super(aID, aName, aNameRegional, aTier, "A Simple diode that will allow Energy Flow in only one direction.", null); - this.amps=amps; + super(aID, aName, aNameRegional, aTier, "A Simple diode that will allow Energy Flow in only one direction."); + this.amps = amps; } public GT_MetaTileEntity_Diode(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { @@ -34,7 +56,8 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Diode(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } + public String[] getDescription() { - return new String[] {mDescription,"Voltage: "+ ChatColorHelper.YELLOW + GT_Values.V[this.mTier],"Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(),"Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via "+ChatColorHelper.DARKGREEN+"BartWorks"}; + return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java index 218f8f0d50..bbe86520f3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.tileentities; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; @@ -43,11 +65,11 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans @Override public long maxEUStore() { - return 512L + (GT_Values.V[this.mTier ] * 320L); + return 512L + (GT_Values.V[this.mTier] * 320L); } public String[] getDescription() { - return new String[] {mDescription,"Voltage: "+ ChatColorHelper.YELLOW +GT_Values.V[this.mTier],"Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(),"Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via "+ChatColorHelper.DARKGREEN+"BartWorks"}; + return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_RadioHatch.java new file mode 100644 index 0000000000..619a025747 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_RadioHatch.java @@ -0,0 +1,315 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities; + +import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_RadioHatch; +import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; + +import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; + +public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { + + private final int cap; + public int sievert; + private long timer = 1; + private short[] colorForGUI; + private byte mass; + private String material; + private byte coverage = 0; + + public GT_MetaTileEntity_RadioHatch(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 1, new String[]{"Radioactive Item Chamber for Multiblocks", "Capacity: " + (aTier - 2) + " kg" + ((aTier - 2) >= 2 ? "s" : ""), "Use a screwdriver to set the containment level"}); + cap = aTier - 2; + } + + public GT_MetaTileEntity_RadioHatch(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 1, aDescription, aTextures); + cap = aTier - 2; + } + + public GT_MetaTileEntity_RadioHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 1, aDescription, aTextures); + cap = aTier - 2; + } + + public static long calcDecayTicks(int x) { + long ret = 0; + if (x >= 83 && x <= 100) + ret = (long) Math.ceil((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); + else if (x == 43) + ret = 5000; + else if (x == 61) + ret = 4500; + else if (x > 100) + ret = (long) Math.ceil(((8000D * Math.tanh(-x / 65D) + 8000D))); + return ret;//*20; + } + + public int getSievert() { + return this.sievert - (int) Math.ceil((float) this.sievert / 100f * (float) coverage); + } + + public short[] getColorForGUI() { + if (this.colorForGUI != null) + return this.colorForGUI; + return new short[]{0xFA, 0xFA, 0xFF}; + } + + public byte getMass() { + return this.mass; + } + + public byte getCoverage() { + return this.coverage; + } + + public void setCoverage(short coverage) { + byte nu = 0; + if (coverage > 100) + nu = 100; + else if (coverage < 0) + nu = 0; + else + nu = (byte) coverage; + this.coverage = nu; + } + + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + } + + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_MetaTileEntity_RadioHatch(mName, mTier, mDescriptionArray, mTextures); + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + aPlayer.openGui(MainMod.modID, 2, this.getBaseMetaTileEntity().getWorld(), this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()); + //super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + } + + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } else { + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + } + + public void updateSlots() { + if (this.mInventory[0] != null && this.mInventory[0].stackSize <= 0) + this.mInventory[0] = null; + } + + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { + if (this.getBaseMetaTileEntity().isServerSide()) { + + if (this.mass > 0) + ++timer; + + if (this.mass > 0 && this.sievert > 0 && calcDecayTicks(this.sievert) > 0) { + if (timer % (calcDecayTicks(this.sievert)) == 0) { + this.mass--; + if (mass == 0) { + material = "Empty"; + sievert = 0; + } + timer = 1; + } + } + + ItemStack lStack = this.mInventory[0]; + + if (lStack == null) + return; + + if (GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_4.get(1))) { + Materials materials = Materials.Uranium; + byte kg = 3; + + if (GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_4.get(1))) + materials = Materials.Plutonium; + else if (GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_4.get(1))) + materials = Materials.Thorium; + else if (GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_4.get(1))) + materials = Materials.Naquadah; + else + kg = 6; + + if (GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_2.get(1))) + kg = (byte) (2 * kg); + else if (GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_4.get(1))) + kg = (byte) (4 * kg); + + + if (this.mass == 0 || this.sievert == calculateSv(materials)) { + if (this.mass + kg <= cap) { + this.sievert = calculateSv(materials); + this.mass += kg; + this.mInventory[0].stackSize--; + updateSlots(); + colorForGUI = materials.mColor.mRGBa; + material = materials.mName; + } + } + } + + for (ItemStack varStack : BioVatLogicAdder.RadioHatch.getIsSv().keySet()) { + if (GT_Utility.areStacksEqual(varStack, lStack)) { + if (this.mass == 0 || this.sievert == BioVatLogicAdder.RadioHatch.getIsSv().get(varStack)) { + if (this.mass < this.cap) { + this.mass++; + this.sievert = BioVatLogicAdder.RadioHatch.getIsSv().get(varStack); + this.mInventory[0].stackSize--; + updateSlots(); + colorForGUI = null; + material = StatCollector.translateToLocal(varStack.getUnlocalizedName()); + return; + } + } + } + } + + //check material for general validity + if (lStack != null && GT_OreDictUnificator.getAssociation(lStack) != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial != null) { + //check orePrefix for general validity + if (GT_OreDictUnificator.getAssociation(lStack).mPrefix != null) { + OrePrefixes orePrefixes = GT_OreDictUnificator.getAssociation(lStack).mPrefix; + //check orePrefix for specialised validity + if (orePrefixes.equals(OrePrefixes.stickLong) || orePrefixes.equals(OrePrefixes.stick)) { + Materials materials = GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial; + //check material for specialised validity + if (materials.getProtons() >= 83 && materials.getProtons() != 125 || materials.getProtons() == 61 || materials.getProtons() == 43) { + if (this.mass == 0 || this.sievert == calculateSv(materials)) { + if ((this.mass + (orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1)) <= cap) { + this.sievert = calculateSv(materials); + this.mass += orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1; + this.mInventory[0].stackSize--; + updateSlots(); + colorForGUI = materials.mColor.mRGBa; + material = materials.mName; + } + } + } + } + } + } + + + } + } + + @Override + public boolean isGivingInformation() { + return true; + } + + @Override + public String[] getInfoData() { + return new String[]{"Material: " + material, "Sievert: " + sievert, "Amount: " + mass, "Time (in t/s/m/h) to decay (1kg): " + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert) * 60)) + "t/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 + "s/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 + "m/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 / 60 + "h"}; + } + + public boolean isSimpleMachine() { + return true; + } + + public boolean isFacingValid(byte aFacing) { + return true; + } + + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + public boolean isValidSlot(int aIndex) { + return true; + } + + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aSide == this.getBaseMetaTileEntity().getFrontFacing(); + } + + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_RadioHatch(aPlayerInventory, aBaseMetaTileEntity); + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_RadioHatch(aPlayerInventory, aBaseMetaTileEntity, this.mName); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setByte("mMass", mass); + aNBT.setByte("mSv", (byte) (sievert - 100)); + aNBT.setByte("mCoverage", coverage); + aNBT.setInteger("mTextColor", BW_Util.getColorFromArray(getColorForGUI())); + if (material != null && !material.isEmpty()) + aNBT.setString("mMaterial", material); + aNBT.setLong("timer", timer); + super.saveNBTData(aNBT); + } + + public long getTimer() { + return this.timer; + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + timer = aNBT.getLong("timer"); + mass = aNBT.getByte("mMass"); + sievert = aNBT.getByte("mSv") + 100; + coverage = aNBT.getByte("mCoverage"); + colorForGUI = BW_Util.splitColortoArray(aNBT.getInteger("mTextColor")); + material = aNBT.getString("mMaterial"); + super.loadNBTData(aNBT); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_BioVat.java new file mode 100644 index 0000000000..a7e153bdc1 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_BioVat.java @@ -0,0 +1,674 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities; + +import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.items.LabParts; +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; +import com.github.bartimaeusnek.bartworks.common.net.RendererPacket; +import com.github.bartimaeusnek.bartworks.util.*; +import cpw.mods.fml.common.FMLCommonHandler; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import javax.annotation.Nonnegative; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; + +import static gregtech.api.enums.GT_Values.V; + +public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { + + public static final HashMap staticColorMap = new HashMap<>(); + + private static final byte MCASING_INDEX = 49; + private static final byte TIMERDIVIDER = 20; + + private final HashSet playerMPHashSet = new HashSet(); + private final ArrayList mRadHatches = new ArrayList<>(); + private int height = 1; + private GT_Recipe mLastRecipe = null; + private Fluid mFluid = FluidRegistry.LAVA; + private BioCulture mCulture; + private ItemStack mStack = null; + private boolean needsVisualUpdate = true; + private byte mGlassTier = 0; + private int mSievert = 0; + + + public GT_TileEntity_BioVat(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_BioVat(String aName) { + super(aName); + } + + private static int[] specialValueUnpack(int aSpecialValure) { + int[] ret = new int[4]; + ret[0] = aSpecialValure & 0xF; // = glas tier + ret[1] = aSpecialValure >>> 4 & 0b11; // = special valure + ret[2] = aSpecialValure >>> 6 & 0b1; //exact svt + ret[3] = aSpecialValure >>> 7 & Integer.MAX_VALUE; // = sievert + return ret; + } + + public boolean isLiquidInput(byte aSide) { + return false; + } + + public boolean isLiquidOutput(byte aSide) { + return false; + } + + private int getInputCapacity() { + int ret = 0; + + for (GT_MetaTileEntity_Hatch_Input fluidH : this.mInputHatches) { + ret += fluidH.getCapacity(); + } + return ret; + } + + private int getOutputCapacity() { + int ret = 0; + + for (GT_MetaTileEntity_Hatch_Output fluidH : this.mOutputHatches) { + ret += fluidH.getCapacity(); + } + return ret; + } + + @Override + public int getCapacity() { + int ret = 0; + ret += getInputCapacity(); + //ret += getOutputCapacity(); + return ret; + } + + @Override + public int fill(FluidStack resource, boolean doFill) { + return super.fill(resource, doFill); + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return BWRecipes.instance.getMappingsFor(BWRecipes.BACTERIALVATBYTE); + } + + private int calcMod(double x) { + return (int) Math.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + GT_Recipe.GT_Recipe_Map gtRecipeMap = getRecipeMap(); + + if (gtRecipeMap == null) + return false; + + ArrayList tInputList = getStoredInputs(); + int tInputList_sS = tInputList.size(); + for (int i = 0; i < tInputList_sS - 1; i++) { + for (int j = i + 1; j < tInputList_sS; j++) { + if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { + if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { + tInputList.remove(j--); + tInputList_sS = tInputList.size(); + } else { + tInputList.remove(i--); + tInputList_sS = tInputList.size(); + break; + } + } + } + } + ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); + + ArrayList tFluidList = getStoredFluids(); + int tFluidList_sS = tFluidList.size(); + for (int i = 0; i < tFluidList_sS - 1; i++) { + for (int j = i + 1; j < tFluidList_sS; j++) { + if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { + if (tFluidList.get(i).amount >= tFluidList.get(j).amount) { + tFluidList.remove(j--); + tFluidList_sS = tFluidList.size(); + } else { + tFluidList.remove(i--); + tFluidList_sS = tFluidList.size(); + break; + } + } + } + } + + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); + + if (tFluidList.size() > 0) { + + GT_Recipe gtRecipe = gtRecipeMap.findRecipe(this.getBaseMetaTileEntity(), mLastRecipe, false, this.getMaxInputVoltage(), tFluids, itemStack, tInputs); + + if (gtRecipe == null) + return false; + + if (!BW_Util.areStacksEqual((ItemStack) gtRecipe.mSpecialItems, itemStack)) + return false; + + int[] conditions = specialValueUnpack(gtRecipe.mSpecialValue); + + if (conditions[2] == 0 ? (this.mSievert < conditions[3] || this.mGlassTier < conditions[0]) : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0])) + return false; + + int times = 1; + + + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + if (gtRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { + if (getStoredFluidOutputs().size() > 0) { + this.mOutputFluids = new FluidStack[gtRecipe.mFluidOutputs.length]; + for (FluidStack storedOutputFluid : getStoredFluidOutputs()) { + if (storedOutputFluid.isFluidEqual(gtRecipe.getFluidOutput(0))) + for (FluidStack inputFluidStack : gtRecipe.mFluidInputs) { + int j = calcMod(storedOutputFluid.amount); + for (int i = 0; i < j; i++) + if (depleteInput(inputFluidStack)) + times++; + } + } + for (FluidStack storedfluidStack : getStoredFluidOutputs()) { + for (int i = 0; i < gtRecipe.mFluidOutputs.length; i++) { + if (storedfluidStack.isFluidEqual(gtRecipe.getFluidOutput(i))) + this.mOutputFluids[i] = (new FluidStack(gtRecipe.getFluidOutput(i), times * gtRecipe.getFluidOutput(0).amount)); + } + + } + } else { + this.mOutputFluids = gtRecipe.mFluidOutputs; + } + } else + return false; + + calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, this.getMaxInputVoltage()); + + if (mEUt > 0) + mEUt = -mEUt; + this.mProgresstime = 0; + + if (gtRecipe.mCanBeBuffered) + mLastRecipe = gtRecipe; + + updateSlots(); + return true; + } + return false; + } + + /** + * Taken from the GTNH fork, made originally by Tec? + * Calcualtes overclocked ness using long integers + * + * @param aEUt - recipe EUt + * @param aDuration - recipe Duration + * @param mAmperage - should be 1 ? + */ + protected void calculateOverclockedNessMulti(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage) { + byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); + if (mTier == 0) { + //Long time calculation + long xMaxProgresstime = ((long) aDuration) << 1; + if (xMaxProgresstime > Integer.MAX_VALUE - 1) { + //make impossible if too long + mEUt = Integer.MAX_VALUE - 1; + mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + mEUt = aEUt >> 2; + mMaxProgresstime = (int) xMaxProgresstime; + } + } else { + //Long EUt calculation + long xEUt = aEUt; + //Isnt too low EUt check? + long tempEUt = xEUt < V[1] ? V[1] : xEUt; + + mMaxProgresstime = aDuration; + + while (tempEUt <= V[mTier - 1] * mAmperage) { + tempEUt <<= 2;//this actually controls overclocking + //xEUt *= 4;//this is effect of everclocking + mMaxProgresstime >>= 1;//this is effect of overclocking + xEUt = mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power + } + if (xEUt > Integer.MAX_VALUE - 1) { + mEUt = Integer.MAX_VALUE - 1; + mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + mEUt = (int) xEUt; + if (mEUt == 0) + mEUt = 1; + if (mMaxProgresstime == 0) + mMaxProgresstime = 1;//set time to 1 tick + } + } + } + + public ArrayList getStoredFluidOutputs() { + ArrayList rList = new ArrayList(); + Iterator var2 = this.mOutputHatches.iterator(); + + while (var2.hasNext()) { + GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) var2.next(); + if (tHatch.getFluid() != null) + rList.add(tHatch.getFluid()); + } + return rList; + } + + private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_RadioHatch) { + ((GT_MetaTileEntity_RadioHatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mRadHatches.add((GT_MetaTileEntity_RadioHatch) aMetaTileEntity); + } else { + return false; + } + } + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; + int blockcounter = 0; + + for (int x = -2; x <= 2; x++) + for (int z = -2; z <= 2; z++) + for (int y = 0; y < 4; y++) { + IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z); + if (y == 0 || y == 3) { + //controller + if (y == 0 && xDir + x == 0 && zDir + z == 0) + continue; + if (!(this.addOutputToMachineList(tileEntity, MCASING_INDEX) || this.addRadiationInputToMachineList(tileEntity, MCASING_INDEX) || this.addInputToMachineList(tileEntity, MCASING_INDEX) || this.addMaintenanceToMachineList(tileEntity, MCASING_INDEX) || this.addEnergyInputToMachineList(tileEntity, MCASING_INDEX))) { + if (BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, GregTech_API.sBlockCasings4, 1)) { + ++blockcounter; + continue; + } + return false; + } + } else { + if (Math.abs(x) < 2 && Math.abs(z) != 2) { + if (!(BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, Blocks.air) || (BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, FluidLoader.bioFluidBlock)))) { + return false; + } + } else { + if (x == -2 && z == -2 && y == 1) + mGlassTier = calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); + if (0 == mGlassTier || mGlassTier != calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z))) { + return false; + } + } + } + } + +// this.mWrench = true; +// this.mScrewdriver = true; +// this.mSoftHammer = true; +// this.mHardHammer = true; +// this.mSolderingTool = true; +// this.mCrowbar = true; + + if (blockcounter > 18) + if (this.mRadHatches.size() < 2) + if (this.mOutputHatches.size() == 1) + if (this.mMaintenanceHatches.size() == 1) + if (this.mInputHatches.size() > 0) + if (this.mEnergyHatches.size() > 0) + return true; + + return false; + } + + private byte calculateGlassTier(@Nonnull Block block, @Nonnegative Byte meta) { + + if (block.equals(BioItemList.bw_glasses[0])) + return meta > 1 ? (byte) (meta + 3) : 4; + + if (block.getUnlocalizedName().equals("blockAlloyGlass")) + return 4; + + if (block.equals(Blocks.glass)) + return 3; + + for (BioVatLogicAdder.BlockMetaPair B : BioVatLogicAdder.BioVatGlass.getGlassMap().keySet()) + if (B.getBlock().equals(block) && B.getaByte().equals(meta)) + return BioVatLogicAdder.BioVatGlass.getGlassMap().get(B); + + if (block.getMaterial().equals(Material.glass)) + return 3; + + return 0; + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + private void sendAllRequiredRendererPackets() { + int height = reCalculateHeight(); + if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) { + for (int x = -1; x < 2; x++) + for (int y = 1; y < height; y++) + for (int z = -1; z < 2; z++) + sendPackagesOrRenewRenderer(x, y, z, this.mCulture); + } + } + + private void sendPackagesOrRenewRenderer(int x, int y, int z, BioCulture lCulture) { + int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; + int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; + + staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId)); + staticColorMap.put(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId), lCulture == null ? BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB() : lCulture.getColorRGB()); + + if (FMLCommonHandler.instance().getSide().isServer()) { + MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( + this.getBaseMetaTileEntity().getWorld(), + new RendererPacket( + new Coords( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId + ), + lCulture == null ? BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB() : lCulture.getColorRGB(), + true + ), + this.getBaseMetaTileEntity().getXCoord(), + this.getBaseMetaTileEntity().getZCoord() + ); + MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( + this.getBaseMetaTileEntity().getWorld(), + new RendererPacket( + new Coords( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId + ), + lCulture == null ? BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB() : lCulture.getColorRGB(), + false + ), + this.getBaseMetaTileEntity().getXCoord(), + this.getBaseMetaTileEntity().getZCoord() + ); + } + needsVisualUpdate = true; + } + + private void check_Chunk() { + World aWorld = this.getBaseMetaTileEntity().getWorld(); + if (!aWorld.isRemote) { + Iterator var5 = aWorld.playerEntities.iterator(); + + while (var5.hasNext()) { + Object tObject = var5.next(); + if (!(tObject instanceof EntityPlayerMP)) { + break; + } + EntityPlayerMP tPlayer = (EntityPlayerMP) tObject; + Chunk tChunk = aWorld.getChunkFromBlockCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord()); + if (tPlayer.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { + if (!playerMPHashSet.contains(tPlayer)) { + playerMPHashSet.add(tPlayer); + sendAllRequiredRendererPackets(); + } + } else { + playerMPHashSet.remove(tPlayer); + } + + } + } + } + + private void placeFluid() { + int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; + int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; + height = reCalculateHeight(); + if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) + for (int x = -1; x < 2; x++) { + for (int y = 0; y < height; y++) { + for (int z = -1; z < 2; z++) { + if (this.getBaseMetaTileEntity().getWorld().getBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()).equals(Blocks.air)) + this.getBaseMetaTileEntity().getWorld().setBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), FluidLoader.bioFluidBlock); + } + } + } + } + + private int reCalculateFluidAmmount() { + int lFluidAmount = 0; + for (int i = 0; i < this.getStoredFluids().size(); i++) { + lFluidAmount += this.getStoredFluids().get(i).amount; + } + return lFluidAmount; + } + + private int reCalculateHeight() { + return (this.reCalculateFluidAmmount() > ((this.getCapacity() / 4) - 1) ? (this.reCalculateFluidAmmount() >= this.getCapacity() / 2 ? 3 : 2) : 1); + } + + public void doAllVisualThings() { + if (this.getBaseMetaTileEntity().isServerSide()) { + if (mMachine) { + ItemStack aStack = this.mInventory[1]; + BioCulture lCulture = null; + int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; + int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; + + if (this.getBaseMetaTileEntity().getTimer() % 200 == 0) { + check_Chunk(); + } + + if (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 0) { + for (int x = -1; x < 2; x++) + for (int y = 1; y < 3; y++) + for (int z = -1; z < 2; z++) + this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()); + } + + height = reCalculateHeight(); + if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) { + if ((!(BW_Util.areStacksEqual(aStack, mStack))) || (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 1)) { + for (int x = -1; x < 2; x++) { + for (int y = 1; y < height; y++) { + for (int z = -1; z < 2; z++) { + if (aStack == null || (aStack != null && aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0)) { + if (mCulture == null || aStack == null || aStack.getTagCompound() == null || mCulture.getID() != aStack.getTagCompound().getInteger("ID")) { + lCulture = aStack == null || aStack.getTagCompound() == null ? null : BioCulture.getBioCulture(aStack.getTagCompound().getString("Name")); + sendPackagesOrRenewRenderer(x, y, z, lCulture); + } + } + } + } + } + mStack = aStack; + mCulture = lCulture; + } + if (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 1) { + if (this.getBaseMetaTileEntity().isClientSide()) + new Throwable().printStackTrace(); + placeFluid(); + needsVisualUpdate = false; + } + } + } else { + onRemoval(); + } + } + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (height != reCalculateHeight()) + needsVisualUpdate = true; + doAllVisualThings(); + if (this.getBaseMetaTileEntity().isServerSide() && this.mRadHatches.size() == 1) + this.mSievert = this.mRadHatches.get(0).getSievert(); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setInteger("mFluidHeight", height); + if (mCulture != null && !mCulture.getName().isEmpty()) + aNBT.setString("mCulture", mCulture.getName()); + else if ((mCulture == null || mCulture.getName().isEmpty()) && !aNBT.getString("mCulture").isEmpty()) { + aNBT.removeTag("mCulture"); + } + if (this.mFluid != null) + aNBT.setString("mFluid", mFluid.getName()); + super.saveNBTData(aNBT); + } + + @Override + public void onRemoval() { + int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; + int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; + for (int x = -1; x < 2; x++) { + for (int y = 1; y < 3; y++) { + for (int z = -1; z < 2; z++) { + if (this.getBaseMetaTileEntity().getWorld().getBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()).equals(FluidLoader.bioFluidBlock)) + this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()); + staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()), this.getBaseMetaTileEntity().getWorld().provider.dimensionId); + if (FMLCommonHandler.instance().getSide().isServer()) + MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( + this.getBaseMetaTileEntity().getWorld(), + new RendererPacket( + new Coords( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId + ), + mCulture == null ? BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB() : mCulture.getColorRGB(), + true + ), + this.getBaseMetaTileEntity().getXCoord(), + this.getBaseMetaTileEntity().getZCoord() + ); + } + } + } + super.onRemoval(); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + height = aNBT.getInteger("mFluidHeight"); + mCulture = BioCulture.getBioCulture(aNBT.getString("mCulture")); + if (!aNBT.getString("mFluid").isEmpty()) + mFluid = FluidRegistry.getFluid(aNBT.getString("mFluid")); + super.loadNBTData(aNBT); + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_BioVat(this.mName); + } + + @Override + public String[] getDescription() { + return new String[]{ + "Controller Block for the Bio Vat", + "LxHxD: 5x4x5", + "Bottom and top are Stainless Steel Casings", + "Bottom and top must contain:", + "1x Maintenance, 1x Output Hatch, 1 or more Input Hatches, 1 or more Input Buses, 0-1 Radiation Input Bus", + "The two middle layers must be build out of glass, hollow", + "The glass can be any glass, i.e. Tinkers Construct Clear Glass", + "Some Recipes need more advanced Glass Types", + "For maximum efficiency boost keep the Output Hatch always half filled!", + "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" + }; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[MCASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[MCASING_INDEX]}; + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java index 1b2a2934fb..7e6f55a02b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.tileentities; import gregtech.api.enums.ItemList; @@ -62,6 +84,5 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { protected void setElectricityStats() { - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java index 501849bfcb..cd88cfa5ec 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java @@ -1,8 +1,30 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.tileentities; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_LESU; -import com.github.bartimaeusnek.bartworks.common.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_LESU; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; @@ -32,24 +54,23 @@ import net.minecraft.world.World; public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { - private static IIcon[] iIcons = new IIcon[4]; - private static IIconContainer[] iIconContainers = new IIconContainer[4]; - private static ITexture[][] iTextures = new ITexture[4][1]; private static final byte TEXID_SIDE = 0; private static final byte TEXID_CHARGING = 1; private static final byte TEXID_IDLE = 2; private static final byte TEXID_EMPTY = 3; - - private long mStorage; + private static IIcon[] iIcons = new IIcon[4]; + private static IIconContainer[] iIconContainers = new IIconContainer[4]; + private static ITexture[][] iTextures = new ITexture[4][1]; public ConnectedBlocksChecker connectedcells; public ItemStack[] circuits = new ItemStack[5]; + private long mStorage; public GT_TileEntity_LESU(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); this.mStorage = ConfigHandler.energyPerCell; } - public GT_TileEntity_LESU(String aName){ + public GT_TileEntity_LESU(String aName) { super(aName); } @@ -66,13 +87,13 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public long maxEUStore() { - return (this.mStorage >= Long.MAX_VALUE-1 || this.mStorage < 0) ? Long.MAX_VALUE-1 : this.mStorage; + return (this.mStorage >= Long.MAX_VALUE - 1 || this.mStorage < 0) ? Long.MAX_VALUE - 1 : this.mStorage; } @Override public long maxAmperesIn() { int ret = 0; - for (int i = 0 ; i < 5; ++i) + for (int i = 0; i < 5; ++i) if (this.circuits[i] != null && this.circuits[i].getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) ret += this.circuits[i].getItemDamage(); return ret > 0 ? ret : 1; @@ -87,8 +108,8 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public long maxEUInput() { for (int i = 1; i < GT_Values.V.length; i++) { - if (maxEUOutput() <= GT_Values.V[i] && maxEUOutput() > GT_Values.V[i-1]) - return Math.min(GT_Values.V[i],32768L); + if (maxEUOutput() <= GT_Values.V[i] && maxEUOutput() > GT_Values.V[i - 1]) + return Math.min(GT_Values.V[i], 32768L); } return 8; @@ -134,13 +155,13 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { return new String[]{ "Controller Block for the GT2-Styled L.E.S.U.", "Size: ANY", - "Storage per LESU Casing: " + ConfigHandler.energyPerCell+"EU", - "Output EU: LESU Casings amount"+ - "Input EU: Next Voltage Tier to Output EU", + "Storage per LESU Casing: " + ConfigHandler.energyPerCell + "EU", + "Output EU: LESU Casings amount" + + "Input EU: Next Voltage Tier to Output EU", "Input/Output Amps can be configured via 4 Circuits in GUI", "Output Side has a dot on it.", - ChatColorHelper.RED+"Only one Controller allowed, no Wallsharing!", - "Added by bartimaeusnek via "+ChatColorHelper.DARKGREEN+"BartWorks" + ChatColorHelper.RED + "Only one Controller allowed, no Wallsharing!", + "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" }; } @@ -148,9 +169,9 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public void registerIcons(IIconRegister aBlockIconRegister) { for (int i = 0; i < iTextures.length; i++) { - iIcons[i]=aBlockIconRegister.registerIcon(MainMod.modID+":LESU_CASING_"+i); + iIcons[i] = aBlockIconRegister.registerIcon(MainMod.modID + ":LESU_CASING_" + i); final int finalI = i; - iIconContainers[i]=new IIconContainer() { + iIconContainers[i] = new IIconContainer() { @Override public IIcon getIcon() { return iIcons[finalI]; @@ -163,7 +184,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public ResourceLocation getTextureFile() { - return new ResourceLocation(MainMod.modID+":LESU_CASING_"+ finalI); + return new ResourceLocation(MainMod.modID + ":LESU_CASING_" + finalI); } }; } @@ -196,7 +217,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { ITexture[] ret = new ITexture[0]; - if(this.isClientSide()) { + if (this.isClientSide()) { for (int i = 0; i < iTextures.length; i++) { iTextures[i][0] = new GT_RenderedTexture(iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); @@ -233,16 +254,16 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public ItemStack getStackInSlot(int p_70301_1_) { if (p_70301_1_ > 1) - return this.circuits[(p_70301_1_-2)]; + return this.circuits[(p_70301_1_ - 2)]; return this.mInventory[p_70301_1_]; } @Override public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { if (p_70299_1_ < 2) - this.mInventory[p_70299_1_]=p_70299_2_; + this.mInventory[p_70299_1_] = p_70299_2_; else - this.circuits[(p_70299_1_-2)]=p_70299_2_; + this.circuits[(p_70299_1_ - 2)] = p_70299_2_; } @Override @@ -268,8 +289,9 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - switch (p_94041_1_){ - case 0: case 1: + switch (p_94041_1_) { + case 0: + case 1: return true; default: return p_94041_2_.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); @@ -323,22 +345,22 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } @Override - public boolean onRunningTick(ItemStack aStack){ - this.mMaxProgresstime=1; + public boolean onRunningTick(ItemStack aStack) { + this.mMaxProgresstime = 1; return true; } @Override public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setIntArray("customCircuitInv",GT_Utility.stacksToIntArray(this.circuits)); + aNBT.setIntArray("customCircuitInv", GT_Utility.stacksToIntArray(this.circuits)); super.saveNBTData(aNBT); } @Override public void loadNBTData(NBTTagCompound aNBT) { int[] stacks = aNBT.getIntArray("customCircuitInv"); - for (int i = 0; i < stacks.length ; i++) { - this.circuits[i]=GT_Utility.intToStack(stacks[i]); + for (int i = 0; i < stacks.length; i++) { + this.circuits[i] = GT_Utility.intToStack(stacks[i]); } super.loadNBTData(aNBT); } @@ -346,29 +368,28 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { connectedcells = new ConnectedBlocksChecker(); - connectedcells.get_connected(aBaseMetaTileEntity.getWorld(),aBaseMetaTileEntity.getXCoord(),aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord(), ItemRegistry.BW_BLOCKS[1]); + connectedcells.get_connected(aBaseMetaTileEntity.getWorld(), aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), ItemRegistry.BW_BLOCKS[1]); - if (connectedcells.get_meta_of_sideblocks(aBaseMetaTileEntity.getWorld(),this.getBaseMetaTileEntity().getMetaTileID(),new int[]{aBaseMetaTileEntity.getXCoord(),aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord()},true)) - { + if (connectedcells.get_meta_of_sideblocks(aBaseMetaTileEntity.getWorld(), this.getBaseMetaTileEntity().getMetaTileID(), new int[]{aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()}, true)) { this.getBaseMetaTileEntity().disableWorking(); this.getBaseMetaTileEntity().setActive(false); - this.mStorage=0; - this.mMaxProgresstime=0; - this.mProgresstime=0; + this.mStorage = 0; + this.mMaxProgresstime = 0; + this.mProgresstime = 0; return false; } - this.mEfficiency=this.getMaxEfficiency(null); - this.mStorage=(ConfigHandler.energyPerCell * connectedcells.hashset.size() >= Long.MAX_VALUE-1 || ConfigHandler.energyPerCell * connectedcells.hashset.size() < 0) ? Long.MAX_VALUE-1 : ConfigHandler.energyPerCell * connectedcells.hashset.size() ; - this.mMaxProgresstime=1; - this.mProgresstime=0; - - this.mCrowbar=true; - this.mHardHammer=true; - this.mScrewdriver=true; - this.mSoftHammer=true; - this.mSolderingTool=true; - this.mWrench=true; + this.mEfficiency = this.getMaxEfficiency(null); + this.mStorage = (ConfigHandler.energyPerCell * connectedcells.hashset.size() >= Long.MAX_VALUE - 1 || ConfigHandler.energyPerCell * connectedcells.hashset.size() < 0) ? Long.MAX_VALUE - 1 : ConfigHandler.energyPerCell * connectedcells.hashset.size(); + this.mMaxProgresstime = 1; + this.mProgresstime = 0; + + this.mCrowbar = true; + this.mHardHammer = true; + this.mScrewdriver = true; + this.mSoftHammer = true; + this.mSolderingTool = true; + this.mWrench = true; this.getBaseMetaTileEntity().enableWorking(); this.getBaseMetaTileEntity().setActive(true); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java index 369a69ba38..93fd85b502 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.tileentities; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; @@ -17,17 +39,18 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; -public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase { +import static gregtech.api.enums.GT_Values.V; - private byte mode = 0; - private byte texid = 2; - private long mCoilWicks = 0; - private boolean upstep = true; +public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase { private static final byte SINGLE_UPSTEP = 0; private static final byte SINGLE_DOWNSTEP = 1; private static final byte MULTI_UPSTEP = 2; private static final byte MULTI_DOWNSTEP = 3; + private byte mode = 0; + private byte texid = 2; + private long mCoilWicks = 0; + private boolean upstep = true; public GT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -46,40 +69,64 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (!this.getBaseMetaTileEntity().isAllowedToWork()) this.stopMachine(); - super.onPostTick(aBaseMetaTileEntity,aTick); + super.onPostTick(aBaseMetaTileEntity, aTick); } @Override - public boolean onRunningTick(ItemStack aStack){ - if (this.mode > SINGLE_DOWNSTEP){ - return false; - } - + public boolean onRunningTick(ItemStack aStack) { if (!this.getBaseMetaTileEntity().isAllowedToWork()) { this.stopMachine(); return false; } - this.mProgresstime=0; - this.mMaxProgresstime=1; + + this.mProgresstime = 0; + this.mMaxProgresstime = 1; + if (this.getBaseMetaTileEntity().getTimer() % 40 == 0) if (this.mEfficiency < this.getMaxEfficiency(null)) this.mEfficiency += 100; else this.mEfficiency = this.getMaxEfficiency(null); - boolean ret = this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput(this.getInputTier() * 2 * this.mEnergyHatches.size() * (long)this.mEfficiency / this.getMaxEfficiency(null)); + if (this.mode > SINGLE_DOWNSTEP) { + return this.onRunningTickTabbedMode(); + } + + boolean ret = this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput(this.getInputTier() * 2 * this.mEnergyHatches.size() * (long) this.mEfficiency / this.getMaxEfficiency(null)); return ret; } + public boolean onRunningTickTabbedMode() { + + for (GT_MetaTileEntity_Hatch_Dynamo E : mDynamoHatches) { + for (GT_MetaTileEntity_Hatch_Energy I : mEnergyHatches) { + + long vtt = I.getEUVar() >= (V[E.mTier] / 2) && E.getEUVar() < E.maxEUStore() ? I.getEUVar() : 0; + + if (vtt == 0) + continue; + + long vtp = E.getEUVar() + (vtt); + long avt = vtp < E.maxEUStore() ? vtp : E.maxEUStore(); + E.setEUVar(avt); + I.setEUVar(I.getEUVar() - vtt); + } + + } + + return true; + } + + public long getInputTier() { - if (this.mEnergyHatches.size()>0) + if (this.mEnergyHatches.size() > 0) return (long) GT_Utility.getTier(this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); else return 0; } public long getOutputTier() { - if (this.mDynamoHatches.size()>0) + if (this.mDynamoHatches.size() > 0) return (long) GT_Utility.getTier(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); else return 0; } @@ -92,10 +139,10 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase return false; } this.mode = this.mInventory[1] == null ? 0 : this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit") ? this.mInventory[1].getItemDamage() > 4 ? (byte) this.mInventory[1].getItemDamage() : 0 : 0; - this.upstep= (this.mode == 0 || this.mode == 2); - this.mProgresstime=0; - this.mMaxProgresstime=1; - this.mEfficiency= this.mEfficiency > 100 ? this.mEfficiency : 100; + this.upstep = (this.mode == 0 || this.mode == 2); + this.mProgresstime = 0; + this.mMaxProgresstime = 1; + this.mEfficiency = this.mEfficiency > 100 ? this.mEfficiency : 100; return this.upstep ? this.getOutputTier() - this.getInputTier() == mCoilWicks : this.getInputTier() - this.getOutputTier() == mCoilWicks; } @@ -104,7 +151,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase this.mode = this.mInventory[1] == null ? 0 : this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit") ? this.mInventory[1].getItemDamage() > 4 ? (byte) this.mInventory[1].getItemDamage() : 0 : 0; - if(this.mode <= 1){ + if (this.mode <= 1) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; @@ -131,7 +178,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase break; } } - System.out.println(mCoilWicks); + if (mCoilWicks % 8 != 0) return false; @@ -177,132 +224,132 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase } } - // check dynamos and energy hatches for the same tier - byte outtier = this.mDynamoHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { - if (out.mTier != outtier) - return false; - } + // check dynamos and energy hatches for the same tier + byte outtier = this.mDynamoHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { + if (out.mTier != outtier) + return false; + } - byte intier = this.mEnergyHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) { - if (in.mTier != intier) - return false; - } - } else { + byte intier = this.mEnergyHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) { + if (in.mTier != intier) + return false; + } + } else { - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; - int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY * 2; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; - //check height - int y = 1; - boolean stillcoil = true; - while (stillcoil) { - for (int x = -1; x <= 1; ++x) { - for (int z = -1; z <= 1; ++z) { - if (x != 0 || z != 0) { - stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; - if (stillcoil) { - ++this.mCoilWicks; - if (mCoilWicks % 8 == 0) { - ++y; - continue; - } - } else - break; - } + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; + int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY * 2; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; + //check height + int y = 1; + boolean stillcoil = true; + while (stillcoil) { + for (int x = -1; x <= 1; ++x) { + for (int z = -1; z <= 1; ++z) { + if (x != 0 || z != 0) { + stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; + if (stillcoil) { + ++this.mCoilWicks; + if (mCoilWicks % 8 == 0) { + ++y; + continue; + } + } else + break; } - if (!stillcoil) - break; } + if (!stillcoil) + break; } + } - if (mCoilWicks % 8 != 0) - return false; + if (mCoilWicks % 8 != 0) + return false; - this.mCoilWicks = this.mCoilWicks / 8; + this.mCoilWicks = this.mCoilWicks / 8; - //check interior (NiFeZn02 Core) - for (int i = 1; i <= this.mCoilWicks; ++i) { - if (!aBaseMetaTileEntity.getBlockOffset(xDir, i, zDir).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir, i, zDir) == 0) { - return false; - } + //check interior (NiFeZn02 Core) + for (int i = 1; i <= this.mCoilWicks; ++i) { + if (!aBaseMetaTileEntity.getBlockOffset(xDir, i, zDir).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir, i, zDir) == 0) { + return false; } + } - //check Bottom - for (int x = -2; x <= 2; ++x) - for (int z = -2; z <= 2; ++z) - if (xDir + x != 0 || zDir + z != 0) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } + //check Bottom + for (int x = -2; x <= 2; ++x) + for (int z = -2; z <= 2; ++z) + if (xDir + x != 0 || zDir + z != 0) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { + return false; + } /* if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { return false; } */ - } } + } - //check Top - for (int x = -2; x <= 2; ++x) - for (int z = -2; z <= 2; ++z) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addDynamoToMachineList(tTileEntity, texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } + //check Top + for (int x = -2; x <= 2; ++x) + for (int z = -2; z <= 2; ++z) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addDynamoToMachineList(tTileEntity, texid)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { + return false; + } /* if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { return false; } */ - } } + } + + if (this.mDynamoHatches.size() <= 0 || this.mEnergyHatches.size() <= 0) + return false; - if (this.mDynamoHatches.size() <= 0 || this.mEnergyHatches.size() <= 0) + byte outtier = this.mDynamoHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { + if (out.mTier != outtier) return false; + } - byte outtier = this.mDynamoHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { - if (out.mTier != outtier) - return false; - } + byte intier = this.mEnergyHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) { + if (in.mTier != intier) + return false; + } - byte intier = this.mEnergyHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) { - if (in.mTier != intier) - return false; - } + //check tap hull + for (int ty = 1; ty <= y; ++ty) { + + byte leveltier = 0; + if (this.mInventory[1].getItemDamage() == 2) + leveltier = ((byte) (intier - ty)); + else if (this.mInventory[1].getItemDamage() == 3) + leveltier = ((byte) (intier + ty)); + else + return false; - //check tap hull - for (int ty = 1; ty <= y; ++ty) { - - byte leveltier = 0; - if (this.mInventory[1].getItemDamage() == 2) - leveltier = ((byte) (intier - ty)); - else if (this.mInventory[1].getItemDamage() == 3) - leveltier = ((byte) (intier + ty)); - else - return false; - - for (int x = -2; x <= 2; ++x) - for (int z = -2; z <= 2; ++z) - if (x == -2 || z == -2 || x == 2 || z == 2) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, ty, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid, leveltier) && !this.addDynamoToMachineList(tTileEntity, texid, leveltier)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, ty, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } + for (int x = -2; x <= 2; ++x) + for (int z = -2; z <= 2; ++z) + if (x == -2 || z == -2 || x == 2 || z == 2) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, ty, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid, leveltier) && !this.addDynamoToMachineList(tTileEntity, texid, leveltier)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, ty, zDir + z) != GregTech_API.sBlockCasings1) { + return false; } } - } + } } - if (this.mDynamoHatches.size() <= 0 || this.mEnergyHatches.size() <= 0) - return false; + } + if (this.mDynamoHatches.size() <= 0 || this.mEnergyHatches.size() <= 0) + return false; return true; } @@ -348,19 +395,19 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase "Middle of Dynamo Coils needs to be a NickelFerrite Core", "Top Contains at least 1 Dynamo Hatch", "Maintenance Hatch can be placed anywhere", - "Added by bartimaeusnek via "+ ChatColorHelper.DARKGREEN+"BartWorks" + "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" //"Tapped Mode is disabled." }; } @Override - public void saveNBTData(NBTTagCompound ntag){ - ntag.setLong("mCoilWicks",mCoilWicks); + public void saveNBTData(NBTTagCompound ntag) { + ntag.setLong("mCoilWicks", mCoilWicks); super.saveNBTData(ntag); } @Override - public void loadNBTData(NBTTagCompound ntag){ + public void loadNBTData(NBTTagCompound ntag) { super.loadNBTData(ntag); mCoilWicks = ntag.getLong("mCoilWicks"); } @@ -378,7 +425,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase if (aMetaTileEntity == null) { return false; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { - if (tier == ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mTier) { + if (tier == ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mTier) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); } @@ -397,9 +444,9 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase if (aMetaTileEntity == null) { return false; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { - if (tier == ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mTier) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo)aMetaTileEntity); + if (tier == ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mTier) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); } return false; } else { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java index bea3a91279..79751aad87 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.tileentities; import com.github.bartimaeusnek.bartworks.MainMod; @@ -69,7 +91,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { return true; } - public boolean recipe_fallback(ItemStack aStack){ + public boolean recipe_fallback(ItemStack aStack) { //sight... fallback to the macerator recipes GT_Recipe.GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; if (tMap == null) @@ -80,14 +102,15 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { if (tRecipe.getOutput(0) != null) { aStack.stackSize--; mOutputItems[0] = tRecipe.getOutput(0); - if (new XSTR().nextInt(2) == 0){ + + if (new XSTR().nextInt(2) == 0) { if (tRecipe.getOutput(1) != null) mOutputItems[1] = tRecipe.getOutput(1); - else + else if (GT_OreDictUnificator.getAssociation(aStack) == null || GT_OreDictUnificator.getAssociation(aStack).mMaterial == null || GT_OreDictUnificator.getAssociation(aStack).mMaterial.mMaterial == null) mOutputItems[1] = tRecipe.getOutput(0); } } - this.mMaxProgresstime = (tRecipe.mDuration * 2 *100); + this.mMaxProgresstime = (tRecipe.mDuration * 2 * 100); return true; } @@ -235,6 +258,11 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { this.mMaxProgresstime = 60 * 20 * 100; this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.crushed, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); return true; + } else if (OrePrefixes.nugget.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 15 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dustTiny, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); + return true; } else if (OrePrefixes.crushed.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { itemStack.stackSize -= 1; this.mMaxProgresstime = 30 * 20 * 100; @@ -256,7 +284,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, (GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL)) ? 9L : 1L)); return true; } else if ( - OrePrefixes.stone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || + OrePrefixes.stone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.stoneBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.stoneChiseled.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.stoneCobble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || @@ -279,7 +307,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new BW_GUIContainer_Windmill(aPlayerInventory, aBaseMetaTileEntity,this.getLocalName()); + return new BW_GUIContainer_Windmill(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName()); } public boolean addDispenserToOutputSet(TileEntity aTileEntity) { @@ -512,10 +540,10 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { "A primitive Grinder powered by Kinetic energy.", "WxHxL: 7x12x7", "Layer 1: 7x7 Bricks, corners are air, controller at front centered.", - "Layer 2-4: 5x5 Hardened Clay, corners are air, can contain one door,", + "Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,", "hollow, must contain at least one Dispenser", - "Layer 5: 5x5 Wood Planks. Corners are filled, hollow.", - "Layer 6: 7x7 Wood Planks. Corners are air, hollow.", + "Layer 6: 5x5 Wood Planks. Corners are filled, hollow.", + "Layer 7: 7x7 Wood Planks. Corners are air, hollow.", "Layer 8: 7x7 Wood Planks. Corners are air, hollow,", "front centered must be a Primitive Kinetic Shaftbox", "Layer 9: 7x7 Wood Planks. Corners are air, hollow.", @@ -525,7 +553,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { "Needs a Wind Mill Rotor in the Shaftbox to operate", "Input items in Controller", "Output items will appear in the dispensers", - "Added by bartimaeusnek via "+ ChatColorHelper.DARKGREEN+"BartWorks" + "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" }; } @@ -536,26 +564,26 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { - iIcons[0]=aBlockIconRegister.registerIcon("brick"); - iIconContainers[0]=new IIconContainer() { - @Override - public IIcon getIcon() { - return iIcons[0]; - } + iIcons[0] = aBlockIconRegister.registerIcon("brick"); + iIconContainers[0] = new IIconContainer() { + @Override + public IIcon getIcon() { + return iIcons[0]; + } - @Override - public IIcon getOverlayIcon() { - return iIcons[0]; - } + @Override + public IIcon getOverlayIcon() { + return iIcons[0]; + } - @Override - public ResourceLocation getTextureFile() { - return new ResourceLocation("brick"); - } - }; + @Override + public ResourceLocation getTextureFile() { + return new ResourceLocation("brick"); + } + }; - iIcons[1]=aBlockIconRegister.registerIcon(MainMod.modID+":windmill_top"); - iIconContainers[1]=new IIconContainer() { + iIcons[1] = aBlockIconRegister.registerIcon(MainMod.modID + ":windmill_top"); + iIconContainers[1] = new IIconContainer() { @Override public IIcon getIcon() { return iIcons[1]; @@ -568,7 +596,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @Override public ResourceLocation getTextureFile() { - return new ResourceLocation(MainMod.modID+":windmill_top"); + return new ResourceLocation(MainMod.modID + ":windmill_top"); } }; } @@ -582,10 +610,10 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { iTextures[0] = new GT_RenderedTexture(iIconContainers[0], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); ret = new ITexture[6]; - for (int i = 0; i < 6; i++) { - ret[i] = iTextures[0]; + for (int i = 0; i < 6; i++) { + ret[i] = iTextures[0]; } - if (aSide == 1){ + if (aSide == 1) { iTextures[1] = new GT_RenderedTexture(iIconContainers[1], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); ret = new ITexture[6]; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java new file mode 100644 index 0000000000..135666a134 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java @@ -0,0 +1,216 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.server.container; + +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_RadioHatch; +import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +import java.util.Iterator; + +public class BW_Container_RadioHatch extends Container { + + public byte coverage, dcoverage; + long timer; + private GT_MetaTileEntity_RadioHatch iGregTechTileEntity; + + public BW_Container_RadioHatch(InventoryPlayer inventory, IMetaTileEntity iGregTechTileEntity) { + this.iGregTechTileEntity = (GT_MetaTileEntity_RadioHatch) iGregTechTileEntity; + + IInventory inv = new IInventory() { + @Override + public int getSizeInventory() { + return 0; + } + + @Override + public ItemStack getStackInSlot(int p_70301_1_) { + return null; + } + + @Override + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + return null; + } + + @Override + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + return null; + } + + @Override + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + + } + + @Override + public String getInventoryName() { + return null; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return 0; + } + + @Override + public void markDirty() { + + } + + @Override + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return false; + } + + @Override + public void openInventory() { + + } + + @Override + public void closeInventory() { + + } + + @Override + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return false; + } + }; + + for (int i = 0; i < 12; i++) { + addSlotToContainer(new GT_Slot_Holo(inv, i, -64 + i * 18, 22, false, false, 1)); + } + + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 9; j++) { + addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + for (int i = 0; i < 9; i++) { + addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); + } + } + + @Override + public void detectAndSendChanges() { + if (!this.iGregTechTileEntity.getBaseMetaTileEntity().isClientSide() && this.iGregTechTileEntity.getBaseMetaTileEntity().getMetaTileEntity() != null) { + coverage = iGregTechTileEntity.getCoverage(); + ++timer; + Iterator var2 = this.crafters.iterator(); + if (timer >= Long.MAX_VALUE - 1) + timer = 0; + while (true) { + do { + if (!var2.hasNext()) { + dcoverage = coverage; + return; + } + ICrafting var1 = (ICrafting) var2.next(); + if (this.timer % 500 == 10 || this.dcoverage != coverage) + var1.sendProgressBarUpdate(this, 0, coverage); + } while (this.timer % 500 != 10 && this.dcoverage != coverage); + } + } + } + + @Override + public void updateProgressBar(int p_75137_1_, int p_75137_2_) { + if (p_75137_1_ == 0) + coverage = (byte) p_75137_2_; + } + + @Override + public ItemStack slotClick(int slot, int button, int aShifthold, EntityPlayer entityPlayer) { + if (slot >= 0 && slot < 12) { + byte setto; + switch (slot) { + case 0: + setto = -100; + break; + case 1: + setto = -75; + break; + case 2: + setto = -50; + break; + case 3: + setto = -25; + break; + case 4: + setto = -10; + break; + case 5: + setto = -1; + break; + case 6: + setto = 1; + break; + case 7: + setto = 10; + break; + case 8: + setto = 25; + break; + case 9: + setto = 50; + break; + case 10: + setto = 75; + break; + case 11: + setto = 100; + break; + default: + setto = 0; + } + this.iGregTechTileEntity.setCoverage((short) (this.iGregTechTileEntity.getCoverage() + setto)); + detectAndSendChanges(); + return null; + } + return super.slotClick(slot, button, aShifthold, entityPlayer); + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int SlotNR) { + return null; + } + + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return true; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java index aa2f248fec..cd56a04a6b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.server.container; import gregtech.api.gui.GT_Slot_Holo; @@ -12,17 +34,17 @@ import net.minecraft.nbt.NBTTagCompound; public class GT_Container_CircuitProgrammer extends Container { - public GT_Container_CircuitProgrammer(InventoryPlayer inventory){ + public GT_Container_CircuitProgrammer(InventoryPlayer inventory) { IInventory inv = new pinv(inventory.player); - addSlotToContainer(new Slot(inv,0,44,61));//-45, 84)); + addSlotToContainer(new Slot(inv, 0, 44, 61));//-45, 84)); for (int i = 1; i < 13; i++) { - addSlotToContainer(new GT_Slot_Holo(inv, i, -64+i*18, 22, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(inv, i, -64 + i * 18, 22, false, false, 1)); } for (int i = 0; i < 12; i++) { - addSlotToContainer(new GT_Slot_Holo(inv, i+12, -46+i*18, 40, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(inv, i + 12, -46 + i * 18, 40, false, false, 1)); } for (int i = 0; i < 3; i++) { @@ -37,13 +59,13 @@ public class GT_Container_CircuitProgrammer extends Container { } @Override - public ItemStack slotClick(int slot, int button, int aShifthold, EntityPlayer entityPlayer){ - if (slot > 0 && slot < 25 && ((Slot)this.inventorySlots.get(0)).getStack() != null){ - ((Slot)this.inventorySlots.get(0)).getStack().setItemDamage(slot); - detectAndSendChanges(); - return ( (Slot) this.inventorySlots.get(0)).getStack(); - } - return super.slotClick(slot, button, aShifthold, entityPlayer);//( (Slot) this.inventorySlots.get(slot)).getStack(); + public ItemStack slotClick(int slot, int button, int aShifthold, EntityPlayer entityPlayer) { + if (slot > 0 && slot < 25 && ((Slot) this.inventorySlots.get(0)).getStack() != null) { + ((Slot) this.inventorySlots.get(0)).getStack().setItemDamage(slot); + detectAndSendChanges(); + return ((Slot) this.inventorySlots.get(0)).getStack(); + } + return super.slotClick(slot, button, aShifthold, entityPlayer);//( (Slot) this.inventorySlots.get(slot)).getStack(); } @Override @@ -52,21 +74,20 @@ public class GT_Container_CircuitProgrammer extends Container { } @Override - public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int SlotNR) - { - Slot chipslot = (Slot)this.inventorySlots.get(0); + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int SlotNR) { + Slot chipslot = (Slot) this.inventorySlots.get(0); if (SlotNR > 24) { Slot slot = (Slot) this.inventorySlots.get(SlotNR); - if (slot != null && slot.getStack().getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())){ - if ( chipslot.getStack()== null ){ + if (slot != null && slot.getStack().getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) { + if (chipslot.getStack() == null) { chipslot.putStack(slot.getStack()); slot.decrStackSize(1); } } - }else if (SlotNR == 0 && chipslot.getStack() != null){ + } else if (SlotNR == 0 && chipslot.getStack() != null) { for (int i = 25; i < this.inventorySlots.size(); i++) { - if (((Slot)this.inventorySlots.get(i)).getStack() == null){ - Slot empty = ( (Slot) this.inventorySlots.get(i)); + if (((Slot) this.inventorySlots.get(i)).getStack() == null) { + Slot empty = ((Slot) this.inventorySlots.get(i)); empty.putStack(chipslot.getStack()); chipslot.decrStackSize(1); break; @@ -78,19 +99,19 @@ public class GT_Container_CircuitProgrammer extends Container { class pinv implements IInventory { - public pinv(EntityPlayer Player){ + ItemStack toBind; + EntityPlayer Player; + ItemStack Slot; + + public pinv(EntityPlayer Player) { super(); - this.Player=Player; - this.toBind=Player.inventory.getCurrentItem(); + this.Player = Player; + this.toBind = Player.inventory.getCurrentItem(); NBTTagCompound tag = this.toBind.getTagCompound(); if (tag.getBoolean("HasChip")) Slot = GT_Utility.getIntegratedCircuit(tag.getByte("ChipConfig")); } - ItemStack toBind; - EntityPlayer Player; - ItemStack Slot; - @Override public int getSizeInventory() { return 1; @@ -106,9 +127,9 @@ public class GT_Container_CircuitProgrammer extends Container { ItemStack ret = Slot.copy(); Slot = null; NBTTagCompound tag = toBind.getTagCompound(); - tag.setBoolean("HasChip",false); + tag.setBoolean("HasChip", false); toBind.setTagCompound(tag); - Player.inventory.setInventorySlotContents(Player.inventory.currentItem,toBind); + Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); return ret; } @@ -123,10 +144,10 @@ public class GT_Container_CircuitProgrammer extends Container { Slot = itemStack.copy().splitStack(1); itemStack.stackSize--; NBTTagCompound tag = toBind.getTagCompound(); - tag.setBoolean("HasChip",true); + tag.setBoolean("HasChip", true); tag.setByte("ChipConfig", (byte) itemStack.getItemDamage()); toBind.setTagCompound(tag); - Player.inventory.setInventorySlotContents(Player.inventory.currentItem,toBind); + Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); } } @@ -167,7 +188,7 @@ public class GT_Container_CircuitProgrammer extends Container { @Override public boolean isItemValidForSlot(int p_94041_1_, ItemStack itemStack) { - if (itemStack!= null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) + if (itemStack != null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) return true; return false; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java index 0de2b8b98f..edfc722bbd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.server.container; import net.minecraft.entity.player.EntityPlayer; @@ -22,6 +44,7 @@ public class GT_Container_Item_Destructopack extends Container { addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); } } + @Override public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int aSlotIndex) { final Slot slotObject = (Slot) this.inventorySlots.get(aSlotIndex); @@ -33,23 +56,21 @@ public class GT_Container_Item_Destructopack extends Container { public boolean canInteractWith(EntityPlayer p_75145_1_) { return true; } + @Override - public void onCraftMatrixChanged(IInventory p_75130_1_) - { + public void onCraftMatrixChanged(IInventory p_75130_1_) { final Slot slotObject = (Slot) this.inventorySlots.get(0); slotObject.decrStackSize(0); } - class delslot extends Slot{ - public delslot() - { + class delslot extends Slot { + public delslot() { super(new InventoryPlayer(null), 0, 80, 17); } - public void putStack(ItemStack p_75215_1_) - { - p_75215_1_=null; + public void putStack(ItemStack p_75215_1_) { + p_75215_1_ = null; this.onSlotChanged(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java index 3e28f36d0b..95d09eefa9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.server.container; import gregtech.api.gui.GT_Container_MultiMachine; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java new file mode 100644 index 0000000000..ceb6a4cc8e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.server.container; + +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_RadioHatch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.gui.GT_Container_1by1; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; + +import java.nio.ByteBuffer; +import java.util.Iterator; + +public class GT_Container_RadioHatch extends GT_Container_1by1 { + + public byte mass, dmass; + public short sv, dsv, sievert, r, g, b, dsievert, dr, dg, db; + public byte[] teTimer = new byte[8], dteTimer = new byte[8]; + GT_MetaTileEntity_RadioHatch TE; + private long timer = 0; + + public GT_Container_RadioHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) { + TE = (GT_MetaTileEntity_RadioHatch) this.mTileEntity.getMetaTileEntity(); + mass = TE.getMass(); + sievert = (short) TE.sievert; + short[] rgb = TE.getColorForGUI(); + r = rgb[0]; + g = rgb[1]; + b = rgb[2]; + sv = (short) TE.getSievert(); + teTimer = ByteBuffer.allocate(8).putLong(TE.getTimer()).array(); + ++timer; + Iterator var2 = this.crafters.iterator(); + if (timer >= Long.MAX_VALUE - 1) + timer = 0; + while (true) { + do { + if (!var2.hasNext()) { + dmass = mass; + dsievert = sievert; + dr = r; + dg = g; + db = b; + dteTimer = teTimer; + dsv = sv; + return; + } + ICrafting var1 = (ICrafting) var2.next(); + + if (this.timer % 500 == 10 || this.dmass != mass) + var1.sendProgressBarUpdate(this, 21, mass); + if (this.timer % 500 == 10 || this.dsievert != sievert) + var1.sendProgressBarUpdate(this, 22, (sievert - 100)); + if (this.timer % 500 == 10 || this.dr != r) + var1.sendProgressBarUpdate(this, 23, r); + if (this.timer % 500 == 10 || this.dg != g) + var1.sendProgressBarUpdate(this, 24, g); + if (this.timer % 500 == 10 || this.db != b) + var1.sendProgressBarUpdate(this, 25, b); + if (this.timer % 500 == 10 || this.dteTimer != teTimer) + for (int i = 0; i < teTimer.length; i++) { + var1.sendProgressBarUpdate(this, 26 + i, teTimer[i]); + } + if (this.timer % 500 == 10 || this.dsv != sv) + var1.sendProgressBarUpdate(this, 34, sv); + + } while (this.timer % 500 != 10 && this.dmass == this.mass); + } + } + } + + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 21: + mass = (byte) par2; + break; + case 22: + sievert = (short) (par2 + 100); + break; + case 23: + r = (short) par2; + break; + case 24: + g = (short) par2; + break; + case 25: + b = (short) par2; + break; + case 26: + teTimer[0] = (byte) par2; + break; + case 27: + teTimer[1] = (byte) par2; + break; + case 28: + teTimer[2] = (byte) par2; + break; + case 29: + teTimer[3] = (byte) par2; + break; + case 30: + teTimer[4] = (byte) par2; + break; + case 31: + teTimer[5] = (byte) par2; + break; + case 32: + teTimer[6] = (byte) par2; + break; + case 33: + teTimer[7] = (byte) par2; + break; + case 34: + sv = (short) par2; + break; + } + } + + public boolean canInteractWith(EntityPlayer player) { + return true; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java new file mode 100644 index 0000000000..f5f837cd0f --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -0,0 +1,580 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util; + +import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; +import cpw.mods.fml.common.Loader; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.items.behaviors.Behaviour_DataOrb; +import ic2.core.item.ItemFluidCell; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import javax.annotation.Nonnegative; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; + +import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.specialToByte; + +public class BWRecipes { + + public static final BWRecipes instance = new BWRecipes(); + public static final byte BIOLABBYTE = 0; + public static final byte BACTERIALVATBYTE = 1; + private GT_Recipe.GT_Recipe_Map sBiolab = new GT_Recipe.GT_Recipe_Map( + new HashSet(150), + "bw.recipe.biolab", + "Bio Lab", + null, + "gregtech:textures/gui/basicmachines/BW.GUI.BioLab", + 6, 2, 1, 1, 1, + "", 1, "", true, true); + private BacteriaVatRecipeMap sBacteriaVat = new BacteriaVatRecipeMap( + new HashSet(50), + "bw.recipe.BacteriaVat", + "Bacterial Vat", + null, + "gregtech:textures/gui/basicmachines/Default", + 6, 2, 0, 1, 1, + "Need Sievert: ", 1, " Sv", true, true); + + public BWRecipes() { + + FluidStack[] dnaFluid = {Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L)}; + + for (ItemStack stack : BioItemList.getAllPetriDishes()) { + BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); + if (DNA != null) { + ItemStack Detergent = BioItemList.getOther(1); + ItemStack DNAFlask = BioItemList.getDNASampleFlask(null); + ItemStack EthanolCell = Materials.Ethanol.getCells(1); + sBiolab.addFakeRecipe(false, + new ItemStack[]{ + stack, + DNAFlask, + Detergent, + EthanolCell + }, + new ItemStack[]{ + BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(DNA)), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L) + }, + BioItemList.mBioLabParts[0], + new int[]{DNA.getChance(), 10000}, + new FluidStack[]{ + FluidRegistry.getFluidStack("ic2distilledwater", 1000) + }, + null, + 500, + BW_Util.getMachineVoltageFromTier(3 + DNA.getTier()), + BW_Util.STANDART + ); + } + } + + for (ItemStack stack : BioItemList.getAllDNASampleFlasks()) { + BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound()); + + if (DNA != null) { + ItemStack Outp = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); + Behaviour_DataOrb.setDataName(Outp, DNA.getName()); + + sBiolab.addFakeRecipe(false, + new ItemStack[]{ + stack, + FluidLoader.BioLabFluidCells[0], + FluidLoader.BioLabFluidCells[3], + ItemList.Tool_DataOrb.get(1L) + }, + new ItemStack[]{ + Outp, + ItemList.Cell_Universal_Fluid.get(2L) + }, + BioItemList.mBioLabParts[1], + new int[]{DNA.getChance(), 10000}, + dnaFluid, + null, + 500, + BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), + BW_Util.STANDART + ); + } + } + + for (ItemStack stack : BioItemList.getAllPlasmidCells()) { + BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound()); + + if (DNA != null) { + ItemStack inp = ItemList.Tool_DataOrb.get(0L); + Behaviour_DataOrb.setDataTitle(inp, "DNA Sample"); + Behaviour_DataOrb.setDataName(inp, DNA.getName()); + ItemStack inp2 = ItemList.Tool_DataOrb.get(0L); + Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); + Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); + + sBiolab.addFakeRecipe(false, + new ItemStack[]{ + FluidLoader.BioLabFluidCells[1], + BioItemList.getPlasmidCell(null), + inp, + inp2 + }, + new ItemStack[]{ + stack, + ItemList.Cell_Universal_Fluid.get(1L) + }, + BioItemList.mBioLabParts[2], + new int[]{DNA.getChance(), 10000}, + dnaFluid, + null, + 500, + BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), + BW_Util.STANDART + ); + } + } + + //Transformation- [Distilled Water] + Culture () + Plasmids (Gene) Cell + Penicillin Cell= Culture (Gene) + Empty Cells + sBiolab.addFakeRecipe(false, + new ItemStack[]{ + BioItemList.getPetriDish(null).setStackDisplayName("The Culture to change"), + BioItemList.getPlasmidCell(null).setStackDisplayName("The Plasmids to Inject"), + FluidLoader.BioLabFluidCells[2], + }, + new ItemStack[]{ + BioItemList.getPetriDish(null).setStackDisplayName("The changed Culture"), + ItemList.Cell_Universal_Fluid.get(1L) + }, + BioItemList.mBioLabParts[3], + new int[]{7500, 10000}, + new FluidStack[]{ + FluidRegistry.getFluidStack("ic2distilledwater", 1000) + }, + null, + 500, + BW_Util.getMachineVoltageFromTier(6), + BW_Util.STANDART + ); + + + ItemStack Outp = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); + Behaviour_DataOrb.setDataName(Outp, "Any DNA"); + //Clonal Cellular Synthesis- [Liquid DNA] + Medium Petri Dish + Plasma Membrane + Stem Cells + Genome Data + sBiolab.addFakeRecipe(false, + new ItemStack[]{ + BioItemList.getPetriDish(null), + BioItemList.getOther(4), + ItemList.Circuit_Chip_Stemcell.get(2L), + Outp + }, + new ItemStack[]{ + BioItemList.getPetriDish(null).setStackDisplayName("The Culture made from DNA"), + }, + BioItemList.mBioLabParts[4], + new int[]{7500, 10000}, + new FluidStack[]{new FluidStack(dnaFluid[0].getFluid(), 9000)}, + null, + 500, + BW_Util.getMachineVoltageFromTier(6), + BW_Util.STANDART + ); + + FluidStack[] easyFluids = {Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000)}; + for (FluidStack fluidStack : easyFluids) { + for (BioCulture bioCulture : BioCulture.BIO_CULTURE_ARRAY_LIST) { + if (bioCulture.isBreedable() && bioCulture.getTier() == 0) { + sBacteriaVat.addRecipe( + //boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue + new BacteriaVatRecipe( + true, + new ItemStack[]{ + GT_Utility.getIntegratedCircuit(0), + new ItemStack(Items.sugar, 64) + }, + null, + BioItemList.getPetriDish(bioCulture), + null, + new FluidStack[]{ + fluidStack + }, + new FluidStack[]{ + new FluidStack(bioCulture.getFluid(), 10) + }, + 1000, + BW_Util.getMachineVoltageFromTier(3), + BW_Util.STANDART + ), true + ); + //aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue + sBiolab.addRecipe( + new BioLabRecipe( + false, + new ItemStack[]{ + BioItemList.getPetriDish(null), + fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Water.getCells(1) : ItemFluidCell.getUniversalFluidCell(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) + }, + new ItemStack[]{ + BioItemList.getPetriDish(bioCulture), + fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Empty.getCells(1) : ItemList.Cell_Universal_Fluid.get(1L) + }, + null, + new int[]{ + bioCulture.getChance(), + 10000 + }, + new FluidStack[]{ + new FluidStack(bioCulture.getFluid(), 1000) + }, + null, + 500, + BW_Util.getMachineVoltageFromTier(3), + BW_Util.STANDART + )); + } + } + } + } + + /** + * @param machine 0 = biolab; 1 = BacterialVat + * @return + */ + public GT_Recipe.GT_Recipe_Map getMappingsFor(byte machine) { + switch (machine) { + case 0: + return sBiolab; + case 1: + return sBacteriaVat; + default: + return null; + } + + } + + public boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + if (sBiolab.addRecipe(new BioLabRecipe(true, aInputs, new ItemStack[]{aOutput}, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) + return true; + return false; + } + + public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { + if (sBiolab.addRecipe(new BioLabRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, aFluidInputs, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null) + return true; + return false; + } + + @Deprecated + public boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + if (sBiolab.addRecipe(new BioLabRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[0], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) + return true; + return false; + } + + @Deprecated + public boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + if (sBiolab.addRecipe(new BioLabRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[1], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) + return true; + return false; + } + + @Deprecated + public boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + if (sBiolab.addRecipe(new BioLabRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[2], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) + return true; + return false; + } + + @Deprecated + public boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + if (sBiolab.addRecipe(new BioLabRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[3], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) + return true; + return false; + } + + @Deprecated + public boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + if (sBiolab.addRecipe(new BioLabRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[4], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) + return true; + return false; + } + + public boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative byte glasTier) { + int aSievert = 0; + if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) + aSievert += calculateSv(material); + aSievert = aSievert << 6; + aSievert = aSievert | glasTier; + if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, new ItemStack[]{GT_Values.NI}, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) + return true; + return false; + } + + public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, @Nonnegative int aSv, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { + byte gTier = (byte) glasTier; + int aSievert = 0; + if (aSv >= 83 || aSv == 61 || aSv == 43) + aSievert += aSv; + aSievert = aSievert << 1; + aSievert = aSievert | (exactSv ? 1 : 0); + aSievert = aSievert << 2; + aSievert = aSievert | specialToByte(aSpecialValue); + aSievert = aSievert << 4; + aSievert = aSievert | gTier; + if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, new ItemStack[]{BioItemList.getPetriDish(aCulture)}, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) + return true; + return false; + } + + public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { + byte gTier = (byte) glasTier; + int aSievert = 0; + if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) + aSievert += calculateSv(material); + aSievert = aSievert << 1; + aSievert = aSievert | (exactSv ? 1 : 0); + aSievert = aSievert << 2; + aSievert = aSievert | specialToByte(aSpecialValue); + aSievert = aSievert << 4; + aSievert = aSievert | gTier; + if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, new ItemStack[]{BioItemList.getPetriDish(aCulture)}, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) + return true; + return false; + } + + public boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, boolean exactSv) { + int aSievert = 0; + if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) + aSievert += calculateSv(material); + aSievert = aSievert << 1; + aSievert = aSievert | (exactSv ? 1 : 0); + aSievert = aSievert << 6; + if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, new ItemStack[]{GT_Values.NI}, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) + return true; + return false; + } + + public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture culture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, int aSpecialValue, boolean exactSv) { + int aSievert = 0; + if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) + aSievert += calculateSv(material); + aSievert = aSievert << 1; + aSievert = aSievert | (exactSv ? 1 : 0); + aSievert = aSievert << 2; + aSievert = aSievert | specialToByte(aSpecialValue); + aSievert = aSievert << 4; + if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, new ItemStack[]{BioItemList.getPetriDish(culture)}, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) + return true; + return false; + } + + /** + * Adds a Vat recipe without Rad requirements but with Glas requirements + */ + public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture culture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, byte glasTier) { + int aSievert = 0; + aSievert = aSievert << 7; + aSievert = aSievert | glasTier; + if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, new ItemStack[]{BioItemList.getPetriDish(culture)}, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) + return true; + return false; + } + + /** + * Adds a Vat recipe without Rad or Glas requirements + */ + public boolean addBacterialVatRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, BioCulture culture, FluidStack[] aFluidOutputs, int aDuration, int aEUt) { + if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, new ItemStack[]{BioItemList.getPetriDish(culture)}, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, 0)) != null) + return true; + return false; + } + + + public boolean addTrimmedBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { + byte gTier = (byte) glasTier; + int aSievert = 0; + if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) + aSievert += material.getProtons(); + aSievert = aSievert << 1; + aSievert = aSievert | (exactSv ? 1 : 0); + aSievert = aSievert << 2; + aSievert = aSievert | specialToByte(aSpecialValue); + aSievert = aSievert << 4; + aSievert = aSievert | gTier; + if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(true, aInputs, null, new ItemStack[]{BioItemList.getPetriDish(aCulture)}, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) + return true; + return false; + } + + class BioLabRecipe extends GT_Recipe { + protected BioLabRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + } + + } + + class BacteriaVatRecipe extends GT_Recipe { + protected BacteriaVatRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + } + } + + class BacteriaVatRecipeMap extends GT_Recipe.GT_Recipe_Map { + + public BacteriaVatRecipeMap(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + /** + * finds a Recipe matching the aFluid and ItemStack Inputs. + * + * @param aTileEntity an Object representing the current coordinates of the executing Block/Entity/Whatever. This may be null, especially during Startup. + * @param aRecipe in case this is != null it will try to use this Recipe first when looking things up. + * @param aNotUnificated if this is T the Recipe searcher will unificate the ItemStack Inputs + * @param aDontCheckStackSizes if set to false will only return recipes that can be executed at least once with the provided input + * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage + * @param aFluids the Fluid Inputs + * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with this, but some custom ones do. + * @param aInputs the Item Inputs + * @return the Recipe it has found or null for no matching Recipe + */ + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + // No Recipes? Well, nothing to be found then. + if (mRecipeList.isEmpty()) return null; + + // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 Stack" or "at least 2 Stacks" before they start searching for Recipes. + // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in their Machines to select Sub Recipes. + if (GregTech_API.sPostloadFinished) { + if (mMinimalInputFluids > 0) { + if (aFluids == null) return null; + int tAmount = 0; + for (FluidStack aFluid : aFluids) if (aFluid != null) tAmount++; + if (tAmount < mMinimalInputFluids) return null; + } + if (mMinimalInputItems > 0) { + if (aInputs == null) return null; + int tAmount = 0; + for (ItemStack aInput : aInputs) if (aInput != null) tAmount++; + if (tAmount < mMinimalInputItems) return null; + } + } + + // Unification happens here in case the Input isn't already unificated. + if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs); + + // Check the Recipe which has been used last time in order to not have to search for it again, if possible. + if (aRecipe != null) + if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqual((ItemStack) aRecipe.mSpecialItems, aSpecialSlot)) + return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; + + // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. + if (mUsualInputCount > 0 && aInputs != null) + for (ItemStack tStack : aInputs) + if (tStack != null) { + Collection tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack)); + if (tRecipes != null) + for (GT_Recipe tRecipe : tRecipes) + if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqual((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) + return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; + tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(GT_Values.W, tStack))); + if (tRecipes != null) + for (GT_Recipe tRecipe : tRecipes) + if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqual((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) + return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; + } + + // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that Map too. + if (mMinimalInputItems == 0 && aFluids != null) + for (FluidStack aFluid : aFluids) + if (aFluid != null) { + Collection tRecipes = mRecipeFluidMap.get(aFluid.getFluid()); + if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) + if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqual((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) + return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; + } + + // And nothing has been found. + return null; + } + + protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) { + aRecipe.mHidden = aHidden; + aRecipe.mFakeRecipe = aFakeRecipe; + GT_Recipe isthere = this.findRecipe((IHasWorldObjectAndCoords) null, false, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs); + + if (aRecipe.mFluidInputs.length < this.mMinimalInputFluids && aRecipe.mInputs.length < this.mMinimalInputItems) { + return null; + } else { + return aCheckForCollisions && isthere != null && BW_Util.areStacksEqual((ItemStack) isthere.mSpecialItems, (ItemStack) aRecipe.mSpecialItems) ? null : this.add(aRecipe); + } + } + + public GT_Recipe addRecipe(GT_Recipe aRecipe, boolean VanillaGT) { + if (VanillaGT) + return addRecipe(aRecipe, true, false, false); + else + return addRecipe(aRecipe); + } + + public GT_Recipe addRecipe(GT_Recipe aRecipe) { + if (aRecipe.mInputs.length > 0 && GT_Utility.areStacksEqual(aRecipe.mInputs[aRecipe.mInputs.length - 1], GT_Utility.getIntegratedCircuit(32767))) + return aRecipe; + else { + ItemStack[] nu1 = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1); + nu1[nu1.length - 1] = GT_Utility.getIntegratedCircuit(9 + nu1.length); + aRecipe.mInputs = nu1; + } + if (this.findRecipe((IHasWorldObjectAndCoords) null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null) { + ItemStack[] nu = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1); + int i = 9 + nu.length; + do { + nu[nu.length - 1] = GT_Utility.getIntegratedCircuit(i); + i++; + aRecipe.mInputs = nu; + if (i > 24) + i = 1; + if (i == 9 + nu.length) + return null; + } + while (this.findRecipe((IHasWorldObjectAndCoords) null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null); + } + return this.addRecipe(aRecipe, false, false, false); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java new file mode 100644 index 0000000000..19b5897fcf --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util; + +import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + +import java.util.Iterator; + +public class BW_Util { + + public static final int STANDART = 0; + public static final int CLEANROOM = -100; + public static final int LOWGRAVITY = -200; + + public static byte specialToByte(int aSpecialValue) { + byte special = 0; + if (aSpecialValue == (CLEANROOM)) + special = 1; + else if (aSpecialValue == (LOWGRAVITY)) + special = 2; + else if (aSpecialValue == (CLEANROOM | LOWGRAVITY)) { + special = 3; + } + return special; + } + + public static boolean addBlockToMachine(int x, int y, int z, int offsetsize, IGregTechTileEntity aBaseMetaTileEntity, Block block) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offsetsize; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offsetsize; + + return aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block); + } + + public static boolean addBlockToMachine(int x, int y, int z, int offsetsize, IGregTechTileEntity aBaseMetaTileEntity, Block block, int damage) { + byte dmg = (byte) damage; + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offsetsize; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offsetsize; + + return aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == dmg; + } + + public static int calculateSv(Materials materials) { + Iterator it = BioVatLogicAdder.RadioHatch.getMaSv().iterator(); + while (it.hasNext()) { + BioVatLogicAdder.MaterialSvPair pair = (BioVatLogicAdder.MaterialSvPair) it.next(); + if (pair.getMaterials().equals(materials)) + return pair.getSievert(); + } + return (int) (materials.getProtons() == 43L ? (materials.equals(Materials.NaquadahEnriched) ? 140 : materials.equals(Materials.Naquadria) ? 150 : materials.equals(Materials.Naquadah) ? 130 : 43) : materials.getProtons()); + } + + public static int getMachineVoltageFromTier(int tier) { + return (int) (30 * Math.pow(4, (tier - 1))); + } + + public static short[] splitColortoArray(int rgb) { + return new short[]{(short) ((rgb >> 16) & 0xFF), (short) ((rgb >> 8) & 0xFF), (short) (rgb & 0xFF)}; + } + + public static int getColorFromArray(short[] color) { + return ((color[0] & 0x0ff) << 16) | ((color[1] & 0x0ff) << 8) | (color[2] & 0x0ff); + } + + public static int getColorFromArray(int[] color) { + return ((color[0] & 0x0ff) << 16) | ((color[1] & 0x0ff) << 8) | (color[2] & 0x0ff); + } + + public static boolean areStacksEqual(ItemStack aStack1, ItemStack aStack2) { + return (aStack1 == null && aStack2 == null) || GT_Utility.areStacksEqual(aStack1, aStack2); + } + + public static byte getByteFromRarity(EnumRarity rarity) { + if (rarity.equals(EnumRarity.uncommon)) + return 1; + else if (rarity.equals(EnumRarity.epic)) + return 2; + else if (rarity.equals(EnumRarity.rare)) + return 3; + return 0; + } + + public static EnumRarity getRarityFromByte(byte b) { + switch (b) { + case 1: + return EnumRarity.uncommon; + case 2: + return EnumRarity.rare; + case 3: + return EnumRarity.epic; + default: + return EnumRarity.common; + } + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java new file mode 100644 index 0000000000..f36a8d54ac --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util; + + +import com.github.bartimaeusnek.bartworks.MainMod; +import net.minecraft.item.EnumRarity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Objects; + +public class BioCulture extends BioData { + + public static final ArrayList BIO_CULTURE_ARRAY_LIST = new ArrayList(); + + Color color; + BioPlasmid plasmid; + BioDNA dDNA; + boolean bBreedable; + Fluid mFluid; + + protected BioCulture(Color color, String name, int ID, BioPlasmid plasmid, BioDNA dDNA, EnumRarity rarity, boolean bBreedable) { + super(name, ID, rarity); + this.color = color; + this.plasmid = plasmid; + this.dDNA = dDNA; + this.bBreedable = bBreedable; + } + + protected BioCulture(Color color, String name, int ID, BioPlasmid plasmid, BioDNA dDNA) { + super(name, ID, dDNA.getRarity()); + this.color = color; + this.plasmid = plasmid; + this.dDNA = dDNA; + } + + public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, EnumRarity rarity, boolean breedable) { + BioCulture ret = new BioCulture(color, name, BIO_CULTURE_ARRAY_LIST.size(), plasmid, dna, rarity, breedable); + BIO_CULTURE_ARRAY_LIST.add(ret); + return ret; + } + + public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, boolean breedable) { + BioCulture ret = new BioCulture(color, name, BIO_CULTURE_ARRAY_LIST.size(), plasmid, dna, dna.getRarity(), breedable); + BIO_CULTURE_ARRAY_LIST.add(ret); + return ret; + } + + public static NBTTagCompound getNBTTagFromCulture(BioCulture bioCulture) { + if (bioCulture == null) + return new NBTTagCompound(); + NBTTagCompound ret = new NBTTagCompound(); + ret.setString("Name", bioCulture.name); + ret.setInteger("ID", bioCulture.ID); + ret.setIntArray("Color", new int[]{bioCulture.color.getRed(), bioCulture.color.getGreen(), bioCulture.color.getBlue()}); + ret.setTag("Plasmid", BioData.getNBTTagFromBioData(BioData.convertBioPlasmidToBioData(bioCulture.plasmid))); + ret.setTag("DNA", BioData.getNBTTagFromBioData(BioData.convertBioDNAToBioData(bioCulture.dDNA))); + ret.setBoolean("Breedable", bioCulture.bBreedable); + ret.setByte("Rarety", BW_Util.getByteFromRarity(bioCulture.rarity)); + if (bioCulture.bBreedable) + ret.setString("Fluid", bioCulture.getFluid().getName()); + return ret; + } + + public static BioCulture getBioCultureFromNBTTag(NBTTagCompound tag) { + if (tag == null || tag.getIntArray("Color").length == 0) + return null; + BioCulture ret = new BioCulture( + new Color(tag.getIntArray("Color")[0], tag.getIntArray("Color")[1], tag.getIntArray("Color")[2]), + tag.getString("Name"), + tag.getInteger("ID"), + BioPlasmid.convertDataToPlasmid(getBioDataFromNBTTag(tag.getCompoundTag("Plasmid"))), + BioDNA.convertDataToDNA(getBioDataFromNBTTag(tag.getCompoundTag("DNA"))), + BW_Util.getRarityFromByte(tag.getByte("Rarety")), + tag.getBoolean("Breedable") + ); + if (ret.bBreedable) + ret.setFluid(FluidRegistry.getFluid(tag.getString("Fluid"))); + return ret; + } + + public static BioCulture getBioCulture(String Name) { + for (BioCulture b : BIO_CULTURE_ARRAY_LIST) + if (b.name.equals(Name)) + return b; + return null; + } + + public static BioCulture getBioCulture(BioDNA DNA) { + for (BioCulture b : BIO_CULTURE_ARRAY_LIST) + if (b.getdDNA().equals(DNA)) + return b; + return null; + } + + public Fluid getFluid() { + if (this.mFluid == null) + MainMod.logger.error("Fluid has not been set yet! The issuring Culture is: " + this.name); + return this.mFluid; + } + + public void setFluid(Fluid mFluid) { + this.mFluid = mFluid; + } + + public boolean isBreedable() { + return this.bBreedable; + } + + public void setbBreedable(boolean bBreedable) { + this.bBreedable = bBreedable; + } + + public int getColorRGB() { + return BW_Util.getColorFromArray(new int[]{this.color.getRed(), this.color.getGreen(), this.color.getBlue()}); + } + + public Color getColor() { + return this.color; + } + + public void setColor(Color color) { + this.color = color; + } + +// public static BioCulture createAndRegisterBioCulture(Color color, String name, long ID, BioPlasmid plasmid, BioDNA dDNA,EnumRarity rarity){ +// BioCulture ret =new BioCulture(color,name,ID,plasmid,dDNA,rarity); +// BIO_CULTURE_ARRAY_LIST.add(ret); +// return ret; +// } + + public BioPlasmid getPlasmid() { + return this.plasmid; + } + + public void setPlasmid(BioPlasmid plasmid) { + this.plasmid = plasmid; + } + + public BioDNA getdDNA() { + return this.dDNA; + } + + public void setdDNA(BioDNA dDNA) { + this.dDNA = dDNA; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + if (!super.equals(o)) return false; + BioCulture culture = (BioCulture) o; + return this.isBreedable() == culture.isBreedable() && + Objects.equals(this.getColor(), culture.getColor()) && + Objects.equals(this.getPlasmid(), culture.getPlasmid()) && + Objects.equals(this.getdDNA(), culture.getdDNA()) && + Objects.equals(this.mFluid, culture.mFluid); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), this.getColor(), this.getPlasmid(), this.getdDNA(), this.isBreedable(), this.mFluid); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java new file mode 100644 index 0000000000..65a7de4ab0 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util; + +import net.minecraft.item.EnumRarity; + +public class BioDNA extends BioData { + + protected BioDNA(String name, int ID, EnumRarity rarity) { + super(name, ID, rarity); + } + + protected BioDNA(BioData bioData) { + super(bioData); + this.name = bioData.name; + this.ID = bioData.ID; + this.rarity = bioData.rarity; + } + + public static BioDNA convertDataToDNA(BioData bioData) { + return new BioDNA(bioData); + } + + public static BioDNA createAndRegisterBioDNA(String aName, EnumRarity rarity) { + BioData ret = BioData.createAndRegisterBioData(aName, rarity); + return new BioDNA(ret); + } + + public static BioDNA createAndRegisterBioDNA(String aName, EnumRarity rarity, int chance, int tier) { + BioData ret = BioData.createAndRegisterBioData(aName, rarity, chance, tier); + return new BioDNA(ret); + } + + @Override + public String toString() { + return "BioDNA{" + + "name='" + name + '\'' + + ", ID=" + ID + + '}'; + } + + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java new file mode 100644 index 0000000000..ac9c7d2083 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util; + +import net.minecraft.item.EnumRarity; +import net.minecraft.nbt.NBTTagCompound; + +import java.util.ArrayList; +import java.util.Objects; + +public class BioData { + public static final ArrayList BIO_DATA_ARRAY_LIST = new ArrayList(); + protected String name; + protected int ID; + protected EnumRarity rarity; + protected int chance; + protected int tier; + + protected BioData(String name, int ID, EnumRarity rarity, int chance, int tier) { + this.name = name; + this.ID = ID; + this.rarity = rarity; + this.chance = chance; + this.tier = tier; + } + + protected BioData(String name, int ID, EnumRarity rarity) { + this.name = name; + this.ID = ID; + this.rarity = rarity; + this.chance = 7500; + this.tier = 0; + } + + protected BioData(BioData bioData) { + this.rarity = bioData.rarity; + this.name = bioData.name; + this.ID = bioData.ID; + this.chance = bioData.chance; + } + + public static BioData convertBioPlasmidToBioData(BioPlasmid bioPlasmid) { + return new BioData(bioPlasmid.name, bioPlasmid.ID, bioPlasmid.rarity, bioPlasmid.chance, bioPlasmid.tier); + } + + public static BioData convertBioDNAToBioData(BioDNA bioDNA) { + return new BioData(bioDNA.name, bioDNA.ID, bioDNA.rarity, bioDNA.chance, bioDNA.tier); + } + + public static BioData createAndRegisterBioData(String aName, EnumRarity rarity, int chance, int tier) { + BioData ret = new BioData(aName, BIO_DATA_ARRAY_LIST.size(), rarity, chance, tier); + BIO_DATA_ARRAY_LIST.add(ret); + return ret; + } + + public static BioData createAndRegisterBioData(String aName, EnumRarity rarity) { + BioData ret = new BioData(aName, BIO_DATA_ARRAY_LIST.size(), rarity); + BIO_DATA_ARRAY_LIST.add(ret); + return ret; + } + + public static NBTTagCompound getNBTTagFromBioData(BioData bioData) { + NBTTagCompound ret = new NBTTagCompound(); + ret.setByte("Rarity", BW_Util.getByteFromRarity(bioData.rarity)); + ret.setString("Name", bioData.name); + ret.setInteger("ID", bioData.ID); + ret.setInteger("Chance", bioData.chance); + ret.setInteger("Tier", bioData.tier); + return ret; + } + + public static BioData getBioDataFromNBTTag(NBTTagCompound tag) { + if (tag == null) + return null; + return getBioDataFromName(tag.getString("Name")); + } + + public static BioData getBioDataFromName(String Name) { + for (BioData bd : BIO_DATA_ARRAY_LIST) + if (bd.name.equals(Name)) + return bd; + return null; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + BioData bioData = (BioData) o; + return this.getID() == bioData.getID() && + this.getChance() == bioData.getChance() && + this.getTier() == bioData.getTier() && + Objects.equals(this.getName(), bioData.getName()) && + this.getRarity() == bioData.getRarity(); + } + + @Override + public int hashCode() { + return Objects.hash(this.getName(), this.getID(), this.getRarity(), this.getChance(), this.getTier()); + } + + public int getTier() { + return this.tier; + } + + public void setTier(int tier) { + this.tier = tier; + } + + @Override + public String toString() { + return "BioData{" + + "name='" + name + '\'' + + ", ID=" + ID + + '}'; + } + + public EnumRarity getRarity() { + return this.rarity; + } + + public void setRarity(EnumRarity rarity) { + this.rarity = rarity; + } + + public int getChance() { + return this.chance; + } + + public void setChance(int chance) { + this.chance = chance; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * DO NOT USE GET ID TO GET THE OBJECT! THIS SHOULD ONLY BE USED FOR COMPARISON! + * + * @return the position in the loading list + */ + public int getID() { + return this.ID; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java new file mode 100644 index 0000000000..7b034f8c43 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util; + +import net.minecraft.item.EnumRarity; + +public class BioPlasmid extends BioData { + private BioPlasmid(String name, int ID, EnumRarity rarity) { + super(name, ID, rarity); + } + + protected BioPlasmid(BioData bioData) { + super(bioData); + this.name = bioData.name; + this.ID = bioData.ID; + this.rarity = bioData.rarity; + } + + public static BioPlasmid convertDataToPlasmid(BioData bioData) { + return new BioPlasmid(bioData); + } + + public static BioPlasmid createAndRegisterBioPlasmid(String aName, EnumRarity rarity) { + BioData ret = BioData.createAndRegisterBioData(aName, rarity); + return new BioPlasmid(ret); + } + + public static BioPlasmid createAndRegisterBioPlasmid(String aName, EnumRarity rarity, int chance, int tier) { + BioData ret = BioData.createAndRegisterBioData(aName, rarity, chance, tier); + return new BioPlasmid(ret); + } + + @Override + public String toString() { + return "BioPlasmid{" + + "name='" + name + '\'' + + ", ID=" + ID + + '}'; + } + + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java index 456a98cf76..b78e39afe1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.util; public class ChatColorHelper { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java index 71a158463c..388d888cf4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.util; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -6,166 +28,143 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import java.util.HashSet; -import java.util.Objects; public class ConnectedBlocksChecker { public final HashSet hashset = new HashSet(); - public int get_connected(World w, int x, int y, int z, Block b){ + public int get_connected(World w, int x, int y, int z, Block b) { int ret = 0; + int wID = w.provider.dimensionId; + byte sides = check_sourroundings(w, x, y, z, b); - if (((sides | 0b111110) == 0b111111) && !hashset.contains(new Coords(x,y+1,z))) { + if (((sides | 0b111110) == 0b111111) && !hashset.contains(new Coords(x, y + 1, z, wID))) { ret++; - ret += get_connected(w, x, y + 1, z,b); + ret += get_connected(w, x, y + 1, z, b); } - if (( (sides | 0b111101) == 0b111111) && !hashset.contains(new Coords(x,y-1,z))) { + if (((sides | 0b111101) == 0b111111) && !hashset.contains(new Coords(x, y - 1, z, wID))) { ret++; - ret += get_connected(w, x, y - 1, z,b); + ret += get_connected(w, x, y - 1, z, b); } - if (( (sides | 0b111011) == 0b111111) && !hashset.contains(new Coords(x+1,y,z))) { + if (((sides | 0b111011) == 0b111111) && !hashset.contains(new Coords(x + 1, y, z, wID))) { ret++; - ret += get_connected(w, x+1, y, z,b); + ret += get_connected(w, x + 1, y, z, b); } - if (( (sides | 0b110111) == 0b111111) && !hashset.contains(new Coords(x-1,y,z))) { + if (((sides | 0b110111) == 0b111111) && !hashset.contains(new Coords(x - 1, y, z, wID))) { ret++; - ret += get_connected(w, x-1, y, z,b); + ret += get_connected(w, x - 1, y, z, b); } - if (( (sides | 0b101111) == 0b111111) && !hashset.contains(new Coords(x,y,z+1))) { + if (((sides | 0b101111) == 0b111111) && !hashset.contains(new Coords(x, y, z + 1, wID))) { ret++; - ret += get_connected(w, x, y, z+1,b); + ret += get_connected(w, x, y, z + 1, b); } - if (( (sides | 0b011111) == 0b111111) && !hashset.contains(new Coords(x,y,z-1))) { + if (((sides | 0b011111) == 0b111111) && !hashset.contains(new Coords(x, y, z - 1, wID))) { ret++; - ret += get_connected(w, x, y, z-1,b); + ret += get_connected(w, x, y, z - 1, b); } return ret; } - public byte check_sourroundings(World w, int x, int y, int z,Block b){ + public byte check_sourroundings(World w, int x, int y, int z, Block b) { byte ret = 0; + int wID = w.provider.dimensionId; - if (hashset.contains(new Coords(x,y,z))) + if (hashset.contains(new Coords(x, y, z, wID))) return ret; - hashset.add(new Coords(x,y,z)); + hashset.add(new Coords(x, y, z, wID)); - if (w.getBlock(x,y+1,z).equals(b)) + if (w.getBlock(x, y + 1, z).equals(b)) ret = (byte) (ret | 0b000001); - if (w.getBlock(x,y-1,z).equals(b)) + if (w.getBlock(x, y - 1, z).equals(b)) ret = (byte) (ret | 0b000010); - if (w.getBlock(x+1,y,z).equals(b)) + if (w.getBlock(x + 1, y, z).equals(b)) ret = (byte) (ret | 0b000100); - if (w.getBlock(x-1,y,z).equals(b)) + if (w.getBlock(x - 1, y, z).equals(b)) ret = (byte) (ret | 0b001000); - if (w.getBlock(x,y,z+1).equals(b)) + if (w.getBlock(x, y, z + 1).equals(b)) ret = (byte) (ret | 0b010000); - if (w.getBlock(x,y,z-1).equals(b)) + if (w.getBlock(x, y, z - 1).equals(b)) ret = (byte) (ret | 0b100000); return ret; } - public boolean get_meta_of_sideblocks(World w, int n, int[] xyz, boolean GT){ + public boolean get_meta_of_sideblocks(World w, int n, int[] xyz, boolean GT) { - Coords Controller = new Coords(xyz[0],xyz[1],xyz[2]); + int wID = w.provider.dimensionId; + Coords Controller = new Coords(xyz[0], xyz[1], xyz[2], wID); - for (Coords C : hashset){ + for (Coords C : hashset) { if (GT) { TileEntity t; t = w.getTileEntity(C.x, C.y + 1, C.z); - if (t != null && !new Coords(C.x, C.y + 1, C.z).equals(Controller)) { + if (t != null && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x, C.y - 1, C.z); - if (t != null && !new Coords(C.x, C.y - 1, C.z).equals(Controller)) { + if (t != null && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x + 1, C.y, C.z); - if (t != null && !new Coords(C.x + 1, C.y, C.z).equals(Controller)) { + if (t != null && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x - 1, C.y, C.z); - if (t != null && !new Coords(C.x - 1, C.y, C.z).equals(Controller)) { + if (t != null && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x, C.y, C.z + 1); - if (t != null && !new Coords(C.x, C.y, C.z + 1).equals(Controller)) { + if (t != null && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x, C.y, C.z - 1); - if (t != null && !new Coords(C.x, C.y, C.z - 1).equals(Controller)) { + if (t != null && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } - }else { - if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) && !new Coords(C.x, C.y + 1, C.z).equals(Controller)) + } else { + if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) return true; - if (n == w.getBlockMetadata(C.x, C.y - 1, C.z) && !new Coords(C.x, C.y - 1, C.z).equals(Controller)) + if (n == w.getBlockMetadata(C.x, C.y - 1, C.z) && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) return true; - if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) && !new Coords(C.x + 1, C.y, C.z).equals(Controller)) + if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) return true; - if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) && !new Coords(C.x - 1, C.y, C.z).equals(Controller)) + if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) return true; - if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) && !new Coords(C.x, C.y, C.z + 1).equals(Controller)) + if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) return true; - if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) && !new Coords(C.x, C.y, C.z - 1).equals(Controller)) + if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) return true; } } return false; } - - class Coords { - - public int x,y,z; - - public Coords(int x, int y, int z){ - this.x=x; - this.y=y; - this.z=z; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Coords coords = (Coords) o; - return x == coords.x && - y == coords.y && - z == coords.z; - } - - @Override - public int hashCode() { - return Objects.hash(x, y, z); - } - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java new file mode 100644 index 0000000000..7d9f60015b --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util; + +import java.util.Objects; + +public class Coords { + + public int x, y, z, wID; + + public Coords(int x, int y, int z, int wID) { + this(x, y, z); + this.wID = wID; + } + + public Coords(int x, int y, int z) { + this.x = x; + this.y = y; + this.z = z; + this.wID = 0; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + Coords coords = (Coords) o; + return this.x == coords.x && + this.y == coords.y && + this.z == coords.z && + this.wID == coords.wID; + } + + @Override + public int hashCode() { + return Objects.hash(this.x, this.y, this.z, this.wID); + } + + @Override + public String toString() { + return x + "," + y + "," + z + "," + wID; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java index 2b634986d2..e1e1df39c2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java @@ -1,8 +1,31 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.util; import codechicken.nei.api.API; import codechicken.nei.api.IConfigureNEI; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import cpw.mods.fml.common.Optional; import net.minecraft.item.ItemStack; @@ -10,21 +33,22 @@ import net.minecraft.item.ItemStack; @Optional.Interface(iface = "codechicken.nei.api.API", modid = "NotEnoughItems") public class NEIbartworksConfig implements IConfigureNEI { - @Optional.Method(modid="NotEnoughItems") + @Optional.Method(modid = "NotEnoughItems") @Override public String getName() { return MainMod.name; } - @Optional.Method(modid="NotEnoughItems") + @Optional.Method(modid = "NotEnoughItems") @Override public String getVersion() { return MainMod.version; } - @Optional.Method(modid="NotEnoughItems") + @Optional.Method(modid = "NotEnoughItems") @Override public void loadConfig() { API.hideItem(new ItemStack(ItemRegistry.tab)); + API.hideItem(new ItemStack(FluidLoader.bioFluidBlock)); } } \ No newline at end of file diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 400cf182fc..cdcef27970 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -1,3 +1,4 @@ +itemGroup.GT2C=Gregtech 2 Compat item.GT_Rockcutter_Item_LV.name=Rockcutter LV item.GT_Rockcutter_Item_MV.name=Rockcutter MV item.GT_Rockcutter_Item_HV.name=Rockcutter HV @@ -5,7 +6,7 @@ item.GT_Teslastaff_Item.name=Teslastaff BW_ItemBlocks.0.name=Etched Lapis Cell BW_ItemBlocks.1.name=Plated Lapis Cell GT_LESU_CASING.0.name=LESU Casing -itemGroup.GT2C=Gregtech 2 Compat + itemGroup.bartworks=BartWorks Inter Temporal BW_Machinery_Casings.0.name=Nickel-Zinc Ferrite Block BW_Machinery_Casings.1.name=Transformer-Winding Block @@ -20,4 +21,26 @@ item.completed_grindstone.name=Grindstone item.rotors.leatherParts.name=Leather Covered Wood Frame item.rotors.woolParts.name=Wool Covered Wood Frame item.rotors.paperParts.name=Paper Covered Wood Frame -item.rotors.combinedParts.name=Multiple Material Covered Wood Frame \ No newline at end of file +item.rotors.combinedParts.name=Multiple Material Covered Wood Frame + +itemGroup.BioTab=BartWorks BioEngineering +filled.item.petriDish.name=Petri Dish with a Culture +item.petriDish.name=Sterilized Petri Dish +item.DNASampleFlask.name=DNA Sample Flask +item.PlasmidCell.name=Plasmid Sample Flask +item.DetergentPowder.name=Detergent Powder +item.Agarose.name=Agarose +item.IncubationModule.name=Incubation Module +item.Cells.name=Bacterial Cells +item.PlasmaMembrane.name=Plasma Membrane +labModule.item.DNAExtractionModule.name=DNA Extraction Module +labModule.item.PCRThermoclyclingModule.name=PCR Thermoclycle Module +labModule.item.PlasmidSynthesisModule.name=Plasmid Synthesis Module +labModule.item.TransformationModule.name=Transformation Module +labModule.item.ClonalCellularSynthesisModule.name=Clonal Cellular Synthesis Module +BW_GlasBlocks.0.name=Borosilicate Glass Blocks +BW_GlasBlocks.1.name=Nickel Reinforced Boroilicate GlassBlock +BW_GlasBlocks.2.name=Tungsten Reinforced Boroilicate GlassBlock +BW_GlasBlocks.3.name=Chrome Reinforced Boroilicate GlassBlock +BW_GlasBlocks.4.name=Iridium Reinforced Boroilicate GlassBlock +BW_GlasBlocks.5.name=Osmium Reinforced Boroilicate GlassBlock \ No newline at end of file diff --git a/src/main/resources/assets/bartworks/textures/GUI/GUI_RSC.png b/src/main/resources/assets/bartworks/textures/GUI/GUI_RSC.png new file mode 100644 index 0000000000..065a6fa929 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/GUI_RSC.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/RadHatch.png b/src/main/resources/assets/bartworks/textures/GUI/RadHatch.png new file mode 100644 index 0000000000..1950ff0985 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/RadHatch.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock.png new file mode 100644 index 0000000000..4ea5e5973f Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRand.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRand.png new file mode 100644 index 0000000000..0e27ddbb62 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRand.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/ChromeReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/ChromeReinforcedBoronSilicateGlassBlock.png new file mode 100644 index 0000000000..213f8feafd Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/ChromeReinforcedBoronSilicateGlassBlock.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/IridiumReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/IridiumReinforcedBoronSilicateGlassBlock.png new file mode 100644 index 0000000000..9a87942ef9 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/IridiumReinforcedBoronSilicateGlassBlock.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/NickelReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/NickelReinforcedBoronSilicateGlassBlock.png new file mode 100644 index 0000000000..9ab096b467 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/NickelReinforcedBoronSilicateGlassBlock.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/OsmiumReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/OsmiumReinforcedBoronSilicateGlassBlock.png new file mode 100644 index 0000000000..e5be40d5ff Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/OsmiumReinforcedBoronSilicateGlassBlock.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/TungstenReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/TungstenReinforcedBoronSilicateGlassBlock.png new file mode 100644 index 0000000000..b3823b02fc Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/TungstenReinforcedBoronSilicateGlassBlock.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/brick.png b/src/main/resources/assets/bartworks/textures/blocks/brick.png deleted file mode 100644 index fd6959c2f5..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/brick.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/items/Agarose.png b/src/main/resources/assets/bartworks/textures/items/Agarose.png new file mode 100644 index 0000000000..fe6add0bb0 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/Agarose.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/ClonalCellularSynthesisModule.png b/src/main/resources/assets/bartworks/textures/items/ClonalCellularSynthesisModule.png new file mode 100644 index 0000000000..a420873554 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/ClonalCellularSynthesisModule.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/DNAExtractionModule.png b/src/main/resources/assets/bartworks/textures/items/DNAExtractionModule.png new file mode 100644 index 0000000000..99dc1c9b95 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/DNAExtractionModule.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/DNASampleFlask.png b/src/main/resources/assets/bartworks/textures/items/DNASampleFlask.png new file mode 100644 index 0000000000..69c6c649b9 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/DNASampleFlask.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/DetergentPowder.png b/src/main/resources/assets/bartworks/textures/items/DetergentPowder.png new file mode 100644 index 0000000000..92fe5e9d81 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/DetergentPowder.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/IncubationModule.png b/src/main/resources/assets/bartworks/textures/items/IncubationModule.png new file mode 100644 index 0000000000..e0ea17749d Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/IncubationModule.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/PCRThermoclyclingModule.png b/src/main/resources/assets/bartworks/textures/items/PCRThermoclyclingModule.png new file mode 100644 index 0000000000..c0e5b9a822 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/PCRThermoclyclingModule.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/PlasmaMembrane.png b/src/main/resources/assets/bartworks/textures/items/PlasmaMembrane.png new file mode 100644 index 0000000000..f51730a7af Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/PlasmaMembrane.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/PlasmidCell.png b/src/main/resources/assets/bartworks/textures/items/PlasmidCell.png new file mode 100644 index 0000000000..680963b8ab Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/PlasmidCell.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/PlasmidSynthesisModule.png b/src/main/resources/assets/bartworks/textures/items/PlasmidSynthesisModule.png new file mode 100644 index 0000000000..9c20f554e7 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/PlasmidSynthesisModule.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/TransformationModule.png b/src/main/resources/assets/bartworks/textures/items/TransformationModule.png new file mode 100644 index 0000000000..36b8a44f4d Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/TransformationModule.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/petriDish.png b/src/main/resources/assets/bartworks/textures/items/petriDish.png new file mode 100644 index 0000000000..4b151f9be8 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/petriDish.png differ diff --git a/src/main/resources/assets/gregtech/textures/GUI/basicmachines/BW.GUI.BioLab.png b/src/main/resources/assets/gregtech/textures/GUI/basicmachines/BW.GUI.BioLab.png new file mode 100644 index 0000000000..fb9c0e113c Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/GUI/basicmachines/BW.GUI.BioLab.png differ -- cgit From 460374856a590c21771884cc1df2706e30206bc8 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 11 Jan 2019 05:43:04 +0100 Subject: fixes https://github.com/bartimaeusnek/bartworks/issues/1 - added Oredict for Grindstones - adjusted tooltip for wind regions Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> --- .../bartworks/common/loaders/RecipeLoader.java | 82 ++++++++++++++++------ .../tileentities/GT_TileEntity_Windmill.java | 1 + 2 files changed, 62 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 43619f7d7c..605a8c8d0a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -378,27 +378,67 @@ public class RecipeLoader implements Runnable { 'G', new ItemStack(ItemRegistry.craftingParts, 1, 2), } ); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts, 1, 0), - RecipeLoader.BITSD, - new Object[]{ - "SSS", - "DfD", - " h ", - 'S', new ItemStack(Blocks.stone), - 'D', new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), - } - ); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts, 1, 1), - RecipeLoader.BITSD, - new Object[]{ - "hDf", - "SSS", - 'S', new ItemStack(Blocks.stone), - 'D', new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), - } - ); + + String[] stones = {"stone","stoneSmooth"}; + String[] granites = {"blockGranite","stoneGranite","Granite","granite"}; + for (String granite : granites) { + for (String stone : stones) { + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.craftingParts, 1, 0), + RecipeLoader.BITSD, + new Object[]{ + "SSS", + "DfD", + " h ", + 'S', stone, + 'D', new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), + } + ); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.craftingParts, 1, 1), + RecipeLoader.BITSD, + new Object[]{ + "hDf", + "SSS", + 'S', stone, + 'D', new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), + } + ); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.craftingParts, 1, 0), + RecipeLoader.BITSD, + new Object[]{ + "SSS", + "DfD", + " h ", + 'S', stone, + 'D', granite, + } + ); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.craftingParts, 1, 1), + RecipeLoader.BITSD, + new Object[]{ + "hDf", + "SSS", + 'S', stone, + 'D', granite, + } + ); + } + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.craftingParts, 1, 2), + RecipeLoader.BITSD, + new Object[]{ + "STS", + "h f", + "SBS", + 'S', granite, + 'T', new ItemStack(ItemRegistry.craftingParts, 1, 0), + 'B', new ItemStack(ItemRegistry.craftingParts, 1, 1), + } + ); + } GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 2), RecipeLoader.BITSD, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java index 79751aad87..31018d73f7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java @@ -553,6 +553,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { "Needs a Wind Mill Rotor in the Shaftbox to operate", "Input items in Controller", "Output items will appear in the dispensers", + "It is faster in regions with more wind (like IC2 Windmills)", "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" }; } -- cgit From 299823db1caa4c3343b3f601f9a63bbd3baee060 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 12 Jan 2019 01:20:09 +0100 Subject: +fixed CircuitProgrammer Deleting Chips +added autoconversion for basic circuits +circuit programmer now drops unsupported items instead of deleting them Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> --- .../bartworks/common/loaders/RecipeLoader.java | 4 ++-- .../container/GT_Container_CircuitProgrammer.java | 27 ++++++++++++++++++---- .../bartimaeusnek/bartworks/util/BW_Util.java | 5 ++++ 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 605a8c8d0a..271f59c4c6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -379,8 +379,8 @@ public class RecipeLoader implements Runnable { } ); - String[] stones = {"stone","stoneSmooth"}; - String[] granites = {"blockGranite","stoneGranite","Granite","granite"}; + String[] stones = {"stone", "stoneSmooth"}; + String[] granites = {"blockGranite", "stoneGranite", "Granite", "granite"}; for (String granite : granites) { for (String stone : stones) { GT_ModHandler.addCraftingRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java index cd56a04a6b..9f0254bd62 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -22,7 +22,11 @@ package com.github.bartimaeusnek.bartworks.server.container; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -31,6 +35,7 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.ForgeHooks; public class GT_Container_CircuitProgrammer extends Container { @@ -102,12 +107,13 @@ public class GT_Container_CircuitProgrammer extends Container { ItemStack toBind; EntityPlayer Player; ItemStack Slot; + NBTTagCompound tag; public pinv(EntityPlayer Player) { super(); this.Player = Player; this.toBind = Player.inventory.getCurrentItem(); - NBTTagCompound tag = this.toBind.getTagCompound(); + tag = this.toBind.getTagCompound(); if (tag.getBoolean("HasChip")) Slot = GT_Utility.getIntegratedCircuit(tag.getByte("ChipConfig")); } @@ -126,7 +132,7 @@ public class GT_Container_CircuitProgrammer extends Container { public ItemStack decrStackSize(int slotNR, int count) { ItemStack ret = Slot.copy(); Slot = null; - NBTTagCompound tag = toBind.getTagCompound(); + tag = toBind.getTagCompound(); tag.setBoolean("HasChip", false); toBind.setTagCompound(tag); Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); @@ -140,14 +146,27 @@ public class GT_Container_CircuitProgrammer extends Container { @Override public void setInventorySlotContents(int slotNR, ItemStack itemStack) { - if (itemStack != null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) { + if (itemStack != null && itemStack.getItem() != null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) { Slot = itemStack.copy().splitStack(1); itemStack.stackSize--; - NBTTagCompound tag = toBind.getTagCompound(); + tag = toBind.getTagCompound(); tag.setBoolean("HasChip", true); tag.setByte("ChipConfig", (byte) itemStack.getItemDamage()); toBind.setTagCompound(tag); Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); + } else if (BW_Util.checkStackAndPrefix(itemStack) && GT_OreDictUnificator.getAssociation(itemStack).mPrefix.equals(OrePrefixes.circuit) && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.equals(Materials.Basic)) { + Slot = GT_Utility.getIntegratedCircuit(0); + itemStack.stackSize--; + tag = toBind.getTagCompound(); + tag.setBoolean("HasChip", true); + tag.setByte("ChipConfig", (byte) itemStack.getItemDamage()); + toBind.setTagCompound(tag); + Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); + } else { + ForgeHooks.onPlayerTossEvent(Player, itemStack, false); + tag = toBind.getTagCompound(); + tag.setBoolean("HasChip", false); + toBind.setTagCompound(tag); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 19b5897fcf..ba5265904f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import gregtech.api.enums.Materials; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.item.EnumRarity; @@ -76,6 +77,10 @@ public class BW_Util { return (int) (materials.getProtons() == 43L ? (materials.equals(Materials.NaquadahEnriched) ? 140 : materials.equals(Materials.Naquadria) ? 150 : materials.equals(Materials.Naquadah) ? 130 : 43) : materials.getProtons()); } + public static boolean checkStackAndPrefix(ItemStack itemStack) { + return itemStack != null && GT_OreDictUnificator.getAssociation(itemStack) != null && GT_OreDictUnificator.getAssociation(itemStack).mPrefix != null && GT_OreDictUnificator.getAssociation(itemStack).mMaterial != null && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial != null; + } + public static int getMachineVoltageFromTier(int tier) { return (int) (30 * Math.pow(4, (tier - 1))); } -- cgit From 52a935e46e0e9f9a5249efdeff8ee6514d5c144e Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 12 Jan 2019 07:33:38 +0100 Subject: version splittage +the mod version now consists of 3 subversions +fixed another NPE Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> --- build.gradle | 2 +- build.properties | 4 +++- .../bartworks/server/container/GT_Container_CircuitProgrammer.java | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 0c65172e39..e9ae2df168 100644 --- a/build.gradle +++ b/build.gradle @@ -36,7 +36,7 @@ configFile.withReader { } -version = config.mod_version +version = config.majorUpdate+"."+config.minorUpdate+"."+config.buildNumber group= "com.github.bartimaeusnek.bartworks" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "bartworks"+ "[" + config.mc_version + "]" diff --git a/build.properties b/build.properties index 6427c44557..5a578408d1 100644 --- a/build.properties +++ b/build.properties @@ -21,7 +21,9 @@ # mc_version=1.7.10 -mod_version=0.3.11 +majorUpdate=0 +minorUpdate=3 +buildNumber=12 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java index 9f0254bd62..f52d3e8b63 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -83,7 +83,7 @@ public class GT_Container_CircuitProgrammer extends Container { Slot chipslot = (Slot) this.inventorySlots.get(0); if (SlotNR > 24) { Slot slot = (Slot) this.inventorySlots.get(SlotNR); - if (slot != null && slot.getStack().getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) { + if (slot != null && slot.getStack() != null && slot.getStack().getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) { if (chipslot.getStack() == null) { chipslot.putStack(slot.getStack()); slot.decrStackSize(1); -- cgit From 7bd4d6d96453229b436cbdfb78b877563a1e12df Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 12 Jan 2019 21:09:19 +0100 Subject: Reworked Coords class +use the MurmurHash3 and optimised equals to run in a Hashset +added credits +added URL Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> --- .../bartimaeusnek/bartworks/util/Coords.java | 28 +- .../bartimaeusnek/bartworks/util/MurmurHash3.java | 303 +++++++++++++++++++++ src/main/resources/mcmod.info | 4 +- 3 files changed, 328 insertions(+), 7 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java index 7d9f60015b..756f6ed7dc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java @@ -26,7 +26,8 @@ import java.util.Objects; public class Coords { - public int x, y, z, wID; + public int x, z, wID; + public short y; public Coords(int x, int y, int z, int wID) { this(x, y, z); @@ -35,15 +36,17 @@ public class Coords { public Coords(int x, int y, int z) { this.x = x; - this.y = y; + this.y = (short) y; this.z = z; this.wID = 0; } @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || this.getClass() != o.getClass()) return false; +// if (this == o) +// return true; +// if (o == null || this.getClass() != o.getClass()) +// return false; Coords coords = (Coords) o; return this.x == coords.x && this.y == coords.y && @@ -53,7 +56,22 @@ public class Coords { @Override public int hashCode() { - return Objects.hash(this.x, this.y, this.z, this.wID); + byte[] data = new byte[14]; + data[0]= (byte) (this.x & 0b1111); + data[1]= (byte) (this.x >> 4 & 0b1111); + data[2]= (byte) (this.x >> 8 & 0b1111); + data[3]= (byte) (this.x >> 12 & 0b1111); + data[4]= (byte) (this.y & 0b1111); + data[5]= (byte) (this.y >> 4 & 0b1111); + data[6]= (byte) (this.z & 0b1111); + data[7]= (byte) (this.z >> 4 & 0b1111); + data[8]= (byte) (this.z >> 8 & 0b1111); + data[9]= (byte) (this.z >> 12 & 0b1111); + data[10]= (byte) (this.wID & 0b1111); + data[11]= (byte) (this.wID >> 4 & 0b1111); + data[12]= (byte) (this.wID >> 8 & 0b1111); + data[13]= (byte) (this.wID >> 12 & 0b1111); + return MurmurHash3.murmurhash3_x86_32(data,0,14,31); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java new file mode 100644 index 0000000000..d0433145c7 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java @@ -0,0 +1,303 @@ +/* + * The MurmurHash3 algorithm was created by Austin Appleby and placed in the public domain. + * This java port was authored by Yonik Seeley and also placed into the public domain. + * The author hereby disclaims copyright to this source code. + *

+ * This produces exactly the same hash values as the final C++ + * version of MurmurHash3 and is thus suitable for producing the same hash values across + * platforms. + *

+ * The 32 bit x86 version of this hash should be the fastest variant for relatively short keys like ids. + * murmurhash3_x64_128 is a good choice for longer strings or if you need more than 32 bits of hash. + *

+ * Note - The x86 and x64 versions do _not_ produce the same results, as the + * algorithms are optimized for their respective platforms. + *

+ * See http://github.com/yonik/java_util for future updates to this file. + * + * + * Special Thanks to Austin Appleby and Yonik Seeley for placing this in the public domain and therefore allowing me to use it! + */ +package com.github.bartimaeusnek.bartworks.util; + + +public final class MurmurHash3 { + + /** 128 bits of state */ + public static final class LongPair { + public long val1; + public long val2; + } + + public static final int fmix32(int h) { + h ^= h >>> 16; + h *= 0x85ebca6b; + h ^= h >>> 13; + h *= 0xc2b2ae35; + h ^= h >>> 16; + return h; + } + + public static final long fmix64(long k) { + k ^= k >>> 33; + k *= 0xff51afd7ed558ccdL; + k ^= k >>> 33; + k *= 0xc4ceb9fe1a85ec53L; + k ^= k >>> 33; + return k; + } + + /** Gets a long from a byte buffer in little endian byte order. */ + public static final long getLongLittleEndian(byte[] buf, int offset) { + return ((long)buf[offset+7] << 56) // no mask needed + | ((buf[offset+6] & 0xffL) << 48) + | ((buf[offset+5] & 0xffL) << 40) + | ((buf[offset+4] & 0xffL) << 32) + | ((buf[offset+3] & 0xffL) << 24) + | ((buf[offset+2] & 0xffL) << 16) + | ((buf[offset+1] & 0xffL) << 8) + | ((buf[offset ] & 0xffL)); // no shift needed + } + + + /** Returns the MurmurHash3_x86_32 hash. */ + public static int murmurhash3_x86_32(byte[] data, int offset, int len, int seed) { + + final int c1 = 0xcc9e2d51; + final int c2 = 0x1b873593; + + int h1 = seed; + int roundedEnd = offset + (len & 0xfffffffc); // round down to 4 byte block + + for (int i=offset; i>> 17); // ROTL32(k1,15); + k1 *= c2; + + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); + h1 = h1*5+0xe6546b64; + } + + // tail + int k1 = 0; + + switch(len & 0x03) { + case 3: + k1 = (data[roundedEnd + 2] & 0xff) << 16; + // fallthrough + case 2: + k1 |= (data[roundedEnd + 1] & 0xff) << 8; + // fallthrough + case 1: + k1 |= (data[roundedEnd] & 0xff); + k1 *= c1; + k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 *= c2; + h1 ^= k1; + } + + // finalization + h1 ^= len; + + // fmix(h1); + h1 ^= h1 >>> 16; + h1 *= 0x85ebca6b; + h1 ^= h1 >>> 13; + h1 *= 0xc2b2ae35; + h1 ^= h1 >>> 16; + + return h1; + } + + + /** Returns the MurmurHash3_x86_32 hash of the UTF-8 bytes of the String without actually encoding + * the string to a temporary buffer. This is more than 2x faster than hashing the result + * of String.getBytes(). + */ + public static int murmurhash3_x86_32(CharSequence data, int offset, int len, int seed) { + + final int c1 = 0xcc9e2d51; + final int c2 = 0x1b873593; + + int h1 = seed; + + int pos = offset; + int end = offset + len; + int k1 = 0; + int k2 = 0; + int shift = 0; + int bits = 0; + int nBytes = 0; // length in UTF8 bytes + + + while (pos < end) { + int code = data.charAt(pos++); + if (code < 0x80) { + k2 = code; + bits = 8; + + /*** + // optimized ascii implementation (currently slower!!! code size?) + if (shift == 24) { + k1 = k1 | (code << 24); + + k1 *= c1; + k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 *= c2; + + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); + h1 = h1*5+0xe6546b64; + + shift = 0; + nBytes += 4; + k1 = 0; + } else { + k1 |= code << shift; + shift += 8; + } + continue; + ***/ + + } + else if (code < 0x800) { + k2 = (0xC0 | (code >> 6)) + | ((0x80 | (code & 0x3F)) << 8); + bits = 16; + } + else if (code < 0xD800 || code > 0xDFFF || pos>=end) { + // we check for pos>=end to encode an unpaired surrogate as 3 bytes. + k2 = (0xE0 | (code >> 12)) + | ((0x80 | ((code >> 6) & 0x3F)) << 8) + | ((0x80 | (code & 0x3F)) << 16); + bits = 24; + } else { + // surrogate pair + // int utf32 = pos < end ? (int) data.charAt(pos++) : 0; + int utf32 = (int) data.charAt(pos++); + utf32 = ((code - 0xD7C0) << 10) + (utf32 & 0x3FF); + k2 = (0xff & (0xF0 | (utf32 >> 18))) + | ((0x80 | ((utf32 >> 12) & 0x3F))) << 8 + | ((0x80 | ((utf32 >> 6) & 0x3F))) << 16 + | (0x80 | (utf32 & 0x3F)) << 24; + bits = 32; + } + + + k1 |= k2 << shift; + + // int used_bits = 32 - shift; // how many bits of k2 were used in k1. + // int unused_bits = bits - used_bits; // (bits-(32-shift)) == bits+shift-32 == bits-newshift + + shift += bits; + if (shift >= 32) { + // mix after we have a complete word + + k1 *= c1; + k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 *= c2; + + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); + h1 = h1*5+0xe6546b64; + + shift -= 32; + // unfortunately, java won't let you shift 32 bits off, so we need to check for 0 + if (shift != 0) { + k1 = k2 >>> (bits-shift); // bits used == bits - newshift + } else { + k1 = 0; + } + nBytes += 4; + } + + } // inner + + // handle tail + if (shift > 0) { + nBytes += shift >> 3; + k1 *= c1; + k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 *= c2; + h1 ^= k1; + } + + // finalization + h1 ^= nBytes; + + // fmix(h1); + h1 ^= h1 >>> 16; + h1 *= 0x85ebca6b; + h1 ^= h1 >>> 13; + h1 *= 0xc2b2ae35; + h1 ^= h1 >>> 16; + + return h1; + } + + + /** Returns the MurmurHash3_x64_128 hash, placing the result in "out". */ + public static void murmurhash3_x64_128(byte[] key, int offset, int len, int seed, LongPair out) { + // The original algorithm does have a 32 bit unsigned seed. + // We have to mask to match the behavior of the unsigned types and prevent sign extension. + long h1 = seed & 0x00000000FFFFFFFFL; + long h2 = seed & 0x00000000FFFFFFFFL; + + final long c1 = 0x87c37b91114253d5L; + final long c2 = 0x4cf5ad432745937fL; + + int roundedEnd = offset + (len & 0xFFFFFFF0); // round down to 16 byte block + for (int i=offset; i Date: Sun, 13 Jan 2019 06:12:39 +0100 Subject: fixes +fixes circuit programmer consuming circuit when closed on servers +fixes BioLab gui not loading +reformat code +version increase --- build.properties | 2 +- .../bartworks/common/net/BW_Network.java | 2 +- .../common/net/CircuitProgrammerPacket.java | 91 ++++ .../container/GT_Container_CircuitProgrammer.java | 30 +- .../bartimaeusnek/bartworks/util/Coords.java | 32 +- .../bartimaeusnek/bartworks/util/MurmurHash3.java | 556 +++++++++++---------- .../textures/GUI/basicmachines/BW.GUI.BioLab.png | Bin 3151 -> 0 bytes .../textures/gui/basicmachines/BW.GUI.BioLab.png | Bin 0 -> 3151 bytes 8 files changed, 429 insertions(+), 284 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java delete mode 100644 src/main/resources/assets/gregtech/textures/GUI/basicmachines/BW.GUI.BioLab.png create mode 100644 src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.BioLab.png diff --git a/build.properties b/build.properties index 5a578408d1..3ab5c64818 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=3 -buildNumber=12 +buildNumber=14 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index af2a08d3e8..9629eec1c9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -59,7 +59,7 @@ public class BW_Network extends MessageToMessageCodec public BW_Network() { this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", new ChannelHandler[]{this, new HandlerShared()}); - this.mSubChannels = new GT_Packet[]{new RendererPacket()}; + this.mSubChannels = new GT_Packet[]{new RendererPacket(), new CircuitProgrammerPacket()}; } protected void encode(ChannelHandlerContext aContext, GT_Packet aPacket, List aOutput) throws Exception { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java new file mode 100644 index 0000000000..23cf7a263f --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.net; + +import com.github.bartimaeusnek.bartworks.common.items.Circuit_Programmer; +import com.google.common.io.ByteArrayDataInput; +import gregtech.api.net.GT_Packet; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; + +import java.nio.ByteBuffer; + +public class CircuitProgrammerPacket extends GT_Packet { + + private int dimID, playerID; + private byte chipCfg; + private boolean hasChip; + + public CircuitProgrammerPacket() { + super(true); + } + + public CircuitProgrammerPacket(int dimID, int playerID, boolean hasChip, byte chipCfg) { + super(false); + this.dimID = dimID; + this.playerID = playerID; + this.hasChip = hasChip; + this.chipCfg = chipCfg; + } + + @Override + public byte getPacketID() { + return 1; + } + + @Override + public byte[] encode() { + return ByteBuffer.allocate(9).putInt(0, dimID).putInt(4, playerID).put(8, (hasChip ? chipCfg : -1)).array(); + } + + @Override + public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { + byte[] ret = new byte[9]; + byteArrayDataInput.readFully(ret); + return new CircuitProgrammerPacket(ByteBuffer.wrap(ret).getInt(0), ByteBuffer.wrap(ret).getInt(4), ByteBuffer.wrap(ret).get(8) > -1, ByteBuffer.wrap(ret).get(8)); + } + + @Override + public void process(IBlockAccess iBlockAccess) { + World w = DimensionManager.getWorld(dimID); + if (w != null && w.getEntityByID(playerID) instanceof EntityPlayer) { + ItemStack stack = ((EntityPlayer) w.getEntityByID(playerID)).getHeldItem(); + if ((stack != null) && (stack.stackSize > 0)) { + Item item = stack.getItem(); + if (item instanceof Circuit_Programmer) { + NBTTagCompound nbt = stack.getTagCompound(); + nbt.setBoolean("HasChip", hasChip); + if (hasChip) + nbt.setByte("ChipConfig", chipCfg); + stack.setTagCompound(nbt); + ((EntityPlayer) w.getEntityByID(playerID)).inventory.setInventorySlotContents(((EntityPlayer) w.getEntityByID(playerID)).inventory.currentItem, stack); + } + } + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java index f52d3e8b63..53c009e973 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.server.container; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.net.CircuitProgrammerPacket; import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -39,9 +41,13 @@ import net.minecraftforge.common.ForgeHooks; public class GT_Container_CircuitProgrammer extends Container { + EntityPlayer player; + public GT_Container_CircuitProgrammer(InventoryPlayer inventory) { - IInventory inv = new pinv(inventory.player); + player = inventory.player; + + IInventory inv = new pinv(player); addSlotToContainer(new Slot(inv, 0, 44, 61));//-45, 84)); @@ -66,10 +72,11 @@ public class GT_Container_CircuitProgrammer extends Container { @Override public ItemStack slotClick(int slot, int button, int aShifthold, EntityPlayer entityPlayer) { if (slot > 0 && slot < 25 && ((Slot) this.inventorySlots.get(0)).getStack() != null) { - ((Slot) this.inventorySlots.get(0)).getStack().setItemDamage(slot); + ((Slot) this.inventorySlots.get(0)).putStack(GT_Utility.getIntegratedCircuit(slot)); detectAndSendChanges(); return ((Slot) this.inventorySlots.get(0)).getStack(); } + detectAndSendChanges(); return super.slotClick(slot, button, aShifthold, entityPlayer);//( (Slot) this.inventorySlots.get(slot)).getStack(); } @@ -83,7 +90,7 @@ public class GT_Container_CircuitProgrammer extends Container { Slot chipslot = (Slot) this.inventorySlots.get(0); if (SlotNR > 24) { Slot slot = (Slot) this.inventorySlots.get(SlotNR); - if (slot != null && slot.getStack() != null && slot.getStack().getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) { + if (slot != null && slot.getStack() != null && slot.getStack().getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) { if (chipslot.getStack() == null) { chipslot.putStack(slot.getStack()); slot.decrStackSize(1); @@ -99,6 +106,7 @@ public class GT_Container_CircuitProgrammer extends Container { } } } + detectAndSendChanges(); return null; } @@ -114,8 +122,9 @@ public class GT_Container_CircuitProgrammer extends Container { this.Player = Player; this.toBind = Player.inventory.getCurrentItem(); tag = this.toBind.getTagCompound(); - if (tag.getBoolean("HasChip")) + if (tag.getBoolean("HasChip")) { Slot = GT_Utility.getIntegratedCircuit(tag.getByte("ChipConfig")); + } } @Override @@ -154,19 +163,29 @@ public class GT_Container_CircuitProgrammer extends Container { tag.setByte("ChipConfig", (byte) itemStack.getItemDamage()); toBind.setTagCompound(tag); Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); + if (!Player.isClientWorld()) + MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(Player.worldObj.provider.dimensionId, Player.getEntityId(), true, (byte) itemStack.getItemDamage())); + } else if (BW_Util.checkStackAndPrefix(itemStack) && GT_OreDictUnificator.getAssociation(itemStack).mPrefix.equals(OrePrefixes.circuit) && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.equals(Materials.Basic)) { Slot = GT_Utility.getIntegratedCircuit(0); itemStack.stackSize--; tag = toBind.getTagCompound(); tag.setBoolean("HasChip", true); - tag.setByte("ChipConfig", (byte) itemStack.getItemDamage()); + tag.setByte("ChipConfig", (byte) 0); toBind.setTagCompound(tag); Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); + if (!Player.isClientWorld()) + MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(Player.worldObj.provider.dimensionId, Player.getEntityId(), true, (byte) 0)); + } else { ForgeHooks.onPlayerTossEvent(Player, itemStack, false); tag = toBind.getTagCompound(); tag.setBoolean("HasChip", false); toBind.setTagCompound(tag); + Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); + if (!Player.isClientWorld()) + MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(Player.worldObj.provider.dimensionId, Player.getEntityId(), false, (byte) 0)); + } } @@ -203,6 +222,7 @@ public class GT_Container_CircuitProgrammer extends Container { @Override public void closeInventory() { + } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java index 756f6ed7dc..f285b7b6e2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java @@ -22,8 +22,6 @@ package com.github.bartimaeusnek.bartworks.util; -import java.util.Objects; - public class Coords { public int x, z, wID; @@ -57,21 +55,21 @@ public class Coords { @Override public int hashCode() { byte[] data = new byte[14]; - data[0]= (byte) (this.x & 0b1111); - data[1]= (byte) (this.x >> 4 & 0b1111); - data[2]= (byte) (this.x >> 8 & 0b1111); - data[3]= (byte) (this.x >> 12 & 0b1111); - data[4]= (byte) (this.y & 0b1111); - data[5]= (byte) (this.y >> 4 & 0b1111); - data[6]= (byte) (this.z & 0b1111); - data[7]= (byte) (this.z >> 4 & 0b1111); - data[8]= (byte) (this.z >> 8 & 0b1111); - data[9]= (byte) (this.z >> 12 & 0b1111); - data[10]= (byte) (this.wID & 0b1111); - data[11]= (byte) (this.wID >> 4 & 0b1111); - data[12]= (byte) (this.wID >> 8 & 0b1111); - data[13]= (byte) (this.wID >> 12 & 0b1111); - return MurmurHash3.murmurhash3_x86_32(data,0,14,31); + data[0] = (byte) (this.x & 0b1111); + data[1] = (byte) (this.x >> 4 & 0b1111); + data[2] = (byte) (this.x >> 8 & 0b1111); + data[3] = (byte) (this.x >> 12 & 0b1111); + data[4] = (byte) (this.y & 0b1111); + data[5] = (byte) (this.y >> 4 & 0b1111); + data[6] = (byte) (this.z & 0b1111); + data[7] = (byte) (this.z >> 4 & 0b1111); + data[8] = (byte) (this.z >> 8 & 0b1111); + data[9] = (byte) (this.z >> 12 & 0b1111); + data[10] = (byte) (this.wID & 0b1111); + data[11] = (byte) (this.wID >> 4 & 0b1111); + data[12] = (byte) (this.wID >> 8 & 0b1111); + data[13] = (byte) (this.wID >> 12 & 0b1111); + return MurmurHash3.murmurhash3_x86_32(data, 0, 14, 31); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java index d0433145c7..cbb10fa312 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java @@ -23,281 +23,317 @@ package com.github.bartimaeusnek.bartworks.util; public final class MurmurHash3 { - /** 128 bits of state */ - public static final class LongPair { - public long val1; - public long val2; - } - - public static final int fmix32(int h) { - h ^= h >>> 16; - h *= 0x85ebca6b; - h ^= h >>> 13; - h *= 0xc2b2ae35; - h ^= h >>> 16; - return h; - } - - public static final long fmix64(long k) { - k ^= k >>> 33; - k *= 0xff51afd7ed558ccdL; - k ^= k >>> 33; - k *= 0xc4ceb9fe1a85ec53L; - k ^= k >>> 33; - return k; - } - - /** Gets a long from a byte buffer in little endian byte order. */ - public static final long getLongLittleEndian(byte[] buf, int offset) { - return ((long)buf[offset+7] << 56) // no mask needed - | ((buf[offset+6] & 0xffL) << 48) - | ((buf[offset+5] & 0xffL) << 40) - | ((buf[offset+4] & 0xffL) << 32) - | ((buf[offset+3] & 0xffL) << 24) - | ((buf[offset+2] & 0xffL) << 16) - | ((buf[offset+1] & 0xffL) << 8) - | ((buf[offset ] & 0xffL)); // no shift needed - } - - - /** Returns the MurmurHash3_x86_32 hash. */ - public static int murmurhash3_x86_32(byte[] data, int offset, int len, int seed) { - - final int c1 = 0xcc9e2d51; - final int c2 = 0x1b873593; - - int h1 = seed; - int roundedEnd = offset + (len & 0xfffffffc); // round down to 4 byte block - - for (int i=offset; i>> 17); // ROTL32(k1,15); - k1 *= c2; - - h1 ^= k1; - h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); - h1 = h1*5+0xe6546b64; + public static final int fmix32(int h) { + h ^= h >>> 16; + h *= 0x85ebca6b; + h ^= h >>> 13; + h *= 0xc2b2ae35; + h ^= h >>> 16; + return h; } - // tail - int k1 = 0; - - switch(len & 0x03) { - case 3: - k1 = (data[roundedEnd + 2] & 0xff) << 16; - // fallthrough - case 2: - k1 |= (data[roundedEnd + 1] & 0xff) << 8; - // fallthrough - case 1: - k1 |= (data[roundedEnd] & 0xff); - k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); - k1 *= c2; - h1 ^= k1; + public static final long fmix64(long k) { + k ^= k >>> 33; + k *= 0xff51afd7ed558ccdL; + k ^= k >>> 33; + k *= 0xc4ceb9fe1a85ec53L; + k ^= k >>> 33; + return k; } - // finalization - h1 ^= len; - - // fmix(h1); - h1 ^= h1 >>> 16; - h1 *= 0x85ebca6b; - h1 ^= h1 >>> 13; - h1 *= 0xc2b2ae35; - h1 ^= h1 >>> 16; - - return h1; - } - - - /** Returns the MurmurHash3_x86_32 hash of the UTF-8 bytes of the String without actually encoding - * the string to a temporary buffer. This is more than 2x faster than hashing the result - * of String.getBytes(). - */ - public static int murmurhash3_x86_32(CharSequence data, int offset, int len, int seed) { - - final int c1 = 0xcc9e2d51; - final int c2 = 0x1b873593; - - int h1 = seed; - - int pos = offset; - int end = offset + len; - int k1 = 0; - int k2 = 0; - int shift = 0; - int bits = 0; - int nBytes = 0; // length in UTF8 bytes - - - while (pos < end) { - int code = data.charAt(pos++); - if (code < 0x80) { - k2 = code; - bits = 8; - - /*** - // optimized ascii implementation (currently slower!!! code size?) - if (shift == 24) { - k1 = k1 | (code << 24); - - k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); - k1 *= c2; - - h1 ^= k1; - h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); - h1 = h1*5+0xe6546b64; - - shift = 0; - nBytes += 4; - k1 = 0; - } else { - k1 |= code << shift; - shift += 8; + /** + * Gets a long from a byte buffer in little endian byte order. + */ + public static final long getLongLittleEndian(byte[] buf, int offset) { + return ((long) buf[offset + 7] << 56) // no mask needed + | ((buf[offset + 6] & 0xffL) << 48) + | ((buf[offset + 5] & 0xffL) << 40) + | ((buf[offset + 4] & 0xffL) << 32) + | ((buf[offset + 3] & 0xffL) << 24) + | ((buf[offset + 2] & 0xffL) << 16) + | ((buf[offset + 1] & 0xffL) << 8) + | ((buf[offset] & 0xffL)); // no shift needed + } + + /** + * Returns the MurmurHash3_x86_32 hash. + */ + public static int murmurhash3_x86_32(byte[] data, int offset, int len, int seed) { + + final int c1 = 0xcc9e2d51; + final int c2 = 0x1b873593; + + int h1 = seed; + int roundedEnd = offset + (len & 0xfffffffc); // round down to 4 byte block + + for (int i = offset; i < roundedEnd; i += 4) { + // little endian load order + int k1 = (data[i] & 0xff) | ((data[i + 1] & 0xff) << 8) | ((data[i + 2] & 0xff) << 16) | (data[i + 3] << 24); + k1 *= c1; + k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 *= c2; + + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); + h1 = h1 * 5 + 0xe6546b64; } - continue; - ***/ - - } - else if (code < 0x800) { - k2 = (0xC0 | (code >> 6)) - | ((0x80 | (code & 0x3F)) << 8); - bits = 16; - } - else if (code < 0xD800 || code > 0xDFFF || pos>=end) { - // we check for pos>=end to encode an unpaired surrogate as 3 bytes. - k2 = (0xE0 | (code >> 12)) - | ((0x80 | ((code >> 6) & 0x3F)) << 8) - | ((0x80 | (code & 0x3F)) << 16); - bits = 24; - } else { - // surrogate pair - // int utf32 = pos < end ? (int) data.charAt(pos++) : 0; - int utf32 = (int) data.charAt(pos++); - utf32 = ((code - 0xD7C0) << 10) + (utf32 & 0x3FF); - k2 = (0xff & (0xF0 | (utf32 >> 18))) - | ((0x80 | ((utf32 >> 12) & 0x3F))) << 8 - | ((0x80 | ((utf32 >> 6) & 0x3F))) << 16 - | (0x80 | (utf32 & 0x3F)) << 24; - bits = 32; - } - - - k1 |= k2 << shift; - - // int used_bits = 32 - shift; // how many bits of k2 were used in k1. - // int unused_bits = bits - used_bits; // (bits-(32-shift)) == bits+shift-32 == bits-newshift - - shift += bits; - if (shift >= 32) { - // mix after we have a complete word - - k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); - k1 *= c2; - - h1 ^= k1; - h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); - h1 = h1*5+0xe6546b64; - - shift -= 32; - // unfortunately, java won't let you shift 32 bits off, so we need to check for 0 - if (shift != 0) { - k1 = k2 >>> (bits-shift); // bits used == bits - newshift - } else { - k1 = 0; + + // tail + int k1 = 0; + + switch (len & 0x03) { + case 3: + k1 = (data[roundedEnd + 2] & 0xff) << 16; + // fallthrough + case 2: + k1 |= (data[roundedEnd + 1] & 0xff) << 8; + // fallthrough + case 1: + k1 |= (data[roundedEnd] & 0xff); + k1 *= c1; + k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 *= c2; + h1 ^= k1; } - nBytes += 4; - } - - } // inner - - // handle tail - if (shift > 0) { - nBytes += shift >> 3; - k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); - k1 *= c2; - h1 ^= k1; - } - // finalization - h1 ^= nBytes; - - // fmix(h1); - h1 ^= h1 >>> 16; - h1 *= 0x85ebca6b; - h1 ^= h1 >>> 13; - h1 *= 0xc2b2ae35; - h1 ^= h1 >>> 16; - - return h1; - } - - - /** Returns the MurmurHash3_x64_128 hash, placing the result in "out". */ - public static void murmurhash3_x64_128(byte[] key, int offset, int len, int seed, LongPair out) { - // The original algorithm does have a 32 bit unsigned seed. - // We have to mask to match the behavior of the unsigned types and prevent sign extension. - long h1 = seed & 0x00000000FFFFFFFFL; - long h2 = seed & 0x00000000FFFFFFFFL; - - final long c1 = 0x87c37b91114253d5L; - final long c2 = 0x4cf5ad432745937fL; - - int roundedEnd = offset + (len & 0xFFFFFFF0); // round down to 16 byte block - for (int i=offset; i>> 16; + h1 *= 0x85ebca6b; + h1 ^= h1 >>> 13; + h1 *= 0xc2b2ae35; + h1 ^= h1 >>> 16; + + return h1; } - long k1 = 0; - long k2 = 0; - - switch (len & 15) { - case 15: k2 = (key[roundedEnd+14] & 0xffL) << 48; - case 14: k2 |= (key[roundedEnd+13] & 0xffL) << 40; - case 13: k2 |= (key[roundedEnd+12] & 0xffL) << 32; - case 12: k2 |= (key[roundedEnd+11] & 0xffL) << 24; - case 11: k2 |= (key[roundedEnd+10] & 0xffL) << 16; - case 10: k2 |= (key[roundedEnd+ 9] & 0xffL) << 8; - case 9: k2 |= (key[roundedEnd+ 8] & 0xffL); - k2 *= c2; k2 = Long.rotateLeft(k2, 33); k2 *= c1; h2 ^= k2; - case 8: k1 = ((long)key[roundedEnd+7]) << 56; - case 7: k1 |= (key[roundedEnd+6] & 0xffL) << 48; - case 6: k1 |= (key[roundedEnd+5] & 0xffL) << 40; - case 5: k1 |= (key[roundedEnd+4] & 0xffL) << 32; - case 4: k1 |= (key[roundedEnd+3] & 0xffL) << 24; - case 3: k1 |= (key[roundedEnd+2] & 0xffL) << 16; - case 2: k1 |= (key[roundedEnd+1] & 0xffL) << 8; - case 1: k1 |= (key[roundedEnd ] & 0xffL); - k1 *= c1; k1 = Long.rotateLeft(k1,31); k1 *= c2; h1 ^= k1; + /** + * Returns the MurmurHash3_x86_32 hash of the UTF-8 bytes of the String without actually encoding + * the string to a temporary buffer. This is more than 2x faster than hashing the result + * of String.getBytes(). + */ + public static int murmurhash3_x86_32(CharSequence data, int offset, int len, int seed) { + + final int c1 = 0xcc9e2d51; + final int c2 = 0x1b873593; + + int h1 = seed; + + int pos = offset; + int end = offset + len; + int k1 = 0; + int k2 = 0; + int shift = 0; + int bits = 0; + int nBytes = 0; // length in UTF8 bytes + + + while (pos < end) { + int code = data.charAt(pos++); + if (code < 0x80) { + k2 = code; + bits = 8; + + /*** + // optimized ascii implementation (currently slower!!! code size?) + if (shift == 24) { + k1 = k1 | (code << 24); + + k1 *= c1; + k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 *= c2; + + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); + h1 = h1*5+0xe6546b64; + + shift = 0; + nBytes += 4; + k1 = 0; + } else { + k1 |= code << shift; + shift += 8; + } + continue; + ***/ + + } else if (code < 0x800) { + k2 = (0xC0 | (code >> 6)) + | ((0x80 | (code & 0x3F)) << 8); + bits = 16; + } else if (code < 0xD800 || code > 0xDFFF || pos >= end) { + // we check for pos>=end to encode an unpaired surrogate as 3 bytes. + k2 = (0xE0 | (code >> 12)) + | ((0x80 | ((code >> 6) & 0x3F)) << 8) + | ((0x80 | (code & 0x3F)) << 16); + bits = 24; + } else { + // surrogate pair + // int utf32 = pos < end ? (int) data.charAt(pos++) : 0; + int utf32 = (int) data.charAt(pos++); + utf32 = ((code - 0xD7C0) << 10) + (utf32 & 0x3FF); + k2 = (0xff & (0xF0 | (utf32 >> 18))) + | ((0x80 | ((utf32 >> 12) & 0x3F))) << 8 + | ((0x80 | ((utf32 >> 6) & 0x3F))) << 16 + | (0x80 | (utf32 & 0x3F)) << 24; + bits = 32; + } + + + k1 |= k2 << shift; + + // int used_bits = 32 - shift; // how many bits of k2 were used in k1. + // int unused_bits = bits - used_bits; // (bits-(32-shift)) == bits+shift-32 == bits-newshift + + shift += bits; + if (shift >= 32) { + // mix after we have a complete word + + k1 *= c1; + k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 *= c2; + + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); + h1 = h1 * 5 + 0xe6546b64; + + shift -= 32; + // unfortunately, java won't let you shift 32 bits off, so we need to check for 0 + if (shift != 0) { + k1 = k2 >>> (bits - shift); // bits used == bits - newshift + } else { + k1 = 0; + } + nBytes += 4; + } + + } // inner + + // handle tail + if (shift > 0) { + nBytes += shift >> 3; + k1 *= c1; + k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 *= c2; + h1 ^= k1; + } + + // finalization + h1 ^= nBytes; + + // fmix(h1); + h1 ^= h1 >>> 16; + h1 *= 0x85ebca6b; + h1 ^= h1 >>> 13; + h1 *= 0xc2b2ae35; + h1 ^= h1 >>> 16; + + return h1; } - //---------- - // finalization + /** + * Returns the MurmurHash3_x64_128 hash, placing the result in "out". + */ + public static void murmurhash3_x64_128(byte[] key, int offset, int len, int seed, LongPair out) { + // The original algorithm does have a 32 bit unsigned seed. + // We have to mask to match the behavior of the unsigned types and prevent sign extension. + long h1 = seed & 0x00000000FFFFFFFFL; + long h2 = seed & 0x00000000FFFFFFFFL; + + final long c1 = 0x87c37b91114253d5L; + final long c2 = 0x4cf5ad432745937fL; + + int roundedEnd = offset + (len & 0xFFFFFFF0); // round down to 16 byte block + for (int i = offset; i < roundedEnd; i += 16) { + long k1 = getLongLittleEndian(key, i); + long k2 = getLongLittleEndian(key, i + 8); + k1 *= c1; + k1 = Long.rotateLeft(k1, 31); + k1 *= c2; + h1 ^= k1; + h1 = Long.rotateLeft(h1, 27); + h1 += h2; + h1 = h1 * 5 + 0x52dce729; + k2 *= c2; + k2 = Long.rotateLeft(k2, 33); + k2 *= c1; + h2 ^= k2; + h2 = Long.rotateLeft(h2, 31); + h2 += h1; + h2 = h2 * 5 + 0x38495ab5; + } + + long k1 = 0; + long k2 = 0; + + switch (len & 15) { + case 15: + k2 = (key[roundedEnd + 14] & 0xffL) << 48; + case 14: + k2 |= (key[roundedEnd + 13] & 0xffL) << 40; + case 13: + k2 |= (key[roundedEnd + 12] & 0xffL) << 32; + case 12: + k2 |= (key[roundedEnd + 11] & 0xffL) << 24; + case 11: + k2 |= (key[roundedEnd + 10] & 0xffL) << 16; + case 10: + k2 |= (key[roundedEnd + 9] & 0xffL) << 8; + case 9: + k2 |= (key[roundedEnd + 8] & 0xffL); + k2 *= c2; + k2 = Long.rotateLeft(k2, 33); + k2 *= c1; + h2 ^= k2; + case 8: + k1 = ((long) key[roundedEnd + 7]) << 56; + case 7: + k1 |= (key[roundedEnd + 6] & 0xffL) << 48; + case 6: + k1 |= (key[roundedEnd + 5] & 0xffL) << 40; + case 5: + k1 |= (key[roundedEnd + 4] & 0xffL) << 32; + case 4: + k1 |= (key[roundedEnd + 3] & 0xffL) << 24; + case 3: + k1 |= (key[roundedEnd + 2] & 0xffL) << 16; + case 2: + k1 |= (key[roundedEnd + 1] & 0xffL) << 8; + case 1: + k1 |= (key[roundedEnd] & 0xffL); + k1 *= c1; + k1 = Long.rotateLeft(k1, 31); + k1 *= c2; + h1 ^= k1; + } + + //---------- + // finalization - h1 ^= len; h2 ^= len; + h1 ^= len; + h2 ^= len; - h1 += h2; - h2 += h1; + h1 += h2; + h2 += h1; - h1 = fmix64(h1); - h2 = fmix64(h2); + h1 = fmix64(h1); + h2 = fmix64(h2); - h1 += h2; - h2 += h1; + h1 += h2; + h2 += h1; - out.val1 = h1; - out.val2 = h2; - } + out.val1 = h1; + out.val2 = h2; + } + + /** + * 128 bits of state + */ + public static final class LongPair { + public long val1; + public long val2; + } } diff --git a/src/main/resources/assets/gregtech/textures/GUI/basicmachines/BW.GUI.BioLab.png b/src/main/resources/assets/gregtech/textures/GUI/basicmachines/BW.GUI.BioLab.png deleted file mode 100644 index fb9c0e113c..0000000000 Binary files a/src/main/resources/assets/gregtech/textures/GUI/basicmachines/BW.GUI.BioLab.png and /dev/null differ diff --git a/src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.BioLab.png b/src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.BioLab.png new file mode 100644 index 0000000000..fb9c0e113c Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.BioLab.png differ -- cgit From baa391cc662db69168abb05630d757d225d45aa9 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 14 Jan 2019 03:44:25 +0100 Subject: glass blocks texture +added Connected Textures +added decorative colored blocks +added a shitton of needed Texture files +updated en_US.lang Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> --- .../client/renderer/RendererGlasBlock.java | 92 ++++++++++++++ .../bartworks/common/blocks/BW_Blocks.java | 6 +- .../bartworks/common/blocks/BW_GlasBlocks.java | 133 +++++++++++++++++++++ .../bartworks/common/loaders/BioItemList.java | 34 ++++-- .../bartworks/common/loaders/BioRecipeLoader.java | 19 ++- .../bartworks/common/loaders/FluidLoader.java | 2 + .../tileentities/GT_MetaTileEntity_BioLab.java | 1 - .../common/tileentities/GT_TileEntity_BioVat.java | 2 +- .../bartworks/util/ConnectedBlocksChecker.java | 28 ++++- .../bartworks/util/NEIbartworksConfig.java | 2 + .../resources/assets/bartworks/lang/en_US.lang | 18 ++- .../textures/blocks/BoronSilicateGlassBlock.png | Bin 177 -> 184 bytes .../blocks/BoronSilicateGlassBlockRand.png | Bin 184 -> 0 bytes .../blocks/BoronSilicateGlassBlockRandlos.png | Bin 0 -> 177 bytes .../blocks/BoronSilicateGlassBlockRandlos_0.png | Bin 0 -> 186 bytes .../blocks/BoronSilicateGlassBlockRandlos_1.png | Bin 0 -> 184 bytes .../blocks/BoronSilicateGlassBlockRandlos_10.png | Bin 0 -> 184 bytes .../blocks/BoronSilicateGlassBlockRandlos_11.png | Bin 0 -> 182 bytes .../blocks/BoronSilicateGlassBlockRandlos_12.png | Bin 0 -> 188 bytes .../blocks/BoronSilicateGlassBlockRandlos_13.png | Bin 0 -> 183 bytes .../blocks/BoronSilicateGlassBlockRandlos_14.png | Bin 0 -> 184 bytes .../blocks/BoronSilicateGlassBlockRandlos_15.png | Bin 0 -> 177 bytes .../blocks/BoronSilicateGlassBlockRandlos_2.png | Bin 0 -> 184 bytes .../blocks/BoronSilicateGlassBlockRandlos_3.png | Bin 0 -> 182 bytes .../blocks/BoronSilicateGlassBlockRandlos_4.png | Bin 0 -> 187 bytes .../blocks/BoronSilicateGlassBlockRandlos_5.png | Bin 0 -> 184 bytes .../blocks/BoronSilicateGlassBlockRandlos_6.png | Bin 0 -> 184 bytes .../blocks/BoronSilicateGlassBlockRandlos_7.png | Bin 0 -> 180 bytes .../blocks/BoronSilicateGlassBlockRandlos_8.png | Bin 0 -> 186 bytes .../blocks/BoronSilicateGlassBlockRandlos_9.png | Bin 0 -> 184 bytes .../textures/blocks/BoronSilicateGlassBlock_0.png | Bin 0 -> 211 bytes .../textures/blocks/BoronSilicateGlassBlock_1.png | Bin 0 -> 207 bytes .../textures/blocks/BoronSilicateGlassBlock_10.png | Bin 0 -> 228 bytes .../textures/blocks/BoronSilicateGlassBlock_11.png | Bin 0 -> 227 bytes .../textures/blocks/BoronSilicateGlassBlock_12.png | Bin 0 -> 207 bytes .../textures/blocks/BoronSilicateGlassBlock_13.png | Bin 0 -> 205 bytes .../textures/blocks/BoronSilicateGlassBlock_14.png | Bin 0 -> 207 bytes .../textures/blocks/BoronSilicateGlassBlock_15.png | Bin 0 -> 203 bytes .../textures/blocks/BoronSilicateGlassBlock_2.png | Bin 0 -> 211 bytes .../textures/blocks/BoronSilicateGlassBlock_3.png | Bin 0 -> 208 bytes .../textures/blocks/BoronSilicateGlassBlock_4.png | Bin 0 -> 209 bytes .../textures/blocks/BoronSilicateGlassBlock_5.png | Bin 0 -> 207 bytes .../textures/blocks/BoronSilicateGlassBlock_6.png | Bin 0 -> 206 bytes .../textures/blocks/BoronSilicateGlassBlock_7.png | Bin 0 -> 202 bytes .../textures/blocks/BoronSilicateGlassBlock_8.png | Bin 0 -> 227 bytes .../textures/blocks/BoronSilicateGlassBlock_9.png | Bin 0 -> 226 bytes .../blocks/ColoredBoronSilicateGlassBlock1.png | Bin 0 -> 187 bytes .../blocks/ColoredBoronSilicateGlassBlock2.png | Bin 0 -> 185 bytes .../blocks/ColoredBoronSilicateGlassBlock3.png | Bin 0 -> 187 bytes .../blocks/ColoredBoronSilicateGlassBlock4.png | Bin 0 -> 188 bytes .../blocks/ColoredBoronSilicateGlassBlock5.png | Bin 0 -> 187 bytes .../blocks/ColoredBoronSilicateGlassBlock6.png | Bin 0 -> 187 bytes 52 files changed, 313 insertions(+), 24 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRand.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_0.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_1.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_10.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_11.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_12.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_13.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_14.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_15.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_2.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_3.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_4.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_5.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_6.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_7.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_8.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_9.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_0.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_1.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_10.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_11.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_12.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_13.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_14.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_15.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_2.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_3.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_4.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_5.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_6.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_7.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_8.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_9.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock1.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock2.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock3.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock4.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock5.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock6.png diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java new file mode 100644 index 0000000000..25f5c9220e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.client.renderer; + +import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.IBlockAccess; +import org.lwjgl.opengl.GL11; + +public class RendererGlasBlock implements ISimpleBlockRenderingHandler { + + public static final int RID = RenderingRegistry.getNextAvailableRenderId(); + public static final RendererGlasBlock instance = new RendererGlasBlock(); + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { + Tessellator tessellator = Tessellator.instance; + block.setBlockBoundsForItemRender(); + renderer.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + //renderer.setRenderBounds(0.001,0.001,0.001,0.999,0.999,0.999); + renderer.renderStandardBlock(BioItemList.bw_fake_glasses, x, y, z); + //renderer.setRenderBounds(0,0,0,1,1,1); + renderer.renderStandardBlockWithColorMultiplier(block, x, y, z, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[0] / 255f, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[1] / 255f, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[2] / 255f); + return true; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return RID; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java index ea7869c982..a067dae815 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java @@ -41,9 +41,9 @@ import java.util.List; public class BW_Blocks extends Block { @SideOnly(Side.CLIENT) - private IIcon[] texture; - private String[] textureNames; - private String name; + protected IIcon[] texture; + protected String[] textureNames; + protected String name; public BW_Blocks(String name, String[] texture) { super(Material.anvil); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java index db93c1cfe6..4b10f1dc9a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java @@ -22,16 +22,39 @@ package com.github.bartimaeusnek.bartworks.common.blocks; +import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.util.ForgeDirection; public class BW_GlasBlocks extends BW_Blocks { + @SideOnly(Side.CLIENT) + IIcon[] connectedTexture; + + boolean connectedTex, fake; + short[][] color = new short[textureNames.length][3]; + public BW_GlasBlocks(String name, String[] texture, CreativeTabs tabs) { super(name, texture, tabs, Material.glass); + connectedTex = false; + } + + + public BW_GlasBlocks(String name, String[] texture, short[][] color, CreativeTabs tabs, boolean connectedTex, boolean fake) { + super(name, texture, tabs, Material.glass); + this.connectedTex = connectedTex; + this.color = color; + this.fake = fake; + } + + public short[] getColor(int meta) { + return meta < texture.length ? color[meta] : color[0]; } @Override @@ -47,12 +70,122 @@ public class BW_GlasBlocks extends BW_Blocks { return super.shouldSideBeRendered(worldClient, xCoord, yCoord, zCoord, aSide); } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + return meta < texture.length ? texture[meta] : texture[0]; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) { + if (!connectedTex) { + texture = new IIcon[textureNames.length]; + for (int i = 0; i < textureNames.length; i++) { + texture[i] = par1IconRegister.registerIcon(textureNames[i]); + } + return; + } + texture = new IIcon[textureNames.length]; + connectedTexture = new IIcon[16]; + for (int i = 0; i < textureNames.length; i++) { + texture[i] = par1IconRegister.registerIcon(textureNames[i]); + for (int j = 0; j < 16; j++) { + connectedTexture[j] = par1IconRegister.registerIcon(textureNames[0] + "_" + j); + } + } + } + + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess worldClient, int xCoord, int yCoord, int zCoord, int aSide) { + if (!connectedTex) + return super.getIcon(worldClient, xCoord, yCoord, zCoord, aSide); + + ForgeDirection dir = ForgeDirection.getOrientation(aSide); + byte sides = 0; + switch (dir) { + case UP: + case DOWN: { + if (worldClient.getBlock(xCoord, yCoord, zCoord - 1) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b0001); + if (worldClient.getBlock(xCoord, yCoord, zCoord + 1) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b0010); + if (worldClient.getBlock(xCoord - 1, yCoord, zCoord) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b0100); + if (worldClient.getBlock(xCoord + 1, yCoord, zCoord) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b1000); + break; + } + case EAST: { + if (worldClient.getBlock(xCoord, yCoord + 1, zCoord) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b0001); + if (worldClient.getBlock(xCoord, yCoord - 1, zCoord) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b0010); + if (worldClient.getBlock(xCoord, yCoord, zCoord + 1) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b0100); + if (worldClient.getBlock(xCoord, yCoord, zCoord - 1) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b1000); + break; + } + case WEST: { + if (worldClient.getBlock(xCoord, yCoord + 1, zCoord) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b0001); + if (worldClient.getBlock(xCoord, yCoord - 1, zCoord) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b0010); + if (worldClient.getBlock(xCoord, yCoord, zCoord - 1) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b0100); + if (worldClient.getBlock(xCoord, yCoord, zCoord + 1) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b1000); + break; + + } + case NORTH: { + if (worldClient.getBlock(xCoord, yCoord + 1, zCoord) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b0001); + if (worldClient.getBlock(xCoord, yCoord - 1, zCoord) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b0010); + if (worldClient.getBlock(xCoord + 1, yCoord, zCoord) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b0100); + if (worldClient.getBlock(xCoord - 1, yCoord, zCoord) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b1000); + break; + } + case SOUTH: { + if (worldClient.getBlock(xCoord, yCoord + 1, zCoord) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b0001); + if (worldClient.getBlock(xCoord, yCoord - 1, zCoord) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b0010); + if (worldClient.getBlock(xCoord - 1, yCoord, zCoord) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b0100); + if (worldClient.getBlock(xCoord + 1, yCoord, zCoord) instanceof BW_GlasBlocks) + sides = (byte) (sides | 0b1000); + break; + } + case UNKNOWN: + default: { + break; + } + } + return connectedTexture[sides]; + } + @Override @SideOnly(Side.CLIENT) public int getRenderBlockPass() { return 1; } + @Override + public int getRenderType() { + if (!fake) + return RendererGlasBlock.RID; + else + return 0; + } + @Override public boolean renderAsNormalBlock() { return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java index 088736025e..60614afde0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java @@ -48,17 +48,34 @@ public class BioItemList { public static final Block[] bw_glasses = { - new BW_GlasBlocks("BW_GlasBlocks", new String[]{ - MainMod.modID + ":BoronSilicateGlassBlock", - MainMod.modID + ":NickelReinforcedBoronSilicateGlassBlock", - MainMod.modID + ":TungstenReinforcedBoronSilicateGlassBlock", - MainMod.modID + ":ChromeReinforcedBoronSilicateGlassBlock", - MainMod.modID + ":IridiumReinforcedBoronSilicateGlassBlock", - MainMod.modID + ":OsmiumReinforcedBoronSilicateGlassBlock", - }, MainMod.BioTab + new BW_GlasBlocks( + "BW_GlasBlocks", + new String[]{ + MainMod.modID + ":BoronSilicateGlassBlock", + MainMod.modID + ":NickelReinforcedBoronSilicateGlassBlock", + MainMod.modID + ":TungstenReinforcedBoronSilicateGlassBlock", + MainMod.modID + ":ChromeReinforcedBoronSilicateGlassBlock", + MainMod.modID + ":IridiumReinforcedBoronSilicateGlassBlock", + MainMod.modID + ":OsmiumReinforcedBoronSilicateGlassBlock", + MainMod.modID + ":ColoredBoronSilicateGlassBlock1", + MainMod.modID + ":ColoredBoronSilicateGlassBlock2", + MainMod.modID + ":ColoredBoronSilicateGlassBlock3", + MainMod.modID + ":ColoredBoronSilicateGlassBlock4", + MainMod.modID + ":ColoredBoronSilicateGlassBlock5", + MainMod.modID + ":ColoredBoronSilicateGlassBlock6", + }, + new short[][]{Materials.BorosilicateGlass.getRGBA(), Materials.Nickel.getRGBA(), Materials.Tungsten.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), Materials.Osmium.getRGBA(), new short[]{0xff, 0, 0}, new short[]{0, 0xff, 0}, new short[]{0x80, 0, 0xff}, new short[]{0xff, 0xff, 0}, new short[]{0, 0xff, 0x80}, new short[]{0x80, 0x33, 0}}, + MainMod.BioTab, + true, false ) }; + public static final Block bw_fake_glasses = + new BW_GlasBlocks("BW_GlasBlocks", new String[]{ + MainMod.modID + ":BoronSilicateGlassBlockRandlos" + }, null, null, true, true); + + private static final Item mItemBioLabParts = new LabModule(new String[]{"DNAExtractionModule", "PCRThermoclyclingModule", "PlasmidSynthesisModule", "TransformationModule", "ClonalCellularSynthesisModule"}); public static final ItemStack[] mBioLabParts = {new ItemStack(mItemBioLabParts), new ItemStack(mItemBioLabParts, 1, 1), new ItemStack(mItemBioLabParts, 1, 2), new ItemStack(mItemBioLabParts, 1, 3), new ItemStack(mItemBioLabParts, 1, 4)}; private static final Item vanillaBioLabParts = new LabParts(new String[]{"petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", "IncubationModule", "PlasmaMembrane"}); @@ -67,6 +84,7 @@ public class BioItemList { GameRegistry.registerItem(mItemBioLabParts, "BioLabModules"); GameRegistry.registerItem(vanillaBioLabParts, "BioLabParts"); GameRegistry.registerBlock(bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); + GameRegistry.registerBlock(bw_fake_glasses, "BW_FakeGlasBlock"); //fixing BorosilicateGlass... -_-' Materials.BorosilicateGlass.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); GT_OreDictUnificator.add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(bw_glasses[0], 1, 0)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index 5fc32bcfc8..0987005a7f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -30,10 +30,7 @@ import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.BioCulture; import cpw.mods.fml.common.Loader; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; @@ -364,6 +361,14 @@ public class BioRecipeLoader extends RecipeLoader { GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 3), Materials.Iridium.getMolten(3888), new ItemStack(BioItemList.bw_glasses[0], 1, 4), 800, BW_Util.getMachineVoltageFromTier(7)); GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 4), Materials.Osmium.getMolten(1296), new ItemStack(BioItemList.bw_glasses[0], 1, 5), 800, BW_Util.getMachineVoltageFromTier(8)); + for (int i = 0; i < Dyes.dyeBrown.getSizeOfFluidList(); ++i) { + GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyeRed.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 6), null, null, null, 64, 2); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyeGreen.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 7), null, null, null, 64, 2); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyePurple.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 8), null, null, null, 64, 2); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyeYellow.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 9), null, null, null, 64, 2); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyeLime.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 10), null, null, null, 64, 2); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyeBrown.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 11), null, null, null, 64, 2); + } //and reverse recipes... cause im nice :P GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 1), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nickel.getDust(36)}, null, 800, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 2), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nickel.getDust(36), Materials.Tungsten.getDust(9)}, null, 800, BW_Util.getMachineVoltageFromTier(5)); @@ -371,5 +376,11 @@ public class BioRecipeLoader extends RecipeLoader { GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 4), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9), Materials.Iridium.getDust(27)}, null, 800, BW_Util.getMachineVoltageFromTier(7)); GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 5), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9), Materials.Osmiridium.getDust(36)}, null, 800, BW_Util.getMachineVoltageFromTier(8)); + for (int i = 6; i < 11; i++) { + GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, i), new ItemStack[]{Materials.BorosilicateGlass.getDust(9)}, null, 400, BW_Util.getMachineVoltageFromTier(1)); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, i), Materials.Chlorine.getGas(50), new ItemStack(BioItemList.bw_glasses[0], 1, 0), null, null, null, 64, 2); + } + + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index b060002b38..4646d850e0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders; +import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock; import com.github.bartimaeusnek.bartworks.client.renderer.RendererSwitchingColorFluid; import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock; import com.github.bartimaeusnek.bartworks.common.tileentities.BWTileEntityDimIDBridge; @@ -81,5 +82,6 @@ public class FluidLoader implements Runnable { GameRegistry.registerBlock(bioFluidBlock, "coloredFluidBlock"); GameRegistry.registerTileEntity(BWTileEntityDimIDBridge.class, "bwTEDimIDBridge"); RenderingRegistry.registerBlockHandler(RendererSwitchingColorFluid.instance); + RenderingRegistry.registerBlockHandler(RendererGlasBlock.instance); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_BioLab.java index b68e399511..b6cb2dea3e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_BioLab.java @@ -132,7 +132,6 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { if (DNABioDataTag == null) return super.checkRecipe(skipOC); BioData cultureDNABioData = BioData.getBioDataFromName(DNABioDataTag.getString("Name")); - if (cultureDNABioData == null) return super.checkRecipe(skipOC); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_BioVat.java index a7e153bdc1..f7f5024f4e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_BioVat.java @@ -390,7 +390,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private byte calculateGlassTier(@Nonnull Block block, @Nonnegative Byte meta) { if (block.equals(BioItemList.bw_glasses[0])) - return meta > 1 ? (byte) (meta + 3) : 4; + return meta > 1 && meta < 6 ? (byte) (meta + 3) : 4; if (block.getUnlocalizedName().equals("blockAlloyGlass")) return 4; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java index 388d888cf4..e1502041ed 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java @@ -26,6 +26,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; import java.util.HashSet; @@ -33,6 +34,32 @@ public class ConnectedBlocksChecker { public final HashSet hashset = new HashSet(); + public static byte check_sourroundings(Coords C, Block b) { + byte ret = 0; + World w = DimensionManager.getWorld(C.wID); + int x = C.x, y = C.y, z = C.z; + + if (w.getBlock(x, y + 1, z).equals(b)) + ret = (byte) (ret | 0b000001); + + if (w.getBlock(x, y - 1, z).equals(b)) + ret = (byte) (ret | 0b000010); + + if (w.getBlock(x + 1, y, z).equals(b)) + ret = (byte) (ret | 0b000100); + + if (w.getBlock(x - 1, y, z).equals(b)) + ret = (byte) (ret | 0b001000); + + if (w.getBlock(x, y, z + 1).equals(b)) + ret = (byte) (ret | 0b010000); + + if (w.getBlock(x, y, z - 1).equals(b)) + ret = (byte) (ret | 0b100000); + + return ret; + } + public int get_connected(World w, int x, int y, int z, Block b) { int ret = 0; @@ -73,7 +100,6 @@ public class ConnectedBlocksChecker { return ret; } - public byte check_sourroundings(World w, int x, int y, int z, Block b) { byte ret = 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java index e1e1df39c2..770f5edfe5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.util; import codechicken.nei.api.API; import codechicken.nei.api.IConfigureNEI; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import cpw.mods.fml.common.Optional; @@ -50,5 +51,6 @@ public class NEIbartworksConfig implements IConfigureNEI { public void loadConfig() { API.hideItem(new ItemStack(ItemRegistry.tab)); API.hideItem(new ItemStack(FluidLoader.bioFluidBlock)); + API.hideItem(new ItemStack(BioItemList.bw_fake_glasses)); } } \ No newline at end of file diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index cdcef27970..23cb370e17 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -38,9 +38,15 @@ labModule.item.PCRThermoclyclingModule.name=PCR Thermoclycle Module labModule.item.PlasmidSynthesisModule.name=Plasmid Synthesis Module labModule.item.TransformationModule.name=Transformation Module labModule.item.ClonalCellularSynthesisModule.name=Clonal Cellular Synthesis Module -BW_GlasBlocks.0.name=Borosilicate Glass Blocks -BW_GlasBlocks.1.name=Nickel Reinforced Boroilicate GlassBlock -BW_GlasBlocks.2.name=Tungsten Reinforced Boroilicate GlassBlock -BW_GlasBlocks.3.name=Chrome Reinforced Boroilicate GlassBlock -BW_GlasBlocks.4.name=Iridium Reinforced Boroilicate GlassBlock -BW_GlasBlocks.5.name=Osmium Reinforced Boroilicate GlassBlock \ No newline at end of file +BW_GlasBlocks.0.name=Borosilicate Glass Block +BW_GlasBlocks.1.name=Nickel Reinforced Borosilicate Glass Block +BW_GlasBlocks.2.name=Tungsten Reinforced Borosilicate Glass Block +BW_GlasBlocks.3.name=Chrome Reinforced Borosilicate Glass Block +BW_GlasBlocks.4.name=Iridium Reinforced Borosilicate Glass Block +BW_GlasBlocks.5.name=Osmium Reinforced Borosilicate Glass Block +BW_GlasBlocks.6.name=Colored Borosilicate Glass Block (Red) +BW_GlasBlocks.7.name=Colored Borosilicate Glass Block (Green) +BW_GlasBlocks.8.name=Colored Borosilicate Glass Block (Purple) +BW_GlasBlocks.9.name=Colored Borosilicate Glass Block (Yellow) +BW_GlasBlocks.10.name=Colored Borosilicate Glass Block (Light Green) +BW_GlasBlocks.11.name=Colored Borosilicate Glass Block (Brown) \ No newline at end of file diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock.png index 4ea5e5973f..0e27ddbb62 100644 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock.png and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRand.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRand.png deleted file mode 100644 index 0e27ddbb62..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRand.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos.png new file mode 100644 index 0000000000..f711908135 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_0.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_0.png new file mode 100644 index 0000000000..5622806282 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_0.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_1.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_1.png new file mode 100644 index 0000000000..c0b5b0da4d Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_1.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_10.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_10.png new file mode 100644 index 0000000000..3c8b4c66d7 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_10.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_11.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_11.png new file mode 100644 index 0000000000..036adac6f3 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_11.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_12.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_12.png new file mode 100644 index 0000000000..ea67c34b23 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_12.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_13.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_13.png new file mode 100644 index 0000000000..1727d6228a Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_13.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_14.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_14.png new file mode 100644 index 0000000000..8795c1dacc Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_14.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_15.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_15.png new file mode 100644 index 0000000000..f711908135 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_15.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_2.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_2.png new file mode 100644 index 0000000000..c69982d8e7 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_2.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_3.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_3.png new file mode 100644 index 0000000000..18eadf45ed Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_3.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_4.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_4.png new file mode 100644 index 0000000000..269de3edb1 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_4.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_5.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_5.png new file mode 100644 index 0000000000..198701e1bb Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_5.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_6.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_6.png new file mode 100644 index 0000000000..9f050cc629 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_6.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_7.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_7.png new file mode 100644 index 0000000000..4969508f31 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_7.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_8.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_8.png new file mode 100644 index 0000000000..c73f1f5320 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_8.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_9.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_9.png new file mode 100644 index 0000000000..f9a450ae2d Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_9.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_0.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_0.png new file mode 100644 index 0000000000..f66994bcd2 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_0.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_1.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_1.png new file mode 100644 index 0000000000..1249814be6 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_1.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_10.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_10.png new file mode 100644 index 0000000000..0bb400b3dc Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_10.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_11.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_11.png new file mode 100644 index 0000000000..e40c597ceb Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_11.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_12.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_12.png new file mode 100644 index 0000000000..2ddabd3331 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_12.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_13.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_13.png new file mode 100644 index 0000000000..617758a4b6 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_13.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_14.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_14.png new file mode 100644 index 0000000000..a8ab0806e2 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_14.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_15.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_15.png new file mode 100644 index 0000000000..d3f697ab1f Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_15.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_2.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_2.png new file mode 100644 index 0000000000..543b011c03 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_2.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_3.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_3.png new file mode 100644 index 0000000000..d69e640fb3 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_3.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_4.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_4.png new file mode 100644 index 0000000000..48509772ce Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_4.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_5.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_5.png new file mode 100644 index 0000000000..93dc271b8e Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_5.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_6.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_6.png new file mode 100644 index 0000000000..da2f1deb4a Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_6.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_7.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_7.png new file mode 100644 index 0000000000..4a7a5b4a3f Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_7.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_8.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_8.png new file mode 100644 index 0000000000..fdf64c2958 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_8.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_9.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_9.png new file mode 100644 index 0000000000..d4110a3b06 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_9.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock1.png b/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock1.png new file mode 100644 index 0000000000..92ce6cb9a2 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock1.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock2.png b/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock2.png new file mode 100644 index 0000000000..0cc6e08ae3 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock2.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock3.png b/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock3.png new file mode 100644 index 0000000000..f230acbe3f Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock3.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock4.png b/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock4.png new file mode 100644 index 0000000000..2febb0540d Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock4.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock5.png b/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock5.png new file mode 100644 index 0000000000..89e0b0d84e Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock5.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock6.png b/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock6.png new file mode 100644 index 0000000000..54c29e5ae9 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/ColoredBoronSilicateGlassBlock6.png differ -- cgit From 9c979f540c6ccdb6676c3e89c36601d5aa4fc258 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 17 Jan 2019 19:46:22 +0100 Subject: Acid Gen Update +Added Simple Wind Meter for the Windmill +Added Tooltips +Changed Windmill Texture +Changed Windmill boni +hopefully fixed circuit programmer +version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> --- build.properties | 2 +- .../bartworks/API/AcidGenFuelAdder.java | 42 ++ .../github/bartimaeusnek/bartworks/MainMod.java | 1 - .../bartworks/common/configs/ConfigHandler.java | 4 +- .../bartworks/common/items/BW_SimpleWindMeter.java | 75 ++++ .../bartworks/common/items/BW_Stonage_Rotors.java | 3 + .../bartworks/common/loaders/ItemRegistry.java | 8 + .../bartworks/common/loaders/RecipeLoader.java | 62 ++- .../GT_MetaTileEntity_AcidGenerator.java | 113 ++++++ .../tileentities/GT_TileEntity_Windmill.java | 50 ++- .../container/GT_Container_CircuitProgrammer.java | 10 +- .../bartimaeusnek/bartworks/util/BWRecipes.java | 427 ++++++++++++--------- .../resources/assets/bartworks/lang/en_US.lang | 1 + .../textures/items/BW_SimpleWindMeter.png | Bin 0 -> 448 bytes 14 files changed, 573 insertions(+), 225 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java create mode 100644 src/main/resources/assets/bartworks/textures/items/BW_SimpleWindMeter.png diff --git a/build.properties b/build.properties index 3ab5c64818..e38d9e91d9 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=3 -buildNumber=14 +buildNumber=16 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java new file mode 100644 index 0000000000..0f181a3559 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import gregtech.api.enums.Materials; +import net.minecraftforge.fluids.FluidStack; + +public final class AcidGenFuelAdder { + + public static boolean addLiquidFuel(Materials M, int burn) { + return ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(M, burn) != null; + } + + public static boolean addLiquidFuel(FluidStack fluidStack, int burn) { + return ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(fluidStack, burn) != null; + } + + public static boolean addMoltenFuel(Materials M, int burn) { + return ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addMoltenFuel(M, burn) != null; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index c2a42579df..3f3fc8d9a5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -91,5 +91,4 @@ public final class MainMod { new GTNHBlocks().run(); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 69621bc1b5..b4f28fd33a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -32,10 +32,10 @@ import javax.annotation.Nonnull; import java.io.File; public class ConfigHandler { - private static final int IDU = GT_Values.VN.length * 8 - 3; + private static final int IDU = GT_Values.VN.length * 8 + 1; public static int IDOffset = 12600; public static boolean teslastaff = false; - public static long energyPerCell = 100000L; + public static long energyPerCell = 1000000L; public static boolean newStuff = true; public static boolean BioLab = true; public static Configuration c; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java new file mode 100644 index 0000000000..f526e5a601 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.items; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.WorldData; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.World; + +import java.util.List; + +public class BW_SimpleWindMeter extends Item { + + public BW_SimpleWindMeter() { + this.maxStackSize = 1; + this.setMaxDamage(15); + this.setCreativeTab(MainMod.BWT); + this.hasSubtypes = false; + this.setUnlocalizedName("BW_SimpleWindMeter"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister p_94581_1_) { + this.itemIcon = p_94581_1_.registerIcon(MainMod.modID + ":BW_SimpleWindMeter"); + } + + @Override + public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean p_77624_4_) { + super.addInformation(itemStack, entityPlayer, list, p_77624_4_); + list.add("A simple Windmeter to choose a place for the Windmill."); + list.add("Uses left: " + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); + list.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); + } + + @Override + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) { + if (entityPlayer.worldObj.isRemote || world == null || WorldData.get(world) == null || WorldData.get(world).windSim == null) + return itemStack; + + float windStrength = (float) WorldData.get(world).windSim.getWindAt(entityPlayer.posY); + String windS = windStrength < 1f ? "non existant" : windStrength < 10f ? "pretty low" : windStrength < 20f ? "common" : windStrength < 30f ? "rather strong" : windStrength < 50f ? "very strong" : "too strong"; + entityPlayer.addChatMessage(new ChatComponentText("The wind here seems to be " + windS + ".")); + itemStack.damageItem(1, entityPlayer); + return itemStack; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index edb2f32e77..2227cae93e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -76,6 +76,9 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { } else if (Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator) { type = WIND; } + info.add("Diameter: " + this.DiaMinMax[0]); + info.add("Durability: " + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); + info.add("Efficiency: " + this.eff); if (type != null) { info.add(StatCollector.translateToLocal(("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type)))); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index fffcf974de..d90b99029d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.items.*; import com.github.bartimaeusnek.bartworks.common.tileentities.BW_RotorBlock; +import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_AcidGenerator; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_Diode; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_EnergyDistributor; import cpw.mods.fml.common.registry.GameRegistry; @@ -61,6 +62,7 @@ public class ItemRegistry implements Runnable { public static final Item CombinedRotor = new BW_Stonage_Rotors(11, 0.22f, 1, 50, 5800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorCombined.png"), "BW_CombinedRotor", "rotors/itemRotorCombined"); public static final Item craftingParts = new SimpleSubItemClass(new String[]{"grindstone_top", "grindstone_bottom", "completed_grindstone", "rotors/leatherParts", "rotors/woolParts", "rotors/paperParts", "rotors/combinedParts"}); public static final Item tab = new SimpleIconItem("GT2Coin"); + public static final Item WINDMETER = new BW_SimpleWindMeter(); public static final Block[] BW_BLOCKS = { new BW_Blocks("BW_ItemBlocks", new String[] { @@ -86,6 +88,7 @@ public class ItemRegistry implements Runnable { public static ItemStack[] Diode12A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] Diode16A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] EnergyDistributor = new ItemStack[GT_Values.VN.length]; + public static ItemStack[] AcidGens = new ItemStack[3]; @Override public void run() { @@ -100,6 +103,7 @@ public class ItemRegistry implements Runnable { GameRegistry.registerItem(craftingParts, "craftingParts"); GameRegistry.registerTileEntity(BW_RotorBlock.class, "BWRotorBlockTE"); GameRegistry.registerBlock(ROTORBLOCK, "BWRotorBlock"); + GameRegistry.registerItem(WINDMETER, "BW_SimpleWindMeter"); for (int i = 0; i < GT_Values.VN.length; i++) { ItemRegistry.Diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "Cable Diode 2A " + GT_Values.VN[i], "Cable Diode 2A " + GT_Values.VN[i], i, 2).getStackForm(1L); @@ -110,6 +114,10 @@ public class ItemRegistry implements Runnable { ItemRegistry.EnergyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset + 1 + i, "Energy Distributor " + GT_Values.VN[i], "Energy Distributor " + GT_Values.VN[i], i, "Splits Amperage into several Sides").getStackForm(1L); } + for (int i = 0; i < 3; i++) { + ItemRegistry.AcidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "Acid Generator " + GT_Values.VN[i + 2], "Acid Generator " + GT_Values.VN[i + 2], i + 2, new String[]{"An Acid Generator", "Creates Power from Chemical Energy Potentials."}).getStackForm(1); + } + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 271f59c4c6..6a651b3c2b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -182,9 +182,42 @@ public class RecipeLoader implements Runnable { }); if (newStuff) { + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.WINDMETER), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{ + "SWF", + "Sf ", + "Ss ", + 'S', "stickWood", + 'W', new ItemStack(Blocks.wool, 1, Short.MAX_VALUE), + 'F', new ItemStack(Items.string), + } + ); + Materials[] cables = {Materials.Lead, Materials.Tin, Materials.AnnealedCopper, Materials.Gold, Materials.Aluminium, Materials.Tungsten, Materials.VanadiumGallium, Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; Materials[] hulls = {Materials.WroughtIron, Materials.Steel, Materials.Aluminium, Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, Materials.Chrome, Materials.Iridium, Materials.Osmium, Materials.Naquadah}; + ItemStack[] bats = {ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_Hull_MV.get(1L), ItemList.Battery_Hull_HV.get(1L)}; + ItemStack[] chreac = {ItemList.Machine_MV_ChemicalReactor.get(1L), ItemList.Machine_HV_ChemicalReactor.get(1L), ItemList.Machine_EV_ChemicalReactor.get(1L)}; + for (int i = 0; i < 3; i++) { + Materials cable = cables[i + 2]; + ItemStack machinehull = ItemList.MACHINE_HULLS[i + 2].get(1L); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.AcidGens[i], + RecipeLoader.BITSD, + new Object[]{ + "HRH", + "HCH", + "HKH", + 'H', bats[i], + 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt01, cable, 1L), + 'C', machinehull, + 'R', chreac[i] + } + ); + } for (int i = 0; i < GT_Values.VN.length; i++) { try { @@ -385,7 +418,7 @@ public class RecipeLoader implements Runnable { for (String stone : stones) { GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 0), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "SSS", "DfD", @@ -396,7 +429,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 1), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hDf", "SSS", @@ -406,7 +439,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 0), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "SSS", "DfD", @@ -417,7 +450,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 1), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hDf", "SSS", @@ -428,7 +461,7 @@ public class RecipeLoader implements Runnable { } GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 2), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "STS", "h f", @@ -441,7 +474,7 @@ public class RecipeLoader implements Runnable { } GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 2), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "STS", "h f", @@ -453,7 +486,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 3), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "WLs", "WLh", @@ -464,7 +497,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 4), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "WLs", "WLh", @@ -475,7 +508,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 5), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "WLs", "WLh", @@ -486,7 +519,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.craftingParts, 1, 6), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "WEs", "WZh", @@ -499,7 +532,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.LeatherRotor), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hPf", "PWP", @@ -510,7 +543,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.WoolRotor), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hPf", "PWP", @@ -521,7 +554,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.PaperRotor), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hPf", "PWP", @@ -532,7 +565,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CombinedRotor), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hPf", "PWP", @@ -553,7 +586,6 @@ public class RecipeLoader implements Runnable { 'G', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), } ); - //next free ID: ConfigHandler.IDOffset+GT_Values.VN.length*6+3 } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java new file mode 100644 index 0000000000..f893779b81 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities; + +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; + +public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGenerator { + + public GT_MetaTileEntity_AcidGenerator(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, aDescription, aTextures); + } + + public GT_MetaTileEntity_AcidGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public int getPollution() { + return 0; + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipes() { + return BWRecipes.instance.getMappingsFor((byte) 2); + } + + @Override + public int getEfficiency() { + return 100 - 3 * mTier; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_MetaTileEntity_AcidGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + + public ITexture[] getFront(byte aColor) { + return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + } + + public ITexture[] getBack(byte aColor) { + return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public ITexture[] getBottom(byte aColor) { + return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public ITexture[] getTop(byte aColor) { + return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT"))}; + } + + public ITexture[] getSides(byte aColor) { + return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public ITexture[] getFrontActive(byte aColor) { + return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + } + + public ITexture[] getBackActive(byte aColor) { + return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public ITexture[] getBottomActive(byte aColor) { + return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public ITexture[] getTopActive(byte aColor) { + return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE"))}; + } + + public ITexture[] getSidesActive(byte aColor) { + return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public boolean isOutputFacing(byte aSide) { + return aSide == this.getBaseMetaTileEntity().getFrontFacing(); + } + + public String[] getDescription() { + return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Efficiency: " + ChatColorHelper.YELLOW + getEfficiency(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks"}; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java index 31018d73f7..555d9f4511 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java @@ -24,14 +24,15 @@ package com.github.bartimaeusnek.bartworks.common.tileentities; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_Windmill; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.Dyes; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; +import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -53,6 +54,7 @@ import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; +import scala.actors.threadpool.Arrays; import java.util.ArrayList; @@ -91,6 +93,11 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { return true; } + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return true; + } + public boolean recipe_fallback(ItemStack aStack) { //sight... fallback to the macerator recipes GT_Recipe.GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; @@ -106,7 +113,18 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { if (new XSTR().nextInt(2) == 0) { if (tRecipe.getOutput(1) != null) mOutputItems[1] = tRecipe.getOutput(1); - else if (GT_OreDictUnificator.getAssociation(aStack) == null || GT_OreDictUnificator.getAssociation(aStack).mMaterial == null || GT_OreDictUnificator.getAssociation(aStack).mMaterial.mMaterial == null) + else if (GT_OreDictUnificator.getAssociation(aStack) == null || GT_OreDictUnificator.getAssociation(aStack).mMaterial == null || GT_OreDictUnificator.getAssociation(aStack).mMaterial.mMaterial == null || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Flint || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Sugar || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Wheat || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Wood || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Clay || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Ash || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Snow || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Stone || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.MeatRaw|| + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.MeatCooked + ) mOutputItems[1] = tRecipe.getOutput(0); } } @@ -168,7 +186,10 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.hardened_clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stained_hardened_clay)) { itemStack.stackSize -= 1; this.mMaxProgresstime = 60 * 20 * 100; - this.mOutputItems[0] = Materials.Clay.getDust(1); + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = Materials.Clay.getDust(2); + else + this.mOutputItems[0] = Materials.Clay.getDust(1); return true; } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.redstone_block)) { itemStack.stackSize -= 1; @@ -349,14 +370,12 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - /* * offset x1 = 3x3 * offset x2 = 5x5 * offset x3 = 7x7 * etc. */ - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 3; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 3; @@ -541,7 +560,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { "WxHxL: 7x12x7", "Layer 1: 7x7 Bricks, corners are air, controller at front centered.", "Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,", - "hollow, must contain at least one Dispenser", + "hollow, Wall must contain at least one Dispenser", "Layer 6: 5x5 Wood Planks. Corners are filled, hollow.", "Layer 7: 7x7 Wood Planks. Corners are air, hollow.", "Layer 8: 7x7 Wood Planks. Corners are air, hollow,", @@ -605,17 +624,22 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - ITexture[] ret = new ITexture[0]; + ITexture[] ret = new ITexture[6]; if (isClientSide()) { - iTextures[0] = new GT_RenderedTexture(iIconContainers[0], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); - ret = new ITexture[6]; - for (int i = 0; i < 6; i++) { - ret[i] = iTextures[0]; + Arrays.fill(ret, new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE)); + + if (aFacing == aSide || aSide == 0) { + iTextures[0] = new GT_RenderedTexture(iIconContainers[0]); + + ret = new ITexture[6]; + for (int i = 0; i < 6; i++) { + ret[i] = iTextures[0]; + } } if (aSide == 1) { - iTextures[1] = new GT_RenderedTexture(iIconContainers[1], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); + iTextures[1] = new GT_RenderedTexture(iIconContainers[1]); ret = new ITexture[6]; for (int i = 0; i < 6; i++) { @@ -624,8 +648,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { } } - - return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java index 53c009e973..2ba88bf4ee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -72,7 +72,9 @@ public class GT_Container_CircuitProgrammer extends Container { @Override public ItemStack slotClick(int slot, int button, int aShifthold, EntityPlayer entityPlayer) { if (slot > 0 && slot < 25 && ((Slot) this.inventorySlots.get(0)).getStack() != null) { - ((Slot) this.inventorySlots.get(0)).putStack(GT_Utility.getIntegratedCircuit(slot)); + ItemStack iCircuit = GT_Utility.getIntegratedCircuit(slot); + iCircuit.stackSize = 1; + ((Slot) this.inventorySlots.get(0)).putStack(iCircuit); detectAndSendChanges(); return ((Slot) this.inventorySlots.get(0)).getStack(); } @@ -92,7 +94,7 @@ public class GT_Container_CircuitProgrammer extends Container { Slot slot = (Slot) this.inventorySlots.get(SlotNR); if (slot != null && slot.getStack() != null && slot.getStack().getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) { if (chipslot.getStack() == null) { - chipslot.putStack(slot.getStack()); + chipslot.putStack(slot.getStack().copy()); slot.decrStackSize(1); } } @@ -100,7 +102,7 @@ public class GT_Container_CircuitProgrammer extends Container { for (int i = 25; i < this.inventorySlots.size(); i++) { if (((Slot) this.inventorySlots.get(i)).getStack() == null) { Slot empty = ((Slot) this.inventorySlots.get(i)); - empty.putStack(chipslot.getStack()); + empty.putStack(chipslot.getStack().copy()); chipslot.decrStackSize(1); break; } @@ -124,6 +126,7 @@ public class GT_Container_CircuitProgrammer extends Container { tag = this.toBind.getTagCompound(); if (tag.getBoolean("HasChip")) { Slot = GT_Utility.getIntegratedCircuit(tag.getByte("ChipConfig")); + Slot.stackSize = 1; } } @@ -168,6 +171,7 @@ public class GT_Container_CircuitProgrammer extends Container { } else if (BW_Util.checkStackAndPrefix(itemStack) && GT_OreDictUnificator.getAssociation(itemStack).mPrefix.equals(OrePrefixes.circuit) && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.equals(Materials.Basic)) { Slot = GT_Utility.getIntegratedCircuit(0); + Slot.stackSize = 1; itemStack.stackSize--; tag = toBind.getTagCompound(); tag.setBoolean("HasChip", true); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index f5f837cd0f..0dec15b274 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.util; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; @@ -37,6 +38,7 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; +import ic2.core.Ic2Items; import ic2.core.item.ItemFluidCell; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -56,7 +58,8 @@ public class BWRecipes { public static final BWRecipes instance = new BWRecipes(); public static final byte BIOLABBYTE = 0; public static final byte BACTERIALVATBYTE = 1; - private GT_Recipe.GT_Recipe_Map sBiolab = new GT_Recipe.GT_Recipe_Map( + public static final byte ACIDGENMAPBYTE = 2; + private final GT_Recipe.GT_Recipe_Map sBiolab = new GT_Recipe.GT_Recipe_Map( new HashSet(150), "bw.recipe.biolab", "Bio Lab", @@ -64,7 +67,7 @@ public class BWRecipes { "gregtech:textures/gui/basicmachines/BW.GUI.BioLab", 6, 2, 1, 1, 1, "", 1, "", true, true); - private BacteriaVatRecipeMap sBacteriaVat = new BacteriaVatRecipeMap( + private final BacteriaVatRecipeMap sBacteriaVat = new BacteriaVatRecipeMap( new HashSet(50), "bw.recipe.BacteriaVat", "Bacterial Vat", @@ -72,208 +75,232 @@ public class BWRecipes { "gregtech:textures/gui/basicmachines/Default", 6, 2, 0, 1, 1, "Need Sievert: ", 1, " Sv", true, true); + private final BW_Recipe_Map_LiquidFuel sAcidGenFuels = new BW_Recipe_Map_LiquidFuel( + new HashSet(10), + "bw.fuels.acidgens", + "Acid Generator", + null, + "gregtech:textures/gui/basicmachines/Default", + 1, 1, 1, 1, 1, + "EU generated: ", 1000, "", false, true + ); public BWRecipes() { - FluidStack[] dnaFluid = {Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L)}; - - for (ItemStack stack : BioItemList.getAllPetriDishes()) { - BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); - if (DNA != null) { - ItemStack Detergent = BioItemList.getOther(1); - ItemStack DNAFlask = BioItemList.getDNASampleFlask(null); - ItemStack EthanolCell = Materials.Ethanol.getCells(1); - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - stack, - DNAFlask, - Detergent, - EthanolCell - }, - new ItemStack[]{ - BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(DNA)), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L) - }, - BioItemList.mBioLabParts[0], - new int[]{DNA.getChance(), 10000}, - new FluidStack[]{ - FluidRegistry.getFluidStack("ic2distilledwater", 1000) - }, - null, - 500, - BW_Util.getMachineVoltageFromTier(3 + DNA.getTier()), - BW_Util.STANDART - ); + if (ConfigHandler.BioLab) { + FluidStack[] dnaFluid = {Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L)}; + + for (ItemStack stack : BioItemList.getAllPetriDishes()) { + BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); + if (DNA != null) { + ItemStack Detergent = BioItemList.getOther(1); + ItemStack DNAFlask = BioItemList.getDNASampleFlask(null); + ItemStack EthanolCell = Materials.Ethanol.getCells(1); + sBiolab.addFakeRecipe(false, + new ItemStack[]{ + stack, + DNAFlask, + Detergent, + EthanolCell + }, + new ItemStack[]{ + BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(DNA)), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L) + }, + BioItemList.mBioLabParts[0], + new int[]{DNA.getChance(), 10000}, + new FluidStack[]{ + FluidRegistry.getFluidStack("ic2distilledwater", 1000) + }, + null, + 500, + BW_Util.getMachineVoltageFromTier(3 + DNA.getTier()), + BW_Util.STANDART + ); + } } - } - for (ItemStack stack : BioItemList.getAllDNASampleFlasks()) { - BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound()); - - if (DNA != null) { - ItemStack Outp = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); - Behaviour_DataOrb.setDataName(Outp, DNA.getName()); - - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - stack, - FluidLoader.BioLabFluidCells[0], - FluidLoader.BioLabFluidCells[3], - ItemList.Tool_DataOrb.get(1L) - }, - new ItemStack[]{ - Outp, - ItemList.Cell_Universal_Fluid.get(2L) - }, - BioItemList.mBioLabParts[1], - new int[]{DNA.getChance(), 10000}, - dnaFluid, - null, - 500, - BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), - BW_Util.STANDART - ); + for (ItemStack stack : BioItemList.getAllDNASampleFlasks()) { + BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound()); + + if (DNA != null) { + ItemStack Outp = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); + Behaviour_DataOrb.setDataName(Outp, DNA.getName()); + + sBiolab.addFakeRecipe(false, + new ItemStack[]{ + stack, + FluidLoader.BioLabFluidCells[0], + FluidLoader.BioLabFluidCells[3], + ItemList.Tool_DataOrb.get(1L) + }, + new ItemStack[]{ + Outp, + ItemList.Cell_Universal_Fluid.get(2L) + }, + BioItemList.mBioLabParts[1], + new int[]{DNA.getChance(), 10000}, + dnaFluid, + null, + 500, + BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), + BW_Util.STANDART + ); + } } - } - for (ItemStack stack : BioItemList.getAllPlasmidCells()) { - BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound()); - - if (DNA != null) { - ItemStack inp = ItemList.Tool_DataOrb.get(0L); - Behaviour_DataOrb.setDataTitle(inp, "DNA Sample"); - Behaviour_DataOrb.setDataName(inp, DNA.getName()); - ItemStack inp2 = ItemList.Tool_DataOrb.get(0L); - Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); - Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); - - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - FluidLoader.BioLabFluidCells[1], - BioItemList.getPlasmidCell(null), - inp, - inp2 - }, - new ItemStack[]{ - stack, - ItemList.Cell_Universal_Fluid.get(1L) - }, - BioItemList.mBioLabParts[2], - new int[]{DNA.getChance(), 10000}, - dnaFluid, - null, - 500, - BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), - BW_Util.STANDART - ); + for (ItemStack stack : BioItemList.getAllPlasmidCells()) { + BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound()); + + if (DNA != null) { + ItemStack inp = ItemList.Tool_DataOrb.get(0L); + Behaviour_DataOrb.setDataTitle(inp, "DNA Sample"); + Behaviour_DataOrb.setDataName(inp, DNA.getName()); + ItemStack inp2 = ItemList.Tool_DataOrb.get(0L); + Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); + Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); + + sBiolab.addFakeRecipe(false, + new ItemStack[]{ + FluidLoader.BioLabFluidCells[1], + BioItemList.getPlasmidCell(null), + inp, + inp2 + }, + new ItemStack[]{ + stack, + ItemList.Cell_Universal_Fluid.get(1L) + }, + BioItemList.mBioLabParts[2], + new int[]{DNA.getChance(), 10000}, + dnaFluid, + null, + 500, + BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), + BW_Util.STANDART + ); + } } - } - //Transformation- [Distilled Water] + Culture () + Plasmids (Gene) Cell + Penicillin Cell= Culture (Gene) + Empty Cells - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - BioItemList.getPetriDish(null).setStackDisplayName("The Culture to change"), - BioItemList.getPlasmidCell(null).setStackDisplayName("The Plasmids to Inject"), - FluidLoader.BioLabFluidCells[2], - }, - new ItemStack[]{ - BioItemList.getPetriDish(null).setStackDisplayName("The changed Culture"), - ItemList.Cell_Universal_Fluid.get(1L) - }, - BioItemList.mBioLabParts[3], - new int[]{7500, 10000}, - new FluidStack[]{ - FluidRegistry.getFluidStack("ic2distilledwater", 1000) - }, - null, - 500, - BW_Util.getMachineVoltageFromTier(6), - BW_Util.STANDART - ); - - - ItemStack Outp = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); - Behaviour_DataOrb.setDataName(Outp, "Any DNA"); - //Clonal Cellular Synthesis- [Liquid DNA] + Medium Petri Dish + Plasma Membrane + Stem Cells + Genome Data - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - BioItemList.getPetriDish(null), - BioItemList.getOther(4), - ItemList.Circuit_Chip_Stemcell.get(2L), - Outp - }, - new ItemStack[]{ - BioItemList.getPetriDish(null).setStackDisplayName("The Culture made from DNA"), - }, - BioItemList.mBioLabParts[4], - new int[]{7500, 10000}, - new FluidStack[]{new FluidStack(dnaFluid[0].getFluid(), 9000)}, - null, - 500, - BW_Util.getMachineVoltageFromTier(6), - BW_Util.STANDART - ); - - FluidStack[] easyFluids = {Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000)}; - for (FluidStack fluidStack : easyFluids) { - for (BioCulture bioCulture : BioCulture.BIO_CULTURE_ARRAY_LIST) { - if (bioCulture.isBreedable() && bioCulture.getTier() == 0) { - sBacteriaVat.addRecipe( - //boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue - new BacteriaVatRecipe( - true, - new ItemStack[]{ - GT_Utility.getIntegratedCircuit(0), - new ItemStack(Items.sugar, 64) - }, - null, - BioItemList.getPetriDish(bioCulture), - null, - new FluidStack[]{ - fluidStack - }, - new FluidStack[]{ - new FluidStack(bioCulture.getFluid(), 10) - }, - 1000, - BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ), true - ); - //aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue - sBiolab.addRecipe( - new BioLabRecipe( - false, - new ItemStack[]{ - BioItemList.getPetriDish(null), - fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Water.getCells(1) : ItemFluidCell.getUniversalFluidCell(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) - }, - new ItemStack[]{ - BioItemList.getPetriDish(bioCulture), - fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Empty.getCells(1) : ItemList.Cell_Universal_Fluid.get(1L) - }, - null, - new int[]{ - bioCulture.getChance(), - 10000 - }, - new FluidStack[]{ - new FluidStack(bioCulture.getFluid(), 1000) - }, - null, - 500, - BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - )); + //Transformation- [Distilled Water] + Culture () + Plasmids (Gene) Cell + Penicillin Cell= Culture (Gene) + Empty Cells + sBiolab.addFakeRecipe(false, + new ItemStack[]{ + BioItemList.getPetriDish(null).setStackDisplayName("The Culture to change"), + BioItemList.getPlasmidCell(null).setStackDisplayName("The Plasmids to Inject"), + FluidLoader.BioLabFluidCells[2], + }, + new ItemStack[]{ + BioItemList.getPetriDish(null).setStackDisplayName("The changed Culture"), + ItemList.Cell_Universal_Fluid.get(1L) + }, + BioItemList.mBioLabParts[3], + new int[]{7500, 10000}, + new FluidStack[]{ + FluidRegistry.getFluidStack("ic2distilledwater", 1000) + }, + null, + 500, + BW_Util.getMachineVoltageFromTier(6), + BW_Util.STANDART + ); + + + ItemStack Outp = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); + Behaviour_DataOrb.setDataName(Outp, "Any DNA"); + //Clonal Cellular Synthesis- [Liquid DNA] + Medium Petri Dish + Plasma Membrane + Stem Cells + Genome Data + sBiolab.addFakeRecipe(false, + new ItemStack[]{ + BioItemList.getPetriDish(null), + BioItemList.getOther(4), + ItemList.Circuit_Chip_Stemcell.get(2L), + Outp + }, + new ItemStack[]{ + BioItemList.getPetriDish(null).setStackDisplayName("The Culture made from DNA"), + }, + BioItemList.mBioLabParts[4], + new int[]{7500, 10000}, + new FluidStack[]{new FluidStack(dnaFluid[0].getFluid(), 9000)}, + null, + 500, + BW_Util.getMachineVoltageFromTier(6), + BW_Util.STANDART + ); + + FluidStack[] easyFluids = {Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000)}; + for (FluidStack fluidStack : easyFluids) { + for (BioCulture bioCulture : BioCulture.BIO_CULTURE_ARRAY_LIST) { + if (bioCulture.isBreedable() && bioCulture.getTier() == 0) { + sBacteriaVat.addRecipe( + //boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue + new BacteriaVatRecipe( + true, + new ItemStack[]{ + GT_Utility.getIntegratedCircuit(0), + new ItemStack(Items.sugar, 64) + }, + null, + BioItemList.getPetriDish(bioCulture), + null, + new FluidStack[]{ + fluidStack + }, + new FluidStack[]{ + new FluidStack(bioCulture.getFluid(), 10) + }, + 1000, + BW_Util.getMachineVoltageFromTier(3), + BW_Util.STANDART + ), true + ); + //aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue + sBiolab.addRecipe( + new BioLabRecipe( + false, + new ItemStack[]{ + BioItemList.getPetriDish(null), + fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Water.getCells(1) : ItemFluidCell.getUniversalFluidCell(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) + }, + new ItemStack[]{ + BioItemList.getPetriDish(bioCulture), + fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Empty.getCells(1) : ItemList.Cell_Universal_Fluid.get(1L) + }, + null, + new int[]{ + bioCulture.getChance(), + 10000 + }, + new FluidStack[]{ + new FluidStack(bioCulture.getFluid(), 1000) + }, + null, + 500, + BW_Util.getMachineVoltageFromTier(3), + BW_Util.STANDART + )); + } } } } + + sAcidGenFuels.addLiquidFuel(Materials.PhosphoricAcid, 36); + sAcidGenFuels.addLiquidFuel(Materials.DilutedHydrochloricAcid, 14); + sAcidGenFuels.addLiquidFuel(Materials.HypochlorousAcid, 30); + sAcidGenFuels.addLiquidFuel(Materials.HydrofluoricAcid, 40); + sAcidGenFuels.addLiquidFuel(Materials.HydrochloricAcid, 28); + sAcidGenFuels.addLiquidFuel(Materials.NitricAcid, 24); + sAcidGenFuels.addLiquidFuel(Materials.Mercury, 32); + sAcidGenFuels.addLiquidFuel(Materials.DilutedSulfuricAcid, 9); + sAcidGenFuels.addLiquidFuel(Materials.SulfuricAcid, 18); + sAcidGenFuels.addLiquidFuel(Materials.AceticAcid, 11); + sAcidGenFuels.addMoltenFuel(Materials.Redstone, 10); } + /** - * @param machine 0 = biolab; 1 = BacterialVat + * @param machine 0 = biolab; 1 = BacterialVat; 2 = sAcidGenFuels * @return */ public GT_Recipe.GT_Recipe_Map getMappingsFor(byte machine) { @@ -282,6 +309,8 @@ public class BWRecipes { return sBiolab; case 1: return sBacteriaVat; + case 2: + return sAcidGenFuels; default: return null; } @@ -442,6 +471,26 @@ public class BWRecipes { return false; } + public static class BW_Recipe_Map_LiquidFuel extends GT_Recipe.GT_Recipe_Map_Fuel { + public BW_Recipe_Map_LiquidFuel(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + public GT_Recipe addLiquidFuel(Materials M, int burn) { + return super.addFuel(M.getCells(1), Materials.Empty.getCells(1), burn); + } + + public GT_Recipe addMoltenFuel(Materials M, int burn) { + return super.addFuel(ItemFluidCell.getUniversalFluidCell(M.getMolten(144L)), Ic2Items.FluidCell.copy(), burn); + } + + public GT_Recipe addLiquidFuel(FluidStack fluidStack, int burn) { + return super.addFuel(ItemFluidCell.getUniversalFluidCell(fluidStack), Ic2Items.FluidCell.copy(), burn); + } + + + } + class BioLabRecipe extends GT_Recipe { protected BioLabRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 23cb370e17..f81f0a533b 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -22,6 +22,7 @@ item.rotors.leatherParts.name=Leather Covered Wood Frame item.rotors.woolParts.name=Wool Covered Wood Frame item.rotors.paperParts.name=Paper Covered Wood Frame item.rotors.combinedParts.name=Multiple Material Covered Wood Frame +item.BW_SimpleWindMeter.name=Simple Wind Meter itemGroup.BioTab=BartWorks BioEngineering filled.item.petriDish.name=Petri Dish with a Culture diff --git a/src/main/resources/assets/bartworks/textures/items/BW_SimpleWindMeter.png b/src/main/resources/assets/bartworks/textures/items/BW_SimpleWindMeter.png new file mode 100644 index 0000000000..6b7f9a54d8 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/BW_SimpleWindMeter.png differ -- cgit From b67f9e359e554030387471c37cadff63336bd37f Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 18 Jan 2019 09:51:01 +0100 Subject: +fixes crash with GTNH Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> --- .../tileentities/GT_TileEntity_Windmill.java | 31 ++++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java index 555d9f4511..1be0c68da1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java @@ -64,7 +64,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { private static IIcon[] iIcons = new IIcon[2]; private static IIconContainer[] iIconContainers = new IIconContainer[2]; - private static ITexture[] iTextures = new ITexture[2]; + private static ITexture[] iTextures = new ITexture[3]; private final ArrayList tedList = new ArrayList(); private BW_RotorBlock rotorBlock; @@ -584,7 +584,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { - iIcons[0] = aBlockIconRegister.registerIcon("brick"); + iIcons[0] = Blocks.brick_block.getIcon(0,0); iIconContainers[0] = new IIconContainer() { @Override public IIcon getIcon() { @@ -593,7 +593,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @Override public IIcon getOverlayIcon() { - return iIcons[0]; + return null; } @Override @@ -611,7 +611,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @Override public IIcon getOverlayIcon() { - return iIcons[1]; + return null; } @Override @@ -619,6 +619,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { return new ResourceLocation(MainMod.modID + ":windmill_top"); } }; + + } @Override @@ -628,25 +630,26 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { if (isClientSide()) { - Arrays.fill(ret, new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE)); - if (aFacing == aSide || aSide == 0) { iTextures[0] = new GT_RenderedTexture(iIconContainers[0]); - ret = new ITexture[6]; - for (int i = 0; i < 6; i++) { - ret[i] = iTextures[0]; + for (int i = 0; i < ret.length; i++) { + ret[i]=iTextures[0]; } } - if (aSide == 1) { + else if (aSide == 1) { iTextures[1] = new GT_RenderedTexture(iIconContainers[1]); - ret = new ITexture[6]; - for (int i = 0; i < 6; i++) { - ret[i] = iTextures[1]; + for (int i = 0; i < ret.length; i++) { + ret[i]=iTextures[1]; + } + } + else{ + iTextures[2] = new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE); + for (int i = 0; i < ret.length; i++) { + ret[i]=iTextures[2]; } } - } return ret; } -- cgit From 46231d010c4bd603e909adcc5d5a17daa91bc78b Mon Sep 17 00:00:00 2001 From: ImgBotApp Date: Fri, 18 Jan 2019 21:47:52 +0000 Subject: [ImgBot] Optimize images *Total -- 37.80kb -> 17.70kb (53.17%) /src/main/resources/assets/bartworks/textures/items/petriDish.png -- 2.96kb -> 0.43kb (85.46%) /BWLogo.png -- 3.88kb -> 0.63kb (83.84%) /src/main/resources/assets/bartworks/textures/GT2/gui/Destructopack.png -- 3.49kb -> 0.89kb (74.56%) /src/main/resources/assets/bartworks/textures/items/rotors/rotorPaper.png -- 1.21kb -> 0.57kb (52.91%) /src/main/resources/assets/bartworks/textures/GUI/GUIPrimitiveKUBox.png -- 1.68kb -> 0.79kb (52.71%) /src/main/resources/assets/bartworks/textures/GT2/gui/LESU.png -- 2.21kb -> 1.13kb (48.9%) /src/main/resources/assets/bartworks/textures/GUI/GUI_CircuitP.png -- 2.79kb -> 1.43kb (48.67%) /src/main/resources/assets/bartworks/textures/GUI/GUI_RSC.png -- 2.54kb -> 1.31kb (48.44%) /src/main/resources/assets/bartworks/textures/blocks/TransformerCoil.png -- 2.36kb -> 1.22kb (48.28%) /src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png -- 2.00kb -> 1.07kb (46.53%) /src/main/resources/assets/bartworks/textures/GUI/RadHatch.png -- 2.22kb -> 1.19kb (46.52%) /src/main/resources/assets/bartworks/textures/items/rotors/rotorLeather.png -- 2.18kb -> 1.26kb (41.93%) /src/main/resources/assets/bartworks/textures/items/rotors/rotorWool.png -- 1.87kb -> 1.10kb (41.23%) /src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.BioLab.png -- 3.08kb -> 1.95kb (36.53%) /src/main/resources/assets/bartworks/textures/items/rotors/rotorCombined.png -- 2.82kb -> 2.24kb (20.68%) /src/main/resources/assets/bartworks/textures/items/rotors/paperParts.png -- 0.53kb -> 0.50kb (6.59%) --- BWLogo.png | Bin 3972 -> 642 bytes .../bartworks/textures/GT2/gui/Destructopack.png | Bin 3569 -> 908 bytes .../assets/bartworks/textures/GT2/gui/LESU.png | Bin 2266 -> 1158 bytes .../bartworks/textures/GUI/GUIPrimitiveKUBox.png | Bin 1717 -> 812 bytes .../assets/bartworks/textures/GUI/GUI_CircuitP.png | Bin 2856 -> 1466 bytes .../assets/bartworks/textures/GUI/GUI_RSC.png | Bin 2599 -> 1340 bytes .../assets/bartworks/textures/GUI/GUI_Windmill.png | Bin 2046 -> 1094 bytes .../assets/bartworks/textures/GUI/RadHatch.png | Bin 2270 -> 1214 bytes .../bartworks/textures/blocks/TransformerCoil.png | Bin 2415 -> 1249 bytes .../assets/bartworks/textures/items/petriDish.png | Bin 3033 -> 441 bytes .../bartworks/textures/items/rotors/paperParts.png | Bin 546 -> 510 bytes .../bartworks/textures/items/rotors/rotorCombined.png | Bin 2892 -> 2294 bytes .../bartworks/textures/items/rotors/rotorLeather.png | Bin 2230 -> 1295 bytes .../bartworks/textures/items/rotors/rotorPaper.png | Bin 1238 -> 583 bytes .../bartworks/textures/items/rotors/rotorWool.png | Bin 1911 -> 1123 bytes .../textures/gui/basicmachines/BW.GUI.BioLab.png | Bin 3151 -> 2000 bytes 16 files changed, 0 insertions(+), 0 deletions(-) diff --git a/BWLogo.png b/BWLogo.png index 79d6679842..61e1a41a95 100644 Binary files a/BWLogo.png and b/BWLogo.png differ diff --git a/src/main/resources/assets/bartworks/textures/GT2/gui/Destructopack.png b/src/main/resources/assets/bartworks/textures/GT2/gui/Destructopack.png index b4a5e95cfe..7c30308cc5 100644 Binary files a/src/main/resources/assets/bartworks/textures/GT2/gui/Destructopack.png and b/src/main/resources/assets/bartworks/textures/GT2/gui/Destructopack.png differ diff --git a/src/main/resources/assets/bartworks/textures/GT2/gui/LESU.png b/src/main/resources/assets/bartworks/textures/GT2/gui/LESU.png index d295b015f6..837692be60 100644 Binary files a/src/main/resources/assets/bartworks/textures/GT2/gui/LESU.png and b/src/main/resources/assets/bartworks/textures/GT2/gui/LESU.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/GUIPrimitiveKUBox.png b/src/main/resources/assets/bartworks/textures/GUI/GUIPrimitiveKUBox.png index 0e329e4ea3..aef2e1687b 100644 Binary files a/src/main/resources/assets/bartworks/textures/GUI/GUIPrimitiveKUBox.png and b/src/main/resources/assets/bartworks/textures/GUI/GUIPrimitiveKUBox.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/GUI_CircuitP.png b/src/main/resources/assets/bartworks/textures/GUI/GUI_CircuitP.png index 29cb0caf40..6ec05f5f55 100644 Binary files a/src/main/resources/assets/bartworks/textures/GUI/GUI_CircuitP.png and b/src/main/resources/assets/bartworks/textures/GUI/GUI_CircuitP.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/GUI_RSC.png b/src/main/resources/assets/bartworks/textures/GUI/GUI_RSC.png index 065a6fa929..dd561b81dd 100644 Binary files a/src/main/resources/assets/bartworks/textures/GUI/GUI_RSC.png and b/src/main/resources/assets/bartworks/textures/GUI/GUI_RSC.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png b/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png index d71477e9da..4237fa0636 100644 Binary files a/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png and b/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/RadHatch.png b/src/main/resources/assets/bartworks/textures/GUI/RadHatch.png index 1950ff0985..12922890d2 100644 Binary files a/src/main/resources/assets/bartworks/textures/GUI/RadHatch.png and b/src/main/resources/assets/bartworks/textures/GUI/RadHatch.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/TransformerCoil.png b/src/main/resources/assets/bartworks/textures/blocks/TransformerCoil.png index 349709d3ee..205816b31f 100644 Binary files a/src/main/resources/assets/bartworks/textures/blocks/TransformerCoil.png and b/src/main/resources/assets/bartworks/textures/blocks/TransformerCoil.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/petriDish.png b/src/main/resources/assets/bartworks/textures/items/petriDish.png index 4b151f9be8..467a79f19c 100644 Binary files a/src/main/resources/assets/bartworks/textures/items/petriDish.png and b/src/main/resources/assets/bartworks/textures/items/petriDish.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/rotors/paperParts.png b/src/main/resources/assets/bartworks/textures/items/rotors/paperParts.png index 5b09228578..c00616ed74 100644 Binary files a/src/main/resources/assets/bartworks/textures/items/rotors/paperParts.png and b/src/main/resources/assets/bartworks/textures/items/rotors/paperParts.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/rotors/rotorCombined.png b/src/main/resources/assets/bartworks/textures/items/rotors/rotorCombined.png index 4e97c01705..3171928a82 100644 Binary files a/src/main/resources/assets/bartworks/textures/items/rotors/rotorCombined.png and b/src/main/resources/assets/bartworks/textures/items/rotors/rotorCombined.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/rotors/rotorLeather.png b/src/main/resources/assets/bartworks/textures/items/rotors/rotorLeather.png index 388b43bd56..4d0b74c047 100644 Binary files a/src/main/resources/assets/bartworks/textures/items/rotors/rotorLeather.png and b/src/main/resources/assets/bartworks/textures/items/rotors/rotorLeather.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/rotors/rotorPaper.png b/src/main/resources/assets/bartworks/textures/items/rotors/rotorPaper.png index e9d1767a42..e60e68040f 100644 Binary files a/src/main/resources/assets/bartworks/textures/items/rotors/rotorPaper.png and b/src/main/resources/assets/bartworks/textures/items/rotors/rotorPaper.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/rotors/rotorWool.png b/src/main/resources/assets/bartworks/textures/items/rotors/rotorWool.png index d62caeba27..5cea540797 100644 Binary files a/src/main/resources/assets/bartworks/textures/items/rotors/rotorWool.png and b/src/main/resources/assets/bartworks/textures/items/rotors/rotorWool.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.BioLab.png b/src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.BioLab.png index fb9c0e113c..eb72a755d6 100644 Binary files a/src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.BioLab.png and b/src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.BioLab.png differ -- cgit From b04aef2f3d21c89172299141a8ba81fca0f6f237 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 20:10:16 +0100 Subject: code cleanup +added DEHP +added travis? +added sonarcloud? +version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> --- .travis.yml | 15 ++ build.gradle | 11 ++ build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 1 + .../bartworks/client/creativetabs/GT2Tab.java | 2 +- .../client/creativetabs/bartworksTab.java | 2 +- .../renderer/RendererSwitchingColorFluid.java | 2 +- .../bartworks/common/configs/ConfigHandler.java | 3 +- .../bartworks/common/items/LabParts.java | 5 +- .../bartworks/common/loaders/BioItemList.java | 4 +- .../bartworks/common/loaders/ItemRegistry.java | 85 +++++---- .../bartworks/common/loaders/RecipeLoader.java | 112 +++++++----- .../GT_MetaTileEntity_AcidGenerator.java | 3 +- .../tileentities/GT_MetaTileEntity_Diode.java | 3 +- .../GT_MetaTileEntity_EnergyDistributor.java | 3 +- .../tileentities/GT_MetaTileEntity_RadioHatch.java | 6 +- .../common/tileentities/GT_TileEntity_DEHP.java | 197 ++++++++++++++++++++- .../common/tileentities/GT_TileEntity_LESU.java | 4 + .../tileentities/GT_TileEntity_ManualTrafo.java | 2 +- .../tileentities/GT_TileEntity_Windmill.java | 21 +-- .../bartimaeusnek/bartworks/util/BW_Util.java | 61 +++++++ .../bartworks/util/NEIbartworksConfig.java | 2 +- 22 files changed, 420 insertions(+), 126 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..029ac46082 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: java +sudo: false +install: true + +addons: + sonarcloud: + organization: "sonarcloud" + token: + secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" + +jdk: + - oraclejdk8 + +script: +- ./gradlew sonarqube \ No newline at end of file diff --git a/build.gradle b/build.gradle index e9ae2df168..667680d955 100644 --- a/build.gradle +++ b/build.gradle @@ -16,6 +16,10 @@ buildscript { } } +plugins { + id "org.sonarqube" version "2.2" +} + apply plugin: 'forge' apply plugin: 'idea' apply plugin: 'signing' @@ -120,6 +124,13 @@ artifacts { archives apiJar } +sonarqube { + properties { + property "sonar.projectName", "bartworks" + property "sonar.projectKey", "bartimaeusnek_bartworks" + } +} + task signJar(dependsOn: 'reobf'){ doLast { ant.signjar( diff --git a/build.properties b/build.properties index e38d9e91d9..19a81a00dd 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=3 -buildNumber=16 +buildNumber=17 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 3f3fc8d9a5..a0364772af 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -82,6 +82,7 @@ public final class MainMod { @Mod.EventHandler public void init(FMLInitializationEvent init) { new LoaderRegistry().run(); + } @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java index 1d403a93d9..8f45b3d48d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java @@ -34,6 +34,6 @@ public class GT2Tab extends CreativeTabs { @Override public Item getTabIconItem() { - return ItemRegistry.tab; + return ItemRegistry.TAB; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java index f3e5e15882..c49fdb0aae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java @@ -34,7 +34,7 @@ public class bartworksTab extends CreativeTabs { @Override public Item getTabIconItem() { - return ItemRegistry.RockcutterHV; + return ItemRegistry.ROCKCUTTER_HV; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java index 15523b68f6..4f7a19e0c6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java @@ -64,7 +64,7 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler ++count; } } - if (end == 0.0f) { + if (end == 0.0f && count != 0) { end = total / count; } return end; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index b4f28fd33a..0db716071e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -39,6 +39,7 @@ public class ConfigHandler { public static boolean newStuff = true; public static boolean BioLab = true; public static Configuration c; + public static boolean DEHPDirectSteam = false; private static boolean ezmode = false; public ConfigHandler(@Nonnull FMLPreInitializationEvent e) { @@ -51,7 +52,7 @@ public class ConfigHandler { teslastaff = c.get("System", "Enable Teslastaff", false, "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); newStuff = !c.get("System", "Disable non-original-GT-stuff", false, "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false); BioLab = !c.get("System", "Disable BioLab", false, "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!").getBoolean(false); - + DEHPDirectSteam = c.get("Multiblocks", "DEHP Direct Steam Mode", false, "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant").getBoolean(false); if (ConfigHandler.IDOffset == 0) { ConfigHandler.IDOffset = 12600; c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java index 5fa2064026..da80a83eb3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -72,7 +72,10 @@ public class LabParts extends SimpleSubItemClass { @Override public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean b) { - if (itemStack == null || itemStack.getTagCompound() == null) { + if (itemStack == null) + return; + + if (itemStack.getTagCompound() == null) { switch (itemStack.getItemDamage()) { case 0: list.add("An empty Sterilized Petri Dish."); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java index 60614afde0..0c7b559b03 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java @@ -76,9 +76,9 @@ public class BioItemList { }, null, null, true, true); - private static final Item mItemBioLabParts = new LabModule(new String[]{"DNAExtractionModule", "PCRThermoclyclingModule", "PlasmidSynthesisModule", "TransformationModule", "ClonalCellularSynthesisModule"}); + private static final Item mItemBioLabParts = new LabModule(new String[]{"DNAExtractionModule", "PCRThermoclyclingModule", "PlasmidSynthesisModule", "TransformationModule", "ClonalCellularSynthesisModule" }); public static final ItemStack[] mBioLabParts = {new ItemStack(mItemBioLabParts), new ItemStack(mItemBioLabParts, 1, 1), new ItemStack(mItemBioLabParts, 1, 2), new ItemStack(mItemBioLabParts, 1, 3), new ItemStack(mItemBioLabParts, 1, 4)}; - private static final Item vanillaBioLabParts = new LabParts(new String[]{"petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", "IncubationModule", "PlasmaMembrane"}); + private static final Item vanillaBioLabParts = new LabParts(new String[]{"petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", "IncubationModule", "PlasmaMembrane" }); public BioItemList() { GameRegistry.registerItem(mItemBioLabParts, "BioLabModules"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index d90b99029d..4ca992e984 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -27,10 +27,7 @@ import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.items.*; -import com.github.bartimaeusnek.bartworks.common.tileentities.BW_RotorBlock; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_AcidGenerator; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_Diode; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_EnergyDistributor; +import com.github.bartimaeusnek.bartworks.common.tileentities.*; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -47,22 +44,23 @@ import static com.github.bartimaeusnek.bartworks.MainMod.BWT; import static com.github.bartimaeusnek.bartworks.MainMod.GT2; import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; -public class ItemRegistry implements Runnable { +public class ItemRegistry { - public static final Item Destructopack = new GT_Destructopack_Item(); - public static final Item Teslastaff = new GT_Teslastaff_Item(); - public static final Item RockcutterLV = new GT_Rockcutter_Item(1); - public static final Item RockcutterMV = new GT_Rockcutter_Item(2); - public static final Item RockcutterHV = new GT_Rockcutter_Item(3); - public static final Item CircuitProgrammer = new Circuit_Programmer(); + public static final Item DESTRUCTOPACK = new GT_Destructopack_Item(); + public static final Item TESLASTAFF = new GT_Teslastaff_Item(); + public static final Item ROCKCUTTER_LV = new GT_Rockcutter_Item(1); + public static final Item ROCKCUTTER_MV = new GT_Rockcutter_Item(2); + public static final Item ROCKCUTTER_HV = new GT_Rockcutter_Item(3); + public static final Item CIRCUIT_PROGRAMMER = new Circuit_Programmer(); public static final Block ROTORBLOCK = new BW_TileEntityContainer(Material.wood, BW_RotorBlock.class, "BWRotorBlock"); - public static final Item LeatherRotor = new BW_Stonage_Rotors(5, 0.15f, 15, 30, 2400, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorLeather.png"), "BW_LeatherRotor", "rotors/itemRotorLeather"); - public static final Item WoolRotor = new BW_Stonage_Rotors(7, 0.18f, 10, 20, 1600, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorWool.png"), "BW_WoolRotor", "rotors/itemRotorWool"); - public static final Item PaperRotor = new BW_Stonage_Rotors(9, 0.2f, 1, 10, 800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorPaper.png"), "BW_PaperRotor", "rotors/itemRotorPaper"); - public static final Item CombinedRotor = new BW_Stonage_Rotors(11, 0.22f, 1, 50, 5800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorCombined.png"), "BW_CombinedRotor", "rotors/itemRotorCombined"); - public static final Item craftingParts = new SimpleSubItemClass(new String[]{"grindstone_top", "grindstone_bottom", "completed_grindstone", "rotors/leatherParts", "rotors/woolParts", "rotors/paperParts", "rotors/combinedParts"}); - public static final Item tab = new SimpleIconItem("GT2Coin"); + public static final Item LEATHER_ROTOR = new BW_Stonage_Rotors(5, 0.15f, 15, 30, 2400, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorLeather.png"), "BW_LeatherRotor", "rotors/itemRotorLeather"); + public static final Item WOOL_ROTOR = new BW_Stonage_Rotors(7, 0.18f, 10, 20, 1600, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorWool.png"), "BW_WoolRotor", "rotors/itemRotorWool"); + public static final Item PAPER_ROTOR = new BW_Stonage_Rotors(9, 0.2f, 1, 10, 800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorPaper.png"), "BW_PaperRotor", "rotors/itemRotorPaper"); + public static final Item COMBINED_ROTOR = new BW_Stonage_Rotors(11, 0.22f, 1, 50, 5800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorCombined.png"), "BW_CombinedRotor", "rotors/itemRotorCombined"); + public static final Item CRAFTING_PARTS = new SimpleSubItemClass(new String[]{"grindstone_top", "grindstone_bottom", "completed_grindstone", "rotors/leatherParts", "rotors/woolParts", "rotors/paperParts", "rotors/combinedParts" }); + public static final Item TAB = new SimpleIconItem("GT2Coin"); public static final Item WINDMETER = new BW_SimpleWindMeter(); + public static ItemStack dehp; public static final Block[] BW_BLOCKS = { new BW_Blocks("BW_ItemBlocks", new String[] { @@ -82,42 +80,41 @@ public class ItemRegistry implements Runnable { }; - public static ItemStack[] Diode2A = new ItemStack[GT_Values.VN.length]; - public static ItemStack[] Diode4A = new ItemStack[GT_Values.VN.length]; - public static ItemStack[] Diode8A = new ItemStack[GT_Values.VN.length]; - public static ItemStack[] Diode12A = new ItemStack[GT_Values.VN.length]; - public static ItemStack[] Diode16A = new ItemStack[GT_Values.VN.length]; - public static ItemStack[] EnergyDistributor = new ItemStack[GT_Values.VN.length]; - public static ItemStack[] AcidGens = new ItemStack[3]; + public static ItemStack[] diode2A = new ItemStack[GT_Values.VN.length]; + public static ItemStack[] diode4A = new ItemStack[GT_Values.VN.length]; + public static ItemStack[] diode8A = new ItemStack[GT_Values.VN.length]; + public static ItemStack[] diode12A = new ItemStack[GT_Values.VN.length]; + public static ItemStack[] diode16A = new ItemStack[GT_Values.VN.length]; + public static ItemStack[] energyDistributor = new ItemStack[GT_Values.VN.length]; + public static ItemStack[] acidGens = new ItemStack[3]; - @Override - public void run() { + public static void run() { if (newStuff) { GameRegistry.registerBlock(BW_BLOCKS[2], BW_ItemBlocks.class, "BW_Machinery_Casings"); GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(BW_BLOCKS[2])); - GameRegistry.registerItem(LeatherRotor, "BW_LeatherRotor"); - GameRegistry.registerItem(WoolRotor, "BW_WoolRotor"); - GameRegistry.registerItem(PaperRotor, "BW_PaperRotor"); - GameRegistry.registerItem(CombinedRotor, "BW_CombinedRotor"); - GameRegistry.registerItem(craftingParts, "craftingParts"); + GameRegistry.registerItem(LEATHER_ROTOR, "BW_LeatherRotor"); + GameRegistry.registerItem(WOOL_ROTOR, "BW_WoolRotor"); + GameRegistry.registerItem(PAPER_ROTOR, "BW_PaperRotor"); + GameRegistry.registerItem(COMBINED_ROTOR, "BW_CombinedRotor"); + GameRegistry.registerItem(CRAFTING_PARTS, "craftingParts"); GameRegistry.registerTileEntity(BW_RotorBlock.class, "BWRotorBlockTE"); GameRegistry.registerBlock(ROTORBLOCK, "BWRotorBlock"); GameRegistry.registerItem(WINDMETER, "BW_SimpleWindMeter"); for (int i = 0; i < GT_Values.VN.length; i++) { - ItemRegistry.Diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "Cable Diode 2A " + GT_Values.VN[i], "Cable Diode 2A " + GT_Values.VN[i], i, 2).getStackForm(1L); - ItemRegistry.Diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "Cable Diode 4A " + GT_Values.VN[i], "Cable Diode 4A " + GT_Values.VN[i], i, 4).getStackForm(1L); - ItemRegistry.Diode8A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, "Cable Diode 8A " + GT_Values.VN[i], "Cable Diode 8A " + GT_Values.VN[i], i, 8).getStackForm(1L); - ItemRegistry.Diode12A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, "Cable Diode 12A " + GT_Values.VN[i], "Cable Diode 12A " + GT_Values.VN[i], i, 12).getStackForm(1L); - ItemRegistry.Diode16A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, "Cable Diode 16A " + GT_Values.VN[i], "Cable Diode 16A " + GT_Values.VN[i], i, 16).getStackForm(1L); - ItemRegistry.EnergyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset + 1 + i, "Energy Distributor " + GT_Values.VN[i], "Energy Distributor " + GT_Values.VN[i], i, "Splits Amperage into several Sides").getStackForm(1L); + ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "Cable Diode 2A " + GT_Values.VN[i], "Cable Diode 2A " + GT_Values.VN[i], i, 2).getStackForm(1L); + ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "Cable Diode 4A " + GT_Values.VN[i], "Cable Diode 4A " + GT_Values.VN[i], i, 4).getStackForm(1L); + ItemRegistry.diode8A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, "Cable Diode 8A " + GT_Values.VN[i], "Cable Diode 8A " + GT_Values.VN[i], i, 8).getStackForm(1L); + ItemRegistry.diode12A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, "Cable Diode 12A " + GT_Values.VN[i], "Cable Diode 12A " + GT_Values.VN[i], i, 12).getStackForm(1L); + ItemRegistry.diode16A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, "Cable Diode 16A " + GT_Values.VN[i], "Cable Diode 16A " + GT_Values.VN[i], i, 16).getStackForm(1L); + ItemRegistry.energyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset + 1 + i, "Energy Distributor " + GT_Values.VN[i], "Energy Distributor " + GT_Values.VN[i], i, "Splits Amperage into several Sides").getStackForm(1L); } for (int i = 0; i < 3; i++) { - ItemRegistry.AcidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "Acid Generator " + GT_Values.VN[i + 2], "Acid Generator " + GT_Values.VN[i + 2], i + 2, new String[]{"An Acid Generator", "Creates Power from Chemical Energy Potentials."}).getStackForm(1); + ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "Acid Generator " + GT_Values.VN[i + 2], "Acid Generator " + GT_Values.VN[i + 2], i + 2, new String[]{"An Acid Generator", "Creates Power from Chemical Energy Potentials." }).getStackForm(1); } - + dehp = new GT_TileEntity_DEHP(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump").getStackForm(1L); } @@ -125,11 +122,11 @@ public class ItemRegistry implements Runnable { GameRegistry.registerBlock(BW_BLOCKS[0], BW_ItemBlocks.class, "BW_ItemBlocks"); GameRegistry.registerBlock(BW_BLOCKS[1], BW_ItemBlocks.class, "GT_LESU_CASING"); if (ConfigHandler.teslastaff) - GameRegistry.registerItem(Teslastaff, Teslastaff.getUnlocalizedName()); + GameRegistry.registerItem(TESLASTAFF, TESLASTAFF.getUnlocalizedName()); - GameRegistry.registerItem(RockcutterLV, RockcutterLV.getUnlocalizedName()); - GameRegistry.registerItem(RockcutterMV, RockcutterMV.getUnlocalizedName()); - GameRegistry.registerItem(RockcutterHV, RockcutterHV.getUnlocalizedName()); - GameRegistry.registerItem(tab, "tabIconGT2"); + GameRegistry.registerItem(ROCKCUTTER_LV, ROCKCUTTER_LV.getUnlocalizedName()); + GameRegistry.registerItem(ROCKCUTTER_MV, ROCKCUTTER_MV.getUnlocalizedName()); + GameRegistry.registerItem(ROCKCUTTER_HV, ROCKCUTTER_HV.getUnlocalizedName()); + GameRegistry.registerItem(TAB, "tabIconGT2"); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 6a651b3c2b..5e191fbc8a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -27,6 +27,7 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_ManualTrafo; import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_Windmill; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -39,6 +40,7 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; @@ -103,7 +105,7 @@ public class RecipeLoader implements Runnable { }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.Destructopack), + new ItemStack(ItemRegistry.DESTRUCTOPACK), RecipeLoader.BITSD, new Object[]{ "CPC", @@ -115,7 +117,7 @@ public class RecipeLoader implements Runnable { }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.Destructopack), + new ItemStack(ItemRegistry.DESTRUCTOPACK), RecipeLoader.BITSD, new Object[]{ "CPC", @@ -127,7 +129,7 @@ public class RecipeLoader implements Runnable { }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.RockcutterMV), + new ItemStack(ItemRegistry.ROCKCUTTER_MV), RecipeLoader.BITSD, new Object[]{ "DS ", @@ -141,7 +143,7 @@ public class RecipeLoader implements Runnable { }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.RockcutterLV), + new ItemStack(ItemRegistry.ROCKCUTTER_LV), RecipeLoader.BITSD, new Object[]{ "DS ", @@ -155,7 +157,7 @@ public class RecipeLoader implements Runnable { }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.RockcutterHV), + new ItemStack(ItemRegistry.ROCKCUTTER_HV), RecipeLoader.BITSD, new Object[]{ "DS ", @@ -170,7 +172,7 @@ public class RecipeLoader implements Runnable { if (ConfigHandler.teslastaff) GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.Teslastaff), + new ItemStack(ItemRegistry.TESLASTAFF), RecipeLoader.BITSD, new Object[]{ "BO ", @@ -182,6 +184,22 @@ public class RecipeLoader implements Runnable { }); if (newStuff) { + if (!MainMod.GTNH) + GT_ModHandler.addCraftingRecipe( + ItemRegistry.dehp, + BITSD, + new Object[]{ + "GPG", + "NCN", + "GPG", + 'G', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 1L), + 'P', ItemList.Pump_IV.get(1L), + 'N', GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 1L), + 'C', ItemList.MACHINE_HULLS[5], + } + ); + else + GT_Values.RA.addAssemblylineRecipe(ItemList.Pump_IV.get(1L), 72000, new ItemStack[]{ItemList.Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 32L), GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 32L), ItemList.Field_Generator_LuV.get(8)}, new FluidStack[]{Materials.SolderingAlloy.getMolten(32 * 144), Materials.Polytetrafluoroethylene.getMolten(32 * 144)}, ItemRegistry.dehp, 5000, BW_Util.getMachineVoltageFromTier(6)); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.WINDMETER), @@ -205,7 +223,7 @@ public class RecipeLoader implements Runnable { Materials cable = cables[i + 2]; ItemStack machinehull = ItemList.MACHINE_HULLS[i + 2].get(1L); GT_ModHandler.addCraftingRecipe( - ItemRegistry.AcidGens[i], + ItemRegistry.acidGens[i], RecipeLoader.BITSD, new Object[]{ "HRH", @@ -226,7 +244,7 @@ public class RecipeLoader implements Runnable { ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); GT_ModHandler.addCraftingRecipe( - ItemRegistry.EnergyDistributor[i], + ItemRegistry.energyDistributor[i], RecipeLoader.BITSD, new Object[]{ "PWP", @@ -237,7 +255,7 @@ public class RecipeLoader implements Runnable { 'C', machinehull }); GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode12A[i], + ItemRegistry.diode12A[i], RecipeLoader.BITSD, new Object[]{ "WDW", @@ -250,7 +268,7 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode12A[i], + ItemRegistry.diode12A[i], RecipeLoader.BITSD, new Object[]{ "WDW", @@ -263,7 +281,7 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode8A[i], + ItemRegistry.diode8A[i], RecipeLoader.BITSD, new Object[]{ "WDW", @@ -276,7 +294,7 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode8A[i], + ItemRegistry.diode8A[i], RecipeLoader.BITSD, new Object[]{ "WDW", @@ -289,7 +307,7 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode4A[i], + ItemRegistry.diode4A[i], RecipeLoader.BITSD, new Object[]{ "WDW", @@ -302,7 +320,7 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode4A[i], + ItemRegistry.diode4A[i], RecipeLoader.BITSD, new Object[]{ "WDW", @@ -315,7 +333,7 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode2A[i], + ItemRegistry.diode2A[i], RecipeLoader.BITSD, new Object[]{ "WDW", @@ -328,7 +346,7 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode2A[i], + ItemRegistry.diode2A[i], RecipeLoader.BITSD, new Object[]{ "WDW", @@ -341,7 +359,7 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode16A[i], + ItemRegistry.diode16A[i], RecipeLoader.BITSD, new Object[]{ "WHW", @@ -355,7 +373,7 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - ItemRegistry.Diode16A[i], + ItemRegistry.diode16A[i], RecipeLoader.BITSD, new Object[]{ "WHW", @@ -396,7 +414,7 @@ public class RecipeLoader implements Runnable { } ); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), Materials.Aluminium.getPlates(1), ItemList.Circuit_Board_Plastic.get(1L), ItemList.Battery_RE_LV_Lithium.get(1L)}, Materials.SolderingAlloy.getMolten(288L), new ItemStack(ItemRegistry.CircuitProgrammer), 600, (int) (GT_Values.V[2] - (GT_Values.V[2] / 10))); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), Materials.Aluminium.getPlates(1), ItemList.Circuit_Board_Plastic.get(1L), ItemList.Battery_RE_LV_Lithium.get(1L)}, Materials.SolderingAlloy.getMolten(288L), new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER), 600, (int) (GT_Values.V[2] - (GT_Values.V[2] / 10))); GT_ModHandler.addCraftingRecipe( new GT_TileEntity_Windmill(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 2, "Windmill", "Windmill").getStackForm(1L), @@ -408,16 +426,16 @@ public class RecipeLoader implements Runnable { 'B', new ItemStack(Blocks.brick_block), 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), 'H', new ItemStack(Blocks.hopper), - 'G', new ItemStack(ItemRegistry.craftingParts, 1, 2), + 'G', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), } ); - String[] stones = {"stone", "stoneSmooth"}; - String[] granites = {"blockGranite", "stoneGranite", "Granite", "granite"}; + String[] stones = {"stone", "stoneSmooth" }; + String[] granites = {"blockGranite", "stoneGranite", "Granite", "granite" }; for (String granite : granites) { for (String stone : stones) { GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts, 1, 0), + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "SSS", @@ -428,7 +446,7 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts, 1, 1), + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hDf", @@ -438,7 +456,7 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts, 1, 0), + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "SSS", @@ -449,7 +467,7 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts, 1, 1), + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hDf", @@ -460,32 +478,32 @@ public class RecipeLoader implements Runnable { ); } GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts, 1, 2), + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "STS", "h f", "SBS", 'S', granite, - 'T', new ItemStack(ItemRegistry.craftingParts, 1, 0), - 'B', new ItemStack(ItemRegistry.craftingParts, 1, 1), + 'T', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), + 'B', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), } ); } GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts, 1, 2), + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "STS", "h f", "SBS", 'S', new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), - 'T', new ItemStack(ItemRegistry.craftingParts, 1, 0), - 'B', new ItemStack(ItemRegistry.craftingParts, 1, 1), + 'T', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), + 'B', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts, 1, 3), + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "WLs", @@ -496,7 +514,7 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts, 1, 4), + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "WLs", @@ -507,7 +525,7 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts, 1, 5), + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "WLs", @@ -518,59 +536,59 @@ public class RecipeLoader implements Runnable { } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.craftingParts, 1, 6), + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "WEs", "WZh", "WDf", - 'E', new ItemStack(ItemRegistry.craftingParts, 1, 3), - 'Z', new ItemStack(ItemRegistry.craftingParts, 1, 4), - 'D', new ItemStack(ItemRegistry.craftingParts, 1, 5), + 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', new ItemStack(Blocks.log, 1, OreDictionary.WILDCARD_VALUE), } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.LeatherRotor), + new ItemStack(ItemRegistry.LEATHER_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hPf", "PWP", "sPr", - 'P', new ItemStack(ItemRegistry.craftingParts, 1, 3), + 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.WoolRotor), + new ItemStack(ItemRegistry.WOOL_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hPf", "PWP", "sPr", - 'P', new ItemStack(ItemRegistry.craftingParts, 1, 4), + 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.PaperRotor), + new ItemStack(ItemRegistry.PAPER_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hPf", "PWP", "sPr", - 'P', new ItemStack(ItemRegistry.craftingParts, 1, 5), + 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), } ); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CombinedRotor), + new ItemStack(ItemRegistry.COMBINED_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "hPf", "PWP", "sPr", - 'P', new ItemStack(ItemRegistry.craftingParts, 1, 6), + 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), } ); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java index f893779b81..4d75f908b9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java @@ -107,7 +107,8 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene return aSide == this.getBaseMetaTileEntity().getFrontFacing(); } + @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Efficiency: " + ChatColorHelper.YELLOW + getEfficiency(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks"}; + return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Efficiency: " + ChatColorHelper.YELLOW + getEfficiency(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java index ab8ceacff9..a30ba65f1d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java @@ -57,7 +57,8 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { return new GT_MetaTileEntity_Diode(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } + @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks"}; + return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java index bbe86520f3..822c495887 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java @@ -68,8 +68,9 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans return 512L + (GT_Values.V[this.mTier] * 320L); } + @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks"}; + return new String[]{this.mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Amperage IN: " + ChatColorHelper.YELLOW + this.maxAmperesIn(), "Amperage OUT: " + ChatColorHelper.YELLOW + this.maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_RadioHatch.java index 619a025747..879d9f7fb1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_RadioHatch.java @@ -57,7 +57,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { private byte coverage = 0; public GT_MetaTileEntity_RadioHatch(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, new String[]{"Radioactive Item Chamber for Multiblocks", "Capacity: " + (aTier - 2) + " kg" + ((aTier - 2) >= 2 ? "s" : ""), "Use a screwdriver to set the containment level"}); + super(aID, aName, aNameRegional, aTier, 1, new String[]{"Radioactive Item Chamber for Multiblocks", "Capacity: " + (aTier - 2) + " kg" + ((aTier - 2) >= 2 ? "s" : ""), "Use a screwdriver to set the containment level" }); cap = aTier - 2; } @@ -251,7 +251,9 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @Override public String[] getInfoData() { - return new String[]{"Material: " + material, "Sievert: " + sievert, "Amount: " + mass, "Time (in t/s/m/h) to decay (1kg): " + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert) * 60)) + "t/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 + "s/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 + "m/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 / 60 + "h"}; + if (calcDecayTicks(this.sievert) != 0) + return new String[]{"Material: " + material, "Sievert: " + sievert, "Amount: " + mass, "Time (in t/s/m/h) to decay (1kg): " + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert) * 60)) + "t/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 + "s/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 + "m/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 / 60 + "h" }; + else return new String[]{"Material: Empty", "Sievert: 0", "Amount: 0" }; } public boolean isSimpleMachine() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java index 7e6f55a02b..adbb63e8d4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java @@ -22,27 +22,75 @@ package com.github.bartimaeusnek.bartworks.common.tileentities; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; +import ic2.core.block.reactor.tileentity.TileEntityNuclearReactorElectric; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; + +import java.lang.reflect.Field; +import java.util.Arrays; public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { + private byte mMode; + private byte mTier; + private static float nulearHeatMod = 2f; - public GT_TileEntity_DEHP(int aID, String aName, String aNameRegional) { + public GT_TileEntity_DEHP(int aID, int tier, String aName, String aNameRegional) { super(aID, aName, aNameRegional); + mTier= (byte) tier; } - public GT_TileEntity_DEHP(String aName) { + public GT_TileEntity_DEHP(String aName,byte mTier) { super(aName); + this.mTier= (byte) mTier; + } + + @Override + public void onConfigLoad(GT_Config aConfig) { + try { + Class c = TileEntityNuclearReactorElectric.class; + Field f = c.getDeclaredField("huOutputModifier"); + f.setAccessible(true); + nulearHeatMod = f.getFloat(f); + }catch (SecurityException | IllegalArgumentException | ExceptionInInitializerError | NullPointerException | IllegalAccessException | NoSuchFieldException e){ + e.printStackTrace(); + } + super.onConfigLoad(aConfig); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setByte("mTier",mTier); + aNBT.setByte("mMode",mMode); + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + mTier=aNBT.getByte("mTier"); + mMode=aNBT.getByte("mMode"); + super.loadNBTData(aNBT); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_TileEntity_DEHP(this.mName); + return new GT_TileEntity_DEHP(this.mName,mTier); } @Override @@ -52,7 +100,9 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override public String[] getDescription() { - return new String[0]; + String[] dscSteam = {"Controller Block for the Deep Earth Heat Pump " + (mTier > 1 ? mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + getCasingBlockItem().name(), "1x3x1 " + getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)","1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)","Consumes "+GT_Values.V[mTier+2]+"EU/t","Has 4 Modes, use the Screwdriver to change them:","0 Idle, 1 Steam, 2 Superheated Steam (requires Distilled Water), 3 Retract","Explodes when it runs out of Water/Distilled Water","Converts "+(long) (mTier*1200*20)+"L/s Water(minus 10% per Maintenance Problem) to Steam","Converts "+(long) (mTier*600*20)+"L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"}; + String[] dscCooleant = {"Controller Block for the Deep Earth Heat Pump " + (mTier > 1 ? mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + getCasingBlockItem().name(), "1x3x1 " + getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)","1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)","Consumes "+GT_Values.V[mTier+2]+"EU/t","Has 4 Modes, use the Screwdriver to change them:","0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract","Explodes when it runs out of Coolant","Heats up "+(long) (mTier*24*((double) nulearHeatMod))*20+"L/s Coolant(minus 10% per Maintenance Problem)"}; + return ConfigHandler.DEHPDirectSteam ? dscSteam : dscCooleant; } @Override @@ -67,12 +117,12 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override protected int getCasingTextureIndex() { - return 13; + return 11; } @Override protected int getMinTier() { - return 5; + return 2+mTier; } @Override @@ -80,9 +130,142 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { return !this.mMaintenanceHatches.isEmpty() && !this.mOutputHatches.isEmpty() && !this.mInputHatches.isEmpty(); } + private long getFluidFromHatches(Fluid f){ + long ret = 0; + for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches){ + if (ih.getFluid().getFluid().equals(f)) + ret += ih.getFluidAmount(); + } + return ret; + } + + private long getWaterFromHatches(boolean onlyDistilled){ + Fluid toConsume1 = FluidRegistry.WATER; + Fluid toConsume2 = GT_ModHandler.getDistilledWater(1L).getFluid(); + if (onlyDistilled) + toConsume1=toConsume2; + long ret = 0; + for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches){ + if (ih.getFluid().getFluid().equals(toConsume1) || ih.getFluid().getFluid().equals(toConsume2)) + ret += ih.getFluidAmount(); + } + return ret; + } + @Override - protected void setElectricityStats() { + protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + if (mMode != 3){ + this.isPickingPipes = false; + return true; + } + return super.workingUpward(aStack, xDrill, yDrill, zDrill, xPipe, zPipe, yHead, oldYHead); + } + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + ++mMode; + if (mMode >=4) + mMode = 0; + GT_Utility.sendChatToPlayer(aPlayer,"Mode: "+mMode); + super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + } + + protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + if (mMode==3){ + this.isPickingPipes = true; + return true; + } + + if (!this.tryLowerPipe()) { + if (this.waitForPipes()) { + return false; + } else { + if (ConfigHandler.DEHPDirectSteam) { + if (mMode==1) { + long steamProduced = (mTier * 600 * 2L * this.mEfficiency / 10000L); + long waterConsume = ((steamProduced + 160) / 160); + + if (getWaterFromHatches(false) - waterConsume > 0) { + consumeFluid(FluidRegistry.WATER,waterConsume); + addOutput(GT_ModHandler.getSteam(steamProduced)); + } else { + explodeMultiblock(); + return false; + } + } else if (mMode==2) { + long steamProduced = (mTier * 300 * 2L * this.mEfficiency / 10000L); + long waterConsume = ((steamProduced + 160) / 160); + + if (getWaterFromHatches(true) - waterConsume > 0) { + consumeFluid(GT_ModHandler.getDistilledWater(1).getFluid(),waterConsume); + addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", (int) steamProduced)); + } else { + explodeMultiblock(); + return false; + } + } + }else{ + if (mMode==1 || mMode==2) { + long coolantConverted = (long) (mTier*24*((double) nulearHeatMod)*this.mEfficiency / 10000L); + if (getFluidFromHatches(FluidRegistry.getFluid("ic2coolant"))-coolantConverted > 0){ + consumeFluid(FluidRegistry.getFluid("ic2coolant"),coolantConverted); + addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", (int) coolantConverted )); + } else { + explodeMultiblock(); + return false; + } + } + } + } + } else { + return true; + } + return true; + } + + private boolean consumeFluid(Fluid fluid,long ammount){ + + if (ammount> Integer.MAX_VALUE){ + int[] tmp = new int[(int) (ammount/Integer.MAX_VALUE)]; + Arrays.fill(tmp,(int) (ammount/Integer.MAX_VALUE)); + for (int i = 0; i < tmp.length; i++) { + for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches){ + if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid().getFluid().equals(fluid) ||ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) :ih.getFluid().getFluid().equals(fluid) ) + tmp[i] -= ih.drain((int) ammount,true).amount; + if (tmp[i] <= 0) + break; + } + } + + if (tmp[tmp.length-1] <= 0){ + return true; + } + + return false; + } + + long tmp = ammount; + for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches){ + if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid().getFluid().equals(fluid) ||ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) :ih.getFluid().getFluid().equals(fluid) ) + tmp -= ih.drain((int) ammount,true).amount; + if (tmp <= 0) + return true; + } + return false; + } + + @Override + protected void setElectricityStats() { + try { + this.mEUt=isPickingPipes ? 60 : Math.toIntExact(GT_Values.V[getMinTier()]); + }catch (ArithmeticException e){ + e.printStackTrace(); + this.mEUt = Integer.MAX_VALUE-7; + } + this.mProgresstime=0; + this.mMaxProgresstime=1; + this.mEfficiency = this.getCurrentEfficiency((ItemStack)null); + this.mEfficiencyIncrease = 10000; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java index cd88cfa5ec..f23fb5900e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java @@ -367,6 +367,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + long startingTime = System.nanoTime(); connectedcells = new ConnectedBlocksChecker(); connectedcells.get_connected(aBaseMetaTileEntity.getWorld(), aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), ItemRegistry.BW_BLOCKS[1]); @@ -394,6 +395,9 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { this.getBaseMetaTileEntity().enableWorking(); this.getBaseMetaTileEntity().setActive(true); + long finishedTime = System.nanoTime(); + if (finishedTime - startingTime > 5000000) + MainMod.logger.warn("LESU LookUp took longer than 5ms!(" + (finishedTime - startingTime) + "ns / " + ((finishedTime - startingTime) / 1000000) + "ms) Check at x:" + this.getBaseMetaTileEntity().getXCoord() + " y:" + this.getBaseMetaTileEntity().getYCoord() + " z:" + this.getBaseMetaTileEntity().getZCoord() + " DIM-ID: " + this.getBaseMetaTileEntity().getWorld().provider.dimensionId); return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java index 93fd85b502..5ae36c80da 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java @@ -348,7 +348,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase } } } - if (this.mDynamoHatches.size() <= 0 || this.mEnergyHatches.size() <= 0) + if (this.mDynamoHatches.isEmpty() || this.mEnergyHatches.isEmpty()) return false; return true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java index 1be0c68da1..aff4e196c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java @@ -54,7 +54,6 @@ import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; -import scala.actors.threadpool.Arrays; import java.util.ArrayList; @@ -122,7 +121,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Ash || BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Snow || BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Stone || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.MeatRaw|| + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.MeatRaw || BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.MeatCooked ) mOutputItems[1] = tRecipe.getOutput(0); @@ -579,12 +578,12 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @Override public String[] getInfoData() { - return new String[]{"Progress:", this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", Integer.toString(this.rotorBlock.getGrindPower()) + "KU/t"}; + return new String[]{"Progress:", this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", Integer.toString(this.rotorBlock.getGrindPower()) + "KU/t" }; } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { - iIcons[0] = Blocks.brick_block.getIcon(0,0); + iIcons[0] = Blocks.brick_block.getIcon(0, 0); iIconContainers[0] = new IIconContainer() { @Override public IIcon getIcon() { @@ -632,22 +631,18 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { if (aFacing == aSide || aSide == 0) { iTextures[0] = new GT_RenderedTexture(iIconContainers[0]); - ret = new ITexture[6]; for (int i = 0; i < ret.length; i++) { - ret[i]=iTextures[0]; + ret[i] = iTextures[0]; } - } - else if (aSide == 1) { + } else if (aSide == 1) { iTextures[1] = new GT_RenderedTexture(iIconContainers[1]); - ret = new ITexture[6]; for (int i = 0; i < ret.length; i++) { - ret[i]=iTextures[1]; + ret[i] = iTextures[1]; } - } - else{ + } else { iTextures[2] = new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE); for (int i = 0; i < ret.length; i++) { - ret[i]=iTextures[2]; + ret[i] = iTextures[2]; } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index ba5265904f..33b6615865 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import gregtech.api.enums.Materials; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; @@ -124,4 +125,64 @@ public class BW_Util { } } + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int diameter, int yLevel, int height, Block block, int offset, int aBaseCasingIndex) { + return check_layer(aBaseMetaTileEntity, diameter, yLevel, height, block, offset, false, aBaseCasingIndex); + } + + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int diameter, int yLevel, int height, Block block, int offset, boolean controllerLayer, int aBaseCasingIndex) { + return check_layer(aBaseMetaTileEntity, diameter, yLevel, height, block, offset, controllerLayer, false, aBaseCasingIndex); + } + + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int diameter, int yLevel, int height, Block block, int offset, boolean controllerLayer, boolean freeCorners, int aBaseCasingIndex) { + return check_layer(aBaseMetaTileEntity, diameter, yLevel, height, block, offset, controllerLayer, freeCorners, false, null, true, aBaseCasingIndex); + } + + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int diameter, int yLevel, int height, Block block, int offset, boolean controllerLayer, boolean insideCheck, Block inside, int aBaseCasingIndex) { + return check_layer(aBaseMetaTileEntity, diameter, yLevel, height, block, offset, controllerLayer, false, insideCheck, inside, true, aBaseCasingIndex); + } + + /** + * @param aBaseMetaTileEntity the Multiblock controller, usually a parameter + * @param diameter the diameter of the layer + * @param yLevel the starting y level of the Layer, referenced to the Multiblock + * @param height the height of the Layers, referenced to the Multiblock + * @param block the block for the walls + * @param offset the offset in most cases should be the same as the diameter + * @param controllerLayer if the layer contains the controller + * @param freeCorners if the corners should be checked + * @param insideCheck if the inside should be empty/filled + * @param inside which block should be inside + * @param allowHatches if hatches are allowed in this Layer + * @param aBaseCasingIndex the Index for the hatches texture + * @return if the layer check was completed + */ + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int diameter, int yLevel, int height, Block block, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck, Block inside, boolean allowHatches, int aBaseCasingIndex) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offset; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offset; + for (int x = -diameter; x < diameter; x++) { + for (int y = yLevel; y < height; y++) { + for (int z = -diameter; z < diameter; z++) { + if (freeCorners && (((Math.abs(x) == diameter && Math.abs(z) == diameter)))) + continue; + if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) + continue; + if (insideCheck && (Math.abs(x) < diameter && Math.abs(z) != diameter)) + if (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside)) + return false; + if (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block)) + if (!(allowHatches && ( + ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addDynamoToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || + ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || + ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || + ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || + ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || + ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) + ))) + return false; + } + } + } + return true; + } + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java index 770f5edfe5..9c6d12c7ba 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java @@ -49,7 +49,7 @@ public class NEIbartworksConfig implements IConfigureNEI { @Optional.Method(modid = "NotEnoughItems") @Override public void loadConfig() { - API.hideItem(new ItemStack(ItemRegistry.tab)); + API.hideItem(new ItemStack(ItemRegistry.TAB)); API.hideItem(new ItemStack(FluidLoader.bioFluidBlock)); API.hideItem(new ItemStack(BioItemList.bw_fake_glasses)); } -- cgit From e53cb74874e6cd22e30a3c2a032f07d43d06ebad Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 20:23:06 +0100 Subject: permission access for travis updated travis yml Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> --- .travis.yml | 12 +++++++++++- gradlew | 0 2 files changed, 11 insertions(+), 1 deletion(-) mode change 100644 => 100755 gradlew diff --git a/.travis.yml b/.travis.yml index 029ac46082..b01bbd03b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,16 @@ language: java sudo: false install: true +cache: + directories: + - "$HOME/.gradle/caches/2.14.1" + - "$HOME/.gradle/caches/jars-1" + - "$HOME/.gradle/caches/jars-2" + - "$HOME/.gradle/caches/jars-3" + - "$HOME/.gradle/native" + - "$HOME/.gradle/daemon" + - "$HOME/.gradle/wrapper" + - "$HOME/.gradle/minecraft" addons: sonarcloud: @@ -12,4 +22,4 @@ jdk: - oraclejdk8 script: -- ./gradlew sonarqube \ No newline at end of file +- gradlew sonarqube \ No newline at end of file diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 -- cgit From 27b5447574cc73ff1cfae1a0254160a9108d81b0 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 20:24:49 +0100 Subject: im an idiot. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b01bbd03b8..437d083000 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,4 +22,4 @@ jdk: - oraclejdk8 script: -- gradlew sonarqube \ No newline at end of file +- ./gradlew sonarqube \ No newline at end of file -- cgit From c552f5dd24b39aca2d126dfa848f3deb1bac80a2 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 20:30:45 +0100 Subject: added libs and gradlew wrapper for travis -_-' Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: e94770b7ffa7ca6fc2208b1134142191eaa0a682 --- .gitignore | 2 +- gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 51017 bytes libs/gregtech-5.09.32-dev.jar.REMOVED.git-id | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 libs/gregtech-5.09.32-dev.jar.REMOVED.git-id diff --git a/.gitignore b/.gitignore index 317f54dbb6..3f30d148b0 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,6 @@ .mtj.tmp/ # Package Files # -*.jar *.war *.nar *.ear @@ -27,6 +26,7 @@ *.lock *.sqlite + # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* /eclipse diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..b761216703 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/libs/gregtech-5.09.32-dev.jar.REMOVED.git-id b/libs/gregtech-5.09.32-dev.jar.REMOVED.git-id new file mode 100644 index 0000000000..4fa1e5f1b5 --- /dev/null +++ b/libs/gregtech-5.09.32-dev.jar.REMOVED.git-id @@ -0,0 +1 @@ +44c5cd845f848818d656a41ae2aacb83fa5275db \ No newline at end of file -- cgit From 01e8d861cee88167d0be2e5d9eb1d7fbf62d677c Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 20:53:41 +0100 Subject: hopefully fixed travis now? Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 1bf401e125c07689fc80b7cce464403fd9d6f08a --- .travis.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 437d083000..73bddd1ab9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ cache: addons: sonarcloud: - organization: "sonarcloud" + organization: "bartimaeusnek-github" token: secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" @@ -22,4 +22,12 @@ jdk: - oraclejdk8 script: -- ./gradlew sonarqube \ No newline at end of file +- ./gradlew sonarqube +- ./gradlew build + +deploy: + provider:releases + api_key: fZcmkACyjZv8rEjG9hjsNq6ZT/przBeSGYzdfpT55YV/xWXj18Lkqr4XfrY4GiTp/pJwOGYT5dUUybRSlMM3eSMWNcAjBOW7WuJDEkZIHPKTb5/H+SJgUeuxj0W7cTqANWvYlMaNv2WSQfV2UW09xvSuMJuVMUcng1E1AZj6hF5285DrbxygEiF0ZY77Rsq+Q3l29bJxrj+x5D8ui8m2rn2tug8+W5/iCxYLpNEQ0hLcxPOh/0GbdHtsett81F9CVW+aPnVE7AlVnGK6lftWfiwPHqglpbx7lwEr6/gHBFuJIasreP5+GJvMx0D96la4KRvREFfS4eAZXLG7Syx0zzVInf6SHtMtzVM7heIY/aEnZ8clYxfnOBw10hyuev4QUdCvBb0tndsrCBI4kEIqvvNVcpHatJyzr+q0gj7mvGsXu3DIN5teo6h6DBJrbuhS6QKM2Lm/FsrboeSfIFlXE94IORmQzH0evgbk8u+CER1VNvrRHBngfEqypGd06TbXVW/uvfCedpvOZ3ewuPhLqOZHCzXbjBDAf0xzIcwWIzkEcpT4hXujHexyGAPJVHZDO2KA/7oFWEks9gCdnSJ7Qet5VwsUyDHzsDACix5+9tiYc0CFyRcEuWsvfVCqYCs1NwDJcHH0KxFceah1UzvS+6QB5MFfR5uFxhgUA4qsMd0= + file: /build/libs/bartworks[1.7.10]-*.jar + skip_cleanup: true + \ No newline at end of file -- cgit From 3c257da8d0f16565332882b08b4c42952dee91e2 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 20:55:40 +0100 Subject: ffsssssss Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: bf35508c12a5be7850830a3d45d3144cb5c4ba31 --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 73bddd1ab9..06a7258248 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,12 +22,11 @@ jdk: - oraclejdk8 script: -- ./gradlew sonarqube -- ./gradlew build + -./gradlew sonarqube + -./gradlew build deploy: provider:releases api_key: fZcmkACyjZv8rEjG9hjsNq6ZT/przBeSGYzdfpT55YV/xWXj18Lkqr4XfrY4GiTp/pJwOGYT5dUUybRSlMM3eSMWNcAjBOW7WuJDEkZIHPKTb5/H+SJgUeuxj0W7cTqANWvYlMaNv2WSQfV2UW09xvSuMJuVMUcng1E1AZj6hF5285DrbxygEiF0ZY77Rsq+Q3l29bJxrj+x5D8ui8m2rn2tug8+W5/iCxYLpNEQ0hLcxPOh/0GbdHtsett81F9CVW+aPnVE7AlVnGK6lftWfiwPHqglpbx7lwEr6/gHBFuJIasreP5+GJvMx0D96la4KRvREFfS4eAZXLG7Syx0zzVInf6SHtMtzVM7heIY/aEnZ8clYxfnOBw10hyuev4QUdCvBb0tndsrCBI4kEIqvvNVcpHatJyzr+q0gj7mvGsXu3DIN5teo6h6DBJrbuhS6QKM2Lm/FsrboeSfIFlXE94IORmQzH0evgbk8u+CER1VNvrRHBngfEqypGd06TbXVW/uvfCedpvOZ3ewuPhLqOZHCzXbjBDAf0xzIcwWIzkEcpT4hXujHexyGAPJVHZDO2KA/7oFWEks9gCdnSJ7Qet5VwsUyDHzsDACix5+9tiYc0CFyRcEuWsvfVCqYCs1NwDJcHH0KxFceah1UzvS+6QB5MFfR5uFxhgUA4qsMd0= file: /build/libs/bartworks[1.7.10]-*.jar skip_cleanup: true - \ No newline at end of file -- cgit From fcb3d657af3b898467d5a6caad8d11ddd0275097 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 20:57:26 +0100 Subject: and again Former-commit-id: ea09791b0c108a5b7c245745feb50f491d0c594f --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 06a7258248..8a90862fda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,8 @@ script: deploy: provider:releases - api_key: fZcmkACyjZv8rEjG9hjsNq6ZT/przBeSGYzdfpT55YV/xWXj18Lkqr4XfrY4GiTp/pJwOGYT5dUUybRSlMM3eSMWNcAjBOW7WuJDEkZIHPKTb5/H+SJgUeuxj0W7cTqANWvYlMaNv2WSQfV2UW09xvSuMJuVMUcng1E1AZj6hF5285DrbxygEiF0ZY77Rsq+Q3l29bJxrj+x5D8ui8m2rn2tug8+W5/iCxYLpNEQ0hLcxPOh/0GbdHtsett81F9CVW+aPnVE7AlVnGK6lftWfiwPHqglpbx7lwEr6/gHBFuJIasreP5+GJvMx0D96la4KRvREFfS4eAZXLG7Syx0zzVInf6SHtMtzVM7heIY/aEnZ8clYxfnOBw10hyuev4QUdCvBb0tndsrCBI4kEIqvvNVcpHatJyzr+q0gj7mvGsXu3DIN5teo6h6DBJrbuhS6QKM2Lm/FsrboeSfIFlXE94IORmQzH0evgbk8u+CER1VNvrRHBngfEqypGd06TbXVW/uvfCedpvOZ3ewuPhLqOZHCzXbjBDAf0xzIcwWIzkEcpT4hXujHexyGAPJVHZDO2KA/7oFWEks9gCdnSJ7Qet5VwsUyDHzsDACix5+9tiYc0CFyRcEuWsvfVCqYCs1NwDJcHH0KxFceah1UzvS+6QB5MFfR5uFxhgUA4qsMd0= + api_key: + secure: "fZcmkACyjZv8rEjG9hjsNq6ZT/przBeSGYzdfpT55YV/xWXj18Lkqr4XfrY4GiTp/pJwOGYT5dUUybRSlMM3eSMWNcAjBOW7WuJDEkZIHPKTb5/H+SJgUeuxj0W7cTqANWvYlMaNv2WSQfV2UW09xvSuMJuVMUcng1E1AZj6hF5285DrbxygEiF0ZY77Rsq+Q3l29bJxrj+x5D8ui8m2rn2tug8+W5/iCxYLpNEQ0hLcxPOh/0GbdHtsett81F9CVW+aPnVE7AlVnGK6lftWfiwPHqglpbx7lwEr6/gHBFuJIasreP5+GJvMx0D96la4KRvREFfS4eAZXLG7Syx0zzVInf6SHtMtzVM7heIY/aEnZ8clYxfnOBw10hyuev4QUdCvBb0tndsrCBI4kEIqvvNVcpHatJyzr+q0gj7mvGsXu3DIN5teo6h6DBJrbuhS6QKM2Lm/FsrboeSfIFlXE94IORmQzH0evgbk8u+CER1VNvrRHBngfEqypGd06TbXVW/uvfCedpvOZ3ewuPhLqOZHCzXbjBDAf0xzIcwWIzkEcpT4hXujHexyGAPJVHZDO2KA/7oFWEks9gCdnSJ7Qet5VwsUyDHzsDACix5+9tiYc0CFyRcEuWsvfVCqYCs1NwDJcHH0KxFceah1UzvS+6QB5MFfR5uFxhgUA4qsMd0=" file: /build/libs/bartworks[1.7.10]-*.jar skip_cleanup: true + file_glob: true -- cgit From 2c1a0e8edc8af66118489411de4e2031ca340009 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 21:45:12 +0100 Subject: does it work now? Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 48b4082bd1f12cab99418e388b53f8726004eceb --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8a90862fda..f7653758ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,6 @@ jdk: script: -./gradlew sonarqube - -./gradlew build deploy: provider:releases -- cgit From a2c8893a497bf785c4a19a2219812dd3125074c8 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 22:16:42 +0100 Subject: redid travis file again -_-' Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: a54e0934354a13a10b34f0d3162ef86752c717b7 --- .travis.yml | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index f7653758ca..afa05bd6d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,23 +11,29 @@ cache: - "$HOME/.gradle/daemon" - "$HOME/.gradle/wrapper" - "$HOME/.gradle/minecraft" - addons: sonarcloud: organization: "bartimaeusnek-github" token: secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" - jdk: - - oraclejdk8 - -script: - -./gradlew sonarqube + - oraclejdk8 +jobs: + include: + stage: buildAndDeploy + script: + -./gradlew build + deploy: + provider: releases + api_key: + secure: "fZcmkACyjZv8rEjG9hjsNq6ZT/przBeSGYzdfpT55YV/xWXj18Lkqr4XfrY4GiTp/pJwOGYT5dUUybRSlMM3eSMWNcAjBOW7WuJDEkZIHPKTb5/H+SJgUeuxj0W7cTqANWvYlMaNv2WSQfV2UW09xvSuMJuVMUcng1E1AZj6hF5285DrbxygEiF0ZY77Rsq+Q3l29bJxrj+x5D8ui8m2rn2tug8+W5/iCxYLpNEQ0hLcxPOh/0GbdHtsett81F9CVW+aPnVE7AlVnGK6lftWfiwPHqglpbx7lwEr6/gHBFuJIasreP5+GJvMx0D96la4KRvREFfS4eAZXLG7Syx0zzVInf6SHtMtzVM7heIY/aEnZ8clYxfnOBw10hyuev4QUdCvBb0tndsrCBI4kEIqvvNVcpHatJyzr+q0gj7mvGsXu3DIN5teo6h6DBJrbuhS6QKM2Lm/FsrboeSfIFlXE94IORmQzH0evgbk8u+CER1VNvrRHBngfEqypGd06TbXVW/uvfCedpvOZ3ewuPhLqOZHCzXbjBDAf0xzIcwWIzkEcpT4hXujHexyGAPJVHZDO2KA/7oFWEks9gCdnSJ7Qet5VwsUyDHzsDACix5+9tiYc0CFyRcEuWsvfVCqYCs1NwDJcHH0KxFceah1UzvS+6QB5MFfR5uFxhgUA4qsMd0=" + file: /build/libs/bartworks[1.7.10]-*.jar + skip_cleanup: true + file_glob: true + on: + tags: false + stage: sonar + script: + -./gradlew sonarqube + -deploy: - provider:releases - api_key: - secure: "fZcmkACyjZv8rEjG9hjsNq6ZT/przBeSGYzdfpT55YV/xWXj18Lkqr4XfrY4GiTp/pJwOGYT5dUUybRSlMM3eSMWNcAjBOW7WuJDEkZIHPKTb5/H+SJgUeuxj0W7cTqANWvYlMaNv2WSQfV2UW09xvSuMJuVMUcng1E1AZj6hF5285DrbxygEiF0ZY77Rsq+Q3l29bJxrj+x5D8ui8m2rn2tug8+W5/iCxYLpNEQ0hLcxPOh/0GbdHtsett81F9CVW+aPnVE7AlVnGK6lftWfiwPHqglpbx7lwEr6/gHBFuJIasreP5+GJvMx0D96la4KRvREFfS4eAZXLG7Syx0zzVInf6SHtMtzVM7heIY/aEnZ8clYxfnOBw10hyuev4QUdCvBb0tndsrCBI4kEIqvvNVcpHatJyzr+q0gj7mvGsXu3DIN5teo6h6DBJrbuhS6QKM2Lm/FsrboeSfIFlXE94IORmQzH0evgbk8u+CER1VNvrRHBngfEqypGd06TbXVW/uvfCedpvOZ3ewuPhLqOZHCzXbjBDAf0xzIcwWIzkEcpT4hXujHexyGAPJVHZDO2KA/7oFWEks9gCdnSJ7Qet5VwsUyDHzsDACix5+9tiYc0CFyRcEuWsvfVCqYCs1NwDJcHH0KxFceah1UzvS+6QB5MFfR5uFxhgUA4qsMd0=" - file: /build/libs/bartworks[1.7.10]-*.jar - skip_cleanup: true - file_glob: true -- cgit From 3df70a0838de7e4fb23a1cb308f6c0affef21781 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 22:20:48 +0100 Subject: removed whitespaces o_o Former-commit-id: 537ebacc862fbcbafc3d1874b746930cc32539ab --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index afa05bd6d5..32bca17e63 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,6 +34,4 @@ jobs: tags: false stage: sonar script: - -./gradlew sonarqube - - + -./gradlew sonarqube \ No newline at end of file -- cgit From 5602fbf39b628e47ed5f71d9dbb94488b87e0d9d Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 22:24:15 +0100 Subject: moved sonar addon ._. Former-commit-id: b63a547b846fb4297ea641966008575640a581ed --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 32bca17e63..1233e05052 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,11 +11,6 @@ cache: - "$HOME/.gradle/daemon" - "$HOME/.gradle/wrapper" - "$HOME/.gradle/minecraft" -addons: - sonarcloud: - organization: "bartimaeusnek-github" - token: - secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" jdk: - oraclejdk8 jobs: @@ -33,5 +28,10 @@ jobs: on: tags: false stage: sonar + addons: + sonarcloud: + organization: "bartimaeusnek-github" + token: + secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" script: -./gradlew sonarqube \ No newline at end of file -- cgit From b36a349cfb3061b48be0c72727e0ab45553ef854 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 22:26:39 +0100 Subject: screw it. no sonar then. Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: e0fd2e50558340235450d2e87f34f4f7c59660df --- .travis.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1233e05052..991b38a462 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,12 +26,4 @@ jobs: skip_cleanup: true file_glob: true on: - tags: false - stage: sonar - addons: - sonarcloud: - organization: "bartimaeusnek-github" - token: - secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" - script: - -./gradlew sonarqube \ No newline at end of file + tags: false \ No newline at end of file -- cgit From 7560fe6305fe7c5f875087ddda8503d40b55a3b5 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 22:29:46 +0100 Subject: another whitespace issure >_> readded sonar then >_> Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 27632be2146104cbefc7ae92f3902fccb52d2832 --- .travis.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 991b38a462..cb866482ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ jobs: include: stage: buildAndDeploy script: - -./gradlew build + - ./gradlew build deploy: provider: releases api_key: @@ -26,4 +26,12 @@ jobs: skip_cleanup: true file_glob: true on: - tags: false \ No newline at end of file + tags: false + stage: sonar + addons: + sonarcloud: + organization: "bartimaeusnek-github" + token: + secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" + script: + - ./gradlew sonarqube \ No newline at end of file -- cgit From ac3fb4350238e6dc3db3a063718460df1668b056 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 22:42:24 +0100 Subject: switched sonarqube and deploy cause it didnt build the archives Former-commit-id: 814a8c09a0a43700355f9983b1975d9e570b28d3 --- .travis.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index cb866482ed..1cb38b2e19 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,9 +15,15 @@ jdk: - oraclejdk8 jobs: include: + stage: sonar + addons: + sonarcloud: + organization: "bartimaeusnek-github" + token: + secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" + script: "./gradlew sonarqube" stage: buildAndDeploy - script: - - ./gradlew build + script: "./gradlew build" deploy: provider: releases api_key: @@ -26,12 +32,4 @@ jobs: skip_cleanup: true file_glob: true on: - tags: false - stage: sonar - addons: - sonarcloud: - organization: "bartimaeusnek-github" - token: - secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" - script: - - ./gradlew sonarqube \ No newline at end of file + tags: false \ No newline at end of file -- cgit From 2365b652a68a126f67b92f90ab54ee6baafdd458 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 22:55:10 +0100 Subject: moved stuff inside of stages? maybe? Former-commit-id: fb33b0b7e592d1406061b00b4e7b84aae94c4d89 --- .travis.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1cb38b2e19..6be64b80b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,20 +16,20 @@ jdk: jobs: include: stage: sonar - addons: - sonarcloud: - organization: "bartimaeusnek-github" - token: + addons: + sonarcloud: + organization: "bartimaeusnek-github" + token: secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" - script: "./gradlew sonarqube" + script: "./gradlew sonarqube" stage: buildAndDeploy - script: "./gradlew build" - deploy: - provider: releases - api_key: - secure: "fZcmkACyjZv8rEjG9hjsNq6ZT/przBeSGYzdfpT55YV/xWXj18Lkqr4XfrY4GiTp/pJwOGYT5dUUybRSlMM3eSMWNcAjBOW7WuJDEkZIHPKTb5/H+SJgUeuxj0W7cTqANWvYlMaNv2WSQfV2UW09xvSuMJuVMUcng1E1AZj6hF5285DrbxygEiF0ZY77Rsq+Q3l29bJxrj+x5D8ui8m2rn2tug8+W5/iCxYLpNEQ0hLcxPOh/0GbdHtsett81F9CVW+aPnVE7AlVnGK6lftWfiwPHqglpbx7lwEr6/gHBFuJIasreP5+GJvMx0D96la4KRvREFfS4eAZXLG7Syx0zzVInf6SHtMtzVM7heIY/aEnZ8clYxfnOBw10hyuev4QUdCvBb0tndsrCBI4kEIqvvNVcpHatJyzr+q0gj7mvGsXu3DIN5teo6h6DBJrbuhS6QKM2Lm/FsrboeSfIFlXE94IORmQzH0evgbk8u+CER1VNvrRHBngfEqypGd06TbXVW/uvfCedpvOZ3ewuPhLqOZHCzXbjBDAf0xzIcwWIzkEcpT4hXujHexyGAPJVHZDO2KA/7oFWEks9gCdnSJ7Qet5VwsUyDHzsDACix5+9tiYc0CFyRcEuWsvfVCqYCs1NwDJcHH0KxFceah1UzvS+6QB5MFfR5uFxhgUA4qsMd0=" - file: /build/libs/bartworks[1.7.10]-*.jar - skip_cleanup: true - file_glob: true - on: - tags: false \ No newline at end of file + script: "./gradlew build" + deploy: + provider: releases + api_key: + secure: "fZcmkACyjZv8rEjG9hjsNq6ZT/przBeSGYzdfpT55YV/xWXj18Lkqr4XfrY4GiTp/pJwOGYT5dUUybRSlMM3eSMWNcAjBOW7WuJDEkZIHPKTb5/H+SJgUeuxj0W7cTqANWvYlMaNv2WSQfV2UW09xvSuMJuVMUcng1E1AZj6hF5285DrbxygEiF0ZY77Rsq+Q3l29bJxrj+x5D8ui8m2rn2tug8+W5/iCxYLpNEQ0hLcxPOh/0GbdHtsett81F9CVW+aPnVE7AlVnGK6lftWfiwPHqglpbx7lwEr6/gHBFuJIasreP5+GJvMx0D96la4KRvREFfS4eAZXLG7Syx0zzVInf6SHtMtzVM7heIY/aEnZ8clYxfnOBw10hyuev4QUdCvBb0tndsrCBI4kEIqvvNVcpHatJyzr+q0gj7mvGsXu3DIN5teo6h6DBJrbuhS6QKM2Lm/FsrboeSfIFlXE94IORmQzH0evgbk8u+CER1VNvrRHBngfEqypGd06TbXVW/uvfCedpvOZ3ewuPhLqOZHCzXbjBDAf0xzIcwWIzkEcpT4hXujHexyGAPJVHZDO2KA/7oFWEks9gCdnSJ7Qet5VwsUyDHzsDACix5+9tiYc0CFyRcEuWsvfVCqYCs1NwDJcHH0KxFceah1UzvS+6QB5MFfR5uFxhgUA4qsMd0=" + file: /build/libs/*.jar + skip_cleanup: true + file_glob: true + on: + tags: false \ No newline at end of file -- cgit From 7dfd711982e273864d1d82a776bf0cbcdf74db8e Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 22:59:33 +0100 Subject: okay that didnt worked. will this work? Former-commit-id: e1e8e492f6bc1326398c6dd4d966ec881872ae02 --- .travis.yml | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6be64b80b4..811668fe94 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,21 +15,22 @@ jdk: - oraclejdk8 jobs: include: - stage: sonar - addons: - sonarcloud: - organization: "bartimaeusnek-github" - token: - secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" - script: "./gradlew sonarqube" - stage: buildAndDeploy - script: "./gradlew build" - deploy: - provider: releases - api_key: - secure: "fZcmkACyjZv8rEjG9hjsNq6ZT/przBeSGYzdfpT55YV/xWXj18Lkqr4XfrY4GiTp/pJwOGYT5dUUybRSlMM3eSMWNcAjBOW7WuJDEkZIHPKTb5/H+SJgUeuxj0W7cTqANWvYlMaNv2WSQfV2UW09xvSuMJuVMUcng1E1AZj6hF5285DrbxygEiF0ZY77Rsq+Q3l29bJxrj+x5D8ui8m2rn2tug8+W5/iCxYLpNEQ0hLcxPOh/0GbdHtsett81F9CVW+aPnVE7AlVnGK6lftWfiwPHqglpbx7lwEr6/gHBFuJIasreP5+GJvMx0D96la4KRvREFfS4eAZXLG7Syx0zzVInf6SHtMtzVM7heIY/aEnZ8clYxfnOBw10hyuev4QUdCvBb0tndsrCBI4kEIqvvNVcpHatJyzr+q0gj7mvGsXu3DIN5teo6h6DBJrbuhS6QKM2Lm/FsrboeSfIFlXE94IORmQzH0evgbk8u+CER1VNvrRHBngfEqypGd06TbXVW/uvfCedpvOZ3ewuPhLqOZHCzXbjBDAf0xzIcwWIzkEcpT4hXujHexyGAPJVHZDO2KA/7oFWEks9gCdnSJ7Qet5VwsUyDHzsDACix5+9tiYc0CFyRcEuWsvfVCqYCs1NwDJcHH0KxFceah1UzvS+6QB5MFfR5uFxhgUA4qsMd0=" - file: /build/libs/*.jar - skip_cleanup: true - file_glob: true - on: - tags: false \ No newline at end of file + -stage: sonar + addons: + sonarcloud: + organization: "bartimaeusnek-github" + token: + secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" + script: "./gradlew sonarqube" + -stage: buildAndDeploy + script: "./gradlew build" + deploy: + provider: releases + api_key: + secure: "fZcmkACyjZv8rEjG9hjsNq6ZT/przBeSGYzdfpT55YV/xWXj18Lkqr4XfrY4GiTp/pJwOGYT5dUUybRSlMM3eSMWNcAjBOW7WuJDEkZIHPKTb5/H+SJgUeuxj0W7cTqANWvYlMaNv2WSQfV2UW09xvSuMJuVMUcng1E1AZj6hF5285DrbxygEiF0ZY77Rsq+Q3l29bJxrj+x5D8ui8m2rn2tug8+W5/iCxYLpNEQ0hLcxPOh/0GbdHtsett81F9CVW+aPnVE7AlVnGK6lftWfiwPHqglpbx7lwEr6/gHBFuJIasreP5+GJvMx0D96la4KRvREFfS4eAZXLG7Syx0zzVInf6SHtMtzVM7heIY/aEnZ8clYxfnOBw10hyuev4QUdCvBb0tndsrCBI4kEIqvvNVcpHatJyzr+q0gj7mvGsXu3DIN5teo6h6DBJrbuhS6QKM2Lm/FsrboeSfIFlXE94IORmQzH0evgbk8u+CER1VNvrRHBngfEqypGd06TbXVW/uvfCedpvOZ3ewuPhLqOZHCzXbjBDAf0xzIcwWIzkEcpT4hXujHexyGAPJVHZDO2KA/7oFWEks9gCdnSJ7Qet5VwsUyDHzsDACix5+9tiYc0CFyRcEuWsvfVCqYCs1NwDJcHH0KxFceah1UzvS+6QB5MFfR5uFxhgUA4qsMd0=" + file: build/libs/*.jar + skip_cleanup: true + file_glob: true + on: + repo: bartimausnek/bartworks + tags: false \ No newline at end of file -- cgit From b40483ef8a04680b49a39581d443e92088b6ea3a Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 23:05:31 +0100 Subject: how i do love whitespace based languages <_< Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 7db7d5d1a683fbab44a8a43e6f6b45d245f93513 --- .travis.yml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 811668fe94..1c9896515e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,25 +12,25 @@ cache: - "$HOME/.gradle/wrapper" - "$HOME/.gradle/minecraft" jdk: - - oraclejdk8 + - oraclejdk8 jobs: include: - -stage: sonar - addons: - sonarcloud: - organization: "bartimaeusnek-github" - token: - secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" - script: "./gradlew sonarqube" - -stage: buildAndDeploy - script: "./gradlew build" - deploy: - provider: releases - api_key: - secure: "fZcmkACyjZv8rEjG9hjsNq6ZT/przBeSGYzdfpT55YV/xWXj18Lkqr4XfrY4GiTp/pJwOGYT5dUUybRSlMM3eSMWNcAjBOW7WuJDEkZIHPKTb5/H+SJgUeuxj0W7cTqANWvYlMaNv2WSQfV2UW09xvSuMJuVMUcng1E1AZj6hF5285DrbxygEiF0ZY77Rsq+Q3l29bJxrj+x5D8ui8m2rn2tug8+W5/iCxYLpNEQ0hLcxPOh/0GbdHtsett81F9CVW+aPnVE7AlVnGK6lftWfiwPHqglpbx7lwEr6/gHBFuJIasreP5+GJvMx0D96la4KRvREFfS4eAZXLG7Syx0zzVInf6SHtMtzVM7heIY/aEnZ8clYxfnOBw10hyuev4QUdCvBb0tndsrCBI4kEIqvvNVcpHatJyzr+q0gj7mvGsXu3DIN5teo6h6DBJrbuhS6QKM2Lm/FsrboeSfIFlXE94IORmQzH0evgbk8u+CER1VNvrRHBngfEqypGd06TbXVW/uvfCedpvOZ3ewuPhLqOZHCzXbjBDAf0xzIcwWIzkEcpT4hXujHexyGAPJVHZDO2KA/7oFWEks9gCdnSJ7Qet5VwsUyDHzsDACix5+9tiYc0CFyRcEuWsvfVCqYCs1NwDJcHH0KxFceah1UzvS+6QB5MFfR5uFxhgUA4qsMd0=" - file: build/libs/*.jar - skip_cleanup: true - file_glob: true - on: - repo: bartimausnek/bartworks - tags: false \ No newline at end of file + - stage: sonar + addons: + sonarcloud: + organization: "bartimaeusnek-github" + token: + secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" + script: "./gradlew sonarqube" + - stage: buildAndDeploy + script: "./gradlew build" + deploy: + provider: releases + api_key: + secure: "fZcmkACyjZv8rEjG9hjsNq6ZT/przBeSGYzdfpT55YV/xWXj18Lkqr4XfrY4GiTp/pJwOGYT5dUUybRSlMM3eSMWNcAjBOW7WuJDEkZIHPKTb5/H+SJgUeuxj0W7cTqANWvYlMaNv2WSQfV2UW09xvSuMJuVMUcng1E1AZj6hF5285DrbxygEiF0ZY77Rsq+Q3l29bJxrj+x5D8ui8m2rn2tug8+W5/iCxYLpNEQ0hLcxPOh/0GbdHtsett81F9CVW+aPnVE7AlVnGK6lftWfiwPHqglpbx7lwEr6/gHBFuJIasreP5+GJvMx0D96la4KRvREFfS4eAZXLG7Syx0zzVInf6SHtMtzVM7heIY/aEnZ8clYxfnOBw10hyuev4QUdCvBb0tndsrCBI4kEIqvvNVcpHatJyzr+q0gj7mvGsXu3DIN5teo6h6DBJrbuhS6QKM2Lm/FsrboeSfIFlXE94IORmQzH0evgbk8u+CER1VNvrRHBngfEqypGd06TbXVW/uvfCedpvOZ3ewuPhLqOZHCzXbjBDAf0xzIcwWIzkEcpT4hXujHexyGAPJVHZDO2KA/7oFWEks9gCdnSJ7Qet5VwsUyDHzsDACix5+9tiYc0CFyRcEuWsvfVCqYCs1NwDJcHH0KxFceah1UzvS+6QB5MFfR5uFxhgUA4qsMd0=" + file: build/libs/*.jar + skip_cleanup: true + file_glob: true + on: + repo: bartimausnek/bartworks + tags: false \ No newline at end of file -- cgit From 7aa2c29f591565b9f35d9f269d1df8d60be9b9b6 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Jan 2019 23:14:28 +0100 Subject: removed deploy-on Former-commit-id: a3c762dcc924bf31adc2245c1e2b8a2802083a4d --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1c9896515e..66204e3e0f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,5 +32,4 @@ jobs: skip_cleanup: true file_glob: true on: - repo: bartimausnek/bartworks tags: false \ No newline at end of file -- cgit From 568783052da2bdf04f99bdfce31463e4bf943068 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 31 Jan 2019 06:49:16 +0100 Subject: hughe code refractor and hughe multis +added tooltip for Vat glas +enhanched code quality +moved glass from biolab -> new stuff +fixed diodes not working after restart +added MEBF and MVFZ +version number increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 379ceb4f37b53cb27be2f6882acf965a141d7591 --- build.properties | 2 +- .../bartworks/API/BioVatLogicAdder.java | 2 +- .../github/bartimaeusnek/bartworks/GuiHandler.java | 24 +- .../github/bartimaeusnek/bartworks/MainMod.java | 35 +- .../ClientEventHandler/ClientEventHandler.java | 62 ++ .../client/gui/BW_GUIContainer_RadLevel.java | 2 +- .../client/gui/BW_GUIContainer_RotorBlock.java | 2 +- .../client/gui/BW_GUIContainer_Windmill.java | 5 +- .../gui/GT_GUIContainer_CircuitProgrammer.java | 5 +- .../client/gui/GT_GUIContainer_Destructopack.java | 5 +- .../bartworks/client/gui/GT_GUIContainer_LESU.java | 7 +- .../client/gui/GT_GUIContainer_RadioHatch.java | 17 +- .../client/renderer/RendererGlasBlock.java | 7 +- .../renderer/RendererSwitchingColorFluid.java | 4 +- .../common/blocks/BW_TileEntityContainer.java | 2 +- .../bartworks/common/blocks/BioFluidBlock.java | 2 +- .../bartworks/common/configs/ConfigHandler.java | 4 +- .../bartworks/common/items/BW_ItemBlocks.java | 6 + .../bartworks/common/items/BW_SimpleWindMeter.java | 2 +- .../bartworks/common/items/BW_Stonage_Rotors.java | 2 +- .../bartworks/common/items/LabModule.java | 2 +- .../bartworks/common/items/LabParts.java | 2 +- .../bartworks/common/items/SimpleSubItemClass.java | 2 +- .../bartworks/common/loaders/BioItemList.java | 46 +- .../bartworks/common/loaders/BioRecipeLoader.java | 41 +- .../bartworks/common/loaders/FluidLoader.java | 2 +- .../bartworks/common/loaders/GTNHBlocks.java | 2 +- .../bartworks/common/loaders/ItemRegistry.java | 72 ++- .../bartworks/common/loaders/RecipeLoader.java | 45 +- .../bartworks/common/net/RendererPacket.java | 4 +- .../tileentities/BWTileEntityDimIDBridge.java | 28 - .../common/tileentities/BW_RotorBlock.java | 49 -- .../GT_MetaTileEntity_AcidGenerator.java | 114 ---- .../tileentities/GT_MetaTileEntity_BioLab.java | 262 -------- .../tileentities/GT_MetaTileEntity_Diode.java | 64 -- .../GT_MetaTileEntity_EnergyDistributor.java | 76 --- .../tileentities/GT_MetaTileEntity_RadioHatch.java | 317 ---------- .../common/tileentities/GT_TileEntity_BioVat.java | 674 --------------------- .../common/tileentities/GT_TileEntity_DEHP.java | 271 --------- .../common/tileentities/GT_TileEntity_LESU.java | 428 ------------- .../tileentities/GT_TileEntity_ManualTrafo.java | 458 -------------- .../tileentities/GT_TileEntity_Windmill.java | 657 -------------------- .../classic/BWTileEntityDimIDBridge.java | 28 + .../common/tileentities/classic/BW_RotorBlock.java | 49 ++ .../tileentities/multis/GT_TileEntity_BioVat.java | 625 +++++++++++++++++++ .../tileentities/multis/GT_TileEntity_DEHP.java | 270 +++++++++ .../tileentities/multis/GT_TileEntity_LESU.java | 428 +++++++++++++ .../multis/GT_TileEntity_ManualTrafo.java | 457 ++++++++++++++ .../multis/GT_TileEntity_Windmill.java | 658 ++++++++++++++++++++ .../mega/GT_TileEntity_MegaBlastFurnace.java | 303 +++++++++ .../mega/GT_TileEntity_MegaVacuumFreezer.java | 131 ++++ .../tiered/GT_MetaTileEntity_AcidGenerator.java | 114 ++++ .../tiered/GT_MetaTileEntity_BioLab.java | 262 ++++++++ .../tiered/GT_MetaTileEntity_Diode.java | 94 +++ .../GT_MetaTileEntity_EnergyDistributor.java | 76 +++ .../tiered/GT_MetaTileEntity_RadioHatch.java | 317 ++++++++++ .../tiered/GT_MetaTileEntity_Transistor.java | 153 +++++ .../server/container/BW_Container_RadioHatch.java | 2 +- .../server/container/GT_Container_RadioHatch.java | 2 +- .../bartimaeusnek/bartworks/util/BW_Util.java | 185 +++++- .../bartimaeusnek/bartworks/util/BioCulture.java | 2 +- .../bartworks/util/NEIbartworksConfig.java | 7 +- 62 files changed, 4394 insertions(+), 3582 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BWTileEntityDimIDBridge.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BW_RotorBlock.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_BioLab.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_RadioHatch.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_BioVat.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java diff --git a/build.properties b/build.properties index 19a81a00dd..790f06e74f 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=3 -buildNumber=17 +buildNumber=18 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java index 483b4a67e2..81b0d894af 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -94,7 +94,7 @@ public final class BioVatLogicAdder { if (ret) BioVatGlass.glasses.put(new BlockMetaPair(block, (byte) meta), (byte) tier); else - MainMod.logger.warn("Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!"); + MainMod.LOGGER.warn("Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!"); block = null; return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java index f45ac86579..00b9317d5a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_Destructopa import com.github.bartimaeusnek.bartworks.server.container.BW_Container_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_CircuitProgrammer; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_Item_Destructopack; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.network.IGuiHandler; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.EntityPlayer; @@ -54,18 +55,21 @@ public class GuiHandler implements IGuiHandler { @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - switch (ID) { - case 0: - return new GT_GUIContainer_Destructopack(player.inventory); - case 1: - return new GT_GUIContainer_CircuitProgrammer(player.inventory); - case 2: { - if (world.getTileEntity(x, y, z) instanceof IGregTechTileEntity) { - IGregTechTileEntity te = (IGregTechTileEntity) world.getTileEntity(x, y, z); - return new BW_GUIContainer_RadLevel(new BW_Container_RadioHatch(player.inventory, te.getMetaTileEntity())); + if (FMLCommonHandler.instance().getSide().isClient()) { + switch (ID) { + case 0: + return new GT_GUIContainer_Destructopack(player.inventory); + case 1: + return new GT_GUIContainer_CircuitProgrammer(player.inventory); + case 2: { + if (world.getTileEntity(x, y, z) instanceof IGregTechTileEntity) { + IGregTechTileEntity te = (IGregTechTileEntity) world.getTileEntity(x, y, z); + return new BW_GUIContainer_RadLevel(new BW_Container_RadioHatch(player.inventory, te.getMetaTileEntity())); + } } } - } + } else + return getServerGuiElement(ID, player, world, x, y, z); return null; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index a0364772af..52b282646f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -23,6 +23,8 @@ package com.github.bartimaeusnek.bartworks; +import com.github.bartimaeusnek.bartworks.API.API_REFERENCE; +import com.github.bartimaeusnek.bartworks.client.ClientEventHandler.ClientEventHandler; import com.github.bartimaeusnek.bartworks.client.creativetabs.BioTab; import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab; @@ -30,6 +32,7 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -37,37 +40,40 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; +import gregtech.api.enums.Materials; +import gregtech.api.enums.SubTag; import net.minecraft.creativetab.CreativeTabs; +import net.minecraftforge.common.MinecraftForge; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import static com.github.bartimaeusnek.bartworks.API.API_REFERENCE.VERSION; - @Mod( - modid = MainMod.modID, name = MainMod.name, version = MainMod.version, + modid = MainMod.MOD_ID, name = MainMod.NAME, version = MainMod.VERSION, dependencies = "required-after:IC2; " + "required-after:gregtech; " ) public final class MainMod { - public static final String name = "BartWorks"; - public static final String version = "@version@"; - public static final String modID = "bartworks"; - public static final Logger logger = LogManager.getLogger(name); + public static final String NAME = "BartWorks"; + public static final String VERSION = "@version@"; + public static final String MOD_ID = "bartworks"; + public static final Logger LOGGER = LogManager.getLogger(NAME); public static final CreativeTabs GT2 = new GT2Tab("GT2C"); - public static final CreativeTabs BioTab = new BioTab("BioTab"); + public static final CreativeTabs BIO_TAB = new BioTab("BioTab"); public static final CreativeTabs BWT = new bartworksTab("bartworks"); public static final IGuiHandler GH = new GuiHandler(); public static boolean GTNH = false; - @Mod.Instance(modID) + @Mod.Instance(MOD_ID) public static MainMod instance; public static ConfigHandler CHandler; public static BW_Network BW_Network_instance = new BW_Network(); @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { - if (!(VERSION.equals(version))) { - logger.error("Something has loaded an old API. Please contact the Mod authors to update!"); + //fixing BorosilicateGlass... -_-' + Materials.BorosilicateGlass.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); + if (!(API_REFERENCE.VERSION.equals(VERSION))) { + LOGGER.error("Something has loaded an old API. Please contact the Mod authors to update!"); } if (Loader.isModLoaded("dreamcraft")) { @@ -75,14 +81,14 @@ public final class MainMod { } CHandler = new ConfigHandler(preinit); if (GTNH) - logger.info("GTNH-Detected . . . ACTIVATE HARDMODE."); - + LOGGER.info("GTNH-Detected . . . ACTIVATE HARDMODE."); } @Mod.EventHandler public void init(FMLInitializationEvent init) { + if (FMLCommonHandler.instance().getSide().isClient() && ConfigHandler.BioLab) + MinecraftForge.EVENT_BUS.register(new ClientEventHandler()); new LoaderRegistry().run(); - } @Mod.EventHandler @@ -91,5 +97,4 @@ public final class MainMod { if (ConfigHandler.BioLab) new GTNHBlocks().run(); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java new file mode 100644 index 0000000000..377632c4ba --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.client.ClientEventHandler; + +import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.GT_Values; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraftforge.event.entity.player.ItemTooltipEvent; + +import java.util.HashMap; + +@SideOnly(Side.CLIENT) +public class ClientEventHandler { + + @SideOnly(Side.CLIENT) + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void getTooltip(ItemTooltipEvent event) { + if (event.itemStack == null || event.itemStack.getItem() == null || Block.getBlockFromItem(event.itemStack.getItem()) == null || event.itemStack.getItemDamage() > 127) + return; + + final Block BLOCK = Block.getBlockFromItem(event.itemStack.getItem()); + if (BLOCK instanceof BW_Blocks) { + return; + } + final BioVatLogicAdder.BlockMetaPair PAIR = new BioVatLogicAdder.BlockMetaPair(BLOCK, (byte) event.itemStack.getItemDamage()); + final HashMap GLASSMAP = BioVatLogicAdder.BioVatGlass.getGlassMap(); + if (GLASSMAP.containsKey(PAIR)) { + int tier = GLASSMAP.get(PAIR); + event.toolTip.add("Glass-Tier: " + BW_Util.getColorForTier(tier) + GT_Values.VN[tier] + ChatColorHelper.RESET); + } else if (BLOCK.getMaterial().equals(Material.glass)) { + event.toolTip.add("Glass-Tier: " + BW_Util.getColorForTier(3) + GT_Values.VN[3] + ChatColorHelper.RESET); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java index 91dfa14c28..bdffce07ee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java @@ -44,7 +44,7 @@ public class BW_GUIContainer_RadLevel extends GuiContainer { @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { GL11.glColor3f(1, 1, 1); - this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.modID, "textures/GUI/GUI_RSC.png")); + this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUI_RSC.png")); drawTexturedModalRect(guiLeft - 79, guiTop, 0, 0, 256, 165); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java index 61b87019e3..0ad5c5982f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java @@ -64,7 +64,7 @@ public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator { protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { GL11.glColor3f(0.5f, 0.25f, 0.07f); - this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.modID, "textures/GUI/GUIPrimitiveKUBox.png")); + this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUIPrimitiveKUBox.png")); int j = (this.width - this.xSize) / 2; int k = (this.height - this.ySize) / 2; this.drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java index 09dec26e2b..df4d721b02 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java @@ -23,6 +23,8 @@ package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_Container_MultiMachine; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -30,6 +32,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; +@SideOnly(Side.CLIENT) public class BW_GUIContainer_Windmill extends GT_GUIContainer_MultiMachine { public BW_GUIContainer_Windmill(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { @@ -46,7 +49,7 @@ public class BW_GUIContainer_Windmill extends GT_GUIContainer_MultiMachine { protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor3f(0.5f, 0.25f, 0.07f); - this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.modID, "textures/GUI/GUI_Windmill.png")); + this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUI_Windmill.png")); int x = (this.width - this.xSize) / 2; int y = (this.height - this.ySize) / 2; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java index 2a699035f4..34574929db 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java @@ -24,15 +24,18 @@ package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_CircuitProgrammer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; +@SideOnly(Side.CLIENT) public class GT_GUIContainer_CircuitProgrammer extends GuiContainer { - public static final ResourceLocation texture = new ResourceLocation(MainMod.modID, "textures/GUI/GUI_CircuitP.png"); + public static final ResourceLocation texture = new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUI_CircuitP.png"); public GT_GUIContainer_CircuitProgrammer(InventoryPlayer p_i1072_1_) { super(new GT_Container_CircuitProgrammer(p_i1072_1_)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java index feaf22fcc1..c1998f4bfe 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java @@ -24,14 +24,17 @@ package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_Item_Destructopack; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; +@SideOnly(Side.CLIENT) public class GT_GUIContainer_Destructopack extends GuiContainer { - public static final ResourceLocation texture = new ResourceLocation(MainMod.modID, "textures/GT2/gui/Destructopack.png"); + public static final ResourceLocation texture = new ResourceLocation(MainMod.MOD_ID, "textures/GT2/gui/Destructopack.png"); public GT_GUIContainer_Destructopack(InventoryPlayer inventory) { super(new GT_Container_Item_Destructopack(inventory)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java index 1378d9e943..8b96ba44fb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -24,8 +24,10 @@ package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_LESU; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_LESU; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_GUIContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.client.Minecraft; @@ -35,9 +37,10 @@ import org.lwjgl.opengl.GL11; import java.awt.*; +@SideOnly(Side.CLIENT) public class GT_GUIContainer_LESU extends GT_GUIContainer { - public static final ResourceLocation texture = new ResourceLocation(MainMod.modID, "textures/GT2/gui/LESU.png"); + public static final ResourceLocation texture = new ResourceLocation(MainMod.MOD_ID, "textures/GT2/gui/LESU.png"); protected GT_Container_LESU mContainer; private GT_TileEntity_LESU c; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java index 220d88d7a9..3cdaddc85b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java @@ -24,9 +24,10 @@ package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_RadioHatch; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; -import com.github.bartimaeusnek.bartworks.util.BW_Util; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; @@ -35,12 +36,13 @@ import org.lwjgl.opengl.GL11; import java.nio.ByteBuffer; +@SideOnly(Side.CLIENT) public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine { private static int maxSv; private final String mName; public GT_GUIContainer_RadioHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { - super(new GT_Container_RadioHatch(aInventoryPlayer, aTileEntity), MainMod.modID + ":textures/GUI/RadHatch.png"); + super(new GT_Container_RadioHatch(aInventoryPlayer, aTileEntity), MainMod.MOD_ID + ":textures/GUI/RadHatch.png"); this.mName = "Radio Hatch"; this.mContainer.detectAndSendChanges(); maxSv = BioVatLogicAdder.RadioHatch.getMaxSv(); @@ -52,7 +54,7 @@ public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine double rem = maxT - timer % maxT; this.fontRendererObj.drawString(this.mName, 8, 4, 4210752); - this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.modID + ":textures/GUI/RadHatch.png")); + this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID + ":textures/GUI/RadHatch.png")); if (((GT_Container_RadioHatch) mContainer).mass > 0) { GL11.glColor3f(((GT_Container_RadioHatch) mContainer).r / 255f, ((GT_Container_RadioHatch) mContainer).g / 255f, ((GT_Container_RadioHatch) mContainer).b / 255f); this.drawTexturedModalRect(124, 18, 124, 18, 16, 48); @@ -61,9 +63,10 @@ public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine this.drawTexturedModalRect(124, 18, 176, 0, 16, 48 - (int) Math.ceil(48 * (rem / maxT))); this.drawTexturedModalRect(65, 13, 192, 0, (48 * (((GT_Container_RadioHatch) mContainer).sv)) / (maxSv), 16); - this.fontRendererObj.drawString("Sv: " + ((GT_Container_RadioHatch) mContainer).sievert, 8, 50, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); - this.fontRendererObj.drawString("Kg: " + ((GT_Container_RadioHatch) mContainer).mass, 8, 68, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); - this.fontRendererObj.drawString("Time: " + timer, 8, 76, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); + +// this.fontRendererObj.drawString("Sv: " + ((GT_Container_RadioHatch) mContainer).sievert, 8, 50, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); +// this.fontRendererObj.drawString("Kg: " + ((GT_Container_RadioHatch) mContainer).mass, 8, 68, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); +// this.fontRendererObj.drawString("Time: " + timer, 8, 76, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java index 25f5c9220e..423fb20468 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java @@ -23,15 +23,18 @@ package com.github.bartimaeusnek.bartworks.client.renderer; import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; -import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.world.IBlockAccess; import org.lwjgl.opengl.GL11; +@SideOnly(Side.CLIENT) public class RendererGlasBlock implements ISimpleBlockRenderingHandler { public static final int RID = RenderingRegistry.getNextAvailableRenderId(); @@ -74,7 +77,7 @@ public class RendererGlasBlock implements ISimpleBlockRenderingHandler { @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { //renderer.setRenderBounds(0.001,0.001,0.001,0.999,0.999,0.999); - renderer.renderStandardBlock(BioItemList.bw_fake_glasses, x, y, z); + renderer.renderStandardBlock(ItemRegistry.bw_fake_glasses, x, y, z); //renderer.setRenderBounds(0,0,0,1,1,1); renderer.renderStandardBlockWithColorMultiplier(block, x, y, z, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[0] / 255f, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[1] / 255f, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[2] / 255f); return true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java index 4f7a19e0c6..0a2bf2d99c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java @@ -24,7 +24,7 @@ package com.github.bartimaeusnek.bartworks.client.renderer; import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_BioVat; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; import com.github.bartimaeusnek.bartworks.util.Coords; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.relauncher.Side; @@ -40,7 +40,7 @@ import net.minecraft.world.IBlockAccess; import net.minecraftforge.fluids.BlockFluidBase; import net.minecraftforge.fluids.IFluidBlock; - +@SideOnly(Side.CLIENT) public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler { private static final float LIGHT_Y_NEG = 0.5f; private static final float LIGHT_Y_POS = 1f; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index b0be51a5c0..b9d59c2294 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -44,7 +44,7 @@ public class BW_TileEntityContainer extends BlockContainer { this.tileEntity = tileEntity; this.setCreativeTab(MainMod.BWT); this.setBlockName(blockName); - this.setBlockTextureName(MainMod.modID + ":" + blockName); + this.setBlockTextureName(MainMod.MOD_ID + ":" + blockName); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java index 3a17a3759b..ea1b074c69 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.blocks; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import com.github.bartimaeusnek.bartworks.common.tileentities.BWTileEntityDimIDBridge; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BWTileEntityDimIDBridge; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.ITileEntityProvider; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 0db716071e..01af8ef53f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -40,10 +40,11 @@ public class ConfigHandler { public static boolean BioLab = true; public static Configuration c; public static boolean DEHPDirectSteam = false; + public static int megaMachinesMax = 256; private static boolean ezmode = false; public ConfigHandler(@Nonnull FMLPreInitializationEvent e) { - c = new Configuration(new File(e.getModConfigurationDirectory().toString() + "/" + MainMod.modID + ".cfg")); + c = new Configuration(new File(e.getModConfigurationDirectory().toString() + "/" + MainMod.MOD_ID + ".cfg")); IDOffset = c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600); energyPerCell = c.get("Multiblocks", "energyPerLESUCell", 1000000, "This will set Up the Energy per LESU Cell", 1000000, Integer.MAX_VALUE).getInt(1000000); @@ -53,6 +54,7 @@ public class ConfigHandler { newStuff = !c.get("System", "Disable non-original-GT-stuff", false, "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false); BioLab = !c.get("System", "Disable BioLab", false, "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!").getBoolean(false); DEHPDirectSteam = c.get("Multiblocks", "DEHP Direct Steam Mode", false, "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant").getBoolean(false); + megaMachinesMax = c.get("Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256); if (ConfigHandler.IDOffset == 0) { ConfigHandler.IDOffset = 12600; c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index 2066ac3b8e..1b631cc5fe 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -23,9 +23,12 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_LanguageManager; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; @@ -58,7 +61,10 @@ public class BW_ItemBlocks extends ItemBlock { } @Override + @SideOnly(Side.CLIENT) public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { + if (this.field_150939_a instanceof BW_GlasBlocks) + aList.add("Glass-Tier: " + BW_Util.getColorForTier(BW_Util.getTierFromGlasMeta(aStack.getItemDamage())) + GT_Values.VN[BW_Util.getTierFromGlasMeta(aStack.getItemDamage())]); aList.add(this.mNoMobsToolTip); aList.add(this.mNoTileEntityToolTip); aList.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java index f526e5a601..d4184dfc08 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java @@ -49,7 +49,7 @@ public class BW_SimpleWindMeter extends Item { @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister p_94581_1_) { - this.itemIcon = p_94581_1_.registerIcon(MainMod.modID + ":BW_SimpleWindMeter"); + this.itemIcon = p_94581_1_.registerIcon(MainMod.MOD_ID + ":BW_SimpleWindMeter"); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index 2227cae93e..cbe4ce0b23 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -65,7 +65,7 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(MainMod.modID + ":" + itemTex); + this.itemIcon = iconRegister.registerIcon(MainMod.MOD_ID + ":" + itemTex); } public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java index f434fd5d5f..9f18e6c457 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java @@ -31,7 +31,7 @@ import java.util.List; public class LabModule extends SimpleSubItemClass { public LabModule(String[] tex) { super(tex); - this.setCreativeTab(MainMod.BioTab); + this.setCreativeTab(MainMod.BIO_TAB); } public String getUnlocalizedName(ItemStack p_77667_1_) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java index da80a83eb3..67c1222a28 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -40,7 +40,7 @@ public class LabParts extends SimpleSubItemClass { public LabParts(String[] tex) { super(tex); - this.setCreativeTab(MainMod.BioTab); + this.setCreativeTab(MainMod.BIO_TAB); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java index 365efb5c81..d2c2e17478 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -50,7 +50,7 @@ public class SimpleSubItemClass extends Item { public void registerIcons(IIconRegister iconRegister) { itemIcon = new IIcon[tex.length]; for (int i = 0; i < tex.length; i++) { - itemIcon[i] = iconRegister.registerIcon(MainMod.modID + ":" + tex[i]); + itemIcon[i] = iconRegister.registerIcon(MainMod.MOD_ID + ":" + tex[i]); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java index 0c7b559b03..590cc6048d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java @@ -22,9 +22,6 @@ package com.github.bartimaeusnek.bartworks.common.loaders; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; -import com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; import com.github.bartimaeusnek.bartworks.common.items.LabModule; import com.github.bartimaeusnek.bartworks.common.items.LabParts; import com.github.bartimaeusnek.bartworks.util.BioCulture; @@ -32,11 +29,6 @@ import com.github.bartimaeusnek.bartworks.util.BioDNA; import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.SubTag; -import gregtech.api.util.GT_OreDictUnificator; -import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -47,47 +39,13 @@ import java.util.HashSet; public class BioItemList { - public static final Block[] bw_glasses = { - new BW_GlasBlocks( - "BW_GlasBlocks", - new String[]{ - MainMod.modID + ":BoronSilicateGlassBlock", - MainMod.modID + ":NickelReinforcedBoronSilicateGlassBlock", - MainMod.modID + ":TungstenReinforcedBoronSilicateGlassBlock", - MainMod.modID + ":ChromeReinforcedBoronSilicateGlassBlock", - MainMod.modID + ":IridiumReinforcedBoronSilicateGlassBlock", - MainMod.modID + ":OsmiumReinforcedBoronSilicateGlassBlock", - MainMod.modID + ":ColoredBoronSilicateGlassBlock1", - MainMod.modID + ":ColoredBoronSilicateGlassBlock2", - MainMod.modID + ":ColoredBoronSilicateGlassBlock3", - MainMod.modID + ":ColoredBoronSilicateGlassBlock4", - MainMod.modID + ":ColoredBoronSilicateGlassBlock5", - MainMod.modID + ":ColoredBoronSilicateGlassBlock6", - }, - new short[][]{Materials.BorosilicateGlass.getRGBA(), Materials.Nickel.getRGBA(), Materials.Tungsten.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), Materials.Osmium.getRGBA(), new short[]{0xff, 0, 0}, new short[]{0, 0xff, 0}, new short[]{0x80, 0, 0xff}, new short[]{0xff, 0xff, 0}, new short[]{0, 0xff, 0x80}, new short[]{0x80, 0x33, 0}}, - MainMod.BioTab, - true, false - ) - }; - - public static final Block bw_fake_glasses = - new BW_GlasBlocks("BW_GlasBlocks", new String[]{ - MainMod.modID + ":BoronSilicateGlassBlockRandlos" - }, null, null, true, true); - - - private static final Item mItemBioLabParts = new LabModule(new String[]{"DNAExtractionModule", "PCRThermoclyclingModule", "PlasmidSynthesisModule", "TransformationModule", "ClonalCellularSynthesisModule" }); + private static final Item mItemBioLabParts = new LabModule(new String[]{"DNAExtractionModule", "PCRThermoclyclingModule", "PlasmidSynthesisModule", "TransformationModule", "ClonalCellularSynthesisModule"}); public static final ItemStack[] mBioLabParts = {new ItemStack(mItemBioLabParts), new ItemStack(mItemBioLabParts, 1, 1), new ItemStack(mItemBioLabParts, 1, 2), new ItemStack(mItemBioLabParts, 1, 3), new ItemStack(mItemBioLabParts, 1, 4)}; - private static final Item vanillaBioLabParts = new LabParts(new String[]{"petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", "IncubationModule", "PlasmaMembrane" }); + private static final Item vanillaBioLabParts = new LabParts(new String[]{"petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", "IncubationModule", "PlasmaMembrane"}); public BioItemList() { GameRegistry.registerItem(mItemBioLabParts, "BioLabModules"); GameRegistry.registerItem(vanillaBioLabParts, "BioLabParts"); - GameRegistry.registerBlock(bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); - GameRegistry.registerBlock(bw_fake_glasses, "BW_FakeGlasBlock"); - //fixing BorosilicateGlass... -_-' - Materials.BorosilicateGlass.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); - GT_OreDictUnificator.add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(bw_glasses[0], 1, 0)); } public static Collection getAllPetriDishes() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index 0987005a7f..05c63ef0cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -23,14 +23,17 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_BioLab; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_RadioHatch; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_BioVat; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_BioLab; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.BioCulture; import cpw.mods.fml.common.Loader; -import gregtech.api.enums.*; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; @@ -197,7 +200,7 @@ public class BioRecipeLoader extends RecipeLoader { "GCG", "KHK", "GCG", - 'G', new ItemStack(BioItemList.bw_glasses[0], 1, 1), + 'G', new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 'C', "circuit" + Materials.Data, 'K', GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Silver, 1L), 'H', ItemList.MACHINE_HULLS[3].get(1L) @@ -354,33 +357,5 @@ public class BioRecipeLoader extends RecipeLoader { 400, BW_Util.getMachineVoltageFromTier(1) ); - - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Materials.Nickel.getMolten(5184), new ItemStack(BioItemList.bw_glasses[0], 1, 1), 800, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 1), Materials.Tungsten.getMolten(1296), new ItemStack(BioItemList.bw_glasses[0], 1, 2), 800, BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 2), Materials.Chrome.getMolten(1296), new ItemStack(BioItemList.bw_glasses[0], 1, 3), 800, BW_Util.getMachineVoltageFromTier(6)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 3), Materials.Iridium.getMolten(3888), new ItemStack(BioItemList.bw_glasses[0], 1, 4), 800, BW_Util.getMachineVoltageFromTier(7)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 4), Materials.Osmium.getMolten(1296), new ItemStack(BioItemList.bw_glasses[0], 1, 5), 800, BW_Util.getMachineVoltageFromTier(8)); - - for (int i = 0; i < Dyes.dyeBrown.getSizeOfFluidList(); ++i) { - GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyeRed.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 6), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyeGreen.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 7), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyePurple.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 8), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyeYellow.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 9), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyeLime.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 10), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyeBrown.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 11), null, null, null, 64, 2); - } - //and reverse recipes... cause im nice :P - GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 1), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nickel.getDust(36)}, null, 800, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 2), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nickel.getDust(36), Materials.Tungsten.getDust(9)}, null, 800, BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 3), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9)}, null, 800, BW_Util.getMachineVoltageFromTier(6)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 4), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9), Materials.Iridium.getDust(27)}, null, 800, BW_Util.getMachineVoltageFromTier(7)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 5), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9), Materials.Osmiridium.getDust(36)}, null, 800, BW_Util.getMachineVoltageFromTier(8)); - - for (int i = 6; i < 11; i++) { - GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, i), new ItemStack[]{Materials.BorosilicateGlass.getDust(9)}, null, 400, BW_Util.getMachineVoltageFromTier(1)); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, i), Materials.Chlorine.getGas(50), new ItemStack(BioItemList.bw_glasses[0], 1, 0), null, null, null, 64, 2); - } - - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 4646d850e0..1f41d225a9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -25,7 +25,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock; import com.github.bartimaeusnek.bartworks.client.renderer.RendererSwitchingColorFluid; import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock; -import com.github.bartimaeusnek.bartworks.common.tileentities.BWTileEntityDimIDBridge; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BWTileEntityDimIDBridge; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.BioCulture; import cpw.mods.fml.client.registry.RenderingRegistry; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java index 8d54f44d8a..095e679dc6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java @@ -66,7 +66,7 @@ public class GTNHBlocks implements Runnable { if (Loader.isModLoaded("TConstruct")) BioVatLogicAdder.BioVatGlass.addCustomGlass("TConstruct", "GlassBlock", 0, 3); if (Loader.isModLoaded("tectech")) - BioVatLogicAdder.BioVatGlass.addCustomGlass("tectech", "tile.quantumGlass", 0, 5); + BioVatLogicAdder.BioVatGlass.addCustomGlass("tectech", "tile.quantumGlass", 0, 8); if (Loader.isModLoaded("chisel")) BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "glass2", 0, 3); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 4ca992e984..169655c4a5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -24,10 +24,17 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.items.*; -import com.github.bartimaeusnek.bartworks.common.tileentities.*; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_DEHP; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaBlastFurnace; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_AcidGenerator; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_Diode; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_EnergyDistributor; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -53,33 +60,59 @@ public class ItemRegistry { public static final Item ROCKCUTTER_HV = new GT_Rockcutter_Item(3); public static final Item CIRCUIT_PROGRAMMER = new Circuit_Programmer(); public static final Block ROTORBLOCK = new BW_TileEntityContainer(Material.wood, BW_RotorBlock.class, "BWRotorBlock"); - public static final Item LEATHER_ROTOR = new BW_Stonage_Rotors(5, 0.15f, 15, 30, 2400, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorLeather.png"), "BW_LeatherRotor", "rotors/itemRotorLeather"); - public static final Item WOOL_ROTOR = new BW_Stonage_Rotors(7, 0.18f, 10, 20, 1600, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorWool.png"), "BW_WoolRotor", "rotors/itemRotorWool"); - public static final Item PAPER_ROTOR = new BW_Stonage_Rotors(9, 0.2f, 1, 10, 800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorPaper.png"), "BW_PaperRotor", "rotors/itemRotorPaper"); - public static final Item COMBINED_ROTOR = new BW_Stonage_Rotors(11, 0.22f, 1, 50, 5800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorCombined.png"), "BW_CombinedRotor", "rotors/itemRotorCombined"); - public static final Item CRAFTING_PARTS = new SimpleSubItemClass(new String[]{"grindstone_top", "grindstone_bottom", "completed_grindstone", "rotors/leatherParts", "rotors/woolParts", "rotors/paperParts", "rotors/combinedParts" }); + public static final Item LEATHER_ROTOR = new BW_Stonage_Rotors(5, 0.15f, 15, 30, 2400, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorLeather.png"), "BW_LeatherRotor", "rotors/itemRotorLeather"); + public static final Item WOOL_ROTOR = new BW_Stonage_Rotors(7, 0.18f, 10, 20, 1600, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorWool.png"), "BW_WoolRotor", "rotors/itemRotorWool"); + public static final Item PAPER_ROTOR = new BW_Stonage_Rotors(9, 0.2f, 1, 10, 800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorPaper.png"), "BW_PaperRotor", "rotors/itemRotorPaper"); + public static final Item COMBINED_ROTOR = new BW_Stonage_Rotors(11, 0.22f, 1, 50, 5800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorCombined.png"), "BW_CombinedRotor", "rotors/itemRotorCombined"); + public static final Item CRAFTING_PARTS = new SimpleSubItemClass(new String[]{"grindstone_top", "grindstone_bottom", "completed_grindstone", "rotors/leatherParts", "rotors/woolParts", "rotors/paperParts", "rotors/combinedParts"}); public static final Item TAB = new SimpleIconItem("GT2Coin"); public static final Item WINDMETER = new BW_SimpleWindMeter(); - public static ItemStack dehp; + + public static final Block[] bw_glasses = { + new BW_GlasBlocks( + "BW_GlasBlocks", + new String[]{ + MainMod.MOD_ID + ":BoronSilicateGlassBlock", + MainMod.MOD_ID + ":NickelReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":TungstenReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":ChromeReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":IridiumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":OsmiumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock1", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock2", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock3", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock4", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock5", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock6", + }, + new short[][]{Materials.BorosilicateGlass.getRGBA(), Materials.Nickel.getRGBA(), Materials.Tungsten.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), Materials.Osmium.getRGBA(), new short[]{0xff, 0, 0}, new short[]{0, 0xff, 0}, new short[]{0x80, 0, 0xff}, new short[]{0xff, 0xff, 0}, new short[]{0, 0xff, 0x80}, new short[]{0x80, 0x33, 0}}, + MainMod.BIO_TAB, + true, false + ) + }; + public static final Block bw_fake_glasses = + new BW_GlasBlocks("BW_GlasBlocks", new String[]{ + MainMod.MOD_ID + ":BoronSilicateGlassBlockRandlos" + }, null, null, true, true); public static final Block[] BW_BLOCKS = { new BW_Blocks("BW_ItemBlocks", new String[] { - MainMod.modID + ":EtchedLapisCell", - MainMod.modID + ":PlatedLapisCell", + MainMod.MOD_ID + ":EtchedLapisCell", + MainMod.MOD_ID + ":PlatedLapisCell", }, GT2), new BW_Blocks("GT_LESU_CASING", new String[]{ - MainMod.modID + ":LESU_CELL", + MainMod.MOD_ID + ":LESU_CELL", }, GT2), new BW_Blocks("BW_Machinery_Casings", new String[]{ - MainMod.modID + ":NickelFerriteBlocks", - MainMod.modID + ":TransformerCoil", - // MainMod.modID+":DEHP_Casing", - // MainMod.modID+":DEHP_Casing_Base" + MainMod.MOD_ID + ":NickelFerriteBlocks", + MainMod.MOD_ID + ":TransformerCoil", + // MainMod.MOD_ID+":DEHP_Casing", + // MainMod.MOD_ID+":DEHP_Casing_Base" }, BWT), }; - + public static ItemStack dehp; public static ItemStack[] diode2A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] diode4A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] diode8A = new ItemStack[GT_Values.VN.length]; @@ -87,10 +120,14 @@ public class ItemRegistry { public static ItemStack[] diode16A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] energyDistributor = new ItemStack[GT_Values.VN.length]; public static ItemStack[] acidGens = new ItemStack[3]; + public static ItemStack[] megaMachines = new ItemStack[2]; public static void run() { if (newStuff) { + GameRegistry.registerBlock(ItemRegistry.bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); + GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses, "BW_FakeGlasBlock"); + GT_OreDictUnificator.add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); GameRegistry.registerBlock(BW_BLOCKS[2], BW_ItemBlocks.class, "BW_Machinery_Casings"); GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(BW_BLOCKS[2])); GameRegistry.registerItem(LEATHER_ROTOR, "BW_LeatherRotor"); @@ -112,9 +149,12 @@ public class ItemRegistry { } for (int i = 0; i < 3; i++) { - ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "Acid Generator " + GT_Values.VN[i + 2], "Acid Generator " + GT_Values.VN[i + 2], i + 2, new String[]{"An Acid Generator", "Creates Power from Chemical Energy Potentials." }).getStackForm(1); + ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "Acid Generator " + GT_Values.VN[i + 2], "Acid Generator " + GT_Values.VN[i + 2], i + 2, new String[]{"An Acid Generator", "Creates Power from Chemical Energy Potentials."}).getStackForm(1); } dehp = new GT_TileEntity_DEHP(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump").getStackForm(1L); + megaMachines[0] = new GT_TileEntity_MegaBlastFurnace(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, "MegaBlastFurnace", "Mega Blast Furnace").getStackForm(1L); + megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, "MegaVaccumFreezer", "Mega Vaccum Freezer").getStackForm(1L); + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 5e191fbc8a..6a40941703 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -24,15 +24,12 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_ManualTrafo; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_Windmill; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_LESU; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_Windmill; import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; @@ -201,6 +198,36 @@ public class RecipeLoader implements Runnable { else GT_Values.RA.addAssemblylineRecipe(ItemList.Pump_IV.get(1L), 72000, new ItemStack[]{ItemList.Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 32L), GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 32L), ItemList.Field_Generator_LuV.get(8)}, new FluidStack[]{Materials.SolderingAlloy.getMolten(32 * 144), Materials.Polytetrafluoroethylene.getMolten(32 * 144)}, ItemRegistry.dehp, 5000, BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1000), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[0], 72000, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1002), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[1], 72000, BW_Util.getMachineVoltageFromTier(3)); + + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Nickel.getMolten(5184), new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 800, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), Materials.Tungsten.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), 800, BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), Materials.Chrome.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), 800, BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), Materials.Iridium.getMolten(3888), new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), 800, BW_Util.getMachineVoltageFromTier(7)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), Materials.Osmium.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), 800, BW_Util.getMachineVoltageFromTier(8)); + + for (int i = 0; i < Dyes.dyeBrown.getSizeOfFluidList(); ++i) { + GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeRed.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 6), null, null, null, 64, 2); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeGreen.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 7), null, null, null, 64, 2); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyePurple.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 8), null, null, null, 64, 2); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeYellow.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 9), null, null, null, 64, 2); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeLime.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 10), null, null, null, 64, 2); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeBrown.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 11), null, null, null, 64, 2); + } + //and reverse recipes... cause im nice :P + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nickel.getDust(36)}, null, 800, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nickel.getDust(36), Materials.Tungsten.getDust(9)}, null, 800, BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9)}, null, 800, BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9), Materials.Iridium.getDust(27)}, null, 800, BW_Util.getMachineVoltageFromTier(7)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9), Materials.Osmiridium.getDust(36)}, null, 800, BW_Util.getMachineVoltageFromTier(8)); + + for (int i = 6; i < 11; i++) { + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, i), new ItemStack[]{Materials.BorosilicateGlass.getDust(9)}, null, 400, BW_Util.getMachineVoltageFromTier(1)); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, i), Materials.Chlorine.getGas(50), new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), null, null, null, 64, 2); + } + + GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.WINDMETER), GT_ModHandler.RecipeBits.NOT_REMOVABLE, @@ -430,8 +457,8 @@ public class RecipeLoader implements Runnable { } ); - String[] stones = {"stone", "stoneSmooth" }; - String[] granites = {"blockGranite", "stoneGranite", "Granite", "granite" }; + String[] stones = {"stone", "stoneSmooth"}; + String[] granites = {"blockGranite", "stoneGranite", "Granite", "granite"}; for (String granite : granites) { for (String stone : stones) { GT_ModHandler.addCraftingRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java index 1427cc291b..71aa50c824 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.net; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_BioVat; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Coords; import com.google.common.io.ByteArrayDataInput; @@ -93,7 +93,7 @@ public class RendererPacket extends GT_Packet { byte checksum = (byte) (coords.x % 25 + coords.y % 25 + coords.z % 25 + coords.wID % 25 + integer % 25 + removal); if (checksum != ByteBuffer.wrap(buffer).get(18)) { - MainMod.logger.error("BW Packet was corrupted or modified!"); + MainMod.LOGGER.error("BW Packet was corrupted or modified!"); return null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BWTileEntityDimIDBridge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BWTileEntityDimIDBridge.java deleted file mode 100644 index d403b54079..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BWTileEntityDimIDBridge.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities; - -import net.minecraft.tileentity.TileEntity; - -public class BWTileEntityDimIDBridge extends TileEntity { -} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BW_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BW_RotorBlock.java deleted file mode 100644 index ee35c37433..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BW_RotorBlock.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities; - -import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_RotorBlock; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.block.kineticgenerator.container.ContainerWindKineticGenerator; -import ic2.core.block.kineticgenerator.tileentity.TileEntityWindKineticGenerator; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; - -public class BW_RotorBlock extends TileEntityWindKineticGenerator { - - public int getGrindPower() { - return super.getKuOutput(); - } - - public int getKuOutput() { - return 0; - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin) { - return new BW_GUIContainer_RotorBlock(new ContainerWindKineticGenerator(entityPlayer, this)); - } - -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java deleted file mode 100644 index 4d75f908b9..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities; - -import com.github.bartimaeusnek.bartworks.util.BWRecipes; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Recipe; - -public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGenerator { - - public GT_MetaTileEntity_AcidGenerator(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, ITexture... aTextures) { - super(aID, aName, aNameRegional, aTier, aDescription, aTextures); - } - - public GT_MetaTileEntity_AcidGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); - } - - @Override - public int getPollution() { - return 0; - } - - @Override - public GT_Recipe.GT_Recipe_Map getRecipes() { - return BWRecipes.instance.getMappingsFor((byte) 2); - } - - @Override - public int getEfficiency() { - return 100 - 3 * mTier; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_MetaTileEntity_AcidGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); - } - - public ITexture[] getFront(byte aColor) { - return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; - } - - public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; - } - - public ITexture[] getBottom(byte aColor) { - return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; - } - - public ITexture[] getTop(byte aColor) { - return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT"))}; - } - - public ITexture[] getSides(byte aColor) { - return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; - } - - public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; - } - - public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; - } - - public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; - } - - public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE"))}; - } - - public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; - } - - public boolean isOutputFacing(byte aSide) { - return aSide == this.getBaseMetaTileEntity().getFrontFacing(); - } - - @SuppressWarnings("deprecation") - public String[] getDescription() { - return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Efficiency: " + ChatColorHelper.YELLOW + getEfficiency(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" }; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_BioLab.java deleted file mode 100644 index b6cb2dea3e..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_BioLab.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities; - -import com.github.bartimaeusnek.bartworks.common.items.LabModule; -import com.github.bartimaeusnek.bartworks.common.items.LabParts; -import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; -import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; -import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import com.github.bartimaeusnek.bartworks.util.*; -import cpw.mods.fml.common.Loader; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.objects.XSTR; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.common.items.behaviors.Behaviour_DataOrb; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { - - private static final String MGUINAME = "BW.GUI.BioLab.png"; - - public GT_MetaTileEntity_BioLab(int aID, String aName, String aNameRegional, int aTier, String aDescription) { - super(aID, aName, aNameRegional, aTier, 1, aDescription, 6, 2, MGUINAME, null, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")/*this is topactive*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")/*this is top*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM"))); - } - - public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, String aNEIName) { - super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2, MGUINAME, aNEIName); - } - - public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String[] aDescription, ITexture[][][] aTextures, String aNEIName) { - super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2, MGUINAME, aNEIName); - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_MetaTileEntity_BioLab(this.mName, this.mTier, this.mAmperage, this.mDescriptionArray, this.mTextures, this.mNEIName); - } - - @Override - public GT_Recipe.GT_Recipe_Map getRecipeList() { - return BWRecipes.instance.getMappingsFor(BWRecipes.BIOLABBYTE); - } - - @Override - public int getCapacity() { - return this.mTier * 1000; - } - - @Override - public int checkRecipe(boolean skipOC) { - - int rTier = 3; - FluidStack dnaFluid = Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); - - if (this.getSpecialSlot() != null && this.getSpecialSlot().getItem() instanceof LabModule) { - int damage = getSpecialSlot().getItemDamage() + 1; - switch (damage) { - case 0: - if (GT_Utility.isStackValid(this.mInventory[4]) && this.mInventory[4].getItem() instanceof LabParts && this.mInventory[4].getItemDamage() == 0 && this.mInventory[4].getTagCompound() != null && //checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[5]) && this.mInventory[5].getItem() instanceof LabParts && this.mInventory[5].getItemDamage() == 1 && this.mInventory[5].getTagCompound() == null && - GT_Utility.isStackValid(this.mInventory[6]) && this.mInventory[6].getItem() instanceof LabParts && this.mInventory[6].getItemDamage() == 3 && - GT_Utility.areStacksEqual(this.mInventory[7], Materials.Ethanol.getCells(1)) && - this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000 - ) { - - NBTTagCompound DNABioDataTag = this.mInventory[4].getTagCompound().getCompoundTag("DNA"); - if (DNABioDataTag == null) - return super.checkRecipe(skipOC); - BioData cultureDNABioData = BioData.getBioDataFromName(this.mInventory[4].getTagCompound().getCompoundTag("DNA").getString("Name")); - if (cultureDNABioData == null) - return super.checkRecipe(skipOC); - - if (this.mTier < rTier + cultureDNABioData.getTier()) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - - for (int i = 4; i < 8; i++) { - if (this.mInventory[i] != null) - this.mInventory[i].stackSize--; - } - - this.mFluid.amount -= 1000; - - if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(cultureDNABioData)); - } - this.mOutputItems[1] = GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L); - this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(rTier + cultureDNABioData.getTier()), 500); - - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; - } - break; - case 1: { - if (GT_Utility.isStackValid(this.mInventory[4]) && this.mInventory[4].getItem() instanceof LabParts && this.mInventory[4].getItemDamage() == 1 && this.mInventory[4].getTagCompound() != null && //checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[7]) && GT_Utility.areStacksEqual(this.mInventory[7], ItemList.Tool_DataOrb.get(1L)) && - GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], FluidLoader.BioLabFluidCells[0]) && - GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], FluidLoader.BioLabFluidCells[3]) && - this.mFluid.isFluidEqual(dnaFluid) && this.mFluid.amount >= 1000) { - NBTTagCompound DNABioDataTag = this.mInventory[4].getTagCompound(); - if (DNABioDataTag == null) - return super.checkRecipe(skipOC); - BioData cultureDNABioData = BioData.getBioDataFromName(DNABioDataTag.getString("Name")); - if (cultureDNABioData == null) - return super.checkRecipe(skipOC); - - if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - - for (int i = 4; i < 8; i++) { - if (this.mInventory[i] != null) - this.mInventory[i].stackSize--; - } - - this.mFluid.amount -= 1000; - - ItemStack Outp = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); - Behaviour_DataOrb.setDataName(Outp, cultureDNABioData.getName()); - - if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = Outp; - } else - this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L); - this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(2L); - - this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); - - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; - - } - } - break; - case 2: { - ItemStack inp2 = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); - Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); - if ( - GT_Utility.isStackValid(this.mInventory[4]) && GT_Utility.areStacksEqual(FluidLoader.BioLabFluidCells[1], this.mInventory[4]) && //checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getPlasmidCell(null)) && - GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], ItemList.Tool_DataOrb.get(1L), true) && - Behaviour_DataOrb.getDataTitle(this.mInventory[6]).equals("DNA Sample") && (!(Behaviour_DataOrb.getDataName(this.mInventory[6]).isEmpty())) && - GT_Utility.isStackValid(this.mInventory[7]) && GT_Utility.areStacksEqual(this.mInventory[7], inp2) && - this.mFluid.isFluidEqual(dnaFluid) && (this.mFluid.amount >= 1000)) { - BioData cultureDNABioData = BioData.getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[6])); - if (cultureDNABioData == null) - return super.checkRecipe(skipOC); - if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 4; i < 6; i++) { - if (this.mInventory[i] != null) - this.mInventory[i].stackSize--; - } - this.mFluid.amount -= 1000; - if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); - } - this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); - this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; - } - - } - break; - - case 3: { - if ( - GT_Utility.isStackValid(this.mInventory[4]) && GT_Utility.areStacksEqual(this.mInventory[4], BioItemList.getPetriDish(null), true) && this.mInventory[4].getTagCompound() != null && - GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getPlasmidCell(null), true) && this.mInventory[5].getTagCompound() != null && - GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], FluidLoader.BioLabFluidCells[2]) && - this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000) { - BioData cultureDNABioData = BioData.getBioDataFromNBTTag(this.mInventory[5].getTagCompound()); - BioCulture bioCulture = BioCulture.getBioCultureFromNBTTag(this.mInventory[4].getTagCompound()); - if (cultureDNABioData == null || bioCulture == null) - return super.checkRecipe(skipOC); - if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 4; i < 7; i++) { - if (this.mInventory[i] != null) - this.mInventory[i].stackSize--; - } - this.mFluid.amount -= 1000; - bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); - if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = BioItemList.getPetriDish(bioCulture); - } - this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); - this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; - } - } - break; - case 4: { - - ItemStack Outp = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); - - if ( - GT_Utility.isStackValid(this.mInventory[4]) && GT_Utility.areStacksEqual(this.mInventory[4], BioItemList.getPetriDish(null)) && - GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getOther(4)) && - GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], ItemList.Circuit_Chip_Stemcell.get(2L)) && - GT_Utility.isStackValid(this.mInventory[7]) && GT_Utility.areStacksEqual(this.mInventory[7], ItemList.Tool_DataOrb.get(1L), true) && - Behaviour_DataOrb.getDataTitle(this.mInventory[7]).equals("DNA Sample") && this.mFluid.isFluidEqual(dnaFluid) && (this.mFluid.amount >= 8000)) { - - BioData cultureDNABioData = BioData.getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[7])); - if (cultureDNABioData == null) - return super.checkRecipe(skipOC); - if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 4; i < 7; i++) { - if (this.mInventory[i] != null) - this.mInventory[i].stackSize--; - } - this.mFluid.amount -= 8000; - if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - BioCulture out = BioCulture.getBioCulture(BioDNA.convertDataToDNA(cultureDNABioData)); - out.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); - this.mOutputItems[0] = BioItemList.getPetriDish(out); - } - this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; - } - } - break; - default: - return super.checkRecipe(skipOC); - } - } - return super.checkRecipe(skipOC); - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java deleted file mode 100644 index a30ba65f1d..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities; - -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import gregtech.api.enums.GT_Values; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull; - -public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { - - private long amps; - - public GT_MetaTileEntity_Diode(int aID, String aName, String aNameRegional, int aTier, int amps) { - super(aID, aName, aNameRegional, aTier, "A Simple diode that will allow Energy Flow in only one direction."); - this.amps = amps; - } - - public GT_MetaTileEntity_Diode(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aInvSlotCount, aDescription, aTextures); - } - - @Override - public long maxAmperesOut() { - return amps; - } - - @Override - public long maxAmperesIn() { - return amps; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Diode(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); - } - - @SuppressWarnings("deprecation") - public String[] getDescription() { - return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" }; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java deleted file mode 100644 index 822c495887..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities; - -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import gregtech.api.enums.GT_Values; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Transformer; - -public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Transformer { - - public GT_MetaTileEntity_EnergyDistributor(int aID, String aName, String aNameRegional, int aTier, String aDescription) { - super(aID, aName, aNameRegional, aTier, aDescription); - } - - public GT_MetaTileEntity_EnergyDistributor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); - } - - public GT_MetaTileEntity_EnergyDistributor(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); - } - - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_EnergyDistributor(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); - } - - public long maxEUInput() { - return GT_Values.V[this.mTier]; - } - - public long maxEUOutput() { - return GT_Values.V[this.mTier]; - } - - public long maxAmperesOut() { - return 320; - } - - public long maxAmperesIn() { - return 320; - } - - @Override - public long maxEUStore() { - return 512L + (GT_Values.V[this.mTier] * 320L); - } - - @SuppressWarnings("deprecation") - public String[] getDescription() { - return new String[]{this.mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Amperage IN: " + ChatColorHelper.YELLOW + this.maxAmperesIn(), "Amperage OUT: " + ChatColorHelper.YELLOW + this.maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" }; - } - -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_RadioHatch.java deleted file mode 100644 index 879d9f7fb1..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_RadioHatch.java +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities; - -import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_RadioHatch; -import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; - -import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; - -public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { - - private final int cap; - public int sievert; - private long timer = 1; - private short[] colorForGUI; - private byte mass; - private String material; - private byte coverage = 0; - - public GT_MetaTileEntity_RadioHatch(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, new String[]{"Radioactive Item Chamber for Multiblocks", "Capacity: " + (aTier - 2) + " kg" + ((aTier - 2) >= 2 ? "s" : ""), "Use a screwdriver to set the containment level" }); - cap = aTier - 2; - } - - public GT_MetaTileEntity_RadioHatch(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, 1, aDescription, aTextures); - cap = aTier - 2; - } - - public GT_MetaTileEntity_RadioHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { - super(aName, aTier, 1, aDescription, aTextures); - cap = aTier - 2; - } - - public static long calcDecayTicks(int x) { - long ret = 0; - if (x >= 83 && x <= 100) - ret = (long) Math.ceil((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); - else if (x == 43) - ret = 5000; - else if (x == 61) - ret = 4500; - else if (x > 100) - ret = (long) Math.ceil(((8000D * Math.tanh(-x / 65D) + 8000D))); - return ret;//*20; - } - - public int getSievert() { - return this.sievert - (int) Math.ceil((float) this.sievert / 100f * (float) coverage); - } - - public short[] getColorForGUI() { - if (this.colorForGUI != null) - return this.colorForGUI; - return new short[]{0xFA, 0xFA, 0xFF}; - } - - public byte getMass() { - return this.mass; - } - - public byte getCoverage() { - return this.coverage; - } - - public void setCoverage(short coverage) { - byte nu = 0; - if (coverage > 100) - nu = 100; - else if (coverage < 0) - nu = 0; - else - nu = (byte) coverage; - this.coverage = nu; - } - - public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)}; - } - - public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)}; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_MetaTileEntity_RadioHatch(mName, mTier, mDescriptionArray, mTextures); - } - - @Override - public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - aPlayer.openGui(MainMod.modID, 2, this.getBaseMetaTileEntity().getWorld(), this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()); - //super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); - } - - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) { - return true; - } else { - aBaseMetaTileEntity.openGUI(aPlayer); - return true; - } - } - - public void updateSlots() { - if (this.mInventory[0] != null && this.mInventory[0].stackSize <= 0) - this.mInventory[0] = null; - } - - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { - if (this.getBaseMetaTileEntity().isServerSide()) { - - if (this.mass > 0) - ++timer; - - if (this.mass > 0 && this.sievert > 0 && calcDecayTicks(this.sievert) > 0) { - if (timer % (calcDecayTicks(this.sievert)) == 0) { - this.mass--; - if (mass == 0) { - material = "Empty"; - sievert = 0; - } - timer = 1; - } - } - - ItemStack lStack = this.mInventory[0]; - - if (lStack == null) - return; - - if (GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_4.get(1))) { - Materials materials = Materials.Uranium; - byte kg = 3; - - if (GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_4.get(1))) - materials = Materials.Plutonium; - else if (GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_4.get(1))) - materials = Materials.Thorium; - else if (GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_4.get(1))) - materials = Materials.Naquadah; - else - kg = 6; - - if (GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_2.get(1))) - kg = (byte) (2 * kg); - else if (GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_4.get(1))) - kg = (byte) (4 * kg); - - - if (this.mass == 0 || this.sievert == calculateSv(materials)) { - if (this.mass + kg <= cap) { - this.sievert = calculateSv(materials); - this.mass += kg; - this.mInventory[0].stackSize--; - updateSlots(); - colorForGUI = materials.mColor.mRGBa; - material = materials.mName; - } - } - } - - for (ItemStack varStack : BioVatLogicAdder.RadioHatch.getIsSv().keySet()) { - if (GT_Utility.areStacksEqual(varStack, lStack)) { - if (this.mass == 0 || this.sievert == BioVatLogicAdder.RadioHatch.getIsSv().get(varStack)) { - if (this.mass < this.cap) { - this.mass++; - this.sievert = BioVatLogicAdder.RadioHatch.getIsSv().get(varStack); - this.mInventory[0].stackSize--; - updateSlots(); - colorForGUI = null; - material = StatCollector.translateToLocal(varStack.getUnlocalizedName()); - return; - } - } - } - } - - //check material for general validity - if (lStack != null && GT_OreDictUnificator.getAssociation(lStack) != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial != null) { - //check orePrefix for general validity - if (GT_OreDictUnificator.getAssociation(lStack).mPrefix != null) { - OrePrefixes orePrefixes = GT_OreDictUnificator.getAssociation(lStack).mPrefix; - //check orePrefix for specialised validity - if (orePrefixes.equals(OrePrefixes.stickLong) || orePrefixes.equals(OrePrefixes.stick)) { - Materials materials = GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial; - //check material for specialised validity - if (materials.getProtons() >= 83 && materials.getProtons() != 125 || materials.getProtons() == 61 || materials.getProtons() == 43) { - if (this.mass == 0 || this.sievert == calculateSv(materials)) { - if ((this.mass + (orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1)) <= cap) { - this.sievert = calculateSv(materials); - this.mass += orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1; - this.mInventory[0].stackSize--; - updateSlots(); - colorForGUI = materials.mColor.mRGBa; - material = materials.mName; - } - } - } - } - } - } - - - } - } - - @Override - public boolean isGivingInformation() { - return true; - } - - @Override - public String[] getInfoData() { - if (calcDecayTicks(this.sievert) != 0) - return new String[]{"Material: " + material, "Sievert: " + sievert, "Amount: " + mass, "Time (in t/s/m/h) to decay (1kg): " + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert) * 60)) + "t/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 + "s/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 + "m/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 / 60 + "h" }; - else return new String[]{"Material: Empty", "Sievert: 0", "Amount: 0" }; - } - - public boolean isSimpleMachine() { - return true; - } - - public boolean isFacingValid(byte aFacing) { - return true; - } - - public boolean isAccessAllowed(EntityPlayer aPlayer) { - return true; - } - - public boolean isValidSlot(int aIndex) { - return true; - } - - public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return false; - } - - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return aSide == this.getBaseMetaTileEntity().getFrontFacing(); - } - - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_RadioHatch(aPlayerInventory, aBaseMetaTileEntity); - } - - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_RadioHatch(aPlayerInventory, aBaseMetaTileEntity, this.mName); - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setByte("mMass", mass); - aNBT.setByte("mSv", (byte) (sievert - 100)); - aNBT.setByte("mCoverage", coverage); - aNBT.setInteger("mTextColor", BW_Util.getColorFromArray(getColorForGUI())); - if (material != null && !material.isEmpty()) - aNBT.setString("mMaterial", material); - aNBT.setLong("timer", timer); - super.saveNBTData(aNBT); - } - - public long getTimer() { - return this.timer; - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - timer = aNBT.getLong("timer"); - mass = aNBT.getByte("mMass"); - sievert = aNBT.getByte("mSv") + 100; - coverage = aNBT.getByte("mCoverage"); - colorForGUI = BW_Util.splitColortoArray(aNBT.getInteger("mTextColor")); - material = aNBT.getString("mMaterial"); - super.loadNBTData(aNBT); - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_BioVat.java deleted file mode 100644 index f7f5024f4e..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_BioVat.java +++ /dev/null @@ -1,674 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities; - -import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.items.LabParts; -import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; -import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import com.github.bartimaeusnek.bartworks.common.net.RendererPacket; -import com.github.bartimaeusnek.bartworks.util.*; -import cpw.mods.fml.common.FMLCommonHandler; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -import javax.annotation.Nonnegative; -import javax.annotation.Nonnull; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; - -import static gregtech.api.enums.GT_Values.V; - -public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { - - public static final HashMap staticColorMap = new HashMap<>(); - - private static final byte MCASING_INDEX = 49; - private static final byte TIMERDIVIDER = 20; - - private final HashSet playerMPHashSet = new HashSet(); - private final ArrayList mRadHatches = new ArrayList<>(); - private int height = 1; - private GT_Recipe mLastRecipe = null; - private Fluid mFluid = FluidRegistry.LAVA; - private BioCulture mCulture; - private ItemStack mStack = null; - private boolean needsVisualUpdate = true; - private byte mGlassTier = 0; - private int mSievert = 0; - - - public GT_TileEntity_BioVat(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public GT_TileEntity_BioVat(String aName) { - super(aName); - } - - private static int[] specialValueUnpack(int aSpecialValure) { - int[] ret = new int[4]; - ret[0] = aSpecialValure & 0xF; // = glas tier - ret[1] = aSpecialValure >>> 4 & 0b11; // = special valure - ret[2] = aSpecialValure >>> 6 & 0b1; //exact svt - ret[3] = aSpecialValure >>> 7 & Integer.MAX_VALUE; // = sievert - return ret; - } - - public boolean isLiquidInput(byte aSide) { - return false; - } - - public boolean isLiquidOutput(byte aSide) { - return false; - } - - private int getInputCapacity() { - int ret = 0; - - for (GT_MetaTileEntity_Hatch_Input fluidH : this.mInputHatches) { - ret += fluidH.getCapacity(); - } - return ret; - } - - private int getOutputCapacity() { - int ret = 0; - - for (GT_MetaTileEntity_Hatch_Output fluidH : this.mOutputHatches) { - ret += fluidH.getCapacity(); - } - return ret; - } - - @Override - public int getCapacity() { - int ret = 0; - ret += getInputCapacity(); - //ret += getOutputCapacity(); - return ret; - } - - @Override - public int fill(FluidStack resource, boolean doFill) { - return super.fill(resource, doFill); - } - - @Override - public boolean isCorrectMachinePart(ItemStack itemStack) { - return true; - } - - @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return BWRecipes.instance.getMappingsFor(BWRecipes.BACTERIALVATBYTE); - } - - private int calcMod(double x) { - return (int) Math.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); - } - - @Override - public boolean checkRecipe(ItemStack itemStack) { - GT_Recipe.GT_Recipe_Map gtRecipeMap = getRecipeMap(); - - if (gtRecipeMap == null) - return false; - - ArrayList tInputList = getStoredInputs(); - int tInputList_sS = tInputList.size(); - for (int i = 0; i < tInputList_sS - 1; i++) { - for (int j = i + 1; j < tInputList_sS; j++) { - if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { - if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { - tInputList.remove(j--); - tInputList_sS = tInputList.size(); - } else { - tInputList.remove(i--); - tInputList_sS = tInputList.size(); - break; - } - } - } - } - ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); - - ArrayList tFluidList = getStoredFluids(); - int tFluidList_sS = tFluidList.size(); - for (int i = 0; i < tFluidList_sS - 1; i++) { - for (int j = i + 1; j < tFluidList_sS; j++) { - if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { - if (tFluidList.get(i).amount >= tFluidList.get(j).amount) { - tFluidList.remove(j--); - tFluidList_sS = tFluidList.size(); - } else { - tFluidList.remove(i--); - tFluidList_sS = tFluidList.size(); - break; - } - } - } - } - - FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); - - if (tFluidList.size() > 0) { - - GT_Recipe gtRecipe = gtRecipeMap.findRecipe(this.getBaseMetaTileEntity(), mLastRecipe, false, this.getMaxInputVoltage(), tFluids, itemStack, tInputs); - - if (gtRecipe == null) - return false; - - if (!BW_Util.areStacksEqual((ItemStack) gtRecipe.mSpecialItems, itemStack)) - return false; - - int[] conditions = specialValueUnpack(gtRecipe.mSpecialValue); - - if (conditions[2] == 0 ? (this.mSievert < conditions[3] || this.mGlassTier < conditions[0]) : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0])) - return false; - - int times = 1; - - - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - - if (gtRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { - if (getStoredFluidOutputs().size() > 0) { - this.mOutputFluids = new FluidStack[gtRecipe.mFluidOutputs.length]; - for (FluidStack storedOutputFluid : getStoredFluidOutputs()) { - if (storedOutputFluid.isFluidEqual(gtRecipe.getFluidOutput(0))) - for (FluidStack inputFluidStack : gtRecipe.mFluidInputs) { - int j = calcMod(storedOutputFluid.amount); - for (int i = 0; i < j; i++) - if (depleteInput(inputFluidStack)) - times++; - } - } - for (FluidStack storedfluidStack : getStoredFluidOutputs()) { - for (int i = 0; i < gtRecipe.mFluidOutputs.length; i++) { - if (storedfluidStack.isFluidEqual(gtRecipe.getFluidOutput(i))) - this.mOutputFluids[i] = (new FluidStack(gtRecipe.getFluidOutput(i), times * gtRecipe.getFluidOutput(0).amount)); - } - - } - } else { - this.mOutputFluids = gtRecipe.mFluidOutputs; - } - } else - return false; - - calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, this.getMaxInputVoltage()); - - if (mEUt > 0) - mEUt = -mEUt; - this.mProgresstime = 0; - - if (gtRecipe.mCanBeBuffered) - mLastRecipe = gtRecipe; - - updateSlots(); - return true; - } - return false; - } - - /** - * Taken from the GTNH fork, made originally by Tec? - * Calcualtes overclocked ness using long integers - * - * @param aEUt - recipe EUt - * @param aDuration - recipe Duration - * @param mAmperage - should be 1 ? - */ - protected void calculateOverclockedNessMulti(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage) { - byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); - if (mTier == 0) { - //Long time calculation - long xMaxProgresstime = ((long) aDuration) << 1; - if (xMaxProgresstime > Integer.MAX_VALUE - 1) { - //make impossible if too long - mEUt = Integer.MAX_VALUE - 1; - mMaxProgresstime = Integer.MAX_VALUE - 1; - } else { - mEUt = aEUt >> 2; - mMaxProgresstime = (int) xMaxProgresstime; - } - } else { - //Long EUt calculation - long xEUt = aEUt; - //Isnt too low EUt check? - long tempEUt = xEUt < V[1] ? V[1] : xEUt; - - mMaxProgresstime = aDuration; - - while (tempEUt <= V[mTier - 1] * mAmperage) { - tempEUt <<= 2;//this actually controls overclocking - //xEUt *= 4;//this is effect of everclocking - mMaxProgresstime >>= 1;//this is effect of overclocking - xEUt = mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power - } - if (xEUt > Integer.MAX_VALUE - 1) { - mEUt = Integer.MAX_VALUE - 1; - mMaxProgresstime = Integer.MAX_VALUE - 1; - } else { - mEUt = (int) xEUt; - if (mEUt == 0) - mEUt = 1; - if (mMaxProgresstime == 0) - mMaxProgresstime = 1;//set time to 1 tick - } - } - } - - public ArrayList getStoredFluidOutputs() { - ArrayList rList = new ArrayList(); - Iterator var2 = this.mOutputHatches.iterator(); - - while (var2.hasNext()) { - GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) var2.next(); - if (tHatch.getFluid() != null) - rList.add(tHatch.getFluid()); - } - return rList; - } - - private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_RadioHatch) { - ((GT_MetaTileEntity_RadioHatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mRadHatches.add((GT_MetaTileEntity_RadioHatch) aMetaTileEntity); - } else { - return false; - } - } - } - - @Override - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; - int blockcounter = 0; - - for (int x = -2; x <= 2; x++) - for (int z = -2; z <= 2; z++) - for (int y = 0; y < 4; y++) { - IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z); - if (y == 0 || y == 3) { - //controller - if (y == 0 && xDir + x == 0 && zDir + z == 0) - continue; - if (!(this.addOutputToMachineList(tileEntity, MCASING_INDEX) || this.addRadiationInputToMachineList(tileEntity, MCASING_INDEX) || this.addInputToMachineList(tileEntity, MCASING_INDEX) || this.addMaintenanceToMachineList(tileEntity, MCASING_INDEX) || this.addEnergyInputToMachineList(tileEntity, MCASING_INDEX))) { - if (BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, GregTech_API.sBlockCasings4, 1)) { - ++blockcounter; - continue; - } - return false; - } - } else { - if (Math.abs(x) < 2 && Math.abs(z) != 2) { - if (!(BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, Blocks.air) || (BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, FluidLoader.bioFluidBlock)))) { - return false; - } - } else { - if (x == -2 && z == -2 && y == 1) - mGlassTier = calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); - if (0 == mGlassTier || mGlassTier != calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z))) { - return false; - } - } - } - } - -// this.mWrench = true; -// this.mScrewdriver = true; -// this.mSoftHammer = true; -// this.mHardHammer = true; -// this.mSolderingTool = true; -// this.mCrowbar = true; - - if (blockcounter > 18) - if (this.mRadHatches.size() < 2) - if (this.mOutputHatches.size() == 1) - if (this.mMaintenanceHatches.size() == 1) - if (this.mInputHatches.size() > 0) - if (this.mEnergyHatches.size() > 0) - return true; - - return false; - } - - private byte calculateGlassTier(@Nonnull Block block, @Nonnegative Byte meta) { - - if (block.equals(BioItemList.bw_glasses[0])) - return meta > 1 && meta < 6 ? (byte) (meta + 3) : 4; - - if (block.getUnlocalizedName().equals("blockAlloyGlass")) - return 4; - - if (block.equals(Blocks.glass)) - return 3; - - for (BioVatLogicAdder.BlockMetaPair B : BioVatLogicAdder.BioVatGlass.getGlassMap().keySet()) - if (B.getBlock().equals(block) && B.getaByte().equals(meta)) - return BioVatLogicAdder.BioVatGlass.getGlassMap().get(B); - - if (block.getMaterial().equals(Material.glass)) - return 3; - - return 0; - } - - @Override - public int getMaxEfficiency(ItemStack itemStack) { - return 10000; - } - - @Override - public int getPollutionPerTick(ItemStack itemStack) { - return 0; - } - - @Override - public int getDamageToComponent(ItemStack itemStack) { - return 0; - } - - private void sendAllRequiredRendererPackets() { - int height = reCalculateHeight(); - if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) { - for (int x = -1; x < 2; x++) - for (int y = 1; y < height; y++) - for (int z = -1; z < 2; z++) - sendPackagesOrRenewRenderer(x, y, z, this.mCulture); - } - } - - private void sendPackagesOrRenewRenderer(int x, int y, int z, BioCulture lCulture) { - int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; - int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; - - staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId)); - staticColorMap.put(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId), lCulture == null ? BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB() : lCulture.getColorRGB()); - - if (FMLCommonHandler.instance().getSide().isServer()) { - MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( - this.getBaseMetaTileEntity().getWorld(), - new RendererPacket( - new Coords( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId - ), - lCulture == null ? BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB() : lCulture.getColorRGB(), - true - ), - this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getZCoord() - ); - MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( - this.getBaseMetaTileEntity().getWorld(), - new RendererPacket( - new Coords( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId - ), - lCulture == null ? BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB() : lCulture.getColorRGB(), - false - ), - this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getZCoord() - ); - } - needsVisualUpdate = true; - } - - private void check_Chunk() { - World aWorld = this.getBaseMetaTileEntity().getWorld(); - if (!aWorld.isRemote) { - Iterator var5 = aWorld.playerEntities.iterator(); - - while (var5.hasNext()) { - Object tObject = var5.next(); - if (!(tObject instanceof EntityPlayerMP)) { - break; - } - EntityPlayerMP tPlayer = (EntityPlayerMP) tObject; - Chunk tChunk = aWorld.getChunkFromBlockCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord()); - if (tPlayer.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { - if (!playerMPHashSet.contains(tPlayer)) { - playerMPHashSet.add(tPlayer); - sendAllRequiredRendererPackets(); - } - } else { - playerMPHashSet.remove(tPlayer); - } - - } - } - } - - private void placeFluid() { - int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; - int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; - height = reCalculateHeight(); - if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) - for (int x = -1; x < 2; x++) { - for (int y = 0; y < height; y++) { - for (int z = -1; z < 2; z++) { - if (this.getBaseMetaTileEntity().getWorld().getBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()).equals(Blocks.air)) - this.getBaseMetaTileEntity().getWorld().setBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), FluidLoader.bioFluidBlock); - } - } - } - } - - private int reCalculateFluidAmmount() { - int lFluidAmount = 0; - for (int i = 0; i < this.getStoredFluids().size(); i++) { - lFluidAmount += this.getStoredFluids().get(i).amount; - } - return lFluidAmount; - } - - private int reCalculateHeight() { - return (this.reCalculateFluidAmmount() > ((this.getCapacity() / 4) - 1) ? (this.reCalculateFluidAmmount() >= this.getCapacity() / 2 ? 3 : 2) : 1); - } - - public void doAllVisualThings() { - if (this.getBaseMetaTileEntity().isServerSide()) { - if (mMachine) { - ItemStack aStack = this.mInventory[1]; - BioCulture lCulture = null; - int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; - int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; - - if (this.getBaseMetaTileEntity().getTimer() % 200 == 0) { - check_Chunk(); - } - - if (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 0) { - for (int x = -1; x < 2; x++) - for (int y = 1; y < 3; y++) - for (int z = -1; z < 2; z++) - this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()); - } - - height = reCalculateHeight(); - if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) { - if ((!(BW_Util.areStacksEqual(aStack, mStack))) || (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 1)) { - for (int x = -1; x < 2; x++) { - for (int y = 1; y < height; y++) { - for (int z = -1; z < 2; z++) { - if (aStack == null || (aStack != null && aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0)) { - if (mCulture == null || aStack == null || aStack.getTagCompound() == null || mCulture.getID() != aStack.getTagCompound().getInteger("ID")) { - lCulture = aStack == null || aStack.getTagCompound() == null ? null : BioCulture.getBioCulture(aStack.getTagCompound().getString("Name")); - sendPackagesOrRenewRenderer(x, y, z, lCulture); - } - } - } - } - } - mStack = aStack; - mCulture = lCulture; - } - if (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 1) { - if (this.getBaseMetaTileEntity().isClientSide()) - new Throwable().printStackTrace(); - placeFluid(); - needsVisualUpdate = false; - } - } - } else { - onRemoval(); - } - } - } - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - super.onPostTick(aBaseMetaTileEntity, aTick); - if (height != reCalculateHeight()) - needsVisualUpdate = true; - doAllVisualThings(); - if (this.getBaseMetaTileEntity().isServerSide() && this.mRadHatches.size() == 1) - this.mSievert = this.mRadHatches.get(0).getSievert(); - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setInteger("mFluidHeight", height); - if (mCulture != null && !mCulture.getName().isEmpty()) - aNBT.setString("mCulture", mCulture.getName()); - else if ((mCulture == null || mCulture.getName().isEmpty()) && !aNBT.getString("mCulture").isEmpty()) { - aNBT.removeTag("mCulture"); - } - if (this.mFluid != null) - aNBT.setString("mFluid", mFluid.getName()); - super.saveNBTData(aNBT); - } - - @Override - public void onRemoval() { - int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; - int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; - for (int x = -1; x < 2; x++) { - for (int y = 1; y < 3; y++) { - for (int z = -1; z < 2; z++) { - if (this.getBaseMetaTileEntity().getWorld().getBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()).equals(FluidLoader.bioFluidBlock)) - this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()); - staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()), this.getBaseMetaTileEntity().getWorld().provider.dimensionId); - if (FMLCommonHandler.instance().getSide().isServer()) - MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( - this.getBaseMetaTileEntity().getWorld(), - new RendererPacket( - new Coords( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId - ), - mCulture == null ? BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB() : mCulture.getColorRGB(), - true - ), - this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getZCoord() - ); - } - } - } - super.onRemoval(); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - height = aNBT.getInteger("mFluidHeight"); - mCulture = BioCulture.getBioCulture(aNBT.getString("mCulture")); - if (!aNBT.getString("mFluid").isEmpty()) - mFluid = FluidRegistry.getFluid(aNBT.getString("mFluid")); - super.loadNBTData(aNBT); - } - - @Override - public boolean explodesOnComponentBreak(ItemStack itemStack) { - return false; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_TileEntity_BioVat(this.mName); - } - - @Override - public String[] getDescription() { - return new String[]{ - "Controller Block for the Bio Vat", - "LxHxD: 5x4x5", - "Bottom and top are Stainless Steel Casings", - "Bottom and top must contain:", - "1x Maintenance, 1x Output Hatch, 1 or more Input Hatches, 1 or more Input Buses, 0-1 Radiation Input Bus", - "The two middle layers must be build out of glass, hollow", - "The glass can be any glass, i.e. Tinkers Construct Clear Glass", - "Some Recipes need more advanced Glass Types", - "For maximum efficiency boost keep the Output Hatch always half filled!", - "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" - }; - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[MCASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[MCASING_INDEX]}; - } -} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java deleted file mode 100644 index adbb63e8d4..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities; - -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.gui.GT_GUIContainer_MultiMachine; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.api.util.GT_Config; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; -import ic2.core.block.reactor.tileentity.TileEntityNuclearReactorElectric; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; - -import java.lang.reflect.Field; -import java.util.Arrays; - -public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { - private byte mMode; - private byte mTier; - private static float nulearHeatMod = 2f; - - public GT_TileEntity_DEHP(int aID, int tier, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - mTier= (byte) tier; - } - - public GT_TileEntity_DEHP(String aName,byte mTier) { - super(aName); - this.mTier= (byte) mTier; - } - - @Override - public void onConfigLoad(GT_Config aConfig) { - try { - Class c = TileEntityNuclearReactorElectric.class; - Field f = c.getDeclaredField("huOutputModifier"); - f.setAccessible(true); - nulearHeatMod = f.getFloat(f); - }catch (SecurityException | IllegalArgumentException | ExceptionInInitializerError | NullPointerException | IllegalAccessException | NoSuchFieldException e){ - e.printStackTrace(); - } - super.onConfigLoad(aConfig); - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setByte("mTier",mTier); - aNBT.setByte("mMode",mMode); - super.saveNBTData(aNBT); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - mTier=aNBT.getByte("mTier"); - mMode=aNBT.getByte("mMode"); - super.loadNBTData(aNBT); - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_TileEntity_DEHP(this.mName,mTier); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "DrillingRig.png"); - } - - @Override - public String[] getDescription() { - String[] dscSteam = {"Controller Block for the Deep Earth Heat Pump " + (mTier > 1 ? mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + getCasingBlockItem().name(), "1x3x1 " + getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)","1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)","Consumes "+GT_Values.V[mTier+2]+"EU/t","Has 4 Modes, use the Screwdriver to change them:","0 Idle, 1 Steam, 2 Superheated Steam (requires Distilled Water), 3 Retract","Explodes when it runs out of Water/Distilled Water","Converts "+(long) (mTier*1200*20)+"L/s Water(minus 10% per Maintenance Problem) to Steam","Converts "+(long) (mTier*600*20)+"L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"}; - String[] dscCooleant = {"Controller Block for the Deep Earth Heat Pump " + (mTier > 1 ? mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + getCasingBlockItem().name(), "1x3x1 " + getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)","1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)","Consumes "+GT_Values.V[mTier+2]+"EU/t","Has 4 Modes, use the Screwdriver to change them:","0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract","Explodes when it runs out of Coolant","Heats up "+(long) (mTier*24*((double) nulearHeatMod))*20+"L/s Coolant(minus 10% per Maintenance Problem)"}; - return ConfigHandler.DEHPDirectSteam ? dscSteam : dscCooleant; - } - - @Override - protected ItemList getCasingBlockItem() { - return ItemList.Casing_HeatProof; - } - - @Override - protected Materials getFrameMaterial() { - return Materials.Tungsten; - } - - @Override - protected int getCasingTextureIndex() { - return 11; - } - - @Override - protected int getMinTier() { - return 2+mTier; - } - - @Override - protected boolean checkHatches() { - return !this.mMaintenanceHatches.isEmpty() && !this.mOutputHatches.isEmpty() && !this.mInputHatches.isEmpty(); - } - - private long getFluidFromHatches(Fluid f){ - long ret = 0; - for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches){ - if (ih.getFluid().getFluid().equals(f)) - ret += ih.getFluidAmount(); - } - return ret; - } - - private long getWaterFromHatches(boolean onlyDistilled){ - Fluid toConsume1 = FluidRegistry.WATER; - Fluid toConsume2 = GT_ModHandler.getDistilledWater(1L).getFluid(); - if (onlyDistilled) - toConsume1=toConsume2; - long ret = 0; - for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches){ - if (ih.getFluid().getFluid().equals(toConsume1) || ih.getFluid().getFluid().equals(toConsume2)) - ret += ih.getFluidAmount(); - } - return ret; - } - - @Override - protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { - if (mMode != 3){ - this.isPickingPipes = false; - return true; - } - return super.workingUpward(aStack, xDrill, yDrill, zDrill, xPipe, zPipe, yHead, oldYHead); - } - - @Override - public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - ++mMode; - if (mMode >=4) - mMode = 0; - GT_Utility.sendChatToPlayer(aPlayer,"Mode: "+mMode); - super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); - } - - protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { - if (mMode==3){ - this.isPickingPipes = true; - return true; - } - - if (!this.tryLowerPipe()) { - if (this.waitForPipes()) { - return false; - } else { - if (ConfigHandler.DEHPDirectSteam) { - if (mMode==1) { - long steamProduced = (mTier * 600 * 2L * this.mEfficiency / 10000L); - long waterConsume = ((steamProduced + 160) / 160); - - if (getWaterFromHatches(false) - waterConsume > 0) { - consumeFluid(FluidRegistry.WATER,waterConsume); - addOutput(GT_ModHandler.getSteam(steamProduced)); - } else { - explodeMultiblock(); - return false; - } - } else if (mMode==2) { - long steamProduced = (mTier * 300 * 2L * this.mEfficiency / 10000L); - long waterConsume = ((steamProduced + 160) / 160); - - if (getWaterFromHatches(true) - waterConsume > 0) { - consumeFluid(GT_ModHandler.getDistilledWater(1).getFluid(),waterConsume); - addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", (int) steamProduced)); - } else { - explodeMultiblock(); - return false; - } - } - }else{ - if (mMode==1 || mMode==2) { - long coolantConverted = (long) (mTier*24*((double) nulearHeatMod)*this.mEfficiency / 10000L); - if (getFluidFromHatches(FluidRegistry.getFluid("ic2coolant"))-coolantConverted > 0){ - consumeFluid(FluidRegistry.getFluid("ic2coolant"),coolantConverted); - addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", (int) coolantConverted )); - } else { - explodeMultiblock(); - return false; - } - } - } - } - } else { - return true; - } - return true; - } - - private boolean consumeFluid(Fluid fluid,long ammount){ - - - if (ammount> Integer.MAX_VALUE){ - int[] tmp = new int[(int) (ammount/Integer.MAX_VALUE)]; - Arrays.fill(tmp,(int) (ammount/Integer.MAX_VALUE)); - for (int i = 0; i < tmp.length; i++) { - for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches){ - if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid().getFluid().equals(fluid) ||ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) :ih.getFluid().getFluid().equals(fluid) ) - tmp[i] -= ih.drain((int) ammount,true).amount; - if (tmp[i] <= 0) - break; - } - } - - if (tmp[tmp.length-1] <= 0){ - return true; - } - - return false; - } - - long tmp = ammount; - for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches){ - if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid().getFluid().equals(fluid) ||ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) :ih.getFluid().getFluid().equals(fluid) ) - tmp -= ih.drain((int) ammount,true).amount; - if (tmp <= 0) - return true; - } - return false; - } - - @Override - protected void setElectricityStats() { - try { - this.mEUt=isPickingPipes ? 60 : Math.toIntExact(GT_Values.V[getMinTier()]); - }catch (ArithmeticException e){ - e.printStackTrace(); - this.mEUt = Integer.MAX_VALUE-7; - } - this.mProgresstime=0; - this.mMaxProgresstime=1; - this.mEfficiency = this.getCurrentEfficiency((ItemStack)null); - this.mEfficiencyIncrease = 10000; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java deleted file mode 100644 index f23fb5900e..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java +++ /dev/null @@ -1,428 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities; - -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_LESU; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; -import com.github.bartimaeusnek.bartworks.server.container.GT_Container_LESU; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import com.github.bartimaeusnek.bartworks.util.ConnectedBlocksChecker; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.Dyes; -import gregtech.api.enums.GT_Values; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Utility; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; - - -public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { - - - private static final byte TEXID_SIDE = 0; - private static final byte TEXID_CHARGING = 1; - private static final byte TEXID_IDLE = 2; - private static final byte TEXID_EMPTY = 3; - private static IIcon[] iIcons = new IIcon[4]; - private static IIconContainer[] iIconContainers = new IIconContainer[4]; - private static ITexture[][] iTextures = new ITexture[4][1]; - public ConnectedBlocksChecker connectedcells; - public ItemStack[] circuits = new ItemStack[5]; - private long mStorage; - - public GT_TileEntity_LESU(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - this.mStorage = ConfigHandler.energyPerCell; - } - - public GT_TileEntity_LESU(String aName) { - super(aName); - } - - - @Override - public boolean isEnetOutput() { - return true; - } - - @Override - public boolean isEnetInput() { - return true; - } - - @Override - public long maxEUStore() { - return (this.mStorage >= Long.MAX_VALUE - 1 || this.mStorage < 0) ? Long.MAX_VALUE - 1 : this.mStorage; - } - - @Override - public long maxAmperesIn() { - int ret = 0; - for (int i = 0; i < 5; ++i) - if (this.circuits[i] != null && this.circuits[i].getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) - ret += this.circuits[i].getItemDamage(); - return ret > 0 ? ret : 1; - } - - @Override - public long maxAmperesOut() { - return maxAmperesIn(); - } - - @Override - public long maxEUInput() { - - for (int i = 1; i < GT_Values.V.length; i++) { - if (maxEUOutput() <= GT_Values.V[i] && maxEUOutput() > GT_Values.V[i - 1]) - return Math.min(GT_Values.V[i], 32768L); - } - - return 8; - } - - @Override - public long maxEUOutput() { - return Math.min(Math.max(this.mStorage / ConfigHandler.energyPerCell, 1L), 32768L); - } - - @Override - public int rechargerSlotStartIndex() { - return 0; - } - - @Override - public int rechargerSlotCount() { - return 1; - } - - @Override - public int dechargerSlotStartIndex() { - return 1; - } - - @Override - public int dechargerSlotCount() { - return 1; - } - - @Override - public boolean isTeleporterCompatible() { - return true; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_TileEntity_LESU(mName); - } - - @Override - public String[] getDescription() { - return new String[]{ - "Controller Block for the GT2-Styled L.E.S.U.", - "Size: ANY", - "Storage per LESU Casing: " + ConfigHandler.energyPerCell + "EU", - "Output EU: LESU Casings amount" + - "Input EU: Next Voltage Tier to Output EU", - "Input/Output Amps can be configured via 4 Circuits in GUI", - "Output Side has a dot on it.", - ChatColorHelper.RED + "Only one Controller allowed, no Wallsharing!", - "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" - }; - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister aBlockIconRegister) { - - for (int i = 0; i < iTextures.length; i++) { - iIcons[i] = aBlockIconRegister.registerIcon(MainMod.modID + ":LESU_CASING_" + i); - final int finalI = i; - iIconContainers[i] = new IIconContainer() { - @Override - public IIcon getIcon() { - return iIcons[finalI]; - } - - @Override - public IIcon getOverlayIcon() { - return iIcons[finalI]; - } - - @Override - public ResourceLocation getTextureFile() { - return new ResourceLocation(MainMod.modID + ":LESU_CASING_" + finalI); - } - }; - } - - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_LESU(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_LESU(aPlayerInventory, aBaseMetaTileEntity); - } - - public boolean isServerSide() { - return !isClientSide(); - } - - public boolean isClientSide() { - if (getWorld() != null) - return getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; - return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; - } - - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - - ITexture[] ret = new ITexture[0]; - - if (this.isClientSide()) { - - for (int i = 0; i < iTextures.length; i++) { - iTextures[i][0] = new GT_RenderedTexture(iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); - } - - if (aSide == aFacing && this.getBaseMetaTileEntity().getUniversalEnergyStored() <= 0) - ret = iTextures[TEXID_EMPTY]; - else if (aSide == aFacing && !aActive) - ret = iTextures[TEXID_IDLE]; - else if (aSide == aFacing && aActive) - ret = iTextures[TEXID_CHARGING]; - else - ret = iTextures[TEXID_SIDE]; - } - - return ret; - } - - @Override - public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) { - return true; - } - - @Override - public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) { - return true; - } - - @Override - public int getSizeInventory() { - return 6; - } - - @Override - public ItemStack getStackInSlot(int p_70301_1_) { - if (p_70301_1_ > 1) - return this.circuits[(p_70301_1_ - 2)]; - return this.mInventory[p_70301_1_]; - } - - @Override - public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { - if (p_70299_1_ < 2) - this.mInventory[p_70299_1_] = p_70299_2_; - else - this.circuits[(p_70299_1_ - 2)] = p_70299_2_; - } - - @Override - public String getInventoryName() { - return "L.E.S.U."; - } - - @Override - public boolean hasCustomInventoryName() { - return true; - } - - @Override - public int getInventoryStackLimit() { - return 1; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { - return true; - } - - @Override - public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - - switch (p_94041_1_) { - case 0: - case 1: - return true; - default: - return p_94041_2_.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); - } - } - - @Override - public boolean isCorrectMachinePart(ItemStack itemStack) { - return true; - } - - @Override - public boolean checkRecipe(ItemStack itemStack) { - return true; - } - - @Override - public boolean isInputFacing(byte aSide) { - return aSide != this.getBaseMetaTileEntity().getFrontFacing(); - } - - @Override - public boolean isOutputFacing(byte aSide) { - return aSide == this.getBaseMetaTileEntity().getFrontFacing(); - } - - @Override - public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { - checkMachine(aBaseMetaTileEntity, null); - super.onFirstTick(aBaseMetaTileEntity); - } - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (aBaseMetaTileEntity.isServerSide()) { - this.mMaxProgresstime = 1; - if (aTick % 20 == 0) - checkMachine(aBaseMetaTileEntity, null); - this.mWrench = true; - this.mScrewdriver = true; - this.mSoftHammer = true; - this.mHardHammer = true; - this.mSolderingTool = true; - this.mCrowbar = true; - } - } - - @Override - public long getMinimumStoredEU() { - return 0; - } - - @Override - public boolean onRunningTick(ItemStack aStack) { - this.mMaxProgresstime = 1; - return true; - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setIntArray("customCircuitInv", GT_Utility.stacksToIntArray(this.circuits)); - super.saveNBTData(aNBT); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - int[] stacks = aNBT.getIntArray("customCircuitInv"); - for (int i = 0; i < stacks.length; i++) { - this.circuits[i] = GT_Utility.intToStack(stacks[i]); - } - super.loadNBTData(aNBT); - } - - @Override - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - long startingTime = System.nanoTime(); - connectedcells = new ConnectedBlocksChecker(); - connectedcells.get_connected(aBaseMetaTileEntity.getWorld(), aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), ItemRegistry.BW_BLOCKS[1]); - - if (connectedcells.get_meta_of_sideblocks(aBaseMetaTileEntity.getWorld(), this.getBaseMetaTileEntity().getMetaTileID(), new int[]{aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()}, true)) { - this.getBaseMetaTileEntity().disableWorking(); - this.getBaseMetaTileEntity().setActive(false); - this.mStorage = 0; - this.mMaxProgresstime = 0; - this.mProgresstime = 0; - return false; - } - - this.mEfficiency = this.getMaxEfficiency(null); - this.mStorage = (ConfigHandler.energyPerCell * connectedcells.hashset.size() >= Long.MAX_VALUE - 1 || ConfigHandler.energyPerCell * connectedcells.hashset.size() < 0) ? Long.MAX_VALUE - 1 : ConfigHandler.energyPerCell * connectedcells.hashset.size(); - this.mMaxProgresstime = 1; - this.mProgresstime = 0; - - this.mCrowbar = true; - this.mHardHammer = true; - this.mScrewdriver = true; - this.mSoftHammer = true; - this.mSolderingTool = true; - this.mWrench = true; - - this.getBaseMetaTileEntity().enableWorking(); - this.getBaseMetaTileEntity().setActive(true); - - long finishedTime = System.nanoTime(); - if (finishedTime - startingTime > 5000000) - MainMod.logger.warn("LESU LookUp took longer than 5ms!(" + (finishedTime - startingTime) + "ns / " + ((finishedTime - startingTime) / 1000000) + "ms) Check at x:" + this.getBaseMetaTileEntity().getXCoord() + " y:" + this.getBaseMetaTileEntity().getYCoord() + " z:" + this.getBaseMetaTileEntity().getZCoord() + " DIM-ID: " + this.getBaseMetaTileEntity().getWorld().provider.dimensionId); - return true; - } - - @Override - public int getMaxEfficiency(ItemStack itemStack) { - return 10000; - } - - @Override - public int getPollutionPerTick(ItemStack itemStack) { - return 0; - } - - @Override - public int getDamageToComponent(ItemStack itemStack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack itemStack) { - return false; - } - - public World getWorld() { - return this.getBaseMetaTileEntity().getWorld(); - } - -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java deleted file mode 100644 index 5ae36c80da..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java +++ /dev/null @@ -1,458 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities; - -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; - -import static gregtech.api.enums.GT_Values.V; - -public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase { - - private static final byte SINGLE_UPSTEP = 0; - private static final byte SINGLE_DOWNSTEP = 1; - private static final byte MULTI_UPSTEP = 2; - private static final byte MULTI_DOWNSTEP = 3; - private byte mode = 0; - private byte texid = 2; - private long mCoilWicks = 0; - private boolean upstep = true; - - public GT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public GT_TileEntity_ManualTrafo(String aName) { - super(aName); - } - - @Override - public boolean isCorrectMachinePart(ItemStack itemStack) { - return true; - } - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (!this.getBaseMetaTileEntity().isAllowedToWork()) - this.stopMachine(); - super.onPostTick(aBaseMetaTileEntity, aTick); - } - - @Override - public boolean onRunningTick(ItemStack aStack) { - if (!this.getBaseMetaTileEntity().isAllowedToWork()) { - this.stopMachine(); - return false; - } - - this.mProgresstime = 0; - this.mMaxProgresstime = 1; - - if (this.getBaseMetaTileEntity().getTimer() % 40 == 0) - if (this.mEfficiency < this.getMaxEfficiency(null)) - this.mEfficiency += 100; - else - this.mEfficiency = this.getMaxEfficiency(null); - - if (this.mode > SINGLE_DOWNSTEP) { - return this.onRunningTickTabbedMode(); - } - - boolean ret = this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput(this.getInputTier() * 2 * this.mEnergyHatches.size() * (long) this.mEfficiency / this.getMaxEfficiency(null)); - - return ret; - } - - public boolean onRunningTickTabbedMode() { - - for (GT_MetaTileEntity_Hatch_Dynamo E : mDynamoHatches) { - for (GT_MetaTileEntity_Hatch_Energy I : mEnergyHatches) { - - long vtt = I.getEUVar() >= (V[E.mTier] / 2) && E.getEUVar() < E.maxEUStore() ? I.getEUVar() : 0; - - if (vtt == 0) - continue; - - long vtp = E.getEUVar() + (vtt); - long avt = vtp < E.maxEUStore() ? vtp : E.maxEUStore(); - E.setEUVar(avt); - I.setEUVar(I.getEUVar() - vtt); - } - - } - - return true; - } - - - public long getInputTier() { - if (this.mEnergyHatches.size() > 0) - return (long) GT_Utility.getTier(this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); - else return 0; - } - - public long getOutputTier() { - if (this.mDynamoHatches.size() > 0) - return (long) GT_Utility.getTier(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); - else return 0; - } - - @Override - public boolean checkRecipe(ItemStack itemStack) { - - if (!this.getBaseMetaTileEntity().isAllowedToWork()) { - this.stopMachine(); - return false; - } - this.mode = this.mInventory[1] == null ? 0 : this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit") ? this.mInventory[1].getItemDamage() > 4 ? (byte) this.mInventory[1].getItemDamage() : 0 : 0; - this.upstep = (this.mode == 0 || this.mode == 2); - this.mProgresstime = 0; - this.mMaxProgresstime = 1; - this.mEfficiency = this.mEfficiency > 100 ? this.mEfficiency : 100; - return this.upstep ? this.getOutputTier() - this.getInputTier() == mCoilWicks : this.getInputTier() - this.getOutputTier() == mCoilWicks; - } - - @Override - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - - this.mode = this.mInventory[1] == null ? 0 : this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit") ? this.mInventory[1].getItemDamage() > 4 ? (byte) this.mInventory[1].getItemDamage() : 0 : 0; - - if (this.mode <= 1) { - - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; - - //check height - int y = 1; - boolean stillcoil = true; - while (stillcoil) { - for (int x = -1; x <= 1; ++x) { - for (int z = -1; z <= 1; ++z) { - if (x != 0 || z != 0) { - stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; - if (stillcoil) { - ++this.mCoilWicks; - if (mCoilWicks % 8 == 0) { - ++y; - continue; - } - } else - break; - } - } - if (!stillcoil) - break; - } - } - - if (mCoilWicks % 8 != 0) - return false; - - this.mCoilWicks = this.mCoilWicks / 8; - - //check interior (NiFeZn02 Core) - for (int i = 1; i <= this.mCoilWicks; ++i) { - if (!aBaseMetaTileEntity.getBlockOffset(xDir, i, zDir).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir, i, zDir) == 0) { - return false; - } - } - - //check Bottom - for (int x = -1; x <= 1; ++x) - for (int z = -1; z <= 1; ++z) - if (xDir + x != 0 || zDir + z != 0) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } - /* - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { - return false; - } - */ - } - } - - //check Top - for (int x = -1; x <= 1; ++x) - for (int z = -1; z <= 1; ++z) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addDynamoToMachineList(tTileEntity, texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } - /* - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { - return false; - } - */ - } - } - - // check dynamos and energy hatches for the same tier - byte outtier = this.mDynamoHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { - if (out.mTier != outtier) - return false; - } - - byte intier = this.mEnergyHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) { - if (in.mTier != intier) - return false; - } - } else { - - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; - int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY * 2; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; - //check height - int y = 1; - boolean stillcoil = true; - while (stillcoil) { - for (int x = -1; x <= 1; ++x) { - for (int z = -1; z <= 1; ++z) { - if (x != 0 || z != 0) { - stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; - if (stillcoil) { - ++this.mCoilWicks; - if (mCoilWicks % 8 == 0) { - ++y; - continue; - } - } else - break; - } - } - if (!stillcoil) - break; - } - } - - if (mCoilWicks % 8 != 0) - return false; - - this.mCoilWicks = this.mCoilWicks / 8; - - //check interior (NiFeZn02 Core) - for (int i = 1; i <= this.mCoilWicks; ++i) { - if (!aBaseMetaTileEntity.getBlockOffset(xDir, i, zDir).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir, i, zDir) == 0) { - return false; - } - } - - //check Bottom - for (int x = -2; x <= 2; ++x) - for (int z = -2; z <= 2; ++z) - if (xDir + x != 0 || zDir + z != 0) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } - /* - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { - return false; - } - */ - } - } - - //check Top - for (int x = -2; x <= 2; ++x) - for (int z = -2; z <= 2; ++z) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addDynamoToMachineList(tTileEntity, texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } - /* - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { - return false; - } - */ - } - } - - if (this.mDynamoHatches.size() <= 0 || this.mEnergyHatches.size() <= 0) - return false; - - byte outtier = this.mDynamoHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { - if (out.mTier != outtier) - return false; - } - - byte intier = this.mEnergyHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) { - if (in.mTier != intier) - return false; - } - - - //check tap hull - for (int ty = 1; ty <= y; ++ty) { - - byte leveltier = 0; - if (this.mInventory[1].getItemDamage() == 2) - leveltier = ((byte) (intier - ty)); - else if (this.mInventory[1].getItemDamage() == 3) - leveltier = ((byte) (intier + ty)); - else - return false; - - for (int x = -2; x <= 2; ++x) - for (int z = -2; z <= 2; ++z) - if (x == -2 || z == -2 || x == 2 || z == 2) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, ty, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid, leveltier) && !this.addDynamoToMachineList(tTileEntity, texid, leveltier)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, ty, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } - } - } - } - } - if (this.mDynamoHatches.isEmpty() || this.mEnergyHatches.isEmpty()) - return false; - - return true; - } - - @Override - public int getMaxEfficiency(ItemStack itemStack) { - return 10000; - } - - @Override - public int getPollutionPerTick(ItemStack itemStack) { - return 0; - } - - @Override - public int getDamageToComponent(ItemStack itemStack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack itemStack) { - return true; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_TileEntity_ManualTrafo(mName); - } - - @Override - public String[] getDescription() { - return new String[]{ - "Controller Block for the Manual Trafo", - //"Operates in 4 Differents Modes:", - "Operates currently in 2 Differents Modes:", - "Mode 1: Circuit 0 in controller: Direct-Upstep", - "Mode 2: Circuit 1 in controller: Direct-Downstep", - //"Mode 3: Circuit 2 in controller: Tapped-Upstep", - //"Mode 4: Circuit 3 in controller: Tapped-Downstep", - "For direct Modes: 3xHx3", - "Base Contains at least 1 Energy Hatch", - "1 Layer of Dynamo Coils for each Tier transformed", - "Middle of Dynamo Coils needs to be a NickelFerrite Core", - "Top Contains at least 1 Dynamo Hatch", - "Maintenance Hatch can be placed anywhere", - "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" - //"Tapped Mode is disabled." - }; - } - - @Override - public void saveNBTData(NBTTagCompound ntag) { - ntag.setLong("mCoilWicks", mCoilWicks); - super.saveNBTData(ntag); - } - - @Override - public void loadNBTData(NBTTagCompound ntag) { - super.loadNBTData(ntag); - mCoilWicks = ntag.getLong("mCoilWicks"); - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[texid], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[texid]}; - } - - public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex, short tier) { - if (aTileEntity == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { - if (tier == ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mTier) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - } - return false; - } else { - return false; - } - } - } - - public boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex, short tier) { - if (aTileEntity == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { - if (tier == ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mTier) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); - } - return false; - } else { - return false; - } - } - } - -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java deleted file mode 100644 index aff4e196c4..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java +++ /dev/null @@ -1,657 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities; - -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_Windmill; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.SubTag; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.objects.XSTR; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityDispenser; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.util.ForgeDirection; - -import java.util.ArrayList; - -import static gregtech.api.enums.GT_Values.V; - -public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { - - private static IIcon[] iIcons = new IIcon[2]; - private static IIconContainer[] iIconContainers = new IIconContainer[2]; - private static ITexture[] iTextures = new ITexture[3]; - - private final ArrayList tedList = new ArrayList(); - private BW_RotorBlock rotorBlock; - private byte hasDoor; - - public GT_TileEntity_Windmill(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - private GT_TileEntity_Windmill(String aName) { - super(aName); - } - - @Override - public boolean isCorrectMachinePart(ItemStack itemStack) { - return true; - } - - public boolean onRunningTick(ItemStack aStack) { - if (this.mMaxProgresstime > 0) - this.mProgresstime += this.rotorBlock.getGrindPower(); - return this.rotorBlock.getGrindPower() > 0; - } - - public boolean doRandomMaintenanceDamage() { - return true; - } - - @Override - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return true; - } - - public boolean recipe_fallback(ItemStack aStack) { - //sight... fallback to the macerator recipes - GT_Recipe.GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; - if (tMap == null) - return false; - GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), false, false, V[1], null, aStack); - if (tRecipe == null) - return false; - if (tRecipe.getOutput(0) != null) { - aStack.stackSize--; - mOutputItems[0] = tRecipe.getOutput(0); - - if (new XSTR().nextInt(2) == 0) { - if (tRecipe.getOutput(1) != null) - mOutputItems[1] = tRecipe.getOutput(1); - else if (GT_OreDictUnificator.getAssociation(aStack) == null || GT_OreDictUnificator.getAssociation(aStack).mMaterial == null || GT_OreDictUnificator.getAssociation(aStack).mMaterial.mMaterial == null || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Flint || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Sugar || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Wheat || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Wood || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Clay || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Ash || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Snow || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Stone || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.MeatRaw || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.MeatCooked - ) - mOutputItems[1] = tRecipe.getOutput(0); - } - } - this.mMaxProgresstime = (tRecipe.mDuration * 2 * 100); - return true; - } - - @Override - public boolean checkRecipe(ItemStack itemStack) { - - if (itemStack == null || itemStack.getItem() == null) - return false; - - if (this.mOutputItems == null) - this.mOutputItems = new ItemStack[2]; - - //Override Recipes that doesnt quite work well with OreUnificator - //Items - if (itemStack.getItem().equals(Items.wheat)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 15 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 1L)); - this.mOutputItems[1] = (GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wheat, 1L)); - return true; - } else if (itemStack.getItem().equals(Items.bone)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 15 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = new ItemStack(Items.dye, 4, 15); - else - this.mOutputItems[0] = new ItemStack(Items.dye, 3, 15); - return true; - } - //Blocks - else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.gravel)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 30 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = new ItemStack(Items.flint, 2); - else - this.mOutputItems[0] = new ItemStack(Items.flint); - return true; - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.cobblestone) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stone)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 2L); - else - this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L); - return true; - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.sandstone)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 45 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = new ItemStack(Blocks.sand, 3); - else - this.mOutputItems[0] = new ItemStack(Blocks.sand, 2); - return true; - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.hardened_clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stained_hardened_clay)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = Materials.Clay.getDust(2); - else - this.mOutputItems[0] = Materials.Clay.getDust(1); - return true; - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.redstone_block)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - this.mOutputItems[0] = Materials.Redstone.getDust(9); - return true; - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glass)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glass, 1L)); - return true; - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.wool)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = new ItemStack(Items.string, 3); - else - this.mOutputItems[0] = new ItemStack(Items.string, 2); - return true; - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glowstone)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = new ItemStack(Items.glowstone_dust, 4); - else - this.mOutputItems[0] = new ItemStack(Items.glowstone_dust, 3); - return true; - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.netherrack)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Netherrack, 2L)); - else - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Netherrack, 1L)); - return true; - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L)); - else - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L)); - return true; - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log2)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L)); - else - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L)); - return true; - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.pumpkin)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 15 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = new ItemStack(Items.pumpkin_seeds, 2); - else - this.mOutputItems[0] = new ItemStack(Items.pumpkin_seeds, 1); - return true; - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.melon_block)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 15 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = new ItemStack(Items.melon_seeds, 2); - else - this.mOutputItems[0] = new ItemStack(Items.melon_seeds, 1); - return true; - } - - //null checks for GT shit - if (GT_OreDictUnificator.getAssociation(itemStack) == null || - GT_OreDictUnificator.getAssociation(itemStack).mPrefix == null || - GT_OreDictUnificator.getAssociation(itemStack).mMaterial == null || - GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial == null || - GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.getDust(1) == null - ) - return recipe_fallback(itemStack); //fallback for all non-unificated Items - - //Ore Unificator shit for balance - if (OrePrefixes.ingot.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.gem.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 45 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); - return true; - } else if (OrePrefixes.ore.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.crushed, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); - return true; - } else if (OrePrefixes.nugget.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 15 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dustTiny, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); - return true; - } else if (OrePrefixes.crushed.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 30 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dustImpure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); - return true; - } else if (OrePrefixes.crushedPurified.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 30 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dustPure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); - return true; - } else if (OrePrefixes.crushedCentrifuged.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 30 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); - return true; - } else if (OrePrefixes.block.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, (GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL)) ? 9L : 1L)); - return true; - } else if ( - OrePrefixes.stone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneChiseled.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneCobble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneCracked.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneMossy.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneMossyBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneSmooth.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.cobblestone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - ) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 2L)); - else - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); - return true; - } - return recipe_fallback(itemStack); //2nd fallback - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new BW_GUIContainer_Windmill(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName()); - } - - public boolean addDispenserToOutputSet(TileEntity aTileEntity) { - if (aTileEntity instanceof TileEntityDispenser) { - this.tedList.add((TileEntityDispenser) aTileEntity); - return true; - } - return false; - } - - public boolean addOutput(ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack)) - return false; - - for (TileEntityDispenser tHatch : this.tedList) { - for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) { - if (tHatch.getStackInSlot(i) == null || GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack) && aStack.stackSize + tHatch.getStackInSlot(i).stackSize <= 64) { - if (GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack)) { - ItemStack merge = tHatch.getStackInSlot(i).copy(); - merge.stackSize = aStack.stackSize + tHatch.getStackInSlot(i).stackSize; - tHatch.setInventorySlotContents(i, merge); - } else { - tHatch.setInventorySlotContents(i, aStack.copy()); - } - - if (GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack)) { - aStack = null; - return true; - } else { - tHatch.setInventorySlotContents(i, null); - aStack = null; - return false; - } - } - } - } - return false; - } - - @Override - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - /* - * offset x1 = 3x3 - * offset x2 = 5x5 - * offset x3 = 7x7 - * etc. - */ - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 3; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 3; - - //floor - for (int x = -3; x <= 3; x++) { - for (int z = -3; z <= 3; z++) { - if (!((Math.abs(x) == 3 && Math.abs(z) == 3) || (xDir + x == 0 && zDir + z == 0))) - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != Blocks.brick_block) { - return false; - } - } - } - - //h_clay shaft - for (int y = 1; y <= 4; y++) - for (int x = -2; x <= 2; x++) - for (int z = -2; z <= 2; z++) { - if (!((Math.abs(x) == 2 && Math.abs(z) == 2) || (Math.abs(x) < 2 && Math.abs(z) != 2))) - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) != Blocks.hardened_clay && !this.addDispenserToOutputSet(aBaseMetaTileEntity.getTileEntityOffset(xDir + x, y, zDir + z))) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == Blocks.wooden_door && this.hasDoor < 3) { - this.hasDoor++; - continue; - } - return false; - } - } - - //plank layer 1 - for (int x = -2; x <= 2; x++) - for (int z = -2; z <= 2; z++) { - if (!(Math.abs(x) < 2 && Math.abs(z) != 2)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 5, zDir + z) != Blocks.planks) - return false; - } - } - - //plank layer 2-4 - for (int x = -3; x <= 3; x++) - for (int y = 6; y <= 8; y++) - for (int z = -3; z <= 3; z++) - if (!(((Math.abs(x) == 3 && Math.abs(z) == 3) || (Math.abs(x) < 3 && (Math.abs(z) != 2 || Math.abs(z) != 1))) || (xDir + x == 0 && zDir + z == 0 && y == 7))) - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) != Blocks.planks) - return false; - - //plank layer 5 - for (int x = -2; x <= 2; x++) - for (int z = -2; z <= 2; z++) - if (!(Math.abs(x) < 2 && (Math.abs(z) != 2))) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 9, zDir + z) != Blocks.planks) - return false; - } - //plank layer 6 - for (int x = -1; x <= 1; x++) - for (int z = -1; z <= 1; z++) - if (!(Math.abs(x) < 1 && (Math.abs(z) != 1))) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 10, zDir + z) != Blocks.planks) - return false; - } - //plank layer 7 - if (aBaseMetaTileEntity.getBlockOffset(xDir, 11, zDir) != Blocks.planks) - return false; - - //Rotor Block - TileEntity te = this.getBaseMetaTileEntity().getWorld().getTileEntity(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord() + 7, this.getBaseMetaTileEntity().getZCoord()); - - if (te instanceof BW_RotorBlock) - this.rotorBlock = (BW_RotorBlock) te; - else - return false; - - //check for outputs - if (this.tedList.isEmpty()) - return false; - - this.mWrench = true; - this.mScrewdriver = true; - this.mSoftHammer = true; - this.mHardHammer = true; - this.mSolderingTool = true; - this.mCrowbar = true; - - //reset door cause bugs >_> - this.hasDoor = 0; - - return true; - } - - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (aBaseMetaTileEntity.isServerSide()) { - if (this.mEfficiency < 0) - this.mEfficiency = 0; - if (--this.mUpdate == 0 || --this.mStartUpCheck == 0) { - this.hasDoor = 0; - this.tedList.clear(); - this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); - } - if (this.mStartUpCheck < 0) { - if (this.mMachine) { - if (this.mMaxProgresstime > 0) { - if (this.onRunningTick(this.mInventory[1])) { - if (this.mMaxProgresstime > 0 && this.mProgresstime >= this.mMaxProgresstime) { - if (this.mOutputItems != null) - for (ItemStack tStack : this.mOutputItems) - if (tStack != null) { - this.addOutput(tStack); - } - this.mEfficiency = 10000; - this.mOutputItems = new ItemStack[2]; - this.mProgresstime = 0; - this.mMaxProgresstime = 0; - this.mEfficiencyIncrease = 0; - if (aBaseMetaTileEntity.isAllowedToWork()) { - if (this.checkRecipe(this.mInventory[1])) - this.updateSlots(); - } - } - } - } else { - if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) { - if (aBaseMetaTileEntity.isAllowedToWork()) { - if (this.checkRecipe(this.mInventory[1])) - this.updateSlots(); - } - } - } - } else { - this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); - return; - } - } else { - this.stopMachine(); - } - } - aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (this.mWrench ? 0 : 1) | (this.mScrewdriver ? 0 : 2) | (this.mSoftHammer ? 0 : 4) | (this.mHardHammer ? 0 : 8) | (this.mSolderingTool ? 0 : 16) | (this.mCrowbar ? 0 : 32) | (this.mMachine ? 0 : 64)); - aBaseMetaTileEntity.setActive(this.mMaxProgresstime > 0); - } - - @Override - public int getCurrentEfficiency(ItemStack itemStack) { - return 10000; - } - - @Override - public void updateSlots() { - if (this.mInventory[1] != null && this.mInventory[1].stackSize <= 0) { - this.mInventory[1] = null; - } - } - - @Override - public int getMaxEfficiency(ItemStack itemStack) { - return 10000; - } - - @Override - public int getPollutionPerTick(ItemStack itemStack) { - return 0; - } - - @Override - public int getDamageToComponent(ItemStack itemStack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack itemStack) { - return false; - } - - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_TileEntity_Windmill(this.mName); - } - - @Override - public String[] getDescription() { - return new String[]{ - "A primitive Grinder powered by Kinetic energy.", - "WxHxL: 7x12x7", - "Layer 1: 7x7 Bricks, corners are air, controller at front centered.", - "Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,", - "hollow, Wall must contain at least one Dispenser", - "Layer 6: 5x5 Wood Planks. Corners are filled, hollow.", - "Layer 7: 7x7 Wood Planks. Corners are air, hollow.", - "Layer 8: 7x7 Wood Planks. Corners are air, hollow,", - "front centered must be a Primitive Kinetic Shaftbox", - "Layer 9: 7x7 Wood Planks. Corners are air, hollow.", - "Layer 10: 5x5 Wood Planks. Corners are filled, hollow.", - "Layer 11: 3x3 Wood Planks. Corners are filled, hollow.", - "Layer 12: 1x1 Wood Plank.", - "Needs a Wind Mill Rotor in the Shaftbox to operate", - "Input items in Controller", - "Output items will appear in the dispensers", - "It is faster in regions with more wind (like IC2 Windmills)", - "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" - }; - } - - @Override - public String[] getInfoData() { - return new String[]{"Progress:", this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", Integer.toString(this.rotorBlock.getGrindPower()) + "KU/t" }; - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister aBlockIconRegister) { - iIcons[0] = Blocks.brick_block.getIcon(0, 0); - iIconContainers[0] = new IIconContainer() { - @Override - public IIcon getIcon() { - return iIcons[0]; - } - - @Override - public IIcon getOverlayIcon() { - return null; - } - - @Override - public ResourceLocation getTextureFile() { - return new ResourceLocation("brick"); - } - }; - - iIcons[1] = aBlockIconRegister.registerIcon(MainMod.modID + ":windmill_top"); - iIconContainers[1] = new IIconContainer() { - @Override - public IIcon getIcon() { - return iIcons[1]; - } - - @Override - public IIcon getOverlayIcon() { - return null; - } - - @Override - public ResourceLocation getTextureFile() { - return new ResourceLocation(MainMod.modID + ":windmill_top"); - } - }; - - - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - - ITexture[] ret = new ITexture[6]; - - if (isClientSide()) { - - if (aFacing == aSide || aSide == 0) { - iTextures[0] = new GT_RenderedTexture(iIconContainers[0]); - for (int i = 0; i < ret.length; i++) { - ret[i] = iTextures[0]; - } - } else if (aSide == 1) { - iTextures[1] = new GT_RenderedTexture(iIconContainers[1]); - for (int i = 0; i < ret.length; i++) { - ret[i] = iTextures[1]; - } - } else { - iTextures[2] = new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE); - for (int i = 0; i < ret.length; i++) { - ret[i] = iTextures[2]; - } - } - } - return ret; - } - - public boolean isClientSide() { - if (this.getBaseMetaTileEntity().getWorld() != null) - return this.getBaseMetaTileEntity().getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; - return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java new file mode 100644 index 0000000000..9d492bb87f --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.classic; + +import net.minecraft.tileentity.TileEntity; + +public class BWTileEntityDimIDBridge extends TileEntity { +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java new file mode 100644 index 0000000000..767e6bd383 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.classic; + +import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_RotorBlock; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.block.kineticgenerator.container.ContainerWindKineticGenerator; +import ic2.core.block.kineticgenerator.tileentity.TileEntityWindKineticGenerator; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; + +public class BW_RotorBlock extends TileEntityWindKineticGenerator { + + public int getGrindPower() { + return super.getKuOutput(); + } + + public int getKuOutput() { + return 0; + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin) { + return new BW_GUIContainer_RotorBlock(new ContainerWindKineticGenerator(entityPlayer, this)); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java new file mode 100644 index 0000000000..30ff2f4b07 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -0,0 +1,625 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; + +import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.items.LabParts; +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.common.net.RendererPacket; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; +import com.github.bartimaeusnek.bartworks.util.*; +import cpw.mods.fml.common.FMLCommonHandler; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import javax.annotation.Nonnegative; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; + +public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { + + public static final HashMap staticColorMap = new HashMap<>(); + + private static final byte MCASING_INDEX = 49; + private static final byte TIMERDIVIDER = 20; + + private final HashSet playerMPHashSet = new HashSet(); + private final ArrayList mRadHatches = new ArrayList<>(); + private int height = 1; + private GT_Recipe mLastRecipe = null; + private Fluid mFluid = FluidRegistry.LAVA; + private BioCulture mCulture; + private ItemStack mStack = null; + private boolean needsVisualUpdate = true; + private byte mGlassTier = 0; + private int mSievert = 0; + + + public GT_TileEntity_BioVat(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_BioVat(String aName) { + super(aName); + } + + private static int[] specialValueUnpack(int aSpecialValure) { + int[] ret = new int[4]; + ret[0] = aSpecialValure & 0xF; // = glas tier + ret[1] = aSpecialValure >>> 4 & 0b11; // = special valure + ret[2] = aSpecialValure >>> 6 & 0b1; //exact svt + ret[3] = aSpecialValure >>> 7 & Integer.MAX_VALUE; // = sievert + return ret; + } + + public boolean isLiquidInput(byte aSide) { + return false; + } + + public boolean isLiquidOutput(byte aSide) { + return false; + } + + private int getInputCapacity() { + int ret = 0; + + for (GT_MetaTileEntity_Hatch_Input fluidH : this.mInputHatches) { + ret += fluidH.getCapacity(); + } + return ret; + } + + private int getOutputCapacity() { + int ret = 0; + + for (GT_MetaTileEntity_Hatch_Output fluidH : this.mOutputHatches) { + ret += fluidH.getCapacity(); + } + return ret; + } + + @Override + public int getCapacity() { + int ret = 0; + ret += getInputCapacity(); + //ret += getOutputCapacity(); + return ret; + } + + @Override + public int fill(FluidStack resource, boolean doFill) { + return super.fill(resource, doFill); + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return BWRecipes.instance.getMappingsFor(BWRecipes.BACTERIALVATBYTE); + } + + private int calcMod(double x) { + return (int) Math.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + GT_Recipe.GT_Recipe_Map gtRecipeMap = getRecipeMap(); + + if (gtRecipeMap == null) + return false; + + ArrayList tInputList = getStoredInputs(); + int tInputList_sS = tInputList.size(); + for (int i = 0; i < tInputList_sS - 1; i++) { + for (int j = i + 1; j < tInputList_sS; j++) { + if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { + if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { + tInputList.remove(j--); + tInputList_sS = tInputList.size(); + } else { + tInputList.remove(i--); + tInputList_sS = tInputList.size(); + break; + } + } + } + } + ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); + + ArrayList tFluidList = getStoredFluids(); + int tFluidList_sS = tFluidList.size(); + for (int i = 0; i < tFluidList_sS - 1; i++) { + for (int j = i + 1; j < tFluidList_sS; j++) { + if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { + if (tFluidList.get(i).amount >= tFluidList.get(j).amount) { + tFluidList.remove(j--); + tFluidList_sS = tFluidList.size(); + } else { + tFluidList.remove(i--); + tFluidList_sS = tFluidList.size(); + break; + } + } + } + } + + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); + + if (tFluidList.size() > 0) { + + GT_Recipe gtRecipe = gtRecipeMap.findRecipe(this.getBaseMetaTileEntity(), mLastRecipe, false, this.getMaxInputVoltage(), tFluids, itemStack, tInputs); + + if (gtRecipe == null) + return false; + + if (!BW_Util.areStacksEqual((ItemStack) gtRecipe.mSpecialItems, itemStack)) + return false; + + int[] conditions = specialValueUnpack(gtRecipe.mSpecialValue); + + if (conditions[2] == 0 ? (this.mSievert < conditions[3] || this.mGlassTier < conditions[0]) : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0])) + return false; + + int times = 1; + + + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + if (gtRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { + if (getStoredFluidOutputs().size() > 0) { + this.mOutputFluids = new FluidStack[gtRecipe.mFluidOutputs.length]; + for (FluidStack storedOutputFluid : getStoredFluidOutputs()) { + if (storedOutputFluid.isFluidEqual(gtRecipe.getFluidOutput(0))) + for (FluidStack inputFluidStack : gtRecipe.mFluidInputs) { + int j = calcMod(storedOutputFluid.amount); + for (int i = 0; i < j; i++) + if (depleteInput(inputFluidStack)) + times++; + } + } + for (FluidStack storedfluidStack : getStoredFluidOutputs()) { + for (int i = 0; i < gtRecipe.mFluidOutputs.length; i++) { + if (storedfluidStack.isFluidEqual(gtRecipe.getFluidOutput(i))) + this.mOutputFluids[i] = (new FluidStack(gtRecipe.getFluidOutput(i), times * gtRecipe.getFluidOutput(0).amount)); + } + + } + } else { + this.mOutputFluids = gtRecipe.mFluidOutputs; + } + } else + return false; + + BW_Util.calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, this.getMaxInputVoltage(), this); + + if (mEUt > 0) + mEUt = -mEUt; + this.mProgresstime = 0; + + if (gtRecipe.mCanBeBuffered) + mLastRecipe = gtRecipe; + + updateSlots(); + return true; + } + return false; + } + + public ArrayList getStoredFluidOutputs() { + ArrayList rList = new ArrayList(); + Iterator var2 = this.mOutputHatches.iterator(); + + while (var2.hasNext()) { + GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) var2.next(); + if (tHatch.getFluid() != null) + rList.add(tHatch.getFluid()); + } + return rList; + } + + private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_RadioHatch) { + ((GT_MetaTileEntity_RadioHatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mRadHatches.add((GT_MetaTileEntity_RadioHatch) aMetaTileEntity); + } else { + return false; + } + } + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; + int blockcounter = 0; + + for (int x = -2; x <= 2; x++) + for (int z = -2; z <= 2; z++) + for (int y = 0; y < 4; y++) { + IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z); + if (y == 0 || y == 3) { + //controller + if (y == 0 && xDir + x == 0 && zDir + z == 0) + continue; + if (!(this.addOutputToMachineList(tileEntity, MCASING_INDEX) || this.addRadiationInputToMachineList(tileEntity, MCASING_INDEX) || this.addInputToMachineList(tileEntity, MCASING_INDEX) || this.addMaintenanceToMachineList(tileEntity, MCASING_INDEX) || this.addEnergyInputToMachineList(tileEntity, MCASING_INDEX))) { + if (BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, GregTech_API.sBlockCasings4, 1)) { + ++blockcounter; + continue; + } + return false; + } + } else { + if (Math.abs(x) < 2 && Math.abs(z) != 2) { + if (!(BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, Blocks.air) || (BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, FluidLoader.bioFluidBlock)))) { + return false; + } + } else { + if (x == -2 && z == -2 && y == 1) + mGlassTier = calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); + if (0 == mGlassTier || mGlassTier != calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z))) { + return false; + } + } + } + } + +// this.mWrench = true; +// this.mScrewdriver = true; +// this.mSoftHammer = true; +// this.mHardHammer = true; +// this.mSolderingTool = true; +// this.mCrowbar = true; + + if (blockcounter > 18) + if (this.mRadHatches.size() < 2) + if (this.mOutputHatches.size() == 1) + if (this.mMaintenanceHatches.size() == 1) + if (this.mInputHatches.size() > 0) + if (this.mEnergyHatches.size() > 0) + return true; + + return false; + } + + private byte calculateGlassTier(@Nonnull Block block, @Nonnegative Byte meta) { + + if (block.equals(ItemRegistry.bw_glasses[0])) + return meta > 1 && meta < 6 ? (byte) (meta + 3) : 4; + + if (block.getUnlocalizedName().equals("blockAlloyGlass")) + return 4; + + if (block.equals(Blocks.glass)) + return 3; + + for (BioVatLogicAdder.BlockMetaPair B : BioVatLogicAdder.BioVatGlass.getGlassMap().keySet()) + if (B.getBlock().equals(block) && B.getaByte().equals(meta)) + return BioVatLogicAdder.BioVatGlass.getGlassMap().get(B); + + if (block.getMaterial().equals(Material.glass)) + return 3; + + return 0; + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + private void sendAllRequiredRendererPackets() { + int height = reCalculateHeight(); + if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) { + for (int x = -1; x < 2; x++) + for (int y = 1; y < height; y++) + for (int z = -1; z < 2; z++) + sendPackagesOrRenewRenderer(x, y, z, this.mCulture); + } + } + + private void sendPackagesOrRenewRenderer(int x, int y, int z, BioCulture lCulture) { + int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; + int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; + + staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId)); + staticColorMap.put(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId), lCulture == null ? BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB() : lCulture.getColorRGB()); + + if (FMLCommonHandler.instance().getSide().isServer()) { + MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( + this.getBaseMetaTileEntity().getWorld(), + new RendererPacket( + new Coords( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId + ), + lCulture == null ? BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB() : lCulture.getColorRGB(), + true + ), + this.getBaseMetaTileEntity().getXCoord(), + this.getBaseMetaTileEntity().getZCoord() + ); + MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( + this.getBaseMetaTileEntity().getWorld(), + new RendererPacket( + new Coords( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId + ), + lCulture == null ? BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB() : lCulture.getColorRGB(), + false + ), + this.getBaseMetaTileEntity().getXCoord(), + this.getBaseMetaTileEntity().getZCoord() + ); + } + needsVisualUpdate = true; + } + + private void check_Chunk() { + World aWorld = this.getBaseMetaTileEntity().getWorld(); + if (!aWorld.isRemote) { + Iterator var5 = aWorld.playerEntities.iterator(); + + while (var5.hasNext()) { + Object tObject = var5.next(); + if (!(tObject instanceof EntityPlayerMP)) { + break; + } + EntityPlayerMP tPlayer = (EntityPlayerMP) tObject; + Chunk tChunk = aWorld.getChunkFromBlockCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord()); + if (tPlayer.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { + if (!playerMPHashSet.contains(tPlayer)) { + playerMPHashSet.add(tPlayer); + sendAllRequiredRendererPackets(); + } + } else { + playerMPHashSet.remove(tPlayer); + } + + } + } + } + + private void placeFluid() { + int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; + int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; + height = reCalculateHeight(); + if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) + for (int x = -1; x < 2; x++) { + for (int y = 0; y < height; y++) { + for (int z = -1; z < 2; z++) { + if (this.getBaseMetaTileEntity().getWorld().getBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()).equals(Blocks.air)) + this.getBaseMetaTileEntity().getWorld().setBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), FluidLoader.bioFluidBlock); + } + } + } + } + + private int reCalculateFluidAmmount() { + int lFluidAmount = 0; + for (int i = 0; i < this.getStoredFluids().size(); i++) { + lFluidAmount += this.getStoredFluids().get(i).amount; + } + return lFluidAmount; + } + + private int reCalculateHeight() { + return (this.reCalculateFluidAmmount() > ((this.getCapacity() / 4) - 1) ? (this.reCalculateFluidAmmount() >= this.getCapacity() / 2 ? 3 : 2) : 1); + } + + public void doAllVisualThings() { + if (this.getBaseMetaTileEntity().isServerSide()) { + if (mMachine) { + ItemStack aStack = this.mInventory[1]; + BioCulture lCulture = null; + int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; + int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; + + if (this.getBaseMetaTileEntity().getTimer() % 200 == 0) { + check_Chunk(); + } + + if (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 0) { + for (int x = -1; x < 2; x++) + for (int y = 1; y < 3; y++) + for (int z = -1; z < 2; z++) + this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()); + } + + height = reCalculateHeight(); + if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) { + if ((!(BW_Util.areStacksEqual(aStack, mStack))) || (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 1)) { + for (int x = -1; x < 2; x++) { + for (int y = 1; y < height; y++) { + for (int z = -1; z < 2; z++) { + if (aStack == null || (aStack != null && aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0)) { + if (mCulture == null || aStack == null || aStack.getTagCompound() == null || mCulture.getID() != aStack.getTagCompound().getInteger("ID")) { + lCulture = aStack == null || aStack.getTagCompound() == null ? null : BioCulture.getBioCulture(aStack.getTagCompound().getString("Name")); + sendPackagesOrRenewRenderer(x, y, z, lCulture); + } + } + } + } + } + mStack = aStack; + mCulture = lCulture; + } + if (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 1) { + if (this.getBaseMetaTileEntity().isClientSide()) + new Throwable().printStackTrace(); + placeFluid(); + needsVisualUpdate = false; + } + } + } else { + onRemoval(); + } + } + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (height != reCalculateHeight()) + needsVisualUpdate = true; + doAllVisualThings(); + if (this.getBaseMetaTileEntity().isServerSide() && this.mRadHatches.size() == 1) + this.mSievert = this.mRadHatches.get(0).getSievert(); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setInteger("mFluidHeight", height); + if (mCulture != null && !mCulture.getName().isEmpty()) + aNBT.setString("mCulture", mCulture.getName()); + else if ((mCulture == null || mCulture.getName().isEmpty()) && !aNBT.getString("mCulture").isEmpty()) { + aNBT.removeTag("mCulture"); + } + if (this.mFluid != null) + aNBT.setString("mFluid", mFluid.getName()); + super.saveNBTData(aNBT); + } + + @Override + public void onRemoval() { + int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; + int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; + for (int x = -1; x < 2; x++) { + for (int y = 1; y < 3; y++) { + for (int z = -1; z < 2; z++) { + if (this.getBaseMetaTileEntity().getWorld().getBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()).equals(FluidLoader.bioFluidBlock)) + this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()); + staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()), this.getBaseMetaTileEntity().getWorld().provider.dimensionId); + if (FMLCommonHandler.instance().getSide().isServer()) + MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( + this.getBaseMetaTileEntity().getWorld(), + new RendererPacket( + new Coords( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId + ), + mCulture == null ? BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB() : mCulture.getColorRGB(), + true + ), + this.getBaseMetaTileEntity().getXCoord(), + this.getBaseMetaTileEntity().getZCoord() + ); + } + } + } + super.onRemoval(); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + height = aNBT.getInteger("mFluidHeight"); + mCulture = BioCulture.getBioCulture(aNBT.getString("mCulture")); + if (!aNBT.getString("mFluid").isEmpty()) + mFluid = FluidRegistry.getFluid(aNBT.getString("mFluid")); + super.loadNBTData(aNBT); + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_BioVat(this.mName); + } + + @Override + public String[] getDescription() { + return new String[]{ + "Controller Block for the Bio Vat", + "LxHxD: 5x4x5", + "Bottom and top are Stainless Steel Casings", + "Bottom and top must contain:", + "1x Maintenance, 1x Output Hatch, 1 or more Input Hatches, 1 or more Input Buses, 0-1 Radiation Input Bus", + "The two middle layers must be build out of glass, hollow", + "The glass can be any glass, i.e. Tinkers Construct Clear Glass", + "Some Recipes need more advanced Glass Types", + "For maximum efficiency boost keep the Output Hatch always half filled!", + "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" + }; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[MCASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[MCASING_INDEX]}; + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java new file mode 100644 index 0000000000..0a69480775 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; +import ic2.core.block.reactor.tileentity.TileEntityNuclearReactorElectric; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; + +import java.lang.reflect.Field; +import java.util.Arrays; + +public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { + private static float nulearHeatMod = 2f; + private byte mMode; + private byte mTier; + + public GT_TileEntity_DEHP(int aID, int tier, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + mTier = (byte) tier; + } + + public GT_TileEntity_DEHP(String aName, byte mTier) { + super(aName); + this.mTier = (byte) mTier; + } + + @Override + public void onConfigLoad(GT_Config aConfig) { + try { + Class c = TileEntityNuclearReactorElectric.class; + Field f = c.getDeclaredField("huOutputModifier"); + f.setAccessible(true); + nulearHeatMod = f.getFloat(f); + } catch (SecurityException | IllegalArgumentException | ExceptionInInitializerError | NullPointerException | IllegalAccessException | NoSuchFieldException e) { + e.printStackTrace(); + } + super.onConfigLoad(aConfig); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setByte("mTier", mTier); + aNBT.setByte("mMode", mMode); + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + mTier = aNBT.getByte("mTier"); + mMode = aNBT.getByte("mMode"); + super.loadNBTData(aNBT); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_DEHP(this.mName, mTier); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "DrillingRig.png"); + } + + @Override + public String[] getDescription() { + String[] dscSteam = {"Controller Block for the Deep Earth Heat Pump " + (mTier > 1 ? mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + getCasingBlockItem().name(), "1x3x1 " + getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)", "1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", "Consumes " + GT_Values.V[mTier + 2] + "EU/t", "Has 4 Modes, use the Screwdriver to change them:", "0 Idle, 1 Steam, 2 Superheated Steam (requires Distilled Water), 3 Retract", "Explodes when it runs out of Water/Distilled Water", "Converts " + (long) (mTier * 1200 * 20) + "L/s Water(minus 10% per Maintenance Problem) to Steam", "Converts " + (long) (mTier * 600 * 20) + "L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"}; + String[] dscCooleant = {"Controller Block for the Deep Earth Heat Pump " + (mTier > 1 ? mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + getCasingBlockItem().name(), "1x3x1 " + getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)", "1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", "Consumes " + GT_Values.V[mTier + 2] + "EU/t", "Has 4 Modes, use the Screwdriver to change them:", "0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract", "Explodes when it runs out of Coolant", "Heats up " + (long) (mTier * 24 * ((double) nulearHeatMod)) * 20 + "L/s Coolant(minus 10% per Maintenance Problem)"}; + return ConfigHandler.DEHPDirectSteam ? dscSteam : dscCooleant; + } + + @Override + protected ItemList getCasingBlockItem() { + return ItemList.Casing_HeatProof; + } + + @Override + protected Materials getFrameMaterial() { + return Materials.Tungsten; + } + + @Override + protected int getCasingTextureIndex() { + return 11; + } + + @Override + protected int getMinTier() { + return 2 + mTier; + } + + @Override + protected boolean checkHatches() { + return !this.mMaintenanceHatches.isEmpty() && !this.mOutputHatches.isEmpty() && !this.mInputHatches.isEmpty(); + } + + private long getFluidFromHatches(Fluid f) { + long ret = 0; + for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { + if (ih.getFluid().getFluid().equals(f)) + ret += ih.getFluidAmount(); + } + return ret; + } + + private long getWaterFromHatches(boolean onlyDistilled) { + Fluid toConsume1 = FluidRegistry.WATER; + Fluid toConsume2 = GT_ModHandler.getDistilledWater(1L).getFluid(); + if (onlyDistilled) + toConsume1 = toConsume2; + long ret = 0; + for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { + if (ih.getFluid().getFluid().equals(toConsume1) || ih.getFluid().getFluid().equals(toConsume2)) + ret += ih.getFluidAmount(); + } + return ret; + } + + @Override + protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + if (mMode != 3) { + this.isPickingPipes = false; + return true; + } + return super.workingUpward(aStack, xDrill, yDrill, zDrill, xPipe, zPipe, yHead, oldYHead); + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + ++mMode; + if (mMode >= 4) + mMode = 0; + GT_Utility.sendChatToPlayer(aPlayer, "Mode: " + mMode); + super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + } + + protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + if (mMode == 3) { + this.isPickingPipes = true; + return true; + } + + if (!this.tryLowerPipe()) { + if (this.waitForPipes()) { + return false; + } else { + if (ConfigHandler.DEHPDirectSteam) { + if (mMode == 1) { + long steamProduced = (mTier * 600 * 2L * this.mEfficiency / 10000L); + long waterConsume = ((steamProduced + 160) / 160); + + if (getWaterFromHatches(false) - waterConsume > 0) { + consumeFluid(FluidRegistry.WATER, waterConsume); + addOutput(GT_ModHandler.getSteam(steamProduced)); + } else { + explodeMultiblock(); + return false; + } + } else if (mMode == 2) { + long steamProduced = (mTier * 300 * 2L * this.mEfficiency / 10000L); + long waterConsume = ((steamProduced + 160) / 160); + + if (getWaterFromHatches(true) - waterConsume > 0) { + consumeFluid(GT_ModHandler.getDistilledWater(1).getFluid(), waterConsume); + addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", (int) steamProduced)); + } else { + explodeMultiblock(); + return false; + } + } + } else { + if (mMode == 1 || mMode == 2) { + long coolantConverted = (long) (mTier * 24 * ((double) nulearHeatMod) * this.mEfficiency / 10000L); + if (getFluidFromHatches(FluidRegistry.getFluid("ic2coolant")) - coolantConverted > 0) { + consumeFluid(FluidRegistry.getFluid("ic2coolant"), coolantConverted); + addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", (int) coolantConverted)); + } else { + explodeMultiblock(); + return false; + } + } + } + } + } else { + return true; + } + return true; + } + + private boolean consumeFluid(Fluid fluid, long ammount) { + + + if (ammount > Integer.MAX_VALUE) { + int[] tmp = new int[(int) (ammount / Integer.MAX_VALUE)]; + Arrays.fill(tmp, (int) (ammount / Integer.MAX_VALUE)); + for (int i = 0; i < tmp.length; i++) { + for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { + if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid().getFluid().equals(fluid) || ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) : ih.getFluid().getFluid().equals(fluid)) + tmp[i] -= ih.drain((int) ammount, true).amount; + if (tmp[i] <= 0) + break; + } + } + + if (tmp[tmp.length - 1] <= 0) { + return true; + } + + return false; + } + + long tmp = ammount; + for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { + if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid().getFluid().equals(fluid) || ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) : ih.getFluid().getFluid().equals(fluid)) + tmp -= ih.drain((int) ammount, true).amount; + if (tmp <= 0) + return true; + } + return false; + } + + @Override + protected void setElectricityStats() { + try { + this.mEUt = isPickingPipes ? 60 : Math.toIntExact(GT_Values.V[getMinTier()]); + } catch (ArithmeticException e) { + e.printStackTrace(); + this.mEUt = Integer.MAX_VALUE - 7; + } + this.mProgresstime = 0; + this.mMaxProgresstime = 1; + this.mEfficiency = this.getCurrentEfficiency((ItemStack) null); + this.mEfficiencyIncrease = 10000; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java new file mode 100644 index 0000000000..b3504b7640 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -0,0 +1,428 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_LESU; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.server.container.GT_Container_LESU; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.ConnectedBlocksChecker; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + + +public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { + + + private static final byte TEXID_SIDE = 0; + private static final byte TEXID_CHARGING = 1; + private static final byte TEXID_IDLE = 2; + private static final byte TEXID_EMPTY = 3; + private static IIcon[] iIcons = new IIcon[4]; + private static IIconContainer[] iIconContainers = new IIconContainer[4]; + private static ITexture[][] iTextures = new ITexture[4][1]; + public ConnectedBlocksChecker connectedcells; + public ItemStack[] circuits = new ItemStack[5]; + private long mStorage; + + public GT_TileEntity_LESU(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + this.mStorage = ConfigHandler.energyPerCell; + } + + public GT_TileEntity_LESU(String aName) { + super(aName); + } + + + @Override + public boolean isEnetOutput() { + return true; + } + + @Override + public boolean isEnetInput() { + return true; + } + + @Override + public long maxEUStore() { + return (this.mStorage >= Long.MAX_VALUE - 1 || this.mStorage < 0) ? Long.MAX_VALUE - 1 : this.mStorage; + } + + @Override + public long maxAmperesIn() { + int ret = 0; + for (int i = 0; i < 5; ++i) + if (this.circuits[i] != null && this.circuits[i].getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) + ret += this.circuits[i].getItemDamage(); + return ret > 0 ? ret : 1; + } + + @Override + public long maxAmperesOut() { + return maxAmperesIn(); + } + + @Override + public long maxEUInput() { + + for (int i = 1; i < GT_Values.V.length; i++) { + if (maxEUOutput() <= GT_Values.V[i] && maxEUOutput() > GT_Values.V[i - 1]) + return Math.min(GT_Values.V[i], 32768L); + } + + return 8; + } + + @Override + public long maxEUOutput() { + return Math.min(Math.max(this.mStorage / ConfigHandler.energyPerCell, 1L), 32768L); + } + + @Override + public int rechargerSlotStartIndex() { + return 0; + } + + @Override + public int rechargerSlotCount() { + return 1; + } + + @Override + public int dechargerSlotStartIndex() { + return 1; + } + + @Override + public int dechargerSlotCount() { + return 1; + } + + @Override + public boolean isTeleporterCompatible() { + return true; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_LESU(mName); + } + + @Override + public String[] getDescription() { + return new String[]{ + "Controller Block for the GT2-Styled L.E.S.U.", + "Size: ANY", + "Storage per LESU Casing: " + ConfigHandler.energyPerCell + "EU", + "Output EU: LESU Casings amount" + + "Input EU: Next Voltage Tier to Output EU", + "Input/Output Amps can be configured via 4 Circuits in GUI", + "Output Side has a dot on it.", + ChatColorHelper.RED + "Only one Controller allowed, no Wallsharing!", + "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" + }; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + + for (int i = 0; i < iTextures.length; i++) { + iIcons[i] = aBlockIconRegister.registerIcon(MainMod.MOD_ID + ":LESU_CASING_" + i); + final int finalI = i; + iIconContainers[i] = new IIconContainer() { + @Override + public IIcon getIcon() { + return iIcons[finalI]; + } + + @Override + public IIcon getOverlayIcon() { + return iIcons[finalI]; + } + + @Override + public ResourceLocation getTextureFile() { + return new ResourceLocation(MainMod.MOD_ID + ":LESU_CASING_" + finalI); + } + }; + } + + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_LESU(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_LESU(aPlayerInventory, aBaseMetaTileEntity); + } + + public boolean isServerSide() { + return !isClientSide(); + } + + public boolean isClientSide() { + if (getWorld() != null) + return getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; + return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; + } + + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + + ITexture[] ret = new ITexture[0]; + + if (this.isClientSide()) { + + for (int i = 0; i < iTextures.length; i++) { + iTextures[i][0] = new GT_RenderedTexture(iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); + } + + if (aSide == aFacing && this.getBaseMetaTileEntity().getUniversalEnergyStored() <= 0) + ret = iTextures[TEXID_EMPTY]; + else if (aSide == aFacing && !aActive) + ret = iTextures[TEXID_IDLE]; + else if (aSide == aFacing && aActive) + ret = iTextures[TEXID_CHARGING]; + else + ret = iTextures[TEXID_SIDE]; + } + + return ret; + } + + @Override + public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) { + return true; + } + + @Override + public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) { + return true; + } + + @Override + public int getSizeInventory() { + return 6; + } + + @Override + public ItemStack getStackInSlot(int p_70301_1_) { + if (p_70301_1_ > 1) + return this.circuits[(p_70301_1_ - 2)]; + return this.mInventory[p_70301_1_]; + } + + @Override + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + if (p_70299_1_ < 2) + this.mInventory[p_70299_1_] = p_70299_2_; + else + this.circuits[(p_70299_1_ - 2)] = p_70299_2_; + } + + @Override + public String getInventoryName() { + return "L.E.S.U."; + } + + @Override + public boolean hasCustomInventoryName() { + return true; + } + + @Override + public int getInventoryStackLimit() { + return 1; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return true; + } + + @Override + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + + switch (p_94041_1_) { + case 0: + case 1: + return true; + default: + return p_94041_2_.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); + } + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + return true; + } + + @Override + public boolean isInputFacing(byte aSide) { + return aSide != this.getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public boolean isOutputFacing(byte aSide) { + return aSide == this.getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + checkMachine(aBaseMetaTileEntity, null); + super.onFirstTick(aBaseMetaTileEntity); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + this.mMaxProgresstime = 1; + if (aTick % 20 == 0) + checkMachine(aBaseMetaTileEntity, null); + this.mWrench = true; + this.mScrewdriver = true; + this.mSoftHammer = true; + this.mHardHammer = true; + this.mSolderingTool = true; + this.mCrowbar = true; + } + } + + @Override + public long getMinimumStoredEU() { + return 0; + } + + @Override + public boolean onRunningTick(ItemStack aStack) { + this.mMaxProgresstime = 1; + return true; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setIntArray("customCircuitInv", GT_Utility.stacksToIntArray(this.circuits)); + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + int[] stacks = aNBT.getIntArray("customCircuitInv"); + for (int i = 0; i < stacks.length; i++) { + this.circuits[i] = GT_Utility.intToStack(stacks[i]); + } + super.loadNBTData(aNBT); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + long startingTime = System.nanoTime(); + connectedcells = new ConnectedBlocksChecker(); + connectedcells.get_connected(aBaseMetaTileEntity.getWorld(), aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), ItemRegistry.BW_BLOCKS[1]); + + if (connectedcells.get_meta_of_sideblocks(aBaseMetaTileEntity.getWorld(), this.getBaseMetaTileEntity().getMetaTileID(), new int[]{aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()}, true)) { + this.getBaseMetaTileEntity().disableWorking(); + this.getBaseMetaTileEntity().setActive(false); + this.mStorage = 0; + this.mMaxProgresstime = 0; + this.mProgresstime = 0; + return false; + } + + this.mEfficiency = this.getMaxEfficiency(null); + this.mStorage = (ConfigHandler.energyPerCell * connectedcells.hashset.size() >= Long.MAX_VALUE - 1 || ConfigHandler.energyPerCell * connectedcells.hashset.size() < 0) ? Long.MAX_VALUE - 1 : ConfigHandler.energyPerCell * connectedcells.hashset.size(); + this.mMaxProgresstime = 1; + this.mProgresstime = 0; + + this.mCrowbar = true; + this.mHardHammer = true; + this.mScrewdriver = true; + this.mSoftHammer = true; + this.mSolderingTool = true; + this.mWrench = true; + + this.getBaseMetaTileEntity().enableWorking(); + this.getBaseMetaTileEntity().setActive(true); + + long finishedTime = System.nanoTime(); + if (finishedTime - startingTime > 5000000) + MainMod.LOGGER.warn("LESU LookUp took longer than 5ms!(" + (finishedTime - startingTime) + "ns / " + ((finishedTime - startingTime) / 1000000) + "ms) Check at x:" + this.getBaseMetaTileEntity().getXCoord() + " y:" + this.getBaseMetaTileEntity().getYCoord() + " z:" + this.getBaseMetaTileEntity().getZCoord() + " DIM-ID: " + this.getBaseMetaTileEntity().getWorld().provider.dimensionId); + return true; + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + public World getWorld() { + return this.getBaseMetaTileEntity().getWorld(); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java new file mode 100644 index 0000000000..2f61696635 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -0,0 +1,457 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; + +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + +import static gregtech.api.enums.GT_Values.V; + +public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase { + + private static final byte SINGLE_UPSTEP = 0; + private static final byte SINGLE_DOWNSTEP = 1; + private static final byte MULTI_UPSTEP = 2; + private static final byte MULTI_DOWNSTEP = 3; + private byte mode = 0; + private byte texid = 2; + private long mCoilWicks = 0; + private boolean upstep = true; + + public GT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_ManualTrafo(String aName) { + super(aName); + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (!this.getBaseMetaTileEntity().isAllowedToWork()) + this.stopMachine(); + super.onPostTick(aBaseMetaTileEntity, aTick); + } + + @Override + public boolean onRunningTick(ItemStack aStack) { + if (!this.getBaseMetaTileEntity().isAllowedToWork()) { + this.stopMachine(); + return false; + } + + this.mProgresstime = 0; + this.mMaxProgresstime = 1; + + if (this.getBaseMetaTileEntity().getTimer() % 40 == 0) + if (this.mEfficiency < this.getMaxEfficiency(null)) + this.mEfficiency += 100; + else + this.mEfficiency = this.getMaxEfficiency(null); + + if (this.mode > SINGLE_DOWNSTEP) { + return this.onRunningTickTabbedMode(); + } + + boolean ret = this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput(this.getInputTier() * 2 * this.mEnergyHatches.size() * (long) this.mEfficiency / this.getMaxEfficiency(null)); + + return ret; + } + + public boolean onRunningTickTabbedMode() { + boolean ret = false; + for (GT_MetaTileEntity_Hatch_Dynamo E : mDynamoHatches) { + for (GT_MetaTileEntity_Hatch_Energy I : mEnergyHatches) { + + long vtt = I.getEUVar() >= (V[E.mTier] / 2) && E.getEUVar() < E.maxEUStore() ? I.getEUVar() : 0; + + if (vtt == 0) + continue; + + long vtp = E.getEUVar() + (vtt); + long avt = vtp < E.maxEUStore() ? vtp : E.maxEUStore(); + E.setEUVar(avt); + I.setEUVar(I.getEUVar() - vtt); + ret = true; + } + } + return ret; + } + + + public long getInputTier() { + if (this.mEnergyHatches.size() > 0) + return (long) GT_Utility.getTier(this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); + else return 0; + } + + public long getOutputTier() { + if (this.mDynamoHatches.size() > 0) + return (long) GT_Utility.getTier(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); + else return 0; + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + + if (!this.getBaseMetaTileEntity().isAllowedToWork()) { + this.stopMachine(); + return false; + } + this.mode = this.mInventory[1] == null ? 0 : this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit") ? this.mInventory[1].getItemDamage() > 4 ? (byte) this.mInventory[1].getItemDamage() : 0 : 0; + this.upstep = (this.mode == 0 || this.mode == 2); + this.mProgresstime = 0; + this.mMaxProgresstime = 1; + this.mEfficiency = this.mEfficiency > 100 ? this.mEfficiency : 100; + return this.upstep ? this.getOutputTier() - this.getInputTier() == mCoilWicks : this.getInputTier() - this.getOutputTier() == mCoilWicks; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + + this.mode = this.mInventory[1] == null ? 0 : this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit") ? this.mInventory[1].getItemDamage() > 4 ? (byte) this.mInventory[1].getItemDamage() : 0 : 0; + + if (this.mode <= 1) { + + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + + //check height + int y = 1; + boolean stillcoil = true; + while (stillcoil) { + for (int x = -1; x <= 1; ++x) { + for (int z = -1; z <= 1; ++z) { + if (x != 0 || z != 0) { + stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; + if (stillcoil) { + ++this.mCoilWicks; + if (mCoilWicks % 8 == 0) { + ++y; + continue; + } + } else + break; + } + } + if (!stillcoil) + break; + } + } + + if (mCoilWicks % 8 != 0) + return false; + + this.mCoilWicks = this.mCoilWicks / 8; + + //check interior (NiFeZn02 Core) + for (int i = 1; i <= this.mCoilWicks; ++i) { + if (!aBaseMetaTileEntity.getBlockOffset(xDir, i, zDir).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir, i, zDir) == 0) { + return false; + } + } + + //check Bottom + for (int x = -1; x <= 1; ++x) + for (int z = -1; z <= 1; ++z) + if (xDir + x != 0 || zDir + z != 0) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { + return false; + } + /* + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { + return false; + } + */ + } + } + + //check Top + for (int x = -1; x <= 1; ++x) + for (int z = -1; z <= 1; ++z) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addDynamoToMachineList(tTileEntity, texid)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { + return false; + } + /* + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { + return false; + } + */ + } + } + + // check dynamos and energy hatches for the same tier + byte outtier = this.mDynamoHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { + if (out.mTier != outtier) + return false; + } + + byte intier = this.mEnergyHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) { + if (in.mTier != intier) + return false; + } + } else { + + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; + int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY * 2; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; + //check height + int y = 1; + boolean stillcoil = true; + while (stillcoil) { + for (int x = -1; x <= 1; ++x) { + for (int z = -1; z <= 1; ++z) { + if (x != 0 || z != 0) { + stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; + if (stillcoil) { + ++this.mCoilWicks; + if (mCoilWicks % 8 == 0) { + ++y; + continue; + } + } else + break; + } + } + if (!stillcoil) + break; + } + } + + if (mCoilWicks % 8 != 0) + return false; + + this.mCoilWicks = this.mCoilWicks / 8; + + //check interior (NiFeZn02 Core) + for (int i = 1; i <= this.mCoilWicks; ++i) { + if (!aBaseMetaTileEntity.getBlockOffset(xDir, i, zDir).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir, i, zDir) == 0) { + return false; + } + } + + //check Bottom + for (int x = -2; x <= 2; ++x) + for (int z = -2; z <= 2; ++z) + if (xDir + x != 0 || zDir + z != 0) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { + return false; + } + /* + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { + return false; + } + */ + } + } + + //check Top + for (int x = -2; x <= 2; ++x) + for (int z = -2; z <= 2; ++z) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addDynamoToMachineList(tTileEntity, texid)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { + return false; + } + /* + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { + return false; + } + */ + } + } + + if (this.mDynamoHatches.size() <= 0 || this.mEnergyHatches.size() <= 0) + return false; + + byte outtier = this.mDynamoHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { + if (out.mTier != outtier) + return false; + } + + byte intier = this.mEnergyHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) { + if (in.mTier != intier) + return false; + } + + + //check tap hull + for (int ty = 1; ty <= y; ++ty) { + + byte leveltier = 0; + if (this.mInventory[1].getItemDamage() == 2) + leveltier = ((byte) (intier - ty)); + else if (this.mInventory[1].getItemDamage() == 3) + leveltier = ((byte) (intier + ty)); + else + return false; + + for (int x = -2; x <= 2; ++x) + for (int z = -2; z <= 2; ++z) + if (x == -2 || z == -2 || x == 2 || z == 2) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, ty, zDir + z); + if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid, leveltier) && !this.addDynamoToMachineList(tTileEntity, texid, leveltier)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, ty, zDir + z) != GregTech_API.sBlockCasings1) { + return false; + } + } + } + } + } + if (this.mDynamoHatches.isEmpty() || this.mEnergyHatches.isEmpty()) + return false; + + return true; + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return true; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_ManualTrafo(mName); + } + + @Override + public String[] getDescription() { + return new String[]{ + "Controller Block for the Manual Trafo", + //"Operates in 4 Differents Modes:", + "Operates currently in 2 Differents Modes:", + "Mode 1: Circuit 0 in controller: Direct-Upstep", + "Mode 2: Circuit 1 in controller: Direct-Downstep", + //"Mode 3: Circuit 2 in controller: Tapped-Upstep", + //"Mode 4: Circuit 3 in controller: Tapped-Downstep", + "For direct Modes: 3xHx3", + "Base Contains at least 1 Energy Hatch", + "1 Layer of Dynamo Coils for each Tier transformed", + "Middle of Dynamo Coils needs to be a NickelFerrite Core", + "Top Contains at least 1 Dynamo Hatch", + "Maintenance Hatch can be placed anywhere", + "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" + //"Tapped Mode is disabled." + }; + } + + @Override + public void saveNBTData(NBTTagCompound ntag) { + ntag.setLong("mCoilWicks", mCoilWicks); + super.saveNBTData(ntag); + } + + @Override + public void loadNBTData(NBTTagCompound ntag) { + super.loadNBTData(ntag); + mCoilWicks = ntag.getLong("mCoilWicks"); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[texid], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[texid]}; + } + + public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex, short tier) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { + if (tier == ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mTier) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); + } + return false; + } else { + return false; + } + } + } + + public boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex, short tier) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { + if (tier == ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mTier) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); + } + return false; + } else { + return false; + } + } + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java new file mode 100644 index 0000000000..bf91333854 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -0,0 +1,658 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_Windmill; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.XSTR; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.util.ForgeDirection; + +import java.util.ArrayList; + +import static gregtech.api.enums.GT_Values.V; + +public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { + + private static IIcon[] iIcons = new IIcon[2]; + private static IIconContainer[] iIconContainers = new IIconContainer[2]; + private static ITexture[] iTextures = new ITexture[3]; + + private final ArrayList tedList = new ArrayList(); + private BW_RotorBlock rotorBlock; + private byte hasDoor; + + public GT_TileEntity_Windmill(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + private GT_TileEntity_Windmill(String aName) { + super(aName); + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + public boolean onRunningTick(ItemStack aStack) { + if (this.mMaxProgresstime > 0) + this.mProgresstime += this.rotorBlock.getGrindPower(); + return this.rotorBlock.getGrindPower() > 0; + } + + public boolean doRandomMaintenanceDamage() { + return true; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return true; + } + + public boolean recipe_fallback(ItemStack aStack) { + //sight... fallback to the macerator recipes + GT_Recipe.GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; + if (tMap == null) + return false; + GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), false, false, V[1], null, aStack); + if (tRecipe == null) + return false; + if (tRecipe.getOutput(0) != null) { + aStack.stackSize--; + mOutputItems[0] = tRecipe.getOutput(0); + + if (new XSTR().nextInt(2) == 0) { + if (tRecipe.getOutput(1) != null) + mOutputItems[1] = tRecipe.getOutput(1); + else if (GT_OreDictUnificator.getAssociation(aStack) == null || GT_OreDictUnificator.getAssociation(aStack).mMaterial == null || GT_OreDictUnificator.getAssociation(aStack).mMaterial.mMaterial == null || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Flint || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Sugar || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Wheat || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Wood || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Clay || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Ash || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Snow || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Stone || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.MeatRaw || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.MeatCooked + ) + mOutputItems[1] = tRecipe.getOutput(0); + } + } + this.mMaxProgresstime = (tRecipe.mDuration * 2 * 100); + return true; + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + + if (itemStack == null || itemStack.getItem() == null) + return false; + + if (this.mOutputItems == null) + this.mOutputItems = new ItemStack[2]; + + //Override Recipes that doesnt quite work well with OreUnificator + //Items + if (itemStack.getItem().equals(Items.wheat)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 15 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 1L)); + this.mOutputItems[1] = (GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wheat, 1L)); + return true; + } else if (itemStack.getItem().equals(Items.bone)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 15 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = new ItemStack(Items.dye, 4, 15); + else + this.mOutputItems[0] = new ItemStack(Items.dye, 3, 15); + return true; + } + //Blocks + else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.gravel)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 30 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = new ItemStack(Items.flint, 2); + else + this.mOutputItems[0] = new ItemStack(Items.flint); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.cobblestone) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stone)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 2L); + else + this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.sandstone)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 45 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = new ItemStack(Blocks.sand, 3); + else + this.mOutputItems[0] = new ItemStack(Blocks.sand, 2); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.hardened_clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stained_hardened_clay)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = Materials.Clay.getDust(2); + else + this.mOutputItems[0] = Materials.Clay.getDust(1); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.redstone_block)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + this.mOutputItems[0] = Materials.Redstone.getDust(9); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glass)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glass, 1L)); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.wool)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = new ItemStack(Items.string, 3); + else + this.mOutputItems[0] = new ItemStack(Items.string, 2); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glowstone)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = new ItemStack(Items.glowstone_dust, 4); + else + this.mOutputItems[0] = new ItemStack(Items.glowstone_dust, 3); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.netherrack)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Netherrack, 2L)); + else + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Netherrack, 1L)); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L)); + else + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L)); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log2)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L)); + else + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L)); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.pumpkin)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 15 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = new ItemStack(Items.pumpkin_seeds, 2); + else + this.mOutputItems[0] = new ItemStack(Items.pumpkin_seeds, 1); + return true; + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.melon_block)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 15 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = new ItemStack(Items.melon_seeds, 2); + else + this.mOutputItems[0] = new ItemStack(Items.melon_seeds, 1); + return true; + } + + //null checks for GT shit + if (GT_OreDictUnificator.getAssociation(itemStack) == null || + GT_OreDictUnificator.getAssociation(itemStack).mPrefix == null || + GT_OreDictUnificator.getAssociation(itemStack).mMaterial == null || + GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial == null || + GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.getDust(1) == null + ) + return recipe_fallback(itemStack); //fallback for all non-unificated Items + + //Ore Unificator shit for balance + if (OrePrefixes.ingot.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.gem.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 45 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); + return true; + } else if (OrePrefixes.ore.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.crushed, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); + return true; + } else if (OrePrefixes.nugget.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 15 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dustTiny, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); + return true; + } else if (OrePrefixes.crushed.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 30 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dustImpure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); + return true; + } else if (OrePrefixes.crushedPurified.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 30 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dustPure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); + return true; + } else if (OrePrefixes.crushedCentrifuged.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 30 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); + return true; + } else if (OrePrefixes.block.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, (GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL)) ? 9L : 1L)); + return true; + } else if ( + OrePrefixes.stone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || + OrePrefixes.stoneBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || + OrePrefixes.stoneChiseled.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || + OrePrefixes.stoneCobble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || + OrePrefixes.stoneCracked.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || + OrePrefixes.stoneMossy.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || + OrePrefixes.stoneMossyBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || + OrePrefixes.stoneSmooth.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || + OrePrefixes.cobblestone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + ) { + itemStack.stackSize -= 1; + this.mMaxProgresstime = 60 * 20 * 100; + if (new XSTR().nextInt(2) == 0) + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 2L)); + else + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); + return true; + } + return recipe_fallback(itemStack); //2nd fallback + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new BW_GUIContainer_Windmill(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName()); + } + + public boolean addDispenserToOutputSet(TileEntity aTileEntity) { + if (aTileEntity instanceof TileEntityDispenser) { + this.tedList.add((TileEntityDispenser) aTileEntity); + return true; + } + return false; + } + + public boolean addOutput(ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) + return false; + + for (TileEntityDispenser tHatch : this.tedList) { + for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) { + if (tHatch.getStackInSlot(i) == null || GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack) && aStack.stackSize + tHatch.getStackInSlot(i).stackSize <= 64) { + if (GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack)) { + ItemStack merge = tHatch.getStackInSlot(i).copy(); + merge.stackSize = aStack.stackSize + tHatch.getStackInSlot(i).stackSize; + tHatch.setInventorySlotContents(i, merge); + } else { + tHatch.setInventorySlotContents(i, aStack.copy()); + } + + if (GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack)) { + aStack = null; + return true; + } else { + tHatch.setInventorySlotContents(i, null); + aStack = null; + return false; + } + } + } + } + return false; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + /* + * offset x1 = 3x3 + * offset x2 = 5x5 + * offset x3 = 7x7 + * etc. + */ + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 3; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 3; + + //floor + for (int x = -3; x <= 3; x++) { + for (int z = -3; z <= 3; z++) { + if (!((Math.abs(x) == 3 && Math.abs(z) == 3) || (xDir + x == 0 && zDir + z == 0))) + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != Blocks.brick_block) { + return false; + } + } + } + + //h_clay shaft + for (int y = 1; y <= 4; y++) + for (int x = -2; x <= 2; x++) + for (int z = -2; z <= 2; z++) { + if (!((Math.abs(x) == 2 && Math.abs(z) == 2) || (Math.abs(x) < 2 && Math.abs(z) != 2))) + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) != Blocks.hardened_clay && !this.addDispenserToOutputSet(aBaseMetaTileEntity.getTileEntityOffset(xDir + x, y, zDir + z))) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == Blocks.wooden_door && this.hasDoor < 3) { + this.hasDoor++; + continue; + } + return false; + } + } + + //plank layer 1 + for (int x = -2; x <= 2; x++) + for (int z = -2; z <= 2; z++) { + if (!(Math.abs(x) < 2 && Math.abs(z) != 2)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 5, zDir + z) != Blocks.planks) + return false; + } + } + + //plank layer 2-4 + for (int x = -3; x <= 3; x++) + for (int y = 6; y <= 8; y++) + for (int z = -3; z <= 3; z++) + if (!(((Math.abs(x) == 3 && Math.abs(z) == 3) || (Math.abs(x) < 3 && (Math.abs(z) != 2 || Math.abs(z) != 1))) || (xDir + x == 0 && zDir + z == 0 && y == 7))) + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) != Blocks.planks) + return false; + + //plank layer 5 + for (int x = -2; x <= 2; x++) + for (int z = -2; z <= 2; z++) + if (!(Math.abs(x) < 2 && (Math.abs(z) != 2))) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 9, zDir + z) != Blocks.planks) + return false; + } + //plank layer 6 + for (int x = -1; x <= 1; x++) + for (int z = -1; z <= 1; z++) + if (!(Math.abs(x) < 1 && (Math.abs(z) != 1))) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 10, zDir + z) != Blocks.planks) + return false; + } + //plank layer 7 + if (aBaseMetaTileEntity.getBlockOffset(xDir, 11, zDir) != Blocks.planks) + return false; + + //Rotor Block + TileEntity te = this.getBaseMetaTileEntity().getWorld().getTileEntity(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord() + 7, this.getBaseMetaTileEntity().getZCoord()); + + if (te instanceof BW_RotorBlock) + this.rotorBlock = (BW_RotorBlock) te; + else + return false; + + //check for outputs + if (this.tedList.isEmpty()) + return false; + + this.mWrench = true; + this.mScrewdriver = true; + this.mSoftHammer = true; + this.mHardHammer = true; + this.mSolderingTool = true; + this.mCrowbar = true; + + //reset door cause bugs >_> + this.hasDoor = 0; + + return true; + } + + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + if (this.mEfficiency < 0) + this.mEfficiency = 0; + if (--this.mUpdate == 0 || --this.mStartUpCheck == 0) { + this.hasDoor = 0; + this.tedList.clear(); + this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); + } + if (this.mStartUpCheck < 0) { + if (this.mMachine) { + if (this.mMaxProgresstime > 0) { + if (this.onRunningTick(this.mInventory[1])) { + if (this.mMaxProgresstime > 0 && this.mProgresstime >= this.mMaxProgresstime) { + if (this.mOutputItems != null) + for (ItemStack tStack : this.mOutputItems) + if (tStack != null) { + this.addOutput(tStack); + } + this.mEfficiency = 10000; + this.mOutputItems = new ItemStack[2]; + this.mProgresstime = 0; + this.mMaxProgresstime = 0; + this.mEfficiencyIncrease = 0; + if (aBaseMetaTileEntity.isAllowedToWork()) { + if (this.checkRecipe(this.mInventory[1])) + this.updateSlots(); + } + } + } + } else { + if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) { + if (aBaseMetaTileEntity.isAllowedToWork()) { + if (this.checkRecipe(this.mInventory[1])) + this.updateSlots(); + } + } + } + } else { + this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); + return; + } + } else { + this.stopMachine(); + } + } + aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (this.mWrench ? 0 : 1) | (this.mScrewdriver ? 0 : 2) | (this.mSoftHammer ? 0 : 4) | (this.mHardHammer ? 0 : 8) | (this.mSolderingTool ? 0 : 16) | (this.mCrowbar ? 0 : 32) | (this.mMachine ? 0 : 64)); + aBaseMetaTileEntity.setActive(this.mMaxProgresstime > 0); + } + + @Override + public int getCurrentEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public void updateSlots() { + if (this.mInventory[1] != null && this.mInventory[1].stackSize <= 0) { + this.mInventory[1] = null; + } + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_Windmill(this.mName); + } + + @Override + public String[] getDescription() { + return new String[]{ + "A primitive Grinder powered by Kinetic energy.", + "WxHxL: 7x12x7", + "Layer 1: 7x7 Bricks, corners are air, controller at front centered.", + "Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,", + "hollow, Wall must contain at least one Dispenser", + "Layer 6: 5x5 Wood Planks. Corners are filled, hollow.", + "Layer 7: 7x7 Wood Planks. Corners are air, hollow.", + "Layer 8: 7x7 Wood Planks. Corners are air, hollow,", + "front centered must be a Primitive Kinetic Shaftbox", + "Layer 9: 7x7 Wood Planks. Corners are air, hollow.", + "Layer 10: 5x5 Wood Planks. Corners are filled, hollow.", + "Layer 11: 3x3 Wood Planks. Corners are filled, hollow.", + "Layer 12: 1x1 Wood Plank.", + "Needs a Wind Mill Rotor in the Shaftbox to operate", + "Input items in Controller", + "Output items will appear in the dispensers", + "It is faster in regions with more wind (like IC2 Windmills)", + "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" + }; + } + + @Override + public String[] getInfoData() { + return new String[]{"Progress:", this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", Integer.toString(this.rotorBlock.getGrindPower()) + "KU/t"}; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + iIcons[0] = Blocks.brick_block.getIcon(0, 0); + iIconContainers[0] = new IIconContainer() { + @Override + public IIcon getIcon() { + return iIcons[0]; + } + + @Override + public IIcon getOverlayIcon() { + return null; + } + + @Override + public ResourceLocation getTextureFile() { + return new ResourceLocation("brick"); + } + }; + + iIcons[1] = aBlockIconRegister.registerIcon(MainMod.MOD_ID + ":windmill_top"); + iIconContainers[1] = new IIconContainer() { + @Override + public IIcon getIcon() { + return iIcons[1]; + } + + @Override + public IIcon getOverlayIcon() { + return null; + } + + @Override + public ResourceLocation getTextureFile() { + return new ResourceLocation(MainMod.MOD_ID + ":windmill_top"); + } + }; + + + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + + ITexture[] ret = new ITexture[6]; + + if (isClientSide()) { + + if (aFacing == aSide || aSide == 0) { + iTextures[0] = new GT_RenderedTexture(iIconContainers[0]); + for (int i = 0; i < ret.length; i++) { + ret[i] = iTextures[0]; + } + } else if (aSide == 1) { + iTextures[1] = new GT_RenderedTexture(iIconContainers[1]); + for (int i = 0; i < ret.length; i++) { + ret[i] = iTextures[1]; + } + } else { + iTextures[2] = new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE); + for (int i = 0; i < ret.length; i++) { + ret[i] = iTextures[2]; + } + } + } + return ret; + } + + public boolean isClientSide() { + if (this.getBaseMetaTileEntity().getWorld() != null) + return this.getBaseMetaTileEntity().getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; + return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java new file mode 100644 index 0000000000..04f8f0f7be --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -0,0 +1,303 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; + +import static gregtech.api.enums.GT_Values.V; + +public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBlastFurnace { + + private int mHeatingCapacity = 0; + private byte glasTier = 0; + private int polPtick = super.getPollutionPerTick(null) * ConfigHandler.megaMachinesMax; + + public GT_TileEntity_MegaBlastFurnace(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_MegaBlastFurnace(String aName) { + super(aName); + } + + public String[] getDescription() { + return new String[]{"Controller Block for the Blast Furnace", + "Size(WxHxD): 15x20x15 (Hollow)", + "Controller 2nd Layer Middle Center", + "Inner 14x18x14 Heating Coils (Hollow)", + "Outer 15x18x15 Boronsilicate Glass", + "The glass limits the the Energy Input tier", + "1+ Input Hatch/Bus (Any casing)", + "1+ Output Hatch/Bus (Any casing)", + "1+ Energy Hatch (Any casing)", + "1x Maintenance Hatch (Any casing)", + "14x14 Muffler Hatches (Top middle)", + "Heat Proof Machine Casings for the outer 15x15 (Layer 20)", + "1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing),", + " Recovery scales with Muffler Hatch tier", + "Heat Proof Machine Casings for Base", + "Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively)", + "Each 1800K over the min. Heat Capacity allows for one upgraded overclock", + "Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%", + "Causes maximal" + 20 * this.getPollutionPerTick((ItemStack) null) + " Pollution per second" + }; + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + ItemStack[] tInputs = (ItemStack[]) this.getStoredInputs().toArray(new ItemStack[0]); + FluidStack[] tFluids = (FluidStack[]) this.getStoredFluids().toArray(new FluidStack[0]); + + ArrayList outputItems = new ArrayList(); + ArrayList outputFluids = new ArrayList(); + + long tVoltage = this.getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); + boolean found_Recipe = false; + int processed = 0; + while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { + if (tRecipe != null && this.mHeatingCapacity >= tRecipe.mSpecialValue && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { + found_Recipe = true; + for (int i = 0; i < tRecipe.mOutputs.length; i++) { + outputItems.add(tRecipe.getOutput(i)); + } + for (int i = 0; i < tRecipe.mFluidOutputs.length; i++) { + outputFluids.add(tRecipe.getFluidOutput(i)); + } + ++processed; + } else + break; + } + + if (found_Recipe) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + int tHeatCapacityDivTiers = (mHeatingCapacity - tRecipe.mSpecialValue) / 900; + byte overclockCount = 0; + long actualEUT = (long) (tRecipe.mEUt) * processed; + if (actualEUT > Integer.MAX_VALUE) { + byte divider = 0; + while (actualEUT > Integer.MAX_VALUE) { + actualEUT = actualEUT / 2; + divider++; + } + overclockCount = calculateOverclockednessEBF((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), tVoltage); + } else + overclockCount = calculateOverclockednessEBF(tRecipe.mEUt * 64, tRecipe.mDuration, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + if (tHeatCapacityDivTiers > 0) { + this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); + this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount);//extra free overclocking if possible + if (this.mMaxProgresstime < 1) + this.mMaxProgresstime = 1;//no eu efficiency correction + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + + this.polPtick = super.getPollutionPerTick(null) * processed; + this.mOutputItems = new ItemStack[outputItems.size()]; + this.mOutputItems = outputItems.toArray(this.mOutputItems); + this.mOutputFluids = new FluidStack[outputFluids.size()]; + this.mOutputFluids = outputFluids.toArray(this.mOutputFluids); + this.updateSlots(); + return true; + } + return false; + } + + /** + * Taken from the GTNH fork, made originally by Tec + * Calcualtes overclocked ness using long integers + * + * @param aEUt - recipe EUt + * @param aDuration - recipe Duration + */ + protected byte calculateOverclockednessEBF(int aEUt, int aDuration, long maxInputVoltage) { + byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)), timesOverclocked = 0; + if (mTier == 0) { + //Long time calculation + long xMaxProgresstime = ((long) aDuration) << 1; + if (xMaxProgresstime > Integer.MAX_VALUE - 1) { + //make impossible if too long + mEUt = Integer.MAX_VALUE - 1; + mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + mEUt = aEUt >> 2; + mMaxProgresstime = (int) xMaxProgresstime; + } + //return 0; + } else { + //Long EUt calculation + long xEUt = aEUt; + //Isnt too low EUt check? + long tempEUt = xEUt < V[1] ? V[1] : xEUt; + + mMaxProgresstime = aDuration; + + while (tempEUt <= V[mTier - 1]) { + tempEUt <<= 2;//this actually controls overclocking + //xEUt *= 4;//this is effect of everclocking + mMaxProgresstime >>= 1;//this is effect of overclocking + xEUt = mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power + timesOverclocked++; + } + if (xEUt > Integer.MAX_VALUE - 1) { + mEUt = Integer.MAX_VALUE - 1; + mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + mEUt = (int) xEUt; + if (mEUt == 0) + mEUt = 1; + if (mMaxProgresstime == 0) + mMaxProgresstime = 1;//set time to 1 tick + } + } + return timesOverclocked; + } + + @Override + public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + mHeatingCapacity = 0; + HashSet ret = new HashSet(); + ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, -2, -1, GregTech_API.sBlockCasings1, 11, 7, 11)); + ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11)); + ret.add(BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11)); + for (int y = -1; y < 17; y++) { + ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, true, 11)); + if (!getCoilHeat(iGregTechTileEntity, 7, y, 6)) + return false; + List metasFromLayer = BW_Util.getMetasFromLayer(iGregTechTileEntity, 7, y, y + 1, 7, y == 0, false, false); + for (Byte meta : metasFromLayer) { + byte inttier = BW_Util.getTierFromGlasMeta(meta); + if (glasTier > 0 && inttier != glasTier) + return false; + else if (glasTier == 0) + glasTier = inttier; + } + } + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 7; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 7; + for (int z = -6; z <= 6; z++) + for (int x = -6; x <= 6; x++) { + if (!addMufflerToMachineList(iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + x, 17, zDir + z), 11)) { + return false; + } + } + if (!this.mOutputHatches.isEmpty()) { + for (GT_MetaTileEntity_Hatch_Output hatchOutput : mOutputHatches) + if (hatchOutput.getBaseMetaTileEntity().getYCoord() < iGregTechTileEntity.getYCoord()) + return false; + } + + if (glasTier != 8 && !mEnergyHatches.isEmpty()) + for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : mEnergyHatches) { + if (glasTier > hatchEnergy.mTier) + return false; + } + + return !ret.contains(Boolean.FALSE) && !this.mMaintenanceHatches.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mInputBusses.isEmpty(); + } + + private boolean getCoilHeat(IGregTechTileEntity iGregTechTileEntity, int offset, int y, int radius) { + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * offset; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * offset; + int internalH = 0; + for (int x = -radius; x <= radius; x++) { + for (int z = -radius; z <= radius; z++) { + if (Math.abs(x) < radius && Math.abs(z) != radius) + continue; + byte tUsedMeta = iGregTechTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); + switch (tUsedMeta) { + case 0: + internalH = 1801; + break; + case 1: + internalH = 2701; + break; + case 2: + internalH = 3601; + break; + case 3: + internalH = 4501; + break; + case 4: + internalH = 5401; + break; + case 5: + internalH = 7201; + break; + case 6: + internalH = 9001; + break; + case 7: + internalH = 12001; + break; + case 8: + internalH = 15001; + break; + default: + break; + } + if (mHeatingCapacity > 0 && internalH != mHeatingCapacity) + return false; + else if (mHeatingCapacity == 0) + mHeatingCapacity = internalH; + } + } + return true; + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return polPtick; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_MegaBlastFurnace(this.mName); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java new file mode 100644 index 0000000000..4976db98c9 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_VacuumFreezer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +import java.util.ArrayList; +import java.util.HashSet; + +import static gregtech.api.enums.GT_Values.V; + +public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFreezer { + + public GT_TileEntity_MegaVacuumFreezer(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_MegaVacuumFreezer(String aName) { + super(aName); + } + + public String[] getDescription() { + return new String[]{ + "Controller Block for the Mega Vacuum Freezer", + "Super cools hot ingots and cells", + "Size(WxHxD): 15x15x15 (Hollow), Controller (Front centered)", + "1x Input Bus (Any casing)", + "1x Output Bus (Any casing)", + "1x Maintenance Hatch (Any casing)", + "1x Energy Hatch (Any casing)", + "Frost Proof Machine Casings for the rest" + }; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_TileEntity_MegaVacuumFreezer(this.mName); + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + ItemStack[] tInputs = (ItemStack[]) this.getStoredInputs().toArray(new ItemStack[0]); + ArrayList outputItems = new ArrayList(); + + long tVoltage = this.getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], null, tInputs); + boolean found_Recipe = false; + int processed = 0; + while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { + if (tRecipe != null && tRecipe.isRecipeInputEqual(true, null, tInputs)) { + found_Recipe = true; + for (int i = 0; i < tRecipe.mOutputs.length; i++) { + outputItems.add(tRecipe.getOutput(i)); + } + ++processed; + } else + break; + } + + if (found_Recipe) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + long actualEUT = (long) (tRecipe.mEUt) * processed; + if (actualEUT > Integer.MAX_VALUE) { + byte divider = 0; + while (actualEUT > Integer.MAX_VALUE) { + actualEUT = actualEUT / 2; + divider++; + } + BW_Util.calculateOverclockedNessMulti((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), 1, this.getMaxInputVoltage(), this); + } else + BW_Util.calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, this.getMaxInputVoltage(), this); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[outputItems.size()]; + this.mOutputItems = outputItems.toArray(this.mOutputItems); + this.updateSlots(); + return true; + } + return false; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + HashSet ret = new HashSet(); + ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, -7, -6, GregTech_API.sBlockCasings2, 1, 7, false, 17)); + ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, -6, 0, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17)); + ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, 0, 1, GregTech_API.sBlockCasings2, 1, 7, true, false, true, Blocks.air, -1, true, 17)); + ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, 1, 7, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17)); + ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false, 17)); + return !(ret.contains(Boolean.FALSE) || this.mInputBusses.isEmpty() || this.mOutputBusses.isEmpty() || this.mEnergyHatches.isEmpty() || this.mMaintenanceHatches.isEmpty()); + } + + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java new file mode 100644 index 0000000000..2b5df0d3a2 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; + +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; + +public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGenerator { + + public GT_MetaTileEntity_AcidGenerator(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, aDescription, aTextures); + } + + public GT_MetaTileEntity_AcidGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public int getPollution() { + return 0; + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipes() { + return BWRecipes.instance.getMappingsFor((byte) 2); + } + + @Override + public int getEfficiency() { + return 100 - 3 * mTier; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_MetaTileEntity_AcidGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + + public ITexture[] getFront(byte aColor) { + return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + } + + public ITexture[] getBack(byte aColor) { + return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public ITexture[] getBottom(byte aColor) { + return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public ITexture[] getTop(byte aColor) { + return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT"))}; + } + + public ITexture[] getSides(byte aColor) { + return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public ITexture[] getFrontActive(byte aColor) { + return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + } + + public ITexture[] getBackActive(byte aColor) { + return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public ITexture[] getBottomActive(byte aColor) { + return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public ITexture[] getTopActive(byte aColor) { + return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE"))}; + } + + public ITexture[] getSidesActive(byte aColor) { + return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + } + + public boolean isOutputFacing(byte aSide) { + return aSide == this.getBaseMetaTileEntity().getFrontFacing(); + } + + @SuppressWarnings("deprecation") + public String[] getDescription() { + return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Efficiency: " + ChatColorHelper.YELLOW + getEfficiency(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks"}; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java new file mode 100644 index 0000000000..593e9fee7a --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -0,0 +1,262 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; + +import com.github.bartimaeusnek.bartworks.common.items.LabModule; +import com.github.bartimaeusnek.bartworks.common.items.LabParts; +import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; +import com.github.bartimaeusnek.bartworks.util.*; +import cpw.mods.fml.common.Loader; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.XSTR; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.items.behaviors.Behaviour_DataOrb; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { + + private static final String MGUINAME = "BW.GUI.BioLab.png"; + + public GT_MetaTileEntity_BioLab(int aID, String aName, String aNameRegional, int aTier, String aDescription) { + super(aID, aName, aNameRegional, aTier, 1, aDescription, 6, 2, MGUINAME, null, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")/*this is topactive*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")/*this is top*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM"))); + } + + public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, String aNEIName) { + super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2, MGUINAME, aNEIName); + } + + public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String[] aDescription, ITexture[][][] aTextures, String aNEIName) { + super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2, MGUINAME, aNEIName); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_MetaTileEntity_BioLab(this.mName, this.mTier, this.mAmperage, this.mDescriptionArray, this.mTextures, this.mNEIName); + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeList() { + return BWRecipes.instance.getMappingsFor(BWRecipes.BIOLABBYTE); + } + + @Override + public int getCapacity() { + return this.mTier * 1000; + } + + @Override + public int checkRecipe(boolean skipOC) { + + int rTier = 3; + FluidStack dnaFluid = Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); + + if (this.getSpecialSlot() != null && this.getSpecialSlot().getItem() instanceof LabModule) { + int damage = getSpecialSlot().getItemDamage() + 1; + switch (damage) { + case 0: + if (GT_Utility.isStackValid(this.mInventory[4]) && this.mInventory[4].getItem() instanceof LabParts && this.mInventory[4].getItemDamage() == 0 && this.mInventory[4].getTagCompound() != null && //checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[5]) && this.mInventory[5].getItem() instanceof LabParts && this.mInventory[5].getItemDamage() == 1 && this.mInventory[5].getTagCompound() == null && + GT_Utility.isStackValid(this.mInventory[6]) && this.mInventory[6].getItem() instanceof LabParts && this.mInventory[6].getItemDamage() == 3 && + GT_Utility.areStacksEqual(this.mInventory[7], Materials.Ethanol.getCells(1)) && + this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000 + ) { + + NBTTagCompound DNABioDataTag = this.mInventory[4].getTagCompound().getCompoundTag("DNA"); + if (DNABioDataTag == null) + return super.checkRecipe(skipOC); + BioData cultureDNABioData = BioData.getBioDataFromName(this.mInventory[4].getTagCompound().getCompoundTag("DNA").getString("Name")); + if (cultureDNABioData == null) + return super.checkRecipe(skipOC); + + if (this.mTier < rTier + cultureDNABioData.getTier()) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + + for (int i = 4; i < 8; i++) { + if (this.mInventory[i] != null) + this.mInventory[i].stackSize--; + } + + this.mFluid.amount -= 1000; + + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + this.mOutputItems[0] = BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(cultureDNABioData)); + } + this.mOutputItems[1] = GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L); + this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(rTier + cultureDNABioData.getTier()), 500); + + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + } + break; + case 1: { + if (GT_Utility.isStackValid(this.mInventory[4]) && this.mInventory[4].getItem() instanceof LabParts && this.mInventory[4].getItemDamage() == 1 && this.mInventory[4].getTagCompound() != null && //checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[7]) && GT_Utility.areStacksEqual(this.mInventory[7], ItemList.Tool_DataOrb.get(1L)) && + GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], FluidLoader.BioLabFluidCells[0]) && + GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], FluidLoader.BioLabFluidCells[3]) && + this.mFluid.isFluidEqual(dnaFluid) && this.mFluid.amount >= 1000) { + NBTTagCompound DNABioDataTag = this.mInventory[4].getTagCompound(); + if (DNABioDataTag == null) + return super.checkRecipe(skipOC); + BioData cultureDNABioData = BioData.getBioDataFromName(DNABioDataTag.getString("Name")); + if (cultureDNABioData == null) + return super.checkRecipe(skipOC); + + if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + + for (int i = 4; i < 8; i++) { + if (this.mInventory[i] != null) + this.mInventory[i].stackSize--; + } + + this.mFluid.amount -= 1000; + + ItemStack Outp = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); + Behaviour_DataOrb.setDataName(Outp, cultureDNABioData.getName()); + + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + this.mOutputItems[0] = Outp; + } else + this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L); + this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(2L); + + this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); + + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + + } + } + break; + case 2: { + ItemStack inp2 = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); + Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); + if ( + GT_Utility.isStackValid(this.mInventory[4]) && GT_Utility.areStacksEqual(FluidLoader.BioLabFluidCells[1], this.mInventory[4]) && //checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getPlasmidCell(null)) && + GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], ItemList.Tool_DataOrb.get(1L), true) && + Behaviour_DataOrb.getDataTitle(this.mInventory[6]).equals("DNA Sample") && (!(Behaviour_DataOrb.getDataName(this.mInventory[6]).isEmpty())) && + GT_Utility.isStackValid(this.mInventory[7]) && GT_Utility.areStacksEqual(this.mInventory[7], inp2) && + this.mFluid.isFluidEqual(dnaFluid) && (this.mFluid.amount >= 1000)) { + BioData cultureDNABioData = BioData.getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[6])); + if (cultureDNABioData == null) + return super.checkRecipe(skipOC); + if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + for (int i = 4; i < 6; i++) { + if (this.mInventory[i] != null) + this.mInventory[i].stackSize--; + } + this.mFluid.amount -= 1000; + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + this.mOutputItems[0] = BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + } + this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); + this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + } + + } + break; + + case 3: { + if ( + GT_Utility.isStackValid(this.mInventory[4]) && GT_Utility.areStacksEqual(this.mInventory[4], BioItemList.getPetriDish(null), true) && this.mInventory[4].getTagCompound() != null && + GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getPlasmidCell(null), true) && this.mInventory[5].getTagCompound() != null && + GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], FluidLoader.BioLabFluidCells[2]) && + this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000) { + BioData cultureDNABioData = BioData.getBioDataFromNBTTag(this.mInventory[5].getTagCompound()); + BioCulture bioCulture = BioCulture.getBioCultureFromNBTTag(this.mInventory[4].getTagCompound()); + if (cultureDNABioData == null || bioCulture == null) + return super.checkRecipe(skipOC); + if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + for (int i = 4; i < 7; i++) { + if (this.mInventory[i] != null) + this.mInventory[i].stackSize--; + } + this.mFluid.amount -= 1000; + bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + this.mOutputItems[0] = BioItemList.getPetriDish(bioCulture); + } + this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); + this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + } + } + break; + case 4: { + + ItemStack Outp = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); + + if ( + GT_Utility.isStackValid(this.mInventory[4]) && GT_Utility.areStacksEqual(this.mInventory[4], BioItemList.getPetriDish(null)) && + GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getOther(4)) && + GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], ItemList.Circuit_Chip_Stemcell.get(2L)) && + GT_Utility.isStackValid(this.mInventory[7]) && GT_Utility.areStacksEqual(this.mInventory[7], ItemList.Tool_DataOrb.get(1L), true) && + Behaviour_DataOrb.getDataTitle(this.mInventory[7]).equals("DNA Sample") && this.mFluid.isFluidEqual(dnaFluid) && (this.mFluid.amount >= 8000)) { + + BioData cultureDNABioData = BioData.getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[7])); + if (cultureDNABioData == null) + return super.checkRecipe(skipOC); + if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + for (int i = 4; i < 7; i++) { + if (this.mInventory[i] != null) + this.mInventory[i].stackSize--; + } + this.mFluid.amount -= 8000; + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + BioCulture out = BioCulture.getBioCulture(BioDNA.convertDataToDNA(cultureDNABioData)); + out.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + this.mOutputItems[0] = BioItemList.getPetriDish(out); + } + this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + } + } + break; + default: + return super.checkRecipe(skipOC); + } + } + return super.checkRecipe(skipOC); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java new file mode 100644 index 0000000000..0d51cb828b --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; + +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + +public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { + + private long maxAmps; + private long aAmps; + + public GT_MetaTileEntity_Diode(int aID, String aName, String aNameRegional, int aTier, int maxAmps) { + super(aID, aName, aNameRegional, aTier, "A Simple diode that will allow Energy Flow in only one direction."); + this.maxAmps = maxAmps; + aAmps = maxAmps; + } + + public GT_MetaTileEntity_Diode(String aName, int aTier, long maxAmps, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + this.maxAmps = maxAmps; + aAmps = maxAmps; + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + --aAmps; + if (aAmps < 0) + aAmps = maxAmps; + GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + aAmps); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setLong("maxAmp", maxAmps); + aNBT.setLong("Amps", aAmps); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + maxAmps = aNBT.getLong("maxAmp"); + aAmps = aNBT.getLong("Amps"); + super.loadNBTData(aNBT); + } + + @Override + public long maxAmperesOut() { + return aAmps; + } + + @Override + public long maxAmperesIn() { + return aAmps; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Diode(this.mName, this.mTier, this.maxAmps, this.mDescriptionArray, this.mTextures); + } + + @SuppressWarnings("deprecation") + public String[] getDescription() { + return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks"}; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java new file mode 100644 index 0000000000..0dad2c8414 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; + +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Transformer; + +public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Transformer { + + public GT_MetaTileEntity_EnergyDistributor(int aID, String aName, String aNameRegional, int aTier, String aDescription) { + super(aID, aName, aNameRegional, aTier, aDescription); + } + + public GT_MetaTileEntity_EnergyDistributor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + public GT_MetaTileEntity_EnergyDistributor(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_EnergyDistributor(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + + public long maxEUInput() { + return GT_Values.V[this.mTier]; + } + + public long maxEUOutput() { + return GT_Values.V[this.mTier]; + } + + public long maxAmperesOut() { + return 320; + } + + public long maxAmperesIn() { + return 320; + } + + @Override + public long maxEUStore() { + return 512L + (GT_Values.V[this.mTier] * 320L); + } + + @SuppressWarnings("deprecation") + public String[] getDescription() { + return new String[]{this.mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Amperage IN: " + ChatColorHelper.YELLOW + this.maxAmperesIn(), "Amperage OUT: " + ChatColorHelper.YELLOW + this.maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks"}; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java new file mode 100644 index 0000000000..ddab78ea3e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -0,0 +1,317 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; + +import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_RadioHatch; +import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; + +import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; + +public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { + + private final int cap; + public int sievert; + private long timer = 1; + private short[] colorForGUI; + private byte mass; + private String material; + private byte coverage = 0; + + public GT_MetaTileEntity_RadioHatch(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 1, new String[]{"Radioactive Item Chamber for Multiblocks", "Capacity: " + (aTier - 2) + " kg" + ((aTier - 2) >= 2 ? "s" : ""), "Use a screwdriver to set the containment level"}); + cap = aTier - 2; + } + + public GT_MetaTileEntity_RadioHatch(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 1, aDescription, aTextures); + cap = aTier - 2; + } + + public GT_MetaTileEntity_RadioHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 1, aDescription, aTextures); + cap = aTier - 2; + } + + public static long calcDecayTicks(int x) { + long ret = 0; + if (x >= 83 && x <= 100) + ret = (long) Math.ceil((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); + else if (x == 43) + ret = 5000; + else if (x == 61) + ret = 4500; + else if (x > 100) + ret = (long) Math.ceil(((8000D * Math.tanh(-x / 65D) + 8000D))); + return ret;//*20; + } + + public int getSievert() { + return this.sievert - (int) Math.ceil((float) this.sievert / 100f * (float) coverage); + } + + public short[] getColorForGUI() { + if (this.colorForGUI != null) + return this.colorForGUI; + return new short[]{0xFA, 0xFA, 0xFF}; + } + + public byte getMass() { + return this.mass; + } + + public byte getCoverage() { + return this.coverage; + } + + public void setCoverage(short coverage) { + byte nu = 0; + if (coverage > 100) + nu = 100; + else if (coverage < 0) + nu = 0; + else + nu = (byte) coverage; + this.coverage = nu; + } + + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + } + + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_MetaTileEntity_RadioHatch(mName, mTier, mDescriptionArray, mTextures); + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + aPlayer.openGui(MainMod.MOD_ID, 2, this.getBaseMetaTileEntity().getWorld(), this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()); + //super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + } + + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } else { + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + } + + public void updateSlots() { + if (this.mInventory[0] != null && this.mInventory[0].stackSize <= 0) + this.mInventory[0] = null; + } + + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { + if (this.getBaseMetaTileEntity().isServerSide()) { + + if (this.mass > 0) + ++timer; + + if (this.mass > 0 && this.sievert > 0 && calcDecayTicks(this.sievert) > 0) { + if (timer % (calcDecayTicks(this.sievert)) == 0) { + this.mass--; + if (mass == 0) { + material = "Empty"; + sievert = 0; + } + timer = 1; + } + } + + ItemStack lStack = this.mInventory[0]; + + if (lStack == null) + return; + + if (GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_4.get(1))) { + Materials materials = Materials.Uranium; + byte kg = 3; + + if (GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_4.get(1))) + materials = Materials.Plutonium; + else if (GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_4.get(1))) + materials = Materials.Thorium; + else if (GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_4.get(1))) + materials = Materials.Naquadah; + else + kg = 6; + + if (GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_2.get(1))) + kg = (byte) (2 * kg); + else if (GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_4.get(1))) + kg = (byte) (4 * kg); + + + if (this.mass == 0 || this.sievert == calculateSv(materials)) { + if (this.mass + kg <= cap) { + this.sievert = calculateSv(materials); + this.mass += kg; + this.mInventory[0].stackSize--; + updateSlots(); + colorForGUI = materials.mColor.mRGBa; + material = materials.mName; + } + } + } + + for (ItemStack varStack : BioVatLogicAdder.RadioHatch.getIsSv().keySet()) { + if (GT_Utility.areStacksEqual(varStack, lStack)) { + if (this.mass == 0 || this.sievert == BioVatLogicAdder.RadioHatch.getIsSv().get(varStack)) { + if (this.mass < this.cap) { + this.mass++; + this.sievert = BioVatLogicAdder.RadioHatch.getIsSv().get(varStack); + this.mInventory[0].stackSize--; + updateSlots(); + colorForGUI = null; + material = StatCollector.translateToLocal(varStack.getUnlocalizedName()); + return; + } + } + } + } + + //check material for general validity + if (lStack != null && GT_OreDictUnificator.getAssociation(lStack) != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial != null) { + //check orePrefix for general validity + if (GT_OreDictUnificator.getAssociation(lStack).mPrefix != null) { + OrePrefixes orePrefixes = GT_OreDictUnificator.getAssociation(lStack).mPrefix; + //check orePrefix for specialised validity + if (orePrefixes.equals(OrePrefixes.stickLong) || orePrefixes.equals(OrePrefixes.stick)) { + Materials materials = GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial; + //check material for specialised validity + if (materials.getProtons() >= 83 && materials.getProtons() != 125 || materials.getProtons() == 61 || materials.getProtons() == 43) { + if (this.mass == 0 || this.sievert == calculateSv(materials)) { + if ((this.mass + (orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1)) <= cap) { + this.sievert = calculateSv(materials); + this.mass += orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1; + this.mInventory[0].stackSize--; + updateSlots(); + colorForGUI = materials.mColor.mRGBa; + material = materials.mName; + } + } + } + } + } + } + + + } + } + + @Override + public boolean isGivingInformation() { + return true; + } + + @Override + public String[] getInfoData() { + if (calcDecayTicks(this.sievert) != 0) + return new String[]{"Material: " + material, "Sievert: " + sievert, "Amount: " + mass, "Time (in t/s/m/h) to decay (1kg): " + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert) * 60)) + "t/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 + "s/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 + "m/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 / 60 + "h"}; + else return new String[]{"Material: Empty", "Sievert: 0", "Amount: 0"}; + } + + public boolean isSimpleMachine() { + return true; + } + + public boolean isFacingValid(byte aFacing) { + return true; + } + + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + public boolean isValidSlot(int aIndex) { + return true; + } + + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aSide == this.getBaseMetaTileEntity().getFrontFacing(); + } + + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_RadioHatch(aPlayerInventory, aBaseMetaTileEntity); + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_RadioHatch(aPlayerInventory, aBaseMetaTileEntity, this.mName); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setByte("mMass", mass); + aNBT.setByte("mSv", (byte) (sievert - 100)); + aNBT.setByte("mCoverage", coverage); + aNBT.setInteger("mTextColor", BW_Util.getColorFromArray(getColorForGUI())); + if (material != null && !material.isEmpty()) + aNBT.setString("mMaterial", material); + aNBT.setLong("timer", timer); + super.saveNBTData(aNBT); + } + + public long getTimer() { + return this.timer; + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + timer = aNBT.getLong("timer"); + mass = aNBT.getByte("mMass"); + sievert = aNBT.getByte("mSv") + 100; + coverage = aNBT.getByte("mCoverage"); + colorForGUI = BW_Util.splitColortoArray(aNBT.getInteger("mTextColor")); + material = aNBT.getString("mMaterial"); + super.loadNBTData(aNBT); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java new file mode 100644 index 0000000000..95625ea9f3 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IBasicEnergyContainer; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachineBlock { + boolean powered = false; + + public GT_MetaTileEntity_Transistor(int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, 0, aDescription, aTextures); + } + + public GT_MetaTileEntity_Transistor(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, 0, aDescription, aTextures); + } + + public GT_MetaTileEntity_Transistor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + } + + public GT_MetaTileEntity_Transistor(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[12][17][]; + + for (byte i = -1; i < 16; ++i) { + rTextures[0][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + rTextures[1][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + rTextures[2][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + rTextures[3][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; + rTextures[4][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; + rTextures[5][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; + rTextures[6][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]}; + rTextures[7][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]}; + rTextures[8][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]}; + rTextures[9][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; + rTextures[10][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; + rTextures[11][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; + } + + return rTextures; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_MetaTileEntity_Transistor(this.mName, this.mTier, this.getDescription(), null); + } + + @Override + public void saveNBTData(NBTTagCompound nbtTagCompound) { + + } + + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + byte side = (byte) ForgeDirection.EAST.flag; + if (aBaseMetaTileEntity.inputEnergyFrom(side)) { + TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(side); + if (!(tTileEntity instanceof IBasicEnergyContainer)) { + powered = false; + return; + } + IBasicEnergyContainer tileAtSide = (IBasicEnergyContainer) tTileEntity; + if (!tileAtSide.outputsEnergyTo((byte) ForgeDirection.WEST.flag) || !tileAtSide.isUniversalEnergyStored(4L)) { + powered = false; + return; + } + if (!tileAtSide.decreaseStoredEnergyUnits(4, false)) { + powered = false; + return; + } + if (aBaseMetaTileEntity.injectEnergyUnits(side, 4L, 1L) == 4L) { + powered = true; + } + } + + if (aBaseMetaTileEntity.isAllowedToWork()) + powered = !powered; + } + } + + public long maxEUInput() { + return GT_Values.V[this.mTier]; + } + + @Override + public long maxAmperesIn() { + return 1L; + } + + @Override + public long maxAmperesOut() { + return powered ? 1L : 0; + } + + public long maxEUOutput() { + return powered ? GT_Values.V[this.mTier] : 0; + } + + @Override + public void loadNBTData(NBTTagCompound nbtTagCompound) { + + } + + @Override + public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + return new ITexture[0]; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java index 135666a134..b30c3fbbd4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java @@ -22,7 +22,7 @@ package com.github.bartimaeusnek.bartworks.server.container; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_RadioHatch; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import gregtech.api.gui.GT_Slot_Holo; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java index ceb6a4cc8e..22a3e8ea17 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java @@ -22,7 +22,7 @@ package com.github.bartimaeusnek.bartworks.server.container; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_RadioHatch; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_Container_1by1; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 33b6615865..5027760ab7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -33,7 +33,12 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import javax.annotation.Nonnegative; +import java.util.ArrayList; import java.util.Iterator; +import java.util.List; + +import static gregtech.api.enums.GT_Values.V; public class BW_Util { @@ -112,6 +117,121 @@ public class BW_Util { return 0; } + public static byte getTierFromGlasMeta(int meta) { + byte ret; + switch (meta) { + case 1: + ret = 4; + break; + case 2: + ret = 5; + break; + case 3: + ret = 6; + break; + case 4: + ret = 7; + break; + case 5: + ret = 8; + break; + default: + ret = 3; + } + return ret; + } + + public static String getColorForTier(int tier) { + String ret; + switch (tier) { + case 0: + ret = ChatColorHelper.RED; + break; + case 1: + ret = ChatColorHelper.GRAY; + break; + case 2: + ret = ChatColorHelper.AQUA; + break; + case 3: + ret = ChatColorHelper.GOLD; + break; + case 4: + ret = ChatColorHelper.DARKPURPLE; + break; + case 5: + ret = ChatColorHelper.DARKBLUE; + break; + case 6: + ret = ChatColorHelper.LIGHT_PURPLE; + break; + case 7: + ret = ChatColorHelper.WHITE; + break; + case 8: + ret = ChatColorHelper.DARKAQUA; + break; + case 9: + ret = ChatColorHelper.DARKRED; + break; + case 10: + ret = ChatColorHelper.GREEN; + break; + default: + ret = ChatColorHelper.OBFUSCATED; + break; + } + return ret; + } + + /** + * Taken from the GTNH fork, made originally by Tec + * Calcualtes overclocked ness using long integers + * + * @param aEUt - recipe EUt + * @param aDuration - recipe Duration + * @param mAmperage - should be 1 ? + */ + public static void calculateOverclockedNessMulti(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, GT_MetaTileEntity_MultiBlockBase base) { + byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); + if (mTier == 0) { + //Long time calculation + long xMaxProgresstime = ((long) aDuration) << 1; + if (xMaxProgresstime > Integer.MAX_VALUE - 1) { + //make impossible if too long + base.mEUt = Integer.MAX_VALUE - 1; + base.mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + base.mEUt = aEUt >> 2; + base.mMaxProgresstime = (int) xMaxProgresstime; + } + } else { + //Long EUt calculation + long xEUt = aEUt; + //Isnt too low EUt check? + long tempEUt = xEUt < V[1] ? V[1] : xEUt; + + base.mMaxProgresstime = aDuration; + + while (tempEUt <= V[mTier - 1] * mAmperage) { + tempEUt <<= 2;//this actually controls overclocking + //xEUt *= 4;//this is effect of everclocking + base.mMaxProgresstime >>= 1;//this is effect of overclocking + xEUt = base.mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power + } + if (xEUt > Integer.MAX_VALUE - 1) { + base.mEUt = Integer.MAX_VALUE - 1; + base.mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + base.mEUt = (int) xEUt; + if (base.mEUt == 0) + base.mEUt = 1; + if (base.mMaxProgresstime == 0) + base.mMaxProgresstime = 1;//set time to 1 tick + } + } + } + public static EnumRarity getRarityFromByte(byte b) { switch (b) { case 1: @@ -125,29 +245,34 @@ public class BW_Util { } } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int diameter, int yLevel, int height, Block block, int offset, int aBaseCasingIndex) { - return check_layer(aBaseMetaTileEntity, diameter, yLevel, height, block, offset, false, aBaseCasingIndex); + + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean insideCheck, Block inside, int dmginside, int aBaseCasingIndex) { + return check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, insideCheck, inside, dmginside, aBaseCasingIndex); } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int diameter, int yLevel, int height, Block block, int offset, boolean controllerLayer, int aBaseCasingIndex) { - return check_layer(aBaseMetaTileEntity, diameter, yLevel, height, block, offset, controllerLayer, false, aBaseCasingIndex); + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, int aBaseCasingIndex) { + return check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, aBaseCasingIndex); } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int diameter, int yLevel, int height, Block block, int offset, boolean controllerLayer, boolean freeCorners, int aBaseCasingIndex) { - return check_layer(aBaseMetaTileEntity, diameter, yLevel, height, block, offset, controllerLayer, freeCorners, false, null, true, aBaseCasingIndex); + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, int aBaseCasingIndex) { + return check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, false, aBaseCasingIndex); } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int diameter, int yLevel, int height, Block block, int offset, boolean controllerLayer, boolean insideCheck, Block inside, int aBaseCasingIndex) { - return check_layer(aBaseMetaTileEntity, diameter, yLevel, height, block, offset, controllerLayer, false, insideCheck, inside, true, aBaseCasingIndex); + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, int aBaseCasingIndex) { + return check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, freeCorners, true, block, dmg, true, aBaseCasingIndex); + } + + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean insideCheck, Block inside, int dmginside, int aBaseCasingIndex) { + return check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, false, insideCheck, inside, dmginside, true, aBaseCasingIndex); } /** * @param aBaseMetaTileEntity the Multiblock controller, usually a parameter - * @param diameter the diameter of the layer + * @param radius the radius of the layer * @param yLevel the starting y level of the Layer, referenced to the Multiblock * @param height the height of the Layers, referenced to the Multiblock * @param block the block for the walls - * @param offset the offset in most cases should be the same as the diameter + * @param offset the offset in most cases should be the same as the radius * @param controllerLayer if the layer contains the controller * @param freeCorners if the corners should be checked * @param insideCheck if the inside should be empty/filled @@ -156,20 +281,21 @@ public class BW_Util { * @param aBaseCasingIndex the Index for the hatches texture * @return if the layer check was completed */ - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int diameter, int yLevel, int height, Block block, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck, Block inside, boolean allowHatches, int aBaseCasingIndex) { + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck, Block inside, int dmginside, boolean allowHatches, int aBaseCasingIndex) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offset; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offset; - for (int x = -diameter; x < diameter; x++) { + for (int x = -radius; x <= radius; x++) { for (int y = yLevel; y < height; y++) { - for (int z = -diameter; z < diameter; z++) { - if (freeCorners && (((Math.abs(x) == diameter && Math.abs(z) == diameter)))) + for (int z = -radius; z <= radius; z++) { + if (freeCorners && (((Math.abs(x) == radius && Math.abs(z) == radius)))) continue; if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) continue; - if (insideCheck && (Math.abs(x) < diameter && Math.abs(z) != diameter)) - if (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside)) + if (insideCheck && (Math.abs(x) < radius && Math.abs(z) != radius)) + if (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside) || (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside && dmginside > (-1))) { return false; - if (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block)) + } + if (((!(Math.abs(x) < radius && Math.abs(z) != radius))) && (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) || (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmg && dmg > (-1)))) { if (!(allowHatches && ( ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addDynamoToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || @@ -177,12 +303,35 @@ public class BW_Util { ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) - ))) + ))) { return false; + } + } } } } return true; } + public static List getMetasFromLayer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck) { + ArrayList ret = new ArrayList<>(); + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offset; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offset; + for (int x = -radius; x <= radius; x++) { + for (int y = yLevel; y < height; y++) { + for (int z = -radius; z <= radius; z++) { + if (freeCorners && (((Math.abs(x) == radius && Math.abs(z) == radius)))) + continue; + if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) + continue; + if (insideCheck && (Math.abs(x) < radius && Math.abs(z) != radius)) + ret.add(aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); + if (!(Math.abs(x) < radius && Math.abs(z) != radius)) { + ret.add(aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); + } + } + } + } + return ret; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index f36a8d54ac..15f432aab3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -119,7 +119,7 @@ public class BioCulture extends BioData { public Fluid getFluid() { if (this.mFluid == null) - MainMod.logger.error("Fluid has not been set yet! The issuring Culture is: " + this.name); + MainMod.LOGGER.error("Fluid has not been set yet! The issuring Culture is: " + this.name); return this.mFluid; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java index 9c6d12c7ba..de262fd73d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java @@ -25,7 +25,6 @@ package com.github.bartimaeusnek.bartworks.util; import codechicken.nei.api.API; import codechicken.nei.api.IConfigureNEI; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import cpw.mods.fml.common.Optional; @@ -37,13 +36,13 @@ public class NEIbartworksConfig implements IConfigureNEI { @Optional.Method(modid = "NotEnoughItems") @Override public String getName() { - return MainMod.name; + return MainMod.NAME; } @Optional.Method(modid = "NotEnoughItems") @Override public String getVersion() { - return MainMod.version; + return MainMod.VERSION; } @Optional.Method(modid = "NotEnoughItems") @@ -51,6 +50,6 @@ public class NEIbartworksConfig implements IConfigureNEI { public void loadConfig() { API.hideItem(new ItemStack(ItemRegistry.TAB)); API.hideItem(new ItemStack(FluidLoader.bioFluidBlock)); - API.hideItem(new ItemStack(BioItemList.bw_fake_glasses)); + API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses)); } } \ No newline at end of file -- cgit From 2d3981ea0fe5c1d38e2f431e45860bb8c530eb90 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 31 Jan 2019 18:08:14 +0100 Subject: +quickfix for servers Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 725142b695afbf12293813449a26d1e45d45813f --- .../bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java | 3 ++- .../github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java index 4b10f1dc9a..893afa625f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.blocks; import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.material.Material; @@ -180,7 +181,7 @@ public class BW_GlasBlocks extends BW_Blocks { @Override public int getRenderType() { - if (!fake) + if (!fake && FMLCommonHandler.instance().getSide().isClient()) return RendererGlasBlock.RID; else return 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 1f41d225a9..879578d24d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -29,6 +29,7 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BWTileEnti import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.BioCulture; import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.objects.GT_Fluid; import ic2.core.item.ItemFluidCell; @@ -81,7 +82,9 @@ public class FluidLoader implements Runnable { bioFluidBlock = new BioFluidBlock(); GameRegistry.registerBlock(bioFluidBlock, "coloredFluidBlock"); GameRegistry.registerTileEntity(BWTileEntityDimIDBridge.class, "bwTEDimIDBridge"); - RenderingRegistry.registerBlockHandler(RendererSwitchingColorFluid.instance); - RenderingRegistry.registerBlockHandler(RendererGlasBlock.instance); + if (FMLCommonHandler.instance().getSide().isClient()) { + RenderingRegistry.registerBlockHandler(RendererSwitchingColorFluid.instance); + RenderingRegistry.registerBlockHandler(RendererGlasBlock.instance); + } } } -- cgit From e412e90f5f9e571aaebf1e05d593a1f0627c8405 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 7 Feb 2019 06:08:52 +0100 Subject: API Changes + added a SimpleWaterGenerator + fixed the Diode not working on servers. Former-commit-id: cd0d74153a5a1279b1ff2409eaac39fbccd5c3cf --- build.gradle | 1 + build.properties | 3 +- .../bartimaeusnek/bartworks/API/API_REFERENCE.java | 2 +- .../bartworks/API/BioRecipeAdder.java | 2 +- .../bartworks/API/ITileAddsInformation.java | 27 ++ .../API/ITileHasDifferentTextureSides.java | 53 ++++ .../bartimaeusnek/bartworks/API/ITileWithGUI.java | 48 ++++ .../github/bartimaeusnek/bartworks/GuiHandler.java | 7 + .../github/bartimaeusnek/bartworks/MainMod.java | 3 +- .../gui/BW_GUIContainer_HeatedWaterPump.java | 63 +++++ .../client/renderer/BW_GT_Vanilla_Texture.java | 64 +++++ .../bartworks/common/blocks/BW_Blocks.java | 1 + .../common/blocks/BW_TileEntityContainer.java | 83 +++++- .../blocks/BW_TileEntityContainer_Multiple.java | 165 ++++++++++++ .../bartworks/common/configs/ConfigHandler.java | 2 + .../bartworks/common/items/BW_ItemBlocks.java | 10 +- .../bartworks/common/loaders/ItemRegistry.java | 8 +- .../bartworks/common/loaders/RecipeLoader.java | 37 +++ .../classic/BW_TileEntity_HeatedWaterPump.java | 281 +++++++++++++++++++++ .../tiered/GT_MetaTileEntity_Diode.java | 4 + .../container/BW_Container_HeatedWaterPump.java | 183 ++++++++++++++ .../bartimaeusnek/bartworks/util/BWRecipes.java | 6 + .../bartimaeusnek/bartworks/util/BW_Util.java | 2 +- .../resources/assets/bartworks/lang/en_US.lang | 6 +- .../bartworks/textures/GUI/GUIheatedPump.png | Bin 0 -> 2075 bytes .../textures/blocks/heatedWaterPumpDown.png | Bin 0 -> 496 bytes .../textures/blocks/heatedWaterPumpSide.png | Bin 0 -> 549 bytes .../textures/blocks/heatedWaterPumpTop.png | Bin 0 -> 496 bytes .../assets/bartworks/textures/items/BWmotor.png | Bin 0 -> 506 bytes .../assets/bartworks/textures/items/BWrawtube.png | Bin 0 -> 450 bytes 30 files changed, 1050 insertions(+), 11 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java create mode 100644 src/main/resources/assets/bartworks/textures/GUI/GUIheatedPump.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpDown.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpSide.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpTop.png create mode 100644 src/main/resources/assets/bartworks/textures/items/BWmotor.png create mode 100644 src/main/resources/assets/bartworks/textures/items/BWrawtube.png diff --git a/build.gradle b/build.gradle index 667680d955..ae10e3f9a3 100644 --- a/build.gradle +++ b/build.gradle @@ -51,6 +51,7 @@ minecraft { replaceIn "MainMod.java" replaceIn "API_REFERENCE.java" replace "@version@", project.version + replace "@apiversion@", config.APIVersion runDir = "run" } diff --git a/build.properties b/build.properties index 790f06e74f..cda875cf39 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,8 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=3 -buildNumber=18 +buildNumber=19 +APIVersion=3 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java index 2767d56168..7c2793f2b1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java @@ -23,5 +23,5 @@ package com.github.bartimaeusnek.bartworks.API; public final class API_REFERENCE { - public static final String VERSION = "@version@"; + public static final String VERSION = "@apiversion@"; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java index 0f81d266f0..feedb79761 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java @@ -53,7 +53,7 @@ public final class BioRecipeAdder { * @param aSpecialValue 0 = STANDART, -100 = LowGravity, -200 = Cleanroom * @return if the recipe was added. */ - public static boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { + public static boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { return BWRecipes.instance.addBioLabRecipeIncubation(aInput, aOutput, aChances, aFluidInputs, aDuration, aEUt, aSpecialValue); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java new file mode 100644 index 0000000000..002b175bbf --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +public interface ITileAddsInformation { + String[] getInfoData(); +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java new file mode 100644 index 0000000000..a9318ca7f0 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + + +public interface ITileHasDifferentTextureSides { + + IIcon[] texture = new IIcon[7]; + + @SideOnly(Side.CLIENT) + default IIcon getTextureForSide(ForgeDirection side, int meta) { + return texture[side.ordinal()]; + } + + ; + + @SideOnly(Side.CLIENT) + default IIcon getTextureForSide(int side, int meta) { + return getTextureForSide(ForgeDirection.values()[side], meta); + } + + ; + + @SideOnly(Side.CLIENT) + void registerBlockIcons(IIconRegister par1IconRegister); + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java new file mode 100644 index 0000000000..636fcb3a31 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +import com.github.bartimaeusnek.bartworks.MainMod; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; + +public interface ITileWithGUI { + + /** + * @return the ID of the GUI, see @link com.github.bartimaeusnek.bartworks.GuiHandler + */ + int getGUIID(); + + /** + * gets called from BW_TileEntityContainer(or _Multiple) when right clicked. + * + * @param tileEntity this tile entity + * @param player the player right clicking it + * @return true always. + */ + default boolean openGUI(TileEntity tileEntity, EntityPlayer player) { + if (!tileEntity.getWorldObj().isRemote) + player.openGui(MainMod.MOD_ID, getGUIID(), tileEntity.getWorldObj(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); + return true; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java index 00b9317d5a..5476c65e72 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -22,9 +22,12 @@ package com.github.bartimaeusnek.bartworks; +import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_HeatedWaterPump; import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_RadLevel; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_CircuitProgrammer; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_Destructopack; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; +import com.github.bartimaeusnek.bartworks.server.container.BW_Container_HeatedWaterPump; import com.github.bartimaeusnek.bartworks.server.container.BW_Container_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_CircuitProgrammer; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_Item_Destructopack; @@ -49,6 +52,8 @@ public class GuiHandler implements IGuiHandler { return new BW_Container_RadioHatch(player.inventory, te.getMetaTileEntity()); } } + case 3: + return new BW_Container_HeatedWaterPump((BW_TileEntity_HeatedWaterPump) world.getTileEntity(x, y, z), player); } return null; } @@ -67,6 +72,8 @@ public class GuiHandler implements IGuiHandler { return new BW_GUIContainer_RadLevel(new BW_Container_RadioHatch(player.inventory, te.getMetaTileEntity())); } } + case 3: + return new BW_GUIContainer_HeatedWaterPump(new BW_Container_HeatedWaterPump((BW_TileEntity_HeatedWaterPump) world.getTileEntity(x, y, z), player)); } } else return getServerGuiElement(ID, player, world, x, y, z); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 52b282646f..1d48b16f2e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -56,6 +56,7 @@ public final class MainMod { public static final String NAME = "BartWorks"; public static final String VERSION = "@version@"; public static final String MOD_ID = "bartworks"; + public static final String APIVERSION = "@apiversion@"; public static final Logger LOGGER = LogManager.getLogger(NAME); public static final CreativeTabs GT2 = new GT2Tab("GT2C"); public static final CreativeTabs BIO_TAB = new BioTab("BioTab"); @@ -72,7 +73,7 @@ public final class MainMod { public void preInit(FMLPreInitializationEvent preinit) { //fixing BorosilicateGlass... -_-' Materials.BorosilicateGlass.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); - if (!(API_REFERENCE.VERSION.equals(VERSION))) { + if (!(API_REFERENCE.VERSION.equals(APIVERSION))) { LOGGER.error("Something has loaded an old API. Please contact the Mod authors to update!"); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java new file mode 100644 index 0000000000..b8cd2e9799 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.client.gui; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.server.container.BW_Container_HeatedWaterPump; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.inventory.Container; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class BW_GUIContainer_HeatedWaterPump extends GuiContainer { + private static final ResourceLocation furnaceGuiTextures = new ResourceLocation(MainMod.MOD_ID + ":textures/GUI/GUIheatedPump.png"); + final BW_Container_HeatedWaterPump container; + + public BW_GUIContainer_HeatedWaterPump(Container p_i1072_1_) { + super(p_i1072_1_); + container = (BW_Container_HeatedWaterPump) p_i1072_1_; + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(furnaceGuiTextures); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + this.drawString(this.fontRendererObj, "Fuel:" + container.fuel + " Water:" + container.water, k, l, 0xffffff); + + if (this.container.fuel > 0) { + this.mc.getTextureManager().bindTexture(furnaceGuiTextures); + int ik = this.container.maxfuel > 200 ? this.container.maxfuel : 200; + int i1 = ((this.container.fuel * 13) / ik); + this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 13 - i1, 14, i1 + 1); + } + +// if (this.container.water > 0){ +// this.mc.getTextureManager().bindTexture( new ResourceLocation("textures/blocks/water_still.png")); +// this.drawTexturedModalRect(k+85,l+32,32,32,18,18); +// } + + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java new file mode 100644 index 0000000000..bb93e0e506 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.interfaces.IIconContainer; +import net.minecraft.block.Block; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.util.ForgeDirection; + +@SideOnly(Side.CLIENT) +public class BW_GT_Vanilla_Texture implements IIconContainer { + + IIcon packed; + + public BW_GT_Vanilla_Texture(Block block, ForgeDirection side) { + this.packed = block.getBlockTextureFromSide(side.flag); + } + + public BW_GT_Vanilla_Texture(Block block, int side) { + this.packed = block.getBlockTextureFromSide(side); + } + + public BW_GT_Vanilla_Texture(IIcon packed) { + this.packed = packed; + } + + @Override + public IIcon getIcon() { + return packed; + } + + @Override + public IIcon getOverlayIcon() { + return null; + } + + @Override + public ResourceLocation getTextureFile() { + return new ResourceLocation(packed.getIconName()); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java index a067dae815..9860ec1c41 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java @@ -78,6 +78,7 @@ public class BW_Blocks extends Block { } @Override + @SideOnly(Side.CLIENT) public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) { for (int i = 0; i < textureNames.length; i++) { list.add(new ItemStack(item, 1, i)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index b9d59c2294..34dc223140 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -22,20 +22,33 @@ package com.github.bartimaeusnek.bartworks.common.blocks; +import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; +import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; +import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import ic2.api.tile.IWrenchable; import ic2.core.IC2; import ic2.core.IHasGui; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.fluids.IFluidContainerItem; -public class BW_TileEntityContainer extends BlockContainer { +public class BW_TileEntityContainer extends BlockContainer implements ITileAddsInformation { Class tileEntity = null; @@ -52,13 +65,24 @@ public class BW_TileEntityContainer extends BlockContainer { if (worldObj.isRemote) { return true; } + final TileEntity tile = worldObj.getTileEntity(x, y, z); + if (tile instanceof BW_TileEntity_HeatedWaterPump) { + if (player.getHeldItem() != null && (player.getHeldItem().getItem().equals(Items.bucket) || player.getHeldItem().getItem() instanceof IFluidContainerItem) && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false) != null) + if (player.getHeldItem().getItem().equals(Items.bucket)) { + player.getHeldItem().stackSize--; + if (player.getHeldItem().stackSize <= 0) + player.inventory.setInventorySlotContents(player.inventory.currentItem, null); + player.inventory.addItemStackToInventory(new ItemStack(Items.water_bucket)); + return true; + } + } if (!player.isSneaking()) { - final TileEntity tile = worldObj.getTileEntity(x, y, z); if (tile instanceof IHasGui) { return worldObj.isRemote || IC2.platform.launchGui(player, (IHasGui) tile); + } else if (tile instanceof ITileWithGUI) { + return worldObj.isRemote || ((ITileWithGUI) tile).openGUI(tile, player); } } - return false; } @@ -89,6 +113,33 @@ public class BW_TileEntityContainer extends BlockContainer { } } + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + if (ITileHasDifferentTextureSides.class.isAssignableFrom(this.tileEntity)) { + try { + return ((ITileHasDifferentTextureSides) this.tileEntity.newInstance()).getTextureForSide(side, meta); + } catch (InstantiationException | IllegalAccessException e) { + e.printStackTrace(); + return super.getIcon(side, meta); + } + } else + return super.getIcon(side, meta); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) { + if (ITileHasDifferentTextureSides.class.isAssignableFrom(this.tileEntity)) { + try { + ((ITileHasDifferentTextureSides) this.tileEntity.newInstance()).registerBlockIcons(par1IconRegister); + } catch (InstantiationException | IllegalAccessException e) { + e.printStackTrace(); + } + } else + super.registerBlockIcons(par1IconRegister); + } + @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { try { @@ -99,4 +150,30 @@ public class BW_TileEntityContainer extends BlockContainer { return null; } + @Override + public boolean canBeReplacedByLeaves(IBlockAccess world, int x, int y, int z) { + return false; + } + + @Override + public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) { + return false; + } + + @Override + public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { + return false; + } + + @Override + public String[] getInfoData() { + if (ITileAddsInformation.class.isAssignableFrom(this.tileEntity)) { + try { + return ((ITileAddsInformation) this.tileEntity.newInstance()).getInfoData(); + } catch (InstantiationException | IllegalAccessException e) { + e.printStackTrace(); + } + } + return new String[0]; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java new file mode 100644 index 0000000000..112d57de9b --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.blocks; + +import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; +import com.github.bartimaeusnek.bartworks.MainMod; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.tile.IWrenchable; +import ic2.core.IC2; +import ic2.core.IHasGui; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import java.util.List; + +public class BW_TileEntityContainer_Multiple extends BlockContainer { + + final protected String[] textureNames; + final protected String name; + final Class[] tileEntityArray; + @SideOnly(Side.CLIENT) + protected IIcon[] texture; + + public BW_TileEntityContainer_Multiple(Material p_i45386_1_, Class[] tileEntity, String blockName, String[] textureNames, CreativeTabs tabs) { + super(p_i45386_1_); + this.setHardness(15.0F); + this.setResistance(30.0F); + tileEntityArray = tileEntity; + name = blockName; + this.textureNames = textureNames; + this.setCreativeTab(tabs); + this.setBlockName(blockName); + this.setBlockTextureName(MainMod.MOD_ID + ":" + blockName); + } + + @Override + public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (worldObj.isRemote) { + return true; + } + if (!player.isSneaking()) { + final TileEntity tile = worldObj.getTileEntity(x, y, z); + if (tile instanceof IHasGui) { + return worldObj.isRemote || IC2.platform.launchGui(player, (IHasGui) tile); + } else if (tile instanceof ITileWithGUI) { + return worldObj.isRemote || ((ITileWithGUI) tile).openGUI(tile, player); + } + } + + return false; + } + + public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack itemStack) { + final TileEntity tile = world.getTileEntity(x, y, z); + if (tile instanceof IWrenchable && itemStack != null) { + final IWrenchable tile2 = (IWrenchable) tile; + int meta = itemStack.getItemDamage(); + world.setBlockMetadataWithNotify(x, y, z, meta, 2); + if (entity != null) { + final int face = MathHelper.floor_double(entity.rotationYaw * 4.0f / 360.0f + 0.5) & 0x3; + switch (face) { + case 0: + tile2.setFacing((short) 2); + break; + case 1: + tile2.setFacing((short) 5); + break; + case 2: + tile2.setFacing((short) 3); + break; + case 3: + tile2.setFacing((short) 4); + break; + } + } + } + } + + @Override + public int damageDropped(final int meta) { + return meta; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) { + for (int i = 0; i < textureNames.length; i++) { + list.add(new ItemStack(item, 1, i)); + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + return meta < texture.length ? texture[meta] : texture[0]; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) { + texture = new IIcon[textureNames.length]; + for (int i = 0; i < textureNames.length; i++) { + texture[i] = par1IconRegister.registerIcon(textureNames[i]); + } + } + + @Override + public boolean canBeReplacedByLeaves(IBlockAccess world, int x, int y, int z) { + return false; + } + + @Override + public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) { + return false; + } + + @Override + public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { + return false; + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + try { + return this.tileEntityArray[p_149915_2_].newInstance(); + } catch (InstantiationException | IllegalAccessException e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 01af8ef53f..cf5e0aab78 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -41,6 +41,7 @@ public class ConfigHandler { public static Configuration c; public static boolean DEHPDirectSteam = false; public static int megaMachinesMax = 256; + public static int mbWaterperSec = 150; private static boolean ezmode = false; public ConfigHandler(@Nonnull FMLPreInitializationEvent e) { @@ -55,6 +56,7 @@ public class ConfigHandler { BioLab = !c.get("System", "Disable BioLab", false, "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!").getBoolean(false); DEHPDirectSteam = c.get("Multiblocks", "DEHP Direct Steam Mode", false, "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant").getBoolean(false); megaMachinesMax = c.get("Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256); + mbWaterperSec = c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150).getInt(150); if (ConfigHandler.IDOffset == 0) { ConfigHandler.IDOffset = 12600; c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index 1b631cc5fe..8386ebb857 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.common.items; +import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -31,6 +32,7 @@ import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_LanguageManager; import net.minecraft.block.Block; +import net.minecraft.block.ITileEntityProvider; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; @@ -65,8 +67,14 @@ public class BW_ItemBlocks extends ItemBlock { public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { if (this.field_150939_a instanceof BW_GlasBlocks) aList.add("Glass-Tier: " + BW_Util.getColorForTier(BW_Util.getTierFromGlasMeta(aStack.getItemDamage())) + GT_Values.VN[BW_Util.getTierFromGlasMeta(aStack.getItemDamage())]); + if (this.field_150939_a instanceof ITileAddsInformation) { + for (int i = 0; i < ((ITileAddsInformation) this.field_150939_a).getInfoData().length; i++) { + aList.add(((ITileAddsInformation) this.field_150939_a).getInfoData()[i]); + } + } aList.add(this.mNoMobsToolTip); - aList.add(this.mNoTileEntityToolTip); + if (!(this.field_150939_a instanceof ITileEntityProvider)) + aList.add(this.mNoTileEntityToolTip); aList.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 169655c4a5..09e4d6be98 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -29,6 +29,7 @@ import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.items.*; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_DEHP; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaBlastFurnace; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; @@ -67,6 +68,8 @@ public class ItemRegistry { public static final Item CRAFTING_PARTS = new SimpleSubItemClass(new String[]{"grindstone_top", "grindstone_bottom", "completed_grindstone", "rotors/leatherParts", "rotors/woolParts", "rotors/paperParts", "rotors/combinedParts"}); public static final Item TAB = new SimpleIconItem("GT2Coin"); public static final Item WINDMETER = new BW_SimpleWindMeter(); + public static final Block PUMPBLOCK = new BW_TileEntityContainer(Material.anvil, BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPump"); + public static final Item PUMPPARTS = new SimpleSubItemClass(new String[]{"BWrawtube", "BWmotor"}); public static final Block[] bw_glasses = { new BW_GlasBlocks( @@ -136,7 +139,10 @@ public class ItemRegistry { GameRegistry.registerItem(COMBINED_ROTOR, "BW_CombinedRotor"); GameRegistry.registerItem(CRAFTING_PARTS, "craftingParts"); GameRegistry.registerTileEntity(BW_RotorBlock.class, "BWRotorBlockTE"); - GameRegistry.registerBlock(ROTORBLOCK, "BWRotorBlock"); + GameRegistry.registerBlock(ROTORBLOCK, BW_ItemBlocks.class, "BWRotorBlock"); + GameRegistry.registerTileEntity(BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPumpTE"); + GameRegistry.registerBlock(PUMPBLOCK, BW_ItemBlocks.class, "BWHeatedWaterPumpBlock"); + GameRegistry.registerItem(PUMPPARTS, "BWPumpParts"); GameRegistry.registerItem(WINDMETER, "BW_SimpleWindMeter"); for (int i = 0; i < GT_Values.VN.length; i++) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 6a40941703..c381b92587 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -33,6 +33,7 @@ import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import ic2.core.Ic2Items; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -181,6 +182,42 @@ public class RecipeLoader implements Runnable { }); if (newStuff) { + + GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.PUMPPARTS, 1, 0),//tube + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{ + " fG", + " G ", + "G ", + 'G', ItemList.Circuit_Parts_Glass_Tube.get(1L) + } + ); + GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.PUMPPARTS, 1, 1),//motor + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{ + "GLP", + "LSd", + "PfT", + 'G', GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.Steel, 1L), + 'L', GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Steel, 1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 1L), + 'P', new ItemStack(Blocks.piston), + 'T', new ItemStack(ItemRegistry.PUMPPARTS, 1, 0) + } + ); + GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.PUMPBLOCK, 1, 0), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{ + "IPI", + "PMP", + "ISI", + 'I', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Wood, 1L), + 'M', new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), + 'S', Ic2Items.ironFurnace + } + ); + if (!MainMod.GTNH) GT_ModHandler.addCraftingRecipe( ItemRegistry.dehp, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java new file mode 100644 index 0000000000..ed4fe3ce78 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.classic; + +import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; +import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; +import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.*; + +public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ISidedInventory, IFluidHandler, IFluidTank, ITileWithGUI, ITileAddsInformation, ITileHasDifferentTextureSides { + + public static final int FUELSLOT = 0; + public static final Fluid WATER = FluidRegistry.WATER; + public ItemStack fuelstack; + public FluidStack outputstack = new FluidStack(FluidRegistry.WATER, 0); + public int fuel = 0; + public byte tick = 0; + public int maxfuel = 0; + public ItemStack fakestack = new ItemStack(Blocks.water); + + @Override + public void writeToNBT(NBTTagCompound p_145841_1_) { + NBTTagCompound subItemStack = new NBTTagCompound(); + if (fuelstack == null) + p_145841_1_.setTag("ItemStack", subItemStack); + else { + fuelstack.writeToNBT(subItemStack); + p_145841_1_.setTag("ItemStack", subItemStack); + } + NBTTagCompound subFluidStack = new NBTTagCompound(); + outputstack.writeToNBT(subFluidStack); + p_145841_1_.setTag("FluidStack", subFluidStack); + p_145841_1_.setInteger("fuel", fuel); + p_145841_1_.setInteger("maxfuel", maxfuel); + p_145841_1_.setByte("tick", tick); + super.writeToNBT(p_145841_1_); + } + + @Override + public void readFromNBT(NBTTagCompound p_145839_1_) { + tick = p_145839_1_.getByte("tick"); + fuel = p_145839_1_.getInteger("fuel"); + maxfuel = p_145839_1_.getInteger("maxfuel"); + outputstack = FluidStack.loadFluidStackFromNBT(p_145839_1_.getCompoundTag("FluidStack")); + if (!p_145839_1_.getCompoundTag("ItemStack").equals(new NBTTagCompound())) + fuelstack = ItemStack.loadItemStackFromNBT(p_145839_1_.getCompoundTag("ItemStack")); + super.readFromNBT(p_145839_1_); + } + + @Override + public void updateEntity() { + if (worldObj.isRemote || ((fuelstack == null || fuelstack.stackSize <= 0) && fuel <= 0) || (tick == 0 && worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) == Blocks.air)) { + return; + } + + if (fuel < 0) + fuel = 0; + + if (fuelstack != null && fuel == 0) { + fuel = maxfuel = TileEntityFurnace.getItemBurnTime(fuelstack); + --fuelstack.stackSize; + if (this.fuelstack.stackSize <= 0) + this.fuelstack = null; + } + + if (fuel > 0) { + ++tick; + --fuel; + if (tick % 20 == 0) { + if (outputstack.amount <= (8000 - ConfigHandler.mbWaterperSec)) + outputstack.amount += ConfigHandler.mbWaterperSec; + tick = 0; + } + } + } + + @Override + public int[] getAccessibleSlotsFromSide(int side) { + return new int[]{0}; + } + + @Override + public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) { + return TileEntityFurnace.getItemBurnTime(p_102007_2_) > 0; + } + + @Override + public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) { + return false; + } + + @Override + public int getSizeInventory() { + return 2; + } + + @Override + public ItemStack getStackInSlot(int p_70301_1_) { + if (p_70301_1_ == 0) + return fuelstack; + else + return fakestack; + } + + @Override + public ItemStack decrStackSize(int slot, int ammount) { + if (slot != FUELSLOT || fuelstack == null || ammount > fuelstack.stackSize) + return null; + + return fuelstack.splitStack(ammount); + } + + @Override + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + return null; + } + + @Override + public void setInventorySlotContents(int slot, ItemStack p_70299_2_) { + if (slot == FUELSLOT) + fuelstack = p_70299_2_; + else + fakestack = p_70299_2_; + } + + @Override + public String getInventoryName() { + return null; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return 64; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return true; + } + + @Override + public void openInventory() { + } + + @Override + public void closeInventory() { + + } + + @Override + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return TileEntityFurnace.getItemBurnTime(p_94041_2_) > 0 && p_94041_1_ == FUELSLOT; + } + + @Override + public FluidStack getFluid() { + return outputstack.amount > 0 ? outputstack : null; + } + + @Override + public int getFluidAmount() { + return outputstack.amount; + } + + @Override + public int getCapacity() { + return 8000; + } + + @Override + public FluidTankInfo getInfo() { + return new FluidTankInfo(this); + } + + @Override + public int fill(FluidStack resource, boolean doFill) { + return 0; + } + + @Override + public FluidStack drain(int maxDrain, boolean doDrain) { + int actualdrain = maxDrain; + if (actualdrain > outputstack.amount) + actualdrain = outputstack.amount; + FluidStack ret = new FluidStack(WATER, actualdrain); + if (ret.amount == 0) + ret = null; + if (doDrain) { + outputstack.amount -= actualdrain; + FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(outputstack, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this, actualdrain)); + } + return ret; + } + + @Override + public int getGUIID() { + return 3; + } + + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { + return 0; + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { + if (resource != null && resource.getFluid() == WATER && drain(resource.amount, false) != null) + return drain(resource.amount, doDrain); + return null; + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { + return drain(maxDrain, doDrain); + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) { + return false; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) { + return fluid == null || fluid == WATER; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) { + return new FluidTankInfo[]{getInfo()}; + } + + @Override + public String[] getInfoData() { + return new String[]{"Produces " + ConfigHandler.mbWaterperSec + "L/s Water when fueled.", "Must be placed on the Ground."}; + } + + @Override + public void registerBlockIcons(IIconRegister par1IconRegister) { + texture[ForgeDirection.UP.ordinal()] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpTop"); + texture[ForgeDirection.DOWN.ordinal()] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpDown"); + for (int i = 2; i < 7; i++) { + texture[i] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpSide"); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index 0d51cb828b..3c4e1c73a7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -52,6 +52,10 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + + if (this.getBaseMetaTileEntity().getWorld().isRemote) + return; + --aAmps; if (aAmps < 0) aAmps = maxAmps; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java new file mode 100644 index 0000000000..a3b951b34e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.server.container; + +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.gui.GT_Slot_Render; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +import java.nio.ByteBuffer; +import java.util.Iterator; + +public class BW_Container_HeatedWaterPump extends Container { + + final BW_TileEntity_HeatedWaterPump TILE; + final IInventory INVENTORY; + public int fuel, water, awater, maxfuel; + long timer = 0; + byte[] anetfuel, netfuel, anetmaxfuel, netmaxfuel; + + public BW_Container_HeatedWaterPump(BW_TileEntity_HeatedWaterPump TILE, EntityPlayer INVENTORY) { + this.TILE = TILE; + this.INVENTORY = INVENTORY.inventory; + + this.addSlotToContainer(new Slot(TILE, 0, 56, 53)); + this.addSlotToContainer(new GT_Slot_Render(TILE, 1, 86, 33)); + int i; + + for (i = 0; i < 3; ++i) { + for (int j = 0; j < 9; ++j) { + this.addSlotToContainer(new Slot(this.INVENTORY, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) { + this.addSlotToContainer(new Slot(this.INVENTORY, i, 8 + i * 18, 142)); + } + } + + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return true; + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + return null; + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (TILE.getWorldObj().isRemote) + return; + + fuel = this.TILE.fuel; + maxfuel = this.TILE.maxfuel; + water = this.TILE.outputstack.amount; + netfuel = ByteBuffer.allocate(8).putInt(fuel).array(); + netmaxfuel = ByteBuffer.allocate(8).putInt(maxfuel).array(); + ++timer; + Iterator var2 = this.crafters.iterator(); + if (timer >= Long.MAX_VALUE - 1) + timer = 0; + while (true) { + do { + if (!var2.hasNext()) { + netfuel = anetfuel; + netmaxfuel = anetmaxfuel; + water = awater; + return; + } + ICrafting var1 = (ICrafting) var2.next(); + if (this.timer % 500 == 10 || this.water != awater) + var1.sendProgressBarUpdate(this, 0, water); + if (this.timer % 500 == 10 || netfuel != anetfuel) + for (int i = 0; i < netfuel.length; i++) { + var1.sendProgressBarUpdate(this, i + 1, netfuel[i]); + } + if (this.timer % 500 == 10 || netmaxfuel != anetmaxfuel) + for (int i = 0; i < netmaxfuel.length; i++) { + var1.sendProgressBarUpdate(this, i + 9, netmaxfuel[i]); + } + } while (this.timer % 500 != 10 && this.water != awater); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int packetID, int valure) { + if (netfuel == null) + netfuel = new byte[8]; + if (netmaxfuel == null) + netmaxfuel = new byte[8]; + switch (packetID) { + case 0: { + water = valure; + this.getSlot(1).putStack(this.getSlot(1).getStack().setStackDisplayName(this.water + "L Water")); + break; + } + case 1: + netfuel[0] = (byte) valure; + break; + case 2: + netfuel[1] = (byte) valure; + break; + case 3: + netfuel[2] = (byte) valure; + break; + case 4: + netfuel[3] = (byte) valure; + break; + case 5: + netfuel[4] = (byte) valure; + break; + case 6: + netfuel[5] = (byte) valure; + break; + case 7: + netfuel[6] = (byte) valure; + break; + case 8: + netfuel[7] = (byte) valure; + break; + case 9: + netmaxfuel[0] = (byte) valure; + break; + case 10: + netmaxfuel[1] = (byte) valure; + break; + case 11: + netmaxfuel[2] = (byte) valure; + break; + case 12: + netmaxfuel[3] = (byte) valure; + break; + case 13: + netmaxfuel[4] = (byte) valure; + break; + case 14: + netmaxfuel[5] = (byte) valure; + break; + case 15: + netmaxfuel[6] = (byte) valure; + break; + case 16: + netmaxfuel[7] = (byte) valure; + break; + default: + break; + } + if (packetID > 0 && packetID < 9) + this.fuel = ByteBuffer.wrap(netfuel).getInt(); + if (packetID > 8 && packetID < 17) + this.maxfuel = ByteBuffer.wrap(netmaxfuel).getInt(); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 0dec15b274..cba13261d0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -329,6 +329,12 @@ public class BWRecipes { return false; } + public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { + if (sBiolab.addRecipe(new BioLabRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, new FluidStack[]{aFluidInputs}, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null) + return true; + return false; + } + @Deprecated public boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { if (sBiolab.addRecipe(new BioLabRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[0], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 5027760ab7..1392184d13 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -259,7 +259,7 @@ public class BW_Util { } public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, int aBaseCasingIndex) { - return check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, freeCorners, true, block, dmg, true, aBaseCasingIndex); + return check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, freeCorners, false, block, dmg, true, aBaseCasingIndex); } public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean insideCheck, Block inside, int dmginside, int aBaseCasingIndex) { diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index f81f0a533b..08a31baa75 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -14,7 +14,7 @@ item.BW_PaperRotor.name=Primitive Paper Rotor (Wind only) item.BW_LeatherRotor.name=Primitive Leather Rotor (Wind only) item.BW_WoolRotor.name=Primitive Wool Rotor (Wind only) item.BW_CombinedRotor.name=Combined Primitive Rotor (Wind only) -tile.BWRotorBlock.name=Primitive Kinetic Shaftbox +tile.BWRotorBlock.0.name=Primitive Kinetic Shaftbox item.grindstone_top.name=Grindstone Top Piece item.grindstone_bottom.name=Grindstone Bottom Piece item.completed_grindstone.name=Grindstone @@ -23,6 +23,10 @@ item.rotors.woolParts.name=Wool Covered Wood Frame item.rotors.paperParts.name=Paper Covered Wood Frame item.rotors.combinedParts.name=Multiple Material Covered Wood Frame item.BW_SimpleWindMeter.name=Simple Wind Meter +tile.BWHeatedWaterPump.0.name=Simple Stirling Water Pump +item.BWrawtube.name=Elongated Glas Tube +item.BWmotor.name=Simple Stirling Motor +item.BWstove.name=Simple Heated Stove itemGroup.BioTab=BartWorks BioEngineering filled.item.petriDish.name=Petri Dish with a Culture diff --git a/src/main/resources/assets/bartworks/textures/GUI/GUIheatedPump.png b/src/main/resources/assets/bartworks/textures/GUI/GUIheatedPump.png new file mode 100644 index 0000000000..f9f82a19c3 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/GUIheatedPump.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpDown.png b/src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpDown.png new file mode 100644 index 0000000000..6fd2b79d13 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpDown.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpSide.png b/src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpSide.png new file mode 100644 index 0000000000..4b8c71a8ae Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpSide.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpTop.png b/src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpTop.png new file mode 100644 index 0000000000..6fd2b79d13 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpTop.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/BWmotor.png b/src/main/resources/assets/bartworks/textures/items/BWmotor.png new file mode 100644 index 0000000000..c701227af2 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/BWmotor.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/BWrawtube.png b/src/main/resources/assets/bartworks/textures/items/BWrawtube.png new file mode 100644 index 0000000000..ab3dd4a2bd Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/BWrawtube.png differ -- cgit From fbe6e4517593ba72f5e705fe2db288735a23ce30 Mon Sep 17 00:00:00 2001 From: ImgBotApp Date: Thu, 7 Feb 2019 05:10:57 +0000 Subject: [ImgBot] Optimize images *Total -- 3.00kb -> 1.67kb (44.28%) /src/main/resources/assets/bartworks/textures/GUI/GUIheatedPump.png -- 2.03kb -> 0.75kb (63.23%) /src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpTop.png -- 0.48kb -> 0.46kb (4.64%) /src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpDown.png -- 0.48kb -> 0.46kb (4.64%) Former-commit-id: bd0b7db55ff6a223a6f511e277c8ec9d3c3fd875 --- .../assets/bartworks/textures/GUI/GUIheatedPump.png | Bin 2075 -> 763 bytes .../bartworks/textures/blocks/heatedWaterPumpDown.png | Bin 496 -> 473 bytes .../bartworks/textures/blocks/heatedWaterPumpTop.png | Bin 496 -> 473 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/main/resources/assets/bartworks/textures/GUI/GUIheatedPump.png b/src/main/resources/assets/bartworks/textures/GUI/GUIheatedPump.png index f9f82a19c3..62deeffa50 100644 Binary files a/src/main/resources/assets/bartworks/textures/GUI/GUIheatedPump.png and b/src/main/resources/assets/bartworks/textures/GUI/GUIheatedPump.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpDown.png b/src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpDown.png index 6fd2b79d13..91bcf79e1f 100644 Binary files a/src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpDown.png and b/src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpDown.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpTop.png b/src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpTop.png index 6fd2b79d13..91bcf79e1f 100644 Binary files a/src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpTop.png and b/src/main/resources/assets/bartworks/textures/blocks/heatedWaterPumpTop.png differ -- cgit From 273c5a96dddbd4862c7f97d55e5145ae4e3d2628 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 12 Feb 2019 01:16:39 +0100 Subject: fixes added soft dependencies, fixed stirling generator not consuming liquid when bucketed, fixed empty recipe when Crops++ is installed, fixed DEHP crash when GTNH is installed fixed DEHP not automatically starting when reaching the ground version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 2cca15cbc1be86cdbd9175a3094fda4fcc984d37 --- .gitignore | 3 ++- build.properties | 4 ++-- .../java/com/github/bartimaeusnek/bartworks/MainMod.java | 3 +++ .../bartworks/common/blocks/BW_TileEntityContainer.java | 3 ++- .../bartworks/common/loaders/BioRecipeLoader.java | 2 +- .../common/tileentities/multis/GT_TileEntity_DEHP.java | 16 ++++++++++++++-- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 3f30d148b0..2963c6d257 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,5 @@ hs_err_pid* /build /out /.gradle -/venv \ No newline at end of file +/venv +/libs \ No newline at end of file diff --git a/build.properties b/build.properties index cda875cf39..73a08cc9c0 100644 --- a/build.properties +++ b/build.properties @@ -23,8 +23,8 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=3 -buildNumber=19 +buildNumber=20 APIVersion=3 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 -gregtech.jenkinsbuild=143 +gregtech.jenkinsbuild=143 \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 1d48b16f2e..f8206768bb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -51,6 +51,9 @@ import org.apache.logging.log4j.Logger; modid = MainMod.MOD_ID, name = MainMod.NAME, version = MainMod.VERSION, dependencies = "required-after:IC2; " + "required-after:gregtech; " + + "after:berriespp;" + + "after:dreamcraft;" + + "after:miscutils;" ) public final class MainMod { public static final String NAME = "BartWorks"; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index 34dc223140..4944355722 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -68,7 +68,8 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI final TileEntity tile = worldObj.getTileEntity(x, y, z); if (tile instanceof BW_TileEntity_HeatedWaterPump) { if (player.getHeldItem() != null && (player.getHeldItem().getItem().equals(Items.bucket) || player.getHeldItem().getItem() instanceof IFluidContainerItem) && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false) != null) - if (player.getHeldItem().getItem().equals(Items.bucket)) { + if (player.getHeldItem().getItem().equals(Items.bucket) && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false).amount == 1000) { + ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, true); player.getHeldItem().stackSize--; if (player.getHeldItem().stackSize <= 0) player.inventory.setInventorySlotContents(player.inventory.currentItem, null); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index 05c63ef0cb..0b827b27a0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -316,7 +316,7 @@ public class BioRecipeLoader extends RecipeLoader { new ItemStack[]{new ItemStack(Items.sugar, 64)}, new FluidStack[]{new FluidStack(fluidStack, 100)}, BioCulture.BIO_CULTURE_ARRAY_LIST.get(1), - new FluidStack[]{(Loader.isModLoaded("berriespp") ? FluidRegistry.getFluidStack("potion.GHP", 1) : Materials.Ethanol.getFluid(1L))}, + new FluidStack[]{(Loader.isModLoaded("berriespp") ? FluidRegistry.getFluidStack("potion.ghp", 1) : Materials.Ethanol.getFluid(1L))}, 350, BW_Util.getMachineVoltageFromTier(4) ); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index 0a69480775..cb582e8e5d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -155,6 +155,11 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { if (mMode != 3) { this.isPickingPipes = false; + try { + Field workState = this.getClass().getField("workState"); + workState.setInt(this, 0); + } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException e) { + } return true; } return super.workingUpward(aStack, xDrill, yDrill, zDrill, xPipe, zPipe, yHead, oldYHead); @@ -162,6 +167,8 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (this.getBaseMetaTileEntity().getWorld().isRemote) + return; ++mMode; if (mMode >= 4) mMode = 0; @@ -172,6 +179,11 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { if (mMode == 3) { this.isPickingPipes = true; + try { + Field workState = this.getClass().getSuperclass().getDeclaredField("workState"); + workState.setInt(this, 2); + } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException e) { + } return true; } @@ -179,6 +191,8 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { if (this.waitForPipes()) { return false; } else { + if (mMode == 0) + mMode = 1; if (ConfigHandler.DEHPDirectSteam) { if (mMode == 1) { long steamProduced = (mTier * 600 * 2L * this.mEfficiency / 10000L); @@ -223,8 +237,6 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { } private boolean consumeFluid(Fluid fluid, long ammount) { - - if (ammount > Integer.MAX_VALUE) { int[] tmp = new int[(int) (ammount / Integer.MAX_VALUE)]; Arrays.fill(tmp, (int) (ammount / Integer.MAX_VALUE)); -- cgit From ca041aee35b27c3a89d526d30c14ae24595a8761 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 15 Feb 2019 21:01:47 +0100 Subject: fixes diode issues with crafted diodes + added first work on the Infinity Tank Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: c9a4d59ff4f2513b086737b7b10778dd170450ce --- .../gui/BW_GUIContainer_HeatedWaterPump.java | 2 +- .../bartworks/common/loaders/ItemRegistry.java | 10 +- .../classic/BW_TileEntity_InfinityTank.java | 169 +++++++++++++++++++++ .../tiered/GT_MetaTileEntity_Diode.java | 39 +++-- 4 files changed, 205 insertions(+), 15 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java index b8cd2e9799..c252d5f935 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java @@ -45,7 +45,7 @@ public class BW_GUIContainer_HeatedWaterPump extends GuiContainer { int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - this.drawString(this.fontRendererObj, "Fuel:" + container.fuel + " Water:" + container.water, k, l, 0xffffff); +// this.drawString(this.fontRendererObj, "Fuel:" + container.fuel + " Water:" + container.water, k, l, 0xffffff); if (this.container.fuel > 0) { this.mc.getTextureManager().bindTexture(furnaceGuiTextures); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 09e4d6be98..5cf42736b6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -146,11 +146,11 @@ public class ItemRegistry { GameRegistry.registerItem(WINDMETER, "BW_SimpleWindMeter"); for (int i = 0; i < GT_Values.VN.length; i++) { - ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "Cable Diode 2A " + GT_Values.VN[i], "Cable Diode 2A " + GT_Values.VN[i], i, 2).getStackForm(1L); - ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "Cable Diode 4A " + GT_Values.VN[i], "Cable Diode 4A " + GT_Values.VN[i], i, 4).getStackForm(1L); - ItemRegistry.diode8A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, "Cable Diode 8A " + GT_Values.VN[i], "Cable Diode 8A " + GT_Values.VN[i], i, 8).getStackForm(1L); - ItemRegistry.diode12A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, "Cable Diode 12A " + GT_Values.VN[i], "Cable Diode 12A " + GT_Values.VN[i], i, 12).getStackForm(1L); - ItemRegistry.diode16A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, "Cable Diode 16A " + GT_Values.VN[i], "Cable Diode 16A " + GT_Values.VN[i], i, 16).getStackForm(1L); + ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "Cable Diode 2A " + GT_Values.VN[i], "Cable Diode 2A " + GT_Values.VN[i], i).getStackForm(1L); + ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "Cable Diode 4A " + GT_Values.VN[i], "Cable Diode 4A " + GT_Values.VN[i], i).getStackForm(1L); + ItemRegistry.diode8A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, "Cable Diode 8A " + GT_Values.VN[i], "Cable Diode 8A " + GT_Values.VN[i], i).getStackForm(1L); + ItemRegistry.diode12A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, "Cable Diode 12A " + GT_Values.VN[i], "Cable Diode 12A " + GT_Values.VN[i], i).getStackForm(1L); + ItemRegistry.diode16A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, "Cable Diode 16A " + GT_Values.VN[i], "Cable Diode 16A " + GT_Values.VN[i], i).getStackForm(1L); ItemRegistry.energyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset + 1 + i, "Energy Distributor " + GT_Values.VN[i], "Energy Distributor " + GT_Values.VN[i], i, "Splits Amperage into several Sides").getStackForm(1L); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java new file mode 100644 index 0000000000..79ac59f5c1 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.classic; + +import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; +import gregtech.api.util.GT_Utility; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.*; + +import java.util.ArrayList; +import java.util.HashSet; + +public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank, IFluidHandler, ITileWithGUI { + + final ArrayList INTERNALTANKS =new ArrayList(); + + int selectedTank; + + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { + return fill(resource, doFill); + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { + return drain(from,resource != null ? resource.amount : 0,doDrain); + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { + return drain(maxDrain,doDrain); + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) { + return true; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) { + HashSet ret = new HashSet(); + for (FluidStack stack : INTERNALTANKS) { + ret.add(GT_Utility.areFluidsEqual(stack, new FluidStack(fluid, 0))); + if (ret.contains(Boolean.TRUE)) + selectedTank = this.INTERNALTANKS.indexOf(stack); + } + return ret.contains(Boolean.TRUE); + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) { + return new FluidTankInfo[0]; + } + + @Override + public FluidStack getFluid() { + if (INTERNALTANKS.get(selectedTank) == null || INTERNALTANKS.get(selectedTank).amount == 0) + if (selectedTank>0) + selectedTank = this.INTERNALTANKS.size()-1; + return INTERNALTANKS.get(selectedTank); + } + + @Override + public int getFluidAmount() { + return INTERNALTANKS.get(selectedTank) != null ? INTERNALTANKS.get(selectedTank).amount : 0; + } + + @Override + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + + NBTTagList lInternalTank = new NBTTagList(); + + for (int i = 0; i < INTERNALTANKS.size(); i++) { + if (INTERNALTANKS.get(i) != null) { + NBTTagCompound entry = new NBTTagCompound(); + entry.setString("FluidName", INTERNALTANKS.get(i).getFluid().getName()); + entry.setInteger("Ammount", INTERNALTANKS.get(i).amount); + entry.setTag("FluidTag", INTERNALTANKS.get(i).tag); + lInternalTank.appendTag(entry); + } + } + p_145841_1_.setTag("InternalTank",lInternalTank); + } + + + + @Override + public int getCapacity() { + return Integer.MAX_VALUE; + } + + @Override + public FluidTankInfo getInfo() { + return null; + } + + @Override + public int fill(FluidStack resource, boolean doFill) { + if (worldObj.isRemote || resource == null || resource.amount == 0) + return 0; + + if (!doFill) + return resource.amount; + + int id = 0; + + if (canDrain(null,resource.getFluid())) { + for (FluidStack stack : INTERNALTANKS) + if (GT_Utility.areFluidsEqual(stack, resource)) { + this.INTERNALTANKS.get(id = this.INTERNALTANKS.indexOf(stack)).amount += resource.amount; + selectedTank = id; + } + } else { + this.INTERNALTANKS.add(resource); + id = this.INTERNALTANKS.size()-1; + selectedTank = id; + } + return this.INTERNALTANKS.get(id).amount; + } + + @Override + public FluidStack drain(int maxDrain, boolean doDrain) { + + FluidStack outputstack = INTERNALTANKS.get(selectedTank); + if (worldObj.isRemote || maxDrain == 0 || this.getFluid() == null || outputstack == null) + return null; + + int actualdrain = maxDrain; + if (actualdrain > outputstack.amount) + actualdrain = outputstack.amount; + FluidStack ret = new FluidStack(outputstack.getFluid(), actualdrain); + if (ret.amount == 0) + ret = null; + if (doDrain) { + outputstack.amount -= actualdrain; + FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(outputstack, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this, actualdrain)); + } + return ret; + } + + @Override + public int getGUIID() { + return 4; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index 3c4e1c73a7..c0c99dab7a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.ITexture; @@ -34,19 +35,24 @@ import net.minecraft.nbt.NBTTagCompound; public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { - private long maxAmps; - private long aAmps; + private long maxAmps = 0L; + private long aAmps = 0L; - public GT_MetaTileEntity_Diode(int aID, String aName, String aNameRegional, int aTier, int maxAmps) { + public GT_MetaTileEntity_Diode(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, "A Simple diode that will allow Energy Flow in only one direction."); - this.maxAmps = maxAmps; - aAmps = maxAmps; } - public GT_MetaTileEntity_Diode(String aName, int aTier, long maxAmps, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Diode(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); - this.maxAmps = maxAmps; - aAmps = maxAmps; + } + + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + super.onFirstTick(aBaseMetaTileEntity); + if (maxAmps == 0 && !this.getBaseMetaTileEntity().getWorld().isRemote) { + maxAmps = getAmpsfromMeta(this.getBaseMetaTileEntity().getMetaTileID()); + aAmps=maxAmps; + } } @Override @@ -88,7 +94,22 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Diode(this.mName, this.mTier, this.maxAmps, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_Diode(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + + private long getAmpsfromMeta(int meta){ + if (meta > ConfigHandler.IDOffset + GT_Values.VN.length && meta <= ConfigHandler.IDOffset + GT_Values.VN.length*2) + return 2L; + else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length*2 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length*3) + return 4L; + else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length*3 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length*4) + return 8L; + else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length*4 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length*5) + return 12L; + else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length*5 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length*6) + return 16L; + else + return 0L; } @SuppressWarnings("deprecation") -- cgit From 145c36f7579ccc4dc479d577f83e83b88b3f2fc1 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 16 Feb 2019 07:47:35 +0100 Subject: Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: c8ca119374548e0ac2819fd17b4c56e6e563a14f --- build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.properties b/build.properties index 73a08cc9c0..725d6c5b1d 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=3 -buildNumber=20 +buildNumber=21 APIVersion=3 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 -- cgit From 795e3c58afa8b6a794155439904ef26a6fbc963b Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Mon, 18 Feb 2019 22:26:21 +0800 Subject: Creat Chinese translation Former-commit-id: 60cb7fc217dbb94c6ebbb354fa2cf7b2a55d33ed --- .../resources/assets/bartworks/lang/zh_CN.lang | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/main/resources/assets/bartworks/lang/zh_CN.lang diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang new file mode 100644 index 0000000000..22ce79877f --- /dev/null +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -0,0 +1,58 @@ +itemGroup.GT2C=Gregtech 2兼容 +item.GT_Rockcutter_Item_LV.name=岩石切割者 LV +item.GT_Rockcutter_Item_MV.name=岩石切割者 MV +item.GT_Rockcutter_Item_HV.name=岩石切割者 HV +item.GT_Teslastaff_Item.name=特斯拉夫 +BW_ItemBlocks.0.name=蚀刻青金石电池 +BW_ItemBlocks.1.name=镀青金石电池 +GT_LESU_CASING.0.name=LESU框架 + +itemGroup.bartworks=BartWorks 跨时代 +BW_Machinery_Casings.0.name=镍锌铁氧体块 +BW_Machinery_Casings.1.name=变压器绕组块 +item.BW_PaperRotor.name=原始纸转子 (只有风) +item.BW_LeatherRotor.name=原始皮革转子 (只有风) +item.BW_WoolRotor.name=原始羊毛转子 (只有风) +item.BW_CombinedRotor.name=复合原始转子 (只有风) +tile.BWRotorBlock.0.name=原始动力学转轴箱 +item.grindstone_top.name=磨石顶部 +item.grindstone_bottom.name=磨石底部 +item.completed_grindstone.name=磨刀石 +item.rotors.leatherParts.name=皮革包木框架 +item.rotors.woolParts.name=羊毛包木框架 +item.rotors.paperParts.name=纸包木框架 +item.rotors.combinedParts.name=多材料包木框架 +item.BW_SimpleWindMeter.name=简易风速计 +tile.BWHeatedWaterPump.0.name=简易斯特林水泵 +item.BWrawtube.name=加长玻璃管 +item.BWmotor.name=简易斯特林电机 +item.BWstove.name=简易加热炉 + +itemGroup.BioTab=BartWorks 生物工程 +filled.item.petriDish.name=培养皿 +item.petriDish.name=无菌培养皿 +item.DNASampleFlask.name=DNA样品瓶 +item.PlasmidCell.name=质粒样品瓶 +item.DetergentPowder.name=洗衣粉 +item.Agarose.name=琼脂糖 +item.IncubationModule.name=孵化模块 +item.Cells.name=细菌细胞 +item.PlasmaMembrane.name=质膜 +labModule.item.DNAExtractionModule.name=DNA提取模块 +labModule.item.PCRThermoclyclingModule.name=PCR热电偶模块 +labModule.item.PlasmidSynthesisModule.name=质粒合成模块 +labModule.item.TransformationModule.name=转换模块 +labModule.item.ClonalCellularSynthesisModule.name=克隆细胞合成模块 +BW_GlasBlocks.0.name=硼硅酸盐玻璃块 +BW_GlasBlocks.1.name=镍加固硼硅酸盐玻璃块 +BW_GlasBlocks.2.name=钨加固硼硅酸盐玻璃块 +BW_GlasBlocks.3.name=铬加固硼硅酸盐玻璃块 +BW_GlasBlocks.4.name=铱加固硼硅酸盐玻璃块 +BW_GlasBlocks.5.name=锇加固硼硅酸盐玻璃块 +BW_GlasBlocks.6.name=染色的硼硅酸盐玻璃块(红) +BW_GlasBlocks.7.name=染色的硼硅酸盐玻璃块(绿) +BW_GlasBlocks.8.name=染色的硼硅酸盐玻璃块(紫) +BW_GlasBlocks.9.name=染色的硼硅酸盐玻璃块(黄) +BW_GlasBlocks.10.name=染色的硼硅酸盐玻璃块(黄绿) +BW_GlasBlocks.11.name=染色的硼硅酸盐玻璃块(棕) +//This zh_CN.lang is translation by huajijam for bartworks (18/2/19) \ No newline at end of file -- cgit From 799e376a4c422e15dd281765348129313e3dc123 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 18 Feb 2019 23:06:58 +0100 Subject: fixes and API update -fixed a bug where a circle dependency may exist -fixed a bug where Bacteria might be null -fixed a bug where the fallback might be wrong -fixed NBT issues with BioData -cleaned up NEI -fixed a bug where bacteria fluids might be null -optimised hashcodes to use murmur3 instead of Objects.hash Former-commit-id: a098d67778e16924b2f65e307f1b2be5131b4ce0 --- build.properties | 4 +- .../bartworks/API/BioObjectAdder.java | 59 +++++++-- .../bartworks/API/BioRecipeAdder.java | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 13 +- .../bartworks/common/loaders/BioCultureLoader.java | 3 - .../bartworks/common/loaders/BioLabLoader.java | 4 +- .../bartworks/common/loaders/BioRecipeLoader.java | 10 +- .../bartworks/common/loaders/FluidLoader.java | 2 +- .../bartworks/common/loaders/LoaderRegistry.java | 3 - .../tileentities/multis/GT_TileEntity_BioVat.java | 10 +- .../tiered/GT_MetaTileEntity_BioLab.java | 18 ++- .../bartworks/neiHandler/BW_NEI_BioLabHandler.java | 88 ++++++++++++++ .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 133 +++++++++++++++++++++ .../bartworks/neiHandler/NEI_BW_Config.java | 47 ++++++++ .../bartimaeusnek/bartworks/util/BWRecipes.java | 34 +++--- .../bartimaeusnek/bartworks/util/BioCulture.java | 33 +++-- .../bartimaeusnek/bartworks/util/BioDNA.java | 2 + .../bartimaeusnek/bartworks/util/BioData.java | 10 +- .../bartimaeusnek/bartworks/util/BioPlasmid.java | 3 + 19 files changed, 411 insertions(+), 67 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java diff --git a/build.properties b/build.properties index 725d6c5b1d..c2c1580cde 100644 --- a/build.properties +++ b/build.properties @@ -23,8 +23,8 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=3 -buildNumber=21 -APIVersion=3 +buildNumber=22 +APIVersion=4 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java index e0e332fab1..92600b5bfe 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -26,7 +26,9 @@ import com.github.bartimaeusnek.bartworks.util.BioCulture; import com.github.bartimaeusnek.bartworks.util.BioDNA; import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; +import gregtech.api.objects.GT_Fluid; import net.minecraft.item.EnumRarity; +import net.minecraftforge.fluids.FluidRegistry; import java.awt.*; @@ -47,7 +49,11 @@ public final class BioObjectAdder { * @return */ public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, EnumRarity rarity, boolean breedable) { - return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, rarity, breedable); + if (BioCulture.BIO_CULTURE_ARRAY_LIST.size() > 1) + return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, rarity, breedable); + else + new Exception("Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + return null; } /** @@ -61,7 +67,11 @@ public final class BioObjectAdder { * @return */ public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, boolean breedable) { - return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, breedable); + if (BioCulture.BIO_CULTURE_ARRAY_LIST.size() > 1) + return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, breedable); + else + new Exception("Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + return null; } /** @@ -74,7 +84,10 @@ public final class BioObjectAdder { * @return */ public static BioData createAndRegisterBioData(String aName, EnumRarity rarity, int chance, int tier) { - return BioData.createAndRegisterBioData(aName, rarity, chance, tier); + if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) + return BioData.createAndRegisterBioData(aName, rarity, chance, tier); + new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + return null; } /** @@ -85,7 +98,10 @@ public final class BioObjectAdder { * @return */ public static BioDNA createAndRegisterBioDNA(String aName, EnumRarity rarity) { - return BioDNA.createAndRegisterBioDNA(aName, rarity); + if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) + return BioDNA.createAndRegisterBioDNA(aName, rarity); + new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + return null; } /** @@ -96,7 +112,10 @@ public final class BioObjectAdder { * @return */ public static BioPlasmid createAndRegisterBioPlasmid(String aName, EnumRarity rarity) { - return BioPlasmid.createAndRegisterBioPlasmid(aName, rarity); + if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) + return BioPlasmid.createAndRegisterBioPlasmid(aName, rarity); + new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + return null; } /** @@ -107,7 +126,10 @@ public final class BioObjectAdder { * @return */ public static BioDNA createAndRegisterBioDNA(String aName, EnumRarity rarity, int chance, int tier) { - return BioDNA.createAndRegisterBioDNA(aName, rarity, chance, tier); + if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) + return BioDNA.createAndRegisterBioDNA(aName, rarity, chance, tier); + new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + return null; } /** @@ -118,8 +140,31 @@ public final class BioObjectAdder { * @return */ public static BioPlasmid createAndRegisterBioPlasmid(String aName, EnumRarity rarity, int chance, int tier) { - return BioPlasmid.createAndRegisterBioPlasmid(aName, rarity, chance, tier); + if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) + return BioPlasmid.createAndRegisterBioPlasmid(aName, rarity, chance, tier); + new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + return null; } + /** + * @param voltageTier (i.e. 6 for LuV, 7 for ZPM, only intresting for LuV+) + * @return the propper Bacteria Tier (at least 0) + */ + public static int getBacteriaTierFromVoltageTier(int voltageTier){ + return voltageTier-6 > 0 ? voltageTier-6 : 0; + } + + /** + * If you get NPE's related to BioCultures (most likely because of Load Order or creating BioCultures after the postinit Phase) execute this. + */ + public static void regenerateBioFluids(){ + for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { + if (B.getFluidNotSet()) { + B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()})); + if (!FluidRegistry.registerFluid(B.getFluid())) + new Exception("FAILED TO REGISTER FLUID FOR: "+B.getName()).printStackTrace(); + } + } + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java index feedb79761..0e40363356 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java @@ -37,7 +37,7 @@ public final class BioRecipeAdder { public static final int LOWGRAVITY = -100; public static final int CLEANROOM = -200; - public static boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + public static boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { return BWRecipes.instance.addBioLabRecipe(aInputs, aOutput, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index f8206768bb..e0384239ba 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -24,11 +24,14 @@ package com.github.bartimaeusnek.bartworks; import com.github.bartimaeusnek.bartworks.API.API_REFERENCE; +import com.github.bartimaeusnek.bartworks.API.BioObjectAdder; import com.github.bartimaeusnek.bartworks.client.ClientEventHandler.ClientEventHandler; import com.github.bartimaeusnek.bartworks.client.creativetabs.BioTab; import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader; import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; @@ -52,8 +55,6 @@ import org.apache.logging.log4j.Logger; dependencies = "required-after:IC2; " + "required-after:gregtech; " + "after:berriespp;" - + "after:dreamcraft;" - + "after:miscutils;" ) public final class MainMod { public static final String NAME = "BartWorks"; @@ -86,6 +87,11 @@ public final class MainMod { CHandler = new ConfigHandler(preinit); if (GTNH) LOGGER.info("GTNH-Detected . . . ACTIVATE HARDMODE."); + + if (ConfigHandler.BioLab) { + BioCultureLoader bioCultureLoader = new BioCultureLoader(); + bioCultureLoader.run(); + } } @Mod.EventHandler @@ -93,6 +99,8 @@ public final class MainMod { if (FMLCommonHandler.instance().getSide().isClient() && ConfigHandler.BioLab) MinecraftForge.EVENT_BUS.register(new ClientEventHandler()); new LoaderRegistry().run(); + if (ConfigHandler.BioLab) + new BioLabLoader().run(); } @Mod.EventHandler @@ -100,5 +108,6 @@ public final class MainMod { NetworkRegistry.INSTANCE.registerGuiHandler(instance, GH); if (ConfigHandler.BioLab) new GTNHBlocks().run(); + BioObjectAdder.regenerateBioFluids(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java index f8c228e507..78ff73554f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java @@ -34,8 +34,6 @@ import java.awt.*; public class BioCultureLoader implements Runnable { public static final BioData BIO_DATA_BETA_LACMATASE = BioData.createAndRegisterBioData("beta-Lactamase", EnumRarity.uncommon, 10000, 0); - private static final BioDNA NULLLDNA = BioDNA.createAndRegisterBioDNA("", EnumRarity.epic); - private static final BioPlasmid NULLPLASMID = BioPlasmid.createAndRegisterBioPlasmid("", EnumRarity.epic); private static final BioData BIO_DATA_YEAST = BioData.createAndRegisterBioData("Saccharomyces cerevisiae", EnumRarity.common); private static final BioDNA BIO_DNA_WHINE_YEAST = BioDNA.createAndRegisterBioDNA("Saccharomyces cerevisiae var bayanus", EnumRarity.uncommon); private static final BioDNA BIO_DNA_BEER_YEAST = BioDNA.createAndRegisterBioDNA("Saccharomyces cerevisiae var cerevisiae", EnumRarity.uncommon); @@ -48,7 +46,6 @@ public class BioCultureLoader implements Runnable { @Override public void run() { - BioCulture.createAndRegisterBioCulture(Color.BLUE, "", NULLPLASMID, NULLLDNA, false); //fallback NULL culture CommonYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae", BioPlasmid.convertDataToPlasmid(BIO_DATA_YEAST), BioDNA.convertDataToDNA(BIO_DATA_YEAST), true); WhineYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var bayanus", BioPlasmid.convertDataToPlasmid(BIO_DATA_YEAST), BIO_DNA_WHINE_YEAST, true); BeerYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var cerevisiae", BioPlasmid.convertDataToPlasmid(BIO_DATA_YEAST), BIO_DNA_BEER_YEAST, true); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java index 04221196ce..4f862ba6a9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java @@ -24,15 +24,13 @@ package com.github.bartimaeusnek.bartworks.common.loaders; public class BioLabLoader implements Runnable { - BioCultureLoader bioCultureLoader; + FluidLoader fluidLoader; BioItemList bioItemList; BioRecipeLoader bioRecipeLoader; @Override public void run() { - bioCultureLoader = new BioCultureLoader(); - bioCultureLoader.run(); fluidLoader = new FluidLoader(); fluidLoader.run(); bioItemList = new BioItemList(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index 0b827b27a0..c0480e2970 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -315,7 +315,7 @@ public class BioRecipeLoader extends RecipeLoader { BWRecipes.instance.addBacterialVatRecipe( new ItemStack[]{new ItemStack(Items.sugar, 64)}, new FluidStack[]{new FluidStack(fluidStack, 100)}, - BioCulture.BIO_CULTURE_ARRAY_LIST.get(1), + BioCultureLoader.CommonYeast, new FluidStack[]{(Loader.isModLoaded("berriespp") ? FluidRegistry.getFluidStack("potion.ghp", 1) : Materials.Ethanol.getFluid(1L))}, 350, BW_Util.getMachineVoltageFromTier(4) @@ -324,7 +324,7 @@ public class BioRecipeLoader extends RecipeLoader { BWRecipes.instance.addBacterialVatRecipe( new ItemStack[]{ItemList.Crop_Drop_Grapes.get(16)}, new FluidStack[]{new FluidStack(fluidStack, 100)}, - BioCulture.BIO_CULTURE_ARRAY_LIST.get(2), + BioCultureLoader.WhineYeast, new FluidStack[]{FluidRegistry.getFluidStack("potion.wine", 12)}, 200, BW_Util.getMachineVoltageFromTier(2) @@ -333,7 +333,7 @@ public class BioRecipeLoader extends RecipeLoader { BWRecipes.instance.addBacterialVatRecipe( new ItemStack[]{new ItemStack(Items.sugar, 4), ItemList.IC2_Hops.get(16L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 8L)}, new FluidStack[]{new FluidStack(fluidStack, 100)}, - BioCulture.BIO_CULTURE_ARRAY_LIST.get(3), + BioCultureLoader.BeerYeast, new FluidStack[]{FluidRegistry.getFluidStack("potion.beer", 5)}, 600, BW_Util.getMachineVoltageFromTier(1) @@ -341,7 +341,7 @@ public class BioRecipeLoader extends RecipeLoader { BWRecipes.instance.addBacterialVatRecipe( new ItemStack[]{ItemList.IC2_Hops.get(32L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 16L)}, new FluidStack[]{new FluidStack(fluidStack, 100)}, - BioCulture.BIO_CULTURE_ARRAY_LIST.get(3), + BioCultureLoader.BeerYeast, new FluidStack[]{FluidRegistry.getFluidStack("potion.darkbeer", 10)}, 600, BW_Util.getMachineVoltageFromTier(1) @@ -352,7 +352,7 @@ public class BioRecipeLoader extends RecipeLoader { BWRecipes.instance.addBacterialVatRecipe( null, new FluidStack[]{FluidRegistry.getFluidStack("potion.grapejuice", 100)}, - BioCulture.BIO_CULTURE_ARRAY_LIST.get(2), + BioCultureLoader.WhineYeast, new FluidStack[]{FluidRegistry.getFluidStack("potion.wine", 12)}, 400, BW_Util.getMachineVoltageFromTier(1) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 879578d24d..00bd28bde6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -70,7 +70,7 @@ public class FluidLoader implements Runnable { BioLabFluidCells[i] = ItemFluidCell.getUniversalFluidCell(new FluidStack(BioLabFluidMaterials[i], 1000)); } - BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", BW_Util.splitColortoArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB()))); +// BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", BW_Util.splitColortoArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB()))); for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.isBreedable()) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java index 7b21cfaef0..93a4fc75c8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java @@ -30,9 +30,6 @@ public class LoaderRegistry implements Runnable { public void run() { new ItemRegistry().run(); new RecipeLoader().run(); - if (ConfigHandler.BioLab) { - new BioLabLoader().run(); - } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 30ff2f4b07..41d8373602 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -89,7 +89,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { super(aName); } - private static int[] specialValueUnpack(int aSpecialValure) { + public static int[] specialValueUnpack(int aSpecialValure) { int[] ret = new int[4]; ret[0] = aSpecialValure & 0xF; // = glas tier ret[1] = aSpecialValure >>> 4 & 0b11; // = special valure @@ -389,7 +389,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId)); - staticColorMap.put(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId), lCulture == null ? BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB() : lCulture.getColorRGB()); + staticColorMap.put(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId), lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB()); if (FMLCommonHandler.instance().getSide().isServer()) { MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( @@ -401,7 +401,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId ), - lCulture == null ? BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB() : lCulture.getColorRGB(), + lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB(), true ), this.getBaseMetaTileEntity().getXCoord(), @@ -416,7 +416,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId ), - lCulture == null ? BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB() : lCulture.getColorRGB(), + lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB(), false ), this.getBaseMetaTileEntity().getXCoord(), @@ -571,7 +571,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId ), - mCulture == null ? BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB() : mCulture.getColorRGB(), + mCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : mCulture.getColorRGB(), true ), this.getBaseMetaTileEntity().getXCoord(), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index 593e9fee7a..2c1218e633 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.util.*; +import com.sun.istack.internal.NotNull; import cpw.mods.fml.common.Loader; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -86,7 +87,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { FluidStack dnaFluid = Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); if (this.getSpecialSlot() != null && this.getSpecialSlot().getItem() instanceof LabModule) { - int damage = getSpecialSlot().getItemDamage() + 1; + int damage = getSpecialSlot().getItemDamage(); switch (damage) { case 0: if (GT_Utility.isStackValid(this.mInventory[4]) && this.mInventory[4].getItem() instanceof LabParts && this.mInventory[4].getItemDamage() == 0 && this.mInventory[4].getTagCompound() != null && //checks if it is a Culture @@ -197,9 +198,9 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { case 3: { if ( GT_Utility.isStackValid(this.mInventory[4]) && GT_Utility.areStacksEqual(this.mInventory[4], BioItemList.getPetriDish(null), true) && this.mInventory[4].getTagCompound() != null && - GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getPlasmidCell(null), true) && this.mInventory[5].getTagCompound() != null && - GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], FluidLoader.BioLabFluidCells[2]) && - this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000) { + GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getPlasmidCell(null), true) && this.mInventory[5].getTagCompound() != null && + GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], FluidLoader.BioLabFluidCells[2]) && + this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000) { BioData cultureDNABioData = BioData.getBioDataFromNBTTag(this.mInventory[5].getTagCompound()); BioCulture bioCulture = BioCulture.getBioCultureFromNBTTag(this.mInventory[4].getTagCompound()); if (cultureDNABioData == null || bioCulture == null) @@ -213,7 +214,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mFluid.amount -= 1000; bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = BioItemList.getPetriDish(bioCulture); + this.mOutputItems[0] = BioItemList.getPetriDish(checkForExisting(bioCulture)); } this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); @@ -259,4 +260,11 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } return super.checkRecipe(skipOC); } + + private BioCulture checkForExisting(@NotNull BioCulture culture){ + for (BioCulture bc : BioCulture.BIO_CULTURE_ARRAY_LIST) + if (culture.getdDNA().equals(bc.getdDNA()) && culture.getPlasmid().equals(bc.getPlasmid())) + return bc; + return culture; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java new file mode 100644 index 0000000000..b0b1fe61df --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.neiHandler; + +import codechicken.nei.recipe.GuiCraftingRecipe; +import codechicken.nei.recipe.GuiUsageRecipe; +import codechicken.nei.recipe.TemplateRecipeHandler; +import com.github.bartimaeusnek.bartworks.common.items.LabParts; +import cpw.mods.fml.common.event.FMLInterModComms; +import gregtech.api.enums.GT_Values; +import gregtech.api.util.GT_Recipe; +import gregtech.nei.GT_NEI_DefaultHandler; +import net.minecraft.item.ItemStack; + +import java.awt.*; + +public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { + public BW_NEI_BioLabHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { + super(aRecipeMap); + this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), getOverlayIdentifier())); + if (!NEI_BW_Config.sIsAdded) { + FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + getRecipeName() + "@" + getOverlayIdentifier()); + GuiCraftingRecipe.craftinghandlers.add(this); + GuiUsageRecipe.usagehandlers.add(this); + } + } + + public TemplateRecipeHandler newInstance() { + return new BW_NEI_BioLabHandler(this.mRecipeMap); + } + + public void loadCraftingRecipes(ItemStack aResult) { + if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3) { + for (GT_Recipe recipe : getSortedRecipes()) { + if (aResult.getTagCompound() != null && recipe != null) + for (int i = 0; i < recipe.mOutputs.length; i++) { + if (recipe.mOutputs[i] != null) + if (aResult.getTagCompound().equals(recipe.mOutputs[i].getTagCompound())) { + this.arecipes.add(new CachedDefaultRecipe(recipe)); + break; + } + + } + } + } + else + super.loadCraftingRecipes(aResult); + } + + @Override + public void loadUsageRecipes(ItemStack aResult) { + if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3) { + for (GT_Recipe recipe : getSortedRecipes()) { + if (aResult.getTagCompound() != null && recipe != null) + for (int i = 0; i < recipe.mInputs.length; i++) { + if (recipe.mInputs[i] != null) + if (aResult.getTagCompound().equals(recipe.mInputs[i].getTagCompound())) { + this.arecipes.add(new CachedDefaultRecipe(recipe)); + break; + } + + } + } + } + else + super.loadCraftingRecipes(aResult); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java new file mode 100644 index 0000000000..ce8aaedd9b --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.neiHandler; + +import codechicken.nei.recipe.GuiCraftingRecipe; +import codechicken.nei.recipe.GuiUsageRecipe; +import codechicken.nei.recipe.TemplateRecipeHandler; +import com.github.bartimaeusnek.bartworks.common.items.LabParts; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; +import cpw.mods.fml.common.event.FMLInterModComms; +import gregtech.GT_Mod; +import gregtech.api.enums.GT_Values; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.nei.GT_NEI_DefaultHandler; +import net.minecraft.item.ItemStack; + +import java.awt.*; + +public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { + + public BW_NEI_BioVatHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { + super(aRecipeMap); + this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), getOverlayIdentifier())); + if (!NEI_BW_Config.sIsAdded) { + FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + getRecipeName() + "@" + getOverlayIdentifier()); + GuiCraftingRecipe.craftinghandlers.add(this); + GuiUsageRecipe.usagehandlers.add(this); + } + } + + public TemplateRecipeHandler newInstance() { + return new BW_NEI_BioVatHandler(this.mRecipeMap); + } + + public void drawExtras(int aRecipeIndex) { + int base = 70; + int[] lines ={ base,base+8,base+16,base+24,base+32,base+40,base+48,base+56,base+64}; + int tEUt = ((GT_NEI_DefaultHandler.CachedDefaultRecipe)this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; + int tDuration = ((GT_NEI_DefaultHandler.CachedDefaultRecipe)this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; + String[] recipeDesc = ((GT_NEI_DefaultHandler.CachedDefaultRecipe)this.arecipes.get(aRecipeIndex)).mRecipe.getNeiDesc(); + int tSpecial; + if (recipeDesc == null) { + if (tEUt != 0) { + drawText(10, lines[0], this.trans("152", "Total: ") + (long)tDuration * (long)tEUt + " EU", -16777216); + drawText(10, lines[1], this.trans("153", "Usage: ") + tEUt + " EU/t", -16777216); + if (this.mRecipeMap.mShowVoltageAmperageInNEI) { + drawText(10,lines[2], this.trans("154", "Voltage: ") + tEUt / this.mRecipeMap.mAmperage + " EU", -16777216); + drawText(10, lines[3], this.trans("155", "Amperage: ") + this.mRecipeMap.mAmperage, -16777216); + } else { + drawText(10, lines[2], this.trans("156", "Voltage: unspecified"), -16777216); + drawText(10, lines[3], this.trans("157", "Amperage: unspecified"), -16777216); + } + } + + + + if (tDuration > 0) { + drawText(10, lines[4], this.trans("158", "Time: ") + String.format("%.2f " + this.trans("161", " secs"), 0.05F * (float)tDuration), -16777216); + } + + tSpecial = ((GT_NEI_DefaultHandler.CachedDefaultRecipe)this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; + + int[] tSpecialA = GT_TileEntity_BioVat.specialValueUnpack(tSpecial); + + drawText(10, lines[5], "Needs Glas Tier: "+ tSpecialA[0],-16777216); + + if (tSpecialA[1] == -100 && GT_Mod.gregtechproxy.mLowGravProcessing) { + drawText(10, lines[7], this.trans("159", "Needs Low Gravity"), -16777216); + } else if (tSpecialA[1] == -200 && GT_Mod.gregtechproxy.mEnableCleanroom) { + drawText(10, lines[7], this.trans("160", "Needs Cleanroom"), -16777216); + } else if (tSpecialA[1] == -300 && GT_Mod.gregtechproxy.mEnableCleanroom) { + drawText(10, lines[7], this.trans("160", "Needs Cleanroom & LowGrav"), -16777216); + } else if (tSpecialA[1] == -400) { + drawText(10, lines[7], this.trans("216", "Deprecated Recipe"), -16777216); + } else if (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre) || GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost)) { + drawText(10, lines[6],(tSpecialA[2] == 1 ? "Need exactly": "Need minimum") + this.mRecipeMap.mNEISpecialValuePre + tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier + this.mRecipeMap.mNEISpecialValuePost, -16777216); + } + } else { + tSpecial = 0; + String[] var6 = recipeDesc; + int var7 = recipeDesc.length; + + for(int var8 = 0; var8 < var7; ++var8) { + String descLine = var6[var8]; + drawText(10, 73 + 10 * tSpecial, descLine, -16777216); + ++tSpecial; + } + } + + } + + @Override + public void loadUsageRecipes(ItemStack aResult) { + if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3) + for (GT_Recipe recipe : this.getSortedRecipes()) { + if (aResult.getTagCompound() != null && recipe != null) + if (recipe.mSpecialItems instanceof ItemStack && ((ItemStack) recipe.mSpecialItems).getItem() instanceof LabParts) + if (aResult.getTagCompound().equals(((ItemStack) recipe.mSpecialItems).getTagCompound())) { + this.arecipes.add(new CachedDefaultRecipe(recipe)); + } + } + else + super.loadCraftingRecipes(aResult); + } + + @Override + public void loadCraftingRecipes(ItemStack aResult) { + if (aResult == null || !(aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 )) { + super.loadCraftingRecipes(aResult); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java new file mode 100644 index 0000000000..3614f608b1 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.neiHandler; + +import codechicken.nei.api.IConfigureNEI; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; + +public class NEI_BW_Config implements IConfigureNEI { + + public static boolean sIsAdded = true; + + public void loadConfig() { + sIsAdded = false; + new BW_NEI_BioVatHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BACTERIALVATBYTE)); + new BW_NEI_BioLabHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BIOLABBYTE)); + sIsAdded = true; + } + + public String getName() { + return "BartWorks NEI Plugin"; + } + + public String getVersion() { + return MainMod.APIVERSION; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index cba13261d0..33b699a87b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -66,7 +66,8 @@ public class BWRecipes { null, "gregtech:textures/gui/basicmachines/BW.GUI.BioLab", 6, 2, 1, 1, 1, - "", 1, "", true, true); + "", 1, "", true, false //special handler + ); private final BacteriaVatRecipeMap sBacteriaVat = new BacteriaVatRecipeMap( new HashSet(50), "bw.recipe.BacteriaVat", @@ -74,7 +75,8 @@ public class BWRecipes { null, "gregtech:textures/gui/basicmachines/Default", 6, 2, 0, 1, 1, - "Need Sievert: ", 1, " Sv", true, true); + " Sievert: ", 1, " Sv", true, false //special handler + ); private final BW_Recipe_Map_LiquidFuel sAcidGenFuels = new BW_Recipe_Map_LiquidFuel( new HashSet(10), "bw.fuels.acidgens", @@ -317,7 +319,7 @@ public class BWRecipes { } - public boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + public boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { if (sBiolab.addRecipe(new BioLabRecipe(true, aInputs, new ItemStack[]{aOutput}, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) return true; return false; @@ -370,13 +372,14 @@ public class BWRecipes { return false; } + @Deprecated public boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative byte glasTier) { int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) aSievert += calculateSv(material); aSievert = aSievert << 6; aSievert = aSievert | glasTier; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, new ItemStack[]{GT_Values.NI}, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) + if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) return true; return false; } @@ -392,7 +395,7 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, new ItemStack[]{BioItemList.getPetriDish(aCulture)}, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) + if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) return true; return false; } @@ -408,11 +411,12 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, new ItemStack[]{BioItemList.getPetriDish(aCulture)}, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) + if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) return true; return false; } + @Deprecated public boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, boolean exactSv) { int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) @@ -420,7 +424,7 @@ public class BWRecipes { aSievert = aSievert << 1; aSievert = aSievert | (exactSv ? 1 : 0); aSievert = aSievert << 6; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, new ItemStack[]{GT_Values.NI}, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) + if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) return true; return false; } @@ -434,7 +438,7 @@ public class BWRecipes { aSievert = aSievert << 2; aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, new ItemStack[]{BioItemList.getPetriDish(culture)}, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) + if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) return true; return false; } @@ -446,7 +450,7 @@ public class BWRecipes { int aSievert = 0; aSievert = aSievert << 7; aSievert = aSievert | glasTier; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, new ItemStack[]{BioItemList.getPetriDish(culture)}, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) + if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) return true; return false; } @@ -455,7 +459,7 @@ public class BWRecipes { * Adds a Vat recipe without Rad or Glas requirements */ public boolean addBacterialVatRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, BioCulture culture, FluidStack[] aFluidOutputs, int aDuration, int aEUt) { - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, new ItemStack[]{BioItemList.getPetriDish(culture)}, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, 0)) != null) + if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, 0)) != null) return true; return false; } @@ -472,7 +476,7 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(true, aInputs, null, new ItemStack[]{BioItemList.getPetriDish(aCulture)}, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) + if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(true, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) return true; return false; } @@ -498,19 +502,19 @@ public class BWRecipes { } class BioLabRecipe extends GT_Recipe { - protected BioLabRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + protected BioLabRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); } } - class BacteriaVatRecipe extends GT_Recipe { - protected BacteriaVatRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + public static class BacteriaVatRecipe extends GT_Recipe { + protected BacteriaVatRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); } } - class BacteriaVatRecipeMap extends GT_Recipe.GT_Recipe_Map { + public static class BacteriaVatRecipeMap extends GT_Recipe.GT_Recipe_Map { public BacteriaVatRecipeMap(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index 15f432aab3..98601e568c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -30,12 +30,15 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import java.awt.*; +import java.nio.ByteBuffer; import java.util.ArrayList; +import java.util.Arrays; import java.util.Objects; public class BioCulture extends BioData { public static final ArrayList BIO_CULTURE_ARRAY_LIST = new ArrayList(); + public static final BioCulture NULLCULTURE = BioCulture.createAndRegisterBioCulture(Color.BLUE, "", BioPlasmid.NULLPLASMID,BioDNA.NULLDNA, false); //fallback NULL culture, also Blue =) Color color; BioPlasmid plasmid; @@ -75,7 +78,7 @@ public class BioCulture extends BioData { return new NBTTagCompound(); NBTTagCompound ret = new NBTTagCompound(); ret.setString("Name", bioCulture.name); - ret.setInteger("ID", bioCulture.ID); + //ret.setInteger("ID", bioCulture.ID); ret.setIntArray("Color", new int[]{bioCulture.color.getRed(), bioCulture.color.getGreen(), bioCulture.color.getBlue()}); ret.setTag("Plasmid", BioData.getNBTTagFromBioData(BioData.convertBioPlasmidToBioData(bioCulture.plasmid))); ret.setTag("DNA", BioData.getNBTTagFromBioData(BioData.convertBioDNAToBioData(bioCulture.dDNA))); @@ -89,17 +92,21 @@ public class BioCulture extends BioData { public static BioCulture getBioCultureFromNBTTag(NBTTagCompound tag) { if (tag == null || tag.getIntArray("Color").length == 0) return null; - BioCulture ret = new BioCulture( - new Color(tag.getIntArray("Color")[0], tag.getIntArray("Color")[1], tag.getIntArray("Color")[2]), - tag.getString("Name"), - tag.getInteger("ID"), - BioPlasmid.convertDataToPlasmid(getBioDataFromNBTTag(tag.getCompoundTag("Plasmid"))), - BioDNA.convertDataToDNA(getBioDataFromNBTTag(tag.getCompoundTag("DNA"))), - BW_Util.getRarityFromByte(tag.getByte("Rarety")), - tag.getBoolean("Breedable") - ); + BioCulture ret = getBioCulture(tag.getString("Name")); + + if (ret == null) + ret = createAndRegisterBioCulture( + new Color(tag.getIntArray("Color")[0], tag.getIntArray("Color")[1], tag.getIntArray("Color")[2]), + tag.getString("Name"), + BioPlasmid.convertDataToPlasmid(getBioDataFromNBTTag(tag.getCompoundTag("Plasmid"))), + BioDNA.convertDataToDNA(getBioDataFromNBTTag(tag.getCompoundTag("DNA"))), + BW_Util.getRarityFromByte(tag.getByte("Rarety")), + tag.getBoolean("Breedable") + ); if (ret.bBreedable) ret.setFluid(FluidRegistry.getFluid(tag.getString("Fluid"))); + if (ret.getFluidNotSet()) //should never happen, but better safe than sorry + ret.setbBreedable(false); return ret; } @@ -123,6 +130,10 @@ public class BioCulture extends BioData { return this.mFluid; } + public boolean getFluidNotSet(){ + return this.mFluid == null && this.isBreedable(); + } + public void setFluid(Fluid mFluid) { this.mFluid = mFluid; } @@ -184,6 +195,6 @@ public class BioCulture extends BioData { @Override public int hashCode() { - return Objects.hash(super.hashCode(), this.getColor(), this.getPlasmid(), this.getdDNA(), this.isBreedable(), this.mFluid); + return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(17).putInt(MurmurHash3.murmurhash3_x86_32(this.getName(),0,this.getName().length(),31)).putInt(this.getColorRGB()).putInt(this.getPlasmid().ID).putInt(this.getdDNA().ID).put((byte) (isBreedable() ? 1 : 0)).array(),0,17,31); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java index 65a7de4ab0..4cdbf1a143 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java @@ -26,6 +26,8 @@ import net.minecraft.item.EnumRarity; public class BioDNA extends BioData { + public static final BioDNA NULLDNA = createAndRegisterBioDNA("", EnumRarity.epic); + protected BioDNA(String name, int ID, EnumRarity rarity) { super(name, ID, rarity); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java index ac9c7d2083..f4e8917e67 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java @@ -25,11 +25,13 @@ package com.github.bartimaeusnek.bartworks.util; import net.minecraft.item.EnumRarity; import net.minecraft.nbt.NBTTagCompound; +import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Objects; public class BioData { public static final ArrayList BIO_DATA_ARRAY_LIST = new ArrayList(); + protected String name; protected int ID; protected EnumRarity rarity; @@ -83,7 +85,7 @@ public class BioData { NBTTagCompound ret = new NBTTagCompound(); ret.setByte("Rarity", BW_Util.getByteFromRarity(bioData.rarity)); ret.setString("Name", bioData.name); - ret.setInteger("ID", bioData.ID); + //ret.setInteger("ID", bioData.ID); buggy when load Order changes ret.setInteger("Chance", bioData.chance); ret.setInteger("Tier", bioData.tier); return ret; @@ -107,16 +109,16 @@ public class BioData { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; BioData bioData = (BioData) o; - return this.getID() == bioData.getID() && + return this.getID() == bioData.getID() || ( this.getChance() == bioData.getChance() && this.getTier() == bioData.getTier() && Objects.equals(this.getName(), bioData.getName()) && - this.getRarity() == bioData.getRarity(); + this.getRarity() == bioData.getRarity()); } @Override public int hashCode() { - return Objects.hash(this.getName(), this.getID(), this.getRarity(), this.getChance(), this.getTier()); + return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(13).putInt(MurmurHash3.murmurhash3_x86_32(this.getName(),0,this.getName().length(),31)).put(BW_Util.getByteFromRarity(this.getRarity())).putInt(this.getChance()).putInt(this.getTier()).array(),0,13,31); } public int getTier() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java index 7b034f8c43..1d59edb5ea 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java @@ -25,6 +25,9 @@ package com.github.bartimaeusnek.bartworks.util; import net.minecraft.item.EnumRarity; public class BioPlasmid extends BioData { + + public static final BioPlasmid NULLPLASMID = convertDataToPlasmid(BioData.convertBioDNAToBioData(BioDNA.NULLDNA)); + private BioPlasmid(String name, int ID, EnumRarity rarity) { super(name, ID, rarity); } -- cgit From e0e7688d24f782c43adfc9031e3ad87e8fcf27fd Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 18 Feb 2019 23:59:43 +0100 Subject: removed not null annotation Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: e4ceb9284d40a3c015611aae0ad559c8e4e38a31 --- .../common/tileentities/tiered/GT_MetaTileEntity_BioLab.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index 2c1218e633..b2e34902c0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -28,7 +28,6 @@ import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.util.*; -import com.sun.istack.internal.NotNull; import cpw.mods.fml.common.Loader; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -261,7 +260,9 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { return super.checkRecipe(skipOC); } - private BioCulture checkForExisting(@NotNull BioCulture culture){ + private BioCulture checkForExisting(BioCulture culture){ + if (culture == null) + return null; for (BioCulture bc : BioCulture.BIO_CULTURE_ARRAY_LIST) if (culture.getdDNA().equals(bc.getdDNA()) && culture.getPlasmid().equals(bc.getPlasmid())) return bc; -- cgit From 7f7218a6ef6b74a9e413fc026f086af74bce8480 Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Thu, 21 Feb 2019 00:27:17 +0800 Subject: Update it undone Former-commit-id: a4ac723decb2ae71502672e485d521638b831930 --- .../resources/assets/bartworks/lang/zh_CN.lang | 89 +++++++++++++++++++++- 1 file changed, 88 insertions(+), 1 deletion(-) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index 22ce79877f..85a876a27a 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -55,4 +55,91 @@ BW_GlasBlocks.8.name=染色的硼硅酸盐玻璃块(紫) BW_GlasBlocks.9.name=染色的硼硅酸盐玻璃块(黄) BW_GlasBlocks.10.name=染色的硼硅酸盐玻璃块(黄绿) BW_GlasBlocks.11.name=染色的硼硅酸盐玻璃块(棕) -//This zh_CN.lang is translation by huajijam for bartworks (18/2/19) \ No newline at end of file + +tooltip.glas.0.name=玻璃等级: +tooltip.LESU.0.name=最大容量! +tooltip.LESU.1.name=多个控制器! + +tooltip.windmeter.0.name=一个简单的风速计选择风车的地方. +tooltip.windmeter.1.name=使用次数剩余: +tooltip.windmeter.2.name=不存在的 +tooltip.windmeter.3.name=很低 +tooltip.windmeter.4.name=普通 +tooltip.windmeter.5.name=相当强大 +tooltip.windmeter.6.name=十分强大 +tooltip.windmeter.7.name=太强了 +tooltip.windmeter.8.name=这里的风似乎是 +tooltip.rotor.0.name=直径: +tooltip.rotor.1.name=耐久: +tooltip.rotor.2.name=效率: +tooltip.cp.0.name=里面有电路吗? + +tooltip.bw.0.name=Added by +tooltip.bw.1.name=由bartimaeusnek添加 +tooltip.bw.yes.name=是 +tooltip.bw.no.name=否 +tooltip.bw.tier.name=阶: +tooltip.bw.kg.0.name=kg +tooltip.bw.kg.1.name=kgs +tooltip.bw.empty.name=空 + +tooltip.teslastaff.0.name=没有保修! +tooltip.labmodule.0.name=用于更改生物实验室工作模式的模块 +tooltip.labparts.0.name=一个空的无菌培养皿 +tooltip.labparts.1.name=一个空的DNA烧瓶. +tooltip.labparts.2.name=一个空的质粒细胞. +tooltip.labparts.3.name=一种特殊的生物工程清洗电源 +tooltip.labparts.4.name=电泳分离DNA的粉末. +tooltip.labparts.5.name=有盖培养皿: +tooltip.labparts.6.name=这是一种很弱的培养物,不能在细菌培养皿中培养。! +tooltip.labparts.7.name=含有DNA的烧瓶: +tooltip.labparts.8.name=质粒细胞容器: + +tooltip.tile.waterpump.0.name=产出 +tooltip.tile.waterpump.1.name=升/秒 加油时的水. +tooltip.tile.waterpump.2.name=必须放在地上. + +tooltip.tile.mbf.0.name=巨型高炉的控制器;大小(宽x高x长):15x20x15(中空);控制器:第3层中间中心;内部13x18x13加热线圈(中空);外部15x18x1硼硅酸盐玻璃;玻璃将限制能量输入等级;1个以上的输入仓/总线(任意机械方块);1个以上的输出仓/总线(任意机械方块);1个以上的能源仓(任意机械方块);1x维护舱(任意机械方块);13x13消音仓(正中);外部15x15的防热机械方块(20层);1个输出仓以回收CO2CO/SO2(可选,任何顶层机械方块);回收比例取决于消音仓等级;防热机械方块为基础;每分钟900K.热容量增加5%(乘以);每分钟1800K. 热容量允许一个升级的超频;升级的超频将配方时间减少到25%并将EU/t增加到400%;造成最大化 +tooltip.tile.mbf.1.name=污染每秒 +tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest +tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom and top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radiation Input Bus;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! +tooltip.tile.windmill.0.name=A primitive Grinder powered by Kinetic energy.;Size(WxHxD): 7x12x7;Layer 1: 7x7 Bricks, corners are air, controller at front centered.;Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,;hollow, Wall must contain at least one Dispenser;Layer 6: 5x5 Wood Planks. Corners are filled, hollow.;Layer 7: 7x7 Wood Planks. Corners are air, hollow.;Layer 8: 7x7 Wood Planks. Corners are air, hollow,;front centered must be a Primitive Kinetic Shaftbox;Layer 9: 7x7 Wood Planks. Corners are air, hollow.;Layer 10: 5x5 Wood Planks. Corners are filled, hollow.;Layer 11: 3x3 Wood Planks. Corners are filled, hollow.;Layer 12: 1x1 Wood Plank.;Needs a Wind Mill Rotor in the Shaftbox to operate;Input items in Controller;Output items will appear in the dispensers;It is faster in regions with more wind (like IC2 Windmills) +tooltip.tile.lesu.0.name=用于GT2-风格的L.E.S.U.的控制器模块;尺寸:任意 +tooltip.tile.lesu.1.name=储存每LESU外壳: +tooltip.tile.lesu.2.name=Output EU: LESU Casings amount;Input EU: Next Voltage Tier to Output EU;Input/Output Amps can be configured via 4 Circuits in GUI;Output Side has a dot on it. +tooltip.tile.lesu.3.name=只允许一个控制器,不允许共享! +tooltip.tile.manualtravo.0.name=Controller Block for the Manual Trafo;Operates in 4 different Modes:;Mode 1: Circuit 0 in controller: Direct-Upstep;Mode 2: Circuit 1 in controller: Direct-Downstep;Mode 3: Circuit 2 in controller: Tapped-Upstep;Mode 4: Circuit 3 in controller: Tapped-Downstep;For direct Modes: 3xHx3;Base Contains at least 1 Energy Hatch;1 Layer of Transformer-Winding Blocks for each Tier transformed;Middle of Transformer-Winding Blocks needs to be a Nickel-Zinc Ferrite Block;Top Contains at least 1 Dynamo Hatch;Maintenance Hatch can be placed anywhere;Tapped Mode is disabled at the Moment. +tooltip.tile.tiereddsc.0.name=电压: +tooltip.tile.tiereddsc.1.name=输入安培: +tooltip.tile.tiereddsc.2.name=输出安培: +tooltip.tile.tiereddsc.3.name=容量: +tooltip.tile.diode.0.name=一个简单的二极管,只允许能量流向一个方向。 +tooltip.tile.energydistributor.0.name=将电流分为多个面 +tooltip.tile.biolab.0.name=生物实验室,一个多用途生物工程站 +tooltip.tile.radhatch.0.name=多方块放射性物质室 +tooltip.tile.radhatch.1.name=使用螺丝刀设置容量等级 +tooltip.tile.radhatch.2.name=材质: +tooltip.tile.radhatch.3.name=西弗特(Sv): +tooltip.tile.radhatch.4.name=数量: +tooltip.tile.radhatch.5.name=时间(在t/s/m/h)来衰变(1kg): +tooltip.tile.radhatch.6.name=t +tooltip.tile.radhatch.7.name=s +tooltip.tile.radhatch.8.name=m +tooltip.tile.radhatch.9.name=h +tooltip.tile.acidgen.0.name=酸发生器 +tooltip.tile.acidgen.1.name=从化学能势中产生能量. +nei.biovat.0.name=需要玻璃等级: +nei.biovat.1.name=确切需要 +nei.biovat.2.name=最少需要 + +tile.diode.name=电缆二极管 +tile.energydistributor.name=能量分配器 +tile.acidgenerator.name=酸发生器 +tile.bw.mbf.name=巨型高炉 +tile.bw.mvf.name=超级真空冷冻柜 +tile.biolab.name=生物实验室 +tile.biovat.name=发酵锅 +tile.radiohatch.name=无线电舱口 +tile.bw.windmill.name=风车 +tile.manutrafo.name=手动变压器 +//This zh_CN.lang is translation by huajijam for bartworks (21/2/19) \ No newline at end of file -- cgit From 33f156de8d43a3f03ea33b1dba86664efc4fd92e Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Thu, 21 Feb 2019 21:23:23 +0800 Subject: translation done Former-commit-id: 5ea54d64f12b7417f47e6e513680d2e206c55063 --- .../resources/assets/bartworks/lang/zh_CN.lang | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index 85a876a27a..b5a05878c4 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -2,22 +2,22 @@ itemGroup.GT2C=Gregtech 2兼容 item.GT_Rockcutter_Item_LV.name=岩石切割者 LV item.GT_Rockcutter_Item_MV.name=岩石切割者 MV item.GT_Rockcutter_Item_HV.name=岩石切割者 HV -item.GT_Teslastaff_Item.name=特斯拉夫 -BW_ItemBlocks.0.name=蚀刻青金石电池 -BW_ItemBlocks.1.name=镀青金石电池 +item.GT_Teslastaff_Item.name=特斯拉权杖 +BW_ItemBlocks.0.name=蚀刻青金石单元 +BW_ItemBlocks.1.name=镀青金石单元 GT_LESU_CASING.0.name=LESU框架 itemGroup.bartworks=BartWorks 跨时代 BW_Machinery_Casings.0.name=镍锌铁氧体块 -BW_Machinery_Casings.1.name=变压器绕组块 -item.BW_PaperRotor.name=原始纸转子 (只有风) -item.BW_LeatherRotor.name=原始皮革转子 (只有风) -item.BW_WoolRotor.name=原始羊毛转子 (只有风) -item.BW_CombinedRotor.name=复合原始转子 (只有风) +BW_Machinery_Casings.1.name=变压器线圈方块 +item.BW_PaperRotor.name=原始纸转子 (风车专用) +item.BW_LeatherRotor.name=原始皮革转子 (风车专用) +item.BW_WoolRotor.name=原始羊毛转子 (风车专用) +item.BW_CombinedRotor.name=复合原始转子 (风车专用) tile.BWRotorBlock.0.name=原始动力学转轴箱 item.grindstone_top.name=磨石顶部 item.grindstone_bottom.name=磨石底部 -item.completed_grindstone.name=磨刀石 +item.completed_grindstone.name=磨石 item.rotors.leatherParts.name=皮革包木框架 item.rotors.woolParts.name=羊毛包木框架 item.rotors.paperParts.name=纸包木框架 @@ -44,11 +44,11 @@ labModule.item.PlasmidSynthesisModule.name=质粒合成模块 labModule.item.TransformationModule.name=转换模块 labModule.item.ClonalCellularSynthesisModule.name=克隆细胞合成模块 BW_GlasBlocks.0.name=硼硅酸盐玻璃块 -BW_GlasBlocks.1.name=镍加固硼硅酸盐玻璃块 -BW_GlasBlocks.2.name=钨加固硼硅酸盐玻璃块 -BW_GlasBlocks.3.name=铬加固硼硅酸盐玻璃块 -BW_GlasBlocks.4.name=铱加固硼硅酸盐玻璃块 -BW_GlasBlocks.5.name=锇加固硼硅酸盐玻璃块 +BW_GlasBlocks.1.name=镍强化硼硅酸盐玻璃块 +BW_GlasBlocks.2.name=钨强化硼硅酸盐玻璃块 +BW_GlasBlocks.3.name=铬强化硼硅酸盐玻璃块 +BW_GlasBlocks.4.name=铱强化硼硅酸盐玻璃块 +BW_GlasBlocks.5.name=锇强化硼硅酸盐玻璃块 BW_GlasBlocks.6.name=染色的硼硅酸盐玻璃块(红) BW_GlasBlocks.7.name=染色的硼硅酸盐玻璃块(绿) BW_GlasBlocks.8.name=染色的硼硅酸盐玻璃块(紫) @@ -99,16 +99,16 @@ tooltip.tile.waterpump.0.name=产出 tooltip.tile.waterpump.1.name=升/秒 加油时的水. tooltip.tile.waterpump.2.name=必须放在地上. -tooltip.tile.mbf.0.name=巨型高炉的控制器;大小(宽x高x长):15x20x15(中空);控制器:第3层中间中心;内部13x18x13加热线圈(中空);外部15x18x1硼硅酸盐玻璃;玻璃将限制能量输入等级;1个以上的输入仓/总线(任意机械方块);1个以上的输出仓/总线(任意机械方块);1个以上的能源仓(任意机械方块);1x维护舱(任意机械方块);13x13消音仓(正中);外部15x15的防热机械方块(20层);1个输出仓以回收CO2CO/SO2(可选,任何顶层机械方块);回收比例取决于消音仓等级;防热机械方块为基础;每分钟900K.热容量增加5%(乘以);每分钟1800K. 热容量允许一个升级的超频;升级的超频将配方时间减少到25%并将EU/t增加到400%;造成最大化 +tooltip.tile.mbf.0.name=巨型高炉的控制器;大小(宽x高x长):15x20x15(中空);控制器:第3层中间中心;内部13x18x13加热线圈(中空);外部15x18x1硼硅酸盐玻璃;玻璃将限制能量输入等级;1个以上的输入仓/总线(任意机械方块);1个以上的输出仓/总线(任意机械方块);1个以上的能源仓(任意机械方块);1x维护仓(任意机械方块);13x13消音仓(顶部正中);外部15x15的防热机械方块(第20层);1个输出仓以回收CO2/CO/SO2(可选,任何顶层机械方块);回收比例取决于消音仓等级;防热机械方块为基础;每分钟900K.热容量增加5%(乘法);每分钟1800K.热容量允许一个升级的超频;升级的超频将配方时间减少到25%并将EU/t增加到400%;造成最大化 tooltip.tile.mbf.1.name=污染每秒 -tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest -tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom and top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radiation Input Bus;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! -tooltip.tile.windmill.0.name=A primitive Grinder powered by Kinetic energy.;Size(WxHxD): 7x12x7;Layer 1: 7x7 Bricks, corners are air, controller at front centered.;Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,;hollow, Wall must contain at least one Dispenser;Layer 6: 5x5 Wood Planks. Corners are filled, hollow.;Layer 7: 7x7 Wood Planks. Corners are air, hollow.;Layer 8: 7x7 Wood Planks. Corners are air, hollow,;front centered must be a Primitive Kinetic Shaftbox;Layer 9: 7x7 Wood Planks. Corners are air, hollow.;Layer 10: 5x5 Wood Planks. Corners are filled, hollow.;Layer 11: 3x3 Wood Planks. Corners are filled, hollow.;Layer 12: 1x1 Wood Plank.;Needs a Wind Mill Rotor in the Shaftbox to operate;Input items in Controller;Output items will appear in the dispensers;It is faster in regions with more wind (like IC2 Windmills) +tooltip.tile.mvf.0.name=巨型真空冷冻机的控制器;超级冷却热金属锭和单元;大小(宽x高x长):15x15x15(中空);控制器:(正面中心);1个输入总线(任意机械方块);1个输出总线(任意机械方块);1个维护仓(任意机械方块);1个能源仓(任意机械方块);其余为的防冻机械方块 +tooltip.tile.bvat.0.name=发酵锅的控制器;大小(宽x高x长):5x4x5;底部和顶部是不锈钢外壳;底部和顶部必须包含:;1个维护仓,1个输出仓;1个或以上的输入仓,1个或以上的输入仓,0-1个辐射输入总线;两个中间层必须由玻璃构成,中空;玻璃可以是任何玻璃,例如,匠魂的通透玻璃;一些配方需要更高级的玻璃;为了最大限度地提高效率,请保持输出仓始终为半满! +tooltip.tile.windmill.0.name=由动能驱动的原始磨床;大小(宽x高x长):7x12x7;第1层7x7砖块,角落为空气方块,控制器在正面中心;第2-5层:5x5硬化粘土,角落为空气方块,可以包含一扇门,中空;墙必须至少包含一个发射器;第六层:5x5木板.角落填满,中空;第7层:7x7木板.角落为空气方块,中空;第8层:7x7木板.角落为空气方块,中空;正面中心必须是原始动力学转轴箱;第9层:7x7木板.角落为空气方块,中空;第10层:5x5木板.角落填满,中空;第11层:3x3木板.角落填满,中空;第12层:1x1木板;需要在动力学转轴箱内有转子才能运行;在控制器中输入物品;输出物品将出现在发射器中;在风力较大的地区,速度更快(像IC2风车一样) tooltip.tile.lesu.0.name=用于GT2-风格的L.E.S.U.的控制器模块;尺寸:任意 tooltip.tile.lesu.1.name=储存每LESU外壳: -tooltip.tile.lesu.2.name=Output EU: LESU Casings amount;Input EU: Next Voltage Tier to Output EU;Input/Output Amps can be configured via 4 Circuits in GUI;Output Side has a dot on it. -tooltip.tile.lesu.3.name=只允许一个控制器,不允许共享! -tooltip.tile.manualtravo.0.name=Controller Block for the Manual Trafo;Operates in 4 different Modes:;Mode 1: Circuit 0 in controller: Direct-Upstep;Mode 2: Circuit 1 in controller: Direct-Downstep;Mode 3: Circuit 2 in controller: Tapped-Upstep;Mode 4: Circuit 3 in controller: Tapped-Downstep;For direct Modes: 3xHx3;Base Contains at least 1 Energy Hatch;1 Layer of Transformer-Winding Blocks for each Tier transformed;Middle of Transformer-Winding Blocks needs to be a Nickel-Zinc Ferrite Block;Top Contains at least 1 Dynamo Hatch;Maintenance Hatch can be placed anywhere;Tapped Mode is disabled at the Moment. +tooltip.tile.lesu.2.name=输出EU:LESU外壳数量;输入EU:输出EU的下一个电压级;输入/输出安培可通过GUI中的4个编程电路进行配置;输出端有一个点. +tooltip.tile.lesu.3.name=只允许一个控制器,不允许共享墙壁! +tooltip.tile.manualtravo.0.name=手动变压器的控制器;可在4种不同的模式下运行:;模式1:控制器内放入编程电路0:直接升压;模式2:控制器内放入编程电路1:直接降压;模式3:控制器内放入编程电路2:轻拍升压;模式4:控制器内放入编程电路3:轻拍降压;对于直接模式:3xHx3;底部包含至少1个能量仓;每1级变压器需要一层变压器线圈方块;变压器线圈方块中间是镍锌铁氧体块;顶部包含至少1个发电机仓;维护仓可放置在任何地方;轻拍模式暂不可用. tooltip.tile.tiereddsc.0.name=电压: tooltip.tile.tiereddsc.1.name=输入安培: tooltip.tile.tiereddsc.2.name=输出安培: -- cgit From 15814fcef82963fb7371bfe13cfed28ccbbc93b9 Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Thu, 21 Feb 2019 21:40:18 +0800 Subject: Fix bug Former-commit-id: 75864540f6155f61dfb3e5767985fe17b2fd99f5 --- src/main/resources/assets/bartworks/lang/zh_CN.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index b5a05878c4..5911638c96 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -108,7 +108,7 @@ tooltip.tile.lesu.0.name=用于GT2-风格的L.E.S.U.的控制器模块;尺寸: tooltip.tile.lesu.1.name=储存每LESU外壳: tooltip.tile.lesu.2.name=输出EU:LESU外壳数量;输入EU:输出EU的下一个电压级;输入/输出安培可通过GUI中的4个编程电路进行配置;输出端有一个点. tooltip.tile.lesu.3.name=只允许一个控制器,不允许共享墙壁! -tooltip.tile.manualtravo.0.name=手动变压器的控制器;可在4种不同的模式下运行:;模式1:控制器内放入编程电路0:直接升压;模式2:控制器内放入编程电路1:直接降压;模式3:控制器内放入编程电路2:轻拍升压;模式4:控制器内放入编程电路3:轻拍降压;对于直接模式:3xHx3;底部包含至少1个能量仓;每1级变压器需要一层变压器线圈方块;变压器线圈方块中间是镍锌铁氧体块;顶部包含至少1个发电机仓;维护仓可放置在任何地方;轻拍模式暂不可用. +tooltip.tile.manualtravo.0.name=手动变压器的控制器;可在4种不同的模式下运行:;模式1:控制器内放入编程电路0:直接升压;模式2:控制器内放入编程电路1:直接降压;模式3:控制器内放入编程电路2:Tapped升压;模式4:控制器内放入编程电路3:Tapped降压;对于直接模式:3xHx3;底部包含至少1个能量仓;每1级变压器需要一层变压器线圈方块;变压器线圈方块中间是镍锌铁氧体块;顶部包含至少1个发电机仓;维护仓可放置在任何地方;Tapped模式暂不可用.(Tapped模式为在变压时获得多个电压)(译注) tooltip.tile.tiereddsc.0.name=电压: tooltip.tile.tiereddsc.1.name=输入安培: tooltip.tile.tiereddsc.2.name=输出安培: -- cgit From 4d2388dd6ced2e5d33a4f0a845dcafc8a0b87b91 Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Thu, 21 Feb 2019 23:39:50 +0800 Subject: Fix bug and have better translation Former-commit-id: 036b6e110fd4a88c921aba59e3ccc8374c00871c --- src/main/resources/assets/bartworks/lang/zh_CN.lang | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index 5911638c96..a837437e3c 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -1,4 +1,4 @@ -itemGroup.GT2C=Gregtech 2兼容 +itemGroup.GT2C=Gregtech2兼容 item.GT_Rockcutter_Item_LV.name=岩石切割者 LV item.GT_Rockcutter_Item_MV.name=岩石切割者 MV item.GT_Rockcutter_Item_HV.name=岩石切割者 HV @@ -7,7 +7,7 @@ BW_ItemBlocks.0.name=蚀刻青金石单元 BW_ItemBlocks.1.name=镀青金石单元 GT_LESU_CASING.0.name=LESU框架 -itemGroup.bartworks=BartWorks 跨时代 +itemGroup.bartworks=BartWorks-跨时代 BW_Machinery_Casings.0.name=镍锌铁氧体块 BW_Machinery_Casings.1.name=变压器线圈方块 item.BW_PaperRotor.name=原始纸转子 (风车专用) @@ -28,7 +28,7 @@ item.BWrawtube.name=加长玻璃管 item.BWmotor.name=简易斯特林电机 item.BWstove.name=简易加热炉 -itemGroup.BioTab=BartWorks 生物工程 +itemGroup.BioTab=BartWorks-生物工程 filled.item.petriDish.name=培养皿 item.petriDish.name=无菌培养皿 item.DNASampleFlask.name=DNA样品瓶 @@ -99,7 +99,7 @@ tooltip.tile.waterpump.0.name=产出 tooltip.tile.waterpump.1.name=升/秒 加油时的水. tooltip.tile.waterpump.2.name=必须放在地上. -tooltip.tile.mbf.0.name=巨型高炉的控制器;大小(宽x高x长):15x20x15(中空);控制器:第3层中间中心;内部13x18x13加热线圈(中空);外部15x18x1硼硅酸盐玻璃;玻璃将限制能量输入等级;1个以上的输入仓/总线(任意机械方块);1个以上的输出仓/总线(任意机械方块);1个以上的能源仓(任意机械方块);1x维护仓(任意机械方块);13x13消音仓(顶部正中);外部15x15的防热机械方块(第20层);1个输出仓以回收CO2/CO/SO2(可选,任何顶层机械方块);回收比例取决于消音仓等级;防热机械方块为基础;每分钟900K.热容量增加5%(乘法);每分钟1800K.热容量允许一个升级的超频;升级的超频将配方时间减少到25%并将EU/t增加到400%;造成最大化 +tooltip.tile.mbf.0.name=巨型工业高炉的控制器;大小(宽x高x长):15x20x15(中空);控制器:第3层中间中心;内部13x18x13加热线圈(中空);外部15x18x1硼硅酸盐玻璃;玻璃将限制能量输入等级;1个以上的输入仓/总线(任意机械方块);1个以上的输出仓/总线(任意机械方块);1个以上的能源仓(任意机械方块);1x维护仓(任意机械方块);13x13消音仓(顶部正中);外部15x15的防热机械方块(第20层);1个输出仓以回收CO2/CO/SO2(可选,任何顶层机械方块);回收比例取决于消音仓等级;底层为隔热机械方块;自配方的最小温度起,温度每高出900K会减少5%的能耗(使用乘法);自配方的最小温度起,每高出1800K的温度将允许进行一次无损超频;无损超频将减少配方加工时间至25%并提升功率至400% tooltip.tile.mbf.1.name=污染每秒 tooltip.tile.mvf.0.name=巨型真空冷冻机的控制器;超级冷却热金属锭和单元;大小(宽x高x长):15x15x15(中空);控制器:(正面中心);1个输入总线(任意机械方块);1个输出总线(任意机械方块);1个维护仓(任意机械方块);1个能源仓(任意机械方块);其余为的防冻机械方块 tooltip.tile.bvat.0.name=发酵锅的控制器;大小(宽x高x长):5x4x5;底部和顶部是不锈钢外壳;底部和顶部必须包含:;1个维护仓,1个输出仓;1个或以上的输入仓,1个或以上的输入仓,0-1个辐射输入总线;两个中间层必须由玻璃构成,中空;玻璃可以是任何玻璃,例如,匠魂的通透玻璃;一些配方需要更高级的玻璃;为了最大限度地提高效率,请保持输出仓始终为半满! @@ -135,11 +135,11 @@ nei.biovat.2.name=最少需要 tile.diode.name=电缆二极管 tile.energydistributor.name=能量分配器 tile.acidgenerator.name=酸发生器 -tile.bw.mbf.name=巨型高炉 -tile.bw.mvf.name=超级真空冷冻柜 +tile.bw.mbf.name=巨型工业高炉 +tile.bw.mvf.name=巨型真空冷冻机 tile.biolab.name=生物实验室 -tile.biovat.name=发酵锅 -tile.radiohatch.name=无线电舱口 +tile.biovat.name=生物培养缸 +tile.radiohatch.name=放射仓 tile.bw.windmill.name=风车 tile.manutrafo.name=手动变压器 //This zh_CN.lang is translation by huajijam for bartworks (21/2/19) \ No newline at end of file -- cgit From 60625fd517ee221c804a22629fce0d3153c7559b Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Thu, 21 Feb 2019 23:59:56 +0800 Subject: Fix more bugs Former-commit-id: 06de74a0b8e5d6fc7065b8de38a0907ca68958b9 --- .../resources/assets/bartworks/lang/zh_CN.lang | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index a837437e3c..27353a0aa5 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -14,7 +14,7 @@ item.BW_PaperRotor.name=原始纸转子 (风车专用) item.BW_LeatherRotor.name=原始皮革转子 (风车专用) item.BW_WoolRotor.name=原始羊毛转子 (风车专用) item.BW_CombinedRotor.name=复合原始转子 (风车专用) -tile.BWRotorBlock.0.name=原始动力学转轴箱 +tile.BWRotorBlock.0.name=原始动力学轴箱 item.grindstone_top.name=磨石顶部 item.grindstone_bottom.name=磨石底部 item.completed_grindstone.name=磨石 @@ -91,7 +91,7 @@ tooltip.labparts.2.name=一个空的质粒细胞. tooltip.labparts.3.name=一种特殊的生物工程清洗电源 tooltip.labparts.4.name=电泳分离DNA的粉末. tooltip.labparts.5.name=有盖培养皿: -tooltip.labparts.6.name=这是一种很弱的培养物,不能在细菌培养皿中培养。! +tooltip.labparts.6.name=这是一种很弱的培养物,不能在细菌培养皿中培养! tooltip.labparts.7.name=含有DNA的烧瓶: tooltip.labparts.8.name=质粒细胞容器: @@ -102,20 +102,20 @@ tooltip.tile.waterpump.2.name=必须放在地上. tooltip.tile.mbf.0.name=巨型工业高炉的控制器;大小(宽x高x长):15x20x15(中空);控制器:第3层中间中心;内部13x18x13加热线圈(中空);外部15x18x1硼硅酸盐玻璃;玻璃将限制能量输入等级;1个以上的输入仓/总线(任意机械方块);1个以上的输出仓/总线(任意机械方块);1个以上的能源仓(任意机械方块);1x维护仓(任意机械方块);13x13消音仓(顶部正中);外部15x15的防热机械方块(第20层);1个输出仓以回收CO2/CO/SO2(可选,任何顶层机械方块);回收比例取决于消音仓等级;底层为隔热机械方块;自配方的最小温度起,温度每高出900K会减少5%的能耗(使用乘法);自配方的最小温度起,每高出1800K的温度将允许进行一次无损超频;无损超频将减少配方加工时间至25%并提升功率至400% tooltip.tile.mbf.1.name=污染每秒 tooltip.tile.mvf.0.name=巨型真空冷冻机的控制器;超级冷却热金属锭和单元;大小(宽x高x长):15x15x15(中空);控制器:(正面中心);1个输入总线(任意机械方块);1个输出总线(任意机械方块);1个维护仓(任意机械方块);1个能源仓(任意机械方块);其余为的防冻机械方块 -tooltip.tile.bvat.0.name=发酵锅的控制器;大小(宽x高x长):5x4x5;底部和顶部是不锈钢外壳;底部和顶部必须包含:;1个维护仓,1个输出仓;1个或以上的输入仓,1个或以上的输入仓,0-1个辐射输入总线;两个中间层必须由玻璃构成,中空;玻璃可以是任何玻璃,例如,匠魂的通透玻璃;一些配方需要更高级的玻璃;为了最大限度地提高效率,请保持输出仓始终为半满! -tooltip.tile.windmill.0.name=由动能驱动的原始磨床;大小(宽x高x长):7x12x7;第1层7x7砖块,角落为空气方块,控制器在正面中心;第2-5层:5x5硬化粘土,角落为空气方块,可以包含一扇门,中空;墙必须至少包含一个发射器;第六层:5x5木板.角落填满,中空;第7层:7x7木板.角落为空气方块,中空;第8层:7x7木板.角落为空气方块,中空;正面中心必须是原始动力学转轴箱;第9层:7x7木板.角落为空气方块,中空;第10层:5x5木板.角落填满,中空;第11层:3x3木板.角落填满,中空;第12层:1x1木板;需要在动力学转轴箱内有转子才能运行;在控制器中输入物品;输出物品将出现在发射器中;在风力较大的地区,速度更快(像IC2风车一样) -tooltip.tile.lesu.0.name=用于GT2-风格的L.E.S.U.的控制器模块;尺寸:任意 -tooltip.tile.lesu.1.name=储存每LESU外壳: -tooltip.tile.lesu.2.name=输出EU:LESU外壳数量;输入EU:输出EU的下一个电压级;输入/输出安培可通过GUI中的4个编程电路进行配置;输出端有一个点. +tooltip.tile.bvat.0.name=生物培养缸的控制器;大小(宽x高x长):5x4x5;底部和顶部是洁净不锈钢机械方块;底部和顶部必须包含:;1个维护仓,1个输出仓;1个或以上的输入仓,1个或以上的输入仓,0-1个辐射输入总线;中间两层必须由玻璃构组成,中空;玻璃可以是任何玻璃,例如,匠魂的通透玻璃;一些配方需要更高级的玻璃;为了最大限度地提高效率,请保持输出仓始终为半满! +tooltip.tile.windmill.0.name=由动能驱动的原始磨床;大小(宽x高x长):7x12x7;第1层7x7砖块,角落空缺,控制器在正面中心;第2-5层:5x5硬化粘土,角落空缺,可以包含一扇门,中空;墙必须至少包含一个发射器;第六层:5x5木板.角落填充,中空;第7层:7x7木板.角落空缺,中空;第8层:7x7木板.角落空缺,中空;正面中心必须是原始动力学轴箱;第9层:7x7木板.角落空缺,中空;第10层:5x5木板.角落填充,中空;第11层:3x3木板.角落填充,中空;第12层:1x1木板;需要在动力学轴箱内有转子才能运行;在控制器中输入物品;输出物品将出现在发射器中;在风力较大的地区,速度更快(像IC2风机一样) +tooltip.tile.lesu.0.name=用于GT2风格的L.E.S.U.的控制器模块;尺寸:任意 +tooltip.tile.lesu.1.name=储存每LESU机械方块: +tooltip.tile.lesu.2.name=输出EU:LESU机械方块数量; 输入EU:输出EU的下一电压等级;输入/输出安培可通过GUI中的4个编程电路进行调整;输出端只有一个点. tooltip.tile.lesu.3.name=只允许一个控制器,不允许共享墙壁! -tooltip.tile.manualtravo.0.name=手动变压器的控制器;可在4种不同的模式下运行:;模式1:控制器内放入编程电路0:直接升压;模式2:控制器内放入编程电路1:直接降压;模式3:控制器内放入编程电路2:Tapped升压;模式4:控制器内放入编程电路3:Tapped降压;对于直接模式:3xHx3;底部包含至少1个能量仓;每1级变压器需要一层变压器线圈方块;变压器线圈方块中间是镍锌铁氧体块;顶部包含至少1个发电机仓;维护仓可放置在任何地方;Tapped模式暂不可用.(Tapped模式为在变压时获得多个电压)(译注) +tooltip.tile.manualtravo.0.name=手动变压器的控制器;可在4种不同的模式下运行:;模式1:控制器内放入编程电路0:直接升压;模式2:控制器内放入编程电路1:直接降压;模式3:控制器内放入编程电路2:Tapped升压;模式4:控制器内放入编程电路3:Tapped降压;对于直接模式:3xHx3;底层至少含有一个能源仓;每1级变压器需要一层变压器线圈方块;变压器线圈方块中间是镍锌铁氧体块;顶部包含至少1个发电机仓;维护仓可放置在任何地方;Tapped模式暂不可用.(Tapped模式为在变压时获得多个电压)(译注) tooltip.tile.tiereddsc.0.name=电压: tooltip.tile.tiereddsc.1.name=输入安培: tooltip.tile.tiereddsc.2.name=输出安培: tooltip.tile.tiereddsc.3.name=容量: -tooltip.tile.diode.0.name=一个简单的二极管,只允许能量流向一个方向。 +tooltip.tile.diode.0.name=一个简单的二极管,只允许能量流向一个方向. tooltip.tile.energydistributor.0.name=将电流分为多个面 -tooltip.tile.biolab.0.name=生物实验室,一个多用途生物工程站 +tooltip.tile.biolab.0.name=生物实验室,一个多用途生物工程站 tooltip.tile.radhatch.0.name=多方块放射性物质室 tooltip.tile.radhatch.1.name=使用螺丝刀设置容量等级 tooltip.tile.radhatch.2.name=材质: @@ -126,7 +126,7 @@ tooltip.tile.radhatch.6.name=t tooltip.tile.radhatch.7.name=s tooltip.tile.radhatch.8.name=m tooltip.tile.radhatch.9.name=h -tooltip.tile.acidgen.0.name=酸发生器 +tooltip.tile.acidgen.0.name=酸性发电机 tooltip.tile.acidgen.1.name=从化学能势中产生能量. nei.biovat.0.name=需要玻璃等级: nei.biovat.1.name=确切需要 -- cgit From cd83af0ce1e38dd75d9661ae1ae708f990c179e3 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 23 Feb 2019 16:04:11 +0100 Subject: localation update, does somewhat work... Former-commit-id: 6be56b48c05ff34b0886b3e994a499959ce1ba17 --- .../ClientEventHandler/ClientEventHandler.java | 10 +- .../bartworks/client/gui/GT_GUIContainer_LESU.java | 5 +- .../bartworks/common/items/BW_ItemBlocks.java | 6 +- .../bartworks/common/items/BW_SimpleWindMeter.java | 11 +- .../bartworks/common/items/BW_Stonage_Rotors.java | 8 +- .../bartworks/common/items/Circuit_Programmer.java | 5 +- .../common/items/GT_Destructopack_Item.java | 3 +- .../bartworks/common/items/GT_Rockcutter_Item.java | 5 +- .../bartworks/common/items/GT_Teslastaff_Item.java | 5 +- .../bartworks/common/items/LabModule.java | 3 +- .../bartworks/common/items/LabParts.java | 19 +-- .../bartworks/common/items/SimpleSubItemClass.java | 3 +- .../bartworks/common/loaders/BioRecipeLoader.java | 9 +- .../bartworks/common/loaders/ItemRegistry.java | 19 +-- .../bartworks/common/loaders/LoaderRegistry.java | 2 - .../bartworks/common/loaders/RecipeLoader.java | 7 +- .../classic/BW_TileEntity_HeatedWaterPump.java | 3 +- .../tileentities/multis/GT_TileEntity_BioVat.java | 20 ++- .../tileentities/multis/GT_TileEntity_LESU.java | 27 ++-- .../multis/GT_TileEntity_ManualTrafo.java | 25 ++-- .../multis/GT_TileEntity_Windmill.java | 28 ++-- .../mega/GT_TileEntity_MegaBlastFurnace.java | 32 ++--- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 19 ++- .../tiered/GT_MetaTileEntity_AcidGenerator.java | 7 +- .../tiered/GT_MetaTileEntity_BioLab.java | 17 ++- .../tiered/GT_MetaTileEntity_Diode.java | 7 +- .../GT_MetaTileEntity_EnergyDistributor.java | 7 +- .../tiered/GT_MetaTileEntity_RadioHatch.java | 9 +- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 5 +- .../bartimaeusnek/bartworks/util/BWRecipes.java | 7 +- .../resources/assets/bartworks/lang/de_DE.lang | 143 ++++++++++++++++++++ .../resources/assets/bartworks/lang/en_US.lang | 93 ++++++++++++- .../resources/assets/bartworks/lang/fr_FR.lang | 144 +++++++++++++++++++++ 33 files changed, 544 insertions(+), 169 deletions(-) create mode 100644 src/main/resources/assets/bartworks/lang/de_DE.lang create mode 100644 src/main/resources/assets/bartworks/lang/fr_FR.lang diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java index 377632c4ba..79f3cf387e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java @@ -33,6 +33,7 @@ import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.util.StatCollector; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import java.util.HashMap; @@ -54,9 +55,14 @@ public class ClientEventHandler { final HashMap GLASSMAP = BioVatLogicAdder.BioVatGlass.getGlassMap(); if (GLASSMAP.containsKey(PAIR)) { int tier = GLASSMAP.get(PAIR); - event.toolTip.add("Glass-Tier: " + BW_Util.getColorForTier(tier) + GT_Values.VN[tier] + ChatColorHelper.RESET); + event.toolTip.add( + StatCollector.translateToLocal("tooltip.glas.0.name")+ + " " + + BW_Util.getColorForTier(tier) + GT_Values.VN[tier] + ChatColorHelper.RESET); } else if (BLOCK.getMaterial().equals(Material.glass)) { - event.toolTip.add("Glass-Tier: " + BW_Util.getColorForTier(3) + GT_Values.VN[3] + ChatColorHelper.RESET); + event.toolTip.add(StatCollector.translateToLocal("tooltip.glas.0.name")+ + " " + + BW_Util.getColorForTier(3) + GT_Values.VN[3] + ChatColorHelper.RESET); } } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java index 8b96ba44fb..336c9fab92 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -33,6 +33,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; import java.awt.*; @@ -61,10 +62,10 @@ public class GT_GUIContainer_LESU extends GT_GUIContainer { this.drawString(this.fontRendererObj, "EU/t OUT: " + String.valueOf(this.mContainer.mOutput), 11, 40, 16448255); this.drawString(this.fontRendererObj, "AMP/t IN/OUT: " + String.valueOf(c.getBaseMetaTileEntity().getInputAmperage()), 11, 48, 16448255); if (c.maxEUStore() >= Long.MAX_VALUE - 1) { - this.drawString(this.fontRendererObj, "Maximum Capacity!", 11, 56, Color.YELLOW.getRGB()); + this.drawString(this.fontRendererObj, StatCollector.translateToLocal("tooltip.LESU.0.name"), 11, 56, Color.YELLOW.getRGB()); } if (!this.c.getBaseMetaTileEntity().isActive()) { - this.drawString(this.fontRendererObj, "Multiple Controllers!", 11, 56, Color.RED.getRGB()); + this.drawString(this.fontRendererObj, StatCollector.translateToLocal("tooltip.LESU.1.name"), 11, 56, Color.RED.getRGB()); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index 8386ebb857..c9286aec26 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -37,6 +37,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; import java.util.List; @@ -66,7 +67,7 @@ public class BW_ItemBlocks extends ItemBlock { @SideOnly(Side.CLIENT) public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { if (this.field_150939_a instanceof BW_GlasBlocks) - aList.add("Glass-Tier: " + BW_Util.getColorForTier(BW_Util.getTierFromGlasMeta(aStack.getItemDamage())) + GT_Values.VN[BW_Util.getTierFromGlasMeta(aStack.getItemDamage())]); + aList.add(StatCollector.translateToLocal("tooltip.glas.0.name") +" " + BW_Util.getColorForTier(BW_Util.getTierFromGlasMeta(aStack.getItemDamage())) + GT_Values.VN[BW_Util.getTierFromGlasMeta(aStack.getItemDamage())]); if (this.field_150939_a instanceof ITileAddsInformation) { for (int i = 0; i < ((ITileAddsInformation) this.field_150939_a).getInfoData().length; i++) { aList.add(((ITileAddsInformation) this.field_150939_a).getInfoData()[i]); @@ -75,7 +76,8 @@ public class BW_ItemBlocks extends ItemBlock { aList.add(this.mNoMobsToolTip); if (!(this.field_150939_a instanceof ITileEntityProvider)) aList.add(this.mNoTileEntityToolTip); - aList.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); + + aList.add(StatCollector.translateToLocal("tooltip.bw.0.name")+ ChatColorHelper.DARKGREEN + " BartWorks"); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java index d4184dfc08..66ff1725de 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java @@ -32,6 +32,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentText; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; @@ -55,9 +56,9 @@ public class BW_SimpleWindMeter extends Item { @Override public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean p_77624_4_) { super.addInformation(itemStack, entityPlayer, list, p_77624_4_); - list.add("A simple Windmeter to choose a place for the Windmill."); - list.add("Uses left: " + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); - list.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); + list.add(StatCollector.translateToLocal("tooltip.windmeter.0.name")); + list.add(StatCollector.translateToLocal("tooltip.windmeter.1.name")+" " + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); + list.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } @Override @@ -66,8 +67,8 @@ public class BW_SimpleWindMeter extends Item { return itemStack; float windStrength = (float) WorldData.get(world).windSim.getWindAt(entityPlayer.posY); - String windS = windStrength < 1f ? "non existant" : windStrength < 10f ? "pretty low" : windStrength < 20f ? "common" : windStrength < 30f ? "rather strong" : windStrength < 50f ? "very strong" : "too strong"; - entityPlayer.addChatMessage(new ChatComponentText("The wind here seems to be " + windS + ".")); + String windS = windStrength < 1f ? StatCollector.translateToLocal("tooltip.windmeter.2.name") : windStrength < 10f ? StatCollector.translateToLocal("tooltip.windmeter.3.name") : windStrength < 20f ? StatCollector.translateToLocal("tooltip.windmeter.4.name") : windStrength < 30f ? StatCollector.translateToLocal("tooltip.windmeter.5.name") : windStrength < 50f ? StatCollector.translateToLocal("tooltip.windmeter.6.name") : StatCollector.translateToLocal("tooltip.windmeter.7.name"); + entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip.windmeter.8.name")+" " + windS + ".")); itemStack.damageItem(1, entityPlayer); return itemStack; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index cbe4ce0b23..71d9b0886f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -76,13 +76,13 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { } else if (Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator) { type = WIND; } - info.add("Diameter: " + this.DiaMinMax[0]); - info.add("Durability: " + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); - info.add("Efficiency: " + this.eff); + info.add(StatCollector.translateToLocal("tooltip.rotor.0.name")+" " + this.DiaMinMax[0]); + info.add(StatCollector.translateToLocal("tooltip.rotor.1.name")+" " + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); + info.add(StatCollector.translateToLocal("tooltip.rotor.2.name")+" " + this.eff); if (type != null) { info.add(StatCollector.translateToLocal(("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type)))); } - info.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); + info.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index 6f8fe09229..621394d199 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -35,6 +35,7 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; @@ -53,8 +54,8 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); if (aStack != null && aStack.getTagCompound() != null) - aList.add("Has Circuit inside? " + (aStack.getTagCompound().getBoolean("HasChip") ? "Yes" : "No")); - aList.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(StatCollector.translateToLocal("tooltip.cp.0.name")+" " + (aStack.getTagCompound().getBoolean("HasChip") ? StatCollector.translateToLocal("tooltip.bw.yes.name") : StatCollector.translateToLocal("tooltip.bw.no.name"))); + aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java index 04fa57efdd..9d06a3e752 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -30,6 +30,7 @@ import gregtech.api.items.GT_Generic_Item; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; @@ -47,7 +48,7 @@ public class GT_Destructopack_Item extends GT_Generic_Item { @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); - aList.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index 38873cd04a..bcca88531f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -43,6 +43,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemTool; import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.HashSet; @@ -74,8 +75,8 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { } public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { - aList.add("Tier: " + GT_Values.VN[this.mTier]); - aList.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(StatCollector.translateToLocal("tooltip.bw.tier.name") +" " + GT_Values.VN[this.mTier]); + aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } public void onUpdate(ItemStack aStack, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java index de59f9cec0..4a25b7e951 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -39,6 +39,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemTool; import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; import java.util.List; import java.util.Set; @@ -65,8 +66,8 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { @Override public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { - aList.add("No warranty!"); - aList.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(StatCollector.translateToLocal("tooltip.teslastaff.0.name")); + aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } public boolean hitEntity(ItemStack aStack, EntityLivingBase aTarget, EntityLivingBase aPlayer) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java index 9f18e6c457..640fca0014 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; import java.util.List; @@ -40,7 +41,7 @@ public class LabModule extends SimpleSubItemClass { @Override public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { - aList.add("A Module used to change the BioLab's working Mode"); + aList.add(StatCollector.translateToLocal("tooltip.labmodule.0.name")); super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java index 67c1222a28..4ae906c96e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -31,6 +31,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; import java.util.List; @@ -78,19 +79,19 @@ public class LabParts extends SimpleSubItemClass { if (itemStack.getTagCompound() == null) { switch (itemStack.getItemDamage()) { case 0: - list.add("An empty Sterilized Petri Dish."); + list.add(StatCollector.translateToLocal("tooltip.labparts.0.name")); break; case 1: - list.add("An empty DNA Flask."); + list.add(StatCollector.translateToLocal("tooltip.labparts.1.name")); break; case 2: - list.add("An empty Plasmid Cell."); + list.add(StatCollector.translateToLocal("tooltip.labparts.2.name")); break; case 3: - list.add("A special washing power for Bio Engineering."); + list.add(StatCollector.translateToLocal("tooltip.labparts.3.name")); break; case 4: - list.add("A powder for the separation of DNA by electrophoresis."); + list.add(StatCollector.translateToLocal("tooltip.labparts.4.name")); break; default: break; @@ -102,16 +103,16 @@ public class LabParts extends SimpleSubItemClass { switch (itemStack.getItemDamage()) { case 0: - list.add("A Petri Dish containing: " + itemStack.getTagCompound().getString("Name")); + list.add(StatCollector.translateToLocal("tooltip.labparts.5.name")+" " + itemStack.getTagCompound().getString("Name")); if (!itemStack.getTagCompound().getBoolean("Breedable")) { - list.add("This is a weak culture, it can not be bred in the Bacterial Vat"); + list.add(StatCollector.translateToLocal("tooltip.labparts.6.name")); } break; case 1: - list.add("A DNA Flask containing: " + itemStack.getTagCompound().getString("Name")); + list.add(StatCollector.translateToLocal("tooltip.labparts.7.name")+" " + itemStack.getTagCompound().getString("Name")); break; case 2: - list.add("A Plasmid Cell containing: " + itemStack.getTagCompound().getString("Name")); + list.add(StatCollector.translateToLocal("tooltip.labparts.8.name")+" "+ itemStack.getTagCompound().getString("Name")); break; default: break; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java index d2c2e17478..c4abbe95b9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -32,6 +32,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; import java.util.List; @@ -58,7 +59,7 @@ public class SimpleSubItemClass extends Item { @Override public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); - aList.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index c0480e2970..00546d6453 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -40,6 +40,7 @@ import gregtech.api.util.GT_Utility; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; @@ -131,7 +132,7 @@ public class BioRecipeLoader extends RecipeLoader { } ); - if (Loader.isModLoaded("croploadcore")) + if (Loader.isModLoaded("croploadcore") && OreDictionary.getOres("cropVine").size() > 1) for (int i = 0; i < OreDictionary.getOres("cropVine").size(); i++) { GT_Values.RA.addExtractorRecipe(OreDictionary.getOres("cropVine").get(i).splitStack(12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3)); } @@ -157,8 +158,8 @@ public class BioRecipeLoader extends RecipeLoader { Materials[] circuits = {Materials.Advanced, Materials.Data, Materials.Elite, Materials.Master, Materials.Ultimate, Materials.Superconductor}; for (int i = 3; i < GT_Values.VN.length; i++) { //12625 - BioLab[(i - 3)] = new GT_MetaTileEntity_BioLab(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i, GT_Values.VN[i] + " Bio Lab", GT_Values.VN[i] + " Bio Lab", i, "The BioLab, a Multi-Use Bioengineering Station").getStackForm(1L); - RadioHatch[(i - 3)] = new GT_MetaTileEntity_RadioHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i, GT_Values.VN[i] + " Radio Hatch", GT_Values.VN[i] + " Radio Hatch", i).getStackForm(1L); + BioLab[(i - 3)] = new GT_MetaTileEntity_BioLab(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i, "bw.biolab"+GT_Values.VN[i], GT_Values.VN[i] + " "+StatCollector.translateToLocal("tile.biolab.name"), i).getStackForm(1L); + RadioHatch[(i - 3)] = new GT_MetaTileEntity_RadioHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i ,"bw.radiohatch"+ GT_Values.VN[i], GT_Values.VN[i] + " "+StatCollector.translateToLocal("tile.radiohatch.name"), i).getStackForm(1L); try { ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); GT_ModHandler.addCraftingRecipe( @@ -194,7 +195,7 @@ public class BioRecipeLoader extends RecipeLoader { } } GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_BioVat(ConfigHandler.IDOffset + GT_Values.VN.length * 7, "BioVat", "BioVat").getStackForm(1L), + new GT_TileEntity_BioVat(ConfigHandler.IDOffset + GT_Values.VN.length * 7, "bw.biovat", StatCollector.translateToLocal("tile.biovat.name")).getStackForm(1L), RecipeLoader.BITSD, new Object[]{ "GCG", diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 5cf42736b6..bdfe5c9850 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -47,6 +47,7 @@ import net.minecraft.block.material.Material; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; import static com.github.bartimaeusnek.bartworks.MainMod.BWT; import static com.github.bartimaeusnek.bartworks.MainMod.GT2; @@ -146,20 +147,20 @@ public class ItemRegistry { GameRegistry.registerItem(WINDMETER, "BW_SimpleWindMeter"); for (int i = 0; i < GT_Values.VN.length; i++) { - ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "Cable Diode 2A " + GT_Values.VN[i], "Cable Diode 2A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "Cable Diode 4A " + GT_Values.VN[i], "Cable Diode 4A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.diode8A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, "Cable Diode 8A " + GT_Values.VN[i], "Cable Diode 8A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.diode12A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, "Cable Diode 12A " + GT_Values.VN[i], "Cable Diode 12A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.diode16A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, "Cable Diode 16A " + GT_Values.VN[i], "Cable Diode 16A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.energyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset + 1 + i, "Energy Distributor " + GT_Values.VN[i], "Energy Distributor " + GT_Values.VN[i], i, "Splits Amperage into several Sides").getStackForm(1L); + ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "diode"+"2A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name")+" 2A " + GT_Values.VN[i], i).getStackForm(1L); + ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "diode"+"4A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name")+" 4A " + GT_Values.VN[i], i).getStackForm(1L); + ItemRegistry.diode8A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, "diode"+"8A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name")+" 8A " + GT_Values.VN[i], i).getStackForm(1L); + ItemRegistry.diode12A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, "diode"+"12A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name")+" 12A " + GT_Values.VN[i], i).getStackForm(1L); + ItemRegistry.diode16A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, "diode"+"16A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name")+" 16A " + GT_Values.VN[i], i).getStackForm(1L); + ItemRegistry.energyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset + 1 + i, "energydistributor" + GT_Values.VN[i], StatCollector.translateToLocal("tile.energydistributor.name")+ " " + GT_Values.VN[i], i).getStackForm(1L); } for (int i = 0; i < 3; i++) { - ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "Acid Generator " + GT_Values.VN[i + 2], "Acid Generator " + GT_Values.VN[i + 2], i + 2, new String[]{"An Acid Generator", "Creates Power from Chemical Energy Potentials."}).getStackForm(1); + ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "acidgenerator"+GT_Values.VN[i + 2], StatCollector.translateToLocal("tile.acidgenerator.name")+" " + GT_Values.VN[i + 2], i + 2).getStackForm(1); } dehp = new GT_TileEntity_DEHP(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump").getStackForm(1L); - megaMachines[0] = new GT_TileEntity_MegaBlastFurnace(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, "MegaBlastFurnace", "Mega Blast Furnace").getStackForm(1L); - megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, "MegaVaccumFreezer", "Mega Vaccum Freezer").getStackForm(1L); + megaMachines[0] = new GT_TileEntity_MegaBlastFurnace(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, "MegaBlastFurnace", StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L); + megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, "MegaVacuumFreezer", StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java index 93a4fc75c8..9ea0f90050 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java @@ -22,8 +22,6 @@ package com.github.bartimaeusnek.bartworks.common.loaders; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; - public class LoaderRegistry implements Runnable { @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index c381b92587..7e4571e9c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -37,6 +37,7 @@ import ic2.core.Ic2Items; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; @@ -89,7 +90,7 @@ public class RecipeLoader implements Runnable { */ GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_LESU(ConfigHandler.IDOffset, "LESU", "LESU").getStackForm(1L), + new GT_TileEntity_LESU(ConfigHandler.IDOffset, "LESU", "L.E.S.U.").getStackForm(1L), RecipeLoader.BITSD, new Object[]{ "CDC", @@ -465,7 +466,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "Manual Travo", "Manual Travo").getStackForm(1L), + new GT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "bw.manualtrafo", StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L), RecipeLoader.BITSD, new Object[]{ "SCS", @@ -481,7 +482,7 @@ public class RecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), Materials.Aluminium.getPlates(1), ItemList.Circuit_Board_Plastic.get(1L), ItemList.Battery_RE_LV_Lithium.get(1L)}, Materials.SolderingAlloy.getMolten(288L), new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER), 600, (int) (GT_Values.V[2] - (GT_Values.V[2] / 10))); GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_Windmill(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 2, "Windmill", "Windmill").getStackForm(1L), + new GT_TileEntity_Windmill(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 2, "bw.windmill", StatCollector.translateToLocal("tile.bw.windmill.name")).getStackForm(1L), RecipeLoader.BITSD, new Object[]{ "BHB", diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index ed4fe3ce78..cca50bce6a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -35,6 +35,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.*; @@ -267,7 +268,7 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ISidedI @Override public String[] getInfoData() { - return new String[]{"Produces " + ConfigHandler.mbWaterperSec + "L/s Water when fueled.", "Must be placed on the Ground."}; + return new String[]{StatCollector.translateToLocal("tooltip.tile.waterpump.0.name")+" " + ConfigHandler.mbWaterperSec + StatCollector.translateToLocal("tooltip.tile.waterpump.1.name"), StatCollector.translateToLocal("tooltip.tile.waterpump.2.name")}; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 41d8373602..d31cd53c1e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -48,6 +48,7 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.common.util.ForgeDirection; @@ -604,18 +605,13 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @Override public String[] getDescription() { - return new String[]{ - "Controller Block for the Bio Vat", - "LxHxD: 5x4x5", - "Bottom and top are Stainless Steel Casings", - "Bottom and top must contain:", - "1x Maintenance, 1x Output Hatch, 1 or more Input Hatches, 1 or more Input Buses, 0-1 Radiation Input Bus", - "The two middle layers must be build out of glass, hollow", - "The glass can be any glass, i.e. Tinkers Construct Clear Glass", - "Some Recipes need more advanced Glass Types", - "For maximum efficiency boost keep the Output Hatch always half filled!", - "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" - }; + String[] dsc = StatCollector.translateToLocal("tooltip.tile.bvat.0.name").split(";"); + String[] fdsc = new String[dsc.length+1]; + for (int i = 0; i < dsc.length; i++) { + fdsc[i]=dsc[i]; + fdsc[dsc.length]=StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; + } + return fdsc; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index b3504b7640..bef87bc3e6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -48,8 +48,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import java.util.ArrayList; + public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @@ -152,17 +155,19 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public String[] getDescription() { - return new String[]{ - "Controller Block for the GT2-Styled L.E.S.U.", - "Size: ANY", - "Storage per LESU Casing: " + ConfigHandler.energyPerCell + "EU", - "Output EU: LESU Casings amount" + - "Input EU: Next Voltage Tier to Output EU", - "Input/Output Amps can be configured via 4 Circuits in GUI", - "Output Side has a dot on it.", - ChatColorHelper.RED + "Only one Controller allowed, no Wallsharing!", - "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" - }; + ArrayList e = new ArrayList<>(); + String[] dsc = StatCollector.translateToLocal("tooltip.tile.lesu.0.name").split(";"); + for (int i = 0; i < dsc.length; i++) { + e.add(dsc[i]); + } + e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name")+" " + ConfigHandler.energyPerCell + "EU"); + dsc = StatCollector.translateToLocal("tooltip.tile.lesu.2.name").split(";"); + for (int i = 0; i < dsc.length; i++) { + e.add(dsc[i]); + } + e.add(ChatColorHelper.RED +StatCollector.translateToLocal("tooltip.tile.lesu.3.name")); + e.add(StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"); + return e.toArray(new String[0]); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index 2f61696635..0cf9d1f2df 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -37,6 +37,7 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import static gregtech.api.enums.GT_Values.V; @@ -380,23 +381,13 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase @Override public String[] getDescription() { - return new String[]{ - "Controller Block for the Manual Trafo", - //"Operates in 4 Differents Modes:", - "Operates currently in 2 Differents Modes:", - "Mode 1: Circuit 0 in controller: Direct-Upstep", - "Mode 2: Circuit 1 in controller: Direct-Downstep", - //"Mode 3: Circuit 2 in controller: Tapped-Upstep", - //"Mode 4: Circuit 3 in controller: Tapped-Downstep", - "For direct Modes: 3xHx3", - "Base Contains at least 1 Energy Hatch", - "1 Layer of Dynamo Coils for each Tier transformed", - "Middle of Dynamo Coils needs to be a NickelFerrite Core", - "Top Contains at least 1 Dynamo Hatch", - "Maintenance Hatch can be placed anywhere", - "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" - //"Tapped Mode is disabled." - }; + String[] dsc = StatCollector.translateToLocal("tooltip.tile.manualtravo.0.name").split(";"); + String[] fdsc = new String[dsc.length+1]; + for (int i = 0; i < dsc.length; i++) { + fdsc[i]=dsc[i]; + fdsc[dsc.length]=StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; + } + return fdsc; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index bf91333854..5d601ed32c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -54,6 +54,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; @@ -555,26 +556,13 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @Override public String[] getDescription() { - return new String[]{ - "A primitive Grinder powered by Kinetic energy.", - "WxHxL: 7x12x7", - "Layer 1: 7x7 Bricks, corners are air, controller at front centered.", - "Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,", - "hollow, Wall must contain at least one Dispenser", - "Layer 6: 5x5 Wood Planks. Corners are filled, hollow.", - "Layer 7: 7x7 Wood Planks. Corners are air, hollow.", - "Layer 8: 7x7 Wood Planks. Corners are air, hollow,", - "front centered must be a Primitive Kinetic Shaftbox", - "Layer 9: 7x7 Wood Planks. Corners are air, hollow.", - "Layer 10: 5x5 Wood Planks. Corners are filled, hollow.", - "Layer 11: 3x3 Wood Planks. Corners are filled, hollow.", - "Layer 12: 1x1 Wood Plank.", - "Needs a Wind Mill Rotor in the Shaftbox to operate", - "Input items in Controller", - "Output items will appear in the dispensers", - "It is faster in regions with more wind (like IC2 Windmills)", - "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" - }; + String[] dsc = StatCollector.translateToLocal("tooltip.tile.windmill.0.name").split(";"); + String[] fdsc = new String[dsc.length+1]; + for (int i = 0; i < dsc.length; i++) { + fdsc[i]=dsc[i]; + fdsc[dsc.length]=StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; + } + return fdsc; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 04f8f0f7be..8f035a94ad 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -35,10 +36,12 @@ import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; @@ -59,26 +62,15 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl } public String[] getDescription() { - return new String[]{"Controller Block for the Blast Furnace", - "Size(WxHxD): 15x20x15 (Hollow)", - "Controller 2nd Layer Middle Center", - "Inner 14x18x14 Heating Coils (Hollow)", - "Outer 15x18x15 Boronsilicate Glass", - "The glass limits the the Energy Input tier", - "1+ Input Hatch/Bus (Any casing)", - "1+ Output Hatch/Bus (Any casing)", - "1+ Energy Hatch (Any casing)", - "1x Maintenance Hatch (Any casing)", - "14x14 Muffler Hatches (Top middle)", - "Heat Proof Machine Casings for the outer 15x15 (Layer 20)", - "1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing),", - " Recovery scales with Muffler Hatch tier", - "Heat Proof Machine Casings for Base", - "Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively)", - "Each 1800K over the min. Heat Capacity allows for one upgraded overclock", - "Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%", - "Causes maximal" + 20 * this.getPollutionPerTick((ItemStack) null) + " Pollution per second" - }; + String[] dsc = StatCollector.translateToLocal("tooltip.tile.mbf.0.name").split(";"); + String tmp = dsc[dsc.length-1]; + dsc[dsc.length-1]=tmp+" "+Integer.toString(20 * this.getPollutionPerTick((ItemStack) null))+" "+StatCollector.translateToLocal("tooltip.tile.mbf.1.name"); + String[] fdsc = new String[dsc.length+1]; + for (int i = 0; i < dsc.length; i++) { + fdsc[i]=dsc[i]; + fdsc[dsc.length]=StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; + } + return fdsc; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 4976db98c9..5b8ce4459b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -32,6 +33,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_VacuumFreezer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; import java.util.ArrayList; import java.util.HashSet; @@ -49,16 +51,13 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre } public String[] getDescription() { - return new String[]{ - "Controller Block for the Mega Vacuum Freezer", - "Super cools hot ingots and cells", - "Size(WxHxD): 15x15x15 (Hollow), Controller (Front centered)", - "1x Input Bus (Any casing)", - "1x Output Bus (Any casing)", - "1x Maintenance Hatch (Any casing)", - "1x Energy Hatch (Any casing)", - "Frost Proof Machine Casings for the rest" - }; + String[] dsc = StatCollector.translateToLocal("tooltip.tile.mvf.0.name").split(";"); + String[] fdsc = new String[dsc.length+1]; + for (int i = 0; i < dsc.length; i++) { + fdsc[i]=dsc[i]; + fdsc[dsc.length]=StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; + } + return fdsc; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index 2b5df0d3a2..d749ce3c54 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -32,11 +32,12 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; +import net.minecraft.util.StatCollector; public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGenerator { - public GT_MetaTileEntity_AcidGenerator(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, ITexture... aTextures) { - super(aID, aName, aNameRegional, aTier, aDescription, aTextures); + public GT_MetaTileEntity_AcidGenerator(int aID, String aName, String aNameRegional, int aTier, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, new String[]{}, aTextures); } public GT_MetaTileEntity_AcidGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { @@ -109,6 +110,6 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Efficiency: " + ChatColorHelper.YELLOW + getEfficiency(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks"}; + return new String[]{StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name")+" "+ ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.rotor.2.name")+" "+ ChatColorHelper.YELLOW + getEfficiency(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name")+" "+ ChatColorHelper.YELLOW + maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index b2e34902c0..f75afd7d4c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -45,6 +45,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; @@ -52,21 +53,17 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { private static final String MGUINAME = "BW.GUI.BioLab.png"; - public GT_MetaTileEntity_BioLab(int aID, String aName, String aNameRegional, int aTier, String aDescription) { - super(aID, aName, aNameRegional, aTier, 1, aDescription, 6, 2, MGUINAME, null, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")/*this is topactive*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")/*this is top*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM"))); + public GT_MetaTileEntity_BioLab(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 1, null, 6, 2, MGUINAME, null, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")/*this is topactive*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")/*this is top*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM"))); } public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, String aNEIName) { super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2, MGUINAME, aNEIName); } - public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String[] aDescription, ITexture[][][] aTextures, String aNEIName) { - super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2, MGUINAME, aNEIName); - } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_MetaTileEntity_BioLab(this.mName, this.mTier, this.mAmperage, this.mDescriptionArray, this.mTextures, this.mNEIName); + return new GT_MetaTileEntity_BioLab(this.mName, this.mTier, this.mAmperage, this.mDescription, this.mTextures, this.mNEIName); } @Override @@ -268,4 +265,10 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { return bc; return culture; } + + @Override + @SuppressWarnings("deprecation") + public String[] getDescription() { + return new String[]{ StatCollector.translateToLocal("tooltip.tile.biolab.0.name"), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index c0c99dab7a..b85e1137fe 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -32,6 +32,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { @@ -39,7 +40,9 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { private long aAmps = 0L; public GT_MetaTileEntity_Diode(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, "A Simple diode that will allow Energy Flow in only one direction."); + super(aID, aName, aNameRegional, aTier, StatCollector.translateToLocal("tooltip.tile.diode.0.name")); + maxAmps = getAmpsfromMeta(aID); + aAmps=maxAmps; } public GT_MetaTileEntity_Diode(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { @@ -114,6 +117,6 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks"}; + return new String[]{mDescription, StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name")+ " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") +" " + ChatColorHelper.YELLOW + maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java index 0dad2c8414..25fad9103e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java @@ -28,11 +28,12 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Transformer; +import net.minecraft.util.StatCollector; public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Transformer { - public GT_MetaTileEntity_EnergyDistributor(int aID, String aName, String aNameRegional, int aTier, String aDescription) { - super(aID, aName, aNameRegional, aTier, aDescription); + public GT_MetaTileEntity_EnergyDistributor(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, null); } public GT_MetaTileEntity_EnergyDistributor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -70,7 +71,7 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{this.mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Amperage IN: " + ChatColorHelper.YELLOW + this.maxAmperesIn(), "Amperage OUT: " + ChatColorHelper.YELLOW + this.maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks"}; + return new String[]{StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name")+ " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name")+ " " + ChatColorHelper.YELLOW + this.maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name")+ " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index ddab78ea3e..6ee28527c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -27,6 +27,7 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -57,7 +58,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { private byte coverage = 0; public GT_MetaTileEntity_RadioHatch(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, new String[]{"Radioactive Item Chamber for Multiblocks", "Capacity: " + (aTier - 2) + " kg" + ((aTier - 2) >= 2 ? "s" : ""), "Use a screwdriver to set the containment level"}); + super(aID, aName, aNameRegional, aTier, 1, new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name")+" " + (aTier - 2) + " " + ((aTier - 2) >= 2 ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") : StatCollector.translateToLocal("tooltip.bw.kg.0.name")), StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}); cap = aTier - 2; } @@ -156,7 +157,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { if (timer % (calcDecayTicks(this.sievert)) == 0) { this.mass--; if (mass == 0) { - material = "Empty"; + material = StatCollector.translateToLocal("tooltip.bw.empty.name"); sievert = 0; } timer = 1; @@ -252,8 +253,8 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @Override public String[] getInfoData() { if (calcDecayTicks(this.sievert) != 0) - return new String[]{"Material: " + material, "Sievert: " + sievert, "Amount: " + mass, "Time (in t/s/m/h) to decay (1kg): " + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert) * 60)) + "t/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 + "s/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 + "m/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 / 60 + "h"}; - else return new String[]{"Material: Empty", "Sievert: 0", "Amount: 0"}; + return new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.2.name")+" "+ material, StatCollector.translateToLocal("tooltip.tile.radhatch.3.name")+" "+ sievert, StatCollector.translateToLocal("tooltip.tile.radhatch.4.name")+" "+mass, StatCollector.translateToLocal("tooltip.tile.radhatch.5.name")+" "+ + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert) * 60)) + StatCollector.translateToLocal("tooltip.tile.radhatch.6.name")+"/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 + StatCollector.translateToLocal("tooltip.tile.radhatch.7.name")+"/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.8.name")+"/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.9.name")}; + else return new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.2.name")+" "+StatCollector.translateToLocal("tooltip.bw.empty.name"), StatCollector.translateToLocal("tooltip.tile.radhatch.3.name")+" "+"0", StatCollector.translateToLocal("tooltip.tile.radhatch.4.name")+" "+"0"}; } public boolean isSimpleMachine() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index ce8aaedd9b..dda5661c69 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -34,6 +34,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.nei.GT_NEI_DefaultHandler; import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; import java.awt.*; @@ -83,7 +84,7 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { int[] tSpecialA = GT_TileEntity_BioVat.specialValueUnpack(tSpecial); - drawText(10, lines[5], "Needs Glas Tier: "+ tSpecialA[0],-16777216); + drawText(10, lines[5], StatCollector.translateToLocal("nei.biovat.0.name")+" " + tSpecialA[0],-16777216); if (tSpecialA[1] == -100 && GT_Mod.gregtechproxy.mLowGravProcessing) { drawText(10, lines[7], this.trans("159", "Needs Low Gravity"), -16777216); @@ -94,7 +95,7 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { } else if (tSpecialA[1] == -400) { drawText(10, lines[7], this.trans("216", "Deprecated Recipe"), -16777216); } else if (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre) || GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost)) { - drawText(10, lines[6],(tSpecialA[2] == 1 ? "Need exactly": "Need minimum") + this.mRecipeMap.mNEISpecialValuePre + tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier + this.mRecipeMap.mNEISpecialValuePost, -16777216); + drawText(10, lines[6],(tSpecialA[2] == 1 ? StatCollector.translateToLocal("nei.biovat.1.name"): StatCollector.translateToLocal("nei.biovat.2.name")) + this.mRecipeMap.mNEISpecialValuePre + tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier + this.mRecipeMap.mNEISpecialValuePost, -16777216); } } else { tSpecial = 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 33b699a87b..2e2760b954 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -42,6 +42,7 @@ import ic2.core.Ic2Items; import ic2.core.item.ItemFluidCell; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; @@ -62,7 +63,7 @@ public class BWRecipes { private final GT_Recipe.GT_Recipe_Map sBiolab = new GT_Recipe.GT_Recipe_Map( new HashSet(150), "bw.recipe.biolab", - "Bio Lab", + StatCollector.translateToLocal("tile.biolab.name"), null, "gregtech:textures/gui/basicmachines/BW.GUI.BioLab", 6, 2, 1, 1, 1, @@ -71,7 +72,7 @@ public class BWRecipes { private final BacteriaVatRecipeMap sBacteriaVat = new BacteriaVatRecipeMap( new HashSet(50), "bw.recipe.BacteriaVat", - "Bacterial Vat", + StatCollector.translateToLocal("tile.biovat.name"), null, "gregtech:textures/gui/basicmachines/Default", 6, 2, 0, 1, 1, @@ -80,7 +81,7 @@ public class BWRecipes { private final BW_Recipe_Map_LiquidFuel sAcidGenFuels = new BW_Recipe_Map_LiquidFuel( new HashSet(10), "bw.fuels.acidgens", - "Acid Generator", + StatCollector.translateToLocal("tile.acidgenerator.name"), null, "gregtech:textures/gui/basicmachines/Default", 1, 1, 1, 1, 1, diff --git a/src/main/resources/assets/bartworks/lang/de_DE.lang b/src/main/resources/assets/bartworks/lang/de_DE.lang new file mode 100644 index 0000000000..df76b57277 --- /dev/null +++ b/src/main/resources/assets/bartworks/lang/de_DE.lang @@ -0,0 +1,143 @@ +itemGroup.GT2C=Gregtech 2 Compat +item.GT_Rockcutter_Item_LV.name=Steinschneider LV +item.GT_Rockcutter_Item_MV.name=Steinschneider MV +item.GT_Rockcutter_Item_HV.name=Steinschneider HV +item.GT_Teslastaff_Item.name=Teslastab +BW_ItemBlocks.0.name=Geätzte Lapis Zelle +BW_ItemBlocks.1.name=Plattierte Lapis Zelle +GT_LESU_CASING.0.name=LESU Hülle + +itemGroup.bartworks=BartWorks Inter Temporal +BW_Machinery_Casings.0.name=Nickel-Zinc Ferrite Block +BW_Machinery_Casings.1.name=Transformer-Wicklungs Block +item.BW_PaperRotor.name=Primitiver Papier Rotor (nur Wind) +item.BW_LeatherRotor.name=Primitiver Leder Rotor (nur Wind) +item.BW_WoolRotor.name=Primitiver Wolle Rotor (nur Wind) +item.BW_CombinedRotor.name=Primitiver Multi-Material Rotor (nur Wind) +tile.BWRotorBlock.0.name=Primitive Kinetische Achsen Box +item.grindstone_top.name=Oberes Teil des Mahlsteins +item.grindstone_bottom.name=Unteres Teil des Mahlsteins +item.completed_grindstone.name=Mahlsteins +item.rotors.leatherParts.name=Leder umspannter Holzrahmen +item.rotors.woolParts.name=Wolle umspannter Holzrahmen +item.rotors.paperParts.name=Papier umspannter Holzrahmen +item.rotors.combinedParts.name=Multi-Material umspannter Holzrahmen +item.BW_SimpleWindMeter.name=Einfaches Wind Meter +tile.BWHeatedWaterPump.0.name=Einfache Stirling Wasser Pumpe +item.BWrawtube.name=Verlängerte Glass Röhre +item.BWmotor.name=Einfache Wärmekraftmaschine + +itemGroup.BioTab=BartWorks BioEngineering +filled.item.petriDish.name=Petri Schale mit einer Kultur +item.petriDish.name=Sterilisierte Petri Schale +item.DNASampleFlask.name=DNA-Proben Flasche +item.PlasmidCell.name=Plasmid-Proben Flasche +item.DetergentPowder.name=Waschmittel +item.Agarose.name=Agarose +item.IncubationModule.name=Incubations Modul +item.Cells.name=Bakterien Zellen +item.PlasmaMembrane.name=Plasma Membran +labModule.item.DNAExtractionModule.name=DNA Extractions Modul +labModule.item.PCRThermoclyclingModule.name=PCR Thermozykler +labModule.item.PlasmidSynthesisModule.name=Plasmid Synthese Modul +labModule.item.TransformationModule.name=Transformations Modul +labModule.item.ClonalCellularSynthesisModule.name=Zelluläres Clone Modul +BW_GlasBlocks.0.name=Borosilicat Glass Block +BW_GlasBlocks.1.name=Nickel Verstärkter Borosilicate Glass Block +BW_GlasBlocks.2.name=Tungsten Verstärkter Borosilicate Glass Block +BW_GlasBlocks.3.name=Chrome Verstärkter Borosilicate Glass Block +BW_GlasBlocks.4.name=Iridium Verstärkter Borosilicate Glass Block +BW_GlasBlocks.5.name=Osmium Verstärkter Borosilicate Glass Block +BW_GlasBlocks.6.name=Farbiger Borosilicate Glass Block (Rot) +BW_GlasBlocks.7.name=Farbiger Borosilicate Glass Block (Grün) +BW_GlasBlocks.8.name=Farbiger Borosilicate Glass Block (Lila) +BW_GlasBlocks.9.name=Farbiger Borosilicate Glass Block (Gelb) +BW_GlasBlocks.10.name=Farbiger Borosilicate Glass Block (Hell Grün) +BW_GlasBlocks.11.name=Farbiger Borosilicate Glass Block (Braun) + +tooltip.glas.0.name=Glass-Tier: +tooltip.LESU.0.name=Maximale Kapazität! +tooltip.LESU.1.name=Mehrere Kontroller! + +tooltip.windmeter.0.name=Ein einfaches Windmeter, um einen Platz für die Windmühle zu finden. +tooltip.windmeter.1.name=Benutzungen: +tooltip.windmeter.2.name=nicht da zu sein. +tooltip.windmeter.3.name=sehr niedrig zu sein. +tooltip.windmeter.4.name=normal zu sein. +tooltip.windmeter.5.name=eher stark zu sein. +tooltip.windmeter.6.name=sehr stark zu sein. +tooltip.windmeter.7.name=zu stark zu sein. +tooltip.windmeter.8.name=Der Wind hier scheint +tooltip.rotor.0.name=Durchmesser: +tooltip.rotor.1.name=Haltbarkeit: +tooltip.rotor.2.name=Effizienz: +tooltip.cp.0.name=Ist ein Chip drinnen? + +tooltip.bw.0.name=Hinzugefügt von +tooltip.bw.1.name=Hinzugefügt von bartimaeusnek durch +tooltip.bw.yes.name=Ja +tooltip.bw.no.name=Nein +tooltip.bw.tier.name=Tier: +tooltip.bw.kg.0.name=kg +tooltip.bw.kg.1.name=kgs +tooltip.bw.empty.name=Leer + +tooltip.teslastaff.0.name=Keine Garantie! +tooltip.labmodule.0.name=A Module used to change the BioLab's working Mode +tooltip.labparts.0.name=An empty Sterilized Petri Dish. +tooltip.labparts.1.name=An empty DNA Flask. +tooltip.labparts.2.name=An empty Plasmid Cell. +tooltip.labparts.3.name=A special washing power for Bio Engineering. +tooltip.labparts.4.name=A powder for the separation of DNA by electrophoresis. +tooltip.labparts.5.name=A Petri Dish containing: +tooltip.labparts.6.name=This is a weak culture, it can not be bred in the Bacterial Vat! +tooltip.labparts.7.name=A DNA Flask containing: +tooltip.labparts.8.name=A Plasmid Cell containing: + +tooltip.tile.waterpump.0.name=Produces +tooltip.tile.waterpump.1.name=L/s Water when fueled. +tooltip.tile.waterpump.2.name=Must be placed on the Ground. + +tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Boronsilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum +tooltip.tile.mbf.1.name=Pollution per second +tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest +tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom and top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radiation Input Bus;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! +tooltip.tile.windmill.0.name=A primitive Grinder powered by Kinetic energy.;Size(WxHxD): 7x12x7;Layer 1: 7x7 Bricks, corners are air, controller at front centered.;Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,;hollow, Wall must contain at least one Dispenser;Layer 6: 5x5 Wood Planks. Corners are filled, hollow.;Layer 7: 7x7 Wood Planks. Corners are air, hollow.;Layer 8: 7x7 Wood Planks. Corners are air, hollow,;front centered must be a Primitive Kinetic Shaftbox;Layer 9: 7x7 Wood Planks. Corners are air, hollow.;Layer 10: 5x5 Wood Planks. Corners are filled, hollow.;Layer 11: 3x3 Wood Planks. Corners are filled, hollow.;Layer 12: 1x1 Wood Plank.;Needs a Wind Mill Rotor in the Shaftbox to operate;Input items in Controller;Output items will appear in the dispensers;It is faster in regions with more wind (like IC2 Windmills) +tooltip.tile.lesu.0.name=Controller Block for the GT2-Styled L.E.S.U.;Size: ANY +tooltip.tile.lesu.1.name=Storage per LESU Casing: +tooltip.tile.lesu.2.name=Output EU: LESU Casings amount;Input EU: Next Voltage Tier to Output EU;Input/Output Amps can be configured via 4 Circuits in GUI;Output Side has a dot on it. +tooltip.tile.lesu.3.name=Only one Controller allowed, no Wallsharing! +tooltip.tile.manualtravo.0.name=Controller Block for the Manual Trafo;Operates in 4 different Modes:;Mode 1: Circuit 0 in controller: Direct-Upstep;Mode 2: Circuit 1 in controller: Direct-Downstep;Mode 3: Circuit 2 in controller: Tapped-Upstep;Mode 4: Circuit 3 in controller: Tapped-Downstep;For direct Modes: 3xHx3;Base Contains at least 1 Energy Hatch;1 Layer of Transformer-Winding Blocks for each Tier transformed;Middle of Transformer-Winding Blocks needs to be a Nickel-Zinc Ferrite Block;Top Contains at least 1 Dynamo Hatch;Maintenance Hatch can be placed anywhere;Tapped Mode is disabled at the Moment. +tooltip.tile.tiereddsc.0.name=Voltage: +tooltip.tile.tiereddsc.1.name=Amperage IN: +tooltip.tile.tiereddsc.2.name=Amperage OUT: +tooltip.tile.tiereddsc.3.name=Capacity: +tooltip.tile.diode.0.name=A Simple diode that will allow Energy Flow in only one direction. +tooltip.tile.energydistributor.0.name=Splits Amperage into several Sides. +tooltip.tile.biolab.0.name=The BioLab, a Multi-Use Bioengineering Station +tooltip.tile.radhatch.0.name=Radioactive Item Chamber for Multiblocks +tooltip.tile.radhatch.1.name=Use a screwdriver to set the containment level +tooltip.tile.radhatch.2.name=Material: +tooltip.tile.radhatch.3.name=Sievert: +tooltip.tile.radhatch.4.name=Amount: +tooltip.tile.radhatch.5.name=Time (in t/s/m/h) to decay (1kg): +tooltip.tile.radhatch.6.name=t +tooltip.tile.radhatch.7.name=s +tooltip.tile.radhatch.8.name=m +tooltip.tile.radhatch.9.name=h +tooltip.tile.acidgen.0.name=An Acid Generator +tooltip.tile.acidgen.1.name=Creates Power from Chemical Energy Potentials. +nei.biovat.0.name=Braucht Glass Tier: +nei.biovat.1.name=Braucht genau +nei.biovat.2.name=Braucht mindestens + +tile.diode.name=Kabel Diode +tile.energydistributor.name=Energie Distributor +tile.acidgenerator.name=Säure Generator +tile.bw.mbf.name=Mega Brennofen +tile.bw.mvf.name=Mega Vacuum Gefrierer +tile.biolab.name=Bio Labor +tile.biovat.name=Bacterien Tank +tile.radiohatch.name=Radio Hülle +tile.bw.windmill.name=Windmühle +tile.manutrafo.name=Manualeller Trafo \ No newline at end of file diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 08a31baa75..bb763c6f0e 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -24,7 +24,7 @@ item.rotors.paperParts.name=Paper Covered Wood Frame item.rotors.combinedParts.name=Multiple Material Covered Wood Frame item.BW_SimpleWindMeter.name=Simple Wind Meter tile.BWHeatedWaterPump.0.name=Simple Stirling Water Pump -item.BWrawtube.name=Elongated Glas Tube +item.BWrawtube.name=Elongated Glass Tube item.BWmotor.name=Simple Stirling Motor item.BWstove.name=Simple Heated Stove @@ -39,7 +39,7 @@ item.IncubationModule.name=Incubation Module item.Cells.name=Bacterial Cells item.PlasmaMembrane.name=Plasma Membrane labModule.item.DNAExtractionModule.name=DNA Extraction Module -labModule.item.PCRThermoclyclingModule.name=PCR Thermoclycle Module +labModule.item.PCRThermoclyclingModule.name=PCR Thermocycle Module labModule.item.PlasmidSynthesisModule.name=Plasmid Synthesis Module labModule.item.TransformationModule.name=Transformation Module labModule.item.ClonalCellularSynthesisModule.name=Clonal Cellular Synthesis Module @@ -54,4 +54,91 @@ BW_GlasBlocks.7.name=Colored Borosilicate Glass Block (Green) BW_GlasBlocks.8.name=Colored Borosilicate Glass Block (Purple) BW_GlasBlocks.9.name=Colored Borosilicate Glass Block (Yellow) BW_GlasBlocks.10.name=Colored Borosilicate Glass Block (Light Green) -BW_GlasBlocks.11.name=Colored Borosilicate Glass Block (Brown) \ No newline at end of file +BW_GlasBlocks.11.name=Colored Borosilicate Glass Block (Brown) + +tooltip.glas.0.name=Glass-Tier: +tooltip.LESU.0.name=Maximum Capacity! +tooltip.LESU.1.name=Multiple Controllers! + +tooltip.windmeter.0.name=A simple Windmeter to choose a place for the Windmill. +tooltip.windmeter.1.name=Uses left: +tooltip.windmeter.2.name=non existant +tooltip.windmeter.3.name=pretty low +tooltip.windmeter.4.name=common +tooltip.windmeter.5.name=rather strong +tooltip.windmeter.6.name=very strong +tooltip.windmeter.7.name=too strong +tooltip.windmeter.8.name=The wind here seems to be +tooltip.rotor.0.name=Diameter: +tooltip.rotor.1.name=Durability: +tooltip.rotor.2.name=Efficiency: +tooltip.cp.0.name=Has Circuit inside? + +tooltip.bw.0.name=Added by +tooltip.bw.1.name=Added by bartimaeusnek via +tooltip.bw.yes.name=Yes +tooltip.bw.no.name=No +tooltip.bw.tier.name=Tier: +tooltip.bw.kg.0.name=kg +tooltip.bw.kg.1.name=kgs +tooltip.bw.empty.name=Empty + +tooltip.teslastaff.0.name=No warranty! +tooltip.labmodule.0.name=A Module used to change the BioLab's working Mode +tooltip.labparts.0.name=An empty Sterilized Petri Dish. +tooltip.labparts.1.name=An empty DNA Flask. +tooltip.labparts.2.name=An empty Plasmid Cell. +tooltip.labparts.3.name=A special washing power for Bio Engineering. +tooltip.labparts.4.name=A powder for the separation of DNA by electrophoresis. +tooltip.labparts.5.name=A Petri Dish containing: +tooltip.labparts.6.name=This is a weak culture, it can not be bred in the Bacterial Vat! +tooltip.labparts.7.name=A DNA Flask containing: +tooltip.labparts.8.name=A Plasmid Cell containing: + +tooltip.tile.waterpump.0.name=Produces +tooltip.tile.waterpump.1.name=L/s Water when fueled. +tooltip.tile.waterpump.2.name=Must be placed on the Ground. + +tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Boronsilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum +tooltip.tile.mbf.1.name=Pollution per second +tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest +tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom and top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radiation Input Bus;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! +tooltip.tile.windmill.0.name=A primitive Grinder powered by Kinetic energy.;Size(WxHxD): 7x12x7;Layer 1: 7x7 Bricks, corners are air, controller at front centered.;Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,;hollow, Wall must contain at least one Dispenser;Layer 6: 5x5 Wood Planks. Corners are filled, hollow.;Layer 7: 7x7 Wood Planks. Corners are air, hollow.;Layer 8: 7x7 Wood Planks. Corners are air, hollow,;front centered must be a Primitive Kinetic Shaftbox;Layer 9: 7x7 Wood Planks. Corners are air, hollow.;Layer 10: 5x5 Wood Planks. Corners are filled, hollow.;Layer 11: 3x3 Wood Planks. Corners are filled, hollow.;Layer 12: 1x1 Wood Plank.;Needs a Wind Mill Rotor in the Shaftbox to operate;Input items in Controller;Output items will appear in the dispensers;It is faster in regions with more wind (like IC2 Windmills) +tooltip.tile.lesu.0.name=Controller Block for the GT2-Styled L.E.S.U.;Size: ANY +tooltip.tile.lesu.1.name=Storage per LESU Casing: +tooltip.tile.lesu.2.name=Output EU: LESU Casings amount;Input EU: Next Voltage Tier to Output EU;Input/Output Amps can be configured via 4 Circuits in GUI;Output Side has a dot on it. +tooltip.tile.lesu.3.name=Only one Controller allowed, no Wallsharing! +tooltip.tile.manualtravo.0.name=Controller Block for the Manual Trafo;Operates in 4 different Modes:;Mode 1: Circuit 0 in controller: Direct-Upstep;Mode 2: Circuit 1 in controller: Direct-Downstep;Mode 3: Circuit 2 in controller: Tapped-Upstep;Mode 4: Circuit 3 in controller: Tapped-Downstep;For direct Modes: 3xHx3;Base Contains at least 1 Energy Hatch;1 Layer of Transformer-Winding Blocks for each Tier transformed;Middle of Transformer-Winding Blocks needs to be a Nickel-Zinc Ferrite Block;Top Contains at least 1 Dynamo Hatch;Maintenance Hatch can be placed anywhere;Tapped Mode is disabled at the Moment. +tooltip.tile.tiereddsc.0.name=Voltage: +tooltip.tile.tiereddsc.1.name=Amperage IN: +tooltip.tile.tiereddsc.2.name=Amperage OUT: +tooltip.tile.tiereddsc.3.name=Capacity: +tooltip.tile.diode.0.name=A Simple diode that will allow Energy Flow in only one direction. +tooltip.tile.energydistributor.0.name=Splits Amperage into several Sides. +tooltip.tile.biolab.0.name=The BioLab, a Multi-Use Bioengineering Station +tooltip.tile.radhatch.0.name=Radioactive Item Chamber for Multiblocks +tooltip.tile.radhatch.1.name=Use a screwdriver to set the containment level +tooltip.tile.radhatch.2.name=Material: +tooltip.tile.radhatch.3.name=Sievert: +tooltip.tile.radhatch.4.name=Amount: +tooltip.tile.radhatch.5.name=Time (in t/s/m/h) to decay (1kg): +tooltip.tile.radhatch.6.name=t +tooltip.tile.radhatch.7.name=s +tooltip.tile.radhatch.8.name=m +tooltip.tile.radhatch.9.name=h +tooltip.tile.acidgen.0.name=An Acid Generator +tooltip.tile.acidgen.1.name=Creates Power from Chemical Energy Potentials. +nei.biovat.0.name=Needs Glass Tier: +nei.biovat.1.name=Need exactly +nei.biovat.2.name=Need minimum + +tile.diode.name=Cable Diode +tile.energydistributor.name=Energy Distributor +tile.acidgenerator.name=Acid Generator +tile.bw.mbf.name=Mega Blast Furnace +tile.bw.mvf.name=Mega Vacuum Freezer +tile.biolab.name=Bio Lab +tile.biovat.name=Bacterial Vat +tile.radiohatch.name=Radio Hatch +tile.bw.windmill.name=Windmill +tile.manutrafo.name=Manual Trafo \ No newline at end of file diff --git a/src/main/resources/assets/bartworks/lang/fr_FR.lang b/src/main/resources/assets/bartworks/lang/fr_FR.lang new file mode 100644 index 0000000000..847d021e59 --- /dev/null +++ b/src/main/resources/assets/bartworks/lang/fr_FR.lang @@ -0,0 +1,144 @@ +itemGroup.GT2C=Compatibilité Gregtech 2 +item.GT_Rockcutter_Item_LV.name=Coupeur de roche LV +item.GT_Rockcutter_Item_MV.name=Coupeur de roche MV +item.GT_Rockcutter_Item_HV.name=Coupeur de roche HV +item.GT_Teslastaff_Item.name=Bâton Tesla +BW_ItemBlocks.0.name=Etched Lapis Cell +BW_ItemBlocks.1.name=Plated Lapis Cell +GT_LESU_CASING.0.name=Bloc enveloppe du LESU + +itemGroup.bartworks=BartWorks inter-temporel +BW_Machinery_Casings.0.name=Bloc de Ferrite en Nickel-Zinc +BW_Machinery_Casings.1.name=Bloc de bobinage de Transformateur +item.BW_PaperRotor.name=Rotor primitif en papier (Vent seulement) +item.BW_LeatherRotor.name=Rotor primitif en cuir (Vent seulement) +item.BW_WoolRotor.name=Rotor primitif en laine (Vent seulement) +item.BW_CombinedRotor.name=Rotor primitif combiné (Vent seulement) +tile.BWRotorBlock.0.name=Boîte d'arbre de transmission primitive +item.grindstone_top.name=partie haute de Meule +item.grindstone_bottom.name=partie basse de Meule +item.completed_grindstone.name=Meule +item.rotors.leatherParts.name=Charpente en bois recouverte de cuir +item.rotors.woolParts.name=Charpente en bois recouverte de laine +item.rotors.paperParts.name=Charpente en bois recouverte de papier +item.rotors.combinedParts.name=Charpente en bois recouverte de plusieurs matériaux +item.BW_SimpleWindMeter.name=Simple Anémomètre +tile.BWHeatedWaterPump.0.name=Simple pompe à eau Stirling +item.BWrawtube.name=Tube de Verre allongé +item.BWmotor.name=Simple Moteur Stirling +item.BWstove.name=Simple réchaud chauffé + +itemGroup.BioTab=Bio-ingéniérie BartWorks +filled.item.petriDish.name=Boîte à Pétri avec culture +item.petriDish.name=Boîte à Pétri stérilisée +item.DNASampleFlask.name=Fiole d'échantillonnage ADN +item.PlasmidCell.name=Fiole d'échantillonnage de Plasmide +item.DetergentPowder.name=Poudre détergente +item.Agarose.name=Agarose +item.IncubationModule.name=Module d'incubation +item.Cells.name=Cellules bactériennes +item.PlasmaMembrane.name=Membrane Cellulaire +labModule.item.DNAExtractionModule.name=Module d'extraction d'ADN +labModule.item.PCRThermoclyclingModule.name=Module de thermocycle PCR +labModule.item.PlasmidSynthesisModule.name=Module de synthèse pour Plasmides +labModule.item.TransformationModule.name=Module de transformation +labModule.item.ClonalCellularSynthesisModule.name=Module de synthèse cellulaire clonale +BW_GlasBlocks.0.name=Bloc de Verre Borosilicate +BW_GlasBlocks.1.name=Bloc de Verre Boronsilicate renforcé en Nickel +BW_GlasBlocks.2.name=Bloc de Verre Boronsilicate renforcé en Tungsten +BW_GlasBlocks.3.name=Bloc de Verre Boronsilicate renforcé en Chrome +BW_GlasBlocks.4.name=Bloc de Verre Boronsilicate renforcé en Iridium +BW_GlasBlocks.5.name=Bloc de Verre Boronsilicate renforcé en Osmium +BW_GlasBlocks.6.name=Bloc de Verre Boronsilicate coloré (Rouge) +BW_GlasBlocks.7.name=Bloc de Verre Boronsilicate coloré (Vert) +BW_GlasBlocks.8.name=Bloc de Verre Boronsilicate coloré (Violet) +BW_GlasBlocks.9.name=Bloc de Verre Boronsilicate coloré (Jaune) +BW_GlasBlocks.10.name=Bloc de Verre Boronsilicate coloré (Vert Clair) +BW_GlasBlocks.11.name=Bloc de Verre Boronsilicate coloré (Marron) + +tooltip.glas.0.name=Tier de verre: +tooltip.LESU.0.name=Capacité maximum! +tooltip.LESU.1.name=Plusieurs contrôleurs! + +tooltip.windmeter.0.name=Un simple anémomètre pour choisir une place pour l'éolienne. +tooltip.windmeter.1.name=Utilisations restantes: +tooltip.windmeter.2.name=non existant +tooltip.windmeter.3.name=plutôt léger +tooltip.windmeter.4.name=commun +tooltip.windmeter.5.name=plutôt fort +tooltip.windmeter.6.name=très fort +tooltip.windmeter.7.name=trop fort +tooltip.windmeter.8.name=Le vent ici semble être +tooltip.rotor.0.name=Diamètre: +tooltip.rotor.1.name=Durabilité: +tooltip.rotor.2.name=Efficacité +tooltip.cp.0.name=Y-a-t-il un circuit dedans? + +tooltip.bw.0.name=Ajouté par +tooltip.bw.1.name=Ajouté par bartimaeusnek via +tooltip.bw.yes.name=Oui +tooltip.bw.no.name=Non +tooltip.bw.tier.name=Tier: +tooltip.bw.kg.0.name=kg +tooltip.bw.kg.1.name=kgs +tooltip.bw.empty.name=Vide + +tooltip.teslastaff.0.name=Pas de garrantie! +tooltip.labmodule.0.name=un module utilisé pour changer le mode de fonctionnement du BioLab +tooltip.labparts.0.name=Une boîte de Pétrie vide stérélisée. +tooltip.labparts.1.name=Une fiole d'ADN vide. +tooltip.labparts.2.name=Une cellule de plasmide vide. +tooltip.labparts.3.name=Un nettoyant spécial pour la Bio-ingéniérie. +tooltip.labparts.4.name=Une poudre de séparation d'ADN par électrophorèse. +tooltip.labparts.5.name=Une boîte de Pétri contenant: +tooltip.labparts.6.name=Ceci est une culture faible, elle ne peut pas se reproduire dans la Bio Cuve! +tooltip.labparts.7.name=Une fiole d'ADN contenant: +tooltip.labparts.8.name=Une cellule de plasmide contenant: + +tooltip.tile.waterpump.0.name=Produit +tooltip.tile.waterpump.1.name=L/s Water quand il est alimenté. +tooltip.tile.waterpump.2.name=Doit être placé sur le sol. + +tooltip.tile.mbf.0.name=Bloc contrôleur pour le haut fourneau;Taille(LxHxP): 15x20x15 (creux);Contrôleur: 3ème couche centré au milieu;Intérieur 13x18x13 bobines de chauffage (creux);Extérieur 15x18x15 Verre Boronsilicate;Le verre limite le tier d'énergie en entrée;1+ Trappe/Bus d'entrée (n'importe quel bloc d'enveloppe);1+ bus de sortie(n'importe quel bloc d'enveloppe);1+ trappe d'énergie (n'importe quel bloc d'enveloppe);1x trappe de maintenance (n'importe quel bloc d'enveloppe);Blocs d'enveloppe de machine résistant à la chaleur pour l'extérieur 15x15 (couche 20);La récupération se câle sur le tier de la trappe d'échappement;Blocs d'enveloppe de machine résistant à la chaleur pour la base;Chaque 900K supérieur à la température de base donne 5% de rapidité (multiplicativement);Chaque 1800k supérieur à la température de base donne un overclock gratuit;Chaque overclock reduit le temps de craft de 25% et augmente la consommation d'EU/t de 400%;Cause une pollution maximale +tooltip.tile.mbf.1.name=Pollution par seconde +tooltip.tile.mvf.0.name=Bloc contrôleur pour le Méga Refroidisseur A Vide;Refroidit très vite les lingots chauds et les cellules;Taille(LxHxP): 15x15x15 (Creux);Contrôleur: (centré devant);1x Bus d'entrée (n'importe quel bloc d'enveloppe);1x Bus de sortie (n'importe quel bloc d'enveloppe);1x Trappe de maintenance (n'importe quel bloc d'enveloppe);1x Trappe d'énergie (n'importe quel bloc d'enveloppe);Blocs d'enveloppe de machine résistant au froid pour le reste +tooltip.tile.bvat.0.name=Bloc contrôleur pour la Bio Cuve;Taille(LxHxP): 5x4x5;Le haut et le bas sont des bloc d'enveloppe en acier inoxydable;Le haut et le bas doivent contenir:;1x trappe de Maintenance, 1x trappe de sortie;1 ou plus de trappe d'entrée, 1 ou plus de bus d'entrée, 0-1 trappe radio;Les deux couches du milieu doivent être construites avec du verre, (creux);Le verre peut être n'importe le quel, i.e. le Verre transparent de Tinkers Construct;Certaines recettes ont besoin de verre plus avancés;Pour un boost d'efficacité maximum gardez la trappe de sortie toujours remplie à moitié! +tooltip.tile.windmill.0.name=Un broyeur primitif fonctionnant a l'énergie cinétique.;Taille(LxHxP): 7x12x7;Couche 1: 7x7 Briques, les coins sont laissés vide,le contrôleur est centré devant.;(creux), les mur doivent contenir au moins un Dispenseur;Couche 7: 7x7 Planches de Bois. les coins sont laissés vide, (creux).;Couche 8: 7x7 Planches de Bois. les coins sont laissés vide, (creux),;le bloc centré devant doit être une Boîte d'arbre de transmission primitive.;Couche 9: 7x7 Planches de Bois. les coins sont laissés vide, (creux).;Couche 11: 3x3 Planches de Bois. les coins sont pleins, (creux).;A besoin d'un Rotor d'éolienne dans la Boîte d'arbre de transmission pour fonctionner.;Les objets d'entrée doivent aller dans le contrôleur.;Les objets de sortie apparaîtront dans les Dispenseurs.;C'est plus rapide dans les régions venteuses (comme les éoliennes IC2). +tooltip.tile.lesu.0.name=Bloc contrôleur pour le GT2-Stylé L.E.S.U.;Taille: n'importe; +tooltip.tile.lesu.1.name=Stockage par enveloppe du LESU: +tooltip.tile.lesu.2.name=EU de sortie: le nombre de blocs d'enveloppe LESU EU d'entrée: prochain Tier de voltage après les EU de sortie;l'ampérage d'entrée/sortie peut être configurée via 4 Circuits dans le GUI;La face de sortie à un point dessus.; +tooltip.tile.lesu.3.name=Seulement un seul contrôleur autorisé, pas de partage des murs! +tooltip.tile.manualtravo.0.name=Bloc contrôleur pour le Transformateur Manuel;4 modes de fonctionnement;Fonctionne avec 2 modes en ce moment:;Mode 1: Circuit 0 dans le contrôleur: unique source et ascendant;Mode 2: Circuit 1 dans le contrôleur: unique source et descendant;Mode 3: Circuit 2 dans le contrôleur: plusieurs sources et ascendant;Mode 4: Circuit 3 dans le contrôleur: plusieurs sources et descendant;Pour les modes directs: 3xHx3;La base doit contenir au moins une trappe d'énergie;1 Couche de Blocs de bobinage de Transformateur pour chaque tier converti;Au milieu des Blocs de bobinage de Transformeur il doit y avoir un Bloc de Ferrite en Nickel-Zinc;Le haut doit contenir au moins une Trappe Dynamo;La trappe de maintenance peut être placée n'importe où;Les modes avec plusieurs sources sont désactivés pour le moment +tooltip.tile.tiereddsc.0.name=Voltage: +tooltip.tile.tiereddsc.1.name=Ampérage d'entrée: +tooltip.tile.tiereddsc.2.name=Ampérage de sortie: +tooltip.tile.tiereddsc.3.name=Capacité: +tooltip.tile.diode.0.name=Une simple diode qui autorise les flux d'énergie dans un seul sens. +tooltip.tile.energydistributor.0.name=Répartit l'ampérage sur plusieur faces. +tooltip.tile.biolab.0.name=Le BioLab, une station de bio-ingéniérie multifonction. +tooltip.tile.radhatch.0.name=Radioactive Item Chamber for Multiblocks Chambre d'objets radiactifs pour multi-blocs +tooltip.tile.radhatch.1.name=Utiliser un tournevis pour régler le niveau de confinement +tooltip.tile.radhatch.2.name=Matériau: +tooltip.tile.radhatch.3.name=Sievert: +tooltip.tile.radhatch.4.name=Quantité: +tooltip.tile.radhatch.5.name=Temps (en t/s/m/h) pour se désintégrer(1kg): +tooltip.tile.radhatch.6.name=t +tooltip.tile.radhatch.7.name=s +tooltip.tile.radhatch.8.name=m +tooltip.tile.radhatch.9.name=h +tooltip.tile.acidgen.0.name=Un générateur à acide +tooltip.tile.acidgen.1.name=Crée de l'énergie à partir de potentiels chimiques. +nei.biovat.0.name=A besoin du tier de verre: +nei.biovat.1.name=A besoin du montant exact +nei.biovat.2.name=A besoin d'un minimum + +tile.diode.name=Diode câble +tile.energydistributor.name=Distributeur d'énergie +tile.acidgenerator.name=Générateur à Acide +tile.bw.mbf.name=Méga Haut Fourneau +tile.bw.mvf.name=Méga Refroidisseur A Vide +tile.biolab.name=Bio Lab +tile.biovat.name=Bio Cuve +tile.radiohatch.name=Trappe Radio +tile.bw.windmill.name=Eolienne +tile.manutrafo.name=Transformateur Manuel \ No newline at end of file -- cgit From a44ec6b7686cbb25d43bf0c7ecafaf209332d7e1 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 24 Feb 2019 13:22:40 +0100 Subject: added a safty mechanism to MegaMultis +they wont accept more recipes than they can power. Former-commit-id: 627253db74fe524815410ddfec695a87b07a18d8 --- .../multis/mega/GT_TileEntity_MegaBlastFurnace.java | 17 +++++++++-------- .../multis/mega/GT_TileEntity_MegaVacuumFreezer.java | 3 ++- .../github/bartimaeusnek/bartworks/util/BW_Util.java | 17 +++++++++++++++++ 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 8f035a94ad..fc9e6bfdc0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -31,6 +31,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; @@ -40,10 +41,7 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; +import java.util.*; import static gregtech.api.enums.GT_Values.V; @@ -87,8 +85,11 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); boolean found_Recipe = false; int processed = 0; + + long nominalV = BW_Util.getnominalVoltage(this); + while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { - if (tRecipe != null && this.mHeatingCapacity >= tRecipe.mSpecialValue && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { + if (tRecipe != null && this.mHeatingCapacity >= tRecipe.mSpecialValue && tRecipe.isRecipeInputEqual(true, tFluids, tInputs) && (tRecipe.mEUt*processed) < nominalV ) { found_Recipe = true; for (int i = 0; i < tRecipe.mOutputs.length; i++) { outputItems.add(tRecipe.getOutput(i)); @@ -115,7 +116,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl } overclockCount = calculateOverclockednessEBF((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), tVoltage); } else - overclockCount = calculateOverclockednessEBF(tRecipe.mEUt * 64, tRecipe.mDuration, tVoltage); + overclockCount = calculateOverclockednessEBF(actualEUT, tRecipe.mDuration, tVoltage); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; @@ -148,7 +149,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl * @param aEUt - recipe EUt * @param aDuration - recipe Duration */ - protected byte calculateOverclockednessEBF(int aEUt, int aDuration, long maxInputVoltage) { + protected byte calculateOverclockednessEBF(long aEUt, int aDuration, long maxInputVoltage) { byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)), timesOverclocked = 0; if (mTier == 0) { //Long time calculation @@ -158,7 +159,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl mEUt = Integer.MAX_VALUE - 1; mMaxProgresstime = Integer.MAX_VALUE - 1; } else { - mEUt = aEUt >> 2; + mEUt = (int) (aEUt >> 2); mMaxProgresstime = (int) xMaxProgresstime; } //return 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 5b8ce4459b..b6ee743027 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -76,8 +76,9 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], null, tInputs); boolean found_Recipe = false; int processed = 0; + long nominalV = BW_Util.getnominalVoltage(this); while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { - if (tRecipe != null && tRecipe.isRecipeInputEqual(true, null, tInputs)) { + if (tRecipe != null && tRecipe.isRecipeInputEqual(true, null, tInputs) && (tRecipe.mEUt*processed) < nominalV ) { found_Recipe = true; for (int i = 0; i < tRecipe.mOutputs.length; i++) { outputItems.add(tRecipe.getOutput(i)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 1392184d13..51572b0543 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import gregtech.api.enums.Materials; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; @@ -232,6 +233,22 @@ public class BW_Util { } } + public static long getnominalVoltage(GT_MetaTileEntity_MultiBlockBase base){ + long rVoltage = 0L; + long rAmperage = 0L; + Iterator var3 = base.mEnergyHatches.iterator(); + + while(var3.hasNext()) { + GT_MetaTileEntity_Hatch_Energy tHatch = (GT_MetaTileEntity_Hatch_Energy)var3.next(); + if (base.isValidMetaTileEntity(tHatch)) { + rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage(); + rAmperage += tHatch.getBaseMetaTileEntity().getInputAmperage(); + } + } + + return rVoltage * rAmperage; + } + public static EnumRarity getRarityFromByte(byte b) { switch (b) { case 1: -- cgit From 0cdb935b69a7f0cb2626972bb497bfe8c6963147 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 9 Mar 2019 07:47:02 +0100 Subject: fixes -ty piky for the bug reports =) Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 531ae727391c3fc7f8e98d6bb6a31d69d2505431 --- .../tileentities/multis/GT_TileEntity_BioVat.java | 8 +------- .../common/tileentities/multis/GT_TileEntity_LESU.java | 4 ---- .../multis/mega/GT_TileEntity_MegaBlastFurnace.java | 18 +++++++++++------- .../tileentities/tiered/GT_MetaTileEntity_BioLab.java | 2 +- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index d31cd53c1e..f8801f25af 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -290,6 +290,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; int blockcounter = 0; + this.mRadHatches.clear(); for (int x = -2; x <= 2; x++) for (int z = -2; z <= 2; z++) @@ -321,13 +322,6 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } } -// this.mWrench = true; -// this.mScrewdriver = true; -// this.mSoftHammer = true; -// this.mHardHammer = true; -// this.mSolderingTool = true; -// this.mCrowbar = true; - if (blockcounter > 18) if (this.mRadHatches.size() < 2) if (this.mOutputHatches.size() == 1) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index bef87bc3e6..8e7042908a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -206,10 +206,6 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { return new GT_Container_LESU(aPlayerInventory, aBaseMetaTileEntity); } - public boolean isServerSide() { - return !isClientSide(); - } - public boolean isClientSide() { if (getWorld() != null) return getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index fc9e6bfdc0..97e7bb9fac 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -75,21 +75,25 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = (ItemStack[]) this.getStoredInputs().toArray(new ItemStack[0]); FluidStack[] tFluids = (FluidStack[]) this.getStoredFluids().toArray(new FluidStack[0]); - - ArrayList outputItems = new ArrayList(); - ArrayList outputFluids = new ArrayList(); - long tVoltage = this.getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); + if (tRecipe == null) + return false; + + ArrayList outputItems = new ArrayList(); + ArrayList outputFluids = new ArrayList(); + boolean found_Recipe = false; int processed = 0; long nominalV = BW_Util.getnominalVoltage(this); + int tHeatCapacityDivTiers = (mHeatingCapacity - tRecipe.mSpecialValue) / 900; + long precutRecipeVoltage = (long) (tRecipe.mEUt*Math.pow(0.95, tHeatCapacityDivTiers)); while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { - if (tRecipe != null && this.mHeatingCapacity >= tRecipe.mSpecialValue && tRecipe.isRecipeInputEqual(true, tFluids, tInputs) && (tRecipe.mEUt*processed) < nominalV ) { + if (this.mHeatingCapacity >= tRecipe.mSpecialValue && (precutRecipeVoltage*(processed+1)) < nominalV && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { found_Recipe = true; for (int i = 0; i < tRecipe.mOutputs.length; i++) { outputItems.add(tRecipe.getOutput(i)); @@ -105,7 +109,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl if (found_Recipe) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - int tHeatCapacityDivTiers = (mHeatingCapacity - tRecipe.mSpecialValue) / 900; + byte overclockCount = 0; long actualEUT = (long) (tRecipe.mEUt) * processed; if (actualEUT > Integer.MAX_VALUE) { @@ -228,7 +232,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl if (glasTier != 8 && !mEnergyHatches.isEmpty()) for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : mEnergyHatches) { - if (glasTier > hatchEnergy.mTier) + if (glasTier < hatchEnergy.mTier) return false; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index f75afd7d4c..1fd3cfcfd6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -54,7 +54,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { private static final String MGUINAME = "BW.GUI.BioLab.png"; public GT_MetaTileEntity_BioLab(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, null, 6, 2, MGUINAME, null, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")/*this is topactive*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")/*this is top*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM"))); + super(aID, aName, aNameRegional, aTier, 1, (String) null, 6, 2, MGUINAME, null, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")/*this is topactive*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")/*this is top*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM"))); } public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, String aNEIName) { -- cgit From 928159a9e889d502eecb30d8882ff78f3aa7cc59 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 11 Mar 2019 02:17:58 +0100 Subject: small fixes -oredicted some recipes -fixed vacuum freezer voiding items -fixed non localised gui -version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: b2353ef18f835520ae3fa40bbb119093ba01c720 --- build.properties | 2 +- .../bartworks/client/gui/BW_GUIContainer_RotorBlock.java | 2 +- .../bartimaeusnek/bartworks/common/loaders/RecipeLoader.java | 10 +++++----- .../multis/mega/GT_TileEntity_MegaVacuumFreezer.java | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build.properties b/build.properties index c2c1580cde..72b745fd12 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=3 -buildNumber=22 +buildNumber=24 APIVersion=4 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java index 0ad5c5982f..597fb1cb0b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java @@ -40,7 +40,7 @@ public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator { public BW_GUIContainer_RotorBlock(ContainerWindKineticGenerator container1) { super(container1); this.container = container1; - this.name = StatCollector.translateToLocal("tile.BWRotorBlock.name"); + this.name = StatCollector.translateToLocal("tile.BWRotorBlock.0.name"); } protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 7e4571e9c4..95cb64890b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -575,7 +575,7 @@ public class RecipeLoader implements Runnable { "WLh", "WLf", 'L', new ItemStack(Items.leather), - 'W', new ItemStack(Blocks.log, 1, OreDictionary.WILDCARD_VALUE), + 'W', "logWood", } ); GT_ModHandler.addCraftingRecipe( @@ -586,7 +586,7 @@ public class RecipeLoader implements Runnable { "WLh", "WLf", 'L', new ItemStack(Blocks.carpet), - 'W', new ItemStack(Blocks.log, 1, OreDictionary.WILDCARD_VALUE), + 'W', "logWood", } ); GT_ModHandler.addCraftingRecipe( @@ -597,7 +597,7 @@ public class RecipeLoader implements Runnable { "WLh", "WLf", 'L', new ItemStack(Items.paper), - 'W', new ItemStack(Blocks.log, 1, OreDictionary.WILDCARD_VALUE), + 'W', "logWood", } ); GT_ModHandler.addCraftingRecipe( @@ -610,7 +610,7 @@ public class RecipeLoader implements Runnable { 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', new ItemStack(Blocks.log, 1, OreDictionary.WILDCARD_VALUE), + 'W', "logWood", } ); GT_ModHandler.addCraftingRecipe( @@ -665,7 +665,7 @@ public class RecipeLoader implements Runnable { "RGR", "WRW", 'R', GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Iron, 1L), - 'W', new ItemStack(Blocks.planks), + 'W', "plankWood", 'G', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), } ); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index b6ee743027..14af3300a9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -78,7 +78,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre int processed = 0; long nominalV = BW_Util.getnominalVoltage(this); while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { - if (tRecipe != null && tRecipe.isRecipeInputEqual(true, null, tInputs) && (tRecipe.mEUt*processed) < nominalV ) { + if (tRecipe != null && (tRecipe.mEUt*(processed+1)) < nominalV && tRecipe.isRecipeInputEqual(true, null, tInputs)) { found_Recipe = true; for (int i = 0; i < tRecipe.mOutputs.length; i++) { outputItems.add(tRecipe.getOutput(i)); -- cgit From 8507d2fda732c286eb2e68fa8bee5344ed011a2f Mon Sep 17 00:00:00 2001 From: Kiwi233 Date: Mon, 11 Mar 2019 09:50:38 +0800 Subject: power→powder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 932b3b265e8458bce550105453cfabc759588617 --- src/main/resources/assets/bartworks/lang/en_US.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index bb763c6f0e..fb9f53db31 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -88,7 +88,7 @@ tooltip.labmodule.0.name=A Module used to change the BioLab's working Mode tooltip.labparts.0.name=An empty Sterilized Petri Dish. tooltip.labparts.1.name=An empty DNA Flask. tooltip.labparts.2.name=An empty Plasmid Cell. -tooltip.labparts.3.name=A special washing power for Bio Engineering. +tooltip.labparts.3.name=A special washing powder for Bio Engineering. tooltip.labparts.4.name=A powder for the separation of DNA by electrophoresis. tooltip.labparts.5.name=A Petri Dish containing: tooltip.labparts.6.name=This is a weak culture, it can not be bred in the Bacterial Vat! -- cgit From 3c5372ef12e1fb401541976d668d53efa8c4eae7 Mon Sep 17 00:00:00 2001 From: Kiwi233 Date: Mon, 11 Mar 2019 10:09:03 +0800 Subject: Update zh_CN.lang Former-commit-id: 939fa291e092045e40eb250c148a114a58809f4f --- .../resources/assets/bartworks/lang/zh_CN.lang | 181 +++++++++++---------- 1 file changed, 91 insertions(+), 90 deletions(-) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index 27353a0aa5..7058f99598 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -1,145 +1,146 @@ -itemGroup.GT2C=Gregtech2兼容 -item.GT_Rockcutter_Item_LV.name=岩石切割者 LV -item.GT_Rockcutter_Item_MV.name=岩石切割者 MV -item.GT_Rockcutter_Item_HV.name=岩石切割者 HV +#Translated by Kiwi233 + +itemGroup.GT2C=GT2兼容 +item.GT_Rockcutter_Item_LV.name=岩石切割机LV +item.GT_Rockcutter_Item_MV.name=岩石切割机MV +item.GT_Rockcutter_Item_HV.name=岩石切割机HV item.GT_Teslastaff_Item.name=特斯拉权杖 -BW_ItemBlocks.0.name=蚀刻青金石单元 -BW_ItemBlocks.1.name=镀青金石单元 -GT_LESU_CASING.0.name=LESU框架 +BW_ItemBlocks.0.name=刻蚀青金石单元 +BW_ItemBlocks.1.name=镀层青金石单元 +GT_LESU_CASING.0.name=LESU机械方块 -itemGroup.bartworks=BartWorks-跨时代 +itemGroup.bartworks=BartWorks跨时代 BW_Machinery_Casings.0.name=镍锌铁氧体块 -BW_Machinery_Casings.1.name=变压器线圈方块 -item.BW_PaperRotor.name=原始纸转子 (风车专用) -item.BW_LeatherRotor.name=原始皮革转子 (风车专用) -item.BW_WoolRotor.name=原始羊毛转子 (风车专用) -item.BW_CombinedRotor.name=复合原始转子 (风车专用) -tile.BWRotorBlock.0.name=原始动力学轴箱 -item.grindstone_top.name=磨石顶部 -item.grindstone_bottom.name=磨石底部 +BW_Machinery_Casings.1.name=变压器线圈块 +item.BW_PaperRotor.name=原始纸转子(风车专用) +item.BW_LeatherRotor.name=原始皮革转子(风车专用) +item.BW_WoolRotor.name=原始羊毛转子(风车专用) +item.BW_CombinedRotor.name=原始复合转子(风车专用) +tile.BWRotorBlock.0.name=原始动力轴箱 +item.grindstone_top.name=磨石顶部件 +item.grindstone_bottom.name=磨石底部件 item.completed_grindstone.name=磨石 -item.rotors.leatherParts.name=皮革包木框架 -item.rotors.woolParts.name=羊毛包木框架 -item.rotors.paperParts.name=纸包木框架 -item.rotors.combinedParts.name=多材料包木框架 +item.rotors.leatherParts.name=皮革包层木框架 +item.rotors.woolParts.name=羊毛包层木框架 +item.rotors.paperParts.name=纸包层木框架 +item.rotors.combinedParts.name=复合材料包层木框架 item.BW_SimpleWindMeter.name=简易风速计 tile.BWHeatedWaterPump.0.name=简易斯特林水泵 item.BWrawtube.name=加长玻璃管 -item.BWmotor.name=简易斯特林电机 -item.BWstove.name=简易加热炉 +item.BWmotor.name=简易斯特林马达 +item.BWstove.name=简易熔炉 -itemGroup.BioTab=BartWorks-生物工程 +itemGroup.BioTab=BartWorks生物工程 filled.item.petriDish.name=培养皿 item.petriDish.name=无菌培养皿 item.DNASampleFlask.name=DNA样品瓶 item.PlasmidCell.name=质粒样品瓶 -item.DetergentPowder.name=洗衣粉 +item.DetergentPowder.name=洗涤粉 item.Agarose.name=琼脂糖 item.IncubationModule.name=孵化模块 item.Cells.name=细菌细胞 item.PlasmaMembrane.name=质膜 labModule.item.DNAExtractionModule.name=DNA提取模块 -labModule.item.PCRThermoclyclingModule.name=PCR热电偶模块 +labModule.item.PCRThermoclyclingModule.name=聚合酶链式反应模块 labModule.item.PlasmidSynthesisModule.name=质粒合成模块 -labModule.item.TransformationModule.name=转换模块 +labModule.item.TransformationModule.name=转化模块 labModule.item.ClonalCellularSynthesisModule.name=克隆细胞合成模块 -BW_GlasBlocks.0.name=硼硅酸盐玻璃块 -BW_GlasBlocks.1.name=镍强化硼硅酸盐玻璃块 -BW_GlasBlocks.2.name=钨强化硼硅酸盐玻璃块 -BW_GlasBlocks.3.name=铬强化硼硅酸盐玻璃块 -BW_GlasBlocks.4.name=铱强化硼硅酸盐玻璃块 -BW_GlasBlocks.5.name=锇强化硼硅酸盐玻璃块 -BW_GlasBlocks.6.name=染色的硼硅酸盐玻璃块(红) -BW_GlasBlocks.7.name=染色的硼硅酸盐玻璃块(绿) -BW_GlasBlocks.8.name=染色的硼硅酸盐玻璃块(紫) -BW_GlasBlocks.9.name=染色的硼硅酸盐玻璃块(黄) -BW_GlasBlocks.10.name=染色的硼硅酸盐玻璃块(黄绿) -BW_GlasBlocks.11.name=染色的硼硅酸盐玻璃块(棕) +BW_GlasBlocks.0.name=硼玻璃方块 +BW_GlasBlocks.1.name=镍强化硼玻璃方块 +BW_GlasBlocks.2.name=钨强化硼玻璃方块 +BW_GlasBlocks.3.name=铬强化硼玻璃方块 +BW_GlasBlocks.4.name=铱强化硼玻璃方块 +BW_GlasBlocks.5.name=锇强化硼玻璃方块 +BW_GlasBlocks.6.name=染色硼玻璃方块(红) +BW_GlasBlocks.7.name=染色硼玻璃方块(绿) +BW_GlasBlocks.8.name=染色硼玻璃方块(紫) +BW_GlasBlocks.9.name=染色硼玻璃方块(黄) +BW_GlasBlocks.10.name=染色硼玻璃方块(淡绿) +BW_GlasBlocks.11.name=染色硼玻璃方块(棕) tooltip.glas.0.name=玻璃等级: tooltip.LESU.0.name=最大容量! tooltip.LESU.1.name=多个控制器! -tooltip.windmeter.0.name=一个简单的风速计选择风车的地方. -tooltip.windmeter.1.name=使用次数剩余: -tooltip.windmeter.2.name=不存在的 +tooltip.windmeter.0.name=用于为风车选址的简易风速计. +tooltip.windmeter.1.name=剩余使用次数: +tooltip.windmeter.2.name=不存在 tooltip.windmeter.3.name=很低 -tooltip.windmeter.4.name=普通 -tooltip.windmeter.5.name=相当强大 -tooltip.windmeter.6.name=十分强大 +tooltip.windmeter.4.name=正常 +tooltip.windmeter.5.name=相当强 +tooltip.windmeter.6.name=很强 tooltip.windmeter.7.name=太强了 -tooltip.windmeter.8.name=这里的风似乎是 +tooltip.windmeter.8.name=这里的风似乎... tooltip.rotor.0.name=直径: tooltip.rotor.1.name=耐久: tooltip.rotor.2.name=效率: -tooltip.cp.0.name=里面有电路吗? +tooltip.cp.0.name=内部是否有编程电路? -tooltip.bw.0.name=Added by -tooltip.bw.1.name=由bartimaeusnek添加 +tooltip.bw.0.name=添加者 +tooltip.bw.1.name=添加者bartimaeusnek tooltip.bw.yes.name=是 tooltip.bw.no.name=否 -tooltip.bw.tier.name=阶: -tooltip.bw.kg.0.name=kg -tooltip.bw.kg.1.name=kgs +tooltip.bw.tier.name=等级: +tooltip.bw.kg.0.name=千克 +tooltip.bw.kg.1.name=千克 tooltip.bw.empty.name=空 tooltip.teslastaff.0.name=没有保修! -tooltip.labmodule.0.name=用于更改生物实验室工作模式的模块 +tooltip.labmodule.0.name=用于改变生物实验室工作模式的模块 tooltip.labparts.0.name=一个空的无菌培养皿 -tooltip.labparts.1.name=一个空的DNA烧瓶. -tooltip.labparts.2.name=一个空的质粒细胞. -tooltip.labparts.3.name=一种特殊的生物工程清洗电源 -tooltip.labparts.4.name=电泳分离DNA的粉末. -tooltip.labparts.5.name=有盖培养皿: -tooltip.labparts.6.name=这是一种很弱的培养物,不能在细菌培养皿中培养! -tooltip.labparts.7.name=含有DNA的烧瓶: -tooltip.labparts.8.name=质粒细胞容器: +tooltip.labparts.1.name=一个空的DNA样品瓶 +tooltip.labparts.2.name=一个空的质粒样品瓶 +tooltip.labparts.3.name=生物工程专用洗涤粉 +tooltip.labparts.4.name=用于辅助电泳分离DNA的粉末 +tooltip.labparts.5.name=一个培养皿,内含: +tooltip.labparts.6.name=这是一种很弱的培养菌,不能在细菌培养缸中繁殖! +tooltip.labparts.7.name=一个DNA样品瓶,内含: +tooltip.labparts.8.name=一个质粒样品瓶,内含: -tooltip.tile.waterpump.0.name=产出 -tooltip.tile.waterpump.1.name=升/秒 加油时的水. +tooltip.tile.waterpump.0.name=生产 +tooltip.tile.waterpump.1.name=L/s水,有燃料时. tooltip.tile.waterpump.2.name=必须放在地上. -tooltip.tile.mbf.0.name=巨型工业高炉的控制器;大小(宽x高x长):15x20x15(中空);控制器:第3层中间中心;内部13x18x13加热线圈(中空);外部15x18x1硼硅酸盐玻璃;玻璃将限制能量输入等级;1个以上的输入仓/总线(任意机械方块);1个以上的输出仓/总线(任意机械方块);1个以上的能源仓(任意机械方块);1x维护仓(任意机械方块);13x13消音仓(顶部正中);外部15x15的防热机械方块(第20层);1个输出仓以回收CO2/CO/SO2(可选,任何顶层机械方块);回收比例取决于消音仓等级;底层为隔热机械方块;自配方的最小温度起,温度每高出900K会减少5%的能耗(使用乘法);自配方的最小温度起,每高出1800K的温度将允许进行一次无损超频;无损超频将减少配方加工时间至25%并提升功率至400% -tooltip.tile.mbf.1.name=污染每秒 -tooltip.tile.mvf.0.name=巨型真空冷冻机的控制器;超级冷却热金属锭和单元;大小(宽x高x长):15x15x15(中空);控制器:(正面中心);1个输入总线(任意机械方块);1个输出总线(任意机械方块);1个维护仓(任意机械方块);1个能源仓(任意机械方块);其余为的防冻机械方块 -tooltip.tile.bvat.0.name=生物培养缸的控制器;大小(宽x高x长):5x4x5;底部和顶部是洁净不锈钢机械方块;底部和顶部必须包含:;1个维护仓,1个输出仓;1个或以上的输入仓,1个或以上的输入仓,0-1个辐射输入总线;中间两层必须由玻璃构组成,中空;玻璃可以是任何玻璃,例如,匠魂的通透玻璃;一些配方需要更高级的玻璃;为了最大限度地提高效率,请保持输出仓始终为半满! -tooltip.tile.windmill.0.name=由动能驱动的原始磨床;大小(宽x高x长):7x12x7;第1层7x7砖块,角落空缺,控制器在正面中心;第2-5层:5x5硬化粘土,角落空缺,可以包含一扇门,中空;墙必须至少包含一个发射器;第六层:5x5木板.角落填充,中空;第7层:7x7木板.角落空缺,中空;第8层:7x7木板.角落空缺,中空;正面中心必须是原始动力学轴箱;第9层:7x7木板.角落空缺,中空;第10层:5x5木板.角落填充,中空;第11层:3x3木板.角落填充,中空;第12层:1x1木板;需要在动力学轴箱内有转子才能运行;在控制器中输入物品;输出物品将出现在发射器中;在风力较大的地区,速度更快(像IC2风机一样) -tooltip.tile.lesu.0.name=用于GT2风格的L.E.S.U.的控制器模块;尺寸:任意 -tooltip.tile.lesu.1.name=储存每LESU机械方块: -tooltip.tile.lesu.2.name=输出EU:LESU机械方块数量; 输入EU:输出EU的下一电压等级;输入/输出安培可通过GUI中的4个编程电路进行调整;输出端只有一个点. -tooltip.tile.lesu.3.name=只允许一个控制器,不允许共享墙壁! -tooltip.tile.manualtravo.0.name=手动变压器的控制器;可在4种不同的模式下运行:;模式1:控制器内放入编程电路0:直接升压;模式2:控制器内放入编程电路1:直接降压;模式3:控制器内放入编程电路2:Tapped升压;模式4:控制器内放入编程电路3:Tapped降压;对于直接模式:3xHx3;底层至少含有一个能源仓;每1级变压器需要一层变压器线圈方块;变压器线圈方块中间是镍锌铁氧体块;顶部包含至少1个发电机仓;维护仓可放置在任何地方;Tapped模式暂不可用.(Tapped模式为在变压时获得多个电压)(译注) +tooltip.tile.mbf.0.name=巨型工业高炉的控制器方块;大小(宽x高x长):15x20x15(中空);控制器方块在第三层正面中央;内层13x18x13加热线圈(中空);外层15x18x15硼玻璃方块;玻璃等级限制了能源仓等级;1+输入仓/总线(任意机械方块);1+输出总线(任意机械方块);1+能源仓(任意机械方块);1x维护仓(任意机械方块)(注:所有底层仓室必须置于边缘);13x1x13消声仓(顶层中央);顶层剩余方块为隔热机械方块;1+输出仓以回收CO2/CO/SO2(可选,任意顶层机械方块);回收比例取决于消声仓等级;底层为隔热机械方块;自配方的最小炉温起,每高出900K会减少5%的能耗,以乘法叠加;自配方的最小炉温起,每高出1800K将允许一次无损超频;无损超频将减少加工时间至25%并提升功率至400%;每秒造成最大 +tooltip.tile.mbf.1.name=污染 +tooltip.tile.mvf.0.name=巨型真空冷冻机的控制器方块;将炽热的锭与单元强力冷却;大小(宽x高x长):15x15x15(中空);控制器方块(正面正中);1x输入总线(任意机械方块);1x输出总线(任意机械方块);1x维护仓(任意机械方块);1x能源仓(任意机械方块);剩余方块为防冻机械方块 +tooltip.tile.bvat.0.name=细菌培养缸的控制器方块;大小(宽x高x长):5x4x5;底层和顶层为洁净不锈钢机械方块;底层和顶层必须包含:;1x维护仓, 1x输出仓;1+输入仓, 1+输入总线, 0-1x放射输入仓;中间两层必须由玻璃构成,中空;任何玻璃都可以,例如匠魂的通透玻璃;某些配方需要更高级的玻璃;想要达到最高效率,保持输出仓半满! +tooltip.tile.windmill.0.name=由动能驱动的原始研磨机;大小(宽x高x长): 7x12x7;=第1层: 7x7砖块,角落空置,控制器方块在正面中央;第2-5层: 5x5硬化粘土,角落空置,可包含一扇门,;中空,墙上必须至少有一个发射器;第6层: 5x5木板.角落填充,中空.;第7层: 7x7木板.角落空置,中空.;第8层: 7x7木板.角落空置,中空,;正面中央必须是原始动力轴箱;第9层: 7x7木板.角落空置,中空.;第10层: 5x5木板.角落填充,中空.;第11层: 3x3木板.角落填充,中空.;第12层: 1x1木板;需要在轴箱中放入风车转子方可运行;在控制器方块中输入物品;输出物品将出现在发射器中;在多风的地区运行比较快(类似IC2风机) +tooltip.tile.lesu.0.name=LESU的控制器方块;大小(宽x高x长):任意 +tooltip.tile.lesu.1.name=每个LESU机械方块存储: +tooltip.tile.lesu.2.name=输出EU: LESU机械方块数量;输入EU: 输出EU的下一电压等级;输入/输出电流可通过GUI中的4个编程电路调整;输出端有一个点. +tooltip.tile.lesu.3.name=只允许一个控制器,不允许共享方块! +tooltip.tile.manualtravo.0.name=可调变压器的控制器方块;目前有四种不同的运作模式:;模式1: 编程电路0: 直接升压;模式2: 编程电路1: 直接降压;模式3: 编程电路2: 抽头升压;模式4: 编程电路3: 抽头降压;直接模式(长x高x宽): 3xHx3;底层至少包含一个能源仓;所需变压的每个电压等级都需要一层变压器绕组方块;变压器绕组块中心需为镍锌铁氧体块;顶部至少包含一个动力仓;维护仓可置于任意位置;抽头模式目前无法使用. tooltip.tile.tiereddsc.0.name=电压: -tooltip.tile.tiereddsc.1.name=输入安培: -tooltip.tile.tiereddsc.2.name=输出安培: +tooltip.tile.tiereddsc.1.name=输入电流: +tooltip.tile.tiereddsc.2.name=输出电流: tooltip.tile.tiereddsc.3.name=容量: -tooltip.tile.diode.0.name=一个简单的二极管,只允许能量流向一个方向. -tooltip.tile.energydistributor.0.name=将电流分为多个面 -tooltip.tile.biolab.0.name=生物实验室,一个多用途生物工程站 -tooltip.tile.radhatch.0.name=多方块放射性物质室 -tooltip.tile.radhatch.1.name=使用螺丝刀设置容量等级 -tooltip.tile.radhatch.2.name=材质: -tooltip.tile.radhatch.3.name=西弗特(Sv): +tooltip.tile.diode.0.name=一种简单的二极管,只允许能量流向一个方向. +tooltip.tile.energydistributor.0.name=将电流分至多面. +tooltip.tile.biolab.0.name=生物实验室,一个多用途的生物工程站 +tooltip.tile.radhatch.0.name=多方块的放射性物品输入仓 +tooltip.tile.radhatch.1.name=使用螺丝刀设置抑制等级 +tooltip.tile.radhatch.2.name=材料: +tooltip.tile.radhatch.3.name=西弗(Sv): tooltip.tile.radhatch.4.name=数量: -tooltip.tile.radhatch.5.name=时间(在t/s/m/h)来衰变(1kg): +tooltip.tile.radhatch.5.name=衰变单位质量(1kg)所需时间(t/s/m/h): tooltip.tile.radhatch.6.name=t tooltip.tile.radhatch.7.name=s tooltip.tile.radhatch.8.name=m tooltip.tile.radhatch.9.name=h tooltip.tile.acidgen.0.name=酸性发电机 -tooltip.tile.acidgen.1.name=从化学能势中产生能量. +tooltip.tile.acidgen.1.name=用化学势能产生电力. nei.biovat.0.name=需要玻璃等级: -nei.biovat.1.name=确切需要 -nei.biovat.2.name=最少需要 +nei.biovat.1.name=精确剂量 +nei.biovat.2.name=最小剂量 -tile.diode.name=电缆二极管 +tile.diode.name=线缆二极管 tile.energydistributor.name=能量分配器 -tile.acidgenerator.name=酸发生器 +tile.acidgenerator.name=酸性发电机 tile.bw.mbf.name=巨型工业高炉 tile.bw.mvf.name=巨型真空冷冻机 tile.biolab.name=生物实验室 -tile.biovat.name=生物培养缸 +tile.biovat.name=细菌培养缸 tile.radiohatch.name=放射仓 tile.bw.windmill.name=风车 -tile.manutrafo.name=手动变压器 -//This zh_CN.lang is translation by huajijam for bartworks (21/2/19) \ No newline at end of file +tile.manutrafo.name=可调变压器 \ No newline at end of file -- cgit From 89ab95b2ff8b79c812e3d965ba2d03f02a53b4e1 Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Mon, 11 Mar 2019 21:24:30 +0800 Subject: FIX ALL BUG TRANSLATION FUCK U,KIWI DO NOT FUCKING USE YOUR MACHINE TRANSLATION TO MESS UP HERE Former-commit-id: c67dc83af297417b75944e76ee68792e5b972ebb --- .../resources/assets/bartworks/lang/zh_CN.lang | 111 ++++++++++----------- 1 file changed, 55 insertions(+), 56 deletions(-) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index 7058f99598..af491fc7b0 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -1,15 +1,13 @@ -#Translated by Kiwi233 - -itemGroup.GT2C=GT2兼容 -item.GT_Rockcutter_Item_LV.name=岩石切割机LV -item.GT_Rockcutter_Item_MV.name=岩石切割机MV -item.GT_Rockcutter_Item_HV.name=岩石切割机HV -item.GT_Teslastaff_Item.name=特斯拉权杖 -BW_ItemBlocks.0.name=刻蚀青金石单元 +itemGroup.GT2C=GergTech2兼容 +item.GT_Rockcutter_Item_LV.name=岩石切割者 LV +item.GT_Rockcutter_Item_MV.name=岩石切割者 MV +item.GT_Rockcutter_Item_HV.name=岩石切割者 HV +item.GT_Teslastaff_Item.name=特斯拉权杖 +BW_ItemBlocks.0.name=蚀刻青金石单元 BW_ItemBlocks.1.name=镀层青金石单元 GT_LESU_CASING.0.name=LESU机械方块 -itemGroup.bartworks=BartWorks跨时代 +itemGroup.bartworks=BartWorks-跨时代 BW_Machinery_Casings.0.name=镍锌铁氧体块 BW_Machinery_Casings.1.name=变压器线圈块 item.BW_PaperRotor.name=原始纸转子(风车专用) @@ -27,10 +25,10 @@ item.rotors.combinedParts.name=复合材料包层木框架 item.BW_SimpleWindMeter.name=简易风速计 tile.BWHeatedWaterPump.0.name=简易斯特林水泵 item.BWrawtube.name=加长玻璃管 -item.BWmotor.name=简易斯特林马达 -item.BWstove.name=简易熔炉 +item.BWmotor.name=简易斯特林引擎 +item.BWstove.name=简易加热炉 -itemGroup.BioTab=BartWorks生物工程 +itemGroup.BioTab=BartWorks-生物工程 filled.item.petriDish.name=培养皿 item.petriDish.name=无菌培养皿 item.DNASampleFlask.name=DNA样品瓶 @@ -45,18 +43,18 @@ labModule.item.PCRThermoclyclingModule.name=聚合酶链式反应模块 labModule.item.PlasmidSynthesisModule.name=质粒合成模块 labModule.item.TransformationModule.name=转化模块 labModule.item.ClonalCellularSynthesisModule.name=克隆细胞合成模块 -BW_GlasBlocks.0.name=硼玻璃方块 -BW_GlasBlocks.1.name=镍强化硼玻璃方块 -BW_GlasBlocks.2.name=钨强化硼玻璃方块 -BW_GlasBlocks.3.name=铬强化硼玻璃方块 -BW_GlasBlocks.4.name=铱强化硼玻璃方块 -BW_GlasBlocks.5.name=锇强化硼玻璃方块 -BW_GlasBlocks.6.name=染色硼玻璃方块(红) -BW_GlasBlocks.7.name=染色硼玻璃方块(绿) -BW_GlasBlocks.8.name=染色硼玻璃方块(紫) -BW_GlasBlocks.9.name=染色硼玻璃方块(黄) -BW_GlasBlocks.10.name=染色硼玻璃方块(淡绿) -BW_GlasBlocks.11.name=染色硼玻璃方块(棕) +BW_GlasBlocks.0.name=硼硅酸盐方块 +BW_GlasBlocks.1.name=镍强化硼硅酸盐方块 +BW_GlasBlocks.2.name=钨强化硼硅酸盐方块 +BW_GlasBlocks.3.name=铬强化硼硅酸盐方块 +BW_GlasBlocks.4.name=铱强化硼硅酸盐方块 +BW_GlasBlocks.5.name=锇强化硼硅酸盐方块 +BW_GlasBlocks.6.name=染色硼硅酸盐方块(红) +BW_GlasBlocks.7.name=染色硼硅酸盐方块(绿) +BW_GlasBlocks.8.name=染色硼硅酸盐方块(紫) +BW_GlasBlocks.9.name=染色硼硅酸盐方块(黄) +BW_GlasBlocks.10.name=染色硼硅酸盐方块(淡绿) +BW_GlasBlocks.11.name=染色硼硅酸盐方块(棕) tooltip.glas.0.name=玻璃等级: tooltip.LESU.0.name=最大容量! @@ -64,7 +62,7 @@ tooltip.LESU.1.name=多个控制器! tooltip.windmeter.0.name=用于为风车选址的简易风速计. tooltip.windmeter.1.name=剩余使用次数: -tooltip.windmeter.2.name=不存在 +tooltip.windmeter.2.name=不存在的 tooltip.windmeter.3.name=很低 tooltip.windmeter.4.name=正常 tooltip.windmeter.5.name=相当强 @@ -76,52 +74,52 @@ tooltip.rotor.1.name=耐久: tooltip.rotor.2.name=效率: tooltip.cp.0.name=内部是否有编程电路? -tooltip.bw.0.name=添加者 -tooltip.bw.1.name=添加者bartimaeusnek +tooltip.bw.0.name=Added by +tooltip.bw.1.name=由bartimaeusnek添加 tooltip.bw.yes.name=是 tooltip.bw.no.name=否 tooltip.bw.tier.name=等级: -tooltip.bw.kg.0.name=千克 -tooltip.bw.kg.1.name=千克 +tooltip.bw.kg.0.name=kg +tooltip.bw.kg.1.name=kgs tooltip.bw.empty.name=空 tooltip.teslastaff.0.name=没有保修! -tooltip.labmodule.0.name=用于改变生物实验室工作模式的模块 +tooltip.labmodule.0.name=用于更改生物实验室工作模式的模块 tooltip.labparts.0.name=一个空的无菌培养皿 -tooltip.labparts.1.name=一个空的DNA样品瓶 -tooltip.labparts.2.name=一个空的质粒样品瓶 +tooltip.labparts.1.name=一个空的DNA烧瓶. +tooltip.labparts.2.name=一个空的质粒单元. tooltip.labparts.3.name=生物工程专用洗涤粉 -tooltip.labparts.4.name=用于辅助电泳分离DNA的粉末 -tooltip.labparts.5.name=一个培养皿,内含: -tooltip.labparts.6.name=这是一种很弱的培养菌,不能在细菌培养缸中繁殖! -tooltip.labparts.7.name=一个DNA样品瓶,内含: -tooltip.labparts.8.name=一个质粒样品瓶,内含: +tooltip.labparts.4.name=电泳分离DNA的粉末. +tooltip.labparts.5.name=培养皿内含有: +tooltip.labparts.6.name=这是一种很弱的培养菌,不能在细菌培养皿中繁殖! +tooltip.labparts.7.name=一个DNA烧瓶,内含: +tooltip.labparts.8.name=一个质粒单元,内含: -tooltip.tile.waterpump.0.name=生产 +tooltip.tile.waterpump.0.name=产出 tooltip.tile.waterpump.1.name=L/s水,有燃料时. tooltip.tile.waterpump.2.name=必须放在地上. -tooltip.tile.mbf.0.name=巨型工业高炉的控制器方块;大小(宽x高x长):15x20x15(中空);控制器方块在第三层正面中央;内层13x18x13加热线圈(中空);外层15x18x15硼玻璃方块;玻璃等级限制了能源仓等级;1+输入仓/总线(任意机械方块);1+输出总线(任意机械方块);1+能源仓(任意机械方块);1x维护仓(任意机械方块)(注:所有底层仓室必须置于边缘);13x1x13消声仓(顶层中央);顶层剩余方块为隔热机械方块;1+输出仓以回收CO2/CO/SO2(可选,任意顶层机械方块);回收比例取决于消声仓等级;底层为隔热机械方块;自配方的最小炉温起,每高出900K会减少5%的能耗,以乘法叠加;自配方的最小炉温起,每高出1800K将允许一次无损超频;无损超频将减少加工时间至25%并提升功率至400%;每秒造成最大 -tooltip.tile.mbf.1.name=污染 -tooltip.tile.mvf.0.name=巨型真空冷冻机的控制器方块;将炽热的锭与单元强力冷却;大小(宽x高x长):15x15x15(中空);控制器方块(正面正中);1x输入总线(任意机械方块);1x输出总线(任意机械方块);1x维护仓(任意机械方块);1x能源仓(任意机械方块);剩余方块为防冻机械方块 -tooltip.tile.bvat.0.name=细菌培养缸的控制器方块;大小(宽x高x长):5x4x5;底层和顶层为洁净不锈钢机械方块;底层和顶层必须包含:;1x维护仓, 1x输出仓;1+输入仓, 1+输入总线, 0-1x放射输入仓;中间两层必须由玻璃构成,中空;任何玻璃都可以,例如匠魂的通透玻璃;某些配方需要更高级的玻璃;想要达到最高效率,保持输出仓半满! -tooltip.tile.windmill.0.name=由动能驱动的原始研磨机;大小(宽x高x长): 7x12x7;=第1层: 7x7砖块,角落空置,控制器方块在正面中央;第2-5层: 5x5硬化粘土,角落空置,可包含一扇门,;中空,墙上必须至少有一个发射器;第6层: 5x5木板.角落填充,中空.;第7层: 7x7木板.角落空置,中空.;第8层: 7x7木板.角落空置,中空,;正面中央必须是原始动力轴箱;第9层: 7x7木板.角落空置,中空.;第10层: 5x5木板.角落填充,中空.;第11层: 3x3木板.角落填充,中空.;第12层: 1x1木板;需要在轴箱中放入风车转子方可运行;在控制器方块中输入物品;输出物品将出现在发射器中;在多风的地区运行比较快(类似IC2风机) -tooltip.tile.lesu.0.name=LESU的控制器方块;大小(宽x高x长):任意 -tooltip.tile.lesu.1.name=每个LESU机械方块存储: -tooltip.tile.lesu.2.name=输出EU: LESU机械方块数量;输入EU: 输出EU的下一电压等级;输入/输出电流可通过GUI中的4个编程电路调整;输出端有一个点. -tooltip.tile.lesu.3.name=只允许一个控制器,不允许共享方块! -tooltip.tile.manualtravo.0.name=可调变压器的控制器方块;目前有四种不同的运作模式:;模式1: 编程电路0: 直接升压;模式2: 编程电路1: 直接降压;模式3: 编程电路2: 抽头升压;模式4: 编程电路3: 抽头降压;直接模式(长x高x宽): 3xHx3;底层至少包含一个能源仓;所需变压的每个电压等级都需要一层变压器绕组方块;变压器绕组块中心需为镍锌铁氧体块;顶部至少包含一个动力仓;维护仓可置于任意位置;抽头模式目前无法使用. +tooltip.tile.mbf.0.name=巨型工业高炉的控制器方块;大小(宽x高x长):15x20x15(中空);控制器方块在第三层正面中央;内层13x18x13加热线圈(中空);外层15x18x15硼硅酸盐玻璃方块;玻璃等级限制了能源仓等级;1+输入仓/总线(任意机械方块);1+输出总线(任意机械方块);1+能源仓(任意机械方块);1x维护仓(任意机械方块)(注:所有底层仓室必须置于边缘);13x1x13消声仓(顶层中央);外部15x15的防热机械方块(第20层);1+输出仓以回收CO2/CO/SO2(可选,任意顶层机械方块);回收比例取决于消声仓等级;底层为隔热机械方块;自物品配方的最小炉温起,每高出900K会减少5%的能耗,使用乘法叠加;自物品配方的最小所需炉温起,每高出1800K将允许一次无损的超频;无损超频将减少加工时间至25%并提升功率至400%;每秒造成最大 +tooltip.tile.mbf.1.name=污染每秒 +tooltip.tile.mvf.0.name=巨型真空冷冻机的控制器方块;将炽热的锭与单元强力冷却;大小(宽x高x长):15x15x15(中空);控制器方块(正面正中);1x输入总线(任意机械方块);1x输出总线(任意机械方块);1x维护仓(任意机械方块);1x能源仓(任意机械方块);剩余方块为防冻机械方块 +tooltip.tile.bvat.0.name=生物培养缸的控制器方块;大小(宽x高x长);5x4x5;底层和顶层为洁净不锈钢机械方块;底层和顶层必须包含:;1个维护仓,1个输出仓;1+输入仓,1个以上的输入总线,0-1个放射输入仓;中间两层必须由玻璃构成,中空;玻璃可以为任何玻璃,例如匠魂的通透玻璃;一些配方需要更高级的玻璃为了最大限度地提高效率,请保持输出仓始终为半满! +tooltip.tile.windmill.0.name=由动能驱动的原始磨床;大小(宽x高x长):7x12x7;第1层:7x7砖块,角落空置,控制器方块在正面中央;第2-5层:5x5硬化粘土,角落空置,可包含一扇门,;中空,墙必须至少包含一个发射器;第6层:5x5木板.角落填充,中空.;第7层:7x7木板.角落空置,中空.;第8层:7x7木板.角落空置,中空,;正面中央必须是原始动力轴箱;第9层:7x7木板.角落空置,中空.;第10层:5x5木板.角落填充,中空.;第11层:3x3木板.角落填充,中空.;第12层:1x1木板;需要在轴箱中放入风车转子才可运行;在控制器中输入物品;输出物品将出现在发射器中;在风大的地区运行较快(像IC2风机一样) +tooltip.tile.lesu.0.name=用于GT2风格的L.E.S.U.的控制器方块;尺寸:任意 +tooltip.tile.lesu.1.name=每个LESU机械方块存储: +tooltip.tile.lesu.2.name=输出EU:LESU机械方块数量; 输入EU:输出EU的下一电压等级;输入/输出安培可通过GUI中的4个编程电路进行调整;输出端只有一个点. +tooltip.tile.lesu.3.name=只允许一个控制器,不允许墙壁共享! +tooltip.tile.manualtravo.0.name=手动变压器的控制器方块;可在4种不同的模式下运行:;模式1:控制器内放入编程电路0:直接升压;模式2:控制器内放入编程电路1:直接降压;模式3:控制器内放入编程电路2:Tapped升压;模式4:控制器内放入编程电路3:Tapped降压;直接模式(长x高x宽):3xHx3;底层至少包含一个能源仓;每1级变压器需要一层变压器线圈方块;变压器线圈方块中心需为镍锌铁氧体块;顶部至少包含一个动力仓;维护仓可置于任意位置;Tapped模式暂不可用.(Tapped模式为在变压时获得多个电压)(译注) tooltip.tile.tiereddsc.0.name=电压: -tooltip.tile.tiereddsc.1.name=输入电流: -tooltip.tile.tiereddsc.2.name=输出电流: +tooltip.tile.tiereddsc.1.name=输入安培: +tooltip.tile.tiereddsc.2.name=输出安培: tooltip.tile.tiereddsc.3.name=容量: -tooltip.tile.diode.0.name=一种简单的二极管,只允许能量流向一个方向. -tooltip.tile.energydistributor.0.name=将电流分至多面. +tooltip.tile.diode.0.name=一个简单的二极管,只允许能量流向一个方向. +tooltip.tile.energydistributor.0.name=将电流分至多个面. tooltip.tile.biolab.0.name=生物实验室,一个多用途的生物工程站 -tooltip.tile.radhatch.0.name=多方块的放射性物品输入仓 +tooltip.tile.radhatch.0.name=多方块机器的放射性物品输入仓 tooltip.tile.radhatch.1.name=使用螺丝刀设置抑制等级 tooltip.tile.radhatch.2.name=材料: -tooltip.tile.radhatch.3.name=西弗(Sv): +tooltip.tile.radhatch.3.name=希沃特(Sv): tooltip.tile.radhatch.4.name=数量: tooltip.tile.radhatch.5.name=衰变单位质量(1kg)所需时间(t/s/m/h): tooltip.tile.radhatch.6.name=t @@ -140,7 +138,8 @@ tile.acidgenerator.name=酸性发电机 tile.bw.mbf.name=巨型工业高炉 tile.bw.mvf.name=巨型真空冷冻机 tile.biolab.name=生物实验室 -tile.biovat.name=细菌培养缸 +tile.biovat.name=生物培养缸 tile.radiohatch.name=放射仓 tile.bw.windmill.name=风车 -tile.manutrafo.name=可调变压器 \ No newline at end of file +tile.manutrafo.name=手动变压器 +//This zh_CN.lang is translation by huajijam for bartworks (11/3/19) \ No newline at end of file -- cgit From 6ed7bd8e4d118736820692238caad1973cd37477 Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Mon, 11 Mar 2019 21:52:47 +0800 Subject: Make the translation smooth Former-commit-id: e65a76ecc1e37f2d1e50d00cc66bb6a283d147d3 --- src/main/resources/assets/bartworks/lang/zh_CN.lang | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index af491fc7b0..027ff7b7e4 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -3,8 +3,8 @@ item.GT_Rockcutter_Item_LV.name=岩石切割者 LV item.GT_Rockcutter_Item_MV.name=岩石切割者 MV item.GT_Rockcutter_Item_HV.name=岩石切割者 HV item.GT_Teslastaff_Item.name=特斯拉权杖 -BW_ItemBlocks.0.name=蚀刻青金石单元 -BW_ItemBlocks.1.name=镀层青金石单元 +BW_ItemBlocks.0.name=蚀刻青金石元件 +BW_ItemBlocks.1.name=镀层青金石元件 GT_LESU_CASING.0.name=LESU机械方块 itemGroup.bartworks=BartWorks-跨时代 @@ -15,8 +15,8 @@ item.BW_LeatherRotor.name=原始皮革转子(风车专用) item.BW_WoolRotor.name=原始羊毛转子(风车专用) item.BW_CombinedRotor.name=原始复合转子(风车专用) tile.BWRotorBlock.0.name=原始动力轴箱 -item.grindstone_top.name=磨石顶部件 -item.grindstone_bottom.name=磨石底部件 +item.grindstone_top.name=磨石顶部 +item.grindstone_bottom.name=磨石底部 item.completed_grindstone.name=磨石 item.rotors.leatherParts.name=皮革包层木框架 item.rotors.woolParts.name=羊毛包层木框架 @@ -31,8 +31,8 @@ item.BWstove.name=简易加热炉 itemGroup.BioTab=BartWorks-生物工程 filled.item.petriDish.name=培养皿 item.petriDish.name=无菌培养皿 -item.DNASampleFlask.name=DNA样品瓶 -item.PlasmidCell.name=质粒样品瓶 +item.DNASampleFlask.name=DNA样品烧瓶 +item.PlasmidCell.name=质粒样品烧瓶 item.DetergentPowder.name=洗涤粉 item.Agarose.name=琼脂糖 item.IncubationModule.name=孵化模块 @@ -95,8 +95,8 @@ tooltip.labparts.6.name=这是一种很弱的培养菌,不能在细菌培养皿 tooltip.labparts.7.name=一个DNA烧瓶,内含: tooltip.labparts.8.name=一个质粒单元,内含: -tooltip.tile.waterpump.0.name=产出 -tooltip.tile.waterpump.1.name=L/s水,有燃料时. +tooltip.tile.waterpump.0.name=在有燃料时,产出 +tooltip.tile.waterpump.1.name=L/s水. tooltip.tile.waterpump.2.name=必须放在地上. tooltip.tile.mbf.0.name=巨型工业高炉的控制器方块;大小(宽x高x长):15x20x15(中空);控制器方块在第三层正面中央;内层13x18x13加热线圈(中空);外层15x18x15硼硅酸盐玻璃方块;玻璃等级限制了能源仓等级;1+输入仓/总线(任意机械方块);1+输出总线(任意机械方块);1+能源仓(任意机械方块);1x维护仓(任意机械方块)(注:所有底层仓室必须置于边缘);13x1x13消声仓(顶层中央);外部15x15的防热机械方块(第20层);1+输出仓以回收CO2/CO/SO2(可选,任意顶层机械方块);回收比例取决于消声仓等级;底层为隔热机械方块;自物品配方的最小炉温起,每高出900K会减少5%的能耗,使用乘法叠加;自物品配方的最小所需炉温起,每高出1800K将允许一次无损的超频;无损超频将减少加工时间至25%并提升功率至400%;每秒造成最大 -- cgit From f2587e15a1d620bd8f268cf4bcb2c5e2611995ee Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 20 Mar 2019 05:59:15 +0100 Subject: smaller fixes +no hardness or resistance on non gt te blocks +fixed possible lesu npe +maybe fixed windmill dupe? Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 738b8615f27431fbc18e1be41314378e495e6bce --- .../bartworks/common/blocks/BW_TileEntityContainer.java | 3 ++- .../bartimaeusnek/bartworks/common/loaders/RecipeLoader.java | 1 + .../bartworks/common/tileentities/multis/GT_TileEntity_LESU.java | 2 +- .../common/tileentities/multis/GT_TileEntity_Windmill.java | 8 +++++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index 4944355722..6cbca9b7ad 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -55,6 +55,8 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI public BW_TileEntityContainer(Material p_i45386_1_, Class tileEntity, String blockName) { super(p_i45386_1_); this.tileEntity = tileEntity; + this.setHardness(15.0F); + this.setResistance(30.0F); this.setCreativeTab(MainMod.BWT); this.setBlockName(blockName); this.setBlockTextureName(MainMod.MOD_ID + ":" + blockName); @@ -87,7 +89,6 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI return false; } - public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack itemStack) { final TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof IWrenchable && itemStack != null) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 95cb64890b..972eacef2d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -600,6 +600,7 @@ public class RecipeLoader implements Runnable { 'W', "logWood", } ); + GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 8e7042908a..c3aabbd0da 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -295,7 +295,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { case 1: return true; default: - return p_94041_2_.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); + return p_94041_2_ != null && p_94041_2_.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 5d601ed32c..0d36a4fcb7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -114,7 +114,13 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { if (new XSTR().nextInt(2) == 0) { if (tRecipe.getOutput(1) != null) mOutputItems[1] = tRecipe.getOutput(1); - else if (GT_OreDictUnificator.getAssociation(aStack) == null || GT_OreDictUnificator.getAssociation(aStack).mMaterial == null || GT_OreDictUnificator.getAssociation(aStack).mMaterial.mMaterial == null || + if( !BW_Util.checkStackAndPrefix(mOutputItems[0]) || + !( + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL)|| + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTALLISABLE) + ) + || BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Flint || BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Sugar || BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Wheat || -- cgit From dd7efdce9c4609ee42266f894cbd5209948e451f Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 20 Mar 2019 06:01:59 +0100 Subject: forgot else Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: eaf46cbf6b5df8deb3d46d3386ec791e637db265 --- .../bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 0d36a4fcb7..a7d4ce12ba 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -114,7 +114,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { if (new XSTR().nextInt(2) == 0) { if (tRecipe.getOutput(1) != null) mOutputItems[1] = tRecipe.getOutput(1); - if( !BW_Util.checkStackAndPrefix(mOutputItems[0]) || + else if( !BW_Util.checkStackAndPrefix(mOutputItems[0]) || !( BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL)|| -- cgit From 7bd2aa9ebf9525b6060158d07eff399018d22ef3 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 26 Mar 2019 16:55:53 +0100 Subject: fixed circuit programmer dupe -began work on Electric Implosion compressor -fixed recipes -added multi layer rotor recipes Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: ac86bf97f142d1fe2f1bf4da47e274441a5430a2 --- .../github/bartimaeusnek/bartworks/MainMod.java | 37 +++ .../bartworks/common/loaders/ItemRegistry.java | 3 +- .../bartworks/common/loaders/RecipeLoader.java | 80 ++++++- .../multis/GT_TileEntity_CrackingDistillTower.java | 92 +++++++ .../GT_TileEntity_ElectricImplosionCompressor.java | 263 +++++++++++++++++++++ .../mega/GT_TileEntity_MegaProcessingArray.java | 207 ++++++++++++++++ .../container/GT_Container_CircuitProgrammer.java | 21 +- .../bartimaeusnek/bartworks/util/BWRecipes.java | 8 + 8 files changed, 690 insertions(+), 21 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index e0384239ba..56d15fa479 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -35,21 +35,33 @@ import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader; import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartedEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; +import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.SubTag; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import java.util.HashSet; + +import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; + @Mod( modid = MainMod.MOD_ID, name = MainMod.NAME, version = MainMod.VERSION, dependencies = "required-after:IC2; " @@ -110,4 +122,29 @@ public final class MainMod { new GTNHBlocks().run(); BioObjectAdder.regenerateBioFluids(); } + + @Mod.EventHandler + public void onServerStarted(FMLServerStartedEvent event){ + eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String)null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); + for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList){ + if (recipe == null || recipe.mInputs == null) + continue; + ItemStack input = recipe.mInputs[0]; + int i = 0; + while(checkForExplosives(input)){ + try { + i++; + input = recipe.mInputs[i]; + }catch (ArrayIndexOutOfBoundsException e){ + LOGGER.error("CAUGHT DEFECTIVE IMPLOSION COMPRESSOR RECIPE."); + e.printStackTrace(); + } + } + eicMap.addRecipe(true,new ItemStack[]{input}, recipe.mOutputs,null,null,null,recipe.mDuration, BW_Util.getMachineVoltageFromTier(10),0); + } + } + + private boolean checkForExplosives(ItemStack input){ + return (GT_Utility.areStacksEqual(input,new ItemStack(Blocks.tnt)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L))|| GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index bdfe5c9850..c945a19d14 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -31,6 +31,7 @@ import com.github.bartimaeusnek.bartworks.common.items.*; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_DEHP; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaBlastFurnace; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_AcidGenerator; @@ -161,7 +162,7 @@ public class ItemRegistry { dehp = new GT_TileEntity_DEHP(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump").getStackForm(1L); megaMachines[0] = new GT_TileEntity_MegaBlastFurnace(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, "MegaBlastFurnace", StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L); megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, "MegaVacuumFreezer", StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L); - + new GT_TileEntity_ElectricImplosionCompressor( ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 4,"Electric Implosion Compressor","Electric Implosion Compressor"); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 972eacef2d..fe2af47746 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_LESU; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_Windmill; @@ -56,16 +57,16 @@ public class RecipeLoader implements Runnable { * GTNH "hardmode" Recipes */ - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(Blocks.lapis_block), Materials.Iron.getMolten(1296L), new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), 100, (int) (GT_Values.V[3] - (GT_Values.V[3] / 10))); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), Materials.Lapis.getPlates(9), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2L), GT_Utility.getIntegratedCircuit(17)}, FluidRegistry.getFluidStack("ic2coolant", 1000), new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), 100, (int) (GT_Values.V[3] - (GT_Values.V[3] / 10))); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), Materials.Lapis.getBlocks(8), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, (int) (GT_Values.V[3] - (GT_Values.V[3] / 10))); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(Blocks.lapis_block), Materials.Iron.getMolten(1296L), new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), 100, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), Materials.Lapis.getPlates(9), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2L), GT_Utility.getIntegratedCircuit(17)}, FluidRegistry.getFluidStack("ic2coolant", 1000), new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), 100, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), Materials.Lapis.getBlocks(8), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, BW_Util.getMachineVoltageFromTier(3)); } else { /* * Vanilla Recipes */ - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{Materials.Lapis.getBlocks(8), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, (int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{Materials.Lapis.getBlocks(8), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, BW_Util.getMachineVoltageFromTier(1)); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.BW_BLOCKS[1]), @@ -78,9 +79,9 @@ public class RecipeLoader implements Runnable { 'C', "circuitBasic" }); - GT_Values.RA.addCutterRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[1]), new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), GT_Values.NI, 100, (int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); - GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, (int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); - GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 0), new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, (int) (GT_Values.V[1] - (GT_Values.V[1] / 10))); + GT_Values.RA.addCutterRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[1]), new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), GT_Values.NI, 100, BW_Util.getMachineVoltageFromTier(1)); + GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, BW_Util.getMachineVoltageFromTier(1)); + GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 0), new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, BW_Util.getMachineVoltageFromTier(1)); GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), RecipeLoader.BITSD, new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1)}); GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), RecipeLoader.BITSD, new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0)}); } @@ -462,7 +463,7 @@ public class RecipeLoader implements Runnable { Materials.Plastic.getMolten(1152L), new ItemStack(ItemRegistry.BW_BLOCKS[2], 1, 1), 20, - (int) (GT_Values.V[3] - (GT_Values.V[3] / 10)) + BW_Util.getMachineVoltageFromTier(3) ); GT_ModHandler.addCraftingRecipe( @@ -479,7 +480,7 @@ public class RecipeLoader implements Runnable { } ); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), Materials.Aluminium.getPlates(1), ItemList.Circuit_Board_Plastic.get(1L), ItemList.Battery_RE_LV_Lithium.get(1L)}, Materials.SolderingAlloy.getMolten(288L), new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER), 600, (int) (GT_Values.V[2] - (GT_Values.V[2] / 10))); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), Materials.Aluminium.getPlates(1), ItemList.Circuit_Board_Plastic.get(1L), ItemList.Battery_RE_LV_Lithium.get(1L)}, Materials.SolderingAlloy.getMolten(288L), new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER), 600, BW_Util.getMachineVoltageFromTier(2)); GT_ModHandler.addCraftingRecipe( new GT_TileEntity_Windmill(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 2, "bw.windmill", StatCollector.translateToLocal("tile.bw.windmill.name")).getStackForm(1L), @@ -614,6 +615,63 @@ public class RecipeLoader implements Runnable { 'W', "logWood", } ); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{ + "WEs", + "WZh", + "WDf", + 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', "logWood", + } + ); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{ + "WEs", + "WZh", + "WDf", + 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', "logWood", + } + ); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{ + "WEs", + "WZh", + "WDf", + 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', "logWood", + } + ); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{ + "WEs", + "WZh", + "WDf", + 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', "logWood", + } + ); + GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.LEATHER_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, @@ -672,8 +730,6 @@ public class RecipeLoader implements Runnable { ); } - - - } + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java new file mode 100644 index 0000000000..d0a242b23f --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; + +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DistillationTower; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; + +public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_DistillationTower { + + public GT_TileEntity_CrackingDistillTower(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_CrackingDistillTower(String aName) { + super(aName); + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + if (!GT_Utility.areStacksEqual(itemStack, GT_Utility.getIntegratedCircuit(0),true)) + return false; + else{ + FluidStack[] array = new FluidStack[0]; + ArrayList fluidInputs = new ArrayList(); + for (GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches){ + if (hatch != null){ + fluidInputs.add(hatch.getFluid()); + } + } + array = fluidInputs.toArray(array); + GT_Recipe.GT_Recipe_Map rMapCracking = GT_Recipe.GT_Recipe_Map.sCrakingRecipes; + GT_Recipe.GT_Recipe_Map rMapDistillTower = GT_Recipe.GT_Recipe_Map.sDistillationRecipes; + GT_Recipe recipeCracking = rMapCracking.findRecipe(this.getBaseMetaTileEntity(),false,this.getMaxInputVoltage(),array,itemStack); + if (recipeCracking == null) + return false; + GT_Recipe recipeDistill = rMapDistillTower.findRecipe(this.getBaseMetaTileEntity(),false,this.getMaxInputVoltage(),recipeCracking.mFluidOutputs); + if (recipeDistill == null) + return false; + float ratio = (float)recipeCracking.mFluidOutputs[0].amount/(float)recipeDistill.mFluidInputs[0].amount; + FluidStack[] nuoutputs = new FluidStack[recipeDistill.mFluidOutputs.length]; + for (int i = 0; i < nuoutputs.length; i++) { + nuoutputs[i]=recipeDistill.mFluidOutputs[i]; + nuoutputs[i].amount=(int)(Math.floor(recipeDistill.mFluidOutputs[i].amount*ratio)); + } + BWRecipes.DynamicGTRecipe combined = new BWRecipes.DynamicGTRecipe(true,null,recipeDistill.mOutputs,null,recipeDistill.mChances,recipeCracking.mFluidInputs,nuoutputs,(int)(Math.floor(recipeDistill.mDuration*ratio))+recipeCracking.mDuration,Math.max((int)(Math.floor(recipeDistill.mEUt*ratio)),recipeCracking.mEUt),0); + if (combined.isRecipeInputEqual(true, array)){ + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + BW_Util.calculateOverclockedNessMulti(combined.mEUt, combined.mDuration, 1, this.getMaxInputVoltage(), this); + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputFluids=combined.mFluidOutputs.clone(); + this.mOutputItems=combined.mOutputs.clone(); + this.updateSlots(); + return true; + } + } + return false; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java new file mode 100644 index 0000000000..2c326887ed --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -0,0 +1,263 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Pollution; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ImplosionCompressor; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; +import java.util.Iterator; + +import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; + +public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity_ImplosionCompressor { + + private boolean piston; + + public GT_TileEntity_ElectricImplosionCompressor(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_ElectricImplosionCompressor(String aName) { + super(aName); + } + + public static GT_Recipe.GT_Recipe_Map eicMap; + + @Override + public boolean checkRecipe(ItemStack aStack) { + + if (this.mEnergyHatches.get(0).getEUVar() <= 0 || this.mEnergyHatches.get(1).getEUVar() <= 0 ) + return false; + + ArrayList tInputList = this.getStoredInputs(); + int tInputList_sS = tInputList.size(); + + for(int i = 0; i < tInputList_sS - 1; ++i) { + for(int j = i + 1; j < tInputList_sS; ++j) { + if (GT_Utility.areStacksEqual((ItemStack)tInputList.get(i), (ItemStack)tInputList.get(j))) { + if (((ItemStack)tInputList.get(i)).stackSize < ((ItemStack)tInputList.get(j)).stackSize) { + tInputList.remove(i--); + tInputList_sS = tInputList.size(); + break; + } + + tInputList.remove(j--); + tInputList_sS = tInputList.size(); + } + } + } + + ItemStack[] tInputs = (ItemStack[])tInputList.toArray(new ItemStack[tInputList.size()]); + if (tInputList.size() > 0) { + GT_Recipe tRecipe = eicMap.findRecipe(this.getBaseMetaTileEntity(), false, 9223372036854775807L, (FluidStack[])null, tInputs); + if (tRecipe != null && tRecipe.isRecipeInputEqual(true, (FluidStack[])null, tInputs)) { + this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; + this.mEfficiencyIncrease = 10000; + this.mEUt = -tRecipe.mEUt; + this.mMaxProgresstime = Math.max(1, tRecipe.mDuration); + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; + this.sendLoopStart((byte)20); + this.updateSlots(); + return true; + } + } + + return false; + } + + @Override + public boolean onRunningTick(ItemStack aStack) { + if (this.mRuntime % 10 == 0) + togglePiston(); + return super.onRunningTick(aStack); + } + + public void stopMachine(){ + resetPiston(); + super.stopMachine(); + } + + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + piston = true; + } + + private void resetPiston(){ + if (this.getBaseMetaTileEntity().getWorld().isRemote) + return; + if (!piston){ + int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; + int aX = this.getBaseMetaTileEntity().getXCoord(),aY = this.getBaseMetaTileEntity().getYCoord() ,aZ = this.getBaseMetaTileEntity().getZCoord(); + for (int x = -1; x <= 1; x++) { + for (int z = -1; z <= 1; z++) { + if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) + this.getBaseMetaTileEntity().getWorld().setBlock(xDir + aX + x, aY + 2, zDir + aZ + z, GregTech_API.sBlockMetal5, 2, 3); + } + } + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + piston = !piston; + } + } + private void togglePiston() { + if (this.getBaseMetaTileEntity().getWorld().isRemote) + return; + int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; + int aX = this.getBaseMetaTileEntity().getXCoord(),aY = this.getBaseMetaTileEntity().getYCoord() ,aZ = this.getBaseMetaTileEntity().getZCoord(); + boolean hax = false; + if(piston){ + for (int x = -1; x <= 1; x++) { + for (int z = -1; z <= 1; z++) { + if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) { + if (this.getBaseMetaTileEntity().getBlock(xDir+aX+x,aY+2,zDir+aZ+z) != GregTech_API.sBlockMetal5 && this.getBaseMetaTileEntity().getMetaID(xDir+aX+x,aY+2,zDir+aZ+z) != 2 ) { + hax = true; + } + this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + aX + x, aY + 2, zDir + aZ + z); + } + } + } + GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + piston=!piston; + } else { + for (int x = -1; x <= 1; x++) { + for (int z = -1; z <= 1; z++) { + if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) + this.getBaseMetaTileEntity().getWorld().setBlock(xDir+aX+x,aY+2,zDir+aZ+z,GregTech_API.sBlockMetal5,2,3); + } + } + GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + piston = !piston; + } + if (hax) + this.explodeMultiblock(); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setBoolean("piston",piston); + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + piston=aNBT.getBoolean("piston"); + super.loadNBTData(aNBT); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + + for (int x = -1; x <= 1; x++) { + for (int y = -2; y < 7; y++) { + for (int z = -1; z <= 1; z++) { + IGregTechTileEntity te = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir+x,y,z+zDir); + if (y == -2 || y == 6) { + if (!(x == 0 && z == 0)) { + if (!this.addMaintenanceToMachineList(te, 16) && !this.addMufflerToMachineList(te, 16) && !this.addInputToMachineList(te, 16) && !this.addOutputToMachineList(te, 16)) { + Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z); + byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); + if ((tBlock != GregTech_API.sBlockCasings2 || tMeta != 0) && (tBlock != GregTech_API.sBlockCasings3 || tMeta != 4)) { + return false; + } + } + } + else if (x == 0 && z == 0) { + if (y == -2) + if (!this.addEnergyInputToMachineList(te, 16)) + return false; + if (y == 6) + if (!this.addEnergyInputToMachineList(te, 16)) + return false; + } + } + else if ((y > -2 && y < 1) || (y > 3 && y < 6)){ + if (y == 0 && xDir+x == 0 && zDir+z==0) + continue; + Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z); + byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); + if (x == 0 && z == 0) { + if (tBlock != BW_BLOCKS[2] || tMeta != 0) + return false; + }else{ + if (tBlock != BW_BLOCKS[2] || tMeta != 1) + return false; + } + + } + else if (y == 1) { + if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 1, zDir + z),1,aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + return false; + } + else if (y == 2) { + if (!piston) { + if (Math.abs(x) == 1 && Math.abs(z) == 1) { + if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z),1,aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + return false; + } + }else if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z),1,aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + return false; + } + else if (y == 3) { + if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 3, zDir + z),1,aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + return false; + } + } + } + } + return true; + } + + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_ElectricImplosionCompressor(this.mName); + } + + @Override + public String[] getDescription() { + return new String[0]; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java new file mode 100644 index 0000000000..414b7b3122 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; + +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.GT_Mod; +import gregtech.api.enums.GT_Values; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ProcessingArray; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.ArrayUtils; + +import java.util.ArrayList; +import java.util.List; + +import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.isValidForLowGravity; + +public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_ProcessingArray { + public GT_TileEntity_MegaProcessingArray(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_MegaProcessingArray(String aName) { + super(aName); + } + + private GT_Recipe mLastRecipe; + private int tTier = 0; + private int mMult = 0; + private String mMachine = ""; + + private GT_MetaTileEntity_Hatch_InputBus machineBus; + + public boolean checkRecipe(ItemStack aStack) { + if (!isCorrectMachinePart(machineBus.mInventory[0])) { + return false; + } + + GT_Recipe.GT_Recipe_Map map = getRecipeMap(); + if (map == null) return false; + ArrayList tInputList = getStoredInputs(); + + if (mInventory[1].getUnlocalizedName().endsWith("10")) { + tTier = 9; + mMult = 2;//u need 4x less machines and they will use 4x less power + } else if (mInventory[1].getUnlocalizedName().endsWith("11")) { + tTier = 9; + mMult = 4;//u need 16x less machines and they will use 16x less power + } else if (mInventory[1].getUnlocalizedName().endsWith("12") || + mInventory[1].getUnlocalizedName().endsWith("13") || + mInventory[1].getUnlocalizedName().endsWith("14") || + mInventory[1].getUnlocalizedName().endsWith("15")) { + tTier = 9; + mMult = 6;//u need 64x less machines and they will use 64x less power + } else if (mInventory[1].getUnlocalizedName().endsWith("1")) { + tTier = 1; + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("2")) { + tTier = 2; + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("3")) { + tTier = 3; + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("4")) { + tTier = 4; + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("5")) { + tTier = 5; + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("6")) { + tTier = 6; + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("7")) { + tTier = 7; + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("8")) { + tTier = 8; + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("9")) { + tTier = 9; + mMult = 0;//*1 + } else { + tTier = 0; + mMult = 0;//*1 + } + + if (!mMachine.equals(mInventory[1].getUnlocalizedName())) mLastRecipe = null; + mMachine = mInventory[1].getUnlocalizedName(); + ItemStack[] tInputs = (ItemStack[]) tInputList.toArray(new ItemStack[tInputList.size()]); + + ArrayList tFluidList = getStoredFluids(); + + FluidStack[] tFluids = (FluidStack[]) tFluidList.toArray(new FluidStack[tFluidList.size()]); + if (tInputList.size() > 0 || tFluids.length > 0) { + GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + if (tRecipe != null) { + if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 && + !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId)) + return false; + + mLastRecipe = tRecipe; + this.mEUt = 0; + this.mOutputItems = null; + this.mOutputFluids = null; + int machines = Math.min(64, mInventory[1].stackSize << mMult); //Upped max Cap to 64 + int i = 0; + for (; i < machines; i++) { + if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { + if (i == 0) { + return false; + } + break; + } + } + this.mMaxProgresstime = tRecipe.mDuration; + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + BW_Util.calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, map.mAmperage, GT_Values.V[tTier],this); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + this.mEUt = GT_Utility.safeInt(((long) this.mEUt * i) >> mMult, 1); + if (mEUt == Integer.MAX_VALUE - 1) + return false; + + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length]; + for (int h = 0; h < tRecipe.mOutputs.length; h++) { + if (tRecipe.getOutput(h) != null) { + tOut[h] = tRecipe.getOutput(h).copy(); + tOut[h].stackSize = 0; + } + } + FluidStack tFOut = null; + if (tRecipe.getFluidOutput(0) != null) tFOut = tRecipe.getFluidOutput(0).copy(); + for (int f = 0; f < tOut.length; f++) { + if (tRecipe.mOutputs[f] != null && tOut[f] != null) { + for (int g = 0; g < i; g++) { + if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) + tOut[f].stackSize += tRecipe.mOutputs[f].stackSize; + } + } + } + if (tFOut != null) { + int tSize = tFOut.amount; + tFOut.amount = tSize * i; + } + tOut = clean(tOut); + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + List overStacks = new ArrayList(); + for (int f = 0; f < tOut.length; f++) { + while (tOut[f].getMaxStackSize() < tOut[f].stackSize) { + if (tOut[f] != null) { + ItemStack tmp = tOut[f].copy(); + tmp.stackSize = tmp.getMaxStackSize(); + tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize(); + overStacks.add(tmp); + } + } + } + if (overStacks.size() > 0) { + ItemStack[] tmp = new ItemStack[overStacks.size()]; + tmp = overStacks.toArray(tmp); + tOut = ArrayUtils.addAll(tOut, tmp); + } + List tSList = new ArrayList(); + for (ItemStack tS : tOut) { + if (tS.stackSize > 0) tSList.add(tS); + } + tOut = tSList.toArray(new ItemStack[tSList.size()]); + this.mOutputItems = tOut; + this.mOutputFluids = new FluidStack[]{tFOut}; + updateSlots(); + return true; + }/* else{ + ...remoteRecipeCheck() + }*/ + } + return false; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java index 2ba88bf4ee..65fb30e847 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -23,11 +23,13 @@ package com.github.bartimaeusnek.bartworks.server.container; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.items.Circuit_Programmer; import com.github.bartimaeusnek.bartworks.common.net.CircuitProgrammerPacket; import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.gui.GT_Slot_Render; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; @@ -63,10 +65,13 @@ public class GT_Container_CircuitProgrammer extends Container { addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } + for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); + if (GT_Utility.isStackValid(inventory.getStackInSlot(i)) && inventory.getStackInSlot(i).getItem() instanceof Circuit_Programmer) + addSlotToContainer(new GT_Slot_Render(inventory, i, 8 + i * 18, 142)); + else + addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); } - } @Override @@ -79,7 +84,7 @@ public class GT_Container_CircuitProgrammer extends Container { return ((Slot) this.inventorySlots.get(0)).getStack(); } detectAndSendChanges(); - return super.slotClick(slot, button, aShifthold, entityPlayer);//( (Slot) this.inventorySlots.get(slot)).getStack(); + return super.slotClick(slot, button, aShifthold, entityPlayer); } @Override @@ -168,7 +173,6 @@ public class GT_Container_CircuitProgrammer extends Container { Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); if (!Player.isClientWorld()) MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(Player.worldObj.provider.dimensionId, Player.getEntityId(), true, (byte) itemStack.getItemDamage())); - } else if (BW_Util.checkStackAndPrefix(itemStack) && GT_OreDictUnificator.getAssociation(itemStack).mPrefix.equals(OrePrefixes.circuit) && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.equals(Materials.Basic)) { Slot = GT_Utility.getIntegratedCircuit(0); Slot.stackSize = 1; @@ -180,8 +184,11 @@ public class GT_Container_CircuitProgrammer extends Container { Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); if (!Player.isClientWorld()) MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(Player.worldObj.provider.dimensionId, Player.getEntityId(), true, (byte) 0)); - - } else { + }/* else if (GT_Utility.isStackValid(itemStack) && itemStack.getItem() instanceof Circuit_Programmer) { + ForgeHooks.onPlayerTossEvent(Player, itemStack, false); + this.closeInventory(); + Player.closeScreen(); + }*/ else { ForgeHooks.onPlayerTossEvent(Player, itemStack, false); tag = toBind.getTagCompound(); tag.setBoolean("HasChip", false); @@ -189,7 +196,6 @@ public class GT_Container_CircuitProgrammer extends Container { Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); if (!Player.isClientWorld()) MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(Player.worldObj.provider.dimensionId, Player.getEntityId(), false, (byte) 0)); - } } @@ -226,7 +232,6 @@ public class GT_Container_CircuitProgrammer extends Container { @Override public void closeInventory() { - } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 2e2760b954..1ee1be96f3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -88,6 +88,8 @@ public class BWRecipes { "EU generated: ", 1000, "", false, true ); + + public BWRecipes() { if (ConfigHandler.BioLab) { @@ -482,6 +484,12 @@ public class BWRecipes { return false; } + public static class DynamicGTRecipe extends GT_Recipe{ + public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + } + } + public static class BW_Recipe_Map_LiquidFuel extends GT_Recipe.GT_Recipe_Map_Fuel { public BW_Recipe_Map_LiquidFuel(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); -- cgit From e47085d1eae7fcd3f1e858c67e75bb4ed936e351 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 7 Apr 2019 07:08:39 +0200 Subject: Giant Materials/Space Compat update +added ASM +added a shit ton of materials and got my own Materials system up and running +added Ross128 when GC is installed Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 6e298a2662d8874903210037f7faa53d9aa83f40 --- build.gradle | 36 +- build.properties | 6 +- .../java/com/github/bartimaeusnek/ASM/BWCore.java | 79 +++ .../com/github/bartimaeusnek/ASM/BWCorePlugin.java | 63 +++ .../ASM/BWCoreStaticReplacementMethodes.java | 31 ++ .../bartimaeusnek/ASM/BWCoreTransformer.java | 212 +++++++ .../bartworks/API/WerkstoffAdderRegistry.java | 48 ++ .../github/bartimaeusnek/bartworks/MainMod.java | 6 + .../client/renderer/BW_Renderer_Block_Ores.java | 92 +++ .../bartworks/common/loaders/ItemRegistry.java | 5 +- .../bartworks/common/net/BW_Network.java | 2 +- .../bartworks/common/net/OrePacket.java | 95 ++++ .../BW_TileEntity_ExperimentalFloodGate.java | 206 +++++++ .../bartworks/neiHandler/BW_NEI_OreHandler.java | 233 ++++++++ .../bartworks/neiHandler/NEI_BW_Config.java | 1 + .../system/material/BW_MetaGeneratedOreTE.java | 101 ++++ .../system/material/BW_MetaGeneratedOre_Item.java | 67 +++ .../system/material/BW_MetaGenerated_Items.java | 172 ++++++ .../system/material/BW_MetaGenerated_Ores.java | 180 ++++++ .../bartworks/system/material/Werkstoff.java | 390 +++++++++++++ .../bartworks/system/material/WerkstoffLoader.java | 616 +++++++++++++++++++++ .../bartimaeusnek/bartworks/util/BioCulture.java | 8 +- .../github/bartimaeusnek/bartworks/util/Pair.java | 74 +++ .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 65 +++ .../crossmod/galacticraft/GalacticraftProxy.java | 84 +++ .../galacticraft/UniversalTeleportType.java | 81 +++ .../galacticraft/blocks/UniversalSpaceBlocks.java | 46 ++ .../galacticraft/creativetabs/SpaceTab.java | 45 ++ .../ross128/world/oregen/BW_WordGenerator.java | 126 +++++ .../ross128/world/oregen/BW_WorldGenRoss128.java | 195 +++++++ .../world/worldprovider/ChunkProviderRoss128b.java | 186 +++++++ .../world/worldprovider/SkyProviderRoss128b.java | 33 ++ .../world/worldprovider/WorldProviderRoss128b.java | 178 ++++++ .../galacticraft/solarsystems/Ross128.java | 91 +++ .../resources/assets/bartworks/lang/en_US.lang | 9 +- .../galacticraft/Ross128b/MapObjs/Ross128.png | Bin 0 -> 934 bytes .../galacticraft/Ross128b/MapObjs/Ross128b.png | Bin 0 -> 1048 bytes .../galacticraft/Ross128b/MapObjs/Ross128ba.png | Bin 0 -> 990 bytes .../galacticraft/Ross128b/World/SunRoss128.png | Bin 0 -> 1260 bytes 39 files changed, 3854 insertions(+), 8 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/ASM/BWCore.java create mode 100644 src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java create mode 100644 src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java create mode 100644 src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128.java create mode 100644 src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/MapObjs/Ross128.png create mode 100644 src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/MapObjs/Ross128b.png create mode 100644 src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/MapObjs/Ross128ba.png create mode 100644 src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/World/SunRoss128.png diff --git a/build.gradle b/build.gradle index ae10e3f9a3..f2592e24f6 100644 --- a/build.gradle +++ b/build.gradle @@ -21,8 +21,14 @@ plugins { } apply plugin: 'forge' -apply plugin: 'idea' apply plugin: 'signing' +apply plugin: 'idea' +idea{ + module { + downloadJavadoc = true + downloadSources = true + } +} import de.undercouch.gradle.tasks.download.Download @@ -61,10 +67,31 @@ repositories { name = "ic2" url = "http://maven.ic2.player.to/" } + maven { // AppleCore + url "http://www.ryanliptak.com/maven/" + } + maven { // GalacticGreg, YAMCore,.. + name 'UsrvDE' + url "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/" + } + ivy { + name 'gtnh_download_source_stupid_underscore_typo' + artifactPattern "http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]_[revision].[ext]" + } + ivy { + name 'gtnh_download_source' + artifactPattern "http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]" + } + maven { + name = "gt" + url = "https://gregtech.overminddl1.com/" + } + } dependencies { compile "net.industrial-craft:industrialcraft-2:${config.ic2.version}:dev" + compileOnly "applecore:AppleCore:1.7.10-3.1.1:api" } //task getGregTech(type: Download) { @@ -102,6 +129,13 @@ processResources } } +jar { + manifest { + attributes 'FMLCorePlugin': 'com.github.bartimaeusnek.ASM.BWCorePlugin', + 'FMLCorePluginContainsFMLMod': 'true' + } +} + task apiJar(type: Jar){ from(sourceSets.main.output) { include 'com/github/bartimaeusnek/bartworks/API/**' diff --git a/build.properties b/build.properties index 72b745fd12..8045287543 100644 --- a/build.properties +++ b/build.properties @@ -22,9 +22,9 @@ mc_version=1.7.10 majorUpdate=0 -minorUpdate=3 -buildNumber=24 -APIVersion=4 +minorUpdate=4 +buildNumber=1 +APIVersion=5 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java new file mode 100644 index 0000000000..bddf66ae5e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.ASM; + +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import com.google.common.eventbus.EventBus; +import com.google.common.eventbus.Subscribe; +import cpw.mods.fml.common.DummyModContainer; +import cpw.mods.fml.common.LoadController; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.versioning.ArtifactVersion; +import cpw.mods.fml.common.versioning.DefaultArtifactVersion; +import net.minecraftforge.common.config.Configuration; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.ArrayList; +import java.util.List; + +public class BWCore extends DummyModContainer { + + public static final String BWCORE_NAME = "BartWorks ASM Core"; + public static final Logger BWCORE_LOG = LogManager.getLogger(BWCORE_NAME); + + public BWCore() { + super(new ModMetadata()); + ModMetadata metadata = getMetadata(); + metadata.modId = "BWCore"; + metadata.name = BWCORE_NAME; + metadata.version = "0.0.1"; + metadata.authorList.add("bartimaeusnek"); + metadata.dependants = getDependants(); + } + + @Subscribe + public void preInit(FMLPreInitializationEvent event) { + Configuration asmconfighandler = new Configuration(event.getSuggestedConfigurationFile()); + for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) { + BWCoreTransformer.shouldTransform[i]=asmconfighandler.get("ASM fixes",BWCoreTransformer.DESCRIPTIONFORCONFIG[i]+" in class: "+BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i],true).getBoolean(true); + } + if (asmconfighandler.hasChanged()) + asmconfighandler.save(); + } + + @Override + public List getDependants() { + List ret = new ArrayList(); + ret.add(new DefaultArtifactVersion("ExtraUtilities", true)); + ret.add(new DefaultArtifactVersion(BartWorksCrossmod.MOD_ID, true)); + return ret; + } + + @Override + public boolean registerBus(EventBus bus, LoadController controller) { + bus.register(this); + return true; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java new file mode 100644 index 0000000000..becd28f524 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.ASM; + +import cpw.mods.fml.relauncher.IFMLLoadingPlugin; + +import java.util.Map; + +@IFMLLoadingPlugin.MCVersion("1.7.10") +@IFMLLoadingPlugin.TransformerExclusions({"com.github.bartimaeusnek.ASM"}) +@IFMLLoadingPlugin.Name(BWCorePlugin.BWCORE_PLUGIN_NAME) +public class BWCorePlugin implements IFMLLoadingPlugin { + + public static final String BWCORE_PLUGIN_NAME="BartWorks ASM Core Plugin"; + + @Override + public String[] getASMTransformerClass() { + return new String[]{BWCoreTransformer.class.getName()}; + } + + @Override + public String getModContainerClass() { + return BWCore.class.getName(); + } + + @Override + public String getSetupClass() { + return null; + } + + @Override + public void injectData(Map data) { + if (data.get("runtimeDeobfuscationEnabled") != null){ + BWCoreTransformer.obfs=(boolean)data.get("runtimeDeobfuscationEnabled"); + } + + } + + @Override + public String getAccessTransformerClass() { + return null; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java new file mode 100644 index 0000000000..0d98c72564 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.ASM; + +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider.WorldProviderRoss128b; +import net.minecraft.client.multiplayer.WorldClient; + +public class BWCoreStaticReplacementMethodes { + private BWCoreStaticReplacementMethodes(){} + +} diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java new file mode 100644 index 0000000000..0a6f44712d --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.ASM; + +import net.minecraft.launchwrapper.IClassTransformer; +import org.apache.commons.lang3.ArrayUtils; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.*; + +import java.util.Arrays; +import java.util.List; + +import static org.objectweb.asm.Opcodes.*; + +public class BWCoreTransformer implements IClassTransformer { + public static boolean obfs = false; + public static final String[] DESCRIPTIONFORCONFIG = { + "REMOVING RAIN FROM LAST MILLENIUM (EXU)", + "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", + "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS" + }; + + public static final String[] CLASSESBEEINGTRANSFORMED = { + "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", + "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", + //"micdoodle8.mods.galacticraft.core.client.SkyProviderOverworld", + "net.minecraft.client.renderer.RenderGlobal", + }; + + public static boolean[] shouldTransform = ArrayUtils.toPrimitive(new Boolean[BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length],true); + + @Override + public byte[] transform(String name, String transformedName, byte[] basicClass) { + for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) { + if (name.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i])) + return BWCoreTransformer.transform(i,basicClass); + } + return basicClass; + } + + public static byte[] transform(int id, byte[] basicClass) { + if (!BWCoreTransformer.shouldTransform[id]) + return basicClass; + + if (id < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length) { + BWCore.BWCORE_LOG.info(DESCRIPTIONFORCONFIG[id]); + ClassReader classReader = new ClassReader(basicClass); + ClassNode classNode = new ClassNode(); + classReader.accept(classNode, ClassReader.SKIP_FRAMES); + List methods = classNode.methods; + switch (id) { + case 0: { + BWCore.BWCORE_LOG.info("Could find: "+CLASSESBEEINGTRANSFORMED[id]); + String name_deObfs = "canDoRainSnowIce"; + + String dsc_deObfs = "(Lnet/minecraft/world/chunk/Chunk;)Z"; + String dsc_Obfs = "(Lapx;)Z"; + for (int i = 0; i < methods.size(); i++) { + if (methods.get(i).name.equalsIgnoreCase(name_deObfs)) { + BWCore.BWCORE_LOG.info("Found "+name_deObfs+"! Removing!"); + methods.remove(i); + break; + } + } + BWCore.BWCORE_LOG.info("Creating new "+name_deObfs+"!"); + MethodNode nu = new MethodNode(Opcodes.ACC_PUBLIC, name_deObfs, + /*obfs ? dsc_Obfs :*/ dsc_deObfs, + name_deObfs+dsc_deObfs.substring(0,dsc_deObfs.length()-1), + new String[0] + ); + InsnList insnList = new InsnList(); + insnList.add(new InsnNode(Opcodes.ICONST_0)); + insnList.add(new InsnNode(Opcodes.IRETURN)); + nu.instructions = insnList; + nu.maxLocals = 1; + nu.maxStack = 1; + methods.add(nu); + break; + } + case 1: { + BWCore.BWCORE_LOG.info("Could find: "+CLASSESBEEINGTRANSFORMED[id]); + String name_deObfs = "getPossibleCreatures"; + String name_Obfs = "func_73155_a"; + String dsc_deObfs = "(Lnet/minecraft/entity/EnumCreatureType;III)Ljava/util/List;"; + String dsc_Obfs = "(Lsx;III)Ljava/util/List;"; + for (int i = 0; i < methods.size(); i++) { + if ((methods.get(i).name.equalsIgnoreCase(obfs?name_Obfs:name_deObfs) && methods.get(i).desc.equalsIgnoreCase(obfs?dsc_Obfs:dsc_deObfs))||(methods.get(i).name.equalsIgnoreCase(!obfs?name_Obfs:name_deObfs) && methods.get(i).desc.equalsIgnoreCase(!obfs?dsc_Obfs:dsc_deObfs))) { + BWCore.BWCORE_LOG.info("Found "+(name_deObfs)+"! Patching!"); + MethodNode toPatch = methods.get(i); + InsnList insnList = new InsnList(); + insnList.add(new InsnNode(Opcodes.ACONST_NULL)); + insnList.add(new InsnNode(Opcodes.ARETURN)); + toPatch.instructions = insnList; + toPatch.maxStack = 1; + toPatch.maxLocals = 5; + methods.set(i, toPatch); + break; + } + } + break; + } + case 2:{ + String name_deObfs = "renderSky"; + String name_Obfs = "func_72714_a"; + String dsc_deObfs = "(F)V"; + BWCore.BWCORE_LOG.info("Could find: "+CLASSESBEEINGTRANSFORMED[id]); + for (int i = 0; i < methods.size(); i++) { + MethodNode toPatch = methods.get(i); + if ((toPatch.name.equalsIgnoreCase(name_Obfs) || toPatch.name.equalsIgnoreCase(name_deObfs)) && methods.get(i).desc.equalsIgnoreCase(dsc_deObfs)) { + BWCore.BWCORE_LOG.info("Found "+(name_deObfs)+"! Patching!"); + InsnList nu = new InsnList(); + LabelNode[] LabelNodes = { new LabelNode(),new LabelNode()}; + for (int j = 0; j < toPatch.instructions.size(); j++) { + if (toPatch.instructions.get(j) instanceof LineNumberNode && ((LineNumberNode) toPatch.instructions.get(j)).line == 1190) { + nu.add(toPatch.instructions.get(j)); + nu.add(new VarInsnNode(ALOAD, 0)); + nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", "theWorld", "Lnet/minecraft/client/multiplayer/WorldClient;")); + nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/multiplayer/WorldClient", "provider", "Lnet/minecraft/world/WorldProvider;")); + nu.add(new TypeInsnNode(INSTANCEOF, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b")); + nu.add(new JumpInsnNode(IFEQ, LabelNodes[0])); + nu.add(new VarInsnNode(ALOAD, 0)); + nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); + nu.add(new FieldInsnNode(GETSTATIC, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b", "sunTex", "Lnet/minecraft/util/ResourceLocation;")); + nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); + nu.add(new JumpInsnNode(GOTO, LabelNodes[1])); + nu.add(LabelNodes[0]); + nu.add(new VarInsnNode(ALOAD, 0)); + nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); + nu.add(new FieldInsnNode(GETSTATIC, "net/minecraft/client/renderer/RenderGlobal", "locationSunPng", "Lnet/minecraft/util/ResourceLocation;")); + nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); + nu.add(LabelNodes[1]); + j+=5; + +// if (toPatch.instructions.get(j) instanceof LineNumberNode && ((LineNumberNode) toPatch.instructions.get(j)).line == 308) { +// nu.add(toPatch.instructions.get(j)); +// nu.add(new VarInsnNode(ALOAD, 0)); +// nu.add(new TypeInsnNode(INSTANCEOF, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b")); +// nu.add(new JumpInsnNode(IFEQ, LabelNodes[0])); +// nu.add(new VarInsnNode(ALOAD, 0)); +// nu.add(new FieldInsnNode(GETFIELD, "micdoodle8/mods/galacticraft/core/client/SkyProviderOverworld", "minecraft", "Lnet/minecraft/client/Minecraft;")); +// nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/Minecraft", "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); +// nu.add(new FieldInsnNode(GETSTATIC, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b", "sunTex", "Lnet/minecraft/util/ResourceLocation;")); +// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); +// nu.add(new JumpInsnNode(GOTO, LabelNodes[1])); +// nu.add(LabelNodes[0]); +// nu.add(new VarInsnNode(ALOAD, 0)); +// nu.add(new FieldInsnNode(GETFIELD, "micdoodle8/mods/galacticraft/core/client/SkyProviderOverworld", "minecraft", "Lnet/minecraft/client/Minecraft;")); +// nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/Minecraft", "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); +// nu.add(new FieldInsnNode(GETSTATIC, "micdoodle8/mods/galacticraft/core/client/SkyProviderOverworld", "sunTexture", "Lnet/minecraft/util/ResourceLocation;")); +// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); +// nu.add(LabelNodes[1]); +// j+=5; + } else { + nu.add(toPatch.instructions.get(j)); + } + } + toPatch.instructions=nu; + break; + } + } + break; + } + default: { + BWCore.BWCORE_LOG.info("Could not find: "+CLASSESBEEINGTRANSFORMED[id]); + return basicClass; + } + } + + classNode.methods=methods; + ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES); + classNode.accept(classWriter); + byte[] ret = classWriter.toByteArray(); + if (Arrays.hashCode(basicClass) == Arrays.hashCode(ret)) + BWCore.BWCORE_LOG.warn("Could not patch: "+CLASSESBEEINGTRANSFORMED[id]); +// try { +// OutputStream os = new FileOutputStream(new File("C:/test/"+CLASSESBEEINGTRANSFORMED[id]+".class")); +// os.write(classWriter.toByteArray()); +// } catch (FileNotFoundException e) { +// e.printStackTrace(); +// } catch (IOException e) { +// e.printStackTrace(); +// } + + return ret; + } + return basicClass; + } + + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java new file mode 100644 index 0000000000..29c45e5074 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +import java.util.HashSet; + +public final class WerkstoffAdderRegistry implements Runnable { + + private WerkstoffAdderRegistry(){} + + static final WerkstoffAdderRegistry INSTANCE = new WerkstoffAdderRegistry(); + + final HashSet toRun= new HashSet<>(); + + public static final WerkstoffAdderRegistry getINSTANCE() { + return INSTANCE; + } + + public static void addWerkstoffAdder(Runnable adder){ + INSTANCE.toRun.add(adder); + } + + @Override + public void run() { + for (Runnable r : toRun) + r.run(); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 56d15fa479..461d8e0f81 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -35,7 +35,9 @@ import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader; import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WordGenerator; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; @@ -104,6 +106,7 @@ public final class MainMod { BioCultureLoader bioCultureLoader = new BioCultureLoader(); bioCultureLoader.run(); } + WerkstoffLoader.INSTANCE.init(); } @Mod.EventHandler @@ -113,6 +116,7 @@ public final class MainMod { new LoaderRegistry().run(); if (ConfigHandler.BioLab) new BioLabLoader().run(); + WerkstoffLoader.INSTANCE.runInit(); } @Mod.EventHandler @@ -121,6 +125,8 @@ public final class MainMod { if (ConfigHandler.BioLab) new GTNHBlocks().run(); BioObjectAdder.regenerateBioFluids(); + new BW_WordGenerator(); + WerkstoffLoader.INSTANCE.run(); } @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java new file mode 100644 index 0000000000..1105ae39ea --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.client.renderer; + +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; +import gregtech.common.render.GT_Renderer_Block; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.IBlockAccess; +import org.lwjgl.opengl.GL11; + +import static gregtech.common.render.GT_Renderer_Block.*; + +public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { + public static BW_Renderer_Block_Ores INSTANCE = new BW_Renderer_Block_Ores(); + public final int mRenderID = RenderingRegistry.getNextAvailableRenderId(); + + @Override + public void renderInventoryBlock(Block aBlock, int aMeta, int modelId, RenderBlocks aRenderer) { + BW_MetaGeneratedOreTE tTileEntity = new BW_MetaGeneratedOreTE(); + tTileEntity.mMetaData = (short)aMeta; + aBlock.setBlockBoundsForItemRender(); + aRenderer.setRenderBoundsFromBlock(aBlock); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + Tessellator.instance.startDrawingQuads(); + Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F); + renderNegativeYFacing((IBlockAccess)null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte)0), true); + Tessellator.instance.draw(); + Tessellator.instance.startDrawingQuads(); + Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F); + renderPositiveYFacing((IBlockAccess)null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte)1), true); + Tessellator.instance.draw(); + Tessellator.instance.startDrawingQuads(); + Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F); + renderNegativeZFacing((IBlockAccess)null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte)2), true); + Tessellator.instance.draw(); + Tessellator.instance.startDrawingQuads(); + Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F); + renderPositiveZFacing((IBlockAccess)null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte)3), true); + Tessellator.instance.draw(); + Tessellator.instance.startDrawingQuads(); + Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F); + renderNegativeXFacing((IBlockAccess)null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte)4), true); + Tessellator.instance.draw(); + Tessellator.instance.startDrawingQuads(); + Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F); + renderPositiveXFacing((IBlockAccess)null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte)5), true); + Tessellator.instance.draw(); + aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + aRenderer.setRenderBoundsFromBlock(aBlock); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); +} + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + return GT_Renderer_Block.renderStandardBlock(world,x,y,z,block,renderer); + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return mRenderID; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index c945a19d14..c4b70a6a54 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -29,6 +29,7 @@ import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.items.*; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_ExperimentalFloodGate; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_DEHP; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; @@ -72,6 +73,7 @@ public class ItemRegistry { public static final Item WINDMETER = new BW_SimpleWindMeter(); public static final Block PUMPBLOCK = new BW_TileEntityContainer(Material.anvil, BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPump"); public static final Item PUMPPARTS = new SimpleSubItemClass(new String[]{"BWrawtube", "BWmotor"}); + public static final Block EXPPUMP = new BW_TileEntityContainer(Material.coral, BW_TileEntity_ExperimentalFloodGate.class,"ExpReversePump"); public static final Block[] bw_glasses = { new BW_GlasBlocks( @@ -146,7 +148,8 @@ public class ItemRegistry { GameRegistry.registerBlock(PUMPBLOCK, BW_ItemBlocks.class, "BWHeatedWaterPumpBlock"); GameRegistry.registerItem(PUMPPARTS, "BWPumpParts"); GameRegistry.registerItem(WINDMETER, "BW_SimpleWindMeter"); - + GameRegistry.registerTileEntity(BW_TileEntity_ExperimentalFloodGate.class,"BWExpReversePump"); + GameRegistry.registerBlock(EXPPUMP,BW_ItemBlocks.class,"BWExpReversePumpBlock"); for (int i = 0; i < GT_Values.VN.length; i++) { ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "diode"+"2A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name")+" 2A " + GT_Values.VN[i], i).getStackForm(1L); ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "diode"+"4A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name")+" 4A " + GT_Values.VN[i], i).getStackForm(1L); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index 9629eec1c9..cca0c39712 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -59,7 +59,7 @@ public class BW_Network extends MessageToMessageCodec public BW_Network() { this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", new ChannelHandler[]{this, new HandlerShared()}); - this.mSubChannels = new GT_Packet[]{new RendererPacket(), new CircuitProgrammerPacket()}; + this.mSubChannels = new GT_Packet[]{new RendererPacket(), new CircuitProgrammerPacket(), new OrePacket()}; } protected void encode(ChannelHandlerContext aContext, GT_Packet aPacket, List aOutput) throws Exception { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java new file mode 100644 index 0000000000..74f8aad3ee --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.net; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE; +import com.github.bartimaeusnek.bartworks.util.MurmurHash3; +import com.google.common.io.ByteArrayDataInput; +import gregtech.api.net.GT_Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import java.nio.ByteBuffer; + +public class OrePacket extends GT_Packet { + + int x; + short y; + int z; + short meta; + + public OrePacket(int x, int y, int z, int meta) { + super(false); + this.x = x; + this.y = (short)y; + this.z = z; + this.meta = (short)meta; + } + + public OrePacket() { + super(true); + } + + @Override + public byte getPacketID() { + return 2; + } + + @Override + public byte[] encode() { + int hash = MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(x).putInt(z).putShort(y).putShort(meta).array(),0,12,31); + return ByteBuffer.allocate(16).putInt(x).putInt(z).putShort(y).putShort(meta).putInt(hash).array(); + } + + @Override + public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { + byte[] tmp = new byte[16]; + byteArrayDataInput.readFully(tmp); + ByteBuffer buff = ByteBuffer.wrap(tmp); + x = buff.getInt(); + z = buff.getInt(); + y = buff.getShort(); + meta = buff.getShort(); + OrePacket todecode = new OrePacket(x,y,z,meta); + if (buff.getInt() != MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(x).putInt(z).putShort(y).putShort(meta).array(),0,12,31)) { + MainMod.LOGGER.error("PACKET HASH DOES NOT MATCH!"); + return null; + } + return todecode; + } + + @Override + public void process(IBlockAccess iBlockAccess) { + if (iBlockAccess != null) { + TileEntity tTileEntity = iBlockAccess.getTileEntity(this.x, this.y, this.z); + if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { + ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = this.meta; + } + if (((iBlockAccess instanceof World)) && (((World) iBlockAccess).isRemote)) { + ((World) iBlockAccess).markBlockForUpdate(this.x, this.y, this.z); + } + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java new file mode 100644 index 0000000000..86b9ed0e20 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.classic; + +import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.Coords; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraftforge.fluids.TileFluidHandler; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; + +public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implements ITileAddsInformation { + + private long ticks = 0; + recursiveBelowCheck check = new recursiveBelowCheck(); + private long noOfIts = 0; + private Coords paused; + + public BW_TileEntity_ExperimentalFloodGate() { + + } + + @Override + public void updateEntity() { + if (paused == null){ + this.paused = new Coords(this.xCoord,this.yCoord,this.zCoord,this.worldObj.provider.dimensionId); + } + ticks++; + if (check.called != -1) { + if (ticks % 20 == 0) { + HashSet toRem = new HashSet<>(); + for (Coords c : check.hashset) { + this.worldObj.setBlock(c.x, c.y, c.z, Blocks.water, 0, 4); + toRem.add(c); + } + check.hashset.removeAll(toRem); + } + } else { + noOfIts=0; + setUpHashSet(); + this.paused=check.hashset.get(check.hashset.size()-1); + } + if (ticks % 50 == 0) + ticks = 0; + } + + private synchronized void setUpHashSet(){ + check = new recursiveBelowCheck(); + Thread t = new Thread(check); + t.run(); + while (t.isAlive()) { + try { + this.wait(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + check.hashset.remove(new Coords(this.xCoord, this.yCoord, this.zCoord,this.worldObj.provider.dimensionId)); + } + + @Override + public String[] getInfoData() { + return new String[]{"Experimental Machine to fill Holes with Fluids"}; + } + + private class recursiveBelowCheck implements Runnable { + + int called = -1; + private final List hashset = new ArrayList(); + + public int getCalled() { + return this.called; + } + + public void setCalled(int called) { + this.called = called; + } + + public synchronized List getHashset() { + return this.hashset; + } + + public byte check_sourroundings(World w, int x, int y, int z, Block b) { + byte ret = 0; + int wID = w.provider.dimensionId; + + if (hashset.contains(new Coords(x, y, z, wID))) + return ret; + + hashset.add(new Coords(x, y, z, wID)); + + if (w.getBlock(x, y + 1, z).equals(b)) + ret = (byte) (ret | 0b000001); + + if (w.getBlock(x, y - 1, z).equals(b)) + ret = (byte) (ret | 0b000010); + + if (w.getBlock(x + 1, y, z).equals(b)) + ret = (byte) (ret | 0b000100); + + if (w.getBlock(x - 1, y, z).equals(b)) + ret = (byte) (ret | 0b001000); + + if (w.getBlock(x, y, z + 1).equals(b)) + ret = (byte) (ret | 0b010000); + + if (w.getBlock(x, y, z - 1).equals(b)) + ret = (byte) (ret | 0b100000); + + return ret; + } + + public int get_connected(World w, int x, int y, int z, Block b, int iterations) { + + if (iterations >= 5000) + return -1; + int tail = 0; + int ret = 0; + iterations++; + int wID = w.provider.dimensionId; + byte sides = check_sourroundings(w, x, y, z, b); + + if (((sides | 0b111110) == 0b111111) && !hashset.contains(new Coords(x, y + 1, z, wID)) && y+1 <= yCoord) { + tail=get_connected(w, x, y + 1, z, b,iterations); + if (tail == -1) + return tail; + ret++; + ret += tail; + } + + if (((sides | 0b111101) == 0b111111) && !hashset.contains(new Coords(x, y - 1, z, wID))) { + tail=get_connected(w, x, y - 1, z, b,iterations); + if (tail == -1) + return tail; + ret++; + ret += tail; + } + + if (((sides | 0b111011) == 0b111111) && !hashset.contains(new Coords(x + 1, y, z, wID))) { + tail= get_connected(w, x + 1, y, z, b,iterations); + if (tail == -1) + return tail; + ret++; + ret += tail; + } + + if (((sides | 0b110111) == 0b111111) && !hashset.contains(new Coords(x - 1, y, z, wID))) { + tail= get_connected(w, x - 1, y, z, b,iterations); + if (tail == -1) + return tail; + ret++; + ret += tail; + } + + if (((sides | 0b101111) == 0b111111) && !hashset.contains(new Coords(x, y, z + 1, wID))) { + tail= get_connected(w, x, y, z+1, b,iterations); + if (tail == -1) + return tail; + ret++; + ret += tail; + + } + + if (((sides | 0b011111) == 0b111111) && !hashset.contains(new Coords(x, y, z - 1, wID))) { + tail= get_connected(w, x, y, z-1, b,iterations); + if (tail == -1) + return tail; + ret++; + ret += tail; + } + + return ret; + } + + @Override + public synchronized void run() { + called=check.get_connected(worldObj, paused.x, paused.y, paused.z, Blocks.air,0); + notifyAll(); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java new file mode 100644 index 0000000000..1c76a84a05 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.neiHandler; + +import codechicken.lib.gui.GuiDraw; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.GuiCraftingRecipe; +import codechicken.nei.recipe.TemplateRecipeHandler; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WorldGenRoss128; +import cpw.mods.fml.common.event.FMLInterModComms; +import gregtech.api.GregTech_API; +import gregtech.common.GT_Worldgen_GT_Ore_Layer; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + +import java.util.ArrayList; +import java.util.List; + +public class BW_NEI_OreHandler extends TemplateRecipeHandler { + + public BW_NEI_OreHandler() { + if (!NEI_BW_Config.sIsAdded) { + FMLInterModComms.sendRuntimeMessage(MainMod.MOD_ID, "NEIPlugins", "register-crafting-handler", MainMod.MOD_ID+"@" + getRecipeName() + "@" + getOverlayIdentifier()); + GuiCraftingRecipe.craftinghandlers.add(this); +// GuiUsageRecipe.usagehandlers.add(this); + } + } + + @Override + public void drawBackground(int recipe) { + GuiDraw.drawRect(0,0,166, 65,0x888888); + } + + @Override + public void loadTransferRects() { +// transferRects.add(new RecipeTransferRect(new Rectangle(0,40,40,10),"quickanddirtyneihandler")); + } + + @Override + public void loadCraftingRecipes(String outputId, Object... results) { + if (outputId.equalsIgnoreCase("quickanddirtyneihandler")){ + for (int i = 0; i < Werkstoff.werkstoffHashMap.values().size(); i++) { + ItemStack result = new ItemStack(WerkstoffLoader.BWOres,1,i); + if (Block.getBlockFromItem(result.getItem()) instanceof BW_MetaGenerated_Ores){ + CachedRecipe tmp = new CachedRecipe() { + + PositionedStack stack = new PositionedStack(result, 0, 0); + + @Override + public PositionedStack getResult() { + return stack; + } + + @Override + public List getOtherStacks() { + ArrayList ret = new ArrayList<>(); + for (int i = 0; i < GT_Worldgen_GT_Ore_Layer.sList.size(); i++) { + if (BW_WorldGenRoss128.sList.get(i) instanceof BW_WorldGenRoss128) { + int baseMeta = result.getItemDamage(); + BW_WorldGenRoss128 worldGen = ((BW_WorldGenRoss128) BW_WorldGenRoss128.sList.get(i)); + if (worldGen.mPrimaryMeta == baseMeta || worldGen.mSecondaryMeta == baseMeta || worldGen.mBetweenMeta == baseMeta || worldGen.mSporadicMeta == baseMeta) { + ItemStack other; + other=result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore","Vein")); + stack = new PositionedStack(other, 83, 0); + if (((worldGen.bwOres & 0b1000) != 0)) { + other = result.copy(); + other.setItemDamage(worldGen.mPrimaryMeta); + ret.add(new PositionedStack(other, 0, 12)); + } else { + other = new ItemStack(GregTech_API.sBlockOres1); + other.setItemDamage(worldGen.mPrimaryMeta); + ret.add(new PositionedStack(other, 0, 12)); + } + if (((worldGen.bwOres & 0b0100) != 0)) { + other = result.copy(); + other.setItemDamage(worldGen.mSecondaryMeta); + ret.add(new PositionedStack(other, 20, 12)); + } else { + other = new ItemStack(GregTech_API.sBlockOres1); + other.setItemDamage(worldGen.mSecondaryMeta); + ret.add(new PositionedStack(other, 20, 12)); + } + if (((worldGen.bwOres & 0b0010) != 0)) { + other = result.copy(); + other.setItemDamage(worldGen.mBetweenMeta); + ret.add(new PositionedStack(other, 40, 12)); + } else { + other = new ItemStack(GregTech_API.sBlockOres1); + other.setItemDamage(worldGen.mBetweenMeta); + ret.add(new PositionedStack(other, 40, 12)); + } + if (((worldGen.bwOres & 0b0001) != 0)) { + other = result.copy(); + other.setItemDamage(worldGen.mSporadicMeta); + ret.add(new PositionedStack(other, 60, 12)); + } else { + other = new ItemStack(GregTech_API.sBlockOres1); + other.setItemDamage(worldGen.mSporadicMeta); + ret.add(new PositionedStack(other, 60, 12)); + } + break; + } + } + } + return ret; + } + }; + this.arecipes.add(tmp); + } + } + } else super.loadCraftingRecipes(outputId, results); + } + + @Override + public void drawExtras(int recipe) { + + GuiDraw.drawString(ChatColorHelper.BOLD+"DIM:"+ChatColorHelper.RESET+" Ross128",0,40,0,false); + GuiDraw.drawString(ChatColorHelper.BOLD+"Primary:",0,50,0,false); + GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(0).item.getDisplayName(),0,60,0,false); + GuiDraw.drawString(ChatColorHelper.BOLD+"Secondary:",0,70,0,false); + GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(1).item.getDisplayName(),0,80,0,false); + GuiDraw.drawString(ChatColorHelper.BOLD+"InBetween:",0,90,0,false); + GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(2).item.getDisplayName(),0,100,0,false); + GuiDraw.drawString(ChatColorHelper.BOLD+"Sporadic:",0,110,0,false); + GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(3).item.getDisplayName(),0,120,0,false); + super.drawExtras(recipe); + } + + @Override + public void loadCraftingRecipes(ItemStack result) { + if (Block.getBlockFromItem(result.getItem()) instanceof BW_MetaGenerated_Ores){ + CachedRecipe tmp = new CachedRecipe() { + + PositionedStack stack = new PositionedStack(result, 0, 0); + + @Override + public PositionedStack getResult() { + return stack; + } + + @Override + public List getOtherStacks() { + ArrayList ret = new ArrayList<>(); + for (int i = 0; i < GT_Worldgen_GT_Ore_Layer.sList.size(); i++) { + if (BW_WorldGenRoss128.sList.get(i) instanceof BW_WorldGenRoss128) { + int baseMeta = result.getItemDamage(); + BW_WorldGenRoss128 worldGen = ((BW_WorldGenRoss128) BW_WorldGenRoss128.sList.get(i)); + if (worldGen.mPrimaryMeta == baseMeta || worldGen.mSecondaryMeta == baseMeta || worldGen.mBetweenMeta == baseMeta || worldGen.mSporadicMeta == baseMeta) { + ItemStack other; + other=result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore","Vein")); + stack = new PositionedStack(other, 83, 0); + if (((worldGen.bwOres & 0b1000) != 0)) { + other = result.copy(); + other.setItemDamage(worldGen.mPrimaryMeta); + ret.add(new PositionedStack(other, 0, 12)); + } else { + other = new ItemStack(GregTech_API.sBlockOres1); + other.setItemDamage(worldGen.mPrimaryMeta); + ret.add(new PositionedStack(other, 0, 12)); + } + if (((worldGen.bwOres & 0b0100) != 0)) { + other = result.copy(); + other.setItemDamage(worldGen.mSecondaryMeta); + ret.add(new PositionedStack(other, 20, 12)); + } else { + other = new ItemStack(GregTech_API.sBlockOres1); + other.setItemDamage(worldGen.mSecondaryMeta); + ret.add(new PositionedStack(other, 20, 12)); + } + if (((worldGen.bwOres & 0b0010) != 0)) { + other = result.copy(); + other.setItemDamage(worldGen.mBetweenMeta); + ret.add(new PositionedStack(other, 40, 12)); + } else { + other = new ItemStack(GregTech_API.sBlockOres1); + other.setItemDamage(worldGen.mBetweenMeta); + ret.add(new PositionedStack(other, 40, 12)); + } + if (((worldGen.bwOres & 0b0001) != 0)) { + other = result.copy(); + other.setItemDamage(worldGen.mSporadicMeta); + ret.add(new PositionedStack(other, 60, 12)); + } else { + other = new ItemStack(GregTech_API.sBlockOres1); + other.setItemDamage(worldGen.mSporadicMeta); + ret.add(new PositionedStack(other, 60, 12)); + } + break; + } + } + } + return ret; + } + }; + this.arecipes.add(tmp); + } + } + + @Override + public String getGuiTexture() { + return "textures/gui/container/brewing_stand.png"; + } + + @Override + public String getRecipeName() { + return "OreShit"; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index 3614f608b1..39aae565bf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -32,6 +32,7 @@ public class NEI_BW_Config implements IConfigureNEI { public void loadConfig() { sIsAdded = false; + new BW_NEI_OreHandler(); new BW_NEI_BioVatHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BACTERIALVATBYTE)); new BW_NEI_BioLabHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BIOLABBYTE)); sIsAdded = true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java new file mode 100644 index 0000000000..1db9bcb8aa --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import com.github.bartimaeusnek.bartworks.common.net.OrePacket; +import com.github.bartimaeusnek.bartworks.util.Coords; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.ITexturedTileEntity; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.common.blocks.GT_Packet_Ores; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import java.util.ArrayList; + +import static com.github.bartimaeusnek.bartworks.MainMod.BW_Network_instance; + +public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEntity { + + public short mMetaData = 0; + + public boolean canUpdate() { + return false; + } + + public void readFromNBT(NBTTagCompound aNBT) { + super.readFromNBT(aNBT); + this.mMetaData = aNBT.getShort("m"); + } + + public void writeToNBT(NBTTagCompound aNBT) { + super.writeToNBT(aNBT); + aNBT.setShort("m", this.mMetaData); + } + + public static boolean placeOre(World aWorld,Coords coords, Werkstoff werkstoff) { + short meta = werkstoff.getmID(); + aWorld.setBlock(coords.x, coords.y, coords.z, WerkstoffLoader.BWOres, 0, 0); + TileEntity tTileEntity = aWorld.getTileEntity(coords.x, coords.y, coords.z); + if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { + ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = meta; + } + return true; + } + + public ArrayList getDrops(Block aDroppedOre) { + ArrayList rList = new ArrayList(); + if (this.mMetaData < 0) { + rList.add(new ItemStack(Blocks.cobblestone, 1, 0)); + return rList; + } + rList.add(new ItemStack(aDroppedOre, 1, this.mMetaData)); + return rList; + } + + public Packet getDescriptionPacket() { + if (!this.worldObj.isRemote) + BW_Network_instance.sendPacketToAllPlayersInRange(this.worldObj, new OrePacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); + return null; + } + + @Override + public ITexture[] getTexture(Block aBlock, byte aSide) { + Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); + if ((aMaterial != null)) { + GT_RenderedTexture aIconSet = new GT_RenderedTexture(aMaterial.getTexSet().mTextures[OrePrefixes.ore.mTextureIndex], aMaterial.getRGBA()); + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet}; + } + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex])}; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java new file mode 100644 index 0000000000..4ebf9a47b8 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; +import gregtech.api.util.GT_LanguageManager; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class BW_MetaGeneratedOre_Item extends BW_ItemBlocks { + + public BW_MetaGeneratedOre_Item(Block par1) { + super(par1); + } + + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { + return false; + } + + public String getUnlocalizedName(ItemStack aStack) { + return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack); + } + + public String getItemStackDisplayName(ItemStack aStack) { + return GT_LanguageManager.getTranslation("bw.blockores.01."+aStack.getItemDamage()+".name"); + } + + public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { + short tDamage = (short) getDamage(aStack); + if (tDamage > 0) { + if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) { + return false; + } + BW_MetaGeneratedOreTE tTileEntity = (BW_MetaGeneratedOreTE) aWorld.getTileEntity(aX, aY, aZ); + tTileEntity.mMetaData = tDamage; + } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, 0, 3)) { + return false; + } + if (aWorld.getBlock(aX, aY, aZ) == this.field_150939_a) { + this.field_150939_a.onBlockPlacedBy(aWorld, aX, aY, aZ, aPlayer, aStack); + this.field_150939_a.onPostBlockPlaced(aWorld, aX, aY, aZ, tDamage); + } + return true; + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java new file mode 100644 index 0000000000..dfd192863f --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Item; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_OreDictUnificator; +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; + +import java.util.List; + +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap; + +public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item { + + private final short aNumToGen= (short) werkstoffHashMap.size(); + + protected final OrePrefixes orePrefixes; + + public BW_MetaGenerated_Items(OrePrefixes orePrefixes) { + super("bwMetaGenerated"+orePrefixes.name(), (short) 32766, (short) 0); + this.orePrefixes = orePrefixes; + this.setCreativeTab(metaTab); + for (int i = 0; i < aNumToGen; i++) { + ItemStack tStack = new ItemStack(this, 1, i); + Werkstoff w = werkstoffHashMap.get((short)i); + if (w == null || ((w.getFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) == 0) ) + continue; + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", this.getDefaultLocalization(w)); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); + GT_OreDictUnificator.registerOre(this.orePrefixes.name()+w.getDefaultName(),tStack); + } + } + + public boolean onEntityItemUpdate(EntityItem aItemEntity) { + int aDamage = aItemEntity.getEntityItem().getItemDamage(); + if ( (aDamage >= 0) && (!aItemEntity.worldObj.isRemote) ) { + Werkstoff aMaterial = werkstoffHashMap.get((short)aDamage); + if ((aMaterial != null) && (aMaterial != Werkstoff.default_null_Werkstoff)) { + int tX = MathHelper.floor_double(aItemEntity.posX); + int tY = MathHelper.floor_double(aItemEntity.posY); + int tZ = MathHelper.floor_double(aItemEntity.posZ); + if ((orePrefixes == OrePrefixes.dustImpure) || (orePrefixes == OrePrefixes.dustPure)) { + Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); + byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); + if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { + aItemEntity.setEntityItemStack(WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.dust, aMaterial, aItemEntity.getEntityItem().stackSize)); + aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); + return true; + } + } else if (orePrefixes == OrePrefixes.crushed) { + Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); + byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); + if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { + aItemEntity.setEntityItemStack(WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.crushedPurified, aMaterial, aItemEntity.getEntityItem().stackSize)); + aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); + return true; + } + } + } + } + return false; + } + + @Override + protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { +// String tooltip = GT_LanguageManager.getTranslation(this.getUnlocalizedName(aStack) + ".tooltip"); +// if (!tooltip.isEmpty()) +// aList.add(tooltip); + if (orePrefixes == OrePrefixes.dustImpure || orePrefixes == OrePrefixes.dustPure) { + aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify")); + } + aList.add(StatCollector.translateToLocal("tooltip.bw.0.name")+ ChatColorHelper.DARKGREEN + " BartWorks"); + } + + public String getDefaultLocalization(Werkstoff werkstoff){ + return werkstoff != null ? orePrefixes.mLocalizedMaterialPre+ werkstoff.getDefaultName()+orePrefixes.mLocalizedMaterialPost : Werkstoff.default_null_Werkstoff.getDefaultName(); + } + + @Override + public String getItemStackDisplayName(ItemStack aStack) { + return GT_LanguageManager.getTranslation(this.getUnlocalizedName(aStack) + ".name"); + } + + @Override + public final IIconContainer getIconContainer(int aMetaData) { + return werkstoffHashMap.get((short)aMetaData) == null ? null : werkstoffHashMap.get((short)aMetaData).getTexSet().mTextures[orePrefixes.mTextureIndex]; + } + + @Override + @SideOnly(Side.CLIENT) + public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { + for (int i = 0; i < aNumToGen; i++) { + Werkstoff werkstoff = werkstoffHashMap.get((short)i); + if (werkstoff != null && ((werkstoff.getFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) != 0)) { + ItemStack tStack = new ItemStack(this, 1, i); + aList.add(tStack); + } + } + super.getSubItems(var1, aCreativeTab, aList); + } + + @Override + public short[] getRGBa(ItemStack aStack) { + Werkstoff werkstoff = werkstoffHashMap.get((short)getDamage(aStack)); + return werkstoff == null ? Materials._NULL.mRGBa : werkstoff.getRGBA(); + } + + @Override + public final IIcon getIconFromDamage(int aMetaData) { + if (aMetaData < 0) + return null; + Werkstoff tMaterial = werkstoffHashMap.get((short)aMetaData); + if (tMaterial == null) + return null; + IIconContainer tIcon = getIconContainer(aMetaData); + if (tIcon != null) + return tIcon.getIcon(); + return null; + } + + @Override + public int getItemStackLimit(ItemStack aStack) { + return 64; + } + + public static final CreativeTabs metaTab = new CreativeTabs("bartworksMetaMaterials") { + + @Override + public Item getTabIconItem() { + return new ItemStack(Blocks.iron_ore).getItem(); + } + }; +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java new file mode 100644 index 0000000000..599b93dbf9 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; +import gregtech.api.GregTech_API; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.common.blocks.GT_Block_Ores_Abstract; +import gregtech.common.blocks.GT_TileEntity_Ores; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; + +import static com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items.metaTab; + +public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { + + public BW_MetaGenerated_Ores(Material p_i45386_1_, Class tileEntity, String blockName) { + super(p_i45386_1_, tileEntity, blockName); + + this.setHardness(5.0F); + this.setResistance(5.0F); + this.setBlockTextureName("stone"); + this.setCreativeTab(metaTab); + for (Werkstoff w: Werkstoff.werkstoffHashSet) { + if (w != null) { + if ((w.getFeatures().toGenerate & 0b1000) == 0) + continue; + GT_ModHandler.addValuableOre(this, w.getmID(), 1); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + w.getmID() +".name", w.getDefaultName() + OrePrefixes.ore.mLocalizedMaterialPost); + GT_OreDictUnificator.registerOre(OrePrefixes.ore + w.getDefaultName(), new ItemStack(this, 1, w.getmID())); + } + } + } + + public String getLocalizedName() { + return StatCollector.translateToLocal(getUnlocalizedName() + ".name"); + } + + @Override + public IIcon getIcon(int side, int meta) { + return Blocks.stone.getIcon(0, 0); + } + + @Override + public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) { + return Blocks.stone.getIcon(0, 0); + } + + @Override + public String getHarvestTool(int metadata) { + return "pickaxe"; + } + + protected boolean canSilkHarvest() { + return false; + } + + public int getRenderType() { + if (BW_Renderer_Block_Ores.INSTANCE == null) { + return super.getRenderType(); + } + return BW_Renderer_Block_Ores.INSTANCE.mRenderID; + } + + public int getDamageValue(World aWorld, int aX, int aY, int aZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (((tTileEntity instanceof BW_MetaGeneratedOreTE))) { + return ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData; + } + return 0; + } + public static ThreadLocal mTemporaryTileEntity = new ThreadLocal(); + + public void breakBlock(World aWorld, int aX, int aY, int aZ, Block par5, int par6) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { + mTemporaryTileEntity.set((BW_MetaGeneratedOreTE) tTileEntity); + } + super.breakBlock(aWorld, aX, aY, aZ, par5, par6); + aWorld.removeTileEntity(aX, aY, aZ); + } + + public ArrayList getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { + return ((BW_MetaGeneratedOreTE) tTileEntity).getDrops(WerkstoffLoader.BWOres); + } + return mTemporaryTileEntity.get() == null ? new ArrayList() : ((BW_MetaGeneratedOreTE) mTemporaryTileEntity.get()).getDrops(WerkstoffLoader.BWOres); + } + + public int getHarvestLevel(int metadata){ + return 3; + } + + @Override + public String getUnlocalizedName() { + return "bw.blockores.01"; + } + + @Override + public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { + for (int i = 0; i < Werkstoff.werkstoffHashSet.size(); i++) { + Werkstoff tMaterial = Werkstoff.werkstoffHashMap.get((short)i); + if ((tMaterial != null) && ((tMaterial.getFeatures().toGenerate & 0x8) != 0) ) { + aList.add(new ItemStack(aItem, 1, i)); + } + } + } + + @Override + public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block p_149695_5_) { + aWorld.getTileEntity(aX, aY, aZ).getDescriptionPacket(); + } + + @Override + public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int tileX, int tileY, int tileZ) { + aWorld.getTileEntity(aX, aY, aZ).getDescriptionPacket(); + } + + public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air) { + if (!air) { + aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); + } + + Block tBlock = aWorld.getBlock(aX, aY, aZ); + Block tOreBlock = WerkstoffLoader.BWOres; + if (aMetaData < 0 || tBlock == Blocks.air && !air) { + return false; + } else { + + if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) { + return false; + } + + aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0); + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof BW_MetaGeneratedOreTE) { + ((BW_MetaGeneratedOreTE)tTileEntity).mMetaData = (short)aMetaData; + } + + return true; + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java new file mode 100644 index 0000000000..7522c40205 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -0,0 +1,390 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import com.github.bartimaeusnek.bartworks.util.MurmurHash3; +import com.github.bartimaeusnek.bartworks.util.Pair; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; +import gregtech.api.enums.TextureSet; +import gregtech.api.interfaces.IColorModulationContainer; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.util.GT_OreDictUnificator; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; + +import java.nio.ByteBuffer; +import java.util.*; + +public class Werkstoff implements IColorModulationContainer, ISubTagContainer { + + public static final LinkedHashSet werkstoffHashSet = new LinkedHashSet<>(); + private static final HashSet idHashSet = new HashSet<>(); + + public static final LinkedHashMap werkstoffHashMap = new LinkedHashMap<>(); + + public static final Werkstoff.Stats default_null_stats = new Werkstoff.Stats(); + public static final Werkstoff.Features default_null_features = new Werkstoff.Features(); + public static final Werkstoff default_null_Werkstoff = new Werkstoff(new short[3], "_NULL", "Default null Werkstoff", default_null_stats, Werkstoff.Types.UNDEFINED, default_null_features, -1, TextureSet.SET_NONE); + + private final List mOreByProducts = new ArrayList(); + + public Pair>> getContents() { + int ret = 0; + switch (this.type) { + case COMPOUND: + case BIOLOGICAL: { + for (int i = 0; i < contents.toArray().length; i++) { + ret += ((Pair) contents.toArray()[i]).getValue(); + } + break; + } + default: + ret = 1; + break; + } + return new Pair<>(ret, this.contents); + } + + private final LinkedHashSet> contents = new LinkedHashSet<>(); + private byte[] rgb = new byte[3]; + private String defaultName; + + public int getNoOfByProducts(){ + return mOreByProducts.size(); + } + + public ItemStack getOreByProduct(int aNumber, OrePrefixes prefixes) { + if (mOreByProducts.size() == 0) + return null; + if (aNumber < 0) + aNumber = mOreByProducts.size() + aNumber; + while (aNumber >= mOreByProducts.size()) + aNumber--; + Object o = mOreByProducts.get(aNumber); + if (o == null || o.equals(default_null_Werkstoff) || o.equals(Materials._NULL)) + return null; + if (o instanceof Werkstoff) + return WerkstoffLoader.getCorresopndingItemStack(prefixes, (Werkstoff) o); + if (o instanceof Materials) + return GT_OreDictUnificator.get(prefixes, o, 1L); + return null; + } + + public String getDefaultName() { + return this.defaultName; + } + + public String getToolTip() { + return this.toolTip; + } + + private String toolTip; + private Fluid fluid; + private Fluid gas; + private Werkstoff.Stats stats; + private Werkstoff.Types type; + private Werkstoff.Features features; + + public Werkstoff.Stats getStats() { + return this.stats; + } + + public short getmID() { + return this.mID; + } + + private short mID; + + public Werkstoff.Features getFeatures() { + return this.features; + } + + public TextureSet getTexSet() { + return this.texSet; + } + + private TextureSet texSet; + + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.Features features, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { + this(rgba,defaultName,Types.getDefaultStatForType(type),type,features,mID,texSet,oreByProduct,contents); + } + + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.Features features, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { + this(rgba,defaultName,"",stats,type,features,mID,texSet,contents); + this.mOreByProducts.addAll(oreByProduct); + } + + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.Features features, int mID, TextureSet texSet, Pair... contents) { + this(rgba,defaultName,"",stats,type,features,mID,texSet,contents); + } + public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.Features features, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { + this(rgba, defaultName, toolTip, stats, type, features, mID, texSet, contents); + this.mOreByProducts.addAll(oreByProduct); + } + + public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.Features features, int mID, TextureSet texSet, Pair... contents) { + + if (idHashSet.contains((short) mID)) + throw new UnsupportedOperationException("ID ("+mID+") is already in use!"); + + if (type == null) + type = Werkstoff.Types.UNDEFINED; + + this.defaultName=defaultName; + + this.type = type; + this.mID = (short) mID; + this.features=features; + this.setRgb(rgba); + this.contents.addAll(Arrays.asList(contents)); + this.toolTip=""; + if (toolTip.isEmpty()) { + for (Pair p : contents) { + if (p.getKey() instanceof Materials) { + this.toolTip += ((Materials) p.getKey()).mChemicalFormula + (p.getValue() > 1 ? p.getValue() : ""); + } + if (p.getKey() instanceof Werkstoff) + this.toolTip += ((Werkstoff) p.getKey()).toolTip + (p.getValue() > 1 ? p.getValue() : ""); + } + } else + this.toolTip = toolTip; + long tmpprotons=0; + for (Pair p : contents) { + if (p.getKey() instanceof Materials) { + tmpprotons += ((Materials) p.getKey()).getProtons()* p.getValue(); + } + } + this.stats = stats.setProtons(tmpprotons); + + long tmpmass=0; + for (Pair p : contents) { + if (p.getKey() instanceof Materials) { + tmpmass += ((Materials) p.getKey()).getMass()* p.getValue(); + } + } + this.stats = stats.setMass(tmpmass); + + this.texSet=texSet; + werkstoffHashSet.add(this); + werkstoffHashMap.put(this.mID,this); + } + + public void setRgb(short[] rgb) { + this.rgb = new byte[]{(byte) (rgb[0]-128), (byte) (rgb[1]-128), (byte) (rgb[2]-128)}; + } + + @Override + public short[] getRGBA() { + return new short[] {(short) (rgb[0]+128), (short) (rgb[1]+128), (short) (rgb[2]+128),0}; + } + + HashSet subtags = new HashSet<>(); + + @Override + public boolean contains(SubTag subTag) { + for (Pair p: contents) + if (p.getKey().contains(subTag)) + return true; + if (subtags.contains(subTag)) + return true; + return false; + } + + @Override + public ISubTagContainer add(SubTag... subTags) { + subtags.addAll(Arrays.asList(subTags)); + return this; + } + + @Override + public boolean remove(SubTag subTag) { + return subtags.remove(subTag); + } + + public ItemStack get(OrePrefixes prefixes){ + return WerkstoffLoader.getCorresopndingItemStack(prefixes,this); + } + + public ItemStack get(OrePrefixes prefixes, int amount){ + return WerkstoffLoader.getCorresopndingItemStack(prefixes,this, amount); + } + + public static class Features { + //logic gate shit + /* + dust 1 + metal 10 + gem 100 + ore 1000 + */ + public byte toGenerate = 0b0001001; + + public boolean hasGems(){ + return (toGenerate & 4) != 0; + } + + public Features onlyDust(){ + toGenerate = (byte) (1); + return this; + } + + public Features addGems(){ + toGenerate = (byte) (toGenerate | 0x4); + return this; + } + + + } + + + public static class Stats { + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Werkstoff.Stats)) return false; + + Werkstoff.Stats that = (Werkstoff.Stats) o; + + if (this.boilingPoint != that.boilingPoint) return false; + if (this.meltingPoint != that.meltingPoint) return false; + if (this.mass != that.mass) return false; + if (this.protons != that.protons) return false; + if (this.neutrons != that.neutrons) return false; + if (this.electrons != that.electrons) return false; + return this.quality == that.quality; + } + + @Override + public int hashCode() { + return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(49).put(quality).putInt(boilingPoint).putInt(meltingPoint).putLong(protons).putLong(neutrons).putLong(electrons).putLong(mass).array(),0,49,31); + } + + int boilingPoint; + int meltingPoint; + long protons; + long neutrons; + long electrons; + long mass; + + + + public Stats setMass(long mass) { + this.mass = protons; + return this; + } + public Stats setProtons(long protons) { + this.protons = protons; + return this; + } + + //logic gate shit + byte quality = ~0b111111; + + public boolean isSublimation() { + return (quality&0b1) == 0b1; + } + + public boolean isToxic() { + return (quality>>1&0b1) == 0b1; + } + + public boolean isRadioactive() { + return (quality>>2&0b1) == 0b1; + } + + public boolean isBlastFurnace() { + return (quality>>3&0b1) == 0b1; + } + + public boolean isElektrolysis() { + return (quality>>4&0b1) == 0b1; + } + + public boolean isCentrifuge() { + return (quality>>5&0b1) == 0b1; + } + + public Werkstoff.Stats setSublimation(boolean sublimation) { + if(sublimation) + quality= (byte) (quality|0b000001); + else + quality= (byte) (quality&0b111110); + return this; + } + + public Werkstoff.Stats setToxic(boolean toxic) { + if(toxic) + quality= (byte) (quality|0b000010); + else + quality= (byte) (quality&0b111101); + return this; + } + + public Werkstoff.Stats setRadioactive(boolean radioactive) { + if(radioactive) + quality= (byte) (quality|0b000100); + else + quality= (byte) (quality&0b111011); + return this; + } + + public Werkstoff.Stats setBlastFurnace(boolean blastFurnace) { + if(blastFurnace) + quality= (byte) (quality|0b001000); + else + quality= (byte) (quality&0b110111); + return this; + } + + public Werkstoff.Stats setElektrolysis(boolean elektrolysis) { + if(elektrolysis) + quality= (byte) (quality|0b010000); + else + quality= (byte) (quality&0b101111); + return this; + } + + public Werkstoff.Stats setCentrifuge(boolean centrifuge) { + if(centrifuge) + quality= (byte) (quality|0b100000); + else + quality=(byte) (quality&0b011111); + return this; + } + } + + public enum Types { + MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, UNDEFINED; + public static Stats getDefaultStatForType(Types T){ + switch (T){ + case COMPOUND: case BIOLOGICAL: return new Stats().setElektrolysis(true); + case MIXTURE: return new Stats().setCentrifuge(true); + default:return new Stats(); + } + } + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java new file mode 100644 index 0000000000..89f69948fa --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -0,0 +1,616 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import com.github.bartimaeusnek.bartworks.API.WerkstoffAdderRegistry; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; +import com.github.bartimaeusnek.bartworks.util.Pair; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.ProgressManager; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.GT_Mod; +import gregtech.api.enums.*; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +import static gregtech.api.enums.OrePrefixes.*; + +public class WerkstoffLoader implements Runnable { + + private WerkstoffLoader(){} + + public static WerkstoffLoader INSTANCE = new WerkstoffLoader(); + + public boolean registered = false; + + public void init(){ + } + + public static HashMap items = new HashMap<>(); + public static Block BWOres; + + public static final Werkstoff Bismutite = new Werkstoff( + new short[]{255, 233, 0, 0}, + "Bismutite", + Werkstoff.Types.COMPOUND, + new Werkstoff.Features().addGems(), + 1, + TextureSet.SET_FLINT, + Arrays.asList(Materials.Bismuth), + new Pair(Materials.Bismuth, 2), + new Pair(Materials.Oxygen, 2), + new Pair(Materials.CarbonDioxide, 2) + ); + public static final Werkstoff Bismuthinit = new Werkstoff( + new short[]{192, 192, 192, 0}, + "Bismuthinite", + Werkstoff.Types.COMPOUND, + new Werkstoff.Features(), + 2, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Bismuth, Materials.Sulfur), + new Pair(Materials.Bismuth, 2), + new Pair(Materials.Sulfur, 3) + ); + + public static final Werkstoff CyclosilicateSi6O18 = new Werkstoff( + new short[]{255,255,255,0}, + "CycloHexaSilicate", + "(Si6O18)", + Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), + Werkstoff.Types.COMPOUND, + new Werkstoff.Features().onlyDust(), + 3, + TextureSet.SET_DULL, + new Pair(Materials.Silicon, 6), + new Pair(Materials.Oxygen, 18) + ); + + public static final Werkstoff Borat = new Werkstoff( + new short[]{255,255,255,0}, + "Borate", + "(BO3)", + Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), + Werkstoff.Types.COMPOUND, + new Werkstoff.Features().onlyDust(), + 4, + TextureSet.SET_DULL, + new Pair(Materials.Boron, 1), + new Pair(Materials.Oxygen, 3) + ); + + //Na Fe3+3 Al6 (Si6O18) (BO3)3 O3 F + public static final Werkstoff FluorBuergerit = new Werkstoff( + new short[]{0x20,0x20,0x20,0}, + "Fluor-Buergerit", + Werkstoff.Types.COMPOUND, + new Werkstoff.Features().addGems(), + 5, + TextureSet.SET_RUBY, + Arrays.asList(Materials.Sodium,Materials.Boron,Materials.Silicon), + new Pair(Materials.Sodium, 1), + new Pair(Materials.Iron, 3), + new Pair(Materials.Aluminium, 6), + new Pair(CyclosilicateSi6O18, 1), + new Pair(Borat, 3), + new Pair(Materials.Oxygen, 1), + new Pair(Materials.Fluorine, 1) + ); + + public static final Werkstoff AluminiumMagnesite = new Werkstoff( + new short[]{255,255,255,0}, + "AluminiumMagnesite", + "(Al4Mg2)", + Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), + Werkstoff.Types.COMPOUND, + new Werkstoff.Features().onlyDust(), + 6, + TextureSet.SET_DULL, + new Pair(Materials.Aluminium, 4), + new Pair(Materials.Magnesium, 2) + ); + +// public static final Werkstoff Hydroxide = new Werkstoff( +// new short[]{255,255,255,0}, +// "Hydroxide", +// "(OH)", +// new Werkstoff.Stats(), +// Werkstoff.Types.COMPOUND, +// new Werkstoff.Features().onlyDust(), +// 7, +// TextureSet.SET_DULL, +// new Pair(Materials.Aluminium, 4), +// new Pair(Materials.Magnesium, 2) +// ); + + public static final Werkstoff ChromoAluminoPovondrait = new Werkstoff( + new short[]{0,0x79,0x6A,0}, + "Chromo-Alumino-Povondraite", + "NaCr3(Al4Mg2)(Si6O18)(BO3)3(OH)3O", + Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), + Werkstoff.Types.COMPOUND, + new Werkstoff.Features().addGems(), + 7, + TextureSet.SET_RUBY, + Arrays.asList(Materials.Sodium,Materials.Boron,Materials.Silicon), + //Na Cr3 (Al4Mg2) (Si6O18) (BO3)3 (OH)3 O + new Pair(Materials.Sodium, 1), + new Pair(Materials.Chrome, 3), + new Pair(AluminiumMagnesite,1), + new Pair(CyclosilicateSi6O18, 1), + new Pair(Borat, 3), + new Pair(Materials.Oxygen, 4), + new Pair(Materials.Hydrogen, 3) + ); + + public static final Werkstoff VanadioOxyDravit = new Werkstoff( + new short[]{0x60,0xA0,0xA0,0}, + "Vanadio-Oxy-Dravite", + "NaV3(Al4Mg2)(Si6O18)(BO3)3(OH)3O", + Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), + Werkstoff.Types.COMPOUND, + new Werkstoff.Features().addGems(), + 8, + TextureSet.SET_RUBY, + Arrays.asList(Materials.Sodium,Materials.Boron,Materials.Silicon), + //Na Cr3 (Al4Mg2) (Si6O18) (BO3)3 (OH)3 O + new Pair(Materials.Sodium, 1), + new Pair(Materials.Vanadium, 3), + new Pair(AluminiumMagnesite,1), + new Pair(CyclosilicateSi6O18, 1), + new Pair(Borat, 3), + new Pair(Materials.Oxygen, 4), + new Pair(Materials.Hydrogen, 3) + ); + + public static final Werkstoff Olenit = new Werkstoff( + new short[]{210,210,210,0}, + "Olenite", + "NaAl3Al6(Si6O18)(BO3)3O3OH", + Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), + Werkstoff.Types.COMPOUND, + new Werkstoff.Features().addGems(), + 9, + TextureSet.SET_RUBY, + Arrays.asList(Materials.Sodium,Materials.Boron,Materials.Silicon), + //Na Cr3 (Al4Mg2) (Si6O18) (BO3)3 (OH)3 O + new Pair(Materials.Sodium, 1), + new Pair(Materials.Aluminium, 9), + new Pair(Materials.Silicon, 6), + new Pair(Borat, 3), + new Pair(Materials.Oxygen, 22), + new Pair(Materials.Hydrogen, 1) + ); + + public static final Werkstoff Arsenopyrite = new Werkstoff( + new short[]{0xB0, 0xB0, 0xB0, 0}, + "Arsenopyrite", + Werkstoff.Types.COMPOUND, + new Werkstoff.Features(), + 10, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Sulfur, Materials.Arsenic,Materials.Iron), + new Pair(Materials.Iron, 1), + new Pair(Materials.Arsenic, 1), + new Pair(Materials.Sulfur, 1) + ); + + public static final Werkstoff Ferberite = new Werkstoff( + new short[]{0xB0, 0xB0, 0xB0, 0}, + "Ferberite", + Werkstoff.Types.COMPOUND, + new Werkstoff.Features(), + 11, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Iron, Materials.Tungsten), + new Pair(Materials.Iron, 1), + new Pair(Materials.Tungsten, 1), + new Pair(Materials.Oxygen, 3) + ); + + public static final Werkstoff Loellingit = new Werkstoff( + new short[]{0xD0, 0xD0, 0xD0, 0}, + "Loellingite", + Werkstoff.Types.COMPOUND, + new Werkstoff.Features(), + 12, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Iron, Materials.Arsenic), + new Pair(Materials.Iron, 1), + new Pair(Materials.Arsenic, 2) + ); + + public static final Werkstoff Roquesit= new Werkstoff( + new short[]{0xA0, 0xA0, 0xA0, 0}, + "Roquesite", + Werkstoff.Types.COMPOUND, + new Werkstoff.Features(), + 13, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Copper, Materials.Sulfur), + new Pair(Materials.Copper, 1), + new Pair(Materials.Indium, 1), + new Pair(Materials.Sulfur, 2) + ); + public static final Werkstoff Bornite= new Werkstoff( + new short[]{0x97, 0x66, 0x2B, 0}, + "Bornite", + Werkstoff.Types.COMPOUND, + new Werkstoff.Features(), + 14, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Copper,Materials.Iron, Materials.Sulfur), + new Pair(Materials.Copper, 5), + new Pair(Materials.Iron, 1), + new Pair(Materials.Sulfur, 4) + ); + public static final Werkstoff Wittichenit= new Werkstoff( + Materials.Copper.mRGBa, + "Wittichenite", + Werkstoff.Types.COMPOUND, + new Werkstoff.Features(), + 15, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Copper,Materials.Bismuth, Materials.Sulfur), + new Pair(Materials.Copper, 5), + new Pair(Materials.Bismuth, 1), + new Pair(Materials.Sulfur, 4) + ); + public static final Werkstoff Djurleit = new Werkstoff( + new short[]{0x60, 0x60, 0x60, 0}, + "Djurleite", + Werkstoff.Types.COMPOUND, + new Werkstoff.Features(), + 16, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Copper,Materials.Copper, Materials.Sulfur), + new Pair(Materials.Copper, 31), + new Pair(Materials.Sulfur, 16) + ); + + public static final Werkstoff Huebnerit = new Werkstoff( + new short[]{0x80, 0x60, 0x60, 0}, + "Huebnerite", + Werkstoff.Types.COMPOUND, + new Werkstoff.Features(), + 17, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Manganese,Materials.Tungsten), + new Pair(Materials.Manganese, 1), + new Pair(Materials.Tungsten, 1), + new Pair(Materials.Oxygen, 3) + ); + + public static final Werkstoff Thorianit = new Werkstoff( + new short[]{0x30, 0x30, 0x30, 0}, + "Thorianit", + Werkstoff.Types.COMPOUND, + new Werkstoff.Features(), + 18, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Thorium), + new Pair(Materials.Thorium, 1), + new Pair(Materials.Oxygen, 2) + ); + + + + + public void runInit() { + WerkstoffAdderRegistry.getINSTANCE().run(); + addSubTags(); + addItemsForGeneration(); + } + @Override + public void run(){ + if (!registered) { + MainMod.LOGGER.info("Loading Processing Recipes for BW Materials"); + long timepre = System.nanoTime(); + ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashMap.size()); + + for (short i = 0; i < Werkstoff.werkstoffHashMap.size(); i++) { + Werkstoff werkstoff = Werkstoff.werkstoffHashMap.get(i); + if (werkstoff == null || werkstoff.getmID() < 0) { + progressBar.step(""); + continue; + } + addDustRecipes(werkstoff); + addGemRecipes(werkstoff); + addOreRecipes(werkstoff); + addCrushedRecipes(werkstoff); + progressBar.step(werkstoff.getDefaultName()); + } + ProgressManager.pop(progressBar); + long timepost = System.nanoTime(); + MainMod.LOGGER.info("Loading Processing Recipes for BW Materials took "+(timepost-timepre)+"ns/"+((timepost-timepre)/1000000)+"ms/"+((timepost-timepre)/1000000000)+"s!"); + registered=true; + } + } + + private void addSubTags(){ + for (Werkstoff W : Werkstoff.werkstoffHashMap.values()){ + for (Pair pair : W.getContents().getValue().toArray(new Pair[0])){ + if (pair.getKey() instanceof Materials && ((Materials)pair.getKey()) == Materials.Neodymium){ + W.add(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM); + break; + } + else if (pair.getKey() instanceof Materials && ((Materials)pair.getKey()) == Materials.Iron){ + W.add(SubTag.ELECTROMAGNETIC_SEPERATION_IRON); + break; + } + else if (pair.getKey() instanceof Materials && ((Materials)pair.getKey()) == Materials.Gold){ + W.add(SubTag.ELECTROMAGNETIC_SEPERATION_GOLD); + break; + } + } + if (W.getFeatures().hasGems()){ + W.add(SubTag.CRYSTAL); + W.add(SubTag.CRYSTALLISABLE); + } + } + + + } + + private void addItemsForGeneration(){ + int toGenerateGlobal = 0b0000000; + + for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) + toGenerateGlobal = (toGenerateGlobal | werkstoff.getFeatures().toGenerate); + + if ((toGenerateGlobal & 0b1) != 0) { + items.put(dust, new BW_MetaGenerated_Items(dust)); + items.put(dustTiny, new BW_MetaGenerated_Items(dustTiny)); + items.put(dustSmall, new BW_MetaGenerated_Items(dustSmall)); + } + if ((toGenerateGlobal & 0b10) != 0) { + items.put(ingot, new BW_MetaGenerated_Items(ingot)); + + } + if ((toGenerateGlobal & 0b100) != 0) { + items.put(gem, new BW_MetaGenerated_Items(gem)); + items.put(gemChipped, new BW_MetaGenerated_Items(gemChipped)); + items.put(gemExquisite, new BW_MetaGenerated_Items(gemExquisite)); + items.put(gemFlawed, new BW_MetaGenerated_Items(gemFlawed)); + items.put(gemFlawless, new BW_MetaGenerated_Items(gemFlawless)); + } + if ((toGenerateGlobal & 0b1000) != 0) { + if (FMLCommonHandler.instance().getSide().isClient()) + RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); + GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class,"bw.blockoresTE"); + BWOres = new BW_MetaGenerated_Ores(Material.rock,BW_MetaGeneratedOreTE.class,"bw.blockores"); + GameRegistry.registerBlock(BWOres,BW_MetaGeneratedOre_Item.class,"bw.blockores.01"); + + items.put(crushed, new BW_MetaGenerated_Items(crushed)); + items.put(crushedPurified, new BW_MetaGenerated_Items(crushedPurified)); + items.put(crushedCentrifuged, new BW_MetaGenerated_Items(crushedCentrifuged)); + items.put(dustPure, new BW_MetaGenerated_Items(dustPure)); + items.put(dustImpure, new BW_MetaGenerated_Items(dustImpure)); + } + } + + private void addGemRecipes(Werkstoff werkstoff){ + if (werkstoff.getFeatures().hasGems()) { + GT_Values.RA.addForgeHammerRecipe(getCorresopndingItemStack(crushedCentrifuged, werkstoff), getCorresopndingItemStack(dust, werkstoff), 10, 16); + GT_ModHandler.addPulverisationRecipe(getCorresopndingItemStack(crushedCentrifuged, werkstoff), + getCorresopndingItemStack(dust, werkstoff), + werkstoff.getOreByProduct(-1, gem), + 10, true); + + GT_Values.RA.addSifterRecipe( + getCorresopndingItemStack(crushedPurified, werkstoff), + new ItemStack[]{ + getCorresopndingItemStack(gemExquisite, werkstoff), + getCorresopndingItemStack(gemFlawless, werkstoff), + getCorresopndingItemStack(gem, werkstoff), + getCorresopndingItemStack(gemFlawed, werkstoff), + getCorresopndingItemStack(gemChipped, werkstoff), + getCorresopndingItemStack(dust, werkstoff) + }, + new int[]{ + 100, 400, 1500, 2000, 4000, 5000 + }, + 800, + 16 + ); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemExquisite),werkstoff.get(dust,4)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawless),werkstoff.get(dust,2)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gem),werkstoff.get(dust)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawed),werkstoff.get(dustSmall,1)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemChipped),werkstoff.get(dustTiny)); + + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemExquisite),werkstoff.get(gemFlawless,2),64, 16); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawless),werkstoff.get(gem,2),64, 16); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gem),werkstoff.get(gemFlawed,2),64, 16); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawed),werkstoff.get(gemChipped,2),64, 16); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemChipped),werkstoff.get(dustTiny),64, 16); + } + } + + private void addDustRecipes(Werkstoff werkstoff){ + if ((werkstoff.getFeatures().toGenerate & 0b1) != 0){ + + List flOutputs = new ArrayList<>(); + List stOutputs = new ArrayList<>(); + HashMap> tracker = new HashMap<>(); + int cells = 0; + + if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge()) { + for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])){ + if (container.getKey() instanceof Materials){ + if (((Materials)container.getKey()).hasCorrespondingGas() || ((Materials)container.getKey()).hasCorrespondingFluid() || ((Materials)container.getKey()).mIconSet == TextureSet.SET_FLUID) { + FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000*container.getValue()); + if (tmpFl == null || tmpFl.getFluid() == null){ + tmpFl = ((Materials) container.getKey()).getFluid(1000*container.getValue()); + } + flOutputs.add(tmpFl); + if (flOutputs.size()>1) { + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(),stOutputs.size() - 1)); + } else { + stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey()+container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue()+1); + } + cells+=container.getValue(); + } + } else { + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(),stOutputs.size() - 1)); + } else { + stOutputs.add(((Materials) container.getKey()).getDust(tracker.get(container.getKey()).getKey()+container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue()+1); + } + } + } else if (container.getKey() instanceof Werkstoff){ + if (((Werkstoff)container.getKey()).getTexSet() == TextureSet.SET_FLUID){ + //not yet implemented no fluids from me... + } else { + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Werkstoff) container.getKey()).get(dust,container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(),stOutputs.size() - 1)); + } else { + stOutputs.add(((Werkstoff) container.getKey()).get(dust,(tracker.get(container.getKey()).getKey()+container.getValue()))); + stOutputs.remove(tracker.get(container.getKey()).getValue()+1); + } + } + } + } + ItemStack input = getCorresopndingItemStack(dust,werkstoff); + input.stackSize=werkstoff.getContents().getKey(); + if (werkstoff.getStats().isElektrolysis()) + GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), (Object)null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int)Math.max(1L,Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4,werkstoff.getContents().getValue().size()) *30, 0); + if (werkstoff.getStats().isCentrifuge()) + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), (Object)null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0); + } + + GT_ModHandler.addShapelessCraftingRecipe(getCorresopndingItemStack(dust,werkstoff), 0,new Object[]{ + getCorresopndingItemStack(dustTiny,werkstoff), + getCorresopndingItemStack(dustTiny,werkstoff), + getCorresopndingItemStack(dustTiny,werkstoff), + getCorresopndingItemStack(dustTiny,werkstoff), + getCorresopndingItemStack(dustTiny,werkstoff), + getCorresopndingItemStack(dustTiny,werkstoff), + getCorresopndingItemStack(dustTiny,werkstoff), + getCorresopndingItemStack(dustTiny,werkstoff), + getCorresopndingItemStack(dustTiny,werkstoff) + }); + GT_ModHandler.addShapelessCraftingRecipe(getCorresopndingItemStack(dust,werkstoff),0,new Object[]{ + getCorresopndingItemStack(dustSmall,werkstoff), + getCorresopndingItemStack(dustSmall,werkstoff), + getCorresopndingItemStack(dustSmall,werkstoff), + getCorresopndingItemStack(dustSmall,werkstoff) + }); + GT_ModHandler.addCraftingRecipe(getCorresopndingItemStack(dustSmall,werkstoff,4),new Object[]{ + " T ",'T',getCorresopndingItemStack(dust,werkstoff) + }); + GT_ModHandler.addCraftingRecipe(getCorresopndingItemStack(dustTiny,werkstoff,9),new Object[]{ + "T ",'T',getCorresopndingItemStack(dust,werkstoff) + }); + if ((werkstoff.getFeatures().toGenerate & 2) != 0 && !werkstoff.getStats().isBlastFurnace()) { + GT_ModHandler.addSmeltingRecipe(getCorresopndingItemStack(dust, werkstoff), getCorresopndingItemStack(ingot, werkstoff)); + GT_ModHandler.addSmeltingRecipe(getCorresopndingItemStack(dustTiny, werkstoff), getCorresopndingItemStack(nugget, werkstoff)); + } + + if (werkstoff.contains(SubTag.CRYSTALLISABLE)) { + GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustPure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); + GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustImpure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); + GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustPure), gregtech.api.util.GT_ModHandler.getDistilledWater(200L), werkstoff.get(gem), 9500, 1500, 24); + GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustImpure), gregtech.api.util.GT_ModHandler.getDistilledWater(200L), werkstoff.get(gem), 9500, 1500, 24); + } + + } + } + + private void addOreRecipes(Werkstoff werkstoff){ + if ((werkstoff.getFeatures().toGenerate & 2) != 0 && !werkstoff.getStats().isBlastFurnace()) + GT_ModHandler.addSmeltingRecipe(getCorresopndingItemStack(ore,werkstoff),getCorresopndingItemStack(ingot,werkstoff)); + + if ((werkstoff.getFeatures().toGenerate & 0b1000) != 0) { + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ore), werkstoff.getFeatures().hasGems() ? werkstoff.get(gem) : werkstoff.get(crushed), 16, 10); + GT_ModHandler.addPulverisationRecipe( + werkstoff.get(ore), + GT_Utility.mul(2L, werkstoff.get(crushed)), + werkstoff.getOreByProduct(0,dust), werkstoff.getNoOfByProducts() > 0 ? 10 : 0, Materials.Stone.getDust(1), 50, true); + } + } + + private void addCrushedRecipes(Werkstoff werkstoff) { + if ((werkstoff.getFeatures().toGenerate & 0b1000) == 0 || (werkstoff.getFeatures().toGenerate & 0b1) == 0) + return; + + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), 10, 16); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), werkstoff.getOreByProduct(0, dust), 10, false); + GT_ModHandler.addOreWasherRecipe(werkstoff.get(crushed), 1000, werkstoff.get(crushedPurified), werkstoff.getOreByProduct(0, dustTiny), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L)); + GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushed), (int) Math.min(5000L, Math.abs(werkstoff.getStats().protons * 20L)), new Object[]{werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dustTiny), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L)}); + + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), 10, 16); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), werkstoff.getOreByProduct(1, dust), 10, false); + GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushedPurified), (int) Math.min(5000L, Math.abs(werkstoff.getStats().protons * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dustTiny)); + + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(dust), 10, 16); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(dust), werkstoff.getOreByProduct(2, dust), 10, false); + + if (werkstoff.contains(SubTag.WASHING_MERCURY)) + GT_Values.RA.addChemicalBathRecipe(werkstoff.get(crushed), Materials.Mercury.getFluid(1000L), werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); + if (werkstoff.contains(SubTag.WASHING_SODIUMPERSULFATE)) + GT_Values.RA.addChemicalBathRecipe(werkstoff.get(crushed), Materials.SodiumPersulfate.getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L), werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); + GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustImpure), 0, werkstoff.get(dust), werkstoff.getOreByProduct(0, dustTiny), null, null, null, null, (int) Math.max(1L, werkstoff.getStats().mass * 8L)); + GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustPure), 0, werkstoff.get(dust), werkstoff.getOreByProduct(1, dustTiny), null, null, null, null, (int) Math.max(1L, werkstoff.getStats().mass * 8L)); + + if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_GOLD)) + GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Gold, 1L), GT_OreDictUnificator.get(OrePrefixes.nugget, Materials.Gold, 1L), new int[]{10000, 4000, 2000}, 400, 24); + if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_IRON)) + GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Iron, 1L), GT_OreDictUnificator.get(OrePrefixes.nugget, Materials.Iron, 1L), new int[]{10000, 4000, 2000}, 400, 24); + if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM)) + GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Neodymium, 1L), GT_OreDictUnificator.get(OrePrefixes.nugget, Materials.Neodymium, 1L), new int[]{10000, 4000, 2000}, 400, 24); + + } + + public static ItemStack getCorresopndingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff) { + return getCorresopndingItemStack(orePrefixes,werkstoff,1); + } + + public static ItemStack getCorresopndingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { + if (orePrefixes == ore) + return new ItemStack(BWOres,amount,werkstoff.getmID()); + return new ItemStack(items.get(orePrefixes), amount, werkstoff.getmID()).copy(); + } + +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index 98601e568c..08e4f3269c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.MainMod; +import gregtech.api.interfaces.IColorModulationContainer; import net.minecraft.item.EnumRarity; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.Fluid; @@ -35,7 +36,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Objects; -public class BioCulture extends BioData { +public class BioCulture extends BioData implements IColorModulationContainer { public static final ArrayList BIO_CULTURE_ARRAY_LIST = new ArrayList(); public static final BioCulture NULLCULTURE = BioCulture.createAndRegisterBioCulture(Color.BLUE, "", BioPlasmid.NULLPLASMID,BioDNA.NULLDNA, false); //fallback NULL culture, also Blue =) @@ -197,4 +198,9 @@ public class BioCulture extends BioData { public int hashCode() { return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(17).putInt(MurmurHash3.murmurhash3_x86_32(this.getName(),0,this.getName().length(),31)).putInt(this.getColorRGB()).putInt(this.getPlasmid().ID).putInt(this.getdDNA().ID).put((byte) (isBreedable() ? 1 : 0)).array(),0,17,31); } + + @Override + public short[] getRGBA() { + return new short[]{(short) getColor().getRed(), (short) getColor().getGreen(), (short) getColor().getBlue(), (short) getColor().getAlpha()}; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java new file mode 100644 index 0000000000..f61eee3c3c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util; + +import java.nio.ByteBuffer; +import java.util.Arrays; +import java.util.Map; + +public class Pair implements Map.Entry { + Object[] pair= new Object[2]; + + + public Pair(Object[] pair) { + this.pair = pair; + } + + + public Pair(A k, B v) { + this.pair[0] = k; + this.pair[1] = v; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Pair)) return false; + + Pair pair1 = (Pair) o; + + // Probably incorrect - comparing Object[] arrays with Arrays.equals + return Arrays.equals(this.pair, pair1.pair); + } + + @Override + public int hashCode() { + return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(8).putInt(pair[0].hashCode()).putInt(pair[1].hashCode()).array(),0,8,31); + } + + @Override + public A getKey() { + return (A) pair[0]; + } + + @Override + public B getValue() { + return (B) pair[1]; + } + + @Override + public B setValue(Object value) { + pair[1]=value; + return (B) pair[1]; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java new file mode 100644 index 0000000000..58d9f52d66 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod; + +import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.common.config.Configuration; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@Mod( + modid =BartWorksCrossmod.MOD_ID, name = BartWorksCrossmod.NAME, version = BartWorksCrossmod.VERSION, + dependencies = "required-after:IC2; " + + "required-after:gregtech; " + + "required-after:bartworks;" + + "after:GalacticraftCore;" +) +public class BartWorksCrossmod { + public static final String NAME = "BartWorks Mod Additions"; + public static final String VERSION = "0.0.1"; + public static final String MOD_ID = "bartworkscrossmod"; + public static final Logger LOGGER = LogManager.getLogger(NAME); + + @Mod.Instance(MOD_ID) + public static BartWorksCrossmod instance; + + @Mod.EventHandler + public void preInit(FMLPreInitializationEvent preinit){ + + + if (Loader.isModLoaded("GalacticraftCore")) + GalacticraftProxy.preInit(preinit); + + } + + @Mod.EventHandler + public void init(FMLInitializationEvent init) { + if (Loader.isModLoaded("GalacticraftCore")) + GalacticraftProxy.init(init); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java new file mode 100644 index 0000000000..ccc11bef56 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft; + +import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import gregtech.api.objects.GT_UO_DimensionList; +import net.minecraftforge.common.config.Configuration; + +import java.io.File; + +import static com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WorldGenRoss128.*; + +public class GalacticraftProxy { + private GalacticraftProxy(){} + static Configuration gtConf; + public static GT_UO_DimensionList uo_dimensionList = new GT_UO_DimensionList(); + + public static void preInit(FMLPreInitializationEvent e){ + if (FMLCommonHandler.instance().getSide().isServer() || FMLCommonHandler.instance().getEffectiveSide().isServer()){ + serverpreInit(e); + } else { + clientpreInit(e); + } + commonpreInit(e); + } + + private static void serverpreInit(FMLPreInitializationEvent e){ + + } + private static void clientpreInit(FMLPreInitializationEvent e){ + } + private static void commonpreInit(FMLPreInitializationEvent e){ + Configuration c = new Configuration(e.getSuggestedConfigurationFile()); + gtConf = new Configuration(new File(new File(e.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg")); + uo_dimensionList.getConfig(gtConf, "undergroundfluid"); + init_undergroundFluidsRoss128(); + gtConf.save(); + Ross128.ross128ID=c.get("System","DimID",-64,"The Dim ID for Ross128").getInt(-64); + init_OresRoss128(); + } + + public static void init(FMLInitializationEvent e){ + if (FMLCommonHandler.instance().getSide().isServer() || FMLCommonHandler.instance().getEffectiveSide().isServer()){ + serverInit(e); + } else { + clientInit(e); + } + commonInit(e); + } + + private static void serverInit(FMLInitializationEvent e){ + + } + private static void clientInit(FMLInitializationEvent e){ + + } + private static void commonInit(FMLInitializationEvent e){ + Ross128.init(); + + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java new file mode 100644 index 0000000000..91c66768ab --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft; + +import micdoodle8.mods.galacticraft.api.vector.Vector3; +import micdoodle8.mods.galacticraft.api.world.ITeleportType; +import micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats; +import micdoodle8.mods.galacticraft.planets.mars.entities.EntityLandingBalloons; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +import java.util.Random; + +public class UniversalTeleportType implements ITeleportType { + + @Override + public boolean useParachute() { + return false; + } + + @Override + public Vector3 getPlayerSpawnLocation(WorldServer world, EntityPlayerMP player) { + return getEntitySpawnLocation(world,player); + } + + @Override + public Vector3 getEntitySpawnLocation(WorldServer world, Entity entity) { + if (entity instanceof EntityPlayerMP){ + GCPlayerStats stats = GCPlayerStats.get((EntityPlayerMP)entity); + return new Vector3(stats.coordsTeleportedFromX, 500D, stats.coordsTeleportedFromZ); + } + return new Vector3(entity.posX, 500D, entity.posZ); + } + + @Override + public Vector3 getParaChestSpawnLocation(WorldServer world, EntityPlayerMP player, Random rand) { + return null; + } + + @Override + public void onSpaceDimensionChanged(World newWorld, EntityPlayerMP player, boolean ridingAutoRocket) { + if ((player != null) && (GCPlayerStats.get(player).teleportCooldown <= 0)) + { + if (player.capabilities.isFlying) { + player.capabilities.isFlying = false; + } + + EntityLandingBalloons entityLandingBalloons = new EntityLandingBalloons(player); + if (!newWorld.isRemote) { + newWorld.spawnEntityInWorld(entityLandingBalloons); + } + GCPlayerStats.get(player).teleportCooldown = 10; + } + } + @Override + public void setupAdventureSpawn(EntityPlayerMP player) { + + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java new file mode 100644 index 0000000000..a404c30e34 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.blocks; + +import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; +import com.github.bartimaeusnek.crossmod.galacticraft.creativetabs.SpaceTab; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.world.IBlockAccess; + +public class UniversalSpaceBlocks extends BW_Blocks { + + public UniversalSpaceBlocks(String name, String[] texture) { + super(name, texture, SpaceTab.getInstance(), Material.rock); + } + + @Override + public boolean canBeReplacedByLeaves(IBlockAccess world, int x, int y, int z) { + return true; + } + + @Override + public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { + return true; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java new file mode 100644 index 0000000000..49a1bf9475 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.creativetabs; + +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; + +public class SpaceTab extends CreativeTabs { + + private static final SpaceTab instance = new SpaceTab("SpaceTab"); + + public static SpaceTab getInstance(){ + return instance; + } + + private SpaceTab(String label) { + super(label); + } + + @Override + public Item getTabIconItem() { + return ItemRegistry.DESTRUCTOPACK; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java new file mode 100644 index 0000000000..e222ab8c9c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen; + + +import cpw.mods.fml.common.IWorldGenerator; +import gregtech.api.objects.XSTR; +import gregtech.api.util.GT_Log; +import gregtech.api.world.GT_Worldgen; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; + +import java.util.HashSet; +import java.util.Random; + +/** + * Original GT File Stripped and adjusted to work with this mod + */ +public class BW_WordGenerator implements IWorldGenerator { + + public BW_WordGenerator() { + //GT_NH Override... +// GameRegistry.registerWorldGenerator(this, 1073741823); + } + + public synchronized void generate(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + new WorldGenContainer(aX * 16, aZ * 16, aWorld.provider.dimensionId, aWorld, aChunkGenerator, aChunkProvider).run(); + } + + public static class WorldGenContainer implements Runnable { + public int mX; + public int mZ; + public final int mDimensionType; + public final World mWorld; + public final IChunkProvider mChunkGenerator; + public final IChunkProvider mChunkProvider; + public static HashSet mGenerated = new HashSet<>(2000); + + public WorldGenContainer(int aX, int aZ, int aDimensionType, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + this.mX = aX; + this.mZ = aZ; + this.mDimensionType = aDimensionType; + this.mWorld = aWorld; + this.mChunkGenerator = aChunkGenerator; + this.mChunkProvider = aChunkProvider;; + } + + //returns a coordinate of a center chunk of 3x3 square; the argument belongs to this square + public int getVeinCenterCoordinate(int c) { + c += c < 0 ? 1 : 3; + return c - c % 3 - 2; + } + + public boolean surroundingChunksLoaded(int xCenter, int zCenter) { + return mWorld.checkChunksExist(xCenter - 16, 0, zCenter - 16, xCenter + 16, 0, zCenter + 16); + } + + public XSTR getRandom(int xChunk, int zChunk) { + long worldSeed = mWorld.getSeed(); + XSTR fmlRandom = new XSTR(worldSeed); + long xSeed = fmlRandom.nextLong() >> 2 + 1L; + long zSeed = fmlRandom.nextLong() >> 2 + 1L; + long chunkSeed = (xSeed * xChunk + zSeed * zChunk) ^ worldSeed; + fmlRandom.setSeed(chunkSeed); + return new XSTR(fmlRandom.nextInt()); + } + + public void run() { + int xCenter = getVeinCenterCoordinate(mX >> 4); + int zCenter = getVeinCenterCoordinate(mZ >> 4); + Random random = getRandom(xCenter, zCenter); + xCenter <<= 4; + zCenter <<= 4; + ChunkCoordIntPair centerChunk = new ChunkCoordIntPair(xCenter, zCenter); + if (!mGenerated.contains(centerChunk) && surroundingChunksLoaded(xCenter, zCenter)) { + mGenerated.add(centerChunk); + if ((BW_WorldGenRoss128.sWeight > 0) && (BW_WorldGenRoss128.sList.size() > 0)) { + boolean temp = true; + int tRandomWeight; + for (int i = 0; (i < 256) && (temp); i++) { + tRandomWeight = random.nextInt(BW_WorldGenRoss128.sWeight); + for (GT_Worldgen tWorldGen : BW_WorldGenRoss128.sList) { + tRandomWeight -= ((BW_WorldGenRoss128) tWorldGen).mWeight; + if (tRandomWeight <= 0) { + try { + if (tWorldGen.executeWorldgen(this.mWorld, random, "", this.mDimensionType, xCenter, zCenter, this.mChunkGenerator, this.mChunkProvider)) { + temp = false; + } + break; + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + } + } + } + } + } + Chunk tChunk = this.mWorld.getChunkFromBlockCoords(this.mX, this.mZ); + if (tChunk != null) { + tChunk.isModified = true; + } + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java new file mode 100644 index 0000000000..3a1c3c2c95 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider.WorldProviderRoss128b; +import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import gregtech.GT_Mod; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.world.GT_Worldgen; +import gregtech.common.blocks.GT_TileEntity_Ores; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.fluids.FluidRegistry; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; + +/** + * Original GT File Stripped and adjusted to work with this mod + */ +public class BW_WorldGenRoss128 extends GT_Worldgen { + + private static final boolean logOregenRoss128 = false; + + public static void init_OresRoss128() { + new BW_WorldGenRoss128("ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, WerkstoffLoader.Thorianit, Materials.Uraninite, Materials.Lepidolite, Materials.Spodumene); + new BW_WorldGenRoss128("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Materials.Graphite, Materials.Diamond, Materials.Coal, Materials.Graphene); + new BW_WorldGenRoss128("ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, WerkstoffLoader.Bismuthinit, Materials.Stibnite, Materials.Bismuth, WerkstoffLoader.Bismutite); + new BW_WorldGenRoss128("ore.mix.ross128.TurmalinAlkali", true, 5, 200, 15, 4, 48, WerkstoffLoader.Olenit, WerkstoffLoader.FluorBuergerit, WerkstoffLoader.ChromoAluminoPovondrait, WerkstoffLoader.VanadioOxyDravit); + new BW_WorldGenRoss128("ore.mix.ross128.Roquesit", true, 5, 250, 3, 1, 12, WerkstoffLoader.Arsenopyrite, WerkstoffLoader.Ferberite, WerkstoffLoader.Loellingit, WerkstoffLoader.Roquesit); + new BW_WorldGenRoss128("ore.mix.ross128.Tungstate", true, 5, 250, 10, 4, 14, WerkstoffLoader.Ferberite, WerkstoffLoader.Huebnerit, WerkstoffLoader.Loellingit, Materials.Scheelite); + new BW_WorldGenRoss128("ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, WerkstoffLoader.Djurleit, WerkstoffLoader.Bornite, WerkstoffLoader.Wittichenit, Materials.Tetrahedrite); + new BW_WorldGenRoss128("ore.mix.ross128.magnetite", true, 60, 180, 50, 2, 32, Materials.Magnetite, Materials.Magnetite, Materials.Iron, Materials.VanadiumMagnetite); + new BW_WorldGenRoss128("ore.mix.ross128.gold", true, 30, 60, 50, 2, 32, Materials.Magnetite, Materials.Magnetite, Materials.VanadiumMagnetite, Materials.Gold); + new BW_WorldGenRoss128("ore.mix.ross128.iron", true, 10, 40, 40, 3, 24, Materials.BrownLimonite, Materials.YellowLimonite, Materials.BandedIron, Materials.Malachite); + } + + public static void init_undergroundFluidsRoss128(){ + String ross128b=StatCollector.translateToLocal("planet.Ross128b"); + uo_dimensionList.SetConfigValues(ross128b,ross128b,"veryheavyoil","liquid_extra_heavy_oil",0,625,40,5); + uo_dimensionList.SetConfigValues(ross128b,ross128b,"lava", FluidRegistry.getFluidName(FluidRegistry.LAVA),0,80000,5,5); + uo_dimensionList.SetConfigValues(ross128b,ross128b,"gas_natural_gas", "gas_natural_gas",0,625,65,5); + + } + + public byte bwOres = 0b0000; + public int mMinY,mWeight,mDensity,mSize,mMaxY,mPrimaryMeta,mSecondaryMeta,mBetweenMeta,mSporadicMeta; + public static int sWeight; + public static final List sList = new ArrayList<>(); + + public BW_WorldGenRoss128(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { + super(aName, sList, aDefault); + this.mMinY = (short) aMinY; + this.mMaxY = (short) aMaxY; + this.mWeight = (short)aWeight; + this.mDensity = (short) aDensity; + this.mSize = (short) Math.max(1, aSize); + + if (mEnabled) + sWeight += this.mWeight; + + if (top instanceof Werkstoff) + bwOres = (byte) (bwOres | 0b1000); + if (bottom instanceof Werkstoff) + bwOres = (byte) (bwOres | 0b0100); + if (between instanceof Werkstoff) + bwOres = (byte) (bwOres | 0b0010); + if (sprinkled instanceof Werkstoff) + bwOres = (byte) (bwOres | 0b0001); + + short aPrimary = top instanceof Materials ? + (short) ((Materials)top).mMetaItemSubID: + top instanceof Werkstoff ? + (short) ((Werkstoff)top).getmID(): + 0 + ; + short aSecondary = bottom instanceof Materials ? + (short) ((Materials)bottom).mMetaItemSubID: + bottom instanceof Werkstoff ? + (short) ((Werkstoff)bottom).getmID(): + 0 + ; + short aBetween = between instanceof Materials ? + (short) ((Materials)between).mMetaItemSubID: + between instanceof Werkstoff ? + (short) ((Werkstoff)between).getmID(): + 0 + ; + short aSporadic = sprinkled instanceof Materials ? + (short) ((Materials)sprinkled).mMetaItemSubID: + sprinkled instanceof Werkstoff ? + (short) ((Werkstoff)sprinkled).getmID(): + 0 + ; + this.mPrimaryMeta = (short) aPrimary; + this.mSecondaryMeta = (short) aSecondary; + this.mBetweenMeta = (short) aBetween; + this.mSporadicMeta = (short) aSporadic; + + } + + @Override + public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { + return aWorld.provider instanceof WorldProviderRoss128b; + } + + @Override + public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + { + int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); + int cX = aChunkX - aRandom.nextInt(this.mSize); + int eX = aChunkX + 16 + aRandom.nextInt(this.mSize); + + for(int tX = cX; tX <= eX; ++tX) { + int cZ = aChunkZ - aRandom.nextInt(this.mSize); + int eZ = aChunkZ + 16 + aRandom.nextInt(this.mSize); + + for(int tZ = cZ; tZ <= eZ; ++tZ) { + int i; + if (this.mSecondaryMeta > 0) { + for(i = tMinY - 1; i < tMinY + 2; ++i) { + if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { + setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false); + } + } + } + + if (this.mBetweenMeta > 0 && (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) { + setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); + } + + if (this.mPrimaryMeta > 0) { + for(i = tMinY + 3; i < tMinY + 6; ++i) { + if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { + setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false); + } + } + } + + if (this.mSporadicMeta > 0 && (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) { + setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); + } + } + } + + if (logOregenRoss128) { + MainMod.LOGGER.info("Generated Orevein: " + this.mWorldGenName + " " + aChunkX + " " + aChunkZ); + } + + return true; + } + } + + public boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre) { + if ((aMetaData == mSporadicMeta && (bwOres & 0b0001) != 0) || (aMetaData == mBetweenMeta && (bwOres & 0b0010) != 0) || (aMetaData == mPrimaryMeta && (bwOres & 0b1000) != 0) || (aMetaData == mSecondaryMeta && (bwOres & 0b0100) != 0)){ + return BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false); + } + return GT_TileEntity_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, isSmallOre, false); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java new file mode 100644 index 0000000000..1f9ce77b26 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider; + +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WordGenerator; +import gregtech.api.GregTech_API; +import gregtech.api.objects.XSTR; +import gregtech.api.world.GT_Worldgen_Ore; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFalling; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.BiomeGenForest; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderGenerate; +import net.minecraft.world.gen.MapGenBase; +import net.minecraft.world.gen.MapGenCaves; +import net.minecraft.world.gen.MapGenRavine; +import net.minecraft.world.gen.feature.WorldGenCanopyTree; +import net.minecraft.world.gen.feature.WorldGenLakes; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.PopulateChunkEvent; +import net.minecraftforge.event.terraingen.TerrainGen; + +import java.util.List; + +import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE; +import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE; + +public class ChunkProviderRoss128b extends ChunkProviderGenerate { + private BiomeGenBase[] biomesForGeneration; + + private BW_WordGenerator BWOreGen = new BW_WordGenerator(); + XSTR rand = new XSTR(); + private World worldObj; + private MapGenBase caveGenerator = new MapGenCaves(); + private MapGenBase ravineGenerator = new MapGenRavine(); + + public ChunkProviderRoss128b(World par1World, long seed, boolean mapFeaturesEnabled) { + super(par1World, seed, mapFeaturesEnabled); + worldObj=par1World; + } + + @Override + public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) { + return super.getPossibleCreatures(p_73155_1_, p_73155_2_, p_73155_3_, p_73155_4_); + } + + public Chunk provideChunk(int p_73154_1_, int p_73154_2_) + { + this.rand.setSeed((long)p_73154_1_ * 341873128712L + (long)p_73154_2_ * 132897987541L); + Block[] ablock = new Block[65536]; + byte[] abyte = new byte[65536]; + this.func_147424_a(p_73154_1_, p_73154_2_, ablock); + this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); + for (int i = 0; i < biomesForGeneration.length; i++) { + BiomeGenBase biomeGenBase = biomesForGeneration[i]; + if (biomeGenBase.biomeID == BiomeGenBase.mushroomIsland.biomeID ){ + this.biomesForGeneration[i]=BiomeGenBase.taiga; + } else if (biomeGenBase.biomeID == BiomeGenBase.mushroomIslandShore.biomeID){ + this.biomesForGeneration[i]=BiomeGenBase.stoneBeach; + } + } + this.replaceBlocksForBiome(p_73154_1_, p_73154_2_, ablock, abyte, this.biomesForGeneration); + this.caveGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); + this.ravineGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); + + Chunk chunk = new Chunk(this.worldObj, ablock, abyte, p_73154_1_, p_73154_2_); + byte[] abyte1 = chunk.getBiomeArray(); + + for (int k = 0; k < abyte1.length; ++k) + { + abyte1[k] = (byte)this.biomesForGeneration[k].biomeID; + } + + chunk.generateSkylightMap(); + return chunk; + } + + @Override + public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) + { + BlockFalling.fallInstantly = true; + int k = p_73153_2_ * 16; + int l = p_73153_3_ * 16; + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16); + this.rand.setSeed(this.worldObj.getSeed()); + if (p_73153_2_%4==0 || p_73153_3_%4==0 ) { + long i1 = this.rand.nextLong() / 2L * 2L + 1L; + long j1 = this.rand.nextLong() / 2L * 2L + 1L; + this.rand.setSeed((long) p_73153_2_ * i1 + (long) p_73153_3_ * j1 ^ this.worldObj.getSeed()); + } + boolean flag = false; + + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag)); + + int k1; + int l1; + int i2; + + if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag && this.rand.nextInt(4) == 0 + && TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, LAKE)) + { + k1 = k + this.rand.nextInt(16) + 8; + l1 = this.rand.nextInt(256); + i2 = l + this.rand.nextInt(16) + 8; + (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, k1, l1, i2); + } + + biomegenbase.decorate(this.worldObj, this.rand, k, l); + + k += 8; + l += 8; + + boolean doGen = TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, ICE); + for (k1 = 0; doGen && k1 < 16; ++k1) + { + for (l1 = 0; l1 < 16; ++l1) + { + i2 = this.worldObj.getPrecipitationHeight(k + k1, l + l1); + + if (this.worldObj.isBlockFreezable(k1 + k, i2 - 1, l1 + l)) + { + this.worldObj.setBlock(k1 + k, i2 - 1, l1 + l, Blocks.ice, 0, 2); + } + + if (this.worldObj.func_147478_e(k1 + k, i2, l1 + l, true)) + { + this.worldObj.setBlock(k1 + k, i2, l1 + l, Blocks.snow_layer, 0, 2); + } + } + } + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag)); + + BWOreGen.generate(rand,p_73153_2_,p_73153_3_,worldObj,this,this); + + BlockFalling.fallInstantly = false; + } + + @Override + public void recreateStructures(int p_82695_1_, int p_82695_2_) { + } + + @Override + public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] blocks, byte[] metas, BiomeGenBase[] p_147422_5_) + { + super.replaceBlocksForBiome(p_147422_1_, p_147422_2_, blocks, metas, p_147422_5_); + for (int i = 0; i < blocks.length; i++) { +// if (blocks[i] == Blocks.stone) { +// blocks[i] = Ross128.Ross128bStone.getBlock(); +// metas[i] = Ross128.Ross128bStone.getMetadata(); +// }else + if (blocks[i] == Blocks.grass) { + blocks[i] = Blocks.dirt; + metas[i] = 2; + } +// else if (blocks[i] == Blocks.dirt) { +// blocks[i] = Ross128.Ross128bDirt.getBlock(); +// metas[i] = Ross128.Ross128bDirt.getMetadata(); +// } + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b.java new file mode 100644 index 0000000000..a8039d0282 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider; + +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import micdoodle8.mods.galacticraft.core.client.SkyProviderOverworld; +import net.minecraft.util.ResourceLocation; + +public class SkyProviderRoss128b extends SkyProviderOverworld { + + //ASM enables this texture + public static final ResourceLocation sunTex = new ResourceLocation(BartWorksCrossmod.MOD_ID+":galacticraft/Ross128b/World/SunRoss128.png"); +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b.java new file mode 100644 index 0000000000..c2b1e9d68a --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b.java @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider; + +import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; +import micdoodle8.mods.galacticraft.api.prefab.world.gen.WorldProviderSpace; +import micdoodle8.mods.galacticraft.api.vector.Vector3; +import micdoodle8.mods.galacticraft.api.world.IExitHeight; +import micdoodle8.mods.galacticraft.api.world.ISolarLevel; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.IChunkProvider; + +public class WorldProviderRoss128b extends WorldProviderSpace implements IExitHeight, ISolarLevel { + + @Override + public boolean canRespawnHere() { + return true; + } + + @SideOnly(Side.CLIENT) + public Vec3 getFogColor(float cy, float noidea) + { + float angle = MathHelper.cos(cy * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + + if (angle < 0.0F) + { + angle = 0.0F; + } + + if (angle > 1.0F) + { + angle = 1.0F; + } + + float red = 200/255f; + float green = 80/255f; + float blue = 0.0F; + red *= angle * 0.94F + 0.06F; + green *= angle * 0.94F + 0.06F; + return Vec3.createVectorHelper((double)red, (double)green, (double)blue); + } + + + @Override + public Vector3 getFogColor() { + //unused + return null; + } + + @Override + public float getSunBrightness(float par1) { + return super.getSunBrightness(par1)*0.975f; + } + + @Override + public float calculateCelestialAngle(long par1, float par3) { + return super.calculateCelestialAngle(par1, par3); + } + + @Override + public Vector3 getSkyColor() { + float red = 200/255f; + float green = 120/255f; + float blue = 0.0F; + return new Vector3(red,green,blue); + } + + @Override + public boolean canRainOrSnow() { + return false; + } + + @Override + public boolean hasSunset() { + return true; + } + + @Override + public long getDayLength() { + return (long) (24000*9.9f); + } + + @Override + public Class getChunkProviderClass() { + return ChunkProviderRoss128b.class; + } + + @Override + public Class getWorldChunkManagerClass() { + return WorldChunkManager.class; + } + + @Override + public float getGravity() { + return -0.0035F; + } + + @Override + public double getMeteorFrequency() { + return 0D; + } + + @Override + public double getFuelUsageMultiplier() { + return 1.35D; + } + + @Override + public boolean canSpaceshipTierPass(int tier) { + return Ross128.Ross128b.getTierRequirement() <= tier; + } + + @Override + public float getFallDamageModifier() { + return 1.35F; + } + + @Override + public float getSoundVolReductionAmount() { + return 1F; + } + + @Override + public float getThermalLevelModifier() { + return 0.01f; + } + + @Override + public float getWindLevel() { + return 1.35f; + } + + @Override + public CelestialBody getCelestialBody() { + return Ross128.Ross128b; + } + + @Override + public double getYCoordinateToTeleport() { + return 500D; + } + + @Override + public double getSolarEnergyMultiplier() { + return 1.38D; + } + + @Override + public boolean hasBreathableAtmosphere() { + return true; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128.java new file mode 100644 index 0000000000..5ce0d75e27 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.solarsystems; + +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; +import com.github.bartimaeusnek.crossmod.galacticraft.blocks.UniversalSpaceBlocks; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider.WorldProviderRoss128b; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.GameRegistry; +import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; +import micdoodle8.mods.galacticraft.api.galaxies.*; +import micdoodle8.mods.galacticraft.api.prefab.core.BlockMetaPair; +import micdoodle8.mods.galacticraft.api.vector.Vector3; +import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; +import micdoodle8.mods.galacticraft.core.GalacticraftCore; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +import java.util.Arrays; + +public class Ross128 { + + private Ross128(){} + + public static SolarSystem Ross128System; + public static Star Ross128; + public static Planet Ross128b; + public static Moon Ross128ba; +// public static Block Ross128bBlocks; +// public static BlockMetaPair Ross128bStone,Ross128bDirt,Ross128bGrass; + public static int ross128ID = -64; + public static void init() { + +// Ross128bBlocks = new UniversalSpaceBlocks("Ross128bBlocks",new String[]{BartWorksCrossmod.MOD_ID+":Ross128bStone",BartWorksCrossmod.MOD_ID+":Ross128bDirt",BartWorksCrossmod.MOD_ID+":Ross128bGrass"}); + + Ross128System = new SolarSystem("Ross128System", "milkyWay").setMapPosition(new Vector3(-1.0D, 1.3D, 0.0D)); + Ross128 = (Star) new Star("Ross128").setParentSolarSystem(Ross128System).setTierRequired(-1); + Ross128.setUnreachable(); + Ross128.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID+":galacticraft/Ross128b/MapObjs/Ross128.png")); + Ross128System.setMainStar(Ross128); + + Ross128b = new Planet("Ross128b").setParentSolarSystem(Ross128System); + Ross128b.setRingColorRGB((0x9F)/255f, (0x8A)/255f, (0x79)/255f); + Ross128b.setPhaseShift(1.25F); + Ross128b.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID+":galacticraft/Ross128b/MapObjs/Ross128b.png")); + Ross128b.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(0.75F, 1.75F)); + Ross128b.setRelativeOrbitTime(0.65F); + Ross128b.atmosphere.addAll(Arrays.asList(IAtmosphericGas.OXYGEN,IAtmosphericGas.NITROGEN,IAtmosphericGas.ARGON)); + Ross128b.setDimensionInfo(ross128ID, WorldProviderRoss128b.class); + Ross128b.setTierRequired(Loader.isModLoaded("galaxyspace") ? 4 : Loader.isModLoaded("GalacticraftMars") ? 3 : -1); + + Ross128ba = new Moon("Ross128ba").setParentPlanet(Ross128b); + Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f,15f)).setRelativeOrbitTime(1 / 0.01F); + Ross128ba.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID+":galacticraft/Ross128b/MapObjs/Ross128ba.png")); + Ross128ba.setUnreachable(); //for now + +// GameRegistry.registerBlock(Ross128bBlocks,Ross128bBlocks.getUnlocalizedName()); +// +// Ross128bStone=new BlockMetaPair(Ross128bBlocks, (byte) 0); +// Ross128bDirt=new BlockMetaPair(Ross128bBlocks, (byte) 1); +// Ross128bGrass=new BlockMetaPair(Ross128bBlocks, (byte) 2); + + GalaxyRegistry.registerPlanet(Ross128b); + GalaxyRegistry.registerMoon(Ross128ba); + GalaxyRegistry.registerSolarSystem(Ross128System); + GalacticraftRegistry.registerTeleportType(WorldProviderRoss128b.class, new UniversalTeleportType()); + } + +} diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index fb9f53db31..773214b1f7 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -141,4 +141,11 @@ tile.biolab.name=Bio Lab tile.biovat.name=Bacterial Vat tile.radiohatch.name=Radio Hatch tile.bw.windmill.name=Windmill -tile.manutrafo.name=Manual Trafo \ No newline at end of file +tile.manutrafo.name=Manual Trafo + +itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials + +planet.Ross128b=Ross128b +moon.Ross128ba=Ross128ba +star.Ross128=Ross128 +solarsystem.Ross128System=Ross128-System \ No newline at end of file diff --git a/src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/MapObjs/Ross128.png b/src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/MapObjs/Ross128.png new file mode 100644 index 0000000000..18e7cd3b3c Binary files /dev/null and b/src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/MapObjs/Ross128.png differ diff --git a/src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/MapObjs/Ross128b.png b/src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/MapObjs/Ross128b.png new file mode 100644 index 0000000000..85b66ad2a5 Binary files /dev/null and b/src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/MapObjs/Ross128b.png differ diff --git a/src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/MapObjs/Ross128ba.png b/src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/MapObjs/Ross128ba.png new file mode 100644 index 0000000000..745d1131c3 Binary files /dev/null and b/src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/MapObjs/Ross128ba.png differ diff --git a/src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/World/SunRoss128.png b/src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/World/SunRoss128.png new file mode 100644 index 0000000000..d966674e54 Binary files /dev/null and b/src/main/resources/assets/bartworkscrossmod/galacticraft/Ross128b/World/SunRoss128.png differ -- cgit From 5e7d6c24e5c0c4d799433a73abab6388a20bdd53 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 7 Apr 2019 18:16:55 +0200 Subject: code clean up +made all asm patches disableable +removed secondary configs +added comments for config +fixed megas not working with more than one hatch Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 97c1b54ee17ec550c7cf03ddce0f5d9fd63bc688 --- build.properties | 2 +- .../com/github/bartimaeusnek/ASM/ASMUtils.java | 64 ++++ .../java/com/github/bartimaeusnek/ASM/BWCore.java | 7 - .../com/github/bartimaeusnek/ASM/BWCorePlugin.java | 27 +- .../ASM/BWCoreStaticReplacementMethodes.java | 6 +- .../bartimaeusnek/ASM/BWCoreTransformer.java | 147 ++++---- .../bartworks/API/BioObjectAdder.java | 8 +- .../bartworks/API/WerkstoffAdderRegistry.java | 8 +- .../github/bartimaeusnek/bartworks/MainMod.java | 63 ++-- .../ClientEventHandler/ClientEventHandler.java | 8 +- .../client/renderer/BW_Renderer_Block_Ores.java | 18 +- .../bartworks/common/configs/ConfigHandler.java | 9 + .../bartworks/common/items/BW_ItemBlocks.java | 4 +- .../bartworks/common/items/BW_SimpleWindMeter.java | 4 +- .../bartworks/common/items/BW_Stonage_Rotors.java | 6 +- .../bartworks/common/items/Circuit_Programmer.java | 2 +- .../common/items/GT_Destructopack_Item.java | 2 +- .../bartworks/common/items/GT_Rockcutter_Item.java | 4 +- .../bartworks/common/items/LabParts.java | 6 +- .../bartworks/common/items/SimpleSubItemClass.java | 2 +- .../bartworks/common/loaders/BioRecipeLoader.java | 5 +- .../bartworks/common/loaders/FluidLoader.java | 1 - .../bartworks/common/loaders/ItemRegistry.java | 22 +- .../bartworks/common/loaders/RecipeLoader.java | 3 +- .../bartworks/common/net/OrePacket.java | 10 +- .../BW_TileEntity_ExperimentalFloodGate.java | 33 +- .../classic/BW_TileEntity_HeatedWaterPump.java | 2 +- .../classic/BW_TileEntity_InfinityTank.java | 17 +- .../tileentities/multis/GT_TileEntity_BioVat.java | 6 +- .../multis/GT_TileEntity_CrackingDistillTower.java | 26 +- .../GT_TileEntity_ElectricImplosionCompressor.java | 92 +++-- .../tileentities/multis/GT_TileEntity_LESU.java | 4 +- .../multis/GT_TileEntity_ManualTrafo.java | 6 +- .../multis/GT_TileEntity_Windmill.java | 12 +- .../mega/GT_TileEntity_MegaBlastFurnace.java | 47 ++- .../mega/GT_TileEntity_MegaProcessingArray.java | 14 +- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 35 +- .../tiered/GT_MetaTileEntity_AcidGenerator.java | 4 +- .../tiered/GT_MetaTileEntity_BioLab.java | 10 +- .../tiered/GT_MetaTileEntity_Diode.java | 18 +- .../GT_MetaTileEntity_EnergyDistributor.java | 2 +- .../tiered/GT_MetaTileEntity_RadioHatch.java | 7 +- .../bartworks/neiHandler/BW_NEI_BioLabHandler.java | 6 +- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 25 +- .../bartworks/neiHandler/BW_NEI_OreHandler.java | 170 ++++----- .../system/material/BW_MetaGeneratedOreTE.java | 24 +- .../system/material/BW_MetaGeneratedOre_Item.java | 2 +- .../system/material/BW_MetaGenerated_Items.java | 51 ++- .../system/material/BW_MetaGenerated_Ores.java | 70 ++-- .../bartworks/system/material/Werkstoff.java | 339 +++++++++--------- .../bartworks/system/material/WerkstoffLoader.java | 396 +++++++++------------ .../bartimaeusnek/bartworks/util/BWRecipes.java | 17 +- .../bartimaeusnek/bartworks/util/BW_Util.java | 9 +- .../bartimaeusnek/bartworks/util/BioCulture.java | 29 +- .../bartimaeusnek/bartworks/util/BioData.java | 8 +- .../github/bartimaeusnek/bartworks/util/Pair.java | 8 +- .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 5 +- .../crossmod/galacticraft/GalacticraftProxy.java | 52 +-- .../galacticraft/UniversalTeleportType.java | 10 +- .../galacticraft/creativetabs/SpaceTab.java | 8 +- .../ross128/world/oregen/BW_WordGenerator.java | 9 +- .../ross128/world/oregen/BW_WorldGenRoss128.java | 100 +++--- .../world/worldprovider/ChunkProviderRoss128b.java | 56 ++- .../world/worldprovider/SkyProviderRoss128b.java | 2 +- .../world/worldprovider/WorldProviderRoss128b.java | 27 +- .../galacticraft/solarsystems/Ross128.java | 25 +- 66 files changed, 1124 insertions(+), 1097 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java diff --git a/build.properties b/build.properties index 8045287543..12d78ec78d 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=1 +buildNumber=3 APIVersion=5 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java b/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java new file mode 100644 index 0000000000..f4b61a17ba --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.ASM; + +import org.objectweb.asm.tree.MethodNode; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; + +public class ASMUtils { + + public static String matchAny(String toCompare, String... args) { + for (int i = 0; i < args.length; i++) { + if (toCompare.equalsIgnoreCase(args[i])) + return args[i]; + } + return ""; + } + + /** + * Call this Method twice, one time for the Descriptor and one time for the Name. + */ + public static boolean isCorrectMethod(MethodNode methodNode, String... args) { + for (int i = 0; i < args.length; i++) { + if (methodNode.name.equalsIgnoreCase(args[i]) || methodNode.desc.equalsIgnoreCase(args[i])) + return true; + } + return false; + } + + public static boolean writeClassToDisk(byte[] towrite, String Classname, String Path) { + try { + OutputStream os = new FileOutputStream(new File(Path + Classname + ".class")); + os.write(towrite); + } catch (IOException e) { + e.printStackTrace(); + return false; + } + return true; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java index bddf66ae5e..9c76b3dd82 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java @@ -31,7 +31,6 @@ import cpw.mods.fml.common.ModMetadata; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.versioning.ArtifactVersion; import cpw.mods.fml.common.versioning.DefaultArtifactVersion; -import net.minecraftforge.common.config.Configuration; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -55,12 +54,6 @@ public class BWCore extends DummyModContainer { @Subscribe public void preInit(FMLPreInitializationEvent event) { - Configuration asmconfighandler = new Configuration(event.getSuggestedConfigurationFile()); - for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) { - BWCoreTransformer.shouldTransform[i]=asmconfighandler.get("ASM fixes",BWCoreTransformer.DESCRIPTIONFORCONFIG[i]+" in class: "+BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i],true).getBoolean(true); - } - if (asmconfighandler.hasChanged()) - asmconfighandler.save(); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java index becd28f524..018690d312 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java @@ -22,16 +22,36 @@ package com.github.bartimaeusnek.ASM; +import cpw.mods.fml.relauncher.FMLInjectionData; import cpw.mods.fml.relauncher.IFMLLoadingPlugin; +import net.minecraftforge.common.config.Configuration; +import java.io.File; import java.util.Map; +@IFMLLoadingPlugin.SortingIndex(999999999)//Load as late as possible (after fastcraft/OptiFine). @IFMLLoadingPlugin.MCVersion("1.7.10") @IFMLLoadingPlugin.TransformerExclusions({"com.github.bartimaeusnek.ASM"}) @IFMLLoadingPlugin.Name(BWCorePlugin.BWCORE_PLUGIN_NAME) public class BWCorePlugin implements IFMLLoadingPlugin { - public static final String BWCORE_PLUGIN_NAME="BartWorks ASM Core Plugin"; + public static final String BWCORE_PLUGIN_NAME = "BartWorks ASM Core Plugin"; + + public static File minecraftDir = null; + + public BWCorePlugin() { + //Injection Code taken from CodeChickenLib + if (minecraftDir != null) + return;//get called twice, once for IFMLCallHook + minecraftDir = (File) FMLInjectionData.data()[6]; + + Configuration asmconfighandler = new Configuration(new File(new File(minecraftDir, "config"), "bartworks.cfg")); + for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) { + BWCoreTransformer.shouldTransform[i] = asmconfighandler.get("ASM fixes", BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i], true).getBoolean(true); + } + if (asmconfighandler.hasChanged()) + asmconfighandler.save(); + } @Override public String[] getASMTransformerClass() { @@ -50,10 +70,9 @@ public class BWCorePlugin implements IFMLLoadingPlugin { @Override public void injectData(Map data) { - if (data.get("runtimeDeobfuscationEnabled") != null){ - BWCoreTransformer.obfs=(boolean)data.get("runtimeDeobfuscationEnabled"); + if (data.get("runtimeDeobfuscationEnabled") != null) { + BWCoreTransformer.obfs = (boolean) data.get("runtimeDeobfuscationEnabled"); } - } @Override diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java index 0d98c72564..505612cd35 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java @@ -22,10 +22,8 @@ package com.github.bartimaeusnek.ASM; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider.WorldProviderRoss128b; -import net.minecraft.client.multiplayer.WorldClient; - public class BWCoreStaticReplacementMethodes { - private BWCoreStaticReplacementMethodes(){} + private BWCoreStaticReplacementMethodes() { + } } diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index 0a6f44712d..6a9850e4fe 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -26,7 +26,6 @@ import net.minecraft.launchwrapper.IClassTransformer; import org.apache.commons.lang3.ArrayUtils; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.*; import java.util.Arrays; @@ -35,34 +34,25 @@ import java.util.List; import static org.objectweb.asm.Opcodes.*; public class BWCoreTransformer implements IClassTransformer { - public static boolean obfs = false; public static final String[] DESCRIPTIONFORCONFIG = { "REMOVING RAIN FROM LAST MILLENIUM (EXU)", "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS" }; - public static final String[] CLASSESBEEINGTRANSFORMED = { "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", //"micdoodle8.mods.galacticraft.core.client.SkyProviderOverworld", "net.minecraft.client.renderer.RenderGlobal", }; - - public static boolean[] shouldTransform = ArrayUtils.toPrimitive(new Boolean[BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length],true); - - @Override - public byte[] transform(String name, String transformedName, byte[] basicClass) { - for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) { - if (name.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i])) - return BWCoreTransformer.transform(i,basicClass); - } - return basicClass; - } + public static boolean obfs = false; + public static boolean[] shouldTransform = ArrayUtils.toPrimitive(new Boolean[BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length], true); public static byte[] transform(int id, byte[] basicClass) { - if (!BWCoreTransformer.shouldTransform[id]) + if (!BWCoreTransformer.shouldTransform[id]) { + BWCore.BWCORE_LOG.info("Patch: " + DESCRIPTIONFORCONFIG[id] + " is disabled, will not patch!"); return basicClass; + } if (id < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length) { BWCore.BWCORE_LOG.info(DESCRIPTIONFORCONFIG[id]); @@ -72,27 +62,27 @@ public class BWCoreTransformer implements IClassTransformer { List methods = classNode.methods; switch (id) { case 0: { - BWCore.BWCORE_LOG.info("Could find: "+CLASSESBEEINGTRANSFORMED[id]); + BWCore.BWCORE_LOG.info("Could find: " + CLASSESBEEINGTRANSFORMED[id]); String name_deObfs = "canDoRainSnowIce"; String dsc_deObfs = "(Lnet/minecraft/world/chunk/Chunk;)Z"; String dsc_Obfs = "(Lapx;)Z"; for (int i = 0; i < methods.size(); i++) { if (methods.get(i).name.equalsIgnoreCase(name_deObfs)) { - BWCore.BWCORE_LOG.info("Found "+name_deObfs+"! Removing!"); + BWCore.BWCORE_LOG.info("Found " + name_deObfs + "! Removing!"); methods.remove(i); break; } } - BWCore.BWCORE_LOG.info("Creating new "+name_deObfs+"!"); - MethodNode nu = new MethodNode(Opcodes.ACC_PUBLIC, name_deObfs, + BWCore.BWCORE_LOG.info("Creating new " + name_deObfs + "!"); + MethodNode nu = new MethodNode(ACC_PUBLIC, name_deObfs, /*obfs ? dsc_Obfs :*/ dsc_deObfs, - name_deObfs+dsc_deObfs.substring(0,dsc_deObfs.length()-1), + null, new String[0] ); InsnList insnList = new InsnList(); - insnList.add(new InsnNode(Opcodes.ICONST_0)); - insnList.add(new InsnNode(Opcodes.IRETURN)); + insnList.add(new InsnNode(ICONST_0)); + insnList.add(new InsnNode(IRETURN)); nu.instructions = insnList; nu.maxLocals = 1; nu.maxStack = 1; @@ -100,18 +90,20 @@ public class BWCoreTransformer implements IClassTransformer { break; } case 1: { - BWCore.BWCORE_LOG.info("Could find: "+CLASSESBEEINGTRANSFORMED[id]); + BWCore.BWCORE_LOG.info("Could find: " + CLASSESBEEINGTRANSFORMED[id]); String name_deObfs = "getPossibleCreatures"; - String name_Obfs = "func_73155_a"; + String name_src = "func_73155_a"; + String name_Obfs = "a"; String dsc_deObfs = "(Lnet/minecraft/entity/EnumCreatureType;III)Ljava/util/List;"; String dsc_Obfs = "(Lsx;III)Ljava/util/List;"; + for (int i = 0; i < methods.size(); i++) { - if ((methods.get(i).name.equalsIgnoreCase(obfs?name_Obfs:name_deObfs) && methods.get(i).desc.equalsIgnoreCase(obfs?dsc_Obfs:dsc_deObfs))||(methods.get(i).name.equalsIgnoreCase(!obfs?name_Obfs:name_deObfs) && methods.get(i).desc.equalsIgnoreCase(!obfs?dsc_Obfs:dsc_deObfs))) { - BWCore.BWCORE_LOG.info("Found "+(name_deObfs)+"! Patching!"); + if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_deObfs, dsc_Obfs)) { + BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); MethodNode toPatch = methods.get(i); InsnList insnList = new InsnList(); - insnList.add(new InsnNode(Opcodes.ACONST_NULL)); - insnList.add(new InsnNode(Opcodes.ARETURN)); + insnList.add(new InsnNode(ACONST_NULL)); + insnList.add(new InsnNode(ARETURN)); toPatch.instructions = insnList; toPatch.maxStack = 1; toPatch.maxLocals = 5; @@ -121,92 +113,93 @@ public class BWCoreTransformer implements IClassTransformer { } break; } - case 2:{ + case 2: { String name_deObfs = "renderSky"; - String name_Obfs = "func_72714_a"; - String dsc_deObfs = "(F)V"; - BWCore.BWCORE_LOG.info("Could find: "+CLASSESBEEINGTRANSFORMED[id]); + String name_src = "func_72714_a"; + String name_Obfs = "a"; + String dsc_universal = "(F)V"; + String field_deObfs = "locationSunPng"; + String field_src = "field_110928_i"; + BWCore.BWCORE_LOG.info("Could find: " + CLASSESBEEINGTRANSFORMED[id]); for (int i = 0; i < methods.size(); i++) { MethodNode toPatch = methods.get(i); - if ((toPatch.name.equalsIgnoreCase(name_Obfs) || toPatch.name.equalsIgnoreCase(name_deObfs)) && methods.get(i).desc.equalsIgnoreCase(dsc_deObfs)) { - BWCore.BWCORE_LOG.info("Found "+(name_deObfs)+"! Patching!"); + if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal)) { + BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); InsnList nu = new InsnList(); - LabelNode[] LabelNodes = { new LabelNode(),new LabelNode()}; + LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; + + String theWorld_src = "field_72769_h"; + String renderEngine_src = "field_72770_i"; + String provider_src = "field_73011_w"; + String bindTexture_src = "func_110577_a"; + String nameFieldToPatch; + for (int j = 0; j < toPatch.instructions.size(); j++) { - if (toPatch.instructions.get(j) instanceof LineNumberNode && ((LineNumberNode) toPatch.instructions.get(j)).line == 1190) { - nu.add(toPatch.instructions.get(j)); + if (toPatch.instructions.get(j) instanceof FieldInsnNode && ((FieldInsnNode) toPatch.instructions.get(j)).getOpcode() == GETSTATIC && !(nameFieldToPatch = ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j)).name, field_deObfs, field_src)).isEmpty()) { + boolean useSrc = nameFieldToPatch.equals(field_src); + if (useSrc) + BWCore.BWCORE_LOG.info("Found either Optifine or Fastcraft... this patch was annoying to make compatible to them..."); + nu.add(new VarInsnNode(ALOAD, 0)); - nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", "theWorld", "Lnet/minecraft/client/multiplayer/WorldClient;")); - nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/multiplayer/WorldClient", "provider", "Lnet/minecraft/world/WorldProvider;")); + nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? theWorld_src : "theWorld", "Lnet/minecraft/client/multiplayer/WorldClient;")); + nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/multiplayer/WorldClient", useSrc ? provider_src : "provider", "Lnet/minecraft/world/WorldProvider;")); nu.add(new TypeInsnNode(INSTANCEOF, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b")); nu.add(new JumpInsnNode(IFEQ, LabelNodes[0])); nu.add(new VarInsnNode(ALOAD, 0)); - nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); + nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? renderEngine_src : "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); nu.add(new FieldInsnNode(GETSTATIC, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b", "sunTex", "Lnet/minecraft/util/ResourceLocation;")); - nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); + nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", useSrc ? bindTexture_src : "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); nu.add(new JumpInsnNode(GOTO, LabelNodes[1])); nu.add(LabelNodes[0]); nu.add(new VarInsnNode(ALOAD, 0)); - nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); - nu.add(new FieldInsnNode(GETSTATIC, "net/minecraft/client/renderer/RenderGlobal", "locationSunPng", "Lnet/minecraft/util/ResourceLocation;")); - nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); + nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? renderEngine_src : "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); + nu.add(new FieldInsnNode(GETSTATIC, "net/minecraft/client/renderer/RenderGlobal", useSrc ? field_src : "locationSunPng", "Lnet/minecraft/util/ResourceLocation;")); + nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", useSrc ? bindTexture_src : "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); nu.add(LabelNodes[1]); - j+=5; - -// if (toPatch.instructions.get(j) instanceof LineNumberNode && ((LineNumberNode) toPatch.instructions.get(j)).line == 308) { -// nu.add(toPatch.instructions.get(j)); -// nu.add(new VarInsnNode(ALOAD, 0)); -// nu.add(new TypeInsnNode(INSTANCEOF, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b")); -// nu.add(new JumpInsnNode(IFEQ, LabelNodes[0])); -// nu.add(new VarInsnNode(ALOAD, 0)); -// nu.add(new FieldInsnNode(GETFIELD, "micdoodle8/mods/galacticraft/core/client/SkyProviderOverworld", "minecraft", "Lnet/minecraft/client/Minecraft;")); -// nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/Minecraft", "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); -// nu.add(new FieldInsnNode(GETSTATIC, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b", "sunTex", "Lnet/minecraft/util/ResourceLocation;")); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); -// nu.add(new JumpInsnNode(GOTO, LabelNodes[1])); -// nu.add(LabelNodes[0]); -// nu.add(new VarInsnNode(ALOAD, 0)); -// nu.add(new FieldInsnNode(GETFIELD, "micdoodle8/mods/galacticraft/core/client/SkyProviderOverworld", "minecraft", "Lnet/minecraft/client/Minecraft;")); -// nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/Minecraft", "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); -// nu.add(new FieldInsnNode(GETSTATIC, "micdoodle8/mods/galacticraft/core/client/SkyProviderOverworld", "sunTexture", "Lnet/minecraft/util/ResourceLocation;")); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); -// nu.add(LabelNodes[1]); -// j+=5; + j++; + } else { + if (j < toPatch.instructions.size() - 2) { + if (toPatch.instructions.get(j + 2) instanceof FieldInsnNode && ((FieldInsnNode) toPatch.instructions.get(j + 2)).getOpcode() == GETSTATIC && !ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j + 2)).name, field_deObfs, field_src).isEmpty()) + continue; + if (toPatch.instructions.get(j + 1) instanceof FieldInsnNode && ((FieldInsnNode) toPatch.instructions.get(j + 1)).getOpcode() == GETSTATIC && !ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j + 1)).name, field_deObfs, field_src).isEmpty()) + continue; + } nu.add(toPatch.instructions.get(j)); } } - toPatch.instructions=nu; + toPatch.instructions = nu; break; } } break; } default: { - BWCore.BWCORE_LOG.info("Could not find: "+CLASSESBEEINGTRANSFORMED[id]); + BWCore.BWCORE_LOG.info("Could not find: " + CLASSESBEEINGTRANSFORMED[id]); return basicClass; } } - classNode.methods=methods; + classNode.methods = methods; ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES); classNode.accept(classWriter); byte[] ret = classWriter.toByteArray(); if (Arrays.hashCode(basicClass) == Arrays.hashCode(ret)) - BWCore.BWCORE_LOG.warn("Could not patch: "+CLASSESBEEINGTRANSFORMED[id]); -// try { -// OutputStream os = new FileOutputStream(new File("C:/test/"+CLASSESBEEINGTRANSFORMED[id]+".class")); -// os.write(classWriter.toByteArray()); -// } catch (FileNotFoundException e) { -// e.printStackTrace(); -// } catch (IOException e) { -// e.printStackTrace(); -// } + BWCore.BWCORE_LOG.warn("Could not patch: " + CLASSESBEEINGTRANSFORMED[id]); return ret; } return basicClass; } + @Override + public byte[] transform(String name, String transformedName, byte[] basicClass) { + for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) { + if (name.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i]) || transformedName.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i])) + return BWCoreTransformer.transform(i, basicClass); + } + return basicClass; + } + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java index 92600b5bfe..3dcd7596fb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -150,19 +150,19 @@ public final class BioObjectAdder { * @param voltageTier (i.e. 6 for LuV, 7 for ZPM, only intresting for LuV+) * @return the propper Bacteria Tier (at least 0) */ - public static int getBacteriaTierFromVoltageTier(int voltageTier){ - return voltageTier-6 > 0 ? voltageTier-6 : 0; + public static int getBacteriaTierFromVoltageTier(int voltageTier) { + return voltageTier - 6 > 0 ? voltageTier - 6 : 0; } /** * If you get NPE's related to BioCultures (most likely because of Load Order or creating BioCultures after the postinit Phase) execute this. */ - public static void regenerateBioFluids(){ + public static void regenerateBioFluids() { for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.getFluidNotSet()) { B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()})); if (!FluidRegistry.registerFluid(B.getFluid())) - new Exception("FAILED TO REGISTER FLUID FOR: "+B.getName()).printStackTrace(); + new Exception("FAILED TO REGISTER FLUID FOR: " + B.getName()).printStackTrace(); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java index 29c45e5074..f35d86218f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java @@ -26,17 +26,17 @@ import java.util.HashSet; public final class WerkstoffAdderRegistry implements Runnable { - private WerkstoffAdderRegistry(){} - static final WerkstoffAdderRegistry INSTANCE = new WerkstoffAdderRegistry(); + final HashSet toRun = new HashSet<>(); - final HashSet toRun= new HashSet<>(); + private WerkstoffAdderRegistry() { + } public static final WerkstoffAdderRegistry getINSTANCE() { return INSTANCE; } - public static void addWerkstoffAdder(Runnable adder){ + public static void addWerkstoffAdder(Runnable adder) { INSTANCE.toRun.add(adder); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 461d8e0f81..8bde0e73b4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -35,8 +35,10 @@ import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader; import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.cropspp.ConfigValures; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WordGenerator; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; @@ -106,7 +108,10 @@ public final class MainMod { BioCultureLoader bioCultureLoader = new BioCultureLoader(); bioCultureLoader.run(); } - WerkstoffLoader.INSTANCE.init(); + if (ConfigHandler.newStuff) { + WerkstoffLoader.INSTANCE.init(); + Werkstoff.init(); + } } @Mod.EventHandler @@ -116,7 +121,8 @@ public final class MainMod { new LoaderRegistry().run(); if (ConfigHandler.BioLab) new BioLabLoader().run(); - WerkstoffLoader.INSTANCE.runInit(); + if (ConfigHandler.newStuff) + WerkstoffLoader.INSTANCE.runInit(); } @Mod.EventHandler @@ -125,32 +131,33 @@ public final class MainMod { if (ConfigHandler.BioLab) new GTNHBlocks().run(); BioObjectAdder.regenerateBioFluids(); - new BW_WordGenerator(); - WerkstoffLoader.INSTANCE.run(); - } - - @Mod.EventHandler - public void onServerStarted(FMLServerStartedEvent event){ - eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String)null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); - for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList){ - if (recipe == null || recipe.mInputs == null) - continue; - ItemStack input = recipe.mInputs[0]; - int i = 0; - while(checkForExplosives(input)){ - try { - i++; - input = recipe.mInputs[i]; - }catch (ArrayIndexOutOfBoundsException e){ - LOGGER.error("CAUGHT DEFECTIVE IMPLOSION COMPRESSOR RECIPE."); - e.printStackTrace(); - } - } - eicMap.addRecipe(true,new ItemStack[]{input}, recipe.mOutputs,null,null,null,recipe.mDuration, BW_Util.getMachineVoltageFromTier(10),0); - } + if (ConfigHandler.newStuff) + WerkstoffLoader.INSTANCE.run(); + ConfigHandler.setUpComments(); } - private boolean checkForExplosives(ItemStack input){ - return (GT_Utility.areStacksEqual(input,new ItemStack(Blocks.tnt)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L))|| GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); - } +// @Mod.EventHandler +// public void onServerStarted(FMLServerStartedEvent event) { +// eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); +// for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList) { +// if (recipe == null || recipe.mInputs == null) +// continue; +// ItemStack input = recipe.mInputs[0]; +// int i = 0; +// while (checkForExplosives(input)) { +// try { +// i++; +// input = recipe.mInputs[i]; +// } catch (ArrayIndexOutOfBoundsException e) { +// LOGGER.error("CAUGHT DEFECTIVE IMPLOSION COMPRESSOR RECIPE."); +// e.printStackTrace(); +// } +// } +// eicMap.addRecipe(true, new ItemStack[]{input}, recipe.mOutputs, null, null, null, recipe.mDuration, BW_Util.getMachineVoltageFromTier(10), 0); +// } +// } +// +// private boolean checkForExplosives(ItemStack input) { +// return (GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L)) || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); +// } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java index 79f3cf387e..b2b152aee9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java @@ -56,13 +56,13 @@ public class ClientEventHandler { if (GLASSMAP.containsKey(PAIR)) { int tier = GLASSMAP.get(PAIR); event.toolTip.add( - StatCollector.translateToLocal("tooltip.glas.0.name")+ - " " + StatCollector.translateToLocal("tooltip.glas.0.name") + + " " + BW_Util.getColorForTier(tier) + GT_Values.VN[tier] + ChatColorHelper.RESET); } else if (BLOCK.getMaterial().equals(Material.glass)) { - event.toolTip.add(StatCollector.translateToLocal("tooltip.glas.0.name")+ + event.toolTip.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " - + BW_Util.getColorForTier(3) + GT_Values.VN[3] + ChatColorHelper.RESET); + + BW_Util.getColorForTier(3) + GT_Values.VN[3] + ChatColorHelper.RESET); } } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index 1105ae39ea..7f537b5054 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -41,43 +41,43 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { @Override public void renderInventoryBlock(Block aBlock, int aMeta, int modelId, RenderBlocks aRenderer) { BW_MetaGeneratedOreTE tTileEntity = new BW_MetaGeneratedOreTE(); - tTileEntity.mMetaData = (short)aMeta; + tTileEntity.mMetaData = (short) aMeta; aBlock.setBlockBoundsForItemRender(); aRenderer.setRenderBoundsFromBlock(aBlock); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F); - renderNegativeYFacing((IBlockAccess)null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte)0), true); + renderNegativeYFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 0), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F); - renderPositiveYFacing((IBlockAccess)null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte)1), true); + renderPositiveYFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 1), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F); - renderNegativeZFacing((IBlockAccess)null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte)2), true); + renderNegativeZFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 2), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F); - renderPositiveZFacing((IBlockAccess)null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte)3), true); + renderPositiveZFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 3), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F); - renderNegativeXFacing((IBlockAccess)null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte)4), true); + renderNegativeXFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 4), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F); - renderPositiveXFacing((IBlockAccess)null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte)5), true); + renderPositiveXFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 5), true); Tessellator.instance.draw(); aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); aRenderer.setRenderBoundsFromBlock(aBlock); GL11.glTranslatef(0.5F, 0.5F, 0.5F); -} + } @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return GT_Renderer_Block.renderStandardBlock(world,x,y,z,block,renderer); + return GT_Renderer_Block.renderStandardBlock(world, x, y, z, block, renderer); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index cf5e0aab78..1539ec80ac 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -67,4 +67,13 @@ public class ConfigHandler { } + public static void setUpComments(){ + c.addCustomCategoryComment("ASM fixes","Disable ASM fixes here."); + c.addCustomCategoryComment("Multiblocks","Multliblock Options can be set here."); + c.addCustomCategoryComment("Singleblocks","Singleblock Options can be set here."); + c.addCustomCategoryComment("System","Different System Settings can be set here."); + c.addCustomCategoryComment("CrossMod Interactions","CrossMod Interaction Settings can be set here. For Underground Fluid settings change the Gregtech.cfg!"); + c.save(); + } + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index c9286aec26..ea0457dcc6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -67,7 +67,7 @@ public class BW_ItemBlocks extends ItemBlock { @SideOnly(Side.CLIENT) public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { if (this.field_150939_a instanceof BW_GlasBlocks) - aList.add(StatCollector.translateToLocal("tooltip.glas.0.name") +" " + BW_Util.getColorForTier(BW_Util.getTierFromGlasMeta(aStack.getItemDamage())) + GT_Values.VN[BW_Util.getTierFromGlasMeta(aStack.getItemDamage())]); + aList.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + BW_Util.getColorForTier(BW_Util.getTierFromGlasMeta(aStack.getItemDamage())) + GT_Values.VN[BW_Util.getTierFromGlasMeta(aStack.getItemDamage())]); if (this.field_150939_a instanceof ITileAddsInformation) { for (int i = 0; i < ((ITileAddsInformation) this.field_150939_a).getInfoData().length; i++) { aList.add(((ITileAddsInformation) this.field_150939_a).getInfoData()[i]); @@ -77,7 +77,7 @@ public class BW_ItemBlocks extends ItemBlock { if (!(this.field_150939_a instanceof ITileEntityProvider)) aList.add(this.mNoTileEntityToolTip); - aList.add(StatCollector.translateToLocal("tooltip.bw.0.name")+ ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java index 66ff1725de..f308420d14 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java @@ -57,7 +57,7 @@ public class BW_SimpleWindMeter extends Item { public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean p_77624_4_) { super.addInformation(itemStack, entityPlayer, list, p_77624_4_); list.add(StatCollector.translateToLocal("tooltip.windmeter.0.name")); - list.add(StatCollector.translateToLocal("tooltip.windmeter.1.name")+" " + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); + list.add(StatCollector.translateToLocal("tooltip.windmeter.1.name") + " " + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); list.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } @@ -68,7 +68,7 @@ public class BW_SimpleWindMeter extends Item { float windStrength = (float) WorldData.get(world).windSim.getWindAt(entityPlayer.posY); String windS = windStrength < 1f ? StatCollector.translateToLocal("tooltip.windmeter.2.name") : windStrength < 10f ? StatCollector.translateToLocal("tooltip.windmeter.3.name") : windStrength < 20f ? StatCollector.translateToLocal("tooltip.windmeter.4.name") : windStrength < 30f ? StatCollector.translateToLocal("tooltip.windmeter.5.name") : windStrength < 50f ? StatCollector.translateToLocal("tooltip.windmeter.6.name") : StatCollector.translateToLocal("tooltip.windmeter.7.name"); - entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip.windmeter.8.name")+" " + windS + ".")); + entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip.windmeter.8.name") + " " + windS + ".")); itemStack.damageItem(1, entityPlayer); return itemStack; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index 71d9b0886f..f67a912aee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -76,9 +76,9 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { } else if (Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator) { type = WIND; } - info.add(StatCollector.translateToLocal("tooltip.rotor.0.name")+" " + this.DiaMinMax[0]); - info.add(StatCollector.translateToLocal("tooltip.rotor.1.name")+" " + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); - info.add(StatCollector.translateToLocal("tooltip.rotor.2.name")+" " + this.eff); + info.add(StatCollector.translateToLocal("tooltip.rotor.0.name") + " " + this.DiaMinMax[0]); + info.add(StatCollector.translateToLocal("tooltip.rotor.1.name") + " " + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); + info.add(StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + this.eff); if (type != null) { info.add(StatCollector.translateToLocal(("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type)))); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index 621394d199..c3491ca6f3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -54,7 +54,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); if (aStack != null && aStack.getTagCompound() != null) - aList.add(StatCollector.translateToLocal("tooltip.cp.0.name")+" " + (aStack.getTagCompound().getBoolean("HasChip") ? StatCollector.translateToLocal("tooltip.bw.yes.name") : StatCollector.translateToLocal("tooltip.bw.no.name"))); + aList.add(StatCollector.translateToLocal("tooltip.cp.0.name") + " " + (aStack.getTagCompound().getBoolean("HasChip") ? StatCollector.translateToLocal("tooltip.bw.yes.name") : StatCollector.translateToLocal("tooltip.bw.no.name"))); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java index 9d06a3e752..ea43784383 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -48,7 +48,7 @@ public class GT_Destructopack_Item extends GT_Generic_Item { @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); - aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index bcca88531f..f744be70b7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -75,8 +75,8 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { } public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { - aList.add(StatCollector.translateToLocal("tooltip.bw.tier.name") +" " + GT_Values.VN[this.mTier]); - aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(StatCollector.translateToLocal("tooltip.bw.tier.name") + " " + GT_Values.VN[this.mTier]); + aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } public void onUpdate(ItemStack aStack, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java index 4ae906c96e..c04a449103 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -103,16 +103,16 @@ public class LabParts extends SimpleSubItemClass { switch (itemStack.getItemDamage()) { case 0: - list.add(StatCollector.translateToLocal("tooltip.labparts.5.name")+" " + itemStack.getTagCompound().getString("Name")); + list.add(StatCollector.translateToLocal("tooltip.labparts.5.name") + " " + itemStack.getTagCompound().getString("Name")); if (!itemStack.getTagCompound().getBoolean("Breedable")) { list.add(StatCollector.translateToLocal("tooltip.labparts.6.name")); } break; case 1: - list.add(StatCollector.translateToLocal("tooltip.labparts.7.name")+" " + itemStack.getTagCompound().getString("Name")); + list.add(StatCollector.translateToLocal("tooltip.labparts.7.name") + " " + itemStack.getTagCompound().getString("Name")); break; case 2: - list.add(StatCollector.translateToLocal("tooltip.labparts.8.name")+" "+ itemStack.getTagCompound().getString("Name")); + list.add(StatCollector.translateToLocal("tooltip.labparts.8.name") + " " + itemStack.getTagCompound().getString("Name")); break; default: break; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java index c4abbe95b9..f5abfeecf7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -59,7 +59,7 @@ public class SimpleSubItemClass extends Item { @Override public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); - aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index 00546d6453..fab53818a7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -28,7 +28,6 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTile import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.BioCulture; import cpw.mods.fml.common.Loader; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -158,8 +157,8 @@ public class BioRecipeLoader extends RecipeLoader { Materials[] circuits = {Materials.Advanced, Materials.Data, Materials.Elite, Materials.Master, Materials.Ultimate, Materials.Superconductor}; for (int i = 3; i < GT_Values.VN.length; i++) { //12625 - BioLab[(i - 3)] = new GT_MetaTileEntity_BioLab(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i, "bw.biolab"+GT_Values.VN[i], GT_Values.VN[i] + " "+StatCollector.translateToLocal("tile.biolab.name"), i).getStackForm(1L); - RadioHatch[(i - 3)] = new GT_MetaTileEntity_RadioHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i ,"bw.radiohatch"+ GT_Values.VN[i], GT_Values.VN[i] + " "+StatCollector.translateToLocal("tile.radiohatch.name"), i).getStackForm(1L); + BioLab[(i - 3)] = new GT_MetaTileEntity_BioLab(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i, "bw.biolab" + GT_Values.VN[i], GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.biolab.name"), i).getStackForm(1L); + RadioHatch[(i - 3)] = new GT_MetaTileEntity_RadioHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i, "bw.radiohatch" + GT_Values.VN[i], GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.radiohatch.name"), i).getStackForm(1L); try { ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); GT_ModHandler.addCraftingRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 00bd28bde6..f4fc82a7db 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -26,7 +26,6 @@ import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock; import com.github.bartimaeusnek.bartworks.client.renderer.RendererSwitchingColorFluid; import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BWTileEntityDimIDBridge; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.BioCulture; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.FMLCommonHandler; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index c4b70a6a54..a12e787ada 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -73,7 +73,7 @@ public class ItemRegistry { public static final Item WINDMETER = new BW_SimpleWindMeter(); public static final Block PUMPBLOCK = new BW_TileEntityContainer(Material.anvil, BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPump"); public static final Item PUMPPARTS = new SimpleSubItemClass(new String[]{"BWrawtube", "BWmotor"}); - public static final Block EXPPUMP = new BW_TileEntityContainer(Material.coral, BW_TileEntity_ExperimentalFloodGate.class,"ExpReversePump"); + public static final Block EXPPUMP = new BW_TileEntityContainer(Material.coral, BW_TileEntity_ExperimentalFloodGate.class, "ExpReversePump"); public static final Block[] bw_glasses = { new BW_GlasBlocks( @@ -148,24 +148,24 @@ public class ItemRegistry { GameRegistry.registerBlock(PUMPBLOCK, BW_ItemBlocks.class, "BWHeatedWaterPumpBlock"); GameRegistry.registerItem(PUMPPARTS, "BWPumpParts"); GameRegistry.registerItem(WINDMETER, "BW_SimpleWindMeter"); - GameRegistry.registerTileEntity(BW_TileEntity_ExperimentalFloodGate.class,"BWExpReversePump"); - GameRegistry.registerBlock(EXPPUMP,BW_ItemBlocks.class,"BWExpReversePumpBlock"); + GameRegistry.registerTileEntity(BW_TileEntity_ExperimentalFloodGate.class, "BWExpReversePump"); + GameRegistry.registerBlock(EXPPUMP, BW_ItemBlocks.class, "BWExpReversePumpBlock"); for (int i = 0; i < GT_Values.VN.length; i++) { - ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "diode"+"2A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name")+" 2A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "diode"+"4A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name")+" 4A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.diode8A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, "diode"+"8A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name")+" 8A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.diode12A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, "diode"+"12A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name")+" 12A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.diode16A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, "diode"+"16A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name")+" 16A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.energyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset + 1 + i, "energydistributor" + GT_Values.VN[i], StatCollector.translateToLocal("tile.energydistributor.name")+ " " + GT_Values.VN[i], i).getStackForm(1L); + ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "diode" + "2A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 2A " + GT_Values.VN[i], i).getStackForm(1L); + ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "diode" + "4A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 4A " + GT_Values.VN[i], i).getStackForm(1L); + ItemRegistry.diode8A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, "diode" + "8A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 8A " + GT_Values.VN[i], i).getStackForm(1L); + ItemRegistry.diode12A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, "diode" + "12A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 12A " + GT_Values.VN[i], i).getStackForm(1L); + ItemRegistry.diode16A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, "diode" + "16A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 16A " + GT_Values.VN[i], i).getStackForm(1L); + ItemRegistry.energyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset + 1 + i, "energydistributor" + GT_Values.VN[i], StatCollector.translateToLocal("tile.energydistributor.name") + " " + GT_Values.VN[i], i).getStackForm(1L); } for (int i = 0; i < 3; i++) { - ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "acidgenerator"+GT_Values.VN[i + 2], StatCollector.translateToLocal("tile.acidgenerator.name")+" " + GT_Values.VN[i + 2], i + 2).getStackForm(1); + ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "acidgenerator" + GT_Values.VN[i + 2], StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[i + 2], i + 2).getStackForm(1); } dehp = new GT_TileEntity_DEHP(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump").getStackForm(1L); megaMachines[0] = new GT_TileEntity_MegaBlastFurnace(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, "MegaBlastFurnace", StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L); megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, "MegaVacuumFreezer", StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L); - new GT_TileEntity_ElectricImplosionCompressor( ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 4,"Electric Implosion Compressor","Electric Implosion Compressor"); +// new GT_TileEntity_ElectricImplosionCompressor(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 4, "Electric Implosion Compressor", "Electric Implosion Compressor"); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index fe2af47746..eef7b29c49 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -24,7 +24,6 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_LESU; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_Windmill; @@ -730,6 +729,6 @@ public class RecipeLoader implements Runnable { ); } - } + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java index 74f8aad3ee..36fd4dfa36 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java @@ -43,9 +43,9 @@ public class OrePacket extends GT_Packet { public OrePacket(int x, int y, int z, int meta) { super(false); this.x = x; - this.y = (short)y; + this.y = (short) y; this.z = z; - this.meta = (short)meta; + this.meta = (short) meta; } public OrePacket() { @@ -59,7 +59,7 @@ public class OrePacket extends GT_Packet { @Override public byte[] encode() { - int hash = MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(x).putInt(z).putShort(y).putShort(meta).array(),0,12,31); + int hash = MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(x).putInt(z).putShort(y).putShort(meta).array(), 0, 12, 31); return ByteBuffer.allocate(16).putInt(x).putInt(z).putShort(y).putShort(meta).putInt(hash).array(); } @@ -72,8 +72,8 @@ public class OrePacket extends GT_Packet { z = buff.getInt(); y = buff.getShort(); meta = buff.getShort(); - OrePacket todecode = new OrePacket(x,y,z,meta); - if (buff.getInt() != MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(x).putInt(z).putShort(y).putShort(meta).array(),0,12,31)) { + OrePacket todecode = new OrePacket(x, y, z, meta); + if (buff.getInt() != MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(x).putInt(z).putShort(y).putShort(meta).array(), 0, 12, 31)) { MainMod.LOGGER.error("PACKET HASH DOES NOT MATCH!"); return null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java index 86b9ed0e20..d71969e12b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java @@ -23,7 +23,6 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; -import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.util.Coords; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -36,8 +35,8 @@ import java.util.List; public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implements ITileAddsInformation { - private long ticks = 0; recursiveBelowCheck check = new recursiveBelowCheck(); + private long ticks = 0; private long noOfIts = 0; private Coords paused; @@ -47,8 +46,8 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem @Override public void updateEntity() { - if (paused == null){ - this.paused = new Coords(this.xCoord,this.yCoord,this.zCoord,this.worldObj.provider.dimensionId); + if (paused == null) { + this.paused = new Coords(this.xCoord, this.yCoord, this.zCoord, this.worldObj.provider.dimensionId); } ticks++; if (check.called != -1) { @@ -61,15 +60,15 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem check.hashset.removeAll(toRem); } } else { - noOfIts=0; + noOfIts = 0; setUpHashSet(); - this.paused=check.hashset.get(check.hashset.size()-1); + this.paused = check.hashset.get(check.hashset.size() - 1); } if (ticks % 50 == 0) ticks = 0; } - private synchronized void setUpHashSet(){ + private synchronized void setUpHashSet() { check = new recursiveBelowCheck(); Thread t = new Thread(check); t.run(); @@ -80,7 +79,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem e.printStackTrace(); } } - check.hashset.remove(new Coords(this.xCoord, this.yCoord, this.zCoord,this.worldObj.provider.dimensionId)); + check.hashset.remove(new Coords(this.xCoord, this.yCoord, this.zCoord, this.worldObj.provider.dimensionId)); } @Override @@ -90,8 +89,8 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem private class recursiveBelowCheck implements Runnable { - int called = -1; private final List hashset = new ArrayList(); + int called = -1; public int getCalled() { return this.called; @@ -145,8 +144,8 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem int wID = w.provider.dimensionId; byte sides = check_sourroundings(w, x, y, z, b); - if (((sides | 0b111110) == 0b111111) && !hashset.contains(new Coords(x, y + 1, z, wID)) && y+1 <= yCoord) { - tail=get_connected(w, x, y + 1, z, b,iterations); + if (((sides | 0b111110) == 0b111111) && !hashset.contains(new Coords(x, y + 1, z, wID)) && y + 1 <= yCoord) { + tail = get_connected(w, x, y + 1, z, b, iterations); if (tail == -1) return tail; ret++; @@ -154,7 +153,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem } if (((sides | 0b111101) == 0b111111) && !hashset.contains(new Coords(x, y - 1, z, wID))) { - tail=get_connected(w, x, y - 1, z, b,iterations); + tail = get_connected(w, x, y - 1, z, b, iterations); if (tail == -1) return tail; ret++; @@ -162,7 +161,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem } if (((sides | 0b111011) == 0b111111) && !hashset.contains(new Coords(x + 1, y, z, wID))) { - tail= get_connected(w, x + 1, y, z, b,iterations); + tail = get_connected(w, x + 1, y, z, b, iterations); if (tail == -1) return tail; ret++; @@ -170,7 +169,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem } if (((sides | 0b110111) == 0b111111) && !hashset.contains(new Coords(x - 1, y, z, wID))) { - tail= get_connected(w, x - 1, y, z, b,iterations); + tail = get_connected(w, x - 1, y, z, b, iterations); if (tail == -1) return tail; ret++; @@ -178,7 +177,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem } if (((sides | 0b101111) == 0b111111) && !hashset.contains(new Coords(x, y, z + 1, wID))) { - tail= get_connected(w, x, y, z+1, b,iterations); + tail = get_connected(w, x, y, z + 1, b, iterations); if (tail == -1) return tail; ret++; @@ -187,7 +186,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem } if (((sides | 0b011111) == 0b111111) && !hashset.contains(new Coords(x, y, z - 1, wID))) { - tail= get_connected(w, x, y, z-1, b,iterations); + tail = get_connected(w, x, y, z - 1, b, iterations); if (tail == -1) return tail; ret++; @@ -199,7 +198,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem @Override public synchronized void run() { - called=check.get_connected(worldObj, paused.x, paused.y, paused.z, Blocks.air,0); + called = check.get_connected(worldObj, paused.x, paused.y, paused.z, Blocks.air, 0); notifyAll(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index cca50bce6a..4c86a8e9b8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -268,7 +268,7 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ISidedI @Override public String[] getInfoData() { - return new String[]{StatCollector.translateToLocal("tooltip.tile.waterpump.0.name")+" " + ConfigHandler.mbWaterperSec + StatCollector.translateToLocal("tooltip.tile.waterpump.1.name"), StatCollector.translateToLocal("tooltip.tile.waterpump.2.name")}; + return new String[]{StatCollector.translateToLocal("tooltip.tile.waterpump.0.name") + " " + ConfigHandler.mbWaterperSec + StatCollector.translateToLocal("tooltip.tile.waterpump.1.name"), StatCollector.translateToLocal("tooltip.tile.waterpump.2.name")}; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java index 79ac59f5c1..989e1618b9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java @@ -35,7 +35,7 @@ import java.util.HashSet; public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank, IFluidHandler, ITileWithGUI { - final ArrayList INTERNALTANKS =new ArrayList(); + final ArrayList INTERNALTANKS = new ArrayList(); int selectedTank; @@ -46,12 +46,12 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { - return drain(from,resource != null ? resource.amount : 0,doDrain); + return drain(from, resource != null ? resource.amount : 0, doDrain); } @Override public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { - return drain(maxDrain,doDrain); + return drain(maxDrain, doDrain); } @Override @@ -78,8 +78,8 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public FluidStack getFluid() { if (INTERNALTANKS.get(selectedTank) == null || INTERNALTANKS.get(selectedTank).amount == 0) - if (selectedTank>0) - selectedTank = this.INTERNALTANKS.size()-1; + if (selectedTank > 0) + selectedTank = this.INTERNALTANKS.size() - 1; return INTERNALTANKS.get(selectedTank); } @@ -103,10 +103,9 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank lInternalTank.appendTag(entry); } } - p_145841_1_.setTag("InternalTank",lInternalTank); + p_145841_1_.setTag("InternalTank", lInternalTank); } - @Override public int getCapacity() { @@ -128,7 +127,7 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank int id = 0; - if (canDrain(null,resource.getFluid())) { + if (canDrain(null, resource.getFluid())) { for (FluidStack stack : INTERNALTANKS) if (GT_Utility.areFluidsEqual(stack, resource)) { this.INTERNALTANKS.get(id = this.INTERNALTANKS.indexOf(stack)).amount += resource.amount; @@ -136,7 +135,7 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank } } else { this.INTERNALTANKS.add(resource); - id = this.INTERNALTANKS.size()-1; + id = this.INTERNALTANKS.size() - 1; selectedTank = id; } return this.INTERNALTANKS.get(id).amount; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index f8801f25af..7042fba1b8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -600,10 +600,10 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @Override public String[] getDescription() { String[] dsc = StatCollector.translateToLocal("tooltip.tile.bvat.0.name").split(";"); - String[] fdsc = new String[dsc.length+1]; + String[] fdsc = new String[dsc.length + 1]; for (int i = 0; i < dsc.length; i++) { - fdsc[i]=dsc[i]; - fdsc[dsc.length]=StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; + fdsc[i] = dsc[i]; + fdsc[dsc.length] = StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; } return fdsc; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java index d0a242b23f..f7ac05a7f9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java @@ -45,33 +45,33 @@ public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_Distil @Override public boolean checkRecipe(ItemStack itemStack) { - if (!GT_Utility.areStacksEqual(itemStack, GT_Utility.getIntegratedCircuit(0),true)) + if (!GT_Utility.areStacksEqual(itemStack, GT_Utility.getIntegratedCircuit(0), true)) return false; - else{ + else { FluidStack[] array = new FluidStack[0]; ArrayList fluidInputs = new ArrayList(); - for (GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches){ - if (hatch != null){ + for (GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches) { + if (hatch != null) { fluidInputs.add(hatch.getFluid()); } } array = fluidInputs.toArray(array); GT_Recipe.GT_Recipe_Map rMapCracking = GT_Recipe.GT_Recipe_Map.sCrakingRecipes; GT_Recipe.GT_Recipe_Map rMapDistillTower = GT_Recipe.GT_Recipe_Map.sDistillationRecipes; - GT_Recipe recipeCracking = rMapCracking.findRecipe(this.getBaseMetaTileEntity(),false,this.getMaxInputVoltage(),array,itemStack); + GT_Recipe recipeCracking = rMapCracking.findRecipe(this.getBaseMetaTileEntity(), false, this.getMaxInputVoltage(), array, itemStack); if (recipeCracking == null) return false; - GT_Recipe recipeDistill = rMapDistillTower.findRecipe(this.getBaseMetaTileEntity(),false,this.getMaxInputVoltage(),recipeCracking.mFluidOutputs); + GT_Recipe recipeDistill = rMapDistillTower.findRecipe(this.getBaseMetaTileEntity(), false, this.getMaxInputVoltage(), recipeCracking.mFluidOutputs); if (recipeDistill == null) return false; - float ratio = (float)recipeCracking.mFluidOutputs[0].amount/(float)recipeDistill.mFluidInputs[0].amount; + float ratio = (float) recipeCracking.mFluidOutputs[0].amount / (float) recipeDistill.mFluidInputs[0].amount; FluidStack[] nuoutputs = new FluidStack[recipeDistill.mFluidOutputs.length]; for (int i = 0; i < nuoutputs.length; i++) { - nuoutputs[i]=recipeDistill.mFluidOutputs[i]; - nuoutputs[i].amount=(int)(Math.floor(recipeDistill.mFluidOutputs[i].amount*ratio)); + nuoutputs[i] = recipeDistill.mFluidOutputs[i]; + nuoutputs[i].amount = (int) (Math.floor(recipeDistill.mFluidOutputs[i].amount * ratio)); } - BWRecipes.DynamicGTRecipe combined = new BWRecipes.DynamicGTRecipe(true,null,recipeDistill.mOutputs,null,recipeDistill.mChances,recipeCracking.mFluidInputs,nuoutputs,(int)(Math.floor(recipeDistill.mDuration*ratio))+recipeCracking.mDuration,Math.max((int)(Math.floor(recipeDistill.mEUt*ratio)),recipeCracking.mEUt),0); - if (combined.isRecipeInputEqual(true, array)){ + BWRecipes.DynamicGTRecipe combined = new BWRecipes.DynamicGTRecipe(true, null, recipeDistill.mOutputs, null, recipeDistill.mChances, recipeCracking.mFluidInputs, nuoutputs, (int) (Math.floor(recipeDistill.mDuration * ratio)) + recipeCracking.mDuration, Math.max((int) (Math.floor(recipeDistill.mEUt * ratio)), recipeCracking.mEUt), 0); + if (combined.isRecipeInputEqual(true, array)) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; BW_Util.calculateOverclockedNessMulti(combined.mEUt, combined.mDuration, 1, this.getMaxInputVoltage(), this); @@ -81,8 +81,8 @@ public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_Distil this.mEUt = (-this.mEUt); } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputFluids=combined.mFluidOutputs.clone(); - this.mOutputItems=combined.mOutputs.clone(); + this.mOutputFluids = combined.mFluidOutputs.clone(); + this.mOutputItems = combined.mOutputs.clone(); this.updateSlots(); return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 2c326887ed..74efa145e5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -23,29 +23,25 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.common.GT_Pollution; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ImplosionCompressor; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; -import java.util.Iterator; import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity_ImplosionCompressor { + public static GT_Recipe.GT_Recipe_Map eicMap; private boolean piston; public GT_TileEntity_ElectricImplosionCompressor(int aID, String aName, String aNameRegional) { @@ -56,21 +52,19 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity super(aName); } - public static GT_Recipe.GT_Recipe_Map eicMap; - @Override public boolean checkRecipe(ItemStack aStack) { - if (this.mEnergyHatches.get(0).getEUVar() <= 0 || this.mEnergyHatches.get(1).getEUVar() <= 0 ) + if (this.mEnergyHatches.get(0).getEUVar() <= 0 || this.mEnergyHatches.get(1).getEUVar() <= 0) return false; ArrayList tInputList = this.getStoredInputs(); int tInputList_sS = tInputList.size(); - for(int i = 0; i < tInputList_sS - 1; ++i) { - for(int j = i + 1; j < tInputList_sS; ++j) { - if (GT_Utility.areStacksEqual((ItemStack)tInputList.get(i), (ItemStack)tInputList.get(j))) { - if (((ItemStack)tInputList.get(i)).stackSize < ((ItemStack)tInputList.get(j)).stackSize) { + for (int i = 0; i < tInputList_sS - 1; ++i) { + for (int j = i + 1; j < tInputList_sS; ++j) { + if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) { + if (((ItemStack) tInputList.get(i)).stackSize < ((ItemStack) tInputList.get(j)).stackSize) { tInputList.remove(i--); tInputList_sS = tInputList.size(); break; @@ -82,16 +76,16 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } } - ItemStack[] tInputs = (ItemStack[])tInputList.toArray(new ItemStack[tInputList.size()]); + ItemStack[] tInputs = (ItemStack[]) tInputList.toArray(new ItemStack[tInputList.size()]); if (tInputList.size() > 0) { - GT_Recipe tRecipe = eicMap.findRecipe(this.getBaseMetaTileEntity(), false, 9223372036854775807L, (FluidStack[])null, tInputs); - if (tRecipe != null && tRecipe.isRecipeInputEqual(true, (FluidStack[])null, tInputs)) { + GT_Recipe tRecipe = eicMap.findRecipe(this.getBaseMetaTileEntity(), false, 9223372036854775807L, (FluidStack[]) null, tInputs); + if (tRecipe != null && tRecipe.isRecipeInputEqual(true, (FluidStack[]) null, tInputs)) { this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; this.mEfficiencyIncrease = 10000; this.mEUt = -tRecipe.mEUt; this.mMaxProgresstime = Math.max(1, tRecipe.mDuration); this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; - this.sendLoopStart((byte)20); + this.sendLoopStart((byte) 20); this.updateSlots(); return true; } @@ -107,7 +101,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity return super.onRunningTick(aStack); } - public void stopMachine(){ + public void stopMachine() { resetPiston(); super.stopMachine(); } @@ -117,13 +111,13 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity piston = true; } - private void resetPiston(){ + private void resetPiston() { if (this.getBaseMetaTileEntity().getWorld().isRemote) return; - if (!piston){ + if (!piston) { int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; - int aX = this.getBaseMetaTileEntity().getXCoord(),aY = this.getBaseMetaTileEntity().getYCoord() ,aZ = this.getBaseMetaTileEntity().getZCoord(); + int aX = this.getBaseMetaTileEntity().getXCoord(), aY = this.getBaseMetaTileEntity().getYCoord(), aZ = this.getBaseMetaTileEntity().getZCoord(); for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) @@ -134,34 +128,35 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity piston = !piston; } } + private void togglePiston() { if (this.getBaseMetaTileEntity().getWorld().isRemote) return; int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; - int aX = this.getBaseMetaTileEntity().getXCoord(),aY = this.getBaseMetaTileEntity().getYCoord() ,aZ = this.getBaseMetaTileEntity().getZCoord(); + int aX = this.getBaseMetaTileEntity().getXCoord(), aY = this.getBaseMetaTileEntity().getYCoord(), aZ = this.getBaseMetaTileEntity().getZCoord(); boolean hax = false; - if(piston){ + if (piston) { for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) { - if (this.getBaseMetaTileEntity().getBlock(xDir+aX+x,aY+2,zDir+aZ+z) != GregTech_API.sBlockMetal5 && this.getBaseMetaTileEntity().getMetaID(xDir+aX+x,aY+2,zDir+aZ+z) != 2 ) { + if (this.getBaseMetaTileEntity().getBlock(xDir + aX + x, aY + 2, zDir + aZ + z) != GregTech_API.sBlockMetal5 && this.getBaseMetaTileEntity().getMetaID(xDir + aX + x, aY + 2, zDir + aZ + z) != 2) { hax = true; } this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + aX + x, aY + 2, zDir + aZ + z); } } } - GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); - piston=!piston; + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + piston = !piston; } else { for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) - this.getBaseMetaTileEntity().getWorld().setBlock(xDir+aX+x,aY+2,zDir+aZ+z,GregTech_API.sBlockMetal5,2,3); + this.getBaseMetaTileEntity().getWorld().setBlock(xDir + aX + x, aY + 2, zDir + aZ + z, GregTech_API.sBlockMetal5, 2, 3); } } - GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); piston = !piston; } if (hax) @@ -170,13 +165,13 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity @Override public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setBoolean("piston",piston); + aNBT.setBoolean("piston", piston); super.saveNBTData(aNBT); } @Override public void loadNBTData(NBTTagCompound aNBT) { - piston=aNBT.getBoolean("piston"); + piston = aNBT.getBoolean("piston"); super.loadNBTData(aNBT); } @@ -188,18 +183,17 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity for (int x = -1; x <= 1; x++) { for (int y = -2; y < 7; y++) { for (int z = -1; z <= 1; z++) { - IGregTechTileEntity te = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir+x,y,z+zDir); + IGregTechTileEntity te = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, z + zDir); if (y == -2 || y == 6) { if (!(x == 0 && z == 0)) { if (!this.addMaintenanceToMachineList(te, 16) && !this.addMufflerToMachineList(te, 16) && !this.addInputToMachineList(te, 16) && !this.addOutputToMachineList(te, 16)) { - Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z); - byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); - if ((tBlock != GregTech_API.sBlockCasings2 || tMeta != 0) && (tBlock != GregTech_API.sBlockCasings3 || tMeta != 4)) { - return false; - } + Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z); + byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); + if ((tBlock != GregTech_API.sBlockCasings2 || tMeta != 0) && (tBlock != GregTech_API.sBlockCasings3 || tMeta != 4)) { + return false; } - } - else if (x == 0 && z == 0) { + } + } else if (x == 0 && z == 0) { if (y == -2) if (!this.addEnergyInputToMachineList(te, 16)) return false; @@ -207,36 +201,32 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity if (!this.addEnergyInputToMachineList(te, 16)) return false; } - } - else if ((y > -2 && y < 1) || (y > 3 && y < 6)){ - if (y == 0 && xDir+x == 0 && zDir+z==0) + } else if ((y > -2 && y < 1) || (y > 3 && y < 6)) { + if (y == 0 && xDir + x == 0 && zDir + z == 0) continue; Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z); byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); if (x == 0 && z == 0) { if (tBlock != BW_BLOCKS[2] || tMeta != 0) return false; - }else{ + } else { if (tBlock != BW_BLOCKS[2] || tMeta != 1) return false; } - } - else if (y == 1) { - if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 1, zDir + z),1,aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + } else if (y == 1) { + if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 1, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) return false; - } - else if (y == 2) { + } else if (y == 2) { if (!piston) { if (Math.abs(x) == 1 && Math.abs(z) == 1) { - if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z),1,aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) return false; } - }else if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z),1,aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + } else if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) return false; - } - else if (y == 3) { - if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 3, zDir + z),1,aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + } else if (y == 3) { + if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 3, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) return false; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index c3aabbd0da..42eeada394 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -160,12 +160,12 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { for (int i = 0; i < dsc.length; i++) { e.add(dsc[i]); } - e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name")+" " + ConfigHandler.energyPerCell + "EU"); + e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + ConfigHandler.energyPerCell + "EU"); dsc = StatCollector.translateToLocal("tooltip.tile.lesu.2.name").split(";"); for (int i = 0; i < dsc.length; i++) { e.add(dsc[i]); } - e.add(ChatColorHelper.RED +StatCollector.translateToLocal("tooltip.tile.lesu.3.name")); + e.add(ChatColorHelper.RED + StatCollector.translateToLocal("tooltip.tile.lesu.3.name")); e.add(StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"); return e.toArray(new String[0]); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index 0cf9d1f2df..c403d990d6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -382,10 +382,10 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase @Override public String[] getDescription() { String[] dsc = StatCollector.translateToLocal("tooltip.tile.manualtravo.0.name").split(";"); - String[] fdsc = new String[dsc.length+1]; + String[] fdsc = new String[dsc.length + 1]; for (int i = 0; i < dsc.length; i++) { - fdsc[i]=dsc[i]; - fdsc[dsc.length]=StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; + fdsc[i] = dsc[i]; + fdsc[dsc.length] = StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; } return fdsc; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index a7d4ce12ba..5cd012821c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -114,11 +114,11 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { if (new XSTR().nextInt(2) == 0) { if (tRecipe.getOutput(1) != null) mOutputItems[1] = tRecipe.getOutput(1); - else if( !BW_Util.checkStackAndPrefix(mOutputItems[0]) || + else if (!BW_Util.checkStackAndPrefix(mOutputItems[0]) || !( BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL)|| - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTALLISABLE) + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL) || + BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTALLISABLE) ) || BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Flint || @@ -563,10 +563,10 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @Override public String[] getDescription() { String[] dsc = StatCollector.translateToLocal("tooltip.tile.windmill.0.name").split(";"); - String[] fdsc = new String[dsc.length+1]; + String[] fdsc = new String[dsc.length + 1]; for (int i = 0; i < dsc.length; i++) { - fdsc[i]=dsc[i]; - fdsc[dsc.length]=StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; + fdsc[i] = dsc[i]; + fdsc[dsc.length] = StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; } return fdsc; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 97e7bb9fac..b74b826da5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -31,7 +31,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; @@ -41,7 +40,9 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import java.util.*; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; import static gregtech.api.enums.GT_Values.V; @@ -61,16 +62,38 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl public String[] getDescription() { String[] dsc = StatCollector.translateToLocal("tooltip.tile.mbf.0.name").split(";"); - String tmp = dsc[dsc.length-1]; - dsc[dsc.length-1]=tmp+" "+Integer.toString(20 * this.getPollutionPerTick((ItemStack) null))+" "+StatCollector.translateToLocal("tooltip.tile.mbf.1.name"); - String[] fdsc = new String[dsc.length+1]; + String tmp = dsc[dsc.length - 1]; + dsc[dsc.length - 1] = tmp + " " + Integer.toString(20 * this.getPollutionPerTick((ItemStack) null)) + " " + StatCollector.translateToLocal("tooltip.tile.mbf.1.name"); + String[] fdsc = new String[dsc.length + 1]; for (int i = 0; i < dsc.length; i++) { - fdsc[i]=dsc[i]; - fdsc[dsc.length]=StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; + fdsc[i] = dsc[i]; + fdsc[dsc.length] = StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; } return fdsc; } + public boolean drainEnergyInput(long aEU) { + if (aEU <= 0) + return true; + long allTheEu = 0; + int hatches = 0; + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) + if (isValidMetaTileEntity(tHatch)) { + allTheEu += tHatch.getEUVar(); + hatches++; + } + if (allTheEu < aEU) + return false; + long euperhatch = aEU / hatches; + HashSet returnset = new HashSet<>(); + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) + if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false)) + returnset.add(true); + else + returnset.add(false); + return returnset.size() > 0 && !returnset.contains(false); + } + @Override public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = (ItemStack[]) this.getStoredInputs().toArray(new ItemStack[0]); @@ -90,10 +113,10 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl long nominalV = BW_Util.getnominalVoltage(this); int tHeatCapacityDivTiers = (mHeatingCapacity - tRecipe.mSpecialValue) / 900; - long precutRecipeVoltage = (long) (tRecipe.mEUt*Math.pow(0.95, tHeatCapacityDivTiers)); + long precutRecipeVoltage = (long) (tRecipe.mEUt * Math.pow(0.95, tHeatCapacityDivTiers)); while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { - if (this.mHeatingCapacity >= tRecipe.mSpecialValue && (precutRecipeVoltage*(processed+1)) < nominalV && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { + if (this.mHeatingCapacity >= tRecipe.mSpecialValue && (precutRecipeVoltage * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { found_Recipe = true; for (int i = 0; i < tRecipe.mOutputs.length; i++) { outputItems.add(tRecipe.getOutput(i)); @@ -118,9 +141,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl actualEUT = actualEUT / 2; divider++; } - overclockCount = calculateOverclockednessEBF((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), tVoltage); + overclockCount = calculateOverclockednessEBF((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), nominalV); } else - overclockCount = calculateOverclockednessEBF(actualEUT, tRecipe.mDuration, tVoltage); + overclockCount = calculateOverclockednessEBF(actualEUT, tRecipe.mDuration, nominalV); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; @@ -129,7 +152,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl } if (tHeatCapacityDivTiers > 0) { this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); - this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount);//extra free overclocking if possible + this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount); //extra free overclocking if possible if (this.mMaxProgresstime < 1) this.mMaxProgresstime = 1;//no eu efficiency correction } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java index 414b7b3122..56b9197a2d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java @@ -39,6 +39,11 @@ import java.util.List; import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.isValidForLowGravity; public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_ProcessingArray { + private GT_Recipe mLastRecipe; + private int tTier = 0; + private int mMult = 0; + private String mMachine = ""; + private GT_MetaTileEntity_Hatch_InputBus machineBus; public GT_TileEntity_MegaProcessingArray(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -47,13 +52,6 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process super(aName); } - private GT_Recipe mLastRecipe; - private int tTier = 0; - private int mMult = 0; - private String mMachine = ""; - - private GT_MetaTileEntity_Hatch_InputBus machineBus; - public boolean checkRecipe(ItemStack aStack) { if (!isCorrectMachinePart(machineBus.mInventory[0])) { return false; @@ -138,7 +136,7 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process this.mMaxProgresstime = tRecipe.mDuration; this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - BW_Util.calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, map.mAmperage, GT_Values.V[tTier],this); + BW_Util.calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, map.mAmperage, GT_Values.V[tTier], this); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 14af3300a9..a2227eb7a4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_VacuumFreezer; @@ -52,10 +53,10 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre public String[] getDescription() { String[] dsc = StatCollector.translateToLocal("tooltip.tile.mvf.0.name").split(";"); - String[] fdsc = new String[dsc.length+1]; + String[] fdsc = new String[dsc.length + 1]; for (int i = 0; i < dsc.length; i++) { - fdsc[i]=dsc[i]; - fdsc[dsc.length]=StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; + fdsc[i] = dsc[i]; + fdsc[dsc.length] = StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; } return fdsc; } @@ -65,6 +66,28 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre return new GT_TileEntity_MegaVacuumFreezer(this.mName); } + public boolean drainEnergyInput(long aEU) { + if (aEU <= 0) + return true; + long allTheEu = 0; + int hatches = 0; + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) + if (isValidMetaTileEntity(tHatch)) { + allTheEu += tHatch.getEUVar(); + hatches++; + } + if (allTheEu < aEU) + return false; + long euperhatch = aEU / hatches; + HashSet returnset = new HashSet<>(); + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) + if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false)) + returnset.add(true); + else + returnset.add(false); + return returnset.size() > 0 && !returnset.contains(false); + } + @Override public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = (ItemStack[]) this.getStoredInputs().toArray(new ItemStack[0]); @@ -78,7 +101,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre int processed = 0; long nominalV = BW_Util.getnominalVoltage(this); while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { - if (tRecipe != null && (tRecipe.mEUt*(processed+1)) < nominalV && tRecipe.isRecipeInputEqual(true, null, tInputs)) { + if (tRecipe != null && (tRecipe.mEUt * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, null, tInputs)) { found_Recipe = true; for (int i = 0; i < tRecipe.mOutputs.length; i++) { outputItems.add(tRecipe.getOutput(i)); @@ -98,9 +121,9 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre actualEUT = actualEUT / 2; divider++; } - BW_Util.calculateOverclockedNessMulti((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), 1, this.getMaxInputVoltage(), this); + BW_Util.calculateOverclockedNessMulti((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), 1, nominalV, this); } else - BW_Util.calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, this.getMaxInputVoltage(), this); + BW_Util.calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, nominalV, this); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index d749ce3c54..e138445f01 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -36,7 +36,7 @@ import net.minecraft.util.StatCollector; public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGenerator { - public GT_MetaTileEntity_AcidGenerator(int aID, String aName, String aNameRegional, int aTier, ITexture... aTextures) { + public GT_MetaTileEntity_AcidGenerator(int aID, String aName, String aNameRegional, int aTier, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, new String[]{}, aTextures); } @@ -110,6 +110,6 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name")+" "+ ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.rotor.2.name")+" "+ ChatColorHelper.YELLOW + getEfficiency(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name")+" "+ ChatColorHelper.YELLOW + maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; + return new String[]{StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + ChatColorHelper.YELLOW + getEfficiency(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index 1fd3cfcfd6..e26b50cdd1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -194,9 +194,9 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { case 3: { if ( GT_Utility.isStackValid(this.mInventory[4]) && GT_Utility.areStacksEqual(this.mInventory[4], BioItemList.getPetriDish(null), true) && this.mInventory[4].getTagCompound() != null && - GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getPlasmidCell(null), true) && this.mInventory[5].getTagCompound() != null && - GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], FluidLoader.BioLabFluidCells[2]) && - this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000) { + GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getPlasmidCell(null), true) && this.mInventory[5].getTagCompound() != null && + GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], FluidLoader.BioLabFluidCells[2]) && + this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000) { BioData cultureDNABioData = BioData.getBioDataFromNBTTag(this.mInventory[5].getTagCompound()); BioCulture bioCulture = BioCulture.getBioCultureFromNBTTag(this.mInventory[4].getTagCompound()); if (cultureDNABioData == null || bioCulture == null) @@ -257,7 +257,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { return super.checkRecipe(skipOC); } - private BioCulture checkForExisting(BioCulture culture){ + private BioCulture checkForExisting(BioCulture culture) { if (culture == null) return null; for (BioCulture bc : BioCulture.BIO_CULTURE_ARRAY_LIST) @@ -269,6 +269,6 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { @Override @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{ StatCollector.translateToLocal("tooltip.tile.biolab.0.name"), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; + return new String[]{StatCollector.translateToLocal("tooltip.tile.biolab.0.name"), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index b85e1137fe..e3a1da3966 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -42,7 +42,7 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { public GT_MetaTileEntity_Diode(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, StatCollector.translateToLocal("tooltip.tile.diode.0.name")); maxAmps = getAmpsfromMeta(aID); - aAmps=maxAmps; + aAmps = maxAmps; } public GT_MetaTileEntity_Diode(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { @@ -54,7 +54,7 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { super.onFirstTick(aBaseMetaTileEntity); if (maxAmps == 0 && !this.getBaseMetaTileEntity().getWorld().isRemote) { maxAmps = getAmpsfromMeta(this.getBaseMetaTileEntity().getMetaTileID()); - aAmps=maxAmps; + aAmps = maxAmps; } } @@ -100,16 +100,16 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { return new GT_MetaTileEntity_Diode(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } - private long getAmpsfromMeta(int meta){ - if (meta > ConfigHandler.IDOffset + GT_Values.VN.length && meta <= ConfigHandler.IDOffset + GT_Values.VN.length*2) + private long getAmpsfromMeta(int meta) { + if (meta > ConfigHandler.IDOffset + GT_Values.VN.length && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 2) return 2L; - else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length*2 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length*3) + else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 2 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 3) return 4L; - else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length*3 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length*4) + else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 3 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 4) return 8L; - else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length*4 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length*5) + else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 4 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 5) return 12L; - else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length*5 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length*6) + else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 5 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 6) return 16L; else return 0L; @@ -117,6 +117,6 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{mDescription, StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name")+ " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") +" " + ChatColorHelper.YELLOW + maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; + return new String[]{mDescription, StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java index 25fad9103e..8c4c13d171 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java @@ -71,7 +71,7 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name")+ " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name")+ " " + ChatColorHelper.YELLOW + this.maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name")+ " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; + return new String[]{StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 6ee28527c4..479681d492 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -58,7 +58,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { private byte coverage = 0; public GT_MetaTileEntity_RadioHatch(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name")+" " + (aTier - 2) + " " + ((aTier - 2) >= 2 ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") : StatCollector.translateToLocal("tooltip.bw.kg.0.name")), StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}); + super(aID, aName, aNameRegional, aTier, 1, new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name") + " " + (aTier - 2) + " " + ((aTier - 2) >= 2 ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") : StatCollector.translateToLocal("tooltip.bw.kg.0.name")), StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}); cap = aTier - 2; } @@ -253,8 +253,9 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @Override public String[] getInfoData() { if (calcDecayTicks(this.sievert) != 0) - return new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.2.name")+" "+ material, StatCollector.translateToLocal("tooltip.tile.radhatch.3.name")+" "+ sievert, StatCollector.translateToLocal("tooltip.tile.radhatch.4.name")+" "+mass, StatCollector.translateToLocal("tooltip.tile.radhatch.5.name")+" "+ + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert) * 60)) + StatCollector.translateToLocal("tooltip.tile.radhatch.6.name")+"/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 + StatCollector.translateToLocal("tooltip.tile.radhatch.7.name")+"/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.8.name")+"/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.9.name")}; - else return new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.2.name")+" "+StatCollector.translateToLocal("tooltip.bw.empty.name"), StatCollector.translateToLocal("tooltip.tile.radhatch.3.name")+" "+"0", StatCollector.translateToLocal("tooltip.tile.radhatch.4.name")+" "+"0"}; + return new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + material, StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + sievert, StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + mass, StatCollector.translateToLocal("tooltip.tile.radhatch.5.name") + " " + +((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert) * 60)) + StatCollector.translateToLocal("tooltip.tile.radhatch.6.name") + "/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 + StatCollector.translateToLocal("tooltip.tile.radhatch.7.name") + "/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.8.name") + "/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.9.name")}; + else + return new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + StatCollector.translateToLocal("tooltip.bw.empty.name"), StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + "0", StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + "0"}; } public boolean isSimpleMachine() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java index b0b1fe61df..8590f1f713 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java @@ -62,8 +62,7 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { } } - } - else + } else super.loadCraftingRecipes(aResult); } @@ -81,8 +80,7 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { } } - } - else + } else super.loadCraftingRecipes(aResult); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index dda5661c69..4cf03fb000 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -56,17 +56,17 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { public void drawExtras(int aRecipeIndex) { int base = 70; - int[] lines ={ base,base+8,base+16,base+24,base+32,base+40,base+48,base+56,base+64}; - int tEUt = ((GT_NEI_DefaultHandler.CachedDefaultRecipe)this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - int tDuration = ((GT_NEI_DefaultHandler.CachedDefaultRecipe)this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - String[] recipeDesc = ((GT_NEI_DefaultHandler.CachedDefaultRecipe)this.arecipes.get(aRecipeIndex)).mRecipe.getNeiDesc(); + int[] lines = {base, base + 8, base + 16, base + 24, base + 32, base + 40, base + 48, base + 56, base + 64}; + int tEUt = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; + int tDuration = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; + String[] recipeDesc = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.getNeiDesc(); int tSpecial; if (recipeDesc == null) { if (tEUt != 0) { - drawText(10, lines[0], this.trans("152", "Total: ") + (long)tDuration * (long)tEUt + " EU", -16777216); + drawText(10, lines[0], this.trans("152", "Total: ") + (long) tDuration * (long) tEUt + " EU", -16777216); drawText(10, lines[1], this.trans("153", "Usage: ") + tEUt + " EU/t", -16777216); if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10,lines[2], this.trans("154", "Voltage: ") + tEUt / this.mRecipeMap.mAmperage + " EU", -16777216); + drawText(10, lines[2], this.trans("154", "Voltage: ") + tEUt / this.mRecipeMap.mAmperage + " EU", -16777216); drawText(10, lines[3], this.trans("155", "Amperage: ") + this.mRecipeMap.mAmperage, -16777216); } else { drawText(10, lines[2], this.trans("156", "Voltage: unspecified"), -16777216); @@ -75,16 +75,15 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { } - if (tDuration > 0) { - drawText(10, lines[4], this.trans("158", "Time: ") + String.format("%.2f " + this.trans("161", " secs"), 0.05F * (float)tDuration), -16777216); + drawText(10, lines[4], this.trans("158", "Time: ") + String.format("%.2f " + this.trans("161", " secs"), 0.05F * (float) tDuration), -16777216); } - tSpecial = ((GT_NEI_DefaultHandler.CachedDefaultRecipe)this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; + tSpecial = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; int[] tSpecialA = GT_TileEntity_BioVat.specialValueUnpack(tSpecial); - drawText(10, lines[5], StatCollector.translateToLocal("nei.biovat.0.name")+" " + tSpecialA[0],-16777216); + drawText(10, lines[5], StatCollector.translateToLocal("nei.biovat.0.name") + " " + tSpecialA[0], -16777216); if (tSpecialA[1] == -100 && GT_Mod.gregtechproxy.mLowGravProcessing) { drawText(10, lines[7], this.trans("159", "Needs Low Gravity"), -16777216); @@ -95,14 +94,14 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { } else if (tSpecialA[1] == -400) { drawText(10, lines[7], this.trans("216", "Deprecated Recipe"), -16777216); } else if (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre) || GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost)) { - drawText(10, lines[6],(tSpecialA[2] == 1 ? StatCollector.translateToLocal("nei.biovat.1.name"): StatCollector.translateToLocal("nei.biovat.2.name")) + this.mRecipeMap.mNEISpecialValuePre + tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier + this.mRecipeMap.mNEISpecialValuePost, -16777216); + drawText(10, lines[6], (tSpecialA[2] == 1 ? StatCollector.translateToLocal("nei.biovat.1.name") : StatCollector.translateToLocal("nei.biovat.2.name")) + this.mRecipeMap.mNEISpecialValuePre + tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier + this.mRecipeMap.mNEISpecialValuePost, -16777216); } } else { tSpecial = 0; String[] var6 = recipeDesc; int var7 = recipeDesc.length; - for(int var8 = 0; var8 < var7; ++var8) { + for (int var8 = 0; var8 < var7; ++var8) { String descLine = var6[var8]; drawText(10, 73 + 10 * tSpecial, descLine, -16777216); ++tSpecial; @@ -127,7 +126,7 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { @Override public void loadCraftingRecipes(ItemStack aResult) { - if (aResult == null || !(aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 )) { + if (aResult == null || !(aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3)) { super.loadCraftingRecipes(aResult); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index 1c76a84a05..38104bf7f2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -45,7 +45,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public BW_NEI_OreHandler() { if (!NEI_BW_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(MainMod.MOD_ID, "NEIPlugins", "register-crafting-handler", MainMod.MOD_ID+"@" + getRecipeName() + "@" + getOverlayIdentifier()); + FMLInterModComms.sendRuntimeMessage(MainMod.MOD_ID, "NEIPlugins", "register-crafting-handler", MainMod.MOD_ID + "@" + getRecipeName() + "@" + getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); // GuiUsageRecipe.usagehandlers.add(this); } @@ -53,7 +53,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void drawBackground(int recipe) { - GuiDraw.drawRect(0,0,166, 65,0x888888); + GuiDraw.drawRect(0, 0, 166, 65, 0x888888); } @Override @@ -63,97 +63,97 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void loadCraftingRecipes(String outputId, Object... results) { - if (outputId.equalsIgnoreCase("quickanddirtyneihandler")){ - for (int i = 0; i < Werkstoff.werkstoffHashMap.values().size(); i++) { - ItemStack result = new ItemStack(WerkstoffLoader.BWOres,1,i); - if (Block.getBlockFromItem(result.getItem()) instanceof BW_MetaGenerated_Ores){ - CachedRecipe tmp = new CachedRecipe() { - - PositionedStack stack = new PositionedStack(result, 0, 0); - - @Override - public PositionedStack getResult() { - return stack; - } - - @Override - public List getOtherStacks() { - ArrayList ret = new ArrayList<>(); - for (int i = 0; i < GT_Worldgen_GT_Ore_Layer.sList.size(); i++) { - if (BW_WorldGenRoss128.sList.get(i) instanceof BW_WorldGenRoss128) { - int baseMeta = result.getItemDamage(); - BW_WorldGenRoss128 worldGen = ((BW_WorldGenRoss128) BW_WorldGenRoss128.sList.get(i)); - if (worldGen.mPrimaryMeta == baseMeta || worldGen.mSecondaryMeta == baseMeta || worldGen.mBetweenMeta == baseMeta || worldGen.mSporadicMeta == baseMeta) { - ItemStack other; - other=result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore","Vein")); - stack = new PositionedStack(other, 83, 0); - if (((worldGen.bwOres & 0b1000) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mPrimaryMeta); - ret.add(new PositionedStack(other, 0, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mPrimaryMeta); - ret.add(new PositionedStack(other, 0, 12)); - } - if (((worldGen.bwOres & 0b0100) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mSecondaryMeta); - ret.add(new PositionedStack(other, 20, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mSecondaryMeta); - ret.add(new PositionedStack(other, 20, 12)); - } - if (((worldGen.bwOres & 0b0010) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mBetweenMeta); - ret.add(new PositionedStack(other, 40, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mBetweenMeta); - ret.add(new PositionedStack(other, 40, 12)); - } - if (((worldGen.bwOres & 0b0001) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mSporadicMeta); - ret.add(new PositionedStack(other, 60, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mSporadicMeta); - ret.add(new PositionedStack(other, 60, 12)); - } - break; - } - } - } - return ret; - } - }; - this.arecipes.add(tmp); - } - } - } else super.loadCraftingRecipes(outputId, results); + if (outputId.equalsIgnoreCase("quickanddirtyneihandler")) { + for (int i = 0; i < Werkstoff.werkstoffHashMap.values().size(); i++) { + ItemStack result = new ItemStack(WerkstoffLoader.BWOres, 1, i); + if (Block.getBlockFromItem(result.getItem()) instanceof BW_MetaGenerated_Ores) { + CachedRecipe tmp = new CachedRecipe() { + + PositionedStack stack = new PositionedStack(result, 0, 0); + + @Override + public PositionedStack getResult() { + return stack; + } + + @Override + public List getOtherStacks() { + ArrayList ret = new ArrayList<>(); + for (int i = 0; i < GT_Worldgen_GT_Ore_Layer.sList.size(); i++) { + if (BW_WorldGenRoss128.sList.get(i) instanceof BW_WorldGenRoss128) { + int baseMeta = result.getItemDamage(); + BW_WorldGenRoss128 worldGen = ((BW_WorldGenRoss128) BW_WorldGenRoss128.sList.get(i)); + if (worldGen.mPrimaryMeta == baseMeta || worldGen.mSecondaryMeta == baseMeta || worldGen.mBetweenMeta == baseMeta || worldGen.mSporadicMeta == baseMeta) { + ItemStack other; + other = result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore", "Vein")); + stack = new PositionedStack(other, 83, 0); + if (((worldGen.bwOres & 0b1000) != 0)) { + other = result.copy(); + other.setItemDamage(worldGen.mPrimaryMeta); + ret.add(new PositionedStack(other, 0, 12)); + } else { + other = new ItemStack(GregTech_API.sBlockOres1); + other.setItemDamage(worldGen.mPrimaryMeta); + ret.add(new PositionedStack(other, 0, 12)); + } + if (((worldGen.bwOres & 0b0100) != 0)) { + other = result.copy(); + other.setItemDamage(worldGen.mSecondaryMeta); + ret.add(new PositionedStack(other, 20, 12)); + } else { + other = new ItemStack(GregTech_API.sBlockOres1); + other.setItemDamage(worldGen.mSecondaryMeta); + ret.add(new PositionedStack(other, 20, 12)); + } + if (((worldGen.bwOres & 0b0010) != 0)) { + other = result.copy(); + other.setItemDamage(worldGen.mBetweenMeta); + ret.add(new PositionedStack(other, 40, 12)); + } else { + other = new ItemStack(GregTech_API.sBlockOres1); + other.setItemDamage(worldGen.mBetweenMeta); + ret.add(new PositionedStack(other, 40, 12)); + } + if (((worldGen.bwOres & 0b0001) != 0)) { + other = result.copy(); + other.setItemDamage(worldGen.mSporadicMeta); + ret.add(new PositionedStack(other, 60, 12)); + } else { + other = new ItemStack(GregTech_API.sBlockOres1); + other.setItemDamage(worldGen.mSporadicMeta); + ret.add(new PositionedStack(other, 60, 12)); + } + break; + } + } + } + return ret; + } + }; + this.arecipes.add(tmp); + } + } + } else super.loadCraftingRecipes(outputId, results); } @Override public void drawExtras(int recipe) { - GuiDraw.drawString(ChatColorHelper.BOLD+"DIM:"+ChatColorHelper.RESET+" Ross128",0,40,0,false); - GuiDraw.drawString(ChatColorHelper.BOLD+"Primary:",0,50,0,false); - GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(0).item.getDisplayName(),0,60,0,false); - GuiDraw.drawString(ChatColorHelper.BOLD+"Secondary:",0,70,0,false); - GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(1).item.getDisplayName(),0,80,0,false); - GuiDraw.drawString(ChatColorHelper.BOLD+"InBetween:",0,90,0,false); - GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(2).item.getDisplayName(),0,100,0,false); - GuiDraw.drawString(ChatColorHelper.BOLD+"Sporadic:",0,110,0,false); - GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(3).item.getDisplayName(),0,120,0,false); + GuiDraw.drawString(ChatColorHelper.BOLD + "DIM:" + ChatColorHelper.RESET + " Ross128", 0, 40, 0, false); + GuiDraw.drawString(ChatColorHelper.BOLD + "Primary:", 0, 50, 0, false); + GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(0).item.getDisplayName(), 0, 60, 0, false); + GuiDraw.drawString(ChatColorHelper.BOLD + "Secondary:", 0, 70, 0, false); + GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(1).item.getDisplayName(), 0, 80, 0, false); + GuiDraw.drawString(ChatColorHelper.BOLD + "InBetween:", 0, 90, 0, false); + GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(2).item.getDisplayName(), 0, 100, 0, false); + GuiDraw.drawString(ChatColorHelper.BOLD + "Sporadic:", 0, 110, 0, false); + GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(3).item.getDisplayName(), 0, 120, 0, false); super.drawExtras(recipe); } @Override public void loadCraftingRecipes(ItemStack result) { - if (Block.getBlockFromItem(result.getItem()) instanceof BW_MetaGenerated_Ores){ + if (Block.getBlockFromItem(result.getItem()) instanceof BW_MetaGenerated_Ores) { CachedRecipe tmp = new CachedRecipe() { PositionedStack stack = new PositionedStack(result, 0, 0); @@ -172,7 +172,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { BW_WorldGenRoss128 worldGen = ((BW_WorldGenRoss128) BW_WorldGenRoss128.sList.get(i)); if (worldGen.mPrimaryMeta == baseMeta || worldGen.mSecondaryMeta == baseMeta || worldGen.mBetweenMeta == baseMeta || worldGen.mSporadicMeta == baseMeta) { ItemStack other; - other=result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore","Vein")); + other = result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore", "Vein")); stack = new PositionedStack(other, 83, 0); if (((worldGen.bwOres & 0b1000) != 0)) { other = result.copy(); @@ -214,7 +214,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { } } } - return ret; + return ret; } }; this.arecipes.add(tmp); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index 1db9bcb8aa..81ab1e54b9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -29,16 +29,12 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ITexturedTileEntity; import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.common.blocks.GT_Packet_Ores; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import java.util.ArrayList; @@ -49,6 +45,16 @@ public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEn public short mMetaData = 0; + public static boolean placeOre(World aWorld, Coords coords, Werkstoff werkstoff) { + short meta = werkstoff.getmID(); + aWorld.setBlock(coords.x, coords.y, coords.z, WerkstoffLoader.BWOres, 0, 0); + TileEntity tTileEntity = aWorld.getTileEntity(coords.x, coords.y, coords.z); + if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { + ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = meta; + } + return true; + } + public boolean canUpdate() { return false; } @@ -63,16 +69,6 @@ public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEn aNBT.setShort("m", this.mMetaData); } - public static boolean placeOre(World aWorld,Coords coords, Werkstoff werkstoff) { - short meta = werkstoff.getmID(); - aWorld.setBlock(coords.x, coords.y, coords.z, WerkstoffLoader.BWOres, 0, 0); - TileEntity tTileEntity = aWorld.getTileEntity(coords.x, coords.y, coords.z); - if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { - ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = meta; - } - return true; - } - public ArrayList getDrops(Block aDroppedOre) { ArrayList rList = new ArrayList(); if (this.mMetaData < 0) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java index 4ebf9a47b8..46a9894572 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java @@ -44,7 +44,7 @@ public class BW_MetaGeneratedOre_Item extends BW_ItemBlocks { } public String getItemStackDisplayName(ItemStack aStack) { - return GT_LanguageManager.getTranslation("bw.blockores.01."+aStack.getItemDamage()+".name"); + return GT_LanguageManager.getTranslation("bw.blockores.01." + aStack.getItemDamage() + ".name"); } public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index dfd192863f..cbdfd9f2d4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -22,12 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material; -import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.IIconContainer; @@ -51,29 +48,35 @@ import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werks public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item { - private final short aNumToGen= (short) werkstoffHashMap.size(); + public static final CreativeTabs metaTab = new CreativeTabs("bartworksMetaMaterials") { + @Override + public Item getTabIconItem() { + return new ItemStack(Blocks.iron_ore).getItem(); + } + }; protected final OrePrefixes orePrefixes; + private final short aNumToGen = (short) werkstoffHashMap.size(); public BW_MetaGenerated_Items(OrePrefixes orePrefixes) { - super("bwMetaGenerated"+orePrefixes.name(), (short) 32766, (short) 0); + super("bwMetaGenerated" + orePrefixes.name(), (short) 32766, (short) 0); this.orePrefixes = orePrefixes; this.setCreativeTab(metaTab); for (int i = 0; i < aNumToGen; i++) { ItemStack tStack = new ItemStack(this, 1, i); - Werkstoff w = werkstoffHashMap.get((short)i); - if (w == null || ((w.getFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) == 0) ) + Werkstoff w = werkstoffHashMap.get((short) i); + if (w == null || ((w.getGenerationFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) == 0)) continue; GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", this.getDefaultLocalization(w)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); - GT_OreDictUnificator.registerOre(this.orePrefixes.name()+w.getDefaultName(),tStack); + GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.getDefaultName(), tStack); } } public boolean onEntityItemUpdate(EntityItem aItemEntity) { int aDamage = aItemEntity.getEntityItem().getItemDamage(); - if ( (aDamage >= 0) && (!aItemEntity.worldObj.isRemote) ) { - Werkstoff aMaterial = werkstoffHashMap.get((short)aDamage); + if ((aDamage >= 0) && (!aItemEntity.worldObj.isRemote)) { + Werkstoff aMaterial = werkstoffHashMap.get((short) aDamage); if ((aMaterial != null) && (aMaterial != Werkstoff.default_null_Werkstoff)) { int tX = MathHelper.floor_double(aItemEntity.posX); int tY = MathHelper.floor_double(aItemEntity.posY); @@ -108,11 +111,11 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item { if (orePrefixes == OrePrefixes.dustImpure || orePrefixes == OrePrefixes.dustPure) { aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify")); } - aList.add(StatCollector.translateToLocal("tooltip.bw.0.name")+ ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } - public String getDefaultLocalization(Werkstoff werkstoff){ - return werkstoff != null ? orePrefixes.mLocalizedMaterialPre+ werkstoff.getDefaultName()+orePrefixes.mLocalizedMaterialPost : Werkstoff.default_null_Werkstoff.getDefaultName(); + public String getDefaultLocalization(Werkstoff werkstoff) { + return werkstoff != null ? orePrefixes.mLocalizedMaterialPre + werkstoff.getDefaultName() + orePrefixes.mLocalizedMaterialPost : Werkstoff.default_null_Werkstoff.getDefaultName(); } @Override @@ -122,17 +125,17 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item { @Override public final IIconContainer getIconContainer(int aMetaData) { - return werkstoffHashMap.get((short)aMetaData) == null ? null : werkstoffHashMap.get((short)aMetaData).getTexSet().mTextures[orePrefixes.mTextureIndex]; + return werkstoffHashMap.get((short) aMetaData) == null ? null : werkstoffHashMap.get((short) aMetaData).getTexSet().mTextures[orePrefixes.mTextureIndex]; } @Override @SideOnly(Side.CLIENT) public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { for (int i = 0; i < aNumToGen; i++) { - Werkstoff werkstoff = werkstoffHashMap.get((short)i); - if (werkstoff != null && ((werkstoff.getFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) != 0)) { - ItemStack tStack = new ItemStack(this, 1, i); - aList.add(tStack); + Werkstoff werkstoff = werkstoffHashMap.get((short) i); + if (werkstoff != null && ((werkstoff.getGenerationFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) != 0)) { + ItemStack tStack = new ItemStack(this, 1, i); + aList.add(tStack); } } super.getSubItems(var1, aCreativeTab, aList); @@ -140,7 +143,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item { @Override public short[] getRGBa(ItemStack aStack) { - Werkstoff werkstoff = werkstoffHashMap.get((short)getDamage(aStack)); + Werkstoff werkstoff = werkstoffHashMap.get((short) getDamage(aStack)); return werkstoff == null ? Materials._NULL.mRGBa : werkstoff.getRGBA(); } @@ -148,7 +151,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item { public final IIcon getIconFromDamage(int aMetaData) { if (aMetaData < 0) return null; - Werkstoff tMaterial = werkstoffHashMap.get((short)aMetaData); + Werkstoff tMaterial = werkstoffHashMap.get((short) aMetaData); if (tMaterial == null) return null; IIconContainer tIcon = getIconContainer(aMetaData); @@ -161,12 +164,4 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item { public int getItemStackLimit(ItemStack aStack) { return 64; } - - public static final CreativeTabs metaTab = new CreativeTabs("bartworksMetaMaterials") { - - @Override - public Item getTabIconItem() { - return new ItemStack(Blocks.iron_ore).getItem(); - } - }; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 599b93dbf9..088f4040fc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -24,13 +24,10 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; -import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; -import gregtech.common.blocks.GT_Block_Ores_Abstract; -import gregtech.common.blocks.GT_TileEntity_Ores; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; @@ -50,6 +47,8 @@ import static com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerate public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { + public static ThreadLocal mTemporaryTileEntity = new ThreadLocal(); + public BW_MetaGenerated_Ores(Material p_i45386_1_, Class tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); @@ -57,17 +56,42 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { this.setResistance(5.0F); this.setBlockTextureName("stone"); this.setCreativeTab(metaTab); - for (Werkstoff w: Werkstoff.werkstoffHashSet) { + for (Werkstoff w : Werkstoff.werkstoffHashSet) { if (w != null) { - if ((w.getFeatures().toGenerate & 0b1000) == 0) + if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0) continue; GT_ModHandler.addValuableOre(this, w.getmID(), 1); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + w.getmID() +".name", w.getDefaultName() + OrePrefixes.ore.mLocalizedMaterialPost); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + w.getmID() + ".name", w.getDefaultName() + OrePrefixes.ore.mLocalizedMaterialPost); GT_OreDictUnificator.registerOre(OrePrefixes.ore + w.getDefaultName(), new ItemStack(this, 1, w.getmID())); } } } + public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air) { + if (!air) { + aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); + } + + Block tBlock = aWorld.getBlock(aX, aY, aZ); + Block tOreBlock = WerkstoffLoader.BWOres; + if (aMetaData < 0 || tBlock == Blocks.air && !air) { + return false; + } else { + + if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) { + return false; + } + + aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0); + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof BW_MetaGeneratedOreTE) { + ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = (short) aMetaData; + } + + return true; + } + } + public String getLocalizedName() { return StatCollector.translateToLocal(getUnlocalizedName() + ".name"); } @@ -105,7 +129,6 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { } return 0; } - public static ThreadLocal mTemporaryTileEntity = new ThreadLocal(); public void breakBlock(World aWorld, int aX, int aY, int aZ, Block par5, int par6) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); @@ -124,7 +147,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { return mTemporaryTileEntity.get() == null ? new ArrayList() : ((BW_MetaGeneratedOreTE) mTemporaryTileEntity.get()).getDrops(WerkstoffLoader.BWOres); } - public int getHarvestLevel(int metadata){ + public int getHarvestLevel(int metadata) { return 3; } @@ -136,8 +159,8 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { @Override public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { for (int i = 0; i < Werkstoff.werkstoffHashSet.size(); i++) { - Werkstoff tMaterial = Werkstoff.werkstoffHashMap.get((short)i); - if ((tMaterial != null) && ((tMaterial.getFeatures().toGenerate & 0x8) != 0) ) { + Werkstoff tMaterial = Werkstoff.werkstoffHashMap.get((short) i); + if ((tMaterial != null) && ((tMaterial.getGenerationFeatures().toGenerate & 0x8) != 0)) { aList.add(new ItemStack(aItem, 1, i)); } } @@ -145,36 +168,11 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { @Override public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block p_149695_5_) { - aWorld.getTileEntity(aX, aY, aZ).getDescriptionPacket(); + aWorld.getTileEntity(aX, aY, aZ).getDescriptionPacket(); } @Override public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int tileX, int tileY, int tileZ) { aWorld.getTileEntity(aX, aY, aZ).getDescriptionPacket(); } - - public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air) { - if (!air) { - aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); - } - - Block tBlock = aWorld.getBlock(aX, aY, aZ); - Block tOreBlock = WerkstoffLoader.BWOres; - if (aMetaData < 0 || tBlock == Blocks.air && !air) { - return false; - } else { - - if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) { - return false; - } - - aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0); - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (tTileEntity instanceof BW_MetaGeneratedOreTE) { - ((BW_MetaGeneratedOreTE)tTileEntity).mMetaData = (short)aMetaData; - } - - return true; - } - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 7522c40205..65ab699c57 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -40,15 +40,103 @@ import java.util.*; public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static final LinkedHashSet werkstoffHashSet = new LinkedHashSet<>(); - private static final HashSet idHashSet = new HashSet<>(); - public static final LinkedHashMap werkstoffHashMap = new LinkedHashMap<>(); + private static final HashSet idHashSet = new HashSet<>(); - public static final Werkstoff.Stats default_null_stats = new Werkstoff.Stats(); - public static final Werkstoff.Features default_null_features = new Werkstoff.Features(); - public static final Werkstoff default_null_Werkstoff = new Werkstoff(new short[3], "_NULL", "Default null Werkstoff", default_null_stats, Werkstoff.Types.UNDEFINED, default_null_features, -1, TextureSet.SET_NONE); + public static final Werkstoff.Stats DEFAULT_NULL_STATS = new Werkstoff.Stats(); + public static final GenerationFeatures DEFAULT_NULL_GENERATION_FEATURES = new GenerationFeatures(); + public static Werkstoff default_null_Werkstoff; private final List mOreByProducts = new ArrayList(); + private final LinkedHashSet> contents = new LinkedHashSet<>(); + HashSet subtags = new HashSet<>(); + private byte[] rgb = new byte[3]; + private String defaultName; + private String toolTip; + private Fluid fluid; + private Fluid gas; + private Werkstoff.Stats stats; + private Werkstoff.Types type; + private GenerationFeatures generationFeatures; + private short mID; + private TextureSet texSet; + + public static void init(){ + default_null_Werkstoff = new Werkstoff(new short[3], "_NULL", "Default null Werkstoff", DEFAULT_NULL_STATS, Werkstoff.Types.UNDEFINED, DEFAULT_NULL_GENERATION_FEATURES, -1, TextureSet.SET_NONE); + } + + + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { + this(rgba, defaultName, Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents); + } + public Werkstoff(short[] rgba, String toolTip, String defaultName, Werkstoff.Types type, GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { + this(rgba, toolTip, defaultName, Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents); + } + + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { + this(rgba, defaultName, "", stats, type, generationFeatures, mID, texSet, contents); + this.mOreByProducts.addAll(oreByProduct); + } + + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { + this(rgba, defaultName, "", stats, type, generationFeatures, mID, texSet, contents); + } + + public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { + this(rgba, defaultName, toolTip, stats, type, generationFeatures, mID, texSet, contents); + this.mOreByProducts.addAll(oreByProduct); + } + + public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { + + if (idHashSet.contains((short) mID)) + throw new UnsupportedOperationException("ID (" + mID + ") is already in use!"); + idHashSet.add((short) mID); + if (type == null) + type = Werkstoff.Types.UNDEFINED; + + this.defaultName = defaultName; + + this.type = type; + this.mID = (short) mID; + this.generationFeatures = generationFeatures; + this.setRgb(rgba); + this.contents.addAll(Arrays.asList(contents)); + this.toolTip = ""; + if (toolTip.isEmpty()) { + for (Pair p : contents) { + if (p.getKey() instanceof Materials) { + this.toolTip += ((Materials) p.getKey()).mChemicalFormula + (p.getValue() > 1 ? p.getValue() : ""); + } + if (p.getKey() instanceof Werkstoff) + this.toolTip += ((Werkstoff) p.getKey()).toolTip + (p.getValue() > 1 ? p.getValue() : ""); + } + } else + this.toolTip = toolTip; + long tmpprotons = 0; + for (Pair p : contents) { + if (p.getKey() instanceof Materials) { + tmpprotons += ((Materials) p.getKey()).getProtons() * p.getValue(); + } else if (p.getKey() instanceof Werkstoff) { + tmpprotons += ((Werkstoff) p.getKey()).getStats().protons * p.getValue(); + } + } + this.stats = stats.setProtons(tmpprotons); + + long tmpmass = 0; + for (Pair p : contents) { + if (p.getKey() instanceof Materials) { + tmpmass += ((Materials) p.getKey()).getMass() * p.getValue(); + } else if (p.getKey() instanceof Werkstoff) { + tmpprotons += ((Werkstoff) p.getKey()).getStats().mass * p.getValue(); + } + } + this.stats = stats.setMass(tmpmass); + + this.texSet = texSet; + werkstoffHashSet.add(this); + werkstoffHashMap.put(this.mID, this); + } public Pair>> getContents() { int ret = 0; @@ -67,11 +155,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return new Pair<>(ret, this.contents); } - private final LinkedHashSet> contents = new LinkedHashSet<>(); - private byte[] rgb = new byte[3]; - private String defaultName; - - public int getNoOfByProducts(){ + public int getNoOfByProducts() { return mOreByProducts.size(); } @@ -100,13 +184,6 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.toolTip; } - private String toolTip; - private Fluid fluid; - private Fluid gas; - private Werkstoff.Stats stats; - private Werkstoff.Types type; - private Werkstoff.Features features; - public Werkstoff.Stats getStats() { return this.stats; } @@ -115,96 +192,26 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.mID; } - private short mID; - - public Werkstoff.Features getFeatures() { - return this.features; + public GenerationFeatures getGenerationFeatures() { + return this.generationFeatures; } public TextureSet getTexSet() { return this.texSet; } - private TextureSet texSet; - - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.Features features, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { - this(rgba,defaultName,Types.getDefaultStatForType(type),type,features,mID,texSet,oreByProduct,contents); - } - - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.Features features, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { - this(rgba,defaultName,"",stats,type,features,mID,texSet,contents); - this.mOreByProducts.addAll(oreByProduct); - } - - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.Features features, int mID, TextureSet texSet, Pair... contents) { - this(rgba,defaultName,"",stats,type,features,mID,texSet,contents); - } - public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.Features features, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { - this(rgba, defaultName, toolTip, stats, type, features, mID, texSet, contents); - this.mOreByProducts.addAll(oreByProduct); - } - - public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.Features features, int mID, TextureSet texSet, Pair... contents) { - - if (idHashSet.contains((short) mID)) - throw new UnsupportedOperationException("ID ("+mID+") is already in use!"); - - if (type == null) - type = Werkstoff.Types.UNDEFINED; - - this.defaultName=defaultName; - - this.type = type; - this.mID = (short) mID; - this.features=features; - this.setRgb(rgba); - this.contents.addAll(Arrays.asList(contents)); - this.toolTip=""; - if (toolTip.isEmpty()) { - for (Pair p : contents) { - if (p.getKey() instanceof Materials) { - this.toolTip += ((Materials) p.getKey()).mChemicalFormula + (p.getValue() > 1 ? p.getValue() : ""); - } - if (p.getKey() instanceof Werkstoff) - this.toolTip += ((Werkstoff) p.getKey()).toolTip + (p.getValue() > 1 ? p.getValue() : ""); - } - } else - this.toolTip = toolTip; - long tmpprotons=0; - for (Pair p : contents) { - if (p.getKey() instanceof Materials) { - tmpprotons += ((Materials) p.getKey()).getProtons()* p.getValue(); - } - } - this.stats = stats.setProtons(tmpprotons); - - long tmpmass=0; - for (Pair p : contents) { - if (p.getKey() instanceof Materials) { - tmpmass += ((Materials) p.getKey()).getMass()* p.getValue(); - } - } - this.stats = stats.setMass(tmpmass); - - this.texSet=texSet; - werkstoffHashSet.add(this); - werkstoffHashMap.put(this.mID,this); - } - public void setRgb(short[] rgb) { - this.rgb = new byte[]{(byte) (rgb[0]-128), (byte) (rgb[1]-128), (byte) (rgb[2]-128)}; + this.rgb = new byte[]{(byte) (rgb[0] - 128), (byte) (rgb[1] - 128), (byte) (rgb[2] - 128)}; } @Override public short[] getRGBA() { - return new short[] {(short) (rgb[0]+128), (short) (rgb[1]+128), (short) (rgb[2]+128),0}; + return new short[]{(short) (rgb[0] + 128), (short) (rgb[1] + 128), (short) (rgb[2] + 128), 0}; } - HashSet subtags = new HashSet<>(); - @Override public boolean contains(SubTag subTag) { - for (Pair p: contents) + for (Pair p : contents) if (p.getKey().contains(subTag)) return true; if (subtags.contains(subTag)) @@ -223,15 +230,31 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return subtags.remove(subTag); } - public ItemStack get(OrePrefixes prefixes){ - return WerkstoffLoader.getCorresopndingItemStack(prefixes,this); + public ItemStack get(OrePrefixes prefixes) { + return WerkstoffLoader.getCorresopndingItemStack(prefixes, this); + } + + public ItemStack get(OrePrefixes prefixes, int amount) { + return WerkstoffLoader.getCorresopndingItemStack(prefixes, this, amount); } - public ItemStack get(OrePrefixes prefixes, int amount){ - return WerkstoffLoader.getCorresopndingItemStack(prefixes,this, amount); + public enum Types { + MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, UNDEFINED; + + public static Stats getDefaultStatForType(Types T) { + switch (T) { + case COMPOUND: + case BIOLOGICAL: + return new Stats().setElektrolysis(true); + case MIXTURE: + return new Stats().setCentrifuge(true); + default: + return new Stats(); + } + } } - public static class Features { + public static class GenerationFeatures { //logic gate shit /* dust 1 @@ -241,16 +264,16 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { */ public byte toGenerate = 0b0001001; - public boolean hasGems(){ + public boolean hasGems() { return (toGenerate & 4) != 0; } - public Features onlyDust(){ + public GenerationFeatures onlyDust() { toGenerate = (byte) (1); return this; } - public Features addGems(){ + public GenerationFeatures addGems() { toGenerate = (byte) (toGenerate | 0x4); return this; } @@ -258,9 +281,17 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } - public static class Stats { + int boilingPoint; + int meltingPoint; + long protons; + long neutrons; + long electrons; + long mass; + //logic gate shit + byte quality = ~0b111111; + @Override public boolean equals(Object o) { if (this == o) return true; @@ -279,112 +310,90 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(49).put(quality).putInt(boilingPoint).putInt(meltingPoint).putLong(protons).putLong(neutrons).putLong(electrons).putLong(mass).array(),0,49,31); + return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(49).put(quality).putInt(boilingPoint).putInt(meltingPoint).putLong(protons).putLong(neutrons).putLong(electrons).putLong(mass).array(), 0, 49, 31); } - int boilingPoint; - int meltingPoint; - long protons; - long neutrons; - long electrons; - long mass; - - - public Stats setMass(long mass) { this.mass = protons; return this; } + public Stats setProtons(long protons) { this.protons = protons; return this; } - //logic gate shit - byte quality = ~0b111111; - public boolean isSublimation() { - return (quality&0b1) == 0b1; - } - - public boolean isToxic() { - return (quality>>1&0b1) == 0b1; - } - - public boolean isRadioactive() { - return (quality>>2&0b1) == 0b1; - } - - public boolean isBlastFurnace() { - return (quality>>3&0b1) == 0b1; - } - - public boolean isElektrolysis() { - return (quality>>4&0b1) == 0b1; - } - - public boolean isCentrifuge() { - return (quality>>5&0b1) == 0b1; + return (quality & 0b1) == 0b1; } public Werkstoff.Stats setSublimation(boolean sublimation) { - if(sublimation) - quality= (byte) (quality|0b000001); - else - quality= (byte) (quality&0b111110); + if (sublimation) + quality = (byte) (quality | 0b000001); + else + quality = (byte) (quality & 0b111110); return this; } + public boolean isToxic() { + return (quality >> 1 & 0b1) == 0b1; + } + public Werkstoff.Stats setToxic(boolean toxic) { - if(toxic) - quality= (byte) (quality|0b000010); + if (toxic) + quality = (byte) (quality | 0b000010); else - quality= (byte) (quality&0b111101); + quality = (byte) (quality & 0b111101); return this; } + public boolean isRadioactive() { + return (quality >> 2 & 0b1) == 0b1; + } + public Werkstoff.Stats setRadioactive(boolean radioactive) { - if(radioactive) - quality= (byte) (quality|0b000100); + if (radioactive) + quality = (byte) (quality | 0b000100); else - quality= (byte) (quality&0b111011); + quality = (byte) (quality & 0b111011); return this; } + public boolean isBlastFurnace() { + return (quality >> 3 & 0b1) == 0b1; + } + public Werkstoff.Stats setBlastFurnace(boolean blastFurnace) { - if(blastFurnace) - quality= (byte) (quality|0b001000); + if (blastFurnace) + quality = (byte) (quality | 0b001000); else - quality= (byte) (quality&0b110111); + quality = (byte) (quality & 0b110111); return this; } + public boolean isElektrolysis() { + return (quality >> 4 & 0b1) == 0b1; + } + public Werkstoff.Stats setElektrolysis(boolean elektrolysis) { - if(elektrolysis) - quality= (byte) (quality|0b010000); + if (elektrolysis) + quality = (byte) (quality | 0b010000); else - quality= (byte) (quality&0b101111); + quality = (byte) (quality & 0b101111); return this; } + public boolean isCentrifuge() { + return (quality >> 5 & 0b1) == 0b1; + } + public Werkstoff.Stats setCentrifuge(boolean centrifuge) { - if(centrifuge) - quality= (byte) (quality|0b100000); + if (centrifuge) + quality = (byte) (quality | 0b100000); else - quality=(byte) (quality&0b011111); + quality = (byte) (quality & 0b011111); return this; } } - public enum Types { - MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, UNDEFINED; - public static Stats getDefaultStatForType(Types T){ - switch (T){ - case COMPOUND: case BIOLOGICAL: return new Stats().setElektrolysis(true); - case MIXTURE: return new Stats().setCentrifuge(true); - default:return new Stats(); - } - } - } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 89f69948fa..948051eff8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -36,10 +36,8 @@ import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -52,23 +50,15 @@ import static gregtech.api.enums.OrePrefixes.*; public class WerkstoffLoader implements Runnable { - private WerkstoffLoader(){} + private WerkstoffLoader() {} - public static WerkstoffLoader INSTANCE = new WerkstoffLoader(); - - public boolean registered = false; - - public void init(){ - } - - public static HashMap items = new HashMap<>(); - public static Block BWOres; + public static final WerkstoffLoader INSTANCE = new WerkstoffLoader(); public static final Werkstoff Bismutite = new Werkstoff( new short[]{255, 233, 0, 0}, "Bismutite", Werkstoff.Types.COMPOUND, - new Werkstoff.Features().addGems(), + new Werkstoff.GenerationFeatures().addGems(), 1, TextureSet.SET_FLINT, Arrays.asList(Materials.Bismuth), @@ -80,161 +70,102 @@ public class WerkstoffLoader implements Runnable { new short[]{192, 192, 192, 0}, "Bismuthinite", Werkstoff.Types.COMPOUND, - new Werkstoff.Features(), + new Werkstoff.GenerationFeatures(), 2, TextureSet.SET_METALLIC, Arrays.asList(Materials.Bismuth, Materials.Sulfur), new Pair(Materials.Bismuth, 2), new Pair(Materials.Sulfur, 3) ); - - public static final Werkstoff CyclosilicateSi6O18 = new Werkstoff( - new short[]{255,255,255,0}, - "CycloHexaSilicate", - "(Si6O18)", - Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), - Werkstoff.Types.COMPOUND, - new Werkstoff.Features().onlyDust(), - 3, - TextureSet.SET_DULL, - new Pair(Materials.Silicon, 6), - new Pair(Materials.Oxygen, 18) - ); - - public static final Werkstoff Borat = new Werkstoff( - new short[]{255,255,255,0}, - "Borate", - "(BO3)", - Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), - Werkstoff.Types.COMPOUND, - new Werkstoff.Features().onlyDust(), - 4, - TextureSet.SET_DULL, - new Pair(Materials.Boron, 1), - new Pair(Materials.Oxygen, 3) - ); - - //Na Fe3+3 Al6 (Si6O18) (BO3)3 O3 F public static final Werkstoff FluorBuergerit = new Werkstoff( - new short[]{0x20,0x20,0x20,0}, + new short[]{0x20, 0x20, 0x20, 0}, "Fluor-Buergerit", + "NaFe3Al6(Si6O18)(BO3)3O3F", Werkstoff.Types.COMPOUND, - new Werkstoff.Features().addGems(), + new Werkstoff.GenerationFeatures().addGems(), 5, TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium,Materials.Boron,Materials.Silicon), + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), new Pair(Materials.Sodium, 1), new Pair(Materials.Iron, 3), new Pair(Materials.Aluminium, 6), - new Pair(CyclosilicateSi6O18, 1), - new Pair(Borat, 3), - new Pair(Materials.Oxygen, 1), + new Pair(Materials.Silicon, 6), + new Pair(Materials.Boron, 3), + new Pair(Materials.Oxygen, 30), new Pair(Materials.Fluorine, 1) ); - - public static final Werkstoff AluminiumMagnesite = new Werkstoff( - new short[]{255,255,255,0}, - "AluminiumMagnesite", - "(Al4Mg2)", - Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), - Werkstoff.Types.COMPOUND, - new Werkstoff.Features().onlyDust(), - 6, - TextureSet.SET_DULL, - new Pair(Materials.Aluminium, 4), - new Pair(Materials.Magnesium, 2) - ); - -// public static final Werkstoff Hydroxide = new Werkstoff( -// new short[]{255,255,255,0}, -// "Hydroxide", -// "(OH)", -// new Werkstoff.Stats(), -// Werkstoff.Types.COMPOUND, -// new Werkstoff.Features().onlyDust(), -// 7, -// TextureSet.SET_DULL, -// new Pair(Materials.Aluminium, 4), -// new Pair(Materials.Magnesium, 2) -// ); - public static final Werkstoff ChromoAluminoPovondrait = new Werkstoff( - new short[]{0,0x79,0x6A,0}, + new short[]{0, 0x79, 0x6A, 0}, "Chromo-Alumino-Povondraite", "NaCr3(Al4Mg2)(Si6O18)(BO3)3(OH)3O", Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), Werkstoff.Types.COMPOUND, - new Werkstoff.Features().addGems(), + new Werkstoff.GenerationFeatures().addGems(), 7, TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium,Materials.Boron,Materials.Silicon), - //Na Cr3 (Al4Mg2) (Si6O18) (BO3)3 (OH)3 O + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), new Pair(Materials.Sodium, 1), new Pair(Materials.Chrome, 3), - new Pair(AluminiumMagnesite,1), - new Pair(CyclosilicateSi6O18, 1), - new Pair(Borat, 3), - new Pair(Materials.Oxygen, 4), + new Pair(Materials.Magnalium, 6), + new Pair(Materials.Silicon, 6), + new Pair(Materials.Boron, 3), + new Pair(Materials.Oxygen, 31), new Pair(Materials.Hydrogen, 3) ); - public static final Werkstoff VanadioOxyDravit = new Werkstoff( - new short[]{0x60,0xA0,0xA0,0}, + new short[]{0x60, 0xA0, 0xA0, 0}, "Vanadio-Oxy-Dravite", "NaV3(Al4Mg2)(Si6O18)(BO3)3(OH)3O", Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), Werkstoff.Types.COMPOUND, - new Werkstoff.Features().addGems(), + new Werkstoff.GenerationFeatures().addGems(), 8, TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium,Materials.Boron,Materials.Silicon), - //Na Cr3 (Al4Mg2) (Si6O18) (BO3)3 (OH)3 O + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), new Pair(Materials.Sodium, 1), new Pair(Materials.Vanadium, 3), - new Pair(AluminiumMagnesite,1), - new Pair(CyclosilicateSi6O18, 1), - new Pair(Borat, 3), - new Pair(Materials.Oxygen, 4), + new Pair(Materials.Magnalium, 6), + new Pair(Materials.Silicon, 6), + new Pair(Materials.Boron, 3), + new Pair(Materials.Oxygen, 31), new Pair(Materials.Hydrogen, 3) ); + //TODO: FREE ID RANGE: 3,4,6,19-32766 public static final Werkstoff Olenit = new Werkstoff( - new short[]{210,210,210,0}, + new short[]{210, 210, 210, 0}, "Olenite", "NaAl3Al6(Si6O18)(BO3)3O3OH", Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), Werkstoff.Types.COMPOUND, - new Werkstoff.Features().addGems(), + new Werkstoff.GenerationFeatures().addGems(), 9, TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium,Materials.Boron,Materials.Silicon), - //Na Cr3 (Al4Mg2) (Si6O18) (BO3)3 (OH)3 O + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), new Pair(Materials.Sodium, 1), new Pair(Materials.Aluminium, 9), new Pair(Materials.Silicon, 6), - new Pair(Borat, 3), - new Pair(Materials.Oxygen, 22), + new Pair(Materials.Boron, 3), + new Pair(Materials.Oxygen, 31), new Pair(Materials.Hydrogen, 1) ); - public static final Werkstoff Arsenopyrite = new Werkstoff( new short[]{0xB0, 0xB0, 0xB0, 0}, "Arsenopyrite", Werkstoff.Types.COMPOUND, - new Werkstoff.Features(), + new Werkstoff.GenerationFeatures(), 10, TextureSet.SET_METALLIC, - Arrays.asList(Materials.Sulfur, Materials.Arsenic,Materials.Iron), + Arrays.asList(Materials.Sulfur, Materials.Arsenic, Materials.Iron), new Pair(Materials.Iron, 1), new Pair(Materials.Arsenic, 1), new Pair(Materials.Sulfur, 1) ); - public static final Werkstoff Ferberite = new Werkstoff( new short[]{0xB0, 0xB0, 0xB0, 0}, "Ferberite", Werkstoff.Types.COMPOUND, - new Werkstoff.Features(), + new Werkstoff.GenerationFeatures(), 11, TextureSet.SET_METALLIC, Arrays.asList(Materials.Iron, Materials.Tungsten), @@ -242,24 +173,22 @@ public class WerkstoffLoader implements Runnable { new Pair(Materials.Tungsten, 1), new Pair(Materials.Oxygen, 3) ); - public static final Werkstoff Loellingit = new Werkstoff( new short[]{0xD0, 0xD0, 0xD0, 0}, "Loellingite", Werkstoff.Types.COMPOUND, - new Werkstoff.Features(), + new Werkstoff.GenerationFeatures(), 12, TextureSet.SET_METALLIC, Arrays.asList(Materials.Iron, Materials.Arsenic), new Pair(Materials.Iron, 1), new Pair(Materials.Arsenic, 2) ); - - public static final Werkstoff Roquesit= new Werkstoff( + public static final Werkstoff Roquesit = new Werkstoff( new short[]{0xA0, 0xA0, 0xA0, 0}, "Roquesite", Werkstoff.Types.COMPOUND, - new Werkstoff.Features(), + new Werkstoff.GenerationFeatures(), 13, TextureSet.SET_METALLIC, Arrays.asList(Materials.Copper, Materials.Sulfur), @@ -267,26 +196,26 @@ public class WerkstoffLoader implements Runnable { new Pair(Materials.Indium, 1), new Pair(Materials.Sulfur, 2) ); - public static final Werkstoff Bornite= new Werkstoff( + public static final Werkstoff Bornite = new Werkstoff( new short[]{0x97, 0x66, 0x2B, 0}, "Bornite", Werkstoff.Types.COMPOUND, - new Werkstoff.Features(), + new Werkstoff.GenerationFeatures(), 14, TextureSet.SET_METALLIC, - Arrays.asList(Materials.Copper,Materials.Iron, Materials.Sulfur), + Arrays.asList(Materials.Copper, Materials.Iron, Materials.Sulfur), new Pair(Materials.Copper, 5), new Pair(Materials.Iron, 1), new Pair(Materials.Sulfur, 4) ); - public static final Werkstoff Wittichenit= new Werkstoff( + public static final Werkstoff Wittichenit = new Werkstoff( Materials.Copper.mRGBa, "Wittichenite", Werkstoff.Types.COMPOUND, - new Werkstoff.Features(), + new Werkstoff.GenerationFeatures(), 15, TextureSet.SET_METALLIC, - Arrays.asList(Materials.Copper,Materials.Bismuth, Materials.Sulfur), + Arrays.asList(Materials.Copper, Materials.Bismuth, Materials.Sulfur), new Pair(Materials.Copper, 5), new Pair(Materials.Bismuth, 1), new Pair(Materials.Sulfur, 4) @@ -295,49 +224,63 @@ public class WerkstoffLoader implements Runnable { new short[]{0x60, 0x60, 0x60, 0}, "Djurleite", Werkstoff.Types.COMPOUND, - new Werkstoff.Features(), + new Werkstoff.GenerationFeatures(), 16, TextureSet.SET_METALLIC, - Arrays.asList(Materials.Copper,Materials.Copper, Materials.Sulfur), + Arrays.asList(Materials.Copper, Materials.Copper, Materials.Sulfur), new Pair(Materials.Copper, 31), new Pair(Materials.Sulfur, 16) ); - public static final Werkstoff Huebnerit = new Werkstoff( new short[]{0x80, 0x60, 0x60, 0}, "Huebnerite", Werkstoff.Types.COMPOUND, - new Werkstoff.Features(), + new Werkstoff.GenerationFeatures(), 17, TextureSet.SET_METALLIC, - Arrays.asList(Materials.Manganese,Materials.Tungsten), + Arrays.asList(Materials.Manganese, Materials.Tungsten), new Pair(Materials.Manganese, 1), new Pair(Materials.Tungsten, 1), new Pair(Materials.Oxygen, 3) ); - public static final Werkstoff Thorianit = new Werkstoff( new short[]{0x30, 0x30, 0x30, 0}, "Thorianit", Werkstoff.Types.COMPOUND, - new Werkstoff.Features(), + new Werkstoff.GenerationFeatures(), 18, TextureSet.SET_METALLIC, Arrays.asList(Materials.Thorium), new Pair(Materials.Thorium, 1), new Pair(Materials.Oxygen, 2) ); + public static HashMap items = new HashMap<>(); + public static Block BWOres; + public boolean registered = false; + public static ItemStack getCorresopndingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff) { + return getCorresopndingItemStack(orePrefixes, werkstoff, 1); + } + public static ItemStack getCorresopndingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { + if (orePrefixes == ore) + return new ItemStack(BWOres, amount, werkstoff.getmID()); + return new ItemStack(items.get(orePrefixes), amount, werkstoff.getmID()).copy(); + } + public void init() { + if (INSTANCE == null) + MainMod.LOGGER.error("INSTANCE IS NULL THIS SHOULD NEVER HAPPEN!"); + } public void runInit() { WerkstoffAdderRegistry.getINSTANCE().run(); addSubTags(); addItemsForGeneration(); } + @Override - public void run(){ + public void run() { if (!registered) { MainMod.LOGGER.info("Loading Processing Recipes for BW Materials"); long timepre = System.nanoTime(); @@ -357,28 +300,27 @@ public class WerkstoffLoader implements Runnable { } ProgressManager.pop(progressBar); long timepost = System.nanoTime(); - MainMod.LOGGER.info("Loading Processing Recipes for BW Materials took "+(timepost-timepre)+"ns/"+((timepost-timepre)/1000000)+"ms/"+((timepost-timepre)/1000000000)+"s!"); - registered=true; + MainMod.LOGGER.info("Loading Processing Recipes for BW Materials took " + (timepost - timepre) + "ns/" + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); + registered = true; } } - private void addSubTags(){ - for (Werkstoff W : Werkstoff.werkstoffHashMap.values()){ - for (Pair pair : W.getContents().getValue().toArray(new Pair[0])){ - if (pair.getKey() instanceof Materials && ((Materials)pair.getKey()) == Materials.Neodymium){ + private void addSubTags() { + for (Werkstoff W : Werkstoff.werkstoffHashMap.values()) { + for (Pair pair : W.getContents().getValue().toArray(new Pair[0])) { + + if (pair.getKey() instanceof Materials && ((Materials) pair.getKey()) == Materials.Neodymium) { W.add(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM); break; - } - else if (pair.getKey() instanceof Materials && ((Materials)pair.getKey()) == Materials.Iron){ + } else if (pair.getKey() instanceof Materials && ((Materials) pair.getKey()) == Materials.Iron) { W.add(SubTag.ELECTROMAGNETIC_SEPERATION_IRON); break; - } - else if (pair.getKey() instanceof Materials && ((Materials)pair.getKey()) == Materials.Gold){ + } else if (pair.getKey() instanceof Materials && ((Materials) pair.getKey()) == Materials.Gold) { W.add(SubTag.ELECTROMAGNETIC_SEPERATION_GOLD); break; } } - if (W.getFeatures().hasGems()){ + if (W.getGenerationFeatures().hasGems()) { W.add(SubTag.CRYSTAL); W.add(SubTag.CRYSTALLISABLE); } @@ -387,11 +329,11 @@ public class WerkstoffLoader implements Runnable { } - private void addItemsForGeneration(){ + private void addItemsForGeneration() { int toGenerateGlobal = 0b0000000; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) - toGenerateGlobal = (toGenerateGlobal | werkstoff.getFeatures().toGenerate); + toGenerateGlobal = (toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); if ((toGenerateGlobal & 0b1) != 0) { items.put(dust, new BW_MetaGenerated_Items(dust)); @@ -412,9 +354,9 @@ public class WerkstoffLoader implements Runnable { if ((toGenerateGlobal & 0b1000) != 0) { if (FMLCommonHandler.instance().getSide().isClient()) RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); - GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class,"bw.blockoresTE"); - BWOres = new BW_MetaGenerated_Ores(Material.rock,BW_MetaGeneratedOreTE.class,"bw.blockores"); - GameRegistry.registerBlock(BWOres,BW_MetaGeneratedOre_Item.class,"bw.blockores.01"); + GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); + BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); + GameRegistry.registerBlock(BWOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.01"); items.put(crushed, new BW_MetaGenerated_Items(crushed)); items.put(crushedPurified, new BW_MetaGenerated_Items(crushedPurified)); @@ -424,13 +366,8 @@ public class WerkstoffLoader implements Runnable { } } - private void addGemRecipes(Werkstoff werkstoff){ - if (werkstoff.getFeatures().hasGems()) { - GT_Values.RA.addForgeHammerRecipe(getCorresopndingItemStack(crushedCentrifuged, werkstoff), getCorresopndingItemStack(dust, werkstoff), 10, 16); - GT_ModHandler.addPulverisationRecipe(getCorresopndingItemStack(crushedCentrifuged, werkstoff), - getCorresopndingItemStack(dust, werkstoff), - werkstoff.getOreByProduct(-1, gem), - 10, true); + private void addGemRecipes(Werkstoff werkstoff) { + if (werkstoff.getGenerationFeatures().hasGems()) { GT_Values.RA.addSifterRecipe( getCorresopndingItemStack(crushedPurified, werkstoff), @@ -448,102 +385,111 @@ public class WerkstoffLoader implements Runnable { 800, 16 ); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemExquisite),werkstoff.get(dust,4)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawless),werkstoff.get(dust,2)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(gem),werkstoff.get(dust)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawed),werkstoff.get(dustSmall,1)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemChipped),werkstoff.get(dustTiny)); - - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemExquisite),werkstoff.get(gemFlawless,2),64, 16); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawless),werkstoff.get(gem,2),64, 16); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gem),werkstoff.get(gemFlawed,2),64, 16); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawed),werkstoff.get(gemChipped,2),64, 16); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemChipped),werkstoff.get(dustTiny),64, 16); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemExquisite), werkstoff.get(dust, 4)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawless), werkstoff.get(dust, 2)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gem), werkstoff.get(dust)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawed), werkstoff.get(dustSmall, 1)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemChipped), werkstoff.get(dustTiny)); + + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemExquisite), werkstoff.get(gemFlawless, 2), 64, 16); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawless), werkstoff.get(gem, 2), 64, 16); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gem), werkstoff.get(gemFlawed, 2), 64, 16); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawed), werkstoff.get(gemChipped, 2), 64, 16); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemChipped), werkstoff.get(dustTiny), 64, 16); + + GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawless, 3), 8, werkstoff.get(gemExquisite), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(gem, 3), 8, werkstoff.get(gemFlawless), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawed, 3), 8, werkstoff.get(gem), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(gemChipped, 3), 8, werkstoff.get(gemFlawed), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2)); + + GT_Values.RA.addImplosionRecipe(werkstoff.get(dust, 4), 24, werkstoff.get(gem, 3), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 8)); + } } - private void addDustRecipes(Werkstoff werkstoff){ - if ((werkstoff.getFeatures().toGenerate & 0b1) != 0){ + private void addDustRecipes(Werkstoff werkstoff) { + if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0) { List flOutputs = new ArrayList<>(); List stOutputs = new ArrayList<>(); - HashMap> tracker = new HashMap<>(); + HashMap> tracker = new HashMap<>(); int cells = 0; if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge()) { - for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])){ - if (container.getKey() instanceof Materials){ - if (((Materials)container.getKey()).hasCorrespondingGas() || ((Materials)container.getKey()).hasCorrespondingFluid() || ((Materials)container.getKey()).mIconSet == TextureSet.SET_FLUID) { - FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000*container.getValue()); - if (tmpFl == null || tmpFl.getFluid() == null){ - tmpFl = ((Materials) container.getKey()).getFluid(1000*container.getValue()); + for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { + if (container.getKey() instanceof Materials) { + if (((Materials) container.getKey()).hasCorrespondingGas() || ((Materials) container.getKey()).hasCorrespondingFluid() || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { + FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); + if (tmpFl == null || tmpFl.getFluid() == null) { + tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); } flOutputs.add(tmpFl); - if (flOutputs.size()>1) { + if (flOutputs.size() > 1) { if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(),stOutputs.size() - 1)); + tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey()+container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue()+1); + stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } - cells+=container.getValue(); + cells += container.getValue(); } } else { if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(),stOutputs.size() - 1)); + tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Materials) container.getKey()).getDust(tracker.get(container.getKey()).getKey()+container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue()+1); + stOutputs.add(((Materials) container.getKey()).getDust(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } } - } else if (container.getKey() instanceof Werkstoff){ - if (((Werkstoff)container.getKey()).getTexSet() == TextureSet.SET_FLUID){ + } else if (container.getKey() instanceof Werkstoff) { + if (((Werkstoff) container.getKey()).getTexSet() == TextureSet.SET_FLUID) { //not yet implemented no fluids from me... } else { if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Werkstoff) container.getKey()).get(dust,container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(),stOutputs.size() - 1)); + stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Werkstoff) container.getKey()).get(dust,(tracker.get(container.getKey()).getKey()+container.getValue()))); - stOutputs.remove(tracker.get(container.getKey()).getValue()+1); + stOutputs.add(((Werkstoff) container.getKey()).get(dust, (tracker.get(container.getKey()).getKey() + container.getValue()))); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } } } } - ItemStack input = getCorresopndingItemStack(dust,werkstoff); - input.stackSize=werkstoff.getContents().getKey(); + ItemStack input = getCorresopndingItemStack(dust, werkstoff); + input.stackSize = werkstoff.getContents().getKey(); if (werkstoff.getStats().isElektrolysis()) - GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), (Object)null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int)Math.max(1L,Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4,werkstoff.getContents().getValue().size()) *30, 0); + GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), (Object) null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); if (werkstoff.getStats().isCentrifuge()) - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), (Object)null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), (Object) null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0); } - GT_ModHandler.addShapelessCraftingRecipe(getCorresopndingItemStack(dust,werkstoff), 0,new Object[]{ - getCorresopndingItemStack(dustTiny,werkstoff), - getCorresopndingItemStack(dustTiny,werkstoff), - getCorresopndingItemStack(dustTiny,werkstoff), - getCorresopndingItemStack(dustTiny,werkstoff), - getCorresopndingItemStack(dustTiny,werkstoff), - getCorresopndingItemStack(dustTiny,werkstoff), - getCorresopndingItemStack(dustTiny,werkstoff), - getCorresopndingItemStack(dustTiny,werkstoff), - getCorresopndingItemStack(dustTiny,werkstoff) + GT_ModHandler.addShapelessCraftingRecipe(getCorresopndingItemStack(dust, werkstoff), 0, new Object[]{ + getCorresopndingItemStack(dustTiny, werkstoff), + getCorresopndingItemStack(dustTiny, werkstoff), + getCorresopndingItemStack(dustTiny, werkstoff), + getCorresopndingItemStack(dustTiny, werkstoff), + getCorresopndingItemStack(dustTiny, werkstoff), + getCorresopndingItemStack(dustTiny, werkstoff), + getCorresopndingItemStack(dustTiny, werkstoff), + getCorresopndingItemStack(dustTiny, werkstoff), + getCorresopndingItemStack(dustTiny, werkstoff) }); - GT_ModHandler.addShapelessCraftingRecipe(getCorresopndingItemStack(dust,werkstoff),0,new Object[]{ - getCorresopndingItemStack(dustSmall,werkstoff), - getCorresopndingItemStack(dustSmall,werkstoff), - getCorresopndingItemStack(dustSmall,werkstoff), - getCorresopndingItemStack(dustSmall,werkstoff) + GT_ModHandler.addShapelessCraftingRecipe(getCorresopndingItemStack(dust, werkstoff), 0, new Object[]{ + getCorresopndingItemStack(dustSmall, werkstoff), + getCorresopndingItemStack(dustSmall, werkstoff), + getCorresopndingItemStack(dustSmall, werkstoff), + getCorresopndingItemStack(dustSmall, werkstoff) }); - GT_ModHandler.addCraftingRecipe(getCorresopndingItemStack(dustSmall,werkstoff,4),new Object[]{ - " T ",'T',getCorresopndingItemStack(dust,werkstoff) + GT_ModHandler.addCraftingRecipe(getCorresopndingItemStack(dustSmall, werkstoff, 4), new Object[]{ + " T ", 'T', getCorresopndingItemStack(dust, werkstoff) }); - GT_ModHandler.addCraftingRecipe(getCorresopndingItemStack(dustTiny,werkstoff,9),new Object[]{ - "T ",'T',getCorresopndingItemStack(dust,werkstoff) + GT_ModHandler.addCraftingRecipe(getCorresopndingItemStack(dustTiny, werkstoff, 9), new Object[]{ + "T ", 'T', getCorresopndingItemStack(dust, werkstoff) }); - if ((werkstoff.getFeatures().toGenerate & 2) != 0 && !werkstoff.getStats().isBlastFurnace()) { + + if ((werkstoff.getGenerationFeatures().toGenerate & 2) != 0 && !werkstoff.getStats().isBlastFurnace()) { GT_ModHandler.addSmeltingRecipe(getCorresopndingItemStack(dust, werkstoff), getCorresopndingItemStack(ingot, werkstoff)); GT_ModHandler.addSmeltingRecipe(getCorresopndingItemStack(dustTiny, werkstoff), getCorresopndingItemStack(nugget, werkstoff)); } @@ -558,27 +504,31 @@ public class WerkstoffLoader implements Runnable { } } - private void addOreRecipes(Werkstoff werkstoff){ - if ((werkstoff.getFeatures().toGenerate & 2) != 0 && !werkstoff.getStats().isBlastFurnace()) - GT_ModHandler.addSmeltingRecipe(getCorresopndingItemStack(ore,werkstoff),getCorresopndingItemStack(ingot,werkstoff)); + private void addOreRecipes(Werkstoff werkstoff) { + if ((werkstoff.getGenerationFeatures().toGenerate & 2) != 0 && !werkstoff.getStats().isBlastFurnace()) + GT_ModHandler.addSmeltingRecipe(getCorresopndingItemStack(ore, werkstoff), getCorresopndingItemStack(ingot, werkstoff)); - if ((werkstoff.getFeatures().toGenerate & 0b1000) != 0) { - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ore), werkstoff.getFeatures().hasGems() ? werkstoff.get(gem) : werkstoff.get(crushed), 16, 10); + if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0) { + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ore), werkstoff.getGenerationFeatures().hasGems() ? werkstoff.get(gem) : werkstoff.get(crushed), 16, 10); GT_ModHandler.addPulverisationRecipe( werkstoff.get(ore), - GT_Utility.mul(2L, werkstoff.get(crushed)), - werkstoff.getOreByProduct(0,dust), werkstoff.getNoOfByProducts() > 0 ? 10 : 0, Materials.Stone.getDust(1), 50, true); + werkstoff.get(crushed, 2), + werkstoff.getOreByProduct(0, gem) != null ? werkstoff.getOreByProduct(0, gem) : werkstoff.getOreByProduct(0, dust), + werkstoff.getNoOfByProducts() > 0 ? 10 : 0, + Materials.Stone.getDust(1), + 50, + true); } } private void addCrushedRecipes(Werkstoff werkstoff) { - if ((werkstoff.getFeatures().toGenerate & 0b1000) == 0 || (werkstoff.getFeatures().toGenerate & 0b1) == 0) + if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) == 0 || (werkstoff.getGenerationFeatures().toGenerate & 0b1) == 0) return; GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), 10, 16); GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), werkstoff.getOreByProduct(0, dust), 10, false); GT_ModHandler.addOreWasherRecipe(werkstoff.get(crushed), 1000, werkstoff.get(crushedPurified), werkstoff.getOreByProduct(0, dustTiny), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L)); - GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushed), (int) Math.min(5000L, Math.abs(werkstoff.getStats().protons * 20L)), new Object[]{werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dustTiny), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L)}); + GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushed), (int) Math.min(5000L, Math.abs(werkstoff.getStats().protons * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dustTiny), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L)); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), 10, 16); GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), werkstoff.getOreByProduct(1, dust), 10, false); @@ -587,30 +537,20 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(dust), 10, 16); GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(dust), werkstoff.getOreByProduct(2, dust), 10, false); + GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustImpure), 0, werkstoff.get(dust), werkstoff.getOreByProduct(0, dustTiny), null, null, null, null, (int) Math.max(1L, werkstoff.getStats().mass * 8L)); + GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustPure), 0, werkstoff.get(dust), werkstoff.getOreByProduct(1, dustTiny), null, null, null, null, (int) Math.max(1L, werkstoff.getStats().mass * 8L)); + + if (werkstoff.contains(SubTag.WASHING_MERCURY)) GT_Values.RA.addChemicalBathRecipe(werkstoff.get(crushed), Materials.Mercury.getFluid(1000L), werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); if (werkstoff.contains(SubTag.WASHING_SODIUMPERSULFATE)) GT_Values.RA.addChemicalBathRecipe(werkstoff.get(crushed), Materials.SodiumPersulfate.getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L), werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); - GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustImpure), 0, werkstoff.get(dust), werkstoff.getOreByProduct(0, dustTiny), null, null, null, null, (int) Math.max(1L, werkstoff.getStats().mass * 8L)); - GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustPure), 0, werkstoff.get(dust), werkstoff.getOreByProduct(1, dustTiny), null, null, null, null, (int) Math.max(1L, werkstoff.getStats().mass * 8L)); - if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_GOLD)) GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Gold, 1L), GT_OreDictUnificator.get(OrePrefixes.nugget, Materials.Gold, 1L), new int[]{10000, 4000, 2000}, 400, 24); - if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_IRON)) + else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_IRON)) GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Iron, 1L), GT_OreDictUnificator.get(OrePrefixes.nugget, Materials.Iron, 1L), new int[]{10000, 4000, 2000}, 400, 24); - if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM)) + else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM)) GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Neodymium, 1L), GT_OreDictUnificator.get(OrePrefixes.nugget, Materials.Neodymium, 1L), new int[]{10000, 4000, 2000}, 400, 24); - - } - - public static ItemStack getCorresopndingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff) { - return getCorresopndingItemStack(orePrefixes,werkstoff,1); - } - - public static ItemStack getCorresopndingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { - if (orePrefixes == ore) - return new ItemStack(BWOres,amount,werkstoff.getmID()); - return new ItemStack(items.get(orePrefixes), amount, werkstoff.getmID()).copy(); } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 1ee1be96f3..b07c84d493 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -89,7 +89,6 @@ public class BWRecipes { ); - public BWRecipes() { if (ConfigHandler.BioLab) { @@ -484,7 +483,7 @@ public class BWRecipes { return false; } - public static class DynamicGTRecipe extends GT_Recipe{ + public static class DynamicGTRecipe extends GT_Recipe { public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); } @@ -510,13 +509,6 @@ public class BWRecipes { } - class BioLabRecipe extends GT_Recipe { - protected BioLabRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); - } - - } - public static class BacteriaVatRecipe extends GT_Recipe { protected BacteriaVatRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); @@ -645,4 +637,11 @@ public class BWRecipes { return this.addRecipe(aRecipe, false, false, false); } } + + class BioLabRecipe extends GT_Recipe { + protected BioLabRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + } + + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 51572b0543..f839b8b503 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -233,15 +233,16 @@ public class BW_Util { } } - public static long getnominalVoltage(GT_MetaTileEntity_MultiBlockBase base){ + public static long getnominalVoltage(GT_MetaTileEntity_MultiBlockBase base) { long rVoltage = 0L; long rAmperage = 0L; Iterator var3 = base.mEnergyHatches.iterator(); - while(var3.hasNext()) { - GT_MetaTileEntity_Hatch_Energy tHatch = (GT_MetaTileEntity_Hatch_Energy)var3.next(); + while (var3.hasNext()) { + GT_MetaTileEntity_Hatch_Energy tHatch = (GT_MetaTileEntity_Hatch_Energy) var3.next(); if (base.isValidMetaTileEntity(tHatch)) { - rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage(); + if (rVoltage == 0 || rVoltage > tHatch.getBaseMetaTileEntity().getInputVoltage()) + rVoltage = tHatch.getBaseMetaTileEntity().getInputVoltage(); rAmperage += tHatch.getBaseMetaTileEntity().getInputAmperage(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index 08e4f3269c..a9f3293cbc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -33,13 +33,12 @@ import net.minecraftforge.fluids.FluidRegistry; import java.awt.*; import java.nio.ByteBuffer; import java.util.ArrayList; -import java.util.Arrays; import java.util.Objects; public class BioCulture extends BioData implements IColorModulationContainer { public static final ArrayList BIO_CULTURE_ARRAY_LIST = new ArrayList(); - public static final BioCulture NULLCULTURE = BioCulture.createAndRegisterBioCulture(Color.BLUE, "", BioPlasmid.NULLPLASMID,BioDNA.NULLDNA, false); //fallback NULL culture, also Blue =) + public static final BioCulture NULLCULTURE = BioCulture.createAndRegisterBioCulture(Color.BLUE, "", BioPlasmid.NULLPLASMID, BioDNA.NULLDNA, false); //fallback NULL culture, also Blue =) Color color; BioPlasmid plasmid; @@ -96,14 +95,14 @@ public class BioCulture extends BioData implements IColorModulationContainer { BioCulture ret = getBioCulture(tag.getString("Name")); if (ret == null) - ret = createAndRegisterBioCulture( - new Color(tag.getIntArray("Color")[0], tag.getIntArray("Color")[1], tag.getIntArray("Color")[2]), - tag.getString("Name"), - BioPlasmid.convertDataToPlasmid(getBioDataFromNBTTag(tag.getCompoundTag("Plasmid"))), - BioDNA.convertDataToDNA(getBioDataFromNBTTag(tag.getCompoundTag("DNA"))), - BW_Util.getRarityFromByte(tag.getByte("Rarety")), - tag.getBoolean("Breedable") - ); + ret = createAndRegisterBioCulture( + new Color(tag.getIntArray("Color")[0], tag.getIntArray("Color")[1], tag.getIntArray("Color")[2]), + tag.getString("Name"), + BioPlasmid.convertDataToPlasmid(getBioDataFromNBTTag(tag.getCompoundTag("Plasmid"))), + BioDNA.convertDataToDNA(getBioDataFromNBTTag(tag.getCompoundTag("DNA"))), + BW_Util.getRarityFromByte(tag.getByte("Rarety")), + tag.getBoolean("Breedable") + ); if (ret.bBreedable) ret.setFluid(FluidRegistry.getFluid(tag.getString("Fluid"))); if (ret.getFluidNotSet()) //should never happen, but better safe than sorry @@ -131,14 +130,14 @@ public class BioCulture extends BioData implements IColorModulationContainer { return this.mFluid; } - public boolean getFluidNotSet(){ - return this.mFluid == null && this.isBreedable(); - } - public void setFluid(Fluid mFluid) { this.mFluid = mFluid; } + public boolean getFluidNotSet() { + return this.mFluid == null && this.isBreedable(); + } + public boolean isBreedable() { return this.bBreedable; } @@ -196,7 +195,7 @@ public class BioCulture extends BioData implements IColorModulationContainer { @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(17).putInt(MurmurHash3.murmurhash3_x86_32(this.getName(),0,this.getName().length(),31)).putInt(this.getColorRGB()).putInt(this.getPlasmid().ID).putInt(this.getdDNA().ID).put((byte) (isBreedable() ? 1 : 0)).array(),0,17,31); + return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(17).putInt(MurmurHash3.murmurhash3_x86_32(this.getName(), 0, this.getName().length(), 31)).putInt(this.getColorRGB()).putInt(this.getPlasmid().ID).putInt(this.getdDNA().ID).put((byte) (isBreedable() ? 1 : 0)).array(), 0, 17, 31); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java index f4e8917e67..1421f75c40 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java @@ -111,14 +111,14 @@ public class BioData { BioData bioData = (BioData) o; return this.getID() == bioData.getID() || ( this.getChance() == bioData.getChance() && - this.getTier() == bioData.getTier() && - Objects.equals(this.getName(), bioData.getName()) && - this.getRarity() == bioData.getRarity()); + this.getTier() == bioData.getTier() && + Objects.equals(this.getName(), bioData.getName()) && + this.getRarity() == bioData.getRarity()); } @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(13).putInt(MurmurHash3.murmurhash3_x86_32(this.getName(),0,this.getName().length(),31)).put(BW_Util.getByteFromRarity(this.getRarity())).putInt(this.getChance()).putInt(this.getTier()).array(),0,13,31); + return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(13).putInt(MurmurHash3.murmurhash3_x86_32(this.getName(), 0, this.getName().length(), 31)).put(BW_Util.getByteFromRarity(this.getRarity())).putInt(this.getChance()).putInt(this.getTier()).array(), 0, 13, 31); } public int getTier() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java index f61eee3c3c..4196a9eadc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java @@ -26,8 +26,8 @@ import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Map; -public class Pair implements Map.Entry { - Object[] pair= new Object[2]; +public class Pair implements Map.Entry { + Object[] pair = new Object[2]; public Pair(Object[] pair) { @@ -53,7 +53,7 @@ public class Pair implements Map.Entry { @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(8).putInt(pair[0].hashCode()).putInt(pair[1].hashCode()).array(),0,8,31); + return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(8).putInt(pair[0].hashCode()).putInt(pair[1].hashCode()).array(), 0, 8, 31); } @Override @@ -68,7 +68,7 @@ public class Pair implements Map.Entry { @Override public B setValue(Object value) { - pair[1]=value; + pair[1] = value; return (B) pair[1]; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 58d9f52d66..9cefea1a7d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -27,12 +27,11 @@ import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import net.minecraftforge.common.config.Configuration; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @Mod( - modid =BartWorksCrossmod.MOD_ID, name = BartWorksCrossmod.NAME, version = BartWorksCrossmod.VERSION, + modid = BartWorksCrossmod.MOD_ID, name = BartWorksCrossmod.NAME, version = BartWorksCrossmod.VERSION, dependencies = "required-after:IC2; " + "required-after:gregtech; " + "required-after:bartworks;" @@ -48,7 +47,7 @@ public class BartWorksCrossmod { public static BartWorksCrossmod instance; @Mod.EventHandler - public void preInit(FMLPreInitializationEvent preinit){ + public void preInit(FMLPreInitializationEvent preinit) { if (Loader.isModLoaded("GalacticraftCore")) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java index ccc11bef56..c3c7f7d3e6 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java @@ -31,15 +31,17 @@ import net.minecraftforge.common.config.Configuration; import java.io.File; -import static com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WorldGenRoss128.*; +import static com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WorldGenRoss128.init_OresRoss128; +import static com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WorldGenRoss128.init_undergroundFluidsRoss128; public class GalacticraftProxy { - private GalacticraftProxy(){} - static Configuration gtConf; public static GT_UO_DimensionList uo_dimensionList = new GT_UO_DimensionList(); + static Configuration gtConf; + private GalacticraftProxy() { + } - public static void preInit(FMLPreInitializationEvent e){ - if (FMLCommonHandler.instance().getSide().isServer() || FMLCommonHandler.instance().getEffectiveSide().isServer()){ + public static void preInit(FMLPreInitializationEvent e) { + if (FMLCommonHandler.instance().getSide().isServer() || FMLCommonHandler.instance().getEffectiveSide().isServer()) { serverpreInit(e); } else { clientpreInit(e); @@ -47,38 +49,48 @@ public class GalacticraftProxy { commonpreInit(e); } - private static void serverpreInit(FMLPreInitializationEvent e){ + private static void serverpreInit(FMLPreInitializationEvent e) { } - private static void clientpreInit(FMLPreInitializationEvent e){ + + private static void clientpreInit(FMLPreInitializationEvent e) { } - private static void commonpreInit(FMLPreInitializationEvent e){ - Configuration c = new Configuration(e.getSuggestedConfigurationFile()); + + private static void commonpreInit(FMLPreInitializationEvent e) { gtConf = new Configuration(new File(new File(e.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg")); uo_dimensionList.getConfig(gtConf, "undergroundfluid"); init_undergroundFluidsRoss128(); - gtConf.save(); - Ross128.ross128ID=c.get("System","DimID",-64,"The Dim ID for Ross128").getInt(-64); + if (gtConf.hasChanged()) + gtConf.save(); + + Configuration c = new Configuration(new File(e.getModConfigurationDirectory(), "bartworks.cfg")); + Ross128.ross128ID = c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64); + Ross128.enabled = c.get("CrossMod Interactions", "Galacticraft - Activate Ross128 System", true, "If the Ross128 System should be activated").getBoolean(true); + if (c.hasChanged()) + c.save(); + init_OresRoss128(); } - public static void init(FMLInitializationEvent e){ - if (FMLCommonHandler.instance().getSide().isServer() || FMLCommonHandler.instance().getEffectiveSide().isServer()){ + public static void init(FMLInitializationEvent e) { + if (FMLCommonHandler.instance().getSide().isServer() || FMLCommonHandler.instance().getEffectiveSide().isServer()) { serverInit(e); } else { clientInit(e); } commonInit(e); } - - private static void serverInit(FMLInitializationEvent e){ - + + private static void serverInit(FMLInitializationEvent e) { + } - private static void clientInit(FMLInitializationEvent e){ - + + private static void clientInit(FMLInitializationEvent e) { + } - private static void commonInit(FMLInitializationEvent e){ - Ross128.init(); + private static void commonInit(FMLInitializationEvent e) { + if (Ross128.enabled) + Ross128.init(); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java index 91c66768ab..742cee9a10 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java @@ -42,13 +42,13 @@ public class UniversalTeleportType implements ITeleportType { @Override public Vector3 getPlayerSpawnLocation(WorldServer world, EntityPlayerMP player) { - return getEntitySpawnLocation(world,player); + return getEntitySpawnLocation(world, player); } @Override public Vector3 getEntitySpawnLocation(WorldServer world, Entity entity) { - if (entity instanceof EntityPlayerMP){ - GCPlayerStats stats = GCPlayerStats.get((EntityPlayerMP)entity); + if (entity instanceof EntityPlayerMP) { + GCPlayerStats stats = GCPlayerStats.get((EntityPlayerMP) entity); return new Vector3(stats.coordsTeleportedFromX, 500D, stats.coordsTeleportedFromZ); } return new Vector3(entity.posX, 500D, entity.posZ); @@ -61,8 +61,7 @@ public class UniversalTeleportType implements ITeleportType { @Override public void onSpaceDimensionChanged(World newWorld, EntityPlayerMP player, boolean ridingAutoRocket) { - if ((player != null) && (GCPlayerStats.get(player).teleportCooldown <= 0)) - { + if ((player != null) && (GCPlayerStats.get(player).teleportCooldown <= 0)) { if (player.capabilities.isFlying) { player.capabilities.isFlying = false; } @@ -74,6 +73,7 @@ public class UniversalTeleportType implements ITeleportType { GCPlayerStats.get(player).teleportCooldown = 10; } } + @Override public void setupAdventureSpawn(EntityPlayerMP player) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java index 49a1bf9475..e3b8aaf3cf 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java @@ -30,14 +30,14 @@ public class SpaceTab extends CreativeTabs { private static final SpaceTab instance = new SpaceTab("SpaceTab"); - public static SpaceTab getInstance(){ - return instance; - } - private SpaceTab(String label) { super(label); } + public static SpaceTab getInstance() { + return instance; + } + @Override public Item getTabIconItem() { return ItemRegistry.DESTRUCTOPACK; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java index e222ab8c9c..5a80b62f75 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java @@ -50,13 +50,13 @@ public class BW_WordGenerator implements IWorldGenerator { } public static class WorldGenContainer implements Runnable { - public int mX; - public int mZ; + public static HashSet mGenerated = new HashSet<>(2000); public final int mDimensionType; public final World mWorld; public final IChunkProvider mChunkGenerator; public final IChunkProvider mChunkProvider; - public static HashSet mGenerated = new HashSet<>(2000); + public int mX; + public int mZ; public WorldGenContainer(int aX, int aZ, int aDimensionType, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { this.mX = aX; @@ -64,7 +64,8 @@ public class BW_WordGenerator implements IWorldGenerator { this.mDimensionType = aDimensionType; this.mWorld = aWorld; this.mChunkGenerator = aChunkGenerator; - this.mChunkProvider = aChunkProvider;; + this.mChunkProvider = aChunkProvider; + ; } //returns a coordinate of a center chunk of 3x3 square; the argument belongs to this square diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java index 3a1c3c2c95..0f49e7ee95 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java @@ -27,10 +27,6 @@ import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider.WorldProviderRoss128b; -import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import gregtech.GT_Mod; import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.world.GT_Worldgen; @@ -39,10 +35,8 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; -import net.minecraftforge.common.config.Configuration; import net.minecraftforge.fluids.FluidRegistry; -import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Random; @@ -54,39 +48,16 @@ import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.u */ public class BW_WorldGenRoss128 extends GT_Worldgen { + public static final List sList = new ArrayList<>(); private static final boolean logOregenRoss128 = false; - - public static void init_OresRoss128() { - new BW_WorldGenRoss128("ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, WerkstoffLoader.Thorianit, Materials.Uraninite, Materials.Lepidolite, Materials.Spodumene); - new BW_WorldGenRoss128("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Materials.Graphite, Materials.Diamond, Materials.Coal, Materials.Graphene); - new BW_WorldGenRoss128("ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, WerkstoffLoader.Bismuthinit, Materials.Stibnite, Materials.Bismuth, WerkstoffLoader.Bismutite); - new BW_WorldGenRoss128("ore.mix.ross128.TurmalinAlkali", true, 5, 200, 15, 4, 48, WerkstoffLoader.Olenit, WerkstoffLoader.FluorBuergerit, WerkstoffLoader.ChromoAluminoPovondrait, WerkstoffLoader.VanadioOxyDravit); - new BW_WorldGenRoss128("ore.mix.ross128.Roquesit", true, 5, 250, 3, 1, 12, WerkstoffLoader.Arsenopyrite, WerkstoffLoader.Ferberite, WerkstoffLoader.Loellingit, WerkstoffLoader.Roquesit); - new BW_WorldGenRoss128("ore.mix.ross128.Tungstate", true, 5, 250, 10, 4, 14, WerkstoffLoader.Ferberite, WerkstoffLoader.Huebnerit, WerkstoffLoader.Loellingit, Materials.Scheelite); - new BW_WorldGenRoss128("ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, WerkstoffLoader.Djurleit, WerkstoffLoader.Bornite, WerkstoffLoader.Wittichenit, Materials.Tetrahedrite); - new BW_WorldGenRoss128("ore.mix.ross128.magnetite", true, 60, 180, 50, 2, 32, Materials.Magnetite, Materials.Magnetite, Materials.Iron, Materials.VanadiumMagnetite); - new BW_WorldGenRoss128("ore.mix.ross128.gold", true, 30, 60, 50, 2, 32, Materials.Magnetite, Materials.Magnetite, Materials.VanadiumMagnetite, Materials.Gold); - new BW_WorldGenRoss128("ore.mix.ross128.iron", true, 10, 40, 40, 3, 24, Materials.BrownLimonite, Materials.YellowLimonite, Materials.BandedIron, Materials.Malachite); - } - - public static void init_undergroundFluidsRoss128(){ - String ross128b=StatCollector.translateToLocal("planet.Ross128b"); - uo_dimensionList.SetConfigValues(ross128b,ross128b,"veryheavyoil","liquid_extra_heavy_oil",0,625,40,5); - uo_dimensionList.SetConfigValues(ross128b,ross128b,"lava", FluidRegistry.getFluidName(FluidRegistry.LAVA),0,80000,5,5); - uo_dimensionList.SetConfigValues(ross128b,ross128b,"gas_natural_gas", "gas_natural_gas",0,625,65,5); - - } - - public byte bwOres = 0b0000; - public int mMinY,mWeight,mDensity,mSize,mMaxY,mPrimaryMeta,mSecondaryMeta,mBetweenMeta,mSporadicMeta; public static int sWeight; - public static final List sList = new ArrayList<>(); - + public byte bwOres = 0b0000; + public int mMinY, mWeight, mDensity, mSize, mMaxY, mPrimaryMeta, mSecondaryMeta, mBetweenMeta, mSporadicMeta; public BW_WorldGenRoss128(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { super(aName, sList, aDefault); this.mMinY = (short) aMinY; this.mMaxY = (short) aMaxY; - this.mWeight = (short)aWeight; + this.mWeight = (short) aWeight; this.mDensity = (short) aDensity; this.mSize = (short) Math.max(1, aSize); @@ -103,29 +74,25 @@ public class BW_WorldGenRoss128 extends GT_Worldgen { bwOres = (byte) (bwOres | 0b0001); short aPrimary = top instanceof Materials ? - (short) ((Materials)top).mMetaItemSubID: + (short) ((Materials) top).mMetaItemSubID : top instanceof Werkstoff ? - (short) ((Werkstoff)top).getmID(): - 0 - ; + (short) ((Werkstoff) top).getmID() : + 0; short aSecondary = bottom instanceof Materials ? - (short) ((Materials)bottom).mMetaItemSubID: + (short) ((Materials) bottom).mMetaItemSubID : bottom instanceof Werkstoff ? - (short) ((Werkstoff)bottom).getmID(): - 0 - ; + (short) ((Werkstoff) bottom).getmID() : + 0; short aBetween = between instanceof Materials ? - (short) ((Materials)between).mMetaItemSubID: + (short) ((Materials) between).mMetaItemSubID : between instanceof Werkstoff ? - (short) ((Werkstoff)between).getmID(): - 0 - ; + (short) ((Werkstoff) between).getmID() : + 0; short aSporadic = sprinkled instanceof Materials ? - (short) ((Materials)sprinkled).mMetaItemSubID: + (short) ((Materials) sprinkled).mMetaItemSubID : sprinkled instanceof Werkstoff ? - (short) ((Werkstoff)sprinkled).getmID(): - 0 - ; + (short) ((Werkstoff) sprinkled).getmID() : + 0; this.mPrimaryMeta = (short) aPrimary; this.mSecondaryMeta = (short) aSecondary; this.mBetweenMeta = (short) aBetween; @@ -133,6 +100,27 @@ public class BW_WorldGenRoss128 extends GT_Worldgen { } + public static void init_OresRoss128() { + new BW_WorldGenRoss128("ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, WerkstoffLoader.Thorianit, Materials.Uraninite, Materials.Lepidolite, Materials.Spodumene); + new BW_WorldGenRoss128("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Materials.Graphite, Materials.Diamond, Materials.Coal, Materials.Graphene); + new BW_WorldGenRoss128("ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, WerkstoffLoader.Bismuthinit, Materials.Stibnite, Materials.Bismuth, WerkstoffLoader.Bismutite); + new BW_WorldGenRoss128("ore.mix.ross128.TurmalinAlkali", true, 5, 200, 15, 4, 48, WerkstoffLoader.Olenit, WerkstoffLoader.FluorBuergerit, WerkstoffLoader.ChromoAluminoPovondrait, WerkstoffLoader.VanadioOxyDravit); + new BW_WorldGenRoss128("ore.mix.ross128.Roquesit", true, 5, 250, 3, 1, 12, WerkstoffLoader.Arsenopyrite, WerkstoffLoader.Ferberite, WerkstoffLoader.Loellingit, WerkstoffLoader.Roquesit); + new BW_WorldGenRoss128("ore.mix.ross128.Tungstate", true, 5, 250, 10, 4, 14, WerkstoffLoader.Ferberite, WerkstoffLoader.Huebnerit, WerkstoffLoader.Loellingit, Materials.Scheelite); + new BW_WorldGenRoss128("ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, WerkstoffLoader.Djurleit, WerkstoffLoader.Bornite, WerkstoffLoader.Wittichenit, Materials.Tetrahedrite); + new BW_WorldGenRoss128("ore.mix.ross128.magnetite", true, 60, 180, 50, 2, 32, Materials.Magnetite, Materials.Magnetite, Materials.Iron, Materials.VanadiumMagnetite); + new BW_WorldGenRoss128("ore.mix.ross128.gold", true, 30, 60, 50, 2, 32, Materials.Magnetite, Materials.Magnetite, Materials.VanadiumMagnetite, Materials.Gold); + new BW_WorldGenRoss128("ore.mix.ross128.iron", true, 10, 40, 40, 3, 24, Materials.BrownLimonite, Materials.YellowLimonite, Materials.BandedIron, Materials.Malachite); + } + + public static void init_undergroundFluidsRoss128() { + String ross128b = StatCollector.translateToLocal("planet.Ross128b"); + uo_dimensionList.SetConfigValues(ross128b, ross128b, "veryheavyoil", "liquid_extra_heavy_oil", 0, 625, 40, 5); + uo_dimensionList.SetConfigValues(ross128b, ross128b, "lava", FluidRegistry.getFluidName(FluidRegistry.LAVA), 0, 32767, 5, 5); + uo_dimensionList.SetConfigValues(ross128b, ross128b, "gas_natural_gas", "gas_natural_gas", 0, 625, 65, 5); + + } + @Override public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { return aWorld.provider instanceof WorldProviderRoss128b; @@ -140,19 +128,19 @@ public class BW_WorldGenRoss128 extends GT_Worldgen { @Override public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - { + { int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); int cX = aChunkX - aRandom.nextInt(this.mSize); int eX = aChunkX + 16 + aRandom.nextInt(this.mSize); - for(int tX = cX; tX <= eX; ++tX) { + for (int tX = cX; tX <= eX; ++tX) { int cZ = aChunkZ - aRandom.nextInt(this.mSize); int eZ = aChunkZ + 16 + aRandom.nextInt(this.mSize); - for(int tZ = cZ; tZ <= eZ; ++tZ) { + for (int tZ = cZ; tZ <= eZ; ++tZ) { int i; if (this.mSecondaryMeta > 0) { - for(i = tMinY - 1; i < tMinY + 2; ++i) { + for (i = tMinY - 1; i < tMinY + 2; ++i) { if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false); } @@ -164,7 +152,7 @@ public class BW_WorldGenRoss128 extends GT_Worldgen { } if (this.mPrimaryMeta > 0) { - for(i = tMinY + 3; i < tMinY + 6; ++i) { + for (i = tMinY + 3; i < tMinY + 6; ++i) { if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false); } @@ -186,10 +174,10 @@ public class BW_WorldGenRoss128 extends GT_Worldgen { } public boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre) { - if ((aMetaData == mSporadicMeta && (bwOres & 0b0001) != 0) || (aMetaData == mBetweenMeta && (bwOres & 0b0010) != 0) || (aMetaData == mPrimaryMeta && (bwOres & 0b1000) != 0) || (aMetaData == mSecondaryMeta && (bwOres & 0b0100) != 0)){ + if ((aMetaData == mSporadicMeta && (bwOres & 0b0001) != 0) || (aMetaData == mBetweenMeta && (bwOres & 0b0010) != 0) || (aMetaData == mPrimaryMeta && (bwOres & 0b1000) != 0) || (aMetaData == mSecondaryMeta && (bwOres & 0b0100) != 0)) { return BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false); } return GT_TileEntity_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, isSmallOre, false); } - + } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java index 1f9ce77b26..0476e4356c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java @@ -23,23 +23,19 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WordGenerator; -import gregtech.api.GregTech_API; import gregtech.api.objects.XSTR; -import gregtech.api.world.GT_Worldgen_Ore; import net.minecraft.block.Block; import net.minecraft.block.BlockFalling; import net.minecraft.entity.EnumCreatureType; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.biome.BiomeGenForest; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.ChunkProviderGenerate; import net.minecraft.world.gen.MapGenBase; import net.minecraft.world.gen.MapGenCaves; import net.minecraft.world.gen.MapGenRavine; -import net.minecraft.world.gen.feature.WorldGenCanopyTree; import net.minecraft.world.gen.feature.WorldGenLakes; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.PopulateChunkEvent; @@ -51,37 +47,35 @@ import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.Ev import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE; public class ChunkProviderRoss128b extends ChunkProviderGenerate { + XSTR rand = new XSTR(); private BiomeGenBase[] biomesForGeneration; - private BW_WordGenerator BWOreGen = new BW_WordGenerator(); - XSTR rand = new XSTR(); private World worldObj; private MapGenBase caveGenerator = new MapGenCaves(); private MapGenBase ravineGenerator = new MapGenRavine(); public ChunkProviderRoss128b(World par1World, long seed, boolean mapFeaturesEnabled) { super(par1World, seed, mapFeaturesEnabled); - worldObj=par1World; + worldObj = par1World; } @Override public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) { - return super.getPossibleCreatures(p_73155_1_, p_73155_2_, p_73155_3_, p_73155_4_); + return null; } - public Chunk provideChunk(int p_73154_1_, int p_73154_2_) - { - this.rand.setSeed((long)p_73154_1_ * 341873128712L + (long)p_73154_2_ * 132897987541L); + public Chunk provideChunk(int p_73154_1_, int p_73154_2_) { + this.rand.setSeed((long) p_73154_1_ * 341873128712L + (long) p_73154_2_ * 132897987541L); Block[] ablock = new Block[65536]; byte[] abyte = new byte[65536]; this.func_147424_a(p_73154_1_, p_73154_2_, ablock); this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); for (int i = 0; i < biomesForGeneration.length; i++) { BiomeGenBase biomeGenBase = biomesForGeneration[i]; - if (biomeGenBase.biomeID == BiomeGenBase.mushroomIsland.biomeID ){ - this.biomesForGeneration[i]=BiomeGenBase.taiga; - } else if (biomeGenBase.biomeID == BiomeGenBase.mushroomIslandShore.biomeID){ - this.biomesForGeneration[i]=BiomeGenBase.stoneBeach; + if (biomeGenBase.biomeID == BiomeGenBase.mushroomIsland.biomeID) { + this.biomesForGeneration[i] = BiomeGenBase.taiga; + } else if (biomeGenBase.biomeID == BiomeGenBase.mushroomIslandShore.biomeID) { + this.biomesForGeneration[i] = BiomeGenBase.stoneBeach; } } this.replaceBlocksForBiome(p_73154_1_, p_73154_2_, ablock, abyte, this.biomesForGeneration); @@ -91,9 +85,8 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { Chunk chunk = new Chunk(this.worldObj, ablock, abyte, p_73154_1_, p_73154_2_); byte[] abyte1 = chunk.getBiomeArray(); - for (int k = 0; k < abyte1.length; ++k) - { - abyte1[k] = (byte)this.biomesForGeneration[k].biomeID; + for (int k = 0; k < abyte1.length; ++k) { + abyte1[k] = (byte) this.biomesForGeneration[k].biomeID; } chunk.generateSkylightMap(); @@ -101,14 +94,13 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { } @Override - public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) - { + public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) { BlockFalling.fallInstantly = true; int k = p_73153_2_ * 16; int l = p_73153_3_ * 16; BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16); this.rand.setSeed(this.worldObj.getSeed()); - if (p_73153_2_%4==0 || p_73153_3_%4==0 ) { + if (p_73153_2_ % 4 == 0 || p_73153_3_ % 4 == 0) { long i1 = this.rand.nextLong() / 2L * 2L + 1L; long j1 = this.rand.nextLong() / 2L * 2L + 1L; this.rand.setSeed((long) p_73153_2_ * i1 + (long) p_73153_3_ * j1 ^ this.worldObj.getSeed()); @@ -122,8 +114,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { int i2; if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag && this.rand.nextInt(4) == 0 - && TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, LAKE)) - { + && TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, LAKE)) { k1 = k + this.rand.nextInt(16) + 8; l1 = this.rand.nextInt(256); i2 = l + this.rand.nextInt(16) + 8; @@ -136,26 +127,22 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { l += 8; boolean doGen = TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, ICE); - for (k1 = 0; doGen && k1 < 16; ++k1) - { - for (l1 = 0; l1 < 16; ++l1) - { + for (k1 = 0; doGen && k1 < 16; ++k1) { + for (l1 = 0; l1 < 16; ++l1) { i2 = this.worldObj.getPrecipitationHeight(k + k1, l + l1); - if (this.worldObj.isBlockFreezable(k1 + k, i2 - 1, l1 + l)) - { + if (this.worldObj.isBlockFreezable(k1 + k, i2 - 1, l1 + l)) { this.worldObj.setBlock(k1 + k, i2 - 1, l1 + l, Blocks.ice, 0, 2); } - if (this.worldObj.func_147478_e(k1 + k, i2, l1 + l, true)) - { + if (this.worldObj.func_147478_e(k1 + k, i2, l1 + l, true)) { this.worldObj.setBlock(k1 + k, i2, l1 + l, Blocks.snow_layer, 0, 2); } } } MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag)); - BWOreGen.generate(rand,p_73153_2_,p_73153_3_,worldObj,this,this); + BWOreGen.generate(rand, p_73153_2_, p_73153_3_, worldObj, this, this); BlockFalling.fallInstantly = false; } @@ -165,9 +152,8 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { } @Override - public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] blocks, byte[] metas, BiomeGenBase[] p_147422_5_) - { - super.replaceBlocksForBiome(p_147422_1_, p_147422_2_, blocks, metas, p_147422_5_); + public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] blocks, byte[] metas, BiomeGenBase[] p_147422_5_) { + super.replaceBlocksForBiome(p_147422_1_, p_147422_2_, blocks, metas, p_147422_5_); for (int i = 0; i < blocks.length; i++) { // if (blocks[i] == Blocks.stone) { // blocks[i] = Ross128.Ross128bStone.getBlock(); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b.java index a8039d0282..c6785ee78b 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b.java @@ -29,5 +29,5 @@ import net.minecraft.util.ResourceLocation; public class SkyProviderRoss128b extends SkyProviderOverworld { //ASM enables this texture - public static final ResourceLocation sunTex = new ResourceLocation(BartWorksCrossmod.MOD_ID+":galacticraft/Ross128b/World/SunRoss128.png"); + public static final ResourceLocation sunTex = new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/World/SunRoss128.png"); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b.java index c2b1e9d68a..6ed4b1bc6c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b.java @@ -43,26 +43,23 @@ public class WorldProviderRoss128b extends WorldProviderSpace implements IExitHe } @SideOnly(Side.CLIENT) - public Vec3 getFogColor(float cy, float noidea) - { - float angle = MathHelper.cos(cy * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + public Vec3 getFogColor(float cy, float noidea) { + float angle = MathHelper.cos(cy * (float) Math.PI * 2.0F) * 2.0F + 0.5F; - if (angle < 0.0F) - { + if (angle < 0.0F) { angle = 0.0F; } - if (angle > 1.0F) - { + if (angle > 1.0F) { angle = 1.0F; } - float red = 200/255f; - float green = 80/255f; + float red = 200 / 255f; + float green = 80 / 255f; float blue = 0.0F; red *= angle * 0.94F + 0.06F; green *= angle * 0.94F + 0.06F; - return Vec3.createVectorHelper((double)red, (double)green, (double)blue); + return Vec3.createVectorHelper((double) red, (double) green, (double) blue); } @@ -74,7 +71,7 @@ public class WorldProviderRoss128b extends WorldProviderSpace implements IExitHe @Override public float getSunBrightness(float par1) { - return super.getSunBrightness(par1)*0.975f; + return super.getSunBrightness(par1) * 0.975f; } @Override @@ -84,10 +81,10 @@ public class WorldProviderRoss128b extends WorldProviderSpace implements IExitHe @Override public Vector3 getSkyColor() { - float red = 200/255f; - float green = 120/255f; + float red = 200 / 255f; + float green = 120 / 255f; float blue = 0.0F; - return new Vector3(red,green,blue); + return new Vector3(red, green, blue); } @Override @@ -102,7 +99,7 @@ public class WorldProviderRoss128b extends WorldProviderSpace implements IExitHe @Override public long getDayLength() { - return (long) (24000*9.9f); + return (long) (24000 * 9.9f); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128.java index 5ce0d75e27..4caa6e02df 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128.java @@ -24,33 +24,30 @@ package com.github.bartimaeusnek.crossmod.galacticraft.solarsystems; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; -import com.github.bartimaeusnek.crossmod.galacticraft.blocks.UniversalSpaceBlocks; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider.WorldProviderRoss128b; import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; import micdoodle8.mods.galacticraft.api.galaxies.*; -import micdoodle8.mods.galacticraft.api.prefab.core.BlockMetaPair; import micdoodle8.mods.galacticraft.api.vector.Vector3; import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; -import micdoodle8.mods.galacticraft.core.GalacticraftCore; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import java.util.Arrays; public class Ross128 { - private Ross128(){} + public static boolean enabled = true; public static SolarSystem Ross128System; public static Star Ross128; public static Planet Ross128b; public static Moon Ross128ba; -// public static Block Ross128bBlocks; + // public static Block Ross128bBlocks; // public static BlockMetaPair Ross128bStone,Ross128bDirt,Ross128bGrass; public static int ross128ID = -64; + private Ross128() { + } + public static void init() { // Ross128bBlocks = new UniversalSpaceBlocks("Ross128bBlocks",new String[]{BartWorksCrossmod.MOD_ID+":Ross128bStone",BartWorksCrossmod.MOD_ID+":Ross128bDirt",BartWorksCrossmod.MOD_ID+":Ross128bGrass"}); @@ -58,22 +55,22 @@ public class Ross128 { Ross128System = new SolarSystem("Ross128System", "milkyWay").setMapPosition(new Vector3(-1.0D, 1.3D, 0.0D)); Ross128 = (Star) new Star("Ross128").setParentSolarSystem(Ross128System).setTierRequired(-1); Ross128.setUnreachable(); - Ross128.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID+":galacticraft/Ross128b/MapObjs/Ross128.png")); + Ross128.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128.png")); Ross128System.setMainStar(Ross128); Ross128b = new Planet("Ross128b").setParentSolarSystem(Ross128System); - Ross128b.setRingColorRGB((0x9F)/255f, (0x8A)/255f, (0x79)/255f); + Ross128b.setRingColorRGB((0x9F) / 255f, (0x8A) / 255f, (0x79) / 255f); Ross128b.setPhaseShift(1.25F); - Ross128b.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID+":galacticraft/Ross128b/MapObjs/Ross128b.png")); + Ross128b.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128b.png")); Ross128b.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(0.75F, 1.75F)); Ross128b.setRelativeOrbitTime(0.65F); - Ross128b.atmosphere.addAll(Arrays.asList(IAtmosphericGas.OXYGEN,IAtmosphericGas.NITROGEN,IAtmosphericGas.ARGON)); + Ross128b.atmosphere.addAll(Arrays.asList(IAtmosphericGas.OXYGEN, IAtmosphericGas.NITROGEN, IAtmosphericGas.ARGON)); Ross128b.setDimensionInfo(ross128ID, WorldProviderRoss128b.class); Ross128b.setTierRequired(Loader.isModLoaded("galaxyspace") ? 4 : Loader.isModLoaded("GalacticraftMars") ? 3 : -1); Ross128ba = new Moon("Ross128ba").setParentPlanet(Ross128b); - Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f,15f)).setRelativeOrbitTime(1 / 0.01F); - Ross128ba.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID+":galacticraft/Ross128b/MapObjs/Ross128ba.png")); + Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)).setRelativeOrbitTime(1 / 0.01F); + Ross128ba.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); Ross128ba.setUnreachable(); //for now // GameRegistry.registerBlock(Ross128bBlocks,Ross128bBlocks.getUnlocalizedName()); -- cgit From 913a24fa383a5beaad83f0a8f5eb04ea55385d62 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 8 Apr 2019 07:02:52 +0200 Subject: +added depts to build.grandle Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 8d24914f14b9b5dcb799bd337e9c870a7774fdf1 --- build.gradle | 5 +- build.properties | 4 +- .../github/bartimaeusnek/bartworks/MainMod.java | 2 - .../bartworks/system/material/ThreadedLoader.java | 74 ++++++++++++++++++++++ 4 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java diff --git a/build.gradle b/build.gradle index f2592e24f6..229a4f71c1 100644 --- a/build.gradle +++ b/build.gradle @@ -91,7 +91,10 @@ repositories { dependencies { compile "net.industrial-craft:industrialcraft-2:${config.ic2.version}:dev" - compileOnly "applecore:AppleCore:1.7.10-3.1.1:api" + compileOnly "applecore:AppleCore:${config.applecore.version}:api" + compile "micdoodle8.mods:MicdoodleCore:${config.galacticraft.version}:Dev" + compile "micdoodle8.mods:GalacticraftCore:${config.galacticraft.version}:Dev" + compile "micdoodle8.mods:Galacticraft-Planets:${config.galacticraft.version}:Dev" } //task getGregTech(type: Download) { diff --git a/build.properties b/build.properties index 12d78ec78d..c81d017315 100644 --- a/build.properties +++ b/build.properties @@ -27,4 +27,6 @@ buildNumber=3 APIVersion=5 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 -gregtech.jenkinsbuild=143 \ No newline at end of file +gregtech.jenkinsbuild=143 +applecore.version=1.7.10-3.1.1 +galacticraft.version=1.7-3.0.12.504 \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 8bde0e73b4..f668e85b4f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -38,8 +38,6 @@ import com.github.bartimaeusnek.bartworks.common.net.BW_Network; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.cropspp.ConfigValures; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WordGenerator; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java new file mode 100644 index 0000000000..e6f80e5e95 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java @@ -0,0 +1,74 @@ +///* +// * Copyright (c) 2019 bartimaeusnek +// * +// * Permission is hereby granted, free of charge, to any person obtaining a copy +// * of this software and associated documentation files (the "Software"), to deal +// * in the Software without restriction, including without limitation the rights +// * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// * copies of the Software, and to permit persons to whom the Software is +// * furnished to do so, subject to the following conditions: +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// * SOFTWARE. +// */ +// +//package com.github.bartimaeusnek.bartworks.system.material; +// +//import com.github.bartimaeusnek.bartworks.MainMod; +//import cpw.mods.fml.common.ProgressManager; +// +//import java.util.ArrayList; +//import java.util.List; +// +//import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +// +//public class ThreadedLoader implements Runnable { +// +// List threads = new ArrayList<>(); +// +// @Override +// public synchronized void run() { +// threads.add(new AllRecipes()); +// +// threads.forEach(Thread::start); +// +// +// } +// +// +// class AllRecipes extends Thread { +// +// public synchronized void run() { +// MainMod.LOGGER.info("Loading Processing Recipes for BW Materials"); +// long timepre = System.nanoTime(); +// ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashMap.size()); +// +// for (short i = 0; i < Werkstoff.werkstoffHashMap.size(); i++) { +// Werkstoff werkstoff = Werkstoff.werkstoffHashMap.get(i); +// if (werkstoff == null || werkstoff.getmID() < 0) { +// progressBar.step(""); +// continue; +// } +// addDustRecipes(werkstoff); +// addGemRecipes(werkstoff); +// addOreRecipes(werkstoff); +// addCrushedRecipes(werkstoff); +// progressBar.step(werkstoff.getDefaultName()); +// } +// ProgressManager.pop(progressBar); +// long timepost = System.nanoTime(); +// MainMod.LOGGER.info("Loading Processing Recipes for BW Materials took " + (timepost - timepre) + "ns/" + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); +// } +// } +// +// +// +//} -- cgit From 267a494c3931c31bdcc5a3d11b743cc63e364750 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 9 Apr 2019 09:10:21 +0200 Subject: Ore Dict Support +Added Y/Th Glas +Added OreDict support for all Materials +Added an Internal Handler for Colors +Added Materials and improved Compability to GT and GT++ +Improved Code Quality of the BW Oregen Handler +Fixed NEI handler +Version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 5b189e2b4257f523efb5313038a2c25c0ea5d424 --- build.properties | 2 +- .../ClientEventHandler/ClientEventHandler.java | 73 ++++- .../client/gui/GT_GUIContainer_RadioHatch.java | 6 +- .../bartworks/common/items/BW_ItemBlocks.java | 3 +- .../bartworks/common/items/LabParts.java | 3 +- .../bartworks/common/loaders/FluidLoader.java | 2 +- .../bartworks/common/loaders/ItemRegistry.java | 4 +- .../bartworks/common/net/RendererPacket.java | 6 +- .../tileentities/multis/GT_TileEntity_BioVat.java | 2 +- .../tiered/GT_MetaTileEntity_RadioHatch.java | 6 +- .../bartworks/neiHandler/BW_NEI_OreHandler.java | 46 ++- .../system/material/BW_MetaGenerated_Items.java | 8 +- .../system/material/BW_MetaGenerated_Ores.java | 5 +- .../bartworks/system/material/OreDictHandler.java | 52 ++++ .../bartworks/system/material/Werkstoff.java | 101 +++++- .../bartworks/system/material/WerkstoffLoader.java | 345 +++++++++++++++++---- .../processingLoaders/AdditionalRecipes.java | 44 +++ .../bartimaeusnek/bartworks/util/BW_ColorUtil.java | 284 +++++++++++++++++ .../bartimaeusnek/bartworks/util/BW_Util.java | 61 +--- .../bartimaeusnek/bartworks/util/BioCulture.java | 2 +- .../planets/ross128/world/oregen/BW_OreLayer.java | 150 +++++++++ .../ross128/world/oregen/BW_WordGenerator.java | 8 +- .../ross128/world/oregen/BW_WorldGenRoss128.java | 127 +------- .../resources/assets/bartworks/lang/en_US.lang | 1 + .../textures/blocks/ThoriumYttriumGlass.png | Bin 0 -> 184 bytes 25 files changed, 1048 insertions(+), 293 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/OreDictHandler.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_OreLayer.java create mode 100644 src/main/resources/assets/bartworks/textures/blocks/ThoriumYttriumGlass.png diff --git a/build.properties b/build.properties index c81d017315..8beb46ca1f 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=3 +buildNumber=4 APIVersion=5 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java index b2b152aee9..5888b88ef2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java @@ -23,46 +23,85 @@ package com.github.bartimaeusnek.bartworks.client.ClientEventHandler; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; -import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.system.material.OreDictHandler; +import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; +import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import net.minecraftforge.event.entity.player.ItemTooltipEvent; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; @SideOnly(Side.CLIENT) public class ClientEventHandler { + HashMap> cache = new HashMap<>(); + @SideOnly(Side.CLIENT) @SubscribeEvent(priority = EventPriority.HIGHEST) public void getTooltip(ItemTooltipEvent event) { - if (event.itemStack == null || event.itemStack.getItem() == null || Block.getBlockFromItem(event.itemStack.getItem()) == null || event.itemStack.getItemDamage() > 127) + if (event.itemStack == null || event.itemStack.getItem() == null || Block.getBlockFromItem(event.itemStack.getItem()) == null) return; - final Block BLOCK = Block.getBlockFromItem(event.itemStack.getItem()); - if (BLOCK instanceof BW_Blocks) { - return; - } - final BioVatLogicAdder.BlockMetaPair PAIR = new BioVatLogicAdder.BlockMetaPair(BLOCK, (byte) event.itemStack.getItemDamage()); - final HashMap GLASSMAP = BioVatLogicAdder.BioVatGlass.getGlassMap(); - if (GLASSMAP.containsKey(PAIR)) { - int tier = GLASSMAP.get(PAIR); - event.toolTip.add( - StatCollector.translateToLocal("tooltip.glas.0.name") + + if (!cache.containsKey(event.itemStack)) { + List tooAdd = new ArrayList<>(); + + for (ItemStack stack : OreDictHandler.getCache().values()) { + if (GT_Utility.areStacksEqual(event.itemStack, stack)) { + GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(stack.getItem()); + if (UI == null) + UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(stack.getItem())); + if (UI != null) { + for (ModContainer modContainer : Loader.instance().getModList()) { + if (UI.modId.equals(MainMod.MOD_ID) || UI.modId.equals(BartWorksCrossmod.MOD_ID) || UI.modId.equals("BWCore")) + break; + if (UI.modId.equals(modContainer.getModId())) { + tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + ChatColorHelper.GRAY + " and " + ChatColorHelper.RED + modContainer.getName()); + } + } + } else + tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + ChatColorHelper.GRAY + " and another Mod, that doesn't use the ModContainer propperly!"); + } + } + + final Block BLOCK = Block.getBlockFromItem(event.itemStack.getItem()); + if (BLOCK instanceof BW_Blocks) { + cache.put(event.itemStack, tooAdd); + return; + } + final BioVatLogicAdder.BlockMetaPair PAIR = new BioVatLogicAdder.BlockMetaPair(BLOCK, (byte) event.itemStack.getItemDamage()); + final HashMap GLASSMAP = BioVatLogicAdder.BioVatGlass.getGlassMap(); + if (GLASSMAP.containsKey(PAIR)) { + int tier = GLASSMAP.get(PAIR); + tooAdd.add( + StatCollector.translateToLocal("tooltip.glas.0.name") + + " " + + BW_ColorUtil.getColorForTier(tier) + GT_Values.VN[tier] + ChatColorHelper.RESET); + } else if (BLOCK.getMaterial().equals(Material.glass)) { + tooAdd.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " - + BW_Util.getColorForTier(tier) + GT_Values.VN[tier] + ChatColorHelper.RESET); - } else if (BLOCK.getMaterial().equals(Material.glass)) { - event.toolTip.add(StatCollector.translateToLocal("tooltip.glas.0.name") + - " " - + BW_Util.getColorForTier(3) + GT_Values.VN[3] + ChatColorHelper.RESET); + + BW_ColorUtil.getColorForTier(3) + GT_Values.VN[3] + ChatColorHelper.RESET); + } + cache.put(event.itemStack, tooAdd); + event.toolTip.addAll(tooAdd); + } else { + event.toolTip.addAll(cache.get(event.itemStack)); } } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java index 3cdaddc85b..2ae5bf6317 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java @@ -64,9 +64,9 @@ public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine this.drawTexturedModalRect(65, 13, 192, 0, (48 * (((GT_Container_RadioHatch) mContainer).sv)) / (maxSv), 16); -// this.fontRendererObj.drawString("Sv: " + ((GT_Container_RadioHatch) mContainer).sievert, 8, 50, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); -// this.fontRendererObj.drawString("Kg: " + ((GT_Container_RadioHatch) mContainer).mass, 8, 68, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); -// this.fontRendererObj.drawString("Time: " + timer, 8, 76, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); +// this.fontRendererObj.drawString("Sv: " + ((GT_Container_RadioHatch) mContainer).sievert, 8, 50, BW_Util.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); +// this.fontRendererObj.drawString("Kg: " + ((GT_Container_RadioHatch) mContainer).mass, 8, 68, BW_Util.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); +// this.fontRendererObj.drawString("Time: " + timer, 8, 76, BW_Util.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index ea0457dcc6..86ea3198eb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; +import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.relauncher.Side; @@ -67,7 +68,7 @@ public class BW_ItemBlocks extends ItemBlock { @SideOnly(Side.CLIENT) public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { if (this.field_150939_a instanceof BW_GlasBlocks) - aList.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + BW_Util.getColorForTier(BW_Util.getTierFromGlasMeta(aStack.getItemDamage())) + GT_Values.VN[BW_Util.getTierFromGlasMeta(aStack.getItemDamage())]); + aList.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + BW_ColorUtil.getColorForTier(BW_Util.getTierFromGlasMeta(aStack.getItemDamage())) + GT_Values.VN[BW_Util.getTierFromGlasMeta(aStack.getItemDamage())]); if (this.field_150939_a instanceof ITileAddsInformation) { for (int i = 0; i < ((ITileAddsInformation) this.field_150939_a).getInfoData().length; i++) { aList.add(((ITileAddsInformation) this.field_150939_a).getInfoData()[i]); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java index c04a449103..5aeed95774 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -66,7 +67,7 @@ public class LabParts extends SimpleSubItemClass { public int getColorFromItemStack(ItemStack stack, int p_82790_2_) { if (stack.getItemDamage() == 0 && stack.getTagCompound() != null && stack.getTagCompound().getIntArray("Color") != null && stack.getTagCompound().getIntArray("Color").length > 0) { int[] rgb = stack.getTagCompound().getIntArray("Color"); - return BW_Util.getColorFromArray(rgb); + return BW_ColorUtil.getColorFromRGBArray(rgb); } return super.getColorFromItemStack(stack, p_82790_2_); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index f4fc82a7db..1b56e588c5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -69,7 +69,7 @@ public class FluidLoader implements Runnable { BioLabFluidCells[i] = ItemFluidCell.getUniversalFluidCell(new FluidStack(BioLabFluidMaterials[i], 1000)); } -// BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", BW_Util.splitColortoArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB()))); +// BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", BW_Util.splitColorToRBGArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB()))); for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.isBreedable()) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index a12e787ada..20911d4361 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -38,6 +38,7 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_Til import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_AcidGenerator; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_Diode; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_EnergyDistributor; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -91,8 +92,9 @@ public class ItemRegistry { MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock4", MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock5", MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock6", + MainMod.MOD_ID + ":ThoriumYttriumGlass", }, - new short[][]{Materials.BorosilicateGlass.getRGBA(), Materials.Nickel.getRGBA(), Materials.Tungsten.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), Materials.Osmium.getRGBA(), new short[]{0xff, 0, 0}, new short[]{0, 0xff, 0}, new short[]{0x80, 0, 0xff}, new short[]{0xff, 0xff, 0}, new short[]{0, 0xff, 0x80}, new short[]{0x80, 0x33, 0}}, + new short[][]{Materials.BorosilicateGlass.getRGBA(), Materials.Nickel.getRGBA(), Materials.Tungsten.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), Materials.Osmium.getRGBA(), new short[]{0xff, 0, 0}, new short[]{0, 0xff, 0}, new short[]{0x80, 0, 0xff}, new short[]{0xff, 0xff, 0}, new short[]{0, 0xff, 0x80}, new short[]{0x80, 0x33, 0}, WerkstoffLoader.YttriumOxide.getRGBA()}, MainMod.BIO_TAB, true, false ) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java index 71aa50c824..a5f5f4089f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -24,7 +24,7 @@ package com.github.bartimaeusnek.bartworks.common.net; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; -import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.Coords; import com.google.common.io.ByteArrayDataInput; import cpw.mods.fml.common.FMLCommonHandler; @@ -73,7 +73,7 @@ public class RendererPacket extends GT_Packet { // public void decodetest (byte[] buffer){ // this.coords=new Coords(ByteBuffer.wrap(buffer).getInt(0),ByteBuffer.wrap(buffer).getShort(4),ByteBuffer.wrap(buffer).getInt(6),ByteBuffer.wrap(buffer).getInt(10)); // int[] rgb = {ByteBuffer.wrap(buffer).get(14)-Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(15)-Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(16)-Byte.MIN_VALUE}; -// this.integer= BW_Util.getColorFromArray(rgb); +// this.integer= BW_Util.getColorFromRGBArray(rgb); // this.removal=ByteBuffer.wrap(buffer).get(17); // // byte checksum = (byte) (coords.x%25+coords.y%25+coords.z%25+coords.wID%25+integer%25+removal); @@ -87,7 +87,7 @@ public class RendererPacket extends GT_Packet { this.coords = new Coords(ByteBuffer.wrap(buffer).getInt(0), ByteBuffer.wrap(buffer).getShort(4), ByteBuffer.wrap(buffer).getInt(6), ByteBuffer.wrap(buffer).getInt(10)); int[] rgb = {ByteBuffer.wrap(buffer).get(14) - Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(15) - Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(16) - Byte.MIN_VALUE}; - this.integer = BW_Util.getColorFromArray(rgb); + this.integer = BW_ColorUtil.getColorFromRGBArray(rgb); this.removal = ByteBuffer.wrap(buffer).get(17); byte checksum = (byte) (coords.x % 25 + coords.y % 25 + coords.z % 25 + coords.wID % 25 + integer % 25 + removal); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 7042fba1b8..76625e06bc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -336,7 +336,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private byte calculateGlassTier(@Nonnull Block block, @Nonnegative Byte meta) { if (block.equals(ItemRegistry.bw_glasses[0])) - return meta > 1 && meta < 6 ? (byte) (meta + 3) : 4; + return meta == 12 ? 5 : meta > 1 && meta < 6 ? (byte) (meta + 3) : 4; if (block.getUnlocalizedName().equals("blockAlloyGlass")) return 4; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 479681d492..63ba6660a1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -26,7 +26,7 @@ import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; -import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -295,7 +295,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { aNBT.setByte("mMass", mass); aNBT.setByte("mSv", (byte) (sievert - 100)); aNBT.setByte("mCoverage", coverage); - aNBT.setInteger("mTextColor", BW_Util.getColorFromArray(getColorForGUI())); + aNBT.setInteger("mTextColor", BW_ColorUtil.getColorFromRGBArray(getColorForGUI())); if (material != null && !material.isEmpty()) aNBT.setString("mMaterial", material); aNBT.setLong("timer", timer); @@ -312,7 +312,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { mass = aNBT.getByte("mMass"); sievert = aNBT.getByte("mSv") + 100; coverage = aNBT.getByte("mCoverage"); - colorForGUI = BW_Util.splitColortoArray(aNBT.getInteger("mTextColor")); + colorForGUI = BW_ColorUtil.splitColorToRBGArray(aNBT.getInteger("mTextColor")); material = aNBT.getString("mMaterial"); super.loadNBTData(aNBT); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index 38104bf7f2..5360268200 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -31,13 +31,16 @@ import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_OreLayer; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WorldGenRoss128; import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.GregTech_API; -import gregtech.common.GT_Worldgen_GT_Ore_Layer; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; +import java.awt.*; import java.util.ArrayList; import java.util.List; @@ -58,15 +61,23 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void loadTransferRects() { -// transferRects.add(new RecipeTransferRect(new Rectangle(0,40,40,10),"quickanddirtyneihandler")); + transferRects.add(new RecipeTransferRect(new Rectangle(0,40,40,10),"quickanddirtyneihandler")); + } + + @Override + public int recipiesPerPage() { + return 1; } @Override public void loadCraftingRecipes(String outputId, Object... results) { if (outputId.equalsIgnoreCase("quickanddirtyneihandler")) { for (int i = 0; i < Werkstoff.werkstoffHashMap.values().size(); i++) { - ItemStack result = new ItemStack(WerkstoffLoader.BWOres, 1, i); - if (Block.getBlockFromItem(result.getItem()) instanceof BW_MetaGenerated_Ores) { + Werkstoff w = Werkstoff.werkstoffHashMap.get((short)i); + if (w == null || w == Werkstoff.default_null_Werkstoff) + continue; + if (w.getGenerationFeatures().hasOres()) { + ItemStack result = w.get(OrePrefixes.ore); CachedRecipe tmp = new CachedRecipe() { PositionedStack stack = new PositionedStack(result, 0, 0); @@ -79,10 +90,10 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public List getOtherStacks() { ArrayList ret = new ArrayList<>(); - for (int i = 0; i < GT_Worldgen_GT_Ore_Layer.sList.size(); i++) { - if (BW_WorldGenRoss128.sList.get(i) instanceof BW_WorldGenRoss128) { + for (int i = 0; i < BW_OreLayer.sList.size(); i++) { + if (BW_OreLayer.sList.get(i) instanceof BW_WorldGenRoss128) { int baseMeta = result.getItemDamage(); - BW_WorldGenRoss128 worldGen = ((BW_WorldGenRoss128) BW_WorldGenRoss128.sList.get(i)); + BW_WorldGenRoss128 worldGen = ((BW_WorldGenRoss128) BW_OreLayer.sList.get(i)); if (worldGen.mPrimaryMeta == baseMeta || worldGen.mSecondaryMeta == baseMeta || worldGen.mBetweenMeta == baseMeta || worldGen.mSporadicMeta == baseMeta) { ItemStack other; other = result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore", "Vein")); @@ -130,7 +141,15 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { return ret; } }; - this.arecipes.add(tmp); + boolean add = true; + for (TemplateRecipeHandler.CachedRecipe recipe: arecipes) { + if (recipe == null || recipe.getOtherStacks() == null || recipe.getOtherStacks().get(0) == null || recipe.getOtherStacks().get(0).item == null) + continue; + if (GT_Utility.areStacksEqual(recipe.getOtherStacks().get(0).item,tmp.getOtherStacks().get(0).item)) + add = false; + } + if (add) + this.arecipes.add(tmp); } } } else super.loadCraftingRecipes(outputId, results); @@ -138,7 +157,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void drawExtras(int recipe) { - + if ((recipe < this.arecipes.size()) && (this.arecipes.get(recipe).getOtherStacks().size() >= 4) ) { GuiDraw.drawString(ChatColorHelper.BOLD + "DIM:" + ChatColorHelper.RESET + " Ross128", 0, 40, 0, false); GuiDraw.drawString(ChatColorHelper.BOLD + "Primary:", 0, 50, 0, false); GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(0).item.getDisplayName(), 0, 60, 0, false); @@ -148,6 +167,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(2).item.getDisplayName(), 0, 100, 0, false); GuiDraw.drawString(ChatColorHelper.BOLD + "Sporadic:", 0, 110, 0, false); GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(3).item.getDisplayName(), 0, 120, 0, false); + } super.drawExtras(recipe); } @@ -166,10 +186,10 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public List getOtherStacks() { ArrayList ret = new ArrayList<>(); - for (int i = 0; i < GT_Worldgen_GT_Ore_Layer.sList.size(); i++) { - if (BW_WorldGenRoss128.sList.get(i) instanceof BW_WorldGenRoss128) { + for (int i = 0; i < BW_OreLayer.sList.size(); i++) { + if (BW_OreLayer.sList.get(i) instanceof BW_WorldGenRoss128) { int baseMeta = result.getItemDamage(); - BW_WorldGenRoss128 worldGen = ((BW_WorldGenRoss128) BW_WorldGenRoss128.sList.get(i)); + BW_WorldGenRoss128 worldGen = ((BW_WorldGenRoss128) BW_OreLayer.sList.get(i)); if (worldGen.mPrimaryMeta == baseMeta || worldGen.mSecondaryMeta == baseMeta || worldGen.mBetweenMeta == baseMeta || worldGen.mSporadicMeta == baseMeta) { ItemStack other; other = result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore", "Vein")); @@ -228,6 +248,6 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public String getRecipeName() { - return "OreShit"; + return "BartWorks Ores"; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index cbdfd9f2d4..72db71e58d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import cpw.mods.fml.common.Loader; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Materials; @@ -41,6 +42,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; +import net.minecraftforge.oredict.OreDictionary; import java.util.List; @@ -65,11 +67,11 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item { for (int i = 0; i < aNumToGen; i++) { ItemStack tStack = new ItemStack(this, 1, i); Werkstoff w = werkstoffHashMap.get((short) i); - if (w == null || ((w.getGenerationFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) == 0)) + if (w == null || ((w.getGenerationFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) == 0) || ((w.getGenerationFeatures().blacklist & orePrefixes.mMaterialGenerationBits) != 0) ) continue; GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", this.getDefaultLocalization(w)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); - GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.getDefaultName(), tStack); + GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.getDefaultName().replaceAll(" ",""), tStack); } } @@ -133,7 +135,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item { public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { for (int i = 0; i < aNumToGen; i++) { Werkstoff werkstoff = werkstoffHashMap.get((short) i); - if (werkstoff != null && ((werkstoff.getGenerationFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) != 0)) { + if (werkstoff != null && ((werkstoff.getGenerationFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) != 0) && ((werkstoff.getGenerationFeatures().blacklist & orePrefixes.mMaterialGenerationBits) == 0)) { ItemStack tStack = new ItemStack(this, 1, i); aList.add(tStack); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 088f4040fc..862de3cd98 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -58,11 +58,10 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { this.setCreativeTab(metaTab); for (Werkstoff w : Werkstoff.werkstoffHashSet) { if (w != null) { - if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0) + if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0 || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) continue; GT_ModHandler.addValuableOre(this, w.getmID(), 1); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + w.getmID() + ".name", w.getDefaultName() + OrePrefixes.ore.mLocalizedMaterialPost); - GT_OreDictUnificator.registerOre(OrePrefixes.ore + w.getDefaultName(), new ItemStack(this, 1, w.getmID())); } } } @@ -160,7 +159,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { for (int i = 0; i < Werkstoff.werkstoffHashSet.size(); i++) { Werkstoff tMaterial = Werkstoff.werkstoffHashMap.get((short) i); - if ((tMaterial != null) && ((tMaterial.getGenerationFeatures().toGenerate & 0x8) != 0)) { + if ((tMaterial != null) && ((tMaterial.getGenerationFeatures().toGenerate & 0x8) != 0) && ((tMaterial.getGenerationFeatures().blacklist & 0x8) == 0)) { aList.add(new ItemStack(aItem, 1, i)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/OreDictHandler.java new file mode 100644 index 0000000000..0715d00a90 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/OreDictHandler.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import gregtech.api.enums.OrePrefixes; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.HashMap; + +public class OreDictHandler { + + private static final HashMap cache = new HashMap<>(); + + public static HashMap getCache() { + return OreDictHandler.cache; + } + + public static ItemStack getItemStack(String elementName, OrePrefixes prefixes, int amount){ + if (cache.get(prefixes+elementName.replaceAll(" ","")) != null){ + ItemStack tmp = cache.get(prefixes+elementName.replaceAll(" ","")).copy(); + tmp.stackSize=amount; + return tmp; + } else if (!OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).isEmpty()){ + ItemStack tmp = OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).get(0).copy(); + tmp.stackSize=amount; + cache.put(prefixes+elementName.replaceAll(" ",""),tmp); + return tmp; + } + return null; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 65ab699c57..3ade8d123d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material; +import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MurmurHash3; import com.github.bartimaeusnek.bartworks.util.Pair; import gregtech.api.enums.Materials; @@ -65,12 +67,14 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { default_null_Werkstoff = new Werkstoff(new short[3], "_NULL", "Default null Werkstoff", DEFAULT_NULL_STATS, Werkstoff.Types.UNDEFINED, DEFAULT_NULL_GENERATION_FEATURES, -1, TextureSet.SET_NONE); } - + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { + this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, contents); + } public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { - this(rgba, defaultName, Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents); + this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents); } public Werkstoff(short[] rgba, String toolTip, String defaultName, Werkstoff.Types type, GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { - this(rgba, toolTip, defaultName, Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents); + this(rgba, toolTip, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents); } public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { @@ -100,7 +104,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.type = type; this.mID = (short) mID; this.generationFeatures = generationFeatures; - this.setRgb(rgba); + this.setRgb(BW_ColorUtil.correctCorlorArray(rgba)); this.contents.addAll(Arrays.asList(contents)); this.toolTip = ""; if (toolTip.isEmpty()) { @@ -138,6 +142,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { werkstoffHashMap.put(this.mID, this); } + + + public Werkstoff.Types getType() { + return this.type; + } + public Pair>> getContents() { int ret = 0; switch (this.type) { @@ -159,16 +169,29 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return mOreByProducts.size(); } - public ItemStack getOreByProduct(int aNumber, OrePrefixes prefixes) { + public ISubTagContainer getOreByProductRaw(int aNumber){ if (mOreByProducts.size() == 0) return null; if (aNumber < 0) aNumber = mOreByProducts.size() + aNumber; while (aNumber >= mOreByProducts.size()) aNumber--; - Object o = mOreByProducts.get(aNumber); + ISubTagContainer o = mOreByProducts.get(aNumber); if (o == null || o.equals(default_null_Werkstoff) || o.equals(Materials._NULL)) + return this; + return o; + } + + public ItemStack getOreByProduct(int aNumber, OrePrefixes prefixes) { + if (mOreByProducts.size() == 0) return null; + if (aNumber < 0) + aNumber = mOreByProducts.size() + aNumber; + while (aNumber >= mOreByProducts.size()) + aNumber--; + Object o = mOreByProducts.get(aNumber); + if (o == null||o.equals(default_null_Werkstoff) || o.equals(Materials._NULL)) + return this.get(prefixes); if (o instanceof Werkstoff) return WerkstoffLoader.getCorresopndingItemStack(prefixes, (Werkstoff) o); if (o instanceof Materials) @@ -239,9 +262,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public enum Types { - MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, UNDEFINED; + MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, ELEMENT, UNDEFINED; - public static Stats getDefaultStatForType(Types T) { + public static Stats getDefaultStatForType(Werkstoff.Types T) { switch (T) { case COMPOUND: case BIOLOGICAL: @@ -263,9 +286,63 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { ore 1000 */ public byte toGenerate = 0b0001001; + public byte blacklist = 0b0000000; + public GenerationFeatures setBlacklist(OrePrefixes p){ + if (p == OrePrefixes.dustTiny || p == OrePrefixes.dust || p == OrePrefixes.dustSmall || p == OrePrefixes.crateGtDust){ + blacklist |= 1; + }else + blacklist |= p.mMaterialGenerationBits; + return this; + } + + public boolean hasDusts() { + return (toGenerate & 0b1) != 0; + } public boolean hasGems() { - return (toGenerate & 4) != 0; + return (toGenerate & 0b100) != 0; + } + public boolean hasOres() { + return (toGenerate & 0b1000) != 0; + } + + public GenerationFeatures removeGems(){ + if (hasGems()) + toGenerate = (byte) (toGenerate ^ 0b100); + return this; + } + + public GenerationFeatures removeDusts(){ + if (hasDusts()) + toGenerate = (byte) (toGenerate ^ 0b1); + return this; + } + public GenerationFeatures removeOres(){ + if (hasOres()) + toGenerate = (byte) (toGenerate ^ 0b1000); + return this; + } + /* + * Auto add Chemical Recipes 1 + * Auto add mixer Recipes 10 + * Auto add Sifter Recipe 100 + */ + public byte extraRecipes = 0b0; + + public GenerationFeatures addChemicalRecipes(){ + this.extraRecipes = (byte) (this.extraRecipes | 1); + return this; + } + public boolean hasChemicalRecipes() { + return (extraRecipes & 1) != 0; + } + + public GenerationFeatures addSifterRecipes(){ + this.extraRecipes = (byte) (this.extraRecipes | 100); + return this; + } + public boolean hasSifterRecipes() { + return (extraRecipes & 100) != 0; } public GenerationFeatures onlyDust() { @@ -273,6 +350,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } + + public GenerationFeatures disable() { + toGenerate = (byte) (0); + return this; + } + public GenerationFeatures addGems() { toGenerate = (byte) (toGenerate | 0x4); return this; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 948051eff8..043dfd1f7d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -25,14 +25,22 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.API.WerkstoffAdderRegistry; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; +import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes; +import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ProgressManager; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.GT_Mod; +import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.objects.GT_MultiTexture; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.MaterialStack; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -40,11 +48,9 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; +import java.util.*; import static gregtech.api.enums.OrePrefixes.*; @@ -54,6 +60,8 @@ public class WerkstoffLoader implements Runnable { public static final WerkstoffLoader INSTANCE = new WerkstoffLoader(); + //TODO: FREE ID RANGE: 19-32766 + public static final Werkstoff Bismutite = new Werkstoff( new short[]{255, 233, 0, 0}, "Bismutite", @@ -77,9 +85,31 @@ public class WerkstoffLoader implements Runnable { new Pair(Materials.Bismuth, 2), new Pair(Materials.Sulfur, 3) ); + public static final Werkstoff Zirconium = new Werkstoff( + new short[]{175, 175, 175, 0}, + "Zirconium", + "Zr", + new Werkstoff.Stats().setProtons(40), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().onlyDust(), + 3, + TextureSet.SET_METALLIC, + Arrays.asList() + ); + public static final Werkstoff Zirconia = new Werkstoff( + new short[]{255, 255, 255, 0}, + "Cubic Zirconia", + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().onlyDust().addGems(), + 4, + TextureSet.SET_DIAMOND, + Arrays.asList(WerkstoffLoader.Zirconium), + new Pair(WerkstoffLoader.Zirconium, 1), + new Pair(Materials.Oxygen, 2) + ); public static final Werkstoff FluorBuergerit = new Werkstoff( new short[]{0x20, 0x20, 0x20, 0}, - "Fluor-Buergerit", + "Fluor-Buergerite", "NaFe3Al6(Si6O18)(BO3)3O3F", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), @@ -94,6 +124,16 @@ public class WerkstoffLoader implements Runnable { new Pair(Materials.Oxygen, 30), new Pair(Materials.Fluorine, 1) ); + public static final Werkstoff YttriumOxide = new Werkstoff( + new short[]{255,255,255,0}, + "Yttrium Oxide", + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().onlyDust(), //No autoadd here to gate this material by hand + 6, + TextureSet.SET_DULL, + new Pair(Materials.Yttrium, 2), + new Pair(Materials.Oxygen, 3) + ); public static final Werkstoff ChromoAluminoPovondrait = new Werkstoff( new short[]{0, 0x79, 0x6A, 0}, "Chromo-Alumino-Povondraite", @@ -130,8 +170,6 @@ public class WerkstoffLoader implements Runnable { new Pair(Materials.Oxygen, 31), new Pair(Materials.Hydrogen, 3) ); - - //TODO: FREE ID RANGE: 3,4,6,19-32766 public static final Werkstoff Olenit = new Werkstoff( new short[]{210, 210, 210, 0}, "Olenite", @@ -245,15 +283,169 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff Thorianit = new Werkstoff( new short[]{0x30, 0x30, 0x30, 0}, - "Thorianit", + "Thorianite", Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), + new Werkstoff.GenerationFeatures().addChemicalRecipes(), 18, TextureSet.SET_METALLIC, Arrays.asList(Materials.Thorium), new Pair(Materials.Thorium, 1), new Pair(Materials.Oxygen, 2) ); + public static final Werkstoff RedZircon = new Werkstoff( + new short[]{195, 19, 19, 0}, + "Red Zircon", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 19, + TextureSet.SET_GEM_VERTICAL, + Arrays.asList(WerkstoffLoader.Zirconium,Materials.Silicon), + new Pair(WerkstoffLoader.Zirconium, 1), + new Pair(Materials.Silicon, 1), + new Pair(Materials.Oxygen, 4) + ); + + //GT Enhancements + public static final Werkstoff Salt = new Werkstoff( + Materials.Salt.mRGBa, + "Salt", + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addGems().addSifterRecipes(), + 20, + TextureSet.SET_FLINT, + Arrays.asList(Materials.RockSalt,Materials.Borax), + new Pair(Materials.Salt, 1) + ); + public static final Werkstoff Spodumen = new Werkstoff( + Materials.Spodumene.mRGBa, + "Spodumene", + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addGems().addSifterRecipes(), + 21, + TextureSet.SET_FLINT, + Arrays.asList(Materials.Spodumene), + new Pair(Materials.Spodumene, 1) + ); + public static final Werkstoff RockSalt = new Werkstoff( + Materials.RockSalt.mRGBa, + "Rock Salt", + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addGems().addSifterRecipes(), + 22, + TextureSet.SET_FLINT, + Arrays.asList(Materials.RockSalt,Materials.Borax), + new Pair(Materials.RockSalt, 1) + ); + public static final Werkstoff Fayalit = new Werkstoff( + new short[]{50,50,50,0}, + "Fayalite", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 23, + TextureSet.SET_QUARTZ, + Arrays.asList(Materials.Iron,Materials.Silicon), + new Pair(Materials.Iron, 2), + new Pair(Materials.Silicon, 1), + new Pair(Materials.Oxygen, 4) + ); + public static final Werkstoff Forsterit = new Werkstoff( + new short[]{150,150,150,0}, + "Forsterite", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 24, + TextureSet.SET_QUARTZ, + Arrays.asList(Materials.Magnesium,Materials.Silicon), + new Pair(Materials.Magnesium, 2), + new Pair(Materials.Silicon, 1), + new Pair(Materials.Oxygen, 4) + ); + public static final Werkstoff Hedenbergit = new Werkstoff( + new short[]{100,150,100,0}, + "Hedenbergite", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 25, + TextureSet.SET_QUARTZ, + Arrays.asList(Materials.Iron,Materials.Calcium,Materials.Silicon), + new Pair(Materials.Calcium, 1), + new Pair(Materials.Iron, 1), + new Pair(Materials.Silicon, 2), + new Pair(Materials.Oxygen, 6) + ); + public static final Werkstoff DescolizitZNVO4 = new Werkstoff( + new short[]{100,60,30,0}, + "Descolizite(ZnVO4)",//Pb(Zn,Cu)[OH|VO4 + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 26, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Lead,Materials.Copper,Materials.Vanadium), + new Pair(Materials.Lead, 1), + new Pair(Materials.Zinc, 1), + new Pair(Materials.Vanadium, 1), + new Pair(Materials.Oxygen, 4) + ); + public static final Werkstoff DescolizitCUVO4 = new Werkstoff( + new short[]{100,60,30,0}, + "Descolizite(CuVO4)",//Pb(Zn,Cu)[OH|VO4 + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 27, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Lead,Materials.Zinc,Materials.Vanadium), + new Pair(Materials.Lead, 1), + new Pair(Materials.Copper, 1), + new Pair(Materials.Vanadium, 1), + new Pair(Materials.Oxygen, 4) + ); + public static final Werkstoff FuchsitAL = new Werkstoff( + new short[]{0x4D,0x7F,0x64,0}, + "Fuchsite(Al)", + "KAl3Si3O10(OH)2", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 28, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Potassium,Materials.Aluminium,Materials.Silicon), + new Pair(Materials.Potassium, 1), + new Pair(Materials.Aluminium, 3), + new Pair(Materials.Silicon, 3), + new Pair(Materials.Oxygen, 12), + new Pair(Materials.Hydrogen, 2) + + ); + public static final Werkstoff FuchsitCR = new Werkstoff( + new short[]{128,0,0,0}, + "Fuchsite(Cr)", + "KCr3Si3O10(OH)2", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 29, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Potassium,Materials.Chrome,Materials.Silicon), + new Pair(Materials.Potassium, 1), + new Pair(Materials.Chrome, 3), + new Pair(Materials.Silicon, 3), + new Pair(Materials.Oxygen, 12), + new Pair(Materials.Hydrogen, 2) + + ); + + + + public static HashMap items = new HashMap<>(); public static Block BWOres; public boolean registered = false; @@ -263,6 +455,9 @@ public class WerkstoffLoader implements Runnable { } public static ItemStack getCorresopndingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { + ItemStack ret = OreDictHandler.getItemStack(werkstoff.getDefaultName(),orePrefixes,amount); + if (ret != null) + return ret; if (orePrefixes == ore) return new ItemStack(BWOres, amount, werkstoff.getmID()); return new ItemStack(items.get(orePrefixes), amount, werkstoff.getmID()).copy(); @@ -274,9 +469,14 @@ public class WerkstoffLoader implements Runnable { } public void runInit() { + MainMod.LOGGER.info("Making Meta Items for BW Materials"); + long timepre = System.nanoTime(); WerkstoffAdderRegistry.getINSTANCE().run(); addSubTags(); addItemsForGeneration(); + runAdditionalOreDict(); + long timepost = System.nanoTime(); + MainMod.LOGGER.info("Making Meta Items for BW Materials took " + (timepost - timepre) + "ns/" + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); } @Override @@ -284,7 +484,7 @@ public class WerkstoffLoader implements Runnable { if (!registered) { MainMod.LOGGER.info("Loading Processing Recipes for BW Materials"); long timepre = System.nanoTime(); - ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashMap.size()); + ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashMap.size()+1); for (short i = 0; i < Werkstoff.werkstoffHashMap.size(); i++) { Werkstoff werkstoff = Werkstoff.werkstoffHashMap.get(i); @@ -298,6 +498,8 @@ public class WerkstoffLoader implements Runnable { addCrushedRecipes(werkstoff); progressBar.step(werkstoff.getDefaultName()); } + progressBar.step("Load Additional Recipes"); + new AdditionalRecipes().run(); ProgressManager.pop(progressBar); long timepost = System.nanoTime(); MainMod.LOGGER.info("Loading Processing Recipes for BW Materials took " + (timepost - timepre) + "ns/" + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); @@ -325,15 +527,19 @@ public class WerkstoffLoader implements Runnable { W.add(SubTag.CRYSTALLISABLE); } } - - } private void addItemsForGeneration() { int toGenerateGlobal = 0b0000000; - for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) + for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { + for (OrePrefixes p : OrePrefixes.values()) + if ((werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(),p,1) != null) { + MainMod.LOGGER.info("Found: "+(p+werkstoff.getDefaultName().replaceAll(" ",""))+" in oreDict, disable and reroute my Items to that, also add a Tooltip."); + werkstoff.getGenerationFeatures().setBlacklist(p); + } toGenerateGlobal = (toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); + } if ((toGenerateGlobal & 0b1) != 0) { items.put(dust, new BW_MetaGenerated_Items(dust)); @@ -350,6 +556,7 @@ public class WerkstoffLoader implements Runnable { items.put(gemExquisite, new BW_MetaGenerated_Items(gemExquisite)); items.put(gemFlawed, new BW_MetaGenerated_Items(gemFlawed)); items.put(gemFlawless, new BW_MetaGenerated_Items(gemFlawless)); + items.put(lens,new BW_MetaGenerated_Items(lens)); } if ((toGenerateGlobal & 0b1000) != 0) { if (FMLCommonHandler.instance().getSide().isClient()) @@ -366,31 +573,48 @@ public class WerkstoffLoader implements Runnable { } } + private void runAdditionalOreDict(){ + for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { + if (werkstoff.getGenerationFeatures().hasOres()) + GT_OreDictUnificator.registerOre(ore + werkstoff.getDefaultName().replaceAll(" ",""), werkstoff.get(ore)); + if (werkstoff.getGenerationFeatures().hasGems()) + OreDictionary.registerOre("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens)); + } + + GT_OreDictUnificator.registerOre("craftingIndustrialDiamond",Zirconia.get(gemExquisite)); + } + private void addGemRecipes(Werkstoff werkstoff) { if (werkstoff.getGenerationFeatures().hasGems()) { - - GT_Values.RA.addSifterRecipe( - getCorresopndingItemStack(crushedPurified, werkstoff), - new ItemStack[]{ - getCorresopndingItemStack(gemExquisite, werkstoff), - getCorresopndingItemStack(gemFlawless, werkstoff), - getCorresopndingItemStack(gem, werkstoff), - getCorresopndingItemStack(gemFlawed, werkstoff), - getCorresopndingItemStack(gemChipped, werkstoff), - getCorresopndingItemStack(dust, werkstoff) - }, - new int[]{ - 100, 400, 1500, 2000, 4000, 5000 - }, - 800, - 16 - ); + if (werkstoff.getGenerationFeatures().hasSifterRecipes() || ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0)) { + GT_Values.RA.addSifterRecipe( + getCorresopndingItemStack(crushedPurified, werkstoff), + new ItemStack[]{ + getCorresopndingItemStack(gemExquisite, werkstoff), + getCorresopndingItemStack(gemFlawless, werkstoff), + getCorresopndingItemStack(gem, werkstoff), + getCorresopndingItemStack(gemFlawed, werkstoff), + getCorresopndingItemStack(gemChipped, werkstoff), + getCorresopndingItemStack(dust, werkstoff) + }, + new int[]{ + 100, 400, 1500, 2000, 4000, 5000 + }, + 800, + 16 + ); + } GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemExquisite), werkstoff.get(dust, 4)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawless), werkstoff.get(dust, 2)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(gem), werkstoff.get(dust)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawed), werkstoff.get(dustSmall, 1)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemChipped), werkstoff.get(dustTiny)); + GT_ModHandler.addCraftingRecipe(werkstoff.get(gemFlawless,2),0,new Object[]{"h ", "W ",'W',werkstoff.get(gemExquisite)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(gem, 2),0,new Object[]{"h ", "W ",'W',werkstoff.get(gemFlawless)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(gemFlawed, 2),0,new Object[]{"h ", "W ",'W',werkstoff.get(gem)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(gemChipped, 2),0,new Object[]{"h ", "W ",'W',werkstoff.get(gemFlawed)}); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemExquisite), werkstoff.get(gemFlawless, 2), 64, 16); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawless), werkstoff.get(gem, 2), 64, 16); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gem), werkstoff.get(gemFlawed, 2), 64, 16); @@ -404,6 +628,22 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addImplosionRecipe(werkstoff.get(dust, 4), 24, werkstoff.get(gem, 3), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 8)); + if ((werkstoff.getGenerationFeatures().toGenerate & 2) != 0){ + GT_Values.RA.addLatheRecipe(werkstoff.get(plate),werkstoff.get(lens),werkstoff.get(dustSmall), 1200, 120); + } + GT_Values.RA.addLatheRecipe(werkstoff.get(gemExquisite),werkstoff.get(lens),werkstoff.get(dust,2), 2400, 30); + GregTech_API.registerCover(werkstoff.get(lens), new GT_MultiTexture(Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false)), new gregtech.common.covers.GT_Cover_Lens(BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(lens), werkstoff.get(dustSmall,3)); + // if (MainMod.GTNH) { + //Engraver Recipe adder + for (ItemStack is : OreDictionary.getOres("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) { + is.stackSize = 0; + GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemChipped, 3), is, werkstoff.get(gemFlawed, 1), 600, 30); + GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemFlawed, 3), is, werkstoff.get(gem, 1), 600, 120); + GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gem, 3), is, werkstoff.get(gemFlawless, 1), 1200, 480); + GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemFlawless, 3), is, werkstoff.get(gemExquisite, 1), 2400, 2000); + } +// } } } @@ -415,7 +655,7 @@ public class WerkstoffLoader implements Runnable { HashMap> tracker = new HashMap<>(); int cells = 0; - if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge()) { + if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { if (container.getKey() instanceof Materials) { if (((Materials) container.getKey()).hasCorrespondingGas() || ((Materials) container.getKey()).hasCorrespondingFluid() || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { @@ -463,23 +703,19 @@ public class WerkstoffLoader implements Runnable { GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), (Object) null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); if (werkstoff.getStats().isCentrifuge()) GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), (Object) null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0); + if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { + if (cells > 0) + stOutputs.add(Materials.Empty.getCells(cells)); + GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0); + } } - GT_ModHandler.addShapelessCraftingRecipe(getCorresopndingItemStack(dust, werkstoff), 0, new Object[]{ - getCorresopndingItemStack(dustTiny, werkstoff), - getCorresopndingItemStack(dustTiny, werkstoff), - getCorresopndingItemStack(dustTiny, werkstoff), - getCorresopndingItemStack(dustTiny, werkstoff), - getCorresopndingItemStack(dustTiny, werkstoff), - getCorresopndingItemStack(dustTiny, werkstoff), - getCorresopndingItemStack(dustTiny, werkstoff), - getCorresopndingItemStack(dustTiny, werkstoff), + GT_ModHandler.addCraftingRecipe(getCorresopndingItemStack(dust, werkstoff), new Object[]{ + "TTT","TTT","TTT",'T', getCorresopndingItemStack(dustTiny, werkstoff) }); - GT_ModHandler.addShapelessCraftingRecipe(getCorresopndingItemStack(dust, werkstoff), 0, new Object[]{ - getCorresopndingItemStack(dustSmall, werkstoff), - getCorresopndingItemStack(dustSmall, werkstoff), - getCorresopndingItemStack(dustSmall, werkstoff), + GT_ModHandler.addCraftingRecipe(getCorresopndingItemStack(dust, werkstoff), new Object[]{ + "TT ","TT ",'T', getCorresopndingItemStack(dustSmall, werkstoff) }); GT_ModHandler.addCraftingRecipe(getCorresopndingItemStack(dustSmall, werkstoff, 4), new Object[]{ @@ -493,14 +729,6 @@ public class WerkstoffLoader implements Runnable { GT_ModHandler.addSmeltingRecipe(getCorresopndingItemStack(dust, werkstoff), getCorresopndingItemStack(ingot, werkstoff)); GT_ModHandler.addSmeltingRecipe(getCorresopndingItemStack(dustTiny, werkstoff), getCorresopndingItemStack(nugget, werkstoff)); } - - if (werkstoff.contains(SubTag.CRYSTALLISABLE)) { - GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustPure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); - GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustImpure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); - GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustPure), gregtech.api.util.GT_ModHandler.getDistilledWater(200L), werkstoff.get(gem), 9500, 1500, 24); - GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustImpure), gregtech.api.util.GT_ModHandler.getDistilledWater(200L), werkstoff.get(gem), 9500, 1500, 24); - } - } } @@ -513,7 +741,7 @@ public class WerkstoffLoader implements Runnable { GT_ModHandler.addPulverisationRecipe( werkstoff.get(ore), werkstoff.get(crushed, 2), - werkstoff.getOreByProduct(0, gem) != null ? werkstoff.getOreByProduct(0, gem) : werkstoff.getOreByProduct(0, dust), + werkstoff.contains(SubTag.CRYSTAL) ? werkstoff.get(gem) : werkstoff.getOreByProduct(0, dust), werkstoff.getNoOfByProducts() > 0 ? 10 : 0, Materials.Stone.getDust(1), 50, @@ -525,6 +753,10 @@ public class WerkstoffLoader implements Runnable { if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) == 0 || (werkstoff.getGenerationFeatures().toGenerate & 0b1) == 0) return; + GT_ModHandler.addCraftingRecipe(werkstoff.get(dustImpure),new Object[]{"h ", "W ",'W',werkstoff.get(crushed)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(dustPure),new Object[]{"h ", "W ",'W',werkstoff.get(crushedPurified)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(dust),new Object[]{"h ", "W ",'W',werkstoff.get(crushedCentrifuged)}); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), 10, 16); GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), werkstoff.getOreByProduct(0, dust), 10, false); GT_ModHandler.addOreWasherRecipe(werkstoff.get(crushed), 1000, werkstoff.get(crushedPurified), werkstoff.getOreByProduct(0, dustTiny), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L)); @@ -540,7 +772,12 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustImpure), 0, werkstoff.get(dust), werkstoff.getOreByProduct(0, dustTiny), null, null, null, null, (int) Math.max(1L, werkstoff.getStats().mass * 8L)); GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustPure), 0, werkstoff.get(dust), werkstoff.getOreByProduct(1, dustTiny), null, null, null, null, (int) Math.max(1L, werkstoff.getStats().mass * 8L)); - + if (werkstoff.contains(SubTag.CRYSTALLISABLE)) { + GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustPure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); + GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustImpure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); + GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustPure), gregtech.api.util.GT_ModHandler.getDistilledWater(200L), werkstoff.get(gem), 9500, 1500, 24); + GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustImpure), gregtech.api.util.GT_ModHandler.getDistilledWater(200L), werkstoff.get(gem), 9500, 1500, 24); + } if (werkstoff.contains(SubTag.WASHING_MERCURY)) GT_Values.RA.addChemicalBathRecipe(werkstoff.get(crushed), Materials.Mercury.getFluid(1000L), werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); if (werkstoff.contains(SubTag.WASHING_SODIUMPERSULFATE)) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java new file mode 100644 index 0000000000..50190d49a4 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; + +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import static gregtech.api.enums.OrePrefixes.*; + +public class AdditionalRecipes implements Runnable { + @Override + public void run() { + GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(11),Materials.Oxygen.getGas(3000),null, WerkstoffLoader.YttriumOxide.get(dust),64, BW_Util.getMachineVoltageFromTier(4)); + GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust,10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.Zirconia.get(gemFlawed, 40)}, (Object) null, (int[]) null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953); + GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall,2),WerkstoffLoader.Thorianit.get(dustSmall,2),Materials.Glass.getMolten(144),null,new ItemStack(ItemRegistry.bw_glasses[0],1,12),null,800,BW_Util.getMachineVoltageFromTier(5),3663); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java new file mode 100644 index 0000000000..f1ae2667ee --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java @@ -0,0 +1,284 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util; + +import gregtech.api.enums.Dyes; + +import java.util.Arrays; + +public class BW_ColorUtil { + private BW_ColorUtil(){} + + public static byte getDarknessFromColor (short[] rgba, int index){ + int g = rgba[index]; + if (g >= 0 && g < 64) + return 0; + else if (g >= 64 && g < 160) + return 1; + else if (g >= 160 && g < 223) + return 2; + else if (g >= 233 && g <= 255) + return 3; + return 4; + } + + public static Dyes getDyeFromColor(short[] rgba){ + rgba=correctCorlorArray(rgba); + if (isGrayScale(rgba,2)){ + switch (getDarknessFromColor(rgba,0)) { + case 0: + return Dyes.dyeBlack; + case 1: + return Dyes.dyeGray; + case 2: + return Dyes.dyeLightGray; + case 3: + return Dyes.dyeWhite; + } + } else { + short[] tmp = roundColor(rgba, 2); + if (isRedScale(tmp)){ + if (isPurpleScale(tmp)) { + switch (getDarknessFromColor(rgba, 0)) { + case 0: + case 1: + if (rgba[3] - 50 > rgba[0]) + return Dyes.dyePurple; + else return Dyes.dyeRed; + case 2: + case 3: + if (rgba[3] - 50 > rgba[0]) + return Dyes.dyeMagenta; + else if (rgba[0] > 200 && rgba[2] > 140) + return Dyes.dyePink; + else if (rgba[0] > rgba[1]+rgba[1]/10 && rgba[0] > rgba[2]+rgba[2]/10 && rgba[1]>>4 == rgba[2]>>4 && rgba[1]+50 > rgba[0]) { + return Dyes.dyeBrown; + } + else + return Dyes.dyeRed; + case 4: + return Dyes._NULL; + } + } + if (isYellowScale(tmp)) + switch (getDarknessFromColor(rgba, 0)) { + case 0: + case 1: + return Dyes.dyeBrown; + case 2: + case 3:{ + if (rgba[0]>>5 > rgba[1]>>5) + return Dyes.dyeOrange; + else + return Dyes.dyeYellow; + } + case 4: + return Dyes._NULL; + } + return Dyes.dyePink; + } else if (isGrenScale(tmp)){ + if (isCyanScale(tmp)) { + if (rgba[2]+40 < rgba[1]) + switch (getDarknessFromColor(rgba,0)) { + case 0: + case 1: + return Dyes.dyeGreen; + case 2: + case 3: + return Dyes.dyeLime; + } + return Dyes.dyeCyan; + } + if (isYellowScale(tmp)) + switch (getDarknessFromColor(rgba, 0)) { + case 0: + case 1: + return Dyes.dyeBrown; + case 2: + case 3:{ + if (rgba[0]>>5 > rgba[1]>>5) + return Dyes.dyeOrange; + else + return Dyes.dyeYellow; + } + } + switch (getDarknessFromColor(rgba,0)) { + case 0: + case 1: + return Dyes.dyeGreen; + case 2: + case 3: + return Dyes.dyeLime; + } + } else if (isBlueScale(tmp)){ + if (isPurpleScale(tmp)) { + switch (getDarknessFromColor(rgba, 0)) { + case 0: + case 1: + return Dyes.dyePurple; + case 2: + case 3: + return Dyes.dyeMagenta; + } + } + else if (isCyanScale(tmp)){ + return Dyes.dyeCyan; + } + switch (getDarknessFromColor(rgba,0)) { + case 0: + case 1: + return Dyes.dyeBlue; + case 2: + case 3: + return Dyes.dyeLightBlue; + } + } + } + return Dyes._NULL; + } + + public static boolean isCyanScale(short[] rgba){ + return !isRedScale(rgba); + } + + public static boolean isPurpleScale(short[] rgba){ + return !isGrenScale(rgba); + } + + public static boolean isYellowScale(short[] rgba){ + return !isBlueScale(rgba); + } + + public static boolean isBlueScale(short[] rgba){ + rgba=correctCorlorArray(rgba); + return (rgba[2]*2) >= (rgba[1]+rgba[0]); + } + + public static boolean isGrenScale(short[] rgba){ + rgba=correctCorlorArray(rgba); + return (rgba[1]*2) >= (rgba[0]+rgba[2]); + } + + public static boolean isRedScale(short[] rgba){ + rgba=correctCorlorArray(rgba); + return (rgba[0]*2) >= (rgba[1]+rgba[2]); + } + + public static boolean isGrayScale(short[] rgba, int magin){ + rgba=correctCorlorArray(rgba); + return rgba[0]>>magin==rgba[1]>>magin && rgba[1]>>magin==rgba[2]>>magin; + } + + public static short[] roundColor(short[] rgba, int magin){ + short[]tmp = Arrays.copyOf(rgba,4); + tmp[0] = (short) (rgba[0]>>magin); + tmp[1] = (short) (rgba[1]>>magin); + tmp[2] = (short) (rgba[2]>>magin); + return tmp; + } + + public static boolean isGrayScale(short[] rgba){ + rgba=correctCorlorArray(rgba); + return rgba[0]==rgba[1] && rgba[1] == rgba[2]; + } + + public static short[] correctCorlorArray(short[] rgba){ + if (rgba.length<4) { + short[] tmp = Arrays.copyOf(rgba, 4); + Arrays.fill(tmp,rgba.length-1,4, (short) 0); + rgba = tmp; + } + if (rgba[0] > 255) + rgba[0] = 255; + if (rgba[1] > 255) + rgba[1] = 255; + if (rgba[2] > 255) + rgba[2] = 255; + if (rgba[3] > 255) + rgba[3] = 255; + if (rgba[0] < 0) + rgba[0] = 0; + if (rgba[1] < 0) + rgba[1] = 0; + if (rgba[2] < 0) + rgba[2] = 0; + if (rgba[3] < 0) + rgba[3] = 0; + return rgba; + } + + public static short[] splitColorToRBGArray(int rgb) { + return new short[]{(short) ((rgb >> 16) & 0xFF), (short) ((rgb >> 8) & 0xFF), (short) (rgb & 0xFF)}; + } + + public static int getColorFromRGBArray(short[] color) { + return ((color[0] & 0x0ff) << 16) | ((color[1] & 0x0ff) << 8) | (color[2] & 0x0ff); + } + + public static int getColorFromRGBArray(int[] color) { + return ((color[0] & 0x0ff) << 16) | ((color[1] & 0x0ff) << 8) | (color[2] & 0x0ff); + } + + public static String getColorForTier(int tier) { + String ret; + switch (tier) { + case 0: + ret = ChatColorHelper.RED; + break; + case 1: + ret = ChatColorHelper.GRAY; + break; + case 2: + ret = ChatColorHelper.AQUA; + break; + case 3: + ret = ChatColorHelper.GOLD; + break; + case 4: + ret = ChatColorHelper.DARKPURPLE; + break; + case 5: + ret = ChatColorHelper.DARKBLUE; + break; + case 6: + ret = ChatColorHelper.LIGHT_PURPLE; + break; + case 7: + ret = ChatColorHelper.WHITE; + break; + case 8: + ret = ChatColorHelper.DARKAQUA; + break; + case 9: + ret = ChatColorHelper.DARKRED; + break; + case 10: + ret = ChatColorHelper.GREEN; + break; + default: + ret = ChatColorHelper.OBFUSCATED; + break; + } + return ret; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index f839b8b503..c775313f1a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import gregtech.api.enums.Materials; +import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; @@ -36,8 +37,10 @@ import net.minecraftforge.common.util.ForgeDirection; import javax.annotation.Nonnegative; import java.util.ArrayList; +import java.util.Arrays; import java.util.Iterator; import java.util.List; +import java.util.function.UnaryOperator; import static gregtech.api.enums.GT_Values.V; @@ -92,18 +95,6 @@ public class BW_Util { return (int) (30 * Math.pow(4, (tier - 1))); } - public static short[] splitColortoArray(int rgb) { - return new short[]{(short) ((rgb >> 16) & 0xFF), (short) ((rgb >> 8) & 0xFF), (short) (rgb & 0xFF)}; - } - - public static int getColorFromArray(short[] color) { - return ((color[0] & 0x0ff) << 16) | ((color[1] & 0x0ff) << 8) | (color[2] & 0x0ff); - } - - public static int getColorFromArray(int[] color) { - return ((color[0] & 0x0ff) << 16) | ((color[1] & 0x0ff) << 8) | (color[2] & 0x0ff); - } - public static boolean areStacksEqual(ItemStack aStack1, ItemStack aStack2) { return (aStack1 == null && aStack2 == null) || GT_Utility.areStacksEqual(aStack1, aStack2); } @@ -136,51 +127,11 @@ public class BW_Util { case 5: ret = 8; break; - default: - ret = 3; - } - return ret; - } - - public static String getColorForTier(int tier) { - String ret; - switch (tier) { - case 0: - ret = ChatColorHelper.RED; - break; - case 1: - ret = ChatColorHelper.GRAY; - break; - case 2: - ret = ChatColorHelper.AQUA; - break; - case 3: - ret = ChatColorHelper.GOLD; - break; - case 4: - ret = ChatColorHelper.DARKPURPLE; - break; - case 5: - ret = ChatColorHelper.DARKBLUE; - break; - case 6: - ret = ChatColorHelper.LIGHT_PURPLE; - break; - case 7: - ret = ChatColorHelper.WHITE; - break; - case 8: - ret = ChatColorHelper.DARKAQUA; - break; - case 9: - ret = ChatColorHelper.DARKRED; - break; - case 10: - ret = ChatColorHelper.GREEN; + case 12: + ret = 5; break; default: - ret = ChatColorHelper.OBFUSCATED; - break; + ret = 3; } return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index a9f3293cbc..001b747be8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -147,7 +147,7 @@ public class BioCulture extends BioData implements IColorModulationContainer { } public int getColorRGB() { - return BW_Util.getColorFromArray(new int[]{this.color.getRed(), this.color.getGreen(), this.color.getBlue()}); + return BW_ColorUtil.getColorFromRGBArray(new int[]{this.color.getRed(), this.color.getGreen(), this.color.getBlue()}); } public Color getColor() { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_OreLayer.java new file mode 100644 index 0000000000..95155b1487 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_OreLayer.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.world.GT_Worldgen; +import gregtech.common.blocks.GT_TileEntity_Ores; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +/** + * Original GT File Stripped and adjusted to work with this mod + */ +public class BW_OreLayer extends GT_Worldgen { + public static final List sList = new ArrayList<>(); + private static final boolean logOregenRoss128 = false; + public static int sWeight; + public byte bwOres = 0b0000; + public int mMinY, mWeight, mDensity, mSize, mMaxY, mPrimaryMeta, mSecondaryMeta, mBetweenMeta, mSporadicMeta; + + public BW_OreLayer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { + super(aName, BW_OreLayer.sList, aDefault); + this.mMinY = (short) aMinY; + this.mMaxY = (short) aMaxY; + this.mWeight = (short) aWeight; + this.mDensity = (short) aDensity; + this.mSize = (short) Math.max(1, aSize); + + if (mEnabled) + BW_OreLayer.sWeight += this.mWeight; + + if (top instanceof Werkstoff) + bwOres = (byte) (bwOres | 0b1000); + if (bottom instanceof Werkstoff) + bwOres = (byte) (bwOres | 0b0100); + if (between instanceof Werkstoff) + bwOres = (byte) (bwOres | 0b0010); + if (sprinkled instanceof Werkstoff) + bwOres = (byte) (bwOres | 0b0001); + + short aPrimary = top instanceof Materials ? + (short) ((Materials) top).mMetaItemSubID : + top instanceof Werkstoff ? + (short) ((Werkstoff) top).getmID() : + 0; + short aSecondary = bottom instanceof Materials ? + (short) ((Materials) bottom).mMetaItemSubID : + bottom instanceof Werkstoff ? + (short) ((Werkstoff) bottom).getmID() : + 0; + short aBetween = between instanceof Materials ? + (short) ((Materials) between).mMetaItemSubID : + between instanceof Werkstoff ? + (short) ((Werkstoff) between).getmID() : + 0; + short aSporadic = sprinkled instanceof Materials ? + (short) ((Materials) sprinkled).mMetaItemSubID : + sprinkled instanceof Werkstoff ? + (short) ((Werkstoff) sprinkled).getmID() : + 0; + this.mPrimaryMeta = (short) aPrimary; + this.mSecondaryMeta = (short) aSecondary; + this.mBetweenMeta = (short) aBetween; + this.mSporadicMeta = (short) aSporadic; + + } + + @Override + public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + { + int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); + int cX = aChunkX - aRandom.nextInt(this.mSize); + int eX = aChunkX + 16 + aRandom.nextInt(this.mSize); + + for (int tX = cX; tX <= eX; ++tX) { + int cZ = aChunkZ - aRandom.nextInt(this.mSize); + int eZ = aChunkZ + 16 + aRandom.nextInt(this.mSize); + + for (int tZ = cZ; tZ <= eZ; ++tZ) { + int i; + if (this.mSecondaryMeta > 0) { + for (i = tMinY - 1; i < tMinY + 2; ++i) { + if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { + setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false); + } + } + } + + if (this.mBetweenMeta > 0 && (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) { + setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); + } + + if (this.mPrimaryMeta > 0) { + for (i = tMinY + 3; i < tMinY + 6; ++i) { + if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { + setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false); + } + } + } + + if (this.mSporadicMeta > 0 && (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) { + setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); + } + } + } + + if (logOregenRoss128) { + MainMod.LOGGER.info("Generated Orevein: " + this.mWorldGenName + " " + aChunkX + " " + aChunkZ); + } + + return true; + } + } + + public boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre) { + if ((aMetaData == mSporadicMeta && (bwOres & 0b0001) != 0) || (aMetaData == mBetweenMeta && (bwOres & 0b0010) != 0) || (aMetaData == mPrimaryMeta && (bwOres & 0b1000) != 0) || (aMetaData == mSecondaryMeta && (bwOres & 0b0100) != 0)) { + return BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false); + } + return GT_TileEntity_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, isSmallOre, false); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java index 5a80b62f75..57dc4ac57d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java @@ -97,13 +97,13 @@ public class BW_WordGenerator implements IWorldGenerator { ChunkCoordIntPair centerChunk = new ChunkCoordIntPair(xCenter, zCenter); if (!mGenerated.contains(centerChunk) && surroundingChunksLoaded(xCenter, zCenter)) { mGenerated.add(centerChunk); - if ((BW_WorldGenRoss128.sWeight > 0) && (BW_WorldGenRoss128.sList.size() > 0)) { + if ((BW_OreLayer.sWeight > 0) && (BW_OreLayer.sList.size() > 0)) { boolean temp = true; int tRandomWeight; for (int i = 0; (i < 256) && (temp); i++) { - tRandomWeight = random.nextInt(BW_WorldGenRoss128.sWeight); - for (GT_Worldgen tWorldGen : BW_WorldGenRoss128.sList) { - tRandomWeight -= ((BW_WorldGenRoss128) tWorldGen).mWeight; + tRandomWeight = random.nextInt(BW_OreLayer.sWeight); + for (BW_OreLayer tWorldGen : BW_OreLayer.sList) { + tRandomWeight -= ((BW_OreLayer) tWorldGen).mWeight; if (tRandomWeight <= 0) { try { if (tWorldGen.executeWorldgen(this.mWorld, random, "", this.mDimensionType, xCenter, zCenter, this.mChunkGenerator, this.mChunkProvider)) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java index 0f49e7ee95..5fa9218ef2 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java @@ -22,82 +22,25 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider.WorldProviderRoss128b; +import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128; import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.world.GT_Worldgen; -import gregtech.common.blocks.GT_TileEntity_Ores; -import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; import net.minecraftforge.fluids.FluidRegistry; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; -/** - * Original GT File Stripped and adjusted to work with this mod - */ -public class BW_WorldGenRoss128 extends GT_Worldgen { - - public static final List sList = new ArrayList<>(); - private static final boolean logOregenRoss128 = false; - public static int sWeight; - public byte bwOres = 0b0000; - public int mMinY, mWeight, mDensity, mSize, mMaxY, mPrimaryMeta, mSecondaryMeta, mBetweenMeta, mSporadicMeta; - public BW_WorldGenRoss128(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { - super(aName, sList, aDefault); - this.mMinY = (short) aMinY; - this.mMaxY = (short) aMaxY; - this.mWeight = (short) aWeight; - this.mDensity = (short) aDensity; - this.mSize = (short) Math.max(1, aSize); - - if (mEnabled) - sWeight += this.mWeight; - if (top instanceof Werkstoff) - bwOres = (byte) (bwOres | 0b1000); - if (bottom instanceof Werkstoff) - bwOres = (byte) (bwOres | 0b0100); - if (between instanceof Werkstoff) - bwOres = (byte) (bwOres | 0b0010); - if (sprinkled instanceof Werkstoff) - bwOres = (byte) (bwOres | 0b0001); +public class BW_WorldGenRoss128 extends BW_OreLayer { - short aPrimary = top instanceof Materials ? - (short) ((Materials) top).mMetaItemSubID : - top instanceof Werkstoff ? - (short) ((Werkstoff) top).getmID() : - 0; - short aSecondary = bottom instanceof Materials ? - (short) ((Materials) bottom).mMetaItemSubID : - bottom instanceof Werkstoff ? - (short) ((Werkstoff) bottom).getmID() : - 0; - short aBetween = between instanceof Materials ? - (short) ((Materials) between).mMetaItemSubID : - between instanceof Werkstoff ? - (short) ((Werkstoff) between).getmID() : - 0; - short aSporadic = sprinkled instanceof Materials ? - (short) ((Materials) sprinkled).mMetaItemSubID : - sprinkled instanceof Werkstoff ? - (short) ((Werkstoff) sprinkled).getmID() : - 0; - this.mPrimaryMeta = (short) aPrimary; - this.mSecondaryMeta = (short) aSecondary; - this.mBetweenMeta = (short) aBetween; - this.mSporadicMeta = (short) aSporadic; + public BW_WorldGenRoss128(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { + super(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, top, bottom, between, sprinkled); } public static void init_OresRoss128() { @@ -108,9 +51,9 @@ public class BW_WorldGenRoss128 extends GT_Worldgen { new BW_WorldGenRoss128("ore.mix.ross128.Roquesit", true, 5, 250, 3, 1, 12, WerkstoffLoader.Arsenopyrite, WerkstoffLoader.Ferberite, WerkstoffLoader.Loellingit, WerkstoffLoader.Roquesit); new BW_WorldGenRoss128("ore.mix.ross128.Tungstate", true, 5, 250, 10, 4, 14, WerkstoffLoader.Ferberite, WerkstoffLoader.Huebnerit, WerkstoffLoader.Loellingit, Materials.Scheelite); new BW_WorldGenRoss128("ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, WerkstoffLoader.Djurleit, WerkstoffLoader.Bornite, WerkstoffLoader.Wittichenit, Materials.Tetrahedrite); - new BW_WorldGenRoss128("ore.mix.ross128.magnetite", true, 60, 180, 50, 2, 32, Materials.Magnetite, Materials.Magnetite, Materials.Iron, Materials.VanadiumMagnetite); - new BW_WorldGenRoss128("ore.mix.ross128.gold", true, 30, 60, 50, 2, 32, Materials.Magnetite, Materials.Magnetite, Materials.VanadiumMagnetite, Materials.Gold); - new BW_WorldGenRoss128("ore.mix.ross128.iron", true, 10, 40, 40, 3, 24, Materials.BrownLimonite, Materials.YellowLimonite, Materials.BandedIron, Materials.Malachite); + new BW_WorldGenRoss128("ore.mix.ross128.Forsterit", true, 60, 180, 50, 2, 32, WerkstoffLoader.Forsterit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescolizitCUVO4, WerkstoffLoader.DescolizitZNVO4); + new BW_WorldGenRoss128("ore.mix.ross128.Hedenbergit", true, 30, 60, 50, 2, 32, WerkstoffLoader.Hedenbergit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescolizitZNVO4, WerkstoffLoader.Forsterit); + new BW_WorldGenRoss128("ore.mix.ross128.RedZircon", true, 10, 40, 40, 3, 24, WerkstoffLoader.Fayalit,WerkstoffLoader.FuchsitAL , WerkstoffLoader.RedZircon,WerkstoffLoader.FuchsitCR); } public static void init_undergroundFluidsRoss128() { @@ -123,61 +66,7 @@ public class BW_WorldGenRoss128 extends GT_Worldgen { @Override public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { - return aWorld.provider instanceof WorldProviderRoss128b; - } - - @Override - public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - { - int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); - int cX = aChunkX - aRandom.nextInt(this.mSize); - int eX = aChunkX + 16 + aRandom.nextInt(this.mSize); - - for (int tX = cX; tX <= eX; ++tX) { - int cZ = aChunkZ - aRandom.nextInt(this.mSize); - int eZ = aChunkZ + 16 + aRandom.nextInt(this.mSize); - - for (int tZ = cZ; tZ <= eZ; ++tZ) { - int i; - if (this.mSecondaryMeta > 0) { - for (i = tMinY - 1; i < tMinY + 2; ++i) { - if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { - setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false); - } - } - } - - if (this.mBetweenMeta > 0 && (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) { - setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); - } - - if (this.mPrimaryMeta > 0) { - for (i = tMinY + 3; i < tMinY + 6; ++i) { - if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { - setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false); - } - } - } - - if (this.mSporadicMeta > 0 && (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) { - setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); - } - } - } - - if (logOregenRoss128) { - MainMod.LOGGER.info("Generated Orevein: " + this.mWorldGenName + " " + aChunkX + " " + aChunkZ); - } - - return true; - } - } - - public boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre) { - if ((aMetaData == mSporadicMeta && (bwOres & 0b0001) != 0) || (aMetaData == mBetweenMeta && (bwOres & 0b0010) != 0) || (aMetaData == mPrimaryMeta && (bwOres & 0b1000) != 0) || (aMetaData == mSecondaryMeta && (bwOres & 0b0100) != 0)) { - return BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false); - } - return GT_TileEntity_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, isSmallOre, false); + return aWorld.provider.dimensionId == Ross128.ross128ID; } } diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 773214b1f7..d7976f0caa 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -55,6 +55,7 @@ BW_GlasBlocks.8.name=Colored Borosilicate Glass Block (Purple) BW_GlasBlocks.9.name=Colored Borosilicate Glass Block (Yellow) BW_GlasBlocks.10.name=Colored Borosilicate Glass Block (Light Green) BW_GlasBlocks.11.name=Colored Borosilicate Glass Block (Brown) +BW_GlasBlocks.12.name=Thorium Yttrium Glass Block tooltip.glas.0.name=Glass-Tier: tooltip.LESU.0.name=Maximum Capacity! diff --git a/src/main/resources/assets/bartworks/textures/blocks/ThoriumYttriumGlass.png b/src/main/resources/assets/bartworks/textures/blocks/ThoriumYttriumGlass.png new file mode 100644 index 0000000000..5d97902f87 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/ThoriumYttriumGlass.png differ -- cgit From de65fb804ee3473faabee38539b0d91ad6b6a471 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 9 Apr 2019 13:06:03 +0200 Subject: finetuned the veins a bit more +changed material names and colors/texture sets Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: a20c82f20965621c62070268fcfbf5545c175d8d --- .../bartworks/system/material/WerkstoffLoader.java | 22 +++++++++++----------- .../ross128/world/oregen/BW_WorldGenRoss128.java | 7 ++----- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 043dfd1f7d..ebb7242ebd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -354,7 +354,7 @@ public class WerkstoffLoader implements Runnable { new Pair(Materials.Oxygen, 4) ); public static final Werkstoff Forsterit = new Werkstoff( - new short[]{150,150,150,0}, + new short[]{255,255,255,0}, "Forsterite", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -380,28 +380,28 @@ public class WerkstoffLoader implements Runnable { new Pair(Materials.Silicon, 2), new Pair(Materials.Oxygen, 6) ); - public static final Werkstoff DescolizitZNVO4 = new Werkstoff( - new short[]{100,60,30,0}, - "Descolizite(ZnVO4)",//Pb(Zn,Cu)[OH|VO4 + public static final Werkstoff DescloiziteZNVO4 = new Werkstoff( + new short[]{0xBF,0x18,0x0F,0}, + "Red Descloizite",//Pb(Zn,Cu)[OH|VO4 new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), 26, - TextureSet.SET_METALLIC, + TextureSet.SET_QUARTZ, Arrays.asList(Materials.Lead,Materials.Copper,Materials.Vanadium), new Pair(Materials.Lead, 1), new Pair(Materials.Zinc, 1), new Pair(Materials.Vanadium, 1), new Pair(Materials.Oxygen, 4) ); - public static final Werkstoff DescolizitCUVO4 = new Werkstoff( - new short[]{100,60,30,0}, - "Descolizite(CuVO4)",//Pb(Zn,Cu)[OH|VO4 + public static final Werkstoff DescloiziteCUVO4 = new Werkstoff( + new short[]{0xf9,0x6d,0x18,0}, + "Orange Descolizite",//Pb(Zn,Cu)[OH|VO4 new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), 27, - TextureSet.SET_METALLIC, + TextureSet.SET_QUARTZ, Arrays.asList(Materials.Lead,Materials.Zinc,Materials.Vanadium), new Pair(Materials.Lead, 1), new Pair(Materials.Copper, 1), @@ -410,7 +410,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff FuchsitAL = new Werkstoff( new short[]{0x4D,0x7F,0x64,0}, - "Fuchsite(Al)", + "Green Fuchsite", "KAl3Si3O10(OH)2", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -427,7 +427,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff FuchsitCR = new Werkstoff( new short[]{128,0,0,0}, - "Fuchsite(Cr)", + "Red Fuchsite", "KCr3Si3O10(OH)2", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java index 5fa9218ef2..d907b7ce69 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java @@ -22,13 +22,10 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider.WorldProviderRoss128b; import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128; import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; -import gregtech.api.world.GT_Worldgen; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidRegistry; @@ -51,8 +48,8 @@ public class BW_WorldGenRoss128 extends BW_OreLayer { new BW_WorldGenRoss128("ore.mix.ross128.Roquesit", true, 5, 250, 3, 1, 12, WerkstoffLoader.Arsenopyrite, WerkstoffLoader.Ferberite, WerkstoffLoader.Loellingit, WerkstoffLoader.Roquesit); new BW_WorldGenRoss128("ore.mix.ross128.Tungstate", true, 5, 250, 10, 4, 14, WerkstoffLoader.Ferberite, WerkstoffLoader.Huebnerit, WerkstoffLoader.Loellingit, Materials.Scheelite); new BW_WorldGenRoss128("ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, WerkstoffLoader.Djurleit, WerkstoffLoader.Bornite, WerkstoffLoader.Wittichenit, Materials.Tetrahedrite); - new BW_WorldGenRoss128("ore.mix.ross128.Forsterit", true, 60, 180, 50, 2, 32, WerkstoffLoader.Forsterit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescolizitCUVO4, WerkstoffLoader.DescolizitZNVO4); - new BW_WorldGenRoss128("ore.mix.ross128.Hedenbergit", true, 30, 60, 50, 2, 32, WerkstoffLoader.Hedenbergit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescolizitZNVO4, WerkstoffLoader.Forsterit); + new BW_WorldGenRoss128("ore.mix.ross128.Forsterit", true, 20, 180, 50, 2, 32, WerkstoffLoader.Forsterit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescloiziteCUVO4, WerkstoffLoader.DescloiziteZNVO4); + new BW_WorldGenRoss128("ore.mix.ross128.Hedenbergit", true, 20, 180, 50, 2, 32, WerkstoffLoader.Hedenbergit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescloiziteCUVO4, WerkstoffLoader.DescloiziteZNVO4); new BW_WorldGenRoss128("ore.mix.ross128.RedZircon", true, 10, 40, 40, 3, 24, WerkstoffLoader.Fayalit,WerkstoffLoader.FuchsitAL , WerkstoffLoader.RedZircon,WerkstoffLoader.FuchsitCR); } -- cgit From d90b05bafacee6bf091702e182f94e3c6794b84e Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 9 Apr 2019 20:13:26 +0200 Subject: removed Taint Biome due to buggyness and i dont like it >:( Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 50a98b3d394b8d0480a691c0d33fb008bbcd7cab --- .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 6 +-- .../world/worldprovider/ChunkProviderRoss128b.java | 6 +++ .../crossmod/thaumcraft/CustomAspects.java | 36 ++++++++++++++++++ .../thaumcraft/util/ThaumcraftHandler.java | 44 ++++++++++++++++++++++ 4 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 9cefea1a7d..cd420afdcb 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.crossmod; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; +import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -48,11 +49,10 @@ public class BartWorksCrossmod { @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { - - if (Loader.isModLoaded("GalacticraftCore")) GalacticraftProxy.preInit(preinit); - + if (Loader.isModLoaded("Thaumcraft")) + new CustomAspects(); } @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java index 0476e4356c..956810dd7f 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java @@ -23,6 +23,8 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WordGenerator; +import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; +import cpw.mods.fml.common.Loader; import gregtech.api.objects.XSTR; import net.minecraft.block.Block; import net.minecraft.block.BlockFalling; @@ -77,6 +79,10 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { } else if (biomeGenBase.biomeID == BiomeGenBase.mushroomIslandShore.biomeID) { this.biomesForGeneration[i] = BiomeGenBase.stoneBeach; } + if (Loader.isModLoaded("Thaumcraft")) { + if (ThaumcraftHandler.isTaintBiome(biomeGenBase.biomeID)) + this.biomesForGeneration[i] = BiomeGenBase.taiga; + } } this.replaceBlocksForBiome(p_73154_1_, p_73154_2_, ablock, abyte, this.biomesForGeneration); this.caveGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java new file mode 100644 index 0000000000..bb419228d1 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.thaumcraft; + +//import com.github.bartimaeusnek.bartworks.MainMod; +//import net.minecraft.util.ResourceLocation; +//import thaumcraft.api.aspects.Aspect; +// +//import static thaumcraft.api.aspects.Aspect.*; + +public class CustomAspects { +// final static Aspect TRADE = new Aspect("Artis",0x00FF00,new Aspect[]{EXCHANGE, MAN},new ResourceLocation(MainMod.MOD_ID+":Aspects/Artis.png"),1); +// final static Aspect UNIVERSE = new Aspect("Universum",0x0000FF,new Aspect[]{MAGIC, ELDRITCH},new ResourceLocation(MainMod.MOD_ID+":Aspects/Universum.png"),1); +// final static Aspect SCIENCE = new Aspect("Scientia",0x00FFFF,new Aspect[]{MAN, UNIVERSE},new ResourceLocation(MainMod.MOD_ID+":Aspects/Scientia.png"),1); + +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java new file mode 100644 index 0000000000..a3cc19b41c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.thaumcraft.util; + +import net.minecraft.world.biome.BiomeGenBase; + +public class ThaumcraftHandler { + private ThaumcraftHandler(){} + + public static Integer taintBiomeID = null; + + public static boolean isTaintBiome(int biomeID){ + if (taintBiomeID == null) { + try { + BiomeGenBase TaintBiome = (BiomeGenBase) Class.forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator").getField("biomeTaint").get(null); + return biomeID == (taintBiomeID = TaintBiome.biomeID); + } catch (ClassCastException | ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + return false; + } + } + return biomeID == taintBiomeID; + } +} -- cgit From 05cea11a5d0be68f592e1c84d78487c0f8402133 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 11 Apr 2019 08:42:40 +0200 Subject: added debug log +added thaumcraft aspects for materials +refractored code +added a config option for the debug log +version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 89fd58076774eee04d9aa677d22d48c039d1a06c --- build.properties | 2 +- .../bartworks/API/WerkstoffAdderRegistry.java | 8 +- .../github/bartimaeusnek/bartworks/MainMod.java | 9 + .../common/blocks/BW_TileEntityContainer.java | 2 +- .../bartworks/common/configs/ConfigHandler.java | 3 +- .../bartworks/system/log/DebugLog.java | 68 ++++++ .../system/material/BW_MetaGenerated_Ores.java | 1 - .../bartworks/system/material/Werkstoff.java | 239 ++++++++++++--------- .../bartworks/system/material/WerkstoffLoader.java | 174 ++++++++------- .../github/bartimaeusnek/bartworks/util/Pair.java | 10 +- .../crossmod/galacticraft/GalacticraftProxy.java | 30 +-- .../planets/ross128/world/oregen/BW_OreLayer.java | 40 ++-- .../ross128/world/oregen/BW_WordGenerator.java | 19 +- .../ross128/world/oregen/BW_WorldGenRoss128.java | 4 +- .../world/worldprovider/WorldProviderRoss128b.java | 6 +- .../galacticraft/solarsystems/Ross128.java | 88 -------- .../solarsystems/Ross128SolarSystem.java | 88 ++++++++ .../thaumcraft/util/ThaumcraftHandler.java | 81 ++++++- 18 files changed, 541 insertions(+), 331 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java diff --git a/build.properties b/build.properties index 8beb46ca1f..ab5c5addf1 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=4 +buildNumber=5 APIVersion=5 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java index f35d86218f..6437ad1087 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java @@ -26,8 +26,8 @@ import java.util.HashSet; public final class WerkstoffAdderRegistry implements Runnable { - static final WerkstoffAdderRegistry INSTANCE = new WerkstoffAdderRegistry(); - final HashSet toRun = new HashSet<>(); + private static final WerkstoffAdderRegistry INSTANCE = new WerkstoffAdderRegistry(); + private final HashSet toRun = new HashSet<>(); private WerkstoffAdderRegistry() { } @@ -36,12 +36,12 @@ public final class WerkstoffAdderRegistry implements Runnable { return INSTANCE; } - public static void addWerkstoffAdder(Runnable adder) { + public static final void addWerkstoffAdder(Runnable adder) { INSTANCE.toRun.add(adder); } @Override - public void run() { + public final void run() { for (Runnable r : toRun) r.run(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index f668e85b4f..7de924d625 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -35,6 +35,7 @@ import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader; import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; +import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -60,6 +61,7 @@ import net.minecraftforge.common.MinecraftForge; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import java.io.IOException; import java.util.HashSet; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; @@ -99,6 +101,13 @@ public final class MainMod { GTNH = true; } CHandler = new ConfigHandler(preinit); + if (ConfigHandler.debugLog) { + try { + new DebugLog(preinit); + } catch (IOException e) { + e.printStackTrace(); + } + } if (GTNH) LOGGER.info("GTNH-Detected . . . ACTIVATE HARDMODE."); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index 6cbca9b7ad..fc546fc980 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -65,7 +65,7 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI @Override public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { if (worldObj.isRemote) { - return true; + return false; } final TileEntity tile = worldObj.getTileEntity(x, y, z); if (tile instanceof BW_TileEntity_HeatedWaterPump) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 1539ec80ac..2321c5e413 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -43,6 +43,7 @@ public class ConfigHandler { public static int megaMachinesMax = 256; public static int mbWaterperSec = 150; private static boolean ezmode = false; + public static boolean debugLog = false; public ConfigHandler(@Nonnull FMLPreInitializationEvent e) { c = new Configuration(new File(e.getModConfigurationDirectory().toString() + "/" + MainMod.MOD_ID + ".cfg")); @@ -61,7 +62,7 @@ public class ConfigHandler { ConfigHandler.IDOffset = 12600; c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600); } - + debugLog=c.get("System","Enable Debug Log",false,"Enables or Disables the debug log.").getBoolean(false); if (c.hasChanged()) c.save(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java new file mode 100644 index 0000000000..ba85a38e79 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.log; + +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +import java.io.File; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.GregorianCalendar; +import java.util.logging.FileHandler; +import java.util.logging.Formatter; +import java.util.logging.LogRecord; +import java.util.logging.Logger; + +public class DebugLog { + private static boolean init = false; + private static FileHandler fh; + private static Logger utilLog; + public DebugLog(FMLPreInitializationEvent event) throws IOException { + if (init) + return; + fh = new FileHandler(new File(new File(event.getModConfigurationDirectory().getParentFile(),"logs"),"BWLog.log").toString()); + utilLog = Logger.getLogger("DebugLog"); + utilLog.setUseParentHandlers(false); + utilLog.addHandler(fh); + Formatter formatter = new Formatter() { + @Override + public String format(LogRecord record) { + SimpleDateFormat logTime = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); + Calendar cal = new GregorianCalendar(); + cal.setTimeInMillis(record.getMillis()); + return "Level: " + record.getLevel() + +" at " + logTime.format(cal.getTime()) + + " " + record.getMessage() + "\n"; + } + }; + fh.setFormatter(formatter); + init = true; + } + + public static void log(String record){ + if (!init) + return; + utilLog.info(record); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 862de3cd98..7b7d33fa3d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -27,7 +27,6 @@ import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 3ade8d123d..f732932eed 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -23,13 +23,9 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MurmurHash3; import com.github.bartimaeusnek.bartworks.util.Pair; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.SubTag; -import gregtech.api.enums.TextureSet; +import gregtech.api.enums.*; import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_OreDictUnificator; @@ -41,61 +37,62 @@ import java.util.*; public class Werkstoff implements IColorModulationContainer, ISubTagContainer { - public static final LinkedHashSet werkstoffHashSet = new LinkedHashSet<>(); + static final LinkedHashSet werkstoffHashSet = new LinkedHashSet<>(); public static final LinkedHashMap werkstoffHashMap = new LinkedHashMap<>(); private static final HashSet idHashSet = new HashSet<>(); - public static final Werkstoff.Stats DEFAULT_NULL_STATS = new Werkstoff.Stats(); - public static final GenerationFeatures DEFAULT_NULL_GENERATION_FEATURES = new GenerationFeatures(); + private static final Werkstoff.Stats DEFAULT_NULL_STATS = new Werkstoff.Stats(); + private static final Werkstoff.GenerationFeatures DEFAULT_NULL_GENERATION_FEATURES = new Werkstoff.GenerationFeatures().disable(); public static Werkstoff default_null_Werkstoff; private final List mOreByProducts = new ArrayList(); private final LinkedHashSet> contents = new LinkedHashSet<>(); HashSet subtags = new HashSet<>(); private byte[] rgb = new byte[3]; - private String defaultName; + private final String defaultName; private String toolTip; private Fluid fluid; private Fluid gas; + private Werkstoff.Stats stats; - private Werkstoff.Types type; - private GenerationFeatures generationFeatures; - private short mID; - private TextureSet texSet; + private final Werkstoff.Types type; + private final Werkstoff.GenerationFeatures generationFeatures; + private final short mID; + private final TextureSet texSet; public static void init(){ - default_null_Werkstoff = new Werkstoff(new short[3], "_NULL", "Default null Werkstoff", DEFAULT_NULL_STATS, Werkstoff.Types.UNDEFINED, DEFAULT_NULL_GENERATION_FEATURES, -1, TextureSet.SET_NONE); + Werkstoff.default_null_Werkstoff = new Werkstoff(new short[3], "_NULL", "Default null Werkstoff", Werkstoff.DEFAULT_NULL_STATS, Werkstoff.Types.UNDEFINED, Werkstoff.DEFAULT_NULL_GENERATION_FEATURES, -1, TextureSet.SET_NONE); } - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, contents); } - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents); } - public Werkstoff(short[] rgba, String toolTip, String defaultName, Werkstoff.Types type, GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { + public Werkstoff(short[] rgba, String toolTip, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { this(rgba, toolTip, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents); } - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { this(rgba, defaultName, "", stats, type, generationFeatures, mID, texSet, contents); this.mOreByProducts.addAll(oreByProduct); } - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { this(rgba, defaultName, "", stats, type, generationFeatures, mID, texSet, contents); } - public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { + public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { this(rgba, defaultName, toolTip, stats, type, generationFeatures, mID, texSet, contents); this.mOreByProducts.addAll(oreByProduct); } - public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { + public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { - if (idHashSet.contains((short) mID)) + if (Werkstoff.idHashSet.contains((short) mID)) throw new UnsupportedOperationException("ID (" + mID + ") is already in use!"); - idHashSet.add((short) mID); + Werkstoff.idHashSet.add((short) mID); if (type == null) type = Werkstoff.Types.UNDEFINED; @@ -138,11 +135,38 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.stats = stats.setMass(tmpmass); this.texSet = texSet; - werkstoffHashSet.add(this); - werkstoffHashMap.put(this.mID, this); + Werkstoff.werkstoffHashSet.add(this); + Werkstoff.werkstoffHashMap.put(this.mID, this); } + public void setTCAspects(Pair... pAspectsArr){ + this.stats.mTC_Aspects=pAspectsArr; + } + + public Pair[] getTCAspects(int ratio){ + if (this.stats.mTC_Aspects == null) { + HashSet tc_aspectStacks = new HashSet<>(); + HashSet> set = new HashSet<>(); + for (Pair p : this.getContents().getValue()) { + if (p.getKey() instanceof Materials) + tc_aspectStacks.addAll(((Materials) p.getKey()).mAspects); + if (p.getKey() instanceof Werkstoff) + set.addAll(Arrays.asList(((Werkstoff) p.getKey()).getTCAspects())); + } + tc_aspectStacks.forEach(tc_aspectStack -> set.add(new Pair(tc_aspectStack.mAspect.mAspect, (int) tc_aspectStack.mAmount))); + this.stats.mTC_Aspects = set.toArray(new Pair[0]); + } + Pair[] ret = this.stats.mTC_Aspects.clone(); + for (int i = 0; i < ret.length; i++) { + ret[i]=ret[i].copyWithNewValue(ret[i].getValue() * ratio); + } + return ret; + } + + public Pair[] getTCAspects(){ + return getTCAspects(1); + } public Werkstoff.Types getType() { return this.type; @@ -153,8 +177,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { switch (this.type) { case COMPOUND: case BIOLOGICAL: { - for (int i = 0; i < contents.toArray().length; i++) { - ret += ((Pair) contents.toArray()[i]).getValue(); + for (int i = 0; i < this.contents.toArray().length; i++) { + ret += ((Pair) this.contents.toArray()[i]).getValue(); } break; } @@ -166,31 +190,31 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public int getNoOfByProducts() { - return mOreByProducts.size(); + return this.mOreByProducts.size(); } public ISubTagContainer getOreByProductRaw(int aNumber){ - if (mOreByProducts.size() == 0) + if (this.mOreByProducts.size() == 0) return null; if (aNumber < 0) - aNumber = mOreByProducts.size() + aNumber; - while (aNumber >= mOreByProducts.size()) + aNumber = this.mOreByProducts.size() + aNumber; + while (aNumber >= this.mOreByProducts.size()) aNumber--; - ISubTagContainer o = mOreByProducts.get(aNumber); - if (o == null || o.equals(default_null_Werkstoff) || o.equals(Materials._NULL)) + ISubTagContainer o = this.mOreByProducts.get(aNumber); + if (o == null || o.equals(Werkstoff.default_null_Werkstoff) || o.equals(Materials._NULL)) return this; return o; } public ItemStack getOreByProduct(int aNumber, OrePrefixes prefixes) { - if (mOreByProducts.size() == 0) + if (this.mOreByProducts.size() == 0) return null; if (aNumber < 0) - aNumber = mOreByProducts.size() + aNumber; - while (aNumber >= mOreByProducts.size()) + aNumber = this.mOreByProducts.size() + aNumber; + while (aNumber >= this.mOreByProducts.size()) aNumber--; - Object o = mOreByProducts.get(aNumber); - if (o == null||o.equals(default_null_Werkstoff) || o.equals(Materials._NULL)) + Object o = this.mOreByProducts.get(aNumber); + if (o == null||o.equals(Werkstoff.default_null_Werkstoff) || o.equals(Materials._NULL)) return this.get(prefixes); if (o instanceof Werkstoff) return WerkstoffLoader.getCorresopndingItemStack(prefixes, (Werkstoff) o); @@ -215,7 +239,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.mID; } - public GenerationFeatures getGenerationFeatures() { + public Werkstoff.GenerationFeatures getGenerationFeatures() { return this.generationFeatures; } @@ -229,28 +253,30 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @Override public short[] getRGBA() { - return new short[]{(short) (rgb[0] + 128), (short) (rgb[1] + 128), (short) (rgb[2] + 128), 0}; + return new short[]{(short) (this.rgb[0] + 128), (short) (this.rgb[1] + 128), (short) (this.rgb[2] + 128), 0}; } @Override public boolean contains(SubTag subTag) { - for (Pair p : contents) + for (Pair p : this.contents) if (p.getKey().contains(subTag)) return true; - if (subtags.contains(subTag)) - return true; - return false; + return this.subtags.contains(subTag); } @Override public ISubTagContainer add(SubTag... subTags) { - subtags.addAll(Arrays.asList(subTags)); + this.subtags.addAll(Arrays.asList(subTags)); return this; } @Override public boolean remove(SubTag subTag) { - return subtags.remove(subTag); + return this.subtags.remove(subTag); + } + + public void getAndAddToCollection(OrePrefixes prefixes,int amount,Collection stacks){ + stacks.add(this.get(prefixes,amount)); } public ItemStack get(OrePrefixes prefixes) { @@ -264,15 +290,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public enum Types { MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, ELEMENT, UNDEFINED; - public static Stats getDefaultStatForType(Werkstoff.Types T) { + public static Werkstoff.Stats getDefaultStatForType(Werkstoff.Types T) { switch (T) { case COMPOUND: case BIOLOGICAL: - return new Stats().setElektrolysis(true); + return new Werkstoff.Stats().setElektrolysis(true); case MIXTURE: - return new Stats().setCentrifuge(true); + return new Werkstoff.Stats().setCentrifuge(true); default: - return new Stats(); + return new Werkstoff.Stats(); } } } @@ -286,40 +312,40 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { ore 1000 */ public byte toGenerate = 0b0001001; - public byte blacklist = 0b0000000; + public byte blacklist; - public GenerationFeatures setBlacklist(OrePrefixes p){ + public Werkstoff.GenerationFeatures setBlacklist(OrePrefixes p){ if (p == OrePrefixes.dustTiny || p == OrePrefixes.dust || p == OrePrefixes.dustSmall || p == OrePrefixes.crateGtDust){ - blacklist |= 1; + this.blacklist |= 1; }else - blacklist |= p.mMaterialGenerationBits; + this.blacklist |= p.mMaterialGenerationBits; return this; } public boolean hasDusts() { - return (toGenerate & 0b1) != 0; + return (this.toGenerate & 0b1) != 0; } public boolean hasGems() { - return (toGenerate & 0b100) != 0; + return (this.toGenerate & 0b100) != 0; } public boolean hasOres() { - return (toGenerate & 0b1000) != 0; + return (this.toGenerate & 0b1000) != 0; } - public GenerationFeatures removeGems(){ - if (hasGems()) - toGenerate = (byte) (toGenerate ^ 0b100); + public Werkstoff.GenerationFeatures removeGems(){ + if (this.hasGems()) + this.toGenerate = (byte) (this.toGenerate ^ 0b100); return this; } - public GenerationFeatures removeDusts(){ - if (hasDusts()) - toGenerate = (byte) (toGenerate ^ 0b1); + public Werkstoff.GenerationFeatures removeDusts(){ + if (this.hasDusts()) + this.toGenerate = (byte) (this.toGenerate ^ 0b1); return this; } - public GenerationFeatures removeOres(){ - if (hasOres()) - toGenerate = (byte) (toGenerate ^ 0b1000); + public Werkstoff.GenerationFeatures removeOres(){ + if (this.hasOres()) + this.toGenerate = (byte) (this.toGenerate ^ 0b1000); return this; } /* @@ -327,37 +353,37 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { * Auto add mixer Recipes 10 * Auto add Sifter Recipe 100 */ - public byte extraRecipes = 0b0; + public byte extraRecipes; - public GenerationFeatures addChemicalRecipes(){ + public Werkstoff.GenerationFeatures addChemicalRecipes(){ this.extraRecipes = (byte) (this.extraRecipes | 1); return this; } public boolean hasChemicalRecipes() { - return (extraRecipes & 1) != 0; + return (this.extraRecipes & 1) != 0; } - public GenerationFeatures addSifterRecipes(){ + public Werkstoff.GenerationFeatures addSifterRecipes(){ this.extraRecipes = (byte) (this.extraRecipes | 100); return this; } public boolean hasSifterRecipes() { - return (extraRecipes & 100) != 0; + return (this.extraRecipes & 100) != 0; } - public GenerationFeatures onlyDust() { - toGenerate = (byte) (1); + public Werkstoff.GenerationFeatures onlyDust() { + this.toGenerate = (byte) (1); return this; } - public GenerationFeatures disable() { - toGenerate = (byte) (0); + public Werkstoff.GenerationFeatures disable() { + this.toGenerate = (byte) (0); return this; } - public GenerationFeatures addGems() { - toGenerate = (byte) (toGenerate | 0x4); + public Werkstoff.GenerationFeatures addGems() { + this.toGenerate = (byte) (this.toGenerate | 0x4); return this; } @@ -372,9 +398,24 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { long neutrons; long electrons; long mass; + private Pair[] mTC_Aspects; //logic gate shit byte quality = ~0b111111; + public Stats setmTC_AspectsArray(Pair[] mTC_Aspects) { + this.mTC_Aspects = mTC_Aspects; + return this; + } + + public Stats setmTC_AspectsVarArg(Pair... mTC_Aspects) { + this.mTC_Aspects = mTC_Aspects; + return this; + } + + Pair[] getmTC_Aspects() { + return this.mTC_Aspects; + } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -393,88 +434,88 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(49).put(quality).putInt(boilingPoint).putInt(meltingPoint).putLong(protons).putLong(neutrons).putLong(electrons).putLong(mass).array(), 0, 49, 31); + return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(49).put(this.quality).putInt(this.boilingPoint).putInt(this.meltingPoint).putLong(this.protons).putLong(this.neutrons).putLong(this.electrons).putLong(this.mass).array(), 0, 49, 31); } - public Stats setMass(long mass) { - this.mass = protons; + public Werkstoff.Stats setMass(long mass) { + this.mass = this.protons; return this; } - public Stats setProtons(long protons) { + public Werkstoff.Stats setProtons(long protons) { this.protons = protons; return this; } public boolean isSublimation() { - return (quality & 0b1) == 0b1; + return (this.quality & 0b1) == 0b1; } public Werkstoff.Stats setSublimation(boolean sublimation) { if (sublimation) - quality = (byte) (quality | 0b000001); + this.quality = (byte) (this.quality | 0b000001); else - quality = (byte) (quality & 0b111110); + this.quality = (byte) (this.quality & 0b111110); return this; } public boolean isToxic() { - return (quality >> 1 & 0b1) == 0b1; + return (this.quality >> 1 & 0b1) == 0b1; } public Werkstoff.Stats setToxic(boolean toxic) { if (toxic) - quality = (byte) (quality | 0b000010); + this.quality = (byte) (this.quality | 0b000010); else - quality = (byte) (quality & 0b111101); + this.quality = (byte) (this.quality & 0b111101); return this; } public boolean isRadioactive() { - return (quality >> 2 & 0b1) == 0b1; + return (this.quality >> 2 & 0b1) == 0b1; } public Werkstoff.Stats setRadioactive(boolean radioactive) { if (radioactive) - quality = (byte) (quality | 0b000100); + this.quality = (byte) (this.quality | 0b000100); else - quality = (byte) (quality & 0b111011); + this.quality = (byte) (this.quality & 0b111011); return this; } public boolean isBlastFurnace() { - return (quality >> 3 & 0b1) == 0b1; + return (this.quality >> 3 & 0b1) == 0b1; } public Werkstoff.Stats setBlastFurnace(boolean blastFurnace) { if (blastFurnace) - quality = (byte) (quality | 0b001000); + this.quality = (byte) (this.quality | 0b001000); else - quality = (byte) (quality & 0b110111); + this.quality = (byte) (this.quality & 0b110111); return this; } public boolean isElektrolysis() { - return (quality >> 4 & 0b1) == 0b1; + return (this.quality >> 4 & 0b1) == 0b1; } public Werkstoff.Stats setElektrolysis(boolean elektrolysis) { if (elektrolysis) - quality = (byte) (quality | 0b010000); + this.quality = (byte) (this.quality | 0b010000); else - quality = (byte) (quality & 0b101111); + this.quality = (byte) (this.quality & 0b101111); return this; } public boolean isCentrifuge() { - return (quality >> 5 & 0b1) == 0b1; + return (this.quality >> 5 & 0b1) == 0b1; } public Werkstoff.Stats setCentrifuge(boolean centrifuge) { if (centrifuge) - quality = (byte) (quality | 0b100000); + this.quality = (byte) (this.quality | 0b100000); else - quality = (byte) (quality & 0b011111); + this.quality = (byte) (this.quality & 0b011111); return this; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index ebb7242ebd..18ea765786 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -25,10 +25,11 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.API.WerkstoffAdderRegistry; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; +import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; +import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; @@ -40,7 +41,6 @@ import gregtech.api.enums.*; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_MultiTexture; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.objects.MaterialStack; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -50,7 +50,10 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; import static gregtech.api.enums.OrePrefixes.*; @@ -103,8 +106,8 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().onlyDust().addGems(), 4, TextureSet.SET_DIAMOND, - Arrays.asList(WerkstoffLoader.Zirconium), - new Pair(WerkstoffLoader.Zirconium, 1), + Arrays.asList(Zirconium), + new Pair(Zirconium, 1), new Pair(Materials.Oxygen, 2) ); public static final Werkstoff FluorBuergerit = new Werkstoff( @@ -300,8 +303,8 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().addGems(), 19, TextureSet.SET_GEM_VERTICAL, - Arrays.asList(WerkstoffLoader.Zirconium,Materials.Silicon), - new Pair(WerkstoffLoader.Zirconium, 1), + Arrays.asList(Zirconium,Materials.Silicon), + new Pair(Zirconium, 1), new Pair(Materials.Silicon, 1), new Pair(Materials.Oxygen, 4) ); @@ -443,15 +446,12 @@ public class WerkstoffLoader implements Runnable { ); - - - public static HashMap items = new HashMap<>(); public static Block BWOres; - public boolean registered = false; + public boolean registered; public static ItemStack getCorresopndingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff) { - return getCorresopndingItemStack(orePrefixes, werkstoff, 1); + return WerkstoffLoader.getCorresopndingItemStack(orePrefixes, werkstoff, 1); } public static ItemStack getCorresopndingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { @@ -459,12 +459,12 @@ public class WerkstoffLoader implements Runnable { if (ret != null) return ret; if (orePrefixes == ore) - return new ItemStack(BWOres, amount, werkstoff.getmID()); - return new ItemStack(items.get(orePrefixes), amount, werkstoff.getmID()).copy(); + return new ItemStack(WerkstoffLoader.BWOres, amount, werkstoff.getmID()); + return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); } public void init() { - if (INSTANCE == null) + if (WerkstoffLoader.INSTANCE == null) MainMod.LOGGER.error("INSTANCE IS NULL THIS SHOULD NEVER HAPPEN!"); } @@ -472,30 +472,42 @@ public class WerkstoffLoader implements Runnable { MainMod.LOGGER.info("Making Meta Items for BW Materials"); long timepre = System.nanoTime(); WerkstoffAdderRegistry.getINSTANCE().run(); - addSubTags(); - addItemsForGeneration(); - runAdditionalOreDict(); + this.addSubTags(); + this.addItemsForGeneration(); + this.runAdditionalOreDict(); long timepost = System.nanoTime(); MainMod.LOGGER.info("Making Meta Items for BW Materials took " + (timepost - timepre) + "ns/" + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); } @Override public void run() { - if (!registered) { + if (!this.registered) { MainMod.LOGGER.info("Loading Processing Recipes for BW Materials"); long timepre = System.nanoTime(); ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashMap.size()+1); - + DebugLog.log("Loading Recipes"+(System.nanoTime()-timepre)); for (short i = 0; i < Werkstoff.werkstoffHashMap.size(); i++) { + long timepreone = System.nanoTime(); Werkstoff werkstoff = Werkstoff.werkstoffHashMap.get(i); + DebugLog.log("Werkstoff is null or id < 0 ? "+ (werkstoff==null || werkstoff.getmID() < 0) + " " + (System.nanoTime()-timepreone)); if (werkstoff == null || werkstoff.getmID() < 0) { progressBar.step(""); continue; } - addDustRecipes(werkstoff); - addGemRecipes(werkstoff); - addOreRecipes(werkstoff); - addCrushedRecipes(werkstoff); + DebugLog.log("Werkstoff: "+ werkstoff.getDefaultName() +" " +(System.nanoTime()-timepreone)); + DebugLog.log("Loading Dusts Recipes"+" " +(System.nanoTime()-timepreone)); + this.addDustRecipes(werkstoff); + DebugLog.log("Loading Gem Recipes"+" " +(System.nanoTime()-timepreone)); + this.addGemRecipes(werkstoff); + DebugLog.log("Loading Ore Recipes"+" " +(System.nanoTime()-timepreone)); + this.addOreRecipes(werkstoff); + DebugLog.log("Loading Crushed Recipes"+" " +(System.nanoTime()-timepreone)); + this.addCrushedRecipes(werkstoff); + if (Loader.isModLoaded("Thaumcraft")) { + DebugLog.log("Loading Aspects"+" " +(System.nanoTime()-timepreone)); + ThaumcraftHandler.AspectAdder.addAspectToAll(werkstoff); + } + DebugLog.log("Done"+" " +(System.nanoTime()-timepreone)); progressBar.step(werkstoff.getDefaultName()); } progressBar.step("Load Additional Recipes"); @@ -503,7 +515,7 @@ public class WerkstoffLoader implements Runnable { ProgressManager.pop(progressBar); long timepost = System.nanoTime(); MainMod.LOGGER.info("Loading Processing Recipes for BW Materials took " + (timepost - timepre) + "ns/" + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); - registered = true; + this.registered = true; } } @@ -511,13 +523,13 @@ public class WerkstoffLoader implements Runnable { for (Werkstoff W : Werkstoff.werkstoffHashMap.values()) { for (Pair pair : W.getContents().getValue().toArray(new Pair[0])) { - if (pair.getKey() instanceof Materials && ((Materials) pair.getKey()) == Materials.Neodymium) { + if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Neodymium) { W.add(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM); break; - } else if (pair.getKey() instanceof Materials && ((Materials) pair.getKey()) == Materials.Iron) { + } else if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Iron) { W.add(SubTag.ELECTROMAGNETIC_SEPERATION_IRON); break; - } else if (pair.getKey() instanceof Materials && ((Materials) pair.getKey()) == Materials.Gold) { + } else if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Gold) { W.add(SubTag.ELECTROMAGNETIC_SEPERATION_GOLD); break; } @@ -533,7 +545,7 @@ public class WerkstoffLoader implements Runnable { int toGenerateGlobal = 0b0000000; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - for (OrePrefixes p : OrePrefixes.values()) + for (OrePrefixes p : values()) if ((werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(),p,1) != null) { MainMod.LOGGER.info("Found: "+(p+werkstoff.getDefaultName().replaceAll(" ",""))+" in oreDict, disable and reroute my Items to that, also add a Tooltip."); werkstoff.getGenerationFeatures().setBlacklist(p); @@ -542,34 +554,34 @@ public class WerkstoffLoader implements Runnable { } if ((toGenerateGlobal & 0b1) != 0) { - items.put(dust, new BW_MetaGenerated_Items(dust)); - items.put(dustTiny, new BW_MetaGenerated_Items(dustTiny)); - items.put(dustSmall, new BW_MetaGenerated_Items(dustSmall)); + WerkstoffLoader.items.put(dust, new BW_MetaGenerated_Items(dust)); + WerkstoffLoader.items.put(dustTiny, new BW_MetaGenerated_Items(dustTiny)); + WerkstoffLoader.items.put(dustSmall, new BW_MetaGenerated_Items(dustSmall)); } if ((toGenerateGlobal & 0b10) != 0) { - items.put(ingot, new BW_MetaGenerated_Items(ingot)); + WerkstoffLoader.items.put(ingot, new BW_MetaGenerated_Items(ingot)); } if ((toGenerateGlobal & 0b100) != 0) { - items.put(gem, new BW_MetaGenerated_Items(gem)); - items.put(gemChipped, new BW_MetaGenerated_Items(gemChipped)); - items.put(gemExquisite, new BW_MetaGenerated_Items(gemExquisite)); - items.put(gemFlawed, new BW_MetaGenerated_Items(gemFlawed)); - items.put(gemFlawless, new BW_MetaGenerated_Items(gemFlawless)); - items.put(lens,new BW_MetaGenerated_Items(lens)); + WerkstoffLoader.items.put(gem, new BW_MetaGenerated_Items(gem)); + WerkstoffLoader.items.put(gemChipped, new BW_MetaGenerated_Items(gemChipped)); + WerkstoffLoader.items.put(gemExquisite, new BW_MetaGenerated_Items(gemExquisite)); + WerkstoffLoader.items.put(gemFlawed, new BW_MetaGenerated_Items(gemFlawed)); + WerkstoffLoader.items.put(gemFlawless, new BW_MetaGenerated_Items(gemFlawless)); + WerkstoffLoader.items.put(lens,new BW_MetaGenerated_Items(lens)); } if ((toGenerateGlobal & 0b1000) != 0) { if (FMLCommonHandler.instance().getSide().isClient()) RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); - BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); - GameRegistry.registerBlock(BWOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.01"); - - items.put(crushed, new BW_MetaGenerated_Items(crushed)); - items.put(crushedPurified, new BW_MetaGenerated_Items(crushedPurified)); - items.put(crushedCentrifuged, new BW_MetaGenerated_Items(crushedCentrifuged)); - items.put(dustPure, new BW_MetaGenerated_Items(dustPure)); - items.put(dustImpure, new BW_MetaGenerated_Items(dustImpure)); + WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); + GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.01"); + + WerkstoffLoader.items.put(crushed, new BW_MetaGenerated_Items(crushed)); + WerkstoffLoader.items.put(crushedPurified, new BW_MetaGenerated_Items(crushedPurified)); + WerkstoffLoader.items.put(crushedCentrifuged, new BW_MetaGenerated_Items(crushedCentrifuged)); + WerkstoffLoader.items.put(dustPure, new BW_MetaGenerated_Items(dustPure)); + WerkstoffLoader.items.put(dustImpure, new BW_MetaGenerated_Items(dustImpure)); } } @@ -581,21 +593,21 @@ public class WerkstoffLoader implements Runnable { OreDictionary.registerOre("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens)); } - GT_OreDictUnificator.registerOre("craftingIndustrialDiamond",Zirconia.get(gemExquisite)); + GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.Zirconia.get(gemExquisite)); } private void addGemRecipes(Werkstoff werkstoff) { if (werkstoff.getGenerationFeatures().hasGems()) { if (werkstoff.getGenerationFeatures().hasSifterRecipes() || ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0)) { GT_Values.RA.addSifterRecipe( - getCorresopndingItemStack(crushedPurified, werkstoff), + WerkstoffLoader.getCorresopndingItemStack(crushedPurified, werkstoff), new ItemStack[]{ - getCorresopndingItemStack(gemExquisite, werkstoff), - getCorresopndingItemStack(gemFlawless, werkstoff), - getCorresopndingItemStack(gem, werkstoff), - getCorresopndingItemStack(gemFlawed, werkstoff), - getCorresopndingItemStack(gemChipped, werkstoff), - getCorresopndingItemStack(dust, werkstoff) + WerkstoffLoader.getCorresopndingItemStack(gemExquisite, werkstoff), + WerkstoffLoader.getCorresopndingItemStack(gemFlawless, werkstoff), + WerkstoffLoader.getCorresopndingItemStack(gem, werkstoff), + WerkstoffLoader.getCorresopndingItemStack(gemFlawed, werkstoff), + WerkstoffLoader.getCorresopndingItemStack(gemChipped, werkstoff), + WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff) }, new int[]{ 100, 400, 1500, 2000, 4000, 5000 @@ -621,12 +633,12 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawed), werkstoff.get(gemChipped, 2), 64, 16); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemChipped), werkstoff.get(dustTiny), 64, 16); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawless, 3), 8, werkstoff.get(gemExquisite), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gem, 3), 8, werkstoff.get(gemFlawless), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawed, 3), 8, werkstoff.get(gem), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemChipped, 3), 8, werkstoff.get(gemFlawed), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawless, 3), 8, werkstoff.get(gemExquisite), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(gem, 3), 8, werkstoff.get(gemFlawless), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawed, 3), 8, werkstoff.get(gem), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(gemChipped, 3), 8, werkstoff.get(gemFlawed), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(dust, 4), 24, werkstoff.get(gem, 3), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 8)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(dust, 4), 24, werkstoff.get(gem, 3), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)); if ((werkstoff.getGenerationFeatures().toGenerate & 2) != 0){ GT_Values.RA.addLatheRecipe(werkstoff.get(plate),werkstoff.get(lens),werkstoff.get(dustSmall), 1200, 120); @@ -697,12 +709,12 @@ public class WerkstoffLoader implements Runnable { } } } - ItemStack input = getCorresopndingItemStack(dust, werkstoff); + ItemStack input = WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff); input.stackSize = werkstoff.getContents().getKey(); if (werkstoff.getStats().isElektrolysis()) - GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), (Object) null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); + GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); if (werkstoff.getStats().isCentrifuge()) - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), (Object) null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0); if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); @@ -710,31 +722,31 @@ public class WerkstoffLoader implements Runnable { } } - GT_ModHandler.addCraftingRecipe(getCorresopndingItemStack(dust, werkstoff), new Object[]{ + GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff), new Object[]{ "TTT","TTT","TTT",'T', - getCorresopndingItemStack(dustTiny, werkstoff) + WerkstoffLoader.getCorresopndingItemStack(dustTiny, werkstoff) }); - GT_ModHandler.addCraftingRecipe(getCorresopndingItemStack(dust, werkstoff), new Object[]{ + GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff), new Object[]{ "TT ","TT ",'T', - getCorresopndingItemStack(dustSmall, werkstoff) + WerkstoffLoader.getCorresopndingItemStack(dustSmall, werkstoff) }); - GT_ModHandler.addCraftingRecipe(getCorresopndingItemStack(dustSmall, werkstoff, 4), new Object[]{ - " T ", 'T', getCorresopndingItemStack(dust, werkstoff) + GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorresopndingItemStack(dustSmall, werkstoff, 4), new Object[]{ + " T ", 'T', WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff) }); - GT_ModHandler.addCraftingRecipe(getCorresopndingItemStack(dustTiny, werkstoff, 9), new Object[]{ - "T ", 'T', getCorresopndingItemStack(dust, werkstoff) + GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorresopndingItemStack(dustTiny, werkstoff, 9), new Object[]{ + "T ", 'T', WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff) }); if ((werkstoff.getGenerationFeatures().toGenerate & 2) != 0 && !werkstoff.getStats().isBlastFurnace()) { - GT_ModHandler.addSmeltingRecipe(getCorresopndingItemStack(dust, werkstoff), getCorresopndingItemStack(ingot, werkstoff)); - GT_ModHandler.addSmeltingRecipe(getCorresopndingItemStack(dustTiny, werkstoff), getCorresopndingItemStack(nugget, werkstoff)); + GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff), WerkstoffLoader.getCorresopndingItemStack(ingot, werkstoff)); + GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorresopndingItemStack(dustTiny, werkstoff), WerkstoffLoader.getCorresopndingItemStack(nugget, werkstoff)); } } } private void addOreRecipes(Werkstoff werkstoff) { if ((werkstoff.getGenerationFeatures().toGenerate & 2) != 0 && !werkstoff.getStats().isBlastFurnace()) - GT_ModHandler.addSmeltingRecipe(getCorresopndingItemStack(ore, werkstoff), getCorresopndingItemStack(ingot, werkstoff)); + GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorresopndingItemStack(ore, werkstoff), WerkstoffLoader.getCorresopndingItemStack(ingot, werkstoff)); if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0) { GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ore), werkstoff.getGenerationFeatures().hasGems() ? werkstoff.get(gem) : werkstoff.get(crushed), 16, 10); @@ -759,8 +771,8 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), 10, 16); GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), werkstoff.getOreByProduct(0, dust), 10, false); - GT_ModHandler.addOreWasherRecipe(werkstoff.get(crushed), 1000, werkstoff.get(crushedPurified), werkstoff.getOreByProduct(0, dustTiny), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L)); - GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushed), (int) Math.min(5000L, Math.abs(werkstoff.getStats().protons * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dustTiny), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L)); + GT_ModHandler.addOreWasherRecipe(werkstoff.get(crushed), 1000, werkstoff.get(crushedPurified), werkstoff.getOreByProduct(0, dustTiny), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); + GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushed), (int) Math.min(5000L, Math.abs(werkstoff.getStats().protons * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dustTiny), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), 10, 16); GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), werkstoff.getOreByProduct(1, dust), 10, false); @@ -779,15 +791,15 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustImpure), gregtech.api.util.GT_ModHandler.getDistilledWater(200L), werkstoff.get(gem), 9500, 1500, 24); } if (werkstoff.contains(SubTag.WASHING_MERCURY)) - GT_Values.RA.addChemicalBathRecipe(werkstoff.get(crushed), Materials.Mercury.getFluid(1000L), werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); + GT_Values.RA.addChemicalBathRecipe(werkstoff.get(crushed), Materials.Mercury.getFluid(1000L), werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); if (werkstoff.contains(SubTag.WASHING_SODIUMPERSULFATE)) - GT_Values.RA.addChemicalBathRecipe(werkstoff.get(crushed), Materials.SodiumPersulfate.getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L), werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); + GT_Values.RA.addChemicalBathRecipe(werkstoff.get(crushed), Materials.SodiumPersulfate.getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L), werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_GOLD)) - GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Gold, 1L), GT_OreDictUnificator.get(OrePrefixes.nugget, Materials.Gold, 1L), new int[]{10000, 4000, 2000}, 400, 24); + GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Gold, 1L), GT_OreDictUnificator.get(nugget, Materials.Gold, 1L), new int[]{10000, 4000, 2000}, 400, 24); else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_IRON)) - GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Iron, 1L), GT_OreDictUnificator.get(OrePrefixes.nugget, Materials.Iron, 1L), new int[]{10000, 4000, 2000}, 400, 24); + GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Iron, 1L), GT_OreDictUnificator.get(nugget, Materials.Iron, 1L), new int[]{10000, 4000, 2000}, 400, 24); else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM)) - GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Neodymium, 1L), GT_OreDictUnificator.get(OrePrefixes.nugget, Materials.Neodymium, 1L), new int[]{10000, 4000, 2000}, 400, 24); + GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Neodymium, 1L), GT_OreDictUnificator.get(nugget, Materials.Neodymium, 1L), new int[]{10000, 4000, 2000}, 400, 24); } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java index 4196a9eadc..acc6da7b14 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java @@ -34,7 +34,6 @@ public class Pair implements Map.Entry { this.pair = pair; } - public Pair(A k, B v) { this.pair[0] = k; this.pair[1] = v; @@ -71,4 +70,13 @@ public class Pair implements Map.Entry { pair[1] = value; return (B) pair[1]; } + + public Pair copyWithNewValue(B value){ + return new Pair<>((A)this.pair[0],value); + } + + public Pair replaceValue(B value){ + this.setValue(value); + return this; + } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java index c3c7f7d3e6..505350d401 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java @@ -22,7 +22,7 @@ package com.github.bartimaeusnek.crossmod.galacticraft; -import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128; +import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; @@ -42,11 +42,11 @@ public class GalacticraftProxy { public static void preInit(FMLPreInitializationEvent e) { if (FMLCommonHandler.instance().getSide().isServer() || FMLCommonHandler.instance().getEffectiveSide().isServer()) { - serverpreInit(e); + GalacticraftProxy.serverpreInit(e); } else { - clientpreInit(e); + GalacticraftProxy.clientpreInit(e); } - commonpreInit(e); + GalacticraftProxy.commonpreInit(e); } private static void serverpreInit(FMLPreInitializationEvent e) { @@ -57,15 +57,15 @@ public class GalacticraftProxy { } private static void commonpreInit(FMLPreInitializationEvent e) { - gtConf = new Configuration(new File(new File(e.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg")); - uo_dimensionList.getConfig(gtConf, "undergroundfluid"); + GalacticraftProxy.gtConf = new Configuration(new File(new File(e.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg")); + GalacticraftProxy.uo_dimensionList.getConfig(GalacticraftProxy.gtConf, "undergroundfluid"); init_undergroundFluidsRoss128(); - if (gtConf.hasChanged()) - gtConf.save(); + if (GalacticraftProxy.gtConf.hasChanged()) + GalacticraftProxy.gtConf.save(); Configuration c = new Configuration(new File(e.getModConfigurationDirectory(), "bartworks.cfg")); - Ross128.ross128ID = c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64); - Ross128.enabled = c.get("CrossMod Interactions", "Galacticraft - Activate Ross128 System", true, "If the Ross128 System should be activated").getBoolean(true); + Ross128SolarSystem.ross128ID = c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64); + Ross128SolarSystem.enabled = c.get("CrossMod Interactions", "Galacticraft - Activate Ross128 System", true, "If the Ross128 System should be activated").getBoolean(true); if (c.hasChanged()) c.save(); @@ -74,11 +74,11 @@ public class GalacticraftProxy { public static void init(FMLInitializationEvent e) { if (FMLCommonHandler.instance().getSide().isServer() || FMLCommonHandler.instance().getEffectiveSide().isServer()) { - serverInit(e); + GalacticraftProxy.serverInit(e); } else { - clientInit(e); + GalacticraftProxy.clientInit(e); } - commonInit(e); + GalacticraftProxy.commonInit(e); } private static void serverInit(FMLInitializationEvent e) { @@ -90,7 +90,7 @@ public class GalacticraftProxy { } private static void commonInit(FMLInitializationEvent e) { - if (Ross128.enabled) - Ross128.init(); + if (Ross128SolarSystem.enabled) + Ross128SolarSystem.init(); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_OreLayer.java index 95155b1487..4f15b27b60 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_OreLayer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_OreLayer.java @@ -44,7 +44,7 @@ public class BW_OreLayer extends GT_Worldgen { public static final List sList = new ArrayList<>(); private static final boolean logOregenRoss128 = false; public static int sWeight; - public byte bwOres = 0b0000; + public byte bwOres; public int mMinY, mWeight, mDensity, mSize, mMaxY, mPrimaryMeta, mSecondaryMeta, mBetweenMeta, mSporadicMeta; public BW_OreLayer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { @@ -55,42 +55,42 @@ public class BW_OreLayer extends GT_Worldgen { this.mDensity = (short) aDensity; this.mSize = (short) Math.max(1, aSize); - if (mEnabled) + if (this.mEnabled) BW_OreLayer.sWeight += this.mWeight; if (top instanceof Werkstoff) - bwOres = (byte) (bwOres | 0b1000); + this.bwOres = (byte) (this.bwOres | 0b1000); if (bottom instanceof Werkstoff) - bwOres = (byte) (bwOres | 0b0100); + this.bwOres = (byte) (this.bwOres | 0b0100); if (between instanceof Werkstoff) - bwOres = (byte) (bwOres | 0b0010); + this.bwOres = (byte) (this.bwOres | 0b0010); if (sprinkled instanceof Werkstoff) - bwOres = (byte) (bwOres | 0b0001); + this.bwOres = (byte) (this.bwOres | 0b0001); short aPrimary = top instanceof Materials ? (short) ((Materials) top).mMetaItemSubID : top instanceof Werkstoff ? - (short) ((Werkstoff) top).getmID() : + ((Werkstoff) top).getmID() : 0; short aSecondary = bottom instanceof Materials ? (short) ((Materials) bottom).mMetaItemSubID : bottom instanceof Werkstoff ? - (short) ((Werkstoff) bottom).getmID() : + ((Werkstoff) bottom).getmID() : 0; short aBetween = between instanceof Materials ? (short) ((Materials) between).mMetaItemSubID : between instanceof Werkstoff ? - (short) ((Werkstoff) between).getmID() : + ((Werkstoff) between).getmID() : 0; short aSporadic = sprinkled instanceof Materials ? (short) ((Materials) sprinkled).mMetaItemSubID : sprinkled instanceof Werkstoff ? - (short) ((Werkstoff) sprinkled).getmID() : + ((Werkstoff) sprinkled).getmID() : 0; - this.mPrimaryMeta = (short) aPrimary; - this.mSecondaryMeta = (short) aSecondary; - this.mBetweenMeta = (short) aBetween; - this.mSporadicMeta = (short) aSporadic; + this.mPrimaryMeta = aPrimary; + this.mSecondaryMeta = aSecondary; + this.mBetweenMeta = aBetween; + this.mSporadicMeta = aSporadic; } @@ -110,30 +110,30 @@ public class BW_OreLayer extends GT_Worldgen { if (this.mSecondaryMeta > 0) { for (i = tMinY - 1; i < tMinY + 2; ++i) { if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { - setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false); + this.setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false); } } } if (this.mBetweenMeta > 0 && (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) { - setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); + this.setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); } if (this.mPrimaryMeta > 0) { for (i = tMinY + 3; i < tMinY + 6; ++i) { if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { - setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false); + this.setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false); } } } if (this.mSporadicMeta > 0 && (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) { - setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); + this.setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); } } } - if (logOregenRoss128) { + if (BW_OreLayer.logOregenRoss128) { MainMod.LOGGER.info("Generated Orevein: " + this.mWorldGenName + " " + aChunkX + " " + aChunkZ); } @@ -142,7 +142,7 @@ public class BW_OreLayer extends GT_Worldgen { } public boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre) { - if ((aMetaData == mSporadicMeta && (bwOres & 0b0001) != 0) || (aMetaData == mBetweenMeta && (bwOres & 0b0010) != 0) || (aMetaData == mPrimaryMeta && (bwOres & 0b1000) != 0) || (aMetaData == mSecondaryMeta && (bwOres & 0b0100) != 0)) { + if ((aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0) || (aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0) || (aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0) || (aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0)) { return BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false); } return GT_TileEntity_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, isSmallOre, false); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java index 57dc4ac57d..2571ecf8a0 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java @@ -46,7 +46,7 @@ public class BW_WordGenerator implements IWorldGenerator { } public synchronized void generate(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - new WorldGenContainer(aX * 16, aZ * 16, aWorld.provider.dimensionId, aWorld, aChunkGenerator, aChunkProvider).run(); + new BW_WordGenerator.WorldGenContainer(aX * 16, aZ * 16, aWorld.provider.dimensionId, aWorld, aChunkGenerator, aChunkProvider).run(); } public static class WorldGenContainer implements Runnable { @@ -65,7 +65,6 @@ public class BW_WordGenerator implements IWorldGenerator { this.mWorld = aWorld; this.mChunkGenerator = aChunkGenerator; this.mChunkProvider = aChunkProvider; - ; } //returns a coordinate of a center chunk of 3x3 square; the argument belongs to this square @@ -75,11 +74,11 @@ public class BW_WordGenerator implements IWorldGenerator { } public boolean surroundingChunksLoaded(int xCenter, int zCenter) { - return mWorld.checkChunksExist(xCenter - 16, 0, zCenter - 16, xCenter + 16, 0, zCenter + 16); + return this.mWorld.checkChunksExist(xCenter - 16, 0, zCenter - 16, xCenter + 16, 0, zCenter + 16); } public XSTR getRandom(int xChunk, int zChunk) { - long worldSeed = mWorld.getSeed(); + long worldSeed = this.mWorld.getSeed(); XSTR fmlRandom = new XSTR(worldSeed); long xSeed = fmlRandom.nextLong() >> 2 + 1L; long zSeed = fmlRandom.nextLong() >> 2 + 1L; @@ -89,21 +88,21 @@ public class BW_WordGenerator implements IWorldGenerator { } public void run() { - int xCenter = getVeinCenterCoordinate(mX >> 4); - int zCenter = getVeinCenterCoordinate(mZ >> 4); - Random random = getRandom(xCenter, zCenter); + int xCenter = this.getVeinCenterCoordinate(this.mX >> 4); + int zCenter = this.getVeinCenterCoordinate(this.mZ >> 4); + Random random = this.getRandom(xCenter, zCenter); xCenter <<= 4; zCenter <<= 4; ChunkCoordIntPair centerChunk = new ChunkCoordIntPair(xCenter, zCenter); - if (!mGenerated.contains(centerChunk) && surroundingChunksLoaded(xCenter, zCenter)) { - mGenerated.add(centerChunk); + if (!BW_WordGenerator.WorldGenContainer.mGenerated.contains(centerChunk) && this.surroundingChunksLoaded(xCenter, zCenter)) { + BW_WordGenerator.WorldGenContainer.mGenerated.add(centerChunk); if ((BW_OreLayer.sWeight > 0) && (BW_OreLayer.sList.size() > 0)) { boolean temp = true; int tRandomWeight; for (int i = 0; (i < 256) && (temp); i++) { tRandomWeight = random.nextInt(BW_OreLayer.sWeight); for (BW_OreLayer tWorldGen : BW_OreLayer.sList) { - tRandomWeight -= ((BW_OreLayer) tWorldGen).mWeight; + tRandomWeight -= tWorldGen.mWeight; if (tRandomWeight <= 0) { try { if (tWorldGen.executeWorldgen(this.mWorld, random, "", this.mDimensionType, xCenter, zCenter, this.mChunkGenerator, this.mChunkProvider)) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java index d907b7ce69..f355bb9a21 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128; +import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; import net.minecraft.util.StatCollector; @@ -63,7 +63,7 @@ public class BW_WorldGenRoss128 extends BW_OreLayer { @Override public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { - return aWorld.provider.dimensionId == Ross128.ross128ID; + return aWorld.provider.dimensionId == Ross128SolarSystem.ross128ID; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b.java index 6ed4b1bc6c..9b2b9fc75a 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b.java @@ -22,7 +22,7 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider; -import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128; +import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; @@ -129,7 +129,7 @@ public class WorldProviderRoss128b extends WorldProviderSpace implements IExitHe @Override public boolean canSpaceshipTierPass(int tier) { - return Ross128.Ross128b.getTierRequirement() <= tier; + return Ross128SolarSystem.Ross128b.getTierRequirement() <= tier; } @Override @@ -154,7 +154,7 @@ public class WorldProviderRoss128b extends WorldProviderSpace implements IExitHe @Override public CelestialBody getCelestialBody() { - return Ross128.Ross128b; + return Ross128SolarSystem.Ross128b; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128.java deleted file mode 100644 index 4caa6e02df..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.galacticraft.solarsystems; - -import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; -import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider.WorldProviderRoss128b; -import cpw.mods.fml.common.Loader; -import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; -import micdoodle8.mods.galacticraft.api.galaxies.*; -import micdoodle8.mods.galacticraft.api.vector.Vector3; -import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; -import net.minecraft.util.ResourceLocation; - -import java.util.Arrays; - -public class Ross128 { - - public static boolean enabled = true; - - public static SolarSystem Ross128System; - public static Star Ross128; - public static Planet Ross128b; - public static Moon Ross128ba; - // public static Block Ross128bBlocks; -// public static BlockMetaPair Ross128bStone,Ross128bDirt,Ross128bGrass; - public static int ross128ID = -64; - private Ross128() { - } - - public static void init() { - -// Ross128bBlocks = new UniversalSpaceBlocks("Ross128bBlocks",new String[]{BartWorksCrossmod.MOD_ID+":Ross128bStone",BartWorksCrossmod.MOD_ID+":Ross128bDirt",BartWorksCrossmod.MOD_ID+":Ross128bGrass"}); - - Ross128System = new SolarSystem("Ross128System", "milkyWay").setMapPosition(new Vector3(-1.0D, 1.3D, 0.0D)); - Ross128 = (Star) new Star("Ross128").setParentSolarSystem(Ross128System).setTierRequired(-1); - Ross128.setUnreachable(); - Ross128.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128.png")); - Ross128System.setMainStar(Ross128); - - Ross128b = new Planet("Ross128b").setParentSolarSystem(Ross128System); - Ross128b.setRingColorRGB((0x9F) / 255f, (0x8A) / 255f, (0x79) / 255f); - Ross128b.setPhaseShift(1.25F); - Ross128b.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128b.png")); - Ross128b.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(0.75F, 1.75F)); - Ross128b.setRelativeOrbitTime(0.65F); - Ross128b.atmosphere.addAll(Arrays.asList(IAtmosphericGas.OXYGEN, IAtmosphericGas.NITROGEN, IAtmosphericGas.ARGON)); - Ross128b.setDimensionInfo(ross128ID, WorldProviderRoss128b.class); - Ross128b.setTierRequired(Loader.isModLoaded("galaxyspace") ? 4 : Loader.isModLoaded("GalacticraftMars") ? 3 : -1); - - Ross128ba = new Moon("Ross128ba").setParentPlanet(Ross128b); - Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)).setRelativeOrbitTime(1 / 0.01F); - Ross128ba.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); - Ross128ba.setUnreachable(); //for now - -// GameRegistry.registerBlock(Ross128bBlocks,Ross128bBlocks.getUnlocalizedName()); -// -// Ross128bStone=new BlockMetaPair(Ross128bBlocks, (byte) 0); -// Ross128bDirt=new BlockMetaPair(Ross128bBlocks, (byte) 1); -// Ross128bGrass=new BlockMetaPair(Ross128bBlocks, (byte) 2); - - GalaxyRegistry.registerPlanet(Ross128b); - GalaxyRegistry.registerMoon(Ross128ba); - GalaxyRegistry.registerSolarSystem(Ross128System); - GalacticraftRegistry.registerTeleportType(WorldProviderRoss128b.class, new UniversalTeleportType()); - } - -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java new file mode 100644 index 0000000000..e7d539f969 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.solarsystems; + +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider.WorldProviderRoss128b; +import cpw.mods.fml.common.Loader; +import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; +import micdoodle8.mods.galacticraft.api.galaxies.*; +import micdoodle8.mods.galacticraft.api.vector.Vector3; +import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; +import net.minecraft.util.ResourceLocation; + +import java.util.Arrays; + +public class Ross128SolarSystem { + + public static boolean enabled = true; + + public static SolarSystem Ross128System; + public static Star Ross128; + public static Planet Ross128b; + public static Moon Ross128ba; + // public static Block Ross128bBlocks; +// public static BlockMetaPair Ross128bStone,Ross128bDirt,Ross128bGrass; + public static int ross128ID = -64; + private Ross128SolarSystem() { + } + + public static void init() { + +// Ross128bBlocks = new UniversalSpaceBlocks("Ross128bBlocks",new String[]{BartWorksCrossmod.MOD_ID+":Ross128bStone",BartWorksCrossmod.MOD_ID+":Ross128bDirt",BartWorksCrossmod.MOD_ID+":Ross128bGrass"}); + + Ross128SolarSystem.Ross128System = new SolarSystem("Ross128System", "milkyWay").setMapPosition(new Vector3(-1.0D, 1.3D, 0.0D)); + Ross128SolarSystem.Ross128 = (Star) new Star("Ross128").setParentSolarSystem(Ross128SolarSystem.Ross128System).setTierRequired(-1); + Ross128SolarSystem.Ross128.setUnreachable(); + Ross128SolarSystem.Ross128.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128.png")); + Ross128SolarSystem.Ross128System.setMainStar(Ross128SolarSystem.Ross128); + + Ross128SolarSystem.Ross128b = new Planet("Ross128b").setParentSolarSystem(Ross128SolarSystem.Ross128System); + Ross128SolarSystem.Ross128b.setRingColorRGB((0x9F) / 255f, (0x8A) / 255f, (0x79) / 255f); + Ross128SolarSystem.Ross128b.setPhaseShift(1.25F); + Ross128SolarSystem.Ross128b.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128b.png")); + Ross128SolarSystem.Ross128b.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(0.75F, 1.75F)); + Ross128SolarSystem.Ross128b.setRelativeOrbitTime(0.65F); + Ross128SolarSystem.Ross128b.atmosphere.addAll(Arrays.asList(IAtmosphericGas.OXYGEN, IAtmosphericGas.NITROGEN, IAtmosphericGas.ARGON)); + Ross128SolarSystem.Ross128b.setDimensionInfo(Ross128SolarSystem.ross128ID, WorldProviderRoss128b.class); + Ross128SolarSystem.Ross128b.setTierRequired(Loader.isModLoaded("galaxyspace") ? 4 : Loader.isModLoaded("GalacticraftMars") ? 3 : -1); + + Ross128SolarSystem.Ross128ba = new Moon("Ross128ba").setParentPlanet(Ross128SolarSystem.Ross128b); + Ross128SolarSystem.Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)).setRelativeOrbitTime(1 / 0.01F); + Ross128SolarSystem.Ross128ba.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); + Ross128SolarSystem.Ross128ba.setUnreachable(); //for now + +// GameRegistry.registerBlock(Ross128bBlocks,Ross128bBlocks.getUnlocalizedName()); +// +// Ross128bStone=new BlockMetaPair(Ross128bBlocks, (byte) 0); +// Ross128bDirt=new BlockMetaPair(Ross128bBlocks, (byte) 1); +// Ross128bGrass=new BlockMetaPair(Ross128bBlocks, (byte) 2); + + GalaxyRegistry.registerPlanet(Ross128SolarSystem.Ross128b); + GalaxyRegistry.registerMoon(Ross128SolarSystem.Ross128ba); + GalaxyRegistry.registerSolarSystem(Ross128SolarSystem.Ross128System); + GalacticraftRegistry.registerTeleportType(WorldProviderRoss128b.class, new UniversalTeleportType()); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index a3cc19b41c..c9dfe96835 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -22,23 +22,96 @@ package com.github.bartimaeusnek.crossmod.thaumcraft.util; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.system.log.DebugLog; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.util.Pair; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TC_Aspects; +import net.minecraft.item.ItemStack; import net.minecraft.world.biome.BiomeGenBase; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + public class ThaumcraftHandler { private ThaumcraftHandler(){} - public static Integer taintBiomeID = null; + private static Integer taintBiomeID; public static boolean isTaintBiome(int biomeID){ - if (taintBiomeID == null) { + if (ThaumcraftHandler.taintBiomeID == null) { try { BiomeGenBase TaintBiome = (BiomeGenBase) Class.forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator").getField("biomeTaint").get(null); - return biomeID == (taintBiomeID = TaintBiome.biomeID); + return biomeID == (ThaumcraftHandler.taintBiomeID = TaintBiome.biomeID); } catch (ClassCastException | ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); return false; } } - return biomeID == taintBiomeID; + return biomeID == ThaumcraftHandler.taintBiomeID; + } + + public static class AspectAdder { + private static Class mAspectListClass; + private static Class mAspectClass; + private static Method registerObjectTag; + private static Method addToList; + private static Method getName; + + static { + try { + ThaumcraftHandler.AspectAdder.mAspectListClass = Class.forName("thaumcraft.api.aspects.AspectList"); + ThaumcraftHandler.AspectAdder.mAspectClass = Class.forName("thaumcraft.api.aspects.Aspect"); + ThaumcraftHandler.AspectAdder.addToList = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("add", ThaumcraftHandler.AspectAdder.mAspectClass,int.class); + ThaumcraftHandler.AspectAdder.registerObjectTag = Class.forName("thaumcraft.api.ThaumcraftApi").getMethod("registerObjectTag",ItemStack.class, ThaumcraftHandler.AspectAdder.mAspectListClass); + ThaumcraftHandler.AspectAdder.getName = mAspectClass.getMethod("getName"); + } catch (ClassNotFoundException | NoSuchMethodException e) { + e.printStackTrace(); + } + } + + public static void addAspectViaBW(ItemStack stack, Pair... aspectPair) { + if (stack == null || stack.getItem() == null || stack.getUnlocalizedName() == null) + return; + try { + Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); + for (Pair a : aspectPair) { + if (ConfigHandler.debugLog) + DebugLog.log("Stack:"+ stack.getDisplayName() + " Damage:" +stack.getItemDamage() + " aspectPair: " + getName.invoke(a.getKey()) + " / " + a.getValue()); + ThaumcraftHandler.AspectAdder.addToList.invoke(aspectList, a.getKey(), a.getValue()); + } + ThaumcraftHandler.AspectAdder.registerObjectTag.invoke(null, stack, aspectList); + }catch (IllegalAccessException | InstantiationException | InvocationTargetException e){ + e.printStackTrace(); + } + } + + public static void addAspectViaGT(ItemStack stack, TC_Aspects.TC_AspectStack... tc_aspectStacks) { + try { + Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); + for (TC_Aspects.TC_AspectStack tc_aspects : tc_aspectStacks) + ThaumcraftHandler.AspectAdder.addToList.invoke(aspectList, tc_aspects.mAspect.mAspect, (int) tc_aspects.mAmount); + ThaumcraftHandler.AspectAdder.registerObjectTag.invoke(null, stack, aspectList); + }catch (IllegalAccessException | InstantiationException | InvocationTargetException e){ + e.printStackTrace(); + } + } + + public static void addAspectToAll(Werkstoff werkstoff){ + for (OrePrefixes element : OrePrefixes.values()) { + if ((werkstoff.getGenerationFeatures().toGenerate & element.mMaterialGenerationBits) != 0 && (werkstoff.getGenerationFeatures().blacklist & element.mMaterialGenerationBits) == 0) { + if (element.mMaterialAmount >= 3628800L || element == OrePrefixes.ore) { + DebugLog.log("OrePrefix: "+element.name() + " mMaterialAmount: " + element.mMaterialAmount/3628800L); + ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), werkstoff.getTCAspects(element == OrePrefixes.ore ? 1 : (int) (element.mMaterialAmount / 3628800L))); + } + else if (element.mMaterialAmount >= 0L) { + ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), new Pair(TC_Aspects.PERDITIO.mAspect, 1)); + } + } + } + } + + } } -- cgit From 86137b22f30dd5bd76f52d40cf2955b31a6f0d9d Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 12 Apr 2019 12:55:30 +0200 Subject: fixed Graphene Typo +prepared custom TC Aspects +enabled a config option for the threaded loader (experimental state) Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 5721ddab9fe1c14d56b9590ab48688fba9613100 --- .../github/bartimaeusnek/bartworks/MainMod.java | 28 ++--- .../bartworks/common/configs/ConfigHandler.java | 2 + .../bartworks/system/material/ThreadedLoader.java | 134 +++++++++------------ .../bartworks/system/material/Werkstoff.java | 14 +-- .../processingLoaders/AdditionalRecipes.java | 2 + .../ross128/world/oregen/BW_WordGenerator.java | 4 +- .../ross128/world/oregen/BW_WorldGenRoss128.java | 2 +- .../crossmod/thaumcraft/CustomAspects.java | 41 +++++-- .../thaumcraft/util/ThaumcraftHandler.java | 2 +- 9 files changed, 120 insertions(+), 109 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 7de924d625..2156adb295 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -36,35 +36,25 @@ import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; +import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; -import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.SubTag; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.IOException; -import java.util.HashSet; - -import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; @Mod( modid = MainMod.MOD_ID, name = MainMod.NAME, version = MainMod.VERSION, @@ -128,8 +118,12 @@ public final class MainMod { new LoaderRegistry().run(); if (ConfigHandler.BioLab) new BioLabLoader().run(); - if (ConfigHandler.newStuff) - WerkstoffLoader.INSTANCE.runInit(); + if (ConfigHandler.newStuff) { + if (ConfigHandler.experimentalThreadedLoader) + new ThreadedLoader().runInit(); + else + WerkstoffLoader.INSTANCE.runInit(); + } } @Mod.EventHandler @@ -138,8 +132,12 @@ public final class MainMod { if (ConfigHandler.BioLab) new GTNHBlocks().run(); BioObjectAdder.regenerateBioFluids(); - if (ConfigHandler.newStuff) - WerkstoffLoader.INSTANCE.run(); + if (ConfigHandler.newStuff) { + if (ConfigHandler.experimentalThreadedLoader) + new ThreadedLoader().run(); + else + WerkstoffLoader.INSTANCE.run(); + } ConfigHandler.setUpComments(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 2321c5e413..186f12c4e6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -44,6 +44,7 @@ public class ConfigHandler { public static int mbWaterperSec = 150; private static boolean ezmode = false; public static boolean debugLog = false; + public static boolean experimentalThreadedLoader = false; public ConfigHandler(@Nonnull FMLPreInitializationEvent e) { c = new Configuration(new File(e.getModConfigurationDirectory().toString() + "/" + MainMod.MOD_ID + ".cfg")); @@ -63,6 +64,7 @@ public class ConfigHandler { c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600); } debugLog=c.get("System","Enable Debug Log",false,"Enables or Disables the debug log.").getBoolean(false); + experimentalThreadedLoader =c.get("System","Enable Experimental Threaded Material Loader",false,"Enables or Disables the Experimental Threaded Material Loader.").getBoolean(false); if (c.hasChanged()) c.save(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java index e6f80e5e95..cc366d63f0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java @@ -1,74 +1,60 @@ -///* -// * Copyright (c) 2019 bartimaeusnek -// * -// * Permission is hereby granted, free of charge, to any person obtaining a copy -// * of this software and associated documentation files (the "Software"), to deal -// * in the Software without restriction, including without limitation the rights -// * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// * copies of the Software, and to permit persons to whom the Software is -// * furnished to do so, subject to the following conditions: -// * -// * The above copyright notice and this permission notice shall be included in all -// * copies or substantial portions of the Software. -// * -// * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// * SOFTWARE. -// */ -// -//package com.github.bartimaeusnek.bartworks.system.material; -// -//import com.github.bartimaeusnek.bartworks.MainMod; -//import cpw.mods.fml.common.ProgressManager; -// -//import java.util.ArrayList; -//import java.util.List; -// -//import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; -// -//public class ThreadedLoader implements Runnable { -// -// List threads = new ArrayList<>(); -// -// @Override -// public synchronized void run() { -// threads.add(new AllRecipes()); -// -// threads.forEach(Thread::start); -// -// -// } -// -// -// class AllRecipes extends Thread { -// -// public synchronized void run() { -// MainMod.LOGGER.info("Loading Processing Recipes for BW Materials"); -// long timepre = System.nanoTime(); -// ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashMap.size()); -// -// for (short i = 0; i < Werkstoff.werkstoffHashMap.size(); i++) { -// Werkstoff werkstoff = Werkstoff.werkstoffHashMap.get(i); -// if (werkstoff == null || werkstoff.getmID() < 0) { -// progressBar.step(""); -// continue; -// } -// addDustRecipes(werkstoff); -// addGemRecipes(werkstoff); -// addOreRecipes(werkstoff); -// addCrushedRecipes(werkstoff); -// progressBar.step(werkstoff.getDefaultName()); -// } -// ProgressManager.pop(progressBar); -// long timepost = System.nanoTime(); -// MainMod.LOGGER.info("Loading Processing Recipes for BW Materials took " + (timepost - timepre) + "ns/" + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); -// } -// } -// -// -// -//} +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import java.util.ArrayList; +import java.util.List; + +public class ThreadedLoader implements Runnable { + + List threads = new ArrayList<>(); + List threadsInit = new ArrayList<>(); + + + @Override + public synchronized void run() { + threads.add(new AllRecipes()); + threads.forEach(Thread::start); + } + + public synchronized void runInit() { + threadsInit.add(new MaterialGen()); + threadsInit.forEach(Thread::start); + } + + class AllRecipes extends Thread { + + public synchronized void run() { + WerkstoffLoader.INSTANCE.run(); + } + } + + class MaterialGen extends Thread { + public synchronized void run() { + WerkstoffLoader.INSTANCE.runInit(); + } + } + + + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index f732932eed..c1bd80e0ea 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -314,6 +314,13 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public byte toGenerate = 0b0001001; public byte blacklist; + /* + * Auto add Chemical Recipes 1 + * Auto add mixer Recipes 10 + * Auto add Sifter Recipe 100 + */ + public byte extraRecipes; + public Werkstoff.GenerationFeatures setBlacklist(OrePrefixes p){ if (p == OrePrefixes.dustTiny || p == OrePrefixes.dust || p == OrePrefixes.dustSmall || p == OrePrefixes.crateGtDust){ this.blacklist |= 1; @@ -348,12 +355,6 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.toGenerate = (byte) (this.toGenerate ^ 0b1000); return this; } - /* - * Auto add Chemical Recipes 1 - * Auto add mixer Recipes 10 - * Auto add Sifter Recipe 100 - */ - public byte extraRecipes; public Werkstoff.GenerationFeatures addChemicalRecipes(){ this.extraRecipes = (byte) (this.extraRecipes | 1); @@ -376,7 +377,6 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } - public Werkstoff.GenerationFeatures disable() { this.toGenerate = (byte) (0); return this; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 50190d49a4..29300cdbbe 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -35,10 +35,12 @@ import net.minecraftforge.fluids.FluidStack; import static gregtech.api.enums.OrePrefixes.*; public class AdditionalRecipes implements Runnable { + @Override public void run() { GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(11),Materials.Oxygen.getGas(3000),null, WerkstoffLoader.YttriumOxide.get(dust),64, BW_Util.getMachineVoltageFromTier(4)); GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust,10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.Zirconia.get(gemFlawed, 40)}, (Object) null, (int[]) null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953); GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall,2),WerkstoffLoader.Thorianit.get(dustSmall,2),Materials.Glass.getMolten(144),null,new ItemStack(ItemRegistry.bw_glasses[0],1,12),null,800,BW_Util.getMachineVoltageFromTier(5),3663); } + } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java index 2571ecf8a0..36e017d626 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java @@ -41,8 +41,8 @@ import java.util.Random; public class BW_WordGenerator implements IWorldGenerator { public BW_WordGenerator() { - //GT_NH Override... -// GameRegistry.registerWorldGenerator(this, 1073741823); + //GT_NH Override... wont be actually registered to force its generation directly in the ChunkProvider + //GameRegistry.registerWorldGenerator(this, 1073741823); } public synchronized void generate(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java index f355bb9a21..d01e782acf 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java @@ -42,7 +42,7 @@ public class BW_WorldGenRoss128 extends BW_OreLayer { public static void init_OresRoss128() { new BW_WorldGenRoss128("ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, WerkstoffLoader.Thorianit, Materials.Uraninite, Materials.Lepidolite, Materials.Spodumene); - new BW_WorldGenRoss128("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Materials.Graphite, Materials.Diamond, Materials.Coal, Materials.Graphene); + new BW_WorldGenRoss128("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Materials.Graphite, Materials.Diamond, Materials.Coal, Materials.Graphite); new BW_WorldGenRoss128("ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, WerkstoffLoader.Bismuthinit, Materials.Stibnite, Materials.Bismuth, WerkstoffLoader.Bismutite); new BW_WorldGenRoss128("ore.mix.ross128.TurmalinAlkali", true, 5, 200, 15, 4, 48, WerkstoffLoader.Olenit, WerkstoffLoader.FluorBuergerit, WerkstoffLoader.ChromoAluminoPovondrait, WerkstoffLoader.VanadioOxyDravit); new BW_WorldGenRoss128("ore.mix.ross128.Roquesit", true, 5, 250, 3, 1, 12, WerkstoffLoader.Arsenopyrite, WerkstoffLoader.Ferberite, WerkstoffLoader.Loellingit, WerkstoffLoader.Roquesit); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java index bb419228d1..542501ccce 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java @@ -22,15 +22,38 @@ package com.github.bartimaeusnek.crossmod.thaumcraft; -//import com.github.bartimaeusnek.bartworks.MainMod; -//import net.minecraft.util.ResourceLocation; -//import thaumcraft.api.aspects.Aspect; -// -//import static thaumcraft.api.aspects.Aspect.*; +import com.github.bartimaeusnek.bartworks.MainMod; -public class CustomAspects { -// final static Aspect TRADE = new Aspect("Artis",0x00FF00,new Aspect[]{EXCHANGE, MAN},new ResourceLocation(MainMod.MOD_ID+":Aspects/Artis.png"),1); -// final static Aspect UNIVERSE = new Aspect("Universum",0x0000FF,new Aspect[]{MAGIC, ELDRITCH},new ResourceLocation(MainMod.MOD_ID+":Aspects/Universum.png"),1); -// final static Aspect SCIENCE = new Aspect("Scientia",0x00FFFF,new Aspect[]{MAN, UNIVERSE},new ResourceLocation(MainMod.MOD_ID+":Aspects/Scientia.png"),1); +import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; +import net.minecraft.util.ResourceLocation; + +import java.lang.reflect.Array; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +public class CustomAspects { +// static Constructor aspectConstructor; +// static Object TRADE; +// static Object UNIVERSE; +// static Object SCIENCE; +// static Object[] tmpArray = new Object[3]; +// static{ +// try { +// aspectConstructor = ThaumcraftHandler.AspectAdder.mAspectClass.getConstructor(String.class,int.class, Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,1).getClass(), ResourceLocation.class,int.class); +// tmpArray[0] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); +// tmpArray[1] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); +// tmpArray[2] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); +// Array.set(tmpArray[0],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("EXCHANGE").get(null)); +// Array.set(tmpArray[0],1,ThaumcraftHandler.AspectAdder.mAspectClass.getField("GREED").get(null)); +// TRADE = aspectConstructor.newInstance("Artis",0x00FF00, tmpArray[0],new ResourceLocation(MainMod.MOD_ID+":Aspects/Artis.png"),1); +// Array.set(tmpArray[1],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("MAGIC").get(null)); +// Array.set(tmpArray[1],1,ThaumcraftHandler.AspectAdder.mAspectClass.getField("ELDRITCH").get(null)); +// UNIVERSE = aspectConstructor.newInstance("Universum",0x0000FF, tmpArray[1],new ResourceLocation(MainMod.MOD_ID+":Aspects/Universum.png"),1); +// Array.set(tmpArray[2],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("MAN").get(null)); +// Array.set(tmpArray[2],1,UNIVERSE); +// SCIENCE = aspectConstructor.newInstance("Scientia",0x00FFFF, tmpArray[2],new ResourceLocation(MainMod.MOD_ID+":Aspects/Scientia.png"),1); +// } catch (NoSuchMethodException | NoSuchFieldException | IllegalAccessException | InstantiationException | InvocationTargetException e) { +// e.printStackTrace(); +// } +// } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index c9dfe96835..d0df9188a2 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -54,7 +54,7 @@ public class ThaumcraftHandler { public static class AspectAdder { private static Class mAspectListClass; - private static Class mAspectClass; + public static Class mAspectClass; private static Method registerObjectTag; private static Method addToList; private static Method getName; -- cgit From c5f23f6dcfc44dacf907b19e09c67632b6f5aaa9 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 12 Apr 2019 16:50:30 +0200 Subject: Improved Threaded Loader +un-threaded GameRegistry stuff +version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 6a1eb48d1e35e96f235ba5b743f7ce6d4cf33af5 --- build.properties | 2 +- .../bartworks/system/material/ThreadedLoader.java | 20 ++++++++++++++++++++ .../bartworks/system/material/WerkstoffLoader.java | 20 ++++++++++++-------- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/build.properties b/build.properties index ab5c5addf1..3d69f35b15 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=5 +buildNumber=6 APIVersion=5 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java index cc366d63f0..d34fd03818 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material; +import com.github.bartimaeusnek.bartworks.MainMod; +import cpw.mods.fml.common.FMLCommonHandler; + import java.util.ArrayList; import java.util.List; @@ -33,13 +36,30 @@ public class ThreadedLoader implements Runnable { @Override public synchronized void run() { + MainMod.LOGGER.warn("EXPERIMENTAL THREADED-LOADER ENABLED!"); + MainMod.LOGGER.info("Starting to register BartWorks Materials Recipes to Gregtech"); threads.add(new AllRecipes()); threads.forEach(Thread::start); } public synchronized void runInit() { + MainMod.LOGGER.warn("EXPERIMENTAL THREADED-LOADER ENABLED!"); + MainMod.LOGGER.info("Starting the Material Generation Thread"); threadsInit.add(new MaterialGen()); threadsInit.forEach(Thread::start); + for (Thread thread : threadsInit) { + try { + MainMod.LOGGER.info("Trying to join the Material Generation Thread"); + thread.join(); + }catch (InterruptedException e){ + e.printStackTrace(); + FMLCommonHandler.instance().exitJava(500,true); + } + } + MainMod.LOGGER.info("Successfully joined the Material Generation Thread, Registering the Items/Blocks to the GameRegistry"); + if ((WerkstoffLoader.toGenerateGlobal & 0b1000) != 0) + WerkstoffLoader.INSTANCE.gameRegistryHandler(); + } class AllRecipes extends Thread { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 18ea765786..1a805cd8d0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.API.WerkstoffAdderRegistry; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; @@ -541,9 +542,8 @@ public class WerkstoffLoader implements Runnable { } } + public static int toGenerateGlobal = 0b0000000; private void addItemsForGeneration() { - int toGenerateGlobal = 0b0000000; - for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { for (OrePrefixes p : values()) if ((werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(),p,1) != null) { @@ -571,12 +571,8 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.items.put(lens,new BW_MetaGenerated_Items(lens)); } if ((toGenerateGlobal & 0b1000) != 0) { - if (FMLCommonHandler.instance().getSide().isClient()) - RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); - GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); - WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); - GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.01"); - + if (!ConfigHandler.experimentalThreadedLoader) + gameRegistryHandler(); WerkstoffLoader.items.put(crushed, new BW_MetaGenerated_Items(crushed)); WerkstoffLoader.items.put(crushedPurified, new BW_MetaGenerated_Items(crushedPurified)); WerkstoffLoader.items.put(crushedCentrifuged, new BW_MetaGenerated_Items(crushedCentrifuged)); @@ -585,6 +581,14 @@ public class WerkstoffLoader implements Runnable { } } + public void gameRegistryHandler(){ + if (FMLCommonHandler.instance().getSide().isClient()) + RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); + GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); + WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); + GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.01"); + } + private void runAdditionalOreDict(){ for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { if (werkstoff.getGenerationFeatures().hasOres()) -- cgit From c74b1a862d9935995f1a56e3a9061e2eb2a5aec6 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 12 Apr 2019 17:32:17 +0200 Subject: Fixed Heated Water Pump + will now drop its contents on removal + will no longer void non-burnable Items + Added ITileDropsContent for easy use + Pulled delSlot into its own Class + Created FuelSlot (a slot that will only accept burnable stacks) + API version increase + version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: bd948c36072c94e50c89213d233f9a718bb0a43b --- build.properties | 4 +-- .../bartworks/API/ITileDropsContent.java | 32 +++++++++++++++++ .../common/blocks/BW_TileEntityContainer.java | 17 +++++++++ .../classic/BW_TileEntity_HeatedWaterPump.java | 3 +- .../container/BW_Container_HeatedWaterPump.java | 3 +- .../container/GT_Container_Item_Destructopack.java | 17 ++------- .../server/container/Slots/BW_DelSlot.java | 40 ++++++++++++++++++++++ .../server/container/Slots/BW_FuelSlot.java | 39 +++++++++++++++++++++ .../system/material/BW_MetaGenerated_Ores.java | 7 ++-- 9 files changed, 139 insertions(+), 23 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java diff --git a/build.properties b/build.properties index 3d69f35b15..22690fd078 100644 --- a/build.properties +++ b/build.properties @@ -23,8 +23,8 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=6 -APIVersion=5 +buildNumber=7 +APIVersion=6 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java new file mode 100644 index 0000000000..a84f254d8a --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +import net.minecraft.inventory.ISidedInventory; + +public interface ITileDropsContent extends ISidedInventory { + default int[] getDropSlots(){ + return new int[] {0}; + }; + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index fc546fc980..4cc851df67 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.blocks; import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; +import com.github.bartimaeusnek.bartworks.API.ITileDropsContent; import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; import com.github.bartimaeusnek.bartworks.MainMod; @@ -32,14 +33,17 @@ import cpw.mods.fml.relauncher.SideOnly; import ic2.api.tile.IWrenchable; import ic2.core.IC2; import ic2.core.IHasGui; +import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; +import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; @@ -115,6 +119,19 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI } } + @Override + public void breakBlock(World world, int x, int y, int z, Block block, int meta) { + TileEntity t = world.getTileEntity(x,y,z); + if (t instanceof ITileDropsContent){ + int[] dropSlots = ((ITileDropsContent)t).getDropSlots(); + for (int i = 0; i < dropSlots.length; i++) { + if (((ITileDropsContent)t).getStackInSlot(dropSlots[i]) != null) + world.spawnEntityInWorld(new EntityItem(world,x,y,z,((BW_TileEntity_HeatedWaterPump)t).getStackInSlot(dropSlots[i]))); + } + } + super.breakBlock(world, x, y, z, block, meta); + } + @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index 4c86a8e9b8..416e4fb56e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; +import com.github.bartimaeusnek.bartworks.API.ITileDropsContent; import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; import com.github.bartimaeusnek.bartworks.MainMod; @@ -39,7 +40,7 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.*; -public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ISidedInventory, IFluidHandler, IFluidTank, ITileWithGUI, ITileAddsInformation, ITileHasDifferentTextureSides { +public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDropsContent, IFluidHandler, IFluidTank, ITileWithGUI, ITileAddsInformation, ITileHasDifferentTextureSides { public static final int FUELSLOT = 0; public static final Fluid WATER = FluidRegistry.WATER; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java index a3b951b34e..121f628df8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.server.container; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; +import com.github.bartimaeusnek.bartworks.server.container.Slots.BW_FuelSlot; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_Slot_Render; @@ -48,7 +49,7 @@ public class BW_Container_HeatedWaterPump extends Container { this.TILE = TILE; this.INVENTORY = INVENTORY.inventory; - this.addSlotToContainer(new Slot(TILE, 0, 56, 53)); + this.addSlotToContainer(new BW_FuelSlot(TILE, 0, 56, 53)); this.addSlotToContainer(new GT_Slot_Render(TILE, 1, 86, 33)); int i; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java index edfc722bbd..b983ea27d7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.server.container; +import com.github.bartimaeusnek.bartworks.server.container.Slots.BW_DelSlot; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -33,7 +34,7 @@ public class GT_Container_Item_Destructopack extends Container { public GT_Container_Item_Destructopack(InventoryPlayer inventory) { - addSlotToContainer(new delslot()); + addSlotToContainer(new BW_DelSlot()); for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { @@ -62,18 +63,4 @@ public class GT_Container_Item_Destructopack extends Container { final Slot slotObject = (Slot) this.inventorySlots.get(0); slotObject.decrStackSize(0); } - - - class delslot extends Slot { - public delslot() { - super(new InventoryPlayer(null), 0, 80, 17); - } - - public void putStack(ItemStack p_75215_1_) { - p_75215_1_ = null; - this.onSlotChanged(); - } - - - } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java new file mode 100644 index 0000000000..133bc2dfbb --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.server.container.Slots; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class BW_DelSlot extends Slot { + public BW_DelSlot() { + super(new InventoryPlayer(null), 0, 80, 17); + } + + public void putStack(ItemStack p_75215_1_) { + p_75215_1_ = null; + this.onSlotChanged(); + } + + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java new file mode 100644 index 0000000000..71ed548559 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.server.container.Slots; + +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityFurnace; + +public class BW_FuelSlot extends Slot { + public BW_FuelSlot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) { + super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_); + } + + @Override + public boolean isItemValid(ItemStack itemStack) { + return TileEntityFurnace.getItemBurnTime(itemStack) > 0; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 7b7d33fa3d..fd8e39ebcb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -128,13 +128,12 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { return 0; } - public void breakBlock(World aWorld, int aX, int aY, int aZ, Block par5, int par6) { - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + public void breakBlock(World world, int x, int y, int z, Block block, int meta) { + TileEntity tTileEntity = world.getTileEntity(x, y, z); if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { mTemporaryTileEntity.set((BW_MetaGeneratedOreTE) tTileEntity); } - super.breakBlock(aWorld, aX, aY, aZ, par5, par6); - aWorld.removeTileEntity(aX, aY, aZ); + super.breakBlock(world, x, y, z, block, meta); } public ArrayList getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { -- cgit From 89eeaa22a6dc811bfdbf8858d14c0f2f5c2bf825 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 14 Apr 2019 04:06:14 +0200 Subject: Added THTR +Redid Config to work propperly +added some materials/items for the THTR +version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: e0d63542f91bbdb56a95d5db721d4e7a8ab830cf --- build.properties | 2 +- .../com/github/bartimaeusnek/ASM/BWCorePlugin.java | 10 +- .../github/bartimaeusnek/bartworks/MainMod.java | 10 +- .../bartworks/common/configs/ConfigHandler.java | 74 ++--- .../bartworks/common/items/SimpleSubItemClass.java | 2 +- .../bartworks/common/loaders/ItemRegistry.java | 4 + .../bartworks/common/loaders/RecipeLoader.java | 29 +- .../tileentities/multis/GT_TileEntity_THTR.java | 322 +++++++++++++++++++++ .../bartworks/system/material/WerkstoffLoader.java | 10 + .../crossmod/galacticraft/GalacticraftProxy.java | 10 +- .../ross128/world/oregen/BW_WorldGenRoss128.java | 4 +- .../solarsystems/Ross128SolarSystem.java | 9 +- .../resources/assets/bartworks/lang/en_US.lang | 7 + .../assets/bartworks/textures/items/BISOPellet.png | Bin 0 -> 253 bytes .../bartworks/textures/items/BISOPelletBall.png | Bin 0 -> 305 bytes .../textures/items/BISOPelletCompound.png | Bin 0 -> 269 bytes .../bartworks/textures/items/TRISOPellet.png | Bin 0 -> 257 bytes .../bartworks/textures/items/TRISOPelletBall.png | Bin 0 -> 305 bytes .../textures/items/TRISOPelletCompound.png | Bin 0 -> 244 bytes 19 files changed, 421 insertions(+), 72 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java create mode 100644 src/main/resources/assets/bartworks/textures/items/BISOPellet.png create mode 100644 src/main/resources/assets/bartworks/textures/items/BISOPelletBall.png create mode 100644 src/main/resources/assets/bartworks/textures/items/BISOPelletCompound.png create mode 100644 src/main/resources/assets/bartworks/textures/items/TRISOPellet.png create mode 100644 src/main/resources/assets/bartworks/textures/items/TRISOPelletBall.png create mode 100644 src/main/resources/assets/bartworks/textures/items/TRISOPelletCompound.png diff --git a/build.properties b/build.properties index 22690fd078..ae7c150099 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=7 +buildNumber=8 APIVersion=6 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java index 018690d312..2093b6a092 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.ASM; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import cpw.mods.fml.relauncher.FMLInjectionData; import cpw.mods.fml.relauncher.IFMLLoadingPlugin; import net.minecraftforge.common.config.Configuration; @@ -44,13 +45,8 @@ public class BWCorePlugin implements IFMLLoadingPlugin { if (minecraftDir != null) return;//get called twice, once for IFMLCallHook minecraftDir = (File) FMLInjectionData.data()[6]; - - Configuration asmconfighandler = new Configuration(new File(new File(minecraftDir, "config"), "bartworks.cfg")); - for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) { - BWCoreTransformer.shouldTransform[i] = asmconfighandler.get("ASM fixes", BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i], true).getBoolean(true); - } - if (asmconfighandler.hasChanged()) - asmconfighandler.save(); + //do all the configuration already now... + new ConfigHandler(new Configuration(new File(new File(minecraftDir, "config"), "bartworks.cfg"))); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 2156adb295..99ac6fda7e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -35,6 +35,7 @@ import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader; import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -72,11 +73,9 @@ public final class MainMod { public static final CreativeTabs BIO_TAB = new BioTab("BioTab"); public static final CreativeTabs BWT = new bartworksTab("bartworks"); public static final IGuiHandler GH = new GuiHandler(); - public static boolean GTNH = false; @Mod.Instance(MOD_ID) public static MainMod instance; - public static ConfigHandler CHandler; public static BW_Network BW_Network_instance = new BW_Network(); @Mod.EventHandler @@ -88,9 +87,9 @@ public final class MainMod { } if (Loader.isModLoaded("dreamcraft")) { - GTNH = true; + ConfigHandler.GTNH = true; } - CHandler = new ConfigHandler(preinit); + ConfigHandler.GTNH = ConfigHandler.ezmode != ConfigHandler.GTNH; if (ConfigHandler.debugLog) { try { new DebugLog(preinit); @@ -98,7 +97,7 @@ public final class MainMod { e.printStackTrace(); } } - if (GTNH) + if (ConfigHandler.GTNH) LOGGER.info("GTNH-Detected . . . ACTIVATE HARDMODE."); if (ConfigHandler.BioLab) { @@ -124,6 +123,7 @@ public final class MainMod { else WerkstoffLoader.INSTANCE.runInit(); } + } @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 186f12c4e6..3f27a5adcf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -23,60 +23,66 @@ package com.github.bartimaeusnek.bartworks.common.configs; -import com.github.bartimaeusnek.bartworks.MainMod; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import com.github.bartimaeusnek.ASM.BWCoreTransformer; import gregtech.api.enums.GT_Values; import net.minecraftforge.common.config.Configuration; -import javax.annotation.Nonnull; -import java.io.File; - public class ConfigHandler { private static final int IDU = GT_Values.VN.length * 8 + 1; public static int IDOffset = 12600; - public static boolean teslastaff = false; + public static boolean teslastaff; public static long energyPerCell = 1000000L; public static boolean newStuff = true; public static boolean BioLab = true; public static Configuration c; - public static boolean DEHPDirectSteam = false; + public static boolean DEHPDirectSteam; public static int megaMachinesMax = 256; public static int mbWaterperSec = 150; - private static boolean ezmode = false; - public static boolean debugLog = false; - public static boolean experimentalThreadedLoader = false; + public static int ross128ID = -64; + public static boolean Ross128Enabled = true; + public static boolean debugLog; + public static boolean experimentalThreadedLoader; + public static boolean GTNH; + public static boolean ezmode; - public ConfigHandler(@Nonnull FMLPreInitializationEvent e) { - c = new Configuration(new File(e.getModConfigurationDirectory().toString() + "/" + MainMod.MOD_ID + ".cfg")); + public ConfigHandler(Configuration C) { + ConfigHandler.c = C; - IDOffset = c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600); - energyPerCell = c.get("Multiblocks", "energyPerLESUCell", 1000000, "This will set Up the Energy per LESU Cell", 1000000, Integer.MAX_VALUE).getInt(1000000); - ezmode = c.get("System", "Mode switch", false, "If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false); - MainMod.GTNH = ezmode ? !MainMod.GTNH : MainMod.GTNH; - teslastaff = c.get("System", "Enable Teslastaff", false, "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); - newStuff = !c.get("System", "Disable non-original-GT-stuff", false, "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false); - BioLab = !c.get("System", "Disable BioLab", false, "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!").getBoolean(false); - DEHPDirectSteam = c.get("Multiblocks", "DEHP Direct Steam Mode", false, "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant").getBoolean(false); - megaMachinesMax = c.get("Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256); - mbWaterperSec = c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150).getInt(150); + ConfigHandler.IDOffset = ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600); + ConfigHandler.energyPerCell = ConfigHandler.c.get("Multiblocks", "energyPerLESUCell", 1000000, "This will set Up the Energy per LESU Cell", 1000000, Integer.MAX_VALUE).getInt(1000000); + ConfigHandler.ezmode = ConfigHandler.c.get("System", "Mode switch", false, "If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false); + ConfigHandler.teslastaff = ConfigHandler.c.get("System", "Enable Teslastaff", false, "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); + ConfigHandler.newStuff = !ConfigHandler.c.get("System", "Disable non-original-GT-stuff", false, "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false); + ConfigHandler.BioLab = !ConfigHandler.c.get("System", "Disable BioLab", false, "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!").getBoolean(false); + ConfigHandler.DEHPDirectSteam = ConfigHandler.c.get("Multiblocks", "DEHP Direct Steam Mode", false, "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant").getBoolean(false); + ConfigHandler.megaMachinesMax = ConfigHandler.c.get("Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256); + ConfigHandler.mbWaterperSec = ConfigHandler.c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150).getInt(150); if (ConfigHandler.IDOffset == 0) { ConfigHandler.IDOffset = 12600; - c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600); + ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600); + } + ConfigHandler.debugLog = ConfigHandler.c.get("System", "Enable Debug Log", false, "Enables or Disables the debug log.").getBoolean(false); + ConfigHandler.experimentalThreadedLoader = ConfigHandler.c.get("System", "Enable Experimental Threaded Material Loader", false, "Enables or Disables the Experimental Threaded Material Loader.").getBoolean(false); + + for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) { + BWCoreTransformer.shouldTransform[i] = ConfigHandler.c.get("ASM fixes", BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i], true).getBoolean(true); } - debugLog=c.get("System","Enable Debug Log",false,"Enables or Disables the debug log.").getBoolean(false); - experimentalThreadedLoader =c.get("System","Enable Experimental Threaded Material Loader",false,"Enables or Disables the Experimental Threaded Material Loader.").getBoolean(false); - if (c.hasChanged()) - c.save(); + ConfigHandler.ross128ID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64); + ConfigHandler.Ross128Enabled = ConfigHandler.c.get("CrossMod Interactions", "Galacticraft - Activate Ross128 System", true, "If the Ross128 System should be activated").getBoolean(true); + + ConfigHandler.setUpComments(); + + if (ConfigHandler.c.hasChanged()) + ConfigHandler.c.save(); } - public static void setUpComments(){ - c.addCustomCategoryComment("ASM fixes","Disable ASM fixes here."); - c.addCustomCategoryComment("Multiblocks","Multliblock Options can be set here."); - c.addCustomCategoryComment("Singleblocks","Singleblock Options can be set here."); - c.addCustomCategoryComment("System","Different System Settings can be set here."); - c.addCustomCategoryComment("CrossMod Interactions","CrossMod Interaction Settings can be set here. For Underground Fluid settings change the Gregtech.cfg!"); - c.save(); + public static void setUpComments() { + ConfigHandler.c.addCustomCategoryComment("ASM fixes", "Disable ASM fixes here."); + ConfigHandler.c.addCustomCategoryComment("Multiblocks", "Multliblock Options can be set here."); + ConfigHandler.c.addCustomCategoryComment("Singleblocks", "Singleblock Options can be set here."); + ConfigHandler.c.addCustomCategoryComment("System", "Different System Settings can be set here."); + ConfigHandler.c.addCustomCategoryComment("CrossMod Interactions", "CrossMod Interaction Settings can be set here. For Underground Fluid settings change the Gregtech.cfg!"); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java index f5abfeecf7..8c6d810869 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -41,7 +41,7 @@ public class SimpleSubItemClass extends Item { protected IIcon[] itemIcon; String[] tex; - public SimpleSubItemClass(String[] tex) { + public SimpleSubItemClass(String... tex) { this.tex = tex; this.hasSubtypes = true; this.setCreativeTab(MainMod.BWT); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 20911d4361..ca12a39636 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -33,6 +33,7 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEnt import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_DEHP; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaBlastFurnace; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_AcidGenerator; @@ -130,10 +131,13 @@ public class ItemRegistry { public static ItemStack[] energyDistributor = new ItemStack[GT_Values.VN.length]; public static ItemStack[] acidGens = new ItemStack[3]; public static ItemStack[] megaMachines = new ItemStack[2]; + public static ItemStack thtr; public static void run() { if (newStuff) { + thtr=new GT_TileEntity_THTR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5,"THTR","Thorium High Temperature Reactor").getStackForm(1L); + GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials(); GameRegistry.registerBlock(ItemRegistry.bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses, "BW_FakeGlasBlock"); GT_OreDictUnificator.add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index eef7b29c49..9c958e25fa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -22,10 +22,10 @@ package com.github.bartimaeusnek.bartworks.common.loaders; -import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_LESU; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_Windmill; import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.GregTech_API; @@ -51,7 +51,7 @@ public class RecipeLoader implements Runnable { @Override public void run() { - if (MainMod.GTNH) { + if (ConfigHandler.GTNH) { /* * GTNH "hardmode" Recipes */ @@ -96,11 +96,11 @@ public class RecipeLoader implements Runnable { "CDC", "SBS", "CFC", - 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, MainMod.GTNH ? Materials.Advanced : Materials.Basic, 1L), + 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, ConfigHandler.GTNH ? Materials.Advanced : Materials.Basic, 1L), 'D', ItemList.Cover_Screen.get(1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.cableGt12, MainMod.GTNH ? Materials.Platinum : Materials.AnnealedCopper, 1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.cableGt12, ConfigHandler.GTNH ? Materials.Platinum : Materials.AnnealedCopper, 1L), 'B', new ItemStack(ItemRegistry.BW_BLOCKS[1]), - 'F', MainMod.GTNH ? ItemList.Field_Generator_HV.get(1L) : ItemList.Field_Generator_LV.get(1L) + 'F', ConfigHandler.GTNH ? ItemList.Field_Generator_HV.get(1L) : ItemList.Field_Generator_LV.get(1L) }); GT_ModHandler.addCraftingRecipe( @@ -111,7 +111,7 @@ public class RecipeLoader implements Runnable { "PLP", "CPC", 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1L), - 'P', GT_OreDictUnificator.get(MainMod.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, Materials.Aluminium, 1L), + 'P', GT_OreDictUnificator.get(ConfigHandler.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, Materials.Aluminium, 1L), 'L', new ItemStack(Items.lava_bucket) }); @@ -123,7 +123,7 @@ public class RecipeLoader implements Runnable { "PLP", "CPC", 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1L), - 'P', GT_OreDictUnificator.get(MainMod.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, MainMod.GTNH ? Materials.Steel : Materials.Iron, 1L), + 'P', GT_OreDictUnificator.get(ConfigHandler.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, ConfigHandler.GTNH ? Materials.Steel : Materials.Iron, 1L), 'L', new ItemStack(Items.lava_bucket) }); @@ -219,7 +219,7 @@ public class RecipeLoader implements Runnable { } ); - if (!MainMod.GTNH) + if (!ConfigHandler.GTNH) GT_ModHandler.addCraftingRecipe( ItemRegistry.dehp, BITSD, @@ -727,6 +727,19 @@ public class RecipeLoader implements Runnable { 'G', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), } ); + GT_TileEntity_THTR.THTRMaterials.registerTHR_Recipes(); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.thtr, + RecipeLoader.BITSD, + new Object[]{ + "BZB", + "BRB", + "BZB", + 'B',new ItemStack(GregTech_API.sBlockCasings3,1,12), + 'R',GT_ModHandler.getModItem("IC2","blockGenerator",1,5), + 'Z',"circuitUltimate" + } + ); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java new file mode 100644 index 0000000000..af51d5d34c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -0,0 +1,322 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; + +import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.XSTR; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import ic2.core.ExplosionIC2; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import java.util.Arrays; + +public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { + + private static final int BASECASINGINDEX = 44; + private static final int HELIUM_NEEDED = 320; + private int HeliumSupply; + private int BISOPeletSupply; + private int TRISOPeletSupply; + + public GT_TileEntity_THTR(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_THTR(String aName) { + super(aName); + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + HeliumSupply=aNBT.getInteger("HeliumSupply"); + BISOPeletSupply=aNBT.getInteger("BISOPeletSupply"); + TRISOPeletSupply=aNBT.getInteger("TRISOPeletSupply"); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setInteger("HeliumSupply",HeliumSupply); + aNBT.setInteger("BISOPeletSupply",BISOPeletSupply); + aNBT.setInteger("TRISOPeletSupply",TRISOPeletSupply); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (aBaseMetaTileEntity.isServerSide()){ + if (HeliumSupply < HELIUM_NEEDED){ + for (FluidStack fluidStack : this.getStoredFluids()){ + if (fluidStack.isFluidEqual(Materials.Helium.getGas(1000))) { + while (HeliumSupply < HELIUM_NEEDED && fluidStack.amount > 0) { + HeliumSupply++; + fluidStack.amount--; + } + } + } + } + for (ItemStack itemStack : this.getStoredInputs()) { + if (GT_Utility.areStacksEqual(itemStack, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3))) { + if (BISOPeletSupply + TRISOPeletSupply < 675000) { + while (BISOPeletSupply + TRISOPeletSupply < 675000 && itemStack.stackSize > 0) { + itemStack.stackSize--; + TRISOPeletSupply++; + } + this.updateSlots(); + } + } else if (GT_Utility.areStacksEqual(itemStack, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1))) { + if (BISOPeletSupply + TRISOPeletSupply < 675000) { + while (BISOPeletSupply + TRISOPeletSupply < 675000 && itemStack.stackSize > 0) { + itemStack.stackSize--; + BISOPeletSupply++; + + } + this.updateSlots(); + } + } + } + } + } + + @Override + public boolean checkRecipe(ItemStack controllerStack) { + + if (!(HeliumSupply >= HELIUM_NEEDED && BISOPeletSupply + TRISOPeletSupply >= 100000)) + return false; + + if (new XSTR().nextBoolean()) { + if (this.BISOPeletSupply > 0) + --this.BISOPeletSupply; + else + --this.TRISOPeletSupply; + } else { + if (this.TRISOPeletSupply > 0) + --this.TRISOPeletSupply; + else + --this.BISOPeletSupply; + } + + this.updateSlots(); + if (this.mOutputFluids == null || this.mOutputFluids[0] == null) + this.mOutputFluids = new FluidStack[]{FluidRegistry.getFluidStack("ic2hotcoolant",0)}; + //this.mOutputFluids[0].amount+=toProduce; + this.mEUt=0; + this.mMaxProgresstime=648000; + + + return true; + } + + @Override + public boolean onRunningTick(ItemStack aStack) { + long accessibleCoolant = 0; + long toProduce=0; + for (FluidStack fluidStack : this.getStoredFluids()) { + if (fluidStack.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))) { + accessibleCoolant+=fluidStack.amount; + } + } + + toProduce = (long) ((0.03471*(float)this.TRISOPeletSupply + 0.0267*(float)this.BISOPeletSupply)); + + if (toProduce > accessibleCoolant) { +// new ExplosionIC2( +// this.getBaseMetaTileEntity().getWorld(), +// null, +// this.getBaseMetaTileEntity().getXCoord(), +// this.getBaseMetaTileEntity().getYCoord(), +// this.getBaseMetaTileEntity().getZCoord(), +// 50f, +// 0.01f, +// ExplosionIC2.Type.Nuclear +// ).doExplosion(); + return false; + } + + accessibleCoolant=toProduce; + + for (FluidStack fluidStack : this.getStoredFluids()) { + if (fluidStack.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))) { + if (accessibleCoolant >= fluidStack.amount) { + accessibleCoolant -= fluidStack.amount; + fluidStack.amount=0; + } else if (accessibleCoolant > 0) { + fluidStack.amount-=accessibleCoolant; + accessibleCoolant=0; + } + } + } + this.mOutputFluids[0].amount+=toProduce; + return true; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 4; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 4; + for (int x = -4; x <= 4; x++) { + for (int z = -4; z <= 4; z++) { + for (int y = 0; y < 12; y++) { + if (y == 0 || y == 11) { + if ( + !((Math.abs(z) == 3 && Math.abs(x) == 4)) && + !((Math.abs(z) == 4 && Math.abs(x) == 3)) && + !((Math.abs(x) == Math.abs(z) && Math.abs(x) == 4)) + ) { + if (x + xDir == 0 && y == 0 && z + zDir == 0) + continue; + if (!(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 12)) { + if ( + ( + !(this.addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), BASECASINGINDEX) && y == 11) && + !(this.addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), BASECASINGINDEX) && y == 0)) && + !this.addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), BASECASINGINDEX) + ) { + return false; + } + } + } + } + else if (!((Math.abs(x) == 4 && Math.abs(z) == 4) || (Math.abs(x) == 3 && Math.abs(z) == 3)) && !(Math.abs(x) < 3 || Math.abs(z) < 3) && !((Math.abs(x) == Math.abs(z) && Math.abs(x) == 3) || Math.abs(x) == 4 || Math.abs(z) == 4)) { + if (!(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 12)) { + if ( + !this.addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), BASECASINGINDEX)) + { + return false; + } + } + } + } + } + + } + + if (this.mMaintenanceHatches.size() != 1) + return false; + + return true; + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_THTR(this.mName); + } + + + @Override + public String[] getDescription() { + String[] dsc = StatCollector.translateToLocal("tooltip.tile.htr.0.name").split(";"); + String[] mDescription = new String[dsc.length + 1]; + for (int i = 0; i < dsc.length; i++) { + mDescription[i] = dsc[i]; + mDescription[dsc.length] = StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; + } + return mDescription; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[BASECASINGINDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[BASECASINGINDEX]}; + } + + + public static class THTRMaterials{ + static final SimpleSubItemClass aTHTR_Materials = new SimpleSubItemClass("BISOPelletCompound","BISOPellet","TRISOPelletCompound","TRISOPellet","BISOPelletBall","TRISOPelletBall"); + public static void registeraTHR_Materials(){ + GameRegistry.registerItem(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,"bw.THTRMaterials"); + } + + public static void registerTHR_Recipes(){ + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.plateDense,Materials.Lead,6), + GT_OreDictUnificator.get(OrePrefixes.frameGt,Materials.TungstenSteel,1) + }, + Materials.Concrete.getMolten(1296), + new ItemStack(GregTech_API.sBlockCasings3,1,12), + 40, + BW_Util.getMachineVoltageFromTier(5) + ); + GT_Values.RA.addMixerRecipe(WerkstoffLoader.Thorium232.get(OrePrefixes.dust,10),Materials.Uranium235.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,new ItemStack(aTHTR_Materials),400,30); + GT_Values.RA.addFormingPressRecipe(new ItemStack(aTHTR_Materials),Materials.Graphite.getDust(64),new ItemStack(aTHTR_Materials,1,4),40,30); + ItemStack[] pellets = new ItemStack[6]; + Arrays.fill(pellets,new ItemStack(aTHTR_Materials,64,1)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(aTHTR_Materials,1,4),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,24000,30,0); + GT_Values.RA.addFormingPressRecipe(new ItemStack(aTHTR_Materials,1,4),Materials.Silicon.getDust(64),new ItemStack(aTHTR_Materials,1,2),40,30); + GT_Values.RA.addFormingPressRecipe(new ItemStack(aTHTR_Materials,1,2),Materials.Graphite.getDust(64),new ItemStack(aTHTR_Materials,1,5),40,30); + pellets = new ItemStack[6]; + Arrays.fill(pellets,new ItemStack(aTHTR_Materials,64,3)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(aTHTR_Materials,1,5),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,48000,30,0); + } + + } + + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 1a805cd8d0..824435461d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -446,6 +446,16 @@ public class WerkstoffLoader implements Runnable { new Pair(Materials.Hydrogen, 2) ); + public static final Werkstoff Thorium232 = new Werkstoff( + new short[]{0,64,0,0}, + "Thorium 232", + "Th232", + new Werkstoff.Stats().setRadioactive(true), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 30, + TextureSet.SET_METALLIC + ); public static HashMap items = new HashMap<>(); public static Block BWOres; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java index 505350d401..c93a698902 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.crossmod.galacticraft; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -62,13 +63,6 @@ public class GalacticraftProxy { init_undergroundFluidsRoss128(); if (GalacticraftProxy.gtConf.hasChanged()) GalacticraftProxy.gtConf.save(); - - Configuration c = new Configuration(new File(e.getModConfigurationDirectory(), "bartworks.cfg")); - Ross128SolarSystem.ross128ID = c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64); - Ross128SolarSystem.enabled = c.get("CrossMod Interactions", "Galacticraft - Activate Ross128 System", true, "If the Ross128 System should be activated").getBoolean(true); - if (c.hasChanged()) - c.save(); - init_OresRoss128(); } @@ -90,7 +84,7 @@ public class GalacticraftProxy { } private static void commonInit(FMLInitializationEvent e) { - if (Ross128SolarSystem.enabled) + if (ConfigHandler.Ross128Enabled) Ross128SolarSystem.init(); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java index d01e782acf..46a5fd07e2 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java @@ -22,8 +22,8 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; import net.minecraft.util.StatCollector; @@ -63,7 +63,7 @@ public class BW_WorldGenRoss128 extends BW_OreLayer { @Override public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { - return aWorld.provider.dimensionId == Ross128SolarSystem.ross128ID; + return aWorld.provider.dimensionId == ConfigHandler.ross128ID; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index e7d539f969..ba2ac7c185 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.crossmod.galacticraft.solarsystems; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider.WorldProviderRoss128b; @@ -36,15 +37,11 @@ import java.util.Arrays; public class Ross128SolarSystem { - public static boolean enabled = true; - public static SolarSystem Ross128System; public static Star Ross128; public static Planet Ross128b; public static Moon Ross128ba; - // public static Block Ross128bBlocks; -// public static BlockMetaPair Ross128bStone,Ross128bDirt,Ross128bGrass; - public static int ross128ID = -64; + private Ross128SolarSystem() { } @@ -65,7 +62,7 @@ public class Ross128SolarSystem { Ross128SolarSystem.Ross128b.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(0.75F, 1.75F)); Ross128SolarSystem.Ross128b.setRelativeOrbitTime(0.65F); Ross128SolarSystem.Ross128b.atmosphere.addAll(Arrays.asList(IAtmosphericGas.OXYGEN, IAtmosphericGas.NITROGEN, IAtmosphericGas.ARGON)); - Ross128SolarSystem.Ross128b.setDimensionInfo(Ross128SolarSystem.ross128ID, WorldProviderRoss128b.class); + Ross128SolarSystem.Ross128b.setDimensionInfo(ConfigHandler.ross128ID, WorldProviderRoss128b.class); Ross128SolarSystem.Ross128b.setTierRequired(Loader.isModLoaded("galaxyspace") ? 4 : Loader.isModLoaded("GalacticraftMars") ? 3 : -1); Ross128SolarSystem.Ross128ba = new Moon("Ross128ba").setParentPlanet(Ross128SolarSystem.Ross128b); diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index d7976f0caa..e2df35928f 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -144,6 +144,13 @@ tile.radiohatch.name=Radio Hatch tile.bw.windmill.name=Windmill tile.manutrafo.name=Manual Trafo +tooltip.tile.htr.0.name=Controller Block for the Thorium High Temperature Reactor;Size(WxHxD): 9x12x9 (Hollow);Corners and the 2 touching blocks are air;Once build, Helium is inserted into the Fluid Input Hatch until it doesnt accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Raidation Proof Casings for the Rest;Needs a constant supply of coolant or will shut down;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes 1 Fuel Pellet per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days +item.TRISOPellet.name=TRISO pebble +item.TRISOPelletBall.name=TRISO pebble ball +item.BISOPelletBall.name=BISO pebble ball +item.BISOPellet.name=BRISO pebble +item.TRISOPelletCompound.name=TRISO pebble compund +item.BISOPelletCompound.name=BISO pebble compund itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials planet.Ross128b=Ross128b diff --git a/src/main/resources/assets/bartworks/textures/items/BISOPellet.png b/src/main/resources/assets/bartworks/textures/items/BISOPellet.png new file mode 100644 index 0000000000..4fb39c473b Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/BISOPellet.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/BISOPelletBall.png b/src/main/resources/assets/bartworks/textures/items/BISOPelletBall.png new file mode 100644 index 0000000000..ea113e3f22 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/BISOPelletBall.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/BISOPelletCompound.png b/src/main/resources/assets/bartworks/textures/items/BISOPelletCompound.png new file mode 100644 index 0000000000..029d895f31 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/BISOPelletCompound.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/TRISOPellet.png b/src/main/resources/assets/bartworks/textures/items/TRISOPellet.png new file mode 100644 index 0000000000..26109fc979 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/TRISOPellet.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/TRISOPelletBall.png b/src/main/resources/assets/bartworks/textures/items/TRISOPelletBall.png new file mode 100644 index 0000000000..0aea0500cf Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/TRISOPelletBall.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/TRISOPelletCompound.png b/src/main/resources/assets/bartworks/textures/items/TRISOPelletCompound.png new file mode 100644 index 0000000000..6b2835d100 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/TRISOPelletCompound.png differ -- cgit From 1507649eaaa6b45f5941367e520531cfddd5ad4e Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Sun, 14 Apr 2019 23:19:16 +0800 Subject: update Former-commit-id: eff6c79f0d1231566768a68dc697ed8c0f0a1509 --- src/main/resources/assets/bartworks/lang/zh_CN.lang | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index 027ff7b7e4..896a79c0ad 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -55,6 +55,7 @@ BW_GlasBlocks.8.name=染色硼硅酸盐方块(紫) BW_GlasBlocks.9.name=染色硼硅酸盐方块(黄) BW_GlasBlocks.10.name=染色硼硅酸盐方块(淡绿) BW_GlasBlocks.11.name=染色硼硅酸盐方块(棕) +BW_GlasBlocks.12.name=钍钇玻璃块 tooltip.glas.0.name=玻璃等级: tooltip.LESU.0.name=最大容量! @@ -142,4 +143,11 @@ tile.biovat.name=生物培养缸 tile.radiohatch.name=放射仓 tile.bw.windmill.name=风车 tile.manutrafo.name=手动变压器 -//This zh_CN.lang is translation by huajijam for bartworks (11/3/19) \ No newline at end of file + +itemGroup.bartworksMetaMaterials=BartWorks' meta材料 + +planet.Ross128b=罗斯128b +moon.Ross128ba=罗斯128ba +star.Ross128=罗斯128 +solarsystem.Ross128System=罗斯128-行星系 +//This zh_CN.lang is translation by huajijam for bartworks (14/4/19) \ No newline at end of file -- cgit From 3e5b27f51c166967a6cbe5dde6075fb1a2fce342 Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Sun, 14 Apr 2019 23:23:16 +0800 Subject: fix a bug Former-commit-id: e72552e3bed884f9484e04fac0f9c92e441d86d6 --- src/main/resources/assets/bartworks/lang/zh_CN.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index 896a79c0ad..eb3f57907f 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -144,7 +144,7 @@ tile.radiohatch.name=放射仓 tile.bw.windmill.name=风车 tile.manutrafo.name=手动变压器 -itemGroup.bartworksMetaMaterials=BartWorks' meta材料 +itemGroup.bartworksMetaMaterials=BartWorks-meta材料 planet.Ross128b=罗斯128b moon.Ross128ba=罗斯128ba -- cgit From 6f39c39ef3043430efc1c621a567ffcb6a02810b Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 14 Apr 2019 20:13:54 +0200 Subject: added additional Thorianite Recipes +added InfoData on THTR +added isSneaking on diode screwdriver click (reverse Actual Amps) Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 292eef278737e3852f37c3364821b13640205297 --- .../common/tileentities/multis/GT_TileEntity_THTR.java | 16 +++++++++++++--- .../tileentities/tiered/GT_MetaTileEntity_Diode.java | 16 +++++++++++----- .../material/processingLoaders/AdditionalRecipes.java | 14 ++++++++++++++ 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index af51d5d34c..b21e97aead 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -26,7 +26,6 @@ import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -42,7 +41,6 @@ import gregtech.api.objects.XSTR; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import ic2.core.ExplosionIC2; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; @@ -55,7 +53,7 @@ import java.util.Arrays; public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { private static final int BASECASINGINDEX = 44; - private static final int HELIUM_NEEDED = 320; + private static final int HELIUM_NEEDED = 730000; private int HeliumSupply; private int BISOPeletSupply; private int TRISOPeletSupply; @@ -271,6 +269,18 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { } + @Override + public String[] getInfoData() { + return new String[]{ + "Progress:", this.mProgresstime / 20 + "secs", this.mMaxProgresstime / 20 + "secs", + "BISO-Pebbles:", this.BISOPeletSupply + "pcs.", + "TRISO-Pebbles:", this.TRISOPeletSupply + "pcs.", + "Helium-Level:", this.HeliumSupply+"L / "+HELIUM_NEEDED+"L", + "Coolant/sec:", this.BISOPeletSupply+this.TRISOPeletSupply >= 100000 ? (long) ((0.03471*(float)this.TRISOPeletSupply + 0.0267*(float)this.BISOPeletSupply))+"L/t" : "0L/t", + "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) + }; + } + @Override public String[] getDescription() { String[] dsc = StatCollector.translateToLocal("tooltip.tile.htr.0.name").split(";"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index e3a1da3966..909d84bb31 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -64,11 +64,17 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { if (this.getBaseMetaTileEntity().getWorld().isRemote) return; - - --aAmps; - if (aAmps < 0) - aAmps = maxAmps; - GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + aAmps); + if (!aPlayer.isSneaking()) { + --aAmps; + if (aAmps < 0) + aAmps = maxAmps; + GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + aAmps); + }else{ + ++aAmps; + if (aAmps > maxAmps) + aAmps = 0; + GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + aAmps); + } } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 29300cdbbe..667d44342e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -41,6 +41,20 @@ public class AdditionalRecipes implements Runnable { GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(11),Materials.Oxygen.getGas(3000),null, WerkstoffLoader.YttriumOxide.get(dust),64, BW_Util.getMachineVoltageFromTier(4)); GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust,10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.Zirconia.get(gemFlawed, 40)}, (Object) null, (int[]) null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953); GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall,2),WerkstoffLoader.Thorianit.get(dustSmall,2),Materials.Glass.getMolten(144),null,new ItemStack(ItemRegistry.bw_glasses[0],1,12),null,800,BW_Util.getMachineVoltageFromTier(5),3663); + GT_Values.RA.addSifterRecipe(WerkstoffLoader.Thorianit.get(crushedPurified), + new ItemStack[]{ + WerkstoffLoader.Thorianit.get(dust), + WerkstoffLoader.Thorianit.get(dust), + WerkstoffLoader.Thorianit.get(dust), + Materials.Thorium.getDust(1), + Materials.Thorium.getDust(1), + WerkstoffLoader.Thorium232.get(dust), + }, new int[]{7000,1300,700,600,300,100}, + 400, + BW_Util.getMachineVoltageFromTier(5) + ); + GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust),Materials.Aluminium.getDust(1),Materials.Thorium.getDust(1),1000); + GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust),Materials.Magnesium.getDust(1),Materials.Thorium.getDust(1),1000); } } -- cgit From c43ff72f47693da3db3da6239934224dbb7635bd Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Mon, 15 Apr 2019 20:33:37 +0800 Subject: update need to translate BRISO Former-commit-id: a7e6f63f5e74fd8900c3a8d61572d0198fabbe47 --- src/main/resources/assets/bartworks/lang/zh_CN.lang | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index eb3f57907f..5398d0a00a 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -144,6 +144,13 @@ tile.radiohatch.name=放射仓 tile.bw.windmill.name=风车 tile.manutrafo.name=手动变压器 +tooltip.tile.htr.0.name=高温钍反应堆的控制器方块;大小(宽x高x长): 9x12x9 (中空);角落和两个接近的方块是空气;一旦搭建,需将氦气输入输入仓,直到它不再接受为止;1+输出仓(任意底部机械方块);1+输入仓(任意顶部机械方块);1+输入总线(任意顶部机械方块);1x维护仓(任意机械方块);其余的为辐射防护机械方块;需要持续供应冷却液或将关机;需要至少100k燃料卵石才能开始工作(最多可使用675k个卵石);每次操作消耗1个燃料颗粒;高温钍反应堆卵石增加30%的能量;每个卵石都会增加转换冷却剂的需求数量;一次操作需要27个游戏天数 +item.TRISOPellet.name=高温钍反应堆卵石 +item.TRISOPelletBall.name=高温钍反应堆卵石球 +item.BISOPelletBall.name=BISO 卵石球 +item.BISOPellet.name=BRISO 卵石 +item.TRISOPelletCompound.name=高温钍反应堆卵石复合材料 +item.BISOPelletCompound.name=BISO 卵石复合材料 itemGroup.bartworksMetaMaterials=BartWorks-meta材料 planet.Ross128b=罗斯128b -- cgit From e0b84b5b0b508a897c9a55860847fd8794a2d274 Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Mon, 15 Apr 2019 23:16:20 +0800 Subject: fix bugs Former-commit-id: 2d6c4e365d6e9665d8b233cc8224081604989ea6 --- src/main/resources/assets/bartworks/lang/zh_CN.lang | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index 5398d0a00a..7d94107dd3 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -144,13 +144,13 @@ tile.radiohatch.name=放射仓 tile.bw.windmill.name=风车 tile.manutrafo.name=手动变压器 -tooltip.tile.htr.0.name=高温钍反应堆的控制器方块;大小(宽x高x长): 9x12x9 (中空);角落和两个接近的方块是空气;一旦搭建,需将氦气输入输入仓,直到它不再接受为止;1+输出仓(任意底部机械方块);1+输入仓(任意顶部机械方块);1+输入总线(任意顶部机械方块);1x维护仓(任意机械方块);其余的为辐射防护机械方块;需要持续供应冷却液或将关机;需要至少100k燃料卵石才能开始工作(最多可使用675k个卵石);每次操作消耗1个燃料颗粒;高温钍反应堆卵石增加30%的能量;每个卵石都会增加转换冷却剂的需求数量;一次操作需要27个游戏天数 -item.TRISOPellet.name=高温钍反应堆卵石 -item.TRISOPelletBall.name=高温钍反应堆卵石球 -item.BISOPelletBall.name=BISO 卵石球 -item.BISOPellet.name=BRISO 卵石 -item.TRISOPelletCompound.name=高温钍反应堆卵石复合材料 -item.BISOPelletCompound.name=BISO 卵石复合材料 +tooltip.tile.htr.0.name=高温钍反应堆的控制器方块;大小(宽x高x长): 9x12x9 (中空);角落和两个接近的方块是空气;一旦搭建,需将氦气输入输入仓,直到它不再接受为止;1+输出仓(任意底部机械方块);1+输入仓(任意顶部机械方块);1+输入总线(任意顶部机械方块);1x维护仓(任意机械方块);其余的为辐射防护机械方块;需要持续供应冷却液或将关机;需要至少100k燃料卵石才能开始工作(最多可使用675k个卵石);每次操作消耗1个燃料颗粒;TRISO卵石将提供30%的额外能量;每个卵石都会增加转换冷却剂的需求数量;一次工作耗时27个游戏天数 +item.TRISOPellet.name=TRISO卵石 +item.TRISOPelletBall.name=TRISO卵石球 +item.BISOPelletBall.name=BISO卵石球 +item.BISOPellet.name=BISO卵石 +item.TRISOPelletCompound.name=TRISO卵石复合材料 +item.BISOPelletCompound.name=BISO卵石复合材料 itemGroup.bartworksMetaMaterials=BartWorks-meta材料 planet.Ross128b=罗斯128b -- cgit From 290de5438e0ea7bc06e39e6d01d4d99c7878e72f Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Mon, 15 Apr 2019 23:17:58 +0800 Subject: fix bugs Former-commit-id: 04076ab3cf5fba8736406d969e056bc4168c38ef --- src/main/resources/assets/bartworks/lang/zh_CN.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index 7d94107dd3..bd6200e2bb 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -144,7 +144,7 @@ tile.radiohatch.name=放射仓 tile.bw.windmill.name=风车 tile.manutrafo.name=手动变压器 -tooltip.tile.htr.0.name=高温钍反应堆的控制器方块;大小(宽x高x长): 9x12x9 (中空);角落和两个接近的方块是空气;一旦搭建,需将氦气输入输入仓,直到它不再接受为止;1+输出仓(任意底部机械方块);1+输入仓(任意顶部机械方块);1+输入总线(任意顶部机械方块);1x维护仓(任意机械方块);其余的为辐射防护机械方块;需要持续供应冷却液或将关机;需要至少100k燃料卵石才能开始工作(最多可使用675k个卵石);每次操作消耗1个燃料颗粒;TRISO卵石将提供30%的额外能量;每个卵石都会增加转换冷却剂的需求数量;一次工作耗时27个游戏天数 +tooltip.tile.htr.0.name=高温钍反应堆的控制器方块;大小(宽x高x长): 9x12x9 (中空);角落和两个相邻的方块是空气;一旦搭建,需要在输入仓中输入氦气,直到它不再接受;1+输出仓(任意底部机械方块);1+输入仓(任意顶部机械方块);1+输入总线(任意顶部机械方块);1x维护仓(任意机械方块);其余的为辐射防护机械方块;需要持续供应冷却液或将关机;需要至少100k燃料卵石才能开始工作(最多可使用675k个卵石);每次操作消耗1个燃料颗粒;TRISO卵石将提供30%的额外能量;每个卵石都会增加转换冷却剂的需求数量;一次工作耗时27个游戏天数 item.TRISOPellet.name=TRISO卵石 item.TRISOPelletBall.name=TRISO卵石球 item.BISOPelletBall.name=BISO卵石球 @@ -157,4 +157,4 @@ planet.Ross128b=罗斯128b moon.Ross128ba=罗斯128ba star.Ross128=罗斯128 solarsystem.Ross128System=罗斯128-行星系 -//This zh_CN.lang is translation by huajijam for bartworks (14/4/19) \ No newline at end of file +//This zh_CN.lang is translation by huajijam for bartworks (15/4/19) \ No newline at end of file -- cgit From 6888617c1b4d6a9836b97e4234ea114ad9bd25bc Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 16 Apr 2019 00:29:22 +0200 Subject: +added World Generation feature for Ross128b +started on Ross128ba +cleaned up code +started on Werkstoff Liquids +fixed small translation failure Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: a43cc5cc4ac47e49a27203595c4b8ca841a81a9a --- .../bartimaeusnek/ASM/BWCoreTransformer.java | 4 +- .../bartworks/common/commands/SummonRuin.java | 55 ++++ .../bartworks/common/configs/ConfigHandler.java | 7 +- .../bartworks/neiHandler/BW_NEI_OreHandler.java | 13 +- .../system/material/BW_MetaGenerated_Items.java | 48 +-- .../system/material/BW_MetaGenerated_Ores.java | 4 +- .../bartworks/system/material/Werkstoff.java | 10 + .../bartworks/system/material/WerkstoffLoader.java | 195 +++++++------ .../bartworks/system/oregen/BW_OreLayer.java | 181 ++++++++++++ .../bartworks/system/oregen/BW_WordGenerator.java | 125 ++++++++ .../system/oregen/BW_WorldGenRoss128b.java | 74 +++++ .../system/oregen/BW_WorldGenRoss128ba.java | 54 ++++ .../bartworks/system/worldgen/GT_WorldgenUtil.java | 106 +++++++ .../bartworks/system/worldgen/MapGenRuins.java | 325 +++++++++++++++++++++ .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 6 + .../crossmod/galacticraft/GalacticraftProxy.java | 4 +- .../planets/AbstractWorldProviderSpace.java | 40 +++ .../planets/ross128/world/oregen/BW_OreLayer.java | 150 ---------- .../ross128/world/oregen/BW_WordGenerator.java | 126 -------- .../ross128/world/oregen/BW_WorldGenRoss128.java | 69 ----- .../world/worldprovider/ChunkProviderRoss128b.java | 178 ----------- .../world/worldprovider/SkyProviderRoss128b.java | 33 --- .../world/worldprovider/WorldProviderRoss128b.java | 175 ----------- .../planets/ross128b/ChunkProviderRoss128b.java | 179 ++++++++++++ .../planets/ross128b/SkyProviderRoss128b.java | 33 +++ .../planets/ross128b/WorldProviderRoss128b.java | 163 +++++++++++ .../planets/ross128ba/ChunkProviderRoss128ba.java | 66 +++++ .../planets/ross128ba/WorldProviderRoss128ba.java | 117 ++++++++ .../solarsystems/Ross128SolarSystem.java | 17 +- .../resources/assets/bartworks/lang/en_US.lang | 2 +- 30 files changed, 1686 insertions(+), 873 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_OreLayer.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index 6a9850e4fe..e56fd65c51 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -143,11 +143,11 @@ public class BWCoreTransformer implements IClassTransformer { nu.add(new VarInsnNode(ALOAD, 0)); nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? theWorld_src : "theWorld", "Lnet/minecraft/client/multiplayer/WorldClient;")); nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/multiplayer/WorldClient", useSrc ? provider_src : "provider", "Lnet/minecraft/world/WorldProvider;")); - nu.add(new TypeInsnNode(INSTANCEOF, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b")); + nu.add(new TypeInsnNode(INSTANCEOF, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b")); nu.add(new JumpInsnNode(IFEQ, LabelNodes[0])); nu.add(new VarInsnNode(ALOAD, 0)); nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? renderEngine_src : "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); - nu.add(new FieldInsnNode(GETSTATIC, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b", "sunTex", "Lnet/minecraft/util/ResourceLocation;")); + nu.add(new FieldInsnNode(GETSTATIC, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b", "sunTex", "Lnet/minecraft/util/ResourceLocation;")); nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", useSrc ? bindTexture_src : "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); nu.add(new JumpInsnNode(GOTO, LabelNodes[1])); nu.add(LabelNodes[0]); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java new file mode 100644 index 0000000000..f569d62abe --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.commands; + +import com.github.bartimaeusnek.bartworks.system.worldgen.MapGenRuins; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; + +public class SummonRuin extends CommandBase { + + @Override + public String getCommandName() { + return "SummonRuin"; + } + + @Override + public String getCommandUsage(ICommandSender p_71518_1_) { + return "SummonRuin x z"; + } + + @Override + public void processCommand(ICommandSender iCommandSender, String[] p_71515_2_) { + try { + new MapGenRuins.RuinsBase().generate( + iCommandSender.getEntityWorld(), + iCommandSender.getEntityWorld().rand, + Integer.parseInt(p_71515_2_[0]), + 256, + Integer.parseInt(p_71515_2_[1]) + ); + }catch (Exception e){ + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 3f27a5adcf..6676b242aa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -38,7 +38,8 @@ public class ConfigHandler { public static boolean DEHPDirectSteam; public static int megaMachinesMax = 256; public static int mbWaterperSec = 150; - public static int ross128ID = -64; + public static int ross128BID = -64; + public static int ross128BAID = -63; public static boolean Ross128Enabled = true; public static boolean debugLog; public static boolean experimentalThreadedLoader; @@ -68,7 +69,9 @@ public class ConfigHandler { BWCoreTransformer.shouldTransform[i] = ConfigHandler.c.get("ASM fixes", BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i], true).getBoolean(true); } - ConfigHandler.ross128ID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64); + ConfigHandler.ross128BID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64); + ConfigHandler.ross128BAID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128ba", -63, "The Dim ID for Ross128ba (Ross128b's Moon)").getInt(-63); + ConfigHandler.Ross128Enabled = ConfigHandler.c.get("CrossMod Interactions", "Galacticraft - Activate Ross128 System", true, "If the Ross128 System should be activated").getBoolean(true); ConfigHandler.setUpComments(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index 5360268200..1012cffc01 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -29,10 +29,9 @@ import codechicken.nei.recipe.TemplateRecipeHandler; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_OreLayer; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WorldGenRoss128; +import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer; +import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b; import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; @@ -91,9 +90,9 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public List getOtherStacks() { ArrayList ret = new ArrayList<>(); for (int i = 0; i < BW_OreLayer.sList.size(); i++) { - if (BW_OreLayer.sList.get(i) instanceof BW_WorldGenRoss128) { + if (BW_OreLayer.sList.get(i) instanceof BW_WorldGenRoss128b) { int baseMeta = result.getItemDamage(); - BW_WorldGenRoss128 worldGen = ((BW_WorldGenRoss128) BW_OreLayer.sList.get(i)); + BW_WorldGenRoss128b worldGen = ((BW_WorldGenRoss128b) BW_OreLayer.sList.get(i)); if (worldGen.mPrimaryMeta == baseMeta || worldGen.mSecondaryMeta == baseMeta || worldGen.mBetweenMeta == baseMeta || worldGen.mSporadicMeta == baseMeta) { ItemStack other; other = result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore", "Vein")); @@ -187,9 +186,9 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public List getOtherStacks() { ArrayList ret = new ArrayList<>(); for (int i = 0; i < BW_OreLayer.sList.size(); i++) { - if (BW_OreLayer.sList.get(i) instanceof BW_WorldGenRoss128) { + if (BW_OreLayer.sList.get(i) instanceof BW_WorldGenRoss128b) { int baseMeta = result.getItemDamage(); - BW_WorldGenRoss128 worldGen = ((BW_WorldGenRoss128) BW_OreLayer.sList.get(i)); + BW_WorldGenRoss128b worldGen = ((BW_WorldGenRoss128b) BW_OreLayer.sList.get(i)); if (worldGen.mPrimaryMeta == baseMeta || worldGen.mSecondaryMeta == baseMeta || worldGen.mBetweenMeta == baseMeta || worldGen.mSporadicMeta == baseMeta) { ItemStack other; other = result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore", "Vein")); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 72db71e58d..d50081c9e9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -76,28 +76,30 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item { } public boolean onEntityItemUpdate(EntityItem aItemEntity) { - int aDamage = aItemEntity.getEntityItem().getItemDamage(); - if ((aDamage >= 0) && (!aItemEntity.worldObj.isRemote)) { - Werkstoff aMaterial = werkstoffHashMap.get((short) aDamage); - if ((aMaterial != null) && (aMaterial != Werkstoff.default_null_Werkstoff)) { - int tX = MathHelper.floor_double(aItemEntity.posX); - int tY = MathHelper.floor_double(aItemEntity.posY); - int tZ = MathHelper.floor_double(aItemEntity.posZ); - if ((orePrefixes == OrePrefixes.dustImpure) || (orePrefixes == OrePrefixes.dustPure)) { - Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); - byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); - if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { - aItemEntity.setEntityItemStack(WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.dust, aMaterial, aItemEntity.getEntityItem().stackSize)); - aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); - return true; - } - } else if (orePrefixes == OrePrefixes.crushed) { - Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); - byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); - if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { - aItemEntity.setEntityItemStack(WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.crushedPurified, aMaterial, aItemEntity.getEntityItem().stackSize)); - aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); - return true; + if (orePrefixes == OrePrefixes.dustImpure || orePrefixes == OrePrefixes.dustPure || orePrefixes == OrePrefixes.crushed) { + int aDamage = aItemEntity.getEntityItem().getItemDamage(); + if ((aDamage >= 0) && (!aItemEntity.worldObj.isRemote)) { + Werkstoff aMaterial = werkstoffHashMap.get((short) aDamage); + if ((aMaterial != null) && (aMaterial != Werkstoff.default_null_Werkstoff)) { + int tX = MathHelper.floor_double(aItemEntity.posX); + int tY = MathHelper.floor_double(aItemEntity.posY); + int tZ = MathHelper.floor_double(aItemEntity.posZ); + if ((orePrefixes == OrePrefixes.dustImpure) || (orePrefixes == OrePrefixes.dustPure)) { + Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); + byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); + if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { + aItemEntity.setEntityItemStack(WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.dust, aMaterial, aItemEntity.getEntityItem().stackSize)); + aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); + return true; + } + } else if (orePrefixes == OrePrefixes.crushed) { + Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); + byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); + if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { + aItemEntity.setEntityItemStack(WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.crushedPurified, aMaterial, aItemEntity.getEntityItem().stackSize)); + aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); + return true; + } } } } @@ -113,6 +115,8 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item { if (orePrefixes == OrePrefixes.dustImpure || orePrefixes == OrePrefixes.dustPure) { aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify")); } + if (orePrefixes == OrePrefixes.crushed) + aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify.2")); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index fd8e39ebcb..ba03007669 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -65,7 +65,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { } } - public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air) { + public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block) { if (!air) { aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); } @@ -76,7 +76,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { return false; } else { - if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) { + if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, block)) { return false; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index c1bd80e0ea..a681a86270 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.util.Pair; import gregtech.api.enums.*; import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.objects.GT_Fluid; import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; @@ -135,6 +136,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.stats = stats.setMass(tmpmass); this.texSet = texSet; + + if (this.getStats().meltingPoint > 0) { + this.fluid = new GT_Fluid("molten" + this.getDefaultName().replaceAll(" ", ""), "molten.autogenerated", this.getRGBA()); + this.getGenerationFeatures().toGenerate |= 16; + } + Werkstoff.werkstoffHashSet.add(this); Werkstoff.werkstoffHashMap.put(this.mID, this); } @@ -310,6 +317,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { metal 10 gem 100 ore 1000 + cell 1000 */ public byte toGenerate = 0b0001001; public byte blacklist; @@ -392,6 +400,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static class Stats { + public static final int NULL_KELVIN = 0; + int boilingPoint; int meltingPoint; long protons; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 824435461d..7256b12a43 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -42,6 +42,7 @@ import gregtech.api.enums.*; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_MultiTexture; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -74,9 +75,9 @@ public class WerkstoffLoader implements Runnable { 1, TextureSet.SET_FLINT, Arrays.asList(Materials.Bismuth), - new Pair(Materials.Bismuth, 2), - new Pair(Materials.Oxygen, 2), - new Pair(Materials.CarbonDioxide, 2) + new Pair<>(Materials.Bismuth, 2), + new Pair<>(Materials.Oxygen, 2), + new Pair<>(Materials.CarbonDioxide, 2) ); public static final Werkstoff Bismuthinit = new Werkstoff( new short[]{192, 192, 192, 0}, @@ -86,8 +87,8 @@ public class WerkstoffLoader implements Runnable { 2, TextureSet.SET_METALLIC, Arrays.asList(Materials.Bismuth, Materials.Sulfur), - new Pair(Materials.Bismuth, 2), - new Pair(Materials.Sulfur, 3) + new Pair<>(Materials.Bismuth, 2), + new Pair<>(Materials.Sulfur, 3) ); public static final Werkstoff Zirconium = new Werkstoff( new short[]{175, 175, 175, 0}, @@ -108,8 +109,8 @@ public class WerkstoffLoader implements Runnable { 4, TextureSet.SET_DIAMOND, Arrays.asList(Zirconium), - new Pair(Zirconium, 1), - new Pair(Materials.Oxygen, 2) + new Pair<>(Zirconium, 1), + new Pair<>(Materials.Oxygen, 2) ); public static final Werkstoff FluorBuergerit = new Werkstoff( new short[]{0x20, 0x20, 0x20, 0}, @@ -120,13 +121,13 @@ public class WerkstoffLoader implements Runnable { 5, TextureSet.SET_RUBY, Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), - new Pair(Materials.Sodium, 1), - new Pair(Materials.Iron, 3), - new Pair(Materials.Aluminium, 6), - new Pair(Materials.Silicon, 6), - new Pair(Materials.Boron, 3), - new Pair(Materials.Oxygen, 30), - new Pair(Materials.Fluorine, 1) + new Pair<>(Materials.Sodium, 1), + new Pair<>(Materials.Iron, 3), + new Pair<>(Materials.Aluminium, 6), + new Pair<>(Materials.Silicon, 6), + new Pair<>(Materials.Boron, 3), + new Pair<>(Materials.Oxygen, 30), + new Pair<>(Materials.Fluorine, 1) ); public static final Werkstoff YttriumOxide = new Werkstoff( new short[]{255,255,255,0}, @@ -135,8 +136,8 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().onlyDust(), //No autoadd here to gate this material by hand 6, TextureSet.SET_DULL, - new Pair(Materials.Yttrium, 2), - new Pair(Materials.Oxygen, 3) + new Pair<>(Materials.Yttrium, 2), + new Pair<>(Materials.Oxygen, 3) ); public static final Werkstoff ChromoAluminoPovondrait = new Werkstoff( new short[]{0, 0x79, 0x6A, 0}, @@ -148,13 +149,13 @@ public class WerkstoffLoader implements Runnable { 7, TextureSet.SET_RUBY, Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), - new Pair(Materials.Sodium, 1), - new Pair(Materials.Chrome, 3), - new Pair(Materials.Magnalium, 6), - new Pair(Materials.Silicon, 6), - new Pair(Materials.Boron, 3), - new Pair(Materials.Oxygen, 31), - new Pair(Materials.Hydrogen, 3) + new Pair<>(Materials.Sodium, 1), + new Pair<>(Materials.Chrome, 3), + new Pair<>(Materials.Magnalium, 6), + new Pair<>(Materials.Silicon, 6), + new Pair<>(Materials.Boron, 3), + new Pair<>(Materials.Oxygen, 31), + new Pair<>(Materials.Hydrogen, 3) ); public static final Werkstoff VanadioOxyDravit = new Werkstoff( new short[]{0x60, 0xA0, 0xA0, 0}, @@ -166,13 +167,13 @@ public class WerkstoffLoader implements Runnable { 8, TextureSet.SET_RUBY, Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), - new Pair(Materials.Sodium, 1), - new Pair(Materials.Vanadium, 3), - new Pair(Materials.Magnalium, 6), - new Pair(Materials.Silicon, 6), - new Pair(Materials.Boron, 3), - new Pair(Materials.Oxygen, 31), - new Pair(Materials.Hydrogen, 3) + new Pair<>(Materials.Sodium, 1), + new Pair<>(Materials.Vanadium, 3), + new Pair<>(Materials.Magnalium, 6), + new Pair<>(Materials.Silicon, 6), + new Pair<>(Materials.Boron, 3), + new Pair<>(Materials.Oxygen, 31), + new Pair<>(Materials.Hydrogen, 3) ); public static final Werkstoff Olenit = new Werkstoff( new short[]{210, 210, 210, 0}, @@ -184,12 +185,12 @@ public class WerkstoffLoader implements Runnable { 9, TextureSet.SET_RUBY, Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), - new Pair(Materials.Sodium, 1), - new Pair(Materials.Aluminium, 9), - new Pair(Materials.Silicon, 6), - new Pair(Materials.Boron, 3), - new Pair(Materials.Oxygen, 31), - new Pair(Materials.Hydrogen, 1) + new Pair<>(Materials.Sodium, 1), + new Pair<>(Materials.Aluminium, 9), + new Pair<>(Materials.Silicon, 6), + new Pair<>(Materials.Boron, 3), + new Pair<>(Materials.Oxygen, 31), + new Pair<>(Materials.Hydrogen, 1) ); public static final Werkstoff Arsenopyrite = new Werkstoff( new short[]{0xB0, 0xB0, 0xB0, 0}, @@ -199,9 +200,9 @@ public class WerkstoffLoader implements Runnable { 10, TextureSet.SET_METALLIC, Arrays.asList(Materials.Sulfur, Materials.Arsenic, Materials.Iron), - new Pair(Materials.Iron, 1), - new Pair(Materials.Arsenic, 1), - new Pair(Materials.Sulfur, 1) + new Pair<>(Materials.Iron, 1), + new Pair<>(Materials.Arsenic, 1), + new Pair<>(Materials.Sulfur, 1) ); public static final Werkstoff Ferberite = new Werkstoff( new short[]{0xB0, 0xB0, 0xB0, 0}, @@ -211,9 +212,9 @@ public class WerkstoffLoader implements Runnable { 11, TextureSet.SET_METALLIC, Arrays.asList(Materials.Iron, Materials.Tungsten), - new Pair(Materials.Iron, 1), - new Pair(Materials.Tungsten, 1), - new Pair(Materials.Oxygen, 3) + new Pair<>(Materials.Iron, 1), + new Pair<>(Materials.Tungsten, 1), + new Pair<>(Materials.Oxygen, 3) ); public static final Werkstoff Loellingit = new Werkstoff( new short[]{0xD0, 0xD0, 0xD0, 0}, @@ -223,8 +224,8 @@ public class WerkstoffLoader implements Runnable { 12, TextureSet.SET_METALLIC, Arrays.asList(Materials.Iron, Materials.Arsenic), - new Pair(Materials.Iron, 1), - new Pair(Materials.Arsenic, 2) + new Pair<>(Materials.Iron, 1), + new Pair<>(Materials.Arsenic, 2) ); public static final Werkstoff Roquesit = new Werkstoff( new short[]{0xA0, 0xA0, 0xA0, 0}, @@ -234,9 +235,9 @@ public class WerkstoffLoader implements Runnable { 13, TextureSet.SET_METALLIC, Arrays.asList(Materials.Copper, Materials.Sulfur), - new Pair(Materials.Copper, 1), - new Pair(Materials.Indium, 1), - new Pair(Materials.Sulfur, 2) + new Pair<>(Materials.Copper, 1), + new Pair<>(Materials.Indium, 1), + new Pair<>(Materials.Sulfur, 2) ); public static final Werkstoff Bornite = new Werkstoff( new short[]{0x97, 0x66, 0x2B, 0}, @@ -246,9 +247,9 @@ public class WerkstoffLoader implements Runnable { 14, TextureSet.SET_METALLIC, Arrays.asList(Materials.Copper, Materials.Iron, Materials.Sulfur), - new Pair(Materials.Copper, 5), - new Pair(Materials.Iron, 1), - new Pair(Materials.Sulfur, 4) + new Pair<>(Materials.Copper, 5), + new Pair<>(Materials.Iron, 1), + new Pair<>(Materials.Sulfur, 4) ); public static final Werkstoff Wittichenit = new Werkstoff( Materials.Copper.mRGBa, @@ -258,9 +259,9 @@ public class WerkstoffLoader implements Runnable { 15, TextureSet.SET_METALLIC, Arrays.asList(Materials.Copper, Materials.Bismuth, Materials.Sulfur), - new Pair(Materials.Copper, 5), - new Pair(Materials.Bismuth, 1), - new Pair(Materials.Sulfur, 4) + new Pair<>(Materials.Copper, 5), + new Pair<>(Materials.Bismuth, 1), + new Pair<>(Materials.Sulfur, 4) ); public static final Werkstoff Djurleit = new Werkstoff( new short[]{0x60, 0x60, 0x60, 0}, @@ -270,8 +271,8 @@ public class WerkstoffLoader implements Runnable { 16, TextureSet.SET_METALLIC, Arrays.asList(Materials.Copper, Materials.Copper, Materials.Sulfur), - new Pair(Materials.Copper, 31), - new Pair(Materials.Sulfur, 16) + new Pair<>(Materials.Copper, 31), + new Pair<>(Materials.Sulfur, 16) ); public static final Werkstoff Huebnerit = new Werkstoff( new short[]{0x80, 0x60, 0x60, 0}, @@ -281,9 +282,9 @@ public class WerkstoffLoader implements Runnable { 17, TextureSet.SET_METALLIC, Arrays.asList(Materials.Manganese, Materials.Tungsten), - new Pair(Materials.Manganese, 1), - new Pair(Materials.Tungsten, 1), - new Pair(Materials.Oxygen, 3) + new Pair<>(Materials.Manganese, 1), + new Pair<>(Materials.Tungsten, 1), + new Pair<>(Materials.Oxygen, 3) ); public static final Werkstoff Thorianit = new Werkstoff( new short[]{0x30, 0x30, 0x30, 0}, @@ -293,8 +294,8 @@ public class WerkstoffLoader implements Runnable { 18, TextureSet.SET_METALLIC, Arrays.asList(Materials.Thorium), - new Pair(Materials.Thorium, 1), - new Pair(Materials.Oxygen, 2) + new Pair<>(Materials.Thorium, 1), + new Pair<>(Materials.Oxygen, 2) ); public static final Werkstoff RedZircon = new Werkstoff( new short[]{195, 19, 19, 0}, @@ -305,9 +306,9 @@ public class WerkstoffLoader implements Runnable { 19, TextureSet.SET_GEM_VERTICAL, Arrays.asList(Zirconium,Materials.Silicon), - new Pair(Zirconium, 1), - new Pair(Materials.Silicon, 1), - new Pair(Materials.Oxygen, 4) + new Pair<>(Zirconium, 1), + new Pair<>(Materials.Silicon, 1), + new Pair<>(Materials.Oxygen, 4) ); //GT Enhancements @@ -320,7 +321,7 @@ public class WerkstoffLoader implements Runnable { 20, TextureSet.SET_FLINT, Arrays.asList(Materials.RockSalt,Materials.Borax), - new Pair(Materials.Salt, 1) + new Pair<>(Materials.Salt, 1) ); public static final Werkstoff Spodumen = new Werkstoff( Materials.Spodumene.mRGBa, @@ -331,7 +332,7 @@ public class WerkstoffLoader implements Runnable { 21, TextureSet.SET_FLINT, Arrays.asList(Materials.Spodumene), - new Pair(Materials.Spodumene, 1) + new Pair<>(Materials.Spodumene, 1) ); public static final Werkstoff RockSalt = new Werkstoff( Materials.RockSalt.mRGBa, @@ -342,7 +343,7 @@ public class WerkstoffLoader implements Runnable { 22, TextureSet.SET_FLINT, Arrays.asList(Materials.RockSalt,Materials.Borax), - new Pair(Materials.RockSalt, 1) + new Pair<>(Materials.RockSalt, 1) ); public static final Werkstoff Fayalit = new Werkstoff( new short[]{50,50,50,0}, @@ -353,9 +354,9 @@ public class WerkstoffLoader implements Runnable { 23, TextureSet.SET_QUARTZ, Arrays.asList(Materials.Iron,Materials.Silicon), - new Pair(Materials.Iron, 2), - new Pair(Materials.Silicon, 1), - new Pair(Materials.Oxygen, 4) + new Pair<>(Materials.Iron, 2), + new Pair<>(Materials.Silicon, 1), + new Pair<>(Materials.Oxygen, 4) ); public static final Werkstoff Forsterit = new Werkstoff( new short[]{255,255,255,0}, @@ -366,9 +367,9 @@ public class WerkstoffLoader implements Runnable { 24, TextureSet.SET_QUARTZ, Arrays.asList(Materials.Magnesium,Materials.Silicon), - new Pair(Materials.Magnesium, 2), - new Pair(Materials.Silicon, 1), - new Pair(Materials.Oxygen, 4) + new Pair<>(Materials.Magnesium, 2), + new Pair<>(Materials.Silicon, 1), + new Pair<>(Materials.Oxygen, 4) ); public static final Werkstoff Hedenbergit = new Werkstoff( new short[]{100,150,100,0}, @@ -379,10 +380,10 @@ public class WerkstoffLoader implements Runnable { 25, TextureSet.SET_QUARTZ, Arrays.asList(Materials.Iron,Materials.Calcium,Materials.Silicon), - new Pair(Materials.Calcium, 1), - new Pair(Materials.Iron, 1), - new Pair(Materials.Silicon, 2), - new Pair(Materials.Oxygen, 6) + new Pair<>(Materials.Calcium, 1), + new Pair<>(Materials.Iron, 1), + new Pair<>(Materials.Silicon, 2), + new Pair<>(Materials.Oxygen, 6) ); public static final Werkstoff DescloiziteZNVO4 = new Werkstoff( new short[]{0xBF,0x18,0x0F,0}, @@ -393,10 +394,10 @@ public class WerkstoffLoader implements Runnable { 26, TextureSet.SET_QUARTZ, Arrays.asList(Materials.Lead,Materials.Copper,Materials.Vanadium), - new Pair(Materials.Lead, 1), - new Pair(Materials.Zinc, 1), - new Pair(Materials.Vanadium, 1), - new Pair(Materials.Oxygen, 4) + new Pair<>(Materials.Lead, 1), + new Pair<>(Materials.Zinc, 1), + new Pair<>(Materials.Vanadium, 1), + new Pair<>(Materials.Oxygen, 4) ); public static final Werkstoff DescloiziteCUVO4 = new Werkstoff( new short[]{0xf9,0x6d,0x18,0}, @@ -407,10 +408,10 @@ public class WerkstoffLoader implements Runnable { 27, TextureSet.SET_QUARTZ, Arrays.asList(Materials.Lead,Materials.Zinc,Materials.Vanadium), - new Pair(Materials.Lead, 1), - new Pair(Materials.Copper, 1), - new Pair(Materials.Vanadium, 1), - new Pair(Materials.Oxygen, 4) + new Pair<>(Materials.Lead, 1), + new Pair<>(Materials.Copper, 1), + new Pair<>(Materials.Vanadium, 1), + new Pair<>(Materials.Oxygen, 4) ); public static final Werkstoff FuchsitAL = new Werkstoff( new short[]{0x4D,0x7F,0x64,0}, @@ -422,11 +423,11 @@ public class WerkstoffLoader implements Runnable { 28, TextureSet.SET_METALLIC, Arrays.asList(Materials.Potassium,Materials.Aluminium,Materials.Silicon), - new Pair(Materials.Potassium, 1), - new Pair(Materials.Aluminium, 3), - new Pair(Materials.Silicon, 3), - new Pair(Materials.Oxygen, 12), - new Pair(Materials.Hydrogen, 2) + new Pair<>(Materials.Potassium, 1), + new Pair<>(Materials.Aluminium, 3), + new Pair<>(Materials.Silicon, 3), + new Pair<>(Materials.Oxygen, 12), + new Pair<>(Materials.Hydrogen, 2) ); public static final Werkstoff FuchsitCR = new Werkstoff( @@ -439,11 +440,11 @@ public class WerkstoffLoader implements Runnable { 29, TextureSet.SET_METALLIC, Arrays.asList(Materials.Potassium,Materials.Chrome,Materials.Silicon), - new Pair(Materials.Potassium, 1), - new Pair(Materials.Chrome, 3), - new Pair(Materials.Silicon, 3), - new Pair(Materials.Oxygen, 12), - new Pair(Materials.Hydrogen, 2) + new Pair<>(Materials.Potassium, 1), + new Pair<>(Materials.Chrome, 3), + new Pair<>(Materials.Silicon, 3), + new Pair<>(Materials.Oxygen, 12), + new Pair<>(Materials.Hydrogen, 2) ); public static final Werkstoff Thorium232 = new Werkstoff( @@ -477,6 +478,7 @@ public class WerkstoffLoader implements Runnable { public void init() { if (WerkstoffLoader.INSTANCE == null) MainMod.LOGGER.error("INSTANCE IS NULL THIS SHOULD NEVER HAPPEN!"); + GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.purify.2","Throw into Cauldron to get clean crushed Ore"); } public void runInit() { @@ -589,6 +591,11 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.items.put(dustPure, new BW_MetaGenerated_Items(dustPure)); WerkstoffLoader.items.put(dustImpure, new BW_MetaGenerated_Items(dustImpure)); } + if ((toGenerateGlobal & 0b10000) != 0) { + WerkstoffLoader.items.put(cell, new BW_MetaGenerated_Items(cell)); + WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle)); + WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); + } } public void gameRegistryHandler(){ diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java new file mode 100644 index 0000000000..92f42ad9e0 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.oregen; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.world.GT_Worldgen; +import gregtech.common.blocks.GT_Block_Ores; +import gregtech.common.blocks.GT_TileEntity_Ores; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +/** + * Original GT File Stripped and adjusted to work with this mod + */ +public abstract class BW_OreLayer extends GT_Worldgen { + public static final List sList = new ArrayList<>(); + private static final boolean logOregenRoss128 = false; + public static int sWeight; + public byte bwOres; + public int mMinY, mWeight, mDensity, mSize, mMaxY, mPrimaryMeta, mSecondaryMeta, mBetweenMeta, mSporadicMeta; + + public abstract Block getDefaultBlockToReplace(); + + public BW_OreLayer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { + super(aName, BW_OreLayer.sList, aDefault); + this.mMinY = (short) aMinY; + this.mMaxY = (short) aMaxY; + this.mWeight = (short) aWeight; + this.mDensity = (short) aDensity; + this.mSize = (short) Math.max(1, aSize); + + if (this.mEnabled) + BW_OreLayer.sWeight += this.mWeight; + + if (top instanceof Werkstoff) + this.bwOres = (byte) (this.bwOres | 0b1000); + if (bottom instanceof Werkstoff) + this.bwOres = (byte) (this.bwOres | 0b0100); + if (between instanceof Werkstoff) + this.bwOres = (byte) (this.bwOres | 0b0010); + if (sprinkled instanceof Werkstoff) + this.bwOres = (byte) (this.bwOres | 0b0001); + + short aPrimary = top instanceof Materials ? + (short) ((Materials) top).mMetaItemSubID : + top instanceof Werkstoff ? + ((Werkstoff) top).getmID() : + 0; + short aSecondary = bottom instanceof Materials ? + (short) ((Materials) bottom).mMetaItemSubID : + bottom instanceof Werkstoff ? + ((Werkstoff) bottom).getmID() : + 0; + short aBetween = between instanceof Materials ? + (short) ((Materials) between).mMetaItemSubID : + between instanceof Werkstoff ? + ((Werkstoff) between).getmID() : + 0; + short aSporadic = sprinkled instanceof Materials ? + (short) ((Materials) sprinkled).mMetaItemSubID : + sprinkled instanceof Werkstoff ? + ((Werkstoff) sprinkled).getmID() : + 0; + this.mPrimaryMeta = aPrimary; + this.mSecondaryMeta = aSecondary; + this.mBetweenMeta = aBetween; + this.mSporadicMeta = aSporadic; + + } + + @Override + public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { { + int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); + int cX = aChunkX - aRandom.nextInt(this.mSize); + int eX = aChunkX + 16 + aRandom.nextInt(this.mSize); + + for (int tX = cX; tX <= eX; ++tX) { + int cZ = aChunkZ - aRandom.nextInt(this.mSize); + int eZ = aChunkZ + 16 + aRandom.nextInt(this.mSize); + + for (int tZ = cZ; tZ <= eZ; ++tZ) { + int i; + if (this.mSecondaryMeta > 0) { + for (i = tMinY - 1; i < tMinY + 2; ++i) { + if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { + this.setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false); + } + } + } + + if (this.mBetweenMeta > 0 && (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) { + this.setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); + } + + if (this.mPrimaryMeta > 0) { + for (i = tMinY + 3; i < tMinY + 6; ++i) { + if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { + this.setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false); + } + } + } + + if (this.mSporadicMeta > 0 && (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) { + this.setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); + } + } + } + + if (BW_OreLayer.logOregenRoss128) { + MainMod.LOGGER.info("Generated Orevein: " + this.mWorldGenName + " " + aChunkX + " " + aChunkZ); + } + + return true; + } + } + + public boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre) { + if ((aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0) || (aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0) || (aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0) || (aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0)) { + return BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, getDefaultBlockToReplace()); + } + return setGTOreBlockSpace(aWorld, aX, aY, aZ, aMetaData, getDefaultBlockToReplace()); + } + + public boolean setGTOreBlockSpace(World aWorld, int aX, int aY, int aZ, int aMetaData, Block block){ + if (!GT_TileEntity_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, false)) { + aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); + Block tBlock = aWorld.getBlock(aX, aY, aZ); + Block tOreBlock = GregTech_API.sBlockOres1; + if (aMetaData < 0 || tBlock == Blocks.air) { + return false; + } else { + if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, block)) { + return false; + } + aMetaData += 5000; + aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0); + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof GT_TileEntity_Ores) { + ((GT_TileEntity_Ores) tTileEntity).mMetaData = (short) aMetaData; + } + return true; + } + }else + return true; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java new file mode 100644 index 0000000000..907f1eeaff --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.oregen; + + +import cpw.mods.fml.common.IWorldGenerator; +import gregtech.api.objects.XSTR; +import gregtech.api.util.GT_Log; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; + +import java.util.HashSet; +import java.util.Random; + +/** + * Original GT File Stripped and adjusted to work with this mod + */ +public class BW_WordGenerator implements IWorldGenerator { + + public BW_WordGenerator() { + //GT_NH Override... wont be actually registered to force its generation directly in the ChunkProvider + //GameRegistry.registerWorldGenerator(this, 1073741823); + } + + public synchronized void generate(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + new BW_WordGenerator.WorldGenContainer(aX * 16, aZ * 16, aWorld.provider.dimensionId, aWorld, aChunkGenerator, aChunkProvider).run(); + } + + public static class WorldGenContainer implements Runnable { + public static HashSet mGenerated = new HashSet<>(2000); + public final int mDimensionType; + public final World mWorld; + public final IChunkProvider mChunkGenerator; + public final IChunkProvider mChunkProvider; + public int mX; + public int mZ; + + public WorldGenContainer(int aX, int aZ, int aDimensionType, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + this.mX = aX; + this.mZ = aZ; + this.mDimensionType = aDimensionType; + this.mWorld = aWorld; + this.mChunkGenerator = aChunkGenerator; + this.mChunkProvider = aChunkProvider; + } + + //returns a coordinate of a center chunk of 3x3 square; the argument belongs to this square + public int getVeinCenterCoordinate(int c) { + c += c < 0 ? 1 : 3; + return c - c % 3 - 2; + } + + public boolean surroundingChunksLoaded(int xCenter, int zCenter) { + return this.mWorld.checkChunksExist(xCenter - 16, 0, zCenter - 16, xCenter + 16, 0, zCenter + 16); + } + + public XSTR getRandom(int xChunk, int zChunk) { + long worldSeed = this.mWorld.getSeed(); + XSTR fmlRandom = new XSTR(worldSeed); + long xSeed = fmlRandom.nextLong() >> 2 + 1L; + long zSeed = fmlRandom.nextLong() >> 2 + 1L; + long chunkSeed = (xSeed * xChunk + zSeed * zChunk) ^ worldSeed; + fmlRandom.setSeed(chunkSeed); + return new XSTR(fmlRandom.nextInt()); + } + + public void run() { + int xCenter = this.getVeinCenterCoordinate(this.mX >> 4); + int zCenter = this.getVeinCenterCoordinate(this.mZ >> 4); + Random random = this.getRandom(xCenter, zCenter); + xCenter <<= 4; + zCenter <<= 4; + ChunkCoordIntPair centerChunk = new ChunkCoordIntPair(xCenter, zCenter); + if (!BW_WordGenerator.WorldGenContainer.mGenerated.contains(centerChunk) && this.surroundingChunksLoaded(xCenter, zCenter)) { + BW_WordGenerator.WorldGenContainer.mGenerated.add(centerChunk); + if ((BW_OreLayer.sWeight > 0) && (BW_OreLayer.sList.size() > 0)) { + boolean temp = true; + int tRandomWeight; + for (int i = 0; (i < 256) && (temp); i++) { + tRandomWeight = random.nextInt(BW_OreLayer.sWeight); + for (BW_OreLayer tWorldGen : BW_OreLayer.sList) { + tRandomWeight -= tWorldGen.mWeight; + if (tRandomWeight <= 0) { + try { + if (tWorldGen.executeWorldgen(this.mWorld, random, "", this.mDimensionType, xCenter, zCenter, this.mChunkGenerator, this.mChunkProvider)) { + temp = false; + } + break; + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + } + } + } + } + } + Chunk tChunk = this.mWorld.getChunkFromBlockCoords(this.mX, this.mZ); + if (tChunk != null) { + tChunk.isModified = true; + } + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java new file mode 100644 index 0000000000..a1535ff8f5 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.oregen; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.ISubTagContainer; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidRegistry; + +import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; + + +public class BW_WorldGenRoss128b extends BW_OreLayer { + + public Block getDefaultBlockToReplace(){ + return Blocks.stone; + } + + public BW_WorldGenRoss128b(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { + super(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, top, bottom, between, sprinkled); + } + + public static void init_OresRoss128() { + new BW_WorldGenRoss128b("ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, WerkstoffLoader.Thorianit, Materials.Uraninite, Materials.Lepidolite, Materials.Spodumene); + new BW_WorldGenRoss128b("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Materials.Graphite, Materials.Diamond, Materials.Coal, Materials.Graphite); + new BW_WorldGenRoss128b("ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, WerkstoffLoader.Bismuthinit, Materials.Stibnite, Materials.Bismuth, WerkstoffLoader.Bismutite); + new BW_WorldGenRoss128b("ore.mix.ross128.TurmalinAlkali", true, 5, 200, 15, 4, 48, WerkstoffLoader.Olenit, WerkstoffLoader.FluorBuergerit, WerkstoffLoader.ChromoAluminoPovondrait, WerkstoffLoader.VanadioOxyDravit); + new BW_WorldGenRoss128b("ore.mix.ross128.Roquesit", true, 5, 250, 3, 1, 12, WerkstoffLoader.Arsenopyrite, WerkstoffLoader.Ferberite, WerkstoffLoader.Loellingit, WerkstoffLoader.Roquesit); + new BW_WorldGenRoss128b("ore.mix.ross128.Tungstate", true, 5, 250, 10, 4, 14, WerkstoffLoader.Ferberite, WerkstoffLoader.Huebnerit, WerkstoffLoader.Loellingit, Materials.Scheelite); + new BW_WorldGenRoss128b("ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, WerkstoffLoader.Djurleit, WerkstoffLoader.Bornite, WerkstoffLoader.Wittichenit, Materials.Tetrahedrite); + new BW_WorldGenRoss128b("ore.mix.ross128.Forsterit", true, 20, 180, 50, 2, 32, WerkstoffLoader.Forsterit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescloiziteCUVO4, WerkstoffLoader.DescloiziteZNVO4); + new BW_WorldGenRoss128b("ore.mix.ross128.Hedenbergit", true, 20, 180, 50, 2, 32, WerkstoffLoader.Hedenbergit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescloiziteCUVO4, WerkstoffLoader.DescloiziteZNVO4); + new BW_WorldGenRoss128b("ore.mix.ross128.RedZircon", true, 10, 40, 40, 3, 24, WerkstoffLoader.Fayalit,WerkstoffLoader.FuchsitAL , WerkstoffLoader.RedZircon,WerkstoffLoader.FuchsitCR); + } + + public static void init_undergroundFluidsRoss128() { + String ross128b = StatCollector.translateToLocal("planet.Ross128b"); + uo_dimensionList.SetConfigValues(ross128b, ross128b, "veryheavyoil", "liquid_extra_heavy_oil", 0, 625, 40, 5); + uo_dimensionList.SetConfigValues(ross128b, ross128b, "lava", FluidRegistry.getFluidName(FluidRegistry.LAVA), 0, 32767, 5, 5); + uo_dimensionList.SetConfigValues(ross128b, ross128b, "gas_natural_gas", "gas_natural_gas", 0, 625, 65, 5); + + } + + @Override + public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { + return aWorld.provider.dimensionId == ConfigHandler.ross128BID; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java new file mode 100644 index 0000000000..87158bf01e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.oregen; + +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.util.GT_ModHandler; +import net.minecraft.block.Block; +import net.minecraft.util.StatCollector; + +import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; + +public class BW_WorldGenRoss128ba extends BW_OreLayer { + + public BW_WorldGenRoss128ba(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { + super(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, top, bottom, between, sprinkled); + } + + @Override + public Block getDefaultBlockToReplace() { + return Block.getBlockFromItem(GT_ModHandler.getModItem("galacticraftCore","tile.moonBlock",1).getItem()); + } + + public static void init_OresRoss128ba() { + //none + } + + public static void init_undergroundFluidsRoss128ba() { + String ross128b = StatCollector.translateToLocal("planet.Ross128ba"); + uo_dimensionList.SetConfigValues(ross128b, ross128b, Materials.SaltWater.getFluid(1).getUnlocalizedName(), Materials.SaltWater.getFluid(1).getUnlocalizedName(), 0, 625, 40, 5); + uo_dimensionList.SetConfigValues(ross128b, ross128b, Materials.Helium_3.getGas(1).getUnlocalizedName(), Materials.Helium_3.getGas(1).getUnlocalizedName(), 0, 625, 60, 5); + + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java new file mode 100644 index 0000000000..8254b44815 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.worldgen; + +import gregtech.api.GregTech_API; +import net.minecraft.block.Block; + +import java.util.Random; + +public class GT_WorldgenUtil { + + private GT_WorldgenUtil() {} + + public final static Block GT_TILES = GregTech_API.sBlockMachines; + + public final static short[][] METAFORTIERS_ENERGY = { + {100,101,102,105}, //ULV=HPSteam + {1110,1115,1120,1127}, + {1111,12726,1116,1121,1128}, + {1112,12727,1117,1122,1129}, + {12728,1190,1130,12685}, + {1191,1174,695,12686}, + }; + public final static short[][] METAFORTIERS_BUFFER = { + {5133,5123}, //ULV=HPSteam + {161,171,181,191}, + {162,172,182,192}, + {163,173,183,193}, + {164,174,184,194}, + {165,175,185,195}, + }; + //ULV=HPSteam + public final static short[][] METAFORTIERS_CABLE = { + {5133,5123}, //ULV=HPSteam + {1210,1230,1250,1270,1290}, + {1310,1330,1350,1370,1390}, + {1410,1430,1450,1470,1490}, + {1510,1530,1550,1570,1590}, + {1650,1670,1690}, + }; + public final static short[][] METAFORTIERS_MACHINE = { + {103,104,106,107,109,110,112,113,115,116,118,119}, //ULV=HPSteam + {201,211,221,231,241,251,261,271,281,291,301,311,321,331,341,351,361,371,381,391,401,411,421,431,441,451,461,471,481,491,501,511,521,531,541,551,561,571,581,591,601,611,621,631,641,651,661,671}, + {}, + {}, + {}, + {}, + }; + + private static boolean initialisized = false; + + private static void init(){ + + for (int j = 1; j < 5; j++) { + METAFORTIERS_MACHINE[j+1]=new short[METAFORTIERS_MACHINE[1].length]; + for (int i = 0; i < METAFORTIERS_MACHINE[1].length; i++) { + METAFORTIERS_MACHINE[j+1][i]= (short) (METAFORTIERS_MACHINE[1][i]+j); + } + } + initialisized=true; + } + + public static short getGenerator(Random rand,int tier){ + short meta = METAFORTIERS_ENERGY[tier][rand.nextInt(METAFORTIERS_ENERGY[tier].length)]; + return GregTech_API.METATILEENTITIES[meta] != null ? meta : getGenerator(rand,tier); + } + + public static short getBuffer(Random rand,int tier){ + short meta = METAFORTIERS_BUFFER[tier][rand.nextInt(METAFORTIERS_BUFFER[tier].length)]; + return GregTech_API.METATILEENTITIES[meta] != null ? meta : getBuffer(rand,tier); + } + + public static short getCable(Random rand,int tier){ + short meta = METAFORTIERS_CABLE[tier][rand.nextInt(METAFORTIERS_CABLE[tier].length)]; + return GregTech_API.METATILEENTITIES[meta] != null ? meta : getCable(rand,tier); + } + + public static short getMachine(Random rand,int tier){ + if (!initialisized) + init(); + short meta = METAFORTIERS_MACHINE[tier][rand.nextInt(METAFORTIERS_MACHINE[tier].length)]; + return GregTech_API.METATILEENTITIES[meta] != null ? meta : getMachine(rand,tier); + } + + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java new file mode 100644 index 0000000000..acd948dd19 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java @@ -0,0 +1,325 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.worldgen; + +import com.github.bartimaeusnek.bartworks.util.Pair; +import gregtech.api.GregTech_API; +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import gregtech.api.metatileentity.MetaPipeEntity; +import gregtech.api.objects.XSTR; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraftforge.common.ChestGenHooks; +import net.minecraftforge.common.ForgeHooks; + +import java.util.Random; + +import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; +import static net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST; +import static net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST; + +public abstract class MapGenRuins extends WorldGenerator { + + protected Pair[][] ToBuildWith = new Pair[4][0]; + + @Override + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + return false; + } + + protected void setFloorBlocks(int[] metas, Block... blocks){ + ToBuildWith[0]=new Pair[metas.length]; + for (int i = 0; i < metas.length; i++) { + ToBuildWith[0][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + } + } + + protected void setWallBlocks(int[] metas,Block... blocks){ + ToBuildWith[1]=new Pair[metas.length]; + for (int i = 0; i < metas.length; i++) { + ToBuildWith[1][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + } + } + + protected void setRoofBlocks(int[] metas,Block... blocks){ + ToBuildWith[2]=new Pair[metas.length]; + for (int i = 0; i < metas.length; i++) { + ToBuildWith[2][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + } + } + + protected void setMiscBlocks(int[] metas,Block... blocks){ + ToBuildWith[3]=new Pair[metas.length]; + for (int i = 0; i < metas.length; i++) { + ToBuildWith[3][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + } + } + + int[] statBlocks = new int[4]; + + protected void setRandomBlockWAirChance(World worldObj, int x, int y, int z, Random rand, int airchance, Pair... blocks){ + if (rand.nextInt(100) > airchance) + setRandomBlock(worldObj,x,y,z,rand,blocks); + else + setBlock(worldObj,x,y,z,Blocks.air,0); + } + + protected void setRandomBlock(World worldObj, int x, int y, int z, Random rand, Pair... blocks){ + Block toSet = blocks[rand.nextInt(blocks.length)].getKey(); + int meta = blocks[rand.nextInt(blocks.length)].getValue(); + this.setBlock(worldObj,x,y,z,toSet,meta); + } + + protected void setBlock(World worldObj, int x, int y, int z, Block block,int meta){ + this.setBlockAndNotifyAdequately(worldObj,x,y,z,block,meta); + } + protected void setBlock(World worldObj, int x, int y, int z, Pair pair){ + this.setBlockAndNotifyAdequately(worldObj,x,y,z,pair.getKey(),pair.getValue()); + } + + public static class RuinsBase extends MapGenRuins{ + + @Override + public boolean generate(World worldObj, Random rand1, int x, int y, int z) { + + for (int i = 0; i < rand1.nextInt(144); i++) { + rand1.nextLong(); + } + + Random rand = new XSTR(rand1.nextLong()); + + + x=x+5; + z=z+5; + + if (worldObj.getBlock(x,y,z) == Blocks.air) { + while (worldObj.getBlock(x, y, z) == Blocks.air) { + y--; + } + } else { + while (worldObj.getBlock(x, y, z) != Blocks.air) { + y++; + } + y--; + } + + setFloorBlocks(new int[]{0,0,0},Blocks.brick_block,Blocks.double_stone_slab,Blocks.stonebrick); + setWallBlocks(new int[]{0,1,2,1,1},Blocks.stonebrick); + setRoofBlocks(new int[]{9},Blocks.log); + setMiscBlocks(new int[]{1},Blocks.log); + statBlocks= new int[]{rand.nextInt(ToBuildWith[0].length)}; + int colored=rand.nextInt(15); + int tier = rand.nextInt(6); + boolean useColor = rand.nextBoolean(); + byte set = 0; + byte toSet = (byte) (rand.nextInt(6-tier)+1); + short cablemeta = GT_WorldgenUtil.getCable(rand,tier); + byte treeinaRow = 0; + boolean lastset = rand.nextBoolean(); + for (int dx = -6; dx <= 6; dx++) { + for (int dy = 0; dy <= 8; dy++) { + for (int dz = -6; dz <= 6; dz++) { + this.setBlock(worldObj,x+dx,y+dy,z+dz,Blocks.air,0); + if (dy == 0){ + Pair floor = ToBuildWith[0][statBlocks[0]]; + this.setBlock(worldObj,x+dx,y+dy,z+dz, floor.getKey(),floor.getValue()); + } + else if (dy > 0 && dy < 4){ + if (Math.abs(dx) == 5 && Math.abs(dz) == 5){ + setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,5, ToBuildWith[3][0]); + } + else if ((dx == 0) && dz == -5 && (dy == 1 || dy == 2)){ + if (dy == 1) + this.setBlock(worldObj,x+dx,y+dy,z+dz, Blocks.iron_door,1); + if (dy == 2) + this.setBlock(worldObj,x+dx,y+dy,z+dz, Blocks.iron_door,8); + } + else if (Math.abs(dx)== 5 && Math.abs(dz) < 5 || Math.abs(dz)== 5 && Math.abs(dx) < 5){ + setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[1]); + if (dy == 2) { + if (rand.nextInt(100)<12) + if (useColor) + setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,new Pair<>(Blocks.stained_glass_pane,colored)); + else + setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,new Pair<>(Blocks.glass_pane,0)); + } + } + + if (dy == 3 && Math.abs(dx)== 6){ + setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[2]); + } + + if (dy == 1){ + if (dx == 3 && dz == -3){ + setBlock(worldObj,x + dx, y + dy, z + dz,Blocks.crafting_table,0); + } + if (dx == -3 && (dz == -3 || dz == -2)){ + setBlock(worldObj,x + dx, y + dy, z + dz,Blocks.chest,5); + IInventory chest = (IInventory)worldObj.getTileEntity(x + dx, y + dy, z + dz); + if (chest != null) { + WeightedRandomChestContent.generateChestContents(rand, ChestGenHooks.getItems(PYRAMID_JUNGLE_CHEST, rand), chest, ChestGenHooks.getCount(PYRAMID_JUNGLE_CHEST, rand)); + } + } + + if (dx == 4 && dz==4) { + short meta = GT_WorldgenUtil.getGenerator(rand,tier); + setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES,GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); + BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); + BTE.setInitialValuesAsNBT(null,meta); + BTE.setOwnerName("Ancient Cultures"); + BTE.setFrontFacing(tier > 0 ? (byte)4 : (byte) 2); + + } + else if (dx == 3 && dz==4) { + if (tier>0) { + short meta = GT_WorldgenUtil.getBuffer(rand, tier); + setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); + BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); + BTE.setInitialValuesAsNBT(null, meta); + BTE.setOwnerName("Ancient Cultures"); + BTE.setFrontFacing((byte) 4); + }else{ + short meta = cablemeta; + setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 33, new Pair(GT_WorldgenUtil.GT_TILES, (int) GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType())); + BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); + if (BTE != null) { + BTE.setInitialValuesAsNBT(null, meta); + BTE.setOwnerName("Ancient Cultures"); + BTE.setFrontFacing((byte) 4); + BTE.mConnections = (byte) (BTE.mConnections | 1 << (byte) 4); + BTE.mConnections = (byte) (BTE.mConnections | 1 << (byte) GT_Utility.getOppositeSide(4)); + ((MetaPipeEntity) BTE.getMetaTileEntity()).mConnections = BTE.mConnections; + } + } + } + else if (dx < 3 && dx > -5 && dz == 4) { + short meta = cablemeta; + setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 33, new Pair(GT_WorldgenUtil.GT_TILES, (int) GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType())); + + BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); + if (BTE != null) { + BTE.setInitialValuesAsNBT(null, meta); + BTE.setOwnerName("Ancient Cultures"); + BTE.setFrontFacing((byte) 4); + BTE.mConnections = (byte)(BTE.mConnections | 1 << (byte)4); + BTE.mConnections = (byte)(BTE.mConnections | 1 << (byte) GT_Utility.getOppositeSide(4)); + + BaseMetaTileEntity BPE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz-1); + if (BPE != null) { + BTE.mConnections = (byte)(BTE.mConnections | 1 << (byte)2); + } + ((MetaPipeEntity)BTE.getMetaTileEntity()).mConnections=BTE.mConnections; + } + + } + else if (dx < 3 && dx > -5 && dz == 3 && set < toSet){ + if (!lastset || treeinaRow > 2) { + short meta = GT_WorldgenUtil.getMachine(rand, tier); + setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); + BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); + BTE.setInitialValuesAsNBT(null, meta); + BTE.setOwnerName("Ancient Cultures"); + BTE.setFrontFacing((byte) 2); + + set++; + treeinaRow = 0; + lastset=true; + } + else { + lastset = rand.nextBoolean(); + if (lastset) + treeinaRow++; + } + } + } + } + else if(dy == 4){ + if (Math.abs(dx)== 5) + setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[2]); + else if (Math.abs(dz) == 5 && Math.abs(dx) < 5) + setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[1]); + } + else if(dy == 5){ + if (Math.abs(dx)== 4) + setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[2]); + else if (Math.abs(dz) == 5 && Math.abs(dx) < 4) + setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[1]); + } + else if(dy == 6){ + if (Math.abs(dx)== 3) + setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[2]); + else if (Math.abs(dz) == 5 && Math.abs(dx) < 3) + setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[1]); + } + else if(dy == 7){ + if (Math.abs(dx)== 2) + setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[2]); + else if (Math.abs(dz) == 5 && Math.abs(dx) < 2) + setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[1]); + } + else if(dy == 8) { + if (Math.abs(dx) == 1 || Math.abs(dx) == 0) + setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, ToBuildWith[2]); + } + } + } + } + tosetloop: + while (set < toSet){ + int dy = 1; + int dz = 3; + for (int dx = 2; dx > -5; dx--) { + if (set < toSet){ + if (!lastset || treeinaRow > 2 && worldObj.getTileEntity(x + dx, y + dy, z + dz) == null) { + short meta = GT_WorldgenUtil.getMachine(rand, tier); + setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); + BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); + BTE.setInitialValuesAsNBT(null, meta); + BTE.setOwnerName("Ancient Cultures"); + BTE.setFrontFacing((byte) 2); + + set++; + treeinaRow = 0; + lastset=true; + } + else { + lastset = rand.nextBoolean(); + if (lastset) + treeinaRow++; + } + }else + break tosetloop; + } + } + return true; + } + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index cd420afdcb..da78891b8c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -22,12 +22,14 @@ package com.github.bartimaeusnek.crossmod; +import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -61,4 +63,8 @@ public class BartWorksCrossmod { GalacticraftProxy.init(init); } + @Mod.EventHandler + public void onFMLServerStart(FMLServerStartingEvent event) { + event.registerServerCommand(new SummonRuin()); + } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java index c93a698902..a8c9a218b1 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java @@ -32,8 +32,8 @@ import net.minecraftforge.common.config.Configuration; import java.io.File; -import static com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WorldGenRoss128.init_OresRoss128; -import static com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WorldGenRoss128.init_undergroundFluidsRoss128; +import static com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b.init_OresRoss128; +import static com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b.init_undergroundFluidsRoss128; public class GalacticraftProxy { public static GT_UO_DimensionList uo_dimensionList = new GT_UO_DimensionList(); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java new file mode 100644 index 0000000000..c3b87bf15c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.planets; + +import micdoodle8.mods.galacticraft.api.prefab.world.gen.WorldProviderSpace; +import micdoodle8.mods.galacticraft.api.world.IExitHeight; +import micdoodle8.mods.galacticraft.api.world.ISolarLevel; + +public abstract class AbstractWorldProviderSpace extends WorldProviderSpace implements IExitHeight, ISolarLevel { + @Override + public boolean canRainOrSnow() { + return false; + } + + @Override + public boolean hasSunset() { + return true; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_OreLayer.java deleted file mode 100644 index 4f15b27b60..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_OreLayer.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen; - -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import gregtech.api.enums.Materials; -import gregtech.api.interfaces.ISubTagContainer; -import gregtech.api.world.GT_Worldgen; -import gregtech.common.blocks.GT_TileEntity_Ores; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -/** - * Original GT File Stripped and adjusted to work with this mod - */ -public class BW_OreLayer extends GT_Worldgen { - public static final List sList = new ArrayList<>(); - private static final boolean logOregenRoss128 = false; - public static int sWeight; - public byte bwOres; - public int mMinY, mWeight, mDensity, mSize, mMaxY, mPrimaryMeta, mSecondaryMeta, mBetweenMeta, mSporadicMeta; - - public BW_OreLayer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { - super(aName, BW_OreLayer.sList, aDefault); - this.mMinY = (short) aMinY; - this.mMaxY = (short) aMaxY; - this.mWeight = (short) aWeight; - this.mDensity = (short) aDensity; - this.mSize = (short) Math.max(1, aSize); - - if (this.mEnabled) - BW_OreLayer.sWeight += this.mWeight; - - if (top instanceof Werkstoff) - this.bwOres = (byte) (this.bwOres | 0b1000); - if (bottom instanceof Werkstoff) - this.bwOres = (byte) (this.bwOres | 0b0100); - if (between instanceof Werkstoff) - this.bwOres = (byte) (this.bwOres | 0b0010); - if (sprinkled instanceof Werkstoff) - this.bwOres = (byte) (this.bwOres | 0b0001); - - short aPrimary = top instanceof Materials ? - (short) ((Materials) top).mMetaItemSubID : - top instanceof Werkstoff ? - ((Werkstoff) top).getmID() : - 0; - short aSecondary = bottom instanceof Materials ? - (short) ((Materials) bottom).mMetaItemSubID : - bottom instanceof Werkstoff ? - ((Werkstoff) bottom).getmID() : - 0; - short aBetween = between instanceof Materials ? - (short) ((Materials) between).mMetaItemSubID : - between instanceof Werkstoff ? - ((Werkstoff) between).getmID() : - 0; - short aSporadic = sprinkled instanceof Materials ? - (short) ((Materials) sprinkled).mMetaItemSubID : - sprinkled instanceof Werkstoff ? - ((Werkstoff) sprinkled).getmID() : - 0; - this.mPrimaryMeta = aPrimary; - this.mSecondaryMeta = aSecondary; - this.mBetweenMeta = aBetween; - this.mSporadicMeta = aSporadic; - - } - - @Override - public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - { - int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); - int cX = aChunkX - aRandom.nextInt(this.mSize); - int eX = aChunkX + 16 + aRandom.nextInt(this.mSize); - - for (int tX = cX; tX <= eX; ++tX) { - int cZ = aChunkZ - aRandom.nextInt(this.mSize); - int eZ = aChunkZ + 16 + aRandom.nextInt(this.mSize); - - for (int tZ = cZ; tZ <= eZ; ++tZ) { - int i; - if (this.mSecondaryMeta > 0) { - for (i = tMinY - 1; i < tMinY + 2; ++i) { - if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { - this.setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false); - } - } - } - - if (this.mBetweenMeta > 0 && (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) { - this.setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); - } - - if (this.mPrimaryMeta > 0) { - for (i = tMinY + 3; i < tMinY + 6; ++i) { - if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { - this.setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false); - } - } - } - - if (this.mSporadicMeta > 0 && (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) { - this.setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); - } - } - } - - if (BW_OreLayer.logOregenRoss128) { - MainMod.LOGGER.info("Generated Orevein: " + this.mWorldGenName + " " + aChunkX + " " + aChunkZ); - } - - return true; - } - } - - public boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre) { - if ((aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0) || (aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0) || (aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0) || (aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0)) { - return BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false); - } - return GT_TileEntity_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, isSmallOre, false); - } -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java deleted file mode 100644 index 36e017d626..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WordGenerator.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen; - - -import cpw.mods.fml.common.IWorldGenerator; -import gregtech.api.objects.XSTR; -import gregtech.api.util.GT_Log; -import gregtech.api.world.GT_Worldgen; -import net.minecraft.world.ChunkCoordIntPair; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.chunk.IChunkProvider; - -import java.util.HashSet; -import java.util.Random; - -/** - * Original GT File Stripped and adjusted to work with this mod - */ -public class BW_WordGenerator implements IWorldGenerator { - - public BW_WordGenerator() { - //GT_NH Override... wont be actually registered to force its generation directly in the ChunkProvider - //GameRegistry.registerWorldGenerator(this, 1073741823); - } - - public synchronized void generate(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - new BW_WordGenerator.WorldGenContainer(aX * 16, aZ * 16, aWorld.provider.dimensionId, aWorld, aChunkGenerator, aChunkProvider).run(); - } - - public static class WorldGenContainer implements Runnable { - public static HashSet mGenerated = new HashSet<>(2000); - public final int mDimensionType; - public final World mWorld; - public final IChunkProvider mChunkGenerator; - public final IChunkProvider mChunkProvider; - public int mX; - public int mZ; - - public WorldGenContainer(int aX, int aZ, int aDimensionType, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - this.mX = aX; - this.mZ = aZ; - this.mDimensionType = aDimensionType; - this.mWorld = aWorld; - this.mChunkGenerator = aChunkGenerator; - this.mChunkProvider = aChunkProvider; - } - - //returns a coordinate of a center chunk of 3x3 square; the argument belongs to this square - public int getVeinCenterCoordinate(int c) { - c += c < 0 ? 1 : 3; - return c - c % 3 - 2; - } - - public boolean surroundingChunksLoaded(int xCenter, int zCenter) { - return this.mWorld.checkChunksExist(xCenter - 16, 0, zCenter - 16, xCenter + 16, 0, zCenter + 16); - } - - public XSTR getRandom(int xChunk, int zChunk) { - long worldSeed = this.mWorld.getSeed(); - XSTR fmlRandom = new XSTR(worldSeed); - long xSeed = fmlRandom.nextLong() >> 2 + 1L; - long zSeed = fmlRandom.nextLong() >> 2 + 1L; - long chunkSeed = (xSeed * xChunk + zSeed * zChunk) ^ worldSeed; - fmlRandom.setSeed(chunkSeed); - return new XSTR(fmlRandom.nextInt()); - } - - public void run() { - int xCenter = this.getVeinCenterCoordinate(this.mX >> 4); - int zCenter = this.getVeinCenterCoordinate(this.mZ >> 4); - Random random = this.getRandom(xCenter, zCenter); - xCenter <<= 4; - zCenter <<= 4; - ChunkCoordIntPair centerChunk = new ChunkCoordIntPair(xCenter, zCenter); - if (!BW_WordGenerator.WorldGenContainer.mGenerated.contains(centerChunk) && this.surroundingChunksLoaded(xCenter, zCenter)) { - BW_WordGenerator.WorldGenContainer.mGenerated.add(centerChunk); - if ((BW_OreLayer.sWeight > 0) && (BW_OreLayer.sList.size() > 0)) { - boolean temp = true; - int tRandomWeight; - for (int i = 0; (i < 256) && (temp); i++) { - tRandomWeight = random.nextInt(BW_OreLayer.sWeight); - for (BW_OreLayer tWorldGen : BW_OreLayer.sList) { - tRandomWeight -= tWorldGen.mWeight; - if (tRandomWeight <= 0) { - try { - if (tWorldGen.executeWorldgen(this.mWorld, random, "", this.mDimensionType, xCenter, zCenter, this.mChunkGenerator, this.mChunkProvider)) { - temp = false; - } - break; - } catch (Throwable e) { - e.printStackTrace(GT_Log.err); - } - } - } - } - } - } - Chunk tChunk = this.mWorld.getChunkFromBlockCoords(this.mX, this.mZ); - if (tChunk != null) { - tChunk.isModified = true; - } - } - } -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java deleted file mode 100644 index 46a5fd07e2..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/oregen/BW_WorldGenRoss128.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen; - -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import gregtech.api.enums.Materials; -import gregtech.api.interfaces.ISubTagContainer; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidRegistry; - -import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; - - -public class BW_WorldGenRoss128 extends BW_OreLayer { - - - public BW_WorldGenRoss128(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { - super(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, top, bottom, between, sprinkled); - } - - public static void init_OresRoss128() { - new BW_WorldGenRoss128("ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, WerkstoffLoader.Thorianit, Materials.Uraninite, Materials.Lepidolite, Materials.Spodumene); - new BW_WorldGenRoss128("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Materials.Graphite, Materials.Diamond, Materials.Coal, Materials.Graphite); - new BW_WorldGenRoss128("ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, WerkstoffLoader.Bismuthinit, Materials.Stibnite, Materials.Bismuth, WerkstoffLoader.Bismutite); - new BW_WorldGenRoss128("ore.mix.ross128.TurmalinAlkali", true, 5, 200, 15, 4, 48, WerkstoffLoader.Olenit, WerkstoffLoader.FluorBuergerit, WerkstoffLoader.ChromoAluminoPovondrait, WerkstoffLoader.VanadioOxyDravit); - new BW_WorldGenRoss128("ore.mix.ross128.Roquesit", true, 5, 250, 3, 1, 12, WerkstoffLoader.Arsenopyrite, WerkstoffLoader.Ferberite, WerkstoffLoader.Loellingit, WerkstoffLoader.Roquesit); - new BW_WorldGenRoss128("ore.mix.ross128.Tungstate", true, 5, 250, 10, 4, 14, WerkstoffLoader.Ferberite, WerkstoffLoader.Huebnerit, WerkstoffLoader.Loellingit, Materials.Scheelite); - new BW_WorldGenRoss128("ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, WerkstoffLoader.Djurleit, WerkstoffLoader.Bornite, WerkstoffLoader.Wittichenit, Materials.Tetrahedrite); - new BW_WorldGenRoss128("ore.mix.ross128.Forsterit", true, 20, 180, 50, 2, 32, WerkstoffLoader.Forsterit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescloiziteCUVO4, WerkstoffLoader.DescloiziteZNVO4); - new BW_WorldGenRoss128("ore.mix.ross128.Hedenbergit", true, 20, 180, 50, 2, 32, WerkstoffLoader.Hedenbergit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescloiziteCUVO4, WerkstoffLoader.DescloiziteZNVO4); - new BW_WorldGenRoss128("ore.mix.ross128.RedZircon", true, 10, 40, 40, 3, 24, WerkstoffLoader.Fayalit,WerkstoffLoader.FuchsitAL , WerkstoffLoader.RedZircon,WerkstoffLoader.FuchsitCR); - } - - public static void init_undergroundFluidsRoss128() { - String ross128b = StatCollector.translateToLocal("planet.Ross128b"); - uo_dimensionList.SetConfigValues(ross128b, ross128b, "veryheavyoil", "liquid_extra_heavy_oil", 0, 625, 40, 5); - uo_dimensionList.SetConfigValues(ross128b, ross128b, "lava", FluidRegistry.getFluidName(FluidRegistry.LAVA), 0, 32767, 5, 5); - uo_dimensionList.SetConfigValues(ross128b, ross128b, "gas_natural_gas", "gas_natural_gas", 0, 625, 65, 5); - - } - - @Override - public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { - return aWorld.provider.dimensionId == ConfigHandler.ross128ID; - } - -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java deleted file mode 100644 index 956810dd7f..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/ChunkProviderRoss128b.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider; - -import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.oregen.BW_WordGenerator; -import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; -import cpw.mods.fml.common.Loader; -import gregtech.api.objects.XSTR; -import net.minecraft.block.Block; -import net.minecraft.block.BlockFalling; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.chunk.IChunkProvider; -import net.minecraft.world.gen.ChunkProviderGenerate; -import net.minecraft.world.gen.MapGenBase; -import net.minecraft.world.gen.MapGenCaves; -import net.minecraft.world.gen.MapGenRavine; -import net.minecraft.world.gen.feature.WorldGenLakes; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.terraingen.PopulateChunkEvent; -import net.minecraftforge.event.terraingen.TerrainGen; - -import java.util.List; - -import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE; -import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE; - -public class ChunkProviderRoss128b extends ChunkProviderGenerate { - XSTR rand = new XSTR(); - private BiomeGenBase[] biomesForGeneration; - private BW_WordGenerator BWOreGen = new BW_WordGenerator(); - private World worldObj; - private MapGenBase caveGenerator = new MapGenCaves(); - private MapGenBase ravineGenerator = new MapGenRavine(); - - public ChunkProviderRoss128b(World par1World, long seed, boolean mapFeaturesEnabled) { - super(par1World, seed, mapFeaturesEnabled); - worldObj = par1World; - } - - @Override - public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) { - return null; - } - - public Chunk provideChunk(int p_73154_1_, int p_73154_2_) { - this.rand.setSeed((long) p_73154_1_ * 341873128712L + (long) p_73154_2_ * 132897987541L); - Block[] ablock = new Block[65536]; - byte[] abyte = new byte[65536]; - this.func_147424_a(p_73154_1_, p_73154_2_, ablock); - this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); - for (int i = 0; i < biomesForGeneration.length; i++) { - BiomeGenBase biomeGenBase = biomesForGeneration[i]; - if (biomeGenBase.biomeID == BiomeGenBase.mushroomIsland.biomeID) { - this.biomesForGeneration[i] = BiomeGenBase.taiga; - } else if (biomeGenBase.biomeID == BiomeGenBase.mushroomIslandShore.biomeID) { - this.biomesForGeneration[i] = BiomeGenBase.stoneBeach; - } - if (Loader.isModLoaded("Thaumcraft")) { - if (ThaumcraftHandler.isTaintBiome(biomeGenBase.biomeID)) - this.biomesForGeneration[i] = BiomeGenBase.taiga; - } - } - this.replaceBlocksForBiome(p_73154_1_, p_73154_2_, ablock, abyte, this.biomesForGeneration); - this.caveGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); - this.ravineGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); - - Chunk chunk = new Chunk(this.worldObj, ablock, abyte, p_73154_1_, p_73154_2_); - byte[] abyte1 = chunk.getBiomeArray(); - - for (int k = 0; k < abyte1.length; ++k) { - abyte1[k] = (byte) this.biomesForGeneration[k].biomeID; - } - - chunk.generateSkylightMap(); - return chunk; - } - - @Override - public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) { - BlockFalling.fallInstantly = true; - int k = p_73153_2_ * 16; - int l = p_73153_3_ * 16; - BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16); - this.rand.setSeed(this.worldObj.getSeed()); - if (p_73153_2_ % 4 == 0 || p_73153_3_ % 4 == 0) { - long i1 = this.rand.nextLong() / 2L * 2L + 1L; - long j1 = this.rand.nextLong() / 2L * 2L + 1L; - this.rand.setSeed((long) p_73153_2_ * i1 + (long) p_73153_3_ * j1 ^ this.worldObj.getSeed()); - } - boolean flag = false; - - MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag)); - - int k1; - int l1; - int i2; - - if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag && this.rand.nextInt(4) == 0 - && TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, LAKE)) { - k1 = k + this.rand.nextInt(16) + 8; - l1 = this.rand.nextInt(256); - i2 = l + this.rand.nextInt(16) + 8; - (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, k1, l1, i2); - } - - biomegenbase.decorate(this.worldObj, this.rand, k, l); - - k += 8; - l += 8; - - boolean doGen = TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, ICE); - for (k1 = 0; doGen && k1 < 16; ++k1) { - for (l1 = 0; l1 < 16; ++l1) { - i2 = this.worldObj.getPrecipitationHeight(k + k1, l + l1); - - if (this.worldObj.isBlockFreezable(k1 + k, i2 - 1, l1 + l)) { - this.worldObj.setBlock(k1 + k, i2 - 1, l1 + l, Blocks.ice, 0, 2); - } - - if (this.worldObj.func_147478_e(k1 + k, i2, l1 + l, true)) { - this.worldObj.setBlock(k1 + k, i2, l1 + l, Blocks.snow_layer, 0, 2); - } - } - } - MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag)); - - BWOreGen.generate(rand, p_73153_2_, p_73153_3_, worldObj, this, this); - - BlockFalling.fallInstantly = false; - } - - @Override - public void recreateStructures(int p_82695_1_, int p_82695_2_) { - } - - @Override - public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] blocks, byte[] metas, BiomeGenBase[] p_147422_5_) { - super.replaceBlocksForBiome(p_147422_1_, p_147422_2_, blocks, metas, p_147422_5_); - for (int i = 0; i < blocks.length; i++) { -// if (blocks[i] == Blocks.stone) { -// blocks[i] = Ross128.Ross128bStone.getBlock(); -// metas[i] = Ross128.Ross128bStone.getMetadata(); -// }else - if (blocks[i] == Blocks.grass) { - blocks[i] = Blocks.dirt; - metas[i] = 2; - } -// else if (blocks[i] == Blocks.dirt) { -// blocks[i] = Ross128.Ross128bDirt.getBlock(); -// metas[i] = Ross128.Ross128bDirt.getMetadata(); -// } - } - } -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b.java deleted file mode 100644 index c6785ee78b..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/SkyProviderRoss128b.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider; - -import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; -import micdoodle8.mods.galacticraft.core.client.SkyProviderOverworld; -import net.minecraft.util.ResourceLocation; - -public class SkyProviderRoss128b extends SkyProviderOverworld { - - //ASM enables this texture - public static final ResourceLocation sunTex = new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/World/SunRoss128.png"); -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b.java deleted file mode 100644 index 9b2b9fc75a..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128/world/worldprovider/WorldProviderRoss128b.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider; - -import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; -import micdoodle8.mods.galacticraft.api.prefab.world.gen.WorldProviderSpace; -import micdoodle8.mods.galacticraft.api.vector.Vector3; -import micdoodle8.mods.galacticraft.api.world.IExitHeight; -import micdoodle8.mods.galacticraft.api.world.ISolarLevel; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.biome.WorldChunkManager; -import net.minecraft.world.chunk.IChunkProvider; - -public class WorldProviderRoss128b extends WorldProviderSpace implements IExitHeight, ISolarLevel { - - @Override - public boolean canRespawnHere() { - return true; - } - - @SideOnly(Side.CLIENT) - public Vec3 getFogColor(float cy, float noidea) { - float angle = MathHelper.cos(cy * (float) Math.PI * 2.0F) * 2.0F + 0.5F; - - if (angle < 0.0F) { - angle = 0.0F; - } - - if (angle > 1.0F) { - angle = 1.0F; - } - - float red = 200 / 255f; - float green = 80 / 255f; - float blue = 0.0F; - red *= angle * 0.94F + 0.06F; - green *= angle * 0.94F + 0.06F; - return Vec3.createVectorHelper((double) red, (double) green, (double) blue); - } - - - @Override - public Vector3 getFogColor() { - //unused - return null; - } - - @Override - public float getSunBrightness(float par1) { - return super.getSunBrightness(par1) * 0.975f; - } - - @Override - public float calculateCelestialAngle(long par1, float par3) { - return super.calculateCelestialAngle(par1, par3); - } - - @Override - public Vector3 getSkyColor() { - float red = 200 / 255f; - float green = 120 / 255f; - float blue = 0.0F; - return new Vector3(red, green, blue); - } - - @Override - public boolean canRainOrSnow() { - return false; - } - - @Override - public boolean hasSunset() { - return true; - } - - @Override - public long getDayLength() { - return (long) (24000 * 9.9f); - } - - @Override - public Class getChunkProviderClass() { - return ChunkProviderRoss128b.class; - } - - @Override - public Class getWorldChunkManagerClass() { - return WorldChunkManager.class; - } - - @Override - public float getGravity() { - return -0.0035F; - } - - @Override - public double getMeteorFrequency() { - return 0D; - } - - @Override - public double getFuelUsageMultiplier() { - return 1.35D; - } - - @Override - public boolean canSpaceshipTierPass(int tier) { - return Ross128SolarSystem.Ross128b.getTierRequirement() <= tier; - } - - @Override - public float getFallDamageModifier() { - return 1.35F; - } - - @Override - public float getSoundVolReductionAmount() { - return 1F; - } - - @Override - public float getThermalLevelModifier() { - return 0.01f; - } - - @Override - public float getWindLevel() { - return 1.35f; - } - - @Override - public CelestialBody getCelestialBody() { - return Ross128SolarSystem.Ross128b; - } - - @Override - public double getYCoordinateToTeleport() { - return 500D; - } - - @Override - public double getSolarEnergyMultiplier() { - return 1.38D; - } - - @Override - public boolean hasBreathableAtmosphere() { - return true; - } - -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java new file mode 100644 index 0000000000..0e7f7e28d1 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b; + +import com.github.bartimaeusnek.bartworks.system.oregen.BW_WordGenerator; +import com.github.bartimaeusnek.bartworks.system.worldgen.MapGenRuins; +import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; +import cpw.mods.fml.common.Loader; +import gregtech.api.objects.XSTR; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFalling; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderGenerate; +import net.minecraft.world.gen.MapGenBase; +import net.minecraft.world.gen.MapGenCaves; +import net.minecraft.world.gen.MapGenRavine; +import net.minecraft.world.gen.feature.WorldGenLakes; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.PopulateChunkEvent; +import net.minecraftforge.event.terraingen.TerrainGen; + +import java.util.List; + +import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE; +import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE; + +public class ChunkProviderRoss128b extends ChunkProviderGenerate { + XSTR rand = new XSTR(); + private BiomeGenBase[] biomesForGeneration; + private BW_WordGenerator BWOreGen = new BW_WordGenerator(); + private World worldObj; + private MapGenBase caveGenerator = new MapGenCaves(); + private MapGenBase ravineGenerator = new MapGenRavine(); + private MapGenRuins.RuinsBase ruinsBase = new MapGenRuins.RuinsBase(); + + public ChunkProviderRoss128b(World par1World, long seed, boolean mapFeaturesEnabled) { + super(par1World, seed, mapFeaturesEnabled); + worldObj = par1World; + } + + @Override + public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) { + return null; + } + + public Chunk provideChunk(int p_73154_1_, int p_73154_2_) { + this.rand.setSeed((long) p_73154_1_ * 341873128712L + (long) p_73154_2_ * 132897987541L); + Block[] ablock = new Block[65536]; + byte[] abyte = new byte[65536]; + this.func_147424_a(p_73154_1_, p_73154_2_, ablock); + this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); + for (int i = 0; i < biomesForGeneration.length; i++) { + BiomeGenBase biomeGenBase = biomesForGeneration[i]; + if (biomeGenBase.biomeID == BiomeGenBase.mushroomIsland.biomeID) { + this.biomesForGeneration[i] = BiomeGenBase.taiga; + } else if (biomeGenBase.biomeID == BiomeGenBase.mushroomIslandShore.biomeID) { + this.biomesForGeneration[i] = BiomeGenBase.stoneBeach; + } + if (Loader.isModLoaded("Thaumcraft")) { + if (ThaumcraftHandler.isTaintBiome(biomeGenBase.biomeID)) + this.biomesForGeneration[i] = BiomeGenBase.taiga; + } + } + this.replaceBlocksForBiome(p_73154_1_, p_73154_2_, ablock, abyte, this.biomesForGeneration); + this.caveGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); + this.ravineGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); + + Chunk chunk = new Chunk(this.worldObj, ablock, abyte, p_73154_1_, p_73154_2_); + byte[] abyte1 = chunk.getBiomeArray(); + + for (int k = 0; k < abyte1.length; ++k) { + abyte1[k] = (byte) this.biomesForGeneration[k].biomeID; + } + + chunk.generateSkylightMap(); + return chunk; + } + + @Override + public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) { + BlockFalling.fallInstantly = true; + int k = p_73153_2_ * 16; + int l = p_73153_3_ * 16; + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16); + this.rand.setSeed(this.worldObj.getSeed()); + if (p_73153_2_ % 4 == 0 || p_73153_3_ % 4 == 0) { + long i1 = this.rand.nextLong() / 2L * 2L + 1L; + long j1 = this.rand.nextLong() / 2L * 2L + 1L; + this.rand.setSeed((long) p_73153_2_ * i1 + (long) p_73153_3_ * j1 ^ this.worldObj.getSeed()); + } + + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, false)); + + int x1; + int y1; + int z1; + + if (biomegenbase != BiomeGenBase.ocean && biomegenbase != BiomeGenBase.deepOcean && biomegenbase != BiomeGenBase.river && biomegenbase != BiomeGenBase.frozenOcean && biomegenbase != BiomeGenBase.frozenRiver + && this.rand.nextInt(512) == 0) { + x1 = k + this.rand.nextInt(16) + 3; + y1 = this.rand.nextInt(256); + z1 = l + this.rand.nextInt(16) + 3; + ruinsBase.generate(worldObj, rand, x1, y1, z1); + } + + if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && this.rand.nextInt(4) == 0 + && TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, false, LAKE)) { + x1 = k + this.rand.nextInt(16) + 8; + y1 = this.rand.nextInt(256); + z1 = l + this.rand.nextInt(16) + 8; + (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, x1, y1, z1); + } + + biomegenbase.decorate(this.worldObj, this.rand, k, l); + + k += 8; + l += 8; + + boolean doGen = TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, false, ICE); + for (x1 = 0; doGen && x1 < 16; ++x1) { + for (y1 = 0; y1 < 16; ++y1) { + z1 = this.worldObj.getPrecipitationHeight(k + x1, l + y1); + + if (this.worldObj.isBlockFreezable(x1 + k, z1 - 1, y1 + l)) { + this.worldObj.setBlock(x1 + k, z1 - 1, y1 + l, Blocks.ice, 0, 2); + } + + if (this.worldObj.func_147478_e(x1 + k, z1, y1 + l, true)) { + this.worldObj.setBlock(x1 + k, z1, y1 + l, Blocks.snow_layer, 0, 2); + } + } + } + + BWOreGen.generate(rand, p_73153_2_, p_73153_3_, worldObj, this, this); + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, false)); + + BlockFalling.fallInstantly = false; + } + + @Override + public void recreateStructures(int p_82695_1_, int p_82695_2_) { + } + + @Override + public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] blocks, byte[] metas, BiomeGenBase[] p_147422_5_) { + super.replaceBlocksForBiome(p_147422_1_, p_147422_2_, blocks, metas, p_147422_5_); + for (int i = 0; i < blocks.length; i++) { + if (blocks[i] == Blocks.grass) { + blocks[i] = Blocks.dirt; + metas[i] = 2; + } + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java new file mode 100644 index 0000000000..24c8e8573e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b; + +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import micdoodle8.mods.galacticraft.core.client.SkyProviderOverworld; +import net.minecraft.util.ResourceLocation; + +public class SkyProviderRoss128b extends SkyProviderOverworld { + + //ASM enables this texture + public static final ResourceLocation sunTex = new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/World/SunRoss128.png"); +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java new file mode 100644 index 0000000000..40cfbbbca4 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b; + +import com.github.bartimaeusnek.crossmod.galacticraft.planets.AbstractWorldProviderSpace; +import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; +import micdoodle8.mods.galacticraft.api.vector.Vector3; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.IChunkProvider; + +public class WorldProviderRoss128b extends AbstractWorldProviderSpace { + + @Override + public boolean canRespawnHere() { + return true; + } + + @SideOnly(Side.CLIENT) + public Vec3 getFogColor(float cy, float noidea) { + float angle = MathHelper.cos(cy * (float) Math.PI * 2.0F) * 2.0F + 0.5F; + + if (angle < 0.0F) { + angle = 0.0F; + } + + if (angle > 1.0F) { + angle = 1.0F; + } + + float red = 200 / 255f; + float green = 80 / 255f; + float blue = 0.0F; + red *= angle * 0.94F + 0.06F; + green *= angle * 0.94F + 0.06F; + return Vec3.createVectorHelper((double) red, (double) green, (double) blue); + } + + + @Override + public Vector3 getFogColor() { + //unused + return null; + } + + @Override + public float getSunBrightness(float par1) { + return super.getSunBrightness(par1) * 0.975f; + } + + @Override + public float calculateCelestialAngle(long par1, float par3) { + return super.calculateCelestialAngle(par1, par3); + } + + @Override + public Vector3 getSkyColor() { + float red = 200 / 255f; + float green = 120 / 255f; + float blue = 0.0F; + return new Vector3(red, green, blue); + } + + @Override + public long getDayLength() { + return (long) (24000 * 9.9f); + } + + @Override + public Class getChunkProviderClass() { + return ChunkProviderRoss128b.class; + } + + @Override + public Class getWorldChunkManagerClass() { + return WorldChunkManager.class; + } + + @Override + public float getGravity() { + return -0.0035F; + } + + @Override + public double getMeteorFrequency() { + return 0D; + } + + @Override + public double getFuelUsageMultiplier() { + return 1.35D; + } + + @Override + public boolean canSpaceshipTierPass(int tier) { + return Ross128SolarSystem.Ross128b.getTierRequirement() <= tier; + } + + @Override + public float getFallDamageModifier() { + return 1.35F; + } + + @Override + public float getSoundVolReductionAmount() { + return 1F; + } + + @Override + public float getThermalLevelModifier() { + return 0.01f; + } + + @Override + public float getWindLevel() { + return 1.35f; + } + + @Override + public CelestialBody getCelestialBody() { + return Ross128SolarSystem.Ross128b; + } + + @Override + public double getYCoordinateToTeleport() { + return 500D; + } + + @Override + public double getSolarEnergyMultiplier() { + return 1.38D; + } + + @Override + public boolean hasBreathableAtmosphere() { + return true; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java new file mode 100644 index 0000000000..01bb163283 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba; + +import gregtech.api.objects.XSTR; +import micdoodle8.mods.galacticraft.api.prefab.world.gen.MapGenBaseMeta; +import micdoodle8.mods.galacticraft.core.world.gen.BiomeGenBaseMoon; +import micdoodle8.mods.galacticraft.core.world.gen.ChunkProviderMoon; +import micdoodle8.mods.galacticraft.core.world.gen.MapGenCavesMoon; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; + +import java.util.Arrays; + +public class ChunkProviderRoss128ba extends ChunkProviderMoon { + + private XSTR rand = new XSTR(); + private World worldObj; + private BiomeGenBase[] biomesForGeneration; + private MapGenBaseMeta caveGenerator; + + public ChunkProviderRoss128ba(World world, long seed, boolean mapFeaturesEnabled) { + super(world, seed, mapFeaturesEnabled); + this.biomesForGeneration = new BiomeGenBase[]{BiomeGenBaseMoon.moonFlat}; + this.caveGenerator = new MapGenCavesMoon(); + this.worldObj=world; + } + + public Chunk provideChunk(int cx, int cz) { + this.rand.setSeed((long)cx * 341873128712L + (long)cz * 132897987541L); + Block[] ids = new Block[65536]; + byte[] meta = new byte[65536]; + Arrays.fill(ids, Blocks.air); + this.generateTerrain(cx, cz, ids, meta); + this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, cx * 16, cz * 16, 16, 16); + this.createCraters(cx, cz, ids, meta); + this.replaceBlocksForBiome(cx, cz, ids, meta, this.biomesForGeneration); + this.caveGenerator.generate(this, this.worldObj, cx, cz, ids, meta); + Chunk Chunk = new Chunk(this.worldObj, ids, meta, cx, cz); + Chunk.generateSkylightMap(); + return Chunk; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java new file mode 100644 index 0000000000..c28374d2ca --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba; + +import com.github.bartimaeusnek.crossmod.galacticraft.planets.AbstractWorldProviderSpace; +import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; +import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; +import micdoodle8.mods.galacticraft.api.vector.Vector3; +import micdoodle8.mods.galacticraft.core.world.gen.WorldChunkManagerMoon; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.IChunkProvider; + +public class WorldProviderRoss128ba extends AbstractWorldProviderSpace { + @Override + public Vector3 getFogColor() { + return new Vector3(0,0,0); + } + + @Override + public Vector3 getSkyColor() { + return new Vector3(0,0,0); + } + + @Override + public long getDayLength() { + return (long) Math.floor(24000f*9.9f/100f); + } + @Override + public boolean hasSunset() { + return false; + } + + @Override + public Class getChunkProviderClass() { + return ChunkProviderRoss128ba.class; + } + + @Override + public Class getWorldChunkManagerClass() { + return WorldChunkManagerMoon.class; + } + + @Override + public double getYCoordinateToTeleport() { + return 500; + } + + @Override + public float getGravity() { + return 0.060f; + } + + @Override + public double getMeteorFrequency() { + return 9D; + } + + @Override + public double getFuelUsageMultiplier() { + return 0.7D; + } + + @Override + public boolean canSpaceshipTierPass(int i) { + return i >= Ross128SolarSystem.Ross128ba.getTierRequirement(); + } + + @Override + public float getFallDamageModifier() { + return 0.2f; + } + + @Override + public float getSoundVolReductionAmount() { + return 20f; + } + + @Override + public float getThermalLevelModifier() { + return 0; + } + + @Override + public float getWindLevel() { + return 0; + } + + @Override + public CelestialBody getCelestialBody() { + return Ross128SolarSystem.Ross128ba; + } + + @Override + public double getSolarEnergyMultiplier() { + return 1.9D; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index ba2ac7c185..5035090c2e 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -25,7 +25,8 @@ package com.github.bartimaeusnek.crossmod.galacticraft.solarsystems; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128.world.worldprovider.WorldProviderRoss128b; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.WorldProviderRoss128b; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba.WorldProviderRoss128ba; import cpw.mods.fml.common.Loader; import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; import micdoodle8.mods.galacticraft.api.galaxies.*; @@ -47,8 +48,6 @@ public class Ross128SolarSystem { public static void init() { -// Ross128bBlocks = new UniversalSpaceBlocks("Ross128bBlocks",new String[]{BartWorksCrossmod.MOD_ID+":Ross128bStone",BartWorksCrossmod.MOD_ID+":Ross128bDirt",BartWorksCrossmod.MOD_ID+":Ross128bGrass"}); - Ross128SolarSystem.Ross128System = new SolarSystem("Ross128System", "milkyWay").setMapPosition(new Vector3(-1.0D, 1.3D, 0.0D)); Ross128SolarSystem.Ross128 = (Star) new Star("Ross128").setParentSolarSystem(Ross128SolarSystem.Ross128System).setTierRequired(-1); Ross128SolarSystem.Ross128.setUnreachable(); @@ -62,24 +61,22 @@ public class Ross128SolarSystem { Ross128SolarSystem.Ross128b.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(0.75F, 1.75F)); Ross128SolarSystem.Ross128b.setRelativeOrbitTime(0.65F); Ross128SolarSystem.Ross128b.atmosphere.addAll(Arrays.asList(IAtmosphericGas.OXYGEN, IAtmosphericGas.NITROGEN, IAtmosphericGas.ARGON)); - Ross128SolarSystem.Ross128b.setDimensionInfo(ConfigHandler.ross128ID, WorldProviderRoss128b.class); + Ross128SolarSystem.Ross128b.setDimensionInfo(ConfigHandler.ross128BID, WorldProviderRoss128b.class); Ross128SolarSystem.Ross128b.setTierRequired(Loader.isModLoaded("galaxyspace") ? 4 : Loader.isModLoaded("GalacticraftMars") ? 3 : -1); Ross128SolarSystem.Ross128ba = new Moon("Ross128ba").setParentPlanet(Ross128SolarSystem.Ross128b); Ross128SolarSystem.Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)).setRelativeOrbitTime(1 / 0.01F); Ross128SolarSystem.Ross128ba.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); - Ross128SolarSystem.Ross128ba.setUnreachable(); //for now + Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128ba.class); + Ross128SolarSystem.Ross128ba.setTierRequired(Loader.isModLoaded("galaxyspace") ? 5 : Loader.isModLoaded("GalacticraftMars") ? 3 : -1); -// GameRegistry.registerBlock(Ross128bBlocks,Ross128bBlocks.getUnlocalizedName()); -// -// Ross128bStone=new BlockMetaPair(Ross128bBlocks, (byte) 0); -// Ross128bDirt=new BlockMetaPair(Ross128bBlocks, (byte) 1); -// Ross128bGrass=new BlockMetaPair(Ross128bBlocks, (byte) 2); + Ross128SolarSystem.Ross128ba.setUnreachable(); GalaxyRegistry.registerPlanet(Ross128SolarSystem.Ross128b); GalaxyRegistry.registerMoon(Ross128SolarSystem.Ross128ba); GalaxyRegistry.registerSolarSystem(Ross128SolarSystem.Ross128System); GalacticraftRegistry.registerTeleportType(WorldProviderRoss128b.class, new UniversalTeleportType()); + GalacticraftRegistry.registerTeleportType(WorldProviderRoss128ba.class, new UniversalTeleportType()); } } diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index e2df35928f..d035c87472 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -148,7 +148,7 @@ tooltip.tile.htr.0.name=Controller Block for the Thorium High Temperature Reacto item.TRISOPellet.name=TRISO pebble item.TRISOPelletBall.name=TRISO pebble ball item.BISOPelletBall.name=BISO pebble ball -item.BISOPellet.name=BRISO pebble +item.BISOPellet.name=BISO pebble item.TRISOPelletCompound.name=TRISO pebble compund item.BISOPelletCompound.name=BISO pebble compund itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials -- cgit From c0479821d3d5ba619e2221248972551b322d75c4 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 16 Apr 2019 00:39:50 +0200 Subject: should fix https://github.com/bartimaeusnek/bartworks/issues/23 +version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 3031b2a5e52eb5d83b16ea3ad702289c6a5d7933 --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/build.properties b/build.properties index ae7c150099..3aa71fe6c6 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=8 +buildNumber=9 APIVersion=6 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 6676b242aa..cce52a223d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -23,12 +23,11 @@ package com.github.bartimaeusnek.bartworks.common.configs; -import com.github.bartimaeusnek.ASM.BWCoreTransformer; -import gregtech.api.enums.GT_Values; +import com.github.bartimaeusnek.ASM.BWCoreTransformer;; import net.minecraftforge.common.config.Configuration; public class ConfigHandler { - private static final int IDU = GT_Values.VN.length * 8 + 1; + private static final int IDU = 10 * 8 + 5; public static int IDOffset = 12600; public static boolean teslastaff; public static long energyPerCell = 1000000L; -- cgit From 68af9d08a6acebf79c1d338629ac27f914b9f810 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 16 Apr 2019 13:55:36 +0200 Subject: fixes https://github.com/bartimaeusnek/bartworks/issues/27 (#28) Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 92cbb7880fcee5920d5180b02ab99866131dba21 --- .gitignore | 1 + .../bartimaeusnek/ASM/BWCoreTransformer.java | 23 +++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 2963c6d257..4d4c2b25eb 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ *.bin *.lock *.sqlite +/old # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index e56fd65c51..c40faa0c98 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -23,7 +23,6 @@ package com.github.bartimaeusnek.ASM; import net.minecraft.launchwrapper.IClassTransformer; -import org.apache.commons.lang3.ArrayUtils; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.tree.*; @@ -42,11 +41,29 @@ public class BWCoreTransformer implements IClassTransformer { public static final String[] CLASSESBEEINGTRANSFORMED = { "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", - //"micdoodle8.mods.galacticraft.core.client.SkyProviderOverworld", "net.minecraft.client.renderer.RenderGlobal", }; public static boolean obfs = false; - public static boolean[] shouldTransform = ArrayUtils.toPrimitive(new Boolean[BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length], true); + + public static boolean[] shouldTransform = new boolean[CLASSESBEEINGTRANSFORMED.length]; + + static { + //hacky way to detect if the mods are loaded + try{ + Class.forName("com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime"); + shouldTransform[0] = true; + shouldTransform[1] = true; + }catch (ClassNotFoundException e){ + shouldTransform[0] = false; + shouldTransform[1] = false; + } + try{ + Class.forName("micdoodle8.mods.galacticraft.core.client.SkyProviderOverworld"); + shouldTransform[2] = true; + }catch (ClassNotFoundException e){ + shouldTransform[2] = false; + } + } public static byte[] transform(int id, byte[] basicClass) { if (!BWCoreTransformer.shouldTransform[id]) { -- cgit From 4c965eba82e0233dfa0844d4c513c30aefbbea85 Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Sat, 20 Apr 2019 00:51:04 +0800 Subject: fix a simple bug that i have never mind Former-commit-id: 5bc7f975113e64b53b3e169ba51d8d0f120cabf5 --- src/main/resources/assets/bartworks/lang/zh_CN.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index bd6200e2bb..6d5572f073 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -144,7 +144,7 @@ tile.radiohatch.name=放射仓 tile.bw.windmill.name=风车 tile.manutrafo.name=手动变压器 -tooltip.tile.htr.0.name=高温钍反应堆的控制器方块;大小(宽x高x长): 9x12x9 (中空);角落和两个相邻的方块是空气;一旦搭建,需要在输入仓中输入氦气,直到它不再接受;1+输出仓(任意底部机械方块);1+输入仓(任意顶部机械方块);1+输入总线(任意顶部机械方块);1x维护仓(任意机械方块);其余的为辐射防护机械方块;需要持续供应冷却液或将关机;需要至少100k燃料卵石才能开始工作(最多可使用675k个卵石);每次操作消耗1个燃料颗粒;TRISO卵石将提供30%的额外能量;每个卵石都会增加转换冷却剂的需求数量;一次工作耗时27个游戏天数 +tooltip.tile.htr.0.name=高温钍反应堆的控制器方块;大小(宽x高x长):9x12x9(中空);角落和两个相邻的方块是空气;一旦搭建完成,需要在输入仓中输入氦气直到不再接受;1+输出仓(任意底部机械方块);1+输入仓(任意顶部机械方块);1+输入总线(任意顶部机械方块);1x维护仓(任意机械方块);其余的为辐射防护机械方块;需要持续供应冷却液否则将灰关机;需要至少100k卵石燃料才能开始工作(最多可使用675k个卵石);每次操作消耗1个燃料颗粒;TRISO卵石将提供30%的额外能量;每个卵石都会增加转换冷却剂的需求数量;一次工作耗时27个游戏日 item.TRISOPellet.name=TRISO卵石 item.TRISOPelletBall.name=TRISO卵石球 item.BISOPelletBall.name=BISO卵石球 @@ -157,4 +157,4 @@ planet.Ross128b=罗斯128b moon.Ross128ba=罗斯128ba star.Ross128=罗斯128 solarsystem.Ross128System=罗斯128-行星系 -//This zh_CN.lang is translation by huajijam for bartworks (15/4/19) \ No newline at end of file +//This zh_CN.lang is translated by huajijam for bartworks (15/4/19) \ No newline at end of file -- cgit From 8bb053d5db221a57cd840ce7aedc2f05c88b4a3e Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 19 Apr 2019 19:52:46 +0200 Subject: fixes +this time really fixed (#27) +added small rocket gui stuff +fixed a bug where the moon of ross128b would cause issues with the dim handler +added Electric Implosion Compressor recipe and tooltip +fixed Electric Implosion Compressor recipe "Map" Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: aeee7f250bedb4ea9b5fb2e4656ea01be48211e3 --- .../com/github/bartimaeusnek/ASM/BWCorePlugin.java | 2 + .../bartimaeusnek/ASM/BWCoreTransformer.java | 4 +- .../github/bartimaeusnek/bartworks/MainMod.java | 86 +++++++++------ .../bartworks/common/loaders/ItemRegistry.java | 5 +- .../bartworks/common/loaders/RecipeLoader.java | 21 +++- .../GT_TileEntity_ElectricImplosionCompressor.java | 12 ++- .../tileentities/multis/GT_TileEntity_THTR.java | 2 +- .../system/material/BW_MetaGenerated_Items.java | 2 - .../bartworks/system/oregen/BW_OreLayer.java | 3 - .../system/oregen/BW_WorldGenRoss128b.java | 1 - .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 12 ++- .../crossmod/galacticraft/GalacticraftProxy.java | 21 ++++ .../planets/AbstractWorldProviderSpace.java | 5 + .../planets/ross128b/SkyProviderRoss128b.java | 4 +- .../planets/ross128ba/WorldProviderRoss128Ba.java | 117 +++++++++++++++++++++ .../planets/ross128ba/WorldProviderRoss128ba.java | 117 --------------------- .../solarsystems/Ross128SolarSystem.java | 11 +- .../resources/assets/bartworks/lang/en_US.lang | 3 + 18 files changed, 261 insertions(+), 167 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java index 2093b6a092..64206d5e56 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java @@ -47,6 +47,8 @@ public class BWCorePlugin implements IFMLLoadingPlugin { minecraftDir = (File) FMLInjectionData.data()[6]; //do all the configuration already now... new ConfigHandler(new Configuration(new File(new File(minecraftDir, "config"), "bartworks.cfg"))); + //config Override if mods are missing. + new BWCoreTransformer().checkForMods(); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index c40faa0c98..b9b823bb89 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -47,7 +47,7 @@ public class BWCoreTransformer implements IClassTransformer { public static boolean[] shouldTransform = new boolean[CLASSESBEEINGTRANSFORMED.length]; - static { + public void checkForMods() { //hacky way to detect if the mods are loaded try{ Class.forName("com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime"); @@ -58,7 +58,7 @@ public class BWCoreTransformer implements IClassTransformer { shouldTransform[1] = false; } try{ - Class.forName("micdoodle8.mods.galacticraft.core.client.SkyProviderOverworld"); + Class.forName("micdoodle8.mods.galacticraft.core.Constants"); shouldTransform[2] = true; }catch (ClassNotFoundException e){ shouldTransform[2] = false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 99ac6fda7e..522943fba4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -35,34 +35,46 @@ import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader; import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartedEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; +import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.SubTag; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.IOException; +import java.util.HashSet; + +import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; @Mod( modid = MainMod.MOD_ID, name = MainMod.NAME, version = MainMod.VERSION, dependencies = "required-after:IC2; " + "required-after:gregtech; " - + "after:berriespp;" -) + + "after:berriespp; " + + "after:GalacticraftMars; " + + "after:GalacticraftCore; " + ) public final class MainMod { public static final String NAME = "BartWorks"; public static final String VERSION = "@version@"; @@ -80,12 +92,14 @@ public final class MainMod { @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { - //fixing BorosilicateGlass... -_-' - Materials.BorosilicateGlass.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); + if (!(API_REFERENCE.VERSION.equals(APIVERSION))) { LOGGER.error("Something has loaded an old API. Please contact the Mod authors to update!"); } + //fixing BorosilicateGlass... -_-' + Materials.BorosilicateGlass.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); + if (Loader.isModLoaded("dreamcraft")) { ConfigHandler.GTNH = true; } @@ -138,31 +152,43 @@ public final class MainMod { else WerkstoffLoader.INSTANCE.run(); } - ConfigHandler.setUpComments(); } -// @Mod.EventHandler -// public void onServerStarted(FMLServerStartedEvent event) { -// eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); -// for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList) { -// if (recipe == null || recipe.mInputs == null) -// continue; -// ItemStack input = recipe.mInputs[0]; -// int i = 0; -// while (checkForExplosives(input)) { -// try { -// i++; -// input = recipe.mInputs[i]; -// } catch (ArrayIndexOutOfBoundsException e) { -// LOGGER.error("CAUGHT DEFECTIVE IMPLOSION COMPRESSOR RECIPE."); -// e.printStackTrace(); -// } -// } -// eicMap.addRecipe(true, new ItemStack[]{input}, recipe.mOutputs, null, null, null, recipe.mDuration, BW_Util.getMachineVoltageFromTier(10), 0); -// } -// } -// -// private boolean checkForExplosives(ItemStack input) { -// return (GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L)) || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); -// } + @Mod.EventHandler + public void onServerStarted(FMLServerStartedEvent event) { + eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); + recipeLoop: + for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList) { + if (recipe == null || recipe.mInputs == null) + continue; + try { + ItemStack input = recipe.mInputs[0]; + int i = 0; + float durMod = 0; + if (checkForExplosives(recipe.mInputs[1])) { + if (GT_Utility.areStacksEqual(recipe.mInputs[1], GT_ModHandler.getIC2Item("industrialTnt", 1L))) + durMod += ((float) input.stackSize * 2f); + else + continue recipeLoop; + } + while (checkForExplosives(input)) { + if (GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L))) + durMod += ((float) input.stackSize * 2f); + else + continue recipeLoop; + i++; + input = recipe.mInputs[i]; + } + + eicMap.addRecipe(true, new ItemStack[]{input}, recipe.mOutputs, null, null, null, (int)Math.floor(Math.max((float)recipe.mDuration*durMod,20f)), BW_Util.getMachineVoltageFromTier(10), 0); + } catch (ArrayIndexOutOfBoundsException e) { + LOGGER.error("CAUGHT DEFECTIVE IMPLOSION COMPRESSOR RECIPE!"); + e.printStackTrace(); + } + } + } + + private boolean checkForExplosives(ItemStack input) { + return (GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L)) || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index ca12a39636..e5db33bc5c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -122,7 +122,7 @@ public class ItemRegistry { }, BWT), }; - public static ItemStack dehp; + public static ItemStack[] diode2A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] diode4A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] diode8A = new ItemStack[GT_Values.VN.length]; @@ -131,11 +131,14 @@ public class ItemRegistry { public static ItemStack[] energyDistributor = new ItemStack[GT_Values.VN.length]; public static ItemStack[] acidGens = new ItemStack[3]; public static ItemStack[] megaMachines = new ItemStack[2]; + public static ItemStack dehp; public static ItemStack thtr; + public static ItemStack eic; public static void run() { if (newStuff) { + eic=new GT_TileEntity_ElectricImplosionCompressor(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6,"ElectricImplosionCompressor","Electric Implosion Compressor").getStackForm(1L); thtr=new GT_TileEntity_THTR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5,"THTR","Thorium High Temperature Reactor").getStackForm(1L); GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials(); GameRegistry.registerBlock(ItemRegistry.bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 9c958e25fa..ffcddc4706 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -739,8 +739,27 @@ public class RecipeLoader implements Runnable { 'R',GT_ModHandler.getModItem("IC2","blockGenerator",1,5), 'Z',"circuitUltimate" } - ); + ); + GT_Values.RA.addAssemblylineRecipe( + ItemList.Machine_Multi_ImplosionCompressor.get(1L),24000, + new ItemStack[]{ + ItemList.Machine_Multi_ImplosionCompressor.get(1L), + Materials.Neutronium.getBlocks(5), + GT_OreDictUnificator.get(OrePrefixes.stickLong,Materials.Osmium,64), + GT_OreDictUnificator.get(OrePrefixes.ring,Materials.Osmium,64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01,Materials.Superconductor,64), + ItemList.Electric_Piston_UV.get(64), + }, + new FluidStack[]{ + Materials.SolderingAlloy.getMolten(1440), + Materials.Osmium.getMolten(1440), + Materials.Neutronium.getMolten(1440) + }, + ItemRegistry.eic.copy(), + 240000, + BW_Util.getMachineVoltageFromTier(8) + ); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 74efa145e5..cd45301d4f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -32,6 +33,7 @@ import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ImplosionCo import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -186,7 +188,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity IGregTechTileEntity te = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, z + zDir); if (y == -2 || y == 6) { if (!(x == 0 && z == 0)) { - if (!this.addMaintenanceToMachineList(te, 16) && !this.addMufflerToMachineList(te, 16) && !this.addInputToMachineList(te, 16) && !this.addOutputToMachineList(te, 16)) { + if (!this.addMaintenanceToMachineList(te, 16) && !this.addInputToMachineList(te, 16) && !this.addOutputToMachineList(te, 16)) { Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z); byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); if ((tBlock != GregTech_API.sBlockCasings2 || tMeta != 0) && (tBlock != GregTech_API.sBlockCasings3 || tMeta != 4)) { @@ -248,6 +250,12 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity @Override public String[] getDescription() { - return new String[0]; + String[] dsc = StatCollector.translateToLocal("tooltip.tile.eic.0.name").split(";"); + String[] mDescription = new String[dsc.length + 1]; + for (int i = 0; i < dsc.length; i++) { + mDescription[i] = dsc[i]; + mDescription[dsc.length] = StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; + } + return mDescription; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index b21e97aead..501069b25d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -176,7 +176,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { // 0.01f, // ExplosionIC2.Type.Nuclear // ).doExplosion(); - return false; + toProduce=accessibleCoolant; } accessibleCoolant=toProduce; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index d50081c9e9..f77c8ea745 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -23,7 +23,6 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import cpw.mods.fml.common.Loader; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Materials; @@ -42,7 +41,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; -import net.minecraftforge.oredict.OreDictionary; import java.util.List; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java index 92f42ad9e0..d5d13aea13 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java @@ -23,15 +23,12 @@ package com.github.bartimaeusnek.bartworks.system.oregen; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.world.GT_Worldgen; -import gregtech.common.blocks.GT_Block_Ores; import gregtech.common.blocks.GT_TileEntity_Ores; import net.minecraft.block.Block; import net.minecraft.init.Blocks; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index a1535ff8f5..95a69f00b0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -63,7 +63,6 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { uo_dimensionList.SetConfigValues(ross128b, ross128b, "veryheavyoil", "liquid_extra_heavy_oil", 0, 625, 40, 5); uo_dimensionList.SetConfigValues(ross128b, ross128b, "lava", FluidRegistry.getFluidName(FluidRegistry.LAVA), 0, 32767, 5, 5); uo_dimensionList.SetConfigValues(ross128b, ross128b, "gas_natural_gas", "gas_natural_gas", 0, 625, 65, 5); - } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index da78891b8c..65fbb0f6a7 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; import org.apache.logging.log4j.LogManager; @@ -38,7 +39,9 @@ import org.apache.logging.log4j.Logger; dependencies = "required-after:IC2; " + "required-after:gregtech; " + "required-after:bartworks;" - + "after:GalacticraftCore;" + + "after:GalacticraftMars; " + + "after:GalacticraftCore; " + + "after:Micdoodlecore; " ) public class BartWorksCrossmod { public static final String NAME = "BartWorks Mod Additions"; @@ -63,6 +66,13 @@ public class BartWorksCrossmod { GalacticraftProxy.init(init); } + @Mod.EventHandler + public void postInit(FMLPostInitializationEvent init) { + if (Loader.isModLoaded("GalacticraftCore")) + GalacticraftProxy.postInit(init); + } + + @Mod.EventHandler public void onFMLServerStart(FMLServerStartingEvent event) { event.registerServerCommand(new SummonRuin()); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java index a8c9a218b1..2c126759b8 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import gregtech.api.objects.GT_UO_DimensionList; import net.minecraftforge.common.config.Configuration; @@ -41,6 +42,15 @@ public class GalacticraftProxy { private GalacticraftProxy() { } + public static void postInit(FMLPostInitializationEvent e){ + if (FMLCommonHandler.instance().getSide().isServer() || FMLCommonHandler.instance().getEffectiveSide().isServer()) { + GalacticraftProxy.serverPostInit(e); + } else { + GalacticraftProxy.clientPostInit(e); + } + GalacticraftProxy.commonPostInit(e); + } + public static void preInit(FMLPreInitializationEvent e) { if (FMLCommonHandler.instance().getSide().isServer() || FMLCommonHandler.instance().getEffectiveSide().isServer()) { GalacticraftProxy.serverpreInit(e); @@ -87,4 +97,15 @@ public class GalacticraftProxy { if (ConfigHandler.Ross128Enabled) Ross128SolarSystem.init(); } + private static void serverPostInit(FMLPostInitializationEvent e) { + + } + + private static void clientPostInit(FMLPostInitializationEvent e) { + + } + + private static void commonPostInit(FMLPostInitializationEvent e) { + + } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java index c3b87bf15c..988920cae6 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java @@ -32,6 +32,11 @@ public abstract class AbstractWorldProviderSpace extends WorldProviderSpace impl return false; } + @Override + public String getDimensionName() { + return this.getCelestialBody().getLocalizedName(); + } + @Override public boolean hasSunset() { return true; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java index 24c8e8573e..d575bd7dd8 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java @@ -23,11 +23,9 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; -import micdoodle8.mods.galacticraft.core.client.SkyProviderOverworld; import net.minecraft.util.ResourceLocation; -public class SkyProviderRoss128b extends SkyProviderOverworld { - +public class SkyProviderRoss128b { //ASM enables this texture public static final ResourceLocation sunTex = new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/World/SunRoss128.png"); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java new file mode 100644 index 0000000000..eeb306018c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba; + +import com.github.bartimaeusnek.crossmod.galacticraft.planets.AbstractWorldProviderSpace; +import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; +import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; +import micdoodle8.mods.galacticraft.api.vector.Vector3; +import micdoodle8.mods.galacticraft.core.world.gen.WorldChunkManagerMoon; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.IChunkProvider; + +public class WorldProviderRoss128Ba extends AbstractWorldProviderSpace { + @Override + public Vector3 getFogColor() { + return new Vector3(0,0,0); + } + + @Override + public Vector3 getSkyColor() { + return new Vector3(0,0,0); + } + + @Override + public long getDayLength() { + return (long) Math.floor(24000f*9.9f/100f); + } + @Override + public boolean hasSunset() { + return false; + } + + @Override + public Class getChunkProviderClass() { + return ChunkProviderRoss128ba.class; + } + + @Override + public Class getWorldChunkManagerClass() { + return WorldChunkManagerMoon.class; + } + + @Override + public double getYCoordinateToTeleport() { + return 500; + } + + @Override + public float getGravity() { + return 0.060f; + } + + @Override + public double getMeteorFrequency() { + return 9D; + } + + @Override + public double getFuelUsageMultiplier() { + return 0.7D; + } + + @Override + public boolean canSpaceshipTierPass(int i) { + return i >= Ross128SolarSystem.Ross128ba.getTierRequirement(); + } + + @Override + public float getFallDamageModifier() { + return 0.2f; + } + + @Override + public float getSoundVolReductionAmount() { + return 20f; + } + + @Override + public float getThermalLevelModifier() { + return 0; + } + + @Override + public float getWindLevel() { + return 0; + } + + @Override + public CelestialBody getCelestialBody() { + return Ross128SolarSystem.Ross128ba; + } + + @Override + public double getSolarEnergyMultiplier() { + return 1.9D; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java deleted file mode 100644 index c28374d2ca..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba; - -import com.github.bartimaeusnek.crossmod.galacticraft.planets.AbstractWorldProviderSpace; -import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; -import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; -import micdoodle8.mods.galacticraft.api.vector.Vector3; -import micdoodle8.mods.galacticraft.core.world.gen.WorldChunkManagerMoon; -import net.minecraft.world.biome.WorldChunkManager; -import net.minecraft.world.chunk.IChunkProvider; - -public class WorldProviderRoss128ba extends AbstractWorldProviderSpace { - @Override - public Vector3 getFogColor() { - return new Vector3(0,0,0); - } - - @Override - public Vector3 getSkyColor() { - return new Vector3(0,0,0); - } - - @Override - public long getDayLength() { - return (long) Math.floor(24000f*9.9f/100f); - } - @Override - public boolean hasSunset() { - return false; - } - - @Override - public Class getChunkProviderClass() { - return ChunkProviderRoss128ba.class; - } - - @Override - public Class getWorldChunkManagerClass() { - return WorldChunkManagerMoon.class; - } - - @Override - public double getYCoordinateToTeleport() { - return 500; - } - - @Override - public float getGravity() { - return 0.060f; - } - - @Override - public double getMeteorFrequency() { - return 9D; - } - - @Override - public double getFuelUsageMultiplier() { - return 0.7D; - } - - @Override - public boolean canSpaceshipTierPass(int i) { - return i >= Ross128SolarSystem.Ross128ba.getTierRequirement(); - } - - @Override - public float getFallDamageModifier() { - return 0.2f; - } - - @Override - public float getSoundVolReductionAmount() { - return 20f; - } - - @Override - public float getThermalLevelModifier() { - return 0; - } - - @Override - public float getWindLevel() { - return 0; - } - - @Override - public CelestialBody getCelestialBody() { - return Ross128SolarSystem.Ross128ba; - } - - @Override - public double getSolarEnergyMultiplier() { - return 1.9D; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index 5035090c2e..c69ec74549 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -26,13 +26,16 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.WorldProviderRoss128b; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba.WorldProviderRoss128ba; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba.WorldProviderRoss128Ba; import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.GameRegistry; import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; import micdoodle8.mods.galacticraft.api.galaxies.*; import micdoodle8.mods.galacticraft.api.vector.Vector3; import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; +import micdoodle8.mods.galacticraft.core.GalacticraftCore; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.DimensionManager; import java.util.Arrays; @@ -67,7 +70,7 @@ public class Ross128SolarSystem { Ross128SolarSystem.Ross128ba = new Moon("Ross128ba").setParentPlanet(Ross128SolarSystem.Ross128b); Ross128SolarSystem.Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)).setRelativeOrbitTime(1 / 0.01F); Ross128SolarSystem.Ross128ba.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); - Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128ba.class); +// Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128Ba.class); Ross128SolarSystem.Ross128ba.setTierRequired(Loader.isModLoaded("galaxyspace") ? 5 : Loader.isModLoaded("GalacticraftMars") ? 3 : -1); Ross128SolarSystem.Ross128ba.setUnreachable(); @@ -75,8 +78,10 @@ public class Ross128SolarSystem { GalaxyRegistry.registerPlanet(Ross128SolarSystem.Ross128b); GalaxyRegistry.registerMoon(Ross128SolarSystem.Ross128ba); GalaxyRegistry.registerSolarSystem(Ross128SolarSystem.Ross128System); + GalacticraftRegistry.registerRocketGui(WorldProviderRoss128b.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/overworldRocketGui.png")); +// GalacticraftRegistry.registerRocketGui(WorldProviderRoss128Ba.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/moonRocketGui.png")); GalacticraftRegistry.registerTeleportType(WorldProviderRoss128b.class, new UniversalTeleportType()); - GalacticraftRegistry.registerTeleportType(WorldProviderRoss128ba.class, new UniversalTeleportType()); +// GalacticraftRegistry.registerTeleportType(WorldProviderRoss128Ba.class, new UniversalTeleportType()); } } diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index d035c87472..73a58a4c64 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -153,6 +153,9 @@ item.TRISOPelletCompound.name=TRISO pebble compund item.BISOPelletCompound.name=BISO pebble compund itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials +tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so! + + planet.Ross128b=Ross128b moon.Ross128ba=Ross128ba star.Ross128=Ross128 -- cgit From 59990f3d91daca43b94522dc6a230147c1b82fc6 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 19 Apr 2019 20:08:04 +0200 Subject: moved Ross128 to t3 even with galaxyspace loaded Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 88669e848a7482e79eb6874023bc0eba3214ef4f --- .../crossmod/galacticraft/solarsystems/Ross128SolarSystem.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index c69ec74549..7f9befe058 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -65,13 +65,13 @@ public class Ross128SolarSystem { Ross128SolarSystem.Ross128b.setRelativeOrbitTime(0.65F); Ross128SolarSystem.Ross128b.atmosphere.addAll(Arrays.asList(IAtmosphericGas.OXYGEN, IAtmosphericGas.NITROGEN, IAtmosphericGas.ARGON)); Ross128SolarSystem.Ross128b.setDimensionInfo(ConfigHandler.ross128BID, WorldProviderRoss128b.class); - Ross128SolarSystem.Ross128b.setTierRequired(Loader.isModLoaded("galaxyspace") ? 4 : Loader.isModLoaded("GalacticraftMars") ? 3 : -1); + Ross128SolarSystem.Ross128b.setTierRequired(3); Ross128SolarSystem.Ross128ba = new Moon("Ross128ba").setParentPlanet(Ross128SolarSystem.Ross128b); Ross128SolarSystem.Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)).setRelativeOrbitTime(1 / 0.01F); Ross128SolarSystem.Ross128ba.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); // Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128Ba.class); - Ross128SolarSystem.Ross128ba.setTierRequired(Loader.isModLoaded("galaxyspace") ? 5 : Loader.isModLoaded("GalacticraftMars") ? 3 : -1); + Ross128SolarSystem.Ross128ba.setTierRequired(Loader.isModLoaded("galaxyspace") ? 4 : 3); Ross128SolarSystem.Ross128ba.setUnreachable(); -- cgit From ce7dd84438ca300a61ac01acb6099c4462fc3ec9 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 19 Apr 2019 20:19:11 +0200 Subject: removed sonarqube because of failing builds.. investigation will take place soon Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 782e1c58381b21f3954433c790df2f9b3ca2f046 --- .travis.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 66204e3e0f..0ce2ec14a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,13 +15,13 @@ jdk: - oraclejdk8 jobs: include: - - stage: sonar - addons: - sonarcloud: - organization: "bartimaeusnek-github" - token: - secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" - script: "./gradlew sonarqube" +# - stage: sonar +# addons: +# sonarcloud: +# organization: "bartimaeusnek-github" +# token: +# secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" +# script: "./gradlew sonarqube" - stage: buildAndDeploy script: "./gradlew build" deploy: -- cgit From 0d29c70baf147ca9ea3281b095ffe98558a674f3 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 19 Apr 2019 21:46:22 +0200 Subject: fixes +fixes crash when ExU is installed +version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 09bd3c16b90946f3e737329aafc5d85726a15725 --- build.properties | 2 +- src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.properties b/build.properties index 3aa71fe6c6..bab92f34d6 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=9 +buildNumber=10 APIVersion=6 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index b9b823bb89..41c1164db4 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -50,7 +50,7 @@ public class BWCoreTransformer implements IClassTransformer { public void checkForMods() { //hacky way to detect if the mods are loaded try{ - Class.forName("com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime"); + Class.forName("com.rwtema.extrautils.core.Tuple"); shouldTransform[0] = true; shouldTransform[1] = true; }catch (ClassNotFoundException e){ -- cgit From a80b6ce33747bbf63fb26ccc4ee6252f2ac099c4 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 21 Apr 2019 23:11:49 +0200 Subject: fixes +Optimised BlockChecker +made THTR structure check NOT ignore walls +corrected tooltip on THTR +added Empty mode on THTR +fixed coords hash +started work on OC integration +rewrote blockchecker just to see if a loop would be faster than a recursive check +version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 9cad6f0b7ab2d3fafa413b515baa405c8961cce5 --- build.gradle | 5 +- build.properties | 2 +- .../tileentities/multis/GT_TileEntity_LESU.java | 3 +- .../tileentities/multis/GT_TileEntity_THTR.java | 56 +++++--- .../bartworks/util/ConnectedBlocksChecker.java | 49 +++---- .../util/ConnectedBlocksCheckerIteration.java | 143 +++++++++++++++++++++ .../bartimaeusnek/bartworks/util/Coords.java | 28 ++-- .../crossmod/openComputers/GT_NBT_DataBase.java | 88 +++++++++++++ .../openComputers/TileEntity_GTDataServer.java | 122 ++++++++++++++++++ .../resources/assets/bartworks/lang/en_US.lang | 2 +- 10 files changed, 442 insertions(+), 56 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java diff --git a/build.gradle b/build.gradle index 229a4f71c1..42805998bb 100644 --- a/build.gradle +++ b/build.gradle @@ -86,7 +86,9 @@ repositories { name = "gt" url = "https://gregtech.overminddl1.com/" } - + maven { + url = "http://maven.cil.li/" + } } dependencies { @@ -95,6 +97,7 @@ dependencies { compile "micdoodle8.mods:MicdoodleCore:${config.galacticraft.version}:Dev" compile "micdoodle8.mods:GalacticraftCore:${config.galacticraft.version}:Dev" compile "micdoodle8.mods:Galacticraft-Planets:${config.galacticraft.version}:Dev" + compile "li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api" } //task getGregTech(type: Download) { diff --git a/build.properties b/build.properties index bab92f34d6..9219373f51 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=10 +buildNumber=11 APIVersion=6 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 42eeada394..471373e3dd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -397,8 +397,9 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { this.getBaseMetaTileEntity().setActive(true); long finishedTime = System.nanoTime(); + //System.out.println("LESU LookUp: "+((finishedTime - startingTime) / 1000000)+"ms"); if (finishedTime - startingTime > 5000000) - MainMod.LOGGER.warn("LESU LookUp took longer than 5ms!(" + (finishedTime - startingTime) + "ns / " + ((finishedTime - startingTime) / 1000000) + "ms) Check at x:" + this.getBaseMetaTileEntity().getXCoord() + " y:" + this.getBaseMetaTileEntity().getYCoord() + " z:" + this.getBaseMetaTileEntity().getZCoord() + " DIM-ID: " + this.getBaseMetaTileEntity().getWorld().provider.dimensionId); + MainMod.LOGGER.warn("LESU LookUp took longer than 5ms!(" + (finishedTime - startingTime) + "ns / " + ((finishedTime - startingTime) / 1000000) + "ms) Owner:"+this.getBaseMetaTileEntity().getOwnerName()+" Check at x:" + this.getBaseMetaTileEntity().getXCoord() + " y:" + this.getBaseMetaTileEntity().getYCoord() + " z:" + this.getBaseMetaTileEntity().getZCoord() + " DIM-ID: " + this.getBaseMetaTileEntity().getWorld().provider.dimensionId); return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 501069b25d..193a1ffacb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -41,6 +41,7 @@ import gregtech.api.objects.XSTR; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; @@ -57,6 +58,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { private int HeliumSupply; private int BISOPeletSupply; private int TRISOPeletSupply; + private boolean empty; public GT_TileEntity_THTR(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -77,6 +79,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { HeliumSupply=aNBT.getInteger("HeliumSupply"); BISOPeletSupply=aNBT.getInteger("BISOPeletSupply"); TRISOPeletSupply=aNBT.getInteger("TRISOPeletSupply"); + empty=aNBT.getBoolean("EmptyMode"); } @Override @@ -85,6 +88,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { aNBT.setInteger("HeliumSupply",HeliumSupply); aNBT.setInteger("BISOPeletSupply",BISOPeletSupply); aNBT.setInteger("TRISOPeletSupply",TRISOPeletSupply); + aNBT.setBoolean("EmptyMode",empty); } @Override @@ -155,6 +159,17 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean onRunningTick(ItemStack aStack) { + + if (empty){ + this.addOutput(Materials.Helium.getGas(HeliumSupply)); + this.addOutput(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, TRISOPeletSupply, 3)); + this.addOutput(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, BISOPeletSupply, 1)); + this.HeliumSupply = 0; + this.TRISOPeletSupply = 0; + this.BISOPeletSupply = 0; + return true; + } + long accessibleCoolant = 0; long toProduce=0; for (FluidStack fluidStack : this.getStoredFluids()) { @@ -198,16 +213,17 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 4; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 4; - for (int x = -4; x <= 4; x++) { - for (int z = -4; z <= 4; z++) { + final byte xz = 5; + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * xz; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * xz; + for (int x = -xz; x <= xz; x++) { + for (int z = -xz; z <= xz; z++) { for (int y = 0; y < 12; y++) { if (y == 0 || y == 11) { if ( - !((Math.abs(z) == 3 && Math.abs(x) == 4)) && - !((Math.abs(z) == 4 && Math.abs(x) == 3)) && - !((Math.abs(x) == Math.abs(z) && Math.abs(x) == 4)) + !((Math.abs(z) == xz-1 && Math.abs(x) == xz)) && + !((Math.abs(z) == xz && Math.abs(x) == xz-1)) && + !((Math.abs(x) == Math.abs(z) && Math.abs(x) == xz)) ) { if (x + xDir == 0 && y == 0 && z + zDir == 0) continue; @@ -223,10 +239,18 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { } } } - else if (!((Math.abs(x) == 4 && Math.abs(z) == 4) || (Math.abs(x) == 3 && Math.abs(z) == 3)) && !(Math.abs(x) < 3 || Math.abs(z) < 3) && !((Math.abs(x) == Math.abs(z) && Math.abs(x) == 3) || Math.abs(x) == 4 || Math.abs(z) == 4)) { - if (!(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 12)) { + + +// else if (!((Math.abs(x) == 4 && Math.abs(z) == 4) || (Math.abs(x) == 3 && Math.abs(z) == 3)) && !(Math.abs(x) < 3 || Math.abs(z) < 3) && !((Math.abs(x) == Math.abs(z) && Math.abs(x) == 3) || Math.abs(x) == 4 || Math.abs(z) == 4)) { + else if (!((Math.abs(z) == xz-1 && Math.abs(x) == xz))) + if (!((Math.abs(z) == xz && Math.abs(x) == xz-1))) + if (!((Math.abs(x) == Math.abs(z) && Math.abs(x) == xz))) + if (!(Math.abs(x) < xz && Math.abs(z) != xz)) + + { + if (!(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 12)) { if ( - !this.addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), BASECASINGINDEX)) + !this.addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), BASECASINGINDEX)) { return false; } @@ -237,10 +261,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { } - if (this.mMaintenanceHatches.size() != 1) - return false; - - return true; + return this.mMaintenanceHatches.size() == 1; } @Override @@ -276,7 +297,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { "BISO-Pebbles:", this.BISOPeletSupply + "pcs.", "TRISO-Pebbles:", this.TRISOPeletSupply + "pcs.", "Helium-Level:", this.HeliumSupply+"L / "+HELIUM_NEEDED+"L", - "Coolant/sec:", this.BISOPeletSupply+this.TRISOPeletSupply >= 100000 ? (long) ((0.03471*(float)this.TRISOPeletSupply + 0.0267*(float)this.BISOPeletSupply))+"L/t" : "0L/t", + "Coolant/t:", this.BISOPeletSupply+this.TRISOPeletSupply >= 100000 ? (long) ((0.03471*(float)this.TRISOPeletSupply + 0.0267*(float)this.BISOPeletSupply))+"L/t" : "0L/t", "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; } @@ -297,6 +318,11 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[BASECASINGINDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[BASECASINGINDEX]}; } + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + empty = !empty; + GT_Utility.sendChatToPlayer(aPlayer,empty ? "THTR will now empty itself." : "THTR is back in normal Operation"); + } public static class THTRMaterials{ static final SimpleSubItemClass aTHTR_Materials = new SimpleSubItemClass("BISOPelletCompound","BISOPellet","TRISOPelletCompound","TRISOPellet","BISOPelletBall","TRISOPelletBall"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java index e1502041ed..1a0f189fd7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java @@ -29,22 +29,17 @@ import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; import java.util.HashSet; +import java.util.LinkedHashSet; public class ConnectedBlocksChecker { - public final HashSet hashset = new HashSet(); + public final HashSet hashset = new HashSet(2048); public static byte check_sourroundings(Coords C, Block b) { byte ret = 0; World w = DimensionManager.getWorld(C.wID); int x = C.x, y = C.y, z = C.z; - if (w.getBlock(x, y + 1, z).equals(b)) - ret = (byte) (ret | 0b000001); - - if (w.getBlock(x, y - 1, z).equals(b)) - ret = (byte) (ret | 0b000010); - if (w.getBlock(x + 1, y, z).equals(b)) ret = (byte) (ret | 0b000100); @@ -57,6 +52,13 @@ public class ConnectedBlocksChecker { if (w.getBlock(x, y, z - 1).equals(b)) ret = (byte) (ret | 0b100000); + if (w.getBlock(x, y + 1, z).equals(b)) + ret = (byte) (ret | 0b000001); + + if (w.getBlock(x, y - 1, z).equals(b)) + ret = (byte) (ret | 0b000010); + + return ret; } @@ -67,16 +69,6 @@ public class ConnectedBlocksChecker { byte sides = check_sourroundings(w, x, y, z, b); - if (((sides | 0b111110) == 0b111111) && !hashset.contains(new Coords(x, y + 1, z, wID))) { - ret++; - ret += get_connected(w, x, y + 1, z, b); - } - - if (((sides | 0b111101) == 0b111111) && !hashset.contains(new Coords(x, y - 1, z, wID))) { - ret++; - ret += get_connected(w, x, y - 1, z, b); - } - if (((sides | 0b111011) == 0b111111) && !hashset.contains(new Coords(x + 1, y, z, wID))) { ret++; ret += get_connected(w, x + 1, y, z, b); @@ -97,6 +89,17 @@ public class ConnectedBlocksChecker { ret += get_connected(w, x, y, z - 1, b); } + + if (((sides | 0b111110) == 0b111111) && !hashset.contains(new Coords(x, y + 1, z, wID))) { + ret++; + ret += get_connected(w, x, y + 1, z, b); + } + + if (((sides | 0b111101) == 0b111111) && !hashset.contains(new Coords(x, y - 1, z, wID))) { + ret++; + ret += get_connected(w, x, y - 1, z, b); + } + return ret; } @@ -110,12 +113,6 @@ public class ConnectedBlocksChecker { hashset.add(new Coords(x, y, z, wID)); - if (w.getBlock(x, y + 1, z).equals(b)) - ret = (byte) (ret | 0b000001); - - if (w.getBlock(x, y - 1, z).equals(b)) - ret = (byte) (ret | 0b000010); - if (w.getBlock(x + 1, y, z).equals(b)) ret = (byte) (ret | 0b000100); @@ -128,6 +125,12 @@ public class ConnectedBlocksChecker { if (w.getBlock(x, y, z - 1).equals(b)) ret = (byte) (ret | 0b100000); + if (w.getBlock(x, y + 1, z).equals(b)) + ret = (byte) (ret | 0b000001); + + if (w.getBlock(x, y - 1, z).equals(b)) + ret = (byte) (ret | 0b000010); + return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java new file mode 100644 index 0000000000..707b374888 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.block.Block; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +import java.util.HashSet; +import java.util.LinkedList; +import java.util.Queue; + + +/** + * This implementation is for some reason slower than the Recursive Check.... + * For ~3400 blocks this takes 8ms, the Recursive Check 5ms. + */ +public class ConnectedBlocksCheckerIteration { + + public final HashSet hashset = new HashSet(2048); + public final HashSet checked = new HashSet(4096); + private final Queue kwoe = new LinkedList(); + + public long get_connected(World w, int x, int y, int z, Block b){ + kwoe.add(new Coords(x,y,z,w.provider.dimensionId)); + hashset.add(new Coords(x,y,z,w.provider.dimensionId)); + while (!kwoe.isEmpty()){ + Coords tocheck = kwoe.poll(); + int wID = w.provider.dimensionId; + checked.add(tocheck); + Coords c; + if (!checked.contains(c = new Coords(tocheck.x + 1, tocheck.y, tocheck.z, wID)) && w.getBlock(tocheck.x + 1, tocheck.y, tocheck.z).equals(b)) { + kwoe.add(c); + hashset.add(c); + } + if (!checked.contains(c = new Coords(tocheck.x - 1, tocheck.y, tocheck.z, wID)) && w.getBlock(tocheck.x - 1, tocheck.y, tocheck.z).equals(b)) { + kwoe.add(c); + hashset.add(c); + } + if (!checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z + 1, wID)) && w.getBlock(tocheck.x, tocheck.y, tocheck.z + 1).equals(b)) { + kwoe.add(c); + hashset.add(c); + } + if (!checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z - 1, wID)) && w.getBlock(tocheck.x, tocheck.y, tocheck.z - 1).equals(b)) { + kwoe.add(c); + hashset.add(c); + } + if (!checked.contains(c = new Coords(tocheck.x, tocheck.y + 1, tocheck.z, wID)) && w.getBlock(tocheck.x, tocheck.y + 1, tocheck.z).equals(b)) { + kwoe.add(c); + hashset.add(c); + } + if (!checked.contains(c = new Coords(tocheck.x, tocheck.y - 1, tocheck.z, wID)) && w.getBlock(tocheck.x, tocheck.y - 1, tocheck.z).equals(b)) { + kwoe.add(c); + hashset.add(c); + } + } + return hashset.size(); + } + + public boolean get_meta_of_sideblocks(World w, int n, int[] xyz, boolean GT) { + + int wID = w.provider.dimensionId; + Coords Controller = new Coords(xyz[0], xyz[1], xyz[2], wID); + + for (Coords C : hashset) { + if (GT) { + TileEntity t; + t = w.getTileEntity(C.x, C.y + 1, C.z); + if (t != null && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) { + if (t instanceof IGregTechTileEntity) + if (((IGregTechTileEntity) t).getMetaTileID() == n) + return true; + } + t = w.getTileEntity(C.x, C.y - 1, C.z); + if (t != null && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) { + if (t instanceof IGregTechTileEntity) + if (((IGregTechTileEntity) t).getMetaTileID() == n) + return true; + } + t = w.getTileEntity(C.x + 1, C.y, C.z); + if (t != null && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) { + if (t instanceof IGregTechTileEntity) + if (((IGregTechTileEntity) t).getMetaTileID() == n) + return true; + } + t = w.getTileEntity(C.x - 1, C.y, C.z); + if (t != null && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) { + if (t instanceof IGregTechTileEntity) + if (((IGregTechTileEntity) t).getMetaTileID() == n) + return true; + } + t = w.getTileEntity(C.x, C.y, C.z + 1); + if (t != null && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) { + if (t instanceof IGregTechTileEntity) + if (((IGregTechTileEntity) t).getMetaTileID() == n) + return true; + } + t = w.getTileEntity(C.x, C.y, C.z - 1); + if (t != null && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) { + if (t instanceof IGregTechTileEntity) + if (((IGregTechTileEntity) t).getMetaTileID() == n) + return true; + } + } else { + if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) + return true; + if (n == w.getBlockMetadata(C.x, C.y - 1, C.z) && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) + return true; + if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) + return true; + if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) + return true; + if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) + return true; + if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) + return true; + } + } + return false; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java index f285b7b6e2..c27054eb01 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java @@ -55,20 +55,20 @@ public class Coords { @Override public int hashCode() { byte[] data = new byte[14]; - data[0] = (byte) (this.x & 0b1111); - data[1] = (byte) (this.x >> 4 & 0b1111); - data[2] = (byte) (this.x >> 8 & 0b1111); - data[3] = (byte) (this.x >> 12 & 0b1111); - data[4] = (byte) (this.y & 0b1111); - data[5] = (byte) (this.y >> 4 & 0b1111); - data[6] = (byte) (this.z & 0b1111); - data[7] = (byte) (this.z >> 4 & 0b1111); - data[8] = (byte) (this.z >> 8 & 0b1111); - data[9] = (byte) (this.z >> 12 & 0b1111); - data[10] = (byte) (this.wID & 0b1111); - data[11] = (byte) (this.wID >> 4 & 0b1111); - data[12] = (byte) (this.wID >> 8 & 0b1111); - data[13] = (byte) (this.wID >> 12 & 0b1111); + data[0] = (byte) (this.x & 0xff); + data[1] = (byte) (this.x >> 4 & 0xff); + data[2] = (byte) (this.x >> 8 & 0xff); + data[3] = (byte) (this.x >> 12 & 0xff); + data[4] = (byte) (this.y & 0xff); + data[5] = (byte) (this.y >> 4 & 0xff); + data[6] = (byte) (this.z & 0xff); + data[7] = (byte) (this.z >> 4 & 0xff); + data[8] = (byte) (this.z >> 8 & 0xff); + data[9] = (byte) (this.z >> 12 & 0xff); + data[10] = (byte) (this.wID & 0xff); + data[11] = (byte) (this.wID >> 4 & 0xff); + data[12] = (byte) (this.wID >> 8 & 0xff); + data[13] = (byte) (this.wID >> 12 & 0xff); return MurmurHash3.murmurhash3_x86_32(data, 0, 14, 31); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java new file mode 100644 index 0000000000..4974a5725d --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.openComputers; + +import net.minecraft.nbt.NBTTagCompound; + +import java.util.HashMap; + +public class GT_NBT_DataBase { + + private static HashMap tagToIdMap = new HashMap<>(); + + private static long maxID = Long.MIN_VALUE+1; + + private final NBTTagCompound tagCompound; + + private final String mDataName; + private final String mDataTitle; + private long id; + + GT_NBT_DataBase(String mDataName, String mDataTitle, NBTTagCompound tagCompound) { + this.mDataName = mDataName; + this.mDataTitle = mDataTitle; + this.tagCompound = tagCompound; + this.id = GT_NBT_DataBase.maxID; + GT_NBT_DataBase.tagToIdMap.put(tagCompound,id); + ++GT_NBT_DataBase.maxID; + } + + static Long getIdFromTag(NBTTagCompound tagCompound){ + return GT_NBT_DataBase.tagToIdMap.get(tagCompound); + } + + public NBTTagCompound getTagCompound() { + return this.tagCompound; + } + + public String getmDataName() { + return this.mDataName; + } + + static long getMaxID() { + return GT_NBT_DataBase.maxID; + } + + public String getmDataTitle() { + return this.mDataTitle; + } + + public long getId() { + return this.id; + } + + public void setId(long id) { + this.id = id; + } + + private GT_NBT_DataBase(NBTTagCompound tagCompound, String mDataName, String mDataTitle, long id) { + this.tagCompound = tagCompound; + this.mDataName = mDataName; + this.mDataTitle = mDataTitle; + this.id = id; + } + + public static GT_NBT_DataBase makeNewWithoutRegister(String mDataName, String mDataTitle, NBTTagCompound tagCompound){ + return new GT_NBT_DataBase(tagCompound,mDataName,mDataTitle,Long.MIN_VALUE); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java new file mode 100644 index 0000000000..635ceb9fee --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.openComputers; + +import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; +import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; +import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; +import cpw.mods.fml.common.FMLCommonHandler; +import gregtech.api.enums.ItemList; +import gregtech.api.util.GT_Utility; +import gregtech.common.items.behaviors.Behaviour_DataOrb; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + +import java.util.HashMap; + +//@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers") +public class TileEntity_GTDataServer extends TileEntity implements ITileWithGUI, ITileAddsInformation, ITileHasDifferentTextureSides/*, SimpleComponent*/ { + + private static HashMap OrbDataBase = new HashMap<>(); + + private ItemStack[] mItems = new ItemStack[2]; + + + private byte TickTimer = 0; + + public String getComponentName() { + return "GT-Data Server"; + } + +// @Callback +// @Optional.Method(modid = "OpenComputers") +// public Object[] listData(Context context, Arguments args) { +// return new String[] +// } + + private boolean isServerSide(){ + return !this.worldObj.isRemote || FMLCommonHandler.instance().getSide().isServer(); + } + + + @Override + public void updateEntity() { + if (this.TickTimer++ % 20 != 0) + return; + + if (this.isServerSide()) { + if (GT_Utility.areStacksEqual(this.mItems[0],ItemList.Tool_DataOrb.get(1))) { + if (this.mItems[0].hasTagCompound()) { + if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) { + TileEntity_GTDataServer.OrbDataBase.put( + GT_NBT_DataBase.getMaxID(), + new GT_NBT_DataBase( + Behaviour_DataOrb.getDataName(this.mItems[0]), + Behaviour_DataOrb.getDataTitle(this.mItems[0]), + this.mItems[0].getTagCompound() + ) + ); + } + } + } + if (GT_Utility.areStacksEqual(this.mItems[0],ItemList.Tool_DataStick.get(1))) { + if (this.mItems[0].hasTagCompound()) { + + String bookTitle = GT_Utility.ItemNBT.getBookTitle(this.mItems[0]); + String punchcardData = GT_Utility.ItemNBT.getPunchCardData(this.mItems[0]); + short mapID = GT_Utility.ItemNBT.getMapID(this.mItems[0]); + byte data = (byte) (bookTitle.isEmpty() ? punchcardData.isEmpty() ? mapID != -1 ? 3 : -1 : 2 : 1); + + String title = data == 1 ? bookTitle : data == 2 ? punchcardData : data == 3 ? ""+mapID : "Custom Data"; + String name = data == 1 ? "eBook" : data == 2 ? "Punch Card Data" : data == 3 ? "Map Data" : "Custom Data"; + if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) { + TileEntity_GTDataServer.OrbDataBase.put( + GT_NBT_DataBase.getMaxID(), + new GT_NBT_DataBase( + name, + title, + this.mItems[0].getTagCompound() + ) + ); + } + } + } + } + } + + @Override + public String[] getInfoData() { + return new String[0]; + } + + @Override + public void registerBlockIcons(IIconRegister par1IconRegister) { + + } + + @Override + public int getGUIID() { + return 0; + } +} diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 73a58a4c64..0388c0cb46 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -144,7 +144,7 @@ tile.radiohatch.name=Radio Hatch tile.bw.windmill.name=Windmill tile.manutrafo.name=Manual Trafo -tooltip.tile.htr.0.name=Controller Block for the Thorium High Temperature Reactor;Size(WxHxD): 9x12x9 (Hollow);Corners and the 2 touching blocks are air;Once build, Helium is inserted into the Fluid Input Hatch until it doesnt accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Raidation Proof Casings for the Rest;Needs a constant supply of coolant or will shut down;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes 1 Fuel Pellet per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days +tooltip.tile.htr.0.name=Controller Block for the Thorium High Temperature Reactor;Size(WxHxD): 11x12x11 (Hollow);Controller: Front Center, Lowest Layer;Corners and the 2 touching blocks are air;Once build, Helium is inserted into the Fluid Input Hatch until it doesnt accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Raidation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete Operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes 1 Fuel Pellet per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days item.TRISOPellet.name=TRISO pebble item.TRISOPelletBall.name=TRISO pebble ball item.BISOPelletBall.name=BISO pebble ball -- cgit From 3ee2e33630d3346d9ab04c9e4c56f101f18399d2 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 23 Apr 2019 04:46:25 +0200 Subject: improved threaded loader +fixes not enabled ASM code Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: c7b407a7fed7730839a2613a93b5a985e7ae3a0e --- build.properties | 2 +- .../java/com/github/bartimaeusnek/ASM/BWCore.java | 15 +++++-- .../com/github/bartimaeusnek/ASM/BWCorePlugin.java | 22 ++++++--- .../bartimaeusnek/ASM/BWCoreTransformer.java | 39 +++++++++------- .../github/bartimaeusnek/bartworks/MainMod.java | 4 ++ .../ClientEventHandler/ClientEventHandler.java | 2 +- .../bartworks/common/configs/ConfigHandler.java | 6 ++- .../system/material/BW_MetaGenerated_Items.java | 8 +++- .../bartworks/system/material/OreDictHandler.java | 52 ---------------------- .../bartworks/system/material/ThreadedLoader.java | 6 ++- .../bartworks/system/material/WerkstoffLoader.java | 27 ++++++++--- .../bartworks/system/oredict/OreDictAdder.java | 51 +++++++++++++++++++++ .../bartworks/system/oredict/OreDictHandler.java | 52 ++++++++++++++++++++++ 13 files changed, 194 insertions(+), 92 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/OreDictHandler.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java diff --git a/build.properties b/build.properties index 9219373f51..4f072d27ec 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=11 +buildNumber=12 APIVersion=6 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java index 9c76b3dd82..031ff30512 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java @@ -22,11 +22,13 @@ package com.github.bartimaeusnek.ASM; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.google.common.eventbus.EventBus; import com.google.common.eventbus.Subscribe; import cpw.mods.fml.common.DummyModContainer; import cpw.mods.fml.common.LoadController; +import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModMetadata; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.versioning.ArtifactVersion; @@ -37,23 +39,28 @@ import org.apache.logging.log4j.Logger; import java.util.ArrayList; import java.util.List; +import static com.github.bartimaeusnek.ASM.BWCoreTransformer.shouldTransform; + public class BWCore extends DummyModContainer { public static final String BWCORE_NAME = "BartWorks ASM Core"; - public static final Logger BWCORE_LOG = LogManager.getLogger(BWCORE_NAME); + public static final Logger BWCORE_LOG = LogManager.getLogger(BWCore.BWCORE_NAME); public BWCore() { super(new ModMetadata()); - ModMetadata metadata = getMetadata(); + ModMetadata metadata = this.getMetadata(); metadata.modId = "BWCore"; - metadata.name = BWCORE_NAME; + metadata.name = BWCore.BWCORE_NAME; metadata.version = "0.0.1"; metadata.authorList.add("bartimaeusnek"); - metadata.dependants = getDependants(); + metadata.dependants = this.getDependants(); } @Subscribe public void preInit(FMLPreInitializationEvent event) { + shouldTransform[0] = Loader.isModLoaded("ExtraUtilities") && ConfigHandler.enabledPatches[0]; + shouldTransform[1] = Loader.isModLoaded("ExtraUtilities") && ConfigHandler.enabledPatches[1]; + BWCore.BWCORE_LOG.info("Extra Utilities found? " + shouldTransform[0]); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java index 64206d5e56..97f4702d4c 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java @@ -28,27 +28,27 @@ import cpw.mods.fml.relauncher.IFMLLoadingPlugin; import net.minecraftforge.common.config.Configuration; import java.io.File; +import java.util.ArrayList; import java.util.Map; @IFMLLoadingPlugin.SortingIndex(999999999)//Load as late as possible (after fastcraft/OptiFine). @IFMLLoadingPlugin.MCVersion("1.7.10") -@IFMLLoadingPlugin.TransformerExclusions({"com.github.bartimaeusnek.ASM"}) +@IFMLLoadingPlugin.TransformerExclusions("com.github.bartimaeusnek.ASM") @IFMLLoadingPlugin.Name(BWCorePlugin.BWCORE_PLUGIN_NAME) public class BWCorePlugin implements IFMLLoadingPlugin { public static final String BWCORE_PLUGIN_NAME = "BartWorks ASM Core Plugin"; - public static File minecraftDir = null; + public static File minecraftDir; public BWCorePlugin() { //Injection Code taken from CodeChickenLib - if (minecraftDir != null) + if (BWCorePlugin.minecraftDir != null) return;//get called twice, once for IFMLCallHook - minecraftDir = (File) FMLInjectionData.data()[6]; + BWCorePlugin.minecraftDir = (File) FMLInjectionData.data()[6]; //do all the configuration already now... - new ConfigHandler(new Configuration(new File(new File(minecraftDir, "config"), "bartworks.cfg"))); - //config Override if mods are missing. - new BWCoreTransformer().checkForMods(); + new ConfigHandler(new Configuration(new File(new File(BWCorePlugin.minecraftDir, "config"), "bartworks.cfg"))); + BWCoreTransformer.shouldTransform[2] = false; } @Override @@ -71,6 +71,14 @@ public class BWCorePlugin implements IFMLLoadingPlugin { if (data.get("runtimeDeobfuscationEnabled") != null) { BWCoreTransformer.obfs = (boolean) data.get("runtimeDeobfuscationEnabled"); } + if (data.get("coremodList") != null) { + for (Object o : (ArrayList) data.get("coremodList")) { + if (o.toString().contains("MicdoodlePlugin")) { + BWCoreTransformer.shouldTransform[2] = ConfigHandler.enabledPatches[2]; + break; + } + } + } } @Override diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index 41c1164db4..bcc67b18d3 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -23,12 +23,15 @@ package com.github.bartimaeusnek.ASM; import net.minecraft.launchwrapper.IClassTransformer; +import net.minecraft.launchwrapper.Launch; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.tree.*; +import java.io.File; import java.util.Arrays; import java.util.List; +import java.util.jar.JarFile; import static org.objectweb.asm.Opcodes.*; @@ -47,23 +50,25 @@ public class BWCoreTransformer implements IClassTransformer { public static boolean[] shouldTransform = new boolean[CLASSESBEEINGTRANSFORMED.length]; - public void checkForMods() { - //hacky way to detect if the mods are loaded - try{ - Class.forName("com.rwtema.extrautils.core.Tuple"); - shouldTransform[0] = true; - shouldTransform[1] = true; - }catch (ClassNotFoundException e){ - shouldTransform[0] = false; - shouldTransform[1] = false; - } - try{ - Class.forName("micdoodle8.mods.galacticraft.core.Constants"); - shouldTransform[2] = true; - }catch (ClassNotFoundException e){ - shouldTransform[2] = false; - } - } +// public void checkForMods() { +// //hacky way to detect if the mods are loaded +// try{ +// Class.forName("com.rwtema.extrautils.core.Tuple"); +// shouldTransform[0] = true; +// shouldTransform[1] = true; +// }catch (ClassNotFoundException e){ +// BWCore.BWCORE_LOG.info("Extra Utilities not found!"); +// shouldTransform[0] = false; +// shouldTransform[1] = false; +// } +// try{ +// Class.forName("micdoodle8.mods.galacticraft.core.Constants"); +// shouldTransform[2] = true; +// }catch (ClassNotFoundException e){ +// BWCore.BWCORE_LOG.info("micdoodle Core not found!"); +// shouldTransform[2] = false; +// } +// } public static byte[] transform(int id, byte[] basicClass) { if (!BWCoreTransformer.shouldTransform[id]) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 522943fba4..e5ee488b2f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -49,6 +49,8 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartedEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.registry.GameData; +import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.SubTag; @@ -57,6 +59,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import org.apache.logging.log4j.LogManager; @@ -64,6 +67,7 @@ import org.apache.logging.log4j.Logger; import java.io.IOException; import java.util.HashSet; +import java.util.Iterator; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java index 5888b88ef2..d2277817c5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java @@ -25,7 +25,7 @@ package com.github.bartimaeusnek.bartworks.client.ClientEventHandler; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; -import com.github.bartimaeusnek.bartworks.system.material.OreDictHandler; +import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index cce52a223d..669417a345 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -26,6 +26,8 @@ package com.github.bartimaeusnek.bartworks.common.configs; import com.github.bartimaeusnek.ASM.BWCoreTransformer;; import net.minecraftforge.common.config.Configuration; +import java.util.Arrays; + public class ConfigHandler { private static final int IDU = 10 * 8 + 5; public static int IDOffset = 12600; @@ -44,7 +46,7 @@ public class ConfigHandler { public static boolean experimentalThreadedLoader; public static boolean GTNH; public static boolean ezmode; - + public static boolean[] enabledPatches ; public ConfigHandler(Configuration C) { ConfigHandler.c = C; @@ -67,6 +69,8 @@ public class ConfigHandler { for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) { BWCoreTransformer.shouldTransform[i] = ConfigHandler.c.get("ASM fixes", BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i], true).getBoolean(true); } + enabledPatches = new boolean[BWCoreTransformer.shouldTransform.length]; + enabledPatches = Arrays.copyOf(BWCoreTransformer.shouldTransform,BWCoreTransformer.shouldTransform.length); ConfigHandler.ross128BID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64); ConfigHandler.ross128BAID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128ba", -63, "The Dim ID for Ross128ba (Ross128b's Moon)").getInt(-63); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index f77c8ea745..552548c4d6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -22,7 +22,10 @@ package com.github.bartimaeusnek.bartworks.system.material; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.Pair; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Materials; @@ -69,7 +72,10 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item { continue; GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", this.getDefaultLocalization(w)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); - GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.getDefaultName().replaceAll(" ",""), tStack); + if (ConfigHandler.experimentalThreadedLoader) + OreDictAdder.addToMap(new Pair<>(this.orePrefixes.name() + w.getDefaultName().replaceAll(" ",""), tStack)); + else + GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.getDefaultName().replaceAll(" ",""), tStack); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/OreDictHandler.java deleted file mode 100644 index 0715d00a90..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/OreDictHandler.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.system.material; - -import gregtech.api.enums.OrePrefixes; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -import java.util.HashMap; - -public class OreDictHandler { - - private static final HashMap cache = new HashMap<>(); - - public static HashMap getCache() { - return OreDictHandler.cache; - } - - public static ItemStack getItemStack(String elementName, OrePrefixes prefixes, int amount){ - if (cache.get(prefixes+elementName.replaceAll(" ","")) != null){ - ItemStack tmp = cache.get(prefixes+elementName.replaceAll(" ","")).copy(); - tmp.stackSize=amount; - return tmp; - } else if (!OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).isEmpty()){ - ItemStack tmp = OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).get(0).copy(); - tmp.stackSize=amount; - cache.put(prefixes+elementName.replaceAll(" ",""),tmp); - return tmp; - } - return null; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java index d34fd03818..bb3bea4915 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import cpw.mods.fml.common.FMLCommonHandler; import java.util.ArrayList; @@ -40,6 +41,7 @@ public class ThreadedLoader implements Runnable { MainMod.LOGGER.info("Starting to register BartWorks Materials Recipes to Gregtech"); threads.add(new AllRecipes()); threads.forEach(Thread::start); + } public synchronized void runInit() { @@ -57,9 +59,11 @@ public class ThreadedLoader implements Runnable { } } MainMod.LOGGER.info("Successfully joined the Material Generation Thread, Registering the Items/Blocks to the GameRegistry"); + if ((WerkstoffLoader.toGenerateGlobal) != 0){ + OreDictAdder.addToOreDict(); + } if ((WerkstoffLoader.toGenerateGlobal & 0b1000) != 0) WerkstoffLoader.INSTANCE.gameRegistryHandler(); - } class AllRecipes extends Thread { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 7256b12a43..e5848f2789 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -28,6 +28,8 @@ import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes; +import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; +import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; @@ -607,14 +609,25 @@ public class WerkstoffLoader implements Runnable { } private void runAdditionalOreDict(){ - for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - if (werkstoff.getGenerationFeatures().hasOres()) - GT_OreDictUnificator.registerOre(ore + werkstoff.getDefaultName().replaceAll(" ",""), werkstoff.get(ore)); - if (werkstoff.getGenerationFeatures().hasGems()) - OreDictionary.registerOre("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens)); - } + if (ConfigHandler.experimentalThreadedLoader){ + for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { + if (werkstoff.getGenerationFeatures().hasOres()) + OreDictAdder.addToMap(new Pair<>(ore + werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.get(ore))); + if (werkstoff.getGenerationFeatures().hasGems()) + OreDictAdder.addToMap(new Pair<>("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens))); + } - GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.Zirconia.get(gemExquisite)); + OreDictAdder.addToMap(new Pair<>("craftingIndustrialDiamond", WerkstoffLoader.Zirconia.get(gemExquisite))); + }else { + for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { + if (werkstoff.getGenerationFeatures().hasOres()) + GT_OreDictUnificator.registerOre(ore + werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.get(ore)); + if (werkstoff.getGenerationFeatures().hasGems()) + OreDictionary.registerOre("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens)); + } + + GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.Zirconia.get(gemExquisite)); + } } private void addGemRecipes(Werkstoff werkstoff) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java new file mode 100644 index 0000000000..25e3598df0 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.oredict; + +import com.github.bartimaeusnek.bartworks.util.Pair; +import gregtech.api.util.GT_OreDictUnificator; +import net.minecraft.item.ItemStack; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public class OreDictAdder { + + private static ConcurrentHashMap toAddMap = new ConcurrentHashMap<>(); + + public static synchronized void addToMap(Pair element){ + OreDictAdder.toAddMap.put(element.getKey(),element.getValue()); + } + + public static synchronized void addToMap(Pair... elements){ + for (Pair p : elements) + OreDictAdder.toAddMap.put(p.getKey(),p.getValue()); + } + + public static void addToOreDict(){ + for (Map.Entry entry: toAddMap.entrySet()){ + GT_OreDictUnificator.registerOre(entry.getKey(),entry.getValue()); + } + } + +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java new file mode 100644 index 0000000000..e86d55acce --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.oredict; + +import gregtech.api.enums.OrePrefixes; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.HashMap; + +public class OreDictHandler { + + private static final HashMap cache = new HashMap<>(); + + public static HashMap getCache() { + return OreDictHandler.cache; + } + + public static ItemStack getItemStack(String elementName, OrePrefixes prefixes, int amount){ + if (cache.get(prefixes+elementName.replaceAll(" ","")) != null){ + ItemStack tmp = cache.get(prefixes+elementName.replaceAll(" ","")).copy(); + tmp.stackSize=amount; + return tmp; + } else if (!OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).isEmpty()){ + ItemStack tmp = OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).get(0).copy(); + tmp.stackSize=amount; + cache.put(prefixes+elementName.replaceAll(" ",""),tmp); + return tmp; + } + return null; + } +} -- cgit From f203f18effabfbb52e269e3bdd889bd39f5b8509 Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Wed, 24 Apr 2019 17:59:22 +0800 Subject: update translation Former-commit-id: cdba8f410f806fd89bf5dc94fd464803cc6b21a3 --- src/main/resources/assets/bartworks/lang/zh_CN.lang | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index 6d5572f073..29b66c2ebd 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -144,7 +144,7 @@ tile.radiohatch.name=放射仓 tile.bw.windmill.name=风车 tile.manutrafo.name=手动变压器 -tooltip.tile.htr.0.name=高温钍反应堆的控制器方块;大小(宽x高x长):9x12x9(中空);角落和两个相邻的方块是空气;一旦搭建完成,需要在输入仓中输入氦气直到不再接受;1+输出仓(任意底部机械方块);1+输入仓(任意顶部机械方块);1+输入总线(任意顶部机械方块);1x维护仓(任意机械方块);其余的为辐射防护机械方块;需要持续供应冷却液否则将灰关机;需要至少100k卵石燃料才能开始工作(最多可使用675k个卵石);每次操作消耗1个燃料颗粒;TRISO卵石将提供30%的额外能量;每个卵石都会增加转换冷却剂的需求数量;一次工作耗时27个游戏日 +tooltip.tile.htr.0.name=高温钍反应堆的控制器方块;大小(宽x高x长):11x12x11 (中空);控制器:正面中心,最低一层;角落和两个相邻的方块是空气;:一旦搭建完成,需要在输入仓中输入氦气直到不再接受;1+输出仓(任意底部机械方块);1+输入仓(任意顶部机械方块);1+输入总线(任意顶部机械方块);1x维护仓(任意机械方块);其余的为辐射防护机械方块;在运行时需要持续供应冷却液,完成工作后输出;需要至少100k卵石燃料才能开始工作(最多可使用675k个卵石);每次操作消耗1个燃料颗粒;TRISO卵石将提供30%的额外能量;每个卵石都会增加转换冷却剂的需求数量;一次工作耗时27个游戏日 item.TRISOPellet.name=TRISO卵石 item.TRISOPelletBall.name=TRISO卵石球 item.BISOPelletBall.name=BISO卵石球 @@ -153,8 +153,11 @@ item.TRISOPelletCompound.name=TRISO卵石复合材料 item.BISOPelletCompound.name=BISO卵石复合材料 itemGroup.bartworksMetaMaterials=BartWorks-meta材料 +tooltip.tile.eic.0.name=电气聚爆压缩机的控制器方块;大小(宽x高x长):3x9x3;使用电而不是爆炸物工作;控制器在第三层正面中心;第一到第九层为坚硬钢机械方块,每层中间为能量仓;第2,3,7,8层:中心为镍锌铁氧体方块,其余的为变压器线圈块;第4,5,6层为中子块;1+输入总线,1+输出总线,1个维护仓于坚硬钢机械方块;在操作过程中,请勿遮挡或挖掘移动方块,这会上演爆炸的艺术!! + + planet.Ross128b=罗斯128b moon.Ross128ba=罗斯128ba star.Ross128=罗斯128 solarsystem.Ross128System=罗斯128-行星系 -//This zh_CN.lang is translated by huajijam for bartworks (15/4/19) \ No newline at end of file +//This zh_CN.lang is translated by huajijam for bartworks (24/4/19) \ No newline at end of file -- cgit From aaa4c29f55ec261fb784941ca17435ba06e58467 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 28 Apr 2019 02:22:39 +0200 Subject: reworked clienteventhandler Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: be5ebbabc9ed6e24d8394f4f38242c431b9f694e --- .../ClientEventHandler/ClientEventHandler.java | 54 +++++++++++++--------- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java index d2277817c5..2d37b61242 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java @@ -40,6 +40,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import net.minecraftforge.event.entity.player.ItemTooltipEvent; @@ -51,38 +52,43 @@ import java.util.List; @SideOnly(Side.CLIENT) public class ClientEventHandler { - HashMap> cache = new HashMap<>(); + private static final HashMap> CACHE = new HashMap<>(); @SideOnly(Side.CLIENT) @SubscribeEvent(priority = EventPriority.HIGHEST) public void getTooltip(ItemTooltipEvent event) { - if (event.itemStack == null || event.itemStack.getItem() == null || Block.getBlockFromItem(event.itemStack.getItem()) == null) + if (CACHE.size() > 500) + CACHE.clear(); + + if (event.itemStack == null || event.itemStack.getItem() == null || !(OreDictHandler.getCache().containsValue(event.itemStack) || Block.getBlockFromItem(event.itemStack.getItem()) != Blocks.air)) return; - if (!cache.containsKey(event.itemStack)) { + if (!CACHE.containsKey(event.itemStack)) { List tooAdd = new ArrayList<>(); - - for (ItemStack stack : OreDictHandler.getCache().values()) { - if (GT_Utility.areStacksEqual(event.itemStack, stack)) { - GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(stack.getItem()); - if (UI == null) - UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(stack.getItem())); - if (UI != null) { - for (ModContainer modContainer : Loader.instance().getModList()) { - if (UI.modId.equals(MainMod.MOD_ID) || UI.modId.equals(BartWorksCrossmod.MOD_ID) || UI.modId.equals("BWCore")) - break; - if (UI.modId.equals(modContainer.getModId())) { - tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + ChatColorHelper.GRAY + " and " + ChatColorHelper.RED + modContainer.getName()); + if (OreDictHandler.getCache().containsValue(event.itemStack) ) { + for (ItemStack stack : OreDictHandler.getCache().values()) { + if (GT_Utility.areStacksEqual(event.itemStack, stack)) { + GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(stack.getItem()); + if (UI == null) + UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(stack.getItem())); + if (UI != null) { + for (ModContainer modContainer : Loader.instance().getModList()) { + if (UI.modId.equals(MainMod.MOD_ID) || UI.modId.equals(BartWorksCrossmod.MOD_ID) || UI.modId.equals("BWCore")) + break; + if (UI.modId.equals(modContainer.getModId())) { + tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + ChatColorHelper.GRAY + " and " + ChatColorHelper.RED + modContainer.getName()); + } } - } - } else - tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + ChatColorHelper.GRAY + " and another Mod, that doesn't use the ModContainer propperly!"); + } else + tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + ChatColorHelper.GRAY + " and another Mod, that doesn't use the ModContainer propperly!"); + } } } - final Block BLOCK = Block.getBlockFromItem(event.itemStack.getItem()); + final Block BLOCK = Block.getBlockFromItem(event.itemStack.getItem()); + if (BLOCK != null && BLOCK != Blocks.air) { if (BLOCK instanceof BW_Blocks) { - cache.put(event.itemStack, tooAdd); + CACHE.put(event.itemStack, tooAdd); return; } final BioVatLogicAdder.BlockMetaPair PAIR = new BioVatLogicAdder.BlockMetaPair(BLOCK, (byte) event.itemStack.getItemDamage()); @@ -98,10 +104,12 @@ public class ClientEventHandler { " " + BW_ColorUtil.getColorForTier(3) + GT_Values.VN[3] + ChatColorHelper.RESET); } - cache.put(event.itemStack, tooAdd); - event.toolTip.addAll(tooAdd); + } + + CACHE.put(event.itemStack, tooAdd); + event.toolTip.addAll(tooAdd); } else { - event.toolTip.addAll(cache.get(event.itemStack)); + event.toolTip.addAll(CACHE.get(event.itemStack)); } } } \ No newline at end of file -- cgit From 7f895c5e164e8b73d953756a3c02b2aea2d405b6 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 28 Apr 2019 06:34:48 +0200 Subject: re-enabled the tooltip handler Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 949b0d20ef0323d6308beac55e46a933b32bcf79 --- .../github/bartimaeusnek/bartworks/MainMod.java | 60 ++++++++++--------- .../ClientEventHandler/ClientEventHandler.java | 29 +++++----- .../client/ClientEventHandler/TooltipCache.java | 67 ++++++++++++++++++++++ .../bartworks/system/oredict/OreDictHandler.java | 26 +++++++-- 4 files changed, 133 insertions(+), 49 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index e5ee488b2f..43b76254d2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -39,6 +39,7 @@ import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; @@ -160,34 +161,37 @@ public final class MainMod { @Mod.EventHandler public void onServerStarted(FMLServerStartedEvent event) { - eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); - recipeLoop: - for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList) { - if (recipe == null || recipe.mInputs == null) - continue; - try { - ItemStack input = recipe.mInputs[0]; - int i = 0; - float durMod = 0; - if (checkForExplosives(recipe.mInputs[1])) { - if (GT_Utility.areStacksEqual(recipe.mInputs[1], GT_ModHandler.getIC2Item("industrialTnt", 1L))) - durMod += ((float) input.stackSize * 2f); - else - continue recipeLoop; - } - while (checkForExplosives(input)) { - if (GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L))) - durMod += ((float) input.stackSize * 2f); - else - continue recipeLoop; - i++; - input = recipe.mInputs[i]; - } - - eicMap.addRecipe(true, new ItemStack[]{input}, recipe.mOutputs, null, null, null, (int)Math.floor(Math.max((float)recipe.mDuration*durMod,20f)), BW_Util.getMachineVoltageFromTier(10), 0); - } catch (ArrayIndexOutOfBoundsException e) { - LOGGER.error("CAUGHT DEFECTIVE IMPLOSION COMPRESSOR RECIPE!"); - e.printStackTrace(); + OreDictHandler.adaptCacheForWorld(); + if (eicMap == null) { + eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); + recipeLoop: + for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList) { + if (recipe == null || recipe.mInputs == null) + continue; + try { + ItemStack input = recipe.mInputs[0]; + int i = 0; + float durMod = 0; + if (this.checkForExplosives(recipe.mInputs[1])) { + if (GT_Utility.areStacksEqual(recipe.mInputs[1], GT_ModHandler.getIC2Item("industrialTnt", 1L))) + durMod += ((float) input.stackSize * 2f); + else + continue; + } + while (this.checkForExplosives(input)) { + if (GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L))) + durMod += ((float) input.stackSize * 2f); + else + continue recipeLoop; + i++; + input = recipe.mInputs[i]; + } + + eicMap.addRecipe(true, new ItemStack[]{input}, recipe.mOutputs, null, null, null, (int) Math.floor(Math.max((float) recipe.mDuration * durMod, 20f)), BW_Util.getMachineVoltageFromTier(10), 0); + } catch (ArrayIndexOutOfBoundsException e) { + MainMod.LOGGER.error("CAUGHT DEFECTIVE IMPLOSION COMPRESSOR RECIPE!"); + e.printStackTrace(); + } } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java index 2d37b61242..861b456fd9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; @@ -37,10 +38,10 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; -import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import net.minecraftforge.event.entity.player.ItemTooltipEvent; @@ -52,25 +53,23 @@ import java.util.List; @SideOnly(Side.CLIENT) public class ClientEventHandler { - private static final HashMap> CACHE = new HashMap<>(); - @SideOnly(Side.CLIENT) @SubscribeEvent(priority = EventPriority.HIGHEST) public void getTooltip(ItemTooltipEvent event) { - if (CACHE.size() > 500) - CACHE.clear(); - if (event.itemStack == null || event.itemStack.getItem() == null || !(OreDictHandler.getCache().containsValue(event.itemStack) || Block.getBlockFromItem(event.itemStack.getItem()) != Blocks.air)) + if (event.itemStack == null || event.itemStack.getItem() == null) return; - if (!CACHE.containsKey(event.itemStack)) { + if (TooltipCache.getTooltip(event.itemStack).isEmpty()) { + ItemStack tmp = event.itemStack.copy(); + Pair abstractedStack = new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); List tooAdd = new ArrayList<>(); - if (OreDictHandler.getCache().containsValue(event.itemStack) ) { - for (ItemStack stack : OreDictHandler.getCache().values()) { - if (GT_Utility.areStacksEqual(event.itemStack, stack)) { - GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(stack.getItem()); + if (OreDictHandler.getCache().containsValue(abstractedStack)) { + for (Pair pair : OreDictHandler.getCache().values()) { + if (pair.equals(abstractedStack)) { + GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); if (UI == null) - UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(stack.getItem())); + UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); if (UI != null) { for (ModContainer modContainer : Loader.instance().getModList()) { if (UI.modId.equals(MainMod.MOD_ID) || UI.modId.equals(BartWorksCrossmod.MOD_ID) || UI.modId.equals("BWCore")) @@ -88,7 +87,7 @@ public class ClientEventHandler { final Block BLOCK = Block.getBlockFromItem(event.itemStack.getItem()); if (BLOCK != null && BLOCK != Blocks.air) { if (BLOCK instanceof BW_Blocks) { - CACHE.put(event.itemStack, tooAdd); + TooltipCache.put(event.itemStack, tooAdd); return; } final BioVatLogicAdder.BlockMetaPair PAIR = new BioVatLogicAdder.BlockMetaPair(BLOCK, (byte) event.itemStack.getItemDamage()); @@ -106,10 +105,10 @@ public class ClientEventHandler { } } - CACHE.put(event.itemStack, tooAdd); + TooltipCache.put(event.itemStack, tooAdd); event.toolTip.addAll(tooAdd); } else { - event.toolTip.addAll(CACHE.get(event.itemStack)); + event.toolTip.addAll(TooltipCache.getTooltip(event.itemStack)); } } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java new file mode 100644 index 0000000000..5702c32252 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.client.ClientEventHandler; + +import com.github.bartimaeusnek.bartworks.util.Pair; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +import java.util.*; + +class TooltipCache { + private static final HashMap, char[]> cache = new HashMap<>(); + + static boolean put(ItemStack itemStack, List tooltip){ + Pair p = new Pair<>(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage()); + if (TooltipCache.cache.containsKey(p)) + return false; + + if (!tooltip.isEmpty()) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < tooltip.size(); i++) { + sb.append(tooltip.get(i)); + sb.append(System.lineSeparator()); + } + char[] rettype = sb.toString().toCharArray(); + return TooltipCache.cache.put(p,rettype) == rettype; + } else { + return false; + } + } + + static List getTooltip(ItemStack itemStack) { + Pair p = new Pair<>(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage()); + char[] toTest= TooltipCache.cache.get(p); + if (toTest == null){ + return new ArrayList<>(); + } + return Arrays.asList(new String(toTest).split(System.lineSeparator())); + } + + private static void checkSize(){ + if (TooltipCache.cache.size()> Short.MAX_VALUE*2 ){ + TooltipCache.cache.clear(); + } + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java index e86d55acce..d70bf884d2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java @@ -22,29 +22,43 @@ package com.github.bartimaeusnek.bartworks.system.oredict; +import com.github.bartimaeusnek.bartworks.util.Pair; import gregtech.api.enums.OrePrefixes; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; public class OreDictHandler { - private static final HashMap cache = new HashMap<>(); + private static final HashMap> cache = new HashMap<>(); - public static HashMap getCache() { + public static HashMap> getCache() { return OreDictHandler.cache; } + public static void adaptCacheForWorld(){ + Set used = new HashSet<>(cache.keySet()); + OreDictHandler.cache.clear(); + for (String s : used) { + if (!OreDictionary.getOres(s).isEmpty()) { + ItemStack tmp = OreDictionary.getOres(s).get(0).copy(); + cache.put(s, new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage())); + } + } + } + public static ItemStack getItemStack(String elementName, OrePrefixes prefixes, int amount){ if (cache.get(prefixes+elementName.replaceAll(" ","")) != null){ - ItemStack tmp = cache.get(prefixes+elementName.replaceAll(" ","")).copy(); - tmp.stackSize=amount; - return tmp; + Pair p = cache.get(prefixes+elementName.replaceAll(" ","")); + return new ItemStack(Item.getItemById(p.getKey()),amount,p.getValue()); } else if (!OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).isEmpty()){ ItemStack tmp = OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).get(0).copy(); + cache.put(prefixes+elementName.replaceAll(" ",""),new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage())); tmp.stackSize=amount; - cache.put(prefixes+elementName.replaceAll(" ",""),tmp); return tmp; } return null; -- cgit From 3a88412bab88b2338ad76ebb78d8b1ea35b5eeea Mon Sep 17 00:00:00 2001 From: huajijam Date: Sun, 28 Apr 2019 12:35:43 +0800 Subject: update chinses translation and fix more bugssssss (#29) * fix a simple bug that i have never mind * update translation Former-commit-id: fc0087dc6a6794d611782199d6e5c50f3d1ffdeb --- src/main/resources/assets/bartworks/lang/zh_CN.lang | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index bd6200e2bb..29b66c2ebd 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -144,7 +144,7 @@ tile.radiohatch.name=放射仓 tile.bw.windmill.name=风车 tile.manutrafo.name=手动变压器 -tooltip.tile.htr.0.name=高温钍反应堆的控制器方块;大小(宽x高x长): 9x12x9 (中空);角落和两个相邻的方块是空气;一旦搭建,需要在输入仓中输入氦气,直到它不再接受;1+输出仓(任意底部机械方块);1+输入仓(任意顶部机械方块);1+输入总线(任意顶部机械方块);1x维护仓(任意机械方块);其余的为辐射防护机械方块;需要持续供应冷却液或将关机;需要至少100k燃料卵石才能开始工作(最多可使用675k个卵石);每次操作消耗1个燃料颗粒;TRISO卵石将提供30%的额外能量;每个卵石都会增加转换冷却剂的需求数量;一次工作耗时27个游戏天数 +tooltip.tile.htr.0.name=高温钍反应堆的控制器方块;大小(宽x高x长):11x12x11 (中空);控制器:正面中心,最低一层;角落和两个相邻的方块是空气;:一旦搭建完成,需要在输入仓中输入氦气直到不再接受;1+输出仓(任意底部机械方块);1+输入仓(任意顶部机械方块);1+输入总线(任意顶部机械方块);1x维护仓(任意机械方块);其余的为辐射防护机械方块;在运行时需要持续供应冷却液,完成工作后输出;需要至少100k卵石燃料才能开始工作(最多可使用675k个卵石);每次操作消耗1个燃料颗粒;TRISO卵石将提供30%的额外能量;每个卵石都会增加转换冷却剂的需求数量;一次工作耗时27个游戏日 item.TRISOPellet.name=TRISO卵石 item.TRISOPelletBall.name=TRISO卵石球 item.BISOPelletBall.name=BISO卵石球 @@ -153,8 +153,11 @@ item.TRISOPelletCompound.name=TRISO卵石复合材料 item.BISOPelletCompound.name=BISO卵石复合材料 itemGroup.bartworksMetaMaterials=BartWorks-meta材料 +tooltip.tile.eic.0.name=电气聚爆压缩机的控制器方块;大小(宽x高x长):3x9x3;使用电而不是爆炸物工作;控制器在第三层正面中心;第一到第九层为坚硬钢机械方块,每层中间为能量仓;第2,3,7,8层:中心为镍锌铁氧体方块,其余的为变压器线圈块;第4,5,6层为中子块;1+输入总线,1+输出总线,1个维护仓于坚硬钢机械方块;在操作过程中,请勿遮挡或挖掘移动方块,这会上演爆炸的艺术!! + + planet.Ross128b=罗斯128b moon.Ross128ba=罗斯128ba star.Ross128=罗斯128 solarsystem.Ross128System=罗斯128-行星系 -//This zh_CN.lang is translation by huajijam for bartworks (15/4/19) \ No newline at end of file +//This zh_CN.lang is translated by huajijam for bartworks (24/4/19) \ No newline at end of file -- cgit From 5f41aa8bd449c8c63fd899c6640468fe9d86dc9f Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 28 Apr 2019 22:13:13 +0200 Subject: Tooltip Server Synchronisation Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 1ce6237155c71ee8329f6302c82b357cc6432214 --- .../github/bartimaeusnek/bartworks/MainMod.java | 8 +-- .../ClientEventHandler/ClientEventHandler.java | 4 +- .../bartworks/common/net/BW_Network.java | 2 +- .../bartworks/common/net/OreDictCachePacket.java | 76 ++++++++++++++++++++++ .../server/EventHandler/ServerEventHandler.java | 41 ++++++++++++ .../bartworks/system/oredict/OreDictHandler.java | 19 +++++- 6 files changed, 141 insertions(+), 9 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 43b76254d2..da330424ee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -35,6 +35,7 @@ import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader; import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; +import com.github.bartimaeusnek.bartworks.server.EventHandler.ServerEventHandler; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -50,8 +51,6 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartedEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameData; -import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.SubTag; @@ -60,7 +59,6 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import org.apache.logging.log4j.LogManager; @@ -68,7 +66,6 @@ import org.apache.logging.log4j.Logger; import java.io.IOException; import java.util.HashSet; -import java.util.Iterator; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; @@ -133,6 +130,8 @@ public final class MainMod { public void init(FMLInitializationEvent init) { if (FMLCommonHandler.instance().getSide().isClient() && ConfigHandler.BioLab) MinecraftForge.EVENT_BUS.register(new ClientEventHandler()); + if (FMLCommonHandler.instance().getSide().isServer()) + MinecraftForge.EVENT_BUS.register(new ServerEventHandler()); new LoaderRegistry().run(); if (ConfigHandler.BioLab) new BioLabLoader().run(); @@ -158,7 +157,6 @@ public final class MainMod { WerkstoffLoader.INSTANCE.run(); } } - @Mod.EventHandler public void onServerStarted(FMLServerStartedEvent event) { OreDictHandler.adaptCacheForWorld(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java index 861b456fd9..f4c155d246 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java @@ -64,8 +64,8 @@ public class ClientEventHandler { ItemStack tmp = event.itemStack.copy(); Pair abstractedStack = new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); List tooAdd = new ArrayList<>(); - if (OreDictHandler.getCache().containsValue(abstractedStack)) { - for (Pair pair : OreDictHandler.getCache().values()) { + if (OreDictHandler.getNonBWCache().contains(abstractedStack)) { + for (Pair pair : OreDictHandler.getNonBWCache()) { if (pair.equals(abstractedStack)) { GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); if (UI == null) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index cca0c39712..277823b5f4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -59,7 +59,7 @@ public class BW_Network extends MessageToMessageCodec public BW_Network() { this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", new ChannelHandler[]{this, new HandlerShared()}); - this.mSubChannels = new GT_Packet[]{new RendererPacket(), new CircuitProgrammerPacket(), new OrePacket()}; + this.mSubChannels = new GT_Packet[]{new RendererPacket(), new CircuitProgrammerPacket(), new OrePacket(), new OreDictCachePacket()}; } protected void encode(ChannelHandlerContext aContext, GT_Packet aPacket, List aOutput) throws Exception { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java new file mode 100644 index 0000000000..d44fc42cce --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.net; + +import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; +import com.github.bartimaeusnek.bartworks.util.Pair; +import com.google.common.io.ByteArrayDataInput; +import gregtech.api.net.GT_Packet; +import net.minecraft.world.IBlockAccess; + +import java.nio.ByteBuffer; +import java.util.HashSet; + +public class OreDictCachePacket extends GT_Packet { + + + private HashSet> hashSet = new HashSet<>(); + + public OreDictCachePacket() { + super(true); + } + + public OreDictCachePacket(HashSet> set) { + super(false); + hashSet = set; + } + + @Override + public byte getPacketID() { + return 3; + } + + @Override + public byte[] encode() { + int size = this.hashSet.size(); + ByteBuffer buff = ByteBuffer.allocate(4+size*4+size*2).putInt(size); + for(Pair p : this.hashSet) + buff.putInt(p.getKey()).putShort(p.getValue()); + return buff.array(); + } + + @Override + public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { + int size = byteArrayDataInput.readInt(); + for (int i = 0; i < size; i++) { + this.hashSet.add(new Pair(byteArrayDataInput.readInt(),byteArrayDataInput.readShort())); + } + return new OreDictCachePacket(this.hashSet); + } + + @Override + public void process(IBlockAccess iBlockAccess) { + OreDictHandler.getNonBWCache().clear(); + OreDictHandler.getNonBWCache().addAll(this.hashSet); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java new file mode 100644 index 0000000000..9fc72b31cd --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.server.EventHandler; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.net.OreDictCachePacket; +import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; + +public class ServerEventHandler { + @SubscribeEvent(priority = EventPriority.LOWEST) + public void getTooltip(EntityJoinWorldEvent event) { + if (event == null || !(event.entity instanceof EntityPlayerMP) || !FMLCommonHandler.instance().getSide().isServer()) + return; + MainMod.BW_Network_instance.sendToPlayer(new OreDictCachePacket(OreDictHandler.getNonBWCache()), (EntityPlayerMP) event.entity); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java index d70bf884d2..fb13cc7c85 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java @@ -22,8 +22,12 @@ package com.github.bartimaeusnek.bartworks.system.oredict; +import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.util.Pair; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.OrePrefixes; +import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; @@ -35,18 +39,31 @@ import java.util.Set; public class OreDictHandler { private static final HashMap> cache = new HashMap<>(); + private static final HashSet> cacheNonBW = new HashSet<>(); public static HashMap> getCache() { return OreDictHandler.cache; } + public static HashSet> getNonBWCache(){ + return OreDictHandler.cacheNonBW; + } + public static void adaptCacheForWorld(){ Set used = new HashSet<>(cache.keySet()); OreDictHandler.cache.clear(); + OreDictHandler.cacheNonBW.clear(); for (String s : used) { if (!OreDictionary.getOres(s).isEmpty()) { ItemStack tmp = OreDictionary.getOres(s).get(0).copy(); - cache.put(s, new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage())); + Pair p = new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); + cache.put(s, p); + GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); + if (UI == null) + UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); + if (!UI.modId.equals(MainMod.MOD_ID) && !UI.modId.equals(BartWorksCrossmod.MOD_ID) && !UI.modId.equals("BWCore")){ + OreDictHandler.cacheNonBW.add(p); + } } } } -- cgit From c844dda23e1cff06f5c2517bf03bd11201549c11 Mon Sep 17 00:00:00 2001 From: Fabian Maurer Date: Sat, 4 May 2019 16:02:03 +0200 Subject: Add thaumcraft wand pedestal fix We only add the vis into the wand on the server, preventing vis duplication in SP. Former-commit-id: a426a31acbe75d3a2188ab7d9b82b45f9c5c75c8 --- .../bartimaeusnek/ASM/BWCoreTransformer.java | 46 +++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index bcc67b18d3..ce5ab6da40 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -39,12 +39,14 @@ public class BWCoreTransformer implements IClassTransformer { public static final String[] DESCRIPTIONFORCONFIG = { "REMOVING RAIN FROM LAST MILLENIUM (EXU)", "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", - "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS" + "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS", + "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", }; public static final String[] CLASSESBEEINGTRANSFORMED = { "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", "net.minecraft.client.renderer.RenderGlobal", + "thaumcraft.common.tiles.TileWandPedestal", }; public static boolean obfs = false; @@ -70,6 +72,30 @@ public class BWCoreTransformer implements IClassTransformer { // } // } + private static MethodNode transformThaumcraftWandPedestal(MethodNode method) { + InsnList nu = new InsnList(); + for (int j = 0; j < method.instructions.size(); j++) { + AbstractInsnNode instruction = method.instructions.get(j); + nu.add(instruction); + if (instruction.getOpcode() == INVOKEVIRTUAL) { + MethodInsnNode invokevirtual = (MethodInsnNode) instruction; + if (invokevirtual.name.equals("addVis")) { + AbstractInsnNode beginning = method.instructions.get(j - 7); + LabelNode label = new LabelNode(); + nu.insertBefore(beginning, new VarInsnNode(ALOAD, 0)); + nu.insertBefore(beginning, new FieldInsnNode(GETFIELD, "thaumcraft/common/tiles/TileWandPedestal", "field_145850_b" /*"worldObj"*/, "Lnet/minecraft/world/World;")); + nu.insertBefore(beginning, new FieldInsnNode(GETFIELD, "net/minecraft/world/World", "field_72995_K" /*"isRemote"*/, "Z")); + nu.insertBefore(beginning, new JumpInsnNode(IFNE, label)); + nu.add(new InsnNode(POP)); + nu.add(label); + j++; // Skip actual Pop + } + } + } + method.instructions = nu; + return method; + } + public static byte[] transform(int id, byte[] basicClass) { if (!BWCoreTransformer.shouldTransform[id]) { BWCore.BWCORE_LOG.info("Patch: " + DESCRIPTIONFORCONFIG[id] + " is disabled, will not patch!"); @@ -196,6 +222,24 @@ public class BWCoreTransformer implements IClassTransformer { } break; } + case 3: { + BWCore.BWCORE_LOG.info("Could find: " + CLASSESBEEINGTRANSFORMED[id]); + String name_deObfs = "updateEntity"; + String name_src = "func_145845_h"; + String name_Obfs = "h"; + String dsc_universal = "()V"; + + for (int i = 0; i < methods.size(); i++) { + if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal, dsc_universal)) { + BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); + MethodNode toPatch = methods.get(i); + toPatch = transformThaumcraftWandPedestal(toPatch); + methods.set(i, toPatch); + break; + } + } + break; + } default: { BWCore.BWCORE_LOG.info("Could not find: " + CLASSESBEEINGTRANSFORMED[id]); return basicClass; -- cgit From 52b2a4533d82a1b3051e9f790a1def9a09b05a8b Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 4 May 2019 17:10:51 +0200 Subject: smaller fixes Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 9ae4a938c305f96c15859edccb5b69baacc6599d --- .../classic/BW_TileEntity_LESU_Redux.java | 493 +++++++++++++++++++++ .../multis/GT_TileEntity_Windmill.java | 8 +- .../bartworks/system/oredict/OreDictHandler.java | 17 +- 3 files changed, 507 insertions(+), 11 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java new file mode 100644 index 0000000000..49cb2f30eb --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java @@ -0,0 +1,493 @@ +///* +// * Copyright (c) 2019 bartimaeusnek +// * +// * Permission is hereby granted, free of charge, to any person obtaining a copy +// * of this software and associated documentation files (the "Software"), to deal +// * in the Software without restriction, including without limitation the rights +// * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// * copies of the Software, and to permit persons to whom the Software is +// * furnished to do so, subject to the following conditions: +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// * SOFTWARE. +// */ +// +//package com.github.bartimaeusnek.bartworks.common.tileentities.classic; +// +//import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; +//import com.github.bartimaeusnek.bartworks.API.ITileDropsContent; +//import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; +//import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; +//import com.github.bartimaeusnek.bartworks.MainMod; +//import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +//import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +//import com.github.bartimaeusnek.bartworks.util.ConnectedBlocksChecker; +//import cpw.mods.fml.common.FMLCommonHandler; +//import cpw.mods.fml.relauncher.Side; +//import gregtech.api.interfaces.tileentity.IEnergyConnected; +//import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +//import gregtech.api.objects.XSTR; +//import net.minecraft.block.Block; +//import net.minecraft.client.renderer.texture.IIconRegister; +//import net.minecraft.entity.player.EntityPlayer; +//import net.minecraft.inventory.IInventory; +//import net.minecraft.item.ItemStack; +//import net.minecraft.tileentity.TileEntity; +//import net.minecraft.util.StatCollector; +//import net.minecraft.world.World; +//import net.minecraft.world.biome.BiomeGenBase; +//import net.minecraftforge.fluids.IFluidHandler; +// +//import java.nio.ByteBuffer; +//import java.util.ArrayList; +// +// +//public class BW_TileEntity_LESU_Redux extends TileEntity implements ITileHasDifferentTextureSides, ITileAddsInformation, ITileWithGUI, ITileDropsContent, IEnergyConnected { +// +// public ConnectedBlocksChecker connectedcells; +// public ItemStack[] circuits = new ItemStack[5]; +// private long[] storage; +// private long input; +// private long output; +// ByteBuffer eu; +// +// @Override +// public String[] getInfoData() { +// ArrayList e = new ArrayList<>(); +// String[] dsc = StatCollector.translateToLocal("tooltip.tile.lesu.0.name").split(";"); +// for (int i = 0; i < dsc.length; i++) { +// e.add(dsc[i]); +// } +// e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + ConfigHandler.energyPerCell + "EU"); +// dsc = StatCollector.translateToLocal("tooltip.tile.lesu.2.name").split(";"); +// for (int i = 0; i < dsc.length; i++) { +// e.add(dsc[i]); +// } +// e.add(ChatColorHelper.RED + StatCollector.translateToLocal("tooltip.tile.lesu.3.name")); +// e.add(StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"); +// return e.toArray(new String[0]); +// } +// +// @Override +// public void registerBlockIcons(IIconRegister par1IconRegister) { +// par1IconRegister.registerIcon(MainMod.MOD_ID + ":LESU_CASING_" + i); +// } +// +// @Override +// public int getGUIID() { +// return 0; +// } +// +// @Override +// public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { +// if (inputEnergyFrom(aSide)){ +// +// } +// return 0; +// } +// +// @Override +// public boolean inputEnergyFrom(byte b) { +// return true; +// } +// +// @Override +// public boolean outputsEnergyTo(byte b) { +// return false; +// } +// +// @Override +// public byte getColorization() { +// return 0; +// } +// +// @Override +// public byte setColorization(byte b) { +// return 0; +// } +// +// @Override +// public World getWorld() { +// return null; +// } +// +// @Override +// public int getXCoord() { +// return 0; +// } +// +// @Override +// public short getYCoord() { +// return 0; +// } +// +// @Override +// public int getZCoord() { +// return 0; +// } +// +// @Override +// public boolean isServerSide() { +// return !isClientSide(); +// } +// +// @Override +// public boolean isClientSide() { +// if (getWorld() != null) +// return getWorld().isRemote; +// return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; +// } +// +// @Override +// public int getRandomNumber(int i) { +// return new XSTR().nextInt(i); +// } +// +// @Override +// public TileEntity getTileEntity(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public TileEntity getTileEntityOffset(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public TileEntity getTileEntityAtSide(byte b) { +// return null; +// } +// +// @Override +// public TileEntity getTileEntityAtSideAndDistance(byte b, int i) { +// return null; +// } +// +// @Override +// public IInventory getIInventory(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public IInventory getIInventoryOffset(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public IInventory getIInventoryAtSide(byte b) { +// return null; +// } +// +// @Override +// public IInventory getIInventoryAtSideAndDistance(byte b, int i) { +// return null; +// } +// +// @Override +// public IFluidHandler getITankContainer(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public IFluidHandler getITankContainerOffset(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public IFluidHandler getITankContainerAtSide(byte b) { +// return null; +// } +// +// @Override +// public IFluidHandler getITankContainerAtSideAndDistance(byte b, int i) { +// return null; +// } +// +// @Override +// public IGregTechTileEntity getIGregTechTileEntity(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public IGregTechTileEntity getIGregTechTileEntityOffset(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public IGregTechTileEntity getIGregTechTileEntityAtSide(byte b) { +// return null; +// } +// +// @Override +// public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte b, int i) { +// return null; +// } +// +// @Override +// public Block getBlock(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public Block getBlockOffset(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public Block getBlockAtSide(byte b) { +// return null; +// } +// +// @Override +// public Block getBlockAtSideAndDistance(byte b, int i) { +// return null; +// } +// +// @Override +// public byte getMetaID(int i, int i1, int i2) { +// return 0; +// } +// +// @Override +// public byte getMetaIDOffset(int i, int i1, int i2) { +// return 0; +// } +// +// @Override +// public byte getMetaIDAtSide(byte b) { +// return 0; +// } +// +// @Override +// public byte getMetaIDAtSideAndDistance(byte b, int i) { +// return 0; +// } +// +// @Override +// public byte getLightLevel(int i, int i1, int i2) { +// return 0; +// } +// +// @Override +// public byte getLightLevelOffset(int i, int i1, int i2) { +// return 0; +// } +// +// @Override +// public byte getLightLevelAtSide(byte b) { +// return 0; +// } +// +// @Override +// public byte getLightLevelAtSideAndDistance(byte b, int i) { +// return 0; +// } +// +// @Override +// public boolean getOpacity(int i, int i1, int i2) { +// return false; +// } +// +// @Override +// public boolean getOpacityOffset(int i, int i1, int i2) { +// return false; +// } +// +// @Override +// public boolean getOpacityAtSide(byte b) { +// return false; +// } +// +// @Override +// public boolean getOpacityAtSideAndDistance(byte b, int i) { +// return false; +// } +// +// @Override +// public boolean getSky(int i, int i1, int i2) { +// return false; +// } +// +// @Override +// public boolean getSkyOffset(int i, int i1, int i2) { +// return false; +// } +// +// @Override +// public boolean getSkyAtSide(byte b) { +// return false; +// } +// +// @Override +// public boolean getSkyAtSideAndDistance(byte b, int i) { +// return false; +// } +// +// @Override +// public boolean getAir(int i, int i1, int i2) { +// return false; +// } +// +// @Override +// public boolean getAirOffset(int i, int i1, int i2) { +// return false; +// } +// +// @Override +// public boolean getAirAtSide(byte b) { +// return false; +// } +// +// @Override +// public boolean getAirAtSideAndDistance(byte b, int i) { +// return false; +// } +// +// @Override +// public BiomeGenBase getBiome() { +// return null; +// } +// +// @Override +// public BiomeGenBase getBiome(int i, int i1) { +// return null; +// } +// +// @Override +// public int getOffsetX(byte b, int i) { +// return 0; +// } +// +// @Override +// public short getOffsetY(byte b, int i) { +// return 0; +// } +// +// @Override +// public int getOffsetZ(byte b, int i) { +// return 0; +// } +// +// @Override +// public boolean isDead() { +// return false; +// } +// +// @Override +// public void sendBlockEvent(byte b, byte b1) { +// +// } +// +// @Override +// public long getTimer() { +// return 0; +// } +// +// @Override +// public void setLightValue(byte b) { +// +// } +// +// @Override +// public boolean isInvalidTileEntity() { +// return false; +// } +// +// @Override +// public boolean openGUI(EntityPlayer entityPlayer, int i) { +// return false; +// } +// +// @Override +// public boolean openGUI(EntityPlayer entityPlayer) { +// return false; +// } +// +// @Override +// public int[] getAccessibleSlotsFromSide(int p_94128_1_) { +// return new int[0]; +// } +// +// @Override +// public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) { +// return false; +// } +// +// @Override +// public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) { +// return false; +// } +// +// @Override +// public int getSizeInventory() { +// return 0; +// } +// +// @Override +// public ItemStack getStackInSlot(int p_70301_1_) { +// return null; +// } +// +// @Override +// public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { +// return null; +// } +// +// @Override +// public ItemStack getStackInSlotOnClosing(int p_70304_1_) { +// return null; +// } +// +// @Override +// public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { +// +// } +// +// @Override +// public String getInventoryName() { +// return null; +// } +// +// @Override +// public boolean hasCustomInventoryName() { +// return false; +// } +// +// @Override +// public int getInventoryStackLimit() { +// return 0; +// } +// +// @Override +// public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { +// return false; +// } +// +// @Override +// public void openInventory() { +// +// } +// +// @Override +// public void closeInventory() { +// +// } +// +// @Override +// public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { +// return false; +// } +// +// @Override +// public int[] getDropSlots() { +// return new int[0]; +// } +//} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 5cd012821c..a1b10d27a8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -236,17 +236,17 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { itemStack.stackSize -= 1; this.mMaxProgresstime = 60 * 20 * 100; if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L)); + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 12L)); else - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L)); + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 6L)); return true; } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log2)) { itemStack.stackSize -= 1; this.mMaxProgresstime = 60 * 20 * 100; if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L)); + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 12L)); else - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L)); + this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 6L)); return true; } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.pumpkin)) { itemStack.stackSize -= 1; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java index fb13cc7c85..77578b3c1c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java @@ -55,14 +55,17 @@ public class OreDictHandler { OreDictHandler.cacheNonBW.clear(); for (String s : used) { if (!OreDictionary.getOres(s).isEmpty()) { - ItemStack tmp = OreDictionary.getOres(s).get(0).copy(); - Pair p = new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); + ItemStack tmpstack = OreDictionary.getOres(s).get(0).copy(); + Pair p = new Pair<>(Item.getIdFromItem(tmpstack.getItem()), (short) tmpstack.getItemDamage()); cache.put(s, p); - GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); - if (UI == null) - UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); - if (!UI.modId.equals(MainMod.MOD_ID) && !UI.modId.equals(BartWorksCrossmod.MOD_ID) && !UI.modId.equals("BWCore")){ - OreDictHandler.cacheNonBW.add(p); + for (ItemStack tmp : OreDictionary.getOres(s)) { + Pair p2 = new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); + GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); + if (UI == null) + UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); + if (!UI.modId.equals(MainMod.MOD_ID) && !UI.modId.equals(BartWorksCrossmod.MOD_ID) && !UI.modId.equals("BWCore")) { + OreDictHandler.cacheNonBW.add(p2); + } } } } -- cgit From e054e77358c4ca1cd5f794274740c3200aed9940 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 4 May 2019 17:27:53 +0200 Subject: added ConfigOption for TC patch +added DeObfs instruction +code cleanup Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: d28147d803a8f97cf0d8ef07870f4e28691d7212 --- .../java/com/github/bartimaeusnek/ASM/BWCore.java | 5 +- .../bartimaeusnek/ASM/BWCoreTransformer.java | 57 ++++++++-------------- .../bartworks/common/configs/ConfigHandler.java | 6 +-- 3 files changed, 26 insertions(+), 42 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java index 031ff30512..b32537378c 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java @@ -60,13 +60,16 @@ public class BWCore extends DummyModContainer { public void preInit(FMLPreInitializationEvent event) { shouldTransform[0] = Loader.isModLoaded("ExtraUtilities") && ConfigHandler.enabledPatches[0]; shouldTransform[1] = Loader.isModLoaded("ExtraUtilities") && ConfigHandler.enabledPatches[1]; - BWCore.BWCORE_LOG.info("Extra Utilities found? " + shouldTransform[0]); + shouldTransform[3] = Loader.isModLoaded("Thaumcraft") && ConfigHandler.enabledPatches[3]; + BWCore.BWCORE_LOG.info("Extra Utilities found and ASM Patch enabled? " + shouldTransform[0]); + BWCore.BWCORE_LOG.info("Thaumcraft found and ASM Patch enabled? " + shouldTransform[3]); } @Override public List getDependants() { List ret = new ArrayList(); ret.add(new DefaultArtifactVersion("ExtraUtilities", true)); + ret.add(new DefaultArtifactVersion("Thaumcraft", true)); ret.add(new DefaultArtifactVersion(BartWorksCrossmod.MOD_ID, true)); return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index ce5ab6da40..1f2d6f942c 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -48,30 +48,13 @@ public class BWCoreTransformer implements IClassTransformer { "net.minecraft.client.renderer.RenderGlobal", "thaumcraft.common.tiles.TileWandPedestal", }; - public static boolean obfs = false; + static boolean obfs; - public static boolean[] shouldTransform = new boolean[CLASSESBEEINGTRANSFORMED.length]; - -// public void checkForMods() { -// //hacky way to detect if the mods are loaded -// try{ -// Class.forName("com.rwtema.extrautils.core.Tuple"); -// shouldTransform[0] = true; -// shouldTransform[1] = true; -// }catch (ClassNotFoundException e){ -// BWCore.BWCORE_LOG.info("Extra Utilities not found!"); -// shouldTransform[0] = false; -// shouldTransform[1] = false; -// } -// try{ -// Class.forName("micdoodle8.mods.galacticraft.core.Constants"); -// shouldTransform[2] = true; -// }catch (ClassNotFoundException e){ -// BWCore.BWCORE_LOG.info("micdoodle Core not found!"); -// shouldTransform[2] = false; -// } -// } + public static boolean[] shouldTransform = new boolean[BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length]; + /** + * Made by DarkShaddow44 + */ private static MethodNode transformThaumcraftWandPedestal(MethodNode method) { InsnList nu = new InsnList(); for (int j = 0; j < method.instructions.size(); j++) { @@ -83,8 +66,8 @@ public class BWCoreTransformer implements IClassTransformer { AbstractInsnNode beginning = method.instructions.get(j - 7); LabelNode label = new LabelNode(); nu.insertBefore(beginning, new VarInsnNode(ALOAD, 0)); - nu.insertBefore(beginning, new FieldInsnNode(GETFIELD, "thaumcraft/common/tiles/TileWandPedestal", "field_145850_b" /*"worldObj"*/, "Lnet/minecraft/world/World;")); - nu.insertBefore(beginning, new FieldInsnNode(GETFIELD, "net/minecraft/world/World", "field_72995_K" /*"isRemote"*/, "Z")); + nu.insertBefore(beginning, new FieldInsnNode(GETFIELD, "thaumcraft/common/tiles/TileWandPedestal", obfs ? "field_145850_b" : "worldObj", "Lnet/minecraft/world/World;")); + nu.insertBefore(beginning, new FieldInsnNode(GETFIELD, "net/minecraft/world/World", obfs ? "field_72995_K" : "isRemote", "Z")); nu.insertBefore(beginning, new JumpInsnNode(IFNE, label)); nu.add(new InsnNode(POP)); nu.add(label); @@ -98,19 +81,19 @@ public class BWCoreTransformer implements IClassTransformer { public static byte[] transform(int id, byte[] basicClass) { if (!BWCoreTransformer.shouldTransform[id]) { - BWCore.BWCORE_LOG.info("Patch: " + DESCRIPTIONFORCONFIG[id] + " is disabled, will not patch!"); + BWCore.BWCORE_LOG.info("Patch: " + BWCoreTransformer.DESCRIPTIONFORCONFIG[id] + " is disabled, will not patch!"); return basicClass; } if (id < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length) { - BWCore.BWCORE_LOG.info(DESCRIPTIONFORCONFIG[id]); + BWCore.BWCORE_LOG.info(BWCoreTransformer.DESCRIPTIONFORCONFIG[id]); ClassReader classReader = new ClassReader(basicClass); ClassNode classNode = new ClassNode(); classReader.accept(classNode, ClassReader.SKIP_FRAMES); List methods = classNode.methods; switch (id) { case 0: { - BWCore.BWCORE_LOG.info("Could find: " + CLASSESBEEINGTRANSFORMED[id]); + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); String name_deObfs = "canDoRainSnowIce"; String dsc_deObfs = "(Lnet/minecraft/world/chunk/Chunk;)Z"; @@ -138,7 +121,7 @@ public class BWCoreTransformer implements IClassTransformer { break; } case 1: { - BWCore.BWCORE_LOG.info("Could find: " + CLASSESBEEINGTRANSFORMED[id]); + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); String name_deObfs = "getPossibleCreatures"; String name_src = "func_73155_a"; String name_Obfs = "a"; @@ -168,7 +151,7 @@ public class BWCoreTransformer implements IClassTransformer { String dsc_universal = "(F)V"; String field_deObfs = "locationSunPng"; String field_src = "field_110928_i"; - BWCore.BWCORE_LOG.info("Could find: " + CLASSESBEEINGTRANSFORMED[id]); + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); for (int i = 0; i < methods.size(); i++) { MethodNode toPatch = methods.get(i); if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal)) { @@ -183,7 +166,7 @@ public class BWCoreTransformer implements IClassTransformer { String nameFieldToPatch; for (int j = 0; j < toPatch.instructions.size(); j++) { - if (toPatch.instructions.get(j) instanceof FieldInsnNode && ((FieldInsnNode) toPatch.instructions.get(j)).getOpcode() == GETSTATIC && !(nameFieldToPatch = ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j)).name, field_deObfs, field_src)).isEmpty()) { + if (toPatch.instructions.get(j) instanceof FieldInsnNode && toPatch.instructions.get(j).getOpcode() == GETSTATIC && !(nameFieldToPatch = ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j)).name, field_deObfs, field_src)).isEmpty()) { boolean useSrc = nameFieldToPatch.equals(field_src); if (useSrc) BWCore.BWCORE_LOG.info("Found either Optifine or Fastcraft... this patch was annoying to make compatible to them..."); @@ -208,9 +191,9 @@ public class BWCoreTransformer implements IClassTransformer { } else { if (j < toPatch.instructions.size() - 2) { - if (toPatch.instructions.get(j + 2) instanceof FieldInsnNode && ((FieldInsnNode) toPatch.instructions.get(j + 2)).getOpcode() == GETSTATIC && !ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j + 2)).name, field_deObfs, field_src).isEmpty()) + if (toPatch.instructions.get(j + 2) instanceof FieldInsnNode && toPatch.instructions.get(j + 2).getOpcode() == GETSTATIC && !ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j + 2)).name, field_deObfs, field_src).isEmpty()) continue; - if (toPatch.instructions.get(j + 1) instanceof FieldInsnNode && ((FieldInsnNode) toPatch.instructions.get(j + 1)).getOpcode() == GETSTATIC && !ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j + 1)).name, field_deObfs, field_src).isEmpty()) + if (toPatch.instructions.get(j + 1) instanceof FieldInsnNode && toPatch.instructions.get(j + 1).getOpcode() == GETSTATIC && !ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j + 1)).name, field_deObfs, field_src).isEmpty()) continue; } nu.add(toPatch.instructions.get(j)); @@ -223,7 +206,7 @@ public class BWCoreTransformer implements IClassTransformer { break; } case 3: { - BWCore.BWCORE_LOG.info("Could find: " + CLASSESBEEINGTRANSFORMED[id]); + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); String name_deObfs = "updateEntity"; String name_src = "func_145845_h"; String name_Obfs = "h"; @@ -232,16 +215,14 @@ public class BWCoreTransformer implements IClassTransformer { for (int i = 0; i < methods.size(); i++) { if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal, dsc_universal)) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); - MethodNode toPatch = methods.get(i); - toPatch = transformThaumcraftWandPedestal(toPatch); - methods.set(i, toPatch); + methods.set(i, BWCoreTransformer.transformThaumcraftWandPedestal(methods.get(i))); break; } } break; } default: { - BWCore.BWCORE_LOG.info("Could not find: " + CLASSESBEEINGTRANSFORMED[id]); + BWCore.BWCORE_LOG.info("Could not find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); return basicClass; } } @@ -251,7 +232,7 @@ public class BWCoreTransformer implements IClassTransformer { classNode.accept(classWriter); byte[] ret = classWriter.toByteArray(); if (Arrays.hashCode(basicClass) == Arrays.hashCode(ret)) - BWCore.BWCORE_LOG.warn("Could not patch: " + CLASSESBEEINGTRANSFORMED[id]); + BWCore.BWCORE_LOG.warn("Could not patch: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 669417a345..92aeef9c3f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -69,8 +69,8 @@ public class ConfigHandler { for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) { BWCoreTransformer.shouldTransform[i] = ConfigHandler.c.get("ASM fixes", BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i], true).getBoolean(true); } - enabledPatches = new boolean[BWCoreTransformer.shouldTransform.length]; - enabledPatches = Arrays.copyOf(BWCoreTransformer.shouldTransform,BWCoreTransformer.shouldTransform.length); + ConfigHandler.enabledPatches = new boolean[BWCoreTransformer.shouldTransform.length]; + ConfigHandler.enabledPatches = Arrays.copyOf(BWCoreTransformer.shouldTransform,BWCoreTransformer.shouldTransform.length); ConfigHandler.ross128BID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64); ConfigHandler.ross128BAID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128ba", -63, "The Dim ID for Ross128ba (Ross128b's Moon)").getInt(-63); @@ -83,7 +83,7 @@ public class ConfigHandler { ConfigHandler.c.save(); } - public static void setUpComments() { + private static void setUpComments() { ConfigHandler.c.addCustomCategoryComment("ASM fixes", "Disable ASM fixes here."); ConfigHandler.c.addCustomCategoryComment("Multiblocks", "Multliblock Options can be set here."); ConfigHandler.c.addCustomCategoryComment("Singleblocks", "Singleblock Options can be set here."); -- cgit From 4696d50469bcee79df3e397d34ac8fec9213432c Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 13 May 2019 04:35:37 +0200 Subject: added Miner Compability +tweaked heat values for GTNH +minor code changes Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 4f6fba852c442166ad52d3a8886d0fa825d7c667 --- build.properties | 2 +- .../bartworks/common/loaders/ItemRegistry.java | 53 +++++++++++----------- .../mega/GT_TileEntity_MegaBlastFurnace.java | 4 +- .../bartworks/system/material/WerkstoffLoader.java | 5 ++ .../crossmod/thaumcraft/tile/GT_WandBuffer.java | 42 +++++++++++++++++ 5 files changed, 76 insertions(+), 30 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java diff --git a/build.properties b/build.properties index 4f072d27ec..0db52c2a68 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=12 +buildNumber=13 APIVersion=6 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index e5db33bc5c..37e55107a7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -70,11 +70,11 @@ public class ItemRegistry { public static final Item WOOL_ROTOR = new BW_Stonage_Rotors(7, 0.18f, 10, 20, 1600, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorWool.png"), "BW_WoolRotor", "rotors/itemRotorWool"); public static final Item PAPER_ROTOR = new BW_Stonage_Rotors(9, 0.2f, 1, 10, 800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorPaper.png"), "BW_PaperRotor", "rotors/itemRotorPaper"); public static final Item COMBINED_ROTOR = new BW_Stonage_Rotors(11, 0.22f, 1, 50, 5800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorCombined.png"), "BW_CombinedRotor", "rotors/itemRotorCombined"); - public static final Item CRAFTING_PARTS = new SimpleSubItemClass(new String[]{"grindstone_top", "grindstone_bottom", "completed_grindstone", "rotors/leatherParts", "rotors/woolParts", "rotors/paperParts", "rotors/combinedParts"}); + public static final Item CRAFTING_PARTS = new SimpleSubItemClass("grindstone_top", "grindstone_bottom", "completed_grindstone", "rotors/leatherParts", "rotors/woolParts", "rotors/paperParts", "rotors/combinedParts"); public static final Item TAB = new SimpleIconItem("GT2Coin"); public static final Item WINDMETER = new BW_SimpleWindMeter(); public static final Block PUMPBLOCK = new BW_TileEntityContainer(Material.anvil, BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPump"); - public static final Item PUMPPARTS = new SimpleSubItemClass(new String[]{"BWrawtube", "BWmotor"}); + public static final Item PUMPPARTS = new SimpleSubItemClass("BWrawtube", "BWmotor"); public static final Block EXPPUMP = new BW_TileEntityContainer(Material.coral, BW_TileEntity_ExperimentalFloodGate.class, "ExpReversePump"); public static final Block[] bw_glasses = { @@ -138,27 +138,27 @@ public class ItemRegistry { public static void run() { if (newStuff) { - eic=new GT_TileEntity_ElectricImplosionCompressor(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6,"ElectricImplosionCompressor","Electric Implosion Compressor").getStackForm(1L); - thtr=new GT_TileEntity_THTR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5,"THTR","Thorium High Temperature Reactor").getStackForm(1L); + ItemRegistry.eic = new GT_TileEntity_ElectricImplosionCompressor(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, "ElectricImplosionCompressor", "Electric Implosion Compressor").getStackForm(1L); + ItemRegistry.thtr = new GT_TileEntity_THTR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, "THTR", "Thorium High Temperature Reactor").getStackForm(1L); GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials(); GameRegistry.registerBlock(ItemRegistry.bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses, "BW_FakeGlasBlock"); GT_OreDictUnificator.add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); - GameRegistry.registerBlock(BW_BLOCKS[2], BW_ItemBlocks.class, "BW_Machinery_Casings"); - GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(BW_BLOCKS[2])); - GameRegistry.registerItem(LEATHER_ROTOR, "BW_LeatherRotor"); - GameRegistry.registerItem(WOOL_ROTOR, "BW_WoolRotor"); - GameRegistry.registerItem(PAPER_ROTOR, "BW_PaperRotor"); - GameRegistry.registerItem(COMBINED_ROTOR, "BW_CombinedRotor"); - GameRegistry.registerItem(CRAFTING_PARTS, "craftingParts"); + GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[2], BW_ItemBlocks.class, "BW_Machinery_Casings"); + GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(ItemRegistry.BW_BLOCKS[2])); + GameRegistry.registerItem(ItemRegistry.LEATHER_ROTOR, "BW_LeatherRotor"); + GameRegistry.registerItem(ItemRegistry.WOOL_ROTOR, "BW_WoolRotor"); + GameRegistry.registerItem(ItemRegistry.PAPER_ROTOR, "BW_PaperRotor"); + GameRegistry.registerItem(ItemRegistry.COMBINED_ROTOR, "BW_CombinedRotor"); + GameRegistry.registerItem(ItemRegistry.CRAFTING_PARTS, "craftingParts"); GameRegistry.registerTileEntity(BW_RotorBlock.class, "BWRotorBlockTE"); - GameRegistry.registerBlock(ROTORBLOCK, BW_ItemBlocks.class, "BWRotorBlock"); + GameRegistry.registerBlock(ItemRegistry.ROTORBLOCK, BW_ItemBlocks.class, "BWRotorBlock"); GameRegistry.registerTileEntity(BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPumpTE"); - GameRegistry.registerBlock(PUMPBLOCK, BW_ItemBlocks.class, "BWHeatedWaterPumpBlock"); - GameRegistry.registerItem(PUMPPARTS, "BWPumpParts"); - GameRegistry.registerItem(WINDMETER, "BW_SimpleWindMeter"); + GameRegistry.registerBlock(ItemRegistry.PUMPBLOCK, BW_ItemBlocks.class, "BWHeatedWaterPumpBlock"); + GameRegistry.registerItem(ItemRegistry.PUMPPARTS, "BWPumpParts"); + GameRegistry.registerItem(ItemRegistry.WINDMETER, "BW_SimpleWindMeter"); GameRegistry.registerTileEntity(BW_TileEntity_ExperimentalFloodGate.class, "BWExpReversePump"); - GameRegistry.registerBlock(EXPPUMP, BW_ItemBlocks.class, "BWExpReversePumpBlock"); + GameRegistry.registerBlock(ItemRegistry.EXPPUMP, BW_ItemBlocks.class, "BWExpReversePumpBlock"); for (int i = 0; i < GT_Values.VN.length; i++) { ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "diode" + "2A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 2A " + GT_Values.VN[i], i).getStackForm(1L); ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "diode" + "4A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 4A " + GT_Values.VN[i], i).getStackForm(1L); @@ -171,22 +171,21 @@ public class ItemRegistry { for (int i = 0; i < 3; i++) { ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "acidgenerator" + GT_Values.VN[i + 2], StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[i + 2], i + 2).getStackForm(1); } - dehp = new GT_TileEntity_DEHP(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump").getStackForm(1L); - megaMachines[0] = new GT_TileEntity_MegaBlastFurnace(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, "MegaBlastFurnace", StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L); - megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, "MegaVacuumFreezer", StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L); -// new GT_TileEntity_ElectricImplosionCompressor(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 4, "Electric Implosion Compressor", "Electric Implosion Compressor"); + ItemRegistry.dehp = new GT_TileEntity_DEHP(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump").getStackForm(1L); + ItemRegistry.megaMachines[0] = new GT_TileEntity_MegaBlastFurnace(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, "MegaBlastFurnace", StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L); + ItemRegistry.megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, "MegaVacuumFreezer", StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L); } //GT2 stuff - GameRegistry.registerBlock(BW_BLOCKS[0], BW_ItemBlocks.class, "BW_ItemBlocks"); - GameRegistry.registerBlock(BW_BLOCKS[1], BW_ItemBlocks.class, "GT_LESU_CASING"); + GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[0], BW_ItemBlocks.class, "BW_ItemBlocks"); + GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[1], BW_ItemBlocks.class, "GT_LESU_CASING"); if (ConfigHandler.teslastaff) - GameRegistry.registerItem(TESLASTAFF, TESLASTAFF.getUnlocalizedName()); + GameRegistry.registerItem(ItemRegistry.TESLASTAFF, ItemRegistry.TESLASTAFF.getUnlocalizedName()); - GameRegistry.registerItem(ROCKCUTTER_LV, ROCKCUTTER_LV.getUnlocalizedName()); - GameRegistry.registerItem(ROCKCUTTER_MV, ROCKCUTTER_MV.getUnlocalizedName()); - GameRegistry.registerItem(ROCKCUTTER_HV, ROCKCUTTER_HV.getUnlocalizedName()); - GameRegistry.registerItem(TAB, "tabIconGT2"); + GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_LV, ItemRegistry.ROCKCUTTER_LV.getUnlocalizedName()); + GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_MV, ItemRegistry.ROCKCUTTER_MV.getUnlocalizedName()); + GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_HV, ItemRegistry.ROCKCUTTER_HV.getUnlocalizedName()); + GameRegistry.registerItem(ItemRegistry.TAB, "tabIconGT2"); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index b74b826da5..11588cc42f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -294,10 +294,10 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl internalH = 9001; break; case 7: - internalH = 12001; + internalH = 9901; break; case 8: - internalH = 15001; + internalH = 10801; break; default: break; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index e5848f2789..4d94bfa75b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -44,6 +44,7 @@ import gregtech.api.enums.*; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_MultiTexture; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.ItemData; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -606,6 +607,10 @@ public class WerkstoffLoader implements Runnable { GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.01"); + for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { + if (werkstoff.getGenerationFeatures().hasOres()) + GT_OreDictUnificator.setItemData(new ItemStack(WerkstoffLoader.BWOres,1,werkstoff.getmID()), new ItemData(ore,Materials._NULL)); + } } private void runAdditionalOreDict(){ diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java new file mode 100644 index 0000000000..c16398795e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.thaumcraft.tile; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicBatteryBuffer; + +public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { + public GT_WandBuffer(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) { + super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount); + } + + public GT_WandBuffer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) { + super(aName, aTier, aDescription, aTextures, aSlotCount); + } + + public GT_WandBuffer(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int aSlotCount) { + super(aName, aTier, aDescription, aTextures, aSlotCount); + } + + +} -- cgit From 143071f60e2666eff9a8645d8546303105fc4084 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 25 May 2019 21:37:30 +0200 Subject: fixed thorianit exploit +fixed yttrium oxide recipe +added thorium leaf recipe Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 1a76d7dcfa80617e9be58f914e3aeb01ba223e83 --- .../bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java | 13 ++++++++++++- .../bartworks/system/material/WerkstoffLoader.java | 3 ++- .../material/processingLoaders/AdditionalRecipes.java | 7 ++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index 39aae565bf..d760f09cea 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -22,15 +22,24 @@ package com.github.bartimaeusnek.bartworks.neiHandler; +import codechicken.nei.api.API; import codechicken.nei.api.IConfigureNEI; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import cpw.mods.fml.common.Optional; +import net.minecraft.item.ItemStack; +@Optional.Interface(iface = "codechicken.nei.api.API", modid = "NotEnoughItems") public class NEI_BW_Config implements IConfigureNEI { public static boolean sIsAdded = true; public void loadConfig() { + API.hideItem(new ItemStack(ItemRegistry.TAB)); + API.hideItem(new ItemStack(FluidLoader.bioFluidBlock)); + API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses)); sIsAdded = false; new BW_NEI_OreHandler(); new BW_NEI_BioVatHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BACTERIALVATBYTE)); @@ -38,11 +47,13 @@ public class NEI_BW_Config implements IConfigureNEI { sIsAdded = true; } + @Optional.Method(modid = "NotEnoughItems") public String getName() { return "BartWorks NEI Plugin"; } + @Optional.Method(modid = "NotEnoughItems") public String getVersion() { return MainMod.APIVERSION; } -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 4d94bfa75b..0570627797 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -292,8 +292,9 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff Thorianit = new Werkstoff( new short[]{0x30, 0x30, 0x30, 0}, "Thorianite", + new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().addChemicalRecipes(), + new Werkstoff.GenerationFeatures(), 18, TextureSet.SET_METALLIC, Arrays.asList(Materials.Thorium), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 667d44342e..799522d347 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -38,9 +39,12 @@ public class AdditionalRecipes implements Runnable { @Override public void run() { - GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(11),Materials.Oxygen.getGas(3000),null, WerkstoffLoader.YttriumOxide.get(dust),64, BW_Util.getMachineVoltageFromTier(4)); + //Cubic Circonia + GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(11),Materials.Oxygen.getGas(3000),null, WerkstoffLoader.YttriumOxide.get(dust,5),64, BW_Util.getMachineVoltageFromTier(4)); GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust,10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.Zirconia.get(gemFlawed, 40)}, (Object) null, (int[]) null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953); + //Thorium/Yttrium Glas GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall,2),WerkstoffLoader.Thorianit.get(dustSmall,2),Materials.Glass.getMolten(144),null,new ItemStack(ItemRegistry.bw_glasses[0],1,12),null,800,BW_Util.getMachineVoltageFromTier(5),3663); + //Thorianit recipes GT_Values.RA.addSifterRecipe(WerkstoffLoader.Thorianit.get(crushedPurified), new ItemStack[]{ WerkstoffLoader.Thorianit.get(dust), @@ -55,6 +59,7 @@ public class AdditionalRecipes implements Runnable { ); GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust),Materials.Aluminium.getDust(1),Materials.Thorium.getDust(1),1000); GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust),Materials.Magnesium.getDust(1),Materials.Thorium.getDust(1),1000); + GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(crushed), ItemList.Crop_Drop_Thorium.get(9),Materials.Water.getFluid(1000),Materials.Thorium.getMolten(144),WerkstoffLoader.Thorianit.get(crushedPurified,4),96,24); } } -- cgit From fc3c78ee94729fd57582e86fe2b0b9190df17924 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 27 May 2019 01:35:24 +0200 Subject: fixed 45% empty space Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 7be7d38b1d9160b2c4ee9411259bf3b04d582b1e --- build.properties | 2 +- .../bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java | 12 +++++++----- .../bartworks/system/oregen/BW_WordGenerator.java | 9 +++++++-- .../bartworks/system/oregen/BW_WorldGenRoss128b.java | 12 ++++++------ 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/build.properties b/build.properties index 0db52c2a68..e635ed9c51 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=13 +buildNumber=15 APIVersion=6 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java index d5d13aea13..1c4ffbb8cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java @@ -106,6 +106,8 @@ public abstract class BW_OreLayer extends GT_Worldgen { int cX = aChunkX - aRandom.nextInt(this.mSize); int eX = aChunkX + 16 + aRandom.nextInt(this.mSize); + boolean wasPlaced = false; + for (int tX = cX; tX <= eX; ++tX) { int cZ = aChunkZ - aRandom.nextInt(this.mSize); int eZ = aChunkZ + 16 + aRandom.nextInt(this.mSize); @@ -115,25 +117,25 @@ public abstract class BW_OreLayer extends GT_Worldgen { if (this.mSecondaryMeta > 0) { for (i = tMinY - 1; i < tMinY + 2; ++i) { if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { - this.setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false); + wasPlaced = this.setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false); } } } if (this.mBetweenMeta > 0 && (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) { - this.setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); + wasPlaced = this.setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); } if (this.mPrimaryMeta > 0) { for (i = tMinY + 3; i < tMinY + 6; ++i) { if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { - this.setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false); + wasPlaced = this.setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false); } } } if (this.mSporadicMeta > 0 && (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) { - this.setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); + wasPlaced = this.setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); } } } @@ -142,7 +144,7 @@ public abstract class BW_OreLayer extends GT_Worldgen { MainMod.LOGGER.info("Generated Orevein: " + this.mWorldGenName + " " + aChunkX + " " + aChunkZ); } - return true; + return wasPlaced; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java index 907f1eeaff..2cc26fe8cc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java @@ -104,9 +104,14 @@ public class BW_WordGenerator implements IWorldGenerator { tRandomWeight -= tWorldGen.mWeight; if (tRandomWeight <= 0) { try { - if (tWorldGen.executeWorldgen(this.mWorld, random, "", this.mDimensionType, xCenter, zCenter, this.mChunkGenerator, this.mChunkProvider)) { - temp = false; + boolean placed; + int attempts = 0; + do{ + placed = tWorldGen.executeWorldgen(this.mWorld, random, "", this.mDimensionType, xCenter, zCenter, this.mChunkGenerator, this.mChunkProvider); + ++attempts; } + while ((!placed) && attempts < 25); + temp = false; break; } catch (Throwable e) { e.printStackTrace(GT_Log.err); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index 95a69f00b0..6037349a51 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -49,13 +49,13 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { new BW_WorldGenRoss128b("ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, WerkstoffLoader.Thorianit, Materials.Uraninite, Materials.Lepidolite, Materials.Spodumene); new BW_WorldGenRoss128b("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Materials.Graphite, Materials.Diamond, Materials.Coal, Materials.Graphite); new BW_WorldGenRoss128b("ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, WerkstoffLoader.Bismuthinit, Materials.Stibnite, Materials.Bismuth, WerkstoffLoader.Bismutite); - new BW_WorldGenRoss128b("ore.mix.ross128.TurmalinAlkali", true, 5, 200, 15, 4, 48, WerkstoffLoader.Olenit, WerkstoffLoader.FluorBuergerit, WerkstoffLoader.ChromoAluminoPovondrait, WerkstoffLoader.VanadioOxyDravit); - new BW_WorldGenRoss128b("ore.mix.ross128.Roquesit", true, 5, 250, 3, 1, 12, WerkstoffLoader.Arsenopyrite, WerkstoffLoader.Ferberite, WerkstoffLoader.Loellingit, WerkstoffLoader.Roquesit); - new BW_WorldGenRoss128b("ore.mix.ross128.Tungstate", true, 5, 250, 10, 4, 14, WerkstoffLoader.Ferberite, WerkstoffLoader.Huebnerit, WerkstoffLoader.Loellingit, Materials.Scheelite); + new BW_WorldGenRoss128b("ore.mix.ross128.TurmalinAlkali", true, 5, 80, 15, 4, 48, WerkstoffLoader.Olenit, WerkstoffLoader.FluorBuergerit, WerkstoffLoader.ChromoAluminoPovondrait, WerkstoffLoader.VanadioOxyDravit); + new BW_WorldGenRoss128b("ore.mix.ross128.Roquesit", true, 30, 50, 3, 1, 12, WerkstoffLoader.Arsenopyrite, WerkstoffLoader.Ferberite, WerkstoffLoader.Loellingit, WerkstoffLoader.Roquesit); + new BW_WorldGenRoss128b("ore.mix.ross128.Tungstate", true, 5, 40, 10, 4, 14, WerkstoffLoader.Ferberite, WerkstoffLoader.Huebnerit, WerkstoffLoader.Loellingit, Materials.Scheelite); new BW_WorldGenRoss128b("ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, WerkstoffLoader.Djurleit, WerkstoffLoader.Bornite, WerkstoffLoader.Wittichenit, Materials.Tetrahedrite); - new BW_WorldGenRoss128b("ore.mix.ross128.Forsterit", true, 20, 180, 50, 2, 32, WerkstoffLoader.Forsterit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescloiziteCUVO4, WerkstoffLoader.DescloiziteZNVO4); - new BW_WorldGenRoss128b("ore.mix.ross128.Hedenbergit", true, 20, 180, 50, 2, 32, WerkstoffLoader.Hedenbergit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescloiziteCUVO4, WerkstoffLoader.DescloiziteZNVO4); - new BW_WorldGenRoss128b("ore.mix.ross128.RedZircon", true, 10, 40, 40, 3, 24, WerkstoffLoader.Fayalit,WerkstoffLoader.FuchsitAL , WerkstoffLoader.RedZircon,WerkstoffLoader.FuchsitCR); + new BW_WorldGenRoss128b("ore.mix.ross128.Forsterit", true, 20, 90, 50, 2, 32, WerkstoffLoader.Forsterit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescloiziteCUVO4, WerkstoffLoader.DescloiziteZNVO4); + new BW_WorldGenRoss128b("ore.mix.ross128.Hedenbergit", true, 20, 90, 50, 2, 32, WerkstoffLoader.Hedenbergit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescloiziteCUVO4, WerkstoffLoader.DescloiziteZNVO4); + new BW_WorldGenRoss128b("ore.mix.ross128.RedZircon", true, 10, 80, 40, 3, 24, WerkstoffLoader.Fayalit,WerkstoffLoader.FuchsitAL , WerkstoffLoader.RedZircon,WerkstoffLoader.FuchsitCR); } public static void init_undergroundFluidsRoss128() { -- cgit From dc0268bde0747c8371e1944c88d6454e7931fc0c Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 2 Jun 2019 15:18:24 +0200 Subject: Added config options -removed broken IC2 recipes Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 430abd84eab9bd6ec4f0cfc1c376c8afa81fb7f5 --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 8 +- .../ClientEventHandler/ClientEventHandler.java | 114 --------------------- .../ClientEventHandler/TooltipEventHandler.java | 114 +++++++++++++++++++++ .../bartworks/common/configs/ConfigHandler.java | 37 +++++-- .../bartworks/system/material/WerkstoffLoader.java | 35 +++++-- .../system/oregen/BW_WorldGenRoss128b.java | 23 +++-- .../galacticraft/UniversalTeleportType.java | 21 +++- .../planets/ross128b/ChunkProviderRoss128b.java | 3 +- .../solarsystems/Ross128SolarSystem.java | 2 +- 10 files changed, 207 insertions(+), 152 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java diff --git a/build.properties b/build.properties index e635ed9c51..9998e7ace1 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=15 +buildNumber=16 APIVersion=6 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index da330424ee..8bc304e41d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -25,7 +25,7 @@ package com.github.bartimaeusnek.bartworks; import com.github.bartimaeusnek.bartworks.API.API_REFERENCE; import com.github.bartimaeusnek.bartworks.API.BioObjectAdder; -import com.github.bartimaeusnek.bartworks.client.ClientEventHandler.ClientEventHandler; +import com.github.bartimaeusnek.bartworks.client.ClientEventHandler.TooltipEventHandler; import com.github.bartimaeusnek.bartworks.client.creativetabs.BioTab; import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab; @@ -128,8 +128,8 @@ public final class MainMod { @Mod.EventHandler public void init(FMLInitializationEvent init) { - if (FMLCommonHandler.instance().getSide().isClient() && ConfigHandler.BioLab) - MinecraftForge.EVENT_BUS.register(new ClientEventHandler()); + if (FMLCommonHandler.instance().getSide().isClient() && ConfigHandler.tooltips) + MinecraftForge.EVENT_BUS.register(new TooltipEventHandler()); if (FMLCommonHandler.instance().getSide().isServer()) MinecraftForge.EVENT_BUS.register(new ServerEventHandler()); new LoaderRegistry().run(); @@ -141,7 +141,6 @@ public final class MainMod { else WerkstoffLoader.INSTANCE.runInit(); } - } @Mod.EventHandler @@ -160,6 +159,7 @@ public final class MainMod { @Mod.EventHandler public void onServerStarted(FMLServerStartedEvent event) { OreDictHandler.adaptCacheForWorld(); + WerkstoffLoader.removeIC2Recipes(); if (eicMap == null) { eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); recipeLoop: diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java deleted file mode 100644 index f4c155d246..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.client.ClientEventHandler; - -import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; -import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; -import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import com.github.bartimaeusnek.bartworks.util.Pair; -import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.ModContainer; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.GT_Values; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraftforge.event.entity.player.ItemTooltipEvent; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -@SideOnly(Side.CLIENT) -public class ClientEventHandler { - - @SideOnly(Side.CLIENT) - @SubscribeEvent(priority = EventPriority.HIGHEST) - public void getTooltip(ItemTooltipEvent event) { - - if (event.itemStack == null || event.itemStack.getItem() == null) - return; - - if (TooltipCache.getTooltip(event.itemStack).isEmpty()) { - ItemStack tmp = event.itemStack.copy(); - Pair abstractedStack = new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); - List tooAdd = new ArrayList<>(); - if (OreDictHandler.getNonBWCache().contains(abstractedStack)) { - for (Pair pair : OreDictHandler.getNonBWCache()) { - if (pair.equals(abstractedStack)) { - GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); - if (UI == null) - UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); - if (UI != null) { - for (ModContainer modContainer : Loader.instance().getModList()) { - if (UI.modId.equals(MainMod.MOD_ID) || UI.modId.equals(BartWorksCrossmod.MOD_ID) || UI.modId.equals("BWCore")) - break; - if (UI.modId.equals(modContainer.getModId())) { - tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + ChatColorHelper.GRAY + " and " + ChatColorHelper.RED + modContainer.getName()); - } - } - } else - tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + ChatColorHelper.GRAY + " and another Mod, that doesn't use the ModContainer propperly!"); - } - } - } - - final Block BLOCK = Block.getBlockFromItem(event.itemStack.getItem()); - if (BLOCK != null && BLOCK != Blocks.air) { - if (BLOCK instanceof BW_Blocks) { - TooltipCache.put(event.itemStack, tooAdd); - return; - } - final BioVatLogicAdder.BlockMetaPair PAIR = new BioVatLogicAdder.BlockMetaPair(BLOCK, (byte) event.itemStack.getItemDamage()); - final HashMap GLASSMAP = BioVatLogicAdder.BioVatGlass.getGlassMap(); - if (GLASSMAP.containsKey(PAIR)) { - int tier = GLASSMAP.get(PAIR); - tooAdd.add( - StatCollector.translateToLocal("tooltip.glas.0.name") + - " " - + BW_ColorUtil.getColorForTier(tier) + GT_Values.VN[tier] + ChatColorHelper.RESET); - } else if (BLOCK.getMaterial().equals(Material.glass)) { - tooAdd.add(StatCollector.translateToLocal("tooltip.glas.0.name") + - " " - + BW_ColorUtil.getColorForTier(3) + GT_Values.VN[3] + ChatColorHelper.RESET); - } - } - - TooltipCache.put(event.itemStack, tooAdd); - event.toolTip.addAll(tooAdd); - } else { - event.toolTip.addAll(TooltipCache.getTooltip(event.itemStack)); - } - } -} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java new file mode 100644 index 0000000000..72c0db2735 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.client.ClientEventHandler; + +import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; +import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; +import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.Pair; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.GT_Values; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraftforge.event.entity.player.ItemTooltipEvent; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +@SideOnly(Side.CLIENT) +public class TooltipEventHandler { + + @SideOnly(Side.CLIENT) + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void getTooltip(ItemTooltipEvent event) { + + if (event == null || event.itemStack == null || event.itemStack.getItem() == null) + return; + + if (TooltipCache.getTooltip(event.itemStack).isEmpty()) { + ItemStack tmp = event.itemStack.copy(); + Pair abstractedStack = new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); + List tooAdd = new ArrayList<>(); + if (OreDictHandler.getNonBWCache().contains(abstractedStack)) { + for (Pair pair : OreDictHandler.getNonBWCache()) { + if (pair.equals(abstractedStack)) { + GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); + if (UI == null) + UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); + if (UI != null) { + for (ModContainer modContainer : Loader.instance().getModList()) { + if (UI.modId.equals(MainMod.MOD_ID) || UI.modId.equals(BartWorksCrossmod.MOD_ID) || UI.modId.equals("BWCore")) + break; + if (UI.modId.equals(modContainer.getModId())) { + tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + ChatColorHelper.GRAY + " and " + ChatColorHelper.RED + modContainer.getName()); + } + } + } else + tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + ChatColorHelper.GRAY + " and another Mod, that doesn't use the ModContainer propperly!"); + } + } + } + + final Block BLOCK = Block.getBlockFromItem(event.itemStack.getItem()); + if (BLOCK != null && BLOCK != Blocks.air) { + if (BLOCK instanceof BW_Blocks) { + TooltipCache.put(event.itemStack, tooAdd); + return; + } + final BioVatLogicAdder.BlockMetaPair PAIR = new BioVatLogicAdder.BlockMetaPair(BLOCK, (byte) event.itemStack.getItemDamage()); + final HashMap GLASSMAP = BioVatLogicAdder.BioVatGlass.getGlassMap(); + if (GLASSMAP.containsKey(PAIR)) { + int tier = GLASSMAP.get(PAIR); + tooAdd.add( + StatCollector.translateToLocal("tooltip.glas.0.name") + + " " + + BW_ColorUtil.getColorForTier(tier) + GT_Values.VN[tier] + ChatColorHelper.RESET); + } else if (BLOCK.getMaterial().equals(Material.glass)) { + tooAdd.add(StatCollector.translateToLocal("tooltip.glas.0.name") + + " " + + BW_ColorUtil.getColorForTier(3) + GT_Values.VN[3] + ChatColorHelper.RESET); + } + } + + TooltipCache.put(event.itemStack, tooAdd); + event.toolTip.addAll(tooAdd); + } else { + event.toolTip.addAll(TooltipCache.getTooltip(event.itemStack)); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 92aeef9c3f..c52c56b8c8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -29,27 +29,42 @@ import net.minecraftforge.common.config.Configuration; import java.util.Arrays; public class ConfigHandler { + private static final int IDU = 10 * 8 + 5; - public static int IDOffset = 12600; - public static boolean teslastaff; - public static long energyPerCell = 1000000L; - public static boolean newStuff = true; - public static boolean BioLab = true; public static Configuration c; - public static boolean DEHPDirectSteam; + + public static int IDOffset = 12600; public static int megaMachinesMax = 256; public static int mbWaterperSec = 150; public static int ross128BID = -64; public static int ross128BAID = -63; + public static int ross128btier = 3; + public static int ross128batier = 3; + public static int landerType = 3; + public static int ross128bRuinChance = 512; + + public static long energyPerCell = 1000000L; + + public static boolean newStuff = true; + public static boolean BioLab = true; public static boolean Ross128Enabled = true; - public static boolean debugLog; + + public static boolean DEHPDirectSteam; + public static boolean teslastaff; public static boolean experimentalThreadedLoader; public static boolean GTNH; public static boolean ezmode; - public static boolean[] enabledPatches ; + + //One-Side-Only + public static boolean debugLog; + public static boolean tooltips = true; + public static boolean[] enabledPatches; + + public ConfigHandler(Configuration C) { ConfigHandler.c = C; + ConfigHandler.tooltips = ConfigHandler.c.get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips").getBoolean(true); ConfigHandler.IDOffset = ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600); ConfigHandler.energyPerCell = ConfigHandler.c.get("Multiblocks", "energyPerLESUCell", 1000000, "This will set Up the Energy per LESU Cell", 1000000, Integer.MAX_VALUE).getInt(1000000); ConfigHandler.ezmode = ConfigHandler.c.get("System", "Mode switch", false, "If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false); @@ -74,9 +89,11 @@ public class ConfigHandler { ConfigHandler.ross128BID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64); ConfigHandler.ross128BAID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128ba", -63, "The Dim ID for Ross128ba (Ross128b's Moon)").getInt(-63); - + ConfigHandler.ross128btier = ConfigHandler.c.get("CrossMod Interactions", "Rocket Tier - Ross128b", 3, "The Rocket Tier for Ross128b").getInt(3); + ConfigHandler.ross128batier = ConfigHandler.c.get("CrossMod Interactions", "Rocket Tier - Ross128ba", 3, "The Rocket Tier for Ross128a").getInt(3); + ConfigHandler.ross128bRuinChance = ConfigHandler.c.get("CrossMod Interactions", "Ruin Chance - Ross128b", 512, "Higher Values mean lesser Ruins.").getInt(512); ConfigHandler.Ross128Enabled = ConfigHandler.c.get("CrossMod Interactions", "Galacticraft - Activate Ross128 System", true, "If the Ross128 System should be activated").getBoolean(true); - + ConfigHandler.landerType = ConfigHandler.c.get("CrossMod Interactions", "LanderType", 3, "1 = Moon Lander, 2 = Landing Balloons, 3 = Asteroid Lander").getInt(3); ConfigHandler.setUpComments(); if (ConfigHandler.c.hasChanged()) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 0570627797..cfbc3956d7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -45,20 +45,19 @@ import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_MultiTexture; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.ItemData; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.*; +import ic2.api.recipe.IRecipeInput; +import ic2.api.recipe.RecipeInputOreDict; +import ic2.api.recipe.RecipeOutput; +import ic2.api.recipe.Recipes; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; +import java.util.*; import static gregtech.api.enums.OrePrefixes.*; @@ -608,12 +607,32 @@ public class WerkstoffLoader implements Runnable { GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.01"); + runGTItemDataRegistrator(); + } + + public static void runGTItemDataRegistrator(){ for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { if (werkstoff.getGenerationFeatures().hasOres()) GT_OreDictUnificator.setItemData(new ItemStack(WerkstoffLoader.BWOres,1,werkstoff.getmID()), new ItemData(ore,Materials._NULL)); } } + public static void removeIC2Recipes() { + try { + Set> remset = new HashSet<>(); + for (Map.Entry curr : Recipes.macerator.getRecipes().entrySet()) { + if (curr.getKey() instanceof RecipeInputOreDict) { + if (((RecipeInputOreDict) curr.getKey()).input.equalsIgnoreCase("oreNULL")) { + remset.add(curr); + } + } + } + Recipes.macerator.getRecipes().entrySet().removeAll(remset); + }catch (Exception e){ + e.printStackTrace(); + } + } + private void runAdditionalOreDict(){ if (ConfigHandler.experimentalThreadedLoader){ for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index 6037349a51..7442a9a769 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -33,7 +33,8 @@ import net.minecraft.world.World; import net.minecraftforge.fluids.FluidRegistry; import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; - +import static gregtech.api.enums.Materials.*; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; public class BW_WorldGenRoss128b extends BW_OreLayer { @@ -46,16 +47,16 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { } public static void init_OresRoss128() { - new BW_WorldGenRoss128b("ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, WerkstoffLoader.Thorianit, Materials.Uraninite, Materials.Lepidolite, Materials.Spodumene); - new BW_WorldGenRoss128b("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Materials.Graphite, Materials.Diamond, Materials.Coal, Materials.Graphite); - new BW_WorldGenRoss128b("ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, WerkstoffLoader.Bismuthinit, Materials.Stibnite, Materials.Bismuth, WerkstoffLoader.Bismutite); - new BW_WorldGenRoss128b("ore.mix.ross128.TurmalinAlkali", true, 5, 80, 15, 4, 48, WerkstoffLoader.Olenit, WerkstoffLoader.FluorBuergerit, WerkstoffLoader.ChromoAluminoPovondrait, WerkstoffLoader.VanadioOxyDravit); - new BW_WorldGenRoss128b("ore.mix.ross128.Roquesit", true, 30, 50, 3, 1, 12, WerkstoffLoader.Arsenopyrite, WerkstoffLoader.Ferberite, WerkstoffLoader.Loellingit, WerkstoffLoader.Roquesit); - new BW_WorldGenRoss128b("ore.mix.ross128.Tungstate", true, 5, 40, 10, 4, 14, WerkstoffLoader.Ferberite, WerkstoffLoader.Huebnerit, WerkstoffLoader.Loellingit, Materials.Scheelite); - new BW_WorldGenRoss128b("ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, WerkstoffLoader.Djurleit, WerkstoffLoader.Bornite, WerkstoffLoader.Wittichenit, Materials.Tetrahedrite); - new BW_WorldGenRoss128b("ore.mix.ross128.Forsterit", true, 20, 90, 50, 2, 32, WerkstoffLoader.Forsterit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescloiziteCUVO4, WerkstoffLoader.DescloiziteZNVO4); - new BW_WorldGenRoss128b("ore.mix.ross128.Hedenbergit", true, 20, 90, 50, 2, 32, WerkstoffLoader.Hedenbergit, WerkstoffLoader.Fayalit, WerkstoffLoader.DescloiziteCUVO4, WerkstoffLoader.DescloiziteZNVO4); - new BW_WorldGenRoss128b("ore.mix.ross128.RedZircon", true, 10, 80, 40, 3, 24, WerkstoffLoader.Fayalit,WerkstoffLoader.FuchsitAL , WerkstoffLoader.RedZircon,WerkstoffLoader.FuchsitCR); + new BW_WorldGenRoss128b("ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, Thorianit, Uraninite, Lepidolite, Spodumene); + new BW_WorldGenRoss128b("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Graphite, Diamond, Coal, Graphite); + new BW_WorldGenRoss128b("ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, Bismuthinit, Stibnite, Bismuth, Bismutite); + new BW_WorldGenRoss128b("ore.mix.ross128.TurmalinAlkali", true, 5, 80, 15, 4, 48, Olenit, FluorBuergerit, ChromoAluminoPovondrait, VanadioOxyDravit); + new BW_WorldGenRoss128b("ore.mix.ross128.Roquesit", true, 30, 50, 3, 1, 12, Arsenopyrite, Ferberite, Loellingit, Roquesit); + new BW_WorldGenRoss128b("ore.mix.ross128.Tungstate", true, 5, 40, 10, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite); + new BW_WorldGenRoss128b("ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, Djurleit, Bornite, Wittichenit, Tetrahedrite); + new BW_WorldGenRoss128b("ore.mix.ross128.Forsterit", true, 20, 90, 50, 2, 32, Forsterit, Fayalit, DescloiziteCUVO4, DescloiziteZNVO4); + new BW_WorldGenRoss128b("ore.mix.ross128.Hedenbergit", true, 20, 90, 50, 2, 32, Hedenbergit, Fayalit, DescloiziteCUVO4, DescloiziteZNVO4); + new BW_WorldGenRoss128b("ore.mix.ross128.RedZircon", true, 10, 80, 40, 3, 24, Fayalit,FuchsitAL , RedZircon,FuchsitCR); } public static void init_undergroundFluidsRoss128() { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java index 742cee9a10..22e95e6d02 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java @@ -22,9 +22,13 @@ package com.github.bartimaeusnek.crossmod.galacticraft; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import micdoodle8.mods.galacticraft.api.vector.Vector3; import micdoodle8.mods.galacticraft.api.world.ITeleportType; +import micdoodle8.mods.galacticraft.core.entities.EntityLander; +import micdoodle8.mods.galacticraft.core.entities.EntityLanderBase; import micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats; +import micdoodle8.mods.galacticraft.planets.asteroids.entities.EntityEntryPod; import micdoodle8.mods.galacticraft.planets.mars.entities.EntityLandingBalloons; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayerMP; @@ -66,9 +70,22 @@ public class UniversalTeleportType implements ITeleportType { player.capabilities.isFlying = false; } - EntityLandingBalloons entityLandingBalloons = new EntityLandingBalloons(player); + EntityLanderBase elb; + + switch (ConfigHandler.landerType){ + case 1: + elb = new EntityLander(player); + break; + case 2: + elb = new EntityLandingBalloons(player); + break; + default: + elb = new EntityEntryPod(player); + break; + } + if (!newWorld.isRemote) { - newWorld.spawnEntityInWorld(entityLandingBalloons); + newWorld.spawnEntityInWorld(elb); } GCPlayerStats.get(player).teleportCooldown = 10; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index 0e7f7e28d1..483b8f5cf7 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WordGenerator; import com.github.bartimaeusnek.bartworks.system.worldgen.MapGenRuins; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; @@ -121,7 +122,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { int z1; if (biomegenbase != BiomeGenBase.ocean && biomegenbase != BiomeGenBase.deepOcean && biomegenbase != BiomeGenBase.river && biomegenbase != BiomeGenBase.frozenOcean && biomegenbase != BiomeGenBase.frozenRiver - && this.rand.nextInt(512) == 0) { + && this.rand.nextInt(ConfigHandler.ross128bRuinChance) == 0) { x1 = k + this.rand.nextInt(16) + 3; y1 = this.rand.nextInt(256); z1 = l + this.rand.nextInt(16) + 3; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index 7f9befe058..1634ca0f75 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -65,7 +65,7 @@ public class Ross128SolarSystem { Ross128SolarSystem.Ross128b.setRelativeOrbitTime(0.65F); Ross128SolarSystem.Ross128b.atmosphere.addAll(Arrays.asList(IAtmosphericGas.OXYGEN, IAtmosphericGas.NITROGEN, IAtmosphericGas.ARGON)); Ross128SolarSystem.Ross128b.setDimensionInfo(ConfigHandler.ross128BID, WorldProviderRoss128b.class); - Ross128SolarSystem.Ross128b.setTierRequired(3); + Ross128SolarSystem.Ross128b.setTierRequired(ConfigHandler.ross128btier); Ross128SolarSystem.Ross128ba = new Moon("Ross128ba").setParentPlanet(Ross128SolarSystem.Ross128b); Ross128SolarSystem.Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)).setRelativeOrbitTime(1 / 0.01F); -- cgit From ea461ff484bab83c577f481ad21a5c3a2b949acc Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 3 Jun 2019 01:58:17 +0200 Subject: fixed DEHP recipe Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: f33e956d64f45ddac25a7570fa23cdb954ca6864 --- .../bartworks/common/loaders/RecipeLoader.java | 13 ++++++++++++- .../bartworks/system/material/WerkstoffLoader.java | 9 +++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index ffcddc4706..7174c2176b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -234,7 +234,18 @@ public class RecipeLoader implements Runnable { } ); else - GT_Values.RA.addAssemblylineRecipe(ItemList.Pump_IV.get(1L), 72000, new ItemStack[]{ItemList.Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 32L), GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 32L), ItemList.Field_Generator_LuV.get(8)}, new FluidStack[]{Materials.SolderingAlloy.getMolten(32 * 144), Materials.Polytetrafluoroethylene.getMolten(32 * 144)}, ItemRegistry.dehp, 5000, BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addAssemblylineRecipe(ItemList.Pump_IV.get(1L), 72000, + new ItemStack[]{ + ItemList.Pump_IV.get(16), + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 32L), + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), + ItemList.Field_Generator_LuV.get(8) + }, + new FluidStack[]{ + Materials.SolderingAlloy.getMolten(32 * 144), + Materials.Polytetrafluoroethylene.getMolten(32 * 144) + }, ItemRegistry.dehp, 5000, BW_Util.getMachineVoltageFromTier(6)); GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1000), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[0], 72000, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1002), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[1], 72000, BW_Util.getMachineVoltageFromTier(3)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index cfbc3956d7..3f9113f07f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -460,6 +460,15 @@ public class WerkstoffLoader implements Runnable { 30, TextureSet.SET_METALLIC ); +// public static final Werkstoff BismuthTellurite = new Werkstoff( +// new short[]{0,64,0,0}, +// "Bismuth Tellurite", +// new Werkstoff.Stats().setElektrolysis(true).setToxic(true), +// Werkstoff.Types.COMPOUND, +// new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), +// 31, +// TextureSet.SET_METALLIC +// ); public static HashMap items = new HashMap<>(); public static Block BWOres; -- cgit From 30282fdd376f304bac02a6a53a1d852c5a8399a7 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 13 Jun 2019 21:40:53 +0200 Subject: Create FUNDING.yml Former-commit-id: f6d4d57ecee43f90e382ff796071ede24329345c --- .github/FUNDING.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000000..8b1d0623a8 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: bartimaeusnek +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL -- cgit From f70471bab9f21d9073aa184c23a10b3d04d604dd Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 12 Jul 2019 10:48:46 +0200 Subject: fixes +added sub/supercript numbers to Werkstoff +adjusted ElectricImplosionCompressor times +added "Creative Debug Scanner" for BlackFlame +added ingot/nuggets to Werkstoff +improved Generation Randomness of Ruins +fixed MegaEBF forming issues +added an Interface for the Radiation Hatch +minor API changes +added Tellurium Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: ea498532b67021650b60b739c10ae7bc120ba22a --- build.gradle | 1 + build.properties | 4 +- .../bartimaeusnek/ASM/BWCoreTransformer.java | 147 ++++++++++++++++++++- .../bartworks/API/BioObjectAdder.java | 7 + .../bartworks/API/BioObjectGetter.java | 8 +- .../bartworks/API/BioVatLogicAdder.java | 4 +- .../bartimaeusnek/bartworks/API/IRadMaterial.java | 48 +++++++ .../bartimaeusnek/bartworks/API/WerkstoffAPI.java | 34 +++++ .../github/bartimaeusnek/bartworks/MainMod.java | 30 ++--- .../bartworks/common/configs/ConfigHandler.java | 3 +- .../common/loaders/CircuitImprintLoader.java | 43 ++++++ .../bartworks/common/loaders/FluidLoader.java | 7 +- .../bartworks/common/loaders/ItemRegistry.java | 3 + .../common/tileentities/debug/CreativeScanner.java | 50 +++++++ .../multis/GT_TileEntity_CircuitAssemblyLine.java | 142 ++++++++++++++++++++ .../mega/GT_TileEntity_MegaBlastFurnace.java | 19 ++- .../tiered/GT_MetaTileEntity_RadioHatch.java | 19 +++ .../system/material/BW_MetaGeneratedOreTE.java | 3 +- .../system/material/BW_MetaGeneratedOre_Item.java | 16 +++ .../system/material/BW_MetaGenerated_Items.java | 56 +++++++- .../bartworks/system/material/Werkstoff.java | 45 ++++++- .../bartworks/system/material/WerkstoffLoader.java | 146 ++++++++++++++------ .../processingLoaders/AdditionalRecipes.java | 7 +- .../bartworks/system/object/AbstractedStack.java | 88 ++++++++++++ .../bartworks/system/worldgen/MapGenRuins.java | 16 ++- .../bartimaeusnek/bartworks/util/BW_Util.java | 137 +++++++++++++++++-- 26 files changed, 987 insertions(+), 96 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java diff --git a/build.gradle b/build.gradle index 42805998bb..e25c1e8bf7 100644 --- a/build.gradle +++ b/build.gradle @@ -37,6 +37,7 @@ targetCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = 1.8 targetCompatibility = 1.8 +compileJava.options.encoding = 'UTF-8' ext.configFile = file "build.properties" configFile.withReader { diff --git a/build.properties b/build.properties index 9998e7ace1..602e878c53 100644 --- a/build.properties +++ b/build.properties @@ -23,8 +23,8 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=16 -APIVersion=6 +buildNumber=18_pre2 +APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index 1f2d6f942c..d3e3eb727b 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -24,11 +24,13 @@ package com.github.bartimaeusnek.ASM; import net.minecraft.launchwrapper.IClassTransformer; import net.minecraft.launchwrapper.Launch; +import net.minecraftforge.oredict.OreDictionary; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.tree.*; import java.io.File; +import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.jar.JarFile; @@ -41,12 +43,14 @@ public class BWCoreTransformer implements IClassTransformer { "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS", "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", + // "ADD EXECTION HANDLEING TO FIND OREIDS/OREDICT" }; public static final String[] CLASSESBEEINGTRANSFORMED = { "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", "net.minecraft.client.renderer.RenderGlobal", "thaumcraft.common.tiles.TileWandPedestal", + // "net.minecraftforge.oredict.OreDictionary" }; static boolean obfs; @@ -221,6 +225,148 @@ public class BWCoreTransformer implements IClassTransformer { } break; } + case 4 : { + +// String name_deObfs = "getOreIDs"; +// String dsc_deObfs = "(Lnet/minecraft/item/ItemStack;)[I"; +// String dsc_Obfs = "(Ladd;)[I"; +// +// for (int i = 0; i < methods.size(); i++) { +// if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs) && ASMUtils.isCorrectMethod(methods.get(i), dsc_deObfs, dsc_Obfs)) { +// MethodNode toPatch = methods.get(i); +// LabelNode[] LabelNodes = {new LabelNode(), new LabelNode(), new LabelNode(),new LabelNode(),new LabelNode(),new LabelNode(),new LabelNode()}; +// InsnList nu = new InsnList(); +// nu.add(new VarInsnNode(ALOAD, 0)); +// nu.add(new JumpInsnNode(IFNULL, LabelNodes[0])); //L1 +// nu.add(new VarInsnNode(ALOAD, 0)); +// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false)); +// nu.add(new JumpInsnNode(IFNONNULL, LabelNodes[1])); //L2 +// nu.add(LabelNodes[0]); //L1 +// nu.add(new TypeInsnNode(NEW, "java/lang/IllegalArgumentException")); +// nu.add(new InsnNode(DUP)); +// nu.add(new TypeInsnNode(LDC,"Stack can not be invalid!")); +// nu.add(new MethodInsnNode(INVOKEVIRTUAL,"java/lang/IllegalArgumentException","","(Ljava/lang/String;)V",false)); +// nu.add(new InsnNode(ATHROW)); +// nu.add(LabelNodes[1]); //L2 +// nu.add(new TypeInsnNode(NEW, "java/util/HashSet")); +// nu.add(new InsnNode(DUP)); +// nu.add(new MethodInsnNode(INVOKEVIRTUAL,"java/util/HashSet","","()V",false)); +// nu.add(new VarInsnNode(ASTORE, 1)); +// nu.add(new VarInsnNode(ALOAD, 0)); +// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false)); +// nu.add(new FieldInsnNode(GETFIELD,"net/minecraft/item/Item","delegate","Lcpw/mods/fml/common/registry/RegistryDelegate;")); +// nu.add(new MethodInsnNode(INVOKEINTERFACE, "cpw/mods/fml/common/registry/RegistryDelegate", "name", "()Ljava/lang/String;", true)); +// nu.add(new VarInsnNode(ASTORE, 2)); +// nu.add(new VarInsnNode(ALOAD, 2)); +// nu.add(new JumpInsnNode(IFNONNULL, LabelNodes[2])); //L5 +// nu.add(new FieldInsnNode(GETSTATIC,"org/apache/logging/log4j/Level","DEBUG","Lorg/apache/logging/log4j/Level;")); +// nu.add(new TypeInsnNode(LDC,"Attempted to find the oreIDs for an unregistered object (%s). This won't work very well.")); +// nu.add(new InsnNode(ICONST_1)); +// nu.add(new TypeInsnNode(ANEWARRAY,"java/lang/Object")); +// nu.add(new InsnNode(DUP)); +// nu.add(new InsnNode(ICONST_0)); +// nu.add(new VarInsnNode(ALOAD, 0)); +// nu.add(new InsnNode(AASTORE)); +// nu.add(new MethodInsnNode(INVOKESTATIC, "cpw/mods/fml/common/FMLLog", "log", "(Lorg/apache/logging/log4j/Level;Ljava/lang/String;[Ljava/lang/Object;)V", false)); +// nu.add(new TypeInsnNode(NEW, "java/io/StringWriter")); +// nu.add(new InsnNode(DUP)); +// nu.add(new MethodInsnNode(INVOKESPECIAL, "java/io/StringWriter", "", "()V", false)); +// nu.add(new VarInsnNode(ASTORE, 4)); +// nu.add(new TypeInsnNode(NEW, "java/io/PrintWriter")); +// nu.add(new InsnNode(DUP)); +// nu.add(new VarInsnNode(ALOAD, 4)); +// nu.add(new MethodInsnNode(INVOKESPECIAL, "java/io/PrintWriter", "", "(Ljava/io/Writer;)V", false)); +// nu.add(new VarInsnNode(ASTORE, 5)); +// nu.add(new TypeInsnNode(NEW, "java/lang/Exception")); +// nu.add(new InsnNode(DUP)); +// nu.add(new TypeInsnNode(LDC,"FINDME!")); +// nu.add(new MethodInsnNode(INVOKESPECIAL, "java/lang/Exception", "", "(Ljava/lang/String;)V", false)); +// nu.add(new VarInsnNode(ALOAD, 5)); +// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "java/lang/Exception", "printStackTrace", "(Ljava/io/PrintWriter;)V", false)); +// nu.add(new FieldInsnNode(GETSTATIC,"org/apache/logging/log4j/Level","DEBUG","Lorg/apache/logging/log4j/Level;")); +// nu.add(new VarInsnNode(ALOAD, 5)); +// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "java/lang/Object", "toString", "()Ljava/lang/String;", false)); +// nu.add(new InsnNode(ICONST_0)); +// nu.add(new TypeInsnNode(ANEWARRAY,"java/lang/Object")); +// nu.add(new MethodInsnNode(INVOKESTATIC, "cpw/mods/fml/common/FMLLog", "log", "(Lorg/apache/logging/log4j/Level;Ljava/lang/String;[Ljava/lang/Object;)V", false)); +// nu.add(new InsnNode(ICONST_0)); +// nu.add(new IntInsnNode(NEWARRAY,T_INT)); +// nu.add(new InsnNode(ARETURN)); +// nu.add(LabelNodes[2]); //L5 +// nu.add(new MethodInsnNode(INVOKESTATIC, "cpw/mods/fml/common/registry/GameData", "getItemRegistry", "()Lcpw/mods/fml/common/registry/FMLControlledNamespacedRegistry;", false)); +// nu.add(new VarInsnNode(ALOAD, 2)); +// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry", "getId", "(Ljava/lang/String;)I", false)); +// nu.add(new VarInsnNode(ISTORE, 3)); +// nu.add(new FieldInsnNode(GETSTATIC,"net/minecraftforge/oredict/OreDictionary","stackToId","Ljava/util/Map;")); +// nu.add(new VarInsnNode(ILOAD, 3)); +// nu.add(new MethodInsnNode(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false)); +// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", false)); +// nu.add(new TypeInsnNode(CHECKCAST,"java/util/List")); +// nu.add(new VarInsnNode(ASTORE, 4)); +// nu.add(new VarInsnNode(ALOAD, 4)); +// nu.add(new JumpInsnNode(IFNULL, LabelNodes[3])); //L14 +// nu.add(new VarInsnNode(ALOAD, 1)); +// nu.add(new VarInsnNode(ALOAD, 4)); +// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Set", "addAll", "(Ljava/util/Collection;)Z", true)); +// nu.add(new InsnNode(POP)); +// nu.add(LabelNodes[3]); //L14 +// nu.add(new FieldInsnNode(GETSTATIC,"net/minecraftforge/oredict/OreDictionary","stackToId","Ljava/util/Map;")); +// nu.add(new VarInsnNode(ILOAD, 3)); +// nu.add(new VarInsnNode(ALOAD, 0)); +// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItemDamage", "()I", false)); +// nu.add(new InsnNode(ICONST_1)); +// nu.add(new InsnNode(IADD)); +// nu.add(new VarInsnNode(BIPUSH, 16)); +// nu.add(new InsnNode(ISHL)); +// nu.add(new InsnNode(IOR)); +// nu.add(new MethodInsnNode(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false)); +// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true)); +// nu.add(new TypeInsnNode(CHECKCAST,"java/util/List")); +// nu.add(new VarInsnNode(ASTORE, 4)); +// nu.add(new VarInsnNode(ALOAD, 4)); +// nu.add(new JumpInsnNode(IFNULL, LabelNodes[4])); //L16 +// nu.add(new VarInsnNode(ALOAD, 1)); +// nu.add(new VarInsnNode(ALOAD, 4)); +// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Set", "addAll", "(Ljava/util/Collection;)Z", true)); +// nu.add(new InsnNode(POP)); +// nu.add(LabelNodes[4]); //L16 +// nu.add(new VarInsnNode(ALOAD, 1)); +// nu.add(new VarInsnNode(ALOAD, 1)); +// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Set", "size", "()I", true)); +// nu.add(new TypeInsnNode(ANEWARRAY,"java/lang/Integer")); +// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Set", "toArray", "([Ljava/lang/Object;)[Ljava/lang/Object;", true)); +// nu.add(new TypeInsnNode(CHECKCAST,"[java/util/Integer")); +// nu.add(new VarInsnNode(ASTORE, 5)); +// nu.add(new VarInsnNode(ALOAD, 5)); +// nu.add(new InsnNode(ARRAYLENGTH)); +// nu.add(new IntInsnNode(NEWARRAY,T_INT)); +// nu.add(new VarInsnNode(ASTORE, 6)); +// nu.add(new InsnNode(ICONST_0)); +// nu.add(new VarInsnNode(ISTORE, 7)); +// nu.add(LabelNodes[6]); //L19 +// nu.add(new VarInsnNode(ILOAD, 7)); +// nu.add(new VarInsnNode(ALOAD, 5)); +// nu.add(new InsnNode(ARRAYLENGTH)); +// nu.add(new JumpInsnNode(IF_ICMPGE, LabelNodes[5])); //L20 +// nu.add(new VarInsnNode(ALOAD, 6)); +// nu.add(new VarInsnNode(ILOAD, 7)); +// nu.add(new VarInsnNode(ALOAD, 5)); +// nu.add(new VarInsnNode(ILOAD, 7)); +// nu.add(new InsnNode(AALOAD)); +// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "java/lang/Integer", "intValue", "()I", false)); +// nu.add(new InsnNode(IASTORE)); +// nu.add(new IincInsnNode(7,1)); +// nu.add(new JumpInsnNode(GOTO, LabelNodes[6])); //L19 +// nu.add(LabelNodes[5]); //L20 +// nu.add(new VarInsnNode(ALOAD, 6)); +// nu.add(new InsnNode(ARETURN)); +// toPatch.instructions = nu; +// toPatch.maxStack = 6; +// toPatch.maxLocals = 8; +// methods.set(i, toPatch); +// break; +// } + } default: { BWCore.BWCORE_LOG.info("Could not find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); return basicClass; @@ -233,7 +379,6 @@ public class BWCoreTransformer implements IClassTransformer { byte[] ret = classWriter.toByteArray(); if (Arrays.hashCode(basicClass) == Arrays.hashCode(ret)) BWCore.BWCORE_LOG.warn("Could not patch: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - return ret; } return basicClass; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java index 3dcd7596fb..a3c33ceac9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -26,9 +26,14 @@ import com.github.bartimaeusnek.bartworks.util.BioCulture; import com.github.bartimaeusnek.bartworks.util.BioDNA; import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; +import cpw.mods.fml.common.Loader; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; import gregtech.api.objects.GT_Fluid; +import gregtech.api.util.GT_Utility; import net.minecraft.item.EnumRarity; import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; import java.awt.*; @@ -158,11 +163,13 @@ public final class BioObjectAdder { * If you get NPE's related to BioCultures (most likely because of Load Order or creating BioCultures after the postinit Phase) execute this. */ public static void regenerateBioFluids() { + FluidStack dnaFluid = Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L); for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.getFluidNotSet()) { B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()})); if (!FluidRegistry.registerFluid(B.getFluid())) new Exception("FAILED TO REGISTER FLUID FOR: " + B.getName()).printStackTrace(); + GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(10),GT_Values.NI,new FluidStack(B.getFluid(),1000),dnaFluid,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,null,500,120); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java index 86ec61c138..edee87f534 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java @@ -43,11 +43,11 @@ public final class BioObjectGetter { } public static NBTTagCompound getNBTTagFromBioPlasmid(BioPlasmid bioPlasmid) { - return getNBTTagFromBioData(convertBioPlasmidToData(bioPlasmid)); + return BioObjectGetter.getNBTTagFromBioData(BioObjectGetter.convertBioPlasmidToData(bioPlasmid)); } public static NBTTagCompound getNBTTagFromBioDNA(BioDNA bioDNA) { - return getNBTTagFromBioData(convertBioDNAtoData(bioDNA)); + return BioObjectGetter.getNBTTagFromBioData(BioObjectGetter.convertBioDNAtoData(bioDNA)); } public static NBTTagCompound getNBTTagFromBioData(BioData bioData) { @@ -75,11 +75,11 @@ public final class BioObjectGetter { } public static BioPlasmid convertBioDNAtoBioPlasmid(BioDNA bioDNA) { - return convertDataToPlasmid(convertBioDNAtoData(bioDNA)); + return BioObjectGetter.convertDataToPlasmid(BioObjectGetter.convertBioDNAtoData(bioDNA)); } public static BioDNA convertBioPlasmidtoBioDNA(BioPlasmid bioPlasmid) { - return convertDataToDNA(convertBioPlasmidToData(bioPlasmid)); + return BioObjectGetter.convertDataToDNA(BioObjectGetter.convertBioPlasmidToData(bioPlasmid)); } public static Collection getAllPetriDishes() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java index 81b0d894af..a8fc8dae91 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -60,8 +60,10 @@ public final class BioVatLogicAdder { IsSv.put(stack, sv); } + public static int MaxSV = 150; + public static int getMaxSv() { - int ret = 150; + int ret = MaxSV; Iterator it = BioVatLogicAdder.RadioHatch.getMaSv().iterator(); while (it.hasNext()) { BioVatLogicAdder.MaterialSvPair pair = (BioVatLogicAdder.MaterialSvPair) it.next(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java new file mode 100644 index 0000000000..391593d217 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +import net.minecraft.item.ItemStack; + +public interface IRadMaterial { + + /** + * @return the amount of Radiation (0-150, commonly, higher values are possible but not recommended!) + */ + int getRadiationLevel(ItemStack aStack); + + /** + * @return 1 for stick, 2 for long rods, 3 for fuel rods + */ + byte getAmountOfMaterial(ItemStack aStack); + + /** + * @return the color of the material for display purposes + */ + short[] getColorForGUI(ItemStack aStack); + + /** + * @return the name of the material for display purposes + */ + String getNameForGUI(ItemStack aStack); +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java new file mode 100644 index 0000000000..a441e38e35 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; + +public final class WerkstoffAPI { + + public Werkstoff getWerkstoff(String aName) throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException { + Class w = Class.forName("com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader"); + return (Werkstoff) w.getField(aName).get(w); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 8bc304e41d..297abb2ca2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -30,10 +30,7 @@ import com.github.bartimaeusnek.bartworks.client.creativetabs.BioTab; import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; -import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader; -import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; -import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; +import com.github.bartimaeusnek.bartworks.common.loaders.*; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; import com.github.bartimaeusnek.bartworks.server.EventHandler.ServerEventHandler; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; @@ -160,8 +157,13 @@ public final class MainMod { public void onServerStarted(FMLServerStartedEvent event) { OreDictHandler.adaptCacheForWorld(); WerkstoffLoader.removeIC2Recipes(); + this.addElectricImplosionCompressorRecipes(); + new CircuitImprintLoader().run(); + } + + private void addElectricImplosionCompressorRecipes(){ if (eicMap == null) { - eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); + eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); recipeLoop: for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList) { if (recipe == null || recipe.mInputs == null) @@ -169,23 +171,20 @@ public final class MainMod { try { ItemStack input = recipe.mInputs[0]; int i = 0; - float durMod = 0; if (this.checkForExplosives(recipe.mInputs[1])) { - if (GT_Utility.areStacksEqual(recipe.mInputs[1], GT_ModHandler.getIC2Item("industrialTnt", 1L))) - durMod += ((float) input.stackSize * 2f); - else - continue; + continue; } while (this.checkForExplosives(input)) { - if (GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L))) - durMod += ((float) input.stackSize * 2f); + if (GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L))) { + i++; + input = recipe.mInputs[i]; + } else continue recipeLoop; - i++; - input = recipe.mInputs[i]; + } - eicMap.addRecipe(true, new ItemStack[]{input}, recipe.mOutputs, null, null, null, (int) Math.floor(Math.max((float) recipe.mDuration * durMod, 20f)), BW_Util.getMachineVoltageFromTier(10), 0); + eicMap.addRecipe(true, new ItemStack[]{input}, recipe.mOutputs, null, null, null, recipe.mDuration, BW_Util.getMachineVoltageFromTier(10), 0); } catch (ArrayIndexOutOfBoundsException e) { MainMod.LOGGER.error("CAUGHT DEFECTIVE IMPLOSION COMPRESSOR RECIPE!"); e.printStackTrace(); @@ -197,4 +196,5 @@ public final class MainMod { private boolean checkForExplosives(ItemStack input) { return (GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L)) || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); } + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index c52c56b8c8..3ecfd658b3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -42,6 +42,7 @@ public class ConfigHandler { public static int ross128batier = 3; public static int landerType = 3; public static int ross128bRuinChance = 512; + public static int creativeScannerID = 0; public static long energyPerCell = 1000000L; @@ -63,7 +64,7 @@ public class ConfigHandler { public ConfigHandler(Configuration C) { ConfigHandler.c = C; - + ConfigHandler.creativeScannerID = ConfigHandler.c.get("System", "Creative Debug Scanner", 0, "ID for the Creative Debug Scanner Block").getInt(0); ConfigHandler.tooltips = ConfigHandler.c.get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips").getBoolean(true); ConfigHandler.IDOffset = ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600); ConfigHandler.energyPerCell = ConfigHandler.c.get("Multiblocks", "energyPerLESUCell", 1000000, "This will set Up the Energy per LESU Cell", 1000000, Integer.MAX_VALUE).getInt(1000000); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java new file mode 100644 index 0000000000..97cc8e3c85 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.loaders; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.HashSet; + +public class CircuitImprintLoader implements Runnable { + + private static HashSet circuitTypes = new HashSet<>(); + + @Override + public void run() { + for(String names : OreDictionary.getOreNames()){ + if (names.contains("circuit") || names.contains("Circuit")) + for (ItemStack itemStack : OreDictionary.getOres(names)) + CircuitImprintLoader.circuitTypes.add(itemStack.copy().splitStack(1).writeToNBT(new NBTTagCompound())); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 1b56e588c5..8285eb9789 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -29,8 +29,12 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BWTileEnti import com.github.bartimaeusnek.bartworks.util.BioCulture; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; import gregtech.api.objects.GT_Fluid; +import gregtech.api.util.GT_Utility; import ic2.core.item.ItemFluidCell; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; @@ -70,11 +74,12 @@ public class FluidLoader implements Runnable { } // BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", BW_Util.splitColorToRBGArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB()))); - + FluidStack dnaFluid = Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L); for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.isBreedable()) { B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()})); FluidRegistry.registerFluid(B.getFluid()); + GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(10),GT_Values.NI,new FluidStack(B.getFluid(),1000),dnaFluid,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,null,500,120); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 37e55107a7..faf503d33f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -31,6 +31,7 @@ import com.github.bartimaeusnek.bartworks.common.items.*; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_ExperimentalFloodGate; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; +import com.github.bartimaeusnek.bartworks.common.tileentities.debug.CreativeScanner; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_DEHP; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; @@ -138,6 +139,8 @@ public class ItemRegistry { public static void run() { if (newStuff) { + if (ConfigHandler.creativeScannerID != 0) + new CreativeScanner(ConfigHandler.creativeScannerID,"ZPM Creative Debug Scanner","ZPM Creative Debug Scanner",7); ItemRegistry.eic = new GT_TileEntity_ElectricImplosionCompressor(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, "ElectricImplosionCompressor", "Electric Implosion Compressor").getStackForm(1L); ItemRegistry.thtr = new GT_TileEntity_THTR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, "THTR", "Thorium High Temperature Reactor").getStackForm(1L); GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java new file mode 100644 index 0000000000..323a009d0a --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.debug; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_Scanner; + +public class CreativeScanner extends GT_MetaTileEntity_Scanner { + public CreativeScanner(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier); + } + + public CreativeScanner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, aDescription, aTextures, aGUIName, aNEIName); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new CreativeScanner(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + this.setEUVar(this.maxEUStore()); + this.mProgresstime = this.mMaxProgresstime; + super.onPostTick(aBaseMetaTileEntity, aTick); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java new file mode 100644 index 0000000000..9b145f0123 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; + +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.util.GT_Recipe; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import java.util.Collection; + +public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBlockBase { + + private NBTTagCompound type; + private GT_Recipe bufferedRecipe = null; + + public GT_TileEntity_CircuitAssemblyLine(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_CircuitAssemblyLine(String aName) { + super(aName); + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + + return false; + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + type = aNBT.getCompoundTag("Type"); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setTag("Type",type); + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + if (type == null) + return false; + + if (bufferedRecipe != null && bufferedRecipe.isRecipeInputEqual(false,true,BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) + return true; + + ItemStack stack = ItemStack.loadItemStackFromNBT(type); + + if (stack == null) + return false; + + Collection recipes = null; + + for (GT_ItemStack GTitemstack : GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeItemMap.keySet()){ + if (GTitemstack.mItem.equals(stack.getItem()) && GTitemstack.mMetaData == (short) stack.getItemDamage()){ + recipes = GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeItemMap.get(GTitemstack); + break; + } + } + + if (recipes == null || recipes.isEmpty()) + return false; + + for (GT_Recipe recipe : recipes){ + if (recipe.isRecipeInputEqual(false,true,BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) + bufferedRecipe = recipe; + } + + + + return true; + } + + @Override + public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return false; + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 0; + } + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_CircuitAssemblyLine(this.mName); + } + + @Override + public String[] getDescription() { + return new String[0]; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + return new ITexture[0]; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 11588cc42f..13a94b30f0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.GregTech_API; @@ -42,6 +43,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import static gregtech.api.enums.GT_Values.V; @@ -94,6 +96,21 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return returnset.size() > 0 && !returnset.contains(false); } +// @Override +// public long getMaxInputVoltage() { +// long rVoltage = 0L; +// Iterator var3 = this.mEnergyHatches.iterator(); +// +// while(var3.hasNext()) { +// GT_MetaTileEntity_Hatch_Energy tHatch = (GT_MetaTileEntity_Hatch_Energy)var3.next(); +// if (isValidMetaTileEntity(tHatch)) { +// rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage(); +// } +// } +// //glass tier needs NBT persistance if this is enabled +// return glasTier != 8 && rVoltage > BW_Util.getTierVoltage(glasTier) ? BW_Util.getTierVoltage(glasTier) : rVoltage ; +// } + @Override public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = (ItemStack[]) this.getStoredInputs().toArray(new ItemStack[0]); @@ -223,7 +240,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { mHeatingCapacity = 0; HashSet ret = new HashSet(); - ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, -2, -1, GregTech_API.sBlockCasings1, 11, 7, 11)); + ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, -2, -1, GregTech_API.sBlockCasings1, 11, 7, false,false,true,GregTech_API.sBlockCasings1,11,true,11)); ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11)); ret.add(BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11)); for (int y = -1; y < 17; y++) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 63ba6660a1..1eab412c16 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.API.IRadMaterial; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; @@ -169,6 +170,24 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { if (lStack == null) return; + if (lStack.getItem() instanceof IRadMaterial) { + IRadMaterial material = ((IRadMaterial) lStack.getItem()); + int sv = material.getRadiationLevel(lStack); + if (sv > BioVatLogicAdder.RadioHatch.getMaxSv()) + BioVatLogicAdder.RadioHatch.MaxSV = sv; + if (this.mass == 0 || this.sievert == sv) { + if (this.mass < this.cap) { + this.mass = material.getAmountOfMaterial(lStack); + this.sievert = sv; + this.mInventory[0].stackSize--; + this.updateSlots(); + this.colorForGUI = material.getColorForGUI(lStack); + this.material = material.getNameForGUI(lStack); + return; + } + } + } + if (GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_4.get(1))) { Materials materials = Materials.Uranium; byte kg = 3; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index 81ab1e54b9..4418d72dbd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -29,6 +29,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ITexturedTileEntity; import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.common.blocks.GT_Block_Ores_Abstract; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -70,7 +71,7 @@ public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEn } public ArrayList getDrops(Block aDroppedOre) { - ArrayList rList = new ArrayList(); + ArrayList rList = new ArrayList(); if (this.mMetaData < 0) { rList.add(new ItemStack(Blocks.cobblestone, 1, 0)); return rList; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java index 46a9894572..6aa0ab1671 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java @@ -23,12 +23,18 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import java.util.ArrayList; +import java.util.List; + public class BW_MetaGeneratedOre_Item extends BW_ItemBlocks { public BW_MetaGeneratedOre_Item(Block par1) { @@ -47,6 +53,16 @@ public class BW_MetaGeneratedOre_Item extends BW_ItemBlocks { return GT_LanguageManager.getTranslation("bw.blockores.01." + aStack.getItemDamage() + ".name"); } + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + if (!GT_Utility.isStackValid(aStack) || aPlayer == null || aStack.getItemDamage() <= 0) + return; + if (aList == null) + aList = new ArrayList(); + aList.add(Werkstoff.werkstoffHashMap.get((short) aStack.getItemDamage()).getToolTip()); + } + public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { short tDamage = (short) getDamage(aStack); if (tDamage > 0) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 552548c4d6..3cbd78ac89 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.system.material; +import com.github.bartimaeusnek.bartworks.API.IRadMaterial; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; @@ -34,22 +35,31 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Item; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import ic2.core.IC2Potion; +import ic2.core.item.armor.ItemArmorHazmat; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; +import net.minecraft.world.World; import java.util.List; import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap; -public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item { +public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRadMaterial { public static final CreativeTabs metaTab = new CreativeTabs("bartworksMetaMaterials") { @@ -157,6 +167,27 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item { return werkstoff == null ? Materials._NULL.mRGBa : werkstoff.getRGBA(); } + @Override + public void onUpdate(ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) { + super.onUpdate(aStack, aWorld, aPlayer, aTimer, aIsInHand); + if (aStack == null || aStack.getItem() == null || !(aPlayer instanceof EntityLivingBase)) + return; + + EntityLivingBase bPlayer = (EntityPlayer) aPlayer; + Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage()); + if (w == null || w.getStats() == null) + return; + + if (w.getStats().isToxic() && !GT_Utility.isWearingFullBioHazmat(bPlayer)){ + bPlayer.addPotionEffect(new PotionEffect(Potion.poison.getId(),80,4)); + } + + if (w.getStats().isRadioactive() && !GT_Utility.isWearingFullRadioHazmat(bPlayer)){ + bPlayer.addPotionEffect(new PotionEffect(IC2Potion.radiation.id,80,4)); + } + + } + @Override public final IIcon getIconFromDamage(int aMetaData) { if (aMetaData < 0) @@ -174,4 +205,27 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item { public int getItemStackLimit(ItemStack aStack) { return 64; } + + @Override + public int getRadiationLevel(ItemStack aStack) { + Werkstoff w = Werkstoff.werkstoffHashMap.get((short)aStack.getItemDamage()); + return w.getStats().isRadioactive() ? (int) w.getStats().protons : 0; + } + + @Override + public byte getAmountOfMaterial(ItemStack aStack) { + return (byte) (this.orePrefixes == OrePrefixes.stick ? 1 : this.orePrefixes == OrePrefixes.stickLong ? 2 : 0); + } + + @Override + public short[] getColorForGUI(ItemStack aStack) { + Werkstoff w = Werkstoff.werkstoffHashMap.get((short)aStack.getItemDamage()); + return w.getRGBA(); + } + + @Override + public String getNameForGUI(ItemStack aStack) { + Werkstoff w = Werkstoff.werkstoffHashMap.get((short)aStack.getItemDamage()); + return w.getDefaultName(); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index a681a86270..754d07055f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MurmurHash3; import com.github.bartimaeusnek.bartworks.util.Pair; import gregtech.api.enums.*; @@ -108,10 +109,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (toolTip.isEmpty()) { for (Pair p : contents) { if (p.getKey() instanceof Materials) { - this.toolTip += ((Materials) p.getKey()).mChemicalFormula + (p.getValue() > 1 ? p.getValue() : ""); + this.toolTip += ((Materials) p.getKey()).mChemicalFormula + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } if (p.getKey() instanceof Werkstoff) - this.toolTip += ((Werkstoff) p.getKey()).toolTip + (p.getValue() > 1 ? p.getValue() : ""); + this.toolTip += ((Werkstoff) p.getKey()).toolTip + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } } else this.toolTip = toolTip; @@ -172,7 +173,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Pair[] getTCAspects(){ - return getTCAspects(1); + return this.getTCAspects(1); } public Werkstoff.Types getType() { @@ -317,7 +318,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { metal 10 gem 100 ore 1000 - cell 1000 + cell 10000 */ public byte toGenerate = 0b0001001; public byte blacklist; @@ -372,6 +373,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return (this.extraRecipes & 1) != 0; } + public Werkstoff.GenerationFeatures addMixerRecipes(){ + this.extraRecipes = (byte) (this.extraRecipes | 10); + return this; + } + public boolean hasMixerRecipes() { + return (this.extraRecipes & 10) != 0; + } + + public Werkstoff.GenerationFeatures addSifterRecipes(){ this.extraRecipes = (byte) (this.extraRecipes | 100); return this; @@ -381,7 +391,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.GenerationFeatures onlyDust() { - this.toGenerate = (byte) (1); + this.toGenerate = (byte) (0b1); + return this; + } + + public Werkstoff.GenerationFeatures addMetalItems() { + this.toGenerate = (byte) (this.toGenerate | 0b10); return this; } @@ -395,7 +410,6 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } - } public static class Stats { @@ -403,6 +417,25 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static final int NULL_KELVIN = 0; int boilingPoint; + + public int getBoilingPoint() { + return this.boilingPoint; + } + + public Stats setBoilingPoint(int boilingPoint) { + this.boilingPoint = boilingPoint; + return this; + } + + public int getMeltingPoint() { + return this.meltingPoint; + } + + public Stats setMeltingPoint(int meltingPoint) { + this.meltingPoint = meltingPoint; + return this; + } + int meltingPoint; long protons; long neutrons; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 3f9113f07f..1f494dffab 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -59,6 +59,8 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.*; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.subscriptNumbers; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.superscriptNumbers; import static gregtech.api.enums.OrePrefixes.*; public class WerkstoffLoader implements Runnable { @@ -117,7 +119,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff FluorBuergerit = new Werkstoff( new short[]{0x20, 0x20, 0x20, 0}, "Fluor-Buergerite", - "NaFe3Al6(Si6O18)(BO3)3O3F", + subscriptNumbers("NaFe3Al6(Si6O18)(BO3)3O3F"), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 5, @@ -144,7 +146,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff ChromoAluminoPovondrait = new Werkstoff( new short[]{0, 0x79, 0x6A, 0}, "Chromo-Alumino-Povondraite", - "NaCr3(Al4Mg2)(Si6O18)(BO3)3(OH)3O", + subscriptNumbers("NaCr3(Al4Mg2)(Si6O18)(BO3)3(OH)3O"), Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), @@ -162,7 +164,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff VanadioOxyDravit = new Werkstoff( new short[]{0x60, 0xA0, 0xA0, 0}, "Vanadio-Oxy-Dravite", - "NaV3(Al4Mg2)(Si6O18)(BO3)3(OH)3O", + subscriptNumbers("NaV3(Al4Mg2)(Si6O18)(BO3)3(OH)3O"), Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), @@ -180,7 +182,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff Olenit = new Werkstoff( new short[]{210, 210, 210, 0}, "Olenite", - "NaAl3Al6(Si6O18)(BO3)3O3OH", + subscriptNumbers("NaAl3Al6(Si6O18)(BO3)3O3OH"), Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), @@ -404,7 +406,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff DescloiziteCUVO4 = new Werkstoff( new short[]{0xf9,0x6d,0x18,0}, - "Orange Descolizite",//Pb(Zn,Cu)[OH|VO4 + "Orange Descloizite",//Pb(Zn,Cu)[OH|VO4 new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -419,7 +421,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff FuchsitAL = new Werkstoff( new short[]{0x4D,0x7F,0x64,0}, "Green Fuchsite", - "KAl3Si3O10(OH)2", + subscriptNumbers("KAl3Si3O10(OH)2"), new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -436,7 +438,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff FuchsitCR = new Werkstoff( new short[]{128,0,0,0}, "Red Fuchsite", - "KCr3Si3O10(OH)2", + subscriptNumbers("KCr3Si3O10(OH)2"), new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -453,22 +455,58 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff Thorium232 = new Werkstoff( new short[]{0,64,0,0}, "Thorium 232", - "Th232", + superscriptNumbers("Th232"), new Werkstoff.Stats().setRadioactive(true), Werkstoff.Types.ELEMENT, new Werkstoff.GenerationFeatures().disable().onlyDust(), 30, TextureSet.SET_METALLIC ); -// public static final Werkstoff BismuthTellurite = new Werkstoff( -// new short[]{0,64,0,0}, -// "Bismuth Tellurite", -// new Werkstoff.Stats().setElektrolysis(true).setToxic(true), -// Werkstoff.Types.COMPOUND, -// new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), -// 31, -// TextureSet.SET_METALLIC -// ); + public static final Werkstoff BismuthTellurite = new Werkstoff( + new short[]{32,72,32,0}, + "Bismuth Tellurite", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), + 31, + TextureSet.SET_METALLIC, + new Pair<>(Materials.Bismuth, 2), + new Pair<>(Materials.Tellurium, 3) + ); + public static final Werkstoff Tellurium = new Werkstoff( + new short[]{0xff,0xff,0xff,0}, + "Tellurium", + new Werkstoff.Stats(), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable().addMetalItems(), + 32, + TextureSet.SET_METALLIC, + new Pair<>(Materials.Tellurium, 1) + ); + public static final Werkstoff BismuthHydroBorat = new Werkstoff( + new short[]{72,144,72,0}, + "Dibismuthhydroborat", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), + 33, + TextureSet.SET_METALLIC, + new Pair<>(Materials.Bismuth, 2), + new Pair<>(Materials.Boron, 1), + new Pair<>(Materials.Hydrogen, 1) + ); + public static final Werkstoff ArInGaPhoBiBoTe = new Werkstoff( + new short[]{36,36,36,0}, + "Circuit Compound MK1", + new Werkstoff.Stats().setCentrifuge(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMixerRecipes(), + 34, + TextureSet.SET_METALLIC, + new Pair<>(Materials.IndiumGalliumPhosphide, 1), + new Pair<>(WerkstoffLoader.BismuthHydroBorat, 3), + new Pair<>(WerkstoffLoader.BismuthTellurite, 2) + ); public static HashMap items = new HashMap<>(); public static Block BWOres; @@ -575,6 +613,7 @@ public class WerkstoffLoader implements Runnable { werkstoff.getGenerationFeatures().setBlacklist(p); } toGenerateGlobal = (toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); + //System.out.println(werkstoff.getDefaultName()+": "+werkstoff.getGenerationFeatures().toGenerate); } if ((toGenerateGlobal & 0b1) != 0) { @@ -584,7 +623,7 @@ public class WerkstoffLoader implements Runnable { } if ((toGenerateGlobal & 0b10) != 0) { WerkstoffLoader.items.put(ingot, new BW_MetaGenerated_Items(ingot)); - + WerkstoffLoader.items.put(nugget, new BW_MetaGenerated_Items(nugget)); } if ((toGenerateGlobal & 0b100) != 0) { WerkstoffLoader.items.put(gem, new BW_MetaGenerated_Items(gem)); @@ -621,8 +660,7 @@ public class WerkstoffLoader implements Runnable { public static void runGTItemDataRegistrator(){ for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - if (werkstoff.getGenerationFeatures().hasOres()) - GT_OreDictUnificator.setItemData(new ItemStack(WerkstoffLoader.BWOres,1,werkstoff.getmID()), new ItemData(ore,Materials._NULL)); + GT_OreDictUnificator.addAssociation(ore,Materials._NULL,new ItemStack(WerkstoffLoader.BWOres,1,werkstoff.getmID()),true); } } @@ -652,7 +690,7 @@ public class WerkstoffLoader implements Runnable { } OreDictAdder.addToMap(new Pair<>("craftingIndustrialDiamond", WerkstoffLoader.Zirconia.get(gemExquisite))); - }else { + } else { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { if (werkstoff.getGenerationFeatures().hasOres()) GT_OreDictUnificator.registerOre(ore + werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.get(ore)); @@ -667,6 +705,7 @@ public class WerkstoffLoader implements Runnable { private void addGemRecipes(Werkstoff werkstoff) { if (werkstoff.getGenerationFeatures().hasGems()) { if (werkstoff.getGenerationFeatures().hasSifterRecipes() || ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0)) { + GT_Values.RA.addSifterRecipe( WerkstoffLoader.getCorresopndingItemStack(crushedPurified, werkstoff), new ItemStack[]{ @@ -684,16 +723,17 @@ public class WerkstoffLoader implements Runnable { 16 ); } + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemExquisite), werkstoff.get(dust, 4)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawless), werkstoff.get(dust, 2)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(gem), werkstoff.get(dust)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawed), werkstoff.get(dustSmall, 1)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemChipped), werkstoff.get(dustTiny)); - GT_ModHandler.addCraftingRecipe(werkstoff.get(gemFlawless,2),0,new Object[]{"h ", "W ",'W',werkstoff.get(gemExquisite)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(gem, 2),0,new Object[]{"h ", "W ",'W',werkstoff.get(gemFlawless)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(gemFlawed, 2),0,new Object[]{"h ", "W ",'W',werkstoff.get(gem)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(gemChipped, 2),0,new Object[]{"h ", "W ",'W',werkstoff.get(gemFlawed)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(gemFlawless, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gemExquisite)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(gem, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gemFlawless)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(gemFlawed, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gem)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(gemChipped, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gemFlawed)}); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemExquisite), werkstoff.get(gemFlawless, 2), 64, 16); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawless), werkstoff.get(gem, 2), 64, 16); @@ -708,22 +748,21 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addImplosionRecipe(werkstoff.get(dust, 4), 24, werkstoff.get(gem, 3), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)); - if ((werkstoff.getGenerationFeatures().toGenerate & 2) != 0){ - GT_Values.RA.addLatheRecipe(werkstoff.get(plate),werkstoff.get(lens),werkstoff.get(dustSmall), 1200, 120); + if ((werkstoff.getGenerationFeatures().toGenerate & 2) != 0) { + GT_Values.RA.addLatheRecipe(werkstoff.get(plate), werkstoff.get(lens), werkstoff.get(dustSmall), 1200, 120); } - GT_Values.RA.addLatheRecipe(werkstoff.get(gemExquisite),werkstoff.get(lens),werkstoff.get(dust,2), 2400, 30); + + GT_Values.RA.addLatheRecipe(werkstoff.get(gemExquisite), werkstoff.get(lens), werkstoff.get(dust, 2), 2400, 30); GregTech_API.registerCover(werkstoff.get(lens), new GT_MultiTexture(Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false)), new gregtech.common.covers.GT_Cover_Lens(BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(lens), werkstoff.get(dustSmall,3)); - // if (MainMod.GTNH) { - //Engraver Recipe adder - for (ItemStack is : OreDictionary.getOres("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) { - is.stackSize = 0; - GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemChipped, 3), is, werkstoff.get(gemFlawed, 1), 600, 30); - GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemFlawed, 3), is, werkstoff.get(gem, 1), 600, 120); - GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gem, 3), is, werkstoff.get(gemFlawless, 1), 1200, 480); - GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemFlawless, 3), is, werkstoff.get(gemExquisite, 1), 2400, 2000); - } -// } + GT_ModHandler.addPulverisationRecipe(werkstoff.get(lens), werkstoff.get(dustSmall, 3)); + + for (ItemStack is : OreDictionary.getOres("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) { + is.stackSize = 0; + GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemChipped, 3), is, werkstoff.get(gemFlawed, 1), 600, 30); + GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemFlawed, 3), is, werkstoff.get(gem, 1), 600, 120); + GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gem, 3), is, werkstoff.get(gemFlawless, 1), 1200, 480); + GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemFlawless, 3), is, werkstoff.get(gemExquisite, 1), 2400, 2000); + } } } @@ -788,6 +827,11 @@ public class WerkstoffLoader implements Runnable { stOutputs.add(Materials.Empty.getCells(cells)); GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0); } + if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { + if (cells > 0) + stOutputs.add(Materials.Empty.getCells(cells)); + GT_Recipe.GT_Recipe_Map.sMixerRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0); + } } GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff), new Object[]{ @@ -805,15 +849,19 @@ public class WerkstoffLoader implements Runnable { "T ", 'T', WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff) }); - if ((werkstoff.getGenerationFeatures().toGenerate & 2) != 0 && !werkstoff.getStats().isBlastFurnace()) { + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 && !werkstoff.getStats().isBlastFurnace()) { GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff), WerkstoffLoader.getCorresopndingItemStack(ingot, werkstoff)); GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorresopndingItemStack(dustTiny, werkstoff), WerkstoffLoader.getCorresopndingItemStack(nugget, werkstoff)); } + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0){ + GT_ModHandler.addPulverisationRecipe(werkstoff.get(ingot),werkstoff.get(dust)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(nugget),werkstoff.get(dustTiny)); + } } } private void addOreRecipes(Werkstoff werkstoff) { - if ((werkstoff.getGenerationFeatures().toGenerate & 2) != 0 && !werkstoff.getStats().isBlastFurnace()) + if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 &&!werkstoff.getStats().isBlastFurnace()) GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorresopndingItemStack(ore, werkstoff), WerkstoffLoader.getCorresopndingItemStack(ingot, werkstoff)); if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0) { @@ -833,6 +881,22 @@ public class WerkstoffLoader implements Runnable { if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) == 0 || (werkstoff.getGenerationFeatures().toGenerate & 0b1) == 0) return; + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 && !werkstoff.getStats().isBlastFurnace()) { + if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { + GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushed), werkstoff.get(nugget, 10)); + GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedPurified), werkstoff.get(nugget, 10)); + GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(nugget, 10)); + } + else { + GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushed), werkstoff.get(ingot)); + GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedPurified), werkstoff.get(ingot)); + GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(ingot)); + } + GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustImpure), werkstoff.get(ingot)); + GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustPure), werkstoff.get(ingot)); + GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); + } + GT_ModHandler.addCraftingRecipe(werkstoff.get(dustImpure),new Object[]{"h ", "W ",'W',werkstoff.get(crushed)}); GT_ModHandler.addCraftingRecipe(werkstoff.get(dustPure),new Object[]{"h ", "W ",'W',werkstoff.get(crushedPurified)}); GT_ModHandler.addCraftingRecipe(werkstoff.get(dust),new Object[]{"h ", "W ",'W',werkstoff.get(crushedCentrifuged)}); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 799522d347..a6345c8736 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -28,6 +28,8 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; @@ -60,6 +62,7 @@ public class AdditionalRecipes implements Runnable { GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust),Materials.Aluminium.getDust(1),Materials.Thorium.getDust(1),1000); GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust),Materials.Magnesium.getDust(1),Materials.Thorium.getDust(1),1000); GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(crushed), ItemList.Crop_Drop_Thorium.get(9),Materials.Water.getFluid(1000),Materials.Thorium.getMolten(144),WerkstoffLoader.Thorianit.get(crushedPurified,4),96,24); + //Tellurium + GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed,Materials.Lead,10L),GT_Utility.getIntegratedCircuit(17),GT_Values.NF,GT_Values.NF,Materials.Lead.getIngots(10),Materials.Tellurium.getNuggets(20),800,BW_Util.getMachineVoltageFromTier(2),722); } - -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java new file mode 100644 index 0000000000..a46b3b1067 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.object; + +import com.github.bartimaeusnek.bartworks.util.Pair; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import java.io.*; + +public class AbstractedStack implements Serializable { + + final Pair idDamage; + final NBTTagCompound mTag; + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof AbstractedStack)) return false; + + AbstractedStack that = (AbstractedStack) o; + + if (this.getIdDamage() != null ? !this.getIdDamage().equals(that.getIdDamage()) : that.getIdDamage() != null) + return false; + return this.getmTag() != null ? this.getmTag().equals(that.getmTag()) : that.getmTag() == null; + } + + @Override + public int hashCode() { + int result = this.getIdDamage() != null ? this.getIdDamage().hashCode() : 0; + result = 31 * result + (this.getmTag() != null ? this.getmTag().hashCode() : 0); + return result; + } + + public Pair getIdDamage() { + return this.idDamage; + } + + public NBTTagCompound getmTag() { + return this.mTag; + } + + public AbstractedStack(Pair idDamage, NBTTagCompound mTag) { + this.idDamage = idDamage; + this.mTag = mTag; + } + + public AbstractedStack(ItemStack itemStack) { + if (itemStack == null) + throw new UnsupportedOperationException(); + this.idDamage = new Pair(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage()); + this.mTag = itemStack.getTagCompound(); + } + + public byte[] serialize() throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + ObjectOutputStream os = new ObjectOutputStream(out); + os.writeObject(this); + return out.toByteArray(); + } + + public AbstractedStack deserialize(byte[] data) throws IOException, ClassNotFoundException, ClassCastException { + ByteArrayInputStream in = new ByteArrayInputStream(data); + ObjectInputStream is = new ObjectInputStream(in); + return (AbstractedStack) is.readObject(); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java index acd948dd19..841fe49b12 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java @@ -39,6 +39,8 @@ import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.ChestGenHooks; import net.minecraftforge.common.ForgeHooks; +import java.nio.ByteBuffer; +import java.security.SecureRandom; import java.util.Random; import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; @@ -114,7 +116,7 @@ public abstract class MapGenRuins extends WorldGenerator { } Random rand = new XSTR(rand1.nextLong()); - + SecureRandom secureRandom = new SecureRandom(); x=x+5; z=z+5; @@ -140,7 +142,7 @@ public abstract class MapGenRuins extends WorldGenerator { boolean useColor = rand.nextBoolean(); byte set = 0; byte toSet = (byte) (rand.nextInt(6-tier)+1); - short cablemeta = GT_WorldgenUtil.getCable(rand,tier); + short cablemeta = GT_WorldgenUtil.getCable(secureRandom,tier); byte treeinaRow = 0; boolean lastset = rand.nextBoolean(); for (int dx = -6; dx <= 6; dx++) { @@ -184,12 +186,12 @@ public abstract class MapGenRuins extends WorldGenerator { setBlock(worldObj,x + dx, y + dy, z + dz,Blocks.chest,5); IInventory chest = (IInventory)worldObj.getTileEntity(x + dx, y + dy, z + dz); if (chest != null) { - WeightedRandomChestContent.generateChestContents(rand, ChestGenHooks.getItems(PYRAMID_JUNGLE_CHEST, rand), chest, ChestGenHooks.getCount(PYRAMID_JUNGLE_CHEST, rand)); + WeightedRandomChestContent.generateChestContents(secureRandom, ChestGenHooks.getItems(PYRAMID_JUNGLE_CHEST, rand), chest, ChestGenHooks.getCount(PYRAMID_JUNGLE_CHEST, rand)); } } if (dx == 4 && dz==4) { - short meta = GT_WorldgenUtil.getGenerator(rand,tier); + short meta = GT_WorldgenUtil.getGenerator(secureRandom,tier); setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES,GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); BTE.setInitialValuesAsNBT(null,meta); @@ -199,7 +201,7 @@ public abstract class MapGenRuins extends WorldGenerator { } else if (dx == 3 && dz==4) { if (tier>0) { - short meta = GT_WorldgenUtil.getBuffer(rand, tier); + short meta = GT_WorldgenUtil.getBuffer(secureRandom, tier); setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); BTE.setInitialValuesAsNBT(null, meta); @@ -241,7 +243,7 @@ public abstract class MapGenRuins extends WorldGenerator { } else if (dx < 3 && dx > -5 && dz == 3 && set < toSet){ if (!lastset || treeinaRow > 2) { - short meta = GT_WorldgenUtil.getMachine(rand, tier); + short meta = GT_WorldgenUtil.getMachine(secureRandom, tier); setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); BTE.setInitialValuesAsNBT(null, meta); @@ -298,7 +300,7 @@ public abstract class MapGenRuins extends WorldGenerator { for (int dx = 2; dx > -5; dx--) { if (set < toSet){ if (!lastset || treeinaRow > 2 && worldObj.getTileEntity(x + dx, y + dy, z + dz) == null) { - short meta = GT_WorldgenUtil.getMachine(rand, tier); + short meta = GT_WorldgenUtil.getMachine(secureRandom, tier); setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); BTE.setInitialValuesAsNBT(null, meta); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index c775313f1a..64ea87132f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -27,6 +27,8 @@ import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; @@ -34,12 +36,10 @@ import net.minecraft.block.Block; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; import javax.annotation.Nonnegative; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; +import java.util.*; import java.util.function.UnaryOperator; import static gregtech.api.enums.GT_Values.V; @@ -50,6 +50,89 @@ public class BW_Util { public static final int CLEANROOM = -100; public static final int LOWGRAVITY = -200; + + public static String subscriptNumbers(String b){ + char[] chars = b.toCharArray(); + char[] nu = new char[chars.length]; + for (int i = 0; i < chars.length; i++) { + switch (chars[i]){ + case '0': nu[i] = '₀'; continue; + case '1': nu[i] = '₁'; continue; + case '2': nu[i] = '₂'; continue; + case '3': nu[i] = '₃'; continue; + case '4': nu[i] = '₄'; continue; + case '5': nu[i] = '₅'; continue; + case '6': nu[i] = '₆'; continue; + case '7': nu[i] = '₇'; continue; + case '8': nu[i] = '₈'; continue; + case '9': nu[i] = '₉'; continue; + default: nu[i] = chars[i]; + } + } + return new String(nu); + } + + public static String subscriptNumber(Number b){ + char[] chars = Long.toString(b.longValue()).toCharArray(); + char[] nu = new char[chars.length]; + for (int i = 0; i < chars.length; i++) { + switch (chars[i]){ + case '0': nu[i] = '₀'; continue; + case '1': nu[i] = '₁'; continue; + case '2': nu[i] = '₂'; continue; + case '3': nu[i] = '₃'; continue; + case '4': nu[i] = '₄'; continue; + case '5': nu[i] = '₅'; continue; + case '6': nu[i] = '₆'; continue; + case '7': nu[i] = '₇'; continue; + case '8': nu[i] = '₈'; continue; + case '9': nu[i] = '₉'; + } + } + return new String(nu); + } + + public static String superscriptNumbers(String b){ + char[] chars = b.toCharArray(); + char[] nu = new char[chars.length]; + for (int i = 0; i < chars.length; i++) { + switch (chars[i]){ + case '0': nu[i] = '⁰'; continue; + case '1': nu[i] = '¹'; continue; + case '2': nu[i] = '²'; continue; + case '3': nu[i] = '³'; continue; + case '4': nu[i] = '⁴'; continue; + case '5': nu[i] = '⁵'; continue; + case '6': nu[i] = '⁶'; continue; + case '7': nu[i] = '⁷'; continue; + case '8': nu[i] = '⁸'; continue; + case '9': nu[i] = '⁹'; continue; + default: nu[i] = chars[i]; + } + } + return new String(nu); + } + + public static String superscriptNumber(Number b){ + char[] chars = Long.toString(b.longValue()).toCharArray(); + char[] nu = new char[chars.length]; + for (int i = 0; i < chars.length; i++) { + switch (chars[i]){ + case '0': nu[i] = '⁰'; continue; + case '1': nu[i] = '¹'; continue; + case '2': nu[i] = '²'; continue; + case '3': nu[i] = '³'; continue; + case '4': nu[i] = '⁴'; continue; + case '5': nu[i] = '⁵'; continue; + case '6': nu[i] = '⁶'; continue; + case '7': nu[i] = '⁷'; continue; + case '8': nu[i] = '⁸'; continue; + case '9': nu[i] = '⁹'; + } + } + return new String(nu); + } + public static byte specialToByte(int aSpecialValue) { byte special = 0; if (aSpecialValue == (CLEANROOM)) @@ -95,6 +178,10 @@ public class BW_Util { return (int) (30 * Math.pow(4, (tier - 1))); } + public static int getTierVoltage(int tier) { + return 8 << (2*tier); + } + public static boolean areStacksEqual(ItemStack aStack1, ItemStack aStack2) { return (aStack1 == null && aStack2 == null) || GT_Utility.areStacksEqual(aStack1, aStack2); } @@ -191,7 +278,7 @@ public class BW_Util { while (var3.hasNext()) { GT_MetaTileEntity_Hatch_Energy tHatch = (GT_MetaTileEntity_Hatch_Energy) var3.next(); - if (base.isValidMetaTileEntity(tHatch)) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { if (rVoltage == 0 || rVoltage > tHatch.getBaseMetaTileEntity().getInputVoltage()) rVoltage = tHatch.getBaseMetaTileEntity().getInputVoltage(); rAmperage += tHatch.getBaseMetaTileEntity().getInputAmperage(); @@ -201,6 +288,22 @@ public class BW_Util { return rVoltage * rAmperage; } + public static FluidStack[] getFluidsFromInputHatches(GT_MetaTileEntity_MultiBlockBase aBaseMetaTileEntity){ + ArrayList tmp = new ArrayList<>(); + for (GT_MetaTileEntity_Hatch_Input fip : aBaseMetaTileEntity.mInputHatches){ + tmp.add(fip.getFluid()); + } + return (FluidStack[]) tmp.toArray(); + } + public static ItemStack[] getItemsFromInputBusses(GT_MetaTileEntity_MultiBlockBase aBaseMetaTileEntity){ + ArrayList tmp = new ArrayList<>(); + for (GT_MetaTileEntity_Hatch_InputBus fip : aBaseMetaTileEntity.mInputBusses){ + tmp.addAll(Arrays.asList(fip.mInventory)); + } + return (ItemStack[]) tmp.toArray(); + } + + public static EnumRarity getRarityFromByte(byte b) { switch (b) { case 1: @@ -216,23 +319,23 @@ public class BW_Util { public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean insideCheck, Block inside, int dmginside, int aBaseCasingIndex) { - return check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, insideCheck, inside, dmginside, aBaseCasingIndex); + return BW_Util.check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, insideCheck, inside, dmginside, aBaseCasingIndex); } public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, int aBaseCasingIndex) { - return check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, aBaseCasingIndex); + return BW_Util.check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, aBaseCasingIndex); } public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, int aBaseCasingIndex) { - return check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, false, aBaseCasingIndex); + return BW_Util.check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, false, aBaseCasingIndex); } public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, int aBaseCasingIndex) { - return check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, freeCorners, false, block, dmg, true, aBaseCasingIndex); + return BW_Util.check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, freeCorners, false, block, dmg, true, aBaseCasingIndex); } public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean insideCheck, Block inside, int dmginside, int aBaseCasingIndex) { - return check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, false, insideCheck, inside, dmginside, true, aBaseCasingIndex); + return BW_Util.check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, false, insideCheck, inside, dmginside, true, aBaseCasingIndex); } /** @@ -260,10 +363,20 @@ public class BW_Util { continue; if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) continue; - if (insideCheck && (Math.abs(x) < radius && Math.abs(z) != radius)) + if (insideCheck && (Math.abs(x) < radius && Math.abs(z) != radius)) { if (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside) || (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside && dmginside > (-1))) { - return false; + if (!(allowHatches && ( + ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addDynamoToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || + ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || + ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || + ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || + ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || + ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) + ))) { + return false; + } } + } if (((!(Math.abs(x) < radius && Math.abs(z) != radius))) && (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) || (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmg && dmg > (-1)))) { if (!(allowHatches && ( ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addDynamoToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || -- cgit From 9a65150aaab8c3fdec2e173946a5836ad7a63135 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 16 Jul 2019 12:57:19 +0200 Subject: added GT++ compat, fixed bugs, improved code +added qualifiers to a lot of stuff, +wrote a GT++ compat for the radio hatch +fixed a typo in he bacterial vat description +made the bio vat loose his output when sv arent delivered though the whole process +hopefully fixed the stackoverflow for ores +buffed output on siftable ores +made my werkstoffsystem work with the biovat Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 1f414f3ebc7b214f85c89e1cd597910d4dfec2f1 --- build.properties | 2 +- .../gui/BW_GUIContainer_HeatedWaterPump.java | 6 +- .../client/gui/BW_GUIContainer_RadLevel.java | 15 +- .../gui/GT_GUIContainer_CircuitProgrammer.java | 4 +- .../client/gui/GT_GUIContainer_Destructopack.java | 4 +- .../bartworks/client/gui/GT_GUIContainer_LESU.java | 8 +- .../client/gui/GT_GUIContainer_RadioHatch.java | 20 +- .../tileentities/multis/GT_TileEntity_BioVat.java | 27 ++- .../tiered/GT_MetaTileEntity_RadioHatch.java | 31 ++- .../bartworks/system/material/WerkstoffLoader.java | 2 +- .../bartworks/system/oregen/BW_OreLayer.java | 11 +- .../bartimaeusnek/bartworks/util/BWRecipes.java | 10 +- .../bartimaeusnek/bartworks/util/BW_Util.java | 4 +- .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 17 +- .../crossmod/GTpp/loader/RadioHatchCompat.java | 265 +++++++++++++++++++++ .../galacticraft/UniversalTeleportType.java | 2 +- .../tile/GT_Multi_IndustrialCrucible.java | 90 +++++++ .../crossmod/thaumcraft/tile/GT_WandBuffer.java | 87 +++++++ .../thaumcraft/util/ThaumcraftHandler.java | 18 ++ .../resources/assets/bartworks/lang/en_US.lang | 2 +- 20 files changed, 561 insertions(+), 64 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java diff --git a/build.properties b/build.properties index 602e878c53..5757859380 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=18_pre2 +buildNumber=18_pre3 APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java index c252d5f935..44dc931a23 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java @@ -35,20 +35,20 @@ public class BW_GUIContainer_HeatedWaterPump extends GuiContainer { public BW_GUIContainer_HeatedWaterPump(Container p_i1072_1_) { super(p_i1072_1_); - container = (BW_Container_HeatedWaterPump) p_i1072_1_; + this.container = (BW_Container_HeatedWaterPump) p_i1072_1_; } @Override protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(furnaceGuiTextures); + this.mc.getTextureManager().bindTexture(BW_GUIContainer_HeatedWaterPump.furnaceGuiTextures); int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); // this.drawString(this.fontRendererObj, "Fuel:" + container.fuel + " Water:" + container.water, k, l, 0xffffff); if (this.container.fuel > 0) { - this.mc.getTextureManager().bindTexture(furnaceGuiTextures); + this.mc.getTextureManager().bindTexture(BW_GUIContainer_HeatedWaterPump.furnaceGuiTextures); int ik = this.container.maxfuel > 200 ? this.container.maxfuel : 200; int i1 = ((this.container.fuel * 13) / ik); this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 13 - i1, 14, i1 + 1); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java index bdffce07ee..788bcb379a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.server.container.BW_Container_RadioHatch; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.inventory.Container; import net.minecraft.util.ResourceLocation; @@ -37,7 +38,7 @@ public class BW_GUIContainer_RadLevel extends GuiContainer { public BW_GUIContainer_RadLevel(Container p_i1072_1_) { super(p_i1072_1_); - container = (BW_Container_RadioHatch) p_i1072_1_; + this.container = (BW_Container_RadioHatch) p_i1072_1_; } @@ -45,16 +46,16 @@ public class BW_GUIContainer_RadLevel extends GuiContainer { protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { GL11.glColor3f(1, 1, 1); this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUI_RSC.png")); - drawTexturedModalRect(guiLeft - 79, guiTop, 0, 0, 256, 165); + this.drawTexturedModalRect(this.guiLeft - 79, this.guiTop, 0, 0, 256, 165); } @Override protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - int y = 51 + (container.coverage / 2 - 3); + int y = 51 + (this.container.coverage / 2 - 3); int x = -63; - if (container.coverage != 100 && container.coverage != 0) - drawRect(x, y, x + 51, y + 1, 0xFF60D82E); - drawRect(x, 48, x + 51, y, 0xFF8B8B8B); - this.fontRendererObj.drawString(Byte.toString(container.coverage), 88 - 79, 50, 16448255); + if (this.container.coverage != 100 && this.container.coverage != 0) + Gui.drawRect(x, y, x + 51, y + 1, 0xFF60D82E); + Gui.drawRect(x, 48, x + 51, y, 0xFF8B8B8B); + this.fontRendererObj.drawString(Byte.toString(this.container.coverage), 88 - 79, 50, 16448255); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java index 34574929db..8f31fc31db 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java @@ -44,7 +44,7 @@ public class GT_GUIContainer_CircuitProgrammer extends GuiContainer { @Override protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { GL11.glColor4f(1F, 1F, 1F, 1F); - Minecraft.getMinecraft().getTextureManager().bindTexture(texture); - drawTexturedModalRect(guiLeft - 79, guiTop, 0, 0, 256, 165); + Minecraft.getMinecraft().getTextureManager().bindTexture(GT_GUIContainer_CircuitProgrammer.texture); + this.drawTexturedModalRect(this.guiLeft - 79, this.guiTop, 0, 0, 256, 165); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java index c1998f4bfe..e672eebe94 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java @@ -43,8 +43,8 @@ public class GT_GUIContainer_Destructopack extends GuiContainer { @Override public void drawGuiContainerBackgroundLayer(float f, int j, int i) { GL11.glColor4f(1F, 1F, 1F, 1F); - Minecraft.getMinecraft().getTextureManager().bindTexture(texture); - drawTexturedModalRect(guiLeft, guiTop, 0, 0, 175, 165); + Minecraft.getMinecraft().getTextureManager().bindTexture(GT_GUIContainer_Destructopack.texture); + this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 175, 165); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java index 336c9fab92..540f597051 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -46,9 +46,9 @@ public class GT_GUIContainer_LESU extends GT_GUIContainer { private GT_TileEntity_LESU c; public GT_GUIContainer_LESU(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_LESU(aInventoryPlayer, aTileEntity), texture.getResourceDomain()); - mContainer = ((GT_Container_LESU) this.inventorySlots); - c = ((GT_TileEntity_LESU) (this.mContainer.mTileEntity.getMetaTileEntity())); + super(new GT_Container_LESU(aInventoryPlayer, aTileEntity), GT_GUIContainer_LESU.texture.getResourceDomain()); + this.mContainer = ((GT_Container_LESU) this.inventorySlots); + this.c = ((GT_TileEntity_LESU) (this.mContainer.mTileEntity.getMetaTileEntity())); } @Override @@ -60,7 +60,7 @@ public class GT_GUIContainer_LESU extends GT_GUIContainer { this.drawString(this.fontRendererObj, "MAX: " + (this.c.getBaseMetaTileEntity().isActive() ? String.valueOf(this.mContainer.mOutput) + percell : Integer.toString(0)), 11, 24, 16448255); this.drawString(this.fontRendererObj, "MAX EU/t IN: " + String.valueOf(this.mContainer.mInput), 11, 32, 16448255); this.drawString(this.fontRendererObj, "EU/t OUT: " + String.valueOf(this.mContainer.mOutput), 11, 40, 16448255); - this.drawString(this.fontRendererObj, "AMP/t IN/OUT: " + String.valueOf(c.getBaseMetaTileEntity().getInputAmperage()), 11, 48, 16448255); + this.drawString(this.fontRendererObj, "AMP/t IN/OUT: " + String.valueOf(this.c.getBaseMetaTileEntity().getInputAmperage()), 11, 48, 16448255); if (c.maxEUStore() >= Long.MAX_VALUE - 1) { this.drawString(this.fontRendererObj, StatCollector.translateToLocal("tooltip.LESU.0.name"), 11, 56, Color.YELLOW.getRGB()); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java index 2ae5bf6317..d214b4b09e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java @@ -26,6 +26,8 @@ import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; +import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; @@ -45,28 +47,28 @@ public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine super(new GT_Container_RadioHatch(aInventoryPlayer, aTileEntity), MainMod.MOD_ID + ":textures/GUI/RadHatch.png"); this.mName = "Radio Hatch"; this.mContainer.detectAndSendChanges(); - maxSv = BioVatLogicAdder.RadioHatch.getMaxSv(); + GT_GUIContainer_RadioHatch.maxSv = BioVatLogicAdder.RadioHatch.getMaxSv(); } protected void drawGuiContainerForegroundLayer(int par1, int par2) { - long timer = ByteBuffer.wrap(((GT_Container_RadioHatch) mContainer).teTimer).getLong(); - double maxT = ((GT_Container_RadioHatch) mContainer).mass * (GT_MetaTileEntity_RadioHatch.calcDecayTicks(((GT_Container_RadioHatch) mContainer).sievert)); + long timer = ByteBuffer.wrap(((GT_Container_RadioHatch) this.mContainer).teTimer).getLong(); + double maxT = ((GT_Container_RadioHatch) this.mContainer).mass * (GT_MetaTileEntity_RadioHatch.calcDecayTicks(((GT_Container_RadioHatch) this.mContainer).sievert)); double rem = maxT - timer % maxT; this.fontRendererObj.drawString(this.mName, 8, 4, 4210752); this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID + ":textures/GUI/RadHatch.png")); - if (((GT_Container_RadioHatch) mContainer).mass > 0) { - GL11.glColor3f(((GT_Container_RadioHatch) mContainer).r / 255f, ((GT_Container_RadioHatch) mContainer).g / 255f, ((GT_Container_RadioHatch) mContainer).b / 255f); + if (((GT_Container_RadioHatch) this.mContainer).mass > 0) { + GL11.glColor3f(((GT_Container_RadioHatch) this.mContainer).r / 255f, ((GT_Container_RadioHatch) this.mContainer).g / 255f, ((GT_Container_RadioHatch) this.mContainer).b / 255f); this.drawTexturedModalRect(124, 18, 124, 18, 16, 48); } GL11.glColor3f(1f, 1f, 1f); this.drawTexturedModalRect(124, 18, 176, 0, 16, 48 - (int) Math.ceil(48 * (rem / maxT))); - this.drawTexturedModalRect(65, 13, 192, 0, (48 * (((GT_Container_RadioHatch) mContainer).sv)) / (maxSv), 16); + this.drawTexturedModalRect(65, 13, 192, 0, (48 * (((GT_Container_RadioHatch) this.mContainer).sv)) / (GT_GUIContainer_RadioHatch.maxSv), 16); -// this.fontRendererObj.drawString("Sv: " + ((GT_Container_RadioHatch) mContainer).sievert, 8, 50, BW_Util.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); -// this.fontRendererObj.drawString("Kg: " + ((GT_Container_RadioHatch) mContainer).mass, 8, 68, BW_Util.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); -// this.fontRendererObj.drawString("Time: " + timer, 8, 76, BW_Util.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); +// this.fontRendererObj.drawString("Sv: " + ((GT_Container_RadioHatch) mContainer).sievert, 8, 50, BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); +// this.fontRendererObj.drawString("Kg: " + ((GT_Container_RadioHatch) mContainer).mass, 8, 68, BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); +// this.fontRendererObj.drawString("Time: " + timer, 8, 76, BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 76625e06bc..b3fce2c4ac 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -80,7 +80,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private boolean needsVisualUpdate = true; private byte mGlassTier = 0; private int mSievert = 0; - + private int mNeededSievert = 0; public GT_TileEntity_BioVat(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -203,12 +203,14 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { if (gtRecipe == null) return false; - if (!BW_Util.areStacksEqual((ItemStack) gtRecipe.mSpecialItems, itemStack)) + if (!BW_Util.areStacksEqualOrNull((ItemStack) gtRecipe.mSpecialItems, itemStack)) return false; int[] conditions = specialValueUnpack(gtRecipe.mSpecialValue); - if (conditions[2] == 0 ? (this.mSievert < conditions[3] || this.mGlassTier < conditions[0]) : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0])) + this.mNeededSievert = conditions[3]; + + if (conditions[2] == 0 ? (this.mSievert < this.mNeededSievert || this.mGlassTier < conditions[0]) : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0])) return false; int times = 1; @@ -494,7 +496,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { height = reCalculateHeight(); if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) { - if ((!(BW_Util.areStacksEqual(aStack, mStack))) || (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 1)) { + if ((!(BW_Util.areStacksEqualOrNull(aStack, mStack))) || (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 1)) { for (int x = -1; x < 2; x++) { for (int y = 1; y < height; y++) { for (int z = -1; z < 2; z++) { @@ -529,8 +531,11 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { if (height != reCalculateHeight()) needsVisualUpdate = true; doAllVisualThings(); - if (this.getBaseMetaTileEntity().isServerSide() && this.mRadHatches.size() == 1) + if (this.getBaseMetaTileEntity().isServerSide() && this.mRadHatches.size() == 1) { this.mSievert = this.mRadHatches.get(0).getSievert(); + if (this.getBaseMetaTileEntity().isActive() && this.mNeededSievert > this.mSievert) + this.mOutputFluids = null; + } } @Override @@ -543,6 +548,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } if (this.mFluid != null) aNBT.setString("mFluid", mFluid.getName()); + aNBT.setInteger("mSievert",this.mSievert); + aNBT.setInteger("mNeededSievert",this.mNeededSievert); super.saveNBTData(aNBT); } @@ -580,10 +587,12 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @Override public void loadNBTData(NBTTagCompound aNBT) { - height = aNBT.getInteger("mFluidHeight"); - mCulture = BioCulture.getBioCulture(aNBT.getString("mCulture")); + this.height = aNBT.getInteger("mFluidHeight"); + this.mCulture = BioCulture.getBioCulture(aNBT.getString("mCulture")); if (!aNBT.getString("mFluid").isEmpty()) - mFluid = FluidRegistry.getFluid(aNBT.getString("mFluid")); + this.mFluid = FluidRegistry.getFluid(aNBT.getString("mFluid")); + this.mSievert = aNBT.getInteger("mSievert"); + this.mNeededSievert = aNBT.getInteger("mNeededSievert"); super.loadNBTData(aNBT); } @@ -610,6 +619,6 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[MCASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[MCASING_INDEX]}; + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_BioVat.MCASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[MCASING_INDEX]}; } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 1eab412c16..b88c6209a0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -29,6 +29,8 @@ import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; +import cpw.mods.fml.common.Loader; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -75,13 +77,13 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { public static long calcDecayTicks(int x) { long ret = 0; - if (x >= 83 && x <= 100) - ret = (long) Math.ceil((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); - else if (x == 43) + if (x == 43) ret = 5000; else if (x == 61) ret = 4500; - else if (x > 100) + else if (x <= 100) + ret = (long) Math.ceil((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); + else ret = (long) Math.ceil(((8000D * Math.tanh(-x / 65D) + 8000D))); return ret;//*20; } @@ -170,19 +172,26 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { if (lStack == null) return; - if (lStack.getItem() instanceof IRadMaterial) { - IRadMaterial material = ((IRadMaterial) lStack.getItem()); - int sv = material.getRadiationLevel(lStack); + + IRadMaterial radmat = null; + //gt++ compat + if (Loader.isModLoaded("miscutils")) + radmat = RadioHatchCompat.GTppRadChecker(lStack); + + if (lStack.getItem() instanceof IRadMaterial || radmat != null) { + if (radmat == null) + radmat = ((IRadMaterial) lStack.getItem()); + int sv = radmat.getRadiationLevel(lStack); if (sv > BioVatLogicAdder.RadioHatch.getMaxSv()) BioVatLogicAdder.RadioHatch.MaxSV = sv; if (this.mass == 0 || this.sievert == sv) { - if (this.mass < this.cap) { - this.mass = material.getAmountOfMaterial(lStack); + if (this.mass + radmat.getAmountOfMaterial(lStack) <= this.cap) { + this.mass += radmat.getAmountOfMaterial(lStack); this.sievert = sv; this.mInventory[0].stackSize--; this.updateSlots(); - this.colorForGUI = material.getColorForGUI(lStack); - this.material = material.getNameForGUI(lStack); + this.colorForGUI = radmat.getColorForGUI(lStack); + this.material = radmat.getNameForGUI(lStack); return; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 1f494dffab..662cfbea5a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -717,7 +717,7 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff) }, new int[]{ - 100, 400, 1500, 2000, 4000, 5000 + 200, 1000, 2500, 2000, 4000, 5000 }, 800, 16 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java index 1c4ffbb8cb..ebc432d1b5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.system.oregen; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import gregtech.api.GregTech_API; @@ -149,10 +150,16 @@ public abstract class BW_OreLayer extends GT_Worldgen { } public boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre) { + //security stuff to prevent crashes with 2 TileEntites on the same Spot + TileEntity te = aWorld.getTileEntity(aX,aY,aZ); + if (te instanceof BW_MetaGeneratedOreTE || te instanceof GT_TileEntity_Ores) + return true; + if ((aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0) || (aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0) || (aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0) || (aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0)) { - return BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, getDefaultBlockToReplace()); + return BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, this.getDefaultBlockToReplace()); } - return setGTOreBlockSpace(aWorld, aX, aY, aZ, aMetaData, getDefaultBlockToReplace()); + + return this.setGTOreBlockSpace(aWorld, aX, aY, aZ, aMetaData, this.getDefaultBlockToReplace()); } public boolean setGTOreBlockSpace(World aWorld, int aX, int aY, int aZ, int aMetaData, Block block){ diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index b07c84d493..c380f3399b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -560,7 +560,7 @@ public class BWRecipes { // Check the Recipe which has been used last time in order to not have to search for it again, if possible. if (aRecipe != null) - if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqual((ItemStack) aRecipe.mSpecialItems, aSpecialSlot)) + if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) aRecipe.mSpecialItems, aSpecialSlot)) return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. @@ -570,12 +570,12 @@ public class BWRecipes { Collection tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack)); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqual((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) + if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(GT_Values.W, tStack))); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqual((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) + if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; } @@ -585,7 +585,7 @@ public class BWRecipes { if (aFluid != null) { Collection tRecipes = mRecipeFluidMap.get(aFluid.getFluid()); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqual((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) + if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; } @@ -601,7 +601,7 @@ public class BWRecipes { if (aRecipe.mFluidInputs.length < this.mMinimalInputFluids && aRecipe.mInputs.length < this.mMinimalInputItems) { return null; } else { - return aCheckForCollisions && isthere != null && BW_Util.areStacksEqual((ItemStack) isthere.mSpecialItems, (ItemStack) aRecipe.mSpecialItems) ? null : this.add(aRecipe); + return aCheckForCollisions && isthere != null && BW_Util.areStacksEqualOrNull((ItemStack) isthere.mSpecialItems, (ItemStack) aRecipe.mSpecialItems) ? null : this.add(aRecipe); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 64ea87132f..f7312eeab2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -32,6 +32,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import ic2.api.item.IElectricItem; import net.minecraft.block.Block; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; @@ -50,7 +51,6 @@ public class BW_Util { public static final int CLEANROOM = -100; public static final int LOWGRAVITY = -200; - public static String subscriptNumbers(String b){ char[] chars = b.toCharArray(); char[] nu = new char[chars.length]; @@ -182,7 +182,7 @@ public class BW_Util { return 8 << (2*tier); } - public static boolean areStacksEqual(ItemStack aStack1, ItemStack aStack2) { + public static boolean areStacksEqualOrNull(ItemStack aStack1, ItemStack aStack2) { return (aStack1 == null && aStack2 == null) || GT_Utility.areStacksEqual(aStack1, aStack2); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 65fbb0f6a7..0fb357cdb3 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -23,17 +23,17 @@ package com.github.bartimaeusnek.crossmod; import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; +import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.event.*; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import java.util.List; + @Mod( modid = BartWorksCrossmod.MOD_ID, name = BartWorksCrossmod.NAME, version = BartWorksCrossmod.VERSION, dependencies = "required-after:IC2; " @@ -42,6 +42,7 @@ import org.apache.logging.log4j.Logger; + "after:GalacticraftMars; " + "after:GalacticraftCore; " + "after:Micdoodlecore; " + + "after:miscutils;" ) public class BartWorksCrossmod { public static final String NAME = "BartWorks Mod Additions"; @@ -70,8 +71,16 @@ public class BartWorksCrossmod { public void postInit(FMLPostInitializationEvent init) { if (Loader.isModLoaded("GalacticraftCore")) GalacticraftProxy.postInit(init); + if (Loader.isModLoaded("miscutils")) + new RadioHatchCompat().run(); } +// @Mod.EventHandler +// public void onFMLMissingMappingsEvent(FMLMissingMappingsEvent event){ +// for (FMLMissingMappingsEvent.MissingMapping mapping : event.getAll()){ +// if (mapping.name.equalsIgnoreCase()) +// } +// } @Mod.EventHandler public void onFMLServerStart(FMLServerStartingEvent event) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java new file mode 100644 index 0000000000..2d63cae904 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java @@ -0,0 +1,265 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.GTpp.loader; + +import com.github.bartimaeusnek.bartworks.API.IRadMaterial; +import com.github.bartimaeusnek.bartworks.system.log.DebugLog; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.registry.GameData; +import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.RegistryNamespaced; +import net.minecraftforge.oredict.OreDictionary; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.util.*; + +public class RadioHatchCompat implements Runnable { + + private static Class intf; + private static Class materialClass; + private static Class enu; + private static Class materialStackClass; + + private static Field isRadioactive; + private static Field f; + private static Field componentType; + private static Field radlevel; + private static Field protons; + + private static Field vMaterialInput; + private static Field stackMaterial; + private static Field RGBA; + private static Field localizedName; + private static Field unlocalizedName; + + private static Object rod; + private static Object longRod; + static{ + try { + RadioHatchCompat.intf = Class.forName("gtPlusPlus.core.item.base.BaseItemComponent"); + RadioHatchCompat.enu = Class.forName("gtPlusPlus.core.item.base.BaseItemComponent$ComponentTypes"); + RadioHatchCompat.materialClass = Class.forName("gtPlusPlus.core.material.Material"); + RadioHatchCompat.materialStackClass = Class.forName("gtPlusPlus.core.material.MaterialStack"); + + RadioHatchCompat.f = RadioHatchCompat.intf.getField("componentMaterial"); + RadioHatchCompat.isRadioactive = RadioHatchCompat.materialClass.getField("isRadioactive"); + RadioHatchCompat.componentType = RadioHatchCompat.intf.getDeclaredField("componentType"); + RadioHatchCompat.radlevel = RadioHatchCompat.materialClass.getField("vRadiationLevel"); + + RadioHatchCompat.vMaterialInput = RadioHatchCompat.materialClass.getDeclaredField("vMaterialInput"); + RadioHatchCompat.stackMaterial = RadioHatchCompat.materialStackClass.getDeclaredField("stackMaterial"); + RadioHatchCompat.protons = RadioHatchCompat.materialClass.getDeclaredField("vProtons"); + RadioHatchCompat.RGBA = RadioHatchCompat.materialClass.getDeclaredField("RGBA"); + RadioHatchCompat.localizedName = RadioHatchCompat.materialClass.getDeclaredField("localizedName"); + RadioHatchCompat.unlocalizedName = RadioHatchCompat.materialClass.getDeclaredField("unlocalizedName"); + + RadioHatchCompat.vMaterialInput.setAccessible(true); + RadioHatchCompat.stackMaterial.setAccessible(true); + RadioHatchCompat.protons.setAccessible(true); + RadioHatchCompat.RGBA.setAccessible(true); + RadioHatchCompat.localizedName.setAccessible(true); + RadioHatchCompat.unlocalizedName.setAccessible(true); + + Object[] arr = enu.getEnumConstants(); + for (Object o : arr){ + if (RadioHatchCompat.rod != null && RadioHatchCompat.longRod != null) + break; + else if (o.toString().equalsIgnoreCase("ROD")) + RadioHatchCompat.rod = o; + else if (o.toString().equalsIgnoreCase("RODLONG")) + RadioHatchCompat.longRod = o; + } + + } catch (NoSuchFieldException | ClassNotFoundException e) { + e.printStackTrace(); + } + } + + @Override + public void run() { + DebugLog.log("Starting Generation of missing GT++ rods/longrods"); + try { + Class rodclass = Class.forName("gtPlusPlus.core.item.base.rods.BaseItemRod"); + Class longrodclass = Class.forName("gtPlusPlus.core.item.base.rods.BaseItemRodLong"); + Constructor c1 = rodclass.getConstructor(RadioHatchCompat.materialClass); + Constructor c2 = longrodclass.getConstructor(RadioHatchCompat.materialClass); + Field cOwners = GameData.class.getDeclaredField("customOwners"); + cOwners.setAccessible(true); + Field map = RegistryNamespaced.class.getDeclaredField("field_148758_b"); + map.setAccessible(true); + Map UniqueIdentifierMap = (Map) map.get(GameData.getItemRegistry()); + + Map ownerItems = (Map) cOwners.get(null); + ModContainer gtpp = null; + ModContainer bartworks = null; + + for (ModContainer container : Loader.instance().getModList()){ + if (gtpp != null && bartworks != null) + break; + else if (container.getModId().equalsIgnoreCase(BartWorksCrossmod.MOD_ID)) + bartworks=container; + else if (container.getModId().equalsIgnoreCase("miscutils")) + gtpp=container; + } + + for (Object mats : (Set) RadioHatchCompat.materialClass.getField("mMaterialMap").get(null)) { + if (RadioHatchCompat.isRadioactive.getBoolean(mats)) { + + if (OreDictionary.getOres("stick" + RadioHatchCompat.unlocalizedName.get(mats)).isEmpty()) { + Item it = (Item) c1.newInstance(mats); + UniqueIdentifierMap.replace(it,"miscutils:"+it.getUnlocalizedName()); + GameRegistry.UniqueIdentifier ui = GameRegistry.findUniqueIdentifierFor(it); + ownerItems.replace(ui,bartworks,gtpp); + + DebugLog.log("Generate: " + RadioHatchCompat.rod + RadioHatchCompat.unlocalizedName.get(mats)); + } + if (OreDictionary.getOres("stickLong" + RadioHatchCompat.unlocalizedName.get(mats)).isEmpty()) { + Item it2 = (Item) c2.newInstance(mats); + UniqueIdentifierMap.replace(it2,"miscutils:"+it2.getUnlocalizedName()); + GameRegistry.UniqueIdentifier ui2 = GameRegistry.findUniqueIdentifierFor(it2); + ownerItems.replace(ui2,bartworks,gtpp); + + DebugLog.log("Generate: " + RadioHatchCompat.longRod + RadioHatchCompat.unlocalizedName.get(mats)); + } + } + } + } catch (NoSuchFieldException | IllegalAccessException | NoSuchMethodException | InvocationTargetException | InstantiationException | ClassNotFoundException e) { + e.printStackTrace(); + } + } + + public static IRadMaterial GTppRadChecker(ItemStack lStack){ + try { + if (RadioHatchCompat.intf.isAssignableFrom(lStack.getItem().getClass())){ + if (!RadioHatchCompat.isRadioactive.getBoolean(RadioHatchCompat.f.get(lStack.getItem()))) + return null; + return new RadioHatchCompat.GTPPRadAdapter(RadioHatchCompat.componentType.get(lStack.getItem()).equals(RadioHatchCompat.rod) ? 1 : RadioHatchCompat.componentType.get(lStack.getItem()).equals(RadioHatchCompat.longRod) ? 2 : 0, RadioHatchCompat.f.get(lStack.getItem())); + } + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + return null; + } + + static class GTPPRadAdapter implements IRadMaterial{ + + static final HashMap BUFFER = new HashMap<>(); + + public GTPPRadAdapter(Object m) { + this.m = m; + } + + public GTPPRadAdapter(int amount, Object m) { + this.amount = (byte) amount; + this.m = m; + } + + byte amount; + final Object m; + + private static ArrayList getMaterialInput(Object GTPPMaterial) throws IllegalAccessException { + Object ret = RadioHatchCompat.vMaterialInput.get(GTPPMaterial); + return ret instanceof ArrayList ? (ArrayList) ret : new ArrayList(); + } + + private static boolean isElement(Object GTPPMaterial) throws IllegalAccessException { + return RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial).isEmpty(); + } + + private static List getElemets(Object GTPPMaterial) throws IllegalAccessException { + ArrayList elements = new ArrayList(); + Queue toCheck = new LinkedList(); + ArrayList materialInputs = RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial); + if (materialInputs.isEmpty()) + return Collections.singletonList(GTPPMaterial); + for (Object materialStack : materialInputs){ + if (!RadioHatchCompat.GTPPRadAdapter.isElement(RadioHatchCompat.stackMaterial.get(materialStack))) + toCheck.add(RadioHatchCompat.stackMaterial.get(materialStack)); + else + elements.add(RadioHatchCompat.stackMaterial.get(materialStack)); + } + while (!toCheck.isEmpty()){ + elements.addAll(getElemets(toCheck.poll())); + } + return elements; + } + + private static Integer calulateRad(Object m){ + int ret = 0; + try { + List pureElements = RadioHatchCompat.GTPPRadAdapter.getElemets(m); + for (Object materialObj : pureElements) + if (RadioHatchCompat.isRadioactive.getBoolean(materialObj)) + ret += ((int) RadioHatchCompat.radlevel.getByte(m) + RadioHatchCompat.GTPPRadAdapter.clampToZero(RadioHatchCompat.protons.getLong(materialObj))); + else + ret += ((int) RadioHatchCompat.radlevel.getByte(m)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + return ret; + } + + @Override + public int getRadiationLevel(ItemStack aStack) { + return RadioHatchCompat.GTPPRadAdapter.BUFFER.computeIfAbsent(this.m, radlvl -> RadioHatchCompat.GTPPRadAdapter.calulateRad(this.m)); + } + + private static long clampToZero(long number){ + return number > 0 ? number : 0; + } + + @Override + public byte getAmountOfMaterial(ItemStack aStack) { + return this.amount; + } + + @Override + public short[] getColorForGUI(ItemStack aStack) { + short[] rgba = {0,0,0,0}; + try { + rgba = (short[]) RadioHatchCompat.RGBA.get(this.m); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + return rgba; + } + + @Override + public String getNameForGUI(ItemStack aStack) { + String ret = ""; + try { + ret = (String) RadioHatchCompat.localizedName.get(this.m); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + return ret; + } + + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java index 22e95e6d02..c1e7e7a6c8 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java @@ -46,7 +46,7 @@ public class UniversalTeleportType implements ITeleportType { @Override public Vector3 getPlayerSpawnLocation(WorldServer world, EntityPlayerMP player) { - return getEntitySpawnLocation(world, player); + return this.getEntitySpawnLocation(world, player); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java new file mode 100644 index 0000000000..3700e89287 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.thaumcraft.tile; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import net.minecraft.item.ItemStack; + +public class GT_Multi_IndustrialCrucible extends GT_MetaTileEntity_MultiBlockBase { + + public GT_Multi_IndustrialCrucible(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_Multi_IndustrialCrucible(String aName) { + super(aName); + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return false; + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + return false; + } + + @Override + public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return false; + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 0; + } + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return null; + } + + @Override + public String[] getDescription() { + return new String[0]; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + return new ITexture[0]; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java index c16398795e..3daa758a88 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java @@ -22,8 +22,16 @@ package com.github.bartimaeusnek.crossmod.thaumcraft.tile; +import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicBatteryBuffer; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import ic2.api.item.ElectricItem; +import ic2.api.item.IElectricItem; +import net.minecraft.item.ItemStack; public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { public GT_WandBuffer(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) { @@ -38,5 +46,84 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { super(aName, aTier, aDescription, aTextures, aSlotCount); } + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + this.mCharge = aBaseMetaTileEntity.getStoredEU() / 2L > aBaseMetaTileEntity.getEUCapacity() / 3L; + this.mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3L; + this.mBatteryCount = 0; + this.mChargeableCount = 0; + ItemStack[] var4 = this.mInventory; + int var5 = var4.length; + + for(int var6 = 0; var6 < var5; ++var6) { + ItemStack tStack = var4[var6]; + if (ThaumcraftHandler.isWand(tStack)) { + ++this.mBatteryCount; + ++this.mChargeableCount; + } + } + } + + } + + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return ThaumcraftHandler.isWand(aStack); + } + + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return ThaumcraftHandler.isWand(aStack); + } + + public int getInventoryStackLimit() { + return 1; + } + + public long[] getStoredEnergy() { + boolean scaleOverflow = false; + boolean storedOverflow = false; + long tScale = this.getBaseMetaTileEntity().getEUCapacity(); + long tStored = this.getBaseMetaTileEntity().getStoredEU(); + long tStep = 0L; + if (this.mInventory != null) { + ItemStack[] var9 = this.mInventory; + int var10 = var9.length; + + for(int var11 = 0; var11 < var10; ++var11) { + ItemStack aStack = var9[var11]; + if (GT_ModHandler.isElectricItem(aStack)) { + if (aStack.getItem() instanceof GT_MetaBase_Item) { + Long[] stats = ((GT_MetaBase_Item)aStack.getItem()).getElectricStats(aStack); + if (stats != null) { + if (stats[0] > 4611686018427387903L) { + scaleOverflow = true; + } + + tScale += stats[0]; + tStep = ((GT_MetaBase_Item)aStack.getItem()).getRealCharge(aStack); + if (tStep > 4611686018427387903L) { + storedOverflow = true; + } + + tStored += tStep; + } + } else if (aStack.getItem() instanceof IElectricItem) { + tStored += (long)ElectricItem.manager.getCharge(aStack); + tScale += (long)((IElectricItem)aStack.getItem()).getMaxCharge(aStack); + } + } + } + } + + if (scaleOverflow) { + tScale = 9223372036854775807L; + } + + if (storedOverflow) { + tStored = 9223372036854775807L; + } + + return new long[]{tStored, tScale}; + } + } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index d0df9188a2..3d984ed063 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -39,6 +39,24 @@ public class ThaumcraftHandler { private static Integer taintBiomeID; + private static Class mWandInterface; + + static { + try { + ThaumcraftHandler.mWandInterface = Class.forName("thaumcraft.common.items.wands.ItemWandCasting"); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + } + + public static boolean isWand(ItemStack aStack) { + try { + return aStack != null && ThaumcraftHandler.mWandInterface.isAssignableFrom(aStack.getItem().getClass()); + } catch (Throwable var3) { + return false; + } + } + public static boolean isTaintBiome(int biomeID){ if (ThaumcraftHandler.taintBiomeID == null) { try { diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 0388c0cb46..0aac211cdf 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -103,7 +103,7 @@ tooltip.tile.waterpump.2.name=Must be placed on the Ground. tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Boronsilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum tooltip.tile.mbf.1.name=Pollution per second tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest -tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom and top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radiation Input Bus;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! +tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom or top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radio Hatch;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! tooltip.tile.windmill.0.name=A primitive Grinder powered by Kinetic energy.;Size(WxHxD): 7x12x7;Layer 1: 7x7 Bricks, corners are air, controller at front centered.;Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,;hollow, Wall must contain at least one Dispenser;Layer 6: 5x5 Wood Planks. Corners are filled, hollow.;Layer 7: 7x7 Wood Planks. Corners are air, hollow.;Layer 8: 7x7 Wood Planks. Corners are air, hollow,;front centered must be a Primitive Kinetic Shaftbox;Layer 9: 7x7 Wood Planks. Corners are air, hollow.;Layer 10: 5x5 Wood Planks. Corners are filled, hollow.;Layer 11: 3x3 Wood Planks. Corners are filled, hollow.;Layer 12: 1x1 Wood Plank.;Needs a Wind Mill Rotor in the Shaftbox to operate;Input items in Controller;Output items will appear in the dispensers;It is faster in regions with more wind (like IC2 Windmills) tooltip.tile.lesu.0.name=Controller Block for the GT2-Styled L.E.S.U.;Size: ANY tooltip.tile.lesu.1.name=Storage per LESU Casing: -- cgit From 07291ba30ae01b119cf43f7b957921a31addbd95 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 16 Jul 2019 18:55:43 +0200 Subject: added GT++ Localisation Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 34ab3a274facd5295857fb1671da538630ccf733 --- .../github/bartimaeusnek/crossmod/BartWorksCrossmod.java | 13 +++++++++++-- .../crossmod/GTpp/loader/RadioHatchCompat.java | 7 +++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 0fb357cdb3..5effb4a33e 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -28,11 +28,16 @@ import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.event.*; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; +import net.minecraft.util.StringTranslate; +import org.apache.commons.io.input.ReaderInputStream; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.util.List; +import java.io.StringReader; @Mod( modid = BartWorksCrossmod.MOD_ID, name = BartWorksCrossmod.NAME, version = BartWorksCrossmod.VERSION, @@ -85,5 +90,9 @@ public class BartWorksCrossmod { @Mod.EventHandler public void onFMLServerStart(FMLServerStartingEvent event) { event.registerServerCommand(new SummonRuin()); + if (Loader.isModLoaded("miscutils")) + for (Object s : RadioHatchCompat.TranslateSet){ + StringTranslate.inject(new ReaderInputStream(new StringReader((String) s))); + } } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java index 2d63cae904..8721026957 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java @@ -60,6 +60,9 @@ public class RadioHatchCompat implements Runnable { private static Object rod; private static Object longRod; + + public static HashSet TranslateSet = new HashSet(); + static{ try { RadioHatchCompat.intf = Class.forName("gtPlusPlus.core.item.base.BaseItemComponent"); @@ -137,6 +140,10 @@ public class RadioHatchCompat implements Runnable { GameRegistry.UniqueIdentifier ui = GameRegistry.findUniqueIdentifierFor(it); ownerItems.replace(ui,bartworks,gtpp); + String tanslate = it.getUnlocalizedName()+".name="+RadioHatchCompat.localizedName.get(mats)+" Rod"; + TranslateSet.add(tanslate); + + DebugLog.log(tanslate); DebugLog.log("Generate: " + RadioHatchCompat.rod + RadioHatchCompat.unlocalizedName.get(mats)); } if (OreDictionary.getOres("stickLong" + RadioHatchCompat.unlocalizedName.get(mats)).isEmpty()) { -- cgit From 9eca233df8a72a4dc64d396d467f2ee099469be8 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 16 Jul 2019 19:13:55 +0200 Subject: version increase, codestyle fixes Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 18023016c0c5e6c11babbc64de516f8c5ca561e0 --- build.properties | 2 +- .../github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.properties b/build.properties index 5757859380..ecc130725e 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=18_pre3 +buildNumber=18 APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java index 8721026957..1c48eae294 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java @@ -141,7 +141,7 @@ public class RadioHatchCompat implements Runnable { ownerItems.replace(ui,bartworks,gtpp); String tanslate = it.getUnlocalizedName()+".name="+RadioHatchCompat.localizedName.get(mats)+" Rod"; - TranslateSet.add(tanslate); + RadioHatchCompat.TranslateSet.add(tanslate); DebugLog.log(tanslate); DebugLog.log("Generate: " + RadioHatchCompat.rod + RadioHatchCompat.unlocalizedName.get(mats)); @@ -178,11 +178,11 @@ public class RadioHatchCompat implements Runnable { static final HashMap BUFFER = new HashMap<>(); - public GTPPRadAdapter(Object m) { + GTPPRadAdapter(Object m) { this.m = m; } - public GTPPRadAdapter(int amount, Object m) { + GTPPRadAdapter(int amount, Object m) { this.amount = (byte) amount; this.m = m; } -- cgit From 10d27ac2a3c62889273eb95625805aaef1c0d7c7 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 16 Jul 2019 19:19:41 +0200 Subject: added Discord webhook Former-commit-id: b0fee7b07f5631d70baefba9e70d314c37250cb0 --- .travis.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0ce2ec14a9..3948c2908e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,4 +32,12 @@ jobs: skip_cleanup: true file_glob: true on: - tags: false \ No newline at end of file + tags: false +after_success: + - wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh + - chmod +x send.sh + - ./send.sh success $WEBHOOK_URL +after_failure: + - wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh + - chmod +x send.sh + - ./send.sh failure $WEBHOOK_URL -- cgit From 292b2353e15a94f158a38408943064dc3b1c662e Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 16 Jul 2019 19:30:54 +0200 Subject: added download button Former-commit-id: fcb686cc12f3fe475bbd3217735984fccbdbe397 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3948c2908e..f35895a6d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ jobs: on: tags: false after_success: - - wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh + - wget https://raw.githubusercontent.com/bartimaeusnek/travis-ci-discord-webhook/master/send.sh - chmod +x send.sh - ./send.sh success $WEBHOOK_URL after_failure: -- cgit From ad2554e0c3d719eee9ec9537a047ee6e620a3956 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 17 Jul 2019 06:17:29 +0200 Subject: Update README.md Former-commit-id: f2956eafa7df85411bb2c02669bd8cde0481ce01 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7734188f28..ea0aa21230 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # bartworks -A Gregtech addon. +A Gregtech addon, that adds GT2,3,4 stuff, a BioLabor, and much more custom content. Integration for Galaxy Space, and new Ores aswell. +Visit us on Twitch: +https://minecraft.curseforge.com/projects/bartworks/ -- cgit From bcdb9546eeff7791fede412e8ea910d3a23af7de Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 17 Jul 2019 12:03:57 +0200 Subject: New BioVatOilRecipe +fixed bugged modifier on the BioVat +added OilRecipe Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: a4f4a2eab37f14377a770ae8e7068e90cc207187 --- build.properties | 2 +- .../bartworks/common/loaders/BioCultureLoader.java | 6 ++-- .../bartworks/common/loaders/BioRecipeLoader.java | 24 +++++++++++++- .../bartworks/common/loaders/FluidLoader.java | 37 ++++++++++++++++++---- .../tileentities/multis/GT_TileEntity_BioVat.java | 3 +- 5 files changed, 60 insertions(+), 12 deletions(-) diff --git a/build.properties b/build.properties index ecc130725e..a5e94c153f 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=18 +buildNumber=19_pre1 APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java index 78ff73554f..53b59830eb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java @@ -38,12 +38,14 @@ public class BioCultureLoader implements Runnable { private static final BioDNA BIO_DNA_WHINE_YEAST = BioDNA.createAndRegisterBioDNA("Saccharomyces cerevisiae var bayanus", EnumRarity.uncommon); private static final BioDNA BIO_DNA_BEER_YEAST = BioDNA.createAndRegisterBioDNA("Saccharomyces cerevisiae var cerevisiae", EnumRarity.uncommon); private static final BioData eColiData = BioData.createAndRegisterBioData("Escherichia koli", EnumRarity.uncommon, 10000, 0); + private static final BioDNA BIO_DNA_ANAEROBIC_OIL = BioDNA.createAndRegisterBioDNA("Pseudomonas Veronii", EnumRarity.uncommon); + private static final BioData BIO_DATA_ANAEROBIC_OIL = BioData.createAndRegisterBioData("Pseudomonas Veronii", EnumRarity.uncommon, 5000, 1); public static BioCulture CommonYeast; public static BioCulture WhineYeast; public static BioCulture BeerYeast; public static BioCulture rottenFleshBacteria; public static BioCulture eColi; - + public static BioCulture anaerobicOil; @Override public void run() { CommonYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae", BioPlasmid.convertDataToPlasmid(BIO_DATA_YEAST), BioDNA.convertDataToDNA(BIO_DATA_YEAST), true); @@ -51,7 +53,7 @@ public class BioCultureLoader implements Runnable { BeerYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var cerevisiae", BioPlasmid.convertDataToPlasmid(BIO_DATA_YEAST), BIO_DNA_BEER_YEAST, true); rottenFleshBacteria = BioCulture.createAndRegisterBioCulture(new Color(110, 40, 25), "Escherichia cadaver", BioPlasmid.convertDataToPlasmid(BIO_DATA_BETA_LACMATASE), BioDNA.convertDataToDNA(BIO_DATA_BETA_LACMATASE), false); eColi = BioCulture.createAndRegisterBioCulture(new Color(149, 132, 75), "Escherichia koli", BioPlasmid.convertDataToPlasmid(eColiData), BioDNA.convertDataToDNA(eColiData), true); - + anaerobicOil = BioCulture.createAndRegisterBioCulture(new Color(0, 0, 0), "Pseudomonas Veronii", BioPlasmid.convertDataToPlasmid(BIO_DNA_ANAEROBIC_OIL), BioDNA.convertDataToDNA(BIO_DATA_ANAEROBIC_OIL), true); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index fab53818a7..54d5ecda9f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -312,6 +312,16 @@ public class BioRecipeLoader extends RecipeLoader { BW_Util.STANDART ); + BWRecipes.instance.addBioLabRecipeIncubation( + new ItemStack(Blocks.dirt), + BioCultureLoader.anaerobicOil, + new int[]{100}, + new FluidStack[]{fluidStack}, + 1500, + BW_Util.getMachineVoltageFromTier(4), + BW_Util.STANDART + ); + BWRecipes.instance.addBacterialVatRecipe( new ItemStack[]{new ItemStack(Items.sugar, 64)}, new FluidStack[]{new FluidStack(fluidStack, 100)}, @@ -357,5 +367,17 @@ public class BioRecipeLoader extends RecipeLoader { 400, BW_Util.getMachineVoltageFromTier(1) ); + + BWRecipes.instance.addBacterialVatRecipe( + null, + new FluidStack[]{Materials.FermentedBiomass.getFluid(10000)}, + BioCultureLoader.anaerobicOil, + new FluidStack[]{new FluidStack(FluidLoader.fulvicAcid,1000)}, + 2748, + BW_Util.getMachineVoltageFromTier(3) + ); + GT_Values.RA.addFluidHeaterRecipe(GT_Utility.getIntegratedCircuit(10),new FluidStack(FluidLoader.fulvicAcid,1000),new FluidStack(FluidLoader.heatedfulvicAcid,1000),90,BW_Util.getMachineVoltageFromTier(2)); + GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(10),null,new FluidStack(FluidLoader.heatedfulvicAcid,1000),new FluidStack(FluidLoader.Kerogen,1000),null,75,BW_Util.getMachineVoltageFromTier(2)); + GT_Values.RA.addPyrolyseRecipe(Materials.Wood.getDust(10),new FluidStack(FluidLoader.Kerogen,1000),10,null,Materials.Oil.getFluid(1000),105,BW_Util.getMachineVoltageFromTier(3)); } -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 8285eb9789..af33363990 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -27,6 +27,7 @@ import com.github.bartimaeusnek.bartworks.client.renderer.RendererSwitchingColor import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BWTileEntityDimIDBridge; import com.github.bartimaeusnek.bartworks.util.BioCulture; +import com.github.bartimaeusnek.bartworks.util.Pair; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; @@ -44,6 +45,7 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import java.util.Arrays; +import java.awt.*; public class FluidLoader implements Runnable { @@ -54,23 +56,32 @@ public class FluidLoader implements Runnable { public static Fluid[] BioLabFluidMaterials; public static ItemStack[] BioLabFluidCells; + //OilProcessing chain + public static Fluid fulvicAcid,heatedfulvicAcid,Kerogen; + + + + @Override public void run() { FluidLoader.renderID = RenderingRegistry.getNextAvailableRenderId(); short[] rgb = new short[3]; Arrays.fill(rgb, (short) 255); FluidLoader.ff = new GT_Fluid("BWfakeFluid", "molten.autogenerated", rgb); - BioLabFluidMaterials = new Fluid[]{ + FluidLoader.fulvicAcid = FluidLoader.createAndRegisterFluid("Fulvic Acid", new Color(20, 20, 20)); + FluidLoader.heatedfulvicAcid = FluidLoader.createAndRegisterFluid("Heated Fulvic Acid", new Color(40, 20, 20),720); + FluidLoader.Kerogen = FluidLoader.createAndRegisterFluid("Kerogen", new Color(85, 85, 85)); + FluidLoader.BioLabFluidMaterials = new Fluid[]{ new GT_Fluid("FluorecentdDNA", "molten.autogenerated", new short[]{125, 50, 170, 0}), new GT_Fluid("EnzymesSollution", "molten.autogenerated", new short[]{240, 200, 125, 0}), new GT_Fluid("Penicillin", "molten.autogenerated", new short[]{255, 255, 255, 0}), new GT_Fluid("Polymerase", "molten.autogenerated", new short[]{110, 180, 110, 0}), }; - BioLabFluidCells = new ItemStack[BioLabFluidMaterials.length]; - for (int i = 0; i < BioLabFluidMaterials.length; i++) { - FluidRegistry.registerFluid(BioLabFluidMaterials[i]); - BioLabFluidCells[i] = ItemFluidCell.getUniversalFluidCell(new FluidStack(BioLabFluidMaterials[i], 1000)); + FluidLoader.BioLabFluidCells = new ItemStack[FluidLoader.BioLabFluidMaterials.length]; + for (int i = 0; i < FluidLoader.BioLabFluidMaterials.length; i++) { + FluidRegistry.registerFluid(FluidLoader.BioLabFluidMaterials[i]); + FluidLoader.BioLabFluidCells[i] = ItemFluidCell.getUniversalFluidCell(new FluidStack(FluidLoader.BioLabFluidMaterials[i], 1000)); } // BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", BW_Util.splitColorToRBGArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB()))); @@ -83,12 +94,24 @@ public class FluidLoader implements Runnable { } } - bioFluidBlock = new BioFluidBlock(); - GameRegistry.registerBlock(bioFluidBlock, "coloredFluidBlock"); + FluidLoader.bioFluidBlock = new BioFluidBlock(); + GameRegistry.registerBlock(FluidLoader.bioFluidBlock, "coloredFluidBlock"); GameRegistry.registerTileEntity(BWTileEntityDimIDBridge.class, "bwTEDimIDBridge"); if (FMLCommonHandler.instance().getSide().isClient()) { RenderingRegistry.registerBlockHandler(RendererSwitchingColorFluid.instance); RenderingRegistry.registerBlockHandler(RendererGlasBlock.instance); } } + + public static Fluid createAndRegisterFluid(String Name,Color color){ + Fluid f = new GT_Fluid(Name,"molten.autogenerated",new short[]{(short) color.getRed(),(short) color.getGreen(),(short) color.getBlue(), (short) color.getAlpha()}); + FluidRegistry.registerFluid(f); + return f; + } + public static Fluid createAndRegisterFluid(String Name, Color color, int temperature){ + Fluid f = new GT_Fluid(Name,"molten.autogenerated",new short[]{(short) color.getRed(),(short) color.getGreen(),(short) color.getBlue(), (short) color.getAlpha()}); + f.setTemperature(temperature); + FluidRegistry.registerFluid(f); + return f; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index b3fce2c4ac..d9a4c77efc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -149,7 +149,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } private int calcMod(double x) { - return (int) Math.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); + int ret = (int) Math.ceil(100D*(-(2*this.getOutputCapacity()-x)*(2*this.getOutputCapacity()-x)+1D)); + return ret <= 0 ? 1 : ret > 100 ? 100 : ret;//(int) Math.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); } @Override -- cgit From 2b6a28710ab5216ba987c100ce367ffbbbf40fff Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 18 Jul 2019 10:35:55 +0200 Subject: code maintenance +cleaned up code (removed unused imports, resorted modifiers, added qualifiers) +fixed BioVat bonus? maybe? +fixed BioVat Forming issues with invisible TEs inside Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 2b19f3694c04f39845f0b55fb0e012cf1dc265e7 --- .../bartimaeusnek/ASM/BWCoreTransformer.java | 5 - .../client/ClientEventHandler/TooltipCache.java | 5 +- .../ClientEventHandler/TooltipEventHandler.java | 6 +- .../bartworks/client/gui/GT_GUIContainer_LESU.java | 26 ++-- .../client/gui/GT_GUIContainer_RadioHatch.java | 2 - .../client/renderer/BW_GT_Vanilla_Texture.java | 4 +- .../client/renderer/BW_Renderer_Block_Ores.java | 16 +-- .../client/renderer/RendererGlasBlock.java | 2 +- .../bartworks/common/blocks/BW_Blocks.java | 18 +-- .../bartworks/common/blocks/BW_GlasBlocks.java | 37 +++--- .../common/blocks/BW_TileEntityContainer.java | 13 +- .../blocks/BW_TileEntityContainer_Multiple.java | 34 ++--- .../bartworks/common/configs/ConfigHandler.java | 4 +- .../bartworks/common/items/BW_ItemBlocks.java | 14 +-- .../bartworks/common/items/BW_Stonage_Rotors.java | 18 +-- .../bartworks/common/items/Circuit_Programmer.java | 6 +- .../bartworks/common/items/GT_Rockcutter_Item.java | 42 +++---- .../bartworks/common/items/GT_Teslastaff_Item.java | 20 +-- .../bartworks/common/items/SimpleIconItem.java | 5 +- .../bartworks/common/items/SimpleSubItemClass.java | 12 +- .../bartworks/common/loaders/BioCultureLoader.java | 12 +- .../bartworks/common/loaders/BioItemList.java | 26 ++-- .../bartworks/common/loaders/BioLabLoader.java | 16 +-- .../common/loaders/CircuitImprintLoader.java | 2 +- .../bartworks/common/loaders/FluidLoader.java | 3 +- .../bartworks/common/loaders/RecipeLoader.java | 2 +- .../bartworks/common/net/BW_Network.java | 10 +- .../common/net/CircuitProgrammerPacket.java | 16 +-- .../bartworks/common/net/OreDictCachePacket.java | 2 +- .../bartworks/common/net/OrePacket.java | 16 +-- .../bartworks/common/net/RendererPacket.java | 20 +-- .../BW_TileEntity_ExperimentalFloodGate.java | 80 ++++++------ .../classic/BW_TileEntity_HeatedWaterPump.java | 101 ++++++++------- .../classic/BW_TileEntity_InfinityTank.java | 44 +++---- .../tileentities/multis/GT_TileEntity_BioVat.java | 139 ++++++++++----------- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 14 +-- .../multis/GT_TileEntity_CrackingDistillTower.java | 4 +- .../tileentities/multis/GT_TileEntity_DEHP.java | 83 ++++++------ .../GT_TileEntity_ElectricImplosionCompressor.java | 44 +++---- .../tileentities/multis/GT_TileEntity_LESU.java | 52 ++++---- .../multis/GT_TileEntity_ManualTrafo.java | 45 ++++--- .../tileentities/multis/GT_TileEntity_THTR.java | 78 ++++++------ .../multis/GT_TileEntity_Windmill.java | 74 +++++------ .../mega/GT_TileEntity_MegaBlastFurnace.java | 84 ++++++------- .../mega/GT_TileEntity_MegaProcessingArray.java | 126 +++++++++---------- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 12 +- .../tiered/GT_MetaTileEntity_AcidGenerator.java | 4 +- .../tiered/GT_MetaTileEntity_BioLab.java | 28 ++--- .../tiered/GT_MetaTileEntity_Diode.java | 44 +++---- .../tiered/GT_MetaTileEntity_RadioHatch.java | 78 ++++++------ .../tiered/GT_MetaTileEntity_Transistor.java | 16 +-- .../bartworks/neiHandler/BW_NEI_BioLabHandler.java | 8 +- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 32 ++--- .../bartworks/neiHandler/BW_NEI_OreHandler.java | 20 +-- .../bartworks/neiHandler/NEI_BW_Config.java | 4 +- .../container/BW_Container_HeatedWaterPump.java | 90 ++++++------- .../server/container/BW_Container_RadioHatch.java | 28 ++--- .../container/GT_Container_CircuitProgrammer.java | 99 +++++++-------- .../container/GT_Container_Item_Destructopack.java | 12 +- .../server/container/GT_Container_RadioHatch.java | 98 +++++++-------- .../bartworks/system/log/DebugLog.java | 20 +-- .../system/material/BW_MetaGeneratedOreTE.java | 3 +- .../system/material/BW_MetaGeneratedOre_Item.java | 4 +- .../system/material/BW_MetaGenerated_Items.java | 34 +++-- .../system/material/BW_MetaGenerated_Ores.java | 8 +- .../bartworks/system/material/ThreadedLoader.java | 10 +- .../bartworks/system/material/Werkstoff.java | 8 +- .../bartworks/system/material/WerkstoffLoader.java | 33 ++--- .../processingLoaders/AdditionalRecipes.java | 3 +- .../bartworks/system/oredict/OreDictAdder.java | 4 +- .../bartworks/system/oredict/OreDictHandler.java | 10 +- .../system/oregen/BW_WorldGenRoss128b.java | 4 +- .../bartworks/system/worldgen/GT_WorldgenUtil.java | 40 +++--- .../bartworks/system/worldgen/MapGenRuins.java | 91 +++++++------- .../bartimaeusnek/bartworks/util/BW_Util.java | 13 +- .../bartworks/util/ConnectedBlocksChecker.java | 1 - .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 4 +- .../crossmod/GTpp/loader/RadioHatchCompat.java | 18 +-- .../galacticraft/creativetabs/SpaceTab.java | 2 +- .../planets/ross128b/ChunkProviderRoss128b.java | 28 ++--- .../planets/ross128ba/ChunkProviderRoss128ba.java | 6 +- .../solarsystems/Ross128SolarSystem.java | 3 - .../crossmod/openComputers/GT_NBT_DataBase.java | 4 +- .../openComputers/TileEntity_GTDataServer.java | 6 +- .../crossmod/thaumcraft/CustomAspects.java | 9 -- .../crossmod/thaumcraft/tile/GT_WandBuffer.java | 1 - .../thaumcraft/util/ThaumcraftHandler.java | 4 +- 87 files changed, 1141 insertions(+), 1185 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index d3e3eb727b..f2631564c4 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -23,17 +23,12 @@ package com.github.bartimaeusnek.ASM; import net.minecraft.launchwrapper.IClassTransformer; -import net.minecraft.launchwrapper.Launch; -import net.minecraftforge.oredict.OreDictionary; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.tree.*; -import java.io.File; -import java.io.IOException; import java.util.Arrays; import java.util.List; -import java.util.jar.JarFile; import static org.objectweb.asm.Opcodes.*; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java index 5702c32252..f3590b4e90 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java @@ -26,7 +26,10 @@ import com.github.bartimaeusnek.bartworks.util.Pair; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; class TooltipCache { private static final HashMap, char[]> cache = new HashMap<>(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java index 72c0db2735..2532357218 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java @@ -84,14 +84,14 @@ public class TooltipEventHandler { } } - final Block BLOCK = Block.getBlockFromItem(event.itemStack.getItem()); + Block BLOCK = Block.getBlockFromItem(event.itemStack.getItem()); if (BLOCK != null && BLOCK != Blocks.air) { if (BLOCK instanceof BW_Blocks) { TooltipCache.put(event.itemStack, tooAdd); return; } - final BioVatLogicAdder.BlockMetaPair PAIR = new BioVatLogicAdder.BlockMetaPair(BLOCK, (byte) event.itemStack.getItemDamage()); - final HashMap GLASSMAP = BioVatLogicAdder.BioVatGlass.getGlassMap(); + BioVatLogicAdder.BlockMetaPair PAIR = new BioVatLogicAdder.BlockMetaPair(BLOCK, (byte) event.itemStack.getItemDamage()); + HashMap GLASSMAP = BioVatLogicAdder.BioVatGlass.getGlassMap(); if (GLASSMAP.containsKey(PAIR)) { int tier = GLASSMAP.get(PAIR); tooAdd.add( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java index 540f597051..8686cee0be 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -43,7 +43,7 @@ public class GT_GUIContainer_LESU extends GT_GUIContainer { public static final ResourceLocation texture = new ResourceLocation(MainMod.MOD_ID, "textures/GT2/gui/LESU.png"); protected GT_Container_LESU mContainer; - private GT_TileEntity_LESU c; + private final GT_TileEntity_LESU c; public GT_GUIContainer_LESU(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_LESU(aInventoryPlayer, aTileEntity), GT_GUIContainer_LESU.texture.getResourceDomain()); @@ -52,16 +52,16 @@ public class GT_GUIContainer_LESU extends GT_GUIContainer { } @Override - protected void drawGuiContainerForegroundLayer(final int par1, final int par2) { + protected void drawGuiContainerForegroundLayer(int par1, int par2) { this.drawString(this.fontRendererObj, "L.E.S.U.", 11, 8, 16448255); if (this.mContainer != null) { String percell = String.valueOf(ConfigHandler.energyPerCell).substring(1); - this.drawString(this.fontRendererObj, "EU: " + String.valueOf(this.mContainer.mEnergy), 11, 16, 16448255); - this.drawString(this.fontRendererObj, "MAX: " + (this.c.getBaseMetaTileEntity().isActive() ? String.valueOf(this.mContainer.mOutput) + percell : Integer.toString(0)), 11, 24, 16448255); - this.drawString(this.fontRendererObj, "MAX EU/t IN: " + String.valueOf(this.mContainer.mInput), 11, 32, 16448255); - this.drawString(this.fontRendererObj, "EU/t OUT: " + String.valueOf(this.mContainer.mOutput), 11, 40, 16448255); - this.drawString(this.fontRendererObj, "AMP/t IN/OUT: " + String.valueOf(this.c.getBaseMetaTileEntity().getInputAmperage()), 11, 48, 16448255); - if (c.maxEUStore() >= Long.MAX_VALUE - 1) { + this.drawString(this.fontRendererObj, "EU: " + this.mContainer.mEnergy, 11, 16, 16448255); + this.drawString(this.fontRendererObj, "MAX: " + (this.c.getBaseMetaTileEntity().isActive() ? this.mContainer.mOutput + percell : Integer.toString(0)), 11, 24, 16448255); + this.drawString(this.fontRendererObj, "MAX EU/t IN: " + this.mContainer.mInput, 11, 32, 16448255); + this.drawString(this.fontRendererObj, "EU/t OUT: " + this.mContainer.mOutput, 11, 40, 16448255); + this.drawString(this.fontRendererObj, "AMP/t IN/OUT: " + this.c.getBaseMetaTileEntity().getInputAmperage(), 11, 48, 16448255); + if (this.c.maxEUStore() >= Long.MAX_VALUE - 1) { this.drawString(this.fontRendererObj, StatCollector.translateToLocal("tooltip.LESU.0.name"), 11, 56, Color.YELLOW.getRGB()); } if (!this.c.getBaseMetaTileEntity().isActive()) { @@ -71,14 +71,14 @@ public class GT_GUIContainer_LESU extends GT_GUIContainer { } @Override - protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) { + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - Minecraft.getMinecraft().getTextureManager().bindTexture(texture); - final int x = (this.width - this.xSize) / 2; - final int y = (this.height - this.ySize) / 2; + Minecraft.getMinecraft().getTextureManager().bindTexture(GT_GUIContainer_LESU.texture); + int x = (this.width - this.xSize) / 2; + int y = (this.height - this.ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); if (this.mContainer != null) { - final long tScale = this.mContainer.mEnergy / Math.max(1, c.maxEUStore() / 116); + long tScale = this.mContainer.mEnergy / Math.max(1, this.c.maxEUStore() / 116); this.drawTexturedModalRect(x + 8, y + 73, 0, 251, (int) tScale, 5); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java index d214b4b09e..86779b71d0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java @@ -26,8 +26,6 @@ import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; -import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java index bb93e0e506..879274d114 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java @@ -49,7 +49,7 @@ public class BW_GT_Vanilla_Texture implements IIconContainer { @Override public IIcon getIcon() { - return packed; + return this.packed; } @Override @@ -59,6 +59,6 @@ public class BW_GT_Vanilla_Texture implements IIconContainer { @Override public ResourceLocation getTextureFile() { - return new ResourceLocation(packed.getIconName()); + return new ResourceLocation(this.packed.getIconName()); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index 7f537b5054..397f0d3bc8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -48,27 +48,27 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { GL11.glTranslatef(-0.5F, -0.5F, -0.5F); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F); - renderNegativeYFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 0), true); + renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 0), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F); - renderPositiveYFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 1), true); + renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 1), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F); - renderNegativeZFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 2), true); + renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 2), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F); - renderPositiveZFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 3), true); + renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 3), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F); - renderNegativeXFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 4), true); + renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 4), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F); - renderPositiveXFacing((IBlockAccess) null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 5), true); + renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 5), true); Tessellator.instance.draw(); aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); aRenderer.setRenderBoundsFromBlock(aBlock); @@ -77,7 +77,7 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return GT_Renderer_Block.renderStandardBlock(world, x, y, z, block, renderer); + return renderStandardBlock(world, x, y, z, block, renderer); } @Override @@ -87,6 +87,6 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { @Override public int getRenderId() { - return mRenderID; + return this.mRenderID; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java index 423fb20468..82150c7913 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java @@ -90,6 +90,6 @@ public class RendererGlasBlock implements ISimpleBlockRenderingHandler { @Override public int getRenderId() { - return RID; + return RendererGlasBlock.RID; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java index 9860ec1c41..cf81a296f3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java @@ -42,7 +42,7 @@ public class BW_Blocks extends Block { @SideOnly(Side.CLIENT) protected IIcon[] texture; - protected String[] textureNames; + String[] textureNames; protected String name; public BW_Blocks(String name, String[] texture) { @@ -73,14 +73,14 @@ public class BW_Blocks extends Block { } @Override - public int damageDropped(final int meta) { + public int damageDropped(int meta) { return meta; } @Override @SideOnly(Side.CLIENT) - public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) { - for (int i = 0; i < textureNames.length; i++) { + public void getSubBlocks(Item item, CreativeTabs tab, List list) { + for (int i = 0; i < this.textureNames.length; i++) { list.add(new ItemStack(item, 1, i)); } } @@ -88,21 +88,21 @@ public class BW_Blocks extends Block { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { - return meta < texture.length ? texture[meta] : texture[0]; + return meta < this.texture.length ? this.texture[meta] : this.texture[0]; } @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister par1IconRegister) { - texture = new IIcon[textureNames.length]; - for (int i = 0; i < textureNames.length; i++) { - texture[i] = par1IconRegister.registerIcon(textureNames[i]); + this.texture = new IIcon[this.textureNames.length]; + for (int i = 0; i < this.textureNames.length; i++) { + this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]); } } @Override public String getUnlocalizedName() { - return name; + return this.name; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java index 893afa625f..3d6d3e41b0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java @@ -36,14 +36,15 @@ import net.minecraftforge.common.util.ForgeDirection; public class BW_GlasBlocks extends BW_Blocks { @SideOnly(Side.CLIENT) - IIcon[] connectedTexture; + private IIcon[] connectedTexture; - boolean connectedTex, fake; - short[][] color = new short[textureNames.length][3]; + private final boolean connectedTex; + private boolean fake; + private short[][] color = new short[this.textureNames.length][3]; public BW_GlasBlocks(String name, String[] texture, CreativeTabs tabs) { super(name, texture, tabs, Material.glass); - connectedTex = false; + this.connectedTex = false; } @@ -55,7 +56,7 @@ public class BW_GlasBlocks extends BW_Blocks { } public short[] getColor(int meta) { - return meta < texture.length ? color[meta] : color[0]; + return meta < this.texture.length ? this.color[meta] : this.color[0]; } @Override @@ -75,25 +76,25 @@ public class BW_GlasBlocks extends BW_Blocks { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { - return meta < texture.length ? texture[meta] : texture[0]; + return meta < this.texture.length ? this.texture[meta] : this.texture[0]; } @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister par1IconRegister) { - if (!connectedTex) { - texture = new IIcon[textureNames.length]; - for (int i = 0; i < textureNames.length; i++) { - texture[i] = par1IconRegister.registerIcon(textureNames[i]); + if (!this.connectedTex) { + this.texture = new IIcon[this.textureNames.length]; + for (int i = 0; i < this.textureNames.length; i++) { + this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]); } return; } - texture = new IIcon[textureNames.length]; - connectedTexture = new IIcon[16]; - for (int i = 0; i < textureNames.length; i++) { - texture[i] = par1IconRegister.registerIcon(textureNames[i]); + this.texture = new IIcon[this.textureNames.length]; + this.connectedTexture = new IIcon[16]; + for (int i = 0; i < this.textureNames.length; i++) { + this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]); for (int j = 0; j < 16; j++) { - connectedTexture[j] = par1IconRegister.registerIcon(textureNames[0] + "_" + j); + this.connectedTexture[j] = par1IconRegister.registerIcon(this.textureNames[0] + "_" + j); } } } @@ -102,7 +103,7 @@ public class BW_GlasBlocks extends BW_Blocks { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(IBlockAccess worldClient, int xCoord, int yCoord, int zCoord, int aSide) { - if (!connectedTex) + if (!this.connectedTex) return super.getIcon(worldClient, xCoord, yCoord, zCoord, aSide); ForgeDirection dir = ForgeDirection.getOrientation(aSide); @@ -170,7 +171,7 @@ public class BW_GlasBlocks extends BW_Blocks { break; } } - return connectedTexture[sides]; + return this.connectedTexture[sides]; } @Override @@ -181,7 +182,7 @@ public class BW_GlasBlocks extends BW_Blocks { @Override public int getRenderType() { - if (!fake && FMLCommonHandler.instance().getSide().isClient()) + if (!this.fake && FMLCommonHandler.instance().getSide().isClient()) return RendererGlasBlock.RID; else return 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index 4cc851df67..b6a1ee611d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -43,7 +43,6 @@ import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; -import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; @@ -54,7 +53,7 @@ import net.minecraftforge.fluids.IFluidContainerItem; public class BW_TileEntityContainer extends BlockContainer implements ITileAddsInformation { - Class tileEntity = null; + Class tileEntity; public BW_TileEntityContainer(Material p_i45386_1_, Class tileEntity, String blockName) { super(p_i45386_1_); @@ -71,7 +70,7 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI if (worldObj.isRemote) { return false; } - final TileEntity tile = worldObj.getTileEntity(x, y, z); + TileEntity tile = worldObj.getTileEntity(x, y, z); if (tile instanceof BW_TileEntity_HeatedWaterPump) { if (player.getHeldItem() != null && (player.getHeldItem().getItem().equals(Items.bucket) || player.getHeldItem().getItem() instanceof IFluidContainerItem) && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false) != null) if (player.getHeldItem().getItem().equals(Items.bucket) && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false).amount == 1000) { @@ -93,14 +92,14 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI return false; } - public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack itemStack) { - final TileEntity tile = world.getTileEntity(x, y, z); + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) { + TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof IWrenchable && itemStack != null) { - final IWrenchable tile2 = (IWrenchable) tile; + IWrenchable tile2 = (IWrenchable) tile; int meta = itemStack.getItemDamage(); world.setBlockMetadataWithNotify(x, y, z, meta, 2); if (entity != null) { - final int face = MathHelper.floor_double(entity.rotationYaw * 4.0f / 360.0f + 0.5) & 0x3; + int face = MathHelper.floor_double(entity.rotationYaw * 4.0f / 360.0f + 0.5) & 0x3; switch (face) { case 0: tile2.setFacing((short) 2); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java index 112d57de9b..eac3b5fd28 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java @@ -49,9 +49,9 @@ import java.util.List; public class BW_TileEntityContainer_Multiple extends BlockContainer { - final protected String[] textureNames; - final protected String name; - final Class[] tileEntityArray; + protected final String[] textureNames; + protected final String name; + protected final Class[] tileEntityArray; @SideOnly(Side.CLIENT) protected IIcon[] texture; @@ -59,8 +59,8 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { super(p_i45386_1_); this.setHardness(15.0F); this.setResistance(30.0F); - tileEntityArray = tileEntity; - name = blockName; + this.tileEntityArray = tileEntity; + this.name = blockName; this.textureNames = textureNames; this.setCreativeTab(tabs); this.setBlockName(blockName); @@ -73,7 +73,7 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { return true; } if (!player.isSneaking()) { - final TileEntity tile = worldObj.getTileEntity(x, y, z); + TileEntity tile = worldObj.getTileEntity(x, y, z); if (tile instanceof IHasGui) { return worldObj.isRemote || IC2.platform.launchGui(player, (IHasGui) tile); } else if (tile instanceof ITileWithGUI) { @@ -84,14 +84,14 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { return false; } - public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack itemStack) { - final TileEntity tile = world.getTileEntity(x, y, z); + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) { + TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof IWrenchable && itemStack != null) { - final IWrenchable tile2 = (IWrenchable) tile; + IWrenchable tile2 = (IWrenchable) tile; int meta = itemStack.getItemDamage(); world.setBlockMetadataWithNotify(x, y, z, meta, 2); if (entity != null) { - final int face = MathHelper.floor_double(entity.rotationYaw * 4.0f / 360.0f + 0.5) & 0x3; + int face = MathHelper.floor_double(entity.rotationYaw * 4.0f / 360.0f + 0.5) & 0x3; switch (face) { case 0: tile2.setFacing((short) 2); @@ -111,14 +111,14 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { } @Override - public int damageDropped(final int meta) { + public int damageDropped(int meta) { return meta; } @Override @SideOnly(Side.CLIENT) - public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) { - for (int i = 0; i < textureNames.length; i++) { + public void getSubBlocks(Item item, CreativeTabs tab, List list) { + for (int i = 0; i < this.textureNames.length; i++) { list.add(new ItemStack(item, 1, i)); } } @@ -126,15 +126,15 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { - return meta < texture.length ? texture[meta] : texture[0]; + return meta < this.texture.length ? this.texture[meta] : this.texture[0]; } @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister par1IconRegister) { - texture = new IIcon[textureNames.length]; - for (int i = 0; i < textureNames.length; i++) { - texture[i] = par1IconRegister.registerIcon(textureNames[i]); + this.texture = new IIcon[this.textureNames.length]; + for (int i = 0; i < this.textureNames.length; i++) { + this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 3ecfd658b3..95cde7ddcc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.configs; -import com.github.bartimaeusnek.ASM.BWCoreTransformer;; +import com.github.bartimaeusnek.ASM.BWCoreTransformer; import net.minecraftforge.common.config.Configuration; import java.util.Arrays; @@ -42,7 +42,7 @@ public class ConfigHandler { public static int ross128batier = 3; public static int landerType = 3; public static int ross128bRuinChance = 512; - public static int creativeScannerID = 0; + public static int creativeScannerID; public static long energyPerCell = 1000000L; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index 86ea3198eb..db5a66173f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -44,10 +44,10 @@ import java.util.List; public class BW_ItemBlocks extends ItemBlock { - protected final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); - protected final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + private final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + private final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); - public BW_ItemBlocks(final Block par1) { + public BW_ItemBlocks(Block par1) { super(par1); this.setMaxDamage(0); this.setHasSubtypes(true); @@ -55,18 +55,18 @@ public class BW_ItemBlocks extends ItemBlock { } @Override - public int getMetadata(final int aMeta) { + public int getMetadata(int aMeta) { return aMeta; } @Override - public String getUnlocalizedName(final ItemStack aStack) { + public String getUnlocalizedName(ItemStack aStack) { return this.field_150939_a.getUnlocalizedName() + "." + this.getDamage(aStack); } @Override @SideOnly(Side.CLIENT) - public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { if (this.field_150939_a instanceof BW_GlasBlocks) aList.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + BW_ColorUtil.getColorForTier(BW_Util.getTierFromGlasMeta(aStack.getItemDamage())) + GT_Values.VN[BW_Util.getTierFromGlasMeta(aStack.getItemDamage())]); if (this.field_150939_a instanceof ITileAddsInformation) { @@ -90,7 +90,7 @@ public class BW_ItemBlocks extends ItemBlock { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - return getIcon(stack, renderPass); + return this.getIcon(stack, renderPass); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index f67a912aee..6c11a9be64 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -44,13 +44,13 @@ import static ic2.api.item.IKineticRotor.GearboxType.WIND; public class BW_Stonage_Rotors extends Item implements IKineticRotor { - private int[] DiaMinMax = new int[3]; - private float eff; - private GearboxType type; - private ResourceLocation tex; - private String itemTex; + private final int[] DiaMinMax = new int[3]; + private final float eff; + private final IKineticRotor.GearboxType type; + private final ResourceLocation tex; + private final String itemTex; - public BW_Stonage_Rotors(int diameter, float eff, int min, int max, int durability, GearboxType type, ResourceLocation tex, String Name, String itemTex) { + public BW_Stonage_Rotors(int diameter, float eff, int min, int max, int durability, IKineticRotor.GearboxType type, ResourceLocation tex, String Name, String itemTex) { this.DiaMinMax[0] = diameter; this.DiaMinMax[1] = min; this.DiaMinMax[2] = max; @@ -65,12 +65,12 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(MainMod.MOD_ID + ":" + itemTex); + this.itemIcon = iconRegister.registerIcon(MainMod.MOD_ID + ":" + this.itemTex); } public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", this.DiaMinMax[1], this.DiaMinMax[2])); - GearboxType type = null; + IKineticRotor.GearboxType type = null; if (Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator) { type = WATER; } else if (Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator) { @@ -111,7 +111,7 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { } @Override - public boolean isAcceptedType(ItemStack itemStack, GearboxType gearboxType) { + public boolean isAcceptedType(ItemStack itemStack, IKineticRotor.GearboxType gearboxType) { return gearboxType.equals(this.type); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index c3491ca6f3..136ccb27b5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -69,13 +69,13 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem @SideOnly(Side.CLIENT) public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); - if (getChargedItem(itemStack) == this) { + if (this.getChargedItem(itemStack) == this) { ItemStack charged = new ItemStack(this, 1); ElectricItem.manager.charge(charged, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false); itemList.add(charged); } - if (getEmptyItem(itemStack) == this) { - itemList.add(new ItemStack(this, 1, getMaxDamage())); + if (this.getEmptyItem(itemStack) == this) { + itemList.add(new ItemStack(this, 1, this.getMaxDamage())); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index f744be70b7..5d5f8b790c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -51,36 +51,36 @@ import java.util.List; import java.util.Set; public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { - public static Set mineableBlocks = Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); - public int mCharge; - public int mTransfer; + private static Set mineableBlocks = Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); + private final int mCharge; + private final int mTransfer; public int mTier; @SideOnly(Side.CLIENT) private IIcon icon; - private int multi; + private final int multi; public GT_Rockcutter_Item(int aTier) { - super(2 * aTier, ToolMaterial.EMERALD, mineableBlocks); + super(2 * aTier, Item.ToolMaterial.EMERALD, GT_Rockcutter_Item.mineableBlocks); this.mTier = aTier; - multi = (int) Math.pow(10, (mTier - 1)); - this.mineableBlocks = new HashSet(); + this.multi = (int) Math.pow(10, (this.mTier - 1)); + GT_Rockcutter_Item.mineableBlocks = new HashSet(); this.maxStackSize = 1; - this.mCharge = 10000 * multi; - this.mTransfer = (int) GT_Values.V[mTier]; - this.efficiencyOnProperMaterial = 2.0f * mTier; + this.mCharge = 10000 * this.multi; + this.mTransfer = (int) GT_Values.V[this.mTier]; + this.efficiencyOnProperMaterial = 2.0f * this.mTier; this.setCreativeTab(MainMod.GT2); - this.setMaxDamage(27 + 10 * multi); + this.setMaxDamage(27 + 10 * this.multi); this.setNoRepair(); - this.setUnlocalizedName("GT_Rockcutter_Item_" + GT_Values.VN[mTier]); + this.setUnlocalizedName("GT_Rockcutter_Item_" + GT_Values.VN[this.mTier]); } - public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { aList.add(StatCollector.translateToLocal("tooltip.bw.tier.name") + " " + GT_Values.VN[this.mTier]); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } public void onUpdate(ItemStack aStack, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { - if (!ElectricItem.manager.canUse(aStack, 500 * multi)) { + if (!ElectricItem.manager.canUse(aStack, 500 * this.multi)) { if (aStack.isItemEnchanted()) { aStack.getTagCompound().removeTag("ench"); } @@ -94,10 +94,10 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { return false; } - public boolean onBlockDestroyed(final ItemStack var1, final World var2, final Block var3, final int var4, final int var5, final int var6, final EntityLivingBase var7) { + public boolean onBlockDestroyed(ItemStack var1, World var2, Block var3, int var4, int var5, int var6, EntityLivingBase var7) { ElectricItem.manager.use(var1, 0, var7); - if (ElectricItem.manager.canUse(var1, 500 * multi)) { - ElectricItem.manager.use(var1, 500 * multi, var7); + if (ElectricItem.manager.canUse(var1, 500 * this.multi)) { + ElectricItem.manager.use(var1, 500 * this.multi, var7); } else { ElectricItem.manager.discharge(var1, Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, false); } @@ -106,19 +106,19 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { @Override public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) { - return par1Block.getMaterial().equals(Material.glass) || par1Block.getMaterial().equals(Material.clay) || par1Block.getMaterial().equals(Material.packedIce) || par1Block.getMaterial().equals(Material.ice) || par1Block.getMaterial().equals(Material.sand) || par1Block.getMaterial().equals(Material.ground) || par1Block.getMaterial().equals(Material.rock) || this.mineableBlocks.contains(par1Block); + return par1Block.getMaterial().equals(Material.glass) || par1Block.getMaterial().equals(Material.clay) || par1Block.getMaterial().equals(Material.packedIce) || par1Block.getMaterial().equals(Material.ice) || par1Block.getMaterial().equals(Material.sand) || par1Block.getMaterial().equals(Material.ground) || par1Block.getMaterial().equals(Material.rock) || mineableBlocks.contains(par1Block); } @SideOnly(Side.CLIENT) public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); - if (getChargedItem(itemStack) == this) { + if (this.getChargedItem(itemStack) == this) { ItemStack charged = new ItemStack(this, 1); ElectricItem.manager.charge(charged, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false); itemList.add(charged); } - if (getEmptyItem(itemStack) == this) { - itemList.add(new ItemStack(this, 1, getMaxDamage())); + if (this.getEmptyItem(itemStack) == this) { + itemList.add(new ItemStack(this, 1, this.getMaxDamage())); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java index 4a25b7e951..b45b831bae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -45,15 +45,15 @@ import java.util.List; import java.util.Set; public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { - private static Set effective = Sets.newHashSet(Blocks.web); - public double mCharge; - public double mTransfer; + private static final Set effective = Sets.newHashSet(Blocks.web); + private final double mCharge; + private final double mTransfer; public int mTier; @SideOnly(Side.CLIENT) private IIcon icon; public GT_Teslastaff_Item() { - super(0, ToolMaterial.GOLD, effective); + super(0, Item.ToolMaterial.GOLD, GT_Teslastaff_Item.effective); this.setCreativeTab(MainMod.GT2); this.setNoRepair(); this.mCharge = 10000000D; @@ -65,15 +65,15 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { } @Override - public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { aList.add(StatCollector.translateToLocal("tooltip.teslastaff.0.name")); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } public boolean hitEntity(ItemStack aStack, EntityLivingBase aTarget, EntityLivingBase aPlayer) { if (aTarget instanceof EntityLiving && ElectricItem.manager.canUse(aStack, 9000000)) { - final EntityLiving tTarget = (EntityLiving) aTarget; - final EntityLivingBase tPlayer = (EntityLivingBase) aPlayer; + EntityLiving tTarget = (EntityLiving) aTarget; + EntityLivingBase tPlayer = aPlayer; ElectricItem.manager.use(aStack, 9000000, tPlayer); for (int i = 1; i < 5; ++i) { if (tTarget.getEquipmentInSlot(i) != null && tTarget.getEquipmentInSlot(i).getItem() instanceof IElectricItem) { @@ -87,13 +87,13 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { @SideOnly(Side.CLIENT) public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); - if (getChargedItem(itemStack) == this) { + if (this.getChargedItem(itemStack) == this) { ItemStack charged = new ItemStack(this, 1); ElectricItem.manager.charge(charged, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false); itemList.add(charged); } - if (getEmptyItem(itemStack) == this) { - itemList.add(new ItemStack(this, 1, getMaxDamage())); + if (this.getEmptyItem(itemStack) == this) { + itemList.add(new ItemStack(this, 1, this.getMaxDamage())); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java index c38be6c6c0..1ca3c8fe2f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java @@ -29,15 +29,14 @@ import net.minecraft.item.Item; public class SimpleIconItem extends Item { - String tex; + private final String tex; public SimpleIconItem(String tex) { - super(); this.tex = tex; } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { - itemIcon = iconRegister.registerIcon("bartworks:" + tex); + this.itemIcon = iconRegister.registerIcon("bartworks:" + this.tex); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java index 8c6d810869..3d312d6e37 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -49,9 +49,9 @@ public class SimpleSubItemClass extends Item { @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { - itemIcon = new IIcon[tex.length]; - for (int i = 0; i < tex.length; i++) { - itemIcon[i] = iconRegister.registerIcon(MainMod.MOD_ID + ":" + tex[i]); + this.itemIcon = new IIcon[this.tex.length]; + for (int i = 0; i < this.tex.length; i++) { + this.itemIcon[i] = iconRegister.registerIcon(MainMod.MOD_ID + ":" + this.tex[i]); } } @@ -64,21 +64,21 @@ public class SimpleSubItemClass extends Item { @Override public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { - for (int i = 0; i < tex.length; i++) { + for (int i = 0; i < this.tex.length; i++) { p_150895_3_.add(new ItemStack(p_150895_1_, 1, i)); } } @SideOnly(Side.CLIENT) public IIcon getIconFromDamage(int p_77617_1_) { - if (p_77617_1_ < tex.length) + if (p_77617_1_ < this.tex.length) return this.itemIcon[p_77617_1_]; else return this.itemIcon[0]; } public String getUnlocalizedName(ItemStack p_77667_1_) { - if (p_77667_1_.getItemDamage() < tex.length) + if (p_77667_1_.getItemDamage() < this.tex.length) return "item." + this.tex[p_77667_1_.getItemDamage()].replaceAll("/", "."); else return "WrongDamageItemDestroyIt"; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java index 53b59830eb..57a9ee9aac 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java @@ -48,12 +48,12 @@ public class BioCultureLoader implements Runnable { public static BioCulture anaerobicOil; @Override public void run() { - CommonYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae", BioPlasmid.convertDataToPlasmid(BIO_DATA_YEAST), BioDNA.convertDataToDNA(BIO_DATA_YEAST), true); - WhineYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var bayanus", BioPlasmid.convertDataToPlasmid(BIO_DATA_YEAST), BIO_DNA_WHINE_YEAST, true); - BeerYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var cerevisiae", BioPlasmid.convertDataToPlasmid(BIO_DATA_YEAST), BIO_DNA_BEER_YEAST, true); - rottenFleshBacteria = BioCulture.createAndRegisterBioCulture(new Color(110, 40, 25), "Escherichia cadaver", BioPlasmid.convertDataToPlasmid(BIO_DATA_BETA_LACMATASE), BioDNA.convertDataToDNA(BIO_DATA_BETA_LACMATASE), false); - eColi = BioCulture.createAndRegisterBioCulture(new Color(149, 132, 75), "Escherichia koli", BioPlasmid.convertDataToPlasmid(eColiData), BioDNA.convertDataToDNA(eColiData), true); - anaerobicOil = BioCulture.createAndRegisterBioCulture(new Color(0, 0, 0), "Pseudomonas Veronii", BioPlasmid.convertDataToPlasmid(BIO_DNA_ANAEROBIC_OIL), BioDNA.convertDataToDNA(BIO_DATA_ANAEROBIC_OIL), true); + BioCultureLoader.CommonYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_YEAST), true); + BioCultureLoader.WhineYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var bayanus", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_WHINE_YEAST, true); + BioCultureLoader.BeerYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_BEER_YEAST, true); + BioCultureLoader.rottenFleshBacteria = BioCulture.createAndRegisterBioCulture(new Color(110, 40, 25), "Escherichia cadaver", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_BETA_LACMATASE), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_BETA_LACMATASE), false); + BioCultureLoader.eColi = BioCulture.createAndRegisterBioCulture(new Color(149, 132, 75), "Escherichia koli", BioPlasmid.convertDataToPlasmid(BioCultureLoader.eColiData), BioDNA.convertDataToDNA(BioCultureLoader.eColiData), true); + BioCultureLoader.anaerobicOil = BioCulture.createAndRegisterBioCulture(new Color(0, 0, 0), "Pseudomonas Veronii", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_ANAEROBIC_OIL), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_ANAEROBIC_OIL), true); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java index 590cc6048d..7968e2996c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java @@ -40,18 +40,18 @@ public class BioItemList { private static final Item mItemBioLabParts = new LabModule(new String[]{"DNAExtractionModule", "PCRThermoclyclingModule", "PlasmidSynthesisModule", "TransformationModule", "ClonalCellularSynthesisModule"}); - public static final ItemStack[] mBioLabParts = {new ItemStack(mItemBioLabParts), new ItemStack(mItemBioLabParts, 1, 1), new ItemStack(mItemBioLabParts, 1, 2), new ItemStack(mItemBioLabParts, 1, 3), new ItemStack(mItemBioLabParts, 1, 4)}; + public static final ItemStack[] mBioLabParts = {new ItemStack(BioItemList.mItemBioLabParts), new ItemStack(BioItemList.mItemBioLabParts, 1, 1), new ItemStack(BioItemList.mItemBioLabParts, 1, 2), new ItemStack(BioItemList.mItemBioLabParts, 1, 3), new ItemStack(BioItemList.mItemBioLabParts, 1, 4)}; private static final Item vanillaBioLabParts = new LabParts(new String[]{"petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", "IncubationModule", "PlasmaMembrane"}); public BioItemList() { - GameRegistry.registerItem(mItemBioLabParts, "BioLabModules"); - GameRegistry.registerItem(vanillaBioLabParts, "BioLabParts"); + GameRegistry.registerItem(BioItemList.mItemBioLabParts, "BioLabModules"); + GameRegistry.registerItem(BioItemList.vanillaBioLabParts, "BioLabParts"); } public static Collection getAllPetriDishes() { HashSet ret = new HashSet<>(); for (BioCulture Culture : BioCulture.BIO_CULTURE_ARRAY_LIST) { - ret.add(getPetriDish(Culture)); + ret.add(BioItemList.getPetriDish(Culture)); } return ret; } @@ -59,7 +59,7 @@ public class BioItemList { public static Collection getAllDNASampleFlasks() { HashSet ret = new HashSet<>(); for (BioData dna : BioData.BIO_DATA_ARRAY_LIST) { - ret.add(getDNASampleFlask(BioDNA.convertDataToDNA(dna))); + ret.add(BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(dna))); } return ret; } @@ -67,32 +67,32 @@ public class BioItemList { public static Collection getAllPlasmidCells() { HashSet ret = new HashSet<>(); for (BioData dna : BioData.BIO_DATA_ARRAY_LIST) { - ret.add(getPlasmidCell(BioPlasmid.convertDataToPlasmid(dna))); + ret.add(BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(dna))); } return ret; } public static ItemStack getPetriDish(BioCulture Culture) { if (Culture == null) - return new ItemStack(vanillaBioLabParts); - ItemStack ret = new ItemStack(vanillaBioLabParts); + return new ItemStack(BioItemList.vanillaBioLabParts); + ItemStack ret = new ItemStack(BioItemList.vanillaBioLabParts); ret.setTagCompound(BioCulture.getNBTTagFromCulture(Culture)); return ret; } public static ItemStack getDNASampleFlask(BioDNA dna) { if (dna == null) - return new ItemStack(vanillaBioLabParts, 1, 1); + return new ItemStack(BioItemList.vanillaBioLabParts, 1, 1); - ItemStack ret = new ItemStack(vanillaBioLabParts, 1, 1); + ItemStack ret = new ItemStack(BioItemList.vanillaBioLabParts, 1, 1); ret.setTagCompound(BioData.getNBTTagFromBioData(dna)); return ret; } public static ItemStack getPlasmidCell(BioPlasmid plasmid) { if (plasmid == null) - return new ItemStack(vanillaBioLabParts, 1, 2); - ItemStack ret = new ItemStack(vanillaBioLabParts, 1, 2); + return new ItemStack(BioItemList.vanillaBioLabParts, 1, 2); + ItemStack ret = new ItemStack(BioItemList.vanillaBioLabParts, 1, 2); ret.setTagCompound(BioData.getNBTTagFromBioData(plasmid)); return ret; } @@ -111,6 +111,6 @@ public class BioItemList { if (selection < 1 || selection > 4) return null; - return new ItemStack(vanillaBioLabParts, 1, 2 + selection); + return new ItemStack(BioItemList.vanillaBioLabParts, 1, 2 + selection); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java index 4f862ba6a9..dbb060700a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java @@ -25,16 +25,16 @@ package com.github.bartimaeusnek.bartworks.common.loaders; public class BioLabLoader implements Runnable { - FluidLoader fluidLoader; - BioItemList bioItemList; - BioRecipeLoader bioRecipeLoader; + private FluidLoader fluidLoader; + private BioItemList bioItemList; + private BioRecipeLoader bioRecipeLoader; @Override public void run() { - fluidLoader = new FluidLoader(); - fluidLoader.run(); - bioItemList = new BioItemList(); - bioRecipeLoader = new BioRecipeLoader(); - bioRecipeLoader.run(); + this.fluidLoader = new FluidLoader(); + this.fluidLoader.run(); + this.bioItemList = new BioItemList(); + this.bioRecipeLoader = new BioRecipeLoader(); + this.bioRecipeLoader.run(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java index 97cc8e3c85..1027e8b344 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java @@ -30,7 +30,7 @@ import java.util.HashSet; public class CircuitImprintLoader implements Runnable { - private static HashSet circuitTypes = new HashSet<>(); + private static final HashSet circuitTypes = new HashSet<>(); @Override public void run() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index af33363990..6503dcef86 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -27,7 +27,6 @@ import com.github.bartimaeusnek.bartworks.client.renderer.RendererSwitchingColor import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BWTileEntityDimIDBridge; import com.github.bartimaeusnek.bartworks.util.BioCulture; -import com.github.bartimaeusnek.bartworks.util.Pair; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; @@ -44,8 +43,8 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.util.Arrays; import java.awt.*; +import java.util.Arrays; public class FluidLoader implements Runnable { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 7174c2176b..ffe29352ba 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -222,7 +222,7 @@ public class RecipeLoader implements Runnable { if (!ConfigHandler.GTNH) GT_ModHandler.addCraftingRecipe( ItemRegistry.dehp, - BITSD, + RecipeLoader.BITSD, new Object[]{ "GPG", "NCN", diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index 277823b5f4..e7708253e1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -54,11 +54,11 @@ import java.util.List; @ChannelHandler.Sharable public class BW_Network extends MessageToMessageCodec implements IGT_NetworkHandler { - private EnumMap mChannel; - private GT_Packet[] mSubChannels; + private final EnumMap mChannel; + private final GT_Packet[] mSubChannels; public BW_Network() { - this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", new ChannelHandler[]{this, new HandlerShared()}); + this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", this, new BW_Network.HandlerShared()); this.mSubChannels = new GT_Packet[]{new RendererPacket(), new CircuitProgrammerPacket(), new OrePacket(), new OreDictCachePacket()}; } @@ -98,10 +98,8 @@ public class BW_Network extends MessageToMessageCodec public void sendPacketToAllPlayersInRange(World aWorld, @Nonnull GT_Packet aPacket, int aX, int aZ) { if (!aWorld.isRemote) { - Iterator var5 = aWorld.playerEntities.iterator(); - while (var5.hasNext()) { - Object tObject = var5.next(); + for (Object tObject : aWorld.playerEntities) { if (!(tObject instanceof EntityPlayerMP)) { break; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java index 23cf7a263f..0da061e352 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java @@ -60,7 +60,7 @@ public class CircuitProgrammerPacket extends GT_Packet { @Override public byte[] encode() { - return ByteBuffer.allocate(9).putInt(0, dimID).putInt(4, playerID).put(8, (hasChip ? chipCfg : -1)).array(); + return ByteBuffer.allocate(9).putInt(0, this.dimID).putInt(4, this.playerID).put(8, (this.hasChip ? this.chipCfg : -1)).array(); } @Override @@ -72,18 +72,18 @@ public class CircuitProgrammerPacket extends GT_Packet { @Override public void process(IBlockAccess iBlockAccess) { - World w = DimensionManager.getWorld(dimID); - if (w != null && w.getEntityByID(playerID) instanceof EntityPlayer) { - ItemStack stack = ((EntityPlayer) w.getEntityByID(playerID)).getHeldItem(); + World w = DimensionManager.getWorld(this.dimID); + if (w != null && w.getEntityByID(this.playerID) instanceof EntityPlayer) { + ItemStack stack = ((EntityPlayer) w.getEntityByID(this.playerID)).getHeldItem(); if ((stack != null) && (stack.stackSize > 0)) { Item item = stack.getItem(); if (item instanceof Circuit_Programmer) { NBTTagCompound nbt = stack.getTagCompound(); - nbt.setBoolean("HasChip", hasChip); - if (hasChip) - nbt.setByte("ChipConfig", chipCfg); + nbt.setBoolean("HasChip", this.hasChip); + if (this.hasChip) + nbt.setByte("ChipConfig", this.chipCfg); stack.setTagCompound(nbt); - ((EntityPlayer) w.getEntityByID(playerID)).inventory.setInventorySlotContents(((EntityPlayer) w.getEntityByID(playerID)).inventory.currentItem, stack); + ((EntityPlayer) w.getEntityByID(this.playerID)).inventory.setInventorySlotContents(((EntityPlayer) w.getEntityByID(this.playerID)).inventory.currentItem, stack); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java index d44fc42cce..793f59c899 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java @@ -42,7 +42,7 @@ public class OreDictCachePacket extends GT_Packet { public OreDictCachePacket(HashSet> set) { super(false); - hashSet = set; + this.hashSet = set; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java index 36fd4dfa36..4147087a51 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java @@ -59,8 +59,8 @@ public class OrePacket extends GT_Packet { @Override public byte[] encode() { - int hash = MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(x).putInt(z).putShort(y).putShort(meta).array(), 0, 12, 31); - return ByteBuffer.allocate(16).putInt(x).putInt(z).putShort(y).putShort(meta).putInt(hash).array(); + int hash = MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), 0, 12, 31); + return ByteBuffer.allocate(16).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).putInt(hash).array(); } @Override @@ -68,12 +68,12 @@ public class OrePacket extends GT_Packet { byte[] tmp = new byte[16]; byteArrayDataInput.readFully(tmp); ByteBuffer buff = ByteBuffer.wrap(tmp); - x = buff.getInt(); - z = buff.getInt(); - y = buff.getShort(); - meta = buff.getShort(); - OrePacket todecode = new OrePacket(x, y, z, meta); - if (buff.getInt() != MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(x).putInt(z).putShort(y).putShort(meta).array(), 0, 12, 31)) { + this.x = buff.getInt(); + this.z = buff.getInt(); + this.y = buff.getShort(); + this.meta = buff.getShort(); + OrePacket todecode = new OrePacket(this.x, this.y, this.z, this.meta); + if (buff.getInt() != MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), 0, 12, 31)) { MainMod.LOGGER.error("PACKET HASH DOES NOT MATCH!"); return null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java index a5f5f4089f..90a3adc69a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -59,11 +59,11 @@ public class RendererPacket extends GT_Packet { @Override public byte[] encode() { - byte r = (byte) (((integer >> 16) & 0xFF) + Byte.MIN_VALUE); - byte g = (byte) (((integer >> 8) & 0xFF) + Byte.MIN_VALUE); - byte b = (byte) (((integer >> 0) & 0xFF) + Byte.MIN_VALUE); - byte checksum = (byte) (coords.x % 25 + coords.y % 25 + coords.z % 25 + coords.wID % 25 + integer % 25 + removal); - return ByteBuffer.allocate(19).putInt(0, coords.x).putShort(4, (short) coords.y).putInt(6, coords.z).putInt(10, coords.wID).put(14, r).put(15, g).put(16, b).put(17, removal).put(18, checksum).array(); + byte r = (byte) (((this.integer >> 16) & 0xFF) + Byte.MIN_VALUE); + byte g = (byte) (((this.integer >> 8) & 0xFF) + Byte.MIN_VALUE); + byte b = (byte) (((this.integer) & 0xFF) + Byte.MIN_VALUE); + byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25 + this.coords.z % 25 + this.coords.wID % 25 + this.integer % 25 + this.removal); + return ByteBuffer.allocate(19).putInt(0, this.coords.x).putShort(4, this.coords.y).putInt(6, this.coords.z).putInt(10, this.coords.wID).put(14, r).put(15, g).put(16, b).put(17, this.removal).put(18, checksum).array(); } // /** @@ -90,23 +90,23 @@ public class RendererPacket extends GT_Packet { this.integer = BW_ColorUtil.getColorFromRGBArray(rgb); this.removal = ByteBuffer.wrap(buffer).get(17); - byte checksum = (byte) (coords.x % 25 + coords.y % 25 + coords.z % 25 + coords.wID % 25 + integer % 25 + removal); + byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25 + this.coords.z % 25 + this.coords.wID % 25 + this.integer % 25 + this.removal); if (checksum != ByteBuffer.wrap(buffer).get(18)) { MainMod.LOGGER.error("BW Packet was corrupted or modified!"); return null; } - return new RendererPacket(coords, integer, removal == 1); + return new RendererPacket(this.coords, this.integer, this.removal == 1); } @Override public void process(IBlockAccess iBlockAccess) { if (FMLCommonHandler.instance().getSide().isClient()) { - if (removal == 0) - GT_TileEntity_BioVat.staticColorMap.put(coords, integer); + if (this.removal == 0) + GT_TileEntity_BioVat.staticColorMap.put(this.coords, this.integer); else - GT_TileEntity_BioVat.staticColorMap.remove(coords); + GT_TileEntity_BioVat.staticColorMap.remove(this.coords); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java index d71969e12b..0e54e9264d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java @@ -35,9 +35,9 @@ import java.util.List; public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implements ITileAddsInformation { - recursiveBelowCheck check = new recursiveBelowCheck(); - private long ticks = 0; - private long noOfIts = 0; + BW_TileEntity_ExperimentalFloodGate.recursiveBelowCheck check = new BW_TileEntity_ExperimentalFloodGate.recursiveBelowCheck(); + private long ticks; + private long noOfIts; private Coords paused; public BW_TileEntity_ExperimentalFloodGate() { @@ -46,31 +46,31 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem @Override public void updateEntity() { - if (paused == null) { + if (this.paused == null) { this.paused = new Coords(this.xCoord, this.yCoord, this.zCoord, this.worldObj.provider.dimensionId); } - ticks++; - if (check.called != -1) { - if (ticks % 20 == 0) { + this.ticks++; + if (this.check.called != -1) { + if (this.ticks % 20 == 0) { HashSet toRem = new HashSet<>(); - for (Coords c : check.hashset) { + for (Coords c : this.check.hashset) { this.worldObj.setBlock(c.x, c.y, c.z, Blocks.water, 0, 4); toRem.add(c); } - check.hashset.removeAll(toRem); + this.check.hashset.removeAll(toRem); } } else { - noOfIts = 0; - setUpHashSet(); - this.paused = check.hashset.get(check.hashset.size() - 1); + this.noOfIts = 0; + this.setUpHashSet(); + this.paused = this.check.hashset.get(this.check.hashset.size() - 1); } - if (ticks % 50 == 0) - ticks = 0; + if (this.ticks % 50 == 0) + this.ticks = 0; } private synchronized void setUpHashSet() { - check = new recursiveBelowCheck(); - Thread t = new Thread(check); + this.check = new BW_TileEntity_ExperimentalFloodGate.recursiveBelowCheck(); + Thread t = new Thread(this.check); t.run(); while (t.isAlive()) { try { @@ -79,7 +79,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem e.printStackTrace(); } } - check.hashset.remove(new Coords(this.xCoord, this.yCoord, this.zCoord, this.worldObj.provider.dimensionId)); + this.check.hashset.remove(new Coords(this.xCoord, this.yCoord, this.zCoord, this.worldObj.provider.dimensionId)); } @Override @@ -108,10 +108,10 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem byte ret = 0; int wID = w.provider.dimensionId; - if (hashset.contains(new Coords(x, y, z, wID))) + if (this.hashset.contains(new Coords(x, y, z, wID))) return ret; - hashset.add(new Coords(x, y, z, wID)); + this.hashset.add(new Coords(x, y, z, wID)); if (w.getBlock(x, y + 1, z).equals(b)) ret = (byte) (ret | 0b000001); @@ -142,53 +142,53 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem int ret = 0; iterations++; int wID = w.provider.dimensionId; - byte sides = check_sourroundings(w, x, y, z, b); + byte sides = this.check_sourroundings(w, x, y, z, b); - if (((sides | 0b111110) == 0b111111) && !hashset.contains(new Coords(x, y + 1, z, wID)) && y + 1 <= yCoord) { - tail = get_connected(w, x, y + 1, z, b, iterations); + if (((sides | 0b111110) == 0b111111) && !this.hashset.contains(new Coords(x, y + 1, z, wID)) && y + 1 <= BW_TileEntity_ExperimentalFloodGate.this.yCoord) { + tail = this.get_connected(w, x, y + 1, z, b, iterations); if (tail == -1) - return tail; + return -1; ret++; ret += tail; } - if (((sides | 0b111101) == 0b111111) && !hashset.contains(new Coords(x, y - 1, z, wID))) { - tail = get_connected(w, x, y - 1, z, b, iterations); + if (((sides | 0b111101) == 0b111111) && !this.hashset.contains(new Coords(x, y - 1, z, wID))) { + tail = this.get_connected(w, x, y - 1, z, b, iterations); if (tail == -1) - return tail; + return -1; ret++; ret += tail; } - if (((sides | 0b111011) == 0b111111) && !hashset.contains(new Coords(x + 1, y, z, wID))) { - tail = get_connected(w, x + 1, y, z, b, iterations); + if (((sides | 0b111011) == 0b111111) && !this.hashset.contains(new Coords(x + 1, y, z, wID))) { + tail = this.get_connected(w, x + 1, y, z, b, iterations); if (tail == -1) - return tail; + return -1; ret++; ret += tail; } - if (((sides | 0b110111) == 0b111111) && !hashset.contains(new Coords(x - 1, y, z, wID))) { - tail = get_connected(w, x - 1, y, z, b, iterations); + if (((sides | 0b110111) == 0b111111) && !this.hashset.contains(new Coords(x - 1, y, z, wID))) { + tail = this.get_connected(w, x - 1, y, z, b, iterations); if (tail == -1) - return tail; + return -1; ret++; ret += tail; } - if (((sides | 0b101111) == 0b111111) && !hashset.contains(new Coords(x, y, z + 1, wID))) { - tail = get_connected(w, x, y, z + 1, b, iterations); + if (((sides | 0b101111) == 0b111111) && !this.hashset.contains(new Coords(x, y, z + 1, wID))) { + tail = this.get_connected(w, x, y, z + 1, b, iterations); if (tail == -1) - return tail; + return -1; ret++; ret += tail; } - if (((sides | 0b011111) == 0b111111) && !hashset.contains(new Coords(x, y, z - 1, wID))) { - tail = get_connected(w, x, y, z - 1, b, iterations); + if (((sides | 0b011111) == 0b111111) && !this.hashset.contains(new Coords(x, y, z - 1, wID))) { + tail = this.get_connected(w, x, y, z - 1, b, iterations); if (tail == -1) - return tail; + return -1; ret++; ret += tail; } @@ -198,8 +198,8 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem @Override public synchronized void run() { - called = check.get_connected(worldObj, paused.x, paused.y, paused.z, Blocks.air, 0); - notifyAll(); + this.called = BW_TileEntity_ExperimentalFloodGate.this.check.get_connected(BW_TileEntity_ExperimentalFloodGate.this.worldObj, BW_TileEntity_ExperimentalFloodGate.this.paused.x, BW_TileEntity_ExperimentalFloodGate.this.paused.y, BW_TileEntity_ExperimentalFloodGate.this.paused.z, Blocks.air, 0); + this.notifyAll(); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index 416e4fb56e..ea9bfe6395 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -31,7 +31,6 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; -import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -46,63 +45,63 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr public static final Fluid WATER = FluidRegistry.WATER; public ItemStack fuelstack; public FluidStack outputstack = new FluidStack(FluidRegistry.WATER, 0); - public int fuel = 0; - public byte tick = 0; - public int maxfuel = 0; + public int fuel; + public byte tick; + public int maxfuel; public ItemStack fakestack = new ItemStack(Blocks.water); @Override public void writeToNBT(NBTTagCompound p_145841_1_) { NBTTagCompound subItemStack = new NBTTagCompound(); - if (fuelstack == null) + if (this.fuelstack == null) p_145841_1_.setTag("ItemStack", subItemStack); else { - fuelstack.writeToNBT(subItemStack); + this.fuelstack.writeToNBT(subItemStack); p_145841_1_.setTag("ItemStack", subItemStack); } NBTTagCompound subFluidStack = new NBTTagCompound(); - outputstack.writeToNBT(subFluidStack); + this.outputstack.writeToNBT(subFluidStack); p_145841_1_.setTag("FluidStack", subFluidStack); - p_145841_1_.setInteger("fuel", fuel); - p_145841_1_.setInteger("maxfuel", maxfuel); - p_145841_1_.setByte("tick", tick); + p_145841_1_.setInteger("fuel", this.fuel); + p_145841_1_.setInteger("maxfuel", this.maxfuel); + p_145841_1_.setByte("tick", this.tick); super.writeToNBT(p_145841_1_); } @Override public void readFromNBT(NBTTagCompound p_145839_1_) { - tick = p_145839_1_.getByte("tick"); - fuel = p_145839_1_.getInteger("fuel"); - maxfuel = p_145839_1_.getInteger("maxfuel"); - outputstack = FluidStack.loadFluidStackFromNBT(p_145839_1_.getCompoundTag("FluidStack")); + this.tick = p_145839_1_.getByte("tick"); + this.fuel = p_145839_1_.getInteger("fuel"); + this.maxfuel = p_145839_1_.getInteger("maxfuel"); + this.outputstack = FluidStack.loadFluidStackFromNBT(p_145839_1_.getCompoundTag("FluidStack")); if (!p_145839_1_.getCompoundTag("ItemStack").equals(new NBTTagCompound())) - fuelstack = ItemStack.loadItemStackFromNBT(p_145839_1_.getCompoundTag("ItemStack")); + this.fuelstack = ItemStack.loadItemStackFromNBT(p_145839_1_.getCompoundTag("ItemStack")); super.readFromNBT(p_145839_1_); } @Override public void updateEntity() { - if (worldObj.isRemote || ((fuelstack == null || fuelstack.stackSize <= 0) && fuel <= 0) || (tick == 0 && worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) == Blocks.air)) { + if (this.worldObj.isRemote || ((this.fuelstack == null || this.fuelstack.stackSize <= 0) && this.fuel <= 0) || (this.tick == 0 && this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) == Blocks.air)) { return; } - if (fuel < 0) - fuel = 0; + if (this.fuel < 0) + this.fuel = 0; - if (fuelstack != null && fuel == 0) { - fuel = maxfuel = TileEntityFurnace.getItemBurnTime(fuelstack); - --fuelstack.stackSize; + if (this.fuelstack != null && this.fuel == 0) { + this.fuel = this.maxfuel = TileEntityFurnace.getItemBurnTime(this.fuelstack); + --this.fuelstack.stackSize; if (this.fuelstack.stackSize <= 0) this.fuelstack = null; } - if (fuel > 0) { - ++tick; - --fuel; - if (tick % 20 == 0) { - if (outputstack.amount <= (8000 - ConfigHandler.mbWaterperSec)) - outputstack.amount += ConfigHandler.mbWaterperSec; - tick = 0; + if (this.fuel > 0) { + ++this.tick; + --this.fuel; + if (this.tick % 20 == 0) { + if (this.outputstack.amount <= (8000 - ConfigHandler.mbWaterperSec)) + this.outputstack.amount += ConfigHandler.mbWaterperSec; + this.tick = 0; } } } @@ -130,17 +129,17 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public ItemStack getStackInSlot(int p_70301_1_) { if (p_70301_1_ == 0) - return fuelstack; + return this.fuelstack; else - return fakestack; + return this.fakestack; } @Override public ItemStack decrStackSize(int slot, int ammount) { - if (slot != FUELSLOT || fuelstack == null || ammount > fuelstack.stackSize) + if (slot != BW_TileEntity_HeatedWaterPump.FUELSLOT || this.fuelstack == null || ammount > this.fuelstack.stackSize) return null; - return fuelstack.splitStack(ammount); + return this.fuelstack.splitStack(ammount); } @Override @@ -150,10 +149,10 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public void setInventorySlotContents(int slot, ItemStack p_70299_2_) { - if (slot == FUELSLOT) - fuelstack = p_70299_2_; + if (slot == BW_TileEntity_HeatedWaterPump.FUELSLOT) + this.fuelstack = p_70299_2_; else - fakestack = p_70299_2_; + this.fakestack = p_70299_2_; } @Override @@ -187,17 +186,17 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - return TileEntityFurnace.getItemBurnTime(p_94041_2_) > 0 && p_94041_1_ == FUELSLOT; + return TileEntityFurnace.getItemBurnTime(p_94041_2_) > 0 && p_94041_1_ == BW_TileEntity_HeatedWaterPump.FUELSLOT; } @Override public FluidStack getFluid() { - return outputstack.amount > 0 ? outputstack : null; + return this.outputstack.amount > 0 ? this.outputstack : null; } @Override public int getFluidAmount() { - return outputstack.amount; + return this.outputstack.amount; } @Override @@ -218,14 +217,14 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public FluidStack drain(int maxDrain, boolean doDrain) { int actualdrain = maxDrain; - if (actualdrain > outputstack.amount) - actualdrain = outputstack.amount; - FluidStack ret = new FluidStack(WATER, actualdrain); + if (actualdrain > this.outputstack.amount) + actualdrain = this.outputstack.amount; + FluidStack ret = new FluidStack(BW_TileEntity_HeatedWaterPump.WATER, actualdrain); if (ret.amount == 0) ret = null; if (doDrain) { - outputstack.amount -= actualdrain; - FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(outputstack, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this, actualdrain)); + this.outputstack.amount -= actualdrain; + FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(this.outputstack, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this, actualdrain)); } return ret; } @@ -242,14 +241,14 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { - if (resource != null && resource.getFluid() == WATER && drain(resource.amount, false) != null) - return drain(resource.amount, doDrain); + if (resource != null && resource.getFluid() == BW_TileEntity_HeatedWaterPump.WATER && this.drain(resource.amount, false) != null) + return this.drain(resource.amount, doDrain); return null; } @Override public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { - return drain(maxDrain, doDrain); + return this.drain(maxDrain, doDrain); } @Override @@ -259,12 +258,12 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public boolean canDrain(ForgeDirection from, Fluid fluid) { - return fluid == null || fluid == WATER; + return fluid == null || fluid == BW_TileEntity_HeatedWaterPump.WATER; } @Override public FluidTankInfo[] getTankInfo(ForgeDirection from) { - return new FluidTankInfo[]{getInfo()}; + return new FluidTankInfo[]{this.getInfo()}; } @Override @@ -274,10 +273,10 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public void registerBlockIcons(IIconRegister par1IconRegister) { - texture[ForgeDirection.UP.ordinal()] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpTop"); - texture[ForgeDirection.DOWN.ordinal()] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpDown"); + ITileHasDifferentTextureSides.texture[ForgeDirection.UP.ordinal()] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpTop"); + ITileHasDifferentTextureSides.texture[ForgeDirection.DOWN.ordinal()] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpDown"); for (int i = 2; i < 7; i++) { - texture[i] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpSide"); + ITileHasDifferentTextureSides.texture[i] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpSide"); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java index 989e1618b9..f9e7553760 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java @@ -41,17 +41,17 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { - return fill(resource, doFill); + return this.fill(resource, doFill); } @Override public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { - return drain(from, resource != null ? resource.amount : 0, doDrain); + return this.drain(from, resource != null ? resource.amount : 0, doDrain); } @Override public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { - return drain(maxDrain, doDrain); + return this.drain(maxDrain, doDrain); } @Override @@ -62,10 +62,10 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public boolean canDrain(ForgeDirection from, Fluid fluid) { HashSet ret = new HashSet(); - for (FluidStack stack : INTERNALTANKS) { + for (FluidStack stack : this.INTERNALTANKS) { ret.add(GT_Utility.areFluidsEqual(stack, new FluidStack(fluid, 0))); if (ret.contains(Boolean.TRUE)) - selectedTank = this.INTERNALTANKS.indexOf(stack); + this.selectedTank = this.INTERNALTANKS.indexOf(stack); } return ret.contains(Boolean.TRUE); } @@ -77,15 +77,15 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public FluidStack getFluid() { - if (INTERNALTANKS.get(selectedTank) == null || INTERNALTANKS.get(selectedTank).amount == 0) - if (selectedTank > 0) - selectedTank = this.INTERNALTANKS.size() - 1; - return INTERNALTANKS.get(selectedTank); + if (this.INTERNALTANKS.get(this.selectedTank) == null || this.INTERNALTANKS.get(this.selectedTank).amount == 0) + if (this.selectedTank > 0) + this.selectedTank = this.INTERNALTANKS.size() - 1; + return this.INTERNALTANKS.get(this.selectedTank); } @Override public int getFluidAmount() { - return INTERNALTANKS.get(selectedTank) != null ? INTERNALTANKS.get(selectedTank).amount : 0; + return this.INTERNALTANKS.get(this.selectedTank) != null ? this.INTERNALTANKS.get(this.selectedTank).amount : 0; } @Override @@ -94,12 +94,12 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank NBTTagList lInternalTank = new NBTTagList(); - for (int i = 0; i < INTERNALTANKS.size(); i++) { - if (INTERNALTANKS.get(i) != null) { + for (int i = 0; i < this.INTERNALTANKS.size(); i++) { + if (this.INTERNALTANKS.get(i) != null) { NBTTagCompound entry = new NBTTagCompound(); - entry.setString("FluidName", INTERNALTANKS.get(i).getFluid().getName()); - entry.setInteger("Ammount", INTERNALTANKS.get(i).amount); - entry.setTag("FluidTag", INTERNALTANKS.get(i).tag); + entry.setString("FluidName", this.INTERNALTANKS.get(i).getFluid().getName()); + entry.setInteger("Ammount", this.INTERNALTANKS.get(i).amount); + entry.setTag("FluidTag", this.INTERNALTANKS.get(i).tag); lInternalTank.appendTag(entry); } } @@ -119,7 +119,7 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public int fill(FluidStack resource, boolean doFill) { - if (worldObj.isRemote || resource == null || resource.amount == 0) + if (this.worldObj.isRemote || resource == null || resource.amount == 0) return 0; if (!doFill) @@ -127,16 +127,16 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank int id = 0; - if (canDrain(null, resource.getFluid())) { - for (FluidStack stack : INTERNALTANKS) + if (this.canDrain(null, resource.getFluid())) { + for (FluidStack stack : this.INTERNALTANKS) if (GT_Utility.areFluidsEqual(stack, resource)) { this.INTERNALTANKS.get(id = this.INTERNALTANKS.indexOf(stack)).amount += resource.amount; - selectedTank = id; + this.selectedTank = id; } } else { this.INTERNALTANKS.add(resource); id = this.INTERNALTANKS.size() - 1; - selectedTank = id; + this.selectedTank = id; } return this.INTERNALTANKS.get(id).amount; } @@ -144,8 +144,8 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public FluidStack drain(int maxDrain, boolean doDrain) { - FluidStack outputstack = INTERNALTANKS.get(selectedTank); - if (worldObj.isRemote || maxDrain == 0 || this.getFluid() == null || outputstack == null) + FluidStack outputstack = this.INTERNALTANKS.get(this.selectedTank); + if (this.worldObj.isRemote || maxDrain == 0 || this.getFluid() == null || outputstack == null) return null; int actualdrain = maxDrain; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index d9a4c77efc..db58b69cc4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -73,14 +73,14 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private final HashSet playerMPHashSet = new HashSet(); private final ArrayList mRadHatches = new ArrayList<>(); private int height = 1; - private GT_Recipe mLastRecipe = null; + private GT_Recipe mLastRecipe; private Fluid mFluid = FluidRegistry.LAVA; private BioCulture mCulture; - private ItemStack mStack = null; + private ItemStack mStack; private boolean needsVisualUpdate = true; - private byte mGlassTier = 0; - private int mSievert = 0; - private int mNeededSievert = 0; + private byte mGlassTier; + private int mSievert; + private int mNeededSievert; public GT_TileEntity_BioVat(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -90,12 +90,12 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { super(aName); } - public static int[] specialValueUnpack(int aSpecialValure) { + public static int[] specialValueUnpack(int aSpecialValue) { int[] ret = new int[4]; - ret[0] = aSpecialValure & 0xF; // = glas tier - ret[1] = aSpecialValure >>> 4 & 0b11; // = special valure - ret[2] = aSpecialValure >>> 6 & 0b1; //exact svt - ret[3] = aSpecialValure >>> 7 & Integer.MAX_VALUE; // = sievert + ret[0] = aSpecialValue & 0xF; // = glas tier + ret[1] = aSpecialValue >>> 4 & 0b11; // = special valure + ret[2] = aSpecialValue >>> 6 & 0b1; //boolean exact svt | 1 = true | 0 = false + ret[3] = aSpecialValue >>> 7 & Integer.MAX_VALUE; // = sievert return ret; } @@ -128,7 +128,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @Override public int getCapacity() { int ret = 0; - ret += getInputCapacity(); + ret += this.getInputCapacity(); //ret += getOutputCapacity(); return ret; } @@ -149,18 +149,18 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } private int calcMod(double x) { - int ret = (int) Math.ceil(100D*(-(2*this.getOutputCapacity()-x)*(2*this.getOutputCapacity()-x)+1D)); + int ret = (int) Math.ceil(100D*(-(2*(this.getOutputCapacity()-x))*(2*(this.getOutputCapacity()-x))+1D)); return ret <= 0 ? 1 : ret > 100 ? 100 : ret;//(int) Math.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); } @Override public boolean checkRecipe(ItemStack itemStack) { - GT_Recipe.GT_Recipe_Map gtRecipeMap = getRecipeMap(); + GT_Recipe.GT_Recipe_Map gtRecipeMap = this.getRecipeMap(); if (gtRecipeMap == null) return false; - ArrayList tInputList = getStoredInputs(); + ArrayList tInputList = this.getStoredInputs(); int tInputList_sS = tInputList.size(); for (int i = 0; i < tInputList_sS - 1; i++) { for (int j = i + 1; j < tInputList_sS; j++) { @@ -178,7 +178,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); - ArrayList tFluidList = getStoredFluids(); + ArrayList tFluidList = this.getStoredFluids(); int tFluidList_sS = tFluidList.size(); for (int i = 0; i < tFluidList_sS - 1; i++) { for (int j = i + 1; j < tFluidList_sS; j++) { @@ -199,7 +199,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { if (tFluidList.size() > 0) { - GT_Recipe gtRecipe = gtRecipeMap.findRecipe(this.getBaseMetaTileEntity(), mLastRecipe, false, this.getMaxInputVoltage(), tFluids, itemStack, tInputs); + GT_Recipe gtRecipe = gtRecipeMap.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, this.getMaxInputVoltage(), tFluids, itemStack, tInputs); if (gtRecipe == null) return false; @@ -207,7 +207,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { if (!BW_Util.areStacksEqualOrNull((ItemStack) gtRecipe.mSpecialItems, itemStack)) return false; - int[] conditions = specialValueUnpack(gtRecipe.mSpecialValue); + int[] conditions = GT_TileEntity_BioVat.specialValueUnpack(gtRecipe.mSpecialValue); this.mNeededSievert = conditions[3]; @@ -217,22 +217,22 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { int times = 1; - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; if (gtRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { - if (getStoredFluidOutputs().size() > 0) { + if (this.getStoredFluidOutputs().size() > 0) { this.mOutputFluids = new FluidStack[gtRecipe.mFluidOutputs.length]; - for (FluidStack storedOutputFluid : getStoredFluidOutputs()) { + for (FluidStack storedOutputFluid : this.getStoredFluidOutputs()) { if (storedOutputFluid.isFluidEqual(gtRecipe.getFluidOutput(0))) for (FluidStack inputFluidStack : gtRecipe.mFluidInputs) { - int j = calcMod(storedOutputFluid.amount); + int j = this.calcMod(storedOutputFluid.amount); for (int i = 0; i < j; i++) - if (depleteInput(inputFluidStack)) + if (this.depleteInput(inputFluidStack)) times++; } } - for (FluidStack storedfluidStack : getStoredFluidOutputs()) { + for (FluidStack storedfluidStack : this.getStoredFluidOutputs()) { for (int i = 0; i < gtRecipe.mFluidOutputs.length; i++) { if (storedfluidStack.isFluidEqual(gtRecipe.getFluidOutput(i))) this.mOutputFluids[i] = (new FluidStack(gtRecipe.getFluidOutput(i), times * gtRecipe.getFluidOutput(0).amount)); @@ -247,14 +247,14 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { BW_Util.calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, this.getMaxInputVoltage(), this); - if (mEUt > 0) - mEUt = -mEUt; + if (this.mEUt > 0) + this.mEUt = -this.mEUt; this.mProgresstime = 0; if (gtRecipe.mCanBeBuffered) - mLastRecipe = gtRecipe; + this.mLastRecipe = gtRecipe; - updateSlots(); + this.updateSlots(); return true; } return false; @@ -303,7 +303,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { //controller if (y == 0 && xDir + x == 0 && zDir + z == 0) continue; - if (!(this.addOutputToMachineList(tileEntity, MCASING_INDEX) || this.addRadiationInputToMachineList(tileEntity, MCASING_INDEX) || this.addInputToMachineList(tileEntity, MCASING_INDEX) || this.addMaintenanceToMachineList(tileEntity, MCASING_INDEX) || this.addEnergyInputToMachineList(tileEntity, MCASING_INDEX))) { + if (!(this.addOutputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addRadiationInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addMaintenanceToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addEnergyInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX))) { if (BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, GregTech_API.sBlockCasings4, 1)) { ++blockcounter; continue; @@ -317,8 +317,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } } else { if (x == -2 && z == -2 && y == 1) - mGlassTier = calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); - if (0 == mGlassTier || mGlassTier != calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z))) { + this.mGlassTier = this.calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + -2, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); + if (0 == this.mGlassTier || this.mGlassTier != this.calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z))) { return false; } } @@ -330,8 +330,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { if (this.mOutputHatches.size() == 1) if (this.mMaintenanceHatches.size() == 1) if (this.mInputHatches.size() > 0) - if (this.mEnergyHatches.size() > 0) - return true; + return this.mEnergyHatches.size() > 0; return false; } @@ -373,12 +372,12 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } private void sendAllRequiredRendererPackets() { - int height = reCalculateHeight(); + int height = this.reCalculateHeight(); if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) { for (int x = -1; x < 2; x++) for (int y = 1; y < height; y++) for (int z = -1; z < 2; z++) - sendPackagesOrRenewRenderer(x, y, z, this.mCulture); + this.sendPackagesOrRenewRenderer(x, y, z, this.mCulture); } } @@ -386,8 +385,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; - staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId)); - staticColorMap.put(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId), lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB()); + GT_TileEntity_BioVat.staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId)); + GT_TileEntity_BioVat.staticColorMap.put(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId), lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB()); if (FMLCommonHandler.instance().getSide().isServer()) { MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( @@ -421,7 +420,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { this.getBaseMetaTileEntity().getZCoord() ); } - needsVisualUpdate = true; + this.needsVisualUpdate = true; } private void check_Chunk() { @@ -437,12 +436,12 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { EntityPlayerMP tPlayer = (EntityPlayerMP) tObject; Chunk tChunk = aWorld.getChunkFromBlockCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord()); if (tPlayer.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { - if (!playerMPHashSet.contains(tPlayer)) { - playerMPHashSet.add(tPlayer); - sendAllRequiredRendererPackets(); + if (!this.playerMPHashSet.contains(tPlayer)) { + this.playerMPHashSet.add(tPlayer); + this.sendAllRequiredRendererPackets(); } } else { - playerMPHashSet.remove(tPlayer); + this.playerMPHashSet.remove(tPlayer); } } @@ -452,10 +451,10 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private void placeFluid() { int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; - height = reCalculateHeight(); - if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) + this.height = this.reCalculateHeight(); + if (this.mFluid != null && this.height > 1 && this.reCalculateFluidAmmount() > 0) for (int x = -1; x < 2; x++) { - for (int y = 0; y < height; y++) { + for (int y = 0; y < this.height; y++) { for (int z = -1; z < 2; z++) { if (this.getBaseMetaTileEntity().getWorld().getBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()).equals(Blocks.air)) this.getBaseMetaTileEntity().getWorld().setBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), FluidLoader.bioFluidBlock); @@ -478,50 +477,50 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { public void doAllVisualThings() { if (this.getBaseMetaTileEntity().isServerSide()) { - if (mMachine) { + if (this.mMachine) { ItemStack aStack = this.mInventory[1]; BioCulture lCulture = null; int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; if (this.getBaseMetaTileEntity().getTimer() % 200 == 0) { - check_Chunk(); + this.check_Chunk(); } - if (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 0) { + if (this.needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 0) { for (int x = -1; x < 2; x++) for (int y = 1; y < 3; y++) for (int z = -1; z < 2; z++) this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()); } - height = reCalculateHeight(); - if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) { - if ((!(BW_Util.areStacksEqualOrNull(aStack, mStack))) || (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 1)) { + this.height = this.reCalculateHeight(); + if (this.mFluid != null && this.height > 1 && this.reCalculateFluidAmmount() > 0) { + if ((!(BW_Util.areStacksEqualOrNull(aStack, this.mStack))) || (this.needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1)) { for (int x = -1; x < 2; x++) { - for (int y = 1; y < height; y++) { + for (int y = 1; y < this.height; y++) { for (int z = -1; z < 2; z++) { if (aStack == null || (aStack != null && aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0)) { - if (mCulture == null || aStack == null || aStack.getTagCompound() == null || mCulture.getID() != aStack.getTagCompound().getInteger("ID")) { + if (this.mCulture == null || aStack == null || aStack.getTagCompound() == null || this.mCulture.getID() != aStack.getTagCompound().getInteger("ID")) { lCulture = aStack == null || aStack.getTagCompound() == null ? null : BioCulture.getBioCulture(aStack.getTagCompound().getString("Name")); - sendPackagesOrRenewRenderer(x, y, z, lCulture); + this.sendPackagesOrRenewRenderer(x, y, z, lCulture); } } } } } - mStack = aStack; - mCulture = lCulture; + this.mStack = aStack; + this.mCulture = lCulture; } - if (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 1) { + if (this.needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1) { if (this.getBaseMetaTileEntity().isClientSide()) new Throwable().printStackTrace(); - placeFluid(); - needsVisualUpdate = false; + this.placeFluid(); + this.needsVisualUpdate = false; } } } else { - onRemoval(); + this.onRemoval(); } } } @@ -529,9 +528,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (height != reCalculateHeight()) - needsVisualUpdate = true; - doAllVisualThings(); + if (this.height != this.reCalculateHeight()) + this.needsVisualUpdate = true; + this.doAllVisualThings(); if (this.getBaseMetaTileEntity().isServerSide() && this.mRadHatches.size() == 1) { this.mSievert = this.mRadHatches.get(0).getSievert(); if (this.getBaseMetaTileEntity().isActive() && this.mNeededSievert > this.mSievert) @@ -541,14 +540,14 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @Override public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setInteger("mFluidHeight", height); - if (mCulture != null && !mCulture.getName().isEmpty()) - aNBT.setString("mCulture", mCulture.getName()); - else if ((mCulture == null || mCulture.getName().isEmpty()) && !aNBT.getString("mCulture").isEmpty()) { + aNBT.setInteger("mFluidHeight", this.height); + if (this.mCulture != null && !this.mCulture.getName().isEmpty()) + aNBT.setString("mCulture", this.mCulture.getName()); + else if ((this.mCulture == null || this.mCulture.getName().isEmpty()) && !aNBT.getString("mCulture").isEmpty()) { aNBT.removeTag("mCulture"); } if (this.mFluid != null) - aNBT.setString("mFluid", mFluid.getName()); + aNBT.setString("mFluid", this.mFluid.getName()); aNBT.setInteger("mSievert",this.mSievert); aNBT.setInteger("mNeededSievert",this.mNeededSievert); super.saveNBTData(aNBT); @@ -563,7 +562,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { for (int z = -1; z < 2; z++) { if (this.getBaseMetaTileEntity().getWorld().getBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()).equals(FluidLoader.bioFluidBlock)) this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()); - staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()), this.getBaseMetaTileEntity().getWorld().provider.dimensionId); + GT_TileEntity_BioVat.staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()), this.getBaseMetaTileEntity().getWorld().provider.dimensionId); if (FMLCommonHandler.instance().getSide().isServer()) MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( this.getBaseMetaTileEntity().getWorld(), @@ -574,7 +573,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId ), - mCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : mCulture.getColorRGB(), + this.mCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : this.mCulture.getColorRGB(), true ), this.getBaseMetaTileEntity().getXCoord(), @@ -620,6 +619,6 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_BioVat.MCASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[MCASING_INDEX]}; + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_BioVat.MCASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_BioVat.MCASING_INDEX]}; } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 9b145f0123..14e8954f69 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -37,7 +37,7 @@ import java.util.Collection; public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBlockBase { private NBTTagCompound type; - private GT_Recipe bufferedRecipe = null; + private GT_Recipe bufferedRecipe; public GT_TileEntity_CircuitAssemblyLine(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -56,24 +56,24 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - type = aNBT.getCompoundTag("Type"); + this.type = aNBT.getCompoundTag("Type"); } @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setTag("Type",type); + aNBT.setTag("Type", this.type); } @Override public boolean checkRecipe(ItemStack itemStack) { - if (type == null) + if (this.type == null) return false; - if (bufferedRecipe != null && bufferedRecipe.isRecipeInputEqual(false,true,BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) + if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(false,true,BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) return true; - ItemStack stack = ItemStack.loadItemStackFromNBT(type); + ItemStack stack = ItemStack.loadItemStackFromNBT(this.type); if (stack == null) return false; @@ -92,7 +92,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl for (GT_Recipe recipe : recipes){ if (recipe.isRecipeInputEqual(false,true,BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) - bufferedRecipe = recipe; + this.bufferedRecipe = recipe; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java index f7ac05a7f9..50e2c7e632 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java @@ -72,10 +72,10 @@ public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_Distil } BWRecipes.DynamicGTRecipe combined = new BWRecipes.DynamicGTRecipe(true, null, recipeDistill.mOutputs, null, recipeDistill.mChances, recipeCracking.mFluidInputs, nuoutputs, (int) (Math.floor(recipeDistill.mDuration * ratio)) + recipeCracking.mDuration, Math.max((int) (Math.floor(recipeDistill.mEUt * ratio)), recipeCracking.mEUt), 0); if (combined.isRecipeInputEqual(true, array)) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; BW_Util.calculateOverclockedNessMulti(combined.mEUt, combined.mDuration, 1, this.getMaxInputVoltage(), this); - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { this.mEUt = (-this.mEUt); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index cb582e8e5d..9b826dc9f4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -52,12 +52,12 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { public GT_TileEntity_DEHP(int aID, int tier, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - mTier = (byte) tier; + this.mTier = (byte) tier; } public GT_TileEntity_DEHP(String aName, byte mTier) { super(aName); - this.mTier = (byte) mTier; + this.mTier = mTier; } @Override @@ -66,7 +66,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { Class c = TileEntityNuclearReactorElectric.class; Field f = c.getDeclaredField("huOutputModifier"); f.setAccessible(true); - nulearHeatMod = f.getFloat(f); + GT_TileEntity_DEHP.nulearHeatMod = f.getFloat(f); } catch (SecurityException | IllegalArgumentException | ExceptionInInitializerError | NullPointerException | IllegalAccessException | NoSuchFieldException e) { e.printStackTrace(); } @@ -75,21 +75,21 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setByte("mTier", mTier); - aNBT.setByte("mMode", mMode); + aNBT.setByte("mTier", this.mTier); + aNBT.setByte("mMode", this.mMode); super.saveNBTData(aNBT); } @Override public void loadNBTData(NBTTagCompound aNBT) { - mTier = aNBT.getByte("mTier"); - mMode = aNBT.getByte("mMode"); + this.mTier = aNBT.getByte("mTier"); + this.mMode = aNBT.getByte("mMode"); super.loadNBTData(aNBT); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_TileEntity_DEHP(this.mName, mTier); + return new GT_TileEntity_DEHP(this.mName, this.mTier); } @Override @@ -99,8 +99,8 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override public String[] getDescription() { - String[] dscSteam = {"Controller Block for the Deep Earth Heat Pump " + (mTier > 1 ? mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + getCasingBlockItem().name(), "1x3x1 " + getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)", "1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", "Consumes " + GT_Values.V[mTier + 2] + "EU/t", "Has 4 Modes, use the Screwdriver to change them:", "0 Idle, 1 Steam, 2 Superheated Steam (requires Distilled Water), 3 Retract", "Explodes when it runs out of Water/Distilled Water", "Converts " + (long) (mTier * 1200 * 20) + "L/s Water(minus 10% per Maintenance Problem) to Steam", "Converts " + (long) (mTier * 600 * 20) + "L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"}; - String[] dscCooleant = {"Controller Block for the Deep Earth Heat Pump " + (mTier > 1 ? mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + getCasingBlockItem().name(), "1x3x1 " + getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)", "1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", "Consumes " + GT_Values.V[mTier + 2] + "EU/t", "Has 4 Modes, use the Screwdriver to change them:", "0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract", "Explodes when it runs out of Coolant", "Heats up " + (long) (mTier * 24 * ((double) nulearHeatMod)) * 20 + "L/s Coolant(minus 10% per Maintenance Problem)"}; + String[] dscSteam = {"Controller Block for the Deep Earth Heat Pump " + (this.mTier > 1 ? this.mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + this.getCasingBlockItem().name(), "1x3x1 " + this.getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)", "1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", "Consumes " + GT_Values.V[this.mTier + 2] + "EU/t", "Has 4 Modes, use the Screwdriver to change them:", "0 Idle, 1 Steam, 2 Superheated Steam (requires Distilled Water), 3 Retract", "Explodes when it runs out of Water/Distilled Water", "Converts " + (long) (this.mTier * 1200 * 20) + "L/s Water(minus 10% per Maintenance Problem) to Steam", "Converts " + (long) (this.mTier * 600 * 20) + "L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"}; + String[] dscCooleant = {"Controller Block for the Deep Earth Heat Pump " + (this.mTier > 1 ? this.mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + this.getCasingBlockItem().name(), "1x3x1 " + this.getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)", "1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", "Consumes " + GT_Values.V[this.mTier + 2] + "EU/t", "Has 4 Modes, use the Screwdriver to change them:", "0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract", "Explodes when it runs out of Coolant", "Heats up " + (long) (this.mTier * 24 * ((double) GT_TileEntity_DEHP.nulearHeatMod)) * 20 + "L/s Coolant(minus 10% per Maintenance Problem)"}; return ConfigHandler.DEHPDirectSteam ? dscSteam : dscCooleant; } @@ -121,7 +121,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override protected int getMinTier() { - return 2 + mTier; + return 2 + this.mTier; } @Override @@ -153,7 +153,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { - if (mMode != 3) { + if (this.mMode != 3) { this.isPickingPipes = false; try { Field workState = this.getClass().getField("workState"); @@ -169,15 +169,15 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (this.getBaseMetaTileEntity().getWorld().isRemote) return; - ++mMode; - if (mMode >= 4) - mMode = 0; - GT_Utility.sendChatToPlayer(aPlayer, "Mode: " + mMode); + ++this.mMode; + if (this.mMode >= 4) + this.mMode = 0; + GT_Utility.sendChatToPlayer(aPlayer, "Mode: " + this.mMode); super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); } protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { - if (mMode == 3) { + if (this.mMode == 3) { this.isPickingPipes = true; try { Field workState = this.getClass().getSuperclass().getDeclaredField("workState"); @@ -191,40 +191,40 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { if (this.waitForPipes()) { return false; } else { - if (mMode == 0) - mMode = 1; + if (this.mMode == 0) + this.mMode = 1; if (ConfigHandler.DEHPDirectSteam) { - if (mMode == 1) { - long steamProduced = (mTier * 600 * 2L * this.mEfficiency / 10000L); + if (this.mMode == 1) { + long steamProduced = (this.mTier * 600 * 2L * this.mEfficiency / 10000L); long waterConsume = ((steamProduced + 160) / 160); - if (getWaterFromHatches(false) - waterConsume > 0) { - consumeFluid(FluidRegistry.WATER, waterConsume); - addOutput(GT_ModHandler.getSteam(steamProduced)); + if (this.getWaterFromHatches(false) - waterConsume > 0) { + this.consumeFluid(FluidRegistry.WATER, waterConsume); + this.addOutput(GT_ModHandler.getSteam(steamProduced)); } else { - explodeMultiblock(); + this.explodeMultiblock(); return false; } - } else if (mMode == 2) { - long steamProduced = (mTier * 300 * 2L * this.mEfficiency / 10000L); + } else if (this.mMode == 2) { + long steamProduced = (this.mTier * 300 * 2L * this.mEfficiency / 10000L); long waterConsume = ((steamProduced + 160) / 160); - if (getWaterFromHatches(true) - waterConsume > 0) { - consumeFluid(GT_ModHandler.getDistilledWater(1).getFluid(), waterConsume); - addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", (int) steamProduced)); + if (this.getWaterFromHatches(true) - waterConsume > 0) { + this.consumeFluid(GT_ModHandler.getDistilledWater(1).getFluid(), waterConsume); + this.addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", (int) steamProduced)); } else { - explodeMultiblock(); + this.explodeMultiblock(); return false; } } } else { - if (mMode == 1 || mMode == 2) { - long coolantConverted = (long) (mTier * 24 * ((double) nulearHeatMod) * this.mEfficiency / 10000L); - if (getFluidFromHatches(FluidRegistry.getFluid("ic2coolant")) - coolantConverted > 0) { - consumeFluid(FluidRegistry.getFluid("ic2coolant"), coolantConverted); - addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", (int) coolantConverted)); + if (this.mMode == 1 || this.mMode == 2) { + long coolantConverted = (long) (this.mTier * 24 * ((double) GT_TileEntity_DEHP.nulearHeatMod) * this.mEfficiency / 10000L); + if (this.getFluidFromHatches(FluidRegistry.getFluid("ic2coolant")) - coolantConverted > 0) { + this.consumeFluid(FluidRegistry.getFluid("ic2coolant"), coolantConverted); + this.addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", (int) coolantConverted)); } else { - explodeMultiblock(); + this.explodeMultiblock(); return false; } } @@ -249,11 +249,8 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { } } - if (tmp[tmp.length - 1] <= 0) { - return true; - } + return tmp[tmp.length - 1] <= 0; - return false; } long tmp = ammount; @@ -269,14 +266,14 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override protected void setElectricityStats() { try { - this.mEUt = isPickingPipes ? 60 : Math.toIntExact(GT_Values.V[getMinTier()]); + this.mEUt = this.isPickingPipes ? 60 : Math.toIntExact(GT_Values.V[this.getMinTier()]); } catch (ArithmeticException e) { e.printStackTrace(); this.mEUt = Integer.MAX_VALUE - 7; } this.mProgresstime = 0; this.mMaxProgresstime = 1; - this.mEfficiency = this.getCurrentEfficiency((ItemStack) null); + this.mEfficiency = this.getCurrentEfficiency(null); this.mEfficiencyIncrease = 10000; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index cd45301d4f..4a6b30b757 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -65,8 +65,8 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity for (int i = 0; i < tInputList_sS - 1; ++i) { for (int j = i + 1; j < tInputList_sS; ++j) { - if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) { - if (((ItemStack) tInputList.get(i)).stackSize < ((ItemStack) tInputList.get(j)).stackSize) { + if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { + if (tInputList.get(i).stackSize < tInputList.get(j).stackSize) { tInputList.remove(i--); tInputList_sS = tInputList.size(); break; @@ -78,10 +78,10 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } } - ItemStack[] tInputs = (ItemStack[]) tInputList.toArray(new ItemStack[tInputList.size()]); + ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); if (tInputList.size() > 0) { - GT_Recipe tRecipe = eicMap.findRecipe(this.getBaseMetaTileEntity(), false, 9223372036854775807L, (FluidStack[]) null, tInputs); - if (tRecipe != null && tRecipe.isRecipeInputEqual(true, (FluidStack[]) null, tInputs)) { + GT_Recipe tRecipe = GT_TileEntity_ElectricImplosionCompressor.eicMap.findRecipe(this.getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); + if (tRecipe != null && tRecipe.isRecipeInputEqual(true, null, tInputs)) { this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; this.mEfficiencyIncrease = 10000; this.mEUt = -tRecipe.mEUt; @@ -99,24 +99,24 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity @Override public boolean onRunningTick(ItemStack aStack) { if (this.mRuntime % 10 == 0) - togglePiston(); + this.togglePiston(); return super.onRunningTick(aStack); } public void stopMachine() { - resetPiston(); + this.resetPiston(); super.stopMachine(); } @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { - piston = true; + this.piston = true; } private void resetPiston() { if (this.getBaseMetaTileEntity().getWorld().isRemote) return; - if (!piston) { + if (!this.piston) { int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; int aX = this.getBaseMetaTileEntity().getXCoord(), aY = this.getBaseMetaTileEntity().getYCoord(), aZ = this.getBaseMetaTileEntity().getZCoord(); @@ -126,8 +126,8 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity this.getBaseMetaTileEntity().getWorld().setBlock(xDir + aX + x, aY + 2, zDir + aZ + z, GregTech_API.sBlockMetal5, 2, 3); } } - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); - piston = !piston; + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + this.piston = !this.piston; } } @@ -138,7 +138,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; int aX = this.getBaseMetaTileEntity().getXCoord(), aY = this.getBaseMetaTileEntity().getYCoord(), aZ = this.getBaseMetaTileEntity().getZCoord(); boolean hax = false; - if (piston) { + if (this.piston) { for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) { @@ -149,8 +149,8 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } } } - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); - piston = !piston; + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + this.piston = !this.piston; } else { for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { @@ -158,8 +158,8 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity this.getBaseMetaTileEntity().getWorld().setBlock(xDir + aX + x, aY + 2, zDir + aZ + z, GregTech_API.sBlockMetal5, 2, 3); } } - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); - piston = !piston; + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + this.piston = !this.piston; } if (hax) this.explodeMultiblock(); @@ -167,13 +167,13 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity @Override public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setBoolean("piston", piston); + aNBT.setBoolean("piston", this.piston); super.saveNBTData(aNBT); } @Override public void loadNBTData(NBTTagCompound aNBT) { - piston = aNBT.getBoolean("piston"); + this.piston = aNBT.getBoolean("piston"); super.loadNBTData(aNBT); } @@ -217,18 +217,18 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } } else if (y == 1) { - if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 1, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 1, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 1, zDir + z)), Materials.Neutronium.getBlocks(1))) return false; } else if (y == 2) { - if (!piston) { + if (!this.piston) { if (Math.abs(x) == 1 && Math.abs(z) == 1) { - if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 2, zDir + z)), Materials.Neutronium.getBlocks(1))) return false; } } else if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) return false; } else if (y == 3) { - if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 3, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) + if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 3, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 3, zDir + z)), Materials.Neutronium.getBlocks(1))) return false; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 471373e3dd..06ecfecd26 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -61,9 +61,9 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { private static final byte TEXID_CHARGING = 1; private static final byte TEXID_IDLE = 2; private static final byte TEXID_EMPTY = 3; - private static IIcon[] iIcons = new IIcon[4]; - private static IIconContainer[] iIconContainers = new IIconContainer[4]; - private static ITexture[][] iTextures = new ITexture[4][1]; + private static final IIcon[] iIcons = new IIcon[4]; + private static final IIconContainer[] iIconContainers = new IIconContainer[4]; + private static final ITexture[][] iTextures = new ITexture[4][1]; public ConnectedBlocksChecker connectedcells; public ItemStack[] circuits = new ItemStack[5]; private long mStorage; @@ -104,14 +104,14 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public long maxAmperesOut() { - return maxAmperesIn(); + return this.maxAmperesIn(); } @Override public long maxEUInput() { for (int i = 1; i < GT_Values.V.length; i++) { - if (maxEUOutput() <= GT_Values.V[i] && maxEUOutput() > GT_Values.V[i - 1]) + if (this.maxEUOutput() <= GT_Values.V[i] && this.maxEUOutput() > GT_Values.V[i - 1]) return Math.min(GT_Values.V[i], 32768L); } @@ -150,7 +150,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_TileEntity_LESU(mName); + return new GT_TileEntity_LESU(this.mName); } @Override @@ -173,18 +173,18 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { - for (int i = 0; i < iTextures.length; i++) { - iIcons[i] = aBlockIconRegister.registerIcon(MainMod.MOD_ID + ":LESU_CASING_" + i); - final int finalI = i; - iIconContainers[i] = new IIconContainer() { + for (int i = 0; i < GT_TileEntity_LESU.iTextures.length; i++) { + GT_TileEntity_LESU.iIcons[i] = aBlockIconRegister.registerIcon(MainMod.MOD_ID + ":LESU_CASING_" + i); + int finalI = i; + GT_TileEntity_LESU.iIconContainers[i] = new IIconContainer() { @Override public IIcon getIcon() { - return iIcons[finalI]; + return GT_TileEntity_LESU.iIcons[finalI]; } @Override public IIcon getOverlayIcon() { - return iIcons[finalI]; + return GT_TileEntity_LESU.iIcons[finalI]; } @Override @@ -207,8 +207,8 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } public boolean isClientSide() { - if (getWorld() != null) - return getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; + if (this.getWorld() != null) + return this.getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; } @@ -220,18 +220,18 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { if (this.isClientSide()) { - for (int i = 0; i < iTextures.length; i++) { - iTextures[i][0] = new GT_RenderedTexture(iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); + for (int i = 0; i < GT_TileEntity_LESU.iTextures.length; i++) { + GT_TileEntity_LESU.iTextures[i][0] = new GT_RenderedTexture(GT_TileEntity_LESU.iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); } if (aSide == aFacing && this.getBaseMetaTileEntity().getUniversalEnergyStored() <= 0) - ret = iTextures[TEXID_EMPTY]; + ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_EMPTY]; else if (aSide == aFacing && !aActive) - ret = iTextures[TEXID_IDLE]; + ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_IDLE]; else if (aSide == aFacing && aActive) - ret = iTextures[TEXID_CHARGING]; + ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_CHARGING]; else - ret = iTextures[TEXID_SIDE]; + ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_SIDE]; } return ret; @@ -321,7 +321,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { - checkMachine(aBaseMetaTileEntity, null); + this.checkMachine(aBaseMetaTileEntity, null); super.onFirstTick(aBaseMetaTileEntity); } @@ -330,7 +330,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { if (aBaseMetaTileEntity.isServerSide()) { this.mMaxProgresstime = 1; if (aTick % 20 == 0) - checkMachine(aBaseMetaTileEntity, null); + this.checkMachine(aBaseMetaTileEntity, null); this.mWrench = true; this.mScrewdriver = true; this.mSoftHammer = true; @@ -369,10 +369,10 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { long startingTime = System.nanoTime(); - connectedcells = new ConnectedBlocksChecker(); - connectedcells.get_connected(aBaseMetaTileEntity.getWorld(), aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), ItemRegistry.BW_BLOCKS[1]); + this.connectedcells = new ConnectedBlocksChecker(); + this.connectedcells.get_connected(aBaseMetaTileEntity.getWorld(), aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), ItemRegistry.BW_BLOCKS[1]); - if (connectedcells.get_meta_of_sideblocks(aBaseMetaTileEntity.getWorld(), this.getBaseMetaTileEntity().getMetaTileID(), new int[]{aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()}, true)) { + if (this.connectedcells.get_meta_of_sideblocks(aBaseMetaTileEntity.getWorld(), this.getBaseMetaTileEntity().getMetaTileID(), new int[]{aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()}, true)) { this.getBaseMetaTileEntity().disableWorking(); this.getBaseMetaTileEntity().setActive(false); this.mStorage = 0; @@ -382,7 +382,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } this.mEfficiency = this.getMaxEfficiency(null); - this.mStorage = (ConfigHandler.energyPerCell * connectedcells.hashset.size() >= Long.MAX_VALUE - 1 || ConfigHandler.energyPerCell * connectedcells.hashset.size() < 0) ? Long.MAX_VALUE - 1 : ConfigHandler.energyPerCell * connectedcells.hashset.size(); + this.mStorage = (ConfigHandler.energyPerCell * this.connectedcells.hashset.size() >= Long.MAX_VALUE - 1 || ConfigHandler.energyPerCell * this.connectedcells.hashset.size() < 0) ? Long.MAX_VALUE - 1 : ConfigHandler.energyPerCell * this.connectedcells.hashset.size(); this.mMaxProgresstime = 1; this.mProgresstime = 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index c403d990d6..9543643c3c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -48,9 +48,9 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase private static final byte SINGLE_DOWNSTEP = 1; private static final byte MULTI_UPSTEP = 2; private static final byte MULTI_DOWNSTEP = 3; - private byte mode = 0; - private byte texid = 2; - private long mCoilWicks = 0; + private byte mode; + private final byte texid = 2; + private long mCoilWicks; private boolean upstep = true; public GT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) { @@ -89,7 +89,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase else this.mEfficiency = this.getMaxEfficiency(null); - if (this.mode > SINGLE_DOWNSTEP) { + if (this.mode > GT_TileEntity_ManualTrafo.SINGLE_DOWNSTEP) { return this.onRunningTickTabbedMode(); } @@ -100,8 +100,8 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase public boolean onRunningTickTabbedMode() { boolean ret = false; - for (GT_MetaTileEntity_Hatch_Dynamo E : mDynamoHatches) { - for (GT_MetaTileEntity_Hatch_Energy I : mEnergyHatches) { + for (GT_MetaTileEntity_Hatch_Dynamo E : this.mDynamoHatches) { + for (GT_MetaTileEntity_Hatch_Energy I : this.mEnergyHatches) { long vtt = I.getEUVar() >= (V[E.mTier] / 2) && E.getEUVar() < E.maxEUStore() ? I.getEUVar() : 0; @@ -143,7 +143,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase this.mProgresstime = 0; this.mMaxProgresstime = 1; this.mEfficiency = this.mEfficiency > 100 ? this.mEfficiency : 100; - return this.upstep ? this.getOutputTier() - this.getInputTier() == mCoilWicks : this.getInputTier() - this.getOutputTier() == mCoilWicks; + return this.upstep ? this.getOutputTier() - this.getInputTier() == this.mCoilWicks : this.getInputTier() - this.getOutputTier() == this.mCoilWicks; } @Override @@ -166,7 +166,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; if (stillcoil) { ++this.mCoilWicks; - if (mCoilWicks % 8 == 0) { + if (this.mCoilWicks % 8 == 0) { ++y; continue; } @@ -179,7 +179,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase } } - if (mCoilWicks % 8 != 0) + if (this.mCoilWicks % 8 != 0) return false; this.mCoilWicks = this.mCoilWicks / 8; @@ -196,7 +196,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase for (int z = -1; z <= 1; ++z) if (xDir + x != 0 || zDir + z != 0) { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid)) { + if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addEnergyInputToMachineList(tTileEntity, this.texid)) { if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { return false; } @@ -212,7 +212,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase for (int x = -1; x <= 1; ++x) for (int z = -1; z <= 1; ++z) { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addDynamoToMachineList(tTileEntity, texid)) { + if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addDynamoToMachineList(tTileEntity, this.texid)) { if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { return false; } @@ -251,7 +251,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; if (stillcoil) { ++this.mCoilWicks; - if (mCoilWicks % 8 == 0) { + if (this.mCoilWicks % 8 == 0) { ++y; continue; } @@ -264,7 +264,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase } } - if (mCoilWicks % 8 != 0) + if (this.mCoilWicks % 8 != 0) return false; this.mCoilWicks = this.mCoilWicks / 8; @@ -281,7 +281,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase for (int z = -2; z <= 2; ++z) if (xDir + x != 0 || zDir + z != 0) { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid)) { + if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addEnergyInputToMachineList(tTileEntity, this.texid)) { if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { return false; } @@ -297,7 +297,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase for (int x = -2; x <= 2; ++x) for (int z = -2; z <= 2; ++z) { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addDynamoToMachineList(tTileEntity, texid)) { + if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addDynamoToMachineList(tTileEntity, this.texid)) { if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { return false; } @@ -340,7 +340,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase for (int z = -2; z <= 2; ++z) if (x == -2 || z == -2 || x == 2 || z == 2) { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, ty, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, texid) && !this.addEnergyInputToMachineList(tTileEntity, texid, leveltier) && !this.addDynamoToMachineList(tTileEntity, texid, leveltier)) { + if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addEnergyInputToMachineList(tTileEntity, this.texid, leveltier) && !this.addDynamoToMachineList(tTileEntity, this.texid, leveltier)) { if (aBaseMetaTileEntity.getBlockOffset(xDir + x, ty, zDir + z) != GregTech_API.sBlockCasings1) { return false; } @@ -348,10 +348,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase } } } - if (this.mDynamoHatches.isEmpty() || this.mEnergyHatches.isEmpty()) - return false; - - return true; + return !this.mDynamoHatches.isEmpty() && !this.mEnergyHatches.isEmpty(); } @Override @@ -376,7 +373,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_TileEntity_ManualTrafo(mName); + return new GT_TileEntity_ManualTrafo(this.mName); } @Override @@ -392,19 +389,19 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase @Override public void saveNBTData(NBTTagCompound ntag) { - ntag.setLong("mCoilWicks", mCoilWicks); + ntag.setLong("mCoilWicks", this.mCoilWicks); super.saveNBTData(ntag); } @Override public void loadNBTData(NBTTagCompound ntag) { super.loadNBTData(ntag); - mCoilWicks = ntag.getLong("mCoilWicks"); + this.mCoilWicks = ntag.getLong("mCoilWicks"); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[texid], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[texid]}; + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[this.texid], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[this.texid]}; } public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex, short tier) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 193a1ffacb..edbe884c1f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -76,30 +76,30 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - HeliumSupply=aNBT.getInteger("HeliumSupply"); - BISOPeletSupply=aNBT.getInteger("BISOPeletSupply"); - TRISOPeletSupply=aNBT.getInteger("TRISOPeletSupply"); - empty=aNBT.getBoolean("EmptyMode"); + this.HeliumSupply =aNBT.getInteger("HeliumSupply"); + this.BISOPeletSupply =aNBT.getInteger("BISOPeletSupply"); + this.TRISOPeletSupply =aNBT.getInteger("TRISOPeletSupply"); + this.empty =aNBT.getBoolean("EmptyMode"); } @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setInteger("HeliumSupply",HeliumSupply); - aNBT.setInteger("BISOPeletSupply",BISOPeletSupply); - aNBT.setInteger("TRISOPeletSupply",TRISOPeletSupply); - aNBT.setBoolean("EmptyMode",empty); + aNBT.setInteger("HeliumSupply", this.HeliumSupply); + aNBT.setInteger("BISOPeletSupply", this.BISOPeletSupply); + aNBT.setInteger("TRISOPeletSupply", this.TRISOPeletSupply); + aNBT.setBoolean("EmptyMode", this.empty); } @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isServerSide()){ - if (HeliumSupply < HELIUM_NEEDED){ + if (this.HeliumSupply < GT_TileEntity_THTR.HELIUM_NEEDED){ for (FluidStack fluidStack : this.getStoredFluids()){ if (fluidStack.isFluidEqual(Materials.Helium.getGas(1000))) { - while (HeliumSupply < HELIUM_NEEDED && fluidStack.amount > 0) { - HeliumSupply++; + while (this.HeliumSupply < GT_TileEntity_THTR.HELIUM_NEEDED && fluidStack.amount > 0) { + this.HeliumSupply++; fluidStack.amount--; } } @@ -107,18 +107,18 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { } for (ItemStack itemStack : this.getStoredInputs()) { if (GT_Utility.areStacksEqual(itemStack, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3))) { - if (BISOPeletSupply + TRISOPeletSupply < 675000) { - while (BISOPeletSupply + TRISOPeletSupply < 675000 && itemStack.stackSize > 0) { + if (this.BISOPeletSupply + this.TRISOPeletSupply < 675000) { + while (this.BISOPeletSupply + this.TRISOPeletSupply < 675000 && itemStack.stackSize > 0) { itemStack.stackSize--; - TRISOPeletSupply++; + this.TRISOPeletSupply++; } this.updateSlots(); } } else if (GT_Utility.areStacksEqual(itemStack, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1))) { - if (BISOPeletSupply + TRISOPeletSupply < 675000) { - while (BISOPeletSupply + TRISOPeletSupply < 675000 && itemStack.stackSize > 0) { + if (this.BISOPeletSupply + this.TRISOPeletSupply < 675000) { + while (this.BISOPeletSupply + this.TRISOPeletSupply < 675000 && itemStack.stackSize > 0) { itemStack.stackSize--; - BISOPeletSupply++; + this.BISOPeletSupply++; } this.updateSlots(); @@ -131,7 +131,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean checkRecipe(ItemStack controllerStack) { - if (!(HeliumSupply >= HELIUM_NEEDED && BISOPeletSupply + TRISOPeletSupply >= 100000)) + if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.BISOPeletSupply + this.TRISOPeletSupply >= 100000)) return false; if (new XSTR().nextBoolean()) { @@ -160,10 +160,10 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean onRunningTick(ItemStack aStack) { - if (empty){ - this.addOutput(Materials.Helium.getGas(HeliumSupply)); - this.addOutput(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, TRISOPeletSupply, 3)); - this.addOutput(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, BISOPeletSupply, 1)); + if (this.empty){ + this.addOutput(Materials.Helium.getGas(this.HeliumSupply)); + this.addOutput(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, this.TRISOPeletSupply, 3)); + this.addOutput(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, this.BISOPeletSupply, 1)); this.HeliumSupply = 0; this.TRISOPeletSupply = 0; this.BISOPeletSupply = 0; @@ -213,7 +213,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - final byte xz = 5; + byte xz = 5; int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * xz; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * xz; for (int x = -xz; x <= xz; x++) { @@ -230,9 +230,9 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { if (!(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 12)) { if ( ( - !(this.addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), BASECASINGINDEX) && y == 11) && - !(this.addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), BASECASINGINDEX) && y == 0)) && - !this.addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), BASECASINGINDEX) + !(this.addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), GT_TileEntity_THTR.BASECASINGINDEX) && y == 11) && + !(this.addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), GT_TileEntity_THTR.BASECASINGINDEX) && y == 0)) && + !this.addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), GT_TileEntity_THTR.BASECASINGINDEX) ) { return false; } @@ -250,7 +250,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { { if (!(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 12)) { if ( - !this.addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), BASECASINGINDEX)) + !this.addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), GT_TileEntity_THTR.BASECASINGINDEX)) { return false; } @@ -296,7 +296,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { "Progress:", this.mProgresstime / 20 + "secs", this.mMaxProgresstime / 20 + "secs", "BISO-Pebbles:", this.BISOPeletSupply + "pcs.", "TRISO-Pebbles:", this.TRISOPeletSupply + "pcs.", - "Helium-Level:", this.HeliumSupply+"L / "+HELIUM_NEEDED+"L", + "Helium-Level:", this.HeliumSupply+"L / "+ GT_TileEntity_THTR.HELIUM_NEEDED +"L", "Coolant/t:", this.BISOPeletSupply+this.TRISOPeletSupply >= 100000 ? (long) ((0.03471*(float)this.TRISOPeletSupply + 0.0267*(float)this.BISOPeletSupply))+"L/t" : "0L/t", "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; @@ -315,13 +315,13 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[BASECASINGINDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[BASECASINGINDEX]}; + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_THTR.BASECASINGINDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_THTR.BASECASINGINDEX]}; } @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - empty = !empty; - GT_Utility.sendChatToPlayer(aPlayer,empty ? "THTR will now empty itself." : "THTR is back in normal Operation"); + this.empty = !this.empty; + GT_Utility.sendChatToPlayer(aPlayer, this.empty ? "THTR will now empty itself." : "THTR is back in normal Operation"); } public static class THTRMaterials{ @@ -340,16 +340,16 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { 40, BW_Util.getMachineVoltageFromTier(5) ); - GT_Values.RA.addMixerRecipe(WerkstoffLoader.Thorium232.get(OrePrefixes.dust,10),Materials.Uranium235.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,new ItemStack(aTHTR_Materials),400,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(aTHTR_Materials),Materials.Graphite.getDust(64),new ItemStack(aTHTR_Materials,1,4),40,30); + GT_Values.RA.addMixerRecipe(WerkstoffLoader.Thorium232.get(OrePrefixes.dust,10),Materials.Uranium235.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,new ItemStack(THTRMaterials.aTHTR_Materials),400,30); + GT_Values.RA.addFormingPressRecipe(new ItemStack(THTRMaterials.aTHTR_Materials),Materials.Graphite.getDust(64),new ItemStack(THTRMaterials.aTHTR_Materials,1,4),40,30); ItemStack[] pellets = new ItemStack[6]; - Arrays.fill(pellets,new ItemStack(aTHTR_Materials,64,1)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(aTHTR_Materials,1,4),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,24000,30,0); - GT_Values.RA.addFormingPressRecipe(new ItemStack(aTHTR_Materials,1,4),Materials.Silicon.getDust(64),new ItemStack(aTHTR_Materials,1,2),40,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(aTHTR_Materials,1,2),Materials.Graphite.getDust(64),new ItemStack(aTHTR_Materials,1,5),40,30); + Arrays.fill(pellets,new ItemStack(THTRMaterials.aTHTR_Materials,64,1)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(THTRMaterials.aTHTR_Materials,1,4),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,24000,30,0); + GT_Values.RA.addFormingPressRecipe(new ItemStack(THTRMaterials.aTHTR_Materials,1,4),Materials.Silicon.getDust(64),new ItemStack(THTRMaterials.aTHTR_Materials,1,2),40,30); + GT_Values.RA.addFormingPressRecipe(new ItemStack(THTRMaterials.aTHTR_Materials,1,2),Materials.Graphite.getDust(64),new ItemStack(THTRMaterials.aTHTR_Materials,1,5),40,30); pellets = new ItemStack[6]; - Arrays.fill(pellets,new ItemStack(aTHTR_Materials,64,3)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(aTHTR_Materials,1,5),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,48000,30,0); + Arrays.fill(pellets,new ItemStack(THTRMaterials.aTHTR_Materials,64,3)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(THTRMaterials.aTHTR_Materials,1,5),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,48000,30,0); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index a1b10d27a8..625e857401 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -63,9 +63,9 @@ import static gregtech.api.enums.GT_Values.V; public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { - private static IIcon[] iIcons = new IIcon[2]; - private static IIconContainer[] iIconContainers = new IIconContainer[2]; - private static ITexture[] iTextures = new ITexture[3]; + private static final IIcon[] iIcons = new IIcon[2]; + private static final IIconContainer[] iIconContainers = new IIconContainer[2]; + private static final ITexture[] iTextures = new ITexture[3]; private final ArrayList tedList = new ArrayList(); private BW_RotorBlock rotorBlock; @@ -104,35 +104,35 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { GT_Recipe.GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; if (tMap == null) return false; - GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), false, false, V[1], null, aStack); + GT_Recipe tRecipe = tMap.findRecipe(this.getBaseMetaTileEntity(), false, false, V[1], null, aStack); if (tRecipe == null) return false; if (tRecipe.getOutput(0) != null) { aStack.stackSize--; - mOutputItems[0] = tRecipe.getOutput(0); + this.mOutputItems[0] = tRecipe.getOutput(0); if (new XSTR().nextInt(2) == 0) { if (tRecipe.getOutput(1) != null) - mOutputItems[1] = tRecipe.getOutput(1); - else if (!BW_Util.checkStackAndPrefix(mOutputItems[0]) || + this.mOutputItems[1] = tRecipe.getOutput(1); + else if (!BW_Util.checkStackAndPrefix(this.mOutputItems[0]) || !( - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL) || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTALLISABLE) + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL) || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTALLISABLE) ) || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Flint || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Sugar || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Wheat || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Wood || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Clay || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Ash || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Snow || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.Stone || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.MeatRaw || - BW_Util.checkStackAndPrefix(mOutputItems[0]) && GT_OreDictUnificator.getAssociation(mOutputItems[0]).mMaterial.mMaterial == Materials.MeatCooked + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Flint || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Sugar || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Wheat || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Wood || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Clay || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Ash || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Snow || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Stone || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.MeatRaw || + BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.MeatCooked ) - mOutputItems[1] = tRecipe.getOutput(0); + this.mOutputItems[1] = tRecipe.getOutput(0); } } this.mMaxProgresstime = (tRecipe.mDuration * 2 * 100); @@ -273,7 +273,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial == null || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.getDust(1) == null ) - return recipe_fallback(itemStack); //fallback for all non-unificated Items + return this.recipe_fallback(itemStack); //fallback for all non-unificated Items //Ore Unificator shit for balance if (OrePrefixes.ingot.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.gem.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { @@ -330,7 +330,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); return true; } - return recipe_fallback(itemStack); //2nd fallback + return this.recipe_fallback(itemStack); //2nd fallback } @Override @@ -573,16 +573,16 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @Override public String[] getInfoData() { - return new String[]{"Progress:", this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", Integer.toString(this.rotorBlock.getGrindPower()) + "KU/t"}; + return new String[]{"Progress:", this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", this.rotorBlock.getGrindPower() + "KU/t"}; } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { - iIcons[0] = Blocks.brick_block.getIcon(0, 0); - iIconContainers[0] = new IIconContainer() { + GT_TileEntity_Windmill.iIcons[0] = Blocks.brick_block.getIcon(0, 0); + GT_TileEntity_Windmill.iIconContainers[0] = new IIconContainer() { @Override public IIcon getIcon() { - return iIcons[0]; + return GT_TileEntity_Windmill.iIcons[0]; } @Override @@ -596,11 +596,11 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { } }; - iIcons[1] = aBlockIconRegister.registerIcon(MainMod.MOD_ID + ":windmill_top"); - iIconContainers[1] = new IIconContainer() { + GT_TileEntity_Windmill.iIcons[1] = aBlockIconRegister.registerIcon(MainMod.MOD_ID + ":windmill_top"); + GT_TileEntity_Windmill.iIconContainers[1] = new IIconContainer() { @Override public IIcon getIcon() { - return iIcons[1]; + return GT_TileEntity_Windmill.iIcons[1]; } @Override @@ -622,22 +622,22 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { ITexture[] ret = new ITexture[6]; - if (isClientSide()) { + if (this.isClientSide()) { if (aFacing == aSide || aSide == 0) { - iTextures[0] = new GT_RenderedTexture(iIconContainers[0]); + GT_TileEntity_Windmill.iTextures[0] = new GT_RenderedTexture(GT_TileEntity_Windmill.iIconContainers[0]); for (int i = 0; i < ret.length; i++) { - ret[i] = iTextures[0]; + ret[i] = GT_TileEntity_Windmill.iTextures[0]; } } else if (aSide == 1) { - iTextures[1] = new GT_RenderedTexture(iIconContainers[1]); + GT_TileEntity_Windmill.iTextures[1] = new GT_RenderedTexture(GT_TileEntity_Windmill.iIconContainers[1]); for (int i = 0; i < ret.length; i++) { - ret[i] = iTextures[1]; + ret[i] = GT_TileEntity_Windmill.iTextures[1]; } } else { - iTextures[2] = new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE); + GT_TileEntity_Windmill.iTextures[2] = new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE); for (int i = 0; i < ret.length; i++) { - ret[i] = iTextures[2]; + ret[i] = GT_TileEntity_Windmill.iTextures[2]; } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 13a94b30f0..e19d43a10b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -24,7 +24,6 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; -import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.GregTech_API; @@ -43,15 +42,14 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import static gregtech.api.enums.GT_Values.V; public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBlastFurnace { - private int mHeatingCapacity = 0; - private byte glasTier = 0; + private int mHeatingCapacity; + private byte glasTier; private int polPtick = super.getPollutionPerTick(null) * ConfigHandler.megaMachinesMax; public GT_TileEntity_MegaBlastFurnace(int aID, String aName, String aNameRegional) { @@ -65,7 +63,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl public String[] getDescription() { String[] dsc = StatCollector.translateToLocal("tooltip.tile.mbf.0.name").split(";"); String tmp = dsc[dsc.length - 1]; - dsc[dsc.length - 1] = tmp + " " + Integer.toString(20 * this.getPollutionPerTick((ItemStack) null)) + " " + StatCollector.translateToLocal("tooltip.tile.mbf.1.name"); + dsc[dsc.length - 1] = tmp + " " + 20 * this.getPollutionPerTick(null) + " " + StatCollector.translateToLocal("tooltip.tile.mbf.1.name"); String[] fdsc = new String[dsc.length + 1]; for (int i = 0; i < dsc.length; i++) { fdsc[i] = dsc[i]; @@ -79,8 +77,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return true; long allTheEu = 0; int hatches = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) - if (isValidMetaTileEntity(tHatch)) { + for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { allTheEu += tHatch.getEUVar(); hatches++; } @@ -88,7 +86,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return false; long euperhatch = aEU / hatches; HashSet returnset = new HashSet<>(); - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) + for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false)) returnset.add(true); else @@ -113,8 +111,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl @Override public boolean checkRecipe(ItemStack itemStack) { - ItemStack[] tInputs = (ItemStack[]) this.getStoredInputs().toArray(new ItemStack[0]); - FluidStack[] tFluids = (FluidStack[]) this.getStoredFluids().toArray(new FluidStack[0]); + ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); + FluidStack[] tFluids = this.getStoredFluids().toArray(new FluidStack[0]); long tVoltage = this.getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); @@ -129,7 +127,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl int processed = 0; long nominalV = BW_Util.getnominalVoltage(this); - int tHeatCapacityDivTiers = (mHeatingCapacity - tRecipe.mSpecialValue) / 900; + int tHeatCapacityDivTiers = (this.mHeatingCapacity - tRecipe.mSpecialValue) / 900; long precutRecipeVoltage = (long) (tRecipe.mEUt * Math.pow(0.95, tHeatCapacityDivTiers)); while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { @@ -147,7 +145,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl } if (found_Recipe) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; byte overclockCount = 0; @@ -158,11 +156,11 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl actualEUT = actualEUT / 2; divider++; } - overclockCount = calculateOverclockednessEBF((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), nominalV); + overclockCount = this.calculateOverclockednessEBF((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), nominalV); } else - overclockCount = calculateOverclockednessEBF(actualEUT, tRecipe.mDuration, nominalV); + overclockCount = this.calculateOverclockednessEBF(actualEUT, tRecipe.mDuration, nominalV); //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { this.mEUt = (-this.mEUt); @@ -200,11 +198,11 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl long xMaxProgresstime = ((long) aDuration) << 1; if (xMaxProgresstime > Integer.MAX_VALUE - 1) { //make impossible if too long - mEUt = Integer.MAX_VALUE - 1; - mMaxProgresstime = Integer.MAX_VALUE - 1; + this.mEUt = Integer.MAX_VALUE - 1; + this.mMaxProgresstime = Integer.MAX_VALUE - 1; } else { - mEUt = (int) (aEUt >> 2); - mMaxProgresstime = (int) xMaxProgresstime; + this.mEUt = (int) (aEUt >> 2); + this.mMaxProgresstime = (int) xMaxProgresstime; } //return 0; } else { @@ -213,24 +211,24 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl //Isnt too low EUt check? long tempEUt = xEUt < V[1] ? V[1] : xEUt; - mMaxProgresstime = aDuration; + this.mMaxProgresstime = aDuration; while (tempEUt <= V[mTier - 1]) { tempEUt <<= 2;//this actually controls overclocking //xEUt *= 4;//this is effect of everclocking - mMaxProgresstime >>= 1;//this is effect of overclocking - xEUt = mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power + this.mMaxProgresstime >>= 1;//this is effect of overclocking + xEUt = this.mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power timesOverclocked++; } if (xEUt > Integer.MAX_VALUE - 1) { - mEUt = Integer.MAX_VALUE - 1; - mMaxProgresstime = Integer.MAX_VALUE - 1; + this.mEUt = Integer.MAX_VALUE - 1; + this.mMaxProgresstime = Integer.MAX_VALUE - 1; } else { - mEUt = (int) xEUt; - if (mEUt == 0) - mEUt = 1; - if (mMaxProgresstime == 0) - mMaxProgresstime = 1;//set time to 1 tick + this.mEUt = (int) xEUt; + if (this.mEUt == 0) + this.mEUt = 1; + if (this.mMaxProgresstime == 0) + this.mMaxProgresstime = 1;//set time to 1 tick } } return timesOverclocked; @@ -238,41 +236,41 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl @Override public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - mHeatingCapacity = 0; + this.mHeatingCapacity = 0; HashSet ret = new HashSet(); ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, -2, -1, GregTech_API.sBlockCasings1, 11, 7, false,false,true,GregTech_API.sBlockCasings1,11,true,11)); ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11)); ret.add(BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11)); for (int y = -1; y < 17; y++) { ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, true, 11)); - if (!getCoilHeat(iGregTechTileEntity, 7, y, 6)) + if (!this.getCoilHeat(iGregTechTileEntity, 7, y, 6)) return false; List metasFromLayer = BW_Util.getMetasFromLayer(iGregTechTileEntity, 7, y, y + 1, 7, y == 0, false, false); for (Byte meta : metasFromLayer) { byte inttier = BW_Util.getTierFromGlasMeta(meta); - if (glasTier > 0 && inttier != glasTier) + if (this.glasTier > 0 && inttier != this.glasTier) return false; - else if (glasTier == 0) - glasTier = inttier; + else if (this.glasTier == 0) + this.glasTier = inttier; } } int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 7; int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 7; for (int z = -6; z <= 6; z++) for (int x = -6; x <= 6; x++) { - if (!addMufflerToMachineList(iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + x, 17, zDir + z), 11)) { + if (!this.addMufflerToMachineList(iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + x, 17, zDir + z), 11)) { return false; } } if (!this.mOutputHatches.isEmpty()) { - for (GT_MetaTileEntity_Hatch_Output hatchOutput : mOutputHatches) + for (GT_MetaTileEntity_Hatch_Output hatchOutput : this.mOutputHatches) if (hatchOutput.getBaseMetaTileEntity().getYCoord() < iGregTechTileEntity.getYCoord()) return false; } - if (glasTier != 8 && !mEnergyHatches.isEmpty()) - for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : mEnergyHatches) { - if (glasTier < hatchEnergy.mTier) + if (this.glasTier != 8 && !this.mEnergyHatches.isEmpty()) + for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) { + if (this.glasTier < hatchEnergy.mTier) return false; } @@ -319,10 +317,10 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl default: break; } - if (mHeatingCapacity > 0 && internalH != mHeatingCapacity) + if (this.mHeatingCapacity > 0 && internalH != this.mHeatingCapacity) return false; - else if (mHeatingCapacity == 0) - mHeatingCapacity = internalH; + else if (this.mHeatingCapacity == 0) + this.mHeatingCapacity = internalH; } } return true; @@ -330,7 +328,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl @Override public int getPollutionPerTick(ItemStack aStack) { - return polPtick; + return this.polPtick; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java index 56b9197a2d..3c7c1db53d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java @@ -40,8 +40,8 @@ import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Basi public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_ProcessingArray { private GT_Recipe mLastRecipe; - private int tTier = 0; - private int mMult = 0; + private int tTier; + private int mMult; private String mMachine = ""; private GT_MetaTileEntity_Hatch_InputBus machineBus; public GT_TileEntity_MegaProcessingArray(int aID, String aName, String aNameRegional) { @@ -53,77 +53,77 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process } public boolean checkRecipe(ItemStack aStack) { - if (!isCorrectMachinePart(machineBus.mInventory[0])) { + if (!this.isCorrectMachinePart(this.machineBus.mInventory[0])) { return false; } - GT_Recipe.GT_Recipe_Map map = getRecipeMap(); + GT_Recipe.GT_Recipe_Map map = this.getRecipeMap(); if (map == null) return false; - ArrayList tInputList = getStoredInputs(); + ArrayList tInputList = this.getStoredInputs(); - if (mInventory[1].getUnlocalizedName().endsWith("10")) { - tTier = 9; - mMult = 2;//u need 4x less machines and they will use 4x less power - } else if (mInventory[1].getUnlocalizedName().endsWith("11")) { - tTier = 9; - mMult = 4;//u need 16x less machines and they will use 16x less power - } else if (mInventory[1].getUnlocalizedName().endsWith("12") || - mInventory[1].getUnlocalizedName().endsWith("13") || - mInventory[1].getUnlocalizedName().endsWith("14") || - mInventory[1].getUnlocalizedName().endsWith("15")) { - tTier = 9; - mMult = 6;//u need 64x less machines and they will use 64x less power - } else if (mInventory[1].getUnlocalizedName().endsWith("1")) { - tTier = 1; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("2")) { - tTier = 2; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("3")) { - tTier = 3; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("4")) { - tTier = 4; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("5")) { - tTier = 5; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("6")) { - tTier = 6; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("7")) { - tTier = 7; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("8")) { - tTier = 8; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("9")) { - tTier = 9; - mMult = 0;//*1 + if (this.mInventory[1].getUnlocalizedName().endsWith("10")) { + this.tTier = 9; + this.mMult = 2;//u need 4x less machines and they will use 4x less power + } else if (this.mInventory[1].getUnlocalizedName().endsWith("11")) { + this.tTier = 9; + this.mMult = 4;//u need 16x less machines and they will use 16x less power + } else if (this.mInventory[1].getUnlocalizedName().endsWith("12") || + this.mInventory[1].getUnlocalizedName().endsWith("13") || + this.mInventory[1].getUnlocalizedName().endsWith("14") || + this.mInventory[1].getUnlocalizedName().endsWith("15")) { + this.tTier = 9; + this.mMult = 6;//u need 64x less machines and they will use 64x less power + } else if (this.mInventory[1].getUnlocalizedName().endsWith("1")) { + this.tTier = 1; + this.mMult = 0;//*1 + } else if (this.mInventory[1].getUnlocalizedName().endsWith("2")) { + this.tTier = 2; + this.mMult = 0;//*1 + } else if (this.mInventory[1].getUnlocalizedName().endsWith("3")) { + this.tTier = 3; + this.mMult = 0;//*1 + } else if (this.mInventory[1].getUnlocalizedName().endsWith("4")) { + this.tTier = 4; + this.mMult = 0;//*1 + } else if (this.mInventory[1].getUnlocalizedName().endsWith("5")) { + this.tTier = 5; + this.mMult = 0;//*1 + } else if (this.mInventory[1].getUnlocalizedName().endsWith("6")) { + this.tTier = 6; + this.mMult = 0;//*1 + } else if (this.mInventory[1].getUnlocalizedName().endsWith("7")) { + this.tTier = 7; + this.mMult = 0;//*1 + } else if (this.mInventory[1].getUnlocalizedName().endsWith("8")) { + this.tTier = 8; + this.mMult = 0;//*1 + } else if (this.mInventory[1].getUnlocalizedName().endsWith("9")) { + this.tTier = 9; + this.mMult = 0;//*1 } else { - tTier = 0; - mMult = 0;//*1 + this.tTier = 0; + this.mMult = 0;//*1 } - if (!mMachine.equals(mInventory[1].getUnlocalizedName())) mLastRecipe = null; - mMachine = mInventory[1].getUnlocalizedName(); - ItemStack[] tInputs = (ItemStack[]) tInputList.toArray(new ItemStack[tInputList.size()]); + if (!this.mMachine.equals(this.mInventory[1].getUnlocalizedName())) this.mLastRecipe = null; + this.mMachine = this.mInventory[1].getUnlocalizedName(); + ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); - ArrayList tFluidList = getStoredFluids(); + ArrayList tFluidList = this.getStoredFluids(); - FluidStack[] tFluids = (FluidStack[]) tFluidList.toArray(new FluidStack[tFluidList.size()]); + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); if (tInputList.size() > 0 || tFluids.length > 0) { - GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + GT_Recipe tRecipe = map.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, gregtech.api.enums.GT_Values.V[this.tTier], tFluids, tInputs); if (tRecipe != null) { if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 && - !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId)) + !isValidForLowGravity(tRecipe, this.getBaseMetaTileEntity().getWorld().provider.dimensionId)) return false; - mLastRecipe = tRecipe; + this.mLastRecipe = tRecipe; this.mEUt = 0; this.mOutputItems = null; this.mOutputFluids = null; - int machines = Math.min(64, mInventory[1].stackSize << mMult); //Upped max Cap to 64 + int machines = Math.min(64, this.mInventory[1].stackSize << this.mMult); //Upped max Cap to 64 int i = 0; for (; i < machines; i++) { if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { @@ -134,14 +134,14 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process } } this.mMaxProgresstime = tRecipe.mDuration; - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - BW_Util.calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, map.mAmperage, GT_Values.V[tTier], this); + BW_Util.calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, map.mAmperage, GT_Values.V[this.tTier], this); //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) return false; - this.mEUt = GT_Utility.safeInt(((long) this.mEUt * i) >> mMult, 1); - if (mEUt == Integer.MAX_VALUE - 1) + this.mEUt = GT_Utility.safeInt(((long) this.mEUt * i) >> this.mMult, 1); + if (this.mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { @@ -159,7 +159,7 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process for (int f = 0; f < tOut.length; f++) { if (tRecipe.mOutputs[f] != null && tOut[f] != null) { for (int g = 0; g < i; g++) { - if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) + if (this.getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) tOut[f].stackSize += tRecipe.mOutputs[f].stackSize; } } @@ -168,7 +168,7 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process int tSize = tFOut.amount; tFOut.amount = tSize * i; } - tOut = clean(tOut); + tOut = GT_MetaTileEntity_ProcessingArray.clean(tOut); this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); List overStacks = new ArrayList(); for (int f = 0; f < tOut.length; f++) { @@ -193,7 +193,7 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process tOut = tSList.toArray(new ItemStack[tSList.size()]); this.mOutputItems = tOut; this.mOutputFluids = new FluidStack[]{tFOut}; - updateSlots(); + this.updateSlots(); return true; }/* else{ ...remoteRecipeCheck() diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index a2227eb7a4..3c53ae1b49 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -71,8 +71,8 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre return true; long allTheEu = 0; int hatches = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) - if (isValidMetaTileEntity(tHatch)) { + for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { allTheEu += tHatch.getEUVar(); hatches++; } @@ -80,7 +80,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre return false; long euperhatch = aEU / hatches; HashSet returnset = new HashSet<>(); - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) + for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false)) returnset.add(true); else @@ -90,7 +90,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre @Override public boolean checkRecipe(ItemStack itemStack) { - ItemStack[] tInputs = (ItemStack[]) this.getStoredInputs().toArray(new ItemStack[0]); + ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); ArrayList outputItems = new ArrayList(); long tVoltage = this.getMaxInputVoltage(); @@ -112,7 +112,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre } if (found_Recipe) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; long actualEUT = (long) (tRecipe.mEUt) * processed; if (actualEUT > Integer.MAX_VALUE) { @@ -125,7 +125,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre } else BW_Util.calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, nominalV, this); //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { this.mEUt = (-this.mEUt); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index e138445f01..2453610894 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -56,7 +56,7 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene @Override public int getEfficiency() { - return 100 - 3 * mTier; + return 100 - 3 * this.mTier; } @Override @@ -110,6 +110,6 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + ChatColorHelper.YELLOW + getEfficiency(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; + return new String[]{StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + ChatColorHelper.YELLOW + this.getEfficiency(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index e26b50cdd1..5ca5d59a19 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -54,11 +54,11 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { private static final String MGUINAME = "BW.GUI.BioLab.png"; public GT_MetaTileEntity_BioLab(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, (String) null, 6, 2, MGUINAME, null, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")/*this is topactive*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")/*this is top*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM"))); + super(aID, aName, aNameRegional, aTier, 1, null, 6, 2, GT_MetaTileEntity_BioLab.MGUINAME, null, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")/*this is topactive*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")/*this is top*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM"))); } public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, String aNEIName) { - super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2, MGUINAME, aNEIName); + super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2, GT_MetaTileEntity_BioLab.MGUINAME, aNEIName); } @Override @@ -83,7 +83,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { FluidStack dnaFluid = Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); if (this.getSpecialSlot() != null && this.getSpecialSlot().getItem() instanceof LabModule) { - int damage = getSpecialSlot().getItemDamage(); + int damage = this.getSpecialSlot().getItemDamage(); switch (damage) { case 0: if (GT_Utility.isStackValid(this.mInventory[4]) && this.mInventory[4].getItem() instanceof LabParts && this.mInventory[4].getItemDamage() == 0 && this.mInventory[4].getTagCompound() != null && //checks if it is a Culture @@ -101,7 +101,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { return super.checkRecipe(skipOC); if (this.mTier < rTier + cultureDNABioData.getTier()) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 4; i < 8; i++) { if (this.mInventory[i] != null) @@ -116,7 +116,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mOutputItems[1] = GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L); this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(rTier + cultureDNABioData.getTier()), 500); - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } break; case 1: { @@ -133,7 +133,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { return super.checkRecipe(skipOC); if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 4; i < 8; i++) { if (this.mInventory[i] != null) @@ -154,7 +154,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } @@ -174,7 +174,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { if (cultureDNABioData == null) return super.checkRecipe(skipOC); if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 4; i < 6; i++) { if (this.mInventory[i] != null) this.mInventory[i].stackSize--; @@ -185,7 +185,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } @@ -202,7 +202,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { if (cultureDNABioData == null || bioCulture == null) return super.checkRecipe(skipOC); if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 4; i < 7; i++) { if (this.mInventory[i] != null) this.mInventory[i].stackSize--; @@ -210,11 +210,11 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mFluid.amount -= 1000; bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = BioItemList.getPetriDish(checkForExisting(bioCulture)); + this.mOutputItems[0] = BioItemList.getPetriDish(this.checkForExisting(bioCulture)); } this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } break; @@ -234,7 +234,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { if (cultureDNABioData == null) return super.checkRecipe(skipOC); if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 4; i < 7; i++) { if (this.mInventory[i] != null) this.mInventory[i].stackSize--; @@ -246,7 +246,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mOutputItems[0] = BioItemList.getPetriDish(out); } this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } break; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index 909d84bb31..8d3d6d1777 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -36,13 +36,13 @@ import net.minecraft.util.StatCollector; public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { - private long maxAmps = 0L; - private long aAmps = 0L; + private long maxAmps; + private long aAmps; public GT_MetaTileEntity_Diode(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, StatCollector.translateToLocal("tooltip.tile.diode.0.name")); - maxAmps = getAmpsfromMeta(aID); - aAmps = maxAmps; + this.maxAmps = this.getAmpsfromMeta(aID); + this.aAmps = this.maxAmps; } public GT_MetaTileEntity_Diode(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { @@ -52,9 +52,9 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { super.onFirstTick(aBaseMetaTileEntity); - if (maxAmps == 0 && !this.getBaseMetaTileEntity().getWorld().isRemote) { - maxAmps = getAmpsfromMeta(this.getBaseMetaTileEntity().getMetaTileID()); - aAmps = maxAmps; + if (this.maxAmps == 0 && !this.getBaseMetaTileEntity().getWorld().isRemote) { + this.maxAmps = this.getAmpsfromMeta(this.getBaseMetaTileEntity().getMetaTileID()); + this.aAmps = this.maxAmps; } } @@ -65,40 +65,40 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { if (this.getBaseMetaTileEntity().getWorld().isRemote) return; if (!aPlayer.isSneaking()) { - --aAmps; - if (aAmps < 0) - aAmps = maxAmps; - GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + aAmps); + --this.aAmps; + if (this.aAmps < 0) + this.aAmps = this.maxAmps; + GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + this.aAmps); }else{ - ++aAmps; - if (aAmps > maxAmps) - aAmps = 0; - GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + aAmps); + ++this.aAmps; + if (this.aAmps > this.maxAmps) + this.aAmps = 0; + GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + this.aAmps); } } @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setLong("maxAmp", maxAmps); - aNBT.setLong("Amps", aAmps); + aNBT.setLong("maxAmp", this.maxAmps); + aNBT.setLong("Amps", this.aAmps); } @Override public void loadNBTData(NBTTagCompound aNBT) { - maxAmps = aNBT.getLong("maxAmp"); - aAmps = aNBT.getLong("Amps"); + this.maxAmps = aNBT.getLong("maxAmp"); + this.aAmps = aNBT.getLong("Amps"); super.loadNBTData(aNBT); } @Override public long maxAmperesOut() { - return aAmps; + return this.aAmps; } @Override public long maxAmperesIn() { - return aAmps; + return this.aAmps; } @Override @@ -123,6 +123,6 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{mDescription, StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; + return new String[]{this.mDescription, StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index b88c6209a0..c84fbdfd13 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -58,21 +58,21 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { private short[] colorForGUI; private byte mass; private String material; - private byte coverage = 0; + private byte coverage; public GT_MetaTileEntity_RadioHatch(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 1, new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name") + " " + (aTier - 2) + " " + ((aTier - 2) >= 2 ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") : StatCollector.translateToLocal("tooltip.bw.kg.0.name")), StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}); - cap = aTier - 2; + this.cap = aTier - 2; } public GT_MetaTileEntity_RadioHatch(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 1, aDescription, aTextures); - cap = aTier - 2; + this.cap = aTier - 2; } public GT_MetaTileEntity_RadioHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 1, aDescription, aTextures); - cap = aTier - 2; + this.cap = aTier - 2; } public static long calcDecayTicks(int x) { @@ -89,7 +89,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public int getSievert() { - return this.sievert - (int) Math.ceil((float) this.sievert / 100f * (float) coverage); + return this.sievert - (int) Math.ceil((float) this.sievert / 100f * (float) this.coverage); } public short[] getColorForGUI() { @@ -127,7 +127,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_MetaTileEntity_RadioHatch(mName, mTier, mDescriptionArray, mTextures); + return new GT_MetaTileEntity_RadioHatch(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override @@ -154,16 +154,16 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { if (this.getBaseMetaTileEntity().isServerSide()) { if (this.mass > 0) - ++timer; + ++this.timer; - if (this.mass > 0 && this.sievert > 0 && calcDecayTicks(this.sievert) > 0) { - if (timer % (calcDecayTicks(this.sievert)) == 0) { + if (this.mass > 0 && this.sievert > 0 && GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert) > 0) { + if (this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) == 0) { this.mass--; - if (mass == 0) { - material = StatCollector.translateToLocal("tooltip.bw.empty.name"); - sievert = 0; + if (this.mass == 0) { + this.material = StatCollector.translateToLocal("tooltip.bw.empty.name"); + this.sievert = 0; } - timer = 1; + this.timer = 1; } } @@ -217,13 +217,13 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { if (this.mass == 0 || this.sievert == calculateSv(materials)) { - if (this.mass + kg <= cap) { + if (this.mass + kg <= this.cap) { this.sievert = calculateSv(materials); this.mass += kg; this.mInventory[0].stackSize--; - updateSlots(); - colorForGUI = materials.mColor.mRGBa; - material = materials.mName; + this.updateSlots(); + this.colorForGUI = materials.mColor.mRGBa; + this.material = materials.mName; } } } @@ -235,9 +235,9 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { this.mass++; this.sievert = BioVatLogicAdder.RadioHatch.getIsSv().get(varStack); this.mInventory[0].stackSize--; - updateSlots(); - colorForGUI = null; - material = StatCollector.translateToLocal(varStack.getUnlocalizedName()); + this.updateSlots(); + this.colorForGUI = null; + this.material = StatCollector.translateToLocal(varStack.getUnlocalizedName()); return; } } @@ -255,13 +255,13 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { //check material for specialised validity if (materials.getProtons() >= 83 && materials.getProtons() != 125 || materials.getProtons() == 61 || materials.getProtons() == 43) { if (this.mass == 0 || this.sievert == calculateSv(materials)) { - if ((this.mass + (orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1)) <= cap) { + if ((this.mass + (orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1)) <= this.cap) { this.sievert = calculateSv(materials); this.mass += orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1; this.mInventory[0].stackSize--; - updateSlots(); - colorForGUI = materials.mColor.mRGBa; - material = materials.mName; + this.updateSlots(); + this.colorForGUI = materials.mColor.mRGBa; + this.material = materials.mName; } } } @@ -280,8 +280,8 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @Override public String[] getInfoData() { - if (calcDecayTicks(this.sievert) != 0) - return new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + material, StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + sievert, StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + mass, StatCollector.translateToLocal("tooltip.tile.radhatch.5.name") + " " + +((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert) * 60)) + StatCollector.translateToLocal("tooltip.tile.radhatch.6.name") + "/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 + StatCollector.translateToLocal("tooltip.tile.radhatch.7.name") + "/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.8.name") + "/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.9.name")}; + if (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert) != 0) + return new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + this.material, StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + this.sievert, StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + this.mass, StatCollector.translateToLocal("tooltip.tile.radhatch.5.name") + " " + +((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert) * 60)) + StatCollector.translateToLocal("tooltip.tile.radhatch.6.name") + "/" + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 + StatCollector.translateToLocal("tooltip.tile.radhatch.7.name") + "/" + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.8.name") + "/" + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 / 60 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.9.name")}; else return new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + StatCollector.translateToLocal("tooltip.bw.empty.name"), StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + "0", StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + "0"}; } @@ -320,13 +320,13 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @Override public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setByte("mMass", mass); - aNBT.setByte("mSv", (byte) (sievert - 100)); - aNBT.setByte("mCoverage", coverage); - aNBT.setInteger("mTextColor", BW_ColorUtil.getColorFromRGBArray(getColorForGUI())); - if (material != null && !material.isEmpty()) - aNBT.setString("mMaterial", material); - aNBT.setLong("timer", timer); + aNBT.setByte("mMass", this.mass); + aNBT.setByte("mSv", (byte) (this.sievert - 100)); + aNBT.setByte("mCoverage", this.coverage); + aNBT.setInteger("mTextColor", BW_ColorUtil.getColorFromRGBArray(this.getColorForGUI())); + if (this.material != null && !this.material.isEmpty()) + aNBT.setString("mMaterial", this.material); + aNBT.setLong("timer", this.timer); super.saveNBTData(aNBT); } @@ -336,12 +336,12 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @Override public void loadNBTData(NBTTagCompound aNBT) { - timer = aNBT.getLong("timer"); - mass = aNBT.getByte("mMass"); - sievert = aNBT.getByte("mSv") + 100; - coverage = aNBT.getByte("mCoverage"); - colorForGUI = BW_ColorUtil.splitColorToRBGArray(aNBT.getInteger("mTextColor")); - material = aNBT.getString("mMaterial"); + this.timer = aNBT.getLong("timer"); + this.mass = aNBT.getByte("mMass"); + this.sievert = aNBT.getByte("mSv") + 100; + this.coverage = aNBT.getByte("mCoverage"); + this.colorForGUI = BW_ColorUtil.splitColorToRBGArray(aNBT.getInteger("mTextColor")); + this.material = aNBT.getString("mMaterial"); super.loadNBTData(aNBT); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java index 95625ea9f3..5fd9b5b5d7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java @@ -35,7 +35,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachineBlock { - boolean powered = false; + boolean powered; public GT_MetaTileEntity_Transistor(int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 0, aDescription, aTextures); @@ -91,25 +91,25 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin if (aBaseMetaTileEntity.inputEnergyFrom(side)) { TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(side); if (!(tTileEntity instanceof IBasicEnergyContainer)) { - powered = false; + this.powered = false; return; } IBasicEnergyContainer tileAtSide = (IBasicEnergyContainer) tTileEntity; if (!tileAtSide.outputsEnergyTo((byte) ForgeDirection.WEST.flag) || !tileAtSide.isUniversalEnergyStored(4L)) { - powered = false; + this.powered = false; return; } if (!tileAtSide.decreaseStoredEnergyUnits(4, false)) { - powered = false; + this.powered = false; return; } if (aBaseMetaTileEntity.injectEnergyUnits(side, 4L, 1L) == 4L) { - powered = true; + this.powered = true; } } if (aBaseMetaTileEntity.isAllowedToWork()) - powered = !powered; + this.powered = !this.powered; } } @@ -124,11 +124,11 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin @Override public long maxAmperesOut() { - return powered ? 1L : 0; + return this.powered ? 1L : 0; } public long maxEUOutput() { - return powered ? GT_Values.V[this.mTier] : 0; + return this.powered ? GT_Values.V[this.mTier] : 0; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java index 8590f1f713..0dd86aa030 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java @@ -37,9 +37,9 @@ import java.awt.*; public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { public BW_NEI_BioLabHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { super(aRecipeMap); - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), getOverlayIdentifier())); + this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier())); if (!NEI_BW_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + getRecipeName() + "@" + getOverlayIdentifier()); + FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); GuiUsageRecipe.usagehandlers.add(this); } @@ -51,7 +51,7 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { public void loadCraftingRecipes(ItemStack aResult) { if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3) { - for (GT_Recipe recipe : getSortedRecipes()) { + for (GT_Recipe recipe : this.getSortedRecipes()) { if (aResult.getTagCompound() != null && recipe != null) for (int i = 0; i < recipe.mOutputs.length; i++) { if (recipe.mOutputs[i] != null) @@ -69,7 +69,7 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { @Override public void loadUsageRecipes(ItemStack aResult) { if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3) { - for (GT_Recipe recipe : getSortedRecipes()) { + for (GT_Recipe recipe : this.getSortedRecipes()) { if (aResult.getTagCompound() != null && recipe != null) for (int i = 0; i < recipe.mInputs.length; i++) { if (recipe.mInputs[i] != null) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index 4cf03fb000..ddf1da1e15 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -42,9 +42,9 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { public BW_NEI_BioVatHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { super(aRecipeMap); - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), getOverlayIdentifier())); + this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier())); if (!NEI_BW_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + getRecipeName() + "@" + getOverlayIdentifier()); + FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); GuiUsageRecipe.usagehandlers.add(this); } @@ -63,38 +63,38 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { int tSpecial; if (recipeDesc == null) { if (tEUt != 0) { - drawText(10, lines[0], this.trans("152", "Total: ") + (long) tDuration * (long) tEUt + " EU", -16777216); - drawText(10, lines[1], this.trans("153", "Usage: ") + tEUt + " EU/t", -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[0], this.trans("152", "Total: ") + (long) tDuration * (long) tEUt + " EU", -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[1], this.trans("153", "Usage: ") + tEUt + " EU/t", -16777216); if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, lines[2], this.trans("154", "Voltage: ") + tEUt / this.mRecipeMap.mAmperage + " EU", -16777216); - drawText(10, lines[3], this.trans("155", "Amperage: ") + this.mRecipeMap.mAmperage, -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[2], this.trans("154", "Voltage: ") + tEUt / this.mRecipeMap.mAmperage + " EU", -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[3], this.trans("155", "Amperage: ") + this.mRecipeMap.mAmperage, -16777216); } else { - drawText(10, lines[2], this.trans("156", "Voltage: unspecified"), -16777216); - drawText(10, lines[3], this.trans("157", "Amperage: unspecified"), -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[2], this.trans("156", "Voltage: unspecified"), -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[3], this.trans("157", "Amperage: unspecified"), -16777216); } } if (tDuration > 0) { - drawText(10, lines[4], this.trans("158", "Time: ") + String.format("%.2f " + this.trans("161", " secs"), 0.05F * (float) tDuration), -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[4], this.trans("158", "Time: ") + String.format("%.2f " + this.trans("161", " secs"), 0.05F * (float) tDuration), -16777216); } tSpecial = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; int[] tSpecialA = GT_TileEntity_BioVat.specialValueUnpack(tSpecial); - drawText(10, lines[5], StatCollector.translateToLocal("nei.biovat.0.name") + " " + tSpecialA[0], -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[5], StatCollector.translateToLocal("nei.biovat.0.name") + " " + tSpecialA[0], -16777216); if (tSpecialA[1] == -100 && GT_Mod.gregtechproxy.mLowGravProcessing) { - drawText(10, lines[7], this.trans("159", "Needs Low Gravity"), -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[7], this.trans("159", "Needs Low Gravity"), -16777216); } else if (tSpecialA[1] == -200 && GT_Mod.gregtechproxy.mEnableCleanroom) { - drawText(10, lines[7], this.trans("160", "Needs Cleanroom"), -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[7], this.trans("160", "Needs Cleanroom"), -16777216); } else if (tSpecialA[1] == -300 && GT_Mod.gregtechproxy.mEnableCleanroom) { - drawText(10, lines[7], this.trans("160", "Needs Cleanroom & LowGrav"), -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[7], this.trans("160", "Needs Cleanroom & LowGrav"), -16777216); } else if (tSpecialA[1] == -400) { - drawText(10, lines[7], this.trans("216", "Deprecated Recipe"), -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[7], this.trans("216", "Deprecated Recipe"), -16777216); } else if (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre) || GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost)) { - drawText(10, lines[6], (tSpecialA[2] == 1 ? StatCollector.translateToLocal("nei.biovat.1.name") : StatCollector.translateToLocal("nei.biovat.2.name")) + this.mRecipeMap.mNEISpecialValuePre + tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier + this.mRecipeMap.mNEISpecialValuePost, -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[6], (tSpecialA[2] == 1 ? StatCollector.translateToLocal("nei.biovat.1.name") : StatCollector.translateToLocal("nei.biovat.2.name")) + this.mRecipeMap.mNEISpecialValuePre + tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier + this.mRecipeMap.mNEISpecialValuePost, -16777216); } } else { tSpecial = 0; @@ -103,7 +103,7 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { for (int var8 = 0; var8 < var7; ++var8) { String descLine = var6[var8]; - drawText(10, 73 + 10 * tSpecial, descLine, -16777216); + GT_NEI_DefaultHandler.drawText(10, 73 + 10 * tSpecial, descLine, -16777216); ++tSpecial; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index 1012cffc01..4f5f1a8cd2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -29,9 +29,9 @@ import codechicken.nei.recipe.TemplateRecipeHandler; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; @@ -47,7 +47,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public BW_NEI_OreHandler() { if (!NEI_BW_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(MainMod.MOD_ID, "NEIPlugins", "register-crafting-handler", MainMod.MOD_ID + "@" + getRecipeName() + "@" + getOverlayIdentifier()); + FMLInterModComms.sendRuntimeMessage(MainMod.MOD_ID, "NEIPlugins", "register-crafting-handler", MainMod.MOD_ID + "@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); // GuiUsageRecipe.usagehandlers.add(this); } @@ -60,7 +60,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void loadTransferRects() { - transferRects.add(new RecipeTransferRect(new Rectangle(0,40,40,10),"quickanddirtyneihandler")); + this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(0,40,40,10),"quickanddirtyneihandler")); } @Override @@ -77,13 +77,13 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { continue; if (w.getGenerationFeatures().hasOres()) { ItemStack result = w.get(OrePrefixes.ore); - CachedRecipe tmp = new CachedRecipe() { + TemplateRecipeHandler.CachedRecipe tmp = new TemplateRecipeHandler.CachedRecipe() { PositionedStack stack = new PositionedStack(result, 0, 0); @Override public PositionedStack getResult() { - return stack; + return this.stack; } @Override @@ -96,7 +96,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { if (worldGen.mPrimaryMeta == baseMeta || worldGen.mSecondaryMeta == baseMeta || worldGen.mBetweenMeta == baseMeta || worldGen.mSporadicMeta == baseMeta) { ItemStack other; other = result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore", "Vein")); - stack = new PositionedStack(other, 83, 0); + this.stack = new PositionedStack(other, 83, 0); if (((worldGen.bwOres & 0b1000) != 0)) { other = result.copy(); other.setItemDamage(worldGen.mPrimaryMeta); @@ -141,7 +141,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { } }; boolean add = true; - for (TemplateRecipeHandler.CachedRecipe recipe: arecipes) { + for (TemplateRecipeHandler.CachedRecipe recipe: this.arecipes) { if (recipe == null || recipe.getOtherStacks() == null || recipe.getOtherStacks().get(0) == null || recipe.getOtherStacks().get(0).item == null) continue; if (GT_Utility.areStacksEqual(recipe.getOtherStacks().get(0).item,tmp.getOtherStacks().get(0).item)) @@ -173,13 +173,13 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void loadCraftingRecipes(ItemStack result) { if (Block.getBlockFromItem(result.getItem()) instanceof BW_MetaGenerated_Ores) { - CachedRecipe tmp = new CachedRecipe() { + TemplateRecipeHandler.CachedRecipe tmp = new TemplateRecipeHandler.CachedRecipe() { PositionedStack stack = new PositionedStack(result, 0, 0); @Override public PositionedStack getResult() { - return stack; + return this.stack; } @Override @@ -192,7 +192,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { if (worldGen.mPrimaryMeta == baseMeta || worldGen.mSecondaryMeta == baseMeta || worldGen.mBetweenMeta == baseMeta || worldGen.mSporadicMeta == baseMeta) { ItemStack other; other = result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore", "Vein")); - stack = new PositionedStack(other, 83, 0); + this.stack = new PositionedStack(other, 83, 0); if (((worldGen.bwOres & 0b1000) != 0)) { other = result.copy(); other.setItemDamage(worldGen.mPrimaryMeta); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index d760f09cea..284fdc973c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -40,11 +40,11 @@ public class NEI_BW_Config implements IConfigureNEI { API.hideItem(new ItemStack(ItemRegistry.TAB)); API.hideItem(new ItemStack(FluidLoader.bioFluidBlock)); API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses)); - sIsAdded = false; + NEI_BW_Config.sIsAdded = false; new BW_NEI_OreHandler(); new BW_NEI_BioVatHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BACTERIALVATBYTE)); new BW_NEI_BioLabHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BIOLABBYTE)); - sIsAdded = true; + NEI_BW_Config.sIsAdded = true; } @Optional.Method(modid = "NotEnoughItems") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java index 121f628df8..f18b34c734 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java @@ -42,7 +42,7 @@ public class BW_Container_HeatedWaterPump extends Container { final BW_TileEntity_HeatedWaterPump TILE; final IInventory INVENTORY; public int fuel, water, awater, maxfuel; - long timer = 0; + long timer; byte[] anetfuel, netfuel, anetmaxfuel, netmaxfuel; public BW_Container_HeatedWaterPump(BW_TileEntity_HeatedWaterPump TILE, EntityPlayer INVENTORY) { @@ -77,108 +77,108 @@ public class BW_Container_HeatedWaterPump extends Container { @Override public void detectAndSendChanges() { super.detectAndSendChanges(); - if (TILE.getWorldObj().isRemote) + if (this.TILE.getWorldObj().isRemote) return; - fuel = this.TILE.fuel; - maxfuel = this.TILE.maxfuel; - water = this.TILE.outputstack.amount; - netfuel = ByteBuffer.allocate(8).putInt(fuel).array(); - netmaxfuel = ByteBuffer.allocate(8).putInt(maxfuel).array(); - ++timer; + this.fuel = this.TILE.fuel; + this.maxfuel = this.TILE.maxfuel; + this.water = this.TILE.outputstack.amount; + this.netfuel = ByteBuffer.allocate(8).putInt(this.fuel).array(); + this.netmaxfuel = ByteBuffer.allocate(8).putInt(this.maxfuel).array(); + ++this.timer; Iterator var2 = this.crafters.iterator(); - if (timer >= Long.MAX_VALUE - 1) - timer = 0; + if (this.timer >= Long.MAX_VALUE - 1) + this.timer = 0; while (true) { do { if (!var2.hasNext()) { - netfuel = anetfuel; - netmaxfuel = anetmaxfuel; - water = awater; + this.netfuel = this.anetfuel; + this.netmaxfuel = this.anetmaxfuel; + this.water = this.awater; return; } ICrafting var1 = (ICrafting) var2.next(); - if (this.timer % 500 == 10 || this.water != awater) - var1.sendProgressBarUpdate(this, 0, water); - if (this.timer % 500 == 10 || netfuel != anetfuel) - for (int i = 0; i < netfuel.length; i++) { - var1.sendProgressBarUpdate(this, i + 1, netfuel[i]); + if (this.timer % 500 == 10 || this.water != this.awater) + var1.sendProgressBarUpdate(this, 0, this.water); + if (this.timer % 500 == 10 || this.netfuel != this.anetfuel) + for (int i = 0; i < this.netfuel.length; i++) { + var1.sendProgressBarUpdate(this, i + 1, this.netfuel[i]); } - if (this.timer % 500 == 10 || netmaxfuel != anetmaxfuel) - for (int i = 0; i < netmaxfuel.length; i++) { - var1.sendProgressBarUpdate(this, i + 9, netmaxfuel[i]); + if (this.timer % 500 == 10 || this.netmaxfuel != this.anetmaxfuel) + for (int i = 0; i < this.netmaxfuel.length; i++) { + var1.sendProgressBarUpdate(this, i + 9, this.netmaxfuel[i]); } - } while (this.timer % 500 != 10 && this.water != awater); + } while (this.timer % 500 != 10 && this.water != this.awater); } } @Override @SideOnly(Side.CLIENT) public void updateProgressBar(int packetID, int valure) { - if (netfuel == null) - netfuel = new byte[8]; - if (netmaxfuel == null) - netmaxfuel = new byte[8]; + if (this.netfuel == null) + this.netfuel = new byte[8]; + if (this.netmaxfuel == null) + this.netmaxfuel = new byte[8]; switch (packetID) { case 0: { - water = valure; + this.water = valure; this.getSlot(1).putStack(this.getSlot(1).getStack().setStackDisplayName(this.water + "L Water")); break; } case 1: - netfuel[0] = (byte) valure; + this.netfuel[0] = (byte) valure; break; case 2: - netfuel[1] = (byte) valure; + this.netfuel[1] = (byte) valure; break; case 3: - netfuel[2] = (byte) valure; + this.netfuel[2] = (byte) valure; break; case 4: - netfuel[3] = (byte) valure; + this.netfuel[3] = (byte) valure; break; case 5: - netfuel[4] = (byte) valure; + this.netfuel[4] = (byte) valure; break; case 6: - netfuel[5] = (byte) valure; + this.netfuel[5] = (byte) valure; break; case 7: - netfuel[6] = (byte) valure; + this.netfuel[6] = (byte) valure; break; case 8: - netfuel[7] = (byte) valure; + this.netfuel[7] = (byte) valure; break; case 9: - netmaxfuel[0] = (byte) valure; + this.netmaxfuel[0] = (byte) valure; break; case 10: - netmaxfuel[1] = (byte) valure; + this.netmaxfuel[1] = (byte) valure; break; case 11: - netmaxfuel[2] = (byte) valure; + this.netmaxfuel[2] = (byte) valure; break; case 12: - netmaxfuel[3] = (byte) valure; + this.netmaxfuel[3] = (byte) valure; break; case 13: - netmaxfuel[4] = (byte) valure; + this.netmaxfuel[4] = (byte) valure; break; case 14: - netmaxfuel[5] = (byte) valure; + this.netmaxfuel[5] = (byte) valure; break; case 15: - netmaxfuel[6] = (byte) valure; + this.netmaxfuel[6] = (byte) valure; break; case 16: - netmaxfuel[7] = (byte) valure; + this.netmaxfuel[7] = (byte) valure; break; default: break; } if (packetID > 0 && packetID < 9) - this.fuel = ByteBuffer.wrap(netfuel).getInt(); + this.fuel = ByteBuffer.wrap(this.netfuel).getInt(); if (packetID > 8 && packetID < 17) - this.maxfuel = ByteBuffer.wrap(netmaxfuel).getInt(); + this.maxfuel = ByteBuffer.wrap(this.netmaxfuel).getInt(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java index b30c3fbbd4..42bdc56e3b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java @@ -39,7 +39,7 @@ public class BW_Container_RadioHatch extends Container { public byte coverage, dcoverage; long timer; - private GT_MetaTileEntity_RadioHatch iGregTechTileEntity; + private final GT_MetaTileEntity_RadioHatch iGregTechTileEntity; public BW_Container_RadioHatch(InventoryPlayer inventory, IMetaTileEntity iGregTechTileEntity) { this.iGregTechTileEntity = (GT_MetaTileEntity_RadioHatch) iGregTechTileEntity; @@ -112,37 +112,37 @@ public class BW_Container_RadioHatch extends Container { }; for (int i = 0; i < 12; i++) { - addSlotToContainer(new GT_Slot_Holo(inv, i, -64 + i * 18, 22, false, false, 1)); + this.addSlotToContainer(new GT_Slot_Holo(inv, i, -64 + i * 18, 22, false, false, 1)); } for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); + this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); } } @Override public void detectAndSendChanges() { if (!this.iGregTechTileEntity.getBaseMetaTileEntity().isClientSide() && this.iGregTechTileEntity.getBaseMetaTileEntity().getMetaTileEntity() != null) { - coverage = iGregTechTileEntity.getCoverage(); - ++timer; + this.coverage = this.iGregTechTileEntity.getCoverage(); + ++this.timer; Iterator var2 = this.crafters.iterator(); - if (timer >= Long.MAX_VALUE - 1) - timer = 0; + if (this.timer >= Long.MAX_VALUE - 1) + this.timer = 0; while (true) { do { if (!var2.hasNext()) { - dcoverage = coverage; + this.dcoverage = this.coverage; return; } ICrafting var1 = (ICrafting) var2.next(); - if (this.timer % 500 == 10 || this.dcoverage != coverage) - var1.sendProgressBarUpdate(this, 0, coverage); - } while (this.timer % 500 != 10 && this.dcoverage != coverage); + if (this.timer % 500 == 10 || this.dcoverage != this.coverage) + var1.sendProgressBarUpdate(this, 0, this.coverage); + } while (this.timer % 500 != 10 && this.dcoverage != this.coverage); } } } @@ -150,7 +150,7 @@ public class BW_Container_RadioHatch extends Container { @Override public void updateProgressBar(int p_75137_1_, int p_75137_2_) { if (p_75137_1_ == 0) - coverage = (byte) p_75137_2_; + this.coverage = (byte) p_75137_2_; } @Override @@ -198,7 +198,7 @@ public class BW_Container_RadioHatch extends Container { setto = 0; } this.iGregTechTileEntity.setCoverage((short) (this.iGregTechTileEntity.getCoverage() + setto)); - detectAndSendChanges(); + this.detectAndSendChanges(); return null; } return super.slotClick(slot, button, aShifthold, entityPlayer); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java index 65fb30e847..7545d5225a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -47,30 +47,30 @@ public class GT_Container_CircuitProgrammer extends Container { public GT_Container_CircuitProgrammer(InventoryPlayer inventory) { - player = inventory.player; + this.player = inventory.player; - IInventory inv = new pinv(player); + IInventory inv = new pinv(this.player); - addSlotToContainer(new Slot(inv, 0, 44, 61));//-45, 84)); + this.addSlotToContainer(new Slot(inv, 0, 44, 61));//-45, 84)); for (int i = 1; i < 13; i++) { - addSlotToContainer(new GT_Slot_Holo(inv, i, -64 + i * 18, 22, false, false, 1)); + this.addSlotToContainer(new GT_Slot_Holo(inv, i, -64 + i * 18, 22, false, false, 1)); } for (int i = 0; i < 12; i++) { - addSlotToContainer(new GT_Slot_Holo(inv, i + 12, -46 + i * 18, 40, false, false, 1)); + this.addSlotToContainer(new GT_Slot_Holo(inv, i + 12, -46 + i * 18, 40, false, false, 1)); } for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (int i = 0; i < 9; i++) { if (GT_Utility.isStackValid(inventory.getStackInSlot(i)) && inventory.getStackInSlot(i).getItem() instanceof Circuit_Programmer) - addSlotToContainer(new GT_Slot_Render(inventory, i, 8 + i * 18, 142)); + this.addSlotToContainer(new GT_Slot_Render(inventory, i, 8 + i * 18, 142)); else - addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); + this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); } } @@ -80,10 +80,10 @@ public class GT_Container_CircuitProgrammer extends Container { ItemStack iCircuit = GT_Utility.getIntegratedCircuit(slot); iCircuit.stackSize = 1; ((Slot) this.inventorySlots.get(0)).putStack(iCircuit); - detectAndSendChanges(); + this.detectAndSendChanges(); return ((Slot) this.inventorySlots.get(0)).getStack(); } - detectAndSendChanges(); + this.detectAndSendChanges(); return super.slotClick(slot, button, aShifthold, entityPlayer); } @@ -113,7 +113,7 @@ public class GT_Container_CircuitProgrammer extends Container { } } } - detectAndSendChanges(); + this.detectAndSendChanges(); return null; } @@ -125,13 +125,12 @@ public class GT_Container_CircuitProgrammer extends Container { NBTTagCompound tag; public pinv(EntityPlayer Player) { - super(); this.Player = Player; this.toBind = Player.inventory.getCurrentItem(); - tag = this.toBind.getTagCompound(); - if (tag.getBoolean("HasChip")) { - Slot = GT_Utility.getIntegratedCircuit(tag.getByte("ChipConfig")); - Slot.stackSize = 1; + this.tag = this.toBind.getTagCompound(); + if (this.tag.getBoolean("HasChip")) { + this.Slot = GT_Utility.getIntegratedCircuit(this.tag.getByte("ChipConfig")); + this.Slot.stackSize = 1; } } @@ -142,60 +141,60 @@ public class GT_Container_CircuitProgrammer extends Container { @Override public ItemStack getStackInSlot(int slot) { - return slot == 0 ? Slot : null; + return slot == 0 ? this.Slot : null; } @Override public ItemStack decrStackSize(int slotNR, int count) { - ItemStack ret = Slot.copy(); - Slot = null; - tag = toBind.getTagCompound(); - tag.setBoolean("HasChip", false); - toBind.setTagCompound(tag); - Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); + ItemStack ret = this.Slot.copy(); + this.Slot = null; + this.tag = this.toBind.getTagCompound(); + this.tag.setBoolean("HasChip", false); + this.toBind.setTagCompound(this.tag); + this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); return ret; } @Override public ItemStack getStackInSlotOnClosing(int p_70304_1_) { - return Slot; + return this.Slot; } @Override public void setInventorySlotContents(int slotNR, ItemStack itemStack) { if (itemStack != null && itemStack.getItem() != null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) { - Slot = itemStack.copy().splitStack(1); + this.Slot = itemStack.copy().splitStack(1); itemStack.stackSize--; - tag = toBind.getTagCompound(); - tag.setBoolean("HasChip", true); - tag.setByte("ChipConfig", (byte) itemStack.getItemDamage()); - toBind.setTagCompound(tag); - Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); - if (!Player.isClientWorld()) - MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(Player.worldObj.provider.dimensionId, Player.getEntityId(), true, (byte) itemStack.getItemDamage())); + this.tag = this.toBind.getTagCompound(); + this.tag.setBoolean("HasChip", true); + this.tag.setByte("ChipConfig", (byte) itemStack.getItemDamage()); + this.toBind.setTagCompound(this.tag); + this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); + if (!this.Player.isClientWorld()) + MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), true, (byte) itemStack.getItemDamage())); } else if (BW_Util.checkStackAndPrefix(itemStack) && GT_OreDictUnificator.getAssociation(itemStack).mPrefix.equals(OrePrefixes.circuit) && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.equals(Materials.Basic)) { - Slot = GT_Utility.getIntegratedCircuit(0); - Slot.stackSize = 1; + this.Slot = GT_Utility.getIntegratedCircuit(0); + this.Slot.stackSize = 1; itemStack.stackSize--; - tag = toBind.getTagCompound(); - tag.setBoolean("HasChip", true); - tag.setByte("ChipConfig", (byte) 0); - toBind.setTagCompound(tag); - Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); - if (!Player.isClientWorld()) - MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(Player.worldObj.provider.dimensionId, Player.getEntityId(), true, (byte) 0)); + this.tag = this.toBind.getTagCompound(); + this.tag.setBoolean("HasChip", true); + this.tag.setByte("ChipConfig", (byte) 0); + this.toBind.setTagCompound(this.tag); + this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); + if (!this.Player.isClientWorld()) + MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), true, (byte) 0)); }/* else if (GT_Utility.isStackValid(itemStack) && itemStack.getItem() instanceof Circuit_Programmer) { ForgeHooks.onPlayerTossEvent(Player, itemStack, false); this.closeInventory(); Player.closeScreen(); }*/ else { - ForgeHooks.onPlayerTossEvent(Player, itemStack, false); - tag = toBind.getTagCompound(); - tag.setBoolean("HasChip", false); - toBind.setTagCompound(tag); - Player.inventory.setInventorySlotContents(Player.inventory.currentItem, toBind); - if (!Player.isClientWorld()) - MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(Player.worldObj.provider.dimensionId, Player.getEntityId(), false, (byte) 0)); + ForgeHooks.onPlayerTossEvent(this.Player, itemStack, false); + this.tag = this.toBind.getTagCompound(); + this.tag.setBoolean("HasChip", false); + this.toBind.setTagCompound(this.tag); + this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); + if (!this.Player.isClientWorld()) + MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), false, (byte) 0)); } } @@ -236,9 +235,7 @@ public class GT_Container_CircuitProgrammer extends Container { @Override public boolean isItemValidForSlot(int p_94041_1_, ItemStack itemStack) { - if (itemStack != null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) - return true; - return false; + return itemStack != null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java index b983ea27d7..6d3b86da1f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java @@ -34,21 +34,21 @@ public class GT_Container_Item_Destructopack extends Container { public GT_Container_Item_Destructopack(InventoryPlayer inventory) { - addSlotToContainer(new BW_DelSlot()); + this.addSlotToContainer(new BW_DelSlot()); for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); + this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); } } @Override - public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int aSlotIndex) { - final Slot slotObject = (Slot) this.inventorySlots.get(aSlotIndex); + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int aSlotIndex) { + Slot slotObject = (Slot) this.inventorySlots.get(aSlotIndex); slotObject.putStack(null); return null; } @@ -60,7 +60,7 @@ public class GT_Container_Item_Destructopack extends Container { @Override public void onCraftMatrixChanged(IInventory p_75130_1_) { - final Slot slotObject = (Slot) this.inventorySlots.get(0); + Slot slotObject = (Slot) this.inventorySlots.get(0); slotObject.decrStackSize(0); } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java index 22a3e8ea17..a1cd7505fe 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java @@ -40,7 +40,7 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { public short sv, dsv, sievert, r, g, b, dsievert, dr, dg, db; public byte[] teTimer = new byte[8], dteTimer = new byte[8]; GT_MetaTileEntity_RadioHatch TE; - private long timer = 0; + private long timer; public GT_Container_RadioHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); @@ -49,49 +49,49 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { public void detectAndSendChanges() { super.detectAndSendChanges(); if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) { - TE = (GT_MetaTileEntity_RadioHatch) this.mTileEntity.getMetaTileEntity(); - mass = TE.getMass(); - sievert = (short) TE.sievert; - short[] rgb = TE.getColorForGUI(); - r = rgb[0]; - g = rgb[1]; - b = rgb[2]; - sv = (short) TE.getSievert(); - teTimer = ByteBuffer.allocate(8).putLong(TE.getTimer()).array(); - ++timer; + this.TE = (GT_MetaTileEntity_RadioHatch) this.mTileEntity.getMetaTileEntity(); + this.mass = this.TE.getMass(); + this.sievert = (short) this.TE.sievert; + short[] rgb = this.TE.getColorForGUI(); + this.r = rgb[0]; + this.g = rgb[1]; + this.b = rgb[2]; + this.sv = (short) this.TE.getSievert(); + this.teTimer = ByteBuffer.allocate(8).putLong(this.TE.getTimer()).array(); + ++this.timer; Iterator var2 = this.crafters.iterator(); - if (timer >= Long.MAX_VALUE - 1) - timer = 0; + if (this.timer >= Long.MAX_VALUE - 1) + this.timer = 0; while (true) { do { if (!var2.hasNext()) { - dmass = mass; - dsievert = sievert; - dr = r; - dg = g; - db = b; - dteTimer = teTimer; - dsv = sv; + this.dmass = this.mass; + this.dsievert = this.sievert; + this.dr = this.r; + this.dg = this.g; + this.db = this.b; + this.dteTimer = this.teTimer; + this.dsv = this.sv; return; } ICrafting var1 = (ICrafting) var2.next(); - if (this.timer % 500 == 10 || this.dmass != mass) - var1.sendProgressBarUpdate(this, 21, mass); - if (this.timer % 500 == 10 || this.dsievert != sievert) - var1.sendProgressBarUpdate(this, 22, (sievert - 100)); - if (this.timer % 500 == 10 || this.dr != r) - var1.sendProgressBarUpdate(this, 23, r); - if (this.timer % 500 == 10 || this.dg != g) - var1.sendProgressBarUpdate(this, 24, g); - if (this.timer % 500 == 10 || this.db != b) - var1.sendProgressBarUpdate(this, 25, b); - if (this.timer % 500 == 10 || this.dteTimer != teTimer) - for (int i = 0; i < teTimer.length; i++) { - var1.sendProgressBarUpdate(this, 26 + i, teTimer[i]); + if (this.timer % 500 == 10 || this.dmass != this.mass) + var1.sendProgressBarUpdate(this, 21, this.mass); + if (this.timer % 500 == 10 || this.dsievert != this.sievert) + var1.sendProgressBarUpdate(this, 22, (this.sievert - 100)); + if (this.timer % 500 == 10 || this.dr != this.r) + var1.sendProgressBarUpdate(this, 23, this.r); + if (this.timer % 500 == 10 || this.dg != this.g) + var1.sendProgressBarUpdate(this, 24, this.g); + if (this.timer % 500 == 10 || this.db != this.b) + var1.sendProgressBarUpdate(this, 25, this.b); + if (this.timer % 500 == 10 || this.dteTimer != this.teTimer) + for (int i = 0; i < this.teTimer.length; i++) { + var1.sendProgressBarUpdate(this, 26 + i, this.teTimer[i]); } - if (this.timer % 500 == 10 || this.dsv != sv) - var1.sendProgressBarUpdate(this, 34, sv); + if (this.timer % 500 == 10 || this.dsv != this.sv) + var1.sendProgressBarUpdate(this, 34, this.sv); } while (this.timer % 500 != 10 && this.dmass == this.mass); } @@ -104,46 +104,46 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { super.updateProgressBar(par1, par2); switch (par1) { case 21: - mass = (byte) par2; + this.mass = (byte) par2; break; case 22: - sievert = (short) (par2 + 100); + this.sievert = (short) (par2 + 100); break; case 23: - r = (short) par2; + this.r = (short) par2; break; case 24: - g = (short) par2; + this.g = (short) par2; break; case 25: - b = (short) par2; + this.b = (short) par2; break; case 26: - teTimer[0] = (byte) par2; + this.teTimer[0] = (byte) par2; break; case 27: - teTimer[1] = (byte) par2; + this.teTimer[1] = (byte) par2; break; case 28: - teTimer[2] = (byte) par2; + this.teTimer[2] = (byte) par2; break; case 29: - teTimer[3] = (byte) par2; + this.teTimer[3] = (byte) par2; break; case 30: - teTimer[4] = (byte) par2; + this.teTimer[4] = (byte) par2; break; case 31: - teTimer[5] = (byte) par2; + this.teTimer[5] = (byte) par2; break; case 32: - teTimer[6] = (byte) par2; + this.teTimer[6] = (byte) par2; break; case 33: - teTimer[7] = (byte) par2; + this.teTimer[7] = (byte) par2; break; case 34: - sv = (short) par2; + this.sv = (short) par2; break; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java index ba85a38e79..9e832e0820 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java @@ -35,16 +35,16 @@ import java.util.logging.LogRecord; import java.util.logging.Logger; public class DebugLog { - private static boolean init = false; + private static boolean init; private static FileHandler fh; private static Logger utilLog; public DebugLog(FMLPreInitializationEvent event) throws IOException { - if (init) + if (DebugLog.init) return; - fh = new FileHandler(new File(new File(event.getModConfigurationDirectory().getParentFile(),"logs"),"BWLog.log").toString()); - utilLog = Logger.getLogger("DebugLog"); - utilLog.setUseParentHandlers(false); - utilLog.addHandler(fh); + DebugLog.fh = new FileHandler(new File(new File(event.getModConfigurationDirectory().getParentFile(),"logs"),"BWLog.log").toString()); + DebugLog.utilLog = Logger.getLogger("DebugLog"); + DebugLog.utilLog.setUseParentHandlers(false); + DebugLog.utilLog.addHandler(DebugLog.fh); Formatter formatter = new Formatter() { @Override public String format(LogRecord record) { @@ -56,13 +56,13 @@ public class DebugLog { + " " + record.getMessage() + "\n"; } }; - fh.setFormatter(formatter); - init = true; + DebugLog.fh.setFormatter(formatter); + DebugLog.init = true; } public static void log(String record){ - if (!init) + if (!DebugLog.init) return; - utilLog.info(record); + DebugLog.utilLog.info(record); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index 4418d72dbd..3fe6337b7d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -29,7 +29,6 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ITexturedTileEntity; import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.common.blocks.GT_Block_Ores_Abstract; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -44,7 +43,7 @@ import static com.github.bartimaeusnek.bartworks.MainMod.BW_Network_instance; public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEntity { - public short mMetaData = 0; + public short mMetaData; public static boolean placeOre(World aWorld, Coords coords, Werkstoff werkstoff) { short meta = werkstoff.getmID(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java index 6aa0ab1671..f09bb6f33d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java @@ -46,7 +46,7 @@ public class BW_MetaGeneratedOre_Item extends BW_ItemBlocks { } public String getUnlocalizedName(ItemStack aStack) { - return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack); + return this.field_150939_a.getUnlocalizedName() + "." + this.getDamage(aStack); } public String getItemStackDisplayName(ItemStack aStack) { @@ -64,7 +64,7 @@ public class BW_MetaGeneratedOre_Item extends BW_ItemBlocks { } public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { - short tDamage = (short) getDamage(aStack); + short tDamage = (short) this.getDamage(aStack); if (tDamage > 0) { if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) { return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 3cbd78ac89..7baa3c7090 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -37,14 +37,12 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import ic2.core.IC2Potion; -import ic2.core.item.armor.ItemArmorHazmat; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -74,8 +72,8 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa public BW_MetaGenerated_Items(OrePrefixes orePrefixes) { super("bwMetaGenerated" + orePrefixes.name(), (short) 32766, (short) 0); this.orePrefixes = orePrefixes; - this.setCreativeTab(metaTab); - for (int i = 0; i < aNumToGen; i++) { + this.setCreativeTab(BW_MetaGenerated_Items.metaTab); + for (int i = 0; i < this.aNumToGen; i++) { ItemStack tStack = new ItemStack(this, 1, i); Werkstoff w = werkstoffHashMap.get((short) i); if (w == null || ((w.getGenerationFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) == 0) || ((w.getGenerationFeatures().blacklist & orePrefixes.mMaterialGenerationBits) != 0) ) @@ -90,7 +88,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } public boolean onEntityItemUpdate(EntityItem aItemEntity) { - if (orePrefixes == OrePrefixes.dustImpure || orePrefixes == OrePrefixes.dustPure || orePrefixes == OrePrefixes.crushed) { + if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure || this.orePrefixes == OrePrefixes.crushed) { int aDamage = aItemEntity.getEntityItem().getItemDamage(); if ((aDamage >= 0) && (!aItemEntity.worldObj.isRemote)) { Werkstoff aMaterial = werkstoffHashMap.get((short) aDamage); @@ -98,7 +96,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa int tX = MathHelper.floor_double(aItemEntity.posX); int tY = MathHelper.floor_double(aItemEntity.posY); int tZ = MathHelper.floor_double(aItemEntity.posZ); - if ((orePrefixes == OrePrefixes.dustImpure) || (orePrefixes == OrePrefixes.dustPure)) { + if ((this.orePrefixes == OrePrefixes.dustImpure) || (this.orePrefixes == OrePrefixes.dustPure)) { Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { @@ -106,7 +104,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } - } else if (orePrefixes == OrePrefixes.crushed) { + } else if (this.orePrefixes == OrePrefixes.crushed) { Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { @@ -126,16 +124,16 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa // String tooltip = GT_LanguageManager.getTranslation(this.getUnlocalizedName(aStack) + ".tooltip"); // if (!tooltip.isEmpty()) // aList.add(tooltip); - if (orePrefixes == OrePrefixes.dustImpure || orePrefixes == OrePrefixes.dustPure) { + if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure) { aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify")); } - if (orePrefixes == OrePrefixes.crushed) + if (this.orePrefixes == OrePrefixes.crushed) aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify.2")); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } public String getDefaultLocalization(Werkstoff werkstoff) { - return werkstoff != null ? orePrefixes.mLocalizedMaterialPre + werkstoff.getDefaultName() + orePrefixes.mLocalizedMaterialPost : Werkstoff.default_null_Werkstoff.getDefaultName(); + return werkstoff != null ? this.orePrefixes.mLocalizedMaterialPre + werkstoff.getDefaultName() + this.orePrefixes.mLocalizedMaterialPost : Werkstoff.default_null_Werkstoff.getDefaultName(); } @Override @@ -145,15 +143,15 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public final IIconContainer getIconContainer(int aMetaData) { - return werkstoffHashMap.get((short) aMetaData) == null ? null : werkstoffHashMap.get((short) aMetaData).getTexSet().mTextures[orePrefixes.mTextureIndex]; + return werkstoffHashMap.get((short) aMetaData) == null ? null : werkstoffHashMap.get((short) aMetaData).getTexSet().mTextures[this.orePrefixes.mTextureIndex]; } @Override @SideOnly(Side.CLIENT) public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { - for (int i = 0; i < aNumToGen; i++) { + for (int i = 0; i < this.aNumToGen; i++) { Werkstoff werkstoff = werkstoffHashMap.get((short) i); - if (werkstoff != null && ((werkstoff.getGenerationFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) != 0) && ((werkstoff.getGenerationFeatures().blacklist & orePrefixes.mMaterialGenerationBits) == 0)) { + if (werkstoff != null && ((werkstoff.getGenerationFeatures().toGenerate & this.orePrefixes.mMaterialGenerationBits) != 0) && ((werkstoff.getGenerationFeatures().blacklist & this.orePrefixes.mMaterialGenerationBits) == 0)) { ItemStack tStack = new ItemStack(this, 1, i); aList.add(tStack); } @@ -163,7 +161,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public short[] getRGBa(ItemStack aStack) { - Werkstoff werkstoff = werkstoffHashMap.get((short) getDamage(aStack)); + Werkstoff werkstoff = werkstoffHashMap.get((short) this.getDamage(aStack)); return werkstoff == null ? Materials._NULL.mRGBa : werkstoff.getRGBA(); } @@ -195,7 +193,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa Werkstoff tMaterial = werkstoffHashMap.get((short) aMetaData); if (tMaterial == null) return null; - IIconContainer tIcon = getIconContainer(aMetaData); + IIconContainer tIcon = this.getIconContainer(aMetaData); if (tIcon != null) return tIcon.getIcon(); return null; @@ -208,7 +206,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public int getRadiationLevel(ItemStack aStack) { - Werkstoff w = Werkstoff.werkstoffHashMap.get((short)aStack.getItemDamage()); + Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage()); return w.getStats().isRadioactive() ? (int) w.getStats().protons : 0; } @@ -219,13 +217,13 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public short[] getColorForGUI(ItemStack aStack) { - Werkstoff w = Werkstoff.werkstoffHashMap.get((short)aStack.getItemDamage()); + Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage()); return w.getRGBA(); } @Override public String getNameForGUI(ItemStack aStack) { - Werkstoff w = Werkstoff.werkstoffHashMap.get((short)aStack.getItemDamage()); + Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage()); return w.getDefaultName(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index ba03007669..f09c5f7442 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -60,7 +60,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0 || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) continue; GT_ModHandler.addValuableOre(this, w.getmID(), 1); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + w.getmID() + ".name", w.getDefaultName() + OrePrefixes.ore.mLocalizedMaterialPost); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", w.getDefaultName() + OrePrefixes.ore.mLocalizedMaterialPost); } } } @@ -91,7 +91,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { } public String getLocalizedName() { - return StatCollector.translateToLocal(getUnlocalizedName() + ".name"); + return StatCollector.translateToLocal(this.getUnlocalizedName() + ".name"); } @Override @@ -131,7 +131,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { public void breakBlock(World world, int x, int y, int z, Block block, int meta) { TileEntity tTileEntity = world.getTileEntity(x, y, z); if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { - mTemporaryTileEntity.set((BW_MetaGeneratedOreTE) tTileEntity); + BW_MetaGenerated_Ores.mTemporaryTileEntity.set((BW_MetaGeneratedOreTE) tTileEntity); } super.breakBlock(world, x, y, z, block, meta); } @@ -141,7 +141,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { return ((BW_MetaGeneratedOreTE) tTileEntity).getDrops(WerkstoffLoader.BWOres); } - return mTemporaryTileEntity.get() == null ? new ArrayList() : ((BW_MetaGeneratedOreTE) mTemporaryTileEntity.get()).getDrops(WerkstoffLoader.BWOres); + return BW_MetaGenerated_Ores.mTemporaryTileEntity.get() == null ? new ArrayList() : BW_MetaGenerated_Ores.mTemporaryTileEntity.get().getDrops(WerkstoffLoader.BWOres); } public int getHarvestLevel(int metadata) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java index bb3bea4915..e5467ea8c3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java @@ -39,17 +39,17 @@ public class ThreadedLoader implements Runnable { public synchronized void run() { MainMod.LOGGER.warn("EXPERIMENTAL THREADED-LOADER ENABLED!"); MainMod.LOGGER.info("Starting to register BartWorks Materials Recipes to Gregtech"); - threads.add(new AllRecipes()); - threads.forEach(Thread::start); + this.threads.add(new AllRecipes()); + this.threads.forEach(Thread::start); } public synchronized void runInit() { MainMod.LOGGER.warn("EXPERIMENTAL THREADED-LOADER ENABLED!"); MainMod.LOGGER.info("Starting the Material Generation Thread"); - threadsInit.add(new MaterialGen()); - threadsInit.forEach(Thread::start); - for (Thread thread : threadsInit) { + this.threadsInit.add(new MaterialGen()); + this.threadsInit.forEach(Thread::start); + for (Thread thread : this.threadsInit) { try { MainMod.LOGGER.info("Trying to join the Material Generation Thread"); thread.join(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 754d07055f..ccc1335e6c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -422,7 +422,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.boilingPoint; } - public Stats setBoilingPoint(int boilingPoint) { + public Werkstoff.Stats setBoilingPoint(int boilingPoint) { this.boilingPoint = boilingPoint; return this; } @@ -431,7 +431,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.meltingPoint; } - public Stats setMeltingPoint(int meltingPoint) { + public Werkstoff.Stats setMeltingPoint(int meltingPoint) { this.meltingPoint = meltingPoint; return this; } @@ -445,12 +445,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { //logic gate shit byte quality = ~0b111111; - public Stats setmTC_AspectsArray(Pair[] mTC_Aspects) { + public Werkstoff.Stats setmTC_AspectsArray(Pair[] mTC_Aspects) { this.mTC_Aspects = mTC_Aspects; return this; } - public Stats setmTC_AspectsVarArg(Pair... mTC_Aspects) { + public Werkstoff.Stats setmTC_AspectsVarArg(Pair... mTC_Aspects) { this.mTC_Aspects = mTC_Aspects; return this; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 662cfbea5a..99dce114b2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -44,15 +44,16 @@ import gregtech.api.enums.*; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_MultiTexture; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.objects.ItemData; -import gregtech.api.util.*; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputOreDict; import ic2.api.recipe.RecipeOutput; import ic2.api.recipe.Recipes; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; @@ -112,8 +113,8 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().onlyDust().addGems(), 4, TextureSet.SET_DIAMOND, - Arrays.asList(Zirconium), - new Pair<>(Zirconium, 1), + Arrays.asList(WerkstoffLoader.Zirconium), + new Pair<>(WerkstoffLoader.Zirconium, 1), new Pair<>(Materials.Oxygen, 2) ); public static final Werkstoff FluorBuergerit = new Werkstoff( @@ -310,8 +311,8 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().addGems(), 19, TextureSet.SET_GEM_VERTICAL, - Arrays.asList(Zirconium,Materials.Silicon), - new Pair<>(Zirconium, 1), + Arrays.asList(WerkstoffLoader.Zirconium,Materials.Silicon), + new Pair<>(WerkstoffLoader.Zirconium, 1), new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Oxygen, 4) ); @@ -604,7 +605,7 @@ public class WerkstoffLoader implements Runnable { } } - public static int toGenerateGlobal = 0b0000000; + public static int toGenerateGlobal; private void addItemsForGeneration() { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { for (OrePrefixes p : values()) @@ -612,20 +613,20 @@ public class WerkstoffLoader implements Runnable { MainMod.LOGGER.info("Found: "+(p+werkstoff.getDefaultName().replaceAll(" ",""))+" in oreDict, disable and reroute my Items to that, also add a Tooltip."); werkstoff.getGenerationFeatures().setBlacklist(p); } - toGenerateGlobal = (toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); + WerkstoffLoader.toGenerateGlobal = (WerkstoffLoader.toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); //System.out.println(werkstoff.getDefaultName()+": "+werkstoff.getGenerationFeatures().toGenerate); } - if ((toGenerateGlobal & 0b1) != 0) { + if ((WerkstoffLoader.toGenerateGlobal & 0b1) != 0) { WerkstoffLoader.items.put(dust, new BW_MetaGenerated_Items(dust)); WerkstoffLoader.items.put(dustTiny, new BW_MetaGenerated_Items(dustTiny)); WerkstoffLoader.items.put(dustSmall, new BW_MetaGenerated_Items(dustSmall)); } - if ((toGenerateGlobal & 0b10) != 0) { + if ((WerkstoffLoader.toGenerateGlobal & 0b10) != 0) { WerkstoffLoader.items.put(ingot, new BW_MetaGenerated_Items(ingot)); WerkstoffLoader.items.put(nugget, new BW_MetaGenerated_Items(nugget)); } - if ((toGenerateGlobal & 0b100) != 0) { + if ((WerkstoffLoader.toGenerateGlobal & 0b100) != 0) { WerkstoffLoader.items.put(gem, new BW_MetaGenerated_Items(gem)); WerkstoffLoader.items.put(gemChipped, new BW_MetaGenerated_Items(gemChipped)); WerkstoffLoader.items.put(gemExquisite, new BW_MetaGenerated_Items(gemExquisite)); @@ -633,16 +634,16 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.items.put(gemFlawless, new BW_MetaGenerated_Items(gemFlawless)); WerkstoffLoader.items.put(lens,new BW_MetaGenerated_Items(lens)); } - if ((toGenerateGlobal & 0b1000) != 0) { + if ((WerkstoffLoader.toGenerateGlobal & 0b1000) != 0) { if (!ConfigHandler.experimentalThreadedLoader) - gameRegistryHandler(); + this.gameRegistryHandler(); WerkstoffLoader.items.put(crushed, new BW_MetaGenerated_Items(crushed)); WerkstoffLoader.items.put(crushedPurified, new BW_MetaGenerated_Items(crushedPurified)); WerkstoffLoader.items.put(crushedCentrifuged, new BW_MetaGenerated_Items(crushedCentrifuged)); WerkstoffLoader.items.put(dustPure, new BW_MetaGenerated_Items(dustPure)); WerkstoffLoader.items.put(dustImpure, new BW_MetaGenerated_Items(dustImpure)); } - if ((toGenerateGlobal & 0b10000) != 0) { + if ((WerkstoffLoader.toGenerateGlobal & 0b10000) != 0) { WerkstoffLoader.items.put(cell, new BW_MetaGenerated_Items(cell)); WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle)); WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); @@ -655,7 +656,7 @@ public class WerkstoffLoader implements Runnable { GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.01"); - runGTItemDataRegistrator(); + WerkstoffLoader.runGTItemDataRegistrator(); } public static void runGTItemDataRegistrator(){ diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index a6345c8736..0c8327ad69 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -28,7 +28,6 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -43,7 +42,7 @@ public class AdditionalRecipes implements Runnable { public void run() { //Cubic Circonia GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(11),Materials.Oxygen.getGas(3000),null, WerkstoffLoader.YttriumOxide.get(dust,5),64, BW_Util.getMachineVoltageFromTier(4)); - GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust,10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.Zirconia.get(gemFlawed, 40)}, (Object) null, (int[]) null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953); + GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust,10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.Zirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953); //Thorium/Yttrium Glas GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall,2),WerkstoffLoader.Thorianit.get(dustSmall,2),Materials.Glass.getMolten(144),null,new ItemStack(ItemRegistry.bw_glasses[0],1,12),null,800,BW_Util.getMachineVoltageFromTier(5),3663); //Thorianit recipes diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java index 25e3598df0..61a1d33d08 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java @@ -31,7 +31,7 @@ import java.util.concurrent.ConcurrentHashMap; public class OreDictAdder { - private static ConcurrentHashMap toAddMap = new ConcurrentHashMap<>(); + private static final ConcurrentHashMap toAddMap = new ConcurrentHashMap<>(); public static synchronized void addToMap(Pair element){ OreDictAdder.toAddMap.put(element.getKey(),element.getValue()); @@ -43,7 +43,7 @@ public class OreDictAdder { } public static void addToOreDict(){ - for (Map.Entry entry: toAddMap.entrySet()){ + for (Map.Entry entry: OreDictAdder.toAddMap.entrySet()){ GT_OreDictUnificator.registerOre(entry.getKey(),entry.getValue()); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java index 77578b3c1c..6bc3627e7c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java @@ -50,14 +50,14 @@ public class OreDictHandler { } public static void adaptCacheForWorld(){ - Set used = new HashSet<>(cache.keySet()); + Set used = new HashSet<>(OreDictHandler.cache.keySet()); OreDictHandler.cache.clear(); OreDictHandler.cacheNonBW.clear(); for (String s : used) { if (!OreDictionary.getOres(s).isEmpty()) { ItemStack tmpstack = OreDictionary.getOres(s).get(0).copy(); Pair p = new Pair<>(Item.getIdFromItem(tmpstack.getItem()), (short) tmpstack.getItemDamage()); - cache.put(s, p); + OreDictHandler.cache.put(s, p); for (ItemStack tmp : OreDictionary.getOres(s)) { Pair p2 = new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); @@ -72,12 +72,12 @@ public class OreDictHandler { } public static ItemStack getItemStack(String elementName, OrePrefixes prefixes, int amount){ - if (cache.get(prefixes+elementName.replaceAll(" ","")) != null){ - Pair p = cache.get(prefixes+elementName.replaceAll(" ","")); + if (OreDictHandler.cache.get(prefixes+elementName.replaceAll(" ","")) != null){ + Pair p = OreDictHandler.cache.get(prefixes+elementName.replaceAll(" ","")); return new ItemStack(Item.getItemById(p.getKey()),amount,p.getValue()); } else if (!OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).isEmpty()){ ItemStack tmp = OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).get(0).copy(); - cache.put(prefixes+elementName.replaceAll(" ",""),new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage())); + OreDictHandler.cache.put(prefixes+elementName.replaceAll(" ",""),new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage())); tmp.stackSize=amount; return tmp; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index 7442a9a769..1dc9e080c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -23,8 +23,6 @@ package com.github.bartimaeusnek.bartworks.system.oregen; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -32,9 +30,9 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidRegistry; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; import static gregtech.api.enums.Materials.*; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; public class BW_WorldGenRoss128b extends BW_OreLayer { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java index 8254b44815..39a1ffa5bb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java @@ -31,9 +31,9 @@ public class GT_WorldgenUtil { private GT_WorldgenUtil() {} - public final static Block GT_TILES = GregTech_API.sBlockMachines; + public static final Block GT_TILES = GregTech_API.sBlockMachines; - public final static short[][] METAFORTIERS_ENERGY = { + public static final short[][] METAFORTIERS_ENERGY = { {100,101,102,105}, //ULV=HPSteam {1110,1115,1120,1127}, {1111,12726,1116,1121,1128}, @@ -41,7 +41,7 @@ public class GT_WorldgenUtil { {12728,1190,1130,12685}, {1191,1174,695,12686}, }; - public final static short[][] METAFORTIERS_BUFFER = { + public static final short[][] METAFORTIERS_BUFFER = { {5133,5123}, //ULV=HPSteam {161,171,181,191}, {162,172,182,192}, @@ -50,7 +50,7 @@ public class GT_WorldgenUtil { {165,175,185,195}, }; //ULV=HPSteam - public final static short[][] METAFORTIERS_CABLE = { + public static final short[][] METAFORTIERS_CABLE = { {5133,5123}, //ULV=HPSteam {1210,1230,1250,1270,1290}, {1310,1330,1350,1370,1390}, @@ -58,7 +58,7 @@ public class GT_WorldgenUtil { {1510,1530,1550,1570,1590}, {1650,1670,1690}, }; - public final static short[][] METAFORTIERS_MACHINE = { + public static final short[][] METAFORTIERS_MACHINE = { {103,104,106,107,109,110,112,113,115,116,118,119}, //ULV=HPSteam {201,211,221,231,241,251,261,271,281,291,301,311,321,331,341,351,361,371,381,391,401,411,421,431,441,451,461,471,481,491,501,511,521,531,541,551,561,571,581,591,601,611,621,631,641,651,661,671}, {}, @@ -67,39 +67,39 @@ public class GT_WorldgenUtil { {}, }; - private static boolean initialisized = false; + private static boolean initialisized; private static void init(){ for (int j = 1; j < 5; j++) { - METAFORTIERS_MACHINE[j+1]=new short[METAFORTIERS_MACHINE[1].length]; - for (int i = 0; i < METAFORTIERS_MACHINE[1].length; i++) { - METAFORTIERS_MACHINE[j+1][i]= (short) (METAFORTIERS_MACHINE[1][i]+j); + GT_WorldgenUtil.METAFORTIERS_MACHINE[j+1]=new short[GT_WorldgenUtil.METAFORTIERS_MACHINE[1].length]; + for (int i = 0; i < GT_WorldgenUtil.METAFORTIERS_MACHINE[1].length; i++) { + GT_WorldgenUtil.METAFORTIERS_MACHINE[j+1][i]= (short) (GT_WorldgenUtil.METAFORTIERS_MACHINE[1][i]+j); } } - initialisized=true; + GT_WorldgenUtil.initialisized =true; } public static short getGenerator(Random rand,int tier){ - short meta = METAFORTIERS_ENERGY[tier][rand.nextInt(METAFORTIERS_ENERGY[tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? meta : getGenerator(rand,tier); + short meta = GT_WorldgenUtil.METAFORTIERS_ENERGY[tier][rand.nextInt(GT_WorldgenUtil.METAFORTIERS_ENERGY[tier].length)]; + return GregTech_API.METATILEENTITIES[meta] != null ? meta : GT_WorldgenUtil.getGenerator(rand,tier); } public static short getBuffer(Random rand,int tier){ - short meta = METAFORTIERS_BUFFER[tier][rand.nextInt(METAFORTIERS_BUFFER[tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? meta : getBuffer(rand,tier); + short meta = GT_WorldgenUtil.METAFORTIERS_BUFFER[tier][rand.nextInt(GT_WorldgenUtil.METAFORTIERS_BUFFER[tier].length)]; + return GregTech_API.METATILEENTITIES[meta] != null ? meta : GT_WorldgenUtil.getBuffer(rand,tier); } public static short getCable(Random rand,int tier){ - short meta = METAFORTIERS_CABLE[tier][rand.nextInt(METAFORTIERS_CABLE[tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? meta : getCable(rand,tier); + short meta = GT_WorldgenUtil.METAFORTIERS_CABLE[tier][rand.nextInt(GT_WorldgenUtil.METAFORTIERS_CABLE[tier].length)]; + return GregTech_API.METATILEENTITIES[meta] != null ? meta : GT_WorldgenUtil.getCable(rand,tier); } public static short getMachine(Random rand,int tier){ - if (!initialisized) - init(); - short meta = METAFORTIERS_MACHINE[tier][rand.nextInt(METAFORTIERS_MACHINE[tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? meta : getMachine(rand,tier); + if (!GT_WorldgenUtil.initialisized) + GT_WorldgenUtil.init(); + short meta = GT_WorldgenUtil.METAFORTIERS_MACHINE[tier][rand.nextInt(GT_WorldgenUtil.METAFORTIERS_MACHINE[tier].length)]; + return GregTech_API.METATILEENTITIES[meta] != null ? meta : GT_WorldgenUtil.getMachine(rand,tier); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java index 841fe49b12..8c5db993b3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java @@ -32,19 +32,14 @@ import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; -import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.ChestGenHooks; -import net.minecraftforge.common.ForgeHooks; -import java.nio.ByteBuffer; import java.security.SecureRandom; import java.util.Random; -import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; -import static net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST; import static net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST; public abstract class MapGenRuins extends WorldGenerator { @@ -57,30 +52,30 @@ public abstract class MapGenRuins extends WorldGenerator { } protected void setFloorBlocks(int[] metas, Block... blocks){ - ToBuildWith[0]=new Pair[metas.length]; + this.ToBuildWith[0]=new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { - ToBuildWith[0][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + this.ToBuildWith[0][i]=new Pair<>(blocks[i%blocks.length],metas[i]); } } protected void setWallBlocks(int[] metas,Block... blocks){ - ToBuildWith[1]=new Pair[metas.length]; + this.ToBuildWith[1]=new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { - ToBuildWith[1][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + this.ToBuildWith[1][i]=new Pair<>(blocks[i%blocks.length],metas[i]); } } protected void setRoofBlocks(int[] metas,Block... blocks){ - ToBuildWith[2]=new Pair[metas.length]; + this.ToBuildWith[2]=new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { - ToBuildWith[2][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + this.ToBuildWith[2][i]=new Pair<>(blocks[i%blocks.length],metas[i]); } } protected void setMiscBlocks(int[] metas,Block... blocks){ - ToBuildWith[3]=new Pair[metas.length]; + this.ToBuildWith[3]=new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { - ToBuildWith[3][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + this.ToBuildWith[3][i]=new Pair<>(blocks[i%blocks.length],metas[i]); } } @@ -88,9 +83,9 @@ public abstract class MapGenRuins extends WorldGenerator { protected void setRandomBlockWAirChance(World worldObj, int x, int y, int z, Random rand, int airchance, Pair... blocks){ if (rand.nextInt(100) > airchance) - setRandomBlock(worldObj,x,y,z,rand,blocks); + this.setRandomBlock(worldObj,x,y,z,rand,blocks); else - setBlock(worldObj,x,y,z,Blocks.air,0); + this.setBlock(worldObj,x,y,z,Blocks.air,0); } protected void setRandomBlock(World worldObj, int x, int y, int z, Random rand, Pair... blocks){ @@ -132,11 +127,11 @@ public abstract class MapGenRuins extends WorldGenerator { y--; } - setFloorBlocks(new int[]{0,0,0},Blocks.brick_block,Blocks.double_stone_slab,Blocks.stonebrick); - setWallBlocks(new int[]{0,1,2,1,1},Blocks.stonebrick); - setRoofBlocks(new int[]{9},Blocks.log); - setMiscBlocks(new int[]{1},Blocks.log); - statBlocks= new int[]{rand.nextInt(ToBuildWith[0].length)}; + this.setFloorBlocks(new int[]{0,0,0},Blocks.brick_block,Blocks.double_stone_slab,Blocks.stonebrick); + this.setWallBlocks(new int[]{0,1,2,1,1},Blocks.stonebrick); + this.setRoofBlocks(new int[]{9},Blocks.log); + this.setMiscBlocks(new int[]{1},Blocks.log); + this.statBlocks = new int[]{rand.nextInt(this.ToBuildWith[0].length)}; int colored=rand.nextInt(15); int tier = rand.nextInt(6); boolean useColor = rand.nextBoolean(); @@ -150,40 +145,40 @@ public abstract class MapGenRuins extends WorldGenerator { for (int dz = -6; dz <= 6; dz++) { this.setBlock(worldObj,x+dx,y+dy,z+dz,Blocks.air,0); if (dy == 0){ - Pair floor = ToBuildWith[0][statBlocks[0]]; - this.setBlock(worldObj,x+dx,y+dy,z+dz, floor.getKey(),floor.getValue()); + Pair floor = this.ToBuildWith[0][this.statBlocks[0]]; + this.setBlock(worldObj,x+dx,y+ 0,z+dz, floor.getKey(),floor.getValue()); } else if (dy > 0 && dy < 4){ if (Math.abs(dx) == 5 && Math.abs(dz) == 5){ - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,5, ToBuildWith[3][0]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,5, this.ToBuildWith[3][0]); } else if ((dx == 0) && dz == -5 && (dy == 1 || dy == 2)){ if (dy == 1) - this.setBlock(worldObj,x+dx,y+dy,z+dz, Blocks.iron_door,1); + this.setBlock(worldObj,x+dx,y+ 1,z+ -5, Blocks.iron_door,1); if (dy == 2) - this.setBlock(worldObj,x+dx,y+dy,z+dz, Blocks.iron_door,8); + this.setBlock(worldObj,x+dx,y+ 2,z+dz, Blocks.iron_door,8); } else if (Math.abs(dx)== 5 && Math.abs(dz) < 5 || Math.abs(dz)== 5 && Math.abs(dx) < 5){ - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[1]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); if (dy == 2) { if (rand.nextInt(100)<12) if (useColor) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,new Pair<>(Blocks.stained_glass_pane,colored)); + this.setRandomBlockWAirChance(worldObj,x+dx,y+ 2,z+dz,rand,25,new Pair<>(Blocks.stained_glass_pane,colored)); else - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,new Pair<>(Blocks.glass_pane,0)); + this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,new Pair<>(Blocks.glass_pane,0)); } } if (dy == 3 && Math.abs(dx)== 6){ - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+ 3,z+dz,rand,25, this.ToBuildWith[2]); } if (dy == 1){ if (dx == 3 && dz == -3){ - setBlock(worldObj,x + dx, y + dy, z + dz,Blocks.crafting_table,0); + this.setBlock(worldObj,x + 3, y + 1, z + dz,Blocks.crafting_table,0); } if (dx == -3 && (dz == -3 || dz == -2)){ - setBlock(worldObj,x + dx, y + dy, z + dz,Blocks.chest,5); + this.setBlock(worldObj,x + -3, y + dy, z + dz,Blocks.chest,5); IInventory chest = (IInventory)worldObj.getTileEntity(x + dx, y + dy, z + dz); if (chest != null) { WeightedRandomChestContent.generateChestContents(secureRandom, ChestGenHooks.getItems(PYRAMID_JUNGLE_CHEST, rand), chest, ChestGenHooks.getCount(PYRAMID_JUNGLE_CHEST, rand)); @@ -192,7 +187,7 @@ public abstract class MapGenRuins extends WorldGenerator { if (dx == 4 && dz==4) { short meta = GT_WorldgenUtil.getGenerator(secureRandom,tier); - setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES,GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); + this.setBlock(worldObj, x + 4, y + dy, z + dz, GT_WorldgenUtil.GT_TILES,GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); BTE.setInitialValuesAsNBT(null,meta); BTE.setOwnerName("Ancient Cultures"); @@ -202,28 +197,28 @@ public abstract class MapGenRuins extends WorldGenerator { else if (dx == 3 && dz==4) { if (tier>0) { short meta = GT_WorldgenUtil.getBuffer(secureRandom, tier); - setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); + this.setBlock(worldObj, x + 3, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); BTE.setInitialValuesAsNBT(null, meta); BTE.setOwnerName("Ancient Cultures"); BTE.setFrontFacing((byte) 4); }else{ short meta = cablemeta; - setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 33, new Pair(GT_WorldgenUtil.GT_TILES, (int) GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType())); + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 33, new Pair(GT_WorldgenUtil.GT_TILES, (int) GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType())); BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); if (BTE != null) { BTE.setInitialValuesAsNBT(null, meta); BTE.setOwnerName("Ancient Cultures"); BTE.setFrontFacing((byte) 4); BTE.mConnections = (byte) (BTE.mConnections | 1 << (byte) 4); - BTE.mConnections = (byte) (BTE.mConnections | 1 << (byte) GT_Utility.getOppositeSide(4)); + BTE.mConnections = (byte) (BTE.mConnections | 1 << GT_Utility.getOppositeSide(4)); ((MetaPipeEntity) BTE.getMetaTileEntity()).mConnections = BTE.mConnections; } } } else if (dx < 3 && dx > -5 && dz == 4) { short meta = cablemeta; - setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 33, new Pair(GT_WorldgenUtil.GT_TILES, (int) GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType())); + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + 4, rand, 33, new Pair(GT_WorldgenUtil.GT_TILES, (int) GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType())); BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); if (BTE != null) { @@ -231,7 +226,7 @@ public abstract class MapGenRuins extends WorldGenerator { BTE.setOwnerName("Ancient Cultures"); BTE.setFrontFacing((byte) 4); BTE.mConnections = (byte)(BTE.mConnections | 1 << (byte)4); - BTE.mConnections = (byte)(BTE.mConnections | 1 << (byte) GT_Utility.getOppositeSide(4)); + BTE.mConnections = (byte)(BTE.mConnections | 1 << GT_Utility.getOppositeSide(4)); BaseMetaTileEntity BPE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz-1); if (BPE != null) { @@ -244,7 +239,7 @@ public abstract class MapGenRuins extends WorldGenerator { else if (dx < 3 && dx > -5 && dz == 3 && set < toSet){ if (!lastset || treeinaRow > 2) { short meta = GT_WorldgenUtil.getMachine(secureRandom, tier); - setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); + this.setBlock(worldObj, x + dx, y + dy, z + 3, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); BTE.setInitialValuesAsNBT(null, meta); BTE.setOwnerName("Ancient Cultures"); @@ -264,31 +259,31 @@ public abstract class MapGenRuins extends WorldGenerator { } else if(dy == 4){ if (Math.abs(dx)== 5) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+ 4,z+dz,rand,25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 5) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[1]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); } else if(dy == 5){ if (Math.abs(dx)== 4) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+ 5,z+dz,rand,25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 4) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[1]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); } else if(dy == 6){ if (Math.abs(dx)== 3) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+ 6,z+dz,rand,25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 3) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[1]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); } else if(dy == 7){ if (Math.abs(dx)== 2) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+ 7,z+dz,rand,25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 2) - setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,ToBuildWith[1]); + this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); } else if(dy == 8) { if (Math.abs(dx) == 1 || Math.abs(dx) == 0) - setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj, x + dx, y + 8, z + dz, rand, 25, this.ToBuildWith[2]); } } } @@ -301,7 +296,7 @@ public abstract class MapGenRuins extends WorldGenerator { if (set < toSet){ if (!lastset || treeinaRow > 2 && worldObj.getTileEntity(x + dx, y + dy, z + dz) == null) { short meta = GT_WorldgenUtil.getMachine(secureRandom, tier); - setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); + this.setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); BTE.setInitialValuesAsNBT(null, meta); BTE.setOwnerName("Ancient Cultures"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index f7312eeab2..f774989d6a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -24,7 +24,6 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import gregtech.api.enums.Materials; -import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; @@ -32,16 +31,18 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; -import ic2.api.item.IElectricItem; import net.minecraft.block.Block; +import net.minecraft.init.Blocks; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import javax.annotation.Nonnegative; -import java.util.*; -import java.util.function.UnaryOperator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; import static gregtech.api.enums.GT_Values.V; @@ -149,7 +150,7 @@ public class BW_Util { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offsetsize; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offsetsize; - return aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block); + return block == Blocks.air ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block); } public static boolean addBlockToMachine(int x, int y, int z, int offsetsize, IGregTechTileEntity aBaseMetaTileEntity, Block block, int damage) { @@ -157,7 +158,7 @@ public class BW_Util { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offsetsize; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offsetsize; - return aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == dmg; + return block == Blocks.air ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == dmg; } public static int calculateSv(Materials materials) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java index 1a0f189fd7..7e35affabf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java @@ -29,7 +29,6 @@ import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; import java.util.HashSet; -import java.util.LinkedHashSet; public class ConnectedBlocksChecker { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 5effb4a33e..4ae8b0a85e 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -53,9 +53,9 @@ public class BartWorksCrossmod { public static final String NAME = "BartWorks Mod Additions"; public static final String VERSION = "0.0.1"; public static final String MOD_ID = "bartworkscrossmod"; - public static final Logger LOGGER = LogManager.getLogger(NAME); + public static final Logger LOGGER = LogManager.getLogger(BartWorksCrossmod.NAME); - @Mod.Instance(MOD_ID) + @Mod.Instance(BartWorksCrossmod.MOD_ID) public static BartWorksCrossmod instance; @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java index 1c48eae294..e424b693d2 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java @@ -61,7 +61,7 @@ public class RadioHatchCompat implements Runnable { private static Object rod; private static Object longRod; - public static HashSet TranslateSet = new HashSet(); + public static HashSet TranslateSet = new HashSet<>(); static{ try { @@ -89,7 +89,7 @@ public class RadioHatchCompat implements Runnable { RadioHatchCompat.localizedName.setAccessible(true); RadioHatchCompat.unlocalizedName.setAccessible(true); - Object[] arr = enu.getEnumConstants(); + Object[] arr = RadioHatchCompat.enu.getEnumConstants(); for (Object o : arr){ if (RadioHatchCompat.rod != null && RadioHatchCompat.longRod != null) break; @@ -110,13 +110,13 @@ public class RadioHatchCompat implements Runnable { try { Class rodclass = Class.forName("gtPlusPlus.core.item.base.rods.BaseItemRod"); Class longrodclass = Class.forName("gtPlusPlus.core.item.base.rods.BaseItemRodLong"); - Constructor c1 = rodclass.getConstructor(RadioHatchCompat.materialClass); - Constructor c2 = longrodclass.getConstructor(RadioHatchCompat.materialClass); + Constructor c1 = rodclass.getConstructor(RadioHatchCompat.materialClass); + Constructor c2 = longrodclass.getConstructor(RadioHatchCompat.materialClass); Field cOwners = GameData.class.getDeclaredField("customOwners"); cOwners.setAccessible(true); Field map = RegistryNamespaced.class.getDeclaredField("field_148758_b"); map.setAccessible(true); - Map UniqueIdentifierMap = (Map) map.get(GameData.getItemRegistry()); + Map UniqueIdentifierMap = (Map) map.get(GameData.getItemRegistry()); Map ownerItems = (Map) cOwners.get(null); ModContainer gtpp = null; @@ -135,7 +135,7 @@ public class RadioHatchCompat implements Runnable { if (RadioHatchCompat.isRadioactive.getBoolean(mats)) { if (OreDictionary.getOres("stick" + RadioHatchCompat.unlocalizedName.get(mats)).isEmpty()) { - Item it = (Item) c1.newInstance(mats); + Item it = c1.newInstance(mats); UniqueIdentifierMap.replace(it,"miscutils:"+it.getUnlocalizedName()); GameRegistry.UniqueIdentifier ui = GameRegistry.findUniqueIdentifierFor(it); ownerItems.replace(ui,bartworks,gtpp); @@ -147,7 +147,7 @@ public class RadioHatchCompat implements Runnable { DebugLog.log("Generate: " + RadioHatchCompat.rod + RadioHatchCompat.unlocalizedName.get(mats)); } if (OreDictionary.getOres("stickLong" + RadioHatchCompat.unlocalizedName.get(mats)).isEmpty()) { - Item it2 = (Item) c2.newInstance(mats); + Item it2 = c2.newInstance(mats); UniqueIdentifierMap.replace(it2,"miscutils:"+it2.getUnlocalizedName()); GameRegistry.UniqueIdentifier ui2 = GameRegistry.findUniqueIdentifierFor(it2); ownerItems.replace(ui2,bartworks,gtpp); @@ -212,7 +212,7 @@ public class RadioHatchCompat implements Runnable { elements.add(RadioHatchCompat.stackMaterial.get(materialStack)); } while (!toCheck.isEmpty()){ - elements.addAll(getElemets(toCheck.poll())); + elements.addAll(GTPPRadAdapter.getElemets(toCheck.poll())); } return elements; } @@ -269,4 +269,4 @@ public class RadioHatchCompat implements Runnable { } } -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java index e3b8aaf3cf..d30d72bacd 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java @@ -35,7 +35,7 @@ public class SpaceTab extends CreativeTabs { } public static SpaceTab getInstance() { - return instance; + return SpaceTab.instance; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index 483b8f5cf7..08f496edda 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -53,15 +53,15 @@ import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.Ev public class ChunkProviderRoss128b extends ChunkProviderGenerate { XSTR rand = new XSTR(); private BiomeGenBase[] biomesForGeneration; - private BW_WordGenerator BWOreGen = new BW_WordGenerator(); - private World worldObj; - private MapGenBase caveGenerator = new MapGenCaves(); - private MapGenBase ravineGenerator = new MapGenRavine(); - private MapGenRuins.RuinsBase ruinsBase = new MapGenRuins.RuinsBase(); + private final BW_WordGenerator BWOreGen = new BW_WordGenerator(); + private final World worldObj; + private final MapGenBase caveGenerator = new MapGenCaves(); + private final MapGenBase ravineGenerator = new MapGenRavine(); + private final MapGenRuins.RuinsBase ruinsBase = new MapGenRuins.RuinsBase(); public ChunkProviderRoss128b(World par1World, long seed, boolean mapFeaturesEnabled) { super(par1World, seed, mapFeaturesEnabled); - worldObj = par1World; + this.worldObj = par1World; } @Override @@ -75,8 +75,8 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { byte[] abyte = new byte[65536]; this.func_147424_a(p_73154_1_, p_73154_2_, ablock); this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); - for (int i = 0; i < biomesForGeneration.length; i++) { - BiomeGenBase biomeGenBase = biomesForGeneration[i]; + for (int i = 0; i < this.biomesForGeneration.length; i++) { + BiomeGenBase biomeGenBase = this.biomesForGeneration[i]; if (biomeGenBase.biomeID == BiomeGenBase.mushroomIsland.biomeID) { this.biomesForGeneration[i] = BiomeGenBase.taiga; } else if (biomeGenBase.biomeID == BiomeGenBase.mushroomIslandShore.biomeID) { @@ -115,7 +115,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { this.rand.setSeed((long) p_73153_2_ * i1 + (long) p_73153_3_ * j1 ^ this.worldObj.getSeed()); } - MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, false)); + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); int x1; int y1; @@ -126,11 +126,11 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { x1 = k + this.rand.nextInt(16) + 3; y1 = this.rand.nextInt(256); z1 = l + this.rand.nextInt(16) + 3; - ruinsBase.generate(worldObj, rand, x1, y1, z1); + this.ruinsBase.generate(this.worldObj, this.rand, x1, y1, z1); } if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && this.rand.nextInt(4) == 0 - && TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, false, LAKE)) { + && TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, LAKE)) { x1 = k + this.rand.nextInt(16) + 8; y1 = this.rand.nextInt(256); z1 = l + this.rand.nextInt(16) + 8; @@ -142,7 +142,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { k += 8; l += 8; - boolean doGen = TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, false, ICE); + boolean doGen = TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, ICE); for (x1 = 0; doGen && x1 < 16; ++x1) { for (y1 = 0; y1 < 16; ++y1) { z1 = this.worldObj.getPrecipitationHeight(k + x1, l + y1); @@ -157,8 +157,8 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { } } - BWOreGen.generate(rand, p_73153_2_, p_73153_3_, worldObj, this, this); - MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, false)); + this.BWOreGen.generate(this.rand, p_73153_2_, p_73153_3_, this.worldObj, this, this); + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); BlockFalling.fallInstantly = false; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java index 01bb163283..aa0968a95b 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java @@ -37,10 +37,10 @@ import java.util.Arrays; public class ChunkProviderRoss128ba extends ChunkProviderMoon { - private XSTR rand = new XSTR(); - private World worldObj; + private final XSTR rand = new XSTR(); + private final World worldObj; private BiomeGenBase[] biomesForGeneration; - private MapGenBaseMeta caveGenerator; + private final MapGenBaseMeta caveGenerator; public ChunkProviderRoss128ba(World world, long seed, boolean mapFeaturesEnabled) { super(world, seed, mapFeaturesEnabled); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index 1634ca0f75..121a31bf2f 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -26,16 +26,13 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.WorldProviderRoss128b; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba.WorldProviderRoss128Ba; import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; import micdoodle8.mods.galacticraft.api.galaxies.*; import micdoodle8.mods.galacticraft.api.vector.Vector3; import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; import micdoodle8.mods.galacticraft.core.GalacticraftCore; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.DimensionManager; import java.util.Arrays; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java index 4974a5725d..b32385e29d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java @@ -28,7 +28,7 @@ import java.util.HashMap; public class GT_NBT_DataBase { - private static HashMap tagToIdMap = new HashMap<>(); + private static final HashMap tagToIdMap = new HashMap<>(); private static long maxID = Long.MIN_VALUE+1; @@ -43,7 +43,7 @@ public class GT_NBT_DataBase { this.mDataTitle = mDataTitle; this.tagCompound = tagCompound; this.id = GT_NBT_DataBase.maxID; - GT_NBT_DataBase.tagToIdMap.put(tagCompound,id); + GT_NBT_DataBase.tagToIdMap.put(tagCompound, this.id); ++GT_NBT_DataBase.maxID; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java index 635ceb9fee..9f7c593084 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java @@ -38,12 +38,12 @@ import java.util.HashMap; //@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers") public class TileEntity_GTDataServer extends TileEntity implements ITileWithGUI, ITileAddsInformation, ITileHasDifferentTextureSides/*, SimpleComponent*/ { - private static HashMap OrbDataBase = new HashMap<>(); + private static final HashMap OrbDataBase = new HashMap<>(); - private ItemStack[] mItems = new ItemStack[2]; + private final ItemStack[] mItems = new ItemStack[2]; - private byte TickTimer = 0; + private byte TickTimer; public String getComponentName() { return "GT-Data Server"; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java index 542501ccce..267945116f 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java @@ -22,15 +22,6 @@ package com.github.bartimaeusnek.crossmod.thaumcraft; -import com.github.bartimaeusnek.bartworks.MainMod; - -import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; -import net.minecraft.util.ResourceLocation; - -import java.lang.reflect.Array; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; - public class CustomAspects { // static Constructor aspectConstructor; // static Object TRADE; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java index 3daa758a88..7911b0c9af 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java @@ -28,7 +28,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicBatteryBuffer; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index 3d984ed063..ebede8bf4b 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -83,7 +83,7 @@ public class ThaumcraftHandler { ThaumcraftHandler.AspectAdder.mAspectClass = Class.forName("thaumcraft.api.aspects.Aspect"); ThaumcraftHandler.AspectAdder.addToList = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("add", ThaumcraftHandler.AspectAdder.mAspectClass,int.class); ThaumcraftHandler.AspectAdder.registerObjectTag = Class.forName("thaumcraft.api.ThaumcraftApi").getMethod("registerObjectTag",ItemStack.class, ThaumcraftHandler.AspectAdder.mAspectListClass); - ThaumcraftHandler.AspectAdder.getName = mAspectClass.getMethod("getName"); + ThaumcraftHandler.AspectAdder.getName = AspectAdder.mAspectClass.getMethod("getName"); } catch (ClassNotFoundException | NoSuchMethodException e) { e.printStackTrace(); } @@ -96,7 +96,7 @@ public class ThaumcraftHandler { Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); for (Pair a : aspectPair) { if (ConfigHandler.debugLog) - DebugLog.log("Stack:"+ stack.getDisplayName() + " Damage:" +stack.getItemDamage() + " aspectPair: " + getName.invoke(a.getKey()) + " / " + a.getValue()); + DebugLog.log("Stack:"+ stack.getDisplayName() + " Damage:" +stack.getItemDamage() + " aspectPair: " + AspectAdder.getName.invoke(a.getKey()) + " / " + a.getValue()); ThaumcraftHandler.AspectAdder.addToList.invoke(aspectList, a.getKey(), a.getValue()); } ThaumcraftHandler.AspectAdder.registerObjectTag.invoke(null, stack, aspectList); -- cgit From dbaf46ae9d07a7bf543fce5a7b7465cf307a5b27 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 18 Jul 2019 10:40:58 +0200 Subject: version increase +readded missing imports Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 7908a75ed61f98e41cf66124699c3d4860537900 --- build.properties | 2 +- .../common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java | 1 + .../tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build.properties b/build.properties index a5e94c153f..d7dc4ed33e 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=19_pre1 +buildNumber=19_pre2 APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index e19d43a10b..a9fab1b94b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -31,6 +31,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 3c53ae1b49..fd5fec2e16 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -29,6 +29,7 @@ import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_VacuumFreezer; -- cgit From 4371ae568f86f4cae59bfb488d04051ce49db6e3 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 18 Jul 2019 11:49:09 +0200 Subject: finally fixed the stupid modifier Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 9b1e63e27c1beb65b909b5434e50db0903e5e84f --- .../bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index db58b69cc4..1d4f0fe71f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -149,7 +149,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } private int calcMod(double x) { - int ret = (int) Math.ceil(100D*(-(2*(this.getOutputCapacity()-x))*(2*(this.getOutputCapacity()-x))+1D)); + int ret = (int) Math.ceil(100D*(-(((2*x/this.getOutputCapacity())-1)*(2*x/this.getOutputCapacity()-1D))+1D)); return ret <= 0 ? 1 : ret > 100 ? 100 : ret;//(int) Math.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); } -- cgit From 92d2a532246fb17383d895d8bd12600af45879d2 Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Fri, 19 Jul 2019 16:56:40 +0800 Subject: update the chinese translation and fix bugs Former-commit-id: 99965b4fb0f9efada6de2b9c58af5a22fdbd6b77 --- src/main/resources/assets/bartworks/lang/zh_CN.lang | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index 29b66c2ebd..54982222b9 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -103,7 +103,7 @@ tooltip.tile.waterpump.2.name=必须放在地上. tooltip.tile.mbf.0.name=巨型工业高炉的控制器方块;大小(宽x高x长):15x20x15(中空);控制器方块在第三层正面中央;内层13x18x13加热线圈(中空);外层15x18x15硼硅酸盐玻璃方块;玻璃等级限制了能源仓等级;1+输入仓/总线(任意机械方块);1+输出总线(任意机械方块);1+能源仓(任意机械方块);1x维护仓(任意机械方块)(注:所有底层仓室必须置于边缘);13x1x13消声仓(顶层中央);外部15x15的防热机械方块(第20层);1+输出仓以回收CO2/CO/SO2(可选,任意顶层机械方块);回收比例取决于消声仓等级;底层为隔热机械方块;自物品配方的最小炉温起,每高出900K会减少5%的能耗,使用乘法叠加;自物品配方的最小所需炉温起,每高出1800K将允许一次无损的超频;无损超频将减少加工时间至25%并提升功率至400%;每秒造成最大 tooltip.tile.mbf.1.name=污染每秒 tooltip.tile.mvf.0.name=巨型真空冷冻机的控制器方块;将炽热的锭与单元强力冷却;大小(宽x高x长):15x15x15(中空);控制器方块(正面正中);1x输入总线(任意机械方块);1x输出总线(任意机械方块);1x维护仓(任意机械方块);1x能源仓(任意机械方块);剩余方块为防冻机械方块 -tooltip.tile.bvat.0.name=生物培养缸的控制器方块;大小(宽x高x长);5x4x5;底层和顶层为洁净不锈钢机械方块;底层和顶层必须包含:;1个维护仓,1个输出仓;1+输入仓,1个以上的输入总线,0-1个放射输入仓;中间两层必须由玻璃构成,中空;玻璃可以为任何玻璃,例如匠魂的通透玻璃;一些配方需要更高级的玻璃为了最大限度地提高效率,请保持输出仓始终为半满! +tooltip.tile.bvat.0.name=生物培养缸的控制器方块;大小(宽x高x长);5x4x5;底层和顶层为洁净不锈钢机械方块;底层或顶层必须含有:;1个维护仓,1个输出仓;1+输入仓,1个以上的输入总线,0-1个放射仓;中间两层必须由玻璃构成,中空;玻璃可以为任何玻璃,例如匠魂的通透玻璃;一些配方需要更高级的玻璃为了最大限度地提高效率,请保持输出仓始终为半满! tooltip.tile.windmill.0.name=由动能驱动的原始磨床;大小(宽x高x长):7x12x7;第1层:7x7砖块,角落空置,控制器方块在正面中央;第2-5层:5x5硬化粘土,角落空置,可包含一扇门,;中空,墙必须至少包含一个发射器;第6层:5x5木板.角落填充,中空.;第7层:7x7木板.角落空置,中空.;第8层:7x7木板.角落空置,中空,;正面中央必须是原始动力轴箱;第9层:7x7木板.角落空置,中空.;第10层:5x5木板.角落填充,中空.;第11层:3x3木板.角落填充,中空.;第12层:1x1木板;需要在轴箱中放入风车转子才可运行;在控制器中输入物品;输出物品将出现在发射器中;在风大的地区运行较快(像IC2风机一样) tooltip.tile.lesu.0.name=用于GT2风格的L.E.S.U.的控制器方块;尺寸:任意 tooltip.tile.lesu.1.name=每个LESU机械方块存储: @@ -159,5 +159,5 @@ tooltip.tile.eic.0.name=电气聚爆压缩机的控制器方块;大小(宽x高x planet.Ross128b=罗斯128b moon.Ross128ba=罗斯128ba star.Ross128=罗斯128 -solarsystem.Ross128System=罗斯128-行星系 -//This zh_CN.lang is translated by huajijam for bartworks (24/4/19) \ No newline at end of file +solarsystem.Ross128System=罗斯128星系 +//This zh_CN.lang is translated by huajijam for bartworks (19/7/19) \ No newline at end of file -- cgit From 49eb3ab050b92c84267f64cbf8f46a9251be960c Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 19 Jul 2019 22:36:32 +0200 Subject: added config changing command +made the bio vat bonus config dependant +version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 40c59e4af03241615320fa70be0a6ac3ce08de95 --- build.properties | 2 +- .../bartworks/common/commands/ChangeConfig.java | 82 ++++++++++++++++++++++ .../bartworks/common/configs/ConfigHandler.java | 2 + .../tileentities/multis/GT_TileEntity_BioVat.java | 3 +- .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 2 + 5 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java diff --git a/build.properties b/build.properties index d7dc4ed33e..9f14eb0535 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=4 -buildNumber=19_pre2 +buildNumber=19_pre3 APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java new file mode 100644 index 0000000000..ec85e7e1d4 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.commands; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.ChatComponentText; + +import java.lang.reflect.Field; + +public class ChangeConfig extends CommandBase { + @Override + public String getCommandName() { + return "bwcfg"; + } + + @Override + public String getCommandUsage(ICommandSender p_71518_1_) { + return "bwcfg "; + } + + @Override + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + try{ + Field f = ConfigHandler.class.getField(p_71515_2_[0]); + Class c = f.getType(); + if (c.equals(int.class)) { + int l; + try { + l = Integer.parseInt(p_71515_2_[1]); + } catch (NumberFormatException e) { + p_71515_1_.addChatMessage(new ChatComponentText("you need to enter a number!")); + return; + } + f.setInt(null, Integer.parseInt(p_71515_2_[1])); + } + else if (c.equals(long.class)) { + long l; + try{ + l = Long.parseLong(p_71515_2_[1]); + }catch (NumberFormatException e){ + p_71515_1_.addChatMessage(new ChatComponentText("you need to enter a number!")); + return; + } + f.setLong(null, l); + } + else if (c.equals(boolean.class)){ + if (p_71515_2_[1].equalsIgnoreCase("true") || p_71515_2_[1].equalsIgnoreCase("1") ) + f.setBoolean(null,true); + else if (p_71515_2_[1].equalsIgnoreCase("false") || p_71515_2_[1].equalsIgnoreCase("0") ) + f.setBoolean(null,false); + else { + p_71515_1_.addChatMessage(new ChatComponentText("booleans need to be set to true or false")); + return; + } + } + }catch (Exception e){ + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 95cde7ddcc..d0e57cae15 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -43,6 +43,7 @@ public class ConfigHandler { public static int landerType = 3; public static int ross128bRuinChance = 512; public static int creativeScannerID; + public static int bioVatMaxParallelBonus = 1000; public static long energyPerCell = 1000000L; @@ -75,6 +76,7 @@ public class ConfigHandler { ConfigHandler.DEHPDirectSteam = ConfigHandler.c.get("Multiblocks", "DEHP Direct Steam Mode", false, "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant").getBoolean(false); ConfigHandler.megaMachinesMax = ConfigHandler.c.get("Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256); ConfigHandler.mbWaterperSec = ConfigHandler.c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150).getInt(150); + ConfigHandler.bioVatMaxParallelBonus = ConfigHandler.c.get("Multiblocks","BioVat Maximum Bonus on Recipes", 1000,"This are the maximum parallel Operations the BioVat can do, when the output is half full.").getInt(1000); if (ConfigHandler.IDOffset == 0) { ConfigHandler.IDOffset = 12600; ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 1d4f0fe71f..1a8b555478 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.items.LabParts; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; @@ -149,7 +150,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } private int calcMod(double x) { - int ret = (int) Math.ceil(100D*(-(((2*x/this.getOutputCapacity())-1)*(2*x/this.getOutputCapacity()-1D))+1D)); + int ret = (int) Math.ceil(ConfigHandler.bioVatMaxParallelBonus*(-(((2D*x/(double)this.getOutputCapacity())-1D)*(2D*x/(double)this.getOutputCapacity()-1D))+1D)); return ret <= 0 ? 1 : ret > 100 ? 100 : ret;//(int) Math.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 4ae8b0a85e..d0a13b9af0 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.crossmod; +import com.github.bartimaeusnek.bartworks.common.commands.ChangeConfig; import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; @@ -90,6 +91,7 @@ public class BartWorksCrossmod { @Mod.EventHandler public void onFMLServerStart(FMLServerStartingEvent event) { event.registerServerCommand(new SummonRuin()); + event.registerServerCommand(new ChangeConfig()); if (Loader.isModLoaded("miscutils")) for (Object s : RadioHatchCompat.TranslateSet){ StringTranslate.inject(new ReaderInputStream(new StringReader((String) s))); -- cgit From 1bf9655308ffca6ad00edcce03e37cc47dc31d69 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 30 Jul 2019 02:34:08 +0200 Subject: 0.5pre Circuits Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: aeccff4e60af64a4f1a140019ca3989bd3de87c6 --- .../github/bartimaeusnek/bartworks/MainMod.java | 4 + .../bartworks/common/items/SimpleIconItem.java | 1 + .../common/loaders/CircuitImprintLoader.java | 43 ------- .../CircuitGeneration/BW_CircuitsLoader.java | 48 +++++++ .../material/CircuitGeneration/BW_Meta_Items.java | 109 ++++++++++++++++ .../material/CircuitGeneration/CircuitData.java | 79 ++++++++++++ .../CircuitGeneration/CircuitImprintLoader.java | 118 +++++++++++++++++ .../CircuitGeneration/CircuitPartLoader.java | 30 +++++ .../bartworks/system/material/Werkstoff.java | 24 +++- .../bartworks/system/material/WerkstoffLoader.java | 51 +++++++- .../processingLoaders/AdditionalRecipes.java | 12 +- .../bartimaeusnek/bartworks/util/BWRecipes.java | 142 +++++++++++---------- .../bartimaeusnek/bartworks/util/BW_Util.java | 18 +++ 13 files changed, 557 insertions(+), 122 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 297abb2ca2..aa5d3f63f4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -34,6 +34,8 @@ import com.github.bartimaeusnek.bartworks.common.loaders.*; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; import com.github.bartimaeusnek.bartworks.server.EventHandler.ServerEventHandler; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; +import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; +import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader; import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -48,6 +50,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartedEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; +import gregtech.api.GregTech_API; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.SubTag; @@ -120,6 +123,7 @@ public final class MainMod { if (ConfigHandler.newStuff) { WerkstoffLoader.INSTANCE.init(); Werkstoff.init(); + GregTech_API.sAfterGTPostload.add(new CircuitPartLoader()); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java index 1ca3c8fe2f..ab19b5d967 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java @@ -38,5 +38,6 @@ public class SimpleIconItem extends Item { @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon("bartworks:" + this.tex); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java deleted file mode 100644 index 1027e8b344..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.loaders; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.oredict.OreDictionary; - -import java.util.HashSet; - -public class CircuitImprintLoader implements Runnable { - - private static final HashSet circuitTypes = new HashSet<>(); - - @Override - public void run() { - for(String names : OreDictionary.getOreNames()){ - if (names.contains("circuit") || names.contains("Circuit")) - for (ItemStack itemStack : OreDictionary.getOres(names)) - CircuitImprintLoader.circuitTypes.add(itemStack.copy().splitStack(1).writeToNBT(new NBTTagCompound())); - } - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java new file mode 100644 index 0000000000..5bd182c6c0 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; + +import gregtech.api.GregTech_API; + +public class BW_CircuitsLoader { + private static final BW_Meta_Items NEW_CIRCUITS; + + public static BW_Meta_Items getNewCircuits() { + return BW_CircuitsLoader.NEW_CIRCUITS; + } + + static { + NEW_CIRCUITS = new BW_Meta_Items(); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(0,1, "Primitive Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(1,2, "Basic Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(2,3, "Good Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(3,4, "Advanced Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(4,5, "Data Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(5,6, "Elite Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(6,7, "Master Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(7,8, "Ultimate Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(8,9, "Superconductor Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(9,10, "Infinite Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(10,11, "Bio Magneto Resonatic Circuit"); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java new file mode 100644 index 0000000000..c8e1ba1335 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.Pair; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; +import gregtech.api.items.GT_MetaGenerated_Item; +import gregtech.api.util.GT_OreDictUnificator; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + + +public class BW_Meta_Items { + + public static BW_Meta_Items.BW_GT_MetaGenCircuits getNEWCIRCUITS() { + return BW_Meta_Items.NEWCIRCUITS; + } + + private static final BW_Meta_Items.BW_GT_MetaGenCircuits NEWCIRCUITS = new BW_Meta_Items.BW_GT_MetaGenCircuits(); + + + public void addNewCircuit(int aTier, int aID, String aName){ + + String additionalOreDictData = ""; + String tooltip = ""; + String aOreDictPrefix = OrePrefixes.circuit.toString(); + switch (aTier){ + case 0: additionalOreDictData = Materials.Primitive.toString(); tooltip = Materials.Primitive.getToolTip(); break; + case 1: additionalOreDictData = Materials.Basic.toString(); tooltip = Materials.Basic.getToolTip(); break; + case 2: additionalOreDictData = Materials.Good.toString(); tooltip = Materials.Good.getToolTip(); break; + case 3: additionalOreDictData = Materials.Advanced.toString(); tooltip = Materials.Advanced.getToolTip(); break; + case 4: additionalOreDictData = Materials.Data.toString(); tooltip = Materials.Data.getToolTip(); break; + case 5: additionalOreDictData = Materials.Elite.toString(); tooltip = Materials.Elite.getToolTip(); break; + case 6: additionalOreDictData = Materials.Master.toString(); tooltip = Materials.Master.getToolTip(); break; + case 7: additionalOreDictData = Materials.Ultimate.toString(); tooltip = Materials.Ultimate.getToolTip(); break; + case 8: additionalOreDictData = Materials.Superconductor.toString(); tooltip = Materials.Superconductor.getToolTip(); break; + case 9: additionalOreDictData = "Infinite"; tooltip = "An Infinite Circuit"; break; + case 10: additionalOreDictData = "Bio"; tooltip = "A Bio Circuit"; break; + } + + ItemStack tStack = BW_Meta_Items.NEWCIRCUITS.addCircuit(aID,aName,tooltip,aTier); + + if (ConfigHandler.experimentalThreadedLoader) + OreDictAdder.addToMap(new Pair<>((aOreDictPrefix + additionalOreDictData).replaceAll(" ",""), tStack)); + else + GT_OreDictUnificator.registerOre((aOreDictPrefix + additionalOreDictData).replaceAll(" ",""), tStack); + } + + public static class BW_GT_MetaGenCircuits extends BW_Meta_Items.BW_GT_MetaGen_Item_Hook{ + + + public BW_GT_MetaGenCircuits() { + super("bwMetaGeneratedItem0", (short) 0, (short) 32766); + } + + public final ItemStack addCircuit(int aID, String aEnglish, String aToolTip, int tier){ + CircuitImprintLoader.bwCircuitTagMap.put(new CircuitData(BW_Util.getMachineVoltageFromTier(tier-2),0,(byte)tier), CircuitImprintLoader.getTagFromStack(new ItemStack(BW_Meta_Items.NEWCIRCUITS,1,aID))); + return this.addItem(aID, aEnglish, aToolTip,SubTag.NO_UNIFICATION); + } + + public final void modifyIIconIndex(int aID, IIcon icon){ + this.mIconList[aID][0] = icon; + } + + public final ItemStack getStack(int... meta_amount){ + ItemStack ret = new ItemStack(this); + if (meta_amount.length <= 0 || meta_amount.length > 2) + return ret; + if (meta_amount.length == 1) { + ret.setItemDamage(meta_amount[0]); + return ret; + } + ret.setItemDamage(meta_amount[0]); + ret.stackSize=meta_amount[1]; + return ret; + } + } + + private static class BW_GT_MetaGen_Item_Hook extends GT_MetaGenerated_Item{ + private BW_GT_MetaGen_Item_Hook(String aUnlocalized, short aOffset, short aItemAmount) { + super(aUnlocalized, aOffset, aItemAmount); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java new file mode 100644 index 0000000000..2dfb4ad7c0 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; + +import com.github.bartimaeusnek.bartworks.util.MurmurHash3; + +import java.nio.ByteBuffer; + +public class CircuitData { + + private long aVoltage; + private int aSpecial; + private byte aTier; + + public CircuitData(long aVoltage, int aSpecial, byte aTier) { + this.aVoltage = aVoltage; + this.aSpecial = aSpecial; + this.aTier = aTier; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof CircuitData)) return false; + CircuitData that = (CircuitData) o; + if (this.getaVoltage() != that.getaVoltage()) return false; + if (this.getaSpecial() != that.getaSpecial()) return false; + return this.getaTier() == that.getaTier(); + } + + @Override + public int hashCode() { + return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(13).put(this.aTier).putInt(this.aSpecial).putLong(this.aVoltage).array(),0,13,31); + } + + public long getaVoltage() { + return this.aVoltage; + } + + public void setaVoltage(long aVoltage) { + this.aVoltage = aVoltage; + } + + public int getaSpecial() { + return this.aSpecial; + } + + public void setaSpecial(int aSpecial) { + this.aSpecial = aSpecial; + } + + public byte getaTier() { + return this.aTier; + } + + public void setaTier(byte aTier) { + this.aTier = aTier; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java new file mode 100644 index 0000000000..d3af29e6b7 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; + +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.Pair; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.HashBiMap; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.items.GT_MetaGenerated_Item; +import gregtech.api.items.GT_MetaGenerated_Item_X32; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.*; + +public class CircuitImprintLoader implements Runnable { + + static final ArrayListMultimap recipeTagMap = ArrayListMultimap.create(); + static final HashBiMap bwCircuitTagMap = HashBiMap.create(20); + static final HashSet refs = new HashSet<>(); + private static short reverseIDs = 32766; + + public static NBTTagCompound getTagFromStack(ItemStack stack){ + if (GT_Utility.isStackValid(stack)) + return stack.copy().splitStack(1).writeToNBT(new NBTTagCompound()); + return new NBTTagCompound(); + } + + public static ItemStack getStackFromTag(NBTTagCompound tagCompound){ + return ItemStack.loadItemStackFromNBT(tagCompound); + } + + public static void makeCircuitParts() { + ItemList[] itemLists = ItemList.values(); + for (ItemList single : itemLists) { + if (!single.hasBeenSet()) + continue; + ItemStack itemStack = single.get(1); + if (!GT_Utility.isStackValid(itemStack)) + continue; + int[] oreIDS = OreDictionary.getOreIDs(itemStack); + if (oreIDS.length > 1) + continue; + String name = null; + if (oreIDS.length == 1) + name = OreDictionary.getOreName(oreIDS[0]); + if ((name == null || name.isEmpty()) && (single.toString().contains("Circuit") || single.toString().contains("circuit")) && single.getBlock() == Blocks.air) { + ArrayList toolTip = new ArrayList<>(); + single.getItem().addInformation(single.get(1).copy(), null, toolTip, true); + String localised = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); + BW_Meta_Items.getNEWCIRCUITS().addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised, toolTip.size() > 0 ? toolTip.get(0) : ""); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{single.get(16).copy()},Materials.Plastic.getMolten(576),BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs),600,30); + CircuitImprintLoader.reverseIDs--; + } + } + } + + @Override + public void run() { + Iterator it = GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.iterator(); + GT_Recipe circuitRecipe; + HashSet torem = new HashSet<>(); + while (it.hasNext()) { + circuitRecipe = it.next(); + ItemStack[] outputs = circuitRecipe.mOutputs; + if (outputs.length < 1) + continue; + int[] oreIDS = OreDictionary.getOreIDs(outputs[0]); + if (oreIDS.length < 1) + continue; + String name = OreDictionary.getOreName(oreIDS[0]); + if (name.contains("Circuit") || name.contains("circuit")) { + CircuitImprintLoader.recipeTagMap.put(CircuitImprintLoader.getTagFromStack(outputs[0]),circuitRecipe.copy()); + for (ItemStack s : circuitRecipe.mInputs){ + if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))) + CircuitImprintLoader.refs.add(CircuitImprintLoader.getTagFromStack(s.copy().splitStack(1))); + } +// if (circuitRecipe.mEUt > BW_Util.getTierVoltage(5)) + if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))) { + torem.add(circuitRecipe); + BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(circuitRecipe); + } + } + } + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(torem); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java new file mode 100644 index 0000000000..24f581d208 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; + +public class CircuitPartLoader implements Runnable { + @Override + public void run() { + CircuitImprintLoader.makeCircuitParts(); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index ccc1335e6c..24af0547a7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -108,11 +108,27 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.toolTip = ""; if (toolTip.isEmpty()) { for (Pair p : contents) { - if (p.getKey() instanceof Materials) { - this.toolTip += ((Materials) p.getKey()).mChemicalFormula + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + if (contents.length > 1) { + if (p.getKey() instanceof Materials) { + if (((Materials) p.getKey()).mMaterialList.size() > 1 && p.getValue() > 1) +// if (((Materials) p.getKey()).mChemicalFormula != null && Character.isDigit(((Materials) p.getKey()).mChemicalFormula.toCharArray()[((Materials) p.getKey()).mChemicalFormula.length()-1])) + this.toolTip += "(" + ((Materials) p.getKey()).mChemicalFormula + ")" + (BW_Util.subscriptNumber(p.getValue())); + else + this.toolTip += ((Materials) p.getKey()).mChemicalFormula + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + } + if (p.getKey() instanceof Werkstoff) { + if (((Werkstoff) p.getKey()).contents.size() > 1 && p.getValue() > 1) +// if (((Werkstoff) p.getKey()).toolTip != null && Character.isDigit(((Werkstoff) p.getKey()).toolTip.toCharArray()[((Werkstoff) p.getKey()).toolTip.length()-1])) + this.toolTip += "(" + ((Werkstoff) p.getKey()).toolTip + ")" + (BW_Util.subscriptNumber(p.getValue())); + else + this.toolTip += ((Werkstoff) p.getKey()).toolTip + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + } + } else { + if (p.getKey() instanceof Materials) { + this.toolTip += ((Materials) p.getKey()).mChemicalFormula + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + } else if (p.getKey() instanceof Werkstoff) + this.toolTip += ((Werkstoff) p.getKey()).toolTip + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } - if (p.getKey() instanceof Werkstoff) - this.toolTip += ((Werkstoff) p.getKey()).toolTip + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } } else this.toolTip = toolTip; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 99dce114b2..8c9164538a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes; +import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_CircuitsLoader; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; @@ -103,10 +104,10 @@ public class WerkstoffLoader implements Runnable { Werkstoff.Types.ELEMENT, new Werkstoff.GenerationFeatures().onlyDust(), 3, - TextureSet.SET_METALLIC, - Arrays.asList() + TextureSet.SET_METALLIC + //No Byproducts ); - public static final Werkstoff Zirconia = new Werkstoff( + public static final Werkstoff CubicZirconia = new Werkstoff( new short[]{255, 255, 255, 0}, "Cubic Zirconia", Werkstoff.Types.COMPOUND, @@ -462,6 +463,7 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().onlyDust(), 30, TextureSet.SET_METALLIC + //No Byproducts ); public static final Werkstoff BismuthTellurite = new Werkstoff( new short[]{32,72,32,0}, @@ -471,6 +473,7 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), 31, TextureSet.SET_METALLIC, + //No Byproducts new Pair<>(Materials.Bismuth, 2), new Pair<>(Materials.Tellurium, 3) ); @@ -479,9 +482,10 @@ public class WerkstoffLoader implements Runnable { "Tellurium", new Werkstoff.Stats(), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().disable().addMetalItems(), + new Werkstoff.GenerationFeatures().addMetalItems().removeOres(), 32, TextureSet.SET_METALLIC, + //No Byproducts new Pair<>(Materials.Tellurium, 1) ); public static final Werkstoff BismuthHydroBorat = new Werkstoff( @@ -492,23 +496,54 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), 33, TextureSet.SET_METALLIC, + //No Byproducts new Pair<>(Materials.Bismuth, 2), new Pair<>(Materials.Boron, 1), new Pair<>(Materials.Hydrogen, 1) ); public static final Werkstoff ArInGaPhoBiBoTe = new Werkstoff( new short[]{36,36,36,0}, - "Circuit Compound MK1", + "Circuit Compound MK3", new Werkstoff.Stats().setCentrifuge(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust().addMixerRecipes(), 34, TextureSet.SET_METALLIC, + //No Byproducts new Pair<>(Materials.IndiumGalliumPhosphide, 1), new Pair<>(WerkstoffLoader.BismuthHydroBorat, 3), new Pair<>(WerkstoffLoader.BismuthTellurite, 2) ); + public static final Werkstoff Prasiolite = new Werkstoff( + new short[]{0xD0,0xDD,0x95,0}, + "Prasiolite", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 35, + TextureSet.SET_QUARTZ, + //No Byproducts + new Pair<>(Materials.Silicon,5), + new Pair<>(Materials.Oxygen,10), + new Pair<>(Materials.Iron,1) + ); + + public static final Werkstoff MagnetoResonaticDust = new Werkstoff( + new short[]{0xDD,0x77,0xDD,0}, + "Magneto Resonatic Dust", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().onlyDust().addMixerRecipes(), + 36, + TextureSet.SET_MAGNETIC, + //No Byproducts + new Pair<>(WerkstoffLoader.Prasiolite,3), + new Pair<>(WerkstoffLoader.BismuthTellurite,4), + new Pair<>(WerkstoffLoader.CubicZirconia,1), + new Pair<>(Materials.SteelMagnetic,1) + ); + public static HashMap items = new HashMap<>(); public static Block BWOres; public boolean registered; @@ -571,6 +606,8 @@ public class WerkstoffLoader implements Runnable { DebugLog.log("Loading Aspects"+" " +(System.nanoTime()-timepreone)); ThaumcraftHandler.AspectAdder.addAspectToAll(werkstoff); } + DebugLog.log("Loading New Circuits"+" " +(System.nanoTime()-timepreone)); + new BW_CircuitsLoader(); DebugLog.log("Done"+" " +(System.nanoTime()-timepreone)); progressBar.step(werkstoff.getDefaultName()); } @@ -690,7 +727,7 @@ public class WerkstoffLoader implements Runnable { OreDictAdder.addToMap(new Pair<>("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens))); } - OreDictAdder.addToMap(new Pair<>("craftingIndustrialDiamond", WerkstoffLoader.Zirconia.get(gemExquisite))); + OreDictAdder.addToMap(new Pair<>("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite))); } else { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { if (werkstoff.getGenerationFeatures().hasOres()) @@ -699,7 +736,7 @@ public class WerkstoffLoader implements Runnable { OreDictionary.registerOre("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens)); } - GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.Zirconia.get(gemExquisite)); + GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 0c8327ad69..155283bfb0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -40,9 +41,6 @@ public class AdditionalRecipes implements Runnable { @Override public void run() { - //Cubic Circonia - GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(11),Materials.Oxygen.getGas(3000),null, WerkstoffLoader.YttriumOxide.get(dust,5),64, BW_Util.getMachineVoltageFromTier(4)); - GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust,10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.Zirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953); //Thorium/Yttrium Glas GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall,2),WerkstoffLoader.Thorianit.get(dustSmall,2),Materials.Glass.getMolten(144),null,new ItemStack(ItemRegistry.bw_glasses[0],1,12),null,800,BW_Util.getMachineVoltageFromTier(5),3663); //Thorianit recipes @@ -61,6 +59,14 @@ public class AdditionalRecipes implements Runnable { GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust),Materials.Aluminium.getDust(1),Materials.Thorium.getDust(1),1000); GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust),Materials.Magnesium.getDust(1),Materials.Thorium.getDust(1),1000); GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(crushed), ItemList.Crop_Drop_Thorium.get(9),Materials.Water.getFluid(1000),Materials.Thorium.getMolten(144),WerkstoffLoader.Thorianit.get(crushedPurified,4),96,24); + + //TODO: Gem & Circuit Stuff + //Prasiolite + GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(dust,Materials.Quartzite,40L),Materials.Amethyst.getDust(10),GT_Values.NF,GT_Values.NF,WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed,20),GT_Values.NI,800, BW_Util.getMachineVoltageFromTier(2),500); + GT_Values.RA.addPrimitiveBlastRecipe(GT_OreDictUnificator.get(dust,Materials.Quartzite,40L),Materials.Amethyst.getDust(10),6,WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed,20),GT_Values.NI,800); + //Cubic Circonia + GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(11),Materials.Oxygen.getGas(3000),null, WerkstoffLoader.YttriumOxide.get(dust,5),64, BW_Util.getMachineVoltageFromTier(4)); + GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust,10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.CubicZirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953); //Tellurium GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed,Materials.Lead,10L),GT_Utility.getIntegratedCircuit(17),GT_Values.NF,GT_Values.NF,Materials.Lead.getIngots(10),Materials.Tellurium.getNuggets(20),800,BW_Util.getMachineVoltageFromTier(2),722); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index c380f3399b..e6c83a7f76 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -60,6 +60,8 @@ public class BWRecipes { public static final byte BIOLABBYTE = 0; public static final byte BACTERIALVATBYTE = 1; public static final byte ACIDGENMAPBYTE = 2; + public static final byte CIRCUITASSEMBLYLINE = 3; + private final GT_Recipe.GT_Recipe_Map sBiolab = new GT_Recipe.GT_Recipe_Map( new HashSet(150), "bw.recipe.biolab", @@ -87,6 +89,15 @@ public class BWRecipes { 1, 1, 1, 1, 1, "EU generated: ", 1000, "", false, true ); + private final BWRecipes.SpecialObjectSensitiveMap sCircuitAssemblyLineMap = new SpecialObjectSensitiveMap( + new HashSet(60), + "bw.recipe.cal", + "Circuit Assembly Line", + null, + "gregtech:textures/gui/basicmachines/Default", + 6, 6, 1, 1, 1, + "", 1, "", true, true //special handler + ); public BWRecipes() { @@ -261,7 +272,7 @@ public class BWRecipes { ); //aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue sBiolab.addRecipe( - new BioLabRecipe( + new DynamicGTRecipe( false, new ItemStack[]{ BioItemList.getPetriDish(null), @@ -304,8 +315,7 @@ public class BWRecipes { /** - * @param machine 0 = biolab; 1 = BacterialVat; 2 = sAcidGenFuels - * @return + * @param machine 0 = biolab; 1 = BacterialVat; 2 = sAcidGenFuels; 3 = circuitAssemblyLine */ public GT_Recipe.GT_Recipe_Map getMappingsFor(byte machine) { switch (machine) { @@ -315,6 +325,8 @@ public class BWRecipes { return sBacteriaVat; case 2: return sAcidGenFuels; + case 3: + return sCircuitAssemblyLineMap; default: return null; } @@ -322,54 +334,54 @@ public class BWRecipes { } public boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new BioLabRecipe(true, aInputs, new ItemStack[]{aOutput}, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) + if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) return true; return false; } public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new BioLabRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, aFluidInputs, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null) + if (sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, aFluidInputs, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null) return true; return false; } public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new BioLabRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, new FluidStack[]{aFluidInputs}, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null) + if (sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, new FluidStack[]{aFluidInputs}, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null) return true; return false; } @Deprecated public boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new BioLabRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[0], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) + if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[0], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) return true; return false; } @Deprecated public boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new BioLabRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[1], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) + if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[1], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) return true; return false; } @Deprecated public boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new BioLabRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[2], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) + if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[2], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) return true; return false; } @Deprecated public boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new BioLabRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[3], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) + if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[3], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) return true; return false; } @Deprecated public boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new BioLabRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[4], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) + if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[4], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) return true; return false; } @@ -515,14 +527,65 @@ public class BWRecipes { } } - public static class BacteriaVatRecipeMap extends GT_Recipe.GT_Recipe_Map { + public static class BacteriaVatRecipeMap extends BWRecipes.SpecialObjectSensitiveMap { public BacteriaVatRecipeMap(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); } + protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) { + aRecipe.mHidden = aHidden; + aRecipe.mFakeRecipe = aFakeRecipe; + GT_Recipe isthere = this.findRecipe((IHasWorldObjectAndCoords) null, false, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs); + + if (aRecipe.mFluidInputs.length < this.mMinimalInputFluids && aRecipe.mInputs.length < this.mMinimalInputItems) { + return null; + } else { + return aCheckForCollisions && isthere != null && BW_Util.areStacksEqualOrNull((ItemStack) isthere.mSpecialItems, (ItemStack) aRecipe.mSpecialItems) ? null : this.add(aRecipe); + } + } + + public GT_Recipe addRecipe(GT_Recipe aRecipe, boolean VanillaGT) { + if (VanillaGT) + return addRecipe(aRecipe, true, false, false); + else + return addRecipe(aRecipe); + } + + public GT_Recipe addRecipe(GT_Recipe aRecipe) { + if (aRecipe.mInputs.length > 0 && GT_Utility.areStacksEqual(aRecipe.mInputs[aRecipe.mInputs.length - 1], GT_Utility.getIntegratedCircuit(32767))) + return aRecipe; + else { + ItemStack[] nu1 = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1); + nu1[nu1.length - 1] = GT_Utility.getIntegratedCircuit(9 + nu1.length); + aRecipe.mInputs = nu1; + } + if (this.findRecipe((IHasWorldObjectAndCoords) null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null) { + ItemStack[] nu = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1); + int i = 9 + nu.length; + do { + nu[nu.length - 1] = GT_Utility.getIntegratedCircuit(i); + i++; + aRecipe.mInputs = nu; + if (i > 24) + i = 1; + if (i == 9 + nu.length) + return null; + } + while (this.findRecipe((IHasWorldObjectAndCoords) null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null); + } + return this.addRecipe(aRecipe, false, false, false); + } + } + + private static class SpecialObjectSensitiveMap extends GT_Recipe.GT_Recipe_Map{ + + private SpecialObjectSensitiveMap(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + /** - * finds a Recipe matching the aFluid and ItemStack Inputs. + * finds a Recipe matching the aFluid, aSpecial and ItemStack Inputs. * * @param aTileEntity an Object representing the current coordinates of the executing Block/Entity/Whatever. This may be null, especially during Startup. * @param aRecipe in case this is != null it will try to use this Recipe first when looking things up. @@ -530,7 +593,7 @@ public class BWRecipes { * @param aDontCheckStackSizes if set to false will only return recipes that can be executed at least once with the provided input * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage * @param aFluids the Fluid Inputs - * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with this, but some custom ones do. + * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with this, but some custom ones do. Like this one. * @param aInputs the Item Inputs * @return the Recipe it has found or null for no matching Recipe */ @@ -592,56 +655,5 @@ public class BWRecipes { // And nothing has been found. return null; } - - protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) { - aRecipe.mHidden = aHidden; - aRecipe.mFakeRecipe = aFakeRecipe; - GT_Recipe isthere = this.findRecipe((IHasWorldObjectAndCoords) null, false, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs); - - if (aRecipe.mFluidInputs.length < this.mMinimalInputFluids && aRecipe.mInputs.length < this.mMinimalInputItems) { - return null; - } else { - return aCheckForCollisions && isthere != null && BW_Util.areStacksEqualOrNull((ItemStack) isthere.mSpecialItems, (ItemStack) aRecipe.mSpecialItems) ? null : this.add(aRecipe); - } - } - - public GT_Recipe addRecipe(GT_Recipe aRecipe, boolean VanillaGT) { - if (VanillaGT) - return addRecipe(aRecipe, true, false, false); - else - return addRecipe(aRecipe); - } - - public GT_Recipe addRecipe(GT_Recipe aRecipe) { - if (aRecipe.mInputs.length > 0 && GT_Utility.areStacksEqual(aRecipe.mInputs[aRecipe.mInputs.length - 1], GT_Utility.getIntegratedCircuit(32767))) - return aRecipe; - else { - ItemStack[] nu1 = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1); - nu1[nu1.length - 1] = GT_Utility.getIntegratedCircuit(9 + nu1.length); - aRecipe.mInputs = nu1; - } - if (this.findRecipe((IHasWorldObjectAndCoords) null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null) { - ItemStack[] nu = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1); - int i = 9 + nu.length; - do { - nu[nu.length - 1] = GT_Utility.getIntegratedCircuit(i); - i++; - aRecipe.mInputs = nu; - if (i > 24) - i = 1; - if (i == 9 + nu.length) - return null; - } - while (this.findRecipe((IHasWorldObjectAndCoords) null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null); - } - return this.addRecipe(aRecipe, false, false, false); - } - } - - class BioLabRecipe extends GT_Recipe { - protected BioLabRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); - } - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index f774989d6a..5802387794 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; @@ -417,4 +418,21 @@ public class BW_Util { } return ret; } + + public static byte getCircuitTierFromOreDictName(String name) { + switch (name){ + case "circuitPrimitive": return 0; + case "circuitBasic": return 1; + case "circuitGood": return 2; + case "circuitAdvanced": return 3; + case "circuitData": return 4; + case "circuitElite": return 5; + case "circuitMaster": return 6; + case "circuitUltimate": return 7; + case "circuitSuperconductor": return 8; + case "circuitInfinite": return 9; + case "circuitBio": return 10; + default: return -1; + } + } } -- cgit From 151888e7cf33f50f4ec887e1af6e334b44d94909 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 31 Jul 2019 18:34:46 +0200 Subject: improved circuit recipe generation Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 915e3e018f1b929bdd5ca03cbb668a85ade12e02 --- build.gradle | 5 +- build.properties | 4 +- .../client/renderer/BW_GT_ItemRenderer.java | 125 ++++++++++++++ .../material/CircuitGeneration/BW_Meta_Items.java | 192 +++++++++++++++++++-- .../CircuitGeneration/CircuitImprintLoader.java | 84 +++++++-- .../CircuitGeneration/CircuitPartLoader.java | 5 + .../bartworks/system/material/WerkstoffLoader.java | 1 + .../bartimaeusnek/bartworks/util/BW_Util.java | 10 ++ .../resources/assets/bartworks/lang/en_US.lang | 4 +- .../bartworks/textures/items/WrapOverlay.png | Bin 0 -> 496 bytes 10 files changed, 398 insertions(+), 32 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java create mode 100644 src/main/resources/assets/bartworks/textures/items/WrapOverlay.png diff --git a/build.gradle b/build.gradle index e25c1e8bf7..bd21e845de 100644 --- a/build.gradle +++ b/build.gradle @@ -51,8 +51,6 @@ version = config.majorUpdate+"."+config.minorUpdate+"."+config.buildNumber group= "com.github.bartimaeusnek.bartworks" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "bartworks"+ "[" + config.mc_version + "]" - - minecraft { version = "1.7.10-10.13.4.1614-1.7.10" replaceIn "MainMod.java" @@ -138,8 +136,7 @@ processResources jar { manifest { - attributes 'FMLCorePlugin': 'com.github.bartimaeusnek.ASM.BWCorePlugin', - 'FMLCorePluginContainsFMLMod': 'true' + attributes 'FMLCorePlugin': 'com.github.bartimaeusnek.ASM.BWCorePlugin','FMLCorePluginContainsFMLMod': 'true' } } diff --git a/build.properties b/build.properties index 9f14eb0535..bf04c0eeb5 100644 --- a/build.properties +++ b/build.properties @@ -22,8 +22,8 @@ mc_version=1.7.10 majorUpdate=0 -minorUpdate=4 -buildNumber=19_pre3 +minorUpdate=5 +buildNumber=0_pre1 APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java new file mode 100644 index 0000000000..a59fb87635 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.client.renderer; + +import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; +import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.util.GT_Utility; +import gregtech.common.render.GT_RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class BW_GT_ItemRenderer implements IItemRenderer { + public BW_GT_ItemRenderer() { + for (BW_Meta_Items.BW_GT_MetaGen_Item_Hook tItem : BW_Meta_Items.BW_GT_MetaGen_Item_Hook.sInstances) { + MinecraftForgeClient.registerItemRenderer(tItem, this); + } + + } + + @Override + public boolean handleRenderType(ItemStack aStack, IItemRenderer.ItemRenderType aType) { + if (!GT_Utility.isStackInvalid(aStack) && aStack.getItemDamage() >= 0) { + return aType == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON || aType == IItemRenderer.ItemRenderType.INVENTORY || aType == IItemRenderer.ItemRenderType.EQUIPPED || aType == IItemRenderer.ItemRenderType.ENTITY; + } else { + return false; + } + } + @Override + public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType aType, ItemStack aStack, IItemRenderer.ItemRendererHelper aHelper) { + if (GT_Utility.isStackInvalid(aStack)) { + return false; + } else { + return aType == IItemRenderer.ItemRenderType.ENTITY; + } + } + @Override + public void renderItem(IItemRenderer.ItemRenderType type, ItemStack aStack, Object... data) { + if (!GT_Utility.isStackInvalid(aStack)) { + short aMetaData = (short) aStack.getItemDamage(); + if (aMetaData >= 0) { + BW_Meta_Items.BW_GT_MetaGen_Item_Hook aItem = (BW_Meta_Items.BW_GT_MetaGen_Item_Hook) aStack.getItem(); + GL11.glEnable(3042); + if (type == IItemRenderer.ItemRenderType.ENTITY) { + if (RenderItem.renderInFrame) { + GL11.glScalef(0.85F, 0.85F, 0.85F); + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslated(-0.5D, -0.42D, 0.0D); + } else { + GL11.glTranslated(-0.5D, -0.42D, 0.0D); + } + } + + GL11.glColor3f(1.0F, 1.0F, 1.0F); + IIcon tIcon = (IIcon) BW_Util.get2DCoordFrom1DArray(aMetaData, 0, 2, aItem.mIconList); + + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); + GL11.glBlendFunc(770, 771); + if (type.equals(IItemRenderer.ItemRenderType.INVENTORY)) { + if (aMetaData < CircuitImprintLoader.reverseIDs) + GT_RenderUtil.renderItemIcon(tIcon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); + else { + for (int i = 0; i < 4; i++) { + GT_RenderUtil.renderItemIcon(tIcon, 0.0D+i*2D,0.0D+i*2D,10.0D+i*2D,10.0D+i*2D, 0.001D, 0.0F, 0.0F, -1.0F); + } + } + } else { + if (aMetaData < CircuitImprintLoader.reverseIDs) + ItemRenderer.renderItemIn2D(Tessellator.instance,tIcon.getMaxU(), tIcon.getMinV(), tIcon.getMinU(), tIcon.getMaxV(), tIcon.getIconWidth(), tIcon.getIconHeight(), 0.0625F); +// else { +// for (int i = 0; i < 4; i++) { +// ItemRenderer.renderItemIn2D(Tessellator.instance, 0.0F+i*2F,0.0F+i*2F,10.0F+i*2F,10.0F+i*2F, tIcon.getIconWidth(), tIcon.getIconHeight(),0.0625F); +// } +// } +// ItemRenderer.renderItemIn2D(Tessellator.instance, tIcon.getMaxU(), tIcon.getMinV(), tIcon.getMinU(), tIcon.getMaxV(), tIcon.getIconWidth(), tIcon.getIconHeight(), 0.0625F); + } + + IIcon tOverlay = (IIcon) BW_Util.get2DCoordFrom1DArray(aMetaData, 1, 2, aItem.mIconList); + GL11.glColor3f(1.0F, 1.0F, 1.0F); + if (tOverlay != null) { + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); + GL11.glBlendFunc(770, 771); + if (type.equals(IItemRenderer.ItemRenderType.INVENTORY)) { + GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); + } else { + ItemRenderer.renderItemIn2D(Tessellator.instance, tOverlay.getMaxU(), tOverlay.getMinV(), tOverlay.getMinU(), tOverlay.getMaxV(), tOverlay.getIconWidth(), tOverlay.getIconHeight(), 0.0625F); + } + } + } + + GL11.glDisable(3042); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index c8e1ba1335..0048353a3e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -22,17 +22,40 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; +import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.Pair; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; -import gregtech.api.items.GT_MetaGenerated_Item; +import gregtech.api.enums.TC_Aspects; +import gregtech.api.interfaces.IItemBehaviour; +import gregtech.api.interfaces.IItemContainer; +import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.objects.ItemData; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; + +import java.util.ArrayList; +import java.util.BitSet; +import java.util.HashSet; +import java.util.List; public class BW_Meta_Items { @@ -75,7 +98,7 @@ public class BW_Meta_Items { public BW_GT_MetaGenCircuits() { - super("bwMetaGeneratedItem0", (short) 0, (short) 32766); + super("bwMetaGeneratedItem0"); } public final ItemStack addCircuit(int aID, String aEnglish, String aToolTip, int tier){ @@ -83,10 +106,6 @@ public class BW_Meta_Items { return this.addItem(aID, aEnglish, aToolTip,SubTag.NO_UNIFICATION); } - public final void modifyIIconIndex(int aID, IIcon icon){ - this.mIconList[aID][0] = icon; - } - public final ItemStack getStack(int... meta_amount){ ItemStack ret = new ItemStack(this); if (meta_amount.length <= 0 || meta_amount.length > 2) @@ -101,9 +120,162 @@ public class BW_Meta_Items { } } - private static class BW_GT_MetaGen_Item_Hook extends GT_MetaGenerated_Item{ - private BW_GT_MetaGen_Item_Hook(String aUnlocalized, short aOffset, short aItemAmount) { - super(aUnlocalized, aOffset, aItemAmount); + public static class BW_GT_MetaGen_Item_Hook extends GT_MetaBase_Item { + public static final HashSet sInstances = new HashSet<>(); + public final IIcon[] mIconList; + public final BitSet mEnabledItems; + { + this.mIconList = new IIcon[Short.MAX_VALUE*2]; + this.mEnabledItems = new BitSet(Short.MAX_VALUE); + } + + private BW_GT_MetaGen_Item_Hook(String aUnlocalized) { + super(aUnlocalized); + + this.setCreativeTab(new CreativeTabs("bw.MetaItems.0") { + @Override + public Item getTabIconItem() { + return ItemRegistry.TAB; + } + }); + this.setHasSubtypes(true); + this.setMaxDamage(0); + BW_Meta_Items.BW_GT_MetaGen_Item_Hook.sInstances.add(this); + } + + @Override + public Long[] getElectricStats(ItemStack itemStack) { + return null; + } + + @Override + public Long[] getFluidContainerStats(ItemStack itemStack) { + return null; + } + + public final ItemStack addItem(int aID, String aEnglish, String aToolTip, Object... aRandomData) { + if (aToolTip == null) { + aToolTip = ""; + } + ItemStack rStack = new ItemStack(this, 1, aID); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".name", aEnglish); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".tooltip", aToolTip); + List tAspects = new ArrayList<>(); + this.mEnabledItems.set(aID); + Object[] var7 = aRandomData; + int var8 = aRandomData.length; + + int var9; + Object tRandomData; + for(var9 = 0; var9 < var8; ++var9) { + tRandomData = var7[var9]; + if (tRandomData instanceof SubTag) { + if (tRandomData == SubTag.NO_UNIFICATION) { + GT_OreDictUnificator.addToBlacklist(rStack); + } + } + } + + var7 = aRandomData; + var8 = aRandomData.length; + + for(var9 = 0; var9 < var8; ++var9) { + tRandomData = var7[var9]; + if (tRandomData != null) { + boolean tUseOreDict = true; + + if (tRandomData instanceof IItemBehaviour) { + this.addItemBehavior(aID, (IItemBehaviour) tRandomData); + tUseOreDict = false; + } + + if (tRandomData instanceof IItemContainer) { + ((IItemContainer)tRandomData).set(rStack); + tUseOreDict = false; + } + + if (!(tRandomData instanceof SubTag)) { + if (tRandomData instanceof TC_Aspects.TC_AspectStack) { + ((TC_Aspects.TC_AspectStack)tRandomData).addToAspectList(tAspects); + } else if (tRandomData instanceof ItemData) { + if (GT_Utility.isStringValid(tRandomData)) { + GT_OreDictUnificator.registerOre(tRandomData, rStack); + } else { + GT_OreDictUnificator.addItemData(rStack, (ItemData)tRandomData); + } + } else if (tUseOreDict) { + GT_OreDictUnificator.registerOre(tRandomData, rStack); + } + } + } + } + + if (GregTech_API.sThaumcraftCompat != null) { + GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false); + } + + return rStack; + } + + @SideOnly(Side.CLIENT) + public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { + int j = this.mEnabledItems.length(); + + for(int i = 0; i < j; ++i) { + if (this.mEnabledItems.get(i)) { + ItemStack tStack = new ItemStack(this, 1, i); + this.isItemStackUsable(tStack); + aList.add(tStack); + } + } + + } + + @SideOnly(Side.CLIENT) + public final void registerIcons(IIconRegister aIconRegister) { + + for(short i = 0; i < CircuitImprintLoader.reverseIDs; ++i) { + if (this.mEnabledItems.get(i)) { + BW_Util.set2DCoordTo1DArray(i,0,2,aIconRegister.registerIcon("gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + "/" + i)),this.mIconList); + } + } + + for (short i = CircuitImprintLoader.reverseIDs; i < Short.MAX_VALUE; i++) { + if (this.mEnabledItems.get(i)) { + BW_Util.set2DCoordTo1DArray(i,0,2,CircuitImprintLoader.circuitIIconRefs.get(i).get(1).getIconIndex(),this.mIconList); + BW_Util.set2DCoordTo1DArray(i,1,2,aIconRegister.registerIcon(MainMod.MOD_ID+":WrapOverlay"),this.mIconList); + //aIconRegister.registerIcon("gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + "/" + i)); + } + } + + } + + @Override + protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { + super.addAdditionalToolTips(aList, aStack, aPlayer); + aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); + } + + @Override + public String getUnlocalizedName(ItemStack aStack) { + return this.getUnlocalizedName() + "." + aStack.getItemDamage(); + } + + @Override + public IIcon getIconFromDamage(int i) { + if (this.mEnabledItems.get(i)) + return (IIcon) BW_Util.get2DCoordFrom1DArray(i,0,2,this.mIconList); + return null; + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { + return getIconFromDamage(stack.getItemDamage()); + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + return getIconFromDamage(stack.getItemDamage()); } } -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index d3af29e6b7..bd49c3e64f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -23,32 +23,33 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; import com.github.bartimaeusnek.bartworks.util.BWRecipes; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.Pair; import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; -import gregtech.api.items.GT_MetaGenerated_Item; -import gregtech.api.items.GT_MetaGenerated_Item_X32; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; import net.minecraftforge.oredict.OreDictionary; -import java.util.*; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; + +import static gregtech.api.enums.ItemList.*; public class CircuitImprintLoader implements Runnable { static final ArrayListMultimap recipeTagMap = ArrayListMultimap.create(); static final HashBiMap bwCircuitTagMap = HashBiMap.create(20); static final HashSet refs = new HashSet<>(); - private static short reverseIDs = 32766; + public static short reverseIDs = Short.MAX_VALUE-1; + public static HashBiMap circuitIIconRefs = HashBiMap.create(20); public static NBTTagCompound getTagFromStack(ItemStack stack){ if (GT_Utility.isStackValid(stack)) @@ -61,10 +62,33 @@ public class CircuitImprintLoader implements Runnable { } public static void makeCircuitParts() { - ItemList[] itemLists = ItemList.values(); + ItemList[] itemLists = values(); for (ItemList single : itemLists) { if (!single.hasBeenSet()) continue; + if ( + single.toString().contains("Wafer") || + single.toString().contains("Circuit_Silicon_Ingot") || + single.toString().contains("Raw") || + single.toString().contains("raw") || + single.toString().contains("Glass_Tube") || + single == Circuit_Parts_GlassFiber || + single == Circuit_Parts_Advanced || + single == Circuit_Parts_Wiring_Advanced || + single == Circuit_Parts_Wiring_Elite || + single == Circuit_Parts_Wiring_Basic || + single == Circuit_Integrated || + single == Circuit_Parts_PetriDish || + single == Circuit_Parts_Vacuum_Tube || + single == Circuit_Integrated_Good || + single == Circuit_Parts_Capacitor || + single == Circuit_Parts_Diode || + single == Circuit_Parts_Resistor || + single == Circuit_Parts_Transistor + + ){ + continue; + } ItemStack itemStack = single.get(1); if (!GT_Utility.isStackValid(itemStack)) continue; @@ -74,12 +98,15 @@ public class CircuitImprintLoader implements Runnable { String name = null; if (oreIDS.length == 1) name = OreDictionary.getOreName(oreIDS[0]); - if ((name == null || name.isEmpty()) && (single.toString().contains("Circuit") || single.toString().contains("circuit")) && single.getBlock() == Blocks.air) { + if ((name == null || name.isEmpty()) && (single.toString().contains("Circuit") || single.toString().contains("circuit") || single.toString().contains("board")) && single.getBlock() == Blocks.air) { ArrayList toolTip = new ArrayList<>(); single.getItem().addInformation(single.get(1).copy(), null, toolTip, true); + String tt = (toolTip.size() > 0 ? toolTip.get(0) : ""); + // tt += "Internal Name = "+single; String localised = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); - BW_Meta_Items.getNEWCIRCUITS().addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised, toolTip.size() > 0 ? toolTip.get(0) : ""); + BW_Meta_Items.getNEWCIRCUITS().addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised+"s", tt); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{single.get(16).copy()},Materials.Plastic.getMolten(576),BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs),600,30); + CircuitImprintLoader.circuitIIconRefs.put(CircuitImprintLoader.reverseIDs,single); CircuitImprintLoader.reverseIDs--; } } @@ -105,14 +132,41 @@ public class CircuitImprintLoader implements Runnable { if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))) CircuitImprintLoader.refs.add(CircuitImprintLoader.getTagFromStack(s.copy().splitStack(1))); } -// if (circuitRecipe.mEUt > BW_Util.getTierVoltage(5)) - if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))) { - torem.add(circuitRecipe); - BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(circuitRecipe); - } + if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))) + BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(CircuitImprintLoader.reBuildRecipe(circuitRecipe)); +// if (circuitRecipe.mEUt > BW_Util.getTierVoltage(5)) { +// torem.add(circuitRecipe); +// } } } GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(torem); } + public static GT_Recipe reBuildRecipe(GT_Recipe original){ + ItemStack out = original.copy().getOutput(0); + out.stackSize = 16; + ItemStack[] in = new ItemStack[6]; + BiMap inversed = CircuitImprintLoader.circuitIIconRefs.inverse(); + for (int i = 0; i < 6; i++) { + try { + for (ItemList il : inversed.keySet()){ + if (GT_Utility.areStacksEqual(il.get(1), original.mInputs[i])) { + in[i] = BW_Meta_Items.getNEWCIRCUITS().getStack(inversed.get(il), original.mInputs[i].stackSize); + } + + } + if (original.mInputs[i] != null && in[i] == null){ + in[i] = original.mInputs[i].copy(); + in[i].stackSize *= 16; +// if (in[i].stackSize > 64) +// return null; + } + } catch (ArrayIndexOutOfBoundsException e){ + break; + } catch (NullPointerException e){ + } + } + return new BWRecipes.DynamicGTRecipe(false,in,new ItemStack[]{out},null,null, original.mFluidInputs,null,original.mDuration,original.mEUt,original.mSpecialValue); + } + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index 24f581d208..b25bd5d1b6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -22,9 +22,14 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; +import com.github.bartimaeusnek.bartworks.client.renderer.BW_GT_ItemRenderer; +import cpw.mods.fml.common.FMLCommonHandler; + public class CircuitPartLoader implements Runnable { @Override public void run() { CircuitImprintLoader.makeCircuitParts(); + if (FMLCommonHandler.instance().getEffectiveSide().isClient()) + new BW_GT_ItemRenderer(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 8c9164538a..1c9a8f4fc1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.API.WerkstoffAdderRegistry; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.client.renderer.BW_GT_ItemRenderer; import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 5802387794..261ab49c77 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -53,6 +53,16 @@ public class BW_Util { public static final int CLEANROOM = -100; public static final int LOWGRAVITY = -200; + public static void set2DCoordTo1DArray(int indexX, int indexY, int sizeY, Object value, Object[] array) { + int index = indexX * sizeY + indexY; + array[index] = value; + } + + public static Object get2DCoordFrom1DArray(int indexX, int indexY, int sizeY, Object[] array){ + int index = indexX * sizeY + indexY; + return array[index]; + } + public static String subscriptNumbers(String b){ char[] chars = b.toCharArray(); char[] nu = new char[chars.length]; diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 0aac211cdf..b0b3c9b7b6 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -159,4 +159,6 @@ tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;S planet.Ross128b=Ross128b moon.Ross128ba=Ross128ba star.Ross128=Ross128 -solarsystem.Ross128System=Ross128-System \ No newline at end of file +solarsystem.Ross128System=Ross128-System + +itemGroup.bw.MetaItems.0=BartWorks Circuit Overhaul Items \ No newline at end of file diff --git a/src/main/resources/assets/bartworks/textures/items/WrapOverlay.png b/src/main/resources/assets/bartworks/textures/items/WrapOverlay.png new file mode 100644 index 0000000000..f6d80e292e Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/WrapOverlay.png differ -- cgit From e7f82a6de66c07ba7b4d5b683e681a34925be023 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 1 Aug 2019 20:54:35 +0200 Subject: finalised circuit recipe gen +fixed lowgravity/cleanroom mismatch +fixed name of "Magneto Resonatic Dust" +fixed Electric implosion generator not working Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 2ebdf8661cc9db030a355b8d7570cb8539be0cc2 --- .../github/bartimaeusnek/bartworks/MainMod.java | 29 +--- .../CircuitGeneration/BW_CircuitsLoader.java | 22 +-- .../material/CircuitGeneration/BW_Meta_Items.java | 87 +++++++---- .../CircuitGeneration/CircuitImprintLoader.java | 171 ++++++++++++--------- .../CircuitGeneration/CircuitPartLoader.java | 67 +++++++- .../bartworks/system/material/WerkstoffLoader.java | 2 +- .../processingLoaders/AdditionalRecipes.java | 1 - .../bartimaeusnek/bartworks/util/BW_Util.java | 11 +- 8 files changed, 247 insertions(+), 143 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index aa5d3f63f4..bca700773a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -165,34 +165,17 @@ public final class MainMod { new CircuitImprintLoader().run(); } - private void addElectricImplosionCompressorRecipes(){ + private void addElectricImplosionCompressorRecipes() { if (eicMap == null) { eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); - recipeLoop: for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList) { if (recipe == null || recipe.mInputs == null) continue; - try { - ItemStack input = recipe.mInputs[0]; - int i = 0; - if (this.checkForExplosives(recipe.mInputs[1])) { - continue; - } - while (this.checkForExplosives(input)) { - if (GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L))) { - i++; - input = recipe.mInputs[i]; - } - else - continue recipeLoop; - - } - - eicMap.addRecipe(true, new ItemStack[]{input}, recipe.mOutputs, null, null, null, recipe.mDuration, BW_Util.getMachineVoltageFromTier(10), 0); - } catch (ArrayIndexOutOfBoundsException e) { - MainMod.LOGGER.error("CAUGHT DEFECTIVE IMPLOSION COMPRESSOR RECIPE!"); - e.printStackTrace(); - } + HashSet inputs = new HashSet<>(); + for (ItemStack is : recipe.mInputs) + if (!this.checkForExplosives(is)) + inputs.add(is); + eicMap.addRecipe(true, inputs.toArray(new ItemStack[0]), recipe.mOutputs, null, null, null, recipe.mDuration, BW_Util.getMachineVoltageFromTier(10), 0); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java index 5bd182c6c0..36dc620685 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java @@ -33,16 +33,16 @@ public class BW_CircuitsLoader { static { NEW_CIRCUITS = new BW_Meta_Items(); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(0,1, "Primitive Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(1,2, "Basic Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(2,3, "Good Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(3,4, "Advanced Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(4,5, "Data Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(5,6, "Elite Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(6,7, "Master Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(7,8, "Ultimate Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(8,9, "Superconductor Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(9,10, "Infinite Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(10,11, "Bio Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(0,4, "Primitive Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(1,5, "Basic Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(2,6, "Good Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(3,7, "Advanced Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(4,8, "Data Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(5,9, "Elite Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(6,10, "Master Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(7,11, "Ultimate Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(8,12, "Superconductor Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(9,13, "Infinite Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(10,14, "Bio Magneto Resonatic Circuit"); } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index 0048353a3e..0cee76a61d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -25,32 +25,30 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.Pair; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.SubTag; -import gregtech.api.enums.TC_Aspects; +import gregtech.api.enums.*; import gregtech.api.interfaces.IItemBehaviour; import gregtech.api.interfaces.IItemContainer; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.objects.ItemData; -import gregtech.api.util.GT_Config; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.BitSet; @@ -66,6 +64,14 @@ public class BW_Meta_Items { private static final BW_Meta_Items.BW_GT_MetaGenCircuits NEWCIRCUITS = new BW_Meta_Items.BW_GT_MetaGenCircuits(); + static{ + BW_Meta_Items.NEWCIRCUITS.addItem(0,"Circuit Imprint","",SubTag.NO_UNIFICATION,SubTag.NO_RECYCLING); + BW_Meta_Items.NEWCIRCUITS.addItem(1,"Sliced Circuit","",SubTag.NO_UNIFICATION,SubTag.NO_RECYCLING); + BW_Meta_Items.NEWCIRCUITS.addItem(2,"Raw Imprint supporting Board","A Raw Board needed for Circuit Imprints"); + BW_Meta_Items.NEWCIRCUITS.addItem(3,"Imprint supporting Board","A Board needed for Circuit Imprints"); + GT_Values.RA.addFormingPressRecipe(WerkstoffLoader.MagnetoResonaticDust.get(OrePrefixes.dust,1),WerkstoffLoader.ArInGaPhoBiBoTe.get(OrePrefixes.dust,4),BW_Meta_Items.NEWCIRCUITS.getStack(2),300,480); + GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{BW_Meta_Items.NEWCIRCUITS.getStack(2)},new ItemStack[]{BW_Meta_Items.NEWCIRCUITS.getStack(3)},null,new int[]{7500},new FluidStack[]{Materials.SolderingAlloy.getMolten(576)},null,300,BW_Util.getMachineVoltageFromTier(4),BW_Util.CLEANROOM)); + } public void addNewCircuit(int aTier, int aID, String aName){ @@ -102,7 +108,7 @@ public class BW_Meta_Items { } public final ItemStack addCircuit(int aID, String aEnglish, String aToolTip, int tier){ - CircuitImprintLoader.bwCircuitTagMap.put(new CircuitData(BW_Util.getMachineVoltageFromTier(tier-2),0,(byte)tier), CircuitImprintLoader.getTagFromStack(new ItemStack(BW_Meta_Items.NEWCIRCUITS,1,aID))); + CircuitImprintLoader.bwCircuitTagMap.put(new CircuitData(BW_Util.getMachineVoltageFromTier(tier-2),tier > 2 ? BW_Util.CLEANROOM : 0,(byte)tier), CircuitImprintLoader.getTagFromStack(new ItemStack(BW_Meta_Items.NEWCIRCUITS,1,aID))); return this.addItem(aID, aEnglish, aToolTip,SubTag.NO_UNIFICATION); } @@ -118,6 +124,46 @@ public class BW_Meta_Items { ret.stackSize=meta_amount[1]; return ret; } + + public final ItemStack getStackWithNBT(NBTTagCompound tag, int... meta_amount){ + ItemStack ret = this.getStack(meta_amount); + ret.setTagCompound(tag); + return ret; + } + + @SideOnly(Side.CLIENT) + public final void registerIcons(IIconRegister aIconRegister) { + + for(short i = 0; i < CircuitImprintLoader.reverseIDs; ++i) { + if (this.mEnabledItems.get(i)) { + BW_Util.set2DCoordTo1DArray(i,0,2,aIconRegister.registerIcon("gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + "/" + i)),this.mIconList); + } + } + + for (short i = CircuitImprintLoader.reverseIDs; i < Short.MAX_VALUE; i++) { + if (this.mEnabledItems.get(i)) { + BW_Util.set2DCoordTo1DArray(i,0,2,CircuitImprintLoader.circuitIIconRefs.get(i).get(1).getIconIndex(),this.mIconList); + BW_Util.set2DCoordTo1DArray(i,1,2,aIconRegister.registerIcon(MainMod.MOD_ID+":WrapOverlay"),this.mIconList); + //aIconRegister.registerIcon("gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + "/" + i)); + } + } + + } + + @Override + protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { + if (aStack.getItemDamage() == 0 ) + if (aStack.getTagCompound() != null && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) + aList.add("An Imprint for: "+GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); + else + aList.add("An Imprint for a Circuit"); + else if (aStack.getItemDamage() == 1 ) + if (aStack.getTagCompound() != null && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) + aList.add("A Sliced "+GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); + else + aList.add("A Sliced Circuit"); + super.addAdditionalToolTips(aList, aStack, aPlayer); + } } public static class BW_GT_MetaGen_Item_Hook extends GT_MetaBase_Item { @@ -231,25 +277,6 @@ public class BW_Meta_Items { } - @SideOnly(Side.CLIENT) - public final void registerIcons(IIconRegister aIconRegister) { - - for(short i = 0; i < CircuitImprintLoader.reverseIDs; ++i) { - if (this.mEnabledItems.get(i)) { - BW_Util.set2DCoordTo1DArray(i,0,2,aIconRegister.registerIcon("gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + "/" + i)),this.mIconList); - } - } - - for (short i = CircuitImprintLoader.reverseIDs; i < Short.MAX_VALUE; i++) { - if (this.mEnabledItems.get(i)) { - BW_Util.set2DCoordTo1DArray(i,0,2,CircuitImprintLoader.circuitIIconRefs.get(i).get(1).getIconIndex(),this.mIconList); - BW_Util.set2DCoordTo1DArray(i,1,2,aIconRegister.registerIcon(MainMod.MOD_ID+":WrapOverlay"),this.mIconList); - //aIconRegister.registerIcon("gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + "/" + i)); - } - } - - } - @Override protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { super.addAdditionalToolTips(aList, aStack, aPlayer); @@ -270,12 +297,12 @@ public class BW_Meta_Items { @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - return getIconFromDamage(stack.getItemDamage()); + return this.getIconFromDamage(stack.getItemDamage()); } @Override public IIcon getIcon(ItemStack stack, int pass) { - return getIconFromDamage(stack.getItemDamage()); + return this.getIconFromDamage(stack.getItemDamage()); } } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index bd49c3e64f..bc0c15b162 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -22,27 +22,26 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; -import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; -import gregtech.api.util.GT_LanguageManager; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.oredict.OreDictionary; -import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; -import static gregtech.api.enums.ItemList.*; - public class CircuitImprintLoader implements Runnable { static final ArrayListMultimap recipeTagMap = ArrayListMultimap.create(); @@ -61,62 +60,12 @@ public class CircuitImprintLoader implements Runnable { return ItemStack.loadItemStackFromNBT(tagCompound); } - public static void makeCircuitParts() { - ItemList[] itemLists = values(); - for (ItemList single : itemLists) { - if (!single.hasBeenSet()) - continue; - if ( - single.toString().contains("Wafer") || - single.toString().contains("Circuit_Silicon_Ingot") || - single.toString().contains("Raw") || - single.toString().contains("raw") || - single.toString().contains("Glass_Tube") || - single == Circuit_Parts_GlassFiber || - single == Circuit_Parts_Advanced || - single == Circuit_Parts_Wiring_Advanced || - single == Circuit_Parts_Wiring_Elite || - single == Circuit_Parts_Wiring_Basic || - single == Circuit_Integrated || - single == Circuit_Parts_PetriDish || - single == Circuit_Parts_Vacuum_Tube || - single == Circuit_Integrated_Good || - single == Circuit_Parts_Capacitor || - single == Circuit_Parts_Diode || - single == Circuit_Parts_Resistor || - single == Circuit_Parts_Transistor - - ){ - continue; - } - ItemStack itemStack = single.get(1); - if (!GT_Utility.isStackValid(itemStack)) - continue; - int[] oreIDS = OreDictionary.getOreIDs(itemStack); - if (oreIDS.length > 1) - continue; - String name = null; - if (oreIDS.length == 1) - name = OreDictionary.getOreName(oreIDS[0]); - if ((name == null || name.isEmpty()) && (single.toString().contains("Circuit") || single.toString().contains("circuit") || single.toString().contains("board")) && single.getBlock() == Blocks.air) { - ArrayList toolTip = new ArrayList<>(); - single.getItem().addInformation(single.get(1).copy(), null, toolTip, true); - String tt = (toolTip.size() > 0 ? toolTip.get(0) : ""); - // tt += "Internal Name = "+single; - String localised = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); - BW_Meta_Items.getNEWCIRCUITS().addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised+"s", tt); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{single.get(16).copy()},Materials.Plastic.getMolten(576),BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs),600,30); - CircuitImprintLoader.circuitIIconRefs.put(CircuitImprintLoader.reverseIDs,single); - CircuitImprintLoader.reverseIDs--; - } - } - } - @Override public void run() { Iterator it = GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.iterator(); GT_Recipe circuitRecipe; - HashSet torem = new HashSet<>(); + HashSet toRem = new HashSet<>(); + HashSet toAdd = new HashSet<>(); while (it.hasNext()) { circuitRecipe = it.next(); ItemStack[] outputs = circuitRecipe.mOutputs; @@ -127,19 +76,43 @@ public class CircuitImprintLoader implements Runnable { continue; String name = OreDictionary.getOreName(oreIDS[0]); if (name.contains("Circuit") || name.contains("circuit")) { - CircuitImprintLoader.recipeTagMap.put(CircuitImprintLoader.getTagFromStack(outputs[0]),circuitRecipe.copy()); - for (ItemStack s : circuitRecipe.mInputs){ + CircuitImprintLoader.recipeTagMap.put(CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); + for (ItemStack s : circuitRecipe.mInputs) { if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))) CircuitImprintLoader.refs.add(CircuitImprintLoader.getTagFromStack(s.copy().splitStack(1))); } - if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))) - BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(CircuitImprintLoader.reBuildRecipe(circuitRecipe)); -// if (circuitRecipe.mEUt > BW_Util.getTierVoltage(5)) { -// torem.add(circuitRecipe); -// } + if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))) { + + GT_Recipe newRecipe = CircuitImprintLoader.reBuildRecipe(circuitRecipe); + if (newRecipe != null) + BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(newRecipe); + if (circuitRecipe.mEUt > BW_Util.getTierVoltage(5)) { + toRem.add(circuitRecipe); + toAdd.add(CircuitImprintLoader.makeMoreExpensive(circuitRecipe)); + } + } else { + if (circuitRecipe.mEUt > BW_Util.getTierVoltage(5)) { + toRem.add(circuitRecipe); + } + } + } } - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(torem); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.addAll(toAdd); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(toRem); + this.makeCircuitImprints(); + } + + public static GT_Recipe makeMoreExpensive(GT_Recipe original){ + GT_Recipe newRecipe = original.copy(); + for (ItemStack is : newRecipe.mInputs){ + int[] oreIDs = OreDictionary.getOreIDs(is); + if(oreIDs == null || oreIDs.length < 1 || !OreDictionary.getOreName(oreIDs[0]).contains("circuit")) + is.stackSize = Math.max( 64, is.stackSize *= 4); + } + newRecipe.mFluidInputs[0].amount *= 4; + newRecipe.mDuration *= 4; + return newRecipe; } public static GT_Recipe reBuildRecipe(GT_Recipe original){ @@ -156,17 +129,75 @@ public class CircuitImprintLoader implements Runnable { } if (original.mInputs[i] != null && in[i] == null){ - in[i] = original.mInputs[i].copy(); - in[i].stackSize *= 16; + if (BW_Util.checkStackAndPrefix(original.mInputs[i]) && GT_OreDictUnificator.getAssociation(original.mInputs[i]).mPrefix == OrePrefixes.wireGt01){ + in[i] = GT_OreDictUnificator.get(OrePrefixes.wireGt16,GT_OreDictUnificator.getAssociation(original.mInputs[i]).mMaterial.mMaterial,original.mInputs[i].stackSize); + } + else { + in[i] = original.mInputs[i].copy(); + in[i].stackSize *= 16; + } // if (in[i].stackSize > 64) // return null; } } catch (ArrayIndexOutOfBoundsException e){ break; } catch (NullPointerException e){ + e.printStackTrace(); } } - return new BWRecipes.DynamicGTRecipe(false,in,new ItemStack[]{out},null,null, original.mFluidInputs,null,original.mDuration,original.mEUt,original.mSpecialValue); + if (CircuitImprintLoader.checkForBlacklistedComponents(in)){ + return null; + } + + return new BWRecipes.DynamicGTRecipe(false,in,new ItemStack[]{out},BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]),0,0),null, original.mFluidInputs,null,original.mDuration,original.mEUt,original.mSpecialValue); } -} + + public static final HashSet blacklistSet = new HashSet<>(); + + private static boolean checkForBlacklistedComponents(ItemStack[] itemStacks){ + for (ItemStack is: itemStacks){ + for (ItemStack is2 : CircuitImprintLoader.blacklistSet){ + if (GT_Utility.areStacksEqual(is,is2)) + return true; + } + } + return false; + } + + private void makeCircuitImprints(){ + for (NBTTagCompound tag : CircuitImprintLoader.recipeTagMap.keySet()){ + ItemStack stack = CircuitImprintLoader.getStackFromTag(tag); + int eut = Integer.MAX_VALUE; + for (GT_Recipe recipe : CircuitImprintLoader.recipeTagMap.get(tag)) { + eut = Math.min(eut, recipe.mEUt); + } + eut = Math.min(eut,BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName(OreDictionary.getOreIDs(stack)[0])))); + GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300,eut,BW_Util.CLEANROOM); + GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); + GT_ModHandler.addCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1),GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS ,new Object[]{ + " X ", + "GPG", + " X ", + 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), + 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), + 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3) + }); + } +// for (NBTTagCompound tag : CircuitImprintLoader.bwCircuitTagMap.values()){ +// CircuitData data = CircuitImprintLoader.bwCircuitTagMap.inverse().get(tag); +// ItemStack stack = CircuitImprintLoader.getStackFromTag(tag); +// GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300, Math.toIntExact(data.getaVoltage()),data.getaSpecial()); +// GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); +// GT_ModHandler.addCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1),GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS ,new Object[]{ +// "DXD", +// "GPG", +// "DXD", +// 'D', WerkstoffLoader.ArInGaPhoBiBoTe.get(OrePrefixes.dust,1), +// 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), +// 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), +// 'X', WerkstoffLoader.MagnetoResonaticDust.get(OrePrefixes.dust,1) +// }); +// } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index b25bd5d1b6..7bec3e9213 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -24,12 +24,77 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; import com.github.bartimaeusnek.bartworks.client.renderer.BW_GT_ItemRenderer; import cpw.mods.fml.common.FMLCommonHandler; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Utility; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.ArrayList; + +import static gregtech.api.enums.ItemList.*; +import static gregtech.api.enums.ItemList.Circuit_Parts_Transistor; public class CircuitPartLoader implements Runnable { @Override public void run() { - CircuitImprintLoader.makeCircuitParts(); + CircuitPartLoader.makeCircuitParts(); if (FMLCommonHandler.instance().getEffectiveSide().isClient()) new BW_GT_ItemRenderer(); } + + public static void makeCircuitParts() { + ItemList[] itemLists = values(); + for (ItemList single : itemLists) { + if (!single.hasBeenSet()) + continue; + if ( + single.toString().contains("Wafer") || + single.toString().contains("Circuit_Silicon_Ingot") || + single.toString().contains("Raw") || + single.toString().contains("raw") || + single.toString().contains("Glass_Tube") || + single == Circuit_Parts_GlassFiber || + single == Circuit_Parts_Advanced || + single == Circuit_Parts_Wiring_Advanced || + single == Circuit_Parts_Wiring_Elite || + single == Circuit_Parts_Wiring_Basic || + single == Circuit_Integrated || + single == Circuit_Parts_PetriDish || + single == Circuit_Parts_Vacuum_Tube || + single == Circuit_Integrated_Good || + single == Circuit_Parts_Capacitor || + single == Circuit_Parts_Diode || + single == Circuit_Parts_Resistor || + single == Circuit_Parts_Transistor + + ){ + CircuitImprintLoader.blacklistSet.add(single.get(1)); + continue; + } + ItemStack itemStack = single.get(1); + if (!GT_Utility.isStackValid(itemStack)) + continue; + int[] oreIDS = OreDictionary.getOreIDs(itemStack); + if (oreIDS.length > 1) + continue; + String name = null; + if (oreIDS.length == 1) + name = OreDictionary.getOreName(oreIDS[0]); + if ((name == null || name.isEmpty()) && (single.toString().contains("Circuit") || single.toString().contains("circuit") || single.toString().contains("board")) && single.getBlock() == Blocks.air) { + ArrayList toolTip = new ArrayList<>(); + single.getItem().addInformation(single.get(1).copy(), null, toolTip, true); + String tt = (toolTip.size() > 0 ? toolTip.get(0) : ""); + // tt += "Internal Name = "+single; + String localised = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); + BW_Meta_Items.getNEWCIRCUITS().addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised+"s", tt); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{single.get(16).copy()}, Materials.Plastic.getMolten(576),BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs),600,30); + CircuitImprintLoader.circuitIIconRefs.put(CircuitImprintLoader.reverseIDs,single); + CircuitImprintLoader.reverseIDs--; + } + } + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 1c9a8f4fc1..d3175f967c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -532,7 +532,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff MagnetoResonaticDust = new Werkstoff( new short[]{0xDD,0x77,0xDD,0}, - "Magneto Resonatic Dust", + "Magneto Resonatic", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().onlyDust().addMixerRecipes(), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 155283bfb0..7678e69faa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -60,7 +60,6 @@ public class AdditionalRecipes implements Runnable { GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust),Materials.Magnesium.getDust(1),Materials.Thorium.getDust(1),1000); GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(crushed), ItemList.Crop_Drop_Thorium.get(9),Materials.Water.getFluid(1000),Materials.Thorium.getMolten(144),WerkstoffLoader.Thorianit.get(crushedPurified,4),96,24); - //TODO: Gem & Circuit Stuff //Prasiolite GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(dust,Materials.Quartzite,40L),Materials.Amethyst.getDust(10),GT_Values.NF,GT_Values.NF,WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed,20),GT_Values.NI,800, BW_Util.getMachineVoltageFromTier(2),500); GT_Values.RA.addPrimitiveBlastRecipe(GT_OreDictUnificator.get(dust,Materials.Quartzite,40L),Materials.Amethyst.getDust(10),6,WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed,20),GT_Values.NI,800); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 261ab49c77..ea2208146b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -24,7 +24,6 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; @@ -50,8 +49,8 @@ import static gregtech.api.enums.GT_Values.V; public class BW_Util { public static final int STANDART = 0; - public static final int CLEANROOM = -100; - public static final int LOWGRAVITY = -200; + public static final int LOWGRAVITY = -100; + public static final int CLEANROOM = -200; public static void set2DCoordTo1DArray(int indexX, int indexY, int sizeY, Object value, Object[] array) { int index = indexX * sizeY + indexY; @@ -147,11 +146,11 @@ public class BW_Util { public static byte specialToByte(int aSpecialValue) { byte special = 0; - if (aSpecialValue == (CLEANROOM)) + if (aSpecialValue == (LOWGRAVITY)) special = 1; - else if (aSpecialValue == (LOWGRAVITY)) + else if (aSpecialValue == (CLEANROOM)) special = 2; - else if (aSpecialValue == (CLEANROOM | LOWGRAVITY)) { + else if (aSpecialValue == (LOWGRAVITY | CLEANROOM)) { special = 3; } return special; -- cgit From f859c4458703f56ab00c70fab69fd555fee47db7 Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Sun, 4 Aug 2019 14:59:47 +0800 Subject: Update Circuit update‘s lang MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 1a7a3f25fe4a187de9442ed1f092405288209c50 --- src/main/resources/assets/bartworks/lang/zh_CN.lang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index 54982222b9..35818c0e8b 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -160,4 +160,6 @@ planet.Ross128b=罗斯128b moon.Ross128ba=罗斯128ba star.Ross128=罗斯128 solarsystem.Ross128System=罗斯128星系 + +itemGroup.bw.MetaItems.0=BartWorks电路更新物品 //This zh_CN.lang is translated by huajijam for bartworks (19/7/19) \ No newline at end of file -- cgit From 87b9bfd0a0989ec3186cb3f8c01bbb461182da17 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 6 Aug 2019 19:24:57 +0200 Subject: +added Achivment Localisation +MegaMachine Fixes Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 4e539963efb6cbe8603466dea2e7850aab6e4bec --- build.properties | 2 +- .../com/github/bartimaeusnek/bartworks/MainMod.java | 5 +++++ .../multis/mega/GT_TileEntity_MegaBlastFurnace.java | 15 ++++++++++----- .../bartimaeusnek/bartworks/util/BW_Util.java | 21 +++++++++++++++------ 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/build.properties b/build.properties index bf04c0eeb5..81c9f8cb9c 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=0_pre1 +buildNumber=0_pre3 APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index bca700773a..8001cb0c41 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -54,6 +54,7 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.SubTag; +import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -155,6 +156,10 @@ public final class MainMod { new ThreadedLoader().run(); else WerkstoffLoader.INSTANCE.run(); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor","Electric Implosions?"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor.desc","Basically a giant Hammer that presses Stuff - No more TNT!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.DEHP","Heat from below!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.DEHP.desc","Get ALL the thermal energy!"); } } @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index a9fab1b94b..6c90893975 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -210,17 +210,22 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl //Long EUt calculation long xEUt = aEUt; //Isnt too low EUt check? - long tempEUt = xEUt < V[1] ? V[1] : xEUt; + long tempEUt = Math.max(xEUt, V[1]); this.mMaxProgresstime = aDuration; - while (tempEUt <= V[mTier - 1]) { tempEUt <<= 2;//this actually controls overclocking //xEUt *= 4;//this is effect of everclocking this.mMaxProgresstime >>= 1;//this is effect of overclocking - xEUt = this.mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power + xEUt = this.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power timesOverclocked++; } + if (xEUt > maxInputVoltage){ + //downclock one notch, we have overshot. + xEUt >>=2; + this.mMaxProgresstime <<= 1; + timesOverclocked--; + } if (xEUt > Integer.MAX_VALUE - 1) { this.mEUt = Integer.MAX_VALUE - 1; this.mMaxProgresstime = Integer.MAX_VALUE - 1; @@ -228,7 +233,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl this.mEUt = (int) xEUt; if (this.mEUt == 0) this.mEUt = 1; - if (this.mMaxProgresstime == 0) + if (this.mMaxProgresstime <= 0) this.mMaxProgresstime = 1;//set time to 1 tick } } @@ -243,7 +248,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11)); ret.add(BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11)); for (int y = -1; y < 17; y++) { - ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, true, 11)); + ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, false, 11)); if (!this.getCoilHeat(iGregTechTileEntity, 7, y, 6)) return false; List metasFromLayer = BW_Util.getMetasFromLayer(iGregTechTileEntity, 7, y, y + 1, 7, y == 0, false, false); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index ea2208146b..046c9363e4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -30,6 +30,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -259,7 +260,7 @@ public class BW_Util { //Long EUt calculation long xEUt = aEUt; //Isnt too low EUt check? - long tempEUt = xEUt < V[1] ? V[1] : xEUt; + long tempEUt = Math.max(xEUt, V[1]); base.mMaxProgresstime = aDuration; @@ -267,8 +268,15 @@ public class BW_Util { tempEUt <<= 2;//this actually controls overclocking //xEUt *= 4;//this is effect of everclocking base.mMaxProgresstime >>= 1;//this is effect of overclocking - xEUt = base.mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power + xEUt = base.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power } + + if (xEUt > maxInputVoltage){ + //downclock one notch, we have overshot. + xEUt >>=2; + base.mMaxProgresstime <<= 1; + } + if (xEUt > Integer.MAX_VALUE - 1) { base.mEUt = Integer.MAX_VALUE - 1; base.mMaxProgresstime = Integer.MAX_VALUE - 1; @@ -276,7 +284,7 @@ public class BW_Util { base.mEUt = (int) xEUt; if (base.mEUt == 0) base.mEUt = 1; - if (base.mMaxProgresstime == 0) + if (base.mMaxProgresstime <= 0) base.mMaxProgresstime = 1;//set time to 1 tick } } @@ -374,8 +382,9 @@ public class BW_Util { continue; if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) continue; - if (insideCheck && (Math.abs(x) < radius && Math.abs(z) != radius)) { - if (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside) || (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside && dmginside > (-1))) { + boolean b = Math.abs(x) < radius && Math.abs(z) != radius; + if (insideCheck && b) { + if (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside) && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside || dmginside > (-1))) { if (!(allowHatches && ( ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addDynamoToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || @@ -388,7 +397,7 @@ public class BW_Util { } } } - if (((!(Math.abs(x) < radius && Math.abs(z) != radius))) && (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) || (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmg && dmg > (-1)))) { + if (!b && !aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmg || dmg > (-1))) { if (!(allowHatches && ( ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addDynamoToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || -- cgit From 50c4013a228c30fedec312c062a04a7511077f7e Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 11 Aug 2019 11:44:08 +0200 Subject: Circuit Assembly Line added + added "classic mode" Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 6d0acc949506b6fcd424f971c39f0b8e3a75093b --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 3 + .../bartworks/common/configs/ConfigHandler.java | 11 +- .../bartworks/common/loaders/ItemRegistry.java | 5 +- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 231 +++++++++++++++++++-- .../material/CircuitGeneration/BW_Meta_Items.java | 11 + .../CircuitGeneration/CircuitImprintLoader.java | 2 +- .../material/processingLoaders/DownTierLoader.java | 51 +++++ .../bartimaeusnek/bartworks/util/BW_Util.java | 18 +- 9 files changed, 303 insertions(+), 31 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java diff --git a/build.properties b/build.properties index 81c9f8cb9c..0cf847ee9b 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=0_pre3 +buildNumber=0_pre4 APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 8001cb0c41..fab50ec3b4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -39,6 +39,7 @@ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.Circ import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.common.FMLCommonHandler; @@ -168,6 +169,8 @@ public final class MainMod { WerkstoffLoader.removeIC2Recipes(); this.addElectricImplosionCompressorRecipes(); new CircuitImprintLoader().run(); + if (ConfigHandler.classicMode) + new DownTierLoader().run(); } private void addElectricImplosionCompressorRecipes() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index d0e57cae15..10fe70816f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -53,6 +53,7 @@ public class ConfigHandler { public static boolean DEHPDirectSteam; public static boolean teslastaff; + public static boolean classicMode; public static boolean experimentalThreadedLoader; public static boolean GTNH; public static boolean ezmode; @@ -65,17 +66,20 @@ public class ConfigHandler { public ConfigHandler(Configuration C) { ConfigHandler.c = C; + ConfigHandler.classicMode= ConfigHandler.c.get("System", "Enable Classic Mode", false, "Enables the classic Mode (all recipes in normal machines are doable in MV").getBoolean(false); ConfigHandler.creativeScannerID = ConfigHandler.c.get("System", "Creative Debug Scanner", 0, "ID for the Creative Debug Scanner Block").getInt(0); ConfigHandler.tooltips = ConfigHandler.c.get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips").getBoolean(true); ConfigHandler.IDOffset = ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600); - ConfigHandler.energyPerCell = ConfigHandler.c.get("Multiblocks", "energyPerLESUCell", 1000000, "This will set Up the Energy per LESU Cell", 1000000, Integer.MAX_VALUE).getInt(1000000); ConfigHandler.ezmode = ConfigHandler.c.get("System", "Mode switch", false, "If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false); ConfigHandler.teslastaff = ConfigHandler.c.get("System", "Enable Teslastaff", false, "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); ConfigHandler.newStuff = !ConfigHandler.c.get("System", "Disable non-original-GT-stuff", false, "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false); ConfigHandler.BioLab = !ConfigHandler.c.get("System", "Disable BioLab", false, "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!").getBoolean(false); + + ConfigHandler.mbWaterperSec = ConfigHandler.c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150).getInt(150); + + ConfigHandler.energyPerCell = ConfigHandler.c.get("Multiblocks", "energyPerLESUCell", 1000000, "This will set Up the Energy per LESU Cell", 1000000, Integer.MAX_VALUE).getInt(1000000); ConfigHandler.DEHPDirectSteam = ConfigHandler.c.get("Multiblocks", "DEHP Direct Steam Mode", false, "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant").getBoolean(false); ConfigHandler.megaMachinesMax = ConfigHandler.c.get("Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256); - ConfigHandler.mbWaterperSec = ConfigHandler.c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150).getInt(150); ConfigHandler.bioVatMaxParallelBonus = ConfigHandler.c.get("Multiblocks","BioVat Maximum Bonus on Recipes", 1000,"This are the maximum parallel Operations the BioVat can do, when the output is half full.").getInt(1000); if (ConfigHandler.IDOffset == 0) { ConfigHandler.IDOffset = 12600; @@ -89,7 +93,6 @@ public class ConfigHandler { } ConfigHandler.enabledPatches = new boolean[BWCoreTransformer.shouldTransform.length]; ConfigHandler.enabledPatches = Arrays.copyOf(BWCoreTransformer.shouldTransform,BWCoreTransformer.shouldTransform.length); - ConfigHandler.ross128BID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64); ConfigHandler.ross128BAID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128ba", -63, "The Dim ID for Ross128ba (Ross128b's Moon)").getInt(-63); ConfigHandler.ross128btier = ConfigHandler.c.get("CrossMod Interactions", "Rocket Tier - Ross128b", 3, "The Rocket Tier for Ross128b").getInt(3); @@ -105,8 +108,8 @@ public class ConfigHandler { private static void setUpComments() { ConfigHandler.c.addCustomCategoryComment("ASM fixes", "Disable ASM fixes here."); - ConfigHandler.c.addCustomCategoryComment("Multiblocks", "Multliblock Options can be set here."); ConfigHandler.c.addCustomCategoryComment("Singleblocks", "Singleblock Options can be set here."); + ConfigHandler.c.addCustomCategoryComment("Multiblocks", "Multliblock Options can be set here."); ConfigHandler.c.addCustomCategoryComment("System", "Different System Settings can be set here."); ConfigHandler.c.addCustomCategoryComment("CrossMod Interactions", "CrossMod Interaction Settings can be set here. For Underground Fluid settings change the Gregtech.cfg!"); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index faf503d33f..704dc73c60 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -32,6 +32,7 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBl import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_ExperimentalFloodGate; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; import com.github.bartimaeusnek.bartworks.common.tileentities.debug.CreativeScanner; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_CircuitAssemblyLine; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_DEHP; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; @@ -135,12 +136,13 @@ public class ItemRegistry { public static ItemStack dehp; public static ItemStack thtr; public static ItemStack eic; + public static ItemStack cal; public static void run() { if (newStuff) { if (ConfigHandler.creativeScannerID != 0) - new CreativeScanner(ConfigHandler.creativeScannerID,"ZPM Creative Debug Scanner","ZPM Creative Debug Scanner",7); + new CreativeScanner(ConfigHandler.creativeScannerID,"Creative Debug Scanner","Creative Debug Scanner",20); ItemRegistry.eic = new GT_TileEntity_ElectricImplosionCompressor(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, "ElectricImplosionCompressor", "Electric Implosion Compressor").getStackForm(1L); ItemRegistry.thtr = new GT_TileEntity_THTR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, "THTR", "Thorium High Temperature Reactor").getStackForm(1L); GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials(); @@ -177,6 +179,7 @@ public class ItemRegistry { ItemRegistry.dehp = new GT_TileEntity_DEHP(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump").getStackForm(1L); ItemRegistry.megaMachines[0] = new GT_TileEntity_MegaBlastFurnace(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, "MegaBlastFurnace", StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L); ItemRegistry.megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, "MegaVacuumFreezer", StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L); + ItemRegistry.cal = new GT_TileEntity_CircuitAssemblyLine(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 7, "CircuitAssemblyLine", "Circuit Assembly Line").getStackForm(1L); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 14e8954f69..805ab0a55f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -22,21 +22,38 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; +import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_ItemStack; +import gregtech.api.metatileentity.implementations.*; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; import java.util.Collection; +import java.util.HashSet; public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBlockBase { - private NBTTagCompound type; + public String getTypeForDisplay() { + if (this.type.equals(new NBTTagCompound())) + return ""; + return GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); + } + + private NBTTagCompound type = new NBTTagCompound(); private GT_Recipe bufferedRecipe; public GT_TileEntity_CircuitAssemblyLine(int aID, String aName, String aNameRegional) { @@ -47,67 +64,214 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl super(aName); } + private boolean imprintMachine(ItemStack itemStack){ + if (!this.type.equals(new NBTTagCompound())) + return true; + if (!GT_Utility.isStackValid(itemStack)) + return false; + if (itemStack.getItem() instanceof BW_Meta_Items.BW_GT_MetaGenCircuits && itemStack.getItemDamage() == 0 && itemStack.getTagCompound() != null && this.type.equals(new NBTTagCompound())){ + this.type = itemStack.getTagCompound(); + this.mInventory[1] = null; + this.getBaseMetaTileEntity().issueBlockUpdate(); + return true; + } + return false; + } + @Override public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } - return false; + @Override + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { + super.startSoundLoop(aIndex, aX, aY, aZ); + if (aIndex == 20) { + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(212), 10, 1.0F, aX, aY, aZ); + } } @Override public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); this.type = aNBT.getCompoundTag("Type"); + super.loadNBTData(aNBT); } @Override public void saveNBTData(NBTTagCompound aNBT) { + if (!this.type.equals(new NBTTagCompound())) + aNBT.setTag("Type", this.type); super.saveNBTData(aNBT); - aNBT.setTag("Type", this.type); + } @Override public boolean checkRecipe(ItemStack itemStack) { - if (this.type == null) - return false; + if (this.type.equals(new NBTTagCompound())) + if (!this.imprintMachine(itemStack)) + return false; - if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(false,true,BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) + if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(true,false,BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) { + BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); + if (this.mEUt < 0) + this.mEUt = -this.mEUt; + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = this.bufferedRecipe.mOutputs; + this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; return true; + } ItemStack stack = ItemStack.loadItemStackFromNBT(this.type); if (stack == null) return false; - Collection recipes = null; + Collection recipes = new HashSet<>(); - for (GT_ItemStack GTitemstack : GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeItemMap.keySet()){ - if (GTitemstack.mItem.equals(stack.getItem()) && GTitemstack.mMetaData == (short) stack.getItemDamage()){ - recipes = GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeItemMap.get(GTitemstack); + for (GT_Recipe recipe : BWRecipes.instance.getMappingsFor((byte)3).mRecipeList){ + if (GT_Utility.areStacksEqual(recipe.mOutputs[0],stack,true)){ + recipes.add(recipe); break; } } - if (recipes == null || recipes.isEmpty()) + if (recipes.isEmpty()) return false; for (GT_Recipe recipe : recipes){ - if (recipe.isRecipeInputEqual(false,true,BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) + if (recipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) this.bufferedRecipe = recipe; + else + continue; + + BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); + if (this.mEUt < 0) + this.mEUt = -this.mEUt; + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = this.bufferedRecipe.mOutputs; + this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; + return true; } + return false; + } + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + int r; + int i; + IGregTechTileEntity tTileEntity; + if (xDir != 0) { + for(r = 0; r <= 7; ++r) { + i = r * xDir; + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 0, i); + if (!this.addEnergyInputToMachineList(tTileEntity, 16)) + if ((aBaseMetaTileEntity.getBlockOffset(0, 0, i) != GregTech_API.sBlockCasings3 || aBaseMetaTileEntity.getMetaIDOffset(0, 0, i) != 10) && r == 1) + return false; + if (!aBaseMetaTileEntity.getBlockOffset(0, -1, i).getUnlocalizedName().equals("blockAlloyGlass")) + return false; - return true; + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(0, -2, i); + if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16)) + if (aBaseMetaTileEntity.getBlockOffset(0, -2, i) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(0, -2, i) != 0) + return false; + + if (i != 0 && (aBaseMetaTileEntity.getBlockOffset(xDir, -1, i) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(xDir, -1, i) != 5)) + return false; + + if (!aBaseMetaTileEntity.getBlockOffset(xDir * 2, -1, i).getUnlocalizedName().equals("blockAlloyGlass")) + return false; + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir * 2, -2, i); + if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16)) + if (aBaseMetaTileEntity.getBlockOffset(xDir * 2, -2, i) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(xDir * 2, -2, i) != 0) + return false; + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, -2, i); + if (!this.addInputToMachineList(tTileEntity, 16) && this.addOutputToMachineList(tTileEntity, 16)) + return r > 0 && this.mEnergyHatches.size() > 0; + + } + } else { + + for(r = 0; r <= 7; ++r) { + i = r * -zDir; + + //top with grate and energy hatch + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, 0, zDir); + if (!this.addEnergyInputToMachineList(tTileEntity, 16)) + if ((aBaseMetaTileEntity.getBlockOffset(i, 0, 0) != GregTech_API.sBlockCasings3 || aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0) != 10) && r == 1) + return false; + + if (!aBaseMetaTileEntity.getBlockOffset(i, -1, 0).getUnlocalizedName().equals("blockAlloyGlass")) + return false; + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, 0); + if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16)) + if (aBaseMetaTileEntity.getBlockOffset(i, -2, 0) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(i, -2, 0) != 0) + return false; + + if (i != 0 && (aBaseMetaTileEntity.getBlockOffset(i, -1, zDir) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(i, -1, zDir) != 5)) + return false; + + if (!aBaseMetaTileEntity.getBlockOffset(i, -1, zDir * 2).getUnlocalizedName().equals("blockAlloyGlass")) + return false; + + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir * 2); + if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16)) + if (aBaseMetaTileEntity.getBlockOffset(i, -2, zDir * 2) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(i, -2, zDir * 2) != 0) + return false; + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir); + if (!this.addInputToMachineList(tTileEntity, 16) && this.addOutputToMachineList(tTileEntity, 16)) + return r > 0 && this.mEnergyHatches.size() == 1; + } + } + + return false; } @Override - public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return false; + public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); + return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus && ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mTier == 0) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); + return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + } else { + return false; + } + } + } + + @Override + public boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus && ((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity).mTier == 0) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus)aMetaTileEntity); + } else { + return false; + } + } } @Override public int getMaxEfficiency(ItemStack itemStack) { - return 0; + return 10000; } @Override @@ -132,11 +296,34 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl @Override public String[] getDescription() { - return new String[0]; + return new String[]{ + "Circuit Assembly Line", "Size(WxHxD): (2-7)x3x3, variable length", + "Bottom: Steel Machine Casing(or 1x Maintenance or Input Hatch),", + "ULV Input Bus (Last ULV Output Bus), Steel Machine Casing", + "Middle: Reinforced Glass, Assembling Line Casing, Reinforced Glass", + "Top: Grate Machine Casing (or Controller or 1x Energy Hatch)", + "Up to 7 repeating slices, last is Output Bus", + "Imprint this machine with a Circuit Imprint,", + "by putting the imprint in the controller.", + "Every Circuit Assembly Line can only be imprinted ONCE.", + StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks" + }; + } + + @Override + public String[] getInfoData() { + String[] ret = new String[super.getInfoData().length+1]; + ret[super.getInfoData().length] = "Imprinted with: "+ GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); + return ret; + } + + @Override + public boolean isGivingInformation() { + return true; } @Override - public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { - return new ITexture[0]; + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16]}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index 0cee76a61d..c8e755e3e4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -131,6 +131,17 @@ public class BW_Meta_Items { return ret; } + @Override + public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { + if (aCreativeTab == this.getCreativeTab()) + for (NBTTagCompound tag : CircuitImprintLoader.recipeTagMap.keySet()){ + ItemStack stack = new ItemStack(BW_Meta_Items.NEWCIRCUITS,1,0); + stack.setTagCompound(tag); + aList.add(stack); + } + super.getSubItems(var1, aCreativeTab, aList); + } + @SideOnly(Side.CLIENT) public final void registerIcons(IIconRegister aIconRegister) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index bc0c15b162..aa1470073e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -44,7 +44,7 @@ import java.util.Iterator; public class CircuitImprintLoader implements Runnable { - static final ArrayListMultimap recipeTagMap = ArrayListMultimap.create(); + public static final ArrayListMultimap recipeTagMap = ArrayListMultimap.create(); static final HashBiMap bwCircuitTagMap = HashBiMap.create(20); static final HashSet refs = new HashSet<>(); public static short reverseIDs = Short.MAX_VALUE-1; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java new file mode 100644 index 0000000000..1ed1cb0b83 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; + +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.api.util.GT_Recipe; + +import java.util.HashSet; +import java.util.Set; + +public class DownTierLoader implements Runnable { + @Override + public void run() { + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + if (map == GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes || map == GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes || map == GT_Recipe.GT_Recipe_Map.sMassFabFakeRecipes || map == GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes || map == GT_Recipe.GT_Recipe_Map.sFusionRecipes || map == GT_Recipe.GT_Recipe_Map.sRockBreakerFakeRecipes) + return; + Set newRecipes = new HashSet<>(); + Set toRem = new HashSet<>(); + for (GT_Recipe recipe : map.mRecipeList) { + if (recipe == null) + continue; + if (recipe.mEUt > 128) { + toRem.add(recipe); + newRecipes.add(BW_Util.copyAndSetTierToNewRecipe(recipe, (byte) 2)); + } + } + map.mRecipeList.removeAll(toRem); + map.mRecipeList.addAll(newRecipes); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 046c9363e4..c3dd4962be 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -63,6 +63,20 @@ public class BW_Util { return array[index]; } + public static GT_Recipe copyAndSetTierToNewRecipe(GT_Recipe recipe, byte tier){ + byte oldTier = GT_Utility.getTier(recipe.mEUt); + int newTime = recipe.mDuration; + int newVoltage = recipe.mEUt; + if (tier < oldTier) { + newTime <<= (oldTier - tier); + newVoltage >>= 2 * (oldTier - tier); + } else { + newTime >>= (tier - oldTier); + newVoltage <<= 2 * (tier - oldTier); + } + return new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, recipe.mFluidInputs, recipe.mFluidOutputs, newTime, newVoltage, recipe.mSpecialValue); + } + public static String subscriptNumbers(String b){ char[] chars = b.toCharArray(); char[] nu = new char[chars.length]; @@ -312,14 +326,14 @@ public class BW_Util { for (GT_MetaTileEntity_Hatch_Input fip : aBaseMetaTileEntity.mInputHatches){ tmp.add(fip.getFluid()); } - return (FluidStack[]) tmp.toArray(); + return tmp.toArray(new FluidStack[0]); } public static ItemStack[] getItemsFromInputBusses(GT_MetaTileEntity_MultiBlockBase aBaseMetaTileEntity){ ArrayList tmp = new ArrayList<>(); for (GT_MetaTileEntity_Hatch_InputBus fip : aBaseMetaTileEntity.mInputBusses){ tmp.addAll(Arrays.asList(fip.mInventory)); } - return (ItemStack[]) tmp.toArray(); + return tmp.toArray(new ItemStack[0]); } -- cgit From a3a672f8f5cd7b0dc13ca5db7fa2c46cb849e840 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 13 Aug 2019 03:35:42 +0200 Subject: fixed MP issues Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: bd9898031da9580de00cdc928bf90af882fe9c58 --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 26 +++++---- .../bartworks/common/net/BW_Network.java | 3 +- .../bartworks/common/net/ServerJoinedPackage.java | 64 ++++++++++++++++++++++ .../server/EventHandler/ServerEventHandler.java | 5 +- .../CircuitGeneration/CircuitImprintLoader.java | 52 +++++++++--------- .../CircuitGeneration/CircuitPartLoader.java | 3 +- .../bartimaeusnek/bartworks/util/BWRecipes.java | 3 +- 8 files changed, 115 insertions(+), 43 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java diff --git a/build.properties b/build.properties index 0cf847ee9b..dc75c235a5 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=0_pre4 +buildNumber=0_pre5 APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index fab50ec3b4..21ad4d58cc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -84,21 +84,21 @@ public final class MainMod { public static final String VERSION = "@version@"; public static final String MOD_ID = "bartworks"; public static final String APIVERSION = "@apiversion@"; - public static final Logger LOGGER = LogManager.getLogger(NAME); + public static final Logger LOGGER = LogManager.getLogger(MainMod.NAME); public static final CreativeTabs GT2 = new GT2Tab("GT2C"); public static final CreativeTabs BIO_TAB = new BioTab("BioTab"); public static final CreativeTabs BWT = new bartworksTab("bartworks"); public static final IGuiHandler GH = new GuiHandler(); - @Mod.Instance(MOD_ID) + @Mod.Instance(MainMod.MOD_ID) public static MainMod instance; public static BW_Network BW_Network_instance = new BW_Network(); @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { - if (!(API_REFERENCE.VERSION.equals(APIVERSION))) { - LOGGER.error("Something has loaded an old API. Please contact the Mod authors to update!"); + if (!(API_REFERENCE.VERSION.equals(MainMod.APIVERSION))) { + MainMod.LOGGER.error("Something has loaded an old API. Please contact the Mod authors to update!"); } //fixing BorosilicateGlass... -_-' @@ -116,7 +116,7 @@ public final class MainMod { } } if (ConfigHandler.GTNH) - LOGGER.info("GTNH-Detected . . . ACTIVATE HARDMODE."); + MainMod.LOGGER.info("GTNH-Detected . . . ACTIVATE HARDMODE."); if (ConfigHandler.BioLab) { BioCultureLoader bioCultureLoader = new BioCultureLoader(); @@ -148,7 +148,7 @@ public final class MainMod { @Mod.EventHandler public void postInit(FMLPostInitializationEvent postinit) { - NetworkRegistry.INSTANCE.registerGuiHandler(instance, GH); + NetworkRegistry.INSTANCE.registerGuiHandler(MainMod.instance, MainMod.GH); if (ConfigHandler.BioLab) new GTNHBlocks().run(); BioObjectAdder.regenerateBioFluids(); @@ -166,14 +166,18 @@ public final class MainMod { @Mod.EventHandler public void onServerStarted(FMLServerStartedEvent event) { OreDictHandler.adaptCacheForWorld(); + MainMod.runOnPlayerJoined(ConfigHandler.classicMode); + } + + public static void runOnPlayerJoined(boolean classicMode){ WerkstoffLoader.removeIC2Recipes(); - this.addElectricImplosionCompressorRecipes(); + MainMod.addElectricImplosionCompressorRecipes(); new CircuitImprintLoader().run(); - if (ConfigHandler.classicMode) + if (classicMode) new DownTierLoader().run(); } - private void addElectricImplosionCompressorRecipes() { + private static void addElectricImplosionCompressorRecipes() { if (eicMap == null) { eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList) { @@ -181,14 +185,14 @@ public final class MainMod { continue; HashSet inputs = new HashSet<>(); for (ItemStack is : recipe.mInputs) - if (!this.checkForExplosives(is)) + if (!checkForExplosives(is)) inputs.add(is); eicMap.addRecipe(true, inputs.toArray(new ItemStack[0]), recipe.mOutputs, null, null, null, recipe.mDuration, BW_Util.getMachineVoltageFromTier(10), 0); } } } - private boolean checkForExplosives(ItemStack input) { + private static boolean checkForExplosives(ItemStack input) { return (GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L)) || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index e7708253e1..bb32c7aeb4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -45,7 +45,6 @@ import net.minecraft.world.chunk.Chunk; import javax.annotation.Nonnull; import java.util.EnumMap; -import java.util.Iterator; import java.util.List; /* @@ -59,7 +58,7 @@ public class BW_Network extends MessageToMessageCodec public BW_Network() { this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", this, new BW_Network.HandlerShared()); - this.mSubChannels = new GT_Packet[]{new RendererPacket(), new CircuitProgrammerPacket(), new OrePacket(), new OreDictCachePacket()}; + this.mSubChannels = new GT_Packet[]{new RendererPacket(), new CircuitProgrammerPacket(), new OrePacket(), new OreDictCachePacket(), new ServerJoinedPackage()}; } protected void encode(ChannelHandlerContext aContext, GT_Packet aPacket, List aOutput) throws Exception { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java new file mode 100644 index 0000000000..a9b37065e4 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.net; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.google.common.io.ByteArrayDataInput; +import gregtech.api.net.GT_Packet; +import net.minecraft.world.IBlockAccess; + +public class ServerJoinedPackage extends GT_Packet { + + private boolean config; + + ServerJoinedPackage() { + super(true); + } + + public ServerJoinedPackage(Object obj) { + super(false); + this.config = ConfigHandler.classicMode; + } + + @Override + public byte getPacketID() { + return 4; + } + + @Override + public byte[] encode() { + return new byte[]{(byte) (this.config ? 1 : 0)}; + } + + @Override + public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { + this.config = byteArrayDataInput.readBoolean(); + return this; + } + + @Override + public void process(IBlockAccess iBlockAccess) { + MainMod.runOnPlayerJoined(this.config); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java index 9fc72b31cd..5c357302e7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.server.EventHandler; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.net.OreDictCachePacket; +import com.github.bartimaeusnek.bartworks.common.net.ServerJoinedPackage; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.EventPriority; @@ -32,10 +33,12 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraftforge.event.entity.EntityJoinWorldEvent; public class ServerEventHandler { + @SubscribeEvent(priority = EventPriority.LOWEST) - public void getTooltip(EntityJoinWorldEvent event) { + public void EntityJoinWorldEvent(EntityJoinWorldEvent event) { if (event == null || !(event.entity instanceof EntityPlayerMP) || !FMLCommonHandler.instance().getSide().isServer()) return; MainMod.BW_Network_instance.sendToPlayer(new OreDictCachePacket(OreDictHandler.getNonBWCache()), (EntityPlayerMP) event.entity); + MainMod.BW_Network_instance.sendToPlayer(new ServerJoinedPackage(null),(EntityPlayerMP) event.entity); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index aa1470073e..4a3421a51d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -107,8 +107,9 @@ public class CircuitImprintLoader implements Runnable { GT_Recipe newRecipe = original.copy(); for (ItemStack is : newRecipe.mInputs){ int[] oreIDs = OreDictionary.getOreIDs(is); - if(oreIDs == null || oreIDs.length < 1 || !OreDictionary.getOreName(oreIDs[0]).contains("circuit")) - is.stackSize = Math.max( 64, is.stackSize *= 4); + if(oreIDs == null || oreIDs.length < 1 || !OreDictionary.getOreName(oreIDs[0]).contains("circuit")) { + is.stackSize = Math.max(64, is.stackSize*4); + } } newRecipe.mFluidInputs[0].amount *= 4; newRecipe.mDuration *= 4; @@ -117,39 +118,38 @@ public class CircuitImprintLoader implements Runnable { public static GT_Recipe reBuildRecipe(GT_Recipe original){ ItemStack out = original.copy().getOutput(0); - out.stackSize = 16; + out.stackSize *= 16; ItemStack[] in = new ItemStack[6]; BiMap inversed = CircuitImprintLoader.circuitIIconRefs.inverse(); for (int i = 0; i < 6; i++) { try { - for (ItemList il : inversed.keySet()){ + for (ItemList il : inversed.keySet()){ if (GT_Utility.areStacksEqual(il.get(1), original.mInputs[i])) { in[i] = BW_Meta_Items.getNEWCIRCUITS().getStack(inversed.get(il), original.mInputs[i].stackSize); } - } - if (original.mInputs[i] != null && in[i] == null){ - if (BW_Util.checkStackAndPrefix(original.mInputs[i]) && GT_OreDictUnificator.getAssociation(original.mInputs[i]).mPrefix == OrePrefixes.wireGt01){ - in[i] = GT_OreDictUnificator.get(OrePrefixes.wireGt16,GT_OreDictUnificator.getAssociation(original.mInputs[i]).mMaterial.mMaterial,original.mInputs[i].stackSize); - } - else { - in[i] = original.mInputs[i].copy(); - in[i].stackSize *= 16; - } -// if (in[i].stackSize > 64) -// return null; - } - } catch (ArrayIndexOutOfBoundsException e){ - break; - } catch (NullPointerException e){ - e.printStackTrace(); - } - } - if (CircuitImprintLoader.checkForBlacklistedComponents(in)){ + } + if (original.mInputs[i] != null && in[i] == null){ + if (BW_Util.checkStackAndPrefix(original.mInputs[i]) && GT_OreDictUnificator.getAssociation(original.mInputs[i]).mPrefix == OrePrefixes.wireGt01){ + in[i] = GT_OreDictUnificator.get(OrePrefixes.wireGt16,GT_OreDictUnificator.getAssociation(original.mInputs[i]).mMaterial.mMaterial,original.mInputs[i].stackSize); + } + else { + in[i] = original.mInputs[i].copy(); + in[i].stackSize *= 16; + } +// if (in[i].stackSize > 64) +// return null; + } + } catch (ArrayIndexOutOfBoundsException e){ + break; + } catch (NullPointerException e){ + e.printStackTrace(); + } + } + if (CircuitImprintLoader.checkForBlacklistedComponents(in)){ return null; - } - - return new BWRecipes.DynamicGTRecipe(false,in,new ItemStack[]{out},BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]),0,0),null, original.mFluidInputs,null,original.mDuration,original.mEUt,original.mSpecialValue); + } + return new BWRecipes.DynamicGTRecipe(false,in,new ItemStack[]{out},BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]),0,0),null, original.mFluidInputs,null,original.mDuration,original.mEUt,original.mSpecialValue); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index 7bec3e9213..4c754e4caf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -86,7 +86,8 @@ public class CircuitPartLoader implements Runnable { name = OreDictionary.getOreName(oreIDS[0]); if ((name == null || name.isEmpty()) && (single.toString().contains("Circuit") || single.toString().contains("circuit") || single.toString().contains("board")) && single.getBlock() == Blocks.air) { ArrayList toolTip = new ArrayList<>(); - single.getItem().addInformation(single.get(1).copy(), null, toolTip, true); + if (FMLCommonHandler.instance().getEffectiveSide().isClient()) + single.getItem().addInformation(single.get(1).copy(), null, toolTip, true); String tt = (toolTip.size() > 0 ? toolTip.get(0) : ""); // tt += "Internal Name = "+single; String localised = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index e6c83a7f76..be9f710991 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -47,6 +47,7 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import javax.annotation.Nonnegative; +import java.io.Serializable; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -495,7 +496,7 @@ public class BWRecipes { return false; } - public static class DynamicGTRecipe extends GT_Recipe { + public static class DynamicGTRecipe extends GT_Recipe implements Serializable { public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); } -- cgit From 11cb4d041b3364bca9ff5e69e265047b9f928fc1 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 15 Aug 2019 06:21:26 +0200 Subject: added pngs to circuit assembly line parts +fixed part recipes +hide trash from nei Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 28aa41372e52886f7f8ce08e8452fabc440ebb14 --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 2 +- .../CircuitGeneration/CircuitImprintLoader.java | 13 +++- .../bartimaeusnek/bartworks/util/BWRecipes.java | 77 ++++++++++++++++++++- .../bartworks/util/NEIbartworksConfig.java | 21 ++++++ .../textures/items/gt.bwMetaGeneratedItem0/0.png | Bin 0 -> 606 bytes .../textures/items/gt.bwMetaGeneratedItem0/1.png | Bin 0 -> 375 bytes .../textures/items/gt.bwMetaGeneratedItem0/2.png | Bin 0 -> 396 bytes .../textures/items/gt.bwMetaGeneratedItem0/3.png | Bin 0 -> 245 bytes 9 files changed, 107 insertions(+), 8 deletions(-) create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/0.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/1.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/2.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/3.png diff --git a/build.properties b/build.properties index dc75c235a5..e046d77987 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=0_pre5 +buildNumber=0_pre6 APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 21ad4d58cc..068a28b906 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -165,11 +165,11 @@ public final class MainMod { } @Mod.EventHandler public void onServerStarted(FMLServerStartedEvent event) { - OreDictHandler.adaptCacheForWorld(); MainMod.runOnPlayerJoined(ConfigHandler.classicMode); } public static void runOnPlayerJoined(boolean classicMode){ + OreDictHandler.adaptCacheForWorld(); WerkstoffLoader.removeIC2Recipes(); MainMod.addElectricImplosionCompressorRecipes(); new CircuitImprintLoader().run(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 4a3421a51d..999711e3fe 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; +import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -175,14 +176,20 @@ public class CircuitImprintLoader implements Runnable { eut = Math.min(eut,BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName(OreDictionary.getOreIDs(stack)[0])))); GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300,eut,BW_Util.CLEANROOM); GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); - GT_ModHandler.addCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1),GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS ,new Object[]{ + GameRegistry.addRecipe(new BWRecipes.BWNBTDependantCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), " X ", "GPG", " X ", 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), - 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3) - }); + 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3))); + GT_ModHandler.addCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{ + " X ", + "GPG", + " X ", + 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), + 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), + 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3)}); } // for (NBTTagCompound tag : CircuitImprintLoader.bwCircuitTagMap.values()){ // CircuitData data = CircuitImprintLoader.bwCircuitTagMap.inverse().get(tag); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index be9f710991..3d31641d79 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -40,17 +40,21 @@ import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; import ic2.core.Ic2Items; import ic2.core.item.ItemFluidCell; +import net.minecraft.block.Block; import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.StatCollector; +import net.minecraft.world.World; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.ShapedOreRecipe; import javax.annotation.Nonnegative; import java.io.Serializable; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; +import java.util.*; import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; import static com.github.bartimaeusnek.bartworks.util.BW_Util.specialToByte; @@ -657,4 +661,71 @@ public class BWRecipes { return null; } } + + public static class BWNBTDependantCraftingRecipe implements IRecipe { + + ItemStack result; + Map charToStackMap = new HashMap<>(9,1); + String[] shape; + + public BWNBTDependantCraftingRecipe(ItemStack result, Object... recipe) { + this.result = result; + this.shape = new String[3]; + System.arraycopy(recipe,0, this.shape,0,3); + this.charToStackMap.put(' ', null); + for (int i = 3; i < recipe.length; i+=2) { + this.charToStackMap.put((char)recipe[i],((ItemStack)recipe[i+1]).copy()); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof BWRecipes.BWNBTDependantCraftingRecipe)) return false; + + BWRecipes.BWNBTDependantCraftingRecipe that = (BWRecipes.BWNBTDependantCraftingRecipe) o; + + if (!Objects.equals(this.result, that.result)) return false; + if (!Objects.equals(this.charToStackMap, that.charToStackMap)) + return false; + // Probably incorrect - comparing Object[] arrays with Arrays.equals + return Arrays.equals(this.shape, that.shape); + } + + @Override + public int hashCode() { + int result1 = this.result != null ? this.result.hashCode() : 0; + result1 = 31 * result1 + (this.charToStackMap != null ? this.charToStackMap.hashCode() : 0); + result1 = 31 * result1 + Arrays.hashCode(this.shape); + return result1; + } + + @Override + public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) { + for (int x = 0; x < 3; x++) { + for (int y = 0; y < 3; y++) { + ItemStack toCheck = p_77569_1_.getStackInRowAndColumn(y,x); + ItemStack ref = this.charToStackMap.get(this.shape[x].toCharArray()[y]); + if (!BW_Util.areStacksEqualOrNull(toCheck,ref)) + return false; + } + } + return true; + } + + @Override + public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) { + return this.result.copy(); + } + + @Override + public int getRecipeSize() { + return 10; + } + + @Override + public ItemStack getRecipeOutput() { + return this.result; + } + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java index de262fd73d..5a8af015ef 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java @@ -27,9 +27,12 @@ import codechicken.nei.api.IConfigureNEI; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import cpw.mods.fml.common.Optional; +import gregtech.api.enums.OrePrefixes; import net.minecraft.item.ItemStack; + @Optional.Interface(iface = "codechicken.nei.api.API", modid = "NotEnoughItems") public class NEIbartworksConfig implements IConfigureNEI { @@ -51,5 +54,23 @@ public class NEIbartworksConfig implements IConfigureNEI { API.hideItem(new ItemStack(ItemRegistry.TAB)); API.hideItem(new ItemStack(FluidLoader.bioFluidBlock)); API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses)); + ItemStack[] prefixesToHide = { + WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.dustTiny, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.dustSmall, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.crushed, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.crushedPurified, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.crushedCentrifuged, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.nugget, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.gemChipped, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.gemFlawed, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.gemFlawless, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.gemExquisite, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.dustImpure, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.dustPure, WerkstoffLoader.Bismutite).copy(), + }; + for (ItemStack stack : prefixesToHide) { + stack.setItemDamage(Short.MAX_VALUE); + API.hideItem(stack); + } } } \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/0.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/0.png new file mode 100644 index 0000000000..c597cc08ae Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/0.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/1.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/1.png new file mode 100644 index 0000000000..f2ec0dcb97 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/1.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/2.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/2.png new file mode 100644 index 0000000000..43291b873a Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/2.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/3.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/3.png new file mode 100644 index 0000000000..7987d1fff6 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/3.png differ -- cgit From 4c6858c45f178ff2aa0cb5a74947e90fa5540ca9 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 17 Aug 2019 13:31:45 +0200 Subject: fixed CircuitAssemblyLine +added Gas +started on fluid generation +started on forced re-unification +worked on TileEntity_GTDataServer Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: c9328571559451e83d31e56d17cdb07fd9e5e008 --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 14 +-- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 25 ++-- .../server/EventHandler/ServerEventHandler.java | 27 +++++ .../system/material/BWUnificationEnforcer.java | 48 ++++++++ .../system/material/BW_MetaGenerated_Items.java | 6 +- .../bartworks/system/material/Werkstoff.java | 54 ++++++--- .../bartworks/system/material/WerkstoffLoader.java | 73 +++++++---- .../bartworks/util/NEIbartworksConfig.java | 24 ++-- .../crossmod/openComputers/GT_NBT_DataBase.java | 24 +++- .../openComputers/TileEntity_GTDataServer.java | 135 ++++++++++++++++++--- 11 files changed, 336 insertions(+), 96 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BWUnificationEnforcer.java diff --git a/build.properties b/build.properties index e046d77987..a57697dccb 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=0_pre6 +buildNumber=0_pre7 APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 068a28b906..d1b2935cf3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -45,10 +45,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; +import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; import gregtech.api.GregTech_API; @@ -133,8 +130,11 @@ public final class MainMod { public void init(FMLInitializationEvent init) { if (FMLCommonHandler.instance().getSide().isClient() && ConfigHandler.tooltips) MinecraftForge.EVENT_BUS.register(new TooltipEventHandler()); - if (FMLCommonHandler.instance().getSide().isServer()) - MinecraftForge.EVENT_BUS.register(new ServerEventHandler()); + if (FMLCommonHandler.instance().getSide().isServer()) { + ServerEventHandler serverEventHandler = new ServerEventHandler(); + MinecraftForge.EVENT_BUS.register(serverEventHandler); +// FMLCommonHandler.instance().bus().register(serverEventHandler); + } new LoaderRegistry().run(); if (ConfigHandler.BioLab) new BioLabLoader().run(); @@ -185,7 +185,7 @@ public final class MainMod { continue; HashSet inputs = new HashSet<>(); for (ItemStack is : recipe.mInputs) - if (!checkForExplosives(is)) + if (!MainMod.checkForExplosives(is)) inputs.add(is); eicMap.addRecipe(true, inputs.toArray(new ItemStack[0]), recipe.mOutputs, null, null, null, recipe.mDuration, BW_Util.getMachineVoltageFromTier(10), 0); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 805ab0a55f..1db2ae5c15 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -105,6 +105,8 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl } + private final Collection GT_RECIPE_COLLECTION = new HashSet<>(); + @Override public boolean checkRecipe(ItemStack itemStack) { if (this.type.equals(new NBTTagCompound())) @@ -113,11 +115,12 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(true,false,BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) { BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); - if (this.mEUt < 0) + if (this.mEUt > 0) this.mEUt = -this.mEUt; this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = this.bufferedRecipe.mOutputs; this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; + this.updateSlots(); return true; } @@ -126,30 +129,27 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl if (stack == null) return false; - Collection recipes = new HashSet<>(); - - for (GT_Recipe recipe : BWRecipes.instance.getMappingsFor((byte)3).mRecipeList){ - if (GT_Utility.areStacksEqual(recipe.mOutputs[0],stack,true)){ - recipes.add(recipe); - break; + if (this.GT_RECIPE_COLLECTION.isEmpty()) { + for (GT_Recipe recipe : BWRecipes.instance.getMappingsFor((byte) 3).mRecipeList) { + if (GT_Utility.areStacksEqual(recipe.mOutputs[0], stack, true)) { + this.GT_RECIPE_COLLECTION.add(recipe); + } } } - if (recipes.isEmpty()) - return false; - - for (GT_Recipe recipe : recipes){ + for (GT_Recipe recipe : this.GT_RECIPE_COLLECTION) { if (recipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) this.bufferedRecipe = recipe; else continue; BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); - if (this.mEUt < 0) + if (this.mEUt > 0) this.mEUt = -this.mEUt; this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = this.bufferedRecipe.mOutputs; this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; + this.updateSlots(); return true; } return false; @@ -313,6 +313,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl @Override public String[] getInfoData() { String[] ret = new String[super.getInfoData().length+1]; + System.arraycopy(super.getInfoData(),0,ret,0,super.getInfoData().length); ret[super.getInfoData().length] = "Imprinted with: "+ GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java index 5c357302e7..493a06bd11 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java @@ -25,12 +25,19 @@ package com.github.bartimaeusnek.bartworks.server.EventHandler; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.net.OreDictCachePacket; import com.github.bartimaeusnek.bartworks.common.net.ServerJoinedPackage; +import com.github.bartimaeusnek.bartworks.system.material.BWUnificationEnforcer; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; +import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.ArrayList; public class ServerEventHandler { @@ -41,4 +48,24 @@ public class ServerEventHandler { MainMod.BW_Network_instance.sendToPlayer(new OreDictCachePacket(OreDictHandler.getNonBWCache()), (EntityPlayerMP) event.entity); MainMod.BW_Network_instance.sendToPlayer(new ServerJoinedPackage(null),(EntityPlayerMP) event.entity); } + +// @SubscribeEvent(priority = EventPriority.HIGHEST) +// public void onPlayerTickEventServer(TickEvent.PlayerTickEvent event) { +// if (!BWUnificationEnforcer.isEnabled() || event == null || !(event.player instanceof EntityPlayerMP) || !FMLCommonHandler.instance().getSide().isServer()) +// return; +// +// for (int i = 0; i < event.player.inventory.mainInventory.length; i++) { +// ItemStack stack = event.player.inventory.mainInventory[i]; +// for (int id : OreDictionary.getOreIDs(stack)) +// if (BWUnificationEnforcer.getUnificationTargets().contains(OreDictionary.getOreName(id))){ +// ArrayList stacks = OreDictionary.getOres(OreDictionary.getOreName(id)); +// for (int j = 0; j < stacks.size(); j++) { +// GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(stacks.get(j).getItem()); +// if (UI.modId.equals(MainMod.MOD_ID)){ +// event.player.inventory.mainInventory[i] = stacks.get(j).copy().splitStack(stack.stackSize); +// } +// } +// } +// } +// } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BWUnificationEnforcer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BWUnificationEnforcer.java new file mode 100644 index 0000000000..784459f25e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BWUnificationEnforcer.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import net.minecraftforge.oredict.OreDictionary; + +import java.util.HashSet; + +public class BWUnificationEnforcer { + private static boolean enabled; + private static final HashSet UNIFICATION_TARGETS = new HashSet<>(); + public static boolean isEnabled() { + return BWUnificationEnforcer.enabled; + } + + public static HashSet getUnificationTargets() { + return BWUnificationEnforcer.UNIFICATION_TARGETS; + } + + public static void addUnificationTarget(String aOreDictName){ + if (aOreDictName == null || aOreDictName.isEmpty() || !OreDictionary.doesOreNameExist(aOreDictName)) + return; + BWUnificationEnforcer.UNIFICATION_TARGETS.add(aOreDictName); + BWUnificationEnforcer.enabled = true; + } + + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 7baa3c7090..b3e8417ceb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -100,7 +100,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { - aItemEntity.setEntityItemStack(WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.dust, aMaterial, aItemEntity.getEntityItem().stackSize)); + aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dust, aMaterial, aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } @@ -108,7 +108,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { - aItemEntity.setEntityItemStack(WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.crushedPurified, aMaterial, aItemEntity.getEntityItem().stackSize)); + aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, aMaterial, aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } @@ -143,7 +143,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public final IIconContainer getIconContainer(int aMetaData) { - return werkstoffHashMap.get((short) aMetaData) == null ? null : werkstoffHashMap.get((short) aMetaData).getTexSet().mTextures[this.orePrefixes.mTextureIndex]; + return werkstoffHashMap.get((short) aMetaData) == null ? null : this.orePrefixes.mTextureIndex == -1 ? null : werkstoffHashMap.get((short) aMetaData).getTexSet().mTextures[this.orePrefixes.mTextureIndex]; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 24af0547a7..dbb42d004d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -154,11 +154,14 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.texSet = texSet; - if (this.getStats().meltingPoint > 0) { + if (this.getStats().meltingPoint > 0 && !this.getStats().isGas()) { this.fluid = new GT_Fluid("molten" + this.getDefaultName().replaceAll(" ", ""), "molten.autogenerated", this.getRGBA()); this.getGenerationFeatures().toGenerate |= 16; } - + if (this.getGenerationFeatures().enforceUnification) { + for (OrePrefixes prefix : OrePrefixes.values()) + BWUnificationEnforcer.addUnificationTarget(prefix+this.getDefaultName()); + } Werkstoff.werkstoffHashSet.add(this); Werkstoff.werkstoffHashMap.put(this.mID, this); } @@ -241,7 +244,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (o == null||o.equals(Werkstoff.default_null_Werkstoff) || o.equals(Materials._NULL)) return this.get(prefixes); if (o instanceof Werkstoff) - return WerkstoffLoader.getCorresopndingItemStack(prefixes, (Werkstoff) o); + return WerkstoffLoader.getCorrespondingItemStack(prefixes, (Werkstoff) o); if (o instanceof Materials) return GT_OreDictUnificator.get(prefixes, o, 1L); return null; @@ -304,11 +307,11 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public ItemStack get(OrePrefixes prefixes) { - return WerkstoffLoader.getCorresopndingItemStack(prefixes, this); + return WerkstoffLoader.getCorrespondingItemStack(prefixes, this); } public ItemStack get(OrePrefixes prefixes, int amount) { - return WerkstoffLoader.getCorresopndingItemStack(prefixes, this, amount); + return WerkstoffLoader.getCorrespondingItemStack(prefixes, this, amount); } public enum Types { @@ -339,6 +342,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public byte toGenerate = 0b0001001; public byte blacklist; + public boolean enforceUnification; + /* * Auto add Chemical Recipes 1 * Auto add mixer Recipes 10 @@ -364,6 +369,11 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return (this.toGenerate & 0b1000) != 0; } + public Werkstoff.GenerationFeatures enforceUnification(){ + this.enforceUnification = true; + return this; + } + public Werkstoff.GenerationFeatures removeGems(){ if (this.hasGems()) this.toGenerate = (byte) (this.toGenerate ^ 0b100); @@ -420,6 +430,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.toGenerate = (byte) (0); return this; } + public Werkstoff.GenerationFeatures addCells() { + this.toGenerate = (byte) (this.toGenerate | 0b10000); + return this; + } public Werkstoff.GenerationFeatures addGems() { this.toGenerate = (byte) (this.toGenerate | 0x4); @@ -459,7 +473,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { long mass; private Pair[] mTC_Aspects; //logic gate shit - byte quality = ~0b111111; + byte quality = ~0b1111111; public Werkstoff.Stats setmTC_AspectsArray(Pair[] mTC_Aspects) { this.mTC_Aspects = mTC_Aspects; @@ -514,7 +528,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (sublimation) this.quality = (byte) (this.quality | 0b000001); else - this.quality = (byte) (this.quality & 0b111110); + this.quality = (byte) (this.quality & 0b1111110); return this; } @@ -526,7 +540,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (toxic) this.quality = (byte) (this.quality | 0b000010); else - this.quality = (byte) (this.quality & 0b111101); + this.quality = (byte) (this.quality & 0b1111101); return this; } @@ -538,7 +552,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (radioactive) this.quality = (byte) (this.quality | 0b000100); else - this.quality = (byte) (this.quality & 0b111011); + this.quality = (byte) (this.quality & 0b1111011); return this; } @@ -550,7 +564,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (blastFurnace) this.quality = (byte) (this.quality | 0b001000); else - this.quality = (byte) (this.quality & 0b110111); + this.quality = (byte) (this.quality & 0b1110111); return this; } @@ -560,9 +574,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public Werkstoff.Stats setElektrolysis(boolean elektrolysis) { if (elektrolysis) - this.quality = (byte) (this.quality | 0b010000); + this.quality = (byte) (this.quality | 0x10); else - this.quality = (byte) (this.quality & 0b101111); + this.quality = (byte) (this.quality & 0b1101111); return this; } @@ -572,9 +586,21 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public Werkstoff.Stats setCentrifuge(boolean centrifuge) { if (centrifuge) - this.quality = (byte) (this.quality | 0b100000); + this.quality = (byte) (this.quality | 0x20); + else + this.quality = (byte) (this.quality & 0b1011111); + return this; + } + + public boolean isGas() { + return (this.quality >> 6 & 0b1) == 0b1; + } + + public Werkstoff.Stats setGas(boolean gas) { + if (gas) + this.quality = (byte) (this.quality | 0x40); else - this.quality = (byte) (this.quality & 0b011111); + this.quality = (byte) (this.quality & 0b0111111); return this; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index d3175f967c..4fcf361c9d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -24,7 +24,6 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.API.WerkstoffAdderRegistry; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.client.renderer.BW_GT_ItemRenderer; import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; @@ -44,6 +43,7 @@ import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.objects.GT_Fluid; import gregtech.api.objects.GT_MultiTexture; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_LanguageManager; @@ -57,6 +57,7 @@ import ic2.api.recipe.Recipes; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; @@ -544,16 +545,29 @@ public class WerkstoffLoader implements Runnable { new Pair<>(WerkstoffLoader.CubicZirconia,1), new Pair<>(Materials.SteelMagnetic,1) ); +// public static final Werkstoff Xenon = new Werkstoff( +// new short[]{0x14,0x39,0x7F,0}, +// "Xenon", +// "Xe", +// new Werkstoff.Stats().setProtons(54).setGas(true), +// Werkstoff.Types.ELEMENT, +// new Werkstoff.GenerationFeatures().disable().addCells(), +// 37, +// TextureSet.SET_FLUID +// //No Byproducts +// //No Ingridients +// ); public static HashMap items = new HashMap<>(); + public static HashMap fluids = new HashMap<>(); public static Block BWOres; public boolean registered; - public static ItemStack getCorresopndingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff) { - return WerkstoffLoader.getCorresopndingItemStack(orePrefixes, werkstoff, 1); + public static ItemStack getCorrespondingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff) { + return WerkstoffLoader.getCorrespondingItemStack(orePrefixes, werkstoff, 1); } - public static ItemStack getCorresopndingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { + public static ItemStack getCorrespondingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { ItemStack ret = OreDictHandler.getItemStack(werkstoff.getDefaultName(),orePrefixes,amount); if (ret != null) return ret; @@ -646,8 +660,12 @@ public class WerkstoffLoader implements Runnable { public static int toGenerateGlobal; private void addItemsForGeneration() { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000) != 0 && FluidRegistry.isFluidRegistered(werkstoff.getDefaultName())){ + DebugLog.log("Adding new Fluid: "+werkstoff.getDefaultName()); + WerkstoffLoader.fluids.put(werkstoff, (GT_Fluid) new GT_Fluid(werkstoff.getDefaultName(),"molten.autogenerated",werkstoff.getRGBA()).setGaseous(werkstoff.getStats().isGas())); + } for (OrePrefixes p : values()) - if ((werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(),p,1) != null) { + if (!werkstoff.getGenerationFeatures().enforceUnification && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(),p,1) != null) { MainMod.LOGGER.info("Found: "+(p+werkstoff.getDefaultName().replaceAll(" ",""))+" in oreDict, disable and reroute my Items to that, also add a Tooltip."); werkstoff.getGenerationFeatures().setBlacklist(p); } @@ -683,8 +701,11 @@ public class WerkstoffLoader implements Runnable { } if ((WerkstoffLoader.toGenerateGlobal & 0b10000) != 0) { WerkstoffLoader.items.put(cell, new BW_MetaGenerated_Items(cell)); - WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle)); - WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); + // WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle)); + // WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); + } + if ((WerkstoffLoader.toGenerateGlobal & 0b100000) != 0) { + WerkstoffLoader.items.put(cellPlasma, new BW_MetaGenerated_Items(cellPlasma)); } } @@ -746,14 +767,14 @@ public class WerkstoffLoader implements Runnable { if (werkstoff.getGenerationFeatures().hasSifterRecipes() || ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0)) { GT_Values.RA.addSifterRecipe( - WerkstoffLoader.getCorresopndingItemStack(crushedPurified, werkstoff), + WerkstoffLoader.getCorrespondingItemStack(crushedPurified, werkstoff), new ItemStack[]{ - WerkstoffLoader.getCorresopndingItemStack(gemExquisite, werkstoff), - WerkstoffLoader.getCorresopndingItemStack(gemFlawless, werkstoff), - WerkstoffLoader.getCorresopndingItemStack(gem, werkstoff), - WerkstoffLoader.getCorresopndingItemStack(gemFlawed, werkstoff), - WerkstoffLoader.getCorresopndingItemStack(gemChipped, werkstoff), - WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff) + WerkstoffLoader.getCorrespondingItemStack(gemExquisite, werkstoff), + WerkstoffLoader.getCorrespondingItemStack(gemFlawless, werkstoff), + WerkstoffLoader.getCorrespondingItemStack(gem, werkstoff), + WerkstoffLoader.getCorrespondingItemStack(gemFlawed, werkstoff), + WerkstoffLoader.getCorrespondingItemStack(gemChipped, werkstoff), + WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff) }, new int[]{ 200, 1000, 2500, 2000, 4000, 5000 @@ -855,7 +876,7 @@ public class WerkstoffLoader implements Runnable { } } } - ItemStack input = WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff); + ItemStack input = WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff); input.stackSize = werkstoff.getContents().getKey(); if (werkstoff.getStats().isElektrolysis()) GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); @@ -873,24 +894,24 @@ public class WerkstoffLoader implements Runnable { } } - GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff), new Object[]{ + GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff), new Object[]{ "TTT","TTT","TTT",'T', - WerkstoffLoader.getCorresopndingItemStack(dustTiny, werkstoff) + WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff) }); - GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff), new Object[]{ + GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff), new Object[]{ "TT ","TT ",'T', - WerkstoffLoader.getCorresopndingItemStack(dustSmall, werkstoff) + WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff) }); - GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorresopndingItemStack(dustSmall, werkstoff, 4), new Object[]{ - " T ", 'T', WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff) + GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff, 4), new Object[]{ + " T ", 'T', WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff) }); - GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorresopndingItemStack(dustTiny, werkstoff, 9), new Object[]{ - "T ", 'T', WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff) + GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff, 9), new Object[]{ + "T ", 'T', WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff) }); if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 && !werkstoff.getStats().isBlastFurnace()) { - GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff), WerkstoffLoader.getCorresopndingItemStack(ingot, werkstoff)); - GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorresopndingItemStack(dustTiny, werkstoff), WerkstoffLoader.getCorresopndingItemStack(nugget, werkstoff)); + GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff), WerkstoffLoader.getCorrespondingItemStack(ingot, werkstoff)); + GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff), WerkstoffLoader.getCorrespondingItemStack(nugget, werkstoff)); } if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0){ GT_ModHandler.addPulverisationRecipe(werkstoff.get(ingot),werkstoff.get(dust)); @@ -901,7 +922,7 @@ public class WerkstoffLoader implements Runnable { private void addOreRecipes(Werkstoff werkstoff) { if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 &&!werkstoff.getStats().isBlastFurnace()) - GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorresopndingItemStack(ore, werkstoff), WerkstoffLoader.getCorresopndingItemStack(ingot, werkstoff)); + GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), WerkstoffLoader.getCorrespondingItemStack(ingot, werkstoff)); if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0) { GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ore), werkstoff.getGenerationFeatures().hasGems() ? werkstoff.get(gem) : werkstoff.get(crushed), 16, 10); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java index 5a8af015ef..d37f3f0661 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java @@ -55,18 +55,18 @@ public class NEIbartworksConfig implements IConfigureNEI { API.hideItem(new ItemStack(FluidLoader.bioFluidBlock)); API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses)); ItemStack[] prefixesToHide = { - WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.dustTiny, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.dustSmall, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.crushed, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.crushedPurified, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.crushedCentrifuged, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.nugget, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.gemChipped, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.gemFlawed, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.gemFlawless, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.gemExquisite, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.dustImpure, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorresopndingItemStack(OrePrefixes.dustPure, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustTiny, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustSmall, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushed, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedCentrifuged, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.nugget, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemChipped, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawed, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawless, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemExquisite, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustImpure, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustPure, WerkstoffLoader.Bismutite).copy(), }; for (ItemStack stack : prefixesToHide) { stack.setItemDamage(Short.MAX_VALUE); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java index b32385e29d..7db0ab7bb5 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java @@ -22,13 +22,14 @@ package com.github.bartimaeusnek.crossmod.openComputers; +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; import net.minecraft.nbt.NBTTagCompound; -import java.util.HashMap; - public class GT_NBT_DataBase { - private static final HashMap tagToIdMap = new HashMap<>(); + private static final BiMap tagIdBiMap = HashBiMap.create(); + private static final BiMap GTNBTBIMAP = HashBiMap.create(); private static long maxID = Long.MIN_VALUE+1; @@ -43,12 +44,25 @@ public class GT_NBT_DataBase { this.mDataTitle = mDataTitle; this.tagCompound = tagCompound; this.id = GT_NBT_DataBase.maxID; - GT_NBT_DataBase.tagToIdMap.put(tagCompound, this.id); + GT_NBT_DataBase.tagIdBiMap.put(tagCompound, this.id); + GT_NBT_DataBase.GTNBTBIMAP.put(this,this.id); ++GT_NBT_DataBase.maxID; } + static GT_NBT_DataBase getGTTagFromId(Long id){ + return GT_NBT_DataBase.GTNBTBIMAP.inverse().get(id); + } + + static Long getIdFromGTTag(GT_NBT_DataBase tagCompound){ + return GT_NBT_DataBase.GTNBTBIMAP.get(tagCompound); + } + + static NBTTagCompound getTagFromId(Long id){ + return GT_NBT_DataBase.tagIdBiMap.inverse().get(id); + } + static Long getIdFromTag(NBTTagCompound tagCompound){ - return GT_NBT_DataBase.tagToIdMap.get(tagCompound); + return GT_NBT_DataBase.tagIdBiMap.get(tagCompound); } public NBTTagCompound getTagCompound() { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java index 9f7c593084..78251dac89 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java @@ -25,41 +25,61 @@ package com.github.bartimaeusnek.crossmod.openComputers; import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Optional; import gregtech.api.enums.ItemList; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; +import li.cil.oc.api.machine.Arguments; +import li.cil.oc.api.machine.Callback; +import li.cil.oc.api.machine.Context; +import li.cil.oc.api.network.SimpleComponent; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; -//@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers") -public class TileEntity_GTDataServer extends TileEntity implements ITileWithGUI, ITileAddsInformation, ITileHasDifferentTextureSides/*, SimpleComponent*/ { +@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers") +public class TileEntity_GTDataServer extends TileEntity implements ISidedInventory, ITileWithGUI, ITileAddsInformation, ITileHasDifferentTextureSides, SimpleComponent { - private static final HashMap OrbDataBase = new HashMap<>(); + private final BiMap OrbDataBase = HashBiMap.create(); - private final ItemStack[] mItems = new ItemStack[2]; - - + private ItemStack[] mItems = new ItemStack[2]; private byte TickTimer; + @Optional.Method(modid = "OpenComputers") public String getComponentName() { return "GT-Data Server"; } -// @Callback -// @Optional.Method(modid = "OpenComputers") -// public Object[] listData(Context context, Arguments args) { -// return new String[] -// } + @Optional.Method(modid = "OpenComputers") + @Callback + public Object[] listData(Context context, Arguments args) { + Set ret = new HashSet<>(); + for (Map.Entry entry : OrbDataBase.entrySet()){ + ret.add((entry.getValue().getId()+Long.MAX_VALUE)+". "+entry.getValue().getmDataTitle()); + } + return ret.toArray(new String[0]); + } + + @Optional.Method(modid = "OpenComputers") + @Callback + public Object[] imprintOrb(Context context, Arguments args) { + return new Object[]{false}; + } + private boolean isServerSide(){ return !this.worldObj.isRemote || FMLCommonHandler.instance().getSide().isServer(); } - - + @Override public void updateEntity() { if (this.TickTimer++ % 20 != 0) @@ -69,7 +89,7 @@ public class TileEntity_GTDataServer extends TileEntity implements ITileWithGUI, if (GT_Utility.areStacksEqual(this.mItems[0],ItemList.Tool_DataOrb.get(1))) { if (this.mItems[0].hasTagCompound()) { if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) { - TileEntity_GTDataServer.OrbDataBase.put( + this.OrbDataBase.put( GT_NBT_DataBase.getMaxID(), new GT_NBT_DataBase( Behaviour_DataOrb.getDataName(this.mItems[0]), @@ -77,6 +97,9 @@ public class TileEntity_GTDataServer extends TileEntity implements ITileWithGUI, this.mItems[0].getTagCompound() ) ); + } else { + long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()); + this.OrbDataBase.put(id,GT_NBT_DataBase.getGTTagFromId(id)); } } } @@ -91,7 +114,7 @@ public class TileEntity_GTDataServer extends TileEntity implements ITileWithGUI, String title = data == 1 ? bookTitle : data == 2 ? punchcardData : data == 3 ? ""+mapID : "Custom Data"; String name = data == 1 ? "eBook" : data == 2 ? "Punch Card Data" : data == 3 ? "Map Data" : "Custom Data"; if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) { - TileEntity_GTDataServer.OrbDataBase.put( + this.OrbDataBase.put( GT_NBT_DataBase.getMaxID(), new GT_NBT_DataBase( name, @@ -99,6 +122,9 @@ public class TileEntity_GTDataServer extends TileEntity implements ITileWithGUI, this.mItems[0].getTagCompound() ) ); + } else { + long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()); + this.OrbDataBase.put(id,GT_NBT_DataBase.getGTTagFromId(id)); } } } @@ -119,4 +145,81 @@ public class TileEntity_GTDataServer extends TileEntity implements ITileWithGUI, public int getGUIID() { return 0; } + + @Override + public int[] getAccessibleSlotsFromSide(int p_94128_1_) { + return new int[0]; + } + + @Override + public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) { + return false; + } + + @Override + public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) { + return false; + } + + @Override + public int getSizeInventory() { + return this.mItems.length; + } + + @Override + public ItemStack getStackInSlot(int p_70301_1_) { + return p_70301_1_ == 0 ? this.mItems[0] : this.mItems[1]; + } + + @Override + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + return null; + } + + @Override + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + return null; + } + + @Override + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + if (p_70299_1_ > 1 || p_70299_1_ < 0) + return; + this.mItems[p_70299_1_]=p_70299_2_; + } + + @Override + public String getInventoryName() { + return null; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return 1; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return true; + } + + @Override + public void openInventory() { + + } + + @Override + public void closeInventory() { + + } + + @Override + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return p_94041_1_ == 0; + } } -- cgit From cf932b2cfd44f3ae0df11259f37bb3f3e7891bf2 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 19 Aug 2019 22:43:54 +0200 Subject: added Noble Gasses +fixed fluid generation system +fixed UnificationEnforcer +added MoltenCells +added NobleGas EBF Recipes +added Replicator/Scanner Recipes +started working on Giant Hatches Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 8a5a261297188387671ce994e3cc02f81eedb7ff --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 213 +++++++++++++- .../bartworks/common/commands/SummonRuin.java | 2 +- .../bartworks/common/loaders/ItemRegistry.java | 8 +- .../GT_MetaTileEntity_CompressedFluidHatch.java | 57 ++++ .../tiered/GT_MetaTileEntity_GiantOutputHatch.java | 49 ++++ .../system/material/BW_MetaGenerated_Items.java | 11 +- .../material/CircuitGeneration/BW_Meta_Items.java | 2 +- .../CircuitGeneration/CircuitImprintLoader.java | 40 +-- .../bartworks/system/material/Werkstoff.java | 90 ++++-- .../bartworks/system/material/WerkstoffLoader.java | 322 ++++++++++++++++++--- .../processingLoaders/AdditionalRecipes.java | 74 ++++- 12 files changed, 753 insertions(+), 117 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java diff --git a/build.properties b/build.properties index a57697dccb..ed11277dc1 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=0_pre7 +buildNumber=0_pre9 APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index d1b2935cf3..6f066cb893 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -41,7 +41,9 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.google.common.collect.ArrayListMultimap; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; @@ -49,24 +51,26 @@ import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; import gregtech.api.GregTech_API; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.SubTag; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.enums.*; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.util.*; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.IOException; -import java.util.HashSet; +import java.lang.reflect.Field; +import java.util.*; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; @Mod( modid = MainMod.MOD_ID, name = MainMod.NAME, version = MainMod.VERSION, @@ -120,7 +124,7 @@ public final class MainMod { bioCultureLoader.run(); } if (ConfigHandler.newStuff) { - WerkstoffLoader.INSTANCE.init(); + INSTANCE.init(); Werkstoff.init(); GregTech_API.sAfterGTPostload.add(new CircuitPartLoader()); } @@ -142,7 +146,7 @@ public final class MainMod { if (ConfigHandler.experimentalThreadedLoader) new ThreadedLoader().runInit(); else - WerkstoffLoader.INSTANCE.runInit(); + INSTANCE.runInit(); } } @@ -156,7 +160,7 @@ public final class MainMod { if (ConfigHandler.experimentalThreadedLoader) new ThreadedLoader().run(); else - WerkstoffLoader.INSTANCE.run(); + INSTANCE.run(); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor","Electric Implosions?"); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor.desc","Basically a giant Hammer that presses Stuff - No more TNT!"); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.DEHP","Heat from below!"); @@ -170,13 +174,198 @@ public final class MainMod { public static void runOnPlayerJoined(boolean classicMode){ OreDictHandler.adaptCacheForWorld(); - WerkstoffLoader.removeIC2Recipes(); + removeIC2Recipes(); MainMod.addElectricImplosionCompressorRecipes(); + MainMod.unificationEnforcer(); + + ArrayListMultimap tochange = MainMod.getRecipesToChange(NOBLE_GAS,ANAEROBE_GAS); + HashSet noGas = MainMod.getNoGasItems(tochange); + MainMod.editRecipes(tochange,noGas); + new CircuitImprintLoader().run(); if (classicMode) new DownTierLoader().run(); } + private static void unificationEnforcer() { + for (Werkstoff werkstoff : Werkstoff.werkstoffHashMap.values()) { + if (werkstoff.getGenerationFeatures().enforceUnification) { + MainMod.runMoltenUnificationEnfocement(werkstoff); + for (OrePrefixes prefixes : OrePrefixes.values()) { + if (OreDictionary.getOres(prefixes + werkstoff.getDefaultName()).size() > 1) { + for (int j = 0; j < OreDictionary.getOres(prefixes + werkstoff.getDefaultName()).size(); j++) { + ItemStack toReplace = OreDictionary.getOres(prefixes + werkstoff.getDefaultName()).get(j); + ItemStack replacement = werkstoff.get(prefixes); + if (GT_Utility.areStacksEqual(toReplace,replacement) || replacement == null || replacement.getItem() == null) + continue; + if (toReplace != null) { + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + HashSet toRem = new HashSet<>(); + for (GT_Recipe recipe : map.mRecipeList) { + boolean removal = map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes); + for (int i = 0; i < recipe.mInputs.length; i++) { + if (GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) { + if (removal) + toRem.add(recipe); + else + recipe.mInputs[i] = replacement; + } + } + for (int i = 0; i < recipe.mOutputs.length; i++) { + if (GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) { + if (removal) + toRem.add(recipe); + else + recipe.mOutputs[i] = replacement; + } + } + if (recipe.mSpecialItems instanceof ItemStack) { + if (GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) { + if (removal) + toRem.add(recipe); + else + recipe.mSpecialItems = replacement; + } + } + } + map.mRecipeList.removeAll(toRem); + } + } + } + } + } + } + } + } + + private static void runMoltenUnificationEnfocement(Werkstoff werkstoff){ + if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.getGenerationFeatures().hasMolten()) { + try { + FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(molten.get(werkstoff), 144), werkstoff.get(cellMolten), Materials.Empty.getCells(1)); + Field f = GT_Utility.class.getDeclaredField("sFilledContainerToData"); + f.setAccessible(true); + Map sFilledContainerToData = (Map) f.get(null); + HashSet torem = new HashSet(); + ItemStack toReplace = null; + for (Map.Entry entry : sFilledContainerToData.entrySet()) { + if (entry.getValue().fluid.equals(data.fluid) && !entry.getValue().filledContainer.equals(data.filledContainer)) { + toReplace = entry.getValue().filledContainer; + torem.add(entry); + } + } + torem.clear(); + sFilledContainerToData.entrySet().removeAll(torem); + if (toReplace != null) { + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + torem.clear(); + for (GT_Recipe recipe : map.mRecipeList) { + for (int i = 0; i < recipe.mInputs.length; i++) { + if (GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) { + torem.add(recipe); + // recipe.mInputs[i] = data.filledContainer; + } + } + for (int i = 0; i < recipe.mOutputs.length; i++) { + if (GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) { + torem.add(recipe); + // recipe.mOutputs[i] = data.filledContainer; + if (map == GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes && GT_Utility.areStacksEqual(recipe.mOutputs[i], data.filledContainer) && !recipe.mFluidInputs[0].equals(data.fluid)) { + torem.add(recipe); + // recipe.mOutputs[i] = data.filledContainer; + } + } + } + if (recipe.mSpecialItems instanceof ItemStack) { + if (GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) { + torem.add(recipe); + // recipe.mSpecialItems = data.filledContainer; + } + } + } + map.mRecipeList.removeAll(torem); + } + } + + GT_Utility.addFluidContainerData(data); + } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { + e.printStackTrace(); + } + } + } + + private static ArrayListMultimap getRecipesToChange(SubTag... GasTags){ + Iterator it = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.iterator(); + ArrayListMultimap toAdd = ArrayListMultimap.create(); + while (it.hasNext()) { + GT_Recipe recipe = it.next(); + if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) { + String FluidString = recipe.mFluidInputs[0].getFluid().getName().replaceAll("molten", "").replaceAll("fluid", ""); + Materials mat = Materials.get(FluidString.substring(0, 1).toUpperCase() + FluidString.substring(1)); + if (mat != Materials._NULL) { + for (SubTag tag : GasTags){ + if (mat.contains(tag)) + toAdd.put(tag,recipe); + } + } + } + } + return toAdd; + } + + private static HashSet getNoGasItems(ArrayListMultimap base){ + Iterator it = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.iterator(); + HashSet toAdd = new HashSet<>(); + ArrayListMultimap repToAdd = ArrayListMultimap.create(); + while (it.hasNext()) { + GT_Recipe recipe = it.next(); + for (SubTag tag : base.keySet()) + recipeLoop: + for (GT_Recipe baseRe : base.get(tag)) { + if (recipe.mInputs.length == baseRe.mInputs.length && recipe.mOutputs.length == baseRe.mOutputs.length) + for (int i = 0; i < recipe.mInputs.length; i++) { + if ((recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) && BW_Util.checkStackAndPrefix(recipe.mInputs[i]) && BW_Util.checkStackAndPrefix(baseRe.mInputs[i]) && GT_OreDictUnificator.getAssociation(recipe.mInputs[i]).mMaterial.mMaterial.equals(GT_OreDictUnificator.getAssociation(baseRe.mInputs[i]).mMaterial.mMaterial) && GT_Utility.areStacksEqual(recipe.mOutputs[0], recipe.mOutputs[0])) { + toAdd.add(recipe.mOutputs[0]); + repToAdd.put(tag,recipe); + continue recipeLoop; + } + } + } + } + base.putAll(repToAdd); + return toAdd; + } + + private static void editRecipes(ArrayListMultimap base, HashSet noGas) { + HashSet toAdd = new HashSet<>(); + for (SubTag GasTag : base.keySet()) { + for (GT_Recipe recipe : base.get(GasTag)) { + if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) { + String FluidString = recipe.mFluidInputs[0].getFluid().getName().replaceAll("molten", "").replaceAll("fluid", ""); + Materials mat = Materials.get(FluidString.substring(0, 1).toUpperCase() + FluidString.substring(1)); + if (mat != Materials._NULL) { + for (Werkstoff werkstoff : Werkstoff.werkstoffHashMap.values()) { + if (!werkstoff.contains(GasTag)) + continue; + toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(fluids.get(werkstoff), recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + (double) mat.getProtons() - (double) werkstoff.getStats().getProtons())), recipe.mEUt, recipe.mSpecialValue)); + } + for (Materials materials : Materials.values()) { + if (!materials.contains(GasTag)) + continue; + toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{materials.getGas(recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + (double) mat.getProtons() - (double) materials.getProtons())), recipe.mEUt, recipe.mSpecialValue)); + } + for (ItemStack is : noGas) + if (GT_Utility.areStacksEqual(is, recipe.mOutputs[0])) { + toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + (double) mat.getProtons())), recipe.mEUt, recipe.mSpecialValue)); + break; + } + } + } + } + GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.removeAll(base.get(GasTag)); + } + GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.addAll(toAdd); + } + private static void addElectricImplosionCompressorRecipes() { if (eicMap == null) { eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java index f569d62abe..48f7a6d236 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java @@ -35,7 +35,7 @@ public class SummonRuin extends CommandBase { @Override public String getCommandUsage(ICommandSender p_71518_1_) { - return "SummonRuin x z"; + return "SummonRuin "; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 704dc73c60..dd20bd3a85 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -38,9 +38,7 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEnti import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaBlastFurnace; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; -import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_AcidGenerator; -import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_Diode; -import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_EnergyDistributor; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.*; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; @@ -137,6 +135,8 @@ public class ItemRegistry { public static ItemStack thtr; public static ItemStack eic; public static ItemStack cal; + public static ItemStack compressedHatch; + public static ItemStack giantOutputHatch; public static void run() { @@ -180,6 +180,8 @@ public class ItemRegistry { ItemRegistry.megaMachines[0] = new GT_TileEntity_MegaBlastFurnace(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, "MegaBlastFurnace", StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L); ItemRegistry.megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, "MegaVacuumFreezer", StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L); ItemRegistry.cal = new GT_TileEntity_CircuitAssemblyLine(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 7, "CircuitAssemblyLine", "Circuit Assembly Line").getStackForm(1L); + ItemRegistry.compressedHatch = new GT_MetaTileEntity_CompressedFluidHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, "CompressedFluidHatch", "Liquid Air Fluid Hatch").getStackForm(1L); + ItemRegistry.giantOutputHatch = new GT_MetaTileEntity_GiantOutputHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, "GiantOutputHatch", "Giant Output Hatch").getStackForm(1L); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java new file mode 100644 index 0000000000..d4382eac7a --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; + +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.util.GT_Utility; +import net.minecraftforge.fluids.FluidStack; + +public class GT_MetaTileEntity_CompressedFluidHatch extends GT_MetaTileEntity_Hatch_Input { + public GT_MetaTileEntity_CompressedFluidHatch(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, 0); + this.mDescriptionArray[1] = "Capacity: 100000000L"; + } + + public GT_MetaTileEntity_CompressedFluidHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public int getCapacity() { + return 100000000; + } + + @Override + public boolean isFluidInputAllowed(FluidStack aFluid) { + return GT_Utility.areFluidsEqual(aFluid, Materials.LiquidAir.getFluid(1)); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_CompressedFluidHatch(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java new file mode 100644 index 0000000000..887b93db54 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; + +public class GT_MetaTileEntity_GiantOutputHatch extends GT_MetaTileEntity_Hatch_Output { + + public GT_MetaTileEntity_GiantOutputHatch(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, 0); + } + + public GT_MetaTileEntity_GiantOutputHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_GiantOutputHatch(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + + @Override + public int getCapacity() { + return 100000000; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index b3e8417ceb..2990352776 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -33,6 +33,7 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Item; +import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; @@ -52,6 +53,7 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidContainerRegistry; import java.util.List; @@ -76,7 +78,9 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa for (int i = 0; i < this.aNumToGen; i++) { ItemStack tStack = new ItemStack(this, 1, i); Werkstoff w = werkstoffHashMap.get((short) i); - if (w == null || ((w.getGenerationFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) == 0) || ((w.getGenerationFeatures().blacklist & orePrefixes.mMaterialGenerationBits) != 0) ) + if (w == null || ((w.getGenerationFeatures().blacklist & orePrefixes.mMaterialGenerationBits) != 0) ) + continue; + if ((w.getGenerationFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) == 0 && orePrefixes.mMaterialGenerationBits != 0) continue; GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", this.getDefaultLocalization(w)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); @@ -226,4 +230,9 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage()); return w.getDefaultName(); } + + @Override + public int getCapacity(ItemStack aStack) { + return this.orePrefixes == OrePrefixes.cell || this.orePrefixes == OrePrefixes.cellPlasma ? 1000 : this.orePrefixes == WerkstoffLoader.cellMolten ? 144 : 0; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index c8e755e3e4..86ddee4fbd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -108,7 +108,7 @@ public class BW_Meta_Items { } public final ItemStack addCircuit(int aID, String aEnglish, String aToolTip, int tier){ - CircuitImprintLoader.bwCircuitTagMap.put(new CircuitData(BW_Util.getMachineVoltageFromTier(tier-2),tier > 2 ? BW_Util.CLEANROOM : 0,(byte)tier), CircuitImprintLoader.getTagFromStack(new ItemStack(BW_Meta_Items.NEWCIRCUITS,1,aID))); + CircuitImprintLoader.bwCircuitTagMap.put(new CircuitData(BW_Util.getMachineVoltageFromTier(Math.min(1,(tier-2))),tier > 2 ? BW_Util.CLEANROOM : 0,(byte)tier), new ItemStack(BW_Meta_Items.NEWCIRCUITS,1,aID)); return this.addItem(aID, aEnglish, aToolTip,SubTag.NO_UNIFICATION); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 999711e3fe..3ddadafffd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -46,7 +46,7 @@ import java.util.Iterator; public class CircuitImprintLoader implements Runnable { public static final ArrayListMultimap recipeTagMap = ArrayListMultimap.create(); - static final HashBiMap bwCircuitTagMap = HashBiMap.create(20); + static final HashBiMap bwCircuitTagMap = HashBiMap.create(20); static final HashSet refs = new HashSet<>(); public static short reverseIDs = Short.MAX_VALUE-1; public static HashBiMap circuitIIconRefs = HashBiMap.create(20); @@ -109,7 +109,7 @@ public class CircuitImprintLoader implements Runnable { for (ItemStack is : newRecipe.mInputs){ int[] oreIDs = OreDictionary.getOreIDs(is); if(oreIDs == null || oreIDs.length < 1 || !OreDictionary.getOreName(oreIDs[0]).contains("circuit")) { - is.stackSize = Math.max(64, is.stackSize*4); + is.stackSize = 64; } } newRecipe.mFluidInputs[0].amount *= 4; @@ -191,20 +191,26 @@ public class CircuitImprintLoader implements Runnable { 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3)}); } -// for (NBTTagCompound tag : CircuitImprintLoader.bwCircuitTagMap.values()){ -// CircuitData data = CircuitImprintLoader.bwCircuitTagMap.inverse().get(tag); -// ItemStack stack = CircuitImprintLoader.getStackFromTag(tag); -// GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300, Math.toIntExact(data.getaVoltage()),data.getaSpecial()); -// GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); -// GT_ModHandler.addCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1),GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS ,new Object[]{ -// "DXD", -// "GPG", -// "DXD", -// 'D', WerkstoffLoader.ArInGaPhoBiBoTe.get(OrePrefixes.dust,1), -// 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), -// 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), -// 'X', WerkstoffLoader.MagnetoResonaticDust.get(OrePrefixes.dust,1) -// }); -// } + for (ItemStack stack : CircuitImprintLoader.bwCircuitTagMap.values()){ + NBTTagCompound tag = CircuitImprintLoader.getTagFromStack(stack); + CircuitData data = CircuitImprintLoader.bwCircuitTagMap.inverse().get(stack); + GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300, Math.toIntExact(data.getaVoltage()),data.getaSpecial()); + GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); + GameRegistry.addRecipe(new BWRecipes.BWNBTDependantCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), + " X ", + "GPG", + " X ", + 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), + 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), + 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3))); + GT_ModHandler.addCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1),GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS ,new Object[]{ + " X ", + "GPG", + " X ", + 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), + 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), + 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3) + }); + } } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index dbb42d004d..64822f25fe 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -33,6 +33,7 @@ import gregtech.api.objects.GT_Fluid; import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; import java.nio.ByteBuffer; import java.util.*; @@ -53,8 +54,6 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { private byte[] rgb = new byte[3]; private final String defaultName; private String toolTip; - private Fluid fluid; - private Fluid gas; private Werkstoff.Stats stats; private final Werkstoff.Types type; @@ -99,7 +98,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { type = Werkstoff.Types.UNDEFINED; this.defaultName = defaultName; - + this.stats = stats; this.type = type; this.mID = (short) mID; this.generationFeatures = generationFeatures; @@ -132,32 +131,30 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } } else this.toolTip = toolTip; - long tmpprotons = 0; - for (Pair p : contents) { - if (p.getKey() instanceof Materials) { - tmpprotons += ((Materials) p.getKey()).getProtons() * p.getValue(); - } else if (p.getKey() instanceof Werkstoff) { - tmpprotons += ((Werkstoff) p.getKey()).getStats().protons * p.getValue(); + if (this.stats.protons == 0) { + long tmpprotons = 0; + for (Pair p : contents) { + if (p.getKey() instanceof Materials) { + tmpprotons += ((Materials) p.getKey()).getProtons() * p.getValue(); + } else if (p.getKey() instanceof Werkstoff) { + tmpprotons += ((Werkstoff) p.getKey()).getStats().protons * p.getValue(); + } } + this.stats = stats.setProtons(tmpprotons); } - this.stats = stats.setProtons(tmpprotons); - - long tmpmass = 0; - for (Pair p : contents) { - if (p.getKey() instanceof Materials) { - tmpmass += ((Materials) p.getKey()).getMass() * p.getValue(); - } else if (p.getKey() instanceof Werkstoff) { - tmpprotons += ((Werkstoff) p.getKey()).getStats().mass * p.getValue(); + if (this.stats.mass == 0) { + long tmpmass = 0; + for (Pair p : contents) { + if (p.getKey() instanceof Materials) { + tmpmass += ((Materials) p.getKey()).getMass() * p.getValue(); + } else if (p.getKey() instanceof Werkstoff) { + tmpmass += ((Werkstoff) p.getKey()).getStats().mass * p.getValue(); + } } + this.stats = stats.setMass(tmpmass); } - this.stats = stats.setMass(tmpmass); - this.texSet = texSet; - if (this.getStats().meltingPoint > 0 && !this.getStats().isGas()) { - this.fluid = new GT_Fluid("molten" + this.getDefaultName().replaceAll(" ", ""), "molten.autogenerated", this.getRGBA()); - this.getGenerationFeatures().toGenerate |= 16; - } if (this.getGenerationFeatures().enforceUnification) { for (OrePrefixes prefix : OrePrefixes.values()) BWUnificationEnforcer.addUnificationTarget(prefix+this.getDefaultName()); @@ -310,12 +307,20 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return WerkstoffLoader.getCorrespondingItemStack(prefixes, this); } + public FluidStack getFluidOrGas(int fluidAmount) { + return new FluidStack(WerkstoffLoader.fluids.get(this),fluidAmount); + } + public FluidStack getMolten(int fluidAmount) { + return new FluidStack(WerkstoffLoader.molten.get(this),fluidAmount); + } + + public ItemStack get(OrePrefixes prefixes, int amount) { return WerkstoffLoader.getCorrespondingItemStack(prefixes, this, amount); } public enum Types { - MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, ELEMENT, UNDEFINED; + MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, ELEMENT, ISOTOPE, UNDEFINED; public static Werkstoff.Stats getDefaultStatForType(Werkstoff.Types T) { switch (T) { @@ -338,8 +343,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { gem 100 ore 1000 cell 10000 + plasma 100000 + molten 1000000 */ public byte toGenerate = 0b0001001; + + //public byte toGenerateSecondary = 0b0000000; public byte blacklist; public boolean enforceUnification; @@ -435,6 +444,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } + public boolean hasMolten() { + return (this.toGenerate & 0b1000000) != 0; + } + + public Werkstoff.GenerationFeatures addMolten() { + this.toGenerate = (byte) (this.toGenerate | 0b1000000); + return this; + } + public Werkstoff.GenerationFeatures addGems() { this.toGenerate = (byte) (this.toGenerate | 0x4); return this; @@ -457,6 +475,14 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } + public long getMass() { + return this.mass; + } + + public long getProtons() { + return this.protons; + } + public int getMeltingPoint() { return this.meltingPoint; } @@ -511,7 +537,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.Stats setMass(long mass) { - this.mass = this.protons; + this.mass = mass; return this; } @@ -521,7 +547,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public boolean isSublimation() { - return (this.quality & 0b1) == 0b1; + return (this.quality & 0b1) != 0; } public Werkstoff.Stats setSublimation(boolean sublimation) { @@ -533,7 +559,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public boolean isToxic() { - return (this.quality >> 1 & 0b1) == 0b1; + return (this.quality & 0b10) != 0; } public Werkstoff.Stats setToxic(boolean toxic) { @@ -545,7 +571,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public boolean isRadioactive() { - return (this.quality >> 2 & 0b1) == 0b1; + return (this.quality & 0b100) != 0; } public Werkstoff.Stats setRadioactive(boolean radioactive) { @@ -557,7 +583,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public boolean isBlastFurnace() { - return (this.quality >> 3 & 0b1) == 0b1; + return (this.quality & 0b1000) != 0; } public Werkstoff.Stats setBlastFurnace(boolean blastFurnace) { @@ -569,7 +595,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public boolean isElektrolysis() { - return (this.quality >> 4 & 0b1) == 0b1; + return (this.quality & 0x10) != 0; } public Werkstoff.Stats setElektrolysis(boolean elektrolysis) { @@ -581,7 +607,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public boolean isCentrifuge() { - return (this.quality >> 5 & 0b1) == 0b1; + return (this.quality & 0x20) != 0; } public Werkstoff.Stats setCentrifuge(boolean centrifuge) { @@ -593,7 +619,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public boolean isGas() { - return (this.quality >> 6 & 0b1) == 0b1; + return (this.quality & 0x40) != 0; } public Werkstoff.Stats setGas(boolean gas) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 4fcf361c9d..2b19c6a4c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -27,10 +27,11 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; -import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_CircuitsLoader; +import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; @@ -46,10 +47,8 @@ import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_Fluid; import gregtech.api.objects.GT_MultiTexture; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.*; +import gregtech.common.items.behaviors.Behaviour_DataOrb; import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputOreDict; import ic2.api.recipe.RecipeOutput; @@ -57,10 +56,14 @@ import ic2.api.recipe.Recipes; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.EnumHelper; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; +import java.lang.reflect.Field; import java.util.*; import static com.github.bartimaeusnek.bartworks.util.BW_Util.subscriptNumbers; @@ -72,7 +75,23 @@ public class WerkstoffLoader implements Runnable { private WerkstoffLoader() {} public static final WerkstoffLoader INSTANCE = new WerkstoffLoader(); + public static final SubTag NOBLE_GAS = SubTag.getNewSubTag("NobleGas"); + public static final SubTag ANAEROBE_GAS = SubTag.getNewSubTag("AnaerobeGas"); + public static final SubTag ANAEROBE_SMELTING = SubTag.getNewSubTag("AnaerobeSmelting"); + public static OrePrefixes cellMolten; + static { + for (OrePrefixes prefix : OrePrefixes.values()){ + if (prefix.toString().equals("cellMolten")) + WerkstoffLoader.cellMolten = prefix; + } + if (WerkstoffLoader.cellMolten == null) { + WerkstoffLoader.cellMolten = EnumHelper.addEnum(OrePrefixes.class,"cellMolten",new Class[]{String.class, String.class, String.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, int.class, long.class, int.class, int.class},new Object[]{"Cells of Molten stuff", "Molten ", " Cell", true, true, true, true, false, false, false, true, false, false, 0b1000000, 3628800L, 64, 31}); + // GT_LanguageManager.addStringLocalization(".name", this.getDefaultLocalization(w)); + } else { + WerkstoffLoader.cellMolten.mMaterialGenerationBits = 0b1000000; + } + } //TODO: FREE ID RANGE: 19-32766 public static final Werkstoff Bismutite = new Werkstoff( @@ -461,7 +480,7 @@ public class WerkstoffLoader implements Runnable { "Thorium 232", superscriptNumbers("Th232"), new Werkstoff.Stats().setRadioactive(true), - Werkstoff.Types.ELEMENT, + Werkstoff.Types.ISOTOPE, new Werkstoff.GenerationFeatures().disable().onlyDust(), 30, TextureSet.SET_METALLIC @@ -536,7 +555,7 @@ public class WerkstoffLoader implements Runnable { "Magneto Resonatic", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().onlyDust().addMixerRecipes(), + new Werkstoff.GenerationFeatures().onlyDust().addMixerRecipes().addGems(), 36, TextureSet.SET_MAGNETIC, //No Byproducts @@ -545,21 +564,83 @@ public class WerkstoffLoader implements Runnable { new Pair<>(WerkstoffLoader.CubicZirconia,1), new Pair<>(Materials.SteelMagnetic,1) ); -// public static final Werkstoff Xenon = new Werkstoff( -// new short[]{0x14,0x39,0x7F,0}, -// "Xenon", -// "Xe", -// new Werkstoff.Stats().setProtons(54).setGas(true), -// Werkstoff.Types.ELEMENT, -// new Werkstoff.GenerationFeatures().disable().addCells(), -// 37, -// TextureSet.SET_FLUID -// //No Byproducts -// //No Ingridients -// ); + public static final Werkstoff Xenon = new Werkstoff( + new short[]{0x14,0x39,0x7F,0}, + "Xenon", + "Xe", + new Werkstoff.Stats().setProtons(54).setMass(131).setGas(true), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), + 37, + TextureSet.SET_FLUID + //No Byproducts + //No Ingredients + ); + public static final Werkstoff Oganesson = new Werkstoff( + new short[]{0x14,0x39,0x7F,0}, + "Oganesson", + "Og", + new Werkstoff.Stats().setProtons(118).setMass(294).setGas(true), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable().addCells(), + 38, + TextureSet.SET_FLUID + //No Byproducts + //No Ingredients + ); + public static final Werkstoff Californium = new Werkstoff( + new short[]{0xAA,0xAA,0xAA,0}, + "Californium", + "Cf", + new Werkstoff.Stats().setProtons(98).setMass(251).setBlastFurnace(true).setMeltingPoint(900), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten().enforceUnification(), + 39, + TextureSet.SET_METALLIC + //No Byproducts + //No Ingredients + ); + public static final Werkstoff Calcium = new Werkstoff( + Materials.Calcium.mRGBa, + "Calcium", + "Ca", + new Werkstoff.Stats().setProtons(Element.Ca.mProtons).setMass(Element.Ca.getMass()).setBlastFurnace(true).setMeltingPoint(1115).setBoilingPoint(1757), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten(), + 40, + Materials.Calcium.mIconSet + //No Byproducts + //No Ingredients + ); + public static final Werkstoff Neon = new Werkstoff( + new short[]{0xff,0x07,0x3a}, + "Neon", + "Ne", + new Werkstoff.Stats().setProtons(Element.Ne.mProtons).setMass(Element.Ne.getMass()).setGas(true), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), + 41, + TextureSet.SET_FLUID + //No Byproducts + //No Ingredients + ); + public static final Werkstoff Krypton = new Werkstoff( + new short[]{0xb1,0xff,0x32}, + "Krypton", + "Kr", + new Werkstoff.Stats().setProtons(Element.Kr.mProtons).setMass(Element.Kr.getMass()).setGas(true), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), + 42, + TextureSet.SET_FLUID + //No Byproducts + //No Ingredients + ); + public static HashMap items = new HashMap<>(); - public static HashMap fluids = new HashMap<>(); + public static HashMap fluids = new HashMap<>(); + public static HashMap molten = new HashMap<>(); public static Block BWOres; public boolean registered; @@ -568,9 +649,11 @@ public class WerkstoffLoader implements Runnable { } public static ItemStack getCorrespondingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { - ItemStack ret = OreDictHandler.getItemStack(werkstoff.getDefaultName(),orePrefixes,amount); + if (!werkstoff.getGenerationFeatures().enforceUnification) { + ItemStack ret = OreDictHandler.getItemStack(werkstoff.getDefaultName(), orePrefixes, amount); if (ret != null) return ret; + } if (orePrefixes == ore) return new ItemStack(WerkstoffLoader.BWOres, amount, werkstoff.getmID()); return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); @@ -617,6 +700,10 @@ public class WerkstoffLoader implements Runnable { this.addOreRecipes(werkstoff); DebugLog.log("Loading Crushed Recipes"+" " +(System.nanoTime()-timepreone)); this.addCrushedRecipes(werkstoff); + DebugLog.log("Loading Cell Recipes"+" " +(System.nanoTime()-timepreone)); + this.addCellRecipes(werkstoff); + DebugLog.log("Loading Meltdown Recipes"+" " +(System.nanoTime()-timepreone)); + this.addMoltenRecipes(werkstoff); if (Loader.isModLoaded("Thaumcraft")) { DebugLog.log("Loading Aspects"+" " +(System.nanoTime()-timepreone)); ThaumcraftHandler.AspectAdder.addAspectToAll(werkstoff); @@ -636,6 +723,21 @@ public class WerkstoffLoader implements Runnable { } private void addSubTags() { + + WerkstoffLoader.Krypton.add(WerkstoffLoader.NOBLE_GAS); + WerkstoffLoader.Xenon.add(WerkstoffLoader.NOBLE_GAS); + WerkstoffLoader.Neon.add(WerkstoffLoader.NOBLE_GAS); + Materials.Helium.add(WerkstoffLoader.NOBLE_GAS); + + Materials.Argon.add(WerkstoffLoader.NOBLE_GAS); + + WerkstoffLoader.Oganesson.add(WerkstoffLoader.NOBLE_GAS,WerkstoffLoader.ANAEROBE_GAS); + Materials.Radon.add(WerkstoffLoader.NOBLE_GAS,WerkstoffLoader.ANAEROBE_GAS); + + Materials.Nitrogen.add(WerkstoffLoader.ANAEROBE_GAS); + + WerkstoffLoader.Calcium.add(WerkstoffLoader.ANAEROBE_SMELTING); + for (Werkstoff W : Werkstoff.werkstoffHashMap.values()) { for (Pair pair : W.getContents().getValue().toArray(new Pair[0])) { @@ -660,9 +762,29 @@ public class WerkstoffLoader implements Runnable { public static int toGenerateGlobal; private void addItemsForGeneration() { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000) != 0 && FluidRegistry.isFluidRegistered(werkstoff.getDefaultName())){ - DebugLog.log("Adding new Fluid: "+werkstoff.getDefaultName()); - WerkstoffLoader.fluids.put(werkstoff, (GT_Fluid) new GT_Fluid(werkstoff.getDefaultName(),"molten.autogenerated",werkstoff.getRGBA()).setGaseous(werkstoff.getStats().isGas())); + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000) != 0){ + if (!FluidRegistry.isFluidRegistered(werkstoff.getDefaultName())) { + DebugLog.log("Adding new Fluid: " + werkstoff.getDefaultName()); + GT_Fluid fluid = (GT_Fluid) new GT_Fluid(werkstoff.getDefaultName(), "molten.autogenerated", werkstoff.getRGBA()).setGaseous(werkstoff.getStats().isGas()); + FluidRegistry.registerFluid(fluid); + WerkstoffLoader.fluids.put(werkstoff, fluid); + } else { + WerkstoffLoader.fluids.put(werkstoff, FluidRegistry.getFluid(werkstoff.getDefaultName())); + } + } + if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000000) != 0){ + if (!FluidRegistry.isFluidRegistered("molten."+werkstoff.getDefaultName())) { + DebugLog.log("Adding new Molten: " + werkstoff.getDefaultName()); + Fluid fluid = new GT_Fluid("molten." + werkstoff.getDefaultName(), "molten.autogenerated", werkstoff.getRGBA()); + if (werkstoff.getStats().meltingPoint > 0) + fluid = fluid.setTemperature(werkstoff.getStats().meltingPoint); + FluidRegistry.registerFluid(fluid); + //GT_LanguageManager.addStringLocalization("Molten." + werkstoff.getDefaultName(), "Molten "+ werkstoff.getDefaultName()); + GT_LanguageManager.addStringLocalization(fluid.getUnlocalizedName(), "Molten "+ werkstoff.getDefaultName()); + WerkstoffLoader.molten.put(werkstoff, fluid); + } else { + WerkstoffLoader.molten.put(werkstoff, FluidRegistry.getFluid(werkstoff.getDefaultName())); + } } for (OrePrefixes p : values()) if (!werkstoff.getGenerationFeatures().enforceUnification && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(),p,1) != null) { @@ -672,7 +794,7 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.toGenerateGlobal = (WerkstoffLoader.toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); //System.out.println(werkstoff.getDefaultName()+": "+werkstoff.getGenerationFeatures().toGenerate); } - + DebugLog.log("GlobalGeneration: "+WerkstoffLoader.toGenerateGlobal); if ((WerkstoffLoader.toGenerateGlobal & 0b1) != 0) { WerkstoffLoader.items.put(dust, new BW_MetaGenerated_Items(dust)); WerkstoffLoader.items.put(dustTiny, new BW_MetaGenerated_Items(dustTiny)); @@ -701,14 +823,19 @@ public class WerkstoffLoader implements Runnable { } if ((WerkstoffLoader.toGenerateGlobal & 0b10000) != 0) { WerkstoffLoader.items.put(cell, new BW_MetaGenerated_Items(cell)); - // WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle)); - // WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); + //WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle)); + //WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); } if ((WerkstoffLoader.toGenerateGlobal & 0b100000) != 0) { WerkstoffLoader.items.put(cellPlasma, new BW_MetaGenerated_Items(cellPlasma)); } + if ((WerkstoffLoader.toGenerateGlobal & 0b1000000) != 0) { + WerkstoffLoader.items.put(cellMolten, new BW_MetaGenerated_Items(cellMolten)); + } } + + public void gameRegistryHandler(){ if (FMLCommonHandler.instance().getSide().isClient()) RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); @@ -767,14 +894,14 @@ public class WerkstoffLoader implements Runnable { if (werkstoff.getGenerationFeatures().hasSifterRecipes() || ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0)) { GT_Values.RA.addSifterRecipe( - WerkstoffLoader.getCorrespondingItemStack(crushedPurified, werkstoff), + werkstoff.get(crushedPurified), new ItemStack[]{ - WerkstoffLoader.getCorrespondingItemStack(gemExquisite, werkstoff), - WerkstoffLoader.getCorrespondingItemStack(gemFlawless, werkstoff), - WerkstoffLoader.getCorrespondingItemStack(gem, werkstoff), - WerkstoffLoader.getCorrespondingItemStack(gemFlawed, werkstoff), - WerkstoffLoader.getCorrespondingItemStack(gemChipped, werkstoff), - WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff) + werkstoff.get(gemExquisite), + werkstoff.get(gemFlawless), + werkstoff.get(gem), + werkstoff.get(gemFlawed), + werkstoff.get(gemChipped), + werkstoff.get(dust) }, new int[]{ 200, 1000, 2500, 2000, 4000, 5000 @@ -828,7 +955,6 @@ public class WerkstoffLoader implements Runnable { private void addDustRecipes(Werkstoff werkstoff) { if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0) { - List flOutputs = new ArrayList<>(); List stOutputs = new ArrayList<>(); HashMap> tracker = new HashMap<>(); @@ -876,7 +1002,7 @@ public class WerkstoffLoader implements Runnable { } } } - ItemStack input = WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff); + ItemStack input = werkstoff.get(dust); input.stackSize = werkstoff.getContents().getKey(); if (werkstoff.getStats().isElektrolysis()) GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); @@ -894,35 +1020,80 @@ public class WerkstoffLoader implements Runnable { } } - GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff), new Object[]{ + GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{ "TTT","TTT","TTT",'T', - WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff) + werkstoff.get(dustTiny) }); - GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff), new Object[]{ + GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{ "TT ","TT ",'T', WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff) }); GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff, 4), new Object[]{ - " T ", 'T', WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff) + " T ", 'T', werkstoff.get(dust) }); GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff, 9), new Object[]{ - "T ", 'T', WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff) + "T ", 'T', werkstoff.get(dust) }); if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 && !werkstoff.getStats().isBlastFurnace()) { - GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff), WerkstoffLoader.getCorrespondingItemStack(ingot, werkstoff)); - GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff), WerkstoffLoader.getCorrespondingItemStack(nugget, werkstoff)); + GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); + GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustTiny), werkstoff.get(nugget)); + } + else if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 && werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().meltingPoint != 0){ + if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)){ + GT_Values.RA.addBlastRecipe(werkstoff.get(dust),GT_Utility.getIntegratedCircuit(11),Materials.Nitrogen.getGas(1000),null,werkstoff.get(ingot),null,(int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); + } + else { + GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, werkstoff.get(ingot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); + if (werkstoff.getStats().meltingPoint <= 1000) { + GT_Values.RA.addPrimitiveBlastRecipe(werkstoff.get(dust), null, 9, werkstoff.get(ingot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint); + GT_ModHandler.addRCBlastFurnaceRecipe(werkstoff.get(ingot), werkstoff.get(dust), werkstoff.getStats().meltingPoint); + } + } } if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0){ GT_ModHandler.addPulverisationRecipe(werkstoff.get(ingot),werkstoff.get(dust)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(nugget),werkstoff.get(dustTiny)); } + + if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { + Materials werkstoffBridgeMaterial = null; + boolean ElementSet = false; + for (Element e : Element.values()){ + if (e.toString().equals(werkstoff.getToolTip())){ + if (e.mLinkedMaterials.size() > 0) + break; + werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName(),werkstoff.getDefaultName()); + werkstoffBridgeMaterial.mElement = e; + e.mLinkedMaterials.add(werkstoffBridgeMaterial); + ElementSet = true; + break; + } + } + if (!ElementSet) + return; + + GT_OreDictUnificator.addAssociation(dust,werkstoffBridgeMaterial, werkstoff.get(dust),true); + try { + Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); + f.setAccessible(true); + Map MATERIALS_MAP = (Map) f.get(null); + MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); + } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { + e.printStackTrace(); + } + ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); + Behaviour_DataOrb.setDataName(scannerOutput,werkstoff.getToolTip()); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(dust)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),32,0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, null,new ItemStack[]{werkstoff.get(dust)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),32,0)); + } } } private void addOreRecipes(Werkstoff werkstoff) { if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 &&!werkstoff.getStats().isBlastFurnace()) - GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), WerkstoffLoader.getCorrespondingItemStack(ingot, werkstoff)); + GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), werkstoff.get(ingot)); if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0) { GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ore), werkstoff.getGenerationFeatures().hasGems() ? werkstoff.get(gem) : werkstoff.get(crushed), 16, 10); @@ -994,4 +1165,67 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Neodymium, 1L), GT_OreDictUnificator.get(nugget, Materials.Neodymium, 1L), new int[]{10000, 4000, 2000}, 400, 24); } + private void addCellRecipes(Werkstoff werkstoff){ + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000) == 0) + return; + + //Tank "Recipe" + GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(WerkstoffLoader.fluids.get(werkstoff), 1000),werkstoff.get(cell),Materials.Empty.getCells(1))); + + GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(fluids.get(werkstoff),1000), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(fluids.get(werkstoff),1000)); + + if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { + Materials werkstoffBridgeMaterial = null; + boolean ElementSet = false; + for (Element e : Element.values()){ + if (e.toString().equals(werkstoff.getToolTip())){ + werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName(),werkstoff.getDefaultName()); + werkstoffBridgeMaterial.mElement = e; + e.mLinkedMaterials.add(werkstoffBridgeMaterial); + ElementSet = true; + break; + } + } + if (!ElementSet) + return; + + GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),true); + try { + Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); + f.setAccessible(true); + Map MATERIALS_MAP = (Map) f.get(null); + MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); + } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { + e.printStackTrace(); + } + ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); + Behaviour_DataOrb.setDataName(scannerOutput,werkstoff.getToolTip()); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),32,0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),32,0)); + } + } + private void addMoltenRecipes(Werkstoff werkstoff) { + if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000000) == 0) + return; + + //Tank "Recipe" + FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(WerkstoffLoader.molten.get(werkstoff), 144),werkstoff.get(cellMolten),Materials.Empty.getCells(1)); + GT_Utility.addFluidContainerData(data); + GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cellMolten), new FluidStack(molten.get(werkstoff),144), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(molten.get(werkstoff),144)); + + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0) { + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + //GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + //GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + //GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick),null,werkstoff.getMolten(72),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget),null,werkstoff.getMolten(16),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + } + } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 7678e69faa..fc6964875c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -23,18 +23,26 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_CircuitsLoader; +import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; +import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; +import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.*; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gregtech.common.items.behaviors.Behaviour_DataOrb; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import java.lang.reflect.Field; +import java.util.Map; + +import static com.github.bartimaeusnek.bartworks.util.BW_Util.CLEANROOM; import static gregtech.api.enums.OrePrefixes.*; public class AdditionalRecipes implements Runnable { @@ -68,5 +76,61 @@ public class AdditionalRecipes implements Runnable { GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust,10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.CubicZirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953); //Tellurium GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed,Materials.Lead,10L),GT_Utility.getIntegratedCircuit(17),GT_Values.NF,GT_Values.NF,Materials.Lead.getIngots(10),Materials.Tellurium.getNuggets(20),800,BW_Util.getMachineVoltageFromTier(2),722); - } + GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium.getMolten(16), Materials.Beryllium.getMolten(16), WerkstoffLoader.Californium.getMolten(16), 250,49152, 480000000); + GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), WerkstoffLoader.Calcium.getMolten(16), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500,49152, 600000000); + GT_Values.RA.addDistillationTowerRecipe(Materials.LiquidAir.getFluid(100000000),new FluidStack[]{Materials.Nitrogen.getGas(78084000),Materials.Oxygen.getGas(20946000),Materials.Argon.getGas(934000),Materials.CarbonDioxide.getGas(40700),WerkstoffLoader.Neon.getFluidOrGas(1818),Materials.Helium.getGas(524),Materials.Methane.getGas(180),WerkstoffLoader.Krypton.getFluidOrGas(114),Materials.Hydrogen.getGas(55)},null,7500,BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust),WerkstoffLoader.Neon.getFluidOrGas(1000),WerkstoffLoader.MagnetoResonaticDust.get(gemChipped,9),9000,4500,BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust),WerkstoffLoader.Krypton.getFluidOrGas(1000),WerkstoffLoader.MagnetoResonaticDust.get(gem),10000,4500,BW_Util.getMachineVoltageFromTier(5)); + + + for (int i = 0; i < 11; i++) { + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( + new BWRecipes.DynamicGTRecipe(false, + new ItemStack[]{ + BW_Meta_Items.getNEWCIRCUITS().getStack(3), + WerkstoffLoader.MagnetoResonaticDust.get(gem), + BW_Meta_Items.getNEWCIRCUITS().getStack(i+3), + ItemList.Circuit_Parts_DiodeSMD.get((i+1)*4), + ItemList.Circuit_Parts_CapacitorSMD.get((i+1)*4), + ItemList.Circuit_Parts_TransistorSMD.get((i+1)*4) + }, + new ItemStack[]{ + BW_Meta_Items.getNEWCIRCUITS().getStack(i+4) + },null,null, + new FluidStack[]{ + Materials.SolderingAlloy.getMolten((i+1)*36) + },null,(i+1)*750,BW_Util.getMachineVoltageFromTier((i+1)),CLEANROOM)); + } + + //manual override for older GT + Werkstoff werkstoff = WerkstoffLoader.Oganesson; + Materials werkstoffBridgeMaterial = null; + boolean aElementSet = false; + for (Element e : Element.values()){ + if (e.toString().equals("Uuo")){ + werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName(),werkstoff.getDefaultName()); + werkstoffBridgeMaterial.mElement = e; + e.mLinkedMaterials.add(werkstoffBridgeMaterial); + aElementSet = true; + break; + } + } + if (!aElementSet) + return; + + GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),true); + try { + Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); + f.setAccessible(true); + Map MATERIALS_MAP = (Map) f.get(null); + MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); + } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { + e.printStackTrace(); + } + ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); + Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),32,0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),32,0)); + } } \ No newline at end of file -- cgit From ba0a7b6f7d64cf8ed59bf711e74a6b4b2016cb54 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 20 Aug 2019 01:05:58 +0200 Subject: added recipe for CircuitAssemblyLine +fixed unificationEnforcer for GT++ "molten."noblegases +added localisation for CircuitAssemblyLine achivment +added Capacity description to the GiantOutputHatch +added Xenon to the Liquid Air Distilling recipe Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: fbea0279363b61a810ea5b11d5b5535503fb310f --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 50 +++++++++++++++++----- .../bartworks/common/loaders/FluidLoader.java | 3 -- .../bartworks/common/loaders/RecipeLoader.java | 23 ++++++++++ .../tiered/GT_MetaTileEntity_GiantOutputHatch.java | 1 + .../processingLoaders/AdditionalRecipes.java | 2 +- 6 files changed, 66 insertions(+), 15 deletions(-) diff --git a/build.properties b/build.properties index ed11277dc1..a2526759a3 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=0_pre9 +buildNumber=0_pre10 APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 6f066cb893..64b1bf5c76 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -30,7 +30,10 @@ import com.github.bartimaeusnek.bartworks.client.creativetabs.BioTab; import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.loaders.*; +import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; +import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; import com.github.bartimaeusnek.bartworks.server.EventHandler.ServerEventHandler; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; @@ -38,7 +41,6 @@ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.Circ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader; import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BWRecipes; @@ -47,12 +49,17 @@ import com.google.common.collect.ArrayListMultimap; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.event.*; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartedEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; import gregtech.api.GregTech_API; -import gregtech.api.enums.*; -import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.*; import net.minecraft.creativetab.CreativeTabs; @@ -60,6 +67,7 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import org.apache.logging.log4j.LogManager; @@ -67,7 +75,9 @@ import org.apache.logging.log4j.Logger; import java.io.IOException; import java.lang.reflect.Field; -import java.util.*; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; @@ -165,6 +175,8 @@ public final class MainMod { GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor.desc","Basically a giant Hammer that presses Stuff - No more TNT!"); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.DEHP","Heat from below!"); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.DEHP.desc","Get ALL the thermal energy!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.CircuitAssemblyLine","Cheaper Circuits?"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.CircuitAssemblyLine.desc","Well, yes, but actually no..."); } } @Mod.EventHandler @@ -190,6 +202,25 @@ public final class MainMod { private static void unificationEnforcer() { for (Werkstoff werkstoff : Werkstoff.werkstoffHashMap.values()) { if (werkstoff.getGenerationFeatures().enforceUnification) { + if (werkstoff.contains(NOBLE_GAS)){ + String name = werkstoff.getFluidOrGas(1).getFluid().getName(); + String wrongname ="molten."+name; + FluidStack wrongNamedFluid = FluidRegistry.getFluidStack(wrongname,1); + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + for (GT_Recipe recipe : map.mRecipeList) { + for (int i = 0; i < recipe.mFluidInputs.length; i++) { + if (GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], wrongNamedFluid)) { + recipe.mFluidInputs[i] = werkstoff.getFluidOrGas(recipe.mFluidInputs[i].amount); + } + } + for (int i = 0; i < recipe.mFluidOutputs.length; i++) { + if (GT_Utility.areFluidsEqual(recipe.mFluidOutputs[i], wrongNamedFluid)) { + recipe.mFluidOutputs[i] = werkstoff.getFluidOrGas(recipe.mFluidOutputs[i].amount); + } + } + } + } + } MainMod.runMoltenUnificationEnfocement(werkstoff); for (OrePrefixes prefixes : OrePrefixes.values()) { if (OreDictionary.getOres(prefixes + werkstoff.getDefaultName()).size() > 1) { @@ -245,7 +276,7 @@ public final class MainMod { Field f = GT_Utility.class.getDeclaredField("sFilledContainerToData"); f.setAccessible(true); Map sFilledContainerToData = (Map) f.get(null); - HashSet torem = new HashSet(); + HashSet torem = new HashSet<>(); ItemStack toReplace = null; for (Map.Entry entry : sFilledContainerToData.entrySet()) { if (entry.getValue().fluid.equals(data.fluid) && !entry.getValue().filledContainer.equals(data.filledContainer)) { @@ -253,8 +284,8 @@ public final class MainMod { torem.add(entry); } } - torem.clear(); sFilledContainerToData.entrySet().removeAll(torem); + torem.clear(); if (toReplace != null) { for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { torem.clear(); @@ -285,7 +316,6 @@ public final class MainMod { map.mRecipeList.removeAll(torem); } } - GT_Utility.addFluidContainerData(data); } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { e.printStackTrace(); @@ -315,7 +345,7 @@ public final class MainMod { private static HashSet getNoGasItems(ArrayListMultimap base){ Iterator it = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.iterator(); HashSet toAdd = new HashSet<>(); - ArrayListMultimap repToAdd = ArrayListMultimap.create(); + ArrayListMultimap repToAdd = ArrayListMultimap.create(); while (it.hasNext()) { GT_Recipe recipe = it.next(); for (SubTag tag : base.keySet()) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 6503dcef86..5fa6e23213 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -58,9 +58,6 @@ public class FluidLoader implements Runnable { //OilProcessing chain public static Fluid fulvicAcid,heatedfulvicAcid,Kerogen; - - - @Override public void run() { FluidLoader.renderID = RenderingRegistry.getNextAvailableRenderId(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index ffe29352ba..5a85445f39 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -27,11 +27,13 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEnti import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_Windmill; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import ic2.core.Ic2Items; import net.minecraft.init.Blocks; @@ -771,6 +773,27 @@ public class RecipeLoader implements Runnable { 240000, BW_Util.getMachineVoltageFromTier(8) ); + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{ItemList.Hatch_Input_HV.get(64),Materials.LiquidAir.getCells(1),GT_Utility.getIntegratedCircuit(17)},new ItemStack[]{ItemRegistry.compressedHatch.copy()},null,null,null,null,300,BW_Util.getMachineVoltageFromTier(3),0)); + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{ItemList.Hatch_Output_HV.get(64),GT_Utility.getIntegratedCircuit(17)},new ItemStack[]{ItemRegistry.giantOutputHatch.copy()},null,null,null,null,300,BW_Util.getMachineVoltageFromTier(3),0)); + + GT_Values.RA.addAssemblylineRecipe( + ItemList.Machine_LuV_CircuitAssembler.get(1L),24000, + new ItemStack[]{ + ItemList.Machine_LuV_CircuitAssembler.get(1L), + ItemList.Robot_Arm_LuV.get(4L), + ItemList.Electric_Motor_LuV.get(4L), + ItemList.Field_Generator_LuV.get(1L), + ItemList.Emitter_LuV.get(1L), + ItemList.Sensor_LuV.get(1L), + Materials.Chrome.getPlates(8) + }, + new FluidStack[]{ + Materials.SolderingAlloy.getMolten(1440) + }, + ItemRegistry.cal.copy(), + 240000, + BW_Util.getMachineVoltageFromTier(6) + ); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java index 887b93db54..8bc01b5554 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java @@ -31,6 +31,7 @@ public class GT_MetaTileEntity_GiantOutputHatch extends GT_MetaTileEntity_Hatch_ public GT_MetaTileEntity_GiantOutputHatch(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 0); + this.mDescriptionArray[1] = "Capacity: 100000000L"; } public GT_MetaTileEntity_GiantOutputHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index fc6964875c..b07a9bc72f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -78,7 +78,7 @@ public class AdditionalRecipes implements Runnable { GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed,Materials.Lead,10L),GT_Utility.getIntegratedCircuit(17),GT_Values.NF,GT_Values.NF,Materials.Lead.getIngots(10),Materials.Tellurium.getNuggets(20),800,BW_Util.getMachineVoltageFromTier(2),722); GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium.getMolten(16), Materials.Beryllium.getMolten(16), WerkstoffLoader.Californium.getMolten(16), 250,49152, 480000000); GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), WerkstoffLoader.Calcium.getMolten(16), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500,49152, 600000000); - GT_Values.RA.addDistillationTowerRecipe(Materials.LiquidAir.getFluid(100000000),new FluidStack[]{Materials.Nitrogen.getGas(78084000),Materials.Oxygen.getGas(20946000),Materials.Argon.getGas(934000),Materials.CarbonDioxide.getGas(40700),WerkstoffLoader.Neon.getFluidOrGas(1818),Materials.Helium.getGas(524),Materials.Methane.getGas(180),WerkstoffLoader.Krypton.getFluidOrGas(114),Materials.Hydrogen.getGas(55)},null,7500,BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.addDistillationTowerRecipe(Materials.LiquidAir.getFluid(100000000),new FluidStack[]{Materials.Nitrogen.getGas(78084000),Materials.Oxygen.getGas(20946000),Materials.Argon.getGas(934000),Materials.CarbonDioxide.getGas(40700),WerkstoffLoader.Neon.getFluidOrGas(1818),Materials.Helium.getGas(524),Materials.Methane.getGas(180),WerkstoffLoader.Krypton.getFluidOrGas(114),Materials.Hydrogen.getGas(55),WerkstoffLoader.Xenon.getFluidOrGas(9)},null,7500,BW_Util.getMachineVoltageFromTier(4)); GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust),WerkstoffLoader.Neon.getFluidOrGas(1000),WerkstoffLoader.MagnetoResonaticDust.get(gemChipped,9),9000,4500,BW_Util.getMachineVoltageFromTier(5)); GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust),WerkstoffLoader.Krypton.getFluidOrGas(1000),WerkstoffLoader.MagnetoResonaticDust.get(gem),10000,4500,BW_Util.getMachineVoltageFromTier(5)); -- cgit From 23da1fbc8e9567a2e94551f660913c3cfcc19b51 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 22 Aug 2019 02:01:22 +0200 Subject: some fixed -fixed circuit assembly line not crafting -fixed some NEI/Circuit Assembly Line issues Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 7c15b789303c7673c351743e4885cb1abd9145d1 --- build.properties | 2 +- src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java | 11 ++++++++--- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 4 ---- .../material/CircuitGeneration/CircuitImprintLoader.java | 2 ++ 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/build.properties b/build.properties index a2526759a3..0ab6f85c59 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=0_pre10 +buildNumber=0_pre11 APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 64b1bf5c76..bc7bfe2bed 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -41,6 +41,7 @@ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.Circ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader; import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BWRecipes; @@ -60,6 +61,7 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; +import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.*; import net.minecraft.creativetab.CreativeTabs; @@ -366,12 +368,14 @@ public final class MainMod { } private static void editRecipes(ArrayListMultimap base, HashSet noGas) { + if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeFluidNameMap.contains(fluids.get(Oganesson).getName())) + return; HashSet toAdd = new HashSet<>(); for (SubTag GasTag : base.keySet()) { for (GT_Recipe recipe : base.get(GasTag)) { if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) { - String FluidString = recipe.mFluidInputs[0].getFluid().getName().replaceAll("molten", "").replaceAll("fluid", ""); - Materials mat = Materials.get(FluidString.substring(0, 1).toUpperCase() + FluidString.substring(1)); + String materialString = recipe.mFluidInputs[0].getFluid().getName().replaceAll("molten", "").replaceAll("fluid", ""); + Materials mat = Materials.get(materialString.substring(0, 1).toUpperCase() + materialString.substring(1)); if (mat != Materials._NULL) { for (Werkstoff werkstoff : Werkstoff.werkstoffHashMap.values()) { if (!werkstoff.contains(GasTag)) @@ -393,7 +397,8 @@ public final class MainMod { } GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.removeAll(base.get(GasTag)); } - GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.addAll(toAdd); + for (GT_Recipe recipe : toAdd) + GT_Recipe.GT_Recipe_Map.sBlastRecipes.add(recipe); } private static void addElectricImplosionCompressorRecipes() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 1db2ae5c15..6a075e0a31 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -115,8 +115,6 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(true,false,BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) { BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); - if (this.mEUt > 0) - this.mEUt = -this.mEUt; this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = this.bufferedRecipe.mOutputs; this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; @@ -144,8 +142,6 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl continue; BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); - if (this.mEUt > 0) - this.mEUt = -this.mEUt; this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = this.bufferedRecipe.mOutputs; this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 3ddadafffd..7f6cbe008e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -63,6 +63,8 @@ public class CircuitImprintLoader implements Runnable { @Override public void run() { + if (BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).mRecipeList.size() > 0) + return; Iterator it = GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.iterator(); GT_Recipe circuitRecipe; HashSet toRem = new HashSet<>(); -- cgit From 973c0e8e98807d368b6c0126864927c9c432f7ae Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 28 Aug 2019 21:49:22 +0200 Subject: Several fixes, last planned pre 0.5 release +worked on Ross128bA +added config option for magical forrests on Ross128b +fixed non working Werkstoff recipes +added config options for CAL +added config option for new EBF Gas recipes +added pictures for circuits (thanks EmeraldsEmerald) -fixed CAL recipe Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 70c7fc511c2ddacd908831e9d4501708bc23c332 --- build.properties | 2 +- .../bartimaeusnek/bartworks/API/INoiseGen.java | 33 ++ .../github/bartimaeusnek/bartworks/MainMod.java | 41 ++- .../bartworks/common/configs/ConfigHandler.java | 9 + .../bartworks/common/loaders/RecipeLoader.java | 2 +- .../bartworks/common/net/ServerJoinedPackage.java | 13 +- .../system/material/BW_MetaGeneratedOreTE.java | 3 +- .../system/material/BW_MetaGenerated_Ores.java | 23 +- .../CircuitGeneration/CircuitImprintLoader.java | 47 +-- .../bartworks/system/material/Werkstoff.java | 11 +- .../bartworks/system/material/WerkstoffLoader.java | 73 ++++- .../bartworks/util/NoiseUtil/BartsNoise.java | 237 ++++++++++++++ .../bartworks/util/NoiseUtil/SimplexNoise.java | 357 +++++++++++++++++++++ .../crossmod/galacticraft/GalacticraftProxy.java | 3 + .../atmosphere/BWAtmosphereManager.java | 113 +++++++ .../planets/ross128b/ChunkProviderRoss128b.java | 3 + .../planets/ross128ba/ChunkProviderRoss128ba.java | 33 ++ .../solarsystems/Ross128SolarSystem.java | 11 +- .../thaumcraft/util/ThaumcraftHandler.java | 15 +- .../textures/items/gt.bwMetaGeneratedItem0/10.png | Bin 0 -> 337 bytes .../textures/items/gt.bwMetaGeneratedItem0/11.png | Bin 0 -> 367 bytes .../textures/items/gt.bwMetaGeneratedItem0/12.png | Bin 0 -> 433 bytes .../textures/items/gt.bwMetaGeneratedItem0/13.png | Bin 0 -> 401 bytes .../textures/items/gt.bwMetaGeneratedItem0/14.png | Bin 0 -> 859 bytes .../textures/items/gt.bwMetaGeneratedItem0/4.png | Bin 0 -> 222 bytes .../textures/items/gt.bwMetaGeneratedItem0/5.png | Bin 0 -> 344 bytes .../textures/items/gt.bwMetaGeneratedItem0/6.png | Bin 0 -> 347 bytes .../textures/items/gt.bwMetaGeneratedItem0/7.png | Bin 0 -> 331 bytes .../textures/items/gt.bwMetaGeneratedItem0/8.png | Bin 0 -> 331 bytes .../textures/items/gt.bwMetaGeneratedItem0/9.png | Bin 0 -> 378 bytes src/main/resources/mcmod.info | 2 +- 31 files changed, 967 insertions(+), 64 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/10.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/11.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/12.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/13.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/14.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/4.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/5.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/6.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/7.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/8.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/9.png diff --git a/build.properties b/build.properties index 0ab6f85c59..21c042d7b7 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=0_pre11 +buildNumber=0_pre13 APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java new file mode 100644 index 0000000000..76612ad404 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +public interface INoiseGen { + + double getNoise(int x, int z); + double[][] getNoiseForRegion(int xStart, int zStart, int xEnd, int zEnd); + void setOctaves(int octaves); + void setFrequency(double freq); + void setSeed(long seed); + void setAmplitude(double amplitude); +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index bc7bfe2bed..ba65d2198a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -41,7 +41,6 @@ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.Circ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader; import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BWRecipes; @@ -61,7 +60,6 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; -import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.*; import net.minecraft.creativetab.CreativeTabs; @@ -74,6 +72,7 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import java.util.ArrayList; import java.io.IOException; import java.lang.reflect.Field; @@ -183,18 +182,20 @@ public final class MainMod { } @Mod.EventHandler public void onServerStarted(FMLServerStartedEvent event) { - MainMod.runOnPlayerJoined(ConfigHandler.classicMode); + MainMod.runOnPlayerJoined(ConfigHandler.classicMode, ConfigHandler.disableExtraGassesForEBF); } - public static void runOnPlayerJoined(boolean classicMode){ + public static void runOnPlayerJoined(boolean classicMode, boolean extraGasRecipes){ OreDictHandler.adaptCacheForWorld(); removeIC2Recipes(); MainMod.addElectricImplosionCompressorRecipes(); MainMod.unificationEnforcer(); - ArrayListMultimap tochange = MainMod.getRecipesToChange(NOBLE_GAS,ANAEROBE_GAS); - HashSet noGas = MainMod.getNoGasItems(tochange); - MainMod.editRecipes(tochange,noGas); + if (!extraGasRecipes) { + ArrayListMultimap toChange = MainMod.getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS); + HashSet noGas = MainMod.getNoGasItems(toChange); + MainMod.editRecipes(toChange, noGas); + } new CircuitImprintLoader().run(); if (classicMode) @@ -389,7 +390,12 @@ public final class MainMod { } for (ItemStack is : noGas) if (GT_Utility.areStacksEqual(is, recipe.mOutputs[0])) { - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + (double) mat.getProtons())), recipe.mEUt, recipe.mSpecialValue)); + ArrayList inputs = new ArrayList<>(recipe.mInputs.length); + for (ItemStack stack : recipe.mInputs) + if (!GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(11),stack)) + inputs.add(stack); + inputs.add(GT_Utility.getIntegratedCircuit(0)); + toAdd.add(new BWRecipes.DynamicGTRecipe(false, inputs.toArray(new ItemStack[0]), recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + ((double) mat.getProtons()*2.5D))), recipe.mEUt, recipe.mSpecialValue)); break; } } @@ -397,6 +403,25 @@ public final class MainMod { } GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.removeAll(base.get(GasTag)); } + HashSet duplicates = new HashSet(); + for (GT_Recipe recipe : toAdd){ + for (GT_Recipe recipe2 : toAdd){ + if (recipe.mEUt != recipe2.mEUt || recipe.mDuration != recipe2.mDuration || recipe.mSpecialValue != recipe2.mSpecialValue || recipe == recipe2 || recipe.mInputs.length != recipe2.mInputs.length || recipe.mFluidInputs.length != recipe2.mFluidInputs.length) + continue; + boolean isSame = true; + for (int i = 0; i < recipe.mInputs.length; i++) { + if (!GT_Utility.areStacksEqual(recipe.mInputs[i],recipe2.mInputs[i])) + isSame = false; + } + for (int i = 0; i < recipe.mFluidInputs.length; i++) { + if (!GT_Utility.areFluidsEqual(recipe.mFluidInputs[i],recipe2.mFluidInputs[i])) + isSame = false; + } + if (isSame) + duplicates.add(recipe2); + } + } + toAdd.removeAll(duplicates); for (GT_Recipe recipe : toAdd) GT_Recipe.GT_Recipe_Map.sBlastRecipes.add(recipe); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 10fe70816f..b5d5d8b972 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.common.configs; import com.github.bartimaeusnek.ASM.BWCoreTransformer; +import gregtech.api.enums.GT_Values; import net.minecraftforge.common.config.Configuration; import java.util.Arrays; @@ -44,6 +45,7 @@ public class ConfigHandler { public static int ross128bRuinChance = 512; public static int creativeScannerID; public static int bioVatMaxParallelBonus = 1000; + public static int cutoffTier = 5; public static long energyPerCell = 1000000L; @@ -51,6 +53,8 @@ public class ConfigHandler { public static boolean BioLab = true; public static boolean Ross128Enabled = true; + public static boolean disableExtraGassesForEBF; + public static boolean disableMagicalForest; public static boolean DEHPDirectSteam; public static boolean teslastaff; public static boolean classicMode; @@ -74,6 +78,9 @@ public class ConfigHandler { ConfigHandler.teslastaff = ConfigHandler.c.get("System", "Enable Teslastaff", false, "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); ConfigHandler.newStuff = !ConfigHandler.c.get("System", "Disable non-original-GT-stuff", false, "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false); ConfigHandler.BioLab = !ConfigHandler.c.get("System", "Disable BioLab", false, "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!").getBoolean(false); + ConfigHandler.cutoffTier = ConfigHandler.c.get("System", "Tier to nerf circuits", 5, "This switch sets the lowest unnerfed Circuit Recipe Tier. -1 to disable it completely.").getInt(5); + ConfigHandler.cutoffTier = (ConfigHandler.cutoffTier == -1 ? GT_Values.VN.length : ConfigHandler.cutoffTier); + ConfigHandler.disableExtraGassesForEBF = ConfigHandler.c.get("System", "Disable Extra Gases for EBF", false, "This switch disables extra gas recipes for the EBF, i.e. Xenon instead of Nitrogen").getBoolean(false); ConfigHandler.mbWaterperSec = ConfigHandler.c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150).getInt(150); @@ -100,6 +107,8 @@ public class ConfigHandler { ConfigHandler.ross128bRuinChance = ConfigHandler.c.get("CrossMod Interactions", "Ruin Chance - Ross128b", 512, "Higher Values mean lesser Ruins.").getInt(512); ConfigHandler.Ross128Enabled = ConfigHandler.c.get("CrossMod Interactions", "Galacticraft - Activate Ross128 System", true, "If the Ross128 System should be activated").getBoolean(true); ConfigHandler.landerType = ConfigHandler.c.get("CrossMod Interactions", "LanderType", 3, "1 = Moon Lander, 2 = Landing Balloons, 3 = Asteroid Lander").getInt(3); + ConfigHandler.disableMagicalForest = ConfigHandler.c.get("CrossMod Interactions", "Disable Magical Forest - Ross128b", false, "True disables the magical Forest Biome on Ross for more performance during World generation.").getBoolean(false); + ConfigHandler.setUpComments(); if (ConfigHandler.c.hasChanged()) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 5a85445f39..d6b1293cbf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -791,7 +791,7 @@ public class RecipeLoader implements Runnable { Materials.SolderingAlloy.getMolten(1440) }, ItemRegistry.cal.copy(), - 240000, + 24000, BW_Util.getMachineVoltageFromTier(6) ); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java index a9b37065e4..149db03d5b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java @@ -30,7 +30,7 @@ import net.minecraft.world.IBlockAccess; public class ServerJoinedPackage extends GT_Packet { - private boolean config; + private byte config; ServerJoinedPackage() { super(true); @@ -38,7 +38,8 @@ public class ServerJoinedPackage extends GT_Packet { public ServerJoinedPackage(Object obj) { super(false); - this.config = ConfigHandler.classicMode; + this.config =(byte) (ConfigHandler.classicMode && ConfigHandler.disableExtraGassesForEBF ? 3 : ConfigHandler.classicMode ? 2 : ConfigHandler.disableExtraGassesForEBF ? 1 : 0); + } @Override @@ -48,17 +49,19 @@ public class ServerJoinedPackage extends GT_Packet { @Override public byte[] encode() { - return new byte[]{(byte) (this.config ? 1 : 0)}; + return new byte[]{this.config}; } @Override public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { - this.config = byteArrayDataInput.readBoolean(); + this.config = byteArrayDataInput.readByte(); return this; } @Override public void process(IBlockAccess iBlockAccess) { - MainMod.runOnPlayerJoined(this.config); + boolean gas = (this.config & 1) != 0; + boolean classic = (this.config & 0b10) != 0; + MainMod.runOnPlayerJoined(classic,gas); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index 3fe6337b7d..45db6ce632 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -79,10 +79,9 @@ public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEn return rList; } - public Packet getDescriptionPacket() { + public void sendPacket(){ if (!this.worldObj.isRemote) BW_Network_instance.sendPacketToAllPlayersInRange(this.worldObj, new OrePacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); - return null; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index f09c5f7442..47e676e082 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; +import cpw.mods.fml.common.FMLCommonHandler; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; @@ -165,11 +166,27 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { @Override public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block p_149695_5_) { - aWorld.getTileEntity(aX, aY, aZ).getDescriptionPacket(); + if ((!aWorld.isRemote || this.checkForAir(aWorld,aX,aY,aZ)) && aWorld.getTileEntity(aX, aY, aZ) instanceof BW_MetaGeneratedOreTE) + ((BW_MetaGeneratedOreTE)aWorld.getTileEntity(aX, aY, aZ)).sendPacket(); } @Override public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int tileX, int tileY, int tileZ) { - aWorld.getTileEntity(aX, aY, aZ).getDescriptionPacket(); + if ((FMLCommonHandler.instance().getEffectiveSide().isServer() || this.checkForAir(aWorld,aX,aY,aZ)) && aWorld.getTileEntity(aX, aY, aZ) instanceof BW_MetaGeneratedOreTE) + ((BW_MetaGeneratedOreTE)aWorld.getTileEntity(aX, aY, aZ)).sendPacket(); + } + + private boolean checkForAir(IBlockAccess aWorld, int aX, int aY, int aZ){ + for (int x = -1; x <= 1; x++) { + for (int y = -1; y <= 1; y++) { + for (int z = -1; z <= 1; z++) { + if (x == 0 && y == 0 && z == 0) + continue; + if (aWorld.getBlock(aX+x,aY+y,aZ+z).isAir(aWorld,aX+x,aY+y,aZ+z)) + return true; + } + } + } + return false; } -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 7f6cbe008e..005f89cc88 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -89,12 +90,12 @@ public class CircuitImprintLoader implements Runnable { GT_Recipe newRecipe = CircuitImprintLoader.reBuildRecipe(circuitRecipe); if (newRecipe != null) BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(newRecipe); - if (circuitRecipe.mEUt > BW_Util.getTierVoltage(5)) { + if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) { toRem.add(circuitRecipe); toAdd.add(CircuitImprintLoader.makeMoreExpensive(circuitRecipe)); } } else { - if (circuitRecipe.mEUt > BW_Util.getTierVoltage(5)) { + if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) { toRem.add(circuitRecipe); } } @@ -193,26 +194,26 @@ public class CircuitImprintLoader implements Runnable { 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3)}); } - for (ItemStack stack : CircuitImprintLoader.bwCircuitTagMap.values()){ - NBTTagCompound tag = CircuitImprintLoader.getTagFromStack(stack); - CircuitData data = CircuitImprintLoader.bwCircuitTagMap.inverse().get(stack); - GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300, Math.toIntExact(data.getaVoltage()),data.getaSpecial()); - GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); - GameRegistry.addRecipe(new BWRecipes.BWNBTDependantCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), - " X ", - "GPG", - " X ", - 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), - 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), - 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3))); - GT_ModHandler.addCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1),GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS ,new Object[]{ - " X ", - "GPG", - " X ", - 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), - 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), - 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3) - }); - } +// for (ItemStack stack : CircuitImprintLoader.bwCircuitTagMap.values()){ +// NBTTagCompound tag = CircuitImprintLoader.getTagFromStack(stack); +// CircuitData data = CircuitImprintLoader.bwCircuitTagMap.inverse().get(stack); +// GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300, Math.toIntExact(data.getaVoltage()),data.getaSpecial()); +// GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); +// GameRegistry.addRecipe(new BWRecipes.BWNBTDependantCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), +// " X ", +// "GPG", +// " X ", +// 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), +// 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), +// 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3))); +// GT_ModHandler.addCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1),GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS ,new Object[]{ +// " X ", +// "GPG", +// " X ", +// 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), +// 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), +// 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3) +// }); +// } } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 64822f25fe..cc4841cad7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -282,9 +282,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @Override public boolean contains(SubTag subTag) { - for (Pair p : this.contents) - if (p.getKey().contains(subTag)) - return true; + if (!subTag.equals(WerkstoffLoader.NOBLE_GAS) && !subTag.equals(WerkstoffLoader.ANAEROBE_GAS)) + for (Pair p : this.contents) + if (p.getKey().contains(subTag)) + return true; return this.subtags.contains(subTag); } @@ -444,6 +445,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } + public boolean hasCells() { + return (this.toGenerate & 0b10000) != 0; + } + public boolean hasMolten() { return (this.toGenerate & 0b1000000) != 0; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 2b19c6a4c4..e8ae5f64ae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -78,8 +78,8 @@ public class WerkstoffLoader implements Runnable { public static final SubTag NOBLE_GAS = SubTag.getNewSubTag("NobleGas"); public static final SubTag ANAEROBE_GAS = SubTag.getNewSubTag("AnaerobeGas"); public static final SubTag ANAEROBE_SMELTING = SubTag.getNewSubTag("AnaerobeSmelting"); - public static OrePrefixes cellMolten; + static { for (OrePrefixes prefix : OrePrefixes.values()){ if (prefix.toString().equals("cellMolten")) @@ -636,7 +636,29 @@ public class WerkstoffLoader implements Runnable { //No Byproducts //No Ingredients ); - + public static final Werkstoff BArTiMaEuSNeK = new Werkstoff( + new short[]{0x00,0xff,0x00}, + "BArTiMaEuSNeK", + "Are you serious?", + new Werkstoff.Stats().setMeltingPoint(9001).setCentrifuge(true).setBlastFurnace(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems().addMetalItems().addMolten(), + 43, + TextureSet.SET_DIAMOND, + Arrays.asList( + Materials.Boron, + Materials.Titanium, + Materials.Europium + ), + new Pair<>(Materials.Boron,1), + new Pair<>(Materials.Argon,1), + new Pair<>(Materials.Titanium,1), + new Pair<>(Materials.Magic,1), + new Pair<>(Materials.Europium,1), + new Pair<>(Materials.Sulfur,1), + new Pair<>(WerkstoffLoader.Neon,1), + new Pair<>(Materials.Potassium,1) + ); public static HashMap items = new HashMap<>(); public static HashMap fluids = new HashMap<>(); @@ -644,6 +666,17 @@ public class WerkstoffLoader implements Runnable { public static Block BWOres; public boolean registered; + public static Werkstoff getWerkstoff(String Name){ + try{ + Field f = WerkstoffLoader.class.getField(Name); + if (f != null) + return (Werkstoff) f.get(null); + } catch (IllegalAccessException | NoSuchFieldException | ClassCastException e) { + e.printStackTrace(); + } + return Werkstoff.default_null_Werkstoff; + } + public static ItemStack getCorrespondingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff) { return WerkstoffLoader.getCorrespondingItemStack(orePrefixes, werkstoff, 1); } @@ -723,21 +756,21 @@ public class WerkstoffLoader implements Runnable { } private void addSubTags() { - - WerkstoffLoader.Krypton.add(WerkstoffLoader.NOBLE_GAS); - WerkstoffLoader.Xenon.add(WerkstoffLoader.NOBLE_GAS); - WerkstoffLoader.Neon.add(WerkstoffLoader.NOBLE_GAS); Materials.Helium.add(WerkstoffLoader.NOBLE_GAS); - + WerkstoffLoader.Neon.add(WerkstoffLoader.NOBLE_GAS); Materials.Argon.add(WerkstoffLoader.NOBLE_GAS); - + WerkstoffLoader.Krypton.add(WerkstoffLoader.NOBLE_GAS); + WerkstoffLoader.Xenon.add(WerkstoffLoader.NOBLE_GAS,WerkstoffLoader.ANAEROBE_GAS); + Materials.Radon.add(WerkstoffLoader.NOBLE_GAS); WerkstoffLoader.Oganesson.add(WerkstoffLoader.NOBLE_GAS,WerkstoffLoader.ANAEROBE_GAS); - Materials.Radon.add(WerkstoffLoader.NOBLE_GAS,WerkstoffLoader.ANAEROBE_GAS); Materials.Nitrogen.add(WerkstoffLoader.ANAEROBE_GAS); WerkstoffLoader.Calcium.add(WerkstoffLoader.ANAEROBE_SMELTING); + //Calcium Smelting block + Materials.Calcium.mBlastFurnaceRequired=true; + for (Werkstoff W : Werkstoff.werkstoffHashMap.values()) { for (Pair pair : W.getContents().getValue().toArray(new Pair[0])) { @@ -980,6 +1013,8 @@ public class WerkstoffLoader implements Runnable { cells += container.getValue(); } } else { + if (((Materials) container.getKey()).getDust(container.getValue()) == null ) + continue; if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); @@ -989,9 +1024,25 @@ public class WerkstoffLoader implements Runnable { } } } else if (container.getKey() instanceof Werkstoff) { - if (((Werkstoff) container.getKey()).getTexSet() == TextureSet.SET_FLUID) { - //not yet implemented no fluids from me... + if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).getGenerationFeatures().hasCells()) { + FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); + if (tmpFl == null || tmpFl.getFluid() == null) { + tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); + } + flOutputs.add(tmpFl); + if (flOutputs.size() > 1) { + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + } else { + stOutputs.add(((Werkstoff) container.getKey()).get(cell, tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + } + cells += container.getValue(); + } } else { + if (!((Werkstoff) container.getKey()).getGenerationFeatures().hasDusts()) + continue; if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java new file mode 100644 index 0000000000..7b62f34e2c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java @@ -0,0 +1,237 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util.NoiseUtil; + +import com.github.bartimaeusnek.bartworks.API.INoiseGen; +import gregtech.api.objects.XSTR; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.util.Random; + +public class BartsNoise implements INoiseGen { + public void setUsePhase(boolean usePhase) { + this.usePhase = usePhase; + } + + public void setRandom(Random random) { + this.random = random; + } + + boolean usePhase; + int octaves; + double frequency; + double amplitude; + long seed; + Random random; + + public enum NoiseColor{ + Red(-1),Pink(-0.5),White(0),Blue(0.5),Violet(1); + NoiseColor(double num) { + this.ampl=num; + } + double ampl; + public BartsNoise getColoredNoise(){ + BartsNoise noise = new BartsNoise(); + noise.setAmplitude(this.ampl); + return noise; + } + } + + public static double clamp(double input, double lowerBound, double upperBound){ + return Math.min(Math.max(input, lowerBound),upperBound); + } + public static double wrap(double input, double bound){ + return (((input % bound)+bound) % bound); + } + + public BartsNoise(int octaves, double frequency, double amplitude, long seed) { + this.octaves = octaves; + this.frequency = frequency; + this.amplitude = amplitude; + this.seed = seed; + this.random = new XSTR(seed); + } + + public BartsNoise() { + this.seed = new XSTR().nextLong(); + this.random = new XSTR(this.seed); + this.octaves = 1; + this.frequency = this.random.nextGaussian(); + this.amplitude = this.random.nextGaussian(); + } + + public BartsNoise(long seed) { + this.seed = seed; + this.random = new XSTR(seed); + this.octaves = 1; + this.frequency = this.random.nextGaussian(); + this.amplitude = this.random.nextGaussian(); + } + + public BartsNoise copy(){ + return new BartsNoise(this.octaves,this.frequency,this.amplitude,this.seed); + } + public BartsNoise copy(long seed){ + return new BartsNoise(this.octaves,this.frequency,this.amplitude,seed); + } +// public static void main(String[] args) throws IOException { +// +// BartsNoise noiseGen1 = new BartsNoise(2,0.005F,1D,System.nanoTime()); +//// BartsNoise noiseGen2 = new BartsNoise(1,0.002F,-1D,System.nanoTime()); +//// BartsNoise noiseGen3 = new BartsNoise(1,0.002F,-1D,System.nanoTime()); +// +// noiseGen1.setUsePhase(false); +//// noiseGen2.setUsePhase(false); +//// noiseGen3.setUsePhase(false); +// +// +// BufferedImage image = new BufferedImage(640, 640, BufferedImage.TYPE_INT_RGB); +// +// for (int chunkX = 0; chunkX < 40; chunkX++) { +// for (int chunkZ = 0; chunkZ < 40; chunkZ++) { +// for (int x = 0; x < 16; ++x) { +// for (int z = 0; z < 16; ++z) { +// double d = noiseGen1.getNoise(x + chunkX * 16, z + chunkZ * 16) * 2D; +//// double d2 = noiseGen2.getNoise(x + chunkX * 16, z + chunkZ * 16) * 2D; +//// double d3 = (noiseGen3.getNoise(x + chunkX * 16, z + chunkZ * 16) - 0.5D); +//// d3 *= 2; +// double yDev; +//// if (d3 < 0.0D) { +//// yDev = d; +//// } else if (d3 > 1.0D) { +//// yDev = d2; +//// } else { +// yDev = d*4; +//// } +// yDev=wrap(yDev,1); +// image.setRGB(x + chunkX * 16,z + chunkZ * 16,new Color((float)(1f*yDev),(float)(1f*yDev),(float)(1f*yDev)).getRGB()); +// } +// } +// } +// } +// File file = new File("myimage.png"); +// ImageIO.write(image, "png", file); +//// BartsNoise redNoise = NoiseColor.Blue.getColoredNoise(); +//// redNoise.setOctaves(1); +//// redNoise.setFrequency(0.05F); +//// for (int i = 40; i < 50; i++) { +//// String line = ""; +//// for (int j = 0; j < 10; j++) { +//// double num = (redNoise.getNoise(i,j)-0.5D); +//// line += num+","; +//// } +//// System.out.println(line); +//// } +// } + + public double getCosNoise(double x, double y){ + double pr = x * this.frequency; + double r1 = Math.cos(pr); + if (r1 < 0) + r1 = Math.abs(r1); + double result = Math.pow(r1, this.amplitude); + double pr2 = y * this.frequency; + double r2 = Math.cos(pr2); + if (r2 < 0) + r2 = Math.abs(r2); + double result2 = Math.pow(r2, this.amplitude); + result *= result2; + if (result == Double.POSITIVE_INFINITY) + result = Double.MAX_VALUE; + if (result == Double.NEGATIVE_INFINITY) + result = Double.MIN_VALUE; + return BartsNoise.wrap(result,1D); + } + + + double getNonOctavedNoise(double x, double y){ + double phase = SimplexNoise.noise( Math.pow(x*this.frequency,this.amplitude),Math.pow(y*this.frequency,this.amplitude)); + return BartsNoise.wrap(phase,1); + + } + + public double getNeighbouringNoise(int x, int y){ + return (this.getNoiseSingle(x-1,y-1)+ + this.getNoiseSingle(x,y-1) + + this.getNoiseSingle(x-1,y) + + this.getNoiseSingle(x+1,y) + + this.getNoiseSingle(x,y+1) + + this.getNoiseSingle(x+1,y+1) + + this.getNoiseSingle(x-1,y+1)+ + this.getNoiseSingle(x+1,y-1) + )/8; + } + + public double getNoiseSingle(int x, int y){ + double result = 0; + for (double i = 1; i <= this.octaves; i++) { + result += 1d/i * this.getNonOctavedNoise(i * x, i * y); + } + return result; + } + + @Override + public double getNoise(int x, int y) { + double result = 0; + for (double i = 1; i <= this.octaves; i++) { + result += 1d/i * this.getNonOctavedNoise(i * x, y); + } + //result = (this.getNeighbouringNoise(x,y)+result)/2; + return BartsNoise.wrap(result,1D); + } + + @Override + public double[][] getNoiseForRegion(int xStart, int zStart, int xEnd, int zEnd) { +// double[][] results = new double[Math.abs(xEnd)-Math.abs(xStart)][Math.abs(zEnd)-Math.abs(zStart)]; +// for (int i = xStart; i < xEnd; i++) { +// for (int j = zStart; j < zEnd; j++) { +// results +// } +// } + return new double[0][0]; + } + + @Override + public void setAmplitude(double amplitude) { + this.amplitude = amplitude; + } + + @Override + public void setOctaves(int octaves) { + this.octaves = octaves; + } + + @Override + public void setFrequency(double freq) { + this.frequency = freq; + } + + @Override + public void setSeed(long seed) { + this.seed=seed; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java new file mode 100644 index 0000000000..e494594bd2 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java @@ -0,0 +1,357 @@ +package com.github.bartimaeusnek.bartworks.util.NoiseUtil; +/* + * A speed-improved simplex noise algorithm for 2D, 3D and 4D in Java. + * + * Based on example code by Stefan Gustavson (stegu@itn.liu.se). + * Optimisations by Peter Eastman (peastman@drizzle.stanford.edu). + * Better rank ordering method by Stefan Gustavson in 2012. + * + * This could be speeded up even further, but it's useful as it is. + * + * Version 2012-03-09 + * + * This code was placed in the public domain by its original author, + * Stefan Gustavson. You may use it as you see fit, but + * attribution is appreciated. + * + */ + +public class SimplexNoise { // Simplex noise in 2D, 3D and 4D + private static Grad grad3[] = {new Grad(1,1,0),new Grad(-1,1,0),new Grad(1,-1,0),new Grad(-1,-1,0), + new Grad(1,0,1),new Grad(-1,0,1),new Grad(1,0,-1),new Grad(-1,0,-1), + new Grad(0,1,1),new Grad(0,-1,1),new Grad(0,1,-1),new Grad(0,-1,-1)}; + + private static Grad grad4[]= {new Grad(0,1,1,1),new Grad(0,1,1,-1),new Grad(0,1,-1,1),new Grad(0,1,-1,-1), + new Grad(0,-1,1,1),new Grad(0,-1,1,-1),new Grad(0,-1,-1,1),new Grad(0,-1,-1,-1), + new Grad(1,0,1,1),new Grad(1,0,1,-1),new Grad(1,0,-1,1),new Grad(1,0,-1,-1), + new Grad(-1,0,1,1),new Grad(-1,0,1,-1),new Grad(-1,0,-1,1),new Grad(-1,0,-1,-1), + new Grad(1,1,0,1),new Grad(1,1,0,-1),new Grad(1,-1,0,1),new Grad(1,-1,0,-1), + new Grad(-1,1,0,1),new Grad(-1,1,0,-1),new Grad(-1,-1,0,1),new Grad(-1,-1,0,-1), + new Grad(1,1,1,0),new Grad(1,1,-1,0),new Grad(1,-1,1,0),new Grad(1,-1,-1,0), + new Grad(-1,1,1,0),new Grad(-1,1,-1,0),new Grad(-1,-1,1,0),new Grad(-1,-1,-1,0)}; + + private static short p[] = {151,160,137,91,90,15, + 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23, + 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33, + 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166, + 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244, + 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196, + 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123, + 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42, + 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9, + 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228, + 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107, + 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254, + 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180}; + // To remove the need for index wrapping, double the permutation table length + private static short perm[] = new short[512]; + private static short permMod12[] = new short[512]; + static { + for(int i=0; i<512; i++) + { + perm[i]=p[i & 255]; + permMod12[i] = (short)(perm[i] % 12); + } + } + + // Skewing and unskewing factors for 2, 3, and 4 dimensions + private static final double F2 = 0.5*(Math.sqrt(3.0)-1.0); + private static final double G2 = (3.0-Math.sqrt(3.0))/6.0; + private static final double F3 = 1.0/3.0; + private static final double G3 = 1.0/6.0; + private static final double F4 = (Math.sqrt(5.0)-1.0)/4.0; + private static final double G4 = (5.0-Math.sqrt(5.0))/20.0; + + // This method is a *lot* faster than using (int)Math.floor(x) + private static int fastfloor(double x) { + int xi = (int)x; + return xy0) {i1=1; j1=0;} // lower triangle, XY order: (0,0)->(1,0)->(1,1) + else {i1=0; j1=1;} // upper triangle, YX order: (0,0)->(0,1)->(1,1) + // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and + // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where + // c = (3-sqrt(3))/6 + double x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords + double y1 = y0 - j1 + G2; + double x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords + double y2 = y0 - 1.0 + 2.0 * G2; + // Work out the hashed gradient indices of the three simplex corners + int ii = i & 255; + int jj = j & 255; + int gi0 = permMod12[ii+perm[jj]]; + int gi1 = permMod12[ii+i1+perm[jj+j1]]; + int gi2 = permMod12[ii+1+perm[jj+1]]; + // Calculate the contribution from the three corners + double t0 = 0.5 - x0*x0-y0*y0; + if(t0<0) n0 = 0.0; + else { + t0 *= t0; + n0 = t0 * t0 * dot(grad3[gi0], x0, y0); // (x,y) of grad3 used for 2D gradient + } + double t1 = 0.5 - x1*x1-y1*y1; + if(t1<0) n1 = 0.0; + else { + t1 *= t1; + n1 = t1 * t1 * dot(grad3[gi1], x1, y1); + } + double t2 = 0.5 - x2*x2-y2*y2; + if(t2<0) n2 = 0.0; + else { + t2 *= t2; + n2 = t2 * t2 * dot(grad3[gi2], x2, y2); + } + // Add contributions from each corner to get the final noise value. + // The result is scaled to return values in the interval [-1,1]. + return 70.0 * (n0 + n1 + n2); + } + + + // 3D simplex noise + public static double noise(double xin, double yin, double zin) { + double n0, n1, n2, n3; // Noise contributions from the four corners + // Skew the input space to determine which simplex cell we're in + double s = (xin+yin+zin)*F3; // Very nice and simple skew factor for 3D + int i = fastfloor(xin+s); + int j = fastfloor(yin+s); + int k = fastfloor(zin+s); + double t = (i+j+k)*G3; + double X0 = i-t; // Unskew the cell origin back to (x,y,z) space + double Y0 = j-t; + double Z0 = k-t; + double x0 = xin-X0; // The x,y,z distances from the cell origin + double y0 = yin-Y0; + double z0 = zin-Z0; + // For the 3D case, the simplex shape is a slightly irregular tetrahedron. + // Determine which simplex we are in. + int i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords + int i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords + if(x0>=y0) { + if(y0>=z0) + { i1=1; j1=0; k1=0; i2=1; j2=1; k2=0; } // X Y Z order + else if(x0>=z0) { i1=1; j1=0; k1=0; i2=1; j2=0; k2=1; } // X Z Y order + else { i1=0; j1=0; k1=1; i2=1; j2=0; k2=1; } // Z X Y order + } + else { // x0 y0) rankx++; else ranky++; + if(x0 > z0) rankx++; else rankz++; + if(x0 > w0) rankx++; else rankw++; + if(y0 > z0) ranky++; else rankz++; + if(y0 > w0) ranky++; else rankw++; + if(z0 > w0) rankz++; else rankw++; + int i1, j1, k1, l1; // The integer offsets for the second simplex corner + int i2, j2, k2, l2; // The integer offsets for the third simplex corner + int i3, j3, k3, l3; // The integer offsets for the fourth simplex corner + // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order. + // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0; + j1 = ranky >= 3 ? 1 : 0; + k1 = rankz >= 3 ? 1 : 0; + l1 = rankw >= 3 ? 1 : 0; + // Rank 2 denotes the second largest coordinate. + i2 = rankx >= 2 ? 1 : 0; + j2 = ranky >= 2 ? 1 : 0; + k2 = rankz >= 2 ? 1 : 0; + l2 = rankw >= 2 ? 1 : 0; + // Rank 1 denotes the second smallest coordinate. + i3 = rankx >= 1 ? 1 : 0; + j3 = ranky >= 1 ? 1 : 0; + k3 = rankz >= 1 ? 1 : 0; + l3 = rankw >= 1 ? 1 : 0; + // The fifth corner has all coordinate offsets = 1, so no need to compute that. + double x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords + double y1 = y0 - j1 + G4; + double z1 = z0 - k1 + G4; + double w1 = w0 - l1 + G4; + double x2 = x0 - i2 + 2.0*G4; // Offsets for third corner in (x,y,z,w) coords + double y2 = y0 - j2 + 2.0*G4; + double z2 = z0 - k2 + 2.0*G4; + double w2 = w0 - l2 + 2.0*G4; + double x3 = x0 - i3 + 3.0*G4; // Offsets for fourth corner in (x,y,z,w) coords + double y3 = y0 - j3 + 3.0*G4; + double z3 = z0 - k3 + 3.0*G4; + double w3 = w0 - l3 + 3.0*G4; + double x4 = x0 - 1.0 + 4.0*G4; // Offsets for last corner in (x,y,z,w) coords + double y4 = y0 - 1.0 + 4.0*G4; + double z4 = z0 - 1.0 + 4.0*G4; + double w4 = w0 - 1.0 + 4.0*G4; + // Work out the hashed gradient indices of the five simplex corners + int ii = i & 255; + int jj = j & 255; + int kk = k & 255; + int ll = l & 255; + int gi0 = perm[ii+perm[jj+perm[kk+perm[ll]]]] % 32; + int gi1 = perm[ii+i1+perm[jj+j1+perm[kk+k1+perm[ll+l1]]]] % 32; + int gi2 = perm[ii+i2+perm[jj+j2+perm[kk+k2+perm[ll+l2]]]] % 32; + int gi3 = perm[ii+i3+perm[jj+j3+perm[kk+k3+perm[ll+l3]]]] % 32; + int gi4 = perm[ii+1+perm[jj+1+perm[kk+1+perm[ll+1]]]] % 32; + // Calculate the contribution from the five corners + double t0 = 0.6 - x0*x0 - y0*y0 - z0*z0 - w0*w0; + if(t0<0) n0 = 0.0; + else { + t0 *= t0; + n0 = t0 * t0 * dot(grad4[gi0], x0, y0, z0, w0); + } + double t1 = 0.6 - x1*x1 - y1*y1 - z1*z1 - w1*w1; + if(t1<0) n1 = 0.0; + else { + t1 *= t1; + n1 = t1 * t1 * dot(grad4[gi1], x1, y1, z1, w1); + } + double t2 = 0.6 - x2*x2 - y2*y2 - z2*z2 - w2*w2; + if(t2<0) n2 = 0.0; + else { + t2 *= t2; + n2 = t2 * t2 * dot(grad4[gi2], x2, y2, z2, w2); + } + double t3 = 0.6 - x3*x3 - y3*y3 - z3*z3 - w3*w3; + if(t3<0) n3 = 0.0; + else { + t3 *= t3; + n3 = t3 * t3 * dot(grad4[gi3], x3, y3, z3, w3); + } + double t4 = 0.6 - x4*x4 - y4*y4 - z4*z4 - w4*w4; + if(t4<0) n4 = 0.0; + else { + t4 *= t4; + n4 = t4 * t4 * dot(grad4[gi4], x4, y4, z4, w4); + } + // Sum up and scale the result to cover the range [-1,1] + return 27.0 * (n0 + n1 + n2 + n3 + n4); + } + + // Inner class to speed upp gradient computations + // (array access is a lot slower than member access) + private static class Grad + { + double x, y, z, w; + + Grad(double x, double y, double z) + { + this.x = x; + this.y = y; + this.z = z; + } + + Grad(double x, double y, double z, double w) + { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java index 2c126759b8..cca1bf94d4 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java @@ -23,12 +23,14 @@ package com.github.bartimaeusnek.crossmod.galacticraft; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.crossmod.galacticraft.atmosphere.BWAtmosphereManager; import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import gregtech.api.objects.GT_UO_DimensionList; +import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.config.Configuration; import java.io.File; @@ -74,6 +76,7 @@ public class GalacticraftProxy { if (GalacticraftProxy.gtConf.hasChanged()) GalacticraftProxy.gtConf.save(); init_OresRoss128(); + MinecraftForge.EVENT_BUS.register(BWAtmosphereManager.INSTANCE); } public static void init(FMLInitializationEvent e) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java new file mode 100644 index 0000000000..0b835e382c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.atmosphere; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.Pair; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import com.google.common.collect.ArrayListMultimap; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.ISubTagContainer; +import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; +import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; +import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; + +import java.util.*; + +public final class BWAtmosphereManager { + + private static final Map COEFFICIENT_MAP = new HashMap<>(); + + private BWAtmosphereManager() { + BWAtmosphereManager.COEFFICIENT_MAP.put(1, new Integer[]{100}); + BWAtmosphereManager.COEFFICIENT_MAP.put(2,new Integer[]{70,30}); + BWAtmosphereManager.COEFFICIENT_MAP.put(3,new Integer[]{60,25,15}); + BWAtmosphereManager.COEFFICIENT_MAP.put(4,new Integer[]{50,25,15,10}); + BWAtmosphereManager.COEFFICIENT_MAP.put(5,new Integer[]{45,25,15,10,5}); + BWAtmosphereManager.COEFFICIENT_MAP.put(6,new Integer[]{45,20,15,10,5,5}); + BWAtmosphereManager.COEFFICIENT_MAP.put(7,new Integer[]{40,20,15,10,5,5,5}); + BWAtmosphereManager.COEFFICIENT_MAP.put(8,new Integer[]{35,20,15,10,5,5,5,5}); + BWAtmosphereManager.COEFFICIENT_MAP.put(9,new Integer[]{35,15,15,10,5,5,5,5,5}); + } + + public static final BWAtmosphereManager INSTANCE = new BWAtmosphereManager(); + + private static final ArrayListMultimap> gasConcentration = ArrayListMultimap.create(); + + public static List> getGasFromWorldID(int worldID){ + return BWAtmosphereManager.gasConcentration.get(worldID); + } + + public static void removeGasFromWorld(int worldID, ISubTagContainer gas){ + HashSet toRemSet = new HashSet(); + for (Pair pair : BWAtmosphereManager.gasConcentration.get(worldID)){ + if (pair.getKey().equals(gas)){ + BWAtmosphereManager.gasConcentration.get(worldID).remove(pair); + return; + } + } + } + + public static void addGasToWorld(int worldID, ISubTagContainer gas, int amount){ + Pair toadd = new Pair(gas,amount); + BWAtmosphereManager.gasConcentration.put(worldID,toadd); + } + + public static void addGasToWorld(int worldID, Pair toPut){ + BWAtmosphereManager.gasConcentration.put(worldID,toPut); + } + + public static void addGasToWorld(int worldID, Pair... toPut){ + for (Pair toadd : toPut) + BWAtmosphereManager.gasConcentration.put(worldID,toadd); + } + + private static boolean addGCGasToWorld(int worldID, IAtmosphericGas gas, int aNumber, int aMaxNumber){ + if (gas.equals(IAtmosphericGas.CO2)) { + BWAtmosphereManager.addGasToWorld(worldID, Materials.CarbonDioxide, BWAtmosphereManager.COEFFICIENT_MAP.get(aMaxNumber)[aNumber]); + return true; + } + String name = gas.toString(); + name = name.substring(0,1)+name.substring(1).toLowerCase(Locale.US); + ISubTagContainer mat = Materials.get(name); + if (mat == Materials._NULL){ + mat = WerkstoffLoader.getWerkstoff(name); + } + if (mat == Werkstoff.default_null_Werkstoff){ + return false; + } + BWAtmosphereManager.addGasToWorld(worldID, mat, BWAtmosphereManager.COEFFICIENT_MAP.get(aMaxNumber)[aNumber]); + return true; + } + + @SubscribeEvent + public void gcAutoRegister(GalaxyRegistry.PlanetRegisterEvent event){ + CelestialBody planet = GalaxyRegistry.getRegisteredPlanets().get(event.planetName); + for (int i = 0; i < planet.atmosphere.size(); i++) { + if (!BWAtmosphereManager.addGCGasToWorld(planet.getDimensionID(),planet.atmosphere.get(i),i,planet.atmosphere.size())) + BartWorksCrossmod.LOGGER.warn("Unidentified Fluid ("+planet.atmosphere.get(i)+") in the Atmosphere of: "+planet.getLocalizedName()); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index 08f496edda..807ad35055 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -44,6 +44,7 @@ import net.minecraft.world.gen.feature.WorldGenLakes; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.PopulateChunkEvent; import net.minecraftforge.event.terraingen.TerrainGen; +import sun.security.krb5.Config; import java.util.List; @@ -85,6 +86,8 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { if (Loader.isModLoaded("Thaumcraft")) { if (ThaumcraftHandler.isTaintBiome(biomeGenBase.biomeID)) this.biomesForGeneration[i] = BiomeGenBase.taiga; + else if (ConfigHandler.disableMagicalForest && ThaumcraftHandler.isMagicalForestBiome(biomeGenBase.biomeID)) + this.biomesForGeneration[i] = BiomeGenBase.birchForest; } } this.replaceBlocksForBiome(p_73154_1_, p_73154_2_, ablock, abyte, this.biomesForGeneration); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java index aa0968a95b..677bb17e39 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java @@ -22,8 +22,11 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba; +import com.github.bartimaeusnek.bartworks.util.NoiseUtil.BartsNoise; import gregtech.api.objects.XSTR; import micdoodle8.mods.galacticraft.api.prefab.world.gen.MapGenBaseMeta; +import micdoodle8.mods.galacticraft.core.blocks.GCBlocks; +import micdoodle8.mods.galacticraft.core.perlin.NoiseModule; import micdoodle8.mods.galacticraft.core.world.gen.BiomeGenBaseMoon; import micdoodle8.mods.galacticraft.core.world.gen.ChunkProviderMoon; import micdoodle8.mods.galacticraft.core.world.gen.MapGenCavesMoon; @@ -63,4 +66,34 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { Chunk.generateSkylightMap(); return Chunk; } + + private int getIndex(int x, int y, int z) { + return (x * 16 + z) * 256 + y; + } + + final Block lowerBlockID = GCBlocks.blockMoon; + final BartsNoise noiseGen= new BartsNoise(2,0.008F,1D,System.nanoTime()); + final BartsNoise noiseGen2= new BartsNoise(2,0.01F,1D,System.nanoTime()); + final BartsNoise noiseGen3= new BartsNoise(2,0.002F,1D,System.nanoTime()); + + public void generateTerrain(int chunkX, int chunkZ, Block[] idArray, byte[] metaArray) { + for(int x = 0; x < 16; ++x) { + for(int z = 0; z < 16; ++z) { + double d = noiseGen.getNoise(x + chunkX * 16, z + chunkZ * 16); + double d2 = noiseGen2.getNoise(x + chunkX * 16, z + chunkZ * 16); + double d3 = noiseGen3.getCosNoise(x + chunkX * 16, z + chunkZ * 16); + + double yDev = d*4+d2*2+d3; + + for(int y = 0; y < 128; ++y) { + if ((double)y < 60.0D + yDev) { + idArray[this.getIndex(x, y, z)] = this.lowerBlockID; + int var10001 = this.getIndex(x, y, z); + metaArray[var10001] = 4; + } + } + } + } + + } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index 121a31bf2f..359450c7f9 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.WorldProviderRoss128b; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba.WorldProviderRoss128Ba; import cpw.mods.fml.common.Loader; import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; import micdoodle8.mods.galacticraft.api.galaxies.*; @@ -67,14 +68,14 @@ public class Ross128SolarSystem { Ross128SolarSystem.Ross128ba = new Moon("Ross128ba").setParentPlanet(Ross128SolarSystem.Ross128b); Ross128SolarSystem.Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)).setRelativeOrbitTime(1 / 0.01F); Ross128SolarSystem.Ross128ba.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); -// Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128Ba.class); - Ross128SolarSystem.Ross128ba.setTierRequired(Loader.isModLoaded("galaxyspace") ? 4 : 3); + Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128Ba.class); + Ross128SolarSystem.Ross128ba.setTierRequired(Loader.isModLoaded("galaxyspace") ? Math.min(ConfigHandler.ross128btier + 1, 8) : 3); - Ross128SolarSystem.Ross128ba.setUnreachable(); + //Ross128SolarSystem.Ross128ba.setUnreachable(); - GalaxyRegistry.registerPlanet(Ross128SolarSystem.Ross128b); - GalaxyRegistry.registerMoon(Ross128SolarSystem.Ross128ba); GalaxyRegistry.registerSolarSystem(Ross128SolarSystem.Ross128System); + GalaxyRegistry.registerPlanet(Ross128SolarSystem.Ross128b); +// GalaxyRegistry.registerMoon(Ross128SolarSystem.Ross128ba); GalacticraftRegistry.registerRocketGui(WorldProviderRoss128b.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/overworldRocketGui.png")); // GalacticraftRegistry.registerRocketGui(WorldProviderRoss128Ba.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/moonRocketGui.png")); GalacticraftRegistry.registerTeleportType(WorldProviderRoss128b.class, new UniversalTeleportType()); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index ebede8bf4b..ef6dcde7f0 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -38,7 +38,7 @@ public class ThaumcraftHandler { private ThaumcraftHandler(){} private static Integer taintBiomeID; - + private static Integer magicalForestBiomeID; private static Class mWandInterface; static { @@ -57,6 +57,19 @@ public class ThaumcraftHandler { } } + public static boolean isMagicalForestBiome(int biomeID){ + if (ThaumcraftHandler.magicalForestBiomeID == null) { + try { + BiomeGenBase biome = (BiomeGenBase) Class.forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator").getField("biomeMagicalForest").get(null); + return biomeID == (ThaumcraftHandler.magicalForestBiomeID = biome.biomeID); + } catch (ClassCastException | ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + return false; + } + } + return biomeID == ThaumcraftHandler.magicalForestBiomeID; + } + public static boolean isTaintBiome(int biomeID){ if (ThaumcraftHandler.taintBiomeID == null) { try { diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/10.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/10.png new file mode 100644 index 0000000000..38429ed78d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/10.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/11.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/11.png new file mode 100644 index 0000000000..3901815927 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/11.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/12.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/12.png new file mode 100644 index 0000000000..c97ec3384c Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/12.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/13.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/13.png new file mode 100644 index 0000000000..40e5c92817 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/13.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/14.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/14.png new file mode 100644 index 0000000000..10c6f20de0 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/14.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/4.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/4.png new file mode 100644 index 0000000000..86411e18bd Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/4.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/5.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/5.png new file mode 100644 index 0000000000..57a7c7a932 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/5.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/6.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/6.png new file mode 100644 index 0000000000..9f68371247 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/6.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/7.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/7.png new file mode 100644 index 0000000000..7a322b76c0 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/7.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/8.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/8.png new file mode 100644 index 0000000000..9fe039db81 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/8.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/9.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/9.png new file mode 100644 index 0000000000..457a51b7a1 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/9.png differ diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 82e2fed82f..ce4324d98d 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -8,7 +8,7 @@ "url": "https://github.com/bartimaeusnek/bartworks", "updateUrl": "", "authorList": ["bartimaeusnek"], - "credits": "Gregorius Techneticies for making gregtech and allowing me to port his old stuff. Austin Appleby and Yonik Seeley for creating and putting the MurmurHash3 into the public domain.", + "credits": "Gregorius Techneticies for making gregtech and allowing me to port his old stuff.\n Austin Appleby and Yonik Seeley for creating and putting the MurmurHash3 into the public domain.\n Spluff and EmeraldsEmerald for the Awesome Textures aswell.", "logoFile": "", "screenshots": [], "dependencies": [] -- cgit From 11a3d36162113bb6f2d5f81b36aea3feceb55074 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 30 Aug 2019 04:13:28 +0200 Subject: fixed circuits, and missing recipes for EBF +added stuff to debug log +code inprovement Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 273819d206f4a409c6f76c97e84e05a2029c8ad7 --- .../github/bartimaeusnek/bartworks/MainMod.java | 31 ++++++++++++++-------- .../bartworks/common/loaders/BioRecipeLoader.java | 6 ++--- .../bartworks/common/loaders/RecipeLoader.java | 4 +-- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 4 +-- .../material/CircuitGeneration/BW_Meta_Items.java | 2 +- .../CircuitGeneration/CircuitImprintLoader.java | 7 +++-- .../CircuitGeneration/CircuitPartLoader.java | 2 +- .../bartworks/system/material/Werkstoff.java | 2 -- .../bartworks/system/material/WerkstoffLoader.java | 8 +++--- .../processingLoaders/AdditionalRecipes.java | 19 ++++++------- .../bartimaeusnek/bartworks/util/BWRecipes.java | 3 --- .../bartimaeusnek/bartworks/util/BW_Util.java | 17 +++++++++--- 12 files changed, 60 insertions(+), 45 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index ba65d2198a..ad9f161c73 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -336,8 +336,10 @@ public final class MainMod { Materials mat = Materials.get(FluidString.substring(0, 1).toUpperCase() + FluidString.substring(1)); if (mat != Materials._NULL) { for (SubTag tag : GasTags){ - if (mat.contains(tag)) - toAdd.put(tag,recipe); + if (mat.contains(tag)) { + DebugLog.log("Found EBF Recipe to change, Output:"+ BW_Util.translateGTItemStack(recipe.mOutputs[0])); + toAdd.put(tag, recipe); + } } } } @@ -356,7 +358,7 @@ public final class MainMod { for (GT_Recipe baseRe : base.get(tag)) { if (recipe.mInputs.length == baseRe.mInputs.length && recipe.mOutputs.length == baseRe.mOutputs.length) for (int i = 0; i < recipe.mInputs.length; i++) { - if ((recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) && BW_Util.checkStackAndPrefix(recipe.mInputs[i]) && BW_Util.checkStackAndPrefix(baseRe.mInputs[i]) && GT_OreDictUnificator.getAssociation(recipe.mInputs[i]).mMaterial.mMaterial.equals(GT_OreDictUnificator.getAssociation(baseRe.mInputs[i]).mMaterial.mMaterial) && GT_Utility.areStacksEqual(recipe.mOutputs[0], recipe.mOutputs[0])) { + if ((recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) && BW_Util.checkStackAndPrefix(recipe.mInputs[i]) && BW_Util.checkStackAndPrefix(baseRe.mInputs[i]) && GT_OreDictUnificator.getAssociation(recipe.mInputs[i]).mMaterial.mMaterial.equals(GT_OreDictUnificator.getAssociation(baseRe.mInputs[i]).mMaterial.mMaterial) && GT_Utility.areStacksEqual(recipe.mOutputs[0], baseRe.mOutputs[0])) { toAdd.add(recipe.mOutputs[0]); repToAdd.put(tag,recipe); continue recipeLoop; @@ -381,29 +383,36 @@ public final class MainMod { for (Werkstoff werkstoff : Werkstoff.werkstoffHashMap.values()) { if (!werkstoff.contains(GasTag)) continue; - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(fluids.get(werkstoff), recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + (double) mat.getProtons() - (double) werkstoff.getStats().getProtons())), recipe.mEUt, recipe.mSpecialValue)); + int time = (int) ((double) recipe.mDuration / 200D * (200D + (werkstoff.getStats().getProtons() > mat.getProtons() ? (double) mat.getProtons() - (double) werkstoff.getStats().getProtons() : (double) mat.getProtons()*2.75D - (double) werkstoff.getStats().getProtons()))); + toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(fluids.get(werkstoff), recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); } for (Materials materials : Materials.values()) { if (!materials.contains(GasTag)) continue; - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{materials.getGas(recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + (double) mat.getProtons() - (double) materials.getProtons())), recipe.mEUt, recipe.mSpecialValue)); + int time = (int) ((double) recipe.mDuration / 200D * (200D + (materials.getProtons() > mat.getProtons() ? (double) mat.getProtons() - (double) materials.getProtons() : (double) mat.getProtons()*2.75D - (double) materials.getProtons()))); + toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{materials.getGas(recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); } - for (ItemStack is : noGas) + for (ItemStack is : noGas) { + byte circuitConfiguration = 1; if (GT_Utility.areStacksEqual(is, recipe.mOutputs[0])) { ArrayList inputs = new ArrayList<>(recipe.mInputs.length); for (ItemStack stack : recipe.mInputs) - if (!GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(11),stack)) + if (!GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(11), stack) && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(14), stack) && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(19), stack)) { + if (BW_Util.checkStackAndPrefix(stack)) + circuitConfiguration = (byte) (GT_OreDictUnificator.getAssociation(stack).mPrefix.equals(OrePrefixes.dustSmall) ? 4 : GT_OreDictUnificator.getAssociation(stack).mPrefix.equals(OrePrefixes.dustTiny) ? 9 : 1); inputs.add(stack); - inputs.add(GT_Utility.getIntegratedCircuit(0)); - toAdd.add(new BWRecipes.DynamicGTRecipe(false, inputs.toArray(new ItemStack[0]), recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + ((double) mat.getProtons()*2.5D))), recipe.mEUt, recipe.mSpecialValue)); + } + inputs.add(GT_Utility.getIntegratedCircuit(circuitConfiguration)); + toAdd.add(new BWRecipes.DynamicGTRecipe(false, inputs.toArray(new ItemStack[0]), recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + ((double) mat.getProtons() * 2.75D))), recipe.mEUt, recipe.mSpecialValue)); break; } + } } } } GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.removeAll(base.get(GasTag)); } - HashSet duplicates = new HashSet(); + HashSet duplicates = new HashSet<>(); for (GT_Recipe recipe : toAdd){ for (GT_Recipe recipe2 : toAdd){ if (recipe.mEUt != recipe2.mEUt || recipe.mDuration != recipe2.mDuration || recipe.mSpecialValue != recipe2.mSpecialValue || recipe == recipe2 || recipe.mInputs.length != recipe2.mInputs.length || recipe.mFluidInputs.length != recipe2.mFluidInputs.length) @@ -445,4 +454,4 @@ public final class MainMod { return (GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L)) || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); } -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index 54d5ecda9f..7d5409bf00 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -376,8 +376,8 @@ public class BioRecipeLoader extends RecipeLoader { 2748, BW_Util.getMachineVoltageFromTier(3) ); - GT_Values.RA.addFluidHeaterRecipe(GT_Utility.getIntegratedCircuit(10),new FluidStack(FluidLoader.fulvicAcid,1000),new FluidStack(FluidLoader.heatedfulvicAcid,1000),90,BW_Util.getMachineVoltageFromTier(2)); - GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(10),null,new FluidStack(FluidLoader.heatedfulvicAcid,1000),new FluidStack(FluidLoader.Kerogen,1000),null,75,BW_Util.getMachineVoltageFromTier(2)); - GT_Values.RA.addPyrolyseRecipe(Materials.Wood.getDust(10),new FluidStack(FluidLoader.Kerogen,1000),10,null,Materials.Oil.getFluid(1000),105,BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addFluidHeaterRecipe(GT_Utility.getIntegratedCircuit(10),new FluidStack(FluidLoader.fulvicAcid,1000),new FluidStack(FluidLoader.heatedfulvicAcid,1000),90, BW_Util.getMachineVoltageFromTier(2)); + GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(10),null,new FluidStack(FluidLoader.heatedfulvicAcid,1000),new FluidStack(FluidLoader.Kerogen,1000),null,75, BW_Util.getMachineVoltageFromTier(2)); + GT_Values.RA.addPyrolyseRecipe(Materials.Wood.getDust(10),new FluidStack(FluidLoader.Kerogen,1000),10,null,Materials.Oil.getFluid(1000),105, BW_Util.getMachineVoltageFromTier(3)); } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index d6b1293cbf..5426e20a99 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -773,8 +773,8 @@ public class RecipeLoader implements Runnable { 240000, BW_Util.getMachineVoltageFromTier(8) ); - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{ItemList.Hatch_Input_HV.get(64),Materials.LiquidAir.getCells(1),GT_Utility.getIntegratedCircuit(17)},new ItemStack[]{ItemRegistry.compressedHatch.copy()},null,null,null,null,300,BW_Util.getMachineVoltageFromTier(3),0)); - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{ItemList.Hatch_Output_HV.get(64),GT_Utility.getIntegratedCircuit(17)},new ItemStack[]{ItemRegistry.giantOutputHatch.copy()},null,null,null,null,300,BW_Util.getMachineVoltageFromTier(3),0)); + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{ItemList.Hatch_Input_HV.get(64),Materials.LiquidAir.getCells(1),GT_Utility.getIntegratedCircuit(17)},new ItemStack[]{ItemRegistry.compressedHatch.copy()},null,null,null,null,300, BW_Util.getMachineVoltageFromTier(3),0)); + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{ItemList.Hatch_Output_HV.get(64),GT_Utility.getIntegratedCircuit(17)},new ItemStack[]{ItemRegistry.giantOutputHatch.copy()},null,null,null,null,300, BW_Util.getMachineVoltageFromTier(3),0)); GT_Values.RA.addAssemblylineRecipe( ItemList.Machine_LuV_CircuitAssembler.get(1L),24000, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 6a075e0a31..ef71506d0e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -113,7 +113,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl if (!this.imprintMachine(itemStack)) return false; - if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(true,false,BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) { + if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), BW_Util.getItemsFromInputBusses(this))) { BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = this.bufferedRecipe.mOutputs; @@ -136,7 +136,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl } for (GT_Recipe recipe : this.GT_RECIPE_COLLECTION) { - if (recipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) + if (recipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), BW_Util.getItemsFromInputBusses(this))) this.bufferedRecipe = recipe; else continue; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index 86ddee4fbd..dfb48a7b50 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -70,7 +70,7 @@ public class BW_Meta_Items { BW_Meta_Items.NEWCIRCUITS.addItem(2,"Raw Imprint supporting Board","A Raw Board needed for Circuit Imprints"); BW_Meta_Items.NEWCIRCUITS.addItem(3,"Imprint supporting Board","A Board needed for Circuit Imprints"); GT_Values.RA.addFormingPressRecipe(WerkstoffLoader.MagnetoResonaticDust.get(OrePrefixes.dust,1),WerkstoffLoader.ArInGaPhoBiBoTe.get(OrePrefixes.dust,4),BW_Meta_Items.NEWCIRCUITS.getStack(2),300,480); - GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{BW_Meta_Items.NEWCIRCUITS.getStack(2)},new ItemStack[]{BW_Meta_Items.NEWCIRCUITS.getStack(3)},null,new int[]{7500},new FluidStack[]{Materials.SolderingAlloy.getMolten(576)},null,300,BW_Util.getMachineVoltageFromTier(4),BW_Util.CLEANROOM)); + GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{BW_Meta_Items.NEWCIRCUITS.getStack(2)},new ItemStack[]{BW_Meta_Items.NEWCIRCUITS.getStack(3)},null,new int[]{7500},new FluidStack[]{Materials.SolderingAlloy.getMolten(576)},null,300, BW_Util.getMachineVoltageFromTier(4), BW_Util.CLEANROOM)); } public void addNewCircuit(int aTier, int aID, String aName){ diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 005f89cc88..26f774b780 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -137,6 +137,9 @@ public class CircuitImprintLoader implements Runnable { if (BW_Util.checkStackAndPrefix(original.mInputs[i]) && GT_OreDictUnificator.getAssociation(original.mInputs[i]).mPrefix == OrePrefixes.wireGt01){ in[i] = GT_OreDictUnificator.get(OrePrefixes.wireGt16,GT_OreDictUnificator.getAssociation(original.mInputs[i]).mMaterial.mMaterial,original.mInputs[i].stackSize); } + else if (BW_Util.checkStackAndPrefix(original.mInputs[i]) && GT_OreDictUnificator.getAssociation(original.mInputs[i]).mPrefix == OrePrefixes.wireFine){ + in[i] = GT_OreDictUnificator.get(OrePrefixes.wireGt04,GT_OreDictUnificator.getAssociation(original.mInputs[i]).mMaterial.mMaterial,original.mInputs[i].stackSize); + } else { in[i] = original.mInputs[i].copy(); in[i].stackSize *= 16; @@ -176,8 +179,8 @@ public class CircuitImprintLoader implements Runnable { for (GT_Recipe recipe : CircuitImprintLoader.recipeTagMap.get(tag)) { eut = Math.min(eut, recipe.mEUt); } - eut = Math.min(eut,BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName(OreDictionary.getOreIDs(stack)[0])))); - GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300,eut,BW_Util.CLEANROOM); + eut = Math.min(eut, BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName(OreDictionary.getOreIDs(stack)[0])))); + GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300,eut, BW_Util.CLEANROOM); GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); GameRegistry.addRecipe(new BWRecipes.BWNBTDependantCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), " X ", diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index 4c754e4caf..e946fab6ec 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -92,7 +92,7 @@ public class CircuitPartLoader implements Runnable { // tt += "Internal Name = "+single; String localised = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); BW_Meta_Items.getNEWCIRCUITS().addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised+"s", tt); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{single.get(16).copy()}, Materials.Plastic.getMolten(576),BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs),600,30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{single.get(16).copy()}, Materials.Plastic.getMolten(72),BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs),600,30); CircuitImprintLoader.circuitIIconRefs.put(CircuitImprintLoader.reverseIDs,single); CircuitImprintLoader.reverseIDs--; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index cc4841cad7..5d73dba279 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -29,10 +29,8 @@ import com.github.bartimaeusnek.bartworks.util.Pair; import gregtech.api.enums.*; import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.interfaces.ISubTagContainer; -import gregtech.api.objects.GT_Fluid; import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import java.nio.ByteBuffer; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index e8ae5f64ae..bc7b4b54aa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1136,8 +1136,8 @@ public class WerkstoffLoader implements Runnable { ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput,werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(dust)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),32,0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, null,new ItemStack[]{werkstoff.get(dust)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),32,0)); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(dust)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),30,0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, null,new ItemStack[]{werkstoff.get(dust)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),30,0)); } } } @@ -1253,8 +1253,8 @@ public class WerkstoffLoader implements Runnable { ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput,werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),32,0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),32,0)); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),30,0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),30,0)); } } private void addMoltenRecipes(Werkstoff werkstoff) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index b07a9bc72f..3878422bbe 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -23,10 +23,7 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; -import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_CircuitsLoader; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; -import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; -import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; @@ -50,7 +47,7 @@ public class AdditionalRecipes implements Runnable { @Override public void run() { //Thorium/Yttrium Glas - GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall,2),WerkstoffLoader.Thorianit.get(dustSmall,2),Materials.Glass.getMolten(144),null,new ItemStack(ItemRegistry.bw_glasses[0],1,12),null,800,BW_Util.getMachineVoltageFromTier(5),3663); + GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall,2),WerkstoffLoader.Thorianit.get(dustSmall,2),Materials.Glass.getMolten(144),null,new ItemStack(ItemRegistry.bw_glasses[0],1,12),null,800, BW_Util.getMachineVoltageFromTier(5),3663); //Thorianit recipes GT_Values.RA.addSifterRecipe(WerkstoffLoader.Thorianit.get(crushedPurified), new ItemStack[]{ @@ -75,12 +72,12 @@ public class AdditionalRecipes implements Runnable { GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(11),Materials.Oxygen.getGas(3000),null, WerkstoffLoader.YttriumOxide.get(dust,5),64, BW_Util.getMachineVoltageFromTier(4)); GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust,10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.CubicZirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953); //Tellurium - GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed,Materials.Lead,10L),GT_Utility.getIntegratedCircuit(17),GT_Values.NF,GT_Values.NF,Materials.Lead.getIngots(10),Materials.Tellurium.getNuggets(20),800,BW_Util.getMachineVoltageFromTier(2),722); + GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed,Materials.Lead,10L),GT_Utility.getIntegratedCircuit(17),GT_Values.NF,GT_Values.NF,Materials.Lead.getIngots(10),Materials.Tellurium.getNuggets(20),800, BW_Util.getMachineVoltageFromTier(2),722); GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium.getMolten(16), Materials.Beryllium.getMolten(16), WerkstoffLoader.Californium.getMolten(16), 250,49152, 480000000); GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), WerkstoffLoader.Calcium.getMolten(16), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500,49152, 600000000); - GT_Values.RA.addDistillationTowerRecipe(Materials.LiquidAir.getFluid(100000000),new FluidStack[]{Materials.Nitrogen.getGas(78084000),Materials.Oxygen.getGas(20946000),Materials.Argon.getGas(934000),Materials.CarbonDioxide.getGas(40700),WerkstoffLoader.Neon.getFluidOrGas(1818),Materials.Helium.getGas(524),Materials.Methane.getGas(180),WerkstoffLoader.Krypton.getFluidOrGas(114),Materials.Hydrogen.getGas(55),WerkstoffLoader.Xenon.getFluidOrGas(9)},null,7500,BW_Util.getMachineVoltageFromTier(4)); - GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust),WerkstoffLoader.Neon.getFluidOrGas(1000),WerkstoffLoader.MagnetoResonaticDust.get(gemChipped,9),9000,4500,BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust),WerkstoffLoader.Krypton.getFluidOrGas(1000),WerkstoffLoader.MagnetoResonaticDust.get(gem),10000,4500,BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addDistillationTowerRecipe(Materials.LiquidAir.getFluid(100000000),new FluidStack[]{Materials.Nitrogen.getGas(78084000),Materials.Oxygen.getGas(20946000),Materials.Argon.getGas(934000),Materials.CarbonDioxide.getGas(40700),WerkstoffLoader.Neon.getFluidOrGas(1818),Materials.Helium.getGas(524),Materials.Methane.getGas(180),WerkstoffLoader.Krypton.getFluidOrGas(114),Materials.Hydrogen.getGas(55),WerkstoffLoader.Xenon.getFluidOrGas(9)},null,7500, BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust),WerkstoffLoader.Neon.getFluidOrGas(1000),WerkstoffLoader.MagnetoResonaticDust.get(gemChipped,9),9000,4500, BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust),WerkstoffLoader.Krypton.getFluidOrGas(1000),WerkstoffLoader.MagnetoResonaticDust.get(gem),10000,4500, BW_Util.getMachineVoltageFromTier(5)); for (int i = 0; i < 11; i++) { @@ -99,7 +96,7 @@ public class AdditionalRecipes implements Runnable { },null,null, new FluidStack[]{ Materials.SolderingAlloy.getMolten((i+1)*36) - },null,(i+1)*750,BW_Util.getMachineVoltageFromTier((i+1)),CLEANROOM)); + },null,(i+1)*750, BW_Util.getMachineVoltageFromTier((i+1)),CLEANROOM)); } //manual override for older GT @@ -130,7 +127,7 @@ public class AdditionalRecipes implements Runnable { ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),32,0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),32,0)); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),30,0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),30,0)); } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 3d31641d79..3b4784beca 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -40,17 +40,14 @@ import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; import ic2.core.Ic2Items; import ic2.core.item.ItemFluidCell; -import net.minecraft.block.Block; import net.minecraft.init.Items; import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.ShapedOreRecipe; import javax.annotation.Nonnegative; import java.io.Serializable; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index c3dd4962be..0ee22cbd7d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -29,6 +29,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -53,6 +54,18 @@ public class BW_Util { public static final int LOWGRAVITY = -100; public static final int CLEANROOM = -200; + public static String translateGTItemStack(ItemStack itemStack){ + if (!GT_Utility.isStackValid(itemStack)) + return "Not a Valid ItemStack:"+itemStack; + String ret = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); + if (!ret.contains("%material")) + return ret; + String matname = ""; + if (BW_Util.checkStackAndPrefix(itemStack)) + matname = GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mDefaultLocalName; + return ret.replace("%material", matname); + } + public static void set2DCoordTo1DArray(int indexX, int indexY, int sizeY, Object value, Object[] array) { int index = indexX * sizeY + indexY; array[index] = value; @@ -229,6 +242,7 @@ public class BW_Util { ret = 4; break; case 2: + case 12: ret = 5; break; case 3: @@ -240,9 +254,6 @@ public class BW_Util { case 5: ret = 8; break; - case 12: - ret = 5; - break; default: ret = 3; } -- cgit From 2a37383c634c67c8b94c67a47679416f7efb701d Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 30 Aug 2019 04:16:29 +0200 Subject: removed unused imports, +version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 31bcdc7dedf59e1a8ed0cac710a9504c172a0910 --- build.properties | 2 +- src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java | 2 +- .../bartworks/client/renderer/BW_Renderer_Block_Ores.java | 1 - .../multis/GT_TileEntity_ElectricImplosionCompressor.java | 1 - .../bartworks/server/EventHandler/ServerEventHandler.java | 7 ------- .../bartworks/system/material/BW_MetaGeneratedOreTE.java | 1 - .../bartworks/system/material/BW_MetaGenerated_Items.java | 2 -- .../system/material/CircuitGeneration/BW_CircuitsLoader.java | 2 -- .../system/material/CircuitGeneration/CircuitPartLoader.java | 1 - .../github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java | 5 ----- .../galacticraft/planets/ross128b/ChunkProviderRoss128b.java | 1 - .../galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java | 1 - 12 files changed, 2 insertions(+), 24 deletions(-) diff --git a/build.properties b/build.properties index 21c042d7b7..73e4cadd19 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=0_pre13 +buildNumber=0_pre14 APIVersion=7 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index ad9f161c73..b13b4cadb5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -72,10 +72,10 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.util.ArrayList; import java.io.IOException; import java.lang.reflect.Field; +import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.Map; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index 397f0d3bc8..bb5078ebff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -25,7 +25,6 @@ package com.github.bartimaeusnek.bartworks.client.renderer; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; -import gregtech.common.render.GT_Renderer_Block; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 4a6b30b757..2dff59f0a2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -35,7 +35,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java index 493a06bd11..0b2822dae8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java @@ -25,19 +25,12 @@ package com.github.bartimaeusnek.bartworks.server.EventHandler; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.net.OreDictCachePacket; import com.github.bartimaeusnek.bartworks.common.net.ServerJoinedPackage; -import com.github.bartimaeusnek.bartworks.system.material.BWUnificationEnforcer; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; -import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.oredict.OreDictionary; - -import java.util.ArrayList; public class ServerEventHandler { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index 45db6ce632..1e671a1d29 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -33,7 +33,6 @@ import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.Packet; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 2990352776..d3bd73964b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -33,7 +33,6 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Item; -import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; @@ -53,7 +52,6 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidContainerRegistry; import java.util.List; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java index 36dc620685..819d9f98bd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java @@ -22,8 +22,6 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; -import gregtech.api.GregTech_API; - public class BW_CircuitsLoader { private static final BW_Meta_Items NEW_CIRCUITS; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index e946fab6ec..b6d1e83529 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -36,7 +36,6 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.ArrayList; import static gregtech.api.enums.ItemList.*; -import static gregtech.api.enums.ItemList.Circuit_Parts_Transistor; public class CircuitPartLoader implements Runnable { @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java index 7b62f34e2c..d568baf22b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java @@ -25,11 +25,6 @@ package com.github.bartimaeusnek.bartworks.util.NoiseUtil; import com.github.bartimaeusnek.bartworks.API.INoiseGen; import gregtech.api.objects.XSTR; -import javax.imageio.ImageIO; -import java.awt.*; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; import java.util.Random; public class BartsNoise implements INoiseGen { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index 807ad35055..34e96e6111 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -44,7 +44,6 @@ import net.minecraft.world.gen.feature.WorldGenLakes; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.PopulateChunkEvent; import net.minecraftforge.event.terraingen.TerrainGen; -import sun.security.krb5.Config; import java.util.List; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java index 677bb17e39..044737ac9c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java @@ -26,7 +26,6 @@ import com.github.bartimaeusnek.bartworks.util.NoiseUtil.BartsNoise; import gregtech.api.objects.XSTR; import micdoodle8.mods.galacticraft.api.prefab.world.gen.MapGenBaseMeta; import micdoodle8.mods.galacticraft.core.blocks.GCBlocks; -import micdoodle8.mods.galacticraft.core.perlin.NoiseModule; import micdoodle8.mods.galacticraft.core.world.gen.BiomeGenBaseMoon; import micdoodle8.mods.galacticraft.core.world.gen.ChunkProviderMoon; import micdoodle8.mods.galacticraft.core.world.gen.MapGenCavesMoon; -- cgit From c9fa2faffad73b649c662cefd630aac65f2c7367 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 2 Sep 2019 00:23:43 +0200 Subject: Moar Fixes +THTR now puts out the correct amount of IC2HotCoolant +improvements on the Unification Enforcer (added a way to convert old fluids) +fixed original EBF noble gas recipe to not be affected by lower tier gas +rebalanced ZPM+ Circuits +added new Textures by EmeraldsEmerald Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 7cb480259f0cc023c04bc55a58785649b242cf8f --- .../github/bartimaeusnek/bartworks/MainMod.java | 14 +++++++------ .../tileentities/multis/GT_TileEntity_THTR.java | 23 ++++++++++----------- .../bartworks/system/material/WerkstoffLoader.java | 4 ++-- .../processingLoaders/AdditionalRecipes.java | 20 +++++++++++++++++- .../textures/items/gt.bwMetaGeneratedItem0/0.png | Bin 606 -> 566 bytes .../textures/items/gt.bwMetaGeneratedItem0/1.png | Bin 375 -> 298 bytes .../textures/items/gt.bwMetaGeneratedItem0/2.png | Bin 396 -> 443 bytes .../textures/items/gt.bwMetaGeneratedItem0/3.png | Bin 245 -> 232 bytes 8 files changed, 40 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index b13b4cadb5..bee7086eb9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -75,10 +75,7 @@ import org.apache.logging.log4j.Logger; import java.io.IOException; import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; +import java.util.*; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; @@ -213,7 +210,11 @@ public final class MainMod { for (GT_Recipe recipe : map.mRecipeList) { for (int i = 0; i < recipe.mFluidInputs.length; i++) { if (GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], wrongNamedFluid)) { + Collection col = map.mRecipeFluidMap.get(wrongNamedFluid.getFluid()); + map.mRecipeFluidMap.remove(wrongNamedFluid.getFluid()); + map.mRecipeFluidMap.put(werkstoff.getFluidOrGas(1).getFluid(),col); recipe.mFluidInputs[i] = werkstoff.getFluidOrGas(recipe.mFluidInputs[i].amount); + map.mRecipeFluidNameMap.add(werkstoff.getFluidOrGas(1).getFluid().getName()); } } for (int i = 0; i < recipe.mFluidOutputs.length; i++) { @@ -223,6 +224,7 @@ public final class MainMod { } } } + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(false,null,null,null,null,new FluidStack[]{wrongNamedFluid},new FluidStack[]{werkstoff.getFluidOrGas(1)},1,1,0)); } MainMod.runMoltenUnificationEnfocement(werkstoff); for (OrePrefixes prefixes : OrePrefixes.values()) { @@ -383,13 +385,13 @@ public final class MainMod { for (Werkstoff werkstoff : Werkstoff.werkstoffHashMap.values()) { if (!werkstoff.contains(GasTag)) continue; - int time = (int) ((double) recipe.mDuration / 200D * (200D + (werkstoff.getStats().getProtons() > mat.getProtons() ? (double) mat.getProtons() - (double) werkstoff.getStats().getProtons() : (double) mat.getProtons()*2.75D - (double) werkstoff.getStats().getProtons()))); + int time = (int) ((double) recipe.mDuration / 200D * (200D + (werkstoff.getStats().getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) werkstoff.getStats().getProtons() : (double) mat.getProtons()*2.75D - (double) werkstoff.getStats().getProtons()))); toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(fluids.get(werkstoff), recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); } for (Materials materials : Materials.values()) { if (!materials.contains(GasTag)) continue; - int time = (int) ((double) recipe.mDuration / 200D * (200D + (materials.getProtons() > mat.getProtons() ? (double) mat.getProtons() - (double) materials.getProtons() : (double) mat.getProtons()*2.75D - (double) materials.getProtons()))); + int time = (int) ((double) recipe.mDuration / 200D * (200D + (materials.getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) materials.getProtons() : (double) mat.getProtons()*2.75D - (double) materials.getProtons()))); toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{materials.getGas(recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); } for (ItemStack is : noGas) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index edbe884c1f..d1b0d2ebce 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -149,11 +149,10 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { this.updateSlots(); if (this.mOutputFluids == null || this.mOutputFluids[0] == null) this.mOutputFluids = new FluidStack[]{FluidRegistry.getFluidStack("ic2hotcoolant",0)}; - //this.mOutputFluids[0].amount+=toProduce; + this.mEUt=0; this.mMaxProgresstime=648000; - return true; } @@ -178,7 +177,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { } } - toProduce = (long) ((0.03471*(float)this.TRISOPeletSupply + 0.0267*(float)this.BISOPeletSupply)); + toProduce = (long) ((0.00711111111111111111111111111111D*(double)this.TRISOPeletSupply + 0.00474074074074074074074074074074D*(double)this.BISOPeletSupply)); if (toProduce > accessibleCoolant) { // new ExplosionIC2( @@ -339,17 +338,17 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { new ItemStack(GregTech_API.sBlockCasings3,1,12), 40, BW_Util.getMachineVoltageFromTier(5) - ); - GT_Values.RA.addMixerRecipe(WerkstoffLoader.Thorium232.get(OrePrefixes.dust,10),Materials.Uranium235.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,new ItemStack(THTRMaterials.aTHTR_Materials),400,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(THTRMaterials.aTHTR_Materials),Materials.Graphite.getDust(64),new ItemStack(THTRMaterials.aTHTR_Materials,1,4),40,30); + ); + GT_Values.RA.addMixerRecipe(WerkstoffLoader.Thorium232.get(OrePrefixes.dust,10),Materials.Uranium235.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials),400,30); + GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials),Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),40,30); ItemStack[] pellets = new ItemStack[6]; - Arrays.fill(pellets,new ItemStack(THTRMaterials.aTHTR_Materials,64,1)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(THTRMaterials.aTHTR_Materials,1,4),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,24000,30,0); - GT_Values.RA.addFormingPressRecipe(new ItemStack(THTRMaterials.aTHTR_Materials,1,4),Materials.Silicon.getDust(64),new ItemStack(THTRMaterials.aTHTR_Materials,1,2),40,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(THTRMaterials.aTHTR_Materials,1,2),Materials.Graphite.getDust(64),new ItemStack(THTRMaterials.aTHTR_Materials,1,5),40,30); + Arrays.fill(pellets,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,1)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,24000,30,0); + GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),Materials.Silicon.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,2),40,30); + GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,2),Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,5),40,30); pellets = new ItemStack[6]; - Arrays.fill(pellets,new ItemStack(THTRMaterials.aTHTR_Materials,64,3)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(THTRMaterials.aTHTR_Materials,1,5),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,48000,30,0); + Arrays.fill(pellets,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,3)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,5),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,48000,30,0); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index bc7b4b54aa..bf3ae4bb9e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -947,8 +947,8 @@ public class WerkstoffLoader implements Runnable { GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemExquisite), werkstoff.get(dust, 4)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawless), werkstoff.get(dust, 2)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(gem), werkstoff.get(dust)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawed), werkstoff.get(dustSmall, 1)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemChipped), werkstoff.get(dustTiny)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawed), werkstoff.get(dustSmall, 2)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemChipped), werkstoff.get(dustSmall)); GT_ModHandler.addCraftingRecipe(werkstoff.get(gemFlawless, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gemExquisite)}); GT_ModHandler.addCraftingRecipe(werkstoff.get(gem, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gemFlawless)}); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 3878422bbe..0acd99df2d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -80,7 +80,7 @@ public class AdditionalRecipes implements Runnable { GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust),WerkstoffLoader.Krypton.getFluidOrGas(1000),WerkstoffLoader.MagnetoResonaticDust.get(gem),10000,4500, BW_Util.getMachineVoltageFromTier(5)); - for (int i = 0; i < 11; i++) { + for (int i = 0; i <= 6; i++) { GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{ @@ -98,6 +98,24 @@ public class AdditionalRecipes implements Runnable { Materials.SolderingAlloy.getMolten((i+1)*36) },null,(i+1)*750, BW_Util.getMachineVoltageFromTier((i+1)),CLEANROOM)); } + for (int i = 7; i <= 10; i++) { + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( + new BWRecipes.DynamicGTRecipe(false, + new ItemStack[]{ + BW_Meta_Items.getNEWCIRCUITS().getStack(3), + WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite,(2)), + BW_Meta_Items.getNEWCIRCUITS().getStack(i+3), + ItemList.Circuit_Parts_DiodeSMD.get((i+6)*4), + ItemList.Circuit_Parts_CapacitorSMD.get((i+6)*4), + ItemList.Circuit_Parts_TransistorSMD.get((i+6)*4) + }, + new ItemStack[]{ + BW_Meta_Items.getNEWCIRCUITS().getStack(i+4) + },null,null, + new FluidStack[]{ + Materials.SolderingAlloy.getMolten((i+1)*144) + },null,(i+1)*1500, BW_Util.getMachineVoltageFromTier(i+1),CLEANROOM)); + } //manual override for older GT Werkstoff werkstoff = WerkstoffLoader.Oganesson; diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/0.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/0.png index c597cc08ae..e16102588a 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/0.png and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/0.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/1.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/1.png index f2ec0dcb97..491164695b 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/1.png and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/1.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/2.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/2.png index 43291b873a..968e0745c9 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/2.png and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/2.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/3.png b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/3.png index 7987d1fff6..9e22dd6726 100644 Binary files a/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/3.png and b/src/main/resources/assets/gregtech/textures/items/gt.bwMetaGeneratedItem0/3.png differ -- cgit From e353a91980806712ef011d542bfb2c64f9f7ba26 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 3 Sep 2019 08:56:00 +0200 Subject: final 5.1 commit -changed Loading behavior -added oredict for glassblocks -fixed crash when galacticraft.planets is not installed, but only galacticraft.core -started to work on 5.2 content,loading of which is disabled Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: b3f46ee3a6870d9ae9c35a725fe69f6bebae07ca --- build.properties | 4 +- .../github/bartimaeusnek/bartworks/MainMod.java | 9 +- .../bartworks/common/loaders/BeforeGTPreload.java | 128 +++++++++ .../bartworks/common/loaders/ItemRegistry.java | 36 +-- .../bartimaeusnek/bartworks/util/BWRecipes.java | 4 +- .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 23 +- .../crossmod/emt/recipe/TCRecipeHandler.java | 286 +++++++++++++++++++++ .../multi/GT_Industrial_Alchemic_Furnace.java | 150 +++++++++++ .../crossmod/emt/util/EMTHandler.java | 39 +++ .../crossmod/galacticraft/PlanetsHelperClass.java | 49 ++++ .../galacticraft/UniversalTeleportType.java | 20 +- .../thaumcraft/util/ThaumcraftHandler.java | 23 +- .../bartimaeusnek/preloader/PreLoaderMod.java | 55 ++++ 13 files changed, 766 insertions(+), 60 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Furnace.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java create mode 100644 src/main/java/com/github/bartimaeusnek/preloader/PreLoaderMod.java diff --git a/build.properties b/build.properties index 73e4cadd19..7daca1c59d 100644 --- a/build.properties +++ b/build.properties @@ -23,8 +23,8 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=0_pre14 -APIVersion=7 +buildNumber=1 +APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index bee7086eb9..9a5e86b39c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks; import com.github.bartimaeusnek.bartworks.API.API_REFERENCE; import com.github.bartimaeusnek.bartworks.API.BioObjectAdder; +import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.client.ClientEventHandler.TooltipEventHandler; import com.github.bartimaeusnek.bartworks.client.creativetabs.BioTab; import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; @@ -79,6 +80,7 @@ import java.util.*; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static gregtech.api.enums.GT_Values.VN; @Mod( modid = MainMod.MOD_ID, name = MainMod.NAME, version = MainMod.VERSION, @@ -161,8 +163,13 @@ public final class MainMod { @Mod.EventHandler public void postInit(FMLPostInitializationEvent postinit) { NetworkRegistry.INSTANCE.registerGuiHandler(MainMod.instance, MainMod.GH); - if (ConfigHandler.BioLab) + if (ConfigHandler.BioLab) { new GTNHBlocks().run(); + for (Map.Entrypair : BioVatLogicAdder.BioVatGlass.getGlassMap().entrySet()){ + GT_OreDictUnificator.registerOre("blockGlass"+VN[pair.getValue()],new ItemStack(pair.getKey().getBlock(),1,pair.getKey().getaByte())); + } + } + BioObjectAdder.regenerateBioFluids(); if (ConfigHandler.newStuff) { if (ConfigHandler.experimentalThreadedLoader) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java new file mode 100644 index 0000000000..de0e57a138 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.loaders; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_ExperimentalFloodGate; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.LoadController; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.util.GT_OreDictUnificator; +import ic2.core.Ic2Items; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; +import org.apache.commons.lang3.reflect.FieldUtils; + +import java.lang.reflect.Field; + +import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; + +public class BeforeGTPreload implements Runnable { + @Override + public void run() { + Field fieldModController = FieldUtils.getDeclaredField(Loader.class,"modController",true); + LoadController modController = null; + try { + modController = (LoadController) fieldModController.get(Loader.instance()); + } catch (IllegalAccessException e) { + e.printStackTrace(); + FMLCommonHandler.instance().exitJava(-1,true); + } + ModContainer bartworks = null; + ModContainer gregtech = null; + assert modController != null; + for (ModContainer mod : modController.getActiveModList()){ + if (mod.getModId().equals(MainMod.MOD_ID)) { + bartworks = mod; + } + if (mod.getModId().equals("gregtech")) + gregtech=mod; + if (bartworks!= null && gregtech != null) + break; + } + if (bartworks == null || gregtech == null) + FMLCommonHandler.instance().exitJava(-1,true); + Field activeContainer = FieldUtils.getDeclaredField(LoadController.class,"activeContainer",true); + + try { + activeContainer.set(modController,bartworks); + } catch (IllegalAccessException e) { + e.printStackTrace(); + FMLCommonHandler.instance().exitJava(-1,true); + } + + if (newStuff) { + GameRegistry.registerBlock(ItemRegistry.bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); + GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses, "BW_FakeGlasBlock"); + GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[2], BW_ItemBlocks.class, "BW_Machinery_Casings"); + GameRegistry.registerItem(ItemRegistry.LEATHER_ROTOR, "BW_LeatherRotor"); + GameRegistry.registerItem(ItemRegistry.WOOL_ROTOR, "BW_WoolRotor"); + GameRegistry.registerItem(ItemRegistry.PAPER_ROTOR, "BW_PaperRotor"); + GameRegistry.registerItem(ItemRegistry.COMBINED_ROTOR, "BW_CombinedRotor"); + GameRegistry.registerItem(ItemRegistry.CRAFTING_PARTS, "craftingParts"); + GameRegistry.registerTileEntity(BW_RotorBlock.class, "BWRotorBlockTE"); + GameRegistry.registerBlock(ItemRegistry.ROTORBLOCK, BW_ItemBlocks.class, "BWRotorBlock"); + GameRegistry.registerTileEntity(BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPumpTE"); + GameRegistry.registerBlock(ItemRegistry.PUMPBLOCK, BW_ItemBlocks.class, "BWHeatedWaterPumpBlock"); + GameRegistry.registerItem(ItemRegistry.PUMPPARTS, "BWPumpParts"); + GameRegistry.registerItem(ItemRegistry.WINDMETER, "BW_SimpleWindMeter"); + GameRegistry.registerTileEntity(BW_TileEntity_ExperimentalFloodGate.class, "BWExpReversePump"); + GameRegistry.registerBlock(ItemRegistry.EXPPUMP, BW_ItemBlocks.class, "BWExpReversePumpBlock"); + } + + //GT2 stuff + GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[0], BW_ItemBlocks.class, "BW_ItemBlocks"); + GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[1], BW_ItemBlocks.class, "GT_LESU_CASING"); + if (ConfigHandler.teslastaff) + GameRegistry.registerItem(ItemRegistry.TESLASTAFF, ItemRegistry.TESLASTAFF.getUnlocalizedName()); + + GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_LV, ItemRegistry.ROCKCUTTER_LV.getUnlocalizedName()); + GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_MV, ItemRegistry.ROCKCUTTER_MV.getUnlocalizedName()); + GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_HV, ItemRegistry.ROCKCUTTER_HV.getUnlocalizedName()); + GameRegistry.registerItem(ItemRegistry.TAB, "tabIconGT2"); + + OreDictionary.registerOre("blockGlassHV",new ItemStack(Blocks.glass,1,Short.MAX_VALUE)); + OreDictionary.registerOre("blockGlassHV",new ItemStack(ItemRegistry.bw_glasses[0],1,0)); + OreDictionary.registerOre("blockGlassEV", Ic2Items.reinforcedGlass); + OreDictionary.registerOre("blockGlassEV",new ItemStack(ItemRegistry.bw_glasses[0],1,1)); + OreDictionary.registerOre("blockGlassIV",new ItemStack(ItemRegistry.bw_glasses[0],1,2)); + OreDictionary.registerOre("blockGlassIV",new ItemStack(ItemRegistry.bw_glasses[0],1,12)); + OreDictionary.registerOre("blockGlassLuV",new ItemStack(ItemRegistry.bw_glasses[0],1,3)); + OreDictionary.registerOre("blockGlassZPM",new ItemStack(ItemRegistry.bw_glasses[0],1,4)); + OreDictionary.registerOre("blockGlassUV",new ItemStack(ItemRegistry.bw_glasses[0],1,5)); + + try { + activeContainer.set(modController,gregtech); + } catch (IllegalAccessException e) { + e.printStackTrace(); + FMLCommonHandler.instance().exitJava(-1,true); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index dd20bd3a85..f14e5f8051 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -40,6 +40,9 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_Til import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.*; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import cpw.mods.fml.common.LoadController; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -52,6 +55,9 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; +import org.apache.commons.lang3.reflect.FieldUtils; + +import java.lang.reflect.Field; import static com.github.bartimaeusnek.bartworks.MainMod.BWT; import static com.github.bartimaeusnek.bartworks.MainMod.GT2; @@ -139,31 +145,14 @@ public class ItemRegistry { public static ItemStack giantOutputHatch; public static void run() { - if (newStuff) { if (ConfigHandler.creativeScannerID != 0) new CreativeScanner(ConfigHandler.creativeScannerID,"Creative Debug Scanner","Creative Debug Scanner",20); ItemRegistry.eic = new GT_TileEntity_ElectricImplosionCompressor(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, "ElectricImplosionCompressor", "Electric Implosion Compressor").getStackForm(1L); ItemRegistry.thtr = new GT_TileEntity_THTR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, "THTR", "Thorium High Temperature Reactor").getStackForm(1L); GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials(); - GameRegistry.registerBlock(ItemRegistry.bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); - GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses, "BW_FakeGlasBlock"); GT_OreDictUnificator.add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); - GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[2], BW_ItemBlocks.class, "BW_Machinery_Casings"); GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(ItemRegistry.BW_BLOCKS[2])); - GameRegistry.registerItem(ItemRegistry.LEATHER_ROTOR, "BW_LeatherRotor"); - GameRegistry.registerItem(ItemRegistry.WOOL_ROTOR, "BW_WoolRotor"); - GameRegistry.registerItem(ItemRegistry.PAPER_ROTOR, "BW_PaperRotor"); - GameRegistry.registerItem(ItemRegistry.COMBINED_ROTOR, "BW_CombinedRotor"); - GameRegistry.registerItem(ItemRegistry.CRAFTING_PARTS, "craftingParts"); - GameRegistry.registerTileEntity(BW_RotorBlock.class, "BWRotorBlockTE"); - GameRegistry.registerBlock(ItemRegistry.ROTORBLOCK, BW_ItemBlocks.class, "BWRotorBlock"); - GameRegistry.registerTileEntity(BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPumpTE"); - GameRegistry.registerBlock(ItemRegistry.PUMPBLOCK, BW_ItemBlocks.class, "BWHeatedWaterPumpBlock"); - GameRegistry.registerItem(ItemRegistry.PUMPPARTS, "BWPumpParts"); - GameRegistry.registerItem(ItemRegistry.WINDMETER, "BW_SimpleWindMeter"); - GameRegistry.registerTileEntity(BW_TileEntity_ExperimentalFloodGate.class, "BWExpReversePump"); - GameRegistry.registerBlock(ItemRegistry.EXPPUMP, BW_ItemBlocks.class, "BWExpReversePumpBlock"); for (int i = 0; i < GT_Values.VN.length; i++) { ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "diode" + "2A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 2A " + GT_Values.VN[i], i).getStackForm(1L); ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "diode" + "4A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 4A " + GT_Values.VN[i], i).getStackForm(1L); @@ -171,7 +160,6 @@ public class ItemRegistry { ItemRegistry.diode12A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, "diode" + "12A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 12A " + GT_Values.VN[i], i).getStackForm(1L); ItemRegistry.diode16A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, "diode" + "16A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 16A " + GT_Values.VN[i], i).getStackForm(1L); ItemRegistry.energyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset + 1 + i, "energydistributor" + GT_Values.VN[i], StatCollector.translateToLocal("tile.energydistributor.name") + " " + GT_Values.VN[i], i).getStackForm(1L); - } for (int i = 0; i < 3; i++) { ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "acidgenerator" + GT_Values.VN[i + 2], StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[i + 2], i + 2).getStackForm(1); @@ -183,17 +171,5 @@ public class ItemRegistry { ItemRegistry.compressedHatch = new GT_MetaTileEntity_CompressedFluidHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, "CompressedFluidHatch", "Liquid Air Fluid Hatch").getStackForm(1L); ItemRegistry.giantOutputHatch = new GT_MetaTileEntity_GiantOutputHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, "GiantOutputHatch", "Giant Output Hatch").getStackForm(1L); } - - - //GT2 stuff - GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[0], BW_ItemBlocks.class, "BW_ItemBlocks"); - GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[1], BW_ItemBlocks.class, "GT_LESU_CASING"); - if (ConfigHandler.teslastaff) - GameRegistry.registerItem(ItemRegistry.TESLASTAFF, ItemRegistry.TESLASTAFF.getUnlocalizedName()); - - GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_LV, ItemRegistry.ROCKCUTTER_LV.getUnlocalizedName()); - GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_MV, ItemRegistry.ROCKCUTTER_MV.getUnlocalizedName()); - GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_HV, ItemRegistry.ROCKCUTTER_HV.getUnlocalizedName()); - GameRegistry.registerItem(ItemRegistry.TAB, "tabIconGT2"); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 3b4784beca..16d306d05f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -580,9 +580,9 @@ public class BWRecipes { } } - private static class SpecialObjectSensitiveMap extends GT_Recipe.GT_Recipe_Map{ + public static class SpecialObjectSensitiveMap extends GT_Recipe.GT_Recipe_Map{ - private SpecialObjectSensitiveMap(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + public SpecialObjectSensitiveMap(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index d0a13b9af0..9bbd454325 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -22,23 +22,24 @@ package com.github.bartimaeusnek.crossmod; +import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.commands.ChangeConfig; import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; +import com.github.bartimaeusnek.crossmod.emt.recipe.TCRecipeHandler; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.event.*; import net.minecraft.util.StringTranslate; import org.apache.commons.io.input.ReaderInputStream; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.StringReader; +import java.lang.reflect.InvocationTargetException; @Mod( modid = BartWorksCrossmod.MOD_ID, name = BartWorksCrossmod.NAME, version = BartWorksCrossmod.VERSION, @@ -49,6 +50,7 @@ import java.io.StringReader; + "after:GalacticraftCore; " + "after:Micdoodlecore; " + "after:miscutils;" + + "after:EMT;" ) public class BartWorksCrossmod { public static final String NAME = "BartWorks Mod Additions"; @@ -88,6 +90,19 @@ public class BartWorksCrossmod { // } // } + +// @Mod.EventHandler +// public void onServerStarted(FMLServerStartedEvent event) { +// if (Loader.isModLoaded("EMT")){ +// try { +// TCRecipeHandler.init(); +// } catch (IllegalAccessException | InvocationTargetException e) { +// e.printStackTrace(); +// } +// +// } +// } + @Mod.EventHandler public void onFMLServerStart(FMLServerStartingEvent event) { event.registerServerCommand(new SummonRuin()); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java new file mode 100644 index 0000000000..c36f63cd00 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java @@ -0,0 +1,286 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.emt.recipe; + +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.HashBiMap; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; + +import static com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler.AspectAdder; + +public class TCRecipeHandler { + public static final GT_Recipe.GT_Recipe_Map alchemicalConstructHandler = new TCRecipeHandler.TCRecipeMap(new HashSet<>(), + "bwcm.recipe.alchemicalConstruct", + "Industrical Alchemical Construct", + null, + "gregtech:textures/gui/basicmachines/Default", + 2, 1, 2, 0, 1, + "", 1, "", true, true + ); + static Class aCrucibleRecipeClass; + static Class aThaumcraftAPI; + static Field craftingRecipes; + static Field aCrucibleRecipeField; + static Field aCrucibleRecipeCatalyst; + static Field aspects; + static Field key; + + static { + try { + aCrucibleRecipeClass = Class.forName("thaumcraft.api.crafting.CrucibleRecipe"); + aThaumcraftAPI = Class.forName("thaumcraft.api.ThaumcraftApi"); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + try { + aspects = aCrucibleRecipeClass.getField("aspects"); + + key = aCrucibleRecipeClass.getField("key"); + + aCrucibleRecipeField = aCrucibleRecipeClass.getDeclaredField("recipeOutput"); + aCrucibleRecipeField.setAccessible(true); + + aCrucibleRecipeCatalyst = aCrucibleRecipeClass.getField("catalyst"); + + craftingRecipes = aThaumcraftAPI.getDeclaredField("craftingRecipes"); + craftingRecipes.setAccessible(true); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + } + + public static void init() throws IllegalAccessException, InvocationTargetException { + ArrayList tcCraftingList = (ArrayList) craftingRecipes.get(null); + HashSet crucibleRecipes = new HashSet(); + for (Object o : tcCraftingList) { + if (TCRecipeHandler.aCrucibleRecipeClass.isInstance(o)) + crucibleRecipes.add(o); + } + TCRecipeHandler.convertCrucibleRecipesToGTRecipes(crucibleRecipes); + } + + public static void convertCrucibleRecipesToGTRecipes(HashSet crucibleRecipes) throws IllegalAccessException, InvocationTargetException { + HashSet ret = new HashSet<>(); + ArrayListMultimap itemToCircuitConfigMap = ArrayListMultimap.create(); + ArrayListMultimap itemToAspectsMap = ArrayListMultimap.create(); + ArrayListMultimap itemToOutputMap = ArrayListMultimap.create(); + ArrayListMultimap itemToResearchMap = ArrayListMultimap.create(); + + for (Object o : crucibleRecipes) { + + String key = (String) TCRecipeHandler.key.get(o); + ItemStack out = (ItemStack) TCRecipeHandler.aCrucibleRecipeField.get(o); + Object aspects = TCRecipeHandler.aspects.get(o); + Object cat = TCRecipeHandler.aCrucibleRecipeCatalyst.get(o); + + if (cat instanceof ItemStack) { + itemToAspectsMap.put((ItemStack)cat,aspects); + itemToOutputMap.put((ItemStack)cat,out); + itemToResearchMap.put((ItemStack)cat,key); + } else if (cat instanceof String) { + for (ItemStack stack : OreDictionary.getOres((String) cat)) { + itemToAspectsMap.put(stack,aspects); + itemToOutputMap.put(stack,out); + itemToResearchMap.put(stack,key); + } + } else if (cat instanceof ArrayList && ((ArrayList) cat).size() > 0) { + for (ItemStack stack : ((ArrayList) cat)) { + itemToAspectsMap.put(stack,aspects); + itemToOutputMap.put(stack,out); + itemToResearchMap.put(stack,key); + + } + } + } + for (ItemStack o : itemToAspectsMap.keySet()){ + for (int j = 1; j <= itemToAspectsMap.get(o).size() ; j++) { + itemToCircuitConfigMap.put(o,j); + } + + for (int j = 0; j < itemToAspectsMap.get(o).size() ; j++) { + ret.add(addRecipes(itemToResearchMap.get(o).get(j),itemToOutputMap.get(o).get(j),itemToAspectsMap.get(o).get(j),o,itemToCircuitConfigMap.get(o).get(j))); + } + } + + for (GT_Recipe recipe : ret){ + TCRecipeHandler.alchemicalConstructHandler.add(recipe); + } + + } + + public static GT_Recipe addRecipes(String key, ItemStack out, Object aspects, ItemStack cat, int config) throws InvocationTargetException, IllegalAccessException { + + NBTTagCompound toWrite = new NBTTagCompound(); + ThaumcraftHandler.AspectAdder.writeAspectListToNBT.invoke(aspects, toWrite); + ItemStack fake = new ItemStack(Items.feather); + fake.setTagCompound(toWrite); + fake.setStackDisplayName(key); + GT_Recipe recipe = new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[]{cat, GT_Utility.getIntegratedCircuit(config)}, + new ItemStack[]{out}, + fake, + null, + null, + null, + 60, + 480, + 0 + ); + return recipe; + } + + static class TCRecipeMap extends GT_Recipe.GT_Recipe_Map { + public TCRecipeMap(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + @Override + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + // No Recipes? Well, nothing to be found then. + if (mRecipeList.isEmpty()) return null; + + // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 Stack" or "at least 2 Stacks" before they start searching for Recipes. + // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in their Machines to select Sub Recipes. + if (GregTech_API.sPostloadFinished) { + if (this.mMinimalInputItems > 0) { + if (aInputs == null) + return null; + int tAmount = 0; + for (ItemStack aInput : aInputs) + if (aInput != null) + tAmount++; + if (tAmount < this.mMinimalInputItems) + return null; + } + } + + // Unification happens here in case the Input isn't already unificated. + if (aNotUnificated) + aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs); + +// // Check the Recipe which has been used last time in order to not have to search for it again, if possible. +// if (aRecipe != null) +// if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { +// NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); +// NBTTagCompound givenNBT = ((ItemStack)aRecipe.mSpecialItems).getTagCompound(); +// Object aAspectListToCheck = null; +// Object aGivenAspectList = null; +// try { +// aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); +// aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); +// AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck,toCheckNBT); +// AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList,givenNBT); +// if (!TCRecipeHandler.TCRecipeMap.containsAspects(aAspectListToCheck,aGivenAspectList)) +// return null; +// } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { +// e.printStackTrace(); +// return null; +// } +// return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; +// } + + + // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. + if (this.mUsualInputCount > 0 && aInputs != null) + for (ItemStack tStack : aInputs) + if (tStack != null) { + Collection tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack)); + if (tRecipes != null) + for (GT_Recipe tRecipe : tRecipes) + if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { + NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); + NBTTagCompound givenNBT = ((ItemStack)aRecipe.mSpecialItems).getTagCompound(); + Object aAspectListToCheck = null; + Object aGivenAspectList = null; + try { + aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); + aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); + AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck,toCheckNBT); + AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList,givenNBT); + if (!TCRecipeHandler.TCRecipeMap.containsAspects(aAspectListToCheck,aGivenAspectList)) + continue; + } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { + e.printStackTrace(); + return null; + } + return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; + } + tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(GT_Values.W, tStack))); + if (tRecipes != null) + for (GT_Recipe tRecipe : tRecipes) + if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) { + NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); + NBTTagCompound givenNBT = ((ItemStack)aRecipe.mSpecialItems).getTagCompound(); + Object aAspectListToCheck = null; + Object aGivenAspectList = null; + try { + aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); + aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); + AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck,toCheckNBT); + AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList,givenNBT); + if (!TCRecipeHandler.TCRecipeMap.containsAspects(aAspectListToCheck,aGivenAspectList)) + continue; + } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { + e.printStackTrace(); + return null; + } + return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; + } + } + // And nothing has been found. + return null; + } + + + private static boolean containsAspects(Object aAspectListToCheck, Object aGivenAspectList) throws InvocationTargetException, IllegalAccessException { + Object[] aspects = (Object[]) ThaumcraftHandler.AspectAdder.getAspects.invoke(aGivenAspectList); + for (int i = 0; i < aspects.length; i++) { + if ((int) ThaumcraftHandler.AspectAdder.getAmount.invoke(aAspectListToCheck,aspects[i]) < (int) ThaumcraftHandler.AspectAdder.getAmount.invoke(aGivenAspectList,aspects[i])) + return false; + } + return true; + } + + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Furnace.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Furnace.java new file mode 100644 index 0000000000..fa9bf7cd37 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Furnace.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.emt.tileentities.multi; + +import com.github.bartimaeusnek.crossmod.emt.recipe.TCRecipeHandler; +import com.github.bartimaeusnek.crossmod.emt.util.EMTHandler; +import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.List; + +import static gregtech.api.enums.GT_Values.V; + +public class GT_Industrial_Alchemic_Furnace extends GT_MetaTileEntity_MultiBlockBase { + + List mEssentiaHatches = new ArrayList<>(); + + public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity.getClass().isInstance(EMTHandler.aEssentiaInputHatch)) + return this.addEssetiaHatchToList(aTileEntity, aBaseCasingIndex); + return super.addInputToMachineList(aTileEntity, aBaseCasingIndex); + } + + private boolean addEssetiaHatchToList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } else if (aTileEntity.getClass().isInstance(EMTHandler.aEssentiaInputHatch)) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mEssentiaHatches.add(aMetaTileEntity); + } else { + return false; + } + } + } + + public GT_Industrial_Alchemic_Furnace(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_Industrial_Alchemic_Furnace(String aName) { + super(aName); + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + ItemStack stack = new ItemStack(Items.feather); + try { + String owner = this.getBaseMetaTileEntity().getOwnerName(); + Object allAspects = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); + for (Object o : this.mEssentiaHatches) { + Object aspectList = EMTHandler.aAspectField.get(o); + ThaumcraftHandler.AspectAdder.add.invoke(allAspects,aspectList); + } + NBTTagCompound toWrite = (NBTTagCompound)ThaumcraftHandler.AspectAdder.writeAspectListToNBT.invoke(allAspects,new NBTTagCompound()); + stack.setTagCompound(toWrite); + } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) { + e.printStackTrace(); + return false; + } + ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); + ArrayList outputItems = new ArrayList(); + + long tVoltage = this.getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + GT_Recipe tRecipe = TCRecipeHandler.alchemicalConstructHandler.findRecipe(this.getBaseMetaTileEntity(),null,false, false, V[tTier], null, stack,tInputs); + + return false; + } + + @Override + public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return false; + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 0; + } + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_Industrial_Alchemic_Furnace(mName); + } + + @Override + public String[] getDescription() { + return new String[0]; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + return new ITexture[0]; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java new file mode 100644 index 0000000000..c720de1f07 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.emt.util; + +import java.lang.reflect.Field; + +public class EMTHandler { + public static Class aEssentiaInputHatch; + public static Field aAspectField; + static { + try { + aEssentiaInputHatch = Class.forName("emt.gthandler.common.implementations.EssentiaHatch"); + aAspectField = aEssentiaInputHatch.getDeclaredField("current"); + aAspectField.setAccessible(true); + } catch (ClassNotFoundException | NoSuchFieldException e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java new file mode 100644 index 0000000000..8eddf5eb04 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import micdoodle8.mods.galacticraft.core.entities.EntityLander; +import micdoodle8.mods.galacticraft.core.entities.EntityLanderBase; +import micdoodle8.mods.galacticraft.planets.asteroids.entities.EntityEntryPod; +import micdoodle8.mods.galacticraft.planets.mars.entities.EntityLandingBalloons; +import net.minecraft.entity.player.EntityPlayerMP; + +public class PlanetsHelperClass { + + public static EntityLanderBase getLanderType(EntityPlayerMP player){ + EntityLanderBase elb; + switch (ConfigHandler.landerType){ + case 1: + elb = new EntityLander(player); + break; + case 2: + elb = new EntityLandingBalloons(player); + break; + default: + elb = new EntityEntryPod(player); + break; + } + return elb; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java index c1e7e7a6c8..ddae0648b2 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java @@ -22,14 +22,12 @@ package com.github.bartimaeusnek.crossmod.galacticraft; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import cpw.mods.fml.common.Loader; import micdoodle8.mods.galacticraft.api.vector.Vector3; import micdoodle8.mods.galacticraft.api.world.ITeleportType; import micdoodle8.mods.galacticraft.core.entities.EntityLander; import micdoodle8.mods.galacticraft.core.entities.EntityLanderBase; import micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats; -import micdoodle8.mods.galacticraft.planets.asteroids.entities.EntityEntryPod; -import micdoodle8.mods.galacticraft.planets.mars.entities.EntityLandingBalloons; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.world.World; @@ -71,18 +69,10 @@ public class UniversalTeleportType implements ITeleportType { } EntityLanderBase elb; - - switch (ConfigHandler.landerType){ - case 1: - elb = new EntityLander(player); - break; - case 2: - elb = new EntityLandingBalloons(player); - break; - default: - elb = new EntityEntryPod(player); - break; - } + if (Loader.isModLoaded("GalacticraftMars")) + elb=PlanetsHelperClass.getLanderType(player); + else + elb = new EntityLander(player); if (!newWorld.isRemote) { newWorld.spawnEntityInWorld(elb); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index ef6dcde7f0..b753f61a4c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -29,6 +29,7 @@ import com.github.bartimaeusnek.bartworks.util.Pair; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TC_Aspects; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.biome.BiomeGenBase; import java.lang.reflect.InvocationTargetException; @@ -84,11 +85,16 @@ public class ThaumcraftHandler { } public static class AspectAdder { - private static Class mAspectListClass; + public static Class mAspectListClass; public static Class mAspectClass; - private static Method registerObjectTag; - private static Method addToList; - private static Method getName; + public static Method registerObjectTag; + public static Method addToList; + public static Method getName; + public static Method writeAspectListToNBT; + public static Method readAspectListFromNBT; + public static Method add; + public static Method getAmount; + public static Method getAspects; static { try { @@ -96,7 +102,12 @@ public class ThaumcraftHandler { ThaumcraftHandler.AspectAdder.mAspectClass = Class.forName("thaumcraft.api.aspects.Aspect"); ThaumcraftHandler.AspectAdder.addToList = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("add", ThaumcraftHandler.AspectAdder.mAspectClass,int.class); ThaumcraftHandler.AspectAdder.registerObjectTag = Class.forName("thaumcraft.api.ThaumcraftApi").getMethod("registerObjectTag",ItemStack.class, ThaumcraftHandler.AspectAdder.mAspectListClass); - ThaumcraftHandler.AspectAdder.getName = AspectAdder.mAspectClass.getMethod("getName"); + ThaumcraftHandler.AspectAdder.getName = ThaumcraftHandler.AspectAdder.mAspectClass.getMethod("getName"); + ThaumcraftHandler.AspectAdder.writeAspectListToNBT = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("writeToNBT", NBTTagCompound.class); + ThaumcraftHandler.AspectAdder.add = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("add", ThaumcraftHandler.AspectAdder.mAspectListClass); + ThaumcraftHandler.AspectAdder.getAmount = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("getAmount", ThaumcraftHandler.AspectAdder.mAspectClass); + ThaumcraftHandler.AspectAdder.getAspects = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("getAspects"); + ThaumcraftHandler.AspectAdder.readAspectListFromNBT = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("readFromNBT", NBTTagCompound.class); } catch (ClassNotFoundException | NoSuchMethodException e) { e.printStackTrace(); } @@ -109,7 +120,7 @@ public class ThaumcraftHandler { Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); for (Pair a : aspectPair) { if (ConfigHandler.debugLog) - DebugLog.log("Stack:"+ stack.getDisplayName() + " Damage:" +stack.getItemDamage() + " aspectPair: " + AspectAdder.getName.invoke(a.getKey()) + " / " + a.getValue()); + DebugLog.log("Stack:"+ stack.getDisplayName() + " Damage:" +stack.getItemDamage() + " aspectPair: " + ThaumcraftHandler.AspectAdder.getName.invoke(a.getKey()) + " / " + a.getValue()); ThaumcraftHandler.AspectAdder.addToList.invoke(aspectList, a.getKey(), a.getValue()); } ThaumcraftHandler.AspectAdder.registerObjectTag.invoke(null, stack, aspectList); diff --git a/src/main/java/com/github/bartimaeusnek/preloader/PreLoaderMod.java b/src/main/java/com/github/bartimaeusnek/preloader/PreLoaderMod.java new file mode 100644 index 0000000000..b46a133df5 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/preloader/PreLoaderMod.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.preloader; + +import com.github.bartimaeusnek.bartworks.common.loaders.BeforeGTPreload; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import gregtech.api.GregTech_API; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@Mod( + modid = com.github.bartimaeusnek.preloader.PreLoaderMod.MOD_ID, name = com.github.bartimaeusnek.preloader.PreLoaderMod.NAME, version = com.github.bartimaeusnek.preloader.PreLoaderMod.VERSION, + dependencies = "required-before:IC2; " + + "required-before:gregtech; " + + "required-before:bartworks;" + + "before:GalacticraftMars; " + + "before:GalacticraftCore; " + + "before:miscutils;" + + "before:dreamcraft;" + + "before:EMT;" +) +public class PreLoaderMod { + public static final String NAME = "BartWorks Preloader Mod"; + public static final String VERSION = "0.0.1"; + public static final String MOD_ID = "bartworkspreloader"; + public static final Logger LOGGER = LogManager.getLogger(BartWorksCrossmod.NAME); + + + @Mod.EventHandler + public void preInit(FMLPreInitializationEvent preinit) { + GregTech_API.sBeforeGTPreload.add(new BeforeGTPreload()); + } +} -- cgit From c8152dc7aeeabf21f1ed3fca2b895153595dcec8 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 3 Sep 2019 09:09:55 +0200 Subject: travis fix? -changed OracleJDK8 -> OpenJDK8 Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: a3bfcadfd51454c0f98a188d27cd4c4d28ee50bb --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f35895a6d5..7625510d22 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ cache: - "$HOME/.gradle/wrapper" - "$HOME/.gradle/minecraft" jdk: - - oraclejdk8 + - openjdk8 jobs: include: # - stage: sonar -- cgit From 8dda23e3d9e80d467c60a192e24ec38d1a33882a Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 4 Sep 2019 00:20:40 +0200 Subject: changed load order again, fixing class exceptions in obfs enviroment Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: bb79d62b33144ce4b36289d05bea2bbbff972732 --- build.properties | 2 +- .../java/com/github/bartimaeusnek/ASM/BWCore.java | 2 +- .../bartimaeusnek/ASM/BWCoreTransformer.java | 29 +++++ .../bartworks/common/loaders/BeforeGTPreload.java | 135 +++++++++------------ .../bartworks/common/loaders/ItemRegistry.java | 34 +++++- .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 9 +- .../crossmod/emt/recipe/TCRecipeHandler.java | 11 +- .../multi/GT_Industrial_Alchemic_Furnace.java | 1 - .../bartimaeusnek/preloader/PreLoaderMod.java | 55 --------- 9 files changed, 129 insertions(+), 149 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/preloader/PreLoaderMod.java diff --git a/build.properties b/build.properties index 7daca1c59d..e314c6ce35 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=1 +buildNumber=2 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java index b32537378c..2b4eafb9a1 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java @@ -67,7 +67,7 @@ public class BWCore extends DummyModContainer { @Override public List getDependants() { - List ret = new ArrayList(); + List ret = new ArrayList<>(); ret.add(new DefaultArtifactVersion("ExtraUtilities", true)); ret.add(new DefaultArtifactVersion("Thaumcraft", true)); ret.add(new DefaultArtifactVersion(BartWorksCrossmod.MOD_ID, true)); diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index f2631564c4..06261bea9f 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -38,6 +38,7 @@ public class BWCoreTransformer implements IClassTransformer { "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS", "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", + "PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API" // "ADD EXECTION HANDLEING TO FIND OREIDS/OREDICT" }; public static final String[] CLASSESBEEINGTRANSFORMED = { @@ -45,6 +46,7 @@ public class BWCoreTransformer implements IClassTransformer { "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", "net.minecraft.client.renderer.RenderGlobal", "thaumcraft.common.tiles.TileWandPedestal", + "gregtech.GT_Mod" // "net.minecraftforge.oredict.OreDictionary" }; static boolean obfs; @@ -221,7 +223,34 @@ public class BWCoreTransformer implements IClassTransformer { break; } case 4 : { + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + String name_deObfs = ""; + for (int i = 0; i < methods.size(); i++) { + MethodNode toPatch = methods.get(i); + if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs) && (methods.get(i).access & ACC_STATIC) != 0) { + BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); + InsnList nu = new InsnList(); + LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; + for (int j = 0; j < 2; j++) { + nu.add(toPatch.instructions.get(j)); + } + nu.add(new FieldInsnNode(GETSTATIC, "gregtech/api/GregTech_API", "sBeforeGTPreload", "Ljava/util/List;")); + nu.add(new TypeInsnNode(NEW, "com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload")); + nu.add(new InsnNode(DUP)); + nu.add(new MethodInsnNode(INVOKESPECIAL, "com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload", "", "()V", false)); + nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/List", "add", "(Ljava/lang/Object;)Z", true)); + nu.add(new InsnNode(POP)); + for (int j = 2; j < toPatch.instructions.size(); j++) { + nu.add(toPatch.instructions.get(j)); + } + toPatch.instructions = nu; + break; + } + } + break; + } + case 5: { // String name_deObfs = "getOreIDs"; // String dsc_deObfs = "(Lnet/minecraft/item/ItemStack;)[I"; // String dsc_Obfs = "(Ladd;)[I"; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java index de0e57a138..2164330a96 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java @@ -22,19 +22,14 @@ package com.github.bartimaeusnek.bartworks.common.loaders; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; -import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; -import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_ExperimentalFloodGate; -import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.LoadController; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.util.GT_OreDictUnificator; import ic2.core.Ic2Items; +import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; @@ -42,87 +37,75 @@ import org.apache.commons.lang3.reflect.FieldUtils; import java.lang.reflect.Field; -import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; - public class BeforeGTPreload implements Runnable { + + private static boolean didrun; + @Override public void run() { - Field fieldModController = FieldUtils.getDeclaredField(Loader.class,"modController",true); - LoadController modController = null; - try { - modController = (LoadController) fieldModController.get(Loader.instance()); - } catch (IllegalAccessException e) { - e.printStackTrace(); - FMLCommonHandler.instance().exitJava(-1,true); - } + if (didrun) + return; + + Field activeContainer = FieldUtils.getDeclaredField(LoadController.class, "activeContainer", true); ModContainer bartworks = null; - ModContainer gregtech = null; - assert modController != null; - for (ModContainer mod : modController.getActiveModList()){ - if (mod.getModId().equals(MainMod.MOD_ID)) { - bartworks = mod; + ModContainer gregtech = Loader.instance().activeModContainer(); + boolean switchback = false; + LoadController modController = null; + if (!Loader.instance().activeModContainer().getModId().equals("bartworks")) { + Field fieldModController = FieldUtils.getDeclaredField(Loader.class, "modController", true); + try { + modController = (LoadController) fieldModController.get(Loader.instance()); + } catch (IllegalAccessException e) { + e.printStackTrace(); + FMLCommonHandler.instance().exitJava(-1, true); } - if (mod.getModId().equals("gregtech")) - gregtech=mod; - if (bartworks!= null && gregtech != null) - break; - } - if (bartworks == null || gregtech == null) - FMLCommonHandler.instance().exitJava(-1,true); - Field activeContainer = FieldUtils.getDeclaredField(LoadController.class,"activeContainer",true); - try { - activeContainer.set(modController,bartworks); - } catch (IllegalAccessException e) { - e.printStackTrace(); - FMLCommonHandler.instance().exitJava(-1,true); - } - - if (newStuff) { - GameRegistry.registerBlock(ItemRegistry.bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); - GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses, "BW_FakeGlasBlock"); - GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[2], BW_ItemBlocks.class, "BW_Machinery_Casings"); - GameRegistry.registerItem(ItemRegistry.LEATHER_ROTOR, "BW_LeatherRotor"); - GameRegistry.registerItem(ItemRegistry.WOOL_ROTOR, "BW_WoolRotor"); - GameRegistry.registerItem(ItemRegistry.PAPER_ROTOR, "BW_PaperRotor"); - GameRegistry.registerItem(ItemRegistry.COMBINED_ROTOR, "BW_CombinedRotor"); - GameRegistry.registerItem(ItemRegistry.CRAFTING_PARTS, "craftingParts"); - GameRegistry.registerTileEntity(BW_RotorBlock.class, "BWRotorBlockTE"); - GameRegistry.registerBlock(ItemRegistry.ROTORBLOCK, BW_ItemBlocks.class, "BWRotorBlock"); - GameRegistry.registerTileEntity(BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPumpTE"); - GameRegistry.registerBlock(ItemRegistry.PUMPBLOCK, BW_ItemBlocks.class, "BWHeatedWaterPumpBlock"); - GameRegistry.registerItem(ItemRegistry.PUMPPARTS, "BWPumpParts"); - GameRegistry.registerItem(ItemRegistry.WINDMETER, "BW_SimpleWindMeter"); - GameRegistry.registerTileEntity(BW_TileEntity_ExperimentalFloodGate.class, "BWExpReversePump"); - GameRegistry.registerBlock(ItemRegistry.EXPPUMP, BW_ItemBlocks.class, "BWExpReversePumpBlock"); - } - - //GT2 stuff - GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[0], BW_ItemBlocks.class, "BW_ItemBlocks"); - GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[1], BW_ItemBlocks.class, "GT_LESU_CASING"); - if (ConfigHandler.teslastaff) - GameRegistry.registerItem(ItemRegistry.TESLASTAFF, ItemRegistry.TESLASTAFF.getUnlocalizedName()); + assert modController != null; + for (ModContainer mod : modController.getActiveModList()) { + if (mod.getModId().equals("bartworks")) { + bartworks = mod; + } + if (bartworks != null) + break; + } + if (bartworks == null || gregtech == null) + FMLCommonHandler.instance().exitJava(-1, true); - GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_LV, ItemRegistry.ROCKCUTTER_LV.getUnlocalizedName()); - GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_MV, ItemRegistry.ROCKCUTTER_MV.getUnlocalizedName()); - GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_HV, ItemRegistry.ROCKCUTTER_HV.getUnlocalizedName()); - GameRegistry.registerItem(ItemRegistry.TAB, "tabIconGT2"); - OreDictionary.registerOre("blockGlassHV",new ItemStack(Blocks.glass,1,Short.MAX_VALUE)); - OreDictionary.registerOre("blockGlassHV",new ItemStack(ItemRegistry.bw_glasses[0],1,0)); - OreDictionary.registerOre("blockGlassEV", Ic2Items.reinforcedGlass); - OreDictionary.registerOre("blockGlassEV",new ItemStack(ItemRegistry.bw_glasses[0],1,1)); - OreDictionary.registerOre("blockGlassIV",new ItemStack(ItemRegistry.bw_glasses[0],1,2)); - OreDictionary.registerOre("blockGlassIV",new ItemStack(ItemRegistry.bw_glasses[0],1,12)); - OreDictionary.registerOre("blockGlassLuV",new ItemStack(ItemRegistry.bw_glasses[0],1,3)); - OreDictionary.registerOre("blockGlassZPM",new ItemStack(ItemRegistry.bw_glasses[0],1,4)); - OreDictionary.registerOre("blockGlassUV",new ItemStack(ItemRegistry.bw_glasses[0],1,5)); + try { + activeContainer.set(modController, bartworks); + } catch (IllegalAccessException e) { + e.printStackTrace(); + FMLCommonHandler.instance().exitJava(-1, true); + } + switchback = true; + } + Block[] bw_glasses; try { - activeContainer.set(modController,gregtech); - } catch (IllegalAccessException e) { + bw_glasses = (Block[]) Class.forName("com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry").getField("bw_glasses").get(null); + GameRegistry.registerBlock(bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); + OreDictionary.registerOre("blockGlassHV", new ItemStack(Blocks.glass, 1, Short.MAX_VALUE)); + OreDictionary.registerOre("blockGlassHV", new ItemStack(bw_glasses[0], 1, 0)); + OreDictionary.registerOre("blockGlassEV", Ic2Items.reinforcedGlass); + OreDictionary.registerOre("blockGlassEV", new ItemStack(bw_glasses[0], 1, 1)); + OreDictionary.registerOre("blockGlassIV", new ItemStack(bw_glasses[0], 1, 2)); + OreDictionary.registerOre("blockGlassIV", new ItemStack(bw_glasses[0], 1, 12)); + OreDictionary.registerOre("blockGlassLuV", new ItemStack(bw_glasses[0], 1, 3)); + OreDictionary.registerOre("blockGlassZPM", new ItemStack(bw_glasses[0], 1, 4)); + OreDictionary.registerOre("blockGlassUV", new ItemStack(bw_glasses[0], 1, 5)); + } catch (IllegalAccessException | NoSuchFieldException | ClassNotFoundException e) { e.printStackTrace(); - FMLCommonHandler.instance().exitJava(-1,true); + FMLCommonHandler.instance().exitJava(-1, true); + } + if (switchback) { + try { + activeContainer.set(modController, gregtech); + } catch (IllegalAccessException e) { + e.printStackTrace(); + FMLCommonHandler.instance().exitJava(-1, true); + } } + BeforeGTPreload.didrun = true; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index f14e5f8051..6e55fd509a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -40,9 +40,6 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_Til import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.*; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import cpw.mods.fml.common.LoadController; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -55,9 +52,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; -import org.apache.commons.lang3.reflect.FieldUtils; - -import java.lang.reflect.Field; import static com.github.bartimaeusnek.bartworks.MainMod.BWT; import static com.github.bartimaeusnek.bartworks.MainMod.GT2; @@ -145,6 +139,34 @@ public class ItemRegistry { public static ItemStack giantOutputHatch; public static void run() { + if (newStuff) { + GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses, "BW_FakeGlasBlock"); + GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[2], BW_ItemBlocks.class, "BW_Machinery_Casings"); + GameRegistry.registerItem(ItemRegistry.LEATHER_ROTOR, "BW_LeatherRotor"); + GameRegistry.registerItem(ItemRegistry.WOOL_ROTOR, "BW_WoolRotor"); + GameRegistry.registerItem(ItemRegistry.PAPER_ROTOR, "BW_PaperRotor"); + GameRegistry.registerItem(ItemRegistry.COMBINED_ROTOR, "BW_CombinedRotor"); + GameRegistry.registerItem(ItemRegistry.CRAFTING_PARTS, "craftingParts"); + GameRegistry.registerTileEntity(BW_RotorBlock.class, "BWRotorBlockTE"); + GameRegistry.registerBlock(ItemRegistry.ROTORBLOCK, BW_ItemBlocks.class, "BWRotorBlock"); + GameRegistry.registerTileEntity(BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPumpTE"); + GameRegistry.registerBlock(ItemRegistry.PUMPBLOCK, BW_ItemBlocks.class, "BWHeatedWaterPumpBlock"); + GameRegistry.registerItem(ItemRegistry.PUMPPARTS, "BWPumpParts"); + GameRegistry.registerItem(ItemRegistry.WINDMETER, "BW_SimpleWindMeter"); + GameRegistry.registerTileEntity(BW_TileEntity_ExperimentalFloodGate.class, "BWExpReversePump"); + GameRegistry.registerBlock(ItemRegistry.EXPPUMP, BW_ItemBlocks.class, "BWExpReversePumpBlock"); + } + + //GT2 stuff + GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[0], BW_ItemBlocks.class, "BW_ItemBlocks"); + GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[1], BW_ItemBlocks.class, "GT_LESU_CASING"); + if (ConfigHandler.teslastaff) + GameRegistry.registerItem(ItemRegistry.TESLASTAFF, ItemRegistry.TESLASTAFF.getUnlocalizedName()); + + GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_LV, ItemRegistry.ROCKCUTTER_LV.getUnlocalizedName()); + GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_MV, ItemRegistry.ROCKCUTTER_MV.getUnlocalizedName()); + GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_HV, ItemRegistry.ROCKCUTTER_HV.getUnlocalizedName()); + GameRegistry.registerItem(ItemRegistry.TAB, "tabIconGT2"); if (newStuff) { if (ConfigHandler.creativeScannerID != 0) new CreativeScanner(ConfigHandler.creativeScannerID,"Creative Debug Scanner","Creative Debug Scanner",20); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 9bbd454325..49f2b22365 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -22,24 +22,23 @@ package com.github.bartimaeusnek.crossmod; -import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.commands.ChangeConfig; import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; -import com.github.bartimaeusnek.crossmod.emt.recipe.TCRecipeHandler; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.event.*; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; import net.minecraft.util.StringTranslate; import org.apache.commons.io.input.ReaderInputStream; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.StringReader; -import java.lang.reflect.InvocationTargetException; @Mod( modid = BartWorksCrossmod.MOD_ID, name = BartWorksCrossmod.NAME, version = BartWorksCrossmod.VERSION, diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java index c36f63cd00..e6e500987c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java @@ -26,7 +26,6 @@ import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.HashBiMap; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; @@ -133,9 +132,13 @@ public class TCRecipeHandler { } } for (ItemStack o : itemToAspectsMap.keySet()){ - for (int j = 1; j <= itemToAspectsMap.get(o).size() ; j++) { - itemToCircuitConfigMap.put(o,j); - } + if (o.getItemDamage() == Short.MAX_VALUE) + itemToCircuitConfigMap.put(o,24); + else + for (int j = 1; j <= itemToAspectsMap.get(o).size(); j++) { + itemToCircuitConfigMap.put(o,j%24); + } + for (int j = 0; j < itemToAspectsMap.get(o).size() ; j++) { ret.add(addRecipes(itemToResearchMap.get(o).get(j),itemToOutputMap.get(o).get(j),itemToAspectsMap.get(o).get(j),o,itemToCircuitConfigMap.get(o).get(j))); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Furnace.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Furnace.java index fa9bf7cd37..b8192f742e 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Furnace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Furnace.java @@ -28,7 +28,6 @@ import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Recipe; diff --git a/src/main/java/com/github/bartimaeusnek/preloader/PreLoaderMod.java b/src/main/java/com/github/bartimaeusnek/preloader/PreLoaderMod.java deleted file mode 100644 index b46a133df5..0000000000 --- a/src/main/java/com/github/bartimaeusnek/preloader/PreLoaderMod.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.preloader; - -import com.github.bartimaeusnek.bartworks.common.loaders.BeforeGTPreload; -import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import gregtech.api.GregTech_API; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -@Mod( - modid = com.github.bartimaeusnek.preloader.PreLoaderMod.MOD_ID, name = com.github.bartimaeusnek.preloader.PreLoaderMod.NAME, version = com.github.bartimaeusnek.preloader.PreLoaderMod.VERSION, - dependencies = "required-before:IC2; " - + "required-before:gregtech; " - + "required-before:bartworks;" - + "before:GalacticraftMars; " - + "before:GalacticraftCore; " - + "before:miscutils;" - + "before:dreamcraft;" - + "before:EMT;" -) -public class PreLoaderMod { - public static final String NAME = "BartWorks Preloader Mod"; - public static final String VERSION = "0.0.1"; - public static final String MOD_ID = "bartworkspreloader"; - public static final Logger LOGGER = LogManager.getLogger(BartWorksCrossmod.NAME); - - - @Mod.EventHandler - public void preInit(FMLPreInitializationEvent preinit) { - GregTech_API.sBeforeGTPreload.add(new BeforeGTPreload()); - } -} -- cgit From 2616ba28c946150a3d802c6414fbd403a8a412ed Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 4 Sep 2019 00:27:35 +0200 Subject: updated readme Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: e827990775fe49a66c9fa5f59b660ff5c8927e3e --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index ea0aa21230..af2d69b350 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,6 @@ A Gregtech addon, that adds GT2,3,4 stuff, a BioLabor, and much more custom content. Integration for Galaxy Space, and new Ores aswell. Visit us on Twitch: https://minecraft.curseforge.com/projects/bartworks/ + + +Please add -Dfml.coreMods.load=com.github.bartimaeusnek.ASM.BWCorePlugin to your args when you run this in a dev enviroment! \ No newline at end of file -- cgit From a8e54c336b8a5bc8509d173ea438af59f7acf909 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 5 Sep 2019 10:11:23 +0200 Subject: began on PlatinumOverhaul Palladium and Platinum recipes are done Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: b7cbc2e2b799c3bc2a2e6ef31395d14bda5f6ef0 --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 3 +- .../bartworks/system/material/Werkstoff.java | 8 + .../bartworks/system/material/WerkstoffLoader.java | 311 ++++++++++++++++++++- .../processingLoaders/AdditionalRecipes.java | 61 ++-- .../processingLoaders/PlatinumSludgeOverHaul.java | 171 +++++++++++ .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 8 +- .../crossmod/emt/recipe/TCRecipeHandler.java | 2 +- .../multi/GT_Industrial_Alchemic_Construct.java | 186 ++++++++++++ .../multi/GT_Industrial_Alchemic_Furnace.java | 149 ---------- .../thaumcraft/util/ThaumcraftHandler.java | 7 +- 11 files changed, 717 insertions(+), 191 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Furnace.java diff --git a/build.properties b/build.properties index e314c6ce35..c905c6cecc 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2 +buildNumber=2_pre1 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 9a5e86b39c..b3cd4aca0c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -43,6 +43,7 @@ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.Circ import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader; +import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.PlatinumSludgeOverHaul; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -200,7 +201,7 @@ public final class MainMod { HashSet noGas = MainMod.getNoGasItems(toChange); MainMod.editRecipes(toChange, noGas); } - + PlatinumSludgeOverHaul.replacePureElements(); new CircuitImprintLoader().run(); if (classicMode) new DownTierLoader().run(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 5d73dba279..0f0d9d3c5e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -194,6 +194,14 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.type; } + public boolean containsStuff(ISubTagContainer stuff){ + for (Pair pair : this.contents){ + if (pair.getKey().equals(stuff)) + return true; + } + return false; + } + public Pair>> getContents() { int ret = 0; switch (this.type) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index bf3ae4bb9e..269a258809 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -33,6 +33,7 @@ import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import cpw.mods.fml.client.registry.RenderingRegistry; @@ -659,6 +660,245 @@ public class WerkstoffLoader implements Runnable { new Pair<>(WerkstoffLoader.Neon,1), new Pair<>(Materials.Potassium,1) ); + public static final Werkstoff PTConcentrate = new Werkstoff( + Materials.Platinum.getRGBA(), + "Platin Concentrate", + "", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 44, + TextureSet.SET_FLUID + //No Byproducts + //No Ingredients + ); + public static final Werkstoff PTSaltCrude = new Werkstoff( + Materials.Platinum.getRGBA(), + "Platin Salt", + "", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 45, + TextureSet.SET_DULL + //No Byproducts + //No Ingredients + ); + public static final Werkstoff PTSaltRefined = new Werkstoff( + Materials.Platinum.getRGBA(), + "Refined Platin Salt", + "", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 46, + TextureSet.SET_METALLIC + //No Byproducts + //No Ingredients + ); + public static final Werkstoff PTMetallicPowder = new Werkstoff( + Materials.Platinum.getRGBA(), + "Platin Metallic Powder", + "", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 47, + TextureSet.SET_METALLIC + //No Byproducts + //No Ingredients + ); + public static final Werkstoff AquaRegia = new Werkstoff( + new short[]{0xff,0xb1,0x32}, + "AquaRegia", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 48, + TextureSet.SET_FLUID, + //No Byproducts + new Pair<>(Materials.DilutedSulfuricAcid,1), + new Pair<>(Materials.NitricAcid,1) + ); + public static final Werkstoff PTResidue = new Werkstoff( + Materials.Platinum.getRGBA(), + "Platinum Residue", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 49, + TextureSet.SET_ROUGH + //No Byproducts + ); + public static final Werkstoff AmmoniumCloride = new Werkstoff( + new short[]{0xff,0xff,0xff}, + "Ammonium Cloride", + subscriptNumbers("NH4Cl"), + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + 50, + TextureSet.SET_FLUID, + //No Byproducts + new Pair<>(Materials.Ammonium,1), + new Pair<>(Materials.HydrochloricAcid,1) + ); + public static final Werkstoff PTRawPowder = new Werkstoff( + Materials.Platinum.getRGBA(), + "Reprecipated Platin", + "PtCl", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 51, + TextureSet.SET_METALLIC + //No Byproducts + //No Ingredients + ); + public static final Werkstoff PDAmmonia = new Werkstoff( + Materials.Palladium.getRGBA(), + "Palladium enriched Ammonia", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 52, + TextureSet.SET_FLUID, + //No Byproducts + new Pair<>(Materials.Ammonium,1), + new Pair<>(Materials.Palladium,1) + ); + public static final Werkstoff PDMetallicPowder = new Werkstoff( + Materials.Palladium.getRGBA(), + "Palladium Metallic Powder", + "", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 53, + TextureSet.SET_METALLIC + //No Byproducts + //No Ingredients + ); + public static final Werkstoff PDRawPowder = new Werkstoff( + Materials.Palladium.getRGBA(), + "Reprecipated Palladium", + subscriptNumbers("Pd2NH4"), + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 54, + TextureSet.SET_METALLIC + //No Byproducts + //No Ingredients + ); + public static final Werkstoff PDSalt = new Werkstoff( + Materials.Palladium.getRGBA(), + "Palladium Salt", + "", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 55, + TextureSet.SET_METALLIC + //No Byproducts + //No Ingredients + ); + public static final Werkstoff Sodiumformate = new Werkstoff( + new short[]{0xff,0xaa,0xaa}, + "Sodium formate", + "HCOONa", + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + 56, + TextureSet.SET_FLUID, + //No Byproducts + new Pair<>(Materials.SodiumHydroxide,1), + new Pair<>(Materials.CarbonMonoxide,1) + ); + public static final Werkstoff Sodiumsulfate = new Werkstoff( + new short[]{0xff,0xff,0xff}, + "Sodium sulfate", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 57, + TextureSet.SET_FLUID, + //No Byproducts + new Pair<>(Materials.Sodium,2), + new Pair<>(Materials.Sulfur,1), + new Pair<>(Materials.Oxygen,4) + ); + public static final Werkstoff FormicAcid = new Werkstoff( + new short[]{0xff,0xaa,0x77}, + "Formic Acid", + subscriptNumbers("CH2O2"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + 58, + TextureSet.SET_FLUID, + //No Byproducts + new Pair<>(Materials.Carbon,1), + new Pair<>(Materials.Hydrogen,2), + new Pair<>(Materials.Oxygen,2) + ); + public static final Werkstoff PotassiumDisulfate = new Werkstoff( + new short[]{0xfb,0xbb,0x66}, + "PotassiumDisulfate", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), + 59, + TextureSet.SET_DULL, + //No Byproducts + new Pair<>(Materials.Potassium,2), + new Pair<>(Materials.Sulfur,2), + new Pair<>(Materials.Oxygen,7) + ); + public static final Werkstoff PHLESSResidue = new Werkstoff( + Materials.Platinum.getRGBA(), + "Leach Residue", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 60, + TextureSet.SET_ROUGH + //No Byproducts + ); + public static final Werkstoff RHSulfate = new Werkstoff( + new short[]{0xee,0xaa,0x55}, + "Rh Sulfate", + new Werkstoff.Stats().setGas(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + 61, + TextureSet.SET_ROUGH + //No Byproducts + ); + public static final Werkstoff RHSulfateSolution = new Werkstoff( + new short[]{0xff,0xbb,0x66}, + "Rh Sulfate Solution", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 62, + TextureSet.SET_ROUGH + //No Byproducts + ); + public static final Werkstoff CalciumChloride = new Werkstoff( + new short[]{0xff,0xff,0xff}, + "Calcium chloride", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 63, + TextureSet.SET_DULL, + new Pair<>(Materials.Calcium,1), + new Pair<>(Materials.Chlorine,2) + //No Byproducts + ); + public static HashMap items = new HashMap<>(); public static HashMap fluids = new HashMap<>(); @@ -1136,8 +1376,8 @@ public class WerkstoffLoader implements Runnable { ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput,werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(dust)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),30,0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, null,new ItemStack[]{werkstoff.get(dust)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),30,0)); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false,new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(dust)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),30,0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false,new BWRecipes.DynamicGTRecipe(false, null,new ItemStack[]{werkstoff.get(dust)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),30,0)); } } } @@ -1220,6 +1460,69 @@ public class WerkstoffLoader implements Runnable { if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000) == 0) return; + if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { + List flOutputs = new ArrayList<>(); + List stOutputs = new ArrayList<>(); + HashMap> tracker = new HashMap<>(); + int cells = 0; + for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { + if (container.getKey() instanceof Materials) { + if (((Materials) container.getKey()).hasCorrespondingGas() || ((Materials) container.getKey()).hasCorrespondingFluid() || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { + FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); + if (tmpFl == null || tmpFl.getFluid() == null) { + tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); + } + flOutputs.add(tmpFl); + if (flOutputs.size() > 1) { + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + } else { + stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + } + cells += container.getValue(); + } + } + } else if (container.getKey() instanceof Werkstoff) { + if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).getGenerationFeatures().hasCells()) { + FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); + if (tmpFl == null || tmpFl.getFluid() == null) { + tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); + } + flOutputs.add(tmpFl); + if (flOutputs.size() > 1) { + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + } else { + stOutputs.add(((Werkstoff) container.getKey()).get(cell, tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + } + cells += container.getValue(); + } + } + } + } + ItemStack input = werkstoff.get(cell); + input.stackSize = werkstoff.getContents().getKey(); + stOutputs.add(Materials.Empty.getCells(cells)); + if (werkstoff.getStats().isElektrolysis()) + GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); + if (werkstoff.getStats().isCentrifuge()) + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0); + if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { + if (cells > 0) + stOutputs.add(Materials.Empty.getCells(cells)); + GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0); + } + if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { + if (cells > 0) + stOutputs.add(Materials.Empty.getCells(cells)); + GT_Recipe.GT_Recipe_Map.sMixerRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0); + } + } + //Tank "Recipe" GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(WerkstoffLoader.fluids.get(werkstoff), 1000),werkstoff.get(cell),Materials.Empty.getCells(1))); @@ -1253,8 +1556,8 @@ public class WerkstoffLoader implements Runnable { ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput,werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),30,0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),30,0)); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false,new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),30,0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false,new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),30,0)); } } private void addMoltenRecipes(Werkstoff werkstoff) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 0acd99df2d..f829306575 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -116,36 +116,39 @@ public class AdditionalRecipes implements Runnable { Materials.SolderingAlloy.getMolten((i+1)*144) },null,(i+1)*1500, BW_Util.getMachineVoltageFromTier(i+1),CLEANROOM)); } + oldGThelperMethod(); + } - //manual override for older GT - Werkstoff werkstoff = WerkstoffLoader.Oganesson; - Materials werkstoffBridgeMaterial = null; - boolean aElementSet = false; - for (Element e : Element.values()){ - if (e.toString().equals("Uuo")){ - werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName(),werkstoff.getDefaultName()); - werkstoffBridgeMaterial.mElement = e; - e.mLinkedMaterials.add(werkstoffBridgeMaterial); - aElementSet = true; - break; - } - } - if (!aElementSet) - return; + private static void oldGThelperMethod(){ + //manual override for older GT + Werkstoff werkstoff = WerkstoffLoader.Oganesson; + Materials werkstoffBridgeMaterial = null; + boolean aElementSet = false; + for (Element e : Element.values()){ + if (e.toString().equals("Uuo")){ + werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName(),werkstoff.getDefaultName()); + werkstoffBridgeMaterial.mElement = e; + e.mLinkedMaterials.add(werkstoffBridgeMaterial); + aElementSet = true; + break; + } + } + if (!aElementSet) + return; - GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),true); - try { - Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); - f.setAccessible(true); - Map MATERIALS_MAP = (Map) f.get(null); - MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); - } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { - e.printStackTrace(); - } - ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); - Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),30,0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),30,0)); + GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),true); + try { + Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); + f.setAccessible(true); + Map MATERIALS_MAP = (Map) f.get(null); + MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); + } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { + e.printStackTrace(); + } + ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); + Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false,new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),30,0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false,new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),30,0)); } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java new file mode 100644 index 0000000000..67bf92e8de --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; + +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.objects.MaterialStack; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraftforge.fluids.FluidStack; + +import java.util.Map; + +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static gregtech.api.enums.OrePrefixes.*; + +public class PlatinumSludgeOverHaul { + private PlatinumSludgeOverHaul(){} + + public static void runHelperrecipes(){ + //FormicAcid + GT_Values.RA.addChemicalRecipe(Sodiumformate.get(cell,2), GT_Utility.getIntegratedCircuit(21), Materials.SulfuricAcid.getFluid(1000),null,FormicAcid.get(cell,2),Sodiumsulfate.get(dust),15); + GT_Values.RA.addChemicalRecipe(Materials.SulfuricAcid.getCells(2), GT_Utility.getIntegratedCircuit(21), Sodiumformate.getFluidOrGas(1000),FormicAcid.getFluidOrGas(2000),Materials.Empty.getCells(2),Sodiumsulfate.get(dust),15); + //AquaRegia + GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1),Materials.NitricAcid.getCells(1),GT_Utility.getIntegratedCircuit(1),null,null,null, AquaRegia.get(cell,2),30,30); + //AmmoniumCloride + GT_Values.RA.addChemicalRecipe(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(11), Materials.HydrochloricAcid.getFluid(1000),null,AmmoniumCloride.get(cell,1),null,15); + GT_Values.RA.addChemicalRecipe(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(11), Materials.Ammonia.getGas(1000),AmmoniumCloride.getFluidOrGas(1000),Materials.Empty.getCells(1),null,15); + + for (Werkstoff w :Werkstoff.werkstoffHashMap.values()) + if (w.containsStuff(Materials.Sulfur)&&(w.containsStuff(Materials.Copper)||w.containsStuff(Materials.Nickel))) { + GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(11), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); + GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dust), 250); + } + for (Materials m : Materials.values()) + if (materialsContains(m,Materials.Sulfur)&&(materialsContains(m,Materials.Copper)||materialsContains(m,Materials.Nickel))){ + GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified,m,1), GT_Utility.getIntegratedCircuit(11), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); + GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified,m,1), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dust), 250); + } + GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(11), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dust), 250); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{},new FluidStack[]{PTConcentrate.getFluidOrGas(1000),AmmoniumCloride.getFluidOrGas(1000)},new FluidStack[]{PDAmmonia.getFluidOrGas(1000)},new ItemStack[]{PTSaltCrude.get(dustTiny,8),PTRawPowder.get(dustTiny)},600,30); + GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust),new ItemStack[]{ + PTSaltRefined.get(dustTiny), + PTSaltRefined.get(dustTiny), + PTSaltRefined.get(dustTiny), + PTSaltRefined.get(dustTiny), + PTSaltRefined.get(dustTiny), + PTSaltRefined.get(dustTiny), + PTSaltRefined.get(dustTiny), + PTSaltRefined.get(dustTiny), + PTSaltRefined.get(dustTiny), + },new int[]{ + 1000,1000,1000,1000,1000,1000,1000,1000,500, + },600,30); + GT_Values.RA.addBlastRecipe(PTSaltRefined.get(dust),null,null,null,PTMetallicPowder.get(dust),null,200,120,900); + GT_Values.RA.addChemicalRecipe(PTRawPowder.get(dust,2),Materials.Calcium.getDust(1),null,null,Materials.Platinum.getDust(2),CalciumChloride.get(dust),30); + GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(11), PDAmmonia.getFluidOrGas(1000), null,PDSalt.get(dustTiny,16),PDRawPowder.get(dustTiny,2), 250); + GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(10),null,PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dustTiny,9), 250); + GT_Values.RA.addSifterRecipe(PDSalt.get(dust),new ItemStack[]{ + PDMetallicPowder.get(dustTiny), + PDMetallicPowder.get(dustTiny), + PDMetallicPowder.get(dustTiny), + PDMetallicPowder.get(dustTiny), + PDMetallicPowder.get(dustTiny), + PDMetallicPowder.get(dustTiny), + PDMetallicPowder.get(dustTiny), + PDMetallicPowder.get(dustTiny), + PDMetallicPowder.get(dustTiny), + },new int[]{ + 1000,1000,1000,1000,1000,1000,1000,1000,500, + },600,30); + GT_Values.RA.addChemicalRecipe(PDRawPowder.get(dust,2), GT_Utility.getIntegratedCircuit(11), FormicAcid.getFluidOrGas(4000), Materials.Ammonium.getGas(2000),Materials.Palladium.getDust(2),Materials.Ethylene.getDust(1), 250); + + + } + + + private static boolean materialsContains(Materials one, ISubTagContainer other){ + if (one == null || one.mMaterialList == null || one.mMaterialList.isEmpty()) + return false; + for (MaterialStack stack : one.mMaterialList) + if (stack.mMaterial.equals(other)) + return true; + return false; + } + + + public static void replacePureElements(){ + for (Object entry : FurnaceRecipes.smelting().getSmeltingList().entrySet()){ + Map.Entry realEntry = (Map.Entry) entry; + if (GT_Utility.isStackValid(realEntry.getKey()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getKey())) + if (!GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dust) && !GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dustTiny)) + if (GT_Utility.isStackValid(realEntry.getValue()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())) + if (GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()).mMaterial.mMaterial.equals(Materials.Platinum)) + realEntry.setValue(PTMetallicPowder.get(dust)); + else if (GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()).mMaterial.mMaterial.equals(Materials.Palladium)) + realEntry.setValue(PDMetallicPowder.get(dust)); + } + + maploop: for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + for (GT_Recipe recipe : map.mRecipeList) { + if (recipe.mFakeRecipe) + continue maploop; + for (int i = 0; i < recipe.mOutputs.length; i++) { + if (!BW_Util.checkStackAndPrefix(recipe.mOutputs[i])) + continue; + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Platinum)) { + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 11); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PTMetallicPowder.get(dustSmall).splitStack(amount); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount); + } + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Palladium)) { + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PDMetallicPowder.get(dustTiny).splitStack(amount * 11); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PDMetallicPowder.get(dust).splitStack(amount); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PDMetallicPowder.get(dustSmall).splitStack(amount); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PDMetallicPowder.get(dustTiny).splitStack(amount); + } + } + } + } + } + PlatinumSludgeOverHaul.runHelperrecipes(); + } + +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 49f2b22365..eaaac8cbd6 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -25,20 +25,19 @@ package com.github.bartimaeusnek.crossmod; import com.github.bartimaeusnek.bartworks.common.commands.ChangeConfig; import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; +import com.github.bartimaeusnek.crossmod.emt.recipe.TCRecipeHandler; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.event.*; import net.minecraft.util.StringTranslate; import org.apache.commons.io.input.ReaderInputStream; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.StringReader; +import java.lang.reflect.InvocationTargetException; @Mod( modid = BartWorksCrossmod.MOD_ID, name = BartWorksCrossmod.NAME, version = BartWorksCrossmod.VERSION, @@ -98,7 +97,6 @@ public class BartWorksCrossmod { // } catch (IllegalAccessException | InvocationTargetException e) { // e.printStackTrace(); // } -// // } // } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java index e6e500987c..3b9a70b89d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java @@ -48,7 +48,7 @@ import java.util.HashSet; import static com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler.AspectAdder; public class TCRecipeHandler { - public static final GT_Recipe.GT_Recipe_Map alchemicalConstructHandler = new TCRecipeHandler.TCRecipeMap(new HashSet<>(), + public static final GT_Recipe.GT_Recipe_Map alchemicalConstructHandler = new TCRecipeHandler.TCRecipeMap(new HashSet<>(15000), "bwcm.recipe.alchemicalConstruct", "Industrical Alchemical Construct", null, diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java new file mode 100644 index 0000000000..c67674ae25 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.emt.tileentities.multi; + +import com.github.bartimaeusnek.crossmod.emt.recipe.TCRecipeHandler; +import com.github.bartimaeusnek.crossmod.emt.util.EMTHandler; +import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + +import java.lang.reflect.InvocationTargetException; +import java.util.*; + +import static gregtech.api.enums.GT_Values.V; + +public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlockBase { + + List mEssentiaHatches = new ArrayList<>(); + + public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity.getClass().isInstance(EMTHandler.aEssentiaInputHatch)) + return this.addEssetiaHatchToList(aTileEntity, aBaseCasingIndex); + return super.addInputToMachineList(aTileEntity, aBaseCasingIndex); + } + + private boolean addEssetiaHatchToList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } else if (aTileEntity.getClass().isInstance(EMTHandler.aEssentiaInputHatch)) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mEssentiaHatches.add(aMetaTileEntity); + } else { + return false; + } + } + } + + public GT_Industrial_Alchemic_Construct(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_Industrial_Alchemic_Construct(String aName) { + super(aName); + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + ItemStack stack = new ItemStack(Items.feather); + String owner = this.getBaseMetaTileEntity().getOwnerName(); + Object allAspects = null; + try { + allAspects = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); + for (Object o : this.mEssentiaHatches) { + Object aspectList = EMTHandler.aAspectField.get(o); + ThaumcraftHandler.AspectAdder.add.invoke(allAspects,aspectList); + } + NBTTagCompound toWrite = (NBTTagCompound)ThaumcraftHandler.AspectAdder.writeAspectListToNBT.invoke(allAspects,new NBTTagCompound()); + stack.setTagCompound(toWrite); + } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) { + e.printStackTrace(); + return false; + } + ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); + ItemStack outputItems = null; + + long tVoltage = this.getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + GT_Recipe tRecipe = TCRecipeHandler.alchemicalConstructHandler.findRecipe(this.getBaseMetaTileEntity(),null,false, false, V[tTier], null, stack, tInputs); + ItemStack helper = (ItemStack) tRecipe.mSpecialItems; + NBTTagCompound tagCompound = helper.getTagCompound(); + String research = tagCompound.getCompoundTag("display").getString("Name"); + Object aspectList = null; + try { + aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); + ThaumcraftHandler.AspectAdder.readAspectListFromNBT.invoke(aspectList,tagCompound); + } catch (IllegalAccessException | InvocationTargetException | InstantiationException e) { + e.printStackTrace(); + return false; + } + boolean complete = false; + try { + complete = (boolean) ThaumcraftHandler.AspectAdder.isResearchComplete.invoke(null,owner,research); + } catch (IllegalAccessException | InvocationTargetException e) { + e.printStackTrace(); + } + if (!complete) + return false; + if (!tRecipe.isRecipeInputEqual(true,new FluidStack[0],tInputs)) + return false; + LinkedHashMap list = null; + LinkedHashMap needed = null; + try { + list = (LinkedHashMap) ThaumcraftHandler.AspectAdder.linkedAspektList.get(allAspects); + needed = (LinkedHashMap) ThaumcraftHandler.AspectAdder.linkedAspektList.get(aspectList); + } catch (IllegalAccessException e) { + e.printStackTrace(); + return false; + } + assert list != null; + assert needed != null; + for (Map.Entry toTake : needed.entrySet()){ + list.replace(toTake.getKey(),list.get(toTake.getKey())-toTake.getValue()); + } + this.addOutput(tRecipe.mOutputs[0]); + this.updateSlots(); + return true; + } + + @Override + public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return false; + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 0; + } + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_Industrial_Alchemic_Construct(mName); + } + + @Override + public String[] getDescription() { + return new String[0]; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + return new ITexture[0]; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Furnace.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Furnace.java deleted file mode 100644 index b8192f742e..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Furnace.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.emt.tileentities.multi; - -import com.github.bartimaeusnek.crossmod.emt.recipe.TCRecipeHandler; -import com.github.bartimaeusnek.crossmod.emt.util.EMTHandler; -import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.List; - -import static gregtech.api.enums.GT_Values.V; - -public class GT_Industrial_Alchemic_Furnace extends GT_MetaTileEntity_MultiBlockBase { - - List mEssentiaHatches = new ArrayList<>(); - - public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity.getClass().isInstance(EMTHandler.aEssentiaInputHatch)) - return this.addEssetiaHatchToList(aTileEntity, aBaseCasingIndex); - return super.addInputToMachineList(aTileEntity, aBaseCasingIndex); - } - - private boolean addEssetiaHatchToList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aTileEntity.getClass().isInstance(EMTHandler.aEssentiaInputHatch)) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEssentiaHatches.add(aMetaTileEntity); - } else { - return false; - } - } - } - - public GT_Industrial_Alchemic_Furnace(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public GT_Industrial_Alchemic_Furnace(String aName) { - super(aName); - } - - @Override - public boolean isCorrectMachinePart(ItemStack itemStack) { - return true; - } - - @Override - public boolean checkRecipe(ItemStack itemStack) { - ItemStack stack = new ItemStack(Items.feather); - try { - String owner = this.getBaseMetaTileEntity().getOwnerName(); - Object allAspects = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); - for (Object o : this.mEssentiaHatches) { - Object aspectList = EMTHandler.aAspectField.get(o); - ThaumcraftHandler.AspectAdder.add.invoke(allAspects,aspectList); - } - NBTTagCompound toWrite = (NBTTagCompound)ThaumcraftHandler.AspectAdder.writeAspectListToNBT.invoke(allAspects,new NBTTagCompound()); - stack.setTagCompound(toWrite); - } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) { - e.printStackTrace(); - return false; - } - ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - ArrayList outputItems = new ArrayList(); - - long tVoltage = this.getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = TCRecipeHandler.alchemicalConstructHandler.findRecipe(this.getBaseMetaTileEntity(),null,false, false, V[tTier], null, stack,tInputs); - - return false; - } - - @Override - public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return false; - } - - @Override - public int getMaxEfficiency(ItemStack itemStack) { - return 0; - } - - @Override - public int getPollutionPerTick(ItemStack itemStack) { - return 0; - } - - @Override - public int getDamageToComponent(ItemStack itemStack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack itemStack) { - return false; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_Industrial_Alchemic_Furnace(mName); - } - - @Override - public String[] getDescription() { - return new String[0]; - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { - return new ITexture[0]; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index b753f61a4c..353f656e4e 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -32,6 +32,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.biome.BiomeGenBase; +import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -95,6 +96,8 @@ public class ThaumcraftHandler { public static Method add; public static Method getAmount; public static Method getAspects; + public static Method isResearchComplete; + public static Field linkedAspektList; static { try { @@ -108,7 +111,9 @@ public class ThaumcraftHandler { ThaumcraftHandler.AspectAdder.getAmount = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("getAmount", ThaumcraftHandler.AspectAdder.mAspectClass); ThaumcraftHandler.AspectAdder.getAspects = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("getAspects"); ThaumcraftHandler.AspectAdder.readAspectListFromNBT = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("readFromNBT", NBTTagCompound.class); - } catch (ClassNotFoundException | NoSuchMethodException e) { + ThaumcraftHandler.AspectAdder.isResearchComplete = Class.forName("thaumcraft.common.lib.research.ResearchManager").getMethod("isResearchComplete",String.class,String.class); + ThaumcraftHandler.AspectAdder.linkedAspektList = ThaumcraftHandler.AspectAdder.mAspectListClass.getField("aspects"); + } catch (ClassNotFoundException | NoSuchMethodException | NoSuchFieldException e) { e.printStackTrace(); } } -- cgit From 509c8d741a7333df2bb64b218bf2baf55ae9370f Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 6 Sep 2019 10:15:09 +0200 Subject: fixed weird behavior of autogenerated recipes added Ruthenium, Iridium, Osmium and Rhodium chain Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: ea0d26a9cceed1004f6eb2c6c2f3779faabc0505 --- build.properties | 2 +- .../bartworks/system/material/WerkstoffLoader.java | 341 +++++++++++++++++++-- .../processingLoaders/PlatinumSludgeOverHaul.java | 188 +++++++++++- 3 files changed, 500 insertions(+), 31 deletions(-) diff --git a/build.properties b/build.properties index c905c6cecc..a86113eaf1 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre1 +buildNumber=2_pre2 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 269a258809..e4d744921f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -710,7 +710,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff AquaRegia = new Werkstoff( new short[]{0xff,0xb1,0x32}, - "AquaRegia", + "Aqua Regia", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().addCells(), @@ -721,7 +721,7 @@ public class WerkstoffLoader implements Runnable { new Pair<>(Materials.NitricAcid,1) ); public static final Werkstoff PTResidue = new Werkstoff( - Materials.Platinum.getRGBA(), + new short[]{0x64,0x63,0x2E}, "Platinum Residue", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -757,7 +757,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff PDAmmonia = new Werkstoff( Materials.Palladium.getRGBA(), - "Palladium enriched Ammonia", + "Palladium Enriched Ammonia", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().addCells(), @@ -805,7 +805,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff Sodiumformate = new Werkstoff( new short[]{0xff,0xaa,0xaa}, - "Sodium formate", + "Sodium Formate", "HCOONa", new Werkstoff.Stats(), Werkstoff.Types.COMPOUND, @@ -818,7 +818,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff Sodiumsulfate = new Werkstoff( new short[]{0xff,0xff,0xff}, - "Sodium sulfate", + "Sodium Sulfate", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust(), @@ -845,10 +845,10 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff PotassiumDisulfate = new Werkstoff( new short[]{0xfb,0xbb,0x66}, - "PotassiumDisulfate", + "Potassium Disulfate", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), + new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addChemicalRecipes(), 59, TextureSet.SET_DULL, //No Byproducts @@ -856,8 +856,8 @@ public class WerkstoffLoader implements Runnable { new Pair<>(Materials.Sulfur,2), new Pair<>(Materials.Oxygen,7) ); - public static final Werkstoff PHLESSResidue = new Werkstoff( - Materials.Platinum.getRGBA(), + public static final Werkstoff LeachResidue = new Werkstoff( + new short[]{0x64, 0x46, 0x29}, "Leach Residue", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -868,36 +868,306 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff RHSulfate = new Werkstoff( new short[]{0xee,0xaa,0x55}, - "Rh Sulfate", + "Rhodium Sulfate", new Werkstoff.Stats().setGas(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().addCells(), 61, - TextureSet.SET_ROUGH + TextureSet.SET_FLUID //No Byproducts ); public static final Werkstoff RHSulfateSolution = new Werkstoff( new short[]{0xff,0xbb,0x66}, - "Rh Sulfate Solution", + "Rhodium Sulfate Solution", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().addCells(), 62, - TextureSet.SET_ROUGH + TextureSet.SET_FLUID //No Byproducts ); public static final Werkstoff CalciumChloride = new Werkstoff( new short[]{0xff,0xff,0xff}, - "Calcium chloride", + "Calcium Chloride", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust(), + new Werkstoff.GenerationFeatures().disable().onlyDust().addCells(), 63, TextureSet.SET_DULL, new Pair<>(Materials.Calcium,1), new Pair<>(Materials.Chlorine,2) //No Byproducts ); + public static final Werkstoff Ruthenium = new Werkstoff( + new short[]{0x64,0x64,0x64}, + "Ruthenium", + "Ru", + new Werkstoff.Stats().setBlastFurnace(true).setMeltingPoint(2607).setMass(Element.Ru.getMass()).setProtons(Element.Ru.mProtons), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().onlyDust().addMolten().addMetalItems().enforceUnification(), + 64, + TextureSet.SET_METALLIC + //No Byproducts + ); + public static final Werkstoff SodiumRuthenate = new Werkstoff( + new short[]{0x3a,0x40,0xcb}, + "Sodium Ruthenate", + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 65, + TextureSet.SET_SHINY, + new Pair<>(Materials.Sodium,2), + new Pair<>(Ruthenium,1), + new Pair<>(Materials.Oxygen,3) + //No Byproducts + ); + public static final Werkstoff RutheniumTetroxide = new Werkstoff( + new short[]{0xc7,0xc7,0xc7}, + "Ruthenium Tetroxide", + new Werkstoff.Stats().setMeltingPoint(313), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust().addCells(), + 66, + TextureSet.SET_DULL, + new Pair<>(Ruthenium,1), + new Pair<>(Materials.Oxygen,4) + //No Byproducts + ); + public static final Werkstoff HotRutheniumTetroxideSollution= new Werkstoff( + new short[]{0xc7,0xc7,0xc7}, + "Hot Ruthenium Tetroxide Sollution", + "???", + new Werkstoff.Stats().setGas(true).setMeltingPoint(700), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + 67, + TextureSet.SET_FLUID, + new Pair<>(Ruthenium,1), + new Pair<>(Materials.Oxygen,4), + new Pair<>(Materials.Chlorine,2), + new Pair<>(Materials.Sodium,2), + new Pair<>(Materials.Water,2) + //No Byproducts + ); + public static final Werkstoff RutheniumTetroxideSollution = new Werkstoff( + new short[]{0xc7,0xc7,0xc7}, + "Ruthenium Tetroxide Sollution", + "???", + new Werkstoff.Stats().setMeltingPoint(313), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + 68, + TextureSet.SET_FLUID, + new Pair<>(Ruthenium,1), + new Pair<>(Materials.Oxygen,4), + new Pair<>(Materials.Chlorine,2), + new Pair<>(Materials.Sodium,2), + new Pair<>(Materials.Water,2) + //No Byproducts + ); + public static final Werkstoff IrOsLeachResidue = new Werkstoff( + new short[]{0x64, 0x46, 0x29}, + "Rarest Metal Residue", + "???", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 69, + TextureSet.SET_ROUGH + //No Byproducts + ); + public static final Werkstoff IrLeachResidue = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Iridium Metal Residue", + "???", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 70, + TextureSet.SET_ROUGH + //No Byproducts + ); + public static final Werkstoff PGSDResidue = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Sludge Dust Residue", + new Werkstoff.Stats().setCentrifuge(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 71, + TextureSet.SET_DULL, + new Pair<>(Materials.SiliconDioxide,3), + new Pair<>(Materials.Gold,2) + ); + public static final Werkstoff AcidicOsmiumSolution = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Acidic Osmium Solution", + "???", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 72, + TextureSet.SET_FLUID, + new Pair<>(Materials.Osmium,1), + new Pair<>(Materials.HydrochloricAcid,1) + ); + public static final Werkstoff IridiumDioxide = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Iridium Dioxide", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 73, + TextureSet.SET_FLUID, + new Pair<>(Materials.Iridium,1), + new Pair<>(Materials.Oxygen,2) + ); + public static final Werkstoff OsmiumSolution = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Osmium Solution", + "???", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 74, + TextureSet.SET_FLUID, + new Pair<>(Materials.Osmium,1), + new Pair<>(Materials.Hydrogen,1) + ); + public static final Werkstoff AcidicIridiumSolution = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Acidic Iridium Solution", + "???", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 75, + TextureSet.SET_FLUID, + new Pair<>(Materials.Iridium,1), + new Pair<>(Materials.Hydrogen,1) + ); + public static final Werkstoff IridiumChloride = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Iridium Chloride", + subscriptNumbers("IrCl3"), + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 76, + TextureSet.SET_LAPIS, + new Pair<>(Materials.Iridium,1), + new Pair<>(Materials.Chlorine,3) + ); + public static final Werkstoff PGSDResidue2 = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Metallic Sludge Dust Residue", + new Werkstoff.Stats().setCentrifuge(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 77, + TextureSet.SET_DULL, + new Pair<>(Materials.Nickel,1), + new Pair<>(Materials.Copper,1) + ); + public static final Werkstoff Rhodium = new Werkstoff( + new short[]{0xF4, 0xF4, 0xF4}, + "Rhodium", + "Rh", + new Werkstoff.Stats().setProtons(Element.Rh.mProtons).setMass(Element.Rh.getMass()).setBlastFurnace(true).setMeltingPoint(2237), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten().enforceUnification(), + 78, + TextureSet.SET_METALLIC + ); + public static final Werkstoff CrudeRhMetall = new Werkstoff( + new short[]{0x66, 0x66, 0x66}, + "Crude Rhodium Metall", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 79, + TextureSet.SET_DULL + ); + public static final Werkstoff RHSalt = new Werkstoff( + new short[]{0x84, 0x84, 0x84}, + "Rhodium Salt", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 80, + TextureSet.SET_GEM_VERTICAL + ); + public static final Werkstoff RHSaltSolution = new Werkstoff( + new short[]{0x66, 0x77, 0x88}, + "Rhodium Salt Solution", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 81, + TextureSet.SET_FLUID + ); + public static final Werkstoff SodiumNitrate = new Werkstoff( + new short[]{0x84, 0x66, 0x84}, + "Sodium Nitrate", + subscriptNumbers("NaNO3"), + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), + 82, + TextureSet.SET_ROUGH, + new Pair<>(Materials.Sodium,1), + new Pair<>(Materials.NitricAcid,1) + ); + public static final Werkstoff RHNitrate = new Werkstoff( + new short[]{0x77, 0x66, 0x49}, + "Rhodium Nitrate", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 83, + TextureSet.SET_QUARTZ + ); + public static final Werkstoff ZincSulfate = new Werkstoff( + new short[]{0x84, 0x66, 0x49}, + "Zinc Sulfate", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 84, + TextureSet.SET_QUARTZ, + new Pair<>(Materials.Zinc,1), + new Pair<>(Materials.Sulfur,1), + new Pair<>(Materials.Oxygen,4) + ); + public static final Werkstoff RhFilterCake = new Werkstoff( + new short[]{0x77, 0x66, 0x49}, + "Rhodium Filter Cake", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 85, + TextureSet.SET_QUARTZ + ); + public static final Werkstoff RHFilterCakeSolution = new Werkstoff( + new short[]{0x66, 0x77, 0x88}, + "Rhodium Filter Cake Solution", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 86, + TextureSet.SET_FLUID + ); + public static final Werkstoff ReRh = new Werkstoff( + new short[]{0x77, 0x66, 0x49}, + "Reprecipated Rhodium", + "RERh", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 87, + TextureSet.SET_QUARTZ + ); + public static HashMap items = new HashMap<>(); @@ -1119,8 +1389,20 @@ public class WerkstoffLoader implements Runnable { } public static void runGTItemDataRegistrator(){ + HashSet toRem = new HashSet<>(); for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - GT_OreDictUnificator.addAssociation(ore,Materials._NULL,new ItemStack(WerkstoffLoader.BWOres,1,werkstoff.getmID()),true); + Materials werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName(),werkstoff.getDefaultName()); + GT_OreDictUnificator.addAssociation(ore,werkstoffBridgeMaterial,new ItemStack(WerkstoffLoader.BWOres,1,werkstoff.getmID()),true); + toRem.add(werkstoffBridgeMaterial); + } + try { + Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); + f.setAccessible(true); + Map MATERIALS_MAP = (Map) f.get(null); + for (Materials o : toRem) + MATERIALS_MAP.remove(o.mName); + } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { + e.printStackTrace(); } } @@ -1296,18 +1578,18 @@ public class WerkstoffLoader implements Runnable { ItemStack input = werkstoff.get(dust); input.stackSize = werkstoff.getContents().getKey(); if (werkstoff.getStats().isElektrolysis()) - GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); + GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); if (werkstoff.getStats().isCentrifuge()) - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0); + GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0)); } if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sMixerRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0); + GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0)); } } @@ -1508,18 +1790,18 @@ public class WerkstoffLoader implements Runnable { input.stackSize = werkstoff.getContents().getKey(); stOutputs.add(Materials.Empty.getCells(cells)); if (werkstoff.getStats().isElektrolysis()) - GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); + GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); if (werkstoff.getStats().isCentrifuge()) - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0); + GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0)); } if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sMixerRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0); + GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0)); } } @@ -1529,6 +1811,11 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(fluids.get(werkstoff),1000), GT_Values.NF); GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(fluids.get(werkstoff),1000)); + if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0){ + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getFluidOrGas(1000),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + GT_Values.RA.addFluidSolidifierRecipe(GT_Utility.getIntegratedCircuit(1), werkstoff.getFluidOrGas(1000), werkstoff.get(dust), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + } + if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { Materials werkstoffBridgeMaterial = null; boolean ElementSet = false; @@ -1580,6 +1867,10 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - } + } else if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b10) == 0){ + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall),null,werkstoff.getMolten(36),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny),null,werkstoff.getMolten(16),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + } } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java index 67bf92e8de..3d1f916a91 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java @@ -23,14 +23,13 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; - import com.github.bartimaeusnek.bartworks.util.BW_Util; -import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.MaterialStack; +import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -38,6 +37,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraftforge.fluids.FluidStack; +import java.util.HashSet; import java.util.Map; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; @@ -56,6 +56,7 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addChemicalRecipe(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(11), Materials.HydrochloricAcid.getFluid(1000),null,AmmoniumCloride.get(cell,1),null,15); GT_Values.RA.addChemicalRecipe(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(11), Materials.Ammonia.getGas(1000),AmmoniumCloride.getFluidOrGas(1000),Materials.Empty.getCells(1),null,15); + //base sollution for (Werkstoff w :Werkstoff.werkstoffHashMap.values()) if (w.containsStuff(Materials.Sulfur)&&(w.containsStuff(Materials.Copper)||w.containsStuff(Materials.Nickel))) { GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(11), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); @@ -66,6 +67,7 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified,m,1), GT_Utility.getIntegratedCircuit(11), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified,m,1), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dust), 250); } + //Pt GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(11), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dust), 250); GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{},new FluidStack[]{PTConcentrate.getFluidOrGas(1000),AmmoniumCloride.getFluidOrGas(1000)},new FluidStack[]{PDAmmonia.getFluidOrGas(1000)},new ItemStack[]{PTSaltCrude.get(dustTiny,8),PTRawPowder.get(dustTiny)},600,30); GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust),new ItemStack[]{ @@ -83,6 +85,7 @@ public class PlatinumSludgeOverHaul { },600,30); GT_Values.RA.addBlastRecipe(PTSaltRefined.get(dust),null,null,null,PTMetallicPowder.get(dust),null,200,120,900); GT_Values.RA.addChemicalRecipe(PTRawPowder.get(dust,2),Materials.Calcium.getDust(1),null,null,Materials.Platinum.getDust(2),CalciumChloride.get(dust),30); + //Pd GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(11), PDAmmonia.getFluidOrGas(1000), null,PDSalt.get(dustTiny,16),PDRawPowder.get(dustTiny,2), 250); GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(10),null,PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dustTiny,9), 250); GT_Values.RA.addSifterRecipe(PDSalt.get(dust),new ItemStack[]{ @@ -98,9 +101,58 @@ public class PlatinumSludgeOverHaul { },new int[]{ 1000,1000,1000,1000,1000,1000,1000,1000,500, },600,30); - GT_Values.RA.addChemicalRecipe(PDRawPowder.get(dust,2), GT_Utility.getIntegratedCircuit(11), FormicAcid.getFluidOrGas(4000), Materials.Ammonium.getGas(2000),Materials.Palladium.getDust(2),Materials.Ethylene.getDust(1), 250); + GT_Values.RA.addChemicalRecipeForBasicMachineOnly(PDRawPowder.get(dust,2), Materials.Empty.getCells(1), FormicAcid.getFluidOrGas(4000), Materials.Ammonia.getGas(2000),Materials.Palladium.getDust(2),Materials.Ethylene.getCells(1), 250,30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{PDRawPowder.get(dust,2)},new FluidStack[]{FormicAcid.getFluidOrGas(4000)},new FluidStack[]{Materials.Ammonia.getGas(2000),Materials.Ethylene.getGas(1000),Materials.Water.getFluid(1000)},new ItemStack[]{Materials.Palladium.getDust(2)},250,30); + GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(cell,2),Materials.Hydrogen.getCells(1),null,Materials.SulfuricAcid.getFluid(2000),Materials.Sodium.getDust(1),Materials.Empty.getCells(3),30); + //K2S2O7 + GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(cell,1),Materials.Potassium.getDust(2),Materials.Oxygen.getGas(3000),null,PotassiumDisulfate.get(dust),Materials.Empty.getCells(1),30); + //Rh/Os/Ir/Ru + GT_Values.RA.addBlastRecipe(PTResidue.get(dust),GT_Utility.getIntegratedCircuit(11),PotassiumDisulfate.getMolten(1440),RHSulfate.getFluidOrGas(1440),LeachResidue.get(dust),null,200,120,775); + + //Ru + GT_Values.RA.addBlastRecipe(LeachResidue.get(dust),Materials.Saltpeter.getDust(8),Materials.SaltWater.getFluid(1000), GT_ModHandler.getSteam(1000),SodiumRuthenate.get(dust,3),IrOsLeachResidue.get(dust,6),200,120,775); + GT_Values.RA.addChemicalRecipe(SodiumRuthenate.get(dust,6),Materials.Chlorine.getCells(3),null,RutheniumTetroxideSollution.getFluidOrGas(9000),Materials.Empty.getCells(3),300); + GT_Values.RA.addFluidHeaterRecipe(null,RutheniumTetroxideSollution.getFluidOrGas(800),HotRutheniumTetroxideSollution.getFluidOrGas(800),600,480); + //int circuitConfig, FluidStack aInput, FluidStack aInput2, FluidStack aOutput, int aDuration, int aEUt + GT_Values.RA.addCrackingRecipe(17,RutheniumTetroxideSollution.getFluidOrGas(1000),null,HotRutheniumTetroxideSollution.getFluidOrGas(1000),150,480); + GT_Values.RA.addDistillationTowerRecipe(HotRutheniumTetroxideSollution.getFluidOrGas(9000),new FluidStack[]{ + Materials.Water.getFluid(1800), + RutheniumTetroxide.getFluidOrGas(7200) + },Materials.Salt.getDust(6),1500,480); + GT_Values.RA.addChemicalRecipe(RutheniumTetroxide.get(dust,1),Materials.HydrochloricAcid.getCells(8),null,Materials.Water.getFluid(2000),Ruthenium.get(dust),Materials.Chlorine.getCells(6),300); + //Os + GT_Values.RA.addBlastRecipe(IrOsLeachResidue.get(dust),GT_Utility.getIntegratedCircuit(11),Materials.HydrochloricAcid.getFluid(1000), AcidicOsmiumSolution.getFluidOrGas(1000), IrLeachResidue.get(dust),null,200,120,775); + GT_Values.RA.addDistillationTowerRecipe(AcidicOsmiumSolution.getFluidOrGas(1000),new FluidStack[]{OsmiumSolution.getFluidOrGas(100),Materials.Water.getFluid(900)},null,600,BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addChemicalRecipe(OsmiumSolution.get(cell),Materials.HydrochloricAcid.getCells(8),null,Materials.Water.getFluid(2000),Materials.Osmium.getDust(1),Materials.Chlorine.getCells(6),300); + //Ir + GT_Values.RA.addBlastRecipe(IrLeachResidue.get(dust),GT_Utility.getIntegratedCircuit(1),null, null,PGSDResidue.get(dust),IridiumDioxide.get(dust),200,120,775); + GT_Values.RA.addChemicalRecipe(IridiumDioxide.get(dust),Materials.HydrochloricAcid.getCells(1),null,AcidicIridiumSolution.getFluidOrGas(1000),Materials.Empty.getCells(1),null,300); + GT_Values.RA.addChemicalRecipe(AcidicIridiumSolution.get(cell),AmmoniumCloride.get(cell,3),null,Materials.Ammonia.getGas(3000),Materials.Empty.getCells(4),IridiumChloride.get(dust),300); + GT_Values.RA.addChemicalRecipe(IridiumChloride.get(dust),Materials.Calcium.getDust(3),null,CalciumChloride.getFluidOrGas(3000),PGSDResidue2.get(dust),Materials.Iridium.getDust(1),300,1920); + //Rh + GT_Values.RA.addMixerRecipe(RHSulfate.get(cell),null,null,null,Materials.Water.getFluid(1000),RHSulfateSolution.getFluidOrGas(1000),LeachResidue.get(dustSmall),300,30); + GT_Values.RA.addChemicalRecipe(Materials.Zinc.getDust(1),null,RHSulfateSolution.getFluidOrGas(1000),null,ZincSulfate.get(dust),CrudeRhMetall.get(dust),300); + GT_Values.RA.addBlastRecipe(CrudeRhMetall.get(dust),Materials.Salt.getDust(1),Materials.Chlorine.getGas(1000),null,RHSalt.get(dust,3),null,300,120,600); + GT_Values.RA.addMixerRecipe(RHSalt.get(dust),null,null,null,Materials.Water.getFluid(1000),RHSaltSolution.getFluidOrGas(1000),null,300,30); + GT_Values.RA.addChemicalRecipe(SodiumNitrate.get(dust),GT_Utility.getIntegratedCircuit(11),RHSaltSolution.getFluidOrGas(1000),null,RHNitrate.get(dust),Materials.Salt.getDust(1),300); + GT_Values.RA.addSifterRecipe(RHNitrate.get(dust),new ItemStack[]{ + RhFilterCake.get(dustTiny), + RhFilterCake.get(dustTiny), + RhFilterCake.get(dustTiny), + RhFilterCake.get(dustTiny), + RhFilterCake.get(dustTiny), + RhFilterCake.get(dustTiny), + RhFilterCake.get(dustTiny), + RhFilterCake.get(dustTiny), + RhFilterCake.get(dustTiny), + },new int[]{ + 1000,1000,1000,1000,1000,1000,1000,1000,500, + },600,30); + GT_Values.RA.addMixerRecipe(RhFilterCake.get(dust),null,null,null,Materials.Water.getFluid(1000),RHFilterCakeSolution.getFluidOrGas(1000),null,300,30); + GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(10),null,RHFilterCakeSolution.getFluidOrGas(1000),null,ReRh.get(dust),null,300); + GT_Values.RA.addChemicalRecipe(ReRh.get(dust),Materials.Empty.getCells(1),Materials.HydrochloricAcid.getFluid(1000),Materials.Chlorine.getGas(1000),Rhodium.get(dust),Materials.Ammonia.getCells(1),300); } @@ -127,13 +179,42 @@ public class PlatinumSludgeOverHaul { } maploop: for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - for (GT_Recipe recipe : map.mRecipeList) { + HashSet toDel = new HashSet(); + recipeloop: for (GT_Recipe recipe : map.mRecipeList) { if (recipe.mFakeRecipe) continue maploop; + for (int i = 0; i < recipe.mFluidOutputs.length; i++) { + if (map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes)) + continue maploop; + if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + } for (int i = 0; i < recipe.mOutputs.length; i++) { + if (!GT_Utility.isStackValid(recipe.mOutputs[i])) + continue; + if (BW_Util.areStacksEqualOrNull(Ruthenium.get(dust), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustImpure), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustPure), recipe.mOutputs[i])) { + if (!BW_Util.areStacksEqualOrNull(Ruthenium.get(ingot), recipe.mInputs[0])) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = LeachResidue.get(dust, amount); + } + } + if (BW_Util.areStacksEqualOrNull(Rhodium.get(dust), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Rhodium.get(dustImpure), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Rhodium.get(dustPure), recipe.mOutputs[i])) { + if (!BW_Util.areStacksEqualOrNull(Rhodium.get(ingot), recipe.mInputs[0])) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = CrudeRhMetall.get(dust, amount); + } + } if (!BW_Util.checkStackAndPrefix(recipe.mOutputs[i])) continue; + //Pt if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Platinum)) { + for (int j = 0; j < recipe.mInputs.length; j++) { + if (BW_Util.checkStackAndPrefix(recipe.mInputs[j])) + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + } if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 11); @@ -148,6 +229,11 @@ public class PlatinumSludgeOverHaul { recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount); } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Palladium)) { + for (int j = 0; j < recipe.mInputs.length; j++) { + if (BW_Util.checkStackAndPrefix(recipe.mInputs[j])) + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + } if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = PDMetallicPowder.get(dustTiny).splitStack(amount * 11); @@ -161,11 +247,103 @@ public class PlatinumSludgeOverHaul { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = PDMetallicPowder.get(dustTiny).splitStack(amount); } + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Osmium)) { + for (int j = 0; j < recipe.mInputs.length; j++) { + if (BW_Util.checkStackAndPrefix(recipe.mInputs[j])) + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + } + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount * 22); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrOsLeachResidue.get(dust).splitStack(amount * 2); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrOsLeachResidue.get(dustSmall).splitStack(amount * 2); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount * 2); + } + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Iridium)) { + for (int j = 0; j < recipe.mInputs.length; j++) { + if (BW_Util.checkStackAndPrefix(recipe.mInputs[j])) + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + } + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount * 11); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrOsLeachResidue.get(dust).splitStack(amount); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrOsLeachResidue.get(dustSmall).splitStack(amount); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount); + } } } } + map.mRecipeList.removeAll(toDel); } PlatinumSludgeOverHaul.runHelperrecipes(); } - + + private static final OrePrefixes[] OPWHITELIST = { + dust, + dustTiny, + dustSmall, + dustPure, + dustImpure, + dustRefined, + crateGtDust, + ore, + oreBasalt, + oreBlackgranite, + oreDense, + oreEnd, + oreEndstone, + oreMarble, + oreNether, + oreNetherrack, + oreNormal, + orePoor, + oreRedgranite, + oreRich, + oreSmall, + oreGem, + denseore, + crushed, + crushedPurified, + crushedCentrifuged, + gem, + gemFlawed, + gemExquisite, + gemFlawless, + gemChipped, + crateGtGem, + }; + + private static final Materials[] BLACKLIST = { + Materials.HSSS, + Materials.EnderiumBase, + Materials.Osmiridium, + Materials.get("Uraniumtriplatinid"), + Materials.get("Tetranaquadahdiindiumhexaplatiumosminid"), + Materials.get("Longasssuperconductornameforuvwire"), + }; + + private static boolean isInBlackList(ItemStack stack){ + if (!BW_Util.checkStackAndPrefix(stack)) + return false; + for (Materials m : PlatinumSludgeOverHaul.BLACKLIST){ + if (GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial.equals(m)) + return true; + } + return false; + } } \ No newline at end of file -- cgit From c6b938f6c98156b1b452032a98cf1214c3656a17 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 7 Sep 2019 00:20:03 +0200 Subject: recipe changes +added fluid container registration for LCR +fixed boxinator(packager) recipes +rebalanced PGSD Overhaul v1 +fixed typos +added HotIngots +started on own logic system for oreprefixes Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: a1fb14768be881f1fa6324bf66a685f32bd14803 --- build.properties | 2 +- .../system/material/BW_MetaGeneratedFrames.java | 125 ++++++++++++++++ .../bartworks/system/material/Werkstoff.java | 40 ++++- .../bartworks/system/material/WerkstoffLoader.java | 89 +++++++++-- .../processingLoaders/PlatinumSludgeOverHaul.java | 162 +++++++++++---------- 5 files changed, 325 insertions(+), 93 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java diff --git a/build.properties b/build.properties index a86113eaf1..b9eb909cee 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre2 +buildNumber=2_pre3 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java new file mode 100644 index 0000000000..f82dcc2307 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import gregtech.api.enums.*; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaPipeEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_ModHandler.RecipeBits; +import gregtech.api.util.GT_OreDictUnificator; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import static gregtech.api.enums.GT_Values.RA; + +public class BW_MetaGeneratedFrames extends MetaPipeEntity { + + public final Werkstoff mMaterial; + + public BW_MetaGeneratedFrames(int aID, String aName, String aNameRegional, Werkstoff aMaterial) { + super(aID, aName, aNameRegional, 0); + mMaterial = aMaterial; + + GT_OreDictUnificator.registerOre(OrePrefixes.frameGt, aMaterial, getStackForm(1)); + GT_ModHandler.addCraftingRecipe(getStackForm(2), RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SSS", "SwS", "SSS", 'S', OrePrefixes.stick.get(mMaterial)}); + RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 4), ItemList.Circuit_Integrated.getWithDamage(0, 4), getStackForm(1), 64, 8); + } + + public BW_MetaGeneratedFrames(String aName, Werkstoff aMaterial) { + super(aName, 0); + mMaterial = aMaterial; + } + + @Override + public byte getTileEntityBaseType() { + return 4; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new BW_MetaGeneratedFrames(this.mName, this.mMaterial); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { + return new ITexture[]{new GT_RenderedTexture(this.mMaterial.getTexSet().mTextures[OrePrefixes.frameGt.mTextureIndex], Dyes.getModulation(aColorIndex, this.mMaterial.getRGBA()))}; + } + + @Override + public String[] getDescription() { + return new String[]{"Just something you can put a Cover or CFoam on."}; + } + + @Override + public final boolean isSimpleMachine() { + return true; + } + + @Override + public final boolean isFacingValid(byte aFacing) { + return false; + } + + @Override + public final boolean isValidSlot(int aIndex) { + return false; + } + + @Override + public final boolean renderInside(byte aSide) { + return true; + } + + @Override + public final float getThickNess() { + return 1.0F; + } + + @Override + public final void saveNBTData(NBTTagCompound aNBT) {/*Do nothing*/} + + @Override + public final void loadNBTData(NBTTagCompound aNBT) {/*Do nothing*/} + + @Override + public final boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public final boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + public int connect(byte aSide) { + return 0; + } + + public void disconnect(byte aSide) { + /* Do nothing*/ + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 0f0d9d3c5e..83aeae3afc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -346,14 +346,48 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { //logic gate shit /* dust 1 - metal 10 + metal 10 (ingot, nugget) gem 100 ore 1000 cell 10000 plasma 100000 molten 1000000 + crafting metal 10000000 (sticks, plates) + meta crafting metal 100000000 (gears, screws, bolts, springs) + multiple ingotWorth stuff 1000000000 (double, triple, quadrupe, ingot/plates) */ - public byte toGenerate = 0b0001001; + public short toGenerate = 0b0001001; + public static final HashMap prefixLogic = new HashMap<>(); + + static { + for (OrePrefixes p : OrePrefixes.values()){ + Werkstoff.GenerationFeatures.prefixLogic.put(p,0); + } + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dust,1); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustTiny,1); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustSmall,1); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingot,10); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotHot,10); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.nugget,10); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gem,100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawed,100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemExquisite,100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemChipped,100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawless,100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ore,1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustImpure,1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustPure,1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushed,1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedPurified,1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedCentrifuged,1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.cell,10000); + Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten,1000000); + Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten,1000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plate,10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stick,10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rod,10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stickLong,10000000); + } //public byte toGenerateSecondary = 0b0000000; public byte blacklist; @@ -364,6 +398,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { * Auto add Chemical Recipes 1 * Auto add mixer Recipes 10 * Auto add Sifter Recipe 100 + * Auto add MetalWorking(sticks, plates) Recipe 1000 + * Auto add MetalWorking(crafting components) Recipe 10000 */ public byte extraRecipes; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index e4d744921f..26f4783a0f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -662,7 +662,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff PTConcentrate = new Werkstoff( Materials.Platinum.getRGBA(), - "Platin Concentrate", + "Platinum Concentrate", "", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -674,7 +674,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff PTSaltCrude = new Werkstoff( Materials.Platinum.getRGBA(), - "Platin Salt", + "Platinum Salt", "", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -686,7 +686,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff PTSaltRefined = new Werkstoff( Materials.Platinum.getRGBA(), - "Refined Platin Salt", + "Refined Platinum Salt", "", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -698,7 +698,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff PTMetallicPowder = new Werkstoff( Materials.Platinum.getRGBA(), - "Platin Metallic Powder", + "Platinum Metallic Powder", "", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -730,9 +730,9 @@ public class WerkstoffLoader implements Runnable { TextureSet.SET_ROUGH //No Byproducts ); - public static final Werkstoff AmmoniumCloride = new Werkstoff( + public static final Werkstoff AmmoniumChloride = new Werkstoff( new short[]{0xff,0xff,0xff}, - "Ammonium Cloride", + "Ammonium Chloride", subscriptNumbers("NH4Cl"), new Werkstoff.Stats(), Werkstoff.Types.COMPOUND, @@ -745,7 +745,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff PTRawPowder = new Werkstoff( Materials.Platinum.getRGBA(), - "Reprecipated Platin", + "Reprecipated Platinum", "PtCl", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -936,7 +936,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff HotRutheniumTetroxideSollution= new Werkstoff( new short[]{0xc7,0xc7,0xc7}, - "Hot Ruthenium Tetroxide Sollution", + "Hot Ruthenium Tetroxide Solution", "???", new Werkstoff.Stats().setGas(true).setMeltingPoint(700), Werkstoff.Types.COMPOUND, @@ -952,7 +952,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff RutheniumTetroxideSollution = new Werkstoff( new short[]{0xc7,0xc7,0xc7}, - "Ruthenium Tetroxide Sollution", + "Ruthenium Tetroxide Solution", "???", new Werkstoff.Stats().setMeltingPoint(313), Werkstoff.Types.COMPOUND, @@ -1081,7 +1081,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff CrudeRhMetall = new Werkstoff( new short[]{0x66, 0x66, 0x66}, - "Crude Rhodium Metall", + "Crude Rhodium Metal", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().onlyDust(), @@ -1160,14 +1160,24 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff ReRh = new Werkstoff( new short[]{0x77, 0x66, 0x49}, "Reprecipated Rhodium", - "RERh", + subscriptNumbers("Rh2NH4"), new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().onlyDust(), 87, TextureSet.SET_QUARTZ ); - + public static final Werkstoff LuVTierMaterial = new Werkstoff( + new short[]{0xff, 0xee, 0xee}, + "Rhodium-Plated Palladium", + new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMixerRecipes(), + 88, + TextureSet.SET_METALLIC, + new Pair<>(Materials.Palladium,3), + new Pair<>(WerkstoffLoader.Rhodium,1) + ); public static HashMap items = new HashMap<>(); @@ -1345,7 +1355,30 @@ public class WerkstoffLoader implements Runnable { } if ((WerkstoffLoader.toGenerateGlobal & 0b10) != 0) { WerkstoffLoader.items.put(ingot, new BW_MetaGenerated_Items(ingot)); + WerkstoffLoader.items.put(ingotHot, new BW_MetaGenerated_Items(ingotHot)); //1750 WerkstoffLoader.items.put(nugget, new BW_MetaGenerated_Items(nugget)); + +// WerkstoffLoader.items.put(plate, new BW_MetaGenerated_Items(plate)); +// WerkstoffLoader.items.put(rod, new BW_MetaGenerated_Items(rod)); +// WerkstoffLoader.items.put(stickLong, new BW_MetaGenerated_Items(stickLong)); +// +// WerkstoffLoader.items.put(gearGt, new BW_MetaGenerated_Items(gearGt)); +// WerkstoffLoader.items.put(gearGtSmall, new BW_MetaGenerated_Items(gearGtSmall)); +// WerkstoffLoader.items.put(bolt, new BW_MetaGenerated_Items(bolt)); +// WerkstoffLoader.items.put(screw, new BW_MetaGenerated_Items(screw)); +// WerkstoffLoader.items.put(ring, new BW_MetaGenerated_Items(ring)); +// WerkstoffLoader.items.put(spring, new BW_MetaGenerated_Items(spring)); +// WerkstoffLoader.items.put(springSmall, new BW_MetaGenerated_Items(springSmall)); +// +// WerkstoffLoader.items.put(plateDouble, new BW_MetaGenerated_Items(plateDouble)); +// WerkstoffLoader.items.put(plateTriple, new BW_MetaGenerated_Items(plateTriple)); +// WerkstoffLoader.items.put(plateQuadruple, new BW_MetaGenerated_Items(plateQuadruple)); +// WerkstoffLoader.items.put(plateQuintuple, new BW_MetaGenerated_Items(plateQuintuple)); +// WerkstoffLoader.items.put(plateDense, new BW_MetaGenerated_Items(plateDense)); +// WerkstoffLoader.items.put(ingotDouble, new BW_MetaGenerated_Items(ingotDouble)); +// WerkstoffLoader.items.put(ingotTriple, new BW_MetaGenerated_Items(ingotTriple)); +// WerkstoffLoader.items.put(ingotQuadruple, new BW_MetaGenerated_Items(ingotQuadruple)); +// WerkstoffLoader.items.put(ingotQuintuple, new BW_MetaGenerated_Items(ingotQuintuple)); } if ((WerkstoffLoader.toGenerateGlobal & 0b100) != 0) { WerkstoffLoader.items.put(gem, new BW_MetaGenerated_Items(gem)); @@ -1393,6 +1426,21 @@ public class WerkstoffLoader implements Runnable { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { Materials werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName(),werkstoff.getDefaultName()); GT_OreDictUnificator.addAssociation(ore,werkstoffBridgeMaterial,new ItemStack(WerkstoffLoader.BWOres,1,werkstoff.getmID()),true); + for (OrePrefixes prefixes : values()) { + if (werkstoff.get(prefixes) != null && werkstoff.get(prefixes).getItem() != null) + GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, werkstoff.get(prefixes), true); + } + if (werkstoff.getGenerationFeatures().hasCells()) { + werkstoffBridgeMaterial.setHasCorrespondingFluid(true); + werkstoffBridgeMaterial.setHasCorrespondingGas(true); + werkstoffBridgeMaterial.mFluid = werkstoff.getFluidOrGas(1).getFluid(); + werkstoffBridgeMaterial.mGas = werkstoff.getFluidOrGas(1).getFluid(); + + } + if (werkstoff.getGenerationFeatures().hasMolten()) { + werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid(); + + } toRem.add(werkstoffBridgeMaterial); } try { @@ -1608,22 +1656,32 @@ public class WerkstoffLoader implements Runnable { "T ", 'T', werkstoff.get(dust) }); + GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny,9), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall,4), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny,9), ItemList.Schematic_3by3.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall,4), ItemList.Schematic_2by2.get(0L), werkstoff.get(dust), 100, 4); + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 && !werkstoff.getStats().isBlastFurnace()) { GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustTiny), werkstoff.get(nugget)); } else if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 && werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().meltingPoint != 0){ if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)){ - GT_Values.RA.addBlastRecipe(werkstoff.get(dust),GT_Utility.getIntegratedCircuit(11),Materials.Nitrogen.getGas(1000),null,werkstoff.get(ingot),null,(int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.addBlastRecipe(werkstoff.get(dust),GT_Utility.getIntegratedCircuit(11),Materials.Nitrogen.getGas(1000),null,werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot),null,(int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); } else { - GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, werkstoff.get(ingot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); if (werkstoff.getStats().meltingPoint <= 1000) { GT_Values.RA.addPrimitiveBlastRecipe(werkstoff.get(dust), null, 9, werkstoff.get(ingot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint); GT_ModHandler.addRCBlastFurnaceRecipe(werkstoff.get(ingot), werkstoff.get(dust), werkstoff.getStats().meltingPoint); } } } + + if (werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().meltingPoint > 1750){ + GT_Values.RA.addVacuumFreezerRecipe(werkstoff.get(ingotHot),werkstoff.get(ingot),(int) Math.max(werkstoff.getStats().mass * 3L, 1L)); + } + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0){ GT_ModHandler.addPulverisationRecipe(werkstoff.get(ingot),werkstoff.get(dust)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(nugget),werkstoff.get(dustTiny)); @@ -1807,7 +1865,7 @@ public class WerkstoffLoader implements Runnable { //Tank "Recipe" GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(WerkstoffLoader.fluids.get(werkstoff), 1000),werkstoff.get(cell),Materials.Empty.getCells(1))); - + FluidContainerRegistry.registerFluidContainer(werkstoff.getFluidOrGas(1).getFluid(),werkstoff.get(cell),Materials.Empty.getCells(1)); GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(fluids.get(werkstoff),1000), GT_Values.NF); GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(fluids.get(werkstoff),1000)); @@ -1853,6 +1911,7 @@ public class WerkstoffLoader implements Runnable { //Tank "Recipe" FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(WerkstoffLoader.molten.get(werkstoff), 144),werkstoff.get(cellMolten),Materials.Empty.getCells(1)); + FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144),werkstoff.get(cell),Materials.Empty.getCells(1)); GT_Utility.addFluidContainerData(data); GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cellMolten), new FluidStack(molten.get(werkstoff),144), GT_Values.NF); GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(molten.get(werkstoff),144)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java index 3d1f916a91..b590615154 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; +import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; @@ -47,74 +49,77 @@ public class PlatinumSludgeOverHaul { private PlatinumSludgeOverHaul(){} public static void runHelperrecipes(){ + //DilutedSulfuricAcid + GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(3),Materials.Water.getCells(1),GT_Utility.getIntegratedCircuit(1),null,null,null, Materials.DilutedSulfuricAcid.getCells(4),30,30); + //FormicAcid - GT_Values.RA.addChemicalRecipe(Sodiumformate.get(cell,2), GT_Utility.getIntegratedCircuit(21), Materials.SulfuricAcid.getFluid(1000),null,FormicAcid.get(cell,2),Sodiumsulfate.get(dust),15); - GT_Values.RA.addChemicalRecipe(Materials.SulfuricAcid.getCells(2), GT_Utility.getIntegratedCircuit(21), Sodiumformate.getFluidOrGas(1000),FormicAcid.getFluidOrGas(2000),Materials.Empty.getCells(2),Sodiumsulfate.get(dust),15); + GT_Values.RA.addChemicalRecipe(Sodiumformate.get(cell,2), GT_Utility.getIntegratedCircuit(1), Materials.SulfuricAcid.getFluid(1000),null,FormicAcid.get(cell,2),Sodiumsulfate.get(dust),15); + GT_Values.RA.addChemicalRecipe(Materials.SulfuricAcid.getCells(2), GT_Utility.getIntegratedCircuit(1), Sodiumformate.getFluidOrGas(1000),FormicAcid.getFluidOrGas(2000),Materials.Empty.getCells(2),Sodiumsulfate.get(dust),15); //AquaRegia GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1),Materials.NitricAcid.getCells(1),GT_Utility.getIntegratedCircuit(1),null,null,null, AquaRegia.get(cell,2),30,30); //AmmoniumCloride - GT_Values.RA.addChemicalRecipe(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(11), Materials.HydrochloricAcid.getFluid(1000),null,AmmoniumCloride.get(cell,1),null,15); - GT_Values.RA.addChemicalRecipe(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(11), Materials.Ammonia.getGas(1000),AmmoniumCloride.getFluidOrGas(1000),Materials.Empty.getCells(1),null,15); + GT_Values.RA.addChemicalRecipe(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.HydrochloricAcid.getFluid(1000),null, AmmoniumChloride.get(cell,1),null,15); + GT_Values.RA.addChemicalRecipe(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), AmmoniumChloride.getFluidOrGas(1000),Materials.Empty.getCells(1),null,15); //base sollution for (Werkstoff w :Werkstoff.werkstoffHashMap.values()) if (w.containsStuff(Materials.Sulfur)&&(w.containsStuff(Materials.Copper)||w.containsStuff(Materials.Nickel))) { - GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(11), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); - GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dust), 250); + GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); + GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny), 250); } for (Materials m : Materials.values()) if (materialsContains(m,Materials.Sulfur)&&(materialsContains(m,Materials.Copper)||materialsContains(m,Materials.Nickel))){ - GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified,m,1), GT_Utility.getIntegratedCircuit(11), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); - GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified,m,1), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dust), 250); + GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified,m,1), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); + GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified,m,1), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny), 250); } //Pt - GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(11), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dust), 250); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{},new FluidStack[]{PTConcentrate.getFluidOrGas(1000),AmmoniumCloride.getFluidOrGas(1000)},new FluidStack[]{PDAmmonia.getFluidOrGas(1000)},new ItemStack[]{PTSaltCrude.get(dustTiny,8),PTRawPowder.get(dustTiny)},600,30); + GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{},new FluidStack[]{PTConcentrate.getFluidOrGas(1000), AmmoniumChloride.getFluidOrGas(1000)},new FluidStack[]{PDAmmonia.getFluidOrGas(100),Materials.Ammonia.getGas(900)},new ItemStack[]{PTSaltCrude.get(dustTiny,8),PTRawPowder.get(dustTiny)},600,30); GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust),new ItemStack[]{ - PTSaltRefined.get(dustTiny), - PTSaltRefined.get(dustTiny), - PTSaltRefined.get(dustTiny), - PTSaltRefined.get(dustTiny), - PTSaltRefined.get(dustTiny), - PTSaltRefined.get(dustTiny), - PTSaltRefined.get(dustTiny), - PTSaltRefined.get(dustTiny), - PTSaltRefined.get(dustTiny), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), },new int[]{ 1000,1000,1000,1000,1000,1000,1000,1000,500, },600,30); - GT_Values.RA.addBlastRecipe(PTSaltRefined.get(dust),null,null,null,PTMetallicPowder.get(dust),null,200,120,900); + GT_Values.RA.addBlastRecipe(PTSaltRefined.get(dust),GT_Utility.getIntegratedCircuit(1),null,null,PTMetallicPowder.get(dust),null,200,120,900); GT_Values.RA.addChemicalRecipe(PTRawPowder.get(dust,2),Materials.Calcium.getDust(1),null,null,Materials.Platinum.getDust(2),CalciumChloride.get(dust),30); //Pd - GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(11), PDAmmonia.getFluidOrGas(1000), null,PDSalt.get(dustTiny,16),PDRawPowder.get(dustTiny,2), 250); - GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(10),null,PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dustTiny,9), 250); + GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust),GT_Utility.getIntegratedCircuit(1),Materials.Ammonia.getGas(1000), PDAmmonia.getFluidOrGas(1000), null, 250); + GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), PDAmmonia.getFluidOrGas(1000), null,PDSalt.get(dustTiny,16),PDRawPowder.get(dustTiny,2), 250); + GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2),null,PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dustTiny,9), 250); GT_Values.RA.addSifterRecipe(PDSalt.get(dust),new ItemStack[]{ - PDMetallicPowder.get(dustTiny), - PDMetallicPowder.get(dustTiny), - PDMetallicPowder.get(dustTiny), - PDMetallicPowder.get(dustTiny), - PDMetallicPowder.get(dustTiny), - PDMetallicPowder.get(dustTiny), - PDMetallicPowder.get(dustTiny), - PDMetallicPowder.get(dustTiny), - PDMetallicPowder.get(dustTiny), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), },new int[]{ 1000,1000,1000,1000,1000,1000,1000,1000,500, },600,30); GT_Values.RA.addChemicalRecipeForBasicMachineOnly(PDRawPowder.get(dust,2), Materials.Empty.getCells(1), FormicAcid.getFluidOrGas(4000), Materials.Ammonia.getGas(2000),Materials.Palladium.getDust(2),Materials.Ethylene.getCells(1), 250,30); GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{PDRawPowder.get(dust,2)},new FluidStack[]{FormicAcid.getFluidOrGas(4000)},new FluidStack[]{Materials.Ammonia.getGas(2000),Materials.Ethylene.getGas(1000),Materials.Water.getFluid(1000)},new ItemStack[]{Materials.Palladium.getDust(2)},250,30); - GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(cell,2),Materials.Hydrogen.getCells(1),null,Materials.SulfuricAcid.getFluid(2000),Materials.Sodium.getDust(1),Materials.Empty.getCells(3),30); + GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust,2),Materials.Hydrogen.getCells(1),null,Materials.SulfuricAcid.getFluid(2000),Materials.Sodium.getDust(1),Materials.Empty.getCells(3),30); //K2S2O7 - GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(cell,1),Materials.Potassium.getDust(2),Materials.Oxygen.getGas(3000),null,PotassiumDisulfate.get(dust),Materials.Empty.getCells(1),30); + GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust),Materials.Potassium.getDust(2),Materials.Oxygen.getGas(3000),null,PotassiumDisulfate.get(dust),Materials.Empty.getCells(1),30); //Rh/Os/Ir/Ru GT_Values.RA.addBlastRecipe(PTResidue.get(dust),GT_Utility.getIntegratedCircuit(11),PotassiumDisulfate.getMolten(1440),RHSulfate.getFluidOrGas(1440),LeachResidue.get(dust),null,200,120,775); //Ru - GT_Values.RA.addBlastRecipe(LeachResidue.get(dust),Materials.Saltpeter.getDust(8),Materials.SaltWater.getFluid(1000), GT_ModHandler.getSteam(1000),SodiumRuthenate.get(dust,3),IrOsLeachResidue.get(dust,6),200,120,775); + GT_Values.RA.addBlastRecipe(LeachResidue.get(dust,10),Materials.Saltpeter.getDust(10),Materials.SaltWater.getFluid(1000), GT_ModHandler.getSteam(1000),SodiumRuthenate.get(dust,3),IrOsLeachResidue.get(dust,6),200,120,775); GT_Values.RA.addChemicalRecipe(SodiumRuthenate.get(dust,6),Materials.Chlorine.getCells(3),null,RutheniumTetroxideSollution.getFluidOrGas(9000),Materials.Empty.getCells(3),300); - GT_Values.RA.addFluidHeaterRecipe(null,RutheniumTetroxideSollution.getFluidOrGas(800),HotRutheniumTetroxideSollution.getFluidOrGas(800),600,480); - //int circuitConfig, FluidStack aInput, FluidStack aInput2, FluidStack aOutput, int aDuration, int aEUt - GT_Values.RA.addCrackingRecipe(17,RutheniumTetroxideSollution.getFluidOrGas(1000),null,HotRutheniumTetroxideSollution.getFluidOrGas(1000),150,480); + GT_Values.RA.addFluidHeaterRecipe(null,RutheniumTetroxideSollution.getFluidOrGas(800),HotRutheniumTetroxideSollution.getFluidOrGas(1600),300,480); + GT_Values.RA.addCrackingRecipe(17,RutheniumTetroxideSollution.getFluidOrGas(1000),null,HotRutheniumTetroxideSollution.getFluidOrGas(2000),150,480); GT_Values.RA.addDistillationTowerRecipe(HotRutheniumTetroxideSollution.getFluidOrGas(9000),new FluidStack[]{ Materials.Water.getFluid(1800), RutheniumTetroxide.getFluidOrGas(7200) @@ -122,36 +127,37 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addChemicalRecipe(RutheniumTetroxide.get(dust,1),Materials.HydrochloricAcid.getCells(8),null,Materials.Water.getFluid(2000),Ruthenium.get(dust),Materials.Chlorine.getCells(6),300); //Os - GT_Values.RA.addBlastRecipe(IrOsLeachResidue.get(dust),GT_Utility.getIntegratedCircuit(11),Materials.HydrochloricAcid.getFluid(1000), AcidicOsmiumSolution.getFluidOrGas(1000), IrLeachResidue.get(dust),null,200,120,775); - GT_Values.RA.addDistillationTowerRecipe(AcidicOsmiumSolution.getFluidOrGas(1000),new FluidStack[]{OsmiumSolution.getFluidOrGas(100),Materials.Water.getFluid(900)},null,600,BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addBlastRecipe(IrOsLeachResidue.get(dust,4),GT_Utility.getIntegratedCircuit(11),Materials.HydrochloricAcid.getFluid(1000), AcidicOsmiumSolution.getFluidOrGas(2000), IrLeachResidue.get(dust,2),null,200,120,775); + GT_Values.RA.addDistillationTowerRecipe(AcidicOsmiumSolution.getFluidOrGas(1000),new FluidStack[]{OsmiumSolution.getFluidOrGas(100),Materials.Water.getFluid(900)},null,150,BW_Util.getMachineVoltageFromTier(5)); GT_Values.RA.addChemicalRecipe(OsmiumSolution.get(cell),Materials.HydrochloricAcid.getCells(8),null,Materials.Water.getFluid(2000),Materials.Osmium.getDust(1),Materials.Chlorine.getCells(6),300); //Ir GT_Values.RA.addBlastRecipe(IrLeachResidue.get(dust),GT_Utility.getIntegratedCircuit(1),null, null,PGSDResidue.get(dust),IridiumDioxide.get(dust),200,120,775); GT_Values.RA.addChemicalRecipe(IridiumDioxide.get(dust),Materials.HydrochloricAcid.getCells(1),null,AcidicIridiumSolution.getFluidOrGas(1000),Materials.Empty.getCells(1),null,300); - GT_Values.RA.addChemicalRecipe(AcidicIridiumSolution.get(cell),AmmoniumCloride.get(cell,3),null,Materials.Ammonia.getGas(3000),Materials.Empty.getCells(4),IridiumChloride.get(dust),300); + GT_Values.RA.addChemicalRecipe(AcidicIridiumSolution.get(cell), AmmoniumChloride.get(cell,3),null,Materials.Ammonia.getGas(3000),Materials.Empty.getCells(4),IridiumChloride.get(dust),300); GT_Values.RA.addChemicalRecipe(IridiumChloride.get(dust),Materials.Calcium.getDust(3),null,CalciumChloride.getFluidOrGas(3000),PGSDResidue2.get(dust),Materials.Iridium.getDust(1),300,1920); + //Rh - GT_Values.RA.addMixerRecipe(RHSulfate.get(cell),null,null,null,Materials.Water.getFluid(1000),RHSulfateSolution.getFluidOrGas(1000),LeachResidue.get(dustSmall),300,30); + GT_Values.RA.addMixerRecipe(RHSulfate.get(cell,5),null,null,null,Materials.Water.getFluid(5000),RHSulfateSolution.getFluidOrGas(5000),LeachResidue.get(dustTiny),300,30); GT_Values.RA.addChemicalRecipe(Materials.Zinc.getDust(1),null,RHSulfateSolution.getFluidOrGas(1000),null,ZincSulfate.get(dust),CrudeRhMetall.get(dust),300); GT_Values.RA.addBlastRecipe(CrudeRhMetall.get(dust),Materials.Salt.getDust(1),Materials.Chlorine.getGas(1000),null,RHSalt.get(dust,3),null,300,120,600); - GT_Values.RA.addMixerRecipe(RHSalt.get(dust),null,null,null,Materials.Water.getFluid(1000),RHSaltSolution.getFluidOrGas(1000),null,300,30); - GT_Values.RA.addChemicalRecipe(SodiumNitrate.get(dust),GT_Utility.getIntegratedCircuit(11),RHSaltSolution.getFluidOrGas(1000),null,RHNitrate.get(dust),Materials.Salt.getDust(1),300); + GT_Values.RA.addMixerRecipe(RHSalt.get(dust,10),null,null,null,Materials.Water.getFluid(2000),RHSaltSolution.getFluidOrGas(2000),null,300,30); + GT_Values.RA.addChemicalRecipe(SodiumNitrate.get(dust),GT_Utility.getIntegratedCircuit(1),RHSaltSolution.getFluidOrGas(1000),null,RHNitrate.get(dust),Materials.Salt.getDust(1),300); GT_Values.RA.addSifterRecipe(RHNitrate.get(dust),new ItemStack[]{ - RhFilterCake.get(dustTiny), - RhFilterCake.get(dustTiny), - RhFilterCake.get(dustTiny), - RhFilterCake.get(dustTiny), - RhFilterCake.get(dustTiny), - RhFilterCake.get(dustTiny), - RhFilterCake.get(dustTiny), - RhFilterCake.get(dustTiny), - RhFilterCake.get(dustTiny), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), },new int[]{ 1000,1000,1000,1000,1000,1000,1000,1000,500, },600,30); GT_Values.RA.addMixerRecipe(RhFilterCake.get(dust),null,null,null,Materials.Water.getFluid(1000),RHFilterCakeSolution.getFluidOrGas(1000),null,300,30); - GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(10),null,RHFilterCakeSolution.getFluidOrGas(1000),null,ReRh.get(dust),null,300); + GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2),null,RHFilterCakeSolution.getFluidOrGas(1000),null,ReRh.get(dust),null,300); GT_Values.RA.addChemicalRecipe(ReRh.get(dust),Materials.Empty.getCells(1),Materials.HydrochloricAcid.getFluid(1000),Materials.Chlorine.getGas(1000),Rhodium.get(dust),Materials.Ammonia.getCells(1),300); } @@ -215,10 +221,11 @@ public class PlatinumSludgeOverHaul { if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 11); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { +// if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { +// int amount = recipe.mOutputs[i].stackSize; +// recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 11); +// } else + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { @@ -234,10 +241,11 @@ public class PlatinumSludgeOverHaul { if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PDMetallicPowder.get(dustTiny).splitStack(amount * 11); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { +// if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { +// int amount = recipe.mOutputs[i].stackSize; +// recipe.mOutputs[i] = PDMetallicPowder.get(dustTiny).splitStack(amount * 11); +// } else + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = PDMetallicPowder.get(dust).splitStack(amount); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { @@ -253,18 +261,19 @@ public class PlatinumSludgeOverHaul { if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount * 22); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { +// if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { +// int amount = recipe.mOutputs[i].stackSize; +// recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount * 22); +// } else + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrOsLeachResidue.get(dust).splitStack(amount * 2); + recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount * 4); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrOsLeachResidue.get(dustSmall).splitStack(amount * 2); + recipe.mOutputs[i] = PTMetallicPowder.get(dustSmall).splitStack(amount * 4); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount * 2); + recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 4); } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Iridium)) { for (int j = 0; j < recipe.mInputs.length; j++) { @@ -272,18 +281,19 @@ public class PlatinumSludgeOverHaul { if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount * 11); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { +// if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { +// int amount = recipe.mOutputs[i].stackSize; +// recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount * 11); +// } else + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrOsLeachResidue.get(dust).splitStack(amount); + recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount * 2); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrOsLeachResidue.get(dustSmall).splitStack(amount); + recipe.mOutputs[i] = PTMetallicPowder.get(dustSmall).splitStack(amount * 2); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount); + recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 2); } } } @@ -340,6 +350,8 @@ public class PlatinumSludgeOverHaul { private static boolean isInBlackList(ItemStack stack){ if (!BW_Util.checkStackAndPrefix(stack)) return false; + if (stack.getItem() instanceof BW_MetaGenerated_Items) + return true; for (Materials m : PlatinumSludgeOverHaul.BLACKLIST){ if (GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial.equals(m)) return true; -- cgit From 1c73a9a064874d64684f300cbd786fd1cbef23ca Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 7 Sep 2019 13:23:58 +0200 Subject: lot of fixes +fixed translation for asembly line machines +fixed UnificationEnforcer +made diode recipes use new LuV Material +use my own prefixLogic +fixed my prefixLogic +added plate, stick and stickLong to my Werkstoffs +made LuV Hulls/LuV Casings use my LuV Material +fixed wrong outputs of nerfed dusts +fixed crop recipes give out pure metal +fixed crafting recipes give out pure metal +added Sodiumformate recipe Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 88e0e27dc697559c7ea2b455a557f3dfa5f807b8 --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 28 +- .../bartworks/common/loaders/RecipeLoader.java | 29 +- .../system/material/BW_MetaGenerated_Items.java | 9 +- .../bartworks/system/material/Werkstoff.java | 66 +++-- .../bartworks/system/material/WerkstoffLoader.java | 57 +++- .../processingLoaders/AdditionalRecipes.java | 228 ++++++++++++--- .../processingLoaders/PlatinumSludgeOverHaul.java | 306 ++++++++++++--------- 8 files changed, 484 insertions(+), 241 deletions(-) diff --git a/build.properties b/build.properties index b9eb909cee..74c884604a 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre3 +buildNumber=2_pre5 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index b3cd4aca0c..832b37716c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -150,7 +150,6 @@ public final class MainMod { MinecraftForge.EVENT_BUS.register(serverEventHandler); // FMLCommonHandler.instance().bus().register(serverEventHandler); } - new LoaderRegistry().run(); if (ConfigHandler.BioLab) new BioLabLoader().run(); if (ConfigHandler.newStuff) { @@ -159,6 +158,7 @@ public final class MainMod { else INSTANCE.runInit(); } + new LoaderRegistry().run(); } @Mod.EventHandler @@ -179,10 +179,10 @@ public final class MainMod { INSTANCE.run(); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor","Electric Implosions?"); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor.desc","Basically a giant Hammer that presses Stuff - No more TNT!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.DEHP","Heat from below!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.DEHP.desc","Get ALL the thermal energy!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.CircuitAssemblyLine","Cheaper Circuits?"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.CircuitAssemblyLine.desc","Well, yes, but actually no..."); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp","Heat from below!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp.desc","Get ALL the thermal energy!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline","Cheaper Circuits?"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline.desc","Well, yes, but actually no..."); } } @Mod.EventHandler @@ -251,24 +251,30 @@ public final class MainMod { if (GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) { if (removal) toRem.add(recipe); - else - recipe.mInputs[i] = replacement; + else { + int amount = recipe.mInputs[i].stackSize; + recipe.mInputs[i] = replacement.splitStack(amount); + } } } for (int i = 0; i < recipe.mOutputs.length; i++) { if (GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) { if (removal) toRem.add(recipe); - else - recipe.mOutputs[i] = replacement; + else { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = replacement.splitStack(amount); + } } } if (recipe.mSpecialItems instanceof ItemStack) { if (GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) { if (removal) toRem.add(recipe); - else - recipe.mSpecialItems = replacement; + else { + int amount = ((ItemStack) recipe.mSpecialItems).stackSize; + recipe.mSpecialItems = replacement.splitStack(amount); + } } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 5426e20a99..9519d67aee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -27,10 +27,13 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEnti import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_Windmill; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.GregTech_API; import gregtech.api.enums.*; +import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -293,7 +296,7 @@ public class RecipeLoader implements Runnable { ); Materials[] cables = {Materials.Lead, Materials.Tin, Materials.AnnealedCopper, Materials.Gold, Materials.Aluminium, Materials.Tungsten, Materials.VanadiumGallium, Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; - Materials[] hulls = {Materials.WroughtIron, Materials.Steel, Materials.Aluminium, Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, Materials.Chrome, Materials.Iridium, Materials.Osmium, Materials.Naquadah}; + ISubTagContainer[] hulls = {Materials.WroughtIron, Materials.Steel, Materials.Aluminium, Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, WerkstoffLoader.LuVTierMaterial, Materials.Iridium, Materials.Osmium, Materials.Naquadah}; ItemStack[] bats = {ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_Hull_MV.get(1L), ItemList.Battery_Hull_HV.get(1L)}; ItemStack[] chreac = {ItemList.Machine_MV_ChemicalReactor.get(1L), ItemList.Machine_HV_ChemicalReactor.get(1L), ItemList.Machine_EV_ChemicalReactor.get(1L)}; @@ -318,7 +321,7 @@ public class RecipeLoader implements Runnable { for (int i = 0; i < GT_Values.VN.length; i++) { try { Materials cable = cables[i]; - Materials hull = hulls[i]; + ItemStack hull = hulls[i] instanceof Materials ? GT_OreDictUnificator.get(OrePrefixes.plate, hulls[i], 1L) : ((Werkstoff) hulls[i]).get(OrePrefixes.plate); ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); GT_ModHandler.addCraftingRecipe( @@ -329,7 +332,7 @@ public class RecipeLoader implements Runnable { "WCW", "PWP", 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull }); GT_ModHandler.addCraftingRecipe( @@ -341,7 +344,7 @@ public class RecipeLoader implements Runnable { "PDP", 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -354,7 +357,7 @@ public class RecipeLoader implements Runnable { "PDP", 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -367,7 +370,7 @@ public class RecipeLoader implements Runnable { "PDP", 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -380,7 +383,7 @@ public class RecipeLoader implements Runnable { "PDP", 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -393,7 +396,7 @@ public class RecipeLoader implements Runnable { "PDP", 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -406,7 +409,7 @@ public class RecipeLoader implements Runnable { "PDP", 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -419,7 +422,7 @@ public class RecipeLoader implements Runnable { "PDP", 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -432,7 +435,7 @@ public class RecipeLoader implements Runnable { "PDP", 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -446,7 +449,7 @@ public class RecipeLoader implements Runnable { 'H', ItemList.Circuit_Parts_Coil.get(1L), 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); @@ -460,7 +463,7 @@ public class RecipeLoader implements Runnable { 'H', ItemList.Circuit_Parts_Coil.get(1L), 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, hull, 1L), + 'P', hull, 'C', machinehull } ); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index d3bd73964b..5da4d63e25 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.API.IRadMaterial; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.Pair; @@ -76,9 +77,9 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa for (int i = 0; i < this.aNumToGen; i++) { ItemStack tStack = new ItemStack(this, 1, i); Werkstoff w = werkstoffHashMap.get((short) i); - if (w == null || ((w.getGenerationFeatures().blacklist & orePrefixes.mMaterialGenerationBits) != 0) ) + if (w == null || ((w.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) != 0) ) continue; - if ((w.getGenerationFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) == 0 && orePrefixes.mMaterialGenerationBits != 0) + if ((w.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes) != 0) continue; GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", this.getDefaultLocalization(w)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); @@ -153,12 +154,12 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { for (int i = 0; i < this.aNumToGen; i++) { Werkstoff werkstoff = werkstoffHashMap.get((short) i); - if (werkstoff != null && ((werkstoff.getGenerationFeatures().toGenerate & this.orePrefixes.mMaterialGenerationBits) != 0) && ((werkstoff.getGenerationFeatures().blacklist & this.orePrefixes.mMaterialGenerationBits) == 0)) { + if (werkstoff != null && ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) != 0) && ((werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0)) { ItemStack tStack = new ItemStack(this, 1, i); aList.add(tStack); } } - super.getSubItems(var1, aCreativeTab, aList); + //super.getSubItems(var1, aCreativeTab, aList); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 83aeae3afc..3ece0e03d3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -58,6 +58,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { private final Werkstoff.GenerationFeatures generationFeatures; private final short mID; private final TextureSet texSet; + private Materials bridgeMaterial; + + public Materials getBridgeMaterial() { + return this.bridgeMaterial; + } + + public void setBridgeMaterial(Materials bridgeMaterial) { + this.bridgeMaterial = bridgeMaterial; + } public static void init(){ Werkstoff.default_null_Werkstoff = new Werkstoff(new short[3], "_NULL", "Default null Werkstoff", Werkstoff.DEFAULT_NULL_STATS, Werkstoff.Types.UNDEFINED, Werkstoff.DEFAULT_NULL_GENERATION_FEATURES, -1, TextureSet.SET_NONE); @@ -354,7 +363,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { molten 1000000 crafting metal 10000000 (sticks, plates) meta crafting metal 100000000 (gears, screws, bolts, springs) - multiple ingotWorth stuff 1000000000 (double, triple, quadrupe, ingot/plates) + multiple ingotWorth stuff 1000000000 (double, triple, quadruple, ingot/plates) */ public short toGenerate = 0b0001001; public static final HashMap prefixLogic = new HashMap<>(); @@ -363,30 +372,30 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { for (OrePrefixes p : OrePrefixes.values()){ Werkstoff.GenerationFeatures.prefixLogic.put(p,0); } - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dust,1); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustTiny,1); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustSmall,1); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingot,10); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotHot,10); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.nugget,10); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gem,100); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawed,100); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemExquisite,100); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemChipped,100); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawless,100); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ore,1000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustImpure,1000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustPure,1000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushed,1000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedPurified,1000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedCentrifuged,1000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.cell,10000); - Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten,1000000); - Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten,1000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plate,10000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stick,10000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rod,10000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stickLong,10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dust,0b1); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustTiny,0b1); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustSmall,0b1); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingot,0b10); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotHot,0b10); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.nugget,0b10); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gem,0b100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawed,0b100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemExquisite,0b100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemChipped,0b100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawless,0b100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ore,0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustImpure,0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustPure,0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushed,0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedPurified,0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedCentrifuged,0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.cell,0b10000); + Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten,0b1000000); + Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten,0b1000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plate,0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stick,0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rod,0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stickLong,0b10000000); } //public byte toGenerateSecondary = 0b0000000; @@ -504,6 +513,13 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.toGenerate = (byte) (this.toGenerate | 0x4); return this; } + public Werkstoff.GenerationFeatures addSimpleMetalWorkingItems() { + this.toGenerate = (byte) (this.toGenerate | 0b10000000); + return this; + } + public boolean hasSimpleMetalWorkingItems() { + return (this.toGenerate & 0b10000000) != 0; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 26f4783a0f..157b5ca643 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -33,7 +33,6 @@ import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import cpw.mods.fml.client.registry.RenderingRegistry; @@ -49,6 +48,7 @@ import gregtech.api.objects.GT_Fluid; import gregtech.api.objects.GT_MultiTexture; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.*; +import gregtech.common.GT_Proxy; import gregtech.common.items.behaviors.Behaviour_DataOrb; import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputOreDict; @@ -1168,11 +1168,11 @@ public class WerkstoffLoader implements Runnable { TextureSet.SET_QUARTZ ); public static final Werkstoff LuVTierMaterial = new Werkstoff( - new short[]{0xff, 0xee, 0xee}, + Materials.Chrome.getRGBA(), "Rhodium-Plated Palladium", new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500), Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMixerRecipes(), + new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems(), 88, TextureSet.SET_METALLIC, new Pair<>(Materials.Palladium,3), @@ -1257,6 +1257,8 @@ public class WerkstoffLoader implements Runnable { this.addCellRecipes(werkstoff); DebugLog.log("Loading Meltdown Recipes"+" " +(System.nanoTime()-timepreone)); this.addMoltenRecipes(werkstoff); + DebugLog.log("Loading Simple MetalWorking Recipes"+" " +(System.nanoTime()-timepreone)); + this.addSimpleMetalRecipes(werkstoff); if (Loader.isModLoaded("Thaumcraft")) { DebugLog.log("Loading Aspects"+" " +(System.nanoTime()-timepreone)); ThaumcraftHandler.AspectAdder.addAspectToAll(werkstoff); @@ -1358,10 +1360,8 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.items.put(ingotHot, new BW_MetaGenerated_Items(ingotHot)); //1750 WerkstoffLoader.items.put(nugget, new BW_MetaGenerated_Items(nugget)); -// WerkstoffLoader.items.put(plate, new BW_MetaGenerated_Items(plate)); -// WerkstoffLoader.items.put(rod, new BW_MetaGenerated_Items(rod)); -// WerkstoffLoader.items.put(stickLong, new BW_MetaGenerated_Items(stickLong)); -// + + // WerkstoffLoader.items.put(gearGt, new BW_MetaGenerated_Items(gearGt)); // WerkstoffLoader.items.put(gearGtSmall, new BW_MetaGenerated_Items(gearGtSmall)); // WerkstoffLoader.items.put(bolt, new BW_MetaGenerated_Items(bolt)); @@ -1408,6 +1408,13 @@ public class WerkstoffLoader implements Runnable { if ((WerkstoffLoader.toGenerateGlobal & 0b1000000) != 0) { WerkstoffLoader.items.put(cellMolten, new BW_MetaGenerated_Items(cellMolten)); } + if ((WerkstoffLoader.toGenerateGlobal & 0b10000000) != 0) { + WerkstoffLoader.items.put(plate, new BW_MetaGenerated_Items(plate)); + WerkstoffLoader.items.put(stick, new BW_MetaGenerated_Items(stick)); + WerkstoffLoader.items.put(stickLong, new BW_MetaGenerated_Items(stickLong)); + } + + } @@ -1439,9 +1446,10 @@ public class WerkstoffLoader implements Runnable { } if (werkstoff.getGenerationFeatures().hasMolten()) { werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid(); - } + werkstoffBridgeMaterial.mName = werkstoff.getDefaultName(); toRem.add(werkstoffBridgeMaterial); + werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); } try { Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); @@ -1556,6 +1564,31 @@ public class WerkstoffLoader implements Runnable { } } + private void addSimpleMetalRecipes(Werkstoff werkstoff) { + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000000) != 0) { + if (werkstoff.getGenerationFeatures().hasGems()) { + GT_Values.RA.addLatheRecipe(werkstoff.get(gem), werkstoff.get(stick), werkstoff.get(dustSmall), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); + GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(gem)}); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); + return; + } + + GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(ingot)}); + + GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{werkstoff.get(ingot),GT_Utility.getIntegratedCircuit(1)},new ItemStack[]{werkstoff.get(plate)},null,null,null,null, (int) Math.max(werkstoff.getStats().getMass(), 1L), 24,0)); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ingot,3), werkstoff.get(plate,2), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); + + GT_Values.RA.addLatheRecipe(werkstoff.get(ingot), werkstoff.get(stick), werkstoff.get(dustSmall), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); + + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); + + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot),ItemList.Shape_Extruder_Plate.get(0),werkstoff.get(plate),(int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot),ItemList.Shape_Extruder_Rod.get(0),werkstoff.get(stick,2),(int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); + } + } + private void addDustRecipes(Werkstoff werkstoff) { if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0) { List flOutputs = new ArrayList<>(); @@ -1918,9 +1951,11 @@ public class WerkstoffLoader implements Runnable { if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0) { GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - //GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - //GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - //GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick),null,werkstoff.getMolten(72),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000000) != 0) { + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong), null, werkstoff.getMolten(144), 0, werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate), null, werkstoff.getMolten(144), 0, werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick), null, werkstoff.getMolten(72), 0, werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + } GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget),null,werkstoff.getMolten(16),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index f829306575..0dfd487d20 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -29,14 +29,22 @@ import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.*; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.ItemData; +import gregtech.api.util.*; import gregtech.common.items.behaviors.Behaviour_DataOrb; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; +import org.apache.commons.lang3.reflect.FieldUtils; +import sun.reflect.FieldInfo; import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import static com.github.bartimaeusnek.bartworks.util.BW_Util.CLEANROOM; @@ -47,7 +55,7 @@ public class AdditionalRecipes implements Runnable { @Override public void run() { //Thorium/Yttrium Glas - GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall,2),WerkstoffLoader.Thorianit.get(dustSmall,2),Materials.Glass.getMolten(144),null,new ItemStack(ItemRegistry.bw_glasses[0],1,12),null,800, BW_Util.getMachineVoltageFromTier(5),3663); + GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall, 2), WerkstoffLoader.Thorianit.get(dustSmall, 2), Materials.Glass.getMolten(144), null, new ItemStack(ItemRegistry.bw_glasses[0], 1, 12), null, 800, BW_Util.getMachineVoltageFromTier(5), 3663); //Thorianit recipes GT_Values.RA.addSifterRecipe(WerkstoffLoader.Thorianit.get(crushedPurified), new ItemStack[]{ @@ -57,66 +65,196 @@ public class AdditionalRecipes implements Runnable { Materials.Thorium.getDust(1), Materials.Thorium.getDust(1), WerkstoffLoader.Thorium232.get(dust), - }, new int[]{7000,1300,700,600,300,100}, + }, new int[]{7000, 1300, 700, 600, 300, 100}, 400, BW_Util.getMachineVoltageFromTier(5) - ); - GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust),Materials.Aluminium.getDust(1),Materials.Thorium.getDust(1),1000); - GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust),Materials.Magnesium.getDust(1),Materials.Thorium.getDust(1),1000); - GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(crushed), ItemList.Crop_Drop_Thorium.get(9),Materials.Water.getFluid(1000),Materials.Thorium.getMolten(144),WerkstoffLoader.Thorianit.get(crushedPurified,4),96,24); + ); + GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust), Materials.Aluminium.getDust(1), Materials.Thorium.getDust(1), 1000); + GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust), Materials.Magnesium.getDust(1), Materials.Thorium.getDust(1), 1000); + GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(crushed), ItemList.Crop_Drop_Thorium.get(9), Materials.Water.getFluid(1000), Materials.Thorium.getMolten(144), WerkstoffLoader.Thorianit.get(crushedPurified, 4), 96, 24); //Prasiolite - GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(dust,Materials.Quartzite,40L),Materials.Amethyst.getDust(10),GT_Values.NF,GT_Values.NF,WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed,20),GT_Values.NI,800, BW_Util.getMachineVoltageFromTier(2),500); - GT_Values.RA.addPrimitiveBlastRecipe(GT_OreDictUnificator.get(dust,Materials.Quartzite,40L),Materials.Amethyst.getDust(10),6,WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed,20),GT_Values.NI,800); + GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), Materials.Amethyst.getDust(10), GT_Values.NF, GT_Values.NF, WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), GT_Values.NI, 800, BW_Util.getMachineVoltageFromTier(2), 500); + GT_Values.RA.addPrimitiveBlastRecipe(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), Materials.Amethyst.getDust(10), 6, WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), GT_Values.NI, 800); //Cubic Circonia - GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(11),Materials.Oxygen.getGas(3000),null, WerkstoffLoader.YttriumOxide.get(dust,5),64, BW_Util.getMachineVoltageFromTier(4)); - GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust,10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.CubicZirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953); + GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(11), Materials.Oxygen.getGas(3000), null, WerkstoffLoader.YttriumOxide.get(dust, 5), 64, BW_Util.getMachineVoltageFromTier(4)); + GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust, 10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.CubicZirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953); //Tellurium - GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed,Materials.Lead,10L),GT_Utility.getIntegratedCircuit(17),GT_Values.NF,GT_Values.NF,Materials.Lead.getIngots(10),Materials.Tellurium.getNuggets(20),800, BW_Util.getMachineVoltageFromTier(2),722); - GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium.getMolten(16), Materials.Beryllium.getMolten(16), WerkstoffLoader.Californium.getMolten(16), 250,49152, 480000000); - GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), WerkstoffLoader.Calcium.getMolten(16), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500,49152, 600000000); - GT_Values.RA.addDistillationTowerRecipe(Materials.LiquidAir.getFluid(100000000),new FluidStack[]{Materials.Nitrogen.getGas(78084000),Materials.Oxygen.getGas(20946000),Materials.Argon.getGas(934000),Materials.CarbonDioxide.getGas(40700),WerkstoffLoader.Neon.getFluidOrGas(1818),Materials.Helium.getGas(524),Materials.Methane.getGas(180),WerkstoffLoader.Krypton.getFluidOrGas(114),Materials.Hydrogen.getGas(55),WerkstoffLoader.Xenon.getFluidOrGas(9)},null,7500, BW_Util.getMachineVoltageFromTier(4)); - GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust),WerkstoffLoader.Neon.getFluidOrGas(1000),WerkstoffLoader.MagnetoResonaticDust.get(gemChipped,9),9000,4500, BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust),WerkstoffLoader.Krypton.getFluidOrGas(1000),WerkstoffLoader.MagnetoResonaticDust.get(gem),10000,4500, BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed, Materials.Lead, 10L), GT_Utility.getIntegratedCircuit(17), GT_Values.NF, GT_Values.NF, Materials.Lead.getIngots(10), Materials.Tellurium.getNuggets(20), 800, BW_Util.getMachineVoltageFromTier(2), 722); + GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium.getMolten(16), Materials.Beryllium.getMolten(16), WerkstoffLoader.Californium.getMolten(16), 250, 49152, 480000000); + GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), WerkstoffLoader.Calcium.getMolten(16), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500, 49152, 600000000); + GT_Values.RA.addDistillationTowerRecipe(Materials.LiquidAir.getFluid(100000000), new FluidStack[]{Materials.Nitrogen.getGas(78084000), Materials.Oxygen.getGas(20946000), Materials.Argon.getGas(934000), Materials.CarbonDioxide.getGas(40700), WerkstoffLoader.Neon.getFluidOrGas(1818), Materials.Helium.getGas(524), Materials.Methane.getGas(180), WerkstoffLoader.Krypton.getFluidOrGas(114), Materials.Hydrogen.getGas(55), WerkstoffLoader.Xenon.getFluidOrGas(9)}, null, 7500, BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust), WerkstoffLoader.Neon.getFluidOrGas(1000), WerkstoffLoader.MagnetoResonaticDust.get(gemChipped, 9), 9000, 4500, BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust), WerkstoffLoader.Krypton.getFluidOrGas(1000), WerkstoffLoader.MagnetoResonaticDust.get(gem), 10000, 4500, BW_Util.getMachineVoltageFromTier(5)); for (int i = 0; i <= 6; i++) { - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( - new BWRecipes.DynamicGTRecipe(false, - new ItemStack[]{ - BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gem), - BW_Meta_Items.getNEWCIRCUITS().getStack(i+3), - ItemList.Circuit_Parts_DiodeSMD.get((i+1)*4), - ItemList.Circuit_Parts_CapacitorSMD.get((i+1)*4), - ItemList.Circuit_Parts_TransistorSMD.get((i+1)*4) - }, - new ItemStack[]{ - BW_Meta_Items.getNEWCIRCUITS().getStack(i+4) - },null,null, - new FluidStack[]{ - Materials.SolderingAlloy.getMolten((i+1)*36) - },null,(i+1)*750, BW_Util.getMachineVoltageFromTier((i+1)),CLEANROOM)); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( + new BWRecipes.DynamicGTRecipe(false, + new ItemStack[]{ + BW_Meta_Items.getNEWCIRCUITS().getStack(3), + WerkstoffLoader.MagnetoResonaticDust.get(gem), + BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), + ItemList.Circuit_Parts_DiodeSMD.get((i + 1) * 4), + ItemList.Circuit_Parts_CapacitorSMD.get((i + 1) * 4), + ItemList.Circuit_Parts_TransistorSMD.get((i + 1) * 4) + }, + new ItemStack[]{ + BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4) + }, null, null, + new FluidStack[]{ + Materials.SolderingAlloy.getMolten((i + 1) * 36) + }, null, (i + 1) * 750, BW_Util.getMachineVoltageFromTier((i + 1)), CLEANROOM)); } for (int i = 7; i <= 10; i++) { GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{ BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite,(2)), - BW_Meta_Items.getNEWCIRCUITS().getStack(i+3), - ItemList.Circuit_Parts_DiodeSMD.get((i+6)*4), - ItemList.Circuit_Parts_CapacitorSMD.get((i+6)*4), - ItemList.Circuit_Parts_TransistorSMD.get((i+6)*4) + WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (2)), + BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), + ItemList.Circuit_Parts_DiodeSMD.get((i + 6) * 4), + ItemList.Circuit_Parts_CapacitorSMD.get((i + 6) * 4), + ItemList.Circuit_Parts_TransistorSMD.get((i + 6) * 4) }, new ItemStack[]{ - BW_Meta_Items.getNEWCIRCUITS().getStack(i+4) - },null,null, + BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4) + }, null, null, new FluidStack[]{ - Materials.SolderingAlloy.getMolten((i+1)*144) - },null,(i+1)*1500, BW_Util.getMachineVoltageFromTier(i+1),CLEANROOM)); + Materials.SolderingAlloy.getMolten((i + 1) * 144) + }, null, (i + 1) * 1500, BW_Util.getMachineVoltageFromTier(i + 1), CLEANROOM)); + } + AdditionalRecipes.replaceLuVHull(); + AdditionalRecipes.oldGThelperMethod(); + } + + private static void replaceLuVHull(){ + Object toRemove = null; + for (Object obj : CraftingManager.getInstance().getRecipeList()) { + if (!(obj instanceof GT_Shaped_Recipe)) + continue; + if (BW_Util.areStacksEqualOrNull(((GT_Shaped_Recipe) obj).getRecipeOutput(), ItemList.Casing_LuV.get(1))) { + toRemove = obj; + break; + } + } + CraftingManager.getInstance().getRecipeList().remove(toRemove); + toRemove = null; + List bufferedRecipeList = null; + try { + bufferedRecipeList = (List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + assert bufferedRecipeList != null; + for (Object obj : bufferedRecipeList) { + if (!(obj instanceof GT_Shaped_Recipe)) + continue; + if (BW_Util.areStacksEqualOrNull(((GT_Shaped_Recipe) obj).getRecipeOutput(), ItemList.Casing_LuV.get(1))) { + toRemove = obj; + break; + } + } + bufferedRecipeList.remove(toRemove); + try { + Map map = (Map) FieldUtils.getDeclaredField(GT_OreDictUnificator.class, "sItemStack2DataMap", true).get(null); + ItemData data = map.get(new GT_ItemStack(ItemList.Casing_LuV.get(1))); + data.mMaterial.mMaterial = WerkstoffLoader.LuVTierMaterial.getBridgeMaterial(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + GT_ModHandler.addCraftingRecipe(ItemList.Casing_LuV.get(1), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, new Object[]{"PPP", "PwP", "PPP", 'P', WerkstoffLoader.LuVTierMaterial.get(plate)}); + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings){ + for (GT_Recipe recipe : map.mRecipeList){ + + if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,ItemList.Casing_LuV.get(1),false)) + AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,GT_OreDictUnificator.get(plate,Materials.Chrome,1),true,WerkstoffLoader.LuVTierMaterial.get(plate)); + if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mOutputs,ItemList.Casing_LuV.get(1),false)) + AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,GT_OreDictUnificator.get(plate,Materials.Chrome,1),true,WerkstoffLoader.LuVTierMaterial.get(plate)); + + if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,ItemList.Hull_LuV.get(1),false)) + AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,GT_OreDictUnificator.get(plate,Materials.Chrome,1),true,WerkstoffLoader.LuVTierMaterial.get(plate)); + if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mOutputs,ItemList.Hull_LuV.get(1),false)) + AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,GT_OreDictUnificator.get(plate,Materials.Chrome,1),true,WerkstoffLoader.LuVTierMaterial.get(plate)); + + if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,ItemList.Casing_LuV.get(1),false)) + AdditionalRecipes.doStacksCointainAndReplace(recipe.mFluidInputs,Materials.Chrome.getMolten(1),true,WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mOutputs,ItemList.Casing_LuV.get(1),false)) + AdditionalRecipes.doStacksCointainAndReplace(recipe.mFluidInputs,Materials.Chrome.getMolten(1),true,WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,ItemList.Casing_LuV.get(1),false)) + AdditionalRecipes.doStacksCointainAndReplace(recipe.mFluidOutputs,Materials.Chrome.getMolten(1),true,WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mOutputs,ItemList.Casing_LuV.get(1),false)) + AdditionalRecipes.doStacksCointainAndReplace(recipe.mFluidOutputs,Materials.Chrome.getMolten(1),true,WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + + if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,ItemList.Hull_LuV.get(1),false)) + AdditionalRecipes.doStacksCointainAndReplace(recipe.mFluidInputs,Materials.Chrome.getMolten(1),true,WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mOutputs,ItemList.Hull_LuV.get(1),false)) + AdditionalRecipes.doStacksCointainAndReplace(recipe.mFluidInputs,Materials.Chrome.getMolten(1),true,WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,ItemList.Hull_LuV.get(1),false)) + AdditionalRecipes.doStacksCointainAndReplace(recipe.mFluidOutputs,Materials.Chrome.getMolten(1),true,WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mOutputs,ItemList.Hull_LuV.get(1),false)) + AdditionalRecipes.doStacksCointainAndReplace(recipe.mFluidOutputs,Materials.Chrome.getMolten(1),true,WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + + } + } + + for (Object obj : CraftingManager.getInstance().getRecipeList()) { + if (!(obj instanceof GT_Shaped_Recipe)) + continue; + if (BW_Util.areStacksEqualOrNull(((GT_Shaped_Recipe) obj).getRecipeOutput(), ItemList.Hull_LuV.get(1))) { + toRemove = obj;//AdditionalRecipes.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(),GT_OreDictUnificator.get(plate,Materials.Chrome,1),true,WerkstoffLoader.LuVTierMaterial.get(plate)); + break; + } + } + CraftingManager.getInstance().getRecipeList().remove(toRemove); + for (Object obj : bufferedRecipeList) { + if (!(obj instanceof GT_Shaped_Recipe)) + continue; + if (BW_Util.areStacksEqualOrNull(((GT_Shaped_Recipe) obj).getRecipeOutput(), ItemList.Hull_LuV.get(1))) { + toRemove = obj;//AdditionalRecipes.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(),GT_OreDictUnificator.get(plate,Materials.Chrome,1),true,WerkstoffLoader.LuVTierMaterial.get(plate)); + break; + } + } + bufferedRecipeList.remove(toRemove); + try { + Map map = (Map) FieldUtils.getDeclaredField(GT_OreDictUnificator.class, "sItemStack2DataMap", true).get(null); + ItemData data = map.get(new GT_ItemStack(ItemList.Hull_LuV.get(1))); + data.mMaterial.mMaterial = WerkstoffLoader.LuVTierMaterial.getBridgeMaterial(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + GT_ModHandler.addCraftingRecipe(ItemList.Hull_LuV.get(1), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, new Object[]{"KPK", "CHC", 'P', WerkstoffLoader.LuVTierMaterial.get(plate), 'K',Materials.Polytetrafluoroethylene.getPlates(1), 'C', GT_OreDictUnificator.get(cableGt01, Materials.VanadiumGallium,1L), 'H',ItemList.Casing_LuV}); + } + + private static boolean doStacksCointainAndReplace(FluidStack[] stacks, FluidStack stack, boolean replace, Fluid... replacement){ + boolean replaced = false; + for (int i = 0; i < stacks.length; i++) { + if (GT_Utility.areFluidsEqual(stack, stacks[i])) + if (!replace) + return true; + else { + int amount = stacks[i].amount; + stacks[i] = new FluidStack(replacement[0],amount); + replaced = true; + } + } + return replaced; + } + private static boolean doStacksCointainAndReplace(Object[] stacks, ItemStack stack, boolean replace, ItemStack... replacement){ + boolean replaced = false; + for (int i = 0; i < stacks.length; i++) { + if (!GT_Utility.isStackValid(stacks[i])){ + continue; + } + else if (GT_Utility.areStacksEqual(stack, (ItemStack) stacks[i])) + if (!replace) + return true; + else { + stacks[i] = replacement[0]; + replaced = true; + } } - oldGThelperMethod(); + return replaced; } private static void oldGThelperMethod(){ diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java index b590615154..0f45f7ceec 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java @@ -22,60 +22,77 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; +import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; -import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.MaterialStack; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.*; +import net.minecraft.block.Block; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.reflect.FieldUtils; +import java.lang.reflect.Field; import java.util.HashSet; +import java.util.List; import java.util.Map; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; import static gregtech.api.enums.OrePrefixes.*; public class PlatinumSludgeOverHaul { - private PlatinumSludgeOverHaul(){} + private static final Materials[] BLACKLIST = { + Materials.HSSS, + Materials.EnderiumBase, + Materials.Osmiridium, + Materials.get("Uraniumtriplatinid"), + Materials.get("Tetranaquadahdiindiumhexaplatiumosminid"), + Materials.get("Longasssuperconductornameforuvwire"), + }; - public static void runHelperrecipes(){ - //DilutedSulfuricAcid - GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(3),Materials.Water.getCells(1),GT_Utility.getIntegratedCircuit(1),null,null,null, Materials.DilutedSulfuricAcid.getCells(4),30,30); + private PlatinumSludgeOverHaul() { + } + public static void runHelperrecipes() { + //DilutedSulfuricAcid + GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(3), Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, Materials.DilutedSulfuricAcid.getCells(4), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, Materials.SulfuricAcid.getFluid(3000), Materials.DilutedSulfuricAcid.getFluid(4000), Materials.Empty.getCells(1), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(3), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Water.getFluid(1000), Materials.DilutedSulfuricAcid.getFluid(4000), Materials.Empty.getCells(3), 30, 30); //FormicAcid - GT_Values.RA.addChemicalRecipe(Sodiumformate.get(cell,2), GT_Utility.getIntegratedCircuit(1), Materials.SulfuricAcid.getFluid(1000),null,FormicAcid.get(cell,2),Sodiumsulfate.get(dust),15); - GT_Values.RA.addChemicalRecipe(Materials.SulfuricAcid.getCells(2), GT_Utility.getIntegratedCircuit(1), Sodiumformate.getFluidOrGas(1000),FormicAcid.getFluidOrGas(2000),Materials.Empty.getCells(2),Sodiumsulfate.get(dust),15); + GT_Values.RA.addChemicalRecipe(Materials.CarbonMonoxide.getCells(1), Materials.SodiumHydroxide.getDust(1), null, null, Sodiumformate.get(cell), null, 15); + GT_Values.RA.addChemicalRecipe(Sodiumformate.get(cell, 2), GT_Utility.getIntegratedCircuit(1), Materials.SulfuricAcid.getFluid(1000), null, FormicAcid.get(cell, 2), Sodiumsulfate.get(dust), 15); + GT_Values.RA.addChemicalRecipe(Materials.SulfuricAcid.getCells(2), GT_Utility.getIntegratedCircuit(1), Sodiumformate.getFluidOrGas(1000), FormicAcid.getFluidOrGas(2000), Materials.Empty.getCells(2), Sodiumsulfate.get(dust), 15); //AquaRegia - GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1),Materials.NitricAcid.getCells(1),GT_Utility.getIntegratedCircuit(1),null,null,null, AquaRegia.get(cell,2),30,30); + GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, AquaRegia.get(cell, 2), 30, 30); //AmmoniumCloride - GT_Values.RA.addChemicalRecipe(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.HydrochloricAcid.getFluid(1000),null, AmmoniumChloride.get(cell,1),null,15); - GT_Values.RA.addChemicalRecipe(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), AmmoniumChloride.getFluidOrGas(1000),Materials.Empty.getCells(1),null,15); + GT_Values.RA.addChemicalRecipe(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.HydrochloricAcid.getFluid(1000), null, AmmoniumChloride.get(cell, 1), null, 15); + GT_Values.RA.addChemicalRecipe(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), AmmoniumChloride.getFluidOrGas(1000), Materials.Empty.getCells(1), null, 15); //base sollution - for (Werkstoff w :Werkstoff.werkstoffHashMap.values()) - if (w.containsStuff(Materials.Sulfur)&&(w.containsStuff(Materials.Copper)||w.containsStuff(Materials.Nickel))) { + for (Werkstoff w : Werkstoff.werkstoffHashMap.values()) + if (w.containsStuff(Materials.Sulfur) && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny), 250); } for (Materials m : Materials.values()) - if (materialsContains(m,Materials.Sulfur)&&(materialsContains(m,Materials.Copper)||materialsContains(m,Materials.Nickel))){ - GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified,m,1), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); - GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified,m,1), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny), 250); + if (PlatinumSludgeOverHaul.materialsContains(m, Materials.Sulfur) && (PlatinumSludgeOverHaul.materialsContains(m, Materials.Copper) || PlatinumSludgeOverHaul.materialsContains(m, Materials.Nickel))) { + GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); + GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny), 250); } //Pt GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{},new FluidStack[]{PTConcentrate.getFluidOrGas(1000), AmmoniumChloride.getFluidOrGas(1000)},new FluidStack[]{PDAmmonia.getFluidOrGas(100),Materials.Ammonia.getGas(900)},new ItemStack[]{PTSaltCrude.get(dustTiny,8),PTRawPowder.get(dustTiny)},600,30); - GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust),new ItemStack[]{ + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{}, new FluidStack[]{PTConcentrate.getFluidOrGas(1000), AmmoniumChloride.getFluidOrGas(1000)}, new FluidStack[]{PDAmmonia.getFluidOrGas(100), Materials.Ammonia.getGas(900)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 8), PTRawPowder.get(dustTiny)}, 600, 30); + GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ PTSaltRefined.get(dust), PTSaltRefined.get(dust), PTSaltRefined.get(dust), @@ -85,16 +102,16 @@ public class PlatinumSludgeOverHaul { PTSaltRefined.get(dust), PTSaltRefined.get(dust), PTSaltRefined.get(dust), - },new int[]{ - 1000,1000,1000,1000,1000,1000,1000,1000,500, - },600,30); - GT_Values.RA.addBlastRecipe(PTSaltRefined.get(dust),GT_Utility.getIntegratedCircuit(1),null,null,PTMetallicPowder.get(dust),null,200,120,900); - GT_Values.RA.addChemicalRecipe(PTRawPowder.get(dust,2),Materials.Calcium.getDust(1),null,null,Materials.Platinum.getDust(2),CalciumChloride.get(dust),30); + }, new int[]{ + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, + }, 600, 30); + GT_Values.RA.addBlastRecipe(PTSaltRefined.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, PTMetallicPowder.get(dust), null, 200, 120, 900); + GT_Values.RA.addChemicalRecipe(PTRawPowder.get(dust, 2), Materials.Calcium.getDust(1), null, null, Materials.Platinum.getDust(2), CalciumChloride.get(dust), 30); //Pd - GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust),GT_Utility.getIntegratedCircuit(1),Materials.Ammonia.getGas(1000), PDAmmonia.getFluidOrGas(1000), null, 250); - GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), PDAmmonia.getFluidOrGas(1000), null,PDSalt.get(dustTiny,16),PDRawPowder.get(dustTiny,2), 250); - GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2),null,PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dustTiny,9), 250); - GT_Values.RA.addSifterRecipe(PDSalt.get(dust),new ItemStack[]{ + GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), PDAmmonia.getFluidOrGas(1000), null, 250); + GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dustTiny, 16), PDRawPowder.get(dustTiny, 2), 250); + GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), null, PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dustTiny, 9), 250); + GT_Values.RA.addSifterRecipe(PDSalt.get(dust), new ItemStack[]{ PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), @@ -104,46 +121,46 @@ public class PlatinumSludgeOverHaul { PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), - },new int[]{ - 1000,1000,1000,1000,1000,1000,1000,1000,500, - },600,30); - GT_Values.RA.addChemicalRecipeForBasicMachineOnly(PDRawPowder.get(dust,2), Materials.Empty.getCells(1), FormicAcid.getFluidOrGas(4000), Materials.Ammonia.getGas(2000),Materials.Palladium.getDust(2),Materials.Ethylene.getCells(1), 250,30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{PDRawPowder.get(dust,2)},new FluidStack[]{FormicAcid.getFluidOrGas(4000)},new FluidStack[]{Materials.Ammonia.getGas(2000),Materials.Ethylene.getGas(1000),Materials.Water.getFluid(1000)},new ItemStack[]{Materials.Palladium.getDust(2)},250,30); - GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust,2),Materials.Hydrogen.getCells(1),null,Materials.SulfuricAcid.getFluid(2000),Materials.Sodium.getDust(1),Materials.Empty.getCells(3),30); + }, new int[]{ + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, + }, 600, 30); + GT_Values.RA.addChemicalRecipeForBasicMachineOnly(PDRawPowder.get(dust, 2), Materials.Empty.getCells(1), FormicAcid.getFluidOrGas(4000), Materials.Ammonia.getGas(2000), Materials.Palladium.getDust(2), Materials.Ethylene.getCells(1), 250, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{PDRawPowder.get(dust, 2)}, new FluidStack[]{FormicAcid.getFluidOrGas(4000)}, new FluidStack[]{Materials.Ammonia.getGas(2000), Materials.Ethylene.getGas(1000), Materials.Water.getFluid(1000)}, new ItemStack[]{Materials.Palladium.getDust(2)}, 250, 30); + GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust, 2), Materials.Hydrogen.getCells(1), null, Materials.SulfuricAcid.getFluid(2000), Materials.Sodium.getDust(1), Materials.Empty.getCells(3), 30); //K2S2O7 - GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust),Materials.Potassium.getDust(2),Materials.Oxygen.getGas(3000),null,PotassiumDisulfate.get(dust),Materials.Empty.getCells(1),30); + GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust), Materials.Empty.getCells(1), 30); //Rh/Os/Ir/Ru - GT_Values.RA.addBlastRecipe(PTResidue.get(dust),GT_Utility.getIntegratedCircuit(11),PotassiumDisulfate.getMolten(1440),RHSulfate.getFluidOrGas(1440),LeachResidue.get(dust),null,200,120,775); + GT_Values.RA.addBlastRecipe(PTResidue.get(dust), GT_Utility.getIntegratedCircuit(11), PotassiumDisulfate.getMolten(1440), RHSulfate.getFluidOrGas(1440), LeachResidue.get(dust), null, 200, 120, 775); //Ru - GT_Values.RA.addBlastRecipe(LeachResidue.get(dust,10),Materials.Saltpeter.getDust(10),Materials.SaltWater.getFluid(1000), GT_ModHandler.getSteam(1000),SodiumRuthenate.get(dust,3),IrOsLeachResidue.get(dust,6),200,120,775); - GT_Values.RA.addChemicalRecipe(SodiumRuthenate.get(dust,6),Materials.Chlorine.getCells(3),null,RutheniumTetroxideSollution.getFluidOrGas(9000),Materials.Empty.getCells(3),300); - GT_Values.RA.addFluidHeaterRecipe(null,RutheniumTetroxideSollution.getFluidOrGas(800),HotRutheniumTetroxideSollution.getFluidOrGas(1600),300,480); - GT_Values.RA.addCrackingRecipe(17,RutheniumTetroxideSollution.getFluidOrGas(1000),null,HotRutheniumTetroxideSollution.getFluidOrGas(2000),150,480); - GT_Values.RA.addDistillationTowerRecipe(HotRutheniumTetroxideSollution.getFluidOrGas(9000),new FluidStack[]{ + GT_Values.RA.addBlastRecipe(LeachResidue.get(dust, 10), Materials.Saltpeter.getDust(10), Materials.SaltWater.getFluid(1000), GT_ModHandler.getSteam(1000), SodiumRuthenate.get(dust, 3), IrOsLeachResidue.get(dust, 6), 200, 120, 775); + GT_Values.RA.addChemicalRecipe(SodiumRuthenate.get(dust, 6), Materials.Chlorine.getCells(3), null, RutheniumTetroxideSollution.getFluidOrGas(9000), Materials.Empty.getCells(3), 300); + GT_Values.RA.addFluidHeaterRecipe(null, RutheniumTetroxideSollution.getFluidOrGas(800), HotRutheniumTetroxideSollution.getFluidOrGas(1600), 300, 480); + GT_Values.RA.addCrackingRecipe(17, RutheniumTetroxideSollution.getFluidOrGas(1000), null, HotRutheniumTetroxideSollution.getFluidOrGas(2000), 150, 480); + GT_Values.RA.addDistillationTowerRecipe(HotRutheniumTetroxideSollution.getFluidOrGas(9000), new FluidStack[]{ Materials.Water.getFluid(1800), RutheniumTetroxide.getFluidOrGas(7200) - },Materials.Salt.getDust(6),1500,480); - GT_Values.RA.addChemicalRecipe(RutheniumTetroxide.get(dust,1),Materials.HydrochloricAcid.getCells(8),null,Materials.Water.getFluid(2000),Ruthenium.get(dust),Materials.Chlorine.getCells(6),300); + }, Materials.Salt.getDust(6), 1500, 480); + GT_Values.RA.addChemicalRecipe(RutheniumTetroxide.get(dust, 1), Materials.HydrochloricAcid.getCells(8), null, Materials.Water.getFluid(2000), Ruthenium.get(dust), Materials.Chlorine.getCells(6), 300); //Os - GT_Values.RA.addBlastRecipe(IrOsLeachResidue.get(dust,4),GT_Utility.getIntegratedCircuit(11),Materials.HydrochloricAcid.getFluid(1000), AcidicOsmiumSolution.getFluidOrGas(2000), IrLeachResidue.get(dust,2),null,200,120,775); - GT_Values.RA.addDistillationTowerRecipe(AcidicOsmiumSolution.getFluidOrGas(1000),new FluidStack[]{OsmiumSolution.getFluidOrGas(100),Materials.Water.getFluid(900)},null,150,BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addChemicalRecipe(OsmiumSolution.get(cell),Materials.HydrochloricAcid.getCells(8),null,Materials.Water.getFluid(2000),Materials.Osmium.getDust(1),Materials.Chlorine.getCells(6),300); + GT_Values.RA.addBlastRecipe(IrOsLeachResidue.get(dust, 4), GT_Utility.getIntegratedCircuit(11), Materials.HydrochloricAcid.getFluid(1000), AcidicOsmiumSolution.getFluidOrGas(2000), IrLeachResidue.get(dust, 2), null, 200, 120, 775); + GT_Values.RA.addDistillationTowerRecipe(AcidicOsmiumSolution.getFluidOrGas(1000), new FluidStack[]{OsmiumSolution.getFluidOrGas(100), Materials.Water.getFluid(900)}, null, 150, BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addChemicalRecipe(OsmiumSolution.get(cell), Materials.HydrochloricAcid.getCells(8), null, Materials.Water.getFluid(2000), Materials.Osmium.getDust(1), Materials.Chlorine.getCells(6), 300); //Ir - GT_Values.RA.addBlastRecipe(IrLeachResidue.get(dust),GT_Utility.getIntegratedCircuit(1),null, null,PGSDResidue.get(dust),IridiumDioxide.get(dust),200,120,775); - GT_Values.RA.addChemicalRecipe(IridiumDioxide.get(dust),Materials.HydrochloricAcid.getCells(1),null,AcidicIridiumSolution.getFluidOrGas(1000),Materials.Empty.getCells(1),null,300); - GT_Values.RA.addChemicalRecipe(AcidicIridiumSolution.get(cell), AmmoniumChloride.get(cell,3),null,Materials.Ammonia.getGas(3000),Materials.Empty.getCells(4),IridiumChloride.get(dust),300); - GT_Values.RA.addChemicalRecipe(IridiumChloride.get(dust),Materials.Calcium.getDust(3),null,CalciumChloride.getFluidOrGas(3000),PGSDResidue2.get(dust),Materials.Iridium.getDust(1),300,1920); + GT_Values.RA.addBlastRecipe(IrLeachResidue.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, PGSDResidue.get(dust), IridiumDioxide.get(dust), 200, 120, 775); + GT_Values.RA.addChemicalRecipe(IridiumDioxide.get(dust), Materials.HydrochloricAcid.getCells(1), null, AcidicIridiumSolution.getFluidOrGas(1000), Materials.Empty.getCells(1), null, 300); + GT_Values.RA.addChemicalRecipe(AcidicIridiumSolution.get(cell), AmmoniumChloride.get(cell, 3), null, Materials.Ammonia.getGas(3000), Materials.Empty.getCells(4), IridiumChloride.get(dust), 300); + GT_Values.RA.addChemicalRecipe(IridiumChloride.get(dust), Materials.Calcium.getDust(3), null, CalciumChloride.getFluidOrGas(3000), PGSDResidue2.get(dust), Materials.Iridium.getDust(1), 300, 1920); //Rh - GT_Values.RA.addMixerRecipe(RHSulfate.get(cell,5),null,null,null,Materials.Water.getFluid(5000),RHSulfateSolution.getFluidOrGas(5000),LeachResidue.get(dustTiny),300,30); - GT_Values.RA.addChemicalRecipe(Materials.Zinc.getDust(1),null,RHSulfateSolution.getFluidOrGas(1000),null,ZincSulfate.get(dust),CrudeRhMetall.get(dust),300); - GT_Values.RA.addBlastRecipe(CrudeRhMetall.get(dust),Materials.Salt.getDust(1),Materials.Chlorine.getGas(1000),null,RHSalt.get(dust,3),null,300,120,600); - GT_Values.RA.addMixerRecipe(RHSalt.get(dust,10),null,null,null,Materials.Water.getFluid(2000),RHSaltSolution.getFluidOrGas(2000),null,300,30); - GT_Values.RA.addChemicalRecipe(SodiumNitrate.get(dust),GT_Utility.getIntegratedCircuit(1),RHSaltSolution.getFluidOrGas(1000),null,RHNitrate.get(dust),Materials.Salt.getDust(1),300); - GT_Values.RA.addSifterRecipe(RHNitrate.get(dust),new ItemStack[]{ + GT_Values.RA.addMixerRecipe(RHSulfate.get(cell, 5), null, null, null, Materials.Water.getFluid(5000), RHSulfateSolution.getFluidOrGas(5000), LeachResidue.get(dustTiny), 300, 30); + GT_Values.RA.addChemicalRecipe(Materials.Zinc.getDust(1), null, RHSulfateSolution.getFluidOrGas(1000), null, ZincSulfate.get(dust), CrudeRhMetall.get(dust), 300); + GT_Values.RA.addBlastRecipe(CrudeRhMetall.get(dust), Materials.Salt.getDust(1), Materials.Chlorine.getGas(1000), null, RHSalt.get(dust, 3), null, 300, 120, 600); + GT_Values.RA.addMixerRecipe(RHSalt.get(dust, 10), null, null, null, Materials.Water.getFluid(2000), RHSaltSolution.getFluidOrGas(2000), null, 300, 30); + GT_Values.RA.addChemicalRecipe(SodiumNitrate.get(dust), GT_Utility.getIntegratedCircuit(1), RHSaltSolution.getFluidOrGas(1000), null, RHNitrate.get(dust), Materials.Salt.getDust(1), 300); + GT_Values.RA.addSifterRecipe(RHNitrate.get(dust), new ItemStack[]{ RhFilterCake.get(dust), RhFilterCake.get(dust), RhFilterCake.get(dust), @@ -153,16 +170,15 @@ public class PlatinumSludgeOverHaul { RhFilterCake.get(dust), RhFilterCake.get(dust), RhFilterCake.get(dust), - },new int[]{ - 1000,1000,1000,1000,1000,1000,1000,1000,500, - },600,30); - GT_Values.RA.addMixerRecipe(RhFilterCake.get(dust),null,null,null,Materials.Water.getFluid(1000),RHFilterCakeSolution.getFluidOrGas(1000),null,300,30); - GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2),null,RHFilterCakeSolution.getFluidOrGas(1000),null,ReRh.get(dust),null,300); - GT_Values.RA.addChemicalRecipe(ReRh.get(dust),Materials.Empty.getCells(1),Materials.HydrochloricAcid.getFluid(1000),Materials.Chlorine.getGas(1000),Rhodium.get(dust),Materials.Ammonia.getCells(1),300); + }, new int[]{ + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, + }, 600, 30); + GT_Values.RA.addMixerRecipe(RhFilterCake.get(dust), null, null, null, Materials.Water.getFluid(1000), RHFilterCakeSolution.getFluidOrGas(1000), null, 300, 30); + GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), null, RHFilterCakeSolution.getFluidOrGas(1000), null, ReRh.get(dust), null, 300); + GT_Values.RA.addChemicalRecipe(ReRh.get(dust), Materials.Empty.getCells(1), Materials.HydrochloricAcid.getFluid(1000), Materials.Chlorine.getGas(1000), Rhodium.get(dust), Materials.Ammonia.getCells(1), 300); } - - private static boolean materialsContains(Materials one, ISubTagContainer other){ + private static boolean materialsContains(Materials one, ISubTagContainer other) { if (one == null || one.mMaterialList == null || one.mMaterialList.isEmpty()) return false; for (MaterialStack stack : one.mMaterialList) @@ -171,9 +187,8 @@ public class PlatinumSludgeOverHaul { return false; } - - public static void replacePureElements(){ - for (Object entry : FurnaceRecipes.smelting().getSmeltingList().entrySet()){ + public static void replacePureElements() { + for (Object entry : FurnaceRecipes.smelting().getSmeltingList().entrySet()) { Map.Entry realEntry = (Map.Entry) entry; if (GT_Utility.isStackValid(realEntry.getKey()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getKey())) if (!GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dust) && !GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dustTiny)) @@ -184,9 +199,22 @@ public class PlatinumSludgeOverHaul { realEntry.setValue(PDMetallicPowder.get(dust)); } - maploop: for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + for (Object obj : CraftingManager.getInstance().getRecipeList()) { + PlatinumSludgeOverHaul.setnewMaterialInRecipe(obj); + } + try { + for (Object obj : (List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null)) { + PlatinumSludgeOverHaul.setnewMaterialInRecipe(obj); + } + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + + maploop: + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { HashSet toDel = new HashSet(); - recipeloop: for (GT_Recipe recipe : map.mRecipeList) { + recipeloop: + for (GT_Recipe recipe : map.mRecipeList) { if (recipe.mFakeRecipe) continue maploop; for (int i = 0; i < recipe.mFluidOutputs.length; i++) { @@ -196,18 +224,30 @@ public class PlatinumSludgeOverHaul { toDel.add(recipe); else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) + recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); + else if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) + recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); + else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) + recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); } for (int i = 0; i < recipe.mOutputs.length; i++) { if (!GT_Utility.isStackValid(recipe.mOutputs[i])) continue; if (BW_Util.areStacksEqualOrNull(Ruthenium.get(dust), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustImpure), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustPure), recipe.mOutputs[i])) { if (!BW_Util.areStacksEqualOrNull(Ruthenium.get(ingot), recipe.mInputs[0])) { + for (int j = 0; j < recipe.mInputs.length; j++) + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = LeachResidue.get(dust, amount); } } if (BW_Util.areStacksEqualOrNull(Rhodium.get(dust), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Rhodium.get(dustImpure), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Rhodium.get(dustPure), recipe.mOutputs[i])) { if (!BW_Util.areStacksEqualOrNull(Rhodium.get(ingot), recipe.mInputs[0])) { + for (int j = 0; j < recipe.mInputs.length; j++) + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = CrudeRhMetall.get(dust, amount); } @@ -217,9 +257,8 @@ public class PlatinumSludgeOverHaul { //Pt if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Platinum)) { for (int j = 0; j < recipe.mInputs.length; j++) { - if (BW_Util.checkStackAndPrefix(recipe.mInputs[j])) - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; } // if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { // int amount = recipe.mOutputs[i].stackSize; @@ -237,9 +276,8 @@ public class PlatinumSludgeOverHaul { } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Palladium)) { for (int j = 0; j < recipe.mInputs.length; j++) { - if (BW_Util.checkStackAndPrefix(recipe.mInputs[j])) - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; } // if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { // int amount = recipe.mOutputs[i].stackSize; @@ -257,9 +295,8 @@ public class PlatinumSludgeOverHaul { } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Osmium)) { for (int j = 0; j < recipe.mInputs.length; j++) { - if (BW_Util.checkStackAndPrefix(recipe.mInputs[j])) - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; } // if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { // int amount = recipe.mOutputs[i].stackSize; @@ -277,9 +314,8 @@ public class PlatinumSludgeOverHaul { } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Iridium)) { for (int j = 0; j < recipe.mInputs.length; j++) { - if (BW_Util.checkStackAndPrefix(recipe.mInputs[j])) - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; } // if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { // int amount = recipe.mOutputs[i].stackSize; @@ -303,56 +339,64 @@ public class PlatinumSludgeOverHaul { PlatinumSludgeOverHaul.runHelperrecipes(); } - private static final OrePrefixes[] OPWHITELIST = { - dust, - dustTiny, - dustSmall, - dustPure, - dustImpure, - dustRefined, - crateGtDust, - ore, - oreBasalt, - oreBlackgranite, - oreDense, - oreEnd, - oreEndstone, - oreMarble, - oreNether, - oreNetherrack, - oreNormal, - orePoor, - oreRedgranite, - oreRich, - oreSmall, - oreGem, - denseore, - crushed, - crushedPurified, - crushedCentrifuged, - gem, - gemFlawed, - gemExquisite, - gemFlawless, - gemChipped, - crateGtGem, - }; - - private static final Materials[] BLACKLIST = { - Materials.HSSS, - Materials.EnderiumBase, - Materials.Osmiridium, - Materials.get("Uraniumtriplatinid"), - Materials.get("Tetranaquadahdiindiumhexaplatiumosminid"), - Materials.get("Longasssuperconductornameforuvwire"), - }; + private static void setnewMaterialInRecipe(Object obj){ + if (!(obj instanceof GT_Shaped_Recipe)) + return; + GT_Shaped_Recipe recipe = (GT_Shaped_Recipe) obj; + ItemStack otpt = recipe.getRecipeOutput(); + if (!BW_Util.checkStackAndPrefix(otpt)) + return; + Field out = FieldUtils.getDeclaredField(recipe.getClass(), "output", true); + if (out != null && GT_OreDictUnificator.getAssociation(otpt).mMaterial.mMaterial.equals(Materials.Platinum) && GT_OreDictUnificator.getAssociation(otpt).mPrefix == dust) { + try { + out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + else if (out != null && GT_OreDictUnificator.getAssociation(otpt).mMaterial.mMaterial.equals(Materials.Palladium) && GT_OreDictUnificator.getAssociation(otpt).mPrefix == dust) { + try { + out.set(recipe, PDMetallicPowder.get(dust, otpt.stackSize)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + else if (out != null && GT_OreDictUnificator.getAssociation(otpt).mMaterial.mMaterial.equals(Materials.Iridium) && GT_OreDictUnificator.getAssociation(otpt).mPrefix == dust) { + try { + out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize * 2)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + else if (out != null && GT_OreDictUnificator.getAssociation(otpt).mMaterial.mMaterial.equals(Materials.Osmium) && GT_OreDictUnificator.getAssociation(otpt).mPrefix == dust) { + try { + out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize * 4)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + } - private static boolean isInBlackList(ItemStack stack){ - if (!BW_Util.checkStackAndPrefix(stack)) - return false; + private static boolean isInBlackList(ItemStack stack) { if (stack.getItem() instanceof BW_MetaGenerated_Items) return true; - for (Materials m : PlatinumSludgeOverHaul.BLACKLIST){ + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(MainMod.MOD_ID)) + return true; + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(BartWorksCrossmod.MOD_ID)) + return true; + if (Loader.isModLoaded("miscutils")) { + try { + if (Class.forName("gtPlusPlus.core.item.base.BaseItemComponent").isAssignableFrom(stack.getItem().getClass()) && !(stack.getUnlocalizedName().contains("dust") || stack.getUnlocalizedName().contains("Dust"))) + return true; + if (Class.forName("gtPlusPlus.core.block.base.BlockBaseModular").isAssignableFrom(Block.getBlockFromItem(stack.getItem()).getClass())) + return true; + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + } + if (!BW_Util.checkStackAndPrefix(stack)) + return false; + for (Materials m : PlatinumSludgeOverHaul.BLACKLIST) { if (GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial.equals(m)) return true; } -- cgit From 5bdde6428dda70b8fbe60f41a06200adb4a9d2c1 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 8 Sep 2019 11:16:32 +0200 Subject: fixed bugs +added crafting meta items +added multiple ingot neta items +fixed LuV Tier recipe changer +smaller visual fixes +smaller recipe fixes Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: d6e740bf94c3c1d79aa9b3368cf84ae32fafce64 --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 2 + .../bartworks/system/material/Werkstoff.java | 9 +- .../bartworks/system/material/WerkstoffLoader.java | 153 +++++++++++--- .../processingLoaders/AdditionalRecipes.java | 233 ++++++++++----------- .../processingLoaders/PlatinumSludgeOverHaul.java | 6 +- 6 files changed, 256 insertions(+), 149 deletions(-) diff --git a/build.properties b/build.properties index 74c884604a..883ba16c79 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre5 +buildNumber=2_pre6 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 832b37716c..c05c14ced6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -42,6 +42,7 @@ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.Circ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader; import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.PlatinumSludgeOverHaul; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; @@ -202,6 +203,7 @@ public final class MainMod { MainMod.editRecipes(toChange, noGas); } PlatinumSludgeOverHaul.replacePureElements(); + //new AdditionalRecipes.LuVHullReplacer(); new CircuitImprintLoader().run(); if (classicMode) new DownTierLoader().run(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 3ece0e03d3..612e6a4a4e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -520,7 +520,14 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public boolean hasSimpleMetalWorkingItems() { return (this.toGenerate & 0b10000000) != 0; } - + public Werkstoff.GenerationFeatures addCraftingMetalWorkingItems() { + this.toGenerate = (byte) (this.toGenerate | 0b100000000); + return this; + } + public Werkstoff.GenerationFeatures addMultipleIngotMetalWorkingItems() { + this.toGenerate = (byte) (this.toGenerate | 0b10000000); + return this; + } } public static class Stats { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 157b5ca643..a36a32f986 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -33,6 +33,7 @@ import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import cpw.mods.fml.client.registry.RenderingRegistry; @@ -79,7 +80,14 @@ public class WerkstoffLoader implements Runnable { public static final SubTag NOBLE_GAS = SubTag.getNewSubTag("NobleGas"); public static final SubTag ANAEROBE_GAS = SubTag.getNewSubTag("AnaerobeGas"); public static final SubTag ANAEROBE_SMELTING = SubTag.getNewSubTag("AnaerobeSmelting"); + public static final SubTag NOBLE_GAS_SMELTING = SubTag.getNewSubTag("NobleGasSmelting"); public static OrePrefixes cellMolten; + public static ItemList rotorMold; + public static ItemList rotorShape; + public static ItemList smallGearShape; + public static ItemList ringMold; + public static ItemList boltMold; + static { for (OrePrefixes prefix : OrePrefixes.values()){ @@ -92,6 +100,13 @@ public class WerkstoffLoader implements Runnable { } else { WerkstoffLoader.cellMolten.mMaterialGenerationBits = 0b1000000; } + try { + WerkstoffLoader.rotorMold = Enum.valueOf(ItemList.class, "Shape_Mold_Rotor"); + WerkstoffLoader.rotorShape = Enum.valueOf(ItemList.class, "Shape_Extruder_Rotor"); + WerkstoffLoader.smallGearShape = Enum.valueOf(ItemList.class, "Shape_Extruder_Small_Gear"); + WerkstoffLoader.ringMold = Enum.valueOf(ItemList.class, "Shape_Mold_Ring"); + WerkstoffLoader.boltMold = Enum.valueOf(ItemList.class, "Shape_Mold_Bolt"); + }catch (NullPointerException | IllegalArgumentException e){} } //TODO: FREE ID RANGE: 19-32766 @@ -745,7 +760,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff PTRawPowder = new Werkstoff( Materials.Platinum.getRGBA(), - "Reprecipated Platinum", + "Reprecipitated Platinum", "PtCl", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -781,7 +796,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff PDRawPowder = new Werkstoff( Materials.Palladium.getRGBA(), - "Reprecipated Palladium", + "Reprecipitated Palladium", subscriptNumbers("Pd2NH4"), new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -1159,7 +1174,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff ReRh = new Werkstoff( new short[]{0x77, 0x66, 0x49}, - "Reprecipated Rhodium", + "Reprecipitated Rhodium", subscriptNumbers("Rh2NH4"), new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -1172,7 +1187,7 @@ public class WerkstoffLoader implements Runnable { "Rhodium-Plated Palladium", new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500), Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems(), + new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), 88, TextureSet.SET_METALLIC, new Pair<>(Materials.Palladium,3), @@ -1259,6 +1274,10 @@ public class WerkstoffLoader implements Runnable { this.addMoltenRecipes(werkstoff); DebugLog.log("Loading Simple MetalWorking Recipes"+" " +(System.nanoTime()-timepreone)); this.addSimpleMetalRecipes(werkstoff); + DebugLog.log("Loading Crafting MetalWorking Recipes"+" " +(System.nanoTime()-timepreone)); + this.addCraftingMetalRecipes(werkstoff); + DebugLog.log("Loading MultipleIngots MetalWorking Recipes"+" " +(System.nanoTime()-timepreone)); + this.addMultipleMetalRecipes(werkstoff); if (Loader.isModLoaded("Thaumcraft")) { DebugLog.log("Loading Aspects"+" " +(System.nanoTime()-timepreone)); ThaumcraftHandler.AspectAdder.addAspectToAll(werkstoff); @@ -1290,6 +1309,8 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.Calcium.add(WerkstoffLoader.ANAEROBE_SMELTING); + WerkstoffLoader.LuVTierMaterial.add(WerkstoffLoader.NOBLE_GAS_SMELTING); + //Calcium Smelting block Materials.Calcium.mBlastFurnaceRequired=true; @@ -1359,26 +1380,6 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.items.put(ingot, new BW_MetaGenerated_Items(ingot)); WerkstoffLoader.items.put(ingotHot, new BW_MetaGenerated_Items(ingotHot)); //1750 WerkstoffLoader.items.put(nugget, new BW_MetaGenerated_Items(nugget)); - - - -// WerkstoffLoader.items.put(gearGt, new BW_MetaGenerated_Items(gearGt)); -// WerkstoffLoader.items.put(gearGtSmall, new BW_MetaGenerated_Items(gearGtSmall)); -// WerkstoffLoader.items.put(bolt, new BW_MetaGenerated_Items(bolt)); -// WerkstoffLoader.items.put(screw, new BW_MetaGenerated_Items(screw)); -// WerkstoffLoader.items.put(ring, new BW_MetaGenerated_Items(ring)); -// WerkstoffLoader.items.put(spring, new BW_MetaGenerated_Items(spring)); -// WerkstoffLoader.items.put(springSmall, new BW_MetaGenerated_Items(springSmall)); -// -// WerkstoffLoader.items.put(plateDouble, new BW_MetaGenerated_Items(plateDouble)); -// WerkstoffLoader.items.put(plateTriple, new BW_MetaGenerated_Items(plateTriple)); -// WerkstoffLoader.items.put(plateQuadruple, new BW_MetaGenerated_Items(plateQuadruple)); -// WerkstoffLoader.items.put(plateQuintuple, new BW_MetaGenerated_Items(plateQuintuple)); -// WerkstoffLoader.items.put(plateDense, new BW_MetaGenerated_Items(plateDense)); -// WerkstoffLoader.items.put(ingotDouble, new BW_MetaGenerated_Items(ingotDouble)); -// WerkstoffLoader.items.put(ingotTriple, new BW_MetaGenerated_Items(ingotTriple)); -// WerkstoffLoader.items.put(ingotQuadruple, new BW_MetaGenerated_Items(ingotQuadruple)); -// WerkstoffLoader.items.put(ingotQuintuple, new BW_MetaGenerated_Items(ingotQuintuple)); } if ((WerkstoffLoader.toGenerateGlobal & 0b100) != 0) { WerkstoffLoader.items.put(gem, new BW_MetaGenerated_Items(gem)); @@ -1406,14 +1407,34 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.items.put(cellPlasma, new BW_MetaGenerated_Items(cellPlasma)); } if ((WerkstoffLoader.toGenerateGlobal & 0b1000000) != 0) { - WerkstoffLoader.items.put(cellMolten, new BW_MetaGenerated_Items(cellMolten)); + WerkstoffLoader.items.put(WerkstoffLoader.cellMolten, new BW_MetaGenerated_Items(WerkstoffLoader.cellMolten)); } if ((WerkstoffLoader.toGenerateGlobal & 0b10000000) != 0) { WerkstoffLoader.items.put(plate, new BW_MetaGenerated_Items(plate)); WerkstoffLoader.items.put(stick, new BW_MetaGenerated_Items(stick)); WerkstoffLoader.items.put(stickLong, new BW_MetaGenerated_Items(stickLong)); } - + if ((WerkstoffLoader.toGenerateGlobal & 0b100000000) != 0) { + WerkstoffLoader.items.put(gearGt, new BW_MetaGenerated_Items(gearGt)); + WerkstoffLoader.items.put(gearGtSmall, new BW_MetaGenerated_Items(gearGtSmall)); + WerkstoffLoader.items.put(bolt, new BW_MetaGenerated_Items(bolt)); + WerkstoffLoader.items.put(screw, new BW_MetaGenerated_Items(screw)); + WerkstoffLoader.items.put(ring, new BW_MetaGenerated_Items(ring)); + WerkstoffLoader.items.put(spring, new BW_MetaGenerated_Items(spring)); + WerkstoffLoader.items.put(springSmall, new BW_MetaGenerated_Items(springSmall)); + WerkstoffLoader.items.put(rotor, new BW_MetaGenerated_Items(rotor)); + } + if ((WerkstoffLoader.toGenerateGlobal & 0b1000000000) != 0) { + WerkstoffLoader.items.put(plateDouble, new BW_MetaGenerated_Items(plateDouble)); + WerkstoffLoader.items.put(plateTriple, new BW_MetaGenerated_Items(plateTriple)); + WerkstoffLoader.items.put(plateQuadruple, new BW_MetaGenerated_Items(plateQuadruple)); + WerkstoffLoader.items.put(plateQuintuple, new BW_MetaGenerated_Items(plateQuintuple)); + WerkstoffLoader.items.put(plateDense, new BW_MetaGenerated_Items(plateDense)); + WerkstoffLoader.items.put(ingotDouble, new BW_MetaGenerated_Items(ingotDouble)); + WerkstoffLoader.items.put(ingotTriple, new BW_MetaGenerated_Items(ingotTriple)); + WerkstoffLoader.items.put(ingotQuadruple, new BW_MetaGenerated_Items(ingotQuadruple)); + WerkstoffLoader.items.put(ingotQuintuple, new BW_MetaGenerated_Items(ingotQuintuple)); + } } @@ -1470,6 +1491,10 @@ public class WerkstoffLoader implements Runnable { if (((RecipeInputOreDict) curr.getKey()).input.equalsIgnoreCase("oreNULL")) { remset.add(curr); } + for (ItemStack stack : curr.getValue().items){ + if (stack.getItem() instanceof BW_MetaGenerated_Items) + remset.add(curr); + } } } Recipes.macerator.getRecipes().entrySet().removeAll(remset); @@ -1579,6 +1604,7 @@ public class WerkstoffLoader implements Runnable { GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{werkstoff.get(ingot),GT_Utility.getIntegratedCircuit(1)},new ItemStack[]{werkstoff.get(plate)},null,null,null,null, (int) Math.max(werkstoff.getStats().getMass(), 1L), 24,0)); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ingot,3), werkstoff.get(plate,2), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); + GregTech_API.registerCover(werkstoff.get(plate), new GT_RenderedTexture(werkstoff.getTexSet().mTextures[71], werkstoff.getRGBA(), false), null); GT_Values.RA.addLatheRecipe(werkstoff.get(ingot), werkstoff.get(stick), werkstoff.get(dustSmall), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); @@ -1586,6 +1612,78 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot),ItemList.Shape_Extruder_Plate.get(0),werkstoff.get(plate),(int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot),ItemList.Shape_Extruder_Rod.get(0),werkstoff.get(stick,2),(int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); + + GT_Values.RA.addPulveriserRecipe(werkstoff.get(ingot),new ItemStack[]{werkstoff.get(dust)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate),new ItemStack[]{werkstoff.get(dust)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(stickLong),new ItemStack[]{werkstoff.get(dust)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(stick),new ItemStack[]{werkstoff.get(dustSmall,2)},null,2,8); + } + } + + private void addCraftingMetalRecipes(Werkstoff werkstoff) { + if ((werkstoff.getGenerationFeatures().toGenerate & 0b100000000) != 0) { + int tVoltageMultiplier = werkstoff.getStats().meltingPoint >= 2800 ? 60 : 15; + + //bolt + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Bolt.get(0L), werkstoff.get(bolt,8), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 8 * tVoltageMultiplier); + GT_Values.RA.addCutterRecipe(werkstoff.get(stick), werkstoff.get(bolt,4), null, (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 4); + + //screw + GT_Values.RA.addLatheRecipe(werkstoff.get(bolt), werkstoff.get(screw),null, (int) Math.max(werkstoff.getStats().getMass() / 8L, 1L), 4); + GT_ModHandler.addCraftingRecipe(werkstoff.get(screw), GT_Proxy.tBits, new Object[]{"fX", "X ", 'X', werkstoff.get(bolt)}); + + //ring + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Ring.get(0L), werkstoff.get(ring,4), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 6 * tVoltageMultiplier); + GT_ModHandler.addCraftingRecipe(werkstoff.get(ring), GT_Proxy.tBits, new Object[]{"h ", "fX", 'X', werkstoff.get(stick)}); + + //Gear + GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGt), GT_Proxy.tBits, new Object[]{"SPS", "PwP", "SPS", 'P', werkstoff.get(plate), 'S', werkstoff.get(stick)}); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot,4), ItemList.Shape_Extruder_Gear.get(0L), werkstoff.get(gearGt), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1), 8 * tVoltageMultiplier); + + //smallGear + if (WerkstoffLoader.smallGearShape != null) + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), WerkstoffLoader.smallGearShape.get(0L), werkstoff.get(gearGtSmall), (int) werkstoff.getStats().mass, 8 * tVoltageMultiplier); + if (ConfigHandler.GTNH) + GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{" S ", "hPx"," S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate)}); + else + GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{"P "," h ", 'P', werkstoff.get(plate)}); + + //Rotor + GT_ModHandler.addCraftingRecipe(werkstoff.get(rotor), GT_Proxy.tBits, new Object[]{"PhP", "SRf", "PdP", 'P', werkstoff.get(plate), 'R', werkstoff.get(ring), 'S', werkstoff.get(screw)}); + GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate,4), werkstoff.get(ring), Materials.Tin.getMolten(32), werkstoff.get(rotor), 240, 24); + GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate,4), werkstoff.get(ring), Materials.Lead.getMolten(48), werkstoff.get(rotor), 240, 24); + GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate,4), werkstoff.get(ring), Materials.SolderingAlloy.getMolten(16), werkstoff.get(rotor), 240, 24); + + if (WerkstoffLoader.rotorShape != null) + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot,5), WerkstoffLoader.rotorShape.get(0L), werkstoff.get(rotor), 200, 60); + + //molten -> metal + if (werkstoff.getGenerationFeatures().hasMolten()) { + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear.get(0L), werkstoff.getMolten(576), werkstoff.get(gearGt), 128, 8); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear_Small.get(0L), werkstoff.getMolten(144), werkstoff.get(gearGtSmall), 16, 8); + if (WerkstoffLoader.ringMold != null) + GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.ringMold.get(0L), werkstoff.getMolten(36), werkstoff.get(ring), 100, 4 * tVoltageMultiplier); + if (WerkstoffLoader.boltMold != null) + GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.boltMold.get(0L), werkstoff.getMolten(18), werkstoff.get(bolt), 50, 2 * tVoltageMultiplier); + + if (WerkstoffLoader.rotorMold != null) + GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.rotorMold.get(0L), werkstoff.getMolten(612), werkstoff.get(rotor), 100, 60); + } + + GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGt),new ItemStack[]{werkstoff.get(dust,4)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGtSmall),new ItemStack[]{werkstoff.get(dust,1)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(rotor),new ItemStack[]{werkstoff.get(dust,4),werkstoff.get(dustSmall)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(bolt),new ItemStack[]{werkstoff.get(dustTiny,1)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(screw),new ItemStack[]{werkstoff.get(dustTiny,1)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(ring),new ItemStack[]{werkstoff.get(dustSmall,1)},null,2,8); + } + } + + private void addMultipleMetalRecipes(Werkstoff werkstoff){ + if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000000000) != 0) { + GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{werkstoff.get(ingot),GT_Utility.getIntegratedCircuit(2)},new ItemStack[]{werkstoff.get(plateDouble)},null,null,null,null, (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), 60,0)); + GregTech_API.registerCover(werkstoff.get(plateDouble), new GT_RenderedTexture(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false), null); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(plateDouble),new ItemStack[]{werkstoff.get(dust,2)},null,2,8); } } @@ -1702,6 +1800,9 @@ public class WerkstoffLoader implements Runnable { if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)){ GT_Values.RA.addBlastRecipe(werkstoff.get(dust),GT_Utility.getIntegratedCircuit(11),Materials.Nitrogen.getGas(1000),null,werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot),null,(int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); } + else if (werkstoff.contains(WerkstoffLoader.NOBLE_GAS_SMELTING)) { + GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), WerkstoffLoader.Neon.getFluidOrGas(1000), null, werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); + } else { GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); if (werkstoff.getStats().meltingPoint <= 1000) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 0dfd487d20..ea6e5722de 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -28,6 +28,8 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import cpw.mods.fml.common.Loader; +import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.ItemData; @@ -40,10 +42,15 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import org.apache.commons.lang3.reflect.FieldUtils; +import org.apache.commons.lang3.reflect.MethodUtils; import sun.reflect.FieldInfo; +import java.lang.reflect.Array; import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Map; @@ -124,139 +131,127 @@ public class AdditionalRecipes implements Runnable { Materials.SolderingAlloy.getMolten((i + 1) * 144) }, null, (i + 1) * 1500, BW_Util.getMachineVoltageFromTier(i + 1), CLEANROOM)); } - AdditionalRecipes.replaceLuVHull(); + GregTech_API.sAfterGTPostload.add(new AdditionalRecipes.LuVHullReplacer()); AdditionalRecipes.oldGThelperMethod(); } - private static void replaceLuVHull(){ - Object toRemove = null; - for (Object obj : CraftingManager.getInstance().getRecipeList()) { - if (!(obj instanceof GT_Shaped_Recipe)) - continue; - if (BW_Util.areStacksEqualOrNull(((GT_Shaped_Recipe) obj).getRecipeOutput(), ItemList.Casing_LuV.get(1))) { - toRemove = obj; - break; - } - } - CraftingManager.getInstance().getRecipeList().remove(toRemove); - toRemove = null; - List bufferedRecipeList = null; - try { - bufferedRecipeList = (List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - assert bufferedRecipeList != null; - for (Object obj : bufferedRecipeList) { - if (!(obj instanceof GT_Shaped_Recipe)) - continue; - if (BW_Util.areStacksEqualOrNull(((GT_Shaped_Recipe) obj).getRecipeOutput(), ItemList.Casing_LuV.get(1))) { - toRemove = obj; - break; - } - } - bufferedRecipeList.remove(toRemove); - try { - Map map = (Map) FieldUtils.getDeclaredField(GT_OreDictUnificator.class, "sItemStack2DataMap", true).get(null); - ItemData data = map.get(new GT_ItemStack(ItemList.Casing_LuV.get(1))); - data.mMaterial.mMaterial = WerkstoffLoader.LuVTierMaterial.getBridgeMaterial(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - GT_ModHandler.addCraftingRecipe(ItemList.Casing_LuV.get(1), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, new Object[]{"PPP", "PwP", "PPP", 'P', WerkstoffLoader.LuVTierMaterial.get(plate)}); - for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings){ - for (GT_Recipe recipe : map.mRecipeList){ - - if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,ItemList.Casing_LuV.get(1),false)) - AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,GT_OreDictUnificator.get(plate,Materials.Chrome,1),true,WerkstoffLoader.LuVTierMaterial.get(plate)); - if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mOutputs,ItemList.Casing_LuV.get(1),false)) - AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,GT_OreDictUnificator.get(plate,Materials.Chrome,1),true,WerkstoffLoader.LuVTierMaterial.get(plate)); - - if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,ItemList.Hull_LuV.get(1),false)) - AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,GT_OreDictUnificator.get(plate,Materials.Chrome,1),true,WerkstoffLoader.LuVTierMaterial.get(plate)); - if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mOutputs,ItemList.Hull_LuV.get(1),false)) - AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,GT_OreDictUnificator.get(plate,Materials.Chrome,1),true,WerkstoffLoader.LuVTierMaterial.get(plate)); - - if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,ItemList.Casing_LuV.get(1),false)) - AdditionalRecipes.doStacksCointainAndReplace(recipe.mFluidInputs,Materials.Chrome.getMolten(1),true,WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mOutputs,ItemList.Casing_LuV.get(1),false)) - AdditionalRecipes.doStacksCointainAndReplace(recipe.mFluidInputs,Materials.Chrome.getMolten(1),true,WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,ItemList.Casing_LuV.get(1),false)) - AdditionalRecipes.doStacksCointainAndReplace(recipe.mFluidOutputs,Materials.Chrome.getMolten(1),true,WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mOutputs,ItemList.Casing_LuV.get(1),false)) - AdditionalRecipes.doStacksCointainAndReplace(recipe.mFluidOutputs,Materials.Chrome.getMolten(1),true,WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - - if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,ItemList.Hull_LuV.get(1),false)) - AdditionalRecipes.doStacksCointainAndReplace(recipe.mFluidInputs,Materials.Chrome.getMolten(1),true,WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mOutputs,ItemList.Hull_LuV.get(1),false)) - AdditionalRecipes.doStacksCointainAndReplace(recipe.mFluidInputs,Materials.Chrome.getMolten(1),true,WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mInputs,ItemList.Hull_LuV.get(1),false)) - AdditionalRecipes.doStacksCointainAndReplace(recipe.mFluidOutputs,Materials.Chrome.getMolten(1),true,WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - if (AdditionalRecipes.doStacksCointainAndReplace(recipe.mOutputs,ItemList.Hull_LuV.get(1),false)) - AdditionalRecipes.doStacksCointainAndReplace(recipe.mFluidOutputs,Materials.Chrome.getMolten(1),true,WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + public static class LuVHullReplacer implements Runnable { + public void run() { + List bufferedRecipeList = null; + try { + bufferedRecipeList = (List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null); + } catch (IllegalAccessException e) { + e.printStackTrace(); } - } + assert bufferedRecipeList != null; - for (Object obj : CraftingManager.getInstance().getRecipeList()) { - if (!(obj instanceof GT_Shaped_Recipe)) - continue; - if (BW_Util.areStacksEqualOrNull(((GT_Shaped_Recipe) obj).getRecipeOutput(), ItemList.Hull_LuV.get(1))) { - toRemove = obj;//AdditionalRecipes.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(),GT_OreDictUnificator.get(plate,Materials.Chrome,1),true,WerkstoffLoader.LuVTierMaterial.get(plate)); - break; + HashSet LuVMachines = new HashSet<>(); + OrePrefixes[] LuVMaterialsGenerated = {dust, ingot, plate, stick, stickLong, rotor, plateDouble, plateDense}; + for (ItemList item : ItemList.values()) { + if (item.toString().contains("LuV") && item.hasBeenSet()) + LuVMachines.add(item.get(1)); } - } - CraftingManager.getInstance().getRecipeList().remove(toRemove); - for (Object obj : bufferedRecipeList) { - if (!(obj instanceof GT_Shaped_Recipe)) - continue; - if (BW_Util.areStacksEqualOrNull(((GT_Shaped_Recipe) obj).getRecipeOutput(), ItemList.Hull_LuV.get(1))) { - toRemove = obj;//AdditionalRecipes.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(),GT_OreDictUnificator.get(plate,Materials.Chrome,1),true,WerkstoffLoader.LuVTierMaterial.get(plate)); - break; + if (Loader.isModLoaded("dreamcraft")) { + try { + Class customItemListClass = Class.forName("com.dreammaster.gthandler.CustomItemList"); + Method hasnotBeenSet = MethodUtils.getAccessibleMethod(customItemListClass, "hasBeenSet"); + Method get = MethodUtils.getAccessibleMethod(customItemListClass, "get", long.class, Object[].class); + for (Enum customItemList : (Enum[]) FieldUtils.getField(customItemListClass, "$VALUES", true).get(null)) { + if (customItemList.toString().contains("LuV") && (boolean) hasnotBeenSet.invoke(customItemList)) + LuVMachines.add((ItemStack) get.invoke(customItemList, 1, new Object[0])); + } + } catch (IllegalAccessException | ClassNotFoundException | InvocationTargetException e) { + e.printStackTrace(); + } + } + GT_ModHandler.addCraftingRecipe(ItemList.Casing_LuV.get(1), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, new Object[]{"PPP", "PwP", "PPP", 'P', WerkstoffLoader.LuVTierMaterial.get(plate)}); + for (ItemStack stack : LuVMachines) { + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + for (GT_Recipe recipe : map.mRecipeList) { + for (OrePrefixes prefixes : LuVMaterialsGenerated) { + if (AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { + AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + if (AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { + AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + } + if (AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { + AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + } + if (AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { + AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + } + } + } + for (OrePrefixes prefixes : LuVMaterialsGenerated) { + for (Object obj : CraftingManager.getInstance().getRecipeList()) { + if (!(obj instanceof GT_Shaped_Recipe)) + continue; + if (GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true)) { + AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(), GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + } + for (Object obj : bufferedRecipeList) { + if (!(obj instanceof GT_Shaped_Recipe)) + continue; + if (GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true)) { + AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(), GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + } + } } - } - bufferedRecipeList.remove(toRemove); - try { - Map map = (Map) FieldUtils.getDeclaredField(GT_OreDictUnificator.class, "sItemStack2DataMap", true).get(null); - ItemData data = map.get(new GT_ItemStack(ItemList.Hull_LuV.get(1))); - data.mMaterial.mMaterial = WerkstoffLoader.LuVTierMaterial.getBridgeMaterial(); - } catch (IllegalAccessException e) { - e.printStackTrace(); } - GT_ModHandler.addCraftingRecipe(ItemList.Hull_LuV.get(1), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, new Object[]{"KPK", "CHC", 'P', WerkstoffLoader.LuVTierMaterial.get(plate), 'K',Materials.Polytetrafluoroethylene.getPlates(1), 'C', GT_OreDictUnificator.get(cableGt01, Materials.VanadiumGallium,1L), 'H',ItemList.Casing_LuV}); - } - private static boolean doStacksCointainAndReplace(FluidStack[] stacks, FluidStack stack, boolean replace, Fluid... replacement){ - boolean replaced = false; - for (int i = 0; i < stacks.length; i++) { - if (GT_Utility.areFluidsEqual(stack, stacks[i])) - if (!replace) - return true; - else { - int amount = stacks[i].amount; - stacks[i] = new FluidStack(replacement[0],amount); - replaced = true; - } + private static boolean doStacksCointainAndReplace(FluidStack[] stacks, FluidStack stack, boolean replace, Fluid... replacement) { + boolean replaced = false; + for (int i = 0; i < stacks.length; i++) { + if (GT_Utility.areFluidsEqual(stack, stacks[i])) + if (!replace) + return true; + else { + int amount = stacks[i].amount; + stacks[i] = new FluidStack(replacement[0], amount); + replaced = true; + } + } + return replaced; } - return replaced; - } - private static boolean doStacksCointainAndReplace(Object[] stacks, ItemStack stack, boolean replace, ItemStack... replacement){ - boolean replaced = false; - for (int i = 0; i < stacks.length; i++) { - if (!GT_Utility.isStackValid(stacks[i])){ - continue; + + private static boolean doStacksCointainAndReplace(Object[] stacks, ItemStack stack, boolean replace, ItemStack... replacement) { + boolean replaced = false; + for (int i = 0; i < stacks.length; i++) { + if (!GT_Utility.isStackValid(stacks[i])) { + if (stacks[i] instanceof ArrayList && ((ArrayList)stacks[i]).size() > 0) { + if (GT_Utility.areStacksEqual(stack, (ItemStack) ((ArrayList)stacks[i]).get(0), true)) + if (!replace) + return true; + else { + int amount = ((ItemStack) ((ArrayList)stacks[i]).get(0)).stackSize; + stacks[i] = new ArrayList<>(); + ((ArrayList)stacks[i]).add(replacement[0].splitStack(amount)); + replaced = true; + } + + } else + continue; + } else if (GT_Utility.areStacksEqual(stack, (ItemStack) stacks[i], true)) + if (!replace) + return true; + else { + int amount = ((ItemStack) stacks[i]).stackSize; + stacks[i] = replacement[0].splitStack(amount); + replaced = true; + } } - else if (GT_Utility.areStacksEqual(stack, (ItemStack) stacks[i])) - if (!replace) - return true; - else { - stacks[i] = replacement[0]; - replaced = true; - } + return replaced; } - return replaced; } - private static void oldGThelperMethod(){ //manual override for older GT Werkstoff werkstoff = WerkstoffLoader.Oganesson; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java index 0f45f7ceec..2a56658e81 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java @@ -71,9 +71,11 @@ public class PlatinumSludgeOverHaul { //FormicAcid GT_Values.RA.addChemicalRecipe(Materials.CarbonMonoxide.getCells(1), Materials.SodiumHydroxide.getDust(1), null, null, Sodiumformate.get(cell), null, 15); GT_Values.RA.addChemicalRecipe(Sodiumformate.get(cell, 2), GT_Utility.getIntegratedCircuit(1), Materials.SulfuricAcid.getFluid(1000), null, FormicAcid.get(cell, 2), Sodiumsulfate.get(dust), 15); - GT_Values.RA.addChemicalRecipe(Materials.SulfuricAcid.getCells(2), GT_Utility.getIntegratedCircuit(1), Sodiumformate.getFluidOrGas(1000), FormicAcid.getFluidOrGas(2000), Materials.Empty.getCells(2), Sodiumsulfate.get(dust), 15); + GT_Values.RA.addChemicalRecipe(Materials.SulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Sodiumformate.getFluidOrGas(2000), FormicAcid.getFluidOrGas(2000), Materials.Empty.getCells(1), Sodiumsulfate.get(dust), 15); //AquaRegia GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, AquaRegia.get(cell, 2), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(2), null, null, AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(2), 30, 30); + //AmmoniumCloride GT_Values.RA.addChemicalRecipe(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.HydrochloricAcid.getFluid(1000), null, AmmoniumChloride.get(cell, 1), null, 15); GT_Values.RA.addChemicalRecipe(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), AmmoniumChloride.getFluidOrGas(1000), Materials.Empty.getCells(1), null, 15); @@ -128,7 +130,7 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{PDRawPowder.get(dust, 2)}, new FluidStack[]{FormicAcid.getFluidOrGas(4000)}, new FluidStack[]{Materials.Ammonia.getGas(2000), Materials.Ethylene.getGas(1000), Materials.Water.getFluid(1000)}, new ItemStack[]{Materials.Palladium.getDust(2)}, 250, 30); GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust, 2), Materials.Hydrogen.getCells(1), null, Materials.SulfuricAcid.getFluid(2000), Materials.Sodium.getDust(1), Materials.Empty.getCells(3), 30); //K2S2O7 - GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust), Materials.Empty.getCells(1), 30); + GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust), null, 30); //Rh/Os/Ir/Ru GT_Values.RA.addBlastRecipe(PTResidue.get(dust), GT_Utility.getIntegratedCircuit(11), PotassiumDisulfate.getMolten(1440), RHSulfate.getFluidOrGas(1440), LeachResidue.get(dust), null, 200, 120, 775); -- cgit From 033df977c4ecdd80777718fc42ec994b02ab2029 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 9 Sep 2019 15:47:43 +0200 Subject: rebalanced PlatinumStuff +fixed some recipes Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: b911c3a4b8b6a94cbd6f40b4d7ad4619b02dce72 --- build.properties | 2 +- .../bartimaeusnek/bartworks/API/WerkstoffAPI.java | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 4 +- .../bartworks/system/material/Werkstoff.java | 24 +++- .../bartworks/system/material/WerkstoffLoader.java | 158 ++++++++++++--------- .../processingLoaders/PlatinumSludgeOverHaul.java | 65 +++++---- 6 files changed, 149 insertions(+), 106 deletions(-) diff --git a/build.properties b/build.properties index 883ba16c79..55ea1bf87a 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre6 +buildNumber=2_pre7 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java index a441e38e35..397d949e77 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java @@ -28,7 +28,7 @@ public final class WerkstoffAPI { public Werkstoff getWerkstoff(String aName) throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException { Class w = Class.forName("com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader"); - return (Werkstoff) w.getField(aName).get(w); + return (Werkstoff) w.getField(aName).get(null); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index c05c14ced6..01bd75baec 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -42,6 +42,7 @@ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.Circ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader; import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.PlatinumSludgeOverHaul; @@ -197,13 +198,12 @@ public final class MainMod { MainMod.addElectricImplosionCompressorRecipes(); MainMod.unificationEnforcer(); + PlatinumSludgeOverHaul.replacePureElements(); if (!extraGasRecipes) { ArrayListMultimap toChange = MainMod.getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS); HashSet noGas = MainMod.getNoGasItems(toChange); MainMod.editRecipes(toChange, noGas); } - PlatinumSludgeOverHaul.replacePureElements(); - //new AdditionalRecipes.LuVHullReplacer(); new CircuitImprintLoader().run(); if (classicMode) new DownTierLoader().run(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 612e6a4a4e..d5e88de602 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -31,6 +31,7 @@ import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import java.nio.ByteBuffer; @@ -40,6 +41,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { static final LinkedHashSet werkstoffHashSet = new LinkedHashSet<>(); public static final LinkedHashMap werkstoffHashMap = new LinkedHashMap<>(); + public static final LinkedHashMap werkstoffNameHashMap = new LinkedHashMap<>(); + private static final HashSet idHashSet = new HashSet<>(); private static final Werkstoff.Stats DEFAULT_NULL_STATS = new Werkstoff.Stats(); @@ -168,6 +171,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } Werkstoff.werkstoffHashSet.add(this); Werkstoff.werkstoffHashMap.put(this.mID, this); + Werkstoff.werkstoffNameHashMap.put(this.defaultName,this); } @@ -395,7 +399,25 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plate,0b10000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stick,0b10000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rod,0b10000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stickLong,0b10000000); + + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gearGt,0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gearGtSmall,0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.bolt,0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.screw,0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ring,0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.spring,0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.springSmall,0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rotor,0b100000000); + + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateDouble,0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateTriple,0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateQuadruple,0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateQuintuple,0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateDense,0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotDouble,0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotTriple,0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuadruple,0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuintuple,0b1000000000); } //public byte toGenerateSecondary = 0b0000000; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index a36a32f986..bd948b032a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -36,6 +36,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; +import com.google.common.collect.HashBiMap; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; @@ -1196,8 +1197,8 @@ public class WerkstoffLoader implements Runnable { public static HashMap items = new HashMap<>(); - public static HashMap fluids = new HashMap<>(); - public static HashMap molten = new HashMap<>(); + public static HashBiMap fluids = HashBiMap.create(); + public static HashBiMap molten = HashBiMap.create(); public static Block BWOres; public boolean registered; @@ -1452,10 +1453,10 @@ public class WerkstoffLoader implements Runnable { public static void runGTItemDataRegistrator(){ HashSet toRem = new HashSet<>(); for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - Materials werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName(),werkstoff.getDefaultName()); + Materials werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName().replaceAll(" ",""),werkstoff.getDefaultName()); GT_OreDictUnificator.addAssociation(ore,werkstoffBridgeMaterial,new ItemStack(WerkstoffLoader.BWOres,1,werkstoff.getmID()),true); for (OrePrefixes prefixes : values()) { - if (werkstoff.get(prefixes) != null && werkstoff.get(prefixes).getItem() != null) + if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) != 0 && werkstoff.get(prefixes) != null && werkstoff.get(prefixes).getItem() != null) GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, werkstoff.get(prefixes), true); } if (werkstoff.getGenerationFeatures().hasCells()) { @@ -1801,7 +1802,7 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addBlastRecipe(werkstoff.get(dust),GT_Utility.getIntegratedCircuit(11),Materials.Nitrogen.getGas(1000),null,werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot),null,(int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); } else if (werkstoff.contains(WerkstoffLoader.NOBLE_GAS_SMELTING)) { - GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), WerkstoffLoader.Neon.getFluidOrGas(1000), null, werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Argon.getGas(1000), null, werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); } else { GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); @@ -1828,7 +1829,7 @@ public class WerkstoffLoader implements Runnable { if (e.toString().equals(werkstoff.getToolTip())){ if (e.mLinkedMaterials.size() > 0) break; - werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName(),werkstoff.getDefaultName()); + werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName().replaceAll(" ",""),werkstoff.getDefaultName()); werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials.add(werkstoffBridgeMaterial); ElementSet = true; @@ -1934,68 +1935,89 @@ public class WerkstoffLoader implements Runnable { if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000) == 0) return; - if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { - List flOutputs = new ArrayList<>(); - List stOutputs = new ArrayList<>(); - HashMap> tracker = new HashMap<>(); - int cells = 0; - for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { - if (container.getKey() instanceof Materials) { - if (((Materials) container.getKey()).hasCorrespondingGas() || ((Materials) container.getKey()).hasCorrespondingFluid() || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { - FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); - if (tmpFl == null || tmpFl.getFluid() == null) { - tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); - } - flOutputs.add(tmpFl); - if (flOutputs.size() > 1) { - if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); - } else { - stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); - } - cells += container.getValue(); - } - } - } else if (container.getKey() instanceof Werkstoff) { - if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).getGenerationFeatures().hasCells()) { - FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); - if (tmpFl == null || tmpFl.getFluid() == null) { - tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); - } - flOutputs.add(tmpFl); - if (flOutputs.size() > 1) { - if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); - } else { - stOutputs.add(((Werkstoff) container.getKey()).get(cell, tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); - } - cells += container.getValue(); - } - } - } - } - ItemStack input = werkstoff.get(cell); - input.stackSize = werkstoff.getContents().getKey(); - stOutputs.add(Materials.Empty.getCells(cells)); - if (werkstoff.getStats().isElektrolysis()) - GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); - if (werkstoff.getStats().isCentrifuge()) - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); - if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { - if (cells > 0) - stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0)); - } - if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { - if (cells > 0) - stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0)); - } - } +// if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { +// List flOutputs = new ArrayList<>(); +// List stOutputs = new ArrayList<>(); +// HashMap> tracker = new HashMap<>(); +// int cells = 0; +// for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { +// if (container.getKey() instanceof Materials) { +// if (((Materials) container.getKey()).hasCorrespondingGas() || ((Materials) container.getKey()).hasCorrespondingFluid() || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { +// FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); +// if (tmpFl == null || tmpFl.getFluid() == null) { +// tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); +// } +// flOutputs.add(tmpFl); +// if (flOutputs.size() > 1) { +// if (!tracker.containsKey(container.getKey())) { +// stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); +// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); +// } else { +// stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); +// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); +// } +// cells += container.getValue(); +// } +// } else { +// if (((Materials) container.getKey()).getDust(container.getValue()) == null) +// continue; +// if (!tracker.containsKey(container.getKey())) { +// stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); +// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); +// } else { +// stOutputs.add(((Materials) container.getKey()).getDust(tracker.get(container.getKey()).getKey() + container.getValue())); +// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); +// } +// } +// } else if (container.getKey() instanceof Werkstoff) { +// if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).getGenerationFeatures().hasCells()) { +// FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); +// if (tmpFl == null || tmpFl.getFluid() == null) { +// tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); +// } +// flOutputs.add(tmpFl); +// if (flOutputs.size() > 1) { +// if (!tracker.containsKey(container.getKey())) { +// stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); +// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); +// } else { +// stOutputs.add(((Werkstoff) container.getKey()).get(cell, tracker.get(container.getKey()).getKey() + container.getValue())); +// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); +// } +// cells += container.getValue(); +// } +// } else { +// if (!((Werkstoff) container.getKey()).getGenerationFeatures().hasDusts()) +// continue; +// if (!tracker.containsKey(container.getKey())) { +// stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); +// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); +// } else { +// stOutputs.add(((Werkstoff) container.getKey()).get(dust, (tracker.get(container.getKey()).getKey() + container.getValue()))); +// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); +// } +// } +// } +// } +// ItemStack input = werkstoff.get(cell); +// input.stackSize = werkstoff.getContents().getKey(); +// cells += werkstoff.getContents().getKey(); +// stOutputs.add(Materials.Empty.getCells(cells)); +// if (werkstoff.getStats().isElektrolysis()) +// GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); +// if (werkstoff.getStats().isCentrifuge()) +// GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); +// if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { +// if (cells > 0) +// stOutputs.add(Materials.Empty.getCells(cells)); +// GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0)); +// } +// if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { +// if (cells > 0) +// stOutputs.add(Materials.Empty.getCells(cells)); +// GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0)); +// } +// } //Tank "Recipe" GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(WerkstoffLoader.fluids.get(werkstoff), 1000),werkstoff.get(cell),Materials.Empty.getCells(1))); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java index 2a56658e81..78c91fc264 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java @@ -25,12 +25,15 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.enums.Element; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.MaterialStack; import gregtech.api.util.*; @@ -41,8 +44,11 @@ import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.reflect.FieldUtils; +import org.apache.commons.lang3.reflect.MethodUtils; import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -75,6 +81,8 @@ public class PlatinumSludgeOverHaul { //AquaRegia GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, AquaRegia.get(cell, 2), 30, 30); GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(2), null, null, AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(2), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.NitricAcid.getCells(1),GT_Utility.getIntegratedCircuit(3), null, null, Materials.DilutedSulfuricAcid.getFluid(1000), AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(1), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1),GT_Utility.getIntegratedCircuit(4), null, null, Materials.NitricAcid.getFluid(1000), AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(1), 30, 30); //AmmoniumCloride GT_Values.RA.addChemicalRecipe(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.HydrochloricAcid.getFluid(1000), null, AmmoniumChloride.get(cell, 1), null, 15); @@ -84,16 +92,19 @@ public class PlatinumSludgeOverHaul { for (Werkstoff w : Werkstoff.werkstoffHashMap.values()) if (w.containsStuff(Materials.Sulfur) && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); - GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny), 250); + GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(2150), PTConcentrate.getFluidOrGas(2150), PTResidue.get(dustTiny,2), 250); } for (Materials m : Materials.values()) if (PlatinumSludgeOverHaul.materialsContains(m, Materials.Sulfur) && (PlatinumSludgeOverHaul.materialsContains(m, Materials.Copper) || PlatinumSludgeOverHaul.materialsContains(m, Materials.Nickel))) { GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); - GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny), 250); + GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(2150), PTConcentrate.getFluidOrGas(2150), PTResidue.get(dustTiny,2), 250); } //Pt - GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{}, new FluidStack[]{PTConcentrate.getFluidOrGas(1000), AmmoniumChloride.getFluidOrGas(1000)}, new FluidStack[]{PDAmmonia.getFluidOrGas(100), Materials.Ammonia.getGas(900)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 8), PTRawPowder.get(dustTiny)}, 600, 30); + GT_Values.RA.addBlastRecipe(PTMetallicPowder.get(dust,3), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Platinum.getNuggets(2), null, 600, 120, Materials.Platinum.mMeltingPoint); + + GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(2000), PTConcentrate.getFluidOrGas(2000), PTResidue.get(dustTiny,2), 250); + GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell),null,AmmoniumChloride.getFluidOrGas(100),PDAmmonia.getFluidOrGas(100),PTSaltCrude.get(dustTiny, 8), PTRawPowder.get(dustTiny),Materials.Empty.getCells(1),null,null,null,null,600,30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{}, new FluidStack[]{PTConcentrate.getFluidOrGas(1000), AmmoniumChloride.getFluidOrGas(100)}, new FluidStack[]{PDAmmonia.getFluidOrGas(100)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 8), PTRawPowder.get(dustTiny)}, 600, 30); GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ PTSaltRefined.get(dust), PTSaltRefined.get(dust), @@ -107,12 +118,12 @@ public class PlatinumSludgeOverHaul { }, new int[]{ 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, }, 600, 30); - GT_Values.RA.addBlastRecipe(PTSaltRefined.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, PTMetallicPowder.get(dust), null, 200, 120, 900); + GT_Values.RA.addBlastRecipe(PTSaltRefined.get(dust), GT_Utility.getIntegratedCircuit(1), null, Materials.Chlorine.getGas(500), PTMetallicPowder.get(dust), null, 200, 120, 900); GT_Values.RA.addChemicalRecipe(PTRawPowder.get(dust, 2), Materials.Calcium.getDust(1), null, null, Materials.Platinum.getDust(2), CalciumChloride.get(dust), 30); //Pd GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), PDAmmonia.getFluidOrGas(1000), null, 250); GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dustTiny, 16), PDRawPowder.get(dustTiny, 2), 250); - GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), null, PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dustTiny, 9), 250); + GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), null, PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dust), 250); GT_Values.RA.addSifterRecipe(PDSalt.get(dust), new ItemStack[]{ PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), @@ -130,25 +141,25 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{PDRawPowder.get(dust, 2)}, new FluidStack[]{FormicAcid.getFluidOrGas(4000)}, new FluidStack[]{Materials.Ammonia.getGas(2000), Materials.Ethylene.getGas(1000), Materials.Water.getFluid(1000)}, new ItemStack[]{Materials.Palladium.getDust(2)}, 250, 30); GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust, 2), Materials.Hydrogen.getCells(1), null, Materials.SulfuricAcid.getFluid(2000), Materials.Sodium.getDust(1), Materials.Empty.getCells(3), 30); //K2S2O7 - GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust), null, 30); + // GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust,6), null, 30); //Rh/Os/Ir/Ru GT_Values.RA.addBlastRecipe(PTResidue.get(dust), GT_Utility.getIntegratedCircuit(11), PotassiumDisulfate.getMolten(1440), RHSulfate.getFluidOrGas(1440), LeachResidue.get(dust), null, 200, 120, 775); //Ru GT_Values.RA.addBlastRecipe(LeachResidue.get(dust, 10), Materials.Saltpeter.getDust(10), Materials.SaltWater.getFluid(1000), GT_ModHandler.getSteam(1000), SodiumRuthenate.get(dust, 3), IrOsLeachResidue.get(dust, 6), 200, 120, 775); GT_Values.RA.addChemicalRecipe(SodiumRuthenate.get(dust, 6), Materials.Chlorine.getCells(3), null, RutheniumTetroxideSollution.getFluidOrGas(9000), Materials.Empty.getCells(3), 300); - GT_Values.RA.addFluidHeaterRecipe(null, RutheniumTetroxideSollution.getFluidOrGas(800), HotRutheniumTetroxideSollution.getFluidOrGas(1600), 300, 480); - GT_Values.RA.addCrackingRecipe(17, RutheniumTetroxideSollution.getFluidOrGas(1000), null, HotRutheniumTetroxideSollution.getFluidOrGas(2000), 150, 480); + GT_Values.RA.addFluidHeaterRecipe(GT_Utility.getIntegratedCircuit(1), RutheniumTetroxideSollution.getFluidOrGas(800), HotRutheniumTetroxideSollution.getFluidOrGas(800), 300, 480); + GT_Values.RA.addCrackingRecipe(17, RutheniumTetroxideSollution.getFluidOrGas(1000), GT_ModHandler.getSteam(1000), HotRutheniumTetroxideSollution.getFluidOrGas(2000), 150, 480); GT_Values.RA.addDistillationTowerRecipe(HotRutheniumTetroxideSollution.getFluidOrGas(9000), new FluidStack[]{ Materials.Water.getFluid(1800), RutheniumTetroxide.getFluidOrGas(7200) }, Materials.Salt.getDust(6), 1500, 480); - GT_Values.RA.addChemicalRecipe(RutheniumTetroxide.get(dust, 1), Materials.HydrochloricAcid.getCells(8), null, Materials.Water.getFluid(2000), Ruthenium.get(dust), Materials.Chlorine.getCells(6), 300); + GT_Values.RA.addChemicalRecipe(RutheniumTetroxide.get(dust, 1), Materials.HydrochloricAcid.getCells(6), null, Materials.Water.getFluid(2000), Ruthenium.get(dust), Materials.Chlorine.getCells(6), 300); //Os GT_Values.RA.addBlastRecipe(IrOsLeachResidue.get(dust, 4), GT_Utility.getIntegratedCircuit(11), Materials.HydrochloricAcid.getFluid(1000), AcidicOsmiumSolution.getFluidOrGas(2000), IrLeachResidue.get(dust, 2), null, 200, 120, 775); GT_Values.RA.addDistillationTowerRecipe(AcidicOsmiumSolution.getFluidOrGas(1000), new FluidStack[]{OsmiumSolution.getFluidOrGas(100), Materials.Water.getFluid(900)}, null, 150, BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addChemicalRecipe(OsmiumSolution.get(cell), Materials.HydrochloricAcid.getCells(8), null, Materials.Water.getFluid(2000), Materials.Osmium.getDust(1), Materials.Chlorine.getCells(6), 300); + GT_Values.RA.addChemicalRecipe(OsmiumSolution.get(cell), Materials.HydrochloricAcid.getCells(6), null, Materials.Water.getFluid(2000), Materials.Osmium.getDust(1), Materials.Chlorine.getCells(7), 300); //Ir GT_Values.RA.addBlastRecipe(IrLeachResidue.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, PGSDResidue.get(dust), IridiumDioxide.get(dust), 200, 120, 775); @@ -157,7 +168,8 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addChemicalRecipe(IridiumChloride.get(dust), Materials.Calcium.getDust(3), null, CalciumChloride.getFluidOrGas(3000), PGSDResidue2.get(dust), Materials.Iridium.getDust(1), 300, 1920); //Rh - GT_Values.RA.addMixerRecipe(RHSulfate.get(cell, 5), null, null, null, Materials.Water.getFluid(5000), RHSulfateSolution.getFluidOrGas(5000), LeachResidue.get(dustTiny), 300, 30); + GT_Values.RA.addChemicalRecipe(RHSulfate.get(cell, 11), GT_Utility.getIntegratedCircuit(1), Materials.Water.getFluid(10000), Materials.Potassium.getMolten(288),RHSulfateSolution.get(cell,11), LeachResidue.get(dustTiny,10), 300, 30); + GT_Values.RA.addChemicalRecipe(Materials.Zinc.getDust(1), null, RHSulfateSolution.getFluidOrGas(1000), null, ZincSulfate.get(dust), CrudeRhMetall.get(dust), 300); GT_Values.RA.addBlastRecipe(CrudeRhMetall.get(dust), Materials.Salt.getDust(1), Materials.Chlorine.getGas(1000), null, RHSalt.get(dust, 3), null, 300, 120, 600); GT_Values.RA.addMixerRecipe(RHSalt.get(dust, 10), null, null, null, Materials.Water.getFluid(2000), RHSaltSolution.getFluidOrGas(2000), null, 300, 30); @@ -193,7 +205,7 @@ public class PlatinumSludgeOverHaul { for (Object entry : FurnaceRecipes.smelting().getSmeltingList().entrySet()) { Map.Entry realEntry = (Map.Entry) entry; if (GT_Utility.isStackValid(realEntry.getKey()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getKey())) - if (!GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dust) && !GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dustTiny)) + if ((!GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dust) && !GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dustTiny)) || !GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mMaterial.mMaterial.equals(Materials.Platinum)) if (GT_Utility.isStackValid(realEntry.getValue()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())) if (GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()).mMaterial.mMaterial.equals(Materials.Platinum)) realEntry.setValue(PTMetallicPowder.get(dust)); @@ -214,11 +226,14 @@ public class PlatinumSludgeOverHaul { maploop: for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + if (map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes) + continue; HashSet toDel = new HashSet(); recipeloop: for (GT_Recipe recipe : map.mRecipeList) { if (recipe.mFakeRecipe) continue maploop; + for (int i = 0; i < recipe.mFluidOutputs.length; i++) { if (map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes)) continue maploop; @@ -262,10 +277,6 @@ public class PlatinumSludgeOverHaul { if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; } -// if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { -// int amount = recipe.mOutputs[i].stackSize; -// recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 11); -// } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount); @@ -281,10 +292,6 @@ public class PlatinumSludgeOverHaul { if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; } -// if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { -// int amount = recipe.mOutputs[i].stackSize; -// recipe.mOutputs[i] = PDMetallicPowder.get(dustTiny).splitStack(amount * 11); -// } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = PDMetallicPowder.get(dust).splitStack(amount); @@ -300,10 +307,6 @@ public class PlatinumSludgeOverHaul { if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; } -// if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { -// int amount = recipe.mOutputs[i].stackSize; -// recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount * 22); -// } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount * 4); @@ -319,10 +322,6 @@ public class PlatinumSludgeOverHaul { if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; } -// if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushed) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedCentrifuged) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(crushedPurified)) { -// int amount = recipe.mOutputs[i].stackSize; -// recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount * 11); -// } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount * 2); @@ -349,28 +348,28 @@ public class PlatinumSludgeOverHaul { if (!BW_Util.checkStackAndPrefix(otpt)) return; Field out = FieldUtils.getDeclaredField(recipe.getClass(), "output", true); - if (out != null && GT_OreDictUnificator.getAssociation(otpt).mMaterial.mMaterial.equals(Materials.Platinum) && GT_OreDictUnificator.getAssociation(otpt).mPrefix == dust) { + if (out != null && GT_Utility.areStacksEqual(otpt,Materials.Platinum.getDust(1),true)) { try { out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize)); } catch (IllegalAccessException e) { e.printStackTrace(); } } - else if (out != null && GT_OreDictUnificator.getAssociation(otpt).mMaterial.mMaterial.equals(Materials.Palladium) && GT_OreDictUnificator.getAssociation(otpt).mPrefix == dust) { + else if (out != null && GT_Utility.areStacksEqual(otpt,Materials.Palladium.getDust(1),true)) { try { out.set(recipe, PDMetallicPowder.get(dust, otpt.stackSize)); } catch (IllegalAccessException e) { e.printStackTrace(); } } - else if (out != null && GT_OreDictUnificator.getAssociation(otpt).mMaterial.mMaterial.equals(Materials.Iridium) && GT_OreDictUnificator.getAssociation(otpt).mPrefix == dust) { + else if (out != null && GT_Utility.areStacksEqual(otpt,Materials.Iridium.getDust(1),true)) { try { out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize * 2)); } catch (IllegalAccessException e) { e.printStackTrace(); } } - else if (out != null && GT_OreDictUnificator.getAssociation(otpt).mMaterial.mMaterial.equals(Materials.Osmium) && GT_OreDictUnificator.getAssociation(otpt).mPrefix == dust) { + else if (out != null && GT_Utility.areStacksEqual(otpt,Materials.Osmium.getDust(1),true)) { try { out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize * 4)); } catch (IllegalAccessException e) { -- cgit From 53159ebfeeeffbe83d49670c456cc5a7189c3d54 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 10 Sep 2019 19:12:05 +0200 Subject: rebalanced PTGroup +improved imports +fixed UnificationEnforcer Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: a74d38b748c8bac947a40e8fe94c1d93362dbcf8 --- .../github/bartimaeusnek/bartworks/MainMod.java | 27 ++++++-- .../system/material/BW_MetaGeneratedFrames.java | 4 +- .../system/material/BW_MetaGenerated_Items.java | 1 - .../bartworks/system/material/Werkstoff.java | 1 - .../bartworks/system/material/WerkstoffLoader.java | 10 ++- .../processingLoaders/AdditionalRecipes.java | 7 +- .../processingLoaders/PlatinumSludgeOverHaul.java | 79 ++++++++++------------ .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 7 +- .../multi/GT_Industrial_Alchemic_Construct.java | 5 +- 9 files changed, 71 insertions(+), 70 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 01bd75baec..760adf02dd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -42,8 +42,6 @@ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.Circ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader; import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.PlatinumSludgeOverHaul; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; @@ -60,10 +58,7 @@ import cpw.mods.fml.common.event.FMLServerStartedEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; import gregtech.api.GregTech_API; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.SubTag; +import gregtech.api.enums.*; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.*; import net.minecraft.creativetab.CreativeTabs; @@ -237,6 +232,7 @@ public final class MainMod { GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(false,null,null,null,null,new FluidStack[]{wrongNamedFluid},new FluidStack[]{werkstoff.getFluidOrGas(1)},1,1,0)); } MainMod.runMoltenUnificationEnfocement(werkstoff); + MainMod.runUnficationDeleter(werkstoff); for (OrePrefixes prefixes : OrePrefixes.values()) { if (OreDictionary.getOres(prefixes + werkstoff.getDefaultName()).size() > 1) { for (int j = 0; j < OreDictionary.getOres(prefixes + werkstoff.getDefaultName()).size(); j++) { @@ -344,6 +340,23 @@ public final class MainMod { } } + private static void runUnficationDeleter(Werkstoff werkstoff) { + if (werkstoff.getType() == Werkstoff.Types.ELEMENT) { + werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip()); + Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>(); + Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial()); + } + + for (OrePrefixes prefixes : OrePrefixes.values()) + if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) != 0 && ((werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0)) { + GT_OreDictUnificator.set(prefixes,werkstoff.getBridgeMaterial(),werkstoff.get(prefixes),true,true); + for (ItemStack stack : OreDictionary.getOres(prefixes + werkstoff.getDefaultName().replace(" ", ""))) { + GT_OreDictUnificator.addAssociation(prefixes,werkstoff.getBridgeMaterial(),stack,false); + GT_OreDictUnificator.getAssociation(stack).mUnificationTarget = werkstoff.get(prefixes); + } + } + } + private static ArrayListMultimap getRecipesToChange(SubTag... GasTags){ Iterator it = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.iterator(); ArrayListMultimap toAdd = ArrayListMultimap.create(); @@ -455,7 +468,7 @@ public final class MainMod { private static void addElectricImplosionCompressorRecipes() { if (eicMap == null) { - eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); + eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList) { if (recipe == null || recipe.mInputs == null) continue; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java index f82dcc2307..0bf9f2a6f6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java @@ -22,7 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material; -import gregtech.api.enums.*; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 5da4d63e25..9b7f2f44e5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -24,7 +24,6 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.API.IRadMaterial; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.Pair; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index d5e88de602..c9ae650d36 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -31,7 +31,6 @@ import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import java.nio.ByteBuffer; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index bd948b032a..96fe88d759 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -33,7 +33,6 @@ import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import com.google.common.collect.HashBiMap; @@ -1454,17 +1453,16 @@ public class WerkstoffLoader implements Runnable { HashSet toRem = new HashSet<>(); for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { Materials werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName().replaceAll(" ",""),werkstoff.getDefaultName()); - GT_OreDictUnificator.addAssociation(ore,werkstoffBridgeMaterial,new ItemStack(WerkstoffLoader.BWOres,1,werkstoff.getmID()),true); + GT_OreDictUnificator.addAssociation(ore,werkstoffBridgeMaterial,new ItemStack(WerkstoffLoader.BWOres,1,werkstoff.getmID()),false); for (OrePrefixes prefixes : values()) { if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) != 0 && werkstoff.get(prefixes) != null && werkstoff.get(prefixes).getItem() != null) - GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, werkstoff.get(prefixes), true); + GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, werkstoff.get(prefixes), false); } if (werkstoff.getGenerationFeatures().hasCells()) { werkstoffBridgeMaterial.setHasCorrespondingFluid(true); werkstoffBridgeMaterial.setHasCorrespondingGas(true); werkstoffBridgeMaterial.mFluid = werkstoff.getFluidOrGas(1).getFluid(); werkstoffBridgeMaterial.mGas = werkstoff.getFluidOrGas(1).getFluid(); - } if (werkstoff.getGenerationFeatures().hasMolten()) { werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid(); @@ -1839,7 +1837,7 @@ public class WerkstoffLoader implements Runnable { if (!ElementSet) return; - GT_OreDictUnificator.addAssociation(dust,werkstoffBridgeMaterial, werkstoff.get(dust),true); + GT_OreDictUnificator.addAssociation(dust,werkstoffBridgeMaterial, werkstoff.get(dust),false); try { Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); f.setAccessible(true); @@ -2045,7 +2043,7 @@ public class WerkstoffLoader implements Runnable { if (!ElementSet) return; - GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),true); + GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),false); try { Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); f.setAccessible(true); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index ea6e5722de..56ad180e95 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -31,8 +31,6 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.common.Loader; import gregtech.api.GregTech_API; import gregtech.api.enums.*; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.objects.ItemData; import gregtech.api.util.*; import gregtech.common.items.behaviors.Behaviour_DataOrb; import net.minecraft.item.ItemStack; @@ -40,12 +38,9 @@ import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; import org.apache.commons.lang3.reflect.FieldUtils; import org.apache.commons.lang3.reflect.MethodUtils; -import sun.reflect.FieldInfo; -import java.lang.reflect.Array; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -269,7 +264,7 @@ public class AdditionalRecipes implements Runnable { if (!aElementSet) return; - GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),true); + GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),false); try { Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); f.setAccessible(true); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java index 78c91fc264..5ef10a1343 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java @@ -25,15 +25,12 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.enums.Element; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.MaterialStack; import gregtech.api.util.*; @@ -44,11 +41,8 @@ import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.reflect.FieldUtils; -import org.apache.commons.lang3.reflect.MethodUtils; import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -81,8 +75,8 @@ public class PlatinumSludgeOverHaul { //AquaRegia GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, AquaRegia.get(cell, 2), 30, 30); GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(2), null, null, AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(2), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.NitricAcid.getCells(1),GT_Utility.getIntegratedCircuit(3), null, null, Materials.DilutedSulfuricAcid.getFluid(1000), AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(1), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1),GT_Utility.getIntegratedCircuit(4), null, null, Materials.NitricAcid.getFluid(1000), AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(1), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(3), null, null, Materials.DilutedSulfuricAcid.getFluid(1000), AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(1), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(4), null, null, Materials.NitricAcid.getFluid(1000), AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(1), 30, 30); //AmmoniumCloride GT_Values.RA.addChemicalRecipe(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.HydrochloricAcid.getFluid(1000), null, AmmoniumChloride.get(cell, 1), null, 15); @@ -92,18 +86,18 @@ public class PlatinumSludgeOverHaul { for (Werkstoff w : Werkstoff.werkstoffHashMap.values()) if (w.containsStuff(Materials.Sulfur) && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); - GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(2150), PTConcentrate.getFluidOrGas(2150), PTResidue.get(dustTiny,2), 250); + GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny, 2), 250); } for (Materials m : Materials.values()) if (PlatinumSludgeOverHaul.materialsContains(m, Materials.Sulfur) && (PlatinumSludgeOverHaul.materialsContains(m, Materials.Copper) || PlatinumSludgeOverHaul.materialsContains(m, Materials.Nickel))) { GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); - GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(2150), PTConcentrate.getFluidOrGas(2150), PTResidue.get(dustTiny,2), 250); + GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny, 2), 250); } //Pt - GT_Values.RA.addBlastRecipe(PTMetallicPowder.get(dust,3), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Platinum.getNuggets(2), null, 600, 120, Materials.Platinum.mMeltingPoint); + GT_Values.RA.addBlastRecipe(PTMetallicPowder.get(dust, 3), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Platinum.getNuggets(2), null, 600, 120, Materials.Platinum.mMeltingPoint); - GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(2000), PTConcentrate.getFluidOrGas(2000), PTResidue.get(dustTiny,2), 250); - GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell),null,AmmoniumChloride.getFluidOrGas(100),PDAmmonia.getFluidOrGas(100),PTSaltCrude.get(dustTiny, 8), PTRawPowder.get(dustTiny),Materials.Empty.getCells(1),null,null,null,null,600,30); + GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(2000), PTConcentrate.getFluidOrGas(2000), PTResidue.get(dustTiny, 2), 250); + GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell), null, AmmoniumChloride.getFluidOrGas(100), PDAmmonia.getFluidOrGas(100), PTSaltCrude.get(dustTiny, 8), PTRawPowder.get(dustTiny), Materials.Empty.getCells(1), null, null, null, null, 600, 30); GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{}, new FluidStack[]{PTConcentrate.getFluidOrGas(1000), AmmoniumChloride.getFluidOrGas(100)}, new FluidStack[]{PDAmmonia.getFluidOrGas(100)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 8), PTRawPowder.get(dustTiny)}, 600, 30); GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ PTSaltRefined.get(dust), @@ -118,7 +112,7 @@ public class PlatinumSludgeOverHaul { }, new int[]{ 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, }, 600, 30); - GT_Values.RA.addBlastRecipe(PTSaltRefined.get(dust), GT_Utility.getIntegratedCircuit(1), null, Materials.Chlorine.getGas(500), PTMetallicPowder.get(dust), null, 200, 120, 900); + GT_Values.RA.addBlastRecipe(PTSaltRefined.get(dust), GT_Utility.getIntegratedCircuit(1), null, Materials.Chlorine.getGas(87), PTMetallicPowder.get(dust), null, 200, 120, 900); GT_Values.RA.addChemicalRecipe(PTRawPowder.get(dust, 2), Materials.Calcium.getDust(1), null, null, Materials.Platinum.getDust(2), CalciumChloride.get(dust), 30); //Pd GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), PDAmmonia.getFluidOrGas(1000), null, 250); @@ -141,7 +135,7 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{PDRawPowder.get(dust, 2)}, new FluidStack[]{FormicAcid.getFluidOrGas(4000)}, new FluidStack[]{Materials.Ammonia.getGas(2000), Materials.Ethylene.getGas(1000), Materials.Water.getFluid(1000)}, new ItemStack[]{Materials.Palladium.getDust(2)}, 250, 30); GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust, 2), Materials.Hydrogen.getCells(1), null, Materials.SulfuricAcid.getFluid(2000), Materials.Sodium.getDust(1), Materials.Empty.getCells(3), 30); //K2S2O7 - // GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust,6), null, 30); + // GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust,6), null, 30); //Rh/Os/Ir/Ru GT_Values.RA.addBlastRecipe(PTResidue.get(dust), GT_Utility.getIntegratedCircuit(11), PotassiumDisulfate.getMolten(1440), RHSulfate.getFluidOrGas(1440), LeachResidue.get(dust), null, 200, 120, 775); @@ -168,7 +162,7 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addChemicalRecipe(IridiumChloride.get(dust), Materials.Calcium.getDust(3), null, CalciumChloride.getFluidOrGas(3000), PGSDResidue2.get(dust), Materials.Iridium.getDust(1), 300, 1920); //Rh - GT_Values.RA.addChemicalRecipe(RHSulfate.get(cell, 11), GT_Utility.getIntegratedCircuit(1), Materials.Water.getFluid(10000), Materials.Potassium.getMolten(288),RHSulfateSolution.get(cell,11), LeachResidue.get(dustTiny,10), 300, 30); + GT_Values.RA.addChemicalRecipe(RHSulfate.get(cell, 11), GT_Utility.getIntegratedCircuit(1), Materials.Water.getFluid(10000), Materials.Potassium.getMolten(288), RHSulfateSolution.get(cell, 11), LeachResidue.get(dustTiny, 10), 300, 30); GT_Values.RA.addChemicalRecipe(Materials.Zinc.getDust(1), null, RHSulfateSolution.getFluidOrGas(1000), null, ZincSulfate.get(dust), CrudeRhMetall.get(dust), 300); GT_Values.RA.addBlastRecipe(CrudeRhMetall.get(dust), Materials.Salt.getDust(1), Materials.Chlorine.getGas(1000), null, RHSalt.get(dust, 3), null, 300, 120, 600); @@ -208,9 +202,9 @@ public class PlatinumSludgeOverHaul { if ((!GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dust) && !GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dustTiny)) || !GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mMaterial.mMaterial.equals(Materials.Platinum)) if (GT_Utility.isStackValid(realEntry.getValue()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())) if (GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()).mMaterial.mMaterial.equals(Materials.Platinum)) - realEntry.setValue(PTMetallicPowder.get(dust)); + realEntry.setValue(PTMetallicPowder.get(dust, ((ItemStack) realEntry.getValue()).stackSize * 2)); else if (GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()).mMaterial.mMaterial.equals(Materials.Palladium)) - realEntry.setValue(PDMetallicPowder.get(dust)); + realEntry.setValue(PDMetallicPowder.get(dust, ((ItemStack) realEntry.getValue()).stackSize * 2)); } for (Object obj : CraftingManager.getInstance().getRecipeList()) { @@ -256,7 +250,7 @@ public class PlatinumSludgeOverHaul { for (int j = 0; j < recipe.mInputs.length; j++) if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; - int amount = recipe.mOutputs[i].stackSize; + int amount = recipe.mOutputs[i].stackSize * 2; recipe.mOutputs[i] = LeachResidue.get(dust, amount); } } @@ -265,7 +259,7 @@ public class PlatinumSludgeOverHaul { for (int j = 0; j < recipe.mInputs.length; j++) if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; - int amount = recipe.mOutputs[i].stackSize; + int amount = recipe.mOutputs[i].stackSize * 2; recipe.mOutputs[i] = CrudeRhMetall.get(dust, amount); } } @@ -279,13 +273,13 @@ public class PlatinumSludgeOverHaul { } if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount); + recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount * 2); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dustSmall).splitStack(amount); + recipe.mOutputs[i] = PTMetallicPowder.get(dustSmall).splitStack(amount * 2); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount); + recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 2); } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Palladium)) { for (int j = 0; j < recipe.mInputs.length; j++) { @@ -294,13 +288,13 @@ public class PlatinumSludgeOverHaul { } if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PDMetallicPowder.get(dust).splitStack(amount); + recipe.mOutputs[i] = PDMetallicPowder.get(dust).splitStack(amount * 2); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PDMetallicPowder.get(dustSmall).splitStack(amount); + recipe.mOutputs[i] = PDMetallicPowder.get(dustSmall).splitStack(amount * 2); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PDMetallicPowder.get(dustTiny).splitStack(amount); + recipe.mOutputs[i] = PDMetallicPowder.get(dustTiny).splitStack(amount * 2); } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Osmium)) { for (int j = 0; j < recipe.mInputs.length; j++) { @@ -309,13 +303,13 @@ public class PlatinumSludgeOverHaul { } if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount * 4); + recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount * 8); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dustSmall).splitStack(amount * 4); + recipe.mOutputs[i] = PTMetallicPowder.get(dustSmall).splitStack(amount * 8); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 4); + recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 8); } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Iridium)) { for (int j = 0; j < recipe.mInputs.length; j++) { @@ -324,13 +318,13 @@ public class PlatinumSludgeOverHaul { } if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount * 2); + recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount * 4); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dustSmall).splitStack(amount * 2); + recipe.mOutputs[i] = PTMetallicPowder.get(dustSmall).splitStack(amount * 4); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 2); + recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 4); } } } @@ -340,7 +334,7 @@ public class PlatinumSludgeOverHaul { PlatinumSludgeOverHaul.runHelperrecipes(); } - private static void setnewMaterialInRecipe(Object obj){ + private static void setnewMaterialInRecipe(Object obj) { if (!(obj instanceof GT_Shaped_Recipe)) return; GT_Shaped_Recipe recipe = (GT_Shaped_Recipe) obj; @@ -348,30 +342,27 @@ public class PlatinumSludgeOverHaul { if (!BW_Util.checkStackAndPrefix(otpt)) return; Field out = FieldUtils.getDeclaredField(recipe.getClass(), "output", true); - if (out != null && GT_Utility.areStacksEqual(otpt,Materials.Platinum.getDust(1),true)) { + if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Platinum.getDust(1), true)) { try { - out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize)); + out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize * 2)); } catch (IllegalAccessException e) { e.printStackTrace(); } - } - else if (out != null && GT_Utility.areStacksEqual(otpt,Materials.Palladium.getDust(1),true)) { + } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Palladium.getDust(1), true)) { try { - out.set(recipe, PDMetallicPowder.get(dust, otpt.stackSize)); + out.set(recipe, PDMetallicPowder.get(dust, otpt.stackSize * 2)); } catch (IllegalAccessException e) { e.printStackTrace(); } - } - else if (out != null && GT_Utility.areStacksEqual(otpt,Materials.Iridium.getDust(1),true)) { + } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Iridium.getDust(1), true)) { try { - out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize * 2)); + out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize * 4)); } catch (IllegalAccessException e) { e.printStackTrace(); } - } - else if (out != null && GT_Utility.areStacksEqual(otpt,Materials.Osmium.getDust(1),true)) { + } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Osmium.getDust(1), true)) { try { - out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize * 4)); + out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize * 8)); } catch (IllegalAccessException e) { e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index eaaac8cbd6..90ed4493e1 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -25,19 +25,20 @@ package com.github.bartimaeusnek.crossmod; import com.github.bartimaeusnek.bartworks.common.commands.ChangeConfig; import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; -import com.github.bartimaeusnek.crossmod.emt.recipe.TCRecipeHandler; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.event.*; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; import net.minecraft.util.StringTranslate; import org.apache.commons.io.input.ReaderInputStream; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.StringReader; -import java.lang.reflect.InvocationTargetException; @Mod( modid = BartWorksCrossmod.MOD_ID, name = BartWorksCrossmod.NAME, version = BartWorksCrossmod.VERSION, diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java index c67674ae25..f7f2298c28 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java @@ -38,7 +38,10 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; import java.lang.reflect.InvocationTargetException; -import java.util.*; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; import static gregtech.api.enums.GT_Values.V; -- cgit From d928b204b81606c6874e5889300cea00e26dcb85 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 11 Sep 2019 17:29:46 +0200 Subject: fixed the recipe replacer +changed out Osmiridium for LuV recipes +added Tiberium for Blackflame +added LuVFineWireMaterial("Ruridit") +added wireFine items & recipes +fixed Scanner/Replicator recipes +deleted an unused class +added a config option to silence the GT++ logging Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: a0981899093b854814d4c04c9c321b9a4df17e5f --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 34 +- .../bartworks/common/configs/ConfigHandler.java | 2 + .../bartworks/system/log/DebugLog.java | 2 +- .../bartworks/system/log/STFUGTPPLOG.java | 653 +++++++++++++++++++++ .../system/material/BWUnificationEnforcer.java | 48 -- .../bartworks/system/material/Werkstoff.java | 14 +- .../bartworks/system/material/WerkstoffLoader.java | 140 +++-- .../processingLoaders/AdditionalRecipes.java | 120 +--- .../processingLoaders/LuVTierEnhancer.java | 207 +++++++ .../processingLoaders/PlatinumSludgeOverHaul.java | 232 ++++++-- .../system/oregen/BW_WorldGenRoss128b.java | 2 +- .../system/oregen/BW_WorldGenRoss128ba.java | 6 +- 13 files changed, 1168 insertions(+), 294 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BWUnificationEnforcer.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java diff --git a/build.properties b/build.properties index 55ea1bf87a..32b78ad9eb 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre7 +buildNumber=2_pre9 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 760adf02dd..e3b88b62e8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -38,6 +38,7 @@ import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; import com.github.bartimaeusnek.bartworks.server.EventHandler.ServerEventHandler; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; +import com.github.bartimaeusnek.bartworks.system.log.STFUGTPPLOG; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader; import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; @@ -69,12 +70,15 @@ import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; +import org.apache.commons.lang3.reflect.FieldUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.IOException; import java.lang.reflect.Field; +import java.lang.reflect.Modifier; import java.util.*; +import java.util.stream.Collectors; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; @@ -110,6 +114,16 @@ public final class MainMod { MainMod.LOGGER.error("Something has loaded an old API. Please contact the Mod authors to update!"); } + if (Loader.isModLoaded("miscutils") && ConfigHandler.GTppLogDisabler) { + try { + Field loggerField = FieldUtils.getField(Class.forName("gtPlusPlus.api.objects.Logger"),"modLogger",true); + FieldUtils.removeFinalModifier(loggerField,true); + loggerField.set(null,(Logger)new STFUGTPPLOG()); + } catch (IllegalAccessException | ClassNotFoundException e) { + e.printStackTrace(); + } + } + //fixing BorosilicateGlass... -_-' Materials.BorosilicateGlass.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); @@ -194,6 +208,7 @@ public final class MainMod { MainMod.unificationEnforcer(); PlatinumSludgeOverHaul.replacePureElements(); + if (!extraGasRecipes) { ArrayListMultimap toChange = MainMod.getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS); HashSet noGas = MainMod.getNoGasItems(toChange); @@ -289,7 +304,7 @@ public final class MainMod { private static void runMoltenUnificationEnfocement(Werkstoff werkstoff){ if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.getGenerationFeatures().hasMolten()) { try { - FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(molten.get(werkstoff), 144), werkstoff.get(cellMolten), Materials.Empty.getCells(1)); + FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), werkstoff.get(cellMolten), Materials.Empty.getCells(1)); Field f = GT_Utility.class.getDeclaredField("sFilledContainerToData"); f.setAccessible(true); Map sFilledContainerToData = (Map) f.get(null); @@ -402,7 +417,7 @@ public final class MainMod { } private static void editRecipes(ArrayListMultimap base, HashSet noGas) { - if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeFluidNameMap.contains(fluids.get(Oganesson).getName())) + if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeFluidNameMap.contains(Objects.requireNonNull(fluids.get(Oganesson)).getName())) return; HashSet toAdd = new HashSet<>(); for (SubTag GasTag : base.keySet()) { @@ -415,7 +430,7 @@ public final class MainMod { if (!werkstoff.contains(GasTag)) continue; int time = (int) ((double) recipe.mDuration / 200D * (200D + (werkstoff.getStats().getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) werkstoff.getStats().getProtons() : (double) mat.getProtons()*2.75D - (double) werkstoff.getStats().getProtons()))); - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(fluids.get(werkstoff), recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); + toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); } for (Materials materials : Materials.values()) { if (!materials.contains(GasTag)) @@ -462,22 +477,13 @@ public final class MainMod { } } toAdd.removeAll(duplicates); - for (GT_Recipe recipe : toAdd) - GT_Recipe.GT_Recipe_Map.sBlastRecipes.add(recipe); + toAdd.forEach(GT_Recipe.GT_Recipe_Map.sBlastRecipes::add); } private static void addElectricImplosionCompressorRecipes() { if (eicMap == null) { eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); - for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList) { - if (recipe == null || recipe.mInputs == null) - continue; - HashSet inputs = new HashSet<>(); - for (ItemStack is : recipe.mInputs) - if (!MainMod.checkForExplosives(is)) - inputs.add(is); - eicMap.addRecipe(true, inputs.toArray(new ItemStack[0]), recipe.mOutputs, null, null, null, recipe.mDuration, BW_Util.getMachineVoltageFromTier(10), 0); - } + GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream().filter(e -> e.mInputs != null).forEach(recipe -> eicMap.addRecipe(true, Arrays.stream(recipe.mInputs).filter(e -> !MainMod.checkForExplosives(e)).distinct().toArray(ItemStack[]::new), recipe.mOutputs, null, null, null, recipe.mDuration, BW_Util.getMachineVoltageFromTier(10), 0)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index b5d5d8b972..da0397087e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -64,6 +64,7 @@ public class ConfigHandler { //One-Side-Only public static boolean debugLog; + public static boolean GTppLogDisabler; public static boolean tooltips = true; public static boolean[] enabledPatches; @@ -92,6 +93,7 @@ public class ConfigHandler { ConfigHandler.IDOffset = 12600; ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600); } + ConfigHandler.GTppLogDisabler = ConfigHandler.c.get("System", "Disable GT++ Logging", false, "Enables or Disables GT++ Logging.").getBoolean(false); ConfigHandler.debugLog = ConfigHandler.c.get("System", "Enable Debug Log", false, "Enables or Disables the debug log.").getBoolean(false); ConfigHandler.experimentalThreadedLoader = ConfigHandler.c.get("System", "Enable Experimental Threaded Material Loader", false, "Enables or Disables the Experimental Threaded Material Loader.").getBoolean(false); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java index 9e832e0820..f0854d78a9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java @@ -36,7 +36,7 @@ import java.util.logging.Logger; public class DebugLog { private static boolean init; - private static FileHandler fh; + static FileHandler fh; private static Logger utilLog; public DebugLog(FMLPreInitializationEvent event) throws IOException { if (DebugLog.init) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java new file mode 100644 index 0000000000..21268ac1c2 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java @@ -0,0 +1,653 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.log; + + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.message.Message; +import org.apache.logging.log4j.message.MessageFactory; + +public class STFUGTPPLOG implements Logger { + + @Override + public void catching(Level level, Throwable t) { + + } + + @Override + public void catching(Throwable t) { + + } + + @Override + public void debug(Marker marker, Message msg) { + + } + + @Override + public void debug(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void debug(Marker marker, Object message) { + + } + + @Override + public void debug(Marker marker, Object message, Throwable t) { + + } + + @Override + public void debug(Marker marker, String message) { + + } + + @Override + public void debug(Marker marker, String message, Object... params) { + + } + + @Override + public void debug(Marker marker, String message, Throwable t) { + + } + + @Override + public void debug(Message msg) { + + } + + @Override + public void debug(Message msg, Throwable t) { + + } + + @Override + public void debug(Object message) { + + } + + @Override + public void debug(Object message, Throwable t) { + + } + + @Override + public void debug(String message) { + + } + + @Override + public void debug(String message, Object... params) { + + } + + @Override + public void debug(String message, Throwable t) { + + } + + @Override + public void entry() { + + } + + @Override + public void entry(Object... params) { + + } + + @Override + public void error(Marker marker, Message msg) { + + } + + @Override + public void error(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void error(Marker marker, Object message) { + + } + + @Override + public void error(Marker marker, Object message, Throwable t) { + + } + + @Override + public void error(Marker marker, String message) { + + } + + @Override + public void error(Marker marker, String message, Object... params) { + + } + + @Override + public void error(Marker marker, String message, Throwable t) { + + } + + @Override + public void error(Message msg) { + + } + + @Override + public void error(Message msg, Throwable t) { + + } + + @Override + public void error(Object message) { + + } + + @Override + public void error(Object message, Throwable t) { + + } + + @Override + public void error(String message) { + + } + + @Override + public void error(String message, Object... params) { + + } + + @Override + public void error(String message, Throwable t) { + + } + + @Override + public void exit() { + + } + + @Override + public R exit(R result) { + return null; + } + + @Override + public void fatal(Marker marker, Message msg) { + + } + + @Override + public void fatal(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void fatal(Marker marker, Object message) { + + } + + @Override + public void fatal(Marker marker, Object message, Throwable t) { + + } + + @Override + public void fatal(Marker marker, String message) { + + } + + @Override + public void fatal(Marker marker, String message, Object... params) { + + } + + @Override + public void fatal(Marker marker, String message, Throwable t) { + + } + + @Override + public void fatal(Message msg) { + + } + + @Override + public void fatal(Message msg, Throwable t) { + + } + + @Override + public void fatal(Object message) { + + } + + @Override + public void fatal(Object message, Throwable t) { + + } + + @Override + public void fatal(String message) { + + } + + @Override + public void fatal(String message, Object... params) { + + } + + @Override + public void fatal(String message, Throwable t) { + + } + + @Override + public MessageFactory getMessageFactory() { + return null; + } + + @Override + public String getName() { + return null; + } + + @Override + public void info(Marker marker, Message msg) { + + } + + @Override + public void info(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void info(Marker marker, Object message) { + + } + + @Override + public void info(Marker marker, Object message, Throwable t) { + + } + + @Override + public void info(Marker marker, String message) { + + } + + @Override + public void info(Marker marker, String message, Object... params) { + + } + + @Override + public void info(Marker marker, String message, Throwable t) { + + } + + @Override + public void info(Message msg) { + + } + + @Override + public void info(Message msg, Throwable t) { + + } + + @Override + public void info(Object message) { + + } + + @Override + public void info(Object message, Throwable t) { + + } + + @Override + public void info(String message) { + + } + + @Override + public void info(String message, Object... params) { + + } + + @Override + public void info(String message, Throwable t) { + + } + + @Override + public boolean isDebugEnabled() { + return false; + } + + @Override + public boolean isDebugEnabled(Marker marker) { + return false; + } + + @Override + public boolean isEnabled(Level level) { + return false; + } + + @Override + public boolean isEnabled(Level level, Marker marker) { + return false; + } + + @Override + public boolean isErrorEnabled() { + return false; + } + + @Override + public boolean isErrorEnabled(Marker marker) { + return false; + } + + @Override + public boolean isFatalEnabled() { + return false; + } + + @Override + public boolean isFatalEnabled(Marker marker) { + return false; + } + + @Override + public boolean isInfoEnabled() { + return false; + } + + @Override + public boolean isInfoEnabled(Marker marker) { + return false; + } + + @Override + public boolean isTraceEnabled() { + return false; + } + + @Override + public boolean isTraceEnabled(Marker marker) { + return false; + } + + @Override + public boolean isWarnEnabled() { + return false; + } + + @Override + public boolean isWarnEnabled(Marker marker) { + return false; + } + + @Override + public void log(Level level, Marker marker, Message msg) { + + } + + @Override + public void log(Level level, Marker marker, Message msg, Throwable t) { + + } + + @Override + public void log(Level level, Marker marker, Object message) { + + } + + @Override + public void log(Level level, Marker marker, Object message, Throwable t) { + + } + + @Override + public void log(Level level, Marker marker, String message) { + + } + + @Override + public void log(Level level, Marker marker, String message, Object... params) { + + } + + @Override + public void log(Level level, Marker marker, String message, Throwable t) { + + } + + @Override + public void log(Level level, Message msg) { + + } + + @Override + public void log(Level level, Message msg, Throwable t) { + + } + + @Override + public void log(Level level, Object message) { + + } + + @Override + public void log(Level level, Object message, Throwable t) { + + } + + @Override + public void log(Level level, String message) { + + } + + @Override + public void log(Level level, String message, Object... params) { + + } + + @Override + public void log(Level level, String message, Throwable t) { + + } + + @Override + public void printf(Level level, Marker marker, String format, Object... params) { + + } + + @Override + public void printf(Level level, String format, Object... params) { + + } + + @Override + public T throwing(Level level, T t) { + return null; + } + + @Override + public T throwing(T t) { + return null; + } + + @Override + public void trace(Marker marker, Message msg) { + + } + + @Override + public void trace(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void trace(Marker marker, Object message) { + + } + + @Override + public void trace(Marker marker, Object message, Throwable t) { + + } + + @Override + public void trace(Marker marker, String message) { + + } + + @Override + public void trace(Marker marker, String message, Object... params) { + + } + + @Override + public void trace(Marker marker, String message, Throwable t) { + + } + + @Override + public void trace(Message msg) { + + } + + @Override + public void trace(Message msg, Throwable t) { + + } + + @Override + public void trace(Object message) { + + } + + @Override + public void trace(Object message, Throwable t) { + + } + + @Override + public void trace(String message) { + + } + + @Override + public void trace(String message, Object... params) { + + } + + @Override + public void trace(String message, Throwable t) { + + } + + @Override + public void warn(Marker marker, Message msg) { + + } + + @Override + public void warn(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void warn(Marker marker, Object message) { + + } + + @Override + public void warn(Marker marker, Object message, Throwable t) { + + } + + @Override + public void warn(Marker marker, String message) { + + } + + @Override + public void warn(Marker marker, String message, Object... params) { + + } + + @Override + public void warn(Marker marker, String message, Throwable t) { + + } + + @Override + public void warn(Message msg) { + + } + + @Override + public void warn(Message msg, Throwable t) { + + } + + @Override + public void warn(Object message) { + + } + + @Override + public void warn(Object message, Throwable t) { + + } + + @Override + public void warn(String message) { + + } + + @Override + public void warn(String message, Object... params) { + + } + + @Override + public void warn(String message, Throwable t) { + + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BWUnificationEnforcer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BWUnificationEnforcer.java deleted file mode 100644 index 784459f25e..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BWUnificationEnforcer.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.system.material; - -import net.minecraftforge.oredict.OreDictionary; - -import java.util.HashSet; - -public class BWUnificationEnforcer { - private static boolean enabled; - private static final HashSet UNIFICATION_TARGETS = new HashSet<>(); - public static boolean isEnabled() { - return BWUnificationEnforcer.enabled; - } - - public static HashSet getUnificationTargets() { - return BWUnificationEnforcer.UNIFICATION_TARGETS; - } - - public static void addUnificationTarget(String aOreDictName){ - if (aOreDictName == null || aOreDictName.isEmpty() || !OreDictionary.doesOreNameExist(aOreDictName)) - return; - BWUnificationEnforcer.UNIFICATION_TARGETS.add(aOreDictName); - BWUnificationEnforcer.enabled = true; - } - - -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index c9ae650d36..0144404b46 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -38,7 +38,7 @@ import java.util.*; public class Werkstoff implements IColorModulationContainer, ISubTagContainer { - static final LinkedHashSet werkstoffHashSet = new LinkedHashSet<>(); + public static final LinkedHashSet werkstoffHashSet = new LinkedHashSet<>(); public static final LinkedHashMap werkstoffHashMap = new LinkedHashMap<>(); public static final LinkedHashMap werkstoffNameHashMap = new LinkedHashMap<>(); @@ -164,10 +164,6 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } this.texSet = texSet; - if (this.getGenerationFeatures().enforceUnification) { - for (OrePrefixes prefix : OrePrefixes.values()) - BWUnificationEnforcer.addUnificationTarget(prefix+this.getDefaultName()); - } Werkstoff.werkstoffHashSet.add(this); Werkstoff.werkstoffHashMap.put(this.mID, this); Werkstoff.werkstoffNameHashMap.put(this.defaultName,this); @@ -378,23 +374,28 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dust,0b1); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustTiny,0b1); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustSmall,0b1); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingot,0b10); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotHot,0b10); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.nugget,0b10); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gem,0b100); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawed,0b100); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemExquisite,0b100); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemChipped,0b100); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawless,0b100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ore,0b1000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustImpure,0b1000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustPure,0b1000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushed,0b1000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedPurified,0b1000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedCentrifuged,0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.cell,0b10000); + Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten,0b1000000); - Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten,0b1000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plate,0b10000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stick,0b10000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rod,0b10000000); @@ -407,6 +408,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.spring,0b100000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.springSmall,0b100000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rotor,0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.wireFine,0b100000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateDouble,0b1000000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateTriple,0b1000000000); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 96fe88d759..d4307a13dd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -48,6 +48,7 @@ import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_Fluid; import gregtech.api.objects.GT_MultiTexture; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.ItemData; import gregtech.api.util.*; import gregtech.common.GT_Proxy; import gregtech.common.items.behaviors.Behaviour_DataOrb; @@ -106,7 +107,8 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.smallGearShape = Enum.valueOf(ItemList.class, "Shape_Extruder_Small_Gear"); WerkstoffLoader.ringMold = Enum.valueOf(ItemList.class, "Shape_Mold_Ring"); WerkstoffLoader.boltMold = Enum.valueOf(ItemList.class, "Shape_Mold_Bolt"); - }catch (NullPointerException | IllegalArgumentException e){} + } catch (NullPointerException | IllegalArgumentException e){} + Element t = EnumHelper.addEnum(Element.class,"Tr",new Class[]{long.class, long.class, long.class, long.class, String.class, String.class, boolean.class}, new Object[]{123L, 203L, 0L, -1L, (String) null, "Tiberium", false}); } //TODO: FREE ID RANGE: 19-32766 @@ -945,7 +947,7 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().onlyDust().addCells(), 66, TextureSet.SET_DULL, - new Pair<>(Ruthenium,1), + new Pair<>(WerkstoffLoader.Ruthenium,1), new Pair<>(Materials.Oxygen,4) //No Byproducts ); @@ -958,7 +960,7 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().addCells(), 67, TextureSet.SET_FLUID, - new Pair<>(Ruthenium,1), + new Pair<>(WerkstoffLoader.Ruthenium,1), new Pair<>(Materials.Oxygen,4), new Pair<>(Materials.Chlorine,2), new Pair<>(Materials.Sodium,2), @@ -1193,7 +1195,27 @@ public class WerkstoffLoader implements Runnable { new Pair<>(Materials.Palladium,3), new Pair<>(WerkstoffLoader.Rhodium,1) ); - + public static final Werkstoff Tiberium = new Werkstoff( + new short[]{0x22,0xEE,0x22}, + "Tiberium", + "Tr", + new Werkstoff.Stats().setProtons(123).setMass(326), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().onlyDust().addGems(), + 89, + TextureSet.SET_DIAMOND + ); + public static final Werkstoff LuVFineWireMaterial = new Werkstoff( + new short[]{0xA4,0xA4,0xA4}, + "Ruridit", + new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), + 90, + TextureSet.SET_METALLIC, + new Pair<>(WerkstoffLoader.Ruthenium,2), + new Pair<>(Materials.Iridium,1) + ); public static HashMap items = new HashMap<>(); public static HashBiMap fluids = HashBiMap.create(); @@ -1423,6 +1445,7 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.items.put(spring, new BW_MetaGenerated_Items(spring)); WerkstoffLoader.items.put(springSmall, new BW_MetaGenerated_Items(springSmall)); WerkstoffLoader.items.put(rotor, new BW_MetaGenerated_Items(rotor)); + WerkstoffLoader.items.put(wireFine, new BW_MetaGenerated_Items(wireFine)); } if ((WerkstoffLoader.toGenerateGlobal & 0b1000000000) != 0) { WerkstoffLoader.items.put(plateDouble, new BW_MetaGenerated_Items(plateDouble)); @@ -1438,8 +1461,6 @@ public class WerkstoffLoader implements Runnable { } - - public void gameRegistryHandler(){ if (FMLCommonHandler.instance().getSide().isClient()) RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); @@ -1452,24 +1473,59 @@ public class WerkstoffLoader implements Runnable { public static void runGTItemDataRegistrator(){ HashSet toRem = new HashSet<>(); for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - Materials werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName().replaceAll(" ",""),werkstoff.getDefaultName()); - GT_OreDictUnificator.addAssociation(ore,werkstoffBridgeMaterial,new ItemStack(WerkstoffLoader.BWOres,1,werkstoff.getmID()),false); + Materials werkstoffBridgeMaterial = new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName()); for (OrePrefixes prefixes : values()) { - if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) != 0 && werkstoff.get(prefixes) != null && werkstoff.get(prefixes).getItem() != null) - GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, werkstoff.get(prefixes), false); - } - if (werkstoff.getGenerationFeatures().hasCells()) { - werkstoffBridgeMaterial.setHasCorrespondingFluid(true); - werkstoffBridgeMaterial.setHasCorrespondingGas(true); - werkstoffBridgeMaterial.mFluid = werkstoff.getFluidOrGas(1).getFluid(); - werkstoffBridgeMaterial.mGas = werkstoff.getFluidOrGas(1).getFluid(); - } - if (werkstoff.getGenerationFeatures().hasMolten()) { - werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid(); + if (!(prefixes == cell && werkstoff.getType().equals(Werkstoff.Types.ELEMENT))) { + if (prefixes == dust && werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { + if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { + boolean ElementSet = false; + for (Element e : Element.values()) { + if (e.toString().equals(werkstoff.getToolTip())) { + if (e.mLinkedMaterials.size() > 0) + break; + werkstoffBridgeMaterial = new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, true, werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName()); + werkstoffBridgeMaterial.mElement = e; + e.mLinkedMaterials = new ArrayList<>(); + e.mLinkedMaterials.add(werkstoffBridgeMaterial); + GT_OreDictUnificator.addAssociation(dust, werkstoffBridgeMaterial, werkstoff.get(dust), false); + GT_OreDictUnificator.set(dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true); + ElementSet = true; + break; + } + } + if (!ElementSet) + continue; + try { + Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); + f.setAccessible(true); + Map MATERIALS_MAP = (Map) f.get(null); + MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); + } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { + e.printStackTrace(); + } + ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); + Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(prefixes)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, null, new ItemStack[]{werkstoff.get(prefixes)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); + } + } else if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0 && werkstoff.get(prefixes) != null && werkstoff.get(prefixes).getItem() != null) + GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, werkstoff.get(prefixes), false); + + if (werkstoff.getGenerationFeatures().hasCells()) { + werkstoffBridgeMaterial.setHasCorrespondingFluid(true); + werkstoffBridgeMaterial.setHasCorrespondingGas(true); + werkstoffBridgeMaterial.mFluid = werkstoff.getFluidOrGas(1).getFluid(); + werkstoffBridgeMaterial.mGas = werkstoff.getFluidOrGas(1).getFluid(); + } + if (werkstoff.getGenerationFeatures().hasMolten()) { + werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid(); + } + werkstoffBridgeMaterial.mName = werkstoff.getDefaultName(); + toRem.add(werkstoffBridgeMaterial); + werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); + } } - werkstoffBridgeMaterial.mName = werkstoff.getDefaultName(); - toRem.add(werkstoffBridgeMaterial); - werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); } try { Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); @@ -1639,6 +1695,11 @@ public class WerkstoffLoader implements Runnable { GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGt), GT_Proxy.tBits, new Object[]{"SPS", "PwP", "SPS", 'P', werkstoff.get(plate), 'S', werkstoff.get(stick)}); GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot,4), ItemList.Shape_Extruder_Gear.get(0L), werkstoff.get(gearGt), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1), 8 * tVoltageMultiplier); + //wireFine + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Wire.get(0L), werkstoff.get(wireFine,8), (int) Math.max(werkstoff.getStats().getMass() * 1.5F, 1F), 8 * tVoltageMultiplier); + GT_Values.RA.addWiremillRecipe(werkstoff.get(ingot), werkstoff.get(wireFine,8), (int) Math.max(werkstoff.getStats().getMass(), 1), 8 * tVoltageMultiplier); + GT_Values.RA.addWiremillRecipe(werkstoff.get(stick), werkstoff.get(wireFine,4), (int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F), 8 * tVoltageMultiplier); + //smallGear if (WerkstoffLoader.smallGearShape != null) GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), WerkstoffLoader.smallGearShape.get(0L), werkstoff.get(gearGtSmall), (int) werkstoff.getStats().mass, 8 * tVoltageMultiplier); @@ -1819,39 +1880,6 @@ public class WerkstoffLoader implements Runnable { GT_ModHandler.addPulverisationRecipe(werkstoff.get(ingot),werkstoff.get(dust)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(nugget),werkstoff.get(dustTiny)); } - - if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { - Materials werkstoffBridgeMaterial = null; - boolean ElementSet = false; - for (Element e : Element.values()){ - if (e.toString().equals(werkstoff.getToolTip())){ - if (e.mLinkedMaterials.size() > 0) - break; - werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName().replaceAll(" ",""),werkstoff.getDefaultName()); - werkstoffBridgeMaterial.mElement = e; - e.mLinkedMaterials.add(werkstoffBridgeMaterial); - ElementSet = true; - break; - } - } - if (!ElementSet) - return; - - GT_OreDictUnificator.addAssociation(dust,werkstoffBridgeMaterial, werkstoff.get(dust),false); - try { - Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); - f.setAccessible(true); - Map MATERIALS_MAP = (Map) f.get(null); - MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); - } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { - e.printStackTrace(); - } - ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); - Behaviour_DataOrb.setDataName(scannerOutput,werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false,new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(dust)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),30,0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false,new BWRecipes.DynamicGTRecipe(false, null,new ItemStack[]{werkstoff.get(dust)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),30,0)); - } } } @@ -2042,7 +2070,7 @@ public class WerkstoffLoader implements Runnable { } if (!ElementSet) return; - + GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),false); try { Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 56ad180e95..b865c9e39f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -126,127 +126,9 @@ public class AdditionalRecipes implements Runnable { Materials.SolderingAlloy.getMolten((i + 1) * 144) }, null, (i + 1) * 1500, BW_Util.getMachineVoltageFromTier(i + 1), CLEANROOM)); } - GregTech_API.sAfterGTPostload.add(new AdditionalRecipes.LuVHullReplacer()); + GregTech_API.sAfterGTPostload.add(new LuVTierEnhancer()); AdditionalRecipes.oldGThelperMethod(); } - - public static class LuVHullReplacer implements Runnable { - - public void run() { - List bufferedRecipeList = null; - try { - bufferedRecipeList = (List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - assert bufferedRecipeList != null; - - HashSet LuVMachines = new HashSet<>(); - OrePrefixes[] LuVMaterialsGenerated = {dust, ingot, plate, stick, stickLong, rotor, plateDouble, plateDense}; - for (ItemList item : ItemList.values()) { - if (item.toString().contains("LuV") && item.hasBeenSet()) - LuVMachines.add(item.get(1)); - } - if (Loader.isModLoaded("dreamcraft")) { - try { - Class customItemListClass = Class.forName("com.dreammaster.gthandler.CustomItemList"); - Method hasnotBeenSet = MethodUtils.getAccessibleMethod(customItemListClass, "hasBeenSet"); - Method get = MethodUtils.getAccessibleMethod(customItemListClass, "get", long.class, Object[].class); - for (Enum customItemList : (Enum[]) FieldUtils.getField(customItemListClass, "$VALUES", true).get(null)) { - if (customItemList.toString().contains("LuV") && (boolean) hasnotBeenSet.invoke(customItemList)) - LuVMachines.add((ItemStack) get.invoke(customItemList, 1, new Object[0])); - } - } catch (IllegalAccessException | ClassNotFoundException | InvocationTargetException e) { - e.printStackTrace(); - } - } - GT_ModHandler.addCraftingRecipe(ItemList.Casing_LuV.get(1), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, new Object[]{"PPP", "PwP", "PPP", 'P', WerkstoffLoader.LuVTierMaterial.get(plate)}); - for (ItemStack stack : LuVMachines) { - for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - for (GT_Recipe recipe : map.mRecipeList) { - for (OrePrefixes prefixes : LuVMaterialsGenerated) { - if (AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { - AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } - if (AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { - AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } - } - if (AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { - AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - } - if (AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { - AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - } - } - } - for (OrePrefixes prefixes : LuVMaterialsGenerated) { - for (Object obj : CraftingManager.getInstance().getRecipeList()) { - if (!(obj instanceof GT_Shaped_Recipe)) - continue; - if (GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true)) { - AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(), GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } - } - for (Object obj : bufferedRecipeList) { - if (!(obj instanceof GT_Shaped_Recipe)) - continue; - if (GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true)) { - AdditionalRecipes.LuVHullReplacer.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(), GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } - } - } - } - } - - private static boolean doStacksCointainAndReplace(FluidStack[] stacks, FluidStack stack, boolean replace, Fluid... replacement) { - boolean replaced = false; - for (int i = 0; i < stacks.length; i++) { - if (GT_Utility.areFluidsEqual(stack, stacks[i])) - if (!replace) - return true; - else { - int amount = stacks[i].amount; - stacks[i] = new FluidStack(replacement[0], amount); - replaced = true; - } - } - return replaced; - } - - private static boolean doStacksCointainAndReplace(Object[] stacks, ItemStack stack, boolean replace, ItemStack... replacement) { - boolean replaced = false; - for (int i = 0; i < stacks.length; i++) { - if (!GT_Utility.isStackValid(stacks[i])) { - if (stacks[i] instanceof ArrayList && ((ArrayList)stacks[i]).size() > 0) { - if (GT_Utility.areStacksEqual(stack, (ItemStack) ((ArrayList)stacks[i]).get(0), true)) - if (!replace) - return true; - else { - int amount = ((ItemStack) ((ArrayList)stacks[i]).get(0)).stackSize; - stacks[i] = new ArrayList<>(); - ((ArrayList)stacks[i]).add(replacement[0].splitStack(amount)); - replaced = true; - } - - } else - continue; - } else if (GT_Utility.areStacksEqual(stack, (ItemStack) stacks[i], true)) - if (!replace) - return true; - else { - int amount = ((ItemStack) stacks[i]).stackSize; - stacks[i] = replacement[0].splitStack(amount); - replaced = true; - } - } - return replaced; - } - } private static void oldGThelperMethod(){ //manual override for older GT Werkstoff werkstoff = WerkstoffLoader.Oganesson; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java new file mode 100644 index 0000000000..7542253844 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; + +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import cpw.mods.fml.common.Loader; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.objects.ItemData; +import gregtech.api.util.*; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.apache.commons.lang3.reflect.MethodUtils; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; + +import static gregtech.api.enums.OrePrefixes.*; + +public class LuVTierEnhancer implements Runnable { + + public void run() { + LuVTierEnhancer.replaceAsslineRecipes(); + List bufferedRecipeList = null; + try { + bufferedRecipeList = (List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + assert bufferedRecipeList != null; + + HashSet LuVMachines = new HashSet<>(); + OrePrefixes[] LuVMaterialsGenerated = {dust, ingot, plate, stick, stickLong, rotor, plateDouble, plateDense}; + for (ItemList item : ItemList.values()) { + if (item.toString().contains("LuV") && item.hasBeenSet()) + LuVMachines.add(item.get(1)); + } + if (Loader.isModLoaded("dreamcraft")) { + try { + Class customItemListClass = Class.forName("com.dreammaster.gthandler.CustomItemList"); + Method hasnotBeenSet = MethodUtils.getAccessibleMethod(customItemListClass, "hasBeenSet"); + Method get = MethodUtils.getAccessibleMethod(customItemListClass, "get", long.class, Object[].class); + for (Enum customItemList : (Enum[]) FieldUtils.getField(customItemListClass, "$VALUES", true).get(null)) { + if (customItemList.toString().contains("LuV") && (boolean) hasnotBeenSet.invoke(customItemList)) + LuVMachines.add((ItemStack) get.invoke(customItemList, 1, new Object[0])); + } + } catch (IllegalAccessException | ClassNotFoundException | InvocationTargetException e) { + e.printStackTrace(); + } + } + GT_ModHandler.addCraftingRecipe(ItemList.Casing_LuV.get(1), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, new Object[]{"PPP", "PwP", "PPP", 'P', WerkstoffLoader.LuVTierMaterial.get(plate)}); + for (ItemStack stack : LuVMachines) { + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + for (GT_Recipe recipe : map.mRecipeList) { + for (OrePrefixes prefixes : LuVMaterialsGenerated) { + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + } + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + } + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + } + } + } + for (OrePrefixes prefixes : LuVMaterialsGenerated) { + for (Object obj : CraftingManager.getInstance().getRecipeList()) { + if (!(obj instanceof GT_Shaped_Recipe)) + continue; + if (GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true)) { + LuVTierEnhancer.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(), GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + } + for (Object obj : bufferedRecipeList) { + if (!(obj instanceof GT_Shaped_Recipe)) + continue; + if (GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true)) { + LuVTierEnhancer.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(), GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + } + } + } + } + + private static void replaceAsslineRecipes(){ + for (GT_Recipe.GT_Recipe_AssemblyLine recipe_assemblyLine : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){ + if (recipe_assemblyLine.mEUt > 6000) + continue; + for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) { + ItemStack stack = recipe_assemblyLine.mInputs[i]; + if (!BW_Util.checkStackAndPrefix(stack)) + continue; + ItemData ass = GT_OreDictUnificator.getAssociation(stack); + if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) + recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix,stack.stackSize); + } + } + for (GT_Recipe recipe_assemblyLine : GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList){ + if (recipe_assemblyLine.mEUt > BW_Util.getTierVoltage(6)) + continue; + if (BW_Util.checkStackAndPrefix(recipe_assemblyLine.mOutputs[0])) + continue; + for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) { + ItemStack stack = recipe_assemblyLine.mInputs[i]; + if (!BW_Util.checkStackAndPrefix(stack)) + continue; + ItemData ass = GT_OreDictUnificator.getAssociation(stack); + if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) + recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix,stack.stackSize); + } + } + for (GT_Recipe recipe_assemblyLine : GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList){ + if (recipe_assemblyLine.mEUt > 6000) + continue; + for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) { + ItemStack stack = recipe_assemblyLine.mInputs[i]; + if (!BW_Util.checkStackAndPrefix(stack)) + continue; + ItemData ass = GT_OreDictUnificator.getAssociation(stack); + if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) + recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix,stack.stackSize); + } + } + } + + private static boolean doStacksCointainAndReplace(FluidStack[] stacks, FluidStack stack, boolean replace, Fluid... replacement) { + boolean replaced = false; + for (int i = 0; i < stacks.length; i++) { + if (GT_Utility.areFluidsEqual(stack, stacks[i])) + if (!replace) + return true; + else { + int amount = stacks[i].amount; + stacks[i] = new FluidStack(replacement[0], amount); + replaced = true; + } + } + return replaced; + } + + private static boolean doStacksCointainAndReplace(Object[] stacks, ItemStack stack, boolean replace, ItemStack... replacement) { + boolean replaced = false; + for (int i = 0; i < stacks.length; i++) { + if (!GT_Utility.isStackValid(stacks[i])) { + if (stacks[i] instanceof ArrayList && ((ArrayList)stacks[i]).size() > 0) { + if (GT_Utility.areStacksEqual(stack, (ItemStack) ((ArrayList)stacks[i]).get(0), true)) + if (!replace) + return true; + else { + int amount = ((ItemStack) ((ArrayList)stacks[i]).get(0)).stackSize; + stacks[i] = new ArrayList<>(); + ((ArrayList)stacks[i]).add(replacement[0].splitStack(amount)); + replaced = true; + } + + } else + continue; + } else if (GT_Utility.areStacksEqual(stack, (ItemStack) stacks[i], true)) + if (!replace) + return true; + else { + int amount = ((ItemStack) stacks[i]).stackSize; + stacks[i] = replacement[0].splitStack(amount); + replaced = true; + } + } + return replaced; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java index 5ef10a1343..c3e8397117 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java @@ -30,22 +30,32 @@ import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.items.GT_Generic_Block; +import gregtech.api.items.GT_Generic_Item; +import gregtech.api.objects.ItemData; import gregtech.api.objects.MaterialStack; -import gregtech.api.util.*; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Block_Ores_Abstract; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.FurnaceRecipes; -import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.*; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; import org.apache.commons.lang3.reflect.FieldUtils; +import java.lang.reflect.Array; import java.lang.reflect.Field; -import java.util.HashSet; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; import static gregtech.api.enums.OrePrefixes.*; @@ -59,11 +69,14 @@ public class PlatinumSludgeOverHaul { Materials.get("Tetranaquadahdiindiumhexaplatiumosminid"), Materials.get("Longasssuperconductornameforuvwire"), }; + private static final OrePrefixes[] OPBLACKLIST = { + crushedCentrifuged,crushed,crushedPurified,dustPure,dustImpure,dustRefined,dust,dustTiny,dustSmall + }; private PlatinumSludgeOverHaul() { } - public static void runHelperrecipes() { + private static void runHelperrecipes() { //DilutedSulfuricAcid GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(3), Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, Materials.DilutedSulfuricAcid.getCells(4), 30, 30); GT_Values.RA.addMixerRecipe(Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, Materials.SulfuricAcid.getFluid(3000), Materials.DilutedSulfuricAcid.getFluid(4000), Materials.Empty.getCells(1), 30, 30); @@ -83,22 +96,22 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addChemicalRecipe(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), AmmoniumChloride.getFluidOrGas(1000), Materials.Empty.getCells(1), null, 15); //base sollution - for (Werkstoff w : Werkstoff.werkstoffHashMap.values()) + for (Werkstoff w : Werkstoff.werkstoffHashSet) if (w.containsStuff(Materials.Sulfur) && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); - GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny, 2), 250); + GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny), 250); } for (Materials m : Materials.values()) if (PlatinumSludgeOverHaul.materialsContains(m, Materials.Sulfur) && (PlatinumSludgeOverHaul.materialsContains(m, Materials.Copper) || PlatinumSludgeOverHaul.materialsContains(m, Materials.Nickel))) { GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); - GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny, 2), 250); + GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny), 250); } //Pt GT_Values.RA.addBlastRecipe(PTMetallicPowder.get(dust, 3), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Platinum.getNuggets(2), null, 600, 120, Materials.Platinum.mMeltingPoint); - GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(2000), PTConcentrate.getFluidOrGas(2000), PTResidue.get(dustTiny, 2), 250); - GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell), null, AmmoniumChloride.getFluidOrGas(100), PDAmmonia.getFluidOrGas(100), PTSaltCrude.get(dustTiny, 8), PTRawPowder.get(dustTiny), Materials.Empty.getCells(1), null, null, null, null, 600, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{}, new FluidStack[]{PTConcentrate.getFluidOrGas(1000), AmmoniumChloride.getFluidOrGas(100)}, new FluidStack[]{PDAmmonia.getFluidOrGas(100)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 8), PTRawPowder.get(dustTiny)}, 600, 30); + GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); + GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2),null, AmmoniumChloride.getFluidOrGas(200), PDAmmonia.getFluidOrGas(200), PTSaltCrude.get(dustTiny, 18), PTRawPowder.get(dustTiny,2), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(200)}, new FluidStack[]{PDAmmonia.getFluidOrGas(200), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2)}, 1200, 30); GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ PTSaltRefined.get(dust), PTSaltRefined.get(dust), @@ -162,7 +175,7 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addChemicalRecipe(IridiumChloride.get(dust), Materials.Calcium.getDust(3), null, CalciumChloride.getFluidOrGas(3000), PGSDResidue2.get(dust), Materials.Iridium.getDust(1), 300, 1920); //Rh - GT_Values.RA.addChemicalRecipe(RHSulfate.get(cell, 11), GT_Utility.getIntegratedCircuit(1), Materials.Water.getFluid(10000), Materials.Potassium.getMolten(288), RHSulfateSolution.get(cell, 11), LeachResidue.get(dustTiny, 10), 300, 30); + GT_Values.RA.addChemicalRecipe(RHSulfate.get(cell, 11), GT_Utility.getIntegratedCircuit(1), Materials.Water.getFluid(10000), Materials.Potassium.getMolten(1999), RHSulfateSolution.get(cell, 11), LeachResidue.get(dustTiny, 10), 300, 30); GT_Values.RA.addChemicalRecipe(Materials.Zinc.getDust(1), null, RHSulfateSolution.getFluidOrGas(1000), null, ZincSulfate.get(dust), CrudeRhMetall.get(dust), 300); GT_Values.RA.addBlastRecipe(CrudeRhMetall.get(dust), Materials.Salt.getDust(1), Materials.Chlorine.getGas(1000), null, RHSalt.get(dust, 3), null, 300, 120, 600); @@ -196,33 +209,35 @@ public class PlatinumSludgeOverHaul { } public static void replacePureElements() { + //furnace for (Object entry : FurnaceRecipes.smelting().getSmeltingList().entrySet()) { Map.Entry realEntry = (Map.Entry) entry; if (GT_Utility.isStackValid(realEntry.getKey()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getKey())) if ((!GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dust) && !GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dustTiny)) || !GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mMaterial.mMaterial.equals(Materials.Platinum)) - if (GT_Utility.isStackValid(realEntry.getValue()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())) - if (GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()).mMaterial.mMaterial.equals(Materials.Platinum)) - realEntry.setValue(PTMetallicPowder.get(dust, ((ItemStack) realEntry.getValue()).stackSize * 2)); - else if (GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()).mMaterial.mMaterial.equals(Materials.Palladium)) - realEntry.setValue(PDMetallicPowder.get(dust, ((ItemStack) realEntry.getValue()).stackSize * 2)); - } - - for (Object obj : CraftingManager.getInstance().getRecipeList()) { - PlatinumSludgeOverHaul.setnewMaterialInRecipe(obj); + if (GT_Utility.isStackValid(realEntry.getValue()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())){ + ItemData ass = GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()); + if (ass.mMaterial.mMaterial.equals(Materials.Platinum)) + if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) + realEntry.setValue(PTMetallicPowder.get(ass.mPrefix == nugget ? dustTiny : dust, ((ItemStack) realEntry.getValue()).stackSize * 2)); + else if (ass.mMaterial.mMaterial.equals(Materials.Palladium)) + if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) + realEntry.setValue(PDMetallicPowder.get(ass.mPrefix == nugget ? dustTiny : dust, ((ItemStack) realEntry.getValue()).stackSize * 2)); + } } + //vanilla crafting + CraftingManager.getInstance().getRecipeList().forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); + //gt crafting try { - for (Object obj : (List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null)) { - PlatinumSludgeOverHaul.setnewMaterialInRecipe(obj); - } + ((List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null)).forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); } catch (IllegalAccessException e) { e.printStackTrace(); } - + //gt machines maploop: for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { if (map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes) continue; - HashSet toDel = new HashSet(); + HashSet toDel = new HashSet(); recipeloop: for (GT_Recipe recipe : map.mRecipeList) { if (recipe.mFakeRecipe) @@ -303,13 +318,13 @@ public class PlatinumSludgeOverHaul { } if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount * 8); + recipe.mOutputs[i] = IrOsLeachResidue.get(dust).splitStack(amount); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dustSmall).splitStack(amount * 8); + recipe.mOutputs[i] = IrOsLeachResidue.get(dustSmall).splitStack(amount); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 8); + recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount); } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Iridium)) { for (int j = 0; j < recipe.mInputs.length; j++) { @@ -318,64 +333,189 @@ public class PlatinumSludgeOverHaul { } if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount * 4); + recipe.mOutputs[i] = IrLeachResidue.get(dust).splitStack(amount); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dustSmall).splitStack(amount * 4); + recipe.mOutputs[i] = IrLeachResidue.get(dustSmall).splitStack(amount); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 4); + recipe.mOutputs[i] = IrLeachResidue.get(dustTiny).splitStack(amount); } } } } map.mRecipeList.removeAll(toDel); } + //TODO: remove EnderIO recipes + + //fix HV tier + PlatinumSludgeOverHaul.replaceHVCircuitMaterials(); + //add new recipes PlatinumSludgeOverHaul.runHelperrecipes(); } + private static void replaceHVCircuitMaterials(){ + GT_Values.RA.addMixerRecipe(Materials.Redstone.getDust(1),Materials.Electrum.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,Materials.Nikolite.getDust(8),1800,120); + for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList){ + if (recipe.mEUt > 512) + continue; + if (BW_Util.checkStackAndPrefix(recipe.mOutputs[0])) { + for (int i = 0; i < recipe.mInputs.length; i++) { + ItemStack stack = recipe.mInputs[i]; + ItemData ass = GT_OreDictUnificator.getAssociation(stack); + if (BW_Util.checkStackAndPrefix(stack) && ass.mMaterial.mMaterial.equals(Materials.Platinum)) { + recipe.mInputs[i] = GT_OreDictUnificator.get(ass.mPrefix,Materials.BlueAlloy,stack.stackSize); + } + } + } + } + } + private static void setnewMaterialInRecipe(Object obj) { - if (!(obj instanceof GT_Shaped_Recipe)) - return; - GT_Shaped_Recipe recipe = (GT_Shaped_Recipe) obj; + String inputName = "output"; + String inputItemName = "input"; + if (!(obj instanceof ShapedOreRecipe || obj instanceof ShapelessOreRecipe)){ + if (obj instanceof ShapedRecipes || (obj instanceof ShapelessRecipes)) { + inputName = "recipeOutput"; + inputItemName = "recipeItems"; + } + else if (Loader.isModLoaded("miscutils")) { + try { + if (Class.forName("gtPlusPlus.api.objects.minecraft.ShapedRecipe").isAssignableFrom(obj.getClass())) + obj = FieldUtils.getField(obj.getClass(),"mRecipe",true).get(obj); + } catch (ClassNotFoundException | IllegalAccessException e) { + e.printStackTrace(); + } + } + } + + IRecipe recipe = (IRecipe) obj; ItemStack otpt = recipe.getRecipeOutput(); - if (!BW_Util.checkStackAndPrefix(otpt)) + + Field out = FieldUtils.getDeclaredField(recipe.getClass(), inputName, true); + if (out == null) + out = FieldUtils.getField(recipe.getClass(), inputName, true); + + + Field in = FieldUtils.getDeclaredField(recipe.getClass(), inputItemName, true); + if (in == null) + in = FieldUtils.getField(recipe.getClass(), inputItemName, true); + if (in == null) return; - Field out = FieldUtils.getDeclaredField(recipe.getClass(), "output", true); + FieldUtils.removeFinalModifier(in,true); + Object input = null; + try { + input = in.get(obj); + } catch (IllegalAccessException e) { + e.printStackTrace(); + return; + } + assert input != null; + if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Platinum.getDust(1), true)) { + if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Platinum)) + return; try { out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize * 2)); } catch (IllegalAccessException e) { e.printStackTrace(); } } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Palladium.getDust(1), true)) { + if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Palladium)) + return; try { out.set(recipe, PDMetallicPowder.get(dust, otpt.stackSize * 2)); } catch (IllegalAccessException e) { e.printStackTrace(); } } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Iridium.getDust(1), true)) { + if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Iridium)) + return; try { - out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize * 4)); + out.set(recipe, IrLeachResidue.get(dust, otpt.stackSize)); } catch (IllegalAccessException e) { e.printStackTrace(); } } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Osmium.getDust(1), true)) { + if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Osmium)) + return; try { - out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize * 8)); + out.set(recipe, IrOsLeachResidue.get(dust, otpt.stackSize)); } catch (IllegalAccessException e) { e.printStackTrace(); } } } + private static boolean checkRecipe(Object input,Materials mat){ + if (input instanceof List || input instanceof Object[]) { + Set lists = new HashSet(), stacks= new HashSet(); + List ip = input instanceof List ? (List)input : new ArrayList(); + Object[] ip2 = input instanceof Object[] ? (Object[])input : new Object[0]; + + for (Object o : ip){ + if (o instanceof List) + lists.add(o); + else if (o instanceof ItemStack) + stacks.add(o); + } + for (Object o : ip2){ + if (o instanceof List) + lists.add(o); + else if (o instanceof ItemStack) + stacks.add(o); + } + + for (Object o : lists) { + if (!((List) o).isEmpty()) + stacks.add(((List) o).get(0)); + } + + for (Object stack : stacks) { + if (stack instanceof ItemStack) { + if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(crateGtDust, mat, 1), (ItemStack) stack)) + return true; + } + } + + boolean allSame = false; + for (Object stack : stacks) { + if (stack instanceof ItemStack) { + allSame = BW_Util.checkStackAndPrefix((ItemStack) stack) && GT_OreDictUnificator.getAssociation((ItemStack) stack).mMaterial.mMaterial.equals(mat); + } else { + allSame = false; + break; + } + if (!allSame) + break; + } + return allSame; + } + return false; + } + private static boolean isInBlackList(ItemStack stack) { if (stack.getItem() instanceof BW_MetaGenerated_Items) return true; + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(MainMod.MOD_ID)) return true; + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(BartWorksCrossmod.MOD_ID)) return true; + + if (Block.getBlockFromItem(stack.getItem()) instanceof GT_Generic_Block && !(Block.getBlockFromItem(stack.getItem()) instanceof GT_Block_Ores_Abstract)) + return true; + + if (stack.getItem() instanceof GT_Generic_Item) { + if (!BW_Util.checkStackAndPrefix(stack)) + return false; + return (!Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mPrefix)) || Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); + } + + if (GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_1.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_2.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_4.get(1),stack,true)) + return true; + if (Loader.isModLoaded("miscutils")) { try { if (Class.forName("gtPlusPlus.core.item.base.BaseItemComponent").isAssignableFrom(stack.getItem().getClass()) && !(stack.getUnlocalizedName().contains("dust") || stack.getUnlocalizedName().contains("Dust"))) @@ -386,12 +526,10 @@ public class PlatinumSludgeOverHaul { e.printStackTrace(); } } + if (!BW_Util.checkStackAndPrefix(stack)) return false; - for (Materials m : PlatinumSludgeOverHaul.BLACKLIST) { - if (GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial.equals(m)) - return true; - } - return false; + + return Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index 1dc9e080c4..08e26b4075 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -54,7 +54,7 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { new BW_WorldGenRoss128b("ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, Djurleit, Bornite, Wittichenit, Tetrahedrite); new BW_WorldGenRoss128b("ore.mix.ross128.Forsterit", true, 20, 90, 50, 2, 32, Forsterit, Fayalit, DescloiziteCUVO4, DescloiziteZNVO4); new BW_WorldGenRoss128b("ore.mix.ross128.Hedenbergit", true, 20, 90, 50, 2, 32, Hedenbergit, Fayalit, DescloiziteCUVO4, DescloiziteZNVO4); - new BW_WorldGenRoss128b("ore.mix.ross128.RedZircon", true, 10, 80, 40, 3, 24, Fayalit,FuchsitAL , RedZircon,FuchsitCR); + new BW_WorldGenRoss128b("ore.mix.ross128.RedZircon", true, 10, 80, 40, 3, 24, Fayalit, FuchsitAL, RedZircon, FuchsitCR); } public static void init_undergroundFluidsRoss128() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java index 87158bf01e..ebe2f69dce 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java @@ -28,7 +28,9 @@ import gregtech.api.util.GT_ModHandler; import net.minecraft.block.Block; import net.minecraft.util.StatCollector; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; +import static gregtech.api.enums.Materials.*; public class BW_WorldGenRoss128ba extends BW_OreLayer { @@ -42,7 +44,9 @@ public class BW_WorldGenRoss128ba extends BW_OreLayer { } public static void init_OresRoss128ba() { - //none + new BW_WorldGenRoss128b("ore.mix.ross128ba.tib", true, 30, 60, 6, 1, 16, Tiberium, Naquadah, NaquadahEnriched, NaquadahEnriched); + new BW_WorldGenRoss128b("ore.mix.ross128.Tungstate", true, 5, 40, 10, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite); + } public static void init_undergroundFluidsRoss128ba() { -- cgit From 05be80efe3d7a1a302d75f3d07e19f9133cf8584 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 14 Sep 2019 03:40:12 +0200 Subject: fixes +added a warning to not disable Ross after world start +fixed a lot of broken recipes +further fixed bridge materials/OreDict +added Tiberium FuelRods +fixed lenses not showing up +fixed gem only materials +added NoBlast SubTag Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 4ede8aeef53134b181aba6b15c5e372eda4ef9ea --- .../github/bartimaeusnek/bartworks/MainMod.java | 11 +- .../bartworks/common/configs/ConfigHandler.java | 2 +- .../system/material/BW_MetaGenerated_Items.java | 4 + .../system/material/BW_NonMeta_MaterialItems.java | 160 +++++++++++++++++++++ .../bartworks/system/material/Werkstoff.java | 31 ++-- .../bartworks/system/material/WerkstoffLoader.java | 59 +++++--- .../processingLoaders/AdditionalRecipes.java | 96 +++++++------ .../processingLoaders/AfterLuVTierEnhacement.java | 63 ++++++++ .../processingLoaders/LoadItemContainers.java | 40 ++++++ .../processingLoaders/LuVTierEnhancer.java | 1 + .../processingLoaders/PlatinumSludgeOverHaul.java | 38 +++-- .../system/oregen/BW_WorldGenRoss128ba.java | 5 +- .../textures/items/gt.Double_Tiberiumcell.png | Bin 0 -> 362 bytes .../textures/items/gt.Double_TiberiumcellDep.png | Bin 0 -> 364 bytes .../textures/items/gt.Quad_Tiberiumcell.png | Bin 0 -> 535 bytes .../textures/items/gt.Quad_TiberiumcellDep.png | Bin 0 -> 528 bytes .../gregtech/textures/items/gt.Tiberiumcell.png | Bin 0 -> 318 bytes .../gregtech/textures/items/gt.TiberiumcellDep.png | Bin 0 -> 318 bytes 18 files changed, 410 insertions(+), 100 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.Double_Tiberiumcell.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.Double_TiberiumcellDep.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.Quad_Tiberiumcell.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.Quad_TiberiumcellDep.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.Tiberiumcell.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.TiberiumcellDep.png diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index e3b88b62e8..126a1263f4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -194,6 +194,7 @@ public final class MainMod { GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp.desc","Get ALL the thermal energy!"); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline","Cheaper Circuits?"); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline.desc","Well, yes, but actually no..."); + GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.nqgen","Can be used as Enriched Naquadah Fuel Substitute"); } } @Mod.EventHandler @@ -357,9 +358,11 @@ public final class MainMod { private static void runUnficationDeleter(Werkstoff werkstoff) { if (werkstoff.getType() == Werkstoff.Types.ELEMENT) { - werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip()); - Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>(); - Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial()); + if (werkstoff.getBridgeMaterial() != null) { + werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip()); + Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>(); + Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial()); + } } for (OrePrefixes prefixes : OrePrefixes.values()) @@ -483,7 +486,7 @@ public final class MainMod { private static void addElectricImplosionCompressorRecipes() { if (eicMap == null) { eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); - GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream().filter(e -> e.mInputs != null).forEach(recipe -> eicMap.addRecipe(true, Arrays.stream(recipe.mInputs).filter(e -> !MainMod.checkForExplosives(e)).distinct().toArray(ItemStack[]::new), recipe.mOutputs, null, null, null, recipe.mDuration, BW_Util.getMachineVoltageFromTier(10), 0)); + GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream().filter(e -> e.mInputs != null).forEach(recipe -> eicMap.addRecipe(true, Arrays.stream(recipe.mInputs).filter(e -> !MainMod.checkForExplosives(e)).distinct().toArray(ItemStack[]::new), recipe.mOutputs, null, null, null, 1, BW_Util.getMachineVoltageFromTier(10), 0)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index da0397087e..1f808bae95 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -107,7 +107,7 @@ public class ConfigHandler { ConfigHandler.ross128btier = ConfigHandler.c.get("CrossMod Interactions", "Rocket Tier - Ross128b", 3, "The Rocket Tier for Ross128b").getInt(3); ConfigHandler.ross128batier = ConfigHandler.c.get("CrossMod Interactions", "Rocket Tier - Ross128ba", 3, "The Rocket Tier for Ross128a").getInt(3); ConfigHandler.ross128bRuinChance = ConfigHandler.c.get("CrossMod Interactions", "Ruin Chance - Ross128b", 512, "Higher Values mean lesser Ruins.").getInt(512); - ConfigHandler.Ross128Enabled = ConfigHandler.c.get("CrossMod Interactions", "Galacticraft - Activate Ross128 System", true, "If the Ross128 System should be activated").getBoolean(true); + ConfigHandler.Ross128Enabled = ConfigHandler.c.get("CrossMod Interactions", "Galacticraft - Activate Ross128 System", true, "If the Ross128 System should be activated, DO NOT CHANGE AFTER WORLD GENERATION").getBoolean(true); ConfigHandler.landerType = ConfigHandler.c.get("CrossMod Interactions", "LanderType", 3, "1 = Moon Lander, 2 = Landing Balloons, 3 = Asteroid Lander").getInt(3); ConfigHandler.disableMagicalForest = ConfigHandler.c.get("CrossMod Interactions", "Disable Magical Forest - Ross128b", false, "True disables the magical Forest Biome on Ross for more performance during World generation.").getBoolean(false); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 9b7f2f44e5..e7a4c3aa02 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -131,6 +131,10 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } if (this.orePrefixes == OrePrefixes.crushed) aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify.2")); + + if (aStack != null && aStack.getItem() instanceof BW_MetaGenerated_Items && aStack.getItemDamage() == WerkstoffLoader.Tiberium.getmID()) + aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.nqgen")); + aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java new file mode 100644 index 0000000000..7f36e43193 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import gregtech.api.interfaces.IItemContainer; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +import static gregtech.api.enums.GT_Values.W; + +public enum BW_NonMeta_MaterialItems implements IItemContainer { + Depleted_Tiberium_1,Depleted_Tiberium_2,Depleted_Tiberium_4, + TiberiumCell_1,TiberiumCell_2,TiberiumCell_4 + ; + private ItemStack mStack; + private boolean mHasNotBeenSet = true; + + @Override + public IItemContainer set(Item aItem) { + mHasNotBeenSet = false; + if (aItem == null) return this; + ItemStack aStack = new ItemStack(aItem, 1, 0); + mStack = GT_Utility.copyAmount(1, aStack); + return this; + } + + @Override + public IItemContainer set(ItemStack aStack) { + mHasNotBeenSet = false; + mStack = GT_Utility.copyAmount(1, aStack); + return this; + } + + @Override + public Item getItem() { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return null; + return mStack.getItem(); + } + + @Override + public Block getBlock() { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + return GT_Utility.getBlockFromItem(getItem()); + } + + @Override + public final boolean hasBeenSet() { + return !mHasNotBeenSet; + } + + @Override + public boolean isStackEqual(Object aStack) { + return isStackEqual(aStack, false, false); + } + + @Override + public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT) { + if (GT_Utility.isStackInvalid(aStack)) return false; + return GT_Utility.areUnificationsEqual((ItemStack) aStack, aWildcard ? getWildcard(1) : get(1), aIgnoreNBT); + } + + @Override + public ItemStack get(long aAmount, Object... aReplacements) { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(mStack)); + } + + @Override + public ItemStack getWildcard(long aAmount, Object... aReplacements) { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(mStack)); + } + + @Override + public ItemStack getUndamaged(long aAmount, Object... aReplacements) { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(mStack)); + } + + @Override + public ItemStack getAlmostBroken(long aAmount, Object... aReplacements) { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, mStack.getMaxDamage() - 1, GT_OreDictUnificator.get(mStack)); + } + + @Override + public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements) { + ItemStack rStack = get(1, aReplacements); + if (GT_Utility.isStackInvalid(rStack)) return null; + rStack.setStackDisplayName(aDisplayName); + return GT_Utility.copyAmount(aAmount, rStack); + } + + @Override + public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements) { + ItemStack rStack = get(1, aReplacements); + if (GT_Utility.isStackInvalid(rStack)) return null; + GT_ModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false); + return GT_Utility.copyAmount(aAmount, rStack); + } + + @Override + public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements) { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(mStack)); + } + + @Override + public IItemContainer registerOre(Object... aOreNames) { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, get(1)); + return this; + } + + @Override + public IItemContainer registerWildcardAsOre(Object... aOreNames) { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, getWildcard(1)); + return this; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 0144404b46..4d138e21db 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -48,9 +48,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { private static final Werkstoff.GenerationFeatures DEFAULT_NULL_GENERATION_FEATURES = new Werkstoff.GenerationFeatures().disable(); public static Werkstoff default_null_Werkstoff; - private final List mOreByProducts = new ArrayList(); - private final LinkedHashSet> contents = new LinkedHashSet<>(); - HashSet subtags = new HashSet<>(); + private final List mOreByProducts = new ArrayList<>(); + private final LinkedHashSet> CONTENTS = new LinkedHashSet<>(); + private final HashSet SUBTAGS = new HashSet<>(); private byte[] rgb = new byte[3]; private final String defaultName; private String toolTip; @@ -112,7 +112,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.mID = (short) mID; this.generationFeatures = generationFeatures; this.setRgb(BW_ColorUtil.correctCorlorArray(rgba)); - this.contents.addAll(Arrays.asList(contents)); + this.CONTENTS.addAll(Arrays.asList(contents)); this.toolTip = ""; if (toolTip.isEmpty()) { for (Pair p : contents) { @@ -125,7 +125,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.toolTip += ((Materials) p.getKey()).mChemicalFormula + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } if (p.getKey() instanceof Werkstoff) { - if (((Werkstoff) p.getKey()).contents.size() > 1 && p.getValue() > 1) + if (((Werkstoff) p.getKey()).CONTENTS.size() > 1 && p.getValue() > 1) // if (((Werkstoff) p.getKey()).toolTip != null && Character.isDigit(((Werkstoff) p.getKey()).toolTip.toCharArray()[((Werkstoff) p.getKey()).toolTip.length()-1])) this.toolTip += "(" + ((Werkstoff) p.getKey()).toolTip + ")" + (BW_Util.subscriptNumber(p.getValue())); else @@ -203,7 +203,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public boolean containsStuff(ISubTagContainer stuff){ - for (Pair pair : this.contents){ + for (Pair pair : this.CONTENTS){ if (pair.getKey().equals(stuff)) return true; } @@ -215,8 +215,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { switch (this.type) { case COMPOUND: case BIOLOGICAL: { - for (int i = 0; i < this.contents.toArray().length; i++) { - ret += ((Pair) this.contents.toArray()[i]).getValue(); + for (int i = 0; i < this.CONTENTS.toArray().length; i++) { + ret += ((Pair) this.CONTENTS.toArray()[i]).getValue(); } break; } @@ -224,7 +224,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { ret = 1; break; } - return new Pair<>(ret, this.contents); + return new Pair<>(ret, this.CONTENTS); } public int getNoOfByProducts() { @@ -296,22 +296,22 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @Override public boolean contains(SubTag subTag) { - if (!subTag.equals(WerkstoffLoader.NOBLE_GAS) && !subTag.equals(WerkstoffLoader.ANAEROBE_GAS)) - for (Pair p : this.contents) + if (!subTag.equals(WerkstoffLoader.NOBLE_GAS) && !subTag.equals(WerkstoffLoader.ANAEROBE_GAS) && !subTag.equals(WerkstoffLoader.NO_BLAST)) + for (Pair p : this.CONTENTS) if (p.getKey().contains(subTag)) return true; - return this.subtags.contains(subTag); + return this.SUBTAGS.contains(subTag); } @Override public ISubTagContainer add(SubTag... subTags) { - this.subtags.addAll(Arrays.asList(subTags)); + this.SUBTAGS.addAll(Arrays.asList(subTags)); return this; } @Override public boolean remove(SubTag subTag) { - return this.subtags.remove(subTag); + return this.SUBTAGS.remove(subTag); } public void getAndAddToCollection(OrePrefixes prefixes,int amount,Collection stacks){ @@ -384,6 +384,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemExquisite,0b100); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemChipped,0b100); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawless,0b100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.lens,0b100); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ore,0b1000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustImpure,0b1000); @@ -548,7 +549,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } public Werkstoff.GenerationFeatures addMultipleIngotMetalWorkingItems() { - this.toGenerate = (byte) (this.toGenerate | 0b10000000); + this.toGenerate = (byte) (this.toGenerate | 0b1000000000); return this; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index d4307a13dd..d821007533 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -82,6 +82,7 @@ public class WerkstoffLoader implements Runnable { public static final SubTag ANAEROBE_GAS = SubTag.getNewSubTag("AnaerobeGas"); public static final SubTag ANAEROBE_SMELTING = SubTag.getNewSubTag("AnaerobeSmelting"); public static final SubTag NOBLE_GAS_SMELTING = SubTag.getNewSubTag("NobleGasSmelting"); + public static final SubTag NO_BLAST = SubTag.getNewSubTag("NoBlast"); public static OrePrefixes cellMolten; public static ItemList rotorMold; public static ItemList rotorShape; @@ -1199,9 +1200,9 @@ public class WerkstoffLoader implements Runnable { new short[]{0x22,0xEE,0x22}, "Tiberium", "Tr", - new Werkstoff.Stats().setProtons(123).setMass(326), + new Werkstoff.Stats().setProtons(123).setMass(326).setBlastFurnace(true).setMeltingPoint(1800).setRadioactive(true).setToxic(true), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().onlyDust().addGems(), + new Werkstoff.GenerationFeatures().onlyDust().addGems().addCraftingMetalWorkingItems().addSimpleMetalWorkingItems(), 89, TextureSet.SET_DIAMOND ); @@ -1333,6 +1334,8 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.LuVTierMaterial.add(WerkstoffLoader.NOBLE_GAS_SMELTING); + WerkstoffLoader.MagnetoResonaticDust.add(WerkstoffLoader.NO_BLAST); + //Calcium Smelting block Materials.Calcium.mBlastFurnaceRequired=true; @@ -1473,7 +1476,7 @@ public class WerkstoffLoader implements Runnable { public static void runGTItemDataRegistrator(){ HashSet toRem = new HashSet<>(); for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - Materials werkstoffBridgeMaterial = new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName()); + Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName()); for (OrePrefixes prefixes : values()) { if (!(prefixes == cell && werkstoff.getType().equals(Werkstoff.Types.ELEMENT))) { if (prefixes == dust && werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { @@ -1487,8 +1490,10 @@ public class WerkstoffLoader implements Runnable { werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials = new ArrayList<>(); e.mLinkedMaterials.add(werkstoffBridgeMaterial); - GT_OreDictUnificator.addAssociation(dust, werkstoffBridgeMaterial, werkstoff.get(dust), false); - GT_OreDictUnificator.set(dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true); + if (((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) == 0 && werkstoff.get(dust) != null && werkstoff.get(dust).getItem() != null)) { + GT_OreDictUnificator.addAssociation(dust, werkstoffBridgeMaterial, werkstoff.get(dust), false); + GT_OreDictUnificator.set(dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true); + } ElementSet = true; break; } @@ -1503,14 +1508,15 @@ public class WerkstoffLoader implements Runnable { } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { e.printStackTrace(); } - ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); - Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(prefixes)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, null, new ItemStack[]{werkstoff.get(prefixes)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); + if (((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) == 0 && werkstoff.get(dust) != null && werkstoff.get(dust).getItem() != null)) { + ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); + Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(prefixes)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, null, new ItemStack[]{werkstoff.get(prefixes)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); + } } - } else if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0 && werkstoff.get(prefixes) != null && werkstoff.get(prefixes).getItem() != null) - GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, werkstoff.get(prefixes), false); + } if (werkstoff.getGenerationFeatures().hasCells()) { werkstoffBridgeMaterial.setHasCorrespondingFluid(true); @@ -1524,6 +1530,8 @@ public class WerkstoffLoader implements Runnable { werkstoffBridgeMaterial.mName = werkstoff.getDefaultName(); toRem.add(werkstoffBridgeMaterial); werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); + if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0 && werkstoff.get(prefixes) != null && werkstoff.get(prefixes).getItem() != null) + GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, werkstoff.get(prefixes), false); } } } @@ -1619,12 +1627,14 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawed), werkstoff.get(gemChipped, 2), 64, 16); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemChipped), werkstoff.get(dustTiny), 64, 16); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawless, 3), 8, werkstoff.get(gemExquisite), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gem, 3), 8, werkstoff.get(gemFlawless), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawed, 3), 8, werkstoff.get(gem), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemChipped, 3), 8, werkstoff.get(gemFlawed), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + if (!werkstoff.contains(WerkstoffLoader.NO_BLAST)) { + GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawless, 3), 8, werkstoff.get(gemExquisite), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(gem, 3), 8, werkstoff.get(gemFlawless), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawed, 3), 8, werkstoff.get(gem), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(gemChipped, 3), 8, werkstoff.get(gemFlawed), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(dust, 4), 24, werkstoff.get(gem, 3), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(dust, 4), 24, werkstoff.get(gem, 3), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)); + } if ((werkstoff.getGenerationFeatures().toGenerate & 2) != 0) { GT_Values.RA.addLatheRecipe(werkstoff.get(plate), werkstoff.get(lens), werkstoff.get(dustSmall), 1200, 120); @@ -1676,16 +1686,21 @@ public class WerkstoffLoader implements Runnable { } private void addCraftingMetalRecipes(Werkstoff werkstoff) { - if ((werkstoff.getGenerationFeatures().toGenerate & 0b100000000) != 0) { + if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(screw)) != 0) { int tVoltageMultiplier = werkstoff.getStats().meltingPoint >= 2800 ? 60 : 15; //bolt - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Bolt.get(0L), werkstoff.get(bolt,8), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 8 * tVoltageMultiplier); + GT_Values.RA.addExtruderRecipe(werkstoff.getGenerationFeatures().hasGems() ? werkstoff.get(gem) : werkstoff.get(ingot), ItemList.Shape_Extruder_Bolt.get(0L), werkstoff.get(bolt,8), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 8 * tVoltageMultiplier); GT_Values.RA.addCutterRecipe(werkstoff.get(stick), werkstoff.get(bolt,4), null, (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 4); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(bolt),new ItemStack[]{werkstoff.get(dustTiny,1)},null,2,8); //screw GT_Values.RA.addLatheRecipe(werkstoff.get(bolt), werkstoff.get(screw),null, (int) Math.max(werkstoff.getStats().getMass() / 8L, 1L), 4); GT_ModHandler.addCraftingRecipe(werkstoff.get(screw), GT_Proxy.tBits, new Object[]{"fX", "X ", 'X', werkstoff.get(bolt)}); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(screw),new ItemStack[]{werkstoff.get(dustTiny,1)},null,2,8); + + if (werkstoff.getGenerationFeatures().hasGems()) + return; //ring GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Ring.get(0L), werkstoff.get(ring,4), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 6 * tVoltageMultiplier); @@ -1733,15 +1748,13 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGt),new ItemStack[]{werkstoff.get(dust,4)},null,2,8); GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGtSmall),new ItemStack[]{werkstoff.get(dust,1)},null,2,8); GT_Values.RA.addPulveriserRecipe(werkstoff.get(rotor),new ItemStack[]{werkstoff.get(dust,4),werkstoff.get(dustSmall)},null,2,8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(bolt),new ItemStack[]{werkstoff.get(dustTiny,1)},null,2,8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(screw),new ItemStack[]{werkstoff.get(dustTiny,1)},null,2,8); GT_Values.RA.addPulveriserRecipe(werkstoff.get(ring),new ItemStack[]{werkstoff.get(dustSmall,1)},null,2,8); } } private void addMultipleMetalRecipes(Werkstoff werkstoff){ - if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000000000) != 0) { - GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{werkstoff.get(ingot),GT_Utility.getIntegratedCircuit(2)},new ItemStack[]{werkstoff.get(plateDouble)},null,null,null,null, (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), 60,0)); + if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(plateDense)) != 0) { + GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{werkstoff.get(ingot,2),GT_Utility.getIntegratedCircuit(2)},new ItemStack[]{werkstoff.get(plateDouble)},null,null,null,null, (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), 60,0)); GregTech_API.registerCover(werkstoff.get(plateDouble), new GT_RenderedTexture(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false), null); GT_Values.RA.addPulveriserRecipe(werkstoff.get(plateDouble),new ItemStack[]{werkstoff.get(dust,2)},null,2,8); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index b865c9e39f..f2ac02b257 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -23,30 +23,21 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import cpw.mods.fml.common.Loader; import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.util.*; import gregtech.common.items.behaviors.Behaviour_DataOrb; import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; -import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.reflect.FieldUtils; -import org.apache.commons.lang3.reflect.MethodUtils; import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; import java.util.Map; import static com.github.bartimaeusnek.bartworks.util.BW_Util.CLEANROOM; @@ -89,6 +80,9 @@ public class AdditionalRecipes implements Runnable { GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust), WerkstoffLoader.Neon.getFluidOrGas(1000), WerkstoffLoader.MagnetoResonaticDust.get(gemChipped, 9), 9000, 4500, BW_Util.getMachineVoltageFromTier(5)); GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust), WerkstoffLoader.Krypton.getFluidOrGas(1000), WerkstoffLoader.MagnetoResonaticDust.get(gem), 10000, 4500, BW_Util.getMachineVoltageFromTier(5)); + //Milk + //GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), Materials.Milk.getFluid(12000), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500, 49152, 600000000); + GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(1),null,Materials.Milk.getFluid(10000),Materials.Water.getFluid(8832),Materials.Sugar.getDustSmall(21),Materials.Calcium.getDustTiny(1),Materials.Magnesium.getDustTiny(1),Materials.Potassium.getDustTiny(1),Materials.Sodium.getDustTiny(4),Materials.Phosphor.getDustTiny(1),new int[]{10000,10000,1000,10000,1000,1000},50,120); for (int i = 0; i <= 6; i++) { GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( @@ -126,39 +120,59 @@ public class AdditionalRecipes implements Runnable { Materials.SolderingAlloy.getMolten((i + 1) * 144) }, null, (i + 1) * 1500, BW_Util.getMachineVoltageFromTier(i + 1), CLEANROOM)); } + GT_Recipe.GT_Recipe_Map.sSmallNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(bolt)}, new ItemStack[]{}, null, null, null, 0, 0, 12500); + GT_Recipe.GT_Recipe_Map.sLargeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stick)}, new ItemStack[]{}, null, null, null, 0, 0, 62500); + + try{ + Class map = GT_Recipe.GT_Recipe_Map.class; + GT_Recipe.GT_Recipe_Map sHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sHugeNaquadahReactorFuels").get(null); + GT_Recipe.GT_Recipe_Map sExtremeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sExtremeNaquadahReactorFuels").get(null); + GT_Recipe.GT_Recipe_Map sUltraHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sUltraHugeNaquadahReactorFuels").get(null); + sHugeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stickLong)}, new ItemStack[]{}, null, null, null, 0, 0, 125000); + sExtremeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stick)}, new ItemStack[]{}, null, null, null, 0, 0, 31250); + sUltraHugeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stickLong)}, new ItemStack[]{}, null, null, null, 0, 0, 125000); + }catch (NullPointerException | IllegalAccessException e){} + + new LoadItemContainers().run(); + + GT_Values.RA.addCannerRecipe(ItemList.Large_Fluid_Cell_TungstenSteel.get(1L), WerkstoffLoader.Tiberium.get(dust,3), BW_NonMeta_MaterialItems.TiberiumCell_1.get(1L), null, 30, 16); + GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_1.get(2L), GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), BW_NonMeta_MaterialItems.TiberiumCell_2.get(1L), 100, 400); + GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_1.get(4L), GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 6L), BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), 150, 400); + GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_2.get(2L), GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), 100, 400); + GregTech_API.sAfterGTPostload.add(new LuVTierEnhancer()); AdditionalRecipes.oldGThelperMethod(); } - private static void oldGThelperMethod(){ - //manual override for older GT - Werkstoff werkstoff = WerkstoffLoader.Oganesson; - Materials werkstoffBridgeMaterial = null; - boolean aElementSet = false; - for (Element e : Element.values()){ - if (e.toString().equals("Uuo")){ - werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName(),werkstoff.getDefaultName()); - werkstoffBridgeMaterial.mElement = e; - e.mLinkedMaterials.add(werkstoffBridgeMaterial); - aElementSet = true; - break; - } - } - if (!aElementSet) - return; + private static void oldGThelperMethod() { + //manual override for older GT + Werkstoff werkstoff = WerkstoffLoader.Oganesson; + Materials werkstoffBridgeMaterial = null; + boolean aElementSet = false; + for (Element e : Element.values()) { + if (e.toString().equals("Uuo")) { + werkstoffBridgeMaterial = new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName(), werkstoff.getDefaultName()); + werkstoffBridgeMaterial.mElement = e; + e.mLinkedMaterials.add(werkstoffBridgeMaterial); + aElementSet = true; + break; + } + } + if (!aElementSet) + return; - GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),false); - try { - Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); - f.setAccessible(true); - Map MATERIALS_MAP = (Map) f.get(null); - MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); - } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { - e.printStackTrace(); - } - ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); - Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false,new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),30,0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false,new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),30,0)); - } + GT_OreDictUnificator.addAssociation(cell, werkstoffBridgeMaterial, werkstoff.get(cell), false); + try { + Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); + f.setAccessible(true); + Map MATERIALS_MAP = (Map) f.get(null); + MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); + } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { + e.printStackTrace(); + } + ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); + Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{Materials.Empty.getCells(1)}, new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); + } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java new file mode 100644 index 0000000000..b0d0c2e79c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; + +import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_OreDictUnificator; + +import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.OrePrefixes.dust; + +public class AfterLuVTierEnhacement implements Runnable { + + @Override + public void run() { + GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(50), + WerkstoffLoader.Zirconium.get(dust), + WerkstoffLoader.Zirconium.get(dust), + WerkstoffLoader.Tiberium.get(dustSmall,2), + WerkstoffLoader.Zirconium.get(dust,2), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 8L), + GT_OreDictUnificator.get(dust, Materials.Platinum, 1L), + new int[]{10_000,5_000,5_000,2_500,10_000,10_000},250,2000); + GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(100), + WerkstoffLoader.Zirconium.get(dust,2), + WerkstoffLoader.Zirconium.get(dust,2), + WerkstoffLoader.Tiberium.get(dust), + WerkstoffLoader.Zirconium.get(dust,4), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 18L), + GT_OreDictUnificator.get(dust, Materials.Platinum, 2L), + new int[]{10_000,5_000,5_000,2_500,10_000,10_000},500,2000); + GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(200), + WerkstoffLoader.Zirconium.get(dust,4), + WerkstoffLoader.Zirconium.get(dust,4), + WerkstoffLoader.Tiberium.get(dust,2), + WerkstoffLoader.Zirconium.get(dust,8), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 38L), + GT_OreDictUnificator.get(dust, Materials.Platinum, 4L), + new int[]{10_000,5_000,5_000,2_500,10_000,10_000},1000,2000); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java new file mode 100644 index 0000000000..053b899ea8 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; + +import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; +import gregtech.api.items.GT_RadioactiveCellIC_Item; +import gregtech.common.items.GT_DepletetCell_Item; + +public class LoadItemContainers implements Runnable { + + @Override + public void run() { + BW_NonMeta_MaterialItems.Depleted_Tiberium_1.set(new GT_DepletetCell_Item("TiberiumcellDep", "Fuel Rod (Depleted Tiberium)", 1)); + BW_NonMeta_MaterialItems.Depleted_Tiberium_2.set(new GT_DepletetCell_Item("Double_TiberiumcellDep", "Dual Fuel Rod (Depleted Tiberium)", 1)); + BW_NonMeta_MaterialItems.Depleted_Tiberium_4.set(new GT_DepletetCell_Item("Quad_TiberiumcellDep", "Quad Fuel Rod (Depleted Tiberium)", 1)); + BW_NonMeta_MaterialItems.TiberiumCell_1.set(new GT_RadioactiveCellIC_Item("Tiberiumcell", "Fuel Rod (Tiberium)", 1, 50000, 2F, 1, 0.5F, BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), false)); + BW_NonMeta_MaterialItems.TiberiumCell_2.set(new GT_RadioactiveCellIC_Item("Double_Tiberiumcell", "Dual Fuel Rod (Tiberium)", 2, 50000, 2F, 1, 0.5F, BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), false)); + BW_NonMeta_MaterialItems.TiberiumCell_4.set(new GT_RadioactiveCellIC_Item("Quad_Tiberiumcell", "Quad Fuel Rod (Tiberium)", 4, 50000, 2F, 1, 0.5F, BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), false)); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java index 7542253844..50c9e0d311 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java @@ -118,6 +118,7 @@ public class LuVTierEnhancer implements Runnable { } } } + new AfterLuVTierEnhacement().run(); } private static void replaceAsslineRecipes(){ diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java index c3e8397117..69bd771eb0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java @@ -51,11 +51,8 @@ import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; import org.apache.commons.lang3.reflect.FieldUtils; -import java.lang.reflect.Array; import java.lang.reflect.Field; import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; import static gregtech.api.enums.OrePrefixes.*; @@ -175,7 +172,7 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addChemicalRecipe(IridiumChloride.get(dust), Materials.Calcium.getDust(3), null, CalciumChloride.getFluidOrGas(3000), PGSDResidue2.get(dust), Materials.Iridium.getDust(1), 300, 1920); //Rh - GT_Values.RA.addChemicalRecipe(RHSulfate.get(cell, 11), GT_Utility.getIntegratedCircuit(1), Materials.Water.getFluid(10000), Materials.Potassium.getMolten(1999), RHSulfateSolution.get(cell, 11), LeachResidue.get(dustTiny, 10), 300, 30); + GT_Values.RA.addChemicalRecipe(RHSulfate.get(cell, 11), GT_Utility.getIntegratedCircuit(1), Materials.Water.getFluid(10000), Materials.Potassium.getMolten(2000), RHSulfateSolution.get(cell, 11), LeachResidue.get(dustTiny, 10), 300, 30); GT_Values.RA.addChemicalRecipe(Materials.Zinc.getDust(1), null, RHSulfateSolution.getFluidOrGas(1000), null, ZincSulfate.get(dust), CrudeRhMetall.get(dust), 300); GT_Values.RA.addBlastRecipe(CrudeRhMetall.get(dust), Materials.Salt.getDust(1), Materials.Chlorine.getGas(1000), null, RHSalt.get(dust, 3), null, 300, 120, 600); @@ -246,16 +243,29 @@ public class PlatinumSludgeOverHaul { for (int i = 0; i < recipe.mFluidOutputs.length; i++) { if (map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes)) continue maploop; - if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) - recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); - else if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) - recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); - else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) - recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); + else if (map.equals(GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sChemicalRecipes)) { + if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) + recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); + else if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) + recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); + else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) + recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); + } else { + if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + } } for (int i = 0; i < recipe.mOutputs.length; i++) { if (!GT_Utility.isStackValid(recipe.mOutputs[i])) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java index ebe2f69dce..8bcffab9b1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java @@ -44,8 +44,9 @@ public class BW_WorldGenRoss128ba extends BW_OreLayer { } public static void init_OresRoss128ba() { - new BW_WorldGenRoss128b("ore.mix.ross128ba.tib", true, 30, 60, 6, 1, 16, Tiberium, Naquadah, NaquadahEnriched, NaquadahEnriched); - new BW_WorldGenRoss128b("ore.mix.ross128.Tungstate", true, 5, 40, 10, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite); + new BW_WorldGenRoss128ba("ore.mix.ross128ba.tib", true, 30, 60, 6, 1, 16, Tiberium, Tiberium, NaquadahEnriched, NaquadahEnriched); + new BW_WorldGenRoss128ba("ore.mix.ross128.Tungstate", true, 5, 40, 10, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite); + new BW_WorldGenRoss128ba("ore.mix.ross128ba.bart", true, 30, 60, 1, 1, 3, BArTiMaEuSNeK, BArTiMaEuSNeK, BArTiMaEuSNeK, BArTiMaEuSNeK); } diff --git a/src/main/resources/assets/gregtech/textures/items/gt.Double_Tiberiumcell.png b/src/main/resources/assets/gregtech/textures/items/gt.Double_Tiberiumcell.png new file mode 100644 index 0000000000..bfe6e2288b Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.Double_Tiberiumcell.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.Double_TiberiumcellDep.png b/src/main/resources/assets/gregtech/textures/items/gt.Double_TiberiumcellDep.png new file mode 100644 index 0000000000..a7d2c341a2 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.Double_TiberiumcellDep.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.Quad_Tiberiumcell.png b/src/main/resources/assets/gregtech/textures/items/gt.Quad_Tiberiumcell.png new file mode 100644 index 0000000000..85aa8c19a1 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.Quad_Tiberiumcell.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.Quad_TiberiumcellDep.png b/src/main/resources/assets/gregtech/textures/items/gt.Quad_TiberiumcellDep.png new file mode 100644 index 0000000000..0a71854e05 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.Quad_TiberiumcellDep.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.Tiberiumcell.png b/src/main/resources/assets/gregtech/textures/items/gt.Tiberiumcell.png new file mode 100644 index 0000000000..4071c6062d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.Tiberiumcell.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.TiberiumcellDep.png b/src/main/resources/assets/gregtech/textures/items/gt.TiberiumcellDep.png new file mode 100644 index 0000000000..bafc8a4c8c Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.TiberiumcellDep.png differ -- cgit From 4af4e216d11883788a16dd513c8a2a1b38204a4d Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 19 Sep 2019 06:07:33 +0200 Subject: added Ross128ba into the game +fixed ore decolorisation +added "TheCore" Nq cell +rewrote NEI Ore Handler +limited oregen to the propper planets +added Fluorspar ore +further improved werkstoff recipe generation +a lot of smaller fixes and balance Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: aaed052c041488605313bd133e66a575451a2a9e --- .gitignore | 1 + build.properties | 2 +- .../bartimaeusnek/ASM/BWCoreTransformer.java | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 2 - .../bartworks/neiHandler/BW_NEI_OreHandler.java | 212 ++++++--------------- .../system/material/BW_MetaGeneratedOreTE.java | 5 +- .../system/material/BW_MetaGenerated_Ores.java | 32 ++-- .../system/material/BW_NonMeta_MaterialItems.java | 4 +- .../bartworks/system/material/Werkstoff.java | 12 +- .../bartworks/system/material/WerkstoffLoader.java | 36 +++- .../processingLoaders/AdditionalRecipes.java | 6 +- .../processingLoaders/AfterLuVTierEnhacement.java | 17 +- .../processingLoaders/LoadItemContainers.java | 2 + .../processingLoaders/PlatinumSludgeOverHaul.java | 3 + .../bartworks/system/oregen/BW_OreLayer.java | 47 ++++- .../bartworks/system/oregen/BW_WordGenerator.java | 6 +- .../system/oregen/BW_WorldGenRoss128b.java | 16 +- .../system/oregen/BW_WorldGenRoss128ba.java | 45 +++-- .../bartimaeusnek/bartworks/util/BW_ColorUtil.java | 5 +- .../crossmod/galacticraft/GalacticraftProxy.java | 11 +- .../planets/ross128b/ChunkProviderRoss128b.java | 4 +- .../planets/ross128ba/ChunkProviderRoss128ba.java | 11 ++ .../solarsystems/Ross128SolarSystem.java | 8 +- 23 files changed, 275 insertions(+), 214 deletions(-) diff --git a/.gitignore b/.gitignore index 4d4c2b25eb..3db8b9657c 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ hs_err_pid* /eclipse /build /out +/run /.gradle /venv /libs \ No newline at end of file diff --git a/build.properties b/build.properties index 32b78ad9eb..cf61024f4f 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre9 +buildNumber=2_pre11 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index 06261bea9f..51ee9867a9 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -175,7 +175,7 @@ public class BWCoreTransformer implements IClassTransformer { nu.add(new VarInsnNode(ALOAD, 0)); nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? theWorld_src : "theWorld", "Lnet/minecraft/client/multiplayer/WorldClient;")); nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/multiplayer/WorldClient", useSrc ? provider_src : "provider", "Lnet/minecraft/world/WorldProvider;")); - nu.add(new TypeInsnNode(INSTANCEOF, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b")); + nu.add(new TypeInsnNode(INSTANCEOF, "com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace")); nu.add(new JumpInsnNode(IFEQ, LabelNodes[0])); nu.add(new VarInsnNode(ALOAD, 0)); nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? renderEngine_src : "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 126a1263f4..1d452f0505 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -76,9 +76,7 @@ import org.apache.logging.log4j.Logger; import java.io.IOException; import java.lang.reflect.Field; -import java.lang.reflect.Modifier; import java.util.*; -import java.util.stream.Collectors; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index 4f5f1a8cd2..cbd5706d16 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -30,18 +30,17 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer; -import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import java.awt.*; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Objects; public class BW_NEI_OreHandler extends TemplateRecipeHandler { @@ -60,7 +59,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void loadTransferRects() { - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(0,40,40,10),"quickanddirtyneihandler")); + this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(0,40,40,120),"quickanddirtyneihandler")); } @Override @@ -71,93 +70,27 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void loadCraftingRecipes(String outputId, Object... results) { if (outputId.equalsIgnoreCase("quickanddirtyneihandler")) { - for (int i = 0; i < Werkstoff.werkstoffHashMap.values().size(); i++) { - Werkstoff w = Werkstoff.werkstoffHashMap.get((short)i); - if (w == null || w == Werkstoff.default_null_Werkstoff) - continue; - if (w.getGenerationFeatures().hasOres()) { - ItemStack result = w.get(OrePrefixes.ore); - TemplateRecipeHandler.CachedRecipe tmp = new TemplateRecipeHandler.CachedRecipe() { - - PositionedStack stack = new PositionedStack(result, 0, 0); - - @Override - public PositionedStack getResult() { - return this.stack; - } - - @Override - public List getOtherStacks() { - ArrayList ret = new ArrayList<>(); - for (int i = 0; i < BW_OreLayer.sList.size(); i++) { - if (BW_OreLayer.sList.get(i) instanceof BW_WorldGenRoss128b) { - int baseMeta = result.getItemDamage(); - BW_WorldGenRoss128b worldGen = ((BW_WorldGenRoss128b) BW_OreLayer.sList.get(i)); - if (worldGen.mPrimaryMeta == baseMeta || worldGen.mSecondaryMeta == baseMeta || worldGen.mBetweenMeta == baseMeta || worldGen.mSporadicMeta == baseMeta) { - ItemStack other; - other = result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore", "Vein")); - this.stack = new PositionedStack(other, 83, 0); - if (((worldGen.bwOres & 0b1000) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mPrimaryMeta); - ret.add(new PositionedStack(other, 0, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mPrimaryMeta); - ret.add(new PositionedStack(other, 0, 12)); - } - if (((worldGen.bwOres & 0b0100) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mSecondaryMeta); - ret.add(new PositionedStack(other, 20, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mSecondaryMeta); - ret.add(new PositionedStack(other, 20, 12)); - } - if (((worldGen.bwOres & 0b0010) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mBetweenMeta); - ret.add(new PositionedStack(other, 40, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mBetweenMeta); - ret.add(new PositionedStack(other, 40, 12)); - } - if (((worldGen.bwOres & 0b0001) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mSporadicMeta); - ret.add(new PositionedStack(other, 60, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mSporadicMeta); - ret.add(new PositionedStack(other, 60, 12)); - } - break; - } - } - } - return ret; - } - }; - boolean add = true; - for (TemplateRecipeHandler.CachedRecipe recipe: this.arecipes) { - if (recipe == null || recipe.getOtherStacks() == null || recipe.getOtherStacks().get(0) == null || recipe.getOtherStacks().get(0).item == null) - continue; - if (GT_Utility.areStacksEqual(recipe.getOtherStacks().get(0).item,tmp.getOtherStacks().get(0).item)) - add = false; - } - if (add) - this.arecipes.add(tmp); - } - } - } else super.loadCraftingRecipes(outputId, results); + HashSet result = new HashSet<>(); + Werkstoff.werkstoffHashSet.stream().filter(w -> w.getGenerationFeatures().hasOres()).forEach(w -> result.add(w.get(OrePrefixes.ore))); + result.forEach(this::loadCraftingRecipes); + HashSet hashSet = new HashSet<>(this.arecipes); + this.arecipes.clear(); + this.arecipes.addAll(hashSet); + } + if (outputId.equals("item")) { + this.loadCraftingRecipes((ItemStack)results[0]); + HashSet hashSet = new HashSet<>(this.arecipes); + this.arecipes.clear(); + this.arecipes.addAll(hashSet); + } } @Override public void drawExtras(int recipe) { - if ((recipe < this.arecipes.size()) && (this.arecipes.get(recipe).getOtherStacks().size() >= 4) ) { - GuiDraw.drawString(ChatColorHelper.BOLD + "DIM:" + ChatColorHelper.RESET + " Ross128", 0, 40, 0, false); + if ((recipe < this.arecipes.size()) && (this.arecipes.get(recipe) instanceof CachedOreRecipe) ) { + CachedOreRecipe cachedOreRecipe = (CachedOreRecipe) this.arecipes.get(recipe); + + GuiDraw.drawString(ChatColorHelper.BOLD + "DIM: " + ChatColorHelper.RESET + cachedOreRecipe.worldGen.getDimName(), 0, 40, 0, false); GuiDraw.drawString(ChatColorHelper.BOLD + "Primary:", 0, 50, 0, false); GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(0).item.getDisplayName(), 0, 60, 0, false); GuiDraw.drawString(ChatColorHelper.BOLD + "Secondary:", 0, 70, 0, false); @@ -173,70 +106,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void loadCraftingRecipes(ItemStack result) { if (Block.getBlockFromItem(result.getItem()) instanceof BW_MetaGenerated_Ores) { - TemplateRecipeHandler.CachedRecipe tmp = new TemplateRecipeHandler.CachedRecipe() { - - PositionedStack stack = new PositionedStack(result, 0, 0); - - @Override - public PositionedStack getResult() { - return this.stack; - } - - @Override - public List getOtherStacks() { - ArrayList ret = new ArrayList<>(); - for (int i = 0; i < BW_OreLayer.sList.size(); i++) { - if (BW_OreLayer.sList.get(i) instanceof BW_WorldGenRoss128b) { - int baseMeta = result.getItemDamage(); - BW_WorldGenRoss128b worldGen = ((BW_WorldGenRoss128b) BW_OreLayer.sList.get(i)); - if (worldGen.mPrimaryMeta == baseMeta || worldGen.mSecondaryMeta == baseMeta || worldGen.mBetweenMeta == baseMeta || worldGen.mSporadicMeta == baseMeta) { - ItemStack other; - other = result.copy().setStackDisplayName(result.getDisplayName().replaceAll("Ore", "Vein")); - this.stack = new PositionedStack(other, 83, 0); - if (((worldGen.bwOres & 0b1000) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mPrimaryMeta); - ret.add(new PositionedStack(other, 0, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mPrimaryMeta); - ret.add(new PositionedStack(other, 0, 12)); - } - if (((worldGen.bwOres & 0b0100) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mSecondaryMeta); - ret.add(new PositionedStack(other, 20, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mSecondaryMeta); - ret.add(new PositionedStack(other, 20, 12)); - } - if (((worldGen.bwOres & 0b0010) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mBetweenMeta); - ret.add(new PositionedStack(other, 40, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mBetweenMeta); - ret.add(new PositionedStack(other, 40, 12)); - } - if (((worldGen.bwOres & 0b0001) != 0)) { - other = result.copy(); - other.setItemDamage(worldGen.mSporadicMeta); - ret.add(new PositionedStack(other, 60, 12)); - } else { - other = new ItemStack(GregTech_API.sBlockOres1); - other.setItemDamage(worldGen.mSporadicMeta); - ret.add(new PositionedStack(other, 60, 12)); - } - break; - } - } - } - return ret; - } - }; - this.arecipes.add(tmp); + BW_OreLayer.NEIMAP.get((short) result.getItemDamage()).forEach(l -> this.arecipes.add(new CachedOreRecipe(l, result))); } } @@ -249,4 +119,44 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public String getRecipeName() { return "BartWorks Ores"; } + + class CachedOreRecipe extends TemplateRecipeHandler.CachedRecipe{ + + public CachedOreRecipe(BW_OreLayer worldGen, ItemStack result) { + this.worldGen = worldGen; + this.stack = new PositionedStack(result, 0, 0); + } + + BW_OreLayer worldGen; + PositionedStack stack ; + + @Override + public PositionedStack getResult() { + return this.stack; + } + + @Override + public List getOtherStacks() { + List ret = new ArrayList<>(); + int x = 0; + for (int i = 0; i < 4; i++) { + x += 20; + ret.add(new PositionedStack(worldGen.getStacks().get(i), x, 12)); + } + return ret; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof CachedOreRecipe)) return false; + CachedOreRecipe that = (CachedOreRecipe) o; + return Objects.equals(worldGen, that.worldGen); + } + + @Override + public int hashCode() { + return worldGen.hashCode(); + } + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index 1e671a1d29..55714c38ec 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -33,6 +33,7 @@ import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; @@ -78,9 +79,11 @@ public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEn return rList; } - public void sendPacket(){ + @Override + public Packet getDescriptionPacket() { if (!this.worldObj.isRemote) BW_Network_instance.sendPacketToAllPlayersInRange(this.worldObj, new OrePacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); + return null; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 47e676e082..4d1a5a4a9e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -24,7 +24,6 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; -import cpw.mods.fml.common.FMLCommonHandler; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; @@ -41,6 +40,7 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import static com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items.metaTab; @@ -66,7 +66,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { } } - public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block) { + public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, int[] aBlockMeta) { if (!air) { aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); } @@ -77,7 +77,11 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { return false; } else { - if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, block)) { + if (Block.getIdFromBlock(tBlock) != Block.getIdFromBlock(block)) { + return false; + } + final int aaY = aY; + if (Arrays.stream(aBlockMeta).noneMatch(e -> e == aWorld.getBlockMetadata(aX, aaY, aZ))) { return false; } @@ -164,17 +168,17 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { } } - @Override - public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block p_149695_5_) { - if ((!aWorld.isRemote || this.checkForAir(aWorld,aX,aY,aZ)) && aWorld.getTileEntity(aX, aY, aZ) instanceof BW_MetaGeneratedOreTE) - ((BW_MetaGeneratedOreTE)aWorld.getTileEntity(aX, aY, aZ)).sendPacket(); - } - - @Override - public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int tileX, int tileY, int tileZ) { - if ((FMLCommonHandler.instance().getEffectiveSide().isServer() || this.checkForAir(aWorld,aX,aY,aZ)) && aWorld.getTileEntity(aX, aY, aZ) instanceof BW_MetaGeneratedOreTE) - ((BW_MetaGeneratedOreTE)aWorld.getTileEntity(aX, aY, aZ)).sendPacket(); - } +// @Override +// public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block p_149695_5_) { +// if ((!aWorld.isRemote || this.checkForAir(aWorld,aX,aY,aZ)) && aWorld.getTileEntity(aX, aY, aZ) instanceof BW_MetaGeneratedOreTE) +// ((BW_MetaGeneratedOreTE)aWorld.getTileEntity(aX, aY, aZ)).sendPacket(); +// } +// +// @Override +// public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int tileX, int tileY, int tileZ) { +// if ((FMLCommonHandler.instance().getEffectiveSide().isServer() || this.checkForAir(aWorld,aX,aY,aZ)) && aWorld.getTileEntity(aX, aY, aZ) instanceof BW_MetaGeneratedOreTE) +// ((BW_MetaGeneratedOreTE)aWorld.getTileEntity(aX, aY, aZ)).sendPacket(); +// } private boolean checkForAir(IBlockAccess aWorld, int aX, int aY, int aZ){ for (int x = -1; x <= 1; x++) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java index 7f36e43193..1c3455147f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java @@ -34,8 +34,8 @@ import static gregtech.api.enums.GT_Values.W; public enum BW_NonMeta_MaterialItems implements IItemContainer { Depleted_Tiberium_1,Depleted_Tiberium_2,Depleted_Tiberium_4, - TiberiumCell_1,TiberiumCell_2,TiberiumCell_4 - ; + TiberiumCell_1,TiberiumCell_2,TiberiumCell_4, + TheCoreCell,Depleted_TheCoreCell; private ItemStack mStack; private boolean mHasNotBeenSet = true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 4d138e21db..0cfc13e342 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -86,6 +86,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { this(rgba, defaultName, "", stats, type, generationFeatures, mID, texSet, contents); + this.mOreByProducts.clear(); this.mOreByProducts.addAll(oreByProduct); } @@ -95,6 +96,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { this(rgba, defaultName, toolTip, stats, type, generationFeatures, mID, texSet, contents); + this.mOreByProducts.clear(); this.mOreByProducts.addAll(oreByProduct); } @@ -164,6 +166,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } this.texSet = texSet; + if (this.mOreByProducts.isEmpty()) { + this.mOreByProducts.add(this); + this.mOreByProducts.add(this); + this.mOreByProducts.add(this); + } + Werkstoff.werkstoffHashSet.add(this); Werkstoff.werkstoffHashMap.put(this.mID, this); Werkstoff.werkstoffNameHashMap.put(this.defaultName,this); @@ -323,10 +331,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public FluidStack getFluidOrGas(int fluidAmount) { - return new FluidStack(WerkstoffLoader.fluids.get(this),fluidAmount); + return new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(this)),fluidAmount); } public FluidStack getMolten(int fluidAmount) { - return new FluidStack(WerkstoffLoader.molten.get(this),fluidAmount); + return new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(this)),fluidAmount); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index d821007533..95337e0a7b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -48,7 +48,6 @@ import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_Fluid; import gregtech.api.objects.GT_MultiTexture; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.objects.ItemData; import gregtech.api.util.*; import gregtech.common.GT_Proxy; import gregtech.common.items.behaviors.Behaviour_DataOrb; @@ -111,7 +110,8 @@ public class WerkstoffLoader implements Runnable { } catch (NullPointerException | IllegalArgumentException e){} Element t = EnumHelper.addEnum(Element.class,"Tr",new Class[]{long.class, long.class, long.class, long.class, String.class, String.class, boolean.class}, new Object[]{123L, 203L, 0L, -1L, (String) null, "Tiberium", false}); } - //TODO: FREE ID RANGE: 19-32766 + + //TODO: FREE ID RANGE: 91-32766 public static final Werkstoff Bismutite = new Werkstoff( new short[]{255, 233, 0, 0}, @@ -1202,7 +1202,7 @@ public class WerkstoffLoader implements Runnable { "Tr", new Werkstoff.Stats().setProtons(123).setMass(326).setBlastFurnace(true).setMeltingPoint(1800).setRadioactive(true).setToxic(true), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().onlyDust().addGems().addCraftingMetalWorkingItems().addSimpleMetalWorkingItems(), + new Werkstoff.GenerationFeatures().addGems().addCraftingMetalWorkingItems().addSimpleMetalWorkingItems(), 89, TextureSet.SET_DIAMOND ); @@ -1217,6 +1217,31 @@ public class WerkstoffLoader implements Runnable { new Pair<>(WerkstoffLoader.Ruthenium,2), new Pair<>(Materials.Iridium,1) ); + public static final Werkstoff Fluorspar = new Werkstoff( + new short[]{185,69,251}, + "Fluorspar", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 91, + TextureSet.SET_GEM_VERTICAL, + new Pair<>(Materials.Calcium,1), + new Pair<>(Materials.Fluorine,2) + ); +// public static final Werkstoff Baryte = new Werkstoff( +// new short[]{0xB9,0x45,0xFB}, +// "Baryte", +// new Werkstoff.Stats().setElektrolysis(true), +// Werkstoff.Types.COMPOUND, +// new Werkstoff.GenerationFeatures().addGems(), +// 92, +// TextureSet.SET_GEM_VERTICAL, +// new Pair<>(Materials.Barium,1), +// new Pair<>(Materials.Sulfur,1), +// new Pair<>(Materials.Oxygen,3) +// ); + + public static HashMap items = new HashMap<>(); public static HashBiMap fluids = HashBiMap.create(); @@ -1476,7 +1501,7 @@ public class WerkstoffLoader implements Runnable { public static void runGTItemDataRegistrator(){ HashSet toRem = new HashSet<>(); for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName()); + Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getDefaultName()) != Materials._NULL ? Materials.get(werkstoff.getDefaultName()) : new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName()); for (OrePrefixes prefixes : values()) { if (!(prefixes == cell && werkstoff.getType().equals(Werkstoff.Types.ELEMENT))) { if (prefixes == dust && werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { @@ -1486,7 +1511,7 @@ public class WerkstoffLoader implements Runnable { if (e.toString().equals(werkstoff.getToolTip())) { if (e.mLinkedMaterials.size() > 0) break; - werkstoffBridgeMaterial = new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, true, werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName()); + werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getDefaultName()) != Materials._NULL ? Materials.get(werkstoff.getDefaultName()) : new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName()); werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials = new ArrayList<>(); e.mLinkedMaterials.add(werkstoffBridgeMaterial); @@ -1837,6 +1862,7 @@ public class WerkstoffLoader implements Runnable { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0)); + GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0); } if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { if (cells > 0) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index f2ac02b257..8071b9b423 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -31,7 +31,9 @@ import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.GregTech_API; import gregtech.api.enums.*; -import gregtech.api.util.*; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -140,6 +142,8 @@ public class AdditionalRecipes implements Runnable { GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_1.get(4L), GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 6L), BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), 150, 400); GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_2.get(2L), GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), 100, 400); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.NaquadahCell_1.get(32L), GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L), GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L), GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L)},null, BW_NonMeta_MaterialItems.TheCoreCell.get(1L), 100, BW_Util.getMachineVoltageFromTier(6)); + GregTech_API.sAfterGTPostload.add(new LuVTierEnhancer()); AdditionalRecipes.oldGThelperMethod(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java index b0d0c2e79c..95ee440ddb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java @@ -25,17 +25,18 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.util.GT_OreDictUnificator; -import static gregtech.api.enums.OrePrefixes.*; import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.dustSmall; public class AfterLuVTierEnhacement implements Runnable { @Override public void run() { - GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(50), + GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(1), WerkstoffLoader.Zirconium.get(dust), WerkstoffLoader.Zirconium.get(dust), WerkstoffLoader.Tiberium.get(dustSmall,2), @@ -43,7 +44,7 @@ public class AfterLuVTierEnhacement implements Runnable { GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 8L), GT_OreDictUnificator.get(dust, Materials.Platinum, 1L), new int[]{10_000,5_000,5_000,2_500,10_000,10_000},250,2000); - GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(100), + GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(2), WerkstoffLoader.Zirconium.get(dust,2), WerkstoffLoader.Zirconium.get(dust,2), WerkstoffLoader.Tiberium.get(dust), @@ -51,7 +52,7 @@ public class AfterLuVTierEnhacement implements Runnable { GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 18L), GT_OreDictUnificator.get(dust, Materials.Platinum, 2L), new int[]{10_000,5_000,5_000,2_500,10_000,10_000},500,2000); - GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(200), + GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(4), WerkstoffLoader.Zirconium.get(dust,4), WerkstoffLoader.Zirconium.get(dust,4), WerkstoffLoader.Tiberium.get(dust,2), @@ -59,5 +60,13 @@ public class AfterLuVTierEnhacement implements Runnable { GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 38L), GT_OreDictUnificator.get(dust, Materials.Platinum, 4L), new int[]{10_000,5_000,5_000,2_500,10_000,10_000},1000,2000); + GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), null,null,null, + ItemList.Depleted_Naquadah_4.get(8), + null, + null, + null, + null, + null, + null,2000,8000); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java index 053b899ea8..bcc0917b9a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java @@ -36,5 +36,7 @@ public class LoadItemContainers implements Runnable { BW_NonMeta_MaterialItems.TiberiumCell_1.set(new GT_RadioactiveCellIC_Item("Tiberiumcell", "Fuel Rod (Tiberium)", 1, 50000, 2F, 1, 0.5F, BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), false)); BW_NonMeta_MaterialItems.TiberiumCell_2.set(new GT_RadioactiveCellIC_Item("Double_Tiberiumcell", "Dual Fuel Rod (Tiberium)", 2, 50000, 2F, 1, 0.5F, BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), false)); BW_NonMeta_MaterialItems.TiberiumCell_4.set(new GT_RadioactiveCellIC_Item("Quad_Tiberiumcell", "Quad Fuel Rod (Tiberium)", 4, 50000, 2F, 1, 0.5F, BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), false)); + BW_NonMeta_MaterialItems.Depleted_TheCoreCell.set(new GT_DepletetCell_Item("Core_Reactor_CellDep", "Depleted \"The Core\" Cell", 32)); + BW_NonMeta_MaterialItems.TheCoreCell.set(new GT_RadioactiveCellIC_Item("Core_Reactor_Cell", "\"The Core\" Cell", 32, 102400000, 8F, 32, 1F, BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), false)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java index 69bd771eb0..b04e2e6db0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java @@ -505,6 +505,9 @@ public class PlatinumSludgeOverHaul { } private static boolean isInBlackList(ItemStack stack) { + if (stack == null) + return true; + if (stack.getItem() instanceof BW_MetaGenerated_Items) return true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java index ebc432d1b5..d9dff96cf7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java @@ -26,6 +26,9 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.MurmurHash3; +import com.google.common.collect.ArrayListMultimap; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; @@ -33,11 +36,13 @@ import gregtech.api.world.GT_Worldgen; import gregtech.common.blocks.GT_TileEntity_Ores; import net.minecraft.block.Block; import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; +import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; import java.util.Random; @@ -47,12 +52,15 @@ import java.util.Random; */ public abstract class BW_OreLayer extends GT_Worldgen { public static final List sList = new ArrayList<>(); + public static final ArrayListMultimap NEIMAP = ArrayListMultimap.create(); private static final boolean logOregenRoss128 = false; public static int sWeight; public byte bwOres; public int mMinY, mWeight, mDensity, mSize, mMaxY, mPrimaryMeta, mSecondaryMeta, mBetweenMeta, mSporadicMeta; public abstract Block getDefaultBlockToReplace(); + public abstract int[] getDefaultDamageToReplace(); + public abstract String getDimName(); public BW_OreLayer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { super(aName, BW_OreLayer.sList, aDefault); @@ -98,11 +106,24 @@ public abstract class BW_OreLayer extends GT_Worldgen { this.mSecondaryMeta = aSecondary; this.mBetweenMeta = aBetween; this.mSporadicMeta = aSporadic; + NEIMAP.put((short) this.mPrimaryMeta,this); + NEIMAP.put((short) this.mSecondaryMeta,this); + NEIMAP.put((short) this.mBetweenMeta,this); + NEIMAP.put((short) this.mSporadicMeta,this); + } + public List getStacks(){ + ArrayList ret = new ArrayList<>(); + ret.add((this.bwOres & 0b1000) != 0 ? new ItemStack(WerkstoffLoader.BWOres,1,this.mPrimaryMeta) : new ItemStack ( GregTech_API.sBlockOres1,1,this.mPrimaryMeta)); + ret.add((this.bwOres & 0b0100) != 0 ? new ItemStack(WerkstoffLoader.BWOres,1,this.mSecondaryMeta) : new ItemStack ( GregTech_API.sBlockOres1,1,this.mSecondaryMeta)); + ret.add((this.bwOres & 0b0010) != 0 ? new ItemStack(WerkstoffLoader.BWOres,1,this.mBetweenMeta) : new ItemStack ( GregTech_API.sBlockOres1,1,this.mBetweenMeta)); + ret.add((this.bwOres & 0b0001) != 0 ? new ItemStack(WerkstoffLoader.BWOres,1,this.mSporadicMeta) : new ItemStack ( GregTech_API.sBlockOres1,1,this.mSporadicMeta)); + return ret; } @Override public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { { + int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); int cX = aChunkX - aRandom.nextInt(this.mSize); int eX = aChunkX + 16 + aRandom.nextInt(this.mSize); @@ -156,7 +177,7 @@ public abstract class BW_OreLayer extends GT_Worldgen { return true; if ((aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0) || (aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0) || (aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0) || (aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0)) { - return BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, this.getDefaultBlockToReplace()); + return BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, this.getDefaultBlockToReplace(),this.getDefaultDamageToReplace()); } return this.setGTOreBlockSpace(aWorld, aX, aY, aZ, aMetaData, this.getDefaultBlockToReplace()); @@ -184,4 +205,28 @@ public abstract class BW_OreLayer extends GT_Worldgen { }else return true; } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof BW_OreLayer)) return false; + + BW_OreLayer that = (BW_OreLayer) o; + + if (bwOres != that.bwOres) return false; + if (mMinY != that.mMinY) return false; + if (mWeight != that.mWeight) return false; + if (mDensity != that.mDensity) return false; + if (mSize != that.mSize) return false; + if (mMaxY != that.mMaxY) return false; + if (mPrimaryMeta != that.mPrimaryMeta) return false; + if (mSecondaryMeta != that.mSecondaryMeta) return false; + if (mBetweenMeta != that.mBetweenMeta) return false; + return mSporadicMeta == that.mSporadicMeta; + } + + @Override + public int hashCode() { + return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(37).put(bwOres).putInt(mMinY).putInt(mWeight).putInt(mDensity).putInt(mSize).putInt(mMaxY).putInt(mPrimaryMeta).putInt(mSecondaryMeta).putInt(mBetweenMeta).putInt(mSporadicMeta).array(),0,37,31); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java index 2cc26fe8cc..8a442787b9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java @@ -101,17 +101,19 @@ public class BW_WordGenerator implements IWorldGenerator { for (int i = 0; (i < 256) && (temp); i++) { tRandomWeight = random.nextInt(BW_OreLayer.sWeight); for (BW_OreLayer tWorldGen : BW_OreLayer.sList) { + if (!tWorldGen.isGenerationAllowed(this.mWorld, this.mDimensionType, this.mDimensionType)) + continue; tRandomWeight -= tWorldGen.mWeight; if (tRandomWeight <= 0) { try { boolean placed; int attempts = 0; - do{ + do { placed = tWorldGen.executeWorldgen(this.mWorld, random, "", this.mDimensionType, xCenter, zCenter, this.mChunkGenerator, this.mChunkProvider); ++attempts; } while ((!placed) && attempts < 25); - temp = false; + temp = false; break; } catch (Throwable e) { e.printStackTrace(GT_Log.err); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index 08e26b4075..471120793e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -40,11 +40,21 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { return Blocks.stone; } + @Override + public int[] getDefaultDamageToReplace() { + return new int[]{0}; + } + + @Override + public String getDimName() { + return StatCollector.translateToLocal("planet.Ross128b"); + } + public BW_WorldGenRoss128b(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { super(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, top, bottom, between, sprinkled); } - public static void init_OresRoss128() { + public static void initOres() { new BW_WorldGenRoss128b("ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, Thorianit, Uraninite, Lepidolite, Spodumene); new BW_WorldGenRoss128b("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Graphite, Diamond, Coal, Graphite); new BW_WorldGenRoss128b("ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, Bismuthinit, Stibnite, Bismuth, Bismutite); @@ -57,7 +67,7 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { new BW_WorldGenRoss128b("ore.mix.ross128.RedZircon", true, 10, 80, 40, 3, 24, Fayalit, FuchsitAL, RedZircon, FuchsitCR); } - public static void init_undergroundFluidsRoss128() { + public static void initundergroundFluids() { String ross128b = StatCollector.translateToLocal("planet.Ross128b"); uo_dimensionList.SetConfigValues(ross128b, ross128b, "veryheavyoil", "liquid_extra_heavy_oil", 0, 625, 40, 5); uo_dimensionList.SetConfigValues(ross128b, ross128b, "lava", FluidRegistry.getFluidName(FluidRegistry.LAVA), 0, 32767, 5, 5); @@ -66,7 +76,7 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { @Override public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { - return aWorld.provider.dimensionId == ConfigHandler.ross128BID; + return aDimensionType == ConfigHandler.ross128BID; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java index 8bcffab9b1..ae7b8bcf6c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java @@ -22,11 +22,11 @@ package com.github.bartimaeusnek.bartworks.system.oregen; -import gregtech.api.enums.Materials; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import gregtech.api.interfaces.ISubTagContainer; -import gregtech.api.util.GT_ModHandler; import net.minecraft.block.Block; import net.minecraft.util.StatCollector; +import net.minecraft.world.World; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; @@ -40,20 +40,43 @@ public class BW_WorldGenRoss128ba extends BW_OreLayer { @Override public Block getDefaultBlockToReplace() { - return Block.getBlockFromItem(GT_ModHandler.getModItem("galacticraftCore","tile.moonBlock",1).getItem()); + return Block.getBlockFromName("GalacticraftCore:tile.moonBlock"); + } + @Override + public int[] getDefaultDamageToReplace(){ + int[] ret = new int[12]; + for (int i = 0; i < 12; i++) { + if (i != 5 && i != 3) + ret[i] = i; + } + return ret; } - public static void init_OresRoss128ba() { - new BW_WorldGenRoss128ba("ore.mix.ross128ba.tib", true, 30, 60, 6, 1, 16, Tiberium, Tiberium, NaquadahEnriched, NaquadahEnriched); - new BW_WorldGenRoss128ba("ore.mix.ross128.Tungstate", true, 5, 40, 10, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite); - new BW_WorldGenRoss128ba("ore.mix.ross128ba.bart", true, 30, 60, 1, 1, 3, BArTiMaEuSNeK, BArTiMaEuSNeK, BArTiMaEuSNeK, BArTiMaEuSNeK); + @Override + public String getDimName() { + return StatCollector.translateToLocal("moon.Ross128ba"); + } + public static void init_Ores() { + new BW_WorldGenRoss128ba("ore.mix.ross128ba.tib", true, 30, 60, 6, 1, 16, Tiberium, Tiberium, NaquadahEnriched, NaquadahEnriched); + new BW_WorldGenRoss128ba("ore.mix.ross128ba.Tungstate", true, 5, 40, 60, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite); + new BW_WorldGenRoss128ba("ore.mix.ross128ba.bart", true, 30, 60, 1, 1, 1, BArTiMaEuSNeK, BArTiMaEuSNeK, BArTiMaEuSNeK, BArTiMaEuSNeK); + new BW_WorldGenRoss128ba("ore.mix.ross128ba.TurmalinAlkali", true, 5, 80, 60, 4, 48, Olenit, FluorBuergerit, ChromoAluminoPovondrait, VanadioOxyDravit); + new BW_WorldGenRoss128ba("ore.mix.ross128ba.Amethyst", true, 5, 80, 35, 2, 8, Amethyst, Olivine, Prasiolite, Hedenbergit); + new BW_WorldGenRoss128ba("ore.mix.ross128ba.CopperSulfits", true, 40, 70, 80, 3, 24, Djurleit, Bornite, Wittichenit, Tetrahedrite); + new BW_WorldGenRoss128ba("ore.mix.ross128ba.RedZircon", true, 10, 80, 40, 3, 24, Fayalit, FuchsitAL, RedZircon, FuchsitCR); + new BW_WorldGenRoss128ba("ore.mix.ross128ba.Fluorspar", true, 10, 80, 35, 4, 8, Galena, Sphalerite, Fluorspar, Barite); } - public static void init_undergroundFluidsRoss128ba() { - String ross128b = StatCollector.translateToLocal("planet.Ross128ba"); - uo_dimensionList.SetConfigValues(ross128b, ross128b, Materials.SaltWater.getFluid(1).getUnlocalizedName(), Materials.SaltWater.getFluid(1).getUnlocalizedName(), 0, 625, 40, 5); - uo_dimensionList.SetConfigValues(ross128b, ross128b, Materials.Helium_3.getGas(1).getUnlocalizedName(), Materials.Helium_3.getGas(1).getUnlocalizedName(), 0, 625, 60, 5); + public static void init_undergroundFluids() { + String ross128b = StatCollector.translateToLocal("moon.Ross128ba"); + uo_dimensionList.SetConfigValues(ross128b, ross128b, SaltWater.getFluid(1).getFluid().getName(), SaltWater.getFluid(1).getFluid().getName(), 0, 625, 40, 5); + uo_dimensionList.SetConfigValues(ross128b, ross128b, Helium_3.getGas(1).getFluid().getName(), Helium_3.getGas(1).getFluid().getName(), 0, 625, 60, 5); + } + @Override + public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { + return aDimensionType == ConfigHandler.ross128BAID; } + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java index f1ae2667ee..11d6637db3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java @@ -203,9 +203,12 @@ public class BW_ColorUtil { } public static short[] correctCorlorArray(short[] rgba){ + if (rgba.length>4) { + rgba = Arrays.copyOfRange(rgba, 0,4); + } if (rgba.length<4) { short[] tmp = Arrays.copyOf(rgba, 4); - Arrays.fill(tmp,rgba.length-1,4, (short) 0); + Arrays.fill(tmp,rgba.length,4, (short) 0); rgba = tmp; } if (rgba[0] > 255) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java index cca1bf94d4..b3648ccabc 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java @@ -23,6 +23,8 @@ package com.github.bartimaeusnek.crossmod.galacticraft; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b; +import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128ba; import com.github.bartimaeusnek.crossmod.galacticraft.atmosphere.BWAtmosphereManager; import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; import cpw.mods.fml.common.FMLCommonHandler; @@ -35,9 +37,6 @@ import net.minecraftforge.common.config.Configuration; import java.io.File; -import static com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b.init_OresRoss128; -import static com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b.init_undergroundFluidsRoss128; - public class GalacticraftProxy { public static GT_UO_DimensionList uo_dimensionList = new GT_UO_DimensionList(); static Configuration gtConf; @@ -72,10 +71,12 @@ public class GalacticraftProxy { private static void commonpreInit(FMLPreInitializationEvent e) { GalacticraftProxy.gtConf = new Configuration(new File(new File(e.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg")); GalacticraftProxy.uo_dimensionList.getConfig(GalacticraftProxy.gtConf, "undergroundfluid"); - init_undergroundFluidsRoss128(); + BW_WorldGenRoss128b.initundergroundFluids(); + BW_WorldGenRoss128ba.init_undergroundFluids(); if (GalacticraftProxy.gtConf.hasChanged()) GalacticraftProxy.gtConf.save(); - init_OresRoss128(); + BW_WorldGenRoss128b.initOres(); + BW_WorldGenRoss128ba.init_Ores(); MinecraftForge.EVENT_BUS.register(BWAtmosphereManager.INSTANCE); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index 34e96e6111..c815c6f3d6 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -53,7 +53,7 @@ import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.Ev public class ChunkProviderRoss128b extends ChunkProviderGenerate { XSTR rand = new XSTR(); private BiomeGenBase[] biomesForGeneration; - private final BW_WordGenerator BWOreGen = new BW_WordGenerator(); + public static final BW_WordGenerator BWOreGen = new BW_WordGenerator(); private final World worldObj; private final MapGenBase caveGenerator = new MapGenCaves(); private final MapGenBase ravineGenerator = new MapGenRavine(); @@ -159,7 +159,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { } } - this.BWOreGen.generate(this.rand, p_73153_2_, p_73153_3_, this.worldObj, this, this); + BWOreGen.generate(this.rand, p_73153_2_, p_73153_3_, this.worldObj, this, this); MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); BlockFalling.fallInstantly = false; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java index 044737ac9c..2cc84b41ea 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba; import com.github.bartimaeusnek.bartworks.util.NoiseUtil.BartsNoise; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.ChunkProviderRoss128b; import gregtech.api.objects.XSTR; import micdoodle8.mods.galacticraft.api.prefab.world.gen.MapGenBaseMeta; import micdoodle8.mods.galacticraft.core.blocks.GCBlocks; @@ -30,10 +31,12 @@ import micdoodle8.mods.galacticraft.core.world.gen.BiomeGenBaseMoon; import micdoodle8.mods.galacticraft.core.world.gen.ChunkProviderMoon; import micdoodle8.mods.galacticraft.core.world.gen.MapGenCavesMoon; import net.minecraft.block.Block; +import net.minecraft.block.BlockFalling; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; import java.util.Arrays; @@ -66,6 +69,14 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { return Chunk; } + @Override + public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { + super.populate(par1IChunkProvider, par2, par3); + BlockFalling.fallInstantly = true; + ChunkProviderRoss128b.BWOreGen.generate(this.rand, par2, par3, this.worldObj, this, this); + BlockFalling.fallInstantly = false; + } + private int getIndex(int x, int y, int z) { return (x * 16 + z) * 256 + y; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index 359450c7f9..a4410102a7 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -71,15 +71,13 @@ public class Ross128SolarSystem { Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128Ba.class); Ross128SolarSystem.Ross128ba.setTierRequired(Loader.isModLoaded("galaxyspace") ? Math.min(ConfigHandler.ross128btier + 1, 8) : 3); - //Ross128SolarSystem.Ross128ba.setUnreachable(); - GalaxyRegistry.registerSolarSystem(Ross128SolarSystem.Ross128System); GalaxyRegistry.registerPlanet(Ross128SolarSystem.Ross128b); -// GalaxyRegistry.registerMoon(Ross128SolarSystem.Ross128ba); + GalaxyRegistry.registerMoon(Ross128SolarSystem.Ross128ba); GalacticraftRegistry.registerRocketGui(WorldProviderRoss128b.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/overworldRocketGui.png")); -// GalacticraftRegistry.registerRocketGui(WorldProviderRoss128Ba.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/moonRocketGui.png")); + GalacticraftRegistry.registerRocketGui(WorldProviderRoss128Ba.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/moonRocketGui.png")); GalacticraftRegistry.registerTeleportType(WorldProviderRoss128b.class, new UniversalTeleportType()); -// GalacticraftRegistry.registerTeleportType(WorldProviderRoss128Ba.class, new UniversalTeleportType()); + GalacticraftRegistry.registerTeleportType(WorldProviderRoss128Ba.class, new UniversalTeleportType()); } } -- cgit From 3d3427e5720aca81d4559290b077bc6b33dff4ec Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 21 Sep 2019 13:09:08 +0200 Subject: security patches +moved some commands, +fixed a typo +removed null items +rebalanced TheCore +added forestry compat (possible due to their LGPL license!) +fixed langfiles Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: cf1373fd88ba341662144023f989bc45fef3c48d --- .../github/bartimaeusnek/bartworks/MainMod.java | 14 +- .../client/textures/PrefixTextureLinker.java | 39 ++++ .../bartworks/common/loaders/BeforeGTPreload.java | 4 + .../tiered/GT_MetaTileEntity_BioLab.java | 2 +- .../system/material/BW_MetaGenerated_Items.java | 30 +++- .../material/GT_Enhancement/BWGTMetaItems.java | 144 +++++++++++++++ .../GT_Enhancement/GTMetaItemEnhancer.java | 63 +++++++ .../bartworks/system/material/Werkstoff.java | 4 + .../bartworks/system/material/WerkstoffLoader.java | 51 ++++-- .../processingLoaders/AdditionalRecipes.java | 9 +- .../processingLoaders/AfterLuVTierEnhacement.java | 6 +- .../processingLoaders/LoadItemContainers.java | 2 +- .../processingLoaders/LuVTierEnhancer.java | 9 +- .../processingLoaders/PlatinumSludgeOverHaul.java | 6 +- .../bartworks/system/worldgen/MapGenRuins.java | 4 +- .../solarsystems/Ross128SolarSystem.java | 2 +- .../thaumcraft/util/ThaumcraftHandler.java | 7 +- .../resources/assets/bartworks/lang/de_DE.lang | 199 +++++++++++---------- .../resources/assets/bartworks/lang/fr_FR.lang | 22 ++- .../resources/assets/bartworks/lang/zh_CN.lang | 2 +- .../items/materialicons/DIAMOND/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/DIAMOND/capsuleMolten.png | Bin 0 -> 135 bytes .../DIAMOND/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../materialicons/DIAMOND/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../textures/items/materialicons/DULL/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/DULL/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/DULL/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/DULL/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../items/materialicons/EMERALD/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/EMERALD/capsuleMolten.png | Bin 0 -> 135 bytes .../EMERALD/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../materialicons/EMERALD/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../textures/items/materialicons/FIERY/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/FIERY/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/FIERY/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/FIERY/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../textures/items/materialicons/FINE/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/FINE/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/FINE/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/FINE/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../textures/items/materialicons/FLINT/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/FLINT/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/FLINT/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/FLINT/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../textures/items/materialicons/FLUID/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/FLUID/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/FLUID/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/FLUID/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../items/materialicons/GEM_HORIZONTAL/capsule.png | Bin 0 -> 211 bytes .../materialicons/GEM_HORIZONTAL/capsuleMolten.png | Bin 0 -> 135 bytes .../GEM_HORIZONTAL/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../GEM_HORIZONTAL/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../items/materialicons/GEM_VERTICAL/capsule.png | Bin 0 -> 211 bytes .../materialicons/GEM_VERTICAL/capsuleMolten.png | Bin 0 -> 135 bytes .../GEM_VERTICAL/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../materialicons/GEM_VERTICAL/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../textures/items/materialicons/GLASS/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/GLASS/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/GLASS/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/GLASS/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../textures/items/materialicons/LAPIS/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/LAPIS/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/LAPIS/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/LAPIS/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../textures/items/materialicons/LEAF/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/LEAF/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/LEAF/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/LEAF/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../items/materialicons/LIGNITE/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/LIGNITE/capsuleMolten.png | Bin 0 -> 135 bytes .../LIGNITE/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../materialicons/LIGNITE/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../items/materialicons/MAGNETIC/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/MAGNETIC/capsuleMolten.png | Bin 0 -> 135 bytes .../MAGNETIC/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../materialicons/MAGNETIC/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../items/materialicons/METALLIC/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/METALLIC/capsuleMolten.png | Bin 0 -> 135 bytes .../METALLIC/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../materialicons/METALLIC/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../items/materialicons/NETHERSTAR/capsule.png | Bin 0 -> 211 bytes .../materialicons/NETHERSTAR/capsuleMolten.png | Bin 0 -> 135 bytes .../NETHERSTAR/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../materialicons/NETHERSTAR/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../textures/items/materialicons/NONE/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/NONE/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/NONE/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/NONE/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../textures/items/materialicons/OPAL/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/OPAL/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/OPAL/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/OPAL/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../textures/items/materialicons/PAPER/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/PAPER/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/PAPER/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/PAPER/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../items/materialicons/POWDER/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/POWDER/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/POWDER/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/POWDER/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../items/materialicons/QUARTZ/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/QUARTZ/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/QUARTZ/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/QUARTZ/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../textures/items/materialicons/ROUGH/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/ROUGH/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/ROUGH/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/ROUGH/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../textures/items/materialicons/RUBY/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/RUBY/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/RUBY/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/RUBY/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../textures/items/materialicons/SAND/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/SAND/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/SAND/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/SAND/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../items/materialicons/SHARDS/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/SHARDS/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/SHARDS/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/SHARDS/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../textures/items/materialicons/SHINY/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/SHINY/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/SHINY/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/SHINY/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../textures/items/materialicons/WOOD/capsule.png | Bin 0 -> 211 bytes .../items/materialicons/WOOD/capsuleMolten.png | Bin 0 -> 135 bytes .../materialicons/WOOD/capsuleMolten_OVERLAY.png | Bin 0 -> 168 bytes .../items/materialicons/WOOD/capsule_OVERLAY.png | Bin 0 -> 308 bytes .../gregtech/textures/items/materialicons/copy.bat | 1 + 129 files changed, 485 insertions(+), 135 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsule.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsuleMolten.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsuleMolten_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsule_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/copy.bat diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 1d452f0505..6182738f04 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -30,6 +30,7 @@ import com.github.bartimaeusnek.bartworks.client.ClientEventHandler.TooltipEvent import com.github.bartimaeusnek.bartworks.client.creativetabs.BioTab; import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab; +import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader; @@ -48,6 +49,7 @@ import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.Plat import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.google.common.collect.ArrayListMultimap; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; @@ -58,6 +60,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartedEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.objects.GT_ItemStack; @@ -89,6 +92,7 @@ import static gregtech.api.enums.GT_Values.VN; + "after:berriespp; " + "after:GalacticraftMars; " + "after:GalacticraftCore; " + + "after:Forestry; " ) public final class MainMod { public static final String NAME = "BartWorks"; @@ -122,9 +126,6 @@ public final class MainMod { } } - //fixing BorosilicateGlass... -_-' - Materials.BorosilicateGlass.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); - if (Loader.isModLoaded("dreamcraft")) { ConfigHandler.GTNH = true; } @@ -147,6 +148,8 @@ public final class MainMod { INSTANCE.init(); Werkstoff.init(); GregTech_API.sAfterGTPostload.add(new CircuitPartLoader()); + if (FMLCommonHandler.instance().getSide().isClient()) + new PrefixTextureLinker(); } } @@ -219,7 +222,7 @@ public final class MainMod { } private static void unificationEnforcer() { - for (Werkstoff werkstoff : Werkstoff.werkstoffHashMap.values()) { + for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { if (werkstoff.getGenerationFeatures().enforceUnification) { if (werkstoff.contains(NOBLE_GAS)){ String name = werkstoff.getFluidOrGas(1).getFluid().getName(); @@ -310,6 +313,9 @@ public final class MainMod { HashSet torem = new HashSet<>(); ItemStack toReplace = null; for (Map.Entry entry : sFilledContainerToData.entrySet()) { + final String MODID = GameRegistry.findUniqueIdentifierFor(data.filledContainer.getItem()).modId; + if (MODID.equals(MainMod.MOD_ID) || MODID.equals(BartWorksCrossmod.MOD_ID)) + continue; if (entry.getValue().fluid.equals(data.fluid) && !entry.getValue().filledContainer.equals(data.filledContainer)) { toReplace = entry.getValue().filledContainer; torem.add(entry); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java new file mode 100644 index 0000000000..96e69f4cf3 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java @@ -0,0 +1,39 @@ +package com.github.bartimaeusnek.bartworks.client.textures; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TextureSet; +import gregtech.api.enums.Textures; + +import java.util.Arrays; +import java.util.HashMap; + +@SideOnly(Side.CLIENT) +public class PrefixTextureLinker implements Runnable { + public static HashMap> texMap = new HashMap<>(); + + { + GregTech_API.sBeforeGTLoad.add(this); + } + + @Override + public void run() { + + for (OrePrefixes prefixes : OrePrefixes.values()) { + HashMap curr = new HashMap<>(); + if (prefixes.mTextureIndex == -1 && Werkstoff.GenerationFeatures.prefixLogic.get(prefixes) != 0) { + Arrays.stream(TextureSet.class.getFields()).filter(field -> field.getName().contains("SET")).forEach(SET -> { + try { + curr.put(SET.get(null), new Textures.ItemIcons.CustomIcon("materialicons/" + SET.getName().substring(4) + "/" + prefixes)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + }); + texMap.put(prefixes, curr); + } + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java index 2164330a96..ed84c5a98f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java @@ -28,6 +28,8 @@ import cpw.mods.fml.common.LoadController; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.enums.Materials; +import gregtech.api.enums.SubTag; import ic2.core.Ic2Items; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -45,6 +47,8 @@ public class BeforeGTPreload implements Runnable { public void run() { if (didrun) return; + //fixing BorosilicateGlass... -_-' + Materials.BorosilicateGlass.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); Field activeContainer = FieldUtils.getDeclaredField(LoadController.class, "activeContainer", true); ModContainer bartworks = null; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index 5ca5d59a19..154b2a1355 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -54,7 +54,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { private static final String MGUINAME = "BW.GUI.BioLab.png"; public GT_MetaTileEntity_BioLab(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, null, 6, 2, GT_MetaTileEntity_BioLab.MGUINAME, null, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")/*this is topactive*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")/*this is top*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM"))); + super(aID, aName, aNameRegional, aTier, 1, (String) null, 6, 2, GT_MetaTileEntity_BioLab.MGUINAME, null, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")/*this is topactive*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")/*this is top*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM"))); } public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, String aNEIName) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index e7a4c3aa02..c25dbd6bf1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -23,14 +23,18 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.API.IRadMaterial; +import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.Pair; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TextureSet; +import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Item; import gregtech.api.util.GT_LanguageManager; @@ -53,6 +57,7 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import java.util.HashMap; import java.util.List; import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap; @@ -69,6 +74,11 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa protected final OrePrefixes orePrefixes; private final short aNumToGen = (short) werkstoffHashMap.size(); + public BW_MetaGenerated_Items(OrePrefixes orePrefixes, Object unused){ + super("bwMetaGeneratedGTEnhancement" + orePrefixes.name(), (short) 32766, (short) 0); + this.orePrefixes = orePrefixes; + } + public BW_MetaGenerated_Items(OrePrefixes orePrefixes) { super("bwMetaGenerated" + orePrefixes.name(), (short) 32766, (short) 0); this.orePrefixes = orePrefixes; @@ -148,13 +158,23 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } @Override - public final IIconContainer getIconContainer(int aMetaData) { - return werkstoffHashMap.get((short) aMetaData) == null ? null : this.orePrefixes.mTextureIndex == -1 ? null : werkstoffHashMap.get((short) aMetaData).getTexSet().mTextures[this.orePrefixes.mTextureIndex]; + public IIconContainer getIconContainer(int aMetaData) { + if (werkstoffHashMap.get((short) aMetaData) == null) + return null; + if (this.orePrefixes.mTextureIndex == -1) + return getIconContainerBartWorks(aMetaData); + return werkstoffHashMap.get((short) aMetaData).getTexSet().mTextures[this.orePrefixes.mTextureIndex]; + } + + protected IIconContainer getIconContainerBartWorks(int aMetaData) { + if (FMLCommonHandler.instance().getSide().isClient()) + return PrefixTextureLinker.texMap.get(this.orePrefixes).get(werkstoffHashMap.get((short) aMetaData).getTexSet()); + return null; } @Override @SideOnly(Side.CLIENT) - public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { + public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { for (int i = 0; i < this.aNumToGen; i++) { Werkstoff werkstoff = werkstoffHashMap.get((short) i); if (werkstoff != null && ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) != 0) && ((werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0)) { @@ -207,7 +227,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public int getItemStackLimit(ItemStack aStack) { - return 64; + return this.orePrefixes.mDefaultStackSize; } @Override @@ -235,6 +255,6 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public int getCapacity(ItemStack aStack) { - return this.orePrefixes == OrePrefixes.cell || this.orePrefixes == OrePrefixes.cellPlasma ? 1000 : this.orePrefixes == WerkstoffLoader.cellMolten ? 144 : 0; + return this.orePrefixes == OrePrefixes.capsule || this.orePrefixes == OrePrefixes.cell || this.orePrefixes == OrePrefixes.cellPlasma ? 1000 : this.orePrefixes == WerkstoffLoader.cellMolten || this.orePrefixes == WerkstoffLoader.capsuleMolten ? 144 : 0; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java new file mode 100644 index 0000000000..8cd06481d3 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -0,0 +1,144 @@ +package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; + +import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; +import com.github.bartimaeusnek.bartworks.util.Pair; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_OreDictUnificator; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import java.util.List; + +import static com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.GTMetaItemEnhancer.NoMetaValue; + +public class BWGTMetaItems extends BW_MetaGenerated_Items { + + boolean hasList; + + public BWGTMetaItems(OrePrefixes orePrefixes, List noSubIDMaterials) { + super(orePrefixes,null); + materialloop: + for (int i = 0; i < Materials.values().length; i++) { + ItemStack tStack = new ItemStack(this, 1, i); + Materials w = Materials.values()[i]; + if (!((w.getMolten(1) != null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) != null || w.getGas(1) != null) && orePrefixes == OrePrefixes.capsule))) + continue; + for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) + if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) + continue materialloop; + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", getDefaultLocalization(w)); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); + if (ConfigHandler.experimentalThreadedLoader) + OreDictAdder.addToMap(new Pair<>(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack)); + else + GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); + } + if (noSubIDMaterials != null){ + hasList = true; + materialloop: + for (int i = 0; i < noSubIDMaterials.size(); i++) { + ItemStack tStack = new ItemStack(this, 1, i+1001); + Materials w = (Materials) noSubIDMaterials.get(i); + if (!((w.getMolten(1) != null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) != null || w.getGas(1) != null) && orePrefixes == OrePrefixes.capsule))) + continue; + for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) + if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) + continue materialloop; + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", getDefaultLocalization(w)); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); + if (ConfigHandler.experimentalThreadedLoader) + OreDictAdder.addToMap(new Pair<>(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack)); + else + GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); + } + } + } + + @Override + public IIconContainer getIconContainer(int aMetaData) { + if (this.orePrefixes.mTextureIndex == -1) + return getIconContainerBartWorks(aMetaData); + if (aMetaData > 1000 && hasList) + return NoMetaValue.get(aMetaData-1001).mIconSet.mTextures[this.orePrefixes.mTextureIndex]; + if (aMetaData < 0 || aMetaData > Materials.values().length || Materials.values()[(short) aMetaData] == null) + return null; + return Materials.values()[(short) aMetaData].mIconSet.mTextures[this.orePrefixes.mTextureIndex]; + } + + public String getDefaultLocalization(Materials werkstoff) { + return werkstoff != null ? this.orePrefixes.mLocalizedMaterialPre + werkstoff.mDefaultLocalName + this.orePrefixes.mLocalizedMaterialPost : Materials._NULL.mDefaultLocalName; + } + + protected IIconContainer getIconContainerBartWorks(int aMetaData) { + if (FMLCommonHandler.instance().getSide().isClient()) { + if (aMetaData > 1000 && hasList) + return PrefixTextureLinker.texMap.get(this.orePrefixes).get(NoMetaValue.get(aMetaData-1001).mIconSet); + return PrefixTextureLinker.texMap.get(this.orePrefixes).get(Materials.values()[(short) aMetaData].mIconSet); + } + return null; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { + for (int i = 0; i < Materials.values().length; i++) { + Materials w = Materials.values()[i]; + if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes) != 0) + continue; + if ((w.getMolten(1) != null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) != null || w.getGas(1) != null) && orePrefixes == OrePrefixes.capsule)) + aList.add(new ItemStack(this, 1, i)); + } + for (int i = 0; i < NoMetaValue.size(); i++) { + Materials w = NoMetaValue.get(i); + if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes) != 0) + continue; + if (hasList && ((w.getMolten(1) != null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) != null || w.getGas(1) != null) && orePrefixes == OrePrefixes.capsule))) + aList.add(new ItemStack(this, 1, i+1001)); + } + } + + @Override + public short[] getColorForGUI(ItemStack aStack) { + if (aStack.getItemDamage() > 1000 && hasList) + return NoMetaValue.get(aStack.getItemDamage()-1001).mRGBa; + return Materials.values()[aStack.getItemDamage()].mRGBa; + } + + @Override + public String getNameForGUI(ItemStack aStack) { + if (aStack.getItemDamage() > 1000 && hasList) + return NoMetaValue.get(aStack.getItemDamage()-1001).mDefaultLocalName; + return Materials.values()[aStack.getItemDamage()].mDefaultLocalName; + } + + @Override + public void onUpdate(ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) { + + } + + @Override + public short[] getRGBa(ItemStack aStack) { + if (aStack.getItemDamage() > 1000 && hasList) + return NoMetaValue.get(aStack.getItemDamage()-1001).mRGBa; + return Materials.values()[aStack.getItemDamage()].mRGBa; + } + + public boolean onEntityItemUpdate(EntityItem aItemEntity) { + return false; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java new file mode 100644 index 0000000000..35214f636c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -0,0 +1,63 @@ +package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; + +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import cpw.mods.fml.common.Loader; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; + +import java.util.List; +import java.util.stream.Collectors; + +public class GTMetaItemEnhancer { + static List NoMetaValue; + + + static{ + if (Loader.isModLoaded("Forestry")) { + NoMetaValue = Materials.getMaterialsMap().values().stream().filter(m -> m.mMetaItemSubID == -1).collect(Collectors.toList()); + Item moltenCapsuls = new BWGTMetaItems(WerkstoffLoader.capsuleMolten, null); + Item capsuls = new BWGTMetaItems(OrePrefixes.capsule, NoMetaValue); + + Materials[] values = Materials.values(); + for (int i = 0, valuesLength = values.length; i < valuesLength; i++) { + Materials m = values[i]; + if (m.mStandardMoltenFluid != null && GT_OreDictUnificator.get(WerkstoffLoader.cellMolten, m, 1) != null) { + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(m.getMolten(144), new ItemStack(moltenCapsuls, 1, i), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + FluidContainerRegistry.registerFluidContainer(emptyData); + GT_Utility.addFluidContainerData(emptyData); + GT_Values.RA.addFluidCannerRecipe(GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1), new ItemStack(moltenCapsuls, 1, i), m.getMolten(144), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(new ItemStack(moltenCapsuls, 1, i), GT_Values.NI, GT_Values.NF, m.getMolten(144)); + } + if (m.hasCorrespondingFluid() || m.hasCorrespondingGas()) { + Fluid f = m.hasCorrespondingFluid() ? m.getFluid(1).getFluid() : m.getGas(1).getFluid(); + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(f, 1000), new ItemStack(capsuls, 1, i), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1)); + FluidContainerRegistry.registerFluidContainer(emptyData); + GT_Utility.addFluidContainerData(emptyData); + GT_Values.RA.addFluidCannerRecipe(GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), new ItemStack(capsuls, 1, i), new FluidStack(f, 1000), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(new ItemStack(capsuls, 1, i), GT_Values.NI, GT_Values.NF, new FluidStack(f, 1000)); + } + } + for (int i = 0, valuesLength = NoMetaValue.size(); i < valuesLength; i++) { + Materials m = NoMetaValue.get(i); + if (m.getFluid(1) != null || m.getGas(1) != null) { + Fluid f = m.hasCorrespondingFluid() ? m.getFluid(1).getFluid() : m.getGas(1).getFluid(); + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(f, 1000), new ItemStack(capsuls, 1, i + 1001), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1)); + FluidContainerRegistry.registerFluidContainer(emptyData); + GT_Utility.addFluidContainerData(emptyData); + GT_Values.RA.addFluidCannerRecipe(GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), new ItemStack(capsuls, 1, i + 1001), new FluidStack(f, 1000), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(new ItemStack(capsuls, 1, i + 1001), GT_Values.NI, GT_Values.NF, new FluidStack(f, 1000)); + } + } + } + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 0cfc13e342..7be1117d4c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -36,6 +36,8 @@ import net.minecraftforge.fluids.FluidStack; import java.nio.ByteBuffer; import java.util.*; +import static gregtech.api.enums.OrePrefixes.capsule; + public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static final LinkedHashSet werkstoffHashSet = new LinkedHashSet<>(); @@ -402,7 +404,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedCentrifuged,0b1000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.cell,0b10000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.capsule,0b10000); + Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.capsuleMolten,0b1000000); Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten,0b1000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plate,0b10000000); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 95337e0a7b..4e1011eb29 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_CircuitsLoader; +import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.GTMetaItemEnhancer; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; @@ -83,13 +84,13 @@ public class WerkstoffLoader implements Runnable { public static final SubTag NOBLE_GAS_SMELTING = SubTag.getNewSubTag("NobleGasSmelting"); public static final SubTag NO_BLAST = SubTag.getNewSubTag("NoBlast"); public static OrePrefixes cellMolten; + public static OrePrefixes capsuleMolten; public static ItemList rotorMold; public static ItemList rotorShape; public static ItemList smallGearShape; public static ItemList ringMold; public static ItemList boltMold; - static { for (OrePrefixes prefix : OrePrefixes.values()){ if (prefix.toString().equals("cellMolten")) @@ -108,7 +109,14 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.ringMold = Enum.valueOf(ItemList.class, "Shape_Mold_Ring"); WerkstoffLoader.boltMold = Enum.valueOf(ItemList.class, "Shape_Mold_Bolt"); } catch (NullPointerException | IllegalArgumentException e){} + //add tiberium Element t = EnumHelper.addEnum(Element.class,"Tr",new Class[]{long.class, long.class, long.class, long.class, String.class, String.class, boolean.class}, new Object[]{123L, 203L, 0L, -1L, (String) null, "Tiberium", false}); + //add molten & regular capsuls + if (Loader.isModLoaded("Forestry")) { + capsuleMolten = EnumHelper.addEnum(OrePrefixes.class, "capsuleMolten", new Class[]{String.class, String.class, String.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, int.class, long.class, int.class, int.class}, new Object[]{"Capsule of Molten stuff", "Molten ", " Capsule", true, true, true, true, false, false, false, true, false, false, 0b1000000, 3628800L, 64, -1}); + capsule.mMaterialGenerationBits = 0b100000; + capsule.mDefaultStackSize = 64; + } } //TODO: FREE ID RANGE: 91-32766 @@ -1272,6 +1280,8 @@ public class WerkstoffLoader implements Runnable { } if (orePrefixes == ore) return new ItemStack(WerkstoffLoader.BWOres, amount, werkstoff.getmID()); + if (WerkstoffLoader.items.get(orePrefixes) == null) + new Exception("NO SUCH ITEM!"+orePrefixes+werkstoff.getDefaultName()).printStackTrace(); return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); } @@ -1358,6 +1368,7 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.Calcium.add(WerkstoffLoader.ANAEROBE_SMELTING); WerkstoffLoader.LuVTierMaterial.add(WerkstoffLoader.NOBLE_GAS_SMELTING); + WerkstoffLoader.LuVFineWireMaterial.add(WerkstoffLoader.NOBLE_GAS_SMELTING); WerkstoffLoader.MagnetoResonaticDust.add(WerkstoffLoader.NO_BLAST); @@ -1451,13 +1462,16 @@ public class WerkstoffLoader implements Runnable { if ((WerkstoffLoader.toGenerateGlobal & 0b10000) != 0) { WerkstoffLoader.items.put(cell, new BW_MetaGenerated_Items(cell)); //WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle)); - //WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); + if (Loader.isModLoaded("Forestry")) + WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); } if ((WerkstoffLoader.toGenerateGlobal & 0b100000) != 0) { WerkstoffLoader.items.put(cellPlasma, new BW_MetaGenerated_Items(cellPlasma)); } if ((WerkstoffLoader.toGenerateGlobal & 0b1000000) != 0) { WerkstoffLoader.items.put(WerkstoffLoader.cellMolten, new BW_MetaGenerated_Items(WerkstoffLoader.cellMolten)); + if (Loader.isModLoaded("Forestry")) + WerkstoffLoader.items.put(capsuleMolten, new BW_MetaGenerated_Items(capsuleMolten)); } if ((WerkstoffLoader.toGenerateGlobal & 0b10000000) != 0) { WerkstoffLoader.items.put(plate, new BW_MetaGenerated_Items(plate)); @@ -1486,19 +1500,19 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.items.put(ingotQuadruple, new BW_MetaGenerated_Items(ingotQuadruple)); WerkstoffLoader.items.put(ingotQuintuple, new BW_MetaGenerated_Items(ingotQuintuple)); } - + WerkstoffLoader.runGTItemDataRegistrator(); } - public void gameRegistryHandler(){ + void gameRegistryHandler(){ if (FMLCommonHandler.instance().getSide().isClient()) RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.01"); - WerkstoffLoader.runGTItemDataRegistrator(); + new GTMetaItemEnhancer(); } - public static void runGTItemDataRegistrator(){ + private static void runGTItemDataRegistrator() { HashSet toRem = new HashSet<>(); for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getDefaultName()) != Materials._NULL ? Materials.get(werkstoff.getDefaultName()) : new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName()); @@ -1555,8 +1569,9 @@ public class WerkstoffLoader implements Runnable { werkstoffBridgeMaterial.mName = werkstoff.getDefaultName(); toRem.add(werkstoffBridgeMaterial); werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); - if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0 && werkstoff.get(prefixes) != null && werkstoff.get(prefixes).getItem() != null) - GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, werkstoff.get(prefixes), false); + if (WerkstoffLoader.items.get(prefixes) != null) + if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0 && werkstoff.get(prefixes) != null && werkstoff.get(prefixes).getItem() != null) + GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, werkstoff.get(prefixes), false); } } } @@ -2090,6 +2105,13 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(fluids.get(werkstoff),1000), GT_Values.NF); GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(fluids.get(werkstoff),1000)); + if (Loader.isModLoaded("Forestry")) { + FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(WerkstoffLoader.fluids.get(werkstoff), 1000), werkstoff.get(capsule), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), true); + GT_Utility.addFluidContainerData(emptyData); + FluidContainerRegistry.registerFluidContainer(emptyData); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsule), GT_Values.NI, GT_Values.NF, new FluidStack(fluids.get(werkstoff), 1000)); + } + if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0){ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getFluidOrGas(1000),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); GT_Values.RA.addFluidSolidifierRecipe(GT_Utility.getIntegratedCircuit(1), werkstoff.getFluidOrGas(1000), werkstoff.get(dust), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); @@ -2131,11 +2153,18 @@ public class WerkstoffLoader implements Runnable { return; //Tank "Recipe" - FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(WerkstoffLoader.molten.get(werkstoff), 144),werkstoff.get(cellMolten),Materials.Empty.getCells(1)); + final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144),werkstoff.get(cellMolten),Materials.Empty.getCells(1)); FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144),werkstoff.get(cell),Materials.Empty.getCells(1)); GT_Utility.addFluidContainerData(data); - GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cellMolten), new FluidStack(molten.get(werkstoff),144), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(molten.get(werkstoff),144)); + GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cellMolten), new FluidStack(Objects.requireNonNull(molten.get(werkstoff)),144), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(molten.get(werkstoff)),144)); + + if (Loader.isModLoaded("Forestry")) { + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + GT_Utility.addFluidContainerData(emptyData); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsuleMolten), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144)); + } if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0) { GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 8071b9b423..353493bb70 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -142,7 +142,14 @@ public class AdditionalRecipes implements Runnable { GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_1.get(4L), GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 6L), BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), 150, 400); GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_2.get(2L), GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), 100, 400); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.NaquadahCell_1.get(32L), GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L), GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L), GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L)},null, BW_NonMeta_MaterialItems.TheCoreCell.get(1L), 100, BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[]{ItemList.NaquadahCell_1.get(32L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L), + WerkstoffLoader.Tiberium.get(dust,64), + WerkstoffLoader.Tiberium.get(dust,64) + },null, BW_NonMeta_MaterialItems.TheCoreCell.get(1L), 100, BW_Util.getMachineVoltageFromTier(6)); GregTech_API.sAfterGTPostload.add(new LuVTierEnhancer()); AdditionalRecipes.oldGThelperMethod(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java index 95ee440ddb..c7c1ed2585 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java @@ -62,11 +62,11 @@ public class AfterLuVTierEnhacement implements Runnable { new int[]{10_000,5_000,5_000,2_500,10_000,10_000},1000,2000); GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), null,null,null, ItemList.Depleted_Naquadah_4.get(8), + WerkstoffLoader.Zirconium.get(dust,64), + WerkstoffLoader.Zirconium.get(dust,64), null, null, null, - null, - null, - null,2000,8000); + new int[]{10_000,5_000,5_000},2000,8000); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java index bcc0917b9a..289d76c4f8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java @@ -37,6 +37,6 @@ public class LoadItemContainers implements Runnable { BW_NonMeta_MaterialItems.TiberiumCell_2.set(new GT_RadioactiveCellIC_Item("Double_Tiberiumcell", "Dual Fuel Rod (Tiberium)", 2, 50000, 2F, 1, 0.5F, BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), false)); BW_NonMeta_MaterialItems.TiberiumCell_4.set(new GT_RadioactiveCellIC_Item("Quad_Tiberiumcell", "Quad Fuel Rod (Tiberium)", 4, 50000, 2F, 1, 0.5F, BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), false)); BW_NonMeta_MaterialItems.Depleted_TheCoreCell.set(new GT_DepletetCell_Item("Core_Reactor_CellDep", "Depleted \"The Core\" Cell", 32)); - BW_NonMeta_MaterialItems.TheCoreCell.set(new GT_RadioactiveCellIC_Item("Core_Reactor_Cell", "\"The Core\" Cell", 32, 102400000, 8F, 32, 1F, BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), false)); + BW_NonMeta_MaterialItems.TheCoreCell.set(new GT_RadioactiveCellIC_Item("Core_Reactor_Cell", "\"The Core\" Cell", 32, 100000, 8F, 32, 1F, BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), false)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java index 50c9e0d311..85f800d77c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java @@ -131,7 +131,8 @@ public class LuVTierEnhancer implements Runnable { continue; ItemData ass = GT_OreDictUnificator.getAssociation(stack); if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) - recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix,stack.stackSize); + if (WerkstoffLoader.items.get(ass.mPrefix) != null) + recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix,stack.stackSize); } } for (GT_Recipe recipe_assemblyLine : GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList){ @@ -145,7 +146,8 @@ public class LuVTierEnhancer implements Runnable { continue; ItemData ass = GT_OreDictUnificator.getAssociation(stack); if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) - recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix,stack.stackSize); + if (WerkstoffLoader.items.get(ass.mPrefix) != null) + recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix, stack.stackSize); } } for (GT_Recipe recipe_assemblyLine : GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList){ @@ -157,7 +159,8 @@ public class LuVTierEnhancer implements Runnable { continue; ItemData ass = GT_OreDictUnificator.getAssociation(stack); if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) - recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix,stack.stackSize); + if (WerkstoffLoader.items.get(ass.mPrefix) != null) + recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix,stack.stackSize); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java index b04e2e6db0..98d0438056 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java @@ -520,15 +520,15 @@ public class PlatinumSludgeOverHaul { if (Block.getBlockFromItem(stack.getItem()) instanceof GT_Generic_Block && !(Block.getBlockFromItem(stack.getItem()) instanceof GT_Block_Ores_Abstract)) return true; + if (GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_1.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_2.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_4.get(1),stack,true)) + return true; + if (stack.getItem() instanceof GT_Generic_Item) { if (!BW_Util.checkStackAndPrefix(stack)) return false; return (!Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mPrefix)) || Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); } - if (GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_1.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_2.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_4.get(1),stack,true)) - return true; - if (Loader.isModLoaded("miscutils")) { try { if (Class.forName("gtPlusPlus.core.item.base.BaseItemComponent").isAssignableFrom(stack.getItem().getClass()) && !(stack.getUnlocalizedName().contains("dust") || stack.getUnlocalizedName().contains("Dust"))) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java index 8c5db993b3..ead000b328 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java @@ -132,8 +132,8 @@ public abstract class MapGenRuins extends WorldGenerator { this.setRoofBlocks(new int[]{9},Blocks.log); this.setMiscBlocks(new int[]{1},Blocks.log); this.statBlocks = new int[]{rand.nextInt(this.ToBuildWith[0].length)}; - int colored=rand.nextInt(15); - int tier = rand.nextInt(6); + int colored = rand.nextInt(15); + int tier = secureRandom.nextInt(6); boolean useColor = rand.nextBoolean(); byte set = 0; byte toSet = (byte) (rand.nextInt(6-tier)+1); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index a4410102a7..b548597e08 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -69,7 +69,7 @@ public class Ross128SolarSystem { Ross128SolarSystem.Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)).setRelativeOrbitTime(1 / 0.01F); Ross128SolarSystem.Ross128ba.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128Ba.class); - Ross128SolarSystem.Ross128ba.setTierRequired(Loader.isModLoaded("galaxyspace") ? Math.min(ConfigHandler.ross128btier + 1, 8) : 3); + Ross128SolarSystem.Ross128ba.setTierRequired(Loader.isModLoaded("GalaxySpace") ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3); GalaxyRegistry.registerSolarSystem(Ross128SolarSystem.Ross128System); GalaxyRegistry.registerPlanet(Ross128SolarSystem.Ross128b); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index 353f656e4e..4d382a6c07 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.crossmod.thaumcraft.util; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.Pair; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TC_Aspects; @@ -150,10 +151,12 @@ public class ThaumcraftHandler { if ((werkstoff.getGenerationFeatures().toGenerate & element.mMaterialGenerationBits) != 0 && (werkstoff.getGenerationFeatures().blacklist & element.mMaterialGenerationBits) == 0) { if (element.mMaterialAmount >= 3628800L || element == OrePrefixes.ore) { DebugLog.log("OrePrefix: "+element.name() + " mMaterialAmount: " + element.mMaterialAmount/3628800L); - ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), werkstoff.getTCAspects(element == OrePrefixes.ore ? 1 : (int) (element.mMaterialAmount / 3628800L))); + if (WerkstoffLoader.items.get(element) != null) + ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), werkstoff.getTCAspects(element == OrePrefixes.ore ? 1 : (int) (element.mMaterialAmount / 3628800L))); } else if (element.mMaterialAmount >= 0L) { - ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), new Pair(TC_Aspects.PERDITIO.mAspect, 1)); + if (WerkstoffLoader.items.get(element) != null) + ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), new Pair(TC_Aspects.PERDITIO.mAspect, 1)); } } } diff --git a/src/main/resources/assets/bartworks/lang/de_DE.lang b/src/main/resources/assets/bartworks/lang/de_DE.lang index df76b57277..f3df754f6b 100644 --- a/src/main/resources/assets/bartworks/lang/de_DE.lang +++ b/src/main/resources/assets/bartworks/lang/de_DE.lang @@ -1,88 +1,96 @@ -itemGroup.GT2C=Gregtech 2 Compat -item.GT_Rockcutter_Item_LV.name=Steinschneider LV -item.GT_Rockcutter_Item_MV.name=Steinschneider MV -item.GT_Rockcutter_Item_HV.name=Steinschneider HV -item.GT_Teslastaff_Item.name=Teslastab +BW_GlasBlocks.0.name=Borosilicat Glass Block +BW_GlasBlocks.1.name=Nickel Verstärkter Borosilicate Glass Block +BW_GlasBlocks.10.name=Farbiger Borosilicate Glass Block (Hell Grün) +BW_GlasBlocks.11.name=Farbiger Borosilicate Glass Block (Braun) +BW_GlasBlocks.12.name=Thorium Yttrium Glass Block +BW_GlasBlocks.2.name=Tungsten Verstärkter Borosilicate Glass Block +BW_GlasBlocks.3.name=Chrome Verstärkter Borosilicate Glass Block +BW_GlasBlocks.4.name=Iridium Verstärkter Borosilicate Glass Block +BW_GlasBlocks.5.name=Osmium Verstärkter Borosilicate Glass Block +BW_GlasBlocks.6.name=Farbiger Borosilicate Glass Block (Rot) +BW_GlasBlocks.7.name=Farbiger Borosilicate Glass Block (Grün) +BW_GlasBlocks.8.name=Farbiger Borosilicate Glass Block (Lila) +BW_GlasBlocks.9.name=Farbiger Borosilicate Glass Block (Gelb) BW_ItemBlocks.0.name=Geätzte Lapis Zelle BW_ItemBlocks.1.name=Plattierte Lapis Zelle -GT_LESU_CASING.0.name=LESU Hülle - -itemGroup.bartworks=BartWorks Inter Temporal BW_Machinery_Casings.0.name=Nickel-Zinc Ferrite Block BW_Machinery_Casings.1.name=Transformer-Wicklungs Block -item.BW_PaperRotor.name=Primitiver Papier Rotor (nur Wind) -item.BW_LeatherRotor.name=Primitiver Leder Rotor (nur Wind) -item.BW_WoolRotor.name=Primitiver Wolle Rotor (nur Wind) +GT_LESU_CASING.0.name=LESU Hülle +filled.item.petriDish.name=Petri Schale mit einer Kultur +item.Agarose.name=Agarose +item.BISOPellet.name=BISO Kügelchen +item.BISOPelletBall.name=BISO Kügelchen Ball +item.BISOPelletCompound.name=BISO Kügelchen Material item.BW_CombinedRotor.name=Primitiver Multi-Material Rotor (nur Wind) -tile.BWRotorBlock.0.name=Primitive Kinetische Achsen Box -item.grindstone_top.name=Oberes Teil des Mahlsteins -item.grindstone_bottom.name=Unteres Teil des Mahlsteins -item.completed_grindstone.name=Mahlsteins -item.rotors.leatherParts.name=Leder umspannter Holzrahmen -item.rotors.woolParts.name=Wolle umspannter Holzrahmen -item.rotors.paperParts.name=Papier umspannter Holzrahmen -item.rotors.combinedParts.name=Multi-Material umspannter Holzrahmen +item.BW_LeatherRotor.name=Primitiver Leder Rotor (nur Wind) +item.BW_PaperRotor.name=Primitiver Papier Rotor (nur Wind) item.BW_SimpleWindMeter.name=Einfaches Wind Meter -tile.BWHeatedWaterPump.0.name=Einfache Stirling Wasser Pumpe -item.BWrawtube.name=Verlängerte Glass Röhre +item.BW_WoolRotor.name=Primitiver Wolle Rotor (nur Wind) item.BWmotor.name=Einfache Wärmekraftmaschine - -itemGroup.BioTab=BartWorks BioEngineering -filled.item.petriDish.name=Petri Schale mit einer Kultur -item.petriDish.name=Sterilisierte Petri Schale +item.BWrawtube.name=Verlängerte Glass Röhre +item.BWstove.name=Einfacher Beheizter Ofen +item.Cells.name=Bakterien Zellen item.DNASampleFlask.name=DNA-Proben Flasche -item.PlasmidCell.name=Plasmid-Proben Flasche item.DetergentPowder.name=Waschmittel -item.Agarose.name=Agarose +item.GT_Rockcutter_Item_HV.name=Steinschneider HV +item.GT_Rockcutter_Item_LV.name=Steinschneider LV +item.GT_Rockcutter_Item_MV.name=Steinschneider MV +item.GT_Teslastaff_Item.name=Teslastab item.IncubationModule.name=Incubations Modul -item.Cells.name=Bakterien Zellen item.PlasmaMembrane.name=Plasma Membran +item.PlasmidCell.name=Plasmid-Proben Flasche +item.TRISOPellet.name=TRISO Kügelchen +item.TRISOPelletBall.name=TRISO Kügelchen Ball +item.TRISOPelletCompound.name=TRISO Kügelchen Material +item.completed_grindstone.name=Mahlstein +item.grindstone_bottom.name=Unteres Teil des Mahlsteins +item.grindstone_top.name=Oberes Teil des Mahlsteins +item.petriDish.name=Sterilisierte Petri Schale +item.rotors.combinedParts.name=Multi-Material umspannter Holzrahmen +item.rotors.leatherParts.name=Leder umspannter Holzrahmen +item.rotors.paperParts.name=Papier umspannter Holzrahmen +item.rotors.woolParts.name=Wolle umspannter Holzrahmen +itemGroup.BioTab=BartWorks BioEngineering +itemGroup.GT2C=Gregtech 2 Compat +itemGroup.bartworks=BartWorks Inter Temporal +itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials +itemGroup.bw.MetaItems.0=BartWorks Circuit Overhaul Items +labModule.item.ClonalCellularSynthesisModule.name=Zelluläres Clone Modul labModule.item.DNAExtractionModule.name=DNA Extractions Modul labModule.item.PCRThermoclyclingModule.name=PCR Thermozykler labModule.item.PlasmidSynthesisModule.name=Plasmid Synthese Modul labModule.item.TransformationModule.name=Transformations Modul -labModule.item.ClonalCellularSynthesisModule.name=Zelluläres Clone Modul -BW_GlasBlocks.0.name=Borosilicat Glass Block -BW_GlasBlocks.1.name=Nickel Verstärkter Borosilicate Glass Block -BW_GlasBlocks.2.name=Tungsten Verstärkter Borosilicate Glass Block -BW_GlasBlocks.3.name=Chrome Verstärkter Borosilicate Glass Block -BW_GlasBlocks.4.name=Iridium Verstärkter Borosilicate Glass Block -BW_GlasBlocks.5.name=Osmium Verstärkter Borosilicate Glass Block -BW_GlasBlocks.6.name=Farbiger Borosilicate Glass Block (Rot) -BW_GlasBlocks.7.name=Farbiger Borosilicate Glass Block (Grün) -BW_GlasBlocks.8.name=Farbiger Borosilicate Glass Block (Lila) -BW_GlasBlocks.9.name=Farbiger Borosilicate Glass Block (Gelb) -BW_GlasBlocks.10.name=Farbiger Borosilicate Glass Block (Hell Grün) -BW_GlasBlocks.11.name=Farbiger Borosilicate Glass Block (Braun) - -tooltip.glas.0.name=Glass-Tier: +moon.Ross128ba=Ross128ba +nei.biovat.0.name=Braucht Glass Tier: +nei.biovat.1.name=Braucht genau +nei.biovat.2.name=Braucht mindestens +planet.Ross128b=Ross128b +solarsystem.Ross128System=Ross128-System +star.Ross128=Ross128 +tile.BWHeatedWaterPump.0.name=Einfache Stirling Wasser Pumpe +tile.BWRotorBlock.0.name=Primitive Kinetische Achsen Box +tile.acidgenerator.name=Säure Generator +tile.biolab.name=Bio Labor +tile.biovat.name=Bacterien Tank +tile.bw.mbf.name=Mega Brennofen +tile.bw.mvf.name=Mega Vacuum Gefrierer +tile.bw.windmill.name=Windmühle +tile.diode.name=Kabel Diode +tile.energydistributor.name=Energie Distributor +tile.manutrafo.name=Manualeller Trafo +tile.radiohatch.name=Radio Hülle tooltip.LESU.0.name=Maximale Kapazität! tooltip.LESU.1.name=Mehrere Kontroller! - -tooltip.windmeter.0.name=Ein einfaches Windmeter, um einen Platz für die Windmühle zu finden. -tooltip.windmeter.1.name=Benutzungen: -tooltip.windmeter.2.name=nicht da zu sein. -tooltip.windmeter.3.name=sehr niedrig zu sein. -tooltip.windmeter.4.name=normal zu sein. -tooltip.windmeter.5.name=eher stark zu sein. -tooltip.windmeter.6.name=sehr stark zu sein. -tooltip.windmeter.7.name=zu stark zu sein. -tooltip.windmeter.8.name=Der Wind hier scheint -tooltip.rotor.0.name=Durchmesser: -tooltip.rotor.1.name=Haltbarkeit: -tooltip.rotor.2.name=Effizienz: -tooltip.cp.0.name=Ist ein Chip drinnen? - tooltip.bw.0.name=Hinzugefügt von tooltip.bw.1.name=Hinzugefügt von bartimaeusnek durch -tooltip.bw.yes.name=Ja -tooltip.bw.no.name=Nein -tooltip.bw.tier.name=Tier: +tooltip.bw.empty.name=Leer tooltip.bw.kg.0.name=kg tooltip.bw.kg.1.name=kgs -tooltip.bw.empty.name=Leer - -tooltip.teslastaff.0.name=Keine Garantie! +tooltip.bw.no.name=Nein +tooltip.bw.tier.name=Tier: +tooltip.bw.yes.name=Ja +tooltip.cp.0.name=Ist ein Chip drinnen? +tooltip.glas.0.name=Glass-Tier: tooltip.labmodule.0.name=A Module used to change the BioLab's working Mode tooltip.labparts.0.name=An empty Sterilized Petri Dish. tooltip.labparts.1.name=An empty DNA Flask. @@ -93,28 +101,26 @@ tooltip.labparts.5.name=A Petri Dish containing: tooltip.labparts.6.name=This is a weak culture, it can not be bred in the Bacterial Vat! tooltip.labparts.7.name=A DNA Flask containing: tooltip.labparts.8.name=A Plasmid Cell containing: - -tooltip.tile.waterpump.0.name=Produces -tooltip.tile.waterpump.1.name=L/s Water when fueled. -tooltip.tile.waterpump.2.name=Must be placed on the Ground. - -tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Boronsilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum -tooltip.tile.mbf.1.name=Pollution per second -tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest +tooltip.rotor.0.name=Durchmesser: +tooltip.rotor.1.name=Haltbarkeit: +tooltip.rotor.2.name=Effizienz: +tooltip.teslastaff.0.name=Keine Garantie! +tooltip.tile.acidgen.0.name=An Acid Generator +tooltip.tile.acidgen.1.name=Creates Power from Chemical Energy Potentials. +tooltip.tile.biolab.0.name=The BioLab, a Multi-Use Bioengineering Station tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom and top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radiation Input Bus;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! -tooltip.tile.windmill.0.name=A primitive Grinder powered by Kinetic energy.;Size(WxHxD): 7x12x7;Layer 1: 7x7 Bricks, corners are air, controller at front centered.;Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,;hollow, Wall must contain at least one Dispenser;Layer 6: 5x5 Wood Planks. Corners are filled, hollow.;Layer 7: 7x7 Wood Planks. Corners are air, hollow.;Layer 8: 7x7 Wood Planks. Corners are air, hollow,;front centered must be a Primitive Kinetic Shaftbox;Layer 9: 7x7 Wood Planks. Corners are air, hollow.;Layer 10: 5x5 Wood Planks. Corners are filled, hollow.;Layer 11: 3x3 Wood Planks. Corners are filled, hollow.;Layer 12: 1x1 Wood Plank.;Needs a Wind Mill Rotor in the Shaftbox to operate;Input items in Controller;Output items will appear in the dispensers;It is faster in regions with more wind (like IC2 Windmills) +tooltip.tile.diode.0.name=A Simple diode that will allow Energy Flow in only one direction. +tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so! +tooltip.tile.energydistributor.0.name=Splits Amperage into several Sides. +tooltip.tile.htr.0.name=Controller Block for the Thorium High Temperature Reactor;Size(WxHxD): 11x12x11 (Hollow);Controller: Front Center, Lowest Layer;Corners and the 2 touching blocks are air;Once build, Helium is inserted into the Fluid Input Hatch until it doesnt accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Raidation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete Operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes 1 Fuel Pellet per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days tooltip.tile.lesu.0.name=Controller Block for the GT2-Styled L.E.S.U.;Size: ANY tooltip.tile.lesu.1.name=Storage per LESU Casing: tooltip.tile.lesu.2.name=Output EU: LESU Casings amount;Input EU: Next Voltage Tier to Output EU;Input/Output Amps can be configured via 4 Circuits in GUI;Output Side has a dot on it. tooltip.tile.lesu.3.name=Only one Controller allowed, no Wallsharing! tooltip.tile.manualtravo.0.name=Controller Block for the Manual Trafo;Operates in 4 different Modes:;Mode 1: Circuit 0 in controller: Direct-Upstep;Mode 2: Circuit 1 in controller: Direct-Downstep;Mode 3: Circuit 2 in controller: Tapped-Upstep;Mode 4: Circuit 3 in controller: Tapped-Downstep;For direct Modes: 3xHx3;Base Contains at least 1 Energy Hatch;1 Layer of Transformer-Winding Blocks for each Tier transformed;Middle of Transformer-Winding Blocks needs to be a Nickel-Zinc Ferrite Block;Top Contains at least 1 Dynamo Hatch;Maintenance Hatch can be placed anywhere;Tapped Mode is disabled at the Moment. -tooltip.tile.tiereddsc.0.name=Voltage: -tooltip.tile.tiereddsc.1.name=Amperage IN: -tooltip.tile.tiereddsc.2.name=Amperage OUT: -tooltip.tile.tiereddsc.3.name=Capacity: -tooltip.tile.diode.0.name=A Simple diode that will allow Energy Flow in only one direction. -tooltip.tile.energydistributor.0.name=Splits Amperage into several Sides. -tooltip.tile.biolab.0.name=The BioLab, a Multi-Use Bioengineering Station +tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Boronsilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum +tooltip.tile.mbf.1.name=Pollution per second +tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest tooltip.tile.radhatch.0.name=Radioactive Item Chamber for Multiblocks tooltip.tile.radhatch.1.name=Use a screwdriver to set the containment level tooltip.tile.radhatch.2.name=Material: @@ -125,19 +131,20 @@ tooltip.tile.radhatch.6.name=t tooltip.tile.radhatch.7.name=s tooltip.tile.radhatch.8.name=m tooltip.tile.radhatch.9.name=h -tooltip.tile.acidgen.0.name=An Acid Generator -tooltip.tile.acidgen.1.name=Creates Power from Chemical Energy Potentials. -nei.biovat.0.name=Braucht Glass Tier: -nei.biovat.1.name=Braucht genau -nei.biovat.2.name=Braucht mindestens - -tile.diode.name=Kabel Diode -tile.energydistributor.name=Energie Distributor -tile.acidgenerator.name=Säure Generator -tile.bw.mbf.name=Mega Brennofen -tile.bw.mvf.name=Mega Vacuum Gefrierer -tile.biolab.name=Bio Labor -tile.biovat.name=Bacterien Tank -tile.radiohatch.name=Radio Hülle -tile.bw.windmill.name=Windmühle -tile.manutrafo.name=Manualeller Trafo \ No newline at end of file +tooltip.tile.tiereddsc.0.name=Voltage: +tooltip.tile.tiereddsc.1.name=Amperage IN: +tooltip.tile.tiereddsc.2.name=Amperage OUT: +tooltip.tile.tiereddsc.3.name=Kapazität: +tooltip.tile.waterpump.0.name=Produziert +tooltip.tile.waterpump.1.name=L/s Wasser wenn laufend. +tooltip.tile.waterpump.2.name=Muss auf dem Boden stehen. +tooltip.tile.windmill.0.name=A primitive Grinder powered by Kinetic energy.;Size(WxHxD): 7x12x7;Layer 1: 7x7 Bricks, corners are air, controller at front centered.;Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,;hollow, Wall must contain at least one Dispenser;Layer 6: 5x5 Wood Planks. Corners are filled, hollow.;Layer 7: 7x7 Wood Planks. Corners are air, hollow.;Layer 8: 7x7 Wood Planks. Corners are air, hollow,;front centered must be a Primitive Kinetic Shaftbox;Layer 9: 7x7 Wood Planks. Corners are air, hollow.;Layer 10: 5x5 Wood Planks. Corners are filled, hollow.;Layer 11: 3x3 Wood Planks. Corners are filled, hollow.;Layer 12: 1x1 Wood Plank.;Needs a Wind Mill Rotor in the Shaftbox to operate;Input items in Controller;Output items will appear in the dispensers;It is faster in regions with more wind (like IC2 Windmills) +tooltip.windmeter.0.name=Ein einfaches Windmeter, um einen Platz für die Windmühle zu finden. +tooltip.windmeter.1.name=Benutzungen: +tooltip.windmeter.2.name=nicht da zu sein. +tooltip.windmeter.3.name=sehr niedrig zu sein. +tooltip.windmeter.4.name=normal zu sein. +tooltip.windmeter.5.name=eher stark zu sein. +tooltip.windmeter.6.name=sehr stark zu sein. +tooltip.windmeter.7.name=zu stark zu sein. +tooltip.windmeter.8.name=Der Wind hier scheint \ No newline at end of file diff --git a/src/main/resources/assets/bartworks/lang/fr_FR.lang b/src/main/resources/assets/bartworks/lang/fr_FR.lang index 847d021e59..16aed282ec 100644 --- a/src/main/resources/assets/bartworks/lang/fr_FR.lang +++ b/src/main/resources/assets/bartworks/lang/fr_FR.lang @@ -55,6 +55,7 @@ BW_GlasBlocks.8.name=Bloc de Verre Boronsilicate coloré (Violet) BW_GlasBlocks.9.name=Bloc de Verre Boronsilicate coloré (Jaune) BW_GlasBlocks.10.name=Bloc de Verre Boronsilicate coloré (Vert Clair) BW_GlasBlocks.11.name=Bloc de Verre Boronsilicate coloré (Marron) +BW_GlasBlocks.12.name=Thorium Yttrium Glass Block tooltip.glas.0.name=Tier de verre: tooltip.LESU.0.name=Capacité maximum! @@ -141,4 +142,23 @@ tile.biolab.name=Bio Lab tile.biovat.name=Bio Cuve tile.radiohatch.name=Trappe Radio tile.bw.windmill.name=Eolienne -tile.manutrafo.name=Transformateur Manuel \ No newline at end of file +tile.manutrafo.name=Transformateur Manuel + +tooltip.tile.htr.0.name=Controller Block for the Thorium High Temperature Reactor;Size(WxHxD): 11x12x11 (Hollow);Controller: Front Center, Lowest Layer;Corners and the 2 touching blocks are air;Once build, Helium is inserted into the Fluid Input Hatch until it doesnt accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Raidation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete Operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes 1 Fuel Pellet per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days +item.TRISOPellet.name=TRISO pebble +item.TRISOPelletBall.name=TRISO pebble ball +item.BISOPelletBall.name=BISO pebble ball +item.BISOPellet.name=BISO pebble +item.TRISOPelletCompound.name=TRISO pebble compund +item.BISOPelletCompound.name=BISO pebble compund +itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials + +tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so! + + +planet.Ross128b=Ross128b +moon.Ross128ba=Ross128ba +star.Ross128=Ross128 +solarsystem.Ross128System=Ross128-System + +itemGroup.bw.MetaItems.0=BartWorks Circuit Overhaul Items diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index 35818c0e8b..419c845f96 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -162,4 +162,4 @@ star.Ross128=罗斯128 solarsystem.Ross128System=罗斯128星系 itemGroup.bw.MetaItems.0=BartWorks电路更新物品 -//This zh_CN.lang is translated by huajijam for bartworks (19/7/19) \ No newline at end of file +#This zh_CN.lang is translated by huajijam for bartworks (19/7/19) \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsule.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsule.png new file mode 100644 index 0000000000..9e388650d9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsule.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsuleMolten.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsuleMolten.png new file mode 100644 index 0000000000..3e9106f277 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsuleMolten.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsuleMolten_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsuleMolten_OVERLAY.png new file mode 100644 index 0000000000..b2bd85bf44 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsuleMolten_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsule_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsule_OVERLAY.png new file mode 100644 index 0000000000..7c6797718d Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/capsule_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/copy.bat b/src/main/resources/assets/gregtech/textures/items/materialicons/copy.bat new file mode 100644 index 0000000000..9713953aac --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/materialicons/copy.bat @@ -0,0 +1 @@ +for /r /d %%I in (*) do xcopy %1 "%%~fsI" /H /K /Y \ No newline at end of file -- cgit From 28da0eda5faf0066a4e44c866feb30b543ba036f Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 25 Sep 2019 05:39:56 +0200 Subject: fixes - cells getting deleted after use on drums - higher tier fluid solodifier uncraftable Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 4cadf71307543fb8923a698dc6c8195ccb71100a --- build.properties | 2 +- .../bartworks/common/loaders/RecipeLoader.java | 8 +- .../system/material/BW_MetaGenerated_Items.java | 5 + .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 6 +- .../crossmod/ae2/ItemSingleItemStorageCell.java | 122 +++++++++++++++++++++ 5 files changed, 137 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java diff --git a/build.properties b/build.properties index cf61024f4f..6304133a65 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre11 +buildNumber=2_pre12 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 9519d67aee..013a26a6aa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -256,10 +256,10 @@ public class RecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1002), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[1], 72000, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Nickel.getMolten(5184), new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 800, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), Materials.Tungsten.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), 800, BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), Materials.Chrome.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), 800, BW_Util.getMachineVoltageFromTier(6)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), Materials.Iridium.getMolten(3888), new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), 800, BW_Util.getMachineVoltageFromTier(7)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), Materials.Osmium.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), 800, BW_Util.getMachineVoltageFromTier(8)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), Materials.Tungsten.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), 800, BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), Materials.Chrome.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), 800, BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), Materials.Iridium.getMolten(3888), new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), 800, BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), Materials.Osmium.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), 800, BW_Util.getMachineVoltageFromTier(7)); for (int i = 0; i < Dyes.dyeBrown.getSizeOfFluidList(); ++i) { GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeRed.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 6), null, null, null, 64, 2); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index c25dbd6bf1..29b98c9506 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -257,4 +257,9 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa public int getCapacity(ItemStack aStack) { return this.orePrefixes == OrePrefixes.capsule || this.orePrefixes == OrePrefixes.cell || this.orePrefixes == OrePrefixes.cellPlasma ? 1000 : this.orePrefixes == WerkstoffLoader.cellMolten || this.orePrefixes == WerkstoffLoader.capsuleMolten ? 144 : 0; } + + @Override + public ItemStack getContainerItem(ItemStack aStack) { + return this.orePrefixes == OrePrefixes.cell ||this.orePrefixes == OrePrefixes.cellPlasma || this.orePrefixes == WerkstoffLoader.cellMolten ? Materials.Empty.getCells(1) : null; + } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 90ed4493e1..19e0603b1c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -22,9 +22,11 @@ package com.github.bartimaeusnek.crossmod; +import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.commands.ChangeConfig; import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; +import com.github.bartimaeusnek.crossmod.ae2.ItemSingleItemStorageCell; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Loader; @@ -53,7 +55,7 @@ import java.io.StringReader; ) public class BartWorksCrossmod { public static final String NAME = "BartWorks Mod Additions"; - public static final String VERSION = "0.0.1"; + public static final String VERSION = MainMod.VERSION; public static final String MOD_ID = "bartworkscrossmod"; public static final Logger LOGGER = LogManager.getLogger(BartWorksCrossmod.NAME); @@ -62,6 +64,8 @@ public class BartWorksCrossmod { @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { +// if (Loader.isModLoaded("appliedenergistics2")) +// new ItemSingleItemStorageCell("singleItemStorageCell"); if (Loader.isModLoaded("GalacticraftCore")) GalacticraftProxy.preInit(preinit); if (Loader.isModLoaded("Thaumcraft")) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java b/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java new file mode 100644 index 0000000000..29aa9d06c3 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java @@ -0,0 +1,122 @@ +package com.github.bartimaeusnek.crossmod.ae2; + +import appeng.api.AEApi; +import appeng.api.config.FuzzyMode; +import appeng.api.config.IncludeExclude; +import appeng.api.implementations.items.IStorageCell; +import appeng.api.storage.*; +import appeng.api.storage.data.IAEItemStack; +import appeng.core.localization.GuiText; +import appeng.items.contents.CellUpgrades; +import appeng.util.Platform; +import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +import java.util.List; + +public class ItemSingleItemStorageCell extends SimpleSubItemClass implements IStorageCell { + + public ItemSingleItemStorageCell(String tex) { + super(tex); + Item thizz = this; + GameRegistry.registerItem(this, BartWorksCrossmod.MOD_ID+this.iconString); + } + + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer p_77624_2_, List lines, boolean p_77624_4_) { + IMEInventoryHandler inventory = AEApi.instance().registries().cell().getCellInventory(stack, (ISaveProvider)null, StorageChannel.ITEMS); + if (inventory instanceof ICellInventoryHandler) { + ICellInventoryHandler handler = (ICellInventoryHandler)inventory; + ICellInventory cellInventory = handler.getCellInv(); + if (cellInventory != null) { + lines.add(cellInventory.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal()); + lines.add(cellInventory.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalItemTypes() + ' ' + GuiText.Types.getLocal()); + if (handler.isPreformatted()) { + String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : GuiText.Excluded).getLocal(); + if (handler.isFuzzy()) { + lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Fuzzy.getLocal()); + } else { + lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Precise.getLocal()); + } + } + } + } + } + + @Override + public int getBytes(ItemStack itemStack) { + return getTotalTypes(itemStack)*getBytesPerType(itemStack); + } + + @Override + public int BytePerType(ItemStack itemStack) { + return 1; + } + + @Override + public int getBytesPerType(ItemStack itemStack) { + return 1; + } + + @Override + public int getTotalTypes(ItemStack itemStack) { + return 4096; + } + + @Override + public boolean isBlackListed(ItemStack itemStack, IAEItemStack iaeItemStack) { + return iaeItemStack == null || iaeItemStack.getItem().getItemStackLimit() != 1; + } + + @Override + public boolean storableInStorageCell() { + return true; + } + + @Override + public boolean isStorageCell(ItemStack itemStack) { + return true; + } + + @Override + public double getIdleDrain() { + return 4D; + } + + @Override + public boolean isEditable(ItemStack itemStack) { + return true; + } + + @Override + public IInventory getUpgradesInventory(ItemStack itemStack) { + return new CellUpgrades(itemStack, 2); + } + + @Override + public IInventory getConfigInventory(ItemStack itemStack) { + return new CellUpgrades(itemStack,2); + } + @Override + public FuzzyMode getFuzzyMode(ItemStack is) { + String fz = Platform.openNbtData(is).getString("FuzzyMode"); + + try { + return FuzzyMode.valueOf(fz); + } catch (Throwable var4) { + return FuzzyMode.IGNORE_ALL; + } + } + @Override + public void setFuzzyMode(ItemStack is, FuzzyMode fzMode) { + Platform.openNbtData(is).setString("FuzzyMode", fzMode.name()); + } +} -- cgit From 95812474d5a2ccdd7936be618ba7b0f22dfcf5cb Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 28 Sep 2019 21:21:39 +0200 Subject: +added localisation to BioCulture System(add your locale to the GT Language File) (fixes #38) +removed dead AE2 code +applied new prefix logic to the thaum compat +added most of GT Tools and some Electric GT Tools +greatly improved bridge materials +fixed some platinum stuff not giving back the correct dusts +fixed formic acid input loss +moved code in the propper packages Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: cd295221dc66e27a72cddc900e70535ea81c5d54 --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 2 +- .../bartworks/common/items/LabParts.java | 8 +- .../bartworks/common/loaders/BioCultureLoader.java | 6 + .../bartworks/common/loaders/FluidLoader.java | 2 + .../system/material/BW_MetaGenerated_Items.java | 3 - .../material/GT_Enhancement/LuVTierEnhancer.java | 212 ++++++++ .../GT_Enhancement/PlatinumSludgeOverHaul.java | 570 +++++++++++++++++++++ .../bartworks/system/material/Werkstoff.java | 91 +++- .../bartworks/system/material/WerkstoffLoader.java | 205 ++++++-- .../processingLoaders/AdditionalRecipes.java | 1 + .../processingLoaders/LuVTierEnhancer.java | 211 -------- .../processingLoaders/PlatinumSludgeOverHaul.java | 548 -------------------- .../bartimaeusnek/bartworks/util/BW_ColorUtil.java | 4 +- .../bartimaeusnek/bartworks/util/BioCulture.java | 11 + .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 1 - .../crossmod/ae2/ItemSingleItemStorageCell.java | 244 ++++----- .../thaumcraft/util/ThaumcraftHandler.java | 2 +- .../resources/assets/bartworks/lang/en_US.lang | 4 +- 19 files changed, 1183 insertions(+), 944 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java diff --git a/build.properties b/build.properties index 6304133a65..ee3f254372 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre12 +buildNumber=2_pre14 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 6182738f04..b936be1f72 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -45,7 +45,7 @@ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.Circ import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader; -import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.PlatinumSludgeOverHaul; +import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.PlatinumSludgeOverHaul; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java index 5aeed95774..675eb4602d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.BioCulture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.creativetab.CreativeTabs; @@ -101,19 +102,20 @@ public class LabParts extends SimpleSubItemClass { return; } + BioCulture culture = BioCulture.getBioCulture(itemStack.getTagCompound().getString("Name")); switch (itemStack.getItemDamage()) { case 0: - list.add(StatCollector.translateToLocal("tooltip.labparts.5.name") + " " + itemStack.getTagCompound().getString("Name")); + list.add(StatCollector.translateToLocal("tooltip.labparts.5.name") + " " + itemStack.getTagCompound().getString("Name") + (culture != null ? " ("+culture.getLocalisedName()+")" : "")); if (!itemStack.getTagCompound().getBoolean("Breedable")) { list.add(StatCollector.translateToLocal("tooltip.labparts.6.name")); } break; case 1: - list.add(StatCollector.translateToLocal("tooltip.labparts.7.name") + " " + itemStack.getTagCompound().getString("Name")); + list.add(StatCollector.translateToLocal("tooltip.labparts.7.name") + " " + itemStack.getTagCompound().getString("Name") + (culture != null ? " ("+culture.getLocalisedName()+")" : "")); break; case 2: - list.add(StatCollector.translateToLocal("tooltip.labparts.8.name") + " " + itemStack.getTagCompound().getString("Name")); + list.add(StatCollector.translateToLocal("tooltip.labparts.8.name") + " " + itemStack.getTagCompound().getString("Name") + (culture != null ? " ("+culture.getLocalisedName()+")" : "")); break; default: break; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java index 57a9ee9aac..35ad62ae47 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java @@ -54,6 +54,12 @@ public class BioCultureLoader implements Runnable { BioCultureLoader.rottenFleshBacteria = BioCulture.createAndRegisterBioCulture(new Color(110, 40, 25), "Escherichia cadaver", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_BETA_LACMATASE), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_BETA_LACMATASE), false); BioCultureLoader.eColi = BioCulture.createAndRegisterBioCulture(new Color(149, 132, 75), "Escherichia koli", BioPlasmid.convertDataToPlasmid(BioCultureLoader.eColiData), BioDNA.convertDataToDNA(BioCultureLoader.eColiData), true); BioCultureLoader.anaerobicOil = BioCulture.createAndRegisterBioCulture(new Color(0, 0, 0), "Pseudomonas Veronii", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_ANAEROBIC_OIL), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_ANAEROBIC_OIL), true); + BioCultureLoader.CommonYeast.setLocalisedName("Common Yeast"); + BioCultureLoader.WhineYeast.setLocalisedName("Whine Yeast"); + BioCultureLoader.BeerYeast.setLocalisedName("Beer Yeast"); + BioCultureLoader.rottenFleshBacteria.setLocalisedName("Rotten Flesh Bacteria"); + BioCultureLoader.eColi.setLocalisedName("eColi Bacteria"); + BioCultureLoader.anaerobicOil.setLocalisedName("Anaerobic Oil Bacteria"); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 5fa6e23213..09d8292eb6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -34,6 +34,7 @@ import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.objects.GT_Fluid; +import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; import ic2.core.item.ItemFluidCell; import net.minecraft.block.Block; @@ -86,6 +87,7 @@ public class FluidLoader implements Runnable { if (B.isBreedable()) { B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()})); FluidRegistry.registerFluid(B.getFluid()); + GT_LanguageManager.addStringLocalization(B.getFluid().getUnlocalizedName(), B.getLocalisedName()+" Fluid"); GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(10),GT_Values.NI,new FluidStack(B.getFluid(),1000),dnaFluid,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,null,500,120); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 29b98c9506..6f0365d412 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -33,8 +33,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.TextureSet; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Item; import gregtech.api.util.GT_LanguageManager; @@ -57,7 +55,6 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import java.util.HashMap; import java.util.List; import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java new file mode 100644 index 0000000000..ee1f6b3b57 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; + +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AfterLuVTierEnhacement; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import cpw.mods.fml.common.Loader; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.objects.ItemData; +import gregtech.api.util.*; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.apache.commons.lang3.reflect.MethodUtils; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; + +import static gregtech.api.enums.OrePrefixes.*; + +public class LuVTierEnhancer implements Runnable { + + public void run() { + LuVTierEnhancer.replaceAsslineRecipes(); + List bufferedRecipeList = null; + try { + bufferedRecipeList = (List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + assert bufferedRecipeList != null; + + HashSet LuVMachines = new HashSet<>(); + OrePrefixes[] LuVMaterialsGenerated = {dust, ingot, plate, stick, stickLong, rotor, plateDouble, plateDense}; + for (ItemList item : ItemList.values()) { + if (item.toString().contains("LuV") && item.hasBeenSet()) + LuVMachines.add(item.get(1)); + } + if (Loader.isModLoaded("dreamcraft")) { + try { + Class customItemListClass = Class.forName("com.dreammaster.gthandler.CustomItemList"); + Method hasnotBeenSet = MethodUtils.getAccessibleMethod(customItemListClass, "hasBeenSet"); + Method get = MethodUtils.getAccessibleMethod(customItemListClass, "get", long.class, Object[].class); + for (Enum customItemList : (Enum[]) FieldUtils.getField(customItemListClass, "$VALUES", true).get(null)) { + if (customItemList.toString().contains("LuV") && (boolean) hasnotBeenSet.invoke(customItemList)) + LuVMachines.add((ItemStack) get.invoke(customItemList, 1, new Object[0])); + } + } catch (IllegalAccessException | ClassNotFoundException | InvocationTargetException e) { + e.printStackTrace(); + } + } + GT_ModHandler.addCraftingRecipe(ItemList.Casing_LuV.get(1), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, new Object[]{"PPP", "PwP", "PPP", 'P', WerkstoffLoader.LuVTierMaterial.get(plate)}); + for (ItemStack stack : LuVMachines) { + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + for (GT_Recipe recipe : map.mRecipeList) { + for (OrePrefixes prefixes : LuVMaterialsGenerated) { + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + } + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + } + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + } + } + } + for (OrePrefixes prefixes : LuVMaterialsGenerated) { + for (Object obj : CraftingManager.getInstance().getRecipeList()) { + if (!(obj instanceof GT_Shaped_Recipe)) + continue; + if (GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true)) { + LuVTierEnhancer.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(), GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + } + for (Object obj : bufferedRecipeList) { + if (!(obj instanceof GT_Shaped_Recipe)) + continue; + if (GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true)) { + LuVTierEnhancer.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(), GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + } + } + } + new AfterLuVTierEnhacement().run(); + } + + private static void replaceAsslineRecipes(){ + for (GT_Recipe.GT_Recipe_AssemblyLine recipe_assemblyLine : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){ + if (recipe_assemblyLine.mEUt > 6000) + continue; + for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) { + ItemStack stack = recipe_assemblyLine.mInputs[i]; + if (!BW_Util.checkStackAndPrefix(stack)) + continue; + ItemData ass = GT_OreDictUnificator.getAssociation(stack); + if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) + if (WerkstoffLoader.items.get(ass.mPrefix) != null) + recipe_assemblyLine.mInputs[i] = WerkstoffLoader.Ruridit.get(ass.mPrefix,stack.stackSize); + } + } + for (GT_Recipe recipe_assemblyLine : GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList){ + if (recipe_assemblyLine.mEUt > BW_Util.getTierVoltage(6)) + continue; + if (BW_Util.checkStackAndPrefix(recipe_assemblyLine.mOutputs[0])) + continue; + for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) { + ItemStack stack = recipe_assemblyLine.mInputs[i]; + if (!BW_Util.checkStackAndPrefix(stack)) + continue; + ItemData ass = GT_OreDictUnificator.getAssociation(stack); + if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) + if (WerkstoffLoader.items.get(ass.mPrefix) != null) + recipe_assemblyLine.mInputs[i] = WerkstoffLoader.Ruridit.get(ass.mPrefix, stack.stackSize); + } + } + for (GT_Recipe recipe_assemblyLine : GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList){ + if (recipe_assemblyLine.mEUt > 6000) + continue; + for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) { + ItemStack stack = recipe_assemblyLine.mInputs[i]; + if (!BW_Util.checkStackAndPrefix(stack)) + continue; + ItemData ass = GT_OreDictUnificator.getAssociation(stack); + if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) + if (WerkstoffLoader.items.get(ass.mPrefix) != null) + recipe_assemblyLine.mInputs[i] = WerkstoffLoader.Ruridit.get(ass.mPrefix,stack.stackSize); + } + } + } + + private static boolean doStacksCointainAndReplace(FluidStack[] stacks, FluidStack stack, boolean replace, Fluid... replacement) { + boolean replaced = false; + for (int i = 0; i < stacks.length; i++) { + if (GT_Utility.areFluidsEqual(stack, stacks[i])) + if (!replace) + return true; + else { + int amount = stacks[i].amount; + stacks[i] = new FluidStack(replacement[0], amount); + replaced = true; + } + } + return replaced; + } + + private static boolean doStacksCointainAndReplace(Object[] stacks, ItemStack stack, boolean replace, ItemStack... replacement) { + boolean replaced = false; + for (int i = 0; i < stacks.length; i++) { + if (!GT_Utility.isStackValid(stacks[i])) { + if (stacks[i] instanceof ArrayList && ((ArrayList)stacks[i]).size() > 0) { + if (GT_Utility.areStacksEqual(stack, (ItemStack) ((ArrayList)stacks[i]).get(0), true)) + if (!replace) + return true; + else { + int amount = ((ItemStack) ((ArrayList)stacks[i]).get(0)).stackSize; + stacks[i] = new ArrayList<>(); + ((ArrayList)stacks[i]).add(replacement[0].splitStack(amount)); + replaced = true; + } + + } else + continue; + } else if (GT_Utility.areStacksEqual(stack, (ItemStack) stacks[i], true)) + if (!replace) + return true; + else { + int amount = ((ItemStack) stacks[i]).stackSize; + stacks[i] = replacement[0].splitStack(amount); + replaced = true; + } + } + return replaced; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java new file mode 100644 index 0000000000..6427b827f3 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -0,0 +1,570 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.items.GT_Generic_Block; +import gregtech.api.items.GT_Generic_Item; +import gregtech.api.objects.ItemData; +import gregtech.api.objects.MaterialStack; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Block_Ores_Abstract; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.*; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; +import org.apache.commons.lang3.reflect.FieldUtils; + +import java.lang.reflect.Field; +import java.util.*; + +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static gregtech.api.enums.OrePrefixes.*; + +public class PlatinumSludgeOverHaul { + private static final Materials[] BLACKLIST = { + Materials.HSSS, + Materials.EnderiumBase, + Materials.Osmiridium, + Materials.get("Uraniumtriplatinid"), + Materials.get("Tetranaquadahdiindiumhexaplatiumosminid"), + Materials.get("Longasssuperconductornameforuvwire"), + }; + private static final OrePrefixes[] OPBLACKLIST = { + crushedCentrifuged,crushed,crushedPurified,dustPure,dustImpure,dustRefined,dust,dustTiny,dustSmall + }; + + private PlatinumSludgeOverHaul() { + } + + private static void runHelperrecipes() { + //DilutedSulfuricAcid + GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(3), Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, Materials.DilutedSulfuricAcid.getCells(4), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, Materials.SulfuricAcid.getFluid(3000), Materials.DilutedSulfuricAcid.getFluid(4000), Materials.Empty.getCells(1), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(3), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Water.getFluid(1000), Materials.DilutedSulfuricAcid.getFluid(4000), Materials.Empty.getCells(3), 30, 30); + //FormicAcid + GT_Values.RA.addChemicalRecipe(Materials.CarbonMonoxide.getCells(1), Materials.SodiumHydroxide.getDust(1), null, null, Sodiumformate.get(cell), null, 15); + GT_Values.RA.addChemicalRecipe(Sodiumformate.get(cell, 2), GT_Utility.getIntegratedCircuit(1), Materials.SulfuricAcid.getFluid(1000), null, FormicAcid.get(cell, 2), Sodiumsulfate.get(dust, 7), 15); + GT_Values.RA.addChemicalRecipe(Materials.SulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Sodiumformate.getFluidOrGas(2000), FormicAcid.getFluidOrGas(2000), Materials.Empty.getCells(1), Sodiumsulfate.get(dust, 7), 15); + //AquaRegia + GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, AquaRegia.get(cell, 2), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(2), null, null, AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(2), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(3), null, null, Materials.DilutedSulfuricAcid.getFluid(1000), AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(1), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(4), null, null, Materials.NitricAcid.getFluid(1000), AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(1), 30, 30); + + //AmmoniumCloride + GT_Values.RA.addChemicalRecipe(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.HydrochloricAcid.getFluid(1000), null, AmmoniumChloride.get(cell, 1), null, 15); + GT_Values.RA.addChemicalRecipe(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), AmmoniumChloride.getFluidOrGas(1000), Materials.Empty.getCells(1), null, 15); + + //base sollution + for (Werkstoff w : Werkstoff.werkstoffHashSet) + if (w.containsStuff(Materials.Sulfur) && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { + GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); + GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny), 250); + } + for (Materials m : Materials.values()) + if (PlatinumSludgeOverHaul.materialsContains(m, Materials.Sulfur) && (PlatinumSludgeOverHaul.materialsContains(m, Materials.Copper) || PlatinumSludgeOverHaul.materialsContains(m, Materials.Nickel))) { + GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); + GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny), 250); + } + //Pt + GT_Values.RA.addBlastRecipe(PTMetallicPowder.get(dust, 3), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Platinum.getNuggets(2), null, 600, 120, Materials.Platinum.mMeltingPoint); + + GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); + GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2),null, AmmoniumChloride.getFluidOrGas(200), PDAmmonia.getFluidOrGas(200), PTSaltCrude.get(dustTiny, 18), PTRawPowder.get(dustTiny,2), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(200)}, new FluidStack[]{PDAmmonia.getFluidOrGas(200), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2)}, 1200, 30); + GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + }, new int[]{ + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, + }, 600, 30); + GT_Values.RA.addBlastRecipe(PTSaltRefined.get(dust), GT_Utility.getIntegratedCircuit(1), null, Materials.Chlorine.getGas(87), PTMetallicPowder.get(dust), null, 200, 120, 900); + GT_Values.RA.addChemicalRecipe(PTRawPowder.get(dust, 2), Materials.Calcium.getDust(1), null, null, Materials.Platinum.getDust(2), CalciumChloride.get(dust), 30); + //Pd + GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), PDAmmonia.getFluidOrGas(1000), null, 250); + GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dustTiny, 16), PDRawPowder.get(dustTiny, 2), 250); + GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), null, PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dust), 250); + GT_Values.RA.addSifterRecipe(PDSalt.get(dust), new ItemStack[]{ + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + }, new int[]{ + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, + }, 600, 30); + GT_Values.RA.addChemicalRecipeForBasicMachineOnly(PDRawPowder.get(dust, 2), Materials.Empty.getCells(1), FormicAcid.getFluidOrGas(4000), Materials.Ammonia.getGas(2000), Materials.Palladium.getDust(2), Materials.Ethylene.getCells(1), 250, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{PDRawPowder.get(dust, 2)}, new FluidStack[]{FormicAcid.getFluidOrGas(4000)}, new FluidStack[]{Materials.Ammonia.getGas(2000), Materials.Ethylene.getGas(1000), Materials.Water.getFluid(1000)}, new ItemStack[]{Materials.Palladium.getDust(2)}, 250, 30); + GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust, 2), Materials.Hydrogen.getCells(1), null, Materials.SulfuricAcid.getFluid(2000), Materials.Sodium.getDust(1), Materials.Empty.getCells(3), 30); + //K2S2O7 + // GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust,6), null, 30); + //Rh/Os/Ir/Ru + GT_Values.RA.addBlastRecipe(PTResidue.get(dust), GT_Utility.getIntegratedCircuit(11), PotassiumDisulfate.getMolten(1440), RHSulfate.getFluidOrGas(1440), LeachResidue.get(dust), null, 200, 120, 775); + + //Ru + GT_Values.RA.addBlastRecipe(LeachResidue.get(dust, 10), Materials.Saltpeter.getDust(10), Materials.SaltWater.getFluid(1000), GT_ModHandler.getSteam(1000), SodiumRuthenate.get(dust, 3), IrOsLeachResidue.get(dust, 6), 200, 120, 775); + GT_Values.RA.addChemicalRecipe(SodiumRuthenate.get(dust, 6), Materials.Chlorine.getCells(3), null, RutheniumTetroxideSollution.getFluidOrGas(9000), Materials.Empty.getCells(3), 300); + GT_Values.RA.addFluidHeaterRecipe(GT_Utility.getIntegratedCircuit(1), RutheniumTetroxideSollution.getFluidOrGas(800), HotRutheniumTetroxideSollution.getFluidOrGas(800), 300, 480); + GT_Values.RA.addCrackingRecipe(17, RutheniumTetroxideSollution.getFluidOrGas(1000), GT_ModHandler.getSteam(1000), HotRutheniumTetroxideSollution.getFluidOrGas(2000), 150, 480); + GT_Values.RA.addDistillationTowerRecipe(HotRutheniumTetroxideSollution.getFluidOrGas(9000), new FluidStack[]{ + Materials.Water.getFluid(1800), + RutheniumTetroxide.getFluidOrGas(7200) + }, Materials.Salt.getDust(6), 1500, 480); + GT_Values.RA.addChemicalRecipe(RutheniumTetroxide.get(dust, 1), Materials.HydrochloricAcid.getCells(6), null, Materials.Water.getFluid(2000), Ruthenium.get(dust), Materials.Chlorine.getCells(6), 300); + + //Os + GT_Values.RA.addBlastRecipe(IrOsLeachResidue.get(dust, 4), GT_Utility.getIntegratedCircuit(11), Materials.HydrochloricAcid.getFluid(1000), AcidicOsmiumSolution.getFluidOrGas(2000), IrLeachResidue.get(dust, 2), null, 200, 120, 775); + GT_Values.RA.addDistillationTowerRecipe(AcidicOsmiumSolution.getFluidOrGas(1000), new FluidStack[]{OsmiumSolution.getFluidOrGas(100), Materials.Water.getFluid(900)}, null, 150, BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addChemicalRecipe(OsmiumSolution.get(cell), Materials.HydrochloricAcid.getCells(6), null, Materials.Water.getFluid(2000), Materials.Osmium.getDust(1), Materials.Chlorine.getCells(7), 300); + + //Ir + GT_Values.RA.addBlastRecipe(IrLeachResidue.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, PGSDResidue.get(dust), IridiumDioxide.get(dust), 200, 120, 775); + GT_Values.RA.addChemicalRecipe(IridiumDioxide.get(dust), Materials.HydrochloricAcid.getCells(1), null, AcidicIridiumSolution.getFluidOrGas(1000), Materials.Empty.getCells(1), null, 300); + GT_Values.RA.addChemicalRecipe(AcidicIridiumSolution.get(cell), AmmoniumChloride.get(cell, 3), null, Materials.Ammonia.getGas(3000), Materials.Empty.getCells(4), IridiumChloride.get(dust), 300); + GT_Values.RA.addChemicalRecipe(IridiumChloride.get(dust), Materials.Calcium.getDust(3), null, CalciumChloride.getFluidOrGas(3000), PGSDResidue2.get(dust), Materials.Iridium.getDust(1), 300, 1920); + + //Rh + GT_Values.RA.addChemicalRecipe(RHSulfate.get(cell, 11), GT_Utility.getIntegratedCircuit(1), Materials.Water.getFluid(10000), Materials.Potassium.getMolten(2000), RHSulfateSolution.get(cell, 11), LeachResidue.get(dustTiny, 10), 300, 30); + + GT_Values.RA.addChemicalRecipe(Materials.Zinc.getDust(1), null, RHSulfateSolution.getFluidOrGas(1000), null, ZincSulfate.get(dust), CrudeRhMetall.get(dust), 300); + GT_Values.RA.addBlastRecipe(CrudeRhMetall.get(dust), Materials.Salt.getDust(1), Materials.Chlorine.getGas(1000), null, RHSalt.get(dust, 3), null, 300, 120, 600); + GT_Values.RA.addMixerRecipe(RHSalt.get(dust, 10), null, null, null, Materials.Water.getFluid(2000), RHSaltSolution.getFluidOrGas(2000), null, 300, 30); + GT_Values.RA.addChemicalRecipe(SodiumNitrate.get(dust), GT_Utility.getIntegratedCircuit(1), RHSaltSolution.getFluidOrGas(1000), null, RHNitrate.get(dust), Materials.Salt.getDust(1), 300); + GT_Values.RA.addSifterRecipe(RHNitrate.get(dust), new ItemStack[]{ + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + }, new int[]{ + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, + }, 600, 30); + GT_Values.RA.addMixerRecipe(RhFilterCake.get(dust), null, null, null, Materials.Water.getFluid(1000), RHFilterCakeSolution.getFluidOrGas(1000), null, 300, 30); + GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), null, RHFilterCakeSolution.getFluidOrGas(1000), null, ReRh.get(dust), null, 300); + GT_Values.RA.addChemicalRecipe(ReRh.get(dust), Materials.Empty.getCells(1), Materials.HydrochloricAcid.getFluid(1000), Materials.Chlorine.getGas(1000), Rhodium.get(dust), Materials.Ammonia.getCells(1), 300); + } + + private static boolean materialsContains(Materials one, ISubTagContainer other) { + if (one == null || one.mMaterialList == null || one.mMaterialList.isEmpty()) + return false; + for (MaterialStack stack : one.mMaterialList) + if (stack.mMaterial.equals(other)) + return true; + return false; + } + + public static void replacePureElements() { + //furnace + for (Object entry : FurnaceRecipes.smelting().getSmeltingList().entrySet()) { + Map.Entry realEntry = (Map.Entry) entry; + if (GT_Utility.isStackValid(realEntry.getKey()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getKey())) + if ((!GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dust) && !GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dustTiny)) || !GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mMaterial.mMaterial.equals(Materials.Platinum)) + if (GT_Utility.isStackValid(realEntry.getValue()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())){ + ItemData ass = GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()); + if (ass.mMaterial.mMaterial.equals(Materials.Platinum)) + if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) + realEntry.setValue(PTMetallicPowder.get(ass.mPrefix == nugget ? dustTiny : dust, ((ItemStack) realEntry.getValue()).stackSize * 2)); + else if (ass.mMaterial.mMaterial.equals(Materials.Palladium)) + if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) + realEntry.setValue(PDMetallicPowder.get(ass.mPrefix == nugget ? dustTiny : dust, ((ItemStack) realEntry.getValue()).stackSize * 2)); + } + } + //vanilla crafting + CraftingManager.getInstance().getRecipeList().forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); + //gt crafting + try { + ((List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null)).forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + //gt machines + maploop: + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + if (map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes) + continue; + HashSet toDel = new HashSet(); + recipeloop: + for (GT_Recipe recipe : map.mRecipeList) { + if (recipe.mFakeRecipe) + continue maploop; + + for (int i = 0; i < recipe.mFluidOutputs.length; i++) { + if (map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes)) + continue maploop; + else if (map.equals(GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sChemicalRecipes)) { + if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) + recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); + else if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) + recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); + else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) + recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); + } else { + if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + } + } + for (int i = 0; i < recipe.mOutputs.length; i++) { + if (!GT_Utility.isStackValid(recipe.mOutputs[i])) + continue; + if (BW_Util.areStacksEqualOrNull(Ruthenium.get(dust), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustImpure), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustPure), recipe.mOutputs[i])) { + if (!BW_Util.areStacksEqualOrNull(Ruthenium.get(ingot), recipe.mInputs[0])) { + for (int j = 0; j < recipe.mInputs.length; j++) + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + int amount = recipe.mOutputs[i].stackSize * 2; + recipe.mOutputs[i] = LeachResidue.get(dust, amount); + } + } + if (BW_Util.areStacksEqualOrNull(Rhodium.get(dust), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Rhodium.get(dustImpure), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Rhodium.get(dustPure), recipe.mOutputs[i])) { + if (!BW_Util.areStacksEqualOrNull(Rhodium.get(ingot), recipe.mInputs[0])) { + for (int j = 0; j < recipe.mInputs.length; j++) + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + int amount = recipe.mOutputs[i].stackSize * 2; + recipe.mOutputs[i] = CrudeRhMetall.get(dust, amount); + } + } + if (!BW_Util.checkStackAndPrefix(recipe.mOutputs[i])) + continue; + //Pt + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Platinum)) { + for (int j = 0; j < recipe.mInputs.length; j++) { + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + } + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount * 2); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PTMetallicPowder.get(dustSmall).splitStack(amount * 2); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 2); + } + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Palladium)) { + for (int j = 0; j < recipe.mInputs.length; j++) { + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + } + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PDMetallicPowder.get(dust).splitStack(amount * 2); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PDMetallicPowder.get(dustSmall).splitStack(amount * 2); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = PDMetallicPowder.get(dustTiny).splitStack(amount * 2); + } + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Osmium)) { + for (int j = 0; j < recipe.mInputs.length; j++) { + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + } + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrOsLeachResidue.get(dust).splitStack(amount); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrOsLeachResidue.get(dustSmall).splitStack(amount); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount); + } + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Iridium)) { + for (int j = 0; j < recipe.mInputs.length; j++) { + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + } + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrLeachResidue.get(dust).splitStack(amount); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrLeachResidue.get(dustSmall).splitStack(amount); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = IrLeachResidue.get(dustTiny).splitStack(amount); + } + } + } + } + map.mRecipeList.removeAll(toDel); + } + //TODO: remove EnderIO recipes + + //fix HV tier + PlatinumSludgeOverHaul.replaceHVCircuitMaterials(); + //add new recipes + PlatinumSludgeOverHaul.runHelperrecipes(); + } + + private static void replaceHVCircuitMaterials(){ + GT_Values.RA.addMixerRecipe(Materials.Redstone.getDust(1),Materials.Electrum.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,Materials.Nikolite.getDust(8),1800,120); + for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList){ + if (recipe.mEUt > 512) + continue; + if (BW_Util.checkStackAndPrefix(recipe.mOutputs[0])) { + for (int i = 0; i < recipe.mInputs.length; i++) { + ItemStack stack = recipe.mInputs[i]; + ItemData ass = GT_OreDictUnificator.getAssociation(stack); + if (BW_Util.checkStackAndPrefix(stack) && ass.mMaterial.mMaterial.equals(Materials.Platinum)) { + recipe.mInputs[i] = GT_OreDictUnificator.get(ass.mPrefix,Materials.BlueAlloy,stack.stackSize); + } + } + } + } + } + + private static void setnewMaterialInRecipe(Object obj) { + String inputName = "output"; + String inputItemName = "input"; + if (!(obj instanceof ShapedOreRecipe || obj instanceof ShapelessOreRecipe)){ + if (obj instanceof ShapedRecipes || (obj instanceof ShapelessRecipes)) { + inputName = "recipeOutput"; + inputItemName = "recipeItems"; + } + else if (Loader.isModLoaded("miscutils")) { + try { + if (Class.forName("gtPlusPlus.api.objects.minecraft.ShapedRecipe").isAssignableFrom(obj.getClass())) + obj = FieldUtils.getField(obj.getClass(),"mRecipe",true).get(obj); + } catch (ClassNotFoundException | IllegalAccessException e) { + e.printStackTrace(); + } + } + } + + IRecipe recipe = (IRecipe) obj; + ItemStack otpt = recipe.getRecipeOutput(); + + Field out = FieldUtils.getDeclaredField(recipe.getClass(), inputName, true); + if (out == null) + out = FieldUtils.getField(recipe.getClass(), inputName, true); + + + Field in = FieldUtils.getDeclaredField(recipe.getClass(), inputItemName, true); + if (in == null) + in = FieldUtils.getField(recipe.getClass(), inputItemName, true); + if (in == null) + return; + FieldUtils.removeFinalModifier(in,true); + Object input = null; + try { + input = in.get(obj); + } catch (IllegalAccessException e) { + e.printStackTrace(); + return; + } + assert input != null; + + if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Platinum.getDust(1), true)) { + if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Platinum)) + return; + try { + out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize * 2)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Palladium.getDust(1), true)) { + if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Palladium)) + return; + try { + out.set(recipe, PDMetallicPowder.get(dust, otpt.stackSize * 2)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Iridium.getDust(1), true)) { + if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Iridium)) + return; + try { + out.set(recipe, IrLeachResidue.get(dust, otpt.stackSize)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Osmium.getDust(1), true)) { + if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Osmium)) + return; + try { + out.set(recipe, IrOsLeachResidue.get(dust, otpt.stackSize)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + } + + private static boolean checkRecipe(Object input,Materials mat){ + if (input instanceof List || input instanceof Object[]) { + Set lists = new HashSet(), stacks= new HashSet(); + List ip = input instanceof List ? (List)input : new ArrayList(); + Object[] ip2 = input instanceof Object[] ? (Object[])input : new Object[0]; + + for (Object o : ip){ + if (o instanceof List) + lists.add(o); + else if (o instanceof ItemStack) + stacks.add(o); + } + for (Object o : ip2){ + if (o instanceof List) + lists.add(o); + else if (o instanceof ItemStack) + stacks.add(o); + } + + for (Object o : lists) { + if (!((List) o).isEmpty()) + stacks.add(((List) o).get(0)); + } + + for (Object stack : stacks) { + if (stack instanceof ItemStack) { + if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(crateGtDust, mat, 1), (ItemStack) stack)) + return true; + } + } + + boolean allSame = false; + for (Object stack : stacks) { + if (stack instanceof ItemStack) { + allSame = BW_Util.checkStackAndPrefix((ItemStack) stack) && GT_OreDictUnificator.getAssociation((ItemStack) stack).mMaterial.mMaterial.equals(mat); + } else { + allSame = false; + break; + } + if (!allSame) + break; + } + return allSame; + } + return false; + } + + private static boolean isInBlackList(ItemStack stack) { + if (stack == null) + return true; + + if (stack.getItem() instanceof BW_MetaGenerated_Items) + return true; + + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(MainMod.MOD_ID)) + return true; + + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(BartWorksCrossmod.MOD_ID)) + return true; + + if (Block.getBlockFromItem(stack.getItem()) instanceof GT_Generic_Block && !(Block.getBlockFromItem(stack.getItem()) instanceof GT_Block_Ores_Abstract)) + return true; + + if (GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_1.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_2.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_4.get(1),stack,true)) + return true; + + + if (GT_Utility.areStacksEqual(ItemList.Tool_Lighter_Platinum_Empty.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Tool_Lighter_Platinum_Used.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Tool_Lighter_Platinum_Full.get(1),stack,true)) + return true; + + if (GT_Utility.areStacksEqual(ItemList.Emitter_EV.get(1),stack,true)) + return true; + + try { + ItemList gtnhItemListItems = ItemList.valueOf("Large_Fluid_Cell_TungstenSteel"); + if (GT_Utility.areStacksEqual(gtnhItemListItems.get(1), stack, true)) + return true; + gtnhItemListItems = ItemList.valueOf("Depleted_MNq_1"); + if (GT_Utility.areStacksEqual(gtnhItemListItems.get(1), stack, true)) + return true; + gtnhItemListItems = ItemList.valueOf("Depleted_MNq_2"); + if (GT_Utility.areStacksEqual(gtnhItemListItems.get(1), stack, true)) + return true; + gtnhItemListItems = ItemList.valueOf("Depleted_MNq_4"); + if (GT_Utility.areStacksEqual(gtnhItemListItems.get(1), stack, true)) + return true; + } catch (IllegalArgumentException ignored) {} + + if (stack.getItem() instanceof GT_Generic_Item) { + if (!BW_Util.checkStackAndPrefix(stack)) + return false; + return (!Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mPrefix)) || Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); + } + + if (Loader.isModLoaded("miscutils")) { + try { + if (Class.forName("gtPlusPlus.core.item.base.BaseItemComponent").isAssignableFrom(stack.getItem().getClass()) && !(stack.getUnlocalizedName().contains("dust") || stack.getUnlocalizedName().contains("Dust"))) + return true; + if (Class.forName("gtPlusPlus.core.block.base.BlockBaseModular").isAssignableFrom(Block.getBlockFromItem(stack.getItem()).getClass())) + return true; + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + } + + if (!BW_Util.checkStackAndPrefix(stack)) + return false; + + return Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 7be1117d4c..ac1d96bc9b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MurmurHash3; import com.github.bartimaeusnek.bartworks.util.Pair; +import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import gregtech.api.enums.*; import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.interfaces.ISubTagContainer; @@ -33,11 +34,10 @@ import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import java.lang.reflect.InvocationTargetException; import java.nio.ByteBuffer; import java.util.*; -import static gregtech.api.enums.OrePrefixes.capsule; - public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static final LinkedHashSet werkstoffHashSet = new LinkedHashSet<>(); @@ -76,9 +76,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.default_null_Werkstoff = new Werkstoff(new short[3], "_NULL", "Default null Werkstoff", Werkstoff.DEFAULT_NULL_STATS, Werkstoff.Types.UNDEFINED, Werkstoff.DEFAULT_NULL_GENERATION_FEATURES, -1, TextureSet.SET_NONE); } + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type,int meltingpoint, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { + this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), type, generationFeatures, mID, texSet, contents); + } public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, contents); } + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { + this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), type, generationFeatures, mID, texSet, oreByProduct, contents); + } public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents); } @@ -144,6 +150,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } } else this.toolTip = toolTip; + +// if (this.toolTip.length() > 25) +// this.toolTip = "The formula is to long..."; + if (this.stats.protons == 0) { long tmpprotons = 0; for (Pair p : contents) { @@ -166,6 +176,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } this.stats = stats.setMass(tmpmass); } + + if (this.stats.meltingPoint == 0) + this.stats.meltingPoint = 1123; + this.texSet = texSet; if (this.mOreByProducts.isEmpty()) { @@ -204,6 +218,19 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return ret; } + public List getGTWrappedTCAspects() { + List ret = new ArrayList<>(); + try { + Pair[] aspectArray = getTCAspects(); + TC_Aspects.TC_AspectStack stack = null; + for (Pair objectIntegerPair : aspectArray) { + stack = new TC_Aspects.TC_AspectStack(TC_Aspects.valueOf(((String) ThaumcraftHandler.AspectAdder.getName.invoke(objectIntegerPair.getKey())).toUpperCase(Locale.US)) , objectIntegerPair.getValue()); + stack.addToAspectList(ret); + } + }catch( InvocationTargetException | IllegalAccessException ignored){} + return ret; + } + public Pair[] getTCAspects(){ return this.getTCAspects(1); } @@ -224,6 +251,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { int ret = 0; switch (this.type) { case COMPOUND: + case MIXTURE: case BIOLOGICAL: { for (int i = 0; i < this.CONTENTS.toArray().length; i++) { ret += ((Pair) this.CONTENTS.toArray()[i]).getValue(); @@ -275,6 +303,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.defaultName; } + public String getVarName() { + return this.defaultName.replaceAll(" ",""); + } + public String getToolTip() { return this.toolTip; } @@ -344,6 +376,21 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return WerkstoffLoader.getCorrespondingItemStack(prefixes, this, amount); } + public byte getToolQuality() { + return (byte) ( (15f * (((float)this.getStats().getProtons() / 188f) + (float) this.getStats().getMeltingPoint() / 10801f)) / (float) this.getContents().getKey() ); + } + + public float getToolSpeed() { + return this.stats.speedOverride > 0f ? this.stats.speedOverride : Math.max(1f, + 2f*((float) -this.getStats().getMass() + 0.1f * (float) this.getStats().getMeltingPoint() + (float) this.getStats().getProtons()) * 0.1f / (float) this.getContents().getKey() * 0.1f * (float) this.getToolQuality() + ); + } + + public int getDurability() { + return this.stats.durOverride > 0 ? this.stats.durOverride : (int) (this.stats.durMod * ((0.01f * (float) this.getStats().getMeltingPoint() * (float) this.getStats().getMass()) / (float) this.getContents().getKey())); + } + + public enum Types { MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, ELEMENT, ISOTOPE, UNDEFINED; @@ -412,6 +459,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plate,0b10000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stick,0b10000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rod,0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadHammer,0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadWrench,0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadSaw,0b10000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gearGt,0b100000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gearGtSmall,0b100000000); @@ -598,11 +648,48 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } + public int getDurOverride() { + return durOverride; + } + + public void setDurOverride(int durOverride) { + this.durOverride = durOverride; + } + + public float getSpeedOverride() { + return speedOverride; + } + + public void setSpeedOverride(float speedOverride) { + this.speedOverride = speedOverride; + } + + public float getTierOverride() { + return tierOverride; + } + + public void setTierOverride(float tierOverride) { + this.tierOverride = tierOverride; + } + int meltingPoint; long protons; long neutrons; long electrons; long mass; + int durOverride; + float speedOverride; + float tierOverride; + float durMod = 1f; + + public float getDurMod() { + return durMod; + } + + public void setDurMod(float durMod) { + this.durMod = durMod; + } + private Pair[] mTC_Aspects; //logic gate shit byte quality = ~0b1111111; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 4e1011eb29..9158de5a89 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -51,6 +51,7 @@ import gregtech.api.objects.GT_MultiTexture; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.*; import gregtech.common.GT_Proxy; +import gregtech.common.items.GT_MetaGenerated_Tool_01; import gregtech.common.items.behaviors.Behaviour_DataOrb; import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputOreDict; @@ -58,6 +59,7 @@ import ic2.api.recipe.RecipeOutput; import ic2.api.recipe.Recipes; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fluids.Fluid; @@ -90,8 +92,12 @@ public class WerkstoffLoader implements Runnable { public static ItemList smallGearShape; public static ItemList ringMold; public static ItemList boltMold; - + public static boolean gtnhGT = false; static { + try { + gtnhGT = GT_MetaGenerated_Tool_01.class.getField("SOLDERING_IRON_MV") != null; + } catch (NoSuchFieldException ignored) {} + for (OrePrefixes prefix : OrePrefixes.values()){ if (prefix.toString().equals("cellMolten")) WerkstoffLoader.cellMolten = prefix; @@ -108,7 +114,7 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.smallGearShape = Enum.valueOf(ItemList.class, "Shape_Extruder_Small_Gear"); WerkstoffLoader.ringMold = Enum.valueOf(ItemList.class, "Shape_Mold_Ring"); WerkstoffLoader.boltMold = Enum.valueOf(ItemList.class, "Shape_Mold_Bolt"); - } catch (NullPointerException | IllegalArgumentException e){} + } catch (NullPointerException | IllegalArgumentException ignored){} //add tiberium Element t = EnumHelper.addEnum(Element.class,"Tr",new Class[]{long.class, long.class, long.class, long.class, String.class, String.class, boolean.class}, new Object[]{123L, 203L, 0L, -1L, (String) null, "Tiberium", false}); //add molten & regular capsuls @@ -148,7 +154,7 @@ public class WerkstoffLoader implements Runnable { new short[]{175, 175, 175, 0}, "Zirconium", "Zr", - new Werkstoff.Stats().setProtons(40), + new Werkstoff.Stats().setProtons(40).setMeltingPoint(2130), Werkstoff.Types.ELEMENT, new Werkstoff.GenerationFeatures().onlyDust(), 3, @@ -159,6 +165,7 @@ public class WerkstoffLoader implements Runnable { new short[]{255, 255, 255, 0}, "Cubic Zirconia", Werkstoff.Types.COMPOUND, + 3273, new Werkstoff.GenerationFeatures().onlyDust().addGems(), 4, TextureSet.SET_DIAMOND, @@ -355,7 +362,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff RedZircon = new Werkstoff( new short[]{195, 19, 19, 0}, "Red Zircon", - new Werkstoff.Stats().setElektrolysis(true), + new Werkstoff.Stats().setElektrolysis(true).setMeltingPoint(2130), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 19, @@ -566,7 +573,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff Prasiolite = new Werkstoff( new short[]{0xD0,0xDD,0x95,0}, "Prasiolite", - new Werkstoff.Stats().setElektrolysis(true), + new Werkstoff.Stats().setElektrolysis(true).setMeltingPoint(1923), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 35, @@ -1214,7 +1221,7 @@ public class WerkstoffLoader implements Runnable { 89, TextureSet.SET_DIAMOND ); - public static final Werkstoff LuVFineWireMaterial = new Werkstoff( + public static final Werkstoff Ruridit = new Werkstoff( new short[]{0xA4,0xA4,0xA4}, "Ruridit", new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500), @@ -1236,20 +1243,21 @@ public class WerkstoffLoader implements Runnable { new Pair<>(Materials.Calcium,1), new Pair<>(Materials.Fluorine,2) ); -// public static final Werkstoff Baryte = new Werkstoff( -// new short[]{0xB9,0x45,0xFB}, -// "Baryte", -// new Werkstoff.Stats().setElektrolysis(true), -// Werkstoff.Types.COMPOUND, -// new Werkstoff.GenerationFeatures().addGems(), -// 92, -// TextureSet.SET_GEM_VERTICAL, -// new Pair<>(Materials.Barium,1), -// new Pair<>(Materials.Sulfur,1), -// new Pair<>(Materials.Oxygen,3) -// ); - - + public static final Werkstoff HDCS = new Werkstoff( + new short[]{0x33,0x44,0x33}, + "High Durability Compound Steel", + new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(9000), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), + 92, + TextureSet.SET_SHINY, + new Pair<>(Materials.TungstenSteel,12), + new Pair<>(Materials.HSSE,9), + new Pair<>(Materials.HSSG,6), + new Pair<>(WerkstoffLoader.Ruridit,3), + new Pair<>(WerkstoffLoader.MagnetoResonaticDust,2), + new Pair<>(Materials.Plutonium,1) + ); public static HashMap items = new HashMap<>(); public static HashBiMap fluids = HashBiMap.create(); @@ -1336,6 +1344,8 @@ public class WerkstoffLoader implements Runnable { this.addCraftingMetalRecipes(werkstoff); DebugLog.log("Loading MultipleIngots MetalWorking Recipes"+" " +(System.nanoTime()-timepreone)); this.addMultipleMetalRecipes(werkstoff); + DebugLog.log("Loading Tool Recipes"+" " +(System.nanoTime()-timepreone)); + this.addTools(werkstoff); if (Loader.isModLoaded("Thaumcraft")) { DebugLog.log("Loading Aspects"+" " +(System.nanoTime()-timepreone)); ThaumcraftHandler.AspectAdder.addAspectToAll(werkstoff); @@ -1355,6 +1365,10 @@ public class WerkstoffLoader implements Runnable { } private void addSubTags() { + + WerkstoffLoader.CubicZirconia.getStats().setDurOverride(Materials.Diamond.mDurability); + WerkstoffLoader.HDCS.getStats().setSpeedOverride(Materials.HSSS.mToolSpeed); + WerkstoffLoader.HDCS.getStats().setDurMod(10f); Materials.Helium.add(WerkstoffLoader.NOBLE_GAS); WerkstoffLoader.Neon.add(WerkstoffLoader.NOBLE_GAS); Materials.Argon.add(WerkstoffLoader.NOBLE_GAS); @@ -1368,13 +1382,28 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.Calcium.add(WerkstoffLoader.ANAEROBE_SMELTING); WerkstoffLoader.LuVTierMaterial.add(WerkstoffLoader.NOBLE_GAS_SMELTING); - WerkstoffLoader.LuVFineWireMaterial.add(WerkstoffLoader.NOBLE_GAS_SMELTING); + WerkstoffLoader.Ruridit.add(WerkstoffLoader.NOBLE_GAS_SMELTING); WerkstoffLoader.MagnetoResonaticDust.add(WerkstoffLoader.NO_BLAST); //Calcium Smelting block Materials.Calcium.mBlastFurnaceRequired=true; + Materials.Salt.mDurability = WerkstoffLoader.Salt.getDurability(); + Materials.Spodumene.mDurability = WerkstoffLoader.Spodumen.getDurability(); + Materials.RockSalt.mDurability = WerkstoffLoader.RockSalt.getDurability(); + Materials.Calcium.mDurability = WerkstoffLoader.Calcium.getDurability(); + + Materials.Salt.mToolSpeed = WerkstoffLoader.Salt.getToolSpeed(); + Materials.Spodumene.mToolSpeed = WerkstoffLoader.Spodumen.getToolSpeed(); + Materials.RockSalt.mToolSpeed = WerkstoffLoader.RockSalt.getToolSpeed(); + Materials.Calcium.mToolSpeed = WerkstoffLoader.Calcium.getToolSpeed(); + + Materials.Salt.mToolQuality = WerkstoffLoader.Salt.getToolQuality(); + Materials.Spodumene.mToolQuality = WerkstoffLoader.Spodumen.getToolQuality(); + Materials.RockSalt.mToolQuality = WerkstoffLoader.RockSalt.getToolQuality(); + Materials.Calcium.mToolQuality = WerkstoffLoader.Calcium.getToolQuality(); + for (Werkstoff W : Werkstoff.werkstoffHashMap.values()) { for (Pair pair : W.getContents().getValue().toArray(new Pair[0])) { @@ -1477,6 +1506,9 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.items.put(plate, new BW_MetaGenerated_Items(plate)); WerkstoffLoader.items.put(stick, new BW_MetaGenerated_Items(stick)); WerkstoffLoader.items.put(stickLong, new BW_MetaGenerated_Items(stickLong)); + WerkstoffLoader.items.put(toolHeadWrench, new BW_MetaGenerated_Items(toolHeadWrench)); + WerkstoffLoader.items.put(toolHeadHammer, new BW_MetaGenerated_Items(toolHeadHammer)); + WerkstoffLoader.items.put(toolHeadSaw, new BW_MetaGenerated_Items(toolHeadSaw)); } if ((WerkstoffLoader.toGenerateGlobal & 0b100000000) != 0) { WerkstoffLoader.items.put(gearGt, new BW_MetaGenerated_Items(gearGt)); @@ -1515,7 +1547,9 @@ public class WerkstoffLoader implements Runnable { private static void runGTItemDataRegistrator() { HashSet toRem = new HashSet<>(); for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getDefaultName()) != Materials._NULL ? Materials.get(werkstoff.getDefaultName()) : new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName()); + //int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, String aConfigSection, boolean aCustomOre, String aCustomID + Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : + new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(),0, werkstoff.getRGBA()[0],werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName(),0,0,werkstoff.getStats().meltingPoint,werkstoff.getStats().meltingPoint,werkstoff.getStats().isBlastFurnace(),false,0,1,1,null); for (OrePrefixes prefixes : values()) { if (!(prefixes == cell && werkstoff.getType().equals(Werkstoff.Types.ELEMENT))) { if (prefixes == dust && werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { @@ -1525,7 +1559,8 @@ public class WerkstoffLoader implements Runnable { if (e.toString().equals(werkstoff.getToolTip())) { if (e.mLinkedMaterials.size() > 0) break; - werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getDefaultName()) != Materials._NULL ? Materials.get(werkstoff.getDefaultName()) : new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName()); + werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : + new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(),0, werkstoff.getRGBA()[0],werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName(),0,0,werkstoff.getStats().meltingPoint,werkstoff.getStats().meltingPoint,werkstoff.getStats().isBlastFurnace(),false,0,1,1,null); werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials = new ArrayList<>(); e.mLinkedMaterials.add(werkstoffBridgeMaterial); @@ -1539,14 +1574,14 @@ public class WerkstoffLoader implements Runnable { } if (!ElementSet) continue; - try { - Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); - f.setAccessible(true); - Map MATERIALS_MAP = (Map) f.get(null); - MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); - } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { - e.printStackTrace(); - } +// try { +// Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); +// f.setAccessible(true); +// Map MATERIALS_MAP = (Map) f.get(null); +// MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); +// } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { +// e.printStackTrace(); +// } if (((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) == 0 && werkstoff.get(dust) != null && werkstoff.get(dust).getItem() != null)) { ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); @@ -1566,7 +1601,16 @@ public class WerkstoffLoader implements Runnable { if (werkstoff.getGenerationFeatures().hasMolten()) { werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid(); } - werkstoffBridgeMaterial.mName = werkstoff.getDefaultName(); + werkstoffBridgeMaterial.mName = werkstoff.getVarName(); + werkstoffBridgeMaterial.mDefaultLocalName = werkstoff.getDefaultName(); + try { + Field f = Materials.class.getField("mLocalizedName"); + f.set(werkstoffBridgeMaterial, werkstoff.getDefaultName()); + } catch (NoSuchFieldException | IllegalAccessException ignored){} + werkstoffBridgeMaterial.mChemicalFormula = werkstoff.getToolTip(); + werkstoffBridgeMaterial.mAspects=werkstoff.getGTWrappedTCAspects(); + werkstoffBridgeMaterial.mMaterialInto = werkstoffBridgeMaterial; + werkstoffBridgeMaterial.mHandleMaterial = werkstoff.contains(SubTag.BURNING) ? Materials.Blaze : werkstoff.contains(SubTag.MAGICAL) ? Materials.Thaumium : werkstoffBridgeMaterial.mDurability > 5120 ? Materials.TungstenSteel : werkstoffBridgeMaterial.mDurability > 1280 ? Materials.Steel : Materials.Wood; toRem.add(werkstoffBridgeMaterial); werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); if (WerkstoffLoader.items.get(prefixes) != null) @@ -1575,15 +1619,79 @@ public class WerkstoffLoader implements Runnable { } } } - try { - Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); - f.setAccessible(true); - Map MATERIALS_MAP = (Map) f.get(null); - for (Materials o : toRem) - MATERIALS_MAP.remove(o.mName); - } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { - e.printStackTrace(); +// try { +// Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); +// f.setAccessible(true); +// Map MATERIALS_MAP = (Map) f.get(null); +// for (Materials o : toRem) +// MATERIALS_MAP.remove(o.mName); +// } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { +// e.printStackTrace(); +// } + } + + private void addTools(Werkstoff werkstoff){ + if (werkstoff.getBridgeMaterial().mDurability == 0) + return; + + if (werkstoff.getGenerationFeatures().hasGems()){ + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', OrePrefixes.gem.get(werkstoff.getBridgeMaterial()), 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"GGf", 'G', OrePrefixes.gem.get(werkstoff.getBridgeMaterial())}); + } + + if (!werkstoff.getGenerationFeatures().hasSimpleMetalWorkingItems()) + return; + + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.PLUNGER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"xRR", " SR", "S f", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'R', OrePrefixes.plate.get(Materials.AnyRubber)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', OrePrefixes.ingot.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"hDS", "DSD", "SDf", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'D', Dyes.dyeBlue}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{" fS", " Sh", "W ", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'W', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WIRECUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "hPd", "STS", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'T', OrePrefixes.screw.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCOOP, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SWS", "SSS", "xSh", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'W', new ItemStack(Blocks.wool, 1, 32767)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BRANCHCUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "PdP", "STS", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'T', OrePrefixes.screw.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.KNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"fPh", " S ", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PPf", "PP ", "Sh ", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', OrePrefixes.bolt.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(Materials.AnyRubber), 'S', OrePrefixes.stick.get(Materials.Iron), 'L', ItemList.Battery_RE_LV_Lithium.get(1L)}); + if (gtnhGT) { + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(162, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', OrePrefixes.bolt.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(Materials.AnyRubber), 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_MV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(164, 1, werkstoff.getBridgeMaterial(), Materials.StyreneButadieneRubber, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', OrePrefixes.bolt.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(Materials.StyreneButadieneRubber), 'S', OrePrefixes.stick.get(Materials.StainlessSteel), 'L', ItemList.Battery_RE_HV_Lithium.get(1L)}); } + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{ 800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); + + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); + if (gtnhGT) { + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{ 800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); + } + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"II ", "IIh", "II ", 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'I', OrePrefixes.ingot.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadWrench, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"hXW", "XRX", "WXd", 'X', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'S', OrePrefixes.plate.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'R', OrePrefixes.ring.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'W', OrePrefixes.screw.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + + GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{toolHeadHammer.get(werkstoff.getBridgeMaterial()), OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + + if (!werkstoff.getGenerationFeatures().hasGems()) { + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', OrePrefixes.ingot.get(werkstoff.getBridgeMaterial()), 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"PP ", "fh ", 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'I', OrePrefixes.ingot.get(werkstoff.getBridgeMaterial())}); + } + + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.FILE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P", "P", "S", 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + + GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SAW, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), new Object[]{toolHeadSaw.get(werkstoff.getBridgeMaterial()), OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + + // GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(16,1, werkstoff.getBridgeMaterial(),werkstoff.getBridgeMaterial(),null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', werkstoff.get(OrePrefixes.ingot)}); } public static void removeIC2Recipes() { @@ -1706,6 +1814,7 @@ public class WerkstoffLoader implements Runnable { GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)}); GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(ingot)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(plate), GT_Proxy.tBits, new Object[]{"h", "X", "X", 'X', werkstoff.get(ingot)}); GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{werkstoff.get(ingot),GT_Utility.getIntegratedCircuit(1)},new ItemStack[]{werkstoff.get(plate)},null,null,null,null, (int) Math.max(werkstoff.getStats().getMass(), 1L), 24,0)); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ingot,3), werkstoff.get(plate,2), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); @@ -2133,14 +2242,14 @@ public class WerkstoffLoader implements Runnable { return; GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),false); - try { - Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); - f.setAccessible(true); - Map MATERIALS_MAP = (Map) f.get(null); - MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); - } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { - e.printStackTrace(); - } +// try { +// Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); +// f.setAccessible(true); +// Map MATERIALS_MAP = (Map) f.get(null); +// MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); +// } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { +// e.printStackTrace(); +// } ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput,werkstoff.getToolTip()); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 353493bb70..e657a5af83 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; +import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.LuVTierEnhancer; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java deleted file mode 100644 index 85f800d77c..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LuVTierEnhancer.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; - -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import cpw.mods.fml.common.Loader; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.objects.ItemData; -import gregtech.api.util.*; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import org.apache.commons.lang3.reflect.FieldUtils; -import org.apache.commons.lang3.reflect.MethodUtils; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; - -import static gregtech.api.enums.OrePrefixes.*; - -public class LuVTierEnhancer implements Runnable { - - public void run() { - LuVTierEnhancer.replaceAsslineRecipes(); - List bufferedRecipeList = null; - try { - bufferedRecipeList = (List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - assert bufferedRecipeList != null; - - HashSet LuVMachines = new HashSet<>(); - OrePrefixes[] LuVMaterialsGenerated = {dust, ingot, plate, stick, stickLong, rotor, plateDouble, plateDense}; - for (ItemList item : ItemList.values()) { - if (item.toString().contains("LuV") && item.hasBeenSet()) - LuVMachines.add(item.get(1)); - } - if (Loader.isModLoaded("dreamcraft")) { - try { - Class customItemListClass = Class.forName("com.dreammaster.gthandler.CustomItemList"); - Method hasnotBeenSet = MethodUtils.getAccessibleMethod(customItemListClass, "hasBeenSet"); - Method get = MethodUtils.getAccessibleMethod(customItemListClass, "get", long.class, Object[].class); - for (Enum customItemList : (Enum[]) FieldUtils.getField(customItemListClass, "$VALUES", true).get(null)) { - if (customItemList.toString().contains("LuV") && (boolean) hasnotBeenSet.invoke(customItemList)) - LuVMachines.add((ItemStack) get.invoke(customItemList, 1, new Object[0])); - } - } catch (IllegalAccessException | ClassNotFoundException | InvocationTargetException e) { - e.printStackTrace(); - } - } - GT_ModHandler.addCraftingRecipe(ItemList.Casing_LuV.get(1), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, new Object[]{"PPP", "PwP", "PPP", 'P', WerkstoffLoader.LuVTierMaterial.get(plate)}); - for (ItemStack stack : LuVMachines) { - for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - for (GT_Recipe recipe : map.mRecipeList) { - for (OrePrefixes prefixes : LuVMaterialsGenerated) { - if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } - if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } - } - if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - } - if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - } - } - } - for (OrePrefixes prefixes : LuVMaterialsGenerated) { - for (Object obj : CraftingManager.getInstance().getRecipeList()) { - if (!(obj instanceof GT_Shaped_Recipe)) - continue; - if (GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true)) { - LuVTierEnhancer.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(), GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } - } - for (Object obj : bufferedRecipeList) { - if (!(obj instanceof GT_Shaped_Recipe)) - continue; - if (GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true)) { - LuVTierEnhancer.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(), GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } - } - } - } - new AfterLuVTierEnhacement().run(); - } - - private static void replaceAsslineRecipes(){ - for (GT_Recipe.GT_Recipe_AssemblyLine recipe_assemblyLine : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){ - if (recipe_assemblyLine.mEUt > 6000) - continue; - for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) { - ItemStack stack = recipe_assemblyLine.mInputs[i]; - if (!BW_Util.checkStackAndPrefix(stack)) - continue; - ItemData ass = GT_OreDictUnificator.getAssociation(stack); - if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) - if (WerkstoffLoader.items.get(ass.mPrefix) != null) - recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix,stack.stackSize); - } - } - for (GT_Recipe recipe_assemblyLine : GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList){ - if (recipe_assemblyLine.mEUt > BW_Util.getTierVoltage(6)) - continue; - if (BW_Util.checkStackAndPrefix(recipe_assemblyLine.mOutputs[0])) - continue; - for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) { - ItemStack stack = recipe_assemblyLine.mInputs[i]; - if (!BW_Util.checkStackAndPrefix(stack)) - continue; - ItemData ass = GT_OreDictUnificator.getAssociation(stack); - if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) - if (WerkstoffLoader.items.get(ass.mPrefix) != null) - recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix, stack.stackSize); - } - } - for (GT_Recipe recipe_assemblyLine : GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList){ - if (recipe_assemblyLine.mEUt > 6000) - continue; - for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) { - ItemStack stack = recipe_assemblyLine.mInputs[i]; - if (!BW_Util.checkStackAndPrefix(stack)) - continue; - ItemData ass = GT_OreDictUnificator.getAssociation(stack); - if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) - if (WerkstoffLoader.items.get(ass.mPrefix) != null) - recipe_assemblyLine.mInputs[i] = WerkstoffLoader.LuVFineWireMaterial.get(ass.mPrefix,stack.stackSize); - } - } - } - - private static boolean doStacksCointainAndReplace(FluidStack[] stacks, FluidStack stack, boolean replace, Fluid... replacement) { - boolean replaced = false; - for (int i = 0; i < stacks.length; i++) { - if (GT_Utility.areFluidsEqual(stack, stacks[i])) - if (!replace) - return true; - else { - int amount = stacks[i].amount; - stacks[i] = new FluidStack(replacement[0], amount); - replaced = true; - } - } - return replaced; - } - - private static boolean doStacksCointainAndReplace(Object[] stacks, ItemStack stack, boolean replace, ItemStack... replacement) { - boolean replaced = false; - for (int i = 0; i < stacks.length; i++) { - if (!GT_Utility.isStackValid(stacks[i])) { - if (stacks[i] instanceof ArrayList && ((ArrayList)stacks[i]).size() > 0) { - if (GT_Utility.areStacksEqual(stack, (ItemStack) ((ArrayList)stacks[i]).get(0), true)) - if (!replace) - return true; - else { - int amount = ((ItemStack) ((ArrayList)stacks[i]).get(0)).stackSize; - stacks[i] = new ArrayList<>(); - ((ArrayList)stacks[i]).add(replacement[0].splitStack(amount)); - replaced = true; - } - - } else - continue; - } else if (GT_Utility.areStacksEqual(stack, (ItemStack) stacks[i], true)) - if (!replace) - return true; - else { - int amount = ((ItemStack) stacks[i]).stackSize; - stacks[i] = replacement[0].splitStack(amount); - replaced = true; - } - } - return replaced; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java deleted file mode 100644 index 98d0438056..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/PlatinumSludgeOverHaul.java +++ /dev/null @@ -1,548 +0,0 @@ -/* - * Copyright (c) 2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; - -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.interfaces.ISubTagContainer; -import gregtech.api.items.GT_Generic_Block; -import gregtech.api.items.GT_Generic_Item; -import gregtech.api.objects.ItemData; -import gregtech.api.objects.MaterialStack; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.common.blocks.GT_Block_Ores_Abstract; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.*; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; -import org.apache.commons.lang3.reflect.FieldUtils; - -import java.lang.reflect.Field; -import java.util.*; - -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; -import static gregtech.api.enums.OrePrefixes.*; - -public class PlatinumSludgeOverHaul { - private static final Materials[] BLACKLIST = { - Materials.HSSS, - Materials.EnderiumBase, - Materials.Osmiridium, - Materials.get("Uraniumtriplatinid"), - Materials.get("Tetranaquadahdiindiumhexaplatiumosminid"), - Materials.get("Longasssuperconductornameforuvwire"), - }; - private static final OrePrefixes[] OPBLACKLIST = { - crushedCentrifuged,crushed,crushedPurified,dustPure,dustImpure,dustRefined,dust,dustTiny,dustSmall - }; - - private PlatinumSludgeOverHaul() { - } - - private static void runHelperrecipes() { - //DilutedSulfuricAcid - GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(3), Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, Materials.DilutedSulfuricAcid.getCells(4), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, Materials.SulfuricAcid.getFluid(3000), Materials.DilutedSulfuricAcid.getFluid(4000), Materials.Empty.getCells(1), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(3), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Water.getFluid(1000), Materials.DilutedSulfuricAcid.getFluid(4000), Materials.Empty.getCells(3), 30, 30); - //FormicAcid - GT_Values.RA.addChemicalRecipe(Materials.CarbonMonoxide.getCells(1), Materials.SodiumHydroxide.getDust(1), null, null, Sodiumformate.get(cell), null, 15); - GT_Values.RA.addChemicalRecipe(Sodiumformate.get(cell, 2), GT_Utility.getIntegratedCircuit(1), Materials.SulfuricAcid.getFluid(1000), null, FormicAcid.get(cell, 2), Sodiumsulfate.get(dust), 15); - GT_Values.RA.addChemicalRecipe(Materials.SulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Sodiumformate.getFluidOrGas(2000), FormicAcid.getFluidOrGas(2000), Materials.Empty.getCells(1), Sodiumsulfate.get(dust), 15); - //AquaRegia - GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, AquaRegia.get(cell, 2), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(2), null, null, AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(2), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(3), null, null, Materials.DilutedSulfuricAcid.getFluid(1000), AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(1), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(4), null, null, Materials.NitricAcid.getFluid(1000), AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(1), 30, 30); - - //AmmoniumCloride - GT_Values.RA.addChemicalRecipe(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.HydrochloricAcid.getFluid(1000), null, AmmoniumChloride.get(cell, 1), null, 15); - GT_Values.RA.addChemicalRecipe(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), AmmoniumChloride.getFluidOrGas(1000), Materials.Empty.getCells(1), null, 15); - - //base sollution - for (Werkstoff w : Werkstoff.werkstoffHashSet) - if (w.containsStuff(Materials.Sulfur) && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { - GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); - GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny), 250); - } - for (Materials m : Materials.values()) - if (PlatinumSludgeOverHaul.materialsContains(m, Materials.Sulfur) && (PlatinumSludgeOverHaul.materialsContains(m, Materials.Copper) || PlatinumSludgeOverHaul.materialsContains(m, Materials.Nickel))) { - GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); - GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny), 250); - } - //Pt - GT_Values.RA.addBlastRecipe(PTMetallicPowder.get(dust, 3), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Platinum.getNuggets(2), null, 600, 120, Materials.Platinum.mMeltingPoint); - - GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); - GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2),null, AmmoniumChloride.getFluidOrGas(200), PDAmmonia.getFluidOrGas(200), PTSaltCrude.get(dustTiny, 18), PTRawPowder.get(dustTiny,2), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(200)}, new FluidStack[]{PDAmmonia.getFluidOrGas(200), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2)}, 1200, 30); - GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - }, new int[]{ - 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, - }, 600, 30); - GT_Values.RA.addBlastRecipe(PTSaltRefined.get(dust), GT_Utility.getIntegratedCircuit(1), null, Materials.Chlorine.getGas(87), PTMetallicPowder.get(dust), null, 200, 120, 900); - GT_Values.RA.addChemicalRecipe(PTRawPowder.get(dust, 2), Materials.Calcium.getDust(1), null, null, Materials.Platinum.getDust(2), CalciumChloride.get(dust), 30); - //Pd - GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), PDAmmonia.getFluidOrGas(1000), null, 250); - GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dustTiny, 16), PDRawPowder.get(dustTiny, 2), 250); - GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), null, PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dust), 250); - GT_Values.RA.addSifterRecipe(PDSalt.get(dust), new ItemStack[]{ - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - }, new int[]{ - 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, - }, 600, 30); - GT_Values.RA.addChemicalRecipeForBasicMachineOnly(PDRawPowder.get(dust, 2), Materials.Empty.getCells(1), FormicAcid.getFluidOrGas(4000), Materials.Ammonia.getGas(2000), Materials.Palladium.getDust(2), Materials.Ethylene.getCells(1), 250, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{PDRawPowder.get(dust, 2)}, new FluidStack[]{FormicAcid.getFluidOrGas(4000)}, new FluidStack[]{Materials.Ammonia.getGas(2000), Materials.Ethylene.getGas(1000), Materials.Water.getFluid(1000)}, new ItemStack[]{Materials.Palladium.getDust(2)}, 250, 30); - GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust, 2), Materials.Hydrogen.getCells(1), null, Materials.SulfuricAcid.getFluid(2000), Materials.Sodium.getDust(1), Materials.Empty.getCells(3), 30); - //K2S2O7 - // GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust,6), null, 30); - //Rh/Os/Ir/Ru - GT_Values.RA.addBlastRecipe(PTResidue.get(dust), GT_Utility.getIntegratedCircuit(11), PotassiumDisulfate.getMolten(1440), RHSulfate.getFluidOrGas(1440), LeachResidue.get(dust), null, 200, 120, 775); - - //Ru - GT_Values.RA.addBlastRecipe(LeachResidue.get(dust, 10), Materials.Saltpeter.getDust(10), Materials.SaltWater.getFluid(1000), GT_ModHandler.getSteam(1000), SodiumRuthenate.get(dust, 3), IrOsLeachResidue.get(dust, 6), 200, 120, 775); - GT_Values.RA.addChemicalRecipe(SodiumRuthenate.get(dust, 6), Materials.Chlorine.getCells(3), null, RutheniumTetroxideSollution.getFluidOrGas(9000), Materials.Empty.getCells(3), 300); - GT_Values.RA.addFluidHeaterRecipe(GT_Utility.getIntegratedCircuit(1), RutheniumTetroxideSollution.getFluidOrGas(800), HotRutheniumTetroxideSollution.getFluidOrGas(800), 300, 480); - GT_Values.RA.addCrackingRecipe(17, RutheniumTetroxideSollution.getFluidOrGas(1000), GT_ModHandler.getSteam(1000), HotRutheniumTetroxideSollution.getFluidOrGas(2000), 150, 480); - GT_Values.RA.addDistillationTowerRecipe(HotRutheniumTetroxideSollution.getFluidOrGas(9000), new FluidStack[]{ - Materials.Water.getFluid(1800), - RutheniumTetroxide.getFluidOrGas(7200) - }, Materials.Salt.getDust(6), 1500, 480); - GT_Values.RA.addChemicalRecipe(RutheniumTetroxide.get(dust, 1), Materials.HydrochloricAcid.getCells(6), null, Materials.Water.getFluid(2000), Ruthenium.get(dust), Materials.Chlorine.getCells(6), 300); - - //Os - GT_Values.RA.addBlastRecipe(IrOsLeachResidue.get(dust, 4), GT_Utility.getIntegratedCircuit(11), Materials.HydrochloricAcid.getFluid(1000), AcidicOsmiumSolution.getFluidOrGas(2000), IrLeachResidue.get(dust, 2), null, 200, 120, 775); - GT_Values.RA.addDistillationTowerRecipe(AcidicOsmiumSolution.getFluidOrGas(1000), new FluidStack[]{OsmiumSolution.getFluidOrGas(100), Materials.Water.getFluid(900)}, null, 150, BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addChemicalRecipe(OsmiumSolution.get(cell), Materials.HydrochloricAcid.getCells(6), null, Materials.Water.getFluid(2000), Materials.Osmium.getDust(1), Materials.Chlorine.getCells(7), 300); - - //Ir - GT_Values.RA.addBlastRecipe(IrLeachResidue.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, PGSDResidue.get(dust), IridiumDioxide.get(dust), 200, 120, 775); - GT_Values.RA.addChemicalRecipe(IridiumDioxide.get(dust), Materials.HydrochloricAcid.getCells(1), null, AcidicIridiumSolution.getFluidOrGas(1000), Materials.Empty.getCells(1), null, 300); - GT_Values.RA.addChemicalRecipe(AcidicIridiumSolution.get(cell), AmmoniumChloride.get(cell, 3), null, Materials.Ammonia.getGas(3000), Materials.Empty.getCells(4), IridiumChloride.get(dust), 300); - GT_Values.RA.addChemicalRecipe(IridiumChloride.get(dust), Materials.Calcium.getDust(3), null, CalciumChloride.getFluidOrGas(3000), PGSDResidue2.get(dust), Materials.Iridium.getDust(1), 300, 1920); - - //Rh - GT_Values.RA.addChemicalRecipe(RHSulfate.get(cell, 11), GT_Utility.getIntegratedCircuit(1), Materials.Water.getFluid(10000), Materials.Potassium.getMolten(2000), RHSulfateSolution.get(cell, 11), LeachResidue.get(dustTiny, 10), 300, 30); - - GT_Values.RA.addChemicalRecipe(Materials.Zinc.getDust(1), null, RHSulfateSolution.getFluidOrGas(1000), null, ZincSulfate.get(dust), CrudeRhMetall.get(dust), 300); - GT_Values.RA.addBlastRecipe(CrudeRhMetall.get(dust), Materials.Salt.getDust(1), Materials.Chlorine.getGas(1000), null, RHSalt.get(dust, 3), null, 300, 120, 600); - GT_Values.RA.addMixerRecipe(RHSalt.get(dust, 10), null, null, null, Materials.Water.getFluid(2000), RHSaltSolution.getFluidOrGas(2000), null, 300, 30); - GT_Values.RA.addChemicalRecipe(SodiumNitrate.get(dust), GT_Utility.getIntegratedCircuit(1), RHSaltSolution.getFluidOrGas(1000), null, RHNitrate.get(dust), Materials.Salt.getDust(1), 300); - GT_Values.RA.addSifterRecipe(RHNitrate.get(dust), new ItemStack[]{ - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - }, new int[]{ - 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, - }, 600, 30); - GT_Values.RA.addMixerRecipe(RhFilterCake.get(dust), null, null, null, Materials.Water.getFluid(1000), RHFilterCakeSolution.getFluidOrGas(1000), null, 300, 30); - GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), null, RHFilterCakeSolution.getFluidOrGas(1000), null, ReRh.get(dust), null, 300); - GT_Values.RA.addChemicalRecipe(ReRh.get(dust), Materials.Empty.getCells(1), Materials.HydrochloricAcid.getFluid(1000), Materials.Chlorine.getGas(1000), Rhodium.get(dust), Materials.Ammonia.getCells(1), 300); - } - - private static boolean materialsContains(Materials one, ISubTagContainer other) { - if (one == null || one.mMaterialList == null || one.mMaterialList.isEmpty()) - return false; - for (MaterialStack stack : one.mMaterialList) - if (stack.mMaterial.equals(other)) - return true; - return false; - } - - public static void replacePureElements() { - //furnace - for (Object entry : FurnaceRecipes.smelting().getSmeltingList().entrySet()) { - Map.Entry realEntry = (Map.Entry) entry; - if (GT_Utility.isStackValid(realEntry.getKey()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getKey())) - if ((!GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dust) && !GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dustTiny)) || !GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mMaterial.mMaterial.equals(Materials.Platinum)) - if (GT_Utility.isStackValid(realEntry.getValue()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())){ - ItemData ass = GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()); - if (ass.mMaterial.mMaterial.equals(Materials.Platinum)) - if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) - realEntry.setValue(PTMetallicPowder.get(ass.mPrefix == nugget ? dustTiny : dust, ((ItemStack) realEntry.getValue()).stackSize * 2)); - else if (ass.mMaterial.mMaterial.equals(Materials.Palladium)) - if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) - realEntry.setValue(PDMetallicPowder.get(ass.mPrefix == nugget ? dustTiny : dust, ((ItemStack) realEntry.getValue()).stackSize * 2)); - } - } - //vanilla crafting - CraftingManager.getInstance().getRecipeList().forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); - //gt crafting - try { - ((List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null)).forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - //gt machines - maploop: - for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - if (map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes) - continue; - HashSet toDel = new HashSet(); - recipeloop: - for (GT_Recipe recipe : map.mRecipeList) { - if (recipe.mFakeRecipe) - continue maploop; - - for (int i = 0; i < recipe.mFluidOutputs.length; i++) { - if (map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes)) - continue maploop; - else if (map.equals(GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sChemicalRecipes)) { - if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) - recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); - else if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) - recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); - else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) - recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); - } else { - if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - } - } - for (int i = 0; i < recipe.mOutputs.length; i++) { - if (!GT_Utility.isStackValid(recipe.mOutputs[i])) - continue; - if (BW_Util.areStacksEqualOrNull(Ruthenium.get(dust), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustImpure), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustPure), recipe.mOutputs[i])) { - if (!BW_Util.areStacksEqualOrNull(Ruthenium.get(ingot), recipe.mInputs[0])) { - for (int j = 0; j < recipe.mInputs.length; j++) - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; - int amount = recipe.mOutputs[i].stackSize * 2; - recipe.mOutputs[i] = LeachResidue.get(dust, amount); - } - } - if (BW_Util.areStacksEqualOrNull(Rhodium.get(dust), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Rhodium.get(dustImpure), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Rhodium.get(dustPure), recipe.mOutputs[i])) { - if (!BW_Util.areStacksEqualOrNull(Rhodium.get(ingot), recipe.mInputs[0])) { - for (int j = 0; j < recipe.mInputs.length; j++) - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; - int amount = recipe.mOutputs[i].stackSize * 2; - recipe.mOutputs[i] = CrudeRhMetall.get(dust, amount); - } - } - if (!BW_Util.checkStackAndPrefix(recipe.mOutputs[i])) - continue; - //Pt - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Platinum)) { - for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; - } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount * 2); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dustSmall).splitStack(amount * 2); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 2); - } - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Palladium)) { - for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; - } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PDMetallicPowder.get(dust).splitStack(amount * 2); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PDMetallicPowder.get(dustSmall).splitStack(amount * 2); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PDMetallicPowder.get(dustTiny).splitStack(amount * 2); - } - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Osmium)) { - for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; - } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrOsLeachResidue.get(dust).splitStack(amount); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrOsLeachResidue.get(dustSmall).splitStack(amount); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount); - } - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Iridium)) { - for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; - } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrLeachResidue.get(dust).splitStack(amount); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrLeachResidue.get(dustSmall).splitStack(amount); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrLeachResidue.get(dustTiny).splitStack(amount); - } - } - } - } - map.mRecipeList.removeAll(toDel); - } - //TODO: remove EnderIO recipes - - //fix HV tier - PlatinumSludgeOverHaul.replaceHVCircuitMaterials(); - //add new recipes - PlatinumSludgeOverHaul.runHelperrecipes(); - } - - private static void replaceHVCircuitMaterials(){ - GT_Values.RA.addMixerRecipe(Materials.Redstone.getDust(1),Materials.Electrum.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,Materials.Nikolite.getDust(8),1800,120); - for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList){ - if (recipe.mEUt > 512) - continue; - if (BW_Util.checkStackAndPrefix(recipe.mOutputs[0])) { - for (int i = 0; i < recipe.mInputs.length; i++) { - ItemStack stack = recipe.mInputs[i]; - ItemData ass = GT_OreDictUnificator.getAssociation(stack); - if (BW_Util.checkStackAndPrefix(stack) && ass.mMaterial.mMaterial.equals(Materials.Platinum)) { - recipe.mInputs[i] = GT_OreDictUnificator.get(ass.mPrefix,Materials.BlueAlloy,stack.stackSize); - } - } - } - } - } - - private static void setnewMaterialInRecipe(Object obj) { - String inputName = "output"; - String inputItemName = "input"; - if (!(obj instanceof ShapedOreRecipe || obj instanceof ShapelessOreRecipe)){ - if (obj instanceof ShapedRecipes || (obj instanceof ShapelessRecipes)) { - inputName = "recipeOutput"; - inputItemName = "recipeItems"; - } - else if (Loader.isModLoaded("miscutils")) { - try { - if (Class.forName("gtPlusPlus.api.objects.minecraft.ShapedRecipe").isAssignableFrom(obj.getClass())) - obj = FieldUtils.getField(obj.getClass(),"mRecipe",true).get(obj); - } catch (ClassNotFoundException | IllegalAccessException e) { - e.printStackTrace(); - } - } - } - - IRecipe recipe = (IRecipe) obj; - ItemStack otpt = recipe.getRecipeOutput(); - - Field out = FieldUtils.getDeclaredField(recipe.getClass(), inputName, true); - if (out == null) - out = FieldUtils.getField(recipe.getClass(), inputName, true); - - - Field in = FieldUtils.getDeclaredField(recipe.getClass(), inputItemName, true); - if (in == null) - in = FieldUtils.getField(recipe.getClass(), inputItemName, true); - if (in == null) - return; - FieldUtils.removeFinalModifier(in,true); - Object input = null; - try { - input = in.get(obj); - } catch (IllegalAccessException e) { - e.printStackTrace(); - return; - } - assert input != null; - - if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Platinum.getDust(1), true)) { - if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Platinum)) - return; - try { - out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize * 2)); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Palladium.getDust(1), true)) { - if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Palladium)) - return; - try { - out.set(recipe, PDMetallicPowder.get(dust, otpt.stackSize * 2)); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Iridium.getDust(1), true)) { - if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Iridium)) - return; - try { - out.set(recipe, IrLeachResidue.get(dust, otpt.stackSize)); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Osmium.getDust(1), true)) { - if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Osmium)) - return; - try { - out.set(recipe, IrOsLeachResidue.get(dust, otpt.stackSize)); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - } - - private static boolean checkRecipe(Object input,Materials mat){ - if (input instanceof List || input instanceof Object[]) { - Set lists = new HashSet(), stacks= new HashSet(); - List ip = input instanceof List ? (List)input : new ArrayList(); - Object[] ip2 = input instanceof Object[] ? (Object[])input : new Object[0]; - - for (Object o : ip){ - if (o instanceof List) - lists.add(o); - else if (o instanceof ItemStack) - stacks.add(o); - } - for (Object o : ip2){ - if (o instanceof List) - lists.add(o); - else if (o instanceof ItemStack) - stacks.add(o); - } - - for (Object o : lists) { - if (!((List) o).isEmpty()) - stacks.add(((List) o).get(0)); - } - - for (Object stack : stacks) { - if (stack instanceof ItemStack) { - if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(crateGtDust, mat, 1), (ItemStack) stack)) - return true; - } - } - - boolean allSame = false; - for (Object stack : stacks) { - if (stack instanceof ItemStack) { - allSame = BW_Util.checkStackAndPrefix((ItemStack) stack) && GT_OreDictUnificator.getAssociation((ItemStack) stack).mMaterial.mMaterial.equals(mat); - } else { - allSame = false; - break; - } - if (!allSame) - break; - } - return allSame; - } - return false; - } - - private static boolean isInBlackList(ItemStack stack) { - if (stack == null) - return true; - - if (stack.getItem() instanceof BW_MetaGenerated_Items) - return true; - - if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(MainMod.MOD_ID)) - return true; - - if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(BartWorksCrossmod.MOD_ID)) - return true; - - if (Block.getBlockFromItem(stack.getItem()) instanceof GT_Generic_Block && !(Block.getBlockFromItem(stack.getItem()) instanceof GT_Block_Ores_Abstract)) - return true; - - if (GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_1.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_2.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_4.get(1),stack,true)) - return true; - - if (stack.getItem() instanceof GT_Generic_Item) { - if (!BW_Util.checkStackAndPrefix(stack)) - return false; - return (!Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mPrefix)) || Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); - } - - if (Loader.isModLoaded("miscutils")) { - try { - if (Class.forName("gtPlusPlus.core.item.base.BaseItemComponent").isAssignableFrom(stack.getItem().getClass()) && !(stack.getUnlocalizedName().contains("dust") || stack.getUnlocalizedName().contains("Dust"))) - return true; - if (Class.forName("gtPlusPlus.core.block.base.BlockBaseModular").isAssignableFrom(Block.getBlockFromItem(stack.getItem()).getClass())) - return true; - } catch (ClassNotFoundException e) { - e.printStackTrace(); - } - } - - if (!BW_Util.checkStackAndPrefix(stack)) - return false; - - return Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); - } -} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java index 11d6637db3..95af2d9738 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java @@ -203,10 +203,10 @@ public class BW_ColorUtil { } public static short[] correctCorlorArray(short[] rgba){ - if (rgba.length>4) { + if (rgba.length > 4) { rgba = Arrays.copyOfRange(rgba, 0,4); } - if (rgba.length<4) { + if (rgba.length < 4) { short[] tmp = Arrays.copyOf(rgba, 4); Arrays.fill(tmp,rgba.length,4, (short) 0); rgba = tmp; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index 001b747be8..a5b2b49d69 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.MainMod; import gregtech.api.interfaces.IColorModulationContainer; +import gregtech.api.util.GT_LanguageManager; import net.minecraft.item.EnumRarity; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.Fluid; @@ -40,6 +41,14 @@ public class BioCulture extends BioData implements IColorModulationContainer { public static final ArrayList BIO_CULTURE_ARRAY_LIST = new ArrayList(); public static final BioCulture NULLCULTURE = BioCulture.createAndRegisterBioCulture(Color.BLUE, "", BioPlasmid.NULLPLASMID, BioDNA.NULLDNA, false); //fallback NULL culture, also Blue =) + public String getLocalisedName() { + return GT_LanguageManager.getTranslation(this.getName()); + } + + public void setLocalisedName(String localisedName) { + GT_LanguageManager.addStringLocalization(this.getName(),localisedName); + } + Color color; BioPlasmid plasmid; BioDNA dDNA; @@ -111,6 +120,8 @@ public class BioCulture extends BioData implements IColorModulationContainer { } public static BioCulture getBioCulture(String Name) { + if (Name == null || Name.isEmpty()) + return null; for (BioCulture b : BIO_CULTURE_ARRAY_LIST) if (b.name.equals(Name)) return b; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 19e0603b1c..dde15a6611 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -26,7 +26,6 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.commands.ChangeConfig; import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; -import com.github.bartimaeusnek.crossmod.ae2.ItemSingleItemStorageCell; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Loader; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java b/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java index 29aa9d06c3..af653781be 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java @@ -1,122 +1,122 @@ -package com.github.bartimaeusnek.crossmod.ae2; - -import appeng.api.AEApi; -import appeng.api.config.FuzzyMode; -import appeng.api.config.IncludeExclude; -import appeng.api.implementations.items.IStorageCell; -import appeng.api.storage.*; -import appeng.api.storage.data.IAEItemStack; -import appeng.core.localization.GuiText; -import appeng.items.contents.CellUpgrades; -import appeng.util.Platform; -import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; -import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import java.util.List; - -public class ItemSingleItemStorageCell extends SimpleSubItemClass implements IStorageCell { - - public ItemSingleItemStorageCell(String tex) { - super(tex); - Item thizz = this; - GameRegistry.registerItem(this, BartWorksCrossmod.MOD_ID+this.iconString); - } - - @Override - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack stack, EntityPlayer p_77624_2_, List lines, boolean p_77624_4_) { - IMEInventoryHandler inventory = AEApi.instance().registries().cell().getCellInventory(stack, (ISaveProvider)null, StorageChannel.ITEMS); - if (inventory instanceof ICellInventoryHandler) { - ICellInventoryHandler handler = (ICellInventoryHandler)inventory; - ICellInventory cellInventory = handler.getCellInv(); - if (cellInventory != null) { - lines.add(cellInventory.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal()); - lines.add(cellInventory.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalItemTypes() + ' ' + GuiText.Types.getLocal()); - if (handler.isPreformatted()) { - String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : GuiText.Excluded).getLocal(); - if (handler.isFuzzy()) { - lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Fuzzy.getLocal()); - } else { - lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Precise.getLocal()); - } - } - } - } - } - - @Override - public int getBytes(ItemStack itemStack) { - return getTotalTypes(itemStack)*getBytesPerType(itemStack); - } - - @Override - public int BytePerType(ItemStack itemStack) { - return 1; - } - - @Override - public int getBytesPerType(ItemStack itemStack) { - return 1; - } - - @Override - public int getTotalTypes(ItemStack itemStack) { - return 4096; - } - - @Override - public boolean isBlackListed(ItemStack itemStack, IAEItemStack iaeItemStack) { - return iaeItemStack == null || iaeItemStack.getItem().getItemStackLimit() != 1; - } - - @Override - public boolean storableInStorageCell() { - return true; - } - - @Override - public boolean isStorageCell(ItemStack itemStack) { - return true; - } - - @Override - public double getIdleDrain() { - return 4D; - } - - @Override - public boolean isEditable(ItemStack itemStack) { - return true; - } - - @Override - public IInventory getUpgradesInventory(ItemStack itemStack) { - return new CellUpgrades(itemStack, 2); - } - - @Override - public IInventory getConfigInventory(ItemStack itemStack) { - return new CellUpgrades(itemStack,2); - } - @Override - public FuzzyMode getFuzzyMode(ItemStack is) { - String fz = Platform.openNbtData(is).getString("FuzzyMode"); - - try { - return FuzzyMode.valueOf(fz); - } catch (Throwable var4) { - return FuzzyMode.IGNORE_ALL; - } - } - @Override - public void setFuzzyMode(ItemStack is, FuzzyMode fzMode) { - Platform.openNbtData(is).setString("FuzzyMode", fzMode.name()); - } -} +//package com.github.bartimaeusnek.crossmod.ae2; +// +//import appeng.api.AEApi; +//import appeng.api.config.FuzzyMode; +//import appeng.api.config.IncludeExclude; +//import appeng.api.implementations.items.IStorageCell; +//import appeng.api.storage.*; +//import appeng.api.storage.data.IAEItemStack; +//import appeng.core.localization.GuiText; +//import appeng.items.contents.CellUpgrades; +//import appeng.util.Platform; +//import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; +//import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +//import cpw.mods.fml.common.registry.GameRegistry; +//import cpw.mods.fml.relauncher.Side; +//import cpw.mods.fml.relauncher.SideOnly; +//import net.minecraft.entity.player.EntityPlayer; +//import net.minecraft.inventory.IInventory; +//import net.minecraft.item.Item; +//import net.minecraft.item.ItemStack; +// +//import java.util.List; +// +//public class ItemSingleItemStorageCell extends SimpleSubItemClass implements IStorageCell { +// +// public ItemSingleItemStorageCell(String tex) { +// super(tex); +// Item thizz = this; +// GameRegistry.registerItem(this, BartWorksCrossmod.MOD_ID+this.iconString); +// } +// +// @Override +// @SideOnly(Side.CLIENT) +// public void addInformation(ItemStack stack, EntityPlayer p_77624_2_, List lines, boolean p_77624_4_) { +// IMEInventoryHandler inventory = AEApi.instance().registries().cell().getCellInventory(stack, (ISaveProvider)null, StorageChannel.ITEMS); +// if (inventory instanceof ICellInventoryHandler) { +// ICellInventoryHandler handler = (ICellInventoryHandler)inventory; +// ICellInventory cellInventory = handler.getCellInv(); +// if (cellInventory != null) { +// lines.add(cellInventory.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal()); +// lines.add(cellInventory.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalItemTypes() + ' ' + GuiText.Types.getLocal()); +// if (handler.isPreformatted()) { +// String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : GuiText.Excluded).getLocal(); +// if (handler.isFuzzy()) { +// lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Fuzzy.getLocal()); +// } else { +// lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Precise.getLocal()); +// } +// } +// } +// } +// } +// +// @Override +// public int getBytes(ItemStack itemStack) { +// return getTotalTypes(itemStack)*getBytesPerType(itemStack); +// } +// +// @Override +// public int BytePerType(ItemStack itemStack) { +// return 1; +// } +// +// @Override +// public int getBytesPerType(ItemStack itemStack) { +// return 1; +// } +// +// @Override +// public int getTotalTypes(ItemStack itemStack) { +// return 4096; +// } +// +// @Override +// public boolean isBlackListed(ItemStack itemStack, IAEItemStack iaeItemStack) { +// return iaeItemStack == null || iaeItemStack.getItem().getItemStackLimit() != 1; +// } +// +// @Override +// public boolean storableInStorageCell() { +// return true; +// } +// +// @Override +// public boolean isStorageCell(ItemStack itemStack) { +// return true; +// } +// +// @Override +// public double getIdleDrain() { +// return 4D; +// } +// +// @Override +// public boolean isEditable(ItemStack itemStack) { +// return true; +// } +// +// @Override +// public IInventory getUpgradesInventory(ItemStack itemStack) { +// return new CellUpgrades(itemStack, 2); +// } +// +// @Override +// public IInventory getConfigInventory(ItemStack itemStack) { +// return new CellUpgrades(itemStack,2); +// } +// @Override +// public FuzzyMode getFuzzyMode(ItemStack is) { +// String fz = Platform.openNbtData(is).getString("FuzzyMode"); +// +// try { +// return FuzzyMode.valueOf(fz); +// } catch (Throwable var4) { +// return FuzzyMode.IGNORE_ALL; +// } +// } +// @Override +// public void setFuzzyMode(ItemStack is, FuzzyMode fzMode) { +// Platform.openNbtData(is).setString("FuzzyMode", fzMode.name()); +// } +//} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index 4d382a6c07..3486b52135 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -148,7 +148,7 @@ public class ThaumcraftHandler { public static void addAspectToAll(Werkstoff werkstoff){ for (OrePrefixes element : OrePrefixes.values()) { - if ((werkstoff.getGenerationFeatures().toGenerate & element.mMaterialGenerationBits) != 0 && (werkstoff.getGenerationFeatures().blacklist & element.mMaterialGenerationBits) == 0) { + if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(element)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(element)) == 0) { if (element.mMaterialAmount >= 3628800L || element == OrePrefixes.ore) { DebugLog.log("OrePrefix: "+element.name() + " mMaterialAmount: " + element.mMaterialAmount/3628800L); if (WerkstoffLoader.items.get(element) != null) diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index b0b3c9b7b6..f1decd8af2 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -161,4 +161,6 @@ moon.Ross128ba=Ross128ba star.Ross128=Ross128 solarsystem.Ross128System=Ross128-System -itemGroup.bw.MetaItems.0=BartWorks Circuit Overhaul Items \ No newline at end of file +itemGroup.bw.MetaItems.0=BartWorks Circuit Overhaul Items + +#Liquids -- cgit From 2ae116761204b2002e8728cc4926d60cee0732d1 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 29 Sep 2019 18:44:40 +0200 Subject: fixes +General fix for Recipes that use Tier Voltage instead of Machine Voltage +limit stack sizes for CAL to max stacksize instead of 64 to make recipes doable Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: f7ac5f2b64c8f406a7a15f3eeb016f08f48435c7 --- build.properties | 2 +- .../java/com/github/bartimaeusnek/bartworks/MainMod.java | 16 ++++++++++++++++ .../material/CircuitGeneration/CircuitImprintLoader.java | 4 ++++ .../material/processingLoaders/AdditionalRecipes.java | 2 +- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/build.properties b/build.properties index ee3f254372..c5e30dde8e 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre14 +buildNumber=2_pre15 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index b936be1f72..3f01018d84 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -219,6 +219,22 @@ public final class MainMod { new CircuitImprintLoader().run(); if (classicMode) new DownTierLoader().run(); + fixEnergyRequirements(); + } + + private static void fixEnergyRequirements() { + maploop: + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings){ + for (GT_Recipe recipe : map.mRecipeList){ + if (recipe.mFakeRecipe) + continue maploop; + for (int i = 0; i < 10; i++) { + if (recipe.mEUt == BW_Util.getTierVoltage(i)){ + recipe.mEUt = BW_Util.getMachineVoltageFromTier(i); + } + } + } + } } private static void unificationEnforcer() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 26f774b780..a2442cb6d2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -113,6 +113,8 @@ public class CircuitImprintLoader implements Runnable { int[] oreIDs = OreDictionary.getOreIDs(is); if(oreIDs == null || oreIDs.length < 1 || !OreDictionary.getOreName(oreIDs[0]).contains("circuit")) { is.stackSize = 64; + if (is.stackSize > is.getItem().getItemStackLimit() || is.stackSize > is.getMaxStackSize()) + is.stackSize = is.getMaxStackSize(); } } newRecipe.mFluidInputs[0].amount *= 4; @@ -143,6 +145,8 @@ public class CircuitImprintLoader implements Runnable { else { in[i] = original.mInputs[i].copy(); in[i].stackSize *= 16; + if (in[i].stackSize > in[i].getItem().getItemStackLimit() || in[i].stackSize > in[i].getMaxStackSize()) + in[i].stackSize = in[i].getMaxStackSize(); } // if (in[i].stackSize > 64) // return null; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index e657a5af83..d6a1f898aa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -110,7 +110,7 @@ public class AdditionalRecipes implements Runnable { new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{ BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (2)), + WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (1)), BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), ItemList.Circuit_Parts_DiodeSMD.get((i + 6) * 4), ItemList.Circuit_Parts_CapacitorSMD.get((i + 6) * 4), -- cgit From c3ba4b8cd8dc2bb516e2beab8915e08fdac1ccbb Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 29 Sep 2019 18:49:15 +0200 Subject: added Localisation for a few more fluids Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 968a052970b71ea7081e627e384bc4b02b8b7400 --- .../com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 09d8292eb6..17cb6d84a9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -103,11 +103,13 @@ public class FluidLoader implements Runnable { public static Fluid createAndRegisterFluid(String Name,Color color){ Fluid f = new GT_Fluid(Name,"molten.autogenerated",new short[]{(short) color.getRed(),(short) color.getGreen(),(short) color.getBlue(), (short) color.getAlpha()}); + GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), Name); FluidRegistry.registerFluid(f); return f; } public static Fluid createAndRegisterFluid(String Name, Color color, int temperature){ Fluid f = new GT_Fluid(Name,"molten.autogenerated",new short[]{(short) color.getRed(),(short) color.getGreen(),(short) color.getBlue(), (short) color.getAlpha()}); + GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), Name); f.setTemperature(temperature); FluidRegistry.registerFluid(f); return f; -- cgit From d077f5f3aae0fb61cb151f4c687b376515d92e9d Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 10 Oct 2019 21:35:05 +0200 Subject: fixes +added ASM fix for RWG +fixed conversion recipes if GT++ isnt installed +fixed texture loader +added mega distillation tower +made Circuit Assembly Line needs power +added heat level 9 for MamiTomoe +added capsules/fixed capsules +started working on bottles +started working on dyson swarm +added The Core picture +added bottle pngs +version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 59da6d7f671e9af160b45b0b9a3021048dbaaa9d --- build.properties | 2 +- .../java/com/github/bartimaeusnek/ASM/BWCore.java | 7 + .../bartimaeusnek/ASM/BWCoreTransformer.java | 58 +++++- .../github/bartimaeusnek/bartworks/MainMod.java | 14 +- .../client/textures/PrefixTextureLinker.java | 2 + .../bartworks/common/loaders/ItemRegistry.java | 4 +- .../bartworks/common/loaders/RecipeLoader.java | 1 + .../multis/GT_TileEntity_CircuitAssemblyLine.java | 2 + .../mega/GT_TileEntity_MegaBlastFurnace.java | 3 + .../mega/GT_TileEntity_MegaDistillTower.java | 230 +++++++++++++++++++++ .../material/GT_Enhancement/BWGTMetaItems.java | 25 ++- .../GT_Enhancement/GTMetaItemEnhancer.java | 31 +-- .../bartworks/system/material/ThreadedLoader.java | 14 +- .../bartworks/system/material/Werkstoff.java | 28 ++- .../bartworks/system/material/WerkstoffLoader.java | 13 +- .../multi/GT_Industrial_Alchemic_Construct.java | 4 +- .../tileEntity/DysonSwarmSunReplacement.java | 98 +++++++++ .../galaxySpace/tileEntity/GalaxySpaceProxy.java | 58 ++++++ .../thaumcraft/util/ThaumcraftHandler.java | 4 +- .../textures/items/gt.Core_Reactor_Cell.png | Bin 0 -> 443 bytes .../textures/items/gt.Core_Reactor_CellDep.png | Bin 0 -> 437 bytes .../items/materialicons/DIAMOND/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/DIAMOND/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/DULL/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/DULL/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../items/materialicons/EMERALD/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/EMERALD/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/FIERY/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/FIERY/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/FINE/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/FINE/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/FLINT/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/FLINT/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/FLUID/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/FLUID/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../items/materialicons/GEM_HORIZONTAL/bottle.png | Bin 0 -> 214 bytes .../GEM_HORIZONTAL/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../items/materialicons/GEM_VERTICAL/bottle.png | Bin 0 -> 214 bytes .../materialicons/GEM_VERTICAL/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/GLASS/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/GLASS/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/LAPIS/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/LAPIS/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/LEAF/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/LEAF/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../items/materialicons/LIGNITE/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/LIGNITE/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../items/materialicons/MAGNETIC/bottle.png | Bin 0 -> 214 bytes .../materialicons/MAGNETIC/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../items/materialicons/METALLIC/bottle.png | Bin 0 -> 214 bytes .../materialicons/METALLIC/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../items/materialicons/NETHERSTAR/bottle.png | Bin 0 -> 214 bytes .../materialicons/NETHERSTAR/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/NONE/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/NONE/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/OPAL/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/OPAL/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/PAPER/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/PAPER/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/POWDER/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/POWDER/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/QUARTZ/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/QUARTZ/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/ROUGH/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/ROUGH/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/RUBY/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/RUBY/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/SAND/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/SAND/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/SHARDS/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/SHARDS/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/SHINY/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/SHINY/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/WOOD/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/WOOD/bottle_OVERLAY.png | Bin 0 -> 267 bytes .../textures/items/materialicons/bottle.png | Bin 0 -> 214 bytes .../items/materialicons/bottle_OVERLAY.png | Bin 0 -> 267 bytes 77 files changed, 530 insertions(+), 68 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.Core_Reactor_Cell.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.Core_Reactor_CellDep.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bottle_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/bottle.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/bottle_OVERLAY.png diff --git a/build.properties b/build.properties index c5e30dde8e..116283303f 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre15 +buildNumber=2_pre16 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java index 2b4eafb9a1..1208a05744 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.ASM; +import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.google.common.eventbus.EventBus; @@ -61,8 +62,11 @@ public class BWCore extends DummyModContainer { shouldTransform[0] = Loader.isModLoaded("ExtraUtilities") && ConfigHandler.enabledPatches[0]; shouldTransform[1] = Loader.isModLoaded("ExtraUtilities") && ConfigHandler.enabledPatches[1]; shouldTransform[3] = Loader.isModLoaded("Thaumcraft") && ConfigHandler.enabledPatches[3]; + shouldTransform[4] = true; + shouldTransform[5] = Loader.isModLoaded("RWG") && ConfigHandler.enabledPatches[5]; BWCore.BWCORE_LOG.info("Extra Utilities found and ASM Patch enabled? " + shouldTransform[0]); BWCore.BWCORE_LOG.info("Thaumcraft found and ASM Patch enabled? " + shouldTransform[3]); + BWCore.BWCORE_LOG.info("RWG found and ASM Patch enabled? " + shouldTransform[5]); } @Override @@ -70,6 +74,9 @@ public class BWCore extends DummyModContainer { List ret = new ArrayList<>(); ret.add(new DefaultArtifactVersion("ExtraUtilities", true)); ret.add(new DefaultArtifactVersion("Thaumcraft", true)); + ret.add(new DefaultArtifactVersion("RWG", true)); + ret.add(new DefaultArtifactVersion("gregtech", true)); + ret.add(new DefaultArtifactVersion(MainMod.MOD_ID, true)); ret.add(new DefaultArtifactVersion(BartWorksCrossmod.MOD_ID, true)); return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index 51ee9867a9..bd395ea175 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.ASM; import net.minecraft.launchwrapper.IClassTransformer; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.*; import java.util.Arrays; @@ -38,7 +39,8 @@ public class BWCoreTransformer implements IClassTransformer { "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS", "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", - "PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API" + "PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API", + "DUCTTAPING RWG WORLDEN FAILS" // "ADD EXECTION HANDLEING TO FIND OREIDS/OREDICT" }; public static final String[] CLASSESBEEINGTRANSFORMED = { @@ -46,7 +48,8 @@ public class BWCoreTransformer implements IClassTransformer { "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", "net.minecraft.client.renderer.RenderGlobal", "thaumcraft.common.tiles.TileWandPedestal", - "gregtech.GT_Mod" + "gregtech.GT_Mod", + "rwg.world.ChunkGeneratorRealistic" // "net.minecraftforge.oredict.OreDictionary" }; static boolean obfs; @@ -92,6 +95,7 @@ public class BWCoreTransformer implements IClassTransformer { ClassNode classNode = new ClassNode(); classReader.accept(classNode, ClassReader.SKIP_FRAMES); List methods = classNode.methods; + scase: switch (id) { case 0: { BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); @@ -140,10 +144,9 @@ public class BWCoreTransformer implements IClassTransformer { toPatch.maxStack = 1; toPatch.maxLocals = 5; methods.set(i, toPatch); - break; + break scase; } } - break; } case 2: { String name_deObfs = "renderSky"; @@ -201,10 +204,9 @@ public class BWCoreTransformer implements IClassTransformer { } } toPatch.instructions = nu; - break; + break scase; } } - break; } case 3: { BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); @@ -217,10 +219,9 @@ public class BWCoreTransformer implements IClassTransformer { if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal, dsc_universal)) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); methods.set(i, BWCoreTransformer.transformThaumcraftWandPedestal(methods.get(i))); - break; + break scase; } } - break; } case 4 : { BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); @@ -244,13 +245,48 @@ public class BWCoreTransformer implements IClassTransformer { nu.add(toPatch.instructions.get(j)); } toPatch.instructions = nu; - break; + break scase; } } - - break; } case 5: { + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + String name_deObfs = "getNewNoise"; + for (int i = 0; i < methods.size(); i++) { + MethodNode toPatch = methods.get(i); + + if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs)) { + BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); + LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; + InsnList nu = new InsnList(); + // if (x < -28675) x %= -28675; + nu.add(new VarInsnNode(ILOAD, 2)); + nu.add(new IntInsnNode(SIPUSH, -28675)); + nu.add(new JumpInsnNode(IF_ICMPGE, LabelNodes[0])); + nu.add(new VarInsnNode(ILOAD, 2)); + nu.add(new LdcInsnNode(-28675)); + nu.add(new InsnNode(IREM)); + nu.add(new VarInsnNode(ISTORE, 2)); + nu.add(LabelNodes[0]); + // if (y < -28675) y %= -28675; + nu.add(new VarInsnNode(ILOAD, 3)); + nu.add(new IntInsnNode(SIPUSH, -28675)); + nu.add(new JumpInsnNode(IF_ICMPGE, LabelNodes[1])); + nu.add(new VarInsnNode(ILOAD, 3)); + nu.add(new LdcInsnNode(-28675)); + nu.add(new InsnNode(IREM)); + nu.add(new VarInsnNode(ISTORE, 3)); + nu.add(LabelNodes[1]); + + for (int j = 1; j < methods.get(i).instructions.size(); j++) { + nu.add(methods.get(i).instructions.get(j)); + } + + methods.get(i).instructions = nu; + break scase; + } + } + // String name_deObfs = "getOreIDs"; // String dsc_deObfs = "(Lnet/minecraft/item/ItemStack;)[I"; // String dsc_Obfs = "(Ladd;)[I"; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 3f01018d84..6fedc29f6b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -240,17 +240,18 @@ public final class MainMod { private static void unificationEnforcer() { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { if (werkstoff.getGenerationFeatures().enforceUnification) { - if (werkstoff.contains(NOBLE_GAS)){ - String name = werkstoff.getFluidOrGas(1).getFluid().getName(); - String wrongname ="molten."+name; - FluidStack wrongNamedFluid = FluidRegistry.getFluidStack(wrongname,1); + if (werkstoff.contains(NOBLE_GAS)) { + String name = werkstoff.getFluidOrGas(1).getFluid().getName(); + String wrongname = "molten." + name; + FluidStack wrongNamedFluid = FluidRegistry.getFluidStack(wrongname, 1); + if (wrongNamedFluid != null) { for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { for (GT_Recipe recipe : map.mRecipeList) { for (int i = 0; i < recipe.mFluidInputs.length; i++) { if (GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], wrongNamedFluid)) { Collection col = map.mRecipeFluidMap.get(wrongNamedFluid.getFluid()); map.mRecipeFluidMap.remove(wrongNamedFluid.getFluid()); - map.mRecipeFluidMap.put(werkstoff.getFluidOrGas(1).getFluid(),col); + map.mRecipeFluidMap.put(werkstoff.getFluidOrGas(1).getFluid(), col); recipe.mFluidInputs[i] = werkstoff.getFluidOrGas(recipe.mFluidInputs[i].amount); map.mRecipeFluidNameMap.add(werkstoff.getFluidOrGas(1).getFluid().getName()); } @@ -262,7 +263,8 @@ public final class MainMod { } } } - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(false,null,null,null,null,new FluidStack[]{wrongNamedFluid},new FluidStack[]{werkstoff.getFluidOrGas(1)},1,1,0)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(false, null, null, null, null, new FluidStack[]{wrongNamedFluid}, new FluidStack[]{werkstoff.getFluidOrGas(1)}, 1, 1, 0)); + } } MainMod.runMoltenUnificationEnfocement(werkstoff); MainMod.runUnficationDeleter(werkstoff); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java index 96e69f4cf3..29b78e568e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java @@ -23,6 +23,8 @@ public class PrefixTextureLinker implements Runnable { public void run() { for (OrePrefixes prefixes : OrePrefixes.values()) { + if (prefixes == OrePrefixes.rod) + continue; HashMap curr = new HashMap<>(); if (prefixes.mTextureIndex == -1 && Werkstoff.GenerationFeatures.prefixLogic.get(prefixes) != 0) { Arrays.stream(TextureSet.class.getFields()).filter(field -> field.getName().contains("SET")).forEach(SET -> { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 6e55fd509a..b23afa275c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -37,6 +37,7 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEnti import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaBlastFurnace; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaDistillTower; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.*; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -130,7 +131,7 @@ public class ItemRegistry { public static ItemStack[] diode16A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] energyDistributor = new ItemStack[GT_Values.VN.length]; public static ItemStack[] acidGens = new ItemStack[3]; - public static ItemStack[] megaMachines = new ItemStack[2]; + public static ItemStack[] megaMachines = new ItemStack[3]; public static ItemStack dehp; public static ItemStack thtr; public static ItemStack eic; @@ -192,6 +193,7 @@ public class ItemRegistry { ItemRegistry.cal = new GT_TileEntity_CircuitAssemblyLine(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 7, "CircuitAssemblyLine", "Circuit Assembly Line").getStackForm(1L); ItemRegistry.compressedHatch = new GT_MetaTileEntity_CompressedFluidHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, "CompressedFluidHatch", "Liquid Air Fluid Hatch").getStackForm(1L); ItemRegistry.giantOutputHatch = new GT_MetaTileEntity_GiantOutputHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, "GiantOutputHatch", "Giant Output Hatch").getStackForm(1L); + ItemRegistry.megaMachines[2] = new GT_TileEntity_MegaDistillTower(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, "MegaDistillationTower", "Mega Distillation Tower").getStackForm(1L); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 013a26a6aa..35be05a86e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -254,6 +254,7 @@ public class RecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1000), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[0], 72000, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1002), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[1], 72000, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1126), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[2], 72000, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Nickel.getMolten(5184), new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 800, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), Materials.Tungsten.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), 800, BW_Util.getMachineVoltageFromTier(4)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index ef71506d0e..b8c8be8e4d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -142,6 +142,8 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl continue; BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); + if (this.mEUt > 0) + this.mEUt = -this.mEUt; this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = this.bufferedRecipe.mOutputs; this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 6c90893975..fc76ab719d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -320,6 +320,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl case 8: internalH = 10801; break; + case 9: + internalH = 21601; + break; default: break; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java new file mode 100644 index 0000000000..19e4455a08 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -0,0 +1,230 @@ +package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.google.common.collect.ArrayListMultimap; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DistillationTower; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; + +public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_DistillationTower { + + private static final int CASING_INDEX = 49; + + public GT_TileEntity_MegaDistillTower(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + private GT_TileEntity_MegaDistillTower(String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_TileEntity_MegaDistillTower(this.mName); + } + + @Override + public String[] getDescription() { + return new String[]{ + "Controller Block for the Mega Distillation Tower", + "Size(WxHxD): 15xhx15 (Hollow), with h ranging from 16 to 61", + "Controller (Front bottom)", + "1+ Input Hatch (Any bottom layer casing)", + "1+ Output Bus (Any bottom layer casing)", + "An \"Output Layer\" consists of 5 layers!", + "2-11+ Output Hatch (One or more per Output Layer)", + "1x Maintenance Hatch (Any casing)", + "1+ Energy Hatch (Any casing)", + "Fluids are only put out at the correct height", + "The correct height equals the slot number in the NEI recipe", + "Clean Stainless Steel Machine Casings for the rest (15 x h - 5 at least!)", + StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks" + }; + } + + private short controllerY = 0; + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + LAYERMAP.clear(); + controllerY = aBaseMetaTileEntity.getYCoord(); + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 7; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 7; + int x, z, y = 0, casingAmount = 0; + boolean reachedTop = false; + + IGregTechTileEntity tileEntity; + Block block; + for (x = xDir - 7; x <= xDir + 7; ++x) { + for (z = zDir - 7; z <= zDir + 7; ++z) { + if (x != 0 || z != 0) { + tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z); + block = aBaseMetaTileEntity.getBlockOffset(x, y, z); + if (!this.addInputToMachineList(tileEntity, CASING_INDEX) && !this.addOutputToMachineList(tileEntity, CASING_INDEX) && !this.addMaintenanceToMachineList(tileEntity, CASING_INDEX) && !this.addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { + if (block != GregTech_API.sBlockCasings4 || aBaseMetaTileEntity.getMetaIDOffset(x, y, z) != 1) { + return false; + } + + ++casingAmount; + } + } + } + } + for (y = y + 1; y <= 60 && !reachedTop; ++y) { + for (x = -7; x <= 7; ++x) { + for (z = -7; z <= 7; ++z) { + tileEntity = aBaseMetaTileEntity.getIGregTechTileEntity(aBaseMetaTileEntity.getXCoord() + xDir + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + zDir + z); + block = aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getXCoord() + xDir + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + zDir + z); + final boolean middle = Math.abs(x) < 7 && Math.abs(z) != 7; + if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getXCoord() + xDir + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + zDir + z)) { + if (!middle) { + //aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getXCoord() + xDir + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + zDir + z,GregTech_API.sBlockCasings4,1,2); + return false; + } + } else { + if (middle) { + reachedTop = true; + } + if (!this.addOutputToMachineList(tileEntity, CASING_INDEX) && !this.addMaintenanceToMachineList(tileEntity, CASING_INDEX) && !this.addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { + if (block != GregTech_API.sBlockCasings4 || aBaseMetaTileEntity.getMetaID(aBaseMetaTileEntity.getXCoord() + xDir + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + zDir + z) != 1) { + return false; + } + + ++casingAmount; + } + } + } + } + } + + return casingAmount >= 15 * y - 5 && y >= 16 && y <= 61 && reachedTop; + } + + @Override + public boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (super.addOutputToMachineList(aTileEntity, aBaseCasingIndex)) { + if (aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output) { + int layer = aTileEntity.getYCoord() - controllerY; + layer = (int) Math.ceil(((double)layer) /5D)-1; + LAYERMAP.put(layer,(GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity()); + } + return true; + } + return false; + } + + @Override + protected void addFluidOutputs(FluidStack[] mOutputFluids2) { + for (int i = 0; i < mOutputFluids2.length; i++) { + for (int j = 0; j < LAYERMAP.get(i).size(); j++) { + LAYERMAP.get(i).get(j).fill(new FluidStack(mOutputFluids2[i],mOutputFluids2[i].amount/LAYERMAP.get(i).size()), true); + } + } + } + + private final ArrayListMultimap LAYERMAP = ArrayListMultimap.create(); + + @Override + public boolean checkRecipe(ItemStack aStack) { + ArrayList tFluidList = this.getStoredFluids(); + + for (int i = 0; i < tFluidList.size() - 1; ++i) { + for (int j = i + 1; j < tFluidList.size(); ++j) { + if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { + if (tFluidList.get(i).amount < tFluidList.get(j).amount) { + tFluidList.remove(i--); + break; + } + tFluidList.remove(j--); + } + } + } + + long tVoltage = this.getMaxInputVoltage(); + byte tTier = (byte) Math.max(0, GT_Utility.getTier(tVoltage)); + + long nominalV = BW_Util.getnominalVoltage(this); + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); + if (tFluids.length > 0) { + for (FluidStack tFluid : tFluids) { + ArrayList outputFluids = new ArrayList<>(); + int processed = 0; + boolean found_Recipe = false; + FluidStack[] output; + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(this.getBaseMetaTileEntity(), false, GT_Values.V[tTier], new FluidStack[]{tFluid}); + while (this.getStoredFluids().size() > 0 && processed < ConfigHandler.megaMachinesMax) { + if (tRecipe != null && (tRecipe.mEUt * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, tFluids)) { + found_Recipe = true; + if (tRecipe.mFluidOutputs.length == 1 && tRecipe.mFluidOutputs[0].amount == 0) + tRecipe.mFluidOutputs[0].amount = tRecipe.mFluidInputs[0].amount; + output = new FluidStack[tRecipe.mFluidOutputs.length]; + for (int i = 0; i < output.length; i++) { + output[i] = new FluidStack(tRecipe.mFluidOutputs[i],tRecipe.mFluidOutputs[i].amount); + } + outputFluids.add(output); + ++processed; + } else + break; + } + if (!found_Recipe) + continue; + for (int j = 1; j < outputFluids.size(); j++) { + for (int k = 0; k < outputFluids.get(j).length; k++) { + outputFluids.get(0)[k].amount += outputFluids.get(j)[k].amount; + } + } + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + long actualEUT = (long) (tRecipe.mEUt) * processed; + if (actualEUT > Integer.MAX_VALUE) { + byte divider = 0; + while (actualEUT > Integer.MAX_VALUE) { + actualEUT = actualEUT / 2; + divider++; + } + BW_Util.calculateOverclockedNessMulti((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), 1, nominalV, this); + } else + BW_Util.calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, nominalV, this); + //In case recipe is too OP for that machine + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputFluids = outputFluids.get(0).clone(); + if (tRecipe.getOutput(0) != null) { + int stacks = processed / 64; + ItemStack[] outputs = new ItemStack[stacks]; + if (stacks > 0) { + for (int i = 0; i < stacks; i++) + if (i != stacks - 1) + outputs[i] = tRecipe.getOutput(0).splitStack(64); + else + outputs[i] = tRecipe.getOutput(0).splitStack(processed - (64 * i)); + this.mOutputItems = outputs; + } else + this.mOutputItems = null; + } else + this.mOutputItems = null; + this.updateSlots(); + return true; + } + } + return false; + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java index 8cd06481d3..6befd36ba6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -28,7 +28,7 @@ import static com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement. public class BWGTMetaItems extends BW_MetaGenerated_Items { - boolean hasList; + private boolean hasList; public BWGTMetaItems(OrePrefixes orePrefixes, List noSubIDMaterials) { super(orePrefixes,null); @@ -36,7 +36,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { for (int i = 0; i < Materials.values().length; i++) { ItemStack tStack = new ItemStack(this, 1, i); Materials w = Materials.values()[i]; - if (!((w.getMolten(1) != null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) != null || w.getGas(1) != null) && orePrefixes == OrePrefixes.capsule))) + if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) @@ -54,7 +54,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { for (int i = 0; i < noSubIDMaterials.size(); i++) { ItemStack tStack = new ItemStack(this, 1, i+1001); Materials w = (Materials) noSubIDMaterials.get(i); - if (!((w.getMolten(1) != null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) != null || w.getGas(1) != null) && orePrefixes == OrePrefixes.capsule))) + if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) @@ -100,16 +100,19 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { Materials w = Materials.values()[i]; if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes) != 0) continue; - if ((w.getMolten(1) != null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) != null || w.getGas(1) != null) && orePrefixes == OrePrefixes.capsule)) - aList.add(new ItemStack(this, 1, i)); - } - for (int i = 0; i < NoMetaValue.size(); i++) { - Materials w = NoMetaValue.get(i); - if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes) != 0) + else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; - if (hasList && ((w.getMolten(1) != null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) != null || w.getGas(1) != null) && orePrefixes == OrePrefixes.capsule))) - aList.add(new ItemStack(this, 1, i+1001)); + aList.add(new ItemStack(this, 1, i)); } + if (hasList) + for (int i = 0; i < NoMetaValue.size(); i++) { + Materials w = NoMetaValue.get(i); + if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes) != 0) + continue; + else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) + continue; + aList.add(new ItemStack(this, 1, i + 1001)); + } } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java index 35214f636c..c0f8aa51ac 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -8,6 +8,7 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; @@ -20,12 +21,12 @@ import java.util.stream.Collectors; public class GTMetaItemEnhancer { static List NoMetaValue; - static{ if (Loader.isModLoaded("Forestry")) { NoMetaValue = Materials.getMaterialsMap().values().stream().filter(m -> m.mMetaItemSubID == -1).collect(Collectors.toList()); Item moltenCapsuls = new BWGTMetaItems(WerkstoffLoader.capsuleMolten, null); Item capsuls = new BWGTMetaItems(OrePrefixes.capsule, NoMetaValue); + //Item bottles = new BWGTMetaItems(OrePrefixes.bottle, NoMetaValue); Materials[] values = Materials.values(); for (int i = 0, valuesLength = values.length; i < valuesLength; i++) { @@ -37,27 +38,29 @@ public class GTMetaItemEnhancer { GT_Values.RA.addFluidCannerRecipe(GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1), new ItemStack(moltenCapsuls, 1, i), m.getMolten(144), GT_Values.NF); GT_Values.RA.addFluidCannerRecipe(new ItemStack(moltenCapsuls, 1, i), GT_Values.NI, GT_Values.NF, m.getMolten(144)); } - if (m.hasCorrespondingFluid() || m.hasCorrespondingGas()) { - Fluid f = m.hasCorrespondingFluid() ? m.getFluid(1).getFluid() : m.getGas(1).getFluid(); - final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(f, 1000), new ItemStack(capsuls, 1, i), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1)); - FluidContainerRegistry.registerFluidContainer(emptyData); - GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe(GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), new ItemStack(capsuls, 1, i), new FluidStack(f, 1000), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(new ItemStack(capsuls, 1, i), GT_Values.NI, GT_Values.NF, new FluidStack(f, 1000)); + if (m.getFluid(1) != null || m.getGas(1) != null) { + addFluidData(m,GT_ModHandler.getModItem("Forestry", "waxCapsule", 1),capsuls,1000,i,true); + // addFluidData(m,new ItemStack(Items.glass_bottle),bottles,250,i,false); } } for (int i = 0, valuesLength = NoMetaValue.size(); i < valuesLength; i++) { Materials m = NoMetaValue.get(i); if (m.getFluid(1) != null || m.getGas(1) != null) { - Fluid f = m.hasCorrespondingFluid() ? m.getFluid(1).getFluid() : m.getGas(1).getFluid(); - final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(f, 1000), new ItemStack(capsuls, 1, i + 1001), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1)); - FluidContainerRegistry.registerFluidContainer(emptyData); - GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe(GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), new ItemStack(capsuls, 1, i + 1001), new FluidStack(f, 1000), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(new ItemStack(capsuls, 1, i + 1001), GT_Values.NI, GT_Values.NF, new FluidStack(f, 1000)); + addFluidData(m,GT_ModHandler.getModItem("Forestry", "waxCapsule", 1),capsuls,1000,i + 1001,true); + // addFluidData(m,new ItemStack(Items.glass_bottle),bottles,250,i + 1001,false); } } + } } + private static void addFluidData(Materials m, ItemStack container, Item filled,int amount, int it, boolean empty){ + Fluid f = m.getFluid(1) != null ? m.getFluid(1).getFluid() : m.getGas(1).getFluid(); + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(f, amount), new ItemStack(filled, 1, it), container); + FluidContainerRegistry.registerFluidContainer(emptyData); + GT_Utility.addFluidContainerData(emptyData); + GT_Values.RA.addFluidCannerRecipe(container, new ItemStack(filled, 1, it), new FluidStack(f, amount), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(new ItemStack(filled, 1, it), empty ? GT_Values.NI : container, GT_Values.NF, new FluidStack(f, amount)); + } + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java index e5467ea8c3..bba6f66547 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java @@ -31,9 +31,8 @@ import java.util.List; public class ThreadedLoader implements Runnable { - List threads = new ArrayList<>(); - List threadsInit = new ArrayList<>(); - + private List threads = new ArrayList<>(); + private List threadsInit = new ArrayList<>(); @Override public synchronized void run() { @@ -66,19 +65,20 @@ public class ThreadedLoader implements Runnable { WerkstoffLoader.INSTANCE.gameRegistryHandler(); } - class AllRecipes extends Thread { + static class AllRecipes extends Thread { public synchronized void run() { WerkstoffLoader.INSTANCE.run(); } + } - class MaterialGen extends Thread { + static class MaterialGen extends Thread { + public synchronized void run() { WerkstoffLoader.INSTANCE.runInit(); } - } - + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index ac1d96bc9b..bb2e825bb9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -208,7 +208,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (p.getKey() instanceof Werkstoff) set.addAll(Arrays.asList(((Werkstoff) p.getKey()).getTCAspects())); } - tc_aspectStacks.forEach(tc_aspectStack -> set.add(new Pair(tc_aspectStack.mAspect.mAspect, (int) tc_aspectStack.mAmount))); + tc_aspectStacks.forEach(tc_aspectStack -> set.add(new Pair<>(tc_aspectStack.mAspect.mAspect, (int) tc_aspectStack.mAmount))); this.stats.mTC_Aspects = set.toArray(new Pair[0]); } Pair[] ret = this.stats.mTC_Aspects.clone(); @@ -219,15 +219,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public List getGTWrappedTCAspects() { - List ret = new ArrayList<>(); - try { - Pair[] aspectArray = getTCAspects(); - TC_Aspects.TC_AspectStack stack = null; - for (Pair objectIntegerPair : aspectArray) { - stack = new TC_Aspects.TC_AspectStack(TC_Aspects.valueOf(((String) ThaumcraftHandler.AspectAdder.getName.invoke(objectIntegerPair.getKey())).toUpperCase(Locale.US)) , objectIntegerPair.getValue()); - stack.addToAspectList(ret); - } - }catch( InvocationTargetException | IllegalAccessException ignored){} + final List ret = new ArrayList<>(); + Arrays.stream(getTCAspects()).forEach(objectIntegerPair -> { + try { + new TC_Aspects.TC_AspectStack(TC_Aspects.valueOf(((String) ThaumcraftHandler.AspectAdder.getName.invoke(objectIntegerPair.getKey())).toUpperCase(Locale.US)), objectIntegerPair.getValue()).addToAspectList(ret); + } catch (IllegalAccessException | InvocationTargetException ignored) {} + }); return ret; } @@ -452,6 +449,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.cell,0b10000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.capsule,0b10000); + // Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.bottle,0b10000); Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.capsuleMolten,0b1000000); Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten,0b1000000); @@ -763,6 +761,16 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } + byte enchantmentlvl = 3; + + public byte getEnchantmentlvl() { + return enchantmentlvl; + } + + public void setEnchantmentlvl(byte enchantmentlvl) { + this.enchantmentlvl = enchantmentlvl; + } + public boolean isRadioactive() { return (this.quality & 0b100) != 0; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 9158de5a89..9a2cafa2d6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -44,6 +44,7 @@ import cpw.mods.fml.common.ProgressManager; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.GT_Mod; import gregtech.api.GregTech_API; +import gregtech.api.enchants.Enchantment_Radioactivity; import gregtech.api.enums.*; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_Fluid; @@ -123,6 +124,7 @@ public class WerkstoffLoader implements Runnable { capsule.mMaterialGenerationBits = 0b100000; capsule.mDefaultStackSize = 64; } + bottle.mDefaultStackSize = 1; } //TODO: FREE ID RANGE: 91-32766 @@ -1545,7 +1547,7 @@ public class WerkstoffLoader implements Runnable { } private static void runGTItemDataRegistrator() { - HashSet toRem = new HashSet<>(); + // HashSet toRem = new HashSet<>(); for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { //int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, String aConfigSection, boolean aCustomOre, String aCustomID Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : @@ -1608,10 +1610,15 @@ public class WerkstoffLoader implements Runnable { f.set(werkstoffBridgeMaterial, werkstoff.getDefaultName()); } catch (NoSuchFieldException | IllegalAccessException ignored){} werkstoffBridgeMaterial.mChemicalFormula = werkstoff.getToolTip(); - werkstoffBridgeMaterial.mAspects=werkstoff.getGTWrappedTCAspects(); + if (Loader.isModLoaded("Thaumcraft")) + werkstoffBridgeMaterial.mAspects=werkstoff.getGTWrappedTCAspects(); werkstoffBridgeMaterial.mMaterialInto = werkstoffBridgeMaterial; werkstoffBridgeMaterial.mHandleMaterial = werkstoff.contains(SubTag.BURNING) ? Materials.Blaze : werkstoff.contains(SubTag.MAGICAL) ? Materials.Thaumium : werkstoffBridgeMaterial.mDurability > 5120 ? Materials.TungstenSteel : werkstoffBridgeMaterial.mDurability > 1280 ? Materials.Steel : Materials.Wood; - toRem.add(werkstoffBridgeMaterial); + //toRem.add(werkstoffBridgeMaterial); + if (werkstoff.getStats().isRadioactive()){ + werkstoffBridgeMaterial.setEnchantmentForArmors(Enchantment_Radioactivity.INSTANCE,werkstoff.getStats().getEnchantmentlvl()); + werkstoffBridgeMaterial.setEnchantmentForTools(Enchantment_Radioactivity.INSTANCE,werkstoff.getStats().getEnchantmentlvl()); + } werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); if (WerkstoffLoader.items.get(prefixes) != null) if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0 && werkstoff.get(prefixes) != null && werkstoff.get(prefixes).getItem() != null) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java index f7f2298c28..0db95667ae 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java @@ -47,7 +47,7 @@ import static gregtech.api.enums.GT_Values.V; public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlockBase { - List mEssentiaHatches = new ArrayList<>(); + private List mEssentiaHatches = new ArrayList<>(); public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity.getClass().isInstance(EMTHandler.aEssentiaInputHatch)) @@ -75,7 +75,7 @@ public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlo super(aID, aName, aNameRegional); } - public GT_Industrial_Alchemic_Construct(String aName) { + private GT_Industrial_Alchemic_Construct(String aName) { super(aName); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java new file mode 100644 index 0000000000..ffc3c9f756 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java @@ -0,0 +1,98 @@ +package com.github.bartimaeusnek.crossmod.galaxySpace.tileEntity; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import micdoodle8.mods.galacticraft.core.GalacticraftCore; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ResourceLocation; + +public class DysonSwarmSunReplacement extends MetaTileEntity { + private static boolean wasBuild; + private static long dysonObjs; + private static long swarmControllers; + + + public DysonSwarmSunReplacement(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) { + super(aID, aBasicName, aRegionalName, aInvSlotCount); + } + + private DysonSwarmSunReplacement(String aName, int aInvSlotCount) { + super(aName, aInvSlotCount); + } + + + public void toggle(){ + if (!wasBuild) { + GalacticraftCore.solarSystemSol.getMainStar().setBodyIcon(new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/moon.png")); + wasBuild = !wasBuild; + } else { + GalacticraftCore.solarSystemSol.getMainStar().setBodyIcon(new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/sun.png")); + wasBuild = !wasBuild; + } + } + + @Override + public byte getTileEntityBaseType() { + return 2; + } + + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + ++swarmControllers; + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + toggle(); + return super.onRightclick(aBaseMetaTileEntity, aPlayer); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new DysonSwarmSunReplacement(this.mName,this.mInventory.length); + } + + @Override + public void saveNBTData(NBTTagCompound nbtTagCompound) { + nbtTagCompound.setLong("dysonObjs", dysonObjs); + } + + @Override + public void loadNBTData(NBTTagCompound nbtTagCompound) { + dysonObjs = Math.max(dysonObjs, nbtTagCompound.getLong("dysonObjs")); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + aBaseMetaTileEntity.increaseStoredEnergyUnits((DysonSwarmSunReplacement.dysonObjs*10000)/ swarmControllers, true); + } + + public boolean isEnetOutput() { + return true; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public String[] getDescription() { + return new String[0]; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + return new ITexture[0]; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java new file mode 100644 index 0000000000..c03a8f5f04 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java @@ -0,0 +1,58 @@ +package com.github.bartimaeusnek.crossmod.galaxySpace.tileEntity; + +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class GalaxySpaceProxy { + + private GalaxySpaceProxy() { + } + + public static void postInit(FMLPostInitializationEvent e){ + + } + + public static void preInit(FMLPreInitializationEvent e) { + + } + + private static void serverpreInit(FMLPreInitializationEvent e) { + + } + + private static void clientpreInit(FMLPreInitializationEvent e) { + } + + private static void commonpreInit(FMLPreInitializationEvent e) { + + } + + public static void init(FMLInitializationEvent e) { + + } + + private static void serverInit(FMLInitializationEvent e) { + + } + + private static void clientInit(FMLInitializationEvent e) { + + } + + private static void commonInit(FMLInitializationEvent e) { + + } + private static void serverPostInit(FMLPostInitializationEvent e) { + + } + + private static void clientPostInit(FMLPostInitializationEvent e) { + + } + + private static void commonPostInit(FMLPostInitializationEvent e) { + + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index 3486b52135..5396f872ec 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -150,13 +150,13 @@ public class ThaumcraftHandler { for (OrePrefixes element : OrePrefixes.values()) { if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(element)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(element)) == 0) { if (element.mMaterialAmount >= 3628800L || element == OrePrefixes.ore) { - DebugLog.log("OrePrefix: "+element.name() + " mMaterialAmount: " + element.mMaterialAmount/3628800L); + DebugLog.log("OrePrefix: " + element.name() + " mMaterialAmount: " + element.mMaterialAmount/3628800L); if (WerkstoffLoader.items.get(element) != null) ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), werkstoff.getTCAspects(element == OrePrefixes.ore ? 1 : (int) (element.mMaterialAmount / 3628800L))); } else if (element.mMaterialAmount >= 0L) { if (WerkstoffLoader.items.get(element) != null) - ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), new Pair(TC_Aspects.PERDITIO.mAspect, 1)); + ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), new Pair<>(TC_Aspects.PERDITIO.mAspect, 1)); } } } diff --git a/src/main/resources/assets/gregtech/textures/items/gt.Core_Reactor_Cell.png b/src/main/resources/assets/gregtech/textures/items/gt.Core_Reactor_Cell.png new file mode 100644 index 0000000000..e372f01092 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.Core_Reactor_Cell.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.Core_Reactor_CellDep.png b/src/main/resources/assets/gregtech/textures/items/gt.Core_Reactor_CellDep.png new file mode 100644 index 0000000000..b0836b8d41 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.Core_Reactor_CellDep.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/bottle_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/bottle.png b/src/main/resources/assets/gregtech/textures/items/materialicons/bottle.png new file mode 100644 index 0000000000..dbf735f4fb Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/bottle.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/bottle_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/bottle_OVERLAY.png new file mode 100644 index 0000000000..66bd26dc46 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/bottle_OVERLAY.png differ -- cgit From 34e37d0a903e2345daf39efa1cfda6a7fc3b01bd Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 11 Oct 2019 12:16:06 +0200 Subject: Sifter Bug fix +added an ASM line to disable the 12% bonus on the GT++ Sifter +removed unused ASM Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: e72b36764a4417b3393eb06cc7ca310a0d623e3a --- .../java/com/github/bartimaeusnek/ASM/BWCore.java | 2 + .../bartimaeusnek/ASM/BWCoreTransformer.java | 155 ++------------------- 2 files changed, 11 insertions(+), 146 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java index 1208a05744..7b25541cc3 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java @@ -64,6 +64,7 @@ public class BWCore extends DummyModContainer { shouldTransform[3] = Loader.isModLoaded("Thaumcraft") && ConfigHandler.enabledPatches[3]; shouldTransform[4] = true; shouldTransform[5] = Loader.isModLoaded("RWG") && ConfigHandler.enabledPatches[5]; + shouldTransform[6] = true; BWCore.BWCORE_LOG.info("Extra Utilities found and ASM Patch enabled? " + shouldTransform[0]); BWCore.BWCORE_LOG.info("Thaumcraft found and ASM Patch enabled? " + shouldTransform[3]); BWCore.BWCORE_LOG.info("RWG found and ASM Patch enabled? " + shouldTransform[5]); @@ -74,6 +75,7 @@ public class BWCore extends DummyModContainer { List ret = new ArrayList<>(); ret.add(new DefaultArtifactVersion("ExtraUtilities", true)); ret.add(new DefaultArtifactVersion("Thaumcraft", true)); + ret.add(new DefaultArtifactVersion("miscutils", true)); ret.add(new DefaultArtifactVersion("RWG", true)); ret.add(new DefaultArtifactVersion("gregtech", true)); ret.add(new DefaultArtifactVersion(MainMod.MOD_ID, true)); diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index bd395ea175..9c0afeefc2 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -40,8 +40,8 @@ public class BWCoreTransformer implements IClassTransformer { "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS", "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", "PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API", - "DUCTTAPING RWG WORLDEN FAILS" - // "ADD EXECTION HANDLEING TO FIND OREIDS/OREDICT" + "DUCTTAPING RWG WORLDEN FAILS", + "REMOVING 12% BONUS OUTPUTS FROM GT++ SIFTER" }; public static final String[] CLASSESBEEINGTRANSFORMED = { "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", @@ -49,8 +49,8 @@ public class BWCoreTransformer implements IClassTransformer { "net.minecraft.client.renderer.RenderGlobal", "thaumcraft.common.tiles.TileWandPedestal", "gregtech.GT_Mod", - "rwg.world.ChunkGeneratorRealistic" - // "net.minecraftforge.oredict.OreDictionary" + "rwg.world.ChunkGeneratorRealistic", + "gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialSifter" }; static boolean obfs; @@ -286,146 +286,11 @@ public class BWCoreTransformer implements IClassTransformer { break scase; } } - -// String name_deObfs = "getOreIDs"; -// String dsc_deObfs = "(Lnet/minecraft/item/ItemStack;)[I"; -// String dsc_Obfs = "(Ladd;)[I"; -// -// for (int i = 0; i < methods.size(); i++) { -// if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs) && ASMUtils.isCorrectMethod(methods.get(i), dsc_deObfs, dsc_Obfs)) { -// MethodNode toPatch = methods.get(i); -// LabelNode[] LabelNodes = {new LabelNode(), new LabelNode(), new LabelNode(),new LabelNode(),new LabelNode(),new LabelNode(),new LabelNode()}; -// InsnList nu = new InsnList(); -// nu.add(new VarInsnNode(ALOAD, 0)); -// nu.add(new JumpInsnNode(IFNULL, LabelNodes[0])); //L1 -// nu.add(new VarInsnNode(ALOAD, 0)); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false)); -// nu.add(new JumpInsnNode(IFNONNULL, LabelNodes[1])); //L2 -// nu.add(LabelNodes[0]); //L1 -// nu.add(new TypeInsnNode(NEW, "java/lang/IllegalArgumentException")); -// nu.add(new InsnNode(DUP)); -// nu.add(new TypeInsnNode(LDC,"Stack can not be invalid!")); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL,"java/lang/IllegalArgumentException","","(Ljava/lang/String;)V",false)); -// nu.add(new InsnNode(ATHROW)); -// nu.add(LabelNodes[1]); //L2 -// nu.add(new TypeInsnNode(NEW, "java/util/HashSet")); -// nu.add(new InsnNode(DUP)); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL,"java/util/HashSet","","()V",false)); -// nu.add(new VarInsnNode(ASTORE, 1)); -// nu.add(new VarInsnNode(ALOAD, 0)); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItem", "()Lnet/minecraft/item/Item;", false)); -// nu.add(new FieldInsnNode(GETFIELD,"net/minecraft/item/Item","delegate","Lcpw/mods/fml/common/registry/RegistryDelegate;")); -// nu.add(new MethodInsnNode(INVOKEINTERFACE, "cpw/mods/fml/common/registry/RegistryDelegate", "name", "()Ljava/lang/String;", true)); -// nu.add(new VarInsnNode(ASTORE, 2)); -// nu.add(new VarInsnNode(ALOAD, 2)); -// nu.add(new JumpInsnNode(IFNONNULL, LabelNodes[2])); //L5 -// nu.add(new FieldInsnNode(GETSTATIC,"org/apache/logging/log4j/Level","DEBUG","Lorg/apache/logging/log4j/Level;")); -// nu.add(new TypeInsnNode(LDC,"Attempted to find the oreIDs for an unregistered object (%s). This won't work very well.")); -// nu.add(new InsnNode(ICONST_1)); -// nu.add(new TypeInsnNode(ANEWARRAY,"java/lang/Object")); -// nu.add(new InsnNode(DUP)); -// nu.add(new InsnNode(ICONST_0)); -// nu.add(new VarInsnNode(ALOAD, 0)); -// nu.add(new InsnNode(AASTORE)); -// nu.add(new MethodInsnNode(INVOKESTATIC, "cpw/mods/fml/common/FMLLog", "log", "(Lorg/apache/logging/log4j/Level;Ljava/lang/String;[Ljava/lang/Object;)V", false)); -// nu.add(new TypeInsnNode(NEW, "java/io/StringWriter")); -// nu.add(new InsnNode(DUP)); -// nu.add(new MethodInsnNode(INVOKESPECIAL, "java/io/StringWriter", "", "()V", false)); -// nu.add(new VarInsnNode(ASTORE, 4)); -// nu.add(new TypeInsnNode(NEW, "java/io/PrintWriter")); -// nu.add(new InsnNode(DUP)); -// nu.add(new VarInsnNode(ALOAD, 4)); -// nu.add(new MethodInsnNode(INVOKESPECIAL, "java/io/PrintWriter", "", "(Ljava/io/Writer;)V", false)); -// nu.add(new VarInsnNode(ASTORE, 5)); -// nu.add(new TypeInsnNode(NEW, "java/lang/Exception")); -// nu.add(new InsnNode(DUP)); -// nu.add(new TypeInsnNode(LDC,"FINDME!")); -// nu.add(new MethodInsnNode(INVOKESPECIAL, "java/lang/Exception", "", "(Ljava/lang/String;)V", false)); -// nu.add(new VarInsnNode(ALOAD, 5)); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "java/lang/Exception", "printStackTrace", "(Ljava/io/PrintWriter;)V", false)); -// nu.add(new FieldInsnNode(GETSTATIC,"org/apache/logging/log4j/Level","DEBUG","Lorg/apache/logging/log4j/Level;")); -// nu.add(new VarInsnNode(ALOAD, 5)); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "java/lang/Object", "toString", "()Ljava/lang/String;", false)); -// nu.add(new InsnNode(ICONST_0)); -// nu.add(new TypeInsnNode(ANEWARRAY,"java/lang/Object")); -// nu.add(new MethodInsnNode(INVOKESTATIC, "cpw/mods/fml/common/FMLLog", "log", "(Lorg/apache/logging/log4j/Level;Ljava/lang/String;[Ljava/lang/Object;)V", false)); -// nu.add(new InsnNode(ICONST_0)); -// nu.add(new IntInsnNode(NEWARRAY,T_INT)); -// nu.add(new InsnNode(ARETURN)); -// nu.add(LabelNodes[2]); //L5 -// nu.add(new MethodInsnNode(INVOKESTATIC, "cpw/mods/fml/common/registry/GameData", "getItemRegistry", "()Lcpw/mods/fml/common/registry/FMLControlledNamespacedRegistry;", false)); -// nu.add(new VarInsnNode(ALOAD, 2)); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry", "getId", "(Ljava/lang/String;)I", false)); -// nu.add(new VarInsnNode(ISTORE, 3)); -// nu.add(new FieldInsnNode(GETSTATIC,"net/minecraftforge/oredict/OreDictionary","stackToId","Ljava/util/Map;")); -// nu.add(new VarInsnNode(ILOAD, 3)); -// nu.add(new MethodInsnNode(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false)); -// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", false)); -// nu.add(new TypeInsnNode(CHECKCAST,"java/util/List")); -// nu.add(new VarInsnNode(ASTORE, 4)); -// nu.add(new VarInsnNode(ALOAD, 4)); -// nu.add(new JumpInsnNode(IFNULL, LabelNodes[3])); //L14 -// nu.add(new VarInsnNode(ALOAD, 1)); -// nu.add(new VarInsnNode(ALOAD, 4)); -// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Set", "addAll", "(Ljava/util/Collection;)Z", true)); -// nu.add(new InsnNode(POP)); -// nu.add(LabelNodes[3]); //L14 -// nu.add(new FieldInsnNode(GETSTATIC,"net/minecraftforge/oredict/OreDictionary","stackToId","Ljava/util/Map;")); -// nu.add(new VarInsnNode(ILOAD, 3)); -// nu.add(new VarInsnNode(ALOAD, 0)); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/item/ItemStack", "getItemDamage", "()I", false)); -// nu.add(new InsnNode(ICONST_1)); -// nu.add(new InsnNode(IADD)); -// nu.add(new VarInsnNode(BIPUSH, 16)); -// nu.add(new InsnNode(ISHL)); -// nu.add(new InsnNode(IOR)); -// nu.add(new MethodInsnNode(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false)); -// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true)); -// nu.add(new TypeInsnNode(CHECKCAST,"java/util/List")); -// nu.add(new VarInsnNode(ASTORE, 4)); -// nu.add(new VarInsnNode(ALOAD, 4)); -// nu.add(new JumpInsnNode(IFNULL, LabelNodes[4])); //L16 -// nu.add(new VarInsnNode(ALOAD, 1)); -// nu.add(new VarInsnNode(ALOAD, 4)); -// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Set", "addAll", "(Ljava/util/Collection;)Z", true)); -// nu.add(new InsnNode(POP)); -// nu.add(LabelNodes[4]); //L16 -// nu.add(new VarInsnNode(ALOAD, 1)); -// nu.add(new VarInsnNode(ALOAD, 1)); -// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Set", "size", "()I", true)); -// nu.add(new TypeInsnNode(ANEWARRAY,"java/lang/Integer")); -// nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/Set", "toArray", "([Ljava/lang/Object;)[Ljava/lang/Object;", true)); -// nu.add(new TypeInsnNode(CHECKCAST,"[java/util/Integer")); -// nu.add(new VarInsnNode(ASTORE, 5)); -// nu.add(new VarInsnNode(ALOAD, 5)); -// nu.add(new InsnNode(ARRAYLENGTH)); -// nu.add(new IntInsnNode(NEWARRAY,T_INT)); -// nu.add(new VarInsnNode(ASTORE, 6)); -// nu.add(new InsnNode(ICONST_0)); -// nu.add(new VarInsnNode(ISTORE, 7)); -// nu.add(LabelNodes[6]); //L19 -// nu.add(new VarInsnNode(ILOAD, 7)); -// nu.add(new VarInsnNode(ALOAD, 5)); -// nu.add(new InsnNode(ARRAYLENGTH)); -// nu.add(new JumpInsnNode(IF_ICMPGE, LabelNodes[5])); //L20 -// nu.add(new VarInsnNode(ALOAD, 6)); -// nu.add(new VarInsnNode(ILOAD, 7)); -// nu.add(new VarInsnNode(ALOAD, 5)); -// nu.add(new VarInsnNode(ILOAD, 7)); -// nu.add(new InsnNode(AALOAD)); -// nu.add(new MethodInsnNode(INVOKEVIRTUAL, "java/lang/Integer", "intValue", "()I", false)); -// nu.add(new InsnNode(IASTORE)); -// nu.add(new IincInsnNode(7,1)); -// nu.add(new JumpInsnNode(GOTO, LabelNodes[6])); //L19 -// nu.add(LabelNodes[5]); //L20 -// nu.add(new VarInsnNode(ALOAD, 6)); -// nu.add(new InsnNode(ARETURN)); -// toPatch.instructions = nu; -// toPatch.maxStack = 6; -// toPatch.maxLocals = 8; -// methods.set(i, toPatch); -// break; -// } + } + case 6: { + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + ((IntInsnNode) methods.get(11).instructions.get(10)).operand = 10000; + break scase; } default: { BWCore.BWCORE_LOG.info("Could not find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); @@ -452,6 +317,4 @@ public class BWCoreTransformer implements IClassTransformer { } return basicClass; } - - } -- cgit From fbf4c6b162fd752570b65a0f719c4b3b0b840858 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 11 Oct 2019 13:38:34 +0200 Subject: updated gradle deps +version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 298be7ee279e420b20a4093e805e2c447ddfddb8 --- build.gradle | 4 +++- build.properties | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index bd21e845de..af53e98bbf 100644 --- a/build.gradle +++ b/build.gradle @@ -92,11 +92,13 @@ repositories { dependencies { compile "net.industrial-craft:industrialcraft-2:${config.ic2.version}:dev" - compileOnly "applecore:AppleCore:${config.applecore.version}:api" compile "micdoodle8.mods:MicdoodleCore:${config.galacticraft.version}:Dev" compile "micdoodle8.mods:GalacticraftCore:${config.galacticraft.version}:Dev" compile "micdoodle8.mods:Galacticraft-Planets:${config.galacticraft.version}:Dev" compile "li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api" + compileOnly "applecore:AppleCore:${config.applecore.version}:api" + compileOnly "com.enderio.core:EnderCore:${config.enderiocore.version}:dev" + compileOnly "com.enderio:EnderIO:${config.enderio.version}:dev" } //task getGregTech(type: Download) { diff --git a/build.properties b/build.properties index 116283303f..91a4eb39d7 100644 --- a/build.properties +++ b/build.properties @@ -23,10 +23,12 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre16 +buildNumber=2_pre17 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 applecore.version=1.7.10-3.1.1 -galacticraft.version=1.7-3.0.12.504 \ No newline at end of file +galacticraft.version=1.7-3.0.12.504 +enderio.version=1.7.10-2.3.0.417_beta +enderiocore.version=1.7.10-0.1.0.25_beta \ No newline at end of file -- cgit From 08ccc497fb99d0af2eaa999743a8024356f40be3 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 11 Oct 2019 21:09:04 +0200 Subject: Gradle fix (#39) * update gradle Former-commit-id: 116d83e0fb0dfb24a4bab656ba9c342e62cebead --- build.gradle | 19 +++++++++++++++---- build.properties | 4 ++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index af53e98bbf..2954d6f60d 100644 --- a/build.gradle +++ b/build.gradle @@ -99,6 +99,17 @@ dependencies { compileOnly "applecore:AppleCore:${config.applecore.version}:api" compileOnly "com.enderio.core:EnderCore:${config.enderiocore.version}:dev" compileOnly "com.enderio:EnderIO:${config.enderio.version}:dev" + compileOnly "com.enderio:EnderIO:${config.enderio.version}:dev" +} + +task getRailCraft(type: Download) { + onlyIf { + !file("libs/Railcraft_1.7.10-9.12.2.0-dev.jar").exists() + } + src 'http://downloads.gtnewhorizons.com/Mods_for_Jenkins/Railcraft_1.7.10-9.12.2.0-dev.jar' + dest file("libs/Railcraft_1.7.10-9.12.2.0-dev.jar") + mustRunAfter "deobfBinJar" + mustRunAfter "repackMinecraft" } //task getGregTech(type: Download) { @@ -111,10 +122,10 @@ dependencies { // mustRunAfter "repackMinecraft" //} -//tasks.setupCIWorkspace.dependsOn getGregTech -//tasks.setupDevWorkspace.dependsOn getGregTech -//tasks.setupDecompWorkspace.dependsOn getGregTech -//tasks.compileJava.dependsOn getGregTech +tasks.setupCIWorkspace.dependsOn getRailCraft +tasks.setupDevWorkspace.dependsOn getRailCraft +tasks.setupDecompWorkspace.dependsOn getRailCraft +tasks.compileJava.dependsOn getRailCraft processResources { diff --git a/build.properties b/build.properties index 91a4eb39d7..aa9a58c099 100644 --- a/build.properties +++ b/build.properties @@ -30,5 +30,5 @@ gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 applecore.version=1.7.10-3.1.1 galacticraft.version=1.7-3.0.12.504 -enderio.version=1.7.10-2.3.0.417_beta -enderiocore.version=1.7.10-0.1.0.25_beta \ No newline at end of file +enderio.version=1.7.10-2.3.0.429_beta +enderiocore.version=1.7.10-0.2.0.39_beta \ No newline at end of file -- cgit From d3f0b24afd94711786063bccaf7716c78402e8af Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 11 Oct 2019 21:10:47 +0200 Subject: added TecTech handler Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 9d40a13aa3cef2a1e87521147628fa2487a2e13c --- .../bartworks/common/loaders/RecipeLoader.java | 3 +- .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 4 ++ .../crossmod/tectech/TecTechResearchLoader.java | 60 ++++++++++++++++++++++ 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 35be05a86e..1f9968c9a3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -31,6 +31,7 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import cpw.mods.fml.common.Loader; import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.interfaces.ISubTagContainer; @@ -282,7 +283,6 @@ public class RecipeLoader implements Runnable { GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, i), Materials.Chlorine.getGas(50), new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), null, null, null, 64, 2); } - GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.WINDMETER), GT_ModHandler.RecipeBits.NOT_REMOVABLE, @@ -758,6 +758,7 @@ public class RecipeLoader implements Runnable { } ); + if (!Loader.isModLoaded("tectech")) GT_Values.RA.addAssemblylineRecipe( ItemList.Machine_Multi_ImplosionCompressor.get(1L),24000, new ItemStack[]{ diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index dde15a6611..6c1b1bd175 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -27,6 +27,7 @@ import com.github.bartimaeusnek.bartworks.common.commands.ChangeConfig; import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; +import com.github.bartimaeusnek.crossmod.tectech.TecTechResearchLoader; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; @@ -51,6 +52,7 @@ import java.io.StringReader; + "after:Micdoodlecore; " + "after:miscutils;" + "after:EMT;" + + "after:tectech;" ) public class BartWorksCrossmod { public static final String NAME = "BartWorks Mod Additions"; @@ -83,6 +85,8 @@ public class BartWorksCrossmod { GalacticraftProxy.postInit(init); if (Loader.isModLoaded("miscutils")) new RadioHatchCompat().run(); + if (Loader.isModLoaded("tectech")) + TecTechResearchLoader.runResearches(); } // @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java new file mode 100644 index 0000000000..ab17f787c9 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java @@ -0,0 +1,60 @@ +package com.github.bartimaeusnek.crossmod.tectech; + +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.technus.tectech.recipe.TT_recipeAdder; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; +import net.minecraftforge.fluids.FluidStack; + +public class TecTechResearchLoader { + + public static void runResearches(){ + + TT_recipeAdder.addResearchableAssemblylineRecipe( + ItemList.Machine_Multi_ImplosionCompressor.get(1L), + 64000, + 48, + BW_Util.getMachineVoltageFromTier(8), + 8, + new Object[]{ + ItemList.Machine_Multi_ImplosionCompressor.get(1L), + Materials.Neutronium.getBlocks(5), + GT_OreDictUnificator.get(OrePrefixes.stickLong,Materials.Osmium,64), + GT_OreDictUnificator.get(OrePrefixes.ring,Materials.Osmium,64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01,Materials.Superconductor,64), + ItemList.Electric_Piston_UV.get(64), + }, + new FluidStack[]{ + Materials.SolderingAlloy.getMolten(1440), + Materials.Osmium.getMolten(1440), + Materials.Neutronium.getMolten(1440) + }, + ItemRegistry.eic.copy(), + 240000, + BW_Util.getMachineVoltageFromTier(8) + ); + +// BartWorksCrossmod.LOGGER.info("Nerfing Assembly Lines >= LuV Recipes to run with TecTech!"); +// HashSet toRem = new HashSet<>(); +// for (GT_Recipe.GT_Recipe_AssemblyLine recipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){ +// if (recipe.mEUt >= BW_Util.getTierVoltage(6) && !GT_Utility.areStacksEqual(recipe.mResearchItem, CustomItemList.UnusedStuff.get(1L))){ +// String modId = GameRegistry.findUniqueIdentifierFor(recipe.mOutput.getItem()).modId; +// if (!modId.equalsIgnoreCase("tectech")) +// if (!modId.equalsIgnoreCase("gregtech") || modId.equalsIgnoreCase("gregtech") && (recipe.mOutput.getItemDamage() < 15000 || recipe.mOutput.getItemDamage() > 16999)) +// toRem.add(recipe); +// } +// } +// HashSet toRemVisual = new HashSet<>(); +// GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.removeAll(toRem); +// +// for (GT_Recipe.GT_Recipe_AssemblyLine recipe : toRem){ +// GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.stream().filter(re -> GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisual::add); +// TT_recipeAdder.addResearchableAssemblylineRecipe(recipe.mResearchItem, recipe.mResearchTime, recipe.mResearchTime/1000, recipe.mEUt, GT_Utility.getTier(recipe.mEUt)-2, recipe.mInputs, recipe.mFluidInputs, recipe.mOutput, recipe.mDuration, recipe.mEUt); +// } +// +// GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.removeAll(toRemVisual); + } +} -- cgit From bfe69ae3cdd50d895fa57689a03572ddc6fff19d Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 11 Oct 2019 21:19:15 +0200 Subject: added tectech jar Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: d9c5e476cd82f56a3790d63a69f643c393dc6859 --- .gitignore | 7 ++++++- libs/TecTech-1.7.10-3.7.3-deobf.jar.REMOVED.git-id | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 libs/TecTech-1.7.10-3.7.3-deobf.jar.REMOVED.git-id diff --git a/.gitignore b/.gitignore index 3db8b9657c..edc0472679 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,9 @@ hs_err_pid* /run /.gradle /venv -/libs \ No newline at end of file +/libs/* +!/libs/TecTech-1.7.10-3.7.3-deobf.jar +!/libs/CodeChickenCore-1.7.10-1.0.4.35-dev.jar +!/libs/CodeChickenLib-1.7.10-1.1.1.99-dev.jar +!/libs/NotEnoughItems-1.7.10-1.0.4.95-dev.jar +!/libs/gregtech-5.09.32-dev.jar \ No newline at end of file diff --git a/libs/TecTech-1.7.10-3.7.3-deobf.jar.REMOVED.git-id b/libs/TecTech-1.7.10-3.7.3-deobf.jar.REMOVED.git-id new file mode 100644 index 0000000000..ffef551870 --- /dev/null +++ b/libs/TecTech-1.7.10-3.7.3-deobf.jar.REMOVED.git-id @@ -0,0 +1 @@ +848964ad2a6250cb5adc79bde00136058f994d99 \ No newline at end of file -- cgit From ff8b4f99505ce2470231bc2b225aacea6cbd8832 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 11 Oct 2019 23:08:44 +0200 Subject: +increased buildnumber +added a bit on tectech compat Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 69f8fe52c9ec7b94a138db426f3c65496792d22b --- build.properties | 2 +- .../crossmod/tectech/TecTechResearchLoader.java | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/build.properties b/build.properties index aa9a58c099..ad1092fbce 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre17 +buildNumber=2_pre18 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java index ab17f787c9..c210a5e170 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java @@ -2,13 +2,20 @@ package com.github.bartimaeusnek.crossmod.tectech; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.github.technus.tectech.recipe.TT_recipeAdder; +import com.github.technus.tectech.thing.CustomItemList; +import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; import net.minecraftforge.fluids.FluidStack; +import java.util.HashSet; + public class TecTechResearchLoader { public static void runResearches(){ @@ -47,14 +54,17 @@ public class TecTechResearchLoader { // toRem.add(recipe); // } // } -// HashSet toRemVisual = new HashSet<>(); +// HashSet toRemVisualScanner = new HashSet<>(); +// HashSet toRemVisualAssLine = new HashSet<>(); // GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.removeAll(toRem); // // for (GT_Recipe.GT_Recipe_AssemblyLine recipe : toRem){ -// GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.stream().filter(re -> GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisual::add); +// GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.stream().filter(re -> GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisualAssLine::add); +// GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.stream().filter(re -> GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisualScanner::add); // TT_recipeAdder.addResearchableAssemblylineRecipe(recipe.mResearchItem, recipe.mResearchTime, recipe.mResearchTime/1000, recipe.mEUt, GT_Utility.getTier(recipe.mEUt)-2, recipe.mInputs, recipe.mFluidInputs, recipe.mOutput, recipe.mDuration, recipe.mEUt); // } // -// GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.removeAll(toRemVisual); +// GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.removeAll(toRemVisualScanner); +// GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.removeAll(toRemVisualAssLine); } } -- cgit From 96973ab20684ec980bd195880c1448e8ed52fae6 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 13 Oct 2019 14:31:04 +0200 Subject: fixed BioCulture "breeding" System +improved readability +rebalanced Rhodium (zinc loss removed, 0,8 -> 0,2 Rh per Pt) +optimised imports Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 2f58c0c6bba54adba05b82685e8fea830e3df468 --- .../bartimaeusnek/ASM/BWCoreTransformer.java | 1 - .../github/bartimaeusnek/bartworks/MainMod.java | 2 +- .../tiered/GT_MetaTileEntity_BioLab.java | 33 ++++++++++------------ .../GT_Enhancement/GTMetaItemEnhancer.java | 1 - .../GT_Enhancement/PlatinumSludgeOverHaul.java | 10 +++---- .../bartimaeusnek/bartworks/util/BW_Util.java | 4 +++ .../bartimaeusnek/bartworks/util/BioCulture.java | 23 +++++++++++++-- .../crossmod/tectech/TecTechResearchLoader.java | 7 ----- 8 files changed, 46 insertions(+), 35 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index 9c0afeefc2..cb0f49c07b 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -25,7 +25,6 @@ package com.github.bartimaeusnek.ASM; import net.minecraft.launchwrapper.IClassTransformer; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.*; import java.util.Arrays; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 6fedc29f6b..dbfcf2044f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -42,10 +42,10 @@ import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.system.log.STFUGTPPLOG; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader; +import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.PlatinumSludgeOverHaul; import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader; -import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.PlatinumSludgeOverHaul; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index 154b2a1355..a70ad2a6e7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -52,6 +52,12 @@ import net.minecraftforge.fluids.FluidStack; public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { private static final String MGUINAME = "BW.GUI.BioLab.png"; + private static final int DNA_EXTRACTION_MODULE = 0; + private static final int PCR_THERMOCYCLE_MODULE = 1; + private static final int PLASMID_SYNTHESIS_MODULE = 2; + private static final int TRANSFORMATION_MODULE = 3; + private static final int CLONAL_CELLULAR_SYNTHESIS_MODULE = 4; + private static final int INCUBATION_MODULE = 5; public GT_MetaTileEntity_BioLab(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 1, (String) null, 6, 2, GT_MetaTileEntity_BioLab.MGUINAME, null, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")/*this is topactive*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")/*this is top*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM"))); @@ -85,7 +91,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { if (this.getSpecialSlot() != null && this.getSpecialSlot().getItem() instanceof LabModule) { int damage = this.getSpecialSlot().getItemDamage(); switch (damage) { - case 0: + case DNA_EXTRACTION_MODULE: if (GT_Utility.isStackValid(this.mInventory[4]) && this.mInventory[4].getItem() instanceof LabParts && this.mInventory[4].getItemDamage() == 0 && this.mInventory[4].getTagCompound() != null && //checks if it is a Culture GT_Utility.isStackValid(this.mInventory[5]) && this.mInventory[5].getItem() instanceof LabParts && this.mInventory[5].getItemDamage() == 1 && this.mInventory[5].getTagCompound() == null && GT_Utility.isStackValid(this.mInventory[6]) && this.mInventory[6].getItem() instanceof LabParts && this.mInventory[6].getItemDamage() == 3 && @@ -119,7 +125,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } break; - case 1: { + case PCR_THERMOCYCLE_MODULE: { if (GT_Utility.isStackValid(this.mInventory[4]) && this.mInventory[4].getItem() instanceof LabParts && this.mInventory[4].getItemDamage() == 1 && this.mInventory[4].getTagCompound() != null && //checks if it is a Culture GT_Utility.isStackValid(this.mInventory[7]) && GT_Utility.areStacksEqual(this.mInventory[7], ItemList.Tool_DataOrb.get(1L)) && GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], FluidLoader.BioLabFluidCells[0]) && @@ -159,7 +165,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } } break; - case 2: { + case PLASMID_SYNTHESIS_MODULE: { ItemStack inp2 = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); @@ -190,8 +196,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } break; - - case 3: { + case TRANSFORMATION_MODULE: { if ( GT_Utility.isStackValid(this.mInventory[4]) && GT_Utility.areStacksEqual(this.mInventory[4], BioItemList.getPetriDish(null), true) && this.mInventory[4].getTagCompound() != null && GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getPlasmidCell(null), true) && this.mInventory[5].getTagCompound() != null && @@ -208,9 +213,9 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mInventory[i].stackSize--; } this.mFluid.amount -= 1000; - bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + bioCulture = bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = BioItemList.getPetriDish(this.checkForExisting(bioCulture)); + this.mOutputItems[0] = BioItemList.getPetriDish(bioCulture); } this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); @@ -218,7 +223,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } } break; - case 4: { + case CLONAL_CELLULAR_SYNTHESIS_MODULE: { ItemStack Outp = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); @@ -242,7 +247,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mFluid.amount -= 8000; if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { BioCulture out = BioCulture.getBioCulture(BioDNA.convertDataToDNA(cultureDNABioData)); - out.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + out = out.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); this.mOutputItems[0] = BioItemList.getPetriDish(out); } this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); @@ -250,6 +255,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } } break; + case INCUBATION_MODULE: default: return super.checkRecipe(skipOC); } @@ -257,15 +263,6 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { return super.checkRecipe(skipOC); } - private BioCulture checkForExisting(BioCulture culture) { - if (culture == null) - return null; - for (BioCulture bc : BioCulture.BIO_CULTURE_ARRAY_LIST) - if (culture.getdDNA().equals(bc.getdDNA()) && culture.getPlasmid().equals(bc.getPlasmid())) - return bc; - return culture; - } - @Override @SuppressWarnings("deprecation") public String[] getDescription() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java index c0f8aa51ac..3cfed71a8c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -8,7 +8,6 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; -import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 6427b827f3..94e2bdf13b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -119,7 +119,7 @@ public class PlatinumSludgeOverHaul { PTSaltRefined.get(dust), PTSaltRefined.get(dust), PTSaltRefined.get(dust), - }, new int[]{ + }, new int[] { 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, }, 600, 30); GT_Values.RA.addBlastRecipe(PTSaltRefined.get(dust), GT_Utility.getIntegratedCircuit(1), null, Materials.Chlorine.getGas(87), PTMetallicPowder.get(dust), null, 200, 120, 900); @@ -138,7 +138,7 @@ public class PlatinumSludgeOverHaul { PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), - }, new int[]{ + }, new int[] { 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, }, 600, 30); GT_Values.RA.addChemicalRecipeForBasicMachineOnly(PDRawPowder.get(dust, 2), Materials.Empty.getCells(1), FormicAcid.getFluidOrGas(4000), Materials.Ammonia.getGas(2000), Materials.Palladium.getDust(2), Materials.Ethylene.getCells(1), 250, 30); @@ -147,7 +147,7 @@ public class PlatinumSludgeOverHaul { //K2S2O7 // GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust,6), null, 30); //Rh/Os/Ir/Ru - GT_Values.RA.addBlastRecipe(PTResidue.get(dust), GT_Utility.getIntegratedCircuit(11), PotassiumDisulfate.getMolten(1440), RHSulfate.getFluidOrGas(1440), LeachResidue.get(dust), null, 200, 120, 775); + GT_Values.RA.addBlastRecipe(PTResidue.get(dust), GT_Utility.getIntegratedCircuit(11), PotassiumDisulfate.getMolten(360), RHSulfate.getFluidOrGas(360), LeachResidue.get(dust), null, 200, 120, 775); //Ru GT_Values.RA.addBlastRecipe(LeachResidue.get(dust, 10), Materials.Saltpeter.getDust(10), Materials.SaltWater.getFluid(1000), GT_ModHandler.getSteam(1000), SodiumRuthenate.get(dust, 3), IrOsLeachResidue.get(dust, 6), 200, 120, 775); @@ -174,7 +174,7 @@ public class PlatinumSludgeOverHaul { //Rh GT_Values.RA.addChemicalRecipe(RHSulfate.get(cell, 11), GT_Utility.getIntegratedCircuit(1), Materials.Water.getFluid(10000), Materials.Potassium.getMolten(2000), RHSulfateSolution.get(cell, 11), LeachResidue.get(dustTiny, 10), 300, 30); - GT_Values.RA.addChemicalRecipe(Materials.Zinc.getDust(1), null, RHSulfateSolution.getFluidOrGas(1000), null, ZincSulfate.get(dust), CrudeRhMetall.get(dust), 300); + GT_Values.RA.addChemicalRecipe(Materials.Zinc.getDust(1), null, RHSulfateSolution.getFluidOrGas(1000), null, ZincSulfate.get(dust,6), CrudeRhMetall.get(dust), 300); GT_Values.RA.addBlastRecipe(CrudeRhMetall.get(dust), Materials.Salt.getDust(1), Materials.Chlorine.getGas(1000), null, RHSalt.get(dust, 3), null, 300, 120, 600); GT_Values.RA.addMixerRecipe(RHSalt.get(dust, 10), null, null, null, Materials.Water.getFluid(2000), RHSaltSolution.getFluidOrGas(2000), null, 300, 30); GT_Values.RA.addChemicalRecipe(SodiumNitrate.get(dust), GT_Utility.getIntegratedCircuit(1), RHSaltSolution.getFluidOrGas(1000), null, RHNitrate.get(dust), Materials.Salt.getDust(1), 300); @@ -188,7 +188,7 @@ public class PlatinumSludgeOverHaul { RhFilterCake.get(dust), RhFilterCake.get(dust), RhFilterCake.get(dust), - }, new int[]{ + }, new int[] { 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, }, 600, 30); GT_Values.RA.addMixerRecipe(RhFilterCake.get(dust), null, null, null, Materials.Water.getFluid(1000), RHFilterCakeSolution.getFluidOrGas(1000), null, 300, 30); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 0ee22cbd7d..c662655990 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -225,6 +225,10 @@ public class BW_Util { return (aStack1 == null && aStack2 == null) || GT_Utility.areStacksEqual(aStack1, aStack2); } + public static boolean areStacksEqualOrEachNull(ItemStack aStack1, ItemStack aStack2) { + return aStack1 == null || aStack2 == null || GT_Utility.areStacksEqual(aStack1, aStack2); + } + public static byte getByteFromRarity(EnumRarity rarity) { if (rarity.equals(EnumRarity.uncommon)) return 1; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index a5b2b49d69..b591243a1e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -179,16 +179,35 @@ public class BioCulture extends BioData implements IColorModulationContainer { return this.plasmid; } - public void setPlasmid(BioPlasmid plasmid) { + public BioCulture setPlasmid(BioPlasmid plasmid) { + return checkForExisting(new BioCulture(this.color, this.name, this.ID, plasmid, this.dDNA, this.rarity, this.bBreedable)); + } + + private BioCulture checkForExisting(BioCulture culture) { + if (culture == null) + return null; + for (BioCulture bc : BioCulture.BIO_CULTURE_ARRAY_LIST) + if (culture.getdDNA().equals(bc.getdDNA()) && culture.getPlasmid().equals(bc.getPlasmid())) + return bc; + return culture; + } + + public BioCulture setPlasmidUnsafe(BioPlasmid plasmid) { this.plasmid = plasmid; + return this; } public BioDNA getdDNA() { return this.dDNA; } - public void setdDNA(BioDNA dDNA) { + public BioCulture setdDNA(BioDNA dDNA) { + return checkForExisting(new BioCulture(this.color, this.name, this.ID, this.plasmid, dDNA, this.rarity, this.bBreedable)); + } + + public BioCulture setdDNAUnsafe(BioDNA dDNA) { this.dDNA = dDNA; + return this; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java index c210a5e170..6c33818755 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java @@ -2,20 +2,13 @@ package com.github.bartimaeusnek.crossmod.tectech; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.github.technus.tectech.recipe.TT_recipeAdder; -import com.github.technus.tectech.thing.CustomItemList; -import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; import net.minecraftforge.fluids.FluidStack; -import java.util.HashSet; - public class TecTechResearchLoader { public static void runResearches(){ -- cgit From a1f3cf977795205635e47875d1c3b65362298219 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 15 Oct 2019 15:14:05 +0200 Subject: Fixes +fixed circuit assembly line +changed THTR, now requires up to 0.5% of input per cycle +added saftey-nullchecks to BioLab +buffed Ross128ba Helium and Saltwater +added General purpose Fermenting Bacteria & fermentation recipes to the Bio Vat +version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: f5d0470ab8375536e9e880918390b54d658139ed --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 2 + .../bartworks/common/loaders/BioCultureLoader.java | 8 ++- .../bartworks/common/loaders/BioRecipeLoader.java | 9 +++ .../multis/GT_TileEntity_CircuitAssemblyLine.java | 8 ++- .../tileentities/multis/GT_TileEntity_THTR.java | 72 ++++++++++------------ .../tiered/GT_MetaTileEntity_BioLab.java | 8 +-- .../system/oregen/BW_WorldGenRoss128ba.java | 4 +- .../bartimaeusnek/bartworks/util/BW_Util.java | 4 +- .../bartimaeusnek/bartworks/util/BioCulture.java | 2 +- .../resources/assets/bartworks/lang/de_DE.lang | 2 +- .../resources/assets/bartworks/lang/en_US.lang | 2 +- .../resources/assets/bartworks/lang/fr_FR.lang | 1 - 13 files changed, 69 insertions(+), 55 deletions(-) diff --git a/build.properties b/build.properties index ad1092fbce..470fd99ff4 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre18 +buildNumber=2_pre20 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index dbfcf2044f..794ccc8ac5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -81,6 +81,7 @@ import java.io.IOException; import java.lang.reflect.Field; import java.util.*; +import static com.github.bartimaeusnek.bartworks.common.loaders.BioRecipeLoader.runOnServerStarted; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; import static gregtech.api.enums.GT_Values.VN; @@ -220,6 +221,7 @@ public final class MainMod { if (classicMode) new DownTierLoader().run(); fixEnergyRequirements(); + runOnServerStarted(); } private static void fixEnergyRequirements() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java index 35ad62ae47..0c13e8b88b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java @@ -46,20 +46,24 @@ public class BioCultureLoader implements Runnable { public static BioCulture rottenFleshBacteria; public static BioCulture eColi; public static BioCulture anaerobicOil; + public static BioCulture generalPurposeFermentingBacteria; @Override public void run() { BioCultureLoader.CommonYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_YEAST), true); - BioCultureLoader.WhineYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var bayanus", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_WHINE_YEAST, true); - BioCultureLoader.BeerYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_BEER_YEAST, true); + BioCultureLoader.WhineYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var bayanus", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_WHINE_YEAST,EnumRarity.uncommon, true); + BioCultureLoader.BeerYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_BEER_YEAST, EnumRarity.uncommon,true); BioCultureLoader.rottenFleshBacteria = BioCulture.createAndRegisterBioCulture(new Color(110, 40, 25), "Escherichia cadaver", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_BETA_LACMATASE), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_BETA_LACMATASE), false); BioCultureLoader.eColi = BioCulture.createAndRegisterBioCulture(new Color(149, 132, 75), "Escherichia koli", BioPlasmid.convertDataToPlasmid(BioCultureLoader.eColiData), BioDNA.convertDataToDNA(BioCultureLoader.eColiData), true); BioCultureLoader.anaerobicOil = BioCulture.createAndRegisterBioCulture(new Color(0, 0, 0), "Pseudomonas Veronii", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_ANAEROBIC_OIL), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_ANAEROBIC_OIL), true); + BioCultureLoader.generalPurposeFermentingBacteria = BioCulture.createAndRegisterBioCulture(new Color(127, 69, 26), "Saccharomyces escherichia", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_BETA_LACMATASE), EnumRarity.epic,true); + BioCultureLoader.CommonYeast.setLocalisedName("Common Yeast"); BioCultureLoader.WhineYeast.setLocalisedName("Whine Yeast"); BioCultureLoader.BeerYeast.setLocalisedName("Beer Yeast"); BioCultureLoader.rottenFleshBacteria.setLocalisedName("Rotten Flesh Bacteria"); BioCultureLoader.eColi.setLocalisedName("eColi Bacteria"); BioCultureLoader.anaerobicOil.setLocalisedName("Anaerobic Oil Bacteria"); + BioCultureLoader.generalPurposeFermentingBacteria.setLocalisedName("General Purpose Fermenting Bacteria"); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index 7d5409bf00..3315d5361e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -35,6 +35,7 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -380,4 +381,12 @@ public class BioRecipeLoader extends RecipeLoader { GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(10),null,new FluidStack(FluidLoader.heatedfulvicAcid,1000),new FluidStack(FluidLoader.Kerogen,1000),null,75, BW_Util.getMachineVoltageFromTier(2)); GT_Values.RA.addPyrolyseRecipe(Materials.Wood.getDust(10),new FluidStack(FluidLoader.Kerogen,1000),10,null,Materials.Oil.getFluid(1000),105, BW_Util.getMachineVoltageFromTier(3)); } + + public static void runOnServerStarted(){ + for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sFermentingRecipes.mRecipeList){ + FluidStack[] flInput = new FluidStack[]{new FluidStack(recipe.mFluidInputs[0], recipe.mFluidInputs[0].amount*100)}; + FluidStack[] flOutput = new FluidStack[]{new FluidStack(recipe.mFluidOutputs[0], recipe.mFluidOutputs[0].amount)}; + BWRecipes.instance.addBacterialVatRecipe(new ItemStack[]{null},BioCultureLoader.generalPurposeFermentingBacteria,flInput,flOutput,recipe.mDuration > 10 ? recipe.mDuration/10 : recipe.mDuration,recipe.mEUt,GT_Utility.getTier(recipe.mEUt)); + } + } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index b8c8be8e4d..4cee0d9ebc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -60,7 +60,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl super(aID, aName, aNameRegional); } - public GT_TileEntity_CircuitAssemblyLine(String aName) { + private GT_TileEntity_CircuitAssemblyLine(String aName) { super(aName); } @@ -115,6 +115,10 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), BW_Util.getItemsFromInputBusses(this))) { BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); + if (this.mEUt > 0) + this.mEUt = -this.mEUt; + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = this.bufferedRecipe.mOutputs; this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; @@ -144,6 +148,8 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); if (this.mEUt > 0) this.mEUt = -this.mEUt; + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = this.bufferedRecipe.mOutputs; this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index d1b0d2ebce..6427023dba 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -56,15 +56,15 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { private static final int BASECASINGINDEX = 44; private static final int HELIUM_NEEDED = 730000; private int HeliumSupply; - private int BISOPeletSupply; - private int TRISOPeletSupply; + private int BISOPeletSupply, savedBISO; + private int TRISOPeletSupply, savedTRISO; private boolean empty; public GT_TileEntity_THTR(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } - public GT_TileEntity_THTR(String aName) { + private GT_TileEntity_THTR(String aName) { super(aName); } @@ -76,10 +76,12 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - this.HeliumSupply =aNBT.getInteger("HeliumSupply"); - this.BISOPeletSupply =aNBT.getInteger("BISOPeletSupply"); - this.TRISOPeletSupply =aNBT.getInteger("TRISOPeletSupply"); - this.empty =aNBT.getBoolean("EmptyMode"); + this.HeliumSupply = aNBT.getInteger("HeliumSupply"); + this.BISOPeletSupply = aNBT.getInteger("BISOPeletSupply"); + this.TRISOPeletSupply = aNBT.getInteger("TRISOPeletSupply"); + this.savedBISO = aNBT.getInteger("savedBISO"); + this.savedTRISO = aNBT.getInteger("savedTRISO"); + this.empty = aNBT.getBoolean("EmptyMode"); } @Override @@ -88,6 +90,8 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { aNBT.setInteger("HeliumSupply", this.HeliumSupply); aNBT.setInteger("BISOPeletSupply", this.BISOPeletSupply); aNBT.setInteger("TRISOPeletSupply", this.TRISOPeletSupply); + aNBT.setInteger("savedBISO", this.savedBISO); + aNBT.setInteger("savedTRISO", this.savedTRISO); aNBT.setBoolean("EmptyMode", this.empty); } @@ -134,25 +138,29 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.BISOPeletSupply + this.TRISOPeletSupply >= 100000)) return false; + int toReduce = new XSTR().nextInt((int)Math.floor(((double)this.BISOPeletSupply + (double)this.TRISOPeletSupply) / 200D)); + + this.savedBISO = BISOPeletSupply; + this.savedTRISO = TRISOPeletSupply; + if (new XSTR().nextBoolean()) { if (this.BISOPeletSupply > 0) - --this.BISOPeletSupply; + this.BISOPeletSupply -= toReduce; else - --this.TRISOPeletSupply; + this.TRISOPeletSupply -= toReduce; } else { if (this.TRISOPeletSupply > 0) - --this.TRISOPeletSupply; + this.TRISOPeletSupply -= toReduce; else - --this.BISOPeletSupply; + this.BISOPeletSupply -= toReduce; } this.updateSlots(); - if (this.mOutputFluids == null || this.mOutputFluids[0] == null) - this.mOutputFluids = new FluidStack[]{FluidRegistry.getFluidStack("ic2hotcoolant",0)}; + + this.mOutputFluids = new FluidStack[]{FluidRegistry.getFluidStack("ic2hotcoolant",0)}; this.mEUt=0; this.mMaxProgresstime=648000; - return true; } @@ -166,47 +174,33 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { this.HeliumSupply = 0; this.TRISOPeletSupply = 0; this.BISOPeletSupply = 0; + this.savedTRISO = 0; + this.savedBISO = 0; return true; } long accessibleCoolant = 0; - long toProduce=0; for (FluidStack fluidStack : this.getStoredFluids()) { if (fluidStack.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))) { - accessibleCoolant+=fluidStack.amount; + accessibleCoolant += fluidStack.amount; } } - - toProduce = (long) ((0.00711111111111111111111111111111D*(double)this.TRISOPeletSupply + 0.00474074074074074074074074074074D*(double)this.BISOPeletSupply)); - - if (toProduce > accessibleCoolant) { -// new ExplosionIC2( -// this.getBaseMetaTileEntity().getWorld(), -// null, -// this.getBaseMetaTileEntity().getXCoord(), -// this.getBaseMetaTileEntity().getYCoord(), -// this.getBaseMetaTileEntity().getZCoord(), -// 50f, -// 0.01f, -// ExplosionIC2.Type.Nuclear -// ).doExplosion(); - toProduce=accessibleCoolant; - } - - accessibleCoolant=toProduce; + + accessibleCoolant = Math.min((long) ((0.00711111111111111111111111111111D*(double)this.savedTRISO + 0.00474074074074074074074074074074D*(double)this.savedBISO)), accessibleCoolant); for (FluidStack fluidStack : this.getStoredFluids()) { if (fluidStack.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))) { if (accessibleCoolant >= fluidStack.amount) { accessibleCoolant -= fluidStack.amount; - fluidStack.amount=0; + fluidStack.amount = 0; } else if (accessibleCoolant > 0) { - fluidStack.amount-=accessibleCoolant; - accessibleCoolant=0; + fluidStack.amount -= accessibleCoolant; + accessibleCoolant = 0; } } } - this.mOutputFluids[0].amount+=toProduce; + this.mOutputFluids[0].amount += accessibleCoolant; + this.updateSlots(); return true; } @@ -296,7 +290,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { "BISO-Pebbles:", this.BISOPeletSupply + "pcs.", "TRISO-Pebbles:", this.TRISOPeletSupply + "pcs.", "Helium-Level:", this.HeliumSupply+"L / "+ GT_TileEntity_THTR.HELIUM_NEEDED +"L", - "Coolant/t:", this.BISOPeletSupply+this.TRISOPeletSupply >= 100000 ? (long) ((0.03471*(float)this.TRISOPeletSupply + 0.0267*(float)this.BISOPeletSupply))+"L/t" : "0L/t", + "Coolant/t:", this.savedBISO+this.savedTRISO >= 100000 ? (long) ((0.00711111111111111111111111111111D * (double) this.savedTRISO + 0.00474074074074074074074074074074D * (double) this.savedBISO))+"L/t" : "0L/t", "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index a70ad2a6e7..e4247a70c5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -96,7 +96,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { GT_Utility.isStackValid(this.mInventory[5]) && this.mInventory[5].getItem() instanceof LabParts && this.mInventory[5].getItemDamage() == 1 && this.mInventory[5].getTagCompound() == null && GT_Utility.isStackValid(this.mInventory[6]) && this.mInventory[6].getItem() instanceof LabParts && this.mInventory[6].getItemDamage() == 3 && GT_Utility.areStacksEqual(this.mInventory[7], Materials.Ethanol.getCells(1)) && - this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000 + this.mFluid != null && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000 ) { NBTTagCompound DNABioDataTag = this.mInventory[4].getTagCompound().getCompoundTag("DNA"); @@ -130,7 +130,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { GT_Utility.isStackValid(this.mInventory[7]) && GT_Utility.areStacksEqual(this.mInventory[7], ItemList.Tool_DataOrb.get(1L)) && GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], FluidLoader.BioLabFluidCells[0]) && GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], FluidLoader.BioLabFluidCells[3]) && - this.mFluid.isFluidEqual(dnaFluid) && this.mFluid.amount >= 1000) { + this.mFluid != null && this.mFluid.isFluidEqual(dnaFluid) && this.mFluid.amount >= 1000) { NBTTagCompound DNABioDataTag = this.mInventory[4].getTagCompound(); if (DNABioDataTag == null) return super.checkRecipe(skipOC); @@ -175,7 +175,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], ItemList.Tool_DataOrb.get(1L), true) && Behaviour_DataOrb.getDataTitle(this.mInventory[6]).equals("DNA Sample") && (!(Behaviour_DataOrb.getDataName(this.mInventory[6]).isEmpty())) && GT_Utility.isStackValid(this.mInventory[7]) && GT_Utility.areStacksEqual(this.mInventory[7], inp2) && - this.mFluid.isFluidEqual(dnaFluid) && (this.mFluid.amount >= 1000)) { + this.mFluid != null && this.mFluid.isFluidEqual(dnaFluid) && (this.mFluid.amount >= 1000)) { BioData cultureDNABioData = BioData.getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[6])); if (cultureDNABioData == null) return super.checkRecipe(skipOC); @@ -201,7 +201,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { GT_Utility.isStackValid(this.mInventory[4]) && GT_Utility.areStacksEqual(this.mInventory[4], BioItemList.getPetriDish(null), true) && this.mInventory[4].getTagCompound() != null && GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getPlasmidCell(null), true) && this.mInventory[5].getTagCompound() != null && GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], FluidLoader.BioLabFluidCells[2]) && - this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000) { + this.mFluid != null && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000) { BioData cultureDNABioData = BioData.getBioDataFromNBTTag(this.mInventory[5].getTagCompound()); BioCulture bioCulture = BioCulture.getBioCultureFromNBTTag(this.mInventory[4].getTagCompound()); if (cultureDNABioData == null || bioCulture == null) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java index ae7b8bcf6c..1659918870 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java @@ -70,8 +70,8 @@ public class BW_WorldGenRoss128ba extends BW_OreLayer { public static void init_undergroundFluids() { String ross128b = StatCollector.translateToLocal("moon.Ross128ba"); - uo_dimensionList.SetConfigValues(ross128b, ross128b, SaltWater.getFluid(1).getFluid().getName(), SaltWater.getFluid(1).getFluid().getName(), 0, 625, 40, 5); - uo_dimensionList.SetConfigValues(ross128b, ross128b, Helium_3.getGas(1).getFluid().getName(), Helium_3.getGas(1).getFluid().getName(), 0, 625, 60, 5); + uo_dimensionList.SetConfigValues(ross128b, ross128b, SaltWater.getFluid(1).getFluid().getName(), SaltWater.getFluid(1).getFluid().getName(), 0, 1250, 40, 5); + uo_dimensionList.SetConfigValues(ross128b, ross128b, Helium_3.getGas(1).getFluid().getName(), Helium_3.getGas(1).getFluid().getName(), 0, 1250, 60, 5); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index c662655990..19d180e31d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -300,8 +300,8 @@ public class BW_Util { xEUt = base.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power } - if (xEUt > maxInputVoltage){ - //downclock one notch, we have overshot. + while (xEUt > maxInputVoltage){ + //downclock one notch until we are good again, we have overshot. xEUt >>=2; base.mMaxProgresstime <<= 1; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index b591243a1e..e7015053ca 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -38,7 +38,7 @@ import java.util.Objects; public class BioCulture extends BioData implements IColorModulationContainer { - public static final ArrayList BIO_CULTURE_ARRAY_LIST = new ArrayList(); + public static final ArrayList BIO_CULTURE_ARRAY_LIST = new ArrayList<>(); public static final BioCulture NULLCULTURE = BioCulture.createAndRegisterBioCulture(Color.BLUE, "", BioPlasmid.NULLPLASMID, BioDNA.NULLDNA, false); //fallback NULL culture, also Blue =) public String getLocalisedName() { diff --git a/src/main/resources/assets/bartworks/lang/de_DE.lang b/src/main/resources/assets/bartworks/lang/de_DE.lang index f3df754f6b..6dc22e440e 100644 --- a/src/main/resources/assets/bartworks/lang/de_DE.lang +++ b/src/main/resources/assets/bartworks/lang/de_DE.lang @@ -112,7 +112,7 @@ tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4 tooltip.tile.diode.0.name=A Simple diode that will allow Energy Flow in only one direction. tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so! tooltip.tile.energydistributor.0.name=Splits Amperage into several Sides. -tooltip.tile.htr.0.name=Controller Block for the Thorium High Temperature Reactor;Size(WxHxD): 11x12x11 (Hollow);Controller: Front Center, Lowest Layer;Corners and the 2 touching blocks are air;Once build, Helium is inserted into the Fluid Input Hatch until it doesnt accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Raidation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete Operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes 1 Fuel Pellet per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days +tooltip.tile.htr.0.name=Controller Block für den Thorium Hoch Temperatur Reaktor;Größe(BxHxL): 11x12x11 (Innen Leer);Controller: Vorne Mitte, Unterste Schicht;Ecken und die 2 beührenden Blöcke sind Luft (Zylinder);Once build, Helium is inserted into the Fluid Input Hatch until it doesnt accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Raidation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete Operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes 1 Fuel Pellet per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days tooltip.tile.lesu.0.name=Controller Block for the GT2-Styled L.E.S.U.;Size: ANY tooltip.tile.lesu.1.name=Storage per LESU Casing: tooltip.tile.lesu.2.name=Output EU: LESU Casings amount;Input EU: Next Voltage Tier to Output EU;Input/Output Amps can be configured via 4 Circuits in GUI;Output Side has a dot on it. diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index f1decd8af2..43830aa4bb 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -144,7 +144,7 @@ tile.radiohatch.name=Radio Hatch tile.bw.windmill.name=Windmill tile.manutrafo.name=Manual Trafo -tooltip.tile.htr.0.name=Controller Block for the Thorium High Temperature Reactor;Size(WxHxD): 11x12x11 (Hollow);Controller: Front Center, Lowest Layer;Corners and the 2 touching blocks are air;Once build, Helium is inserted into the Fluid Input Hatch until it doesnt accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Raidation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete Operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes 1 Fuel Pellet per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days +tooltip.tile.htr.0.name=Controller Block for the Thorium High Temperature Reactor;Size(WxHxD): 11x12x11 (Hollow);Controller: Front Center, Lowest Layer;Corners and the 2 touching blocks are air (Cylindric);Once build, Helium is inserted into the Fluid Input Hatch until it doesnt accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Raidation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete Operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes up to 0.5% of total Fuel Pellet per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days item.TRISOPellet.name=TRISO pebble item.TRISOPelletBall.name=TRISO pebble ball item.BISOPelletBall.name=BISO pebble ball diff --git a/src/main/resources/assets/bartworks/lang/fr_FR.lang b/src/main/resources/assets/bartworks/lang/fr_FR.lang index 16aed282ec..4cb840b7ff 100644 --- a/src/main/resources/assets/bartworks/lang/fr_FR.lang +++ b/src/main/resources/assets/bartworks/lang/fr_FR.lang @@ -144,7 +144,6 @@ tile.radiohatch.name=Trappe Radio tile.bw.windmill.name=Eolienne tile.manutrafo.name=Transformateur Manuel -tooltip.tile.htr.0.name=Controller Block for the Thorium High Temperature Reactor;Size(WxHxD): 11x12x11 (Hollow);Controller: Front Center, Lowest Layer;Corners and the 2 touching blocks are air;Once build, Helium is inserted into the Fluid Input Hatch until it doesnt accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Raidation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete Operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes 1 Fuel Pellet per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days item.TRISOPellet.name=TRISO pebble item.TRISOPelletBall.name=TRISO pebble ball item.BISOPelletBall.name=BISO pebble ball -- cgit From 26579069b0d2b033c70311231d7572a022c5d307 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 20 Oct 2019 22:54:33 +0200 Subject: fusion fix Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: f35ece6e934deb7d989f26cd4f1046311ad4492a --- .../system/material/GT_Enhancement/PlatinumSludgeOverHaul.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 94e2bdf13b..660cfeea16 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -49,6 +49,7 @@ import net.minecraft.item.crafting.*; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; +import org.apache.commons.lang3.ClassUtils; import org.apache.commons.lang3.reflect.FieldUtils; import java.lang.reflect.Field; @@ -232,7 +233,7 @@ public class PlatinumSludgeOverHaul { //gt machines maploop: for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - if (map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes) + if (map == GT_Recipe.GT_Recipe_Map.sFusionRecipes || map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes) continue; HashSet toDel = new HashSet(); recipeloop: -- cgit From 930944f5f0cee1bca1241e0bc179edcbe265d3bb Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 29 Oct 2019 15:57:53 +0100 Subject: fixes + removed final field stuff due to a "java.lang.NoSuchMethodError" on server + fixed last remaining Platinum reverse recipes for Dreamcraft/GT Items + fixed a typo in the centrifuge recipe + added a circuit priorisation mode for the MEGA EBF + redid the CircuitAssemblyLine Structure-Check + version increase to match testing version Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 7037b78d15f87115e9064f712aaacd523d9784d6 --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 22 ++- .../tileentities/multis/GT_TileEntity_BioVat.java | 31 +---- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 152 ++++++++++++--------- .../mega/GT_TileEntity_MegaBlastFurnace.java | 60 +++++++- .../GT_Enhancement/PlatinumSludgeOverHaul.java | 57 ++++---- .../bartimaeusnek/bartworks/util/BW_Util.java | 51 ++++++- 7 files changed, 243 insertions(+), 132 deletions(-) diff --git a/build.properties b/build.properties index 470fd99ff4..e355c9df43 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre20 +buildNumber=2_pre23 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 794ccc8ac5..964dfdf7c7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -220,8 +220,9 @@ public final class MainMod { new CircuitImprintLoader().run(); if (classicMode) new DownTierLoader().run(); - fixEnergyRequirements(); runOnServerStarted(); + fixEnergyRequirements(); +// removeDuplicateRecipes(); } private static void fixEnergyRequirements() { @@ -230,7 +231,7 @@ public final class MainMod { for (GT_Recipe recipe : map.mRecipeList){ if (recipe.mFakeRecipe) continue maploop; - for (int i = 0; i < 10; i++) { + for (int i = 0; i < VN.length; i++) { if (recipe.mEUt == BW_Util.getTierVoltage(i)){ recipe.mEUt = BW_Util.getMachineVoltageFromTier(i); } @@ -518,4 +519,21 @@ public final class MainMod { return (GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L)) || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); } +// private static void removeDuplicateRecipes(){ +// GT_Recipe.GT_Recipe_Map.sMappings.forEach( +// gt_recipe_map -> { +// HashSet mappings = new HashSet<>(); +// HashSet dupes = new HashSet<>(); +// gt_recipe_map.mRecipeList.forEach( +// recipe -> { +// if (mappings.contains(BW_Util.getRecipeHash(recipe))) +// dupes.add(recipe); +// mappings.add(BW_Util.getRecipeHash(recipe)); +// } +// ); +// gt_recipe_map.mRecipeList.removeAll(dupes); +// } +// ); +// } + } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 1a8b555478..3902909ae6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -22,12 +22,10 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; -import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.items.LabParts; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.common.net.RendererPacket; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.util.*; @@ -43,8 +41,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -57,8 +53,6 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import javax.annotation.Nonnegative; -import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -318,8 +312,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } } else { if (x == -2 && z == -2 && y == 1) - this.mGlassTier = this.calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + -2, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); - if (0 == this.mGlassTier || this.mGlassTier != this.calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z))) { + this.mGlassTier = BW_Util.calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + -2, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); + if (0 == this.mGlassTier || this.mGlassTier != BW_Util.calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z))) { return false; } } @@ -336,27 +330,6 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { return false; } - private byte calculateGlassTier(@Nonnull Block block, @Nonnegative Byte meta) { - - if (block.equals(ItemRegistry.bw_glasses[0])) - return meta == 12 ? 5 : meta > 1 && meta < 6 ? (byte) (meta + 3) : 4; - - if (block.getUnlocalizedName().equals("blockAlloyGlass")) - return 4; - - if (block.equals(Blocks.glass)) - return 3; - - for (BioVatLogicAdder.BlockMetaPair B : BioVatLogicAdder.BioVatGlass.getGlassMap().keySet()) - if (B.getBlock().equals(block) && B.getaByte().equals(meta)) - return BioVatLogicAdder.BioVatGlass.getGlassMap().get(B); - - if (block.getMaterial().equals(Material.glass)) - return 3; - - return 0; - } - @Override public int getMaxEfficiency(ItemStack itemStack) { return 10000; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 4cee0d9ebc..39cc442a3e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -22,12 +22,14 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -37,6 +39,9 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; @@ -163,79 +168,98 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; - int r; - int i; - IGregTechTileEntity tTileEntity; - if (xDir != 0) { - for(r = 0; r <= 7; ++r) { - i = r * xDir; - - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 0, i); - if (!this.addEnergyInputToMachineList(tTileEntity, 16)) - if ((aBaseMetaTileEntity.getBlockOffset(0, 0, i) != GregTech_API.sBlockCasings3 || aBaseMetaTileEntity.getMetaIDOffset(0, 0, i) != 10) && r == 1) - return false; - if (!aBaseMetaTileEntity.getBlockOffset(0, -1, i).getUnlocalizedName().equals("blockAlloyGlass")) - return false; - - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(0, -2, i); - if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16)) - if (aBaseMetaTileEntity.getBlockOffset(0, -2, i) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(0, -2, i) != 0) - return false; - - if (i != 0 && (aBaseMetaTileEntity.getBlockOffset(xDir, -1, i) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(xDir, -1, i) != 5)) - return false; - - if (!aBaseMetaTileEntity.getBlockOffset(xDir * 2, -1, i).getUnlocalizedName().equals("blockAlloyGlass")) - return false; - - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir * 2, -2, i); - if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16)) - if (aBaseMetaTileEntity.getBlockOffset(xDir * 2, -2, i) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(xDir * 2, -2, i) != 0) - return false; - - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, -2, i); - if (!this.addInputToMachineList(tTileEntity, 16) && this.addOutputToMachineList(tTileEntity, 16)) - return r > 0 && this.mEnergyHatches.size() > 0; - } - } else { - - for(r = 0; r <= 7; ++r) { - i = r * -zDir; + int xBase = aBaseMetaTileEntity.getXCoord() + xDir; + int yBase = aBaseMetaTileEntity.getYCoord(); + int zBase = aBaseMetaTileEntity.getZCoord() + zDir; - //top with grate and energy hatch - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, 0, zDir); - if (!this.addEnergyInputToMachineList(tTileEntity, 16)) - if ((aBaseMetaTileEntity.getBlockOffset(i, 0, 0) != GregTech_API.sBlockCasings3 || aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0) != 10) && r == 1) - return false; + boolean rl = xDir == 0; - if (!aBaseMetaTileEntity.getBlockOffset(i, -1, 0).getUnlocalizedName().equals("blockAlloyGlass")) - return false; + if (rl) + ++zBase; + else + ++xBase; - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, 0); - if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16)) - if (aBaseMetaTileEntity.getBlockOffset(i, -2, 0) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(i, -2, 0) != 0) - return false; - - if (i != 0 && (aBaseMetaTileEntity.getBlockOffset(i, -1, zDir) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(i, -1, zDir) != 5)) - return false; + int length = 0; + while (true) { + IGregTechTileEntity igtte = aBaseMetaTileEntity.getIGregTechTileEntity(rl ? xBase + length : xBase - 1, yBase - 2, rl ? zBase - 1 : zBase + length); + if (igtte == null) + return false; - if (!aBaseMetaTileEntity.getBlockOffset(i, -1, zDir * 2).getUnlocalizedName().equals("blockAlloyGlass")) - return false; + if (igtte.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_OutputBus) + break; + ++length; - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir * 2); - if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16)) - if (aBaseMetaTileEntity.getBlockOffset(i, -2, zDir * 2) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(i, -2, zDir * 2) != 0) - return false; + if (length > 7) + return false; + } - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir); - if (!this.addInputToMachineList(tTileEntity, 16) && this.addOutputToMachineList(tTileEntity, 16)) - return r > 0 && this.mEnergyHatches.size() == 1; + if (rl) + zBase -= 2; + else + xBase -= 2; + + + for (int x = 0; x <= (rl ? length : 2); x++) { + for (int y = -2; y <= 0; y++) { + for (int z = 0; z <= (rl ? 2 : length); z++) { + if (x == 0 && y == 0 && z == 0) + continue; + + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntity(xBase + x, yBase + y, zBase + z); + Block block = aBaseMetaTileEntity.getBlock(xBase + x, yBase + y, zBase + z); + byte meta = aBaseMetaTileEntity.getMetaID(xBase + x, yBase + y, zBase + z); + + switch (y) { + case -2: { + switch (rl ? z : x) { + case 0: + case 2: { + if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16)) + if (block != GregTech_API.sBlockCasings2 && meta != 0) + return false; + break; + } + case 1: { + if (!this.addInputToMachineList(tTileEntity, 16) && !((rl ? x : z) == length && this.addOutputToMachineList(tTileEntity, 16))) + return false; + break; + } + default: + break; + } + break; + } + case -1: { + switch (rl ? z : x) { + case 0: + case 2: { + if (BW_Util.calculateGlassTier(block, meta) < 4) + return false; + break; + } + case 1: { + if (block != GregTech_API.sBlockCasings2 || meta != 5) + return false; + break; + } + default: + break; + } + break; + } + case 0: { + if (!this.addEnergyInputToMachineList(tTileEntity, 16)) + if (block != GregTech_API.sBlockCasings3 || meta != 10) + return false; + break; + } + } + } } } - - return false; + return this.mEnergyHatches.size() > 0 && this.mMaintenanceHatches.size() == 1; } @Override @@ -304,7 +328,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl "Circuit Assembly Line", "Size(WxHxD): (2-7)x3x3, variable length", "Bottom: Steel Machine Casing(or 1x Maintenance or Input Hatch),", "ULV Input Bus (Last ULV Output Bus), Steel Machine Casing", - "Middle: Reinforced Glass, Assembling Line Casing, Reinforced Glass", + "Middle: EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass", "Top: Grate Machine Casing (or Controller or 1x Energy Hatch)", "Up to 7 repeating slices, last is Output Bus", "Imprint this machine with a Circuit Imprint,", diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index fc76ab719d..31cf20c428 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -35,15 +35,16 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; import static gregtech.api.enums.GT_Values.V; @@ -73,6 +74,20 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return fdsc; } + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setByte("glasTier",glasTier); + aNBT.setByte("circuitMode",circuitMode); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + this.circuitMode = aNBT.getByte("circuitMode"); + this.glasTier = aNBT.getByte("glasTier"); + } + public boolean drainEnergyInput(long aEU) { if (aEU <= 0) return true; @@ -110,16 +125,47 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl // return glasTier != 8 && rVoltage > BW_Util.getTierVoltage(glasTier) ? BW_Util.getTierVoltage(glasTier) : rVoltage ; // } + + private byte circuitMode = 0; + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (aPlayer.isSneaking()) { + --circuitMode; + if (circuitMode < 0) + circuitMode = 24; + } else { + ++circuitMode; + if (circuitMode > 24) + circuitMode = 0; + } + + GT_Utility.sendChatToPlayer(aPlayer,circuitMode > 0 ? "MEBF will prioritise circuit: "+circuitMode : "Circuit prioritisation disabled."); + } + @Override public boolean checkRecipe(ItemStack itemStack) { + ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); + FluidStack[] tFluids = this.getStoredFluids().toArray(new FluidStack[0]); long tVoltage = this.getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); - if (tRecipe == null) - return false; + GT_Recipe tRecipe = null; + if (circuitMode > 0 && Arrays.stream(tInputs).anyMatch(e -> GT_Utility.areStacksEqual(e,GT_Utility.getIntegratedCircuit(circuitMode),true))){ + List modInputs = Arrays.stream(tInputs).filter(Objects::nonNull).filter(e -> !e.getItem().equals(GT_Utility.getIntegratedCircuit(circuitMode).getItem())).collect(Collectors.toList()); + modInputs.add(GT_Utility.getIntegratedCircuit(circuitMode)); + tInputs = modInputs.toArray(new ItemStack[0]); + } + tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); + if (tRecipe == null) { + if (circuitMode == 0) + return false; + tInputs = this.getStoredInputs().toArray(new ItemStack[0]); + tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); + if (tRecipe == null) + return false; + } ArrayList outputItems = new ArrayList(); ArrayList outputFluids = new ArrayList(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 660cfeea16..dc7f5f3977 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -49,11 +49,12 @@ import net.minecraft.item.crafting.*; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; -import org.apache.commons.lang3.ClassUtils; import org.apache.commons.lang3.reflect.FieldUtils; import java.lang.reflect.Field; +import java.lang.reflect.Modifier; import java.util.*; +import java.util.stream.Collectors; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; import static gregtech.api.enums.OrePrefixes.*; @@ -108,7 +109,7 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addBlastRecipe(PTMetallicPowder.get(dust, 3), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Platinum.getNuggets(2), null, 600, 120, Materials.Platinum.mMeltingPoint); GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); - GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2),null, AmmoniumChloride.getFluidOrGas(200), PDAmmonia.getFluidOrGas(200), PTSaltCrude.get(dustTiny, 18), PTRawPowder.get(dustTiny,2), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); + GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2),null, AmmoniumChloride.getFluidOrGas(200), PDAmmonia.getFluidOrGas(200), PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(200)}, new FluidStack[]{PDAmmonia.getFluidOrGas(200), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2)}, 1200, 30); GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ PTSaltRefined.get(dust), @@ -413,7 +414,32 @@ public class PlatinumSludgeOverHaul { in = FieldUtils.getField(recipe.getClass(), inputItemName, true); if (in == null) return; - FieldUtils.removeFinalModifier(in,true); + + //directly copied from the apache commons collection, cause GTNH had problems with that particular function for some reason? + //this part here is NOT MIT LICENSED BUT LICSENSED UNDER THE Apache License, Version 2.0! + try { + if (Modifier.isFinal(in.getModifiers())) { + // Do all JREs implement Field with a private ivar called "modifiers"? + Field modifiersField = Field.class.getDeclaredField("modifiers"); + boolean doForceAccess = !modifiersField.isAccessible(); + if (doForceAccess) { + modifiersField.setAccessible(true); + } + try { + modifiersField.setInt(in, in.getModifiers() & ~Modifier.FINAL); + } finally { + if (doForceAccess) { + modifiersField.setAccessible(false); + } + } + } + } catch (NoSuchFieldException ignored) { + // The field class contains always a modifiers field + } catch (IllegalAccessException ignored) { + // The modifiers field is made accessible + } + // END OF APACHE COMMONS COLLECTION COPY + Object input = null; try { input = in.get(obj); @@ -518,34 +544,15 @@ public class PlatinumSludgeOverHaul { if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(BartWorksCrossmod.MOD_ID)) return true; - if (Block.getBlockFromItem(stack.getItem()) instanceof GT_Generic_Block && !(Block.getBlockFromItem(stack.getItem()) instanceof GT_Block_Ores_Abstract)) + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals("dreamcraft")) return true; - if (GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_1.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_2.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Depleted_Naquadah_4.get(1),stack,true)) - return true; - - - if (GT_Utility.areStacksEqual(ItemList.Tool_Lighter_Platinum_Empty.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Tool_Lighter_Platinum_Used.get(1),stack,true) || GT_Utility.areStacksEqual(ItemList.Tool_Lighter_Platinum_Full.get(1),stack,true)) + if (Block.getBlockFromItem(stack.getItem()) instanceof GT_Generic_Block && !(Block.getBlockFromItem(stack.getItem()) instanceof GT_Block_Ores_Abstract)) return true; - if (GT_Utility.areStacksEqual(ItemList.Emitter_EV.get(1),stack,true)) + if (Arrays.stream(ItemList.values()).filter(ItemList::hasBeenSet).anyMatch(e -> !BW_Util.checkStackAndPrefix(stack) && GT_Utility.areStacksEqual(e.get(1), stack, true))) return true; - try { - ItemList gtnhItemListItems = ItemList.valueOf("Large_Fluid_Cell_TungstenSteel"); - if (GT_Utility.areStacksEqual(gtnhItemListItems.get(1), stack, true)) - return true; - gtnhItemListItems = ItemList.valueOf("Depleted_MNq_1"); - if (GT_Utility.areStacksEqual(gtnhItemListItems.get(1), stack, true)) - return true; - gtnhItemListItems = ItemList.valueOf("Depleted_MNq_2"); - if (GT_Utility.areStacksEqual(gtnhItemListItems.get(1), stack, true)) - return true; - gtnhItemListItems = ItemList.valueOf("Depleted_MNq_4"); - if (GT_Utility.areStacksEqual(gtnhItemListItems.get(1), stack, true)) - return true; - } catch (IllegalArgumentException ignored) {} - if (stack.getItem() instanceof GT_Generic_Item) { if (!BW_Util.checkStackAndPrefix(stack)) return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 19d180e31d..1a34c11359 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import gregtech.api.enums.Materials; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; @@ -34,17 +35,17 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; +import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import javax.annotation.Nonnegative; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; +import javax.annotation.Nonnull; +import java.util.*; import static gregtech.api.enums.GT_Values.V; @@ -213,6 +214,27 @@ public class BW_Util { return itemStack != null && GT_OreDictUnificator.getAssociation(itemStack) != null && GT_OreDictUnificator.getAssociation(itemStack).mPrefix != null && GT_OreDictUnificator.getAssociation(itemStack).mMaterial != null && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial != null; } +// public static int getRecipeHash(GT_Recipe recipe) { +// int mInputItemsRawHash = Arrays.stream(recipe.mInputs).filter(Objects::nonNull).mapToInt(e -> +// Objects.hash(Item.getIdFromItem(e.getItem()),e.getItemDamage(), e.getTagCompound()) +// ).hashCode(); +// int mInputFluidRawHash = Arrays.stream(recipe.mFluidInputs).filter(Objects::nonNull).mapToInt(e -> +// Objects.hash(e.getFluidID(),e.amount,e.tag) +// ).hashCode(); +// int mOutputItemRawHash = Arrays.stream(recipe.mOutputs).filter(Objects::nonNull).mapToInt(e -> +// Objects.hash(Item.getIdFromItem(e.getItem()),e.getItemDamage(), e.getTagCompound()) +// ).hashCode(); +// int mOutputFluidRawHash = Arrays.stream(recipe.mFluidOutputs).filter(Objects::nonNull).mapToInt(e -> +// Objects.hash(e.getFluidID(),e.amount,e.tag) +// ).hashCode(); +// int mChancesRawHash = Arrays.hashCode(recipe.mChances); +// int others = Objects.hash(recipe.mEUt,recipe.mSpecialValue,recipe.mDuration); +// int specialItem = Objects.hash(recipe.mSpecialItems instanceof ItemStack ? +// ((ItemStack) (recipe.mSpecialItems)).getItem() : recipe.mSpecialItems instanceof Item ? recipe.mSpecialItems : 0 , +// recipe.mSpecialItems instanceof ItemStack ? ((ItemStack) (recipe.mSpecialItems)).getItemDamage() : 0); +// return Objects.hash(mInputItemsRawHash,mInputFluidRawHash,mOutputItemRawHash,mOutputFluidRawHash,mChancesRawHash,others,specialItem); +// } + public static int getMachineVoltageFromTier(int tier) { return (int) (30 * Math.pow(4, (tier - 1))); } @@ -482,4 +504,25 @@ public class BW_Util { default: return -1; } } + + public static byte calculateGlassTier(@Nonnull Block block, @Nonnegative byte meta) { + + if (block.equals(ItemRegistry.bw_glasses[0])) + return meta == 12 ? 5 : meta > 1 && meta < 6 ? (byte) (meta + 3) : 4; + + if (block.getUnlocalizedName().equals("blockAlloyGlass")) + return 4; + + if (block.equals(Blocks.glass)) + return 3; + + for (BioVatLogicAdder.BlockMetaPair B : BioVatLogicAdder.BioVatGlass.getGlassMap().keySet()) + if (B.getBlock().equals(block) && B.getaByte().equals(meta)) + return BioVatLogicAdder.BioVatGlass.getGlassMap().get(B); + + if (block.getMaterial().equals(Material.glass)) + return 3; + + return 0; + } } -- cgit From 0891442b1a5abf98c56fb3e42cbbcb08c77bdd5f Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 31 Oct 2019 12:46:19 +0100 Subject: fixes +fixed some recipes +fixed structure check for Circuit assembly line +added Formic acid to the acid gen +re-blacklisted planet stone dust for platinum overhaul Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 5db7bb137eb62c157546e97c78cf00779107e4c4 --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 36 +++++++----- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 65 ++++++++++++++++------ .../GT_Enhancement/PlatinumSludgeOverHaul.java | 2 +- .../processingLoaders/AdditionalRecipes.java | 1 + 5 files changed, 72 insertions(+), 34 deletions(-) diff --git a/build.properties b/build.properties index e355c9df43..8547077e78 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre23 +buildNumber=2_pre24 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 964dfdf7c7..6a16da0256 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -199,6 +199,9 @@ public final class MainMod { GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.nqgen","Can be used as Enriched Naquadah Fuel Substitute"); } } + + private static boolean recipesAdded; + @Mod.EventHandler public void onServerStarted(FMLServerStartedEvent event) { MainMod.runOnPlayerJoined(ConfigHandler.classicMode, ConfigHandler.disableExtraGassesForEBF); @@ -206,23 +209,26 @@ public final class MainMod { public static void runOnPlayerJoined(boolean classicMode, boolean extraGasRecipes){ OreDictHandler.adaptCacheForWorld(); - removeIC2Recipes(); - MainMod.addElectricImplosionCompressorRecipes(); - MainMod.unificationEnforcer(); + if (!recipesAdded) { + removeIC2Recipes(); + MainMod.addElectricImplosionCompressorRecipes(); + MainMod.unificationEnforcer(); - PlatinumSludgeOverHaul.replacePureElements(); + PlatinumSludgeOverHaul.replacePureElements(); - if (!extraGasRecipes) { - ArrayListMultimap toChange = MainMod.getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS); - HashSet noGas = MainMod.getNoGasItems(toChange); - MainMod.editRecipes(toChange, noGas); - } - new CircuitImprintLoader().run(); - if (classicMode) - new DownTierLoader().run(); - runOnServerStarted(); - fixEnergyRequirements(); + if (!extraGasRecipes) { + ArrayListMultimap toChange = MainMod.getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS); + HashSet noGas = MainMod.getNoGasItems(toChange); + MainMod.editRecipes(toChange, noGas); + } + new CircuitImprintLoader().run(); + if (classicMode) + new DownTierLoader().run(); + runOnServerStarted(); + fixEnergyRequirements(); // removeDuplicateRecipes(); + recipesAdded = true; + } } private static void fixEnergyRequirements() { @@ -231,7 +237,7 @@ public final class MainMod { for (GT_Recipe recipe : map.mRecipeList){ if (recipe.mFakeRecipe) continue maploop; - for (int i = 0; i < VN.length; i++) { + for (int i = 0; i < (VN.length-1); i++) { if (recipe.mEUt == BW_Util.getTierVoltage(i)){ recipe.mEUt = BW_Util.getMachineVoltageFromTier(i); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 39cc442a3e..11382078cd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -103,11 +103,17 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl } @Override - public void saveNBTData(NBTTagCompound aNBT) { + public void setItemNBT(NBTTagCompound aNBT) { if (!this.type.equals(new NBTTagCompound())) aNBT.setTag("Type", this.type); super.saveNBTData(aNBT); + } + @Override + public void saveNBTData(NBTTagCompound aNBT) { + if (!this.type.equals(new NBTTagCompound())) + aNBT.setTag("Type", this.type); + super.saveNBTData(aNBT); } private final Collection GT_RECIPE_COLLECTION = new HashSet<>(); @@ -173,38 +179,63 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl int yBase = aBaseMetaTileEntity.getYCoord(); int zBase = aBaseMetaTileEntity.getZCoord() + zDir; - boolean rl = xDir == 0; + boolean sided = xDir == 0; - if (rl) + if (sided) ++zBase; else ++xBase; int length = 0; + boolean backwards = false; + + while (true) { - IGregTechTileEntity igtte = aBaseMetaTileEntity.getIGregTechTileEntity(rl ? xBase + length : xBase - 1, yBase - 2, rl ? zBase - 1 : zBase + length); - if (igtte == null) - return false; + IGregTechTileEntity igtte = aBaseMetaTileEntity.getIGregTechTileEntity(sided ? xBase + length : xBase - 1, yBase - 2, sided ? zBase - 1 : zBase + length); + if (igtte == null){ + backwards = true; + length = 0; + break; + } if (igtte.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_OutputBus) break; ++length; - if (length > 7) - return false; + if (length > 7){ + backwards = true; + length = 0; + break; + } + } + if (backwards) + while (true) { + IGregTechTileEntity igtte = aBaseMetaTileEntity.getIGregTechTileEntity(sided ? xBase + length : xBase - 1, yBase - 2, sided ? zBase - 1 : zBase + length); + if (igtte == null) + return false; + + if (igtte.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_OutputBus) + break; + + --length; - if (rl) + if (length < -7){ + return false; + } + + } + + if (sided) zBase -= 2; else xBase -= 2; - - for (int x = 0; x <= (rl ? length : 2); x++) { + for (int x = (backwards && sided ? length : 0); x <= (backwards && sided ? 0 : (sided ? length : 2)); x++) { for (int y = -2; y <= 0; y++) { - for (int z = 0; z <= (rl ? 2 : length); z++) { - if (x == 0 && y == 0 && z == 0) + for (int z = (backwards && !sided ? length : 0); z <= (backwards && !sided ? 0 : (sided ? 2 : length)); z++) { + if (xBase + x == this.getBaseMetaTileEntity().getXCoord() && yBase + y == this.getBaseMetaTileEntity().getYCoord() && zBase + z == this.getBaseMetaTileEntity().getZCoord()) continue; IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntity(xBase + x, yBase + y, zBase + z); @@ -213,16 +244,16 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl switch (y) { case -2: { - switch (rl ? z : x) { + switch (sided ? z : x) { case 0: case 2: { if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16)) - if (block != GregTech_API.sBlockCasings2 && meta != 0) + if (block != GregTech_API.sBlockCasings2 || meta != 0) return false; break; } case 1: { - if (!this.addInputToMachineList(tTileEntity, 16) && !((rl ? x : z) == length && this.addOutputToMachineList(tTileEntity, 16))) + if (!this.addInputToMachineList(tTileEntity, 16) && !((sided ? x : z) == length && this.addOutputToMachineList(tTileEntity, 16))) return false; break; } @@ -232,7 +263,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl break; } case -1: { - switch (rl ? z : x) { + switch (sided ? z : x) { case 0: case 2: { if (BW_Util.calculateGlassTier(block, meta) < 4) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index dc7f5f3977..ea43acd6d0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -544,7 +544,7 @@ public class PlatinumSludgeOverHaul { if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(BartWorksCrossmod.MOD_ID)) return true; - if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals("dreamcraft")) + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals("dreamcraft") && !stack.getUnlocalizedName().contains("dust") && !stack.getUnlocalizedName().contains("Dust") ) return true; if (Block.getBlockFromItem(stack.getItem()) instanceof GT_Generic_Block && !(Block.getBlockFromItem(stack.getItem()) instanceof GT_Block_Ores_Abstract)) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index d6a1f898aa..5fc62e830f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -50,6 +50,7 @@ public class AdditionalRecipes implements Runnable { @Override public void run() { + ((BWRecipes.BW_Recipe_Map_LiquidFuel)BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(WerkstoffLoader.FormicAcid.getBridgeMaterial(),40); //Thorium/Yttrium Glas GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall, 2), WerkstoffLoader.Thorianit.get(dustSmall, 2), Materials.Glass.getMolten(144), null, new ItemStack(ItemRegistry.bw_glasses[0], 1, 12), null, 800, BW_Util.getMachineVoltageFromTier(5), 3663); //Thorianit recipes -- cgit From 8ad9760f5bf2c4bf1fb8c65447e98786e6b0553b Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 1 Nov 2019 20:15:40 +0100 Subject: Fixed Unification Enforcer +retiered YttriumOxide and CubicZirconia to HV due to Kekztech Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 24a492183a74f63c1cd0eade615488c166f4fd39 --- src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java | 8 ++++---- .../bartimaeusnek/bartworks/system/material/WerkstoffLoader.java | 4 ++-- .../system/material/processingLoaders/AdditionalRecipes.java | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 6a16da0256..6be66988c3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -278,9 +278,9 @@ public final class MainMod { MainMod.runMoltenUnificationEnfocement(werkstoff); MainMod.runUnficationDeleter(werkstoff); for (OrePrefixes prefixes : OrePrefixes.values()) { - if (OreDictionary.getOres(prefixes + werkstoff.getDefaultName()).size() > 1) { - for (int j = 0; j < OreDictionary.getOres(prefixes + werkstoff.getDefaultName()).size(); j++) { - ItemStack toReplace = OreDictionary.getOres(prefixes + werkstoff.getDefaultName()).get(j); + if (OreDictionary.getOres(prefixes + werkstoff.getVarName()).size() > 1) { + for (int j = 0; j < OreDictionary.getOres(prefixes + werkstoff.getVarName()).size(); j++) { + ItemStack toReplace = OreDictionary.getOres(prefixes + werkstoff.getVarName()).get(j); ItemStack replacement = werkstoff.get(prefixes); if (GT_Utility.areStacksEqual(toReplace,replacement) || replacement == null || replacement.getItem() == null) continue; @@ -399,7 +399,7 @@ public final class MainMod { for (OrePrefixes prefixes : OrePrefixes.values()) if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) != 0 && ((werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0)) { GT_OreDictUnificator.set(prefixes,werkstoff.getBridgeMaterial(),werkstoff.get(prefixes),true,true); - for (ItemStack stack : OreDictionary.getOres(prefixes + werkstoff.getDefaultName().replace(" ", ""))) { + for (ItemStack stack : OreDictionary.getOres(prefixes + werkstoff.getVarName())) { GT_OreDictUnificator.addAssociation(prefixes,werkstoff.getBridgeMaterial(),stack,false); GT_OreDictUnificator.getAssociation(stack).mUnificationTarget = werkstoff.get(prefixes); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 9a2cafa2d6..45971f3120 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -168,7 +168,7 @@ public class WerkstoffLoader implements Runnable { "Cubic Zirconia", Werkstoff.Types.COMPOUND, 3273, - new Werkstoff.GenerationFeatures().onlyDust().addGems(), + new Werkstoff.GenerationFeatures().onlyDust().addGems().enforceUnification(), 4, TextureSet.SET_DIAMOND, Arrays.asList(WerkstoffLoader.Zirconium), @@ -196,7 +196,7 @@ public class WerkstoffLoader implements Runnable { new short[]{255,255,255,0}, "Yttrium Oxide", Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().onlyDust(), //No autoadd here to gate this material by hand + new Werkstoff.GenerationFeatures().onlyDust().enforceUnification(), //No autoadd here to gate this material by hand 6, TextureSet.SET_DULL, new Pair<>(Materials.Yttrium, 2), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 5fc62e830f..c4d4dd1124 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -74,8 +74,8 @@ public class AdditionalRecipes implements Runnable { GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), Materials.Amethyst.getDust(10), GT_Values.NF, GT_Values.NF, WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), GT_Values.NI, 800, BW_Util.getMachineVoltageFromTier(2), 500); GT_Values.RA.addPrimitiveBlastRecipe(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), Materials.Amethyst.getDust(10), 6, WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), GT_Values.NI, 800); //Cubic Circonia - GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(11), Materials.Oxygen.getGas(3000), null, WerkstoffLoader.YttriumOxide.get(dust, 5), 64, BW_Util.getMachineVoltageFromTier(4)); - GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust, 10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.CubicZirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953); + GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(5), Materials.Oxygen.getGas(3000), null, WerkstoffLoader.YttriumOxide.get(dust, 5), 4096, BW_Util.getMachineVoltageFromTier(1)); + GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust, 10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.CubicZirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 57600, BW_Util.getMachineVoltageFromTier(3), 2953); //Tellurium GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed, Materials.Lead, 10L), GT_Utility.getIntegratedCircuit(17), GT_Values.NF, GT_Values.NF, Materials.Lead.getIngots(10), Materials.Tellurium.getNuggets(20), 800, BW_Util.getMachineVoltageFromTier(2), 722); GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium.getMolten(16), Materials.Beryllium.getMolten(16), WerkstoffLoader.Californium.getMolten(16), 250, 49152, 480000000); -- cgit From 8b842ae036b5abfe2b64708fe9d7da3b1ddb6e26 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 2 Nov 2019 16:57:16 +0100 Subject: added small ores +fixed heated water pump Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: f2655dba9dabfb9a2fc58ec8e11c96fff5dcad5b --- build.properties | 2 +- .../client/renderer/BW_Renderer_Block_Ores.java | 4 +- .../container/BW_Container_HeatedWaterPump.java | 13 +++ .../material/BW_MetaGeneratedSmallOreTE.java | 92 ++++++++++++++++++++++ .../system/material/BW_MetaGenerated_Ores.java | 17 ++-- .../material/BW_MetaGenerated_SmallOres.java | 63 +++++++++++++++ .../GT_Enhancement/PlatinumSludgeOverHaul.java | 1 + .../bartworks/system/material/WerkstoffLoader.java | 17 ++-- .../bartworks/system/oregen/BW_OreLayer.java | 7 +- 9 files changed, 196 insertions(+), 20 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java diff --git a/build.properties b/build.properties index 8547077e78..d90a27f0c3 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre24 +buildNumber=2_pre25 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index bb5078ebff..5bcd873fd3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -23,6 +23,8 @@ package com.github.bartimaeusnek.bartworks.client.renderer; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedSmallOreTE; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_SmallOres; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; import net.minecraft.block.Block; @@ -39,7 +41,7 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { @Override public void renderInventoryBlock(Block aBlock, int aMeta, int modelId, RenderBlocks aRenderer) { - BW_MetaGeneratedOreTE tTileEntity = new BW_MetaGeneratedOreTE(); + BW_MetaGeneratedOreTE tTileEntity = aBlock instanceof BW_MetaGenerated_SmallOres ? new BW_MetaGeneratedSmallOreTE() : new BW_MetaGeneratedOreTE(); tTileEntity.mMetaData = (short) aMeta; aBlock.setBlockBoundsForItemRender(); aRenderer.setRenderBoundsFromBlock(aBlock); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java index f18b34c734..8ea844c82c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java @@ -71,6 +71,19 @@ public class BW_Container_HeatedWaterPump extends Container { @Override public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + Slot slot = this.getSlot(p_82846_2_); + if (p_82846_2_ == 0 && slot.getStack() != null) { + for (int i = 25; i < this.inventorySlots.size(); i++) { + if (((Slot) this.inventorySlots.get(i)).getStack() == null) { + ((Slot) this.inventorySlots.get(i)).putStack(slot.getStack()); + slot.putStack(null); + } + } + } + else if (p_82846_2_ > 1 && slot.getStack() != null && ((Slot) this.inventorySlots.get(0)).getStack() == null && ((Slot) this.inventorySlots.get(0)).isItemValid(slot.getStack())){ + ((Slot) this.inventorySlots.get(0)).putStack(slot.getStack()); + slot.putStack(null); + } return null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java new file mode 100644 index 0000000000..c6baf39118 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java @@ -0,0 +1,92 @@ +package com.github.bartimaeusnek.bartworks.system.material; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.ITexture; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.XSTR; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Block_Ores_Abstract; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +import java.util.ArrayList; +import java.util.Random; + +public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { + + @Override + public ArrayList getDrops(Block aDroppedOre) { + ArrayList rList = new ArrayList<>(); + Materials aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData).getBridgeMaterial(); + + if (aMaterial != null) { + Random tRandom = new XSTR(this.xCoord ^ this.yCoord ^ this.zCoord); + ArrayList tSelector = new ArrayList<>(); + + ItemStack tStack = GT_OreDictUnificator.get(OrePrefixes.gemExquisite, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); + if (tStack != null) { + for (int i = 0; i < 1; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.gemFlawless, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); + if (tStack != null) { + for (int i = 0; i < 2; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L); + if (tStack != null) { + for (int i = 0; i < 12; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.gemFlawed, aMaterial, GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L), 1L); + if (tStack != null) { + for (int i = 0; i < 5; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L); + if (tStack != null) { + for (int i = 0; i < 10; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.gemChipped, aMaterial, GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L), 1L); + if (tStack != null) { + for (int i = 0; i < 5; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L); + if (tStack != null) { + for (int i = 0; i < 10; i++) { + tSelector.add(tStack); + } + } + if (tSelector.size() > 0) { + rList.add(GT_Utility.copyAmount(1L, tSelector.get(tRandom.nextInt(tSelector.size())))); + } + if (tRandom.nextInt(3) > 1) { + rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Stone, 1L)); + } + } + return rList; + } + + @Override + public ITexture[] getTexture(Block aBlock, byte aSide) { + Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); + if ((aMaterial != null)) { + GT_RenderedTexture aIconSet = new GT_RenderedTexture(aMaterial.getTexSet().mTextures[OrePrefixes.oreSmall.mTextureIndex], aMaterial.getRGBA()); + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet}; + } + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.oreSmall.mTextureIndex])}; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 4d1a5a4a9e..eeb1f269a9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -56,13 +56,16 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { this.setResistance(5.0F); this.setBlockTextureName("stone"); this.setCreativeTab(metaTab); - for (Werkstoff w : Werkstoff.werkstoffHashSet) { - if (w != null) { - if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0 || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) - continue; - GT_ModHandler.addValuableOre(this, w.getmID(), 1); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", w.getDefaultName() + OrePrefixes.ore.mLocalizedMaterialPost); - } + for (Werkstoff w : Werkstoff.werkstoffHashSet) + doRegistrationStuff(w); + } + + protected void doRegistrationStuff(Werkstoff w){ + if (w != null) { + if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0 || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) + return; + GT_ModHandler.addValuableOre(this, w.getmID(), 1); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", w.getDefaultName() + OrePrefixes.ore.mLocalizedMaterialPost); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java new file mode 100644 index 0000000000..f5e6cf1a50 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java @@ -0,0 +1,63 @@ +package com.github.bartimaeusnek.bartworks.system.material; + +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +import java.util.Arrays; + +public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { + public BW_MetaGenerated_SmallOres(Material p_i45386_1_, Class tileEntity, String blockName) { + super(p_i45386_1_, tileEntity, blockName); + } + + @Override + protected void doRegistrationStuff(Werkstoff w) { + if (w != null) { + if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0 || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) + return; + GT_ModHandler.addValuableOre(this, w.getmID(), 1); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", OrePrefixes.oreSmall.mLocalizedMaterialPre + w.getDefaultName() + OrePrefixes.oreSmall.mLocalizedMaterialPost); + } + } + + @Override + public String getUnlocalizedName() { + return "bw.blockores.02"; + } + + public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, int[] aBlockMeta) { + if (!air) { + aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); + } + + Block tBlock = aWorld.getBlock(aX, aY, aZ); + Block tOreBlock = WerkstoffLoader.BWSmallOres; + if (aMetaData < 0 || tBlock == Blocks.air && !air) { + return false; + } else { + + if (Block.getIdFromBlock(tBlock) != Block.getIdFromBlock(block)) { + return false; + } + final int aaY = aY; + if (Arrays.stream(aBlockMeta).noneMatch(e -> e == aWorld.getBlockMetadata(aX, aaY, aZ))) { + return false; + } + + aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0); + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof BW_MetaGeneratedOreTE) { + ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = (short) aMetaData; + } + + return true; + } + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index ea43acd6d0..f9ca22d37a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -42,6 +42,7 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Block_Ores; import gregtech.common.blocks.GT_Block_Ores_Abstract; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 45971f3120..da365a60fc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -737,7 +737,7 @@ public class WerkstoffLoader implements Runnable { "", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), + new Werkstoff.GenerationFeatures(), 47, TextureSet.SET_METALLIC //No Byproducts @@ -808,7 +808,7 @@ public class WerkstoffLoader implements Runnable { "", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), + new Werkstoff.GenerationFeatures(), 53, TextureSet.SET_METALLIC //No Byproducts @@ -896,7 +896,7 @@ public class WerkstoffLoader implements Runnable { "Leach Residue", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), + new Werkstoff.GenerationFeatures(), 60, TextureSet.SET_ROUGH //No Byproducts @@ -1007,7 +1007,7 @@ public class WerkstoffLoader implements Runnable { "???", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), + new Werkstoff.GenerationFeatures(), 69, TextureSet.SET_ROUGH //No Byproducts @@ -1018,7 +1018,7 @@ public class WerkstoffLoader implements Runnable { "???", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), + new Werkstoff.GenerationFeatures(), 70, TextureSet.SET_ROUGH //No Byproducts @@ -1119,7 +1119,7 @@ public class WerkstoffLoader implements Runnable { "Crude Rhodium Metal", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), + new Werkstoff.GenerationFeatures(), 79, TextureSet.SET_DULL ); @@ -1265,6 +1265,7 @@ public class WerkstoffLoader implements Runnable { public static HashBiMap fluids = HashBiMap.create(); public static HashBiMap molten = HashBiMap.create(); public static Block BWOres; + public static Block BWSmallOres; public boolean registered; public static Werkstoff getWerkstoff(String Name){ @@ -1290,6 +1291,8 @@ public class WerkstoffLoader implements Runnable { } if (orePrefixes == ore) return new ItemStack(WerkstoffLoader.BWOres, amount, werkstoff.getmID()); + if (orePrefixes == oreSmall) + return new ItemStack(WerkstoffLoader.BWSmallOres, amount, werkstoff.getmID()); if (WerkstoffLoader.items.get(orePrefixes) == null) new Exception("NO SUCH ITEM!"+orePrefixes+werkstoff.getDefaultName()).printStackTrace(); return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); @@ -1542,7 +1545,9 @@ public class WerkstoffLoader implements Runnable { RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); + WerkstoffLoader.BWSmallOres = new BW_MetaGenerated_SmallOres(Material.rock, BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmall"); GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.01"); + GameRegistry.registerBlock(WerkstoffLoader.BWSmallOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.02"); new GTMetaItemEnhancer(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java index d9dff96cf7..920bb109af 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java @@ -23,10 +23,7 @@ package com.github.bartimaeusnek.bartworks.system.oregen; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.material.*; import com.github.bartimaeusnek.bartworks.util.MurmurHash3; import com.google.common.collect.ArrayListMultimap; import gregtech.api.GregTech_API; @@ -177,7 +174,7 @@ public abstract class BW_OreLayer extends GT_Worldgen { return true; if ((aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0) || (aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0) || (aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0) || (aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0)) { - return BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, this.getDefaultBlockToReplace(),this.getDefaultDamageToReplace()); + return isSmallOre ? BW_MetaGenerated_SmallOres.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, this.getDefaultBlockToReplace(),this.getDefaultDamageToReplace()) : BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, this.getDefaultBlockToReplace(),this.getDefaultDamageToReplace()); } return this.setGTOreBlockSpace(aWorld, aX, aY, aZ, aMetaData, this.getDefaultBlockToReplace()); -- cgit From b3a8c4077381ffc2dc6f23114aeb76536eafd5a1 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 3 Nov 2019 11:12:42 +0100 Subject: fixed small ores +fixed small ore names +added registration for small ores +changed some tooltips +added mercury minerals to use with GaGreg Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: ee0f8301e2040459d922690b505d0760946383a2 --- build.properties | 2 +- .../material/BW_MetaGenerated_SmallOres.java | 2 +- .../bartworks/system/material/WerkstoffLoader.java | 47 ++++++++++++++++++++-- 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/build.properties b/build.properties index d90a27f0c3..d24f1eb750 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre25 +buildNumber=2_pre27 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java index f5e6cf1a50..034b2d3606 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java @@ -22,7 +22,7 @@ public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0 || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) return; GT_ModHandler.addValuableOre(this, w.getmID(), 1); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", OrePrefixes.oreSmall.mLocalizedMaterialPre + w.getDefaultName() + OrePrefixes.oreSmall.mLocalizedMaterialPost); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", "Small " + w.getDefaultName() + OrePrefixes.oreSmall.mLocalizedMaterialPost); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index da365a60fc..72683e7bb8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -805,7 +805,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff PDMetallicPowder = new Werkstoff( Materials.Palladium.getRGBA(), "Palladium Metallic Powder", - "", + "??Pd??", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures(), @@ -829,7 +829,6 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff PDSalt = new Werkstoff( Materials.Palladium.getRGBA(), "Palladium Salt", - "", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().onlyDust(), @@ -894,6 +893,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff LeachResidue = new Werkstoff( new short[]{0x64, 0x46, 0x29}, "Leach Residue", + "??IrOsRhRu??", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures(), @@ -1004,7 +1004,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff IrOsLeachResidue = new Werkstoff( new short[]{0x64, 0x46, 0x29}, "Rarest Metal Residue", - "???", + "??OsIr??", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures(), @@ -1015,7 +1015,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff IrLeachResidue = new Werkstoff( new short[]{0x84, 0x66, 0x49}, "Iridium Metal Residue", - "???", + "??Ir??", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures(), @@ -1117,6 +1117,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff CrudeRhMetall = new Werkstoff( new short[]{0x66, 0x66, 0x66}, "Crude Rhodium Metal", + "??Rh??", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures(), @@ -1260,6 +1261,43 @@ public class WerkstoffLoader implements Runnable { new Pair<>(WerkstoffLoader.MagnetoResonaticDust,2), new Pair<>(Materials.Plutonium,1) ); + public static final Werkstoff Atheneite = new Werkstoff( + new short[]{175,175,175}, + "Atheneite", + subscriptNumbers("(Pd,Hg)3As"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 93, + TextureSet.SET_SHINY, + new Pair<>(WerkstoffLoader.PDMetallicPowder,3), + new Pair<>(Materials.Mercury,3), + new Pair<>(Materials.Arsenic,1) + ); + public static final Werkstoff Temagamite = new Werkstoff( + new short[]{245,245,245}, + "Temagamite", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 94, + TextureSet.SET_ROUGH, + new Pair<>(WerkstoffLoader.PDMetallicPowder,3), + new Pair<>(Materials.Mercury,1), + new Pair<>(Materials.Tellurium,1) + ); + public static final Werkstoff Terlinguaite = new Werkstoff( + new short[]{245,245,245}, + "Terlinguaite", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 95, + TextureSet.SET_GEM_HORIZONTAL, + new Pair<>(Materials.Mercury,2), + new Pair<>(Materials.Chlorine,1), + new Pair<>(Materials.Oxygen,1) + ); public static HashMap items = new HashMap<>(); public static HashBiMap fluids = HashBiMap.create(); @@ -1544,6 +1582,7 @@ public class WerkstoffLoader implements Runnable { if (FMLCommonHandler.instance().getSide().isClient()) RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); + GameRegistry.registerTileEntity(BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmallTE"); WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); WerkstoffLoader.BWSmallOres = new BW_MetaGenerated_SmallOres(Material.rock, BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmall"); GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.01"); -- cgit From 6d7a985fce0dbcb1301833e4dd9d3f02689f28fe Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 3 Nov 2019 19:44:00 +0100 Subject: fixes +fixed small ore names +fixed Hg-Compound Werkstoffs not giving out Hg +fixed cell amount in a recipe Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: db1b903fe9f5b93a1abc381791fe7d8bd0760f6d --- .../system/material/BW_MetaGeneratedOre_Item.java | 2 +- .../GT_Enhancement/PlatinumSludgeOverHaul.java | 2 +- .../bartworks/system/material/WerkstoffLoader.java | 25 +++++++++++++++++++--- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java index f09bb6f33d..be3a5d9643 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java @@ -50,7 +50,7 @@ public class BW_MetaGeneratedOre_Item extends BW_ItemBlocks { } public String getItemStackDisplayName(ItemStack aStack) { - return GT_LanguageManager.getTranslation("bw.blockores.01." + aStack.getItemDamage() + ".name"); + return GT_LanguageManager.getTranslation( getUnlocalizedName(aStack) + ".name"); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index f9ca22d37a..fa28531234 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -146,7 +146,7 @@ public class PlatinumSludgeOverHaul { }, 600, 30); GT_Values.RA.addChemicalRecipeForBasicMachineOnly(PDRawPowder.get(dust, 2), Materials.Empty.getCells(1), FormicAcid.getFluidOrGas(4000), Materials.Ammonia.getGas(2000), Materials.Palladium.getDust(2), Materials.Ethylene.getCells(1), 250, 30); GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{PDRawPowder.get(dust, 2)}, new FluidStack[]{FormicAcid.getFluidOrGas(4000)}, new FluidStack[]{Materials.Ammonia.getGas(2000), Materials.Ethylene.getGas(1000), Materials.Water.getFluid(1000)}, new ItemStack[]{Materials.Palladium.getDust(2)}, 250, 30); - GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust, 2), Materials.Hydrogen.getCells(1), null, Materials.SulfuricAcid.getFluid(2000), Materials.Sodium.getDust(1), Materials.Empty.getCells(3), 30); + GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust, 2), Materials.Hydrogen.getCells(1), null, Materials.SulfuricAcid.getFluid(2000), Materials.Sodium.getDust(1), Materials.Empty.getCells(1), 30); //K2S2O7 // GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust,6), null, 30); //Rh/Os/Ir/Ru diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 72683e7bb8..e2778cc0dc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1277,6 +1277,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff Temagamite = new Werkstoff( new short[]{245,245,245}, "Temagamite", + subscriptNumbers("Pd3HgTe"), new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -1970,7 +1971,7 @@ public class WerkstoffLoader implements Runnable { if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { if (container.getKey() instanceof Materials) { - if (((Materials) container.getKey()).hasCorrespondingGas() || ((Materials) container.getKey()).hasCorrespondingFluid() || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { + if (((Materials) container.getKey()).getGas(0) != null || ((Materials) container.getKey()).getFluid(0) != null || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); @@ -1987,8 +1988,26 @@ public class WerkstoffLoader implements Runnable { cells += container.getValue(); } } else { - if (((Materials) container.getKey()).getDust(container.getValue()) == null ) - continue; + if (((Materials) container.getKey()).getDust(container.getValue()) == null ) { + if (((Materials) container.getKey()).getCells(container.getValue()) != null && (((Materials) container.getKey()).getMolten(0) != null || ((Materials) container.getKey()).getSolid(0) != null)) { + FluidStack tmpFl = ((Materials) container.getKey()).getMolten(1000 * container.getValue()); + if (tmpFl == null || tmpFl.getFluid() == null) { + tmpFl = ((Materials) container.getKey()).getSolid(1000 * container.getValue()); + } + flOutputs.add(tmpFl); + if (flOutputs.size() > 1) { + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + } else { + stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + } + cells += container.getValue(); + } + } else + continue; + } if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); -- cgit From 0819c0dd1f2e55d1e1e3d3a1f319cbd461d19d28 Mon Sep 17 00:00:00 2001 From: bartimaeusnek Date: Sat, 9 Nov 2019 16:24:16 +0100 Subject: added SmallOres fortune +modified NEI handler Signed-off-by: bartimaeusnek Former-commit-id: 67fa75d497e38016116b612f34b378f4578ec338 --- .../mega/GT_TileEntity_MegaBlastFurnace.java | 91 +++++++++++++++++----- .../bartworks/neiHandler/BW_NEI_OreHandler.java | 33 +++++--- .../system/material/BW_MetaGeneratedOreTE.java | 2 +- .../material/BW_MetaGeneratedSmallOreTE.java | 14 ++-- .../system/material/BW_MetaGenerated_Ores.java | 4 +- 5 files changed, 106 insertions(+), 38 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 31cf20c428..229cfa0169 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -27,9 +27,11 @@ import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Recipe; @@ -39,6 +41,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -79,6 +82,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl super.saveNBTData(aNBT); aNBT.setByte("glasTier",glasTier); aNBT.setByte("circuitMode",circuitMode); + aNBT.setLong("lEUt",lEUt); } @Override @@ -86,8 +90,59 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl super.loadNBTData(aNBT); this.circuitMode = aNBT.getByte("circuitMode"); this.glasTier = aNBT.getByte("glasTier"); + this.lEUt = aNBT.getLong("lEUt"); } + @Override + public boolean onRunningTick(ItemStack aStack) { + if (this.lEUt > 0) { + this.addEnergyOutput((long)this.lEUt * (long)this.mEfficiency / 10000L); + return true; + } else if (this.lEUt < 0 && !this.drainEnergyInput((long)(-this.lEUt) * 10000L / (long)Math.max(1000, this.mEfficiency))) { + this.stopMachine(); + return false; + } else { + return true; + } + } + + + @Override + public void stopMachine() { + this.mOutputItems = null; + this.mEUt = 0; + this.lEUt = 0; + this.mEfficiency = 0; + this.mProgresstime = 0; + this.mMaxProgresstime = 0; + this.mEfficiencyIncrease = 0; + this.getBaseMetaTileEntity().disableWorking(); + } + + public String[] getInfoData() { + int mPollutionReduction = 0; + + for (GT_MetaTileEntity_Hatch_Muffler e : this.mMufflerHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(e)) { + mPollutionReduction = Math.max(e.calculatePollutionReduction(this.mPollution), mPollutionReduction); + } + } + + long storedEnergy = 0L; + long maxEnergy = 0L; + + for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + } + } + + return new String[]{StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + Integer.toString(this.mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + Integer.toString(this.mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET + " EU", StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + Long.toString(-this.lEUt) + EnumChatFormatting.RESET + " EU/t", StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + Long.toString(this.getMaxInputVoltage()) + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(this.getMaxInputVoltage())] + EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + (this.getIdealStatus() - this.getRepairStatus()) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW + Float.toString((float)this.mEfficiency / 100.0F) + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %"}; + } + + private long lEUt = 0; + public boolean drainEnergyInput(long aEU) { if (aEU <= 0) return true; @@ -197,23 +252,23 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl byte overclockCount = 0; long actualEUT = (long) (tRecipe.mEUt) * processed; - if (actualEUT > Integer.MAX_VALUE) { - byte divider = 0; - while (actualEUT > Integer.MAX_VALUE) { - actualEUT = actualEUT / 2; - divider++; - } - overclockCount = this.calculateOverclockednessEBF((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), nominalV); - } else +// if (actualEUT > Integer.MAX_VALUE) { +// byte divider = 0; +// while (actualEUT > Integer.MAX_VALUE) { +// actualEUT = actualEUT / 2; +// divider++; +// } +// overclockCount = this.calculateOverclockednessEBF((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), nominalV); +// } else overclockCount = this.calculateOverclockednessEBF(actualEUT, tRecipe.mDuration, nominalV); //In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); + if (this.lEUt > 0) { + this.lEUt = (-this.lEUt); } if (tHeatCapacityDivTiers > 0) { - this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); + this.lEUt = (int) (this.lEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount); //extra free overclocking if possible if (this.mMaxProgresstime < 1) this.mMaxProgresstime = 1;//no eu efficiency correction @@ -245,10 +300,10 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl long xMaxProgresstime = ((long) aDuration) << 1; if (xMaxProgresstime > Integer.MAX_VALUE - 1) { //make impossible if too long - this.mEUt = Integer.MAX_VALUE - 1; + this.lEUt = Integer.MAX_VALUE - 1; this.mMaxProgresstime = Integer.MAX_VALUE - 1; } else { - this.mEUt = (int) (aEUt >> 2); + this.lEUt = (int) (aEUt >> 2); this.mMaxProgresstime = (int) xMaxProgresstime; } //return 0; @@ -273,12 +328,12 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl timesOverclocked--; } if (xEUt > Integer.MAX_VALUE - 1) { - this.mEUt = Integer.MAX_VALUE - 1; + this.lEUt = Integer.MAX_VALUE - 1; this.mMaxProgresstime = Integer.MAX_VALUE - 1; } else { - this.mEUt = (int) xEUt; - if (this.mEUt == 0) - this.mEUt = 1; + this.lEUt = (int) xEUt; + if (this.lEUt == 0) + this.lEUt = 1; if (this.mMaxProgresstime <= 0) this.mMaxProgresstime = 1;//set time to 1 tick } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index cbd5706d16..3c5d02cbb7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -28,6 +28,7 @@ import codechicken.nei.recipe.GuiCraftingRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_SmallOres; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; @@ -93,20 +94,29 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { GuiDraw.drawString(ChatColorHelper.BOLD + "DIM: " + ChatColorHelper.RESET + cachedOreRecipe.worldGen.getDimName(), 0, 40, 0, false); GuiDraw.drawString(ChatColorHelper.BOLD + "Primary:", 0, 50, 0, false); GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(0).item.getDisplayName(), 0, 60, 0, false); - GuiDraw.drawString(ChatColorHelper.BOLD + "Secondary:", 0, 70, 0, false); - GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(1).item.getDisplayName(), 0, 80, 0, false); - GuiDraw.drawString(ChatColorHelper.BOLD + "InBetween:", 0, 90, 0, false); - GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(2).item.getDisplayName(), 0, 100, 0, false); - GuiDraw.drawString(ChatColorHelper.BOLD + "Sporadic:", 0, 110, 0, false); - GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(3).item.getDisplayName(), 0, 120, 0, false); + + + + if (!cachedOreRecipe.small) { + GuiDraw.drawString(ChatColorHelper.BOLD + "Secondary:", 0, 70, 0, false); + GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(1).item.getDisplayName(), 0, 80, 0, false); + GuiDraw.drawString(ChatColorHelper.BOLD + "InBetween:", 0, 90, 0, false); + GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(2).item.getDisplayName(), 0, 100, 0, false); + GuiDraw.drawString(ChatColorHelper.BOLD + "Sporadic:", 0, 110, 0, false); + GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(3).item.getDisplayName(), 0, 120, 0, false); + } else { + GuiDraw.drawString(ChatColorHelper.BOLD + "Amount per Chunk:",0,70,0,false); + GuiDraw.drawString(((CachedOreRecipe) this.arecipes.get(recipe)).worldGen.mDensity+"",0,80,0, false); + } } super.drawExtras(recipe); } @Override public void loadCraftingRecipes(ItemStack result) { - if (Block.getBlockFromItem(result.getItem()) instanceof BW_MetaGenerated_Ores) { - BW_OreLayer.NEIMAP.get((short) result.getItemDamage()).forEach(l -> this.arecipes.add(new CachedOreRecipe(l, result))); + Block ore = Block.getBlockFromItem(result.getItem()); + if (ore instanceof BW_MetaGenerated_Ores) { + BW_OreLayer.NEIMAP.get((short) result.getItemDamage()).forEach(l -> this.arecipes.add(new CachedOreRecipe(l, result, ore instanceof BW_MetaGenerated_SmallOres))); } } @@ -122,11 +132,12 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { class CachedOreRecipe extends TemplateRecipeHandler.CachedRecipe{ - public CachedOreRecipe(BW_OreLayer worldGen, ItemStack result) { + public CachedOreRecipe(BW_OreLayer worldGen, ItemStack result, boolean smallOres) { this.worldGen = worldGen; this.stack = new PositionedStack(result, 0, 0); + this.small=smallOres; } - + boolean small; BW_OreLayer worldGen; PositionedStack stack ; @@ -139,7 +150,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public List getOtherStacks() { List ret = new ArrayList<>(); int x = 0; - for (int i = 0; i < 4; i++) { + for (int i = 0; i < (small ? 1 : 4); i++) { x += 20; ret.add(new PositionedStack(worldGen.getStacks().get(i), x, 12)); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index 55714c38ec..df56e4359b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -69,7 +69,7 @@ public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEn aNBT.setShort("m", this.mMetaData); } - public ArrayList getDrops(Block aDroppedOre) { + public ArrayList getDrops(Block aDroppedOre, int aFortune) { ArrayList rList = new ArrayList(); if (this.mMetaData < 0) { rList.add(new ItemStack(Blocks.cobblestone, 1, 0)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java index c6baf39118..ff5c25ef7a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java @@ -1,6 +1,5 @@ package com.github.bartimaeusnek.bartworks.system.material; -import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; @@ -9,7 +8,6 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.XSTR; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; -import gregtech.common.blocks.GT_Block_Ores_Abstract; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -19,8 +17,7 @@ import java.util.Random; public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { - @Override - public ArrayList getDrops(Block aDroppedOre) { + public ArrayList getDrops(Block aDroppedOre, int aFortune) { ArrayList rList = new ArrayList<>(); Materials aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData).getBridgeMaterial(); @@ -71,9 +68,14 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { } } if (tSelector.size() > 0) { - rList.add(GT_Utility.copyAmount(1L, tSelector.get(tRandom.nextInt(tSelector.size())))); + int i = 0; + + for(int j = Math.max(1, (aFortune > 0 ? tRandom.nextInt(1 + aFortune) : 0)); i < j; ++i) { + rList.add(GT_Utility.copyAmount(1L, tSelector.get(tRandom.nextInt(tSelector.size())))); + } + } - if (tRandom.nextInt(3) > 1) { + if (tRandom.nextInt(3 + aFortune) > 1) { rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Stone, 1L)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index eeb1f269a9..0c8d6270b3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -147,9 +147,9 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { public ArrayList getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { - return ((BW_MetaGeneratedOreTE) tTileEntity).getDrops(WerkstoffLoader.BWOres); + return ((BW_MetaGeneratedOreTE) tTileEntity).getDrops(WerkstoffLoader.BWOres,aFortune); } - return BW_MetaGenerated_Ores.mTemporaryTileEntity.get() == null ? new ArrayList() : BW_MetaGenerated_Ores.mTemporaryTileEntity.get().getDrops(WerkstoffLoader.BWOres); + return BW_MetaGenerated_Ores.mTemporaryTileEntity.get() == null ? new ArrayList() : BW_MetaGenerated_Ores.mTemporaryTileEntity.get().getDrops(WerkstoffLoader.BWOres,aFortune); } public int getHarvestLevel(int metadata) { -- cgit From 05d33ad675adcad53cbca8480f4cc6402d49f9df Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 14 Nov 2019 15:28:25 +0100 Subject: moved recipes edit +to fix CircuitAssembler Recipes +might break scripts Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 9a7dd8ebf5574611e275aef1ca3e4e3cd10e8823 --- .../github/bartimaeusnek/bartworks/MainMod.java | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 6be66988c3..34a148d499 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -54,10 +54,7 @@ import com.google.common.collect.ArrayListMultimap; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; +import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.GameRegistry; @@ -206,26 +203,27 @@ public final class MainMod { public void onServerStarted(FMLServerStartedEvent event) { MainMod.runOnPlayerJoined(ConfigHandler.classicMode, ConfigHandler.disableExtraGassesForEBF); } + @Mod.EventHandler + public void onModLoadingComplete(FMLLoadCompleteEvent event) { + removeIC2Recipes(); + MainMod.addElectricImplosionCompressorRecipes(); + PlatinumSludgeOverHaul.replacePureElements(); + new CircuitImprintLoader().run(); + runOnServerStarted(); + fixEnergyRequirements(); + MainMod.unificationEnforcer(); + } public static void runOnPlayerJoined(boolean classicMode, boolean extraGasRecipes){ OreDictHandler.adaptCacheForWorld(); if (!recipesAdded) { - removeIC2Recipes(); - MainMod.addElectricImplosionCompressorRecipes(); - MainMod.unificationEnforcer(); - - PlatinumSludgeOverHaul.replacePureElements(); - if (!extraGasRecipes) { ArrayListMultimap toChange = MainMod.getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS); HashSet noGas = MainMod.getNoGasItems(toChange); MainMod.editRecipes(toChange, noGas); } - new CircuitImprintLoader().run(); if (classicMode) new DownTierLoader().run(); - runOnServerStarted(); - fixEnergyRequirements(); // removeDuplicateRecipes(); recipesAdded = true; } -- cgit From f3ab586a9a553f03bfa8de3a95ada65622140846 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 6 Dec 2019 20:14:04 +0100 Subject: code maintenance + completely disabled GT++ ASM due to the wish of the author + repaired Unification Enforcer for items + general readability fixes + WerkstoffLoaderAPI fixes Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: b02ed0bee600695b3be09abd8ce59552676289ce --- buid.bat | 2 - build.bat | 2 + build.properties | 2 +- .../java/com/github/bartimaeusnek/ASM/BWCore.java | 2 +- .../bartimaeusnek/ASM/BWCoreTransformer.java | 14 ++-- .../github/bartimaeusnek/bartworks/MainMod.java | 4 +- .../multis/GT_TileEntity_ManualTrafo.java | 12 ++-- .../bartworks/neiHandler/BW_NEI_OreHandler.java | 20 ++++-- .../server/EventHandler/ServerEventHandler.java | 57 +++++++++++------ .../bartworks/system/material/Werkstoff.java | 22 +++++-- .../bartworks/system/material/WerkstoffLoader.java | 37 ++++++----- .../bartimaeusnek/bartworks/util/BWRecipes.java | 74 ++++++---------------- .../bartimaeusnek/bartworks/util/BW_ColorUtil.java | 2 +- .../bartimaeusnek/bartworks/util/BW_Util.java | 21 +++--- 14 files changed, 139 insertions(+), 132 deletions(-) delete mode 100644 buid.bat create mode 100644 build.bat diff --git a/buid.bat b/buid.bat deleted file mode 100644 index 3c93bfe30e..0000000000 --- a/buid.bat +++ /dev/null @@ -1,2 +0,0 @@ -call gradlew.bat build -pause \ No newline at end of file diff --git a/build.bat b/build.bat new file mode 100644 index 0000000000..3c93bfe30e --- /dev/null +++ b/build.bat @@ -0,0 +1,2 @@ +call gradlew.bat build +pause \ No newline at end of file diff --git a/build.properties b/build.properties index d24f1eb750..1b04350404 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre27 +buildNumber=2_pre29 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java index 7b25541cc3..e6143a98d2 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java @@ -64,7 +64,7 @@ public class BWCore extends DummyModContainer { shouldTransform[3] = Loader.isModLoaded("Thaumcraft") && ConfigHandler.enabledPatches[3]; shouldTransform[4] = true; shouldTransform[5] = Loader.isModLoaded("RWG") && ConfigHandler.enabledPatches[5]; - shouldTransform[6] = true; + //shouldTransform[6] = true; BWCore.BWCORE_LOG.info("Extra Utilities found and ASM Patch enabled? " + shouldTransform[0]); BWCore.BWCORE_LOG.info("Thaumcraft found and ASM Patch enabled? " + shouldTransform[3]); BWCore.BWCORE_LOG.info("RWG found and ASM Patch enabled? " + shouldTransform[5]); diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index cb0f49c07b..f880ed0321 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -40,7 +40,7 @@ public class BWCoreTransformer implements IClassTransformer { "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", "PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API", "DUCTTAPING RWG WORLDEN FAILS", - "REMOVING 12% BONUS OUTPUTS FROM GT++ SIFTER" + // "REMOVING 12% BONUS OUTPUTS FROM GT++ SIFTER" }; public static final String[] CLASSESBEEINGTRANSFORMED = { "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", @@ -49,7 +49,7 @@ public class BWCoreTransformer implements IClassTransformer { "thaumcraft.common.tiles.TileWandPedestal", "gregtech.GT_Mod", "rwg.world.ChunkGeneratorRealistic", - "gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialSifter" + // "gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialSifter" }; static boolean obfs; @@ -286,11 +286,11 @@ public class BWCoreTransformer implements IClassTransformer { } } } - case 6: { - BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - ((IntInsnNode) methods.get(11).instructions.get(10)).operand = 10000; - break scase; - } +// case 6: { +// BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); +// ((IntInsnNode) methods.get(11).instructions.get(10)).operand = 10000; +// break scase; +// } default: { BWCore.BWCORE_LOG.info("Could not find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); return basicClass; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 34a148d499..f9674b72c7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -155,10 +155,10 @@ public final class MainMod { public void init(FMLInitializationEvent init) { if (FMLCommonHandler.instance().getSide().isClient() && ConfigHandler.tooltips) MinecraftForge.EVENT_BUS.register(new TooltipEventHandler()); + ServerEventHandler serverEventHandler = new ServerEventHandler(); if (FMLCommonHandler.instance().getSide().isServer()) { - ServerEventHandler serverEventHandler = new ServerEventHandler(); MinecraftForge.EVENT_BUS.register(serverEventHandler); -// FMLCommonHandler.instance().bus().register(serverEventHandler); + FMLCommonHandler.instance().bus().register(serverEventHandler); } if (ConfigHandler.BioLab) new BioLabLoader().run(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index 9543643c3c..9f830eeeda 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -49,7 +49,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase private static final byte MULTI_UPSTEP = 2; private static final byte MULTI_DOWNSTEP = 3; private byte mode; - private final byte texid = 2; + private byte texid = 2; private long mCoilWicks; private boolean upstep = true; @@ -93,9 +93,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase return this.onRunningTickTabbedMode(); } - boolean ret = this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput(this.getInputTier() * 2 * this.mEnergyHatches.size() * (long) this.mEfficiency / this.getMaxEfficiency(null)); - - return ret; + return this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput(this.getInputTier() * 2 * this.mEnergyHatches.size() * (long) this.mEfficiency / this.getMaxEfficiency(null)); } public boolean onRunningTickTabbedMode() { @@ -109,7 +107,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase continue; long vtp = E.getEUVar() + (vtt); - long avt = vtp < E.maxEUStore() ? vtp : E.maxEUStore(); + long avt = Math.min(vtp, E.maxEUStore()); E.setEUVar(avt); I.setEUVar(I.getEUVar() - vtt); ret = true; @@ -142,7 +140,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase this.upstep = (this.mode == 0 || this.mode == 2); this.mProgresstime = 0; this.mMaxProgresstime = 1; - this.mEfficiency = this.mEfficiency > 100 ? this.mEfficiency : 100; + this.mEfficiency = Math.max(this.mEfficiency, 100); return this.upstep ? this.getOutputTier() - this.getInputTier() == this.mCoilWicks : this.getInputTier() - this.getOutputTier() == this.mCoilWicks; } @@ -168,7 +166,6 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase ++this.mCoilWicks; if (this.mCoilWicks % 8 == 0) { ++y; - continue; } } else break; @@ -253,7 +250,6 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase ++this.mCoilWicks; if (this.mCoilWicks % 8 == 0) { ++y; - continue; } } else break; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index 3c5d02cbb7..0bf633dcf2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -31,6 +31,8 @@ import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_SmallOres; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer; +import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b; +import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128ba; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.enums.OrePrefixes; @@ -74,6 +76,10 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { HashSet result = new HashSet<>(); Werkstoff.werkstoffHashSet.stream().filter(w -> w.getGenerationFeatures().hasOres()).forEach(w -> result.add(w.get(OrePrefixes.ore))); result.forEach(this::loadCraftingRecipes); + result.clear(); + Werkstoff.werkstoffHashSet.stream().filter(w -> w.getGenerationFeatures().hasOres()).forEach(w -> result.add(w.get(OrePrefixes.oreSmall))); + result.forEach(this::loadCraftingRecipes); + result.clear(); HashSet hashSet = new HashSet<>(this.arecipes); this.arecipes.clear(); this.arecipes.addAll(hashSet); @@ -95,8 +101,6 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { GuiDraw.drawString(ChatColorHelper.BOLD + "Primary:", 0, 50, 0, false); GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(0).item.getDisplayName(), 0, 60, 0, false); - - if (!cachedOreRecipe.small) { GuiDraw.drawString(ChatColorHelper.BOLD + "Secondary:", 0, 70, 0, false); GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(1).item.getDisplayName(), 0, 80, 0, false); @@ -116,7 +120,13 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public void loadCraftingRecipes(ItemStack result) { Block ore = Block.getBlockFromItem(result.getItem()); if (ore instanceof BW_MetaGenerated_Ores) { - BW_OreLayer.NEIMAP.get((short) result.getItemDamage()).forEach(l -> this.arecipes.add(new CachedOreRecipe(l, result, ore instanceof BW_MetaGenerated_SmallOres))); + BW_OreLayer.NEIMAP.get( + (short) result.getItemDamage()) + .stream() + .filter(l -> !(ore instanceof BW_MetaGenerated_SmallOres) || + !(l.getClass().equals(BW_WorldGenRoss128b.class) || + l.getClass().equals(BW_WorldGenRoss128ba.class))) + .forEach(l -> this.arecipes.add(new CachedOreRecipe(l, result, ore instanceof BW_MetaGenerated_SmallOres))); } } @@ -135,11 +145,11 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public CachedOreRecipe(BW_OreLayer worldGen, ItemStack result, boolean smallOres) { this.worldGen = worldGen; this.stack = new PositionedStack(result, 0, 0); - this.small=smallOres; + this.small = smallOres; } boolean small; BW_OreLayer worldGen; - PositionedStack stack ; + PositionedStack stack; @Override public PositionedStack getResult() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java index 0b2822dae8..eeb8772b15 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java @@ -25,15 +25,22 @@ package com.github.bartimaeusnek.bartworks.server.EventHandler; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.net.OreDictCachePacket; import com.github.bartimaeusnek.bartworks.common.net.ServerJoinedPackage; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.oredict.OreDictionary; public class ServerEventHandler { + //MinecraftForge.EVENT_BUS @SubscribeEvent(priority = EventPriority.LOWEST) public void EntityJoinWorldEvent(EntityJoinWorldEvent event) { if (event == null || !(event.entity instanceof EntityPlayerMP) || !FMLCommonHandler.instance().getSide().isServer()) @@ -42,23 +49,35 @@ public class ServerEventHandler { MainMod.BW_Network_instance.sendToPlayer(new ServerJoinedPackage(null),(EntityPlayerMP) event.entity); } -// @SubscribeEvent(priority = EventPriority.HIGHEST) -// public void onPlayerTickEventServer(TickEvent.PlayerTickEvent event) { -// if (!BWUnificationEnforcer.isEnabled() || event == null || !(event.player instanceof EntityPlayerMP) || !FMLCommonHandler.instance().getSide().isServer()) -// return; -// -// for (int i = 0; i < event.player.inventory.mainInventory.length; i++) { -// ItemStack stack = event.player.inventory.mainInventory[i]; -// for (int id : OreDictionary.getOreIDs(stack)) -// if (BWUnificationEnforcer.getUnificationTargets().contains(OreDictionary.getOreName(id))){ -// ArrayList stacks = OreDictionary.getOres(OreDictionary.getOreName(id)); -// for (int j = 0; j < stacks.size(); j++) { -// GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(stacks.get(j).getItem()); -// if (UI.modId.equals(MainMod.MOD_ID)){ -// event.player.inventory.mainInventory[i] = stacks.get(j).copy().splitStack(stack.stackSize); -// } -// } -// } -// } -// } + //FMLCommonHandler.instance().bus() + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onPlayerTickEventServer(TickEvent.PlayerTickEvent event) { + if (event == null || !(event.player instanceof EntityPlayerMP)) + return; + + boolean replace = false; + ItemStack toReplace = null; + for (int i = 0; i < event.player.inventory.mainInventory.length; i++) { + ItemStack stack = event.player.inventory.mainInventory[i]; + if (stack == null) + continue; + int[] oreIDs = OreDictionary.getOreIDs(stack); + if (oreIDs.length > 0){ + for (int oreID : oreIDs) { + String oreDictName = OreDictionary.getOreName(oreID); + for (Werkstoff e : Werkstoff.werkstoffHashSet) { + replace = e.getGenerationFeatures().enforceUnification; + if (replace && oreDictName.contains(e.getVarName())) { + String prefix = oreDictName.replace(e.getVarName(), ""); + toReplace = GT_OreDictUnificator.get(OrePrefixes.getPrefix(prefix),e.getVarName(),stack.stackSize); + } + } + } + } + if (replace) { + event.player.inventory.setInventorySlotContents(i, toReplace); + replace = false; + } + } + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index bb2e825bb9..b71cb43c24 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -182,10 +182,19 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.texSet = texSet; - if (this.mOreByProducts.isEmpty()) { - this.mOreByProducts.add(this); - this.mOreByProducts.add(this); - this.mOreByProducts.add(this); + switch(this.mOreByProducts.size()) { + case 0 : + this.mOreByProducts.add(this); + this.mOreByProducts.add(this); + this.mOreByProducts.add(this); + break; + case 1: + this.mOreByProducts.add(this); + this.mOreByProducts.add(this); + break; + case 2: + this.mOreByProducts.add(this); + break; } Werkstoff.werkstoffHashSet.add(this); @@ -368,7 +377,6 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(this)),fluidAmount); } - public ItemStack get(OrePrefixes prefixes, int amount) { return WerkstoffLoader.getCorrespondingItemStack(prefixes, this, amount); } @@ -387,7 +395,6 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.stats.durOverride > 0 ? this.stats.durOverride : (int) (this.stats.durMod * ((0.01f * (float) this.getStats().getMeltingPoint() * (float) this.getStats().getMass()) / (float) this.getContents().getKey())); } - public enum Types { MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, ELEMENT, ISOTOPE, UNDEFINED; @@ -697,7 +704,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } - public Werkstoff.Stats setmTC_AspectsVarArg(Pair... mTC_Aspects) { + @SafeVarargs + public final Werkstoff.Stats setmTC_AspectsVarArg(Pair... mTC_Aspects) { this.mTC_Aspects = mTC_Aspects; return this; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index e2778cc0dc..15133368b4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -34,6 +34,7 @@ import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import com.google.common.collect.HashBiMap; @@ -76,6 +77,7 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Util.subscriptNumbers; import static com.github.bartimaeusnek.bartworks.util.BW_Util.superscriptNumbers; import static gregtech.api.enums.OrePrefixes.*; +@SuppressWarnings({"unchecked", "unused", "deprecation"}) public class WerkstoffLoader implements Runnable { private WerkstoffLoader() {} @@ -117,7 +119,7 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.boltMold = Enum.valueOf(ItemList.class, "Shape_Mold_Bolt"); } catch (NullPointerException | IllegalArgumentException ignored){} //add tiberium - Element t = EnumHelper.addEnum(Element.class,"Tr",new Class[]{long.class, long.class, long.class, long.class, String.class, String.class, boolean.class}, new Object[]{123L, 203L, 0L, -1L, (String) null, "Tiberium", false}); + Element t = BW_Util.createNewElement("Tr",123L, 203L, 0L, -1L, null, "Tiberium", false); //add molten & regular capsuls if (Loader.isModLoaded("Forestry")) { capsuleMolten = EnumHelper.addEnum(OrePrefixes.class, "capsuleMolten", new Class[]{String.class, String.class, String.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, int.class, long.class, int.class, int.class}, new Object[]{"Capsule of Molten stuff", "Molten ", " Capsule", true, true, true, true, false, false, false, true, false, false, 0b1000000, 3628800L, 64, -1}); @@ -127,8 +129,10 @@ public class WerkstoffLoader implements Runnable { bottle.mDefaultStackSize = 1; } - //TODO: FREE ID RANGE: 91-32766 - + //TODO: + //FREE ID RANGE: 95-30000 + //bartimaeusnek reserved 0-10000 + //Tec & basdxz reserved range 30000-32767 public static final Werkstoff Bismutite = new Werkstoff( new short[]{255, 233, 0, 0}, "Bismutite", @@ -136,7 +140,7 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().addGems(), 1, TextureSet.SET_FLINT, - Arrays.asList(Materials.Bismuth), + Collections.singletonList(Materials.Bismuth), new Pair<>(Materials.Bismuth, 2), new Pair<>(Materials.Oxygen, 2), new Pair<>(Materials.CarbonDioxide, 2) @@ -171,7 +175,7 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().onlyDust().addGems().enforceUnification(), 4, TextureSet.SET_DIAMOND, - Arrays.asList(WerkstoffLoader.Zirconium), + Collections.singletonList(WerkstoffLoader.Zirconium), new Pair<>(WerkstoffLoader.Zirconium, 1), new Pair<>(Materials.Oxygen, 2) ); @@ -357,7 +361,7 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures(), 18, TextureSet.SET_METALLIC, - Arrays.asList(Materials.Thorium), + Collections.singletonList(Materials.Thorium), new Pair<>(Materials.Thorium, 1), new Pair<>(Materials.Oxygen, 2) ); @@ -395,7 +399,7 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().addGems().addSifterRecipes(), 21, TextureSet.SET_FLINT, - Arrays.asList(Materials.Spodumene), + Collections.singletonList(Materials.Spodumene), new Pair<>(Materials.Spodumene, 1) ); public static final Werkstoff RockSalt = new Werkstoff( @@ -517,7 +521,7 @@ public class WerkstoffLoader implements Runnable { superscriptNumbers("Th232"), new Werkstoff.Stats().setRadioactive(true), Werkstoff.Types.ISOTOPE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), + new Werkstoff.GenerationFeatures().disable().onlyDust().enforceUnification(), 30, TextureSet.SET_METALLIC //No Byproducts @@ -1359,11 +1363,10 @@ public class WerkstoffLoader implements Runnable { if (!this.registered) { MainMod.LOGGER.info("Loading Processing Recipes for BW Materials"); long timepre = System.nanoTime(); - ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashMap.size()+1); + ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashSet.size()+1); DebugLog.log("Loading Recipes"+(System.nanoTime()-timepre)); - for (short i = 0; i < Werkstoff.werkstoffHashMap.size(); i++) { + for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { long timepreone = System.nanoTime(); - Werkstoff werkstoff = Werkstoff.werkstoffHashMap.get(i); DebugLog.log("Werkstoff is null or id < 0 ? "+ (werkstoff==null || werkstoff.getmID() < 0) + " " + (System.nanoTime()-timepreone)); if (werkstoff == null || werkstoff.getmID() < 0) { progressBar.step(""); @@ -1448,7 +1451,7 @@ public class WerkstoffLoader implements Runnable { Materials.RockSalt.mToolQuality = WerkstoffLoader.RockSalt.getToolQuality(); Materials.Calcium.mToolQuality = WerkstoffLoader.Calcium.getToolQuality(); - for (Werkstoff W : Werkstoff.werkstoffHashMap.values()) { + for (Werkstoff W : Werkstoff.werkstoffHashSet) { for (Pair pair : W.getContents().getValue().toArray(new Pair[0])) { if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Neodymium) { @@ -2279,16 +2282,16 @@ public class WerkstoffLoader implements Runnable { // } //Tank "Recipe" - GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(WerkstoffLoader.fluids.get(werkstoff), 1000),werkstoff.get(cell),Materials.Empty.getCells(1))); + GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000),werkstoff.get(cell),Materials.Empty.getCells(1))); FluidContainerRegistry.registerFluidContainer(werkstoff.getFluidOrGas(1).getFluid(),werkstoff.get(cell),Materials.Empty.getCells(1)); - GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(fluids.get(werkstoff),1000), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(fluids.get(werkstoff),1000)); + GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)),1000), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)),1000)); if (Loader.isModLoaded("Forestry")) { - FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(WerkstoffLoader.fluids.get(werkstoff), 1000), werkstoff.get(capsule), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), true); + FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(capsule), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), true); GT_Utility.addFluidContainerData(emptyData); FluidContainerRegistry.registerFluidContainer(emptyData); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsule), GT_Values.NI, GT_Values.NF, new FluidStack(fluids.get(werkstoff), 1000)); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsule), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), 1000)); } if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0){ diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 16d306d05f..2e3e8cf698 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -336,56 +336,40 @@ public class BWRecipes { } public boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) - return true; - return false; + return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; } public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, aFluidInputs, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null) - return true; - return false; + return sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, aFluidInputs, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null; } public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, new FluidStack[]{aFluidInputs}, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null) - return true; - return false; + return sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, new FluidStack[]{aFluidInputs}, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null; } @Deprecated public boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[0], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) - return true; - return false; + return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[0], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; } @Deprecated public boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[1], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) - return true; - return false; + return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[1], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; } @Deprecated public boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[2], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) - return true; - return false; + return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[2], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; } @Deprecated public boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[3], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) - return true; - return false; + return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[3], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; } @Deprecated public boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[4], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null) - return true; - return false; + return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[4], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; } @Deprecated @@ -395,9 +379,7 @@ public class BWRecipes { aSievert += calculateSv(material); aSievert = aSievert << 6; aSievert = aSievert | glasTier; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) - return true; - return false; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; } public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, @Nonnegative int aSv, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { @@ -411,9 +393,7 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) - return true; - return false; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; } public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { @@ -427,9 +407,7 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) - return true; - return false; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; } @Deprecated @@ -440,9 +418,7 @@ public class BWRecipes { aSievert = aSievert << 1; aSievert = aSievert | (exactSv ? 1 : 0); aSievert = aSievert << 6; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) - return true; - return false; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; } public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture culture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, int aSpecialValue, boolean exactSv) { @@ -454,9 +430,7 @@ public class BWRecipes { aSievert = aSievert << 2; aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) - return true; - return false; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; } /** @@ -464,20 +438,15 @@ public class BWRecipes { */ public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture culture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, byte glasTier) { int aSievert = 0; - aSievert = aSievert << 7; aSievert = aSievert | glasTier; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) - return true; - return false; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; } /** * Adds a Vat recipe without Rad or Glas requirements */ public boolean addBacterialVatRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, BioCulture culture, FluidStack[] aFluidOutputs, int aDuration, int aEUt) { - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, 0)) != null) - return true; - return false; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, 0)) != null; } @@ -492,9 +461,7 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(true, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null) - return true; - return false; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe(true, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; } public static class DynamicGTRecipe extends GT_Recipe implements Serializable { @@ -538,7 +505,7 @@ public class BWRecipes { protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) { aRecipe.mHidden = aHidden; aRecipe.mFakeRecipe = aFakeRecipe; - GT_Recipe isthere = this.findRecipe((IHasWorldObjectAndCoords) null, false, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs); + GT_Recipe isthere = this.findRecipe(null, false, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs); if (aRecipe.mFluidInputs.length < this.mMinimalInputFluids && aRecipe.mInputs.length < this.mMinimalInputItems) { return null; @@ -562,7 +529,7 @@ public class BWRecipes { nu1[nu1.length - 1] = GT_Utility.getIntegratedCircuit(9 + nu1.length); aRecipe.mInputs = nu1; } - if (this.findRecipe((IHasWorldObjectAndCoords) null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null) { + if (this.findRecipe(null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null) { ItemStack[] nu = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1); int i = 9 + nu.length; do { @@ -574,7 +541,7 @@ public class BWRecipes { if (i == 9 + nu.length) return null; } - while (this.findRecipe((IHasWorldObjectAndCoords) null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null); + while (this.findRecipe(null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null); } return this.addRecipe(aRecipe, false, false, false); } @@ -621,7 +588,7 @@ public class BWRecipes { } // Unification happens here in case the Input isn't already unificated. - if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs); + if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object) aInputs); // Check the Recipe which has been used last time in order to not have to search for it again, if possible. if (aRecipe != null) @@ -665,6 +632,7 @@ public class BWRecipes { Map charToStackMap = new HashMap<>(9,1); String[] shape; + @SuppressWarnings({"SuspiciousSystemArraycopy"}) public BWNBTDependantCraftingRecipe(ItemStack result, Object... recipe) { this.result = result; this.shape = new String[3]; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java index 95af2d9738..2c01562b8a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java @@ -25,7 +25,7 @@ package com.github.bartimaeusnek.bartworks.util; import gregtech.api.enums.Dyes; import java.util.Arrays; - +@SuppressWarnings("unused") public class BW_ColorUtil { private BW_ColorUtil(){} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 1a34c11359..f9d803ef10 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import gregtech.api.enums.Element; import gregtech.api.enums.Materials; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; @@ -38,17 +39,19 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import javax.annotation.Nonnegative; import javax.annotation.Nonnull; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import static gregtech.api.enums.GT_Values.V; - +@SuppressWarnings("unused") public class BW_Util { public static final int STANDART = 0; @@ -201,9 +204,7 @@ public class BW_Util { } public static int calculateSv(Materials materials) { - Iterator it = BioVatLogicAdder.RadioHatch.getMaSv().iterator(); - while (it.hasNext()) { - BioVatLogicAdder.MaterialSvPair pair = (BioVatLogicAdder.MaterialSvPair) it.next(); + for (BioVatLogicAdder.MaterialSvPair pair : BioVatLogicAdder.RadioHatch.getMaSv()) { if (pair.getMaterials().equals(materials)) return pair.getSievert(); } @@ -344,10 +345,8 @@ public class BW_Util { public static long getnominalVoltage(GT_MetaTileEntity_MultiBlockBase base) { long rVoltage = 0L; long rAmperage = 0L; - Iterator var3 = base.mEnergyHatches.iterator(); - while (var3.hasNext()) { - GT_MetaTileEntity_Hatch_Energy tHatch = (GT_MetaTileEntity_Hatch_Energy) var3.next(); + for (GT_MetaTileEntity_Hatch_Energy tHatch : base.mEnergyHatches) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { if (rVoltage == 0 || rVoltage > tHatch.getBaseMetaTileEntity().getInputVoltage()) rVoltage = tHatch.getBaseMetaTileEntity().getInputVoltage(); @@ -374,6 +373,10 @@ public class BW_Util { } + public static Element createNewElement(String variableName, long aProtons, long aNeutrons, long aAdditionalMass, long aHalfLifeSeconds, String aDecayTo, String aName, boolean aIsIsotope){ + return EnumHelper.addEnum(Element.class,variableName,new Class[]{long.class, long.class, long.class, long.class, String.class, String.class, boolean.class}, new Object[]{aProtons, aNeutrons, aAdditionalMass, aHalfLifeSeconds, aDecayTo, aName, aIsIsotope}); + } + public static EnumRarity getRarityFromByte(byte b) { switch (b) { case 1: -- cgit From b16c70e48cf7c35fd8d3552d0cb1ed6191b4b569 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 6 Dec 2019 20:45:46 +0100 Subject: WerkstoffLoaderAPI fixes Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: c95af8174bf3e49b23c31e0fa984b669ac50274d --- .../bartworks/system/material/BW_MetaGenerated_Items.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 6f0365d412..6e0f198290 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -58,6 +58,7 @@ import net.minecraft.world.World; import java.util.List; import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap; +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashSet; public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRadMaterial { @@ -69,7 +70,6 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } }; protected final OrePrefixes orePrefixes; - private final short aNumToGen = (short) werkstoffHashMap.size(); public BW_MetaGenerated_Items(OrePrefixes orePrefixes, Object unused){ super("bwMetaGeneratedGTEnhancement" + orePrefixes.name(), (short) 32766, (short) 0); @@ -80,10 +80,9 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa super("bwMetaGenerated" + orePrefixes.name(), (short) 32766, (short) 0); this.orePrefixes = orePrefixes; this.setCreativeTab(BW_MetaGenerated_Items.metaTab); - for (int i = 0; i < this.aNumToGen; i++) { - ItemStack tStack = new ItemStack(this, 1, i); - Werkstoff w = werkstoffHashMap.get((short) i); - if (w == null || ((w.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) != 0) ) + for (Werkstoff w : werkstoffHashSet) { + ItemStack tStack = new ItemStack(this, 1, w.getmID()); + if (((w.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) != 0) ) continue; if ((w.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes) != 0) continue; @@ -172,10 +171,9 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override @SideOnly(Side.CLIENT) public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { - for (int i = 0; i < this.aNumToGen; i++) { - Werkstoff werkstoff = werkstoffHashMap.get((short) i); + for (Werkstoff werkstoff : werkstoffHashSet) { if (werkstoff != null && ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) != 0) && ((werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0)) { - ItemStack tStack = new ItemStack(this, 1, i); + ItemStack tStack = new ItemStack(this, 1, werkstoff.getmID()); aList.add(tStack); } } -- cgit From c46c6723e6a7af3edd6d3f660901388d7e01389e Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 6 Dec 2019 20:52:24 +0100 Subject: WerkstoffLoaderAPI fixes Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 953e1f8f195691105e3bcefedc3f34fb101ac71d --- .../bartworks/system/material/BW_MetaGeneratedFrames.java | 6 +++--- .../bartworks/system/material/BW_MetaGenerated_Ores.java | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java index 0bf9f2a6f6..d519da3ef6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java @@ -47,11 +47,11 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { mMaterial = aMaterial; GT_OreDictUnificator.registerOre(OrePrefixes.frameGt, aMaterial, getStackForm(1)); - GT_ModHandler.addCraftingRecipe(getStackForm(2), RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SSS", "SwS", "SSS", 'S', OrePrefixes.stick.get(mMaterial)}); - RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 4), ItemList.Circuit_Integrated.getWithDamage(0, 4), getStackForm(1), 64, 8); + GT_ModHandler.addCraftingRecipe(getStackForm(2), RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SSS", "SwS", "SSS", 'S', mMaterial.get(OrePrefixes.stick)}); + RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.getVarName(), 4), ItemList.Circuit_Integrated.getWithDamage(0, 4), getStackForm(1), 64, 8); } - public BW_MetaGeneratedFrames(String aName, Werkstoff aMaterial) { + private BW_MetaGeneratedFrames(String aName, Werkstoff aMaterial) { super(aName, 0); mMaterial = aMaterial; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 0c8d6270b3..d4a7ec89a3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -163,10 +163,9 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { @Override public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { - for (int i = 0; i < Werkstoff.werkstoffHashSet.size(); i++) { - Werkstoff tMaterial = Werkstoff.werkstoffHashMap.get((short) i); + for (Werkstoff tMaterial : Werkstoff.werkstoffHashSet) { if ((tMaterial != null) && ((tMaterial.getGenerationFeatures().toGenerate & 0x8) != 0) && ((tMaterial.getGenerationFeatures().blacklist & 0x8) == 0)) { - aList.add(new ItemStack(aItem, 1, i)); + aList.add(new ItemStack(aItem, 1, tMaterial.getmID())); } } } -- cgit From 524418b7dd38f6d2b6ef2b536243b0c7b85483d5 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 8 Dec 2019 01:31:05 +0100 Subject: Fixed Numbers in Loader + fixed Werkstoff Mixer recipes not generating + fixed insaine high voltage, and insaine short time requirements for FluidExtractionRecipe and FluidSolidifierRecipe + fixed ElectrolyzerRecipes, CentrifugeRecipes, ChemicalRecipes, MultiblockChemicalRecipes, MixerRecipes time + added not yet enabled TT integrated ManualTrafo Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 0e0b878ded7e1780bb71004cd6cb76016ca562e6 --- build.properties | 2 +- .../bartworks/common/loaders/RecipeLoader.java | 2 +- .../bartworks/system/material/WerkstoffLoader.java | 38 +++--- .../tectech/TT_TileEntity_ManualTrafo.java | 137 +++++++++++++++++++++ 4 files changed, 158 insertions(+), 21 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java diff --git a/build.properties b/build.properties index 1b04350404..aa6089b7de 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre29 +buildNumber=2_pre30 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 1f9968c9a3..f274260d13 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -483,7 +483,7 @@ public class RecipeLoader implements Runnable { ); GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "bw.manualtrafo", StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L), + /*Loader.isModLoaded("tectech") ? new TT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "bw.manualtrafo", StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L) :*/ new GT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "bw.manualtrafo", StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L), RecipeLoader.BITSD, new Object[]{ "SCS", diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 15133368b4..4c92f195f1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1971,7 +1971,7 @@ public class WerkstoffLoader implements Runnable { HashMap> tracker = new HashMap<>(); int cells = 0; - if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { + if (werkstoff.getGenerationFeatures().hasMixerRecipes() || werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { if (container.getKey() instanceof Materials) { if (((Materials) container.getKey()).getGas(0) != null || ((Materials) container.getKey()).getFluid(0) != null || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { @@ -2052,19 +2052,19 @@ public class WerkstoffLoader implements Runnable { ItemStack input = werkstoff.get(dust); input.stackSize = werkstoff.getContents().getKey(); if (werkstoff.getStats().isElektrolysis()) - GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); + GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); if (werkstoff.getStats().isCentrifuge()) - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0)); - GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0); + GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0)); + GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0); } if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0)); + GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0)); } } @@ -2295,8 +2295,8 @@ public class WerkstoffLoader implements Runnable { } if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0){ - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getFluidOrGas(1000),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - GT_Values.RA.addFluidSolidifierRecipe(GT_Utility.getIntegratedCircuit(1), werkstoff.getFluidOrGas(1000), werkstoff.get(dust), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getFluidOrGas(1000),0,(int) werkstoff.getStats().mass,werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe(GT_Utility.getIntegratedCircuit(1), werkstoff.getFluidOrGas(1000), werkstoff.get(dust), (int) werkstoff.getStats().mass,werkstoff.getStats().getMass() > 128 ? 64 : 30); } if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { @@ -2349,21 +2349,21 @@ public class WerkstoffLoader implements Runnable { } if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot),null,werkstoff.getMolten(144),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000000) != 0) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong), null, werkstoff.getMolten(144), 0, werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate), null, werkstoff.getMolten(144), 0, werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick), null, werkstoff.getMolten(72), 0, werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick), null, werkstoff.getMolten(72), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); } - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget),null,werkstoff.getMolten(16),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget),null,werkstoff.getMolten(16),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); } else if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b10) == 0){ - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall),null,werkstoff.getMolten(36),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny),null,werkstoff.getMolten(16),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getMolten(144),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall),null,werkstoff.getMolten(36),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny),null,werkstoff.getMolten(16),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); } } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java new file mode 100644 index 0000000000..b62ec218b5 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java @@ -0,0 +1,137 @@ +package com.github.bartimaeusnek.crossmod.tectech; + +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; + +import java.util.ArrayList; +import java.util.Iterator; + +public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { + + ArrayList mTTEnerys = new ArrayList<>(); + ArrayList mTTDynamos = new ArrayList<>(); + public TT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public TT_TileEntity_ManualTrafo(String aName) { + super(aName); + } + + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new TT_TileEntity_ManualTrafo(this.mName); + } + + + public boolean addEnergyOutput(long aEU) { + if (aEU <= 0L) { + return true; + } else { + return mTTDynamos.size() > 0 || this.mDynamoHatches.size() > 0 && this.addEnergyOutputMultipleDynamos(aEU, true); + } + } + + + public boolean addEnergyOutputMultipleDynamos(long aEU, boolean aAllowMixedVoltageDynamos) { + int injected = 0; + long totalOutput = 0L; + long aFirstVoltageFound = -1L; + boolean aFoundMixedDynamos = false; + Iterator var10 = this.mDynamoHatches.iterator(); + + long aVoltage; + while(var10.hasNext()) { + GT_MetaTileEntity_Hatch_Dynamo aDynamo = (GT_MetaTileEntity_Hatch_Dynamo)var10.next(); + if (aDynamo == null) { + return false; + } + + if (isValidMetaTileEntity(aDynamo)) { + aVoltage = aDynamo.maxEUOutput(); + long aTotal = aDynamo.maxAmperesOut() * aVoltage; + if (aFirstVoltageFound == -1L) { + aFirstVoltageFound = aVoltage; + } else if (aFirstVoltageFound != aVoltage) { + aFoundMixedDynamos = true; + } + + totalOutput += aTotal; + } + } + + if (totalOutput < aEU || aFoundMixedDynamos && !aAllowMixedVoltageDynamos) { + this.explodeMultiblock(); + return false; + } else { + Iterator var17 = this.mDynamoHatches.iterator(); + + while(true) { + GT_MetaTileEntity_Hatch_Dynamo aDynamo; + do { + if (!var17.hasNext()) { + return injected > 0; + } + + aDynamo = (GT_MetaTileEntity_Hatch_Dynamo)var17.next(); + } while(!isValidMetaTileEntity(aDynamo)); + + long leftToInject = aEU - (long)injected; + aVoltage = aDynamo.maxEUOutput(); + int aAmpsToInject = (int)(leftToInject / aVoltage); + int aRemainder = (int)(leftToInject - (long)aAmpsToInject * aVoltage); + int ampsOnCurrentHatch = (int)Math.min(aDynamo.maxAmperesOut(), (long)aAmpsToInject); + + for(int i = 0; i < ampsOnCurrentHatch; ++i) { + aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage, false); + } + + injected = (int)((long)injected + aVoltage * (long)ampsOnCurrentHatch); + if (aRemainder > 0 && (long)ampsOnCurrentHatch < aDynamo.maxAmperesOut()) { + aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits((long)aRemainder, false); + injected += aRemainder; + } + } + } + } + + + + public boolean drainEnergyInput(long aEU) { + if (aEU <= 0L) { + return true; + } else { + { + Iterator var3 = this.mTTEnerys.iterator(); + + GT_MetaTileEntity_Hatch_EnergyMulti tHatch; + do { + if (!var3.hasNext()) { + return false; + } + + tHatch = (GT_MetaTileEntity_Hatch_EnergyMulti)var3.next(); + } while(!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); + } + { + Iterator var3 = this.mEnergyHatches.iterator(); + + GT_MetaTileEntity_Hatch_Energy tHatch; + do { + if (!var3.hasNext()) { + return false; + } + + tHatch = (GT_MetaTileEntity_Hatch_Energy)var3.next(); + } while(!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); + } + + return true; + } + } +} \ No newline at end of file -- cgit From ad8bf1e21b258b46bd98a694b9ccd31c1ac83eea Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 8 Dec 2019 16:36:50 +0100 Subject: Smaller fixes + added a recipe for Th232 + enforced Zr unification + added a quality override for ToolQuality + used getters for speed, dur, and quality Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: bca918b0f7e147511705d8c2051e18072250cf5e --- build.properties | 3 +-- .../tileentities/multis/GT_TileEntity_THTR.java | 7 ++++++ .../bartworks/system/material/Werkstoff.java | 27 +++++++++++++--------- .../bartworks/system/material/WerkstoffLoader.java | 4 ++-- 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/build.properties b/build.properties index aa6089b7de..2e8d567f7e 100644 --- a/build.properties +++ b/build.properties @@ -19,11 +19,10 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # - mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre30 +buildNumber=2_pre31 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 6427023dba..83dbfd0fcd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -324,6 +324,13 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { } public static void registerTHR_Recipes(){ + GT_Values.RA.addCentrifugeRecipe( + Materials.Thorium.getDust(1),GT_Values.NI,GT_Values.NF,GT_Values.NF, + Materials.Thorium.getDustSmall(2),Materials.Thorium.getDustSmall(1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1),WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1),Materials.Lutetium.getDustTiny(1), + new int[]{1600,1500,200,200,50,50}, + 10000, BW_Util.getMachineVoltageFromTier(4)); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ GT_OreDictUnificator.get(OrePrefixes.plateDense,Materials.Lead,6), GT_OreDictUnificator.get(OrePrefixes.frameGt,Materials.TungstenSteel,1) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index b71cb43c24..dd13e5c734 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -38,6 +38,7 @@ import java.lang.reflect.InvocationTargetException; import java.nio.ByteBuffer; import java.util.*; +@SuppressWarnings("ALL") public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static final LinkedHashSet werkstoffHashSet = new LinkedHashSet<>(); @@ -382,17 +383,17 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public byte getToolQuality() { - return (byte) ( (15f * (((float)this.getStats().getProtons() / 188f) + (float) this.getStats().getMeltingPoint() / 10801f)) / (float) this.getContents().getKey() ); + return this.stats.getQualityOverride() > 0 ? this.stats.getQualityOverride() : (byte) ( (15f * (((float)this.getStats().getProtons() / 188f) + (float) this.getStats().getMeltingPoint() / 10801f)) / (float) this.getContents().getKey() ); } public float getToolSpeed() { - return this.stats.speedOverride > 0f ? this.stats.speedOverride : Math.max(1f, + return this.stats.getSpeedOverride() > 0f ? this.stats.getSpeedOverride() : Math.max(1f, 2f*((float) -this.getStats().getMass() + 0.1f * (float) this.getStats().getMeltingPoint() + (float) this.getStats().getProtons()) * 0.1f / (float) this.getContents().getKey() * 0.1f * (float) this.getToolQuality() ); } public int getDurability() { - return this.stats.durOverride > 0 ? this.stats.durOverride : (int) (this.stats.durMod * ((0.01f * (float) this.getStats().getMeltingPoint() * (float) this.getStats().getMass()) / (float) this.getContents().getKey())); + return this.stats.getDurOverride() > 0 ? this.stats.getDurOverride() : (int) (this.stats.durMod * ((0.01f * (float) this.getStats().getMeltingPoint() * (float) this.getStats().getMass()) / (float) this.getContents().getKey())); } public enum Types { @@ -669,22 +670,25 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.speedOverride = speedOverride; } - public float getTierOverride() { - return tierOverride; + public byte getQualityOverride() { + return qualityOverride; } - public void setTierOverride(float tierOverride) { - this.tierOverride = tierOverride; + public void setQualityOverride(byte qualityOverride) { + this.qualityOverride = qualityOverride; } + byte qualityOverride; + int durOverride; + float speedOverride; + int meltingPoint; + long protons; long neutrons; long electrons; long mass; - int durOverride; - float speedOverride; - float tierOverride; + float durMod = 1f; public float getDurMod() { @@ -775,8 +779,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return enchantmentlvl; } - public void setEnchantmentlvl(byte enchantmentlvl) { + public Werkstoff.Stats setEnchantmentlvl(byte enchantmentlvl) { this.enchantmentlvl = enchantmentlvl; + return this; } public boolean isRadioactive() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 4c92f195f1..76749db065 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -162,7 +162,7 @@ public class WerkstoffLoader implements Runnable { "Zr", new Werkstoff.Stats().setProtons(40).setMeltingPoint(2130), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().onlyDust(), + new Werkstoff.GenerationFeatures().onlyDust().enforceUnification(), 3, TextureSet.SET_METALLIC //No Byproducts @@ -1659,7 +1659,7 @@ public class WerkstoffLoader implements Runnable { } catch (NoSuchFieldException | IllegalAccessException ignored){} werkstoffBridgeMaterial.mChemicalFormula = werkstoff.getToolTip(); if (Loader.isModLoaded("Thaumcraft")) - werkstoffBridgeMaterial.mAspects=werkstoff.getGTWrappedTCAspects(); + werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects(); werkstoffBridgeMaterial.mMaterialInto = werkstoffBridgeMaterial; werkstoffBridgeMaterial.mHandleMaterial = werkstoff.contains(SubTag.BURNING) ? Materials.Blaze : werkstoff.contains(SubTag.MAGICAL) ? Materials.Thaumium : werkstoffBridgeMaterial.mDurability > 5120 ? Materials.TungstenSteel : werkstoffBridgeMaterial.mDurability > 1280 ? Materials.Steel : Materials.Wood; //toRem.add(werkstoffBridgeMaterial); -- cgit From cc5710d5547f8766c6600e4f71962f4721fca505 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 9 Dec 2019 18:05:35 +0100 Subject: Updated Copyright Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: eea59a9e5c0ad3f66137668fdd3defd3a7ddb27b --- .../github/bartimaeusnek/bartworks/system/object/AbstractedStack.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java index a46b3b1067..2aeb8cef35 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -69,7 +69,7 @@ public class AbstractedStack implements Serializable { public AbstractedStack(ItemStack itemStack) { if (itemStack == null) throw new UnsupportedOperationException(); - this.idDamage = new Pair(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage()); + this.idDamage = new Pair<>(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage()); this.mTag = itemStack.getTagCompound(); } -- cgit From bde05cbe2d7ffa95a7dce10dc309788c5b0cbc72 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 9 Dec 2019 18:37:46 +0100 Subject: Updated Copyright +fixed or suppressed all warnings Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 72b19b4f3b8c4c2151559f06dc7455a045d7f28b --- .../com/github/bartimaeusnek/ASM/ASMUtils.java | 12 ++--- .../java/com/github/bartimaeusnek/ASM/BWCore.java | 3 +- .../com/github/bartimaeusnek/ASM/BWCorePlugin.java | 3 +- .../ASM/BWCoreStaticReplacementMethodes.java | 2 +- .../bartimaeusnek/ASM/BWCoreTransformer.java | 24 ++++------ .../bartimaeusnek/bartworks/API/API_REFERENCE.java | 2 +- .../bartworks/API/AcidGenFuelAdder.java | 2 +- .../bartworks/API/BioObjectAdder.java | 6 +-- .../bartworks/API/BioObjectGetter.java | 3 +- .../bartworks/API/BioRecipeAdder.java | 3 +- .../bartworks/API/BioVatLogicAdder.java | 8 ++-- .../bartimaeusnek/bartworks/API/INoiseGen.java | 2 +- .../bartimaeusnek/bartworks/API/IRadMaterial.java | 2 +- .../bartworks/API/ITileAddsInformation.java | 2 +- .../bartworks/API/ITileDropsContent.java | 4 +- .../API/ITileHasDifferentTextureSides.java | 6 +-- .../bartimaeusnek/bartworks/API/ITileWithGUI.java | 2 +- .../bartimaeusnek/bartworks/API/WerkstoffAPI.java | 3 +- .../bartworks/API/WerkstoffAdderRegistry.java | 6 +-- .../github/bartimaeusnek/bartworks/GuiHandler.java | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 5 +- .../client/ClientEventHandler/TooltipCache.java | 6 +-- .../ClientEventHandler/TooltipEventHandler.java | 2 +- .../bartworks/client/creativetabs/BioTab.java | 2 +- .../bartworks/client/creativetabs/GT2Tab.java | 2 +- .../client/creativetabs/bartworksTab.java | 2 +- .../gui/BW_GUIContainer_HeatedWaterPump.java | 4 +- .../client/gui/BW_GUIContainer_RadLevel.java | 2 +- .../client/gui/BW_GUIContainer_RotorBlock.java | 2 +- .../client/gui/BW_GUIContainer_Windmill.java | 2 +- .../gui/GT_GUIContainer_CircuitProgrammer.java | 2 +- .../client/gui/GT_GUIContainer_Destructopack.java | 2 +- .../bartworks/client/gui/GT_GUIContainer_LESU.java | 2 +- .../client/gui/GT_GUIContainer_RadioHatch.java | 2 +- .../client/renderer/BW_GT_ItemRenderer.java | 2 +- .../client/renderer/BW_GT_Vanilla_Texture.java | 2 +- .../client/renderer/BW_Renderer_Block_Ores.java | 2 +- .../client/renderer/RendererGlasBlock.java | 2 +- .../renderer/RendererSwitchingColorFluid.java | 52 ++++++++++---------- .../client/textures/PrefixTextureLinker.java | 26 +++++++++- .../bartworks/common/blocks/BW_Blocks.java | 3 +- .../bartworks/common/blocks/BW_GlasBlocks.java | 2 +- .../common/blocks/BW_TileEntityContainer.java | 8 ++-- .../blocks/BW_TileEntityContainer_Multiple.java | 3 +- .../bartworks/common/blocks/BioFluidBlock.java | 2 +- .../bartworks/common/commands/ChangeConfig.java | 6 +-- .../bartworks/common/commands/SummonRuin.java | 2 +- .../bartworks/common/configs/ConfigHandler.java | 2 +- .../bartworks/common/items/BW_ItemBlocks.java | 8 ++-- .../bartworks/common/items/BW_SimpleWindMeter.java | 3 +- .../bartworks/common/items/BW_Stonage_Rotors.java | 3 +- .../bartworks/common/items/Circuit_Programmer.java | 4 +- .../common/items/GT_Destructopack_Item.java | 3 +- .../bartworks/common/items/GT_Rockcutter_Item.java | 9 ++-- .../bartworks/common/items/GT_Teslastaff_Item.java | 10 ++-- .../bartworks/common/items/LabModule.java | 3 +- .../bartworks/common/items/LabParts.java | 13 +++-- .../bartworks/common/items/SimpleIconItem.java | 2 +- .../bartworks/common/items/SimpleSubItemClass.java | 4 +- .../bartworks/common/loaders/BeforeGTPreload.java | 2 +- .../bartworks/common/loaders/BioCultureLoader.java | 2 +- .../bartworks/common/loaders/BioItemList.java | 2 +- .../bartworks/common/loaders/BioLabLoader.java | 2 +- .../bartworks/common/loaders/BioRecipeLoader.java | 3 +- .../bartworks/common/loaders/FluidLoader.java | 2 +- .../bartworks/common/loaders/GTNHBlocks.java | 2 +- .../bartworks/common/loaders/ItemRegistry.java | 2 +- .../bartworks/common/loaders/LoaderRegistry.java | 4 +- .../bartworks/common/loaders/RecipeLoader.java | 3 +- .../bartworks/common/net/BW_Network.java | 3 +- .../common/net/CircuitProgrammerPacket.java | 2 +- .../bartworks/common/net/OreDictCachePacket.java | 4 +- .../bartworks/common/net/OrePacket.java | 2 +- .../bartworks/common/net/RendererPacket.java | 2 +- .../bartworks/common/net/ServerJoinedPackage.java | 2 +- .../classic/BWTileEntityDimIDBridge.java | 2 +- .../common/tileentities/classic/BW_RotorBlock.java | 2 +- .../BW_TileEntity_ExperimentalFloodGate.java | 8 ++-- .../classic/BW_TileEntity_HeatedWaterPump.java | 2 +- .../classic/BW_TileEntity_InfinityTank.java | 25 +++++----- .../common/tileentities/debug/CreativeScanner.java | 2 +- .../tileentities/multis/GT_TileEntity_BioVat.java | 29 +++++------- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 6 +-- .../multis/GT_TileEntity_CrackingDistillTower.java | 4 +- .../tileentities/multis/GT_TileEntity_DEHP.java | 7 +-- .../GT_TileEntity_ElectricImplosionCompressor.java | 5 +- .../tileentities/multis/GT_TileEntity_LESU.java | 12 ++--- .../multis/GT_TileEntity_ManualTrafo.java | 12 ++--- .../tileentities/multis/GT_TileEntity_THTR.java | 2 +- .../multis/GT_TileEntity_Windmill.java | 20 +++----- .../mega/GT_TileEntity_MegaBlastFurnace.java | 42 ++++++++--------- .../mega/GT_TileEntity_MegaDistillTower.java | 22 +++++++++ .../mega/GT_TileEntity_MegaProcessingArray.java | 28 +++++------ .../mega/GT_TileEntity_MegaVacuumFreezer.java | 18 +++---- .../tiered/GT_MetaTileEntity_AcidGenerator.java | 3 +- .../tiered/GT_MetaTileEntity_BioLab.java | 6 ++- .../GT_MetaTileEntity_CompressedFluidHatch.java | 2 +- .../tiered/GT_MetaTileEntity_Diode.java | 2 +- .../GT_MetaTileEntity_EnergyDistributor.java | 3 +- .../tiered/GT_MetaTileEntity_GiantOutputHatch.java | 2 +- .../tiered/GT_MetaTileEntity_RadioHatch.java | 8 ++-- .../tiered/GT_MetaTileEntity_Transistor.java | 2 +- .../bartworks/neiHandler/BW_NEI_BioLabHandler.java | 2 +- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 7 +-- .../bartworks/neiHandler/BW_NEI_OreHandler.java | 2 +- .../bartworks/neiHandler/NEI_BW_Config.java | 2 +- .../server/EventHandler/ServerEventHandler.java | 2 +- .../container/BW_Container_HeatedWaterPump.java | 3 +- .../server/container/BW_Container_RadioHatch.java | 3 +- .../container/GT_Container_CircuitProgrammer.java | 2 +- .../container/GT_Container_Item_Destructopack.java | 2 +- .../server/container/GT_Container_LESU.java | 2 +- .../server/container/GT_Container_RadioHatch.java | 3 +- .../server/container/Slots/BW_DelSlot.java | 3 +- .../server/container/Slots/BW_FuelSlot.java | 2 +- .../bartworks/system/log/DebugLog.java | 2 +- .../bartworks/system/log/STFUGTPPLOG.java | 2 +- .../system/material/BW_MetaGeneratedFrames.java | 2 +- .../system/material/BW_MetaGeneratedOreTE.java | 4 +- .../system/material/BW_MetaGeneratedOre_Item.java | 3 +- .../material/BW_MetaGeneratedSmallOreTE.java | 22 +++++++++ .../system/material/BW_MetaGenerated_Items.java | 13 ++--- .../system/material/BW_MetaGenerated_Ores.java | 9 ++-- .../material/BW_MetaGenerated_SmallOres.java | 22 +++++++++ .../system/material/BW_NonMeta_MaterialItems.java | 2 +- .../CircuitGeneration/BW_CircuitsLoader.java | 2 +- .../material/CircuitGeneration/BW_Meta_Items.java | 18 ++++--- .../material/CircuitGeneration/CircuitData.java | 2 +- .../CircuitGeneration/CircuitImprintLoader.java | 4 +- .../CircuitGeneration/CircuitPartLoader.java | 2 +- .../material/GT_Enhancement/BWGTMetaItems.java | 27 ++++++++++- .../GT_Enhancement/GTMetaItemEnhancer.java | 22 +++++++++ .../material/GT_Enhancement/LuVTierEnhancer.java | 3 +- .../GT_Enhancement/PlatinumSludgeOverHaul.java | 13 +++-- .../bartworks/system/material/ThreadedLoader.java | 2 +- .../bartworks/system/material/Werkstoff.java | 2 +- .../bartworks/system/material/WerkstoffLoader.java | 2 +- .../processingLoaders/AdditionalRecipes.java | 10 ++-- .../processingLoaders/AfterLuVTierEnhacement.java | 2 +- .../material/processingLoaders/DownTierLoader.java | 2 +- .../processingLoaders/LoadItemContainers.java | 2 +- .../bartworks/system/oredict/OreDictAdder.java | 3 +- .../bartworks/system/oredict/OreDictHandler.java | 2 +- .../bartworks/system/oregen/BW_OreLayer.java | 2 +- .../bartworks/system/oregen/BW_WordGenerator.java | 2 +- .../system/oregen/BW_WorldGenRoss128b.java | 2 +- .../system/oregen/BW_WorldGenRoss128ba.java | 2 +- .../bartworks/system/worldgen/GT_WorldgenUtil.java | 2 +- .../bartworks/system/worldgen/MapGenRuins.java | 4 +- .../bartimaeusnek/bartworks/util/BWRecipes.java | 10 ++-- .../bartimaeusnek/bartworks/util/BW_ColorUtil.java | 2 +- .../bartimaeusnek/bartworks/util/BW_Util.java | 2 +- .../bartimaeusnek/bartworks/util/BioCulture.java | 2 +- .../bartimaeusnek/bartworks/util/BioDNA.java | 2 +- .../bartimaeusnek/bartworks/util/BioData.java | 5 +- .../bartimaeusnek/bartworks/util/BioPlasmid.java | 2 +- .../bartworks/util/ChatColorHelper.java | 2 +- .../bartworks/util/ConnectedBlocksChecker.java | 4 +- .../util/ConnectedBlocksCheckerIteration.java | 8 ++-- .../bartimaeusnek/bartworks/util/Coords.java | 10 ++-- .../bartworks/util/NEIbartworksConfig.java | 2 +- .../bartworks/util/NoiseUtil/BartsNoise.java | 2 +- .../bartworks/util/NoiseUtil/SimplexNoise.java | 10 ++-- .../github/bartimaeusnek/bartworks/util/Pair.java | 5 +- .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 2 +- .../crossmod/GTpp/loader/RadioHatchCompat.java | 6 +-- .../crossmod/emt/recipe/TCRecipeHandler.java | 3 +- .../multi/GT_Industrial_Alchemic_Construct.java | 3 +- .../crossmod/emt/util/EMTHandler.java | 10 ++-- .../crossmod/galacticraft/GalacticraftProxy.java | 2 +- .../crossmod/galacticraft/PlanetsHelperClass.java | 2 +- .../galacticraft/UniversalTeleportType.java | 2 +- .../atmosphere/BWAtmosphereManager.java | 12 +++-- .../galacticraft/blocks/UniversalSpaceBlocks.java | 2 +- .../galacticraft/creativetabs/SpaceTab.java | 2 +- .../planets/AbstractWorldProviderSpace.java | 2 +- .../planets/ross128b/ChunkProviderRoss128b.java | 3 +- .../planets/ross128b/SkyProviderRoss128b.java | 2 +- .../planets/ross128b/WorldProviderRoss128b.java | 4 +- .../planets/ross128ba/ChunkProviderRoss128ba.java | 2 +- .../planets/ross128ba/WorldProviderRoss128Ba.java | 2 +- .../solarsystems/Ross128SolarSystem.java | 2 +- .../tileEntity/DysonSwarmSunReplacement.java | 22 +++++++++ .../galaxySpace/tileEntity/GalaxySpaceProxy.java | 22 +++++++++ .../crossmod/openComputers/GT_NBT_DataBase.java | 2 +- .../openComputers/TileEntity_GTDataServer.java | 2 +- .../tectech/TT_TileEntity_ManualTrafo.java | 55 +++++++++++++++------- .../crossmod/tectech/TecTechResearchLoader.java | 23 +++++++++ .../crossmod/thaumcraft/CustomAspects.java | 2 +- .../tile/GT_Multi_IndustrialCrucible.java | 2 +- .../crossmod/thaumcraft/tile/GT_WandBuffer.java | 22 ++++----- .../thaumcraft/util/ThaumcraftHandler.java | 3 +- 192 files changed, 699 insertions(+), 462 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java b/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java index f4b61a17ba..bdfdb29ca8 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -32,9 +32,9 @@ import java.io.OutputStream; public class ASMUtils { public static String matchAny(String toCompare, String... args) { - for (int i = 0; i < args.length; i++) { - if (toCompare.equalsIgnoreCase(args[i])) - return args[i]; + for (String arg : args) { + if (toCompare.equalsIgnoreCase(arg)) + return arg; } return ""; } @@ -43,8 +43,8 @@ public class ASMUtils { * Call this Method twice, one time for the Descriptor and one time for the Name. */ public static boolean isCorrectMethod(MethodNode methodNode, String... args) { - for (int i = 0; i < args.length; i++) { - if (methodNode.name.equalsIgnoreCase(args[i]) || methodNode.desc.equalsIgnoreCase(args[i])) + for (String arg : args) { + if (methodNode.name.equalsIgnoreCase(arg) || methodNode.desc.equalsIgnoreCase(arg)) return true; } return false; diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java index e6143a98d2..a4c8fe9dea 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -42,6 +42,7 @@ import java.util.List; import static com.github.bartimaeusnek.ASM.BWCoreTransformer.shouldTransform; +@SuppressWarnings("ALL") public class BWCore extends DummyModContainer { public static final String BWCORE_NAME = "BartWorks ASM Core"; diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java index 97f4702d4c..3d8811142d 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -67,6 +67,7 @@ public class BWCorePlugin implements IFMLLoadingPlugin { } @Override + @SuppressWarnings("rawtypes") public void injectData(Map data) { if (data.get("runtimeDeobfuscationEnabled") != null) { BWCoreTransformer.obfs = (boolean) data.get("runtimeDeobfuscationEnabled"); diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java index 505612cd35..b239563656 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index f880ed0321..4ec2f70142 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -155,9 +155,8 @@ public class BWCoreTransformer implements IClassTransformer { String field_deObfs = "locationSunPng"; String field_src = "field_110928_i"; BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - for (int i = 0; i < methods.size(); i++) { - MethodNode toPatch = methods.get(i); - if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal)) { + for (MethodNode toPatch : methods) { + if (ASMUtils.isCorrectMethod(toPatch, name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(toPatch, dsc_universal)) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); InsnList nu = new InsnList(); LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; @@ -225,9 +224,8 @@ public class BWCoreTransformer implements IClassTransformer { case 4 : { BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); String name_deObfs = ""; - for (int i = 0; i < methods.size(); i++) { - MethodNode toPatch = methods.get(i); - if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs) && (methods.get(i).access & ACC_STATIC) != 0) { + for (MethodNode toPatch : methods) { + if (ASMUtils.isCorrectMethod(toPatch, name_deObfs) && (toPatch.access & ACC_STATIC) != 0) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); InsnList nu = new InsnList(); LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; @@ -251,10 +249,8 @@ public class BWCoreTransformer implements IClassTransformer { case 5: { BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); String name_deObfs = "getNewNoise"; - for (int i = 0; i < methods.size(); i++) { - MethodNode toPatch = methods.get(i); - - if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs)) { + for (MethodNode toPatch : methods) { + if (ASMUtils.isCorrectMethod(toPatch, name_deObfs)) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; InsnList nu = new InsnList(); @@ -277,11 +273,11 @@ public class BWCoreTransformer implements IClassTransformer { nu.add(new VarInsnNode(ISTORE, 3)); nu.add(LabelNodes[1]); - for (int j = 1; j < methods.get(i).instructions.size(); j++) { - nu.add(methods.get(i).instructions.get(j)); + for (int j = 1; j < toPatch.instructions.size(); j++) { + nu.add(toPatch.instructions.get(j)); } - methods.get(i).instructions = nu; + toPatch.instructions = nu; break scase; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java index 7c2793f2b1..f9fcd4bd37 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java index 0f181a3559..9c55b47440 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java index a3c33ceac9..1035ab7d5c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -36,7 +36,7 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import java.awt.*; - +@SuppressWarnings("ALL") public final class BioObjectAdder { // @Deprecated @@ -156,7 +156,7 @@ public final class BioObjectAdder { * @return the propper Bacteria Tier (at least 0) */ public static int getBacteriaTierFromVoltageTier(int voltageTier) { - return voltageTier - 6 > 0 ? voltageTier - 6 : 0; + return Math.max(voltageTier - 6, 0); } /** diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java index edee87f534..b38fc86344 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -32,6 +32,7 @@ import net.minecraft.nbt.NBTTagCompound; import java.util.Collection; +@SuppressWarnings("ALL") public final class BioObjectGetter { public static BioCulture getBioCulture(String aName) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java index 0e40363356..30d387399c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,6 +31,7 @@ import net.minecraftforge.fluids.FluidStack; import javax.annotation.Nonnegative; import javax.annotation.Nonnull; +@SuppressWarnings("ALL") public final class BioRecipeAdder { public static final int STANDART = 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java index a8fc8dae91..7e17d323e6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,11 +31,11 @@ import javax.annotation.Nonnegative; import javax.annotation.Nonnull; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.Objects; import static cpw.mods.fml.common.registry.GameRegistry.findBlock; +@SuppressWarnings("ALL") public final class BioVatLogicAdder { @@ -64,9 +64,7 @@ public final class BioVatLogicAdder { public static int getMaxSv() { int ret = MaxSV; - Iterator it = BioVatLogicAdder.RadioHatch.getMaSv().iterator(); - while (it.hasNext()) { - BioVatLogicAdder.MaterialSvPair pair = (BioVatLogicAdder.MaterialSvPair) it.next(); + for (MaterialSvPair pair : RadioHatch.getMaSv()) { if (pair.getSievert() > ret) ret = pair.getSievert(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java index 76612ad404..8d5c0d23ae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java index 391593d217..b4fe0923bc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java index 002b175bbf..fe92654fd0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java index a84f254d8a..5e8663f907 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -27,6 +27,6 @@ import net.minecraft.inventory.ISidedInventory; public interface ITileDropsContent extends ISidedInventory { default int[] getDropSlots(){ return new int[] {0}; - }; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java index a9318ca7f0..9ae176d26f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -38,15 +38,11 @@ public interface ITileHasDifferentTextureSides { return texture[side.ordinal()]; } - ; - @SideOnly(Side.CLIENT) default IIcon getTextureForSide(int side, int meta) { return getTextureForSide(ForgeDirection.values()[side], meta); } - ; - @SideOnly(Side.CLIENT) void registerBlockIcons(IIconRegister par1IconRegister); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java index 636fcb3a31..deec80e80f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java index 397d949e77..1dc575bd5a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; public final class WerkstoffAPI { + @SuppressWarnings("rawtypes") public Werkstoff getWerkstoff(String aName) throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException { Class w = Class.forName("com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader"); return (Werkstoff) w.getField(aName).get(null); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java index 6437ad1087..7efe2af842 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -32,11 +32,11 @@ public final class WerkstoffAdderRegistry implements Runnable { private WerkstoffAdderRegistry() { } - public static final WerkstoffAdderRegistry getINSTANCE() { + public static WerkstoffAdderRegistry getINSTANCE() { return INSTANCE; } - public static final void addWerkstoffAdder(Runnable adder) { + public static void addWerkstoffAdder(Runnable adder) { INSTANCE.toRun.add(adder); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java index 5476c65e72..6e46f1dbab 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index f9674b72c7..abd55ddf6e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -108,6 +108,7 @@ public final class MainMod { public static BW_Network BW_Network_instance = new BW_Network(); @Mod.EventHandler + @SuppressWarnings("ALL") public void preInit(FMLPreInitializationEvent preinit) { if (!(API_REFERENCE.VERSION.equals(MainMod.APIVERSION))) { @@ -328,6 +329,7 @@ public final class MainMod { } } + @SuppressWarnings("ALL") private static void runMoltenUnificationEnfocement(Werkstoff werkstoff){ if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.getGenerationFeatures().hasMolten()) { try { @@ -512,6 +514,7 @@ public final class MainMod { toAdd.forEach(GT_Recipe.GT_Recipe_Map.sBlastRecipes::add); } + @SuppressWarnings("ALL") private static void addElectricImplosionCompressorRecipes() { if (eicMap == null) { eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java index f3590b4e90..14a146e01a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -41,8 +41,8 @@ class TooltipCache { if (!tooltip.isEmpty()) { StringBuilder sb = new StringBuilder(); - for (int i = 0; i < tooltip.size(); i++) { - sb.append(tooltip.get(i)); + for (String s : tooltip) { + sb.append(s); sb.append(System.lineSeparator()); } char[] rettype = sb.toString().toCharArray(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java index 2532357218..1f28933622 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java index 2057052be3..628b4acb96 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java index 8f45b3d48d..03ecf155e3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java index c49fdb0aae..41ce06cc81 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java index 44dc931a23..610aeb14f7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -49,7 +49,7 @@ public class BW_GUIContainer_HeatedWaterPump extends GuiContainer { if (this.container.fuel > 0) { this.mc.getTextureManager().bindTexture(BW_GUIContainer_HeatedWaterPump.furnaceGuiTextures); - int ik = this.container.maxfuel > 200 ? this.container.maxfuel : 200; + int ik = Math.max(this.container.maxfuel, 200); int i1 = ((this.container.fuel * 13) / ik); this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 13 - i1, 14, i1 + 1); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java index 788bcb379a..5ede1e09f0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java index 597fb1cb0b..94731e1833 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java index df4d721b02..69ec8349b9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java index 8f31fc31db..ba0bc69c3b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java index e672eebe94..2f45e3c7c9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java index 8686cee0be..ae1187c3d0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java index 86779b71d0..9bd331c59c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java index a59fb87635..3494b461a5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java index 879274d114..4dd9bc3860 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index 5bcd873fd3..7146293456 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java index 82150c7913..74bc3e2712 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java index 0a2bf2d99c..cb0f78ffa5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -170,27 +170,27 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler dInterpolatedV4 = dInterpolatedV; } else { float xFlow = MathHelper.sin(flowDir) * 0.25f, zFlow = MathHelper.cos(flowDir) * 0.25f; - dInterpolatedU = iconStill.getInterpolatedU((double) (8.0f + (-zFlow - xFlow) * 16.0f)); - dInterpolatedV = iconStill.getInterpolatedV((double) (8.0f + (-zFlow + xFlow) * 16.0f)); - dInterpolatedU2 = iconStill.getInterpolatedU((double) (8.0f + (-zFlow + xFlow) * 16.0f)); - dInterpolatedV2 = iconStill.getInterpolatedV((double) (8.0f + (zFlow + xFlow) * 16.0f)); - dInterpolatedU3 = iconStill.getInterpolatedU((double) (8.0f + (zFlow + xFlow) * 16.0f)); - dInterpolatedV3 = iconStill.getInterpolatedV((double) (8.0f + (zFlow - xFlow) * 16.0f)); - dInterpolatedU4 = iconStill.getInterpolatedU((double) (8.0f + (zFlow - xFlow) * 16.0f)); - dInterpolatedV4 = iconStill.getInterpolatedV((double) (8.0f + (-zFlow - xFlow) * 16.0f)); + dInterpolatedU = iconStill.getInterpolatedU(8.0f + (-zFlow - xFlow) * 16.0f); + dInterpolatedV = iconStill.getInterpolatedV(8.0f + (-zFlow + xFlow) * 16.0f); + dInterpolatedU2 = iconStill.getInterpolatedU(8.0f + (-zFlow + xFlow) * 16.0f); + dInterpolatedV2 = iconStill.getInterpolatedV(8.0f + (zFlow + xFlow) * 16.0f); + dInterpolatedU3 = iconStill.getInterpolatedU(8.0f + (zFlow + xFlow) * 16.0f); + dInterpolatedV3 = iconStill.getInterpolatedV(8.0f + (zFlow - xFlow) * 16.0f); + dInterpolatedU4 = iconStill.getInterpolatedU(8.0f + (zFlow - xFlow) * 16.0f); + dInterpolatedV4 = iconStill.getInterpolatedV(8.0f + (-zFlow - xFlow) * 16.0f); } tessellator.setBrightness(block.getMixedBrightnessForBlock(iBlockAccess, x, y, z)); tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_POS * red, RendererSwitchingColorFluid.LIGHT_Y_POS * green, RendererSwitchingColorFluid.LIGHT_Y_POS * blue); - tessellator.addVertexWithUV((double) x, y + heightNW, (double) z, dInterpolatedU, dInterpolatedV); - tessellator.addVertexWithUV((double) x, y + heightSW, (double) (z + 1), dInterpolatedU2, dInterpolatedV2); - tessellator.addVertexWithUV((double) (x + 1), y + heightSE, (double) (z + 1), dInterpolatedU3, dInterpolatedV3); - tessellator.addVertexWithUV((double) (x + 1), y + heightNE, (double) z, dInterpolatedU4, dInterpolatedV4); - tessellator.addVertexWithUV((double) x, y + heightNW, (double) z, dInterpolatedU, dInterpolatedV); - tessellator.addVertexWithUV((double) (x + 1), y + heightNE, (double) z, dInterpolatedU4, dInterpolatedV4); - tessellator.addVertexWithUV((double) (x + 1), y + heightSE, (double) (z + 1), dInterpolatedU3, dInterpolatedV3); - tessellator.addVertexWithUV((double) x, y + heightSW, (double) (z + 1), dInterpolatedU2, dInterpolatedV2); + tessellator.addVertexWithUV(x, y + heightNW, z, dInterpolatedU, dInterpolatedV); + tessellator.addVertexWithUV(x, y + heightSW, z + 1, dInterpolatedU2, dInterpolatedV2); + tessellator.addVertexWithUV(x + 1, y + heightSE, z + 1, dInterpolatedU3, dInterpolatedV3); + tessellator.addVertexWithUV(x + 1, y + heightNE, z, dInterpolatedU4, dInterpolatedV4); + tessellator.addVertexWithUV(x, y + heightNW, z, dInterpolatedU, dInterpolatedV); + tessellator.addVertexWithUV(x + 1, y + heightNE, z, dInterpolatedU4, dInterpolatedV4); + tessellator.addVertexWithUV(x + 1, y + heightSE, z + 1, dInterpolatedU3, dInterpolatedV3); + tessellator.addVertexWithUV(x, y + heightSW, z + 1, dInterpolatedU2, dInterpolatedV2); } @@ -198,7 +198,7 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler rendered = true; tessellator.setBrightness(block.getMixedBrightnessForBlock(iBlockAccess, x, y - 1, z)); tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_NEG * red, RendererSwitchingColorFluid.LIGHT_Y_NEG * green, RendererSwitchingColorFluid.LIGHT_Y_NEG * blue); - renderer.renderFaceYNeg(block, (double) x, y + RendererSwitchingColorFluid.RENDER_OFFSET, (double) z, this.getNullCheckedIiconOrFallbackTexture()); + renderer.renderFaceYNeg(block, x, y + RendererSwitchingColorFluid.RENDER_OFFSET, z, this.getNullCheckedIiconOrFallbackTexture()); } for (int side = 0; side < 4; ++side) { @@ -269,14 +269,14 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler } tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * red, RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * green, RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * blue); - tessellator.addVertexWithUV(dXcoord1, y + dHeight1, dZcoord1, (double) u1Flow, (double) v1Flow); - tessellator.addVertexWithUV(dXcoord2, y + dHeight2, dZcoord2, (double) u2Flow, (double) v2Flow); - tessellator.addVertexWithUV(dXcoord2, (double) y, dZcoord2, (double) u2Flow, (double) v3Flow); - tessellator.addVertexWithUV(dXcoord1, (double) y, dZcoord1, (double) u1Flow, (double) v3Flow); - tessellator.addVertexWithUV(dXcoord1, y + dHeight1, dZcoord1, (double) u1Flow, (double) v1Flow); - tessellator.addVertexWithUV(dXcoord1, (double) y, dZcoord1, (double) u1Flow, (double) v3Flow); - tessellator.addVertexWithUV(dXcoord2, (double) y, dZcoord2, (double) u2Flow, (double) v3Flow); - tessellator.addVertexWithUV(dXcoord2, y + dHeight2, dZcoord2, (double) u2Flow, (double) v2Flow); + tessellator.addVertexWithUV(dXcoord1, y + dHeight1, dZcoord1, u1Flow, v1Flow); + tessellator.addVertexWithUV(dXcoord2, y + dHeight2, dZcoord2, u2Flow, v2Flow); + tessellator.addVertexWithUV(dXcoord2, y, dZcoord2, u2Flow, v3Flow); + tessellator.addVertexWithUV(dXcoord1, y, dZcoord1, u1Flow, v3Flow); + tessellator.addVertexWithUV(dXcoord1, y + dHeight1, dZcoord1, u1Flow, v1Flow); + tessellator.addVertexWithUV(dXcoord1, y, dZcoord1, u1Flow, v3Flow); + tessellator.addVertexWithUV(dXcoord2, y, dZcoord2, u2Flow, v3Flow); + tessellator.addVertexWithUV(dXcoord2, y + dHeight2, dZcoord2, u2Flow, v2Flow); } } renderer.renderMinY = 0.0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java index 29b78e568e..4294e1c89c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.client.textures; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -25,11 +47,11 @@ public class PrefixTextureLinker implements Runnable { for (OrePrefixes prefixes : OrePrefixes.values()) { if (prefixes == OrePrefixes.rod) continue; - HashMap curr = new HashMap<>(); + HashMap curr = new HashMap<>(); if (prefixes.mTextureIndex == -1 && Werkstoff.GenerationFeatures.prefixLogic.get(prefixes) != 0) { Arrays.stream(TextureSet.class.getFields()).filter(field -> field.getName().contains("SET")).forEach(SET -> { try { - curr.put(SET.get(null), new Textures.ItemIcons.CustomIcon("materialicons/" + SET.getName().substring(4) + "/" + prefixes)); + curr.put((TextureSet) SET.get(null), new Textures.ItemIcons.CustomIcon("materialicons/" + SET.getName().substring(4) + "/" + prefixes)); } catch (IllegalAccessException e) { e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java index cf81a296f3..9a1f342b3c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -79,6 +79,7 @@ public class BW_Blocks extends Block { @Override @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubBlocks(Item item, CreativeTabs tab, List list) { for (int i = 0; i < this.textureNames.length; i++) { list.add(new ItemStack(item, 1, i)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java index 3d6d3e41b0..195d1afb6d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index b6a1ee611d..4fb77d6671 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -123,9 +123,9 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI TileEntity t = world.getTileEntity(x,y,z); if (t instanceof ITileDropsContent){ int[] dropSlots = ((ITileDropsContent)t).getDropSlots(); - for (int i = 0; i < dropSlots.length; i++) { - if (((ITileDropsContent)t).getStackInSlot(dropSlots[i]) != null) - world.spawnEntityInWorld(new EntityItem(world,x,y,z,((BW_TileEntity_HeatedWaterPump)t).getStackInSlot(dropSlots[i]))); + for (int dropSlot : dropSlots) { + if (((ITileDropsContent) t).getStackInSlot(dropSlot) != null) + world.spawnEntityInWorld(new EntityItem(world, x, y, z, ((BW_TileEntity_HeatedWaterPump) t).getStackInSlot(dropSlot))); } } super.breakBlock(world, x, y, z, block, meta); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java index eac3b5fd28..41525ef6d7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -117,6 +117,7 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { @Override @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubBlocks(Item item, CreativeTabs tab, List list) { for (int i = 0; i < this.textureNames.length; i++) { list.add(new ItemStack(item, 1, i)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java index ea1b074c69..61c93217d9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java index ec85e7e1d4..d3091afb56 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -41,6 +41,7 @@ public class ChangeConfig extends CommandBase { } @Override + @SuppressWarnings("rawtypes") public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { try{ Field f = ConfigHandler.class.getField(p_71515_2_[0]); @@ -53,7 +54,7 @@ public class ChangeConfig extends CommandBase { p_71515_1_.addChatMessage(new ChatComponentText("you need to enter a number!")); return; } - f.setInt(null, Integer.parseInt(p_71515_2_[1])); + f.setInt(null, l); } else if (c.equals(long.class)) { long l; @@ -72,7 +73,6 @@ public class ChangeConfig extends CommandBase { f.setBoolean(null,false); else { p_71515_1_.addChatMessage(new ChatComponentText("booleans need to be set to true or false")); - return; } } }catch (Exception e){ diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java index 48f7a6d236..3e410ff2d3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 1f808bae95..d71b89b8cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index db5a66173f..46706f6f08 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -40,6 +40,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; +import java.util.Arrays; import java.util.List; public class BW_ItemBlocks extends ItemBlock { @@ -66,13 +67,12 @@ public class BW_ItemBlocks extends ItemBlock { @Override @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { if (this.field_150939_a instanceof BW_GlasBlocks) aList.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + BW_ColorUtil.getColorForTier(BW_Util.getTierFromGlasMeta(aStack.getItemDamage())) + GT_Values.VN[BW_Util.getTierFromGlasMeta(aStack.getItemDamage())]); if (this.field_150939_a instanceof ITileAddsInformation) { - for (int i = 0; i < ((ITileAddsInformation) this.field_150939_a).getInfoData().length; i++) { - aList.add(((ITileAddsInformation) this.field_150939_a).getInfoData()[i]); - } + aList.addAll(Arrays.asList(((ITileAddsInformation) this.field_150939_a).getInfoData())); } aList.add(this.mNoMobsToolTip); if (!(this.field_150939_a instanceof ITileEntityProvider)) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java index f308420d14..e6c0a5ad90 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -54,6 +54,7 @@ public class BW_SimpleWindMeter extends Item { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean p_77624_4_) { super.addInformation(itemStack, entityPlayer, list, p_77624_4_); list.add(StatCollector.translateToLocal("tooltip.windmeter.0.name")); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index 6c11a9be64..fdb263a9f0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -68,6 +68,7 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { this.itemIcon = iconRegister.registerIcon(MainMod.MOD_ID + ":" + this.itemTex); } + @SuppressWarnings("unchecked") public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", this.DiaMinMax[1], this.DiaMinMax[2])); IKineticRotor.GearboxType type = null; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index 136ccb27b5..a39d75dd97 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -51,6 +51,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); if (aStack != null && aStack.getTagCompound() != null) @@ -67,6 +68,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem } @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); if (this.getChargedItem(itemStack) == this) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java index ea43784383..1376a00bd8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -46,6 +46,7 @@ public class GT_Destructopack_Item extends GT_Generic_Item { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index 5d5f8b790c..700b8974c3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -51,7 +51,7 @@ import java.util.List; import java.util.Set; public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { - private static Set mineableBlocks = Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); + private static Set mineableBlocks = Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); private final int mCharge; private final int mTransfer; public int mTier; @@ -63,7 +63,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { super(2 * aTier, Item.ToolMaterial.EMERALD, GT_Rockcutter_Item.mineableBlocks); this.mTier = aTier; this.multi = (int) Math.pow(10, (this.mTier - 1)); - GT_Rockcutter_Item.mineableBlocks = new HashSet(); + GT_Rockcutter_Item.mineableBlocks = new HashSet<>(); this.maxStackSize = 1; this.mCharge = 10000 * this.multi; this.mTransfer = (int) GT_Values.V[this.mTier]; @@ -73,7 +73,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { this.setNoRepair(); this.setUnlocalizedName("GT_Rockcutter_Item_" + GT_Values.VN[this.mTier]); } - + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { aList.add(StatCollector.translateToLocal("tooltip.bw.tier.name") + " " + GT_Values.VN[this.mTier]); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); @@ -110,6 +110,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { } @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); if (this.getChargedItem(itemStack) == this) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java index b45b831bae..458a80e673 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,6 +29,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; +import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLiving; @@ -45,7 +46,7 @@ import java.util.List; import java.util.Set; public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { - private static final Set effective = Sets.newHashSet(Blocks.web); + private static final Set effective = Sets.newHashSet(Blocks.web); private final double mCharge; private final double mTransfer; public int mTier; @@ -65,6 +66,7 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { aList.add(StatCollector.translateToLocal("tooltip.teslastaff.0.name")); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); @@ -73,8 +75,7 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { public boolean hitEntity(ItemStack aStack, EntityLivingBase aTarget, EntityLivingBase aPlayer) { if (aTarget instanceof EntityLiving && ElectricItem.manager.canUse(aStack, 9000000)) { EntityLiving tTarget = (EntityLiving) aTarget; - EntityLivingBase tPlayer = aPlayer; - ElectricItem.manager.use(aStack, 9000000, tPlayer); + ElectricItem.manager.use(aStack, 9000000, aPlayer); for (int i = 1; i < 5; ++i) { if (tTarget.getEquipmentInSlot(i) != null && tTarget.getEquipmentInSlot(i).getItem() instanceof IElectricItem) { tTarget.setCurrentItemOrArmor(i, null); @@ -85,6 +86,7 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { } @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); if (this.getChargedItem(itemStack) == this) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java index 640fca0014..a588921145 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -40,6 +40,7 @@ public class LabModule extends SimpleSubItemClass { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { aList.add(StatCollector.translateToLocal("tooltip.labmodule.0.name")); super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java index 675eb4602d..b879c94958 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -74,6 +74,7 @@ public class LabParts extends SimpleSubItemClass { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean b) { if (itemStack == null) return; @@ -124,13 +125,11 @@ public class LabParts extends SimpleSubItemClass { } @Override + @SuppressWarnings("unchecked") public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - for (ItemStack stack : getAllPetriDishes()) - list.add(stack); - for (ItemStack stack : getAllDNASampleFlasks()) - list.add(stack); - for (ItemStack stack : getAllPlasmidCells()) - list.add(stack); + list.addAll(getAllPetriDishes()); + list.addAll(getAllDNASampleFlasks()); + list.addAll(getAllPlasmidCells()); super.getSubItems(item, creativeTabs, list); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java index ab19b5d967..d8070f4e90 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java index 3d312d6e37..8287c44778 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -57,12 +57,14 @@ public class SimpleSubItemClass extends Item { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } @Override + @SuppressWarnings("unchecked") public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { for (int i = 0; i < this.tex.length; i++) { p_150895_3_.add(new ItemStack(p_150895_1_, 1, i)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java index ed84c5a98f..5012725e34 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java index 0c13e8b88b..e5591f1150 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java index 7968e2996c..93b2ece861 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java index dbb060700a..80a0ff744f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index 3315d5361e..5c2088e606 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -48,6 +48,7 @@ import net.minecraftforge.oredict.OreDictionary; public class BioRecipeLoader extends RecipeLoader { @Override + @SuppressWarnings("deprecation") public void run() { //DNAExtractionModule diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 17cb6d84a9..beba91a18d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java index 095e679dc6..f602963c8e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index b23afa275c..2b61f3250f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java index 9ea0f90050..4f7d83bcf6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,7 +26,7 @@ public class LoaderRegistry implements Runnable { @Override public void run() { - new ItemRegistry().run(); + ItemRegistry.run(); new RecipeLoader().run(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index f274260d13..3f703ba688 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -55,6 +55,7 @@ public class RecipeLoader implements Runnable { protected static final long BITSD = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE; @Override + @SuppressWarnings("deprecation") public void run() { if (ConfigHandler.GTNH) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index bb32c7aeb4..7c6ba97d67 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -50,6 +50,7 @@ import java.util.List; /* * Original GT File slightly Modified */ +@SuppressWarnings("ALL") @ChannelHandler.Sharable public class BW_Network extends MessageToMessageCodec implements IGT_NetworkHandler { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java index 0da061e352..be1fb4dea5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java index 793f59c899..9a4ce6cf38 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -63,7 +63,7 @@ public class OreDictCachePacket extends GT_Packet { public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { int size = byteArrayDataInput.readInt(); for (int i = 0; i < size; i++) { - this.hashSet.add(new Pair(byteArrayDataInput.readInt(),byteArrayDataInput.readShort())); + this.hashSet.add(new Pair<>(byteArrayDataInput.readInt(),byteArrayDataInput.readShort())); } return new OreDictCachePacket(this.hashSet); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java index 4147087a51..75d5cddc30 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java index 90a3adc69a..ede9c1df94 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java index 149db03d5b..4a1367d1dc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java index 9d492bb87f..e382a138ec 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java index 767e6bd383..78df5d33f8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java index 0e54e9264d..0497a1b5b6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -71,7 +71,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem private synchronized void setUpHashSet() { this.check = new BW_TileEntity_ExperimentalFloodGate.recursiveBelowCheck(); Thread t = new Thread(this.check); - t.run(); + t.start(); while (t.isAlive()) { try { this.wait(); @@ -89,7 +89,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem private class recursiveBelowCheck implements Runnable { - private final List hashset = new ArrayList(); + private final List hashset = new ArrayList<>(); int called = -1; public int getCalled() { @@ -138,7 +138,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem if (iterations >= 5000) return -1; - int tail = 0; + int tail; int ret = 0; iterations++; int wID = w.provider.dimensionId; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index ea9bfe6395..fb687ed2a0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java index f9e7553760..f47be6d45e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,11 +31,10 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.*; import java.util.ArrayList; -import java.util.HashSet; public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank, IFluidHandler, ITileWithGUI { - final ArrayList INTERNALTANKS = new ArrayList(); + final ArrayList INTERNALTANKS = new ArrayList<>(); int selectedTank; @@ -61,13 +60,15 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public boolean canDrain(ForgeDirection from, Fluid fluid) { - HashSet ret = new HashSet(); + boolean ret = false; for (FluidStack stack : this.INTERNALTANKS) { - ret.add(GT_Utility.areFluidsEqual(stack, new FluidStack(fluid, 0))); - if (ret.contains(Boolean.TRUE)) + ret = GT_Utility.areFluidsEqual(stack, new FluidStack(fluid, 0)); + if (ret) { this.selectedTank = this.INTERNALTANKS.indexOf(stack); + break; + } } - return ret.contains(Boolean.TRUE); + return ret; } @Override @@ -94,12 +95,12 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank NBTTagList lInternalTank = new NBTTagList(); - for (int i = 0; i < this.INTERNALTANKS.size(); i++) { - if (this.INTERNALTANKS.get(i) != null) { + for (FluidStack internaltank : this.INTERNALTANKS) { + if (internaltank != null) { NBTTagCompound entry = new NBTTagCompound(); - entry.setString("FluidName", this.INTERNALTANKS.get(i).getFluid().getName()); - entry.setInteger("Ammount", this.INTERNALTANKS.get(i).amount); - entry.setTag("FluidTag", this.INTERNALTANKS.get(i).tag); + entry.setString("FluidName", internaltank.getFluid().getName()); + entry.setInteger("Ammount", internaltank.amount); + entry.setTag("FluidTag", internaltank.tag); lInternalTank.appendTag(entry); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java index 323a009d0a..ac7c929cba 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 3902909ae6..d3d8d5f6ab 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -56,7 +56,6 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @@ -65,7 +64,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private static final byte MCASING_INDEX = 49; private static final byte TIMERDIVIDER = 20; - private final HashSet playerMPHashSet = new HashSet(); + private final HashSet playerMPHashSet = new HashSet<>(); private final ArrayList mRadHatches = new ArrayList<>(); private int height = 1; private GT_Recipe mLastRecipe; @@ -145,7 +144,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private int calcMod(double x) { int ret = (int) Math.ceil(ConfigHandler.bioVatMaxParallelBonus*(-(((2D*x/(double)this.getOutputCapacity())-1D)*(2D*x/(double)this.getOutputCapacity()-1D))+1D)); - return ret <= 0 ? 1 : ret > 100 ? 100 : ret;//(int) Math.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); + return ret <= 0 ? 1 : Math.min(ret, 100);//(int) Math.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); } @Override @@ -171,7 +170,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } } } - ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); + ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); ArrayList tFluidList = this.getStoredFluids(); int tFluidList_sS = tFluidList.size(); @@ -190,7 +189,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } } - FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); if (tFluidList.size() > 0) { @@ -256,18 +255,16 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } public ArrayList getStoredFluidOutputs() { - ArrayList rList = new ArrayList(); - Iterator var2 = this.mOutputHatches.iterator(); + ArrayList rList = new ArrayList<>(); - while (var2.hasNext()) { - GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) var2.next(); + for (GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) { if (tHatch.getFluid() != null) rList.add(tHatch.getFluid()); } return rList; } - private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity) { if (aTileEntity == null) { return false; } else { @@ -275,7 +272,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { if (aMetaTileEntity == null) { return false; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_RadioHatch) { - ((GT_MetaTileEntity_RadioHatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_RadioHatch) aMetaTileEntity).updateTexture(GT_TileEntity_BioVat.MCASING_INDEX); return this.mRadHatches.add((GT_MetaTileEntity_RadioHatch) aMetaTileEntity); } else { return false; @@ -298,7 +295,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { //controller if (y == 0 && xDir + x == 0 && zDir + z == 0) continue; - if (!(this.addOutputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addRadiationInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addMaintenanceToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addEnergyInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX))) { + if (!(this.addOutputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addRadiationInputToMachineList(tileEntity) || this.addInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addMaintenanceToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addEnergyInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX))) { if (BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, GregTech_API.sBlockCasings4, 1)) { ++blockcounter; continue; @@ -400,10 +397,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private void check_Chunk() { World aWorld = this.getBaseMetaTileEntity().getWorld(); if (!aWorld.isRemote) { - Iterator var5 = aWorld.playerEntities.iterator(); - while (var5.hasNext()) { - Object tObject = var5.next(); + for (Object tObject : aWorld.playerEntities) { if (!(tObject instanceof EntityPlayerMP)) { break; } @@ -474,7 +469,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { for (int x = -1; x < 2; x++) { for (int y = 1; y < this.height; y++) { for (int z = -1; z < 2; z++) { - if (aStack == null || (aStack != null && aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0)) { + if (aStack == null || aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0) { if (this.mCulture == null || aStack == null || aStack.getTagCompound() == null || this.mCulture.getID() != aStack.getTagCompound().getInteger("ID")) { lCulture = aStack == null || aStack.getTagCompound() == null ? null : BioCulture.getBioCulture(aStack.getTagCompound().getString("Name")); this.sendPackagesOrRenewRenderer(x, y, z, lCulture); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 11382078cd..6d664ed7cd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,14 +22,12 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; -import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -40,8 +38,6 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java index 50e2c7e632..1f96a207e3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -49,7 +49,7 @@ public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_Distil return false; else { FluidStack[] array = new FluidStack[0]; - ArrayList fluidInputs = new ArrayList(); + ArrayList fluidInputs = new ArrayList<>(); for (GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches) { if (hatch != null) { fluidInputs.add(hatch.getFluid()); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index 9b826dc9f4..daadf33416 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -61,6 +61,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { } @Override + @SuppressWarnings("rawtypes") public void onConfigLoad(GT_Config aConfig) { try { Class c = TileEntityNuclearReactorElectric.class; @@ -158,7 +159,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { try { Field workState = this.getClass().getField("workState"); workState.setInt(this, 0); - } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException e) { + } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException ignored) { } return true; } @@ -182,7 +183,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { try { Field workState = this.getClass().getSuperclass().getDeclaredField("workState"); workState.setInt(this, 2); - } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException e) { + } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException ignored) { } return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 2dff59f0a2..8eac4a7f09 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -77,7 +77,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } } - ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); + ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); if (tInputList.size() > 0) { GT_Recipe tRecipe = GT_TileEntity_ElectricImplosionCompressor.eicMap.findRecipe(this.getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); if (tRecipe != null && tRecipe.isRecipeInputEqual(true, null, tInputs)) { @@ -177,6 +177,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } @Override + @SuppressWarnings("ALL") public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 06ecfecd26..1c39d5e07c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -52,6 +52,7 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.ArrayList; +import java.util.Collections; public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @@ -157,14 +158,10 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public String[] getDescription() { ArrayList e = new ArrayList<>(); String[] dsc = StatCollector.translateToLocal("tooltip.tile.lesu.0.name").split(";"); - for (int i = 0; i < dsc.length; i++) { - e.add(dsc[i]); - } + Collections.addAll(e, dsc); e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + ConfigHandler.energyPerCell + "EU"); dsc = StatCollector.translateToLocal("tooltip.tile.lesu.2.name").split(";"); - for (int i = 0; i < dsc.length; i++) { - e.add(dsc[i]); - } + Collections.addAll(e, dsc); e.add(ChatColorHelper.RED + StatCollector.translateToLocal("tooltip.tile.lesu.3.name")); e.add(StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"); return e.toArray(new String[0]); @@ -214,6 +211,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override + @SuppressWarnings("ALL") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { ITexture[] ret = new ITexture[0]; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index 9f830eeeda..8c258a96e6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -119,14 +119,14 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase public long getInputTier() { if (this.mEnergyHatches.size() > 0) - return (long) GT_Utility.getTier(this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); - else return 0; + return GT_Utility.getTier(this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); + else return 0L; } public long getOutputTier() { if (this.mDynamoHatches.size() > 0) - return (long) GT_Utility.getTier(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); - else return 0; + return GT_Utility.getTier(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); + else return 0L; } @Override @@ -324,7 +324,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase //check tap hull for (int ty = 1; ty <= y; ++ty) { - byte leveltier = 0; + byte leveltier; if (this.mInventory[1].getItemDamage() == 2) leveltier = ((byte) (intier - ty)); else if (this.mInventory[1].getItemDamage() == 3) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 83dbfd0fcd..87e1089e1f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 625e857401..1e3c2dc45d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -58,6 +58,7 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; +import java.util.Arrays; import static gregtech.api.enums.GT_Values.V; @@ -67,7 +68,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { private static final IIconContainer[] iIconContainers = new IIconContainer[2]; private static final ITexture[] iTextures = new ITexture[3]; - private final ArrayList tedList = new ArrayList(); + private final ArrayList tedList = new ArrayList<>(); private BW_RotorBlock rotorBlock; private byte hasDoor; @@ -102,8 +103,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { public boolean recipe_fallback(ItemStack aStack) { //sight... fallback to the macerator recipes GT_Recipe.GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; - if (tMap == null) - return false; GT_Recipe tRecipe = tMap.findRecipe(this.getBaseMetaTileEntity(), false, false, V[1], null, aStack); if (tRecipe == null) return false; @@ -346,6 +345,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { return false; } + @SuppressWarnings("ALL") public boolean addOutput(ItemStack aStack) { if (GT_Utility.isStackInvalid(aStack)) return false; @@ -626,19 +626,13 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { if (aFacing == aSide || aSide == 0) { GT_TileEntity_Windmill.iTextures[0] = new GT_RenderedTexture(GT_TileEntity_Windmill.iIconContainers[0]); - for (int i = 0; i < ret.length; i++) { - ret[i] = GT_TileEntity_Windmill.iTextures[0]; - } + Arrays.fill(ret, GT_TileEntity_Windmill.iTextures[0]); } else if (aSide == 1) { GT_TileEntity_Windmill.iTextures[1] = new GT_RenderedTexture(GT_TileEntity_Windmill.iIconContainers[1]); - for (int i = 0; i < ret.length; i++) { - ret[i] = GT_TileEntity_Windmill.iTextures[1]; - } + Arrays.fill(ret, GT_TileEntity_Windmill.iTextures[1]); } else { GT_TileEntity_Windmill.iTextures[2] = new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE); - for (int i = 0; i < ret.length; i++) { - ret[i] = GT_TileEntity_Windmill.iTextures[2]; - } + Arrays.fill(ret, GT_TileEntity_Windmill.iTextures[2]); } } return ret; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 229cfa0169..cf38712bc6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -96,9 +96,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl @Override public boolean onRunningTick(ItemStack aStack) { if (this.lEUt > 0) { - this.addEnergyOutput((long)this.lEUt * (long)this.mEfficiency / 10000L); + this.addEnergyOutput(this.lEUt * (long)this.mEfficiency / 10000L); return true; - } else if (this.lEUt < 0 && !this.drainEnergyInput((long)(-this.lEUt) * 10000L / (long)Math.max(1000, this.mEfficiency))) { + } else if (this.lEUt < 0 && !this.drainEnergyInput((-this.lEUt) * 10000L / (long)Math.max(1000, this.mEfficiency))) { this.stopMachine(); return false; } else { @@ -138,7 +138,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl } } - return new String[]{StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + Integer.toString(this.mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + Integer.toString(this.mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET + " EU", StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + Long.toString(-this.lEUt) + EnumChatFormatting.RESET + " EU/t", StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + Long.toString(this.getMaxInputVoltage()) + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(this.getMaxInputVoltage())] + EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + (this.getIdealStatus() - this.getRepairStatus()) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW + Float.toString((float)this.mEfficiency / 100.0F) + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %"}; + return new String[]{StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + this.mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + this.mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + -this.lEUt + EnumChatFormatting.RESET + " EU/t", StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + this.getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(this.getMaxInputVoltage())] + EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + (this.getIdealStatus() - this.getRepairStatus()) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW + (float) this.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %"}; } private long lEUt = 0; @@ -206,7 +206,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl FluidStack[] tFluids = this.getStoredFluids().toArray(new FluidStack[0]); long tVoltage = this.getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = null; + GT_Recipe tRecipe; if (circuitMode > 0 && Arrays.stream(tInputs).anyMatch(e -> GT_Utility.areStacksEqual(e,GT_Utility.getIntegratedCircuit(circuitMode),true))){ List modInputs = Arrays.stream(tInputs).filter(Objects::nonNull).filter(e -> !e.getItem().equals(GT_Utility.getIntegratedCircuit(circuitMode).getItem())).collect(Collectors.toList()); modInputs.add(GT_Utility.getIntegratedCircuit(circuitMode)); @@ -222,8 +222,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return false; } - ArrayList outputItems = new ArrayList(); - ArrayList outputFluids = new ArrayList(); + ArrayList outputItems = new ArrayList<>(); + ArrayList outputFluids = new ArrayList<>(); boolean found_Recipe = false; int processed = 0; @@ -250,7 +250,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - byte overclockCount = 0; + byte overclockCount; long actualEUT = (long) (tRecipe.mEUt) * processed; // if (actualEUT > Integer.MAX_VALUE) { // byte divider = 0; @@ -344,13 +344,13 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl @Override public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { this.mHeatingCapacity = 0; - HashSet ret = new HashSet(); - ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, -2, -1, GregTech_API.sBlockCasings1, 11, 7, false,false,true,GregTech_API.sBlockCasings1,11,true,11)); - ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11)); - ret.add(BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11)); + boolean ret; + ret = BW_Util.check_layer(iGregTechTileEntity, 7, -2, -1, GregTech_API.sBlockCasings1, 11, 7, false,false,true,GregTech_API.sBlockCasings1,11,true,11); + ret &= BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11); + ret &= BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11); for (int y = -1; y < 17; y++) { - ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, false, 11)); - if (!this.getCoilHeat(iGregTechTileEntity, 7, y, 6)) + ret &= BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, false, 11); + if (!this.getCoilHeat(iGregTechTileEntity, y)) return false; List metasFromLayer = BW_Util.getMetasFromLayer(iGregTechTileEntity, 7, y, y + 1, 7, y == 0, false, false); for (Byte meta : metasFromLayer) { @@ -381,16 +381,16 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return false; } - return !ret.contains(Boolean.FALSE) && !this.mMaintenanceHatches.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mInputBusses.isEmpty(); + return ret && !this.mMaintenanceHatches.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mInputBusses.isEmpty(); } - private boolean getCoilHeat(IGregTechTileEntity iGregTechTileEntity, int offset, int y, int radius) { - int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * offset; - int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * offset; + private boolean getCoilHeat(IGregTechTileEntity iGregTechTileEntity, int y) { + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 7; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 7; int internalH = 0; - for (int x = -radius; x <= radius; x++) { - for (int z = -radius; z <= radius; z++) { - if (Math.abs(x) < radius && Math.abs(z) != radius) + for (int x = -6; x <= 6; x++) { + for (int z = -6; z <= 6; z++) { + if (Math.abs(x) < 6 && Math.abs(z) != 6) continue; byte tUsedMeta = iGregTechTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); switch (tUsedMeta) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 19e4455a08..127c38d0c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java index 3c7c1db53d..89c68563de 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,7 +37,7 @@ import java.util.ArrayList; import java.util.List; import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.isValidForLowGravity; - +@SuppressWarnings("ALL") public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_ProcessingArray { private GT_Recipe mLastRecipe; private int tTier; @@ -107,11 +107,11 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process if (!this.mMachine.equals(this.mInventory[1].getUnlocalizedName())) this.mLastRecipe = null; this.mMachine = this.mInventory[1].getUnlocalizedName(); - ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); + ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); ArrayList tFluidList = this.getStoredFluids(); - FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); if (tInputList.size() > 0 || tFluids.length > 0) { GT_Recipe tRecipe = map.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, gregtech.api.enums.GT_Values.V[this.tTier], tFluids, tInputs); if (tRecipe != null) { @@ -170,15 +170,13 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process } tOut = GT_MetaTileEntity_ProcessingArray.clean(tOut); this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - List overStacks = new ArrayList(); - for (int f = 0; f < tOut.length; f++) { - while (tOut[f].getMaxStackSize() < tOut[f].stackSize) { - if (tOut[f] != null) { - ItemStack tmp = tOut[f].copy(); - tmp.stackSize = tmp.getMaxStackSize(); - tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize(); - overStacks.add(tmp); - } + List overStacks = new ArrayList<>(); + for (ItemStack itemStack : tOut) { + while (itemStack.getMaxStackSize() < itemStack.stackSize) { + ItemStack tmp = itemStack.copy(); + tmp.stackSize = tmp.getMaxStackSize(); + itemStack.stackSize = itemStack.stackSize - itemStack.getMaxStackSize(); + overStacks.add(tmp); } } if (overStacks.size() > 0) { @@ -186,11 +184,11 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process tmp = overStacks.toArray(tmp); tOut = ArrayUtils.addAll(tOut, tmp); } - List tSList = new ArrayList(); + List tSList = new ArrayList<>(); for (ItemStack tS : tOut) { if (tS.stackSize > 0) tSList.add(tS); } - tOut = tSList.toArray(new ItemStack[tSList.size()]); + tOut = tSList.toArray(new ItemStack[0]); this.mOutputItems = tOut; this.mOutputFluids = new FluidStack[]{tFOut}; this.updateSlots(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index fd5fec2e16..434b034160 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -92,7 +92,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre @Override public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - ArrayList outputItems = new ArrayList(); + ArrayList outputItems = new ArrayList<>(); long tVoltage = this.getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); @@ -142,13 +142,13 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - HashSet ret = new HashSet(); - ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, -7, -6, GregTech_API.sBlockCasings2, 1, 7, false, 17)); - ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, -6, 0, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17)); - ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, 0, 1, GregTech_API.sBlockCasings2, 1, 7, true, false, true, Blocks.air, -1, true, 17)); - ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, 1, 7, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17)); - ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false, 17)); - return !(ret.contains(Boolean.FALSE) || this.mInputBusses.isEmpty() || this.mOutputBusses.isEmpty() || this.mEnergyHatches.isEmpty() || this.mMaintenanceHatches.isEmpty()); + return ( + BW_Util.check_layer(aBaseMetaTileEntity, 7, -7, -6, GregTech_API.sBlockCasings2, 1, 7, false, 17) + && BW_Util.check_layer(aBaseMetaTileEntity, 7, -6, 0, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) + && BW_Util.check_layer(aBaseMetaTileEntity, 7, 0, 1, GregTech_API.sBlockCasings2, 1, 7, true, false, true, Blocks.air, -1, true, 17) + && BW_Util.check_layer(aBaseMetaTileEntity, 7, 1, 7, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) + && BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false, 17) + ) && !this.mInputBusses.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mEnergyHatches.isEmpty() && !this.mMaintenanceHatches.isEmpty(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index 2453610894..cc82311a70 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -108,7 +108,6 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene return aSide == this.getBaseMetaTileEntity().getFrontFacing(); } - @SuppressWarnings("deprecation") public String[] getDescription() { return new String[]{StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + ChatColorHelper.YELLOW + this.getEfficiency(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index e4247a70c5..e7ded86c91 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -68,6 +68,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } @Override + @SuppressWarnings("deprecation") public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new GT_MetaTileEntity_BioLab(this.mName, this.mTier, this.mAmperage, this.mDescription, this.mTextures, this.mNEIName); } @@ -247,6 +248,8 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mFluid.amount -= 8000; if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { BioCulture out = BioCulture.getBioCulture(BioDNA.convertDataToDNA(cultureDNABioData)); + if (out == null) + return GT_MetaTileEntity_BasicMachine.DID_NOT_FIND_RECIPE; out = out.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); this.mOutputItems[0] = BioItemList.getPetriDish(out); } @@ -264,7 +267,6 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } @Override - @SuppressWarnings("deprecation") public String[] getDescription() { return new String[]{StatCollector.translateToLocal("tooltip.tile.biolab.0.name"), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java index d4382eac7a..be916e52ff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index 8d3d6d1777..fc7a1e6a05 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java index 8c4c13d171..f454af02d5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -69,7 +69,6 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans return 512L + (GT_Values.V[this.mTier] * 320L); } - @SuppressWarnings("deprecation") public String[] getDescription() { return new String[]{StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java index 8bc01b5554..4f2bebb0d6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index c84fbdfd13..eadf67de7a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -76,7 +76,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public static long calcDecayTicks(int x) { - long ret = 0; + long ret; if (x == 43) ret = 5000; else if (x == 61) @@ -107,7 +107,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public void setCoverage(short coverage) { - byte nu = 0; + byte nu; if (coverage > 100) nu = 100; else if (coverage < 0) @@ -245,7 +245,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } //check material for general validity - if (lStack != null && GT_OreDictUnificator.getAssociation(lStack) != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial != null) { + if (GT_OreDictUnificator.getAssociation(lStack) != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial != null) { //check orePrefix for general validity if (GT_OreDictUnificator.getAssociation(lStack).mPrefix != null) { OrePrefixes orePrefixes = GT_OreDictUnificator.getAssociation(lStack).mPrefix; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java index 5fd9b5b5d7..94b1aedd7e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java index 0dd86aa030..dec4e11c5e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index ddf1da1e15..531c54cfd1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -98,11 +98,8 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { } } else { tSpecial = 0; - String[] var6 = recipeDesc; - int var7 = recipeDesc.length; - for (int var8 = 0; var8 < var7; ++var8) { - String descLine = var6[var8]; + for (String descLine : recipeDesc) { GT_NEI_DefaultHandler.drawText(10, 73 + 10 * tSpecial, descLine, -16777216); ++tSpecial; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index 0bf633dcf2..b23fa6fd0b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index 284fdc973c..48c1b6e6ed 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java index eeb8772b15..33a1333322 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java index 8ea844c82c..4bc7bf3802 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -88,6 +88,7 @@ public class BW_Container_HeatedWaterPump extends Container { } @Override + @SuppressWarnings("rawtypes") public void detectAndSendChanges() { super.detectAndSendChanges(); if (this.TILE.getWorldObj().isRemote) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java index 42bdc56e3b..8d2d9b0b51 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -126,6 +126,7 @@ public class BW_Container_RadioHatch extends Container { } @Override + @SuppressWarnings("rawtypes") public void detectAndSendChanges() { if (!this.iGregTechTileEntity.getBaseMetaTileEntity().isClientSide() && this.iGregTechTileEntity.getBaseMetaTileEntity().getMetaTileEntity() != null) { this.coverage = this.iGregTechTileEntity.getCoverage(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java index 7545d5225a..f370d07043 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java index 6d3b86da1f..2fd79898d8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java index 95d09eefa9..7621a17f0a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java index a1cd7505fe..1b1b4b240f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -46,6 +46,7 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { super(aInventoryPlayer, aTileEntity); } + @SuppressWarnings("rawtypes") public void detectAndSendChanges() { super.detectAndSendChanges(); if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java index 133bc2dfbb..84f054b4bb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,6 +31,7 @@ public class BW_DelSlot extends Slot { super(new InventoryPlayer(null), 0, 80, 17); } + @SuppressWarnings("ALL") public void putStack(ItemStack p_75215_1_) { p_75215_1_ = null; this.onSlotChanged(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java index 71ed548559..6e2eafdf13 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java index f0854d78a9..286d3faa84 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java index 21268ac1c2..63f27d299f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java index d519da3ef6..37c14a6bd0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index df56e4359b..5d876b3986 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -70,7 +70,7 @@ public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEn } public ArrayList getDrops(Block aDroppedOre, int aFortune) { - ArrayList rList = new ArrayList(); + ArrayList rList = new ArrayList<>(); if (this.mMetaData < 0) { rList.add(new ItemStack(Blocks.cobblestone, 1, 0)); return rList; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java index be3a5d9643..90c30d1adf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -55,6 +55,7 @@ public class BW_MetaGeneratedOre_Item extends BW_ItemBlocks { @Override @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { if (!GT_Utility.isStackValid(aStack) || aPlayer == null || aStack.getItemDamage() <= 0) return; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java index ff5c25ef7a..849126df83 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.system.material; import gregtech.api.enums.Materials; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 6e0f198290..0b11ae9f89 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -95,6 +95,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } } + public boolean onEntityItemUpdate(EntityItem aItemEntity) { if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure || this.orePrefixes == OrePrefixes.crushed) { int aDamage = aItemEntity.getEntityItem().getItemDamage(); @@ -104,17 +105,15 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa int tX = MathHelper.floor_double(aItemEntity.posX); int tY = MathHelper.floor_double(aItemEntity.posY); int tZ = MathHelper.floor_double(aItemEntity.posZ); + Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); + byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((this.orePrefixes == OrePrefixes.dustImpure) || (this.orePrefixes == OrePrefixes.dustPure)) { - Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); - byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dust, aMaterial, aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } - } else if (this.orePrefixes == OrePrefixes.crushed) { - Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); - byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); + } else { if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, aMaterial, aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); @@ -128,6 +127,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } @Override + @SuppressWarnings("unchecked") protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { // String tooltip = GT_LanguageManager.getTranslation(this.getUnlocalizedName(aStack) + ".tooltip"); // if (!tooltip.isEmpty()) @@ -170,6 +170,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { for (Werkstoff werkstoff : werkstoffHashSet) { if (werkstoff != null && ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) != 0) && ((werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0)) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index d4a7ec89a3..9ac1b0f383 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -47,7 +47,7 @@ import static com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerate public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { - public static ThreadLocal mTemporaryTileEntity = new ThreadLocal(); + public static ThreadLocal mTemporaryTileEntity = new ThreadLocal<>(); public BW_MetaGenerated_Ores(Material p_i45386_1_, Class tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); @@ -149,7 +149,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { return ((BW_MetaGeneratedOreTE) tTileEntity).getDrops(WerkstoffLoader.BWOres,aFortune); } - return BW_MetaGenerated_Ores.mTemporaryTileEntity.get() == null ? new ArrayList() : BW_MetaGenerated_Ores.mTemporaryTileEntity.get().getDrops(WerkstoffLoader.BWOres,aFortune); + return BW_MetaGenerated_Ores.mTemporaryTileEntity.get() == null ? new ArrayList<>() : BW_MetaGenerated_Ores.mTemporaryTileEntity.get().getDrops(WerkstoffLoader.BWOres,aFortune); } public int getHarvestLevel(int metadata) { @@ -162,6 +162,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { } @Override + @SuppressWarnings("unchecked") public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { for (Werkstoff tMaterial : Werkstoff.werkstoffHashSet) { if ((tMaterial != null) && ((tMaterial.getGenerationFeatures().toGenerate & 0x8) != 0) && ((tMaterial.getGenerationFeatures().blacklist & 0x8) == 0)) { @@ -181,7 +182,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { // if ((FMLCommonHandler.instance().getEffectiveSide().isServer() || this.checkForAir(aWorld,aX,aY,aZ)) && aWorld.getTileEntity(aX, aY, aZ) instanceof BW_MetaGeneratedOreTE) // ((BW_MetaGeneratedOreTE)aWorld.getTileEntity(aX, aY, aZ)).sendPacket(); // } - + @SuppressWarnings("unused") private boolean checkForAir(IBlockAccess aWorld, int aX, int aY, int aZ){ for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java index 034b2d3606..24f447c3d8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.system.material; import gregtech.api.enums.OrePrefixes; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java index 1c3455147f..1cb7d6ea64 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java index 819d9f98bd..1d1cc94863 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index dfb48a7b50..66038d5d85 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -50,10 +50,7 @@ import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.BitSet; -import java.util.HashSet; -import java.util.List; +import java.util.*; public class BW_Meta_Items { @@ -73,6 +70,7 @@ public class BW_Meta_Items { GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{BW_Meta_Items.NEWCIRCUITS.getStack(2)},new ItemStack[]{BW_Meta_Items.NEWCIRCUITS.getStack(3)},null,new int[]{7500},new FluidStack[]{Materials.SolderingAlloy.getMolten(576)},null,300, BW_Util.getMachineVoltageFromTier(4), BW_Util.CLEANROOM)); } + @SuppressWarnings("deprecation") public void addNewCircuit(int aTier, int aID, String aName){ String additionalOreDictData = ""; @@ -132,6 +130,7 @@ public class BW_Meta_Items { } @Override + @SuppressWarnings("unchecked") public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { if (aCreativeTab == this.getCreativeTab()) for (NBTTagCompound tag : CircuitImprintLoader.recipeTagMap.keySet()){ @@ -153,7 +152,7 @@ public class BW_Meta_Items { for (short i = CircuitImprintLoader.reverseIDs; i < Short.MAX_VALUE; i++) { if (this.mEnabledItems.get(i)) { - BW_Util.set2DCoordTo1DArray(i,0,2,CircuitImprintLoader.circuitIIconRefs.get(i).get(1).getIconIndex(),this.mIconList); + BW_Util.set2DCoordTo1DArray(i,0,2, Objects.requireNonNull(CircuitImprintLoader.circuitIIconRefs.get(i)).get(1).getIconIndex(),this.mIconList); BW_Util.set2DCoordTo1DArray(i,1,2,aIconRegister.registerIcon(MainMod.MOD_ID+":WrapOverlay"),this.mIconList); //aIconRegister.registerIcon("gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + "/" + i)); } @@ -162,6 +161,7 @@ public class BW_Meta_Items { } @Override + @SuppressWarnings("unchecked") protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { if (aStack.getItemDamage() == 0 ) if (aStack.getTagCompound() != null && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) @@ -210,6 +210,7 @@ public class BW_Meta_Items { return null; } + @SuppressWarnings({"unchecked","rawtypes"}) public final ItemStack addItem(int aID, String aEnglish, String aToolTip, Object... aRandomData) { if (aToolTip == null) { aToolTip = ""; @@ -242,7 +243,8 @@ public class BW_Meta_Items { boolean tUseOreDict = true; if (tRandomData instanceof IItemBehaviour) { - this.addItemBehavior(aID, (IItemBehaviour) tRandomData); + this.addItemBehavior(aID, + (IItemBehaviour) tRandomData); tUseOreDict = false; } @@ -275,6 +277,7 @@ public class BW_Meta_Items { } @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { int j = this.mEnabledItems.length(); @@ -289,6 +292,7 @@ public class BW_Meta_Items { } @Override + @SuppressWarnings("unchecked") protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { super.addAdditionalToolTips(aList, aStack, aPlayer); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java index 2dfb4ad7c0..22a1caaaf1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index a2442cb6d2..3629b01ead 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -107,6 +107,7 @@ public class CircuitImprintLoader implements Runnable { this.makeCircuitImprints(); } + @SuppressWarnings("deprecation") public static GT_Recipe makeMoreExpensive(GT_Recipe original){ GT_Recipe newRecipe = original.copy(); for (ItemStack is : newRecipe.mInputs){ @@ -122,6 +123,7 @@ public class CircuitImprintLoader implements Runnable { return newRecipe; } + @SuppressWarnings("deprecation") public static GT_Recipe reBuildRecipe(GT_Recipe original){ ItemStack out = original.copy().getOutput(0); out.stackSize *= 16; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index b6d1e83529..c72c7acebc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java index 6befd36ba6..1d1b1a0f35 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; @@ -30,7 +52,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { private boolean hasList; - public BWGTMetaItems(OrePrefixes orePrefixes, List noSubIDMaterials) { + public BWGTMetaItems(OrePrefixes orePrefixes, List noSubIDMaterials) { super(orePrefixes,null); materialloop: for (int i = 0; i < Materials.values().length; i++) { @@ -53,7 +75,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { materialloop: for (int i = 0; i < noSubIDMaterials.size(); i++) { ItemStack tStack = new ItemStack(this, 1, i+1001); - Materials w = (Materials) noSubIDMaterials.get(i); + Materials w = noSubIDMaterials.get(i); if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) @@ -95,6 +117,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { @Override @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { for (int i = 0; i < Materials.values().length; i++) { Materials w = Materials.values()[i]; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java index 3cfed71a8c..4beeab09b2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java index ee1f6b3b57..18651eb7f0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -47,6 +47,7 @@ import java.util.List; import static gregtech.api.enums.OrePrefixes.*; +@SuppressWarnings("ALL") public class LuVTierEnhancer implements Runnable { public void run() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index fa28531234..ff7d384dc3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -42,7 +42,6 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.common.blocks.GT_Block_Ores; import gregtech.common.blocks.GT_Block_Ores_Abstract; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; @@ -55,7 +54,6 @@ import org.apache.commons.lang3.reflect.FieldUtils; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.*; -import java.util.stream.Collectors; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; import static gregtech.api.enums.OrePrefixes.*; @@ -208,6 +206,7 @@ public class PlatinumSludgeOverHaul { return false; } + @SuppressWarnings({"unchecked","rawtypes"}) public static void replacePureElements() { //furnace for (Object entry : FurnaceRecipes.smelting().getSmeltingList().entrySet()) { @@ -237,7 +236,7 @@ public class PlatinumSludgeOverHaul { for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { if (map == GT_Recipe.GT_Recipe_Map.sFusionRecipes || map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes) continue; - HashSet toDel = new HashSet(); + HashSet toDel = new HashSet<>(); recipeloop: for (GT_Recipe recipe : map.mRecipeList) { if (recipe.mFakeRecipe) @@ -368,7 +367,7 @@ public class PlatinumSludgeOverHaul { } private static void replaceHVCircuitMaterials(){ - GT_Values.RA.addMixerRecipe(Materials.Redstone.getDust(1),Materials.Electrum.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,Materials.Nikolite.getDust(8),1800,120); + GT_Values.RA.addMixerRecipe(Materials.Redstone.getDust(1),Materials.Electrum.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,Materials.Electrotine.getDust(8),1800,120); for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList){ if (recipe.mEUt > 512) continue; @@ -441,14 +440,13 @@ public class PlatinumSludgeOverHaul { } // END OF APACHE COMMONS COLLECTION COPY - Object input = null; + Object input; try { input = in.get(obj); } catch (IllegalAccessException e) { e.printStackTrace(); return; } - assert input != null; if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Platinum.getDust(1), true)) { if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Platinum)) @@ -485,6 +483,7 @@ public class PlatinumSludgeOverHaul { } } + @SuppressWarnings({"rawtypes","unchecked"}) private static boolean checkRecipe(Object input,Materials mat){ if (input instanceof List || input instanceof Object[]) { Set lists = new HashSet(), stacks= new HashSet(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java index bba6f66547..8957f2a986 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index dd13e5c734..17dd97ec2f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 76749db065..9c84b2e7fb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index c4d4dd1124..f66c2d5d2c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -86,7 +86,7 @@ public class AdditionalRecipes implements Runnable { //Milk //GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), Materials.Milk.getFluid(12000), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500, 49152, 600000000); - GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(1),null,Materials.Milk.getFluid(10000),Materials.Water.getFluid(8832),Materials.Sugar.getDustSmall(21),Materials.Calcium.getDustTiny(1),Materials.Magnesium.getDustTiny(1),Materials.Potassium.getDustTiny(1),Materials.Sodium.getDustTiny(4),Materials.Phosphor.getDustTiny(1),new int[]{10000,10000,1000,10000,1000,1000},50,120); + GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(1),null,Materials.Milk.getFluid(10000),Materials.Water.getFluid(8832),Materials.Sugar.getDustSmall(21),Materials.Calcium.getDustTiny(1),Materials.Magnesium.getDustTiny(1),Materials.Potassium.getDustTiny(1),Materials.Sodium.getDustTiny(4),Materials.Phosphorus.getDustTiny(1),new int[]{10000,10000,1000,10000,1000,1000},50,120); for (int i = 0; i <= 6; i++) { GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( @@ -128,14 +128,14 @@ public class AdditionalRecipes implements Runnable { GT_Recipe.GT_Recipe_Map.sLargeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stick)}, new ItemStack[]{}, null, null, null, 0, 0, 62500); try{ - Class map = GT_Recipe.GT_Recipe_Map.class; + Class map = GT_Recipe.GT_Recipe_Map.class; GT_Recipe.GT_Recipe_Map sHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sHugeNaquadahReactorFuels").get(null); GT_Recipe.GT_Recipe_Map sExtremeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sExtremeNaquadahReactorFuels").get(null); GT_Recipe.GT_Recipe_Map sUltraHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sUltraHugeNaquadahReactorFuels").get(null); sHugeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stickLong)}, new ItemStack[]{}, null, null, null, 0, 0, 125000); sExtremeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stick)}, new ItemStack[]{}, null, null, null, 0, 0, 31250); sUltraHugeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stickLong)}, new ItemStack[]{}, null, null, null, 0, 0, 125000); - }catch (NullPointerException | IllegalAccessException e){} + }catch (NullPointerException | IllegalAccessException ignored){} new LoadItemContainers().run(); @@ -156,6 +156,8 @@ public class AdditionalRecipes implements Runnable { GregTech_API.sAfterGTPostload.add(new LuVTierEnhancer()); AdditionalRecipes.oldGThelperMethod(); } + + @SuppressWarnings("unchecked") private static void oldGThelperMethod() { //manual override for older GT Werkstoff werkstoff = WerkstoffLoader.Oganesson; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java index c7c1ed2585..09de02eeb2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java index 1ed1cb0b83..c5295eab6e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java index 289d76c4f8..f2edb3b32d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java index 61a1d33d08..9269762a22 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,6 +37,7 @@ public class OreDictAdder { OreDictAdder.toAddMap.put(element.getKey(),element.getValue()); } + @SafeVarargs public static synchronized void addToMap(Pair... elements){ for (Pair p : elements) OreDictAdder.toAddMap.put(p.getKey(),p.getValue()); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java index 6bc3627e7c..9aa46ae3b2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java index 920bb109af..5d86ecf88e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java index 8a442787b9..3def3800d5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index 471120793e..b8fda6a8dc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java index 1659918870..6f32b0007b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java index 39a1ffa5bb..2471a36b60 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java index ead000b328..dbeaa9ef3e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -41,7 +41,7 @@ import java.security.SecureRandom; import java.util.Random; import static net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST; - +@SuppressWarnings({"ALL"}) public abstract class MapGenRuins extends WorldGenerator { protected Pair[][] ToBuildWith = new Pair[4][0]; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 2e3e8cf698..5da71e18b4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -65,7 +65,7 @@ public class BWRecipes { public static final byte CIRCUITASSEMBLYLINE = 3; private final GT_Recipe.GT_Recipe_Map sBiolab = new GT_Recipe.GT_Recipe_Map( - new HashSet(150), + new HashSet<>(150), "bw.recipe.biolab", StatCollector.translateToLocal("tile.biolab.name"), null, @@ -74,7 +74,7 @@ public class BWRecipes { "", 1, "", true, false //special handler ); private final BacteriaVatRecipeMap sBacteriaVat = new BacteriaVatRecipeMap( - new HashSet(50), + new HashSet<>(50), "bw.recipe.BacteriaVat", StatCollector.translateToLocal("tile.biovat.name"), null, @@ -83,7 +83,7 @@ public class BWRecipes { " Sievert: ", 1, " Sv", true, false //special handler ); private final BW_Recipe_Map_LiquidFuel sAcidGenFuels = new BW_Recipe_Map_LiquidFuel( - new HashSet(10), + new HashSet<>(10), "bw.fuels.acidgens", StatCollector.translateToLocal("tile.acidgenerator.name"), null, @@ -92,7 +92,7 @@ public class BWRecipes { "EU generated: ", 1000, "", false, true ); private final BWRecipes.SpecialObjectSensitiveMap sCircuitAssemblyLineMap = new SpecialObjectSensitiveMap( - new HashSet(60), + new HashSet<>(60), "bw.recipe.cal", "Circuit Assembly Line", null, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java index 2c01562b8a..a4a2a794d0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index f9d803ef10..703c3b66da 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index e7015053ca..ab8eea357d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java index 4cdbf1a143..7bb8e427cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java index 1421f75c40..b64e508abd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,7 @@ import java.util.ArrayList; import java.util.Objects; public class BioData { - public static final ArrayList BIO_DATA_ARRAY_LIST = new ArrayList(); + public static final ArrayList BIO_DATA_ARRAY_LIST = new ArrayList<>(); protected String name; protected int ID; @@ -59,6 +59,7 @@ public class BioData { this.name = bioData.name; this.ID = bioData.ID; this.chance = bioData.chance; + this.tier = bioData.tier; } public static BioData convertBioPlasmidToBioData(BioPlasmid bioPlasmid) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java index 1d59edb5ea..9cadce5239 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java index b78e39afe1..38074acc7b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java index 7e35affabf..0e8c18f93c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -32,7 +32,7 @@ import java.util.HashSet; public class ConnectedBlocksChecker { - public final HashSet hashset = new HashSet(2048); + public final HashSet hashset = new HashSet<>(2048); public static byte check_sourroundings(Coords C, Block b) { byte ret = 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java index 707b374888..8282b132ee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -38,9 +38,9 @@ import java.util.Queue; */ public class ConnectedBlocksCheckerIteration { - public final HashSet hashset = new HashSet(2048); - public final HashSet checked = new HashSet(4096); - private final Queue kwoe = new LinkedList(); + public final HashSet hashset = new HashSet<>(2048); + public final HashSet checked = new HashSet<>(4096); + private final Queue kwoe = new LinkedList<>(); public long get_connected(World w, int x, int y, int z, Block b){ kwoe.add(new Coords(x,y,z,w.provider.dimensionId)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java index c27054eb01..4a3ee25235 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -41,10 +41,10 @@ public class Coords { @Override public boolean equals(Object o) { -// if (this == o) -// return true; -// if (o == null || this.getClass() != o.getClass()) -// return false; + if (this == o) + return true; + if (o == null || this.getClass() != o.getClass()) + return false; Coords coords = (Coords) o; return this.x == coords.x && this.y == coords.y && diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java index d37f3f0661..2b740e35d5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java index d568baf22b..4a6b8584dd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java index e494594bd2..5dcb897da2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java @@ -17,11 +17,11 @@ package com.github.bartimaeusnek.bartworks.util.NoiseUtil; */ public class SimplexNoise { // Simplex noise in 2D, 3D and 4D - private static Grad grad3[] = {new Grad(1,1,0),new Grad(-1,1,0),new Grad(1,-1,0),new Grad(-1,-1,0), + private static Grad[] grad3 = {new Grad(1,1,0),new Grad(-1,1,0),new Grad(1,-1,0),new Grad(-1,-1,0), new Grad(1,0,1),new Grad(-1,0,1),new Grad(1,0,-1),new Grad(-1,0,-1), new Grad(0,1,1),new Grad(0,-1,1),new Grad(0,1,-1),new Grad(0,-1,-1)}; - private static Grad grad4[]= {new Grad(0,1,1,1),new Grad(0,1,1,-1),new Grad(0,1,-1,1),new Grad(0,1,-1,-1), + private static Grad[] grad4 = {new Grad(0,1,1,1),new Grad(0,1,1,-1),new Grad(0,1,-1,1),new Grad(0,1,-1,-1), new Grad(0,-1,1,1),new Grad(0,-1,1,-1),new Grad(0,-1,-1,1),new Grad(0,-1,-1,-1), new Grad(1,0,1,1),new Grad(1,0,1,-1),new Grad(1,0,-1,1),new Grad(1,0,-1,-1), new Grad(-1,0,1,1),new Grad(-1,0,1,-1),new Grad(-1,0,-1,1),new Grad(-1,0,-1,-1), @@ -30,7 +30,7 @@ public class SimplexNoise { // Simplex noise in 2D, 3D and 4D new Grad(1,1,1,0),new Grad(1,1,-1,0),new Grad(1,-1,1,0),new Grad(1,-1,-1,0), new Grad(-1,1,1,0),new Grad(-1,1,-1,0),new Grad(-1,-1,1,0),new Grad(-1,-1,-1,0)}; - private static short p[] = {151,160,137,91,90,15, + private static short[] p = {151,160,137,91,90,15, 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23, 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33, 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166, @@ -44,8 +44,8 @@ public class SimplexNoise { // Simplex noise in 2D, 3D and 4D 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254, 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180}; // To remove the need for index wrapping, double the permutation table length - private static short perm[] = new short[512]; - private static short permMod12[] = new short[512]; + private static short[] perm = new short[512]; + private static short[] permMod12 = new short[512]; static { for(int i=0; i<512; i++) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java index acc6da7b14..a64793676c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,7 +26,8 @@ import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Map; -public class Pair implements Map.Entry { +@SuppressWarnings("unchecked") +public class Pair implements Map.Entry { Object[] pair = new Object[2]; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 6c1b1bd175..67deac1066 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java index e424b693d2..11ae398d54 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -38,7 +38,7 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.util.*; - +@SuppressWarnings({"unchecked","rawtypes","unused"}) public class RadioHatchCompat implements Runnable { private static Class intf; @@ -225,7 +225,7 @@ public class RadioHatchCompat implements Runnable { if (RadioHatchCompat.isRadioactive.getBoolean(materialObj)) ret += ((int) RadioHatchCompat.radlevel.getByte(m) + RadioHatchCompat.GTPPRadAdapter.clampToZero(RadioHatchCompat.protons.getLong(materialObj))); else - ret += ((int) RadioHatchCompat.radlevel.getByte(m)); + ret += RadioHatchCompat.radlevel.getByte(m); } catch (IllegalAccessException e) { e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java index 3b9a70b89d..5e1bb3e792 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -47,6 +47,7 @@ import java.util.HashSet; import static com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler.AspectAdder; +@SuppressWarnings("ALL") public class TCRecipeHandler { public static final GT_Recipe.GT_Recipe_Map alchemicalConstructHandler = new TCRecipeHandler.TCRecipeMap(new HashSet<>(15000), "bwcm.recipe.alchemicalConstruct", diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java index 0db95667ae..db9b77ec91 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -45,6 +45,7 @@ import java.util.Map; import static gregtech.api.enums.GT_Values.V; +@SuppressWarnings("ALL") public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlockBase { private List mEssentiaHatches = new ArrayList<>(); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java index c720de1f07..b6cc37b451 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,14 +22,16 @@ package com.github.bartimaeusnek.crossmod.emt.util; -import java.lang.reflect.Field; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import java.lang.reflect.Field; +@SuppressWarnings("unchecked") public class EMTHandler { - public static Class aEssentiaInputHatch; + public static Class aEssentiaInputHatch; public static Field aAspectField; static { try { - aEssentiaInputHatch = Class.forName("emt.gthandler.common.implementations.EssentiaHatch"); + aEssentiaInputHatch = (Class) Class.forName("emt.gthandler.common.implementations.EssentiaHatch"); aAspectField = aEssentiaInputHatch.getDeclaredField("current"); aAspectField.setAccessible(true); } catch (ClassNotFoundException | NoSuchFieldException e) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java index b3648ccabc..255f83a125 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java index 8eddf5eb04..fb0451d381 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java index ddae0648b2..16e4020459 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java index 0b835e382c..83238c5f07 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34,8 +34,12 @@ import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; -import java.util.*; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +@SuppressWarnings("unused") public final class BWAtmosphereManager { private static final Map COEFFICIENT_MAP = new HashMap<>(); @@ -61,7 +65,6 @@ public final class BWAtmosphereManager { } public static void removeGasFromWorld(int worldID, ISubTagContainer gas){ - HashSet toRemSet = new HashSet(); for (Pair pair : BWAtmosphereManager.gasConcentration.get(worldID)){ if (pair.getKey().equals(gas)){ BWAtmosphereManager.gasConcentration.get(worldID).remove(pair); @@ -71,7 +74,7 @@ public final class BWAtmosphereManager { } public static void addGasToWorld(int worldID, ISubTagContainer gas, int amount){ - Pair toadd = new Pair(gas,amount); + Pair toadd = new Pair<>(gas,amount); BWAtmosphereManager.gasConcentration.put(worldID,toadd); } @@ -79,6 +82,7 @@ public final class BWAtmosphereManager { BWAtmosphereManager.gasConcentration.put(worldID,toPut); } + @SafeVarargs public static void addGasToWorld(int worldID, Pair... toPut){ for (Pair toadd : toPut) BWAtmosphereManager.gasConcentration.put(worldID,toadd); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java index a404c30e34..3a7e92f186 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java index d30d72bacd..7e082ba695 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java index 988920cae6..47be16ce21 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index c815c6f3d6..bc33a08855 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -65,6 +65,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { } @Override + @SuppressWarnings("rawtypes") public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) { return null; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java index d575bd7dd8..d096ba4962 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java index 40cfbbbca4..f6a5cfc3f3 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -57,7 +57,7 @@ public class WorldProviderRoss128b extends AbstractWorldProviderSpace { float blue = 0.0F; red *= angle * 0.94F + 0.06F; green *= angle * 0.94F + 0.06F; - return Vec3.createVectorHelper((double) red, (double) green, (double) blue); + return Vec3.createVectorHelper(red, green, blue); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java index 2cc84b41ea..69e7c3d525 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java index eeb306018c..f445290136 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index b548597e08..cc3f2a0744 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java index ffc3c9f756..cce24d22db 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.crossmod.galaxySpace.tileEntity; import gregtech.api.interfaces.ITexture; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java index c03a8f5f04..609a718be2 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.crossmod.galaxySpace.tileEntity; import cpw.mods.fml.common.event.FMLInitializationEvent; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java index 7db0ab7bb5..954364034a 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java index 78251dac89..1cfdcf32d6 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java index b62ec218b5..8bfa8024d5 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.crossmod.tectech; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; @@ -11,9 +33,10 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energ import java.util.ArrayList; import java.util.Iterator; +@SuppressWarnings({"unused"}) public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { - ArrayList mTTEnerys = new ArrayList<>(); + ArrayList mTTEnergyHatches = new ArrayList<>(); ArrayList mTTDynamos = new ArrayList<>(); public TT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -43,11 +66,11 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { long totalOutput = 0L; long aFirstVoltageFound = -1L; boolean aFoundMixedDynamos = false; - Iterator var10 = this.mDynamoHatches.iterator(); + Iterator var10 = this.mDynamoHatches.iterator(); long aVoltage; while(var10.hasNext()) { - GT_MetaTileEntity_Hatch_Dynamo aDynamo = (GT_MetaTileEntity_Hatch_Dynamo)var10.next(); + GT_MetaTileEntity_Hatch_Dynamo aDynamo = var10.next(); if (aDynamo == null) { return false; } @@ -69,7 +92,7 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { this.explodeMultiblock(); return false; } else { - Iterator var17 = this.mDynamoHatches.iterator(); + Iterator var17 = this.mDynamoHatches.iterator(); while(true) { GT_MetaTileEntity_Hatch_Dynamo aDynamo; @@ -78,14 +101,14 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { return injected > 0; } - aDynamo = (GT_MetaTileEntity_Hatch_Dynamo)var17.next(); + aDynamo = var17.next(); } while(!isValidMetaTileEntity(aDynamo)); long leftToInject = aEU - (long)injected; aVoltage = aDynamo.maxEUOutput(); int aAmpsToInject = (int)(leftToInject / aVoltage); int aRemainder = (int)(leftToInject - (long)aAmpsToInject * aVoltage); - int ampsOnCurrentHatch = (int)Math.min(aDynamo.maxAmperesOut(), (long)aAmpsToInject); + int ampsOnCurrentHatch = (int)Math.min(aDynamo.maxAmperesOut(), aAmpsToInject); for(int i = 0; i < ampsOnCurrentHatch; ++i) { aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage, false); @@ -93,7 +116,7 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { injected = (int)((long)injected + aVoltage * (long)ampsOnCurrentHatch); if (aRemainder > 0 && (long)ampsOnCurrentHatch < aDynamo.maxAmperesOut()) { - aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits((long)aRemainder, false); + aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aRemainder, false); injected += aRemainder; } } @@ -103,11 +126,9 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { public boolean drainEnergyInput(long aEU) { - if (aEU <= 0L) { - return true; - } else { + if (aEU > 0L) { { - Iterator var3 = this.mTTEnerys.iterator(); + Iterator var3 = this.mTTEnergyHatches.iterator(); GT_MetaTileEntity_Hatch_EnergyMulti tHatch; do { @@ -115,11 +136,11 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { return false; } - tHatch = (GT_MetaTileEntity_Hatch_EnergyMulti)var3.next(); - } while(!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); + tHatch = var3.next(); + } while (!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); } { - Iterator var3 = this.mEnergyHatches.iterator(); + Iterator var3 = this.mEnergyHatches.iterator(); GT_MetaTileEntity_Hatch_Energy tHatch; do { @@ -127,11 +148,11 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { return false; } - tHatch = (GT_MetaTileEntity_Hatch_Energy)var3.next(); - } while(!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); + tHatch = var3.next(); + } while (!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); } - return true; } + return true; } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java index 6c33818755..855c5011a1 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.crossmod.tectech; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; @@ -11,6 +33,7 @@ import net.minecraftforge.fluids.FluidStack; public class TecTechResearchLoader { + @SuppressWarnings("deprecation") public static void runResearches(){ TT_recipeAdder.addResearchableAssemblylineRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java index 267945116f..c6f9003d9d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java index 3700e89287..67c0dfb15d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java index 7911b0c9af..991b7ad1b5 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -51,11 +51,8 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { this.mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3L; this.mBatteryCount = 0; this.mChargeableCount = 0; - ItemStack[] var4 = this.mInventory; - int var5 = var4.length; - for(int var6 = 0; var6 < var5; ++var6) { - ItemStack tStack = var4[var6]; + for (ItemStack tStack : this.mInventory) { if (ThaumcraftHandler.isWand(tStack)) { ++this.mBatteryCount; ++this.mChargeableCount; @@ -82,23 +79,20 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { boolean storedOverflow = false; long tScale = this.getBaseMetaTileEntity().getEUCapacity(); long tStored = this.getBaseMetaTileEntity().getStoredEU(); - long tStep = 0L; + long tStep; if (this.mInventory != null) { - ItemStack[] var9 = this.mInventory; - int var10 = var9.length; - for(int var11 = 0; var11 < var10; ++var11) { - ItemStack aStack = var9[var11]; + for (ItemStack aStack : this.mInventory) { if (GT_ModHandler.isElectricItem(aStack)) { if (aStack.getItem() instanceof GT_MetaBase_Item) { - Long[] stats = ((GT_MetaBase_Item)aStack.getItem()).getElectricStats(aStack); + Long[] stats = ((GT_MetaBase_Item) aStack.getItem()).getElectricStats(aStack); if (stats != null) { if (stats[0] > 4611686018427387903L) { scaleOverflow = true; } tScale += stats[0]; - tStep = ((GT_MetaBase_Item)aStack.getItem()).getRealCharge(aStack); + tStep = ((GT_MetaBase_Item) aStack.getItem()).getRealCharge(aStack); if (tStep > 4611686018427387903L) { storedOverflow = true; } @@ -106,8 +100,8 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { tStored += tStep; } } else if (aStack.getItem() instanceof IElectricItem) { - tStored += (long)ElectricItem.manager.getCharge(aStack); - tScale += (long)((IElectricItem)aStack.getItem()).getMaxCharge(aStack); + tStored += (long) ElectricItem.manager.getCharge(aStack); + tScale += (long) ((IElectricItem) aStack.getItem()).getMaxCharge(aStack); } } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index 5396f872ec..34fc8be00e 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,6 +37,7 @@ import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +@SuppressWarnings({"rawtypes","unchecked","unused"}) public class ThaumcraftHandler { private ThaumcraftHandler(){} -- cgit From 00ab9ee56f81e6fe4e0234b2a8cd3a7e44ecb4b0 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 9 Dec 2019 18:50:05 +0100 Subject: fixed problems with vanilla gt5u + inlined an else statement Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: f46f6f19f8a44f45b582c2cbe7802d06df6c471a --- .../bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java | 4 +--- .../system/material/GT_Enhancement/PlatinumSludgeOverHaul.java | 3 ++- .../system/material/processingLoaders/AdditionalRecipes.java | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java index 3494b461a5..4de38a0e55 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java @@ -76,10 +76,8 @@ public class BW_GT_ItemRenderer implements IItemRenderer { if (RenderItem.renderInFrame) { GL11.glScalef(0.85F, 0.85F, 0.85F); GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); - GL11.glTranslated(-0.5D, -0.42D, 0.0D); - } else { - GL11.glTranslated(-0.5D, -0.42D, 0.0D); } + GL11.glTranslated(-0.5D, -0.42D, 0.0D); } GL11.glColor3f(1.0F, 1.0F, 1.0F); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index ff7d384dc3..74c60fb27e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -366,8 +366,9 @@ public class PlatinumSludgeOverHaul { PlatinumSludgeOverHaul.runHelperrecipes(); } + @SuppressWarnings("deprecation") private static void replaceHVCircuitMaterials(){ - GT_Values.RA.addMixerRecipe(Materials.Redstone.getDust(1),Materials.Electrum.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,Materials.Electrotine.getDust(8),1800,120); + GT_Values.RA.addMixerRecipe(Materials.Redstone.getDust(1),Materials.Electrum.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,Materials.Nikolite.getDust(8),1800,120); for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList){ if (recipe.mEUt > 512) continue; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index f66c2d5d2c..807db1f804 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -49,6 +49,7 @@ import static gregtech.api.enums.OrePrefixes.*; public class AdditionalRecipes implements Runnable { @Override + @SuppressWarnings("deprecation") public void run() { ((BWRecipes.BW_Recipe_Map_LiquidFuel)BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(WerkstoffLoader.FormicAcid.getBridgeMaterial(),40); //Thorium/Yttrium Glas @@ -86,7 +87,7 @@ public class AdditionalRecipes implements Runnable { //Milk //GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), Materials.Milk.getFluid(12000), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500, 49152, 600000000); - GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(1),null,Materials.Milk.getFluid(10000),Materials.Water.getFluid(8832),Materials.Sugar.getDustSmall(21),Materials.Calcium.getDustTiny(1),Materials.Magnesium.getDustTiny(1),Materials.Potassium.getDustTiny(1),Materials.Sodium.getDustTiny(4),Materials.Phosphorus.getDustTiny(1),new int[]{10000,10000,1000,10000,1000,1000},50,120); + GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(1),null,Materials.Milk.getFluid(10000),Materials.Water.getFluid(8832),Materials.Sugar.getDustSmall(21),Materials.Calcium.getDustTiny(1),Materials.Magnesium.getDustTiny(1),Materials.Potassium.getDustTiny(1),Materials.Sodium.getDustTiny(4),Materials.Phosphor.getDustTiny(1),new int[]{10000,10000,1000,10000,1000,1000},50,120); for (int i = 0; i <= 6; i++) { GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( -- cgit From f87ba14311de8c8d9d34858b311a43c268bb4dfe Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 9 Dec 2019 22:01:53 +0100 Subject: added additional OreDict + fixed issues with Thaumcraft Aspect Handler if Forestry isnt installed + refined error handling + removed redundant calls that have a function + version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: eaa39a4359ee177307eaf954bdbe4032465ecb51 --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 4 +-- .../system/material/BW_MetaGenerated_Items.java | 4 +-- .../bartworks/system/material/Werkstoff.java | 10 ++++++ .../bartworks/system/material/WerkstoffLoader.java | 38 +++++++++++++++++----- .../thaumcraft/util/ThaumcraftHandler.java | 7 ++-- 6 files changed, 48 insertions(+), 17 deletions(-) diff --git a/build.properties b/build.properties index 2e8d567f7e..7523062c9c 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre31 +buildNumber=2_pre32 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index abd55ddf6e..d725129087 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -212,7 +212,7 @@ public final class MainMod { new CircuitImprintLoader().run(); runOnServerStarted(); fixEnergyRequirements(); - MainMod.unificationEnforcer(); + MainMod.unificationRecipeEnforcer(); } public static void runOnPlayerJoined(boolean classicMode, boolean extraGasRecipes){ @@ -245,7 +245,7 @@ public final class MainMod { } } - private static void unificationEnforcer() { + private static void unificationRecipeEnforcer() { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { if (werkstoff.getGenerationFeatures().enforceUnification) { if (werkstoff.contains(NOBLE_GAS)) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 0b11ae9f89..57f6c319b6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -89,9 +89,9 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", this.getDefaultLocalization(w)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); if (ConfigHandler.experimentalThreadedLoader) - OreDictAdder.addToMap(new Pair<>(this.orePrefixes.name() + w.getDefaultName().replaceAll(" ",""), tStack)); + OreDictAdder.addToMap(new Pair<>(this.orePrefixes.name() + w.getVarName(), tStack)); else - GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.getDefaultName().replaceAll(" ",""), tStack); + GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.getVarName(), tStack); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 17dd97ec2f..77b027c123 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -51,6 +51,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { private static final Werkstoff.GenerationFeatures DEFAULT_NULL_GENERATION_FEATURES = new Werkstoff.GenerationFeatures().disable(); public static Werkstoff default_null_Werkstoff; + private final HashSet ADDITIONAL_OREDICT = new HashSet<>(); private final List mOreByProducts = new ArrayList<>(); private final LinkedHashSet> CONTENTS = new LinkedHashSet<>(); private final HashSet SUBTAGS = new HashSet<>(); @@ -204,6 +205,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } + public Werkstoff addAdditionalOreDict(String s){ + ADDITIONAL_OREDICT.add(s); + return this; + } + + public HashSet getADDITIONAL_OREDICT() { + return ADDITIONAL_OREDICT; + } + public void setTCAspects(Pair... pAspectsArr){ this.stats.mTC_Aspects=pAspectsArr; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 9c84b2e7fb..818fc44c78 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -69,6 +69,7 @@ import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; +import org.apache.logging.log4j.Level; import java.lang.reflect.Field; import java.util.*; @@ -101,6 +102,7 @@ public class WerkstoffLoader implements Runnable { gtnhGT = GT_MetaGenerated_Tool_01.class.getField("SOLDERING_IRON_MV") != null; } catch (NoSuchFieldException ignored) {} + //GTNH hack for molten cells for (OrePrefixes prefix : OrePrefixes.values()){ if (prefix.toString().equals("cellMolten")) WerkstoffLoader.cellMolten = prefix; @@ -1310,6 +1312,7 @@ public class WerkstoffLoader implements Runnable { public static Block BWOres; public static Block BWSmallOres; public boolean registered; + public static final HashSet ENABLED_ORE_PREFIXES = new HashSet<>(); public static Werkstoff getWerkstoff(String Name){ try{ @@ -1328,7 +1331,7 @@ public class WerkstoffLoader implements Runnable { public static ItemStack getCorrespondingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { if (!werkstoff.getGenerationFeatures().enforceUnification) { - ItemStack ret = OreDictHandler.getItemStack(werkstoff.getDefaultName(), orePrefixes, amount); + ItemStack ret = OreDictHandler.getItemStack(werkstoff.getVarName(), orePrefixes, amount); if (ret != null) return ret; } @@ -1337,13 +1340,16 @@ public class WerkstoffLoader implements Runnable { if (orePrefixes == oreSmall) return new ItemStack(WerkstoffLoader.BWSmallOres, amount, werkstoff.getmID()); if (WerkstoffLoader.items.get(orePrefixes) == null) - new Exception("NO SUCH ITEM!"+orePrefixes+werkstoff.getDefaultName()).printStackTrace(); + MainMod.LOGGER.catching(Level.ERROR,new Exception("NO SUCH ITEM! "+orePrefixes+werkstoff.getVarName() +" If you encounter this as a user, make sure to contact the authors of the pack/the mods you're playing! " + + "If you are a Developer, you forgot to enable "+orePrefixes+" OrePrefix for Werkstoff "+werkstoff.getDefaultName())); return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); } public void init() { - if (WerkstoffLoader.INSTANCE == null) + if (WerkstoffLoader.INSTANCE == null) { MainMod.LOGGER.error("INSTANCE IS NULL THIS SHOULD NEVER HAPPEN!"); + FMLCommonHandler.instance().exitJava(1,true); + } GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.purify.2","Throw into Cauldron to get clean crushed Ore"); } @@ -1501,7 +1507,7 @@ public class WerkstoffLoader implements Runnable { } for (OrePrefixes p : values()) if (!werkstoff.getGenerationFeatures().enforceUnification && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(),p,1) != null) { - MainMod.LOGGER.info("Found: "+(p+werkstoff.getDefaultName().replaceAll(" ",""))+" in oreDict, disable and reroute my Items to that, also add a Tooltip."); + DebugLog.log("Found: "+(p+werkstoff.getVarName())+" in oreDict, disable and reroute my Items to that, also add a Tooltip."); werkstoff.getGenerationFeatures().setBlacklist(p); } WerkstoffLoader.toGenerateGlobal = (WerkstoffLoader.toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); @@ -1579,6 +1585,9 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.items.put(ingotQuadruple, new BW_MetaGenerated_Items(ingotQuadruple)); WerkstoffLoader.items.put(ingotQuintuple, new BW_MetaGenerated_Items(ingotQuintuple)); } + ENABLED_ORE_PREFIXES.addAll(WerkstoffLoader.items.keySet()); + ENABLED_ORE_PREFIXES.add(ore); + ENABLED_ORE_PREFIXES.add(oreSmall); WerkstoffLoader.runGTItemDataRegistrator(); } @@ -1599,7 +1608,7 @@ public class WerkstoffLoader implements Runnable { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { //int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, String aConfigSection, boolean aCustomOre, String aCustomID Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : - new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(),0, werkstoff.getRGBA()[0],werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName(),0,0,werkstoff.getStats().meltingPoint,werkstoff.getStats().meltingPoint,werkstoff.getStats().isBlastFurnace(),false,0,1,1,null); + new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(),0, werkstoff.getRGBA()[0],werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getVarName(), werkstoff.getDefaultName(),0,0,werkstoff.getStats().meltingPoint,werkstoff.getStats().meltingPoint,werkstoff.getStats().isBlastFurnace(),false,0,1,1,null); for (OrePrefixes prefixes : values()) { if (!(prefixes == cell && werkstoff.getType().equals(Werkstoff.Types.ELEMENT))) { if (prefixes == dust && werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { @@ -1610,7 +1619,7 @@ public class WerkstoffLoader implements Runnable { if (e.mLinkedMaterials.size() > 0) break; werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : - new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(),0, werkstoff.getRGBA()[0],werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.getDefaultName(),0,0,werkstoff.getStats().meltingPoint,werkstoff.getStats().meltingPoint,werkstoff.getStats().isBlastFurnace(),false,0,1,1,null); + new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(),0, werkstoff.getRGBA()[0],werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getVarName(), werkstoff.getDefaultName(),0,0,werkstoff.getStats().meltingPoint,werkstoff.getStats().meltingPoint,werkstoff.getStats().isBlastFurnace(),false,0,1,1,null); werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials = new ArrayList<>(); e.mLinkedMaterials.add(werkstoffBridgeMaterial); @@ -1773,18 +1782,29 @@ public class WerkstoffLoader implements Runnable { if (ConfigHandler.experimentalThreadedLoader){ for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { if (werkstoff.getGenerationFeatures().hasOres()) - OreDictAdder.addToMap(new Pair<>(ore + werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.get(ore))); + OreDictAdder.addToMap(new Pair<>(ore + werkstoff.getVarName(), werkstoff.get(ore))); if (werkstoff.getGenerationFeatures().hasGems()) OreDictAdder.addToMap(new Pair<>("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens))); + if (werkstoff.getADDITIONAL_OREDICT().size() > 0) + werkstoff.getADDITIONAL_OREDICT() + .forEach(s -> ENABLED_ORE_PREFIXES + .stream() + .filter(o -> Objects.nonNull(werkstoff.get(o))) + .forEach( od -> OreDictionary.registerOre(od+s, werkstoff.get(od)))); } - OreDictAdder.addToMap(new Pair<>("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite))); } else { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { if (werkstoff.getGenerationFeatures().hasOres()) - GT_OreDictUnificator.registerOre(ore + werkstoff.getDefaultName().replaceAll(" ", ""), werkstoff.get(ore)); + GT_OreDictUnificator.registerOre(ore + werkstoff.getVarName(), werkstoff.get(ore)); if (werkstoff.getGenerationFeatures().hasGems()) OreDictionary.registerOre("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens)); + + werkstoff.getADDITIONAL_OREDICT() + .forEach(s -> WerkstoffLoader.items.keySet() + .stream() + .filter(o -> Objects.nonNull(werkstoff.get(o))) + .forEach( od -> OreDictionary.registerOre(od+s, werkstoff.get(od)))); } GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite)); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index 34fc8be00e..8789ee60d3 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -36,6 +36,7 @@ import net.minecraft.world.biome.BiomeGenBase; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.util.Objects; @SuppressWarnings({"rawtypes","unchecked","unused"}) public class ThaumcraftHandler { @@ -148,15 +149,15 @@ public class ThaumcraftHandler { } public static void addAspectToAll(Werkstoff werkstoff){ - for (OrePrefixes element : OrePrefixes.values()) { + for (OrePrefixes element : WerkstoffLoader.ENABLED_ORE_PREFIXES) { if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(element)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(element)) == 0) { if (element.mMaterialAmount >= 3628800L || element == OrePrefixes.ore) { DebugLog.log("OrePrefix: " + element.name() + " mMaterialAmount: " + element.mMaterialAmount/3628800L); - if (WerkstoffLoader.items.get(element) != null) + if (Objects.nonNull(WerkstoffLoader.items.get(element))) ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), werkstoff.getTCAspects(element == OrePrefixes.ore ? 1 : (int) (element.mMaterialAmount / 3628800L))); } else if (element.mMaterialAmount >= 0L) { - if (WerkstoffLoader.items.get(element) != null) + if (Objects.nonNull(WerkstoffLoader.items.get(element))) ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), new Pair<>(TC_Aspects.PERDITIO.mAspect, 1)); } } -- cgit From 1a184abb892c4b9a83c7b89d59fcd3206ca7378e Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 11 Dec 2019 22:43:49 +0100 Subject: added fully automated Werkstoff Blocks + added recipes for the blocks + version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: dec9f6907e8c91cff240f6a9141c3531ceccea62 --- build.properties | 2 +- .../client/renderer/BW_Renderer_Block_Ores.java | 7 +- .../common/blocks/BW_TileEntityContainer.java | 2 +- .../bartworks/common/net/BW_Network.java | 2 +- .../bartworks/common/net/MetaBlockPacket.java | 95 +++++++++++++++++ .../bartworks/common/net/OrePacket.java | 95 ----------------- .../material/BW_MetaGeneratedBlock_Item.java | 84 ++++++++++++++++ .../system/material/BW_MetaGeneratedOreTE.java | 62 ++---------- .../system/material/BW_MetaGeneratedOre_Item.java | 84 ---------------- .../material/BW_MetaGeneratedSmallOreTE.java | 7 +- .../system/material/BW_MetaGenerated_Block_TE.java | 75 ++++++++++++++ .../system/material/BW_MetaGenerated_Blocks.java | 112 +++++++++++++++++++++ .../system/material/BW_MetaGenerated_Items.java | 2 + .../system/material/BW_MetaGenerated_Ores.java | 72 +------------ .../BW_MetaGenerated_WerkstoffBlock_TE.java | 48 +++++++++ .../material/BW_MetaGenerated_WerkstoffBlocks.java | 75 ++++++++++++++ .../bartworks/system/material/Werkstoff.java | 8 +- .../bartworks/system/material/WerkstoffLoader.java | 51 ++++++++-- 18 files changed, 556 insertions(+), 327 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java diff --git a/build.properties b/build.properties index 7523062c9c..a06efeb05f 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=2_pre32 +buildNumber=3_pre1 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index 7146293456..5418587508 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -22,9 +22,8 @@ package com.github.bartimaeusnek.bartworks.client.renderer; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedSmallOreTE; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_SmallOres; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block_TE; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Blocks; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; import net.minecraft.block.Block; @@ -41,7 +40,7 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { @Override public void renderInventoryBlock(Block aBlock, int aMeta, int modelId, RenderBlocks aRenderer) { - BW_MetaGeneratedOreTE tTileEntity = aBlock instanceof BW_MetaGenerated_SmallOres ? new BW_MetaGeneratedSmallOreTE() : new BW_MetaGeneratedOreTE(); + BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks)aBlock).getProperTileEntityForRendering(); tTileEntity.mMetaData = (short) aMeta; aBlock.setBlockBoundsForItemRender(); aRenderer.setRenderBoundsFromBlock(aBlock); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index 4fb77d6671..b1aeb18a54 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -53,7 +53,7 @@ import net.minecraftforge.fluids.IFluidContainerItem; public class BW_TileEntityContainer extends BlockContainer implements ITileAddsInformation { - Class tileEntity; + protected Class tileEntity; public BW_TileEntityContainer(Material p_i45386_1_, Class tileEntity, String blockName) { super(p_i45386_1_); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index 7c6ba97d67..b22bd115fd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -59,7 +59,7 @@ public class BW_Network extends MessageToMessageCodec public BW_Network() { this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", this, new BW_Network.HandlerShared()); - this.mSubChannels = new GT_Packet[]{new RendererPacket(), new CircuitProgrammerPacket(), new OrePacket(), new OreDictCachePacket(), new ServerJoinedPackage()}; + this.mSubChannels = new GT_Packet[]{new RendererPacket(), new CircuitProgrammerPacket(), new MetaBlockPacket(), new OreDictCachePacket(), new ServerJoinedPackage()}; } protected void encode(ChannelHandlerContext aContext, GT_Packet aPacket, List aOutput) throws Exception { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java new file mode 100644 index 0000000000..7d083bdaec --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.net; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block_TE; +import com.github.bartimaeusnek.bartworks.util.MurmurHash3; +import com.google.common.io.ByteArrayDataInput; +import gregtech.api.net.GT_Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import java.nio.ByteBuffer; + +public class MetaBlockPacket extends GT_Packet { + + int x; + short y; + int z; + short meta; + + public MetaBlockPacket(int x, int y, int z, int meta) { + super(false); + this.x = x; + this.y = (short) y; + this.z = z; + this.meta = (short) meta; + } + + public MetaBlockPacket() { + super(true); + } + + @Override + public byte getPacketID() { + return 2; + } + + @Override + public byte[] encode() { + int hash = MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), 0, 12, 31); + return ByteBuffer.allocate(16).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).putInt(hash).array(); + } + + @Override + public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { + byte[] tmp = new byte[16]; + byteArrayDataInput.readFully(tmp); + ByteBuffer buff = ByteBuffer.wrap(tmp); + this.x = buff.getInt(); + this.z = buff.getInt(); + this.y = buff.getShort(); + this.meta = buff.getShort(); + MetaBlockPacket todecode = new MetaBlockPacket(this.x, this.y, this.z, this.meta); + if (buff.getInt() != MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), 0, 12, 31)) { + MainMod.LOGGER.error("PACKET HASH DOES NOT MATCH!"); + return null; + } + return todecode; + } + + @Override + public void process(IBlockAccess iBlockAccess) { + if (iBlockAccess != null) { + TileEntity tTileEntity = iBlockAccess.getTileEntity(this.x, this.y, this.z); + if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) { + ((BW_MetaGenerated_Block_TE) tTileEntity).mMetaData = this.meta; + } + if (((iBlockAccess instanceof World)) && (((World) iBlockAccess).isRemote)) { + ((World) iBlockAccess).markBlockForUpdate(this.x, this.y, this.z); + } + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java deleted file mode 100644 index 75d5cddc30..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.net; - -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE; -import com.github.bartimaeusnek.bartworks.util.MurmurHash3; -import com.google.common.io.ByteArrayDataInput; -import gregtech.api.net.GT_Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import java.nio.ByteBuffer; - -public class OrePacket extends GT_Packet { - - int x; - short y; - int z; - short meta; - - public OrePacket(int x, int y, int z, int meta) { - super(false); - this.x = x; - this.y = (short) y; - this.z = z; - this.meta = (short) meta; - } - - public OrePacket() { - super(true); - } - - @Override - public byte getPacketID() { - return 2; - } - - @Override - public byte[] encode() { - int hash = MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), 0, 12, 31); - return ByteBuffer.allocate(16).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).putInt(hash).array(); - } - - @Override - public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { - byte[] tmp = new byte[16]; - byteArrayDataInput.readFully(tmp); - ByteBuffer buff = ByteBuffer.wrap(tmp); - this.x = buff.getInt(); - this.z = buff.getInt(); - this.y = buff.getShort(); - this.meta = buff.getShort(); - OrePacket todecode = new OrePacket(this.x, this.y, this.z, this.meta); - if (buff.getInt() != MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), 0, 12, 31)) { - MainMod.LOGGER.error("PACKET HASH DOES NOT MATCH!"); - return null; - } - return todecode; - } - - @Override - public void process(IBlockAccess iBlockAccess) { - if (iBlockAccess != null) { - TileEntity tTileEntity = iBlockAccess.getTileEntity(this.x, this.y, this.z); - if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { - ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = this.meta; - } - if (((iBlockAccess instanceof World)) && (((World) iBlockAccess).isRemote)) { - ((World) iBlockAccess).markBlockForUpdate(this.x, this.y, this.z); - } - } - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java new file mode 100644 index 0000000000..d50511337d --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; + +public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { + + public BW_MetaGeneratedBlock_Item(Block par1) { + super(par1); + } + + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { + return false; + } + + public String getUnlocalizedName(ItemStack aStack) { + return this.field_150939_a.getUnlocalizedName() + "." + this.getDamage(aStack); + } + + public String getItemStackDisplayName(ItemStack aStack) { + return GT_LanguageManager.getTranslation( getUnlocalizedName(aStack) + ".name"); + } + + @Override + @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + if (!GT_Utility.isStackValid(aStack) || aPlayer == null || aStack.getItemDamage() <= 0) + return; + if (aList == null) + aList = new ArrayList(); + aList.add(Werkstoff.werkstoffHashMap.get((short) aStack.getItemDamage()).getToolTip()); + } + + public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { + short tDamage = (short) this.getDamage(aStack); + if (tDamage > 0) { + if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) { + return false; + } + BW_MetaGenerated_Block_TE tTileEntity = (BW_MetaGenerated_Block_TE) aWorld.getTileEntity(aX, aY, aZ); + tTileEntity.mMetaData = tDamage; + } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, 0, 3)) { + return false; + } + if (aWorld.getBlock(aX, aY, aZ) == this.field_150939_a) { + this.field_150939_a.onBlockPlacedBy(aWorld, aX, aY, aZ, aPlayer, aStack); + this.field_150939_a.onPostBlockPlaced(aWorld, aX, aY, aZ, tDamage); + } + return true; + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index 5d876b3986..5a5539b3f4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -22,69 +22,14 @@ package com.github.bartimaeusnek.bartworks.system.material; -import com.github.bartimaeusnek.bartworks.common.net.OrePacket; -import com.github.bartimaeusnek.bartworks.util.Coords; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.ITexturedTileEntity; import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.objects.GT_RenderedTexture; import net.minecraft.block.Block; import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import java.util.ArrayList; - -import static com.github.bartimaeusnek.bartworks.MainMod.BW_Network_instance; - -public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEntity { - - public short mMetaData; - - public static boolean placeOre(World aWorld, Coords coords, Werkstoff werkstoff) { - short meta = werkstoff.getmID(); - aWorld.setBlock(coords.x, coords.y, coords.z, WerkstoffLoader.BWOres, 0, 0); - TileEntity tTileEntity = aWorld.getTileEntity(coords.x, coords.y, coords.z); - if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { - ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = meta; - } - return true; - } - - public boolean canUpdate() { - return false; - } - - public void readFromNBT(NBTTagCompound aNBT) { - super.readFromNBT(aNBT); - this.mMetaData = aNBT.getShort("m"); - } - - public void writeToNBT(NBTTagCompound aNBT) { - super.writeToNBT(aNBT); - aNBT.setShort("m", this.mMetaData); - } - - public ArrayList getDrops(Block aDroppedOre, int aFortune) { - ArrayList rList = new ArrayList<>(); - if (this.mMetaData < 0) { - rList.add(new ItemStack(Blocks.cobblestone, 1, 0)); - return rList; - } - rList.add(new ItemStack(aDroppedOre, 1, this.mMetaData)); - return rList; - } - - @Override - public Packet getDescriptionPacket() { - if (!this.worldObj.isRemote) - BW_Network_instance.sendPacketToAllPlayersInRange(this.worldObj, new OrePacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); - return null; - } +public class BW_MetaGeneratedOreTE extends BW_MetaGenerated_Block_TE { @Override public ITexture[] getTexture(Block aBlock, byte aSide) { @@ -95,4 +40,9 @@ public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEn } return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex])}; } + + @Override + protected Block GetProperBlock() { + return WerkstoffLoader.BWOres; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java deleted file mode 100644 index 90c30d1adf..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.system.material; - -import com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_Utility; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import java.util.ArrayList; -import java.util.List; - -public class BW_MetaGeneratedOre_Item extends BW_ItemBlocks { - - public BW_MetaGeneratedOre_Item(Block par1) { - super(par1); - } - - public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { - return false; - } - - public String getUnlocalizedName(ItemStack aStack) { - return this.field_150939_a.getUnlocalizedName() + "." + this.getDamage(aStack); - } - - public String getItemStackDisplayName(ItemStack aStack) { - return GT_LanguageManager.getTranslation( getUnlocalizedName(aStack) + ".name"); - } - - @Override - @SideOnly(Side.CLIENT) - @SuppressWarnings("unchecked") - public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { - if (!GT_Utility.isStackValid(aStack) || aPlayer == null || aStack.getItemDamage() <= 0) - return; - if (aList == null) - aList = new ArrayList(); - aList.add(Werkstoff.werkstoffHashMap.get((short) aStack.getItemDamage()).getToolTip()); - } - - public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { - short tDamage = (short) this.getDamage(aStack); - if (tDamage > 0) { - if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) { - return false; - } - BW_MetaGeneratedOreTE tTileEntity = (BW_MetaGeneratedOreTE) aWorld.getTileEntity(aX, aY, aZ); - tTileEntity.mMetaData = tDamage; - } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, 0, 3)) { - return false; - } - if (aWorld.getBlock(aX, aY, aZ) == this.field_150939_a) { - this.field_150939_a.onBlockPlacedBy(aWorld, aX, aY, aZ, aPlayer, aStack); - this.field_150939_a.onPostBlockPlaced(aWorld, aX, aY, aZ, tDamage); - } - return true; - } -} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java index 849126df83..80126f39f4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java @@ -39,7 +39,7 @@ import java.util.Random; public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { - public ArrayList getDrops(Block aDroppedOre, int aFortune) { + public ArrayList getDrops(int aFortune) { ArrayList rList = new ArrayList<>(); Materials aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData).getBridgeMaterial(); @@ -113,4 +113,9 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { } return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.oreSmall.mTextureIndex])}; } + + @Override + protected Block GetProperBlock() { + return WerkstoffLoader.BWSmallOres; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java new file mode 100644 index 0000000000..7213816976 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import com.github.bartimaeusnek.bartworks.common.net.MetaBlockPacket; +import gregtech.api.interfaces.tileentity.ITexturedTileEntity; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; + +import java.util.ArrayList; + +import static com.github.bartimaeusnek.bartworks.MainMod.BW_Network_instance; + +public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements ITexturedTileEntity { + + public short mMetaData; + + public boolean canUpdate() { + return false; + } + + public void readFromNBT(NBTTagCompound aNBT) { + super.readFromNBT(aNBT); + this.mMetaData = aNBT.getShort("m"); + } + + public void writeToNBT(NBTTagCompound aNBT) { + aNBT.setShort("m", this.mMetaData); + super.writeToNBT(aNBT); + } + + @Override + public Packet getDescriptionPacket() { + if (!this.worldObj.isRemote) + BW_Network_instance.sendPacketToAllPlayersInRange(this.worldObj, new MetaBlockPacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); + return null; + } + + protected abstract Block GetProperBlock(); + + public ArrayList getDrops(int aFortune) { + ArrayList rList = new ArrayList<>(); + if (this.mMetaData < 0) { + rList.add(new ItemStack(Blocks.cobblestone, 1, 0)); + return rList; + } + rList.add(new ItemStack(GetProperBlock(), 1, this.mMetaData)); + return rList; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java new file mode 100644 index 0000000000..1b3a645e5c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +import java.util.ArrayList; + +import static com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items.metaTab; + +public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { + + public static ThreadLocal mTemporaryTileEntity = new ThreadLocal<>(); + + public BW_MetaGenerated_Blocks(Material p_i45386_1_, Class tileEntity, String blockName) { + super(p_i45386_1_, tileEntity, blockName); + + this.setHardness(5.0F); + this.setResistance(5.0F); + this.setBlockTextureName("stone"); + this.setCreativeTab(metaTab); + for (Werkstoff w : Werkstoff.werkstoffHashSet) + doRegistrationStuff(w); + } + + @SideOnly(Side.CLIENT) + public final BW_MetaGenerated_Block_TE getProperTileEntityForRendering(){ + return (BW_MetaGenerated_Block_TE) createNewTileEntity(null,0); + } + + protected abstract void doRegistrationStuff(Werkstoff w); + + @Override + public String getHarvestTool(int metadata) { + return "pickaxe"; + } + + protected boolean canSilkHarvest() { + return false; + } + + public int getRenderType() { + if (BW_Renderer_Block_Ores.INSTANCE == null) { + return super.getRenderType(); + } + return BW_Renderer_Block_Ores.INSTANCE.mRenderID; + } + + public int getDamageValue(World aWorld, int aX, int aY, int aZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (((tTileEntity instanceof BW_MetaGenerated_Block_TE))) { + return ((BW_MetaGenerated_Block_TE) tTileEntity).mMetaData; + } + return 0; + } + + @Override + public TileEntity createTileEntity(World world, int metadata) { + return ((ITileEntityProvider)this).createNewTileEntity(world, metadata); + } + + @Override + public boolean hasTileEntity(int metadata) { + return true; + } + + public void breakBlock(World world, int x, int y, int z, Block block, int meta) { + TileEntity tTileEntity = world.getTileEntity(x, y, z); + if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) { + mTemporaryTileEntity.set((BW_MetaGenerated_Block_TE) tTileEntity); + } + super.breakBlock(world, x, y, z, block, meta); + } + + public ArrayList getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) { + return ((BW_MetaGenerated_Block_TE) tTileEntity).getDrops(aFortune); + } + return mTemporaryTileEntity.get() == null ? new ArrayList<>() : mTemporaryTileEntity.get().getDrops(aFortune); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 57f6c319b6..268be7eddf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -68,7 +68,9 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa public Item getTabIconItem() { return new ItemStack(Blocks.iron_ore).getItem(); } + }; + protected final OrePrefixes orePrefixes; public BW_MetaGenerated_Items(OrePrefixes orePrefixes, Object unused){ diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 9ac1b0f383..dc4bc47673 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -22,8 +22,6 @@ package com.github.bartimaeusnek.bartworks.system.material; -import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; @@ -35,29 +33,16 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items.metaTab; - -public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { - - public static ThreadLocal mTemporaryTileEntity = new ThreadLocal<>(); +public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { public BW_MetaGenerated_Ores(Material p_i45386_1_, Class tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); - - this.setHardness(5.0F); - this.setResistance(5.0F); - this.setBlockTextureName("stone"); - this.setCreativeTab(metaTab); - for (Werkstoff w : Werkstoff.werkstoffHashSet) - doRegistrationStuff(w); } protected void doRegistrationStuff(Werkstoff w){ @@ -98,10 +83,6 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { } } - public String getLocalizedName() { - return StatCollector.translateToLocal(this.getUnlocalizedName() + ".name"); - } - @Override public IIcon getIcon(int side, int meta) { return Blocks.stone.getIcon(0, 0); @@ -112,46 +93,6 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { return Blocks.stone.getIcon(0, 0); } - @Override - public String getHarvestTool(int metadata) { - return "pickaxe"; - } - - protected boolean canSilkHarvest() { - return false; - } - - public int getRenderType() { - if (BW_Renderer_Block_Ores.INSTANCE == null) { - return super.getRenderType(); - } - return BW_Renderer_Block_Ores.INSTANCE.mRenderID; - } - - public int getDamageValue(World aWorld, int aX, int aY, int aZ) { - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (((tTileEntity instanceof BW_MetaGeneratedOreTE))) { - return ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData; - } - return 0; - } - - public void breakBlock(World world, int x, int y, int z, Block block, int meta) { - TileEntity tTileEntity = world.getTileEntity(x, y, z); - if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { - BW_MetaGenerated_Ores.mTemporaryTileEntity.set((BW_MetaGeneratedOreTE) tTileEntity); - } - super.breakBlock(world, x, y, z, block, meta); - } - - public ArrayList getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { - return ((BW_MetaGeneratedOreTE) tTileEntity).getDrops(WerkstoffLoader.BWOres,aFortune); - } - return BW_MetaGenerated_Ores.mTemporaryTileEntity.get() == null ? new ArrayList<>() : BW_MetaGenerated_Ores.mTemporaryTileEntity.get().getDrops(WerkstoffLoader.BWOres,aFortune); - } - public int getHarvestLevel(int metadata) { return 3; } @@ -171,17 +112,6 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { } } -// @Override -// public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block p_149695_5_) { -// if ((!aWorld.isRemote || this.checkForAir(aWorld,aX,aY,aZ)) && aWorld.getTileEntity(aX, aY, aZ) instanceof BW_MetaGeneratedOreTE) -// ((BW_MetaGeneratedOreTE)aWorld.getTileEntity(aX, aY, aZ)).sendPacket(); -// } -// -// @Override -// public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int tileX, int tileY, int tileZ) { -// if ((FMLCommonHandler.instance().getEffectiveSide().isServer() || this.checkForAir(aWorld,aX,aY,aZ)) && aWorld.getTileEntity(aX, aY, aZ) instanceof BW_MetaGeneratedOreTE) -// ((BW_MetaGeneratedOreTE)aWorld.getTileEntity(aX, aY, aZ)).sendPacket(); -// } @SuppressWarnings("unused") private boolean checkForAir(IBlockAccess aWorld, int aX, int aY, int aZ){ for (int x = -1; x <= 1; x++) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java new file mode 100644 index 0000000000..632c3e034f --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.ITexture; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; + +public class BW_MetaGenerated_WerkstoffBlock_TE extends BW_MetaGenerated_Block_TE { + + @Override + public ITexture[] getTexture(Block aBlock, byte aSide) { + Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); + if ((aMaterial != null)) { + GT_RenderedTexture aIconSet = new GT_RenderedTexture(aMaterial.getTexSet().mTextures[OrePrefixes.block.mTextureIndex], aMaterial.getRGBA()); + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), aIconSet}; + } + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; + } + + @Override + protected Block GetProperBlock() { + return WerkstoffLoader.BWBlocks; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java new file mode 100644 index 0000000000..382163ae8b --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_LanguageManager; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +import java.util.List; + +public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks { + + public BW_MetaGenerated_WerkstoffBlocks(Material p_i45386_1_, Class tileEntity, String blockName) { + super(p_i45386_1_, tileEntity, blockName); + } + + @Override + protected void doRegistrationStuff(Werkstoff tMaterial) { + if (tMaterial != null) { + if (tMaterial.getGenerationFeatures().hasGems() || (tMaterial.getGenerationFeatures().toGenerate & 0b10) != 0) + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + tMaterial.getmID() + ".name", OrePrefixes.block.mLocalizedMaterialPre + tMaterial.getDefaultName() + OrePrefixes.block.mLocalizedMaterialPost); + } + } + + @Override + public String getUnlocalizedName() { + return "bw.werkstoffblocks.01"; + } + + @Override + public IIcon getIcon(int side, int meta) { + return Blocks.iron_block.getIcon(0, 0); + } + + @Override + public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) { + return Blocks.iron_block.getIcon(0, 0); + } + + @Override + @SuppressWarnings("unchecked") + public void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) { + for (Werkstoff tMaterial : Werkstoff.werkstoffHashSet) { + if (tMaterial.getGenerationFeatures().hasGems() || (tMaterial.getGenerationFeatures().toGenerate & 0b10) != 0) + aList.add(new ItemStack(aItem, 1, tMaterial.getmID())); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 77b027c123..afa98aa857 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -406,6 +406,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.stats.getDurOverride() > 0 ? this.stats.getDurOverride() : (int) (this.stats.durMod * ((0.01f * (float) this.getStats().getMeltingPoint() * (float) this.getStats().getMass()) / (float) this.getContents().getKey())); } + public boolean hasItemType(OrePrefixes prefixes){ + return (this.getGenerationFeatures().toGenerate & GenerationFeatures.prefixLogic.get(prefixes)) != 0; + } + public enum Types { MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, ELEMENT, ISOTOPE, UNDEFINED; @@ -440,9 +444,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static final HashMap prefixLogic = new HashMap<>(); static { - for (OrePrefixes p : OrePrefixes.values()){ - Werkstoff.GenerationFeatures.prefixLogic.put(p,0); - } + Arrays.stream(OrePrefixes.values()).forEach( e -> prefixLogic.put(e,0)); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dust,0b1); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustTiny,0b1); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustSmall,0b1); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 818fc44c78..6ff6c28d98 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1311,6 +1311,7 @@ public class WerkstoffLoader implements Runnable { public static HashBiMap molten = HashBiMap.create(); public static Block BWOres; public static Block BWSmallOres; + public static Block BWBlocks; public boolean registered; public static final HashSet ENABLED_ORE_PREFIXES = new HashSet<>(); @@ -1337,9 +1338,11 @@ public class WerkstoffLoader implements Runnable { } if (orePrefixes == ore) return new ItemStack(WerkstoffLoader.BWOres, amount, werkstoff.getmID()); - if (orePrefixes == oreSmall) + else if (orePrefixes == oreSmall) return new ItemStack(WerkstoffLoader.BWSmallOres, amount, werkstoff.getmID()); - if (WerkstoffLoader.items.get(orePrefixes) == null) + else if (orePrefixes == block) + return new ItemStack(WerkstoffLoader.BWBlocks,amount,werkstoff.getmID()); + else if (WerkstoffLoader.items.get(orePrefixes) == null) MainMod.LOGGER.catching(Level.ERROR,new Exception("NO SUCH ITEM! "+orePrefixes+werkstoff.getVarName() +" If you encounter this as a user, make sure to contact the authors of the pack/the mods you're playing! " + "If you are a Developer, you forgot to enable "+orePrefixes+" OrePrefix for Werkstoff "+werkstoff.getDefaultName())); return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); @@ -1397,6 +1400,8 @@ public class WerkstoffLoader implements Runnable { this.addCraftingMetalRecipes(werkstoff); DebugLog.log("Loading MultipleIngots MetalWorking Recipes"+" " +(System.nanoTime()-timepreone)); this.addMultipleMetalRecipes(werkstoff); + DebugLog.log("Loading Metal Recipes"+" " +(System.nanoTime()-timepreone)); + this.addMetalRecipes(werkstoff); DebugLog.log("Loading Tool Recipes"+" " +(System.nanoTime()-timepreone)); this.addTools(werkstoff); if (Loader.isModLoaded("Thaumcraft")) { @@ -1596,10 +1601,13 @@ public class WerkstoffLoader implements Runnable { RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); GameRegistry.registerTileEntity(BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmallTE"); + GameRegistry.registerTileEntity(BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblockTE"); WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); WerkstoffLoader.BWSmallOres = new BW_MetaGenerated_SmallOres(Material.rock, BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmall"); - GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.01"); - GameRegistry.registerBlock(WerkstoffLoader.BWSmallOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.02"); + WerkstoffLoader.BWBlocks = new BW_MetaGenerated_WerkstoffBlocks(Material.iron,BW_MetaGenerated_WerkstoffBlock_TE.class,"bw.werkstoffblocks"); + GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.01"); + GameRegistry.registerBlock(WerkstoffLoader.BWSmallOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.02"); + GameRegistry.registerBlock(WerkstoffLoader.BWBlocks, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblocks.01"); new GTMetaItemEnhancer(); } @@ -1795,13 +1803,20 @@ public class WerkstoffLoader implements Runnable { OreDictAdder.addToMap(new Pair<>("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite))); } else { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - if (werkstoff.getGenerationFeatures().hasOres()) + if (werkstoff.getGenerationFeatures().hasOres()) { GT_OreDictUnificator.registerOre(ore + werkstoff.getVarName(), werkstoff.get(ore)); + GT_OreDictUnificator.registerOre(oreSmall + werkstoff.getVarName(), werkstoff.get(oreSmall)); + } + if (werkstoff.getGenerationFeatures().hasGems()) OreDictionary.registerOre("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens)); + if (werkstoff.getGenerationFeatures().hasGems() || (werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0){ + GT_OreDictUnificator.registerOre(block + werkstoff.getVarName(), werkstoff.get(block)); + } + werkstoff.getADDITIONAL_OREDICT() - .forEach(s -> WerkstoffLoader.items.keySet() + .forEach(s -> ENABLED_ORE_PREFIXES .stream() .filter(o -> Objects.nonNull(werkstoff.get(o))) .forEach( od -> OreDictionary.registerOre(od+s, werkstoff.get(od)))); @@ -1815,6 +1830,8 @@ public class WerkstoffLoader implements Runnable { if (werkstoff.getGenerationFeatures().hasGems()) { if (werkstoff.getGenerationFeatures().hasSifterRecipes() || ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0)) { + GT_ModHandler.addCompressionRecipe(werkstoff.get(gem, 9), werkstoff.get(block)); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(block),werkstoff.get(gem, 9), 100, 24); GT_Values.RA.addSifterRecipe( werkstoff.get(crushedPurified), new ItemStack[]{ @@ -1859,8 +1876,9 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addImplosionRecipe(werkstoff.get(dust, 4), 24, werkstoff.get(gem, 3), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)); } - if ((werkstoff.getGenerationFeatures().toGenerate & 2) != 0) { + if (werkstoff.hasItemType(plate)) { GT_Values.RA.addLatheRecipe(werkstoff.get(plate), werkstoff.get(lens), werkstoff.get(dustSmall), 1200, 120); + GT_Values.RA.addCutterRecipe(werkstoff.get(block), werkstoff.get(plate,9), null, (int) Math.max(werkstoff.getStats().getMass() * 10L, 1L), 30); } GT_Values.RA.addLatheRecipe(werkstoff.get(gemExquisite), werkstoff.get(lens), werkstoff.get(dust, 2), 2400, 30); @@ -1878,8 +1896,8 @@ public class WerkstoffLoader implements Runnable { } private void addSimpleMetalRecipes(Werkstoff werkstoff) { - if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000000) != 0) { - if (werkstoff.getGenerationFeatures().hasGems()) { + if (werkstoff.hasItemType(plate)) { + if (werkstoff.hasItemType(gem)) { GT_Values.RA.addLatheRecipe(werkstoff.get(gem), werkstoff.get(stick), werkstoff.get(dustSmall), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)}); GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(gem)}); @@ -1976,6 +1994,14 @@ public class WerkstoffLoader implements Runnable { } } + private void addMetalRecipes(Werkstoff werkstoff) { + if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(ingot)) != 0) { + GT_ModHandler.addCompressionRecipe(werkstoff.get(ingot, 9), werkstoff.get(block)); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 9),ItemList.Shape_Extruder_Block.get(0), werkstoff.get(block), (int) werkstoff.getStats().mass, 8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); + GT_Values.RA.addAlloySmelterRecipe(werkstoff.get(ingot, 9), ItemList.Shape_Mold_Block.get(0L), werkstoff.get(block), (int) (werkstoff.getStats().mass/2), 4 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); + } + } + private void addMultipleMetalRecipes(Werkstoff werkstoff){ if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(plateDense)) != 0) { GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{werkstoff.get(ingot,2),GT_Utility.getIntegratedCircuit(2)},new ItemStack[]{werkstoff.get(plateDouble)},null,null,null,null, (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), 60,0)); @@ -2136,6 +2162,9 @@ public class WerkstoffLoader implements Runnable { GT_ModHandler.addPulverisationRecipe(werkstoff.get(ingot),werkstoff.get(dust)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(nugget),werkstoff.get(dustTiny)); } + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 || werkstoff.getGenerationFeatures().hasGems() ){ + GT_ModHandler.addPulverisationRecipe(werkstoff.get(block),werkstoff.get(dust, 9)); + } } } @@ -2380,10 +2409,12 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(1296), werkstoff.get(block), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); } else if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b10) == 0){ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getMolten(144),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall),null,werkstoff.getMolten(36),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny),null,werkstoff.getMolten(16),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - } + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(block),null,werkstoff.getMolten(1296),0,288, 8); + } } } \ No newline at end of file -- cgit From 8c35bce9a6b7f1d917778243047a16eba791c5d9 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 13 Dec 2019 00:07:12 +0100 Subject: added ASM to buffer recipe +added a command to print the recipe list to a file Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 2d9d7406dc7377641cfcf6d38e744e89c7518a47 --- build.properties | 2 +- .../ASM/BWCoreStaticReplacementMethodes.java | 75 ++++++++++++++++++++++ .../bartimaeusnek/ASM/BWCoreTransformer.java | 19 ++++++ .../github/bartimaeusnek/bartworks/MainMod.java | 12 +++- .../common/commands/PrintRecipeListToFile.java | 65 +++++++++++++++++++ .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 4 -- 6 files changed, 171 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java diff --git a/build.properties b/build.properties index a06efeb05f..3bf61b96da 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=3_pre1 +buildNumber=3_pre2 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java index b239563656..9552528acf 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java @@ -22,7 +22,82 @@ package com.github.bartimaeusnek.ASM; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.world.World; + +import java.util.LinkedList; +import java.util.Optional; + public class BWCoreStaticReplacementMethodes { + + public static final LinkedList RECENTLYUSEDRECIPES = new LinkedList<>(); + + @SuppressWarnings("ALL") + public static ItemStack findCachedMatchingRecipe(InventoryCrafting inventoryCrafting, World world) { + int i = 0; + ItemStack itemstack = null; + ItemStack itemstack1 = null; + int j; + + for (j = 0; j < inventoryCrafting.getSizeInventory(); ++j) + { + ItemStack itemstack2 = inventoryCrafting.getStackInSlot(j); + + if (itemstack2 != null) + { + if (i == 0) + { + itemstack = itemstack2; + } + + if (i == 1) + { + itemstack1 = itemstack2; + } + + ++i; + } + } + + if (i == 2 && itemstack.getItem() == itemstack1.getItem() && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && itemstack.getItem().isRepairable()) + { + Item item = itemstack.getItem(); + int j1 = item.getMaxDamage() - itemstack.getItemDamageForDisplay(); + int k = item.getMaxDamage() - itemstack1.getItemDamageForDisplay(); + int l = j1 + k + item.getMaxDamage() * 5 / 100; + int i1 = item.getMaxDamage() - l; + + if (i1 < 0) + { + i1 = 0; + } + + return new ItemStack(itemstack.getItem(), 1, i1); + } else { + Optional iPossibleRecipe = RECENTLYUSEDRECIPES.stream().filter(r -> r.matches(inventoryCrafting, world)).findFirst(); + + if (iPossibleRecipe.isPresent()) { + int index = RECENTLYUSEDRECIPES.indexOf(iPossibleRecipe.get()); + if (index != 0) { + --index; + RECENTLYUSEDRECIPES.remove(iPossibleRecipe.get()); + RECENTLYUSEDRECIPES.add(index, iPossibleRecipe.get()); + } + return iPossibleRecipe.get().getCraftingResult(inventoryCrafting); + } + + iPossibleRecipe = CraftingManager.getInstance().getRecipeList().stream().filter(r -> ((IRecipe)r).matches(inventoryCrafting, world)).findFirst(); + ItemStack stack = iPossibleRecipe.map(iRecipe -> iRecipe.getCraftingResult(inventoryCrafting)).orElse(null); + if (stack != null) + RECENTLYUSEDRECIPES.addLast(iPossibleRecipe.get()); + return stack; + } + } + private BWCoreStaticReplacementMethodes() { } diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index 4ec2f70142..99a748fbd7 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -40,6 +40,7 @@ public class BWCoreTransformer implements IClassTransformer { "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", "PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API", "DUCTTAPING RWG WORLDEN FAILS", + "PATCHING CRAFTING MANAGER FOR CACHING RECIPES" // "REMOVING 12% BONUS OUTPUTS FROM GT++ SIFTER" }; public static final String[] CLASSESBEEINGTRANSFORMED = { @@ -49,6 +50,7 @@ public class BWCoreTransformer implements IClassTransformer { "thaumcraft.common.tiles.TileWandPedestal", "gregtech.GT_Mod", "rwg.world.ChunkGeneratorRealistic", + "net.minecraft.item.crafting.CraftingManager" // "gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialSifter" }; static boolean obfs; @@ -282,6 +284,23 @@ public class BWCoreTransformer implements IClassTransformer { } } } + case 6: { + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + String name_deObfs = "findMatchingRecipe"; + String name_Obfs = "a"; + String name_src = "func_82787_a"; + for (MethodNode toPatch : methods) { + if (ASMUtils.isCorrectMethod(toPatch,name_deObfs,name_Obfs,name_src)){ + toPatch.instructions = new InsnList(); + toPatch.instructions.add(new VarInsnNode(ALOAD,1)); + toPatch.instructions.add(new VarInsnNode(ALOAD,2)); + toPatch.instructions.add(new MethodInsnNode(INVOKESTATIC,"com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes","findCachedMatchingRecipe","(Lnet/minecraft/inventory/InventoryCrafting;Lnet/minecraft/world/World;)Lnet/minecraft/item/ItemStack;",false)); + toPatch.instructions.add(new InsnNode(ARETURN)); + break scase; + } + } + } + // case 6: { // BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); // ((IntInsnNode) methods.get(11).instructions.get(10)).operand = 10000; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index d725129087..88aa7b547c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -31,6 +31,9 @@ import com.github.bartimaeusnek.bartworks.client.creativetabs.BioTab; import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; +import com.github.bartimaeusnek.bartworks.common.commands.ChangeConfig; +import com.github.bartimaeusnek.bartworks.common.commands.PrintRecipeListToFile; +import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader; @@ -198,7 +201,12 @@ public final class MainMod { } } - private static boolean recipesAdded; + @Mod.EventHandler + public void onServerStarting(FMLServerStartingEvent event){ + event.registerServerCommand(new SummonRuin()); + event.registerServerCommand(new ChangeConfig()); + event.registerServerCommand(new PrintRecipeListToFile()); + } @Mod.EventHandler public void onServerStarted(FMLServerStartedEvent event) { @@ -215,6 +223,8 @@ public final class MainMod { MainMod.unificationRecipeEnforcer(); } + private static boolean recipesAdded; + public static void runOnPlayerJoined(boolean classicMode, boolean extraGasRecipes){ OreDictHandler.adaptCacheForWorld(); if (!recipesAdded) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java new file mode 100644 index 0000000000..b7d6e7f82d --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.commands; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + +public class PrintRecipeListToFile extends CommandBase { + @Override + public String getCommandName() { + return "prltf"; + } + + @Override + public String getCommandUsage(ICommandSender p_71518_1_) { + return "prltf "; + } + + @Override + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + File file = new File(p_71515_2_[0]); + try { + + BufferedWriter fw = new BufferedWriter(new FileWriter(file)); + CraftingManager.getInstance().getRecipeList().forEach( e -> { + try { + fw.write(e.toString() + " = " +((IRecipe)e).getRecipeOutput().getDisplayName() +"\n"); + } catch (IOException ex) { + ex.printStackTrace(); + } + }); + fw.flush(); + fw.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 67deac1066..953cfa62ad 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -23,8 +23,6 @@ package com.github.bartimaeusnek.crossmod; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.commands.ChangeConfig; -import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.tectech.TecTechResearchLoader; @@ -110,8 +108,6 @@ public class BartWorksCrossmod { @Mod.EventHandler public void onFMLServerStart(FMLServerStartingEvent event) { - event.registerServerCommand(new SummonRuin()); - event.registerServerCommand(new ChangeConfig()); if (Loader.isModLoaded("miscutils")) for (Object s : RadioHatchCompat.TranslateSet){ StringTranslate.inject(new ReaderInputStream(new StringReader((String) s))); -- cgit From 05ea5eb862d44e695cf71d7f0c4c718ba72023c7 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 13 Dec 2019 00:13:01 +0100 Subject: removed index of call + by using an iterator instead of functional call Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 9ff73dc8b87c91fc8cf41c63f6d8a4664af7d68e --- .../bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java index 9552528acf..3f692c176a 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java @@ -29,6 +29,7 @@ import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import java.util.Iterator; import java.util.LinkedList; import java.util.Optional; @@ -78,10 +79,17 @@ public class BWCoreStaticReplacementMethodes { return new ItemStack(itemstack.getItem(), 1, i1); } else { - Optional iPossibleRecipe = RECENTLYUSEDRECIPES.stream().filter(r -> r.matches(inventoryCrafting, world)).findFirst(); + Optional iPossibleRecipe = Optional.empty(); + int index = 0; + for (Iterator iterator = RECENTLYUSEDRECIPES.iterator(); iterator.hasNext(); ++index) { + IRecipe RECENTLYUSEDRECIPE = iterator.next(); + if (RECENTLYUSEDRECIPE.matches(inventoryCrafting, world)) { + iPossibleRecipe = Optional.of(RECENTLYUSEDRECIPE); + break; + } + } if (iPossibleRecipe.isPresent()) { - int index = RECENTLYUSEDRECIPES.indexOf(iPossibleRecipe.get()); if (index != 0) { --index; RECENTLYUSEDRECIPES.remove(iPossibleRecipe.get()); -- cgit From a4e4f6732b7506d491e0e3cff7e72d331ef2b56d Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 14 Dec 2019 03:47:57 +0100 Subject: added Self Sorting List Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 60b2b9cdd5a015030c879bc1b06bb3f3bf8abeaf --- build.properties | 2 +- .../ASM/BWCoreStaticReplacementMethodes.java | 14 +- .../bartworks/util/selfsortinglist/SSList.java | 358 +++++++++++++++++++++ .../util/selfsortinglist/SSListIterators.java | 139 ++++++++ .../bartworks/util/selfsortinglist/SSListNode.java | 75 +++++ 5 files changed, 578 insertions(+), 10 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListIterators.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListNode.java diff --git a/build.properties b/build.properties index 3bf61b96da..8876906369 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=3_pre2 +buildNumber=3_pre3 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java index 3f692c176a..d5d35e50a5 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.ASM; +import com.github.bartimaeusnek.bartworks.util.selfsortinglist.SSList; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -30,12 +31,11 @@ import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; import java.util.Iterator; -import java.util.LinkedList; import java.util.Optional; public class BWCoreStaticReplacementMethodes { - public static final LinkedList RECENTLYUSEDRECIPES = new LinkedList<>(); + public static final SSList RECENTLYUSEDRECIPES = new SSList<>(); @SuppressWarnings("ALL") public static ItemStack findCachedMatchingRecipe(InventoryCrafting inventoryCrafting, World world) { @@ -81,8 +81,8 @@ public class BWCoreStaticReplacementMethodes { } else { Optional iPossibleRecipe = Optional.empty(); int index = 0; - for (Iterator iterator = RECENTLYUSEDRECIPES.iterator(); iterator.hasNext(); ++index) { - IRecipe RECENTLYUSEDRECIPE = iterator.next(); + for (Iterator it = RECENTLYUSEDRECIPES.iterator(); it.hasNext();++index) { + IRecipe RECENTLYUSEDRECIPE = it.next(); if (RECENTLYUSEDRECIPE.matches(inventoryCrafting, world)) { iPossibleRecipe = Optional.of(RECENTLYUSEDRECIPE); break; @@ -90,11 +90,7 @@ public class BWCoreStaticReplacementMethodes { } if (iPossibleRecipe.isPresent()) { - if (index != 0) { - --index; - RECENTLYUSEDRECIPES.remove(iPossibleRecipe.get()); - RECENTLYUSEDRECIPES.add(index, iPossibleRecipe.get()); - } + RECENTLYUSEDRECIPES.addPrioToNode(index); return iPossibleRecipe.get().getCraftingResult(inventoryCrafting); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java new file mode 100644 index 0000000000..d320cd8316 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java @@ -0,0 +1,358 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util.selfsortinglist; + +import java.util.*; + +public class SSList implements List, Deque, Set { + + transient int size = 0; + transient SSListNode head; + transient SSListNode tail; + + public static SSList create(){ + return new SSList(); + } + + public SSList() {} + + @Override + public void addFirst(E t) { + final SSListNode first = head; + final SSListNode newNode = new SSListNode<>(null, t, first); + head = newNode; + if (first == null) + tail = newNode; + else + first.setBefore(newNode); + size++; + } + + @Override + public void addLast(E t) { + final SSListNode last = tail; + final SSListNode newNode = new SSListNode<>(last, t, null); + tail = newNode; + if (last == null) + head = newNode; + else + last.setNext(newNode); + size++; + } + + @Override + public boolean offerFirst(E e) { + return false; + } + + @Override + public boolean offerLast(E e) { + return false; + } + + @Override + public E removeFirst() { + return null; + } + + @Override + public E removeLast() { + return null; + } + + @Override + public E pollFirst() { + return null; + } + + @Override + public E pollLast() { + return null; + } + + @Override + public E getFirst() { + return peekFirst(); + } + + @Override + public E getLast() { + return peekLast(); + } + + @Override + public E peekFirst() { + return head != null ? head.getELEMENT() : null; + } + + @Override + public E peekLast() { + return tail != null ? tail.getELEMENT() : null; + } + + @Override + public boolean removeFirstOccurrence(Object o) { + return false; + } + + @Override + public boolean removeLastOccurrence(Object o) { + return false; + } + + @Override + public int size() { + return size; + } + + @Override + public boolean isEmpty() { + return size == 0; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator iterator() { + return new SSListIterators.SSListIterator<>(head); + } + + @Override + public Iterator descendingIterator() { + return new SSListIterators.SSListReverseIterator<>(tail); + } + + @Override + public Object[] toArray() { + Object[] ret = new Object[size]; + while (listIterator().hasNext()) + ret[listIterator().nextIndex()-1] = listIterator().next(); + return ret; + } + + @Override + public T[] toArray(T[] a) { + T[] ret = (T[]) new Object[size]; + while (listIterator().hasNext()) + ret[listIterator().nextIndex()-1] = (T) listIterator().next(); + return ret; + } + + @Override + public boolean add(E e) { + addLast(e); + return true; + } + + private void moveNodeUp(SSListNode node){ + if (node == head || node.getBefore() == null) + return; + final SSListNode before = node.getBefore(); + final SSListNode beforeBefore = before.getBefore(); + final SSListNode next = node.getNext(); + + // <0,1,2> <1,2,3> N<2,3,4> <3,4,5> + + node.setBefore(beforeBefore); + // <0,1,2> <1,2,3> N<0,3,4> <3,4,5> + + if (beforeBefore != null) + beforeBefore.setNext(node); + // <0,1,3> <1,2,3> N<0,3,4> <3,4,5> + + before.setBefore(node); + // <0,1,3> <3,2,3> N<0,3,4> <3,4,5> + + before.setNext(next); + // <0,1,3> <3,2,4> N<0,3,4> <3,4,5> + + if (next != null) + next.setBefore(before); + // <0,1,3> N<0,3,4> <3,2,4> <2,4,5> + + node.setNext(before); + // <0,1,3> N<0,3,2> <3,2,4> <2,4,5> + } + + private SSListNode getNode(int index) { + if (index <= (size / 2)) { + SSListNode x = head; + for (int i = 0; i < index; i++) + x = x.getNext(); + return x; + } else { + SSListNode x = tail; + for (int i = size - 1; i > index; i--) + x = x.getBefore(); + return x; + } + } + + @Override + public boolean offer(E e) { + return false; + } + + private boolean isValidIndex(int index) { + return index >= 0 && index < size; + } + + @Override + public E remove() { + return null; + } + + @Override + public E poll() { + return null; + } + + @Override + public E element() { + return null; + } + + @Override + public E peek() { + return null; + } + + @Override + public void push(E e) { + addFirst(e); + } + + @Override + public E pop() { + return null; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection c) { + return false; + } + + @Override + public boolean addAll(Collection c) { + for (E e : c) { + this.addLast(e); + } + return true; + } + + @Override + public boolean addAll(int index, Collection c) { + return false; + } + + @Override + public boolean removeAll(Collection c) { + return false; + } + + @Override + public boolean retainAll(Collection c) { + return false; + } + + @Override + public void clear() { + + } + + public void addPrioToNode(int index, long prio){ + if (!isValidIndex(index)) + return; + SSListNode node = getNode(index); + node.setPriority(node.getPriority()+prio); + if (node.getBefore() != null) + if (node.getPriority() > node.getBefore().getPriority()){ + moveNodeUp(node); + } + } + + public void addPrioToNode(int index){ + addPrioToNode(index,1L); + } + + @Override + public E get(int index) { + if (!isValidIndex(index)) + return null; + SSListNode node = getNode(index); + return node.getELEMENT(); + } + + @Override + public E set(int index, E element) { + return null; + } + + @Override + public void add(int index, E element) { + + } + + @Override + public E remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator listIterator() { + return new SSListIterators.SSListListIterator<>(head,tail); + } + + @Override + public ListIterator listIterator(int index) { + return null; + } + + @Override + public List subList(int fromIndex, int toIndex) { + return null; + } + + @Override + public Spliterator spliterator() { + return null; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListIterators.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListIterators.java new file mode 100644 index 0000000000..c3f3aba347 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListIterators.java @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util.selfsortinglist; + +import org.apache.commons.lang3.NotImplementedException; + +import java.util.Iterator; +import java.util.ListIterator; + +public class SSListIterators { + + + public static class SSListListIterator implements ListIterator { + final SSListNode head; + final SSListNode tail; + SSListNode current; + int counter = 0; + public SSListListIterator(SSListNode head,SSListNode tail) { + this.head = head; + this.tail = tail; + current = null; + } + + @Override + public boolean hasNext() { + return head != current; + } + + @Override + public E next() { + counter++; + E ret = current.getELEMENT(); + current = current.getNext(); + return ret; + } + + @Override + public boolean hasPrevious() { + return tail != current; + } + + @Override + public E previous() { + counter--; + E ret = current.getELEMENT(); + current = current.getBefore(); + return ret; + } + + @Override + public int nextIndex() { + return counter+1; + } + + @Override + public int previousIndex() { + return counter-1; + } + + @Override + public void remove() { + throw new NotImplementedException("Not Implemented"); + } + + @Override + public void set(E e) { + throw new NotImplementedException("Not Implemented"); + } + + @Override + public void add(E e) { + throw new NotImplementedException("Not Implemented"); + } + } + + public static class SSListIterator implements Iterator { + final SSListNode head; + SSListNode current; + public SSListIterator(SSListNode head) { + this.head = head; + current = null; + } + + @Override + public boolean hasNext() { + return current != null; + } + + @Override + public E next() { + E ret = current.getELEMENT(); + current = current.getNext(); + return ret; + } + } + + public static class SSListReverseIterator implements Iterator { + final SSListNode tail; + SSListNode current; + + public SSListReverseIterator(SSListNode head) { + this.tail = head; + current = null; + } + + @Override + public boolean hasNext() { + return current != null; + } + + @Override + public E next() { + E ret = current.getELEMENT(); + current = current.getBefore(); + return ret; + } + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListNode.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListNode.java new file mode 100644 index 0000000000..f9c509019e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListNode.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util.selfsortinglist; + +public class SSListNode { + + public final static SSListNode EMPTY_NODE = new SSListNode(null); + + private final E ELEMENT; + private long priority = Long.MIN_VALUE; + private SSListNode next; + private SSListNode before; + + public SSListNode(E element) { + ELEMENT = element; + } + + public SSListNode(SSListNode before, E element, SSListNode next) { + this.ELEMENT = element; + connect(next, before); + } + + public void connect(SSListNode next, SSListNode before){ + this.setNext(next); + this.setBefore(before); + } + + public E getELEMENT() { + return ELEMENT; + } + + public long getPriority() { + return priority; + } + + public void setPriority(long priority) { + this.priority = priority; + } + + public SSListNode getNext() { + return next; + } + + public void setNext(SSListNode next) { + this.next = next; + } + + public SSListNode getBefore() { + return before; + } + + public void setBefore(SSListNode before) { + this.before = before; + } +} -- cgit From 2bd1c98af55a4b626cdb5451d1111cb045f050ae Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 14 Dec 2019 14:08:04 +0100 Subject: modified sorting algorythm to skip multiple nodes Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: f48a59b9257759308ea7406a457d90adc40f4b02 --- .../com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java index d320cd8316..439f86b3af 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java @@ -294,7 +294,7 @@ public class SSList implements List, Deque, Set { SSListNode node = getNode(index); node.setPriority(node.getPriority()+prio); if (node.getBefore() != null) - if (node.getPriority() > node.getBefore().getPriority()){ + while (node.getPriority() > node.getBefore().getPriority()){ moveNodeUp(node); } } -- cgit From bf51d170f68a677a9ab0e0ce38c7f856b283a51a Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 14 Dec 2019 20:22:03 +0100 Subject: Added Morons "Ademic Steel", + fixed additional oredict for oredict enforcer + added a config option to disable the crafting patch + made setters for overrides chainable (Werkstoff.Stats) + version increace Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: ba3570045ef6d4f29a51d6db16f5c57b4414e981 --- build.properties | 2 +- .../java/com/github/bartimaeusnek/ASM/BWCore.java | 1 + .../github/bartimaeusnek/bartworks/MainMod.java | 9 ++++--- .../server/EventHandler/ServerEventHandler.java | 2 +- .../bartworks/system/material/Werkstoff.java | 9 ++++--- .../bartworks/system/material/WerkstoffLoader.java | 28 ++++++++++++++++++++++ .../processingLoaders/AdditionalRecipes.java | 1 + 7 files changed, 44 insertions(+), 8 deletions(-) diff --git a/build.properties b/build.properties index 8876906369..e03086e26c 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=3_pre3 +buildNumber=3_pre4 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java index a4c8fe9dea..578b768652 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java @@ -65,6 +65,7 @@ public class BWCore extends DummyModContainer { shouldTransform[3] = Loader.isModLoaded("Thaumcraft") && ConfigHandler.enabledPatches[3]; shouldTransform[4] = true; shouldTransform[5] = Loader.isModLoaded("RWG") && ConfigHandler.enabledPatches[5]; + shouldTransform[6] = ConfigHandler.enabledPatches[6]; //shouldTransform[6] = true; BWCore.BWCORE_LOG.info("Extra Utilities found and ASM Patch enabled? " + shouldTransform[0]); BWCore.BWCORE_LOG.info("Thaumcraft found and ASM Patch enabled? " + shouldTransform[3]); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 88aa7b547c..a054945a32 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -284,12 +284,15 @@ public final class MainMod { GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(false, null, null, null, null, new FluidStack[]{wrongNamedFluid}, new FluidStack[]{werkstoff.getFluidOrGas(1)}, 1, 1, 0)); } } + HashSet oreDictNames = new HashSet<>(werkstoff.getADDITIONAL_OREDICT()); + oreDictNames.add(werkstoff.getVarName()); MainMod.runMoltenUnificationEnfocement(werkstoff); MainMod.runUnficationDeleter(werkstoff); + for (String s : oreDictNames) for (OrePrefixes prefixes : OrePrefixes.values()) { - if (OreDictionary.getOres(prefixes + werkstoff.getVarName()).size() > 1) { - for (int j = 0; j < OreDictionary.getOres(prefixes + werkstoff.getVarName()).size(); j++) { - ItemStack toReplace = OreDictionary.getOres(prefixes + werkstoff.getVarName()).get(j); + if (OreDictionary.getOres(prefixes + s).size() > 1) { + for (int j = 0; j < OreDictionary.getOres(prefixes + s).size(); j++) { + ItemStack toReplace = OreDictionary.getOres(prefixes + s).get(j); ItemStack replacement = werkstoff.get(prefixes); if (GT_Utility.areStacksEqual(toReplace,replacement) || replacement == null || replacement.getItem() == null) continue; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java index 33a1333322..cf084f627a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java @@ -67,7 +67,7 @@ public class ServerEventHandler { String oreDictName = OreDictionary.getOreName(oreID); for (Werkstoff e : Werkstoff.werkstoffHashSet) { replace = e.getGenerationFeatures().enforceUnification; - if (replace && oreDictName.contains(e.getVarName())) { + if (replace && (oreDictName.contains(e.getVarName()) || e.getADDITIONAL_OREDICT().stream().anyMatch(oreDictName::contains))) { String prefix = oreDictName.replace(e.getVarName(), ""); toReplace = GT_OreDictUnificator.get(OrePrefixes.getPrefix(prefix),e.getVarName(),stack.stackSize); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index afa98aa857..09810a54cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -670,24 +670,27 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return durOverride; } - public void setDurOverride(int durOverride) { + public Werkstoff.Stats setDurOverride(int durOverride) { this.durOverride = durOverride; + return this; } public float getSpeedOverride() { return speedOverride; } - public void setSpeedOverride(float speedOverride) { + public Werkstoff.Stats setSpeedOverride(float speedOverride) { this.speedOverride = speedOverride; + return this; } public byte getQualityOverride() { return qualityOverride; } - public void setQualityOverride(byte qualityOverride) { + public Werkstoff.Stats setQualityOverride(byte qualityOverride) { this.qualityOverride = qualityOverride; + return this; } byte qualityOverride; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 6ff6c28d98..71e6f1d016 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1305,6 +1305,32 @@ public class WerkstoffLoader implements Runnable { new Pair<>(Materials.Chlorine,1), new Pair<>(Materials.Oxygen,1) ); + public static final Werkstoff AdemicSteel = new Werkstoff( + new short[]{0xcc,0xcc,0xcc}, + "Ademic Steel", + "The break in the line", + new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setDurOverride(6144).setMeltingPoint(1800).setSpeedOverride(12).setQualityOverride((byte) 4), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().onlyDust().addMetalItems().addCraftingMetalWorkingItems().addMolten().addSimpleMetalWorkingItems().addMultipleIngotMetalWorkingItems(), + 96, + TextureSet.SET_METALLIC, + new Pair<>(Materials.Steel ,2), + new Pair<>(Materials.VanadiumSteel,1), + new Pair<>(Materials.DamascusSteel,1), + new Pair<>(Materials.Carbon,4) + ); + public static final Werkstoff RawAdemicSteel = new Werkstoff( + new short[]{0xed,0xed,0xed}, + "Raw Ademic Steel", + new Werkstoff.Stats().setCentrifuge(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().onlyDust().addMixerRecipes(), + 97, + TextureSet.SET_ROUGH, + new Pair<>(Materials.Steel ,2), + new Pair<>(Materials.VanadiumSteel,1), + new Pair<>(Materials.DamascusSteel,1) + ); public static HashMap items = new HashMap<>(); public static HashBiMap fluids = HashBiMap.create(); @@ -1435,12 +1461,14 @@ public class WerkstoffLoader implements Runnable { Materials.Radon.add(WerkstoffLoader.NOBLE_GAS); WerkstoffLoader.Oganesson.add(WerkstoffLoader.NOBLE_GAS,WerkstoffLoader.ANAEROBE_GAS); + Materials.Nitrogen.add(WerkstoffLoader.ANAEROBE_GAS); WerkstoffLoader.Calcium.add(WerkstoffLoader.ANAEROBE_SMELTING); WerkstoffLoader.LuVTierMaterial.add(WerkstoffLoader.NOBLE_GAS_SMELTING); WerkstoffLoader.Ruridit.add(WerkstoffLoader.NOBLE_GAS_SMELTING); + WerkstoffLoader.AdemicSteel.add(WerkstoffLoader.NOBLE_GAS_SMELTING); WerkstoffLoader.MagnetoResonaticDust.add(WerkstoffLoader.NO_BLAST); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 807db1f804..a585f8291b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -51,6 +51,7 @@ public class AdditionalRecipes implements Runnable { @Override @SuppressWarnings("deprecation") public void run() { + GT_Values.RA.addImplosionRecipe(WerkstoffLoader.RawAdemicSteel.get(dust),4,WerkstoffLoader.AdemicSteel.get(dust),null); ((BWRecipes.BW_Recipe_Map_LiquidFuel)BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(WerkstoffLoader.FormicAcid.getBridgeMaterial(),40); //Thorium/Yttrium Glas GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall, 2), WerkstoffLoader.Thorianit.get(dustSmall, 2), Materials.Glass.getMolten(144), null, new ItemStack(ItemRegistry.bw_glasses[0], 1, 12), null, 800, BW_Util.getMachineVoltageFromTier(5), 3663); -- cgit From 1acaaaee43d609f3a99b8c1dce0e67d4efe2ffe7 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 14 Dec 2019 20:25:53 +0100 Subject: Quickfix + fixed possible NPE Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 429e31fa1436be9a3dafb32c1e061fbeb01bb1a0 --- .../github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java index 439f86b3af..11ce5ebafc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java @@ -293,8 +293,7 @@ public class SSList implements List, Deque, Set { return; SSListNode node = getNode(index); node.setPriority(node.getPriority()+prio); - if (node.getBefore() != null) - while (node.getPriority() > node.getBefore().getPriority()){ + while (node.getBefore() != null && node.getPriority() > node.getBefore().getPriority()){ moveNodeUp(node); } } -- cgit From 37bb86e20d542a38614f36dfefda194d1436f11b Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 15 Dec 2019 02:09:37 +0100 Subject: Fixed SSList Iterators Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: ac9f5e451758b0e50ae33e6fc02985f77d4e4596 --- build.properties | 2 +- .../bartworks/util/selfsortinglist/SSList.java | 6 +++--- .../util/selfsortinglist/SSListIterators.java | 25 ++++++++++++++-------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/build.properties b/build.properties index e03086e26c..73f214419f 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=3_pre4 +buildNumber=3_pre5 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java index 11ce5ebafc..769b32638d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java @@ -197,7 +197,7 @@ public class SSList implements List, Deque, Set { // <0,1,3> N<0,3,2> <3,2,4> <2,4,5> } - private SSListNode getNode(int index) { + SSListNode getNode(int index) { if (index <= (size / 2)) { SSListNode x = head; for (int i = 0; i < index; i++) @@ -337,12 +337,12 @@ public class SSList implements List, Deque, Set { @Override public ListIterator listIterator() { - return new SSListIterators.SSListListIterator<>(head,tail); + return new SSListIterators.SSListListIterator<>(head,tail,false); } @Override public ListIterator listIterator(int index) { - return null; + return new SSListIterators.SSListListIterator<>(this,index); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListIterators.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListIterators.java index c3f3aba347..83b3c66046 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListIterators.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListIterators.java @@ -35,15 +35,24 @@ public class SSListIterators { final SSListNode tail; SSListNode current; int counter = 0; - public SSListListIterator(SSListNode head,SSListNode tail) { + boolean reverse; + public SSListListIterator(SSListNode head,SSListNode tail, boolean reverse) { this.head = head; this.tail = tail; - current = null; + current = reverse ? tail : head; + this.reverse = reverse; + } + + public SSListListIterator(SSList list, int index) { + this.head = list.head; + this.tail = list.tail; + current = list.getNode(index); + counter = index; } @Override public boolean hasNext() { - return head != current; + return reverse ? head != current : tail != current; } @Override @@ -56,7 +65,7 @@ public class SSListIterators { @Override public boolean hasPrevious() { - return tail != current; + return !reverse ? head != current : tail != current; } @Override @@ -97,8 +106,7 @@ public class SSListIterators { final SSListNode head; SSListNode current; public SSListIterator(SSListNode head) { - this.head = head; - current = null; + this.head = this.current = head; } @Override @@ -118,9 +126,8 @@ public class SSListIterators { final SSListNode tail; SSListNode current; - public SSListReverseIterator(SSListNode head) { - this.tail = head; - current = null; + public SSListReverseIterator(SSListNode tail) { + this.tail = this.current = tail; } @Override -- cgit From 1cdf28deca74e6cc222e435f972ec2481acd4d36 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 15 Dec 2019 02:38:59 +0100 Subject: Renamed SSList -> AccessPriorityList + implemented clear() Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 56a7fd3f407454fb1eee55ec8e02a255267fbce8 --- .../ASM/BWCoreStaticReplacementMethodes.java | 4 +- .../accessprioritylist/AccessPriorityList.java | 368 +++++++++++++++++++++ .../AccessPriorityListIterators.java | 146 ++++++++ .../accessprioritylist/AccessPriorityListNode.java | 75 +++++ .../bartworks/util/selfsortinglist/SSList.java | 357 -------------------- .../util/selfsortinglist/SSListIterators.java | 146 -------- .../bartworks/util/selfsortinglist/SSListNode.java | 75 ----- 7 files changed, 591 insertions(+), 580 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListIterators.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListNode.java diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java index d5d35e50a5..53a0fff182 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java @@ -22,7 +22,7 @@ package com.github.bartimaeusnek.ASM; -import com.github.bartimaeusnek.bartworks.util.selfsortinglist.SSList; +import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriorityList; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -35,7 +35,7 @@ import java.util.Optional; public class BWCoreStaticReplacementMethodes { - public static final SSList RECENTLYUSEDRECIPES = new SSList<>(); + public static final AccessPriorityList RECENTLYUSEDRECIPES = new AccessPriorityList<>(); @SuppressWarnings("ALL") public static ItemStack findCachedMatchingRecipe(InventoryCrafting inventoryCrafting, World world) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java new file mode 100644 index 0000000000..8f0cd8dd41 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java @@ -0,0 +1,368 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util.accessprioritylist; + +import java.util.*; + +public class AccessPriorityList implements List, Deque, Set { + + transient int size = 0; + transient AccessPriorityListNode head; + transient AccessPriorityListNode tail; + + public static AccessPriorityList create(){ + return new AccessPriorityList(); + } + + public AccessPriorityList() {} + + @Override + public void addFirst(E t) { + final AccessPriorityListNode first = head; + final AccessPriorityListNode newNode = new AccessPriorityListNode<>(null, t, first); + head = newNode; + if (first == null) + tail = newNode; + else + first.setBefore(newNode); + size++; + } + + @Override + public void addLast(E t) { + final AccessPriorityListNode last = tail; + final AccessPriorityListNode newNode = new AccessPriorityListNode<>(last, t, null); + tail = newNode; + if (last == null) + head = newNode; + else + last.setNext(newNode); + size++; + } + + @Override + public boolean offerFirst(E e) { + return false; + } + + @Override + public boolean offerLast(E e) { + return false; + } + + @Override + public E removeFirst() { + return null; + } + + @Override + public E removeLast() { + return null; + } + + @Override + public E pollFirst() { + return null; + } + + @Override + public E pollLast() { + return null; + } + + @Override + public E getFirst() { + return peekFirst(); + } + + @Override + public E getLast() { + return peekLast(); + } + + @Override + public E peekFirst() { + return head != null ? head.getELEMENT() : null; + } + + @Override + public E peekLast() { + return tail != null ? tail.getELEMENT() : null; + } + + @Override + public boolean removeFirstOccurrence(Object o) { + return false; + } + + @Override + public boolean removeLastOccurrence(Object o) { + return false; + } + + @Override + public int size() { + return size; + } + + @Override + public boolean isEmpty() { + return size == 0; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator iterator() { + return new AccessPriorityListIterators.AccessPriorityListIterator<>(head); + } + + @Override + public Iterator descendingIterator() { + return new AccessPriorityListIterators.AccessPriorityListReverseIterator<>(tail); + } + + @Override + public Object[] toArray() { + Object[] ret = new Object[size]; + while (listIterator().hasNext()) + ret[listIterator().nextIndex()-1] = listIterator().next(); + return ret; + } + + @Override + public T[] toArray(T[] a) { + T[] ret = (T[]) new Object[size]; + while (listIterator().hasNext()) + ret[listIterator().nextIndex()-1] = (T) listIterator().next(); + return ret; + } + + @Override + public boolean add(E e) { + addLast(e); + return true; + } + + private void moveNodeUp(AccessPriorityListNode node){ + if (node == head || node.getBefore() == null) + return; + final AccessPriorityListNode before = node.getBefore(); + final AccessPriorityListNode beforeBefore = before.getBefore(); + final AccessPriorityListNode next = node.getNext(); + + // <0,1,2> <1,2,3> N<2,3,4> <3,4,5> + + node.setBefore(beforeBefore); + // <0,1,2> <1,2,3> N<0,3,4> <3,4,5> + + if (beforeBefore != null) + beforeBefore.setNext(node); + // <0,1,3> <1,2,3> N<0,3,4> <3,4,5> + + before.setBefore(node); + // <0,1,3> <3,2,3> N<0,3,4> <3,4,5> + + before.setNext(next); + // <0,1,3> <3,2,4> N<0,3,4> <3,4,5> + + if (next != null) + next.setBefore(before); + // <0,1,3> N<0,3,4> <3,2,4> <2,4,5> + + node.setNext(before); + // <0,1,3> N<0,3,2> <3,2,4> <2,4,5> + } + + AccessPriorityListNode getNode(int index) { + if (index <= (size / 2)) { + AccessPriorityListNode x = head; + for (int i = 0; i < index; i++) + x = x.getNext(); + return x; + } else { + AccessPriorityListNode x = tail; + for (int i = size - 1; i > index; i--) + x = x.getBefore(); + return x; + } + } + + @Override + public boolean offer(E e) { + return false; + } + + private boolean isValidIndex(int index) { + return index >= 0 && index < size; + } + + @Override + public E remove() { + return null; + } + + @Override + public E poll() { + return null; + } + + @Override + public E element() { + return null; + } + + @Override + public E peek() { + return getFirst(); + } + + @Override + public void push(E e) { + addFirst(e); + } + + @Override + public E pop() { + return null; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection c) { + return false; + } + + @Override + public boolean addAll(Collection c) { + for (E e : c) { + this.addLast(e); + } + return true; + } + + @Override + public boolean addAll(int index, Collection c) { + return false; + } + + @Override + public boolean removeAll(Collection c) { + return false; + } + + @Override + public boolean retainAll(Collection c) { + return false; + } + + @Override + public void clear() { + if (tail != null) { + AccessPriorityListNode node = tail; + while (node.getBefore() != null) { + node.setNext(null); + node.setPriority(0L); + node = node.getBefore(); + node.getNext().setBefore(null); + } + this.size = 0; + this.head = null; + this.tail = null; + } + } + + public void addPrioToNode(int index, long prio){ + if (!isValidIndex(index)) + return; + AccessPriorityListNode node = getNode(index); + node.setPriority(node.getPriority()+prio); + while (node.getBefore() != null && node.getPriority() > node.getBefore().getPriority()){ + moveNodeUp(node); + } + } + + public void addPrioToNode(int index){ + addPrioToNode(index,1L); + } + + @Override + public E get(int index) { + if (!isValidIndex(index)) + return null; + AccessPriorityListNode node = getNode(index); + return node.getELEMENT(); + } + + @Override + public E set(int index, E element) { + return null; + } + + @Override + public void add(int index, E element) { + + } + + @Override + public E remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator listIterator() { + return new AccessPriorityListIterators.AccessPriorityListListIterator<>(head,tail,false); + } + + @Override + public ListIterator listIterator(int index) { + return new AccessPriorityListIterators.AccessPriorityListListIterator<>(this,index); + } + + @Override + public List subList(int fromIndex, int toIndex) { + return null; + } + + @Override + public Spliterator spliterator() { + return null; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java new file mode 100644 index 0000000000..3b85030d1e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util.accessprioritylist; + +import org.apache.commons.lang3.NotImplementedException; + +import java.util.Iterator; +import java.util.ListIterator; + +public class AccessPriorityListIterators { + + + public static class AccessPriorityListListIterator implements ListIterator { + final AccessPriorityListNode head; + final AccessPriorityListNode tail; + AccessPriorityListNode current; + int counter = 0; + boolean reverse; + public AccessPriorityListListIterator(AccessPriorityListNode head, AccessPriorityListNode tail, boolean reverse) { + this.head = head; + this.tail = tail; + current = reverse ? tail : head; + this.reverse = reverse; + } + + public AccessPriorityListListIterator(AccessPriorityList list, int index) { + this.head = list.head; + this.tail = list.tail; + current = list.getNode(index); + counter = index; + } + + @Override + public boolean hasNext() { + return reverse ? head != current : tail != current; + } + + @Override + public E next() { + counter++; + E ret = current.getELEMENT(); + current = current.getNext(); + return ret; + } + + @Override + public boolean hasPrevious() { + return !reverse ? head != current : tail != current; + } + + @Override + public E previous() { + counter--; + E ret = current.getELEMENT(); + current = current.getBefore(); + return ret; + } + + @Override + public int nextIndex() { + return counter+1; + } + + @Override + public int previousIndex() { + return counter-1; + } + + @Override + public void remove() { + throw new NotImplementedException("Not Implemented"); + } + + @Override + public void set(E e) { + throw new NotImplementedException("Not Implemented"); + } + + @Override + public void add(E e) { + throw new NotImplementedException("Not Implemented"); + } + } + + public static class AccessPriorityListIterator implements Iterator { + final AccessPriorityListNode head; + AccessPriorityListNode current; + public AccessPriorityListIterator(AccessPriorityListNode head) { + this.head = this.current = head; + } + + @Override + public boolean hasNext() { + return current != null; + } + + @Override + public E next() { + E ret = current.getELEMENT(); + current = current.getNext(); + return ret; + } + } + + public static class AccessPriorityListReverseIterator implements Iterator { + final AccessPriorityListNode tail; + AccessPriorityListNode current; + + public AccessPriorityListReverseIterator(AccessPriorityListNode tail) { + this.tail = this.current = tail; + } + + @Override + public boolean hasNext() { + return current != null; + } + + @Override + public E next() { + E ret = current.getELEMENT(); + current = current.getBefore(); + return ret; + } + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java new file mode 100644 index 0000000000..b8fd357027 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util.accessprioritylist; + +public class AccessPriorityListNode { + + public final static AccessPriorityListNode EMPTY_NODE = new AccessPriorityListNode(null); + + private final E ELEMENT; + private long priority = Long.MIN_VALUE; + private AccessPriorityListNode next; + private AccessPriorityListNode before; + + public AccessPriorityListNode(E element) { + ELEMENT = element; + } + + public AccessPriorityListNode(AccessPriorityListNode before, E element, AccessPriorityListNode next) { + this.ELEMENT = element; + connect(next, before); + } + + public void connect(AccessPriorityListNode next, AccessPriorityListNode before){ + this.setNext(next); + this.setBefore(before); + } + + public E getELEMENT() { + return ELEMENT; + } + + public long getPriority() { + return priority; + } + + public void setPriority(long priority) { + this.priority = priority; + } + + public AccessPriorityListNode getNext() { + return next; + } + + public void setNext(AccessPriorityListNode next) { + this.next = next; + } + + public AccessPriorityListNode getBefore() { + return before; + } + + public void setBefore(AccessPriorityListNode before) { + this.before = before; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java deleted file mode 100644 index 769b32638d..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSList.java +++ /dev/null @@ -1,357 +0,0 @@ -/* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.util.selfsortinglist; - -import java.util.*; - -public class SSList implements List, Deque, Set { - - transient int size = 0; - transient SSListNode head; - transient SSListNode tail; - - public static SSList create(){ - return new SSList(); - } - - public SSList() {} - - @Override - public void addFirst(E t) { - final SSListNode first = head; - final SSListNode newNode = new SSListNode<>(null, t, first); - head = newNode; - if (first == null) - tail = newNode; - else - first.setBefore(newNode); - size++; - } - - @Override - public void addLast(E t) { - final SSListNode last = tail; - final SSListNode newNode = new SSListNode<>(last, t, null); - tail = newNode; - if (last == null) - head = newNode; - else - last.setNext(newNode); - size++; - } - - @Override - public boolean offerFirst(E e) { - return false; - } - - @Override - public boolean offerLast(E e) { - return false; - } - - @Override - public E removeFirst() { - return null; - } - - @Override - public E removeLast() { - return null; - } - - @Override - public E pollFirst() { - return null; - } - - @Override - public E pollLast() { - return null; - } - - @Override - public E getFirst() { - return peekFirst(); - } - - @Override - public E getLast() { - return peekLast(); - } - - @Override - public E peekFirst() { - return head != null ? head.getELEMENT() : null; - } - - @Override - public E peekLast() { - return tail != null ? tail.getELEMENT() : null; - } - - @Override - public boolean removeFirstOccurrence(Object o) { - return false; - } - - @Override - public boolean removeLastOccurrence(Object o) { - return false; - } - - @Override - public int size() { - return size; - } - - @Override - public boolean isEmpty() { - return size == 0; - } - - @Override - public boolean contains(Object o) { - return false; - } - - @Override - public Iterator iterator() { - return new SSListIterators.SSListIterator<>(head); - } - - @Override - public Iterator descendingIterator() { - return new SSListIterators.SSListReverseIterator<>(tail); - } - - @Override - public Object[] toArray() { - Object[] ret = new Object[size]; - while (listIterator().hasNext()) - ret[listIterator().nextIndex()-1] = listIterator().next(); - return ret; - } - - @Override - public T[] toArray(T[] a) { - T[] ret = (T[]) new Object[size]; - while (listIterator().hasNext()) - ret[listIterator().nextIndex()-1] = (T) listIterator().next(); - return ret; - } - - @Override - public boolean add(E e) { - addLast(e); - return true; - } - - private void moveNodeUp(SSListNode node){ - if (node == head || node.getBefore() == null) - return; - final SSListNode before = node.getBefore(); - final SSListNode beforeBefore = before.getBefore(); - final SSListNode next = node.getNext(); - - // <0,1,2> <1,2,3> N<2,3,4> <3,4,5> - - node.setBefore(beforeBefore); - // <0,1,2> <1,2,3> N<0,3,4> <3,4,5> - - if (beforeBefore != null) - beforeBefore.setNext(node); - // <0,1,3> <1,2,3> N<0,3,4> <3,4,5> - - before.setBefore(node); - // <0,1,3> <3,2,3> N<0,3,4> <3,4,5> - - before.setNext(next); - // <0,1,3> <3,2,4> N<0,3,4> <3,4,5> - - if (next != null) - next.setBefore(before); - // <0,1,3> N<0,3,4> <3,2,4> <2,4,5> - - node.setNext(before); - // <0,1,3> N<0,3,2> <3,2,4> <2,4,5> - } - - SSListNode getNode(int index) { - if (index <= (size / 2)) { - SSListNode x = head; - for (int i = 0; i < index; i++) - x = x.getNext(); - return x; - } else { - SSListNode x = tail; - for (int i = size - 1; i > index; i--) - x = x.getBefore(); - return x; - } - } - - @Override - public boolean offer(E e) { - return false; - } - - private boolean isValidIndex(int index) { - return index >= 0 && index < size; - } - - @Override - public E remove() { - return null; - } - - @Override - public E poll() { - return null; - } - - @Override - public E element() { - return null; - } - - @Override - public E peek() { - return null; - } - - @Override - public void push(E e) { - addFirst(e); - } - - @Override - public E pop() { - return null; - } - - @Override - public boolean remove(Object o) { - return false; - } - - @Override - public boolean containsAll(Collection c) { - return false; - } - - @Override - public boolean addAll(Collection c) { - for (E e : c) { - this.addLast(e); - } - return true; - } - - @Override - public boolean addAll(int index, Collection c) { - return false; - } - - @Override - public boolean removeAll(Collection c) { - return false; - } - - @Override - public boolean retainAll(Collection c) { - return false; - } - - @Override - public void clear() { - - } - - public void addPrioToNode(int index, long prio){ - if (!isValidIndex(index)) - return; - SSListNode node = getNode(index); - node.setPriority(node.getPriority()+prio); - while (node.getBefore() != null && node.getPriority() > node.getBefore().getPriority()){ - moveNodeUp(node); - } - } - - public void addPrioToNode(int index){ - addPrioToNode(index,1L); - } - - @Override - public E get(int index) { - if (!isValidIndex(index)) - return null; - SSListNode node = getNode(index); - return node.getELEMENT(); - } - - @Override - public E set(int index, E element) { - return null; - } - - @Override - public void add(int index, E element) { - - } - - @Override - public E remove(int index) { - return null; - } - - @Override - public int indexOf(Object o) { - return 0; - } - - @Override - public int lastIndexOf(Object o) { - return 0; - } - - @Override - public ListIterator listIterator() { - return new SSListIterators.SSListListIterator<>(head,tail,false); - } - - @Override - public ListIterator listIterator(int index) { - return new SSListIterators.SSListListIterator<>(this,index); - } - - @Override - public List subList(int fromIndex, int toIndex) { - return null; - } - - @Override - public Spliterator spliterator() { - return null; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListIterators.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListIterators.java deleted file mode 100644 index 83b3c66046..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListIterators.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.util.selfsortinglist; - -import org.apache.commons.lang3.NotImplementedException; - -import java.util.Iterator; -import java.util.ListIterator; - -public class SSListIterators { - - - public static class SSListListIterator implements ListIterator { - final SSListNode head; - final SSListNode tail; - SSListNode current; - int counter = 0; - boolean reverse; - public SSListListIterator(SSListNode head,SSListNode tail, boolean reverse) { - this.head = head; - this.tail = tail; - current = reverse ? tail : head; - this.reverse = reverse; - } - - public SSListListIterator(SSList list, int index) { - this.head = list.head; - this.tail = list.tail; - current = list.getNode(index); - counter = index; - } - - @Override - public boolean hasNext() { - return reverse ? head != current : tail != current; - } - - @Override - public E next() { - counter++; - E ret = current.getELEMENT(); - current = current.getNext(); - return ret; - } - - @Override - public boolean hasPrevious() { - return !reverse ? head != current : tail != current; - } - - @Override - public E previous() { - counter--; - E ret = current.getELEMENT(); - current = current.getBefore(); - return ret; - } - - @Override - public int nextIndex() { - return counter+1; - } - - @Override - public int previousIndex() { - return counter-1; - } - - @Override - public void remove() { - throw new NotImplementedException("Not Implemented"); - } - - @Override - public void set(E e) { - throw new NotImplementedException("Not Implemented"); - } - - @Override - public void add(E e) { - throw new NotImplementedException("Not Implemented"); - } - } - - public static class SSListIterator implements Iterator { - final SSListNode head; - SSListNode current; - public SSListIterator(SSListNode head) { - this.head = this.current = head; - } - - @Override - public boolean hasNext() { - return current != null; - } - - @Override - public E next() { - E ret = current.getELEMENT(); - current = current.getNext(); - return ret; - } - } - - public static class SSListReverseIterator implements Iterator { - final SSListNode tail; - SSListNode current; - - public SSListReverseIterator(SSListNode tail) { - this.tail = this.current = tail; - } - - @Override - public boolean hasNext() { - return current != null; - } - - @Override - public E next() { - E ret = current.getELEMENT(); - current = current.getBefore(); - return ret; - } - } - -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListNode.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListNode.java deleted file mode 100644 index f9c509019e..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/selfsortinglist/SSListNode.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.util.selfsortinglist; - -public class SSListNode { - - public final static SSListNode EMPTY_NODE = new SSListNode(null); - - private final E ELEMENT; - private long priority = Long.MIN_VALUE; - private SSListNode next; - private SSListNode before; - - public SSListNode(E element) { - ELEMENT = element; - } - - public SSListNode(SSListNode before, E element, SSListNode next) { - this.ELEMENT = element; - connect(next, before); - } - - public void connect(SSListNode next, SSListNode before){ - this.setNext(next); - this.setBefore(before); - } - - public E getELEMENT() { - return ELEMENT; - } - - public long getPriority() { - return priority; - } - - public void setPriority(long priority) { - this.priority = priority; - } - - public SSListNode getNext() { - return next; - } - - public void setNext(SSListNode next) { - this.next = next; - } - - public SSListNode getBefore() { - return before; - } - - public void setBefore(SSListNode before) { - this.before = before; - } -} -- cgit From 6c5e31cd64bf9ca7877771314cc98d2ad6b81711 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 15 Dec 2019 02:45:47 +0100 Subject: changed prio to prefer newer elements if two have the same prio Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: ff122c58d8ad633486463d56b61c506c1200f62a --- .../bartworks/util/accessprioritylist/AccessPriorityList.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java index 8f0cd8dd41..bd4482741d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java @@ -304,7 +304,7 @@ public class AccessPriorityList implements List, Deque, Set { return; AccessPriorityListNode node = getNode(index); node.setPriority(node.getPriority()+prio); - while (node.getBefore() != null && node.getPriority() > node.getBefore().getPriority()){ + while (node.getBefore() != null && node.getPriority() >= node.getBefore().getPriority()){ moveNodeUp(node); } } -- cgit From a70a8c6c1684beaf6f65a8db6f59840a27054d29 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 15 Dec 2019 19:18:01 +0100 Subject: worked on AccessPriorityList + switching now works fine + toArray() now works as expected + added Exceptions Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: b4707dfa63c6239a70f2ae829fef1b19d6ea7a58 --- .../accessprioritylist/AccessPriorityList.java | 74 ++++++++++++---------- 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java index bd4482741d..a1067b051e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.util.accessprioritylist; +import org.apache.commons.lang3.NotImplementedException; + import java.util.*; public class AccessPriorityList implements List, Deque, Set { @@ -30,7 +32,7 @@ public class AccessPriorityList implements List, Deque, Set { transient AccessPriorityListNode head; transient AccessPriorityListNode tail; - public static AccessPriorityList create(){ + public static AccessPriorityList create() { return new AccessPriorityList(); } @@ -62,32 +64,32 @@ public class AccessPriorityList implements List, Deque, Set { @Override public boolean offerFirst(E e) { - return false; + throw new NotImplementedException(""); } @Override public boolean offerLast(E e) { - return false; + throw new NotImplementedException(""); } @Override public E removeFirst() { - return null; + throw new NotImplementedException(""); } @Override public E removeLast() { - return null; + throw new NotImplementedException(""); } @Override public E pollFirst() { - return null; + throw new NotImplementedException(""); } @Override public E pollLast() { - return null; + throw new NotImplementedException(""); } @Override @@ -112,12 +114,12 @@ public class AccessPriorityList implements List, Deque, Set { @Override public boolean removeFirstOccurrence(Object o) { - return false; + throw new NotImplementedException(""); } @Override public boolean removeLastOccurrence(Object o) { - return false; + throw new NotImplementedException(""); } @Override @@ -132,7 +134,7 @@ public class AccessPriorityList implements List, Deque, Set { @Override public boolean contains(Object o) { - return false; + throw new NotImplementedException(""); } @Override @@ -148,16 +150,18 @@ public class AccessPriorityList implements List, Deque, Set { @Override public Object[] toArray() { Object[] ret = new Object[size]; - while (listIterator().hasNext()) - ret[listIterator().nextIndex()-1] = listIterator().next(); + int index = 0; + for (Iterator it = iterator(); it.hasNext(); index++) + ret[index] = it.next(); return ret; } @Override public T[] toArray(T[] a) { T[] ret = (T[]) new Object[size]; - while (listIterator().hasNext()) - ret[listIterator().nextIndex()-1] = (T) listIterator().next(); + int index = 0; + for (Iterator it = (Iterator) iterator(); it.hasNext(); index++) + ret[index] = it.next(); return ret; } @@ -181,6 +185,8 @@ public class AccessPriorityList implements List, Deque, Set { if (beforeBefore != null) beforeBefore.setNext(node); + else + head = node; // <0,1,3> <1,2,3> N<0,3,4> <3,4,5> before.setBefore(node); @@ -191,6 +197,8 @@ public class AccessPriorityList implements List, Deque, Set { if (next != null) next.setBefore(before); + else + tail = before; // <0,1,3> N<0,3,4> <3,2,4> <2,4,5> node.setNext(before); @@ -213,26 +221,28 @@ public class AccessPriorityList implements List, Deque, Set { @Override public boolean offer(E e) { - return false; + throw new NotImplementedException(""); } private boolean isValidIndex(int index) { - return index >= 0 && index < size; + if (index >= 0 && index < size) + return true; + throw new ArrayIndexOutOfBoundsException("NOT A VAILD INDEX!"); } @Override public E remove() { - return null; + throw new NotImplementedException(""); } @Override public E poll() { - return null; + throw new NotImplementedException(""); } @Override public E element() { - return null; + throw new NotImplementedException(""); } @Override @@ -247,17 +257,17 @@ public class AccessPriorityList implements List, Deque, Set { @Override public E pop() { - return null; + throw new NotImplementedException(""); } @Override public boolean remove(Object o) { - return false; + throw new NotImplementedException(""); } @Override public boolean containsAll(Collection c) { - return false; + throw new NotImplementedException(""); } @Override @@ -270,17 +280,17 @@ public class AccessPriorityList implements List, Deque, Set { @Override public boolean addAll(int index, Collection c) { - return false; + throw new NotImplementedException(""); } @Override public boolean removeAll(Collection c) { - return false; + throw new NotImplementedException(""); } @Override public boolean retainAll(Collection c) { - return false; + throw new NotImplementedException(""); } @Override @@ -323,27 +333,27 @@ public class AccessPriorityList implements List, Deque, Set { @Override public E set(int index, E element) { - return null; + throw new NotImplementedException(""); } @Override public void add(int index, E element) { - + throw new NotImplementedException(""); } @Override public E remove(int index) { - return null; + throw new NotImplementedException(""); } @Override public int indexOf(Object o) { - return 0; + throw new NotImplementedException(""); } @Override public int lastIndexOf(Object o) { - return 0; + throw new NotImplementedException(""); } @Override @@ -358,11 +368,11 @@ public class AccessPriorityList implements List, Deque, Set { @Override public List subList(int fromIndex, int toIndex) { - return null; + throw new NotImplementedException(""); } @Override public Spliterator spliterator() { - return null; + throw new NotImplementedException(""); } } -- cgit From 330d0422e03fd6a247e53fc951406f315ce51531 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 22 Dec 2019 10:47:01 +0100 Subject: Lathe Fix Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: c3aa1485e695258c60e8fe561022f8c263785c93 --- .../bartimaeusnek/bartworks/system/material/WerkstoffLoader.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 71e6f1d016..7f960e8258 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1834,6 +1834,8 @@ public class WerkstoffLoader implements Runnable { if (werkstoff.getGenerationFeatures().hasOres()) { GT_OreDictUnificator.registerOre(ore + werkstoff.getVarName(), werkstoff.get(ore)); GT_OreDictUnificator.registerOre(oreSmall + werkstoff.getVarName(), werkstoff.get(oreSmall)); + werkstoff.getADDITIONAL_OREDICT().forEach( e -> OreDictionary.registerOre(ore+e, werkstoff.get(ore))); + werkstoff.getADDITIONAL_OREDICT().forEach( e -> OreDictionary.registerOre(oreSmall+e, werkstoff.get(oreSmall))); } if (werkstoff.getGenerationFeatures().hasGems()) @@ -1841,6 +1843,7 @@ public class WerkstoffLoader implements Runnable { if (werkstoff.getGenerationFeatures().hasGems() || (werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0){ GT_OreDictUnificator.registerOre(block + werkstoff.getVarName(), werkstoff.get(block)); + werkstoff.getADDITIONAL_OREDICT().forEach( e -> OreDictionary.registerOre(block+e, werkstoff.get(block))); } werkstoff.getADDITIONAL_OREDICT() @@ -1926,7 +1929,7 @@ public class WerkstoffLoader implements Runnable { private void addSimpleMetalRecipes(Werkstoff werkstoff) { if (werkstoff.hasItemType(plate)) { if (werkstoff.hasItemType(gem)) { - GT_Values.RA.addLatheRecipe(werkstoff.get(gem), werkstoff.get(stick), werkstoff.get(dustSmall), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); + GT_Values.RA.addLatheRecipe(werkstoff.get(gem), werkstoff.get(stick), werkstoff.get(dustSmall,2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)}); GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(gem)}); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); @@ -1941,7 +1944,7 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ingot,3), werkstoff.get(plate,2), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); GregTech_API.registerCover(werkstoff.get(plate), new GT_RenderedTexture(werkstoff.getTexSet().mTextures[71], werkstoff.getRGBA(), false), null); - GT_Values.RA.addLatheRecipe(werkstoff.get(ingot), werkstoff.get(stick), werkstoff.get(dustSmall), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); + GT_Values.RA.addLatheRecipe(werkstoff.get(ingot), werkstoff.get(stick), werkstoff.get(dustSmall,2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); -- cgit From 3a5ed85148a1e64616d0f5eaf639cd45cd0253af Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 22 Dec 2019 10:47:50 +0100 Subject: Material Conversion Fix Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 4feb0999cb5e05275db0ae4b5267f6af23736d39 --- .../github/bartimaeusnek/bartworks/MainMod.java | 2 +- .../server/EventHandler/ServerEventHandler.java | 26 +++++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index a054945a32..2d33252b12 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -162,8 +162,8 @@ public final class MainMod { ServerEventHandler serverEventHandler = new ServerEventHandler(); if (FMLCommonHandler.instance().getSide().isServer()) { MinecraftForge.EVENT_BUS.register(serverEventHandler); - FMLCommonHandler.instance().bus().register(serverEventHandler); } + FMLCommonHandler.instance().bus().register(serverEventHandler); if (ConfigHandler.BioLab) new BioLabLoader().run(); if (ConfigHandler.newStuff) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java index cf084f627a..bb7c343eee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java @@ -55,6 +55,9 @@ public class ServerEventHandler { if (event == null || !(event.player instanceof EntityPlayerMP)) return; + if (event.player.worldObj.getTotalWorldTime() % 20 != 0) + return; + boolean replace = false; ItemStack toReplace = null; for (int i = 0; i < event.player.inventory.mainInventory.length; i++) { @@ -62,19 +65,32 @@ public class ServerEventHandler { if (stack == null) continue; int[] oreIDs = OreDictionary.getOreIDs(stack); + if (oreIDs.length > 0){ - for (int oreID : oreIDs) { + loop: for (int oreID : oreIDs) { String oreDictName = OreDictionary.getOreName(oreID); for (Werkstoff e : Werkstoff.werkstoffHashSet) { replace = e.getGenerationFeatures().enforceUnification; - if (replace && (oreDictName.contains(e.getVarName()) || e.getADDITIONAL_OREDICT().stream().anyMatch(oreDictName::contains))) { - String prefix = oreDictName.replace(e.getVarName(), ""); - toReplace = GT_OreDictUnificator.get(OrePrefixes.getPrefix(prefix),e.getVarName(),stack.stackSize); + if (replace) { + if (oreDictName.contains(e.getVarName())) { + String prefix = oreDictName.replace(e.getVarName(), ""); + toReplace = GT_OreDictUnificator.get(OrePrefixes.getPrefix(prefix), e.getVarName(), stack.stackSize); + break loop; + } else { + for (String s : e.getADDITIONAL_OREDICT()) { + if (oreDictName.contains(s)) { + String prefix = oreDictName.replace(s, ""); + toReplace = GT_OreDictUnificator.get(OrePrefixes.getPrefix(prefix), e.getVarName(), stack.stackSize); + break loop; + } + } + } } + replace = false; } } } - if (replace) { + if (replace && toReplace != null) { event.player.inventory.setInventorySlotContents(i, toReplace); replace = false; } -- cgit From 184164c971fd18aad29b19f7522c4902e3f41ba4 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 22 Dec 2019 10:48:14 +0100 Subject: finishing work on replacement list + version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 6e1302c5f38d49d3c7cfc2f8194cc5ada9bad1a4 --- build.properties | 2 +- .../ASM/BWCoreStaticReplacementMethodes.java | 28 ++++++++++++++-------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/build.properties b/build.properties index 73f214419f..f9a6425a12 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=3_pre5 +buildNumber=3_pre6 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java index 53a0fff182..d9ff910ff8 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java @@ -30,8 +30,9 @@ import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import java.util.HashSet; import java.util.Iterator; -import java.util.Optional; +import java.util.List; public class BWCoreStaticReplacementMethodes { @@ -79,25 +80,32 @@ public class BWCoreStaticReplacementMethodes { return new ItemStack(itemstack.getItem(), 1, i1); } else { - Optional iPossibleRecipe = Optional.empty(); + IRecipe iPossibleRecipe = null; int index = 0; - for (Iterator it = RECENTLYUSEDRECIPES.iterator(); it.hasNext();++index) { + for (Iterator it = RECENTLYUSEDRECIPES.iterator(); it.hasNext(); ++index) { IRecipe RECENTLYUSEDRECIPE = it.next(); if (RECENTLYUSEDRECIPE.matches(inventoryCrafting, world)) { - iPossibleRecipe = Optional.of(RECENTLYUSEDRECIPE); + iPossibleRecipe = RECENTLYUSEDRECIPE; break; } } - if (iPossibleRecipe.isPresent()) { + if (iPossibleRecipe != null) { RECENTLYUSEDRECIPES.addPrioToNode(index); - return iPossibleRecipe.get().getCraftingResult(inventoryCrafting); + return iPossibleRecipe.getCraftingResult(inventoryCrafting); } - iPossibleRecipe = CraftingManager.getInstance().getRecipeList().stream().filter(r -> ((IRecipe)r).matches(inventoryCrafting, world)).findFirst(); - ItemStack stack = iPossibleRecipe.map(iRecipe -> iRecipe.getCraftingResult(inventoryCrafting)).orElse(null); - if (stack != null) - RECENTLYUSEDRECIPES.addLast(iPossibleRecipe.get()); + ItemStack stack = null; + HashSet recipeHashSet = new HashSet<>(); + for (IRecipe recipe : (List) CraftingManager.getInstance().getRecipeList()) + if (recipe.matches(inventoryCrafting, world)) + recipeHashSet.add(recipe); + + for (IRecipe recipe : recipeHashSet){ + stack = recipe.getCraftingResult(inventoryCrafting); + if (stack != null && recipeHashSet.size() == 1) + RECENTLYUSEDRECIPES.addLast(recipe); + } return stack; } } -- cgit From 3f6b776f96e99ebd5ffd830b0dfc0206d3429409 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 22 Dec 2019 13:09:31 +0100 Subject: Mega Vaccum Freezer Structure Fix Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 19f221d0300dc97607b8f51a0cb3476115c114ca --- build.properties | 2 +- .../tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.properties b/build.properties index f9a6425a12..081acf308a 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=3_pre6 +buildNumber=3 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 434b034160..ce628ce003 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -143,11 +143,11 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { return ( - BW_Util.check_layer(aBaseMetaTileEntity, 7, -7, -6, GregTech_API.sBlockCasings2, 1, 7, false, 17) + BW_Util.check_layer(aBaseMetaTileEntity, 7, -7, -6, GregTech_API.sBlockCasings2, 1, 7, false,false,true, GregTech_API.sBlockCasings2,1,true, 17) && BW_Util.check_layer(aBaseMetaTileEntity, 7, -6, 0, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) && BW_Util.check_layer(aBaseMetaTileEntity, 7, 0, 1, GregTech_API.sBlockCasings2, 1, 7, true, false, true, Blocks.air, -1, true, 17) && BW_Util.check_layer(aBaseMetaTileEntity, 7, 1, 7, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) - && BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false, 17) + && BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false,false,true, GregTech_API.sBlockCasings2,1,true, 17) ) && !this.mInputBusses.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mEnergyHatches.isEmpty() && !this.mMaintenanceHatches.isEmpty(); } -- cgit From 12a54a5f202ef11c6d96f7a627b48c19482a8978 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 24 Dec 2019 22:05:53 +0100 Subject: Fixed Unification enforcement handler Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 9504e9c6269c910c43f335ba728205dae717a196 --- build.properties | 2 +- .../multis/mega/GT_TileEntity_MegaVacuumFreezer.java | 3 +-- .../bartworks/server/EventHandler/ServerEventHandler.java | 12 ++++++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/build.properties b/build.properties index 081acf308a..13606e11cd 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=3 +buildNumber=3_f2 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index ce628ce003..1a3e1ca7bb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -151,5 +151,4 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre ) && !this.mInputBusses.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mEnergyHatches.isEmpty() && !this.mMaintenanceHatches.isEmpty(); } - -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java index bb7c343eee..59b8b947b7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java @@ -74,13 +74,21 @@ public class ServerEventHandler { if (replace) { if (oreDictName.contains(e.getVarName())) { String prefix = oreDictName.replace(e.getVarName(), ""); - toReplace = GT_OreDictUnificator.get(OrePrefixes.getPrefix(prefix), e.getVarName(), stack.stackSize); + OrePrefixes prefixes = OrePrefixes.getPrefix(prefix); + if (prefixes == null) { + continue; + } + toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize); break loop; } else { for (String s : e.getADDITIONAL_OREDICT()) { if (oreDictName.contains(s)) { String prefix = oreDictName.replace(s, ""); - toReplace = GT_OreDictUnificator.get(OrePrefixes.getPrefix(prefix), e.getVarName(), stack.stackSize); + OrePrefixes prefixes = OrePrefixes.getPrefix(prefix); + if (prefixes == null) { + continue; + } + toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize); break loop; } } -- cgit From 814c7d783d1aba4695a6a9da3fd279f1095999e6 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 27 Dec 2019 17:29:13 +0100 Subject: Initial high tier circuit cost adjusted Fixed NEI cleanroom bug Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 0ae0c5d677bc9b653458cec6c42c2127ccc63f86 --- .../system/material/CircuitGeneration/CircuitImprintLoader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 3629b01ead..3298aec12b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -113,7 +113,7 @@ public class CircuitImprintLoader implements Runnable { for (ItemStack is : newRecipe.mInputs){ int[] oreIDs = OreDictionary.getOreIDs(is); if(oreIDs == null || oreIDs.length < 1 || !OreDictionary.getOreName(oreIDs[0]).contains("circuit")) { - is.stackSize = 64; + is.stackSize = Math.min(is.stackSize * 6, 64); if (is.stackSize > is.getItem().getItemStackLimit() || is.stackSize > is.getMaxStackSize()) is.stackSize = is.getMaxStackSize(); } @@ -162,7 +162,7 @@ public class CircuitImprintLoader implements Runnable { if (CircuitImprintLoader.checkForBlacklistedComponents(in)){ return null; } - return new BWRecipes.DynamicGTRecipe(false,in,new ItemStack[]{out},BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]),0,0),null, original.mFluidInputs,null,original.mDuration,original.mEUt,original.mSpecialValue); + return new BWRecipes.DynamicGTRecipe(false,in,new ItemStack[]{out},BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]),0,0),null, original.mFluidInputs,null,original.mDuration * 16,original.mEUt,0); } -- cgit From 7dde152e0f3f11a7e5cac613140baa78624ed290 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 2 Jan 2020 06:34:26 +0100 Subject: moved imprint loader onto server start + fixes NBT issues with recipes Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: b145d22c3a8af5bdda021c4039b830935fd1dbe1 --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 8 ++- .../CircuitGeneration/CircuitImprintLoader.java | 79 +++++++++++++++++----- 3 files changed, 68 insertions(+), 21 deletions(-) diff --git a/build.properties b/build.properties index 13606e11cd..1a4f713309 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=3_f2 +buildNumber=4 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 2d33252b12..cf0c828cc5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -217,7 +217,7 @@ public final class MainMod { removeIC2Recipes(); MainMod.addElectricImplosionCompressorRecipes(); PlatinumSludgeOverHaul.replacePureElements(); - new CircuitImprintLoader().run(); + runOnServerStarted(); fixEnergyRequirements(); MainMod.unificationRecipeEnforcer(); @@ -225,8 +225,11 @@ public final class MainMod { private static boolean recipesAdded; - public static void runOnPlayerJoined(boolean classicMode, boolean extraGasRecipes){ + public static void runOnPlayerJoined(boolean classicMode, boolean extraGasRecipes) { OreDictHandler.adaptCacheForWorld(); + + CircuitImprintLoader.run(); + if (!recipesAdded) { if (!extraGasRecipes) { ArrayListMultimap toChange = MainMod.getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS); @@ -238,6 +241,7 @@ public final class MainMod { // removeDuplicateRecipes(); recipesAdded = true; } + } private static void fixEnergyRequirements() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 3298aec12b..403556f4eb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -44,14 +44,35 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.HashSet; import java.util.Iterator; -public class CircuitImprintLoader implements Runnable { +public class CircuitImprintLoader { public static final ArrayListMultimap recipeTagMap = ArrayListMultimap.create(); + static final HashBiMap bwCircuitTagMap = HashBiMap.create(20); - static final HashSet refs = new HashSet<>(); public static short reverseIDs = Short.MAX_VALUE-1; public static HashBiMap circuitIIconRefs = HashBiMap.create(20); +// /** +// * stack is assumed valid +// **/ +// private static NBTTagCompound getUniqueIdentifierFromStack(ItemStack stack){ +// NBTTagCompound tagCompound = new NBTTagCompound(); +// tagCompound.setString("Name", stack.getUnlocalizedName()); +// tagCompound.setString("ODName", OreDictionary.getOreName(OreDictionary.getOreID(stack))); +// tagCompound.setShort("Damage", (short)stack.getItemDamage()); +// +// return tagCompound; +// } +// +// private static ItemStack getStackFromUniqueIdentifier(NBTTagCompound tagCompound){ +// return OreDictionary.getOres(tagCompound.getString("ODName")).stream().filter( +// e -> +// e.getItemDamage() == tagCompound.getShort("Damage") +// && e.getUnlocalizedName().equals(tagCompound.getString("Name")) +// +// ).findFirst().orElse(null); +// } + public static NBTTagCompound getTagFromStack(ItemStack stack){ if (GT_Utility.isStackValid(stack)) return stack.copy().splitStack(1).writeToNBT(new NBTTagCompound()); @@ -62,49 +83,66 @@ public class CircuitImprintLoader implements Runnable { return ItemStack.loadItemStackFromNBT(tagCompound); } - @Override - public void run() { - if (BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).mRecipeList.size() > 0) - return; + public static void run() { + boolean newServer = false; + if (BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).mRecipeList.size() > 0){ + BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).mRecipeList.clear(); + recipeTagMap.clear(); + newServer = true; + } + Iterator it = GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.iterator(); GT_Recipe circuitRecipe; + HashSet toRem = new HashSet<>(); HashSet toAdd = new HashSet<>(); + while (it.hasNext()) { circuitRecipe = it.next(); + ItemStack[] outputs = circuitRecipe.mOutputs; + if (outputs.length < 1) continue; + int[] oreIDS = OreDictionary.getOreIDs(outputs[0]); + if (oreIDS.length < 1) continue; + String name = OreDictionary.getOreName(oreIDS[0]); + if (name.contains("Circuit") || name.contains("circuit")) { + CircuitImprintLoader.recipeTagMap.put(CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); - for (ItemStack s : circuitRecipe.mInputs) { - if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))) - CircuitImprintLoader.refs.add(CircuitImprintLoader.getTagFromStack(s.copy().splitStack(1))); - } + if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))) { GT_Recipe newRecipe = CircuitImprintLoader.reBuildRecipe(circuitRecipe); + if (newRecipe != null) BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(newRecipe); + if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) { toRem.add(circuitRecipe); toAdd.add(CircuitImprintLoader.makeMoreExpensive(circuitRecipe)); } + } else { - if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) { + + if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) toRem.add(circuitRecipe); - } - } + } } } - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.addAll(toAdd); - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(toRem); - this.makeCircuitImprints(); + + if (!newServer) { + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.addAll(toAdd); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(toRem); + } + + makeCircuitImprints(); } @SuppressWarnings("deprecation") @@ -165,7 +203,6 @@ public class CircuitImprintLoader implements Runnable { return new BWRecipes.DynamicGTRecipe(false,in,new ItemStack[]{out},BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]),0,0),null, original.mFluidInputs,null,original.mDuration * 16,original.mEUt,0); } - public static final HashSet blacklistSet = new HashSet<>(); private static boolean checkForBlacklistedComponents(ItemStack[] itemStacks){ @@ -178,16 +215,21 @@ public class CircuitImprintLoader implements Runnable { return false; } - private void makeCircuitImprints(){ + private static void makeCircuitImprints() { + //TODO: cache and remove recipes if new world is loaded. + for (NBTTagCompound tag : CircuitImprintLoader.recipeTagMap.keySet()){ ItemStack stack = CircuitImprintLoader.getStackFromTag(tag); int eut = Integer.MAX_VALUE; + for (GT_Recipe recipe : CircuitImprintLoader.recipeTagMap.get(tag)) { eut = Math.min(eut, recipe.mEUt); } + eut = Math.min(eut, BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName(OreDictionary.getOreIDs(stack)[0])))); GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300,eut, BW_Util.CLEANROOM); GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); + GameRegistry.addRecipe(new BWRecipes.BWNBTDependantCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), " X ", "GPG", @@ -195,6 +237,7 @@ public class CircuitImprintLoader implements Runnable { 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3))); + GT_ModHandler.addCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{ " X ", "GPG", -- cgit From b17d796eed60c618c4d186906f5bbbf363acf262 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 3 Jan 2020 23:24:35 +0100 Subject: Removed Duplicate recipes when switching server/single player Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: c7b64b2e65aa8fc3107e09f368ddb14218784e16 --- .../CircuitGeneration/CircuitImprintLoader.java | 67 +++--- .../bartimaeusnek/bartworks/util/BW_Util.java | 249 ++++++++++++++++++++- 2 files changed, 275 insertions(+), 41 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 403556f4eb..361648f276 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; +import com.github.bartimaeusnek.ASM.BWCoreStaticReplacementMethodes; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; @@ -38,8 +39,11 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.ShapedOreRecipe; import java.util.HashSet; import java.util.Iterator; @@ -142,7 +146,7 @@ public class CircuitImprintLoader { GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(toRem); } - makeCircuitImprints(); + makeCircuitImprintRecipes(); } @SuppressWarnings("deprecation") @@ -215,8 +219,29 @@ public class CircuitImprintLoader { return false; } - private static void makeCircuitImprints() { - //TODO: cache and remove recipes if new world is loaded. + private static HashSet recipeWorldCache = new HashSet<>(); + private static HashSet gtrecipeWorldCache = new HashSet<>(); + + private static void removeOldRecipesFromRegistries(){ + recipeWorldCache.forEach(CraftingManager.getInstance().getRecipeList()::remove); + BWCoreStaticReplacementMethodes.RECENTLYUSEDRECIPES.clear(); + gtrecipeWorldCache.forEach(GT_Recipe.GT_Recipe_Map.sSlicerRecipes.mRecipeList::remove); + recipeWorldCache.forEach( r -> + { + try { + BW_Util.getGTBufferedRecipeList().remove(r); + } catch (Exception e) { + e.printStackTrace(); + } + } + ); + recipeWorldCache.clear(); + gtrecipeWorldCache.clear(); + } + + private static void makeCircuitImprintRecipes() { + + removeOldRecipesFromRegistries(); for (NBTTagCompound tag : CircuitImprintLoader.recipeTagMap.keySet()){ ItemStack stack = CircuitImprintLoader.getStackFromTag(tag); @@ -228,44 +253,20 @@ public class CircuitImprintLoader { eut = Math.min(eut, BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName(OreDictionary.getOreIDs(stack)[0])))); GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300,eut, BW_Util.CLEANROOM); + gtrecipeWorldCache.add(slicingRecipe); GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); - GameRegistry.addRecipe(new BWRecipes.BWNBTDependantCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), - " X ", - "GPG", - " X ", - 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), - 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), - 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3))); - - GT_ModHandler.addCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{ + ShapedOreRecipe gtrecipe = BW_Util.createGTCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{ " X ", "GPG", " X ", 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3)}); + recipeWorldCache.add(gtrecipe); + GameRegistry.addRecipe(gtrecipe); + } -// for (ItemStack stack : CircuitImprintLoader.bwCircuitTagMap.values()){ -// NBTTagCompound tag = CircuitImprintLoader.getTagFromStack(stack); -// CircuitData data = CircuitImprintLoader.bwCircuitTagMap.inverse().get(stack); -// GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300, Math.toIntExact(data.getaVoltage()),data.getaSpecial()); -// GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); -// GameRegistry.addRecipe(new BWRecipes.BWNBTDependantCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), -// " X ", -// "GPG", -// " X ", -// 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), -// 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), -// 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3))); -// GT_ModHandler.addCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1),GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS ,new Object[]{ -// " X ", -// "GPG", -// " X ", -// 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), -// 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), -// 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3) -// }); -// } + } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 703c3b66da..89d4eea19a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -26,31 +26,38 @@ import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import gregtech.api.enums.Element; import gregtech.api.enums.Materials; +import gregtech.api.enums.OreDictNames; +import gregtech.api.enums.ToolDictNames; +import gregtech.api.interfaces.IItemContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.objects.ItemData; +import gregtech.api.util.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.enchantment.Enchantment; import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.ShapedOreRecipe; +import org.apache.commons.lang3.reflect.FieldUtils; import javax.annotation.Nonnegative; import javax.annotation.Nonnull; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; +import java.lang.reflect.Field; +import java.util.*; + +import static gregtech.api.enums.GT_Values.*; -import static gregtech.api.enums.GT_Values.V; @SuppressWarnings("unused") public class BW_Util { @@ -528,4 +535,230 @@ public class BW_Util { return 0; } + + private static Field sBufferedRecipeList; + public static List getGTBufferedRecipeList() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException{ + if (sBufferedRecipeList == null) { + sBufferedRecipeList = FieldUtils.getDeclaredField(GT_ModHandler.class,"sBufferRecipeList",true); + } + if (sBufferedRecipeList == null) { + sBufferedRecipeList = FieldUtils.getField(GT_ModHandler.class,"sBufferRecipeList",true); + } + return (List) sBufferedRecipeList.get(null); + } + + public static ShapedOreRecipe createGTCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) { + return createGTCraftingRecipe(aResult, new Enchantment[0], new int[0], (aBitMask & GT_ModHandler.RecipeBits.MIRRORED) != 0L, (aBitMask & GT_ModHandler.RecipeBits.BUFFERED) != 0L, (aBitMask & GT_ModHandler.RecipeBits.KEEPNBT) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DISMANTLEABLE) != 0L, (aBitMask & GT_ModHandler.RecipeBits.NOT_REMOVABLE) == 0L, (aBitMask & GT_ModHandler.RecipeBits.REVERSIBLE) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES_IF_SAME_NBT) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_SHAPED_RECIPES) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_NATIVE_RECIPES) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS) == 0L, (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_THERE_IS_ANOTHER_RECIPE_FOR_IT) != 0L, (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL) != 0L, aRecipe); + } + + public static ShapedOreRecipe createGTCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput, boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, boolean aRemoveAllOtherShapedsWithSameOutput, boolean aRemoveAllOtherNativeRecipes, boolean aCheckForCollisions, boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, boolean aOnlyAddIfResultIsNotNull, Object[] aRecipe) { + aResult = GT_OreDictUnificator.get(true, aResult); + if (aOnlyAddIfResultIsNotNull && aResult == null) return null; + if (aResult != null && Items.feather.getDamage(aResult) == W) Items.feather.setDamage(aResult, 0); + if (aRecipe == null || aRecipe.length <= 0) return null; + + boolean tThereWasARecipe = false; + + for (byte i = 0; i < aRecipe.length; i++) { + if (aRecipe[i] instanceof IItemContainer) + aRecipe[i] = ((IItemContainer) aRecipe[i]).get(1); + else if (aRecipe[i] instanceof Enum) + aRecipe[i] = ((Enum) aRecipe[i]).name(); + else if (!(aRecipe[i] == null || aRecipe[i] instanceof ItemStack || aRecipe[i] instanceof ItemData || aRecipe[i] instanceof String || aRecipe[i] instanceof Character)) + aRecipe[i] = aRecipe[i].toString(); + } + + try { + StringBuilder shape = new StringBuilder(E); + int idx = 0; + if (aRecipe[idx] instanceof Boolean) { + throw new IllegalArgumentException(); + } + + ArrayList tRecipeList = new ArrayList(Arrays.asList(aRecipe)); + + while (aRecipe[idx] instanceof String) { + StringBuilder s = new StringBuilder((String) aRecipe[idx++]); + shape.append(s); + while (s.length() < 3) s.append(" "); + if (s.length() > 3) throw new IllegalArgumentException(); + + for (char c : s.toString().toCharArray()) { + switch (c) { + case 'b': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolBlade.name()); + break; + case 'c': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolCrowbar.name()); + break; + case 'd': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolScrewdriver.name()); + break; + case 'f': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolFile.name()); + break; + case 'h': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolHardHammer.name()); + break; + case 'i': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolSolderingIron.name()); + break; + case 'j': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolSolderingMetal.name()); + break; + case 'k': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolKnife.name()); + break; + case 'm': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolMortar.name()); + break; + case 'p': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolDrawplate.name()); + break; + case 'r': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolSoftHammer.name()); + break; + case 's': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolSaw.name()); + break; + case 'w': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolWrench.name()); + break; + case 'x': + tRecipeList.add(c); + tRecipeList.add(ToolDictNames.craftingToolWireCutter.name()); + break; + } + } + } + + aRecipe = tRecipeList.toArray(); + + if (aRecipe[idx] instanceof Boolean) { + idx++; + } + Map tItemStackMap = new HashMap<>(); + Map tItemDataMap = new HashMap<>(); + tItemStackMap.put(' ', null); + + boolean tRemoveRecipe = true; + + for (; idx < aRecipe.length; idx += 2) { + if (aRecipe[idx] == null || aRecipe[idx + 1] == null) { + if (D1) { + GT_Log.err.println("WARNING: Missing Item for shaped Recipe: " + (aResult == null ? "null" : aResult.getDisplayName())); + for (Object tContent : aRecipe) GT_Log.err.println(tContent); + } + return null; + } + Character chr = (Character) aRecipe[idx]; + Object in = aRecipe[idx + 1]; + if (in instanceof ItemStack) { + tItemStackMap.put(chr, GT_Utility.copy(in)); + tItemDataMap.put(chr, GT_OreDictUnificator.getItemData((ItemStack) in)); + } else if (in instanceof ItemData) { + String tString = in.toString(); + switch (tString) { + case "plankWood": + tItemDataMap.put(chr, new ItemData(Materials.Wood, M)); + break; + case "stoneNetherrack": + tItemDataMap.put(chr, new ItemData(Materials.Netherrack, M)); + break; + case "stoneObsidian": + tItemDataMap.put(chr, new ItemData(Materials.Obsidian, M)); + break; + case "stoneEndstone": + tItemDataMap.put(chr, new ItemData(Materials.Endstone, M)); + break; + default: + tItemDataMap.put(chr, (ItemData) in); + break; + } + ItemStack tStack = GT_OreDictUnificator.getFirstOre(in, 1); + if (tStack == null) tRemoveRecipe = false; + else tItemStackMap.put(chr, tStack); + in = aRecipe[idx + 1] = in.toString(); + } else if (in instanceof String) { + if (in.equals(OreDictNames.craftingChest.toString())) + tItemDataMap.put(chr, new ItemData(Materials.Wood, M * 8)); + else if (in.equals(OreDictNames.craftingBook.toString())) + tItemDataMap.put(chr, new ItemData(Materials.Paper, M * 3)); + else if (in.equals(OreDictNames.craftingPiston.toString())) + tItemDataMap.put(chr, new ItemData(Materials.Stone, M * 4, Materials.Wood, M * 3)); + else if (in.equals(OreDictNames.craftingFurnace.toString())) + tItemDataMap.put(chr, new ItemData(Materials.Stone, M * 8)); + else if (in.equals(OreDictNames.craftingIndustrialDiamond.toString())) + tItemDataMap.put(chr, new ItemData(Materials.Diamond, M)); + else if (in.equals(OreDictNames.craftingAnvil.toString())) + tItemDataMap.put(chr, new ItemData(Materials.Iron, M * 10)); + ItemStack tStack = GT_OreDictUnificator.getFirstOre(in, 1); + if (tStack == null) tRemoveRecipe = false; + else tItemStackMap.put(chr, tStack); + } else { + throw new IllegalArgumentException(); + } + } + + if (aReversible && aResult != null) { + ItemData[] tData = new ItemData[9]; + int x = -1; + for (char chr : shape.toString().toCharArray()) tData[++x] = tItemDataMap.get(chr); + if (GT_Utility.arrayContainsNonNull(tData)) + GT_OreDictUnificator.addItemData(aResult, new ItemData(tData)); + } + + if (aCheckForCollisions && tRemoveRecipe) { + ItemStack[] tRecipe = new ItemStack[9]; + int x = -1; + for (char chr : shape.toString().toCharArray()) { + tRecipe[++x] = tItemStackMap.get(chr); + if (tRecipe[x] != null && Items.feather.getDamage(tRecipe[x]) == W) + Items.feather.setDamage(tRecipe[x], 0); + } + tThereWasARecipe = GT_ModHandler.removeRecipe(tRecipe) != null; + } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + + if (aResult == null || aResult.stackSize <= 0) return null; + + if (aRemoveAllOthersWithSameOutput || aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT || aRemoveAllOtherShapedsWithSameOutput || aRemoveAllOtherNativeRecipes) + tThereWasARecipe = GT_ModHandler.removeRecipeByOutput(aResult, !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, aRemoveAllOtherShapedsWithSameOutput, aRemoveAllOtherNativeRecipes) || tThereWasARecipe; + + if (aOnlyAddIfThereIsAnyRecipeOutputtingThis && !tThereWasARecipe) { + ArrayList tList = (ArrayList) CraftingManager.getInstance().getRecipeList(); + int tList_sS=tList.size(); + for (int i = 0; i < tList_sS && !tThereWasARecipe; i++) { + IRecipe tRecipe = tList.get(i); + if (GT_ModHandler.sSpecialRecipeClasses.contains(tRecipe.getClass().getName())) continue; + if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tRecipe.getRecipeOutput()), aResult, true)) { + tList.remove(i--); tList_sS=tList.size(); + tThereWasARecipe = true; + } + } + } + + if (Items.feather.getDamage(aResult) == W || Items.feather.getDamage(aResult) < 0) + Items.feather.setDamage(aResult, 0); + + GT_Utility.updateItemStack(aResult); + + return new GT_Shaped_Recipe(GT_Utility.copy(aResult), aDismantleable, aRemovable, aKeepNBT, aEnchantmentsAdded, aEnchantmentLevelsAdded, aRecipe).setMirrored(aMirrored); + } + } -- cgit From 501134f1e1457fb3b5762f12471e1c930ee1fa94 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 3 Jan 2020 23:37:59 +0100 Subject: version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: f2dcfd8f59d25a7b464658880c9b709395959204 --- build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.properties b/build.properties index 1a4f713309..475a046f35 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=4 +buildNumber=5 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 -- cgit From dcdc33db7fcae16ee535ff8d4696963f466174e2 Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Fri, 3 Jan 2020 23:47:21 +0100 Subject: update git ignore Former-commit-id: c7d8168497b910603cb1f272fa0ef747311a31ee --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index edc0472679..4d09b92927 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,7 @@ hs_err_pid* !/libs/CodeChickenCore-1.7.10-1.0.4.35-dev.jar !/libs/CodeChickenLib-1.7.10-1.1.1.99-dev.jar !/libs/NotEnoughItems-1.7.10-1.0.4.95-dev.jar -!/libs/gregtech-5.09.32-dev.jar \ No newline at end of file +!/libs/gregtech-5.09.32-dev.jar +SetupWorkspaces.bat +SetupDevWorkspaces.bat +Idea.bat -- cgit From 22ac800273f3774331ca4e817d89233d18819000 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 7 Jan 2020 15:49:37 +0100 Subject: Fixes: + Ores not beeing detected by Miners + CircuitImprints not craftable/recipe buildup when server changes Refractored some code Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 2f2d7b4977334c7faba8185ecb76229c57b939a3 --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 144 +++++----- .../material/BW_MetaGeneratedBlock_Item.java | 3 +- .../system/material/BW_MetaGenerated_Blocks.java | 8 +- .../system/material/BW_MetaGenerated_Ores.java | 5 +- .../CircuitGeneration/CircuitImprintLoader.java | 294 +++++++++++---------- .../bartworks/system/material/WerkstoffLoader.java | 98 +++++-- .../bartworks/util/NEIbartworksConfig.java | 3 + 8 files changed, 306 insertions(+), 251 deletions(-) diff --git a/build.properties b/build.properties index 475a046f35..d8837dced6 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=5 +buildNumber=6 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index cf0c828cc5..f1ad6e2b2a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -120,9 +120,9 @@ public final class MainMod { if (Loader.isModLoaded("miscutils") && ConfigHandler.GTppLogDisabler) { try { - Field loggerField = FieldUtils.getField(Class.forName("gtPlusPlus.api.objects.Logger"),"modLogger",true); - FieldUtils.removeFinalModifier(loggerField,true); - loggerField.set(null,(Logger)new STFUGTPPLOG()); + Field loggerField = FieldUtils.getField(Class.forName("gtPlusPlus.api.objects.Logger"), "modLogger", true); + FieldUtils.removeFinalModifier(loggerField, true); + loggerField.set(null, (Logger) new STFUGTPPLOG()); } catch (IllegalAccessException | ClassNotFoundException e) { e.printStackTrace(); } @@ -180,8 +180,8 @@ public final class MainMod { NetworkRegistry.INSTANCE.registerGuiHandler(MainMod.instance, MainMod.GH); if (ConfigHandler.BioLab) { new GTNHBlocks().run(); - for (Map.Entrypair : BioVatLogicAdder.BioVatGlass.getGlassMap().entrySet()){ - GT_OreDictUnificator.registerOre("blockGlass"+VN[pair.getValue()],new ItemStack(pair.getKey().getBlock(),1,pair.getKey().getaByte())); + for (Map.Entry pair : BioVatLogicAdder.BioVatGlass.getGlassMap().entrySet()) { + GT_OreDictUnificator.registerOre("blockGlass" + VN[pair.getValue()], new ItemStack(pair.getKey().getBlock(), 1, pair.getKey().getaByte())); } } @@ -191,18 +191,18 @@ public final class MainMod { new ThreadedLoader().run(); else INSTANCE.run(); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor","Electric Implosions?"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor.desc","Basically a giant Hammer that presses Stuff - No more TNT!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp","Heat from below!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp.desc","Get ALL the thermal energy!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline","Cheaper Circuits?"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline.desc","Well, yes, but actually no..."); - GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.nqgen","Can be used as Enriched Naquadah Fuel Substitute"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor", "Electric Implosions?"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor.desc", "Basically a giant Hammer that presses Stuff - No more TNT!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp", "Heat from below!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp.desc", "Get ALL the thermal energy!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline", "Cheaper Circuits?"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline.desc", "Well, yes, but actually no..."); + GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.nqgen", "Can be used as Enriched Naquadah Fuel Substitute"); } } @Mod.EventHandler - public void onServerStarting(FMLServerStartingEvent event){ + public void onServerStarting(FMLServerStartingEvent event) { event.registerServerCommand(new SummonRuin()); event.registerServerCommand(new ChangeConfig()); event.registerServerCommand(new PrintRecipeListToFile()); @@ -212,6 +212,7 @@ public final class MainMod { public void onServerStarted(FMLServerStartedEvent event) { MainMod.runOnPlayerJoined(ConfigHandler.classicMode, ConfigHandler.disableExtraGassesForEBF); } + @Mod.EventHandler public void onModLoadingComplete(FMLLoadCompleteEvent event) { removeIC2Recipes(); @@ -227,7 +228,6 @@ public final class MainMod { public static void runOnPlayerJoined(boolean classicMode, boolean extraGasRecipes) { OreDictHandler.adaptCacheForWorld(); - CircuitImprintLoader.run(); if (!recipesAdded) { @@ -246,12 +246,12 @@ public final class MainMod { private static void fixEnergyRequirements() { maploop: - for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings){ - for (GT_Recipe recipe : map.mRecipeList){ + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + for (GT_Recipe recipe : map.mRecipeList) { if (recipe.mFakeRecipe) continue maploop; - for (int i = 0; i < (VN.length-1); i++) { - if (recipe.mEUt == BW_Util.getTierVoltage(i)){ + for (int i = 0; i < (VN.length - 1); i++) { + if (recipe.mEUt == BW_Util.getTierVoltage(i)) { recipe.mEUt = BW_Util.getMachineVoltageFromTier(i); } } @@ -293,61 +293,61 @@ public final class MainMod { MainMod.runMoltenUnificationEnfocement(werkstoff); MainMod.runUnficationDeleter(werkstoff); for (String s : oreDictNames) - for (OrePrefixes prefixes : OrePrefixes.values()) { - if (OreDictionary.getOres(prefixes + s).size() > 1) { - for (int j = 0; j < OreDictionary.getOres(prefixes + s).size(); j++) { - ItemStack toReplace = OreDictionary.getOres(prefixes + s).get(j); - ItemStack replacement = werkstoff.get(prefixes); - if (GT_Utility.areStacksEqual(toReplace,replacement) || replacement == null || replacement.getItem() == null) - continue; - if (toReplace != null) { - for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - HashSet toRem = new HashSet<>(); - for (GT_Recipe recipe : map.mRecipeList) { - boolean removal = map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes); - for (int i = 0; i < recipe.mInputs.length; i++) { - if (GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) { - if (removal) - toRem.add(recipe); - else { - int amount = recipe.mInputs[i].stackSize; - recipe.mInputs[i] = replacement.splitStack(amount); + for (OrePrefixes prefixes : OrePrefixes.values()) { + if (OreDictionary.getOres(prefixes + s).size() > 1) { + for (int j = 0; j < OreDictionary.getOres(prefixes + s).size(); j++) { + ItemStack toReplace = OreDictionary.getOres(prefixes + s).get(j); + ItemStack replacement = werkstoff.get(prefixes); + if (GT_Utility.areStacksEqual(toReplace, replacement) || replacement == null || replacement.getItem() == null) + continue; + if (toReplace != null) { + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + HashSet toRem = new HashSet<>(); + for (GT_Recipe recipe : map.mRecipeList) { + boolean removal = map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes); + for (int i = 0; i < recipe.mInputs.length; i++) { + if (GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) { + if (removal) + toRem.add(recipe); + else { + int amount = recipe.mInputs[i].stackSize; + recipe.mInputs[i] = replacement.splitStack(amount); + } } } - } - for (int i = 0; i < recipe.mOutputs.length; i++) { - if (GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) { - if (removal) - toRem.add(recipe); - else { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = replacement.splitStack(amount); + for (int i = 0; i < recipe.mOutputs.length; i++) { + if (GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) { + if (removal) + toRem.add(recipe); + else { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = replacement.splitStack(amount); + } } } - } - if (recipe.mSpecialItems instanceof ItemStack) { - if (GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) { - if (removal) - toRem.add(recipe); - else { - int amount = ((ItemStack) recipe.mSpecialItems).stackSize; - recipe.mSpecialItems = replacement.splitStack(amount); + if (recipe.mSpecialItems instanceof ItemStack) { + if (GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) { + if (removal) + toRem.add(recipe); + else { + int amount = ((ItemStack) recipe.mSpecialItems).stackSize; + recipe.mSpecialItems = replacement.splitStack(amount); + } } } } + map.mRecipeList.removeAll(toRem); } - map.mRecipeList.removeAll(toRem); } } } } - } } } } @SuppressWarnings("ALL") - private static void runMoltenUnificationEnfocement(Werkstoff werkstoff){ + private static void runMoltenUnificationEnfocement(Werkstoff werkstoff) { if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.getGenerationFeatures().hasMolten()) { try { FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), werkstoff.get(cellMolten), Materials.Empty.getCells(1)); @@ -415,26 +415,26 @@ public final class MainMod { for (OrePrefixes prefixes : OrePrefixes.values()) if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) != 0 && ((werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0)) { - GT_OreDictUnificator.set(prefixes,werkstoff.getBridgeMaterial(),werkstoff.get(prefixes),true,true); + GT_OreDictUnificator.set(prefixes, werkstoff.getBridgeMaterial(), werkstoff.get(prefixes), true, true); for (ItemStack stack : OreDictionary.getOres(prefixes + werkstoff.getVarName())) { - GT_OreDictUnificator.addAssociation(prefixes,werkstoff.getBridgeMaterial(),stack,false); + GT_OreDictUnificator.addAssociation(prefixes, werkstoff.getBridgeMaterial(), stack, false); GT_OreDictUnificator.getAssociation(stack).mUnificationTarget = werkstoff.get(prefixes); } } } - private static ArrayListMultimap getRecipesToChange(SubTag... GasTags){ + private static ArrayListMultimap getRecipesToChange(SubTag... GasTags) { Iterator it = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.iterator(); - ArrayListMultimap toAdd = ArrayListMultimap.create(); + ArrayListMultimap toAdd = ArrayListMultimap.create(); while (it.hasNext()) { GT_Recipe recipe = it.next(); if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) { String FluidString = recipe.mFluidInputs[0].getFluid().getName().replaceAll("molten", "").replaceAll("fluid", ""); Materials mat = Materials.get(FluidString.substring(0, 1).toUpperCase() + FluidString.substring(1)); if (mat != Materials._NULL) { - for (SubTag tag : GasTags){ + for (SubTag tag : GasTags) { if (mat.contains(tag)) { - DebugLog.log("Found EBF Recipe to change, Output:"+ BW_Util.translateGTItemStack(recipe.mOutputs[0])); + DebugLog.log("Found EBF Recipe to change, Output:" + BW_Util.translateGTItemStack(recipe.mOutputs[0])); toAdd.put(tag, recipe); } } @@ -444,10 +444,10 @@ public final class MainMod { return toAdd; } - private static HashSet getNoGasItems(ArrayListMultimap base){ + private static HashSet getNoGasItems(ArrayListMultimap base) { Iterator it = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.iterator(); HashSet toAdd = new HashSet<>(); - ArrayListMultimap repToAdd = ArrayListMultimap.create(); + ArrayListMultimap repToAdd = ArrayListMultimap.create(); while (it.hasNext()) { GT_Recipe recipe = it.next(); for (SubTag tag : base.keySet()) @@ -457,7 +457,7 @@ public final class MainMod { for (int i = 0; i < recipe.mInputs.length; i++) { if ((recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) && BW_Util.checkStackAndPrefix(recipe.mInputs[i]) && BW_Util.checkStackAndPrefix(baseRe.mInputs[i]) && GT_OreDictUnificator.getAssociation(recipe.mInputs[i]).mMaterial.mMaterial.equals(GT_OreDictUnificator.getAssociation(baseRe.mInputs[i]).mMaterial.mMaterial) && GT_Utility.areStacksEqual(recipe.mOutputs[0], baseRe.mOutputs[0])) { toAdd.add(recipe.mOutputs[0]); - repToAdd.put(tag,recipe); + repToAdd.put(tag, recipe); continue recipeLoop; } } @@ -467,7 +467,7 @@ public final class MainMod { return toAdd; } - private static void editRecipes(ArrayListMultimap base, HashSet noGas) { + private static void editRecipes(ArrayListMultimap base, HashSet noGas) { if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeFluidNameMap.contains(Objects.requireNonNull(fluids.get(Oganesson)).getName())) return; HashSet toAdd = new HashSet<>(); @@ -480,13 +480,13 @@ public final class MainMod { for (Werkstoff werkstoff : Werkstoff.werkstoffHashMap.values()) { if (!werkstoff.contains(GasTag)) continue; - int time = (int) ((double) recipe.mDuration / 200D * (200D + (werkstoff.getStats().getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) werkstoff.getStats().getProtons() : (double) mat.getProtons()*2.75D - (double) werkstoff.getStats().getProtons()))); + int time = (int) ((double) recipe.mDuration / 200D * (200D + (werkstoff.getStats().getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) werkstoff.getStats().getProtons() : (double) mat.getProtons() * 2.75D - (double) werkstoff.getStats().getProtons()))); toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); } for (Materials materials : Materials.values()) { if (!materials.contains(GasTag)) continue; - int time = (int) ((double) recipe.mDuration / 200D * (200D + (materials.getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) materials.getProtons() : (double) mat.getProtons()*2.75D - (double) materials.getProtons()))); + int time = (int) ((double) recipe.mDuration / 200D * (200D + (materials.getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) materials.getProtons() : (double) mat.getProtons() * 2.75D - (double) materials.getProtons()))); toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{materials.getGas(recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); } for (ItemStack is : noGas) { @@ -510,17 +510,17 @@ public final class MainMod { GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.removeAll(base.get(GasTag)); } HashSet duplicates = new HashSet<>(); - for (GT_Recipe recipe : toAdd){ - for (GT_Recipe recipe2 : toAdd){ + for (GT_Recipe recipe : toAdd) { + for (GT_Recipe recipe2 : toAdd) { if (recipe.mEUt != recipe2.mEUt || recipe.mDuration != recipe2.mDuration || recipe.mSpecialValue != recipe2.mSpecialValue || recipe == recipe2 || recipe.mInputs.length != recipe2.mInputs.length || recipe.mFluidInputs.length != recipe2.mFluidInputs.length) continue; boolean isSame = true; for (int i = 0; i < recipe.mInputs.length; i++) { - if (!GT_Utility.areStacksEqual(recipe.mInputs[i],recipe2.mInputs[i])) + if (!GT_Utility.areStacksEqual(recipe.mInputs[i], recipe2.mInputs[i])) isSame = false; } for (int i = 0; i < recipe.mFluidInputs.length; i++) { - if (!GT_Utility.areFluidsEqual(recipe.mFluidInputs[i],recipe2.mFluidInputs[i])) + if (!GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], recipe2.mFluidInputs[i])) isSame = false; } if (isSame) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java index d50511337d..0e2121a0ae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java @@ -72,9 +72,8 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { } BW_MetaGenerated_Block_TE tTileEntity = (BW_MetaGenerated_Block_TE) aWorld.getTileEntity(aX, aY, aZ); tTileEntity.mMetaData = tDamage; - } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, 0, 3)) { + } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, 0, 3)) return false; - } if (aWorld.getBlock(aX, aY, aZ) == this.field_150939_a) { this.field_150939_a.onBlockPlacedBy(aWorld, aX, aY, aZ, aPlayer, aStack); this.field_150939_a.onPostBlockPlaced(aWorld, aX, aY, aZ, tDamage); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java index 1b3a645e5c..154efe029a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java @@ -48,12 +48,11 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { this.setResistance(5.0F); this.setBlockTextureName("stone"); this.setCreativeTab(metaTab); - for (Werkstoff w : Werkstoff.werkstoffHashSet) - doRegistrationStuff(w); + Werkstoff.werkstoffHashSet.forEach(this::doRegistrationStuff); } @SideOnly(Side.CLIENT) - public final BW_MetaGenerated_Block_TE getProperTileEntityForRendering(){ + public final BW_MetaGenerated_Block_TE getProperTileEntityForRendering() { return (BW_MetaGenerated_Block_TE) createNewTileEntity(null,0); } @@ -69,9 +68,8 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { } public int getRenderType() { - if (BW_Renderer_Block_Ores.INSTANCE == null) { + if (BW_Renderer_Block_Ores.INSTANCE == null) return super.getRenderType(); - } return BW_Renderer_Block_Ores.INSTANCE.mRenderID; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index dc4bc47673..7cea9d0588 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -45,12 +45,13 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { super(p_i45386_1_, tileEntity, blockName); } - protected void doRegistrationStuff(Werkstoff w){ + protected void doRegistrationStuff(Werkstoff w) { if (w != null) { if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0 || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) return; GT_ModHandler.addValuableOre(this, w.getmID(), 1); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", w.getDefaultName() + OrePrefixes.ore.mLocalizedMaterialPost); + } } @@ -113,7 +114,7 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { } @SuppressWarnings("unused") - private boolean checkForAir(IBlockAccess aWorld, int aX, int aY, int aZ){ + private boolean checkForAir(IBlockAccess aWorld, int aX, int aY, int aZ) { for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { for (int z = -1; z <= 1; z++) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 361648f276..4ffade4528 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -46,111 +46,73 @@ import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import java.util.HashSet; -import java.util.Iterator; public class CircuitImprintLoader { - public static final ArrayListMultimap recipeTagMap = ArrayListMultimap.create(); - - static final HashBiMap bwCircuitTagMap = HashBiMap.create(20); public static short reverseIDs = Short.MAX_VALUE-1; - public static HashBiMap circuitIIconRefs = HashBiMap.create(20); - -// /** -// * stack is assumed valid -// **/ -// private static NBTTagCompound getUniqueIdentifierFromStack(ItemStack stack){ -// NBTTagCompound tagCompound = new NBTTagCompound(); -// tagCompound.setString("Name", stack.getUnlocalizedName()); -// tagCompound.setString("ODName", OreDictionary.getOreName(OreDictionary.getOreID(stack))); -// tagCompound.setShort("Damage", (short)stack.getItemDamage()); -// -// return tagCompound; -// } -// -// private static ItemStack getStackFromUniqueIdentifier(NBTTagCompound tagCompound){ -// return OreDictionary.getOres(tagCompound.getString("ODName")).stream().filter( -// e -> -// e.getItemDamage() == tagCompound.getShort("Damage") -// && e.getUnlocalizedName().equals(tagCompound.getString("Name")) -// -// ).findFirst().orElse(null); -// } - - public static NBTTagCompound getTagFromStack(ItemStack stack){ - if (GT_Utility.isStackValid(stack)) - return stack.copy().splitStack(1).writeToNBT(new NBTTagCompound()); - return new NBTTagCompound(); - } - public static ItemStack getStackFromTag(NBTTagCompound tagCompound){ - return ItemStack.loadItemStackFromNBT(tagCompound); - } + public static final ArrayListMultimap recipeTagMap = ArrayListMultimap.create(); + public static final HashBiMap circuitIIconRefs = HashBiMap.create(20); + public static final HashSet blacklistSet = new HashSet<>(); + static final HashBiMap bwCircuitTagMap = HashBiMap.create(20); + private static final HashSet recipeWorldCache = new HashSet<>(); + private static final HashSet gtrecipeWorldCache = new HashSet<>(); public static void run() { - boolean newServer = false; - if (BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).mRecipeList.size() > 0){ - BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).mRecipeList.clear(); - recipeTagMap.clear(); - newServer = true; - } - - Iterator it = GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.iterator(); - GT_Recipe circuitRecipe; - HashSet toRem = new HashSet<>(); HashSet toAdd = new HashSet<>(); - while (it.hasNext()) { - circuitRecipe = it.next(); - - ItemStack[] outputs = circuitRecipe.mOutputs; - - if (outputs.length < 1) - continue; - - int[] oreIDS = OreDictionary.getOreIDs(outputs[0]); - - if (oreIDS.length < 1) - continue; - - String name = OreDictionary.getOreName(oreIDS[0]); - - if (name.contains("Circuit") || name.contains("circuit")) { - - CircuitImprintLoader.recipeTagMap.put(CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); + boolean newServer = checkAndDeleteCALRecipes(); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.forEach(e -> CircuitImprintLoader.handleCircuitRecipeRebuilding(e, toRem, toAdd)); + exchangeRecipesInList(toRem,toAdd,newServer); + makeCircuitImprintRecipes(newServer); + } - if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))) { + private static void handleCircuitRecipeRebuilding(GT_Recipe circuitRecipe, HashSet toRem, HashSet toAdd) { + ItemStack[] outputs = circuitRecipe.mOutputs; + String name = getTypeFromOreDict(outputs); - GT_Recipe newRecipe = CircuitImprintLoader.reBuildRecipe(circuitRecipe); + if (name.contains("Circuit") || name.contains("circuit")) { - if (newRecipe != null) - BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(newRecipe); + CircuitImprintLoader.recipeTagMap.put(CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); - if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) { - toRem.add(circuitRecipe); - toAdd.add(CircuitImprintLoader.makeMoreExpensive(circuitRecipe)); - } + if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))) { + GT_Recipe newRecipe = CircuitImprintLoader.reBuildRecipe(circuitRecipe); + if (newRecipe != null) + BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(newRecipe); + addCutoffRecipeToSets(toRem,toAdd,circuitRecipe); + } else { + if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) + toRem.add(circuitRecipe); + } + } + } - } else { + private static String getTypeFromOreDict(ItemStack[] outputs) { + int[] oreIDS = OreDictionary.getOreIDs(outputs[0]); - if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) - toRem.add(circuitRecipe); + if (oreIDS.length < 1) + return ""; - } - } - } + return OreDictionary.getOreName(oreIDS[0]); + } + private static void exchangeRecipesInList(HashSet toRem, HashSet toAdd, boolean newServer) { if (!newServer) { GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.addAll(toAdd); GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(toRem); } + } - makeCircuitImprintRecipes(); + private static void addCutoffRecipeToSets(HashSet toRem, HashSet toAdd, GT_Recipe circuitRecipe) { + if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) { + toRem.add(circuitRecipe); + toAdd.add(CircuitImprintLoader.makeMoreExpensive(circuitRecipe)); + } } @SuppressWarnings("deprecation") - public static GT_Recipe makeMoreExpensive(GT_Recipe original){ + public static GT_Recipe makeMoreExpensive(GT_Recipe original) { GT_Recipe newRecipe = original.copy(); for (ItemStack is : newRecipe.mInputs){ int[] oreIDs = OreDictionary.getOreIDs(is); @@ -165,51 +127,71 @@ public class CircuitImprintLoader { return newRecipe; } - @SuppressWarnings("deprecation") - public static GT_Recipe reBuildRecipe(GT_Recipe original){ - ItemStack out = original.copy().getOutput(0); - out.stackSize *= 16; - ItemStack[] in = new ItemStack[6]; - BiMap inversed = CircuitImprintLoader.circuitIIconRefs.inverse(); - for (int i = 0; i < 6; i++) { - try { - for (ItemList il : inversed.keySet()){ - if (GT_Utility.areStacksEqual(il.get(1), original.mInputs[i])) { - in[i] = BW_Meta_Items.getNEWCIRCUITS().getStack(inversed.get(il), original.mInputs[i].stackSize); - } + public static GT_Recipe reBuildRecipe(GT_Recipe original) { + ItemStack[] in = new ItemStack[6]; + BiMap inversed = CircuitImprintLoader.circuitIIconRefs.inverse(); + + for (int i = 0; i < 6; i++) { + try { + replaceCircuits(inversed,original,in,i); + replaceComponents(in,original,i); + } catch (ArrayIndexOutOfBoundsException e) { + break; + } catch (NullPointerException e) { + e.printStackTrace(); + } + } - } - if (original.mInputs[i] != null && in[i] == null){ - if (BW_Util.checkStackAndPrefix(original.mInputs[i]) && GT_OreDictUnificator.getAssociation(original.mInputs[i]).mPrefix == OrePrefixes.wireGt01){ - in[i] = GT_OreDictUnificator.get(OrePrefixes.wireGt16,GT_OreDictUnificator.getAssociation(original.mInputs[i]).mMaterial.mMaterial,original.mInputs[i].stackSize); - } - else if (BW_Util.checkStackAndPrefix(original.mInputs[i]) && GT_OreDictUnificator.getAssociation(original.mInputs[i]).mPrefix == OrePrefixes.wireFine){ - in[i] = GT_OreDictUnificator.get(OrePrefixes.wireGt04,GT_OreDictUnificator.getAssociation(original.mInputs[i]).mMaterial.mMaterial,original.mInputs[i].stackSize); - } - else { - in[i] = original.mInputs[i].copy(); - in[i].stackSize *= 16; - if (in[i].stackSize > in[i].getItem().getItemStackLimit() || in[i].stackSize > in[i].getMaxStackSize()) - in[i].stackSize = in[i].getMaxStackSize(); - } -// if (in[i].stackSize > 64) -// return null; - } - } catch (ArrayIndexOutOfBoundsException e){ - break; - } catch (NullPointerException e){ - e.printStackTrace(); - } + if (CircuitImprintLoader.checkForBlacklistedComponents(in)) { + return null; } - if (CircuitImprintLoader.checkForBlacklistedComponents(in)){ - return null; + + return new BWRecipes.DynamicGTRecipe(false, in, new ItemStack[]{getOutputMultiplied(original)}, BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]), 0, 0), null, original.mFluidInputs, null, original.mDuration * 16, original.mEUt, 0); + } + + private static ItemStack getOutputMultiplied(GT_Recipe original){ + ItemStack out = original.copy().getOutput(0); + out.stackSize *= 16; + return out; + } + + private static void replaceCircuits(BiMap inversed, GT_Recipe original, ItemStack[] in, int index){ + for (ItemList il : inversed.keySet()) { + if (GT_Utility.areStacksEqual(il.get(1), original.mInputs[index])) { + in[index] = BW_Meta_Items.getNEWCIRCUITS().getStack(inversed.get(il), original.mInputs[index].stackSize); + } } - return new BWRecipes.DynamicGTRecipe(false,in,new ItemStack[]{out},BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]),0,0),null, original.mFluidInputs,null,original.mDuration * 16,original.mEUt,0); } - public static final HashSet blacklistSet = new HashSet<>(); + @SuppressWarnings("deprecation") + private static void replaceComponents(ItemStack[] in, GT_Recipe original, int index) throws ArrayIndexOutOfBoundsException { + if (original.mInputs[index] != null && in[index] == null) { + //big wires + if (BW_Util.checkStackAndPrefix(original.mInputs[index]) && GT_OreDictUnificator.getAssociation(original.mInputs[index]).mPrefix == OrePrefixes.wireGt01) { + in[index] = GT_OreDictUnificator.get(OrePrefixes.wireGt16, GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, original.mInputs[index].stackSize); + //fine wires + } else if (BW_Util.checkStackAndPrefix(original.mInputs[index]) && GT_OreDictUnificator.getAssociation(original.mInputs[index]).mPrefix == OrePrefixes.wireFine) { + in[index] = GT_OreDictUnificator.get(OrePrefixes.wireGt04, GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, original.mInputs[index].stackSize); + //other components + } else { + in[index] = original.mInputs[index].copy(); + in[index].stackSize *= 16; + if (in[index].stackSize > in[index].getItem().getItemStackLimit() || in[index].stackSize > in[index].getMaxStackSize()) + in[index].stackSize = in[index].getMaxStackSize(); + } + } + } - private static boolean checkForBlacklistedComponents(ItemStack[] itemStacks){ + private static void makeCircuitImprintRecipes(boolean newServer) { + if (newServer) + removeOldRecipesFromRegistries(); + CircuitImprintLoader.recipeTagMap.keySet().forEach(e -> { + makeAndAddSlicingRecipe(e); + makeAndAddCraftingRecipes(e); + }); + } + + private static boolean checkForBlacklistedComponents(ItemStack[] itemStacks) { for (ItemStack is: itemStacks){ for (ItemStack is2 : CircuitImprintLoader.blacklistSet){ if (GT_Utility.areStacksEqual(is,is2)) @@ -219,10 +201,7 @@ public class CircuitImprintLoader { return false; } - private static HashSet recipeWorldCache = new HashSet<>(); - private static HashSet gtrecipeWorldCache = new HashSet<>(); - - private static void removeOldRecipesFromRegistries(){ + private static void removeOldRecipesFromRegistries() { recipeWorldCache.forEach(CraftingManager.getInstance().getRecipeList()::remove); BWCoreStaticReplacementMethodes.RECENTLYUSEDRECIPES.clear(); gtrecipeWorldCache.forEach(GT_Recipe.GT_Recipe_Map.sSlicerRecipes.mRecipeList::remove); @@ -239,34 +218,59 @@ public class CircuitImprintLoader { gtrecipeWorldCache.clear(); } - private static void makeCircuitImprintRecipes() { + private static void makeAndAddSlicingRecipe(NBTTagCompound tag) { + ItemStack stack = CircuitImprintLoader.getStackFromTag(tag); + int eut = Integer.MAX_VALUE; - removeOldRecipesFromRegistries(); + for (GT_Recipe recipe : CircuitImprintLoader.recipeTagMap.get(tag)) { + eut = Math.min(eut, recipe.mEUt); + } + eut = Math.min(eut, BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName(OreDictionary.getOreIDs(stack)[0])))); + GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300,eut, BW_Util.CLEANROOM); + gtrecipeWorldCache.add(slicingRecipe); + GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); + } - for (NBTTagCompound tag : CircuitImprintLoader.recipeTagMap.keySet()){ - ItemStack stack = CircuitImprintLoader.getStackFromTag(tag); - int eut = Integer.MAX_VALUE; + private static void makeAndAddCraftingRecipes(NBTTagCompound tag) { + ItemStack circuit = BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1); + Object[] imprintRecipe = { + " X ", + "GPG", + " X ", + 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), + 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), + 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3) + }; + + IRecipe bwrecipe = new BWRecipes.BWNBTDependantCraftingRecipe(circuit,imprintRecipe); + ShapedOreRecipe gtrecipe = BW_Util.createGTCraftingRecipe(circuit, GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED, imprintRecipe); + + //Adds the actual recipe + recipeWorldCache.add(bwrecipe); + GameRegistry.addRecipe(bwrecipe); + //Adds the NEI visual recipe + recipeWorldCache.add(gtrecipe); + GameRegistry.addRecipe(gtrecipe); + } - for (GT_Recipe recipe : CircuitImprintLoader.recipeTagMap.get(tag)) { - eut = Math.min(eut, recipe.mEUt); - } + public static NBTTagCompound getTagFromStack(ItemStack stack) { + if (GT_Utility.isStackValid(stack)) + return stack.copy().splitStack(1).writeToNBT(new NBTTagCompound()); + return new NBTTagCompound(); + } - eut = Math.min(eut, BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName(OreDictionary.getOreIDs(stack)[0])))); - GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300,eut, BW_Util.CLEANROOM); - gtrecipeWorldCache.add(slicingRecipe); - GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); - - ShapedOreRecipe gtrecipe = BW_Util.createGTCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{ - " X ", - "GPG", - " X ", - 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), - 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), - 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3)}); - recipeWorldCache.add(gtrecipe); - GameRegistry.addRecipe(gtrecipe); + public static ItemStack getStackFromTag(NBTTagCompound tagCompound) { + return ItemStack.loadItemStackFromNBT(tagCompound); + } + private static boolean checkAndDeleteCALRecipes() { + boolean newServer = false; + if (BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).mRecipeList.size() > 0){ + BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).mRecipeList.clear(); + recipeTagMap.clear(); + newServer = true; } - + return newServer; } + } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 7f960e8258..ec43fce23c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1356,7 +1356,7 @@ public class WerkstoffLoader implements Runnable { return WerkstoffLoader.getCorrespondingItemStack(orePrefixes, werkstoff, 1); } - public static ItemStack getCorrespondingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { + private static ItemStack getCorrespondingItemStackUnsafe(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount){ if (!werkstoff.getGenerationFeatures().enforceUnification) { ItemStack ret = OreDictHandler.getItemStack(werkstoff.getVarName(), orePrefixes, amount); if (ret != null) @@ -1369,6 +1369,15 @@ public class WerkstoffLoader implements Runnable { else if (orePrefixes == block) return new ItemStack(WerkstoffLoader.BWBlocks,amount,werkstoff.getmID()); else if (WerkstoffLoader.items.get(orePrefixes) == null) + return null; + return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); + } + + public static ItemStack getCorrespondingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { + ItemStack stack = getCorrespondingItemStackUnsafe(orePrefixes, werkstoff, amount); + if (stack != null) + return stack; + else MainMod.LOGGER.catching(Level.ERROR,new Exception("NO SUCH ITEM! "+orePrefixes+werkstoff.getVarName() +" If you encounter this as a user, make sure to contact the authors of the pack/the mods you're playing! " + "If you are a Developer, you forgot to enable "+orePrefixes+" OrePrefix for Werkstoff "+werkstoff.getDefaultName())); return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); @@ -1640,11 +1649,10 @@ public class WerkstoffLoader implements Runnable { } private static void runGTItemDataRegistrator() { - // HashSet toRem = new HashSet<>(); for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { //int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, String aConfigSection, boolean aCustomOre, String aCustomID Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : - new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(),0, werkstoff.getRGBA()[0],werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getVarName(), werkstoff.getDefaultName(),0,0,werkstoff.getStats().meltingPoint,werkstoff.getStats().meltingPoint,werkstoff.getStats().isBlastFurnace(),false,0,1,1,null); + new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(), 0, werkstoff.getRGBA()[0], werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getVarName(), werkstoff.getDefaultName(), 0, 0, werkstoff.getStats().meltingPoint, werkstoff.getStats().meltingPoint, werkstoff.getStats().isBlastFurnace(), false, 0, 1, 1, null); for (OrePrefixes prefixes : values()) { if (!(prefixes == cell && werkstoff.getType().equals(Werkstoff.Types.ELEMENT))) { if (prefixes == dust && werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { @@ -1655,7 +1663,7 @@ public class WerkstoffLoader implements Runnable { if (e.mLinkedMaterials.size() > 0) break; werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : - new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(),0, werkstoff.getRGBA()[0],werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getVarName(), werkstoff.getDefaultName(),0,0,werkstoff.getStats().meltingPoint,werkstoff.getStats().meltingPoint,werkstoff.getStats().isBlastFurnace(),false,0,1,1,null); + new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(), 0, werkstoff.getRGBA()[0], werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getVarName(), werkstoff.getDefaultName(), 0, 0, werkstoff.getStats().meltingPoint, werkstoff.getStats().meltingPoint, werkstoff.getStats().isBlastFurnace(), false, 0, 1, 1, null); werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials = new ArrayList<>(); e.mLinkedMaterials.add(werkstoffBridgeMaterial); @@ -1693,6 +1701,7 @@ public class WerkstoffLoader implements Runnable { werkstoffBridgeMaterial.mFluid = werkstoff.getFluidOrGas(1).getFluid(); werkstoffBridgeMaterial.mGas = werkstoff.getFluidOrGas(1).getFluid(); } + if (werkstoff.getGenerationFeatures().hasMolten()) { werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid(); } @@ -1701,33 +1710,74 @@ public class WerkstoffLoader implements Runnable { try { Field f = Materials.class.getField("mLocalizedName"); f.set(werkstoffBridgeMaterial, werkstoff.getDefaultName()); - } catch (NoSuchFieldException | IllegalAccessException ignored){} + } catch (NoSuchFieldException | IllegalAccessException ignored) { + } werkstoffBridgeMaterial.mChemicalFormula = werkstoff.getToolTip(); if (Loader.isModLoaded("Thaumcraft")) werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects(); werkstoffBridgeMaterial.mMaterialInto = werkstoffBridgeMaterial; werkstoffBridgeMaterial.mHandleMaterial = werkstoff.contains(SubTag.BURNING) ? Materials.Blaze : werkstoff.contains(SubTag.MAGICAL) ? Materials.Thaumium : werkstoffBridgeMaterial.mDurability > 5120 ? Materials.TungstenSteel : werkstoffBridgeMaterial.mDurability > 1280 ? Materials.Steel : Materials.Wood; - //toRem.add(werkstoffBridgeMaterial); - if (werkstoff.getStats().isRadioactive()){ - werkstoffBridgeMaterial.setEnchantmentForArmors(Enchantment_Radioactivity.INSTANCE,werkstoff.getStats().getEnchantmentlvl()); - werkstoffBridgeMaterial.setEnchantmentForTools(Enchantment_Radioactivity.INSTANCE,werkstoff.getStats().getEnchantmentlvl()); + if (werkstoff.getStats().isRadioactive()) { + werkstoffBridgeMaterial.setEnchantmentForArmors(Enchantment_Radioactivity.INSTANCE, werkstoff.getStats().getEnchantmentlvl()); + werkstoffBridgeMaterial.setEnchantmentForTools(Enchantment_Radioactivity.INSTANCE, werkstoff.getStats().getEnchantmentlvl()); } werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); - if (WerkstoffLoader.items.get(prefixes) != null) - if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0 && werkstoff.get(prefixes) != null && werkstoff.get(prefixes).getItem() != null) - GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, werkstoff.get(prefixes), false); + //if (WerkstoffLoader.items.get(prefixes) != null) } } } -// try { -// Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); -// f.setAccessible(true); -// Map MATERIALS_MAP = (Map) f.get(null); -// for (Materials o : toRem) -// MATERIALS_MAP.remove(o.mName); -// } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { -// e.printStackTrace(); -// } + addAssociationToItems(); + addFakeItemDataToInWorldBlocksAndCleanUpFakeData(); + } + + public static void addAssociationToItems() { + Arrays.stream(values()).forEach( prefixes -> { + Werkstoff.werkstoffHashSet.stream() + .filter(werkstoff -> werkstoff.hasItemType(prefixes) && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0) + .forEach(werkstoff -> { + Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial(); + ItemStack stack = WerkstoffLoader.getCorrespondingItemStackUnsafe(prefixes, werkstoff, 1); + if (stack != null && stack.getItem() != null) { + GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, stack, false); + GT_OreDictUnificator.set(prefixes, werkstoffBridgeMaterial, stack, true, true); + } + }); + }); + } + + /** + * very hacky way to make my ores/blocks/smallores detectable by gt assosication in world, well at least the prefix. + * used for the miners mostly + * removing this hacky material from the materials map instantly. we only need the item data. + */ + private static void addFakeItemDataToInWorldBlocksAndCleanUpFakeData() { + + Map MATERIALS_MAP = null; + + try { + Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); + f.setAccessible(true); + MATERIALS_MAP = (Map) f.get(null); + } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { + e.printStackTrace(); + } + + if (MATERIALS_MAP == null) + throw new NullPointerException("MATERIALS_MAP null!"); + + Materials oreMat = new Materials(-1,null,0,0,0,false,"bwores","bwores",null,true,null); + Materials smallOreMat = new Materials(-1,null,0,0,0,false,"bwsmallores","bwsmallores",null,true,null); + Materials blockMat = new Materials(-1,null,0,0,0,false,"bwblocks","bwblocks",null,true,null); + + for (int i = 0; i < 16; i++) { + GT_OreDictUnificator.addAssociation(ore, oreMat, new ItemStack(BWOres,1,i), true); + GT_OreDictUnificator.addAssociation(oreSmall, smallOreMat, new ItemStack(BWSmallOres,1,i), true); + GT_OreDictUnificator.addAssociation(block, blockMat, new ItemStack(BWBlocks,1,i), true); + } + + MATERIALS_MAP.remove("bwores"); + MATERIALS_MAP.remove("bwsmallores"); + MATERIALS_MAP.remove("bwblocks"); } private void addTools(Werkstoff werkstoff){ @@ -1834,8 +1884,8 @@ public class WerkstoffLoader implements Runnable { if (werkstoff.getGenerationFeatures().hasOres()) { GT_OreDictUnificator.registerOre(ore + werkstoff.getVarName(), werkstoff.get(ore)); GT_OreDictUnificator.registerOre(oreSmall + werkstoff.getVarName(), werkstoff.get(oreSmall)); - werkstoff.getADDITIONAL_OREDICT().forEach( e -> OreDictionary.registerOre(ore+e, werkstoff.get(ore))); - werkstoff.getADDITIONAL_OREDICT().forEach( e -> OreDictionary.registerOre(oreSmall+e, werkstoff.get(oreSmall))); + werkstoff.getADDITIONAL_OREDICT().forEach( e -> OreDictionary.registerOre(ore+e, werkstoff.get(ore))); + werkstoff.getADDITIONAL_OREDICT().forEach( e -> OreDictionary.registerOre(oreSmall+e, werkstoff.get(oreSmall))); } if (werkstoff.getGenerationFeatures().hasGems()) @@ -1850,7 +1900,7 @@ public class WerkstoffLoader implements Runnable { .forEach(s -> ENABLED_ORE_PREFIXES .stream() .filter(o -> Objects.nonNull(werkstoff.get(o))) - .forEach( od -> OreDictionary.registerOre(od+s, werkstoff.get(od)))); + .forEach(od -> OreDictionary.registerOre(od+s, werkstoff.get(od)))); } GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java index 2b740e35d5..faa06e135d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java @@ -72,5 +72,8 @@ public class NEIbartworksConfig implements IConfigureNEI { stack.setItemDamage(Short.MAX_VALUE); API.hideItem(stack); } +// for (int i = 0; i < Short.MAX_VALUE; i++) { +// API.addItemListEntry(new ItemStack(WerkstoffLoader.BWOres,1,i)); +// } } } \ No newline at end of file -- cgit From f2253dc634d3bb222fc1b7e52f859a43e99c7393 Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Tue, 7 Jan 2020 21:11:50 +0100 Subject: possible ix of OC Adapter recipe don't work #5220 https://github.com/GTNewHorizons/NewHorizons/issues/5220 add circuit 16 to wrap of circuit recipe Former-commit-id: 78a293458ccbf73b2a5b1e6c80a5ad3a62284b68 --- .../bartworks/system/material/CircuitGeneration/CircuitPartLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index c72c7acebc..79ee9d697a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -91,7 +91,7 @@ public class CircuitPartLoader implements Runnable { // tt += "Internal Name = "+single; String localised = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); BW_Meta_Items.getNEWCIRCUITS().addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised+"s", tt); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{single.get(16).copy()}, Materials.Plastic.getMolten(72),BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs),600,30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{single.get(16).copy(), GT_Utility.getIntegratedCircuit(16)}, Materials.Plastic.getMolten(72),BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs),600,30); CircuitImprintLoader.circuitIIconRefs.put(CircuitImprintLoader.reverseIDs,single); CircuitImprintLoader.reverseIDs--; } -- cgit From a0782b97055efc31016b18ac6a495c9d0372f815 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 15 Jan 2020 14:55:05 +0100 Subject: fixed rejoin issues + made circuit assembler recipes get readded if server is switched and re-calcuted + added a command to clear the crafting cache + made the NEI OreHandler more stable + worked a bit on implementing the APL + version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: f784e1ce2c2486f002d21f407010c87a41688f62 --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 2 + .../common/commands/ClearCraftingCache.java | 46 ++++++++++++++++++++ .../bartworks/neiHandler/BW_NEI_OreHandler.java | 25 +++++++---- .../CircuitGeneration/CircuitImprintLoader.java | 49 +++++++++++++--------- .../accessprioritylist/AccessPriorityList.java | 32 ++++++++++---- .../accessprioritylist/AccessPriorityListNode.java | 6 +++ 7 files changed, 127 insertions(+), 35 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java diff --git a/build.properties b/build.properties index d8837dced6..128bba6264 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=6 +buildNumber=7 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index f1ad6e2b2a..9cb1dffbaf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -32,6 +32,7 @@ import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.common.commands.ChangeConfig; +import com.github.bartimaeusnek.bartworks.common.commands.ClearCraftingCache; import com.github.bartimaeusnek.bartworks.common.commands.PrintRecipeListToFile; import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -206,6 +207,7 @@ public final class MainMod { event.registerServerCommand(new SummonRuin()); event.registerServerCommand(new ChangeConfig()); event.registerServerCommand(new PrintRecipeListToFile()); + event.registerServerCommand(new ClearCraftingCache()); } @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java new file mode 100644 index 0000000000..42385c60f1 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.commands; + +import com.github.bartimaeusnek.ASM.BWCoreStaticReplacementMethodes; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.ChatComponentText; + +public class ClearCraftingCache extends CommandBase { + @Override + public String getCommandName() { + return "bwclr"; + } + + @Override + public String getCommandUsage(ICommandSender p_71518_1_) { + return "bwclr"; + } + + @Override + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + BWCoreStaticReplacementMethodes.RECENTLYUSEDRECIPES.clear(); + p_71515_1_.addChatMessage(new ChatComponentText("Recipe Cache cleared? "+(BWCoreStaticReplacementMethodes.RECENTLYUSEDRECIPES.size() == 0))); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index b23fa6fd0b..902bf6681c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -96,21 +96,30 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public void drawExtras(int recipe) { if ((recipe < this.arecipes.size()) && (this.arecipes.get(recipe) instanceof CachedOreRecipe) ) { CachedOreRecipe cachedOreRecipe = (CachedOreRecipe) this.arecipes.get(recipe); - - GuiDraw.drawString(ChatColorHelper.BOLD + "DIM: " + ChatColorHelper.RESET + cachedOreRecipe.worldGen.getDimName(), 0, 40, 0, false); + if (cachedOreRecipe == null || cachedOreRecipe.getOtherStacks() == null || + cachedOreRecipe.getOtherStacks().get(0) == null || cachedOreRecipe.getOtherStacks().get(1) == null + || cachedOreRecipe.getOtherStacks().get(2) == null || cachedOreRecipe.getOtherStacks().get(3) == null || + cachedOreRecipe.getOtherStacks().get(0).item == null || cachedOreRecipe.getOtherStacks().get(1).item == null + || cachedOreRecipe.getOtherStacks().get(2).item == null || cachedOreRecipe.getOtherStacks().get(3).item == null + ) + return; + if (cachedOreRecipe.worldGen != null) + GuiDraw.drawString(ChatColorHelper.BOLD + "DIM: " + ChatColorHelper.RESET + cachedOreRecipe.worldGen.getDimName(), 0, 40, 0, false); GuiDraw.drawString(ChatColorHelper.BOLD + "Primary:", 0, 50, 0, false); - GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(0).item.getDisplayName(), 0, 60, 0, false); + GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(0).item.getDisplayName(), 0, 60, 0, false); if (!cachedOreRecipe.small) { GuiDraw.drawString(ChatColorHelper.BOLD + "Secondary:", 0, 70, 0, false); - GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(1).item.getDisplayName(), 0, 80, 0, false); + GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(1).item.getDisplayName(), 0, 80, 0, false); GuiDraw.drawString(ChatColorHelper.BOLD + "InBetween:", 0, 90, 0, false); - GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(2).item.getDisplayName(), 0, 100, 0, false); + GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(2).item.getDisplayName(), 0, 100, 0, false); GuiDraw.drawString(ChatColorHelper.BOLD + "Sporadic:", 0, 110, 0, false); - GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(3).item.getDisplayName(), 0, 120, 0, false); + GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(3).item.getDisplayName(), 0, 120, 0, false); } else { - GuiDraw.drawString(ChatColorHelper.BOLD + "Amount per Chunk:",0,70,0,false); - GuiDraw.drawString(((CachedOreRecipe) this.arecipes.get(recipe)).worldGen.mDensity+"",0,80,0, false); + if (cachedOreRecipe.worldGen != null) { + GuiDraw.drawString(ChatColorHelper.BOLD + "Amount per Chunk:", 0, 70, 0, false); + GuiDraw.drawString(cachedOreRecipe.worldGen.mDensity + "", 0, 80, 0, false); + } } } super.drawExtras(recipe); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 4ffade4528..a7823ed112 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -57,21 +57,37 @@ public class CircuitImprintLoader { static final HashBiMap bwCircuitTagMap = HashBiMap.create(20); private static final HashSet recipeWorldCache = new HashSet<>(); private static final HashSet gtrecipeWorldCache = new HashSet<>(); + private static final HashSet ORIGINAL_CAL_RECIPES = new HashSet<>(); + private static final HashSet MODIFIED_CAL_RECIPES = new HashSet<>(); public static void run() { HashSet toRem = new HashSet<>(); HashSet toAdd = new HashSet<>(); - boolean newServer = checkAndDeleteCALRecipes(); + deleteCALRecipesAndTags(); + rebuildCircuitAssemblerMap(toRem,toAdd); + exchangeRecipesInList(toRem,toAdd); + makeCircuitImprintRecipes(); + + toRem = null; + toAdd = null; + } + + private static void reAddOriginalRecipes(){ + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(MODIFIED_CAL_RECIPES); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.addAll(ORIGINAL_CAL_RECIPES); + ORIGINAL_CAL_RECIPES.clear(); + MODIFIED_CAL_RECIPES.clear(); + } + + private static void rebuildCircuitAssemblerMap(HashSet toRem,HashSet toAdd) { + reAddOriginalRecipes(); GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.forEach(e -> CircuitImprintLoader.handleCircuitRecipeRebuilding(e, toRem, toAdd)); - exchangeRecipesInList(toRem,toAdd,newServer); - makeCircuitImprintRecipes(newServer); } private static void handleCircuitRecipeRebuilding(GT_Recipe circuitRecipe, HashSet toRem, HashSet toAdd) { ItemStack[] outputs = circuitRecipe.mOutputs; String name = getTypeFromOreDict(outputs); - if (name.contains("Circuit") || name.contains("circuit")) { CircuitImprintLoader.recipeTagMap.put(CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); @@ -80,7 +96,7 @@ public class CircuitImprintLoader { GT_Recipe newRecipe = CircuitImprintLoader.reBuildRecipe(circuitRecipe); if (newRecipe != null) BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(newRecipe); - addCutoffRecipeToSets(toRem,toAdd,circuitRecipe); + addCutoffRecipeToSets(toRem,toAdd,circuitRecipe); } else { if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) toRem.add(circuitRecipe); @@ -97,11 +113,11 @@ public class CircuitImprintLoader { return OreDictionary.getOreName(oreIDS[0]); } - private static void exchangeRecipesInList(HashSet toRem, HashSet toAdd, boolean newServer) { - if (!newServer) { - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.addAll(toAdd); - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(toRem); - } + private static void exchangeRecipesInList(HashSet toRem, HashSet toAdd) { + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.addAll(toAdd); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(toRem); + ORIGINAL_CAL_RECIPES.addAll(toRem); + MODIFIED_CAL_RECIPES.addAll(toAdd); } private static void addCutoffRecipeToSets(HashSet toRem, HashSet toAdd, GT_Recipe circuitRecipe) { @@ -182,9 +198,8 @@ public class CircuitImprintLoader { } } - private static void makeCircuitImprintRecipes(boolean newServer) { - if (newServer) - removeOldRecipesFromRegistries(); + private static void makeCircuitImprintRecipes() { + removeOldRecipesFromRegistries(); CircuitImprintLoader.recipeTagMap.keySet().forEach(e -> { makeAndAddSlicingRecipe(e); makeAndAddCraftingRecipes(e); @@ -225,6 +240,7 @@ public class CircuitImprintLoader { for (GT_Recipe recipe : CircuitImprintLoader.recipeTagMap.get(tag)) { eut = Math.min(eut, recipe.mEUt); } + eut = Math.min(eut, BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName(OreDictionary.getOreIDs(stack)[0])))); GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300,eut, BW_Util.CLEANROOM); gtrecipeWorldCache.add(slicingRecipe); @@ -263,14 +279,9 @@ public class CircuitImprintLoader { return ItemStack.loadItemStackFromNBT(tagCompound); } - private static boolean checkAndDeleteCALRecipes() { - boolean newServer = false; - if (BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).mRecipeList.size() > 0){ + private static void deleteCALRecipesAndTags() { BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).mRecipeList.clear(); recipeTagMap.clear(); - newServer = true; - } - return newServer; } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java index a1067b051e..4d49e8523f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java @@ -74,12 +74,26 @@ public class AccessPriorityList implements List, Deque, Set { @Override public E removeFirst() { - throw new NotImplementedException(""); + E first = head.getELEMENT(); + AccessPriorityListNode node = head; + head = node.getNext(); + head.setBefore(null); + node.destroy(); + node = null; + this.size--; + return first; } @Override public E removeLast() { - throw new NotImplementedException(""); + E last = tail.getELEMENT(); + AccessPriorityListNode node = tail; + tail = node.getBefore(); + tail.setNext(null); + node.destroy(); + node = null; + this.size--; + return last; } @Override @@ -237,7 +251,7 @@ public class AccessPriorityList implements List, Deque, Set { @Override public E poll() { - throw new NotImplementedException(""); + return removeFirst(); } @Override @@ -257,11 +271,15 @@ public class AccessPriorityList implements List, Deque, Set { @Override public E pop() { - throw new NotImplementedException(""); + return removeFirst(); } @Override public boolean remove(Object o) { +// Object p; +// for (Iterator it = this.iterator(); it.hasNext(); o.equals(p)){ +// p = it.next(); +// } throw new NotImplementedException(""); } @@ -272,9 +290,9 @@ public class AccessPriorityList implements List, Deque, Set { @Override public boolean addAll(Collection c) { - for (E e : c) { - this.addLast(e); - } + if (c == null) + return false; + c.forEach(this::addLast); return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java index b8fd357027..3c0a037a88 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java @@ -72,4 +72,10 @@ public class AccessPriorityListNode { public void setBefore(AccessPriorityListNode before) { this.before = before; } + + void destroy(){ + this.before = null; + this.next = null; + this.priority = 0L; + } } -- cgit From 8ea5589fe926d3ce983eb3087a9fdbec24ba0c7a Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 16 Jan 2020 18:45:58 +0100 Subject: Minor fixes + reworked LuVTierEnhancer + use of isAir() instead of block.equals(air) in base layer check method Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 743bbe8a3cf6847546a69eef2a6777c7947757df --- .../material/GT_Enhancement/LuVTierEnhancer.java | 162 ++++++++++++++------- .../processingLoaders/AfterLuVTierEnhacement.java | 11 +- .../bartimaeusnek/bartworks/util/BW_Util.java | 2 +- 3 files changed, 115 insertions(+), 60 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java index 18651eb7f0..b63d7377b8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AfterLuVTierEnhacement; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -41,9 +42,9 @@ import org.apache.commons.lang3.reflect.MethodUtils; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; +import java.util.*; +import java.util.function.Consumer; +import java.util.function.Predicate; import static gregtech.api.enums.OrePrefixes.*; @@ -51,79 +52,128 @@ import static gregtech.api.enums.OrePrefixes.*; public class LuVTierEnhancer implements Runnable { public void run() { - LuVTierEnhancer.replaceAsslineRecipes(); + List bufferedRecipeList = null; + try { bufferedRecipeList = (List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null); } catch (IllegalAccessException e) { e.printStackTrace(); } - assert bufferedRecipeList != null; HashSet LuVMachines = new HashSet<>(); + LuVMachines.add(ItemRegistry.cal); OrePrefixes[] LuVMaterialsGenerated = {dust, ingot, plate, stick, stickLong, rotor, plateDouble, plateDense}; - for (ItemList item : ItemList.values()) { - if (item.toString().contains("LuV") && item.hasBeenSet()) - LuVMachines.add(item.get(1)); - } + + Arrays.stream(ItemList.values()) + .filter(item -> item.toString().contains("LuV") && item.hasBeenSet()) + .forEach(item -> LuVMachines.add(item.get(1))); + if (Loader.isModLoaded("dreamcraft")) { - try { - Class customItemListClass = Class.forName("com.dreammaster.gthandler.CustomItemList"); - Method hasnotBeenSet = MethodUtils.getAccessibleMethod(customItemListClass, "hasBeenSet"); - Method get = MethodUtils.getAccessibleMethod(customItemListClass, "get", long.class, Object[].class); - for (Enum customItemList : (Enum[]) FieldUtils.getField(customItemListClass, "$VALUES", true).get(null)) { - if (customItemList.toString().contains("LuV") && (boolean) hasnotBeenSet.invoke(customItemList)) - LuVMachines.add((ItemStack) get.invoke(customItemList, 1, new Object[0])); - } - } catch (IllegalAccessException | ClassNotFoundException | InvocationTargetException e) { - e.printStackTrace(); - } + addDreamcraftItemListItems(LuVMachines); } - GT_ModHandler.addCraftingRecipe(ItemList.Casing_LuV.get(1), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, new Object[]{"PPP", "PwP", "PPP", 'P', WerkstoffLoader.LuVTierMaterial.get(plate)}); - for (ItemStack stack : LuVMachines) { - for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - for (GT_Recipe recipe : map.mRecipeList) { - for (OrePrefixes prefixes : LuVMaterialsGenerated) { - if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } - if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } - } - if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - } - if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - } + + GT_ModHandler.addCraftingRecipe(ItemList.Casing_LuV.get(1), + GT_ModHandler.RecipeBits.BUFFERED | + GT_ModHandler.RecipeBits.REVERSIBLE | + GT_ModHandler.RecipeBits.NOT_REMOVABLE | + GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, + new Object[]{ + "PPP", + "PwP", + "PPP", + 'P', WerkstoffLoader.LuVTierMaterial.get(plate) + }); + + replaceAllRecipes(LuVMachines,LuVMaterialsGenerated,bufferedRecipeList); + + AfterLuVTierEnhacement.run(); + } + + private static void replaceAllRecipes(Collection LuVMachines, OrePrefixes[] LuVMaterialsGenerated, List bufferedRecipeList){ + LuVTierEnhancer.replaceOsmiridiumInLuVRecipes(); + LuVMachines.stream().forEach(stack -> { + + Predicate recipeFilter = obj -> obj instanceof GT_Shaped_Recipe && GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true); + + GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.forEach( + recipe -> rewriteAsslineRecipes(stack, LuVMaterialsGenerated, recipe)); + + GT_Recipe.GT_Recipe_Map.sMappings.forEach( + map -> map.mRecipeList.forEach( + recipe -> rewriteMachineRecipes(stack, LuVMaterialsGenerated, recipe))); + + rewriteCraftingRecipes(bufferedRecipeList, LuVMaterialsGenerated, recipeFilter); } + ); + } + + private static void addDreamcraftItemListItems(Collection LuVMachines){ + try { + Class customItemListClass = Class.forName("com.dreammaster.gthandler.CustomItemList"); + Method hasnotBeenSet = MethodUtils.getAccessibleMethod(customItemListClass, "hasBeenSet"); + Method get = MethodUtils.getAccessibleMethod(customItemListClass, "get", long.class, Object[].class); + for (Enum customItemList : (Enum[]) FieldUtils.getField(customItemListClass, "$VALUES", true).get(null)) { + if (customItemList.toString().contains("LuV") && (boolean) hasnotBeenSet.invoke(customItemList)) + LuVMachines.add((ItemStack) get.invoke(customItemList, 1, new Object[0])); } + } catch (IllegalAccessException | ClassNotFoundException | InvocationTargetException e) { + e.printStackTrace(); + } + } + + private static void rewriteCraftingRecipes(List bufferedRecipeList, OrePrefixes[] LuVMaterialsGenerated, Predicate recipeFilter){ + for (OrePrefixes prefixes : LuVMaterialsGenerated) { + + Consumer recipeAction = obj -> LuVTierEnhancer.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(), + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, + WerkstoffLoader.LuVTierMaterial.get(prefixes)); + + CraftingManager.getInstance().getRecipeList().stream().filter(recipeFilter).forEach(recipeAction); + bufferedRecipeList.stream().filter(recipeFilter).forEach(recipeAction); + } + } + + private static void rewriteMachineRecipes(ItemStack stack, OrePrefixes[] LuVMaterialsGenerated, GT_Recipe recipe){ for (OrePrefixes prefixes : LuVMaterialsGenerated) { - for (Object obj : CraftingManager.getInstance().getRecipeList()) { - if (!(obj instanceof GT_Shaped_Recipe)) - continue; - if (GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true)) { - LuVTierEnhancer.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(), GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); } - for (Object obj : bufferedRecipeList) { - if (!(obj instanceof GT_Shaped_Recipe)) - continue; - if (GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true)) { - LuVTierEnhancer.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(), GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); } } + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + } + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + } + } + private static void rewriteAsslineRecipes(ItemStack stack, OrePrefixes[] LuVMaterialsGenerated, GT_Recipe.GT_Recipe_AssemblyLine recipe){ + for (OrePrefixes prefixes : LuVMaterialsGenerated) { + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksCointainAndReplace(new Object[]{recipe.mOutput}, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + if (LuVTierEnhancer.doStacksCointainAndReplace(new Object[]{recipe.mOutput}, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksCointainAndReplace(new Object[]{recipe.mOutput}, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + } + } + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + } + if (LuVTierEnhancer.doStacksCointainAndReplace(new Object[]{recipe.mOutput}, stack, false)) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); } - new AfterLuVTierEnhacement().run(); } - private static void replaceAsslineRecipes(){ + private static void replaceOsmiridiumInLuVRecipes(){ for (GT_Recipe.GT_Recipe_AssemblyLine recipe_assemblyLine : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){ if (recipe_assemblyLine.mEUt > 6000) continue; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java index 09de02eeb2..2df54251eb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java @@ -32,10 +32,12 @@ import gregtech.api.util.GT_OreDictUnificator; import static gregtech.api.enums.OrePrefixes.dust; import static gregtech.api.enums.OrePrefixes.dustSmall; -public class AfterLuVTierEnhacement implements Runnable { +public class AfterLuVTierEnhacement { + + private AfterLuVTierEnhacement(){}; + + public static void run() { - @Override - public void run() { GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(1), WerkstoffLoader.Zirconium.get(dust), WerkstoffLoader.Zirconium.get(dust), @@ -44,6 +46,7 @@ public class AfterLuVTierEnhacement implements Runnable { GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 8L), GT_OreDictUnificator.get(dust, Materials.Platinum, 1L), new int[]{10_000,5_000,5_000,2_500,10_000,10_000},250,2000); + GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(2), WerkstoffLoader.Zirconium.get(dust,2), WerkstoffLoader.Zirconium.get(dust,2), @@ -52,6 +55,7 @@ public class AfterLuVTierEnhacement implements Runnable { GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 18L), GT_OreDictUnificator.get(dust, Materials.Platinum, 2L), new int[]{10_000,5_000,5_000,2_500,10_000,10_000},500,2000); + GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(4), WerkstoffLoader.Zirconium.get(dust,4), WerkstoffLoader.Zirconium.get(dust,4), @@ -60,6 +64,7 @@ public class AfterLuVTierEnhacement implements Runnable { GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 38L), GT_OreDictUnificator.get(dust, Materials.Platinum, 4L), new int[]{10_000,5_000,5_000,2_500,10_000,10_000},1000,2000); + GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), null,null,null, ItemList.Depleted_Naquadah_4.get(8), WerkstoffLoader.Zirconium.get(dust,64), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 89d4eea19a..02351a3f77 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -445,7 +445,7 @@ public class BW_Util { continue; boolean b = Math.abs(x) < radius && Math.abs(z) != radius; if (insideCheck && b) { - if (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside) && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside || dmginside > (-1))) { + if (! (inside.equals(Blocks.air) ? aBaseMetaTileEntity.getAir(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside) ) && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside || dmginside > (-1))) { if (!(allowHatches && ( ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addDynamoToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || -- cgit From 7e26501c38ca45b8b6fd6782ab495cfce67871c7 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 17 Jan 2020 19:04:55 +0100 Subject: version increase for dream Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 825a2db896bcd591c60e779371eef87be981a769 --- build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.properties b/build.properties index 128bba6264..c45f52f80e 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=7 +buildNumber=8 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 -- cgit From 0c1d0d82bc3700e063a51a90c8d4d88b5c81a074 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 18 Jan 2020 12:05:36 +0100 Subject: circuitassemblyline balance + refractor of code Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 4d1bbb965e7e264597c44766f508033151d955ab --- build.properties | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 26 ++++++---- .../client/textures/PrefixTextureLinker.java | 35 +++++++------ .../multis/GT_TileEntity_CircuitAssemblyLine.java | 2 +- .../CircuitGeneration/CircuitImprintLoader.java | 3 +- .../material/processingLoaders/DownTierLoader.java | 37 ++++++++------ .../bartimaeusnek/bartworks/util/BW_Util.java | 57 ++++++++++++++++++++-- .../bartworks/util/ChatColorHelper.java | 2 + .../atmosphere/BWAtmosphereManager.java | 8 +-- 9 files changed, 118 insertions(+), 54 deletions(-) diff --git a/build.properties b/build.properties index c45f52f80e..0480826dbd 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=8 +buildNumber=9 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 9cb1dffbaf..0bc0a806a4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -129,10 +129,11 @@ public final class MainMod { } } - if (Loader.isModLoaded("dreamcraft")) { + if (Loader.isModLoaded("dreamcraft")) ConfigHandler.GTNH = true; - } + ConfigHandler.GTNH = ConfigHandler.ezmode != ConfigHandler.GTNH; + if (ConfigHandler.debugLog) { try { new DebugLog(preinit); @@ -140,6 +141,7 @@ public final class MainMod { e.printStackTrace(); } } + if (ConfigHandler.GTNH) MainMod.LOGGER.info("GTNH-Detected . . . ACTIVATE HARDMODE."); @@ -147,6 +149,7 @@ public final class MainMod { BioCultureLoader bioCultureLoader = new BioCultureLoader(); bioCultureLoader.run(); } + if (ConfigHandler.newStuff) { INSTANCE.init(); Werkstoff.init(); @@ -154,6 +157,7 @@ public final class MainMod { if (FMLCommonHandler.instance().getSide().isClient()) new PrefixTextureLinker(); } + } @Mod.EventHandler @@ -192,16 +196,20 @@ public final class MainMod { new ThreadedLoader().run(); else INSTANCE.run(); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor", "Electric Implosions?"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor.desc", "Basically a giant Hammer that presses Stuff - No more TNT!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp", "Heat from below!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp.desc", "Get ALL the thermal energy!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline", "Cheaper Circuits?"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline.desc", "Well, yes, but actually no..."); - GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.nqgen", "Can be used as Enriched Naquadah Fuel Substitute"); + localiseAchievements(); } } + private static void localiseAchievements(){ + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor", "Electric Implosions?"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor.desc", "Basically a giant Hammer that presses Stuff - No more TNT!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp", "Heat from below!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp.desc", "Get ALL the thermal energy!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline", "Cheaper Circuits?"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline.desc", "Well, yes, but actually no..."); + GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.nqgen", "Can be used as Enriched Naquadah Fuel Substitute"); + } + @Mod.EventHandler public void onServerStarting(FMLServerStartingEvent event) { event.registerServerCommand(new SummonRuin()); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java index 4294e1c89c..af08a21524 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java @@ -35,7 +35,7 @@ import java.util.HashMap; @SideOnly(Side.CLIENT) public class PrefixTextureLinker implements Runnable { - public static HashMap> texMap = new HashMap<>(); + public static HashMap> texMap = new HashMap<>(); { GregTech_API.sBeforeGTLoad.add(this); @@ -43,21 +43,24 @@ public class PrefixTextureLinker implements Runnable { @Override public void run() { - - for (OrePrefixes prefixes : OrePrefixes.values()) { - if (prefixes == OrePrefixes.rod) - continue; - HashMap curr = new HashMap<>(); - if (prefixes.mTextureIndex == -1 && Werkstoff.GenerationFeatures.prefixLogic.get(prefixes) != 0) { - Arrays.stream(TextureSet.class.getFields()).filter(field -> field.getName().contains("SET")).forEach(SET -> { - try { - curr.put((TextureSet) SET.get(null), new Textures.ItemIcons.CustomIcon("materialicons/" + SET.getName().substring(4) + "/" + prefixes)); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } + Arrays.stream(OrePrefixes.values()) + .filter(prefixes -> prefixes != OrePrefixes.rod + && prefixes.mTextureIndex == -1 && Werkstoff.GenerationFeatures.prefixLogic.get(prefixes) != 0) + .forEach(prefixes -> { + HashMap curr = new HashMap<>(); + Arrays.stream(TextureSet.class.getFields()) + .filter(field -> field.getName().contains("SET")) + .forEach(SET -> { + try { + curr.put((TextureSet) SET.get(null), + new Textures.ItemIcons.CustomIcon( + "materialicons/" + SET.getName().substring(4) + "/" + prefixes) + ); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + }); + texMap.put(prefixes, curr); }); - texMap.put(prefixes, curr); - } - } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 6d664ed7cd..af096236aa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -121,7 +121,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl return false; if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), BW_Util.getItemsFromInputBusses(this))) { - BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); + BW_Util.calculateOverclockedNessMultiPefectOC(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); if (this.mEUt > 0) this.mEUt = -this.mEUt; this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index a7823ed112..81fa72717f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -60,6 +60,7 @@ public class CircuitImprintLoader { private static final HashSet ORIGINAL_CAL_RECIPES = new HashSet<>(); private static final HashSet MODIFIED_CAL_RECIPES = new HashSet<>(); + @SuppressWarnings("unused") public static void run() { HashSet toRem = new HashSet<>(); HashSet toAdd = new HashSet<>(); @@ -162,7 +163,7 @@ public class CircuitImprintLoader { return null; } - return new BWRecipes.DynamicGTRecipe(false, in, new ItemStack[]{getOutputMultiplied(original)}, BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]), 0, 0), null, original.mFluidInputs, null, original.mDuration * 16, original.mEUt, 0); + return new BWRecipes.DynamicGTRecipe(false, in, new ItemStack[]{getOutputMultiplied(original)}, BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]), 0, 0), null, original.mFluidInputs, null, original.mDuration * 12, original.mEUt, 0); } private static ItemStack getOutputMultiplied(GT_Recipe original){ diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java index c5295eab6e..ff080eab82 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java @@ -26,26 +26,31 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.util.GT_Recipe; import java.util.HashSet; +import java.util.Objects; import java.util.Set; public class DownTierLoader implements Runnable { + @Override public void run() { - for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - if (map == GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes || map == GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes || map == GT_Recipe.GT_Recipe_Map.sMassFabFakeRecipes || map == GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes || map == GT_Recipe.GT_Recipe_Map.sFusionRecipes || map == GT_Recipe.GT_Recipe_Map.sRockBreakerFakeRecipes) - return; - Set newRecipes = new HashSet<>(); - Set toRem = new HashSet<>(); - for (GT_Recipe recipe : map.mRecipeList) { - if (recipe == null) - continue; - if (recipe.mEUt > 128) { - toRem.add(recipe); - newRecipes.add(BW_Util.copyAndSetTierToNewRecipe(recipe, (byte) 2)); - } - } - map.mRecipeList.removeAll(toRem); - map.mRecipeList.addAll(newRecipes); - } + GT_Recipe.GT_Recipe_Map.sMappings.stream().filter(map -> + !(map == GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes + || map == GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes + || map == GT_Recipe.GT_Recipe_Map.sMassFabFakeRecipes + || map == GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes + || map == GT_Recipe.GT_Recipe_Map.sFusionRecipes + || map == GT_Recipe.GT_Recipe_Map.sRockBreakerFakeRecipes)) + .forEach(map -> { + Set newRecipes = new HashSet<>(); + Set toRem = new HashSet<>(); + map.mRecipeList.stream() + .filter(recipe -> Objects.nonNull(recipe) && recipe.mEUt > 128) + .forEach(recipe -> { + toRem.add(recipe); + newRecipes.add(BW_Util.copyAndSetTierToNewRecipe(recipe, (byte) 2)); + }); + map.mRecipeList.removeAll(toRem); + map.mRecipeList.addAll(newRecipes); + }); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 02351a3f77..24194ff563 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -349,6 +349,51 @@ public class BW_Util { } } + public static void calculateOverclockedNessMultiPefectOC(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, GT_MetaTileEntity_MultiBlockBase base){ + byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); + if (mTier == 0) { + //Long time calculation + long xMaxProgresstime = ((long) aDuration) << 1; + if (xMaxProgresstime > Integer.MAX_VALUE - 1) { + //make impossible if too long + base.mEUt = Integer.MAX_VALUE - 1; + base.mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + base.mEUt = aEUt >> 2; + base.mMaxProgresstime = (int) xMaxProgresstime; + } + } else { + long xEUt = aEUt; + //Isnt too low EUt check? + long tempEUt = Math.max(xEUt, V[1]); + + base.mMaxProgresstime = aDuration; + + while (tempEUt <= V[mTier - 1] * mAmperage) { + tempEUt <<= 1;//this actually controls overclocking + base.mMaxProgresstime >>= 1;//this is effect of overclocking + xEUt = base.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 1;//U know, if the time is less than 1 tick make the machine use less power + } + + while (xEUt > maxInputVoltage) { + //downclock one notch until we are good again, we have overshot. + xEUt >>= 1; + base.mMaxProgresstime <<= 1; + } + if (xEUt > Integer.MAX_VALUE - 1) { + base.mEUt = Integer.MAX_VALUE - 1; + base.mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + base.mEUt = (int) xEUt; + if (base.mEUt == 0) + base.mEUt = 1; + if (base.mMaxProgresstime <= 0) + base.mMaxProgresstime = 1;//set time to 1 tick + } + } + } + + public static long getnominalVoltage(GT_MetaTileEntity_MultiBlockBase base) { long rVoltage = 0L; long rAmperage = 0L; @@ -487,9 +532,10 @@ public class BW_Util { continue; if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) continue; - if (insideCheck && (Math.abs(x) < radius && Math.abs(z) != radius)) + final boolean inside = Math.abs(x) < radius && Math.abs(z) != radius; + if (insideCheck && inside) ret.add(aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); - if (!(Math.abs(x) < radius && Math.abs(z) != radius)) { + if (!inside) { ret.add(aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); } } @@ -537,7 +583,9 @@ public class BW_Util { } private static Field sBufferedRecipeList; - public static List getGTBufferedRecipeList() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException{ + + @SuppressWarnings("unchecked") + public static List getGTBufferedRecipeList() throws SecurityException, IllegalArgumentException, IllegalAccessException{ if (sBufferedRecipeList == null) { sBufferedRecipeList = FieldUtils.getDeclaredField(GT_ModHandler.class,"sBufferRecipeList",true); } @@ -551,6 +599,7 @@ public class BW_Util { return createGTCraftingRecipe(aResult, new Enchantment[0], new int[0], (aBitMask & GT_ModHandler.RecipeBits.MIRRORED) != 0L, (aBitMask & GT_ModHandler.RecipeBits.BUFFERED) != 0L, (aBitMask & GT_ModHandler.RecipeBits.KEEPNBT) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DISMANTLEABLE) != 0L, (aBitMask & GT_ModHandler.RecipeBits.NOT_REMOVABLE) == 0L, (aBitMask & GT_ModHandler.RecipeBits.REVERSIBLE) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES_IF_SAME_NBT) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_SHAPED_RECIPES) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_NATIVE_RECIPES) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS) == 0L, (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_THERE_IS_ANOTHER_RECIPE_FOR_IT) != 0L, (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL) != 0L, aRecipe); } + @SuppressWarnings({"rawtypes","unchecked"}) public static ShapedOreRecipe createGTCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput, boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, boolean aRemoveAllOtherShapedsWithSameOutput, boolean aRemoveAllOtherNativeRecipes, boolean aCheckForCollisions, boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, boolean aOnlyAddIfResultIsNotNull, Object[] aRecipe) { aResult = GT_OreDictUnificator.get(true, aResult); if (aOnlyAddIfResultIsNotNull && aResult == null) return null; @@ -575,7 +624,7 @@ public class BW_Util { throw new IllegalArgumentException(); } - ArrayList tRecipeList = new ArrayList(Arrays.asList(aRecipe)); + ArrayList tRecipeList = new ArrayList<>(Arrays.asList(aRecipe)); while (aRecipe[idx] instanceof String) { StringBuilder s = new StringBuilder((String) aRecipe[idx++]); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java index 38074acc7b..5c6993d2eb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java @@ -24,6 +24,8 @@ package com.github.bartimaeusnek.bartworks.util; public class ChatColorHelper { + private ChatColorHelper() {} + public static final String BLACK = (char) 167 + "0"; public static final String DARKBLUE = (char) 167 + "1"; public static final String DARKGREEN = (char) 167 + "2"; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java index 83238c5f07..c881e09317 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java @@ -34,10 +34,7 @@ import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; +import java.util.*; @SuppressWarnings("unused") public final class BWAtmosphereManager { @@ -84,8 +81,7 @@ public final class BWAtmosphereManager { @SafeVarargs public static void addGasToWorld(int worldID, Pair... toPut){ - for (Pair toadd : toPut) - BWAtmosphereManager.gasConcentration.put(worldID,toadd); + Arrays.stream(toPut).forEach(toadd -> BWAtmosphereManager.gasConcentration.put(worldID, toadd)); } private static boolean addGCGasToWorld(int worldID, IAtmosphericGas gas, int aNumber, int aMaxNumber){ -- cgit From df489f30891290c5f1e94b3b10699d8c529d5522 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 18 Jan 2020 12:24:45 +0100 Subject: Fixed air offset for multis Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 7618e9883cfe006ca1855a3b1aa8feb4c76b759e --- build.properties | 2 +- src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.properties b/build.properties index 0480826dbd..5d372d6798 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=9 +buildNumber=10 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 24194ff563..cbeede008f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -490,7 +490,7 @@ public class BW_Util { continue; boolean b = Math.abs(x) < radius && Math.abs(z) != radius; if (insideCheck && b) { - if (! (inside.equals(Blocks.air) ? aBaseMetaTileEntity.getAir(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside) ) && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside || dmginside > (-1))) { + if (! (inside.equals(Blocks.air) ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside) ) && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside || dmginside > (-1))) { if (!(allowHatches && ( ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addDynamoToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || -- cgit From 074dd1f7ad09cb47d2612f641ec30716b3cd15cb Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 18 Jan 2020 12:34:03 +0100 Subject: Exclude copy bat from build.gradle Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 2e0f719af6c8a27899f033fa95df4e79aa0d7828 --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index 2954d6f60d..decc7f2518 100644 --- a/build.gradle +++ b/build.gradle @@ -148,6 +148,7 @@ processResources } jar { + exclude ("assets/gregtech/textures/items/materialicons/copy.bat") manifest { attributes 'FMLCorePlugin': 'com.github.bartimaeusnek.ASM.BWCorePlugin','FMLCorePluginContainsFMLMod': 'true' } -- cgit From d5c408cfb2a4d2ede082544f60235e71d01a52b7 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 7 Mar 2020 00:28:33 +0100 Subject: Fixes #50 #51 #52 + fixes a bug where old recipes were still chosen due to missing buffer update + copyright update + version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 0e7d755c5043c8f4d1e402e3ce63d9bf9b34bb8d --- build.properties | 4 +- .../ASM/BWCoreStaticReplacementMethodes.java | 35 +++++++++---- .../github/bartimaeusnek/bartworks/MainMod.java | 30 ++++++----- .../bartworks/common/loaders/RecipeLoader.java | 12 ++--- .../bartworks/system/material/WerkstoffLoader.java | 12 ++--- .../material/processingLoaders/DownTierLoader.java | 12 ++--- .../bartworks/util/NonNullWrappedHashSet.java | 61 ++++++++++++++++++++++ .../bartimaeusnek/bartworks/util/StreamUtils.java | 43 +++++++++++++++ 8 files changed, 162 insertions(+), 47 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java diff --git a/build.properties b/build.properties index 5d372d6798..fd4a76fe7f 100644 --- a/build.properties +++ b/build.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2019 bartimaeusnek +# Copyright (c) 2018-2020 bartimaeusnek # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=10 +buildNumber=11 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java index d9ff910ff8..72a9477e59 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.ASM; +import com.github.bartimaeusnek.bartworks.util.NonNullWrappedHashSet; import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriorityList; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; @@ -96,16 +97,28 @@ public class BWCoreStaticReplacementMethodes { } ItemStack stack = null; - HashSet recipeHashSet = new HashSet<>(); - for (IRecipe recipe : (List) CraftingManager.getInstance().getRecipeList()) - if (recipe.matches(inventoryCrafting, world)) - recipeHashSet.add(recipe); - - for (IRecipe recipe : recipeHashSet){ - stack = recipe.getCraftingResult(inventoryCrafting); - if (stack != null && recipeHashSet.size() == 1) - RECENTLYUSEDRECIPES.addLast(recipe); + + HashSet recipeSet = new NonNullWrappedHashSet<>(); + List recipeList = CraftingManager.getInstance().getRecipeList(); + + for (int k = 0; k < recipeList.size(); k++) { + recipeSet.add((IRecipe) recipeList.get(k)); } + + Object[] arr = recipeSet.parallelStream().filter(r -> r.matches(inventoryCrafting, world)).toArray(); + + if (arr.length == 0) + return null; + + IRecipe recipe = (IRecipe) arr[0]; + stack = recipe.getCraftingResult(inventoryCrafting); + + if (arr.length != 1) + return stack; + + if (stack != null) + RECENTLYUSEDRECIPES.addLast(recipe); + return stack; } } @@ -113,4 +126,4 @@ public class BWCoreStaticReplacementMethodes { private BWCoreStaticReplacementMethodes() { } -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 0bc0a806a4..9d83e88b57 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -53,6 +53,7 @@ import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.Down import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.StreamUtils; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.google.common.collect.ArrayListMultimap; import cpw.mods.fml.common.FMLCommonHandler; @@ -230,7 +231,6 @@ public final class MainMod { PlatinumSludgeOverHaul.replacePureElements(); runOnServerStarted(); - fixEnergyRequirements(); MainMod.unificationRecipeEnforcer(); } @@ -248,25 +248,27 @@ public final class MainMod { } if (classicMode) new DownTierLoader().run(); -// removeDuplicateRecipes(); +// removeDuplicateRecipes(); recipesAdded = true; } + fixEnergyRequirements(); + + //Accept recipe map changes into Buffers + GT_Recipe.GT_Recipe_Map.sMappings.forEach(GT_Recipe.GT_Recipe_Map::reInit); } private static void fixEnergyRequirements() { - maploop: - for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - for (GT_Recipe recipe : map.mRecipeList) { - if (recipe.mFakeRecipe) - continue maploop; - for (int i = 0; i < (VN.length - 1); i++) { - if (recipe.mEUt == BW_Util.getTierVoltage(i)) { - recipe.mEUt = BW_Util.getMachineVoltageFromTier(i); + GT_Recipe.GT_Recipe_Map.sMappings.stream() + .filter(StreamUtils::filterVisualMaps) + .forEach(gt_recipe_map -> + gt_recipe_map.mRecipeList.parallelStream().forEach( gt_recipe -> { + for (int i = 0; i < (VN.length - 1); i++) { + if (gt_recipe.mEUt > BW_Util.getMachineVoltageFromTier(i) && gt_recipe.mEUt <= BW_Util.getTierVoltage(i)) { + gt_recipe.mEUt = BW_Util.getMachineVoltageFromTier(i); + } } - } - } - } + })); } private static void unificationRecipeEnforcer() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 3f703ba688..34401b4d11 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -103,7 +103,7 @@ public class RecipeLoader implements Runnable { "CDC", "SBS", "CFC", - 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, ConfigHandler.GTNH ? Materials.Advanced : Materials.Basic, 1L), + 'C', ConfigHandler.GTNH ? "circuitAdvanced" : "circuitBasic", 'D', ItemList.Cover_Screen.get(1L), 'S', GT_OreDictUnificator.get(OrePrefixes.cableGt12, ConfigHandler.GTNH ? Materials.Platinum : Materials.AnnealedCopper, 1L), 'B', new ItemStack(ItemRegistry.BW_BLOCKS[1]), @@ -112,24 +112,24 @@ public class RecipeLoader implements Runnable { GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.DESTRUCTOPACK), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "CPC", "PLP", "CPC", - 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1L), + 'C', "circuitAdvanced", 'P', GT_OreDictUnificator.get(ConfigHandler.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, Materials.Aluminium, 1L), 'L', new ItemStack(Items.lava_bucket) }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.DESTRUCTOPACK), - RecipeLoader.BITSD, + GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ "CPC", "PLP", "CPC", - 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1L), + 'C', "circuitAdvanced", 'P', GT_OreDictUnificator.get(ConfigHandler.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, ConfigHandler.GTNH ? Materials.Steel : Materials.Iron, 1L), 'L', new ItemStack(Items.lava_bucket) }); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index ec43fce23c..3b1079cb83 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -764,6 +764,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff PTResidue = new Werkstoff( new short[]{0x64,0x63,0x2E}, "Platinum Residue", + "??IrOsRhRu??", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().onlyDust(), @@ -899,7 +900,7 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff LeachResidue = new Werkstoff( new short[]{0x64, 0x46, 0x29}, "Leach Residue", - "??IrOsRhRu??", + "??IrOsRu??", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures(), @@ -1731,8 +1732,8 @@ public class WerkstoffLoader implements Runnable { } public static void addAssociationToItems() { - Arrays.stream(values()).forEach( prefixes -> { - Werkstoff.werkstoffHashSet.stream() + Arrays.stream(values()).forEach( prefixes -> + Werkstoff.werkstoffHashSet.stream() .filter(werkstoff -> werkstoff.hasItemType(prefixes) && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0) .forEach(werkstoff -> { Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial(); @@ -1741,8 +1742,7 @@ public class WerkstoffLoader implements Runnable { GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, stack, false); GT_OreDictUnificator.set(prefixes, werkstoffBridgeMaterial, stack, true, true); } - }); - }); + })); } /** diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java index ff080eab82..320bf534fb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.StreamUtils; import gregtech.api.util.GT_Recipe; import java.util.HashSet; @@ -33,13 +34,8 @@ public class DownTierLoader implements Runnable { @Override public void run() { - GT_Recipe.GT_Recipe_Map.sMappings.stream().filter(map -> - !(map == GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes - || map == GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes - || map == GT_Recipe.GT_Recipe_Map.sMassFabFakeRecipes - || map == GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes - || map == GT_Recipe.GT_Recipe_Map.sFusionRecipes - || map == GT_Recipe.GT_Recipe_Map.sRockBreakerFakeRecipes)) + GT_Recipe.GT_Recipe_Map.sMappings.stream() + .filter(map -> StreamUtils.filterVisualMaps(map) && map != GT_Recipe.GT_Recipe_Map.sFusionRecipes) .forEach(map -> { Set newRecipes = new HashSet<>(); Set toRem = new HashSet<>(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java new file mode 100644 index 0000000000..f7ed76278e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util; + +import java.util.Collection; +import java.util.HashSet; + +public class NonNullWrappedHashSet extends HashSet { + + public NonNullWrappedHashSet() { + super(); + } + + public NonNullWrappedHashSet(Collection c) { + super(); + this.addAll(c); + } + + public NonNullWrappedHashSet(int initialCapacity, float loadFactor) { + super(initialCapacity, loadFactor); + } + + public NonNullWrappedHashSet(int initialCapacity) { + super(initialCapacity); + } + + public boolean add(E e) { + if (e != null) + return super.add(e); + return false; + } + + public boolean addAll(Collection c) { + boolean wasChanged = false; + for (E element : c) { + if (element != null) + wasChanged |= this.add(element); + } + return wasChanged; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java new file mode 100644 index 0000000000..9083ee468f --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util; + +import gregtech.api.util.GT_Recipe; + +import java.util.Optional; +import java.util.function.Predicate; + +public class StreamUtils { + private StreamUtils(){} + + public static Predicate filterVisualMaps() { + return gt_recipe_map -> { + Optional op = gt_recipe_map.mRecipeList.stream().findAny(); + return op.isPresent() && !op.get().mFakeRecipe; + }; + } + + public static boolean filterVisualMaps(GT_Recipe.GT_Recipe_Map gt_recipe_map) { + return filterVisualMaps().test(gt_recipe_map); + } +} -- cgit From 5da586120ed053ce2b326b6cc758ff377cdcd375 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 7 Mar 2020 01:00:39 +0100 Subject: Fixed Materials + Fixed some GTNH small ores not having weight + fixed tooltip on Platinum Metallic Powder Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: ba15b8225fb1ccac85e788a2034f4e0dcbb7b817 --- .../bartworks/system/material/WerkstoffLoader.java | 25 ++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 3b1079cb83..6f6267021a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -740,14 +740,15 @@ public class WerkstoffLoader implements Runnable { public static final Werkstoff PTMetallicPowder = new Werkstoff( Materials.Platinum.getRGBA(), "Platinum Metallic Powder", - "", + "??PtPdIrOsRhRu??", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures(), 47, - TextureSet.SET_METALLIC + TextureSet.SET_METALLIC, //No Byproducts - //No Ingredients + new Pair<>(Materials.Platinum,1), + new Pair<>(Materials.Stone,2) ); public static final Werkstoff AquaRegia = new Werkstoff( new short[]{0xff,0xb1,0x32}, @@ -795,7 +796,6 @@ public class WerkstoffLoader implements Runnable { 51, TextureSet.SET_METALLIC //No Byproducts - //No Ingredients ); public static final Werkstoff PDAmmonia = new Werkstoff( Materials.Palladium.getRGBA(), @@ -817,9 +817,10 @@ public class WerkstoffLoader implements Runnable { Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures(), 53, - TextureSet.SET_METALLIC + TextureSet.SET_METALLIC, //No Byproducts - //No Ingredients + new Pair<>(Materials.Palladium,1), + new Pair<>(Materials.Stone,2) ); public static final Werkstoff PDRawPowder = new Werkstoff( Materials.Palladium.getRGBA(), @@ -1016,8 +1017,10 @@ public class WerkstoffLoader implements Runnable { Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures(), 69, - TextureSet.SET_ROUGH + TextureSet.SET_ROUGH, //No Byproducts + new Pair<>(Materials.Osmiridium,1), + new Pair<>(Materials.Stone,2) ); public static final Werkstoff IrLeachResidue = new Werkstoff( new short[]{0x84, 0x66, 0x49}, @@ -1027,7 +1030,9 @@ public class WerkstoffLoader implements Runnable { Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures(), 70, - TextureSet.SET_ROUGH + TextureSet.SET_ROUGH, + new Pair<>(Materials.Iridium,1), + new Pair<>(Materials.Stone,2) //No Byproducts ); public static final Werkstoff PGSDResidue = new Werkstoff( @@ -1129,7 +1134,9 @@ public class WerkstoffLoader implements Runnable { Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures(), 79, - TextureSet.SET_DULL + TextureSet.SET_DULL, + new Pair<>(Rhodium,1), + new Pair<>(Materials.Stone,1) ); public static final Werkstoff RHSalt = new Werkstoff( new short[]{0x84, 0x84, 0x84}, -- cgit From 5bbd43bd9fadf95cb811328c012ca5e5de1c9a5d Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 7 Mar 2020 18:37:54 +0100 Subject: Fixed NEI Handler for small ores + useage of fastfloor/ceil + Loading plugin reorder + version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: bc9ac90b654f67f20640b202df7f51434cd4d45a --- build.properties | 2 +- .../com/github/bartimaeusnek/ASM/BWCorePlugin.java | 4 +- .../client/gui/GT_GUIContainer_RadioHatch.java | 5 ++- .../tileentities/multis/GT_TileEntity_BioVat.java | 6 +-- .../multis/GT_TileEntity_CrackingDistillTower.java | 7 ++-- .../tileentities/multis/GT_TileEntity_THTR.java | 5 ++- .../mega/GT_TileEntity_MegaDistillTower.java | 5 ++- .../tiered/GT_MetaTileEntity_RadioHatch.java | 9 +++-- .../bartworks/neiHandler/BW_NEI_OreHandler.java | 22 +++++++---- .../bartimaeusnek/bartworks/util/MathUtils.java | 45 ++++++++++++++++++++++ .../planets/ross128ba/WorldProviderRoss128Ba.java | 5 ++- 11 files changed, 87 insertions(+), 28 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java diff --git a/build.properties b/build.properties index fd4a76fe7f..28cb48a532 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=11 +buildNumber=12 APIVersion=8 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java index 3d8811142d..bbaff54ba1 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,7 +31,7 @@ import java.io.File; import java.util.ArrayList; import java.util.Map; -@IFMLLoadingPlugin.SortingIndex(999999999)//Load as late as possible (after fastcraft/OptiFine). +@IFMLLoadingPlugin.SortingIndex(Integer.MAX_VALUE)//Load as late as possible (after fastcraft/OptiFine). @IFMLLoadingPlugin.MCVersion("1.7.10") @IFMLLoadingPlugin.TransformerExclusions("com.github.bartimaeusnek.ASM") @IFMLLoadingPlugin.Name(BWCorePlugin.BWCORE_PLUGIN_NAME) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java index 9bd331c59c..58e4cc0c12 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; +import com.github.bartimaeusnek.bartworks.util.MathUtils; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; @@ -60,7 +61,7 @@ public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine this.drawTexturedModalRect(124, 18, 124, 18, 16, 48); } GL11.glColor3f(1f, 1f, 1f); - this.drawTexturedModalRect(124, 18, 176, 0, 16, 48 - (int) Math.ceil(48 * (rem / maxT))); + this.drawTexturedModalRect(124, 18, 176, 0, 16, 48 - (int) MathUtils.ceil(48 * (rem / maxT))); this.drawTexturedModalRect(65, 13, 192, 0, (48 * (((GT_Container_RadioHatch) this.mContainer).sv)) / (GT_GUIContainer_RadioHatch.maxSv), 16); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index d3d8d5f6ab..5623735b19 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -143,8 +143,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } private int calcMod(double x) { - int ret = (int) Math.ceil(ConfigHandler.bioVatMaxParallelBonus*(-(((2D*x/(double)this.getOutputCapacity())-1D)*(2D*x/(double)this.getOutputCapacity()-1D))+1D)); - return ret <= 0 ? 1 : Math.min(ret, 100);//(int) Math.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); + int ret = (int) MathUtils.ceil(ConfigHandler.bioVatMaxParallelBonus*(-(((2D*x/(double)this.getOutputCapacity())-1D)*(2D*x/(double)this.getOutputCapacity()-1D))+1D)); + return ret <= 0 ? 1 : Math.min(ret, 100);//(int) MathUtils.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java index 1f96a207e3..5b26664943 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.MathUtils; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -68,9 +69,9 @@ public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_Distil FluidStack[] nuoutputs = new FluidStack[recipeDistill.mFluidOutputs.length]; for (int i = 0; i < nuoutputs.length; i++) { nuoutputs[i] = recipeDistill.mFluidOutputs[i]; - nuoutputs[i].amount = (int) (Math.floor(recipeDistill.mFluidOutputs[i].amount * ratio)); + nuoutputs[i].amount = (int) (MathUtils.floor(recipeDistill.mFluidOutputs[i].amount * ratio)); } - BWRecipes.DynamicGTRecipe combined = new BWRecipes.DynamicGTRecipe(true, null, recipeDistill.mOutputs, null, recipeDistill.mChances, recipeCracking.mFluidInputs, nuoutputs, (int) (Math.floor(recipeDistill.mDuration * ratio)) + recipeCracking.mDuration, Math.max((int) (Math.floor(recipeDistill.mEUt * ratio)), recipeCracking.mEUt), 0); + BWRecipes.DynamicGTRecipe combined = new BWRecipes.DynamicGTRecipe(true, null, recipeDistill.mOutputs, null, recipeDistill.mChances, recipeCracking.mFluidInputs, nuoutputs, (int) (MathUtils.floor(recipeDistill.mDuration * ratio)) + recipeCracking.mDuration, Math.max((int) (MathUtils.floor(recipeDistill.mEUt * ratio)), recipeCracking.mEUt), 0); if (combined.isRecipeInputEqual(true, array)) { this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 87e1089e1f..0d449ecddc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.MathUtils; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -138,7 +139,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.BISOPeletSupply + this.TRISOPeletSupply >= 100000)) return false; - int toReduce = new XSTR().nextInt((int)Math.floor(((double)this.BISOPeletSupply + (double)this.TRISOPeletSupply) / 200D)); + int toReduce = new XSTR().nextInt((int) MathUtils.floor(((double)this.BISOPeletSupply + (double)this.TRISOPeletSupply) / 200D)); this.savedBISO = BISOPeletSupply; this.savedTRISO = TRISOPeletSupply; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 127c38d0c4..4e81813ca1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.MathUtils; import com.google.common.collect.ArrayListMultimap; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -141,7 +142,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati if (super.addOutputToMachineList(aTileEntity, aBaseCasingIndex)) { if (aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output) { int layer = aTileEntity.getYCoord() - controllerY; - layer = (int) Math.ceil(((double)layer) /5D)-1; + layer = (int) MathUtils.ceil(((double)layer) /5D)-1; LAYERMAP.put(layer,(GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity()); } return true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index eadf67de7a..205dab5a9a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,6 +29,7 @@ import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.MathUtils; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; import cpw.mods.fml.common.Loader; import gregtech.api.enums.ItemList; @@ -82,14 +83,14 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { else if (x == 61) ret = 4500; else if (x <= 100) - ret = (long) Math.ceil((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); + ret = (long) MathUtils.ceil((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); else - ret = (long) Math.ceil(((8000D * Math.tanh(-x / 65D) + 8000D))); + ret = (long) MathUtils.ceil(((8000D * Math.tanh(-x / 65D) + 8000D))); return ret;//*20; } public int getSievert() { - return this.sievert - (int) Math.ceil((float) this.sievert / 100f * (float) this.coverage); + return this.sievert - (int) MathUtils.ceil((float) this.sievert / 100f * (float) this.coverage); } public short[] getColorForGUI() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index 902bf6681c..677a9af5f7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -96,15 +96,23 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public void drawExtras(int recipe) { if ((recipe < this.arecipes.size()) && (this.arecipes.get(recipe) instanceof CachedOreRecipe) ) { CachedOreRecipe cachedOreRecipe = (CachedOreRecipe) this.arecipes.get(recipe); - if (cachedOreRecipe == null || cachedOreRecipe.getOtherStacks() == null || - cachedOreRecipe.getOtherStacks().get(0) == null || cachedOreRecipe.getOtherStacks().get(1) == null - || cachedOreRecipe.getOtherStacks().get(2) == null || cachedOreRecipe.getOtherStacks().get(3) == null || - cachedOreRecipe.getOtherStacks().get(0).item == null || cachedOreRecipe.getOtherStacks().get(1).item == null - || cachedOreRecipe.getOtherStacks().get(2).item == null || cachedOreRecipe.getOtherStacks().get(3).item == null - ) + + if (cachedOreRecipe == null || cachedOreRecipe.getOtherStacks() == null || cachedOreRecipe.getOtherStacks().size() == 0) return; + + if (!cachedOreRecipe.small) { + if (cachedOreRecipe.getOtherStacks().get(0) == null || cachedOreRecipe.getOtherStacks().get(0).item == null + || cachedOreRecipe.getOtherStacks().get(1) == null + || cachedOreRecipe.getOtherStacks().get(2) == null || cachedOreRecipe.getOtherStacks().get(3) == null || cachedOreRecipe.getOtherStacks().get(1).item == null + || cachedOreRecipe.getOtherStacks().get(2).item == null || cachedOreRecipe.getOtherStacks().get(3).item == null + ) + return; + } else if (cachedOreRecipe.getOtherStacks().get(0) == null || cachedOreRecipe.getOtherStacks().get(0).item == null) + return; + if (cachedOreRecipe.worldGen != null) GuiDraw.drawString(ChatColorHelper.BOLD + "DIM: " + ChatColorHelper.RESET + cachedOreRecipe.worldGen.getDimName(), 0, 40, 0, false); + GuiDraw.drawString(ChatColorHelper.BOLD + "Primary:", 0, 50, 0, false); GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(0).item.getDisplayName(), 0, 60, 0, false); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java new file mode 100644 index 0000000000..dfb95c921d --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util; + +/* + * Faster implementations for Math stuff + */ +public class MathUtils { + + public static double floor(double x) { + if (Double.isInfinite(x) || Double.isNaN(x)) + return x; + int xi = (int)x; + return x < xi ? xi - 1 : xi; + } + + public static double ceil(double x) { + if (Double.isInfinite(x) || Double.isNaN(x)) + return x; + int xi = (int)x; + return x > xi ? xi + 1 : xi; + } + + +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java index f445290136..8ecb971452 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba; +import com.github.bartimaeusnek.bartworks.util.MathUtils; import com.github.bartimaeusnek.crossmod.galacticraft.planets.AbstractWorldProviderSpace; import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; @@ -43,7 +44,7 @@ public class WorldProviderRoss128Ba extends AbstractWorldProviderSpace { @Override public long getDayLength() { - return (long) Math.floor(24000f*9.9f/100f); + return (long) MathUtils.floor(24000f*9.9f/100f); } @Override public boolean hasSunset() { -- cgit From 074ea299b14a815a8a8fc4de975f6c10fc1276b4 Mon Sep 17 00:00:00 2001 From: Bass Date: Mon, 23 Mar 2020 02:56:39 +0000 Subject: Changes Boronsilicate to Borosilicate Fixes #56 Former-commit-id: ace1f51565fc468e90c059f4bd3bb99940c9aaa0 --- .../resources/assets/bartworks/lang/de_DE.lang | 2 +- .../resources/assets/bartworks/lang/en_US.lang | 2 +- .../resources/assets/bartworks/lang/fr_FR.lang | 24 +++++++++++----------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/resources/assets/bartworks/lang/de_DE.lang b/src/main/resources/assets/bartworks/lang/de_DE.lang index 6dc22e440e..7677ce6751 100644 --- a/src/main/resources/assets/bartworks/lang/de_DE.lang +++ b/src/main/resources/assets/bartworks/lang/de_DE.lang @@ -118,7 +118,7 @@ tooltip.tile.lesu.1.name=Storage per LESU Casing: tooltip.tile.lesu.2.name=Output EU: LESU Casings amount;Input EU: Next Voltage Tier to Output EU;Input/Output Amps can be configured via 4 Circuits in GUI;Output Side has a dot on it. tooltip.tile.lesu.3.name=Only one Controller allowed, no Wallsharing! tooltip.tile.manualtravo.0.name=Controller Block for the Manual Trafo;Operates in 4 different Modes:;Mode 1: Circuit 0 in controller: Direct-Upstep;Mode 2: Circuit 1 in controller: Direct-Downstep;Mode 3: Circuit 2 in controller: Tapped-Upstep;Mode 4: Circuit 3 in controller: Tapped-Downstep;For direct Modes: 3xHx3;Base Contains at least 1 Energy Hatch;1 Layer of Transformer-Winding Blocks for each Tier transformed;Middle of Transformer-Winding Blocks needs to be a Nickel-Zinc Ferrite Block;Top Contains at least 1 Dynamo Hatch;Maintenance Hatch can be placed anywhere;Tapped Mode is disabled at the Moment. -tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Boronsilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum +tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Borosilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum tooltip.tile.mbf.1.name=Pollution per second tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest tooltip.tile.radhatch.0.name=Radioactive Item Chamber for Multiblocks diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 43830aa4bb..92579a6bee 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -100,7 +100,7 @@ tooltip.tile.waterpump.0.name=Produces tooltip.tile.waterpump.1.name=L/s Water when fueled. tooltip.tile.waterpump.2.name=Must be placed on the Ground. -tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Boronsilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum +tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Borosilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum tooltip.tile.mbf.1.name=Pollution per second tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom or top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radio Hatch;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! diff --git a/src/main/resources/assets/bartworks/lang/fr_FR.lang b/src/main/resources/assets/bartworks/lang/fr_FR.lang index 4cb840b7ff..bdf54486f7 100644 --- a/src/main/resources/assets/bartworks/lang/fr_FR.lang +++ b/src/main/resources/assets/bartworks/lang/fr_FR.lang @@ -44,17 +44,17 @@ labModule.item.PlasmidSynthesisModule.name=Module de synthèse pour Plasmides labModule.item.TransformationModule.name=Module de transformation labModule.item.ClonalCellularSynthesisModule.name=Module de synthèse cellulaire clonale BW_GlasBlocks.0.name=Bloc de Verre Borosilicate -BW_GlasBlocks.1.name=Bloc de Verre Boronsilicate renforcé en Nickel -BW_GlasBlocks.2.name=Bloc de Verre Boronsilicate renforcé en Tungsten -BW_GlasBlocks.3.name=Bloc de Verre Boronsilicate renforcé en Chrome -BW_GlasBlocks.4.name=Bloc de Verre Boronsilicate renforcé en Iridium -BW_GlasBlocks.5.name=Bloc de Verre Boronsilicate renforcé en Osmium -BW_GlasBlocks.6.name=Bloc de Verre Boronsilicate coloré (Rouge) -BW_GlasBlocks.7.name=Bloc de Verre Boronsilicate coloré (Vert) -BW_GlasBlocks.8.name=Bloc de Verre Boronsilicate coloré (Violet) -BW_GlasBlocks.9.name=Bloc de Verre Boronsilicate coloré (Jaune) -BW_GlasBlocks.10.name=Bloc de Verre Boronsilicate coloré (Vert Clair) -BW_GlasBlocks.11.name=Bloc de Verre Boronsilicate coloré (Marron) +BW_GlasBlocks.1.name=Bloc de Verre Borosilicate renforcé en Nickel +BW_GlasBlocks.2.name=Bloc de Verre Borosilicate renforcé en Tungsten +BW_GlasBlocks.3.name=Bloc de Verre Borosilicate renforcé en Chrome +BW_GlasBlocks.4.name=Bloc de Verre Borosilicate renforcé en Iridium +BW_GlasBlocks.5.name=Bloc de Verre Borosilicate renforcé en Osmium +BW_GlasBlocks.6.name=Bloc de Verre Borosilicate coloré (Rouge) +BW_GlasBlocks.7.name=Bloc de Verre Borosilicate coloré (Vert) +BW_GlasBlocks.8.name=Bloc de Verre Borosilicate coloré (Violet) +BW_GlasBlocks.9.name=Bloc de Verre Borosilicate coloré (Jaune) +BW_GlasBlocks.10.name=Bloc de Verre Borosilicate coloré (Vert Clair) +BW_GlasBlocks.11.name=Bloc de Verre Borosilicate coloré (Marron) BW_GlasBlocks.12.name=Thorium Yttrium Glass Block tooltip.glas.0.name=Tier de verre: @@ -100,7 +100,7 @@ tooltip.tile.waterpump.0.name=Produit tooltip.tile.waterpump.1.name=L/s Water quand il est alimenté. tooltip.tile.waterpump.2.name=Doit être placé sur le sol. -tooltip.tile.mbf.0.name=Bloc contrôleur pour le haut fourneau;Taille(LxHxP): 15x20x15 (creux);Contrôleur: 3ème couche centré au milieu;Intérieur 13x18x13 bobines de chauffage (creux);Extérieur 15x18x15 Verre Boronsilicate;Le verre limite le tier d'énergie en entrée;1+ Trappe/Bus d'entrée (n'importe quel bloc d'enveloppe);1+ bus de sortie(n'importe quel bloc d'enveloppe);1+ trappe d'énergie (n'importe quel bloc d'enveloppe);1x trappe de maintenance (n'importe quel bloc d'enveloppe);Blocs d'enveloppe de machine résistant à la chaleur pour l'extérieur 15x15 (couche 20);La récupération se câle sur le tier de la trappe d'échappement;Blocs d'enveloppe de machine résistant à la chaleur pour la base;Chaque 900K supérieur à la température de base donne 5% de rapidité (multiplicativement);Chaque 1800k supérieur à la température de base donne un overclock gratuit;Chaque overclock reduit le temps de craft de 25% et augmente la consommation d'EU/t de 400%;Cause une pollution maximale +tooltip.tile.mbf.0.name=Bloc contrôleur pour le haut fourneau;Taille(LxHxP): 15x20x15 (creux);Contrôleur: 3ème couche centré au milieu;Intérieur 13x18x13 bobines de chauffage (creux);Extérieur 15x18x15 Verre Borosilicate;Le verre limite le tier d'énergie en entrée;1+ Trappe/Bus d'entrée (n'importe quel bloc d'enveloppe);1+ bus de sortie(n'importe quel bloc d'enveloppe);1+ trappe d'énergie (n'importe quel bloc d'enveloppe);1x trappe de maintenance (n'importe quel bloc d'enveloppe);Blocs d'enveloppe de machine résistant à la chaleur pour l'extérieur 15x15 (couche 20);La récupération se câle sur le tier de la trappe d'échappement;Blocs d'enveloppe de machine résistant à la chaleur pour la base;Chaque 900K supérieur à la température de base donne 5% de rapidité (multiplicativement);Chaque 1800k supérieur à la température de base donne un overclock gratuit;Chaque overclock reduit le temps de craft de 25% et augmente la consommation d'EU/t de 400%;Cause une pollution maximale tooltip.tile.mbf.1.name=Pollution par seconde tooltip.tile.mvf.0.name=Bloc contrôleur pour le Méga Refroidisseur A Vide;Refroidit très vite les lingots chauds et les cellules;Taille(LxHxP): 15x15x15 (Creux);Contrôleur: (centré devant);1x Bus d'entrée (n'importe quel bloc d'enveloppe);1x Bus de sortie (n'importe quel bloc d'enveloppe);1x Trappe de maintenance (n'importe quel bloc d'enveloppe);1x Trappe d'énergie (n'importe quel bloc d'enveloppe);Blocs d'enveloppe de machine résistant au froid pour le reste tooltip.tile.bvat.0.name=Bloc contrôleur pour la Bio Cuve;Taille(LxHxP): 5x4x5;Le haut et le bas sont des bloc d'enveloppe en acier inoxydable;Le haut et le bas doivent contenir:;1x trappe de Maintenance, 1x trappe de sortie;1 ou plus de trappe d'entrée, 1 ou plus de bus d'entrée, 0-1 trappe radio;Les deux couches du milieu doivent être construites avec du verre, (creux);Le verre peut être n'importe le quel, i.e. le Verre transparent de Tinkers Construct;Certaines recettes ont besoin de verre plus avancés;Pour un boost d'efficacité maximum gardez la trappe de sortie toujours remplie à moitié! -- cgit From 104b7a99fad2e6b4e16c99bdd87459e630cb9b0d Mon Sep 17 00:00:00 2001 From: boubou19 Date: Thu, 23 Apr 2020 19:17:47 +0200 Subject: updated fr_FR translation (#67) Former-commit-id: cab236b0321d3a7535fa95c508f7de8140ebd307 --- .../resources/assets/bartworks/lang/fr_FR.lang | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/main/resources/assets/bartworks/lang/fr_FR.lang b/src/main/resources/assets/bartworks/lang/fr_FR.lang index bdf54486f7..4fc3e1890f 100644 --- a/src/main/resources/assets/bartworks/lang/fr_FR.lang +++ b/src/main/resources/assets/bartworks/lang/fr_FR.lang @@ -3,9 +3,9 @@ item.GT_Rockcutter_Item_LV.name=Coupeur de roche LV item.GT_Rockcutter_Item_MV.name=Coupeur de roche MV item.GT_Rockcutter_Item_HV.name=Coupeur de roche HV item.GT_Teslastaff_Item.name=Bâton Tesla -BW_ItemBlocks.0.name=Etched Lapis Cell -BW_ItemBlocks.1.name=Plated Lapis Cell -GT_LESU_CASING.0.name=Bloc enveloppe du LESU +BW_ItemBlocks.0.name=Cellule de Lapis Engravée +BW_ItemBlocks.1.name=Cellule de Lapis Plaquée +GT_LESU_CASING.0.name=Bloc carter du LESU itemGroup.bartworks=BartWorks inter-temporel BW_Machinery_Casings.0.name=Bloc de Ferrite en Nickel-Zinc @@ -55,7 +55,7 @@ BW_GlasBlocks.8.name=Bloc de Verre Borosilicate coloré (Violet) BW_GlasBlocks.9.name=Bloc de Verre Borosilicate coloré (Jaune) BW_GlasBlocks.10.name=Bloc de Verre Borosilicate coloré (Vert Clair) BW_GlasBlocks.11.name=Bloc de Verre Borosilicate coloré (Marron) -BW_GlasBlocks.12.name=Thorium Yttrium Glass Block +BW_GlasBlocks.12.name=Bloc de Verre Thorium Yttrium tooltip.glas.0.name=Tier de verre: tooltip.LESU.0.name=Capacité maximum! @@ -100,16 +100,16 @@ tooltip.tile.waterpump.0.name=Produit tooltip.tile.waterpump.1.name=L/s Water quand il est alimenté. tooltip.tile.waterpump.2.name=Doit être placé sur le sol. -tooltip.tile.mbf.0.name=Bloc contrôleur pour le haut fourneau;Taille(LxHxP): 15x20x15 (creux);Contrôleur: 3ème couche centré au milieu;Intérieur 13x18x13 bobines de chauffage (creux);Extérieur 15x18x15 Verre Borosilicate;Le verre limite le tier d'énergie en entrée;1+ Trappe/Bus d'entrée (n'importe quel bloc d'enveloppe);1+ bus de sortie(n'importe quel bloc d'enveloppe);1+ trappe d'énergie (n'importe quel bloc d'enveloppe);1x trappe de maintenance (n'importe quel bloc d'enveloppe);Blocs d'enveloppe de machine résistant à la chaleur pour l'extérieur 15x15 (couche 20);La récupération se câle sur le tier de la trappe d'échappement;Blocs d'enveloppe de machine résistant à la chaleur pour la base;Chaque 900K supérieur à la température de base donne 5% de rapidité (multiplicativement);Chaque 1800k supérieur à la température de base donne un overclock gratuit;Chaque overclock reduit le temps de craft de 25% et augmente la consommation d'EU/t de 400%;Cause une pollution maximale +tooltip.tile.mbf.0.name=Bloc contrôleur pour le haut fourneau;Taille(LxHxP): 15x20x15 (creux);Contrôleur: 3ème couche centré au milieu;Intérieur 13x18x13 bobines de chauffage (creux);Extérieur 15x18x15 Verre Borosilicate;Le verre limite le tier d'énergie en entrée;1+ Trappe/Bus d'entrée (n'importe quel bloc carter);1+ bus de sortie(n'importe quel bloc carter);1+ trappe d'énergie (n'importe quel bloc carter);1x trappe de maintenance (n'importe quel bloc carter);Blocs carter de machine résistant à la chaleur pour l'extérieur 15x15 (couche 20);La récupération se câle sur le tier de la trappe d'échappement;Blocs carter de machine résistant à la chaleur pour la base;Chaque 900K supérieur à la température de base donne 5% de rapidité (multiplicativement);Chaque 1800k supérieur à la température de base donne un overclock gratuit;Chaque overclock reduit le temps de craft de 25% et augmente la consommation d'EU/t de 400%;Cause une pollution maximale. tooltip.tile.mbf.1.name=Pollution par seconde -tooltip.tile.mvf.0.name=Bloc contrôleur pour le Méga Refroidisseur A Vide;Refroidit très vite les lingots chauds et les cellules;Taille(LxHxP): 15x15x15 (Creux);Contrôleur: (centré devant);1x Bus d'entrée (n'importe quel bloc d'enveloppe);1x Bus de sortie (n'importe quel bloc d'enveloppe);1x Trappe de maintenance (n'importe quel bloc d'enveloppe);1x Trappe d'énergie (n'importe quel bloc d'enveloppe);Blocs d'enveloppe de machine résistant au froid pour le reste -tooltip.tile.bvat.0.name=Bloc contrôleur pour la Bio Cuve;Taille(LxHxP): 5x4x5;Le haut et le bas sont des bloc d'enveloppe en acier inoxydable;Le haut et le bas doivent contenir:;1x trappe de Maintenance, 1x trappe de sortie;1 ou plus de trappe d'entrée, 1 ou plus de bus d'entrée, 0-1 trappe radio;Les deux couches du milieu doivent être construites avec du verre, (creux);Le verre peut être n'importe le quel, i.e. le Verre transparent de Tinkers Construct;Certaines recettes ont besoin de verre plus avancés;Pour un boost d'efficacité maximum gardez la trappe de sortie toujours remplie à moitié! +tooltip.tile.mvf.0.name=Bloc contrôleur pour le Méga Refroidisseur A Vide;Refroidit très vite les lingots chauds et les cellules;Taille(LxHxP): 15x15x15 (Creux);Contrôleur: (centré devant);1x Bus d'entrée (n'importe quel bloc carter);1x Bus de sortie (n'importe quel bloc carter);1x Trappe de maintenance (n'importe quel bloc carter);1x Trappe d'énergie (n'importe quel bloc carter);Blocs carter de machine résistant au froid pour le reste. +tooltip.tile.bvat.0.name=Bloc contrôleur pour la Bio Cuve;Taille(LxHxP): 5x4x5;Le haut et le bas sont des bloc carter en acier inoxydable;Le haut et le bas doivent contenir:;1x trappe de Maintenance, 1x trappe de sortie;1 ou plus de trappe d'entrée, 1 ou plus de bus d'entrée, 0-1 trappe radio;Les deux couches du milieu doivent être construites avec du verre, (creux);Le verre peut être n'importe le quel, i.e. le Verre transparent de Tinkers Construct;Certaines recettes ont besoin de verre plus avancés;Pour un boost d'efficacité maximum gardez la trappe de sortie toujours remplie à moitié! tooltip.tile.windmill.0.name=Un broyeur primitif fonctionnant a l'énergie cinétique.;Taille(LxHxP): 7x12x7;Couche 1: 7x7 Briques, les coins sont laissés vide,le contrôleur est centré devant.;(creux), les mur doivent contenir au moins un Dispenseur;Couche 7: 7x7 Planches de Bois. les coins sont laissés vide, (creux).;Couche 8: 7x7 Planches de Bois. les coins sont laissés vide, (creux),;le bloc centré devant doit être une Boîte d'arbre de transmission primitive.;Couche 9: 7x7 Planches de Bois. les coins sont laissés vide, (creux).;Couche 11: 3x3 Planches de Bois. les coins sont pleins, (creux).;A besoin d'un Rotor d'éolienne dans la Boîte d'arbre de transmission pour fonctionner.;Les objets d'entrée doivent aller dans le contrôleur.;Les objets de sortie apparaîtront dans les Dispenseurs.;C'est plus rapide dans les régions venteuses (comme les éoliennes IC2). tooltip.tile.lesu.0.name=Bloc contrôleur pour le GT2-Stylé L.E.S.U.;Taille: n'importe; -tooltip.tile.lesu.1.name=Stockage par enveloppe du LESU: -tooltip.tile.lesu.2.name=EU de sortie: le nombre de blocs d'enveloppe LESU EU d'entrée: prochain Tier de voltage après les EU de sortie;l'ampérage d'entrée/sortie peut être configurée via 4 Circuits dans le GUI;La face de sortie à un point dessus.; +tooltip.tile.lesu.1.name=Stockage par carter du LESU: +tooltip.tile.lesu.2.name=EU de sortie: le nombre de blocs carter LESU;EU d'entrée: prochain Tier de voltage après les EU de sortie;l'ampérage d'entrée/sortie peut être configurée via 4 Circuits dans le GUI;La face de sortie à un point dessus. tooltip.tile.lesu.3.name=Seulement un seul contrôleur autorisé, pas de partage des murs! -tooltip.tile.manualtravo.0.name=Bloc contrôleur pour le Transformateur Manuel;4 modes de fonctionnement;Fonctionne avec 2 modes en ce moment:;Mode 1: Circuit 0 dans le contrôleur: unique source et ascendant;Mode 2: Circuit 1 dans le contrôleur: unique source et descendant;Mode 3: Circuit 2 dans le contrôleur: plusieurs sources et ascendant;Mode 4: Circuit 3 dans le contrôleur: plusieurs sources et descendant;Pour les modes directs: 3xHx3;La base doit contenir au moins une trappe d'énergie;1 Couche de Blocs de bobinage de Transformateur pour chaque tier converti;Au milieu des Blocs de bobinage de Transformeur il doit y avoir un Bloc de Ferrite en Nickel-Zinc;Le haut doit contenir au moins une Trappe Dynamo;La trappe de maintenance peut être placée n'importe où;Les modes avec plusieurs sources sont désactivés pour le moment +tooltip.tile.manualtravo.0.name=Bloc contrôleur pour le Transformateur Manuel;4 modes de fonctionnement;Fonctionne avec 2 modes en ce moment:;Mode 1: Circuit 0 dans le contrôleur: unique source et ascendant;Mode 2: Circuit 1 dans le contrôleur: unique source et descendant;Mode 3: Circuit 2 dans le contrôleur: plusieurs sources et ascendant;Mode 4: Circuit 3 dans le contrôleur: plusieurs sources et descendant;Pour les modes directs: 3xHx3;La base doit contenir au moins une trappe d'énergie;1 Couche de Blocs de bobinage de Transformateur pour chaque tier converti;Au milieu des Blocs de bobinage de Transformeur il doit y avoir un Bloc de Ferrite en Nickel-Zinc;Le haut doit contenir au moins une Trappe Dynamo;La trappe de maintenance peut être placée n'importe où;Les modes avec plusieurs sources sont désactivés pour le moment. tooltip.tile.tiereddsc.0.name=Voltage: tooltip.tile.tiereddsc.1.name=Ampérage d'entrée: tooltip.tile.tiereddsc.2.name=Ampérage de sortie: @@ -140,24 +140,24 @@ tile.bw.mbf.name=Méga Haut Fourneau tile.bw.mvf.name=Méga Refroidisseur A Vide tile.biolab.name=Bio Lab tile.biovat.name=Bio Cuve -tile.radiohatch.name=Trappe Radio +tile.radiohatch.name=Trappe Radioactive tile.bw.windmill.name=Eolienne tile.manutrafo.name=Transformateur Manuel -item.TRISOPellet.name=TRISO pebble -item.TRISOPelletBall.name=TRISO pebble ball -item.BISOPelletBall.name=BISO pebble ball -item.BISOPellet.name=BISO pebble -item.TRISOPelletCompound.name=TRISO pebble compund -item.BISOPelletCompound.name=BISO pebble compund -itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials +item.TRISOPellet.name=Galet TRISO +item.TRISOPelletBall.name=Boule De Galets TRISO +item.BISOPelletBall.name=Boule De Galets BISO +item.BISOPellet.name=Galet TRISO +item.TRISOPelletCompound.name=Composé De Galet TRISO +item.BISOPelletCompound.name=Composé De Galet BISO +itemGroup.bartworksMetaMaterials=Méta Matériaux De BartWorks -tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so! +tooltip.tile.eic.0.name=Bloc Contrôleur pour le Compresseur à Implosion Electrique;Taille (LxHxP): 3x9x3;Utilise de l'Electricité à la place d'Explosifs;Contrôleur: couche 3, devant, centré;Couches 1 et 9: carter de machine en acier solide, pour chaque couche: 1 Trappe d'Energie au milieu;Couche 2,3,7,8: Milieu: Bloc de Ferrite en Nickel-Zinc, Extérieur: Bloc de bobinage de Transformateur;Couche 4,5,6: Blocs de Neutronium;1+ Bus d'Entrée, 1+ Bus de Sortie, 1 trappe de maintenance n'importe où dans les Blocs Carter en Acier Solide;Ne PAS obstruer ou miner les Parties mobile pendant le fonctionnement, ou explosion garantie! planet.Ross128b=Ross128b moon.Ross128ba=Ross128ba star.Ross128=Ross128 -solarsystem.Ross128System=Ross128-System +solarsystem.Ross128System=Système-Ross128 -itemGroup.bw.MetaItems.0=BartWorks Circuit Overhaul Items +itemGroup.bw.MetaItems.0=Objets du Remaniement des Circuits BartWorks -- cgit From 067e6c04b2416f73cb08698a245fd8c275e9258d Mon Sep 17 00:00:00 2001 From: botn365 <42187820+botn365@users.noreply.github.com> Date: Wed, 20 May 2020 17:52:24 +0200 Subject: Update UniversalTeleportType.java (#78) Former-commit-id: 759e85800479c99ddb51ef30f79cb693432c467a --- .../bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java index 16e4020459..372eb2471d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java @@ -63,6 +63,8 @@ public class UniversalTeleportType implements ITeleportType { @Override public void onSpaceDimensionChanged(World newWorld, EntityPlayerMP player, boolean ridingAutoRocket) { + if (ridingAutoRocket) + return; if ((player != null) && (GCPlayerStats.get(player).teleportCooldown <= 0)) { if (player.capabilities.isFlying) { player.capabilities.isFlying = false; -- cgit From 3997e9f86243bef67175609a6093fe6668cf5ed7 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 27 May 2020 12:53:54 +0200 Subject: Update to v13 * Added VoidMinerWIP Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Continue work on VoidMiner + Added a function to BWOreLayers + Made the voidminer actually WORK somewhat Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Continue work on VoidMiner + added recipes + made the void miner consume noble gasses to boost output + refactored code by quite a lot + added newest GT Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added GalacticGreg lib Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * added localisation of achivements Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * updated GTLib Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * updated GTlib Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Several fixes + Fixed BioVat + Added some Debug Commands + Changed Void Miner logic Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Refactor Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Refactor + removed Experimental ThreadedLoader + moved LoaderCalls into LoaderReference Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Refactor + moved FMLCommonHandler.instance().get(Effective)Side() into SideReference Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * made radio hatch compat call static Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Made More Stuff static + improved flow control Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added more Block-Recipes +version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * api changes + fixed void miner not consuming energy + Made API standalone (mostly) Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Made OrePrefixes lookups NullSecure Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * fixed a typo Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * LICENSE update Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added Config for Metas and Tiers for Ross + fixed GT++ compability Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Fixes + Fixed ConfigHandler initiating GTValues during coremod startup + Fixed MegaEBF sometimes overflowing Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * change recipes for Void Miner using Ore Drill Tier 6 bump gt dependencie and version * update code chicken core and gt version * Added VoidMiner Tiers + Added Recipes for Void Miners Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Fixed VoidMiner Output Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * added void miner localisation for achievements Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * fixed NPE Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Made Void Miner Times in Assembly Line more reasonable Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * fixed fermentation recipes in biovat Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added a force shutdown, due to licensing of GT++ Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Fixed Glass Checked + buffed Oganesson + made LoadItemContainers static + removed force shutdown Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Update WerkstoffLoader.java * Fix imports import cpw.mods.fml.common.Loader was missing * Redid CLS support Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Some new featues + Added Multiblock Updateability to BW Blocks + Added Pollution to WaterPump + Added new Windmill GUI + Refactored Windmill a bit Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added animation to windmill Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * add gt to libs folder to let jenkins build (cherry picked from commit 12f6dae5e2233b533bce1cf6b0c29e9e85a60a0b) * Various Development + Added TT support to MEBF and MVAC + Fixed Energy Logic on MDT + Fixed MEBF not outputting fluids on bottom hatches + added auto-export for water on the simple stirling pump + redid glass folder structure + added EBF / Large Chem circuit Unification + updated TT dependancy + version increase x2 Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Various Development (#75) + Added TT support to MEBF and MVAC + Fixed Energy Logic on MDT + Fixed MEBF not outputting fluids on bottom hatches + added auto-export for water on the simple stirling pump + redid glass folder structure + added EBF / Large Chem circuit Unification + updated TT dependancy + version increase x2 Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added TT Low Power Lasers + Fixed Circuit Logic and added bounds check + added TT Low Power recipes + updated GT-lib + version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Block changes2 (#77) * Various Development + Added TT support to MEBF and MVAC + Fixed Energy Logic on MDT + Fixed MEBF not outputting fluids on bottom hatches + added auto-export for water on the simple stirling pump + redid glass folder structure + added EBF / Large Chem circuit Unification + updated TT dependancy + version increase x2 Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added TT Low Power Lasers + Fixed Circuit Logic and added bounds check + added TT Low Power recipes + updated GT-lib + version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Redid LuV Osmiridium Replacer + version increase + deleted old lib Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Fixes + Unified usage of .hasItemType instead of bitshifts/ .getGenerationFeatures().hasXY() + removed a wrong cast + fixed textures + cleaned up code + removed *some* duplicate recipes for tool items + increased version, increased api version Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * fixed voidminer + fixed MEBF not working with LAZORS or Multi Amp hatches below UV-Glas + fixed LAZORS not exploding when they recive too much Amp lasers * Redid Radio Hatch Stuffs ~~~ + ItemStacks finally work properly + Forbid insertion of a non-Rad-Material + Version increase * fixes + disabled circuit unification + removed unused decoratePlanet on Ross128ba + changed "splitStack" to "setStackSize" + renamed "WorldProviderRoss128Ba" to "WorldProviderRoss128ba" * Math update + Added specialised functions for floor ceil wrap and clamp + Replaced old function calls + LowPower Pipes now have the IC2 glass fibre texture + fixed overflow on the AccessPriorityList + fixed "NOSUCHITEM rod" error + suppressed some warnings + version increase * Fixed Burned Out THTR Stuff * Had the wrong version number Co-authored-by: Dream-Master Co-authored-by: jackowski626 Former-commit-id: 3dce197579f950aa9c2e450e446e03c74b41dc83 --- .gitignore | 3 +- LICENSE | 2 +- build.gradle | 25 + build.properties | 8 +- libs/TecTech-1.7.10-3.7.3-deobf.jar.REMOVED.git-id | 1 - libs/TecTech-1.7.10-3.8.1-dev.jar.REMOVED.git-id | 1 + libs/gregtech-5.09.32-dev.jar.REMOVED.git-id | 1 - libs/gregtech-5.09.33.44-dev.jar.REMOVED.git-id | 1 + .../java/com/github/bartimaeusnek/ASM/BWCore.java | 11 +- .../bartworks/API/API_ConfigValues.java | 28 + .../bartimaeusnek/bartworks/API/API_REFERENCE.java | 3 +- .../bartworks/API/AcidGenFuelAdder.java | 14 +- .../bartworks/API/BioObjectAdder.java | 5 +- .../bartworks/API/BioObjectGetter.java | 4 +- .../bartworks/API/BioVatLogicAdder.java | 103 +- .../bartworks/API/LoaderReference.java | 88 ++ .../bartimaeusnek/bartworks/API/SideReference.java | 37 + .../bartworks/API/VoidMinerDropAdder.java | 46 + .../bartimaeusnek/bartworks/API/WerkstoffAPI.java | 15 +- .../bartworks/API/WerkstoffAdderRegistry.java | 16 +- .../bartimaeusnek/bartworks/API/package-info.java | 25 + .../github/bartimaeusnek/bartworks/GuiHandler.java | 6 +- .../github/bartimaeusnek/bartworks/MainMod.java | 452 +------- .../client/ClientEventHandler/TooltipCache.java | 5 +- .../client/gui/BW_GUIContainer_Windmill.java | 45 +- .../client/gui/GT_GUIContainer_RadioHatch.java | 2 +- .../client/textures/PrefixTextureLinker.java | 23 +- .../bartworks/common/blocks/BW_Blocks.java | 21 +- .../bartworks/common/blocks/BW_GlasBlocks.java | 14 +- .../common/blocks/BW_TileEntityContainer.java | 21 +- .../bartworks/common/commands/ChangeConfig.java | 3 +- .../common/commands/GetWorkingDirectory.java | 45 + .../bartworks/common/commands/RunGC.java | 45 + .../bartworks/common/configs/ConfigHandler.java | 70 +- .../bartworks/common/loaders/BeforeGTPreload.java | 6 +- .../bartworks/common/loaders/BioCultureLoader.java | 9 +- .../bartworks/common/loaders/BioItemList.java | 7 +- .../bartworks/common/loaders/BioLabLoader.java | 20 +- .../bartworks/common/loaders/BioRecipeLoader.java | 34 +- .../bartworks/common/loaders/FluidLoader.java | 15 +- .../bartworks/common/loaders/GTNHBlocks.java | 44 +- .../bartworks/common/loaders/ItemRegistry.java | 81 +- .../bartworks/common/loaders/LoaderRegistry.java | 33 - .../common/loaders/LocalisationLoader.java | 56 + .../bartworks/common/loaders/RecipeLoader.java | 210 +++- .../common/loaders/RegisterServerCommands.java | 39 + .../common/loaders/StaticRecipeChangeLoaders.java | 559 ++++++++++ .../bartworks/common/net/RendererPacket.java | 6 +- .../classic/BW_TileEntity_HeatedWaterPump.java | 80 +- .../tileentities/multis/GT_TileEntity_BioVat.java | 104 +- .../multis/GT_TileEntity_CrackingDistillTower.java | 4 +- .../tileentities/multis/GT_TileEntity_THTR.java | 61 +- .../multis/GT_TileEntity_Windmill.java | 319 +++--- .../mega/GT_TileEntity_MegaBlastFurnace.java | 442 ++++---- .../mega/GT_TileEntity_MegaDistillTower.java | 12 +- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 110 +- .../tiered/GT_MetaTileEntity_BioLab.java | 8 +- .../tiered/GT_MetaTileEntity_RadioHatch.java | 51 +- .../bartworks/neiHandler/NEIbartworksConfig.java | 79 ++ .../server/EventHandler/ServerEventHandler.java | 6 +- .../server/container/BW_Container_Windmill.java | 40 + .../container/GT_Container_CircuitProgrammer.java | 2 +- .../server/container/GT_Container_RadioHatch.java | 41 + .../bartworks/system/log/DebugLog.java | 68 -- .../bartworks/system/log/STFUGTPPLOG.java | 653 ------------ .../system/material/BW_MetaGenerated_Items.java | 20 +- .../system/material/BW_MetaGenerated_Ores.java | 7 +- .../material/BW_MetaGenerated_SmallOres.java | 4 +- .../BW_MetaGenerated_WerkstoffBlock_TE.java | 18 +- .../material/BW_MetaGenerated_WerkstoffBlocks.java | 23 +- .../CircuitGeneration/BW_CircuitsLoader.java | 31 +- .../material/CircuitGeneration/BW_Meta_Items.java | 8 +- .../CircuitGeneration/CircuitImprintLoader.java | 2 +- .../material/GT_Enhancement/BWGTMetaItems.java | 19 +- .../GT_Enhancement/GTMetaItemEnhancer.java | 11 +- .../material/GT_Enhancement/LuVTierEnhancer.java | 95 +- .../GT_Enhancement/PlatinumSludgeOverHaul.java | 32 +- .../bartworks/system/material/ThreadedLoader.java | 84 -- .../bartworks/system/material/Werkstoff.java | 308 +++--- .../bartworks/system/material/WerkstoffLoader.java | 1077 +++++++++++--------- .../processingLoaders/AdditionalRecipes.java | 276 ++++- .../material/processingLoaders/DownTierLoader.java | 5 +- .../processingLoaders/LoadItemContainers.java | 7 +- .../bartworks/system/oregen/BW_OreLayer.java | 12 +- .../bartworks/system/worldgen/GT_WorldgenUtil.java | 72 +- .../bartworks/system/worldgen/MapGenRuins.java | 7 +- .../bartimaeusnek/bartworks/util/BWRecipes.java | 238 +---- .../bartimaeusnek/bartworks/util/BW_Util.java | 144 ++- .../bartimaeusnek/bartworks/util/BioCulture.java | 5 +- .../bartimaeusnek/bartworks/util/EnumUtils.java | 68 ++ .../bartimaeusnek/bartworks/util/MathUtils.java | 85 +- .../bartimaeusnek/bartworks/util/MegaUtils.java | 54 + .../bartworks/util/NEIbartworksConfig.java | 79 -- .../bartworks/util/NoiseUtil/BartsNoise.java | 14 +- .../bartworks/util/NoiseUtil/SimplexNoise.java | 5 +- .../bartworks/util/NonNullWrappedHashMap.java | 62 ++ .../accessprioritylist/AccessPriorityList.java | 26 +- .../bartworks/util/flowerset/FlowerSet.java | 157 +++ .../bartimaeusnek/bartworks/util/log/DebugLog.java | 69 ++ .../bartworks/util/log/STFUGTPPLOG.java | 665 ++++++++++++ .../bartimaeusnek/bartworks/util/package-info.java | 26 + .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 24 +- .../crossmod/GTpp/loader/RadioHatchCompat.java | 9 +- .../bartimaeusnek/crossmod/cls/CLSCompat.java | 108 ++ .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 387 +++++++ .../galacticgreg/GT_TileEntity_VoidMiners.java | 124 +++ .../crossmod/galacticraft/GalacticraftProxy.java | 10 +- .../galacticraft/UniversalTeleportType.java | 6 +- .../planets/ross128b/ChunkProviderRoss128b.java | 6 +- .../planets/ross128ba/ChunkProviderRoss128ba.java | 24 +- .../planets/ross128ba/WorldProviderRoss128Ba.java | 118 --- .../planets/ross128ba/WorldProviderRoss128ba.java | 119 +++ .../solarsystems/Ross128SolarSystem.java | 14 +- .../openComputers/TileEntity_GTDataServer.java | 6 +- .../crossmod/tectech/TecTechEnabledMulti.java | 89 ++ .../crossmod/tectech/TecTechResearchLoader.java | 68 +- .../crossmod/tectech/TecTechUtils.java | 148 +++ .../tectech/tileentites/tiered/LowPowerLaser.java | 116 +++ .../tiered/TT_Abstract_LowPowerLaserThingy.java | 148 +++ .../tiered/TT_MetaTileEntity_LowPowerLaserBox.java | 144 +++ .../TT_MetaTileEntity_LowPowerLaserDynamo.java | 95 ++ .../TT_MetaTileEntity_LowPowerLaserHatch.java | 78 ++ .../TT_MetaTileEntity_Pipe_Energy_LowPower.java | 113 ++ .../thaumcraft/util/ThaumcraftHandler.java | 30 +- .../resources/assets/bartworks/lang/de_DE.lang | 11 +- .../resources/assets/bartworks/lang/en_US.lang | 9 +- .../assets/bartworks/textures/GUI/GUI_Windmill.png | Bin 1094 -> 4857 bytes .../blocks/BoronSilicateGlassBlockRandlos_0.png | Bin 186 -> 0 bytes .../blocks/BoronSilicateGlassBlockRandlos_1.png | Bin 184 -> 0 bytes .../blocks/BoronSilicateGlassBlockRandlos_10.png | Bin 184 -> 0 bytes .../blocks/BoronSilicateGlassBlockRandlos_11.png | Bin 182 -> 0 bytes .../blocks/BoronSilicateGlassBlockRandlos_12.png | Bin 188 -> 0 bytes .../blocks/BoronSilicateGlassBlockRandlos_13.png | Bin 183 -> 0 bytes .../blocks/BoronSilicateGlassBlockRandlos_14.png | Bin 184 -> 0 bytes .../blocks/BoronSilicateGlassBlockRandlos_15.png | Bin 177 -> 0 bytes .../blocks/BoronSilicateGlassBlockRandlos_2.png | Bin 184 -> 0 bytes .../blocks/BoronSilicateGlassBlockRandlos_3.png | Bin 182 -> 0 bytes .../blocks/BoronSilicateGlassBlockRandlos_4.png | Bin 187 -> 0 bytes .../blocks/BoronSilicateGlassBlockRandlos_5.png | Bin 184 -> 0 bytes .../blocks/BoronSilicateGlassBlockRandlos_6.png | Bin 184 -> 0 bytes .../blocks/BoronSilicateGlassBlockRandlos_7.png | Bin 180 -> 0 bytes .../blocks/BoronSilicateGlassBlockRandlos_8.png | Bin 186 -> 0 bytes .../blocks/BoronSilicateGlassBlockRandlos_9.png | Bin 184 -> 0 bytes .../textures/blocks/BoronSilicateGlassBlock_0.png | Bin 211 -> 0 bytes .../textures/blocks/BoronSilicateGlassBlock_1.png | Bin 207 -> 0 bytes .../textures/blocks/BoronSilicateGlassBlock_10.png | Bin 228 -> 0 bytes .../textures/blocks/BoronSilicateGlassBlock_11.png | Bin 227 -> 0 bytes .../textures/blocks/BoronSilicateGlassBlock_12.png | Bin 207 -> 0 bytes .../textures/blocks/BoronSilicateGlassBlock_13.png | Bin 205 -> 0 bytes .../textures/blocks/BoronSilicateGlassBlock_14.png | Bin 207 -> 0 bytes .../textures/blocks/BoronSilicateGlassBlock_15.png | Bin 203 -> 0 bytes .../textures/blocks/BoronSilicateGlassBlock_2.png | Bin 211 -> 0 bytes .../textures/blocks/BoronSilicateGlassBlock_3.png | Bin 208 -> 0 bytes .../textures/blocks/BoronSilicateGlassBlock_4.png | Bin 209 -> 0 bytes .../textures/blocks/BoronSilicateGlassBlock_5.png | Bin 207 -> 0 bytes .../textures/blocks/BoronSilicateGlassBlock_6.png | Bin 206 -> 0 bytes .../textures/blocks/BoronSilicateGlassBlock_7.png | Bin 202 -> 0 bytes .../textures/blocks/BoronSilicateGlassBlock_8.png | Bin 227 -> 0 bytes .../textures/blocks/BoronSilicateGlassBlock_9.png | Bin 226 -> 0 bytes .../BoronSilicateGlassBlock_0.png | Bin 0 -> 211 bytes .../BoronSilicateGlassBlock_1.png | Bin 0 -> 207 bytes .../BoronSilicateGlassBlock_10.png | Bin 0 -> 228 bytes .../BoronSilicateGlassBlock_11.png | Bin 0 -> 227 bytes .../BoronSilicateGlassBlock_12.png | Bin 0 -> 207 bytes .../BoronSilicateGlassBlock_13.png | Bin 0 -> 205 bytes .../BoronSilicateGlassBlock_14.png | Bin 0 -> 207 bytes .../BoronSilicateGlassBlock_15.png | Bin 0 -> 203 bytes .../BoronSilicateGlassBlock_2.png | Bin 0 -> 211 bytes .../BoronSilicateGlassBlock_3.png | Bin 0 -> 208 bytes .../BoronSilicateGlassBlock_4.png | Bin 0 -> 209 bytes .../BoronSilicateGlassBlock_5.png | Bin 0 -> 207 bytes .../BoronSilicateGlassBlock_6.png | Bin 0 -> 206 bytes .../BoronSilicateGlassBlock_7.png | Bin 0 -> 202 bytes .../BoronSilicateGlassBlock_8.png | Bin 0 -> 227 bytes .../BoronSilicateGlassBlock_9.png | Bin 0 -> 226 bytes .../BoronSilicateGlassBlockRandlos_0.png | Bin 0 -> 186 bytes .../BoronSilicateGlassBlockRandlos_1.png | Bin 0 -> 184 bytes .../BoronSilicateGlassBlockRandlos_10.png | Bin 0 -> 184 bytes .../BoronSilicateGlassBlockRandlos_11.png | Bin 0 -> 182 bytes .../BoronSilicateGlassBlockRandlos_12.png | Bin 0 -> 188 bytes .../BoronSilicateGlassBlockRandlos_13.png | Bin 0 -> 183 bytes .../BoronSilicateGlassBlockRandlos_14.png | Bin 0 -> 184 bytes .../BoronSilicateGlassBlockRandlos_15.png | Bin 0 -> 177 bytes .../BoronSilicateGlassBlockRandlos_2.png | Bin 0 -> 184 bytes .../BoronSilicateGlassBlockRandlos_3.png | Bin 0 -> 182 bytes .../BoronSilicateGlassBlockRandlos_4.png | Bin 0 -> 187 bytes .../BoronSilicateGlassBlockRandlos_5.png | Bin 0 -> 184 bytes .../BoronSilicateGlassBlockRandlos_6.png | Bin 0 -> 184 bytes .../BoronSilicateGlassBlockRandlos_7.png | Bin 0 -> 180 bytes .../BoronSilicateGlassBlockRandlos_8.png | Bin 0 -> 186 bytes .../BoronSilicateGlassBlockRandlos_9.png | Bin 0 -> 184 bytes .../textures/items/BurnedOutBISOPellet.png | Bin 0 -> 266 bytes .../textures/items/BurnedOutBISOPelletBall.png | Bin 0 -> 346 bytes .../textures/items/BurnedOutTRISOPellet.png | Bin 0 -> 258 bytes .../textures/items/BurnedOutTRISOPelletBall.png | Bin 0 -> 291 bytes 195 files changed, 6795 insertions(+), 3412 deletions(-) delete mode 100644 libs/TecTech-1.7.10-3.7.3-deobf.jar.REMOVED.git-id create mode 100644 libs/TecTech-1.7.10-3.8.1-dev.jar.REMOVED.git-id delete mode 100644 libs/gregtech-5.09.32-dev.jar.REMOVED.git-id create mode 100644 libs/gregtech-5.09.33.44-dev.jar.REMOVED.git-id create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEIbartworksConfig.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/log/STFUGTPPLOG.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechUtils.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_0.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_1.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_10.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_11.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_12.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_13.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_14.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_15.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_2.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_3.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_4.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_5.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_6.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_7.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_8.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_9.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_0.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_1.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_10.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_11.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_12.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_13.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_14.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_15.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_2.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_3.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_4.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_5.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_6.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_7.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_8.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_9.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_0.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_1.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_10.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_11.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_12.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_13.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_14.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_15.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_2.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_3.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_4.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_5.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_6.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_7.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_8.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_9.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_0.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_1.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_10.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_11.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_12.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_13.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_14.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_15.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_2.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_3.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_4.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_5.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_6.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_7.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_8.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_9.png create mode 100644 src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPellet.png create mode 100644 src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPelletBall.png create mode 100644 src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPellet.png create mode 100644 src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPelletBall.png diff --git a/.gitignore b/.gitignore index 4d09b92927..1801f4555b 100644 --- a/.gitignore +++ b/.gitignore @@ -41,7 +41,8 @@ hs_err_pid* !/libs/CodeChickenCore-1.7.10-1.0.4.35-dev.jar !/libs/CodeChickenLib-1.7.10-1.1.1.99-dev.jar !/libs/NotEnoughItems-1.7.10-1.0.4.95-dev.jar -!/libs/gregtech-5.09.32-dev.jar +!/libs/gregtech-5.09.33.32-dev.jar +!/libs/GalacticGreg-1.7.10-1.0.3.jar SetupWorkspaces.bat SetupDevWorkspaces.bat Idea.bat diff --git a/LICENSE b/LICENSE index ab602974d2..b94f54c82c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 +Copyright (c) 2018-2020 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/build.gradle b/build.gradle index decc7f2518..3e1ffaa99c 100644 --- a/build.gradle +++ b/build.gradle @@ -30,6 +30,28 @@ idea{ } } +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + import de.undercouch.gradle.tasks.download.Download sourceCompatibility = JavaVersion.VERSION_1_8 @@ -157,6 +179,9 @@ jar { task apiJar(type: Jar){ from(sourceSets.main.output) { include 'com/github/bartimaeusnek/bartworks/API/**' + include 'com/github/bartimaeusnek/bartworks/util/**' + include 'com/github/bartimaeusnek/bartworks/system/material/Werkstoff.class' + include 'com/github/bartimaeusnek/crossmod/thaumcraft/util/**' } classifier = 'API' } diff --git a/build.properties b/build.properties index 28cb48a532..0c2cf1116f 100644 --- a/build.properties +++ b/build.properties @@ -22,11 +22,11 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=12 -APIVersion=8 +buildNumber=13 +APIVersion=11 ic2.version=2.2.828-experimental -gregtech.version=5.09.32.36 -gregtech.jenkinsbuild=143 +gregtech.version=5.09.33.38 +gregtech.jenkinsbuild=454 applecore.version=1.7.10-3.1.1 galacticraft.version=1.7-3.0.12.504 enderio.version=1.7.10-2.3.0.429_beta diff --git a/libs/TecTech-1.7.10-3.7.3-deobf.jar.REMOVED.git-id b/libs/TecTech-1.7.10-3.7.3-deobf.jar.REMOVED.git-id deleted file mode 100644 index ffef551870..0000000000 --- a/libs/TecTech-1.7.10-3.7.3-deobf.jar.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -848964ad2a6250cb5adc79bde00136058f994d99 \ No newline at end of file diff --git a/libs/TecTech-1.7.10-3.8.1-dev.jar.REMOVED.git-id b/libs/TecTech-1.7.10-3.8.1-dev.jar.REMOVED.git-id new file mode 100644 index 0000000000..ad85afb9bc --- /dev/null +++ b/libs/TecTech-1.7.10-3.8.1-dev.jar.REMOVED.git-id @@ -0,0 +1 @@ +edbdb613c8251af1451312d5dc7a4ee99c66b13f \ No newline at end of file diff --git a/libs/gregtech-5.09.32-dev.jar.REMOVED.git-id b/libs/gregtech-5.09.32-dev.jar.REMOVED.git-id deleted file mode 100644 index 4fa1e5f1b5..0000000000 --- a/libs/gregtech-5.09.32-dev.jar.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -44c5cd845f848818d656a41ae2aacb83fa5275db \ No newline at end of file diff --git a/libs/gregtech-5.09.33.44-dev.jar.REMOVED.git-id b/libs/gregtech-5.09.33.44-dev.jar.REMOVED.git-id new file mode 100644 index 0000000000..ecf897dd93 --- /dev/null +++ b/libs/gregtech-5.09.33.44-dev.jar.REMOVED.git-id @@ -0,0 +1 @@ +1d948ce2fb4969a62ea55a6bc396d61f209cd52a \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java index 578b768652..6592da592f 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,6 @@ import com.google.common.eventbus.EventBus; import com.google.common.eventbus.Subscribe; import cpw.mods.fml.common.DummyModContainer; import cpw.mods.fml.common.LoadController; -import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModMetadata; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.versioning.ArtifactVersion; @@ -60,11 +59,11 @@ public class BWCore extends DummyModContainer { @Subscribe public void preInit(FMLPreInitializationEvent event) { - shouldTransform[0] = Loader.isModLoaded("ExtraUtilities") && ConfigHandler.enabledPatches[0]; - shouldTransform[1] = Loader.isModLoaded("ExtraUtilities") && ConfigHandler.enabledPatches[1]; - shouldTransform[3] = Loader.isModLoaded("Thaumcraft") && ConfigHandler.enabledPatches[3]; + shouldTransform[0] = ConfigHandler.enabledPatches[0]; + shouldTransform[1] = ConfigHandler.enabledPatches[1]; + shouldTransform[3] = ConfigHandler.enabledPatches[3]; shouldTransform[4] = true; - shouldTransform[5] = Loader.isModLoaded("RWG") && ConfigHandler.enabledPatches[5]; + shouldTransform[5] = ConfigHandler.enabledPatches[5]; shouldTransform[6] = ConfigHandler.enabledPatches[6]; //shouldTransform[6] = true; BWCore.BWCORE_LOG.info("Extra Utilities found and ASM Patch enabled? " + shouldTransform[0]); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java new file mode 100644 index 0000000000..3839d28038 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +public class API_ConfigValues { + //One-Side-Only + public static boolean debugLog = true; +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java index f9fcd4bd37..74c6a7c778 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -19,7 +19,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - package com.github.bartimaeusnek.bartworks.API; public final class API_REFERENCE { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java index 9c55b47440..909489a0c6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -28,15 +28,15 @@ import net.minecraftforge.fluids.FluidStack; public final class AcidGenFuelAdder { - public static boolean addLiquidFuel(Materials M, int burn) { - return ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(M, burn) != null; + public static void addLiquidFuel(Materials M, int burn) { + ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(M, burn); } - public static boolean addLiquidFuel(FluidStack fluidStack, int burn) { - return ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(fluidStack, burn) != null; + public static void addLiquidFuel(FluidStack fluidStack, int burn) { + ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(fluidStack, burn); } - public static boolean addMoltenFuel(Materials M, int burn) { - return ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addMoltenFuel(M, burn) != null; + public static void addMoltenFuel(Materials M, int burn) { + ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addMoltenFuel(M, burn); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java index 1035ab7d5c..c8806d269b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,7 +26,6 @@ import com.github.bartimaeusnek.bartworks.util.BioCulture; import com.github.bartimaeusnek.bartworks.util.BioDNA; import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; -import cpw.mods.fml.common.Loader; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.objects.GT_Fluid; @@ -163,7 +162,7 @@ public final class BioObjectAdder { * If you get NPE's related to BioCultures (most likely because of Load Order or creating BioCultures after the postinit Phase) execute this. */ public static void regenerateBioFluids() { - FluidStack dnaFluid = Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L); + FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L); for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.getFluidNotSet()) { B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()})); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java index b38fc86344..11ebdccb3d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -83,6 +83,8 @@ public final class BioObjectGetter { return BioObjectGetter.convertDataToDNA(BioObjectGetter.convertBioPlasmidToData(bioPlasmid)); } + //UNSAFE needs to be reworked! + public static Collection getAllPetriDishes() { return BioItemList.getAllPetriDishes(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java index 7e17d323e6..91e6b64e15 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,8 +22,13 @@ package com.github.bartimaeusnek.bartworks.API; -import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; +import gregtech.api.util.GT_ModHandler; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; @@ -41,25 +46,113 @@ public final class BioVatLogicAdder { public static class RadioHatch { + public static void runBasicItemIntegration() { + giveItemStackRadioHatchAbilites(ItemList.ThoriumCell_1.get(1), Materials.Thorium, 3); + giveItemStackRadioHatchAbilites(ItemList.ThoriumCell_2.get(1), Materials.Thorium, 6); + giveItemStackRadioHatchAbilites(ItemList.ThoriumCell_4.get(1), Materials.Thorium, 12); + + giveItemStackRadioHatchAbilites(ItemList.NaquadahCell_1.get(1), Materials.Naquadah, 3); + giveItemStackRadioHatchAbilites(ItemList.NaquadahCell_2.get(1), Materials.Naquadah, 6); + giveItemStackRadioHatchAbilites(ItemList.NaquadahCell_4.get(1), Materials.Naquadah, 12); + + giveItemStackRadioHatchAbilites(ItemList.Moxcell_1.get(1), Materials.Plutonium, 3); + giveItemStackRadioHatchAbilites(ItemList.Moxcell_2.get(1), Materials.Plutonium, 6); + giveItemStackRadioHatchAbilites(ItemList.Moxcell_4.get(1), Materials.Plutonium, 12); + + giveItemStackRadioHatchAbilites(ItemList.Uraniumcell_1.get(1), Materials.Uranium, 3); + giveItemStackRadioHatchAbilites(ItemList.Uraniumcell_2.get(1), Materials.Uranium, 6); + giveItemStackRadioHatchAbilites(ItemList.Uraniumcell_4.get(1), Materials.Uranium, 12); + + giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TiberiumCell_1.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 3); + giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TiberiumCell_2.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 6); + giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TiberiumCell_4.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 12); + + giveItemStackRadioHatchAbilites(ItemList.MNqCell_1.get(1), Materials.Naquadria, 3); + giveItemStackRadioHatchAbilites(ItemList.MNqCell_2.get(1), Materials.Naquadria, 6); + giveItemStackRadioHatchAbilites(ItemList.MNqCell_4.get(1), Materials.Naquadria, 12); + + giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TheCoreCell.get(1), Materials.Naquadah, 96); + + giveItemStackRadioHatchAbilites(ItemList.Depleted_Thorium_1.get(1), Materials.Thorium, 3, 10); + giveItemStackRadioHatchAbilites(ItemList.Depleted_Thorium_2.get(1), Materials.Thorium, 6, 10); + giveItemStackRadioHatchAbilites(ItemList.Depleted_Thorium_4.get(1), Materials.Thorium, 12, 10); + + giveItemStackRadioHatchAbilites(ItemList.Depleted_Naquadah_1.get(1), Materials.Naquadah, 3, 10); + giveItemStackRadioHatchAbilites(ItemList.Depleted_Naquadah_2.get(1), Materials.Naquadah, 6, 10); + giveItemStackRadioHatchAbilites(ItemList.Depleted_Naquadah_4.get(1), Materials.Naquadah, 12, 10); + + giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorMOXSimpledepleted",1), Materials.Plutonium, 3, 10); + giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorMOXDualdepleted",1), Materials.Plutonium, 6, 10); + giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorMOXQuaddepleted",1), Materials.Plutonium, 12, 10); + + giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorUraniumSimpledepleted",1), Materials.Uranium, 3, 10); + giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorUraniumDualdepleted",1), Materials.Uranium, 6, 10); + giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorUraniumQuaddepleted",1), Materials.Uranium, 12, 10); + + giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 3, 10); + giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 6, 10); + giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 12, 10); + + giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_1.get(1), Materials.Naquadria, 3, 10); + giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_2.get(1), Materials.Naquadria, 6, 10); + giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_4.get(1), Materials.Naquadria, 12, 10); + + giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), Materials.Naquadah, 96, 10); + } + private static final HashSet MaSv = new HashSet<>(); private static final HashMap IsSv = new HashMap<>(); + private static final HashMap IsKg = new HashMap<>(); + private static final HashMap IsColor = new HashMap<>(); public static HashSet getMaSv() { return RadioHatch.MaSv; } + public static HashMap getIsKg() { + return IsKg; + } + public static HashMap getIsSv() { return RadioHatch.IsSv; } - public static void setOverrideSvForMaterial(Materials m, Integer sv) { + public static HashMap getIsColor() { + return IsColor; + } + + public static void setOverrideSvForMaterial(Materials m, int sv) { MaSv.add(new BioVatLogicAdder.MaterialSvPair(m, sv)); } - public static void giveItemStackRadioHatchAbilites(ItemStack stack, Integer sv) { + public static void giveItemStackRadioHatchAbilites(ItemStack stack, int sv) { IsSv.put(stack, sv); } + public static void giveItemStackRadioHatchAbilites(ItemStack stack, Materials materials) { + IsSv.put(stack, BW_Util.calculateSv(materials)); + } + + public static void giveItemStackRadioHatchAbilites(ItemStack stack, int sv, int kg) { + IsSv.put(stack, sv); + IsKg.put(stack, kg); + } + + public static void giveItemStackRadioHatchAbilites(ItemStack stack, Materials materials, int kg) { + giveItemStackRadioHatchAbilites(stack, BW_Util.calculateSv(materials), kg); + IsColor.put(stack, materials.getRGBA()); + } + + public static void giveItemStackRadioHatchAbilites(ItemStack stack, Materials materials, int kg, int divider) { + giveItemStackRadioHatchAbilites(stack, BW_Util.calculateSv(materials) / divider, kg); + IsColor.put(stack, materials.getRGBA()); + } + + public static void giveItemStackRadioHatchAbilites(ItemStack stack, int sv, int kg, short[] color) { + giveItemStackRadioHatchAbilites(stack, sv, kg); + IsColor.put(stack, color); + } + public static int MaxSV = 150; public static int getMaxSv() { @@ -94,7 +187,7 @@ public final class BioVatLogicAdder { if (ret) BioVatGlass.glasses.put(new BlockMetaPair(block, (byte) meta), (byte) tier); else - MainMod.LOGGER.warn("Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!"); + new IllegalArgumentException("Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!").printStackTrace(); block = null; return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java new file mode 100644 index 0000000000..16ec04b43e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +import cpw.mods.fml.common.Loader; + +/** + * DO NOT CALL THIS IN THE CORE MOD! IT WILL __NOT__ WORK AND FUCK EVERYTHING UP! + */ +public class LoaderReference { + private LoaderReference(){} + + public static boolean Natura; + public static boolean RandomThings; + public static boolean TConstruct; + public static boolean chisel; + public static boolean Railcraft; + public static boolean Ztones; + public static boolean witchery; + public static boolean GalaxySpace; + public static boolean GalacticraftCore; + public static boolean GalacticraftMars; + public static boolean Thaumcraft; + public static boolean miscutils; + public static boolean tectech; + public static boolean ExtraUtilities; + public static boolean RWG; + public static boolean galacticgreg; + public static boolean gendustry; + public static boolean croploadcore; + public static boolean Forestry; + public static boolean berriespp; + public static boolean dreamcraft; + public static boolean BloodArsenal; + public static boolean Botany; + public static boolean EnderIO; + public static boolean HardcoreEnderExpension; + public static boolean betterloadingscreen; + + public static void init() { + Natura = Loader.isModLoaded("Natura"); + RandomThings = Loader.isModLoaded("RandomThings"); + TConstruct = Loader.isModLoaded("TConstruct"); + chisel = Loader.isModLoaded("chisel"); + Railcraft = Loader.isModLoaded("Railcraft"); + Ztones = Loader.isModLoaded("Ztones"); + witchery = Loader.isModLoaded("witchery"); + GalaxySpace = Loader.isModLoaded("GalaxySpace"); + GalacticraftCore = Loader.isModLoaded("GalacticraftCore"); + GalacticraftMars = Loader.isModLoaded("GalacticraftMars"); + Thaumcraft = Loader.isModLoaded("Thaumcraft"); + miscutils = Loader.isModLoaded("miscutils"); + tectech = Loader.isModLoaded("tectech"); + ExtraUtilities = Loader.isModLoaded("ExtraUtilities"); + RWG = Loader.isModLoaded("RWG"); + galacticgreg = Loader.isModLoaded("galacticgreg"); + gendustry = Loader.isModLoaded("gendustry"); + croploadcore = Loader.isModLoaded("croploadcore"); + Forestry = Loader.isModLoaded("Forestry"); + berriespp = Loader.isModLoaded("berriespp"); + dreamcraft = Loader.isModLoaded("dreamcraft"); + BloodArsenal = Loader.isModLoaded("BloodArsenal"); + Botany = Loader.isModLoaded("Botany"); + EnderIO = Loader.isModLoaded("EnderIO"); + HardcoreEnderExpension = Loader.isModLoaded("HardcoreEnderExpension"); + betterloadingscreen = Loader.isModLoaded("betterloadingscreen"); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java new file mode 100644 index 0000000000..8a753938bf --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +import cpw.mods.fml.common.FMLCommonHandler; + +public class SideReference { + + public static class EffectiveSide { + public static final boolean Server = FMLCommonHandler.instance().getEffectiveSide().isServer(); + public static final boolean Client = FMLCommonHandler.instance().getEffectiveSide().isClient(); + } + public static class Side { + public static final boolean Server = FMLCommonHandler.instance().getSide().isServer(); + public static final boolean Client = FMLCommonHandler.instance().getSide().isClient(); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java new file mode 100644 index 0000000000..468885d454 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +import gregtech.api.interfaces.ISubTagContainer; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +public class VoidMinerDropAdder { + + private static Method getExtraDropsDimMap; + + static { + try { + getExtraDropsDimMap = Class.forName("com.github.bartimaeusnek.crossmod.galacticgreg.GT_TileEntity_VoidMiner_Base").getMethod("addMatierialToDimensionList",int.class, ISubTagContainer.class, float.class); + } catch (NoSuchMethodException | ClassNotFoundException e) { + e.printStackTrace(); + } + } + + public static void addDropsToDim(int dimID, ISubTagContainer material, float chance) throws InvocationTargetException, IllegalAccessException { + getExtraDropsDimMap.invoke(null, dimID, material, chance); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java index 1dc575bd5a..bb3400512c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -27,8 +27,17 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; public final class WerkstoffAPI { @SuppressWarnings("rawtypes") - public Werkstoff getWerkstoff(String aName) throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException { - Class w = Class.forName("com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader"); + static Class w; + + static { + try { + w = Class.forName("com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader"); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + } + + public static Werkstoff getWerkstoff(String aName) throws NoSuchFieldException, IllegalAccessException { return (Werkstoff) w.getField(aName).get(null); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java index 7efe2af842..9eabdee449 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,24 +24,18 @@ package com.github.bartimaeusnek.bartworks.API; import java.util.HashSet; -public final class WerkstoffAdderRegistry implements Runnable { +public final class WerkstoffAdderRegistry { - private static final WerkstoffAdderRegistry INSTANCE = new WerkstoffAdderRegistry(); - private final HashSet toRun = new HashSet<>(); + private static final HashSet toRun = new HashSet<>(); private WerkstoffAdderRegistry() { } - public static WerkstoffAdderRegistry getINSTANCE() { - return INSTANCE; - } - public static void addWerkstoffAdder(Runnable adder) { - INSTANCE.toRun.add(adder); + toRun.add(adder); } - @Override - public final void run() { + public static void run() { for (Runnable r : toRun) r.run(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java new file mode 100644 index 0000000000..78f721e950 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +@API(owner = "bartworks", apiVersion = API_REFERENCE.VERSION, provides = "bartworks API") +package com.github.bartimaeusnek.bartworks.API; + +import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java index 6e46f1dbab..63fb597213 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks; +import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_HeatedWaterPump; import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_RadLevel; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_CircuitProgrammer; @@ -31,7 +32,6 @@ import com.github.bartimaeusnek.bartworks.server.container.BW_Container_HeatedWa import com.github.bartimaeusnek.bartworks.server.container.BW_Container_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_CircuitProgrammer; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_Item_Destructopack; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.network.IGuiHandler; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.EntityPlayer; @@ -60,7 +60,7 @@ public class GuiHandler implements IGuiHandler { @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - if (FMLCommonHandler.instance().getSide().isClient()) { + if (SideReference.Side.Client) { switch (ID) { case 0: return new GT_GUIContainer_Destructopack(player.inventory); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 9d83e88b57..33b47fd6a9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -23,71 +23,47 @@ package com.github.bartimaeusnek.bartworks; -import com.github.bartimaeusnek.bartworks.API.API_REFERENCE; -import com.github.bartimaeusnek.bartworks.API.BioObjectAdder; -import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.API.*; import com.github.bartimaeusnek.bartworks.client.ClientEventHandler.TooltipEventHandler; import com.github.bartimaeusnek.bartworks.client.creativetabs.BioTab; import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; -import com.github.bartimaeusnek.bartworks.common.commands.ChangeConfig; -import com.github.bartimaeusnek.bartworks.common.commands.ClearCraftingCache; -import com.github.bartimaeusnek.bartworks.common.commands.PrintRecipeListToFile; -import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; -import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader; -import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; -import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; +import com.github.bartimaeusnek.bartworks.common.loaders.*; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; import com.github.bartimaeusnek.bartworks.server.EventHandler.ServerEventHandler; -import com.github.bartimaeusnek.bartworks.system.log.DebugLog; -import com.github.bartimaeusnek.bartworks.system.log.STFUGTPPLOG; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader; import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.PlatinumSludgeOverHaul; -import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.StreamUtils; -import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; -import com.google.common.collect.ArrayListMultimap; +import com.github.bartimaeusnek.bartworks.util.log.DebugLog; +import com.github.bartimaeusnek.bartworks.util.log.STFUGTPPLOG; import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; -import gregtech.api.enums.*; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.*; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; -import org.apache.commons.lang3.reflect.FieldUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.IOException; -import java.lang.reflect.Field; -import java.util.*; +import java.util.Map; import static com.github.bartimaeusnek.bartworks.common.loaders.BioRecipeLoader.runOnServerStarted; -import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.removeIC2Recipes; import static gregtech.api.enums.GT_Values.VN; +@SuppressWarnings("unused") @Mod( modid = MainMod.MOD_ID, name = MainMod.NAME, version = MainMod.VERSION, dependencies = "required-after:IC2; " @@ -96,6 +72,7 @@ import static gregtech.api.enums.GT_Values.VN; + "after:GalacticraftMars; " + "after:GalacticraftCore; " + "after:Forestry; " + + "before:miscutils; " ) public final class MainMod { public static final String NAME = "BartWorks"; @@ -120,72 +97,68 @@ public final class MainMod { MainMod.LOGGER.error("Something has loaded an old API. Please contact the Mod authors to update!"); } - if (Loader.isModLoaded("miscutils") && ConfigHandler.GTppLogDisabler) { - try { - Field loggerField = FieldUtils.getField(Class.forName("gtPlusPlus.api.objects.Logger"), "modLogger", true); - FieldUtils.removeFinalModifier(loggerField, true); - loggerField.set(null, (Logger) new STFUGTPPLOG()); - } catch (IllegalAccessException | ClassNotFoundException e) { - e.printStackTrace(); - } + LoaderReference.init(); //Check for ALL the mods. + + if (LoaderReference.miscutils && ConfigHandler.GTppLogDisabler) { + STFUGTPPLOG.replaceLogger(); } - if (Loader.isModLoaded("dreamcraft")) + if (LoaderReference.dreamcraft) ConfigHandler.GTNH = true; ConfigHandler.GTNH = ConfigHandler.ezmode != ConfigHandler.GTNH; - if (ConfigHandler.debugLog) { + if (API_ConfigValues.debugLog) { try { - new DebugLog(preinit); + DebugLog.initDebugLog(preinit); } catch (IOException e) { e.printStackTrace(); } } + if (ConfigHandler.newStuff) { + WerkstoffLoader.setUp(); + } + if (ConfigHandler.GTNH) MainMod.LOGGER.info("GTNH-Detected . . . ACTIVATE HARDMODE."); if (ConfigHandler.BioLab) { - BioCultureLoader bioCultureLoader = new BioCultureLoader(); - bioCultureLoader.run(); + BioCultureLoader.run(); } if (ConfigHandler.newStuff) { - INSTANCE.init(); Werkstoff.init(); GregTech_API.sAfterGTPostload.add(new CircuitPartLoader()); - if (FMLCommonHandler.instance().getSide().isClient()) - new PrefixTextureLinker(); + if (SideReference.Side.Client) + GregTech_API.sBeforeGTLoad.add(new PrefixTextureLinker()); } } @Mod.EventHandler public void init(FMLInitializationEvent init) { - if (FMLCommonHandler.instance().getSide().isClient() && ConfigHandler.tooltips) + if (SideReference.Side.Client && ConfigHandler.tooltips) MinecraftForge.EVENT_BUS.register(new TooltipEventHandler()); ServerEventHandler serverEventHandler = new ServerEventHandler(); - if (FMLCommonHandler.instance().getSide().isServer()) { + if (SideReference.Side.Server) { MinecraftForge.EVENT_BUS.register(serverEventHandler); } FMLCommonHandler.instance().bus().register(serverEventHandler); if (ConfigHandler.BioLab) - new BioLabLoader().run(); + BioLabLoader.run(); if (ConfigHandler.newStuff) { - if (ConfigHandler.experimentalThreadedLoader) - new ThreadedLoader().runInit(); - else - INSTANCE.runInit(); + WerkstoffLoader.runInit(); } - new LoaderRegistry().run(); + ItemRegistry.run(); + RecipeLoader.run(); } @Mod.EventHandler public void postInit(FMLPostInitializationEvent postinit) { NetworkRegistry.INSTANCE.registerGuiHandler(MainMod.instance, MainMod.GH); if (ConfigHandler.BioLab) { - new GTNHBlocks().run(); + GTNHBlocks.run(); for (Map.Entry pair : BioVatLogicAdder.BioVatGlass.getGlassMap().entrySet()) { GT_OreDictUnificator.registerOre("blockGlass" + VN[pair.getValue()], new ItemStack(pair.getKey().getBlock(), 1, pair.getKey().getaByte())); } @@ -193,30 +166,14 @@ public final class MainMod { BioObjectAdder.regenerateBioFluids(); if (ConfigHandler.newStuff) { - if (ConfigHandler.experimentalThreadedLoader) - new ThreadedLoader().run(); - else - INSTANCE.run(); - localiseAchievements(); + WerkstoffLoader.run(); + LocalisationLoader.localiseAll(); } } - private static void localiseAchievements(){ - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor", "Electric Implosions?"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor.desc", "Basically a giant Hammer that presses Stuff - No more TNT!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp", "Heat from below!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp.desc", "Get ALL the thermal energy!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline", "Cheaper Circuits?"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline.desc", "Well, yes, but actually no..."); - GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.nqgen", "Can be used as Enriched Naquadah Fuel Substitute"); - } - @Mod.EventHandler public void onServerStarting(FMLServerStartingEvent event) { - event.registerServerCommand(new SummonRuin()); - event.registerServerCommand(new ChangeConfig()); - event.registerServerCommand(new PrintRecipeListToFile()); - event.registerServerCommand(new ClearCraftingCache()); + RegisterServerCommands.registerAll(event); } @Mod.EventHandler @@ -227,349 +184,36 @@ public final class MainMod { @Mod.EventHandler public void onModLoadingComplete(FMLLoadCompleteEvent event) { removeIC2Recipes(); - MainMod.addElectricImplosionCompressorRecipes(); + StaticRecipeChangeLoaders.addElectricImplosionCompressorRecipes(); PlatinumSludgeOverHaul.replacePureElements(); runOnServerStarted(); - MainMod.unificationRecipeEnforcer(); + StaticRecipeChangeLoaders.unificationRecipeEnforcer(); } private static boolean recipesAdded; - public static void runOnPlayerJoined(boolean classicMode, boolean extraGasRecipes) { + public static void runOnPlayerJoined(boolean classicMode, boolean disableExtraGasRecipes) { OreDictHandler.adaptCacheForWorld(); CircuitImprintLoader.run(); - + BioVatLogicAdder.RadioHatch.runBasicItemIntegration(); if (!recipesAdded) { - if (!extraGasRecipes) { - ArrayListMultimap toChange = MainMod.getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS); - HashSet noGas = MainMod.getNoGasItems(toChange); - MainMod.editRecipes(toChange, noGas); - } + if (!disableExtraGasRecipes) + StaticRecipeChangeLoaders.addEBFGasRecipes(); + if (classicMode) - new DownTierLoader().run(); -// removeDuplicateRecipes(); + DownTierLoader.run(); + + //StaticRecipeChangeLoaders.patchEBFMapForCircuitUnification(); + recipesAdded = true; } - fixEnergyRequirements(); + StaticRecipeChangeLoaders.fixEnergyRequirements(); + //StaticRecipeChangeLoaders.synchroniseCircuitUseMulti(); //Accept recipe map changes into Buffers GT_Recipe.GT_Recipe_Map.sMappings.forEach(GT_Recipe.GT_Recipe_Map::reInit); } - private static void fixEnergyRequirements() { - GT_Recipe.GT_Recipe_Map.sMappings.stream() - .filter(StreamUtils::filterVisualMaps) - .forEach(gt_recipe_map -> - gt_recipe_map.mRecipeList.parallelStream().forEach( gt_recipe -> { - for (int i = 0; i < (VN.length - 1); i++) { - if (gt_recipe.mEUt > BW_Util.getMachineVoltageFromTier(i) && gt_recipe.mEUt <= BW_Util.getTierVoltage(i)) { - gt_recipe.mEUt = BW_Util.getMachineVoltageFromTier(i); - } - } - })); - } - - private static void unificationRecipeEnforcer() { - for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - if (werkstoff.getGenerationFeatures().enforceUnification) { - if (werkstoff.contains(NOBLE_GAS)) { - String name = werkstoff.getFluidOrGas(1).getFluid().getName(); - String wrongname = "molten." + name; - FluidStack wrongNamedFluid = FluidRegistry.getFluidStack(wrongname, 1); - if (wrongNamedFluid != null) { - for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - for (GT_Recipe recipe : map.mRecipeList) { - for (int i = 0; i < recipe.mFluidInputs.length; i++) { - if (GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], wrongNamedFluid)) { - Collection col = map.mRecipeFluidMap.get(wrongNamedFluid.getFluid()); - map.mRecipeFluidMap.remove(wrongNamedFluid.getFluid()); - map.mRecipeFluidMap.put(werkstoff.getFluidOrGas(1).getFluid(), col); - recipe.mFluidInputs[i] = werkstoff.getFluidOrGas(recipe.mFluidInputs[i].amount); - map.mRecipeFluidNameMap.add(werkstoff.getFluidOrGas(1).getFluid().getName()); - } - } - for (int i = 0; i < recipe.mFluidOutputs.length; i++) { - if (GT_Utility.areFluidsEqual(recipe.mFluidOutputs[i], wrongNamedFluid)) { - recipe.mFluidOutputs[i] = werkstoff.getFluidOrGas(recipe.mFluidOutputs[i].amount); - } - } - } - } - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(false, null, null, null, null, new FluidStack[]{wrongNamedFluid}, new FluidStack[]{werkstoff.getFluidOrGas(1)}, 1, 1, 0)); - } - } - HashSet oreDictNames = new HashSet<>(werkstoff.getADDITIONAL_OREDICT()); - oreDictNames.add(werkstoff.getVarName()); - MainMod.runMoltenUnificationEnfocement(werkstoff); - MainMod.runUnficationDeleter(werkstoff); - for (String s : oreDictNames) - for (OrePrefixes prefixes : OrePrefixes.values()) { - if (OreDictionary.getOres(prefixes + s).size() > 1) { - for (int j = 0; j < OreDictionary.getOres(prefixes + s).size(); j++) { - ItemStack toReplace = OreDictionary.getOres(prefixes + s).get(j); - ItemStack replacement = werkstoff.get(prefixes); - if (GT_Utility.areStacksEqual(toReplace, replacement) || replacement == null || replacement.getItem() == null) - continue; - if (toReplace != null) { - for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - HashSet toRem = new HashSet<>(); - for (GT_Recipe recipe : map.mRecipeList) { - boolean removal = map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes); - for (int i = 0; i < recipe.mInputs.length; i++) { - if (GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) { - if (removal) - toRem.add(recipe); - else { - int amount = recipe.mInputs[i].stackSize; - recipe.mInputs[i] = replacement.splitStack(amount); - } - } - } - for (int i = 0; i < recipe.mOutputs.length; i++) { - if (GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) { - if (removal) - toRem.add(recipe); - else { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = replacement.splitStack(amount); - } - } - } - if (recipe.mSpecialItems instanceof ItemStack) { - if (GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) { - if (removal) - toRem.add(recipe); - else { - int amount = ((ItemStack) recipe.mSpecialItems).stackSize; - recipe.mSpecialItems = replacement.splitStack(amount); - } - } - } - } - map.mRecipeList.removeAll(toRem); - } - } - } - } - } - } - } - } - - @SuppressWarnings("ALL") - private static void runMoltenUnificationEnfocement(Werkstoff werkstoff) { - if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.getGenerationFeatures().hasMolten()) { - try { - FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), werkstoff.get(cellMolten), Materials.Empty.getCells(1)); - Field f = GT_Utility.class.getDeclaredField("sFilledContainerToData"); - f.setAccessible(true); - Map sFilledContainerToData = (Map) f.get(null); - HashSet torem = new HashSet<>(); - ItemStack toReplace = null; - for (Map.Entry entry : sFilledContainerToData.entrySet()) { - final String MODID = GameRegistry.findUniqueIdentifierFor(data.filledContainer.getItem()).modId; - if (MODID.equals(MainMod.MOD_ID) || MODID.equals(BartWorksCrossmod.MOD_ID)) - continue; - if (entry.getValue().fluid.equals(data.fluid) && !entry.getValue().filledContainer.equals(data.filledContainer)) { - toReplace = entry.getValue().filledContainer; - torem.add(entry); - } - } - sFilledContainerToData.entrySet().removeAll(torem); - torem.clear(); - if (toReplace != null) { - for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - torem.clear(); - for (GT_Recipe recipe : map.mRecipeList) { - for (int i = 0; i < recipe.mInputs.length; i++) { - if (GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) { - torem.add(recipe); - // recipe.mInputs[i] = data.filledContainer; - } - } - for (int i = 0; i < recipe.mOutputs.length; i++) { - if (GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) { - torem.add(recipe); - // recipe.mOutputs[i] = data.filledContainer; - if (map == GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes && GT_Utility.areStacksEqual(recipe.mOutputs[i], data.filledContainer) && !recipe.mFluidInputs[0].equals(data.fluid)) { - torem.add(recipe); - // recipe.mOutputs[i] = data.filledContainer; - } - } - } - if (recipe.mSpecialItems instanceof ItemStack) { - if (GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) { - torem.add(recipe); - // recipe.mSpecialItems = data.filledContainer; - } - } - } - map.mRecipeList.removeAll(torem); - } - } - GT_Utility.addFluidContainerData(data); - } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { - e.printStackTrace(); - } - } - } - - private static void runUnficationDeleter(Werkstoff werkstoff) { - if (werkstoff.getType() == Werkstoff.Types.ELEMENT) { - if (werkstoff.getBridgeMaterial() != null) { - werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip()); - Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>(); - Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial()); - } - } - - for (OrePrefixes prefixes : OrePrefixes.values()) - if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) != 0 && ((werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0)) { - GT_OreDictUnificator.set(prefixes, werkstoff.getBridgeMaterial(), werkstoff.get(prefixes), true, true); - for (ItemStack stack : OreDictionary.getOres(prefixes + werkstoff.getVarName())) { - GT_OreDictUnificator.addAssociation(prefixes, werkstoff.getBridgeMaterial(), stack, false); - GT_OreDictUnificator.getAssociation(stack).mUnificationTarget = werkstoff.get(prefixes); - } - } - } - - private static ArrayListMultimap getRecipesToChange(SubTag... GasTags) { - Iterator it = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.iterator(); - ArrayListMultimap toAdd = ArrayListMultimap.create(); - while (it.hasNext()) { - GT_Recipe recipe = it.next(); - if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) { - String FluidString = recipe.mFluidInputs[0].getFluid().getName().replaceAll("molten", "").replaceAll("fluid", ""); - Materials mat = Materials.get(FluidString.substring(0, 1).toUpperCase() + FluidString.substring(1)); - if (mat != Materials._NULL) { - for (SubTag tag : GasTags) { - if (mat.contains(tag)) { - DebugLog.log("Found EBF Recipe to change, Output:" + BW_Util.translateGTItemStack(recipe.mOutputs[0])); - toAdd.put(tag, recipe); - } - } - } - } - } - return toAdd; - } - - private static HashSet getNoGasItems(ArrayListMultimap base) { - Iterator it = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.iterator(); - HashSet toAdd = new HashSet<>(); - ArrayListMultimap repToAdd = ArrayListMultimap.create(); - while (it.hasNext()) { - GT_Recipe recipe = it.next(); - for (SubTag tag : base.keySet()) - recipeLoop: - for (GT_Recipe baseRe : base.get(tag)) { - if (recipe.mInputs.length == baseRe.mInputs.length && recipe.mOutputs.length == baseRe.mOutputs.length) - for (int i = 0; i < recipe.mInputs.length; i++) { - if ((recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) && BW_Util.checkStackAndPrefix(recipe.mInputs[i]) && BW_Util.checkStackAndPrefix(baseRe.mInputs[i]) && GT_OreDictUnificator.getAssociation(recipe.mInputs[i]).mMaterial.mMaterial.equals(GT_OreDictUnificator.getAssociation(baseRe.mInputs[i]).mMaterial.mMaterial) && GT_Utility.areStacksEqual(recipe.mOutputs[0], baseRe.mOutputs[0])) { - toAdd.add(recipe.mOutputs[0]); - repToAdd.put(tag, recipe); - continue recipeLoop; - } - } - } - } - base.putAll(repToAdd); - return toAdd; - } - - private static void editRecipes(ArrayListMultimap base, HashSet noGas) { - if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeFluidNameMap.contains(Objects.requireNonNull(fluids.get(Oganesson)).getName())) - return; - HashSet toAdd = new HashSet<>(); - for (SubTag GasTag : base.keySet()) { - for (GT_Recipe recipe : base.get(GasTag)) { - if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) { - String materialString = recipe.mFluidInputs[0].getFluid().getName().replaceAll("molten", "").replaceAll("fluid", ""); - Materials mat = Materials.get(materialString.substring(0, 1).toUpperCase() + materialString.substring(1)); - if (mat != Materials._NULL) { - for (Werkstoff werkstoff : Werkstoff.werkstoffHashMap.values()) { - if (!werkstoff.contains(GasTag)) - continue; - int time = (int) ((double) recipe.mDuration / 200D * (200D + (werkstoff.getStats().getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) werkstoff.getStats().getProtons() : (double) mat.getProtons() * 2.75D - (double) werkstoff.getStats().getProtons()))); - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); - } - for (Materials materials : Materials.values()) { - if (!materials.contains(GasTag)) - continue; - int time = (int) ((double) recipe.mDuration / 200D * (200D + (materials.getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) materials.getProtons() : (double) mat.getProtons() * 2.75D - (double) materials.getProtons()))); - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{materials.getGas(recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); - } - for (ItemStack is : noGas) { - byte circuitConfiguration = 1; - if (GT_Utility.areStacksEqual(is, recipe.mOutputs[0])) { - ArrayList inputs = new ArrayList<>(recipe.mInputs.length); - for (ItemStack stack : recipe.mInputs) - if (!GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(11), stack) && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(14), stack) && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(19), stack)) { - if (BW_Util.checkStackAndPrefix(stack)) - circuitConfiguration = (byte) (GT_OreDictUnificator.getAssociation(stack).mPrefix.equals(OrePrefixes.dustSmall) ? 4 : GT_OreDictUnificator.getAssociation(stack).mPrefix.equals(OrePrefixes.dustTiny) ? 9 : 1); - inputs.add(stack); - } - inputs.add(GT_Utility.getIntegratedCircuit(circuitConfiguration)); - toAdd.add(new BWRecipes.DynamicGTRecipe(false, inputs.toArray(new ItemStack[0]), recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + ((double) mat.getProtons() * 2.75D))), recipe.mEUt, recipe.mSpecialValue)); - break; - } - } - } - } - } - GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.removeAll(base.get(GasTag)); - } - HashSet duplicates = new HashSet<>(); - for (GT_Recipe recipe : toAdd) { - for (GT_Recipe recipe2 : toAdd) { - if (recipe.mEUt != recipe2.mEUt || recipe.mDuration != recipe2.mDuration || recipe.mSpecialValue != recipe2.mSpecialValue || recipe == recipe2 || recipe.mInputs.length != recipe2.mInputs.length || recipe.mFluidInputs.length != recipe2.mFluidInputs.length) - continue; - boolean isSame = true; - for (int i = 0; i < recipe.mInputs.length; i++) { - if (!GT_Utility.areStacksEqual(recipe.mInputs[i], recipe2.mInputs[i])) - isSame = false; - } - for (int i = 0; i < recipe.mFluidInputs.length; i++) { - if (!GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], recipe2.mFluidInputs[i])) - isSame = false; - } - if (isSame) - duplicates.add(recipe2); - } - } - toAdd.removeAll(duplicates); - toAdd.forEach(GT_Recipe.GT_Recipe_Map.sBlastRecipes::add); - } - - @SuppressWarnings("ALL") - private static void addElectricImplosionCompressorRecipes() { - if (eicMap == null) { - eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); - GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream().filter(e -> e.mInputs != null).forEach(recipe -> eicMap.addRecipe(true, Arrays.stream(recipe.mInputs).filter(e -> !MainMod.checkForExplosives(e)).distinct().toArray(ItemStack[]::new), recipe.mOutputs, null, null, null, 1, BW_Util.getMachineVoltageFromTier(10), 0)); - } - } - - private static boolean checkForExplosives(ItemStack input) { - return (GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L)) || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); - } - -// private static void removeDuplicateRecipes(){ -// GT_Recipe.GT_Recipe_Map.sMappings.forEach( -// gt_recipe_map -> { -// HashSet mappings = new HashSet<>(); -// HashSet dupes = new HashSet<>(); -// gt_recipe_map.mRecipeList.forEach( -// recipe -> { -// if (mappings.contains(BW_Util.getRecipeHash(recipe))) -// dupes.add(recipe); -// mappings.add(BW_Util.getRecipeHash(recipe)); -// } -// ); -// gt_recipe_map.mRecipeList.removeAll(dupes); -// } -// ); -// } - } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java index 14a146e01a..59e9ee2782 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java @@ -26,10 +26,7 @@ import com.github.bartimaeusnek.bartworks.util.Pair; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; +import java.util.*; class TooltipCache { private static final HashMap, char[]> cache = new HashMap<>(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java index 69ec8349b9..77d290504f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,49 +23,62 @@ package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.server.container.BW_Container_Windmill; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_Container_MultiMachine; -import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_LanguageManager; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) -public class BW_GUIContainer_Windmill extends GT_GUIContainer_MultiMachine { +public class BW_GUIContainer_Windmill extends GT_GUIContainerMetaTile_Machine { - public BW_GUIContainer_Windmill(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { - super(aInventoryPlayer, aTileEntity, aName, null); + public BW_GUIContainer_Windmill(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(new BW_Container_Windmill(aInventoryPlayer, aTileEntity), ""); } protected void drawGuiContainerForegroundLayer(int par1, int par2) { if (!(this.mContainer instanceof GT_Container_MultiMachine)) return; - if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) + if ((this.mContainer.mDisplayErrorCode & 64) != 0) this.fontRendererObj.drawString(this.trans("138", "Incomplete Structure."), 92, 22, 16448255); } + public String trans(String aKey, String aEnglish) { + return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false); + } + + private static final int DIVIDER = 125; + private byte last = 0; + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor3f(0.5f, 0.25f, 0.07f); this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUI_Windmill.png")); int x = (this.width - this.xSize) / 2; int y = (this.height - this.ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); if (this.mContainer.mMaxProgressTime > 0) { - this.drawTexturedModalRect(x + 152, y + 5, 176, 0, 16, 15); - this.drawTexturedModalRect(x + 53, y + 63, 176, 16, 13, 17); + if (System.currentTimeMillis() / DIVIDER % 40 == 30) + this.drawTexturedModalRect(x + 85, y + 27, 176, (last = 96), 32, 32); + else if (System.currentTimeMillis() / DIVIDER % 40 == 20) + this.drawTexturedModalRect(x + 85, y + 27, 176, (last = 64), 32, 32); + else if (System.currentTimeMillis() / DIVIDER % 40 == 10) + this.drawTexturedModalRect(x + 85, y + 27, 176, (last = 32), 32, 32); + else if (System.currentTimeMillis() / DIVIDER % 40 == 0) + this.drawTexturedModalRect(x + 85, y + 27, 176, (last = 0), 32, 32); + else + this.drawTexturedModalRect(x + 85, y + 27, 176, last, 32, 32); } - if (((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode == 0) { - if (((GT_Container_MultiMachine) this.mContainer).mActive == 0) { - GL11.glColor3f(1f, 1f, 1f); - this.drawTexturedModalRect(x + 66, y + 66, 176, 33, 15, 15); + //Soft Mallet + if (this.mContainer.mDisplayErrorCode == 0) { + if (this.mContainer.mActive == 0) { + this.drawTexturedModalRect(x + 66, y + 66, 176, 128, 15, 15); } } - - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java index 58e4cc0c12..cfa0180442 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java @@ -61,7 +61,7 @@ public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine this.drawTexturedModalRect(124, 18, 124, 18, 16, 48); } GL11.glColor3f(1f, 1f, 1f); - this.drawTexturedModalRect(124, 18, 176, 0, 16, 48 - (int) MathUtils.ceil(48 * (rem / maxT))); + this.drawTexturedModalRect(124, 18, 176, 0, 16, 48 - MathUtils.ceilInt(48 * (rem / maxT))); this.drawTexturedModalRect(65, 13, 192, 0, (48 * (((GT_Container_RadioHatch) this.mContainer).sv)) / (GT_GUIContainer_RadioHatch.maxSv), 16); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java index af08a21524..8918c09901 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,27 +25,28 @@ package com.github.bartimaeusnek.bartworks.client.textures; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; import gregtech.api.enums.Textures; import java.util.Arrays; import java.util.HashMap; +import java.util.Map; @SideOnly(Side.CLIENT) public class PrefixTextureLinker implements Runnable { - public static HashMap> texMap = new HashMap<>(); - { - GregTech_API.sBeforeGTLoad.add(this); + public static Map> texMap = new HashMap<>(); + public static Map blockTexMap = new HashMap<>(); + + private static void fillBlockTexMap() { + blockTexMap.put(TextureSet.SET_QUARTZ, TextureSet.INDEX_block4); } - @Override - public void run() { + private static void fillItemTexMap() { Arrays.stream(OrePrefixes.values()) .filter(prefixes -> prefixes != OrePrefixes.rod - && prefixes.mTextureIndex == -1 && Werkstoff.GenerationFeatures.prefixLogic.get(prefixes) != 0) + && prefixes.mTextureIndex == -1 && Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes) != 0) .forEach(prefixes -> { HashMap curr = new HashMap<>(); Arrays.stream(TextureSet.class.getFields()) @@ -63,4 +64,10 @@ public class PrefixTextureLinker implements Runnable { texMap.put(prefixes, curr); }); } + + @Override + public void run() { + fillItemTexMap(); + fillBlockTexMap(); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java index 9a1f342b3c..24f3aad588 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.common.blocks; import com.github.bartimaeusnek.bartworks.MainMod; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -35,6 +36,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; import java.util.List; @@ -52,6 +54,7 @@ public class BW_Blocks extends Block { this.name = name; this.textureNames = texture; this.setCreativeTab(MainMod.GT2); + GregTech_API.registerMachineBlock(this, -1); } public BW_Blocks(String name, String[] texture, CreativeTabs tabs) { @@ -61,6 +64,7 @@ public class BW_Blocks extends Block { this.name = name; this.textureNames = texture; this.setCreativeTab(tabs); + GregTech_API.registerMachineBlock(this, -1); } public BW_Blocks(String name, String[] texture, CreativeTabs tabs, Material material) { @@ -70,6 +74,7 @@ public class BW_Blocks extends Block { this.name = name; this.textureNames = texture; this.setCreativeTab(tabs); + GregTech_API.registerMachineBlock(this, -1); } @Override @@ -101,6 +106,20 @@ public class BW_Blocks extends Block { } } + @Override + public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { + if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + } + + @Override + public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { + if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + } + @Override public String getUnlocalizedName() { return this.name; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java index 195d1afb6d..3661d8e3d7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,8 +22,8 @@ package com.github.bartimaeusnek.bartworks.common.blocks; +import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.material.Material; @@ -93,13 +93,17 @@ public class BW_GlasBlocks extends BW_Blocks { this.connectedTexture = new IIcon[16]; for (int i = 0; i < this.textureNames.length; i++) { this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]); + String[] splitname = this.textureNames[0].split(":"); for (int j = 0; j < 16; j++) { - this.connectedTexture[j] = par1IconRegister.registerIcon(this.textureNames[0] + "_" + j); + this.connectedTexture[j] = par1IconRegister.registerIcon( + splitname[0] + + ":connectedTex/" + + splitname[1] + '/' + + splitname[1] + '_' + j); } } } - @Override @SideOnly(Side.CLIENT) public IIcon getIcon(IBlockAccess worldClient, int xCoord, int yCoord, int zCoord, int aSide) { @@ -182,7 +186,7 @@ public class BW_GlasBlocks extends BW_Blocks { @Override public int getRenderType() { - if (!this.fake && FMLCommonHandler.instance().getSide().isClient()) + if (!this.fake && SideReference.Side.Client) return RendererGlasBlock.RID; else return 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index b1aeb18a54..1cb8106399 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -30,6 +30,7 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; import ic2.api.tile.IWrenchable; import ic2.core.IC2; import ic2.core.IHasGui; @@ -63,6 +64,7 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI this.setCreativeTab(MainMod.BWT); this.setBlockName(blockName); this.setBlockTextureName(MainMod.MOD_ID + ":" + blockName); + GregTech_API.registerMachineBlock(this, -1); } @Override @@ -120,9 +122,13 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI @Override public void breakBlock(World world, int x, int y, int z, Block block, int meta) { - TileEntity t = world.getTileEntity(x,y,z); - if (t instanceof ITileDropsContent){ - int[] dropSlots = ((ITileDropsContent)t).getDropSlots(); + if (GregTech_API.isMachineBlock(this, world.getBlockMetadata(x, y, z))) { + GregTech_API.causeMachineUpdate(world, x, y, z); + } + + TileEntity t = world.getTileEntity(x, y, z); + if (t instanceof ITileDropsContent) { + int[] dropSlots = ((ITileDropsContent) t).getDropSlots(); for (int dropSlot : dropSlots) { if (((ITileDropsContent) t).getStackInSlot(dropSlot) != null) world.spawnEntityInWorld(new EntityItem(world, x, y, z, ((BW_TileEntity_HeatedWaterPump) t).getStackInSlot(dropSlot))); @@ -194,4 +200,11 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI } return new String[0]; } + + @Override + public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { + if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java index d3091afb56..a49fbc5ae4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -75,6 +75,7 @@ public class ChangeConfig extends CommandBase { p_71515_1_.addChatMessage(new ChatComponentText("booleans need to be set to true or false")); } } + p_71515_1_.addChatMessage(new ChatComponentText("Set " + p_71515_2_[0] + " to " + p_71515_2_[1])); }catch (Exception e){ e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java new file mode 100644 index 0000000000..0b179f0332 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.commands; + +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.ChatComponentText; + +public class GetWorkingDirectory extends CommandBase { + @Override + public String getCommandName() { + return "bwgwd"; + } + + @Override + public String getCommandUsage(ICommandSender p_71518_1_) { + return "bwgwd"; + } + + @Override + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + p_71515_1_.addChatMessage(new ChatComponentText(Minecraft.getMinecraft().mcDataDir.getAbsolutePath())); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java new file mode 100644 index 0000000000..00a1fc4c4c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.commands; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.ChatComponentText; + +public class RunGC extends CommandBase { + @Override + public String getCommandName() { + return "bwgc"; + } + + @Override + public String getCommandUsage(ICommandSender p_71518_1_) { + return "bwgc"; + } + + @Override + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + Runtime.getRuntime().gc(); + p_71515_1_.addChatMessage(new ChatComponentText("Ran GC!")); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index d71b89b8cb..b949444067 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,7 +24,7 @@ package com.github.bartimaeusnek.bartworks.common.configs; import com.github.bartimaeusnek.ASM.BWCoreTransformer; -import gregtech.api.enums.GT_Values; +import com.github.bartimaeusnek.bartworks.API.API_ConfigValues; import net.minecraftforge.common.config.Configuration; import java.util.Arrays; @@ -46,6 +46,7 @@ public class ConfigHandler { public static int creativeScannerID; public static int bioVatMaxParallelBonus = 1000; public static int cutoffTier = 5; + public static int[][][] metasForTiers; public static long energyPerCell = 1000000L; @@ -58,16 +59,50 @@ public class ConfigHandler { public static boolean DEHPDirectSteam; public static boolean teslastaff; public static boolean classicMode; - public static boolean experimentalThreadedLoader; public static boolean GTNH; public static boolean ezmode; - //One-Side-Only - public static boolean debugLog; public static boolean GTppLogDisabler; public static boolean tooltips = true; public static boolean[] enabledPatches; + public static byte maxTierRoss; + + private static final int[][] METAFORTIERS_ENERGY = { + {100, 101, 102, 105}, + {1110, 1115, 1120, 1127}, + {1111, 12726, 1116, 1121, 1128}, + {1112, 12727, 1117, 1122, 1129}, + {12728, 1190, 1130, 12685}, + {1191, 1174, 695, 12686}, + }; + private static final int[][] METAFORTIERS_BUFFER = { + {5133, 5123}, + {161, 171, 181, 191}, + {162, 172, 182, 192}, + {163, 173, 183, 193}, + {164, 174, 184, 194}, + {165, 175, 185, 195}, + }; + private static final int[][] METAFORTIERS_CABLE = { + {5133, 5123}, + {1210, 1230, 1250, 1270, 1290}, + {1310, 1330, 1350, 1370, 1390}, + {1410, 1430, 1450, 1470, 1490}, + {1510, 1530, 1550, 1570, 1590}, + {1650, 1670, 1690}, + }; + private static final int[][] METAFORTIERS_MACHINE = { + {103, 104, 106, 107, 109, 110, 112, 113, 115, 116, 118, 119}, + {201, 211, 221, 231, 241, 251, 261, 271, 281, 291, 301, 311, 321, 331, 341, 351, 361, 371, 381, 391, 401, 411, 421, 431, 441, 451, 461, 471, 481, 491, 501, 511, 521, 531, 541, 551, 561, 571, 581, 591, 601, 611, 621, 631, 641, 651, 661, 671}, + {202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 302, 312, 322, 332, 342, 352, 362, 372, 382, 392, 402, 412, 422, 432, 442, 452, 462, 472, 482, 492, 502, 512, 522, 532, 542, 552, 562, 572, 582, 592, 602, 612, 622, 632, 642, 652, 662, 672}, + {203, 213, 223, 233, 243, 253, 263, 273, 283, 293, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 403, 413, 423, 433, 443, 453, 463, 473, 483, 493, 503, 513, 523, 533, 543, 553, 563, 573, 583, 593, 603, 613, 623, 633, 643, 653, 663, 673}, + {204, 214, 224, 234, 244, 254, 264, 274, 284, 294, 304, 314, 324, 334, 344, 354, 364, 374, 384, 394, 404, 414, 424, 434, 444, 454, 464, 474, 484, 494, 504, 514, 524, 534, 544, 554, 564, 574, 584, 594, 604, 614, 624, 634, 644, 654, 664, 674}, + {205, 215, 225, 235, 245, 255, 265, 275, 285, 295, 305, 315, 325, 335, 345, 355, 365, 375, 385, 395, 405, 415, 425, 435, 445, 455, 465, 475, 485, 495, 505, 515, 525, 535, 545, 555, 565, 575, 585, 595, 605, 615, 625, 635, 645, 655, 665, 675}, + }; + private static int[][][] defaultMetasForTiers = {METAFORTIERS_ENERGY, METAFORTIERS_BUFFER, METAFORTIERS_CABLE, METAFORTIERS_MACHINE}; + private static final String[] VOLTAGE_NAMES = new String[]{"High Pressure Steam", "Low Voltage", "Medium Voltage", "High Voltage", "Extreme Voltage", "Insane Voltage", "Ludicrous Voltage", "ZPM Voltage", "Ultimate Voltage", "Ultimate High Voltage", "Ultimate Extreme Voltage", "Ultimate Insane Voltage", "Ultimate Mega Voltage", "Ultimate Extended Mega Voltage", "Overpowered Voltage", "Maximum Voltage"}; + private static final String[] names = {"Generators", "Buffers", "Cables", "Machines"}; public ConfigHandler(Configuration C) { ConfigHandler.c = C; @@ -79,8 +114,8 @@ public class ConfigHandler { ConfigHandler.teslastaff = ConfigHandler.c.get("System", "Enable Teslastaff", false, "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); ConfigHandler.newStuff = !ConfigHandler.c.get("System", "Disable non-original-GT-stuff", false, "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false); ConfigHandler.BioLab = !ConfigHandler.c.get("System", "Disable BioLab", false, "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!").getBoolean(false); - ConfigHandler.cutoffTier = ConfigHandler.c.get("System", "Tier to nerf circuits", 5, "This switch sets the lowest unnerfed Circuit Recipe Tier. -1 to disable it completely.").getInt(5); - ConfigHandler.cutoffTier = (ConfigHandler.cutoffTier == -1 ? GT_Values.VN.length : ConfigHandler.cutoffTier); + ConfigHandler.cutoffTier = ConfigHandler.c.get("System", "Tier to nerf circuits", 5, "This switch sets the lowest unnerfed Circuit Recipe Tier. -1 to disable it completely.",-1, VOLTAGE_NAMES.length).getInt(5); + ConfigHandler.cutoffTier = (ConfigHandler.cutoffTier == -1 ? VOLTAGE_NAMES.length : ConfigHandler.cutoffTier); ConfigHandler.disableExtraGassesForEBF = ConfigHandler.c.get("System", "Disable Extra Gases for EBF", false, "This switch disables extra gas recipes for the EBF, i.e. Xenon instead of Nitrogen").getBoolean(false); ConfigHandler.mbWaterperSec = ConfigHandler.c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150).getInt(150); @@ -89,17 +124,18 @@ public class ConfigHandler { ConfigHandler.DEHPDirectSteam = ConfigHandler.c.get("Multiblocks", "DEHP Direct Steam Mode", false, "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant").getBoolean(false); ConfigHandler.megaMachinesMax = ConfigHandler.c.get("Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256); ConfigHandler.bioVatMaxParallelBonus = ConfigHandler.c.get("Multiblocks","BioVat Maximum Bonus on Recipes", 1000,"This are the maximum parallel Operations the BioVat can do, when the output is half full.").getInt(1000); + if (ConfigHandler.IDOffset == 0) { ConfigHandler.IDOffset = 12600; ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600); } + ConfigHandler.GTppLogDisabler = ConfigHandler.c.get("System", "Disable GT++ Logging", false, "Enables or Disables GT++ Logging.").getBoolean(false); - ConfigHandler.debugLog = ConfigHandler.c.get("System", "Enable Debug Log", false, "Enables or Disables the debug log.").getBoolean(false); - ConfigHandler.experimentalThreadedLoader = ConfigHandler.c.get("System", "Enable Experimental Threaded Material Loader", false, "Enables or Disables the Experimental Threaded Material Loader.").getBoolean(false); + API_ConfigValues.debugLog = ConfigHandler.c.get("System", "Enable Debug Log", false, "Enables or Disables the debug log.").getBoolean(false); - for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) { + for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) BWCoreTransformer.shouldTransform[i] = ConfigHandler.c.get("ASM fixes", BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i], true).getBoolean(true); - } + ConfigHandler.enabledPatches = new boolean[BWCoreTransformer.shouldTransform.length]; ConfigHandler.enabledPatches = Arrays.copyOf(BWCoreTransformer.shouldTransform,BWCoreTransformer.shouldTransform.length); ConfigHandler.ross128BID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64); @@ -111,6 +147,16 @@ public class ConfigHandler { ConfigHandler.landerType = ConfigHandler.c.get("CrossMod Interactions", "LanderType", 3, "1 = Moon Lander, 2 = Landing Balloons, 3 = Asteroid Lander").getInt(3); ConfigHandler.disableMagicalForest = ConfigHandler.c.get("CrossMod Interactions", "Disable Magical Forest - Ross128b", false, "True disables the magical Forest Biome on Ross for more performance during World generation.").getBoolean(false); + ConfigHandler.maxTierRoss = (byte) ConfigHandler.c.get("Ross Ruin Metas", "A_Ruin Machine Tiers",6,"", 0, VOLTAGE_NAMES.length).getInt(6); + ConfigHandler.metasForTiers = new int[4][maxTierRoss][]; + + for (int i = 0; i < 4; i++) { + if (maxTierRoss > ConfigHandler.defaultMetasForTiers[i].length) + ConfigHandler.defaultMetasForTiers[i] = new int[maxTierRoss][0]; + for (int j = 0; j < maxTierRoss; j++) + ConfigHandler.metasForTiers[i][j] = ConfigHandler.c.get("Ross Ruin Metas", j+"_Ruin " + names[i] +" Tier " + VOLTAGE_NAMES[j], ConfigHandler.defaultMetasForTiers[i][j]).getIntList(); + } + ConfigHandler.setUpComments(); if (ConfigHandler.c.hasChanged()) @@ -123,6 +169,6 @@ public class ConfigHandler { ConfigHandler.c.addCustomCategoryComment("Multiblocks", "Multliblock Options can be set here."); ConfigHandler.c.addCustomCategoryComment("System", "Different System Settings can be set here."); ConfigHandler.c.addCustomCategoryComment("CrossMod Interactions", "CrossMod Interaction Settings can be set here. For Underground Fluid settings change the Gregtech.cfg!"); + ConfigHandler.c.addCustomCategoryComment("Ross Ruin Metas", "Ruin Metas and Tiers can be set here."); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java index 5012725e34..11c9d96f66 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -39,6 +39,10 @@ import org.apache.commons.lang3.reflect.FieldUtils; import java.lang.reflect.Field; +/** + * This class gets injected into GT via ASM! + * DO NOT CALL IT YOURSELF! + */ public class BeforeGTPreload implements Runnable { private static boolean didrun; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java index e5591f1150..fcdf63cbc0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,7 +31,7 @@ import net.minecraft.item.EnumRarity; import java.awt.*; -public class BioCultureLoader implements Runnable { +public class BioCultureLoader { public static final BioData BIO_DATA_BETA_LACMATASE = BioData.createAndRegisterBioData("beta-Lactamase", EnumRarity.uncommon, 10000, 0); private static final BioData BIO_DATA_YEAST = BioData.createAndRegisterBioData("Saccharomyces cerevisiae", EnumRarity.common); @@ -47,8 +47,9 @@ public class BioCultureLoader implements Runnable { public static BioCulture eColi; public static BioCulture anaerobicOil; public static BioCulture generalPurposeFermentingBacteria; - @Override - public void run() { + + + public static void run() { BioCultureLoader.CommonYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_YEAST), true); BioCultureLoader.WhineYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var bayanus", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_WHINE_YEAST,EnumRarity.uncommon, true); BioCultureLoader.BeerYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_BEER_YEAST, EnumRarity.uncommon,true); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java index 93b2ece861..72189ce4da 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -35,15 +35,16 @@ import net.minecraft.item.ItemStack; import java.util.Collection; import java.util.HashSet; - public class BioItemList { + private BioItemList() { + } private static final Item mItemBioLabParts = new LabModule(new String[]{"DNAExtractionModule", "PCRThermoclyclingModule", "PlasmidSynthesisModule", "TransformationModule", "ClonalCellularSynthesisModule"}); public static final ItemStack[] mBioLabParts = {new ItemStack(BioItemList.mItemBioLabParts), new ItemStack(BioItemList.mItemBioLabParts, 1, 1), new ItemStack(BioItemList.mItemBioLabParts, 1, 2), new ItemStack(BioItemList.mItemBioLabParts, 1, 3), new ItemStack(BioItemList.mItemBioLabParts, 1, 4)}; private static final Item vanillaBioLabParts = new LabParts(new String[]{"petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", "IncubationModule", "PlasmaMembrane"}); - public BioItemList() { + public static void registerBioItems(){ GameRegistry.registerItem(BioItemList.mItemBioLabParts, "BioLabModules"); GameRegistry.registerItem(BioItemList.vanillaBioLabParts, "BioLabParts"); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java index 80a0ff744f..f72cd1f0aa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,19 +22,11 @@ package com.github.bartimaeusnek.bartworks.common.loaders; -public class BioLabLoader implements Runnable { +public class BioLabLoader { - - private FluidLoader fluidLoader; - private BioItemList bioItemList; - private BioRecipeLoader bioRecipeLoader; - - @Override - public void run() { - this.fluidLoader = new FluidLoader(); - this.fluidLoader.run(); - this.bioItemList = new BioItemList(); - this.bioRecipeLoader = new BioRecipeLoader(); - this.bioRecipeLoader.run(); + public static void run() { + FluidLoader.run(); + BioItemList.registerBioItems(); + BioRecipeLoader.run(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index 5c2088e606..686a7a0777 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,13 +22,13 @@ package com.github.bartimaeusnek.bartworks.common.loaders; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_BioLab; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import cpw.mods.fml.common.Loader; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -45,11 +45,10 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; -public class BioRecipeLoader extends RecipeLoader { +public class BioRecipeLoader { - @Override @SuppressWarnings("deprecation") - public void run() { + public static void run() { //DNAExtractionModule GT_ModHandler.addCraftingRecipe( @@ -133,16 +132,16 @@ public class BioRecipeLoader extends RecipeLoader { } ); - if (Loader.isModLoaded("croploadcore") && OreDictionary.getOres("cropVine").size() > 1) + if (LoaderReference.croploadcore && OreDictionary.getOres("cropVine").size() > 1) for (int i = 0; i < OreDictionary.getOres("cropVine").size(); i++) { - GT_Values.RA.addExtractorRecipe(OreDictionary.getOres("cropVine").get(i).splitStack(12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addExtractorRecipe(BW_Util.setStackSize(OreDictionary.getOres("cropVine").get(i),12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3)); } else GT_Values.RA.addExtractorRecipe(new ItemStack(Blocks.vine, 12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addExtractorRecipe(ItemList.Circuit_Chip_Stemcell.get(1L), BioItemList.getOther(4), 500, BW_Util.getMachineVoltageFromTier(6)); - FluidStack dnaFluid = Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); + FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); GT_Values.RA.addMixerRecipe(GT_Utility.getIntegratedCircuit(17), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Radon, 1L), null, null, dnaFluid, new FluidStack(FluidLoader.BioLabFluidMaterials[0], 2000), Materials.Empty.getCells(1), 500, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(17), null, new FluidStack(BioCultureLoader.eColi.getFluid(), 1000), new FluidStack(FluidLoader.BioLabFluidMaterials[1], 10), BioItemList.getOther(4), null, null, null, null, null, new int[]{1000}, 60 * 20, BW_Util.getMachineVoltageFromTier(3)); @@ -328,7 +327,7 @@ public class BioRecipeLoader extends RecipeLoader { new ItemStack[]{new ItemStack(Items.sugar, 64)}, new FluidStack[]{new FluidStack(fluidStack, 100)}, BioCultureLoader.CommonYeast, - new FluidStack[]{(Loader.isModLoaded("berriespp") ? FluidRegistry.getFluidStack("potion.ghp", 1) : Materials.Ethanol.getFluid(1L))}, + new FluidStack[]{(LoaderReference.berriespp ? FluidRegistry.getFluidStack("potion.ghp", 1) : Materials.Ethanol.getFluid(1L))}, 350, BW_Util.getMachineVoltageFromTier(4) ); @@ -384,10 +383,17 @@ public class BioRecipeLoader extends RecipeLoader { } public static void runOnServerStarted(){ - for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sFermentingRecipes.mRecipeList){ - FluidStack[] flInput = new FluidStack[]{new FluidStack(recipe.mFluidInputs[0], recipe.mFluidInputs[0].amount*100)}; - FluidStack[] flOutput = new FluidStack[]{new FluidStack(recipe.mFluidOutputs[0], recipe.mFluidOutputs[0].amount)}; - BWRecipes.instance.addBacterialVatRecipe(new ItemStack[]{null},BioCultureLoader.generalPurposeFermentingBacteria,flInput,flOutput,recipe.mDuration > 10 ? recipe.mDuration/10 : recipe.mDuration,recipe.mEUt,GT_Utility.getTier(recipe.mEUt)); - } + GT_Recipe.GT_Recipe_Map.sFermentingRecipes.mRecipeList.forEach( + recipe -> + BWRecipes.instance.addBacterialVatRecipe( + new ItemStack[]{null}, + BioCultureLoader.generalPurposeFermentingBacteria, + recipe.mFluidInputs, + recipe.mFluidOutputs, + recipe.mDuration, + recipe.mEUt, + GT_Utility.getTier(recipe.mEUt) + ) + ); } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index beba91a18d..924511cd5d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,14 +22,14 @@ package com.github.bartimaeusnek.bartworks.common.loaders; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock; import com.github.bartimaeusnek.bartworks.client.renderer.RendererSwitchingColorFluid; import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BWTileEntityDimIDBridge; import com.github.bartimaeusnek.bartworks.util.BioCulture; import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -47,7 +47,7 @@ import net.minecraftforge.fluids.FluidStack; import java.awt.*; import java.util.Arrays; -public class FluidLoader implements Runnable { +public class FluidLoader { public static IIcon autogenIIcon; public static Fluid ff; @@ -59,8 +59,7 @@ public class FluidLoader implements Runnable { //OilProcessing chain public static Fluid fulvicAcid,heatedfulvicAcid,Kerogen; - @Override - public void run() { + public static void run() { FluidLoader.renderID = RenderingRegistry.getNextAvailableRenderId(); short[] rgb = new short[3]; Arrays.fill(rgb, (short) 255); @@ -82,7 +81,7 @@ public class FluidLoader implements Runnable { } // BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", BW_Util.splitColorToRBGArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB()))); - FluidStack dnaFluid = Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L); + FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L); for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.isBreedable()) { B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()})); @@ -95,7 +94,7 @@ public class FluidLoader implements Runnable { FluidLoader.bioFluidBlock = new BioFluidBlock(); GameRegistry.registerBlock(FluidLoader.bioFluidBlock, "coloredFluidBlock"); GameRegistry.registerTileEntity(BWTileEntityDimIDBridge.class, "bwTEDimIDBridge"); - if (FMLCommonHandler.instance().getSide().isClient()) { + if (SideReference.Side.Client) { RenderingRegistry.registerBlockHandler(RendererSwitchingColorFluid.instance); RenderingRegistry.registerBlockHandler(RendererGlasBlock.instance); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java index f602963c8e..1023b23ee1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,65 +23,65 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; -import cpw.mods.fml.common.Loader; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; /** * Autogenerated run file, script Created on Wed Jan 2 19:11:07 2019 by boubou_19 and bartimaeusnek * Executed on 2019-01-03 02:08:43 * modified by bartimaeusnek to only add blocks that mods are loaded + * modified by bartimaeusnek on 2020-03-22 00:20 to run statically */ -public class GTNHBlocks implements Runnable { +public class GTNHBlocks { - @Override - public void run() { + public static void run() { BioVatLogicAdder.BioVatGlass.addCustomGlass("minecraft", "glass", 0, 3); BioVatLogicAdder.BioVatGlass.addCustomGlass("IC2", "blockAlloyGlass", 0, 4); - if (Loader.isModLoaded("BloodArsenal")) + if (LoaderReference.BloodArsenal) BioVatLogicAdder.BioVatGlass.addCustomGlass("BloodArsenal", "blood_stained_glass", 0, 3); - if (Loader.isModLoaded("Botany")) + if (LoaderReference.Botany) BioVatLogicAdder.BioVatGlass.addCustomGlass("Botany", "stained", 0, 3); - if (Loader.isModLoaded("EnderIO")) + if (LoaderReference.EnderIO) for (int i = 0; i <= 5; ++i) BioVatLogicAdder.BioVatGlass.addCustomGlass("EnderIO", "blockFusedQuartz", i, 3); - if (Loader.isModLoaded("ExtraUtilities")) { + if (LoaderReference.ExtraUtilities) { BioVatLogicAdder.BioVatGlass.addCustomGlass("ExtraUtilities", "decorativeBlock1", 9, 3); for (int i = 0; i <= 11; ++i) BioVatLogicAdder.BioVatGlass.addCustomGlass("ExtraUtilities", "decorativeBlock2", i, 3); for (int i = 0; i <= 5; ++i) BioVatLogicAdder.BioVatGlass.addCustomGlass("ExtraUtilities", "etherealglass", i, 3); } - if (Loader.isModLoaded("GalaxySpace")) + if (LoaderReference.GalaxySpace) BioVatLogicAdder.BioVatGlass.addCustomGlass("GalaxySpace", "futureglass", 0, 3); - if (Loader.isModLoaded("HardcoreEnderExpension")) + if (LoaderReference.HardcoreEnderExpension) BioVatLogicAdder.BioVatGlass.addCustomGlass("HardcoreEnderExpension", "laboratory_glass", 0, 3); - if (Loader.isModLoaded("Natura")) + if (LoaderReference.Natura) for (int i = 0; i <= 1; ++i) BioVatLogicAdder.BioVatGlass.addCustomGlass("Natura", "NetherGlass", i, 3); - if (Loader.isModLoaded("RandomThings")) + if (LoaderReference.RandomThings) BioVatLogicAdder.BioVatGlass.addCustomGlass("RandomThings", "spectreGlass", 0, 3); - if (Loader.isModLoaded("TConstruct")) + if (LoaderReference.TConstruct) BioVatLogicAdder.BioVatGlass.addCustomGlass("TConstruct", "GlassBlock", 0, 3); - if (Loader.isModLoaded("tectech")) + if (LoaderReference.tectech) BioVatLogicAdder.BioVatGlass.addCustomGlass("tectech", "tile.quantumGlass", 0, 8); - if (Loader.isModLoaded("chisel")) + if (LoaderReference.chisel) BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "glass2", 0, 3); for (int i = 0; i <= 15; ++i) { BioVatLogicAdder.BioVatGlass.addCustomGlass("minecraft", "stained_glass", i, 3); - if (Loader.isModLoaded("GalaxySpace")) + if (LoaderReference.GalaxySpace) BioVatLogicAdder.BioVatGlass.addCustomGlass("GalaxySpace", "futureglasses", i, 3); - if (Loader.isModLoaded("Railcraft")) + if (LoaderReference.Railcraft) BioVatLogicAdder.BioVatGlass.addCustomGlass("Railcraft", "glass", i, 3); - if (Loader.isModLoaded("TConstruct")) + if (LoaderReference.TConstruct) BioVatLogicAdder.BioVatGlass.addCustomGlass("TConstruct", "GlassBlock.StainedClear", i, 3); - if (Loader.isModLoaded("Ztones")) + if (LoaderReference.Ztones) BioVatLogicAdder.BioVatGlass.addCustomGlass("Ztones", "tile.glaxx", i, 3); - if (Loader.isModLoaded("chisel")) { + if (LoaderReference.chisel) { BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "glass", i, 3); BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_white", i, 3); BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_yellow", i, 3); @@ -89,7 +89,7 @@ public class GTNHBlocks implements Runnable { BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_brown", i, 3); BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_forestry", i, 3); } - if (Loader.isModLoaded("witchery")) + if (LoaderReference.witchery) BioVatLogicAdder.BioVatGlass.addCustomGlass("witchery", "shadedglass", i, 3); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 2b61f3250f..df60aafa0f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; @@ -41,6 +42,11 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_Til import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.*; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.crossmod.galacticgreg.GT_TileEntity_VoidMiners; +import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileEntity_LowPowerLaserBox; +import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileEntity_LowPowerLaserDynamo; +import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileEntity_LowPowerLaserHatch; +import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileEntity_Pipe_Energy_LowPower; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -78,28 +84,30 @@ public class ItemRegistry { public static final Item PUMPPARTS = new SimpleSubItemClass("BWrawtube", "BWmotor"); public static final Block EXPPUMP = new BW_TileEntityContainer(Material.coral, BW_TileEntity_ExperimentalFloodGate.class, "ExpReversePump"); + public static final Block bw_realglas = new BW_GlasBlocks( + "BW_GlasBlocks", + new String[]{ + MainMod.MOD_ID + ":BoronSilicateGlassBlock", + MainMod.MOD_ID + ":NickelReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":TungstenReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":ChromeReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":IridiumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":OsmiumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock1", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock2", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock3", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock4", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock5", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock6", + MainMod.MOD_ID + ":ThoriumYttriumGlass", + }, + new short[][]{Materials.BorosilicateGlass.getRGBA(), Materials.Nickel.getRGBA(), Materials.Tungsten.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), Materials.Osmium.getRGBA(), new short[]{0xff, 0, 0}, new short[]{0, 0xff, 0}, new short[]{0x80, 0, 0xff}, new short[]{0xff, 0xff, 0}, new short[]{0, 0xff, 0x80}, new short[]{0x80, 0x33, 0}, WerkstoffLoader.YttriumOxide.getRGBA()}, + MainMod.BIO_TAB, + true, false + ); + public static final Block[] bw_glasses = { - new BW_GlasBlocks( - "BW_GlasBlocks", - new String[]{ - MainMod.MOD_ID + ":BoronSilicateGlassBlock", - MainMod.MOD_ID + ":NickelReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":TungstenReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":ChromeReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":IridiumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":OsmiumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock1", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock2", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock3", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock4", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock5", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock6", - MainMod.MOD_ID + ":ThoriumYttriumGlass", - }, - new short[][]{Materials.BorosilicateGlass.getRGBA(), Materials.Nickel.getRGBA(), Materials.Tungsten.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), Materials.Osmium.getRGBA(), new short[]{0xff, 0, 0}, new short[]{0, 0xff, 0}, new short[]{0x80, 0, 0xff}, new short[]{0xff, 0xff, 0}, new short[]{0, 0xff, 0x80}, new short[]{0x80, 0x33, 0}, WerkstoffLoader.YttriumOxide.getRGBA()}, - MainMod.BIO_TAB, - true, false - ) + bw_realglas }; public static final Block bw_fake_glasses = new BW_GlasBlocks("BW_GlasBlocks", new String[]{ @@ -133,12 +141,16 @@ public class ItemRegistry { public static ItemStack[] acidGens = new ItemStack[3]; public static ItemStack[] megaMachines = new ItemStack[3]; public static ItemStack dehp; + public static ItemStack[] voidminer = new ItemStack[3]; public static ItemStack thtr; public static ItemStack eic; public static ItemStack cal; public static ItemStack compressedHatch; public static ItemStack giantOutputHatch; + public static ItemStack[][][] TecTechLaserAdditions = new ItemStack[3][4][4]; + public static ItemStack TecTechPipeEnergyLowPower; + public static void run() { if (newStuff) { GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses, "BW_FakeGlasBlock"); @@ -194,6 +206,31 @@ public class ItemRegistry { ItemRegistry.compressedHatch = new GT_MetaTileEntity_CompressedFluidHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, "CompressedFluidHatch", "Liquid Air Fluid Hatch").getStackForm(1L); ItemRegistry.giantOutputHatch = new GT_MetaTileEntity_GiantOutputHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, "GiantOutputHatch", "Giant Output Hatch").getStackForm(1L); ItemRegistry.megaMachines[2] = new GT_TileEntity_MegaDistillTower(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, "MegaDistillationTower", "Mega Distillation Tower").getStackForm(1L); + + if (LoaderReference.galacticgreg) { + ItemRegistry.voidminer[2] = new GT_TileEntity_VoidMiners.VMUV(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 11, "VoidMiner3", "Void Miner III").getStackForm(1L); + ItemRegistry.voidminer[1] = new GT_TileEntity_VoidMiners.VMZPM(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 12, "VoidMiner2", "Void Miner II").getStackForm(1L); + ItemRegistry.voidminer[0] = new GT_TileEntity_VoidMiners.VMLUV(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 13, "VoidMiner1", "Void Miner I").getStackForm(1L); + } + if (LoaderReference.tectech) { + TecTechPipeEnergyLowPower = new TT_MetaTileEntity_Pipe_Energy_LowPower(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 14, "pipe.lowpowerlaser", "Low Power Laser Pipe").getStackForm(1L); + int startID = ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15; + for (int amps = 32; amps <= 128; amps += 32) { + for (int tier = 4; tier < 8; tier++) { + TecTechLaserAdditions[0][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserBox(startID++, GT_Values.VN[tier] + "_LPLaser_Converter_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Converter", tier, amps).getStackForm(1L); + } + } + for (int amps = 32; amps <= 128; amps += 32) { + for (int tier = 4; tier < 8; tier++) { + TecTechLaserAdditions[1][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserHatch(startID++, GT_Values.VN[tier] + "_LPLaser_Hatch_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Target Hatch", tier, amps).getStackForm(1L); + } + } + for (int amps = 32; amps <= 128; amps += 32) { + for (int tier = 4; tier < 8; tier++) { + TecTechLaserAdditions[2][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserDynamo(startID++, GT_Values.VN[tier] + "_LPLaser_Dynamo_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Source Hatch", tier, amps).getStackForm(1L); + } + } + } } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java deleted file mode 100644 index 4f7d83bcf6..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.loaders; - -public class LoaderRegistry implements Runnable { - - @Override - public void run() { - ItemRegistry.run(); - new RecipeLoader().run(); - } - -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java new file mode 100644 index 0000000000..733ba9b67b --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.loaders; + +import gregtech.api.util.GT_LanguageManager; + +public class LocalisationLoader { + + private LocalisationLoader() { + } + + private static void localiseTooltips(){ + GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.purify.2","Throw into Cauldron to get clean crushed Ore"); + GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.nqgen", "Can be used as Enriched Naquadah Fuel Substitute"); + } + + private static void localiseAchivements(){ + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor", "Electric Implosions?"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor.desc", "Basically a giant Hammer that presses Stuff - No more TNT!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp", "Heat from below!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp.desc", "Get ALL the thermal energy!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline", "Cheaper Circuits?"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline.desc", "Well, yes, but actually no..."); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer1", "Ores from deep below!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer1.desc", "Is this some kind of Ex-Nihilo?"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer2", "Ores from deep below 2! Electric Boogaloo!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer2.desc", "Ex-Nihilo, but faster!"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer3", "Ores from deep below 3! Trinity Ex-Nihilo"); + GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer3.desc", "3x the trouble, 3x the fun!"); + } + + public static void localiseAll(){ + localiseAchivements(); + localiseTooltips(); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 34401b4d11..738fe18351 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_LESU; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; @@ -31,7 +32,6 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import cpw.mods.fml.common.Loader; import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.interfaces.ISubTagContainer; @@ -50,13 +50,12 @@ import net.minecraftforge.oredict.OreDictionary; import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; -public class RecipeLoader implements Runnable { +public class RecipeLoader { protected static final long BITSD = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE; - @Override @SuppressWarnings("deprecation") - public void run() { + public static void run() { if (ConfigHandler.GTNH) { /* @@ -753,37 +752,188 @@ public class RecipeLoader implements Runnable { "BZB", "BRB", "BZB", - 'B',new ItemStack(GregTech_API.sBlockCasings3,1,12), - 'R',GT_ModHandler.getModItem("IC2","blockGenerator",1,5), - 'Z',"circuitUltimate" + 'B', new ItemStack(GregTech_API.sBlockCasings3, 1, 12), + 'R', GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), + 'Z', "circuitUltimate" } ); - if (!Loader.isModLoaded("tectech")) - GT_Values.RA.addAssemblylineRecipe( - ItemList.Machine_Multi_ImplosionCompressor.get(1L),24000, - new ItemStack[]{ - ItemList.Machine_Multi_ImplosionCompressor.get(1L), - Materials.Neutronium.getBlocks(5), - GT_OreDictUnificator.get(OrePrefixes.stickLong,Materials.Osmium,64), - GT_OreDictUnificator.get(OrePrefixes.ring,Materials.Osmium,64), - GT_OreDictUnificator.get(OrePrefixes.wireGt01,Materials.Superconductor,64), - ItemList.Electric_Piston_UV.get(64), - }, - new FluidStack[]{ - Materials.SolderingAlloy.getMolten(1440), - Materials.Osmium.getMolten(1440), - Materials.Neutronium.getMolten(1440) - }, - ItemRegistry.eic.copy(), - 240000, - BW_Util.getMachineVoltageFromTier(8) - ); - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{ItemList.Hatch_Input_HV.get(64),Materials.LiquidAir.getCells(1),GT_Utility.getIntegratedCircuit(17)},new ItemStack[]{ItemRegistry.compressedHatch.copy()},null,null,null,null,300, BW_Util.getMachineVoltageFromTier(3),0)); - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{ItemList.Hatch_Output_HV.get(64),GT_Utility.getIntegratedCircuit(17)},new ItemStack[]{ItemRegistry.giantOutputHatch.copy()},null,null,null,null,300, BW_Util.getMachineVoltageFromTier(3),0)); + if (LoaderReference.galacticgreg) { + GT_Values.RA.addAssemblylineRecipe( + ItemList.OreDrill4.get(1L), + BW_Util.getMachineVoltageFromTier(6), + new Object[]{ + ItemList.OreDrill4.get(1L), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Europium, 9L), + Materials.Europium.getPlates(3), + ItemList.Electric_Motor_LuV.get(9L), + ItemList.Sensor_LuV.get(9L), + ItemList.Field_Generator_LuV.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 36L) + }, + new FluidStack[]{ + Materials.SolderingAlloy.getMolten(1440), + WerkstoffLoader.Neon.getFluidOrGas(20000), + }, + ItemRegistry.voidminer[0].copy(), + 108000, + BW_Util.getMachineVoltageFromTier(6) + ); + } + + if (!LoaderReference.tectech) { + if (LoaderReference.galacticgreg) { + GT_Values.RA.addAssemblylineRecipe( + ItemRegistry.voidminer[0].copy(), + BW_Util.getMachineVoltageFromTier(7), + new Object[]{ + ItemRegistry.voidminer[0].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), + Materials.BlackPlutonium.getPlates(3), + ItemList.Electric_Motor_ZPM.get(9L), + ItemList.Sensor_ZPM.get(9L), + ItemList.Field_Generator_ZPM.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) + }, + new FluidStack[]{ + Materials.SolderingAlloy.getMolten(1440), + WerkstoffLoader.Krypton.getFluidOrGas(20000) + }, + ItemRegistry.voidminer[1].copy(), + 216000, + BW_Util.getMachineVoltageFromTier(7) + ); + + GT_Values.RA.addAssemblylineRecipe( + ItemRegistry.voidminer[1].copy(), + BW_Util.getMachineVoltageFromTier(8), + new Object[]{ + ItemRegistry.voidminer[1].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), + Materials.Neutronium.getPlates(3), + ItemList.Electric_Motor_UV.get(9L), + ItemList.Sensor_UV.get(9L), + ItemList.Field_Generator_UV.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) + }, + new FluidStack[]{ + Materials.SolderingAlloy.getMolten(1440), + WerkstoffLoader.Oganesson.getFluidOrGas(20000) + }, + ItemRegistry.voidminer[2].copy(), + 432000, + BW_Util.getMachineVoltageFromTier(8) + ); + } + GT_Values.RA.addAssemblylineRecipe( + ItemList.Machine_Multi_ImplosionCompressor.get(1L), 24000, + new ItemStack[]{ + ItemList.Machine_Multi_ImplosionCompressor.get(1L), + Materials.Neutronium.getBlocks(5), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64), + ItemList.Electric_Piston_UV.get(64), + }, + new FluidStack[]{ + Materials.SolderingAlloy.getMolten(1440), + Materials.Osmium.getMolten(1440), + Materials.Neutronium.getMolten(1440) + }, + ItemRegistry.eic.copy(), + 240000, + BW_Util.getMachineVoltageFromTier(8) + ); + } else { + ItemStack[][] converters = ItemRegistry.TecTechLaserAdditions[0]; + ItemStack[][] input = ItemRegistry.TecTechLaserAdditions[1]; + ItemStack[][] dynamo = ItemRegistry.TecTechLaserAdditions[2]; + + ItemList[] emitters = { + ItemList.Emitter_EV, + ItemList.Emitter_IV, + ItemList.Emitter_LuV, + ItemList.Emitter_ZPM + }; + + ItemList[] sensors = { + ItemList.Sensor_EV, + ItemList.Sensor_IV, + ItemList.Sensor_LuV, + ItemList.Sensor_ZPM + }; + + OrePrefixes[] prefixes = { + OrePrefixes.cableGt04, + OrePrefixes.cableGt08, + OrePrefixes.cableGt12, + OrePrefixes.cableGt16 + }; + + GT_Values.RA.addAssemblerRecipe( + new ItemStack[]{ + ItemList.Circuit_Parts_GlassFiber.get(32), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silver, 8), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2) + }, + Materials.Polytetrafluoroethylene.getMolten(72), + new ItemStack(ItemRegistry.TecTechPipeEnergyLowPower.getItem(), 1, ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + 200, + BW_Util.getMachineVoltageFromTier(4) + ); + + for (int j = 0; j < 4; j++) { + for (int i = 0; i < 4; i++) { + ItemStack converter = converters[j][i]; + ItemStack eInput = input[j][i]; + ItemStack eDynamo = dynamo[j][i]; + + GT_Values.RA.addAssemblerRecipe( + new ItemStack[]{ + new ItemStack(ItemRegistry.TecTechPipeEnergyLowPower.getItem(), ((j + 1) * 16), ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + emitters[i].get(2 * (j + 1)), + sensors[i].get(2 * (j + 1)), + ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1)), + }, + Materials.SolderingAlloy.getMolten(144 * i * (j + 1)), + converter, + 200 * (j + 1), + BW_Util.getMachineVoltageFromTier(4 + i)); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[]{ + new ItemStack(ItemRegistry.TecTechPipeEnergyLowPower.getItem(), ((j + 1) * 16), ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + sensors[i].get(2 * (j + 1)), + ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1)), + }, + Materials.SolderingAlloy.getMolten(144 * i * (j + 1)), + eInput, + 200 * (j + 1), + BW_Util.getMachineVoltageFromTier(4 + i)); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[]{ + new ItemStack(ItemRegistry.TecTechPipeEnergyLowPower.getItem(), ((j + 1) * 16), ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + emitters[i].get(2 * (j + 1)), + ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1)), + }, + Materials.SolderingAlloy.getMolten(144 * i * (j + 1)), + eDynamo, + 200 * (j + 1), + BW_Util.getMachineVoltageFromTier(4 + i)); + } + } + } + + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{ItemList.Hatch_Input_HV.get(64), Materials.LiquidAir.getCells(1), GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{ItemRegistry.compressedHatch.copy()}, null, null, null, null, 300, BW_Util.getMachineVoltageFromTier(3), 0)); + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{ItemList.Hatch_Output_HV.get(64), GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{ItemRegistry.giantOutputHatch.copy()}, null, null, null, null, 300, BW_Util.getMachineVoltageFromTier(3), 0)); GT_Values.RA.addAssemblylineRecipe( - ItemList.Machine_LuV_CircuitAssembler.get(1L),24000, + ItemList.Machine_LuV_CircuitAssembler.get(1L), 24000, new ItemStack[]{ ItemList.Machine_LuV_CircuitAssembler.get(1L), ItemList.Robot_Arm_LuV.get(4L), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java new file mode 100644 index 0000000000..bac618bb95 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.loaders; + +import com.github.bartimaeusnek.bartworks.common.commands.*; +import cpw.mods.fml.common.event.FMLServerStartingEvent; + +public class RegisterServerCommands { + + public static void registerAll(FMLServerStartingEvent event){ + event.registerServerCommand(new SummonRuin()); + event.registerServerCommand(new ChangeConfig()); + event.registerServerCommand(new PrintRecipeListToFile()); + event.registerServerCommand(new ClearCraftingCache()); + event.registerServerCommand(new GetWorkingDirectory()); + event.registerServerCommand(new RunGC()); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java new file mode 100644 index 0000000000..cf668d4d36 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -0,0 +1,559 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.loaders; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.Pair; +import com.github.bartimaeusnek.bartworks.util.StreamUtils; +import com.github.bartimaeusnek.bartworks.util.log.DebugLog; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import com.google.common.collect.ArrayListMultimap; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.enums.*; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; +import org.apache.commons.lang3.reflect.FieldUtils; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.*; +import java.util.stream.Collectors; + +import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static gregtech.api.enums.GT_Values.VN; + +public class StaticRecipeChangeLoaders { + + private StaticRecipeChangeLoaders() { + } + + public static void addEBFGasRecipes() { + ArrayListMultimap toChange = getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS); + editRecipes(toChange, getNoGasItems(toChange)); + } + + public static void fixEnergyRequirements() { + GT_Recipe.GT_Recipe_Map.sMappings.stream() + .filter(StreamUtils::filterVisualMaps) + .forEach(gt_recipe_map -> + gt_recipe_map.mRecipeList.parallelStream().forEach(gt_recipe -> { + for (int i = 0; i < (VN.length - 1); i++) { + if (gt_recipe.mEUt > BW_Util.getMachineVoltageFromTier(i) && gt_recipe.mEUt <= BW_Util.getTierVoltage(i)) { + gt_recipe.mEUt = BW_Util.getMachineVoltageFromTier(i); + } + } + })); + } + + private static void replaceWrongFluidOutput(Werkstoff werkstoff, GT_Recipe recipe, FluidStack wrongNamedFluid) { + for (int i = 0; i < recipe.mFluidOutputs.length; i++) { + if (GT_Utility.areFluidsEqual(recipe.mFluidOutputs[i], wrongNamedFluid)) { + recipe.mFluidOutputs[i] = werkstoff.getFluidOrGas(recipe.mFluidOutputs[i].amount); + } + } + } + + private static void replaceWrongFluidInput(Werkstoff werkstoff, GT_Recipe.GT_Recipe_Map map, GT_Recipe recipe, FluidStack wrongNamedFluid) { + for (int i = 0; i < recipe.mFluidInputs.length; i++) { + if (GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], wrongNamedFluid)) { + Collection col = map.mRecipeFluidMap.get(wrongNamedFluid.getFluid()); + map.mRecipeFluidMap.remove(wrongNamedFluid.getFluid()); + map.mRecipeFluidMap.put(werkstoff.getFluidOrGas(1).getFluid(), col); + recipe.mFluidInputs[i] = werkstoff.getFluidOrGas(recipe.mFluidInputs[i].amount); + map.mRecipeFluidNameMap.add(werkstoff.getFluidOrGas(1).getFluid().getName()); + } + } + } + + private static void addConversionRecipe(Werkstoff werkstoff, FluidStack wrongNamedFluid) { + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(false, null, null, null, null, new FluidStack[]{wrongNamedFluid}, new FluidStack[]{werkstoff.getFluidOrGas(1)}, 1, 1, 0)); + } + + private static FluidStack getWrongNameFluid(Werkstoff werkstoff) { + String name = werkstoff.getFluidOrGas(1).getFluid().getName(); + String wrongname = "molten." + name; + return FluidRegistry.getFluidStack(wrongname, 1); + } + + private static void enforceNobleGas(Werkstoff werkstoff) { + FluidStack wrongNamedFluid = getWrongNameFluid(werkstoff); + if (wrongNamedFluid != null) { + GT_Recipe.GT_Recipe_Map.sMappings.forEach(map -> map.mRecipeList.forEach(recipe -> { + replaceWrongFluidInput(werkstoff, map, recipe, wrongNamedFluid); + replaceWrongFluidOutput(werkstoff, recipe, wrongNamedFluid); + })); + addConversionRecipe(werkstoff, wrongNamedFluid); + } + } + + public static void unificationRecipeEnforcer() { + for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { + if (werkstoff.getGenerationFeatures().enforceUnification) { + + if (werkstoff.contains(NOBLE_GAS)) + enforceNobleGas(werkstoff); + + HashSet oreDictNames = new HashSet<>(werkstoff.getADDITIONAL_OREDICT()); + oreDictNames.add(werkstoff.getVarName()); + StaticRecipeChangeLoaders.runMoltenUnificationEnfocement(werkstoff); + StaticRecipeChangeLoaders.runUnficationDeleter(werkstoff); + for (String s : oreDictNames) + for (OrePrefixes prefixes : OrePrefixes.values()) { + if (!werkstoff.hasItemType(prefixes)) + continue; + if (OreDictionary.getOres(prefixes + s).size() <= 1) + continue; + for (int j = 0; j < OreDictionary.getOres(prefixes + s).size(); j++) { + ItemStack toReplace = OreDictionary.getOres(prefixes + s).get(j); + ItemStack replacement = werkstoff.get(prefixes); + if (toReplace == null || GT_Utility.areStacksEqual(toReplace, replacement) || replacement == null || replacement.getItem() == null) + continue; + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + HashSet toRem = new HashSet<>(); + for (GT_Recipe recipe : map.mRecipeList) { + boolean removal = map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes); + for (int i = 0; i < recipe.mInputs.length; i++) { + if (!GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) + continue; + if (removal) + toRem.add(recipe); + else { + int amount = recipe.mInputs[i].stackSize; + recipe.mInputs[i] = BW_Util.setStackSize(replacement, amount); + } + } + for (int i = 0; i < recipe.mOutputs.length; i++) { + if (!GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) + continue; + if (removal) + toRem.add(recipe); + else { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = BW_Util.setStackSize(replacement, amount); + } + } + if (recipe.mSpecialItems instanceof ItemStack) { + if (!GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) + continue; + if (removal) + toRem.add(recipe); + else { + int amount = ((ItemStack) recipe.mSpecialItems).stackSize; + recipe.mSpecialItems = BW_Util.setStackSize(replacement, amount); + } + } + } + map.mRecipeList.removeAll(toRem); + } + } + } + } + } + } + + @SuppressWarnings("ALL") + private static void runMoltenUnificationEnfocement(Werkstoff werkstoff) { + if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.hasItemType(OrePrefixes.cellMolten)) { + try { + FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), werkstoff.get(cellMolten), Materials.Empty.getCells(1)); + Field f = GT_Utility.class.getDeclaredField("sFilledContainerToData"); + f.setAccessible(true); + Map sFilledContainerToData = (Map) f.get(null); + HashSet torem = new HashSet<>(); + ItemStack toReplace = null; + for (Map.Entry entry : sFilledContainerToData.entrySet()) { + final String MODID = GameRegistry.findUniqueIdentifierFor(data.filledContainer.getItem()).modId; + if (MODID.equals(MainMod.MOD_ID) || MODID.equals(BartWorksCrossmod.MOD_ID)) + continue; + if (entry.getValue().fluid.equals(data.fluid) && !entry.getValue().filledContainer.equals(data.filledContainer)) { + toReplace = entry.getValue().filledContainer; + torem.add(entry); + } + } + sFilledContainerToData.entrySet().removeAll(torem); + torem.clear(); + if (toReplace != null) { + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + torem.clear(); + for (GT_Recipe recipe : map.mRecipeList) { + for (int i = 0; i < recipe.mInputs.length; i++) { + if (GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) { + torem.add(recipe); + // recipe.mInputs[i] = data.filledContainer; + } + } + for (int i = 0; i < recipe.mOutputs.length; i++) { + if (GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) { + torem.add(recipe); + // recipe.mOutputs[i] = data.filledContainer; + if (map == GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes && GT_Utility.areStacksEqual(recipe.mOutputs[i], data.filledContainer) && !recipe.mFluidInputs[0].equals(data.fluid)) { + torem.add(recipe); + // recipe.mOutputs[i] = data.filledContainer; + } + } + } + if (recipe.mSpecialItems instanceof ItemStack) { + if (GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) { + torem.add(recipe); + // recipe.mSpecialItems = data.filledContainer; + } + } + } + map.mRecipeList.removeAll(torem); + } + } + GT_Utility.addFluidContainerData(data); + } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { + e.printStackTrace(); + } + } + } + + private static void runUnficationDeleter(Werkstoff werkstoff) { + if (werkstoff.getType() == Werkstoff.Types.ELEMENT) { + if (werkstoff.getBridgeMaterial() != null) { + werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip()); + Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>(); + Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial()); + } + } + + for (OrePrefixes prefixes : OrePrefixes.values()) + if (werkstoff.hasItemType(prefixes)) { + GT_OreDictUnificator.set(prefixes, werkstoff.getBridgeMaterial(), werkstoff.get(prefixes), true, true); + for (ItemStack stack : OreDictionary.getOres(prefixes + werkstoff.getVarName())) { + GT_OreDictUnificator.addAssociation(prefixes, werkstoff.getBridgeMaterial(), stack, false); + GT_OreDictUnificator.getAssociation(stack).mUnificationTarget = werkstoff.get(prefixes); + } + } + } + + private static ArrayListMultimap getRecipesToChange(SubTag... GasTags) { + ArrayListMultimap toAdd = ArrayListMultimap.create(); + for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList) { + if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) { + String FluidString = recipe.mFluidInputs[0].getFluid().getName().replaceAll("molten", "").replaceAll("fluid", ""); + Materials mat = Materials.get(FluidString.substring(0, 1).toUpperCase() + FluidString.substring(1)); + if (mat != Materials._NULL) { + for (SubTag tag : GasTags) { + if (mat.contains(tag)) { + DebugLog.log("Found EBF Recipe to change, Output:" + BW_Util.translateGTItemStack(recipe.mOutputs[0])); + toAdd.put(tag, recipe); + } + } + } + } + } + return toAdd; + } + + private static HashSet getNoGasItems(ArrayListMultimap base) { + HashSet toAdd = new HashSet<>(); + ArrayListMultimap repToAdd = ArrayListMultimap.create(); + for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList) { + for (SubTag tag : base.keySet()) + recipeLoop: + for (GT_Recipe baseRe : base.get(tag)) { + if (recipe.mInputs.length == baseRe.mInputs.length && recipe.mOutputs.length == baseRe.mOutputs.length) + for (int i = 0; i < recipe.mInputs.length; i++) { + if ((recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) && BW_Util.checkStackAndPrefix(recipe.mInputs[i]) && BW_Util.checkStackAndPrefix(baseRe.mInputs[i]) && GT_OreDictUnificator.getAssociation(recipe.mInputs[i]).mMaterial.mMaterial.equals(GT_OreDictUnificator.getAssociation(baseRe.mInputs[i]).mMaterial.mMaterial) && GT_Utility.areStacksEqual(recipe.mOutputs[0], baseRe.mOutputs[0])) { + toAdd.add(recipe.mOutputs[0]); + repToAdd.put(tag, recipe); + continue recipeLoop; + } + } + } + } + base.putAll(repToAdd); + return toAdd; + } + + private static void editEBFMaterialRecipes(SubTag GasTag, GT_Recipe recipe, Materials mat, HashSet toAdd) { + for (Materials materials : Materials.values()) { + if (materials.contains(GasTag)) { + int time = (int) ((double) recipe.mDuration / 200D * (200D + (materials.getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) materials.getProtons() : (double) mat.getProtons() * 2.75D - (double) materials.getProtons()))); + toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{materials.getGas(recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); + } + } + } + + private static void editEBFWerkstoffRecipes(SubTag GasTag, GT_Recipe recipe, Materials mat, HashSet toAdd) { + for (Werkstoff werkstoff : Werkstoff.werkstoffHashMap.values()) { + if (werkstoff.contains(GasTag)) { + int time = (int) ((double) recipe.mDuration / 200D * (200D + (werkstoff.getStats().getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) werkstoff.getStats().getProtons() : (double) mat.getProtons() * 2.75D - (double) werkstoff.getStats().getProtons()))); + toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); + } + } + } + + private static void editEBFNoGasRecipes(GT_Recipe recipe, Materials mat, HashSet toAdd, HashSet noGas) { + for (ItemStack is : noGas) { + byte circuitConfiguration = 1; + if (GT_Utility.areStacksEqual(is, recipe.mOutputs[0])) { + ArrayList inputs = new ArrayList<>(recipe.mInputs.length); + for (ItemStack stack : recipe.mInputs) + if (!GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(11), stack) && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(14), stack) && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(19), stack)) { + if (BW_Util.checkStackAndPrefix(stack)) + circuitConfiguration = (byte) (GT_OreDictUnificator.getAssociation(stack).mPrefix.equals(OrePrefixes.dustSmall) ? 4 : GT_OreDictUnificator.getAssociation(stack).mPrefix.equals(OrePrefixes.dustTiny) ? 9 : 1); + inputs.add(stack); + } + inputs.add(GT_Utility.getIntegratedCircuit(circuitConfiguration)); + toAdd.add(new BWRecipes.DynamicGTRecipe(false, inputs.toArray(new ItemStack[0]), recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + ((double) mat.getProtons() * 2.75D))), recipe.mEUt, recipe.mSpecialValue)); + break; + } + } + } + + private static void removeDuplicateGasRecipes(HashSet toAdd) { + HashSet duplicates = new HashSet<>(); + for (GT_Recipe recipe : toAdd) { + for (GT_Recipe recipe2 : toAdd) { + if (recipe.mEUt != recipe2.mEUt || recipe.mDuration != recipe2.mDuration || recipe.mSpecialValue != recipe2.mSpecialValue || recipe == recipe2 || recipe.mInputs.length != recipe2.mInputs.length || recipe.mFluidInputs.length != recipe2.mFluidInputs.length) + continue; + boolean isSame = true; + for (int i = 0; i < recipe.mInputs.length; i++) { + if (!GT_Utility.areStacksEqual(recipe.mInputs[i], recipe2.mInputs[i])) + isSame = false; + } + for (int i = 0; i < recipe.mFluidInputs.length; i++) { + if (!GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], recipe2.mFluidInputs[i])) + isSame = false; + } + if (isSame) + duplicates.add(recipe2); + } + } + toAdd.removeAll(duplicates); + } + + private static Materials getMaterialFromInputFluid(GT_Recipe recipe) { + String materialString = recipe.mFluidInputs[0].getFluid().getName().replaceAll("molten", "").replaceAll("fluid", ""); + return Materials.get(materialString.substring(0, 1).toUpperCase() + materialString.substring(1)); + } + + private static void editRecipes(ArrayListMultimap base, HashSet noGas) { + if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeFluidNameMap.contains(Objects.requireNonNull(fluids.get(Oganesson)).getName())) + return; + + HashSet toAdd = new HashSet<>(); + + for (SubTag gasTag : base.keySet()) { + for (GT_Recipe recipe : base.get(gasTag)) { + if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) { + Materials mat = getMaterialFromInputFluid(recipe); + if (mat != Materials._NULL) { + editEBFWerkstoffRecipes(gasTag, recipe, mat, toAdd); + editEBFMaterialRecipes(gasTag, recipe, mat, toAdd); + editEBFNoGasRecipes(recipe, mat, toAdd, noGas); + } + } + } + GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.removeAll(base.get(gasTag)); + } + + removeDuplicateGasRecipes(toAdd); + toAdd.forEach(GT_Recipe.GT_Recipe_Map.sBlastRecipes::add); + } + + @SuppressWarnings("ALL") + public static void addElectricImplosionCompressorRecipes() { + if (eicMap == null) { + eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); + GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream().filter(e -> e.mInputs != null).forEach(recipe -> eicMap.addRecipe(true, Arrays.stream(recipe.mInputs).filter(e -> !StaticRecipeChangeLoaders.checkForExplosives(e)).distinct().toArray(ItemStack[]::new), recipe.mOutputs, null, null, null, 1, BW_Util.getMachineVoltageFromTier(10), 0)); + } + } + + private static boolean checkForExplosives(ItemStack input) { + return (GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L)) || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); + } + + public static void patchEBFMapForCircuitUnification() { + Field mUsualInputCount = FieldUtils.getField(GT_Recipe.GT_Recipe_Map.class, "mUsualInputCount", true); + mUsualInputCount.setAccessible(true); + + try { + Field modifiersField = Field.class.getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + modifiersField.setInt(mUsualInputCount, mUsualInputCount.getModifiers() & ~Modifier.FINAL); + mUsualInputCount.setInt(GT_Recipe.GT_Recipe_Map.sBlastRecipes, 3); + } catch (IllegalAccessException | NoSuchFieldException e) { + e.printStackTrace(); + } + } + + public static void synchroniseCircuitUseMulti() { + GT_Recipe.GT_Recipe_Map[] gt_recipe_maps = { + GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes, + GT_Recipe.GT_Recipe_Map.sBlastRecipes + }; + getRecipesByCircuitID(gt_recipe_maps).forEach(StaticRecipeChangeLoaders::transformCircuitRecipes); + } + + private static int getBlastLogic(GT_Recipe recipe) { + int ret = 0; + + for (ItemStack stack : recipe.mInputs) { + if (stack != null) { + ret += Math.max(stack.stackSize, 1); + } + } + + while (ret > 14) { + ret /= 10; + } + + if (recipe.mFluidInputs.length != 0) + ret += 10; + + return ret; + } + + private static int getLogicFuntion(GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe, Pair counts) { + if (gt_recipe_map == GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) + return getChemicalLogic(recipe, counts); + else if (gt_recipe_map == GT_Recipe.GT_Recipe_Map.sBlastRecipes) + return getBlastLogic(recipe); + throw new NoSuchMethodError("Could not find a Supported Method for " + gt_recipe_map.mUnlocalizedName); + } + + private static int getChemicalLogic(GT_Recipe recipe, Pair counts) { + Pair toSet; + + if (counts.getKey() == 0 || counts.getValue() == 0) + toSet = new Pair<>(Math.max(recipe.mFluidOutputs.length, recipe.mOutputs.length), 0); + else if (counts.getValue() > 2) + toSet = new Pair<>(counts.getKey() + counts.getValue(), 1); + else + toSet = counts; + + return toSet.getValue() * 10 + toSet.getKey(); + } + + private static void transformCircuitRecipes(GT_Recipe.GT_Recipe_Map gtRecipeMap, Map> mapGtRecipeCounts) { + mapGtRecipeCounts.forEach((recipe, counts) -> + StaticRecipeChangeLoaders.rewriteForCorrectCircuit(gtRecipeMap, recipe, counts)); + + gtRecipeMap.mRecipeList.clear(); + gtRecipeMap.mRecipeList.addAll(mapGtRecipeCounts.keySet()); + + fixRecipeClashes(gtRecipeMap); + } + + private static void fixRecipeClashes(GT_Recipe.GT_Recipe_Map gtRecipeMap) { + boolean hasClashes; + do { + hasClashes = false; + gtRecipeMap.reInit(); + for (GT_Recipe re : gtRecipeMap.mRecipeList) { + if (gtRecipeMap.findRecipe(null, false, Long.MAX_VALUE, re.mFluidInputs, re.mInputs) != re) { + hasClashes = true; + fixRecipeCircuitClashes(re); + } + } + } while (hasClashes); + } + + private static void fixRecipeCircuitClashes(GT_Recipe recipe) { + for (int i = 0; i < recipe.mInputs.length; i++) { + if (GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(Short.MAX_VALUE), recipe.mInputs[i])) { + int nudmg = recipe.mInputs[i].getItemDamage() + 1 > 24 ? 1 : recipe.mInputs[i].getItemDamage() + 1; + recipe.mInputs[i].setItemDamage(nudmg); + } + } + } + + private static Map>> getRecipesByCircuitID(GT_Recipe.GT_Recipe_Map[] ref) { + return Arrays.stream(ref) + .collect(Collectors + .toMap(k -> k, k -> + getArrayListMultiMapFromRecipeList( + gatherNoCircuitRecipes( + new HashSet<>(k.mRecipeList) + ) + ) + ) + ); + } + + private static GT_Recipe rewriteForCorrectCircuit(GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe, Pair counts) { + ItemStack[] old = BW_Util.copyAndRemoveNulls(recipe.mInputs, ItemStack.class); + ItemStack[] nu = Arrays.copyOf(old, old.length + 1); + + nu[old.length] = GT_Utility.getIntegratedCircuit( //Max 24, Min 1 + Math.min( + Math.max( + getLogicFuntion(gt_recipe_map, recipe, counts), + 1), + 24) + ); + recipe.mInputs = nu; + + return recipe; + } + + @SuppressWarnings("unchecked") + private static Collection gatherNoCircuitRecipes(Collection mRecipeList) { + Collection newColl; + try { + newColl = (Collection) mRecipeList.getClass().newInstance(); + } catch (InstantiationException | IllegalAccessException e) { + newColl = new HashSet<>(); + } + + recipeloop: for (GT_Recipe r : mRecipeList) { + for (int i = 0; i < r.mInputs.length; i++) + if (GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(Short.MAX_VALUE), r.mInputs[i])) { + continue recipeloop; + } + newColl.add(r); + } + + return newColl; + } + + private static Map> getArrayListMultiMapFromRecipeList(Collection mRecipeList) { + return mRecipeList.stream().collect(Collectors.toMap(recipe -> recipe, recipe -> + new Pair<>( + (int) Arrays.stream(recipe.mInputs) + .filter(Objects::nonNull) + .count(), + (int) Arrays.stream(recipe.mFluidInputs) + .filter(Objects::nonNull) + .count() + ) + )); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java index ede9c1df94..46a7c36cc9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,12 +22,12 @@ package com.github.bartimaeusnek.bartworks.common.net; +import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.Coords; import com.google.common.io.ByteArrayDataInput; -import cpw.mods.fml.common.FMLCommonHandler; import gregtech.api.net.GT_Packet; import net.minecraft.world.IBlockAccess; @@ -102,7 +102,7 @@ public class RendererPacket extends GT_Packet { @Override public void process(IBlockAccess iBlockAccess) { - if (FMLCommonHandler.instance().getSide().isClient()) { + if (SideReference.Side.Client) { if (this.removal == 0) GT_TileEntity_BioVat.staticColorMap.put(this.coords, this.integer); else diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index fb687ed2a0..e22b440150 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import gregtech.common.GT_Pollution; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -39,6 +40,9 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.*; +import java.util.Arrays; +import java.util.Optional; + public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDropsContent, IFluidHandler, IFluidTank, ITileWithGUI, ITileAddsInformation, ITileHasDifferentTextureSides { public static final int FUELSLOT = 0; @@ -53,12 +57,10 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public void writeToNBT(NBTTagCompound p_145841_1_) { NBTTagCompound subItemStack = new NBTTagCompound(); - if (this.fuelstack == null) - p_145841_1_.setTag("ItemStack", subItemStack); - else { + if (this.fuelstack != null) { this.fuelstack.writeToNBT(subItemStack); - p_145841_1_.setTag("ItemStack", subItemStack); } + p_145841_1_.setTag("ItemStack", subItemStack); NBTTagCompound subFluidStack = new NBTTagCompound(); this.outputstack.writeToNBT(subFluidStack); p_145841_1_.setTag("FluidStack", subFluidStack); @@ -79,22 +81,26 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr super.readFromNBT(p_145839_1_); } - @Override - public void updateEntity() { - if (this.worldObj.isRemote || ((this.fuelstack == null || this.fuelstack.stackSize <= 0) && this.fuel <= 0) || (this.tick == 0 && this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) == Blocks.air)) { - return; - } + private boolean checkPreUpdate() { + return this.worldObj.isRemote || ((this.fuelstack == null || this.fuelstack.stackSize <= 0) && this.fuel <= 0) || (this.tick == 0 && this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) == Blocks.air); + } + + private void fixUnderlflow() { if (this.fuel < 0) this.fuel = 0; + } + private void handleRefuel() { if (this.fuelstack != null && this.fuel == 0) { this.fuel = this.maxfuel = TileEntityFurnace.getItemBurnTime(this.fuelstack); --this.fuelstack.stackSize; if (this.fuelstack.stackSize <= 0) this.fuelstack = null; } + } + private void handleWaterGeneration() { if (this.fuel > 0) { ++this.tick; --this.fuel; @@ -106,6 +112,60 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr } } + @Override + public void updateEntity() { + pushWaterToAdjacentTiles(); + if (checkPreUpdate()) + return; + + fixUnderlflow(); + handleRefuel(); + handleWaterGeneration(); + causePollution(); + } + + private void pushWaterToAdjacentTiles() { + Arrays.stream(ForgeDirection.values(), 0, 6) //All but Unknown + .forEach( + direction -> Optional.ofNullable( + this.worldObj.getTileEntity( + this.xCoord + direction.offsetX, + this.yCoord + direction.offsetY, + this.zCoord + direction.offsetZ) + ).ifPresent( + te -> { + if (te instanceof IFluidHandler) { + IFluidHandler tank = (IFluidHandler) te; + if (tank.canFill(direction.getOpposite(), this.outputstack.getFluid())) { + int drainage; + if ((drainage = tank.fill(direction.getOpposite(), this.outputstack, false)) > 0) { + tank.fill(direction.getOpposite(), this.outputstack, true); + this.drain(drainage, true); + } + } + } else if (te instanceof IFluidTank) { + IFluidTank tank = (IFluidTank) te; + int drainage; + if ((drainage = tank.fill(this.outputstack, false)) > 0) { + tank.fill(this.outputstack, true); + this.drain(drainage, true); + } + } + } + )); + } + + private void causePollution() { + Optional.ofNullable(this.worldObj).ifPresent(e -> { + if (e.getTotalWorldTime() % 20 == 0) { + Optional.ofNullable(e.getChunkFromBlockCoords(this.xCoord, this.zCoord)).ifPresent(c -> + GT_Pollution.addPollution(c, 5) + ); + } + } + ); + } + @Override public int[] getAccessibleSlotsFromSide(int side) { return new int[]{0}; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 5623735b19..90b0c4ff7d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.items.LabParts; @@ -29,7 +30,6 @@ import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.net.RendererPacket; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.util.*; -import cpw.mods.fml.common.FMLCommonHandler; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -53,9 +53,8 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; +import java.util.*; +import java.util.stream.Collectors; public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @@ -86,8 +85,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { public static int[] specialValueUnpack(int aSpecialValue) { int[] ret = new int[4]; - ret[0] = aSpecialValue & 0xF; // = glas tier - ret[1] = aSpecialValue >>> 4 & 0b11; // = special valure + ret[0] = aSpecialValue & 0xF; // = glass tier + ret[1] = aSpecialValue >>> 4 & 0b11; // = special value ret[2] = aSpecialValue >>> 6 & 0b1; //boolean exact svt | 1 = true | 0 = false ret[3] = aSpecialValue >>> 7 & Integer.MAX_VALUE; // = sievert return ret; @@ -102,21 +101,11 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } private int getInputCapacity() { - int ret = 0; - - for (GT_MetaTileEntity_Hatch_Input fluidH : this.mInputHatches) { - ret += fluidH.getCapacity(); - } - return ret; + return this.mInputHatches.stream().mapToInt(GT_MetaTileEntity_Hatch_Input::getCapacity).sum(); } private int getOutputCapacity() { - int ret = 0; - - for (GT_MetaTileEntity_Hatch_Output fluidH : this.mOutputHatches) { - ret += fluidH.getCapacity(); - } - return ret; + return this.mOutputHatches.stream().mapToInt(GT_MetaTileEntity_Hatch_Output::getCapacity).sum(); } @Override @@ -143,17 +132,14 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } private int calcMod(double x) { - int ret = (int) MathUtils.ceil(ConfigHandler.bioVatMaxParallelBonus*(-(((2D*x/(double)this.getOutputCapacity())-1D)*(2D*x/(double)this.getOutputCapacity()-1D))+1D)); - return ret <= 0 ? 1 : Math.min(ret, 100);//(int) MathUtils.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); - } + double y = (((double) this.getOutputCapacity()) / 2D), + z = ConfigHandler.bioVatMaxParallelBonus; - @Override - public boolean checkRecipe(ItemStack itemStack) { - GT_Recipe.GT_Recipe_Map gtRecipeMap = this.getRecipeMap(); - - if (gtRecipeMap == null) - return false; + int ret = MathUtils.ceilInt(((-1D / y * Math.pow((x - y), 2D) + y) / y * z)); + return MathUtils.clamp(1, ret, ConfigHandler.bioVatMaxParallelBonus); + } + private List getItemInputs(){ ArrayList tInputList = this.getStoredInputs(); int tInputList_sS = tInputList.size(); for (int i = 0; i < tInputList_sS - 1; i++) { @@ -170,8 +156,10 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } } } - ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); + return tInputList; + } + private List getFluidInputs(){ ArrayList tFluidList = this.getStoredFluids(); int tFluidList_sS = tFluidList.size(); for (int i = 0; i < tFluidList_sS - 1; i++) { @@ -188,10 +176,20 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } } } + return tFluidList; + } - FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); + @Override + public boolean checkRecipe(ItemStack itemStack) { + GT_Recipe.GT_Recipe_Map gtRecipeMap = this.getRecipeMap(); - if (tFluidList.size() > 0) { + if (gtRecipeMap == null) + return false; + + ItemStack[] tInputs = getItemInputs().toArray(new ItemStack[0]); + FluidStack[] tFluids = getFluidInputs().toArray(new FluidStack[0]); + + if (tFluids.length > 0) { GT_Recipe gtRecipe = gtRecipeMap.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, this.getMaxInputVoltage(), tFluids, itemStack, tInputs); @@ -205,19 +203,22 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { this.mNeededSievert = conditions[3]; - if (conditions[2] == 0 ? (this.mSievert < this.mNeededSievert || this.mGlassTier < conditions[0]) : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0])) + if (conditions[2] == 0 ? + (this.mSievert < this.mNeededSievert || this.mGlassTier < conditions[0]) + : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0])) return false; int times = 1; - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; + Set storedFluidOutputs = this.getStoredFluidOutputs(); + if (gtRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { - if (this.getStoredFluidOutputs().size() > 0) { + if (storedFluidOutputs.size() > 0) { this.mOutputFluids = new FluidStack[gtRecipe.mFluidOutputs.length]; - for (FluidStack storedOutputFluid : this.getStoredFluidOutputs()) { + for (FluidStack storedOutputFluid : storedFluidOutputs) { if (storedOutputFluid.isFluidEqual(gtRecipe.getFluidOutput(0))) for (FluidStack inputFluidStack : gtRecipe.mFluidInputs) { int j = this.calcMod(storedOutputFluid.amount); @@ -226,7 +227,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { times++; } } - for (FluidStack storedfluidStack : this.getStoredFluidOutputs()) { + for (FluidStack storedfluidStack : storedFluidOutputs) { for (int i = 0; i < gtRecipe.mFluidOutputs.length; i++) { if (storedfluidStack.isFluidEqual(gtRecipe.getFluidOutput(i))) this.mOutputFluids[i] = (new FluidStack(gtRecipe.getFluidOutput(i), times * gtRecipe.getFluidOutput(0).amount)); @@ -254,14 +255,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { return false; } - public ArrayList getStoredFluidOutputs() { - ArrayList rList = new ArrayList<>(); - - for (GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) { - if (tHatch.getFluid() != null) - rList.add(tHatch.getFluid()); - } - return rList; + public Set getStoredFluidOutputs() { + return this.mOutputHatches.stream().map(GT_MetaTileEntity_Hatch_Output::getFluid).filter(Objects::nonNull).collect(Collectors.toSet()); } private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity) { @@ -317,12 +312,12 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } } - if (blockcounter > 18) - if (this.mRadHatches.size() < 2) - if (this.mOutputHatches.size() == 1) - if (this.mMaintenanceHatches.size() == 1) - if (this.mInputHatches.size() > 0) - return this.mEnergyHatches.size() > 0; + if (blockcounter > 18 && + this.mRadHatches.size() < 2 && + this.mOutputHatches.size() == 1 && + this.mMaintenanceHatches.size() == 1 && + this.mInputHatches.size() > 0) + return this.mEnergyHatches.size() > 0; return false; } @@ -359,7 +354,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { GT_TileEntity_BioVat.staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId)); GT_TileEntity_BioVat.staticColorMap.put(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId), lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB()); - if (FMLCommonHandler.instance().getSide().isServer()) { + if (SideReference.Side.Server) { MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( this.getBaseMetaTileEntity().getWorld(), new RendererPacket( @@ -433,11 +428,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } private int reCalculateFluidAmmount() { - int lFluidAmount = 0; - for (int i = 0; i < this.getStoredFluids().size(); i++) { - lFluidAmount += this.getStoredFluids().get(i).amount; - } - return lFluidAmount; + return this.getStoredFluids().stream().mapToInt(fluidStack -> fluidStack.amount).sum(); } private int reCalculateHeight() { @@ -532,7 +523,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { if (this.getBaseMetaTileEntity().getWorld().getBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()).equals(FluidLoader.bioFluidBlock)) this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()); GT_TileEntity_BioVat.staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()), this.getBaseMetaTileEntity().getWorld().provider.dimensionId); - if (FMLCommonHandler.instance().getSide().isServer()) + if (SideReference.Side.Server) MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( this.getBaseMetaTileEntity().getWorld(), new RendererPacket( @@ -587,6 +578,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } @Override + @SuppressWarnings("deprecation") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_BioVat.MCASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_BioVat.MCASING_INDEX]}; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java index 5b26664943..c1c7cc0d29 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java @@ -69,9 +69,9 @@ public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_Distil FluidStack[] nuoutputs = new FluidStack[recipeDistill.mFluidOutputs.length]; for (int i = 0; i < nuoutputs.length; i++) { nuoutputs[i] = recipeDistill.mFluidOutputs[i]; - nuoutputs[i].amount = (int) (MathUtils.floor(recipeDistill.mFluidOutputs[i].amount * ratio)); + nuoutputs[i].amount = MathUtils.floorInt(recipeDistill.mFluidOutputs[i].amount * ratio); } - BWRecipes.DynamicGTRecipe combined = new BWRecipes.DynamicGTRecipe(true, null, recipeDistill.mOutputs, null, recipeDistill.mChances, recipeCracking.mFluidInputs, nuoutputs, (int) (MathUtils.floor(recipeDistill.mDuration * ratio)) + recipeCracking.mDuration, Math.max((int) (MathUtils.floor(recipeDistill.mEUt * ratio)), recipeCracking.mEUt), 0); + BWRecipes.DynamicGTRecipe combined = new BWRecipes.DynamicGTRecipe(true, null, recipeDistill.mOutputs, null, recipeDistill.mChances, recipeCracking.mFluidInputs, nuoutputs, (MathUtils.floorInt(recipeDistill.mDuration * ratio)) + recipeCracking.mDuration, Math.max((MathUtils.floorInt(recipeDistill.mEUt * ratio)), recipeCracking.mEUt), 0); if (combined.isRecipeInputEqual(true, array)) { this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 0d449ecddc..dc85f9476d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -139,7 +139,19 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.BISOPeletSupply + this.TRISOPeletSupply >= 100000)) return false; - int toReduce = new XSTR().nextInt((int) MathUtils.floor(((double)this.BISOPeletSupply + (double)this.TRISOPeletSupply) / 200D)); + reduceSupply(); + addBurnedOutBalls(); + this.updateSlots(); + + this.mOutputFluids = new FluidStack[]{FluidRegistry.getFluidStack("ic2hotcoolant",0)}; + + this.mEUt=0; + this.mMaxProgresstime=648000; + return true; + } + + private void reduceSupply() { + int toReduce = new XSTR().nextInt(MathUtils.floorInt(((double)this.BISOPeletSupply + (double)this.TRISOPeletSupply) / 200D)); this.savedBISO = BISOPeletSupply; this.savedTRISO = TRISOPeletSupply; @@ -155,14 +167,23 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { else this.BISOPeletSupply -= toReduce; } + } - this.updateSlots(); + private void addBurnedOutBalls() { + int burnedTRISO = this.savedTRISO - this.TRISOPeletSupply; + int burnedBISO = this.savedBISO - this.BISOPeletSupply; + int burnedTRISOBall = burnedTRISO / 64; + int burnedBISOBall = burnedBISO / 64; - this.mOutputFluids = new FluidStack[]{FluidRegistry.getFluidStack("ic2hotcoolant",0)}; + burnedBISO -= (burnedBISOBall*64); + burnedTRISO -= (burnedTRISOBall*64); - this.mEUt=0; - this.mMaxProgresstime=648000; - return true; + this.mOutputItems = new ItemStack[] { + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, burnedTRISOBall, 6), + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, burnedTRISO, 8), + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, burnedBISOBall, 7), + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, burnedBISO, 9) + }; } @Override @@ -186,7 +207,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { accessibleCoolant += fluidStack.amount; } } - + accessibleCoolant = Math.min((long) ((0.00711111111111111111111111111111D*(double)this.savedTRISO + 0.00474074074074074074074074074074D*(double)this.savedBISO)), accessibleCoolant); for (FluidStack fluidStack : this.getStoredFluids()) { @@ -308,6 +329,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { } @Override + @SuppressWarnings("deprecation") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_THTR.BASECASINGINDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_THTR.BASECASINGINDEX]}; } @@ -319,7 +341,18 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { } public static class THTRMaterials{ - static final SimpleSubItemClass aTHTR_Materials = new SimpleSubItemClass("BISOPelletCompound","BISOPellet","TRISOPelletCompound","TRISOPellet","BISOPelletBall","TRISOPelletBall"); + static final SimpleSubItemClass aTHTR_Materials = new SimpleSubItemClass( + "BISOPelletCompound", + "BISOPellet", + "TRISOPelletCompound", + "TRISOPellet", + "BISOPelletBall", + "TRISOPelletBall", + "BurnedOutBISOPelletBall", + "BurnedOutTRISOPelletBall", + "BurnedOutBISOPellet", + "BurnedOutTRISOPellet" + ); public static void registeraTHR_Materials(){ GameRegistry.registerItem(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,"bw.THTRMaterials"); } @@ -345,15 +378,17 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials),Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),40,30); ItemStack[] pellets = new ItemStack[6]; Arrays.fill(pellets,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,1)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,24000,30,0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),GT_Utility.getIntegratedCircuit(17)}, pellets,null,null,null,null,24000,30,0); GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),Materials.Silicon.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,2),40,30); GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,2),Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,5),40,30); pellets = new ItemStack[6]; Arrays.fill(pellets,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,3)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,5),GT_Utility.getIntegratedCircuit(17)},pellets,null,null,null,null,48000,30,0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,5),GT_Utility.getIntegratedCircuit(17)}, pellets,null,null,null,null,48000,30,0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,6),GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,8)},null,null,null,null,48000,30,0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,7),GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,9)},null,null,null,null,48000,30,0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,8)},new ItemStack[]{Materials.Lutetium.getDustSmall(2)},null,null,null,null,1200,30,0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,9)},new ItemStack[]{Materials.Lutetium.getDustSmall(4)},null,null,null,null,1200,30,0); } } - - -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 1e3c2dc45d..69a20db22c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_Windmill; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; +import com.github.bartimaeusnek.bartworks.server.container.BW_Container_Windmill; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.common.FMLCommonHandler; @@ -57,8 +58,9 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; -import java.util.ArrayList; import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; import static gregtech.api.enums.GT_Values.V; @@ -68,7 +70,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { private static final IIconContainer[] iIconContainers = new IIconContainer[2]; private static final ITexture[] iTextures = new ITexture[3]; - private final ArrayList tedList = new ArrayList<>(); + private static final XSTR localRandomInstance = new XSTR(); private BW_RotorBlock rotorBlock; private byte hasDoor; @@ -85,16 +87,15 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { return true; } + private final Set tileEntityDispensers = new HashSet<>(); + + @Override public boolean onRunningTick(ItemStack aStack) { if (this.mMaxProgresstime > 0) this.mProgresstime += this.rotorBlock.getGrindPower(); return this.rotorBlock.getGrindPower() > 0; } - public boolean doRandomMaintenanceDamage() { - return true; - } - @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return true; @@ -138,6 +139,27 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { return true; } + @Override + public boolean doRandomMaintenanceDamage() { + return true; + } + + private boolean hardOverride(int maxProgresstime, boolean randomise, ItemStack input, ItemStack... outputs) { + input.stackSize -= 1; + this.mMaxProgresstime = maxProgresstime; + if (randomise) { + if (localRandomInstance.nextInt(2) == 0) + this.mOutputItems[0] = outputs[0]; + else + this.mOutputItems[0] = outputs[1]; + } else { + this.mOutputItems[0] = outputs[0]; + if (outputs.length == 2) + this.mOutputItems[1] = outputs[1]; + } + return true; + } + @Override public boolean checkRecipe(ItemStack itemStack) { @@ -150,119 +172,110 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { //Override Recipes that doesnt quite work well with OreUnificator //Items if (itemStack.getItem().equals(Items.wheat)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 15 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 1L)); - this.mOutputItems[1] = (GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wheat, 1L)); - return true; + return hardOverride( + 30000, + false, + itemStack, + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 1L), + GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wheat, 1L)); } else if (itemStack.getItem().equals(Items.bone)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 15 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = new ItemStack(Items.dye, 4, 15); - else - this.mOutputItems[0] = new ItemStack(Items.dye, 3, 15); - return true; + return hardOverride( + 30000, + true, + itemStack, + new ItemStack(Items.dye, 4, 15), + new ItemStack(Items.dye, 3, 15)); } //Blocks else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.gravel)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 30 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = new ItemStack(Items.flint, 2); - else - this.mOutputItems[0] = new ItemStack(Items.flint); - return true; + return hardOverride( + 60000, + true, + itemStack, + new ItemStack(Items.flint, 2), + new ItemStack(Items.flint)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.cobblestone) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stone)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 2L); - else - this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L); - return true; + return hardOverride( + 120000, + true, + itemStack, + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 2L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.sandstone)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 45 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = new ItemStack(Blocks.sand, 3); - else - this.mOutputItems[0] = new ItemStack(Blocks.sand, 2); - return true; + return hardOverride( + 120000, + true, + itemStack, + new ItemStack(Blocks.sand, 3), + new ItemStack(Blocks.sand, 2)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.hardened_clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stained_hardened_clay)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = Materials.Clay.getDust(2); - else - this.mOutputItems[0] = Materials.Clay.getDust(1); - return true; + return hardOverride( + 120000, + true, + itemStack, + Materials.Clay.getDust(2), + Materials.Clay.getDust(1)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.redstone_block)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - this.mOutputItems[0] = Materials.Redstone.getDust(9); - return true; + return hardOverride( + 120000, + false, + itemStack, + Materials.Redstone.getDust(9)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glass)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glass, 1L)); - return true; + return hardOverride( + 120000, + false, + itemStack, + (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glass, 1L))); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.wool)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = new ItemStack(Items.string, 3); - else - this.mOutputItems[0] = new ItemStack(Items.string, 2); - return true; + return hardOverride( + 120000, + true, + itemStack, + new ItemStack(Items.string, 3), + new ItemStack(Items.string, 2)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glowstone)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = new ItemStack(Items.glowstone_dust, 4); - else - this.mOutputItems[0] = new ItemStack(Items.glowstone_dust, 3); - return true; + return hardOverride( + 120000, + true, + itemStack, + new ItemStack(Items.glowstone_dust, 4), + new ItemStack(Items.glowstone_dust, 3)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.netherrack)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Netherrack, 2L)); - else - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Netherrack, 1L)); - return true; + return hardOverride( + 120000, + true, + itemStack, + (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Netherrack, 2L)), + (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Netherrack, 1L))); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 12L)); - else - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 6L)); - return true; + return hardOverride( + 120000, + true, + itemStack, + (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 12L)), + (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 6L))); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log2)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 12L)); - else - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 6L)); - return true; + return hardOverride( + 120000, + true, + itemStack, + (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 12L)), + (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 6L))); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.pumpkin)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 15 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = new ItemStack(Items.pumpkin_seeds, 2); - else - this.mOutputItems[0] = new ItemStack(Items.pumpkin_seeds, 1); - return true; + return hardOverride( + 30000, + true, + itemStack, + new ItemStack(Items.pumpkin_seeds, 2), + new ItemStack(Items.pumpkin_seeds, 1)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.melon_block)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 15 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = new ItemStack(Items.melon_seeds, 2); - else - this.mOutputItems[0] = new ItemStack(Items.melon_seeds, 1); - return true; + return hardOverride( + 30000, + true, + itemStack, + new ItemStack(Items.melon_seeds, 2), + new ItemStack(Items.melon_seeds, 1)); } //null checks for GT shit @@ -276,40 +289,47 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { //Ore Unificator shit for balance if (OrePrefixes.ingot.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.gem.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 45 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); - return true; + return hardOverride( + 90000, + false, + itemStack, + (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); } else if (OrePrefixes.ore.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.crushed, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); - return true; + return hardOverride( + 120000, + false, + itemStack, + (GT_OreDictUnificator.get(OrePrefixes.crushed, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); } else if (OrePrefixes.nugget.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 15 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dustTiny, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); - return true; + return hardOverride( + 30000, + false, + itemStack, + (GT_OreDictUnificator.get(OrePrefixes.dustTiny, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); } else if (OrePrefixes.crushed.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 30 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dustImpure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); - return true; + return hardOverride( + 60000, + false, + itemStack, + (GT_OreDictUnificator.get(OrePrefixes.dustImpure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); } else if (OrePrefixes.crushedPurified.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 30 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dustPure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); - return true; + return hardOverride( + 60000, + false, + itemStack, + (GT_OreDictUnificator.get(OrePrefixes.dustPure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); } else if (OrePrefixes.crushedCentrifuged.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 30 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); - return true; + return hardOverride( + 60000, + false, + itemStack, + (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); } else if (OrePrefixes.block.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, (GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL)) ? 9L : 1L)); - return true; + return hardOverride( + 120000, + false, + itemStack, + (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, (GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL)) ? 9L : 1L))); } else if ( OrePrefixes.stone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.stoneBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || @@ -321,36 +341,41 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { OrePrefixes.stoneSmooth.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.cobblestone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) ) { - itemStack.stackSize -= 1; - this.mMaxProgresstime = 60 * 20 * 100; - if (new XSTR().nextInt(2) == 0) - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 2L)); - else - this.mOutputItems[0] = (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L)); - return true; + return hardOverride( + 120000, + true, + itemStack, + (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 2L)), + (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); } return this.recipe_fallback(itemStack); //2nd fallback } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new BW_GUIContainer_Windmill(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName()); + return new BW_GUIContainer_Windmill(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new BW_Container_Windmill(aPlayerInventory, aBaseMetaTileEntity); } public boolean addDispenserToOutputSet(TileEntity aTileEntity) { if (aTileEntity instanceof TileEntityDispenser) { - this.tedList.add((TileEntityDispenser) aTileEntity); + this.tileEntityDispensers.add((TileEntityDispenser) aTileEntity); return true; } return false; } @SuppressWarnings("ALL") + @Override public boolean addOutput(ItemStack aStack) { if (GT_Utility.isStackInvalid(aStack)) return false; - for (TileEntityDispenser tHatch : this.tedList) { + for (TileEntityDispenser tHatch : this.tileEntityDispensers) { for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) { if (tHatch.getStackInSlot(i) == null || GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack) && aStack.stackSize + tHatch.getStackInSlot(i).stackSize <= 64) { if (GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack)) { @@ -454,9 +479,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { return false; //check for outputs - if (this.tedList.isEmpty()) + if (this.tileEntityDispensers.isEmpty()) return false; - this.mWrench = true; this.mScrewdriver = true; this.mSoftHammer = true; @@ -473,12 +497,14 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + this.mProgresstime++; if (aBaseMetaTileEntity.isServerSide()) { if (this.mEfficiency < 0) this.mEfficiency = 0; + //noinspection NonAtomicOperationOnVolatileField if (--this.mUpdate == 0 || --this.mStartUpCheck == 0) { this.hasDoor = 0; - this.tedList.clear(); + this.tileEntityDispensers.clear(); this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); } if (this.mStartUpCheck < 0) { @@ -577,6 +603,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { } @SideOnly(Side.CLIENT) + @Override public void registerIcons(IIconRegister aBlockIconRegister) { GT_TileEntity_Windmill.iIcons[0] = Blocks.brick_block.getIcon(0, 0); GT_TileEntity_Windmill.iIconContainers[0] = new IIconContainer() { @@ -643,4 +670,4 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { return this.getBaseMetaTileEntity().getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; } -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index cf38712bc6..86ac7fc73d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,18 +22,25 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.MegaUtils; +import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; +import com.github.bartimaeusnek.crossmod.tectech.TecTechUtils; +import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.LowPowerLaser; +import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; @@ -46,16 +53,28 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import java.lang.reflect.Field; import java.util.*; import java.util.stream.Collectors; import static gregtech.api.enums.GT_Values.V; -public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBlastFurnace { +@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) +public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBlastFurnace implements TecTechEnabledMulti { private int mHeatingCapacity; private byte glasTier; private int polPtick = super.getPollutionPerTick(null) * ConfigHandler.megaMachinesMax; + static Field controllerY; + + static { + try { + controllerY = GT_MetaTileEntity_ElectricBlastFurnace.class.getDeclaredField("controllerY"); + } catch (NoSuchFieldException e) { + MainMod.LOGGER.catching(e); + } + controllerY.setAccessible(true); + } public GT_TileEntity_MegaBlastFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -77,13 +96,10 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return fdsc; } - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setByte("glasTier",glasTier); - aNBT.setByte("circuitMode",circuitMode); - aNBT.setLong("lEUt",lEUt); - } + @SuppressWarnings("rawtypes") + public ArrayList TTTunnels = new ArrayList<>(); + @SuppressWarnings("rawtypes") + public ArrayList TTMultiAmp = new ArrayList<>(); @Override public void loadNBTData(NBTTagCompound aNBT) { @@ -119,69 +135,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl this.getBaseMetaTileEntity().disableWorking(); } - public String[] getInfoData() { - int mPollutionReduction = 0; - - for (GT_MetaTileEntity_Hatch_Muffler e : this.mMufflerHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(e)) { - mPollutionReduction = Math.max(e.calculatePollutionReduction(this.mPollution), mPollutionReduction); - } - } - - long storedEnergy = 0L; - long maxEnergy = 0L; - - for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); - } - } - - return new String[]{StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + this.mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + this.mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + -this.lEUt + EnumChatFormatting.RESET + " EU/t", StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + this.getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(this.getMaxInputVoltage())] + EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + (this.getIdealStatus() - this.getRepairStatus()) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW + (float) this.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %"}; - } - - private long lEUt = 0; - - public boolean drainEnergyInput(long aEU) { - if (aEU <= 0) - return true; - long allTheEu = 0; - int hatches = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - allTheEu += tHatch.getEUVar(); - hatches++; - } - if (allTheEu < aEU) - return false; - long euperhatch = aEU / hatches; - HashSet returnset = new HashSet<>(); - for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) - if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false)) - returnset.add(true); - else - returnset.add(false); - return returnset.size() > 0 && !returnset.contains(false); - } - -// @Override -// public long getMaxInputVoltage() { -// long rVoltage = 0L; -// Iterator var3 = this.mEnergyHatches.iterator(); -// -// while(var3.hasNext()) { -// GT_MetaTileEntity_Hatch_Energy tHatch = (GT_MetaTileEntity_Hatch_Energy)var3.next(); -// if (isValidMetaTileEntity(tHatch)) { -// rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage(); -// } -// } -// //glass tier needs NBT persistance if this is enabled -// return glasTier != 8 && rVoltage > BW_Util.getTierVoltage(glasTier) ? BW_Util.getTierVoltage(glasTier) : rVoltage ; -// } - - private byte circuitMode = 0; + private long lEUt = 0; @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { @@ -195,95 +150,22 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl circuitMode = 0; } - GT_Utility.sendChatToPlayer(aPlayer,circuitMode > 0 ? "MEBF will prioritise circuit: "+circuitMode : "Circuit prioritisation disabled."); + GT_Utility.sendChatToPlayer(aPlayer, circuitMode > 0 ? "MEBF will prioritise circuit: " + circuitMode : "Circuit prioritisation disabled."); } @Override - public boolean checkRecipe(ItemStack itemStack) { - - ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - - FluidStack[] tFluids = this.getStoredFluids().toArray(new FluidStack[0]); - long tVoltage = this.getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe; - if (circuitMode > 0 && Arrays.stream(tInputs).anyMatch(e -> GT_Utility.areStacksEqual(e,GT_Utility.getIntegratedCircuit(circuitMode),true))){ - List modInputs = Arrays.stream(tInputs).filter(Objects::nonNull).filter(e -> !e.getItem().equals(GT_Utility.getIntegratedCircuit(circuitMode).getItem())).collect(Collectors.toList()); - modInputs.add(GT_Utility.getIntegratedCircuit(circuitMode)); - tInputs = modInputs.toArray(new ItemStack[0]); - } - tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); - if (tRecipe == null) { - if (circuitMode == 0) - return false; - tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); - if (tRecipe == null) - return false; - } - - ArrayList outputItems = new ArrayList<>(); - ArrayList outputFluids = new ArrayList<>(); - - boolean found_Recipe = false; - int processed = 0; - - long nominalV = BW_Util.getnominalVoltage(this); - int tHeatCapacityDivTiers = (this.mHeatingCapacity - tRecipe.mSpecialValue) / 900; - long precutRecipeVoltage = (long) (tRecipe.mEUt * Math.pow(0.95, tHeatCapacityDivTiers)); - - while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { - if (this.mHeatingCapacity >= tRecipe.mSpecialValue && (precutRecipeVoltage * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { - found_Recipe = true; - for (int i = 0; i < tRecipe.mOutputs.length; i++) { - outputItems.add(tRecipe.getOutput(i)); - } - for (int i = 0; i < tRecipe.mFluidOutputs.length; i++) { - outputFluids.add(tRecipe.getFluidOutput(i)); - } - ++processed; - } else - break; - } - - if (found_Recipe) { - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - - byte overclockCount; - long actualEUT = (long) (tRecipe.mEUt) * processed; -// if (actualEUT > Integer.MAX_VALUE) { -// byte divider = 0; -// while (actualEUT > Integer.MAX_VALUE) { -// actualEUT = actualEUT / 2; -// divider++; -// } -// overclockCount = this.calculateOverclockednessEBF((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), nominalV); -// } else - overclockCount = this.calculateOverclockednessEBF(actualEUT, tRecipe.mDuration, nominalV); - //In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) - return false; - if (this.lEUt > 0) { - this.lEUt = (-this.lEUt); - } - if (tHeatCapacityDivTiers > 0) { - this.lEUt = (int) (this.lEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); - this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount); //extra free overclocking if possible - if (this.mMaxProgresstime < 1) - this.mMaxProgresstime = 1;//no eu efficiency correction - } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setByte("glasTier", glasTier); + aNBT.setByte("circuitMode", circuitMode); + aNBT.setLong("lEUt", lEUt); + } - this.polPtick = super.getPollutionPerTick(null) * processed; - this.mOutputItems = new ItemStack[outputItems.size()]; - this.mOutputItems = outputItems.toArray(this.mOutputItems); - this.mOutputFluids = new FluidStack[outputFluids.size()]; - this.mOutputFluids = outputFluids.toArray(this.mOutputFluids); - this.updateSlots(); - return true; - } - return false; + @Override + public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (LoaderReference.tectech) + return TecTechUtils.addEnergyInputToMachineList(this, aTileEntity, aBaseCasingIndex); + return super.addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); } /** @@ -321,7 +203,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl xEUt = this.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power timesOverclocked++; } - if (xEUt > maxInputVoltage){ + if (xEUt > maxInputVoltage) { //downclock one notch, we have overshot. xEUt >>=2; this.mMaxProgresstime <<= 1; @@ -341,47 +223,44 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return timesOverclocked; } - @Override - public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - this.mHeatingCapacity = 0; - boolean ret; - ret = BW_Util.check_layer(iGregTechTileEntity, 7, -2, -1, GregTech_API.sBlockCasings1, 11, 7, false,false,true,GregTech_API.sBlockCasings1,11,true,11); - ret &= BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11); - ret &= BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11); - for (int y = -1; y < 17; y++) { - ret &= BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, false, 11); - if (!this.getCoilHeat(iGregTechTileEntity, y)) - return false; - List metasFromLayer = BW_Util.getMetasFromLayer(iGregTechTileEntity, 7, y, y + 1, 7, y == 0, false, false); - for (Byte meta : metasFromLayer) { - byte inttier = BW_Util.getTierFromGlasMeta(meta); - if (this.glasTier > 0 && inttier != this.glasTier) - return false; - else if (this.glasTier == 0) - this.glasTier = inttier; - } + public String[] getInfoData() { + int mPollutionReduction = 0; + + for (GT_MetaTileEntity_Hatch_Muffler e : this.mMufflerHatches) + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(e)) + mPollutionReduction = Math.max(e.calculatePollutionReduction(this.mPollution), mPollutionReduction); + + long storedEnergy = 0L; + long maxEnergy = 0L; + + if (LoaderReference.tectech) { + long[] info = getCurrentInfoData(); + storedEnergy = info[0]; + maxEnergy = info[1]; } - int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 7; - int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 7; - for (int z = -6; z <= 6; z++) - for (int x = -6; x <= 6; x++) { - if (!this.addMufflerToMachineList(iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + x, 17, zDir + z), 11)) { - return false; - } + + for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); } - if (!this.mOutputHatches.isEmpty()) { - for (GT_MetaTileEntity_Hatch_Output hatchOutput : this.mOutputHatches) - if (hatchOutput.getBaseMetaTileEntity().getYCoord() < iGregTechTileEntity.getYCoord()) - return false; } - if (this.glasTier != 8 && !this.mEnergyHatches.isEmpty()) - for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) { - if (this.glasTier < hatchEnergy.mTier) - return false; - } + return new String[]{StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + this.mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + this.mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + -this.lEUt + EnumChatFormatting.RESET + " EU/t", StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + this.getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(this.getMaxInputVoltage())] + EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + (this.getIdealStatus() - this.getRepairStatus()) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW + (float) this.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %"}; + } - return ret && !this.mMaintenanceHatches.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mInputBusses.isEmpty(); + @Override + public boolean drainEnergyInput(long aEU) { + if (LoaderReference.tectech) + return TecTechUtils.drainEnergyMEBFTecTech(this, aEU); + return MegaUtils.drainEnergyMegaVanilla(this, aEU); + } + + @Override + public long getMaxInputVoltage() { + if (LoaderReference.tectech) + return TecTechUtils.getMaxInputVoltage(this); + return super.getMaxInputVoltage(); } private boolean getCoilHeat(IGregTechTileEntity iGregTechTileEntity, int y) { @@ -445,4 +324,179 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new GT_TileEntity_MegaBlastFurnace(this.mName); } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + + ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); + + FluidStack[] tFluids = this.getStoredFluids().toArray(new FluidStack[0]); + long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + + byte tTier = (byte) Math.max(1, GT_Utility.getTier(nominalV)); + GT_Recipe tRecipe; + if (circuitMode > 0 && Arrays.stream(tInputs).anyMatch(e -> GT_Utility.areStacksEqual(e, GT_Utility.getIntegratedCircuit(circuitMode), true))) { + List modInputs = Arrays.stream(tInputs).filter(Objects::nonNull).filter(e -> !e.getItem().equals(GT_Utility.getIntegratedCircuit(circuitMode).getItem())).collect(Collectors.toList()); + modInputs.add(GT_Utility.getIntegratedCircuit(circuitMode)); + tInputs = modInputs.toArray(new ItemStack[0]); + } + tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); + if (tRecipe == null) { + if (circuitMode == 0) + return false; + tInputs = this.getStoredInputs().toArray(new ItemStack[0]); + tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); + if (tRecipe == null) + return false; + } + + ArrayList outputItems = new ArrayList<>(); + ArrayList outputFluids = new ArrayList<>(); + + boolean found_Recipe = false; + int processed = 0; + + int tHeatCapacityDivTiers = (this.mHeatingCapacity - tRecipe.mSpecialValue) / 900; + long precutRecipeVoltage = (long) (tRecipe.mEUt * Math.pow(0.95, tHeatCapacityDivTiers)); + + while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { + if (this.mHeatingCapacity >= tRecipe.mSpecialValue && (precutRecipeVoltage * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { + found_Recipe = true; + for (int i = 0; i < tRecipe.mOutputs.length; i++) { + outputItems.add(tRecipe.getOutput(i)); + } + for (int i = 0; i < tRecipe.mFluidOutputs.length; i++) { + outputFluids.add(tRecipe.getFluidOutput(i)); + } + ++processed; + } else + break; + } + + if (found_Recipe) { + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + long actualEUT = precutRecipeVoltage * processed; + byte overclockCount = this.calculateOverclockednessEBF(actualEUT, tRecipe.mDuration, nominalV); + + //In case recipe is too OP for that machine + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) + return false; + + if (this.lEUt > 0) + this.lEUt = (-this.lEUt); + + if (tHeatCapacityDivTiers > 0) { + this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount); //extra free overclocking if possible + if (this.mMaxProgresstime < 1) + this.mMaxProgresstime = 1; //no eu efficiency correction + } + + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + + this.polPtick = super.getPollutionPerTick(null) * processed; + this.mOutputItems = new ItemStack[outputItems.size()]; + this.mOutputItems = outputItems.toArray(this.mOutputItems); + this.mOutputFluids = new FluidStack[outputFluids.size()]; + this.mOutputFluids = outputFluids.toArray(this.mOutputFluids); + this.updateSlots(); + return true; + } + return false; + } + + @Override + public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + try { + controllerY.set(this, iGregTechTileEntity.getYCoord() - 2); + } catch (IllegalAccessException e) { + MainMod.LOGGER.catching(e); + } + + if (LoaderReference.tectech) { + this.getTecTechEnergyMultis().clear(); + this.getTecTechEnergyTunnels().clear(); + } + + this.mHeatingCapacity = 0; + boolean ret; + ret = BW_Util.check_layer(iGregTechTileEntity, 7, -2, -1, GregTech_API.sBlockCasings1, 11, 7, false, false, true, GregTech_API.sBlockCasings1, 11, true, 11); + ret &= BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11); + ret &= BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11); + + for (int y = -1; y < 17; y++) { + ret &= BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, false, 11); + if (!this.getCoilHeat(iGregTechTileEntity, y)) + return false; + List metasFromLayer = BW_Util.getMetasFromLayer(iGregTechTileEntity, 7, y, y + 1, 7, y == 0, false, false); + for (Byte meta : metasFromLayer) { + byte inttier = BW_Util.getTierFromGlasMeta(meta); + if (this.glasTier > 0 && inttier != this.glasTier) + return false; + else if (this.glasTier == 0) + this.glasTier = inttier; + } + } + + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 7; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 7; + + for (int z = -6; z <= 6; z++) + for (int x = -6; x <= 6; x++) + if (!this.addMufflerToMachineList(iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + x, 17, zDir + z), 11)) + return false; + + if (LoaderReference.tectech && this.glasTier != 8) + if (!areLazorsLowPowa() || !areThingsProperlyTiered(this.getTecTechEnergyTunnels()) || !areThingsProperlyTiered(this.getTecTechEnergyMultis())) + return false; + + if (this.glasTier != 8 && !this.mEnergyHatches.isEmpty()) + for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) + if (this.glasTier < hatchEnergy.mTier) + return false; + + return ret && !this.mMaintenanceHatches.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mInputBusses.isEmpty(); + } + + @SuppressWarnings("rawtypes") + @Optional.Method(modid = "tectech") + private boolean areThingsProperlyTiered(Collection collection) { + if (!collection.isEmpty()) + for (Object tecTechEnergyMulti : collection) + if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) + return false; + return true; + } + + @SuppressWarnings("rawtypes") + @Optional.Method(modid = "tectech") + private boolean areLazorsLowPowa() { + Collection collection = this.getTecTechEnergyTunnels(); + if (!collection.isEmpty()) + for (Object tecTechEnergyMulti : collection) + if (!(tecTechEnergyMulti instanceof LowPowerLaser)) + return false; + return true; + } + + @Override + @Optional.Method(modid = "tectech") + public List getVanillaEnergyHatches() { + return this.mEnergyHatches; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + @Optional.Method(modid = "tectech") + public List getTecTechEnergyTunnels() { + return TTTunnels; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + @Optional.Method(modid = "tectech") + public List getTecTechEnergyMultis() { + return TTMultiAmp; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 4e81813ca1..33434bb9d6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.MathUtils; +import com.github.bartimaeusnek.bartworks.util.MegaUtils; import com.google.common.collect.ArrayListMultimap; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -142,7 +143,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati if (super.addOutputToMachineList(aTileEntity, aBaseCasingIndex)) { if (aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output) { int layer = aTileEntity.getYCoord() - controllerY; - layer = (int) MathUtils.ceil(((double)layer) /5D)-1; + layer = MathUtils.ceilInt(((double)layer) /5D)-1; LAYERMAP.put(layer,(GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity()); } return true; @@ -236,9 +237,9 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati if (stacks > 0) { for (int i = 0; i < stacks; i++) if (i != stacks - 1) - outputs[i] = tRecipe.getOutput(0).splitStack(64); + outputs[i] = BW_Util.setStackSize(tRecipe.getOutput(0),64); else - outputs[i] = tRecipe.getOutput(0).splitStack(processed - (64 * i)); + outputs[i] = BW_Util.setStackSize(tRecipe.getOutput(0),processed - (64 * i)); this.mOutputItems = outputs; } else this.mOutputItems = null; @@ -250,4 +251,9 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati } return false; } + + @Override + public boolean drainEnergyInput(long aEU) { + return MegaUtils.drainEnergyMegaVanilla(this, aEU); + } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 1a3e1ca7bb..2d553a506e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,14 +22,18 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.MegaUtils; +import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; +import com.github.bartimaeusnek.crossmod.tectech.TecTechUtils; +import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_VacuumFreezer; @@ -38,11 +42,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import java.util.ArrayList; -import java.util.HashSet; +import java.util.List; import static gregtech.api.enums.GT_Values.V; -public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFreezer { +@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) +public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFreezer implements TecTechEnabledMulti { public GT_TileEntity_MegaVacuumFreezer(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -67,26 +72,30 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre return new GT_TileEntity_MegaVacuumFreezer(this.mName); } + @SuppressWarnings("rawtypes") + public ArrayList TTTunnels = new ArrayList<>(); + @SuppressWarnings("rawtypes") + public ArrayList TTMultiAmp = new ArrayList<>(); + + @Override + public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (LoaderReference.tectech) + return TecTechUtils.addEnergyInputToMachineList(this, aTileEntity, aBaseCasingIndex); + return super.addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); + } + + @Override public boolean drainEnergyInput(long aEU) { - if (aEU <= 0) - return true; - long allTheEu = 0; - int hatches = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - allTheEu += tHatch.getEUVar(); - hatches++; - } - if (allTheEu < aEU) - return false; - long euperhatch = aEU / hatches; - HashSet returnset = new HashSet<>(); - for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) - if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false)) - returnset.add(true); - else - returnset.add(false); - return returnset.size() > 0 && !returnset.contains(false); + if (LoaderReference.tectech) + return TecTechUtils.drainEnergyMEBFTecTech(this, aEU); + return MegaUtils.drainEnergyMegaVanilla(this, aEU); + } + + @Override + public long getMaxInputVoltage() { + if (LoaderReference.tectech) + return TecTechUtils.getMaxInputVoltage(this); + return super.getMaxInputVoltage(); } @Override @@ -94,13 +103,14 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); ArrayList outputItems = new ArrayList<>(); - long tVoltage = this.getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + + byte tTier = (byte) Math.max(1, GT_Utility.getTier(nominalV)); GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], null, tInputs); boolean found_Recipe = false; int processed = 0; - long nominalV = BW_Util.getnominalVoltage(this); + while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { if (tRecipe != null && (tRecipe.mEUt * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, null, tInputs)) { found_Recipe = true; @@ -140,15 +150,51 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre return false; } + // -------------- TEC TECH COMPAT ---------------- + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + if (LoaderReference.tectech) { + this.getTecTechEnergyMultis().clear(); + this.getTecTechEnergyTunnels().clear(); + } return ( - BW_Util.check_layer(aBaseMetaTileEntity, 7, -7, -6, GregTech_API.sBlockCasings2, 1, 7, false,false,true, GregTech_API.sBlockCasings2,1,true, 17) - && BW_Util.check_layer(aBaseMetaTileEntity, 7, -6, 0, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) - && BW_Util.check_layer(aBaseMetaTileEntity, 7, 0, 1, GregTech_API.sBlockCasings2, 1, 7, true, false, true, Blocks.air, -1, true, 17) - && BW_Util.check_layer(aBaseMetaTileEntity, 7, 1, 7, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) - && BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false,false,true, GregTech_API.sBlockCasings2,1,true, 17) - ) && !this.mInputBusses.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mEnergyHatches.isEmpty() && !this.mMaintenanceHatches.isEmpty(); + BW_Util.check_layer(aBaseMetaTileEntity, 7, -7, -6, GregTech_API.sBlockCasings2, 1, 7, false, false, true, GregTech_API.sBlockCasings2, 1, true, 17) + && BW_Util.check_layer(aBaseMetaTileEntity, 7, -6, 0, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) + && BW_Util.check_layer(aBaseMetaTileEntity, 7, 0, 1, GregTech_API.sBlockCasings2, 1, 7, true, false, true, Blocks.air, -1, true, 17) + && BW_Util.check_layer(aBaseMetaTileEntity, 7, 1, 7, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) + && BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false, false, true, GregTech_API.sBlockCasings2, 1, true, 17) + ) && + !this.mInputBusses.isEmpty() && + !this.mOutputBusses.isEmpty() && + !this.mMaintenanceHatches.isEmpty() && + LoaderReference.tectech ? + (!this.getTecTechEnergyMultis().isEmpty() || !this.getTecTechEnergyTunnels().isEmpty() || !this.mEnergyHatches.isEmpty()) : + !this.mEnergyHatches.isEmpty(); + } + + @Override + public String[] getInfoData() { + return LoaderReference.tectech ? this.getInfoDataArray(this) : super.getInfoData(); + } + + @Override + @Optional.Method(modid = "tectech") + public List getVanillaEnergyHatches() { + return this.mEnergyHatches; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + @Optional.Method(modid = "tectech") + public List getTecTechEnergyTunnels() { + return TTTunnels; } + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + @Optional.Method(modid = "tectech") + public List getTecTechEnergyMultis() { + return TTMultiAmp; + } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index e7ded86c91..fccba2ae65 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,13 +22,13 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.items.LabModule; import com.github.bartimaeusnek.bartworks.common.items.LabParts; import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.util.*; -import cpw.mods.fml.common.Loader; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -87,7 +87,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { public int checkRecipe(boolean skipOC) { int rTier = 3; - FluidStack dnaFluid = Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); + FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); if (this.getSpecialSlot() != null && this.getSpecialSlot().getItem() instanceof LabModule) { int damage = this.getSpecialSlot().getItemDamage(); @@ -260,7 +260,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { break; case INCUBATION_MODULE: default: - return super.checkRecipe(skipOC); + break; } } return super.checkRecipe(skipOC); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 205dab5a9a..9b6154b4aa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.API.IRadMaterial; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; @@ -31,7 +32,6 @@ import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.MathUtils; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; -import cpw.mods.fml.common.Loader; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -83,14 +83,14 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { else if (x == 61) ret = 4500; else if (x <= 100) - ret = (long) MathUtils.ceil((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); + ret = MathUtils.ceilLong((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); else - ret = (long) MathUtils.ceil(((8000D * Math.tanh(-x / 65D) + 8000D))); + ret = MathUtils.ceilLong(((8000D * Math.tanh(-x / 65D) + 8000D))); return ret;//*20; } public int getSievert() { - return this.sievert - (int) MathUtils.ceil((float) this.sievert / 100f * (float) this.coverage); + return this.sievert - MathUtils.ceilInt((float) this.sievert / 100f * (float) this.coverage); } public short[] getColorForGUI() { @@ -173,10 +173,9 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { if (lStack == null) return; - IRadMaterial radmat = null; //gt++ compat - if (Loader.isModLoaded("miscutils")) + if (LoaderReference.miscutils) radmat = RadioHatchCompat.GTppRadChecker(lStack); if (lStack.getItem() instanceof IRadMaterial || radmat != null) { @@ -198,46 +197,16 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } } - if (GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_4.get(1))) { - Materials materials = Materials.Uranium; - byte kg = 3; - - if (GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_4.get(1))) - materials = Materials.Plutonium; - else if (GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_4.get(1))) - materials = Materials.Thorium; - else if (GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_1.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_4.get(1))) - materials = Materials.Naquadah; - else - kg = 6; - - if (GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_2.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_2.get(1))) - kg = (byte) (2 * kg); - else if (GT_Utility.areStacksEqual(lStack, ItemList.Moxcell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.Uraniumcell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.ThoriumCell_4.get(1)) || GT_Utility.areStacksEqual(lStack, ItemList.NaquadahCell_4.get(1))) - kg = (byte) (4 * kg); - - - if (this.mass == 0 || this.sievert == calculateSv(materials)) { - if (this.mass + kg <= this.cap) { - this.sievert = calculateSv(materials); - this.mass += kg; - this.mInventory[0].stackSize--; - this.updateSlots(); - this.colorForGUI = materials.mColor.mRGBa; - this.material = materials.mName; - } - } - } - for (ItemStack varStack : BioVatLogicAdder.RadioHatch.getIsSv().keySet()) { - if (GT_Utility.areStacksEqual(varStack, lStack)) { + if (GT_Utility.areStacksEqual(varStack, lStack, true)) { if (this.mass == 0 || this.sievert == BioVatLogicAdder.RadioHatch.getIsSv().get(varStack)) { - if (this.mass < this.cap) { - this.mass++; + int massToAdd = BioVatLogicAdder.RadioHatch.getIsKg().getOrDefault(varStack,1); + if (this.mass + massToAdd <= this.cap) { + this.mass += massToAdd; this.sievert = BioVatLogicAdder.RadioHatch.getIsSv().get(varStack); this.mInventory[0].stackSize--; this.updateSlots(); - this.colorForGUI = null; + this.colorForGUI = BioVatLogicAdder.RadioHatch.getIsColor().get(varStack); this.material = StatCollector.translateToLocal(varStack.getUnlocalizedName()); return; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEIbartworksConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEIbartworksConfig.java new file mode 100644 index 0000000000..f05a35cdb9 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEIbartworksConfig.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.neiHandler; + +import codechicken.nei.api.API; +import codechicken.nei.api.IConfigureNEI; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import cpw.mods.fml.common.Optional; +import gregtech.api.enums.OrePrefixes; +import net.minecraft.item.ItemStack; + + +@Optional.Interface(iface = "codechicken.nei.api.API", modid = "NotEnoughItems") +public class NEIbartworksConfig implements IConfigureNEI { + + @Optional.Method(modid = "NotEnoughItems") + @Override + public String getName() { + return MainMod.NAME; + } + + @Optional.Method(modid = "NotEnoughItems") + @Override + public String getVersion() { + return MainMod.VERSION; + } + + @Optional.Method(modid = "NotEnoughItems") + @Override + public void loadConfig() { + API.hideItem(new ItemStack(ItemRegistry.TAB)); + API.hideItem(new ItemStack(FluidLoader.bioFluidBlock)); + API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses)); + ItemStack[] prefixesToHide = { + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustTiny, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustSmall, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushed, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedCentrifuged, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.nugget, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemChipped, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawed, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawless, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemExquisite, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustImpure, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustPure, WerkstoffLoader.Bismutite).copy(), + }; + for (ItemStack stack : prefixesToHide) { + stack.setItemDamage(Short.MAX_VALUE); + API.hideItem(stack); + } +// for (int i = 0; i < Short.MAX_VALUE; i++) { +// API.addItemListEntry(new ItemStack(WerkstoffLoader.BWOres,1,i)); +// } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java index 59b8b947b7..a2943e67e1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,12 +22,12 @@ package com.github.bartimaeusnek.bartworks.server.EventHandler; +import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.net.OreDictCachePacket; import com.github.bartimaeusnek.bartworks.common.net.ServerJoinedPackage; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; @@ -43,7 +43,7 @@ public class ServerEventHandler { //MinecraftForge.EVENT_BUS @SubscribeEvent(priority = EventPriority.LOWEST) public void EntityJoinWorldEvent(EntityJoinWorldEvent event) { - if (event == null || !(event.entity instanceof EntityPlayerMP) || !FMLCommonHandler.instance().getSide().isServer()) + if (event == null || !(event.entity instanceof EntityPlayerMP) || !SideReference.Side.Server) return; MainMod.BW_Network_instance.sendToPlayer(new OreDictCachePacket(OreDictHandler.getNonBWCache()), (EntityPlayerMP) event.entity); MainMod.BW_Network_instance.sendToPlayer(new ServerJoinedPackage(null),(EntityPlayerMP) event.entity); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java new file mode 100644 index 0000000000..fc11974864 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.server.container; + +import gregtech.api.gui.GT_Container_MultiMachine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; + +public class BW_Container_Windmill extends GT_Container_MultiMachine { + + public BW_Container_Windmill(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + + public void addSlots(InventoryPlayer aInventoryPlayer) { + this.addSlotToContainer(new Slot(this.mTileEntity, 1, 60, 36)); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java index f370d07043..385897db6a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -163,7 +163,7 @@ public class GT_Container_CircuitProgrammer extends Container { @Override public void setInventorySlotContents(int slotNR, ItemStack itemStack) { if (itemStack != null && itemStack.getItem() != null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) { - this.Slot = itemStack.copy().splitStack(1); + this.Slot = BW_Util.setStackSize(itemStack.copy(),1); itemStack.stackSize--; this.tag = this.toBind.getTagCompound(); this.tag.setBoolean("HasChip", true); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java index 1b1b4b240f..512325688c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java @@ -22,17 +22,28 @@ package com.github.bartimaeusnek.bartworks.server.container; +import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.API.IRadMaterial; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.OrePrefixes; import gregtech.api.gui.GT_Container_1by1; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.ItemData; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; import java.nio.ByteBuffer; import java.util.Iterator; +import java.util.Optional; public class GT_Container_RadioHatch extends GT_Container_1by1 { @@ -46,6 +57,10 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { super(aInventoryPlayer, aTileEntity); } + public void addSlots(InventoryPlayer aInventoryPlayer) { + this.addSlotToContainer(new RadioSlot(this.mTileEntity, 0, 80, 35)); + } + @SuppressWarnings("rawtypes") public void detectAndSendChanges() { super.detectAndSendChanges(); @@ -153,4 +168,30 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { return true; } + private static class RadioSlot extends Slot{ + public RadioSlot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) { + super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_); + } + + @Override + public boolean isItemValid(ItemStack p_75214_1_) { + if (BioVatLogicAdder.RadioHatch.getIsSv() + .keySet() + .stream() + .anyMatch( + stack -> GT_Utility.areStacksEqual(stack, p_75214_1_,true) + )) + return true; + + if (!BW_Util.checkStackAndPrefix(p_75214_1_)) + return false; + + ItemData ass = GT_OreDictUnificator.getAssociation(p_75214_1_); + return IRadMaterial.class.isAssignableFrom(p_75214_1_.getItem().getClass()) || + ass.mPrefix == OrePrefixes.rod || + ass.mPrefix == OrePrefixes.stick || + ass.mPrefix == OrePrefixes.stickLong; + } + } + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java deleted file mode 100644 index 286d3faa84..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.system.log; - -import cpw.mods.fml.common.event.FMLPreInitializationEvent; - -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.GregorianCalendar; -import java.util.logging.FileHandler; -import java.util.logging.Formatter; -import java.util.logging.LogRecord; -import java.util.logging.Logger; - -public class DebugLog { - private static boolean init; - static FileHandler fh; - private static Logger utilLog; - public DebugLog(FMLPreInitializationEvent event) throws IOException { - if (DebugLog.init) - return; - DebugLog.fh = new FileHandler(new File(new File(event.getModConfigurationDirectory().getParentFile(),"logs"),"BWLog.log").toString()); - DebugLog.utilLog = Logger.getLogger("DebugLog"); - DebugLog.utilLog.setUseParentHandlers(false); - DebugLog.utilLog.addHandler(DebugLog.fh); - Formatter formatter = new Formatter() { - @Override - public String format(LogRecord record) { - SimpleDateFormat logTime = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); - Calendar cal = new GregorianCalendar(); - cal.setTimeInMillis(record.getMillis()); - return "Level: " + record.getLevel() - +" at " + logTime.format(cal.getTime()) - + " " + record.getMessage() + "\n"; - } - }; - DebugLog.fh.setFormatter(formatter); - DebugLog.init = true; - } - - public static void log(String record){ - if (!DebugLog.init) - return; - DebugLog.utilLog.info(record); - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java deleted file mode 100644 index 63f27d299f..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java +++ /dev/null @@ -1,653 +0,0 @@ -/* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.system.log; - - -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.Marker; -import org.apache.logging.log4j.message.Message; -import org.apache.logging.log4j.message.MessageFactory; - -public class STFUGTPPLOG implements Logger { - - @Override - public void catching(Level level, Throwable t) { - - } - - @Override - public void catching(Throwable t) { - - } - - @Override - public void debug(Marker marker, Message msg) { - - } - - @Override - public void debug(Marker marker, Message msg, Throwable t) { - - } - - @Override - public void debug(Marker marker, Object message) { - - } - - @Override - public void debug(Marker marker, Object message, Throwable t) { - - } - - @Override - public void debug(Marker marker, String message) { - - } - - @Override - public void debug(Marker marker, String message, Object... params) { - - } - - @Override - public void debug(Marker marker, String message, Throwable t) { - - } - - @Override - public void debug(Message msg) { - - } - - @Override - public void debug(Message msg, Throwable t) { - - } - - @Override - public void debug(Object message) { - - } - - @Override - public void debug(Object message, Throwable t) { - - } - - @Override - public void debug(String message) { - - } - - @Override - public void debug(String message, Object... params) { - - } - - @Override - public void debug(String message, Throwable t) { - - } - - @Override - public void entry() { - - } - - @Override - public void entry(Object... params) { - - } - - @Override - public void error(Marker marker, Message msg) { - - } - - @Override - public void error(Marker marker, Message msg, Throwable t) { - - } - - @Override - public void error(Marker marker, Object message) { - - } - - @Override - public void error(Marker marker, Object message, Throwable t) { - - } - - @Override - public void error(Marker marker, String message) { - - } - - @Override - public void error(Marker marker, String message, Object... params) { - - } - - @Override - public void error(Marker marker, String message, Throwable t) { - - } - - @Override - public void error(Message msg) { - - } - - @Override - public void error(Message msg, Throwable t) { - - } - - @Override - public void error(Object message) { - - } - - @Override - public void error(Object message, Throwable t) { - - } - - @Override - public void error(String message) { - - } - - @Override - public void error(String message, Object... params) { - - } - - @Override - public void error(String message, Throwable t) { - - } - - @Override - public void exit() { - - } - - @Override - public R exit(R result) { - return null; - } - - @Override - public void fatal(Marker marker, Message msg) { - - } - - @Override - public void fatal(Marker marker, Message msg, Throwable t) { - - } - - @Override - public void fatal(Marker marker, Object message) { - - } - - @Override - public void fatal(Marker marker, Object message, Throwable t) { - - } - - @Override - public void fatal(Marker marker, String message) { - - } - - @Override - public void fatal(Marker marker, String message, Object... params) { - - } - - @Override - public void fatal(Marker marker, String message, Throwable t) { - - } - - @Override - public void fatal(Message msg) { - - } - - @Override - public void fatal(Message msg, Throwable t) { - - } - - @Override - public void fatal(Object message) { - - } - - @Override - public void fatal(Object message, Throwable t) { - - } - - @Override - public void fatal(String message) { - - } - - @Override - public void fatal(String message, Object... params) { - - } - - @Override - public void fatal(String message, Throwable t) { - - } - - @Override - public MessageFactory getMessageFactory() { - return null; - } - - @Override - public String getName() { - return null; - } - - @Override - public void info(Marker marker, Message msg) { - - } - - @Override - public void info(Marker marker, Message msg, Throwable t) { - - } - - @Override - public void info(Marker marker, Object message) { - - } - - @Override - public void info(Marker marker, Object message, Throwable t) { - - } - - @Override - public void info(Marker marker, String message) { - - } - - @Override - public void info(Marker marker, String message, Object... params) { - - } - - @Override - public void info(Marker marker, String message, Throwable t) { - - } - - @Override - public void info(Message msg) { - - } - - @Override - public void info(Message msg, Throwable t) { - - } - - @Override - public void info(Object message) { - - } - - @Override - public void info(Object message, Throwable t) { - - } - - @Override - public void info(String message) { - - } - - @Override - public void info(String message, Object... params) { - - } - - @Override - public void info(String message, Throwable t) { - - } - - @Override - public boolean isDebugEnabled() { - return false; - } - - @Override - public boolean isDebugEnabled(Marker marker) { - return false; - } - - @Override - public boolean isEnabled(Level level) { - return false; - } - - @Override - public boolean isEnabled(Level level, Marker marker) { - return false; - } - - @Override - public boolean isErrorEnabled() { - return false; - } - - @Override - public boolean isErrorEnabled(Marker marker) { - return false; - } - - @Override - public boolean isFatalEnabled() { - return false; - } - - @Override - public boolean isFatalEnabled(Marker marker) { - return false; - } - - @Override - public boolean isInfoEnabled() { - return false; - } - - @Override - public boolean isInfoEnabled(Marker marker) { - return false; - } - - @Override - public boolean isTraceEnabled() { - return false; - } - - @Override - public boolean isTraceEnabled(Marker marker) { - return false; - } - - @Override - public boolean isWarnEnabled() { - return false; - } - - @Override - public boolean isWarnEnabled(Marker marker) { - return false; - } - - @Override - public void log(Level level, Marker marker, Message msg) { - - } - - @Override - public void log(Level level, Marker marker, Message msg, Throwable t) { - - } - - @Override - public void log(Level level, Marker marker, Object message) { - - } - - @Override - public void log(Level level, Marker marker, Object message, Throwable t) { - - } - - @Override - public void log(Level level, Marker marker, String message) { - - } - - @Override - public void log(Level level, Marker marker, String message, Object... params) { - - } - - @Override - public void log(Level level, Marker marker, String message, Throwable t) { - - } - - @Override - public void log(Level level, Message msg) { - - } - - @Override - public void log(Level level, Message msg, Throwable t) { - - } - - @Override - public void log(Level level, Object message) { - - } - - @Override - public void log(Level level, Object message, Throwable t) { - - } - - @Override - public void log(Level level, String message) { - - } - - @Override - public void log(Level level, String message, Object... params) { - - } - - @Override - public void log(Level level, String message, Throwable t) { - - } - - @Override - public void printf(Level level, Marker marker, String format, Object... params) { - - } - - @Override - public void printf(Level level, String format, Object... params) { - - } - - @Override - public T throwing(Level level, T t) { - return null; - } - - @Override - public T throwing(T t) { - return null; - } - - @Override - public void trace(Marker marker, Message msg) { - - } - - @Override - public void trace(Marker marker, Message msg, Throwable t) { - - } - - @Override - public void trace(Marker marker, Object message) { - - } - - @Override - public void trace(Marker marker, Object message, Throwable t) { - - } - - @Override - public void trace(Marker marker, String message) { - - } - - @Override - public void trace(Marker marker, String message, Object... params) { - - } - - @Override - public void trace(Marker marker, String message, Throwable t) { - - } - - @Override - public void trace(Message msg) { - - } - - @Override - public void trace(Message msg, Throwable t) { - - } - - @Override - public void trace(Object message) { - - } - - @Override - public void trace(Object message, Throwable t) { - - } - - @Override - public void trace(String message) { - - } - - @Override - public void trace(String message, Object... params) { - - } - - @Override - public void trace(String message, Throwable t) { - - } - - @Override - public void warn(Marker marker, Message msg) { - - } - - @Override - public void warn(Marker marker, Message msg, Throwable t) { - - } - - @Override - public void warn(Marker marker, Object message) { - - } - - @Override - public void warn(Marker marker, Object message, Throwable t) { - - } - - @Override - public void warn(Marker marker, String message) { - - } - - @Override - public void warn(Marker marker, String message, Object... params) { - - } - - @Override - public void warn(Marker marker, String message, Throwable t) { - - } - - @Override - public void warn(Message msg) { - - } - - @Override - public void warn(Message msg, Throwable t) { - - } - - @Override - public void warn(Object message) { - - } - - @Override - public void warn(Object message, Throwable t) { - - } - - @Override - public void warn(String message) { - - } - - @Override - public void warn(String message, Object... params) { - - } - - @Override - public void warn(String message, Throwable t) { - - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 268be7eddf..10e33f28cc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,12 +23,9 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.API.IRadMaterial; +import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import com.github.bartimaeusnek.bartworks.util.Pair; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Materials; @@ -84,16 +81,11 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa this.setCreativeTab(BW_MetaGenerated_Items.metaTab); for (Werkstoff w : werkstoffHashSet) { ItemStack tStack = new ItemStack(this, 1, w.getmID()); - if (((w.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) != 0) ) - continue; - if ((w.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes) != 0) + if (!w.hasItemType(this.orePrefixes)) continue; GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", this.getDefaultLocalization(w)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); - if (ConfigHandler.experimentalThreadedLoader) - OreDictAdder.addToMap(new Pair<>(this.orePrefixes.name() + w.getVarName(), tStack)); - else - GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.getVarName(), tStack); + GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.getVarName(), tStack); } } @@ -165,7 +157,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } protected IIconContainer getIconContainerBartWorks(int aMetaData) { - if (FMLCommonHandler.instance().getSide().isClient()) + if (SideReference.Side.Client) return PrefixTextureLinker.texMap.get(this.orePrefixes).get(werkstoffHashMap.get((short) aMetaData).getTexSet()); return null; } @@ -175,7 +167,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @SuppressWarnings("unchecked") public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { for (Werkstoff werkstoff : werkstoffHashSet) { - if (werkstoff != null && ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) != 0) && ((werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0)) { + if (werkstoff != null && werkstoff.hasItemType(this.orePrefixes)) { ItemStack tStack = new ItemStack(this, 1, werkstoff.getmID()); aList.add(tStack); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 7cea9d0588..37c1da6c8d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -47,11 +47,10 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { protected void doRegistrationStuff(Werkstoff w) { if (w != null) { - if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0 || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) + if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) return; GT_ModHandler.addValuableOre(this, w.getmID(), 1); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", w.getDefaultName() + OrePrefixes.ore.mLocalizedMaterialPost); - } } @@ -107,7 +106,7 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { @SuppressWarnings("unchecked") public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { for (Werkstoff tMaterial : Werkstoff.werkstoffHashSet) { - if ((tMaterial != null) && ((tMaterial.getGenerationFeatures().toGenerate & 0x8) != 0) && ((tMaterial.getGenerationFeatures().blacklist & 0x8) == 0)) { + if ((tMaterial != null) && tMaterial.hasItemType(OrePrefixes.ore) && ((tMaterial.getGenerationFeatures().blacklist & 0x8) == 0)) { aList.add(new ItemStack(aItem, 1, tMaterial.getmID())); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java index 24f447c3d8..dc1db4303a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -41,7 +41,7 @@ public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { @Override protected void doRegistrationStuff(Werkstoff w) { if (w != null) { - if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0 || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) + if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) return; GT_ModHandler.addValuableOre(this, w.getmID(), 1); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", "Small " + w.getDefaultName() + OrePrefixes.oreSmall.mLocalizedMaterialPost); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java index 632c3e034f..75c774240b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,7 +22,10 @@ package com.github.bartimaeusnek.bartworks.system.material; +import com.github.bartimaeusnek.bartworks.API.SideReference; +import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TextureSet; import gregtech.api.interfaces.ITexture; import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.objects.GT_RenderedTexture; @@ -33,10 +36,15 @@ public class BW_MetaGenerated_WerkstoffBlock_TE extends BW_MetaGenerated_Block_T @Override public ITexture[] getTexture(Block aBlock, byte aSide) { - Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); - if ((aMaterial != null)) { - GT_RenderedTexture aIconSet = new GT_RenderedTexture(aMaterial.getTexSet().mTextures[OrePrefixes.block.mTextureIndex], aMaterial.getRGBA()); - return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), aIconSet}; + if (SideReference.Side.Client) { + Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); + if ((aMaterial != null)) { + TextureSet set = aMaterial.getTexSet(); + GT_RenderedTexture aIconSet = new GT_RenderedTexture( + set.mTextures[PrefixTextureLinker.blockTexMap.getOrDefault(set, OrePrefixes.block.mTextureIndex)], aMaterial.getRGBA() + ); + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), aIconSet}; + } } return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java index 382163ae8b..166f9aef8d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34,6 +34,7 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import java.util.List; +import java.util.Optional; public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks { @@ -43,10 +44,14 @@ public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks { @Override protected void doRegistrationStuff(Werkstoff tMaterial) { - if (tMaterial != null) { - if (tMaterial.getGenerationFeatures().hasGems() || (tMaterial.getGenerationFeatures().toGenerate & 0b10) != 0) - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + tMaterial.getmID() + ".name", OrePrefixes.block.mLocalizedMaterialPre + tMaterial.getDefaultName() + OrePrefixes.block.mLocalizedMaterialPost); - } + Optional.ofNullable(tMaterial) + .filter(pMaterial -> pMaterial.hasItemType(OrePrefixes.gem) || pMaterial.hasItemType(OrePrefixes.ingot)) + .ifPresent(pMaterial -> + GT_LanguageManager.addStringLocalization( + this.getUnlocalizedName() + "." + pMaterial.getmID() + ".name", + OrePrefixes.block.mLocalizedMaterialPre + pMaterial.getDefaultName() + OrePrefixes.block.mLocalizedMaterialPost + ) + ); } @Override @@ -67,9 +72,9 @@ public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks { @Override @SuppressWarnings("unchecked") public void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) { - for (Werkstoff tMaterial : Werkstoff.werkstoffHashSet) { - if (tMaterial.getGenerationFeatures().hasGems() || (tMaterial.getGenerationFeatures().toGenerate & 0b10) != 0) - aList.add(new ItemStack(aItem, 1, tMaterial.getmID())); - } + Werkstoff.werkstoffHashSet.stream() + .filter(tMaterial -> tMaterial.hasItemType(OrePrefixes.gem) || tMaterial.hasItemType(OrePrefixes.ingot)) + .map(tMaterial -> new ItemStack(aItem, 1, tMaterial.getmID())) + .forEach(aList::add); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java index 1d1cc94863..98fcfb7878 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,24 +23,27 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; public class BW_CircuitsLoader { - private static final BW_Meta_Items NEW_CIRCUITS; + + private static final BW_Meta_Items NEW_CIRCUITS = new BW_Meta_Items(); + + private BW_CircuitsLoader() { + } public static BW_Meta_Items getNewCircuits() { return BW_CircuitsLoader.NEW_CIRCUITS; } - static { - NEW_CIRCUITS = new BW_Meta_Items(); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(0,4, "Primitive Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(1,5, "Basic Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(2,6, "Good Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(3,7, "Advanced Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(4,8, "Data Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(5,9, "Elite Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(6,10, "Master Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(7,11, "Ultimate Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(8,12, "Superconductor Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(9,13, "Infinite Magneto Resonatic Circuit"); + public static void initNewCircuits() { + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(0, 4, "Primitive Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(1, 5, "Basic Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(2, 6, "Good Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(3, 7, "Advanced Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(4, 8, "Data Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(5, 9, "Elite Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(6, 10, "Master Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(7, 11, "Ultimate Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(8, 12, "Superconductor Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(9, 13, "Infinite Magneto Resonatic Circuit"); BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(10,14, "Bio Magneto Resonatic Circuit"); } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index 66038d5d85..7870b820e8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,14 +23,11 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import com.github.bartimaeusnek.bartworks.util.Pair; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -92,9 +89,6 @@ public class BW_Meta_Items { ItemStack tStack = BW_Meta_Items.NEWCIRCUITS.addCircuit(aID,aName,tooltip,aTier); - if (ConfigHandler.experimentalThreadedLoader) - OreDictAdder.addToMap(new Pair<>((aOreDictPrefix + additionalOreDictData).replaceAll(" ",""), tStack)); - else GT_OreDictUnificator.registerOre((aOreDictPrefix + additionalOreDictData).replaceAll(" ",""), tStack); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 81fa72717f..56e3ad035c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -272,7 +272,7 @@ public class CircuitImprintLoader { public static NBTTagCompound getTagFromStack(ItemStack stack) { if (GT_Utility.isStackValid(stack)) - return stack.copy().splitStack(1).writeToNBT(new NBTTagCompound()); + return BW_Util.setStackSize(stack.copy(),1).writeToNBT(new NBTTagCompound()); return new NBTTagCompound(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java index 1d1b1a0f35..d9d4ac7dbe 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,14 +22,11 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; +import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; -import com.github.bartimaeusnek.bartworks.util.Pair; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Materials; @@ -65,9 +62,6 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { continue materialloop; GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", getDefaultLocalization(w)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); - if (ConfigHandler.experimentalThreadedLoader) - OreDictAdder.addToMap(new Pair<>(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack)); - else GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); } if (noSubIDMaterials != null){ @@ -83,9 +77,6 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { continue materialloop; GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", getDefaultLocalization(w)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); - if (ConfigHandler.experimentalThreadedLoader) - OreDictAdder.addToMap(new Pair<>(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack)); - else GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); } } @@ -107,7 +98,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { } protected IIconContainer getIconContainerBartWorks(int aMetaData) { - if (FMLCommonHandler.instance().getSide().isClient()) { + if (SideReference.Side.Client) { if (aMetaData > 1000 && hasList) return PrefixTextureLinker.texMap.get(this.orePrefixes).get(NoMetaValue.get(aMetaData-1001).mIconSet); return PrefixTextureLinker.texMap.get(this.orePrefixes).get(Materials.values()[(short) aMetaData].mIconSet); @@ -121,7 +112,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { for (int i = 0; i < Materials.values().length; i++) { Materials w = Materials.values()[i]; - if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes) != 0) + if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) continue; else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; @@ -130,7 +121,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { if (hasList) for (int i = 0; i < NoMetaValue.size(); i++) { Materials w = NoMetaValue.get(i); - if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes) != 0) + if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) continue; else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java index 4beeab09b2..96e222ee11 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,8 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import cpw.mods.fml.common.Loader; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -42,8 +42,11 @@ import java.util.stream.Collectors; public class GTMetaItemEnhancer { static List NoMetaValue; - static{ - if (Loader.isModLoaded("Forestry")) { + private GTMetaItemEnhancer() { + } + + public static void init(){ + if (LoaderReference.Forestry) { NoMetaValue = Materials.getMaterialsMap().values().stream().filter(m -> m.mMetaItemSubID == -1).collect(Collectors.toList()); Item moltenCapsuls = new BWGTMetaItems(WerkstoffLoader.capsuleMolten, null); Item capsuls = new BWGTMetaItems(OrePrefixes.capsule, NoMetaValue); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java index b63d7377b8..dc1d1f7ade 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,11 +22,12 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AfterLuVTierEnhacement; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import cpw.mods.fml.common.Loader; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -69,7 +70,7 @@ public class LuVTierEnhancer implements Runnable { .filter(item -> item.toString().contains("LuV") && item.hasBeenSet()) .forEach(item -> LuVMachines.add(item.get(1))); - if (Loader.isModLoaded("dreamcraft")) { + if (LoaderReference.dreamcraft) { addDreamcraftItemListItems(LuVMachines); } @@ -173,48 +174,52 @@ public class LuVTierEnhancer implements Runnable { } } - private static void replaceOsmiridiumInLuVRecipes(){ - for (GT_Recipe.GT_Recipe_AssemblyLine recipe_assemblyLine : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){ - if (recipe_assemblyLine.mEUt > 6000) - continue; - for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) { - ItemStack stack = recipe_assemblyLine.mInputs[i]; - if (!BW_Util.checkStackAndPrefix(stack)) - continue; - ItemData ass = GT_OreDictUnificator.getAssociation(stack); - if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) - if (WerkstoffLoader.items.get(ass.mPrefix) != null) - recipe_assemblyLine.mInputs[i] = WerkstoffLoader.Ruridit.get(ass.mPrefix,stack.stackSize); - } - } - for (GT_Recipe recipe_assemblyLine : GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList){ - if (recipe_assemblyLine.mEUt > BW_Util.getTierVoltage(6)) - continue; - if (BW_Util.checkStackAndPrefix(recipe_assemblyLine.mOutputs[0])) - continue; - for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) { - ItemStack stack = recipe_assemblyLine.mInputs[i]; - if (!BW_Util.checkStackAndPrefix(stack)) - continue; - ItemData ass = GT_OreDictUnificator.getAssociation(stack); - if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) - if (WerkstoffLoader.items.get(ass.mPrefix) != null) - recipe_assemblyLine.mInputs[i] = WerkstoffLoader.Ruridit.get(ass.mPrefix, stack.stackSize); - } - } - for (GT_Recipe recipe_assemblyLine : GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList){ - if (recipe_assemblyLine.mEUt > 6000) + private static void replaceOsmiridiumInLuVRecipes() { + Consumer replace = gt_recipe -> + gt_recipe.mInputs = replaceArrayWith( + gt_recipe.mInputs, + Materials.Osmiridium, + WerkstoffLoader.Ruridit + ); + + GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.stream() + .filter(recipe_assemblyLine -> recipe_assemblyLine.mEUt <= 6000) + .forEach(recipe_assemblyLine -> + recipe_assemblyLine.mInputs = replaceArrayWith( + recipe_assemblyLine.mInputs, + Materials.Osmiridium, + WerkstoffLoader.Ruridit + ) + ); + + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList.stream() + .filter(gt_recipe -> + gt_recipe.mEUt < BW_Util.getTierVoltage(6) && + !BW_Util.checkStackAndPrefix(gt_recipe.mOutputs[0]) + ) + .forEach(replace); + + GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.stream() + .filter(gt_recipe -> gt_recipe.mEUt <= 6000) + .forEach(replace); + } + + private static ItemStack[] replaceArrayWith(ItemStack[] stackArray, Materials source, Werkstoff target) { + for (int i = 0; i < stackArray.length; i++) { + ItemStack stack = stackArray[i]; + if (!BW_Util.checkStackAndPrefix(stack)) continue; - for (int i = 0; i < recipe_assemblyLine.mInputs.length; i++) { - ItemStack stack = recipe_assemblyLine.mInputs[i]; - if (!BW_Util.checkStackAndPrefix(stack)) - continue; - ItemData ass = GT_OreDictUnificator.getAssociation(stack); - if (ass.mMaterial.mMaterial.equals(Materials.Osmiridium)) - if (WerkstoffLoader.items.get(ass.mPrefix) != null) - recipe_assemblyLine.mInputs[i] = WerkstoffLoader.Ruridit.get(ass.mPrefix,stack.stackSize); - } + stackArray[i] = replaceStackWith(stack, source, target); } + return stackArray; + } + + private static ItemStack replaceStackWith(ItemStack stack, Materials source, Werkstoff target) { + ItemData ass = GT_OreDictUnificator.getAssociation(stack); + if (ass.mMaterial.mMaterial.equals(source)) + if (target.hasItemType(ass.mPrefix)) + stack = target.get(ass.mPrefix, stack.stackSize); + return stack; } private static boolean doStacksCointainAndReplace(FluidStack[] stacks, FluidStack stack, boolean replace, Fluid... replacement) { @@ -243,7 +248,7 @@ public class LuVTierEnhancer implements Runnable { else { int amount = ((ItemStack) ((ArrayList)stacks[i]).get(0)).stackSize; stacks[i] = new ArrayList<>(); - ((ArrayList)stacks[i]).add(replacement[0].splitStack(amount)); + ((ArrayList)stacks[i]).add(BW_Util.setStackSize(replacement[0], amount)); replaced = true; } @@ -254,7 +259,7 @@ public class LuVTierEnhancer implements Runnable { return true; else { int amount = ((ItemStack) stacks[i]).stackSize; - stacks[i] = replacement[0].splitStack(amount); + stacks[i] = BW_Util.setStackSize(replacement[0], amount); replaced = true; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 74c60fb27e..3a290b7777 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,12 +22,12 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; -import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -300,13 +300,13 @@ public class PlatinumSludgeOverHaul { } if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dust).splitStack(amount * 2); + recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dust), amount * 2); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dustSmall).splitStack(amount * 2); + recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dustSmall), amount * 2); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PTMetallicPowder.get(dustTiny).splitStack(amount * 2); + recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dustTiny), amount * 2); } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Palladium)) { for (int j = 0; j < recipe.mInputs.length; j++) { @@ -315,13 +315,13 @@ public class PlatinumSludgeOverHaul { } if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PDMetallicPowder.get(dust).splitStack(amount * 2); + recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dust), amount * 2); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PDMetallicPowder.get(dustSmall).splitStack(amount * 2); + recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dustSmall), amount * 2); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = PDMetallicPowder.get(dustTiny).splitStack(amount * 2); + recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dustTiny), amount * 2); } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Osmium)) { for (int j = 0; j < recipe.mInputs.length; j++) { @@ -330,13 +330,13 @@ public class PlatinumSludgeOverHaul { } if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrOsLeachResidue.get(dust).splitStack(amount); + recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dust), amount); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrOsLeachResidue.get(dustSmall).splitStack(amount); + recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dustSmall), amount); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrOsLeachResidue.get(dustTiny).splitStack(amount); + recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dustTiny), amount); } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Iridium)) { for (int j = 0; j < recipe.mInputs.length; j++) { @@ -345,13 +345,13 @@ public class PlatinumSludgeOverHaul { } if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrLeachResidue.get(dust).splitStack(amount); + recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dust), amount); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrLeachResidue.get(dustSmall).splitStack(amount); + recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dustSmall), amount); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = IrLeachResidue.get(dustTiny).splitStack(amount); + recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dustTiny), amount); } } } @@ -392,7 +392,7 @@ public class PlatinumSludgeOverHaul { inputName = "recipeOutput"; inputItemName = "recipeItems"; } - else if (Loader.isModLoaded("miscutils")) { + else if (LoaderReference.miscutils) { try { if (Class.forName("gtPlusPlus.api.objects.minecraft.ShapedRecipe").isAssignableFrom(obj.getClass())) obj = FieldUtils.getField(obj.getClass(),"mRecipe",true).get(obj); @@ -560,7 +560,7 @@ public class PlatinumSludgeOverHaul { return (!Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mPrefix)) || Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); } - if (Loader.isModLoaded("miscutils")) { + if (LoaderReference.miscutils) { try { if (Class.forName("gtPlusPlus.core.item.base.BaseItemComponent").isAssignableFrom(stack.getItem().getClass()) && !(stack.getUnlocalizedName().contains("dust") || stack.getUnlocalizedName().contains("Dust"))) return true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java deleted file mode 100644 index 8957f2a986..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.system.material; - -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; -import cpw.mods.fml.common.FMLCommonHandler; - -import java.util.ArrayList; -import java.util.List; - -public class ThreadedLoader implements Runnable { - - private List threads = new ArrayList<>(); - private List threadsInit = new ArrayList<>(); - - @Override - public synchronized void run() { - MainMod.LOGGER.warn("EXPERIMENTAL THREADED-LOADER ENABLED!"); - MainMod.LOGGER.info("Starting to register BartWorks Materials Recipes to Gregtech"); - this.threads.add(new AllRecipes()); - this.threads.forEach(Thread::start); - - } - - public synchronized void runInit() { - MainMod.LOGGER.warn("EXPERIMENTAL THREADED-LOADER ENABLED!"); - MainMod.LOGGER.info("Starting the Material Generation Thread"); - this.threadsInit.add(new MaterialGen()); - this.threadsInit.forEach(Thread::start); - for (Thread thread : this.threadsInit) { - try { - MainMod.LOGGER.info("Trying to join the Material Generation Thread"); - thread.join(); - }catch (InterruptedException e){ - e.printStackTrace(); - FMLCommonHandler.instance().exitJava(500,true); - } - } - MainMod.LOGGER.info("Successfully joined the Material Generation Thread, Registering the Items/Blocks to the GameRegistry"); - if ((WerkstoffLoader.toGenerateGlobal) != 0){ - OreDictAdder.addToOreDict(); - } - if ((WerkstoffLoader.toGenerateGlobal & 0b1000) != 0) - WerkstoffLoader.INSTANCE.gameRegistryHandler(); - } - - static class AllRecipes extends Thread { - - public synchronized void run() { - WerkstoffLoader.INSTANCE.run(); - } - - } - - static class MaterialGen extends Thread { - - public synchronized void run() { - WerkstoffLoader.INSTANCE.runInit(); - } - - } - -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 09810a54cb..c72632bf3e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,10 +22,7 @@ package com.github.bartimaeusnek.bartworks.system.material; -import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.MurmurHash3; -import com.github.bartimaeusnek.bartworks.util.Pair; +import com.github.bartimaeusnek.bartworks.util.*; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import gregtech.api.enums.*; import gregtech.api.interfaces.IColorModulationContainer; @@ -74,22 +71,26 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.bridgeMaterial = bridgeMaterial; } - public static void init(){ + public static void init() { Werkstoff.default_null_Werkstoff = new Werkstoff(new short[3], "_NULL", "Default null Werkstoff", Werkstoff.DEFAULT_NULL_STATS, Werkstoff.Types.UNDEFINED, Werkstoff.DEFAULT_NULL_GENERATION_FEATURES, -1, TextureSet.SET_NONE); } - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type,int meltingpoint, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), type, generationFeatures, mID, texSet, contents); } + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, contents); } + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), type, generationFeatures, mID, texSet, oreByProduct, contents); } + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents); } + public Werkstoff(short[] rgba, String toolTip, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { this(rgba, toolTip, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents); } @@ -184,8 +185,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.texSet = texSet; - switch(this.mOreByProducts.size()) { - case 0 : + switch (this.mOreByProducts.size()) { + case 0: this.mOreByProducts.add(this); this.mOreByProducts.add(this); this.mOreByProducts.add(this); @@ -199,13 +200,20 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { break; } + Optional> firstContent; + if (this.CONTENTS.size() == 1 && (firstContent = this.CONTENTS.stream().findFirst()).isPresent()) { + ISubTagContainer firstContentSubTagContainer = firstContent.get().getKey(); + if (firstContent.get().getValue() == 1 && firstContentSubTagContainer instanceof Materials) + this.getGenerationFeatures().setExtension(); + } + Werkstoff.werkstoffHashSet.add(this); Werkstoff.werkstoffHashMap.put(this.mID, this); - Werkstoff.werkstoffNameHashMap.put(this.defaultName,this); + Werkstoff.werkstoffNameHashMap.put(this.defaultName, this); } - public Werkstoff addAdditionalOreDict(String s){ + public Werkstoff addAdditionalOreDict(String s) { ADDITIONAL_OREDICT.add(s); return this; } @@ -214,11 +222,11 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return ADDITIONAL_OREDICT; } - public void setTCAspects(Pair... pAspectsArr){ - this.stats.mTC_Aspects=pAspectsArr; + public void setTCAspects(Pair... pAspectsArr) { + this.stats.mTC_Aspects = pAspectsArr; } - public Pair[] getTCAspects(int ratio){ + public Pair[] getTCAspects(int ratio) { if (this.stats.mTC_Aspects == null) { HashSet tc_aspectStacks = new HashSet<>(); HashSet> set = new HashSet<>(); @@ -231,24 +239,25 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { tc_aspectStacks.forEach(tc_aspectStack -> set.add(new Pair<>(tc_aspectStack.mAspect.mAspect, (int) tc_aspectStack.mAmount))); this.stats.mTC_Aspects = set.toArray(new Pair[0]); } - Pair[] ret = this.stats.mTC_Aspects.clone(); + Pair[] ret = this.stats.mTC_Aspects.clone(); for (int i = 0; i < ret.length; i++) { - ret[i]=ret[i].copyWithNewValue(ret[i].getValue() * ratio); + ret[i] = ret[i].copyWithNewValue(ret[i].getValue() * ratio); } return ret; } public List getGTWrappedTCAspects() { final List ret = new ArrayList<>(); - Arrays.stream(getTCAspects()).forEach(objectIntegerPair -> { - try { - new TC_Aspects.TC_AspectStack(TC_Aspects.valueOf(((String) ThaumcraftHandler.AspectAdder.getName.invoke(objectIntegerPair.getKey())).toUpperCase(Locale.US)), objectIntegerPair.getValue()).addToAspectList(ret); - } catch (IllegalAccessException | InvocationTargetException ignored) {} - }); + Arrays.stream(getTCAspects()).forEach(objectIntegerPair -> { + try { + new TC_Aspects.TC_AspectStack(TC_Aspects.valueOf(((String) ThaumcraftHandler.AspectAdder.getName.invoke(objectIntegerPair.getKey())).toUpperCase(Locale.US)), objectIntegerPair.getValue()).addToAspectList(ret); + } catch (IllegalAccessException | InvocationTargetException ignored) { + } + }); return ret; } - public Pair[] getTCAspects(){ + public Pair[] getTCAspects() { return this.getTCAspects(1); } @@ -256,8 +265,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.type; } - public boolean containsStuff(ISubTagContainer stuff){ - for (Pair pair : this.CONTENTS){ + public boolean containsStuff(ISubTagContainer stuff) { + for (Pair pair : this.CONTENTS) { if (pair.getKey().equals(stuff)) return true; } @@ -286,7 +295,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.mOreByProducts.size(); } - public ISubTagContainer getOreByProductRaw(int aNumber){ + public ISubTagContainer getOreByProductRaw(int aNumber) { if (this.mOreByProducts.size() == 0) return null; if (aNumber < 0) @@ -307,7 +316,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { while (aNumber >= this.mOreByProducts.size()) aNumber--; Object o = this.mOreByProducts.get(aNumber); - if (o == null||o.equals(Werkstoff.default_null_Werkstoff) || o.equals(Materials._NULL)) + if (o == null || o.equals(Werkstoff.default_null_Werkstoff) || o.equals(Materials._NULL)) return this.get(prefixes); if (o instanceof Werkstoff) return WerkstoffLoader.getCorrespondingItemStack(prefixes, (Werkstoff) o); @@ -321,7 +330,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public String getVarName() { - return this.defaultName.replaceAll(" ",""); + return this.defaultName.replaceAll(" ", ""); } public String getToolTip() { @@ -373,8 +382,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.SUBTAGS.remove(subTag); } - public void getAndAddToCollection(OrePrefixes prefixes,int amount,Collection stacks){ - stacks.add(this.get(prefixes,amount)); + public void getAndAddToCollection(OrePrefixes prefixes, int amount, Collection stacks) { + stacks.add(this.get(prefixes, amount)); } public ItemStack get(OrePrefixes prefixes) { @@ -382,10 +391,11 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public FluidStack getFluidOrGas(int fluidAmount) { - return new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(this)),fluidAmount); + return new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(this)), fluidAmount); } + public FluidStack getMolten(int fluidAmount) { - return new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(this)),fluidAmount); + return new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(this)), fluidAmount); } public ItemStack get(OrePrefixes prefixes, int amount) { @@ -393,12 +403,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public byte getToolQuality() { - return this.stats.getQualityOverride() > 0 ? this.stats.getQualityOverride() : (byte) ( (15f * (((float)this.getStats().getProtons() / 188f) + (float) this.getStats().getMeltingPoint() / 10801f)) / (float) this.getContents().getKey() ); + return this.stats.getQualityOverride() > 0 ? this.stats.getQualityOverride() : (byte) ((15f * (((float) this.getStats().getProtons() / 188f) + (float) this.getStats().getMeltingPoint() / 10801f)) / (float) this.getContents().getKey()); } public float getToolSpeed() { return this.stats.getSpeedOverride() > 0f ? this.stats.getSpeedOverride() : Math.max(1f, - 2f*((float) -this.getStats().getMass() + 0.1f * (float) this.getStats().getMeltingPoint() + (float) this.getStats().getProtons()) * 0.1f / (float) this.getContents().getKey() * 0.1f * (float) this.getToolQuality() + 2f * ((float) -this.getStats().getMass() + 0.1f * (float) this.getStats().getMeltingPoint() + (float) this.getStats().getProtons()) * 0.1f / (float) this.getContents().getKey() * 0.1f * (float) this.getToolQuality() ); } @@ -406,8 +416,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.stats.getDurOverride() > 0 ? this.stats.getDurOverride() : (int) (this.stats.durMod * ((0.01f * (float) this.getStats().getMeltingPoint() * (float) this.getStats().getMass()) / (float) this.getContents().getKey())); } - public boolean hasItemType(OrePrefixes prefixes){ - return (this.getGenerationFeatures().toGenerate & GenerationFeatures.prefixLogic.get(prefixes)) != 0; + public boolean hasItemType(OrePrefixes prefixes) { + int unpacked = Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes); + return (this.getGenerationFeatures().toGenerate & unpacked) != 0 && (this.getGenerationFeatures().blacklist & unpacked) == 0; } public enum Types { @@ -427,6 +438,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public static class GenerationFeatures { + long toGenerate = 0b0001001; //logic gate shit /* dust 1 @@ -440,66 +452,85 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { meta crafting metal 100000000 (gears, screws, bolts, springs) multiple ingotWorth stuff 1000000000 (double, triple, quadruple, ingot/plates) */ - public short toGenerate = 0b0001001; - public static final HashMap prefixLogic = new HashMap<>(); - - static { - Arrays.stream(OrePrefixes.values()).forEach( e -> prefixLogic.put(e,0)); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dust,0b1); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustTiny,0b1); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustSmall,0b1); - - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingot,0b10); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotHot,0b10); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.nugget,0b10); - - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gem,0b100); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawed,0b100); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemExquisite,0b100); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemChipped,0b100); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawless,0b100); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.lens,0b100); - - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ore,0b1000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustImpure,0b1000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustPure,0b1000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushed,0b1000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedPurified,0b1000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedCentrifuged,0b1000); - - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.cell,0b10000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.capsule,0b10000); - // Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.bottle,0b10000); - - Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.capsuleMolten,0b1000000); - Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten,0b1000000); - - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plate,0b10000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stick,0b10000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rod,0b10000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadHammer,0b10000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadWrench,0b10000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadSaw,0b10000000); - - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gearGt,0b100000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gearGtSmall,0b100000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.bolt,0b100000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.screw,0b100000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ring,0b100000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.spring,0b100000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.springSmall,0b100000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rotor,0b100000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.wireFine,0b100000000); - - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateDouble,0b1000000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateTriple,0b1000000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateQuadruple,0b1000000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateQuintuple,0b1000000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateDense,0b1000000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotDouble,0b1000000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotTriple,0b1000000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuadruple,0b1000000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuintuple,0b1000000000); + private boolean isExtension; + private static final NonNullWrappedHashMap prefixLogic = new NonNullWrappedHashMap<>(0); + + public GenerationFeatures() { + } + + public static void initPrefixLogic() { + Arrays.stream(OrePrefixes.values()).forEach(e -> prefixLogic.put(e, 0)); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dust, 0b1); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustTiny, 0b1); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustSmall, 0b1); + + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingot, 0b10); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotHot, 0b10); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.nugget, 0b10); + + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gem, 0b100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawed, 0b100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemExquisite, 0b100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemChipped, 0b100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gemFlawless, 0b100); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.lens, 0b100); + + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.block, 0b110); + + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ore, 0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustImpure, 0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustPure, 0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushed, 0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedPurified, 0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedCentrifuged, 0b1000); + + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.cell, 0b10000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.capsule, 0b10000); + // Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.bottle,0b10000); + + Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.capsuleMolten, 0b1000000); + Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten, 0b1000000); + + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plate, 0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stick, 0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stickLong, 0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadHammer, 0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadWrench, 0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadSaw, 0b10000000); + + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.screw, 0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gearGt, 0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gearGtSmall, 0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.bolt, 0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ring, 0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.spring, 0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.springSmall, 0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rotor, 0b100000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.wireFine, 0b100000000); + + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateDouble, 0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateTriple, 0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateQuadruple, 0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateQuintuple, 0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateDense, 0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotDouble, 0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotTriple, 0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuadruple, 0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuintuple, 0b1000000000); + } + + public void setExtension() { + isExtension = !isExtension; + } + + public static int getPrefixDataRaw(OrePrefixes prefixes) { + if (prefixes == null) + throw new IllegalArgumentException("OrePrefixes is NULL!"); + return GenerationFeatures.prefixLogic.get(prefixes); + } + + public boolean isExtension() { + return isExtension; } //public byte toGenerateSecondary = 0b0000000; @@ -516,120 +547,153 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { */ public byte extraRecipes; - public Werkstoff.GenerationFeatures setBlacklist(OrePrefixes p){ - if (p == OrePrefixes.dustTiny || p == OrePrefixes.dust || p == OrePrefixes.dustSmall || p == OrePrefixes.crateGtDust){ - this.blacklist |= 1; - }else - this.blacklist |= p.mMaterialGenerationBits; + public Werkstoff.GenerationFeatures setBlacklist(OrePrefixes p) { + this.blacklist |= getPrefixDataRaw(p); return this; } + @Deprecated public boolean hasDusts() { return (this.toGenerate & 0b1) != 0; } + + @Deprecated public boolean hasGems() { return (this.toGenerate & 0b100) != 0; } + + @Deprecated public boolean hasOres() { return (this.toGenerate & 0b1000) != 0; } - public Werkstoff.GenerationFeatures enforceUnification(){ + public Werkstoff.GenerationFeatures enforceUnification() { this.enforceUnification = true; return this; } - public Werkstoff.GenerationFeatures removeGems(){ + @Deprecated + public Werkstoff.GenerationFeatures removeGems() { if (this.hasGems()) - this.toGenerate = (byte) (this.toGenerate ^ 0b100); + this.toGenerate = (long) (this.toGenerate ^ 0b100); return this; } - public Werkstoff.GenerationFeatures removeDusts(){ + @Deprecated + public Werkstoff.GenerationFeatures removeDusts() { if (this.hasDusts()) - this.toGenerate = (byte) (this.toGenerate ^ 0b1); + this.toGenerate = (long) (this.toGenerate ^ 0b1); return this; } - public Werkstoff.GenerationFeatures removeOres(){ + + @Deprecated + public Werkstoff.GenerationFeatures removeOres() { if (this.hasOres()) - this.toGenerate = (byte) (this.toGenerate ^ 0b1000); + this.toGenerate = (long) (this.toGenerate ^ 0b1000); return this; } - public Werkstoff.GenerationFeatures addChemicalRecipes(){ + public Werkstoff.GenerationFeatures addChemicalRecipes() { this.extraRecipes = (byte) (this.extraRecipes | 1); return this; } + public boolean hasChemicalRecipes() { - return (this.extraRecipes & 1) != 0; + return (this.extraRecipes & 1) != 0; } - public Werkstoff.GenerationFeatures addMixerRecipes(){ + public Werkstoff.GenerationFeatures addMixerRecipes() { this.extraRecipes = (byte) (this.extraRecipes | 10); return this; } + public boolean hasMixerRecipes() { return (this.extraRecipes & 10) != 0; } - public Werkstoff.GenerationFeatures addSifterRecipes(){ + public Werkstoff.GenerationFeatures addSifterRecipes() { this.extraRecipes = (byte) (this.extraRecipes | 100); return this; } + public boolean hasSifterRecipes() { return (this.extraRecipes & 100) != 0; } public Werkstoff.GenerationFeatures onlyDust() { - this.toGenerate = (byte) (0b1); + this.toGenerate = (long) (0b1); return this; } + /** + * Automatically adds Simple Metal Working Items + */ public Werkstoff.GenerationFeatures addMetalItems() { - this.toGenerate = (byte) (this.toGenerate | 0b10); + this.toGenerate = (long) (this.addSimpleMetalWorkingItems().toGenerate | 0b10); return this; } public Werkstoff.GenerationFeatures disable() { - this.toGenerate = (byte) (0); + this.toGenerate = (long) (0); return this; } + public Werkstoff.GenerationFeatures addCells() { - this.toGenerate = (byte) (this.toGenerate | 0b10000); + this.toGenerate = (long) (this.toGenerate | 0b10000); return this; } + @Deprecated public boolean hasCells() { return (this.toGenerate & 0b10000) != 0; } + @Deprecated public boolean hasMolten() { return (this.toGenerate & 0b1000000) != 0; } public Werkstoff.GenerationFeatures addMolten() { - this.toGenerate = (byte) (this.toGenerate | 0b1000000); + this.toGenerate = (long) (this.toGenerate | 0b1000000); return this; } + /** + * Automatically adds Simple Metal Working Items + */ public Werkstoff.GenerationFeatures addGems() { - this.toGenerate = (byte) (this.toGenerate | 0x4); + this.toGenerate = (long) (this.addSimpleMetalWorkingItems().toGenerate | 0x4); return this; } + public Werkstoff.GenerationFeatures addSimpleMetalWorkingItems() { - this.toGenerate = (byte) (this.toGenerate | 0b10000000); + this.toGenerate = (long) (this.toGenerate | 0b10000000); return this; } + + @Deprecated public boolean hasSimpleMetalWorkingItems() { return (this.toGenerate & 0b10000000) != 0; } + public Werkstoff.GenerationFeatures addCraftingMetalWorkingItems() { - this.toGenerate = (byte) (this.toGenerate | 0b100000000); + this.toGenerate = (long) (this.toGenerate | 0b100000000); return this; } + public Werkstoff.GenerationFeatures addMultipleIngotMetalWorkingItems() { - this.toGenerate = (byte) (this.toGenerate | 0b1000000000); + this.toGenerate = (long) (this.toGenerate | 0b1000000000); + return this; + } + + public Werkstoff.GenerationFeatures addPrefix(OrePrefixes prefixes) { + this.toGenerate = (long) (this.toGenerate | this.getPrefixDataRaw(prefixes)); + return this; + } + + public Werkstoff.GenerationFeatures removePrefix(OrePrefixes prefixes) { + this.toGenerate = (long) (this.toGenerate ^ this.getPrefixDataRaw(prefixes)); return this; } } @@ -714,7 +778,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.durMod = durMod; } - private Pair[] mTC_Aspects; + private Pair[] mTC_Aspects; //logic gate shit byte quality = ~0b1111111; @@ -860,4 +924,4 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } } -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 6f6267021a..1cc9b077cf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -22,25 +22,26 @@ package com.github.bartimaeusnek.bartworks.system.material; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.API.WerkstoffAdderRegistry; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; +import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.system.log.DebugLog; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_CircuitsLoader; import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.GTMetaItemEnhancer; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes; -import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; -import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.EnumUtils; import com.github.bartimaeusnek.bartworks.util.Pair; +import com.github.bartimaeusnek.bartworks.util.log.DebugLog; +import com.github.bartimaeusnek.crossmod.cls.CLSCompat; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import com.google.common.collect.HashBiMap; import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ProgressManager; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.GT_Mod; @@ -63,7 +64,6 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; @@ -79,11 +79,10 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Util.superscriptNumbers import static gregtech.api.enums.OrePrefixes.*; @SuppressWarnings({"unchecked", "unused", "deprecation"}) -public class WerkstoffLoader implements Runnable { - - private WerkstoffLoader() {} +public class WerkstoffLoader { + private WerkstoffLoader() { + } - public static final WerkstoffLoader INSTANCE = new WerkstoffLoader(); public static final SubTag NOBLE_GAS = SubTag.getNewSubTag("NobleGas"); public static final SubTag ANAEROBE_GAS = SubTag.getNewSubTag("AnaerobeGas"); public static final SubTag ANAEROBE_SMELTING = SubTag.getNewSubTag("AnaerobeSmelting"); @@ -97,38 +96,67 @@ public class WerkstoffLoader implements Runnable { public static ItemList ringMold; public static ItemList boltMold; public static boolean gtnhGT = false; - static { + + + public static void setUp() { + //GTNH detection hack try { - gtnhGT = GT_MetaGenerated_Tool_01.class.getField("SOLDERING_IRON_MV") != null; - } catch (NoSuchFieldException ignored) {} + Field f = GT_MetaGenerated_Tool_01.class.getField("SOLDERING_IRON_MV"); + gtnhGT = true; + } catch (Exception ignored) { + gtnhGT = false; + } //GTNH hack for molten cells - for (OrePrefixes prefix : OrePrefixes.values()){ - if (prefix.toString().equals("cellMolten")) + for (OrePrefixes prefix : values()) { + if (prefix.toString().equals("cellMolten")) { WerkstoffLoader.cellMolten = prefix; + break; + } } + if (WerkstoffLoader.cellMolten == null) { - WerkstoffLoader.cellMolten = EnumHelper.addEnum(OrePrefixes.class,"cellMolten",new Class[]{String.class, String.class, String.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, int.class, long.class, int.class, int.class},new Object[]{"Cells of Molten stuff", "Molten ", " Cell", true, true, true, true, false, false, false, true, false, false, 0b1000000, 3628800L, 64, 31}); - // GT_LanguageManager.addStringLocalization(".name", this.getDefaultLocalization(w)); + WerkstoffLoader.cellMolten = EnumUtils.addNewOrePrefix( + "cellMolten","Cells of Molten stuff", "Molten ", + " Cell", true, true, + true, true, false, + false, false, true, + false, false, 0b1000000, + 3628800L, 64, 31 + ); + // GT_LanguageManager.addStringLocalization(".name", this.getDefaultLocalization(w)); } else { WerkstoffLoader.cellMolten.mMaterialGenerationBits = 0b1000000; } + try { WerkstoffLoader.rotorMold = Enum.valueOf(ItemList.class, "Shape_Mold_Rotor"); WerkstoffLoader.rotorShape = Enum.valueOf(ItemList.class, "Shape_Extruder_Rotor"); WerkstoffLoader.smallGearShape = Enum.valueOf(ItemList.class, "Shape_Extruder_Small_Gear"); WerkstoffLoader.ringMold = Enum.valueOf(ItemList.class, "Shape_Mold_Ring"); WerkstoffLoader.boltMold = Enum.valueOf(ItemList.class, "Shape_Mold_Bolt"); - } catch (NullPointerException | IllegalArgumentException ignored){} + } catch (NullPointerException | IllegalArgumentException ignored) { + } + //add tiberium - Element t = BW_Util.createNewElement("Tr",123L, 203L, 0L, -1L, null, "Tiberium", false); + Element t = EnumUtils.createNewElement("Tr", 123L, 203L, 0L, -1L, null, "Tiberium", false); + //add molten & regular capsuls - if (Loader.isModLoaded("Forestry")) { - capsuleMolten = EnumHelper.addEnum(OrePrefixes.class, "capsuleMolten", new Class[]{String.class, String.class, String.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, int.class, long.class, int.class, int.class}, new Object[]{"Capsule of Molten stuff", "Molten ", " Capsule", true, true, true, true, false, false, false, true, false, false, 0b1000000, 3628800L, 64, -1}); + if (LoaderReference.Forestry) { + capsuleMolten = EnumUtils.addNewOrePrefix( + "capsuleMolten", "Capsule of Molten stuff", "Molten ", + " Capsule", true, true, + true, true, false, + false, false, true, + false, false, 0b1000000, + 3628800L, 64, -1 + ); capsule.mMaterialGenerationBits = 0b100000; capsule.mDefaultStackSize = 64; } + bottle.mDefaultStackSize = 1; + Werkstoff.GenerationFeatures.initPrefixLogic(); } //TODO: @@ -199,7 +227,7 @@ public class WerkstoffLoader implements Runnable { new Pair<>(Materials.Fluorine, 1) ); public static final Werkstoff YttriumOxide = new Werkstoff( - new short[]{255,255,255,0}, + new short[]{255, 255, 255, 0}, "Yttrium Oxide", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().onlyDust().enforceUnification(), //No autoadd here to gate this material by hand @@ -375,7 +403,7 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().addGems(), 19, TextureSet.SET_GEM_VERTICAL, - Arrays.asList(WerkstoffLoader.Zirconium,Materials.Silicon), + Arrays.asList(WerkstoffLoader.Zirconium, Materials.Silicon), new Pair<>(WerkstoffLoader.Zirconium, 1), new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Oxygen, 4) @@ -390,7 +418,7 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().addGems().addSifterRecipes(), 20, TextureSet.SET_FLINT, - Arrays.asList(Materials.RockSalt,Materials.Borax), + Arrays.asList(Materials.RockSalt, Materials.Borax), new Pair<>(Materials.Salt, 1) ); public static final Werkstoff Spodumen = new Werkstoff( @@ -412,79 +440,79 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().addGems().addSifterRecipes(), 22, TextureSet.SET_FLINT, - Arrays.asList(Materials.RockSalt,Materials.Borax), + Arrays.asList(Materials.RockSalt, Materials.Borax), new Pair<>(Materials.RockSalt, 1) ); public static final Werkstoff Fayalit = new Werkstoff( - new short[]{50,50,50,0}, + new short[]{50, 50, 50, 0}, "Fayalite", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 23, TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Iron,Materials.Silicon), + Arrays.asList(Materials.Iron, Materials.Silicon), new Pair<>(Materials.Iron, 2), new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Oxygen, 4) ); public static final Werkstoff Forsterit = new Werkstoff( - new short[]{255,255,255,0}, + new short[]{255, 255, 255, 0}, "Forsterite", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 24, TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Magnesium,Materials.Silicon), + Arrays.asList(Materials.Magnesium, Materials.Silicon), new Pair<>(Materials.Magnesium, 2), new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Oxygen, 4) ); public static final Werkstoff Hedenbergit = new Werkstoff( - new short[]{100,150,100,0}, + new short[]{100, 150, 100, 0}, "Hedenbergite", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 25, TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Iron,Materials.Calcium,Materials.Silicon), + Arrays.asList(Materials.Iron, Materials.Calcium, Materials.Silicon), new Pair<>(Materials.Calcium, 1), new Pair<>(Materials.Iron, 1), new Pair<>(Materials.Silicon, 2), new Pair<>(Materials.Oxygen, 6) ); public static final Werkstoff DescloiziteZNVO4 = new Werkstoff( - new short[]{0xBF,0x18,0x0F,0}, + new short[]{0xBF, 0x18, 0x0F, 0}, "Red Descloizite",//Pb(Zn,Cu)[OH|VO4 new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), 26, TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Lead,Materials.Copper,Materials.Vanadium), + Arrays.asList(Materials.Lead, Materials.Copper, Materials.Vanadium), new Pair<>(Materials.Lead, 1), new Pair<>(Materials.Zinc, 1), new Pair<>(Materials.Vanadium, 1), new Pair<>(Materials.Oxygen, 4) ); public static final Werkstoff DescloiziteCUVO4 = new Werkstoff( - new short[]{0xf9,0x6d,0x18,0}, + new short[]{0xf9, 0x6d, 0x18, 0}, "Orange Descloizite",//Pb(Zn,Cu)[OH|VO4 new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), 27, TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Lead,Materials.Zinc,Materials.Vanadium), + Arrays.asList(Materials.Lead, Materials.Zinc, Materials.Vanadium), new Pair<>(Materials.Lead, 1), new Pair<>(Materials.Copper, 1), new Pair<>(Materials.Vanadium, 1), new Pair<>(Materials.Oxygen, 4) ); public static final Werkstoff FuchsitAL = new Werkstoff( - new short[]{0x4D,0x7F,0x64,0}, + new short[]{0x4D, 0x7F, 0x64, 0}, "Green Fuchsite", subscriptNumbers("KAl3Si3O10(OH)2"), new Werkstoff.Stats().setElektrolysis(true), @@ -492,7 +520,7 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures(), 28, TextureSet.SET_METALLIC, - Arrays.asList(Materials.Potassium,Materials.Aluminium,Materials.Silicon), + Arrays.asList(Materials.Potassium, Materials.Aluminium, Materials.Silicon), new Pair<>(Materials.Potassium, 1), new Pair<>(Materials.Aluminium, 3), new Pair<>(Materials.Silicon, 3), @@ -501,7 +529,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff FuchsitCR = new Werkstoff( - new short[]{128,0,0,0}, + new short[]{128, 0, 0, 0}, "Red Fuchsite", subscriptNumbers("KCr3Si3O10(OH)2"), new Werkstoff.Stats().setElektrolysis(true), @@ -509,7 +537,7 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures(), 29, TextureSet.SET_METALLIC, - Arrays.asList(Materials.Potassium,Materials.Chrome,Materials.Silicon), + Arrays.asList(Materials.Potassium, Materials.Chrome, Materials.Silicon), new Pair<>(Materials.Potassium, 1), new Pair<>(Materials.Chrome, 3), new Pair<>(Materials.Silicon, 3), @@ -518,7 +546,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff Thorium232 = new Werkstoff( - new short[]{0,64,0,0}, + new short[]{0, 64, 0, 0}, "Thorium 232", superscriptNumbers("Th232"), new Werkstoff.Stats().setRadioactive(true), @@ -529,7 +557,7 @@ public class WerkstoffLoader implements Runnable { //No Byproducts ); public static final Werkstoff BismuthTellurite = new Werkstoff( - new short[]{32,72,32,0}, + new short[]{32, 72, 32, 0}, "Bismuth Tellurite", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -541,18 +569,18 @@ public class WerkstoffLoader implements Runnable { new Pair<>(Materials.Tellurium, 3) ); public static final Werkstoff Tellurium = new Werkstoff( - new short[]{0xff,0xff,0xff,0}, + new short[]{0xff, 0xff, 0xff, 0}, "Tellurium", new Werkstoff.Stats(), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().addMetalItems().removeOres(), + new Werkstoff.GenerationFeatures().addMetalItems().removePrefix(ore), 32, TextureSet.SET_METALLIC, //No Byproducts new Pair<>(Materials.Tellurium, 1) ); public static final Werkstoff BismuthHydroBorat = new Werkstoff( - new short[]{72,144,72,0}, + new short[]{72, 144, 72, 0}, "Dibismuthhydroborat", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -565,7 +593,7 @@ public class WerkstoffLoader implements Runnable { new Pair<>(Materials.Hydrogen, 1) ); public static final Werkstoff ArInGaPhoBiBoTe = new Werkstoff( - new short[]{36,36,36,0}, + new short[]{36, 36, 36, 0}, "Circuit Compound MK3", new Werkstoff.Stats().setCentrifuge(true), Werkstoff.Types.COMPOUND, @@ -579,7 +607,7 @@ public class WerkstoffLoader implements Runnable { ); public static final Werkstoff Prasiolite = new Werkstoff( - new short[]{0xD0,0xDD,0x95,0}, + new short[]{0xD0, 0xDD, 0x95, 0}, "Prasiolite", new Werkstoff.Stats().setElektrolysis(true).setMeltingPoint(1923), Werkstoff.Types.COMPOUND, @@ -587,13 +615,13 @@ public class WerkstoffLoader implements Runnable { 35, TextureSet.SET_QUARTZ, //No Byproducts - new Pair<>(Materials.Silicon,5), - new Pair<>(Materials.Oxygen,10), - new Pair<>(Materials.Iron,1) + new Pair<>(Materials.Silicon, 5), + new Pair<>(Materials.Oxygen, 10), + new Pair<>(Materials.Iron, 1) ); public static final Werkstoff MagnetoResonaticDust = new Werkstoff( - new short[]{0xDD,0x77,0xDD,0}, + new short[]{0xDD, 0x77, 0xDD, 0}, "Magneto Resonatic", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -601,13 +629,13 @@ public class WerkstoffLoader implements Runnable { 36, TextureSet.SET_MAGNETIC, //No Byproducts - new Pair<>(WerkstoffLoader.Prasiolite,3), - new Pair<>(WerkstoffLoader.BismuthTellurite,4), - new Pair<>(WerkstoffLoader.CubicZirconia,1), - new Pair<>(Materials.SteelMagnetic,1) + new Pair<>(WerkstoffLoader.Prasiolite, 3), + new Pair<>(WerkstoffLoader.BismuthTellurite, 4), + new Pair<>(WerkstoffLoader.CubicZirconia, 1), + new Pair<>(Materials.SteelMagnetic, 1) ); public static final Werkstoff Xenon = new Werkstoff( - new short[]{0x14,0x39,0x7F,0}, + new short[]{0x14, 0x39, 0x7F, 0}, "Xenon", "Xe", new Werkstoff.Stats().setProtons(54).setMass(131).setGas(true), @@ -619,7 +647,7 @@ public class WerkstoffLoader implements Runnable { //No Ingredients ); public static final Werkstoff Oganesson = new Werkstoff( - new short[]{0x14,0x39,0x7F,0}, + new short[]{0x14, 0x39, 0x7F, 0}, "Oganesson", "Og", new Werkstoff.Stats().setProtons(118).setMass(294).setGas(true), @@ -631,7 +659,7 @@ public class WerkstoffLoader implements Runnable { //No Ingredients ); public static final Werkstoff Californium = new Werkstoff( - new short[]{0xAA,0xAA,0xAA,0}, + new short[]{0xAA, 0xAA, 0xAA, 0}, "Californium", "Cf", new Werkstoff.Stats().setProtons(98).setMass(251).setBlastFurnace(true).setMeltingPoint(900), @@ -650,12 +678,12 @@ public class WerkstoffLoader implements Runnable { Werkstoff.Types.ELEMENT, new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten(), 40, - Materials.Calcium.mIconSet + Materials.Calcium.mIconSet, //No Byproducts - //No Ingredients + new Pair<>(Materials.Calcium,1) ); public static final Werkstoff Neon = new Werkstoff( - new short[]{0xff,0x07,0x3a}, + new short[]{0xff, 0x07, 0x3a}, "Neon", "Ne", new Werkstoff.Stats().setProtons(Element.Ne.mProtons).setMass(Element.Ne.getMass()).setGas(true), @@ -667,7 +695,7 @@ public class WerkstoffLoader implements Runnable { //No Ingredients ); public static final Werkstoff Krypton = new Werkstoff( - new short[]{0xb1,0xff,0x32}, + new short[]{0xb1, 0xff, 0x32}, "Krypton", "Kr", new Werkstoff.Stats().setProtons(Element.Kr.mProtons).setMass(Element.Kr.getMass()).setGas(true), @@ -679,7 +707,7 @@ public class WerkstoffLoader implements Runnable { //No Ingredients ); public static final Werkstoff BArTiMaEuSNeK = new Werkstoff( - new short[]{0x00,0xff,0x00}, + new short[]{0x00, 0xff, 0x00}, "BArTiMaEuSNeK", "Are you serious?", new Werkstoff.Stats().setMeltingPoint(9001).setCentrifuge(true).setBlastFurnace(true), @@ -692,14 +720,14 @@ public class WerkstoffLoader implements Runnable { Materials.Titanium, Materials.Europium ), - new Pair<>(Materials.Boron,1), - new Pair<>(Materials.Argon,1), - new Pair<>(Materials.Titanium,1), - new Pair<>(Materials.Magic,1), - new Pair<>(Materials.Europium,1), - new Pair<>(Materials.Sulfur,1), - new Pair<>(WerkstoffLoader.Neon,1), - new Pair<>(Materials.Potassium,1) + new Pair<>(Materials.Boron, 1), + new Pair<>(Materials.Argon, 1), + new Pair<>(Materials.Titanium, 1), + new Pair<>(Materials.Magic, 1), + new Pair<>(Materials.Europium, 1), + new Pair<>(Materials.Sulfur, 1), + new Pair<>(WerkstoffLoader.Neon, 1), + new Pair<>(Materials.Potassium, 1) ); public static final Werkstoff PTConcentrate = new Werkstoff( Materials.Platinum.getRGBA(), @@ -747,11 +775,11 @@ public class WerkstoffLoader implements Runnable { 47, TextureSet.SET_METALLIC, //No Byproducts - new Pair<>(Materials.Platinum,1), - new Pair<>(Materials.Stone,2) + new Pair<>(Materials.Platinum, 1), + new Pair<>(Materials.Stone, 2) ); public static final Werkstoff AquaRegia = new Werkstoff( - new short[]{0xff,0xb1,0x32}, + new short[]{0xff, 0xb1, 0x32}, "Aqua Regia", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -759,11 +787,11 @@ public class WerkstoffLoader implements Runnable { 48, TextureSet.SET_FLUID, //No Byproducts - new Pair<>(Materials.DilutedSulfuricAcid,1), - new Pair<>(Materials.NitricAcid,1) + new Pair<>(Materials.DilutedSulfuricAcid, 1), + new Pair<>(Materials.NitricAcid, 1) ); public static final Werkstoff PTResidue = new Werkstoff( - new short[]{0x64,0x63,0x2E}, + new short[]{0x64, 0x63, 0x2E}, "Platinum Residue", "??IrOsRhRu??", new Werkstoff.Stats(), @@ -774,7 +802,7 @@ public class WerkstoffLoader implements Runnable { //No Byproducts ); public static final Werkstoff AmmoniumChloride = new Werkstoff( - new short[]{0xff,0xff,0xff}, + new short[]{0xff, 0xff, 0xff}, "Ammonium Chloride", subscriptNumbers("NH4Cl"), new Werkstoff.Stats(), @@ -783,8 +811,8 @@ public class WerkstoffLoader implements Runnable { 50, TextureSet.SET_FLUID, //No Byproducts - new Pair<>(Materials.Ammonium,1), - new Pair<>(Materials.HydrochloricAcid,1) + new Pair<>(Materials.Ammonium, 1), + new Pair<>(Materials.HydrochloricAcid, 1) ); public static final Werkstoff PTRawPowder = new Werkstoff( Materials.Platinum.getRGBA(), @@ -806,8 +834,8 @@ public class WerkstoffLoader implements Runnable { 52, TextureSet.SET_FLUID, //No Byproducts - new Pair<>(Materials.Ammonium,1), - new Pair<>(Materials.Palladium,1) + new Pair<>(Materials.Ammonium, 1), + new Pair<>(Materials.Palladium, 1) ); public static final Werkstoff PDMetallicPowder = new Werkstoff( Materials.Palladium.getRGBA(), @@ -819,8 +847,8 @@ public class WerkstoffLoader implements Runnable { 53, TextureSet.SET_METALLIC, //No Byproducts - new Pair<>(Materials.Palladium,1), - new Pair<>(Materials.Stone,2) + new Pair<>(Materials.Palladium, 1), + new Pair<>(Materials.Stone, 2) ); public static final Werkstoff PDRawPowder = new Werkstoff( Materials.Palladium.getRGBA(), @@ -846,7 +874,7 @@ public class WerkstoffLoader implements Runnable { //No Ingredients ); public static final Werkstoff Sodiumformate = new Werkstoff( - new short[]{0xff,0xaa,0xaa}, + new short[]{0xff, 0xaa, 0xaa}, "Sodium Formate", "HCOONa", new Werkstoff.Stats(), @@ -855,11 +883,11 @@ public class WerkstoffLoader implements Runnable { 56, TextureSet.SET_FLUID, //No Byproducts - new Pair<>(Materials.SodiumHydroxide,1), - new Pair<>(Materials.CarbonMonoxide,1) + new Pair<>(Materials.SodiumHydroxide, 1), + new Pair<>(Materials.CarbonMonoxide, 1) ); public static final Werkstoff Sodiumsulfate = new Werkstoff( - new short[]{0xff,0xff,0xff}, + new short[]{0xff, 0xff, 0xff}, "Sodium Sulfate", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -867,12 +895,12 @@ public class WerkstoffLoader implements Runnable { 57, TextureSet.SET_FLUID, //No Byproducts - new Pair<>(Materials.Sodium,2), - new Pair<>(Materials.Sulfur,1), - new Pair<>(Materials.Oxygen,4) + new Pair<>(Materials.Sodium, 2), + new Pair<>(Materials.Sulfur, 1), + new Pair<>(Materials.Oxygen, 4) ); public static final Werkstoff FormicAcid = new Werkstoff( - new short[]{0xff,0xaa,0x77}, + new short[]{0xff, 0xaa, 0x77}, "Formic Acid", subscriptNumbers("CH2O2"), new Werkstoff.Stats().setElektrolysis(true), @@ -881,12 +909,12 @@ public class WerkstoffLoader implements Runnable { 58, TextureSet.SET_FLUID, //No Byproducts - new Pair<>(Materials.Carbon,1), - new Pair<>(Materials.Hydrogen,2), - new Pair<>(Materials.Oxygen,2) + new Pair<>(Materials.Carbon, 1), + new Pair<>(Materials.Hydrogen, 2), + new Pair<>(Materials.Oxygen, 2) ); public static final Werkstoff PotassiumDisulfate = new Werkstoff( - new short[]{0xfb,0xbb,0x66}, + new short[]{0xfb, 0xbb, 0x66}, "Potassium Disulfate", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -894,9 +922,9 @@ public class WerkstoffLoader implements Runnable { 59, TextureSet.SET_DULL, //No Byproducts - new Pair<>(Materials.Potassium,2), - new Pair<>(Materials.Sulfur,2), - new Pair<>(Materials.Oxygen,7) + new Pair<>(Materials.Potassium, 2), + new Pair<>(Materials.Sulfur, 2), + new Pair<>(Materials.Oxygen, 7) ); public static final Werkstoff LeachResidue = new Werkstoff( new short[]{0x64, 0x46, 0x29}, @@ -910,7 +938,7 @@ public class WerkstoffLoader implements Runnable { //No Byproducts ); public static final Werkstoff RHSulfate = new Werkstoff( - new short[]{0xee,0xaa,0x55}, + new short[]{0xee, 0xaa, 0x55}, "Rhodium Sulfate", new Werkstoff.Stats().setGas(true), Werkstoff.Types.COMPOUND, @@ -920,7 +948,7 @@ public class WerkstoffLoader implements Runnable { //No Byproducts ); public static final Werkstoff RHSulfateSolution = new Werkstoff( - new short[]{0xff,0xbb,0x66}, + new short[]{0xff, 0xbb, 0x66}, "Rhodium Sulfate Solution", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -930,19 +958,19 @@ public class WerkstoffLoader implements Runnable { //No Byproducts ); public static final Werkstoff CalciumChloride = new Werkstoff( - new short[]{0xff,0xff,0xff}, + new short[]{0xff, 0xff, 0xff}, "Calcium Chloride", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust().addCells(), 63, TextureSet.SET_DULL, - new Pair<>(Materials.Calcium,1), - new Pair<>(Materials.Chlorine,2) + new Pair<>(Materials.Calcium, 1), + new Pair<>(Materials.Chlorine, 2) //No Byproducts ); public static final Werkstoff Ruthenium = new Werkstoff( - new short[]{0x64,0x64,0x64}, + new short[]{0x64, 0x64, 0x64}, "Ruthenium", "Ru", new Werkstoff.Stats().setBlastFurnace(true).setMeltingPoint(2607).setMass(Element.Ru.getMass()).setProtons(Element.Ru.mProtons), @@ -953,32 +981,32 @@ public class WerkstoffLoader implements Runnable { //No Byproducts ); public static final Werkstoff SodiumRuthenate = new Werkstoff( - new short[]{0x3a,0x40,0xcb}, + new short[]{0x3a, 0x40, 0xcb}, "Sodium Ruthenate", new Werkstoff.Stats(), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust(), 65, TextureSet.SET_SHINY, - new Pair<>(Materials.Sodium,2), - new Pair<>(Ruthenium,1), - new Pair<>(Materials.Oxygen,3) + new Pair<>(Materials.Sodium, 2), + new Pair<>(Ruthenium, 1), + new Pair<>(Materials.Oxygen, 3) //No Byproducts ); public static final Werkstoff RutheniumTetroxide = new Werkstoff( - new short[]{0xc7,0xc7,0xc7}, + new short[]{0xc7, 0xc7, 0xc7}, "Ruthenium Tetroxide", new Werkstoff.Stats().setMeltingPoint(313), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust().addCells(), 66, TextureSet.SET_DULL, - new Pair<>(WerkstoffLoader.Ruthenium,1), - new Pair<>(Materials.Oxygen,4) + new Pair<>(WerkstoffLoader.Ruthenium, 1), + new Pair<>(Materials.Oxygen, 4) //No Byproducts ); - public static final Werkstoff HotRutheniumTetroxideSollution= new Werkstoff( - new short[]{0xc7,0xc7,0xc7}, + public static final Werkstoff HotRutheniumTetroxideSollution = new Werkstoff( + new short[]{0xc7, 0xc7, 0xc7}, "Hot Ruthenium Tetroxide Solution", "???", new Werkstoff.Stats().setGas(true).setMeltingPoint(700), @@ -986,15 +1014,15 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().addCells(), 67, TextureSet.SET_FLUID, - new Pair<>(WerkstoffLoader.Ruthenium,1), - new Pair<>(Materials.Oxygen,4), - new Pair<>(Materials.Chlorine,2), - new Pair<>(Materials.Sodium,2), - new Pair<>(Materials.Water,2) + new Pair<>(WerkstoffLoader.Ruthenium, 1), + new Pair<>(Materials.Oxygen, 4), + new Pair<>(Materials.Chlorine, 2), + new Pair<>(Materials.Sodium, 2), + new Pair<>(Materials.Water, 2) //No Byproducts ); public static final Werkstoff RutheniumTetroxideSollution = new Werkstoff( - new short[]{0xc7,0xc7,0xc7}, + new short[]{0xc7, 0xc7, 0xc7}, "Ruthenium Tetroxide Solution", "???", new Werkstoff.Stats().setMeltingPoint(313), @@ -1002,11 +1030,11 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().addCells(), 68, TextureSet.SET_FLUID, - new Pair<>(Ruthenium,1), - new Pair<>(Materials.Oxygen,4), - new Pair<>(Materials.Chlorine,2), - new Pair<>(Materials.Sodium,2), - new Pair<>(Materials.Water,2) + new Pair<>(Ruthenium, 1), + new Pair<>(Materials.Oxygen, 4), + new Pair<>(Materials.Chlorine, 2), + new Pair<>(Materials.Sodium, 2), + new Pair<>(Materials.Water, 2) //No Byproducts ); public static final Werkstoff IrOsLeachResidue = new Werkstoff( @@ -1019,8 +1047,8 @@ public class WerkstoffLoader implements Runnable { 69, TextureSet.SET_ROUGH, //No Byproducts - new Pair<>(Materials.Osmiridium,1), - new Pair<>(Materials.Stone,2) + new Pair<>(Materials.Osmiridium, 1), + new Pair<>(Materials.Stone, 2) ); public static final Werkstoff IrLeachResidue = new Werkstoff( new short[]{0x84, 0x66, 0x49}, @@ -1031,8 +1059,8 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures(), 70, TextureSet.SET_ROUGH, - new Pair<>(Materials.Iridium,1), - new Pair<>(Materials.Stone,2) + new Pair<>(Materials.Iridium, 1), + new Pair<>(Materials.Stone, 2) //No Byproducts ); public static final Werkstoff PGSDResidue = new Werkstoff( @@ -1043,8 +1071,8 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().onlyDust(), 71, TextureSet.SET_DULL, - new Pair<>(Materials.SiliconDioxide,3), - new Pair<>(Materials.Gold,2) + new Pair<>(Materials.SiliconDioxide, 3), + new Pair<>(Materials.Gold, 2) ); public static final Werkstoff AcidicOsmiumSolution = new Werkstoff( new short[]{0x84, 0x66, 0x49}, @@ -1055,8 +1083,8 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().addCells(), 72, TextureSet.SET_FLUID, - new Pair<>(Materials.Osmium,1), - new Pair<>(Materials.HydrochloricAcid,1) + new Pair<>(Materials.Osmium, 1), + new Pair<>(Materials.HydrochloricAcid, 1) ); public static final Werkstoff IridiumDioxide = new Werkstoff( new short[]{0x84, 0x66, 0x49}, @@ -1066,8 +1094,8 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().onlyDust(), 73, TextureSet.SET_FLUID, - new Pair<>(Materials.Iridium,1), - new Pair<>(Materials.Oxygen,2) + new Pair<>(Materials.Iridium, 1), + new Pair<>(Materials.Oxygen, 2) ); public static final Werkstoff OsmiumSolution = new Werkstoff( new short[]{0x84, 0x66, 0x49}, @@ -1078,8 +1106,8 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().addCells(), 74, TextureSet.SET_FLUID, - new Pair<>(Materials.Osmium,1), - new Pair<>(Materials.Hydrogen,1) + new Pair<>(Materials.Osmium, 1), + new Pair<>(Materials.Hydrogen, 1) ); public static final Werkstoff AcidicIridiumSolution = new Werkstoff( new short[]{0x84, 0x66, 0x49}, @@ -1090,8 +1118,8 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().addCells(), 75, TextureSet.SET_FLUID, - new Pair<>(Materials.Iridium,1), - new Pair<>(Materials.Hydrogen,1) + new Pair<>(Materials.Iridium, 1), + new Pair<>(Materials.Hydrogen, 1) ); public static final Werkstoff IridiumChloride = new Werkstoff( new short[]{0x84, 0x66, 0x49}, @@ -1102,8 +1130,8 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().onlyDust(), 76, TextureSet.SET_LAPIS, - new Pair<>(Materials.Iridium,1), - new Pair<>(Materials.Chlorine,3) + new Pair<>(Materials.Iridium, 1), + new Pair<>(Materials.Chlorine, 3) ); public static final Werkstoff PGSDResidue2 = new Werkstoff( new short[]{0x84, 0x66, 0x49}, @@ -1113,8 +1141,8 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().onlyDust(), 77, TextureSet.SET_DULL, - new Pair<>(Materials.Nickel,1), - new Pair<>(Materials.Copper,1) + new Pair<>(Materials.Nickel, 1), + new Pair<>(Materials.Copper, 1) ); public static final Werkstoff Rhodium = new Werkstoff( new short[]{0xF4, 0xF4, 0xF4}, @@ -1135,8 +1163,8 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures(), 79, TextureSet.SET_DULL, - new Pair<>(Rhodium,1), - new Pair<>(Materials.Stone,1) + new Pair<>(Rhodium, 1), + new Pair<>(Materials.Stone, 1) ); public static final Werkstoff RHSalt = new Werkstoff( new short[]{0x84, 0x84, 0x84}, @@ -1165,8 +1193,8 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), 82, TextureSet.SET_ROUGH, - new Pair<>(Materials.Sodium,1), - new Pair<>(Materials.NitricAcid,1) + new Pair<>(Materials.Sodium, 1), + new Pair<>(Materials.NitricAcid, 1) ); public static final Werkstoff RHNitrate = new Werkstoff( new short[]{0x77, 0x66, 0x49}, @@ -1185,9 +1213,9 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().onlyDust(), 84, TextureSet.SET_QUARTZ, - new Pair<>(Materials.Zinc,1), - new Pair<>(Materials.Sulfur,1), - new Pair<>(Materials.Oxygen,4) + new Pair<>(Materials.Zinc, 1), + new Pair<>(Materials.Sulfur, 1), + new Pair<>(Materials.Oxygen, 4) ); public static final Werkstoff RhFilterCake = new Werkstoff( new short[]{0x77, 0x66, 0x49}, @@ -1225,11 +1253,11 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), 88, TextureSet.SET_METALLIC, - new Pair<>(Materials.Palladium,3), - new Pair<>(WerkstoffLoader.Rhodium,1) + new Pair<>(Materials.Palladium, 3), + new Pair<>(WerkstoffLoader.Rhodium, 1) ); public static final Werkstoff Tiberium = new Werkstoff( - new short[]{0x22,0xEE,0x22}, + new short[]{0x22, 0xEE, 0x22}, "Tiberium", "Tr", new Werkstoff.Stats().setProtons(123).setMass(326).setBlastFurnace(true).setMeltingPoint(1800).setRadioactive(true).setToxic(true), @@ -1239,44 +1267,44 @@ public class WerkstoffLoader implements Runnable { TextureSet.SET_DIAMOND ); public static final Werkstoff Ruridit = new Werkstoff( - new short[]{0xA4,0xA4,0xA4}, + new short[]{0xA4, 0xA4, 0xA4}, "Ruridit", new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), 90, TextureSet.SET_METALLIC, - new Pair<>(WerkstoffLoader.Ruthenium,2), - new Pair<>(Materials.Iridium,1) + new Pair<>(WerkstoffLoader.Ruthenium, 2), + new Pair<>(Materials.Iridium, 1) ); public static final Werkstoff Fluorspar = new Werkstoff( - new short[]{185,69,251}, + new short[]{185, 69, 251}, "Fluorspar", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 91, TextureSet.SET_GEM_VERTICAL, - new Pair<>(Materials.Calcium,1), - new Pair<>(Materials.Fluorine,2) + new Pair<>(Materials.Calcium, 1), + new Pair<>(Materials.Fluorine, 2) ); public static final Werkstoff HDCS = new Werkstoff( - new short[]{0x33,0x44,0x33}, + new short[]{0x33, 0x44, 0x33}, "High Durability Compound Steel", new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(9000), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), 92, TextureSet.SET_SHINY, - new Pair<>(Materials.TungstenSteel,12), - new Pair<>(Materials.HSSE,9), - new Pair<>(Materials.HSSG,6), - new Pair<>(WerkstoffLoader.Ruridit,3), - new Pair<>(WerkstoffLoader.MagnetoResonaticDust,2), - new Pair<>(Materials.Plutonium,1) + new Pair<>(Materials.TungstenSteel, 12), + new Pair<>(Materials.HSSE, 9), + new Pair<>(Materials.HSSG, 6), + new Pair<>(WerkstoffLoader.Ruridit, 3), + new Pair<>(WerkstoffLoader.MagnetoResonaticDust, 2), + new Pair<>(Materials.Plutonium, 1) ); public static final Werkstoff Atheneite = new Werkstoff( - new short[]{175,175,175}, + new short[]{175, 175, 175}, "Atheneite", subscriptNumbers("(Pd,Hg)3As"), new Werkstoff.Stats().setElektrolysis(true), @@ -1284,12 +1312,12 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures(), 93, TextureSet.SET_SHINY, - new Pair<>(WerkstoffLoader.PDMetallicPowder,3), - new Pair<>(Materials.Mercury,3), - new Pair<>(Materials.Arsenic,1) + new Pair<>(WerkstoffLoader.PDMetallicPowder, 3), + new Pair<>(Materials.Mercury, 3), + new Pair<>(Materials.Arsenic, 1) ); public static final Werkstoff Temagamite = new Werkstoff( - new short[]{245,245,245}, + new short[]{245, 245, 245}, "Temagamite", subscriptNumbers("Pd3HgTe"), new Werkstoff.Stats().setElektrolysis(true), @@ -1297,24 +1325,24 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures(), 94, TextureSet.SET_ROUGH, - new Pair<>(WerkstoffLoader.PDMetallicPowder,3), - new Pair<>(Materials.Mercury,1), - new Pair<>(Materials.Tellurium,1) + new Pair<>(WerkstoffLoader.PDMetallicPowder, 3), + new Pair<>(Materials.Mercury, 1), + new Pair<>(Materials.Tellurium, 1) ); public static final Werkstoff Terlinguaite = new Werkstoff( - new short[]{245,245,245}, + new short[]{245, 245, 245}, "Terlinguaite", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), 95, TextureSet.SET_GEM_HORIZONTAL, - new Pair<>(Materials.Mercury,2), - new Pair<>(Materials.Chlorine,1), - new Pair<>(Materials.Oxygen,1) + new Pair<>(Materials.Mercury, 2), + new Pair<>(Materials.Chlorine, 1), + new Pair<>(Materials.Oxygen, 1) ); public static final Werkstoff AdemicSteel = new Werkstoff( - new short[]{0xcc,0xcc,0xcc}, + new short[]{0xcc, 0xcc, 0xcc}, "Ademic Steel", "The break in the line", new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setDurOverride(6144).setMeltingPoint(1800).setSpeedOverride(12).setQualityOverride((byte) 4), @@ -1322,22 +1350,22 @@ public class WerkstoffLoader implements Runnable { new Werkstoff.GenerationFeatures().onlyDust().addMetalItems().addCraftingMetalWorkingItems().addMolten().addSimpleMetalWorkingItems().addMultipleIngotMetalWorkingItems(), 96, TextureSet.SET_METALLIC, - new Pair<>(Materials.Steel ,2), - new Pair<>(Materials.VanadiumSteel,1), - new Pair<>(Materials.DamascusSteel,1), - new Pair<>(Materials.Carbon,4) + new Pair<>(Materials.Steel, 2), + new Pair<>(Materials.VanadiumSteel, 1), + new Pair<>(Materials.DamascusSteel, 1), + new Pair<>(Materials.Carbon, 4) ); public static final Werkstoff RawAdemicSteel = new Werkstoff( - new short[]{0xed,0xed,0xed}, + new short[]{0xed, 0xed, 0xed}, "Raw Ademic Steel", new Werkstoff.Stats().setCentrifuge(true), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().onlyDust().addMixerRecipes(), 97, TextureSet.SET_ROUGH, - new Pair<>(Materials.Steel ,2), - new Pair<>(Materials.VanadiumSteel,1), - new Pair<>(Materials.DamascusSteel,1) + new Pair<>(Materials.Steel, 2), + new Pair<>(Materials.VanadiumSteel, 1), + new Pair<>(Materials.DamascusSteel, 1) ); public static HashMap items = new HashMap<>(); @@ -1346,16 +1374,15 @@ public class WerkstoffLoader implements Runnable { public static Block BWOres; public static Block BWSmallOres; public static Block BWBlocks; - public boolean registered; + public static boolean registered; public static final HashSet ENABLED_ORE_PREFIXES = new HashSet<>(); - public static Werkstoff getWerkstoff(String Name){ - try{ + public static Werkstoff getWerkstoff(String Name) { + try { Field f = WerkstoffLoader.class.getField(Name); - if (f != null) - return (Werkstoff) f.get(null); + return (Werkstoff) f.get(null); } catch (IllegalAccessException | NoSuchFieldException | ClassCastException e) { - e.printStackTrace(); + MainMod.LOGGER.catching(e); } return Werkstoff.default_null_Werkstoff; } @@ -1364,7 +1391,7 @@ public class WerkstoffLoader implements Runnable { return WerkstoffLoader.getCorrespondingItemStack(orePrefixes, werkstoff, 1); } - private static ItemStack getCorrespondingItemStackUnsafe(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount){ + private static ItemStack getCorrespondingItemStackUnsafe(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { if (!werkstoff.getGenerationFeatures().enforceUnification) { ItemStack ret = OreDictHandler.getItemStack(werkstoff.getVarName(), orePrefixes, amount); if (ret != null) @@ -1375,7 +1402,7 @@ public class WerkstoffLoader implements Runnable { else if (orePrefixes == oreSmall) return new ItemStack(WerkstoffLoader.BWSmallOres, amount, werkstoff.getmID()); else if (orePrefixes == block) - return new ItemStack(WerkstoffLoader.BWBlocks,amount,werkstoff.getmID()); + return new ItemStack(WerkstoffLoader.BWBlocks, amount, werkstoff.getmID()); else if (WerkstoffLoader.items.get(orePrefixes) == null) return null; return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); @@ -1386,86 +1413,90 @@ public class WerkstoffLoader implements Runnable { if (stack != null) return stack; else - MainMod.LOGGER.catching(Level.ERROR,new Exception("NO SUCH ITEM! "+orePrefixes+werkstoff.getVarName() +" If you encounter this as a user, make sure to contact the authors of the pack/the mods you're playing! " + - "If you are a Developer, you forgot to enable "+orePrefixes+" OrePrefix for Werkstoff "+werkstoff.getDefaultName())); + MainMod.LOGGER.catching(Level.ERROR, new Exception("NO SUCH ITEM! " + orePrefixes + werkstoff.getVarName() + " If you encounter this as a user, make sure to contact the authors of the pack/the mods you're playing! " + + "If you are a Developer, you forgot to enable " + orePrefixes + " OrePrefix for Werkstoff " + werkstoff.getDefaultName())); return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); } - public void init() { - if (WerkstoffLoader.INSTANCE == null) { - MainMod.LOGGER.error("INSTANCE IS NULL THIS SHOULD NEVER HAPPEN!"); - FMLCommonHandler.instance().exitJava(1,true); - } - GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.purify.2","Throw into Cauldron to get clean crushed Ore"); - } - - public void runInit() { + public static void runInit() { MainMod.LOGGER.info("Making Meta Items for BW Materials"); long timepre = System.nanoTime(); - WerkstoffAdderRegistry.getINSTANCE().run(); - this.addSubTags(); - this.addItemsForGeneration(); - this.runAdditionalOreDict(); + WerkstoffAdderRegistry.run(); + addSubTags(); + addItemsForGeneration(); + runAdditionalOreDict(); long timepost = System.nanoTime(); MainMod.LOGGER.info("Making Meta Items for BW Materials took " + (timepost - timepre) + "ns/" + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); } - @Override - public void run() { - if (!this.registered) { + public static void run() { + if (!registered) { MainMod.LOGGER.info("Loading Processing Recipes for BW Materials"); long timepre = System.nanoTime(); - ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashSet.size()+1); - DebugLog.log("Loading Recipes"+(System.nanoTime()-timepre)); + ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashSet.size() + 1); + DebugLog.log("Loading Recipes" + (System.nanoTime() - timepre)); + + Integer[] clsArr = new Integer[0]; + int size = 0; + if (LoaderReference.betterloadingscreen) + clsArr = CLSCompat.initCls(); for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { long timepreone = System.nanoTime(); - DebugLog.log("Werkstoff is null or id < 0 ? "+ (werkstoff==null || werkstoff.getmID() < 0) + " " + (System.nanoTime()-timepreone)); + DebugLog.log("Werkstoff is null or id < 0 ? " + (werkstoff == null || werkstoff.getmID() < 0) + " " + (System.nanoTime() - timepreone)); if (werkstoff == null || werkstoff.getmID() < 0) { progressBar.step(""); continue; } - DebugLog.log("Werkstoff: "+ werkstoff.getDefaultName() +" " +(System.nanoTime()-timepreone)); - DebugLog.log("Loading Dusts Recipes"+" " +(System.nanoTime()-timepreone)); - this.addDustRecipes(werkstoff); - DebugLog.log("Loading Gem Recipes"+" " +(System.nanoTime()-timepreone)); - this.addGemRecipes(werkstoff); - DebugLog.log("Loading Ore Recipes"+" " +(System.nanoTime()-timepreone)); - this.addOreRecipes(werkstoff); - DebugLog.log("Loading Crushed Recipes"+" " +(System.nanoTime()-timepreone)); - this.addCrushedRecipes(werkstoff); - DebugLog.log("Loading Cell Recipes"+" " +(System.nanoTime()-timepreone)); - this.addCellRecipes(werkstoff); - DebugLog.log("Loading Meltdown Recipes"+" " +(System.nanoTime()-timepreone)); - this.addMoltenRecipes(werkstoff); - DebugLog.log("Loading Simple MetalWorking Recipes"+" " +(System.nanoTime()-timepreone)); - this.addSimpleMetalRecipes(werkstoff); - DebugLog.log("Loading Crafting MetalWorking Recipes"+" " +(System.nanoTime()-timepreone)); - this.addCraftingMetalRecipes(werkstoff); - DebugLog.log("Loading MultipleIngots MetalWorking Recipes"+" " +(System.nanoTime()-timepreone)); - this.addMultipleMetalRecipes(werkstoff); - DebugLog.log("Loading Metal Recipes"+" " +(System.nanoTime()-timepreone)); - this.addMetalRecipes(werkstoff); - DebugLog.log("Loading Tool Recipes"+" " +(System.nanoTime()-timepreone)); - this.addTools(werkstoff); - if (Loader.isModLoaded("Thaumcraft")) { - DebugLog.log("Loading Aspects"+" " +(System.nanoTime()-timepreone)); - ThaumcraftHandler.AspectAdder.addAspectToAll(werkstoff); + if (LoaderReference.betterloadingscreen) + size = CLSCompat.invokeStepSize(werkstoff, clsArr, size); + DebugLog.log("Werkstoff: " + werkstoff.getDefaultName() + " " + (System.nanoTime() - timepreone)); + DebugLog.log("Loading Dusts Recipes" + " " + (System.nanoTime() - timepreone)); + addDustRecipes(werkstoff); + DebugLog.log("Loading Gem Recipes" + " " + (System.nanoTime() - timepreone)); + addGemRecipes(werkstoff); + DebugLog.log("Loading Ore Recipes" + " " + (System.nanoTime() - timepreone)); + addOreRecipes(werkstoff); + DebugLog.log("Loading Crushed Recipes" + " " + (System.nanoTime() - timepreone)); + addCrushedRecipes(werkstoff); + DebugLog.log("Loading Cell Recipes" + " " + (System.nanoTime() - timepreone)); + addCellRecipes(werkstoff); + DebugLog.log("Loading Meltdown Recipes" + " " + (System.nanoTime() - timepreone)); + addMoltenRecipes(werkstoff); + DebugLog.log("Loading Simple MetalWorking Recipes" + " " + (System.nanoTime() - timepreone)); + addSimpleMetalRecipes(werkstoff); + DebugLog.log("Loading Crafting MetalWorking Recipes" + " " + (System.nanoTime() - timepreone)); + addCraftingMetalRecipes(werkstoff); + DebugLog.log("Loading MultipleIngots MetalWorking Recipes" + " " + (System.nanoTime() - timepreone)); + addMultipleMetalRecipes(werkstoff); + DebugLog.log("Loading Metal Recipes" + " " + (System.nanoTime() - timepreone)); + addMetalRecipes(werkstoff); + DebugLog.log("Loading Block Recipes" + " " + (System.nanoTime() - timepreone)); + addBlockRecipes(werkstoff); + DebugLog.log("Loading Tool Recipes" + " " + (System.nanoTime() - timepreone)); + addTools(werkstoff); + if (LoaderReference.Thaumcraft) { + DebugLog.log("Loading Aspects" + " " + (System.nanoTime() - timepreone)); + addAspectToAll(werkstoff); } - DebugLog.log("Loading New Circuits"+" " +(System.nanoTime()-timepreone)); - new BW_CircuitsLoader(); - DebugLog.log("Done"+" " +(System.nanoTime()-timepreone)); + DebugLog.log("Loading New Circuits" + " " + (System.nanoTime() - timepreone)); + BW_CircuitsLoader.initNewCircuits(); + DebugLog.log("Done" + " " + (System.nanoTime() - timepreone)); progressBar.step(werkstoff.getDefaultName()); } + + if (LoaderReference.betterloadingscreen) + CLSCompat.disableCls(); + progressBar.step("Load Additional Recipes"); - new AdditionalRecipes().run(); + AdditionalRecipes.run(); ProgressManager.pop(progressBar); long timepost = System.nanoTime(); MainMod.LOGGER.info("Loading Processing Recipes for BW Materials took " + (timepost - timepre) + "ns/" + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); - this.registered = true; + registered = true; } } - private void addSubTags() { + private static void addSubTags() { WerkstoffLoader.CubicZirconia.getStats().setDurOverride(Materials.Diamond.mDurability); WerkstoffLoader.HDCS.getStats().setSpeedOverride(Materials.HSSS.mToolSpeed); @@ -1474,9 +1505,9 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.Neon.add(WerkstoffLoader.NOBLE_GAS); Materials.Argon.add(WerkstoffLoader.NOBLE_GAS); WerkstoffLoader.Krypton.add(WerkstoffLoader.NOBLE_GAS); - WerkstoffLoader.Xenon.add(WerkstoffLoader.NOBLE_GAS,WerkstoffLoader.ANAEROBE_GAS); + WerkstoffLoader.Xenon.add(WerkstoffLoader.NOBLE_GAS, WerkstoffLoader.ANAEROBE_GAS); Materials.Radon.add(WerkstoffLoader.NOBLE_GAS); - WerkstoffLoader.Oganesson.add(WerkstoffLoader.NOBLE_GAS,WerkstoffLoader.ANAEROBE_GAS); + WerkstoffLoader.Oganesson.add(WerkstoffLoader.NOBLE_GAS, WerkstoffLoader.ANAEROBE_GAS); Materials.Nitrogen.add(WerkstoffLoader.ANAEROBE_GAS); @@ -1490,7 +1521,7 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.MagnetoResonaticDust.add(WerkstoffLoader.NO_BLAST); //Calcium Smelting block - Materials.Calcium.mBlastFurnaceRequired=true; + Materials.Calcium.mBlastFurnaceRequired = true; Materials.Salt.mDurability = WerkstoffLoader.Salt.getDurability(); Materials.Spodumene.mDurability = WerkstoffLoader.Spodumen.getDurability(); @@ -1521,17 +1552,18 @@ public class WerkstoffLoader implements Runnable { break; } } - if (W.getGenerationFeatures().hasGems()) { + if (W.hasItemType(gem)) { W.add(SubTag.CRYSTAL); W.add(SubTag.CRYSTALLISABLE); } } } - public static int toGenerateGlobal; - private void addItemsForGeneration() { + public static long toGenerateGlobal; + + private static void addItemsForGeneration() { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000) != 0){ + if (werkstoff.hasItemType(cell)) { if (!FluidRegistry.isFluidRegistered(werkstoff.getDefaultName())) { DebugLog.log("Adding new Fluid: " + werkstoff.getDefaultName()); GT_Fluid fluid = (GT_Fluid) new GT_Fluid(werkstoff.getDefaultName(), "molten.autogenerated", werkstoff.getRGBA()).setGaseous(werkstoff.getStats().isGas()); @@ -1541,29 +1573,28 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.fluids.put(werkstoff, FluidRegistry.getFluid(werkstoff.getDefaultName())); } } - if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000000) != 0){ - if (!FluidRegistry.isFluidRegistered("molten."+werkstoff.getDefaultName())) { + if (werkstoff.hasItemType(cellMolten)) { + if (!FluidRegistry.isFluidRegistered("molten." + werkstoff.getDefaultName())) { DebugLog.log("Adding new Molten: " + werkstoff.getDefaultName()); Fluid fluid = new GT_Fluid("molten." + werkstoff.getDefaultName(), "molten.autogenerated", werkstoff.getRGBA()); if (werkstoff.getStats().meltingPoint > 0) fluid = fluid.setTemperature(werkstoff.getStats().meltingPoint); FluidRegistry.registerFluid(fluid); //GT_LanguageManager.addStringLocalization("Molten." + werkstoff.getDefaultName(), "Molten "+ werkstoff.getDefaultName()); - GT_LanguageManager.addStringLocalization(fluid.getUnlocalizedName(), "Molten "+ werkstoff.getDefaultName()); + GT_LanguageManager.addStringLocalization(fluid.getUnlocalizedName(), "Molten " + werkstoff.getDefaultName()); WerkstoffLoader.molten.put(werkstoff, fluid); } else { WerkstoffLoader.molten.put(werkstoff, FluidRegistry.getFluid(werkstoff.getDefaultName())); } } for (OrePrefixes p : values()) - if (!werkstoff.getGenerationFeatures().enforceUnification && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(),p,1) != null) { - DebugLog.log("Found: "+(p+werkstoff.getVarName())+" in oreDict, disable and reroute my Items to that, also add a Tooltip."); + if (!werkstoff.getGenerationFeatures().enforceUnification && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(), p, 1) != null) { + DebugLog.log("Found: " + (p + werkstoff.getVarName()) + " in oreDict, disable and reroute my Items to that, also add a Tooltip."); werkstoff.getGenerationFeatures().setBlacklist(p); } WerkstoffLoader.toGenerateGlobal = (WerkstoffLoader.toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); - //System.out.println(werkstoff.getDefaultName()+": "+werkstoff.getGenerationFeatures().toGenerate); } - DebugLog.log("GlobalGeneration: "+WerkstoffLoader.toGenerateGlobal); + DebugLog.log("GlobalGeneration: " + WerkstoffLoader.toGenerateGlobal); if ((WerkstoffLoader.toGenerateGlobal & 0b1) != 0) { WerkstoffLoader.items.put(dust, new BW_MetaGenerated_Items(dust)); WerkstoffLoader.items.put(dustTiny, new BW_MetaGenerated_Items(dustTiny)); @@ -1580,11 +1611,10 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.items.put(gemExquisite, new BW_MetaGenerated_Items(gemExquisite)); WerkstoffLoader.items.put(gemFlawed, new BW_MetaGenerated_Items(gemFlawed)); WerkstoffLoader.items.put(gemFlawless, new BW_MetaGenerated_Items(gemFlawless)); - WerkstoffLoader.items.put(lens,new BW_MetaGenerated_Items(lens)); + WerkstoffLoader.items.put(lens, new BW_MetaGenerated_Items(lens)); } if ((WerkstoffLoader.toGenerateGlobal & 0b1000) != 0) { - if (!ConfigHandler.experimentalThreadedLoader) - this.gameRegistryHandler(); + gameRegistryHandler(); WerkstoffLoader.items.put(crushed, new BW_MetaGenerated_Items(crushed)); WerkstoffLoader.items.put(crushedPurified, new BW_MetaGenerated_Items(crushedPurified)); WerkstoffLoader.items.put(crushedCentrifuged, new BW_MetaGenerated_Items(crushedCentrifuged)); @@ -1594,7 +1624,7 @@ public class WerkstoffLoader implements Runnable { if ((WerkstoffLoader.toGenerateGlobal & 0b10000) != 0) { WerkstoffLoader.items.put(cell, new BW_MetaGenerated_Items(cell)); //WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle)); - if (Loader.isModLoaded("Forestry")) + if (LoaderReference.Forestry) WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); } if ((WerkstoffLoader.toGenerateGlobal & 0b100000) != 0) { @@ -1602,7 +1632,7 @@ public class WerkstoffLoader implements Runnable { } if ((WerkstoffLoader.toGenerateGlobal & 0b1000000) != 0) { WerkstoffLoader.items.put(WerkstoffLoader.cellMolten, new BW_MetaGenerated_Items(WerkstoffLoader.cellMolten)); - if (Loader.isModLoaded("Forestry")) + if (LoaderReference.Forestry) WerkstoffLoader.items.put(capsuleMolten, new BW_MetaGenerated_Items(capsuleMolten)); } if ((WerkstoffLoader.toGenerateGlobal & 0b10000000) != 0) { @@ -1641,19 +1671,19 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.runGTItemDataRegistrator(); } - void gameRegistryHandler(){ - if (FMLCommonHandler.instance().getSide().isClient()) + static void gameRegistryHandler() { + if (SideReference.Side.Client) RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); GameRegistry.registerTileEntity(BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmallTE"); GameRegistry.registerTileEntity(BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblockTE"); WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); WerkstoffLoader.BWSmallOres = new BW_MetaGenerated_SmallOres(Material.rock, BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmall"); - WerkstoffLoader.BWBlocks = new BW_MetaGenerated_WerkstoffBlocks(Material.iron,BW_MetaGenerated_WerkstoffBlock_TE.class,"bw.werkstoffblocks"); + WerkstoffLoader.BWBlocks = new BW_MetaGenerated_WerkstoffBlocks(Material.iron, BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblocks"); GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.01"); GameRegistry.registerBlock(WerkstoffLoader.BWSmallOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.02"); GameRegistry.registerBlock(WerkstoffLoader.BWBlocks, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblocks.01"); - new GTMetaItemEnhancer(); + GTMetaItemEnhancer.init(); } private static void runGTItemDataRegistrator() { @@ -1675,7 +1705,7 @@ public class WerkstoffLoader implements Runnable { werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials = new ArrayList<>(); e.mLinkedMaterials.add(werkstoffBridgeMaterial); - if (((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) == 0 && werkstoff.get(dust) != null && werkstoff.get(dust).getItem() != null)) { + if (werkstoff.hasItemType(dust)) { GT_OreDictUnificator.addAssociation(dust, werkstoffBridgeMaterial, werkstoff.get(dust), false); GT_OreDictUnificator.set(dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true); } @@ -1693,7 +1723,7 @@ public class WerkstoffLoader implements Runnable { // } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { // e.printStackTrace(); // } - if (((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(dust)) == 0 && werkstoff.get(dust) != null && werkstoff.get(dust).getItem() != null)) { + if (werkstoff.hasItemType(dust)) { ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); @@ -1703,14 +1733,14 @@ public class WerkstoffLoader implements Runnable { } } - if (werkstoff.getGenerationFeatures().hasCells()) { + if (werkstoff.hasItemType(cell)) { werkstoffBridgeMaterial.setHasCorrespondingFluid(true); werkstoffBridgeMaterial.setHasCorrespondingGas(true); werkstoffBridgeMaterial.mFluid = werkstoff.getFluidOrGas(1).getFluid(); werkstoffBridgeMaterial.mGas = werkstoff.getFluidOrGas(1).getFluid(); } - if (werkstoff.getGenerationFeatures().hasMolten()) { + if (werkstoff.hasItemType(cellMolten)) { werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid(); } werkstoffBridgeMaterial.mName = werkstoff.getVarName(); @@ -1721,7 +1751,7 @@ public class WerkstoffLoader implements Runnable { } catch (NoSuchFieldException | IllegalAccessException ignored) { } werkstoffBridgeMaterial.mChemicalFormula = werkstoff.getToolTip(); - if (Loader.isModLoaded("Thaumcraft")) + if (LoaderReference.Thaumcraft) werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects(); werkstoffBridgeMaterial.mMaterialInto = werkstoffBridgeMaterial; werkstoffBridgeMaterial.mHandleMaterial = werkstoff.contains(SubTag.BURNING) ? Materials.Blaze : werkstoff.contains(SubTag.MAGICAL) ? Materials.Thaumium : werkstoffBridgeMaterial.mDurability > 5120 ? Materials.TungstenSteel : werkstoffBridgeMaterial.mDurability > 1280 ? Materials.Steel : Materials.Wood; @@ -1739,23 +1769,24 @@ public class WerkstoffLoader implements Runnable { } public static void addAssociationToItems() { - Arrays.stream(values()).forEach( prefixes -> + Arrays.stream(values()).forEach(prefixes -> Werkstoff.werkstoffHashSet.stream() - .filter(werkstoff -> werkstoff.hasItemType(prefixes) && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(prefixes)) == 0) - .forEach(werkstoff -> { - Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial(); - ItemStack stack = WerkstoffLoader.getCorrespondingItemStackUnsafe(prefixes, werkstoff, 1); - if (stack != null && stack.getItem() != null) { - GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, stack, false); - GT_OreDictUnificator.set(prefixes, werkstoffBridgeMaterial, stack, true, true); - } - })); + .filter(werkstoff -> werkstoff.hasItemType(prefixes)) + .forEach(werkstoff -> { + Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial(); + ItemStack stack = WerkstoffLoader.getCorrespondingItemStackUnsafe(prefixes, werkstoff, 1); + + if (stack != null && stack.getItem() != null) { + GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, stack, false); + GT_OreDictUnificator.set(prefixes, werkstoffBridgeMaterial, stack, true, true); + } + })); } /** - * very hacky way to make my ores/blocks/smallores detectable by gt assosication in world, well at least the prefix. - * used for the miners mostly - * removing this hacky material from the materials map instantly. we only need the item data. + * very hacky way to make my ores/blocks/smallores detectable by gt assosication in world, well at least the prefix. + * used for the miners mostly + * removing this hacky material from the materials map instantly. we only need the item data. */ private static void addFakeItemDataToInWorldBlocksAndCleanUpFakeData() { @@ -1772,14 +1803,14 @@ public class WerkstoffLoader implements Runnable { if (MATERIALS_MAP == null) throw new NullPointerException("MATERIALS_MAP null!"); - Materials oreMat = new Materials(-1,null,0,0,0,false,"bwores","bwores",null,true,null); - Materials smallOreMat = new Materials(-1,null,0,0,0,false,"bwsmallores","bwsmallores",null,true,null); - Materials blockMat = new Materials(-1,null,0,0,0,false,"bwblocks","bwblocks",null,true,null); + Materials oreMat = new Materials(-1, null, 0, 0, 0, false, "bwores", "bwores", null, true, null); + Materials smallOreMat = new Materials(-1, null, 0, 0, 0, false, "bwsmallores", "bwsmallores", null, true, null); + Materials blockMat = new Materials(-1, null, 0, 0, 0, false, "bwblocks", "bwblocks", null, true, null); for (int i = 0; i < 16; i++) { - GT_OreDictUnificator.addAssociation(ore, oreMat, new ItemStack(BWOres,1,i), true); - GT_OreDictUnificator.addAssociation(oreSmall, smallOreMat, new ItemStack(BWSmallOres,1,i), true); - GT_OreDictUnificator.addAssociation(block, blockMat, new ItemStack(BWBlocks,1,i), true); + GT_OreDictUnificator.addAssociation(ore, oreMat, new ItemStack(BWOres, 1, i), true); + GT_OreDictUnificator.addAssociation(oreSmall, smallOreMat, new ItemStack(BWSmallOres, 1, i), true); + GT_OreDictUnificator.addAssociation(block, blockMat, new ItemStack(BWBlocks, 1, i), true); } MATERIALS_MAP.remove("bwores"); @@ -1787,68 +1818,78 @@ public class WerkstoffLoader implements Runnable { MATERIALS_MAP.remove("bwblocks"); } - private void addTools(Werkstoff werkstoff){ + private static void addTools(Werkstoff werkstoff) { if (werkstoff.getBridgeMaterial().mDurability == 0) return; - if (werkstoff.getGenerationFeatures().hasGems()){ - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', OrePrefixes.gem.get(werkstoff.getBridgeMaterial()), 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"GGf", 'G', OrePrefixes.gem.get(werkstoff.getBridgeMaterial())}); + if (werkstoff.hasItemType(gem)) { + if (!werkstoff.getGenerationFeatures().isExtension()) + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', gem.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"GGf", 'G', gem.get(werkstoff.getBridgeMaterial())}); } - if (!werkstoff.getGenerationFeatures().hasSimpleMetalWorkingItems()) + if (!werkstoff.hasItemType(plate)) return; - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.PLUNGER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"xRR", " SR", "S f", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'R', OrePrefixes.plate.get(Materials.AnyRubber)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', OrePrefixes.ingot.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"hDS", "DSD", "SDf", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'D', Dyes.dyeBlue}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{" fS", " Sh", "W ", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'W', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WIRECUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "hPd", "STS", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'T', OrePrefixes.screw.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCOOP, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SWS", "SSS", "xSh", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'W', new ItemStack(Blocks.wool, 1, 32767)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BRANCHCUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "PdP", "STS", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'T', OrePrefixes.screw.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.KNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"fPh", " S ", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PPf", "PP ", "Sh ", 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', OrePrefixes.bolt.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(Materials.AnyRubber), 'S', OrePrefixes.stick.get(Materials.Iron), 'L', ItemList.Battery_RE_LV_Lithium.get(1L)}); - if (gtnhGT) { - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(162, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', OrePrefixes.bolt.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(Materials.AnyRubber), 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_MV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(164, 1, werkstoff.getBridgeMaterial(), Materials.StyreneButadieneRubber, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', OrePrefixes.bolt.get(werkstoff.getBridgeMaterial()), 'P', OrePrefixes.plate.get(Materials.StyreneButadieneRubber), 'S', OrePrefixes.stick.get(Materials.StainlessSteel), 'L', ItemList.Battery_RE_HV_Lithium.get(1L)}); - } - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01. WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{ 800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); - - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{ 50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); - if (gtnhGT) { - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{ 200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', OrePrefixes.screw.get(Materials.Titanium ), 'P', OrePrefixes.plate.get(Materials.Titanium ), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium ), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{ 800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', OrePrefixes.stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', OrePrefixes.screw.get(Materials.TungstenSteel ), 'P', OrePrefixes.plate.get(Materials.TungstenSteel ), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel ), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); - } - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"II ", "IIh", "II ", 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'I', OrePrefixes.ingot.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadWrench, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"hXW", "XRX", "WXd", 'X', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'S', OrePrefixes.plate.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'R', OrePrefixes.ring.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'W', OrePrefixes.screw.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - - GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{toolHeadHammer.get(werkstoff.getBridgeMaterial()), OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + //Disable recipe gen with handle Material for GT Materials + if (!werkstoff.getGenerationFeatures().isExtension()) { + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{" fS", " Sh", "W ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadWrench, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"hXW", "XRX", "WXd", 'X', plate.get(werkstoff.getBridgeMaterial()), 'S', plate.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'R', ring.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'W', screw.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{toolHeadHammer.get(werkstoff.getBridgeMaterial()), stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.FILE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P", "P", "S", 'P', plate.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SAW, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), new Object[]{toolHeadSaw.get(werkstoff.getBridgeMaterial()), stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.AnyRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_LV_Lithium.get(1L)}); + + if (gtnhGT) { + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(162, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.AnyRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_MV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(164, 1, werkstoff.getBridgeMaterial(), Materials.StyreneButadieneRubber, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.StyreneButadieneRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_HV_Lithium.get(1L)}); + } - if (!werkstoff.getGenerationFeatures().hasGems()) { - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', OrePrefixes.ingot.get(werkstoff.getBridgeMaterial()), 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"PP ", "fh ", 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'I', OrePrefixes.ingot.get(werkstoff.getBridgeMaterial())}); + if (!werkstoff.hasItemType(gem)) { + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', ingot.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + } } - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.FILE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P", "P", "S", 'P', OrePrefixes.plate.get(werkstoff.getBridgeMaterial()), 'S', OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.PLUNGER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"xRR", " SR", "S f", 'S', stick.get(werkstoff.getBridgeMaterial()), 'R', plate.get(Materials.AnyRubber)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', ingot.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"hDS", "DSD", "SDf", 'S', stick.get(werkstoff.getBridgeMaterial()), 'D', Dyes.dyeBlue}); + + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WIRECUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "hPd", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCOOP, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SWS", "SSS", "xSh", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', new ItemStack(Blocks.wool, 1, 32767)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BRANCHCUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "PdP", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.KNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"fPh", " S ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PPf", "PP ", "Sh ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial())}); + + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); + + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); + + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"II ", "IIh", "II ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', ingot.get(werkstoff.getBridgeMaterial())}); + + if (!werkstoff.hasItemType(gem)) { + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"PP ", "fh ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', ingot.get(werkstoff.getBridgeMaterial())}); + } - GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SAW, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), new Object[]{toolHeadSaw.get(werkstoff.getBridgeMaterial()), OrePrefixes.stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + if (gtnhGT) { + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); + } - // GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(16,1, werkstoff.getBridgeMaterial(),werkstoff.getBridgeMaterial(),null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', werkstoff.get(OrePrefixes.ingot)}); + // GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(16,1, werkstoff.getBridgeMaterial(),werkstoff.getBridgeMaterial(),null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', werkstoff.get(ingot)}); } public static void removeIC2Recipes() { @@ -1859,67 +1900,52 @@ public class WerkstoffLoader implements Runnable { if (((RecipeInputOreDict) curr.getKey()).input.equalsIgnoreCase("oreNULL")) { remset.add(curr); } - for (ItemStack stack : curr.getValue().items){ + for (ItemStack stack : curr.getValue().items) { if (stack.getItem() instanceof BW_MetaGenerated_Items) remset.add(curr); } } } Recipes.macerator.getRecipes().entrySet().removeAll(remset); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } } - private void runAdditionalOreDict(){ - if (ConfigHandler.experimentalThreadedLoader){ - for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - if (werkstoff.getGenerationFeatures().hasOres()) - OreDictAdder.addToMap(new Pair<>(ore + werkstoff.getVarName(), werkstoff.get(ore))); - if (werkstoff.getGenerationFeatures().hasGems()) - OreDictAdder.addToMap(new Pair<>("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens))); - if (werkstoff.getADDITIONAL_OREDICT().size() > 0) - werkstoff.getADDITIONAL_OREDICT() - .forEach(s -> ENABLED_ORE_PREFIXES - .stream() - .filter(o -> Objects.nonNull(werkstoff.get(o))) - .forEach( od -> OreDictionary.registerOre(od+s, werkstoff.get(od)))); - } - OreDictAdder.addToMap(new Pair<>("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite))); - } else { - for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - if (werkstoff.getGenerationFeatures().hasOres()) { - GT_OreDictUnificator.registerOre(ore + werkstoff.getVarName(), werkstoff.get(ore)); - GT_OreDictUnificator.registerOre(oreSmall + werkstoff.getVarName(), werkstoff.get(oreSmall)); - werkstoff.getADDITIONAL_OREDICT().forEach( e -> OreDictionary.registerOre(ore+e, werkstoff.get(ore))); - werkstoff.getADDITIONAL_OREDICT().forEach( e -> OreDictionary.registerOre(oreSmall+e, werkstoff.get(oreSmall))); - } + private static void runAdditionalOreDict() { - if (werkstoff.getGenerationFeatures().hasGems()) - OreDictionary.registerOre("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens)); + for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { + if (werkstoff.hasItemType(ore)) { + GT_OreDictUnificator.registerOre(ore + werkstoff.getVarName(), werkstoff.get(ore)); + GT_OreDictUnificator.registerOre(oreSmall + werkstoff.getVarName(), werkstoff.get(oreSmall)); + werkstoff.getADDITIONAL_OREDICT().forEach(e -> OreDictionary.registerOre(ore + e, werkstoff.get(ore))); + werkstoff.getADDITIONAL_OREDICT().forEach(e -> OreDictionary.registerOre(oreSmall + e, werkstoff.get(oreSmall))); + } - if (werkstoff.getGenerationFeatures().hasGems() || (werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0){ - GT_OreDictUnificator.registerOre(block + werkstoff.getVarName(), werkstoff.get(block)); - werkstoff.getADDITIONAL_OREDICT().forEach( e -> OreDictionary.registerOre(block+e, werkstoff.get(block))); - } + if (werkstoff.hasItemType(gem)) + OreDictionary.registerOre("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens)); - werkstoff.getADDITIONAL_OREDICT() - .forEach(s -> ENABLED_ORE_PREFIXES - .stream() - .filter(o -> Objects.nonNull(werkstoff.get(o))) - .forEach(od -> OreDictionary.registerOre(od+s, werkstoff.get(od)))); + if (werkstoff.hasItemType(gem) || werkstoff.hasItemType(ingot)) { + GT_OreDictUnificator.registerOre(block + werkstoff.getVarName(), werkstoff.get(block)); + werkstoff.getADDITIONAL_OREDICT().forEach(e -> OreDictionary.registerOre(block + e, werkstoff.get(block))); } - GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite)); + werkstoff.getADDITIONAL_OREDICT() + .forEach(s -> ENABLED_ORE_PREFIXES + .stream() + .filter(o -> Objects.nonNull(werkstoff.get(o))) + .forEach(od -> OreDictionary.registerOre(od + s, werkstoff.get(od)))); } + + GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite)); } - private void addGemRecipes(Werkstoff werkstoff) { - if (werkstoff.getGenerationFeatures().hasGems()) { - if (werkstoff.getGenerationFeatures().hasSifterRecipes() || ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0)) { + private static void addGemRecipes(Werkstoff werkstoff) { + if (werkstoff.hasItemType(gem)) { + if (werkstoff.getGenerationFeatures().hasSifterRecipes() || (werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust))) { GT_ModHandler.addCompressionRecipe(werkstoff.get(gem, 9), werkstoff.get(block)); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(block),werkstoff.get(gem, 9), 100, 24); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(block), werkstoff.get(gem, 9), 100, 24); GT_Values.RA.addSifterRecipe( werkstoff.get(crushedPurified), new ItemStack[]{ @@ -1966,7 +1992,6 @@ public class WerkstoffLoader implements Runnable { if (werkstoff.hasItemType(plate)) { GT_Values.RA.addLatheRecipe(werkstoff.get(plate), werkstoff.get(lens), werkstoff.get(dustSmall), 1200, 120); - GT_Values.RA.addCutterRecipe(werkstoff.get(block), werkstoff.get(plate,9), null, (int) Math.max(werkstoff.getStats().getMass() * 10L, 1L), 30); } GT_Values.RA.addLatheRecipe(werkstoff.get(gemExquisite), werkstoff.get(lens), werkstoff.get(dust, 2), 2400, 30); @@ -1983,13 +2008,21 @@ public class WerkstoffLoader implements Runnable { } } - private void addSimpleMetalRecipes(Werkstoff werkstoff) { + private static void addSimpleMetalRecipes(Werkstoff werkstoff) { if (werkstoff.hasItemType(plate)) { if (werkstoff.hasItemType(gem)) { - GT_Values.RA.addLatheRecipe(werkstoff.get(gem), werkstoff.get(stick), werkstoff.get(dustSmall,2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); + GT_Values.RA.addLatheRecipe(werkstoff.get(gem), werkstoff.get(stick), werkstoff.get(dustSmall, 2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)}); GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(gem)}); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); + + TextureSet texSet = werkstoff.getTexSet(); + GT_RenderedTexture texture = SideReference.Side.Client ? + new GT_RenderedTexture(texSet.mTextures[PrefixTextureLinker.blockTexMap.getOrDefault(texSet, block.mTextureIndex)], werkstoff.getRGBA(), false) : + new GT_RenderedTexture(texSet.mTextures[block.mTextureIndex], werkstoff.getRGBA(), false); + GregTech_API.registerCover(werkstoff.get(plate),texture,null); + + GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); return; } @@ -1997,73 +2030,73 @@ public class WerkstoffLoader implements Runnable { GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(ingot)}); GT_ModHandler.addCraftingRecipe(werkstoff.get(plate), GT_Proxy.tBits, new Object[]{"h", "X", "X", 'X', werkstoff.get(ingot)}); - GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{werkstoff.get(ingot),GT_Utility.getIntegratedCircuit(1)},new ItemStack[]{werkstoff.get(plate)},null,null,null,null, (int) Math.max(werkstoff.getStats().getMass(), 1L), 24,0)); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ingot,3), werkstoff.get(plate,2), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); + GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(1)}, new ItemStack[]{werkstoff.get(plate)}, null, null, null, null, (int) Math.max(werkstoff.getStats().getMass(), 1L), 24, 0)); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ingot, 3), werkstoff.get(plate, 2), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); GregTech_API.registerCover(werkstoff.get(plate), new GT_RenderedTexture(werkstoff.getTexSet().mTextures[71], werkstoff.getRGBA(), false), null); - GT_Values.RA.addLatheRecipe(werkstoff.get(ingot), werkstoff.get(stick), werkstoff.get(dustSmall,2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); + GT_Values.RA.addLatheRecipe(werkstoff.get(ingot), werkstoff.get(stick), werkstoff.get(dustSmall, 2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot),ItemList.Shape_Extruder_Plate.get(0),werkstoff.get(plate),(int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot),ItemList.Shape_Extruder_Rod.get(0),werkstoff.get(stick,2),(int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Plate.get(0), werkstoff.get(plate), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Rod.get(0), werkstoff.get(stick, 2), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(ingot),new ItemStack[]{werkstoff.get(dust)},null,2,8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate),new ItemStack[]{werkstoff.get(dust)},null,2,8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(stickLong),new ItemStack[]{werkstoff.get(dust)},null,2,8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(stick),new ItemStack[]{werkstoff.get(dustSmall,2)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(ingot), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(stickLong), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(stick), new ItemStack[]{werkstoff.get(dustSmall, 2)}, null, 2, 8); } } - private void addCraftingMetalRecipes(Werkstoff werkstoff) { - if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(screw)) != 0) { + private static void addCraftingMetalRecipes(Werkstoff werkstoff) { + if (werkstoff.hasItemType(screw)) { int tVoltageMultiplier = werkstoff.getStats().meltingPoint >= 2800 ? 60 : 15; //bolt - GT_Values.RA.addExtruderRecipe(werkstoff.getGenerationFeatures().hasGems() ? werkstoff.get(gem) : werkstoff.get(ingot), ItemList.Shape_Extruder_Bolt.get(0L), werkstoff.get(bolt,8), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 8 * tVoltageMultiplier); - GT_Values.RA.addCutterRecipe(werkstoff.get(stick), werkstoff.get(bolt,4), null, (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 4); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(bolt),new ItemStack[]{werkstoff.get(dustTiny,1)},null,2,8); + GT_Values.RA.addExtruderRecipe(werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(ingot), ItemList.Shape_Extruder_Bolt.get(0L), werkstoff.get(bolt, 8), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 8 * tVoltageMultiplier); + GT_Values.RA.addCutterRecipe(werkstoff.get(stick), werkstoff.get(bolt, 4), null, (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 4); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(bolt), new ItemStack[]{werkstoff.get(dustTiny, 1)}, null, 2, 8); //screw - GT_Values.RA.addLatheRecipe(werkstoff.get(bolt), werkstoff.get(screw),null, (int) Math.max(werkstoff.getStats().getMass() / 8L, 1L), 4); + GT_Values.RA.addLatheRecipe(werkstoff.get(bolt), werkstoff.get(screw), null, (int) Math.max(werkstoff.getStats().getMass() / 8L, 1L), 4); GT_ModHandler.addCraftingRecipe(werkstoff.get(screw), GT_Proxy.tBits, new Object[]{"fX", "X ", 'X', werkstoff.get(bolt)}); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(screw),new ItemStack[]{werkstoff.get(dustTiny,1)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(screw), new ItemStack[]{werkstoff.get(dustTiny, 1)}, null, 2, 8); - if (werkstoff.getGenerationFeatures().hasGems()) + if (werkstoff.hasItemType(gem)) return; //ring - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Ring.get(0L), werkstoff.get(ring,4), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 6 * tVoltageMultiplier); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Ring.get(0L), werkstoff.get(ring, 4), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 6 * tVoltageMultiplier); GT_ModHandler.addCraftingRecipe(werkstoff.get(ring), GT_Proxy.tBits, new Object[]{"h ", "fX", 'X', werkstoff.get(stick)}); //Gear GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGt), GT_Proxy.tBits, new Object[]{"SPS", "PwP", "SPS", 'P', werkstoff.get(plate), 'S', werkstoff.get(stick)}); - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot,4), ItemList.Shape_Extruder_Gear.get(0L), werkstoff.get(gearGt), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1), 8 * tVoltageMultiplier); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 4), ItemList.Shape_Extruder_Gear.get(0L), werkstoff.get(gearGt), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1), 8 * tVoltageMultiplier); //wireFine - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Wire.get(0L), werkstoff.get(wireFine,8), (int) Math.max(werkstoff.getStats().getMass() * 1.5F, 1F), 8 * tVoltageMultiplier); - GT_Values.RA.addWiremillRecipe(werkstoff.get(ingot), werkstoff.get(wireFine,8), (int) Math.max(werkstoff.getStats().getMass(), 1), 8 * tVoltageMultiplier); - GT_Values.RA.addWiremillRecipe(werkstoff.get(stick), werkstoff.get(wireFine,4), (int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F), 8 * tVoltageMultiplier); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Wire.get(0L), werkstoff.get(wireFine, 8), (int) Math.max(werkstoff.getStats().getMass() * 1.5F, 1F), 8 * tVoltageMultiplier); + GT_Values.RA.addWiremillRecipe(werkstoff.get(ingot), werkstoff.get(wireFine, 8), (int) Math.max(werkstoff.getStats().getMass(), 1), 8 * tVoltageMultiplier); + GT_Values.RA.addWiremillRecipe(werkstoff.get(stick), werkstoff.get(wireFine, 4), (int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F), 8 * tVoltageMultiplier); //smallGear if (WerkstoffLoader.smallGearShape != null) GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), WerkstoffLoader.smallGearShape.get(0L), werkstoff.get(gearGtSmall), (int) werkstoff.getStats().mass, 8 * tVoltageMultiplier); if (ConfigHandler.GTNH) - GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{" S ", "hPx"," S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{" S ", "hPx", " S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate)}); else - GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{"P "," h ", 'P', werkstoff.get(plate)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{"P ", " h ", 'P', werkstoff.get(plate)}); //Rotor GT_ModHandler.addCraftingRecipe(werkstoff.get(rotor), GT_Proxy.tBits, new Object[]{"PhP", "SRf", "PdP", 'P', werkstoff.get(plate), 'R', werkstoff.get(ring), 'S', werkstoff.get(screw)}); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate,4), werkstoff.get(ring), Materials.Tin.getMolten(32), werkstoff.get(rotor), 240, 24); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate,4), werkstoff.get(ring), Materials.Lead.getMolten(48), werkstoff.get(rotor), 240, 24); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate,4), werkstoff.get(ring), Materials.SolderingAlloy.getMolten(16), werkstoff.get(rotor), 240, 24); + GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.Tin.getMolten(32), werkstoff.get(rotor), 240, 24); + GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.Lead.getMolten(48), werkstoff.get(rotor), 240, 24); + GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.SolderingAlloy.getMolten(16), werkstoff.get(rotor), 240, 24); if (WerkstoffLoader.rotorShape != null) - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot,5), WerkstoffLoader.rotorShape.get(0L), werkstoff.get(rotor), 200, 60); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 5), WerkstoffLoader.rotorShape.get(0L), werkstoff.get(rotor), 200, 60); //molten -> metal - if (werkstoff.getGenerationFeatures().hasMolten()) { + if (werkstoff.hasItemType(cellMolten)) { GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear.get(0L), werkstoff.getMolten(576), werkstoff.get(gearGt), 128, 8); GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear_Small.get(0L), werkstoff.getMolten(144), werkstoff.get(gearGtSmall), 16, 8); if (WerkstoffLoader.ringMold != null) @@ -2075,31 +2108,45 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.rotorMold.get(0L), werkstoff.getMolten(612), werkstoff.get(rotor), 100, 60); } - GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGt),new ItemStack[]{werkstoff.get(dust,4)},null,2,8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGtSmall),new ItemStack[]{werkstoff.get(dust,1)},null,2,8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(rotor),new ItemStack[]{werkstoff.get(dust,4),werkstoff.get(dustSmall)},null,2,8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(ring),new ItemStack[]{werkstoff.get(dustSmall,1)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGt), new ItemStack[]{werkstoff.get(dust, 4)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGtSmall), new ItemStack[]{werkstoff.get(dust, 1)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(rotor), new ItemStack[]{werkstoff.get(dust, 4), werkstoff.get(dustSmall)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(ring), new ItemStack[]{werkstoff.get(dustSmall, 1)}, null, 2, 8); } } - private void addMetalRecipes(Werkstoff werkstoff) { - if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(ingot)) != 0) { + private static void addBlockRecipes(Werkstoff werkstoff) { + if (!werkstoff.hasItemType(block)) + return; + if (werkstoff.hasItemType(ingot)) { + GT_Values.RA.addArcFurnaceRecipe(werkstoff.get(block), new ItemStack[]{werkstoff.get(ingot, 9)}, null, 16, 90, false); + } + if (werkstoff.hasItemType(cellMolten)) { + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(block), null, werkstoff.getMolten(1296), 0, 288, 8); + } + if (werkstoff.hasItemType(plate)) { + GT_Values.RA.addCutterRecipe(werkstoff.get(block), werkstoff.get(plate, 9), null, (int) Math.max(werkstoff.getStats().getMass() * 10L, 1L), 30); + } + } + + private static void addMetalRecipes(Werkstoff werkstoff) { + if (werkstoff.hasItemType(ingot)) { GT_ModHandler.addCompressionRecipe(werkstoff.get(ingot, 9), werkstoff.get(block)); - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 9),ItemList.Shape_Extruder_Block.get(0), werkstoff.get(block), (int) werkstoff.getStats().mass, 8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); - GT_Values.RA.addAlloySmelterRecipe(werkstoff.get(ingot, 9), ItemList.Shape_Mold_Block.get(0L), werkstoff.get(block), (int) (werkstoff.getStats().mass/2), 4 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 9), ItemList.Shape_Extruder_Block.get(0), werkstoff.get(block), (int) werkstoff.getStats().mass, 8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); + GT_Values.RA.addAlloySmelterRecipe(werkstoff.get(ingot, 9), ItemList.Shape_Mold_Block.get(0L), werkstoff.get(block), (int) (werkstoff.getStats().mass / 2), 4 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); } } - private void addMultipleMetalRecipes(Werkstoff werkstoff){ - if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(plateDense)) != 0) { - GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{werkstoff.get(ingot,2),GT_Utility.getIntegratedCircuit(2)},new ItemStack[]{werkstoff.get(plateDouble)},null,null,null,null, (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), 60,0)); + private static void addMultipleMetalRecipes(Werkstoff werkstoff) { + if (werkstoff.hasItemType(plateDense)) { + GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{werkstoff.get(ingot, 2), GT_Utility.getIntegratedCircuit(2)}, new ItemStack[]{werkstoff.get(plateDouble)}, null, null, null, null, (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), 60, 0)); GregTech_API.registerCover(werkstoff.get(plateDouble), new GT_RenderedTexture(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false), null); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(plateDouble),new ItemStack[]{werkstoff.get(dust,2)},null,2,8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(plateDouble), new ItemStack[]{werkstoff.get(dust, 2)}, null, 2, 8); } } - private void addDustRecipes(Werkstoff werkstoff) { - if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0) { + private static void addDustRecipes(Werkstoff werkstoff) { + if (werkstoff.hasItemType(dust)) { List flOutputs = new ArrayList<>(); List stOutputs = new ArrayList<>(); HashMap> tracker = new HashMap<>(); @@ -2125,7 +2172,7 @@ public class WerkstoffLoader implements Runnable { cells += container.getValue(); } } else { - if (((Materials) container.getKey()).getDust(container.getValue()) == null ) { + if (((Materials) container.getKey()).getDust(container.getValue()) == null) { if (((Materials) container.getKey()).getCells(container.getValue()) != null && (((Materials) container.getKey()).getMolten(0) != null || ((Materials) container.getKey()).getSolid(0) != null)) { FluidStack tmpFl = ((Materials) container.getKey()).getMolten(1000 * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { @@ -2154,7 +2201,7 @@ public class WerkstoffLoader implements Runnable { } } } else if (container.getKey() instanceof Werkstoff) { - if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).getGenerationFeatures().hasCells()) { + if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) { FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); @@ -2171,8 +2218,8 @@ public class WerkstoffLoader implements Runnable { cells += container.getValue(); } } else { - if (!((Werkstoff) container.getKey()).getGenerationFeatures().hasDusts()) - continue; + if (!((Werkstoff) container.getKey()).hasItemType(dust)) + continue; if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); @@ -2192,22 +2239,22 @@ public class WerkstoffLoader implements Runnable { if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0)); - GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0); + GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); + GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); } if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0)); + GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); } } - GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{ - "TTT","TTT","TTT",'T', + GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{ + "TTT", "TTT", "TTT", 'T', werkstoff.get(dustTiny) }); - GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{ - "TT ","TT ",'T', + GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{ + "TT ", "TT ", 'T', WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff) }); GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff, 4), new Object[]{ @@ -2217,23 +2264,20 @@ public class WerkstoffLoader implements Runnable { "T ", 'T', werkstoff.get(dust) }); - GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny,9), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); - GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall,4), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); - GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny,9), ItemList.Schematic_3by3.get(0L), werkstoff.get(dust), 100, 4); - GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall,4), ItemList.Schematic_2by2.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny, 9), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall, 4), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny, 9), ItemList.Schematic_3by3.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall, 4), ItemList.Schematic_2by2.get(0L), werkstoff.get(dust), 100, 4); - if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 && !werkstoff.getStats().isBlastFurnace()) { + if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) { GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustTiny), werkstoff.get(nugget)); - } - else if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 && werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().meltingPoint != 0){ - if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)){ - GT_Values.RA.addBlastRecipe(werkstoff.get(dust),GT_Utility.getIntegratedCircuit(11),Materials.Nitrogen.getGas(1000),null,werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot),null,(int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); - } - else if (werkstoff.contains(WerkstoffLoader.NOBLE_GAS_SMELTING)) { + } else if (werkstoff.hasItemType(ingot) && werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().meltingPoint != 0) { + if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)) { + GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Nitrogen.getGas(1000), null, werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); + } else if (werkstoff.contains(WerkstoffLoader.NOBLE_GAS_SMELTING)) { GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Argon.getGas(1000), null, werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); - } - else { + } else { GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); if (werkstoff.getStats().meltingPoint <= 1000) { GT_Values.RA.addPrimitiveBlastRecipe(werkstoff.get(dust), null, 9, werkstoff.get(ingot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint); @@ -2242,26 +2286,26 @@ public class WerkstoffLoader implements Runnable { } } - if (werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().meltingPoint > 1750){ - GT_Values.RA.addVacuumFreezerRecipe(werkstoff.get(ingotHot),werkstoff.get(ingot),(int) Math.max(werkstoff.getStats().mass * 3L, 1L)); + if (werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().meltingPoint > 1750) { + GT_Values.RA.addVacuumFreezerRecipe(werkstoff.get(ingotHot), werkstoff.get(ingot), (int) Math.max(werkstoff.getStats().mass * 3L, 1L)); } - if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0){ - GT_ModHandler.addPulverisationRecipe(werkstoff.get(ingot),werkstoff.get(dust)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(nugget),werkstoff.get(dustTiny)); + if (werkstoff.hasItemType(ingot)) { + GT_ModHandler.addPulverisationRecipe(werkstoff.get(ingot), werkstoff.get(dust)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(nugget), werkstoff.get(dustTiny)); } - if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 || werkstoff.getGenerationFeatures().hasGems() ){ - GT_ModHandler.addPulverisationRecipe(werkstoff.get(block),werkstoff.get(dust, 9)); + if (werkstoff.hasItemType(ingot) || werkstoff.hasItemType(gem)) { + GT_ModHandler.addPulverisationRecipe(werkstoff.get(block), werkstoff.get(dust, 9)); } } } - private void addOreRecipes(Werkstoff werkstoff) { - if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 &&!werkstoff.getStats().isBlastFurnace()) + private static void addOreRecipes(Werkstoff werkstoff) { + if (werkstoff.hasItemType(ore) && werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), werkstoff.get(ingot)); - if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0) { - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ore), werkstoff.getGenerationFeatures().hasGems() ? werkstoff.get(gem) : werkstoff.get(crushed), 16, 10); + if (werkstoff.hasItemType(ore)) { + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ore), werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(crushed), 16, 10); GT_ModHandler.addPulverisationRecipe( werkstoff.get(ore), werkstoff.get(crushed, 2), @@ -2273,17 +2317,16 @@ public class WerkstoffLoader implements Runnable { } } - private void addCrushedRecipes(Werkstoff werkstoff) { + private static void addCrushedRecipes(Werkstoff werkstoff) { if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) == 0 || (werkstoff.getGenerationFeatures().toGenerate & 0b1) == 0) return; - if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 && !werkstoff.getStats().isBlastFurnace()) { + if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) { if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushed), werkstoff.get(nugget, 10)); GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedPurified), werkstoff.get(nugget, 10)); GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(nugget, 10)); - } - else { + } else { GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushed), werkstoff.get(ingot)); GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedPurified), werkstoff.get(ingot)); GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(ingot)); @@ -2293,9 +2336,9 @@ public class WerkstoffLoader implements Runnable { GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); } - GT_ModHandler.addCraftingRecipe(werkstoff.get(dustImpure),new Object[]{"h ", "W ",'W',werkstoff.get(crushed)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(dustPure),new Object[]{"h ", "W ",'W',werkstoff.get(crushedPurified)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(dust),new Object[]{"h ", "W ",'W',werkstoff.get(crushedCentrifuged)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(dustImpure), new Object[]{"h ", "W ", 'W', werkstoff.get(crushed)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(dustPure), new Object[]{"h ", "W ", 'W', werkstoff.get(crushedPurified)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{"h ", "W ", 'W', werkstoff.get(crushedCentrifuged)}); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), 10, 16); GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), werkstoff.getOreByProduct(0, dust), 10, false); @@ -2330,7 +2373,7 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Neodymium, 1L), GT_OreDictUnificator.get(nugget, Materials.Neodymium, 1L), new int[]{10000, 4000, 2000}, 400, 24); } - private void addCellRecipes(Werkstoff werkstoff){ + private static void addCellRecipes(Werkstoff werkstoff) { if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000) == 0) return; @@ -2369,7 +2412,7 @@ public class WerkstoffLoader implements Runnable { // } // } // } else if (container.getKey() instanceof Werkstoff) { -// if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).getGenerationFeatures().hasCells()) { +// if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) { // FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); // if (tmpFl == null || tmpFl.getFluid() == null) { // tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); @@ -2386,7 +2429,7 @@ public class WerkstoffLoader implements Runnable { // cells += container.getValue(); // } // } else { -// if (!((Werkstoff) container.getKey()).getGenerationFeatures().hasDusts()) +// if (!((Werkstoff) container.getKey()).hasItemType(dust)) // continue; // if (!tracker.containsKey(container.getKey())) { // stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); @@ -2419,29 +2462,29 @@ public class WerkstoffLoader implements Runnable { // } //Tank "Recipe" - GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000),werkstoff.get(cell),Materials.Empty.getCells(1))); - FluidContainerRegistry.registerFluidContainer(werkstoff.getFluidOrGas(1).getFluid(),werkstoff.get(cell),Materials.Empty.getCells(1)); - GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)),1000), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)),1000)); + GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(cell), Materials.Empty.getCells(1))); + FluidContainerRegistry.registerFluidContainer(werkstoff.getFluidOrGas(1).getFluid(), werkstoff.get(cell), Materials.Empty.getCells(1)); + GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), 1000), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), 1000)); - if (Loader.isModLoaded("Forestry")) { + if (LoaderReference.Forestry) { FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(capsule), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), true); GT_Utility.addFluidContainerData(emptyData); FluidContainerRegistry.registerFluidContainer(emptyData); GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsule), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), 1000)); } - if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0){ - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getFluidOrGas(1000),0,(int) werkstoff.getStats().mass,werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe(GT_Utility.getIntegratedCircuit(1), werkstoff.getFluidOrGas(1000), werkstoff.get(dust), (int) werkstoff.getStats().mass,werkstoff.getStats().getMass() > 128 ? 64 : 30); + if (werkstoff.hasItemType(dust)) { + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust), null, werkstoff.getFluidOrGas(1000), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe(GT_Utility.getIntegratedCircuit(1), werkstoff.getFluidOrGas(1000), werkstoff.get(dust), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); } if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { Materials werkstoffBridgeMaterial = null; boolean ElementSet = false; - for (Element e : Element.values()){ - if (e.toString().equals(werkstoff.getToolTip())){ - werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName(),werkstoff.getDefaultName()); + for (Element e : Element.values()) { + if (e.toString().equals(werkstoff.getToolTip())) { + werkstoffBridgeMaterial = new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName(), werkstoff.getDefaultName()); werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials.add(werkstoffBridgeMaterial); ElementSet = true; @@ -2451,7 +2494,7 @@ public class WerkstoffLoader implements Runnable { if (!ElementSet) return; - GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),false); + GT_OreDictUnificator.addAssociation(cell, werkstoffBridgeMaterial, werkstoff.get(cell), false); // try { // Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); // f.setAccessible(true); @@ -2461,48 +2504,68 @@ public class WerkstoffLoader implements Runnable { // e.printStackTrace(); // } ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); - Behaviour_DataOrb.setDataName(scannerOutput,werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false,new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),30,0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false,new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),30,0)); + Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); + Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{Materials.Empty.getCells(1)}, new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); } } - private void addMoltenRecipes(Werkstoff werkstoff) { - if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000000) == 0) + + private static void addMoltenRecipes(Werkstoff werkstoff) { + if (!werkstoff.hasItemType(cellMolten)) return; //Tank "Recipe" - final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144),werkstoff.get(cellMolten),Materials.Empty.getCells(1)); - FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144),werkstoff.get(cell),Materials.Empty.getCells(1)); + final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(cellMolten), Materials.Empty.getCells(1)); + FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(cell), Materials.Empty.getCells(1)); GT_Utility.addFluidContainerData(data); - GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cellMolten), new FluidStack(Objects.requireNonNull(molten.get(werkstoff)),144), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(molten.get(werkstoff)),144)); + GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cellMolten), new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144)); - if (Loader.isModLoaded("Forestry")) { + if (LoaderReference.Forestry) { final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); GT_Utility.addFluidContainerData(emptyData); GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsuleMolten), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144)); } - if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot),null,werkstoff.getMolten(144),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + if (werkstoff.hasItemType(ingot)) { + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000000) != 0) { GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick), null, werkstoff.getMolten(72), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); } - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget),null,werkstoff.getMolten(16),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget), null, werkstoff.getMolten(16), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(1296), werkstoff.get(block), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - } else if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b10) == 0){ - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getMolten(144),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall),null,werkstoff.getMolten(36),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny),null,werkstoff.getMolten(16),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(block),null,werkstoff.getMolten(1296),0,288, 8); + } else if (werkstoff.hasItemType(dust) && (werkstoff.getGenerationFeatures().toGenerate & 0b10) == 0) { + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall), null, werkstoff.getMolten(36), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny), null, werkstoff.getMolten(16), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + } + } + + public static void addAspectToAll(Werkstoff werkstoff){ + for (OrePrefixes enabledOrePrefixes : WerkstoffLoader.ENABLED_ORE_PREFIXES) { + if (werkstoff.hasItemType(enabledOrePrefixes)) { + if (enabledOrePrefixes.mMaterialAmount >= 3628800L || enabledOrePrefixes == OrePrefixes.ore) { + DebugLog.log("OrePrefix: " + enabledOrePrefixes.name() + " mMaterialAmount: " + enabledOrePrefixes.mMaterialAmount/3628800L); + if (Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes))) + ThaumcraftHandler.AspectAdder.addAspectViaBW( + werkstoff.get(enabledOrePrefixes), + werkstoff.getTCAspects(enabledOrePrefixes == OrePrefixes.ore ? 1 : + (int) (enabledOrePrefixes.mMaterialAmount / 3628800L)) + ); + } + else if (enabledOrePrefixes.mMaterialAmount >= 0L) { + if (Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes))) + ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(enabledOrePrefixes), new Pair<>(TC_Aspects.PERDITIO.mAspect, 1)); + } + } } } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index a585f8291b..ed77b13329 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,21 +22,28 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.LuVTierEnhancer; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; -import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.*; import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; +import ic2.core.item.ItemFluidCell; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.reflect.FieldUtils; @@ -46,13 +53,230 @@ import java.util.Map; import static com.github.bartimaeusnek.bartworks.util.BW_Util.CLEANROOM; import static gregtech.api.enums.OrePrefixes.*; -public class AdditionalRecipes implements Runnable { +public class AdditionalRecipes { + + private static BWRecipes.BW_Recipe_Map_LiquidFuel sAcidGenFuels = ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)); + private static BWRecipes.BacteriaVatRecipeMap sBacteriaVat = ((BWRecipes.BacteriaVatRecipeMap) BWRecipes.instance.getMappingsFor((byte) 1)); + private static GT_Recipe.GT_Recipe_Map sBiolab = BWRecipes.instance.getMappingsFor((byte) 0); + + private static void runBWRecipes(){ + + if (ConfigHandler.BioLab) { + FluidStack[] dnaFluid = {LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L)}; + + for (ItemStack stack : BioItemList.getAllPetriDishes()) { + BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); + if (DNA != null) { + ItemStack Detergent = BioItemList.getOther(1); + ItemStack DNAFlask = BioItemList.getDNASampleFlask(null); + ItemStack EthanolCell = Materials.Ethanol.getCells(1); + sBiolab.addFakeRecipe(false, + new ItemStack[]{ + stack, + DNAFlask, + Detergent, + EthanolCell + }, + new ItemStack[]{ + BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(DNA)), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L) + }, + BioItemList.mBioLabParts[0], + new int[]{DNA.getChance(), 10000}, + new FluidStack[]{ + FluidRegistry.getFluidStack("ic2distilledwater", 1000) + }, + null, + 500, + BW_Util.getMachineVoltageFromTier(3 + DNA.getTier()), + BW_Util.STANDART + ); + } + } + + for (ItemStack stack : BioItemList.getAllDNASampleFlasks()) { + BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound()); + + if (DNA != null) { + ItemStack Outp = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); + Behaviour_DataOrb.setDataName(Outp, DNA.getName()); + + sBiolab.addFakeRecipe(false, + new ItemStack[]{ + stack, + FluidLoader.BioLabFluidCells[0], + FluidLoader.BioLabFluidCells[3], + ItemList.Tool_DataOrb.get(1L) + }, + new ItemStack[]{ + Outp, + ItemList.Cell_Universal_Fluid.get(2L) + }, + BioItemList.mBioLabParts[1], + new int[]{DNA.getChance(), 10000}, + dnaFluid, + null, + 500, + BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), + BW_Util.STANDART + ); + } + } + + for (ItemStack stack : BioItemList.getAllPlasmidCells()) { + BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound()); + + if (DNA != null) { + ItemStack inp = ItemList.Tool_DataOrb.get(0L); + Behaviour_DataOrb.setDataTitle(inp, "DNA Sample"); + Behaviour_DataOrb.setDataName(inp, DNA.getName()); + ItemStack inp2 = ItemList.Tool_DataOrb.get(0L); + Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); + Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); + + sBiolab.addFakeRecipe(false, + new ItemStack[]{ + FluidLoader.BioLabFluidCells[1], + BioItemList.getPlasmidCell(null), + inp, + inp2 + }, + new ItemStack[]{ + stack, + ItemList.Cell_Universal_Fluid.get(1L) + }, + BioItemList.mBioLabParts[2], + new int[]{DNA.getChance(), 10000}, + dnaFluid, + null, + 500, + BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), + BW_Util.STANDART + ); + } + } + + //Transformation- [Distilled Water] + Culture () + Plasmids (Gene) Cell + Penicillin Cell= Culture (Gene) + Empty Cells + sBiolab.addFakeRecipe(false, + new ItemStack[]{ + BioItemList.getPetriDish(null).setStackDisplayName("The Culture to change"), + BioItemList.getPlasmidCell(null).setStackDisplayName("The Plasmids to Inject"), + FluidLoader.BioLabFluidCells[2], + }, + new ItemStack[]{ + BioItemList.getPetriDish(null).setStackDisplayName("The changed Culture"), + ItemList.Cell_Universal_Fluid.get(1L) + }, + BioItemList.mBioLabParts[3], + new int[]{7500, 10000}, + new FluidStack[]{ + FluidRegistry.getFluidStack("ic2distilledwater", 1000) + }, + null, + 500, + BW_Util.getMachineVoltageFromTier(6), + BW_Util.STANDART + ); + + + ItemStack Outp = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); + Behaviour_DataOrb.setDataName(Outp, "Any DNA"); + //Clonal Cellular Synthesis- [Liquid DNA] + Medium Petri Dish + Plasma Membrane + Stem Cells + Genome Data + sBiolab.addFakeRecipe(false, + new ItemStack[]{ + BioItemList.getPetriDish(null), + BioItemList.getOther(4), + ItemList.Circuit_Chip_Stemcell.get(2L), + Outp + }, + new ItemStack[]{ + BioItemList.getPetriDish(null).setStackDisplayName("The Culture made from DNA"), + }, + BioItemList.mBioLabParts[4], + new int[]{7500, 10000}, + new FluidStack[]{new FluidStack(dnaFluid[0].getFluid(), 9000)}, + null, + 500, + BW_Util.getMachineVoltageFromTier(6), + BW_Util.STANDART + ); + + FluidStack[] easyFluids = {Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000)}; + for (FluidStack fluidStack : easyFluids) { + for (BioCulture bioCulture : BioCulture.BIO_CULTURE_ARRAY_LIST) { + if (bioCulture.isBreedable() && bioCulture.getTier() == 0) { + sBacteriaVat.addRecipe( + //boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue + new BWRecipes.BacteriaVatRecipe( + true, + new ItemStack[]{ + GT_Utility.getIntegratedCircuit(0), + new ItemStack(Items.sugar, 64) + }, + null, + BioItemList.getPetriDish(bioCulture), + null, + new FluidStack[]{ + fluidStack + }, + new FluidStack[]{ + new FluidStack(bioCulture.getFluid(), 10) + }, + 1000, + BW_Util.getMachineVoltageFromTier(3), + BW_Util.STANDART + ), true + ); + //aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue + sBiolab.addRecipe( + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[]{ + BioItemList.getPetriDish(null), + fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Water.getCells(1) : ItemFluidCell.getUniversalFluidCell(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) + }, + new ItemStack[]{ + BioItemList.getPetriDish(bioCulture), + fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Empty.getCells(1) : ItemList.Cell_Universal_Fluid.get(1L) + }, + null, + new int[]{ + bioCulture.getChance(), + 10000 + }, + new FluidStack[]{ + new FluidStack(bioCulture.getFluid(), 1000) + }, + null, + 500, + BW_Util.getMachineVoltageFromTier(3), + BW_Util.STANDART + )); + } + } + } + } + + sAcidGenFuels.addLiquidFuel(Materials.PhosphoricAcid, 36); + sAcidGenFuels.addLiquidFuel(Materials.DilutedHydrochloricAcid, 14); + sAcidGenFuels.addLiquidFuel(Materials.HypochlorousAcid, 30); + sAcidGenFuels.addLiquidFuel(Materials.HydrofluoricAcid, 40); + sAcidGenFuels.addLiquidFuel(Materials.HydrochloricAcid, 28); + sAcidGenFuels.addLiquidFuel(Materials.NitricAcid, 24); + sAcidGenFuels.addLiquidFuel(Materials.Mercury, 32); + sAcidGenFuels.addLiquidFuel(Materials.DilutedSulfuricAcid, 9); + sAcidGenFuels.addLiquidFuel(Materials.SulfuricAcid, 18); + sAcidGenFuels.addLiquidFuel(Materials.AceticAcid, 11); + sAcidGenFuels.addMoltenFuel(Materials.Redstone, 10); + } - @Override @SuppressWarnings("deprecation") - public void run() { - GT_Values.RA.addImplosionRecipe(WerkstoffLoader.RawAdemicSteel.get(dust),4,WerkstoffLoader.AdemicSteel.get(dust),null); - ((BWRecipes.BW_Recipe_Map_LiquidFuel)BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(WerkstoffLoader.FormicAcid.getBridgeMaterial(),40); + public static void run() { + runBWRecipes(); + GT_Values.RA.addImplosionRecipe(WerkstoffLoader.RawAdemicSteel.get(dust), 4, WerkstoffLoader.AdemicSteel.get(dust), null); + ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(WerkstoffLoader.FormicAcid.getBridgeMaterial(), 40); //Thorium/Yttrium Glas GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall, 2), WerkstoffLoader.Thorianit.get(dustSmall, 2), Materials.Glass.getMolten(144), null, new ItemStack(ItemRegistry.bw_glasses[0], 1, 12), null, 800, BW_Util.getMachineVoltageFromTier(5), 3663); //Thorianit recipes @@ -76,19 +300,19 @@ public class AdditionalRecipes implements Runnable { GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), Materials.Amethyst.getDust(10), GT_Values.NF, GT_Values.NF, WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), GT_Values.NI, 800, BW_Util.getMachineVoltageFromTier(2), 500); GT_Values.RA.addPrimitiveBlastRecipe(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), Materials.Amethyst.getDust(10), 6, WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), GT_Values.NI, 800); //Cubic Circonia - GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(5), Materials.Oxygen.getGas(3000), null, WerkstoffLoader.YttriumOxide.get(dust, 5), 4096, BW_Util.getMachineVoltageFromTier(1)); + GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(5), Materials.Oxygen.getGas(3000), GT_Values.NF, WerkstoffLoader.YttriumOxide.get(dust, 5), 4096, BW_Util.getMachineVoltageFromTier(1)); GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust, 10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.CubicZirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 57600, BW_Util.getMachineVoltageFromTier(3), 2953); //Tellurium GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed, Materials.Lead, 10L), GT_Utility.getIntegratedCircuit(17), GT_Values.NF, GT_Values.NF, Materials.Lead.getIngots(10), Materials.Tellurium.getNuggets(20), 800, BW_Util.getMachineVoltageFromTier(2), 722); - GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium.getMolten(16), Materials.Beryllium.getMolten(16), WerkstoffLoader.Californium.getMolten(16), 250, 49152, 480000000); - GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), WerkstoffLoader.Calcium.getMolten(16), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500, 49152, 600000000); + GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium.getMolten(48), Materials.Beryllium.getMolten(48), WerkstoffLoader.Californium.getMolten(48), 250, 49152, 480000000); + GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(48), WerkstoffLoader.Calcium.getMolten(48), WerkstoffLoader.Oganesson.getFluidOrGas(48), 500, 49152, 600000000); GT_Values.RA.addDistillationTowerRecipe(Materials.LiquidAir.getFluid(100000000), new FluidStack[]{Materials.Nitrogen.getGas(78084000), Materials.Oxygen.getGas(20946000), Materials.Argon.getGas(934000), Materials.CarbonDioxide.getGas(40700), WerkstoffLoader.Neon.getFluidOrGas(1818), Materials.Helium.getGas(524), Materials.Methane.getGas(180), WerkstoffLoader.Krypton.getFluidOrGas(114), Materials.Hydrogen.getGas(55), WerkstoffLoader.Xenon.getFluidOrGas(9)}, null, 7500, BW_Util.getMachineVoltageFromTier(4)); GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust), WerkstoffLoader.Neon.getFluidOrGas(1000), WerkstoffLoader.MagnetoResonaticDust.get(gemChipped, 9), 9000, 4500, BW_Util.getMachineVoltageFromTier(5)); GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust), WerkstoffLoader.Krypton.getFluidOrGas(1000), WerkstoffLoader.MagnetoResonaticDust.get(gem), 10000, 4500, BW_Util.getMachineVoltageFromTier(5)); //Milk //GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), Materials.Milk.getFluid(12000), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500, 49152, 600000000); - GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(1),null,Materials.Milk.getFluid(10000),Materials.Water.getFluid(8832),Materials.Sugar.getDustSmall(21),Materials.Calcium.getDustTiny(1),Materials.Magnesium.getDustTiny(1),Materials.Potassium.getDustTiny(1),Materials.Sodium.getDustTiny(4),Materials.Phosphor.getDustTiny(1),new int[]{10000,10000,1000,10000,1000,1000},50,120); + GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(1), GT_Values.NI, Materials.Milk.getFluid(10000), Materials.Water.getFluid(8832), Materials.Sugar.getDustSmall(21), Materials.Calcium.getDustTiny(1), Materials.Magnesium.getDustTiny(1), Materials.Potassium.getDustTiny(1), Materials.Sodium.getDustTiny(4), Materials.Phosphor.getDustTiny(1), new int[]{10000, 10000, 1000, 10000, 1000, 1000}, 50, 120); for (int i = 0; i <= 6; i++) { GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( @@ -129,31 +353,31 @@ public class AdditionalRecipes implements Runnable { GT_Recipe.GT_Recipe_Map.sSmallNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(bolt)}, new ItemStack[]{}, null, null, null, 0, 0, 12500); GT_Recipe.GT_Recipe_Map.sLargeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stick)}, new ItemStack[]{}, null, null, null, 0, 0, 62500); - try{ + try { Class map = GT_Recipe.GT_Recipe_Map.class; - GT_Recipe.GT_Recipe_Map sHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sHugeNaquadahReactorFuels").get(null); - GT_Recipe.GT_Recipe_Map sExtremeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sExtremeNaquadahReactorFuels").get(null); - GT_Recipe.GT_Recipe_Map sUltraHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sUltraHugeNaquadahReactorFuels").get(null); + GT_Recipe.GT_Recipe_Map sHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map, "sHugeNaquadahReactorFuels").get(null); + GT_Recipe.GT_Recipe_Map sExtremeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map, "sExtremeNaquadahReactorFuels").get(null); + GT_Recipe.GT_Recipe_Map sUltraHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map, "sUltraHugeNaquadahReactorFuels").get(null); sHugeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stickLong)}, new ItemStack[]{}, null, null, null, 0, 0, 125000); sExtremeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stick)}, new ItemStack[]{}, null, null, null, 0, 0, 31250); sUltraHugeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stickLong)}, new ItemStack[]{}, null, null, null, 0, 0, 125000); - }catch (NullPointerException | IllegalAccessException ignored){} + } catch (NullPointerException | IllegalAccessException ignored) {} - new LoadItemContainers().run(); + LoadItemContainers.run(); - GT_Values.RA.addCannerRecipe(ItemList.Large_Fluid_Cell_TungstenSteel.get(1L), WerkstoffLoader.Tiberium.get(dust,3), BW_NonMeta_MaterialItems.TiberiumCell_1.get(1L), null, 30, 16); + GT_Values.RA.addCannerRecipe(ItemList.Large_Fluid_Cell_TungstenSteel.get(1L), WerkstoffLoader.Tiberium.get(dust, 3), BW_NonMeta_MaterialItems.TiberiumCell_1.get(1L), null, 30, 16); GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_1.get(2L), GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), BW_NonMeta_MaterialItems.TiberiumCell_2.get(1L), 100, 400); GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_1.get(4L), GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 6L), BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), 150, 400); GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_2.get(2L), GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), 100, 400); GT_Values.RA.addAssemblerRecipe( - new ItemStack[]{ItemList.NaquadahCell_1.get(32L), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel,64L), - WerkstoffLoader.Tiberium.get(dust,64), - WerkstoffLoader.Tiberium.get(dust,64) - },null, BW_NonMeta_MaterialItems.TheCoreCell.get(1L), 100, BW_Util.getMachineVoltageFromTier(6)); + new ItemStack[]{ItemList.NaquadahCell_1.get(32L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), + WerkstoffLoader.Tiberium.get(dust, 64), + WerkstoffLoader.Tiberium.get(dust, 64) + }, null, BW_NonMeta_MaterialItems.TheCoreCell.get(1L), 100, BW_Util.getMachineVoltageFromTier(6)); GregTech_API.sAfterGTPostload.add(new LuVTierEnhancer()); AdditionalRecipes.oldGThelperMethod(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java index 320bf534fb..c6768aad7b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java @@ -30,10 +30,9 @@ import java.util.HashSet; import java.util.Objects; import java.util.Set; -public class DownTierLoader implements Runnable { +public class DownTierLoader { - @Override - public void run() { + public static void run() { GT_Recipe.GT_Recipe_Map.sMappings.stream() .filter(map -> StreamUtils.filterVisualMaps(map) && map != GT_Recipe.GT_Recipe_Map.sFusionRecipes) .forEach(map -> { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java index f2edb3b32d..c008588477 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,10 +26,9 @@ import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialIte import gregtech.api.items.GT_RadioactiveCellIC_Item; import gregtech.common.items.GT_DepletetCell_Item; -public class LoadItemContainers implements Runnable { +public class LoadItemContainers { - @Override - public void run() { + public static void run() { BW_NonMeta_MaterialItems.Depleted_Tiberium_1.set(new GT_DepletetCell_Item("TiberiumcellDep", "Fuel Rod (Depleted Tiberium)", 1)); BW_NonMeta_MaterialItems.Depleted_Tiberium_2.set(new GT_DepletetCell_Item("Double_TiberiumcellDep", "Dual Fuel Rod (Depleted Tiberium)", 1)); BW_NonMeta_MaterialItems.Depleted_Tiberium_4.set(new GT_DepletetCell_Item("Quad_TiberiumcellDep", "Quad Fuel Rod (Depleted Tiberium)", 1)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java index 5d86ecf88e..2a29fe2855 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.system.oregen; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.*; import com.github.bartimaeusnek.bartworks.util.MurmurHash3; +import com.github.bartimaeusnek.bartworks.util.Pair; import com.google.common.collect.ArrayListMultimap; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; @@ -118,6 +119,15 @@ public abstract class BW_OreLayer extends GT_Worldgen { return ret; } + public List> getStacksRawData(){ + ArrayList> ret = new ArrayList<>(); + ret.add(new Pair<>(this.mPrimaryMeta, (this.bwOres & 0b1000) != 0)); + ret.add(new Pair<>(this.mSecondaryMeta, (this.bwOres & 0b0100) != 0)); + ret.add(new Pair<>(this.mBetweenMeta, (this.bwOres & 0b0010) != 0)); + ret.add(new Pair<>(this.mSporadicMeta, (this.bwOres & 0b0001) != 0)); + return ret; + } + @Override public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java index 2471a36b60..33c36d270a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.system.worldgen; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import gregtech.api.GregTech_API; import net.minecraft.block.Block; @@ -33,74 +34,23 @@ public class GT_WorldgenUtil { public static final Block GT_TILES = GregTech_API.sBlockMachines; - public static final short[][] METAFORTIERS_ENERGY = { - {100,101,102,105}, //ULV=HPSteam - {1110,1115,1120,1127}, - {1111,12726,1116,1121,1128}, - {1112,12727,1117,1122,1129}, - {12728,1190,1130,12685}, - {1191,1174,695,12686}, - }; - public static final short[][] METAFORTIERS_BUFFER = { - {5133,5123}, //ULV=HPSteam - {161,171,181,191}, - {162,172,182,192}, - {163,173,183,193}, - {164,174,184,194}, - {165,175,185,195}, - }; - //ULV=HPSteam - public static final short[][] METAFORTIERS_CABLE = { - {5133,5123}, //ULV=HPSteam - {1210,1230,1250,1270,1290}, - {1310,1330,1350,1370,1390}, - {1410,1430,1450,1470,1490}, - {1510,1530,1550,1570,1590}, - {1650,1670,1690}, - }; - public static final short[][] METAFORTIERS_MACHINE = { - {103,104,106,107,109,110,112,113,115,116,118,119}, //ULV=HPSteam - {201,211,221,231,241,251,261,271,281,291,301,311,321,331,341,351,361,371,381,391,401,411,421,431,441,451,461,471,481,491,501,511,521,531,541,551,561,571,581,591,601,611,621,631,641,651,661,671}, - {}, - {}, - {}, - {}, - }; - - private static boolean initialisized; - - private static void init(){ - - for (int j = 1; j < 5; j++) { - GT_WorldgenUtil.METAFORTIERS_MACHINE[j+1]=new short[GT_WorldgenUtil.METAFORTIERS_MACHINE[1].length]; - for (int i = 0; i < GT_WorldgenUtil.METAFORTIERS_MACHINE[1].length; i++) { - GT_WorldgenUtil.METAFORTIERS_MACHINE[j+1][i]= (short) (GT_WorldgenUtil.METAFORTIERS_MACHINE[1][i]+j); - } - } - GT_WorldgenUtil.initialisized =true; - } - public static short getGenerator(Random rand,int tier){ - short meta = GT_WorldgenUtil.METAFORTIERS_ENERGY[tier][rand.nextInt(GT_WorldgenUtil.METAFORTIERS_ENERGY[tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? meta : GT_WorldgenUtil.getGenerator(rand,tier); + int meta = ConfigHandler.metasForTiers[0][tier][rand.nextInt(ConfigHandler.metasForTiers[0][tier].length)]; + return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getGenerator(rand,tier); } public static short getBuffer(Random rand,int tier){ - short meta = GT_WorldgenUtil.METAFORTIERS_BUFFER[tier][rand.nextInt(GT_WorldgenUtil.METAFORTIERS_BUFFER[tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? meta : GT_WorldgenUtil.getBuffer(rand,tier); + int meta = ConfigHandler.metasForTiers[1][tier][rand.nextInt(ConfigHandler.metasForTiers[1][tier].length)]; + return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getBuffer(rand,tier); } public static short getCable(Random rand,int tier){ - short meta = GT_WorldgenUtil.METAFORTIERS_CABLE[tier][rand.nextInt(GT_WorldgenUtil.METAFORTIERS_CABLE[tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? meta : GT_WorldgenUtil.getCable(rand,tier); + int meta = ConfigHandler.metasForTiers[2][tier][rand.nextInt(ConfigHandler.metasForTiers[2][tier].length)]; + return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getCable(rand,tier); } public static short getMachine(Random rand,int tier){ - if (!GT_WorldgenUtil.initialisized) - GT_WorldgenUtil.init(); - short meta = GT_WorldgenUtil.METAFORTIERS_MACHINE[tier][rand.nextInt(GT_WorldgenUtil.METAFORTIERS_MACHINE[tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? meta : GT_WorldgenUtil.getMachine(rand,tier); + int meta = ConfigHandler.metasForTiers[3][tier][rand.nextInt(ConfigHandler.metasForTiers[3][tier].length)]; + return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getMachine(rand,tier); } - - -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java index dbeaa9ef3e..14f0ca8e0c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -40,6 +40,7 @@ import net.minecraftforge.common.ChestGenHooks; import java.security.SecureRandom; import java.util.Random; +import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.maxTierRoss; import static net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST; @SuppressWarnings({"ALL"}) public abstract class MapGenRuins extends WorldGenerator { @@ -133,10 +134,10 @@ public abstract class MapGenRuins extends WorldGenerator { this.setMiscBlocks(new int[]{1},Blocks.log); this.statBlocks = new int[]{rand.nextInt(this.ToBuildWith[0].length)}; int colored = rand.nextInt(15); - int tier = secureRandom.nextInt(6); + int tier = secureRandom.nextInt(maxTierRoss); boolean useColor = rand.nextBoolean(); byte set = 0; - byte toSet = (byte) (rand.nextInt(6-tier)+1); + byte toSet = (byte) (rand.nextInt(maxTierRoss - tier) + 1); short cablemeta = GT_WorldgenUtil.getCable(secureRandom,tier); byte treeinaRow = 0; boolean lastset = rand.nextBoolean(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 5da71e18b4..c7f578fe41 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,35 +22,25 @@ package com.github.bartimaeusnek.bartworks.util; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; -import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import cpw.mods.fml.common.Loader; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.common.items.behaviors.Behaviour_DataOrb; import ic2.core.Ic2Items; import ic2.core.item.ItemFluidCell; -import net.minecraft.init.Items; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import javax.annotation.Nonnegative; -import java.io.Serializable; import java.util.*; import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; @@ -101,221 +91,6 @@ public class BWRecipes { "", 1, "", true, true //special handler ); - - public BWRecipes() { - - if (ConfigHandler.BioLab) { - FluidStack[] dnaFluid = {Loader.isModLoaded("gendustry") ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L)}; - - for (ItemStack stack : BioItemList.getAllPetriDishes()) { - BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); - if (DNA != null) { - ItemStack Detergent = BioItemList.getOther(1); - ItemStack DNAFlask = BioItemList.getDNASampleFlask(null); - ItemStack EthanolCell = Materials.Ethanol.getCells(1); - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - stack, - DNAFlask, - Detergent, - EthanolCell - }, - new ItemStack[]{ - BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(DNA)), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L) - }, - BioItemList.mBioLabParts[0], - new int[]{DNA.getChance(), 10000}, - new FluidStack[]{ - FluidRegistry.getFluidStack("ic2distilledwater", 1000) - }, - null, - 500, - BW_Util.getMachineVoltageFromTier(3 + DNA.getTier()), - BW_Util.STANDART - ); - } - } - - for (ItemStack stack : BioItemList.getAllDNASampleFlasks()) { - BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound()); - - if (DNA != null) { - ItemStack Outp = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); - Behaviour_DataOrb.setDataName(Outp, DNA.getName()); - - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - stack, - FluidLoader.BioLabFluidCells[0], - FluidLoader.BioLabFluidCells[3], - ItemList.Tool_DataOrb.get(1L) - }, - new ItemStack[]{ - Outp, - ItemList.Cell_Universal_Fluid.get(2L) - }, - BioItemList.mBioLabParts[1], - new int[]{DNA.getChance(), 10000}, - dnaFluid, - null, - 500, - BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), - BW_Util.STANDART - ); - } - } - - for (ItemStack stack : BioItemList.getAllPlasmidCells()) { - BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound()); - - if (DNA != null) { - ItemStack inp = ItemList.Tool_DataOrb.get(0L); - Behaviour_DataOrb.setDataTitle(inp, "DNA Sample"); - Behaviour_DataOrb.setDataName(inp, DNA.getName()); - ItemStack inp2 = ItemList.Tool_DataOrb.get(0L); - Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); - Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); - - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - FluidLoader.BioLabFluidCells[1], - BioItemList.getPlasmidCell(null), - inp, - inp2 - }, - new ItemStack[]{ - stack, - ItemList.Cell_Universal_Fluid.get(1L) - }, - BioItemList.mBioLabParts[2], - new int[]{DNA.getChance(), 10000}, - dnaFluid, - null, - 500, - BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), - BW_Util.STANDART - ); - } - } - - //Transformation- [Distilled Water] + Culture () + Plasmids (Gene) Cell + Penicillin Cell= Culture (Gene) + Empty Cells - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - BioItemList.getPetriDish(null).setStackDisplayName("The Culture to change"), - BioItemList.getPlasmidCell(null).setStackDisplayName("The Plasmids to Inject"), - FluidLoader.BioLabFluidCells[2], - }, - new ItemStack[]{ - BioItemList.getPetriDish(null).setStackDisplayName("The changed Culture"), - ItemList.Cell_Universal_Fluid.get(1L) - }, - BioItemList.mBioLabParts[3], - new int[]{7500, 10000}, - new FluidStack[]{ - FluidRegistry.getFluidStack("ic2distilledwater", 1000) - }, - null, - 500, - BW_Util.getMachineVoltageFromTier(6), - BW_Util.STANDART - ); - - - ItemStack Outp = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); - Behaviour_DataOrb.setDataName(Outp, "Any DNA"); - //Clonal Cellular Synthesis- [Liquid DNA] + Medium Petri Dish + Plasma Membrane + Stem Cells + Genome Data - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - BioItemList.getPetriDish(null), - BioItemList.getOther(4), - ItemList.Circuit_Chip_Stemcell.get(2L), - Outp - }, - new ItemStack[]{ - BioItemList.getPetriDish(null).setStackDisplayName("The Culture made from DNA"), - }, - BioItemList.mBioLabParts[4], - new int[]{7500, 10000}, - new FluidStack[]{new FluidStack(dnaFluid[0].getFluid(), 9000)}, - null, - 500, - BW_Util.getMachineVoltageFromTier(6), - BW_Util.STANDART - ); - - FluidStack[] easyFluids = {Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000)}; - for (FluidStack fluidStack : easyFluids) { - for (BioCulture bioCulture : BioCulture.BIO_CULTURE_ARRAY_LIST) { - if (bioCulture.isBreedable() && bioCulture.getTier() == 0) { - sBacteriaVat.addRecipe( - //boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue - new BacteriaVatRecipe( - true, - new ItemStack[]{ - GT_Utility.getIntegratedCircuit(0), - new ItemStack(Items.sugar, 64) - }, - null, - BioItemList.getPetriDish(bioCulture), - null, - new FluidStack[]{ - fluidStack - }, - new FluidStack[]{ - new FluidStack(bioCulture.getFluid(), 10) - }, - 1000, - BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ), true - ); - //aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue - sBiolab.addRecipe( - new DynamicGTRecipe( - false, - new ItemStack[]{ - BioItemList.getPetriDish(null), - fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Water.getCells(1) : ItemFluidCell.getUniversalFluidCell(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) - }, - new ItemStack[]{ - BioItemList.getPetriDish(bioCulture), - fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Empty.getCells(1) : ItemList.Cell_Universal_Fluid.get(1L) - }, - null, - new int[]{ - bioCulture.getChance(), - 10000 - }, - new FluidStack[]{ - new FluidStack(bioCulture.getFluid(), 1000) - }, - null, - 500, - BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - )); - } - } - } - } - - sAcidGenFuels.addLiquidFuel(Materials.PhosphoricAcid, 36); - sAcidGenFuels.addLiquidFuel(Materials.DilutedHydrochloricAcid, 14); - sAcidGenFuels.addLiquidFuel(Materials.HypochlorousAcid, 30); - sAcidGenFuels.addLiquidFuel(Materials.HydrofluoricAcid, 40); - sAcidGenFuels.addLiquidFuel(Materials.HydrochloricAcid, 28); - sAcidGenFuels.addLiquidFuel(Materials.NitricAcid, 24); - sAcidGenFuels.addLiquidFuel(Materials.Mercury, 32); - sAcidGenFuels.addLiquidFuel(Materials.DilutedSulfuricAcid, 9); - sAcidGenFuels.addLiquidFuel(Materials.SulfuricAcid, 18); - sAcidGenFuels.addLiquidFuel(Materials.AceticAcid, 11); - sAcidGenFuels.addMoltenFuel(Materials.Redstone, 10); - } - - /** * @param machine 0 = biolab; 1 = BacterialVat; 2 = sAcidGenFuels; 3 = circuitAssemblyLine */ @@ -464,13 +239,16 @@ public class BWRecipes { return sBacteriaVat.addRecipe(new BacteriaVatRecipe(true, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; } - public static class DynamicGTRecipe extends GT_Recipe implements Serializable { + public static class DynamicGTRecipe extends GT_Recipe { + public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); } + } public static class BW_Recipe_Map_LiquidFuel extends GT_Recipe.GT_Recipe_Map_Fuel { + public BW_Recipe_Map_LiquidFuel(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); } @@ -487,13 +265,14 @@ public class BWRecipes { return super.addFuel(ItemFluidCell.getUniversalFluidCell(fluidStack), Ic2Items.FluidCell.copy(), burn); } - } public static class BacteriaVatRecipe extends GT_Recipe { - protected BacteriaVatRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + + public BacteriaVatRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); } + } public static class BacteriaVatRecipeMap extends BWRecipes.SpecialObjectSensitiveMap { @@ -522,6 +301,7 @@ public class BWRecipes { } public GT_Recipe addRecipe(GT_Recipe aRecipe) { + if (aRecipe.mInputs.length > 0 && GT_Utility.areStacksEqual(aRecipe.mInputs[aRecipe.mInputs.length - 1], GT_Utility.getIntegratedCircuit(32767))) return aRecipe; else { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index cbeede008f..6429cece69 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,8 +23,6 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; -import gregtech.api.enums.Element; import gregtech.api.enums.Materials; import gregtech.api.enums.OreDictNames; import gregtech.api.enums.ToolDictNames; @@ -42,10 +40,10 @@ import net.minecraft.enchantment.Enchantment; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; -import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.ShapedOreRecipe; @@ -53,8 +51,10 @@ import org.apache.commons.lang3.reflect.FieldUtils; import javax.annotation.Nonnegative; import javax.annotation.Nonnull; +import java.lang.reflect.Array; import java.lang.reflect.Field; import java.util.*; +import java.util.stream.Collectors; import static gregtech.api.enums.GT_Values.*; @@ -98,7 +98,9 @@ public class BW_Util { newTime >>= (tier - oldTier); newVoltage <<= 2 * (tier - oldTier); } - return new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, recipe.mFluidInputs, recipe.mFluidOutputs, newTime, newVoltage, recipe.mSpecialValue); + recipe.mEUt = newVoltage; + recipe.mDuration = newTime; + return recipe; } public static String subscriptNumbers(String b){ @@ -189,9 +191,8 @@ public class BW_Util { special = 1; else if (aSpecialValue == (CLEANROOM)) special = 2; - else if (aSpecialValue == (LOWGRAVITY | CLEANROOM)) { + else if (aSpecialValue == (LOWGRAVITY | CLEANROOM)) special = 3; - } return special; } @@ -218,37 +219,91 @@ public class BW_Util { return (int) (materials.getProtons() == 43L ? (materials.equals(Materials.NaquadahEnriched) ? 140 : materials.equals(Materials.Naquadria) ? 150 : materials.equals(Materials.Naquadah) ? 130 : 43) : materials.getProtons()); } + public static ItemStack setStackSize(ItemStack stack, int size) { + if (stack != null) + stack.stackSize = size; + return stack; + } + public static boolean checkStackAndPrefix(ItemStack itemStack) { return itemStack != null && GT_OreDictUnificator.getAssociation(itemStack) != null && GT_OreDictUnificator.getAssociation(itemStack).mPrefix != null && GT_OreDictUnificator.getAssociation(itemStack).mMaterial != null && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial != null; } -// public static int getRecipeHash(GT_Recipe recipe) { -// int mInputItemsRawHash = Arrays.stream(recipe.mInputs).filter(Objects::nonNull).mapToInt(e -> -// Objects.hash(Item.getIdFromItem(e.getItem()),e.getItemDamage(), e.getTagCompound()) -// ).hashCode(); -// int mInputFluidRawHash = Arrays.stream(recipe.mFluidInputs).filter(Objects::nonNull).mapToInt(e -> -// Objects.hash(e.getFluidID(),e.amount,e.tag) -// ).hashCode(); -// int mOutputItemRawHash = Arrays.stream(recipe.mOutputs).filter(Objects::nonNull).mapToInt(e -> -// Objects.hash(Item.getIdFromItem(e.getItem()),e.getItemDamage(), e.getTagCompound()) -// ).hashCode(); -// int mOutputFluidRawHash = Arrays.stream(recipe.mFluidOutputs).filter(Objects::nonNull).mapToInt(e -> -// Objects.hash(e.getFluidID(),e.amount,e.tag) -// ).hashCode(); -// int mChancesRawHash = Arrays.hashCode(recipe.mChances); -// int others = Objects.hash(recipe.mEUt,recipe.mSpecialValue,recipe.mDuration); -// int specialItem = Objects.hash(recipe.mSpecialItems instanceof ItemStack ? -// ((ItemStack) (recipe.mSpecialItems)).getItem() : recipe.mSpecialItems instanceof Item ? recipe.mSpecialItems : 0 , -// recipe.mSpecialItems instanceof ItemStack ? ((ItemStack) (recipe.mSpecialItems)).getItemDamage() : 0); -// return Objects.hash(mInputItemsRawHash,mInputFluidRawHash,mOutputItemRawHash,mOutputFluidRawHash,mChancesRawHash,others,specialItem); -// } + public static Map getInputsFromOutput(Collection gt_recipes, ItemStack... inputs) { + return gt_recipes.stream() + .filter(ar -> + Arrays.stream(inputs) + .anyMatch(st -> GT_Utility.areStacksEqual(st, ar.mOutputs[0]))) + .collect(Collectors.toMap(k -> k.mOutputs[0], k -> k.mInputs)); + } + + public static Map getAsslineInputsFromOutputs(ItemStack... inputs) { + return GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.stream() + .filter(ar -> + Arrays.stream(inputs) + .anyMatch(st -> GT_Utility.areStacksEqual(st, ar.mOutput))) + .collect(Collectors.toMap(k -> k.mOutput, k -> k.mInputs)); + } + + public static int abstractHashGTRecipe(GT_Recipe recipe) { + int hash = 31; + hash += recipe.mDuration / 20 * 31; + hash += GT_Utility.getTier(recipe.mEUt) * 31; + hash += BW_Util.specialToByte(recipe.mSpecialValue) * 31; + hash += recipe.mInputs.length * 31; + for (ItemStack mInput : recipe.mInputs) { + if (mInput != null) { + hash += mInput.stackSize * 31; + hash += Item.getIdFromItem(mInput.getItem()) * 31; + } + } + hash += recipe.mOutputs.length * 31; + for (ItemStack mOutput : recipe.mOutputs) { + if (mOutput != null) { + hash += mOutput.stackSize * 31; + hash += Item.getIdFromItem(mOutput.getItem()) * 31; + } + } + hash += recipe.mFluidInputs.length * 31; + for (FluidStack mInput : recipe.mFluidInputs) { + if (mInput != null) { + hash += mInput.amount * 31; + hash += mInput.getFluidID() * 31; + } + } + hash += recipe.mFluidOutputs.length * 31; + for (FluidStack mOutput : recipe.mFluidOutputs) { + if (mOutput != null) { + hash += mOutput.amount * 31; + hash += mOutput.getFluidID() * 31; + } + } + return hash; + } + + @SuppressWarnings({"unchecked"}) + public static T[] copyAndRemoveNulls(T[] input, Class clazz) { + List ret = Arrays.stream(input) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + + if (ret.size() <= 0) + return (T[]) Array.newInstance(clazz, 0); + + T[] retArr = (T[]) Array.newInstance(clazz, ret.size()); + + for (int i = 0; i < ret.size(); i++) + retArr[i] = ret.get(i); + + return retArr; + } public static int getMachineVoltageFromTier(int tier) { return (int) (30 * Math.pow(4, (tier - 1))); } public static int getTierVoltage(int tier) { - return 8 << (2*tier); + return 8 << (2 * tier); } public static boolean areStacksEqualOrNull(ItemStack aStack1, ItemStack aStack2) { @@ -393,15 +448,13 @@ public class BW_Util { } } - public static long getnominalVoltage(GT_MetaTileEntity_MultiBlockBase base) { long rVoltage = 0L; long rAmperage = 0L; for (GT_MetaTileEntity_Hatch_Energy tHatch : base.mEnergyHatches) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - if (rVoltage == 0 || rVoltage > tHatch.getBaseMetaTileEntity().getInputVoltage()) - rVoltage = tHatch.getBaseMetaTileEntity().getInputVoltage(); + rVoltage = Math.max(tHatch.getBaseMetaTileEntity().getInputVoltage(), rVoltage); rAmperage += tHatch.getBaseMetaTileEntity().getInputAmperage(); } } @@ -416,6 +469,7 @@ public class BW_Util { } return tmp.toArray(new FluidStack[0]); } + public static ItemStack[] getItemsFromInputBusses(GT_MetaTileEntity_MultiBlockBase aBaseMetaTileEntity){ ArrayList tmp = new ArrayList<>(); for (GT_MetaTileEntity_Hatch_InputBus fip : aBaseMetaTileEntity.mInputBusses){ @@ -424,11 +478,6 @@ public class BW_Util { return tmp.toArray(new ItemStack[0]); } - - public static Element createNewElement(String variableName, long aProtons, long aNeutrons, long aAdditionalMass, long aHalfLifeSeconds, String aDecayTo, String aName, boolean aIsIsotope){ - return EnumHelper.addEnum(Element.class,variableName,new Class[]{long.class, long.class, long.class, long.class, String.class, String.class, boolean.class}, new Object[]{aProtons, aNeutrons, aAdditionalMass, aHalfLifeSeconds, aDecayTo, aName, aIsIsotope}); - } - public static EnumRarity getRarityFromByte(byte b) { switch (b) { case 1: @@ -442,7 +491,6 @@ public class BW_Util { } } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean insideCheck, Block inside, int dmginside, int aBaseCasingIndex) { return BW_Util.check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, insideCheck, inside, dmginside, aBaseCasingIndex); } @@ -561,9 +609,19 @@ public class BW_Util { } } + private static Block bw_realglasRef; + public static byte calculateGlassTier(@Nonnull Block block, @Nonnegative byte meta) { - if (block.equals(ItemRegistry.bw_glasses[0])) + if (bw_realglasRef == null){ + try { + bw_realglasRef = (Block) Class.forName("com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry").getField("bw_realglas").get(null); + } catch (IllegalAccessException | NoSuchFieldException | ClassNotFoundException e) { + e.printStackTrace(); + } + } + + if (block.equals(bw_realglasRef)) return meta == 12 ? 5 : meta > 1 && meta < 6 ? (byte) (meta + 3) : 4; if (block.getUnlocalizedName().equals("blockAlloyGlass")) @@ -738,9 +796,11 @@ public class BW_Util { break; } ItemStack tStack = GT_OreDictUnificator.getFirstOre(in, 1); - if (tStack == null) tRemoveRecipe = false; - else tItemStackMap.put(chr, tStack); - in = aRecipe[idx + 1] = in.toString(); + if (tStack == null) + tRemoveRecipe = false; + else + tItemStackMap.put(chr, tStack); + aRecipe[idx + 1] = in.toString(); } else if (in instanceof String) { if (in.equals(OreDictNames.craftingChest.toString())) tItemDataMap.put(chr, new ItemData(Materials.Wood, M * 8)); @@ -810,4 +870,4 @@ public class BW_Util { return new GT_Shaped_Recipe(GT_Utility.copy(aResult), aDismantleable, aRemovable, aKeepNBT, aEnchantmentsAdded, aEnchantmentLevelsAdded, aRecipe).setMirrored(aMirrored); } -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index ab8eea357d..5d728b8d2a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,7 +23,6 @@ package com.github.bartimaeusnek.bartworks.util; -import com.github.bartimaeusnek.bartworks.MainMod; import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.util.GT_LanguageManager; import net.minecraft.item.EnumRarity; @@ -137,7 +136,7 @@ public class BioCulture extends BioData implements IColorModulationContainer { public Fluid getFluid() { if (this.mFluid == null) - MainMod.LOGGER.error("Fluid has not been set yet! The issuring Culture is: " + this.name); + throw new IllegalStateException("Fluid has not been set yet! The issuring Culture is: " + this.name); return this.mFluid; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java new file mode 100644 index 0000000000..d18eb37eca --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util; + +import gregtech.api.enums.Element; +import gregtech.api.enums.OrePrefixes; +import net.minecraftforge.common.util.EnumHelper; + +public class EnumUtils { + private EnumUtils() { + } + + public static OrePrefixes addNewOrePrefix(String enumName, String aRegularLocalName, String aLocalizedMaterialPre, String aLocalizedMaterialPost, + boolean aIsUnificatable, boolean aIsMaterialBased, boolean aIsSelfReferencing, + boolean aIsContainer, boolean aDontUnificateActively, boolean aIsUsedForBlocks, + boolean aAllowNormalRecycling, boolean aGenerateDefaultItem, boolean aIsEnchantable, + boolean aIsUsedForOreProcessing, int aMaterialGenerationBits, long aMaterialAmount, + int aDefaultStackSize, int aTextureindex) { + return EnumHelper.addEnum(OrePrefixes.class, enumName, new Class[]{ + String.class, String.class, String.class, + boolean.class, boolean.class, boolean.class, + boolean.class, boolean.class, boolean.class, + boolean.class, boolean.class, boolean.class, + boolean.class, int.class, long.class, + int.class, int.class + }, new Object[]{ + aRegularLocalName, aLocalizedMaterialPre, aLocalizedMaterialPost, + aIsUnificatable, aIsMaterialBased, aIsSelfReferencing, + aIsContainer, aDontUnificateActively, aIsUsedForBlocks, + aAllowNormalRecycling, aGenerateDefaultItem, aIsEnchantable, + aIsUsedForOreProcessing, aMaterialGenerationBits, aMaterialAmount, + aDefaultStackSize, aTextureindex + }); + } + + public static Element createNewElement(String enumName, long aProtons, long aNeutrons, long aAdditionalMass, + long aHalfLifeSeconds, String aDecayTo, String aName, boolean aIsIsotope) { + return EnumHelper.addEnum(Element.class, enumName, new Class[]{ + long.class, long.class, long.class, + long.class, String.class, String.class, + boolean.class + }, new Object[]{ + aProtons, aNeutrons, aAdditionalMass, + aHalfLifeSeconds, aDecayTo, aName, + aIsIsotope + }); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java index dfb95c921d..27b2d4cb27 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java @@ -25,21 +25,102 @@ package com.github.bartimaeusnek.bartworks.util; /* * Faster implementations for Math stuff */ +@SuppressWarnings("unused") public class MathUtils { + + public static long floorLong(double x) { + if (Double.isInfinite(x) || Double.isNaN(x)) + return (long) x; + long xi = (long) x; + return x < xi ? xi - 1 : xi; + } + + public static long ceilLong(double x) { + if (Double.isInfinite(x) || Double.isNaN(x)) + return (long) x; + long xi = (long) x; + return x > xi ? xi + 1 : xi; + } + + public static int floorInt(double x) { + if (Double.isInfinite(x) || Double.isNaN(x)) + return (int) x; + int xi = (int) x; + return x < xi ? xi - 1 : xi; + } + + public static int ceilInt(float x) { + if (Float.isInfinite(x) || Float.isNaN(x)) + return (int) x; + int xi = (int) x; + return x > xi ? xi + 1 : xi; + } + + public static int ceilInt(double x) { + if (Double.isInfinite(x) || Double.isNaN(x)) + return (int) x; + int xi = (int) x; + return x > xi ? xi + 1 : xi; + } + public static double floor(double x) { if (Double.isInfinite(x) || Double.isNaN(x)) return x; - int xi = (int)x; + int xi = (int) x; return x < xi ? xi - 1 : xi; } public static double ceil(double x) { if (Double.isInfinite(x) || Double.isNaN(x)) return x; - int xi = (int)x; + int xi = (int) x; return x > xi ? xi + 1 : xi; } + public static byte clamp(byte amount, byte min, byte max) { + byte inner = (amount <= max) ? amount : max; + return (min >= inner) ? min : inner; + } + + public static short clamp(short amount, short min, short max) { + short inner = (amount <= max) ? amount : max; + return (min >= inner) ? min : inner; + } + + public static int clamp(int amount, int min, int max) { + return Math.max(min, Math.min(amount, max)); + } + + public static long clamp(long amount, long min, long max) { + return Math.max(min, Math.min(amount, max)); + } + + public static float clamp(float amount, float min, float max) { + return Math.max(min, Math.min(amount, max)); + } + + public static double clamp(double amount, double min, double max) { + return Math.max(min, Math.min(amount, max)); + } + + public static > T clamp(T val, T min, T max) { + return (val.compareTo(min) < 0) ? min : (val.compareTo(max) > 0) ? max : val; + } + + public static int wrap(int input, int bound){ + return (((input % bound)+bound) % bound); + } + public static long wrap(long input, long bound){ + return (((input % bound)+bound) % bound); + } + + public static double wrap(double input, double bound){ + return (((input % bound)+bound) % bound); + } + + public static float wrap(float input, float bound){ + return (((input % bound)+bound) % bound); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java new file mode 100644 index 0000000000..95588a4cf2 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util; + +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; + +public class MegaUtils { + + public static boolean drainEnergyMegaVanilla(GT_MetaTileEntity_MultiBlockBase multiBlockBase, long aEU) { + if (aEU <= 0) + return true; + + long allTheEu = 0; + int hatches = 0; + for (GT_MetaTileEntity_Hatch_Energy tHatch : multiBlockBase.mEnergyHatches) + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + allTheEu += tHatch.getEUVar(); + hatches++; + } + + if (allTheEu < aEU) + return false; + + long euperhatch = aEU / hatches; + + boolean hasDrained = false; + + for (GT_MetaTileEntity_Hatch_Energy tHatch : multiBlockBase.mEnergyHatches) + hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); + + return hasDrained && multiBlockBase.mEnergyHatches.size() > 0; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java deleted file mode 100644 index faa06e135d..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.util; - -import codechicken.nei.api.API; -import codechicken.nei.api.IConfigureNEI; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import cpw.mods.fml.common.Optional; -import gregtech.api.enums.OrePrefixes; -import net.minecraft.item.ItemStack; - - -@Optional.Interface(iface = "codechicken.nei.api.API", modid = "NotEnoughItems") -public class NEIbartworksConfig implements IConfigureNEI { - - @Optional.Method(modid = "NotEnoughItems") - @Override - public String getName() { - return MainMod.NAME; - } - - @Optional.Method(modid = "NotEnoughItems") - @Override - public String getVersion() { - return MainMod.VERSION; - } - - @Optional.Method(modid = "NotEnoughItems") - @Override - public void loadConfig() { - API.hideItem(new ItemStack(ItemRegistry.TAB)); - API.hideItem(new ItemStack(FluidLoader.bioFluidBlock)); - API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses)); - ItemStack[] prefixesToHide = { - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustTiny, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustSmall, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushed, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedCentrifuged, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.nugget, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemChipped, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawed, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawless, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemExquisite, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustImpure, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustPure, WerkstoffLoader.Bismutite).copy(), - }; - for (ItemStack stack : prefixesToHide) { - stack.setItemDamage(Short.MAX_VALUE); - API.hideItem(stack); - } -// for (int i = 0; i < Short.MAX_VALUE; i++) { -// API.addItemListEntry(new ItemStack(WerkstoffLoader.BWOres,1,i)); -// } - } -} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java index 4a6b8584dd..3e27fe94c3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.util.NoiseUtil; import com.github.bartimaeusnek.bartworks.API.INoiseGen; +import com.github.bartimaeusnek.bartworks.util.MathUtils; import gregtech.api.objects.XSTR; import java.util.Random; @@ -56,13 +57,6 @@ public class BartsNoise implements INoiseGen { } } - public static double clamp(double input, double lowerBound, double upperBound){ - return Math.min(Math.max(input, lowerBound),upperBound); - } - public static double wrap(double input, double bound){ - return (((input % bound)+bound) % bound); - } - public BartsNoise(int octaves, double frequency, double amplitude, long seed) { this.octaves = octaves; this.frequency = frequency; @@ -159,13 +153,13 @@ public class BartsNoise implements INoiseGen { result = Double.MAX_VALUE; if (result == Double.NEGATIVE_INFINITY) result = Double.MIN_VALUE; - return BartsNoise.wrap(result,1D); + return MathUtils.wrap(result,1D); } double getNonOctavedNoise(double x, double y){ double phase = SimplexNoise.noise( Math.pow(x*this.frequency,this.amplitude),Math.pow(y*this.frequency,this.amplitude)); - return BartsNoise.wrap(phase,1); + return MathUtils.wrap(phase,1); } @@ -196,7 +190,7 @@ public class BartsNoise implements INoiseGen { result += 1d/i * this.getNonOctavedNoise(i * x, y); } //result = (this.getNeighbouringNoise(x,y)+result)/2; - return BartsNoise.wrap(result,1D); + return MathUtils.wrap(result,1D); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java index 5dcb897da2..9c9e9ebd8d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java @@ -16,6 +16,8 @@ package com.github.bartimaeusnek.bartworks.util.NoiseUtil; * */ +import com.github.bartimaeusnek.bartworks.util.MathUtils; + public class SimplexNoise { // Simplex noise in 2D, 3D and 4D private static Grad[] grad3 = {new Grad(1,1,0),new Grad(-1,1,0),new Grad(1,-1,0),new Grad(-1,-1,0), new Grad(1,0,1),new Grad(-1,0,1),new Grad(1,0,-1),new Grad(-1,0,-1), @@ -64,8 +66,7 @@ public class SimplexNoise { // Simplex noise in 2D, 3D and 4D // This method is a *lot* faster than using (int)Math.floor(x) private static int fastfloor(double x) { - int xi = (int)x; - return x extends HashMap { + + private V defaultValue; + + public NonNullWrappedHashMap(int initialCapacity, float loadFactor, V defaultValue) { + super(initialCapacity, loadFactor); + this.defaultValue = Objects.requireNonNull(defaultValue); + } + + public NonNullWrappedHashMap(int initialCapacity, V defaultValue) { + super(initialCapacity); + this.defaultValue = Objects.requireNonNull(defaultValue); + } + + public NonNullWrappedHashMap(V defaultValue) { + this.defaultValue = Objects.requireNonNull(defaultValue); + } + + public NonNullWrappedHashMap(Map m, V defaultValue) { + super(m); + this.defaultValue = Objects.requireNonNull(defaultValue); + } + + @Override + public V get(Object key) { + return getOrDefault(key, defaultValue); + } + + @Override + public V getOrDefault(Object key, V defaultValue) { + return Objects.requireNonNull(Optional.ofNullable(super.getOrDefault(key, defaultValue)).orElse(this.defaultValue)); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java index 4d49e8523f..4cbb55c278 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java @@ -26,6 +26,7 @@ import org.apache.commons.lang3.NotImplementedException; import java.util.*; +@SuppressWarnings("ALL") public class AccessPriorityList implements List, Deque, Set { transient int size = 0; @@ -36,7 +37,8 @@ public class AccessPriorityList implements List, Deque, Set { return new AccessPriorityList(); } - public AccessPriorityList() {} + public AccessPriorityList() { + } @Override public void addFirst(E t) { @@ -185,7 +187,7 @@ public class AccessPriorityList implements List, Deque, Set { return true; } - private void moveNodeUp(AccessPriorityListNode node){ + private void moveNodeUp(AccessPriorityListNode node) { if (node == head || node.getBefore() == null) return; final AccessPriorityListNode before = node.getBefore(); @@ -327,18 +329,22 @@ public class AccessPriorityList implements List, Deque, Set { } } - public void addPrioToNode(int index, long prio){ + public void addPrioToNode(int index, long prio) { if (!isValidIndex(index)) return; AccessPriorityListNode node = getNode(index); - node.setPriority(node.getPriority()+prio); - while (node.getBefore() != null && node.getPriority() >= node.getBefore().getPriority()){ - moveNodeUp(node); + long current = node.getPriority(); + if (current == Long.MAX_VALUE || (current > 0 && prio > 0 && prio + current < 0)) + node.setPriority(Long.MAX_VALUE); + else + node.setPriority(current + prio); + while (node.getBefore() != null && node.getPriority() >= node.getBefore().getPriority()) { + moveNodeUp(node); } } - public void addPrioToNode(int index){ - addPrioToNode(index,1L); + public void addPrioToNode(int index) { + addPrioToNode(index, 1L); } @Override @@ -376,12 +382,12 @@ public class AccessPriorityList implements List, Deque, Set { @Override public ListIterator listIterator() { - return new AccessPriorityListIterators.AccessPriorityListListIterator<>(head,tail,false); + return new AccessPriorityListIterators.AccessPriorityListListIterator<>(head, tail, false); } @Override public ListIterator listIterator(int index) { - return new AccessPriorityListIterators.AccessPriorityListListIterator<>(this,index); + return new AccessPriorityListIterators.AccessPriorityListListIterator<>(this, index); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java new file mode 100644 index 0000000000..3a43bba536 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util.flowerset; + +import java.util.Collection; +import java.util.Iterator; +import java.util.Set; +import java.util.function.Function; + +public class FlowerSet implements Set { + + public FlowerSet(int petals, Function comparerison) { + this.petals = petals; + this.comparerison = comparerison; + } + + final int petals; + final Function comparerison; + + public static FlowerSet createBase64(Function comparerison) { + return new FlowerSet(64, comparerison); + } + + public static FlowerSet createHexflower(Function comparerison) { + return new FlowerSet(16, comparerison); + } + + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator iterator() { + return null; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public T1[] toArray(T1[] a) { + return null; + } + + @Override + public boolean add(T t) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection c) { + return false; + } + + @Override + public boolean addAll(Collection c) { + return false; + } + + @Override + public boolean retainAll(Collection c) { + return false; + } + + @Override + public boolean removeAll(Collection c) { + return false; + } + + @Override + public void clear() { + + } + + static class FlowerNode { + private final FlowerSet map; + final V value; + final FlowerNode[] links; + + public FlowerNode(V value, FlowerSet map) { + this.value = value; + this.map = map; + links = new FlowerNode[map.petals]; + } + + private static final int DEPTH = 20480; + + public void TryToSetSingleNode(FlowerNode node, FlowerNode toset, int place, int depth) { + if (depth > DEPTH) + throw new IllegalStateException("Recursive Call went too deep."); + if (node.links[place] == null) + node.links[place] = toset; + else + TryToSetSingleNode(node.links[place], toset, place, depth++); + } + + public void TryToSetSingleNode(FlowerNode node, FlowerNode toset, int place) { + if (node.links[place] == null) + node.links[place] = toset; + else + TryToSetSingleNode(node.links[place], toset, place, 0); + } + + @SafeVarargs + public final void SetUpLinks(FlowerNode... links) { + for (FlowerNode node : links) { + int place = map.comparerison.apply(node); + TryToSetSingleNode(this, node, place); + } + } + } + + static class Functions { + public static Function HashBasedFunction() { + return function -> function.hashCode() % function.map.petals; + } + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java new file mode 100644 index 0000000000..1009ed4bc1 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util.log; + +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +import java.io.File; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.GregorianCalendar; +import java.util.logging.FileHandler; +import java.util.logging.Formatter; +import java.util.logging.LogRecord; +import java.util.logging.Logger; + +public class DebugLog { + private static boolean init; + static FileHandler fh; + private static Logger utilLog; + + public static void initDebugLog(FMLPreInitializationEvent event) throws IOException { + if (DebugLog.init) + return; + DebugLog.fh = new FileHandler(new File(new File(event.getModConfigurationDirectory().getParentFile(),"logs"),"BWLog.log").toString()); + DebugLog.utilLog = Logger.getLogger("DebugLog"); + DebugLog.utilLog.setUseParentHandlers(false); + DebugLog.utilLog.addHandler(DebugLog.fh); + Formatter formatter = new Formatter() { + @Override + public String format(LogRecord record) { + SimpleDateFormat logTime = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); + Calendar cal = new GregorianCalendar(); + cal.setTimeInMillis(record.getMillis()); + return "Level: " + record.getLevel() + +" at " + logTime.format(cal.getTime()) + + " " + record.getMessage() + "\n"; + } + }; + DebugLog.fh.setFormatter(formatter); + DebugLog.init = true; + } + + public static void log(String record){ + if (!DebugLog.init) + return; + DebugLog.utilLog.info(record); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/log/STFUGTPPLOG.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/log/STFUGTPPLOG.java new file mode 100644 index 0000000000..8199032651 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/log/STFUGTPPLOG.java @@ -0,0 +1,665 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util.log; + +import org.apache.commons.lang3.reflect.FieldUtils; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.message.Message; +import org.apache.logging.log4j.message.MessageFactory; + +import java.lang.reflect.Field; + +public class STFUGTPPLOG implements Logger { + + public static void replaceLogger(){ + try { + Field loggerField = FieldUtils.getField(Class.forName("gtPlusPlus.api.objects.Logger"), "modLogger", true); + FieldUtils.removeFinalModifier(loggerField, true); + loggerField.set(null, new STFUGTPPLOG()); + } catch (IllegalAccessException | ClassNotFoundException e) { + e.printStackTrace(); + } + } + + @Override + public void catching(Level level, Throwable t) { + + } + + @Override + public void catching(Throwable t) { + + } + + @Override + public void debug(Marker marker, Message msg) { + + } + + @Override + public void debug(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void debug(Marker marker, Object message) { + + } + + @Override + public void debug(Marker marker, Object message, Throwable t) { + + } + + @Override + public void debug(Marker marker, String message) { + + } + + @Override + public void debug(Marker marker, String message, Object... params) { + + } + + @Override + public void debug(Marker marker, String message, Throwable t) { + + } + + @Override + public void debug(Message msg) { + + } + + @Override + public void debug(Message msg, Throwable t) { + + } + + @Override + public void debug(Object message) { + + } + + @Override + public void debug(Object message, Throwable t) { + + } + + @Override + public void debug(String message) { + + } + + @Override + public void debug(String message, Object... params) { + + } + + @Override + public void debug(String message, Throwable t) { + + } + + @Override + public void entry() { + + } + + @Override + public void entry(Object... params) { + + } + + @Override + public void error(Marker marker, Message msg) { + + } + + @Override + public void error(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void error(Marker marker, Object message) { + + } + + @Override + public void error(Marker marker, Object message, Throwable t) { + + } + + @Override + public void error(Marker marker, String message) { + + } + + @Override + public void error(Marker marker, String message, Object... params) { + + } + + @Override + public void error(Marker marker, String message, Throwable t) { + + } + + @Override + public void error(Message msg) { + + } + + @Override + public void error(Message msg, Throwable t) { + + } + + @Override + public void error(Object message) { + + } + + @Override + public void error(Object message, Throwable t) { + + } + + @Override + public void error(String message) { + + } + + @Override + public void error(String message, Object... params) { + + } + + @Override + public void error(String message, Throwable t) { + + } + + @Override + public void exit() { + + } + + @Override + public R exit(R result) { + return null; + } + + @Override + public void fatal(Marker marker, Message msg) { + + } + + @Override + public void fatal(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void fatal(Marker marker, Object message) { + + } + + @Override + public void fatal(Marker marker, Object message, Throwable t) { + + } + + @Override + public void fatal(Marker marker, String message) { + + } + + @Override + public void fatal(Marker marker, String message, Object... params) { + + } + + @Override + public void fatal(Marker marker, String message, Throwable t) { + + } + + @Override + public void fatal(Message msg) { + + } + + @Override + public void fatal(Message msg, Throwable t) { + + } + + @Override + public void fatal(Object message) { + + } + + @Override + public void fatal(Object message, Throwable t) { + + } + + @Override + public void fatal(String message) { + + } + + @Override + public void fatal(String message, Object... params) { + + } + + @Override + public void fatal(String message, Throwable t) { + + } + + @Override + public MessageFactory getMessageFactory() { + return null; + } + + @Override + public String getName() { + return null; + } + + @Override + public void info(Marker marker, Message msg) { + + } + + @Override + public void info(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void info(Marker marker, Object message) { + + } + + @Override + public void info(Marker marker, Object message, Throwable t) { + + } + + @Override + public void info(Marker marker, String message) { + + } + + @Override + public void info(Marker marker, String message, Object... params) { + + } + + @Override + public void info(Marker marker, String message, Throwable t) { + + } + + @Override + public void info(Message msg) { + + } + + @Override + public void info(Message msg, Throwable t) { + + } + + @Override + public void info(Object message) { + + } + + @Override + public void info(Object message, Throwable t) { + + } + + @Override + public void info(String message) { + + } + + @Override + public void info(String message, Object... params) { + + } + + @Override + public void info(String message, Throwable t) { + + } + + @Override + public boolean isDebugEnabled() { + return false; + } + + @Override + public boolean isDebugEnabled(Marker marker) { + return false; + } + + @Override + public boolean isEnabled(Level level) { + return false; + } + + @Override + public boolean isEnabled(Level level, Marker marker) { + return false; + } + + @Override + public boolean isErrorEnabled() { + return false; + } + + @Override + public boolean isErrorEnabled(Marker marker) { + return false; + } + + @Override + public boolean isFatalEnabled() { + return false; + } + + @Override + public boolean isFatalEnabled(Marker marker) { + return false; + } + + @Override + public boolean isInfoEnabled() { + return false; + } + + @Override + public boolean isInfoEnabled(Marker marker) { + return false; + } + + @Override + public boolean isTraceEnabled() { + return false; + } + + @Override + public boolean isTraceEnabled(Marker marker) { + return false; + } + + @Override + public boolean isWarnEnabled() { + return false; + } + + @Override + public boolean isWarnEnabled(Marker marker) { + return false; + } + + @Override + public void log(Level level, Marker marker, Message msg) { + + } + + @Override + public void log(Level level, Marker marker, Message msg, Throwable t) { + + } + + @Override + public void log(Level level, Marker marker, Object message) { + + } + + @Override + public void log(Level level, Marker marker, Object message, Throwable t) { + + } + + @Override + public void log(Level level, Marker marker, String message) { + + } + + @Override + public void log(Level level, Marker marker, String message, Object... params) { + + } + + @Override + public void log(Level level, Marker marker, String message, Throwable t) { + + } + + @Override + public void log(Level level, Message msg) { + + } + + @Override + public void log(Level level, Message msg, Throwable t) { + + } + + @Override + public void log(Level level, Object message) { + + } + + @Override + public void log(Level level, Object message, Throwable t) { + + } + + @Override + public void log(Level level, String message) { + + } + + @Override + public void log(Level level, String message, Object... params) { + + } + + @Override + public void log(Level level, String message, Throwable t) { + + } + + @Override + public void printf(Level level, Marker marker, String format, Object... params) { + + } + + @Override + public void printf(Level level, String format, Object... params) { + + } + + @Override + public T throwing(Level level, T t) { + return null; + } + + @Override + public T throwing(T t) { + return null; + } + + @Override + public void trace(Marker marker, Message msg) { + + } + + @Override + public void trace(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void trace(Marker marker, Object message) { + + } + + @Override + public void trace(Marker marker, Object message, Throwable t) { + + } + + @Override + public void trace(Marker marker, String message) { + + } + + @Override + public void trace(Marker marker, String message, Object... params) { + + } + + @Override + public void trace(Marker marker, String message, Throwable t) { + + } + + @Override + public void trace(Message msg) { + + } + + @Override + public void trace(Message msg, Throwable t) { + + } + + @Override + public void trace(Object message) { + + } + + @Override + public void trace(Object message, Throwable t) { + + } + + @Override + public void trace(String message) { + + } + + @Override + public void trace(String message, Object... params) { + + } + + @Override + public void trace(String message, Throwable t) { + + } + + @Override + public void warn(Marker marker, Message msg) { + + } + + @Override + public void warn(Marker marker, Message msg, Throwable t) { + + } + + @Override + public void warn(Marker marker, Object message) { + + } + + @Override + public void warn(Marker marker, Object message, Throwable t) { + + } + + @Override + public void warn(Marker marker, String message) { + + } + + @Override + public void warn(Marker marker, String message, Object... params) { + + } + + @Override + public void warn(Marker marker, String message, Throwable t) { + + } + + @Override + public void warn(Message msg) { + + } + + @Override + public void warn(Message msg, Throwable t) { + + } + + @Override + public void warn(Object message) { + + } + + @Override + public void warn(Object message, Throwable t) { + + } + + @Override + public void warn(String message) { + + } + + @Override + public void warn(String message, Object... params) { + + } + + @Override + public void warn(String message, Throwable t) { + + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java new file mode 100644 index 0000000000..a8fd428baa --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +@API(owner = "bartworks", apiVersion = API_REFERENCE.VERSION, provides = "bartworks util") +package com.github.bartimaeusnek.bartworks.util; + +import com.github.bartimaeusnek.bartworks.API.API_REFERENCE; +import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 953cfa62ad..526a9f6be7 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,12 +22,12 @@ package com.github.bartimaeusnek.crossmod; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.tectech.TecTechResearchLoader; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; -import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; @@ -63,27 +63,27 @@ public class BartWorksCrossmod { @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { -// if (Loader.isModLoaded("appliedenergistics2")) +// if (LoaderReference.appliedenergistics2) // new ItemSingleItemStorageCell("singleItemStorageCell"); - if (Loader.isModLoaded("GalacticraftCore")) + if (LoaderReference.GalacticraftCore) GalacticraftProxy.preInit(preinit); - if (Loader.isModLoaded("Thaumcraft")) + if (LoaderReference.Thaumcraft) new CustomAspects(); } @Mod.EventHandler public void init(FMLInitializationEvent init) { - if (Loader.isModLoaded("GalacticraftCore")) + if (LoaderReference.GalacticraftCore) GalacticraftProxy.init(init); } @Mod.EventHandler public void postInit(FMLPostInitializationEvent init) { - if (Loader.isModLoaded("GalacticraftCore")) + if (LoaderReference.GalacticraftCore) GalacticraftProxy.postInit(init); - if (Loader.isModLoaded("miscutils")) - new RadioHatchCompat().run(); - if (Loader.isModLoaded("tectech")) + if (LoaderReference.miscutils) + RadioHatchCompat.run(); + if (LoaderReference.tectech) TecTechResearchLoader.runResearches(); } @@ -97,7 +97,7 @@ public class BartWorksCrossmod { // @Mod.EventHandler // public void onServerStarted(FMLServerStartedEvent event) { -// if (Loader.isModLoaded("EMT")){ +// if (LoaderReference.EMT){ // try { // TCRecipeHandler.init(); // } catch (IllegalAccessException | InvocationTargetException e) { @@ -108,7 +108,7 @@ public class BartWorksCrossmod { @Mod.EventHandler public void onFMLServerStart(FMLServerStartingEvent event) { - if (Loader.isModLoaded("miscutils")) + if (LoaderReference.miscutils) for (Object s : RadioHatchCompat.TranslateSet){ StringTranslate.inject(new ReaderInputStream(new StringReader((String) s))); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java index 11ae398d54..2b46acee0f 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.crossmod.GTpp.loader; import com.github.bartimaeusnek.bartworks.API.IRadMaterial; -import com.github.bartimaeusnek.bartworks.system.log.DebugLog; +import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; @@ -39,7 +39,7 @@ import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.util.*; @SuppressWarnings({"unchecked","rawtypes","unused"}) -public class RadioHatchCompat implements Runnable { +public class RadioHatchCompat { private static Class intf; private static Class materialClass; @@ -104,8 +104,7 @@ public class RadioHatchCompat implements Runnable { } } - @Override - public void run() { + public static void run() { DebugLog.log("Starting Generation of missing GT++ rods/longrods"); try { Class rodclass = Class.forName("gtPlusPlus.core.item.base.rods.BaseItemRod"); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java new file mode 100644 index 0000000000..930360bef4 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.cls; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Optional; + +@SuppressWarnings({"rawtypes","unchecked"}) +public class CLSCompat { + private CLSCompat() { + } + + private static Class alexiilMinecraftDisplayer; + private static Class alexiilProgressDisplayer; + private static Method displayProgress; + private static Field isRegisteringBartWorks; + + static { + try { + alexiilMinecraftDisplayer = Class.forName("alexiil.mods.load.MinecraftDisplayer"); + alexiilProgressDisplayer = Class.forName("alexiil.mods.load.ProgressDisplayer"); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + + Optional.ofNullable(alexiilMinecraftDisplayer).ifPresent(e -> { + try { + isRegisteringBartWorks = e.getField("isRegisteringBartWorks"); + } catch (NoSuchFieldException ex) { + ex.printStackTrace(); + } + }); + + Optional.ofNullable(alexiilProgressDisplayer).ifPresent(e -> { + try { + displayProgress = e.getMethod("displayProgress", String.class, float.class); + } catch (NoSuchMethodException ex) { + ex.printStackTrace(); + } + }); + } + + public static Integer[] initCls() { + int sizeStep; + int sizeStep2 = 1; + + try { + isRegisteringBartWorks.set(null, true); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + + if (Werkstoff.werkstoffHashSet.size() >= 100) + sizeStep = Werkstoff.werkstoffHashSet.size() / 100 - 1; + else + sizeStep = sizeStep2 = Werkstoff.werkstoffHashSet.size(); + + return new Integer[]{sizeStep, sizeStep2, sizeStep}; + } + + public static int invokeStepSize(Werkstoff werkstoff, Integer[] steps, int size) { + --steps[0]; + + try { + displayProgress.invoke(null, werkstoff.getDefaultName(), ((float) size) / 10000); + } catch (IllegalAccessException | InvocationTargetException e) { + e.printStackTrace(); + } + + if (steps[0] == 0 && Werkstoff.werkstoffHashSet.size() >= 100) + steps[0] = steps[2]; + + size += steps[1]; + return size; + } + + public static void disableCls() { + try { + isRegisteringBartWorks.set(null, false); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java new file mode 100644 index 0000000000..bc81b2026c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -0,0 +1,387 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticgreg; + +import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_Layer_Space; +import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_SmallPieces_Space; +import bloodasp.galacticgreg.GalacticGreg; +import bloodasp.galacticgreg.api.ModDimensionDef; +import bloodasp.galacticgreg.bartworks.BW_Worldgen_Ore_Layer_Space; +import bloodasp.galacticgreg.bartworks.BW_Worldgen_Ore_SmallOre_Space; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer; +import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b; +import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128ba; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.Pair; +import com.google.common.collect.ArrayListMultimap; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.objects.XSTR; +import gregtech.api.util.GT_LanguageManager; +import gregtech.common.GT_Worldgen_GT_Ore_Layer; +import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; +import net.minecraft.world.gen.ChunkProviderServer; +import net.minecraftforge.fluids.FluidStack; + +import java.util.*; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +import static bloodasp.galacticgreg.registry.GalacticGregRegistry.getModContainers; + +@SuppressWarnings("ALL") +public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_DrillerBase { + + private static ArrayListMultimap, Float>> extraDropsDimMap = ArrayListMultimap.create(); + private static FluidStack[] NOBLE_GASSES = new FluidStack[]{ + WerkstoffLoader.Neon.getFluidOrGas(1), + WerkstoffLoader.Krypton.getFluidOrGas(1), + WerkstoffLoader.Xenon.getFluidOrGas(1), + WerkstoffLoader.Oganesson.getFluidOrGas(1) + }; + + private HashMap, Float> dropmap = null; + private float totalWeight; + private int multiplier = 1; + + protected byte TIER_MULTIPLIER; + + public static void addMatierialToDimensionList(int DimensionID, ISubTagContainer Material, float weight) { + if (Material instanceof Materials) + getExtraDropsDimMap().put(DimensionID, new Pair<>(new Pair<>(((Materials)Material).mMetaItemSubID,false), weight)); + else if (Material instanceof Werkstoff) + getExtraDropsDimMap().put(DimensionID, new Pair<>(new Pair<>((int) ((Werkstoff)Material).getmID(),true), weight)); + } + + static { + addMatierialToDimensionList(0, Materials.Tellurium, 8.0f); + } + + public GT_TileEntity_VoidMiner_Base(int aID, String aName, String aNameRegional, int tier) { + super(aID, aName, aNameRegional); + TIER_MULTIPLIER = (byte) Math.max(tier, 1); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setByte("TIER_MULTIPLIER",TIER_MULTIPLIER); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + TIER_MULTIPLIER = aNBT.getByte("TIER_MULTIPLIER"); + } + + public GT_TileEntity_VoidMiner_Base(String aName, int tier) { + super(aName); + TIER_MULTIPLIER = (byte) tier; + } + + @Override + protected int getMinTier() { + return this.TIER_MULTIPLIER + 5; //min tier = LuV + } + + @Override + protected boolean checkHatches() { + return true; + } + + @Override + protected void setElectricityStats() { + try { + this.mEUt = this.isPickingPipes ? 60 : Math.toIntExact(GT_Values.V[this.getMinTier()]); + } catch (ArithmeticException e) { + e.printStackTrace(); + this.mEUt = Integer.MAX_VALUE - 7; + } + this.mOutputItems = new ItemStack[0]; + this.mProgresstime = 0; + this.mMaxProgresstime = 10; + this.mEfficiency = this.getCurrentEfficiency(null); + this.mEfficiencyIncrease = 10000; + this.mEUt = this.mEUt > 0 ? -this.mEUt : this.mEUt; + } + + @Override + protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + makeDropMap(); + handleFluidConsumption(); + handleOutputs(); + return true; + } + + @Override + public String[] getDescription() { + String casingName = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(this.getCasingBlockItem().get(1L))); + return new String[]{"Controller Block for the Void Miner "+ GT_Values.VN[this.getMinTier()], + "Size(WxHxD): 3x7x3", + "Controller (Front middle at bottom)", + "3x1x3 Base of " + casingName, + "1x3x1 " + casingName + " pillar (Center of base)", + "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", + "1x Output Bus (One of base casings)", + "Optional: 0+ Input Hatch (One of base casings)", + "1x Maintenance Hatch (One of base casings)", + "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", + "Consumes " + GT_Values.V[this.getMinTier()] + "EU/t", + "Can be supplied with 2L/s of Neon(x4), Krypton(x8), Xenon(x16) or Oganesson(x64)", + "for higher outputs.", + "Will output "+(2*TIER_MULTIPLIER)+" Ores per Second depending on the Dimension it is build in", + StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks" + }; + } + + public static ArrayListMultimap, Float>> getExtraDropsDimMap() { + return extraDropsDimMap; + } + + private Predicate makeOreLayerPredicate() { + switch (this.getBaseMetaTileEntity().getWorld().provider.dimensionId) { + case -1: + return gt_worldgen -> gt_worldgen.mNether; + case 0: + return gt_worldgen -> gt_worldgen.mOverworld; + case 1: + return gt_worldgen -> gt_worldgen.mEnd || gt_worldgen.mEndAsteroid; + default: + throw new IllegalStateException(); + } + } + + private Predicate makeSmallOresPredicate() { + switch (this.getBaseMetaTileEntity().getWorld().provider.dimensionId) { + case -1: + return gt_worldgen -> gt_worldgen.mNether; + case 0: + return gt_worldgen -> gt_worldgen.mOverworld; + case 1: + return gt_worldgen -> gt_worldgen.mEnd; + default: + throw new IllegalStateException(); + } + } + + private void getDropsVanillaVeins(Predicate oreLayerPredicate) { + GT_Worldgen_GT_Ore_Layer.sList.stream().filter(gt_worldgen -> gt_worldgen.mEnabled && oreLayerPredicate.test(gt_worldgen)).forEach(element -> { + dropmap.put(new Pair<>((int) element.mPrimaryMeta,false), (float) element.mWeight); + dropmap.put(new Pair<>((int) element.mSecondaryMeta,false), (float) element.mWeight); + dropmap.put(new Pair<>((int) element.mSporadicMeta,false), (element.mWeight / 8f)); + dropmap.put(new Pair<>((int) element.mBetweenMeta,false), (element.mWeight / 8f)); + } + ); + } + + private void getDropsVanillaSmallOres(Predicate smallOresPredicate) { + GT_Worldgen_GT_Ore_SmallPieces.sList.stream().filter(gt_worldgen -> gt_worldgen.mEnabled && smallOresPredicate.test(gt_worldgen)).forEach(element -> + dropmap.put(new Pair<>((int) element.mMeta,false), (float) element.mAmount) + ); + } + + private void getDropMapVanilla() { + getDropsVanillaVeins(makeOreLayerPredicate()); + getDropsVanillaSmallOres(makeSmallOresPredicate()); + } + + private void getDropMapSpace(ModDimensionDef finalDef) { + getDropsOreVeinsSpace(finalDef); + getDropsSmallOreSpace(finalDef); + } + + private void getDropsOreVeinsSpace(ModDimensionDef finalDef) { + Set space = GalacticGreg.oreVeinWorldgenList.stream() + .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof GT_Worldgen_GT_Ore_Layer_Space && ((GT_Worldgen_GT_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) + .collect(Collectors.toSet()); + + space.forEach( + element -> { + dropmap.put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mPrimaryMeta,false), (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); + dropmap.put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSecondaryMeta,false), (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); + dropmap.put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSporadicMeta,false), (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); + dropmap.put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mBetweenMeta,false), (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); + } + ); + } + + private void getDropsSmallOreSpace(ModDimensionDef finalDef) { + Set space = GalacticGreg.smallOreWorldgenList.stream() + .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof GT_Worldgen_GT_Ore_SmallPieces_Space && ((GT_Worldgen_GT_Ore_SmallPieces_Space) gt_worldgen).isEnabledForDim(finalDef)) + .collect(Collectors.toSet()); + + space.forEach( + element -> + dropmap.put(new Pair<>((int) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mMeta,false), (float) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mAmount) + ); + } + + private Pair getOreDamage() { + int curentWeight = 0; + while (true) { + int randomeint = (Math.abs(XSTR.XSTR_INSTANCE.nextInt((int) Math.ceil(totalWeight)))); + for (Map.Entry, Float> entry : dropmap.entrySet()) { + curentWeight += entry.getValue(); + if (randomeint < curentWeight) + return entry.getKey(); + } + } + } + + private FluidStack getNobleGasInputAndSetMultiplier() { + for (FluidStack s : this.getStoredFluids()) { + for (int i = 0; i < NOBLE_GASSES.length; i++) { + FluidStack ng = NOBLE_GASSES[i]; + if (ng.isFluidEqual(s)) { + multiplier = TIER_MULTIPLIER * (2 << (i == NOBLE_GASSES.length - 1 ? (i+2) : (i+1))); + return s; + } + } + } + return null; + } + + private boolean consumeNobleGas(FluidStack gasToConsume) { + for (FluidStack s : this.getStoredFluids()) { + if (s.isFluidEqual(gasToConsume) && s.amount >= 1) { + s.amount -= 1; + this.updateSlots(); + return true; + } + } + return false; + } + + private void handleFluidConsumption() { + FluidStack storedNobleGas = getNobleGasInputAndSetMultiplier(); + if (storedNobleGas == null || !consumeNobleGas(storedNobleGas)) + multiplier = TIER_MULTIPLIER; + } + + private void getDropMapBartworks(ModDimensionDef finalDef, int aID) { + Consumer addToList = makeAddToList(); + if (aID == ConfigHandler.ross128BID) + BW_WorldGenRoss128b.sList.forEach(addToList); + else if (aID == ConfigHandler.ross128BAID) + BW_WorldGenRoss128ba.sList.forEach(addToList); + else { + addOresVeinsBartworks(finalDef, addToList); + addSmallOresBartworks(finalDef); + } + } + + private Consumer makeAddToList() { + return element -> { + List> data = element.getStacksRawData(); + for (int i = 0; i < data.size(); i++) { + if (i < data.size()-1) + dropmap.put(data.get(i), (float) element.mWeight); + else + dropmap.put(data.get(i), (element.mWeight/8f)); + } + }; + } + + private ModDimensionDef makeModDimDef() { + return getModContainers().stream() + .flatMap(modContainer -> modContainer.getDimensionList().stream()) + .filter(modDimensionDef -> modDimensionDef.getChunkProviderName() + .equals(((ChunkProviderServer) this.getBaseMetaTileEntity().getWorld().getChunkProvider()).currentChunkProvider.getClass().getName())) + .findFirst().orElse(null); + } + + private void addOresVeinsBartworks(ModDimensionDef finalDef, Consumer addToList) { + try { + Set space = GalacticGreg.oreVeinWorldgenList.stream() + .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_Worldgen_Ore_Layer_Space && ((BW_Worldgen_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) + .collect(Collectors.toSet()); + + space.forEach(addToList); + } catch (NullPointerException ignored) {} + } + + private void addSmallOresBartworks(ModDimensionDef finalDef) { + try { + Set space = GalacticGreg.smallOreWorldgenList.stream() + .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_Worldgen_Ore_SmallOre_Space && ((BW_Worldgen_Ore_SmallOre_Space) gt_worldgen).isEnabledForDim(finalDef)) + .collect(Collectors.toSet()); + + space.forEach( + element -> + dropmap.put(new Pair<>(((BW_Worldgen_Ore_SmallOre_Space) element).mPrimaryMeta, ((BW_Worldgen_Ore_SmallOre_Space) element).bwOres != 0), (float) ((BW_Worldgen_Ore_SmallOre_Space) element).mDensity) + ); + } catch (NullPointerException ignored) {} + } + + private void handleExtraDrops(int id) { + Optional.ofNullable(getExtraDropsDimMap().get(id)).ifPresent(e -> e.forEach(f -> dropmap.put(f.getKey(), f.getValue()))); + } + + private void calculateTotalWeight() { + totalWeight = 0.0f; + dropmap.values().forEach(f -> totalWeight += f); + } + + private void handleDimBasedDrops(ModDimensionDef finalDef, int id) { + if (id != ConfigHandler.ross128BID && id != ConfigHandler.ross128BAID) + getDropMapSpace(finalDef); + } + + private void handleModDimDef(int id) { + if (id <= 1 && id >= -1) + getDropMapVanilla(); + Optional.ofNullable(makeModDimDef()).ifPresent(def -> { + handleDimBasedDrops(def, id); + getDropMapBartworks(def, id); + }); + } + + private void calculateDropMap() { + dropmap = new HashMap<>(); + int id = this.getBaseMetaTileEntity().getWorld().provider.dimensionId; + handleModDimDef(id); + handleExtraDrops(id); + calculateTotalWeight(); + } + + private void makeDropMap() { + if (dropmap == null || totalWeight == 0) + calculateDropMap(); + } + + private void handleOutputs() { + Pair stats = getOreDamage(); + this.addOutput(new ItemStack(stats.getValue() ? WerkstoffLoader.BWOres : GregTech_API.sBlockOres1, multiplier, stats.getKey())); + this.updateSlots(); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java new file mode 100644 index 0000000000..a5058a34d7 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticgreg; + +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; + +public class GT_TileEntity_VoidMiners { + + public static class VMLUV extends GT_TileEntity_VoidMiner_Base { + + public VMLUV(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, 1); + } + + public VMLUV(String aName, int tier) { + super(aName, tier); + } + + @Override + protected ItemList getCasingBlockItem() { + return ItemList.Casing_UV; + } + + @Override + protected Materials getFrameMaterial() { + return Materials.Europium; + } + + @Override + protected int getCasingTextureIndex() { + return 8; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new VMLUV(this.mName, this.TIER_MULTIPLIER); + } + } + + public static class VMZPM extends GT_TileEntity_VoidMiner_Base { + + public VMZPM(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, 2); + } + + public VMZPM(String aName, int tier) { + super(aName, tier); + } + + @Override + protected ItemList getCasingBlockItem() { + return ItemList.Casing_MiningBlackPlutonium; + } + + @Override + protected Materials getFrameMaterial() { + return Materials.BlackPlutonium; + } + + @Override + protected int getCasingTextureIndex() { + return 179; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new VMZPM(this.mName, this.TIER_MULTIPLIER); + } + } + + public static class VMUV extends GT_TileEntity_VoidMiner_Base { + + public VMUV(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, 3); + } + + public VMUV(String aName, int tier) { + super(aName, tier); + } + + @Override + protected ItemList getCasingBlockItem() { + return ItemList.Casing_MiningNeutronium; + } + + @Override + protected Materials getFrameMaterial() { + return Materials.Neutronium; + } + + @Override + protected int getCasingTextureIndex() { + return 178; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new VMUV(this.mName, this.TIER_MULTIPLIER); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java index 255f83a125..447909e03d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,12 +22,12 @@ package com.github.bartimaeusnek.crossmod.galacticraft; +import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128ba; import com.github.bartimaeusnek.crossmod.galacticraft.atmosphere.BWAtmosphereManager; import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; @@ -44,7 +44,7 @@ public class GalacticraftProxy { } public static void postInit(FMLPostInitializationEvent e){ - if (FMLCommonHandler.instance().getSide().isServer() || FMLCommonHandler.instance().getEffectiveSide().isServer()) { + if (SideReference.Side.Server || SideReference.EffectiveSide.Server) { GalacticraftProxy.serverPostInit(e); } else { GalacticraftProxy.clientPostInit(e); @@ -53,7 +53,7 @@ public class GalacticraftProxy { } public static void preInit(FMLPreInitializationEvent e) { - if (FMLCommonHandler.instance().getSide().isServer() || FMLCommonHandler.instance().getEffectiveSide().isServer()) { + if (SideReference.Side.Server || SideReference.EffectiveSide.Server) { GalacticraftProxy.serverpreInit(e); } else { GalacticraftProxy.clientpreInit(e); @@ -81,7 +81,7 @@ public class GalacticraftProxy { } public static void init(FMLInitializationEvent e) { - if (FMLCommonHandler.instance().getSide().isServer() || FMLCommonHandler.instance().getEffectiveSide().isServer()) { + if (SideReference.Side.Server || SideReference.EffectiveSide.Server) { GalacticraftProxy.serverInit(e); } else { GalacticraftProxy.clientInit(e); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java index 372eb2471d..74b0f94a26 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,7 +22,7 @@ package com.github.bartimaeusnek.crossmod.galacticraft; -import cpw.mods.fml.common.Loader; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; import micdoodle8.mods.galacticraft.api.vector.Vector3; import micdoodle8.mods.galacticraft.api.world.ITeleportType; import micdoodle8.mods.galacticraft.core.entities.EntityLander; @@ -71,7 +71,7 @@ public class UniversalTeleportType implements ITeleportType { } EntityLanderBase elb; - if (Loader.isModLoaded("GalacticraftMars")) + if (LoaderReference.GalacticraftMars) elb=PlanetsHelperClass.getLanderType(player); else elb = new EntityLander(player); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index bc33a08855..4bc8f64f10 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,11 +22,11 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WordGenerator; import com.github.bartimaeusnek.bartworks.system.worldgen.MapGenRuins; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; -import cpw.mods.fml.common.Loader; import gregtech.api.objects.XSTR; import net.minecraft.block.Block; import net.minecraft.block.BlockFalling; @@ -83,7 +83,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { } else if (biomeGenBase.biomeID == BiomeGenBase.mushroomIslandShore.biomeID) { this.biomesForGeneration[i] = BiomeGenBase.stoneBeach; } - if (Loader.isModLoaded("Thaumcraft")) { + if (LoaderReference.Thaumcraft) { if (ThaumcraftHandler.isTaintBiome(biomeGenBase.biomeID)) this.biomesForGeneration[i] = BiomeGenBase.taiga; else if (ConfigHandler.disableMagicalForest && ThaumcraftHandler.isMagicalForestBiome(biomeGenBase.biomeID)) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java index 69e7c3d525..cf4c13f326 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java @@ -39,6 +39,7 @@ import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; import java.util.Arrays; +import java.util.Random; public class ChunkProviderRoss128ba extends ChunkProviderMoon { @@ -51,11 +52,11 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { super(world, seed, mapFeaturesEnabled); this.biomesForGeneration = new BiomeGenBase[]{BiomeGenBaseMoon.moonFlat}; this.caveGenerator = new MapGenCavesMoon(); - this.worldObj=world; + this.worldObj = world; } public Chunk provideChunk(int cx, int cz) { - this.rand.setSeed((long)cx * 341873128712L + (long)cz * 132897987541L); + this.rand.setSeed((long) cx * 341873128712L + (long) cz * 132897987541L); Block[] ids = new Block[65536]; byte[] meta = new byte[65536]; Arrays.fill(ids, Blocks.air); @@ -69,6 +70,9 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { return Chunk; } + public void decoratePlanet(World par1World, Random par2Random, int par3, int par4) { + } + @Override public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { super.populate(par1IChunkProvider, par2, par3); @@ -82,21 +86,21 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { } final Block lowerBlockID = GCBlocks.blockMoon; - final BartsNoise noiseGen= new BartsNoise(2,0.008F,1D,System.nanoTime()); - final BartsNoise noiseGen2= new BartsNoise(2,0.01F,1D,System.nanoTime()); - final BartsNoise noiseGen3= new BartsNoise(2,0.002F,1D,System.nanoTime()); + final BartsNoise noiseGen = new BartsNoise(2, 0.008F, 1D, System.nanoTime()); + final BartsNoise noiseGen2 = new BartsNoise(2, 0.01F, 1D, System.nanoTime()); + final BartsNoise noiseGen3 = new BartsNoise(2, 0.002F, 1D, System.nanoTime()); public void generateTerrain(int chunkX, int chunkZ, Block[] idArray, byte[] metaArray) { - for(int x = 0; x < 16; ++x) { - for(int z = 0; z < 16; ++z) { + for (int x = 0; x < 16; ++x) { + for (int z = 0; z < 16; ++z) { double d = noiseGen.getNoise(x + chunkX * 16, z + chunkZ * 16); double d2 = noiseGen2.getNoise(x + chunkX * 16, z + chunkZ * 16); double d3 = noiseGen3.getCosNoise(x + chunkX * 16, z + chunkZ * 16); - double yDev = d*4+d2*2+d3; + double yDev = d * 4 + d2 * 2 + d3; - for(int y = 0; y < 128; ++y) { - if ((double)y < 60.0D + yDev) { + for (int y = 0; y < 128; ++y) { + if ((double) y < 60.0D + yDev) { idArray[this.getIndex(x, y, z)] = this.lowerBlockID; int var10001 = this.getIndex(x, y, z); metaArray[var10001] = 4; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java deleted file mode 100644 index 8ecb971452..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba; - -import com.github.bartimaeusnek.bartworks.util.MathUtils; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.AbstractWorldProviderSpace; -import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; -import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; -import micdoodle8.mods.galacticraft.api.vector.Vector3; -import micdoodle8.mods.galacticraft.core.world.gen.WorldChunkManagerMoon; -import net.minecraft.world.biome.WorldChunkManager; -import net.minecraft.world.chunk.IChunkProvider; - -public class WorldProviderRoss128Ba extends AbstractWorldProviderSpace { - @Override - public Vector3 getFogColor() { - return new Vector3(0,0,0); - } - - @Override - public Vector3 getSkyColor() { - return new Vector3(0,0,0); - } - - @Override - public long getDayLength() { - return (long) MathUtils.floor(24000f*9.9f/100f); - } - @Override - public boolean hasSunset() { - return false; - } - - @Override - public Class getChunkProviderClass() { - return ChunkProviderRoss128ba.class; - } - - @Override - public Class getWorldChunkManagerClass() { - return WorldChunkManagerMoon.class; - } - - @Override - public double getYCoordinateToTeleport() { - return 500; - } - - @Override - public float getGravity() { - return 0.060f; - } - - @Override - public double getMeteorFrequency() { - return 9D; - } - - @Override - public double getFuelUsageMultiplier() { - return 0.7D; - } - - @Override - public boolean canSpaceshipTierPass(int i) { - return i >= Ross128SolarSystem.Ross128ba.getTierRequirement(); - } - - @Override - public float getFallDamageModifier() { - return 0.2f; - } - - @Override - public float getSoundVolReductionAmount() { - return 20f; - } - - @Override - public float getThermalLevelModifier() { - return 0; - } - - @Override - public float getWindLevel() { - return 0; - } - - @Override - public CelestialBody getCelestialBody() { - return Ross128SolarSystem.Ross128ba; - } - - @Override - public double getSolarEnergyMultiplier() { - return 1.9D; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java new file mode 100644 index 0000000000..c51fe51611 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba; + +import com.github.bartimaeusnek.bartworks.util.MathUtils; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.AbstractWorldProviderSpace; +import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; +import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; +import micdoodle8.mods.galacticraft.api.vector.Vector3; +import micdoodle8.mods.galacticraft.core.world.gen.WorldChunkManagerMoon; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.IChunkProvider; + +public class WorldProviderRoss128ba extends AbstractWorldProviderSpace { + @Override + public Vector3 getFogColor() { + return new Vector3(0, 0, 0); + } + + @Override + public Vector3 getSkyColor() { + return new Vector3(0, 0, 0); + } + + @Override + public long getDayLength() { + return MathUtils.floorLong(24000f * 9.9f / 100f); + } + + @Override + public boolean hasSunset() { + return false; + } + + @Override + public Class getChunkProviderClass() { + return ChunkProviderRoss128ba.class; + } + + @Override + public Class getWorldChunkManagerClass() { + return WorldChunkManagerMoon.class; + } + + @Override + public double getYCoordinateToTeleport() { + return 500; + } + + @Override + public float getGravity() { + return 0.060f; + } + + @Override + public double getMeteorFrequency() { + return 9D; + } + + @Override + public double getFuelUsageMultiplier() { + return 0.7D; + } + + @Override + public boolean canSpaceshipTierPass(int i) { + return i >= Ross128SolarSystem.Ross128ba.getTierRequirement(); + } + + @Override + public float getFallDamageModifier() { + return 0.2f; + } + + @Override + public float getSoundVolReductionAmount() { + return 20f; + } + + @Override + public float getThermalLevelModifier() { + return 0; + } + + @Override + public float getWindLevel() { + return 0; + } + + @Override + public CelestialBody getCelestialBody() { + return Ross128SolarSystem.Ross128ba; + } + + @Override + public double getSolarEnergyMultiplier() { + return 1.9D; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index cc3f2a0744..bc47a60f4a 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,12 +22,12 @@ package com.github.bartimaeusnek.crossmod.galacticraft.solarsystems; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.WorldProviderRoss128b; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba.WorldProviderRoss128Ba; -import cpw.mods.fml.common.Loader; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba.WorldProviderRoss128ba; import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; import micdoodle8.mods.galacticraft.api.galaxies.*; import micdoodle8.mods.galacticraft.api.vector.Vector3; @@ -68,16 +68,16 @@ public class Ross128SolarSystem { Ross128SolarSystem.Ross128ba = new Moon("Ross128ba").setParentPlanet(Ross128SolarSystem.Ross128b); Ross128SolarSystem.Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)).setRelativeOrbitTime(1 / 0.01F); Ross128SolarSystem.Ross128ba.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); - Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128Ba.class); - Ross128SolarSystem.Ross128ba.setTierRequired(Loader.isModLoaded("GalaxySpace") ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3); + Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128ba.class); + Ross128SolarSystem.Ross128ba.setTierRequired(LoaderReference.GalaxySpace ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3); GalaxyRegistry.registerSolarSystem(Ross128SolarSystem.Ross128System); GalaxyRegistry.registerPlanet(Ross128SolarSystem.Ross128b); GalaxyRegistry.registerMoon(Ross128SolarSystem.Ross128ba); GalacticraftRegistry.registerRocketGui(WorldProviderRoss128b.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/overworldRocketGui.png")); - GalacticraftRegistry.registerRocketGui(WorldProviderRoss128Ba.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/moonRocketGui.png")); + GalacticraftRegistry.registerRocketGui(WorldProviderRoss128ba.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/moonRocketGui.png")); GalacticraftRegistry.registerTeleportType(WorldProviderRoss128b.class, new UniversalTeleportType()); - GalacticraftRegistry.registerTeleportType(WorldProviderRoss128Ba.class, new UniversalTeleportType()); + GalacticraftRegistry.registerTeleportType(WorldProviderRoss128ba.class, new UniversalTeleportType()); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java index 1cfdcf32d6..082b7307d1 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,9 +25,9 @@ package com.github.bartimaeusnek.crossmod.openComputers; import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; +import com.github.bartimaeusnek.bartworks.API.SideReference; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Optional; import gregtech.api.enums.ItemList; import gregtech.api.util.GT_Utility; @@ -77,7 +77,7 @@ public class TileEntity_GTDataServer extends TileEntity implements ISidedInvento private boolean isServerSide(){ - return !this.worldObj.isRemote || FMLCommonHandler.instance().getSide().isServer(); + return !this.worldObj.isRemote || SideReference.Side.Server; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java new file mode 100644 index 0000000000..9f78d02d5a --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech; + +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel; +import gregtech.api.enums.GT_Values; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.util.GT_Utility; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; + +import java.util.List; + +public interface TecTechEnabledMulti { + + List getVanillaEnergyHatches(); + + List getTecTechEnergyTunnels(); + + List getTecTechEnergyMultis(); + + default long[] getCurrentInfoData() { + long storedEnergy = 0, maxEnergy = 0; + for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : this.getTecTechEnergyTunnels()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + } + } + + for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : this.getTecTechEnergyMultis()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + } + } + return new long[]{storedEnergy, maxEnergy}; + } + + default String[] getInfoDataArray(GT_MetaTileEntity_MultiBlockBase multiBlockBase) { + int mPollutionReduction = 0; + + for (GT_MetaTileEntity_Hatch_Muffler tHatch : multiBlockBase.mMufflerHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); + } + } + + long[] ttHatches = getCurrentInfoData(); + long storedEnergy = ttHatches[0]; + long maxEnergy = ttHatches[1]; + + for (GT_MetaTileEntity_Hatch_Energy tHatch : multiBlockBase.mEnergyHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + } + } + + return new String[]{ + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + multiBlockBase.mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + multiBlockBase.mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + -multiBlockBase.mEUt + EnumChatFormatting.RESET + " EU/t", StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + multiBlockBase.getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(multiBlockBase.getMaxInputVoltage())] + EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + (multiBlockBase.getIdealStatus() - multiBlockBase.getRepairStatus()) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW + (float) multiBlockBase.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java index 855c5011a1..c16a042aca 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,7 +22,9 @@ package com.github.bartimaeusnek.crossmod.tectech; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.technus.tectech.recipe.TT_recipeAdder; import gregtech.api.enums.ItemList; @@ -31,10 +33,62 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; import net.minecraftforge.fluids.FluidStack; -public class TecTechResearchLoader { +public class TecTechResearchLoader { @SuppressWarnings("deprecation") - public static void runResearches(){ + public static void runResearches() { + + if (LoaderReference.galacticgreg) { + + TT_recipeAdder.addResearchableAssemblylineRecipe( + ItemRegistry.voidminer[0].copy(), + 1024000, + 256, + BW_Util.getMachineVoltageFromTier(7), + 24, + new Object[]{ + ItemRegistry.voidminer[0].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), + Materials.BlackPlutonium.getPlates(3), + ItemList.Electric_Motor_ZPM.get(9L), + ItemList.Sensor_ZPM.get(9L), + ItemList.Field_Generator_ZPM.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) + }, + new FluidStack[]{ + Materials.SolderingAlloy.getMolten(1440), + WerkstoffLoader.Krypton.getFluidOrGas(20000) + }, + ItemRegistry.voidminer[1].copy(), + 216000, + BW_Util.getMachineVoltageFromTier(7) + ); + + TT_recipeAdder.addResearchableAssemblylineRecipe( + ItemRegistry.voidminer[1].copy(), + 8192000, + 512, + BW_Util.getMachineVoltageFromTier(8), + 64, + new Object[]{ + ItemRegistry.voidminer[1].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), + Materials.Neutronium.getPlates(3), + ItemList.Electric_Motor_UV.get(9L), + ItemList.Sensor_UV.get(9L), + ItemList.Field_Generator_UV.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) + }, + new FluidStack[]{ + Materials.SolderingAlloy.getMolten(1440), + WerkstoffLoader.Oganesson.getFluidOrGas(20000) + }, + ItemRegistry.voidminer[2].copy(), + 432000, + BW_Util.getMachineVoltageFromTier(8) + ); + + } TT_recipeAdder.addResearchableAssemblylineRecipe( ItemList.Machine_Multi_ImplosionCompressor.get(1L), @@ -45,9 +99,9 @@ public class TecTechResearchLoader { new Object[]{ ItemList.Machine_Multi_ImplosionCompressor.get(1L), Materials.Neutronium.getBlocks(5), - GT_OreDictUnificator.get(OrePrefixes.stickLong,Materials.Osmium,64), - GT_OreDictUnificator.get(OrePrefixes.ring,Materials.Osmium,64), - GT_OreDictUnificator.get(OrePrefixes.wireGt01,Materials.Superconductor,64), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64), ItemList.Electric_Piston_UV.get(64), }, new FluidStack[]{ @@ -83,4 +137,4 @@ public class TecTechResearchLoader { // GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.removeAll(toRemVisualScanner); // GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.removeAll(toRemVisualAssLine); } -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechUtils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechUtils.java new file mode 100644 index 0000000000..7759eddfd5 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechUtils.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech; + +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; + +public class TecTechUtils { + + public static boolean addEnergyInputToMachineList(TecTechEnabledMulti baseTE, IGregTechTileEntity te, int aBaseCasingIndex) { + if (te == null || !(te.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch)) + return false; + else { + GT_MetaTileEntity_Hatch mte = (GT_MetaTileEntity_Hatch) te.getMetaTileEntity(); + + if (mte instanceof GT_MetaTileEntity_Hatch_Energy) + baseTE.getVanillaEnergyHatches().add((GT_MetaTileEntity_Hatch_Energy) mte); + else if (mte instanceof GT_MetaTileEntity_Hatch_EnergyTunnel) + baseTE.getTecTechEnergyTunnels().add((GT_MetaTileEntity_Hatch_EnergyTunnel) mte); + else if (mte instanceof GT_MetaTileEntity_Hatch_EnergyMulti) + baseTE.getTecTechEnergyMultis().add((GT_MetaTileEntity_Hatch_EnergyMulti) mte); + else + return false; + + mte.updateTexture(aBaseCasingIndex); + return true; + } + } + + public static boolean drainEnergyMEBFTecTech(TecTechEnabledMulti multi, long aEU) { + if (aEU <= 0) + return true; + + long allTheEu = 0; + int hatches = 0; + for (GT_MetaTileEntity_Hatch_Energy tHatch : multi.getVanillaEnergyHatches()) + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + allTheEu += tHatch.getEUVar(); + hatches++; + } + + for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : multi.getTecTechEnergyTunnels()) + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + allTheEu += tHatch.getEUVar(); + hatches++; + } + + for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : multi.getTecTechEnergyMultis()) + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + allTheEu += tHatch.getEUVar(); + hatches++; + } + + if (allTheEu < aEU) + return false; + + long euperhatch = aEU / hatches; + + boolean hasDrained = false; + + for (GT_MetaTileEntity_Hatch_Energy tHatch : multi.getVanillaEnergyHatches()) + hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); + + for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : multi.getTecTechEnergyTunnels()) + hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); + + for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : multi.getTecTechEnergyMultis()) + hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); + + return hasDrained && (multi.getVanillaEnergyHatches().size() > 0 || multi.getTecTechEnergyTunnels().size() > 0 || multi.getTecTechEnergyMultis().size() > 0); + } + + public static long getnominalVoltageTT(TecTechEnabledMulti base) { + long rVoltage = 0L; + long rAmperage = 0L; + + for (GT_MetaTileEntity_Hatch_Energy tHatch : base.getVanillaEnergyHatches()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + rVoltage = Math.max(tHatch.getBaseMetaTileEntity().getInputVoltage(), rVoltage); + rAmperage += tHatch.getBaseMetaTileEntity().getInputAmperage(); + } + } + + for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : base.getTecTechEnergyMultis()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + rVoltage = Math.max(tHatch.getBaseMetaTileEntity().getInputVoltage(), rVoltage); + rAmperage += tHatch.Amperes; + } + } + + for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : base.getTecTechEnergyTunnels()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + rVoltage = Math.max(getEUPerTickFromLaser(tHatch), rVoltage); + rAmperage += 1; + } + } + + return rVoltage * rAmperage; + } + + public static long getMaxInputVoltage(TecTechEnabledMulti base) { + long rVoltage = 0L; + for (GT_MetaTileEntity_Hatch_Energy tHatch : base.getVanillaEnergyHatches()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage(); + } + } + for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : base.getTecTechEnergyMultis()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage(); + } + } + for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : base.getTecTechEnergyTunnels()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + rVoltage += getEUPerTickFromLaser(tHatch); + } + } + return rVoltage; + } + + public static long getEUPerTickFromLaser(GT_MetaTileEntity_Hatch_EnergyTunnel tHatch) { + return tHatch.Amperes * tHatch.maxEUInput() - (tHatch.Amperes / 20); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java new file mode 100644 index 0000000000..e89bff4e00 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; + +import com.github.technus.tectech.mechanics.pipe.IConnectsToEnergyTunnel; +import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Energy; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; + +public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel { + + boolean isSender(); + + boolean isReceiver(); + + boolean isTunnel(); + + default boolean isConnectedCorrectly(byte side) { + return false; + } + + default void setEUVar(long aEnergy) { + } + + default long getAMPERES() { + return -1; + } + + default long maxEUInput() { + return -1; + } + + default long maxEUOutput() { + return -1; + } + + default long maxEUStore() { + return -1; + } + + default long getTotalPower() { + return this.getAMPERES() * Math.max(this.maxEUOutput(), this.maxEUInput()) - (this.getAMPERES() / 20); + } + + default void moveAroundLowPower(IGregTechTileEntity aBaseMetaTileEntity) { + byte color = this.getBaseMetaTileEntity().getColorization(); + if (color >= 0) { + byte front = aBaseMetaTileEntity.getFrontFacing(); + byte opposite = GT_Utility.getOppositeSide(front); + + for (short dist = 1; dist < 250; ++dist) { + IGregTechTileEntity tGTTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSideAndDistance(front, dist); + if (tGTTileEntity == null || tGTTileEntity.getColorization() != color) { + return; + } + + IMetaTileEntity aMetaTileEntity = tGTTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return; + } + + if (aMetaTileEntity instanceof LowPowerLaser && ((LowPowerLaser) aMetaTileEntity).isReceiver() && opposite == tGTTileEntity.getFrontFacing()) { + if (this.maxEUOutput() > ((LowPowerLaser) aMetaTileEntity).maxEUInput() || this.getAMPERES() > ((LowPowerLaser) aMetaTileEntity).getAMPERES()) { + aMetaTileEntity.doExplosion(this.maxEUOutput()); + this.setEUVar(aBaseMetaTileEntity.getStoredEU() - this.maxEUOutput()); + return; + } + + if (this.maxEUOutput() == ((LowPowerLaser) aMetaTileEntity).maxEUInput()) { + long diff = Math.min(this.getAMPERES() * 20L * this.maxEUOutput(), Math.min(((LowPowerLaser) aMetaTileEntity).maxEUStore() - aMetaTileEntity.getBaseMetaTileEntity().getStoredEU(), aBaseMetaTileEntity.getStoredEU())); + this.setEUVar(aBaseMetaTileEntity.getStoredEU() - diff); + ((LowPowerLaser) aMetaTileEntity).setEUVar(aMetaTileEntity.getBaseMetaTileEntity().getStoredEU() + diff); + } + return; + } + + + if ((!(aMetaTileEntity instanceof LowPowerLaser) || !((LowPowerLaser) aMetaTileEntity).isTunnel()) && !(aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy)) { + return; + } + + if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy) { + if (((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).connectionCount < 2) { + return; + } + + ((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).markUsed(); + } else if (aBaseMetaTileEntity instanceof LowPowerLaser && ((LowPowerLaser) aMetaTileEntity).isTunnel()) { + if (!((LowPowerLaser) aMetaTileEntity).isConnectedCorrectly(front)) + return; + } + } + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java new file mode 100644 index 0000000000..1b82aedace --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; + +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import java.util.Optional; + +public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_TieredMachineBlock implements LowPowerLaser { + + protected long AMPERES; + + public TT_Abstract_LowPowerLaserThingy(int aID, String aName, String aNameRegional, int aTier, long aAmperes, int aInvSlotCount, String aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); + this.AMPERES = aAmperes; + } + + public TT_Abstract_LowPowerLaserThingy(int aID, String aName, String aNameRegional, int aTier, long aAmperes, int aInvSlotCount, String[] aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); + this.AMPERES = aAmperes; + } + + public TT_Abstract_LowPowerLaserThingy(String aName, int aTier, long aAmperes, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aInvSlotCount, aDescription, aTextures); + this.AMPERES = aAmperes; + } + + public TT_Abstract_LowPowerLaserThingy(String aName, int aTier, long aAmperes, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aInvSlotCount, aDescription, aTextures); + this.AMPERES = aAmperes; + } + + public long getAMPERES() { + return AMPERES; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public boolean isInputFacing(byte aSide) { + return true; + } + + @Override + public boolean isOutputFacing(byte aSide) { + return true; + } + + @Override + public boolean shouldJoinIc2Enet() { + return true; + } + + + @Override + public boolean isGivingInformation() { + return true; + } + + @Override + public void saveNBTData(NBTTagCompound nbtTagCompound) { + Optional.ofNullable(nbtTagCompound).ifPresent( + tag -> tag.setLong("AMPERES", AMPERES) + ); + } + + @Override + public void loadNBTData(NBTTagCompound nbtTagCompound) { + Optional.ofNullable(nbtTagCompound).ifPresent( + tag -> AMPERES = tag.getLong("AMPERES") + ); + } + + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + @Override + public boolean isSimpleMachine() { + return true; + } + + @Override + public boolean isFacingValid(byte aFacing) { + return true; + } + + @Override + public long maxEUInput() { + return GT_Values.V[this.mTier]; + } + + @Override + public long maxEUOutput() { + return GT_Values.V[this.mTier]; + } + + @Override + public boolean isTeleporterCompatible() { + return false; + } + + @Override + public long getMinimumStoredEU() { + return GT_Values.V[this.mTier + 1]; + } + + @Override + public long maxEUStore() { + return 512L + GT_Values.V[this.mTier + 1] * 24L * AMPERES; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java new file mode 100644 index 0000000000..aa88094922 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; + +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.util.StatCollector; + +public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLaserThingy { + + public TT_MetaTileEntity_LowPowerLaserBox(int aID, String aName, String aNameRegional, int aTier, long aAmperes, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, aAmperes, 0, new String[0], aTextures); + } + + public TT_MetaTileEntity_LowPowerLaserBox(String aName, int aTier, long aAmperes, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aAmperes, 0, aDescription, aTextures); + } + + @Override + public boolean isSender() { + return this.getBaseMetaTileEntity().isAllowedToWork(); + } + + @Override + public boolean isReceiver() { + return !this.getBaseMetaTileEntity().isAllowedToWork(); + } + + @Override + public boolean isTunnel() { + return false; + } + + public long maxAmperesOut() { + return !this.getBaseMetaTileEntity().isAllowedToWork() ? AMPERES : 0; + } + + public long maxAmperesIn() { + return this.getBaseMetaTileEntity().isAllowedToWork() ? AMPERES + (AMPERES / 4) : 0; + } + + public boolean hasAlternativeModeText() { + return true; + } + + public String getAlternativeModeText() { + return isReceiver() ? "Set to receiving mode" : "Set to sending mode"; + } + + public boolean isEnetInput() { + return this.getBaseMetaTileEntity().isAllowedToWork(); + } + + public boolean isEnetOutput() { + return !this.getBaseMetaTileEntity().isAllowedToWork(); + } + + @Override + public boolean canConnect(byte aSide) { + return aSide == this.getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new TT_MetaTileEntity_LowPowerLaserBox(this.mName, this.mTier, this.AMPERES, this.mDescriptionArray, this.mTextures); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork()); + + byte Tick = (byte) ((int) (aTick % 20L)); + if (16 == Tick) { + if (aBaseMetaTileEntity.getStoredEU() > 0L) { + this.setEUVar(aBaseMetaTileEntity.getStoredEU() - this.AMPERES); + if (aBaseMetaTileEntity.getStoredEU() < 0L) { + this.setEUVar(0L); + } + } + if (this.getBaseMetaTileEntity().isAllowedToWork()) + if (aBaseMetaTileEntity.getStoredEU() > this.getMinimumStoredEU()) { + this.moveAroundLowPower(aBaseMetaTileEntity); + } + } + } + } + + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[12][17][]; + + for (byte i = -1; i < 16; ++i) { + rTextures[0][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; + rTextures[1][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; + rTextures[2][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; + rTextures[3][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier]}; + rTextures[4][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier]}; + rTextures[5][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier]}; + rTextures[6][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; + rTextures[7][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; + rTextures[8][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; + rTextures[9][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier]}; + rTextures[10][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier]}; + rTextures[11][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier]}; + } + + return rTextures; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return this.mTextures[Math.min(2, aSide) + (aSide == aFacing ? 3 : 0) + (aActive ? 0 : 6)][aColorIndex + 1]; + } + + @Override + public String[] getDescription() { + return new String[]{"Like a Tranformer... but for LAZORZ", "Transferrate: " + ChatColorHelper.YELLOW + this.getTotalPower() + ChatColorHelper.WHITE + " EU/t", StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java new file mode 100644 index 0000000000..df3cd12773 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; + +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoTunnel; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; + +@SuppressWarnings("deprecation") +public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hatch_DynamoTunnel implements LowPowerLaser { + + public TT_MetaTileEntity_LowPowerLaserDynamo(int aID, String aName, String aNameRegional, int aTier, int aAmp) { + super(aID, aName, aNameRegional, aTier, aAmp); + } + + public TT_MetaTileEntity_LowPowerLaserDynamo(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aAmp, aDescription, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new TT_MetaTileEntity_LowPowerLaserDynamo(this.mName, this.mTier, this.Amperes, this.mDescription, this.mTextures); + } + + @Override + public boolean isSender() { + return true; + } + + @Override + public boolean isReceiver() { + return false; + } + + @Override + public boolean isTunnel() { + return false; + } + + @Override + public long getAMPERES() { + return this.Amperes; + } + + @Override + public String[] getDescription() { + return new String[]{ + this.mDescription, + StatCollector.translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": " + EnumChatFormatting.YELLOW + this.getTotalPower() + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks" + }; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + byte Tick = (byte) ((int) (aTick % 20L)); + if (16 == Tick) { + if (aBaseMetaTileEntity.getStoredEU() > 0L) { + this.setEUVar(aBaseMetaTileEntity.getStoredEU() - (long) this.Amperes); + if (aBaseMetaTileEntity.getStoredEU() < 0L) { + this.setEUVar(0L); + } + } + } + if (aBaseMetaTileEntity.getStoredEU() > this.getMinimumStoredEU()) { + this.moveAroundLowPower(aBaseMetaTileEntity); + } + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java new file mode 100644 index 0000000000..1774fc0966 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; + +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; + +@SuppressWarnings("deprecation") +public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatch_EnergyTunnel implements LowPowerLaser { + + public TT_MetaTileEntity_LowPowerLaserHatch(int aID, String aName, String aNameRegional, int aTier, int aAmp) { + super(aID, aName, aNameRegional, aTier, aAmp); + } + + public TT_MetaTileEntity_LowPowerLaserHatch(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aAmp, aDescription, aTextures); + } + + @Override + public String[] getDescription() { + return new String[]{ + this.mDescription, + StatCollector.translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " + EnumChatFormatting.YELLOW + this.getTotalPower() + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks" + }; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new TT_MetaTileEntity_LowPowerLaserHatch(this.mName, this.mTier, this.Amperes, this.mDescription, this.mTextures); + } + + @Override + public boolean isSender() { + return false; + } + + @Override + public boolean isReceiver() { + return true; + } + + @Override + public boolean isTunnel() { + return false; + } + + @Override + public long getAMPERES() { + return this.Amperes; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java new file mode 100644 index 0000000000..140359c159 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; + +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Client; +import ic2.core.Ic2Items; +import net.minecraft.block.Block; +import net.minecraft.util.StatCollector; + +public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Cable implements LowPowerLaser { + + public TT_MetaTileEntity_Pipe_Energy_LowPower(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, 0.25f, Materials.BorosilicateGlass, 0, 0, 0, false, false); + } + + public TT_MetaTileEntity_Pipe_Energy_LowPower(String aName, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) { + super(aName, aThickNess, aMaterial, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new TT_MetaTileEntity_Pipe_Energy_LowPower(this.mName, this.mThickNess, this.mMaterial, this.mCableLossPerMeter, this.mAmperage, this.mVoltage, this.mInsulated, this.mCanShock); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aTick % 20 == 13 && aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected == 4) { + aBaseMetaTileEntity.issueTextureUpdate(); + } + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { + return new ITexture[]{ + new GT_CopiedBlockTexture( + Block.getBlockFromItem(Ic2Items.glassFiberCableBlock.getItem()), + aSide, + Ic2Items.glassFiberCableBlock.getItemDamage(), + Dyes.getModulation(aColorIndex, Dyes._NULL.mRGBa) + ) + }; + } + + @Override + public String[] getDescription() { + return new String[]{ + "Primitive Laser Cable intended for Low Power Applications", + "Does not auto-connect", + "Does not turn or bend", + ChatColorHelper.WHITE + "Must be " + ChatColorHelper.YELLOW + "c" + ChatColorHelper.RED + "o" + ChatColorHelper.BLUE + "l" + ChatColorHelper.DARKPURPLE + "o" + ChatColorHelper.GOLD + "r" + ChatColorHelper.DARKRED + "e" + ChatColorHelper.DARKGREEN + "d" + ChatColorHelper.WHITE + " in order to work", + StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks" + }; + } + + @Override + public boolean isSender() { + return false; + } + + @Override + public boolean isReceiver() { + return false; + } + + @Override + public boolean isTunnel() { + return true; + } + + @Override + public boolean canConnect(byte b) { + return true; + } + + @Override + public boolean isGivingInformation() { + return false; + } + + @Override + public boolean isConnectedCorrectly(byte aSide) { + return this.isConnectedAtSide(aSide) && this.isConnectedAtSide(GT_Utility.getOppositeSide(aSide)); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index 8789ee60d3..872970b2f2 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,12 +22,9 @@ package com.github.bartimaeusnek.crossmod.thaumcraft.util; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.system.log.DebugLog; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.API.API_ConfigValues; import com.github.bartimaeusnek.bartworks.util.Pair; -import gregtech.api.enums.OrePrefixes; +import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import gregtech.api.enums.TC_Aspects; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -36,7 +33,6 @@ import net.minecraft.world.biome.BiomeGenBase; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.util.Objects; @SuppressWarnings({"rawtypes","unchecked","unused"}) public class ThaumcraftHandler { @@ -127,7 +123,7 @@ public class ThaumcraftHandler { try { Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); for (Pair a : aspectPair) { - if (ConfigHandler.debugLog) + if (API_ConfigValues.debugLog) DebugLog.log("Stack:"+ stack.getDisplayName() + " Damage:" +stack.getItemDamage() + " aspectPair: " + ThaumcraftHandler.AspectAdder.getName.invoke(a.getKey()) + " / " + a.getValue()); ThaumcraftHandler.AspectAdder.addToList.invoke(aspectList, a.getKey(), a.getValue()); } @@ -147,23 +143,5 @@ public class ThaumcraftHandler { e.printStackTrace(); } } - - public static void addAspectToAll(Werkstoff werkstoff){ - for (OrePrefixes element : WerkstoffLoader.ENABLED_ORE_PREFIXES) { - if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(element)) != 0 && (werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(element)) == 0) { - if (element.mMaterialAmount >= 3628800L || element == OrePrefixes.ore) { - DebugLog.log("OrePrefix: " + element.name() + " mMaterialAmount: " + element.mMaterialAmount/3628800L); - if (Objects.nonNull(WerkstoffLoader.items.get(element))) - ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), werkstoff.getTCAspects(element == OrePrefixes.ore ? 1 : (int) (element.mMaterialAmount / 3628800L))); - } - else if (element.mMaterialAmount >= 0L) { - if (Objects.nonNull(WerkstoffLoader.items.get(element))) - ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(element), new Pair<>(TC_Aspects.PERDITIO.mAspect, 1)); - } - } - } - } - - } } diff --git a/src/main/resources/assets/bartworks/lang/de_DE.lang b/src/main/resources/assets/bartworks/lang/de_DE.lang index 7677ce6751..dfeb3cfd6e 100644 --- a/src/main/resources/assets/bartworks/lang/de_DE.lang +++ b/src/main/resources/assets/bartworks/lang/de_DE.lang @@ -105,7 +105,7 @@ tooltip.rotor.0.name=Durchmesser: tooltip.rotor.1.name=Haltbarkeit: tooltip.rotor.2.name=Effizienz: tooltip.teslastaff.0.name=Keine Garantie! -tooltip.tile.acidgen.0.name=An Acid Generator +tooltip.tile.acidgen.0.name=Ein Säure Generator tooltip.tile.acidgen.1.name=Creates Power from Chemical Energy Potentials. tooltip.tile.biolab.0.name=The BioLab, a Multi-Use Bioengineering Station tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom and top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radiation Input Bus;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! @@ -125,7 +125,7 @@ tooltip.tile.radhatch.0.name=Radioactive Item Chamber for Multiblocks tooltip.tile.radhatch.1.name=Use a screwdriver to set the containment level tooltip.tile.radhatch.2.name=Material: tooltip.tile.radhatch.3.name=Sievert: -tooltip.tile.radhatch.4.name=Amount: +tooltip.tile.radhatch.4.name=Menge: tooltip.tile.radhatch.5.name=Time (in t/s/m/h) to decay (1kg): tooltip.tile.radhatch.6.name=t tooltip.tile.radhatch.7.name=s @@ -147,4 +147,9 @@ tooltip.windmeter.4.name=normal zu sein. tooltip.windmeter.5.name=eher stark zu sein. tooltip.windmeter.6.name=sehr stark zu sein. tooltip.windmeter.7.name=zu stark zu sein. -tooltip.windmeter.8.name=Der Wind hier scheint \ No newline at end of file +tooltip.windmeter.8.name=Der Wind hier scheint + +item.BurnedOutBISOPelletBall.name=Ausgebranntes BISO Kügelchen Ball +item.BurnedOutBISOPellet.name=Ausgebranntes BISO Kügelchen +item.BurnedOutTRISOPelletBall.name=Ausgebranntes TRISO Kügelchen Ball +item.BurnedOutTRISOPellet.name=Ausgebranntes TRISO Kügelchen diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 92579a6bee..ff7b806fbd 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -97,10 +97,10 @@ tooltip.labparts.7.name=A DNA Flask containing: tooltip.labparts.8.name=A Plasmid Cell containing: tooltip.tile.waterpump.0.name=Produces -tooltip.tile.waterpump.1.name=L/s Water when fueled. +tooltip.tile.waterpump.1.name=L/s Water when fueled. Causes 5 Pollution per second. tooltip.tile.waterpump.2.name=Must be placed on the Ground. -tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Borosilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum +tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Boronsilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Hatch/Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum tooltip.tile.mbf.1.name=Pollution per second tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom or top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radio Hatch;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! @@ -151,6 +151,11 @@ item.BISOPelletBall.name=BISO pebble ball item.BISOPellet.name=BISO pebble item.TRISOPelletCompound.name=TRISO pebble compund item.BISOPelletCompound.name=BISO pebble compund +item.BurnedOutBISOPelletBall.name=Burned Out BISO pebble ball +item.BurnedOutBISOPellet.name=Burned Out BISO pebble +item.BurnedOutTRISOPelletBall.name=Burned Out TRISO pebble ball +item.BurnedOutTRISOPellet.name=Burned Out TRISO pebble + itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so! diff --git a/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png b/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png index 4237fa0636..9a340eca30 100644 Binary files a/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png and b/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_0.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_0.png deleted file mode 100644 index 5622806282..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_0.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_1.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_1.png deleted file mode 100644 index c0b5b0da4d..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_1.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_10.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_10.png deleted file mode 100644 index 3c8b4c66d7..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_10.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_11.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_11.png deleted file mode 100644 index 036adac6f3..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_11.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_12.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_12.png deleted file mode 100644 index ea67c34b23..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_12.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_13.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_13.png deleted file mode 100644 index 1727d6228a..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_13.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_14.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_14.png deleted file mode 100644 index 8795c1dacc..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_14.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_15.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_15.png deleted file mode 100644 index f711908135..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_15.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_2.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_2.png deleted file mode 100644 index c69982d8e7..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_2.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_3.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_3.png deleted file mode 100644 index 18eadf45ed..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_3.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_4.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_4.png deleted file mode 100644 index 269de3edb1..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_4.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_5.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_5.png deleted file mode 100644 index 198701e1bb..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_5.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_6.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_6.png deleted file mode 100644 index 9f050cc629..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_6.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_7.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_7.png deleted file mode 100644 index 4969508f31..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_7.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_8.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_8.png deleted file mode 100644 index c73f1f5320..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_8.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_9.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_9.png deleted file mode 100644 index f9a450ae2d..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlockRandlos_9.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_0.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_0.png deleted file mode 100644 index f66994bcd2..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_0.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_1.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_1.png deleted file mode 100644 index 1249814be6..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_1.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_10.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_10.png deleted file mode 100644 index 0bb400b3dc..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_10.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_11.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_11.png deleted file mode 100644 index e40c597ceb..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_11.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_12.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_12.png deleted file mode 100644 index 2ddabd3331..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_12.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_13.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_13.png deleted file mode 100644 index 617758a4b6..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_13.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_14.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_14.png deleted file mode 100644 index a8ab0806e2..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_14.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_15.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_15.png deleted file mode 100644 index d3f697ab1f..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_15.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_2.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_2.png deleted file mode 100644 index 543b011c03..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_2.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_3.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_3.png deleted file mode 100644 index d69e640fb3..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_3.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_4.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_4.png deleted file mode 100644 index 48509772ce..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_4.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_5.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_5.png deleted file mode 100644 index 93dc271b8e..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_5.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_6.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_6.png deleted file mode 100644 index da2f1deb4a..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_6.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_7.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_7.png deleted file mode 100644 index 4a7a5b4a3f..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_7.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_8.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_8.png deleted file mode 100644 index fdf64c2958..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_8.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_9.png b/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_9.png deleted file mode 100644 index d4110a3b06..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/BoronSilicateGlassBlock_9.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_0.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_0.png new file mode 100644 index 0000000000..f66994bcd2 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_0.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_1.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_1.png new file mode 100644 index 0000000000..1249814be6 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_1.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_10.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_10.png new file mode 100644 index 0000000000..0bb400b3dc Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_10.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_11.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_11.png new file mode 100644 index 0000000000..e40c597ceb Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_11.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_12.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_12.png new file mode 100644 index 0000000000..2ddabd3331 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_12.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_13.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_13.png new file mode 100644 index 0000000000..617758a4b6 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_13.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_14.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_14.png new file mode 100644 index 0000000000..a8ab0806e2 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_14.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_15.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_15.png new file mode 100644 index 0000000000..d3f697ab1f Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_15.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_2.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_2.png new file mode 100644 index 0000000000..543b011c03 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_2.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_3.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_3.png new file mode 100644 index 0000000000..d69e640fb3 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_3.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_4.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_4.png new file mode 100644 index 0000000000..48509772ce Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_4.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_5.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_5.png new file mode 100644 index 0000000000..93dc271b8e Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_5.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_6.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_6.png new file mode 100644 index 0000000000..da2f1deb4a Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_6.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_7.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_7.png new file mode 100644 index 0000000000..4a7a5b4a3f Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_7.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_8.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_8.png new file mode 100644 index 0000000000..fdf64c2958 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_8.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_9.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_9.png new file mode 100644 index 0000000000..d4110a3b06 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlock/BoronSilicateGlassBlock_9.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_0.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_0.png new file mode 100644 index 0000000000..5622806282 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_0.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_1.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_1.png new file mode 100644 index 0000000000..c0b5b0da4d Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_1.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_10.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_10.png new file mode 100644 index 0000000000..3c8b4c66d7 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_10.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_11.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_11.png new file mode 100644 index 0000000000..036adac6f3 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_11.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_12.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_12.png new file mode 100644 index 0000000000..ea67c34b23 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_12.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_13.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_13.png new file mode 100644 index 0000000000..1727d6228a Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_13.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_14.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_14.png new file mode 100644 index 0000000000..8795c1dacc Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_14.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_15.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_15.png new file mode 100644 index 0000000000..f711908135 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_15.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_2.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_2.png new file mode 100644 index 0000000000..c69982d8e7 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_2.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_3.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_3.png new file mode 100644 index 0000000000..18eadf45ed Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_3.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_4.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_4.png new file mode 100644 index 0000000000..269de3edb1 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_4.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_5.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_5.png new file mode 100644 index 0000000000..198701e1bb Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_5.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_6.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_6.png new file mode 100644 index 0000000000..9f050cc629 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_6.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_7.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_7.png new file mode 100644 index 0000000000..4969508f31 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_7.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_8.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_8.png new file mode 100644 index 0000000000..c73f1f5320 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_8.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_9.png b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_9.png new file mode 100644 index 0000000000..f9a450ae2d Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/connectedTex/BoronSilicateGlassBlockRandlos/BoronSilicateGlassBlockRandlos_9.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPellet.png b/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPellet.png new file mode 100644 index 0000000000..573d4b309e Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPellet.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPelletBall.png b/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPelletBall.png new file mode 100644 index 0000000000..72ba51bbe0 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPelletBall.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPellet.png b/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPellet.png new file mode 100644 index 0000000000..73abda00dd Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPellet.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPelletBall.png b/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPelletBall.png new file mode 100644 index 0000000000..eb5e37eaa1 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPelletBall.png differ -- cgit From e22cd98e9a185cf1fc6f44488f1fa6502a7557ab Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 28 May 2020 19:32:56 +0200 Subject: No gtnh tested (#81) * Added VoidMinerWIP Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Continue work on VoidMiner + Added a function to BWOreLayers + Made the voidminer actually WORK somewhat Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Continue work on VoidMiner + added recipes + made the void miner consume noble gasses to boost output + refactored code by quite a lot + added newest GT Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added GalacticGreg lib Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * added localisation of achivements Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * updated GTLib Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * updated GTlib Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Several fixes + Fixed BioVat + Added some Debug Commands + Changed Void Miner logic Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Refactor Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Refactor + removed Experimental ThreadedLoader + moved LoaderCalls into LoaderReference Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Refactor + moved FMLCommonHandler.instance().get(Effective)Side() into SideReference Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * made radio hatch compat call static Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Made More Stuff static + improved flow control Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added more Block-Recipes +version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * api changes + fixed void miner not consuming energy + Made API standalone (mostly) Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Made OrePrefixes lookups NullSecure Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * fixed a typo Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * LICENSE update Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added Config for Metas and Tiers for Ross + fixed GT++ compability Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Fixes + Fixed ConfigHandler initiating GTValues during coremod startup + Fixed MegaEBF sometimes overflowing Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * change recipes for Void Miner using Ore Drill Tier 6 bump gt dependencie and version * update code chicken core and gt version * Added VoidMiner Tiers + Added Recipes for Void Miners Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Fixed VoidMiner Output Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * added void miner localisation for achievements Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * fixed NPE Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Made Void Miner Times in Assembly Line more reasonable Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * fixed fermentation recipes in biovat Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added a force shutdown, due to licensing of GT++ Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Fixed Glass Checked + buffed Oganesson + made LoadItemContainers static + removed force shutdown Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Update WerkstoffLoader.java * Fix imports import cpw.mods.fml.common.Loader was missing * Redid CLS support Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Some new featues + Added Multiblock Updateability to BW Blocks + Added Pollution to WaterPump + Added new Windmill GUI + Refactored Windmill a bit Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added animation to windmill Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * add gt to libs folder to let jenkins build (cherry picked from commit 12f6dae5e2233b533bce1cf6b0c29e9e85a60a0b) * Various Development + Added TT support to MEBF and MVAC + Fixed Energy Logic on MDT + Fixed MEBF not outputting fluids on bottom hatches + added auto-export for water on the simple stirling pump + redid glass folder structure + added EBF / Large Chem circuit Unification + updated TT dependancy + version increase x2 Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Various Development (#75) + Added TT support to MEBF and MVAC + Fixed Energy Logic on MDT + Fixed MEBF not outputting fluids on bottom hatches + added auto-export for water on the simple stirling pump + redid glass folder structure + added EBF / Large Chem circuit Unification + updated TT dependancy + version increase x2 Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added TT Low Power Lasers + Fixed Circuit Logic and added bounds check + added TT Low Power recipes + updated GT-lib + version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Block changes2 (#77) * Various Development + Added TT support to MEBF and MVAC + Fixed Energy Logic on MDT + Fixed MEBF not outputting fluids on bottom hatches + added auto-export for water on the simple stirling pump + redid glass folder structure + added EBF / Large Chem circuit Unification + updated TT dependancy + version increase x2 Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Added TT Low Power Lasers + Fixed Circuit Logic and added bounds check + added TT Low Power recipes + updated GT-lib + version increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Redid LuV Osmiridium Replacer + version increase + deleted old lib Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * Fixes + Unified usage of .hasItemType instead of bitshifts/ .getGenerationFeatures().hasXY() + removed a wrong cast + fixed textures + cleaned up code + removed *some* duplicate recipes for tool items + increased version, increased api version Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> * fixed voidminer + fixed MEBF not working with LAZORS or Multi Amp hatches below UV-Glas + fixed LAZORS not exploding when they recive too much Amp lasers * Redid Radio Hatch Stuffs ~~~ + ItemStacks finally work properly + Forbid insertion of a non-Rad-Material + Version increase * fixes + disabled circuit unification + removed unused decoratePlanet on Ross128ba + changed "splitStack" to "setStackSize" + renamed "WorldProviderRoss128Ba" to "WorldProviderRoss128ba" * Math update + Added specialised functions for floor ceil wrap and clamp + Replaced old function calls + LowPower Pipes now have the IC2 glass fibre texture + fixed overflow on the AccessPriorityList + fixed "NOSUCHITEM rod" error + suppressed some warnings + version increase * Fixed Burned Out THTR Stuff * Had the wrong version number * Made a NoGTNH-GT compatible version * renamed hardmode setting in code + unregistered my TileEntitys as machine blocks (caused trouble during worldgen with gtnh gt) + version increase + added a specialised TE container class Co-authored-by: Dream-Master Co-authored-by: jackowski626 Former-commit-id: 136db10e36bc33619904d18c513fd3357759cad4 --- build.properties | 2 +- .../bartworks/API/BioVatLogicAdder.java | 17 ++++---- .../github/bartimaeusnek/bartworks/MainMod.java | 10 ++--- .../common/blocks/BW_TileEntityContainer.java | 12 ----- .../BW_TileEntityContainer_MachineBlock.java | 51 ++++++++++++++++++++++ .../bartworks/common/configs/ConfigHandler.java | 2 +- .../bartworks/common/loaders/ItemRegistry.java | 5 ++- .../bartworks/common/loaders/RecipeLoader.java | 24 +++++----- .../common/loaders/StaticRecipeChangeLoaders.java | 5 ++- .../GT_Enhancement/GTMetaItemEnhancer.java | 17 +++++++- .../bartworks/system/material/WerkstoffLoader.java | 27 +++++++----- 11 files changed, 117 insertions(+), 55 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java diff --git a/build.properties b/build.properties index 0c2cf1116f..bfd657b23f 100644 --- a/build.properties +++ b/build.properties @@ -22,7 +22,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=5 -buildNumber=13 +buildNumber=13.1 APIVersion=11 ic2.version=2.2.828-experimental gregtech.version=5.09.33.38 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java index 91e6b64e15..6562453ecc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -67,10 +67,6 @@ public final class BioVatLogicAdder { giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TiberiumCell_2.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 6); giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TiberiumCell_4.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 12); - giveItemStackRadioHatchAbilites(ItemList.MNqCell_1.get(1), Materials.Naquadria, 3); - giveItemStackRadioHatchAbilites(ItemList.MNqCell_2.get(1), Materials.Naquadria, 6); - giveItemStackRadioHatchAbilites(ItemList.MNqCell_4.get(1), Materials.Naquadria, 12); - giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TheCoreCell.get(1), Materials.Naquadah, 96); giveItemStackRadioHatchAbilites(ItemList.Depleted_Thorium_1.get(1), Materials.Thorium, 3, 10); @@ -93,11 +89,16 @@ public final class BioVatLogicAdder { giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 6, 10); giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 12, 10); - giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_1.get(1), Materials.Naquadria, 3, 10); - giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_2.get(1), Materials.Naquadria, 6, 10); - giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_4.get(1), Materials.Naquadria, 12, 10); - giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), Materials.Naquadah, 96, 10); + + if (WerkstoffLoader.gtnhGT) { + giveItemStackRadioHatchAbilites(ItemList.MNqCell_1.get(1), Materials.Naquadria, 3); + giveItemStackRadioHatchAbilites(ItemList.MNqCell_2.get(1), Materials.Naquadria, 6); + giveItemStackRadioHatchAbilites(ItemList.MNqCell_4.get(1), Materials.Naquadria, 12); + giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_1.get(1), Materials.Naquadria, 3, 10); + giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_2.get(1), Materials.Naquadria, 6, 10); + giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_4.get(1), Materials.Naquadria, 12, 10); + } } private static final HashSet MaSv = new HashSet<>(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 33b47fd6a9..e2ad0b6416 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -104,15 +104,15 @@ public final class MainMod { } if (LoaderReference.dreamcraft) - ConfigHandler.GTNH = true; + ConfigHandler.hardmode = true; - ConfigHandler.GTNH = ConfigHandler.ezmode != ConfigHandler.GTNH; + ConfigHandler.hardmode = ConfigHandler.ezmode != ConfigHandler.hardmode; if (API_ConfigValues.debugLog) { try { DebugLog.initDebugLog(preinit); } catch (IOException e) { - e.printStackTrace(); + MainMod.LOGGER.catching(e); } } @@ -120,8 +120,8 @@ public final class MainMod { WerkstoffLoader.setUp(); } - if (ConfigHandler.GTNH) - MainMod.LOGGER.info("GTNH-Detected . . . ACTIVATE HARDMODE."); + if (ConfigHandler.hardmode) + MainMod.LOGGER.info(". . . ACTIVATED HARDMODE."); if (ConfigHandler.BioLab) { BioCultureLoader.run(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index 1cb8106399..f14e8a70a5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -64,7 +64,6 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI this.setCreativeTab(MainMod.BWT); this.setBlockName(blockName); this.setBlockTextureName(MainMod.MOD_ID + ":" + blockName); - GregTech_API.registerMachineBlock(this, -1); } @Override @@ -122,10 +121,6 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI @Override public void breakBlock(World world, int x, int y, int z, Block block, int meta) { - if (GregTech_API.isMachineBlock(this, world.getBlockMetadata(x, y, z))) { - GregTech_API.causeMachineUpdate(world, x, y, z); - } - TileEntity t = world.getTileEntity(x, y, z); if (t instanceof ITileDropsContent) { int[] dropSlots = ((ITileDropsContent) t).getDropSlots(); @@ -200,11 +195,4 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI } return new String[0]; } - - @Override - public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { - if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { - GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); - } - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java new file mode 100644 index 0000000000..45f67ccfcb --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.blocks; + +import gregtech.api.GregTech_API; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class BW_TileEntityContainer_MachineBlock extends BW_TileEntityContainer { + + public BW_TileEntityContainer_MachineBlock(Material p_i45386_1_, Class tileEntity, String blockName) { + super(p_i45386_1_, tileEntity, blockName); + GregTech_API.registerMachineBlock(this, -1); + } + + @Override + public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { + if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + } + + @Override + public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { + if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index b949444067..a6f781bf98 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -59,7 +59,7 @@ public class ConfigHandler { public static boolean DEHPDirectSteam; public static boolean teslastaff; public static boolean classicMode; - public static boolean GTNH; + public static boolean hardmode; public static boolean ezmode; public static boolean GTppLogDisabler; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index df60aafa0f..10ada4ea61 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -27,6 +27,7 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer_MachineBlock; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.items.*; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; @@ -72,7 +73,7 @@ public class ItemRegistry { public static final Item ROCKCUTTER_MV = new GT_Rockcutter_Item(2); public static final Item ROCKCUTTER_HV = new GT_Rockcutter_Item(3); public static final Item CIRCUIT_PROGRAMMER = new Circuit_Programmer(); - public static final Block ROTORBLOCK = new BW_TileEntityContainer(Material.wood, BW_RotorBlock.class, "BWRotorBlock"); + public static final Block ROTORBLOCK = new BW_TileEntityContainer_MachineBlock(Material.wood, BW_RotorBlock.class, "BWRotorBlock"); public static final Item LEATHER_ROTOR = new BW_Stonage_Rotors(5, 0.15f, 15, 30, 2400, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorLeather.png"), "BW_LeatherRotor", "rotors/itemRotorLeather"); public static final Item WOOL_ROTOR = new BW_Stonage_Rotors(7, 0.18f, 10, 20, 1600, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorWool.png"), "BW_WoolRotor", "rotors/itemRotorWool"); public static final Item PAPER_ROTOR = new BW_Stonage_Rotors(9, 0.2f, 1, 10, 800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorPaper.png"), "BW_PaperRotor", "rotors/itemRotorPaper"); @@ -207,7 +208,7 @@ public class ItemRegistry { ItemRegistry.giantOutputHatch = new GT_MetaTileEntity_GiantOutputHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, "GiantOutputHatch", "Giant Output Hatch").getStackForm(1L); ItemRegistry.megaMachines[2] = new GT_TileEntity_MegaDistillTower(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, "MegaDistillationTower", "Mega Distillation Tower").getStackForm(1L); - if (LoaderReference.galacticgreg) { + if (LoaderReference.galacticgreg && WerkstoffLoader.gtnhGT) { ItemRegistry.voidminer[2] = new GT_TileEntity_VoidMiners.VMUV(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 11, "VoidMiner3", "Void Miner III").getStackForm(1L); ItemRegistry.voidminer[1] = new GT_TileEntity_VoidMiners.VMZPM(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 12, "VoidMiner2", "Void Miner II").getStackForm(1L); ItemRegistry.voidminer[0] = new GT_TileEntity_VoidMiners.VMLUV(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 13, "VoidMiner1", "Void Miner I").getStackForm(1L); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 738fe18351..c8bc059230 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -57,7 +57,7 @@ public class RecipeLoader { @SuppressWarnings("deprecation") public static void run() { - if (ConfigHandler.GTNH) { + if (ConfigHandler.hardmode) { /* * GTNH "hardmode" Recipes */ @@ -102,11 +102,11 @@ public class RecipeLoader { "CDC", "SBS", "CFC", - 'C', ConfigHandler.GTNH ? "circuitAdvanced" : "circuitBasic", + 'C', ConfigHandler.hardmode ? "circuitAdvanced" : "circuitBasic", 'D', ItemList.Cover_Screen.get(1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.cableGt12, ConfigHandler.GTNH ? Materials.Platinum : Materials.AnnealedCopper, 1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.cableGt12, ConfigHandler.hardmode ? Materials.Platinum : Materials.AnnealedCopper, 1L), 'B', new ItemStack(ItemRegistry.BW_BLOCKS[1]), - 'F', ConfigHandler.GTNH ? ItemList.Field_Generator_HV.get(1L) : ItemList.Field_Generator_LV.get(1L) + 'F', ConfigHandler.hardmode ? ItemList.Field_Generator_HV.get(1L) : ItemList.Field_Generator_LV.get(1L) }); GT_ModHandler.addCraftingRecipe( @@ -117,7 +117,7 @@ public class RecipeLoader { "PLP", "CPC", 'C', "circuitAdvanced", - 'P', GT_OreDictUnificator.get(ConfigHandler.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, Materials.Aluminium, 1L), + 'P', GT_OreDictUnificator.get(ConfigHandler.hardmode ? OrePrefixes.plateDouble : OrePrefixes.plate, Materials.Aluminium, 1L), 'L', new ItemStack(Items.lava_bucket) }); @@ -129,7 +129,7 @@ public class RecipeLoader { "PLP", "CPC", 'C', "circuitAdvanced", - 'P', GT_OreDictUnificator.get(ConfigHandler.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, ConfigHandler.GTNH ? Materials.Steel : Materials.Iron, 1L), + 'P', GT_OreDictUnificator.get(ConfigHandler.hardmode ? OrePrefixes.plateDouble : OrePrefixes.plate, ConfigHandler.hardmode ? Materials.Steel : Materials.Iron, 1L), 'L', new ItemStack(Items.lava_bucket) }); @@ -225,7 +225,7 @@ public class RecipeLoader { } ); - if (!ConfigHandler.GTNH) + if (!ConfigHandler.hardmode) GT_ModHandler.addCraftingRecipe( ItemRegistry.dehp, RecipeLoader.BITSD, @@ -864,16 +864,16 @@ public class RecipeLoader { }; OrePrefixes[] prefixes = { - OrePrefixes.cableGt04, - OrePrefixes.cableGt08, - OrePrefixes.cableGt12, - OrePrefixes.cableGt16 + WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt04 : OrePrefixes.wireGt04, + WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt08 : OrePrefixes.wireGt08, + WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt12 : OrePrefixes.wireGt12, + WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt16 : OrePrefixes.cableGt12 }; GT_Values.RA.addAssemblerRecipe( new ItemStack[]{ ItemList.Circuit_Parts_GlassFiber.get(32), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silver, 8), + GT_OreDictUnificator.get(WerkstoffLoader.gtnhGT ? OrePrefixes.foil : OrePrefixes.plateDouble, Materials.Silver, WerkstoffLoader.gtnhGT ? 8 : 1), WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2) }, Materials.Polytetrafluoroethylene.getMolten(72), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index cf668d4d36..c0aabd973d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; @@ -186,9 +187,9 @@ public class StaticRecipeChangeLoaders { @SuppressWarnings("ALL") private static void runMoltenUnificationEnfocement(Werkstoff werkstoff) { - if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.hasItemType(OrePrefixes.cellMolten)) { + if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { try { - FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), werkstoff.get(cellMolten), Materials.Empty.getCells(1)); + FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); Field f = GT_Utility.class.getDeclaredField("sFilledContainerToData"); f.setAccessible(true); Map sFilledContainerToData = (Map) f.get(null); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java index 96e222ee11..fe66b74c40 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -45,7 +46,21 @@ public class GTMetaItemEnhancer { private GTMetaItemEnhancer() { } - public static void init(){ + public static void init() { + if (!WerkstoffLoader.gtnhGT) { + Item moltenCell = new BWGTMetaItems(WerkstoffLoader.cellMolten, null); + Materials[] values = Materials.values(); + for (int i = 0, valuesLength = values.length; i < valuesLength; i++) { + Materials m = values[i]; + if (m != null && m.mStandardMoltenFluid != null) { + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(m.getMolten(144), new ItemStack(moltenCell, 1, i), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L)); + FluidContainerRegistry.registerFluidContainer(emptyData); + GT_Utility.addFluidContainerData(emptyData); + GT_Values.RA.addFluidCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), new ItemStack(moltenCell, 1, i), m.getMolten(144), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(new ItemStack(moltenCell, 1, i), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), GT_Values.NF, m.getMolten(144)); + } + } + } if (LoaderReference.Forestry) { NoMetaValue = Materials.getMaterialsMap().values().stream().filter(m -> m.mMetaItemSubID == -1).collect(Collectors.toList()); Item moltenCapsuls = new BWGTMetaItems(WerkstoffLoader.capsuleMolten, null); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 1cc9b077cf..00c01f85aa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -97,7 +97,6 @@ public class WerkstoffLoader { public static ItemList boltMold; public static boolean gtnhGT = false; - public static void setUp() { //GTNH detection hack try { @@ -106,15 +105,21 @@ public class WerkstoffLoader { } catch (Exception ignored) { gtnhGT = false; } - + //GTNH detection hack #2 //GTNH hack for molten cells for (OrePrefixes prefix : values()) { if (prefix.toString().equals("cellMolten")) { WerkstoffLoader.cellMolten = prefix; + gtnhGT = true; break; } } + if (!gtnhGT) { + WerkstoffLoader.HDCS.getGenerationFeatures().extraRecipes ^= 10; + break; + } + if (WerkstoffLoader.cellMolten == null) { WerkstoffLoader.cellMolten = EnumUtils.addNewOrePrefix( "cellMolten","Cells of Molten stuff", "Molten ", @@ -1573,7 +1578,7 @@ public class WerkstoffLoader { WerkstoffLoader.fluids.put(werkstoff, FluidRegistry.getFluid(werkstoff.getDefaultName())); } } - if (werkstoff.hasItemType(cellMolten)) { + if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { if (!FluidRegistry.isFluidRegistered("molten." + werkstoff.getDefaultName())) { DebugLog.log("Adding new Molten: " + werkstoff.getDefaultName()); Fluid fluid = new GT_Fluid("molten." + werkstoff.getDefaultName(), "molten.autogenerated", werkstoff.getRGBA()); @@ -1740,7 +1745,7 @@ public class WerkstoffLoader { werkstoffBridgeMaterial.mGas = werkstoff.getFluidOrGas(1).getFluid(); } - if (werkstoff.hasItemType(cellMolten)) { + if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid(); } werkstoffBridgeMaterial.mName = werkstoff.getVarName(); @@ -2081,7 +2086,7 @@ public class WerkstoffLoader { //smallGear if (WerkstoffLoader.smallGearShape != null) GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), WerkstoffLoader.smallGearShape.get(0L), werkstoff.get(gearGtSmall), (int) werkstoff.getStats().mass, 8 * tVoltageMultiplier); - if (ConfigHandler.GTNH) + if (ConfigHandler.hardmode) GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{" S ", "hPx", " S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate)}); else GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{"P ", " h ", 'P', werkstoff.get(plate)}); @@ -2096,7 +2101,7 @@ public class WerkstoffLoader { GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 5), WerkstoffLoader.rotorShape.get(0L), werkstoff.get(rotor), 200, 60); //molten -> metal - if (werkstoff.hasItemType(cellMolten)) { + if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear.get(0L), werkstoff.getMolten(576), werkstoff.get(gearGt), 128, 8); GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear_Small.get(0L), werkstoff.getMolten(144), werkstoff.get(gearGtSmall), 16, 8); if (WerkstoffLoader.ringMold != null) @@ -2121,7 +2126,7 @@ public class WerkstoffLoader { if (werkstoff.hasItemType(ingot)) { GT_Values.RA.addArcFurnaceRecipe(werkstoff.get(block), new ItemStack[]{werkstoff.get(ingot, 9)}, null, 16, 90, false); } - if (werkstoff.hasItemType(cellMolten)) { + if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(block), null, werkstoff.getMolten(1296), 0, 288, 8); } if (werkstoff.hasItemType(plate)) { @@ -2512,15 +2517,15 @@ public class WerkstoffLoader { } private static void addMoltenRecipes(Werkstoff werkstoff) { - if (!werkstoff.hasItemType(cellMolten)) + if (!werkstoff.hasItemType(WerkstoffLoader.cellMolten)) return; //Tank "Recipe" - final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(cellMolten), Materials.Empty.getCells(1)); + final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(cell), Materials.Empty.getCells(1)); GT_Utility.addFluidContainerData(data); - GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cellMolten), new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144)); + GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(WerkstoffLoader.cellMolten), new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144)); if (LoaderReference.Forestry) { final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); -- cgit From d394bcef43fd1fb4f93943fda0eb62e94ca5a73b Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 28 May 2020 19:38:27 +0200 Subject: removed failed break; Former-commit-id: 0cd14e98edcbe48cb5aea486369294e4683d3a82 --- .../github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 00c01f85aa..424a557f9a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -117,7 +117,6 @@ public class WerkstoffLoader { if (!gtnhGT) { WerkstoffLoader.HDCS.getGenerationFeatures().extraRecipes ^= 10; - break; } if (WerkstoffLoader.cellMolten == null) { -- cgit From 873503aaffd4f8e00e104e1b8a7d3c8e1a1cdc79 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 7 Jun 2020 00:47:29 +0200 Subject: Fixed Cables Former-commit-id: 345ef743d831c178a76cd0963b76c920e2fc5a37 --- .../tectech/tileentites/tiered/LowPowerLaser.java | 2 +- .../TT_MetaTileEntity_Pipe_Energy_LowPower.java | 40 ++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java index e89bff4e00..9cc15b6773 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java @@ -106,7 +106,7 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel } ((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).markUsed(); - } else if (aBaseMetaTileEntity instanceof LowPowerLaser && ((LowPowerLaser) aMetaTileEntity).isTunnel()) { + } else if (aMetaTileEntity instanceof LowPowerLaser && ((LowPowerLaser) aMetaTileEntity).isTunnel()) { if (!((LowPowerLaser) aMetaTileEntity).isConnectedCorrectly(front)) return; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java index 140359c159..96522d618e 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java @@ -23,19 +23,26 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.google.common.collect.Sets; import gregtech.api.enums.Dyes; import gregtech.api.enums.Materials; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Client; import ic2.core.Ic2Items; import net.minecraft.block.Block; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.StatCollector; +import java.util.ArrayList; +import java.util.HashSet; + public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Cable implements LowPowerLaser { public TT_MetaTileEntity_Pipe_Energy_LowPower(int aID, String aName, String aNameRegional) { @@ -110,4 +117,37 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca public boolean isConnectedCorrectly(byte aSide) { return this.isConnectedAtSide(aSide) && this.isConnectedAtSide(GT_Utility.getOppositeSide(aSide)); } + + @Override + public boolean shouldJoinIc2Enet() { + return false; + } + + @Override + public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { + return 0L; + } + + + @Override + @Deprecated + @SuppressWarnings("deprecation") + public long transferElectricity(byte aSide, long aVoltage, long aAmperage, ArrayList aAlreadyPassedTileEntityList) { + return 0L; + } + + @Override + public long transferElectricity(byte aSide, long aVoltage, long aAmperage, HashSet aAlreadyPassedSet) { + return 0L; + } + + @Override + public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return true; + } } -- cgit From bb8f9a697282013b669678fd25b036d1940e63ab Mon Sep 17 00:00:00 2001 From: botn365 <42187820+botn365@users.noreply.github.com> Date: Sun, 7 Jun 2020 21:01:49 +0200 Subject: fix more then 1 energy hatch on circuit assmebler Former-commit-id: bac49f18bc2b34e059b7ea082ef5e5572d842907 --- .../common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index af096236aa..fe20f66d50 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -286,7 +286,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl } } } - return this.mEnergyHatches.size() > 0 && this.mMaintenanceHatches.size() == 1; + return this.mEnergyHatches.size() == 1 && this.mMaintenanceHatches.size() == 1; } @Override -- cgit From 81a97f7b99b7cec01fd609997a4b300952f3c83f Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 9 Jun 2020 18:01:26 +0200 Subject: Fixes + fixed Ross128b crash + fixed TT recipe overlap + fixed double replicator recipes + updated deps Former-commit-id: a265fe24881113be57001e84d3892d60d81f84aa --- libs/TecTech-1.7.10-3.8.1-dev.jar.REMOVED.git-id | 1 - libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id | 1 + libs/gregtech-5.09.33.44-dev.jar.REMOVED.git-id | 1 - libs/gregtech-5.09.33.52-dev.jar.REMOVED.git-id | 1 + .../bartworks/common/loaders/RecipeLoader.java | 2 +- .../bartworks/system/material/WerkstoffLoader.java | 4 +- .../bartworks/system/worldgen/MapGenRuins.java | 342 +++++++++++---------- .../planets/ross128b/ChunkProviderRoss128b.java | 25 +- .../TT_MetaTileEntity_Pipe_Energy_LowPower.java | 1 - 9 files changed, 205 insertions(+), 173 deletions(-) delete mode 100644 libs/TecTech-1.7.10-3.8.1-dev.jar.REMOVED.git-id create mode 100644 libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id delete mode 100644 libs/gregtech-5.09.33.44-dev.jar.REMOVED.git-id create mode 100644 libs/gregtech-5.09.33.52-dev.jar.REMOVED.git-id diff --git a/libs/TecTech-1.7.10-3.8.1-dev.jar.REMOVED.git-id b/libs/TecTech-1.7.10-3.8.1-dev.jar.REMOVED.git-id deleted file mode 100644 index ad85afb9bc..0000000000 --- a/libs/TecTech-1.7.10-3.8.1-dev.jar.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -edbdb613c8251af1451312d5dc7a4ee99c66b13f \ No newline at end of file diff --git a/libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id b/libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id new file mode 100644 index 0000000000..44e06955ea --- /dev/null +++ b/libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id @@ -0,0 +1 @@ +cf867aabae89a4c11d9452678ee405ba22103922 \ No newline at end of file diff --git a/libs/gregtech-5.09.33.44-dev.jar.REMOVED.git-id b/libs/gregtech-5.09.33.44-dev.jar.REMOVED.git-id deleted file mode 100644 index ecf897dd93..0000000000 --- a/libs/gregtech-5.09.33.44-dev.jar.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -1d948ce2fb4969a62ea55a6bc396d61f209cd52a \ No newline at end of file diff --git a/libs/gregtech-5.09.33.52-dev.jar.REMOVED.git-id b/libs/gregtech-5.09.33.52-dev.jar.REMOVED.git-id new file mode 100644 index 0000000000..f92d3052a9 --- /dev/null +++ b/libs/gregtech-5.09.33.52-dev.jar.REMOVED.git-id @@ -0,0 +1 @@ +099d4e2e397a3d24c7339102cf3908403f33ab3d \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index c8bc059230..b300adaa11 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -873,7 +873,7 @@ public class RecipeLoader { GT_Values.RA.addAssemblerRecipe( new ItemStack[]{ ItemList.Circuit_Parts_GlassFiber.get(32), - GT_OreDictUnificator.get(WerkstoffLoader.gtnhGT ? OrePrefixes.foil : OrePrefixes.plateDouble, Materials.Silver, WerkstoffLoader.gtnhGT ? 8 : 1), + GT_OreDictUnificator.get(WerkstoffLoader.gtnhGT ? OrePrefixes.foil : OrePrefixes.plateDouble, Materials.Electrum, WerkstoffLoader.gtnhGT ? 8 : 1), WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2) }, Materials.Polytetrafluoroethylene.getMolten(72), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 424a557f9a..c80c50cce9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1732,7 +1732,7 @@ public class WerkstoffLoader { Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(prefixes)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, null, new ItemStack[]{werkstoff.get(prefixes)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); + //GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, null, new ItemStack[]{werkstoff.get(prefixes)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); } } } @@ -2511,7 +2511,7 @@ public class WerkstoffLoader { Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{Materials.Empty.getCells(1)}, new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); + //GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{Materials.Empty.getCells(1)}, new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java index 14f0ca8e0c..29eb79ebdc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java @@ -24,14 +24,17 @@ package com.github.bartimaeusnek.bartworks.system.worldgen; import com.github.bartimaeusnek.bartworks.util.Pair; import gregtech.api.GregTech_API; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.metatileentity.MetaPipeEntity; import gregtech.api.objects.XSTR; +import gregtech.api.threads.GT_Runnable_MachineBlockUpdate; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; @@ -45,64 +48,158 @@ import static net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST; @SuppressWarnings({"ALL"}) public abstract class MapGenRuins extends WorldGenerator { - protected Pair[][] ToBuildWith = new Pair[4][0]; + protected Pair[][] ToBuildWith = new Pair[4][0]; @Override public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { return false; } - protected void setFloorBlocks(int[] metas, Block... blocks){ - this.ToBuildWith[0]=new Pair[metas.length]; + protected void setFloorBlocks(int[] metas, Block... blocks) { + this.ToBuildWith[0] = new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { - this.ToBuildWith[0][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + this.ToBuildWith[0][i] = new Pair<>(blocks[i % blocks.length], metas[i]); } } - protected void setWallBlocks(int[] metas,Block... blocks){ - this.ToBuildWith[1]=new Pair[metas.length]; + protected void setWallBlocks(int[] metas, Block... blocks) { + this.ToBuildWith[1] = new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { - this.ToBuildWith[1][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + this.ToBuildWith[1][i] = new Pair<>(blocks[i % blocks.length], metas[i]); } } - protected void setRoofBlocks(int[] metas,Block... blocks){ - this.ToBuildWith[2]=new Pair[metas.length]; + protected void setRoofBlocks(int[] metas, Block... blocks) { + this.ToBuildWith[2] = new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { - this.ToBuildWith[2][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + this.ToBuildWith[2][i] = new Pair<>(blocks[i % blocks.length], metas[i]); } } - protected void setMiscBlocks(int[] metas,Block... blocks){ - this.ToBuildWith[3]=new Pair[metas.length]; + protected void setMiscBlocks(int[] metas, Block... blocks) { + this.ToBuildWith[3] = new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { - this.ToBuildWith[3][i]=new Pair<>(blocks[i%blocks.length],metas[i]); + this.ToBuildWith[3][i] = new Pair<>(blocks[i % blocks.length], metas[i]); } } int[] statBlocks = new int[4]; - protected void setRandomBlockWAirChance(World worldObj, int x, int y, int z, Random rand, int airchance, Pair... blocks){ + protected void setRandomBlockWAirChance(World worldObj, int x, int y, int z, Random rand, int airchance, Pair... blocks) { if (rand.nextInt(100) > airchance) - this.setRandomBlock(worldObj,x,y,z,rand,blocks); + this.setRandomBlock(worldObj, x, y, z, rand, blocks); else - this.setBlock(worldObj,x,y,z,Blocks.air,0); + this.setBlock(worldObj, x, y, z, Blocks.air, 0); } - protected void setRandomBlock(World worldObj, int x, int y, int z, Random rand, Pair... blocks){ + protected void setRandomBlock(World worldObj, int x, int y, int z, Random rand, Pair... blocks) { Block toSet = blocks[rand.nextInt(blocks.length)].getKey(); int meta = blocks[rand.nextInt(blocks.length)].getValue(); - this.setBlock(worldObj,x,y,z,toSet,meta); + this.setBlock(worldObj, x, y, z, toSet, meta); } - protected void setBlock(World worldObj, int x, int y, int z, Block block,int meta){ - this.setBlockAndNotifyAdequately(worldObj,x,y,z,block,meta); + protected void setBlock(World worldObj, int x, int y, int z, Block block, int meta) { + this.setBlockAndNotifyAdequately(worldObj, x, y, z, block, meta); } - protected void setBlock(World worldObj, int x, int y, int z, Pair pair){ - this.setBlockAndNotifyAdequately(worldObj,x,y,z,pair.getKey(),pair.getValue()); + + protected void setBlock(World worldObj, int x, int y, int z, Pair pair) { + this.setBlockAndNotifyAdequately(worldObj, x, y, z, pair.getKey(), pair.getValue()); + } + + private TileEntity setGTMachineBlock(World worldObj, int x, int y, int z, int meta) { + boolean isEnabled = true; + try { + isEnabled = GT_Runnable_MachineBlockUpdate.isEnabled(); + } catch (Throwable ignored) { + isEnabled = false; + } + if (isEnabled) + throw new IllegalStateException("Machine Block Runnable needs to be disabled while creating world!"); + this.setBlockAndNotifyAdequately(worldObj, x, y, z, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); + TileEntity tile = worldObj.getTileEntity(x, y, z); + ((IGregTechTileEntity) tile).setInitialValuesAsNBT(null, (short) meta); + return tile; + } + + protected TileEntity reSetGTTileEntity(IGregTechTileEntity bte, World worldObj, int x, int y, int z, int meta) { + worldObj.removeTileEntity(x, y, z); + this.setBlock(worldObj, x, y, z, Blocks.air, 0); + return setGTMachineBlock(worldObj, x, y, z, meta); + } + + protected void setGTMachineBlockWChance(World worldObj, int x, int y, int z, Random rand, int airchance, int meta) { + if (rand.nextInt(100) > airchance) { + this.setGTMachineBlock(worldObj, x, y, z, meta); + } else + this.setBlock(worldObj, x, y, z, Blocks.air, 0); + } + + protected void setGTCablekWChance(World worldObj, int x, int y, int z, Random rand, int airchance, int meta) { + if (rand.nextInt(100) > airchance) { + this.setGTCable(worldObj, x, y, z, meta); + } else + this.setBlock(worldObj, x, y, z, Blocks.air, 0); + } + + protected void setGTMachine(World worldObj, int x, int y, int z, int meta, String ownerName, byte facing) { + try { + GT_Runnable_MachineBlockUpdate.setDisabled(); + } catch (Throwable ignored) { + } + setGTMachineBlock(worldObj, x, y, z, meta); + BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z); + BTE.setOwnerName(ownerName); + BTE.setFrontFacing(facing); + BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z); + checkTile(BTE, worldObj, x, y, z, meta, ownerName, facing, 0); + try { + GT_Runnable_MachineBlockUpdate.setEnabled(); + } catch (Throwable ignored) { + } + } + + private void checkTile(BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, byte facing, int depth) { + if (depth < 25) { + if (BTE.getMetaTileID() != meta || worldObj.getTileEntity(x, y, z) != BTE || BTE.isInvalid()) { + redoTile(BTE, worldObj, x, y, z, meta, ownerName, facing); + checkTile(BTE, worldObj, x, y, z, meta, ownerName, facing, depth++); + } + } else { + worldObj.removeTileEntity(x, y, z); + worldObj.setBlockToAir(x, y, z); + } + } + + private void redoTile(BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, byte facing) { + reSetGTTileEntity(BTE, worldObj, x, y, z, meta); + BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z); + BTE.setOwnerName(ownerName); + BTE.setFrontFacing(facing); + } + + protected void setGTCable(World worldObj, int x, int y, int z, int meta) { + try { + GT_Runnable_MachineBlockUpdate.setDisabled(); + } catch (Throwable ignored) { + } + BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) setGTMachineBlock(worldObj, x, y, z, meta); + MetaPipeEntity MPE = (MetaPipeEntity) BTE.getMetaTileEntity(); + BTE.mConnections |= (byte) (1 << (byte) 4); + BTE.mConnections |= (byte) (1 << GT_Utility.getOppositeSide(4)); + BaseMetaTileEntity BPE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z - 1); + if (BPE != null) { + BTE.mConnections |= (byte) (1 << (byte) 2); + } + MPE.mConnections = BTE.mConnections; + try { + GT_Runnable_MachineBlockUpdate.setEnabled(); + } catch (Throwable ignored) { + } } - public static class RuinsBase extends MapGenRuins{ + public static class RuinsBase extends MapGenRuins { + + private static final String owner = "Ancient Cultures"; @Override public boolean generate(World worldObj, Random rand1, int x, int y, int z) { @@ -114,175 +211,115 @@ public abstract class MapGenRuins extends WorldGenerator { Random rand = new XSTR(rand1.nextLong()); SecureRandom secureRandom = new SecureRandom(); - x=x+5; - z=z+5; - - if (worldObj.getBlock(x,y,z) == Blocks.air) { + if (worldObj.getBlock(x, y, z) == Blocks.air) { while (worldObj.getBlock(x, y, z) == Blocks.air) { y--; } - } else { - while (worldObj.getBlock(x, y, z) != Blocks.air) { - y++; - } - y--; } - this.setFloorBlocks(new int[]{0,0,0},Blocks.brick_block,Blocks.double_stone_slab,Blocks.stonebrick); - this.setWallBlocks(new int[]{0,1,2,1,1},Blocks.stonebrick); - this.setRoofBlocks(new int[]{9},Blocks.log); - this.setMiscBlocks(new int[]{1},Blocks.log); + this.setFloorBlocks(new int[]{0, 0, 0}, Blocks.brick_block, Blocks.double_stone_slab, Blocks.stonebrick); + this.setWallBlocks(new int[]{0, 1, 2, 1, 1}, Blocks.stonebrick); + this.setRoofBlocks(new int[]{9}, Blocks.log); + this.setMiscBlocks(new int[]{1}, Blocks.log); this.statBlocks = new int[]{rand.nextInt(this.ToBuildWith[0].length)}; int colored = rand.nextInt(15); int tier = secureRandom.nextInt(maxTierRoss); boolean useColor = rand.nextBoolean(); byte set = 0; byte toSet = (byte) (rand.nextInt(maxTierRoss - tier) + 1); - short cablemeta = GT_WorldgenUtil.getCable(secureRandom,tier); + short cablemeta = GT_WorldgenUtil.getCable(secureRandom, tier); byte treeinaRow = 0; boolean lastset = rand.nextBoolean(); for (int dx = -6; dx <= 6; dx++) { for (int dy = 0; dy <= 8; dy++) { for (int dz = -6; dz <= 6; dz++) { - this.setBlock(worldObj,x+dx,y+dy,z+dz,Blocks.air,0); - if (dy == 0){ - Pair floor = this.ToBuildWith[0][this.statBlocks[0]]; - this.setBlock(worldObj,x+dx,y+ 0,z+dz, floor.getKey(),floor.getValue()); - } - else if (dy > 0 && dy < 4){ - if (Math.abs(dx) == 5 && Math.abs(dz) == 5){ - this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,5, this.ToBuildWith[3][0]); - } - else if ((dx == 0) && dz == -5 && (dy == 1 || dy == 2)){ + this.setBlock(worldObj, x + dx, y + dy, z + dz, Blocks.air, 0); + if (dy == 0) { + Pair floor = this.ToBuildWith[0][this.statBlocks[0]]; + this.setBlock(worldObj, x + dx, y + 0, z + dz, floor.getKey(), floor.getValue()); + } else if (dy > 0 && dy < 4) { + if (Math.abs(dx) == 5 && Math.abs(dz) == 5) { + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 5, this.ToBuildWith[3][0]); + } else if ((dx == 0) && dz == -5 && (dy == 1 || dy == 2)) { if (dy == 1) - this.setBlock(worldObj,x+dx,y+ 1,z+ -5, Blocks.iron_door,1); + this.setBlock(worldObj, x + dx, y + 1, z + -5, Blocks.iron_door, 1); if (dy == 2) - this.setBlock(worldObj,x+dx,y+ 2,z+dz, Blocks.iron_door,8); - } - else if (Math.abs(dx)== 5 && Math.abs(dz) < 5 || Math.abs(dz)== 5 && Math.abs(dx) < 5){ - this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); + this.setBlock(worldObj, x + dx, y + 2, z + dz, Blocks.iron_door, 8); + } else if (Math.abs(dx) == 5 && Math.abs(dz) < 5 || Math.abs(dz) == 5 && Math.abs(dx) < 5) { + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); if (dy == 2) { - if (rand.nextInt(100)<12) + if (rand.nextInt(100) < 12) if (useColor) - this.setRandomBlockWAirChance(worldObj,x+dx,y+ 2,z+dz,rand,25,new Pair<>(Blocks.stained_glass_pane,colored)); + this.setRandomBlockWAirChance(worldObj, x + dx, y + 2, z + dz, rand, 25, new Pair<>(Blocks.stained_glass_pane, colored)); else - this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25,new Pair<>(Blocks.glass_pane,0)); + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, new Pair<>(Blocks.glass_pane, 0)); } } - if (dy == 3 && Math.abs(dx)== 6){ - this.setRandomBlockWAirChance(worldObj,x+dx,y+ 3,z+dz,rand,25, this.ToBuildWith[2]); + if (dy == 3 && Math.abs(dx) == 6) { + this.setRandomBlockWAirChance(worldObj, x + dx, y + 3, z + dz, rand, 25, this.ToBuildWith[2]); } - if (dy == 1){ - if (dx == 3 && dz == -3){ - this.setBlock(worldObj,x + 3, y + 1, z + dz,Blocks.crafting_table,0); + if (dy == 1) { + if (dx == 3 && dz == -3) { + this.setBlock(worldObj, x + 3, y + 1, z + dz, Blocks.crafting_table, 0); } - if (dx == -3 && (dz == -3 || dz == -2)){ - this.setBlock(worldObj,x + -3, y + dy, z + dz,Blocks.chest,5); - IInventory chest = (IInventory)worldObj.getTileEntity(x + dx, y + dy, z + dz); + if (dx == -3 && (dz == -3 || dz == -2)) { + this.setBlock(worldObj, x + -3, y + dy, z + dz, Blocks.chest, 5); + IInventory chest = (IInventory) worldObj.getTileEntity(x + dx, y + dy, z + dz); if (chest != null) { WeightedRandomChestContent.generateChestContents(secureRandom, ChestGenHooks.getItems(PYRAMID_JUNGLE_CHEST, rand), chest, ChestGenHooks.getCount(PYRAMID_JUNGLE_CHEST, rand)); } } - if (dx == 4 && dz==4) { - short meta = GT_WorldgenUtil.getGenerator(secureRandom,tier); - this.setBlock(worldObj, x + 4, y + dy, z + dz, GT_WorldgenUtil.GT_TILES,GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); - BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); - BTE.setInitialValuesAsNBT(null,meta); - BTE.setOwnerName("Ancient Cultures"); - BTE.setFrontFacing(tier > 0 ? (byte)4 : (byte) 2); - - } - else if (dx == 3 && dz==4) { - if (tier>0) { + if (dx == 4 && dz == 4) { + short meta = GT_WorldgenUtil.getGenerator(secureRandom, tier); + this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, tier > 0 ? (byte) 4 : (byte) 2); + } else if (dx == 3 && dz == 4) { + if (tier > 0) { short meta = GT_WorldgenUtil.getBuffer(secureRandom, tier); - this.setBlock(worldObj, x + 3, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); - BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); - BTE.setInitialValuesAsNBT(null, meta); - BTE.setOwnerName("Ancient Cultures"); - BTE.setFrontFacing((byte) 4); - }else{ - short meta = cablemeta; - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 33, new Pair(GT_WorldgenUtil.GT_TILES, (int) GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType())); - BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); - if (BTE != null) { - BTE.setInitialValuesAsNBT(null, meta); - BTE.setOwnerName("Ancient Cultures"); - BTE.setFrontFacing((byte) 4); - BTE.mConnections = (byte) (BTE.mConnections | 1 << (byte) 4); - BTE.mConnections = (byte) (BTE.mConnections | 1 << GT_Utility.getOppositeSide(4)); - ((MetaPipeEntity) BTE.getMetaTileEntity()).mConnections = BTE.mConnections; - } + this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, (byte) 4); + } else { + this.setGTCablekWChance(worldObj, x + dx, y + dy, z + dz, rand, 33, cablemeta); } - } - else if (dx < 3 && dx > -5 && dz == 4) { - short meta = cablemeta; - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + 4, rand, 33, new Pair(GT_WorldgenUtil.GT_TILES, (int) GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType())); - - BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); - if (BTE != null) { - BTE.setInitialValuesAsNBT(null, meta); - BTE.setOwnerName("Ancient Cultures"); - BTE.setFrontFacing((byte) 4); - BTE.mConnections = (byte)(BTE.mConnections | 1 << (byte)4); - BTE.mConnections = (byte)(BTE.mConnections | 1 << GT_Utility.getOppositeSide(4)); - - BaseMetaTileEntity BPE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz-1); - if (BPE != null) { - BTE.mConnections = (byte)(BTE.mConnections | 1 << (byte)2); - } - ((MetaPipeEntity)BTE.getMetaTileEntity()).mConnections=BTE.mConnections; - } - - } - else if (dx < 3 && dx > -5 && dz == 3 && set < toSet){ + } else if (dx < 3 && dx > -5 && dz == 4) { + this.setGTCablekWChance(worldObj, x + dx, y + dy, z + dz, rand, 33, cablemeta); + } else if (dx < 3 && dx > -5 && dz == 3 && set < toSet) { if (!lastset || treeinaRow > 2) { short meta = GT_WorldgenUtil.getMachine(secureRandom, tier); - this.setBlock(worldObj, x + dx, y + dy, z + 3, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); - BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); - BTE.setInitialValuesAsNBT(null, meta); - BTE.setOwnerName("Ancient Cultures"); - BTE.setFrontFacing((byte) 2); + this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, (byte) 2); set++; treeinaRow = 0; - lastset=true; - } - else { + lastset = true; + } else { lastset = rand.nextBoolean(); if (lastset) treeinaRow++; } } } - } - else if(dy == 4){ - if (Math.abs(dx)== 5) - this.setRandomBlockWAirChance(worldObj,x+dx,y+ 4,z+dz,rand,25, this.ToBuildWith[2]); + } else if (dy == 4) { + if (Math.abs(dx) == 5) + this.setRandomBlockWAirChance(worldObj, x + dx, y + 4, z + dz, rand, 25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 5) - this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); - } - else if(dy == 5){ - if (Math.abs(dx)== 4) - this.setRandomBlockWAirChance(worldObj,x+dx,y+ 5,z+dz,rand,25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + } else if (dy == 5) { + if (Math.abs(dx) == 4) + this.setRandomBlockWAirChance(worldObj, x + dx, y + 5, z + dz, rand, 25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 4) - this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); - } - else if(dy == 6){ - if (Math.abs(dx)== 3) - this.setRandomBlockWAirChance(worldObj,x+dx,y+ 6,z+dz,rand,25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + } else if (dy == 6) { + if (Math.abs(dx) == 3) + this.setRandomBlockWAirChance(worldObj, x + dx, y + 6, z + dz, rand, 25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 3) - this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); - } - else if(dy == 7){ - if (Math.abs(dx)== 2) - this.setRandomBlockWAirChance(worldObj,x+dx,y+ 7,z+dz,rand,25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + } else if (dy == 7) { + if (Math.abs(dx) == 2) + this.setRandomBlockWAirChance(worldObj, x + dx, y + 7, z + dz, rand, 25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 2) - this.setRandomBlockWAirChance(worldObj,x+dx,y+dy,z+dz,rand,25, this.ToBuildWith[1]); - } - else if(dy == 8) { + this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + } else if (dy == 8) { if (Math.abs(dx) == 1 || Math.abs(dx) == 0) this.setRandomBlockWAirChance(worldObj, x + dx, y + 8, z + dz, rand, 25, this.ToBuildWith[2]); } @@ -290,29 +327,24 @@ public abstract class MapGenRuins extends WorldGenerator { } } tosetloop: - while (set < toSet){ + while (set < toSet) { int dy = 1; int dz = 3; for (int dx = 2; dx > -5; dx--) { - if (set < toSet){ + if (set < toSet) { if (!lastset || treeinaRow > 2 && worldObj.getTileEntity(x + dx, y + dy, z + dz) == null) { short meta = GT_WorldgenUtil.getMachine(secureRandom, tier); - this.setBlock(worldObj, x + dx, y + dy, z + dz, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); - BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x + dx, y + dy, z + dz); - BTE.setInitialValuesAsNBT(null, meta); - BTE.setOwnerName("Ancient Cultures"); - BTE.setFrontFacing((byte) 2); + this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, (byte) 2); set++; treeinaRow = 0; - lastset=true; - } - else { + lastset = true; + } else { lastset = rand.nextBoolean(); if (lastset) treeinaRow++; } - }else + } else break tosetloop; } } @@ -320,4 +352,4 @@ public abstract class MapGenRuins extends WorldGenerator { } } -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index 4bc8f64f10..6fc3ed11ec 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -123,21 +123,22 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { int x1; int y1; int z1; - - if (biomegenbase != BiomeGenBase.ocean && biomegenbase != BiomeGenBase.deepOcean && biomegenbase != BiomeGenBase.river && biomegenbase != BiomeGenBase.frozenOcean && biomegenbase != BiomeGenBase.frozenRiver - && this.rand.nextInt(ConfigHandler.ross128bRuinChance) == 0) { - x1 = k + this.rand.nextInt(16) + 3; - y1 = this.rand.nextInt(256); - z1 = l + this.rand.nextInt(16) + 3; - this.ruinsBase.generate(this.worldObj, this.rand, x1, y1, z1); - } - - if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && this.rand.nextInt(4) == 0 - && TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, LAKE)) { + if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, LAKE)) { x1 = k + this.rand.nextInt(16) + 8; y1 = this.rand.nextInt(256); z1 = l + this.rand.nextInt(16) + 8; - (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, x1, y1, z1); + int rni = this.rand.nextInt(8); + if (rni == 0) + (new WorldGenLakes(Blocks.ice)).generate(this.worldObj, this.rand, x1, y1, z1); + else if (rni == 4) + (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, x1, y1, z1); + } + if (biomegenbase != BiomeGenBase.ocean && biomegenbase != BiomeGenBase.deepOcean && biomegenbase != BiomeGenBase.river && biomegenbase != BiomeGenBase.frozenOcean && biomegenbase != BiomeGenBase.frozenRiver + && this.rand.nextInt(ConfigHandler.ross128bRuinChance) == 0) { + x1 = k + this.rand.nextInt(16) + 3; + y1 = this.rand.nextInt(256); + z1 = l + this.rand.nextInt(16) + 3; + this.ruinsBase.generate(this.worldObj, this.rand, x1, y1, z1); } biomegenbase.decorate(this.worldObj, this.rand, k, l); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java index 96522d618e..12f4c6d2cd 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java @@ -23,7 +23,6 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import com.google.common.collect.Sets; import gregtech.api.enums.Dyes; import gregtech.api.enums.Materials; import gregtech.api.interfaces.ITexture; -- cgit From 1a2ac8922ef5f8971c23dc7fe9b80cffb3f3ede5 Mon Sep 17 00:00:00 2001 From: botn365 <42187820+botn365@users.noreply.github.com> Date: Fri, 12 Jun 2020 15:13:29 +0200 Subject: oganeson fusion buff makes the Og production to 2/s instead of 1.92/s Former-commit-id: 8a36c50b12963513d955039d5484eceb6f2741a8 --- .../system/material/processingLoaders/AdditionalRecipes.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index ed77b13329..332cbdfb66 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -304,8 +304,8 @@ public class AdditionalRecipes { GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust, 10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.CubicZirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 57600, BW_Util.getMachineVoltageFromTier(3), 2953); //Tellurium GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed, Materials.Lead, 10L), GT_Utility.getIntegratedCircuit(17), GT_Values.NF, GT_Values.NF, Materials.Lead.getIngots(10), Materials.Tellurium.getNuggets(20), 800, BW_Util.getMachineVoltageFromTier(2), 722); - GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium.getMolten(48), Materials.Beryllium.getMolten(48), WerkstoffLoader.Californium.getMolten(48), 250, 49152, 480000000); - GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(48), WerkstoffLoader.Calcium.getMolten(48), WerkstoffLoader.Oganesson.getFluidOrGas(48), 500, 49152, 600000000); + GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium.getMolten(48), Materials.Beryllium.getMolten(48), WerkstoffLoader.Californium.getMolten(48), 240, 49152, 480000000); + GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(48), WerkstoffLoader.Calcium.getMolten(48), WerkstoffLoader.Oganesson.getFluidOrGas(48), 480, 49152, 600000000); GT_Values.RA.addDistillationTowerRecipe(Materials.LiquidAir.getFluid(100000000), new FluidStack[]{Materials.Nitrogen.getGas(78084000), Materials.Oxygen.getGas(20946000), Materials.Argon.getGas(934000), Materials.CarbonDioxide.getGas(40700), WerkstoffLoader.Neon.getFluidOrGas(1818), Materials.Helium.getGas(524), Materials.Methane.getGas(180), WerkstoffLoader.Krypton.getFluidOrGas(114), Materials.Hydrogen.getGas(55), WerkstoffLoader.Xenon.getFluidOrGas(9)}, null, 7500, BW_Util.getMachineVoltageFromTier(4)); GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust), WerkstoffLoader.Neon.getFluidOrGas(1000), WerkstoffLoader.MagnetoResonaticDust.get(gemChipped, 9), 9000, 4500, BW_Util.getMachineVoltageFromTier(5)); GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust), WerkstoffLoader.Krypton.getFluidOrGas(1000), WerkstoffLoader.MagnetoResonaticDust.get(gem), 10000, 4500, BW_Util.getMachineVoltageFromTier(5)); @@ -416,4 +416,4 @@ public class AdditionalRecipes { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{Materials.Empty.getCells(1)}, new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); } -} \ No newline at end of file +} -- cgit From fce57f6259047e12bfbb76077b5556d51e40489b Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 22 Jun 2020 23:37:48 +0200 Subject: Added Autogenerated Casings Former-commit-id: 4533005bb093686fb3192113c572c3821cb5c36c --- build.gradle | 8 +- .../client/textures/PrefixTextureLinker.java | 22 ++++ .../material/BW_MetaGeneratedBlocks_Casing.java | 99 +++++++++++++++ .../BW_MetaGeneratedBlocks_CasingAdvanced_TE.java | 37 ++++++ .../material/BW_MetaGeneratedBlocks_Casing_TE.java | 37 ++++++ .../system/material/BW_MetaGenerated_Blocks.java | 8 +- .../bartworks/system/material/Werkstoff.java | 30 +++-- .../bartworks/system/material/WerkstoffLoader.java | 135 ++++++++++++++++++++- .../blocks/materialicons/DIAMOND/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/DIAMOND/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../DIAMOND/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/DIAMOND/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/DULL/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/DULL/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../DULL/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/DULL/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/EMERALD/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/EMERALD/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../EMERALD/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/EMERALD/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/FIERY/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/FIERY/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../FIERY/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/FIERY/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/FINE/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/FINE/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../FINE/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/FINE/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/FLINT/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/FLINT/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../FLINT/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/FLINT/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/FLUID/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/FLUID/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../FLUID/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/FLUID/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/GEM_HORIZONTAL/blockCasing.png | Bin 0 -> 626 bytes .../GEM_HORIZONTAL/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../GEM_HORIZONTAL/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../GEM_HORIZONTAL/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/GEM_VERTICAL/blockCasing.png | Bin 0 -> 626 bytes .../GEM_VERTICAL/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../GEM_VERTICAL/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../GEM_VERTICAL/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/GLASS/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/GLASS/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../GLASS/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/GLASS/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/LAPIS/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/LAPIS/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../LAPIS/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/LAPIS/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/LEAF/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/LEAF/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../LEAF/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/LEAF/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/LIGNITE/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/LIGNITE/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../LIGNITE/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/LIGNITE/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/MAGNETIC/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/MAGNETIC/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../MAGNETIC/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/MAGNETIC/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/METALLIC/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/METALLIC/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../METALLIC/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/METALLIC/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/NETHERSTAR/blockCasing.png | Bin 0 -> 626 bytes .../NETHERSTAR/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../NETHERSTAR/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../NETHERSTAR/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/NONE/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/NONE/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../NONE/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/NONE/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/OPAL/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/OPAL/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../OPAL/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/OPAL/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/PAPER/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/PAPER/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../PAPER/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/PAPER/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/POWDER/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/POWDER/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../POWDER/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/POWDER/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/QUARTZ/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/QUARTZ/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../QUARTZ/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/QUARTZ/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/ROUGH/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/ROUGH/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../ROUGH/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/ROUGH/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/RUBY/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/RUBY/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../RUBY/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/RUBY/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/SAND/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/SAND/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../SAND/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/SAND/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/SHARDS/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/SHARDS/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../SHARDS/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/SHARDS/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/SHINY/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/SHINY/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../SHINY/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/SHINY/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../blocks/materialicons/WOOD/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/WOOD/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../WOOD/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/WOOD/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../textures/blocks/materialicons/blockCasing.png | Bin 0 -> 626 bytes .../blocks/materialicons/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../materialicons/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../textures/blocks/materialicons/copy.bat | 1 + .../items/materialicons/DIAMOND/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/DIAMOND/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../DIAMOND/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/DIAMOND/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/DULL/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/DULL/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../DULL/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/DULL/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/EMERALD/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/EMERALD/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../EMERALD/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/EMERALD/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/FIERY/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/FIERY/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../FIERY/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/FIERY/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/FINE/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/FINE/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../FINE/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/FINE/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/FLINT/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/FLINT/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../FLINT/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/FLINT/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/FLUID/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/FLUID/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../FLUID/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/FLUID/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/GEM_HORIZONTAL/blockCasing.png | Bin 0 -> 626 bytes .../GEM_HORIZONTAL/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../GEM_HORIZONTAL/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../GEM_HORIZONTAL/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/GEM_VERTICAL/blockCasing.png | Bin 0 -> 626 bytes .../GEM_VERTICAL/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../GEM_VERTICAL/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../GEM_VERTICAL/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/GLASS/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/GLASS/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../GLASS/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/GLASS/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/LAPIS/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/LAPIS/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../LAPIS/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/LAPIS/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/LEAF/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/LEAF/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../LEAF/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/LEAF/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/LIGNITE/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/LIGNITE/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../LIGNITE/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/LIGNITE/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/MAGNETIC/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/MAGNETIC/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../MAGNETIC/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/MAGNETIC/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/METALLIC/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/METALLIC/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../METALLIC/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/METALLIC/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/NETHERSTAR/blockCasing.png | Bin 0 -> 626 bytes .../NETHERSTAR/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../NETHERSTAR/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../NETHERSTAR/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/NONE/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/NONE/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../NONE/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/NONE/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/OPAL/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/OPAL/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../OPAL/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/OPAL/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/PAPER/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/PAPER/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../PAPER/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/PAPER/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/POWDER/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/POWDER/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../POWDER/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/POWDER/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/QUARTZ/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/QUARTZ/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../QUARTZ/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/QUARTZ/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/ROUGH/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/ROUGH/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../ROUGH/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/ROUGH/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/RUBY/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/RUBY/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../RUBY/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/RUBY/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/SAND/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/SAND/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../SAND/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/SAND/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/SHARDS/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/SHARDS/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../SHARDS/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/SHARDS/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/SHINY/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/SHINY/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../SHINY/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/SHINY/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes .../items/materialicons/WOOD/blockCasing.png | Bin 0 -> 626 bytes .../materialicons/WOOD/blockCasingAdvanced.png | Bin 0 -> 639 bytes .../WOOD/blockCasingAdvanced_OVERLAY.png | Bin 0 -> 139 bytes .../materialicons/WOOD/blockCasing_OVERLAY.png | Bin 0 -> 139 bytes 228 files changed, 363 insertions(+), 14 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/materialicons/copy.bat create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DULL/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DULL/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DULL/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/DULL/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FINE/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FINE/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FINE/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FINE/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NONE/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NONE/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NONE/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/NONE/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SAND/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SAND/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SAND/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SAND/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/blockCasing_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/blockCasing.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/blockCasingAdvanced.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/blockCasingAdvanced_OVERLAY.png create mode 100644 src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/blockCasing_OVERLAY.png diff --git a/build.gradle b/build.gradle index 3e1ffaa99c..96e65157ca 100644 --- a/build.gradle +++ b/build.gradle @@ -51,12 +51,15 @@ idea{ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - import de.undercouch.gradle.tasks.download.Download +//noinspection GroovyUnusedAssignment sourceCompatibility = JavaVersion.VERSION_1_8 +//noinspection GroovyUnusedAssignment targetCompatibility = JavaVersion.VERSION_1_8 +//noinspection GroovyUnusedAssignment sourceCompatibility = 1.8 +//noinspection GroovyUnusedAssignment targetCompatibility = 1.8 compileJava.options.encoding = 'UTF-8' @@ -70,7 +73,9 @@ configFile.withReader { version = config.majorUpdate+"."+config.minorUpdate+"."+config.buildNumber +//noinspection GroovyUnusedAssignment group= "com.github.bartimaeusnek.bartworks" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +//noinspection GroovyUnusedAssignment archivesBaseName = "bartworks"+ "[" + config.mc_version + "]" minecraft { @@ -171,6 +176,7 @@ processResources jar { exclude ("assets/gregtech/textures/items/materialicons/copy.bat") + exclude ("assets/gregtech/textures/blocks/materialicons/copy.bat") manifest { attributes 'FMLCorePlugin': 'com.github.bartimaeusnek.ASM.BWCorePlugin','FMLCorePluginContainsFMLMod': 'true' } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java index 8918c09901..82f0cc02dc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java @@ -23,24 +23,46 @@ package com.github.bartimaeusnek.bartworks.client.textures; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; import java.util.Arrays; import java.util.HashMap; import java.util.Map; +import java.util.stream.Stream; @SideOnly(Side.CLIENT) public class PrefixTextureLinker implements Runnable { public static Map> texMap = new HashMap<>(); + public static Map> texMapBlocks = new HashMap<>(); public static Map blockTexMap = new HashMap<>(); private static void fillBlockTexMap() { blockTexMap.put(TextureSet.SET_QUARTZ, TextureSet.INDEX_block4); + Stream.of(WerkstoffLoader.blockCasing, WerkstoffLoader.blockCasingAdvanced).forEach( + prefixes -> { + HashMap curr = new HashMap<>(); + Arrays.stream(TextureSet.class.getFields()) + .filter(field -> field.getName().contains("SET")) + .forEach(SET -> { + try { + curr.put((TextureSet) SET.get(null), + new Textures.BlockIcons.CustomIcon( + "materialicons/" + SET.getName().substring(4) + "/" + prefixes) + ); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + }); + texMapBlocks.put(prefixes, curr); + } + ); } private static void fillItemTexMap() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java new file mode 100644 index 0000000000..a1738fca46 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -0,0 +1,99 @@ +package com.github.bartimaeusnek.bartworks.system.material; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_LanguageManager; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +import java.util.List; +import java.util.Optional; + +public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks { + + public BW_MetaGeneratedBlocks_Casing(Material p_i45386_1_, Class tileEntity, String blockName, OrePrefixes prefixes) { + super(p_i45386_1_, tileEntity, blockName, prefixes); + } + + @Override + public String getHarvestTool(int aMeta) { + return "wrench"; + } + + @Override + public int getHarvestLevel(int aMeta) { + return 2; + } + + @Override + public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { + return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ); + } + + @Override + public float getExplosionResistance(Entity aTNT) { + return Blocks.iron_block.getExplosionResistance(aTNT); + } + + @Override + protected boolean canSilkHarvest() { + return false; + } + + @Override + public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { + if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + } + + @Override + public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { + if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + } + + @Override + protected void doRegistrationStuff(Werkstoff tMaterial) { + GregTech_API.registerMachineBlock(this, -1); + Optional.ofNullable(tMaterial) + .filter(pMaterial -> pMaterial.hasItemType(OrePrefixes.plate) && pMaterial.hasItemType(OrePrefixes.screw) && pMaterial.hasItemType(OrePrefixes.plateDouble) ) + .ifPresent(pMaterial -> + GT_LanguageManager.addStringLocalization( + this.getUnlocalizedName() + "." + pMaterial.getmID() + ".name", + _prefixes.mLocalizedMaterialPre + pMaterial.getDefaultName() + _prefixes.mLocalizedMaterialPost + ) + ); + } + + @Override + public String getUnlocalizedName() { + if (_prefixes == WerkstoffLoader.blockCasing) + return "bw.werkstoffblockscasing.01"; + else if (_prefixes == WerkstoffLoader.blockCasingAdvanced) + return "bw.werkstoffblockscasingadvanced.01"; + return ""; + } + + @Override + @SuppressWarnings("unchecked") + public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { + Werkstoff.werkstoffHashSet.stream() + .filter(pMaterial -> + pMaterial != null + && ( + pMaterial.hasItemType(OrePrefixes.plate) && pMaterial.hasItemType(OrePrefixes.screw) && pMaterial.hasItemType(OrePrefixes.plateDouble) + ) + ) + .map(pMaterial -> new ItemStack(aItem, 1, pMaterial.getmID())) + .forEach(aList::add); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java new file mode 100644 index 0000000000..4234355124 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java @@ -0,0 +1,37 @@ +package com.github.bartimaeusnek.bartworks.system.material; + +import com.github.bartimaeusnek.bartworks.API.SideReference; +import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TextureSet; +import gregtech.api.interfaces.ITexture; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; + +public class BW_MetaGeneratedBlocks_CasingAdvanced_TE extends BW_MetaGenerated_Block_TE { + + @Override + protected Block GetProperBlock() { + return WerkstoffLoader.BWBlockCasingsAdvanced; + } + + @Override + public ITexture[] getTexture(Block aBlock, byte aSide) { + if (SideReference.Side.Client) { + Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); + if ((aMaterial != null)) { + TextureSet set = aMaterial.getTexSet(); + GT_RenderedTexture aIconSet = new GT_RenderedTexture( + PrefixTextureLinker.texMapBlocks + .get(WerkstoffLoader.blockCasingAdvanced) + .getOrDefault(set, TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]), + aMaterial.getRGBA() + ); + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), aIconSet}; + } + } + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java new file mode 100644 index 0000000000..b14f30f120 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java @@ -0,0 +1,37 @@ +package com.github.bartimaeusnek.bartworks.system.material; + +import com.github.bartimaeusnek.bartworks.API.SideReference; +import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TextureSet; +import gregtech.api.interfaces.ITexture; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; + +public class BW_MetaGeneratedBlocks_Casing_TE extends BW_MetaGenerated_Block_TE { + + @Override + protected Block GetProperBlock() { + return WerkstoffLoader.BWBlockCasings; + } + + @Override + public ITexture[] getTexture(Block aBlock, byte aSide) { + if (SideReference.Side.Client) { + Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); + if ((aMaterial != null)) { + TextureSet set = aMaterial.getTexSet(); + GT_RenderedTexture aIconSet = new GT_RenderedTexture( + PrefixTextureLinker.texMapBlocks + .get(WerkstoffLoader.blockCasing) + .getOrDefault(set, TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]), + aMaterial.getRGBA() + ); + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), aIconSet}; + } + } + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java index 154efe029a..1dbe218c09 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.OrePrefixes; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; @@ -40,14 +41,19 @@ import static com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerate public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { public static ThreadLocal mTemporaryTileEntity = new ThreadLocal<>(); + protected OrePrefixes _prefixes; public BW_MetaGenerated_Blocks(Material p_i45386_1_, Class tileEntity, String blockName) { - super(p_i45386_1_, tileEntity, blockName); + this(p_i45386_1_, tileEntity, blockName, null); + } + public BW_MetaGenerated_Blocks(Material p_i45386_1_, Class tileEntity, String blockName, OrePrefixes types) { + super(p_i45386_1_, tileEntity, blockName); this.setHardness(5.0F); this.setResistance(5.0F); this.setBlockTextureName("stone"); this.setCreativeTab(metaTab); + _prefixes = types; Werkstoff.werkstoffHashSet.forEach(this::doRegistrationStuff); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index c72632bf3e..bf744178d9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -508,15 +508,18 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rotor, 0b100000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.wireFine, 0b100000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateDouble, 0b1000000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateTriple, 0b1000000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateQuadruple, 0b1000000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateQuintuple, 0b1000000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateDense, 0b1000000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotDouble, 0b1000000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotTriple, 0b1000000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuadruple, 0b1000000000); - Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuintuple, 0b1000000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateDouble, 0x200); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateTriple, 0x200); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateQuadruple, 0x200); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateQuintuple, 0x200); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plateDense, 0x200); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotDouble, 0x200); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotTriple, 0x200); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuadruple, 0x200); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuintuple, 0x200); + + Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.blockCasing, 0x380); + Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.blockCasingAdvanced, 0x380); } public void setExtension() { @@ -672,18 +675,23 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } + public Werkstoff.GenerationFeatures addCasings() { + this.toGenerate = (long) (this.toGenerate | 0x380); + return this; + } + @Deprecated public boolean hasSimpleMetalWorkingItems() { return (this.toGenerate & 0b10000000) != 0; } public Werkstoff.GenerationFeatures addCraftingMetalWorkingItems() { - this.toGenerate = (long) (this.toGenerate | 0b100000000); + this.toGenerate = (long) (this.toGenerate | 0x100); return this; } public Werkstoff.GenerationFeatures addMultipleIngotMetalWorkingItems() { - this.toGenerate = (long) (this.toGenerate | 0b1000000000); + this.toGenerate = (long) (this.toGenerate | 0x200); return this; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index c80c50cce9..6065c78a5a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -90,6 +90,8 @@ public class WerkstoffLoader { public static final SubTag NO_BLAST = SubTag.getNewSubTag("NoBlast"); public static OrePrefixes cellMolten; public static OrePrefixes capsuleMolten; + public static OrePrefixes blockCasing; + public static OrePrefixes blockCasingAdvanced; public static ItemList rotorMold; public static ItemList rotorShape; public static ItemList smallGearShape; @@ -144,7 +146,40 @@ public class WerkstoffLoader { //add tiberium Element t = EnumUtils.createNewElement("Tr", 123L, 203L, 0L, -1L, null, "Tiberium", false); - + blockCasing = EnumUtils.addNewOrePrefix("blockCasing", + "A Casing block for a Multiblock-Machine", + "", " Casing", + true, + true, + true, + true, + false, + true, + false, + true, + false, + false, + 0, + 32659200L, + 64, + -1); + blockCasingAdvanced = EnumUtils.addNewOrePrefix("blockCasingAdvanced", + "An Advanced Casing block for a Multiblock-Machine", + "Advanced ", " Casing", + true, + true, + true, + true, + false, + true, + false, + true, + false, + false, + 0, + 32659200L, + 64, + -1); //add molten & regular capsuls if (LoaderReference.Forestry) { capsuleMolten = EnumUtils.addNewOrePrefix( @@ -1378,6 +1413,8 @@ public class WerkstoffLoader { public static Block BWOres; public static Block BWSmallOres; public static Block BWBlocks; + public static Block BWBlockCasings; + public static Block BWBlockCasingsAdvanced; public static boolean registered; public static final HashSet ENABLED_ORE_PREFIXES = new HashSet<>(); @@ -1407,6 +1444,10 @@ public class WerkstoffLoader { return new ItemStack(WerkstoffLoader.BWSmallOres, amount, werkstoff.getmID()); else if (orePrefixes == block) return new ItemStack(WerkstoffLoader.BWBlocks, amount, werkstoff.getmID()); + else if (orePrefixes == WerkstoffLoader.blockCasing) + return new ItemStack(WerkstoffLoader.BWBlockCasings, amount, werkstoff.getmID()); + else if (orePrefixes == WerkstoffLoader.blockCasingAdvanced) + return new ItemStack(WerkstoffLoader.BWBlockCasingsAdvanced, amount, werkstoff.getmID()); else if (WerkstoffLoader.items.get(orePrefixes) == null) return null; return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); @@ -1478,6 +1519,8 @@ public class WerkstoffLoader { addBlockRecipes(werkstoff); DebugLog.log("Loading Tool Recipes" + " " + (System.nanoTime() - timepreone)); addTools(werkstoff); + DebugLog.log("Loading Casing Recipes" + " " + (System.nanoTime() - timepreone)); + addCasingRecipes(werkstoff); if (LoaderReference.Thaumcraft) { DebugLog.log("Loading Aspects" + " " + (System.nanoTime() - timepreone)); addAspectToAll(werkstoff); @@ -1678,15 +1721,25 @@ public class WerkstoffLoader { static void gameRegistryHandler() { if (SideReference.Side.Client) RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); + GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); GameRegistry.registerTileEntity(BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmallTE"); GameRegistry.registerTileEntity(BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblockTE"); + GameRegistry.registerTileEntity(BW_MetaGeneratedBlocks_Casing_TE.class, "bw.werkstoffblockcasingTE"); + GameRegistry.registerTileEntity(BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, "bw.werkstoffblockscasingadvancedTE"); + WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); WerkstoffLoader.BWSmallOres = new BW_MetaGenerated_SmallOres(Material.rock, BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmall"); WerkstoffLoader.BWBlocks = new BW_MetaGenerated_WerkstoffBlocks(Material.iron, BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblocks"); + WerkstoffLoader.BWBlockCasings = new BW_MetaGeneratedBlocks_Casing(Material.iron, BW_MetaGeneratedBlocks_Casing_TE.class, "bw.werkstoffblockscasing", blockCasing); + WerkstoffLoader.BWBlockCasingsAdvanced = new BW_MetaGeneratedBlocks_Casing(Material.iron, BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, "bw.werkstoffblockscasingadvanced", blockCasingAdvanced); + GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.01"); GameRegistry.registerBlock(WerkstoffLoader.BWSmallOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.02"); GameRegistry.registerBlock(WerkstoffLoader.BWBlocks, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblocks.01"); + GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasings, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasing.01"); + GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasingsAdvanced, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasingadvanced.01"); + GTMetaItemEnhancer.init(); } @@ -1770,6 +1823,53 @@ public class WerkstoffLoader { } addAssociationToItems(); addFakeItemDataToInWorldBlocksAndCleanUpFakeData(); + addCasingsToGTOreDictUnificator(); + } + + public static void addCasingsToGTOreDictUnificator(){ + Werkstoff.werkstoffHashSet.forEach(werkstoff -> { + GT_OreDictUnificator.addAssociation( + blockCasing, werkstoff.getBridgeMaterial(), + new ItemStack(WerkstoffLoader.BWBlockCasings, 1, werkstoff.getmID()), + false + ); + GT_OreDictUnificator.addAssociation( + blockCasingAdvanced, werkstoff.getBridgeMaterial(), + new ItemStack(WerkstoffLoader.BWBlockCasingsAdvanced, 1, werkstoff.getmID()), + false + ); + } + ); + GT_OreDictUnificator.addAssociation( + blockCasing, Materials.Aluminium, + ItemList.Casing_FrostProof.get(1L), + false + ); + GT_OreDictUnificator.addAssociation( + blockCasing, Materials.Nickel, + ItemList.Casing_HeatProof.get(1L), + false + ); + GT_OreDictUnificator.addAssociation( + blockCasing, Materials.Lead, + ItemList.Casing_RadiationProof.get(1L), + false + ); + GT_OreDictUnificator.addAssociation( + blockCasing, Materials.Steel, + ItemList.Casing_SolidSteel.get(1L), + false + ); + GT_OreDictUnificator.addAssociation( + blockCasing, Materials.TungstenSteel, + ItemList.Casing_RobustTungstenSteel.get(1L), + false + ); + GT_OreDictUnificator.addAssociation( + blockCasing, Materials.Polytetrafluoroethylene, + ItemList.Casing_Chemically_Inert.get(1L), + false + ); } public static void addAssociationToItems() { @@ -1944,6 +2044,39 @@ public class WerkstoffLoader { GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite)); } + private static void addCasingRecipes(Werkstoff werkstoff) { + if (!(werkstoff.hasItemType(blockCasing) && werkstoff.hasItemType(plate) && werkstoff.hasItemType(screw) && werkstoff.hasItemType(gearGt) )) + return; + + GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasing),new Object[]{ + "PSP", + "PGP", + "PSP", + 'P', werkstoff.get(plate), + 'S', werkstoff.get(screw), + 'G', werkstoff.get(gearGtSmall) + }); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + werkstoff.get(plate,6), + werkstoff.get(screw,2), + werkstoff.get(gearGtSmall) + }, GT_Values.NF,werkstoff.get(blockCasing), 200, 30); + + GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasingAdvanced),new Object[]{ + "PSP", + "PGP", + "PSP", + 'P', werkstoff.get(plateDouble), + 'S', werkstoff.get(screw), + 'G', werkstoff.get(gearGt) + }); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + werkstoff.get(plateDouble,6), + werkstoff.get(screw,2), + werkstoff.get(gearGt) + }, GT_Values.NF,werkstoff.get(blockCasingAdvanced), 200, 30); + } + private static void addGemRecipes(Werkstoff werkstoff) { if (werkstoff.hasItemType(gem)) { if (werkstoff.getGenerationFeatures().hasSifterRecipes() || (werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust))) { diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/copy.bat b/src/main/resources/assets/gregtech/textures/blocks/materialicons/copy.bat new file mode 100644 index 0000000000..9713953aac --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/materialicons/copy.bat @@ -0,0 +1 @@ +for /r /d %%I in (*) do xcopy %1 "%%~fsI" /H /K /Y \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DIAMOND/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/DULL/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/EMERALD/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FIERY/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FINE/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLINT/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/FLUID/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_HORIZONTAL/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GEM_VERTICAL/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/GLASS/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LAPIS/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LEAF/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/LIGNITE/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/MAGNETIC/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/METALLIC/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NETHERSTAR/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/NONE/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/OPAL/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/PAPER/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/POWDER/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/QUARTZ/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/ROUGH/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/RUBY/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SAND/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHARDS/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/SHINY/blockCasing_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/blockCasing.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/blockCasing.png new file mode 100644 index 0000000000..cd6a50eca3 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/blockCasingAdvanced.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/blockCasingAdvanced.png new file mode 100644 index 0000000000..5fea5be598 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/blockCasingAdvanced.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/blockCasingAdvanced_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/blockCasingAdvanced_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/blockCasingAdvanced_OVERLAY.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/blockCasing_OVERLAY.png b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/blockCasing_OVERLAY.png new file mode 100644 index 0000000000..2b0422489e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/materialicons/WOOD/blockCasing_OVERLAY.png differ -- cgit From db6b2eb7f7f9edd81475fa3e5d7300a132f30cb3 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 23 Jun 2020 17:59:27 +0200 Subject: Added Special interface Former-commit-id: e6f272bb86db65738e4649716b6cbd55e898f334 --- libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id | 1 - .../system/material/BW_MetaGeneratedBlocks_Casing.java | 13 ++++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) delete mode 100644 libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id diff --git a/libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id b/libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id deleted file mode 100644 index 44e06955ea..0000000000 --- a/libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -cf867aabae89a4c11d9452678ee405ba22103922 \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java index a1738fca46..a688664efd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -1,5 +1,6 @@ package com.github.bartimaeusnek.bartworks.system.material; +import com.github.technus.tectech.mechanics.structure.ICustomMetaBlock; import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; @@ -16,7 +17,8 @@ import net.minecraft.world.World; import java.util.List; import java.util.Optional; -public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks { +@cpw.mods.fml.common.Optional.Interface(modid = "tectech", striprefs = true, iface = "com.github.technus.tectech.mechanics.structure.ICustomMetaBlock") +public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks implements ICustomMetaBlock { public BW_MetaGeneratedBlocks_Casing(Material p_i45386_1_, Class tileEntity, String blockName, OrePrefixes prefixes) { super(p_i45386_1_, tileEntity, blockName, prefixes); @@ -96,4 +98,13 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks { .map(pMaterial -> new ItemStack(aItem, 1, pMaterial.getmID())) .forEach(aList::add); } + + @cpw.mods.fml.common.Optional.Method(modid = "tectech") + public void setBlock(World world, int x, int y, int z, int meta) { + world.setBlock(x, y, z,this, meta,2); + Optional.ofNullable(world.getTileEntity(x,y,z)) + .filter(te -> te instanceof BW_MetaGeneratedBlocks_Casing_TE) + .map(te -> (BW_MetaGeneratedBlocks_Casing_TE) te) + .ifPresent(te -> te.mMetaData = (short) meta); + } } -- cgit From 5becd672c34d536807e4509ee1e598c7ff2b8d79 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 23 Jun 2020 18:19:44 +0200 Subject: added TT lib Former-commit-id: debc3f54ae9387c2088355b05ca319a902dd46b1 --- libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id | 1 + 1 file changed, 1 insertion(+) create mode 100644 libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id diff --git a/libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id b/libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id new file mode 100644 index 0000000000..b280989ef6 --- /dev/null +++ b/libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id @@ -0,0 +1 @@ +56ea637c442d397b87ecdaaac1be3c63f335c9e0 \ No newline at end of file -- cgit From 28513f596db0ee7252980287c1a0f722a705d36f Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Sat, 25 Jul 2020 19:44:38 +0200 Subject: fix(Bartworks)recipes fixing two recipes Formic Acid Creates Sodium/Sulfur Positive Loop #6437 https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/6437 Former-commit-id: d307fb60847af5b5506e0764ca0aacdb8a643f5a --- .../system/material/GT_Enhancement/PlatinumSludgeOverHaul.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 3a290b7777..3248c57dc7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -81,8 +81,8 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(3), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Water.getFluid(1000), Materials.DilutedSulfuricAcid.getFluid(4000), Materials.Empty.getCells(3), 30, 30); //FormicAcid GT_Values.RA.addChemicalRecipe(Materials.CarbonMonoxide.getCells(1), Materials.SodiumHydroxide.getDust(1), null, null, Sodiumformate.get(cell), null, 15); - GT_Values.RA.addChemicalRecipe(Sodiumformate.get(cell, 2), GT_Utility.getIntegratedCircuit(1), Materials.SulfuricAcid.getFluid(1000), null, FormicAcid.get(cell, 2), Sodiumsulfate.get(dust, 7), 15); - GT_Values.RA.addChemicalRecipe(Materials.SulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Sodiumformate.getFluidOrGas(2000), FormicAcid.getFluidOrGas(2000), Materials.Empty.getCells(1), Sodiumsulfate.get(dust, 7), 15); + GT_Values.RA.addChemicalRecipe(Sodiumformate.get(cell, 2), GT_Utility.getIntegratedCircuit(1), Materials.SulfuricAcid.getFluid(1000), null, FormicAcid.get(cell, 2), Sodiumsulfate.get(dust, 1), 15); + GT_Values.RA.addChemicalRecipe(Materials.SulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Sodiumformate.getFluidOrGas(2000), FormicAcid.getFluidOrGas(2000), Materials.Empty.getCells(1), Sodiumsulfate.get(dust, 1), 15); //AquaRegia GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, AquaRegia.get(cell, 2), 30, 30); GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(2), null, null, AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(2), 30, 30); @@ -144,7 +144,7 @@ public class PlatinumSludgeOverHaul { }, 600, 30); GT_Values.RA.addChemicalRecipeForBasicMachineOnly(PDRawPowder.get(dust, 2), Materials.Empty.getCells(1), FormicAcid.getFluidOrGas(4000), Materials.Ammonia.getGas(2000), Materials.Palladium.getDust(2), Materials.Ethylene.getCells(1), 250, 30); GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{PDRawPowder.get(dust, 2)}, new FluidStack[]{FormicAcid.getFluidOrGas(4000)}, new FluidStack[]{Materials.Ammonia.getGas(2000), Materials.Ethylene.getGas(1000), Materials.Water.getFluid(1000)}, new ItemStack[]{Materials.Palladium.getDust(2)}, 250, 30); - GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust, 2), Materials.Hydrogen.getCells(1), null, Materials.SulfuricAcid.getFluid(2000), Materials.Sodium.getDust(1), Materials.Empty.getCells(1), 30); + GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust, 1), Materials.Hydrogen.getCells(2), null, Materials.SulfuricAcid.getFluid(1000), Materials.Sodium.getDust(2), Materials.Empty.getCells(2), 30); //K2S2O7 // GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust,6), null, 30); //Rh/Os/Ir/Ru -- cgit From 18e2960ea363a8b947e93fc3eb54fe6eb6a1d731 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 9 Sep 2020 21:34:08 +0200 Subject: Renamed Casings + added GT++ warning + updated TT + fixed forestry capsules + fixed eic Former-commit-id: 319fc8b86aaf8d6c07954f0f3b56119c10f10cb3 --- libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id | 1 - ...ecTech-1.7.10-4.8.3-4eb40295.jar.REMOVED.git-id | 1 + libs/gregtech-5.09.33.52-dev.jar.REMOVED.git-id | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 22 ++++- .../GT_TileEntity_ElectricImplosionCompressor.java | 11 ++- .../material/BW_MetaGeneratedBlocks_Casing.java | 21 ++--- .../material/GT_Enhancement/BWGTMetaItems.java | 22 ++++- .../GT_Enhancement/GTMetaItemEnhancer.java | 97 ++++++++++++++-------- .../bartworks/system/material/Werkstoff.java | 36 ++++++++ .../bartworks/system/material/WerkstoffLoader.java | 7 +- 10 files changed, 154 insertions(+), 66 deletions(-) delete mode 100644 libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id create mode 100644 libs/TecTech-1.7.10-4.8.3-4eb40295.jar.REMOVED.git-id diff --git a/libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id b/libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id deleted file mode 100644 index b280989ef6..0000000000 --- a/libs/TecTech-1.7.10-3.8.3.jar.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -56ea637c442d397b87ecdaaac1be3c63f335c9e0 \ No newline at end of file diff --git a/libs/TecTech-1.7.10-4.8.3-4eb40295.jar.REMOVED.git-id b/libs/TecTech-1.7.10-4.8.3-4eb40295.jar.REMOVED.git-id new file mode 100644 index 0000000000..6a3cc6b00a --- /dev/null +++ b/libs/TecTech-1.7.10-4.8.3-4eb40295.jar.REMOVED.git-id @@ -0,0 +1 @@ +c13aa64170017f7dcbb833974f75d7a99d14ae80 \ No newline at end of file diff --git a/libs/gregtech-5.09.33.52-dev.jar.REMOVED.git-id b/libs/gregtech-5.09.33.52-dev.jar.REMOVED.git-id index f92d3052a9..700ca28882 100644 --- a/libs/gregtech-5.09.33.52-dev.jar.REMOVED.git-id +++ b/libs/gregtech-5.09.33.52-dev.jar.REMOVED.git-id @@ -1 +1 @@ -099d4e2e397a3d24c7339102cf3908403f33ab3d \ No newline at end of file +14c31c860e0a098cc07a306c5a01997664b0604f \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index e2ad0b6416..6ba2dec96d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -47,6 +47,8 @@ import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -63,7 +65,7 @@ import static com.github.bartimaeusnek.bartworks.common.loaders.BioRecipeLoader. import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.removeIC2Recipes; import static gregtech.api.enums.GT_Values.VN; -@SuppressWarnings("unused") +@SuppressWarnings("ALL") @Mod( modid = MainMod.MOD_ID, name = MainMod.NAME, version = MainMod.VERSION, dependencies = "required-after:IC2; " @@ -89,8 +91,15 @@ public final class MainMod { public static MainMod instance; public static BW_Network BW_Network_instance = new BW_Network(); + @SideOnly(Side.CLIENT) + private void ClientGTppWarning() { + javax.swing.JOptionPane.showMessageDialog(null, + "BartWorks was NOT meant to be played with GT++," + + " since GT++'s Multiblocks break the Platinum Processing chain. " + + "Feel free to continue, but be aware of this.","GT++ Warning", javax.swing.JOptionPane.ERROR_MESSAGE); + } + @Mod.EventHandler - @SuppressWarnings("ALL") public void preInit(FMLPreInitializationEvent preinit) { if (!(API_REFERENCE.VERSION.equals(MainMod.APIVERSION))) { @@ -99,6 +108,15 @@ public final class MainMod { LoaderReference.init(); //Check for ALL the mods. + if (LoaderReference.miscutils) { + if (SideReference.Side.Client) + ClientGTppWarning(); + + MainMod.LOGGER.error("BartWorks was NOT meant to be played with GT++," + + " since GT++'s Multiblocks break the Platinum Processing chain. " + + "Feel free to continue, but be aware of this."); + } + if (LoaderReference.miscutils && ConfigHandler.GTppLogDisabler) { STFUGTPPLOG.replaceLogger(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 8eac4a7f09..0502a4a82e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -43,7 +43,7 @@ import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity_ImplosionCompressor { public static GT_Recipe.GT_Recipe_Map eicMap; - private boolean piston; + private Boolean piston = null; public GT_TileEntity_ElectricImplosionCompressor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -109,7 +109,8 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { - this.piston = true; + if (this.piston == null) + this.piston = true; } private void resetPiston() { @@ -148,8 +149,6 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } } } - GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); - this.piston = !this.piston; } else { for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { @@ -157,9 +156,9 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity this.getBaseMetaTileEntity().getWorld().setBlock(xDir + aX + x, aY + 2, zDir + aZ + z, GregTech_API.sBlockMetal5, 2, 3); } } - GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); - this.piston = !this.piston; } + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + this.piston = !this.piston; if (hax) this.explodeMultiblock(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java index a688664efd..c1fa1fbc85 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -1,6 +1,6 @@ package com.github.bartimaeusnek.bartworks.system.material; -import com.github.technus.tectech.mechanics.structure.ICustomMetaBlock; +import com.github.technus.tectech.mechanics.structure.ICustomBlockSetting; import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; @@ -17,8 +17,8 @@ import net.minecraft.world.World; import java.util.List; import java.util.Optional; -@cpw.mods.fml.common.Optional.Interface(modid = "tectech", striprefs = true, iface = "com.github.technus.tectech.mechanics.structure.ICustomMetaBlock") -public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks implements ICustomMetaBlock { +@cpw.mods.fml.common.Optional.Interface(modid = "tectech", striprefs = true, iface = "com.github.technus.tectech.mechanics.structure.ICustomBlockSetting") +public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks implements ICustomBlockSetting { public BW_MetaGeneratedBlocks_Casing(Material p_i45386_1_, Class tileEntity, String blockName, OrePrefixes prefixes) { super(p_i45386_1_, tileEntity, blockName, prefixes); @@ -51,16 +51,12 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple @Override public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { - if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { - GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); - } + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } @Override public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { - if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { - GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); - } + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } @Override @@ -89,12 +85,7 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple @SuppressWarnings("unchecked") public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { Werkstoff.werkstoffHashSet.stream() - .filter(pMaterial -> - pMaterial != null - && ( - pMaterial.hasItemType(OrePrefixes.plate) && pMaterial.hasItemType(OrePrefixes.screw) && pMaterial.hasItemType(OrePrefixes.plateDouble) - ) - ) + .filter(pMaterial -> (pMaterial.hasItemType(WerkstoffLoader.blockCasing))) .map(pMaterial -> new ItemStack(aItem, 1, pMaterial.getmID())) .forEach(aList::add); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java index d9d4ac7dbe..8838d9dc3d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -40,14 +40,18 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; +import java.util.HashSet; import java.util.List; +import java.util.Set; import static com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.GTMetaItemEnhancer.NoMetaValue; public class BWGTMetaItems extends BW_MetaGenerated_Items { private boolean hasList; + private final Set hiddenThings = new HashSet<>(); public BWGTMetaItems(OrePrefixes orePrefixes, List noSubIDMaterials) { super(orePrefixes,null); @@ -60,10 +64,16 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) continue materialloop; + if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""))){ + hiddenThings.add(i); + continue; + } + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", getDefaultLocalization(w)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); - GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); + GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); } + if (noSubIDMaterials != null){ hasList = true; materialloop: @@ -75,9 +85,13 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) continue materialloop; + if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""))){ + hiddenThings.add(i); + continue; + } GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", getDefaultLocalization(w)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); - GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); + GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); } } } @@ -116,6 +130,8 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { continue; else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; + else if (hiddenThings.contains(i)) + continue; aList.add(new ItemStack(this, 1, i)); } if (hasList) @@ -125,6 +141,8 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { continue; else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; + else if (hiddenThings.contains(i)) + continue; aList.add(new ItemStack(this, 1, i + 1001)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java index fe66b74c40..75a2846172 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -23,7 +23,6 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; import com.github.bartimaeusnek.bartworks.API.LoaderReference; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -36,6 +35,7 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; import java.util.List; import java.util.stream.Collectors; @@ -52,48 +52,53 @@ public class GTMetaItemEnhancer { Materials[] values = Materials.values(); for (int i = 0, valuesLength = values.length; i < valuesLength; i++) { Materials m = values[i]; - if (m != null && m.mStandardMoltenFluid != null) { - final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(m.getMolten(144), new ItemStack(moltenCell, 1, i), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L)); - FluidContainerRegistry.registerFluidContainer(emptyData); - GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), new ItemStack(moltenCell, 1, i), m.getMolten(144), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(new ItemStack(moltenCell, 1, i), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), GT_Values.NF, m.getMolten(144)); - } + if (m == null || m.mStandardMoltenFluid == null) + continue; + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(m.getMolten(144), new ItemStack(moltenCell, 1, i), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L)); + FluidContainerRegistry.registerFluidContainer(emptyData); + GT_Utility.addFluidContainerData(emptyData); + GT_Values.RA.addFluidCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), new ItemStack(moltenCell, 1, i), m.getMolten(144), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(new ItemStack(moltenCell, 1, i), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), GT_Values.NF, m.getMolten(144)); } } - if (LoaderReference.Forestry) { - NoMetaValue = Materials.getMaterialsMap().values().stream().filter(m -> m.mMetaItemSubID == -1).collect(Collectors.toList()); - Item moltenCapsuls = new BWGTMetaItems(WerkstoffLoader.capsuleMolten, null); - Item capsuls = new BWGTMetaItems(OrePrefixes.capsule, NoMetaValue); - //Item bottles = new BWGTMetaItems(OrePrefixes.bottle, NoMetaValue); + if (!LoaderReference.Forestry) { + return; + } + NoMetaValue = Materials.getMaterialsMap().values().stream().filter(m -> m.mMetaItemSubID == -1).collect(Collectors.toList()); + Item moltenCapsuls = new BWGTMetaItems(WerkstoffLoader.capsuleMolten, null); + Item capsuls = new BWGTMetaItems(OrePrefixes.capsule, NoMetaValue); + //Item bottles = new BWGTMetaItems(OrePrefixes.bottle, NoMetaValue); - Materials[] values = Materials.values(); - for (int i = 0, valuesLength = values.length; i < valuesLength; i++) { - Materials m = values[i]; - if (m.mStandardMoltenFluid != null && GT_OreDictUnificator.get(WerkstoffLoader.cellMolten, m, 1) != null) { - final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(m.getMolten(144), new ItemStack(moltenCapsuls, 1, i), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); - FluidContainerRegistry.registerFluidContainer(emptyData); - GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe(GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1), new ItemStack(moltenCapsuls, 1, i), m.getMolten(144), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(new ItemStack(moltenCapsuls, 1, i), GT_Values.NI, GT_Values.NF, m.getMolten(144)); - } - if (m.getFluid(1) != null || m.getGas(1) != null) { - addFluidData(m,GT_ModHandler.getModItem("Forestry", "waxCapsule", 1),capsuls,1000,i,true); - // addFluidData(m,new ItemStack(Items.glass_bottle),bottles,250,i,false); - } - } - for (int i = 0, valuesLength = NoMetaValue.size(); i < valuesLength; i++) { - Materials m = NoMetaValue.get(i); - if (m.getFluid(1) != null || m.getGas(1) != null) { - addFluidData(m,GT_ModHandler.getModItem("Forestry", "waxCapsule", 1),capsuls,1000,i + 1001,true); - // addFluidData(m,new ItemStack(Items.glass_bottle),bottles,250,i + 1001,false); - } + Materials[] values = Materials.values(); + for (int i = 0, valuesLength = values.length; i < valuesLength; i++) { + Materials m = values[i]; + if (m.mStandardMoltenFluid != null && GT_OreDictUnificator.get(WerkstoffLoader.cellMolten, m, 1) != null) { + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(m.getMolten(144), new ItemStack(moltenCapsuls, 1, i), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + FluidContainerRegistry.registerFluidContainer(emptyData); + GT_Utility.addFluidContainerData(emptyData); + GT_Values.RA.addFluidCannerRecipe(GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1), new ItemStack(moltenCapsuls, 1, i), m.getMolten(144), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(new ItemStack(moltenCapsuls, 1, i), GT_Values.NI, GT_Values.NF, m.getMolten(144)); } - + if (m.getFluid(1) == null && m.getGas(1) == null) + continue; + if (OreDictionary.doesOreNameExist("capsule"+m.mName)) + continue; + addFluidData(m, GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), capsuls, 1000, i, true); + // addFluidData(m, new ItemStack(Items.glass_bottle), bottles, 250, i, false); } + for (int i = 0, valuesLength = NoMetaValue.size(); i < valuesLength; i++) { + Materials m = NoMetaValue.get(i); + if (m.getFluid(1) == null && m.getGas(1) == null) + continue; + if (OreDictionary.doesOreNameExist("capsule"+m.mName)) + continue; + addFluidData(m, GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), capsuls, 1000, i + 1001, true); + // addFluidData(m, new ItemStack(Items.glass_bottle), bottles, 250, i + 1001, false); + } + } - private static void addFluidData(Materials m, ItemStack container, Item filled,int amount, int it, boolean empty){ + private static void addFluidData(Materials m, ItemStack container, Item filled, int amount, int it, boolean empty){ Fluid f = m.getFluid(1) != null ? m.getFluid(1).getFluid() : m.getGas(1).getFluid(); final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(f, amount), new ItemStack(filled, 1, it), container); FluidContainerRegistry.registerFluidContainer(emptyData); @@ -102,4 +107,24 @@ public class GTMetaItemEnhancer { GT_Values.RA.addFluidCannerRecipe(new ItemStack(filled, 1, it), empty ? GT_Values.NI : container, GT_Values.NF, new FluidStack(f, amount)); } + public static void addAdditionalOreDictToForestry(){ + if (!LoaderReference.Forestry) + return; + OreDictionary.registerOre("capsuleWater", getForestryItem("waxCapsuleWater")); + OreDictionary.registerOre("capsuleIce", getForestryItem("waxCapsuleIce")); + OreDictionary.registerOre("capsuleHoney", getForestryItem("waxCapsuleHoney")); + OreDictionary.registerOre("capsuleJuice", getForestryItem("waxCapsuleJuice")); + OreDictionary.registerOre("capsuleSeedOil", getForestryItem("waxCapsuleSeedOil")); + OreDictionary.registerOre("capsuleEthanol", getForestryItem("waxCapsuleEthanol")); + OreDictionary.registerOre("capsuleBiomass", getForestryItem("waxCapsuleBiomass")); + OreDictionary.registerOre("capsuleShortMead", getForestryItem("waxCapsuleShortMead")); + OreDictionary.registerOre("capsuleMead", getForestryItem("waxCapsuleMead")); + OreDictionary.registerOre("capsuleFuel", getForestryItem("waxCapsuleFuel")); + OreDictionary.registerOre("capsuleOil", getForestryItem("waxCapsuleOil")); + OreDictionary.registerOre("capsuleLava", getForestryItem("refractoryLava")); + } + + private static ItemStack getForestryItem(String itemName){ + return GT_ModHandler.getModItem("Forestry", itemName, 1); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index bf744178d9..5c5698afdc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -34,6 +34,7 @@ import net.minecraftforge.fluids.FluidStack; import java.lang.reflect.InvocationTargetException; import java.nio.ByteBuffer; import java.util.*; +import java.util.stream.Collectors; @SuppressWarnings("ALL") public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @@ -75,6 +76,41 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.default_null_Werkstoff = new Werkstoff(new short[3], "_NULL", "Default null Werkstoff", Werkstoff.DEFAULT_NULL_STATS, Werkstoff.Types.UNDEFINED, Werkstoff.DEFAULT_NULL_GENERATION_FEATURES, -1, TextureSet.SET_NONE); } + public Werkstoff(Materials materials, Werkstoff.GenerationFeatures generationFeatures, Types type, int mID){ + this( materials.mRGBa, + materials.getToolTip(), + materials.mDefaultLocalName, + type == null ? materials.mElement != null ? Types.ELEMENT : Types.UNDEFINED : type, + generationFeatures, + mID, + materials.mIconSet, + (List) materials.mOreByProducts, + materials.mMaterialList + .stream() + .map(ml -> new Pair(ml.mMaterial, (int) ml.mAmount)) + .collect(Collectors.toList()) + .>toArray(new Pair[0]) + ); + this.stats.mass = materials.getMass(); + this.stats.protons = materials.getProtons(); + this.stats.meltingPoint = materials.mMeltingPoint; + this.stats.neutrons = materials.getNeutrons(); + this.stats.speedOverride = materials.mToolSpeed; + this.stats.durOverride = materials.mDurability; + this.stats.qualityOverride = materials.mToolQuality; + this.stats.setGas(materials.mHasGas); + this.stats.setRadioactive(materials.isRadioactive()); + this.stats.setBlastFurnace(materials.mBlastFurnaceRequired); + if (type == Types.COMPOUND){ + this.stats.setElektrolysis(type == Types.COMPOUND); + this.generationFeatures.addChemicalRecipes(); + } + else if (type == Types.MIXTURE) { + this.stats.setCentrifuge(type == Types.MIXTURE); + this.generationFeatures.addMixerRecipes(); + } + } + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), type, generationFeatures, mID, texSet, contents); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 6065c78a5a..07bef2bcf1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -78,7 +78,7 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Util.subscriptNumbers; import static com.github.bartimaeusnek.bartworks.util.BW_Util.superscriptNumbers; import static gregtech.api.enums.OrePrefixes.*; -@SuppressWarnings({"unchecked", "unused", "deprecation"}) +@SuppressWarnings({"unchecked", "deprecation"}) public class WerkstoffLoader { private WerkstoffLoader() { } @@ -148,7 +148,7 @@ public class WerkstoffLoader { Element t = EnumUtils.createNewElement("Tr", 123L, 203L, 0L, -1L, null, "Tiberium", false); blockCasing = EnumUtils.addNewOrePrefix("blockCasing", "A Casing block for a Multiblock-Machine", - "", " Casing", + "Bolted ", " Casing", true, true, true, @@ -165,7 +165,7 @@ public class WerkstoffLoader { -1); blockCasingAdvanced = EnumUtils.addNewOrePrefix("blockCasingAdvanced", "An Advanced Casing block for a Multiblock-Machine", - "Advanced ", " Casing", + "Rebolted ", " Casing", true, true, true, @@ -1740,6 +1740,7 @@ public class WerkstoffLoader { GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasings, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasing.01"); GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasingsAdvanced, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasingadvanced.01"); + GTMetaItemEnhancer.addAdditionalOreDictToForestry(); GTMetaItemEnhancer.init(); } -- cgit From 28747be843b6dff2e48c51fc0faaecc12d6f59f4 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 14 Sep 2020 20:11:05 +0200 Subject: Refactor + Updated Copyright + Split WerkstoffLoader into seperate Files + Fixed overclock underflow + Fixed TT debug code + Fixed autogenerated Casings Former-commit-id: 368bc456441b7560127b712cad2304cbf8628670 --- .../com/github/bartimaeusnek/ASM/ASMUtils.java | 2 +- .../bartimaeusnek/ASM/BWCoreTransformer.java | 2 +- .../bartworks/API/BioRecipeAdder.java | 2 +- .../bartimaeusnek/bartworks/API/INoiseGen.java | 2 +- .../bartimaeusnek/bartworks/API/IRadMaterial.java | 2 +- .../bartworks/API/ITileAddsInformation.java | 2 +- .../bartworks/API/ITileDropsContent.java | 2 +- .../API/ITileHasDifferentTextureSides.java | 2 +- .../bartimaeusnek/bartworks/API/ITileWithGUI.java | 2 +- .../client/ClientEventHandler/TooltipCache.java | 2 +- .../ClientEventHandler/TooltipEventHandler.java | 2 +- .../bartworks/client/creativetabs/BioTab.java | 2 +- .../bartworks/client/creativetabs/GT2Tab.java | 2 +- .../client/creativetabs/bartworksTab.java | 2 +- .../gui/BW_GUIContainer_HeatedWaterPump.java | 2 +- .../client/gui/BW_GUIContainer_RadLevel.java | 2 +- .../client/gui/BW_GUIContainer_RotorBlock.java | 2 +- .../gui/GT_GUIContainer_CircuitProgrammer.java | 2 +- .../client/gui/GT_GUIContainer_Destructopack.java | 2 +- .../bartworks/client/gui/GT_GUIContainer_LESU.java | 2 +- .../client/renderer/BW_GT_ItemRenderer.java | 2 +- .../client/renderer/BW_GT_Vanilla_Texture.java | 2 +- .../client/renderer/BW_Renderer_Block_Ores.java | 2 +- .../client/renderer/RendererGlasBlock.java | 2 +- .../renderer/RendererSwitchingColorFluid.java | 2 +- .../blocks/BW_TileEntityContainer_Multiple.java | 2 +- .../bartworks/common/blocks/BioFluidBlock.java | 2 +- .../common/commands/PrintRecipeListToFile.java | 3 +- .../bartworks/common/commands/SummonRuin.java | 2 +- .../bartworks/common/items/BW_ItemBlocks.java | 2 +- .../bartworks/common/items/BW_SimpleWindMeter.java | 2 +- .../bartworks/common/items/BW_Stonage_Rotors.java | 2 +- .../bartworks/common/items/Circuit_Programmer.java | 2 +- .../common/items/GT_Destructopack_Item.java | 2 +- .../bartworks/common/items/GT_Rockcutter_Item.java | 2 +- .../bartworks/common/items/GT_Teslastaff_Item.java | 2 +- .../bartworks/common/items/LabModule.java | 2 +- .../bartworks/common/items/LabParts.java | 2 +- .../bartworks/common/items/SimpleIconItem.java | 2 +- .../bartworks/common/items/SimpleSubItemClass.java | 2 +- .../bartworks/common/net/BW_Network.java | 2 +- .../common/net/CircuitProgrammerPacket.java | 2 +- .../bartworks/common/net/MetaBlockPacket.java | 2 +- .../bartworks/common/net/OreDictCachePacket.java | 2 +- .../bartworks/common/net/ServerJoinedPackage.java | 2 +- .../classic/BWTileEntityDimIDBridge.java | 2 +- .../common/tileentities/classic/BW_RotorBlock.java | 2 +- .../BW_TileEntity_ExperimentalFloodGate.java | 2 +- .../classic/BW_TileEntity_InfinityTank.java | 2 +- .../common/tileentities/debug/CreativeScanner.java | 2 +- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 3 +- .../tileentities/multis/GT_TileEntity_DEHP.java | 2 +- .../GT_TileEntity_ElectricImplosionCompressor.java | 2 +- .../tileentities/multis/GT_TileEntity_LESU.java | 2 +- .../multis/GT_TileEntity_ManualTrafo.java | 3 +- .../mega/GT_TileEntity_MegaProcessingArray.java | 2 +- .../tiered/GT_MetaTileEntity_AcidGenerator.java | 2 +- .../GT_MetaTileEntity_CompressedFluidHatch.java | 2 +- .../tiered/GT_MetaTileEntity_Diode.java | 2 +- .../GT_MetaTileEntity_EnergyDistributor.java | 2 +- .../tiered/GT_MetaTileEntity_GiantOutputHatch.java | 2 +- .../tiered/GT_MetaTileEntity_Transistor.java | 2 +- .../bartworks/neiHandler/BW_NEI_BioLabHandler.java | 2 +- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 2 +- .../bartworks/neiHandler/NEI_BW_Config.java | 2 +- .../container/BW_Container_HeatedWaterPump.java | 2 +- .../server/container/BW_Container_RadioHatch.java | 2 +- .../container/GT_Container_CircuitProgrammer.java | 2 +- .../container/GT_Container_Item_Destructopack.java | 2 +- .../server/container/GT_Container_LESU.java | 2 +- .../server/container/GT_Container_RadioHatch.java | 2 +- .../server/container/Slots/BW_DelSlot.java | 2 +- .../server/container/Slots/BW_FuelSlot.java | 2 +- .../material/BW_MetaGeneratedBlock_Item.java | 2 +- .../material/BW_MetaGeneratedBlocks_Casing.java | 35 +- .../BW_MetaGeneratedBlocks_CasingAdvanced_TE.java | 22 + .../material/BW_MetaGeneratedBlocks_Casing_TE.java | 22 + .../system/material/BW_MetaGeneratedFrames.java | 2 +- .../system/material/BW_MetaGeneratedOreTE.java | 2 +- .../material/BW_MetaGeneratedSmallOreTE.java | 2 +- .../system/material/BW_MetaGenerated_Block_TE.java | 2 +- .../system/material/BW_MetaGenerated_Blocks.java | 2 +- .../system/material/BW_MetaGenerated_Items.java | 3 +- .../system/material/BW_NonMeta_MaterialItems.java | 2 +- .../material/CircuitGeneration/CircuitData.java | 2 +- .../CircuitGeneration/CircuitImprintLoader.java | 6 +- .../CircuitGeneration/CircuitPartLoader.java | 2 +- .../bartworks/system/material/Werkstoff.java | 18 +- .../bartworks/system/material/WerkstoffLoader.java | 945 ++------------------- .../processingLoaders/AfterLuVTierEnhacement.java | 4 +- .../werkstoff_loaders/IWerkstoffRunnable.java | 29 + .../werkstoff_loaders/recipe/AspectLoader.java | 61 ++ .../werkstoff_loaders/recipe/BlockLoader.java | 48 ++ .../werkstoff_loaders/recipe/CasingLoader.java | 69 ++ .../werkstoff_loaders/recipe/CellLoader.java | 187 ++++ .../recipe/CraftingMaterialLoader.java | 106 +++ .../werkstoff_loaders/recipe/CrushedLoader.java | 93 ++ .../werkstoff_loaders/recipe/DustLoader.java | 205 +++++ .../werkstoff_loaders/recipe/GemLoader.java | 112 +++ .../werkstoff_loaders/recipe/MetalLoader.java | 43 + .../werkstoff_loaders/recipe/MoltenCellLoader.java | 84 ++ .../recipe/MultipleMetalLoader.java | 46 + .../werkstoff_loaders/recipe/OreLoader.java | 53 ++ .../recipe/SimpleMetalLoader.java | 84 ++ .../werkstoff_loaders/recipe/ToolLoader.java | 121 +++ .../registration/AssociationLoader.java | 49 ++ .../registration/BridgeMaterialsLoader.java | 122 +++ .../registration/CasingRegistrator.java | 48 ++ .../bartworks/system/object/AbstractedStack.java | 2 +- .../bartworks/system/oredict/OreDictAdder.java | 2 +- .../bartworks/system/oredict/OreDictHandler.java | 2 +- .../bartworks/system/oregen/BW_WordGenerator.java | 2 +- .../system/oregen/BW_WorldGenRoss128b.java | 2 +- .../system/oregen/BW_WorldGenRoss128ba.java | 2 +- .../bartimaeusnek/bartworks/util/BW_Util.java | 65 +- .../crossmod/emt/recipe/TCRecipeHandler.java | 2 +- .../multi/GT_Industrial_Alchemic_Construct.java | 2 +- .../crossmod/emt/util/EMTHandler.java | 2 +- .../crossmod/galacticraft/PlanetsHelperClass.java | 2 +- .../atmosphere/BWAtmosphereManager.java | 6 +- .../galacticraft/blocks/UniversalSpaceBlocks.java | 2 +- .../galacticraft/creativetabs/SpaceTab.java | 2 +- .../planets/AbstractWorldProviderSpace.java | 2 +- .../planets/ross128b/SkyProviderRoss128b.java | 2 +- .../planets/ross128b/WorldProviderRoss128b.java | 2 +- .../planets/ross128ba/ChunkProviderRoss128ba.java | 2 +- .../tileEntity/DysonSwarmSunReplacement.java | 2 +- .../galaxySpace/tileEntity/GalaxySpaceProxy.java | 2 +- .../crossmod/openComputers/GT_NBT_DataBase.java | 2 +- .../tectech/TT_TileEntity_ManualTrafo.java | 4 +- .../crossmod/thaumcraft/CustomAspects.java | 2 +- .../tile/GT_Multi_IndustrialCrucible.java | 2 +- .../crossmod/thaumcraft/tile/GT_WandBuffer.java | 2 +- 133 files changed, 1829 insertions(+), 1072 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/IWerkstoffRunnable.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/AssociationLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java diff --git a/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java b/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java index bdfdb29ca8..4d9fe89836 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index 99a748fbd7..775c3fc9b1 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java index 30d387399c..7fb06e019e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java index 8d5c0d23ae..96a075d9c7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java index b4fe0923bc..19f422265b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java index fe92654fd0..d7de7ee822 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java index 5e8663f907..c10f7ffb39 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java index 9ae176d26f..369a403dc1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java index deec80e80f..1318cb919f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java index 59e9ee2782..efa6f601ef 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java index 1f28933622..d5875e4609 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java index 628b4acb96..0360502170 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java index 03ecf155e3..a300c63802 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java index 41ce06cc81..68c82fc7cc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java index 610aeb14f7..16cafa256d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java index 5ede1e09f0..7a9603ee61 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java index 94731e1833..90923deee4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java index ba0bc69c3b..80970c254c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java index 2f45e3c7c9..aa13bb4ee1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java index ae1187c3d0..c0d2ed88c6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java index 4de38a0e55..f11167a6bc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java index 4dd9bc3860..bad6170263 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index 5418587508..795acbec17 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java index 74bc3e2712..a054273f6b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java index cb0f78ffa5..612bd33b98 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java index 41525ef6d7..6a8c62bb83 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java index 61c93217d9..a135e7e315 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java index b7d6e7f82d..9b85abbedb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -44,6 +44,7 @@ public class PrintRecipeListToFile extends CommandBase { } @Override + @SuppressWarnings("unchecked") public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { File file = new File(p_71515_2_[0]); try { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java index 3e410ff2d3..aedddf54f8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index 46706f6f08..a3a9fc26e0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java index e6c0a5ad90..c5a6efd711 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index fdb263a9f0..efe7f5c6ca 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index a39d75dd97..29c14101a6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java index 1376a00bd8..c6a6782e34 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index 700b8974c3..3c132cef88 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java index 458a80e673..ba46ded1b2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java index a588921145..8d0dfcbb60 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java index b879c94958..c98bdf232a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java index d8070f4e90..2b9cb9a994 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java index 8287c44778..34bf243c1b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index b22bd115fd..ca291e64bc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java index be1fb4dea5..3b4571a4ca 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java index 7d083bdaec..4fa7ab4327 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java index 9a4ce6cf38..2831ee4ebe 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java index 4a1367d1dc..4f3eaf160e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java index e382a138ec..816f43c20b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java index 78df5d33f8..f655541555 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java index 0497a1b5b6..2cae9449df 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java index f47be6d45e..9efc0c4cfb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java index ac7c929cba..f252afa132 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index fe20f66d50..45bcd28218 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -379,6 +379,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl } @Override + @SuppressWarnings("deprecation") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16]}; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index daadf33416..35e9667204 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 0502a4a82e..bd45fe554a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 1c39d5e07c..5f6dde9c7f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index 8c258a96e6..06c8324457 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -396,6 +396,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase } @Override + @SuppressWarnings("deprecation") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[this.texid], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[this.texid]}; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java index 89c68563de..cd630ef2c3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index cc82311a70..9d17accb06 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java index be916e52ff..4105c99c3c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index fc7a1e6a05..3d82290fac 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java index f454af02d5..eb19af2040 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java index 4f2bebb0d6..1aa313c19b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java index 94b1aedd7e..d5afddb264 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java index dec4e11c5e..0e17f16506 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index 531c54cfd1..7b554447a2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index 48c1b6e6ed..c0f6ba3340 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java index 4bc7bf3802..ee959d878a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java index 8d2d9b0b51..918713a50a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java index 385897db6a..95ac8a9a09 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java index 2fd79898d8..7f82680495 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java index 7621a17f0a..5541256158 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java index 512325688c..e576296d7b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java index 84f054b4bb..3ce3219bde 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java index 6e2eafdf13..0cc1cf956b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java index 0e2121a0ae..18748c8e5c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java index c1fa1fbc85..adeeea4928 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.system.material; import com.github.technus.tectech.mechanics.structure.ICustomBlockSetting; @@ -85,14 +107,25 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple @SuppressWarnings("unchecked") public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { Werkstoff.werkstoffHashSet.stream() - .filter(pMaterial -> (pMaterial.hasItemType(WerkstoffLoader.blockCasing))) + .filter(pMaterial -> + pMaterial.hasItemType(OrePrefixes.plate) + && pMaterial.hasItemType(OrePrefixes.screw) + && pMaterial.hasItemType(OrePrefixes.plateDouble) + ) .map(pMaterial -> new ItemStack(aItem, 1, pMaterial.getmID())) .forEach(aList::add); } + /** + * DEBUG Method for TT-Blueprints! + */ @cpw.mods.fml.common.Optional.Method(modid = "tectech") public void setBlock(World world, int x, int y, int z, int meta) { world.setBlock(x, y, z,this, meta,2); + try { + Thread.sleep(1); + //Fucking Minecraft TE settings. + } catch (InterruptedException ignored) {} Optional.ofNullable(world.getTileEntity(x,y,z)) .filter(te -> te instanceof BW_MetaGeneratedBlocks_Casing_TE) .map(te -> (BW_MetaGeneratedBlocks_Casing_TE) te) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java index 4234355124..6dd15c8b5a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.API.SideReference; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java index b14f30f120..58863aff02 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.API.SideReference; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java index 37c14a6bd0..5fe7a3c4f5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index 5a5539b3f4..e43ee12471 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java index 80126f39f4..3aa323277f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java index 7213816976..9ad31b32cd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java index 1dbe218c09..87eaf7038d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 10e33f28cc..ab84e7fd0b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -89,7 +89,6 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } } - public boolean onEntityItemUpdate(EntityItem aItemEntity) { if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure || this.orePrefixes == OrePrefixes.crushed) { int aDamage = aItemEntity.getEntityItem().getItemDamage(); @@ -223,7 +222,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public int getRadiationLevel(ItemStack aStack) { Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage()); - return w.getStats().isRadioactive() ? (int) w.getStats().protons : 0; + return w.getStats().isRadioactive() ? (int) w.getStats().getProtons() : 0; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java index 1cb7d6ea64..fd3a74b470 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java index 22a1caaaf1..33658ef8e9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 56e3ad035c..bad997cb1e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -60,7 +60,7 @@ public class CircuitImprintLoader { private static final HashSet ORIGINAL_CAL_RECIPES = new HashSet<>(); private static final HashSet MODIFIED_CAL_RECIPES = new HashSet<>(); - @SuppressWarnings("unused") + @SuppressWarnings({"unused","RedundantSuppression"}) public static void run() { HashSet toRem = new HashSet<>(); HashSet toAdd = new HashSet<>(); @@ -69,7 +69,7 @@ public class CircuitImprintLoader { rebuildCircuitAssemblerMap(toRem,toAdd); exchangeRecipesInList(toRem,toAdd); makeCircuitImprintRecipes(); - + toRem = null; toAdd = null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index 79ee9d697a..a82dfb452d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 5c5698afdc..0713ddf102 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -801,16 +801,14 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } - byte qualityOverride; - int durOverride; - float speedOverride; - - int meltingPoint; - - long protons; - long neutrons; - long electrons; - long mass; + private byte qualityOverride; + private int durOverride; + private float speedOverride; + private int meltingPoint; + private long protons; + private long neutrons; + private long electrons; + private long mass; float durMod = 1f; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 07bef2bcf1..5e12e2e7a9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -27,47 +27,38 @@ import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.API.WerkstoffAdderRegistry; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; -import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_CircuitsLoader; import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.GTMetaItemEnhancer; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.*; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration.AssociationLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration.BridgeMaterialsLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration.CasingRegistrator; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.EnumUtils; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import com.github.bartimaeusnek.crossmod.cls.CLSCompat; -import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import com.google.common.collect.HashBiMap; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.ProgressManager; import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enchants.Enchantment_Radioactivity; import gregtech.api.enums.*; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_Fluid; -import gregtech.api.objects.GT_MultiTexture; -import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.*; -import gregtech.common.GT_Proxy; import gregtech.common.items.GT_MetaGenerated_Tool_01; -import gregtech.common.items.behaviors.Behaviour_DataOrb; import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputOreDict; import ic2.api.recipe.RecipeOutput; import ic2.api.recipe.Recipes; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import org.apache.logging.log4j.Level; @@ -199,9 +190,10 @@ public class WerkstoffLoader { } //TODO: - //FREE ID RANGE: 95-30000 - //bartimaeusnek reserved 0-10000 - //Tec & basdxz reserved range 30000-32767 + //FREE ID RANGE: 95-29_999 + //bartimaeusnek reserved 0-10_000 + //Tec & basdxz reserved range 30_000-31_000 + //GT Material range reserved on 31_767-32_767 public static final Werkstoff Bismutite = new Werkstoff( new short[]{255, 233, 0, 0}, "Bismutite", @@ -1432,7 +1424,7 @@ public class WerkstoffLoader { return WerkstoffLoader.getCorrespondingItemStack(orePrefixes, werkstoff, 1); } - private static ItemStack getCorrespondingItemStackUnsafe(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { + public static ItemStack getCorrespondingItemStackUnsafe(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { if (!werkstoff.getGenerationFeatures().enforceUnification) { ItemStack ret = OreDictHandler.getItemStack(werkstoff.getVarName(), orePrefixes, amount); if (ret != null) @@ -1480,13 +1472,31 @@ public class WerkstoffLoader { long timepre = System.nanoTime(); ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashSet.size() + 1); DebugLog.log("Loading Recipes" + (System.nanoTime() - timepre)); - Integer[] clsArr = new Integer[0]; int size = 0; if (LoaderReference.betterloadingscreen) clsArr = CLSCompat.initCls(); + + IWerkstoffRunnable[] werkstoffRunnables = new IWerkstoffRunnable[]{ + new ToolLoader(), + new DustLoader(), + new GemLoader(), + new SimpleMetalLoader(), + new CasingLoader(), + new AspectLoader(), + new OreLoader(), + new CrushedLoader(), + new CraftingMaterialLoader(), + new CellLoader(), + new MoltenCellLoader(), + new MultipleMetalLoader(), + new MetalLoader(), + new BlockLoader() + }; + + long timepreone = 0; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - long timepreone = System.nanoTime(); + timepreone = System.nanoTime(); DebugLog.log("Werkstoff is null or id < 0 ? " + (werkstoff == null || werkstoff.getmID() < 0) + " " + (System.nanoTime() - timepreone)); if (werkstoff == null || werkstoff.getmID() < 0) { progressBar.step(""); @@ -1495,41 +1505,17 @@ public class WerkstoffLoader { if (LoaderReference.betterloadingscreen) size = CLSCompat.invokeStepSize(werkstoff, clsArr, size); DebugLog.log("Werkstoff: " + werkstoff.getDefaultName() + " " + (System.nanoTime() - timepreone)); - DebugLog.log("Loading Dusts Recipes" + " " + (System.nanoTime() - timepreone)); - addDustRecipes(werkstoff); - DebugLog.log("Loading Gem Recipes" + " " + (System.nanoTime() - timepreone)); - addGemRecipes(werkstoff); - DebugLog.log("Loading Ore Recipes" + " " + (System.nanoTime() - timepreone)); - addOreRecipes(werkstoff); - DebugLog.log("Loading Crushed Recipes" + " " + (System.nanoTime() - timepreone)); - addCrushedRecipes(werkstoff); - DebugLog.log("Loading Cell Recipes" + " " + (System.nanoTime() - timepreone)); - addCellRecipes(werkstoff); - DebugLog.log("Loading Meltdown Recipes" + " " + (System.nanoTime() - timepreone)); - addMoltenRecipes(werkstoff); - DebugLog.log("Loading Simple MetalWorking Recipes" + " " + (System.nanoTime() - timepreone)); - addSimpleMetalRecipes(werkstoff); - DebugLog.log("Loading Crafting MetalWorking Recipes" + " " + (System.nanoTime() - timepreone)); - addCraftingMetalRecipes(werkstoff); - DebugLog.log("Loading MultipleIngots MetalWorking Recipes" + " " + (System.nanoTime() - timepreone)); - addMultipleMetalRecipes(werkstoff); - DebugLog.log("Loading Metal Recipes" + " " + (System.nanoTime() - timepreone)); - addMetalRecipes(werkstoff); - DebugLog.log("Loading Block Recipes" + " " + (System.nanoTime() - timepreone)); - addBlockRecipes(werkstoff); - DebugLog.log("Loading Tool Recipes" + " " + (System.nanoTime() - timepreone)); - addTools(werkstoff); - DebugLog.log("Loading Casing Recipes" + " " + (System.nanoTime() - timepreone)); - addCasingRecipes(werkstoff); - if (LoaderReference.Thaumcraft) { - DebugLog.log("Loading Aspects" + " " + (System.nanoTime() - timepreone)); - addAspectToAll(werkstoff); + for (IWerkstoffRunnable runnable : werkstoffRunnables) { + String loaderName = runnable.getClass().getSimpleName(); + DebugLog.log( loaderName + " started " + (System.nanoTime() - timepreone)); + runnable.run(werkstoff); + DebugLog.log(loaderName + " done " + (System.nanoTime() - timepreone)); } - DebugLog.log("Loading New Circuits" + " " + (System.nanoTime() - timepreone)); - BW_CircuitsLoader.initNewCircuits(); DebugLog.log("Done" + " " + (System.nanoTime() - timepreone)); progressBar.step(werkstoff.getDefaultName()); } + DebugLog.log("Loading New Circuits" + " " + (System.nanoTime() - timepreone)); + BW_CircuitsLoader.initNewCircuits(); if (LoaderReference.betterloadingscreen) CLSCompat.disableCls(); @@ -1544,7 +1530,6 @@ public class WerkstoffLoader { } private static void addSubTags() { - WerkstoffLoader.CubicZirconia.getStats().setDurOverride(Materials.Diamond.mDurability); WerkstoffLoader.HDCS.getStats().setSpeedOverride(Materials.HSSS.mToolSpeed); WerkstoffLoader.HDCS.getStats().setDurMod(10f); @@ -1556,7 +1541,6 @@ public class WerkstoffLoader { Materials.Radon.add(WerkstoffLoader.NOBLE_GAS); WerkstoffLoader.Oganesson.add(WerkstoffLoader.NOBLE_GAS, WerkstoffLoader.ANAEROBE_GAS); - Materials.Nitrogen.add(WerkstoffLoader.ANAEROBE_GAS); WerkstoffLoader.Calcium.add(WerkstoffLoader.ANAEROBE_SMELTING); @@ -1624,8 +1608,8 @@ public class WerkstoffLoader { if (!FluidRegistry.isFluidRegistered("molten." + werkstoff.getDefaultName())) { DebugLog.log("Adding new Molten: " + werkstoff.getDefaultName()); Fluid fluid = new GT_Fluid("molten." + werkstoff.getDefaultName(), "molten.autogenerated", werkstoff.getRGBA()); - if (werkstoff.getStats().meltingPoint > 0) - fluid = fluid.setTemperature(werkstoff.getStats().meltingPoint); + if (werkstoff.getStats().getMeltingPoint() > 0) + fluid = fluid.setTemperature(werkstoff.getStats().getMeltingPoint()); FluidRegistry.registerFluid(fluid); //GT_LanguageManager.addStringLocalization("Molten." + werkstoff.getDefaultName(), "Molten "+ werkstoff.getDefaultName()); GT_LanguageManager.addStringLocalization(fluid.getUnlocalizedName(), "Molten " + werkstoff.getDefaultName()); @@ -1745,102 +1729,21 @@ public class WerkstoffLoader { } private static void runGTItemDataRegistrator() { + IWerkstoffRunnable[] registrations = new IWerkstoffRunnable[] { + new BridgeMaterialsLoader(), + new AssociationLoader(), + new CasingRegistrator() + }; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - //int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, String aConfigSection, boolean aCustomOre, String aCustomID - Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : - new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(), 0, werkstoff.getRGBA()[0], werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getVarName(), werkstoff.getDefaultName(), 0, 0, werkstoff.getStats().meltingPoint, werkstoff.getStats().meltingPoint, werkstoff.getStats().isBlastFurnace(), false, 0, 1, 1, null); - for (OrePrefixes prefixes : values()) { - if (!(prefixes == cell && werkstoff.getType().equals(Werkstoff.Types.ELEMENT))) { - if (prefixes == dust && werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { - if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { - boolean ElementSet = false; - for (Element e : Element.values()) { - if (e.toString().equals(werkstoff.getToolTip())) { - if (e.mLinkedMaterials.size() > 0) - break; - werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : - new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(), 0, werkstoff.getRGBA()[0], werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getVarName(), werkstoff.getDefaultName(), 0, 0, werkstoff.getStats().meltingPoint, werkstoff.getStats().meltingPoint, werkstoff.getStats().isBlastFurnace(), false, 0, 1, 1, null); - werkstoffBridgeMaterial.mElement = e; - e.mLinkedMaterials = new ArrayList<>(); - e.mLinkedMaterials.add(werkstoffBridgeMaterial); - if (werkstoff.hasItemType(dust)) { - GT_OreDictUnificator.addAssociation(dust, werkstoffBridgeMaterial, werkstoff.get(dust), false); - GT_OreDictUnificator.set(dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true); - } - ElementSet = true; - break; - } - } - if (!ElementSet) - continue; -// try { -// Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); -// f.setAccessible(true); -// Map MATERIALS_MAP = (Map) f.get(null); -// MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); -// } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { -// e.printStackTrace(); -// } - if (werkstoff.hasItemType(dust)) { - ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); - Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(prefixes)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); - //GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, null, new ItemStack[]{werkstoff.get(prefixes)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); - } - } - } - - if (werkstoff.hasItemType(cell)) { - werkstoffBridgeMaterial.setHasCorrespondingFluid(true); - werkstoffBridgeMaterial.setHasCorrespondingGas(true); - werkstoffBridgeMaterial.mFluid = werkstoff.getFluidOrGas(1).getFluid(); - werkstoffBridgeMaterial.mGas = werkstoff.getFluidOrGas(1).getFluid(); - } - - if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { - werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid(); - } - werkstoffBridgeMaterial.mName = werkstoff.getVarName(); - werkstoffBridgeMaterial.mDefaultLocalName = werkstoff.getDefaultName(); - try { - Field f = Materials.class.getField("mLocalizedName"); - f.set(werkstoffBridgeMaterial, werkstoff.getDefaultName()); - } catch (NoSuchFieldException | IllegalAccessException ignored) { - } - werkstoffBridgeMaterial.mChemicalFormula = werkstoff.getToolTip(); - if (LoaderReference.Thaumcraft) - werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects(); - werkstoffBridgeMaterial.mMaterialInto = werkstoffBridgeMaterial; - werkstoffBridgeMaterial.mHandleMaterial = werkstoff.contains(SubTag.BURNING) ? Materials.Blaze : werkstoff.contains(SubTag.MAGICAL) ? Materials.Thaumium : werkstoffBridgeMaterial.mDurability > 5120 ? Materials.TungstenSteel : werkstoffBridgeMaterial.mDurability > 1280 ? Materials.Steel : Materials.Wood; - if (werkstoff.getStats().isRadioactive()) { - werkstoffBridgeMaterial.setEnchantmentForArmors(Enchantment_Radioactivity.INSTANCE, werkstoff.getStats().getEnchantmentlvl()); - werkstoffBridgeMaterial.setEnchantmentForTools(Enchantment_Radioactivity.INSTANCE, werkstoff.getStats().getEnchantmentlvl()); - } - werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); - //if (WerkstoffLoader.items.get(prefixes) != null) - } + for (IWerkstoffRunnable registration : registrations) { + registration.run(werkstoff); } } - addAssociationToItems(); addFakeItemDataToInWorldBlocksAndCleanUpFakeData(); - addCasingsToGTOreDictUnificator(); + addVanillaCasingsToGTOreDictUnificator(); } - public static void addCasingsToGTOreDictUnificator(){ - Werkstoff.werkstoffHashSet.forEach(werkstoff -> { - GT_OreDictUnificator.addAssociation( - blockCasing, werkstoff.getBridgeMaterial(), - new ItemStack(WerkstoffLoader.BWBlockCasings, 1, werkstoff.getmID()), - false - ); - GT_OreDictUnificator.addAssociation( - blockCasingAdvanced, werkstoff.getBridgeMaterial(), - new ItemStack(WerkstoffLoader.BWBlockCasingsAdvanced, 1, werkstoff.getmID()), - false - ); - } - ); + public static void addVanillaCasingsToGTOreDictUnificator(){ GT_OreDictUnificator.addAssociation( blockCasing, Materials.Aluminium, ItemList.Casing_FrostProof.get(1L), @@ -1873,21 +1776,6 @@ public class WerkstoffLoader { ); } - public static void addAssociationToItems() { - Arrays.stream(values()).forEach(prefixes -> - Werkstoff.werkstoffHashSet.stream() - .filter(werkstoff -> werkstoff.hasItemType(prefixes)) - .forEach(werkstoff -> { - Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial(); - ItemStack stack = WerkstoffLoader.getCorrespondingItemStackUnsafe(prefixes, werkstoff, 1); - - if (stack != null && stack.getItem() != null) { - GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, stack, false); - GT_OreDictUnificator.set(prefixes, werkstoffBridgeMaterial, stack, true, true); - } - })); - } - /** * very hacky way to make my ores/blocks/smallores detectable by gt assosication in world, well at least the prefix. * used for the miners mostly @@ -1923,80 +1811,6 @@ public class WerkstoffLoader { MATERIALS_MAP.remove("bwblocks"); } - private static void addTools(Werkstoff werkstoff) { - if (werkstoff.getBridgeMaterial().mDurability == 0) - return; - - if (werkstoff.hasItemType(gem)) { - if (!werkstoff.getGenerationFeatures().isExtension()) - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', gem.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"GGf", 'G', gem.get(werkstoff.getBridgeMaterial())}); - } - - if (!werkstoff.hasItemType(plate)) - return; - - //Disable recipe gen with handle Material for GT Materials - if (!werkstoff.getGenerationFeatures().isExtension()) { - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{" fS", " Sh", "W ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadWrench, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"hXW", "XRX", "WXd", 'X', plate.get(werkstoff.getBridgeMaterial()), 'S', plate.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'R', ring.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'W', screw.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{toolHeadHammer.get(werkstoff.getBridgeMaterial()), stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.FILE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P", "P", "S", 'P', plate.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SAW, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), new Object[]{toolHeadSaw.get(werkstoff.getBridgeMaterial()), stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.AnyRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_LV_Lithium.get(1L)}); - - if (gtnhGT) { - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(162, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.AnyRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_MV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(164, 1, werkstoff.getBridgeMaterial(), Materials.StyreneButadieneRubber, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.StyreneButadieneRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_HV_Lithium.get(1L)}); - } - - if (!werkstoff.hasItemType(gem)) { - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', ingot.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - } - } - - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.PLUNGER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"xRR", " SR", "S f", 'S', stick.get(werkstoff.getBridgeMaterial()), 'R', plate.get(Materials.AnyRubber)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', ingot.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"hDS", "DSD", "SDf", 'S', stick.get(werkstoff.getBridgeMaterial()), 'D', Dyes.dyeBlue}); - - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WIRECUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "hPd", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCOOP, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SWS", "SSS", "xSh", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', new ItemStack(Blocks.wool, 1, 32767)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BRANCHCUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "PdP", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.KNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"fPh", " S ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PPf", "PP ", "Sh ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial())}); - - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); - - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); - - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"II ", "IIh", "II ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', ingot.get(werkstoff.getBridgeMaterial())}); - - if (!werkstoff.hasItemType(gem)) { - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"PP ", "fh ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', ingot.get(werkstoff.getBridgeMaterial())}); - } - - if (gtnhGT) { - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(152, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(154, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); - } - - // GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(16,1, werkstoff.getBridgeMaterial(),werkstoff.getBridgeMaterial(),null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', werkstoff.get(ingot)}); - } - public static void removeIC2Recipes() { try { Set> remset = new HashSet<>(); @@ -2018,7 +1832,6 @@ public class WerkstoffLoader { } private static void runAdditionalOreDict() { - for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { if (werkstoff.hasItemType(ore)) { GT_OreDictUnificator.registerOre(ore + werkstoff.getVarName(), werkstoff.get(ore)); @@ -2044,666 +1857,4 @@ public class WerkstoffLoader { GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite)); } - - private static void addCasingRecipes(Werkstoff werkstoff) { - if (!(werkstoff.hasItemType(blockCasing) && werkstoff.hasItemType(plate) && werkstoff.hasItemType(screw) && werkstoff.hasItemType(gearGt) )) - return; - - GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasing),new Object[]{ - "PSP", - "PGP", - "PSP", - 'P', werkstoff.get(plate), - 'S', werkstoff.get(screw), - 'G', werkstoff.get(gearGtSmall) - }); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - werkstoff.get(plate,6), - werkstoff.get(screw,2), - werkstoff.get(gearGtSmall) - }, GT_Values.NF,werkstoff.get(blockCasing), 200, 30); - - GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasingAdvanced),new Object[]{ - "PSP", - "PGP", - "PSP", - 'P', werkstoff.get(plateDouble), - 'S', werkstoff.get(screw), - 'G', werkstoff.get(gearGt) - }); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - werkstoff.get(plateDouble,6), - werkstoff.get(screw,2), - werkstoff.get(gearGt) - }, GT_Values.NF,werkstoff.get(blockCasingAdvanced), 200, 30); - } - - private static void addGemRecipes(Werkstoff werkstoff) { - if (werkstoff.hasItemType(gem)) { - if (werkstoff.getGenerationFeatures().hasSifterRecipes() || (werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust))) { - - GT_ModHandler.addCompressionRecipe(werkstoff.get(gem, 9), werkstoff.get(block)); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(block), werkstoff.get(gem, 9), 100, 24); - GT_Values.RA.addSifterRecipe( - werkstoff.get(crushedPurified), - new ItemStack[]{ - werkstoff.get(gemExquisite), - werkstoff.get(gemFlawless), - werkstoff.get(gem), - werkstoff.get(gemFlawed), - werkstoff.get(gemChipped), - werkstoff.get(dust) - }, - new int[]{ - 200, 1000, 2500, 2000, 4000, 5000 - }, - 800, - 16 - ); - } - - GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemExquisite), werkstoff.get(dust, 4)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawless), werkstoff.get(dust, 2)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(gem), werkstoff.get(dust)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawed), werkstoff.get(dustSmall, 2)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemChipped), werkstoff.get(dustSmall)); - - GT_ModHandler.addCraftingRecipe(werkstoff.get(gemFlawless, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gemExquisite)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(gem, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gemFlawless)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(gemFlawed, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gem)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(gemChipped, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gemFlawed)}); - - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemExquisite), werkstoff.get(gemFlawless, 2), 64, 16); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawless), werkstoff.get(gem, 2), 64, 16); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gem), werkstoff.get(gemFlawed, 2), 64, 16); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawed), werkstoff.get(gemChipped, 2), 64, 16); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemChipped), werkstoff.get(dustTiny), 64, 16); - - if (!werkstoff.contains(WerkstoffLoader.NO_BLAST)) { - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawless, 3), 8, werkstoff.get(gemExquisite), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gem, 3), 8, werkstoff.get(gemFlawless), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawed, 3), 8, werkstoff.get(gem), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemChipped, 3), 8, werkstoff.get(gemFlawed), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - - GT_Values.RA.addImplosionRecipe(werkstoff.get(dust, 4), 24, werkstoff.get(gem, 3), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)); - } - - if (werkstoff.hasItemType(plate)) { - GT_Values.RA.addLatheRecipe(werkstoff.get(plate), werkstoff.get(lens), werkstoff.get(dustSmall), 1200, 120); - } - - GT_Values.RA.addLatheRecipe(werkstoff.get(gemExquisite), werkstoff.get(lens), werkstoff.get(dust, 2), 2400, 30); - GregTech_API.registerCover(werkstoff.get(lens), new GT_MultiTexture(Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false)), new gregtech.common.covers.GT_Cover_Lens(BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(lens), werkstoff.get(dustSmall, 3)); - - for (ItemStack is : OreDictionary.getOres("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) { - is.stackSize = 0; - GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemChipped, 3), is, werkstoff.get(gemFlawed, 1), 600, 30); - GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemFlawed, 3), is, werkstoff.get(gem, 1), 600, 120); - GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gem, 3), is, werkstoff.get(gemFlawless, 1), 1200, 480); - GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemFlawless, 3), is, werkstoff.get(gemExquisite, 1), 2400, 2000); - } - } - } - - private static void addSimpleMetalRecipes(Werkstoff werkstoff) { - if (werkstoff.hasItemType(plate)) { - if (werkstoff.hasItemType(gem)) { - GT_Values.RA.addLatheRecipe(werkstoff.get(gem), werkstoff.get(stick), werkstoff.get(dustSmall, 2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); - GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(gem)}); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); - - TextureSet texSet = werkstoff.getTexSet(); - GT_RenderedTexture texture = SideReference.Side.Client ? - new GT_RenderedTexture(texSet.mTextures[PrefixTextureLinker.blockTexMap.getOrDefault(texSet, block.mTextureIndex)], werkstoff.getRGBA(), false) : - new GT_RenderedTexture(texSet.mTextures[block.mTextureIndex], werkstoff.getRGBA(), false); - GregTech_API.registerCover(werkstoff.get(plate),texture,null); - - GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); - return; - } - - GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(ingot)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(plate), GT_Proxy.tBits, new Object[]{"h", "X", "X", 'X', werkstoff.get(ingot)}); - - GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(1)}, new ItemStack[]{werkstoff.get(plate)}, null, null, null, null, (int) Math.max(werkstoff.getStats().getMass(), 1L), 24, 0)); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ingot, 3), werkstoff.get(plate, 2), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); - GregTech_API.registerCover(werkstoff.get(plate), new GT_RenderedTexture(werkstoff.getTexSet().mTextures[71], werkstoff.getRGBA(), false), null); - - GT_Values.RA.addLatheRecipe(werkstoff.get(ingot), werkstoff.get(stick), werkstoff.get(dustSmall, 2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); - - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); - - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Plate.get(0), werkstoff.get(plate), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Rod.get(0), werkstoff.get(stick, 2), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); - - GT_Values.RA.addPulveriserRecipe(werkstoff.get(ingot), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(stickLong), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(stick), new ItemStack[]{werkstoff.get(dustSmall, 2)}, null, 2, 8); - } - } - - private static void addCraftingMetalRecipes(Werkstoff werkstoff) { - if (werkstoff.hasItemType(screw)) { - int tVoltageMultiplier = werkstoff.getStats().meltingPoint >= 2800 ? 60 : 15; - - //bolt - GT_Values.RA.addExtruderRecipe(werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(ingot), ItemList.Shape_Extruder_Bolt.get(0L), werkstoff.get(bolt, 8), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 8 * tVoltageMultiplier); - GT_Values.RA.addCutterRecipe(werkstoff.get(stick), werkstoff.get(bolt, 4), null, (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 4); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(bolt), new ItemStack[]{werkstoff.get(dustTiny, 1)}, null, 2, 8); - - //screw - GT_Values.RA.addLatheRecipe(werkstoff.get(bolt), werkstoff.get(screw), null, (int) Math.max(werkstoff.getStats().getMass() / 8L, 1L), 4); - GT_ModHandler.addCraftingRecipe(werkstoff.get(screw), GT_Proxy.tBits, new Object[]{"fX", "X ", 'X', werkstoff.get(bolt)}); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(screw), new ItemStack[]{werkstoff.get(dustTiny, 1)}, null, 2, 8); - - if (werkstoff.hasItemType(gem)) - return; - - //ring - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Ring.get(0L), werkstoff.get(ring, 4), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 6 * tVoltageMultiplier); - GT_ModHandler.addCraftingRecipe(werkstoff.get(ring), GT_Proxy.tBits, new Object[]{"h ", "fX", 'X', werkstoff.get(stick)}); - - //Gear - GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGt), GT_Proxy.tBits, new Object[]{"SPS", "PwP", "SPS", 'P', werkstoff.get(plate), 'S', werkstoff.get(stick)}); - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 4), ItemList.Shape_Extruder_Gear.get(0L), werkstoff.get(gearGt), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1), 8 * tVoltageMultiplier); - - //wireFine - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Wire.get(0L), werkstoff.get(wireFine, 8), (int) Math.max(werkstoff.getStats().getMass() * 1.5F, 1F), 8 * tVoltageMultiplier); - GT_Values.RA.addWiremillRecipe(werkstoff.get(ingot), werkstoff.get(wireFine, 8), (int) Math.max(werkstoff.getStats().getMass(), 1), 8 * tVoltageMultiplier); - GT_Values.RA.addWiremillRecipe(werkstoff.get(stick), werkstoff.get(wireFine, 4), (int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F), 8 * tVoltageMultiplier); - - //smallGear - if (WerkstoffLoader.smallGearShape != null) - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), WerkstoffLoader.smallGearShape.get(0L), werkstoff.get(gearGtSmall), (int) werkstoff.getStats().mass, 8 * tVoltageMultiplier); - if (ConfigHandler.hardmode) - GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{" S ", "hPx", " S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate)}); - else - GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{"P ", " h ", 'P', werkstoff.get(plate)}); - - //Rotor - GT_ModHandler.addCraftingRecipe(werkstoff.get(rotor), GT_Proxy.tBits, new Object[]{"PhP", "SRf", "PdP", 'P', werkstoff.get(plate), 'R', werkstoff.get(ring), 'S', werkstoff.get(screw)}); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.Tin.getMolten(32), werkstoff.get(rotor), 240, 24); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.Lead.getMolten(48), werkstoff.get(rotor), 240, 24); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.SolderingAlloy.getMolten(16), werkstoff.get(rotor), 240, 24); - - if (WerkstoffLoader.rotorShape != null) - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 5), WerkstoffLoader.rotorShape.get(0L), werkstoff.get(rotor), 200, 60); - - //molten -> metal - if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear.get(0L), werkstoff.getMolten(576), werkstoff.get(gearGt), 128, 8); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear_Small.get(0L), werkstoff.getMolten(144), werkstoff.get(gearGtSmall), 16, 8); - if (WerkstoffLoader.ringMold != null) - GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.ringMold.get(0L), werkstoff.getMolten(36), werkstoff.get(ring), 100, 4 * tVoltageMultiplier); - if (WerkstoffLoader.boltMold != null) - GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.boltMold.get(0L), werkstoff.getMolten(18), werkstoff.get(bolt), 50, 2 * tVoltageMultiplier); - - if (WerkstoffLoader.rotorMold != null) - GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.rotorMold.get(0L), werkstoff.getMolten(612), werkstoff.get(rotor), 100, 60); - } - - GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGt), new ItemStack[]{werkstoff.get(dust, 4)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGtSmall), new ItemStack[]{werkstoff.get(dust, 1)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(rotor), new ItemStack[]{werkstoff.get(dust, 4), werkstoff.get(dustSmall)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(ring), new ItemStack[]{werkstoff.get(dustSmall, 1)}, null, 2, 8); - } - } - - private static void addBlockRecipes(Werkstoff werkstoff) { - if (!werkstoff.hasItemType(block)) - return; - if (werkstoff.hasItemType(ingot)) { - GT_Values.RA.addArcFurnaceRecipe(werkstoff.get(block), new ItemStack[]{werkstoff.get(ingot, 9)}, null, 16, 90, false); - } - if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(block), null, werkstoff.getMolten(1296), 0, 288, 8); - } - if (werkstoff.hasItemType(plate)) { - GT_Values.RA.addCutterRecipe(werkstoff.get(block), werkstoff.get(plate, 9), null, (int) Math.max(werkstoff.getStats().getMass() * 10L, 1L), 30); - } - } - - private static void addMetalRecipes(Werkstoff werkstoff) { - if (werkstoff.hasItemType(ingot)) { - GT_ModHandler.addCompressionRecipe(werkstoff.get(ingot, 9), werkstoff.get(block)); - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 9), ItemList.Shape_Extruder_Block.get(0), werkstoff.get(block), (int) werkstoff.getStats().mass, 8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); - GT_Values.RA.addAlloySmelterRecipe(werkstoff.get(ingot, 9), ItemList.Shape_Mold_Block.get(0L), werkstoff.get(block), (int) (werkstoff.getStats().mass / 2), 4 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); - } - } - - private static void addMultipleMetalRecipes(Werkstoff werkstoff) { - if (werkstoff.hasItemType(plateDense)) { - GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{werkstoff.get(ingot, 2), GT_Utility.getIntegratedCircuit(2)}, new ItemStack[]{werkstoff.get(plateDouble)}, null, null, null, null, (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), 60, 0)); - GregTech_API.registerCover(werkstoff.get(plateDouble), new GT_RenderedTexture(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false), null); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(plateDouble), new ItemStack[]{werkstoff.get(dust, 2)}, null, 2, 8); - } - } - - private static void addDustRecipes(Werkstoff werkstoff) { - if (werkstoff.hasItemType(dust)) { - List flOutputs = new ArrayList<>(); - List stOutputs = new ArrayList<>(); - HashMap> tracker = new HashMap<>(); - int cells = 0; - - if (werkstoff.getGenerationFeatures().hasMixerRecipes() || werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { - for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { - if (container.getKey() instanceof Materials) { - if (((Materials) container.getKey()).getGas(0) != null || ((Materials) container.getKey()).getFluid(0) != null || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { - FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); - if (tmpFl == null || tmpFl.getFluid() == null) { - tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); - } - flOutputs.add(tmpFl); - if (flOutputs.size() > 1) { - if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); - } else { - stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); - } - cells += container.getValue(); - } - } else { - if (((Materials) container.getKey()).getDust(container.getValue()) == null) { - if (((Materials) container.getKey()).getCells(container.getValue()) != null && (((Materials) container.getKey()).getMolten(0) != null || ((Materials) container.getKey()).getSolid(0) != null)) { - FluidStack tmpFl = ((Materials) container.getKey()).getMolten(1000 * container.getValue()); - if (tmpFl == null || tmpFl.getFluid() == null) { - tmpFl = ((Materials) container.getKey()).getSolid(1000 * container.getValue()); - } - flOutputs.add(tmpFl); - if (flOutputs.size() > 1) { - if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); - } else { - stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); - } - cells += container.getValue(); - } - } else - continue; - } - if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); - } else { - stOutputs.add(((Materials) container.getKey()).getDust(tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); - } - } - } else if (container.getKey() instanceof Werkstoff) { - if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) { - FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); - if (tmpFl == null || tmpFl.getFluid() == null) { - tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); - } - flOutputs.add(tmpFl); - if (flOutputs.size() > 1) { - if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); - } else { - stOutputs.add(((Werkstoff) container.getKey()).get(cell, tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); - } - cells += container.getValue(); - } - } else { - if (!((Werkstoff) container.getKey()).hasItemType(dust)) - continue; - if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); - } else { - stOutputs.add(((Werkstoff) container.getKey()).get(dust, (tracker.get(container.getKey()).getKey() + container.getValue()))); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); - } - } - } - } - ItemStack input = werkstoff.get(dust); - input.stackSize = werkstoff.getContents().getKey(); - if (werkstoff.getStats().isElektrolysis()) - GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); - if (werkstoff.getStats().isCentrifuge()) - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); - if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { - if (cells > 0) - stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); - GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); - } - if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { - if (cells > 0) - stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); - } - } - - GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{ - "TTT", "TTT", "TTT", 'T', - werkstoff.get(dustTiny) - }); - GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{ - "TT ", "TT ", 'T', - WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff) - }); - GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff, 4), new Object[]{ - " T ", 'T', werkstoff.get(dust) - }); - GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff, 9), new Object[]{ - "T ", 'T', werkstoff.get(dust) - }); - - GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny, 9), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); - GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall, 4), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); - GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny, 9), ItemList.Schematic_3by3.get(0L), werkstoff.get(dust), 100, 4); - GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall, 4), ItemList.Schematic_2by2.get(0L), werkstoff.get(dust), 100, 4); - - if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) { - GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); - GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustTiny), werkstoff.get(nugget)); - } else if (werkstoff.hasItemType(ingot) && werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().meltingPoint != 0) { - if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)) { - GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Nitrogen.getGas(1000), null, werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); - } else if (werkstoff.contains(WerkstoffLoader.NOBLE_GAS_SMELTING)) { - GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Argon.getGas(1000), null, werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); - } else { - GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, werkstoff.getStats().meltingPoint < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); - if (werkstoff.getStats().meltingPoint <= 1000) { - GT_Values.RA.addPrimitiveBlastRecipe(werkstoff.get(dust), null, 9, werkstoff.get(ingot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint); - GT_ModHandler.addRCBlastFurnaceRecipe(werkstoff.get(ingot), werkstoff.get(dust), werkstoff.getStats().meltingPoint); - } - } - } - - if (werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().meltingPoint > 1750) { - GT_Values.RA.addVacuumFreezerRecipe(werkstoff.get(ingotHot), werkstoff.get(ingot), (int) Math.max(werkstoff.getStats().mass * 3L, 1L)); - } - - if (werkstoff.hasItemType(ingot)) { - GT_ModHandler.addPulverisationRecipe(werkstoff.get(ingot), werkstoff.get(dust)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(nugget), werkstoff.get(dustTiny)); - } - if (werkstoff.hasItemType(ingot) || werkstoff.hasItemType(gem)) { - GT_ModHandler.addPulverisationRecipe(werkstoff.get(block), werkstoff.get(dust, 9)); - } - } - } - - private static void addOreRecipes(Werkstoff werkstoff) { - if (werkstoff.hasItemType(ore) && werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) - GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), werkstoff.get(ingot)); - - if (werkstoff.hasItemType(ore)) { - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ore), werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(crushed), 16, 10); - GT_ModHandler.addPulverisationRecipe( - werkstoff.get(ore), - werkstoff.get(crushed, 2), - werkstoff.contains(SubTag.CRYSTAL) ? werkstoff.get(gem) : werkstoff.getOreByProduct(0, dust), - werkstoff.getNoOfByProducts() > 0 ? 10 : 0, - Materials.Stone.getDust(1), - 50, - true); - } - } - - private static void addCrushedRecipes(Werkstoff werkstoff) { - if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) == 0 || (werkstoff.getGenerationFeatures().toGenerate & 0b1) == 0) - return; - - if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) { - if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { - GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushed), werkstoff.get(nugget, 10)); - GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedPurified), werkstoff.get(nugget, 10)); - GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(nugget, 10)); - } else { - GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushed), werkstoff.get(ingot)); - GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedPurified), werkstoff.get(ingot)); - GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(ingot)); - } - GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustImpure), werkstoff.get(ingot)); - GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustPure), werkstoff.get(ingot)); - GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); - } - - GT_ModHandler.addCraftingRecipe(werkstoff.get(dustImpure), new Object[]{"h ", "W ", 'W', werkstoff.get(crushed)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(dustPure), new Object[]{"h ", "W ", 'W', werkstoff.get(crushedPurified)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{"h ", "W ", 'W', werkstoff.get(crushedCentrifuged)}); - - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), 10, 16); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), werkstoff.getOreByProduct(0, dust), 10, false); - GT_ModHandler.addOreWasherRecipe(werkstoff.get(crushed), 1000, werkstoff.get(crushedPurified), werkstoff.getOreByProduct(0, dustTiny), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); - GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushed), (int) Math.min(5000L, Math.abs(werkstoff.getStats().protons * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dustTiny), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); - - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), 10, 16); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), werkstoff.getOreByProduct(1, dust), 10, false); - GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushedPurified), (int) Math.min(5000L, Math.abs(werkstoff.getStats().protons * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dustTiny)); - - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(dust), 10, 16); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(dust), werkstoff.getOreByProduct(2, dust), 10, false); - - GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustImpure), 0, werkstoff.get(dust), werkstoff.getOreByProduct(0, dustTiny), null, null, null, null, (int) Math.max(1L, werkstoff.getStats().mass * 8L)); - GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustPure), 0, werkstoff.get(dust), werkstoff.getOreByProduct(1, dustTiny), null, null, null, null, (int) Math.max(1L, werkstoff.getStats().mass * 8L)); - - if (werkstoff.contains(SubTag.CRYSTALLISABLE)) { - GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustPure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); - GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustImpure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); - GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustPure), gregtech.api.util.GT_ModHandler.getDistilledWater(200L), werkstoff.get(gem), 9500, 1500, 24); - GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustImpure), gregtech.api.util.GT_ModHandler.getDistilledWater(200L), werkstoff.get(gem), 9500, 1500, 24); - } - if (werkstoff.contains(SubTag.WASHING_MERCURY)) - GT_Values.RA.addChemicalBathRecipe(werkstoff.get(crushed), Materials.Mercury.getFluid(1000L), werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); - if (werkstoff.contains(SubTag.WASHING_SODIUMPERSULFATE)) - GT_Values.RA.addChemicalBathRecipe(werkstoff.get(crushed), Materials.SodiumPersulfate.getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L), werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); - if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_GOLD)) - GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Gold, 1L), GT_OreDictUnificator.get(nugget, Materials.Gold, 1L), new int[]{10000, 4000, 2000}, 400, 24); - else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_IRON)) - GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Iron, 1L), GT_OreDictUnificator.get(nugget, Materials.Iron, 1L), new int[]{10000, 4000, 2000}, 400, 24); - else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM)) - GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Neodymium, 1L), GT_OreDictUnificator.get(nugget, Materials.Neodymium, 1L), new int[]{10000, 4000, 2000}, 400, 24); - } - - private static void addCellRecipes(Werkstoff werkstoff) { - if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000) == 0) - return; - -// if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { -// List flOutputs = new ArrayList<>(); -// List stOutputs = new ArrayList<>(); -// HashMap> tracker = new HashMap<>(); -// int cells = 0; -// for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { -// if (container.getKey() instanceof Materials) { -// if (((Materials) container.getKey()).hasCorrespondingGas() || ((Materials) container.getKey()).hasCorrespondingFluid() || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { -// FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); -// if (tmpFl == null || tmpFl.getFluid() == null) { -// tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); -// } -// flOutputs.add(tmpFl); -// if (flOutputs.size() > 1) { -// if (!tracker.containsKey(container.getKey())) { -// stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); -// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); -// } else { -// stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); -// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); -// } -// cells += container.getValue(); -// } -// } else { -// if (((Materials) container.getKey()).getDust(container.getValue()) == null) -// continue; -// if (!tracker.containsKey(container.getKey())) { -// stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); -// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); -// } else { -// stOutputs.add(((Materials) container.getKey()).getDust(tracker.get(container.getKey()).getKey() + container.getValue())); -// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); -// } -// } -// } else if (container.getKey() instanceof Werkstoff) { -// if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) { -// FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); -// if (tmpFl == null || tmpFl.getFluid() == null) { -// tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); -// } -// flOutputs.add(tmpFl); -// if (flOutputs.size() > 1) { -// if (!tracker.containsKey(container.getKey())) { -// stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); -// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); -// } else { -// stOutputs.add(((Werkstoff) container.getKey()).get(cell, tracker.get(container.getKey()).getKey() + container.getValue())); -// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); -// } -// cells += container.getValue(); -// } -// } else { -// if (!((Werkstoff) container.getKey()).hasItemType(dust)) -// continue; -// if (!tracker.containsKey(container.getKey())) { -// stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); -// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); -// } else { -// stOutputs.add(((Werkstoff) container.getKey()).get(dust, (tracker.get(container.getKey()).getKey() + container.getValue()))); -// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); -// } -// } -// } -// } -// ItemStack input = werkstoff.get(cell); -// input.stackSize = werkstoff.getContents().getKey(); -// cells += werkstoff.getContents().getKey(); -// stOutputs.add(Materials.Empty.getCells(cells)); -// if (werkstoff.getStats().isElektrolysis()) -// GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); -// if (werkstoff.getStats().isCentrifuge()) -// GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); -// if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { -// if (cells > 0) -// stOutputs.add(Materials.Empty.getCells(cells)); -// GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0)); -// } -// if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { -// if (cells > 0) -// stOutputs.add(Materials.Empty.getCells(cells)); -// GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().mass * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0)); -// } -// } - - //Tank "Recipe" - GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(cell), Materials.Empty.getCells(1))); - FluidContainerRegistry.registerFluidContainer(werkstoff.getFluidOrGas(1).getFluid(), werkstoff.get(cell), Materials.Empty.getCells(1)); - GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), 1000), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), 1000)); - - if (LoaderReference.Forestry) { - FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(capsule), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), true); - GT_Utility.addFluidContainerData(emptyData); - FluidContainerRegistry.registerFluidContainer(emptyData); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsule), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), 1000)); - } - - if (werkstoff.hasItemType(dust)) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust), null, werkstoff.getFluidOrGas(1000), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe(GT_Utility.getIntegratedCircuit(1), werkstoff.getFluidOrGas(1000), werkstoff.get(dust), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - } - - if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { - Materials werkstoffBridgeMaterial = null; - boolean ElementSet = false; - for (Element e : Element.values()) { - if (e.toString().equals(werkstoff.getToolTip())) { - werkstoffBridgeMaterial = new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName(), werkstoff.getDefaultName()); - werkstoffBridgeMaterial.mElement = e; - e.mLinkedMaterials.add(werkstoffBridgeMaterial); - ElementSet = true; - break; - } - } - if (!ElementSet) - return; - - GT_OreDictUnificator.addAssociation(cell, werkstoffBridgeMaterial, werkstoff.get(cell), false); -// try { -// Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); -// f.setAccessible(true); -// Map MATERIALS_MAP = (Map) f.get(null); -// MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); -// } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { -// e.printStackTrace(); -// } - ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); - Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); - //GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{Materials.Empty.getCells(1)}, new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); - } - } - - private static void addMoltenRecipes(Werkstoff werkstoff) { - if (!werkstoff.hasItemType(WerkstoffLoader.cellMolten)) - return; - - //Tank "Recipe" - final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); - FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(cell), Materials.Empty.getCells(1)); - GT_Utility.addFluidContainerData(data); - GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(WerkstoffLoader.cellMolten), new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144)); - - if (LoaderReference.Forestry) { - final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); - FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); - GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsuleMolten), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144)); - } - - if (werkstoff.hasItemType(ingot)) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000000) != 0) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick), null, werkstoff.getMolten(72), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - } - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget), null, werkstoff.getMolten(16), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(1296), werkstoff.get(block), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - } else if (werkstoff.hasItemType(dust) && (werkstoff.getGenerationFeatures().toGenerate & 0b10) == 0) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall), null, werkstoff.getMolten(36), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny), null, werkstoff.getMolten(16), 0, (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - } - } - - public static void addAspectToAll(Werkstoff werkstoff){ - for (OrePrefixes enabledOrePrefixes : WerkstoffLoader.ENABLED_ORE_PREFIXES) { - if (werkstoff.hasItemType(enabledOrePrefixes)) { - if (enabledOrePrefixes.mMaterialAmount >= 3628800L || enabledOrePrefixes == OrePrefixes.ore) { - DebugLog.log("OrePrefix: " + enabledOrePrefixes.name() + " mMaterialAmount: " + enabledOrePrefixes.mMaterialAmount/3628800L); - if (Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes))) - ThaumcraftHandler.AspectAdder.addAspectViaBW( - werkstoff.get(enabledOrePrefixes), - werkstoff.getTCAspects(enabledOrePrefixes == OrePrefixes.ore ? 1 : - (int) (enabledOrePrefixes.mMaterialAmount / 3628800L)) - ); - } - else if (enabledOrePrefixes.mMaterialAmount >= 0L) { - if (Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes))) - ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(enabledOrePrefixes), new Pair<>(TC_Aspects.PERDITIO.mAspect, 1)); - } - } - } - } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java index 2df54251eb..a162f4ed45 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34,7 +34,7 @@ import static gregtech.api.enums.OrePrefixes.dustSmall; public class AfterLuVTierEnhacement { - private AfterLuVTierEnhacement(){}; + private AfterLuVTierEnhacement(){} public static void run() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/IWerkstoffRunnable.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/IWerkstoffRunnable.java new file mode 100644 index 0000000000..ae7f85ed68 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/IWerkstoffRunnable.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; + +public interface IWerkstoffRunnable { + void run(Werkstoff werkstoff); +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java new file mode 100644 index 0000000000..822706fb77 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; + +import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import com.github.bartimaeusnek.bartworks.util.Pair; +import com.github.bartimaeusnek.bartworks.util.log.DebugLog; +import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TC_Aspects; + +import java.util.Objects; + +public class AspectLoader implements IWerkstoffRunnable { + + @Override + public void run(Werkstoff werkstoff) { + if (!LoaderReference.Thaumcraft) + return; + for (OrePrefixes enabledOrePrefixes : WerkstoffLoader.ENABLED_ORE_PREFIXES) { + if (werkstoff.hasItemType(enabledOrePrefixes)) { + if (enabledOrePrefixes.mMaterialAmount >= 3628800L || enabledOrePrefixes == OrePrefixes.ore) { + DebugLog.log("OrePrefix: " + enabledOrePrefixes.name() + " mMaterialAmount: " + enabledOrePrefixes.mMaterialAmount / 3628800L); + if (Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes))) + ThaumcraftHandler.AspectAdder.addAspectViaBW( + werkstoff.get(enabledOrePrefixes), + werkstoff.getTCAspects(enabledOrePrefixes == OrePrefixes.ore ? 1 : + (int) (enabledOrePrefixes.mMaterialAmount / 3628800L)) + ); + } else if (enabledOrePrefixes.mMaterialAmount >= 0L) { + if (Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes))) + //noinspection unchecked + ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(enabledOrePrefixes), new Pair<>(TC_Aspects.PERDITIO.mAspect, 1)); + } + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java new file mode 100644 index 0000000000..369423817f --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import gregtech.api.enums.GT_Values; +import net.minecraft.item.ItemStack; + +import static gregtech.api.enums.OrePrefixes.*; + +public class BlockLoader implements IWerkstoffRunnable { + @Override + public void run(Werkstoff werkstoff) { + if (!werkstoff.hasItemType(block)) + return; + if (werkstoff.hasItemType(ingot)) { + GT_Values.RA.addArcFurnaceRecipe(werkstoff.get(block), new ItemStack[]{werkstoff.get(ingot, 9)}, null, 16, 90, false); + } + if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(block), null, werkstoff.getMolten(1296), 0, 288, 8); + } + if (werkstoff.hasItemType(plate)) { + GT_Values.RA.addCutterRecipe(werkstoff.get(block), werkstoff.get(plate, 9), null, (int) Math.max(werkstoff.getStats().getMass() * 10L, 1L), 30); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java new file mode 100644 index 0000000000..cc1f7650a3 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import gregtech.api.enums.GT_Values; +import gregtech.api.util.GT_ModHandler; +import net.minecraft.item.ItemStack; + +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasing; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasingAdvanced; +import static gregtech.api.enums.OrePrefixes.*; + +public class CasingLoader implements IWerkstoffRunnable { + @Override + public void run(Werkstoff werkstoff) { + if (!(werkstoff.hasItemType(blockCasing) || werkstoff.hasItemType(plate) || werkstoff.hasItemType(screw) || werkstoff.hasItemType(gearGt) )) + return; + + GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasing),new Object[]{ + "PSP", + "PGP", + "PSP", + 'P', werkstoff.get(plate), + 'S', werkstoff.get(screw), + 'G', werkstoff.get(gearGtSmall) + }); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + werkstoff.get(plate,6), + werkstoff.get(screw,2), + werkstoff.get(gearGtSmall) + }, GT_Values.NF,werkstoff.get(blockCasing), 200, 30); + + GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasingAdvanced),new Object[]{ + "PSP", + "PGP", + "PSP", + 'P', werkstoff.get(plateDouble), + 'S', werkstoff.get(screw), + 'G', werkstoff.get(gearGt) + }); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + werkstoff.get(plateDouble,6), + werkstoff.get(screw,2), + werkstoff.get(gearGt) + }, GT_Values.NF,werkstoff.get(blockCasingAdvanced), 200, 30); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java new file mode 100644 index 0000000000..ab589c3bec --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; + +import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import gregtech.api.enums.Element; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.items.behaviors.Behaviour_DataOrb; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; + +import java.util.Objects; + +import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.OrePrefixes.cell; + +public class CellLoader implements IWerkstoffRunnable { + @Override + public void run(Werkstoff werkstoff) { + if (!werkstoff.hasItemType(cell)) + return; + +// if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { +// List flOutputs = new ArrayList<>(); +// List stOutputs = new ArrayList<>(); +// HashMap> tracker = new HashMap<>(); +// int cells = 0; +// for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { +// if (container.getKey() instanceof Materials) { +// if (((Materials) container.getKey()).hasCorrespondingGas() || ((Materials) container.getKey()).hasCorrespondingFluid() || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { +// FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); +// if (tmpFl == null || tmpFl.getFluid() == null) { +// tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); +// } +// flOutputs.add(tmpFl); +// if (flOutputs.size() > 1) { +// if (!tracker.containsKey(container.getKey())) { +// stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); +// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); +// } else { +// stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); +// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); +// } +// cells += container.getValue(); +// } +// } else { +// if (((Materials) container.getKey()).getDust(container.getValue()) == null) +// continue; +// if (!tracker.containsKey(container.getKey())) { +// stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); +// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); +// } else { +// stOutputs.add(((Materials) container.getKey()).getDust(tracker.get(container.getKey()).getKey() + container.getValue())); +// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); +// } +// } +// } else if (container.getKey() instanceof Werkstoff) { +// if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) { +// FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); +// if (tmpFl == null || tmpFl.getFluid() == null) { +// tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); +// } +// flOutputs.add(tmpFl); +// if (flOutputs.size() > 1) { +// if (!tracker.containsKey(container.getKey())) { +// stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); +// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); +// } else { +// stOutputs.add(((Werkstoff) container.getKey()).get(cell, tracker.get(container.getKey()).getKey() + container.getValue())); +// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); +// } +// cells += container.getValue(); +// } +// } else { +// if (!((Werkstoff) container.getKey()).hasItemType(dust)) +// continue; +// if (!tracker.containsKey(container.getKey())) { +// stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); +// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); +// } else { +// stOutputs.add(((Werkstoff) container.getKey()).get(dust, (tracker.get(container.getKey()).getKey() + container.getValue()))); +// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); +// } +// } +// } +// } +// ItemStack input = werkstoff.get(cell); +// input.stackSize = werkstoff.getContents().getKey(); +// cells += werkstoff.getContents().getKey(); +// stOutputs.add(Materials.Empty.getCells(cells)); +// if (werkstoff.getStats().isElektrolysis()) +// GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().getProtons() * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); +// if (werkstoff.getStats().isCentrifuge()) +// GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().getMass() * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); +// if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { +// if (cells > 0) +// stOutputs.add(Materials.Empty.getCells(cells)); +// GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().getProtons() * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0)); +// } +// if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { +// if (cells > 0) +// stOutputs.add(Materials.Empty.getCells(cells)); +// GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().getMass() * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0)); +// } +// } + + //Tank "Recipe" + GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(cell), Materials.Empty.getCells(1))); + FluidContainerRegistry.registerFluidContainer(werkstoff.getFluidOrGas(1).getFluid(), werkstoff.get(cell), Materials.Empty.getCells(1)); + GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)); + + if (LoaderReference.Forestry) { + FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(capsule), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), true); + GT_Utility.addFluidContainerData(emptyData); + FluidContainerRegistry.registerFluidContainer(emptyData); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsule), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)); + } + + if (werkstoff.hasItemType(dust)) { + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust), null, werkstoff.getFluidOrGas(1000), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe(GT_Utility.getIntegratedCircuit(1), werkstoff.getFluidOrGas(1000), werkstoff.get(dust), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + } + + if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { + Materials werkstoffBridgeMaterial = null; + boolean ElementSet = false; + for (Element e : Element.values()) { + if (e.toString().equals(werkstoff.getToolTip())) { + werkstoffBridgeMaterial = new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName(), werkstoff.getDefaultName()); + werkstoffBridgeMaterial.mElement = e; + e.mLinkedMaterials.add(werkstoffBridgeMaterial); + ElementSet = true; + break; + } + } + if (!ElementSet) + return; + + GT_OreDictUnificator.addAssociation(cell, werkstoffBridgeMaterial, werkstoff.get(cell), false); +// try { +// Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); +// f.setAccessible(true); +// Map MATERIALS_MAP = (Map) f.get(null); +// MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); +// } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { +// e.printStackTrace(); +// } + ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); + Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); + //GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{Materials.Empty.getCells(1)}, new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java new file mode 100644 index 0000000000..0302f12a59 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_ModHandler; +import gregtech.common.GT_Proxy; +import net.minecraft.item.ItemStack; + +import static gregtech.api.enums.OrePrefixes.*; + +public class CraftingMaterialLoader implements IWerkstoffRunnable { + @Override + public void run(Werkstoff werkstoff) { + if (werkstoff.hasItemType(screw)) { + int tVoltageMultiplier = werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15; + + //bolt + GT_Values.RA.addExtruderRecipe(werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(ingot), ItemList.Shape_Extruder_Bolt.get(0L), werkstoff.get(bolt, 8), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 8 * tVoltageMultiplier); + GT_Values.RA.addCutterRecipe(werkstoff.get(stick), werkstoff.get(bolt, 4), null, (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 4); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(bolt), new ItemStack[]{werkstoff.get(dustTiny, 1)}, null, 2, 8); + + //screw + GT_Values.RA.addLatheRecipe(werkstoff.get(bolt), werkstoff.get(screw), null, (int) Math.max(werkstoff.getStats().getMass() / 8L, 1L), 4); + GT_ModHandler.addCraftingRecipe(werkstoff.get(screw), GT_Proxy.tBits, new Object[]{"fX", "X ", 'X', werkstoff.get(bolt)}); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(screw), new ItemStack[]{werkstoff.get(dustTiny, 1)}, null, 2, 8); + + if (werkstoff.hasItemType(gem)) + return; + + //ring + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Ring.get(0L), werkstoff.get(ring, 4), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 6 * tVoltageMultiplier); + GT_ModHandler.addCraftingRecipe(werkstoff.get(ring), GT_Proxy.tBits, new Object[]{"h ", "fX", 'X', werkstoff.get(stick)}); + + //Gear + GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGt), GT_Proxy.tBits, new Object[]{"SPS", "PwP", "SPS", 'P', werkstoff.get(plate), 'S', werkstoff.get(stick)}); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 4), ItemList.Shape_Extruder_Gear.get(0L), werkstoff.get(gearGt), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1), 8 * tVoltageMultiplier); + + //wireFine + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Wire.get(0L), werkstoff.get(wireFine, 8), (int) Math.max(werkstoff.getStats().getMass() * 1.5F, 1F), 8 * tVoltageMultiplier); + GT_Values.RA.addWiremillRecipe(werkstoff.get(ingot), werkstoff.get(wireFine, 8), (int) Math.max(werkstoff.getStats().getMass(), 1), 8 * tVoltageMultiplier); + GT_Values.RA.addWiremillRecipe(werkstoff.get(stick), werkstoff.get(wireFine, 4), (int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F), 8 * tVoltageMultiplier); + + //smallGear + if (WerkstoffLoader.smallGearShape != null) + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), WerkstoffLoader.smallGearShape.get(0L), werkstoff.get(gearGtSmall), (int) werkstoff.getStats().getMass(), 8 * tVoltageMultiplier); + if (ConfigHandler.hardmode) + GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{" S ", "hPx", " S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate)}); + else + GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{"P ", " h ", 'P', werkstoff.get(plate)}); + + //Rotor + GT_ModHandler.addCraftingRecipe(werkstoff.get(rotor), GT_Proxy.tBits, new Object[]{"PhP", "SRf", "PdP", 'P', werkstoff.get(plate), 'R', werkstoff.get(ring), 'S', werkstoff.get(screw)}); + GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.Tin.getMolten(32), werkstoff.get(rotor), 240, 24); + GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.Lead.getMolten(48), werkstoff.get(rotor), 240, 24); + GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.SolderingAlloy.getMolten(16), werkstoff.get(rotor), 240, 24); + + if (WerkstoffLoader.rotorShape != null) + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 5), WerkstoffLoader.rotorShape.get(0L), werkstoff.get(rotor), 200, 60); + + //molten -> metal + if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear.get(0L), werkstoff.getMolten(576), werkstoff.get(gearGt), 128, 8); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear_Small.get(0L), werkstoff.getMolten(144), werkstoff.get(gearGtSmall), 16, 8); + if (WerkstoffLoader.ringMold != null) + GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.ringMold.get(0L), werkstoff.getMolten(36), werkstoff.get(ring), 100, 4 * tVoltageMultiplier); + if (WerkstoffLoader.boltMold != null) + GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.boltMold.get(0L), werkstoff.getMolten(18), werkstoff.get(bolt), 50, 2 * tVoltageMultiplier); + + if (WerkstoffLoader.rotorMold != null) + GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.rotorMold.get(0L), werkstoff.getMolten(612), werkstoff.get(rotor), 100, 60); + } + + GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGt), new ItemStack[]{werkstoff.get(dust, 4)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGtSmall), new ItemStack[]{werkstoff.get(dust, 1)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(rotor), new ItemStack[]{werkstoff.get(dust, 4), werkstoff.get(dustSmall)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(ring), new ItemStack[]{werkstoff.get(dustSmall, 1)}, null, 2, 8); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java new file mode 100644 index 0000000000..e0c44aed4d --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import gregtech.GT_Mod; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.SubTag; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; + +import static gregtech.api.enums.OrePrefixes.*; + +public class CrushedLoader implements IWerkstoffRunnable { + @Override + public void run(Werkstoff werkstoff) { + if (!werkstoff.hasItemType(ore) || !werkstoff.hasItemType(dust)) + return; + + if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) { + if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { + GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushed), werkstoff.get(nugget, 10)); + GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedPurified), werkstoff.get(nugget, 10)); + GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(nugget, 10)); + } else { + GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushed), werkstoff.get(ingot)); + GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedPurified), werkstoff.get(ingot)); + GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(ingot)); + } + GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustImpure), werkstoff.get(ingot)); + GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustPure), werkstoff.get(ingot)); + GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); + } + + GT_ModHandler.addCraftingRecipe(werkstoff.get(dustImpure), new Object[]{"h ", "W ", 'W', werkstoff.get(crushed)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(dustPure), new Object[]{"h ", "W ", 'W', werkstoff.get(crushedPurified)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{"h ", "W ", 'W', werkstoff.get(crushedCentrifuged)}); + + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), 10, 16); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), werkstoff.getOreByProduct(0, dust), 10, false); + GT_ModHandler.addOreWasherRecipe(werkstoff.get(crushed), 1000, werkstoff.get(crushedPurified), werkstoff.getOreByProduct(0, dustTiny), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); + GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushed), (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dustTiny), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); + + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), 10, 16); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), werkstoff.getOreByProduct(1, dust), 10, false); + GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushedPurified), (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dustTiny)); + + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(dust), 10, 16); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(dust), werkstoff.getOreByProduct(2, dust), 10, false); + + GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustImpure), 0, werkstoff.get(dust), werkstoff.getOreByProduct(0, dustTiny), null, null, null, null, (int) Math.max(1L, werkstoff.getStats().getMass() * 8L)); + GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustPure), 0, werkstoff.get(dust), werkstoff.getOreByProduct(1, dustTiny), null, null, null, null, (int) Math.max(1L, werkstoff.getStats().getMass() * 8L)); + + if (werkstoff.contains(SubTag.CRYSTALLISABLE)) { + GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustPure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); + GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustImpure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); + GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustPure), gregtech.api.util.GT_ModHandler.getDistilledWater(200L), werkstoff.get(gem), 9500, 1500, 24); + GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustImpure), gregtech.api.util.GT_ModHandler.getDistilledWater(200L), werkstoff.get(gem), 9500, 1500, 24); + } + if (werkstoff.contains(SubTag.WASHING_MERCURY)) + GT_Values.RA.addChemicalBathRecipe(werkstoff.get(crushed), Materials.Mercury.getFluid(1000L), werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); + if (werkstoff.contains(SubTag.WASHING_SODIUMPERSULFATE)) + GT_Values.RA.addChemicalBathRecipe(werkstoff.get(crushed), Materials.SodiumPersulfate.getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L), werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); + if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_GOLD)) + GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Gold, 1L), GT_OreDictUnificator.get(nugget, Materials.Gold, 1L), new int[]{10000, 4000, 2000}, 400, 24); + else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_IRON)) + GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Iron, 1L), GT_OreDictUnificator.get(nugget, Materials.Iron, 1L), new int[]{10000, 4000, 2000}, 400, 24); + else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM)) + GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Neodymium, 1L), GT_OreDictUnificator.get(nugget, Materials.Neodymium, 1L), new int[]{10000, 4000, 2000}, 400, 24); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java new file mode 100644 index 0000000000..8f79fc85bc --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.Pair; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.TextureSet; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import static gregtech.api.enums.OrePrefixes.*; + +public class DustLoader implements IWerkstoffRunnable { + + @Override + @SuppressWarnings("unchecked") + public void run(Werkstoff werkstoff) { + if (werkstoff.hasItemType(dust)) { + List flOutputs = new ArrayList<>(); + List stOutputs = new ArrayList<>(); + HashMap> tracker = new HashMap<>(); + int cells = 0; + + if (werkstoff.getGenerationFeatures().hasMixerRecipes() || werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { + for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { + if (container.getKey() instanceof Materials) { + if (((Materials) container.getKey()).getGas(0) != null || ((Materials) container.getKey()).getFluid(0) != null || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { + FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); + if (tmpFl == null || tmpFl.getFluid() == null) { + tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); + } + flOutputs.add(tmpFl); + if (flOutputs.size() > 1) { + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + } else { + stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + } + cells += container.getValue(); + } + } else { + if (((Materials) container.getKey()).getDust(container.getValue()) == null) { + if (((Materials) container.getKey()).getCells(container.getValue()) != null && (((Materials) container.getKey()).getMolten(0) != null || ((Materials) container.getKey()).getSolid(0) != null)) { + FluidStack tmpFl = ((Materials) container.getKey()).getMolten(1000 * container.getValue()); + if (tmpFl == null || tmpFl.getFluid() == null) { + tmpFl = ((Materials) container.getKey()).getSolid(1000 * container.getValue()); + } + flOutputs.add(tmpFl); + if (flOutputs.size() > 1) { + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + } else { + stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + } + cells += container.getValue(); + } + } else + continue; + } + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + } else { + stOutputs.add(((Materials) container.getKey()).getDust(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + } + } + } else if (container.getKey() instanceof Werkstoff) { + if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) { + FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); + if (tmpFl == null || tmpFl.getFluid() == null) { + tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); + } + flOutputs.add(tmpFl); + if (flOutputs.size() > 1) { + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + } else { + stOutputs.add(((Werkstoff) container.getKey()).get(cell, tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + } + cells += container.getValue(); + } + } else { + if (!((Werkstoff) container.getKey()).hasItemType(dust)) + continue; + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + } else { + stOutputs.add(((Werkstoff) container.getKey()).get(dust, (tracker.get(container.getKey()).getKey() + container.getValue()))); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + } + } + } + } + ItemStack input = werkstoff.get(dust); + input.stackSize = werkstoff.getContents().getKey(); + if (werkstoff.getStats().isElektrolysis()) + GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().getProtons() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); + if (werkstoff.getStats().isCentrifuge()) + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().getMass() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); + if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { + if (cells > 0) + stOutputs.add(Materials.Empty.getCells(cells)); + GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().getProtons() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); + GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().getProtons() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); + } + if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { + if (cells > 0) + stOutputs.add(Materials.Empty.getCells(cells)); + GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().getMass() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); + } + } + + GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{ + "TTT", "TTT", "TTT", 'T', + werkstoff.get(dustTiny) + }); + GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{ + "TT ", "TT ", 'T', + WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff) + }); + GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff, 4), new Object[]{ + " T ", 'T', werkstoff.get(dust) + }); + GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff, 9), new Object[]{ + "T ", 'T', werkstoff.get(dust) + }); + + GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny, 9), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall, 4), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny, 9), ItemList.Schematic_3by3.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall, 4), ItemList.Schematic_2by2.get(0L), werkstoff.get(dust), 100, 4); + + if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) { + GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); + GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustTiny), werkstoff.get(nugget)); + } else if (werkstoff.hasItemType(ingot) && werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().getMeltingPoint() != 0) { + if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)) { + GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Nitrogen.getGas(1000), null, werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint(), 120, werkstoff.getStats().getMeltingPoint()); + } else if (werkstoff.contains(WerkstoffLoader.NOBLE_GAS_SMELTING)) { + GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Argon.getGas(1000), null, werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint(), 120, werkstoff.getStats().getMeltingPoint()); + } else { + GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint(), 120, werkstoff.getStats().getMeltingPoint()); + if (werkstoff.getStats().getMeltingPoint() <= 1000) { + GT_Values.RA.addPrimitiveBlastRecipe(werkstoff.get(dust), null, 9, werkstoff.get(ingot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint()); + GT_ModHandler.addRCBlastFurnaceRecipe(werkstoff.get(ingot), werkstoff.get(dust), werkstoff.getStats().getMeltingPoint()); + } + } + } + + if (werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().getMeltingPoint() > 1750) { + GT_Values.RA.addVacuumFreezerRecipe(werkstoff.get(ingotHot), werkstoff.get(ingot), (int) Math.max(werkstoff.getStats().getMass() * 3L, 1L)); + } + + if (werkstoff.hasItemType(ingot)) { + GT_ModHandler.addPulverisationRecipe(werkstoff.get(ingot), werkstoff.get(dust)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(nugget), werkstoff.get(dustTiny)); + } + if (werkstoff.hasItemType(ingot) || werkstoff.hasItemType(gem)) { + GT_ModHandler.addPulverisationRecipe(werkstoff.get(block), werkstoff.get(dust, 9)); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java new file mode 100644 index 0000000000..c020c3394d --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures; +import gregtech.api.objects.GT_MultiTexture; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +import static gregtech.api.enums.OrePrefixes.*; + +public class GemLoader implements IWerkstoffRunnable { + + @Override + public void run(Werkstoff werkstoff) { + if (werkstoff.hasItemType(gem)) { + if (werkstoff.getGenerationFeatures().hasSifterRecipes() || (werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust))) { + + GT_ModHandler.addCompressionRecipe(werkstoff.get(gem, 9), werkstoff.get(block)); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(block), werkstoff.get(gem, 9), 100, 24); + GT_Values.RA.addSifterRecipe( + werkstoff.get(crushedPurified), + new ItemStack[]{ + werkstoff.get(gemExquisite), + werkstoff.get(gemFlawless), + werkstoff.get(gem), + werkstoff.get(gemFlawed), + werkstoff.get(gemChipped), + werkstoff.get(dust) + }, + new int[]{ + 200, 1000, 2500, 2000, 4000, 5000 + }, + 800, + 16 + ); + } + + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemExquisite), werkstoff.get(dust, 4)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawless), werkstoff.get(dust, 2)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gem), werkstoff.get(dust)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawed), werkstoff.get(dustSmall, 2)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemChipped), werkstoff.get(dustSmall)); + + GT_ModHandler.addCraftingRecipe(werkstoff.get(gemFlawless, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gemExquisite)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(gem, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gemFlawless)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(gemFlawed, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gem)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(gemChipped, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gemFlawed)}); + + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemExquisite), werkstoff.get(gemFlawless, 2), 64, 16); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawless), werkstoff.get(gem, 2), 64, 16); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gem), werkstoff.get(gemFlawed, 2), 64, 16); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawed), werkstoff.get(gemChipped, 2), 64, 16); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemChipped), werkstoff.get(dustTiny), 64, 16); + + if (!werkstoff.contains(WerkstoffLoader.NO_BLAST)) { + GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawless, 3), 8, werkstoff.get(gemExquisite), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(gem, 3), 8, werkstoff.get(gemFlawless), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawed, 3), 8, werkstoff.get(gem), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe(werkstoff.get(gemChipped, 3), 8, werkstoff.get(gemFlawed), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + + GT_Values.RA.addImplosionRecipe(werkstoff.get(dust, 4), 24, werkstoff.get(gem, 3), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)); + } + + if (werkstoff.hasItemType(plate)) { + GT_Values.RA.addLatheRecipe(werkstoff.get(plate), werkstoff.get(lens), werkstoff.get(dustSmall), 1200, 120); + } + + GT_Values.RA.addLatheRecipe(werkstoff.get(gemExquisite), werkstoff.get(lens), werkstoff.get(dust, 2), 2400, 30); + GregTech_API.registerCover(werkstoff.get(lens), new GT_MultiTexture(Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false)), new gregtech.common.covers.GT_Cover_Lens(BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex)); + GT_ModHandler.addPulverisationRecipe(werkstoff.get(lens), werkstoff.get(dustSmall, 3)); + + for (ItemStack is : OreDictionary.getOres("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) { + is.stackSize = 0; + GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemChipped, 3), is, werkstoff.get(gemFlawed, 1), 600, 30); + GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemFlawed, 3), is, werkstoff.get(gem, 1), 600, 120); + GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gem, 3), is, werkstoff.get(gemFlawless, 1), 1200, 480); + GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemFlawless, 3), is, werkstoff.get(gemExquisite, 1), 2400, 2000); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java new file mode 100644 index 0000000000..9db7e8f26a --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.util.GT_ModHandler; + +import static gregtech.api.enums.OrePrefixes.block; +import static gregtech.api.enums.OrePrefixes.ingot; + +public class MetalLoader implements IWerkstoffRunnable { + @Override + public void run(Werkstoff werkstoff) { + if (werkstoff.hasItemType(ingot)) { + GT_ModHandler.addCompressionRecipe(werkstoff.get(ingot, 9), werkstoff.get(block)); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 9), ItemList.Shape_Extruder_Block.get(0), werkstoff.get(block), (int) werkstoff.getStats().getMass(), 8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); + GT_Values.RA.addAlloySmelterRecipe(werkstoff.get(ingot, 9), ItemList.Shape_Mold_Block.get(0L), werkstoff.get(block), (int) (werkstoff.getStats().getMass() / 2), 4 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java new file mode 100644 index 0000000000..68cca299c2 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; + +import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; + +import java.util.Objects; + +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.capsuleMolten; +import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.OrePrefixes.dustTiny; + +public class MoltenCellLoader implements IWerkstoffRunnable { + @Override + public void run(Werkstoff werkstoff) { + if (!werkstoff.hasItemType(WerkstoffLoader.cellMolten)) + return; + + //Tank "Recipe" + final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); + FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(cell), Materials.Empty.getCells(1)); + GT_Utility.addFluidContainerData(data); + GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(WerkstoffLoader.cellMolten), new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); + + if (LoaderReference.Forestry) { + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + GT_Utility.addFluidContainerData(emptyData); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsuleMolten), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); + } + + if (werkstoff.hasItemType(ingot)) { + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + if (werkstoff.hasItemType(plate)) { + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick), null, werkstoff.getMolten(72), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + } + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget), null, werkstoff.getMolten(16), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(1296), werkstoff.get(block), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + } else { + if (werkstoff.hasItemType(dust)) { + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall), null, werkstoff.getMolten(36), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny), null, werkstoff.getMolten(16), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java new file mode 100644 index 0000000000..67e82dab29 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; + +import static gregtech.api.enums.OrePrefixes.*; + +public class MultipleMetalLoader implements IWerkstoffRunnable { + @Override + public void run(Werkstoff werkstoff) { + if (werkstoff.hasItemType(plateDense)) { + GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{werkstoff.get(ingot, 2), GT_Utility.getIntegratedCircuit(2)}, new ItemStack[]{werkstoff.get(plateDouble)}, null, null, null, null, (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), 60, 0)); + GregTech_API.registerCover(werkstoff.get(plateDouble), new GT_RenderedTexture(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false), null); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(plateDouble), new ItemStack[]{werkstoff.get(dust, 2)}, null, 2, 8); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java new file mode 100644 index 0000000000..7700ff74c6 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.SubTag; +import gregtech.api.util.GT_ModHandler; + +import static gregtech.api.enums.OrePrefixes.*; + +public class OreLoader implements IWerkstoffRunnable { + @Override + public void run(Werkstoff werkstoff) { + if (werkstoff.hasItemType(ore) && werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) + GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), werkstoff.get(ingot)); + + if (werkstoff.hasItemType(ore)) { + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ore), werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(crushed), 16, 10); + GT_ModHandler.addPulverisationRecipe( + werkstoff.get(ore), + werkstoff.get(crushed, 2), + werkstoff.contains(SubTag.CRYSTAL) ? werkstoff.get(gem) : werkstoff.getOreByProduct(0, dust), + werkstoff.getNoOfByProducts() > 0 ? 10 : 0, + Materials.Stone.getDust(1), + 50, + true); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java new file mode 100644 index 0000000000..e4360f66ef --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; + +import com.github.bartimaeusnek.bartworks.API.SideReference; +import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.TextureSet; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Proxy; +import net.minecraft.item.ItemStack; + +import static gregtech.api.enums.OrePrefixes.*; + +public class SimpleMetalLoader implements IWerkstoffRunnable { + @Override + public void run(Werkstoff werkstoff) { + if (werkstoff.hasItemType(plate)) { + if (werkstoff.hasItemType(gem)) { + GT_Values.RA.addLatheRecipe(werkstoff.get(gem), werkstoff.get(stick), werkstoff.get(dustSmall, 2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); + GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(gem)}); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); + + TextureSet texSet = werkstoff.getTexSet(); + GT_RenderedTexture texture = SideReference.Side.Client ? + new GT_RenderedTexture(texSet.mTextures[PrefixTextureLinker.blockTexMap.getOrDefault(texSet, block.mTextureIndex)], werkstoff.getRGBA(), false) : + new GT_RenderedTexture(texSet.mTextures[block.mTextureIndex], werkstoff.getRGBA(), false); + GregTech_API.registerCover(werkstoff.get(plate),texture,null); + + GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); + return; + } + + GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(ingot)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(plate), GT_Proxy.tBits, new Object[]{"h", "X", "X", 'X', werkstoff.get(ingot)}); + + GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(1)}, new ItemStack[]{werkstoff.get(plate)}, null, null, null, null, (int) Math.max(werkstoff.getStats().getMass(), 1L), 24, 0)); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ingot, 3), werkstoff.get(plate, 2), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); + GregTech_API.registerCover(werkstoff.get(plate), new GT_RenderedTexture(werkstoff.getTexSet().mTextures[71], werkstoff.getRGBA(), false), null); + + GT_Values.RA.addLatheRecipe(werkstoff.get(ingot), werkstoff.get(stick), werkstoff.get(dustSmall, 2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); + + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); + + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Plate.get(0), werkstoff.get(plate), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Rod.get(0), werkstoff.get(stick, 2), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); + + GT_Values.RA.addPulveriserRecipe(werkstoff.get(ingot), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(stickLong), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(stick), new ItemStack[]{werkstoff.get(dustSmall, 2)}, null, 2, 8); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java new file mode 100644 index 0000000000..9b14e0f334 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.common.GT_Proxy; +import gregtech.common.items.GT_MetaGenerated_Tool_01; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.gtnhGT; +import static gregtech.api.enums.OrePrefixes.*; + +public class ToolLoader implements IWerkstoffRunnable { + + //GTNH-Specific + public static final short SCREWDRIVER_MV = 152; + public static final short SCREWDRIVER_HV = 154; + public static final short SOLDERING_IRON_MV = 162; + public static final short SOLDERING_IRON_HV = 164; + + public void run(Werkstoff werkstoff) { + if (werkstoff.getBridgeMaterial().mDurability == 0) + return; + + if (werkstoff.hasItemType(gem)) { + if (!werkstoff.getGenerationFeatures().isExtension()) + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', gem.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"GGf", 'G', gem.get(werkstoff.getBridgeMaterial())}); + } + + if (!werkstoff.hasItemType(plate)) + return; + + //Disable recipe gen with handle Material for GT Materials + if (!werkstoff.getGenerationFeatures().isExtension()) { + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{" fS", " Sh", "W ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadWrench, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"hXW", "XRX", "WXd", 'X', plate.get(werkstoff.getBridgeMaterial()), 'S', plate.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'R', ring.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'W', screw.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{toolHeadHammer.get(werkstoff.getBridgeMaterial()), stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.FILE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P", "P", "S", 'P', plate.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SAW, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), new Object[]{toolHeadSaw.get(werkstoff.getBridgeMaterial()), stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.AnyRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_LV_Lithium.get(1L)}); + + if (gtnhGT) { + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SOLDERING_IRON_MV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.AnyRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_MV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SOLDERING_IRON_HV, 1, werkstoff.getBridgeMaterial(), Materials.StyreneButadieneRubber, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.StyreneButadieneRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_HV_Lithium.get(1L)}); + } + + if (!werkstoff.hasItemType(gem)) { + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', ingot.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + } + } + + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.PLUNGER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"xRR", " SR", "S f", 'S', stick.get(werkstoff.getBridgeMaterial()), 'R', plate.get(Materials.AnyRubber)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', ingot.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"hDS", "DSD", "SDf", 'S', stick.get(werkstoff.getBridgeMaterial()), 'D', Dyes.dyeBlue}); + + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WIRECUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "hPd", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCOOP, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SWS", "SSS", "xSh", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', new ItemStack(Blocks.wool, 1, 32767)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BRANCHCUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "PdP", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.KNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"fPh", " S ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PPf", "PP ", "Sh ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial())}); + + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); + + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); + + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"II ", "IIh", "II ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', ingot.get(werkstoff.getBridgeMaterial())}); + + if (!werkstoff.hasItemType(gem)) { + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"PP ", "fh ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', ingot.get(werkstoff.getBridgeMaterial())}); + } + + if (gtnhGT) { + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); + } + + // GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(16,1, werkstoff.getBridgeMaterial(),werkstoff.getBridgeMaterial(),null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', werkstoff.get(ingot)}); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/AssociationLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/AssociationLoader.java new file mode 100644 index 0000000000..44c35c8543 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/AssociationLoader.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; +import net.minecraft.item.ItemStack; + +public class AssociationLoader implements IWerkstoffRunnable { + @Override + public void run(Werkstoff werkstoff) { + for (OrePrefixes prefixes : OrePrefixes.values()) { + if (!werkstoff.hasItemType(prefixes)) + continue; + + Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial(); + ItemStack stack = WerkstoffLoader.getCorrespondingItemStackUnsafe(prefixes, werkstoff, 1); + + if (stack != null && stack.getItem() != null) { + GT_OreDictUnificator.addAssociation(prefixes, werkstoffBridgeMaterial, stack, false); + GT_OreDictUnificator.set(prefixes, werkstoffBridgeMaterial, stack, true, true); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java new file mode 100644 index 0000000000..f61ce70c81 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration; + +import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import gregtech.api.enchants.Enchantment_Radioactivity; +import gregtech.api.enums.*; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.common.items.behaviors.Behaviour_DataOrb; +import net.minecraft.item.ItemStack; + +import java.lang.reflect.Field; +import java.util.ArrayList; + +import static gregtech.api.enums.OrePrefixes.*; + +public class BridgeMaterialsLoader implements IWerkstoffRunnable { + + @Override + public void run(Werkstoff werkstoff) { + //int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, String aConfigSection, boolean aCustomOre, String aCustomID + Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : + new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(), 0, werkstoff.getRGBA()[0], werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getVarName(), werkstoff.getDefaultName(), 0, 0, werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().isBlastFurnace(), false, 0, 1, 1, null); + for (OrePrefixes prefixes : values()) { + if (!(prefixes == cell && werkstoff.getType().equals(Werkstoff.Types.ELEMENT))) { + if (prefixes == dust && werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { + if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { + boolean ElementSet = false; + for (Element e : Element.values()) { + if (e.toString().equals(werkstoff.getToolTip())) { + if (e.mLinkedMaterials.size() > 0) + break; + werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : + new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(), 0, werkstoff.getRGBA()[0], werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getVarName(), werkstoff.getDefaultName(), 0, 0, werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().isBlastFurnace(), false, 0, 1, 1, null); + werkstoffBridgeMaterial.mElement = e; + e.mLinkedMaterials = new ArrayList<>(); + e.mLinkedMaterials.add(werkstoffBridgeMaterial); + if (werkstoff.hasItemType(dust)) { + GT_OreDictUnificator.addAssociation(dust, werkstoffBridgeMaterial, werkstoff.get(dust), false); + GT_OreDictUnificator.set(dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true); + } + ElementSet = true; + break; + } + } + if (!ElementSet) + continue; +// try { +// Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); +// f.setAccessible(true); +// Map MATERIALS_MAP = (Map) f.get(null); +// MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); +// } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { +// e.printStackTrace(); +// } + if (werkstoff.hasItemType(dust)) { + ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); + Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(prefixes)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); + //GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, null, new ItemStack[]{werkstoff.get(prefixes)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); + } + } + } + + if (werkstoff.hasItemType(cell)) { + werkstoffBridgeMaterial.setHasCorrespondingFluid(true); + werkstoffBridgeMaterial.setHasCorrespondingGas(true); + werkstoffBridgeMaterial.mFluid = werkstoff.getFluidOrGas(1).getFluid(); + werkstoffBridgeMaterial.mGas = werkstoff.getFluidOrGas(1).getFluid(); + } + + if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { + werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid(); + } + werkstoffBridgeMaterial.mName = werkstoff.getVarName(); + werkstoffBridgeMaterial.mDefaultLocalName = werkstoff.getDefaultName(); + try { + Field f = Materials.class.getField("mLocalizedName"); + f.set(werkstoffBridgeMaterial, werkstoff.getDefaultName()); + } catch (NoSuchFieldException | IllegalAccessException ignored) { + } + werkstoffBridgeMaterial.mChemicalFormula = werkstoff.getToolTip(); + if (LoaderReference.Thaumcraft) + werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects(); + werkstoffBridgeMaterial.mMaterialInto = werkstoffBridgeMaterial; + werkstoffBridgeMaterial.mHandleMaterial = werkstoff.contains(SubTag.BURNING) ? Materials.Blaze : werkstoff.contains(SubTag.MAGICAL) ? Materials.Thaumium : werkstoffBridgeMaterial.mDurability > 5120 ? Materials.TungstenSteel : werkstoffBridgeMaterial.mDurability > 1280 ? Materials.Steel : Materials.Wood; + if (werkstoff.getStats().isRadioactive()) { + werkstoffBridgeMaterial.setEnchantmentForArmors(Enchantment_Radioactivity.INSTANCE, werkstoff.getStats().getEnchantmentlvl()); + werkstoffBridgeMaterial.setEnchantmentForTools(Enchantment_Radioactivity.INSTANCE, werkstoff.getStats().getEnchantmentlvl()); + } + werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); + //if (WerkstoffLoader.items.get(prefixes) != null) + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java new file mode 100644 index 0000000000..8ffd3ea552 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; +import gregtech.api.util.GT_OreDictUnificator; +import net.minecraft.item.ItemStack; + +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasing; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasingAdvanced; + +public class CasingRegistrator implements IWerkstoffRunnable { + @Override + public void run(Werkstoff werkstoff) { + GT_OreDictUnificator.addAssociation( + blockCasing, werkstoff.getBridgeMaterial(), + new ItemStack(WerkstoffLoader.BWBlockCasings, 1, werkstoff.getmID()), + false + ); + GT_OreDictUnificator.addAssociation( + blockCasingAdvanced, werkstoff.getBridgeMaterial(), + new ItemStack(WerkstoffLoader.BWBlockCasingsAdvanced, 1, werkstoff.getmID()), + false + ); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java index 2aeb8cef35..8d4fe889cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java index 9269762a22..afa6aaa98a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java index 9aa46ae3b2..bf077f47e1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java index 3def3800d5..6677e6ab79 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index b8fda6a8dc..87b1abdd4e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java index 6f32b0007b..f0682e53b4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 6429cece69..f8b0aac053 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -58,7 +58,7 @@ import java.util.stream.Collectors; import static gregtech.api.enums.GT_Values.*; -@SuppressWarnings("unused") +@SuppressWarnings({"unused","RedundantSuppression"}) public class BW_Util { public static final int STANDART = 0; @@ -357,7 +357,11 @@ public class BW_Util { * @param aDuration - recipe Duration * @param mAmperage - should be 1 ? */ - public static void calculateOverclockedNessMulti(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, GT_MetaTileEntity_MultiBlockBase base) { + public static void calculateOverclockedNessMulti(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, @Nonnull GT_MetaTileEntity_MultiBlockBase base) { + calculateOverclockednessMultiInternal(aEUt, aDuration, mAmperage, maxInputVoltage, base, 2); + } + + private static void calculateOverclockednessMultiInternal(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, @Nonnull GT_MetaTileEntity_MultiBlockBase base, @Nonnegative int modifier){ byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); if (mTier == 0) { //Long time calculation @@ -367,7 +371,7 @@ public class BW_Util { base.mEUt = Integer.MAX_VALUE - 1; base.mMaxProgresstime = Integer.MAX_VALUE - 1; } else { - base.mEUt = aEUt >> 2; + base.mEUt = aEUt >> modifier; base.mMaxProgresstime = (int) xMaxProgresstime; } } else { @@ -379,62 +383,23 @@ public class BW_Util { base.mMaxProgresstime = aDuration; while (tempEUt <= V[mTier - 1] * mAmperage) { - tempEUt <<= 2;//this actually controls overclocking + tempEUt <<= modifier;//this actually controls overclocking //xEUt *= 4;//this is effect of everclocking base.mMaxProgresstime >>= 1;//this is effect of overclocking xEUt = base.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power } - while (xEUt > maxInputVoltage){ + while (xEUt > maxInputVoltage && xEUt >= aEUt){ //downclock one notch until we are good again, we have overshot. - xEUt >>=2; + xEUt >>= modifier; base.mMaxProgresstime <<= 1; } - if (xEUt > Integer.MAX_VALUE - 1) { - base.mEUt = Integer.MAX_VALUE - 1; - base.mMaxProgresstime = Integer.MAX_VALUE - 1; - } else { - base.mEUt = (int) xEUt; - if (base.mEUt == 0) - base.mEUt = 1; - if (base.mMaxProgresstime <= 0) - base.mMaxProgresstime = 1;//set time to 1 tick - } - } - } - - public static void calculateOverclockedNessMultiPefectOC(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, GT_MetaTileEntity_MultiBlockBase base){ - byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); - if (mTier == 0) { - //Long time calculation - long xMaxProgresstime = ((long) aDuration) << 1; - if (xMaxProgresstime > Integer.MAX_VALUE - 1) { - //make impossible if too long - base.mEUt = Integer.MAX_VALUE - 1; - base.mMaxProgresstime = Integer.MAX_VALUE - 1; - } else { - base.mEUt = aEUt >> 2; - base.mMaxProgresstime = (int) xMaxProgresstime; - } - } else { - long xEUt = aEUt; - //Isnt too low EUt check? - long tempEUt = Math.max(xEUt, V[1]); - - base.mMaxProgresstime = aDuration; - - while (tempEUt <= V[mTier - 1] * mAmperage) { - tempEUt <<= 1;//this actually controls overclocking - base.mMaxProgresstime >>= 1;//this is effect of overclocking - xEUt = base.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 1;//U know, if the time is less than 1 tick make the machine use less power + if (xEUt < aEUt){ + xEUt <<= modifier; + base.mMaxProgresstime >>= 1; } - while (xEUt > maxInputVoltage) { - //downclock one notch until we are good again, we have overshot. - xEUt >>= 1; - base.mMaxProgresstime <<= 1; - } if (xEUt > Integer.MAX_VALUE - 1) { base.mEUt = Integer.MAX_VALUE - 1; base.mMaxProgresstime = Integer.MAX_VALUE - 1; @@ -448,6 +413,10 @@ public class BW_Util { } } + public static void calculateOverclockedNessMultiPefectOC(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, @Nonnull GT_MetaTileEntity_MultiBlockBase base){ + calculateOverclockednessMultiInternal(aEUt, aDuration, mAmperage, maxInputVoltage, base, 1); + } + public static long getnominalVoltage(GT_MetaTileEntity_MultiBlockBase base) { long rVoltage = 0L; long rAmperage = 0L; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java index 5e1bb3e792..7045e27bd1 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java index db9b77ec91..dd0dc8f325 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java index b6cc37b451..b75a9fcd1a 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java index fb0451d381..8f6f1f9164 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java index c881e09317..5faa82b6e6 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -36,7 +36,7 @@ import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; import java.util.*; -@SuppressWarnings("unused") +@SuppressWarnings({"unused", "RedundantSuppression"}) public final class BWAtmosphereManager { private static final Map COEFFICIENT_MAP = new HashMap<>(); @@ -90,7 +90,7 @@ public final class BWAtmosphereManager { return true; } String name = gas.toString(); - name = name.substring(0,1)+name.substring(1).toLowerCase(Locale.US); + name = name.charAt(0)+name.substring(1).toLowerCase(Locale.US); ISubTagContainer mat = Materials.get(name); if (mat == Materials._NULL){ mat = WerkstoffLoader.getWerkstoff(name); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java index 3a7e92f186..04d4e41cb8 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java index 7e082ba695..b44120bf34 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java index 47be16ce21..ecc243a3d0 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java index d096ba4962..ddb37b9941 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java index f6a5cfc3f3..2c8eac2cd9 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java index cf4c13f326..78cbd986ac 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java index cce24d22db..a2f3f78861 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java index 609a718be2..1fbddb01b1 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java index 954364034a..7a01028a61 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java index 8bfa8024d5..ffac1554d4 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -33,7 +33,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energ import java.util.ArrayList; import java.util.Iterator; -@SuppressWarnings({"unused"}) +@SuppressWarnings({"unused","RedundantSuppression"}) public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { ArrayList mTTEnergyHatches = new ArrayList<>(); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java index c6f9003d9d..bacd18c894 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java index 67c0dfb15d..ee22ca8ab2 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java index 991b7ad1b5..08fc1d0e5c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek + * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal -- cgit From e9cb18cb188cc41baee5c12a917eeaa7956416dc Mon Sep 17 00:00:00 2001 From: Prometheus0000 Date: Tue, 15 Sep 2020 17:40:13 -0400 Subject: Change max height to 56 Since 5x11(max DT outputs)=55+1(for bottom)=56. Unless I'm missing something. Or did it wrong. Former-commit-id: 1f5f8399bd20dc97dd7215d5128257358ff7691e --- .../tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 33434bb9d6..61abca42ec 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -65,7 +65,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati public String[] getDescription() { return new String[]{ "Controller Block for the Mega Distillation Tower", - "Size(WxHxD): 15xhx15 (Hollow), with h ranging from 16 to 61", + "Size(WxHxD): 15xhx15 (Hollow), with h ranging from 16 to 56", "Controller (Front bottom)", "1+ Input Hatch (Any bottom layer casing)", "1+ Output Bus (Any bottom layer casing)", @@ -135,7 +135,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati } } - return casingAmount >= 15 * y - 5 && y >= 16 && y <= 61 && reachedTop; + return casingAmount >= 15 * y - 5 && y >= 16 && y <= 56 && reachedTop; } @Override @@ -256,4 +256,4 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati public boolean drainEnergyInput(long aEU) { return MegaUtils.drainEnergyMegaVanilla(this, aEU); } -} \ No newline at end of file +} -- cgit From 7853c2b42163b6372680d7d05113acc60cb0d371 Mon Sep 17 00:00:00 2001 From: bartimaeusnek Date: Mon, 12 Oct 2020 10:34:02 +0200 Subject: Repaired FloodGate + completely overhauled flood-gate Former-commit-id: a1170422a40d64566a40eb69ac26b25b7c22d9b0 --- .../BW_TileEntity_ExperimentalFloodGate.java | 229 +++++++-------------- .../bartimaeusnek/bartworks/util/Coords.java | 21 ++ 2 files changed, 97 insertions(+), 153 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java index 0497a1b5b6..8ab24a58f7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java @@ -24,182 +24,105 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; import com.github.bartimaeusnek.bartworks.util.Coords; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.TileFluidHandler; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; +import java.util.Comparator; +import java.util.PriorityQueue; + +import static net.minecraftforge.common.util.ForgeDirection.*; public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implements ITileAddsInformation { - BW_TileEntity_ExperimentalFloodGate.recursiveBelowCheck check = new BW_TileEntity_ExperimentalFloodGate.recursiveBelowCheck(); - private long ticks; - private long noOfIts; - private Coords paused; + private final static ForgeDirection[] allowed_directions = new ForgeDirection[]{DOWN, WEST, EAST, SOUTH, NORTH}; + private PriorityQueue breadthFirstQueue = new PriorityQueue<>(Comparator.comparingInt(x -> x.y)); + private boolean wasInited = false; public BW_TileEntity_ExperimentalFloodGate() { - + this.tank.setCapacity(64000); } @Override - public void updateEntity() { - if (this.paused == null) { - this.paused = new Coords(this.xCoord, this.yCoord, this.zCoord, this.worldObj.provider.dimensionId); - } - this.ticks++; - if (this.check.called != -1) { - if (this.ticks % 20 == 0) { - HashSet toRem = new HashSet<>(); - for (Coords c : this.check.hashset) { - this.worldObj.setBlock(c.x, c.y, c.z, Blocks.water, 0, 4); - toRem.add(c); - } - this.check.hashset.removeAll(toRem); - } - } else { - this.noOfIts = 0; - this.setUpHashSet(); - this.paused = this.check.hashset.get(this.check.hashset.size() - 1); - } - if (this.ticks % 50 == 0) - this.ticks = 0; + public boolean canFill(ForgeDirection from, Fluid fluid) { + return fluid.canBePlacedInWorld(); } - private synchronized void setUpHashSet() { - this.check = new BW_TileEntity_ExperimentalFloodGate.recursiveBelowCheck(); - Thread t = new Thread(this.check); - t.start(); - while (t.isAlive()) { - try { - this.wait(); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - this.check.hashset.remove(new Coords(this.xCoord, this.yCoord, this.zCoord, this.worldObj.provider.dimensionId)); + public void initEntity() { + if (wasInited) + return; + breadthFirstQueue.add(new Coords(this.xCoord, this.yCoord, this.zCoord)); + wasInited = true; } @Override - public String[] getInfoData() { - return new String[]{"Experimental Machine to fill Holes with Fluids"}; + public void updateEntity() { + initEntity(); + Coords current = breadthFirstQueue.poll(); + if (current == null) + return; + setFluidBlock(current); + for (ForgeDirection allowed_direction : allowed_directions) { + addBlockToQueue(current, allowed_direction); + } } - private class recursiveBelowCheck implements Runnable { - - private final List hashset = new ArrayList<>(); - int called = -1; - - public int getCalled() { - return this.called; + @Override + public void writeToNBT(NBTTagCompound tag) { + super.writeToNBT(tag); + tag.setBoolean("init", wasInited); + + int[] x = new int[this.breadthFirstQueue.size()]; + int[] y = new int[this.breadthFirstQueue.size()]; + int[] z = new int[this.breadthFirstQueue.size()]; + Coords[] arr = this.breadthFirstQueue.toArray(new Coords[0]); + + for (int i = 0; i < this.breadthFirstQueue.size(); i++) { + x[i] = arr[i].x; + y[i] = arr[i].y; + z[i] = arr[i].z; } - public void setCalled(int called) { - this.called = called; - } + tag.setIntArray("queueX", x); + tag.setIntArray("queueY", y); + tag.setIntArray("queueZ", z); + } - public synchronized List getHashset() { - return this.hashset; + @Override + public void readFromNBT(NBTTagCompound tag) { + super.readFromNBT(tag); + this.wasInited = tag.getBoolean("init"); + int[] x = tag.getIntArray("queueX"); + int[] y = tag.getIntArray("queueY"); + int[] z = tag.getIntArray("queueZ"); + for (int i = 0; i < x.length; i++) { + this.breadthFirstQueue.add(new Coords(x[i], y[i], z[i])); } + } - public byte check_sourroundings(World w, int x, int y, int z, Block b) { - byte ret = 0; - int wID = w.provider.dimensionId; - - if (this.hashset.contains(new Coords(x, y, z, wID))) - return ret; - - this.hashset.add(new Coords(x, y, z, wID)); - - if (w.getBlock(x, y + 1, z).equals(b)) - ret = (byte) (ret | 0b000001); - - if (w.getBlock(x, y - 1, z).equals(b)) - ret = (byte) (ret | 0b000010); - - if (w.getBlock(x + 1, y, z).equals(b)) - ret = (byte) (ret | 0b000100); - - if (w.getBlock(x - 1, y, z).equals(b)) - ret = (byte) (ret | 0b001000); - - if (w.getBlock(x, y, z + 1).equals(b)) - ret = (byte) (ret | 0b010000); - - if (w.getBlock(x, y, z - 1).equals(b)) - ret = (byte) (ret | 0b100000); + private void setFluidBlock(Coords current) { + if (!checkForAir(current)) + return; + if (this.tank.drain(1000, false) == null || this.tank.drain(1000, false).amount != 1000) + return; + FluidStack stack = this.tank.drain(1000, true); + worldObj.setBlock(current.x, current.y, current.z, stack.getFluid().getBlock(), 0, 2); + } - return ret; - } + private void addBlockToQueue(Coords current, ForgeDirection allowed_direction) { + Coords side = current.getCoordsFromSide(allowed_direction); + if (checkForAir(side)) + breadthFirstQueue.add(side); + } - public int get_connected(World w, int x, int y, int z, Block b, int iterations) { - - if (iterations >= 5000) - return -1; - int tail; - int ret = 0; - iterations++; - int wID = w.provider.dimensionId; - byte sides = this.check_sourroundings(w, x, y, z, b); - - if (((sides | 0b111110) == 0b111111) && !this.hashset.contains(new Coords(x, y + 1, z, wID)) && y + 1 <= BW_TileEntity_ExperimentalFloodGate.this.yCoord) { - tail = this.get_connected(w, x, y + 1, z, b, iterations); - if (tail == -1) - return -1; - ret++; - ret += tail; - } - - if (((sides | 0b111101) == 0b111111) && !this.hashset.contains(new Coords(x, y - 1, z, wID))) { - tail = this.get_connected(w, x, y - 1, z, b, iterations); - if (tail == -1) - return -1; - ret++; - ret += tail; - } - - if (((sides | 0b111011) == 0b111111) && !this.hashset.contains(new Coords(x + 1, y, z, wID))) { - tail = this.get_connected(w, x + 1, y, z, b, iterations); - if (tail == -1) - return -1; - ret++; - ret += tail; - } - - if (((sides | 0b110111) == 0b111111) && !this.hashset.contains(new Coords(x - 1, y, z, wID))) { - tail = this.get_connected(w, x - 1, y, z, b, iterations); - if (tail == -1) - return -1; - ret++; - ret += tail; - } - - if (((sides | 0b101111) == 0b111111) && !this.hashset.contains(new Coords(x, y, z + 1, wID))) { - tail = this.get_connected(w, x, y, z + 1, b, iterations); - if (tail == -1) - return -1; - ret++; - ret += tail; - - } - - if (((sides | 0b011111) == 0b111111) && !this.hashset.contains(new Coords(x, y, z - 1, wID))) { - tail = this.get_connected(w, x, y, z - 1, b, iterations); - if (tail == -1) - return -1; - ret++; - ret += tail; - } - - return ret; - } + private boolean checkForAir(Coords coords) { + return this.worldObj.isAirBlock(coords.x, coords.y, coords.z); + } - @Override - public synchronized void run() { - this.called = BW_TileEntity_ExperimentalFloodGate.this.check.get_connected(BW_TileEntity_ExperimentalFloodGate.this.worldObj, BW_TileEntity_ExperimentalFloodGate.this.paused.x, BW_TileEntity_ExperimentalFloodGate.this.paused.y, BW_TileEntity_ExperimentalFloodGate.this.paused.z, Blocks.air, 0); - this.notifyAll(); - } + @Override + public String[] getInfoData() { + return new String[]{"Experimental Machine to fill Holes with Fluids"}; } -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java index 4a3ee25235..ef213ea16b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.util; +import net.minecraftforge.common.util.ForgeDirection; + public class Coords { public int x, z, wID; @@ -39,6 +41,25 @@ public class Coords { this.wID = 0; } + public Coords getCoordsFromSide(ForgeDirection direction) { + switch (direction) { + case UP: + return new Coords(this.x, this.y + 1, this.z, this.wID); + case DOWN: + return new Coords(this.x, this.y - 1, this.z, this.wID); + case WEST: + return new Coords(this.x - 1, this.y, this.z, this.wID); + case EAST: + return new Coords(this.x + 1, this.y, this.z, this.wID); + case NORTH: + return new Coords(this.x, this.y, this.z - 1, this.wID); + case SOUTH: + return new Coords(this.x, this.y, this.z + 1, this.wID); + default: + throw new UnsupportedOperationException("This is impossible."); + } + } + @Override public boolean equals(Object o) { if (this == o) -- cgit From 4596c26ba6eec8b07b06032849d8b1edd9caa0ac Mon Sep 17 00:00:00 2001 From: bartimaeusnek Date: Mon, 12 Oct 2020 10:35:14 +0200 Subject: UpdatedGradle to 5.6.4 Former-commit-id: 25b98d89c4395cb843b40fd1c3a447f679c89922 --- build.gradle | 192 +++++++++++++++---------------- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 93 insertions(+), 101 deletions(-) diff --git a/build.gradle b/build.gradle index 96e65157ca..9bbee2d10b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,35 +1,3 @@ -buildscript { - repositories { - mavenCentral() - maven { - name = "forge" - url = "http://files.minecraftforge.net/maven" - } - maven { - name = "sonatype" - url = "https://oss.sonatype.org/content/repositories/snapshots/" - } - } - dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' - classpath "de.undercouch:gradle-download-task:3.1.2" - } -} - -plugins { - id "org.sonarqube" version "2.2" -} - -apply plugin: 'forge' -apply plugin: 'signing' -apply plugin: 'idea' -idea{ - module { - downloadJavadoc = true - downloadSources = true - } -} - /* * Copyright (c) 2018-2020 bartimaeusnek * @@ -51,18 +19,39 @@ idea{ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -import de.undercouch.gradle.tasks.download.Download +buildscript { + repositories { + mavenCentral() + maven { + name = "forge" + url = "http://files.minecraftforge.net/maven" + } + maven { + name = "jitpack" + url = "https://jitpack.io" + } + } + dependencies { + classpath "com.github.GTNH2:ForgeGradle:0d2484b" + } +} + +apply plugin: "forge" +apply plugin: "signing" +apply plugin: "idea" +idea{ + module { + downloadJavadoc = true + downloadSources = true + } +} //noinspection GroovyUnusedAssignment sourceCompatibility = JavaVersion.VERSION_1_8 //noinspection GroovyUnusedAssignment targetCompatibility = JavaVersion.VERSION_1_8 -//noinspection GroovyUnusedAssignment -sourceCompatibility = 1.8 -//noinspection GroovyUnusedAssignment -targetCompatibility = 1.8 -compileJava.options.encoding = 'UTF-8' +compileJava.options.encoding = "UTF-8" ext.configFile = file "build.properties" configFile.withReader { @@ -89,71 +78,81 @@ minecraft { repositories { mavenLocal() + maven { + name = "gt" + url = "https://gregtech.overminddl1.com/" + } maven { name = "ic2" url = "http://maven.ic2.player.to/" } - maven { // AppleCore - url "http://www.ryanliptak.com/maven/" - } maven { // GalacticGreg, YAMCore,.. - name 'UsrvDE' + name "UsrvDE" url "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/" } ivy { - name 'gtnh_download_source_stupid_underscore_typo' + name "gtnh_download_source_stupid_underscore_typo" artifactPattern "http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]_[revision].[ext]" } ivy { - name 'gtnh_download_source' + name "gtnh_download_source" artifactPattern "http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]" } maven { - name = "gt" - url = "https://gregtech.overminddl1.com/" + name = "OC repo" + url = "http://maven.cil.li/" } maven { - url = "http://maven.cil.li/" + name = "jabba" + url = "http://default.mobiusstrip.eu/maven" + } + maven { + name = "chickenbones" + url = "http://chickenbones.net/maven/" + } + maven { + name = "Apple" + url "http://www.ryanliptak.com/maven/" + } + ivy { + name "BuildCraft" + artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision](-[classifier]).[ext]" + } + maven { + name = "jitpack" + url = "https://jitpack.io" } } dependencies { + //hard deps compile "net.industrial-craft:industrialcraft-2:${config.ic2.version}:dev" - compile "micdoodle8.mods:MicdoodleCore:${config.galacticraft.version}:Dev" - compile "micdoodle8.mods:GalacticraftCore:${config.galacticraft.version}:Dev" - compile "micdoodle8.mods:Galacticraft-Planets:${config.galacticraft.version}:Dev" - compile "li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api" + //compile "com.github.GTNH2:GT5-Unofficial:experimental-SNAPSHOT:dev" //broken jitpack.io dep + //soft deps + compileOnly "com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf" + compileOnly "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev" + compileOnly "mods.railcraft:Railcraft_1.7.10:9.12.3.0:dev" + compileOnly "micdoodle8.mods:MicdoodleCore:${config.galacticraft.version}:Dev" + compileOnly "micdoodle8.mods:GalacticraftCore:${config.galacticraft.version}:Dev" + compileOnly "micdoodle8.mods:Galacticraft-Planets:${config.galacticraft.version}:Dev" + compileOnly "li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api" + compileOnly "net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev" + compileOnly "com.github.GTNewHorizons:GalacticGregGT5:master-SNAPSHOT" + compileOnly fileTree(dir: "libs", include: "*.jar") + + //CoreLibs for compile-age + //compileOnly "com.github.GTNH2:Yamcl:master-SNAPSHOT" //broken jitpack.io dep compileOnly "applecore:AppleCore:${config.applecore.version}:api" compileOnly "com.enderio.core:EnderCore:${config.enderiocore.version}:dev" compileOnly "com.enderio:EnderIO:${config.enderio.version}:dev" compileOnly "com.enderio:EnderIO:${config.enderio.version}:dev" -} -task getRailCraft(type: Download) { - onlyIf { - !file("libs/Railcraft_1.7.10-9.12.2.0-dev.jar").exists() - } - src 'http://downloads.gtnewhorizons.com/Mods_for_Jenkins/Railcraft_1.7.10-9.12.2.0-dev.jar' - dest file("libs/Railcraft_1.7.10-9.12.2.0-dev.jar") - mustRunAfter "deobfBinJar" - mustRunAfter "repackMinecraft" + //NEI + compile "codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev" + compile "codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev" + compile "codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev" } -//task getGregTech(type: Download) { -// onlyIf { -// !file("libs/gregtech-${config.gregtech.version}-dev.jar").exists() -// } -// src "http://jenkins.usrv.eu:8080/job/Gregtech-5-Unofficial/${config.gregtech.jenkinsbuild}/artifact/build/libs/gregtech-${config.gregtech.version}-dev.jar" -// dest file("libs/gregtech-${config.gregtech.version}-dev.jar") -// mustRunAfter "deobfBinJar" -// mustRunAfter "repackMinecraft" -//} - -tasks.setupCIWorkspace.dependsOn getRailCraft -tasks.setupDevWorkspace.dependsOn getRailCraft -tasks.setupDecompWorkspace.dependsOn getRailCraft -tasks.compileJava.dependsOn getRailCraft - processResources { // this will ensure that this task is redone when the versions change. @@ -162,15 +161,15 @@ processResources // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' + include "mcmod.info" // replace version and mcversion - expand 'version':project.version, 'mcversion':project.minecraft.version + expand "version":project.version, "mcversion":project.minecraft.version } // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' + exclude "mcmod.info" } } @@ -178,28 +177,28 @@ jar { exclude ("assets/gregtech/textures/items/materialicons/copy.bat") exclude ("assets/gregtech/textures/blocks/materialicons/copy.bat") manifest { - attributes 'FMLCorePlugin': 'com.github.bartimaeusnek.ASM.BWCorePlugin','FMLCorePluginContainsFMLMod': 'true' + attributes "FMLCorePlugin": "com.github.bartimaeusnek.ASM.BWCorePlugin","FMLCorePluginContainsFMLMod": "true" } } task apiJar(type: Jar){ from(sourceSets.main.output) { - include 'com/github/bartimaeusnek/bartworks/API/**' - include 'com/github/bartimaeusnek/bartworks/util/**' - include 'com/github/bartimaeusnek/bartworks/system/material/Werkstoff.class' - include 'com/github/bartimaeusnek/crossmod/thaumcraft/util/**' + include "com/github/bartimaeusnek/bartworks/API/**" + include "com/github/bartimaeusnek/bartworks/util/**" + include "com/github/bartimaeusnek/bartworks/system/material/Werkstoff.class" + include "com/github/bartimaeusnek/crossmod/thaumcraft/util/**" } - classifier = 'API' + classifier = "API" } task sourceJar(type: Jar) { from sourceSets.main.allSource - classifier = 'sources' + classifier = "sources" } task devJar(type: Jar) { from sourceSets.main.output - classifier = 'dev' + classifier = "dev" } artifacts { @@ -208,24 +207,17 @@ artifacts { archives apiJar } -sonarqube { - properties { - property "sonar.projectName", "bartworks" - property "sonar.projectKey", "bartimaeusnek_bartworks" - } -} - -task signJar(dependsOn: 'reobf'){ +task signJar(dependsOn: "reobf"){ doLast { ant.signjar( destDir: jar.destinationDir, jar: jar.getArchivePath(), - alias: findProperty('keyStoreAlias') ?: '', - keystore: findProperty('keyStore') ?: '', - storepass: findProperty('keyStorePass') ?: '', - digestalg: findProperty('signDigestAlg') ?: '', - tsaurl: findProperty('signTSAurl') ?: '', + alias: findProperty("keyStoreAlias") ?: "", + keystore: findProperty("keyStore") ?: "", + storepass: findProperty("keyStorePass") ?: "", + digestalg: findProperty("signDigestAlg") ?: "", + tsaurl: findProperty("signTSAurl") ?: "", verbose: true ) } -} +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index daad77681b..9cc785acbf 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip \ No newline at end of file -- cgit -- cgit From 6d1d43085cfd92d67483aac695cf7292d5072c34 Mon Sep 17 00:00:00 2001 From: bartimaeusnek Date: Mon, 12 Oct 2020 12:44:00 +0200 Subject: Updated Buildscript to kts Former-commit-id: 3f7b946b3e475f93c5bf4f58e42a64ec6d12be35 --- build.gradle | 223 ------------------------------------------------------ build.gradle.kts | 216 ++++++++++++++++++++++++++++++++++++++++++++++++++++ build.properties | 33 -------- gradle.properties | 30 ++++++++ 4 files changed, 246 insertions(+), 256 deletions(-) delete mode 100644 build.gradle create mode 100644 build.gradle.kts delete mode 100644 build.properties create mode 100644 gradle.properties diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 9bbee2d10b..0000000000 --- a/build.gradle +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -buildscript { - repositories { - mavenCentral() - maven { - name = "forge" - url = "http://files.minecraftforge.net/maven" - } - maven { - name = "jitpack" - url = "https://jitpack.io" - } - } - dependencies { - classpath "com.github.GTNH2:ForgeGradle:0d2484b" - } -} - -apply plugin: "forge" -apply plugin: "signing" -apply plugin: "idea" -idea{ - module { - downloadJavadoc = true - downloadSources = true - } -} - -//noinspection GroovyUnusedAssignment -sourceCompatibility = JavaVersion.VERSION_1_8 -//noinspection GroovyUnusedAssignment -targetCompatibility = JavaVersion.VERSION_1_8 - -compileJava.options.encoding = "UTF-8" - -ext.configFile = file "build.properties" -configFile.withReader { - def prop = new Properties() - prop.load(it) - project.ext.config = new ConfigSlurper().parse prop -} - - -version = config.majorUpdate+"."+config.minorUpdate+"."+config.buildNumber -//noinspection GroovyUnusedAssignment -group= "com.github.bartimaeusnek.bartworks" // http://maven.apache.org/guides/mini/guide-naming-conventions.html -//noinspection GroovyUnusedAssignment -archivesBaseName = "bartworks"+ "[" + config.mc_version + "]" - -minecraft { - version = "1.7.10-10.13.4.1614-1.7.10" - replaceIn "MainMod.java" - replaceIn "API_REFERENCE.java" - replace "@version@", project.version - replace "@apiversion@", config.APIVersion - runDir = "run" -} - -repositories { - mavenLocal() - maven { - name = "gt" - url = "https://gregtech.overminddl1.com/" - } - maven { - name = "ic2" - url = "http://maven.ic2.player.to/" - } - maven { // GalacticGreg, YAMCore,.. - name "UsrvDE" - url "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/" - } - ivy { - name "gtnh_download_source_stupid_underscore_typo" - artifactPattern "http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]_[revision].[ext]" - } - ivy { - name "gtnh_download_source" - artifactPattern "http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]" - } - maven { - name = "OC repo" - url = "http://maven.cil.li/" - } - maven { - name = "jabba" - url = "http://default.mobiusstrip.eu/maven" - } - maven { - name = "chickenbones" - url = "http://chickenbones.net/maven/" - } - maven { - name = "Apple" - url "http://www.ryanliptak.com/maven/" - } - ivy { - name "BuildCraft" - artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision](-[classifier]).[ext]" - } - maven { - name = "jitpack" - url = "https://jitpack.io" - } -} - -dependencies { - //hard deps - compile "net.industrial-craft:industrialcraft-2:${config.ic2.version}:dev" - //compile "com.github.GTNH2:GT5-Unofficial:experimental-SNAPSHOT:dev" //broken jitpack.io dep - //soft deps - compileOnly "com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf" - compileOnly "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev" - compileOnly "mods.railcraft:Railcraft_1.7.10:9.12.3.0:dev" - compileOnly "micdoodle8.mods:MicdoodleCore:${config.galacticraft.version}:Dev" - compileOnly "micdoodle8.mods:GalacticraftCore:${config.galacticraft.version}:Dev" - compileOnly "micdoodle8.mods:Galacticraft-Planets:${config.galacticraft.version}:Dev" - compileOnly "li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api" - compileOnly "net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev" - compileOnly "com.github.GTNewHorizons:GalacticGregGT5:master-SNAPSHOT" - compileOnly fileTree(dir: "libs", include: "*.jar") - - //CoreLibs for compile-age - //compileOnly "com.github.GTNH2:Yamcl:master-SNAPSHOT" //broken jitpack.io dep - compileOnly "applecore:AppleCore:${config.applecore.version}:api" - compileOnly "com.enderio.core:EnderCore:${config.enderiocore.version}:dev" - compileOnly "com.enderio:EnderIO:${config.enderio.version}:dev" - compileOnly "com.enderio:EnderIO:${config.enderio.version}:dev" - - //NEI - compile "codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev" - compile "codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev" - compile "codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev" -} - -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 "version":project.version, "mcversion":project.minecraft.version - } - - // copy everything else, thats not the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude "mcmod.info" - } -} - -jar { - exclude ("assets/gregtech/textures/items/materialicons/copy.bat") - exclude ("assets/gregtech/textures/blocks/materialicons/copy.bat") - manifest { - attributes "FMLCorePlugin": "com.github.bartimaeusnek.ASM.BWCorePlugin","FMLCorePluginContainsFMLMod": "true" - } -} - -task apiJar(type: Jar){ - from(sourceSets.main.output) { - include "com/github/bartimaeusnek/bartworks/API/**" - include "com/github/bartimaeusnek/bartworks/util/**" - include "com/github/bartimaeusnek/bartworks/system/material/Werkstoff.class" - include "com/github/bartimaeusnek/crossmod/thaumcraft/util/**" - } - classifier = "API" -} - -task sourceJar(type: Jar) { - from sourceSets.main.allSource - classifier = "sources" -} - -task devJar(type: Jar) { - from sourceSets.main.output - classifier = "dev" -} - -artifacts { - archives devJar - archives sourceJar - archives apiJar -} - -task signJar(dependsOn: "reobf"){ - doLast { - ant.signjar( - destDir: jar.destinationDir, - jar: jar.getArchivePath(), - alias: findProperty("keyStoreAlias") ?: "", - keystore: findProperty("keyStore") ?: "", - storepass: findProperty("keyStorePass") ?: "", - digestalg: findProperty("signDigestAlg") ?: "", - tsaurl: findProperty("signTSAurl") ?: "", - verbose: true - ) - } -} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000000..97376f1af6 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,216 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +import net.minecraftforge.gradle.user.UserExtension + +buildscript { + repositories { + mavenCentral() + maven { + name = "forge" + url = uri("http://files.minecraftforge.net/maven") + } + maven { + name = "jitpack" + url = uri("https://jitpack.io") + } + } + dependencies { + classpath("com.github.GTNH2:ForgeGradle:FG_1.2-SNAPSHOT") + } +} + +plugins { + idea + java +} + +apply(plugin = "forge") + +idea { + module { + isDownloadJavadoc = true + isDownloadSources = true + } +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +tasks.withType { + options.encoding = "UTF-8" +} + +val majorUpdate : String by project +val minorUpdate : String by project +val buildNumber : String by project + +version = "$majorUpdate.$minorUpdate.$buildNumber" +group = "com.github.bartimaeusnek.bartworks" + +//minecraft block +configure{ + version = "1.7.10-10.13.4.1614-1.7.10" + replaceIn("MainMod.java") + replaceIn("API_REFERENCE.java") + replace("@version@", project.version) + val apiVersion : String by project + replace("@apiversion@", apiVersion) + runDir = "run" +} + +repositories { + mavenLocal() + maven { + name = "gt" + url = uri("https://gregtech.overminddl1.com/") + } + maven { + name = "ic2" + url = uri("http://maven.ic2.player.to/") + } + maven { // GalacticGreg, YAMCore,.. + name = "UsrvDE" + url = uri("http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/") + } + ivy { + name = "gtnh_download_source_stupid_underscore_typo" + artifactPattern("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]_[revision].[ext]") + } + ivy { + name = "gtnh_download_source" + artifactPattern("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]") + } + maven { + name = "OC repo" + url = uri("http://maven.cil.li/") + } + maven { + name = "jabba" + url = uri("http://default.mobiusstrip.eu/maven") + } + maven { + name = "chickenbones" + url = uri("http://chickenbones.net/maven/") + } + maven { + name = "Apple" + url = uri("http://www.ryanliptak.com/maven/") + } + ivy { + name = "BuildCraft" + artifactPattern("http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision](-[classifier]).[ext]") + } + maven { + name = "jitpack" + url = uri("https://jitpack.io") + } +} + +dependencies { + //Needed properties + val ic2Version : String by project + val galacticraftVersion : String by project + val applecoreVersion : String by project + val enderCoreVersion : String by project + val enderioVersion : String by project + //hard deps + compile("net.industrial-craft:industrialcraft-2:$ic2Version:dev") + //compile("com.github.GTNH2:GT5-Unofficial:experimental-SNAPSHOT:dev") //broken jitpack.io dep + //soft deps + compileOnly("com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf") + compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") + compileOnly("mods.railcraft:Railcraft_1.7.10:9.12.3.0:dev") + compileOnly("micdoodle8.mods:MicdoodleCore:$galacticraftVersion:Dev") + compileOnly("micdoodle8.mods:GalacticraftCore:$galacticraftVersion:Dev") + compileOnly("micdoodle8.mods:Galacticraft-Planets:$galacticraftVersion:Dev") + compileOnly("li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api") + compileOnly("net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev") + compileOnly("com.github.GTNewHorizons:GalacticGregGT5:master-SNAPSHOT") + //compileOnly(fileTree(dir = "libs", include = "*.jar")) + + //CoreLibs for compile-age + //compileOnly("com.github.GTNH2:Yamcl:master-SNAPSHOT") //broken jitpack.io dep + compileOnly("applecore:AppleCore:$applecoreVersion:api") + compileOnly("com.enderio.core:EnderCore:$enderCoreVersion:dev") + compileOnly("com.enderio:EnderIO:$enderioVersion:dev") + + //NEI + compile("codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev") + compile("codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev") + compile("codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev") +} + +val Project.minecraft : UserExtension + get() = extensions.getByName("minecraft") + +tasks.withType { + // this will ensure that this task is redone when the versions change. + inputs.properties += "version" to project.version + inputs.properties += "mcversion" to project.minecraft.version + archiveBaseName.set("bartworks[${project.minecraft.version}]") + + // replace stuff in mcmod.info, nothing else + filesMatching("/mcmod.info") { + expand(mapOf( + "version" to project.version, + "mcversion" to project.minecraft.version + )) + } +} + +tasks.jar { + exclude ("assets/gregtech/textures/items/materialicons/copy.bat") + exclude ("assets/gregtech/textures/blocks/materialicons/copy.bat") + manifest { + attributes["FMLCorePlugin"] = "com.github.bartimaeusnek.ASM.BWCorePlugin" + attributes["FMLCorePluginContainsFMLMod"] = "true" + } +} + +val apiJar by tasks.creating(Jar::class) { + from(sourceSets.main.get().output) { + include("com/github/bartimaeusnek/bartworks/API/**") + include("com/github/bartimaeusnek/bartworks/util/**") + include("com/github/bartimaeusnek/bartworks/system/material/Werkstoff.class") + include("com/github/bartimaeusnek/crossmod/thaumcraft/util/**") + } + archiveClassifier.set("API") +} + +val sourcesJar by tasks.creating(Jar::class) { + from(sourceSets.main.get().allSource) + archiveClassifier.set("sources") +} + +val devJar by tasks.creating(Jar::class) { + from(sourceSets.main.get().output) + archiveClassifier.set("dev") +} + +artifacts { + add("archives", apiJar) + add("archives", sourcesJar) + add("archives", devJar) +} \ No newline at end of file diff --git a/build.properties b/build.properties deleted file mode 100644 index bfd657b23f..0000000000 --- a/build.properties +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright (c) 2018-2020 bartimaeusnek -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -mc_version=1.7.10 -majorUpdate=0 -minorUpdate=5 -buildNumber=13.1 -APIVersion=11 -ic2.version=2.2.828-experimental -gregtech.version=5.09.33.38 -gregtech.jenkinsbuild=454 -applecore.version=1.7.10-3.1.1 -galacticraft.version=1.7-3.0.12.504 -enderio.version=1.7.10-2.3.0.429_beta -enderiocore.version=1.7.10-0.2.0.39_beta \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000000..4fdf782092 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,30 @@ +# +# Copyright (c) 2018-2020 bartimaeusnek +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +majorUpdate=0 +minorUpdate=5 +buildNumber=13.1 +apiVersion=11 +ic2Version=2.2.828-experimental +applecoreVersion=1.7.10-3.1.1 +galacticraftVersion=1.7-3.0.12.504 +enderioVersion=1.7.10-2.3.0.429_beta +enderCoreVersion=1.7.10-0.2.0.39_beta \ No newline at end of file -- cgit From 7c022285e62fdd436eb49dc24d2314221f7c9d0b Mon Sep 17 00:00:00 2001 From: bartimaeusnek Date: Mon, 12 Oct 2020 15:19:29 +0200 Subject: improved readability on buildscript Former-commit-id: abd20cf241cf00b6ce71a1e8df1c7c79bdfc28bc --- build.gradle.kts | 92 +++++++++++++++++++------------------------------------- 1 file changed, 31 insertions(+), 61 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 97376f1af6..d2a12b67a8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,14 +25,8 @@ import net.minecraftforge.gradle.user.UserExtension buildscript { repositories { mavenCentral() - maven { - name = "forge" - url = uri("http://files.minecraftforge.net/maven") - } - maven { - name = "jitpack" - url = uri("https://jitpack.io") - } + maven("http://files.minecraftforge.net/maven") + maven("https://jitpack.io") } dependencies { classpath("com.github.GTNH2:ForgeGradle:FG_1.2-SNAPSHOT") @@ -62,79 +56,55 @@ tasks.withType { options.encoding = "UTF-8" } -val majorUpdate : String by project -val minorUpdate : String by project -val buildNumber : String by project +val majorUpdate: String by project +val minorUpdate: String by project +val buildNumber: String by project version = "$majorUpdate.$minorUpdate.$buildNumber" group = "com.github.bartimaeusnek.bartworks" //minecraft block -configure{ +configure { version = "1.7.10-10.13.4.1614-1.7.10" replaceIn("MainMod.java") replaceIn("API_REFERENCE.java") replace("@version@", project.version) - val apiVersion : String by project + val apiVersion: String by project replace("@apiversion@", apiVersion) runDir = "run" } repositories { mavenLocal() - maven { - name = "gt" - url = uri("https://gregtech.overminddl1.com/") - } - maven { - name = "ic2" - url = uri("http://maven.ic2.player.to/") - } - maven { // GalacticGreg, YAMCore,.. - name = "UsrvDE" - url = uri("http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/") - } + 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 { - name = "gtnh_download_source_stupid_underscore_typo" - artifactPattern("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]_[revision].[ext]") + this.name = "gtnh_download_source_stupid_underscore_typo" + this.artifactPattern("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]_[revision].[ext]") } ivy { - name = "gtnh_download_source" - artifactPattern("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]") - } - maven { - name = "OC repo" - url = uri("http://maven.cil.li/") - } - maven { - name = "jabba" - url = uri("http://default.mobiusstrip.eu/maven") - } - maven { - name = "chickenbones" - url = uri("http://chickenbones.net/maven/") - } - maven { - name = "Apple" - url = uri("http://www.ryanliptak.com/maven/") + this.name = "gtnh_download_source" + this.artifactPattern("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]") } ivy { - name = "BuildCraft" - artifactPattern("http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision](-[classifier]).[ext]") - } - maven { - name = "jitpack" - url = uri("https://jitpack.io") - } + 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 { //Needed properties - val ic2Version : String by project - val galacticraftVersion : String by project - val applecoreVersion : String by project - val enderCoreVersion : String by project - val enderioVersion : String by project + val ic2Version: String by project + val galacticraftVersion: String by project + val applecoreVersion: String by project + val enderCoreVersion: String by project + val enderioVersion: String by project //hard deps compile("net.industrial-craft:industrialcraft-2:$ic2Version:dev") //compile("com.github.GTNH2:GT5-Unofficial:experimental-SNAPSHOT:dev") //broken jitpack.io dep @@ -148,7 +118,7 @@ dependencies { compileOnly("li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api") compileOnly("net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev") compileOnly("com.github.GTNewHorizons:GalacticGregGT5:master-SNAPSHOT") - //compileOnly(fileTree(dir = "libs", include = "*.jar")) + compileOnly(fileTree("libs") { this.include("*.jar") }) //CoreLibs for compile-age //compileOnly("com.github.GTNH2:Yamcl:master-SNAPSHOT") //broken jitpack.io dep @@ -162,7 +132,7 @@ dependencies { compile("codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev") } -val Project.minecraft : UserExtension +val Project.minecraft: UserExtension get() = extensions.getByName("minecraft") tasks.withType { @@ -181,8 +151,8 @@ tasks.withType { } tasks.jar { - exclude ("assets/gregtech/textures/items/materialicons/copy.bat") - exclude ("assets/gregtech/textures/blocks/materialicons/copy.bat") + exclude("assets/gregtech/textures/items/materialicons/copy.bat") + exclude("assets/gregtech/textures/blocks/materialicons/copy.bat") manifest { attributes["FMLCorePlugin"] = "com.github.bartimaeusnek.ASM.BWCorePlugin" attributes["FMLCorePluginContainsFMLMod"] = "true" -- cgit From 3c514e47cde4ff73e7b3685fd8dace8a13cb23f2 Mon Sep 17 00:00:00 2001 From: bartimaeusnek Date: Mon, 12 Oct 2020 15:52:44 +0200 Subject: Improved readability on the buildscript Former-commit-id: 53d03c8f616a1527a6d7c08a3947e61313c3df3d --- build.gradle.kts | 90 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 53 insertions(+), 37 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index d2a12b67a8..c5cb8b82db 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -42,14 +42,14 @@ apply(plugin = "forge") idea { module { - isDownloadJavadoc = true - isDownloadSources = true + this.isDownloadJavadoc = true + this.isDownloadSources = true } } java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + this.sourceCompatibility = JavaVersion.VERSION_1_8 + this.targetCompatibility = JavaVersion.VERSION_1_8 } tasks.withType { @@ -65,13 +65,21 @@ group = "com.github.bartimaeusnek.bartworks" //minecraft block configure { - version = "1.7.10-10.13.4.1614-1.7.10" - replaceIn("MainMod.java") - replaceIn("API_REFERENCE.java") - replace("@version@", project.version) + this.version = "1.7.10-10.13.4.1614-1.7.10" + this.includes.addAll( + arrayOf( + "MainMod.java", + "API_REFERENCE.java" + ) + ) val apiVersion: String by project - replace("@apiversion@", apiVersion) - runDir = "run" + this.replacements.putAll( + mapOf( + Pair("@version@", project.version), + Pair("@apiversion@", apiVersion) + ) + ) + this.runDir = "run" } repositories { @@ -137,50 +145,58 @@ val Project.minecraft: UserExtension tasks.withType { // this will ensure that this task is redone when the versions change. - inputs.properties += "version" to project.version - inputs.properties += "mcversion" to project.minecraft.version - archiveBaseName.set("bartworks[${project.minecraft.version}]") + this.inputs.properties += "version" to project.version + this.inputs.properties += "mcversion" to project.minecraft.version + this.archiveBaseName.set("bartworks[${project.minecraft.version}]") // replace stuff in mcmod.info, nothing else - filesMatching("/mcmod.info") { - expand(mapOf( - "version" to project.version, - "mcversion" to project.minecraft.version - )) + this.filesMatching("/mcmod.info") { + this.expand( + mapOf( + "version" to project.version, + "mcversion" to project.minecraft.version + ) + ) } } tasks.jar { - exclude("assets/gregtech/textures/items/materialicons/copy.bat") - exclude("assets/gregtech/textures/blocks/materialicons/copy.bat") - manifest { - attributes["FMLCorePlugin"] = "com.github.bartimaeusnek.ASM.BWCorePlugin" - attributes["FMLCorePluginContainsFMLMod"] = "true" - } + this.exclude( + "assets/gregtech/textures/items/materialicons/copy.bat", + "assets/gregtech/textures/blocks/materialicons/copy.bat" + ) + this.manifest.attributes( + mapOf( + Pair("FMLCorePlugin","com.github.bartimaeusnek.ASM.BWCorePlugin"), + Pair("FMLCorePluginContainsFMLMod","true") + ) + ) } val apiJar by tasks.creating(Jar::class) { - from(sourceSets.main.get().output) { - include("com/github/bartimaeusnek/bartworks/API/**") - include("com/github/bartimaeusnek/bartworks/util/**") - include("com/github/bartimaeusnek/bartworks/system/material/Werkstoff.class") - include("com/github/bartimaeusnek/crossmod/thaumcraft/util/**") + this.from(sourceSets.main.get().output) { + this.include( + "com/github/bartimaeusnek/bartworks/API/**", + "com/github/bartimaeusnek/bartworks/util/**", + "com/github/bartimaeusnek/bartworks/system/material/Werkstoff.class", + "com/github/bartimaeusnek/crossmod/thaumcraft/util/**" + ) } - archiveClassifier.set("API") + this.archiveClassifier.set("API") } val sourcesJar by tasks.creating(Jar::class) { - from(sourceSets.main.get().allSource) - archiveClassifier.set("sources") + this.from(sourceSets.main.get().allSource) + this.archiveClassifier.set("sources") } val devJar by tasks.creating(Jar::class) { - from(sourceSets.main.get().output) - archiveClassifier.set("dev") + this.from(sourceSets.main.get().output) + this.archiveClassifier.set("dev") } artifacts { - add("archives", apiJar) - add("archives", sourcesJar) - add("archives", devJar) + this.archives(apiJar) + this.archives(sourcesJar) + this.archives(devJar) } \ No newline at end of file -- cgit From 79b66b91fa6fd1530281fc0ac500180801effd48 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 13 Oct 2020 18:28:12 +0200 Subject: Various Develpoment Former-commit-id: e8ab11b5a3cdefe0c89bc82647010239795ddb62 --- ...ecTech-1.7.10-4.8.3-4eb40295.jar.REMOVED.git-id | 1 - ...ch-1.7.10-4.8.3-9b640643-dev.jar.REMOVED.git-id | 1 + libs/gregtech-5.09.33.52-dev.jar.REMOVED.git-id | 1 - libs/gregtech-5.09.33.54-dev.jar.REMOVED.git-id | 1 + .../com/github/bartimaeusnek/ASM/ASMUtils.java | 4 +- .../ASM/BWCoreStaticReplacementMethodes.java | 38 +- .../bartworks/common/items/BW_ItemBlocks.java | 4 +- .../bartworks/common/items/BW_SimpleWindMeter.java | 4 +- .../bartworks/common/items/BW_Stonage_Rotors.java | 4 +- .../bartworks/common/items/Circuit_Programmer.java | 4 +- .../common/items/GT_Destructopack_Item.java | 5 +- .../bartworks/common/items/GT_Rockcutter_Item.java | 4 +- .../bartworks/common/items/GT_Teslastaff_Item.java | 4 +- .../bartworks/common/items/SimpleSubItemClass.java | 5 +- .../tileentities/multis/GT_TileEntity_BioVat.java | 2 +- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 10 +- .../GT_TileEntity_ElectricImplosionCompressor.java | 11 +- .../tileentities/multis/GT_TileEntity_LESU.java | 3 +- .../multis/GT_TileEntity_ManualTrafo.java | 11 +- .../tileentities/multis/GT_TileEntity_THTR.java | 11 +- .../multis/GT_TileEntity_Windmill.java | 11 +- .../mega/GT_TileEntity_MegaBlastFurnace.java | 14 +- .../mega/GT_TileEntity_MegaDistillTower.java | 8 +- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 13 +- .../tiered/GT_MetaTileEntity_AcidGenerator.java | 3 +- .../tiered/GT_MetaTileEntity_BioLab.java | 2 +- .../tiered/GT_MetaTileEntity_Diode.java | 3 +- .../GT_MetaTileEntity_EnergyDistributor.java | 3 +- .../tiered/GT_MetaTileEntity_RadioHatch.java | 5 +- .../bartworks/neiHandler/BW_NEI_OreHandler.java | 4 +- .../system/material/BW_GT_MaterialReference.java | 644 +++++++++++++++++++++ .../material/BW_MetaGeneratedBlock_Item.java | 2 + .../material/BW_MetaGeneratedBlocks_Casing.java | 18 +- .../system/material/BW_MetaGenerated_Blocks.java | 12 + .../system/material/BW_MetaGenerated_Items.java | 5 +- .../material/CircuitGeneration/BW_Meta_Items.java | 5 +- .../material/GT_Enhancement/BWGTMetaItems.java | 30 +- .../bartworks/system/material/Werkstoff.java | 44 +- .../bartworks/system/material/WerkstoffLoader.java | 8 +- .../werkstoff_loaders/recipe/CasingLoader.java | 41 +- .../bartworks/system/oredict/OreDictHandler.java | 3 +- .../bartworks/util/BW_Tooltip_Reference.java | 46 ++ .../accessprioritylist/AccessPriorityList.java | 21 +- .../AccessPriorityListIterators.java | 20 + .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 11 + .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 5 +- .../crossmod/tectech/TecTechEnabledMulti.java | 4 +- .../crossmod/tectech/TecTechUtils.java | 148 ----- .../crossmod/tectech/helper/CoilAdder.java | 63 ++ .../crossmod/tectech/helper/IHasCoils.java | 28 + .../tectech/helper/StructureDefinitions.java | 52 ++ .../crossmod/tectech/helper/TecTechUtils.java | 149 +++++ .../GT_Replacement/TT_ElectronicBlastFurnace.java | 442 ++++++++++++++ .../GT_Replacement/TT_ImplosionCompressor.java | 261 +++++++++ .../multi/GT_Replacement/TT_OilCrackingUnit.java | 325 +++++++++++ .../multi/GT_Replacement/TT_VaccuumFreezer.java | 227 ++++++++ .../tiered/TT_MetaTileEntity_LowPowerLaserBox.java | 4 +- .../TT_MetaTileEntity_LowPowerLaserDynamo.java | 4 +- .../TT_MetaTileEntity_LowPowerLaserHatch.java | 4 +- .../TT_MetaTileEntity_Pipe_Energy_LowPower.java | 4 +- 60 files changed, 2494 insertions(+), 330 deletions(-) delete mode 100644 libs/TecTech-1.7.10-4.8.3-4eb40295.jar.REMOVED.git-id create mode 100644 libs/TecTech-1.7.10-4.8.3-9b640643-dev.jar.REMOVED.git-id delete mode 100644 libs/gregtech-5.09.33.52-dev.jar.REMOVED.git-id create mode 100644 libs/gregtech-5.09.33.54-dev.jar.REMOVED.git-id create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechUtils.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/CoilAdder.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/StructureDefinitions.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VaccuumFreezer.java diff --git a/libs/TecTech-1.7.10-4.8.3-4eb40295.jar.REMOVED.git-id b/libs/TecTech-1.7.10-4.8.3-4eb40295.jar.REMOVED.git-id deleted file mode 100644 index 6a3cc6b00a..0000000000 --- a/libs/TecTech-1.7.10-4.8.3-4eb40295.jar.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -c13aa64170017f7dcbb833974f75d7a99d14ae80 \ No newline at end of file diff --git a/libs/TecTech-1.7.10-4.8.3-9b640643-dev.jar.REMOVED.git-id b/libs/TecTech-1.7.10-4.8.3-9b640643-dev.jar.REMOVED.git-id new file mode 100644 index 0000000000..46ee999944 --- /dev/null +++ b/libs/TecTech-1.7.10-4.8.3-9b640643-dev.jar.REMOVED.git-id @@ -0,0 +1 @@ +3049f86f84ddb13398789bfb1e1360c492fc0b5a \ No newline at end of file diff --git a/libs/gregtech-5.09.33.52-dev.jar.REMOVED.git-id b/libs/gregtech-5.09.33.52-dev.jar.REMOVED.git-id deleted file mode 100644 index 700ca28882..0000000000 --- a/libs/gregtech-5.09.33.52-dev.jar.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -14c31c860e0a098cc07a306c5a01997664b0604f \ No newline at end of file diff --git a/libs/gregtech-5.09.33.54-dev.jar.REMOVED.git-id b/libs/gregtech-5.09.33.54-dev.jar.REMOVED.git-id new file mode 100644 index 0000000000..396d628a54 --- /dev/null +++ b/libs/gregtech-5.09.33.54-dev.jar.REMOVED.git-id @@ -0,0 +1 @@ +fdcf1725ae123ce50af73ffbe38f8f0ec312f32b \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java b/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java index 4d9fe89836..9055909567 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java @@ -52,7 +52,9 @@ public class ASMUtils { public static boolean writeClassToDisk(byte[] towrite, String Classname, String Path) { try { - OutputStream os = new FileOutputStream(new File(Path + Classname + ".class")); + if (Path.charAt(Path.length()-1) == '/' || Path.charAt(Path.length()-1) == '\\') + Path = Path.substring(0,Path.length()-1); + OutputStream os = new FileOutputStream(new File(Path + '/' + Classname + ".class")); os.write(towrite); } catch (IOException e) { e.printStackTrace(); diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java index 72a9477e59..6399a5119b 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.ASM; import com.github.bartimaeusnek.bartworks.util.NonNullWrappedHashSet; import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriorityList; +import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriorityListNode; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -31,6 +32,7 @@ import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.List; @@ -53,21 +55,16 @@ public class BWCoreStaticReplacementMethodes { if (itemstack2 != null) { if (i == 0) - { itemstack = itemstack2; - } if (i == 1) - { itemstack1 = itemstack2; - } ++i; } } - if (i == 2 && itemstack.getItem() == itemstack1.getItem() && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && itemstack.getItem().isRepairable()) - { + if (i == 2 && itemstack.getItem() == itemstack1.getItem() && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && itemstack.getItem().isRepairable()) { Item item = itemstack.getItem(); int j1 = item.getMaxDamage() - itemstack.getItemDamageForDisplay(); int k = item.getMaxDamage() - itemstack1.getItemDamageForDisplay(); @@ -75,24 +72,23 @@ public class BWCoreStaticReplacementMethodes { int i1 = item.getMaxDamage() - l; if (i1 < 0) - { i1 = 0; - } return new ItemStack(itemstack.getItem(), 1, i1); + } else { + IRecipe iPossibleRecipe = null; - int index = 0; - for (Iterator it = RECENTLYUSEDRECIPES.iterator(); it.hasNext(); ++index) { - IRecipe RECENTLYUSEDRECIPE = it.next(); - if (RECENTLYUSEDRECIPE.matches(inventoryCrafting, world)) { - iPossibleRecipe = RECENTLYUSEDRECIPE; - break; - } - } + Iterator> it = RECENTLYUSEDRECIPES.nodeIterator(); + + while (it.hasNext()) { + AccessPriorityListNode recipeNode = it.next(); + iPossibleRecipe = recipeNode.getELEMENT(); + + if (!iPossibleRecipe.matches(inventoryCrafting, world)) + continue; - if (iPossibleRecipe != null) { - RECENTLYUSEDRECIPES.addPrioToNode(index); + RECENTLYUSEDRECIPES.addPrioToNode(recipeNode); return iPossibleRecipe.getCraftingResult(inventoryCrafting); } @@ -102,10 +98,12 @@ public class BWCoreStaticReplacementMethodes { List recipeList = CraftingManager.getInstance().getRecipeList(); for (int k = 0; k < recipeList.size(); k++) { - recipeSet.add((IRecipe) recipeList.get(k)); + IRecipe r = (IRecipe) recipeList.get(k); + if (r.matches(inventoryCrafting, world)) + recipeSet.add(r); } - Object[] arr = recipeSet.parallelStream().filter(r -> r.matches(inventoryCrafting, world)).toArray(); + Object[] arr = recipeSet.toArray(); if (arr.length == 0) return null; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index a3a9fc26e0..e0c172f1cd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -26,8 +26,8 @@ import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; @@ -78,7 +78,7 @@ public class BW_ItemBlocks extends ItemBlock { if (!(this.field_150939_a instanceof ITileEntityProvider)) aList.add(this.mNoTileEntityToolTip); - aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java index c5a6efd711..ff9f43cdbf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ic2.core.WorldData; @@ -59,7 +59,7 @@ public class BW_SimpleWindMeter extends Item { super.addInformation(itemStack, entityPlayer, list, p_77624_4_); list.add(StatCollector.translateToLocal("tooltip.windmeter.0.name")); list.add(StatCollector.translateToLocal("tooltip.windmeter.1.name") + " " + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); - list.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); + list.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index efe7f5c6ca..9731b4da3b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ic2.api.item.IKineticRotor; @@ -83,7 +83,7 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { if (type != null) { info.add(StatCollector.translateToLocal(("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type)))); } - info.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); + info.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index 29c14101a6..b2f633c105 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; @@ -56,7 +56,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem super.addInformation(aStack, aPlayer, aList, aF3_H); if (aStack != null && aStack.getTagCompound() != null) aList.add(StatCollector.translateToLocal("tooltip.cp.0.name") + " " + (aStack.getTagCompound().getBoolean("HasChip") ? StatCollector.translateToLocal("tooltip.bw.yes.name") : StatCollector.translateToLocal("tooltip.bw.no.name"))); - aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java index c6a6782e34..15e16008ad 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -23,14 +23,13 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.items.GT_Generic_Item; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; @@ -49,7 +48,7 @@ public class GT_Destructopack_Item extends GT_Generic_Item { @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); - aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index 3c132cef88..a1b222f7c3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.google.common.collect.Sets; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -76,7 +76,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { aList.add(StatCollector.translateToLocal("tooltip.bw.tier.name") + " " + GT_Values.VN[this.mTier]); - aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } public void onUpdate(ItemStack aStack, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java index ba46ded1b2..9b4c1ba51c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.google.common.collect.Sets; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -69,7 +69,7 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { aList.add(StatCollector.translateToLocal("tooltip.teslastaff.0.name")); - aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } public boolean hitEntity(ItemStack aStack, EntityLivingBase aTarget, EntityLivingBase aPlayer) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java index 34bf243c1b..a363ab6811 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; @@ -32,7 +32,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import java.util.List; @@ -60,7 +59,7 @@ public class SimpleSubItemClass extends Item { @SuppressWarnings("unchecked") public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); - aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 90b0c4ff7d..f13f11607c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -572,7 +572,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { String[] fdsc = new String[dsc.length + 1]; for (int i = 0; i < dsc.length; i++) { fdsc[i] = dsc[i]; - fdsc[dsc.length] = StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; + fdsc[dsc.length] = BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get(); } return fdsc; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 45bcd28218..9de9f736cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -26,7 +26,6 @@ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_M import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -40,12 +39,13 @@ import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import java.util.Collection; import java.util.HashSet; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; + public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBlockBase { public String getTypeForDisplay() { @@ -129,6 +129,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = this.bufferedRecipe.mOutputs; this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; + sendLoopStart((byte) 20); this.updateSlots(); return true; } @@ -217,9 +218,8 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl --length; - if (length < -7){ + if (length < -7) return false; - } } @@ -361,7 +361,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl "Imprint this machine with a Circuit Imprint,", "by putting the imprint in the controller.", "Every Circuit Assembly Line can only be imprinted ONCE.", - StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks" + ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index bd45fe554a..18e6a43ebc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -22,7 +22,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -33,7 +33,6 @@ import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ImplosionCo import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; @@ -249,12 +248,6 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity @Override public String[] getDescription() { - String[] dsc = StatCollector.translateToLocal("tooltip.tile.eic.0.name").split(";"); - String[] mDescription = new String[dsc.length + 1]; - for (int i = 0; i < dsc.length; i++) { - mDescription[i] = dsc[i]; - mDescription[dsc.length] = StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; - } - return mDescription; + return BW_Tooltip_Reference.getTranslatedBrandedTooltip("tooltip.tile.eic.0.name"); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 5f6dde9c7f..533cf24d70 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -27,6 +27,7 @@ import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_LESU; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_LESU; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.ConnectedBlocksChecker; import cpw.mods.fml.common.FMLCommonHandler; @@ -163,7 +164,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { dsc = StatCollector.translateToLocal("tooltip.tile.lesu.2.name").split(";"); Collections.addAll(e, dsc); e.add(ChatColorHelper.RED + StatCollector.translateToLocal("tooltip.tile.lesu.3.name")); - e.add(StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"); + e.add(BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); return e.toArray(new String[0]); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index 06c8324457..9c43cff7de 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -37,7 +37,6 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import static gregtech.api.enums.GT_Values.V; @@ -374,13 +373,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase @Override public String[] getDescription() { - String[] dsc = StatCollector.translateToLocal("tooltip.tile.manualtravo.0.name").split(";"); - String[] fdsc = new String[dsc.length + 1]; - for (int i = 0; i < dsc.length; i++) { - fdsc[i] = dsc[i]; - fdsc[dsc.length] = StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; - } - return fdsc; + return BW_Tooltip_Reference.getTranslatedBrandedTooltip("tooltip.tile.manualtravo.0.name"); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index dc85f9476d..d46754840d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -24,8 +24,8 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.MathUtils; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; @@ -45,7 +45,6 @@ import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; @@ -319,13 +318,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public String[] getDescription() { - String[] dsc = StatCollector.translateToLocal("tooltip.tile.htr.0.name").split(";"); - String[] mDescription = new String[dsc.length + 1]; - for (int i = 0; i < dsc.length; i++) { - mDescription[i] = dsc[i]; - mDescription[dsc.length] = StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; - } - return mDescription; + return BW_Tooltip_Reference.getTranslatedBrandedTooltip("tooltip.tile.htr.0.name"); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 69a20db22c..2bea093f2a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -26,8 +26,8 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_Windmill; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; import com.github.bartimaeusnek.bartworks.server.container.BW_Container_Windmill; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -55,7 +55,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import java.util.Arrays; @@ -588,13 +587,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @Override public String[] getDescription() { - String[] dsc = StatCollector.translateToLocal("tooltip.tile.windmill.0.name").split(";"); - String[] fdsc = new String[dsc.length + 1]; - for (int i = 0; i < dsc.length; i++) { - fdsc[i] = dsc[i]; - fdsc[dsc.length] = StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; - } - return fdsc; + return BW_Tooltip_Reference.getTranslatedBrandedTooltip("tooltip.tile.windmill.0.name"); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 86ac7fc73d..233810028f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -26,11 +26,11 @@ import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.MegaUtils; import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; -import com.github.bartimaeusnek.crossmod.tectech.TecTechUtils; +import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.LowPowerLaser; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; @@ -91,7 +91,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl String[] fdsc = new String[dsc.length + 1]; for (int i = 0; i < dsc.length; i++) { fdsc[i] = dsc[i]; - fdsc[dsc.length] = StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; + fdsc[dsc.length] = BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get(); } return fdsc; } @@ -448,7 +448,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return false; if (LoaderReference.tectech && this.glasTier != 8) - if (!areLazorsLowPowa() || !areThingsProperlyTiered(this.getTecTechEnergyTunnels()) || !areThingsProperlyTiered(this.getTecTechEnergyMultis())) + if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) return false; if (this.glasTier != 8 && !this.mEnergyHatches.isEmpty()) @@ -461,12 +461,12 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl @SuppressWarnings("rawtypes") @Optional.Method(modid = "tectech") - private boolean areThingsProperlyTiered(Collection collection) { + private boolean areThingsNotProperlyTiered(Collection collection) { if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) - return false; - return true; + return true; + return false; } @SuppressWarnings("rawtypes") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 33434bb9d6..1d565567a5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -23,10 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import com.github.bartimaeusnek.bartworks.util.MathUtils; -import com.github.bartimaeusnek.bartworks.util.MegaUtils; +import com.github.bartimaeusnek.bartworks.util.*; import com.google.common.collect.ArrayListMultimap; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -38,7 +35,6 @@ import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DistillationTower; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -76,7 +72,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati "Fluids are only put out at the correct height", "The correct height equals the slot number in the NEI recipe", "Clean Stainless Steel Machine Casings for the rest (15 x h - 5 at least!)", - StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks" + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 2d553a506e..6a3c6ae7ae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -24,11 +24,11 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.MegaUtils; import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; -import com.github.bartimaeusnek.crossmod.tectech.TecTechUtils; +import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -39,7 +39,6 @@ import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_VacuumFreezer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; import java.util.ArrayList; import java.util.List; @@ -58,13 +57,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre } public String[] getDescription() { - String[] dsc = StatCollector.translateToLocal("tooltip.tile.mvf.0.name").split(";"); - String[] fdsc = new String[dsc.length + 1]; - for (int i = 0; i < dsc.length; i++) { - fdsc[i] = dsc[i]; - fdsc[dsc.length] = StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"; - } - return fdsc; + return BW_Tooltip_Reference.getTranslatedBrandedTooltip("tooltip.tile.mvf.0.name"); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index 9d17accb06..3188ce4aa1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; @@ -109,6 +110,6 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene } public String[] getDescription() { - return new String[]{StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + ChatColorHelper.YELLOW + this.getEfficiency(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; + return new String[]{StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + ChatColorHelper.YELLOW + this.getEfficiency(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index fccba2ae65..149c9e09fd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -268,6 +268,6 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { @Override public String[] getDescription() { - return new String[]{StatCollector.translateToLocal("tooltip.tile.biolab.0.name"), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; + return new String[]{StatCollector.translateToLocal("tooltip.tile.biolab.0.name"), BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index 3d82290fac..28e4bd2d7f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.ITexture; @@ -123,6 +124,6 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{this.mDescription, StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; + return new String[]{this.mDescription, StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java index eb19af2040..e011d08609 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.ITexture; @@ -70,7 +71,7 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans } public String[] getDescription() { - return new String[]{StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; + return new String[]{StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 9b6154b4aa..40b6904c02 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -29,10 +29,9 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.MathUtils; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; -import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.Textures; @@ -62,7 +61,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { private byte coverage; public GT_MetaTileEntity_RadioHatch(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name") + " " + (aTier - 2) + " " + ((aTier - 2) >= 2 ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") : StatCollector.translateToLocal("tooltip.bw.kg.0.name")), StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}); + super(aID, aName, aNameRegional, aTier, 1, new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name") + " " + (aTier - 2) + " " + ((aTier - 2) >= 2 ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") : StatCollector.translateToLocal("tooltip.bw.kg.0.name")), StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"), BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}); this.cap = aTier - 2; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index 677a9af5f7..c54667c431 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -74,10 +74,10 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public void loadCraftingRecipes(String outputId, Object... results) { if (outputId.equalsIgnoreCase("quickanddirtyneihandler")) { HashSet result = new HashSet<>(); - Werkstoff.werkstoffHashSet.stream().filter(w -> w.getGenerationFeatures().hasOres()).forEach(w -> result.add(w.get(OrePrefixes.ore))); + Werkstoff.werkstoffHashSet.stream().filter(w -> w.hasGenerationFeature(OrePrefixes.ore)).forEach(w -> result.add(w.get(OrePrefixes.ore))); result.forEach(this::loadCraftingRecipes); result.clear(); - Werkstoff.werkstoffHashSet.stream().filter(w -> w.getGenerationFeatures().hasOres()).forEach(w -> result.add(w.get(OrePrefixes.oreSmall))); + Werkstoff.werkstoffHashSet.stream().filter(w -> w.hasGenerationFeature(OrePrefixes.ore)).forEach(w -> result.add(w.get(OrePrefixes.oreSmall))); result.forEach(this::loadCraftingRecipes); result.clear(); HashSet hashSet = new HashSet<>(this.arecipes); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java new file mode 100644 index 0000000000..f22d9ac470 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java @@ -0,0 +1,644 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package com.github.bartimaeusnek.bartworks.system.material; + +import com.github.bartimaeusnek.bartworks.MainMod; +import gregtech.api.enums.Materials; +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.Types.*; + +public class BW_GT_MaterialReference { + private static final Werkstoff.GenerationFeatures ADD_CASINGS_ONLY = new Werkstoff.GenerationFeatures().disable().addCasings(); + + public static Werkstoff Aluminium = new Werkstoff(Materials.Aluminium, ADD_CASINGS_ONLY, ELEMENT,31_766+19); + public static Werkstoff Americium = new Werkstoff(Materials.Americium, ADD_CASINGS_ONLY, ELEMENT,31_766+103); + public static Werkstoff Antimony = new Werkstoff(Materials.Antimony, ADD_CASINGS_ONLY, ELEMENT, 31_766+58); +// public static Werkstoff Argon = new Werkstoff(Materials.Argon, ADD_CASINGS_ONLY, ELEMENT, 31_766+24); + public static Werkstoff Arsenic = new Werkstoff(Materials.Arsenic, ADD_CASINGS_ONLY, ELEMENT, 31_766+39); + public static Werkstoff Barium = new Werkstoff(Materials.Barium, ADD_CASINGS_ONLY, ELEMENT, 31_766+63); + public static Werkstoff Beryllium = new Werkstoff(Materials.Beryllium, ADD_CASINGS_ONLY, ELEMENT, 31_766+8); + public static Werkstoff Bismuth = new Werkstoff(Materials.Bismuth, ADD_CASINGS_ONLY, ELEMENT, 31_766+90); + public static Werkstoff Boron = new Werkstoff(Materials.Boron, ADD_CASINGS_ONLY, ELEMENT, 31_766+9); + public static Werkstoff Caesium = new Werkstoff(Materials.Caesium, ADD_CASINGS_ONLY, ELEMENT, 31_766+62); +// public static Werkstoff Calcium = new Werkstoff(Materials.Calcium, ADD_CASINGS_ONLY, ELEMENT, 31_766+26); + public static Werkstoff Carbon = new Werkstoff(Materials.Carbon, ADD_CASINGS_ONLY, ELEMENT, 31_766+10); + public static Werkstoff Cadmium = new Werkstoff(Materials.Cadmium, ADD_CASINGS_ONLY, ELEMENT, 31_766+55); + public static Werkstoff Cerium = new Werkstoff(Materials.Cerium, ADD_CASINGS_ONLY, ELEMENT, 31_766+65); +// public static Werkstoff Chlorine = new Werkstoff(Materials.Chlorine, ADD_CASINGS_ONLY, ELEMENT, 31_766+23); + public static Werkstoff Chrome = new Werkstoff(Materials.Chrome, ADD_CASINGS_ONLY, ELEMENT, 31_766+30); + public static Werkstoff Cobalt = new Werkstoff(Materials.Cobalt, ADD_CASINGS_ONLY, ELEMENT, 31_766+33); + public static Werkstoff Copper = new Werkstoff(Materials.Copper, ADD_CASINGS_ONLY, ELEMENT, 31_766+35); +// public static Werkstoff Deuterium = new Werkstoff(Materials.Deuterium, ADD_CASINGS_ONLY, ELEMENT, 31_766+2); + public static Werkstoff Dysprosium = new Werkstoff(Materials.Dysprosium, ADD_CASINGS_ONLY, ELEMENT, 31_766+73); +// public static Werkstoff Empty = new Werkstoff(Materials.Empty, ADD_CASINGS_ONLY, ELEMENT, 31_766+0); + public static Werkstoff Erbium = new Werkstoff(Materials.Erbium, ADD_CASINGS_ONLY, ELEMENT, 31_766+75); + public static Werkstoff Europium = new Werkstoff(Materials.Europium, ADD_CASINGS_ONLY, ELEMENT, 31_766+70); +// public static Werkstoff Fluorine = new Werkstoff(Materials.Fluorine, ADD_CASINGS_ONLY, ELEMENT, 31_766+14); + public static Werkstoff Gadolinium = new Werkstoff(Materials.Gadolinium, ADD_CASINGS_ONLY, ELEMENT, 31_766+71); + public static Werkstoff Gallium = new Werkstoff(Materials.Gallium, ADD_CASINGS_ONLY, ELEMENT, 31_766+37); + public static Werkstoff Gold = new Werkstoff(Materials.Gold, ADD_CASINGS_ONLY, ELEMENT, 31_766+86); + public static Werkstoff Holmium = new Werkstoff(Materials.Holmium, ADD_CASINGS_ONLY, ELEMENT, 31_766+74); +// public static Werkstoff Hydrogen = new Werkstoff(Materials.Hydrogen, ADD_CASINGS_ONLY, ELEMENT, 31_766+1); +// public static Werkstoff Helium = new Werkstoff(Materials.Helium, ADD_CASINGS_ONLY, ELEMENT, 31_766+4); +// public static Werkstoff Helium_3 = new Werkstoff(Materials.Helium_3, ADD_CASINGS_ONLY, ELEMENT, 31_766+5); + public static Werkstoff Indium = new Werkstoff(Materials.Indium, ADD_CASINGS_ONLY, ELEMENT, 31_766+56); + public static Werkstoff Iridium = new Werkstoff(Materials.Iridium, ADD_CASINGS_ONLY, ELEMENT, 31_766+84); + public static Werkstoff Iron = new Werkstoff(Materials.Iron, ADD_CASINGS_ONLY, ELEMENT, 31_766+32); + public static Werkstoff Lanthanum = new Werkstoff(Materials.Lanthanum, ADD_CASINGS_ONLY, ELEMENT, 31_766+64); + public static Werkstoff Lead = new Werkstoff(Materials.Lead, ADD_CASINGS_ONLY, ELEMENT, 31_766+89); + public static Werkstoff Lithium = new Werkstoff(Materials.Lithium, ADD_CASINGS_ONLY, ELEMENT, 31_766+6); + public static Werkstoff Lutetium = new Werkstoff(Materials.Lutetium, ADD_CASINGS_ONLY, ELEMENT, 31_766+78); + public static Werkstoff Magnesium = new Werkstoff(Materials.Magnesium, ADD_CASINGS_ONLY, ELEMENT, 31_766+18); + public static Werkstoff Manganese = new Werkstoff(Materials.Manganese, ADD_CASINGS_ONLY, ELEMENT, 31_766+31); +// public static Werkstoff Mercury = new Werkstoff(Materials.Mercury, ADD_CASINGS_ONLY, ELEMENT, 31_766+87); + public static Werkstoff Molybdenum = new Werkstoff(Materials.Molybdenum, ADD_CASINGS_ONLY, ELEMENT, 31_766+48); + public static Werkstoff Neodymium = new Werkstoff(Materials.Neodymium, ADD_CASINGS_ONLY, ELEMENT, 31_766+67); + public static Werkstoff Neutronium = new Werkstoff(Materials.Neutronium, ADD_CASINGS_ONLY, ELEMENT,31_766+129); + public static Werkstoff Nickel = new Werkstoff(Materials.Nickel, ADD_CASINGS_ONLY, ELEMENT, 31_766+34); + public static Werkstoff Niobium = new Werkstoff(Materials.Niobium, ADD_CASINGS_ONLY, ELEMENT, 31_766+47); +// public static Werkstoff Nitrogen = new Werkstoff(Materials.Nitrogen, ADD_CASINGS_ONLY, ELEMENT, 31_766+12); + public static Werkstoff Osmium = new Werkstoff(Materials.Osmium, ADD_CASINGS_ONLY, ELEMENT, 31_766+83); +// public static Werkstoff Oxygen = new Werkstoff(Materials.Oxygen, ADD_CASINGS_ONLY, ELEMENT, 31_766+13); + public static Werkstoff Palladium = new Werkstoff(Materials.Palladium, ADD_CASINGS_ONLY, ELEMENT, 31_766+52); + public static Werkstoff Phosphorus = new Werkstoff(Materials.Phosphorus, ADD_CASINGS_ONLY, ELEMENT, 31_766+21); + public static Werkstoff Platinum = new Werkstoff(Materials.Platinum, ADD_CASINGS_ONLY, ELEMENT, 31_766+85); + public static Werkstoff Plutonium = new Werkstoff(Materials.Plutonium, ADD_CASINGS_ONLY, ELEMENT,31_766+100); + public static Werkstoff Plutonium241 = new Werkstoff(Materials.Plutonium241, ADD_CASINGS_ONLY, ISOTOPE,31_766+101); + public static Werkstoff Potassium = new Werkstoff(Materials.Potassium, ADD_CASINGS_ONLY, ELEMENT, 31_766+25); + public static Werkstoff Praseodymium = new Werkstoff(Materials.Praseodymium, ADD_CASINGS_ONLY, ELEMENT, 31_766+66); + public static Werkstoff Promethium = new Werkstoff(Materials.Promethium, ADD_CASINGS_ONLY, ELEMENT, 31_766+68); +// public static Werkstoff Radon = new Werkstoff(Materials.Radon, ADD_CASINGS_ONLY, ELEMENT, 31_766+93); + public static Werkstoff Rubidium = new Werkstoff(Materials.Rubidium, ADD_CASINGS_ONLY, ELEMENT, 31_766+43); + public static Werkstoff Samarium = new Werkstoff(Materials.Samarium, ADD_CASINGS_ONLY, ELEMENT, 31_766+69); + public static Werkstoff Scandium = new Werkstoff(Materials.Scandium, ADD_CASINGS_ONLY, ELEMENT, 31_766+27); + public static Werkstoff Silicon = new Werkstoff(Materials.Silicon, ADD_CASINGS_ONLY, ELEMENT, 31_766+20); + public static Werkstoff Silver = new Werkstoff(Materials.Silver, ADD_CASINGS_ONLY, ELEMENT, 31_766+54); + public static Werkstoff Sodium = new Werkstoff(Materials.Sodium, ADD_CASINGS_ONLY, ELEMENT, 31_766+17); + public static Werkstoff Strontium = new Werkstoff(Materials.Strontium, ADD_CASINGS_ONLY, ELEMENT, 31_766+44); + public static Werkstoff Sulfur = new Werkstoff(Materials.Sulfur, ADD_CASINGS_ONLY, ELEMENT, 31_766+22); + public static Werkstoff Tantalum = new Werkstoff(Materials.Tantalum, ADD_CASINGS_ONLY, ELEMENT, 31_766+80); +// public static Werkstoff Tellurium = new Werkstoff(Materials.Tellurium, ADD_CASINGS_ONLY, ELEMENT, 31_766+59); + public static Werkstoff Terbium = new Werkstoff(Materials.Terbium, ADD_CASINGS_ONLY, ELEMENT, 31_766+72); + public static Werkstoff Thorium = new Werkstoff(Materials.Thorium, ADD_CASINGS_ONLY, ELEMENT, 31_766+96); + public static Werkstoff Thulium = new Werkstoff(Materials.Thulium, ADD_CASINGS_ONLY, ELEMENT, 31_766+76); + public static Werkstoff Tin = new Werkstoff(Materials.Tin, ADD_CASINGS_ONLY, ELEMENT, 31_766+57); + public static Werkstoff Titanium = new Werkstoff(Materials.Titanium, ADD_CASINGS_ONLY, ELEMENT, 31_766+28); + public static Werkstoff Tritanium = new Werkstoff(Materials.Tritanium, ADD_CASINGS_ONLY, ELEMENT,31_766+329); + public static Werkstoff Tritium = new Werkstoff(Materials.Tritium, ADD_CASINGS_ONLY, ELEMENT, 31_766+3); + public static Werkstoff Tungsten = new Werkstoff(Materials.Tungsten, ADD_CASINGS_ONLY, ELEMENT, 31_766+81); + public static Werkstoff Uranium = new Werkstoff(Materials.Uranium, ADD_CASINGS_ONLY, ELEMENT, 31_766+98); + public static Werkstoff Uranium235 = new Werkstoff(Materials.Uranium235, ADD_CASINGS_ONLY, ISOTOPE, 31_766+97); + public static Werkstoff Vanadium = new Werkstoff(Materials.Vanadium, ADD_CASINGS_ONLY, ELEMENT, 31_766+29); + public static Werkstoff Ytterbium = new Werkstoff(Materials.Ytterbium, ADD_CASINGS_ONLY, ELEMENT, 31_766+77); + public static Werkstoff Yttrium = new Werkstoff(Materials.Yttrium, ADD_CASINGS_ONLY, ELEMENT, 31_766+45); + public static Werkstoff Zinc = new Werkstoff(Materials.Zinc, ADD_CASINGS_ONLY, ELEMENT, 31_766+36); + public static Werkstoff Ardite = new Werkstoff(Materials.Ardite, ADD_CASINGS_ONLY, ELEMENT,31_766+382); + public static Werkstoff Naquadah = new Werkstoff(Materials.Naquadah, ADD_CASINGS_ONLY, ELEMENT,31_766+324); + public static Werkstoff NaquadahAlloy = new Werkstoff(Materials.NaquadahAlloy, ADD_CASINGS_ONLY, COMPOUND,31_766+325); + public static Werkstoff NaquadahEnriched = new Werkstoff(Materials.NaquadahEnriched, ADD_CASINGS_ONLY, ISOTOPE,31_766+326); + public static Werkstoff Naquadria = new Werkstoff(Materials.Naquadria, ADD_CASINGS_ONLY, ELEMENT,31_766+327); + public static Werkstoff WroughtIron = new Werkstoff(Materials.WroughtIron, ADD_CASINGS_ONLY, ISOTOPE,31_766+304); + public static Werkstoff AnnealedCopper = new Werkstoff(Materials.AnnealedCopper, ADD_CASINGS_ONLY, ISOTOPE,31_766+345); + + public static Werkstoff Osmiridium = new Werkstoff(Materials.Osmiridium, ADD_CASINGS_ONLY, MIXTURE,31_766+317); + public static Werkstoff SterlingSilver = new Werkstoff(Materials.SterlingSilver, ADD_CASINGS_ONLY, MIXTURE,31_766+350); + public static Werkstoff RoseGold = new Werkstoff(Materials.RoseGold, ADD_CASINGS_ONLY, MIXTURE,31_766+351); + public static Werkstoff BlackBronze = new Werkstoff(Materials.BlackBronze, ADD_CASINGS_ONLY, MIXTURE,31_766+352); + public static Werkstoff BismuthBronze = new Werkstoff(Materials.BismuthBronze, ADD_CASINGS_ONLY, MIXTURE,31_766+353); + public static Werkstoff BlackSteel = new Werkstoff(Materials.BlackSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+334); + public static Werkstoff RedSteel = new Werkstoff(Materials.RedSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+348); + public static Werkstoff BlueSteel = new Werkstoff(Materials.BlueSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+349); + public static Werkstoff DamascusSteel = new Werkstoff(Materials.DamascusSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+335); + public static Werkstoff TungstenSteel = new Werkstoff(Materials.TungstenSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+316); + public static Werkstoff Ultimet = new Werkstoff(Materials.Ultimet, ADD_CASINGS_ONLY, MIXTURE,31_766+344); + public static Werkstoff TungstenCarbide = new Werkstoff(Materials.TungstenCarbide, ADD_CASINGS_ONLY, MIXTURE,31_766+370); + public static Werkstoff VanadiumSteel = new Werkstoff(Materials.VanadiumSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+371); + public static Werkstoff HSSG = new Werkstoff(Materials.HSSG, ADD_CASINGS_ONLY, MIXTURE,31_766+372); + public static Werkstoff HSSE = new Werkstoff(Materials.HSSE, ADD_CASINGS_ONLY, MIXTURE,31_766+373); + public static Werkstoff HSSS = new Werkstoff(Materials.HSSS, ADD_CASINGS_ONLY, MIXTURE,31_766+374); + public static Werkstoff StainlessSteel = new Werkstoff(Materials.StainlessSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+306); + public static Werkstoff Brass = new Werkstoff(Materials.Brass, ADD_CASINGS_ONLY, MIXTURE,31_766+301); + public static Werkstoff Bronze = new Werkstoff(Materials.Bronze, ADD_CASINGS_ONLY, MIXTURE,31_766+300); + + public static Werkstoff Wood = new Werkstoff(Materials.Wood, ADD_CASINGS_ONLY, BIOLOGICAL,31_766+809); + // public static Werkstoff WoodSealed = new Werkstoff(Materials.WoodSealed, ADD_CASINGS_ONLY, BIOLOGICAL,31_766+889); + public static Werkstoff Cheese = new Werkstoff(Materials.Cheese, new Werkstoff.GenerationFeatures().addCasings().addMetalItems().addMultipleIngotMetalWorkingItems().enforceUnification(), BIOLOGICAL,31_766+894); + + public static Werkstoff Steel = new Werkstoff(Materials.Steel, ADD_CASINGS_ONLY, COMPOUND,31_766+305); + public static Werkstoff Polytetrafluoroethylene = new Werkstoff(Materials.Polytetrafluoroethylene, ADD_CASINGS_ONLY, COMPOUND,31_766+473); + public static Werkstoff Plastic = new Werkstoff(Materials.Plastic, ADD_CASINGS_ONLY, COMPOUND,31_766+874); + public static Werkstoff Epoxid = new Werkstoff(Materials.Epoxid, ADD_CASINGS_ONLY, COMPOUND,31_766+470); + + public static void init() { + MainMod.LOGGER.info("Load Elements from GT"); + } + +// TODO: GT++ only? + +// public static Werkstoff Flerovium = new Werkstoff(Materials.Flerovium, , ,31_766+984); + +// public static Werkstoff HeeEndium = new Werkstoff(Materials.HeeEndium, , ,31_766+770); +// public static Werkstoff PlatinumGroupSludge = new Werkstoff(Materials.PlatinumGroupSludge, , ,31_766+241); +// public static Werkstoff Draconium = new Werkstoff(Materials.Draconium, , ,31_766+975); +// public static Werkstoff DraconiumAwakened = new Werkstoff(Materials.DraconiumAwakened, , ,31_766+976); +// public static Werkstoff Adamantium = new Werkstoff(Materials.Adamantium, , ,31_766+319); +// public static Werkstoff Alduorite = new Werkstoff(Materials.Alduorite, , ,31_766+485); +// public static Werkstoff Amber = new Werkstoff(Materials.Amber, , ,31_766+514); +// public static Werkstoff Angmallen = new Werkstoff(Materials.Angmallen, , ,31_766+958); + +// public static Werkstoff Atlarus = new Werkstoff(Materials.Atlarus, , ,31_766+965); +// public static Werkstoff Blizz = new Werkstoff(Materials.Blizz, , ,31_766+851); +// public static Werkstoff Blueschist = new Werkstoff(Materials.Blueschist, , ,31_766+852); +// public static Werkstoff Bluestone = new Werkstoff(Materials.Bluestone, , ,31_766+813); +// public static Werkstoff Carmot = new Werkstoff(Materials.Carmot, , ,31_766+962); +// public static Werkstoff Celenegil = new Werkstoff(Materials.Celenegil, , ,31_766+964); +// public static Werkstoff CertusQuartz = new Werkstoff(Materials.CertusQuartz, , ,31_766+516); +// public static Werkstoff Ceruclase = new Werkstoff(Materials.Ceruclase, , ,31_766+952); +// public static Werkstoff CobaltHexahydrate = new Werkstoff(Materials.CobaltHexahydrate, , ,31_766+853); +// public static Werkstoff ConstructionFoam = new Werkstoff(Materials.ConstructionFoam, , ,31_766+854); +// public static Werkstoff Chert = new Werkstoff(Materials.Chert, , ,31_766+857); +// public static Werkstoff CrudeOil = new Werkstoff(Materials.CrudeOil, , ,31_766+858); +// public static Werkstoff Dacite = new Werkstoff(Materials.Dacite, , ,31_766+859); +// public static Werkstoff DarkIron = new Werkstoff(Materials.DarkIron, , ,31_766+342); +// public static Werkstoff Desh = new Werkstoff(Materials.Desh, , ,31_766+884); +// public static Werkstoff Dilithium = new Werkstoff(Materials.Dilithium, , ,31_766+515); +// public static Werkstoff Duranium = new Werkstoff(Materials.Duranium, , ,31_766+328); +// public static Werkstoff Eclogite = new Werkstoff(Materials.Eclogite, , ,31_766+860); +// public static Werkstoff ElectrumFlux = new Werkstoff(Materials.ElectrumFlux, , ,31_766+320); +// public static Werkstoff Emery = new Werkstoff(Materials.Emery, , ,31_766+861); +// public static Werkstoff EnderiumBase = new Werkstoff(Materials.EnderiumBase, , ,31_766+380); +// public static Werkstoff Epidote = new Werkstoff(Materials.Epidote, , ,31_766+862); +// public static Werkstoff Eximite = new Werkstoff(Materials.Eximite, , ,31_766+959); +// public static Werkstoff FierySteel = new Werkstoff(Materials.FierySteel, , ,31_766+346); +// public static Werkstoff Firestone = new Werkstoff(Materials.Firestone, , ,31_766+347); +// public static Werkstoff FoolsRuby = new Werkstoff(Materials.FoolsRuby, , ,31_766+512); +// public static Werkstoff Force = new Werkstoff(Materials.Force, , ,31_766+521); +// public static Werkstoff Forcicium = new Werkstoff(Materials.Forcicium, , ,31_766+518); +// public static Werkstoff Forcillium = new Werkstoff(Materials.Forcillium, , ,31_766+519); +// public static Werkstoff Gabbro = new Werkstoff(Materials.Gabbro, , ,31_766+863); +// public static Werkstoff Glowstone = new Werkstoff(Materials.Glowstone, , ,31_766+811); +// public static Werkstoff Gneiss = new Werkstoff(Materials.Gneiss, , ,31_766+864); +// public static Werkstoff Graphite = new Werkstoff(Materials.Graphite, , ,31_766+865); +// public static Werkstoff Graphene = new Werkstoff(Materials.Graphene, , ,31_766+819); +// public static Werkstoff Greenschist = new Werkstoff(Materials.Greenschist, , ,31_766+866); +// public static Werkstoff Greenstone = new Werkstoff(Materials.Greenstone, , ,31_766+867); +// public static Werkstoff Greywacke = new Werkstoff(Materials.Greywacke, , ,31_766+897); +// public static Werkstoff Haderoth = new Werkstoff(Materials.Haderoth, , ,31_766+963); +// public static Werkstoff Hepatizon = new Werkstoff(Materials.Hepatizon, , ,31_766+957); +// public static Werkstoff HSLA = new Werkstoff(Materials.HSLA, , ,31_766+322); +// public static Werkstoff Ignatius = new Werkstoff(Materials.Ignatius, , ,31_766+950); +// public static Werkstoff Infuscolium = new Werkstoff(Materials.Infuscolium, , ,31_766+490); +// public static Werkstoff InfusedGold = new Werkstoff(Materials.InfusedGold, , ,31_766+323); +// public static Werkstoff InfusedAir = new Werkstoff(Materials.InfusedAir, , ,31_766+540); +// public static Werkstoff InfusedFire = new Werkstoff(Materials.InfusedFire, , ,31_766+541); +// public static Werkstoff InfusedEarth = new Werkstoff(Materials.InfusedEarth, , ,31_766+542); +// public static Werkstoff InfusedWater = new Werkstoff(Materials.InfusedWater, , ,31_766+543); +// public static Werkstoff InfusedEntropy = new Werkstoff(Materials.InfusedEntropy, , ,31_766+544); +// public static Werkstoff InfusedOrder = new Werkstoff(Materials.InfusedOrder, , ,31_766+545); +// public static Werkstoff Inolashite = new Werkstoff(Materials.Inolashite, , ,31_766+954); +// public static Werkstoff Jade = new Werkstoff(Materials.Jade, , ,31_766+537); +// public static Werkstoff Jasper = new Werkstoff(Materials.Jasper, , ,31_766+511); +// public static Werkstoff Kalendrite = new Werkstoff(Materials.Kalendrite, , ,31_766+953); +// public static Werkstoff Komatiite = new Werkstoff(Materials.Komatiite, , ,31_766+869); +// public static Werkstoff Lava = new Werkstoff(Materials.Lava, , ,31_766+700); +// public static Werkstoff Lemurite = new Werkstoff(Materials.Lemurite, , ,31_766+486); +// public static Werkstoff MeteoricIron = new Werkstoff(Materials.MeteoricIron, , ,31_766+340); +// public static Werkstoff MeteoricSteel = new Werkstoff(Materials.MeteoricSteel, , ,31_766+341); +// public static Werkstoff Meutoite = new Werkstoff(Materials.Meutoite, , ,31_766+487); +// public static Werkstoff Migmatite = new Werkstoff(Materials.Migmatite, , ,31_766+872); + +// public static Werkstoff NetherBrick = new Werkstoff(Materials.NetherBrick, , ,31_766+814); +// public static Werkstoff NetherQuartz = new Werkstoff(Materials.NetherQuartz, , ,31_766+522); +// public static Werkstoff NetherStar = new Werkstoff(Materials.NetherStar, , ,31_766+506); +// public static Werkstoff Oilsands = new Werkstoff(Materials.Oilsands, , ,31_766+878); +// public static Werkstoff Orichalcum = new Werkstoff(Materials.Orichalcum, , ,31_766+966); +// public static Werkstoff Oureclase = new Werkstoff(Materials.Oureclase, , ,31_766+961); +// public static Werkstoff Prometheum = new Werkstoff(Materials.Prometheum, , ,31_766+960); +// public static Werkstoff Quartzite = new Werkstoff(Materials.Quartzite, , ,31_766+523); +// public static Werkstoff Rhyolite = new Werkstoff(Materials.Rhyolite, , ,31_766+875); +// public static Werkstoff Rubracium = new Werkstoff(Materials.Rubracium, , ,31_766+488); +// public static Werkstoff Sanguinite = new Werkstoff(Materials.Sanguinite, , ,31_766+955); +// public static Werkstoff Siltstone = new Werkstoff(Materials.Siltstone, , ,31_766+876); +// public static Werkstoff Tartarite = new Werkstoff(Materials.Tartarite, , ,31_766+956); +// public static Werkstoff UUAmplifier = new Werkstoff(Materials.UUAmplifier, , ,31_766+721); +// public static Werkstoff UUMatter = new Werkstoff(Materials.UUMatter, , ,31_766+703); +// public static Werkstoff Void = new Werkstoff(Materials.Void, , ,31_766+970); +// public static Werkstoff Vulcanite = new Werkstoff(Materials.Vulcanite, , ,31_766+489); +// public static Werkstoff Vyroxeres = new Werkstoff(Materials.Vyroxeres, , ,31_766+951); +// public static Werkstoff BioFuel = new Werkstoff(Materials.BioFuel, , ,31_766+705); +// public static Werkstoff Biomass = new Werkstoff(Materials.Biomass, , ,31_766+704); +// public static CharcoalByproducts = new MaterialBuilder + +// public static Werkstoff Chili = new Werkstoff(Materials.Chili, , ,31_766+895); +// public static Werkstoff Chocolate = new Werkstoff(Materials.Chocolate, , ,31_766+886); +// public static Werkstoff CoalFuel = new Werkstoff(Materials.CoalFuel, , ,31_766+710); +// public static Werkstoff Cocoa = new Werkstoff(Materials.Cocoa, , ,31_766+887); +// public static Werkstoff Coffee = new Werkstoff(Materials.Coffee, , ,31_766+888); +// public static Werkstoff Creosote = new Werkstoff(Materials.Creosote, , ,31_766+712); +// public static Werkstoff Ethanol = new Werkstoff(Materials.Ethanol, , ,31_766+706); +// public static FermentedBiomass = new MaterialBuilder +// public static Werkstoff Fuel = new Werkstoff(Materials.Fuel, , ,31_766+708); +// public static Werkstoff Glue = new Werkstoff(Materials.Glue, , ,31_766+726); +// public static Werkstoff Gunpowder = new Werkstoff(Materials.Gunpowder, , ,31_766+800); +// public static Werkstoff FryingOilHot = new Werkstoff(Materials.FryingOilHot, , ,31_766+727); +// public static Werkstoff Honey = new Werkstoff(Materials.Honey, , ,31_766+725); +// public static Werkstoff Lubricant = new Werkstoff(Materials.Lubricant, , ,31_766+724); +// public static Werkstoff McGuffium239 = new Werkstoff(Materials.McGuffium239, , ,31_766+999); +// public static Werkstoff MeatRaw = new Werkstoff(Materials.MeatRaw, , ,31_766+892); +// public static Werkstoff MeatCooked = new Werkstoff(Materials.MeatCooked, , ,31_766+893); +// public static Werkstoff Milk = new Werkstoff(Materials.Milk, , ,31_766+885); +// public static Werkstoff Oil = new Werkstoff(Materials.Oil, , ,31_766+707); +// public static Werkstoff Paper = new Werkstoff(Materials.Paper, , ,31_766+879); +// public static Werkstoff RareEarth = new Werkstoff(Materials.RareEarth, , ,31_766+891); +// public static Werkstoff Reinforced = new Werkstoff(Materials.Reinforced, , ,31_766+383); +// public static Werkstoff SeedOil = new Werkstoff(Materials.SeedOil, , ,31_766+713); +// public static Werkstoff SeedOilHemp = new Werkstoff(Materials.SeedOilHemp, , ,31_766+722); +// public static Werkstoff SeedOilLin = new Werkstoff(Materials.SeedOilLin, , ,31_766+723); +// public static Werkstoff Stone = new Werkstoff(Materials.Stone, , ,31_766+299); +// public static Werkstoff Unstable = new Werkstoff(Materials.Unstable, , ,31_766+396); +// public static Vinegar = new MaterialBuilder +// public static Werkstoff Wheat = new Werkstoff(Materials.Wheat, , ,31_766+881); +// public static WoodGas = new MaterialBuilder +// public static WoodTar = new MaterialBuilder +// public static WoodVinegar = new MaterialBuilder + +// public static Werkstoff Sunnarium = new Werkstoff(Materials.Sunnarium, , ,31_766+318); +// public static Werkstoff Endstone = new Werkstoff(Materials.Endstone, , ,31_766+808); +// public static Werkstoff Netherrack = new Werkstoff(Materials.Netherrack, , ,31_766+807); +// public static Werkstoff Methane = new Werkstoff(Materials.Methane, , ,31_766+715); +// public static Werkstoff CarbonDioxide = new Werkstoff(Materials.CarbonDioxide, , ,31_766+497); +// public static Werkstoff NobleGases = new Werkstoff(Materials.NobleGases, , ,31_766+496); +// public static Werkstoff LiquidAir = new Werkstoff(Materials.LiquidAir, , ,31_766+495); +// public static Werkstoff LiquidNitrogen = new Werkstoff(Materials.LiquidNitrogen, , ,31_766+494); +// public static Werkstoff LiquidOxygen = new Werkstoff(Materials.LiquidOxygen, , ,31_766+493); +// public static Werkstoff Almandine = new Werkstoff(Materials.Almandine, , ,31_766+820); +// public static Werkstoff Andradite = new Werkstoff(Materials.Andradite, , ,31_766+821); + +// public static Werkstoff Asbestos = new Werkstoff(Materials.Asbestos, , ,31_766+946); +// public static Werkstoff Ash = new Werkstoff(Materials.Ash, , ,31_766+815); +// public static Werkstoff BandedIron = new Werkstoff(Materials.BandedIron, , ,31_766+917); +// public static Werkstoff BatteryAlloy = new Werkstoff(Materials.BatteryAlloy, , ,31_766+315); +// public static Werkstoff BlueTopaz = new Werkstoff(Materials.BlueTopaz, , ,31_766+513); +// public static Werkstoff Bone = new Werkstoff(Materials.Bone, , ,31_766+806); + +// public static Werkstoff BrownLimonite = new Werkstoff(Materials.BrownLimonite, , ,31_766+930); +// public static Werkstoff Calcite = new Werkstoff(Materials.Calcite, , ,31_766+823); +// public static Werkstoff Cassiterite = new Werkstoff(Materials.Cassiterite, , ,31_766+824); +// public static Werkstoff CassiteriteSand = new Werkstoff(Materials.CassiteriteSand, , ,31_766+937); +// public static Werkstoff Chalcopyrite = new Werkstoff(Materials.Chalcopyrite, , ,31_766+855); +// public static Werkstoff Charcoal = new Werkstoff(Materials.Charcoal, , ,31_766+536); +// public static Werkstoff Chromite = new Werkstoff(Materials.Chromite, , ,31_766+825); +// public static Werkstoff ChromiumDioxide = new Werkstoff(Materials.ChromiumDioxide, , ,31_766+361); +// public static Werkstoff Cinnabar = new Werkstoff(Materials.Cinnabar, , ,31_766+826); +// public static Werkstoff Water = new Werkstoff(Materials.Water, , ,31_766+701); +// public static Werkstoff Clay = new Werkstoff(Materials.Clay, , ,31_766+805); +// public static Werkstoff Coal = new Werkstoff(Materials.Coal, , ,31_766+535); +// public static Werkstoff Cobaltite = new Werkstoff(Materials.Cobaltite, , ,31_766+827); +// public static Werkstoff Cooperite = new Werkstoff(Materials.Cooperite, , ,31_766+828); +// public static Werkstoff Cupronickel = new Werkstoff(Materials.Cupronickel, , ,31_766+310); +// public static Werkstoff DarkAsh = new Werkstoff(Materials.DarkAsh, , ,31_766+816); +// public static Werkstoff DeepIron = new Werkstoff(Materials.DeepIron, , ,31_766+829); +// public static Werkstoff Diamond = new Werkstoff(Materials.Diamond, , ,31_766+500); +// public static Werkstoff Electrum = new Werkstoff(Materials.Electrum, , ,31_766+303); +// public static Werkstoff Emerald = new Werkstoff(Materials.Emerald, , ,31_766+501); +// public static Werkstoff Galena = new Werkstoff(Materials.Galena, , ,31_766+830); +// public static Werkstoff Garnierite = new Werkstoff(Materials.Garnierite, , ,31_766+906); +// public static Werkstoff Glyceryl = new Werkstoff(Materials.Glyceryl, , ,31_766+714); +// public static Werkstoff GreenSapphire = new Werkstoff(Materials.GreenSapphire, , ,31_766+504); +// public static Werkstoff Grossular = new Werkstoff(Materials.Grossular, , ,31_766+831); +// public static Werkstoff HolyWater = new Werkstoff(Materials.HolyWater, , ,31_766+729); +// public static Werkstoff Ice = new Werkstoff(Materials.Ice, , ,31_766+702); +// public static Werkstoff Ilmenite = new Werkstoff(Materials.Ilmenite, , ,31_766+918); +// public static Werkstoff Rutile = new Werkstoff(Materials.Rutile, , ,31_766+375); +// public static Werkstoff Bauxite = new Werkstoff(Materials.Bauxite, , ,31_766+822); +// public static Werkstoff Titaniumtetrachloride = new Werkstoff(Materials.Titaniumtetrachloride, , ,31_766+376); +// public static Werkstoff Magnesiumchloride = new Werkstoff(Materials.Magnesiumchloride, , ,31_766+377); +// public static Werkstoff Invar = new Werkstoff(Materials.Invar, , ,31_766+302); +// public static Werkstoff Kanthal = new Werkstoff(Materials.Kanthal, , ,31_766+312); +// public static Werkstoff Lazurite = new Werkstoff(Materials.Lazurite, , ,31_766+524); +// public static Werkstoff Magnalium = new Werkstoff(Materials.Magnalium, , ,31_766+313); +// public static Werkstoff Magnesite = new Werkstoff(Materials.Magnesite, , ,31_766+908); +// public static Werkstoff Magnetite = new Werkstoff(Materials.Magnetite, , ,31_766+870); +// public static Werkstoff Molybdenite = new Werkstoff(Materials.Molybdenite, , ,31_766+942); +// public static Werkstoff Nichrome = new Werkstoff(Materials.Nichrome, , ,31_766+311); +// public static Werkstoff NiobiumNitride = new Werkstoff(Materials.NiobiumNitride, , ,31_766+359); +// public static Werkstoff NiobiumTitanium = new Werkstoff(Materials.NiobiumTitanium, , ,31_766+360); +// public static Werkstoff NitroCarbon = new Werkstoff(Materials.NitroCarbon, , ,31_766+716); +// public static Werkstoff NitrogenDioxide = new Werkstoff(Materials.NitrogenDioxide, , ,31_766+717); +// public static Werkstoff Obsidian = new Werkstoff(Materials.Obsidian, , ,31_766+804); +// public static Werkstoff Phosphate = new Werkstoff(Materials.Phosphate, , ,31_766+833); +// public static Werkstoff PigIron = new Werkstoff(Materials.PigIron, , ,31_766+307); + +// public static Polydimethylsiloxane = new MaterialBuilder +// public static Werkstoff Silicone = new Werkstoff(Materials.Silicone, , ,31_766+471); +// public static Werkstoff Polycaprolactam = new Werkstoff(Materials.Polycaprolactam, , ,31_766+472); + +// public static Werkstoff Powellite = new Werkstoff(Materials.Powellite, , ,31_766+883); +// public static Werkstoff Pumice = new Werkstoff(Materials.Pumice, , ,31_766+926); +// public static Werkstoff Pyrite = new Werkstoff(Materials.Pyrite, , ,31_766+834); +// public static Werkstoff Pyrolusite = new Werkstoff(Materials.Pyrolusite, , ,31_766+943); +// public static Werkstoff Pyrope = new Werkstoff(Materials.Pyrope, , ,31_766+835); +// public static Werkstoff RockSalt = new Werkstoff(Materials.RockSalt, , ,31_766+944); +// public static Werkstoff Rubber = new Werkstoff(Materials.Rubber, , ,31_766+880); +// public static Werkstoff RawRubber = new Werkstoff(Materials.RawRubber, , ,31_766+896); +// public static Werkstoff Ruby = new Werkstoff(Materials.Ruby, , ,31_766+502); +// public static Werkstoff Salt = new Werkstoff(Materials.Salt, , ,31_766+817); +// public static Werkstoff Saltpeter = new Werkstoff(Materials.Saltpeter, , ,31_766+836); +// public static Werkstoff Sapphire = new Werkstoff(Materials.Sapphire, , ,31_766+503); +// public static Werkstoff Scheelite = new Werkstoff(Materials.Scheelite, , ,31_766+910); +// public static Werkstoff SiliconDioxide = new Werkstoff(Materials.SiliconDioxide, , ,31_766+837); +// public static Werkstoff Snow = new Werkstoff(Materials.Snow, , ,31_766+728); +// public static Werkstoff Sodalite = new Werkstoff(Materials.Sodalite, , ,31_766+525); +// public static Werkstoff SodiumPersulfate = new Werkstoff(Materials.SodiumPersulfate, , ,31_766+718); +// public static Werkstoff SodiumSulfide = new Werkstoff(Materials.SodiumSulfide, , ,31_766+719); +// public static Werkstoff HydricSulfide = new Werkstoff(Materials.HydricSulfide, , ,31_766+460); +// public static Werkstoff OilHeavy = new Werkstoff(Materials.OilHeavy, , ,31_766+730); +// public static Werkstoff OilMedium = new Werkstoff(Materials.OilMedium, , ,31_766+731); +// public static Werkstoff OilLight = new Werkstoff(Materials.OilLight, , ,31_766+732); +// public static Werkstoff NatruralGas = new Werkstoff(Materials.NatruralGas, , ,31_766+733); +// public static Werkstoff SulfuricGas = new Werkstoff(Materials.SulfuricGas, , ,31_766+734); +// public static Werkstoff Gas = new Werkstoff(Materials.Gas, , ,31_766+735); +// public static Werkstoff SulfuricNaphtha = new Werkstoff(Materials.SulfuricNaphtha, , ,31_766+736); +// public static Werkstoff SulfuricLightFuel = new Werkstoff(Materials.SulfuricLightFuel, , ,31_766+737); +// public static Werkstoff SulfuricHeavyFuel = new Werkstoff(Materials.SulfuricHeavyFuel, , ,31_766+738); +// public static Werkstoff Naphtha = new Werkstoff(Materials.Naphtha, , ,31_766+739); +// public static Werkstoff LightFuel = new Werkstoff(Materials.LightFuel, , ,31_766+740); +// public static Werkstoff HeavyFuel = new Werkstoff(Materials.HeavyFuel, , ,31_766+741); +// public static Werkstoff LPG = new Werkstoff(Materials.LPG, , ,31_766+742); +// public static FluidNaquadahFuel = new MaterialBuilder +// public static EnrichedNaquadria = new MaterialBuilder +// public static ReinforceGlass = new MaterialBuilder +// public static BioMediumRaw = new MaterialBuilder +// public static BioMediumSterilized = new MaterialBuilder +// public static Chlorobenzene = new MaterialBuild +// public static DilutedHydrochloricAcid = new MaterialBuild +// public static Pyrochlore = new MaterialBuild +// public static GrowthMediumRaw = new MaterialBuild +// public static GrowthMediumSterilized = new MaterialBuild +// public static FerriteMixture = new MaterialBuild +// public static NickelZincFerrite = new MaterialBuild +// public static Massicot = new MaterialBuild +// public static ArsenicTrioxide = new MaterialBuild +// public static CobaltOxide = new MaterialBuild +// public static Zincite = new MaterialBuild +// public static AntimonyTrioxide = new MaterialBuild +// public static CupricOxide = new MaterialBuild +// public static Ferrosilite = new MaterialBuild +// public static Magnesia = new MaterialBuild +// public static Quicklime = new MaterialBuild +// public static Potash = new MaterialBuild +// public static SodaAsh = new MaterialBuild +// public static Brick = new MaterialBuild +// public static Fireclay = new MaterialBuild +// public static BioDiesel = new MaterialBuild +// public static NitrationMixture = new MaterialBuild +// public static Glycerol = new MaterialBuild +// public static SodiumBisulfate = new MaterialBuild +// public static PolyphenyleneSulfide = new MaterialBuild +// public static Dichlorobenzene = new MaterialBuild +// public static Polystyrene = new MaterialBuild +// public static Styrene = new MaterialBuild +// public static Isoprene = new MaterialBuild +// public static Tetranitromethane = new MaterialBuild +// public static Ethenone = new MaterialBuild +// public static Ethane = new MaterialBuild +// public static Propane = new MaterialBuild +// public static Butane = new MaterialBuild +// public static Butene = new MaterialBuild +// public static Butadiene = new MaterialBuild +// public static RawStyreneButadieneRubber = new MaterialBuild +// public static StyreneButadieneRubber = new MaterialBuild +// public static Toluene = new MaterialBuild +// public static Epichlorohydrin = new MaterialBuild +// public static PolyvinylChloride = new MaterialBuild +// public static VinylChloride = new MaterialBuild +// public static SulfurDioxide = new MaterialBuild +// public static SulfurTrioxide = new MaterialBuild +// public static NitricAcid = new MaterialBuild +// public static Dimethylhydrazine = new MaterialBuild +// public static Chloramine = new MaterialBuild +// public static Dimethylamine = new MaterialBuild +// public static DinitrogenTetroxide = new MaterialBuild +// public static NitricOxide = new MaterialBuild +// public static Ammonia = new MaterialBuild +// public static Dimethyldichlorosilane = new MaterialBuild +// public static Chloromethane = new MaterialBuild +// public static PhosphorousPentoxide = new MaterialBuild +// public static Tetrafluoroethylene = new MaterialBuild +// public static HydrofluoricAcid = new MaterialBuild +// public static Chloroform = new MaterialBuild +// public static BisphenolA = new MaterialBuild +// public static AceticAcid = new MaterialBuild +// public static CalciumAcetateSolution = new MaterialBuild +// public static Acetone = new MaterialBuild +// public static Methanol = new MaterialBuild +// public static CarbonMonoxide = new MaterialBuild +// public static MetalMixture = new MaterialBuild +// public static Ethylene = new MaterialBuild +// public static Propene = new MaterialBuild +// public static VinylAcetate = new MaterialBuild +// public static PolyvinylAcetate = new MaterialBuild +// public static MethylAcetate = new MaterialBuild +// public static AllylChloride = new MaterialBuild +// public static HydrochloricAcid = new MaterialBuild +// public static HypochlorousAcid = new MaterialBuild +// public static SodiumHydroxide = new MaterialBuild +// public static Benzene = new MaterialBuild +// public static Phenol = new MaterialBuild +// public static Cumene = new MaterialBuild +// public static PhosphoricAcid = new MaterialBuild +// public static SaltWater = new MaterialBuild +// public static IronIIIChloride = new MaterialBuild +// public static LifeEssence = new MaterialBuild +// public static Werkstoff SolderingAlloy = new Werkstoff(Materials.SolderingAlloy, , ,31_766+314); +// public static Werkstoff GalliumArsenide = new Werkstoff(Materials.GalliumArsenide, , ,31_766+980); +// public static Werkstoff IndiumGalliumPhosphide = new Werkstoff(Materials.IndiumGalliumPhosphide, , ,31_766+981); +// public static Werkstoff Spessartine = new Werkstoff(Materials.Spessartine, , ,31_766+838); +// public static Werkstoff Sphalerite = new Werkstoff(Materials.Sphalerite, , ,31_766+839); + +// public static Werkstoff Stibnite = new Werkstoff(Materials.Stibnite, , ,31_766+945); +// public static Werkstoff SulfuricAcid = new Werkstoff(Materials.SulfuricAcid, , ,31_766+720); +// public static Werkstoff Tanzanite = new Werkstoff(Materials.Tanzanite, , ,31_766+508); +// public static Werkstoff Tetrahedrite = new Werkstoff(Materials.Tetrahedrite, , ,31_766+840); +// public static Werkstoff TinAlloy = new Werkstoff(Materials.TinAlloy, , ,31_766+363); +// public static Werkstoff Topaz = new Werkstoff(Materials.Topaz, , ,31_766+507); +// public static Werkstoff Tungstate = new Werkstoff(Materials.Tungstate, , ,31_766+841); + +// public static Werkstoff Uraninite = new Werkstoff(Materials.Uraninite, , ,31_766+922); +// public static Werkstoff Uvarovite = new Werkstoff(Materials.Uvarovite, , ,31_766+842); +// public static Werkstoff VanadiumGallium = new Werkstoff(Materials.VanadiumGallium, , ,31_766+357); + +// public static Werkstoff Wulfenite = new Werkstoff(Materials.Wulfenite, , ,31_766+882); +// public static Werkstoff YellowLimonite = new Werkstoff(Materials.YellowLimonite, , ,31_766+931); +// public static Werkstoff YttriumBariumCuprate = new Werkstoff(Materials.YttriumBariumCuprate, , ,31_766+358); + +// public static Werkstoff LiveRoot = new Werkstoff(Materials.LiveRoot, , ,31_766+832); +// public static Werkstoff IronWood = new Werkstoff(Materials.IronWood, , ,31_766+338); +// public static Werkstoff Glass = new Werkstoff(Materials.Glass, , ,31_766+890); +// public static Werkstoff BorosilicateGlass = new Werkstoff(Materials.BorosilicateGlass, Werkstoff.GenerationFeatures.DISABLED, Werkstoff.Types.COMPOUND, 31_766+611); +// public static Werkstoff Perlite = new Werkstoff(Materials.Perlite, , ,31_766+925); +// public static Werkstoff Borax = new Werkstoff(Materials.Borax, , ,31_766+941); +// public static Werkstoff Lignite = new Werkstoff(Materials.Lignite, , ,31_766+538); +// public static Werkstoff Olivine = new Werkstoff(Materials.Olivine, , ,31_766+505); +// public static Werkstoff Opal = new Werkstoff(Materials.Opal, , ,31_766+510); +// public static Werkstoff Amethyst = new Werkstoff(Materials.Amethyst, , ,31_766+509); +// public static Werkstoff Redstone = new Werkstoff(Materials.Redstone, , ,31_766+810); +// public static Werkstoff Lapis = new Werkstoff(Materials.Lapis, , ,31_766+526); +// public static Werkstoff Blaze = new Werkstoff(Materials.Blaze, , ,31_766+801); +// public static Werkstoff EnderPearl = new Werkstoff(Materials.EnderPearl, , ,31_766+532); +// public static Werkstoff EnderEye = new Werkstoff(Materials.EnderEye, , ,31_766+533); +// public static Werkstoff Flint = new Werkstoff(Materials.Flint, , ,31_766+802); +// public static Werkstoff Diatomite = new Werkstoff(Materials.Diatomite, , ,31_766+948); +// public static Werkstoff VolcanicAsh = new Werkstoff(Materials.VolcanicAsh, , ,31_766+940); +// public static Werkstoff Niter = new Werkstoff(Materials.Niter, , ,31_766+531); +// public static Werkstoff Pyrotheum = new Werkstoff(Materials.Pyrotheum, , ,31_766+843); +// public static Werkstoff Cryotheum = new Werkstoff(Materials.Cryotheum, , ,31_766+898); +// public static Werkstoff HydratedCoal = new Werkstoff(Materials.HydratedCoal, , ,31_766+818); +// public static Werkstoff Apatite = new Werkstoff(Materials.Apatite, , ,31_766+530); +// public static Werkstoff Alumite = new Werkstoff(Materials.Alumite, , ,31_766+400); +// public static Werkstoff Manyullyn = new Werkstoff(Materials.Manyullyn, , ,31_766+386); +// public static Werkstoff Steeleaf = new Werkstoff(Materials.Steeleaf, , ,31_766+339); +// public static Werkstoff Knightmetal = new Werkstoff(Materials.Knightmetal, , ,31_766+362); + +// public static Werkstoff NitroFuel = new Werkstoff(Materials.NitroFuel, , ,31_766+709); +// public static Werkstoff RedAlloy = new Werkstoff(Materials.RedAlloy, , ,31_766+308); +// public static Werkstoff CobaltBrass = new Werkstoff(Materials.CobaltBrass, , ,31_766+343); +// public static Werkstoff TricalciumPhosphate = new Werkstoff(Materials.TricalciumPhosphate, , ,31_766+534); +// public static Werkstoff Basalt = new Werkstoff(Materials.Basalt, , ,31_766+844); +// public static Werkstoff GarnetRed = new Werkstoff(Materials.GarnetRed, , ,31_766+527); +// public static Werkstoff GarnetYellow = new Werkstoff(Materials.GarnetYellow, , ,31_766+528); +// public static Werkstoff Marble = new Werkstoff(Materials.Marble, , ,31_766+845); +// public static Werkstoff Sugar = new Werkstoff(Materials.Sugar, , ,31_766+803); +// public static Werkstoff Thaumium = new Werkstoff(Materials.Thaumium, , ,31_766+330); +// public static Werkstoff Vinteum = new Werkstoff(Materials.Vinteum, , ,31_766+529); +// public static Werkstoff Redrock = new Werkstoff(Materials.Redrock, , ,31_766+846); +// public static Werkstoff PotassiumFeldspar = new Werkstoff(Materials.PotassiumFeldspar, , ,31_766+847); +// public static Werkstoff Biotite = new Werkstoff(Materials.Biotite, , ,31_766+848); +// public static Werkstoff GraniteBlack = new Werkstoff(Materials.GraniteBlack, , ,31_766+849); +// public static Werkstoff GraniteRed = new Werkstoff(Materials.GraniteRed, , ,31_766+850); +// public static Werkstoff Chrysotile = new Werkstoff(Materials.Chrysotile, , ,31_766+912); +// public static Werkstoff Realgar = new Werkstoff(Materials.Realgar, , ,31_766+913); +// public static Werkstoff VanadiumMagnetite = new Werkstoff(Materials.VanadiumMagnetite, , ,31_766+923); +// public static Werkstoff BasalticMineralSand = new Werkstoff(Materials.BasalticMineralSand, , ,31_766+935); +// public static Werkstoff GraniticMineralSand = new Werkstoff(Materials.GraniticMineralSand, , ,31_766+936); +// public static Werkstoff GarnetSand = new Werkstoff(Materials.GarnetSand, , ,31_766+938); +// public static Werkstoff QuartzSand = new Werkstoff(Materials.QuartzSand, , ,31_766+939); +// public static Werkstoff Bastnasite = new Werkstoff(Materials.Bastnasite, , ,31_766+905); +// public static Werkstoff Pentlandite = new Werkstoff(Materials.Pentlandite, , ,31_766+909); +// public static Werkstoff Spodumene = new Werkstoff(Materials.Spodumene, , ,31_766+920); +// public static Werkstoff Pollucite = new Werkstoff(Materials.Pollucite, , ,31_766+919); +// public static Werkstoff Tantalite = new Werkstoff(Materials.Tantalite, , ,31_766+921); +// public static Werkstoff Lepidolite = new Werkstoff(Materials.Lepidolite, , ,31_766+907); +// public static Werkstoff Glauconite = new Werkstoff(Materials.Glauconite, , ,31_766+933); +// public static Werkstoff GlauconiteSand = new Werkstoff(Materials.GlauconiteSand, , ,31_766+949); +// public static Werkstoff Vermiculite = new Werkstoff(Materials.Vermiculite, , ,31_766+932); +// public static Werkstoff Bentonite = new Werkstoff(Materials.Bentonite, , ,31_766+927); +// public static Werkstoff FullersEarth = new Werkstoff(Materials.FullersEarth, , ,31_766+928); +// public static Werkstoff Pitchblende = new Werkstoff(Materials.Pitchblende, , ,31_766+873); +// public static Werkstoff Monazite = new Werkstoff(Materials.Monazite, , ,31_766+520); +// public static Werkstoff Malachite = new Werkstoff(Materials.Malachite, , ,31_766+871); +// public static Werkstoff Mirabilite = new Werkstoff(Materials.Mirabilite, , ,31_766+900); +// public static Werkstoff Mica = new Werkstoff(Materials.Mica, , ,31_766+901); +// public static Werkstoff Trona = new Werkstoff(Materials.Trona, , ,31_766+903); +// public static Werkstoff Barite = new Werkstoff(Materials.Barite, , ,31_766+904); +// public static Werkstoff Gypsum = new Werkstoff(Materials.Gypsum, , ,31_766+934); +// public static Werkstoff Alunite = new Werkstoff(Materials.Alunite, , ,31_766+911); +// public static Werkstoff Dolomite = new Werkstoff(Materials.Dolomite, , ,31_766+914); +// public static Werkstoff Wollastonite = new Werkstoff(Materials.Wollastonite, , ,31_766+915); +// public static Werkstoff Zeolite = new Werkstoff(Materials.Zeolite, , ,31_766+916); +// public static Werkstoff Kyanite = new Werkstoff(Materials.Kyanite, , ,31_766+924); +// public static Werkstoff Kaolinite = new Werkstoff(Materials.Kaolinite, , ,31_766+929); +// public static Werkstoff Talc = new Werkstoff(Materials.Talc, , ,31_766+902); +// public static Werkstoff Soapstone = new Werkstoff(Materials.Soapstone, , ,31_766+877); +// public static Werkstoff Concrete = new Werkstoff(Materials.Concrete, , ,31_766+947); +// public static Werkstoff IronMagnetic = new Werkstoff(Materials.IronMagnetic, , ,31_766+354); +// public static Werkstoff SteelMagnetic = new Werkstoff(Materials.SteelMagnetic, , ,31_766+355); +// public static Werkstoff NeodymiumMagnetic = new Werkstoff(Materials.NeodymiumMagnetic, , ,31_766+356); +// public static Werkstoff SamariumMagnetic = new Werkstoff(Materials.SamariumMagnetic, , ,31_766+399); + +// public static DilutedSulfuricAcid = new MaterialBuilder(31_766+640) +// public static Werkstoff EpoxidFiberReinforced = new Werkstoff(Materials.EpoxidFiberReinforced, , ,31_766+610); +// public static PotassiumNitrade = new MaterialBuilder(59 +// public static ChromiumTrioxide = new MaterialBuilder(31_766+591) +// public static Nitrochlorobenzene = new MaterialBuilder(31_766+592) +// public static Dimethylbenzene = new MaterialBuilder(31_766+593) +// public static Potassiumdichromate = new MaterialBuilder(594 +// public static PhthalicAcid = new MaterialBuilder(31_766+595) +// public static Dichlorobenzidine = new MaterialBuilder(31_766+596) +// public static Diaminobenzidin = new MaterialBuilder(31_766+597) +// public static Diphenylisophthalate = new MaterialBuilder(59 +// public static Werkstoff Polybenzimidazole = new Werkstoff(Materials.Polybenzimidazole, , , 31_766+599); +// public static NitrousOxide = new MaterialBuilder(31_766+993) +// public static AntiKnock = new MaterialBuilder(31_766+994) +// public static Octane = new MaterialBuilder(31_766+995) +// public static GasolineRaw = new MaterialBuilder(31_766+996) +// public static GasolineRegular = new MaterialBuilder(31_766+997) +// public static GasolinePremium = new MaterialBuilder(31_766+998) +// public static Werkstoff Electrotine = new Werkstoff(Materials.Electrotine, , ,31_766+812); +// public static Galgadorian = new Werkstoff(Materials.Galgadorian, , ,31_766+384); +// public static Werkstoff EnhancedGalgadorian = new Werkstoff(Materials.EnhancedGalgadorian, , ,31_766+385); +// public static Werkstoff BloodInfusedIron = new Werkstoff(Materials.BloodInfusedIron, , ,31_766+977); +// public static Werkstoff Shadow = new Werkstoff(Materials.Shadow, , ,31_766+368); +// public static Werkstoff Ledox = new Werkstoff(Materials.Ledox, , ,31_766+390); +// public static Werkstoff Quantium = new Werkstoff(Materials.Quantium, , ,31_766+391); +// public static Werkstoff Mytryl = new Werkstoff(Materials.Mytryl, , ,31_766+387); +// public static Werkstoff BlackPlutonium = new Werkstoff(Materials.BlackPlutonium, , ,31_766+388); +// public static Werkstoff CallistoIce = new Werkstoff(Materials.CallistoIce, , ,31_766+389); +// public static Werkstoff Duralumin = new Werkstoff(Materials.Duralumin, , ,31_766+392); +// public static Werkstoff Oriharukon = new Werkstoff(Materials.Oriharukon, , ,31_766+393); +// public static Werkstoff MysteriousCrystal = new Werkstoff(Materials.MysteriousCrystal, , ,31_766+398); +// public static Werkstoff RedstoneAlloy = new Werkstoff(Materials.RedstoneAlloy, , ,31_766+381); +// public static Werkstoff Soularium = new Werkstoff(Materials.Soularium, , ,31_766+379); +// public static Werkstoff ConductiveIron = new Werkstoff(Materials.ConductiveIron, , ,31_766+369); +// public static Werkstoff ElectricalSteel = new Werkstoff(Materials.ElectricalSteel, , ,31_766+365); +// public static Werkstoff EnergeticAlloy = new Werkstoff(Materials.EnergeticAlloy, , ,31_766+366); +// public static Werkstoff VibrantAlloy = new Werkstoff(Materials.VibrantAlloy, , ,31_766+367); +// public static Werkstoff PulsatingIron = new Werkstoff(Materials.PulsatingIron, , ,31_766+378); +// public static Werkstoff DarkSteel = new Werkstoff(Materials.DarkSteel, , ,31_766+364); +// public static Werkstoff EndSteel = new Werkstoff(Materials.EndSteel, , ,31_766+401); +// public static Werkstoff CrudeSteel = new Werkstoff(Materials.CrudeSteel, , ,31_766+402); +// public static Werkstoff CrystallineAlloy = new Werkstoff(Materials.CrystallineAlloy, , ,31_766+403); +// public static Werkstoff MelodicAlloy = new Werkstoff(Materials.MelodicAlloy, , ,31_766+404); +// public static Werkstoff StellarAlloy = new Werkstoff(Materials.StellarAlloy, , ,31_766+405); +// public static Werkstoff CrystallinePinkSlime = new Werkstoff(Materials.CrystallinePinkSlime, , ,31_766+406); +// public static Werkstoff EnergeticSilver = new Werkstoff(Materials.EnergeticSilver, , ,31_766+407); +// public static Werkstoff VividAlloy = new Werkstoff(Materials.VividAlloy, , ,31_766+408); +// public static Werkstoff Enderium = new Werkstoff(Materials.Enderium, , ,31_766+321); +// public static Werkstoff Mithril = new Werkstoff(Materials.Mithril, , ,31_766+331); +// public static Werkstoff BlueAlloy = new Werkstoff(Materials.BlueAlloy, , ,31_766+309); +// public static Werkstoff ShadowIron = new Werkstoff(Materials.ShadowIron, , ,31_766+336); +// public static Werkstoff ShadowSteel = new Werkstoff(Materials.ShadowSteel, , ,31_766+337); +// public static Werkstoff AstralSilver = new Werkstoff(Materials.AstralSilver, , ,31_766+333); +// public static Werkstoff InfinityCatalyst = new Werkstoff(Materials.InfinityCatalyst, , , 31_766 + 394); +// public static Werkstoff Infinity = new Werkstoff(Materials.Infinity, , , 31_766 + 397); +// public static Werkstoff Bedrockium = new Werkstoff(Materials.Bedrockium, , , 31_766 + 395); +// public static Werkstoff Trinium = new Werkstoff(Materials.Trinium, , , 31_766 + 868); +// public static Werkstoff Ichorium = new Werkstoff(Materials.Ichorium, , , 31_766 + 978); +// public static Werkstoff CosmicNeutronium = new Werkstoff(Materials.CosmicNeutronium, , , 31_766 + 982); +// public static Werkstoff Pentacadmiummagnesiumhexaoxid = new Werkstoff(Materials.Pentacadmiummagnesiumhexaoxid, , , 31_766 + 987); +// public static Werkstoff Titaniumonabariumdecacoppereikosaoxid = new Werkstoff(Materials.Titaniumonabariumdecacoppereikosaoxid, , , 31_766 + 988); +// public static Werkstoff Uraniumtriplatinid = new Werkstoff(Materials.Uraniumtriplatinid, , , 31_766 + 989); +// public static Werkstoff Vanadiumtriindinid = new Werkstoff(Materials.Vanadiumtriindinid, , , 31_766 + 990); +// public static Werkstoff Tetraindiumditindibariumtitaniumheptacoppertetrakaidekaoxid = new Werkstoff(Materials.Tetraindiumditindibariumtitaniumheptacoppertetrakaidekaoxid, , , 31_766 + 991); +// public static Werkstoff Tetranaquadahdiindiumhexaplatiumosminid = new Werkstoff(Materials.Tetranaquadahdiindiumhexaplatiumosminid, , , 31_766 + 992); +// public static Werkstoff Longasssuperconductornameforuvwire = new Werkstoff(Materials.Longasssuperconductornameforuvwire, , , 31_766 + 986); +// public static Werkstoff Longasssuperconductornameforuhvwire = new Werkstoff(Materials.Longasssuperconductornameforuhvwire, , , 31_766 + 985); +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java index 18748c8e5c..d612fa211a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.util.GT_LanguageManager; @@ -62,6 +63,7 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { if (aList == null) aList = new ArrayList(); aList.add(Werkstoff.werkstoffHashMap.get((short) aStack.getItemDamage()).getToolTip()); + aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java index adeeea4928..af87faf775 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -23,6 +23,8 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.technus.tectech.mechanics.structure.ICustomBlockSetting; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; @@ -78,6 +80,7 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple @Override public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { + super.onBlockAdded(aWorld,aX,aY,aZ); GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } @@ -85,7 +88,6 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple protected void doRegistrationStuff(Werkstoff tMaterial) { GregTech_API.registerMachineBlock(this, -1); Optional.ofNullable(tMaterial) - .filter(pMaterial -> pMaterial.hasItemType(OrePrefixes.plate) && pMaterial.hasItemType(OrePrefixes.screw) && pMaterial.hasItemType(OrePrefixes.plateDouble) ) .ifPresent(pMaterial -> GT_LanguageManager.addStringLocalization( this.getUnlocalizedName() + "." + pMaterial.getmID() + ".name", @@ -104,13 +106,19 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple } @Override + @SideOnly(Side.CLIENT) @SuppressWarnings("unchecked") public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { Werkstoff.werkstoffHashSet.stream() .filter(pMaterial -> - pMaterial.hasItemType(OrePrefixes.plate) - && pMaterial.hasItemType(OrePrefixes.screw) - && pMaterial.hasItemType(OrePrefixes.plateDouble) + pMaterial.getType().equals(Werkstoff.Types.BIOLOGICAL) + && pMaterial.hasGenerationFeature(WerkstoffLoader.blockCasing) + || + pMaterial.doesOreDictedItemExists(OrePrefixes.plate) + && pMaterial.doesOreDictedItemExists(OrePrefixes.screw) + && pMaterial.doesOreDictedItemExists(OrePrefixes.plateDouble) + && pMaterial.doesOreDictedItemExists(OrePrefixes.gearGt) + && pMaterial.doesOreDictedItemExists(OrePrefixes.gearGtSmall) ) .map(pMaterial -> new ItemStack(aItem, 1, pMaterial.getmID())) .forEach(aList::add); @@ -131,4 +139,4 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple .map(te -> (BW_MetaGeneratedBlocks_Casing_TE) te) .ifPresent(te -> te.mMetaData = (short) meta); } -} +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java index 87eaf7038d..0d6bfbc9d3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.system.material; +import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; import cpw.mods.fml.relauncher.Side; @@ -57,6 +58,17 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { Werkstoff.werkstoffHashSet.forEach(this::doRegistrationStuff); } + @Override + public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { + super.onBlockAdded(aWorld, aX, aY, aZ); + try { + //TODO: Unsleep this, is here because TE isnt set yet. + Thread.sleep(1); + } catch (InterruptedException e) { + MainMod.LOGGER.catching(e); + } + } + @SideOnly(Side.CLIENT) public final BW_MetaGenerated_Block_TE getProperTileEntityForRendering() { return (BW_MetaGenerated_Block_TE) createNewTileEntity(null,0); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index ab84e7fd0b..ab38546756 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -25,7 +25,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.API.IRadMaterial; import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Materials; @@ -49,7 +49,6 @@ import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; @@ -134,7 +133,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa if (aStack != null && aStack.getItem() instanceof BW_MetaGenerated_Items && aStack.getItemDamage() == WerkstoffLoader.Tiberium.getmID()) aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.nqgen")); - aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } public String getDefaultLocalization(Werkstoff werkstoff) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index 7870b820e8..1747471adf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -26,8 +26,8 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -44,7 +44,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; import java.util.*; @@ -289,7 +288,7 @@ public class BW_Meta_Items { @SuppressWarnings("unchecked") protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { super.addAdditionalToolTips(aList, aStack, aPlayer); - aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); + aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java index 8838d9dc3d..efc29dc129 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -55,36 +55,36 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { public BWGTMetaItems(OrePrefixes orePrefixes, List noSubIDMaterials) { super(orePrefixes,null); - materialloop: + //materialloop: for (int i = 0; i < Materials.values().length; i++) { ItemStack tStack = new ItemStack(this, 1, i); - Materials w = Materials.values()[i]; - if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) + Materials material = Materials.values()[i]; + if (((material.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((material.getFluid(1) == null && material.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; - for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) - if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) - continue materialloop; - if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""))){ + //for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) + // if (material.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) + // continue materialloop; + if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ",""))){ hiddenThings.add(i); continue; } - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", getDefaultLocalization(w)); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); - GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", getDefaultLocalization(material)); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", material.getToolTip()); + GT_OreDictUnificator.registerOre(this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ",""), tStack); } - if (noSubIDMaterials != null){ + if (noSubIDMaterials != null) { hasList = true; - materialloop: + //materialloop: for (int i = 0; i < noSubIDMaterials.size(); i++) { ItemStack tStack = new ItemStack(this, 1, i+1001); Materials w = noSubIDMaterials.get(i); if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; - for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) - if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) - continue materialloop; + //for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) + // if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) + // continue materialloop; if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""))){ hiddenThings.add(i); continue; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 0713ddf102..e99c32d110 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -22,8 +22,10 @@ package com.github.bartimaeusnek.bartworks.system.material; +import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.*; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; +import com.google.common.base.Verify; import gregtech.api.enums.*; import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.interfaces.ISubTagContainer; @@ -34,7 +36,6 @@ import net.minecraftforge.fluids.FluidStack; import java.lang.reflect.InvocationTargetException; import java.nio.ByteBuffer; import java.util.*; -import java.util.stream.Collectors; @SuppressWarnings("ALL") public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @@ -76,21 +77,25 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.default_null_Werkstoff = new Werkstoff(new short[3], "_NULL", "Default null Werkstoff", Werkstoff.DEFAULT_NULL_STATS, Werkstoff.Types.UNDEFINED, Werkstoff.DEFAULT_NULL_GENERATION_FEATURES, -1, TextureSet.SET_NONE); } + /** + * GT Materials Bridge Constructor + * @param materials a GT Materials + * @param generationFeatures the new Types you want to add + * @param type - self explainatory + * @param mID > 31_766 && <= 32_767 + */ public Werkstoff(Materials materials, Werkstoff.GenerationFeatures generationFeatures, Types type, int mID){ this( materials.mRGBa, - materials.getToolTip(), materials.mDefaultLocalName, + materials.getToolTip(), type == null ? materials.mElement != null ? Types.ELEMENT : Types.UNDEFINED : type, generationFeatures, mID, materials.mIconSet, (List) materials.mOreByProducts, - materials.mMaterialList - .stream() - .map(ml -> new Pair(ml.mMaterial, (int) ml.mAmount)) - .collect(Collectors.toList()) - .>toArray(new Pair[0]) + new Pair<>(materials, 1) ); + Verify.verify(mID > 31_766 && mID <= 32_767); this.stats.mass = materials.getMass(); this.stats.protons = materials.getProtons(); this.stats.meltingPoint = materials.mMeltingPoint; @@ -102,11 +107,11 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.stats.setRadioactive(materials.isRadioactive()); this.stats.setBlastFurnace(materials.mBlastFurnaceRequired); if (type == Types.COMPOUND){ - this.stats.setElektrolysis(type == Types.COMPOUND); + this.stats.setElektrolysis(true); this.generationFeatures.addChemicalRecipes(); } else if (type == Types.MIXTURE) { - this.stats.setCentrifuge(type == Types.MIXTURE); + this.stats.setCentrifuge(true); this.generationFeatures.addMixerRecipes(); } } @@ -452,11 +457,29 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.stats.getDurOverride() > 0 ? this.stats.getDurOverride() : (int) (this.stats.durMod * ((0.01f * (float) this.getStats().getMeltingPoint() * (float) this.getStats().getMass()) / (float) this.getContents().getKey())); } + /** + * Checks if the generation feature is enabled and if its not in the blacklist + */ public boolean hasItemType(OrePrefixes prefixes) { int unpacked = Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes); return (this.getGenerationFeatures().toGenerate & unpacked) != 0 && (this.getGenerationFeatures().blacklist & unpacked) == 0; } + /** + * DOES NOT CHECK BLACKLIST! + */ + public boolean hasGenerationFeature(OrePrefixes prefixes){ + int unpacked = Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes); + return (this.getGenerationFeatures().toGenerate & unpacked) != 0; + } + + /** + * Checks if the Actual Stack exists in the OreDict + */ + public boolean doesOreDictedItemExists(OrePrefixes prefixes) { + return OreDictHandler.getItemStack(this.getDefaultName(), prefixes,1) != null; + } + public enum Types { MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, ELEMENT, ISOTOPE, UNDEFINED; @@ -474,6 +497,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public static class GenerationFeatures { + public static final GenerationFeatures DISABLED = new GenerationFeatures().disable(); long toGenerate = 0b0001001; //logic gate shit /* @@ -712,7 +736,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.GenerationFeatures addCasings() { - this.toGenerate = (long) (this.toGenerate | 0x380); + this.toGenerate = (long) (this.toGenerate | 0x382); return this; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 5e12e2e7a9..ccc8966bcf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -187,6 +187,7 @@ public class WerkstoffLoader { bottle.mDefaultStackSize = 1; Werkstoff.GenerationFeatures.initPrefixLogic(); + BW_GT_MaterialReference.init(); } //TODO: @@ -474,6 +475,8 @@ public class WerkstoffLoader { Arrays.asList(Materials.RockSalt, Materials.Borax), new Pair<>(Materials.RockSalt, 1) ); + + //More NonGT Stuff public static final Werkstoff Fayalit = new Werkstoff( new short[]{50, 50, 50, 0}, "Fayalite", @@ -1426,7 +1429,10 @@ public class WerkstoffLoader { public static ItemStack getCorrespondingItemStackUnsafe(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { if (!werkstoff.getGenerationFeatures().enforceUnification) { - ItemStack ret = OreDictHandler.getItemStack(werkstoff.getVarName(), orePrefixes, amount); + ItemStack ret = GT_OreDictUnificator.get(orePrefixes, werkstoff.getBridgeMaterial(), 1); + if (ret != null) + return ret; + ret = OreDictHandler.getItemStack(werkstoff.getVarName(), orePrefixes, amount); if (ret != null) return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java index cc1f7650a3..a1db413dca 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java @@ -22,9 +22,11 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import com.github.bartimaeusnek.bartworks.system.material.BW_GT_MaterialReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import net.minecraft.item.ItemStack; @@ -35,10 +37,27 @@ import static gregtech.api.enums.OrePrefixes.*; public class CasingLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - if (!(werkstoff.hasItemType(blockCasing) || werkstoff.hasItemType(plate) || werkstoff.hasItemType(screw) || werkstoff.hasItemType(gearGt) )) - return; + if (werkstoff == BW_GT_MaterialReference.Wood /*|| werkstoff == BW_GT_MaterialReference.WoodSealed*/) { + addCasingRecipes(werkstoff, plank); + } else { + if (! + ( + werkstoff.hasGenerationFeature(blockCasing) && + werkstoff.doesOreDictedItemExists(plate) && + werkstoff.doesOreDictedItemExists(screw) && + werkstoff.doesOreDictedItemExists(gearGtSmall) && + werkstoff.doesOreDictedItemExists(gearGt) && + werkstoff.doesOreDictedItemExists(plateDouble) + ) + ) + return; - GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasing),new Object[]{ + addCasingRecipes(werkstoff, plateDouble); + } + } + + private static void addCasingRecipes(Werkstoff werkstoff, OrePrefixes reboltedCasingsOuterStuff){ + GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasing), new Object[]{ "PSP", "PGP", "PSP", @@ -47,23 +66,23 @@ public class CasingLoader implements IWerkstoffRunnable { 'G', werkstoff.get(gearGtSmall) }); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - werkstoff.get(plate,6), - werkstoff.get(screw,2), + werkstoff.get(plate, 6), + werkstoff.get(screw, 2), werkstoff.get(gearGtSmall) - }, GT_Values.NF,werkstoff.get(blockCasing), 200, 30); + }, GT_Values.NF, werkstoff.get(blockCasing), 200, 30); - GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasingAdvanced),new Object[]{ + GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasingAdvanced), new Object[]{ "PSP", "PGP", "PSP", - 'P', werkstoff.get(plateDouble), + 'P', werkstoff.get(reboltedCasingsOuterStuff), 'S', werkstoff.get(screw), 'G', werkstoff.get(gearGt) }); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - werkstoff.get(plateDouble,6), - werkstoff.get(screw,2), + werkstoff.get(reboltedCasingsOuterStuff, 6), + werkstoff.get(screw, 2), werkstoff.get(gearGt) - }, GT_Values.NF,werkstoff.get(blockCasingAdvanced), 200, 30); + }, GT_Values.NF, werkstoff.get(blockCasingAdvanced), 200, 30); } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java index bf077f47e1..3e5984df6d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java @@ -27,6 +27,7 @@ import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -76,7 +77,7 @@ public class OreDictHandler { Pair p = OreDictHandler.cache.get(prefixes+elementName.replaceAll(" ","")); return new ItemStack(Item.getItemById(p.getKey()),amount,p.getValue()); } else if (!OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).isEmpty()){ - ItemStack tmp = OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).get(0).copy(); + ItemStack tmp = GT_OreDictUnificator.get(OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).get(0).copy()).copy(); OreDictHandler.cache.put(prefixes+elementName.replaceAll(" ",""),new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage())); tmp.stackSize=amount; return tmp; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java new file mode 100644 index 0000000000..9eb8e70d77 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.util; + +import static net.minecraft.util.EnumChatFormatting.*; +import net.minecraft.util.StatCollector; + +import java.util.function.Supplier; + +public class BW_Tooltip_Reference { + public static final String BW_NO_RESET = ChatColorHelper.DARKGREEN + "BartWorks"; + public static final String TT_NO_RESET = BLUE + "Tec" + DARK_BLUE + "Tech"; + public static final String BW = BW_NO_RESET + GRAY; + public static final String TT = TT_NO_RESET + GRAY; + public static final Supplier ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = () -> StatCollector.translateToLocal("tooltip.bw.1.name") + " " + BW; + public static final Supplier ADDED_BY_BARTWORKS = () -> StatCollector.translateToLocal("tooltip.bw.0.name") + " " + BW; + public static final String ADV_STR_CHECK = "Uses an advanced "+ TT +" structure check, due to "+ BW; + + public static String[] getTranslatedBrandedTooltip(String key){ + String[] dsc = StatCollector.translateToLocal(key).split(";"); + String[] fdsc = new String[dsc.length + 1]; + System.arraycopy(dsc, 0, fdsc, 0, dsc.length); + fdsc[dsc.length] = ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get(); + return fdsc; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java index 4cbb55c278..4529aa5202 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java @@ -158,6 +158,11 @@ public class AccessPriorityList implements List, Deque, Set { return new AccessPriorityListIterators.AccessPriorityListIterator<>(head); } + public Iterator> nodeIterator() { + return new AccessPriorityListIterators.AccessPriorityListNodeIterator<>(head); + } + + @Override public Iterator descendingIterator() { return new AccessPriorityListIterators.AccessPriorityListReverseIterator<>(tail); @@ -329,10 +334,11 @@ public class AccessPriorityList implements List, Deque, Set { } } - public void addPrioToNode(int index, long prio) { - if (!isValidIndex(index)) - return; - AccessPriorityListNode node = getNode(index); + public void addPrioToNode(AccessPriorityListNode node) { + addPrioToNode(node, 1L); + } + + public void addPrioToNode(AccessPriorityListNode node, long prio){ long current = node.getPriority(); if (current == Long.MAX_VALUE || (current > 0 && prio > 0 && prio + current < 0)) node.setPriority(Long.MAX_VALUE); @@ -343,6 +349,13 @@ public class AccessPriorityList implements List, Deque, Set { } } + public void addPrioToNode(int index, long prio) { + if (!isValidIndex(index)) + return; + AccessPriorityListNode node = getNode(index); + addPrioToNode(node, prio); + } + public void addPrioToNode(int index) { addPrioToNode(index, 1L); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java index 3b85030d1e..ec842ede30 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java @@ -143,4 +143,24 @@ public class AccessPriorityListIterators { } } + public static class AccessPriorityListNodeIterator implements Iterator> { + final AccessPriorityListNode head; + AccessPriorityListNode current; + public AccessPriorityListNodeIterator(AccessPriorityListNode head) { + this.head = this.current = head; + } + + @Override + public boolean hasNext() { + return current != null; + } + + @Override + public AccessPriorityListNode next() { + AccessPriorityListNode ret = current; + current = current.getNext(); + return ret; + } + } + } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 526a9f6be7..d20f191dd7 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -27,6 +27,10 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.tectech.TecTechResearchLoader; +import com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement.TT_ElectronicBlastFurnace; +import com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement.TT_ImplosionCompressor; +import com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement.TT_OilCrackingUnit; +import com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement.TT_VaccuumFreezer; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -75,6 +79,13 @@ public class BartWorksCrossmod { public void init(FMLInitializationEvent init) { if (LoaderReference.GalacticraftCore) GalacticraftProxy.init(init); + //Base GT -> TT Replacement + //if (LoaderReference.tectech) { + // new TT_VaccuumFreezer(null); + // new TT_OilCrackingUnit(null); + // new TT_ImplosionCompressor(null); + // new TT_ElectronicBlastFurnace(null); + //} } @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index bc81b2026c..f4400fab11 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -34,7 +34,7 @@ import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128ba; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.Pair; import com.google.common.collect.ArrayListMultimap; import gregtech.api.GregTech_API; @@ -48,7 +48,6 @@ import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; import net.minecraft.world.gen.ChunkProviderServer; import net.minecraftforge.fluids.FluidStack; @@ -160,7 +159,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri "Can be supplied with 2L/s of Neon(x4), Krypton(x8), Xenon(x16) or Oganesson(x64)", "for higher outputs.", "Will output "+(2*TIER_MULTIPLIER)+" Ores per Second depending on the Dimension it is build in", - StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks" + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java index 9f78d02d5a..bda1ae72ca 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java @@ -22,7 +22,7 @@ package com.github.bartimaeusnek.crossmod.tectech; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel; import gregtech.api.enums.GT_Values; @@ -83,7 +83,7 @@ public interface TecTechEnabledMulti { return new String[]{ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " - + EnumChatFormatting.GREEN + multiBlockBase.mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + multiBlockBase.mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + -multiBlockBase.mEUt + EnumChatFormatting.RESET + " EU/t", StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + multiBlockBase.getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(multiBlockBase.getMaxInputVoltage())] + EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + (multiBlockBase.getIdealStatus() - multiBlockBase.getRepairStatus()) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW + (float) multiBlockBase.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; + + EnumChatFormatting.GREEN + multiBlockBase.mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + multiBlockBase.mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + -multiBlockBase.mEUt + EnumChatFormatting.RESET + " EU/t", StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + multiBlockBase.getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(multiBlockBase.getMaxInputVoltage())] + EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + (multiBlockBase.getIdealStatus() - multiBlockBase.getRepairStatus()) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW + (float) multiBlockBase.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %", BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechUtils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechUtils.java deleted file mode 100644 index 7759eddfd5..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechUtils.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.tectech; - -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; - -public class TecTechUtils { - - public static boolean addEnergyInputToMachineList(TecTechEnabledMulti baseTE, IGregTechTileEntity te, int aBaseCasingIndex) { - if (te == null || !(te.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch)) - return false; - else { - GT_MetaTileEntity_Hatch mte = (GT_MetaTileEntity_Hatch) te.getMetaTileEntity(); - - if (mte instanceof GT_MetaTileEntity_Hatch_Energy) - baseTE.getVanillaEnergyHatches().add((GT_MetaTileEntity_Hatch_Energy) mte); - else if (mte instanceof GT_MetaTileEntity_Hatch_EnergyTunnel) - baseTE.getTecTechEnergyTunnels().add((GT_MetaTileEntity_Hatch_EnergyTunnel) mte); - else if (mte instanceof GT_MetaTileEntity_Hatch_EnergyMulti) - baseTE.getTecTechEnergyMultis().add((GT_MetaTileEntity_Hatch_EnergyMulti) mte); - else - return false; - - mte.updateTexture(aBaseCasingIndex); - return true; - } - } - - public static boolean drainEnergyMEBFTecTech(TecTechEnabledMulti multi, long aEU) { - if (aEU <= 0) - return true; - - long allTheEu = 0; - int hatches = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : multi.getVanillaEnergyHatches()) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - allTheEu += tHatch.getEUVar(); - hatches++; - } - - for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : multi.getTecTechEnergyTunnels()) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - allTheEu += tHatch.getEUVar(); - hatches++; - } - - for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : multi.getTecTechEnergyMultis()) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - allTheEu += tHatch.getEUVar(); - hatches++; - } - - if (allTheEu < aEU) - return false; - - long euperhatch = aEU / hatches; - - boolean hasDrained = false; - - for (GT_MetaTileEntity_Hatch_Energy tHatch : multi.getVanillaEnergyHatches()) - hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); - - for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : multi.getTecTechEnergyTunnels()) - hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); - - for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : multi.getTecTechEnergyMultis()) - hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); - - return hasDrained && (multi.getVanillaEnergyHatches().size() > 0 || multi.getTecTechEnergyTunnels().size() > 0 || multi.getTecTechEnergyMultis().size() > 0); - } - - public static long getnominalVoltageTT(TecTechEnabledMulti base) { - long rVoltage = 0L; - long rAmperage = 0L; - - for (GT_MetaTileEntity_Hatch_Energy tHatch : base.getVanillaEnergyHatches()) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rVoltage = Math.max(tHatch.getBaseMetaTileEntity().getInputVoltage(), rVoltage); - rAmperage += tHatch.getBaseMetaTileEntity().getInputAmperage(); - } - } - - for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : base.getTecTechEnergyMultis()) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rVoltage = Math.max(tHatch.getBaseMetaTileEntity().getInputVoltage(), rVoltage); - rAmperage += tHatch.Amperes; - } - } - - for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : base.getTecTechEnergyTunnels()) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rVoltage = Math.max(getEUPerTickFromLaser(tHatch), rVoltage); - rAmperage += 1; - } - } - - return rVoltage * rAmperage; - } - - public static long getMaxInputVoltage(TecTechEnabledMulti base) { - long rVoltage = 0L; - for (GT_MetaTileEntity_Hatch_Energy tHatch : base.getVanillaEnergyHatches()) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage(); - } - } - for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : base.getTecTechEnergyMultis()) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage(); - } - } - for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : base.getTecTechEnergyTunnels()) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rVoltage += getEUPerTickFromLaser(tHatch); - } - } - return rVoltage; - } - - public static long getEUPerTickFromLaser(GT_MetaTileEntity_Hatch_EnergyTunnel tHatch) { - return tHatch.Amperes * tHatch.maxEUInput() - (tHatch.Amperes / 20); - } -} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/CoilAdder.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/CoilAdder.java new file mode 100644 index 0000000000..8cec3450a7 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/CoilAdder.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech.helper; + +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.mechanics.structure.IStructureElement; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import gregtech.api.GregTech_API; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class CoilAdder implements IStructureElement { + + private CoilAdder(){} + + @SuppressWarnings("rawtypes") + private static final CoilAdder INSTANCE = new CoilAdder(); + + @SuppressWarnings("unchecked") + public static CoilAdder getINSTANCE() { + return INSTANCE; + } + + @Override + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { + if (multiBlock.getCoilMeta() == -1) + multiBlock.setCoilMeta((short) world.getBlockMetadata(x, y, z)); + return multiBlock.getCoilMeta() == (short) world.getBlockMetadata(x, y, z) + && GregTech_API.sBlockCasings5 == world.getBlock(x, y, z); + } + + @Override + public boolean placeBlock(MultiBlock MultiBlock, World world, int x, int y, int z, ItemStack trigger) { + world.setBlock(x, y, z, GregTech_API.sBlockCasings5, 0, 2); + return true; + } + + @Override + public boolean spawnHint(MultiBlock MultiBlock, World world, int x, int y, int z, ItemStack trigger) { + TecTech.proxy.hint_particle(world, x, y, z, GregTech_API.sBlockCasings5, 0); + return true; + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java new file mode 100644 index 0000000000..ea987e2426 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech.helper; + +public interface IHasCoils { + void setCoilMeta(short coilMeta); + short getCoilMeta(); +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/StructureDefinitions.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/StructureDefinitions.java new file mode 100644 index 0000000000..7e1b225a2a --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/StructureDefinitions.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech.helper; + +import static com.github.technus.tectech.mechanics.structure.StructureUtility.transpose; + +public enum StructureDefinitions { + CUBE_NO_MUFFLER(transpose( + new String[][]{ + {"VVV", "VVV", "VVV"}, + {"V~V", "V-V", "VVV"}, + {"VVV", "VVV", "VVV"} + })) + , + CUBE_MUFFLER(transpose( + new String[][]{ + {"VVV", "VMV", "VVV"}, + {"V~V", "V-V", "VVV"}, + {"VVV", "VVV", "VVV"} + })) + ; + + private final String[][] definition; + + public String[][] getDefinition() { + return definition; + } + + StructureDefinitions(String[][] definition) { + this.definition = definition; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java new file mode 100644 index 0000000000..bc28090155 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech.helper; + +import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; + +public class TecTechUtils { + + public static boolean addEnergyInputToMachineList(TecTechEnabledMulti baseTE, IGregTechTileEntity te, int aBaseCasingIndex) { + if (te == null || !(te.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch)) + return false; + else { + GT_MetaTileEntity_Hatch mte = (GT_MetaTileEntity_Hatch) te.getMetaTileEntity(); + + if (mte instanceof GT_MetaTileEntity_Hatch_Energy) + baseTE.getVanillaEnergyHatches().add((GT_MetaTileEntity_Hatch_Energy) mte); + else if (mte instanceof GT_MetaTileEntity_Hatch_EnergyTunnel) + baseTE.getTecTechEnergyTunnels().add((GT_MetaTileEntity_Hatch_EnergyTunnel) mte); + else if (mte instanceof GT_MetaTileEntity_Hatch_EnergyMulti) + baseTE.getTecTechEnergyMultis().add((GT_MetaTileEntity_Hatch_EnergyMulti) mte); + else + return false; + + mte.updateTexture(aBaseCasingIndex); + return true; + } + } + + public static boolean drainEnergyMEBFTecTech(TecTechEnabledMulti multi, long aEU) { + if (aEU <= 0) + return true; + + long allTheEu = 0; + int hatches = 0; + for (GT_MetaTileEntity_Hatch_Energy tHatch : multi.getVanillaEnergyHatches()) + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + allTheEu += tHatch.getEUVar(); + hatches++; + } + + for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : multi.getTecTechEnergyTunnels()) + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + allTheEu += tHatch.getEUVar(); + hatches++; + } + + for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : multi.getTecTechEnergyMultis()) + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + allTheEu += tHatch.getEUVar(); + hatches++; + } + + if (allTheEu < aEU) + return false; + + long euperhatch = aEU / hatches; + + boolean hasDrained = false; + + for (GT_MetaTileEntity_Hatch_Energy tHatch : multi.getVanillaEnergyHatches()) + hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); + + for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : multi.getTecTechEnergyTunnels()) + hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); + + for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : multi.getTecTechEnergyMultis()) + hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); + + return hasDrained && (multi.getVanillaEnergyHatches().size() > 0 || multi.getTecTechEnergyTunnels().size() > 0 || multi.getTecTechEnergyMultis().size() > 0); + } + + public static long getnominalVoltageTT(TecTechEnabledMulti base) { + long rVoltage = 0L; + long rAmperage = 0L; + + for (GT_MetaTileEntity_Hatch_Energy tHatch : base.getVanillaEnergyHatches()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + rVoltage = Math.max(tHatch.getBaseMetaTileEntity().getInputVoltage(), rVoltage); + rAmperage += tHatch.getBaseMetaTileEntity().getInputAmperage(); + } + } + + for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : base.getTecTechEnergyMultis()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + rVoltage = Math.max(tHatch.getBaseMetaTileEntity().getInputVoltage(), rVoltage); + rAmperage += tHatch.Amperes; + } + } + + for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : base.getTecTechEnergyTunnels()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + rVoltage = Math.max(getEUPerTickFromLaser(tHatch), rVoltage); + rAmperage += 1; + } + } + + return rVoltage * rAmperage; + } + + public static long getMaxInputVoltage(TecTechEnabledMulti base) { + long rVoltage = 0L; + for (GT_MetaTileEntity_Hatch_Energy tHatch : base.getVanillaEnergyHatches()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage(); + } + } + for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : base.getTecTechEnergyMultis()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage(); + } + } + for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : base.getTecTechEnergyTunnels()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + rVoltage += getEUPerTickFromLaser(tHatch); + } + } + return rVoltage; + } + + public static long getEUPerTickFromLaser(GT_MetaTileEntity_Hatch_EnergyTunnel tHatch) { + return tHatch.Amperes * tHatch.maxEUInput() - (tHatch.Amperes / 20); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java new file mode 100644 index 0000000000..ab6eaca7a0 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java @@ -0,0 +1,442 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; + +import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; +import com.github.bartimaeusnek.crossmod.tectech.helper.IHasCoils; +import com.github.technus.tectech.mechanics.constructable.IConstructable; +import com.github.technus.tectech.mechanics.structure.IStructureDefinition; +import com.github.technus.tectech.mechanics.structure.StructureDefinition; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; +import com.google.common.collect.ImmutableSet; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_Container_MultiMachine; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.interfaces.tileentity.ITurnable; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.*; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; +import java.util.Set; + +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; +import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; +import static gregtech.api.enums.GT_Values.V; + +public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_EM implements IHasCoils, IConstructable { + + public TT_ElectronicBlastFurnace(Object unused) { + super(32765, "multimachine.blastfurnace", "Electric Blast Furnace"); + GregTech_API.METATILEENTITIES[32765] = null; + GregTech_API.METATILEENTITIES[1000] = this; + } + + private TT_ElectronicBlastFurnace(String aName) { + super(aName); + } + + private short coilMeta = -1; + private static final byte TEXTURE_INDEX = 11; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape("main", + transpose(new String[][]{ + {"AAA", "AMA", "AAA"}, + {"CCC", "C-C", "CCC"}, + {"CCC", "C-C", "CCC"}, + {"B~B", "BBB", "BBB"} + }) + ).addElement( + 'C', + CoilAdder.getINSTANCE() + ).addElement( + 'M', + ofHatchAdder( + GT_MetaTileEntity_MultiblockBase_EM::addClassicMufflerToMachineList, TEXTURE_INDEX, + 1 + ) + ).addElement( + 'A', + ofHatchAdderOptional( + TT_ElectronicBlastFurnace::addEBFInputsTop, TEXTURE_INDEX, + GregTech_API.sBlockCasings1, TEXTURE_INDEX, + GregTech_API.sBlockCasings1, TEXTURE_INDEX + ) + ).addElement( + 'B', + ofHatchAdderOptional( + TT_ElectronicBlastFurnace::addEBFInputsBottom, TEXTURE_INDEX, + GregTech_API.sBlockCasings1, TEXTURE_INDEX, + GregTech_API.sBlockCasings1, TEXTURE_INDEX + ) + ) + .build(); + + @Override + public IStructureDefinition getStructure_EM() { + return STRUCTURE_DEFINITION; + } + + @Override + protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + this.setCoilMeta((short) -1); + boolean ret = this.structureCheck_EM("main", 1, 3, 0) && this.getHeatingCapacity() > -1; + if (this.mMufflerHatches.stream() + .map(MetaTileEntity::getBaseMetaTileEntity) + .mapToInt(ITurnable::getFrontFacing) + .noneMatch(x -> x == this.getExtendedFacing().getRelativeUpInWorld().ordinal())) + return false; + return ret; + } + + @Override + public void construct(ItemStack itemStack, boolean b) { + this.structureBuild_EM("main", 1,3,0, b, itemStack); + } + + @Override + protected boolean cyclicUpdate_EM() { + return false; + } + + public final boolean addEBFInputsTop(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) + return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + else + return false; + + return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + } + + private static final Set POLLUTION_FLUID_STACKS = ImmutableSet.of( + Materials.CarbonDioxide.getGas(1000), + Materials.CarbonMonoxide.getGas(1000), + Materials.SulfurDioxide.getGas(1000) + ); + + @Override + public boolean addOutput(FluidStack aLiquid) { + if (aLiquid == null) + return false; + FluidStack tLiquid = aLiquid.copy(); + + if (POLLUTION_FLUID_STACKS.stream().anyMatch(tLiquid::isFluidEqual)) { + tLiquid.amount = tLiquid.amount * (mMufflerHatches.stream() + .filter(GT_MetaTileEntity_MultiBlockBase::isValidMetaTileEntity) + .findFirst() + .map(tHatch -> 100 - tHatch.calculatePollutionReduction(100)) + .orElse(0) + 5) / 100; + } + + for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { + if ( + (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) + ? !tHatch.outputsSteam() + : !tHatch.outputsLiquids()) + || tHatch.getBaseMetaTileEntity().getYCoord() <= this.getBaseMetaTileEntity().getYCoord()) + continue; + int tAmount = tHatch.fill(tLiquid, false); + if (tAmount >= tLiquid.amount) + return tHatch.fill(tLiquid, true) >= tLiquid.amount; + else if (tAmount > 0) + tLiquid.amount = tLiquid.amount - tHatch.fill(tLiquid, true); + } + return false; + } + + public final boolean addEBFInputsBottom(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) + return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + else + return false; + + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) + return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) + return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) + return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) + return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) + return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) + return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) + return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) + return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); + return false; + } + + public String[] getDescription() { + return new String[]{ + "Controller Block for the Blast Furnace", + "Size(WxHxD): 3x4x3 (Hollow), Controller (Front middle bottom)", + "16x Heating Coils (Two middle Layers, hollow)", + "1x Input Hatch/Bus (Any bottom layer casing)", + "1x Output Hatch/Bus (Any bottom layer casing)", + "1x Energy Hatch (Any bottom layer casing)", + "1x Maintenance Hatch (Any bottom layer casing)", + "1x Muffler Hatch (Top middle)", + "1x Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing),", + " Recovery scales with Muffler Hatch tier", + "Heat Proof Machine Casings for the rest", + "Each 900K over the min. Heat Capacity multiplies eu/t by 0.95", + "Each 1800K over the min. Heat Capacity allows for one upgraded overclock", + "Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%", + "Causes " + 20 * getPollutionPerTick(null) + " Pollution per second", + ADV_STR_CHECK + }; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][11], new TT_RenderedExtendedFacingTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; + } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][11]}; + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png"); + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public void setCoilMeta(short coilMeta) { + this.coilMeta = coilMeta; + } + + @Override + public short getCoilMeta() { + return coilMeta; + } + + private int getHeatingCapacity() { + switch (coilMeta) { + case 0: + return 1801; + case 1: + return 2701; + case 2: + return 3601; + case 3: + return 4501; + case 4: + return 5401; + case 5: + return 7201; + case 6: + return 9001; + case 7: + return 9901; + case 8: + return 10801; + default: + return -1; + } + } + + @Override + public String[] getStructureDescription(ItemStack itemStack) { + return new String[0]; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new TT_ElectronicBlastFurnace(this.mName); + } + + public boolean checkRecipe_EM(ItemStack aStack) { + ArrayList tInputList = getStoredInputs(); + int tInputList_sS = tInputList.size(); + for (int i = 0; i < tInputList_sS - 1; i++) { + for (int j = i + 1; j < tInputList_sS; j++) { + if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { + if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { + tInputList.remove(j--); + tInputList_sS = tInputList.size(); + } else { + tInputList.remove(i--); + tInputList_sS = tInputList.size(); + break; + } + } + } + } + ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); + + ArrayList tFluidList = getStoredFluids(); + int tFluidList_sS = tFluidList.size(); + for (int i = 0; i < tFluidList_sS - 1; i++) { + for (int j = i + 1; j < tFluidList_sS; j++) { + if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { + if (tFluidList.get(i).amount >= tFluidList.get(j).amount) { + tFluidList.remove(j--); + tFluidList_sS = tFluidList.size(); + } else { + tFluidList.remove(i--); + tFluidList_sS = tFluidList.size(); + break; + } + } + } + } + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); + if (tInputList.size() > 0) { + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + if (tRecipe == null + || (this.getHeatingCapacity() < tRecipe.mSpecialValue) + || (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) { + return false; + } + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + int tHeatCapacityDivTiers = (this.getHeatingCapacity() - tRecipe.mSpecialValue) / 900; + byte overclockCount = calculateOverclockednessEBF(tRecipe.mEUt, tRecipe.mDuration, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) + this.mEUt = (-this.mEUt); + + if (tHeatCapacityDivTiers > 0) { + this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); + this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount);//extra free overclocking if possible + if (this.mMaxProgresstime < 1) + this.mMaxProgresstime = 1;//no eu efficiency correction + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; + this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; + updateSlots(); + return true; + } + return false; + } + + /** + * Calcualtes overclocked ness using long integers + * + * @param aEUt - recipe EUt + * @param aDuration - recipe Duration + */ + protected byte calculateOverclockednessEBF(int aEUt, int aDuration, long maxInputVoltage) { + byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)), timesOverclocked = 0; + if (mTier == 0) { + //Long time calculation + long xMaxProgresstime = ((long) aDuration) << 1; + if (xMaxProgresstime > Integer.MAX_VALUE - 1) { + //make impossible if too long + mEUt = Integer.MAX_VALUE - 1; + mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + mEUt = aEUt >> 2; + mMaxProgresstime = (int) xMaxProgresstime; + } + //return 0; + } else { + //Long EUt calculation + long xEUt = aEUt; + //Isnt too low EUt check? + long tempEUt = Math.max(xEUt, V[1]); + + mMaxProgresstime = aDuration; + + while (tempEUt <= V[mTier - 1]) { + tempEUt <<= 2;//this actually controls overclocking + //xEUt *= 4;//this is effect of everclocking + mMaxProgresstime >>= 1;//this is effect of overclocking + xEUt = mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power + timesOverclocked++; + } + if (xEUt > Integer.MAX_VALUE - 1) { + mEUt = Integer.MAX_VALUE - 1; + mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + mEUt = (int) xEUt; + if (mEUt == 0) + mEUt = 1; + if (mMaxProgresstime == 0) + mMaxProgresstime = 1;//set time to 1 tick + } + } + return timesOverclocked; + } + + @Override + public boolean isMachineBlockUpdateRecursive() { + return true; + } + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 20; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java new file mode 100644 index 0000000000..387540cfb1 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java @@ -0,0 +1,261 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; + +import com.github.bartimaeusnek.crossmod.tectech.helper.StructureDefinitions; +import com.github.technus.tectech.mechanics.constructable.IConstructable; +import com.github.technus.tectech.mechanics.structure.IStructureDefinition; +import com.github.technus.tectech.mechanics.structure.StructureDefinition; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; +import com.google.common.collect.ArrayListMultimap; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_Container_MultiMachine; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.*; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +import java.util.List; + +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.*; +import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; + +public class TT_ImplosionCompressor extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + + public TT_ImplosionCompressor(Object unused) { + super(32765, "multimachine.implosioncompressor", "Implosion Compressor"); + GregTech_API.METATILEENTITIES[32765] = null; + GregTech_API.METATILEENTITIES[1001] = this; + } + + private TT_ImplosionCompressor(String aName) { + super(aName); + } + + @Override + protected boolean cyclicUpdate_EM() { + return false; + } + + private byte blocks = 0; + + private static final byte TEXTURE_INDEX = 16; + private static final byte SOUND_INDEX = 20; + + private static final ArrayListMultimap BLOCKS = ArrayListMultimap.create(); + + static { + BLOCKS.put(GregTech_API.sBlockCasings2,0); + BLOCKS.put(GregTech_API.sBlockCasings3,4); + } + + private static final IStructureDefinition STRUCTURE_DEFINITION = + StructureDefinition.builder().addShape("main", + StructureDefinitions.CUBE_NO_MUFFLER.getDefinition() + ).addElement( + 'V', + ofChain( + ofHatchAdder( + TT_ImplosionCompressor::addImplosionHatches, + TEXTURE_INDEX, + 1 + ), + onElementPass( + x -> ++x.blocks, + ofBlocksMap( + BLOCKS.asMap(),GregTech_API.sBlockCasings2, + 0 + ) + ) + ) + ).build(); + + public final boolean addImplosionHatches(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity != null) { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + else + return false; + + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) + return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) + return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) + return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) + return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) + return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) + return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) + return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + } + return false; + } + + @Override + protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + this.blocks = 0; + return this.structureCheck_EM("main", 1,1,0) + && this.blocks >= 16; + } + + @Override + public void construct(ItemStack itemStack, boolean b) { + this.structureBuild_EM("main", 1,1,0, b, itemStack); + } + + @Override + public String[] getStructureDescription(ItemStack itemStack) { + return new String[0]; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new TT_ImplosionCompressor(this.mName); + } + + @Override + public String[] getDescription() { + return new String[]{ + "Controller Block for the Implosion Compressor", + "Size(WxHxD): 3x3x3 (Hollow), Controller (Front centered)", + "1x Input Bus (Any casing)", + "1x Output Bus (Any casing)", + "1x Maintenance Hatch (Any casing)", + "1x Muffler Hatch (Any casing)", + "1x Energy Hatch (Any casing)", + "Solid Steel Machine Casings for the rest (16 at least!)", + "Casings can be replaced with Explosion Warning Signs", + "Causes " + 20 * getPollutionPerTick(null) + " Pollution per second", + ADV_STR_CHECK + }; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX], new TT_RenderedExtendedFacingTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR)}; + } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX]}; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ImplosionCompressor.png"); + } + + @Override + public IStructureDefinition getStructure_EM() { + return STRUCTURE_DEFINITION; + } + + @Override + public boolean checkRecipe_EM(ItemStack aStack) { + List tInputList = getStoredInputs(); + int tInputList_sS=tInputList.size(); + for (int i = 0; i < tInputList_sS - 1; i++) { + for (int j = i + 1; j < tInputList_sS; j++) { + if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { + if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { + tInputList.remove(j--); + tInputList_sS=tInputList.size(); + } else { + tInputList.remove(i--); + tInputList_sS=tInputList.size(); + break; + } + } + } + } + ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); + if (tInputList.size() > 0) { + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sImplosionRecipes.findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); + if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, null, tInputs))) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + //OC THAT EXPLOSIVE SHIT!!! + calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, getMaxInputVoltage()); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; + sendLoopStart(SOUND_INDEX); + updateSlots(); + return true; + } + } + return false; + } + + @Override + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { + super.startSoundLoop(aIndex, aX, aY, aZ); + if (aIndex == SOUND_INDEX) { + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + } + } + + + + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 500; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java new file mode 100644 index 0000000000..e35782eaf0 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java @@ -0,0 +1,325 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; + +import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; +import com.github.bartimaeusnek.crossmod.tectech.helper.IHasCoils; +import com.github.technus.tectech.mechanics.constructable.IConstructable; +import com.github.technus.tectech.mechanics.structure.IStructureDefinition; +import com.github.technus.tectech.mechanics.structure.StructureDefinition; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_Container_MultiMachine; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; + +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; +import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; + +public class TT_OilCrackingUnit extends GT_MetaTileEntity_MultiblockBase_EM implements IHasCoils, IConstructable { + + public TT_OilCrackingUnit(Object unused) { + super(32765, "multimachine.cracker", "Oil Cracking Unit"); + GregTech_API.METATILEENTITIES[32765] = null; + GregTech_API.METATILEENTITIES[1160] = this; + } + + private TT_OilCrackingUnit(String aName) { + super(aName); + } + + private short coilMeta = -1; + + @Override + public void setCoilMeta(short coilMeta) { + this.coilMeta = coilMeta; + } + + @Override + public short getCoilMeta() { + return coilMeta; + } + + private byte blocks = 0; + + private static final byte TEXTURE_INDEX = 49; + + @Override + protected boolean cyclicUpdate_EM() { + return false; + } + + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder().addShape("main", + transpose(new String[][]{ + {"ABABA","ABGBA","ABABA"}, + {"AB~BA","E---F","ABABA"}, + {"ABCBA","ABABA","ABABA"} + }) + ).addElement( + 'A', + onElementPass( + x -> ++x.blocks,ofBlock( + GregTech_API.sBlockCasings4, + 1 + ) + ) + ).addElement( + 'B', + CoilAdder.getINSTANCE() + ).addElement( + 'C', + ofHatchAdder( + GT_MetaTileEntity_MultiblockBase_EM::addClassicMaintenanceToMachineList, + TEXTURE_INDEX, + 1 + ) + ).addElement( + 'E', + ofHatchAdder( + TT_OilCrackingUnit::addInputFluidHatch, + TEXTURE_INDEX, + 2 + ) + ).addElement( + 'F', + ofHatchAdder( + TT_OilCrackingUnit::addOutputFluidHatch, + TEXTURE_INDEX, + 3 + ) + ).addElement( + 'G', + ofHatchAdder( + TT_OilCrackingUnit::addMiddleFluidHatch, + TEXTURE_INDEX, + 4 + ) + ).build(); + + GT_MetaTileEntity_Hatch_Input middleFluidHatch; + + public final boolean addMiddleFluidHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) + return false; + else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); + this.middleFluidHatch = (GT_MetaTileEntity_Hatch_Input)aMetaTileEntity; + return true; + } else + return false; + } + } + + @Override + protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + this.coilMeta = -1; + this.blocks = 0; + return this.structureCheck_EM("main", 2,1,0) + && this.blocks >= 18; + } + + public final boolean addOutputFluidHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) + return false; + else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output)aMetaTileEntity); + } else + return false; + } + } + + public final boolean addInputFluidHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) + return false; + else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); + return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity); + } else + return false; + } + } + + @Override + public IStructureDefinition getStructure_EM() { + return STRUCTURE_DEFINITION; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new TT_OilCrackingUnit(this.mName); + } + + @Override + public String[] getDescription() { + return new String[]{ + "Controller Block for the Oil Cracking Unit", + "Thermally cracks heavy hydrocarbons into lighter fractions", + "Size(WxHxD): 5x3x3 (Hollow), Controller (Front center)", + "Ring of 8 Coils (Each side of Controller)", + "Gets 5% energy cost reduction per coil tier", + "1x Hydrocarbon Input Bus/Hatch (Any left/right side casing)", + "1x Steam/Hydrogen Input Hatch (Any middle ring casing)", + "1x Cracked Hydrocarbon Output Hatch (Any left/right side casing)", + "1x Maintenance Hatch (Any casing)", + "1x Energy Hatch (Any casing)", + "Clean Stainless Steel Machine Casings for the rest (18 at least!)", + "Input/Output Hatches must be on opposite sides", + ADV_STR_CHECK + }; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX], + new TT_RenderedExtendedFacingTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER)}; + } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX]}; + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "OilCrackingUnit.png"); + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public boolean checkRecipe_EM(ItemStack aStack) { + ArrayList tInputList = getStoredFluids(); + FluidStack[] tFluidInputs = tInputList.toArray(new FluidStack[0]); + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCrakingRecipes.findRecipe( + getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluidInputs , mInventory[1]); + if (tRecipe != null && tRecipe.isRecipeInputEqual(true, tFluidInputs, mInventory[1])) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, getMaxInputVoltage()); + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + this.mEUt *= Math.pow(0.95D, this.coilMeta); + + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; + return true; + } + return false; + } + + @Override + public boolean isMachineBlockUpdateRecursive() { + return true; + } + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + + @Override + public ArrayList getStoredFluids() { + ArrayList rList = new ArrayList<>(); + + for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) { + FluidStack tStack = tHatch.getFillableStack(); + if (!tStack.isFluidEqual(GT_ModHandler.getSteam(1000)) && !tStack.isFluidEqual(Materials.Hydrogen.getGas(1000))) + rList.add(tStack); + } + } + + if (this.middleFluidHatch != null && isValidMetaTileEntity(this.middleFluidHatch) && this.middleFluidHatch.getFillableStack() != null) { + this.middleFluidHatch.mRecipeMap = getRecipeMap(); + FluidStack tStack = this.middleFluidHatch.getFillableStack(); + if (tStack.isFluidEqual(GT_ModHandler.getSteam(1000)) || tStack.isFluidEqual(Materials.Hydrogen.getGas(1000))) + rList.add(tStack); + } + + return rList; + } + + @Override + public void construct(ItemStack itemStack, boolean b) { + this.structureBuild_EM("main", 2,1,0, b, itemStack); + } + + @Override + public String[] getStructureDescription(ItemStack itemStack) { + return new String[0]; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VaccuumFreezer.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VaccuumFreezer.java new file mode 100644 index 0000000000..4e07db5605 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VaccuumFreezer.java @@ -0,0 +1,227 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; + +import com.github.bartimaeusnek.crossmod.tectech.helper.StructureDefinitions; +import com.github.technus.tectech.mechanics.constructable.IConstructable; +import com.github.technus.tectech.mechanics.structure.IStructureDefinition; +import com.github.technus.tectech.mechanics.structure.StructureDefinition; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_Container_MultiMachine; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.*; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +import java.util.ArrayList; + +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; +import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; + +public class TT_VaccuumFreezer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + public TT_VaccuumFreezer(Object unused) { + super(32765, "multimachine.vacuumfreezer", "Vacuum Freezer"); + GregTech_API.METATILEENTITIES[32765] = null; + GregTech_API.METATILEENTITIES[1002] = this; + } + + @Override + protected boolean cyclicUpdate_EM() { + return false; + } + + private TT_VaccuumFreezer(String aName) { + super(aName); + } + + private static final byte TEXTURE_INDEX = 17; + + private byte blocks = 0; + + private static final IStructureDefinition STRUCTURE_DEFINITION = + StructureDefinition.builder().addShape("main", + StructureDefinitions.CUBE_NO_MUFFLER.getDefinition() + ).addElement( + 'V', + ofChain( + ofHatchAdder( + TT_VaccuumFreezer::addVaccumFreezerHatches, + TEXTURE_INDEX, + 1 + ), + onElementPass( + x -> ++x.blocks, + ofBlock( + GregTech_API.sBlockCasings2, + 1 + ) + ) + ) + ).build(); + + @Override + public IStructureDefinition getStructure_EM() { + return STRUCTURE_DEFINITION; + } + + public String[] getDescription() { + return new String[]{ + "Controller Block for the Vacuum Freezer", + "Super cools hot ingots and cells", + "Size(WxHxD): 3x3x3 (Hollow), Controller (Front centered)", + "1x Input Bus (Any casing)", + "1x Output Bus (Any casing)", + "1x Maintenance Hatch (Any casing)", + "1x Energy Hatch (Any casing)", + "Frost Proof Machine Casings for the rest (16 at least!)", + ADV_STR_CHECK + }; + } + + @Override + protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + this.blocks = 0; + return this.structureCheck_EM("main", 1,1,0) + && this.blocks >= 16; + } + + @SideOnly(Side.CLIENT) + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX], new TT_RenderedExtendedFacingTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)}; + } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX]}; + } + + @Override + public boolean checkRecipe_EM(ItemStack itemStack) { + ArrayList tInputList = getStoredInputs(); + for (ItemStack tInput : tInputList) { + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, tInput); + if (tRecipe != null) { + if (tRecipe.isRecipeInputEqual(true, null, tInput)) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; + updateSlots(); + return true; + } + } + } + return false; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new TT_VaccuumFreezer(this.mName); + } + + @Override + public boolean isMachineBlockUpdateRecursive() { + return true; + } + + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + public int getPollutionPerTick(ItemStack aStack) { + return 0; + } + + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + + @Override + public void construct(ItemStack itemStack, boolean b) { + this.structureBuild_EM("main", 1,1,0, b, itemStack); + } + + @Override + public String[] getStructureDescription(ItemStack itemStack) { + return new String[0]; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png"); + } + + public final boolean addVaccumFreezerHatches(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity != null) { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + else + return false; + + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) + return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) + return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) + return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) + return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) + return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) + return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); + } + return false; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java index aa88094922..7fe4d93a29 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java @@ -22,12 +22,12 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.util.StatCollector; public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLaserThingy { @@ -139,6 +139,6 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase @Override public String[] getDescription() { - return new String[]{"Like a Tranformer... but for LAZORZ", "Transferrate: " + ChatColorHelper.YELLOW + this.getTotalPower() + ChatColorHelper.WHITE + " EU/t", StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; + return new String[]{"Like a Tranformer... but for LAZORZ", "Transferrate: " + ChatColorHelper.YELLOW + this.getTotalPower() + ChatColorHelper.WHITE + " EU/t", BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java index df3cd12773..307e9307cb 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java @@ -22,7 +22,7 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoTunnel; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -71,7 +71,7 @@ public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hat return new String[]{ this.mDescription, StatCollector.translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": " + EnumChatFormatting.YELLOW + this.getTotalPower() + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks" + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java index 1774fc0966..922dea51a8 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java @@ -22,7 +22,7 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -46,7 +46,7 @@ public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatc return new String[]{ this.mDescription, StatCollector.translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " + EnumChatFormatting.YELLOW + this.getTotalPower() + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks" + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java index 12f4c6d2cd..26ba1039d0 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.enums.Dyes; import gregtech.api.enums.Materials; @@ -37,7 +38,6 @@ import gregtech.common.GT_Client; import ic2.core.Ic2Items; import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.StatCollector; import java.util.ArrayList; import java.util.HashSet; @@ -83,7 +83,7 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca "Does not auto-connect", "Does not turn or bend", ChatColorHelper.WHITE + "Must be " + ChatColorHelper.YELLOW + "c" + ChatColorHelper.RED + "o" + ChatColorHelper.BLUE + "l" + ChatColorHelper.DARKPURPLE + "o" + ChatColorHelper.GOLD + "r" + ChatColorHelper.DARKRED + "e" + ChatColorHelper.DARKGREEN + "d" + ChatColorHelper.WHITE + " in order to work", - StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks" + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } -- cgit From 3546b1352aa6ffb0637886cc4743b9c3d13be37b Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 13 Oct 2020 18:36:29 +0200 Subject: Create gradle.yml Former-commit-id: 9f6bded8be42e9f7f0dc3092a1c290a71e5fb3ec --- .github/workflows/gradle.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/gradle.yml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000000..58e1c59ce1 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,26 @@ +# This workflow will build a Java project with Gradle +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: Java CI with Gradle + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build -- cgit From 87c3702289ff4eddd345906dbf24c2f5fdc24674 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 2 Nov 2020 20:55:34 +0100 Subject: Fixes Server Crash Former-commit-id: 95309f3ecb1105e1025544176b3e71ed3e074a7c --- .../com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index e99c32d110..16cbee2d2f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -25,7 +25,6 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.*; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; -import com.google.common.base.Verify; import gregtech.api.enums.*; import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.interfaces.ISubTagContainer; @@ -95,7 +94,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { (List) materials.mOreByProducts, new Pair<>(materials, 1) ); - Verify.verify(mID > 31_766 && mID <= 32_767); + if(!(mID > 31_766 && mID <= 32_767)) + throw new IllegalArgumentException(); this.stats.mass = materials.getMass(); this.stats.protons = materials.getProtons(); this.stats.meltingPoint = materials.mMeltingPoint; -- cgit From d7f0d4575188c477e60184a08c882c380a1805cb Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 3 Nov 2020 16:18:26 +0100 Subject: Fixes a bug where only 1Item is in stack Former-commit-id: c5b014c5f18f083be19bfb625436db89f2a59242 --- build.gradle.kts | 6 +++++- libs/gregtech-5.09.33.54-dev.jar.REMOVED.git-id | 1 - .../bartimaeusnek/bartworks/system/material/WerkstoffLoader.java | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) delete mode 100644 libs/gregtech-5.09.33.54-dev.jar.REMOVED.git-id diff --git a/build.gradle.kts b/build.gradle.kts index c5cb8b82db..fe8e52a958 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -115,7 +115,8 @@ dependencies { val enderioVersion: String by project //hard deps compile("net.industrial-craft:industrialcraft-2:$ic2Version:dev") - //compile("com.github.GTNH2:GT5-Unofficial:experimental-SNAPSHOT:dev") //broken jitpack.io dep + //jitpack + compile("com.github.GTNewHorizons:GT5-Unofficial:experimental-SNAPSHOT:dev") //soft deps compileOnly("com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf") compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") @@ -125,7 +126,10 @@ dependencies { compileOnly("micdoodle8.mods:Galacticraft-Planets:$galacticraftVersion:Dev") compileOnly("li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api") compileOnly("net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev") + //jitpack compileOnly("com.github.GTNewHorizons:GalacticGregGT5:master-SNAPSHOT") + //compileOnly("com.github.Technus:TecTech:BassAddons-SNAPSHOT") + //Files compileOnly(fileTree("libs") { this.include("*.jar") }) //CoreLibs for compile-age diff --git a/libs/gregtech-5.09.33.54-dev.jar.REMOVED.git-id b/libs/gregtech-5.09.33.54-dev.jar.REMOVED.git-id deleted file mode 100644 index 396d628a54..0000000000 --- a/libs/gregtech-5.09.33.54-dev.jar.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -fdcf1725ae123ce50af73ffbe38f8f0ec312f32b \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index ccc8966bcf..c4dedef9d7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1429,7 +1429,7 @@ public class WerkstoffLoader { public static ItemStack getCorrespondingItemStackUnsafe(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { if (!werkstoff.getGenerationFeatures().enforceUnification) { - ItemStack ret = GT_OreDictUnificator.get(orePrefixes, werkstoff.getBridgeMaterial(), 1); + ItemStack ret = GT_OreDictUnificator.get(orePrefixes, werkstoff.getBridgeMaterial(), amount); if (ret != null) return ret; ret = OreDictHandler.getItemStack(werkstoff.getVarName(), orePrefixes, amount); -- cgit From 171fb79478302114847b0c510d8bba7e51d7f9fe Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 17 Dec 2020 20:35:40 +0100 Subject: Quick render crashfix Former-commit-id: bee32a395417ad6b3baad5e8f3e6c2d2022dbeee --- .../material/GT_Enhancement/BWGTMetaItems.java | 29 +++++++++++++++++----- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java index efc29dc129..4310d06156 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -31,6 +31,8 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TextureSet; +import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; @@ -42,6 +44,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -111,13 +114,27 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { return werkstoff != null ? this.orePrefixes.mLocalizedMaterialPre + werkstoff.mDefaultLocalName + this.orePrefixes.mLocalizedMaterialPost : Materials._NULL.mDefaultLocalName; } + @Override protected IIconContainer getIconContainerBartWorks(int aMetaData) { - if (SideReference.Side.Client) { - if (aMetaData > 1000 && hasList) - return PrefixTextureLinker.texMap.get(this.orePrefixes).get(NoMetaValue.get(aMetaData-1001).mIconSet); - return PrefixTextureLinker.texMap.get(this.orePrefixes).get(Materials.values()[(short) aMetaData].mIconSet); - } - return null; + if (SideReference.Side.Server || PrefixTextureLinker.texMap == null) + return null; + + HashMap iconLink = PrefixTextureLinker.texMap.get(this.orePrefixes); + + if (iconLink == null) + return null; + + Materials material; + + if (aMetaData > 1000 && hasList) + material = NoMetaValue.get(aMetaData-1001); + else + material = Materials.values()[aMetaData]; + + if (material == null || material.mIconSet == null) + return null; + + return iconLink.get(material.mIconSet); } @Override -- cgit From 9116ad21d98496312d0ad7567574f609304d4f07 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 19 Dec 2020 15:53:07 +0100 Subject: Should Fix CAL Overclocking issues Former-commit-id: 70f4866ed5d4d025925f0ac9d118f7813402c24c --- gradle.properties | 2 +- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 73 +++++++++++----------- .../bartimaeusnek/bartworks/util/BW_Util.java | 4 -- 3 files changed, 39 insertions(+), 40 deletions(-) diff --git a/gradle.properties b/gradle.properties index 4fdf782092..761a0eae7a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,7 +21,7 @@ # majorUpdate=0 minorUpdate=5 -buildNumber=13.1 +buildNumber=14 apiVersion=11 ic2Version=2.2.828-experimental applecoreVersion=1.7.10-3.1.1 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 9de9f736cb..8552aa14d1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -121,16 +121,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl return false; if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), BW_Util.getItemsFromInputBusses(this))) { - BW_Util.calculateOverclockedNessMultiPefectOC(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); - if (this.mEUt > 0) - this.mEUt = -this.mEUt; - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = this.bufferedRecipe.mOutputs; - this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; - sendLoopStart((byte) 20); - this.updateSlots(); + setRecipeStats(); return true; } @@ -153,20 +144,25 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl else continue; - BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); - if (this.mEUt > 0) - this.mEUt = -this.mEUt; - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = this.bufferedRecipe.mOutputs; - this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; - this.updateSlots(); + this.setRecipeStats(); return true; } return false; } + private void setRecipeStats() { + BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); + if (this.mEUt > 0) + this.mEUt = -this.mEUt; + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = this.bufferedRecipe.mOutputs; + this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; + sendLoopStart((byte) 20); + this.updateSlots(); + } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; @@ -349,28 +345,35 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl return new GT_TileEntity_CircuitAssemblyLine(this.mName); } + private static final String[] DESCRIPTION = new String[]{ + "Circuit Assembly Line", "Size(WxHxD): (2-7)x3x3, variable length", + "Bottom: Steel Machine Casing(or 1x Maintenance or Input Hatch),", + "ULV Input Bus (Last ULV Output Bus), Steel Machine Casing", + "Middle: EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass", + "Top: Grate Machine Casing (or Controller or 1x Energy Hatch)", + "Up to 7 repeating slices, last is Output Bus", + "Imprint this machine with a Circuit Imprint,", + "by putting the imprint in the controller.", + "Every Circuit Assembly Line can only be imprinted ONCE.", + ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + }; + @Override public String[] getDescription() { - return new String[]{ - "Circuit Assembly Line", "Size(WxHxD): (2-7)x3x3, variable length", - "Bottom: Steel Machine Casing(or 1x Maintenance or Input Hatch),", - "ULV Input Bus (Last ULV Output Bus), Steel Machine Casing", - "Middle: EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass", - "Top: Grate Machine Casing (or Controller or 1x Energy Hatch)", - "Up to 7 repeating slices, last is Output Bus", - "Imprint this machine with a Circuit Imprint,", - "by putting the imprint in the controller.", - "Every Circuit Assembly Line can only be imprinted ONCE.", - ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() - }; + return DESCRIPTION; } + private String[] infoDataBuffer; @Override public String[] getInfoData() { - String[] ret = new String[super.getInfoData().length+1]; - System.arraycopy(super.getInfoData(),0,ret,0,super.getInfoData().length); - ret[super.getInfoData().length] = "Imprinted with: "+ GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); - return ret; + if (infoDataBuffer != null) + return infoDataBuffer; + + String[] oldInfo = super.getInfoData(); + infoDataBuffer = new String[oldInfo.length+1]; + System.arraycopy(oldInfo,0,infoDataBuffer,0, oldInfo.length); + infoDataBuffer[oldInfo.length] = "Imprinted with: "+ GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); + return infoDataBuffer; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index f8b0aac053..21790bfe41 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -413,10 +413,6 @@ public class BW_Util { } } - public static void calculateOverclockedNessMultiPefectOC(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, @Nonnull GT_MetaTileEntity_MultiBlockBase base){ - calculateOverclockednessMultiInternal(aEUt, aDuration, mAmperage, maxInputVoltage, base, 1); - } - public static long getnominalVoltage(GT_MetaTileEntity_MultiBlockBase base) { long rVoltage = 0L; long rAmperage = 0L; -- cgit From cade35dcb6709c5614df52586e774704b5ab77ff Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 29 Dec 2020 13:35:25 +0100 Subject: Added Multi Smelter TT Replacement Updated Coil Logic Former-commit-id: ebfd2f5ca914fd66f312730c5cc4342cb96160a9 --- build.gradle.kts | 8 +- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 2 +- .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 18 +- .../crossmod/tectech/helper/CoilAdder.java | 15 +- .../crossmod/tectech/helper/IHasCoils.java | 6 +- .../GT_Replacement/TT_ElectronicBlastFurnace.java | 132 +++------ .../GT_Replacement/TT_ImplosionCompressor.java | 39 ++- .../multi/GT_Replacement/TT_MultiSmelter.java | 311 +++++++++++++++++++++ .../multi/GT_Replacement/TT_OilCrackingUnit.java | 54 ++-- .../multi/GT_Replacement/TT_VaccuumFreezer.java | 34 ++- 10 files changed, 464 insertions(+), 155 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java diff --git a/build.gradle.kts b/build.gradle.kts index fe8e52a958..8d144993c0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -60,12 +60,12 @@ val majorUpdate: String by project val minorUpdate: String by project val buildNumber: String by project +minecraft.version = "1.7.10-10.13.4.1614-1.7.10" version = "$majorUpdate.$minorUpdate.$buildNumber" group = "com.github.bartimaeusnek.bartworks" //minecraft block configure { - this.version = "1.7.10-10.13.4.1614-1.7.10" this.includes.addAll( arrayOf( "MainMod.java", @@ -121,9 +121,9 @@ dependencies { compileOnly("com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf") compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") compileOnly("mods.railcraft:Railcraft_1.7.10:9.12.3.0:dev") - compileOnly("micdoodle8.mods:MicdoodleCore:$galacticraftVersion:Dev") - compileOnly("micdoodle8.mods:GalacticraftCore:$galacticraftVersion:Dev") - compileOnly("micdoodle8.mods:Galacticraft-Planets:$galacticraftVersion:Dev") + compile("micdoodle8.mods:MicdoodleCore:$galacticraftVersion:Dev") + compile("micdoodle8.mods:GalacticraftCore:$galacticraftVersion:Dev") + compile("micdoodle8.mods:Galacticraft-Planets:$galacticraftVersion:Dev") compileOnly("li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api") compileOnly("net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev") //jitpack diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 6a3c6ae7ae..e93d7342eb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -105,7 +105,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre int processed = 0; while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { - if (tRecipe != null && (tRecipe.mEUt * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, null, tInputs)) { + if (tRecipe != null && ((long) tRecipe.mEUt * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, null, tInputs)) { found_Recipe = true; for (int i = 0; i < tRecipe.mOutputs.length; i++) { outputItems.add(tRecipe.getOutput(i)); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index d20f191dd7..46e7652c26 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -27,10 +27,7 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.tectech.TecTechResearchLoader; -import com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement.TT_ElectronicBlastFurnace; -import com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement.TT_ImplosionCompressor; -import com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement.TT_OilCrackingUnit; -import com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement.TT_VaccuumFreezer; +import com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement.*; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -80,12 +77,13 @@ public class BartWorksCrossmod { if (LoaderReference.GalacticraftCore) GalacticraftProxy.init(init); //Base GT -> TT Replacement - //if (LoaderReference.tectech) { - // new TT_VaccuumFreezer(null); - // new TT_OilCrackingUnit(null); - // new TT_ImplosionCompressor(null); - // new TT_ElectronicBlastFurnace(null); - //} + if (LoaderReference.tectech) { + new TT_VaccuumFreezer(null,null); + new TT_OilCrackingUnit(null,null); + new TT_ImplosionCompressor(null,null); + new TT_ElectronicBlastFurnace(null,null); + new TT_MultiSmelter(null,null); + } } @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/CoilAdder.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/CoilAdder.java index 8cec3450a7..8e3dab2566 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/CoilAdder.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/CoilAdder.java @@ -26,6 +26,9 @@ import com.github.technus.tectech.TecTech; import com.github.technus.tectech.mechanics.structure.IStructureElement; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import gregtech.api.GregTech_API; +import gregtech.api.enums.HeatingCoilLevel; +import gregtech.api.interfaces.IHeatingCoil; +import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -43,10 +46,14 @@ public class CoilAdder STRUCTURE_DEFINITION = StructureDefinition .builder() @@ -113,8 +116,8 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ @Override protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - this.setCoilMeta((short) -1); - boolean ret = this.structureCheck_EM("main", 1, 3, 0) && this.getHeatingCapacity() > -1; + this.setCoilHeat(HeatingCoilLevel.None); + boolean ret = this.structureCheck_EM("main", 1, 3, 0) && this.getCoilHeat() != HeatingCoilLevel.None; if (this.mMufflerHatches.stream() .map(MetaTileEntity::getBaseMetaTileEntity) .mapToInt(ITurnable::getFrontFacing) @@ -210,24 +213,36 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ } public String[] getDescription() { - return new String[]{ - "Controller Block for the Blast Furnace", - "Size(WxHxD): 3x4x3 (Hollow), Controller (Front middle bottom)", - "16x Heating Coils (Two middle Layers, hollow)", - "1x Input Hatch/Bus (Any bottom layer casing)", - "1x Output Hatch/Bus (Any bottom layer casing)", - "1x Energy Hatch (Any bottom layer casing)", - "1x Maintenance Hatch (Any bottom layer casing)", - "1x Muffler Hatch (Top middle)", - "1x Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing),", - " Recovery scales with Muffler Hatch tier", - "Heat Proof Machine Casings for the rest", - "Each 900K over the min. Heat Capacity multiplies eu/t by 0.95", - "Each 1800K over the min. Heat Capacity allows for one upgraded overclock", - "Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%", - "Causes " + 20 * getPollutionPerTick(null) + " Pollution per second", - ADV_STR_CHECK - }; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Blast Furnace") + .addInfo("Controller block for the Electric Blast Furnace") + .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") + .addInfo("Each 900K over the min. Heat required multiplies EU/t by 0.95") + .addInfo("Each 1800K over the min. Heat required allows for one upgraded overclock instead of normal") + .addInfo("Upgraded overclocks reduce recipe time to 25% (instead of 50%) and increase EU/t to 400%") + .addInfo("Additionally gives +100K for every tier past MV") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addInfo(ADV_STR_CHECK) + .addSeparator() + .beginStructureBlock(3, 4, 3, true) + .addController("Front bottom") + .addCasingInfo("Heat Proof Machine Casing", 0) + .addOtherStructurePart("Heating Coils", "Two middle Layers") + .addEnergyHatch("Any bottom layer casing") + .addMaintenanceHatch("Any bottom layer casing") + .addMufflerHatch("Top middle") + .addInputBus("Any bottom layer casing") + .addInputHatch("Any bottom layer casing") + .addOutputBus("Any bottom layer casing") + .addOutputHatch("CO/CO2/SO2, Any top layer casing") + .addStructureInfo("Recovery amount scales with Muffler Hatch tier") + .addOutputHatch("Fluids, Any bottom layer casing") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { @@ -247,40 +262,15 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ } @Override - public void setCoilMeta(short coilMeta) { + public void setCoilHeat(HeatingCoilLevel coilMeta) { this.coilMeta = coilMeta; } @Override - public short getCoilMeta() { + public HeatingCoilLevel getCoilHeat() { return coilMeta; } - private int getHeatingCapacity() { - switch (coilMeta) { - case 0: - return 1801; - case 1: - return 2701; - case 2: - return 3601; - case 3: - return 4501; - case 4: - return 5401; - case 5: - return 7201; - case 6: - return 9001; - case 7: - return 9901; - case 8: - return 10801; - default: - return -1; - } - } - @Override public String[] getStructureDescription(ItemStack itemStack) { return new String[0]; @@ -292,53 +282,21 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ } public boolean checkRecipe_EM(ItemStack aStack) { - ArrayList tInputList = getStoredInputs(); - int tInputList_sS = tInputList.size(); - for (int i = 0; i < tInputList_sS - 1; i++) { - for (int j = i + 1; j < tInputList_sS; j++) { - if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { - if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { - tInputList.remove(j--); - tInputList_sS = tInputList.size(); - } else { - tInputList.remove(i--); - tInputList_sS = tInputList.size(); - break; - } - } - } - } - ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); - - ArrayList tFluidList = getStoredFluids(); - int tFluidList_sS = tFluidList.size(); - for (int i = 0; i < tFluidList_sS - 1; i++) { - for (int j = i + 1; j < tFluidList_sS; j++) { - if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { - if (tFluidList.get(i).amount >= tFluidList.get(j).amount) { - tFluidList.remove(j--); - tFluidList_sS = tFluidList.size(); - } else { - tFluidList.remove(i--); - tFluidList_sS = tFluidList.size(); - break; - } - } - } - } - FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); - if (tInputList.size() > 0) { + ItemStack[] tInputs = this.getCompactedInputs(); + FluidStack[] tFluids = this.getCompactedFluids(); + + if (tInputs.length > 0) { long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); if (tRecipe == null - || (this.getHeatingCapacity() < tRecipe.mSpecialValue) + || (this.getCoilHeat().getHeat() < tRecipe.mSpecialValue) || (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) { return false; } this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - int tHeatCapacityDivTiers = (this.getHeatingCapacity() - tRecipe.mSpecialValue) / 900; + int tHeatCapacityDivTiers = (int) ((this.getCoilHeat().getHeat() - tRecipe.mSpecialValue) / 900); byte overclockCount = calculateOverclockednessEBF(tRecipe.mEUt, tRecipe.mDuration, tVoltage); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java index 387540cfb1..8b41aa1dbc 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java @@ -39,11 +39,13 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.*; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; +import org.lwjgl.input.Keyboard; import java.util.List; @@ -52,7 +54,7 @@ import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; public class TT_ImplosionCompressor extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { - public TT_ImplosionCompressor(Object unused) { + public TT_ImplosionCompressor(Object unused, Object unused2) { super(32765, "multimachine.implosioncompressor", "Implosion Compressor"); GregTech_API.METATILEENTITIES[32765] = null; GregTech_API.METATILEENTITIES[1001] = this; @@ -150,19 +152,28 @@ public class TT_ImplosionCompressor extends GT_MetaTileEntity_MultiblockBase_EM @Override public String[] getDescription() { - return new String[]{ - "Controller Block for the Implosion Compressor", - "Size(WxHxD): 3x3x3 (Hollow), Controller (Front centered)", - "1x Input Bus (Any casing)", - "1x Output Bus (Any casing)", - "1x Maintenance Hatch (Any casing)", - "1x Muffler Hatch (Any casing)", - "1x Energy Hatch (Any casing)", - "Solid Steel Machine Casings for the rest (16 at least!)", - "Casings can be replaced with Explosion Warning Signs", - "Causes " + 20 * getPollutionPerTick(null) + " Pollution per second", - ADV_STR_CHECK - }; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Implosion Compressor") + .addInfo("Explosions are fun") + .addInfo("Controller block for the Implosion Compressor") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addInfo(ADV_STR_CHECK) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfo("Solid Steel Machine Casing", 16) + .addStructureInfo("Casings can be replaced with Explosion Warning Signs") + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addMufflerHatch("Any casing") + .addInputBus("Any casing") + .addOutputBus("Any casing") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java new file mode 100644 index 0000000000..086b2c694e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java @@ -0,0 +1,311 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; + +import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; +import com.github.bartimaeusnek.crossmod.tectech.helper.IHasCoils; +import com.github.technus.tectech.mechanics.constructable.IConstructable; +import com.github.technus.tectech.mechanics.structure.IStructureDefinition; +import com.github.technus.tectech.mechanics.structure.StructureDefinition; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; +import gregtech.api.GregTech_API; +import gregtech.api.enums.HeatingCoilLevel; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_Container_MultiMachine; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.interfaces.tileentity.ITurnable; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.*; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import org.lwjgl.input.Keyboard; + +import java.util.ArrayList; + +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; +import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; + +public class TT_MultiSmelter extends GT_MetaTileEntity_MultiblockBase_EM implements IHasCoils, IConstructable { + + private int mLevel; + private int mCostDiscount; + + public TT_MultiSmelter(Object unused, Object unused2) { + super(32765, "multimachine.multifurnace", "Multi Smelter"); + GregTech_API.METATILEENTITIES[32765] = null; + GregTech_API.METATILEENTITIES[1003] = this; + } + + private TT_MultiSmelter(String aName) { + super(aName); + } + + private HeatingCoilLevel coilMeta = HeatingCoilLevel.None; + private static final byte TEXTURE_INDEX = 11; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape("main", + transpose(new String[][]{ + {"AAA", "AMA", "AAA"}, + {"CCC", "C-C", "CCC"}, + {"B~B", "BBB", "BBB"} + }) + ).addElement( + 'C', + CoilAdder.getINSTANCE() + ).addElement( + 'M', + ofHatchAdder( + GT_MetaTileEntity_MultiblockBase_EM::addClassicMufflerToMachineList, TEXTURE_INDEX, + 1 + ) + ).addElement( + 'A', + ofBlock( + GregTech_API.sBlockCasings1, TEXTURE_INDEX, + GregTech_API.sBlockCasings1, TEXTURE_INDEX + ) + ).addElement( + 'B', + ofHatchAdderOptional( + TT_MultiSmelter::addHatchesBottom, TEXTURE_INDEX, + GregTech_API.sBlockCasings1, TEXTURE_INDEX, + GregTech_API.sBlockCasings1, TEXTURE_INDEX + ) + ) + .build(); + + public final boolean addHatchesBottom(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) + return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + else + return false; + + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) + return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) + return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) + return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) + return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) + return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) + return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) + return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) + return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); + return false; + } + + @Override + public IStructureDefinition getStructure_EM() { + return STRUCTURE_DEFINITION; + } + + @Override + protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + this.mLevel = 0; + this.mCostDiscount = 1; + this.setCoilHeat(HeatingCoilLevel.None); + boolean ret = this.structureCheck_EM("main", 1, 2, 0) && this.getCoilHeat() != HeatingCoilLevel.None; + if (this.mMufflerHatches.stream() + .map(MetaTileEntity::getBaseMetaTileEntity) + .mapToInt(ITurnable::getFrontFacing) + .noneMatch(x -> x == this.getExtendedFacing().getRelativeUpInWorld().ordinal())) + return false; + + this.mLevel = this.getCoilHeat().getLevel(); + this.mCostDiscount = this.getCoilHeat().getCostDiscount(); + return ret; + } + + @Override + public void construct(ItemStack itemStack, boolean b) { + this.structureBuild_EM("main", 1,2,0, b, itemStack); + } + + @Override + protected boolean cyclicUpdate_EM() { + return false; + } + + @Override + public String[] getDescription() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Furnace") + .addInfo("Controller Block for the Multi Smelter") + .addInfo("Smelts up to 8-128 items at once") + .addInfo("Items smelted increases with coil tier") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addInfo(ADV_STR_CHECK) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front bottom") + .addCasingInfo("Heat Proof Machine Casing", 8) + .addOtherStructurePart("Heating Coils", "Middle layer") + .addEnergyHatch("Any bottom casing") + .addMaintenanceHatch("Any bottom casing") + .addMufflerHatch("Top Middle") + .addInputBus("Any bottom casing") + .addOutputBus("Any bottom casing") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) + return tt.getInformation(); + return tt.getStructureInformation(); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][11], new TT_RenderedExtendedFacingTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER)}; + } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][11]}; + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiFurnace.png"); + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public void setCoilHeat(HeatingCoilLevel coilMeta) { + this.coilMeta = coilMeta; + } + + @Override + public HeatingCoilLevel getCoilHeat() { + return coilMeta; + } + + @Override + public String[] getStructureDescription(ItemStack itemStack) { + return new String[0]; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new TT_MultiSmelter(this.mName); + } + + @Override + public boolean checkRecipe_EM(ItemStack aStack) { + ArrayList tInputList = getStoredInputs(); + if (tInputList.isEmpty()) + return false; + + int mVolatage = GT_Utility.safeInt(getMaxInputVoltage()); + int tMaxParrallel = 8 * this.mLevel; + int tCurrenParrallel = 0; + ItemStack tSmeltStack = tInputList.get(0); + ItemStack tOutputStack = GT_ModHandler.getSmeltingOutput(tSmeltStack,false,null); + if (tOutputStack == null) + return false; + for (ItemStack item : tInputList) + if (tSmeltStack.isItemEqual(item)) + if (item.stackSize < (tMaxParrallel - tCurrenParrallel)) { + tCurrenParrallel += item.stackSize; + item.stackSize = 0; + } else { + item.stackSize = (tCurrenParrallel + item.stackSize) - tMaxParrallel; + tCurrenParrallel = tMaxParrallel; + break; + } + tCurrenParrallel *= tOutputStack.stackSize; + this.mOutputItems = new ItemStack[(tCurrenParrallel/64)+1]; + for (int i = 0; i < this.mOutputItems.length; i++) { + ItemStack tNewStack = tOutputStack.copy(); + int size = Math.min(tCurrenParrallel, 64); + tNewStack.stackSize = size; + tCurrenParrallel -= size; + this.mOutputItems[i] = tNewStack; + } + + if (this.mOutputItems.length > 0) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + calculateOverclockedNessMulti(4, 512, 1, mVolatage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + + this.mEUt = GT_Utility.safeInt(((long)mEUt) * this.mLevel / (long)this.mCostDiscount,1); + if (mEUt == Integer.MAX_VALUE - 1) + return false; + + if (this.mEUt > 0) + this.mEUt = (-this.mEUt); + } + updateSlots(); + return true; + } + + @Override + public boolean isMachineBlockUpdateRecursive() { + return true; + } + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 20; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java index e35782eaf0..2d154d66ba 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java @@ -30,6 +30,7 @@ import com.github.technus.tectech.mechanics.structure.StructureDefinition; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import gregtech.api.GregTech_API; +import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_Container_MultiMachine; @@ -41,11 +42,13 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.input.Keyboard; import java.util.ArrayList; @@ -54,7 +57,7 @@ import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; public class TT_OilCrackingUnit extends GT_MetaTileEntity_MultiblockBase_EM implements IHasCoils, IConstructable { - public TT_OilCrackingUnit(Object unused) { + public TT_OilCrackingUnit(Object unused, Object unused2) { super(32765, "multimachine.cracker", "Oil Cracking Unit"); GregTech_API.METATILEENTITIES[32765] = null; GregTech_API.METATILEENTITIES[1160] = this; @@ -64,15 +67,15 @@ public class TT_OilCrackingUnit extends GT_MetaTileEntity_MultiblockBase_EM impl super(aName); } - private short coilMeta = -1; + private HeatingCoilLevel coilMeta = HeatingCoilLevel.None; @Override - public void setCoilMeta(short coilMeta) { + public void setCoilHeat(HeatingCoilLevel coilMeta) { this.coilMeta = coilMeta; } @Override - public short getCoilMeta() { + public HeatingCoilLevel getCoilHeat() { return coilMeta; } @@ -151,7 +154,7 @@ public class TT_OilCrackingUnit extends GT_MetaTileEntity_MultiblockBase_EM impl @Override protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - this.coilMeta = -1; + this.coilMeta = HeatingCoilLevel.None; this.blocks = 0; return this.structureCheck_EM("main", 2,1,0) && this.blocks >= 18; @@ -196,21 +199,30 @@ public class TT_OilCrackingUnit extends GT_MetaTileEntity_MultiblockBase_EM impl @Override public String[] getDescription() { - return new String[]{ - "Controller Block for the Oil Cracking Unit", - "Thermally cracks heavy hydrocarbons into lighter fractions", - "Size(WxHxD): 5x3x3 (Hollow), Controller (Front center)", - "Ring of 8 Coils (Each side of Controller)", - "Gets 5% energy cost reduction per coil tier", - "1x Hydrocarbon Input Bus/Hatch (Any left/right side casing)", - "1x Steam/Hydrogen Input Hatch (Any middle ring casing)", - "1x Cracked Hydrocarbon Output Hatch (Any left/right side casing)", - "1x Maintenance Hatch (Any casing)", - "1x Energy Hatch (Any casing)", - "Clean Stainless Steel Machine Casings for the rest (18 at least!)", - "Input/Output Hatches must be on opposite sides", - ADV_STR_CHECK - }; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Cracker") + .addInfo("Controller block for the Oil Cracking Unit") + .addInfo("Thermally cracks heavy hydrocarbons into lighter fractions") + .addInfo("More efficient than the Chemical Reactor") + .addInfo("Place the appropriate circuit in the controller") + .addSeparator() + .beginStructureBlock(5, 3, 3, true) + .addController("Front center") + .addCasingInfo("Clean Stainless Steel Machine Casing", 18) + .addOtherStructurePart("2 Rings of 8 Coils", "Each side of the controller") + .addInfo("Gets 5% energy cost reduction per coil tier") + .addInfo(ADV_STR_CHECK) + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addInputHatch("Steam/Hydrogen, Any middle ring casing") + .addInputHatch("Any left/right side casing") + .addOutputHatch("Any left/right side casing") + .addStructureInfo("Input/Output Hatches must be on opposite sides!") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) + return tt.getInformation(); + else + return tt.getStructureInformation(); } @Override @@ -247,7 +259,7 @@ public class TT_OilCrackingUnit extends GT_MetaTileEntity_MultiblockBase_EM impl calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, getMaxInputVoltage()); if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; - this.mEUt *= Math.pow(0.95D, this.coilMeta); + this.mEUt *= Math.pow(0.95D, this.coilMeta.getTier()); if (this.mEUt > 0) { this.mEUt = (-this.mEUt); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VaccuumFreezer.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VaccuumFreezer.java index 4e07db5605..156ef90060 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VaccuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VaccuumFreezer.java @@ -40,10 +40,12 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.*; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; +import org.lwjgl.input.Keyboard; import java.util.ArrayList; @@ -51,7 +53,7 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_S import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; public class TT_VaccuumFreezer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { - public TT_VaccuumFreezer(Object unused) { + public TT_VaccuumFreezer(Object unused, Object unused2) { super(32765, "multimachine.vacuumfreezer", "Vacuum Freezer"); GregTech_API.METATILEENTITIES[32765] = null; GregTech_API.METATILEENTITIES[1002] = this; @@ -97,17 +99,25 @@ public class TT_VaccuumFreezer extends GT_MetaTileEntity_MultiblockBase_EM imple } public String[] getDescription() { - return new String[]{ - "Controller Block for the Vacuum Freezer", - "Super cools hot ingots and cells", - "Size(WxHxD): 3x3x3 (Hollow), Controller (Front centered)", - "1x Input Bus (Any casing)", - "1x Output Bus (Any casing)", - "1x Maintenance Hatch (Any casing)", - "1x Energy Hatch (Any casing)", - "Frost Proof Machine Casings for the rest (16 at least!)", - ADV_STR_CHECK - }; + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Vacuum Freezer") + .addInfo("Controller Block for the Vacuum Freezer") + .addInfo("Cools hot ingots and cells") + .addInfo(ADV_STR_CHECK) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfo("Frost Proof Machine Casing", 16) + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addInputBus("Any casing") + .addOutputBus("Any casing") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getInformation(); + } else { + return tt.getStructureInformation(); + } } @Override -- cgit From 9673a99e80559579b7d0b157edbfeba27eb023ce Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 29 Dec 2020 17:15:41 +0100 Subject: EBF Heating Cap Fix Former-commit-id: 459c7f8f466a990510115cf667ec7856539028ca --- .../GT_Replacement/TT_ElectronicBlastFurnace.java | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java index eda9093e5b..d6e854a276 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java @@ -53,7 +53,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import org.lwjgl.input.Keyboard; -import java.util.ArrayList; import java.util.Set; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; @@ -72,7 +71,9 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ super(aName); } - private HeatingCoilLevel coilMeta = HeatingCoilLevel.None; + private HeatingCoilLevel heatingCoilLevel = HeatingCoilLevel.None; + private int mHeatingCapacity = 0; + private static final byte TEXTURE_INDEX = 11; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition .builder() @@ -116,6 +117,7 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ @Override protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + this.mHeatingCapacity = 0; this.setCoilHeat(HeatingCoilLevel.None); boolean ret = this.structureCheck_EM("main", 1, 3, 0) && this.getCoilHeat() != HeatingCoilLevel.None; if (this.mMufflerHatches.stream() @@ -123,6 +125,8 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ .mapToInt(ITurnable::getFrontFacing) .noneMatch(x -> x == this.getExtendedFacing().getRelativeUpInWorld().ordinal())) return false; + this.mHeatingCapacity = (int) this.getCoilHeat().getHeat(); + this.mHeatingCapacity += 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 2); return ret; } @@ -212,6 +216,7 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ return false; } + @Override public String[] getDescription() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Blast Furnace") @@ -245,6 +250,7 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ } } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][11], new TT_RenderedExtendedFacingTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; @@ -252,6 +258,7 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][11]}; } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png"); } @@ -263,12 +270,12 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ @Override public void setCoilHeat(HeatingCoilLevel coilMeta) { - this.coilMeta = coilMeta; + this.heatingCoilLevel = coilMeta; } @Override public HeatingCoilLevel getCoilHeat() { - return coilMeta; + return heatingCoilLevel; } @Override @@ -281,6 +288,7 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ return new TT_ElectronicBlastFurnace(this.mName); } + @Override public boolean checkRecipe_EM(ItemStack aStack) { ItemStack[] tInputs = this.getCompactedInputs(); FluidStack[] tFluids = this.getCompactedFluids(); @@ -290,13 +298,13 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); if (tRecipe == null - || (this.getCoilHeat().getHeat() < tRecipe.mSpecialValue) + || (this.mHeatingCapacity < tRecipe.mSpecialValue) || (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) { return false; } this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - int tHeatCapacityDivTiers = (int) ((this.getCoilHeat().getHeat() - tRecipe.mSpecialValue) / 900); + int tHeatCapacityDivTiers = ((this.mHeatingCapacity - tRecipe.mSpecialValue) / 900); byte overclockCount = calculateOverclockednessEBF(tRecipe.mEUt, tRecipe.mDuration, tVoltage); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) -- cgit From 2769ac5af8aad469a20ad54a3873ed505b99be6a Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 31 Dec 2020 23:51:49 +0100 Subject: Fixed Tooltips & GUI for TT Replacements Former-commit-id: fb063680f61081e5a8b7235015dc336df04e2cc3 --- .../bartworks/util/BW_Tooltip_Reference.java | 1 + .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 2 +- .../GT_Replacement/TT_ElectronicBlastFurnace.java | 53 ++--- .../GT_Replacement/TT_ImplosionCompressor.java | 56 +++-- .../multi/GT_Replacement/TT_MultiSmelter.java | 41 ++-- .../multi/GT_Replacement/TT_OilCrackingUnit.java | 42 ++-- .../multi/GT_Replacement/TT_VaccuumFreezer.java | 237 --------------------- .../multi/GT_Replacement/TT_VacuumFreezer.java | 227 ++++++++++++++++++++ 8 files changed, 311 insertions(+), 348 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VaccuumFreezer.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java index 9eb8e70d77..c98d172148 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java @@ -35,6 +35,7 @@ public class BW_Tooltip_Reference { public static final Supplier ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = () -> StatCollector.translateToLocal("tooltip.bw.1.name") + " " + BW; public static final Supplier ADDED_BY_BARTWORKS = () -> StatCollector.translateToLocal("tooltip.bw.0.name") + " " + BW; public static final String ADV_STR_CHECK = "Uses an advanced "+ TT +" structure check, due to "+ BW; + public static final String TT_BLUEPRINT = "To see the structure, use a "+ TT + " Blueprint on the Controller!"; public static String[] getTranslatedBrandedTooltip(String key){ String[] dsc = StatCollector.translateToLocal(key).split(";"); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 46e7652c26..301e25cd40 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -78,7 +78,7 @@ public class BartWorksCrossmod { GalacticraftProxy.init(init); //Base GT -> TT Replacement if (LoaderReference.tectech) { - new TT_VaccuumFreezer(null,null); + new TT_VacuumFreezer(null,null); new TT_OilCrackingUnit(null,null); new TT_ImplosionCompressor(null,null); new TT_ElectronicBlastFurnace(null,null); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java index d6e854a276..600df60ddc 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; import com.github.bartimaeusnek.crossmod.tectech.helper.IHasCoils; import com.github.technus.tectech.mechanics.constructable.IConstructable; @@ -29,6 +30,8 @@ import com.github.technus.tectech.mechanics.structure.IStructureDefinition; import com.github.technus.tectech.mechanics.structure.StructureDefinition; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import com.google.common.collect.ImmutableSet; @@ -56,6 +59,7 @@ import org.lwjgl.input.Keyboard; import java.util.Set; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; import static gregtech.api.enums.GT_Values.V; @@ -120,11 +124,14 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ this.mHeatingCapacity = 0; this.setCoilHeat(HeatingCoilLevel.None); boolean ret = this.structureCheck_EM("main", 1, 3, 0) && this.getCoilHeat() != HeatingCoilLevel.None; + this.mMufflerHatches.forEach(x -> x.setInValidFacings(this.getExtendedFacing().getRelativeUpInWorld().getOpposite())); + if (this.mMufflerHatches.stream() .map(MetaTileEntity::getBaseMetaTileEntity) .mapToInt(ITurnable::getFrontFacing) .noneMatch(x -> x == this.getExtendedFacing().getRelativeUpInWorld().ordinal())) return false; + this.mHeatingCapacity = (int) this.getCoilHeat().getHeat(); this.mHeatingCapacity += 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 2); return ret; @@ -218,36 +225,18 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Blast Furnace") - .addInfo("Controller block for the Electric Blast Furnace") - .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") - .addInfo("Each 900K over the min. Heat required multiplies EU/t by 0.95") - .addInfo("Each 1800K over the min. Heat required allows for one upgraded overclock instead of normal") - .addInfo("Upgraded overclocks reduce recipe time to 25% (instead of 50%) and increase EU/t to 400%") - .addInfo("Additionally gives +100K for every tier past MV") - .addPollutionAmount(20 * getPollutionPerTick(null)) - .addInfo(ADV_STR_CHECK) - .addSeparator() - .beginStructureBlock(3, 4, 3, true) - .addController("Front bottom") - .addCasingInfo("Heat Proof Machine Casing", 0) - .addOtherStructurePart("Heating Coils", "Two middle Layers") - .addEnergyHatch("Any bottom layer casing") - .addMaintenanceHatch("Any bottom layer casing") - .addMufflerHatch("Top middle") - .addInputBus("Any bottom layer casing") - .addInputHatch("Any bottom layer casing") - .addOutputBus("Any bottom layer casing") - .addOutputHatch("CO/CO2/SO2, Any top layer casing") - .addStructureInfo("Recovery amount scales with Muffler Hatch tier") - .addOutputHatch("Fluids, Any bottom layer casing") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + return new String[]{ + "Blast Furnace", + "Controller block for the Electric Blast Furnace", + "You can use some fluids to reduce recipe time. Place the circuit in the Input Bus", + "Each 900K over the min. Heat required multiplies EU/t by 0.95", + "Each 1800K over the min. Heat required allows for one upgraded overclock instead of normal", + "Upgraded overclocks reduce recipe time to 25% (instead of 50%) and increase EU/t to 400%", + "Additionally gives +100K for every tier past MV", + "Creates up to: " + 20 * getPollutionPerTick(null) + " Pollution per Second", + ADV_STR_CHECK, + TT_BLUEPRINT + }; } @Override @@ -260,12 +249,12 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png"); + return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png",false,false,true); } @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity); + return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, false, false, true); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java index 8b41aa1dbc..18b5e52bcf 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java @@ -22,12 +22,15 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.crossmod.tectech.helper.StructureDefinitions; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.structure.IStructureDefinition; import com.github.technus.tectech.mechanics.structure.StructureDefinition; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import com.google.common.collect.ArrayListMultimap; @@ -38,6 +41,8 @@ import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.interfaces.tileentity.ITurnable; +import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.*; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; @@ -131,8 +136,17 @@ public class TT_ImplosionCompressor extends GT_MetaTileEntity_MultiblockBase_EM @Override protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { this.blocks = 0; - return this.structureCheck_EM("main", 1,1,0) + boolean ret = this.structureCheck_EM("main", 1,1,0) && this.blocks >= 16; + this.mMufflerHatches.forEach(x -> x.setInValidFacings(this.getExtendedFacing().getRelativeUpInWorld().getOpposite())); + + if (this.mMufflerHatches.stream() + .map(MetaTileEntity::getBaseMetaTileEntity) + .mapToInt(ITurnable::getFrontFacing) + .noneMatch(x -> x == this.getExtendedFacing().getRelativeUpInWorld().ordinal())) + return false; + + return ret; } @Override @@ -152,28 +166,14 @@ public class TT_ImplosionCompressor extends GT_MetaTileEntity_MultiblockBase_EM @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Implosion Compressor") - .addInfo("Explosions are fun") - .addInfo("Controller block for the Implosion Compressor") - .addPollutionAmount(20 * getPollutionPerTick(null)) - .addInfo(ADV_STR_CHECK) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front center") - .addCasingInfo("Solid Steel Machine Casing", 16) - .addStructureInfo("Casings can be replaced with Explosion Warning Signs") - .addEnergyHatch("Any casing") - .addMaintenanceHatch("Any casing") - .addMufflerHatch("Any casing") - .addInputBus("Any casing") - .addOutputBus("Any casing") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + return new String[]{ + "Implosion Compressor", + "Explosions are fun", + "Controller block for the Implosion Compressor", + "Creates up to: " + 20 * getPollutionPerTick(null) + " Pollution per Second", + ADV_STR_CHECK, + TT_BLUEPRINT + }; } @Override @@ -185,13 +185,13 @@ public class TT_ImplosionCompressor extends GT_MetaTileEntity_MultiblockBase_EM } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity); + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png",false,false,true); } @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ImplosionCompressor.png"); + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, false, false, true); } @Override @@ -248,8 +248,6 @@ public class TT_ImplosionCompressor extends GT_MetaTileEntity_MultiblockBase_EM } } - - @Override public int getMaxEfficiency(ItemStack aStack) { return 10000; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java index 086b2c694e..8ebe821e71 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; import com.github.bartimaeusnek.crossmod.tectech.helper.IHasCoils; import com.github.technus.tectech.mechanics.constructable.IConstructable; @@ -29,6 +30,8 @@ import com.github.technus.tectech.mechanics.structure.IStructureDefinition; import com.github.technus.tectech.mechanics.structure.StructureDefinition; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import gregtech.api.GregTech_API; @@ -52,6 +55,7 @@ import org.lwjgl.input.Keyboard; import java.util.ArrayList; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; public class TT_MultiSmelter extends GT_MetaTileEntity_MultiblockBase_EM implements IHasCoils, IConstructable { @@ -143,6 +147,9 @@ public class TT_MultiSmelter extends GT_MetaTileEntity_MultiblockBase_EM impleme this.mCostDiscount = 1; this.setCoilHeat(HeatingCoilLevel.None); boolean ret = this.structureCheck_EM("main", 1, 2, 0) && this.getCoilHeat() != HeatingCoilLevel.None; + + this.mMufflerHatches.forEach(x -> x.setInValidFacings(this.getExtendedFacing().getRelativeUpInWorld().getOpposite())); + if (this.mMufflerHatches.stream() .map(MetaTileEntity::getBaseMetaTileEntity) .mapToInt(ITurnable::getFrontFacing) @@ -166,27 +173,15 @@ public class TT_MultiSmelter extends GT_MetaTileEntity_MultiblockBase_EM impleme @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Furnace") - .addInfo("Controller Block for the Multi Smelter") - .addInfo("Smelts up to 8-128 items at once") - .addInfo("Items smelted increases with coil tier") - .addPollutionAmount(20 * getPollutionPerTick(null)) - .addInfo(ADV_STR_CHECK) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front bottom") - .addCasingInfo("Heat Proof Machine Casing", 8) - .addOtherStructurePart("Heating Coils", "Middle layer") - .addEnergyHatch("Any bottom casing") - .addMaintenanceHatch("Any bottom casing") - .addMufflerHatch("Top Middle") - .addInputBus("Any bottom casing") - .addOutputBus("Any bottom casing") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) - return tt.getInformation(); - return tt.getStructureInformation(); + return new String[]{ + "Furnace", + "Controller Block for the Multi Smelter", + "Smelts up to 8-128 items at once", + "Items smelted increases with coil tier", + "Creates up to: " + 20 * getPollutionPerTick(null) + " Pollution per Second", + ADV_STR_CHECK, + TT_BLUEPRINT + }; } @Override @@ -199,12 +194,12 @@ public class TT_MultiSmelter extends GT_MetaTileEntity_MultiblockBase_EM impleme @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiFurnace.png"); + return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png",false,false,true); } @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity); + return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, false, false, true); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java index 2d154d66ba..3e5dcc5553 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java @@ -22,11 +22,14 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; import com.github.bartimaeusnek.crossmod.tectech.helper.IHasCoils; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.structure.IStructureDefinition; import com.github.technus.tectech.mechanics.structure.StructureDefinition; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import gregtech.api.GregTech_API; @@ -53,6 +56,7 @@ import org.lwjgl.input.Keyboard; import java.util.ArrayList; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; public class TT_OilCrackingUnit extends GT_MetaTileEntity_MultiblockBase_EM implements IHasCoils, IConstructable { @@ -199,30 +203,16 @@ public class TT_OilCrackingUnit extends GT_MetaTileEntity_MultiblockBase_EM impl @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Cracker") - .addInfo("Controller block for the Oil Cracking Unit") - .addInfo("Thermally cracks heavy hydrocarbons into lighter fractions") - .addInfo("More efficient than the Chemical Reactor") - .addInfo("Place the appropriate circuit in the controller") - .addSeparator() - .beginStructureBlock(5, 3, 3, true) - .addController("Front center") - .addCasingInfo("Clean Stainless Steel Machine Casing", 18) - .addOtherStructurePart("2 Rings of 8 Coils", "Each side of the controller") - .addInfo("Gets 5% energy cost reduction per coil tier") - .addInfo(ADV_STR_CHECK) - .addEnergyHatch("Any casing") - .addMaintenanceHatch("Any casing") - .addInputHatch("Steam/Hydrogen, Any middle ring casing") - .addInputHatch("Any left/right side casing") - .addOutputHatch("Any left/right side casing") - .addStructureInfo("Input/Output Hatches must be on opposite sides!") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) - return tt.getInformation(); - else - return tt.getStructureInformation(); + return new String[]{ + "Cracker", + "Controller block for the Oil Cracking Unit", + "Thermally cracks heavy hydrocarbons into lighter fractions", + "More efficient than the Chemical Reactor", + "Place the appropriate circuit in the controller", + "Gets 5% energy cost reduction per coil tier", + ADV_STR_CHECK, + TT_BLUEPRINT + }; } @Override @@ -236,12 +226,12 @@ public class TT_OilCrackingUnit extends GT_MetaTileEntity_MultiblockBase_EM impl @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "OilCrackingUnit.png"); + return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png",false,false,true); } @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity); + return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, false, false, true); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VaccuumFreezer.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VaccuumFreezer.java deleted file mode 100644 index 156ef90060..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VaccuumFreezer.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; - -import com.github.bartimaeusnek.crossmod.tectech.helper.StructureDefinitions; -import com.github.technus.tectech.mechanics.constructable.IConstructable; -import com.github.technus.tectech.mechanics.structure.IStructureDefinition; -import com.github.technus.tectech.mechanics.structure.StructureDefinition; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; -import gregtech.api.gui.GT_Container_MultiMachine; -import gregtech.api.gui.GT_GUIContainer_MultiMachine; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.*; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import org.lwjgl.input.Keyboard; - -import java.util.ArrayList; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; -import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; - -public class TT_VaccuumFreezer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { - public TT_VaccuumFreezer(Object unused, Object unused2) { - super(32765, "multimachine.vacuumfreezer", "Vacuum Freezer"); - GregTech_API.METATILEENTITIES[32765] = null; - GregTech_API.METATILEENTITIES[1002] = this; - } - - @Override - protected boolean cyclicUpdate_EM() { - return false; - } - - private TT_VaccuumFreezer(String aName) { - super(aName); - } - - private static final byte TEXTURE_INDEX = 17; - - private byte blocks = 0; - - private static final IStructureDefinition STRUCTURE_DEFINITION = - StructureDefinition.builder().addShape("main", - StructureDefinitions.CUBE_NO_MUFFLER.getDefinition() - ).addElement( - 'V', - ofChain( - ofHatchAdder( - TT_VaccuumFreezer::addVaccumFreezerHatches, - TEXTURE_INDEX, - 1 - ), - onElementPass( - x -> ++x.blocks, - ofBlock( - GregTech_API.sBlockCasings2, - 1 - ) - ) - ) - ).build(); - - @Override - public IStructureDefinition getStructure_EM() { - return STRUCTURE_DEFINITION; - } - - public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Vacuum Freezer") - .addInfo("Controller Block for the Vacuum Freezer") - .addInfo("Cools hot ingots and cells") - .addInfo(ADV_STR_CHECK) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front center") - .addCasingInfo("Frost Proof Machine Casing", 16) - .addEnergyHatch("Any casing") - .addMaintenanceHatch("Any casing") - .addInputBus("Any casing") - .addOutputBus("Any casing") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } - } - - @Override - protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - this.blocks = 0; - return this.structureCheck_EM("main", 1,1,0) - && this.blocks >= 16; - } - - @SideOnly(Side.CLIENT) - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX], new TT_RenderedExtendedFacingTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)}; - } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX]}; - } - - @Override - public boolean checkRecipe_EM(ItemStack itemStack) { - ArrayList tInputList = getStoredInputs(); - for (ItemStack tInput : tInputList) { - long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, tInput); - if (tRecipe != null) { - if (tRecipe.isRecipeInputEqual(true, null, tInput)) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - - calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; - updateSlots(); - return true; - } - } - } - return false; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new TT_VaccuumFreezer(this.mName); - } - - @Override - public boolean isMachineBlockUpdateRecursive() { - return true; - } - - public int getMaxEfficiency(ItemStack aStack) { - return 10000; - } - - public int getPollutionPerTick(ItemStack aStack) { - return 0; - } - - public int getDamageToComponent(ItemStack aStack) { - return 0; - } - - public boolean explodesOnComponentBreak(ItemStack aStack) { - return false; - } - - @Override - public void construct(ItemStack itemStack, boolean b) { - this.structureBuild_EM("main", 1,1,0, b, itemStack); - } - - @Override - public String[] getStructureDescription(ItemStack itemStack) { - return new String[0]; - } - - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png"); - } - - public final boolean addVaccumFreezerHatches(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity != null) { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - else - return false; - - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) - return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) - return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); - } - return false; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java new file mode 100644 index 0000000000..6b9eb89563 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java @@ -0,0 +1,227 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; + +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; +import com.github.bartimaeusnek.crossmod.tectech.helper.StructureDefinitions; +import com.github.technus.tectech.mechanics.constructable.IConstructable; +import com.github.technus.tectech.mechanics.structure.IStructureDefinition; +import com.github.technus.tectech.mechanics.structure.StructureDefinition; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.*; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import org.lwjgl.input.Keyboard; + +import java.util.ArrayList; + +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; +import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; + +public class TT_VacuumFreezer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + public TT_VacuumFreezer(Object unused, Object unused2) { + super(32765, "multimachine.vacuumfreezer", "Vacuum Freezer"); + GregTech_API.METATILEENTITIES[32765] = null; + GregTech_API.METATILEENTITIES[1002] = this; + } + + @Override + protected boolean cyclicUpdate_EM() { + return false; + } + + private TT_VacuumFreezer(String aName) { + super(aName); + } + + private static final byte TEXTURE_INDEX = 17; + + private byte blocks = 0; + + private static final IStructureDefinition STRUCTURE_DEFINITION = + StructureDefinition.builder().addShape("main", + StructureDefinitions.CUBE_NO_MUFFLER.getDefinition() + ).addElement( + 'V', + ofChain( + ofHatchAdder( + TT_VacuumFreezer::addVacuumFreezerHatches, + TEXTURE_INDEX, + 1 + ), + onElementPass( + x -> ++x.blocks, + ofBlock( + GregTech_API.sBlockCasings2, + 1 + ) + ) + ) + ).build(); + + @Override + public IStructureDefinition getStructure_EM() { + return STRUCTURE_DEFINITION; + } + + public String[] getDescription() { + return new String[]{ + "Vacuum Freezer", + "Controller Block for the Vacuum Freezer", + "Cools hot ingots and cells", + ADV_STR_CHECK, + TT_BLUEPRINT + }; + } + + @Override + protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + this.blocks = 0; + return this.structureCheck_EM("main", 1,1,0) + && this.blocks >= 16; + } + + @SideOnly(Side.CLIENT) + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX], new TT_RenderedExtendedFacingTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)}; + } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX]}; + } + + @Override + public boolean checkRecipe_EM(ItemStack itemStack) { + ArrayList tInputList = getStoredInputs(); + for (ItemStack tInput : tInputList) { + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, tInput); + if (tRecipe != null) { + if (tRecipe.isRecipeInputEqual(true, null, tInput)) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; + updateSlots(); + return true; + } + } + } + return false; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new TT_VacuumFreezer(this.mName); + } + + @Override + public boolean isMachineBlockUpdateRecursive() { + return true; + } + + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + public int getPollutionPerTick(ItemStack aStack) { + return 0; + } + + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + + @Override + public void construct(ItemStack itemStack, boolean b) { + this.structureBuild_EM("main", 1,1,0, b, itemStack); + } + + @Override + public String[] getStructureDescription(ItemStack itemStack) { + return new String[0]; + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png",false,false,true); + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, false, false, true); + } + + public final boolean addVacuumFreezerHatches(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity != null) { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + else + return false; + + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) + return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) + return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) + return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) + return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) + return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) + return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); + } + return false; + } +} -- cgit From 28fb22fb1375643323e460f08b7d80e1feccb146 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 1 Jan 2021 19:47:10 +0100 Subject: Round Up Replacement-Multiblocks Former-commit-id: d8a462662ba20d2644572e19fb253751b8a8435e --- .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 1 + .../multi/GT_Replacement/BW_TT_HeatExchanger.java | 368 +++++++++++++++++++++ .../GT_Replacement/TT_Abstract_GT_Replacement.java | 102 ++++++ .../TT_Abstract_GT_Replacement_Coils.java | 25 ++ .../GT_Replacement/TT_ElectronicBlastFurnace.java | 160 ++++----- .../GT_Replacement/TT_ImplosionCompressor.java | 76 ++--- .../multi/GT_Replacement/TT_MultiSmelter.java | 152 ++++----- .../multi/GT_Replacement/TT_OilCrackingUnit.java | 144 +++----- .../multi/GT_Replacement/TT_VacuumFreezer.java | 83 ++--- 9 files changed, 721 insertions(+), 390 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement_Coils.java diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 301e25cd40..228df30f2d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -83,6 +83,7 @@ public class BartWorksCrossmod { new TT_ImplosionCompressor(null,null); new TT_ElectronicBlastFurnace(null,null); new TT_MultiSmelter(null,null); + new BW_TT_HeatExchanger(null, null); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java new file mode 100644 index 0000000000..9643bd942d --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java @@ -0,0 +1,368 @@ +package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; + +import com.github.technus.tectech.mechanics.structure.IStructureDefinition; +import com.github.technus.tectech.mechanics.structure.StructureDefinition; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import java.util.Collection; + +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; +import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; + +public class BW_TT_HeatExchanger extends TT_Abstract_GT_Replacement { + public static float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25) + + private GT_MetaTileEntity_Hatch_Input mInputHotFluidHatch; + private GT_MetaTileEntity_Hatch_Output mOutputColdFluidHatch; + private boolean superheated = false; + private int superheated_threshold = 0; + private float water; + private byte blocks = 0; + + public BW_TT_HeatExchanger(Object unused, Object unused2) { + super(1154, "multimachine.heatexchanger", "Large Heat Exchanger"); + } + + public BW_TT_HeatExchanger(String aName) { + super(aName); + } + + private static final byte TEXTURE_INDEX = 50; + private static final byte SOLID_CASING_META = 2; + private static final byte PIPE_CASING_META = 14; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape("main", + transpose(new String[][]{ + {"AAA", "ACA", "AAA"}, + {"AAA", "ABA", "AAA"}, + {"AAA", "ABA", "AAA"}, + {"A~A", "ADA", "AAA"} + }) + ).addElement( + 'A', + ofChain( + ofHatchAdder( + BW_TT_HeatExchanger::addClassicToMachineList, TEXTURE_INDEX, + GregTech_API.sBlockCasings4, SOLID_CASING_META + ), + onElementPass( + x -> ++x.blocks, + ofBlock( + GregTech_API.sBlockCasings4, SOLID_CASING_META + ) + ) + ) + + ).addElement( + 'B', + ofBlock( + GregTech_API.sBlockCasings2, PIPE_CASING_META, + GregTech_API.sBlockCasings2, PIPE_CASING_META + ) + ).addElement( + 'C', + ofHatchAdder( + BW_TT_HeatExchanger::addColdFluidOutputToMachineList,TEXTURE_INDEX, + 1 + ) + ).addElement( + 'D', + ofHatchAdder( + BW_TT_HeatExchanger::addHotFluidInputToMachineList,TEXTURE_INDEX, + 2 + ) + ) + .build(); + + @Override + public IStructureDefinition getStructure_EM() { + return STRUCTURE_DEFINITION; + } + + @Override + protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + this.blocks = 0; + return this.structureCheck_EM("main", 1, 3, 0) && this.blocks >= 20; + } + + private final static String[] desc = new String[]{ + "Heat Exchanger", + "Controller Block for the Large Heat Exchanger", + "Inputs are Hot Fluids and Distilled Water", + "Outputs Cold Fluids and SH Steam/Steam", + "Requires an additional Input and Output Hatch anywhere!", + ADV_STR_CHECK, + TT_BLUEPRINT + }; + + public String[] getDescription() { + return desc; + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + superheated = aNBT.getBoolean("superheated"); + super.loadNBTData(aNBT); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setBoolean("superheated", superheated); + super.saveNBTData(aNBT); + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][50], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)}; + } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][50]}; + } + + private void checkRecipeClassic(float efficiency){ + int fluidAmountToConsume = mInputHotFluidHatch.getFluidAmount(); + float steam_output_multiplier = 20f; // default: multiply output by 4 * 10 (boosted x5) + boolean do_lava = false; + // If we're working with lava, adjust the threshold and multipliers accordingly. + if (GT_ModHandler.isLava(mInputHotFluidHatch.getFluid())) { + steam_output_multiplier /= 5f; // lava is not boosted + superheated_threshold /= 4f; // unchanged + do_lava = true; + } else if (mInputHotFluidHatch.getFluid().isFluidEqual(FluidRegistry.getFluidStack("ic2hotcoolant", 1))) { + steam_output_multiplier /= 2f; // was boosted x2 on top of x5 -> total x10 -> nerf with this code back to 5x + superheated_threshold /= 5f; // 10x smaller since the Hot Things production in reactor is the same. + } + + superheated = fluidAmountToConsume >= superheated_threshold; // set the internal superheated flag if we have enough hot fluid. Used in the onRunningTick method. + fluidAmountToConsume = Math.min(fluidAmountToConsume, superheated_threshold * 2); // Don't consume too much hot fluid per second + mInputHotFluidHatch.drain(fluidAmountToConsume, true); + this.mMaxProgresstime = 20; + this.mEUt = (int) (fluidAmountToConsume * steam_output_multiplier * efficiency); + if (do_lava) { + mOutputColdFluidHatch.fill(FluidRegistry.getFluidStack("ic2pahoehoelava", fluidAmountToConsume), true); + } else { + mOutputColdFluidHatch.fill(FluidRegistry.getFluidStack("ic2coolant", fluidAmountToConsume), true); + } + this.mEfficiencyIncrease = 80; + } + + Materials last = null; + + private void checkRecipe_Additions(float efficiency){ + Materials m = null; + if (last == null || !mInputHotFluidHatch.getFluid().isFluidEqual(last.getPlasma(1))) { + for (Materials materials : Materials.values()) { + if (mInputHotFluidHatch.getFluid().isFluidEqual(materials.getPlasma(1))) { + last = m = materials; + break; + } + else if (mInputHotFluidHatch.getFluid().isFluidEqual(materials.getMolten(1))){ + GT_Log.exp.println(this.mName + " had Molten Metal Injected!"); + explodeMultiblock(); // Generate crater + return; + } + } + } + else + m = last; + + if (m == null) + return; + + int heat = getFuelValue(mInputHotFluidHatch.getFluid(), (int) (100 * efficiency)); + + superheated_threshold /= 4f; + + superheated = heat >= superheated_threshold; // set the internal superheated flag if we have enough hot fluid. Used in the onRunningTick method. + + mInputHotFluidHatch.drain(1, true); + this.mMaxProgresstime = 20; + this.mEUt = heat; + mOutputColdFluidHatch.fill(m.getMolten(1), true); + this.mEfficiencyIncrease = 80; + } + + private int getFuelValue(FluidStack aLiquid, int efficency) { + if (aLiquid == null || getRecipes() == null) + return 0; + FluidStack tLiquid; + Collection tRecipeList = getRecipes().mRecipeList; + if (tRecipeList == null) + return 0; + for (GT_Recipe tFuel : tRecipeList) { + tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true); + if (tLiquid == null) { + continue; + } + if (!aLiquid.isFluidEqual(tLiquid)) { + continue; + } + long val = (long) tFuel.mSpecialValue * efficency / 100; + if (val > Integer.MAX_VALUE) { + throw new ArithmeticException("Integer LOOPBACK!"); + } + return (int) val; + } + return 0; + } + + private GT_Recipe.GT_Recipe_Map getRecipes() { + return GT_Recipe.GT_Recipe_Map.sPlasmaFuels; + } + + public boolean checkRecipe_EM(ItemStack aStack) { + if (mInputHotFluidHatch.getFluid() == null) + return true; + FluidStack fluid = mInputHotFluidHatch.getFluid(); // how much fluid is in hatch + superheated_threshold = 4000; // default: must have 4000L per second to generate superheated steam + float efficiency = calculateEfficiency(); + + if (GT_ModHandler.isLava(fluid) || fluid.isFluidEqual(FluidRegistry.getFluidStack("ic2hotcoolant", 1))) + checkRecipeClassic(efficiency); + else + checkRecipe_Additions(efficiency); + + return true; + } + + private float calculateEfficiency(){ + float defaultEff = 1f; // default: operate at 100% efficiency with no integrated circuitry + float penalty; // penalty to apply to output based on circuitry level (1-25). + int shs_reduction_per_config = 150; // reduce threshold 150L/s per circuitry level (1-25) + + // Do we have an integrated circuit? + if (mInventory[1] == null || mInventory[1].getItem() != GT_Utility.getIntegratedCircuit(0).getItem()) + return defaultEff; + + //valid configuration? + int circuit_config = mInventory[1].getItemDamage(); + if (circuit_config < 1 || circuit_config > 25) + return defaultEff; + + // If so, apply the penalty and reduced threshold. + penalty = (circuit_config - 1) * penalty_per_config; + superheated_threshold -= (shs_reduction_per_config * (circuit_config - 1)); + return defaultEff - penalty; + } + + private int useWater(float input) { + water = water + input; + int usage = (int) water; + water = water - usage; + return usage; + } + + public boolean onRunningTick(ItemStack aStack) { + if (this.mEUt <= 0) { + return false; + } + int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 100_00L); // APPROXIMATELY how much steam to generate. + if (tGeneratedEU <= 0) { + return false; + } + + if (superheated) + tGeneratedEU /= 2; // We produce half as much superheated steam if necessary + + int distilledConsumed = useWater(tGeneratedEU / 160f); // how much distilled water to consume + //tGeneratedEU = distilledConsumed * 160; // EXACTLY how much steam to generate, producing a perfect 1:160 ratio with distilled water consumption + + FluidStack distilledStack = GT_ModHandler.getDistilledWater(distilledConsumed); + if (depleteInput(distilledStack)) // Consume the distilled water + { + if (superheated) { + addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", tGeneratedEU)); // Generate superheated steam + } else { + addOutput(GT_ModHandler.getSteam(tGeneratedEU)); // Generate regular steam + } + } else { + GT_Log.exp.println(this.mName + " had no more Distilled water!"); + explodeMultiblock(); // Generate crater + return false; + } + return true; + } + + + public boolean addColdFluidOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) + return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (!(aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output)) { + return false; + } + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + mOutputColdFluidHatch = (GT_MetaTileEntity_Hatch_Output) aMetaTileEntity; + return true; + } + + public boolean addHotFluidInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (!(aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input)) { + return false; + } + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + mInputHotFluidHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity; + mInputHotFluidHatch.mRecipeMap = null; + return true; + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new BW_TT_HeatExchanger(this.mName); + } + + @Override + public String[] getInfoData() { + return new String[]{ + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", + StatCollector.translateToLocal("GT5U.multiblock.usage") + " " + StatCollector.translateToLocal("GT5U.LHE.steam") + ": " + + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW) + (superheated ? -2 * mEUt : -mEUt) + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.LHE.superheated") + ": " + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.BLUE) + superheated + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.LHE.superheated") + " " + StatCollector.translateToLocal("GT5U.LHE.threshold") + ": " + EnumChatFormatting.GREEN + superheated_threshold + EnumChatFormatting.RESET + }; + } + + @Override + public void construct(ItemStack itemStack, boolean b) { + this.structureBuild_EM("main", 1,3,0, b, itemStack); + } + + private static final String[] sfStructureDescription = new String[] { + "1 - Cold Fluid Output", + "2 - Hot Fluid Input", + "Needs an additional Output Hatch", + "Needs an additional Input Hatch" + }; + + @Override + public String[] getStructureDescription(ItemStack itemStack) { + return sfStructureDescription; + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java new file mode 100644 index 0000000000..8486234619 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java @@ -0,0 +1,102 @@ +package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; + +import com.github.technus.tectech.mechanics.constructable.IConstructable; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.*; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +public abstract class TT_Abstract_GT_Replacement extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + + protected TT_Abstract_GT_Replacement(int newId, String aName, String aNameRegional) { + super(32765, aName, aNameRegional); + GregTech_API.METATILEENTITIES[32765] = null; + GregTech_API.METATILEENTITIES[newId] = this; + } + + protected TT_Abstract_GT_Replacement(String aName) { + super(aName); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", ePowerPass,false,true); + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, ePowerPass, false, true); + } + + @Override + protected boolean cyclicUpdate_EM() { + return false; + } + + @Override + public boolean isMachineBlockUpdateRecursive() { + return true; + } + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + private static final String[] sfStructureDescription = new String[] {"1 - Muffler"}; + + @Override + public String[] getStructureDescription(ItemStack itemStack) { + return sfStructureDescription; + } + + public final boolean addEBFInputsBottom(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) + return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + else + return false; + + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) + return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) + return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) + return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) + return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) + return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) + return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) + return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) + return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); + return false; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement_Coils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement_Coils.java new file mode 100644 index 0000000000..868d432eb3 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement_Coils.java @@ -0,0 +1,25 @@ +package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; + +import com.github.bartimaeusnek.crossmod.tectech.helper.IHasCoils; +import gregtech.api.enums.HeatingCoilLevel; + +public abstract class TT_Abstract_GT_Replacement_Coils extends TT_Abstract_GT_Replacement implements IHasCoils { + protected TT_Abstract_GT_Replacement_Coils(int newId, String aName, String aNameRegional) { + super(newId, aName, aNameRegional); + } + + protected TT_Abstract_GT_Replacement_Coils(String aName) { + super(aName); + } + protected HeatingCoilLevel heatingCoilLevel = HeatingCoilLevel.None; + + @Override + public void setCoilHeat(HeatingCoilLevel coilMeta) { + heatingCoilLevel = coilMeta; + } + + @Override + public HeatingCoilLevel getCoilHeat() { + return heatingCoilLevel; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java index 600df60ddc..f2ee015f50 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java @@ -22,7 +22,6 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; import com.github.bartimaeusnek.crossmod.tectech.helper.IHasCoils; import com.github.technus.tectech.mechanics.constructable.IConstructable; @@ -30,8 +29,6 @@ import com.github.technus.tectech.mechanics.structure.IStructureDefinition; import com.github.technus.tectech.mechanics.structure.StructureDefinition; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import com.google.common.collect.ImmutableSet; @@ -39,8 +36,6 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; -import gregtech.api.gui.GT_Container_MultiMachine; -import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -48,13 +43,12 @@ import gregtech.api.interfaces.tileentity.ITurnable; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.*; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; -import org.lwjgl.input.Keyboard; import java.util.Set; @@ -62,20 +56,18 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_S import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GT_Values.VN; -public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_EM implements IHasCoils, IConstructable { +public class TT_ElectronicBlastFurnace extends TT_Abstract_GT_Replacement_Coils { public TT_ElectronicBlastFurnace(Object unused, Object unused2) { - super(32765, "multimachine.blastfurnace", "Electric Blast Furnace"); - GregTech_API.METATILEENTITIES[32765] = null; - GregTech_API.METATILEENTITIES[1000] = this; + super(1000, "multimachine.blastfurnace", "Electric Blast Furnace"); } private TT_ElectronicBlastFurnace(String aName) { super(aName); } - private HeatingCoilLevel heatingCoilLevel = HeatingCoilLevel.None; private int mHeatingCapacity = 0; private static final byte TEXTURE_INDEX = 11; @@ -142,11 +134,6 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ this.structureBuild_EM("main", 1,3,0, b, itemStack); } - @Override - protected boolean cyclicUpdate_EM() { - return false; - } - public final boolean addEBFInputsTop(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) return false; @@ -195,48 +182,24 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ return false; } - public final boolean addEBFInputsBottom(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) - return false; - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - else - return false; - - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) - return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) - return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); - return false; - } + private static final int pollutionPerTick = 20; + + private final static String[] desc = new String[]{ + "Blast Furnace", + "Controller block for the Electric Blast Furnace", + "You can use some fluids to reduce recipe time. Place the circuit in the Input Bus", + "Each 900K over the min. Heat required multiplies EU/t by 0.95", + "Each 1800K over the min. Heat required allows for one upgraded overclock instead of normal", + "Upgraded overclocks reduce recipe time to 25% (instead of 50%) and increase EU/t to 400%", + "Additionally gives +100K for every tier past MV", + "Creates up to: " + 20 * pollutionPerTick + " Pollution per Second", + ADV_STR_CHECK, + TT_BLUEPRINT + }; @Override public String[] getDescription() { - return new String[]{ - "Blast Furnace", - "Controller block for the Electric Blast Furnace", - "You can use some fluids to reduce recipe time. Place the circuit in the Input Bus", - "Each 900K over the min. Heat required multiplies EU/t by 0.95", - "Each 1800K over the min. Heat required allows for one upgraded overclock instead of normal", - "Upgraded overclocks reduce recipe time to 25% (instead of 50%) and increase EU/t to 400%", - "Additionally gives +100K for every tier past MV", - "Creates up to: " + 20 * getPollutionPerTick(null) + " Pollution per Second", - ADV_STR_CHECK, - TT_BLUEPRINT - }; + return desc; } @Override @@ -247,31 +210,6 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][11]}; } - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png",false,false,true); - } - - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, false, false, true); - } - - @Override - public void setCoilHeat(HeatingCoilLevel coilMeta) { - this.heatingCoilLevel = coilMeta; - } - - @Override - public HeatingCoilLevel getCoilHeat() { - return heatingCoilLevel; - } - - @Override - public String[] getStructureDescription(ItemStack itemStack) { - return new String[0]; - } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new TT_ElectronicBlastFurnace(this.mName); @@ -366,32 +304,56 @@ public class TT_ElectronicBlastFurnace extends GT_MetaTileEntity_MultiblockBase_ } @Override - public boolean isMachineBlockUpdateRecursive() { - return true; - } + public String[] getInfoData() { + int mPollutionReduction = 0; + for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { + if (!isValidMetaTileEntity(tHatch)) + continue; + mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); + } - @Override - public boolean isCorrectMachinePart(ItemStack aStack) { - return true; - } + long storedEnergy = 0; + long maxEnergy = 0; + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { + if (!isValidMetaTileEntity(tHatch)) + continue; + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + } - @Override - public int getMaxEfficiency(ItemStack aStack) { - return 10000; + return new String[]{ + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + -mEUt + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + + EnumChatFormatting.YELLOW + VN[GT_Utility.getTier(getMaxInputVoltage())] + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.EBF.heat") + ": " + + EnumChatFormatting.GREEN + mHeatingCapacity + EnumChatFormatting.RESET + " K", + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %" + }; } @Override public int getPollutionPerTick(ItemStack aStack) { - return 20; + return pollutionPerTick; } - @Override - public int getDamageToComponent(ItemStack aStack) { - return 0; - } + private static final String[] sfStructureDescription = new String[] { + "0 - Air", + "1 - Muffler", + "Required: Output Bus, Input Bus, Energy Hatch, Maintenance Hatch", + "Optional: Input Hatch, Output Hatch at Bottom, Output Hatch at top to regain CO/CO2/SO2" + }; @Override - public boolean explodesOnComponentBreak(ItemStack aStack) { - return false; + public String[] getStructureDescription(ItemStack itemStack) { + return sfStructureDescription; } + } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java index 18b5e52bcf..ade1cca05a 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java @@ -57,23 +57,16 @@ import java.util.List; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.*; import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; -public class TT_ImplosionCompressor extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { +public class TT_ImplosionCompressor extends TT_Abstract_GT_Replacement { public TT_ImplosionCompressor(Object unused, Object unused2) { - super(32765, "multimachine.implosioncompressor", "Implosion Compressor"); - GregTech_API.METATILEENTITIES[32765] = null; - GregTech_API.METATILEENTITIES[1001] = this; + super(1001, "multimachine.implosioncompressor", "Implosion Compressor"); } private TT_ImplosionCompressor(String aName) { super(aName); } - @Override - protected boolean cyclicUpdate_EM() { - return false; - } - private byte blocks = 0; private static final byte TEXTURE_INDEX = 16; @@ -92,17 +85,17 @@ public class TT_ImplosionCompressor extends GT_MetaTileEntity_MultiblockBase_EM ).addElement( 'V', ofChain( - ofHatchAdder( - TT_ImplosionCompressor::addImplosionHatches, - TEXTURE_INDEX, - 1 - ), onElementPass( x -> ++x.blocks, ofBlocksMap( BLOCKS.asMap(),GregTech_API.sBlockCasings2, 0 ) + ), + ofHatchAdder( + TT_ImplosionCompressor::addImplosionHatches, + TEXTURE_INDEX, + 1 ) ) ).build(); @@ -154,26 +147,25 @@ public class TT_ImplosionCompressor extends GT_MetaTileEntity_MultiblockBase_EM this.structureBuild_EM("main", 1,1,0, b, itemStack); } - @Override - public String[] getStructureDescription(ItemStack itemStack) { - return new String[0]; - } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new TT_ImplosionCompressor(this.mName); } + private static final int pollutionPerTick = 500; + + private final static String[] desc = new String[]{ + "Implosion Compressor", + "Explosions are fun", + "Controller block for the Implosion Compressor", + "Creates up to: " + 20 * pollutionPerTick + " Pollution per Second", + ADV_STR_CHECK, + TT_BLUEPRINT + }; + @Override public String[] getDescription() { - return new String[]{ - "Implosion Compressor", - "Explosions are fun", - "Controller block for the Implosion Compressor", - "Creates up to: " + 20 * getPollutionPerTick(null) + " Pollution per Second", - ADV_STR_CHECK, - TT_BLUEPRINT - }; + return desc; } @Override @@ -184,16 +176,6 @@ public class TT_ImplosionCompressor extends GT_MetaTileEntity_MultiblockBase_EM return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX]}; } - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png",false,false,true); - } - - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, false, false, true); - } - @Override public IStructureDefinition getStructure_EM() { return STRUCTURE_DEFINITION; @@ -248,23 +230,19 @@ public class TT_ImplosionCompressor extends GT_MetaTileEntity_MultiblockBase_EM } } - @Override - public int getMaxEfficiency(ItemStack aStack) { - return 10000; - } - @Override public int getPollutionPerTick(ItemStack aStack) { - return 500; + return pollutionPerTick; } - @Override - public int getDamageToComponent(ItemStack aStack) { - return 0; - } + private static final String[] sfStructureDescription = new String[] { + "0 - Air", + "Required: Muffler Hatch, Output Bus, Input Bus, Energy Hatch, Maintenance Hatch" + }; @Override - public boolean explodesOnComponentBreak(ItemStack aStack) { - return false; + public String[] getStructureDescription(ItemStack itemStack) { + return sfStructureDescription; } + } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java index 8ebe821e71..392b72a429 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java @@ -50,6 +50,8 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; import org.lwjgl.input.Keyboard; import java.util.ArrayList; @@ -57,23 +59,21 @@ import java.util.ArrayList; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; +import static gregtech.api.enums.GT_Values.VN; -public class TT_MultiSmelter extends GT_MetaTileEntity_MultiblockBase_EM implements IHasCoils, IConstructable { +public class TT_MultiSmelter extends TT_Abstract_GT_Replacement_Coils { private int mLevel; private int mCostDiscount; public TT_MultiSmelter(Object unused, Object unused2) { - super(32765, "multimachine.multifurnace", "Multi Smelter"); - GregTech_API.METATILEENTITIES[32765] = null; - GregTech_API.METATILEENTITIES[1003] = this; + super(1003, "multimachine.multifurnace", "Multi Smelter"); } private TT_MultiSmelter(String aName) { super(aName); } - private HeatingCoilLevel coilMeta = HeatingCoilLevel.None; private static final byte TEXTURE_INDEX = 11; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition .builder() @@ -101,39 +101,23 @@ public class TT_MultiSmelter extends GT_MetaTileEntity_MultiblockBase_EM impleme ).addElement( 'B', ofHatchAdderOptional( - TT_MultiSmelter::addHatchesBottom, TEXTURE_INDEX, + TT_MultiSmelter::addEBFInputsBottom, TEXTURE_INDEX, GregTech_API.sBlockCasings1, TEXTURE_INDEX, GregTech_API.sBlockCasings1, TEXTURE_INDEX ) ) .build(); - public final boolean addHatchesBottom(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) - return false; - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - else - return false; - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) - return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) - return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); - return false; + private static final String[] sfStructureDescription = new String[] { + "0 - Air", + "1 - Muffler", + "Required: Output Bus, Input Bus, Energy Hatch, Maintenance Hatch", + }; + + @Override + public String[] getStructureDescription(ItemStack itemStack) { + return sfStructureDescription; } @Override @@ -166,22 +150,21 @@ public class TT_MultiSmelter extends GT_MetaTileEntity_MultiblockBase_EM impleme this.structureBuild_EM("main", 1,2,0, b, itemStack); } - @Override - protected boolean cyclicUpdate_EM() { - return false; - } + private static final int pollutionPerTick = 20; + + private final static String[] desc = new String[]{ + "Furnace", + "Controller Block for the Multi Smelter", + "Smelts up to 8-128 items at once", + "Items smelted increases with coil tier", + "Creates up to: " + 20 * pollutionPerTick + " Pollution per Second", + ADV_STR_CHECK, + TT_BLUEPRINT + }; @Override public String[] getDescription() { - return new String[]{ - "Furnace", - "Controller Block for the Multi Smelter", - "Smelts up to 8-128 items at once", - "Items smelted increases with coil tier", - "Creates up to: " + 20 * getPollutionPerTick(null) + " Pollution per Second", - ADV_STR_CHECK, - TT_BLUEPRINT - }; + return desc; } @Override @@ -192,31 +175,6 @@ public class TT_MultiSmelter extends GT_MetaTileEntity_MultiblockBase_EM impleme return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][11]}; } - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png",false,false,true); - } - - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, false, false, true); - } - - @Override - public void setCoilHeat(HeatingCoilLevel coilMeta) { - this.coilMeta = coilMeta; - } - - @Override - public HeatingCoilLevel getCoilHeat() { - return coilMeta; - } - - @Override - public String[] getStructureDescription(ItemStack itemStack) { - return new String[0]; - } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new TT_MultiSmelter(this.mName); @@ -274,33 +232,45 @@ public class TT_MultiSmelter extends GT_MetaTileEntity_MultiblockBase_EM impleme return true; } - @Override - public boolean isMachineBlockUpdateRecursive() { - return true; - } - - @Override - public boolean isCorrectMachinePart(ItemStack aStack) { - return true; - } - - @Override - public int getMaxEfficiency(ItemStack aStack) { - return 10000; - } - @Override public int getPollutionPerTick(ItemStack aStack) { - return 20; + return pollutionPerTick; } @Override - public int getDamageToComponent(ItemStack aStack) { - return 0; - } + public String[] getInfoData() { + int mPollutionReduction=0; + for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) + if (isValidMetaTileEntity(tHatch)) + mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); + + long storedEnergy=0; + long maxEnergy=0; + for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) + if (isValidMetaTileEntity(tHatch)) { + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + } - @Override - public boolean explodesOnComponentBreak(ItemStack aStack) { - return false; + return new String[]{ + StatCollector.translateToLocal("GT5U.multiblock.Progress")+": "+ + EnumChatFormatting.GREEN + mProgresstime / 20 + EnumChatFormatting.RESET +" s / "+ + EnumChatFormatting.YELLOW + mMaxProgresstime / 20 + EnumChatFormatting.RESET +" s", + StatCollector.translateToLocal("GT5U.multiblock.energy")+": "+ + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET +" EU / "+ + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET +" EU", + StatCollector.translateToLocal("GT5U.multiblock.usage")+": "+ + EnumChatFormatting.RED + -mEUt + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei")+": "+ + EnumChatFormatting.YELLOW+ getMaxInputVoltage() +EnumChatFormatting.RESET+" EU/t(*2A) "+StatCollector.translateToLocal("GT5U.machines.tier")+": "+ + EnumChatFormatting.YELLOW+VN[GT_Utility.getTier(getMaxInputVoltage())]+ EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems")+": "+ + EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+ + " "+StatCollector.translateToLocal("GT5U.multiblock.efficiency")+": "+ + EnumChatFormatting.YELLOW+ mEfficiency / 100.0F +EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.MS.multismelting")+": "+ + EnumChatFormatting.GREEN+mLevel*8+EnumChatFormatting.RESET+" Discount: (EU/t) / "+EnumChatFormatting.GREEN+mCostDiscount+EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.pollution")+": "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" + }; } } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java index 3e5dcc5553..aef58cc590 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java @@ -59,87 +59,86 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_S import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; -public class TT_OilCrackingUnit extends GT_MetaTileEntity_MultiblockBase_EM implements IHasCoils, IConstructable { +public class TT_OilCrackingUnit extends TT_Abstract_GT_Replacement_Coils { public TT_OilCrackingUnit(Object unused, Object unused2) { - super(32765, "multimachine.cracker", "Oil Cracking Unit"); - GregTech_API.METATILEENTITIES[32765] = null; - GregTech_API.METATILEENTITIES[1160] = this; + super(1160, "multimachine.cracker", "Oil Cracking Unit"); } private TT_OilCrackingUnit(String aName) { super(aName); } - private HeatingCoilLevel coilMeta = HeatingCoilLevel.None; - - @Override - public void setCoilHeat(HeatingCoilLevel coilMeta) { - this.coilMeta = coilMeta; - } - - @Override - public HeatingCoilLevel getCoilHeat() { - return coilMeta; - } - private byte blocks = 0; private static final byte TEXTURE_INDEX = 49; - @Override - protected boolean cyclicUpdate_EM() { - return false; - } - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder().addShape("main", transpose(new String[][]{ {"ABABA","ABGBA","ABABA"}, {"AB~BA","E---F","ABABA"}, - {"ABCBA","ABABA","ABABA"} + {"ABABA","ABABA","ABABA"} }) ).addElement( 'A', - onElementPass( - x -> ++x.blocks,ofBlock( - GregTech_API.sBlockCasings4, - 1 + ofChain( + onElementPass( + x -> ++x.blocks, + ofBlock( + GregTech_API.sBlockCasings4, + 1 + ) + ), + ofHatchAdder( + TT_OilCrackingUnit::addClassicMaintenanceToMachineList, + TEXTURE_INDEX, + 1 + ), + ofHatchAdder( + TT_OilCrackingUnit::addEnergyIOToMachineList, + TEXTURE_INDEX, + 1 ) ) ).addElement( 'B', CoilAdder.getINSTANCE() - ).addElement( - 'C', - ofHatchAdder( - GT_MetaTileEntity_MultiblockBase_EM::addClassicMaintenanceToMachineList, - TEXTURE_INDEX, - 1 - ) ).addElement( 'E', ofHatchAdder( TT_OilCrackingUnit::addInputFluidHatch, TEXTURE_INDEX, - 2 + 1 ) ).addElement( 'F', ofHatchAdder( TT_OilCrackingUnit::addOutputFluidHatch, TEXTURE_INDEX, - 3 + 2 ) ).addElement( 'G', ofHatchAdder( TT_OilCrackingUnit::addMiddleFluidHatch, TEXTURE_INDEX, - 4 + 1 ) ).build(); - GT_MetaTileEntity_Hatch_Input middleFluidHatch; + private static final String[] sfStructureDescription = new String[] { + "0 - Air", + "1 - Input Hatch", + "2 - Output Hatch", + "Required: Maintenance Hatch, Energy Hatch" + }; + + @Override + public String[] getStructureDescription(ItemStack itemStack) { + return sfStructureDescription; + } + + private GT_MetaTileEntity_Hatch_Input middleFluidHatch; public final boolean addMiddleFluidHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) @@ -158,7 +157,7 @@ public class TT_OilCrackingUnit extends GT_MetaTileEntity_MultiblockBase_EM impl @Override protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - this.coilMeta = HeatingCoilLevel.None; + this.setCoilHeat(HeatingCoilLevel.None); this.blocks = 0; return this.structureCheck_EM("main", 2,1,0) && this.blocks >= 18; @@ -201,18 +200,20 @@ public class TT_OilCrackingUnit extends GT_MetaTileEntity_MultiblockBase_EM impl return new TT_OilCrackingUnit(this.mName); } + private final static String[] desc = new String[]{ + "Cracker", + "Controller block for the Oil Cracking Unit", + "Thermally cracks heavy hydrocarbons into lighter fractions", + "More efficient than the Chemical Reactor", + "Place the appropriate circuit in the controller", + "Gets 5% energy cost reduction per coil tier", + ADV_STR_CHECK, + TT_BLUEPRINT + }; + @Override public String[] getDescription() { - return new String[]{ - "Cracker", - "Controller block for the Oil Cracking Unit", - "Thermally cracks heavy hydrocarbons into lighter fractions", - "More efficient than the Chemical Reactor", - "Place the appropriate circuit in the controller", - "Gets 5% energy cost reduction per coil tier", - ADV_STR_CHECK, - TT_BLUEPRINT - }; + return desc; } @Override @@ -224,16 +225,6 @@ public class TT_OilCrackingUnit extends GT_MetaTileEntity_MultiblockBase_EM impl return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX]}; } - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png",false,false,true); - } - - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, false, false, true); - } - @Override public boolean checkRecipe_EM(ItemStack aStack) { ArrayList tInputList = getStoredFluids(); @@ -249,7 +240,7 @@ public class TT_OilCrackingUnit extends GT_MetaTileEntity_MultiblockBase_EM impl calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, getMaxInputVoltage()); if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; - this.mEUt *= Math.pow(0.95D, this.coilMeta.getTier()); + this.mEUt *= Math.pow(0.95D, this.getCoilHeat().getTier()); if (this.mEUt > 0) { this.mEUt = (-this.mEUt); @@ -262,36 +253,6 @@ public class TT_OilCrackingUnit extends GT_MetaTileEntity_MultiblockBase_EM impl return false; } - @Override - public boolean isMachineBlockUpdateRecursive() { - return true; - } - - @Override - public boolean isCorrectMachinePart(ItemStack aStack) { - return true; - } - - @Override - public int getMaxEfficiency(ItemStack aStack) { - return 10000; - } - - @Override - public int getPollutionPerTick(ItemStack aStack) { - return 0; - } - - @Override - public int getDamageToComponent(ItemStack aStack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack aStack) { - return false; - } - @Override public ArrayList getStoredFluids() { ArrayList rList = new ArrayList<>(); @@ -319,9 +280,4 @@ public class TT_OilCrackingUnit extends GT_MetaTileEntity_MultiblockBase_EM impl public void construct(ItemStack itemStack, boolean b) { this.structureBuild_EM("main", 2,1,0, b, itemStack); } - - @Override - public String[] getStructureDescription(ItemStack itemStack) { - return new String[0]; - } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java index 6b9eb89563..273ddc7efd 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java @@ -54,16 +54,9 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_S import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; -public class TT_VacuumFreezer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { +public class TT_VacuumFreezer extends TT_Abstract_GT_Replacement { public TT_VacuumFreezer(Object unused, Object unused2) { - super(32765, "multimachine.vacuumfreezer", "Vacuum Freezer"); - GregTech_API.METATILEENTITIES[32765] = null; - GregTech_API.METATILEENTITIES[1002] = this; - } - - @Override - protected boolean cyclicUpdate_EM() { - return false; + super(1002, "multimachine.vacuumfreezer", "Vacuum Freezer"); } private TT_VacuumFreezer(String aName) { @@ -80,17 +73,17 @@ public class TT_VacuumFreezer extends GT_MetaTileEntity_MultiblockBase_EM implem ).addElement( 'V', ofChain( - ofHatchAdder( - TT_VacuumFreezer::addVacuumFreezerHatches, - TEXTURE_INDEX, - 1 - ), onElementPass( x -> ++x.blocks, ofBlock( GregTech_API.sBlockCasings2, 1 ) + ), + ofHatchAdder( + TT_VacuumFreezer::addVacuumFreezerHatches, + TEXTURE_INDEX, + 1 ) ) ).build(); @@ -100,14 +93,26 @@ public class TT_VacuumFreezer extends GT_MetaTileEntity_MultiblockBase_EM implem return STRUCTURE_DEFINITION; } + private final static String[] desc = new String[]{ + "Vacuum Freezer", + "Controller Block for the Vacuum Freezer", + "Cools hot ingots and cells", + ADV_STR_CHECK, + TT_BLUEPRINT + }; + + private static final String[] sfStructureDescription = new String[] { + "0 - Air", + "Required: Output Bus, Input Bus, Energy Hatch, Maintenance Hatch" + }; + + @Override + public String[] getStructureDescription(ItemStack itemStack) { + return sfStructureDescription; + } + public String[] getDescription() { - return new String[]{ - "Vacuum Freezer", - "Controller Block for the Vacuum Freezer", - "Cools hot ingots and cells", - ADV_STR_CHECK, - TT_BLUEPRINT - }; + return desc; } @Override @@ -160,47 +165,11 @@ public class TT_VacuumFreezer extends GT_MetaTileEntity_MultiblockBase_EM implem return new TT_VacuumFreezer(this.mName); } - @Override - public boolean isMachineBlockUpdateRecursive() { - return true; - } - - public int getMaxEfficiency(ItemStack aStack) { - return 10000; - } - - public int getPollutionPerTick(ItemStack aStack) { - return 0; - } - - public int getDamageToComponent(ItemStack aStack) { - return 0; - } - - public boolean explodesOnComponentBreak(ItemStack aStack) { - return false; - } - @Override public void construct(ItemStack itemStack, boolean b) { this.structureBuild_EM("main", 1,1,0, b, itemStack); } - @Override - public String[] getStructureDescription(ItemStack itemStack) { - return new String[0]; - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png",false,false,true); - } - - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, false, false, true); - } - public final boolean addVacuumFreezerHatches(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity != null) { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); -- cgit From 7dcd26726b648841edb0043ef9416dad8a42d4df Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 4 Jan 2021 16:29:17 +0100 Subject: Fixes setBlock on adv. casings Former-commit-id: 96246274d309f0ec5d502d6dfce15d963ed1ff7c --- .../bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java index af87faf775..cfe8b2f28f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -135,8 +135,8 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple //Fucking Minecraft TE settings. } catch (InterruptedException ignored) {} Optional.ofNullable(world.getTileEntity(x,y,z)) - .filter(te -> te instanceof BW_MetaGeneratedBlocks_Casing_TE) - .map(te -> (BW_MetaGeneratedBlocks_Casing_TE) te) + .filter(te -> te instanceof BW_MetaGenerated_Block_TE) + .map(te -> (BW_MetaGenerated_Block_TE) te) .ifPresent(te -> te.mMetaData = (short) meta); } } \ No newline at end of file -- cgit From bfa9ed104cca51ecfdebd73cef4e911fdcf257e8 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 5 Jan 2021 22:56:10 +0100 Subject: Tanh speed improvement Former-commit-id: 5d34f0367047cc22a3d120711b23bd95c6b0b7d4 --- .../common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java | 4 ++-- .../java/com/github/bartimaeusnek/bartworks/util/MathUtils.java | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 40b6904c02..2f42348055 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -82,9 +82,9 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { else if (x == 61) ret = 4500; else if (x <= 100) - ret = MathUtils.ceilLong((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); + ret = MathUtils.ceilLong((8000F * MathUtils.tanh(-x / 20F) + 8000F) * 1000F); else - ret = MathUtils.ceilLong(((8000D * Math.tanh(-x / 65D) + 8000D))); + ret = MathUtils.ceilLong(((8000F * MathUtils.tanh(-x / 65F) + 8000F))); return ret;//*20; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java index 27b2d4cb27..0924d36f05 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.util; +import net.minecraft.util.MathHelper; + /* * Faster implementations for Math stuff */ @@ -123,4 +125,11 @@ public class MathUtils { public static float wrap(float input, float bound){ return (((input % bound)+bound) % bound); } + + public static float tanh(float x) { + float x2 = x * x; + float a = x * (135135.0f + x2 * (17325.0f + x2 * (378.0f + x2))); + float b = 135135.0f + x2 * (62370.0f + x2 * (3150.0f + x2 * 28.0f)); + return clamp(a / b, -1, 1); + } } -- cgit From aa72a003f730350172e60ec556e68ebc5de41fc1 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 11 Jan 2021 17:44:17 +0100 Subject: Several fixes Former-commit-id: 85ba0f632541272c8a3072747cb2a3a23d2821ce --- build.gradle.kts | 7 +++- gradle.properties | 2 +- .../system/material/BW_MetaGenerated_Blocks.java | 11 +++---- .../system/material/BW_MetaGenerated_Ores.java | 3 +- .../bartworks/system/oregen/BW_OreLayer.java | 16 ++++++--- .../bartimaeusnek/bartworks/util/BW_Util.java | 13 ++++++++ .../TT_Abstract_GT_Replacement_Coils.java | 2 ++ .../GT_Replacement/TT_ElectronicBlastFurnace.java | 38 ++++++++++++++-------- 8 files changed, 64 insertions(+), 28 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8d144993c0..94850e1f59 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -36,6 +36,7 @@ buildscript { plugins { idea java + id("org.ajoberstar.grgit") version("3.1.1") } apply(plugin = "forge") @@ -151,7 +152,7 @@ tasks.withType { // this will ensure that this task is redone when the versions change. this.inputs.properties += "version" to project.version this.inputs.properties += "mcversion" to project.minecraft.version - this.archiveBaseName.set("bartworks[${project.minecraft.version}]") + this.archiveBaseName.set("bartworks[${project.minecraft.version}]-[${getVersionAppendage()}]") // replace stuff in mcmod.info, nothing else this.filesMatching("/mcmod.info") { @@ -203,4 +204,8 @@ artifacts { this.archives(apiJar) this.archives(sourcesJar) this.archives(devJar) +} + +fun getVersionAppendage() : String { + return org.ajoberstar.grgit.Grgit.open(mapOf("currentDir" to project.rootDir)).log().last().abbreviatedId } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 761a0eae7a..79e967b70c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,7 +21,7 @@ # majorUpdate=0 minorUpdate=5 -buildNumber=14 +buildNumber=15 apiVersion=11 ic2Version=2.2.828-experimental applecoreVersion=1.7.10-3.1.1 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java index 0d6bfbc9d3..8a2143dba7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java @@ -22,9 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material; -import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.OrePrefixes; @@ -61,12 +61,9 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { @Override public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { super.onBlockAdded(aWorld, aX, aY, aZ); - try { - //TODO: Unsleep this, is here because TE isnt set yet. - Thread.sleep(1); - } catch (InterruptedException e) { - MainMod.LOGGER.catching(e); - } + //Waste some time to allow the TE to be set, do not use thread sleep here, it doesnt allow for nanoseconds. + //This will just waste a few cpu cycles to allow the TE to be set + BW_Util.shortSleep(0); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 37c1da6c8d..1f86b274af 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.system.material; +import com.github.bartimaeusnek.bartworks.util.MathUtils; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; @@ -56,7 +57,7 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, int[] aBlockMeta) { if (!air) { - aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); + aY = MathUtils.clamp(aY,1, aWorld.getActualHeight()); } Block tBlock = aWorld.getBlock(aX, aY, aZ); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java index 2a29fe2855..aa1023c9ba 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java @@ -145,25 +145,25 @@ public abstract class BW_OreLayer extends GT_Worldgen { int i; if (this.mSecondaryMeta > 0) { for (i = tMinY - 1; i < tMinY + 2; ++i) { - if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { + if (shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { wasPlaced = this.setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false); } } } - if (this.mBetweenMeta > 0 && (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) { + if (this.mBetweenMeta > 0 && shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { wasPlaced = this.setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); } if (this.mPrimaryMeta > 0) { for (i = tMinY + 3; i < tMinY + 6; ++i) { - if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) { + if (shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { wasPlaced = this.setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false); } } } - if (this.mSporadicMeta > 0 && (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 || aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0)) { + if (this.mSporadicMeta > 0 && (shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ))) { wasPlaced = this.setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); } } @@ -177,6 +177,14 @@ public abstract class BW_OreLayer extends GT_Worldgen { } } + private boolean shouldPlace(Random aRandom, int cX, int eX, int tX, int cZ, int eZ, int tZ) { + if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0) + return true; + if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) + return true; + return false; + } + public boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre) { //security stuff to prevent crashes with 2 TileEntites on the same Spot TileEntity te = aWorld.getTileEntity(aX,aY,aZ); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 21790bfe41..cc0c56214e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.MainMod; import gregtech.api.enums.Materials; import gregtech.api.enums.OreDictNames; import gregtech.api.enums.ToolDictNames; @@ -835,4 +836,16 @@ public class BW_Util { return new GT_Shaped_Recipe(GT_Utility.copy(aResult), aDismantleable, aRemovable, aKeepNBT, aEnchantmentsAdded, aEnchantmentLevelsAdded, aRecipe).setMirrored(aMirrored); } + public static void shortSleep(long nanos) { + try { + long start = System.nanoTime(); + long end; + do { + end = System.nanoTime(); + } while(start + nanos >= end); + } catch (Exception e) { + MainMod.LOGGER.catching(e); + } + } + } \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement_Coils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement_Coils.java index 868d432eb3..05f573b690 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement_Coils.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement_Coils.java @@ -4,6 +4,7 @@ import com.github.bartimaeusnek.crossmod.tectech.helper.IHasCoils; import gregtech.api.enums.HeatingCoilLevel; public abstract class TT_Abstract_GT_Replacement_Coils extends TT_Abstract_GT_Replacement implements IHasCoils { + protected TT_Abstract_GT_Replacement_Coils(int newId, String aName, String aNameRegional) { super(newId, aName, aNameRegional); } @@ -11,6 +12,7 @@ public abstract class TT_Abstract_GT_Replacement_Coils extends TT_Abstract_GT_Re protected TT_Abstract_GT_Replacement_Coils(String aName) { super(aName); } + protected HeatingCoilLevel heatingCoilLevel = HeatingCoilLevel.None; @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java index f2ee015f50..ad1932f3af 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java @@ -23,12 +23,8 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; -import com.github.bartimaeusnek.crossmod.tectech.helper.IHasCoils; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.structure.IStructureDefinition; import com.github.technus.tectech.mechanics.structure.StructureDefinition; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import com.google.common.collect.ImmutableSet; @@ -164,22 +160,36 @@ public class TT_ElectronicBlastFurnace extends TT_Abstract_GT_Replacement_Coils .findFirst() .map(tHatch -> 100 - tHatch.calculatePollutionReduction(100)) .orElse(0) + 5) / 100; + for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { + if ((isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) + ? !tHatch.outputsSteam() + : !tHatch.outputsLiquids()) + || tHatch.getBaseMetaTileEntity().getYCoord() <= this.getBaseMetaTileEntity().getYCoord() + || canNotFillOutput(tHatch, tLiquid)) + continue; + return true; + } + } else { + for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { + if ((isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) + ? !tHatch.outputsSteam() + : !tHatch.outputsLiquids()) + || tHatch.getBaseMetaTileEntity().getYCoord() > this.getBaseMetaTileEntity().getYCoord() + || canNotFillOutput(tHatch, tLiquid)) + continue; + return true; + } } + return false; + } - for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { - if ( - (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) - ? !tHatch.outputsSteam() - : !tHatch.outputsLiquids()) - || tHatch.getBaseMetaTileEntity().getYCoord() <= this.getBaseMetaTileEntity().getYCoord()) - continue; + private boolean canNotFillOutput(GT_MetaTileEntity_Hatch_Output tHatch, FluidStack tLiquid){ int tAmount = tHatch.fill(tLiquid, false); if (tAmount >= tLiquid.amount) - return tHatch.fill(tLiquid, true) >= tLiquid.amount; + return tHatch.fill(tLiquid, true) < tLiquid.amount; else if (tAmount > 0) tLiquid.amount = tLiquid.amount - tHatch.fill(tLiquid, true); - } - return false; + return true; } private static final int pollutionPerTick = 20; -- cgit From a0545850cc56aa6502644852d32028d3ace9c298 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 11 Jan 2021 18:37:23 +0100 Subject: Adds Input Filters to TT Multis Former-commit-id: b2f0937e7e1b34cae0c87271f2d1697c35b2afab --- .../GT_Replacement/TT_Abstract_GT_Replacement.java | 5 +++++ .../GT_Replacement/TT_ElectronicBlastFurnace.java | 6 ++++++ .../GT_Replacement/TT_ImplosionCompressor.java | 6 ++++++ .../multi/GT_Replacement/TT_MultiSmelter.java | 22 +++++++++------------- .../multi/GT_Replacement/TT_OilCrackingUnit.java | 10 ++++++++-- .../multi/GT_Replacement/TT_VacuumFreezer.java | 9 ++++++++- 6 files changed, 42 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java index 8486234619..53ffab396f 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java @@ -25,6 +25,11 @@ public abstract class TT_Abstract_GT_Replacement extends GT_MetaTileEntity_Multi super(aName); } + protected void setInputFilters() { + this.mInputBusses.forEach(x -> x.mRecipeMap = this.getRecipeMap()); + this.mInputHatches.forEach(x -> x.mRecipeMap = this.getRecipeMap()); + } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", ePowerPass,false,true); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java index ad1932f3af..202b5207be 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java @@ -122,9 +122,15 @@ public class TT_ElectronicBlastFurnace extends TT_Abstract_GT_Replacement_Coils this.mHeatingCapacity = (int) this.getCoilHeat().getHeat(); this.mHeatingCapacity += 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 2); + setInputFilters(); return ret; } + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sBlastRecipes; + } + @Override public void construct(ItemStack itemStack, boolean b) { this.structureBuild_EM("main", 1,3,0, b, itemStack); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java index ade1cca05a..3e614fb204 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java @@ -139,9 +139,15 @@ public class TT_ImplosionCompressor extends TT_Abstract_GT_Replacement { .noneMatch(x -> x == this.getExtendedFacing().getRelativeUpInWorld().ordinal())) return false; + setInputFilters(); return ret; } + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sImplosionRecipes; + } + @Override public void construct(ItemStack itemStack, boolean b) { this.structureBuild_EM("main", 1,1,0, b, itemStack); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java index 392b72a429..b542625787 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java @@ -22,37 +22,27 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; -import com.github.bartimaeusnek.crossmod.tectech.helper.IHasCoils; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.structure.IStructureDefinition; import com.github.technus.tectech.mechanics.structure.StructureDefinition; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import gregtech.api.GregTech_API; import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.Textures; -import gregtech.api.gui.GT_Container_MultiMachine; -import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.ITurnable; import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.*; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; -import org.lwjgl.input.Keyboard; import java.util.ArrayList; @@ -142,9 +132,15 @@ public class TT_MultiSmelter extends TT_Abstract_GT_Replacement_Coils { this.mLevel = this.getCoilHeat().getLevel(); this.mCostDiscount = this.getCoilHeat().getCostDiscount(); + setInputFilters(); return ret; } + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sFurnaceRecipes; + } + @Override public void construct(ItemStack itemStack, boolean b) { this.structureBuild_EM("main", 1,2,0, b, itemStack); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java index aef58cc590..fc37d7d2a2 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java @@ -159,8 +159,14 @@ public class TT_OilCrackingUnit extends TT_Abstract_GT_Replacement_Coils { protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { this.setCoilHeat(HeatingCoilLevel.None); this.blocks = 0; - return this.structureCheck_EM("main", 2,1,0) - && this.blocks >= 18; + boolean ret = this.structureCheck_EM("main", 2,1,0); + setInputFilters(); + return ret && this.blocks >= 18; + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sCrakingRecipes; } public final boolean addOutputFluidHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java index 273ddc7efd..16332b91ad 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java @@ -118,8 +118,15 @@ public class TT_VacuumFreezer extends TT_Abstract_GT_Replacement { @Override protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { this.blocks = 0; - return this.structureCheck_EM("main", 1,1,0) + boolean ret = this.structureCheck_EM("main", 1,1,0) && this.blocks >= 16; + setInputFilters(); + return ret; + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sVacuumRecipes; } @SideOnly(Side.CLIENT) -- cgit From 306d6a55f0f82732e19cd72a7e1570dda2cc7d29 Mon Sep 17 00:00:00 2001 From: basdxz Date: Mon, 25 Jan 2021 20:47:37 +0000 Subject: New Casing from EmeraldsEmerald (#123) Former-commit-id: c40a991698f54423fa2108f5c1086fdf2bcf1993 --- .../blocks/materialicons/DIAMOND/blockCasing.png | Bin 626 -> 703 bytes .../textures/blocks/materialicons/DULL/blockCasing.png | Bin 626 -> 703 bytes .../blocks/materialicons/EMERALD/blockCasing.png | Bin 626 -> 703 bytes .../textures/blocks/materialicons/FIERY/blockCasing.png | Bin 626 -> 703 bytes .../textures/blocks/materialicons/FINE/blockCasing.png | Bin 626 -> 703 bytes .../textures/blocks/materialicons/FLINT/blockCasing.png | Bin 626 -> 703 bytes .../textures/blocks/materialicons/FLUID/blockCasing.png | Bin 626 -> 703 bytes .../blocks/materialicons/GEM_HORIZONTAL/blockCasing.png | Bin 626 -> 703 bytes .../blocks/materialicons/GEM_VERTICAL/blockCasing.png | Bin 626 -> 703 bytes .../textures/blocks/materialicons/GLASS/blockCasing.png | Bin 626 -> 703 bytes .../textures/blocks/materialicons/LAPIS/blockCasing.png | Bin 626 -> 703 bytes .../textures/blocks/materialicons/LEAF/blockCasing.png | Bin 626 -> 703 bytes .../blocks/materialicons/LIGNITE/blockCasing.png | Bin 626 -> 703 bytes .../blocks/materialicons/MAGNETIC/blockCasing.png | Bin 626 -> 703 bytes .../blocks/materialicons/METALLIC/blockCasing.png | Bin 626 -> 703 bytes .../blocks/materialicons/NETHERSTAR/blockCasing.png | Bin 626 -> 703 bytes .../textures/blocks/materialicons/NONE/blockCasing.png | Bin 626 -> 703 bytes .../textures/blocks/materialicons/OPAL/blockCasing.png | Bin 626 -> 703 bytes .../textures/blocks/materialicons/PAPER/blockCasing.png | Bin 626 -> 703 bytes .../blocks/materialicons/POWDER/blockCasing.png | Bin 626 -> 703 bytes .../blocks/materialicons/QUARTZ/blockCasing.png | Bin 626 -> 703 bytes .../textures/blocks/materialicons/ROUGH/blockCasing.png | Bin 626 -> 703 bytes .../textures/blocks/materialicons/RUBY/blockCasing.png | Bin 626 -> 703 bytes .../textures/blocks/materialicons/SAND/blockCasing.png | Bin 626 -> 703 bytes .../blocks/materialicons/SHARDS/blockCasing.png | Bin 626 -> 703 bytes .../textures/blocks/materialicons/SHINY/blockCasing.png | Bin 626 -> 703 bytes .../textures/blocks/materialicons/WOOD/blockCasing.png | Bin 626 -> 703 bytes .../textures/blocks/materialicons/blockCasing.png | Bin 626 -> 703 bytes 28 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DIAMOND/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/DULL/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/EMERALD/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FIERY/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FINE/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLINT/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/FLUID/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_HORIZONTAL/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GEM_VERTICAL/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/GLASS/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LAPIS/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LEAF/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/LIGNITE/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/MAGNETIC/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/METALLIC/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NETHERSTAR/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/NONE/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/OPAL/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/PAPER/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/POWDER/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/QUARTZ/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/ROUGH/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/RUBY/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SAND/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHARDS/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/SHINY/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/WOOD/blockCasing.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/materialicons/blockCasing.png b/src/main/resources/assets/gregtech/textures/blocks/materialicons/blockCasing.png index cd6a50eca3..47a39e7526 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/materialicons/blockCasing.png and b/src/main/resources/assets/gregtech/textures/blocks/materialicons/blockCasing.png differ -- cgit From 4e033e51dae84574a06d504dc2e514dc0953df69 Mon Sep 17 00:00:00 2001 From: bartimaeusnek Date: Fri, 29 Jan 2021 10:59:27 +0100 Subject: Several fixes Former-commit-id: 1e2f441ebdf3d49591699ebc9444ae21195aa404 --- .../client/ClientEventHandler/TooltipEventHandler.java | 3 ++- .../bartworks/common/configs/ConfigHandler.java | 11 +++++++++-- .../tileentites/multi/GT_Replacement/TT_MultiSmelter.java | 8 +------- .../tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java | 12 +++++++++++- .../tiered/TT_MetaTileEntity_LowPowerLaserBox.java | 6 ++++++ 5 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java index d5875e4609..6c55b603e8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.client.ClientEventHandler; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; @@ -64,7 +65,7 @@ public class TooltipEventHandler { ItemStack tmp = event.itemStack.copy(); Pair abstractedStack = new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); List tooAdd = new ArrayList<>(); - if (OreDictHandler.getNonBWCache().contains(abstractedStack)) { + if (ConfigHandler.sharedItemStackTooltip && OreDictHandler.getNonBWCache().contains(abstractedStack)) { for (Pair pair : OreDictHandler.getNonBWCache()) { if (pair.equals(abstractedStack)) { GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index a6f781bf98..708815d5a9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.common.configs; import com.github.bartimaeusnek.ASM.BWCoreTransformer; import com.github.bartimaeusnek.bartworks.API.API_ConfigValues; +import com.github.bartimaeusnek.bartworks.API.SideReference; import net.minecraftforge.common.config.Configuration; import java.util.Arrays; @@ -64,6 +65,7 @@ public class ConfigHandler { public static boolean GTppLogDisabler; public static boolean tooltips = true; + public static boolean sharedItemStackTooltip = true; public static boolean[] enabledPatches; public static byte maxTierRoss; @@ -108,7 +110,12 @@ public class ConfigHandler { ConfigHandler.c = C; ConfigHandler.classicMode= ConfigHandler.c.get("System", "Enable Classic Mode", false, "Enables the classic Mode (all recipes in normal machines are doable in MV").getBoolean(false); ConfigHandler.creativeScannerID = ConfigHandler.c.get("System", "Creative Debug Scanner", 0, "ID for the Creative Debug Scanner Block").getInt(0); - ConfigHandler.tooltips = ConfigHandler.c.get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips").getBoolean(true); + + if (SideReference.Side.Client) { + ConfigHandler.tooltips = ConfigHandler.c.get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips").getBoolean(true); + ConfigHandler.sharedItemStackTooltip = ConfigHandler.c.get("System", "BartWorksSharedItemStackToolTips", true, "If you wish to enable \"Shared Item Stack\" tooltips").getBoolean(true); + } + ConfigHandler.IDOffset = ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600); ConfigHandler.ezmode = ConfigHandler.c.get("System", "Mode switch", false, "If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false); ConfigHandler.teslastaff = ConfigHandler.c.get("System", "Enable Teslastaff", false, "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); @@ -166,7 +173,7 @@ public class ConfigHandler { private static void setUpComments() { ConfigHandler.c.addCustomCategoryComment("ASM fixes", "Disable ASM fixes here."); ConfigHandler.c.addCustomCategoryComment("Singleblocks", "Singleblock Options can be set here."); - ConfigHandler.c.addCustomCategoryComment("Multiblocks", "Multliblock Options can be set here."); + ConfigHandler.c.addCustomCategoryComment("Multiblocks", "Multiblock Options can be set here."); ConfigHandler.c.addCustomCategoryComment("System", "Different System Settings can be set here."); ConfigHandler.c.addCustomCategoryComment("CrossMod Interactions", "CrossMod Interaction Settings can be set here. For Underground Fluid settings change the Gregtech.cfg!"); ConfigHandler.c.addCustomCategoryComment("Ross Ruin Metas", "Ruin Metas and Tiers can be set here."); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java index b542625787..f0345a3330 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java @@ -71,7 +71,7 @@ public class TT_MultiSmelter extends TT_Abstract_GT_Replacement_Coils { transpose(new String[][]{ {"AAA", "AMA", "AAA"}, {"CCC", "C-C", "CCC"}, - {"B~B", "BBB", "BBB"} + {"A~A", "AAA", "AAA"} }) ).addElement( 'C', @@ -84,12 +84,6 @@ public class TT_MultiSmelter extends TT_Abstract_GT_Replacement_Coils { ) ).addElement( 'A', - ofBlock( - GregTech_API.sBlockCasings1, TEXTURE_INDEX, - GregTech_API.sBlockCasings1, TEXTURE_INDEX - ) - ).addElement( - 'B', ofHatchAdderOptional( TT_MultiSmelter::addEBFInputsBottom, TEXTURE_INDEX, GregTech_API.sBlockCasings1, TEXTURE_INDEX, diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java index 1b82aedace..34473eab6c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java @@ -56,6 +56,7 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_ this.AMPERES = aAmperes; } + @Override public long getAMPERES() { return AMPERES; } @@ -85,7 +86,6 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_ return true; } - @Override public boolean isGivingInformation() { return true; @@ -120,6 +120,16 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_ return true; } + @Override + public boolean isEnetInput() { + return false; + } + + @Override + public boolean isEnetOutput() { + return false; + } + @Override public long maxEUInput() { return GT_Values.V[this.mTier]; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java index 7fe4d93a29..abecbe811f 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java @@ -54,26 +54,32 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase return false; } + @Override public long maxAmperesOut() { return !this.getBaseMetaTileEntity().isAllowedToWork() ? AMPERES : 0; } + @Override public long maxAmperesIn() { return this.getBaseMetaTileEntity().isAllowedToWork() ? AMPERES + (AMPERES / 4) : 0; } + @Override public boolean hasAlternativeModeText() { return true; } + @Override public String getAlternativeModeText() { return isReceiver() ? "Set to receiving mode" : "Set to sending mode"; } + @Override public boolean isEnetInput() { return this.getBaseMetaTileEntity().isAllowedToWork(); } + @Override public boolean isEnetOutput() { return !this.getBaseMetaTileEntity().isAllowedToWork(); } -- cgit From 49706a14ffa1cdca69450de454c19b64a8847981 Mon Sep 17 00:00:00 2001 From: bartimaeusnek Date: Fri, 29 Jan 2021 22:08:36 +0100 Subject: remove client only config due to ASM Space issues Former-commit-id: bffa6c0819a1f7d2a1f3f21e35a471222dbe5bee --- .../bartimaeusnek/bartworks/common/configs/ConfigHandler.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 708815d5a9..5833067110 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -111,10 +111,8 @@ public class ConfigHandler { ConfigHandler.classicMode= ConfigHandler.c.get("System", "Enable Classic Mode", false, "Enables the classic Mode (all recipes in normal machines are doable in MV").getBoolean(false); ConfigHandler.creativeScannerID = ConfigHandler.c.get("System", "Creative Debug Scanner", 0, "ID for the Creative Debug Scanner Block").getInt(0); - if (SideReference.Side.Client) { - ConfigHandler.tooltips = ConfigHandler.c.get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips").getBoolean(true); - ConfigHandler.sharedItemStackTooltip = ConfigHandler.c.get("System", "BartWorksSharedItemStackToolTips", true, "If you wish to enable \"Shared Item Stack\" tooltips").getBoolean(true); - } + ConfigHandler.tooltips = ConfigHandler.c.get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips").getBoolean(true); + ConfigHandler.sharedItemStackTooltip = ConfigHandler.c.get("System", "BartWorksSharedItemStackToolTips", true, "If you wish to enable \"Shared Item Stack\" tooltips").getBoolean(true); ConfigHandler.IDOffset = ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600); ConfigHandler.ezmode = ConfigHandler.c.get("System", "Mode switch", false, "If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false); -- cgit From ac2c6cae07830c6889346a67c40a66875f1ec382 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:25:09 +0100 Subject: SocketTime Out Travis Former-commit-id: f477bb94b9cac019019c3c5ac9dc8ef40b13409c --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7625510d22..9470b6a66f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ jobs: # secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" # script: "./gradlew sonarqube" - stage: buildAndDeploy - script: "./gradlew build" + script: "./gradlew build -Dorg.gradle.internal.http.socketTimeout=60000 -Dorg.gradle.internal.http.connectionTimeout=60000" deploy: provider: releases api_key: -- cgit From ad3fd0f41d0bbefb3393f4337dfa8a4fe1fbd3c0 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:25:35 +0100 Subject: Socket Time Out GitHub Actions Former-commit-id: f456602e56d75cc5f604177c47631452d2a4ee03 --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 58e1c59ce1..3af6a933ed 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -23,4 +23,4 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle - run: ./gradlew build + run: ./gradlew build -Dorg.gradle.internal.http.socketTimeout=60000 -Dorg.gradle.internal.http.connectionTimeout=60000 -- cgit From 6efb8e6f33c7f84078386b246a5a8e020771bccd Mon Sep 17 00:00:00 2001 From: bartimaeusnek Date: Sat, 30 Jan 2021 01:18:51 +0100 Subject: Added bot's range Former-commit-id: 6632f011207a113203cc67e7dda0345610e7bee7 --- .../bartimaeusnek/bartworks/system/material/WerkstoffLoader.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index c4dedef9d7..d63bff14dc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -191,9 +191,10 @@ public class WerkstoffLoader { } //TODO: - //FREE ID RANGE: 95-29_999 - //bartimaeusnek reserved 0-10_000 - //Tec & basdxz reserved range 30_000-31_000 + //FREE ID RANGE: 10_001-28_998 + //bartimaeusnek reserved 0-10_000 + //bot reserved range 29_899-29_999 + //Tec & basdxz reserved range 30_000-31_000 //GT Material range reserved on 31_767-32_767 public static final Werkstoff Bismutite = new Werkstoff( new short[]{255, 233, 0, 0}, -- cgit From d86495046d2106b5e5ab190e380a2f94156087de Mon Sep 17 00:00:00 2001 From: bartimaeusnek Date: Fri, 29 Jan 2021 18:17:43 +0100 Subject: lets see if this works (cherry picked from commit c525c3a6687832f4ba9c55e8978181ba723f2690) Former-commit-id: 9338510b88d9c3a97db7b4e59895fc1107e73b12 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 94850e1f59..ec0b80d9ae 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -117,7 +117,7 @@ dependencies { //hard deps compile("net.industrial-craft:industrialcraft-2:$ic2Version:dev") //jitpack - compile("com.github.GTNewHorizons:GT5-Unofficial:experimental-SNAPSHOT:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:appeng_transitivity-SNAPSHOT:dev") //soft deps compileOnly("com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf") compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") -- cgit From c40941421085d601357e596b1e6f0c4dae529e6a Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Fri, 18 Dec 2020 18:04:51 +0100 Subject: Update MainMod.java (cherry picked from commit c51b5fec03cb907f993609b984d346fad3e8a1c2) Former-commit-id: 298687a4c05df0f3436891fb1dcb1f153c2008e4 --- src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 6ba2dec96d..4723d9c6ac 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -109,8 +109,8 @@ public final class MainMod { LoaderReference.init(); //Check for ALL the mods. if (LoaderReference.miscutils) { - if (SideReference.Side.Client) - ClientGTppWarning(); + //if (SideReference.Side.Client) + //ClientGTppWarning(); MainMod.LOGGER.error("BartWorks was NOT meant to be played with GT++," + " since GT++'s Multiblocks break the Platinum Processing chain. " + @@ -234,4 +234,4 @@ public final class MainMod { GT_Recipe.GT_Recipe_Map.sMappings.forEach(GT_Recipe.GT_Recipe_Map::reInit); } -} \ No newline at end of file +} -- cgit From ea5026c2d72eaf1e4d8a9bf14ef05d81925e69f1 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 31 Jan 2021 15:55:21 +0100 Subject: Power pass upgrade (#125) * Implemented PowerPassUpgrade * Fixes setBlock on adv. casings * Configured code to use TecTech implementation of PowerPass Co-authored-by: bartimaeusnek Former-commit-id: 83f241cf2df25e5d53fbfd510c549732ec851815 --- build.gradle.kts | 16 +- ...-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id | 1 + ...ch-1.7.10-4.8.3-9b640643-dev.jar.REMOVED.git-id | 1 - .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 2 + .../multi/GT_Replacement/BW_TT_HeatExchanger.java | 9 +- .../GT_Replacement/TT_Abstract_GT_Replacement.java | 15 +- .../GT_Replacement/TT_ElectronicBlastFurnace.java | 76 +++---- .../GT_Replacement/TT_ImplosionCompressor.java | 116 +++++------ .../multi/GT_Replacement/TT_MultiSmelter.java | 23 +- .../multi/GT_Replacement/TT_OilCrackingUnit.java | 96 +++++---- .../multi/GT_Replacement/TT_PyrolyseOven.java | 232 +++++++++++++++++++++ .../multi/GT_Replacement/TT_VacuumFreezer.java | 80 ++++--- 12 files changed, 457 insertions(+), 210 deletions(-) create mode 100644 libs/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id delete mode 100644 libs/TecTech-1.7.10-4.8.3-9b640643-dev.jar.REMOVED.git-id create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java diff --git a/build.gradle.kts b/build.gradle.kts index 94850e1f59..5351995bcf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -52,6 +52,9 @@ java { this.sourceCompatibility = JavaVersion.VERSION_1_8 this.targetCompatibility = JavaVersion.VERSION_1_8 } +configurations.all { + resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS) +} tasks.withType { options.encoding = "UTF-8" @@ -104,6 +107,7 @@ repositories { 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("http://maven.tterrag.com") { this.name = "tterrag Repo" } maven("https://jitpack.io") } @@ -117,7 +121,9 @@ dependencies { //hard deps compile("net.industrial-craft:industrialcraft-2:$ic2Version:dev") //jitpack - compile("com.github.GTNewHorizons:GT5-Unofficial:experimental-SNAPSHOT:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:experimental-SNAPSHOT:dev") { + this.isChanging = true + } //soft deps compileOnly("com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf") compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") @@ -128,8 +134,12 @@ dependencies { compileOnly("li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api") compileOnly("net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev") //jitpack - compileOnly("com.github.GTNewHorizons:GalacticGregGT5:master-SNAPSHOT") - //compileOnly("com.github.Technus:TecTech:BassAddons-SNAPSHOT") + compileOnly("com.github.GTNewHorizons:GalacticGregGT5:master-SNAPSHOT") { + this.isChanging = true + } + //compileOnly("com.github.Technus:Tectech:master-SNAPSHOT") { + // this.isChanging = true + //} //Files compileOnly(fileTree("libs") { this.include("*.jar") }) diff --git a/libs/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id b/libs/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id new file mode 100644 index 0000000000..8f77b8280a --- /dev/null +++ b/libs/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id @@ -0,0 +1 @@ +dc6e19622ea5e9f310bca2ea25ad5f160dc21591 \ No newline at end of file diff --git a/libs/TecTech-1.7.10-4.8.3-9b640643-dev.jar.REMOVED.git-id b/libs/TecTech-1.7.10-4.8.3-9b640643-dev.jar.REMOVED.git-id deleted file mode 100644 index 46ee999944..0000000000 --- a/libs/TecTech-1.7.10-4.8.3-9b640643-dev.jar.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -3049f86f84ddb13398789bfb1e1360c492fc0b5a \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 228df30f2d..c5376dbf3b 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -83,6 +83,8 @@ public class BartWorksCrossmod { new TT_ImplosionCompressor(null,null); new TT_ElectronicBlastFurnace(null,null); new TT_MultiSmelter(null,null); + new TT_PyrolyseOven(null, null); + new BW_TT_HeatExchanger(null, null); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java index 9643bd942d..28592e7802 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java @@ -170,7 +170,9 @@ public class BW_TT_HeatExchanger extends TT_Abstract_GT_Replacement { private void checkRecipe_Additions(float efficiency){ Materials m = null; - if (last == null || !mInputHotFluidHatch.getFluid().isFluidEqual(last.getPlasma(1))) { + if (last != null && mInputHotFluidHatch.getFluid().isFluidEqual(last.getPlasma(1))) { + m = last; + } else { for (Materials materials : Materials.values()) { if (mInputHotFluidHatch.getFluid().isFluidEqual(materials.getPlasma(1))) { last = m = materials; @@ -183,8 +185,6 @@ public class BW_TT_HeatExchanger extends TT_Abstract_GT_Replacement { } } } - else - m = last; if (m == null) return; @@ -358,7 +358,8 @@ public class BW_TT_HeatExchanger extends TT_Abstract_GT_Replacement { "1 - Cold Fluid Output", "2 - Hot Fluid Input", "Needs an additional Output Hatch", - "Needs an additional Input Hatch" + "Needs an additional Input Hatch", + "20 Casings at least!" }; @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java index 53ffab396f..ad7915aff0 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java @@ -10,6 +10,7 @@ import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.*; +import gregtech.api.util.GT_Recipe; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -32,12 +33,12 @@ public abstract class TT_Abstract_GT_Replacement extends GT_MetaTileEntity_Multi @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", ePowerPass,false,true); + return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", this.ePowerPassCover, false, true); } @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, ePowerPass, false, true); + return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, this.ePowerPassCover, false, true); } @Override @@ -70,11 +71,11 @@ public abstract class TT_Abstract_GT_Replacement extends GT_MetaTileEntity_Multi return 0; } - private static final String[] sfStructureDescription = new String[] {"1 - Muffler"}; + protected void setEfficiencyAndOc(GT_Recipe gtRecipe) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; - @Override - public String[] getStructureDescription(ItemStack itemStack) { - return sfStructureDescription; + calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, getMaxInputVoltage()); } public final boolean addEBFInputsBottom(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { @@ -96,6 +97,8 @@ public abstract class TT_Abstract_GT_Replacement extends GT_MetaTileEntity_Multi return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) + return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java index 202b5207be..e4a2b0b300 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java @@ -236,38 +236,38 @@ public class TT_ElectronicBlastFurnace extends TT_Abstract_GT_Replacement_Coils ItemStack[] tInputs = this.getCompactedInputs(); FluidStack[] tFluids = this.getCompactedFluids(); - if (tInputs.length > 0) { - long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - if (tRecipe == null - || (this.mHeatingCapacity < tRecipe.mSpecialValue) - || (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) { - return false; - } - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - int tHeatCapacityDivTiers = ((this.mHeatingCapacity - tRecipe.mSpecialValue) / 900); - byte overclockCount = calculateOverclockednessEBF(tRecipe.mEUt, tRecipe.mDuration, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) - this.mEUt = (-this.mEUt); - - if (tHeatCapacityDivTiers > 0) { - this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); - this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount);//extra free overclocking if possible - if (this.mMaxProgresstime < 1) - this.mMaxProgresstime = 1;//no eu efficiency correction - } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; - this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; - updateSlots(); - return true; + if (tInputs.length <= 0) { + return false; } - return false; + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + if (tRecipe == null + || (this.mHeatingCapacity < tRecipe.mSpecialValue) + || (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) { + return false; + } + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + int tHeatCapacityDivTiers = ((this.mHeatingCapacity - tRecipe.mSpecialValue) / 900); + byte overclockCount = calculateOverclockednessEBF(tRecipe.mEUt, tRecipe.mDuration, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) + this.mEUt = (-this.mEUt); + + if (tHeatCapacityDivTiers > 0) { + this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); + this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount);//extra free overclocking if possible + if (this.mMaxProgresstime < 1) + this.mMaxProgresstime = 1;//no eu efficiency correction + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; + this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; + updateSlots(); + return true; } /** @@ -323,18 +323,18 @@ public class TT_ElectronicBlastFurnace extends TT_Abstract_GT_Replacement_Coils public String[] getInfoData() { int mPollutionReduction = 0; for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { - if (!isValidMetaTileEntity(tHatch)) - continue; - mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); + if (isValidMetaTileEntity(tHatch)) { + mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); + } } long storedEnergy = 0; long maxEnergy = 0; for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { - if (!isValidMetaTileEntity(tHatch)) - continue; - storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + if (isValidMetaTileEntity(tHatch)) { + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + } } return new String[]{ diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java index 3e614fb204..aec51a8d70 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java @@ -22,39 +22,30 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.crossmod.tectech.helper.StructureDefinitions; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.structure.IStructureDefinition; import com.github.technus.tectech.mechanics.structure.StructureDefinition; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import com.google.common.collect.ArrayListMultimap; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; -import gregtech.api.gui.GT_Container_MultiMachine; -import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.ITurnable; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.*; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; -import org.lwjgl.input.Keyboard; import java.util.List; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.*; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; public class TT_ImplosionCompressor extends TT_Abstract_GT_Replacement { @@ -101,28 +92,31 @@ public class TT_ImplosionCompressor extends TT_Abstract_GT_Replacement { ).build(); public final boolean addImplosionHatches(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity != null) { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - else - return false; - - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) - return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) - return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + if (aTileEntity == null) { + return false; } + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + else + return false; + + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) + return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) + return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) + return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) + return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) + return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) + return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) + return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) + return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); return false; } @@ -193,39 +187,38 @@ public class TT_ImplosionCompressor extends TT_Abstract_GT_Replacement { int tInputList_sS=tInputList.size(); for (int i = 0; i < tInputList_sS - 1; i++) { for (int j = i + 1; j < tInputList_sS; j++) { - if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { - if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { - tInputList.remove(j--); - tInputList_sS=tInputList.size(); - } else { - tInputList.remove(i--); - tInputList_sS=tInputList.size(); - break; - } + if (!GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { + continue; + } + if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { + tInputList.remove(j--); + tInputList_sS=tInputList.size(); + } else { + tInputList.remove(i--); + tInputList_sS=tInputList.size(); + break; } } } ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); - if (tInputList.size() > 0) { - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sImplosionRecipes.findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); - if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, null, tInputs))) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - //OC THAT EXPLOSIVE SHIT!!! - calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, getMaxInputVoltage()); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; - sendLoopStart(SOUND_INDEX); - updateSlots(); - return true; - } + if (tInputList.size() <= 0) { + return false; } - return false; + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sImplosionRecipes.findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); + if ((tRecipe == null) || (!tRecipe.isRecipeInputEqual(true, null, tInputs))) { + return false; + } + setEfficiencyAndOc(tRecipe); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; + sendLoopStart(SOUND_INDEX); + updateSlots(); + return true; } @Override @@ -243,7 +236,8 @@ public class TT_ImplosionCompressor extends TT_Abstract_GT_Replacement { private static final String[] sfStructureDescription = new String[] { "0 - Air", - "Required: Muffler Hatch, Output Bus, Input Bus, Energy Hatch, Maintenance Hatch" + "Required: Muffler Hatch, Output Bus, Input Bus, Energy Hatch, Maintenance Hatch", + "16 Casings at least!" }; @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java index f0345a3330..d38f1800ba 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java @@ -183,16 +183,19 @@ public class TT_MultiSmelter extends TT_Abstract_GT_Replacement_Coils { ItemStack tOutputStack = GT_ModHandler.getSmeltingOutput(tSmeltStack,false,null); if (tOutputStack == null) return false; - for (ItemStack item : tInputList) - if (tSmeltStack.isItemEqual(item)) - if (item.stackSize < (tMaxParrallel - tCurrenParrallel)) { - tCurrenParrallel += item.stackSize; - item.stackSize = 0; - } else { - item.stackSize = (tCurrenParrallel + item.stackSize) - tMaxParrallel; - tCurrenParrallel = tMaxParrallel; - break; - } + for (ItemStack item : tInputList) { + if (!tSmeltStack.isItemEqual(item)) { + continue; + } + if (item.stackSize < (tMaxParrallel - tCurrenParrallel)) { + tCurrenParrallel += item.stackSize; + item.stackSize = 0; + } else { + item.stackSize = (tCurrenParrallel + item.stackSize) - tMaxParrallel; + tCurrenParrallel = tMaxParrallel; + break; + } + } tCurrenParrallel *= tOutputStack.stackSize; this.mOutputItems = new ItemStack[(tCurrenParrallel/64)+1]; for (int i = 0; i < this.mOutputItems.length; i++) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java index fc37d7d2a2..8cdaaf581b 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java @@ -22,22 +22,14 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; -import com.github.bartimaeusnek.crossmod.tectech.helper.IHasCoils; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.structure.IStructureDefinition; import com.github.technus.tectech.mechanics.structure.StructureDefinition; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import gregtech.api.GregTech_API; import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; -import gregtech.api.gui.GT_Container_MultiMachine; -import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -45,13 +37,10 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import org.lwjgl.input.Keyboard; import java.util.ArrayList; @@ -75,9 +64,9 @@ public class TT_OilCrackingUnit extends TT_Abstract_GT_Replacement_Coils { private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder().addShape("main", transpose(new String[][]{ - {"ABABA","ABGBA","ABABA"}, - {"AB~BA","E---F","ABABA"}, - {"ABABA","ABABA","ABABA"} + {"ABGBA","ABGBA","ABGBA"}, + {"AB~BA","E---F","ABGBA"}, + {"ABGBA","ABGBA","ABGBA"} }) ).addElement( 'A', @@ -119,10 +108,29 @@ public class TT_OilCrackingUnit extends TT_Abstract_GT_Replacement_Coils { ) ).addElement( 'G', - ofHatchAdder( - TT_OilCrackingUnit::addMiddleFluidHatch, - TEXTURE_INDEX, - 1 + ofChain( + ofHatchAdder( + TT_OilCrackingUnit::addMiddleFluidHatch, + TEXTURE_INDEX, + 3), + onElementPass( + x -> ++x.blocks, + ofBlock( + GregTech_API.sBlockCasings4, + 1 + ) + ), + ofHatchAdder( + TT_OilCrackingUnit::addClassicMaintenanceToMachineList, + TEXTURE_INDEX, + 1 + ), + ofHatchAdder( + TT_OilCrackingUnit::addEnergyIOToMachineList, + TEXTURE_INDEX, + 1 + ) + ) ).build(); @@ -130,7 +138,9 @@ public class TT_OilCrackingUnit extends TT_Abstract_GT_Replacement_Coils { "0 - Air", "1 - Input Hatch", "2 - Output Hatch", - "Required: Maintenance Hatch, Energy Hatch" + "3 - 1x Input Hatch, rest Casings, Maintenance Hatch or Energy Hatch", + "Required: Maintenance Hatch, Energy Hatch, at Position 3 or instead of Casings", + "18 Casings at least!" }; @Override @@ -240,23 +250,21 @@ public class TT_OilCrackingUnit extends TT_Abstract_GT_Replacement_Coils { GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCrakingRecipes.findRecipe( getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluidInputs , mInventory[1]); - if (tRecipe != null && tRecipe.isRecipeInputEqual(true, tFluidInputs, mInventory[1])) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, getMaxInputVoltage()); - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - this.mEUt *= Math.pow(0.95D, this.getCoilHeat().getTier()); - - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } + if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, tFluidInputs, mInventory[1])) { + return false; + } + setEfficiencyAndOc(tRecipe); + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + this.mEUt *= Math.pow(0.95D, this.getCoilHeat().getTier()); - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; - return true; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); } - return false; + + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; + return true; } @Override @@ -265,19 +273,21 @@ public class TT_OilCrackingUnit extends TT_Abstract_GT_Replacement_Coils { for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) { tHatch.mRecipeMap = getRecipeMap(); - if (isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) { - FluidStack tStack = tHatch.getFillableStack(); - if (!tStack.isFluidEqual(GT_ModHandler.getSteam(1000)) && !tStack.isFluidEqual(Materials.Hydrogen.getGas(1000))) - rList.add(tStack); + if (!isValidMetaTileEntity(tHatch) || tHatch.getFillableStack() == null) { + continue; } + FluidStack tStack = tHatch.getFillableStack(); + if (!tStack.isFluidEqual(GT_ModHandler.getSteam(1000)) && !tStack.isFluidEqual(Materials.Hydrogen.getGas(1000))) + rList.add(tStack); } - if (this.middleFluidHatch != null && isValidMetaTileEntity(this.middleFluidHatch) && this.middleFluidHatch.getFillableStack() != null) { - this.middleFluidHatch.mRecipeMap = getRecipeMap(); - FluidStack tStack = this.middleFluidHatch.getFillableStack(); - if (tStack.isFluidEqual(GT_ModHandler.getSteam(1000)) || tStack.isFluidEqual(Materials.Hydrogen.getGas(1000))) - rList.add(tStack); + if (this.middleFluidHatch == null || !isValidMetaTileEntity(this.middleFluidHatch) || this.middleFluidHatch.getFillableStack() == null) { + return rList; } + this.middleFluidHatch.mRecipeMap = getRecipeMap(); + FluidStack tStack = this.middleFluidHatch.getFillableStack(); + if (tStack.isFluidEqual(GT_ModHandler.getSteam(1000)) || tStack.isFluidEqual(Materials.Hydrogen.getGas(1000))) + rList.add(tStack); return rList; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java new file mode 100644 index 0000000000..43ec2f0dde --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java @@ -0,0 +1,232 @@ +package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; + +import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; +import com.github.technus.tectech.mechanics.structure.IStructureDefinition; +import com.github.technus.tectech.mechanics.structure.StructureDefinition; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.enums.HeatingCoilLevel; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.loaders.oreprocessing.ProcessingLog; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; +import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; + +public class TT_PyrolyseOven extends TT_Abstract_GT_Replacement_Coils { + private static final int TEXTURE_INDEX = 1090; + private static final int pollutionPerTick = 30; + + public TT_PyrolyseOven(Object unused, Object unused2) { + super(1159, "multimachine.pyro", "Pyrolyse Oven"); + } + + public TT_PyrolyseOven(String aName) { + super(aName); + } + + private static final Block casingBlock; + private static final int casingMeta; + + private int blocks = 0; + + static { + if (Loader.isModLoaded("dreamcraft")) { + casingBlock = GameRegistry.findBlock("dreamcraft", "gt.blockcasingsNH"); + casingMeta = 2; + } else { + casingBlock = GregTech_API.sBlockCasings1; + casingMeta = 0; + } + } + + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape("main", + transpose(new String[][]{ + {"AAAAA", "ACCCA", "ACCCA", "ACCCA", "AAAAA"}, + {"AAAAA", "A---A", "A---A", "A---A", "AAAAA"}, + {"AAAAA", "A---A", "A---A", "A---A", "AAAAA"}, + {"BB~BB", "BDDDB", "BDDDB", "BDDDB", "BBBBB"} + }) + ).addElement( + 'D', + CoilAdder.getINSTANCE() + ).addElement( + 'A', + onElementPass(x -> x.blocks++, + ofBlock( + casingBlock, + casingMeta + ) + ) + ).addElement( + 'B', + ofChain( + ofHatchAdder( + TT_PyrolyseOven::addClassicOutputToMachineList, TEXTURE_INDEX, + 1 + ), + ofHatchAdder( + TT_PyrolyseOven::addEnergyIOToMachineList, TEXTURE_INDEX, + 1 + ), + ofHatchAdder( + TT_PyrolyseOven::addClassicMaintenanceToMachineList, TEXTURE_INDEX, + 1 + ), + onElementPass(x -> x.blocks++, + ofBlock( + casingBlock, + casingMeta + ) + ) + ) + + ).addElement( + 'C', + ofChain( + ofHint(2), + ofHatchAdder( + TT_PyrolyseOven::addClassicInputToMachineList, TEXTURE_INDEX, + 2 + ), + ofHatchAdder( + TT_PyrolyseOven::addClassicMufflerToMachineList, TEXTURE_INDEX, + 2 + ), + onElementPass(x -> x.blocks++, + ofBlock( + casingBlock, + casingMeta + ) + ) + ) + + ) + .build(); + + @Override + public IStructureDefinition getStructure_EM() { + return STRUCTURE_DEFINITION; + } + + @Override + protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + this.setCoilHeat(HeatingCoilLevel.None); + this.blocks = 0; + return this.structureCheck_EM("main", 2,3,0) && this.blocks >= 60; + } + + private static final String[] desc = new String[]{ + "Coke Oven", + "Controller block for the Pyrolyse Oven", + "Industrial Charcoal producer", + "Processing speed scales linearly with Coil tier:", + "CuNi: 50%, FeAlCr: 100%, Ni4Cr: 150%, Fe50CW: 200%, etc.", + "EU/t is not affected by Coil tier", + "Creates up to: " + 20 * pollutionPerTick + " Pollution per Second", + ADV_STR_CHECK, + TT_BLUEPRINT + }; + + @Override + public String[] getDescription() { + return desc; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.casingTexturePages[8][66], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN)}; + } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[8][66]}; + } + + @Override + public boolean checkRecipe_EM(ItemStack aStack) { + ItemStack[] tInputs = getCompactedInputs(); + FluidStack[] tFluids = getCompactedFluids(); + + if (tInputs.length <= 0) + return false; + + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + + //Dynamic recipe adding for newly found logWoods - wont be visible in nei most probably + if (tRecipe == null) + tRecipe = addRecipesDynamically(tInputs, tFluids, tTier); + + if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) + return false; + setEfficiencyAndOc(tRecipe); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) + this.mEUt = (-this.mEUt); + this.mMaxProgresstime = Math.max(mMaxProgresstime * 2 / (1 + this.heatingCoilLevel.getTier()), 1); + if (tRecipe.mOutputs.length > 0) + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; + if (tRecipe.mFluidOutputs.length > 0) + this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; + updateSlots(); + return true; + } + + private GT_Recipe addRecipesDynamically(ItemStack[] tInputs, FluidStack[] tFluids, int tTier) { + if (tInputs.length <= 1 && (tInputs[0] == null || tInputs[0].getItem() == GT_Utility.getIntegratedCircuit(0).getItem())) { + return null; + } + int oreId = OreDictionary.getOreID("logWood"); + for (ItemStack is : tInputs) { + for (int id : OreDictionary.getOreIDs(is)) { + if (oreId == id) { + ProcessingLog.addPyrolyeOvenRecipes(is); + return GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + } + } + } + return null; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new TT_PyrolyseOven(this.mName); + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return pollutionPerTick; + } + + private static final String[] sfStructureDescription = new String[] { + "0 - Air", + "1 - Output Hatch, Output Bus, Energy Hatch, Maintenance Hatch, Casing", + "2 - Input Hatch, Input Bus, Muffler Hatch, Casing", + "60 Casings at least!" + }; + + @Override + public String[] getStructureDescription(ItemStack itemStack) { + return sfStructureDescription; + } + + @Override + public void construct(ItemStack itemStack, boolean b) { + this.structureBuild_EM("main", 2,3,0, b, itemStack); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java index 16332b91ad..0b415a0d4c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java @@ -22,16 +22,11 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.crossmod.tectech.helper.StructureDefinitions; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.structure.IStructureDefinition; import com.github.technus.tectech.mechanics.structure.StructureDefinition; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -41,12 +36,9 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.*; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; -import org.lwjgl.input.Keyboard; import java.util.ArrayList; @@ -145,24 +137,23 @@ public class TT_VacuumFreezer extends TT_Abstract_GT_Replacement { byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, tInput); - if (tRecipe != null) { - if (tRecipe.isRecipeInputEqual(true, null, tInput)) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - - calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; - updateSlots(); - return true; - } + if (tRecipe == null) { + continue; } + if (!tRecipe.isRecipeInputEqual(true, null, tInput)) { + continue; + } + setEfficiencyAndOc(tRecipe); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; + updateSlots(); + return true; } return false; } @@ -178,26 +169,27 @@ public class TT_VacuumFreezer extends TT_Abstract_GT_Replacement { } public final boolean addVacuumFreezerHatches(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity != null) { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - else - return false; - - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) - return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) - return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); + if (aTileEntity == null) { + return false; } + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + else + return false; + + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) + return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) + return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) + return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) + return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) + return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) + return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); return false; } } -- cgit From 664c30141ffe3f4aff3b87d5119a82784f4eba29 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 31 Jan 2021 15:56:50 +0100 Subject: Power pass upgrade (#125) (#3) * Implemented PowerPassUpgrade * Fixes setBlock on adv. casings * Configured code to use TecTech implementation of PowerPass Co-authored-by: bartimaeusnek Former-commit-id: 55dfeccccee09f5a1dbfc75f58426c065d1e238e --- build.gradle.kts | 16 +- ...-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id | 1 + ...ch-1.7.10-4.8.3-9b640643-dev.jar.REMOVED.git-id | 1 - .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 2 + .../multi/GT_Replacement/BW_TT_HeatExchanger.java | 9 +- .../GT_Replacement/TT_Abstract_GT_Replacement.java | 15 +- .../GT_Replacement/TT_ElectronicBlastFurnace.java | 76 +++---- .../GT_Replacement/TT_ImplosionCompressor.java | 116 +++++------ .../multi/GT_Replacement/TT_MultiSmelter.java | 23 +- .../multi/GT_Replacement/TT_OilCrackingUnit.java | 96 +++++---- .../multi/GT_Replacement/TT_PyrolyseOven.java | 232 +++++++++++++++++++++ .../multi/GT_Replacement/TT_VacuumFreezer.java | 80 ++++--- 12 files changed, 457 insertions(+), 210 deletions(-) create mode 100644 libs/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id delete mode 100644 libs/TecTech-1.7.10-4.8.3-9b640643-dev.jar.REMOVED.git-id create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java diff --git a/build.gradle.kts b/build.gradle.kts index ec0b80d9ae..5351995bcf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -52,6 +52,9 @@ java { this.sourceCompatibility = JavaVersion.VERSION_1_8 this.targetCompatibility = JavaVersion.VERSION_1_8 } +configurations.all { + resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS) +} tasks.withType { options.encoding = "UTF-8" @@ -104,6 +107,7 @@ repositories { 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("http://maven.tterrag.com") { this.name = "tterrag Repo" } maven("https://jitpack.io") } @@ -117,7 +121,9 @@ dependencies { //hard deps compile("net.industrial-craft:industrialcraft-2:$ic2Version:dev") //jitpack - compile("com.github.GTNewHorizons:GT5-Unofficial:appeng_transitivity-SNAPSHOT:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:experimental-SNAPSHOT:dev") { + this.isChanging = true + } //soft deps compileOnly("com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf") compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") @@ -128,8 +134,12 @@ dependencies { compileOnly("li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api") compileOnly("net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev") //jitpack - compileOnly("com.github.GTNewHorizons:GalacticGregGT5:master-SNAPSHOT") - //compileOnly("com.github.Technus:TecTech:BassAddons-SNAPSHOT") + compileOnly("com.github.GTNewHorizons:GalacticGregGT5:master-SNAPSHOT") { + this.isChanging = true + } + //compileOnly("com.github.Technus:Tectech:master-SNAPSHOT") { + // this.isChanging = true + //} //Files compileOnly(fileTree("libs") { this.include("*.jar") }) diff --git a/libs/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id b/libs/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id new file mode 100644 index 0000000000..8f77b8280a --- /dev/null +++ b/libs/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id @@ -0,0 +1 @@ +dc6e19622ea5e9f310bca2ea25ad5f160dc21591 \ No newline at end of file diff --git a/libs/TecTech-1.7.10-4.8.3-9b640643-dev.jar.REMOVED.git-id b/libs/TecTech-1.7.10-4.8.3-9b640643-dev.jar.REMOVED.git-id deleted file mode 100644 index 46ee999944..0000000000 --- a/libs/TecTech-1.7.10-4.8.3-9b640643-dev.jar.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -3049f86f84ddb13398789bfb1e1360c492fc0b5a \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 228df30f2d..c5376dbf3b 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -83,6 +83,8 @@ public class BartWorksCrossmod { new TT_ImplosionCompressor(null,null); new TT_ElectronicBlastFurnace(null,null); new TT_MultiSmelter(null,null); + new TT_PyrolyseOven(null, null); + new BW_TT_HeatExchanger(null, null); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java index 9643bd942d..28592e7802 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java @@ -170,7 +170,9 @@ public class BW_TT_HeatExchanger extends TT_Abstract_GT_Replacement { private void checkRecipe_Additions(float efficiency){ Materials m = null; - if (last == null || !mInputHotFluidHatch.getFluid().isFluidEqual(last.getPlasma(1))) { + if (last != null && mInputHotFluidHatch.getFluid().isFluidEqual(last.getPlasma(1))) { + m = last; + } else { for (Materials materials : Materials.values()) { if (mInputHotFluidHatch.getFluid().isFluidEqual(materials.getPlasma(1))) { last = m = materials; @@ -183,8 +185,6 @@ public class BW_TT_HeatExchanger extends TT_Abstract_GT_Replacement { } } } - else - m = last; if (m == null) return; @@ -358,7 +358,8 @@ public class BW_TT_HeatExchanger extends TT_Abstract_GT_Replacement { "1 - Cold Fluid Output", "2 - Hot Fluid Input", "Needs an additional Output Hatch", - "Needs an additional Input Hatch" + "Needs an additional Input Hatch", + "20 Casings at least!" }; @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java index 53ffab396f..ad7915aff0 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java @@ -10,6 +10,7 @@ import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.*; +import gregtech.api.util.GT_Recipe; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -32,12 +33,12 @@ public abstract class TT_Abstract_GT_Replacement extends GT_MetaTileEntity_Multi @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", ePowerPass,false,true); + return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", this.ePowerPassCover, false, true); } @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, ePowerPass, false, true); + return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, this.ePowerPassCover, false, true); } @Override @@ -70,11 +71,11 @@ public abstract class TT_Abstract_GT_Replacement extends GT_MetaTileEntity_Multi return 0; } - private static final String[] sfStructureDescription = new String[] {"1 - Muffler"}; + protected void setEfficiencyAndOc(GT_Recipe gtRecipe) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; - @Override - public String[] getStructureDescription(ItemStack itemStack) { - return sfStructureDescription; + calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, getMaxInputVoltage()); } public final boolean addEBFInputsBottom(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { @@ -96,6 +97,8 @@ public abstract class TT_Abstract_GT_Replacement extends GT_MetaTileEntity_Multi return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) + return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java index 202b5207be..e4a2b0b300 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java @@ -236,38 +236,38 @@ public class TT_ElectronicBlastFurnace extends TT_Abstract_GT_Replacement_Coils ItemStack[] tInputs = this.getCompactedInputs(); FluidStack[] tFluids = this.getCompactedFluids(); - if (tInputs.length > 0) { - long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - if (tRecipe == null - || (this.mHeatingCapacity < tRecipe.mSpecialValue) - || (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) { - return false; - } - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - int tHeatCapacityDivTiers = ((this.mHeatingCapacity - tRecipe.mSpecialValue) / 900); - byte overclockCount = calculateOverclockednessEBF(tRecipe.mEUt, tRecipe.mDuration, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) - this.mEUt = (-this.mEUt); - - if (tHeatCapacityDivTiers > 0) { - this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); - this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount);//extra free overclocking if possible - if (this.mMaxProgresstime < 1) - this.mMaxProgresstime = 1;//no eu efficiency correction - } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; - this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; - updateSlots(); - return true; + if (tInputs.length <= 0) { + return false; } - return false; + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + if (tRecipe == null + || (this.mHeatingCapacity < tRecipe.mSpecialValue) + || (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) { + return false; + } + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + int tHeatCapacityDivTiers = ((this.mHeatingCapacity - tRecipe.mSpecialValue) / 900); + byte overclockCount = calculateOverclockednessEBF(tRecipe.mEUt, tRecipe.mDuration, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) + this.mEUt = (-this.mEUt); + + if (tHeatCapacityDivTiers > 0) { + this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); + this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount);//extra free overclocking if possible + if (this.mMaxProgresstime < 1) + this.mMaxProgresstime = 1;//no eu efficiency correction + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; + this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; + updateSlots(); + return true; } /** @@ -323,18 +323,18 @@ public class TT_ElectronicBlastFurnace extends TT_Abstract_GT_Replacement_Coils public String[] getInfoData() { int mPollutionReduction = 0; for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { - if (!isValidMetaTileEntity(tHatch)) - continue; - mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); + if (isValidMetaTileEntity(tHatch)) { + mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); + } } long storedEnergy = 0; long maxEnergy = 0; for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { - if (!isValidMetaTileEntity(tHatch)) - continue; - storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + if (isValidMetaTileEntity(tHatch)) { + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + } } return new String[]{ diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java index 3e614fb204..aec51a8d70 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java @@ -22,39 +22,30 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.crossmod.tectech.helper.StructureDefinitions; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.structure.IStructureDefinition; import com.github.technus.tectech.mechanics.structure.StructureDefinition; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import com.google.common.collect.ArrayListMultimap; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; -import gregtech.api.gui.GT_Container_MultiMachine; -import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.ITurnable; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.*; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; -import org.lwjgl.input.Keyboard; import java.util.List; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.*; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; public class TT_ImplosionCompressor extends TT_Abstract_GT_Replacement { @@ -101,28 +92,31 @@ public class TT_ImplosionCompressor extends TT_Abstract_GT_Replacement { ).build(); public final boolean addImplosionHatches(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity != null) { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - else - return false; - - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) - return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) - return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + if (aTileEntity == null) { + return false; } + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + else + return false; + + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) + return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) + return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) + return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) + return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) + return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) + return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) + return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) + return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); return false; } @@ -193,39 +187,38 @@ public class TT_ImplosionCompressor extends TT_Abstract_GT_Replacement { int tInputList_sS=tInputList.size(); for (int i = 0; i < tInputList_sS - 1; i++) { for (int j = i + 1; j < tInputList_sS; j++) { - if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { - if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { - tInputList.remove(j--); - tInputList_sS=tInputList.size(); - } else { - tInputList.remove(i--); - tInputList_sS=tInputList.size(); - break; - } + if (!GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { + continue; + } + if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { + tInputList.remove(j--); + tInputList_sS=tInputList.size(); + } else { + tInputList.remove(i--); + tInputList_sS=tInputList.size(); + break; } } } ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); - if (tInputList.size() > 0) { - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sImplosionRecipes.findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); - if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, null, tInputs))) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - //OC THAT EXPLOSIVE SHIT!!! - calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, getMaxInputVoltage()); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; - sendLoopStart(SOUND_INDEX); - updateSlots(); - return true; - } + if (tInputList.size() <= 0) { + return false; } - return false; + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sImplosionRecipes.findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); + if ((tRecipe == null) || (!tRecipe.isRecipeInputEqual(true, null, tInputs))) { + return false; + } + setEfficiencyAndOc(tRecipe); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; + sendLoopStart(SOUND_INDEX); + updateSlots(); + return true; } @Override @@ -243,7 +236,8 @@ public class TT_ImplosionCompressor extends TT_Abstract_GT_Replacement { private static final String[] sfStructureDescription = new String[] { "0 - Air", - "Required: Muffler Hatch, Output Bus, Input Bus, Energy Hatch, Maintenance Hatch" + "Required: Muffler Hatch, Output Bus, Input Bus, Energy Hatch, Maintenance Hatch", + "16 Casings at least!" }; @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java index f0345a3330..d38f1800ba 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java @@ -183,16 +183,19 @@ public class TT_MultiSmelter extends TT_Abstract_GT_Replacement_Coils { ItemStack tOutputStack = GT_ModHandler.getSmeltingOutput(tSmeltStack,false,null); if (tOutputStack == null) return false; - for (ItemStack item : tInputList) - if (tSmeltStack.isItemEqual(item)) - if (item.stackSize < (tMaxParrallel - tCurrenParrallel)) { - tCurrenParrallel += item.stackSize; - item.stackSize = 0; - } else { - item.stackSize = (tCurrenParrallel + item.stackSize) - tMaxParrallel; - tCurrenParrallel = tMaxParrallel; - break; - } + for (ItemStack item : tInputList) { + if (!tSmeltStack.isItemEqual(item)) { + continue; + } + if (item.stackSize < (tMaxParrallel - tCurrenParrallel)) { + tCurrenParrallel += item.stackSize; + item.stackSize = 0; + } else { + item.stackSize = (tCurrenParrallel + item.stackSize) - tMaxParrallel; + tCurrenParrallel = tMaxParrallel; + break; + } + } tCurrenParrallel *= tOutputStack.stackSize; this.mOutputItems = new ItemStack[(tCurrenParrallel/64)+1]; for (int i = 0; i < this.mOutputItems.length; i++) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java index fc37d7d2a2..8cdaaf581b 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java @@ -22,22 +22,14 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; -import com.github.bartimaeusnek.crossmod.tectech.helper.IHasCoils; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.structure.IStructureDefinition; import com.github.technus.tectech.mechanics.structure.StructureDefinition; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import gregtech.api.GregTech_API; import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; -import gregtech.api.gui.GT_Container_MultiMachine; -import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -45,13 +37,10 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import org.lwjgl.input.Keyboard; import java.util.ArrayList; @@ -75,9 +64,9 @@ public class TT_OilCrackingUnit extends TT_Abstract_GT_Replacement_Coils { private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder().addShape("main", transpose(new String[][]{ - {"ABABA","ABGBA","ABABA"}, - {"AB~BA","E---F","ABABA"}, - {"ABABA","ABABA","ABABA"} + {"ABGBA","ABGBA","ABGBA"}, + {"AB~BA","E---F","ABGBA"}, + {"ABGBA","ABGBA","ABGBA"} }) ).addElement( 'A', @@ -119,10 +108,29 @@ public class TT_OilCrackingUnit extends TT_Abstract_GT_Replacement_Coils { ) ).addElement( 'G', - ofHatchAdder( - TT_OilCrackingUnit::addMiddleFluidHatch, - TEXTURE_INDEX, - 1 + ofChain( + ofHatchAdder( + TT_OilCrackingUnit::addMiddleFluidHatch, + TEXTURE_INDEX, + 3), + onElementPass( + x -> ++x.blocks, + ofBlock( + GregTech_API.sBlockCasings4, + 1 + ) + ), + ofHatchAdder( + TT_OilCrackingUnit::addClassicMaintenanceToMachineList, + TEXTURE_INDEX, + 1 + ), + ofHatchAdder( + TT_OilCrackingUnit::addEnergyIOToMachineList, + TEXTURE_INDEX, + 1 + ) + ) ).build(); @@ -130,7 +138,9 @@ public class TT_OilCrackingUnit extends TT_Abstract_GT_Replacement_Coils { "0 - Air", "1 - Input Hatch", "2 - Output Hatch", - "Required: Maintenance Hatch, Energy Hatch" + "3 - 1x Input Hatch, rest Casings, Maintenance Hatch or Energy Hatch", + "Required: Maintenance Hatch, Energy Hatch, at Position 3 or instead of Casings", + "18 Casings at least!" }; @Override @@ -240,23 +250,21 @@ public class TT_OilCrackingUnit extends TT_Abstract_GT_Replacement_Coils { GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCrakingRecipes.findRecipe( getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluidInputs , mInventory[1]); - if (tRecipe != null && tRecipe.isRecipeInputEqual(true, tFluidInputs, mInventory[1])) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, getMaxInputVoltage()); - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - this.mEUt *= Math.pow(0.95D, this.getCoilHeat().getTier()); - - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } + if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, tFluidInputs, mInventory[1])) { + return false; + } + setEfficiencyAndOc(tRecipe); + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + this.mEUt *= Math.pow(0.95D, this.getCoilHeat().getTier()); - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; - return true; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); } - return false; + + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; + return true; } @Override @@ -265,19 +273,21 @@ public class TT_OilCrackingUnit extends TT_Abstract_GT_Replacement_Coils { for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) { tHatch.mRecipeMap = getRecipeMap(); - if (isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) { - FluidStack tStack = tHatch.getFillableStack(); - if (!tStack.isFluidEqual(GT_ModHandler.getSteam(1000)) && !tStack.isFluidEqual(Materials.Hydrogen.getGas(1000))) - rList.add(tStack); + if (!isValidMetaTileEntity(tHatch) || tHatch.getFillableStack() == null) { + continue; } + FluidStack tStack = tHatch.getFillableStack(); + if (!tStack.isFluidEqual(GT_ModHandler.getSteam(1000)) && !tStack.isFluidEqual(Materials.Hydrogen.getGas(1000))) + rList.add(tStack); } - if (this.middleFluidHatch != null && isValidMetaTileEntity(this.middleFluidHatch) && this.middleFluidHatch.getFillableStack() != null) { - this.middleFluidHatch.mRecipeMap = getRecipeMap(); - FluidStack tStack = this.middleFluidHatch.getFillableStack(); - if (tStack.isFluidEqual(GT_ModHandler.getSteam(1000)) || tStack.isFluidEqual(Materials.Hydrogen.getGas(1000))) - rList.add(tStack); + if (this.middleFluidHatch == null || !isValidMetaTileEntity(this.middleFluidHatch) || this.middleFluidHatch.getFillableStack() == null) { + return rList; } + this.middleFluidHatch.mRecipeMap = getRecipeMap(); + FluidStack tStack = this.middleFluidHatch.getFillableStack(); + if (tStack.isFluidEqual(GT_ModHandler.getSteam(1000)) || tStack.isFluidEqual(Materials.Hydrogen.getGas(1000))) + rList.add(tStack); return rList; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java new file mode 100644 index 0000000000..43ec2f0dde --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java @@ -0,0 +1,232 @@ +package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; + +import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; +import com.github.technus.tectech.mechanics.structure.IStructureDefinition; +import com.github.technus.tectech.mechanics.structure.StructureDefinition; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.enums.HeatingCoilLevel; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.loaders.oreprocessing.ProcessingLog; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; +import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; + +public class TT_PyrolyseOven extends TT_Abstract_GT_Replacement_Coils { + private static final int TEXTURE_INDEX = 1090; + private static final int pollutionPerTick = 30; + + public TT_PyrolyseOven(Object unused, Object unused2) { + super(1159, "multimachine.pyro", "Pyrolyse Oven"); + } + + public TT_PyrolyseOven(String aName) { + super(aName); + } + + private static final Block casingBlock; + private static final int casingMeta; + + private int blocks = 0; + + static { + if (Loader.isModLoaded("dreamcraft")) { + casingBlock = GameRegistry.findBlock("dreamcraft", "gt.blockcasingsNH"); + casingMeta = 2; + } else { + casingBlock = GregTech_API.sBlockCasings1; + casingMeta = 0; + } + } + + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape("main", + transpose(new String[][]{ + {"AAAAA", "ACCCA", "ACCCA", "ACCCA", "AAAAA"}, + {"AAAAA", "A---A", "A---A", "A---A", "AAAAA"}, + {"AAAAA", "A---A", "A---A", "A---A", "AAAAA"}, + {"BB~BB", "BDDDB", "BDDDB", "BDDDB", "BBBBB"} + }) + ).addElement( + 'D', + CoilAdder.getINSTANCE() + ).addElement( + 'A', + onElementPass(x -> x.blocks++, + ofBlock( + casingBlock, + casingMeta + ) + ) + ).addElement( + 'B', + ofChain( + ofHatchAdder( + TT_PyrolyseOven::addClassicOutputToMachineList, TEXTURE_INDEX, + 1 + ), + ofHatchAdder( + TT_PyrolyseOven::addEnergyIOToMachineList, TEXTURE_INDEX, + 1 + ), + ofHatchAdder( + TT_PyrolyseOven::addClassicMaintenanceToMachineList, TEXTURE_INDEX, + 1 + ), + onElementPass(x -> x.blocks++, + ofBlock( + casingBlock, + casingMeta + ) + ) + ) + + ).addElement( + 'C', + ofChain( + ofHint(2), + ofHatchAdder( + TT_PyrolyseOven::addClassicInputToMachineList, TEXTURE_INDEX, + 2 + ), + ofHatchAdder( + TT_PyrolyseOven::addClassicMufflerToMachineList, TEXTURE_INDEX, + 2 + ), + onElementPass(x -> x.blocks++, + ofBlock( + casingBlock, + casingMeta + ) + ) + ) + + ) + .build(); + + @Override + public IStructureDefinition getStructure_EM() { + return STRUCTURE_DEFINITION; + } + + @Override + protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + this.setCoilHeat(HeatingCoilLevel.None); + this.blocks = 0; + return this.structureCheck_EM("main", 2,3,0) && this.blocks >= 60; + } + + private static final String[] desc = new String[]{ + "Coke Oven", + "Controller block for the Pyrolyse Oven", + "Industrial Charcoal producer", + "Processing speed scales linearly with Coil tier:", + "CuNi: 50%, FeAlCr: 100%, Ni4Cr: 150%, Fe50CW: 200%, etc.", + "EU/t is not affected by Coil tier", + "Creates up to: " + 20 * pollutionPerTick + " Pollution per Second", + ADV_STR_CHECK, + TT_BLUEPRINT + }; + + @Override + public String[] getDescription() { + return desc; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.casingTexturePages[8][66], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN)}; + } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[8][66]}; + } + + @Override + public boolean checkRecipe_EM(ItemStack aStack) { + ItemStack[] tInputs = getCompactedInputs(); + FluidStack[] tFluids = getCompactedFluids(); + + if (tInputs.length <= 0) + return false; + + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + + //Dynamic recipe adding for newly found logWoods - wont be visible in nei most probably + if (tRecipe == null) + tRecipe = addRecipesDynamically(tInputs, tFluids, tTier); + + if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) + return false; + setEfficiencyAndOc(tRecipe); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) + this.mEUt = (-this.mEUt); + this.mMaxProgresstime = Math.max(mMaxProgresstime * 2 / (1 + this.heatingCoilLevel.getTier()), 1); + if (tRecipe.mOutputs.length > 0) + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; + if (tRecipe.mFluidOutputs.length > 0) + this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; + updateSlots(); + return true; + } + + private GT_Recipe addRecipesDynamically(ItemStack[] tInputs, FluidStack[] tFluids, int tTier) { + if (tInputs.length <= 1 && (tInputs[0] == null || tInputs[0].getItem() == GT_Utility.getIntegratedCircuit(0).getItem())) { + return null; + } + int oreId = OreDictionary.getOreID("logWood"); + for (ItemStack is : tInputs) { + for (int id : OreDictionary.getOreIDs(is)) { + if (oreId == id) { + ProcessingLog.addPyrolyeOvenRecipes(is); + return GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + } + } + } + return null; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new TT_PyrolyseOven(this.mName); + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return pollutionPerTick; + } + + private static final String[] sfStructureDescription = new String[] { + "0 - Air", + "1 - Output Hatch, Output Bus, Energy Hatch, Maintenance Hatch, Casing", + "2 - Input Hatch, Input Bus, Muffler Hatch, Casing", + "60 Casings at least!" + }; + + @Override + public String[] getStructureDescription(ItemStack itemStack) { + return sfStructureDescription; + } + + @Override + public void construct(ItemStack itemStack, boolean b) { + this.structureBuild_EM("main", 2,3,0, b, itemStack); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java index 16332b91ad..0b415a0d4c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java @@ -22,16 +22,11 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.crossmod.tectech.helper.StructureDefinitions; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.structure.IStructureDefinition; import com.github.technus.tectech.mechanics.structure.StructureDefinition; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -41,12 +36,9 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.*; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; -import org.lwjgl.input.Keyboard; import java.util.ArrayList; @@ -145,24 +137,23 @@ public class TT_VacuumFreezer extends TT_Abstract_GT_Replacement { byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, tInput); - if (tRecipe != null) { - if (tRecipe.isRecipeInputEqual(true, null, tInput)) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - - calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; - updateSlots(); - return true; - } + if (tRecipe == null) { + continue; } + if (!tRecipe.isRecipeInputEqual(true, null, tInput)) { + continue; + } + setEfficiencyAndOc(tRecipe); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; + updateSlots(); + return true; } return false; } @@ -178,26 +169,27 @@ public class TT_VacuumFreezer extends TT_Abstract_GT_Replacement { } public final boolean addVacuumFreezerHatches(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity != null) { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - else - return false; - - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) - return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) - return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); + if (aTileEntity == null) { + return false; } + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + else + return false; + + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) + return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) + return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) + return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) + return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) + return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) + return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); return false; } } -- cgit From 71ca4d87e7d3cd8f73867279f277bc6347a051bd Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sun, 31 Jan 2021 15:57:44 +0100 Subject: Re-Enable Client Side Warning Former-commit-id: 36c63f5303a90109eca61e7c07a09ae91336c228 --- src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 4723d9c6ac..a2fbc8cfff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -109,8 +109,8 @@ public final class MainMod { LoaderReference.init(); //Check for ALL the mods. if (LoaderReference.miscutils) { - //if (SideReference.Side.Client) - //ClientGTppWarning(); + if (SideReference.Side.Client) + ClientGTppWarning(); MainMod.LOGGER.error("BartWorks was NOT meant to be played with GT++," + " since GT++'s Multiblocks break the Platinum Processing chain. " + -- cgit From de9fd64d6e52764f74eddd3252274e41f83b8db9 Mon Sep 17 00:00:00 2001 From: korneel vandamme Date: Sun, 7 Feb 2021 21:07:58 +0100 Subject: unbreak cracker structure Former-commit-id: 28a1120c32e960ab8ba0b7aa5b239f3a246234bf --- .../multi/GT_Replacement/TT_OilCrackingUnit.java | 59 ++++++++++++++++++---- 1 file changed, 48 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java index 8cdaaf581b..efc83cca44 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java @@ -64,9 +64,9 @@ public class TT_OilCrackingUnit extends TT_Abstract_GT_Replacement_Coils { private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder().addShape("main", transpose(new String[][]{ - {"ABGBA","ABGBA","ABGBA"}, - {"AB~BA","E---F","ABGBA"}, - {"ABGBA","ABGBA","ABGBA"} + {"EBGBF","EBGBF","EBGBF"}, + {"EB~BF","E---F","EBGBF"}, + {"EBGBF","EBGBF","EBGBF"} }) ).addElement( 'A', @@ -94,17 +94,54 @@ public class TT_OilCrackingUnit extends TT_Abstract_GT_Replacement_Coils { CoilAdder.getINSTANCE() ).addElement( 'E', - ofHatchAdder( - TT_OilCrackingUnit::addInputFluidHatch, - TEXTURE_INDEX, - 1 + ofChain( + ofHatchAdder( + TT_OilCrackingUnit::addInputFluidHatch, + TEXTURE_INDEX, + 1), + onElementPass( + x -> ++x.blocks, + ofBlock( + GregTech_API.sBlockCasings4, + 1 + ) + ), + ofHatchAdder( + TT_OilCrackingUnit::addClassicMaintenanceToMachineList, + TEXTURE_INDEX, + 1 + ), + ofHatchAdder( + TT_OilCrackingUnit::addEnergyIOToMachineList, + TEXTURE_INDEX, + 1 + ) ) ).addElement( 'F', - ofHatchAdder( - TT_OilCrackingUnit::addOutputFluidHatch, - TEXTURE_INDEX, - 2 + ofChain( + ofHatchAdder( + TT_OilCrackingUnit::addOutputFluidHatch, + TEXTURE_INDEX, + 2), + onElementPass( + x -> ++x.blocks, + ofBlock( + GregTech_API.sBlockCasings4, + 1 + ) + ), + ofHatchAdder( + TT_OilCrackingUnit::addClassicMaintenanceToMachineList, + TEXTURE_INDEX, + 1 + ), + ofHatchAdder( + TT_OilCrackingUnit::addEnergyIOToMachineList, + TEXTURE_INDEX, + 1 + ) + ) ).addElement( 'G', -- cgit From a7c1011dc3ae4e017fa5480d8378cc3f7b911c60 Mon Sep 17 00:00:00 2001 From: korneel vandamme Date: Sun, 7 Feb 2021 21:13:56 +0100 Subject: remove unsused letter Former-commit-id: 384eb59a47bd0130787e84501428d745008846c5 --- .../multi/GT_Replacement/TT_OilCrackingUnit.java | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java index efc83cca44..1fad81adde 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java @@ -68,27 +68,6 @@ public class TT_OilCrackingUnit extends TT_Abstract_GT_Replacement_Coils { {"EB~BF","E---F","EBGBF"}, {"EBGBF","EBGBF","EBGBF"} }) - ).addElement( - 'A', - ofChain( - onElementPass( - x -> ++x.blocks, - ofBlock( - GregTech_API.sBlockCasings4, - 1 - ) - ), - ofHatchAdder( - TT_OilCrackingUnit::addClassicMaintenanceToMachineList, - TEXTURE_INDEX, - 1 - ), - ofHatchAdder( - TT_OilCrackingUnit::addEnergyIOToMachineList, - TEXTURE_INDEX, - 1 - ) - ) ).addElement( 'B', CoilAdder.getINSTANCE() -- cgit From a1a58ec3fdee1baf970506adeeb47fc351f2904b Mon Sep 17 00:00:00 2001 From: bartimaeusnek Date: Fri, 12 Feb 2021 11:33:59 +0100 Subject: Molten Recipe Changes and Refactor Former-commit-id: 7c1fecc118ba299bd1481a32d2fd648ff0bf6ca8 --- .../werkstoff_loaders/recipe/MoltenCellLoader.java | 57 ++++++++++++---------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java index 68cca299c2..295bfd144c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -46,6 +46,31 @@ public class MoltenCellLoader implements IWerkstoffRunnable { if (!werkstoff.hasItemType(WerkstoffLoader.cellMolten)) return; + if (!werkstoff.hasItemType(ingot)) { + if (!werkstoff.hasItemType(dust)) + return; + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall), null, werkstoff.getMolten(36), 0, (int) ((double) werkstoff.getStats().getMass() / 4D), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny), null, werkstoff.getMolten(16), 0, (int) ((double) werkstoff.getStats().getMass() / 9D), werkstoff.getStats().getMass() > 128 ? 64 : 30); + } else { + + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget), null, werkstoff.getMolten(16), 0, (int) ((double) werkstoff.getStats().getMass() / 9D), werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), (int) ((double) werkstoff.getStats().getMass() / 9D), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(1296), werkstoff.get(block), (int) werkstoff.getStats().getMass() * 9, werkstoff.getStats().getMass() > 128 ? 64 : 30); + + if (!werkstoff.hasItemType(plate)) + return; + + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick), null, werkstoff.getMolten(72), 0, (int) ((double) werkstoff.getStats().getMass() / 2D), werkstoff.getStats().getMass() > 128 ? 64 : 30); + } + //Tank "Recipe" final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(cell), Materials.Empty.getCells(1)); @@ -53,32 +78,12 @@ public class MoltenCellLoader implements IWerkstoffRunnable { GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(WerkstoffLoader.cellMolten), new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), GT_Values.NF); GT_Values.RA.addFluidCannerRecipe(werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); - if (LoaderReference.Forestry) { - final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); - FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); - GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsuleMolten), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); - } - - if (werkstoff.hasItemType(ingot)) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - if (werkstoff.hasItemType(plate)) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick), null, werkstoff.getMolten(72), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - } - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget), null, werkstoff.getMolten(16), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + if (!LoaderReference.Forestry) + return; - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(1296), werkstoff.get(block), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - } else { - if (werkstoff.hasItemType(dust)) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall), null, werkstoff.getMolten(36), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny), null, werkstoff.getMolten(16), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - } - } + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + GT_Utility.addFluidContainerData(emptyData); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsuleMolten), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); } } \ No newline at end of file -- cgit From 96a015594c35f82804d996f1b52e07830348754a Mon Sep 17 00:00:00 2001 From: bartimaeusnek Date: Fri, 12 Feb 2021 11:33:59 +0100 Subject: Molten Recipe Changes and Refactor (cherry picked from commit a1a58ec3fdee1baf970506adeeb47fc351f2904b [formerly 7c1fecc118ba299bd1481a32d2fd648ff0bf6ca8]) Former-commit-id: 740d4b1f782880c6e945e8115561195189259f34 --- .../werkstoff_loaders/recipe/MoltenCellLoader.java | 57 ++++++++++++---------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java index 68cca299c2..295bfd144c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -46,6 +46,31 @@ public class MoltenCellLoader implements IWerkstoffRunnable { if (!werkstoff.hasItemType(WerkstoffLoader.cellMolten)) return; + if (!werkstoff.hasItemType(ingot)) { + if (!werkstoff.hasItemType(dust)) + return; + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall), null, werkstoff.getMolten(36), 0, (int) ((double) werkstoff.getStats().getMass() / 4D), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny), null, werkstoff.getMolten(16), 0, (int) ((double) werkstoff.getStats().getMass() / 9D), werkstoff.getStats().getMass() > 128 ? 64 : 30); + } else { + + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget), null, werkstoff.getMolten(16), 0, (int) ((double) werkstoff.getStats().getMass() / 9D), werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), (int) ((double) werkstoff.getStats().getMass() / 9D), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(1296), werkstoff.get(block), (int) werkstoff.getStats().getMass() * 9, werkstoff.getStats().getMass() > 128 ? 64 : 30); + + if (!werkstoff.hasItemType(plate)) + return; + + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick), null, werkstoff.getMolten(72), 0, (int) ((double) werkstoff.getStats().getMass() / 2D), werkstoff.getStats().getMass() > 128 ? 64 : 30); + } + //Tank "Recipe" final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(cell), Materials.Empty.getCells(1)); @@ -53,32 +78,12 @@ public class MoltenCellLoader implements IWerkstoffRunnable { GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(WerkstoffLoader.cellMolten), new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), GT_Values.NF); GT_Values.RA.addFluidCannerRecipe(werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); - if (LoaderReference.Forestry) { - final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); - FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); - GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsuleMolten), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); - } - - if (werkstoff.hasItemType(ingot)) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - if (werkstoff.hasItemType(plate)) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick), null, werkstoff.getMolten(72), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - } - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget), null, werkstoff.getMolten(16), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + if (!LoaderReference.Forestry) + return; - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(1296), werkstoff.get(block), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - } else { - if (werkstoff.hasItemType(dust)) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall), null, werkstoff.getMolten(36), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny), null, werkstoff.getMolten(16), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - } - } + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + GT_Utility.addFluidContainerData(emptyData); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsuleMolten), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); } } \ No newline at end of file -- cgit From debe6a4522b2baeaa613495d69198b34e8c6d01a Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Fri, 26 Feb 2021 07:27:12 +0100 Subject: revert Former-commit-id: 89d90a17eb95ebbd0e94df205ae5d8ceddb0a175 --- src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index a2fbc8cfff..4723d9c6ac 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -109,8 +109,8 @@ public final class MainMod { LoaderReference.init(); //Check for ALL the mods. if (LoaderReference.miscutils) { - if (SideReference.Side.Client) - ClientGTppWarning(); + //if (SideReference.Side.Client) + //ClientGTppWarning(); MainMod.LOGGER.error("BartWorks was NOT meant to be played with GT++," + " since GT++'s Multiblocks break the Platinum Processing chain. " + -- cgit From 029ac0f5f4df8b18810642db139ddd385e484962 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 3 Mar 2021 18:47:21 +0100 Subject: fixes Pyrolyse not checking top (cherry picked from commit 528980859b910226a299dc1657e981a5fd112c50 [formerly e35ff1621be566d225c902d7941bb37f80b064bd]) Former-commit-id: 09e2a1617f88dce9e205a57f366800ca0fe3499e --- .../tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java index 43ec2f0dde..b08e2ede3d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java @@ -97,7 +97,6 @@ public class TT_PyrolyseOven extends TT_Abstract_GT_Replacement_Coils { ).addElement( 'C', ofChain( - ofHint(2), ofHatchAdder( TT_PyrolyseOven::addClassicInputToMachineList, TEXTURE_INDEX, 2 -- cgit From 208e3044d9dbd39957e65d73bfc22b0c755affbf Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 3 Mar 2021 19:02:06 +0100 Subject: Added TGregworks integration (#126) (cherry picked from commit e6f4a1453afece3e68c750684a225be415b40584 [formerly 44aa12c5de2f8e1487e5f5d140668ba559d31ab1]) Former-commit-id: 08379a6fa1c8961e288f6da614ba536d4af7af21 --- build.gradle.kts | 14 ++ gradle.properties | 2 +- .../bartworks/API/LoaderReference.java | 2 + .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 4 + .../crossmod/tgregworks/MaterialsInjector.java | 145 +++++++++++++++++++++ 5 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java diff --git a/build.gradle.kts b/build.gradle.kts index 5351995bcf..4cd7e8c3a7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -52,8 +52,10 @@ java { this.sourceCompatibility = JavaVersion.VERSION_1_8 this.targetCompatibility = JavaVersion.VERSION_1_8 } + configurations.all { resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS) + isTransitive = false } tasks.withType { @@ -103,6 +105,10 @@ repositories { this.name = "BuildCraft" this.artifactPattern("http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision](-[classifier]).[ext]") } + ivy { + this.name = "vexatos" + this.artifactPattern("https://files.vexatos.com/[organisation]/[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" } @@ -118,12 +124,19 @@ dependencies { val applecoreVersion: String by project val enderCoreVersion: String by project val enderioVersion: String by project + //hard deps compile("net.industrial-craft:industrialcraft-2:$ic2Version:dev") //jitpack compile("com.github.GTNewHorizons:GT5-Unofficial:experimental-SNAPSHOT:dev") { this.isChanging = true } + compile("com.github.GTNewHorizons:TinkersConstruct:master-SNAPSHOT:deobf") { + this.isChanging = true + } + compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-1.7.10-SNAPSHOT:dev") { + this.isChanging = true + } //soft deps compileOnly("com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf") compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") @@ -133,6 +146,7 @@ dependencies { compile("micdoodle8.mods:Galacticraft-Planets:$galacticraftVersion:Dev") compileOnly("li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api") compileOnly("net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev") + compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.19:deobf") //jitpack compileOnly("com.github.GTNewHorizons:GalacticGregGT5:master-SNAPSHOT") { this.isChanging = true diff --git a/gradle.properties b/gradle.properties index 79e967b70c..e40fde0e49 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,7 +21,7 @@ # majorUpdate=0 minorUpdate=5 -buildNumber=15 +buildNumber=16 apiVersion=11 ic2Version=2.2.828-experimental applecoreVersion=1.7.10-3.1.1 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java index 16ec04b43e..4cc8ad45c1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java @@ -56,6 +56,7 @@ public class LoaderReference { public static boolean EnderIO; public static boolean HardcoreEnderExpension; public static boolean betterloadingscreen; + public static boolean TGregworks; public static void init() { Natura = Loader.isModLoaded("Natura"); @@ -84,5 +85,6 @@ public class LoaderReference { EnderIO = Loader.isModLoaded("EnderIO"); HardcoreEnderExpension = Loader.isModLoaded("HardcoreEnderExpension"); betterloadingscreen = Loader.isModLoaded("betterloadingscreen"); + TGregworks = Loader.isModLoaded("TGregworks"); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index c5376dbf3b..ee6f09d4ee 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.tectech.TecTechResearchLoader; import com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement.*; +import com.github.bartimaeusnek.crossmod.tgregworks.MaterialsInjector; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -46,6 +47,7 @@ import java.io.StringReader; dependencies = "required-after:IC2; " + "required-after:gregtech; " + "required-after:bartworks;" + + "before:TGregworks; " + "after:GalacticraftMars; " + "after:GalacticraftCore; " + "after:Micdoodlecore; " @@ -87,6 +89,8 @@ public class BartWorksCrossmod { new BW_TT_HeatExchanger(null, null); } + if (LoaderReference.TGregworks) + MaterialsInjector.run(); } @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java new file mode 100644 index 0000000000..2234347045 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java @@ -0,0 +1,145 @@ +package com.github.bartimaeusnek.crossmod.tgregworks; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import cpw.mods.fml.common.FMLCommonHandler; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import net.minecraftforge.common.config.Property; +import tconstruct.library.TConstructRegistry; +import vexatos.tgregworks.TGregworks; +import vexatos.tgregworks.integration.TGregRegistry; +import vexatos.tgregworks.item.ItemTGregPart; +import vexatos.tgregworks.reference.Config; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; + +@SuppressWarnings("unchecked") +public class MaterialsInjector { + private static HashMap configProps; + private static ArrayList configIDs; + private static Method getGlobalMultiplierMethod; + private static Method getGlobalMultiplierMethodTwoArguments; + private static Method getMultiplierMethod; + private static Method getMaterialIDMethod; + private static Method getReinforcedLevelMethod; + private static Method getStoneboundLevelMethod; + + static { + try { + getFields(); + getMethodes(); + } catch ( + IllegalArgumentException + | IllegalAccessException + | NoSuchFieldException + | NoSuchMethodException + | SecurityException + e) { + MainMod.LOGGER.catching(e); + FMLCommonHandler.instance().exitJava(1, true); + } + } + + private static void getFields() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException { + Field configPropsField = TGregRegistry.class.getDeclaredField("configProps"); + configPropsField.setAccessible(true); + configProps = (HashMap) configPropsField.get(TGregworks.registry); + + Field configIDsField = TGregRegistry.class.getDeclaredField("configIDs"); + configIDsField.setAccessible(true); + configIDs = (ArrayList) configIDsField.get(TGregworks.registry); + } + + private static void getMethodes() throws NoSuchMethodException, SecurityException { + getGlobalMultiplierMethod = TGregRegistry.class.getDeclaredMethod("getGlobalMultiplier", String.class); + getGlobalMultiplierMethod.setAccessible(true); + + getGlobalMultiplierMethodTwoArguments = TGregRegistry.class.getDeclaredMethod("getGlobalMultiplier", String.class, double.class); + getGlobalMultiplierMethodTwoArguments.setAccessible(true); + + getMultiplierMethod = TGregRegistry.class.getDeclaredMethod("getMultiplier", Materials.class, String.class); + getMultiplierMethod.setAccessible(true); + + getMaterialIDMethod = TGregRegistry.class.getDeclaredMethod("getMaterialID", Materials.class); + getMaterialIDMethod.setAccessible(true); + + getReinforcedLevelMethod = TGregRegistry.class.getDeclaredMethod("getReinforcedLevel", Materials.class); + getReinforcedLevelMethod.setAccessible(true); + + getStoneboundLevelMethod = TGregRegistry.class.getDeclaredMethod("getStoneboundLevel", Materials.class); + getStoneboundLevelMethod.setAccessible(true); + } + + public static void run() { + MainMod.LOGGER.info("Registering TGregworks - BartWorks tool parts."); + Werkstoff.werkstoffHashSet.stream() + .filter(x -> x.hasItemType(OrePrefixes.gem) || x.hasItemType(OrePrefixes.plate)) + .map(Werkstoff::getBridgeMaterial) + .filter(x -> x.mMetaItemSubID == -1) + .filter(x -> x.mDurability != 0) + .forEach(m -> { + setConfigProps(m); + registerParts(m); + }); + + configProps.clear(); + configIDs.clear(); + + ItemTGregPart.toolMaterialNames = TGregworks.registry.toolMaterialNames; + } + + private static void registerParts(Materials m) { + try { + TGregworks.registry.toolMaterialNames.add(m.mDefaultLocalName); + int matID = (int) getMaterialIDMethod.invoke(TGregworks.registry, m); + + addToolMaterial(matID, m); + addBowMaterial(matID, m); + addArrowMaterial(matID, m); + + TGregworks.registry.matIDs.put(m, matID); + TGregworks.registry.materialIDMap.put(matID, m); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + MainMod.LOGGER.catching(e); + FMLCommonHandler.instance().exitJava(1, true); + } + } + + private static void setConfigProps(Materials m){ + if (TGregworks.config.get(Config.Category.Enable, m.mName, true).getBoolean(true)) { + TGregworks.registry.toolMaterials.add(m); + Property configProp = TGregworks.config.get(Config.onMaterial(Config.MaterialID), m.mName, 0, null, 0, 100000); + configProps.put(m, configProp); + configIDs.add(configProp.getInt()); + } + } + + private static void addToolMaterial(int matID, Materials m) + throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { + TConstructRegistry.addToolMaterial(matID, m.mName, m.mLocalizedName, m.mToolQuality, + (int) (m.mDurability * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.Durability) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.Durability)), // Durability + (int) (m.mToolSpeed * 100F * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.MiningSpeed) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.MiningSpeed)), // Mining speed + (int) (m.mToolQuality * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.Attack) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.Attack)), // Attack + (m.mToolQuality - 0.5F) * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.HandleModifier) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.HandleModifier), // Handle Modifier + (int) getReinforcedLevelMethod.invoke(TGregworks.registry, m), (float) getStoneboundLevelMethod.invoke(TGregworks.registry, m), "", (m.getRGBA()[0] << 16) | (m.getRGBA()[1] << 8) | (m.getRGBA()[2])); + } + + private static void addBowMaterial(int matID, Materials m) + throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { + TConstructRegistry.addBowMaterial(matID, + (int) ((float) m.mToolQuality * 10F * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.BowDrawSpeed) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.BowDrawSpeed)), + (((float) m.mToolQuality) - 0.5F) * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.BowFlightSpeed) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.BowFlightSpeed)); + } + + private static void addArrowMaterial(int matID, Materials m) + throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { + TConstructRegistry.addArrowMaterial(matID, + (float) ((((double) m.getMass()) / 10F) * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.ArrowMass) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.ArrowMass)), + (float) getGlobalMultiplierMethodTwoArguments.invoke(TGregworks.registry, Config.ArrowBreakChance, 0.9) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.ArrowBreakChance)); + } +} -- cgit From 48a106e4b0ac10bc0c65926283678bc49e10be3f Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 8 Mar 2021 20:58:03 +0100 Subject: Resolve Cyclic Dependancy with miscutils + also made gradle wait for deps by default. (cherry picked from commit 79442ef9d74e6f73cd89ee19de1330f94be5fbe5 [formerly 059918559c472d2c1f17a0806916bc9543415ac9]) Former-commit-id: 3c549f350f8c81bc34b6ff5ca524965073143eb9 --- gradle.properties | 2 ++ .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 3 --- .../crossmod/tgregworks/MaterialsInjector.java | 26 +++++++++++++++++++++- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index e40fde0e49..0a34575bb6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,6 +19,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # +systemProp.org.gradle.internal.http.connectionTimeout=120000 +systemProp.org.gradle.internal.http.socketTimeout=120000 majorUpdate=0 minorUpdate=5 buildNumber=16 diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index ee6f09d4ee..0faf2ea561 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -28,7 +28,6 @@ import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.tectech.TecTechResearchLoader; import com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement.*; -import com.github.bartimaeusnek.crossmod.tgregworks.MaterialsInjector; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -89,8 +88,6 @@ public class BartWorksCrossmod { new BW_TT_HeatExchanger(null, null); } - if (LoaderReference.TGregworks) - MaterialsInjector.run(); } @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java index 2234347045..a4cff256bb 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java @@ -1,8 +1,11 @@ package com.github.bartimaeusnek.crossmod.tgregworks; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.event.FMLInitializationEvent; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import net.minecraftforge.common.config.Property; @@ -18,8 +21,21 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; +@Mod( + modid = MaterialsInjector.MOD_ID, name = MaterialsInjector.NAME, version = MaterialsInjector.VERSION, + dependencies = "required-after:IC2; " + + "required-after:gregtech; " + + "required-after:bartworks;" + + "before:TGregworks;" + + "before:miscutils; " +) @SuppressWarnings("unchecked") public class MaterialsInjector { + + public static final String NAME = "BartWorks Mod Additions - TGregworks Container"; + public static final String VERSION = MainMod.VERSION; + public static final String MOD_ID = "bartworkscrossmodtgregworkscontainer"; + private static HashMap configProps; private static ArrayList configIDs; private static Method getGlobalMultiplierMethod; @@ -29,7 +45,15 @@ public class MaterialsInjector { private static Method getReinforcedLevelMethod; private static Method getStoneboundLevelMethod; - static { + @Mod.EventHandler + public void init(FMLInitializationEvent init) { + if (LoaderReference.TGregworks) { + MaterialsInjector.preinit(); + MaterialsInjector.run(); + } + } + + private static void preinit() { try { getFields(); getMethodes(); -- cgit From d72bc905090623048f3da4c9979464d746168a05 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Fri, 12 Mar 2021 11:37:33 +0100 Subject: Removed old dependency annotation (cherry picked from commit 6ae8b900c872195d1e7134b66c2799a66bdbfc9e [formerly d8109a84906b2ce8e3969d3bc89d4a6e8e3ee74c]) Former-commit-id: eb00e7c09a0ba36911f0d954238a0cc824285421 --- .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 0faf2ea561..9975fd8d2d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -42,17 +42,18 @@ import org.apache.logging.log4j.Logger; import java.io.StringReader; @Mod( - modid = BartWorksCrossmod.MOD_ID, name = BartWorksCrossmod.NAME, version = BartWorksCrossmod.VERSION, - dependencies = "required-after:IC2; " - + "required-after:gregtech; " - + "required-after:bartworks;" - + "before:TGregworks; " - + "after:GalacticraftMars; " - + "after:GalacticraftCore; " - + "after:Micdoodlecore; " - + "after:miscutils;" - + "after:EMT;" - + "after:tectech;" + modid = BartWorksCrossmod.MOD_ID, + name = BartWorksCrossmod.NAME, + version = BartWorksCrossmod.VERSION, + dependencies = "required-after:IC2; " + + "required-after:gregtech; " + + "required-after:bartworks;" + + "after:GalacticraftMars; " + + "after:GalacticraftCore; " + + "after:Micdoodlecore; " + + "after:miscutils; " + + "after:EMT; " + + "after:tectech; " ) public class BartWorksCrossmod { public static final String NAME = "BartWorks Mod Additions"; -- cgit From 5d86c51af8d1671becb6bba6c2ebf3c26bc05176 Mon Sep 17 00:00:00 2001 From: botn365 <42187820+botn365@users.noreply.github.com> Date: Fri, 16 Apr 2021 20:18:38 +0200 Subject: allwo for more recipes in the oilcracker (#128) * allow for more difrent recipes allows for more difrent recipes while still keeping hydrogen and steam in the middle * remove extra space (cherry picked from commit c571afe43017cb0dbe5c6321ccce835d4c3e2f3d [formerly fe0e0357b681d0a7bc0a5be9f26de2b34c5b3f33]) Former-commit-id: 561056cf2d345c04ca78ee5016dad0b019ea8e58 --- .../tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java index 8cdaaf581b..8aeee61e1a 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java @@ -286,8 +286,7 @@ public class TT_OilCrackingUnit extends TT_Abstract_GT_Replacement_Coils { } this.middleFluidHatch.mRecipeMap = getRecipeMap(); FluidStack tStack = this.middleFluidHatch.getFillableStack(); - if (tStack.isFluidEqual(GT_ModHandler.getSteam(1000)) || tStack.isFluidEqual(Materials.Hydrogen.getGas(1000))) - rList.add(tStack); + rList.add(tStack); return rList; } -- cgit From c93ce2e9a40b8af87ffbd42ef3f41af11a20daa2 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Sun, 16 May 2021 13:26:04 +0200 Subject: bump version Former-commit-id: df9db0a3127dbe2cb0fe4d3209bdff625c192b13 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 0a34575bb6..41d4d298dc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,7 +22,7 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 majorUpdate=0 -minorUpdate=5 +minorUpdate=6 buildNumber=16 apiVersion=11 ic2Version=2.2.828-experimental -- cgit From 3036a1e3d751349fbca063dc93abe6107e0afa79 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Sun, 16 May 2021 13:26:37 +0200 Subject: Revert "bump version" This reverts commit c93ce2e9a40b8af87ffbd42ef3f41af11a20daa2 [formerly df9db0a3127dbe2cb0fe4d3209bdff625c192b13]. Former-commit-id: a8511ed77919a3e5359b89f12b35545bcb3b9b70 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 41d4d298dc..0a34575bb6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,7 +22,7 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 majorUpdate=0 -minorUpdate=6 +minorUpdate=5 buildNumber=16 apiVersion=11 ic2Version=2.2.828-experimental -- cgit From e9017cd39cc8fa0dafd3190554b6af89c8d46fdc Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Sun, 16 May 2021 13:26:55 +0200 Subject: bump version Former-commit-id: ec7ba8367e8f31ed11b3aaa6149ad104dedefafc --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 0a34575bb6..22860bbbd1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,7 +23,7 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 majorUpdate=0 minorUpdate=5 -buildNumber=16 +buildNumber=17 apiVersion=11 ic2Version=2.2.828-experimental applecoreVersion=1.7.10-3.1.1 -- cgit From e7cf55ce3431fc61c8c122d81798c8eba55a23c7 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Mon, 17 May 2021 08:55:01 +0800 Subject: prevent resetPiston when machine not formed Former-commit-id: 144be54de3e331d919f3ce11a783cf6b86070e27 --- .../tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 18e6a43ebc..8bb604dd36 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -115,7 +115,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity private void resetPiston() { if (this.getBaseMetaTileEntity().getWorld().isRemote) return; - if (!this.piston) { + if (!this.piston && this.mMachine) { int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; int aX = this.getBaseMetaTileEntity().getXCoord(), aY = this.getBaseMetaTileEntity().getYCoord(), aZ = this.getBaseMetaTileEntity().getZCoord(); -- cgit From 4008660fd4ae7e2983e3e5e6eb08545c438900d0 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Mon, 17 May 2021 08:57:58 +0800 Subject: Fix buildscript Former-commit-id: 4f00ff7aad492e0d58873938ff876dd5f4e53d5d --- build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4cd7e8c3a7..35e7681226 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,7 +25,7 @@ import net.minecraftforge.gradle.user.UserExtension buildscript { repositories { mavenCentral() - maven("http://files.minecraftforge.net/maven") + maven("https://gregtech.overminddl1.com/") maven("https://jitpack.io") } dependencies { @@ -232,4 +232,4 @@ artifacts { fun getVersionAppendage() : String { return org.ajoberstar.grgit.Grgit.open(mapOf("currentDir" to project.rootDir)).log().last().abbreviatedId -} \ No newline at end of file +} -- cgit From 55442bc96db7301b245388fa4de1c1752f63d3c1 Mon Sep 17 00:00:00 2001 From: GTNH-Afx237v7 <64365566+GTNH-Afx237v7@users.noreply.github.com> Date: Mon, 17 May 2021 10:55:07 +0200 Subject: fix MBF controller typo see https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/6912 Former-commit-id: 89d62e95241be1adebd7777a71fef14b44fe5177 --- src/main/resources/assets/bartworks/lang/en_US.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index ff7b806fbd..15cf5f0697 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -100,7 +100,7 @@ tooltip.tile.waterpump.0.name=Produces tooltip.tile.waterpump.1.name=L/s Water when fueled. Causes 5 Pollution per second. tooltip.tile.waterpump.2.name=Must be placed on the Ground. -tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Boronsilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Hatch/Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum +tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3rd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Borosilicate Glass;The glass tier limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Hatch/Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum tooltip.tile.mbf.1.name=Pollution per second tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom or top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radio Hatch;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! -- cgit From b378674080f42d0c235582c888aef0346b231f34 Mon Sep 17 00:00:00 2001 From: Léa Gris Date: Sat, 22 May 2021 16:09:27 +0200 Subject: fix(texture): multiblock addressing deprecated array replaces deprecated CASING_BLOCKS by getCasingTextureForId Former-commit-id: e73a81d26196dfadbec42479a7dfc242843ec3f5 --- .../bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java | 4 ++-- .../common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java | 2 +- .../common/tileentities/multis/GT_TileEntity_ManualTrafo.java | 2 +- .../bartworks/common/tileentities/multis/GT_TileEntity_THTR.java | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index f13f11607c..2a1726fbbe 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -580,6 +580,6 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @Override @SuppressWarnings("deprecation") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_BioVat.MCASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_BioVat.MCASING_INDEX]}; + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_BioVat.MCASING_INDEX), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_BioVat.MCASING_INDEX)}; } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 8552aa14d1..246b2fc52c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -384,6 +384,6 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl @Override @SuppressWarnings("deprecation") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16]}; + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(16), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE)} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(16)}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index 9c43cff7de..953a834d2c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -391,7 +391,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase @Override @SuppressWarnings("deprecation") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[this.texid], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[this.texid]}; + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(this.texid), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(this.texid)}; } public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex, short tier) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index d46754840d..45c08556f3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -324,7 +324,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override @SuppressWarnings("deprecation") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_THTR.BASECASINGINDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_THTR.BASECASINGINDEX]}; + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX)}; } @Override @@ -384,4 +384,4 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { } } -} \ No newline at end of file +} -- cgit From 486a3c34448f2241e2ecc2272e268c4a6b357953 Mon Sep 17 00:00:00 2001 From: Léa Gris Date: Tue, 25 May 2021 17:47:44 +0200 Subject: feat(textures): migrate to TextureFactory API and glow textures (#8) - Migrate to the new implementation-free TextureFactory API. - Implement support for glow textures. Former-commit-id: f0d639281d732b70ce96ec0b71e868fad3021aa1 --- .../tileentities/multis/GT_TileEntity_BioVat.java | 5 ++--- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 5 ++--- .../tileentities/multis/GT_TileEntity_LESU.java | 4 ++-- .../multis/GT_TileEntity_ManualTrafo.java | 5 ++--- .../tileentities/multis/GT_TileEntity_THTR.java | 5 ++--- .../multis/GT_TileEntity_Windmill.java | 10 +++++----- .../tiered/GT_MetaTileEntity_AcidGenerator.java | 22 +++++++++++----------- .../tiered/GT_MetaTileEntity_BioLab.java | 4 ++-- .../tiered/GT_MetaTileEntity_RadioHatch.java | 6 +++--- .../BW_MetaGeneratedBlocks_CasingAdvanced_TE.java | 11 +++++------ .../material/BW_MetaGeneratedBlocks_Casing_TE.java | 11 +++++------ .../system/material/BW_MetaGeneratedFrames.java | 6 +++--- .../system/material/BW_MetaGeneratedOreTE.java | 9 ++++----- .../material/BW_MetaGeneratedSmallOreTE.java | 9 ++++----- .../BW_MetaGenerated_WerkstoffBlock_TE.java | 9 ++++----- .../werkstoff_loaders/recipe/GemLoader.java | 7 +++---- .../recipe/MultipleMetalLoader.java | 11 +++++++---- .../recipe/SimpleMetalLoader.java | 22 +++++++++++++++------- .../multi/GT_Replacement/BW_TT_HeatExchanger.java | 6 +++--- .../multi/GT_Replacement/TT_PyrolyseOven.java | 4 ++-- .../TT_MetaTileEntity_Pipe_Energy_LowPower.java | 9 ++++----- 21 files changed, 90 insertions(+), 90 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 2a1726fbbe..9d1a054cb0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -38,7 +38,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayerMP; @@ -578,8 +578,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } @Override - @SuppressWarnings("deprecation") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_BioVat.MCASING_INDEX), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_BioVat.MCASING_INDEX)}; + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_BioVat.MCASING_INDEX), TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).glow().build()))} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_BioVat.MCASING_INDEX)}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 246b2fc52c..3cda596247 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -32,7 +32,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.*; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -382,8 +382,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl } @Override - @SuppressWarnings("deprecation") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(16), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE)} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(16)}; + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(16), TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_GLOW).glow().build()))} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(16)}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 533cf24d70..e292237e58 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -40,7 +40,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -220,7 +220,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { if (this.isClientSide()) { for (int i = 0; i < GT_TileEntity_LESU.iTextures.length; i++) { - GT_TileEntity_LESU.iTextures[i][0] = new GT_RenderedTexture(GT_TileEntity_LESU.iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); + GT_TileEntity_LESU.iTextures[i][0] = TextureFactory.of(GT_TileEntity_LESU.iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); } if (aSide == aFacing && this.getBaseMetaTileEntity().getUniversalEnergyStored() <= 0) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index 953a834d2c..e3b3e64753 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -33,7 +33,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -389,9 +389,8 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase } @Override - @SuppressWarnings("deprecation") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(this.texid), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(this.texid)}; + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(this.texid), TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW).glow().build()))} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(this.texid)}; } public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex, short tier) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 45c08556f3..a7ce0009ec 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -37,8 +37,8 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.XSTR; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -322,9 +322,8 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { } @Override - @SuppressWarnings("deprecation") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX)}; + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).glow().build()))} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX)}; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 2bea093f2a..ffa44e1a88 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -40,8 +40,8 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.XSTR; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -645,13 +645,13 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { if (this.isClientSide()) { if (aFacing == aSide || aSide == 0) { - GT_TileEntity_Windmill.iTextures[0] = new GT_RenderedTexture(GT_TileEntity_Windmill.iIconContainers[0]); + GT_TileEntity_Windmill.iTextures[0] = TextureFactory.of(GT_TileEntity_Windmill.iIconContainers[0]); Arrays.fill(ret, GT_TileEntity_Windmill.iTextures[0]); } else if (aSide == 1) { - GT_TileEntity_Windmill.iTextures[1] = new GT_RenderedTexture(GT_TileEntity_Windmill.iIconContainers[1]); + GT_TileEntity_Windmill.iTextures[1] = TextureFactory.of(GT_TileEntity_Windmill.iIconContainers[1]); Arrays.fill(ret, GT_TileEntity_Windmill.iTextures[1]); } else { - GT_TileEntity_Windmill.iTextures[2] = new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE); + GT_TileEntity_Windmill.iTextures[2] = TextureFactory.of(Textures.BlockIcons.COVER_WOOD_PLATE); Arrays.fill(ret, GT_TileEntity_Windmill.iTextures[2]); } } @@ -663,4 +663,4 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { return this.getBaseMetaTileEntity().getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index 3188ce4aa1..e22641040f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -31,7 +31,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import net.minecraft.util.StatCollector; @@ -66,43 +66,43 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene } public ITexture[] getFront(byte aColor) { - return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[]{super.getFront(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; } public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; } public ITexture[] getBottom(byte aColor) { - return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; } public ITexture[] getTop(byte aColor) { - return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT"))}; + return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")).glow().build()}; } public ITexture[] getSides(byte aColor) { - return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; } public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[]{super.getFrontActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; } public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[]{super.getBackActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; } public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[]{super.getBottomActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; } public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE"))}; + return new ITexture[]{super.getTopActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")).glow().build()}; } public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[]{super.getSidesActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; } public boolean isOutputFacing(byte aSide) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index 149c9e09fd..c4349afa06 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -37,8 +37,8 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; -import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.XSTR; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -60,7 +60,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { private static final int INCUBATION_MODULE = 5; public GT_MetaTileEntity_BioLab(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, (String) null, 6, 2, GT_MetaTileEntity_BioLab.MGUINAME, null, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")/*this is topactive*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")/*this is top*/), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM"))); + super(aID, aName, aNameRegional, aTier, 1, (String) null, 6, 2, GT_MetaTileEntity_BioLab.MGUINAME, null, TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE_GLOW")).glow().build()), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_GLOW")).glow().build()), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE_GLOW")).glow().build()), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_GLOW")).glow().build()), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")).glow().build()/*this is topactive*/), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")).glow().build()/*this is top*/), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE_GLOW")).glow().build()), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_GLOW")).glow().build())); } public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, String aNEIName) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 2f42348055..932869da24 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -39,7 +39,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; @@ -118,11 +118,11 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + return new ITexture[]{aBaseTexture, TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_IN)}; } public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + return new ITexture[]{aBaseTexture, TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_IN)}; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java index 6dd15c8b5a..9d0fd5811b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java @@ -27,8 +27,7 @@ import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; import gregtech.api.interfaces.ITexture; -import gregtech.api.objects.GT_CopiedBlockTexture; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -45,15 +44,15 @@ public class BW_MetaGeneratedBlocks_CasingAdvanced_TE extends BW_MetaGenerated_B Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if ((aMaterial != null)) { TextureSet set = aMaterial.getTexSet(); - GT_RenderedTexture aIconSet = new GT_RenderedTexture( + ITexture aIconSet = TextureFactory.of( PrefixTextureLinker.texMapBlocks .get(WerkstoffLoader.blockCasingAdvanced) .getOrDefault(set, TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]), aMaterial.getRGBA() ); - return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), aIconSet}; + return new ITexture[]{TextureFactory.of(Blocks.iron_block), aIconSet}; } } - return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; + return new ITexture[]{TextureFactory.of(Blocks.iron_block), TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java index 58863aff02..4d81419f2a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java @@ -27,8 +27,7 @@ import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; import gregtech.api.interfaces.ITexture; -import gregtech.api.objects.GT_CopiedBlockTexture; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -45,15 +44,15 @@ public class BW_MetaGeneratedBlocks_Casing_TE extends BW_MetaGenerated_Block_TE Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if ((aMaterial != null)) { TextureSet set = aMaterial.getTexSet(); - GT_RenderedTexture aIconSet = new GT_RenderedTexture( + ITexture aIconSet = TextureFactory.of( PrefixTextureLinker.texMapBlocks .get(WerkstoffLoader.blockCasing) .getOrDefault(set, TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]), aMaterial.getRGBA() ); - return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), aIconSet}; + return new ITexture[]{TextureFactory.of(Blocks.iron_block), aIconSet}; } } - return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; + return new ITexture[]{TextureFactory.of(Blocks.iron_block), TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java index 5fe7a3c4f5..af5706a80b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java @@ -29,7 +29,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaPipeEntity; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_ModHandler.RecipeBits; import gregtech.api.util.GT_OreDictUnificator; @@ -68,7 +68,7 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { - return new ITexture[]{new GT_RenderedTexture(this.mMaterial.getTexSet().mTextures[OrePrefixes.frameGt.mTextureIndex], Dyes.getModulation(aColorIndex, this.mMaterial.getRGBA()))}; + return new ITexture[]{TextureFactory.of(this.mMaterial.getTexSet().mTextures[OrePrefixes.frameGt.mTextureIndex], Dyes.getModulation(aColorIndex, this.mMaterial.getRGBA()))}; } @Override @@ -124,4 +124,4 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { public void disconnect(byte aSide) { /* Do nothing*/ } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index e43ee12471..63245b588a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -24,8 +24,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; -import gregtech.api.objects.GT_CopiedBlockTexture; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -35,10 +34,10 @@ public class BW_MetaGeneratedOreTE extends BW_MetaGenerated_Block_TE { public ITexture[] getTexture(Block aBlock, byte aSide) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if ((aMaterial != null)) { - GT_RenderedTexture aIconSet = new GT_RenderedTexture(aMaterial.getTexSet().mTextures[OrePrefixes.ore.mTextureIndex], aMaterial.getRGBA()); - return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet}; + ITexture aIconSet = TextureFactory.of(aMaterial.getTexSet().mTextures[OrePrefixes.ore.mTextureIndex], aMaterial.getRGBA()); + return new ITexture[]{TextureFactory.of(Blocks.stone), aIconSet}; } - return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex])}; + return new ITexture[]{TextureFactory.of(Blocks.stone), TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex])}; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java index 3aa323277f..cbf6b9482b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java @@ -25,9 +25,8 @@ package com.github.bartimaeusnek.bartworks.system.material; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; -import gregtech.api.objects.GT_CopiedBlockTexture; -import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.XSTR; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; @@ -108,10 +107,10 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { public ITexture[] getTexture(Block aBlock, byte aSide) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if ((aMaterial != null)) { - GT_RenderedTexture aIconSet = new GT_RenderedTexture(aMaterial.getTexSet().mTextures[OrePrefixes.oreSmall.mTextureIndex], aMaterial.getRGBA()); - return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet}; + ITexture aIconSet = TextureFactory.of(aMaterial.getTexSet().mTextures[OrePrefixes.oreSmall.mTextureIndex], aMaterial.getRGBA()); + return new ITexture[]{TextureFactory.of(Blocks.stone), aIconSet}; } - return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.oreSmall.mTextureIndex])}; + return new ITexture[]{TextureFactory.of(Blocks.stone), TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.oreSmall.mTextureIndex])}; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java index 75c774240b..4dd28d9af7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java @@ -27,8 +27,7 @@ import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; import gregtech.api.interfaces.ITexture; -import gregtech.api.objects.GT_CopiedBlockTexture; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -40,13 +39,13 @@ public class BW_MetaGenerated_WerkstoffBlock_TE extends BW_MetaGenerated_Block_T Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if ((aMaterial != null)) { TextureSet set = aMaterial.getTexSet(); - GT_RenderedTexture aIconSet = new GT_RenderedTexture( + ITexture aIconSet = TextureFactory.of( set.mTextures[PrefixTextureLinker.blockTexMap.getOrDefault(set, OrePrefixes.block.mTextureIndex)], aMaterial.getRGBA() ); - return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), aIconSet}; + return new ITexture[]{TextureFactory.of(Blocks.iron_block), aIconSet}; } } - return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; + return new ITexture[]{TextureFactory.of(Blocks.iron_block), TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java index c020c3394d..194ab143d9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java @@ -30,8 +30,7 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; -import gregtech.api.objects.GT_MultiTexture; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; @@ -97,7 +96,7 @@ public class GemLoader implements IWerkstoffRunnable { } GT_Values.RA.addLatheRecipe(werkstoff.get(gemExquisite), werkstoff.get(lens), werkstoff.get(dust, 2), 2400, 30); - GregTech_API.registerCover(werkstoff.get(lens), new GT_MultiTexture(Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false)), new gregtech.common.covers.GT_Cover_Lens(BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex)); + GregTech_API.registerCover(werkstoff.get(lens), TextureFactory.of(Textures.BlockIcons.MACHINE_CASINGS[2][0], TextureFactory.of(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false)), new gregtech.common.covers.GT_Cover_Lens(BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(lens), werkstoff.get(dustSmall, 3)); for (ItemStack is : OreDictionary.getOres("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) { @@ -109,4 +108,4 @@ public class GemLoader implements IWerkstoffRunnable { } } } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java index 67e82dab29..c73714a302 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java @@ -27,20 +27,23 @@ import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWer import com.github.bartimaeusnek.bartworks.util.BWRecipes; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.ingot; +import static gregtech.api.enums.OrePrefixes.plateDense; +import static gregtech.api.enums.OrePrefixes.plateDouble; public class MultipleMetalLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(plateDense)) { GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{werkstoff.get(ingot, 2), GT_Utility.getIntegratedCircuit(2)}, new ItemStack[]{werkstoff.get(plateDouble)}, null, null, null, null, (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), 60, 0)); - GregTech_API.registerCover(werkstoff.get(plateDouble), new GT_RenderedTexture(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false), null); + GregTech_API.registerCover(werkstoff.get(plateDouble), TextureFactory.of(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false), null); GT_Values.RA.addPulveriserRecipe(werkstoff.get(plateDouble), new ItemStack[]{werkstoff.get(dust, 2)}, null, 2, 8); } } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java index e4360f66ef..80468f3af1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java @@ -31,14 +31,22 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.TextureSet; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.interfaces.ITexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Proxy; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.OrePrefixes.block; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.dustSmall; +import static gregtech.api.enums.OrePrefixes.gem; +import static gregtech.api.enums.OrePrefixes.ingot; +import static gregtech.api.enums.OrePrefixes.plate; +import static gregtech.api.enums.OrePrefixes.stick; +import static gregtech.api.enums.OrePrefixes.stickLong; public class SimpleMetalLoader implements IWerkstoffRunnable { @Override @@ -51,9 +59,9 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); TextureSet texSet = werkstoff.getTexSet(); - GT_RenderedTexture texture = SideReference.Side.Client ? - new GT_RenderedTexture(texSet.mTextures[PrefixTextureLinker.blockTexMap.getOrDefault(texSet, block.mTextureIndex)], werkstoff.getRGBA(), false) : - new GT_RenderedTexture(texSet.mTextures[block.mTextureIndex], werkstoff.getRGBA(), false); + ITexture texture = SideReference.Side.Client ? + TextureFactory.of(texSet.mTextures[PrefixTextureLinker.blockTexMap.getOrDefault(texSet, block.mTextureIndex)], werkstoff.getRGBA(), false) : + TextureFactory.of(texSet.mTextures[block.mTextureIndex], werkstoff.getRGBA(), false); GregTech_API.registerCover(werkstoff.get(plate),texture,null); GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); @@ -66,7 +74,7 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(1)}, new ItemStack[]{werkstoff.get(plate)}, null, null, null, null, (int) Math.max(werkstoff.getStats().getMass(), 1L), 24, 0)); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ingot, 3), werkstoff.get(plate, 2), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); - GregTech_API.registerCover(werkstoff.get(plate), new GT_RenderedTexture(werkstoff.getTexSet().mTextures[71], werkstoff.getRGBA(), false), null); + GregTech_API.registerCover(werkstoff.get(plate), TextureFactory.of(werkstoff.getTexSet().mTextures[71], werkstoff.getRGBA(), false), null); GT_Values.RA.addLatheRecipe(werkstoff.get(ingot), werkstoff.get(stick), werkstoff.get(dustSmall, 2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); @@ -81,4 +89,4 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { GT_Values.RA.addPulveriserRecipe(werkstoff.get(stick), new ItemStack[]{werkstoff.get(dustSmall, 2)}, null, 2, 8); } } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java index 28592e7802..ae07cdfe37 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java @@ -11,7 +11,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; @@ -134,7 +134,7 @@ public class BW_TT_HeatExchanger extends TT_Abstract_GT_Replacement { public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][50], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][50], TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).glow().build()))}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][50]}; } @@ -366,4 +366,4 @@ public class BW_TT_HeatExchanger extends TT_Abstract_GT_Replacement { public String[] getStructureDescription(ItemStack itemStack) { return sfStructureDescription; } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java index b08e2ede3d..0c1182189c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java @@ -11,7 +11,7 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.loaders.oreprocessing.ProcessingLog; @@ -148,7 +148,7 @@ public class TT_PyrolyseOven extends TT_Abstract_GT_Replacement_Coils { @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[8][66], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN)}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[8][66], TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_GLOW).glow().build()))}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[8][66]}; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java index 26ba1039d0..f66014596c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java @@ -24,20 +24,20 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import gregtech.api.enums.Dyes; import gregtech.api.enums.Materials; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; -import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Client; import ic2.core.Ic2Items; import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; import java.util.HashSet; @@ -67,11 +67,10 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { return new ITexture[]{ - new GT_CopiedBlockTexture( + TextureFactory.of( Block.getBlockFromItem(Ic2Items.glassFiberCableBlock.getItem()), - aSide, Ic2Items.glassFiberCableBlock.getItemDamage(), - Dyes.getModulation(aColorIndex, Dyes._NULL.mRGBa) + ForgeDirection.getOrientation(aSide) ) }; } -- cgit From a7ea68c8dd218f9f529175fcf0d90b141f7ff26c Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Tue, 15 Jun 2021 21:57:19 +0200 Subject: bump version Former-commit-id: 152dc750847a41537d020dc8455017f6fe07cdf6 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 22860bbbd1..ff2f1c8178 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,7 +23,7 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 majorUpdate=0 minorUpdate=5 -buildNumber=17 +buildNumber=18 apiVersion=11 ic2Version=2.2.828-experimental applecoreVersion=1.7.10-3.1.1 -- cgit From 51a1583285b87bf56818f670c832fa27c2615692 Mon Sep 17 00:00:00 2001 From: llk89 <27812632+llk89@users.noreply.github.com> Date: Mon, 21 Jun 2021 04:08:43 +0800 Subject: re-add perfect overclock to CAL Former-commit-id: d6d63f227d9ff922f428a8cf3ba4f8aa0116278c --- .../common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 3cda596247..6d9b140e44 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -151,7 +151,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl } private void setRecipeStats() { - BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this); + calculatePerfectOverclockedNessMulti(this.bufferedRecipe.mEUt, this.bufferedRecipe.mDuration, 1, this.getMaxInputVoltage()); if (this.mEUt > 0) this.mEUt = -this.mEUt; this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); -- cgit From 723bad1bbad9b00c65d0015eaa66f5b3752846c3 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 24 Jun 2021 22:22:40 +0200 Subject: fix MBF heat issues with new coils Former-commit-id: a41b407e3942e86b97ac4ce0aa5e8c8a81f1c206 --- .../mega/GT_TileEntity_MegaBlastFurnace.java | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 233810028f..7cbd1c487b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -273,36 +273,38 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl continue; byte tUsedMeta = iGregTechTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); switch (tUsedMeta) { - case 0: + case 0: // cupronickel coil internalH = 1801; break; - case 1: + case 1: // Kanthal coil internalH = 2701; break; - case 2: + case 2: // nichrome coil internalH = 3601; break; - case 3: + case 3: // tungstensteel coil internalH = 4501; break; - case 4: + case 4: // HSS-G coil internalH = 5401; break; - case 5: + case 5: // naquadah coil internalH = 7201; break; - case 6: + case 6: // naquadah alloy coil internalH = 9001; break; - case 7: + case 7: // fluxed electrum coil internalH = 9901; break; - case 8: + case 8: // awakened draconium coil internalH = 10801; break; - case 9: - internalH = 21601; + case 9: // HSS-S coil + internalH = 6301; break; + case 10: // trinium coil + internalH = 9001; default: break; } -- cgit From 15d4cbd8ae23d4b734989a0de4433eb6deab66bb Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Sat, 26 Jun 2021 19:56:23 +0200 Subject: fixed another coil mistake in the MBF Former-commit-id: ab7a336f43305b98d697f80afd8e0e264be0e8db --- .../common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 7cbd1c487b..74e540f46e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -292,7 +292,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl internalH = 7201; break; case 6: // naquadah alloy coil - internalH = 9001; + internalH = 8101; break; case 7: // fluxed electrum coil internalH = 9901; -- cgit From 94479be9dad038bd8eb4e65041e0b2b0260cf11e Mon Sep 17 00:00:00 2001 From: GTNH-Afx237v7 <64365566+GTNH-Afx237v7@users.noreply.github.com> Date: Sun, 27 Jun 2021 16:19:24 +0200 Subject: Fix THTR controller text Former-commit-id: 94a3c47d8c56131035698bae534dfeca0eada382 --- src/main/resources/assets/bartworks/lang/en_US.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 15cf5f0697..7448af3917 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -144,7 +144,7 @@ tile.radiohatch.name=Radio Hatch tile.bw.windmill.name=Windmill tile.manutrafo.name=Manual Trafo -tooltip.tile.htr.0.name=Controller Block for the Thorium High Temperature Reactor;Size(WxHxD): 11x12x11 (Hollow);Controller: Front Center, Lowest Layer;Corners and the 2 touching blocks are air (Cylindric);Once build, Helium is inserted into the Fluid Input Hatch until it doesnt accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Raidation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete Operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes up to 0.5% of total Fuel Pellet per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days +tooltip.tile.htr.0.name=Controller Block for the Thorium High Temperature Reactor;Size(WxHxD): 11x12x11 (Hollow);Controller: Front Center, Lowest Layer;Corners and the 2 touching blocks are air (cylindric);Once built, Helium is inserted into the Fluid Input Hatch until it doesn't accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Radiation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes up to 0.5% of total Fuel Pellets per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days item.TRISOPellet.name=TRISO pebble item.TRISOPelletBall.name=TRISO pebble ball item.BISOPelletBall.name=BISO pebble ball -- cgit From fbe535d16a0bf4e77622ed5ceb3194c032c80a0a Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Sun, 27 Jun 2021 23:03:10 +0200 Subject: add(Bartworks)Changelog update gitignore Former-commit-id: 3c8d027fcd9ffbfb4ced5b184ce9004eae261b21 --- .gitignore | 1 + CHANGELOG-2.1.1.0.md | 320 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 321 insertions(+) create mode 100644 CHANGELOG-2.1.1.0.md diff --git a/.gitignore b/.gitignore index 1801f4555b..f338842ce1 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,4 @@ hs_err_pid* SetupWorkspaces.bat SetupDevWorkspaces.bat Idea.bat +*.bat diff --git a/CHANGELOG-2.1.1.0.md b/CHANGELOG-2.1.1.0.md new file mode 100644 index 0000000000..4018003d1e --- /dev/null +++ b/CHANGELOG-2.1.1.0.md @@ -0,0 +1,320 @@ + +# + +Changelog of . + + +### No issue +**Merge pull request #11 from boubou19/master** +* fixed another coil mistake in the MBF + +[dc72318c3f58ada](https://github.com///commit/dc72318c3f58ada) +by Martin Robertz *2021-06-26 18:04:54* + +**fixed another coil mistake in the MBF** + +[237d8f4585ae013](https://github.com///commit/237d8f4585ae013) +by boubou_19 *2021-06-26 17:56:23* + +**Merge pull request #10 from boubou19/master** +* fix MBF heat issues with new coils + +[fa26481f178fad9](https://github.com///commit/fa26481f178fad9) +by Martin Robertz *2021-06-24 20:31:06* + +**fix MBF heat issues with new coils** + +[1fee9b879a45aae](https://github.com///commit/1fee9b879a45aae) +by boubou_19 *2021-06-24 20:22:40* + +**Merge pull request #9 from GTNewHorizons/cal-oc-fix** +* Re-add CAL perfect overclock + +[f75c1c2b6e062fb](https://github.com///commit/f75c1c2b6e062fb) +by Martin Robertz *2021-06-20 21:26:53* + +**re-add perfect overclock to CAL** + +[e137d2fb58e4672](https://github.com///commit/e137d2fb58e4672) +by llk89 *2021-06-20 20:08:43* + +### No issue +**bump version** + +[ed0a2aca198234c](https://github.com///commit/ed0a2aca198234c) +by DreamMasterXXL *2021-06-15 19:57:19* + +**feat(textures): migrate to TextureFactory API and glow textures (#8)** +* - Migrate to the new implementation-free TextureFactory API. +* - Implement support for glow textures. + +[154b85fcf373469](https://github.com///commit/154b85fcf373469) +by Léa Gris *2021-05-25 15:47:44* + +**Merge pull request #7 from GTNewHorizons/fix_deprecated_CASING_BLOCKS** +* fix(texture): multiblock addressing deprecated array + +[1a4f57e86b13e0b](https://github.com///commit/1a4f57e86b13e0b) +by Martin Robertz *2021-05-22 22:12:34* + +**fix(texture): multiblock addressing deprecated array** +* replaces deprecated CASING_BLOCKS by getCasingTextureForId + +[16a8dcd3d780c1d](https://github.com///commit/16a8dcd3d780c1d) +by Léa Gris *2021-05-22 14:09:27* + +**Merge pull request #4 from GTNewHorizons/not-break-cracker** +* unbreak cracker structure + +[09553fd84b217bb](https://github.com///commit/09553fd84b217bb) +by Martin Robertz *2021-05-19 17:48:32* + +**Merge pull request #6 from GTNH-Afx237v7/master** +* fix MBF controller typo + +[59e0f02e4d1c523](https://github.com///commit/59e0f02e4d1c523) +by Martin Robertz *2021-05-17 17:44:45* + +**Merge pull request #5 from GTNewHorizons/patch-implosion-compressor** +* prevent resetPiston when machine not formed + +[2a4ce7bd5eb5fd0](https://github.com///commit/2a4ce7bd5eb5fd0) +by Ethryan *2021-05-17 10:48:03* + +**fix MBF controller typo** +* see https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/6912 + +[ba76318c4a0f84f](https://github.com///commit/ba76318c4a0f84f) +by GTNH-Afx237v7 *2021-05-17 08:55:07* + +**Fix buildscript** + +[f6ba20281fc61a9](https://github.com///commit/f6ba20281fc61a9) +by Glease *2021-05-17 00:57:58* + +**prevent resetPiston when machine not formed** + +[69032bec727fe9b](https://github.com///commit/69032bec727fe9b) +by Glease *2021-05-17 00:55:01* + +**remove unsused letter** + +[92802cc5888caf1](https://github.com///commit/92802cc5888caf1) +by korneel vandamme *2021-02-07 20:13:56* + +**unbreak cracker structure** + +[9bc7482c7b5c215](https://github.com///commit/9bc7482c7b5c215) +by korneel vandamme *2021-02-07 20:07:58* + +**Power pass upgrade (#125) (#3)** +* Implemented PowerPassUpgrade +* Fixes setBlock on adv. casings +* Configured code to use TecTech implementation of PowerPass +* Co-authored-by: bartimaeusnek <no-email> + +[0f823268177df2b](https://github.com///commit/0f823268177df2b) +by bartimaeusnek *2021-01-31 14:56:50* + +**Update MainMod.java** +* (cherry picked from commit c51b5fec03cb907f993609b984d346fad3e8a1c2) + +[e5f3536d9220bd6](https://github.com///commit/e5f3536d9220bd6) +by Martin Robertz *2021-01-30 10:03:48* + +**lets see if this works** +* (cherry picked from commit c525c3a6687832f4ba9c55e8978181ba723f2690) + +[602a9ff085bd250](https://github.com///commit/602a9ff085bd250) +by bartimaeusnek *2021-01-30 09:38:50* + +**Merge pull request #2 from bartimaeusnek/master** +* sync + +[ac1afbbb1d38f1c](https://github.com///commit/ac1afbbb1d38f1c) +by bartimaeusnek *2021-01-30 00:25:45* + +**New Casing from EmeraldsEmerald (#123)** + +[eb0d7a4a8bb7495](https://github.com///commit/eb0d7a4a8bb7495) +by basdxz *2021-01-25 20:47:37* + +### No issue +**bump version** + +[ac258b7f67c26e3](https://github.com///commit/ac258b7f67c26e3) +by DreamMasterXXL *2021-05-16 11:26:55* + +**Revert "bump version"** +* This reverts commit 932a62a34b2e8f311094baec3baf6ba65f266c1a. + +[371af8febf464a1](https://github.com///commit/371af8febf464a1) +by DreamMasterXXL *2021-05-16 11:26:37* + +**bump version** + +[932a62a34b2e8f3](https://github.com///commit/932a62a34b2e8f3) +by DreamMasterXXL *2021-05-16 11:26:04* + +**allwo for more recipes in the oilcracker (#128)** +* allow for more difrent recipes +* allows for more difrent recipes while still keeping hydrogen and steam in the middle +* remove extra space +* (cherry picked from commit e6baffb1b886c74789b97691c9f331c323b9a61f) + +[b419e0aa5af4ffb](https://github.com///commit/b419e0aa5af4ffb) +by botn365 *2021-04-16 18:43:36* + +**Removed old dependency annotation** +* (cherry picked from commit fa28b21c97ca3578791a80d5b576e1e9370393f0) + +[e03fbe8b4cf4689](https://github.com///commit/e03fbe8b4cf4689) +by bartimaeusnek *2021-03-12 10:39:43* + +**Resolve Cyclic Dependancy with miscutils** +* + also made gradle wait for deps by default. +* (cherry picked from commit f83de89d0cfac9dbd01b3e519f4c7c569da60ee1) + +[54c689c12f2bc34](https://github.com///commit/54c689c12f2bc34) +by bartimaeusnek *2021-03-12 09:22:45* + +**Added TGregworks integration (#126)** +* (cherry picked from commit 457c0b58698cb456b53eeede1f8f884587656dd2) + +[d15a07ea14bce24](https://github.com///commit/d15a07ea14bce24) +by bartimaeusnek *2021-03-03 18:35:41* + +**fixes Pyrolyse not checking top** +* (cherry picked from commit 0988abe6c1c6d3a0d9d4dfce7ba3782dcc1c0aaa) + +[afbe11010896cac](https://github.com///commit/afbe11010896cac) +by bartimaeusnek *2021-03-03 17:54:57* + +**revert** + +[a8347b7879ce951](https://github.com///commit/a8347b7879ce951) +by DreamMasterXXL *2021-02-26 06:27:12* + +**Merge remote-tracking branch 'BART/master'** + +[e5b83941435dbfd](https://github.com///commit/e5b83941435dbfd) +by DreamMasterXXL *2021-02-26 06:25:54* + +**Molten Recipe Changes and Refactor** +* (cherry picked from commit 58c1bf1bd33b714cb69a460a2a72105e0c61b06a) + +[75908f9985218f1](https://github.com///commit/75908f9985218f1) +by bartimaeusnek *2021-02-12 13:13:10* + +### No issue +**Molten Recipe Changes and Refactor** + +[58c1bf1bd33b714](https://github.com///commit/58c1bf1bd33b714) +by bartimaeusnek *2021-02-12 10:33:59* + +### No issue +**Re-Enable Client Side Warning** + +[64b72d3848bd93f](https://github.com///commit/64b72d3848bd93f) +by bartimaeusnek *2021-01-31 14:57:44* + +**Merge branch 'master' into master** + +[6637412e8ca9e5d](https://github.com///commit/6637412e8ca9e5d) +by bartimaeusnek *2021-01-31 14:56:38* + +**Power pass upgrade (#125)** +* Implemented PowerPassUpgrade +* Fixes setBlock on adv. casings +* Configured code to use TecTech implementation of PowerPass +* Co-authored-by: bartimaeusnek <no-email> + +[191ae1ba699d5b0](https://github.com///commit/191ae1ba699d5b0) +by bartimaeusnek *2021-01-31 14:55:21* + +### No issue +**Merge remote-tracking branch 'origin/master'** + +[6d936e451470af8](https://github.com///commit/6d936e451470af8) +by bartimaeusnek *2021-01-30 00:19:03* + +**Added bot's range** + +[7a6288b6b5041f8](https://github.com///commit/7a6288b6b5041f8) +by bartimaeusnek *2021-01-30 00:18:51* + +**remove client only config due to ASM Space issues** + +[56620f6f8f40ab5](https://github.com///commit/56620f6f8f40ab5) +by bartimaeusnek *2021-01-29 21:08:36* + +**Merge remote-tracking branch 'origin/master'** + +[58ed9019175d4c9](https://github.com///commit/58ed9019175d4c9) +by bartimaeusnek *2021-01-29 10:08:29* + +**Several fixes** + +[c5006ee765f083d](https://github.com///commit/c5006ee765f083d) +by bartimaeusnek *2021-01-29 10:06:03* + +### No issue +**Socket Time Out GitHub Actions** + +[a7d676c96bb3d90](https://github.com///commit/a7d676c96bb3d90) +by bartimaeusnek *2021-01-29 21:25:35* + +**SocketTime Out Travis** + +[257787a9aff803f](https://github.com///commit/257787a9aff803f) +by bartimaeusnek *2021-01-29 21:25:09* + +### No issue +**Adds Input Filters to TT Multis** + +[305cc469dc60785](https://github.com///commit/305cc469dc60785) +by bartimaeusnek *2021-01-11 17:37:23* + +### No issue +**Several fixes** + +[d1ffbd200edb4ec](https://github.com///commit/d1ffbd200edb4ec) +by bartimaeusnek *2021-01-11 16:44:17* + +### No issue +**Tanh speed improvement** + +[a811bd46d45ba07](https://github.com///commit/a811bd46d45ba07) +by bartimaeusnek *2021-01-05 22:00:01* + +### No issue +**Fixes setBlock on adv. casings** + +[eda3090a2a6504b](https://github.com///commit/eda3090a2a6504b) +by bartimaeusnek *2021-01-04 15:32:09* + +### No issue +**Round Up Replacement-Multiblocks** + +[398e0bcdf94fbc4](https://github.com///commit/398e0bcdf94fbc4) +by bartimaeusnek *2020-01-01 18:47:10* + +### No issue +**Fixed Tooltips & GUI for TT Replacements** + +[74d4e6d1f39daf8](https://github.com///commit/74d4e6d1f39daf8) +by bartimaeusnek *2020-12-31 22:51:49* + +### No issue +**EBF Heating Cap Fix** + +[e3398dbe8bc9f59](https://github.com///commit/e3398dbe8bc9f59) +by bartimaeusnek *2020-12-29 16:15:41* + +### No issue +**Added Multi Smelter TT Replacement** +* Updated Coil Logic + +[205579baab63a75](https://github.com///commit/205579baab63a75) +by bartimaeusnek *2020-12-29 12:35:25* + -- cgit From 39cd394415c0b054bac8d98c5f4f6cb9e227fd4f Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Thu, 1 Jul 2021 17:06:43 +0800 Subject: Do not overwrite localized name with default name Former-commit-id: 7bf016c002e77d175b9241fce0410e02548494d5 --- .../werkstoff_loaders/registration/BridgeMaterialsLoader.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java index f61ce70c81..d3a5d79729 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java @@ -100,11 +100,6 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { } werkstoffBridgeMaterial.mName = werkstoff.getVarName(); werkstoffBridgeMaterial.mDefaultLocalName = werkstoff.getDefaultName(); - try { - Field f = Materials.class.getField("mLocalizedName"); - f.set(werkstoffBridgeMaterial, werkstoff.getDefaultName()); - } catch (NoSuchFieldException | IllegalAccessException ignored) { - } werkstoffBridgeMaterial.mChemicalFormula = werkstoff.getToolTip(); if (LoaderReference.Thaumcraft) werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects(); @@ -119,4 +114,4 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { } } } -} \ No newline at end of file +} -- cgit From cd44668a0907a06a427b6895bae46864bff97f4e Mon Sep 17 00:00:00 2001 From: Prometheus0000 Date: Sat, 3 Jul 2021 16:43:56 -0400 Subject: Get rid of BW cheese Former-commit-id: 18c864a71235c44113203a6eb684e80a8653d078 --- .../bartworks/system/material/BW_GT_MaterialReference.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java index f22d9ac470..6d1463bdfd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java @@ -140,7 +140,7 @@ public class BW_GT_MaterialReference { public static Werkstoff Wood = new Werkstoff(Materials.Wood, ADD_CASINGS_ONLY, BIOLOGICAL,31_766+809); // public static Werkstoff WoodSealed = new Werkstoff(Materials.WoodSealed, ADD_CASINGS_ONLY, BIOLOGICAL,31_766+889); - public static Werkstoff Cheese = new Werkstoff(Materials.Cheese, new Werkstoff.GenerationFeatures().addCasings().addMetalItems().addMultipleIngotMetalWorkingItems().enforceUnification(), BIOLOGICAL,31_766+894); + //public static Werkstoff Cheese = new Werkstoff(Materials.Cheese, new Werkstoff.GenerationFeatures().addCasings().addMetalItems().addMultipleIngotMetalWorkingItems().enforceUnification(), BIOLOGICAL,31_766+894); public static Werkstoff Steel = new Werkstoff(Materials.Steel, ADD_CASINGS_ONLY, COMPOUND,31_766+305); public static Werkstoff Polytetrafluoroethylene = new Werkstoff(Materials.Polytetrafluoroethylene, ADD_CASINGS_ONLY, COMPOUND,31_766+473); -- cgit From 56bc41911b8ec8c6113e8ef43934a987c7108e19 Mon Sep 17 00:00:00 2001 From: GTNH-Afx237v7 <64365566+GTNH-Afx237v7@users.noreply.github.com> Date: Sun, 4 Jul 2021 14:55:02 +0200 Subject: Fix biso/triso typo Former-commit-id: 199cfddc6dd59fc4b0a44ca66527a17492a61c52 --- src/main/resources/assets/bartworks/lang/en_US.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 7448af3917..98482e3482 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -149,8 +149,8 @@ item.TRISOPellet.name=TRISO pebble item.TRISOPelletBall.name=TRISO pebble ball item.BISOPelletBall.name=BISO pebble ball item.BISOPellet.name=BISO pebble -item.TRISOPelletCompound.name=TRISO pebble compund -item.BISOPelletCompound.name=BISO pebble compund +item.TRISOPelletCompound.name=TRISO pebble compound +item.BISOPelletCompound.name=BISO pebble compound item.BurnedOutBISOPelletBall.name=Burned Out BISO pebble ball item.BurnedOutBISOPellet.name=Burned Out BISO pebble item.BurnedOutTRISOPelletBall.name=Burned Out TRISO pebble ball -- cgit From c047cd309d35bc6eceb01f24a98ab96c7da04f88 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Sat, 17 Jul 2021 17:39:56 +0200 Subject: fix void miner drops in the twilight forest Former-commit-id: eff10776ce76b21b7c7a56b7bd040a41150866e0 --- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 44 +++++++++++++++------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index f4400fab11..6a8eaefa9c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -48,6 +48,7 @@ import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; import net.minecraft.world.gen.ChunkProviderServer; import net.minecraftforge.fluids.FluidStack; @@ -168,31 +169,46 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } private Predicate makeOreLayerPredicate() { - switch (this.getBaseMetaTileEntity().getWorld().provider.dimensionId) { + World world = this.getBaseMetaTileEntity().getWorld(); + switch (world.provider.dimensionId) { case -1: return gt_worldgen -> gt_worldgen.mNether; case 0: return gt_worldgen -> gt_worldgen.mOverworld; case 1: return gt_worldgen -> gt_worldgen.mEnd || gt_worldgen.mEndAsteroid; + case 7: + /* + explicitely giving different dim numbers so it default to false in the config, keeping compat + with the current worldgen config + */ + + return gt_worldgen -> gt_worldgen.isGenerationAllowed(world, 0, 7); default: throw new IllegalStateException(); } } - + private Predicate makeSmallOresPredicate() { - switch (this.getBaseMetaTileEntity().getWorld().provider.dimensionId) { + World world = this.getBaseMetaTileEntity().getWorld(); + switch (world.provider.dimensionId) { case -1: return gt_worldgen -> gt_worldgen.mNether; case 0: return gt_worldgen -> gt_worldgen.mOverworld; case 1: return gt_worldgen -> gt_worldgen.mEnd; + case 7: + /* + explicitely giving different dim numbers so it default to false in the config, keeping compat + with the current worldgen config + */ + return gt_worldgen -> gt_worldgen.isGenerationAllowed(world, 0, 7); default: throw new IllegalStateException(); } } - + private void getDropsVanillaVeins(Predicate oreLayerPredicate) { GT_Worldgen_GT_Ore_Layer.sList.stream().filter(gt_worldgen -> gt_worldgen.mEnabled && oreLayerPredicate.test(gt_worldgen)).forEach(element -> { dropmap.put(new Pair<>((int) element.mPrimaryMeta,false), (float) element.mWeight); @@ -208,17 +224,17 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri dropmap.put(new Pair<>((int) element.mMeta,false), (float) element.mAmount) ); } - + private void getDropMapVanilla() { getDropsVanillaVeins(makeOreLayerPredicate()); getDropsVanillaSmallOres(makeSmallOresPredicate()); } - + private void getDropMapSpace(ModDimensionDef finalDef) { getDropsOreVeinsSpace(finalDef); getDropsSmallOreSpace(finalDef); } - + private void getDropsOreVeinsSpace(ModDimensionDef finalDef) { Set space = GalacticGreg.oreVeinWorldgenList.stream() .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof GT_Worldgen_GT_Ore_Layer_Space && ((GT_Worldgen_GT_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) @@ -286,7 +302,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri if (storedNobleGas == null || !consumeNobleGas(storedNobleGas)) multiplier = TIER_MULTIPLIER; } - + private void getDropMapBartworks(ModDimensionDef finalDef, int aID) { Consumer addToList = makeAddToList(); if (aID == ConfigHandler.ross128BID) @@ -310,7 +326,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } }; } - + private ModDimensionDef makeModDimDef() { return getModContainers().stream() .flatMap(modContainer -> modContainer.getDimensionList().stream()) @@ -318,7 +334,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri .equals(((ChunkProviderServer) this.getBaseMetaTileEntity().getWorld().getChunkProvider()).currentChunkProvider.getClass().getName())) .findFirst().orElse(null); } - + private void addOresVeinsBartworks(ModDimensionDef finalDef, Consumer addToList) { try { Set space = GalacticGreg.oreVeinWorldgenList.stream() @@ -328,7 +344,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri space.forEach(addToList); } catch (NullPointerException ignored) {} } - + private void addSmallOresBartworks(ModDimensionDef finalDef) { try { Set space = GalacticGreg.smallOreWorldgenList.stream() @@ -341,7 +357,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri ); } catch (NullPointerException ignored) {} } - + private void handleExtraDrops(int id) { Optional.ofNullable(getExtraDropsDimMap().get(id)).ifPresent(e -> e.forEach(f -> dropmap.put(f.getKey(), f.getValue()))); } @@ -357,7 +373,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } private void handleModDimDef(int id) { - if (id <= 1 && id >= -1) + if ((id <= 1 && id >= -1) || id == 7) getDropMapVanilla(); Optional.ofNullable(makeModDimDef()).ifPresent(def -> { handleDimBasedDrops(def, id); @@ -375,7 +391,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private void makeDropMap() { if (dropmap == null || totalWeight == 0) - calculateDropMap(); + calculateDropMap(); } private void handleOutputs() { -- cgit From 49032880ffc961624004cf933bdfb22f92a5a929 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Sun, 18 Jul 2021 01:22:57 +0200 Subject: removed bus limitation on the CAL Former-commit-id: 1a82db4ce0edbaa2cfd500156009cfe1d4042080 --- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 37 +--------------------- 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 6d9b140e44..69dab9a8cc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -285,41 +285,6 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl return this.mEnergyHatches.size() == 1 && this.mMaintenanceHatches.size() == 1; } - @Override - public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - ((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus && ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mTier == 0) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - ((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); - } else { - return false; - } - } - } - - @Override - public boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus && ((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity).mTier == 0) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus)aMetaTileEntity); - } else { - return false; - } - } - } - @Override public int getMaxEfficiency(ItemStack itemStack) { return 10000; @@ -348,7 +313,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl private static final String[] DESCRIPTION = new String[]{ "Circuit Assembly Line", "Size(WxHxD): (2-7)x3x3, variable length", "Bottom: Steel Machine Casing(or 1x Maintenance or Input Hatch),", - "ULV Input Bus (Last ULV Output Bus), Steel Machine Casing", + "Input Bus (Last Output Bus), Steel Machine Casing", "Middle: EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass", "Top: Grate Machine Casing (or Controller or 1x Energy Hatch)", "Up to 7 repeating slices, last is Output Bus", -- cgit From 25c2d642da5b87ab717568d102b281ee62c87785 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Sun, 18 Jul 2021 03:21:19 +0200 Subject: readd input limitation to avoid players using only the first input bus Former-commit-id: 4d29e7b45b916e4f771042856e1ca5de5c66f09d --- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 69dab9a8cc..8db536319a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -285,6 +285,26 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl return this.mEnergyHatches.size() == 1 && this.mMaintenanceHatches.size() == 1; } + @Override + public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); + return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus && ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mTier == 0) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); + return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + } else { + return false; + } + } + } + @Override public int getMaxEfficiency(ItemStack itemStack) { return 10000; @@ -313,7 +333,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl private static final String[] DESCRIPTION = new String[]{ "Circuit Assembly Line", "Size(WxHxD): (2-7)x3x3, variable length", "Bottom: Steel Machine Casing(or 1x Maintenance or Input Hatch),", - "Input Bus (Last Output Bus), Steel Machine Casing", + "ULV Input Bus (Last Output Bus), Steel Machine Casing", "Middle: EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass", "Top: Grate Machine Casing (or Controller or 1x Energy Hatch)", "Up to 7 repeating slices, last is Output Bus", -- cgit From cd35ba7634c1e156bd8d47183bf0bb63f2c26748 Mon Sep 17 00:00:00 2001 From: GlodBlock <60341015+GlodBlock@users.noreply.github.com> Date: Wed, 21 Jul 2021 20:34:24 +0800 Subject: reserve werkstoff id Former-commit-id: f003dc953322e0185852ee0b9f2fe6d43979b36c --- .../bartimaeusnek/bartworks/system/material/WerkstoffLoader.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index d63bff14dc..99164f0510 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -191,8 +191,9 @@ public class WerkstoffLoader { } //TODO: - //FREE ID RANGE: 10_001-28_998 + //FREE ID RANGE: 11_000-28_998 //bartimaeusnek reserved 0-10_000 + //GlodBlock reserved range 10_001-10_999 //bot reserved range 29_899-29_999 //Tec & basdxz reserved range 30_000-31_000 //GT Material range reserved on 31_767-32_767 @@ -1864,4 +1865,4 @@ public class WerkstoffLoader { GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite)); } -} \ No newline at end of file +} -- cgit From f5729c0aa7f818e09f299ce2fcd8b243f79042d0 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Tue, 27 Jul 2021 02:54:46 +0800 Subject: adjust multiblocks to work with structurelib Former-commit-id: a0f63ca13bdfec42f849ced647d0146d76c3b735 --- .gitignore | 1 + build.gradle.kts | 3 +- .../tileentities/multis/GT_TileEntity_DEHP.java | 40 ++- .../mega/GT_TileEntity_MegaBlastFurnace.java | 240 +++++++------ .../mega/GT_TileEntity_MegaDistillTower.java | 230 ++++++++----- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 10 + .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 12 - .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 42 ++- .../multi/GT_Replacement/BW_TT_HeatExchanger.java | 369 -------------------- .../GT_Replacement/TT_Abstract_GT_Replacement.java | 110 ------ .../TT_Abstract_GT_Replacement_Coils.java | 27 -- .../GT_Replacement/TT_ElectronicBlastFurnace.java | 375 --------------------- .../GT_Replacement/TT_ImplosionCompressor.java | 248 -------------- .../multi/GT_Replacement/TT_MultiSmelter.java | 269 --------------- .../multi/GT_Replacement/TT_OilCrackingUnit.java | 314 ----------------- .../multi/GT_Replacement/TT_PyrolyseOven.java | 231 ------------- .../multi/GT_Replacement/TT_VacuumFreezer.java | 195 ----------- 17 files changed, 340 insertions(+), 2376 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement_Coils.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java diff --git a/.gitignore b/.gitignore index f338842ce1..685344bb21 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,4 @@ SetupWorkspaces.bat SetupDevWorkspaces.bat Idea.bat *.bat +.idea \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 35e7681226..9e27f59691 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -128,9 +128,10 @@ dependencies { //hard deps compile("net.industrial-craft:industrialcraft-2:$ic2Version:dev") //jitpack - compile("com.github.GTNewHorizons:GT5-Unofficial:experimental-SNAPSHOT:dev") { + compile("com.github.GTNewHorizons:GT5-Unofficial:structurelib-integration-SNAPSHOT:dev") { this.isChanging = true } + compile ("com.github.GTNewHorizons:StructureLib:1.0.6:deobf") compile("com.github.GTNewHorizons:TinkersConstruct:master-SNAPSHOT:deobf") { this.isChanging = true } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index 35e9667204..381d17463f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -32,6 +33,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.util.GT_Config; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; import ic2.core.block.reactor.tileentity.TileEntityNuclearReactorElectric; @@ -45,6 +47,8 @@ import net.minecraftforge.fluids.FluidRegistry; import java.lang.reflect.Field; import java.util.Arrays; +import static gregtech.api.enums.GT_Values.VN; + public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { private static float nulearHeatMod = 2f; private byte mMode; @@ -99,10 +103,36 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { } @Override - public String[] getDescription() { - String[] dscSteam = {"Controller Block for the Deep Earth Heat Pump " + (this.mTier > 1 ? this.mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + this.getCasingBlockItem().name(), "1x3x1 " + this.getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)", "1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", "Consumes " + GT_Values.V[this.mTier + 2] + "EU/t", "Has 4 Modes, use the Screwdriver to change them:", "0 Idle, 1 Steam, 2 Superheated Steam (requires Distilled Water), 3 Retract", "Explodes when it runs out of Water/Distilled Water", "Converts " + (long) (this.mTier * 1200 * 20) + "L/s Water(minus 10% per Maintenance Problem) to Steam", "Converts " + (long) (this.mTier * 600 * 20) + "L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"}; - String[] dscCooleant = {"Controller Block for the Deep Earth Heat Pump " + (this.mTier > 1 ? this.mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + this.getCasingBlockItem().name(), "1x3x1 " + this.getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)", "1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", "Consumes " + GT_Values.V[this.mTier + 2] + "EU/t", "Has 4 Modes, use the Screwdriver to change them:", "0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract", "Explodes when it runs out of Coolant", "Heats up " + (long) (this.mTier * 24 * ((double) GT_TileEntity_DEHP.nulearHeatMod)) * 20 + "L/s Coolant(minus 10% per Maintenance Problem)"}; - return ConfigHandler.DEHPDirectSteam ? dscSteam : dscCooleant; + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + String casings = getCasingBlockItem().get(0).getDisplayName(); + tt.addMachineType("Geothermal Heat Pump") + .addInfo("Consumes " + GT_Values.V[this.mTier + 2] + "EU/t") + .addInfo("Has 4 Modes, use the Screwdriver to change them:"); + if (ConfigHandler.DEHPDirectSteam) { + tt.addInfo("0 Idle, 1 Steam, 2 Superheated Steam (requires Distilled Water), 3 Retract") + .addInfo("Explodes when it runs out of Water/Distilled Water") + .addInfo("Converts " + (long) (this.mTier * 1200 * 20) + "L/s Water(minus 10% per Maintenance Problem) to Steam") + .addInfo("Converts " + (long) (this.mTier * 600 * 20) + "L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"); + + } else { + tt.addInfo("0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract") + .addInfo("Explodes when it runs out of Coolant") + .addInfo("Heats up " + (long) (this.mTier * 24 * ((double) GT_TileEntity_DEHP.nulearHeatMod)) * 20 + "L/s Coolant(minus 10% per Maintenance Problem)"); + } + tt.addSeparator() + .beginStructureBlock(3, 7, 3, false) + .addController("Front bottom") + .addStructureInfo(casings + " form the 3x1x3 Base") + .addOtherStructurePart(casings, " 1x3x1 pillar above the center of the base (2 minimum total)") + .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing") + .addMaintenanceHatch("Any base casing") + .addInputBus("Mining Pipes, optional, any base casing") + .addInputHatch("Any base casing") + .addOutputHatch("Any base casing") + .toolTipFinisher(BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); + return tt; } @Override @@ -188,7 +218,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { return true; } - if (!this.tryLowerPipe()) { + if (tryLowerPipeState(false) != 0) { if (this.waitForPipes()) { return false; } else { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 74e540f46e..f13352e09d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -23,7 +23,6 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.API.LoaderReference; -import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; @@ -32,49 +31,94 @@ import com.github.bartimaeusnek.bartworks.util.MegaUtils; import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.LowPowerLaser; +import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; +import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import java.lang.reflect.Field; import java.util.*; import java.util.stream.Collectors; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAdder; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.util.GT_StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBlastFurnace implements TecTechEnabledMulti { + private static final int CASING_INDEX = 11; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape("main", createShape()) + .addElement('t', ofHatchAdderOptional(GT_TileEntity_MegaBlastFurnace::addOutputHatchToTopList, CASING_INDEX, 1, GregTech_API.sBlockCasings1, CASING_INDEX)) + .addElement('m', ofHatchAdder(GT_TileEntity_MegaBlastFurnace::addMufflerToMachineList, CASING_INDEX, 2)) + .addElement('C', ofCoil(GT_TileEntity_MegaBlastFurnace::setCoilLevel, GT_MetaTileEntity_ElectricBlastFurnace::getCoilLevel)) + .addElement('g', ofBlockAdder(GT_TileEntity_MegaBlastFurnace::addGlas, ItemRegistry.bw_glasses[0], 1)) + .addElement('b', ofHatchAdderOptional(GT_TileEntity_MegaBlastFurnace::addBottomHatch, CASING_INDEX, 3, GregTech_API.sBlockCasings1, CASING_INDEX)) + .build(); + + private static String[][] createShape() { + String[][] raw = new String[20][]; + + raw[0] = new String[15]; + String topCasing = "ttttttttttttttt"; + String mufflerLine = "tmmmmmmmmmmmmmt"; + raw[0][0] = topCasing; + for (int i = 1; i < 14; i++) { + raw[0][i] = mufflerLine; + } + raw[0][14] = topCasing; + + raw[1] = new String[15]; + String allGlass = "ggggggggggggggg"; + String allCoil = "gCCCCCCCCCCCCCg"; + String middleLine = "gC-----------Cg"; + raw[1][0] = allGlass; + raw[1][1] = allCoil; + raw[1][13] = allCoil; + raw[1][14] = allGlass; + for (int i = 2; i < 13; i++) { + raw[1][i] = middleLine; + } + for (int i = 2; i < 19; i++) { + raw[i] = raw[1]; + } + String bottomCasing = "bbbbbbbbbbbbbbb"; + raw[19] = new String[15]; + for (int i = 0; i < 15; i++) { + raw[19][i] = bottomCasing; + } + + raw[17] = Arrays.copyOf(raw[17], raw[17].length); + raw[17][0] = "ggggggg~ggggggg"; + + return transpose(raw); + } + private int mHeatingCapacity; private byte glasTier; private int polPtick = super.getPollutionPerTick(null) * ConfigHandler.megaMachinesMax; - static Field controllerY; - - static { - try { - controllerY = GT_MetaTileEntity_ElectricBlastFurnace.class.getDeclaredField("controllerY"); - } catch (NoSuchFieldException e) { - MainMod.LOGGER.catching(e); - } - controllerY.setAccessible(true); - } public GT_TileEntity_MegaBlastFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -84,16 +128,36 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl super(aName); } - public String[] getDescription() { - String[] dsc = StatCollector.translateToLocal("tooltip.tile.mbf.0.name").split(";"); - String tmp = dsc[dsc.length - 1]; - dsc[dsc.length - 1] = tmp + " " + 20 * this.getPollutionPerTick(null) + " " + StatCollector.translateToLocal("tooltip.tile.mbf.1.name"); - String[] fdsc = new String[dsc.length + 1]; - for (int i = 0; i < dsc.length; i++) { - fdsc[i] = dsc[i]; - fdsc[dsc.length] = BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get(); - } - return fdsc; + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Blast Furnace") + .addInfo("Controller block for the Mega Blast Furnace") + .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") + .addInfo("Each 900K over the min. Heat required multiplies EU/t by 0.95") + .addInfo("Each 1800K over the min. Heat required allows for one upgraded overclock instead of normal") + .addInfo("Upgraded overclocks reduce recipe time to 25% (instead of 50%) and increase EU/t to 400%") + .addInfo("Additionally gives +100K for every tier past MV") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(15, 20, 15, true) + .addController("Front bottom") + .addCasingInfo("Heat Proof Machine Casing", 0) + .addOtherStructurePart("Heating Coils", "Inner 13x18x13 (Hollow)") + .addOtherStructurePart("Borosilicate Glass", "Outer 15x18x15") + .addStructureInfo("The glass tier limits the Energy Input tier") + .addEnergyHatch("Any bottom layer casing") + .addMaintenanceHatch("Any bottom layer casing") + .addMufflerHatch("Top middle 13x13") + .addInputBus("Any bottom layer casing") + .addInputHatch("Any bottom layer casing") + .addOutputBus("Any bottom layer casing") + .addOutputHatch("Gasses, Any top layer casing") + .addStructureInfo("Recovery amount scales with Muffler Hatch tier") + .addOutputHatch("Platline fluids, Any bottom layer casing") + .addStructureHint("This Mega Multiblock is too big to have its structure hologram displayed fully.") + .toolTipFinisher(BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); + return tt; } @SuppressWarnings("rawtypes") @@ -223,6 +287,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return timesOverclocked; } + @Override public String[] getInfoData() { int mPollutionReduction = 0; @@ -263,60 +328,6 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return super.getMaxInputVoltage(); } - private boolean getCoilHeat(IGregTechTileEntity iGregTechTileEntity, int y) { - int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 7; - int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 7; - int internalH = 0; - for (int x = -6; x <= 6; x++) { - for (int z = -6; z <= 6; z++) { - if (Math.abs(x) < 6 && Math.abs(z) != 6) - continue; - byte tUsedMeta = iGregTechTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); - switch (tUsedMeta) { - case 0: // cupronickel coil - internalH = 1801; - break; - case 1: // Kanthal coil - internalH = 2701; - break; - case 2: // nichrome coil - internalH = 3601; - break; - case 3: // tungstensteel coil - internalH = 4501; - break; - case 4: // HSS-G coil - internalH = 5401; - break; - case 5: // naquadah coil - internalH = 7201; - break; - case 6: // naquadah alloy coil - internalH = 8101; - break; - case 7: // fluxed electrum coil - internalH = 9901; - break; - case 8: // awakened draconium coil - internalH = 10801; - break; - case 9: // HSS-S coil - internalH = 6301; - break; - case 10: // trinium coil - internalH = 9001; - default: - break; - } - if (this.mHeatingCapacity > 0 && internalH != this.mHeatingCapacity) - return false; - else if (this.mHeatingCapacity == 0) - this.mHeatingCapacity = internalH; - } - } - return true; - } - @Override public int getPollutionPerTick(ItemStack aStack) { return this.polPtick; @@ -409,45 +420,54 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl } @Override - public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - try { - controllerY.set(this, iGregTechTileEntity.getYCoord() - 2); - } catch (IllegalAccessException e) { - MainMod.LOGGER.catching(e); - } + protected IAlignmentLimits getInitialAlignmentLimits() { + return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && f.isNotFlipped(); + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public IStructureDefinition getStructureDefinition() { + // hack to get around generic + return (IStructureDefinition) STRUCTURE_DEFINITION; + } + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece("main", stackSize, hintsOnly, 7, 17, 0); + } + + private boolean addGlas(Block block, int meta) { + if (block != ItemRegistry.bw_glasses[0]) + return false; + byte tier = BW_Util.getTierFromGlasMeta(meta); + if (glasTier > 0) + return tier == glasTier; + glasTier = tier; + return true; + } + + @Override + public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { if (LoaderReference.tectech) { this.getTecTechEnergyMultis().clear(); this.getTecTechEnergyTunnels().clear(); } this.mHeatingCapacity = 0; - boolean ret; - ret = BW_Util.check_layer(iGregTechTileEntity, 7, -2, -1, GregTech_API.sBlockCasings1, 11, 7, false, false, true, GregTech_API.sBlockCasings1, 11, true, 11); - ret &= BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11); - ret &= BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11); - - for (int y = -1; y < 17; y++) { - ret &= BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, false, 11); - if (!this.getCoilHeat(iGregTechTileEntity, y)) - return false; - List metasFromLayer = BW_Util.getMetasFromLayer(iGregTechTileEntity, 7, y, y + 1, 7, y == 0, false, false); - for (Byte meta : metasFromLayer) { - byte inttier = BW_Util.getTierFromGlasMeta(meta); - if (this.glasTier > 0 && inttier != this.glasTier) - return false; - else if (this.glasTier == 0) - this.glasTier = inttier; - } - } + glasTier = 0; - int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 7; - int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 7; + setCoilLevel(HeatingCoilLevel.None); - for (int z = -6; z <= 6; z++) - for (int x = -6; x <= 6; x++) - if (!this.addMufflerToMachineList(iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + x, 17, zDir + z), 11)) - return false; + this.mPollutionOutputHatches.clear(); + + if (!checkPiece("main", 7, 17, 0)) + return false; + + if (getCoilLevel() == HeatingCoilLevel.None) + return false; + + if (mMaintenanceHatches.size() != 1) + return false; if (LoaderReference.tectech && this.glasTier != 8) if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) @@ -458,7 +478,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl if (this.glasTier < hatchEnergy.mTier) return false; - return ret && !this.mMaintenanceHatches.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mInputBusses.isEmpty(); + this.mHeatingCapacity = (int) getCoilLevel().getHeat() + 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 2); + + return true; } @SuppressWarnings("rawtypes") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 64b0dd182f..7c1f13d200 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -24,25 +24,111 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.*; -import com.google.common.collect.ArrayListMultimap; +import com.gtnewhorizon.structurelib.StructureLibAPI; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.IStructureElement; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DistillationTower; -import net.minecraft.block.Block; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; +import java.util.List; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_DistillationTower { + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][]{ + {"bbbbbbb~bbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb"}, + })) + .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][]{ + {"lllllllllllllll", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lllllllllllllll"}, + {"lllllllllllllll", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "lllllllllllllll"}, + {"lllllllllllllll", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "lllllllllllllll"}, + {"lllllllllllllll", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "lllllllllllllll"}, + {"lllllllllllllll", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "lllllllllllllll"}, + })) + .addElement('b', ofChain( + ofHatchAdder(GT_TileEntity_MegaDistillTower::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_MegaDistillTower::addOutputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_MegaDistillTower::addInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_MegaDistillTower::addMaintenanceToMachineList, CASING_INDEX, 1), + onElementPass(GT_TileEntity_MegaDistillTower::onCasingFound, ofBlock(GregTech_API.sBlockCasings4, 1)) + )) + .addElement('l', ofChain( + ofHatchAdder(GT_TileEntity_MegaDistillTower::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_MegaDistillTower::addLayerOutputHatch, CASING_INDEX, 2), + ofHatchAdder(GT_TileEntity_MegaDistillTower::addMaintenanceToMachineList, CASING_INDEX, 1), + onElementPass(GT_TileEntity_MegaDistillTower::onCasingFound, ofBlock(GregTech_API.sBlockCasings4, 1)) + )) + // this one is too complex and cannot be expressed with a combination of existing IStructureElement + .addElement('c', new IStructureElement() { + @Override + public boolean check(GT_TileEntity_MegaDistillTower t, World world, int x, int y, int z) { + if (world.isAirBlock(x, y, z)) { + if (t.mTopState < 1) { + t.mTopState = 0; + return true; + } + // definitely top - cannot be air + return false; + } + // from here on we must be looking at a top layer, since it's not air + if (t.mTopState == 0) + // must be air but failed, so no + return false; + t.mTopState = 1; + // hatch adder + TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity instanceof IGregTechTileEntity) { + IGregTechTileEntity entity = (IGregTechTileEntity) tileEntity; + if (t.addLayerOutputHatch(entity, CASING_INDEX)) { + t.onTopLayerFound(false); + return true; + } + } + // block adder + if(world.getBlock(x, y, z) == GregTech_API.sBlockCasings4 && world.getBlockMetadata(x, y, z) == 1) { + t.onTopLayerFound(true); + return true; + } else { + return false; + } + } + + @Override + public boolean spawnHint(GT_TileEntity_MegaDistillTower t, World world, int x, int y, int z, ItemStack trigger) { + if (trigger.stackSize == 1) + StructureLibAPI.hintParticle(world, x, y, z, GregTech_API.sBlockCasings4, 1); + return true; + } - private static final int CASING_INDEX = 49; + @Override + public boolean placeBlock(GT_TileEntity_MegaDistillTower t, World world, int x, int y, int z, ItemStack trigger) { + if (trigger.stackSize == 1) { + world.setBlock(x, y, z, GregTech_API.sBlockCasings4, 1, 3); + return true; + } + world.setBlockToAir(x, y, z); + return false; + } + } + ) + .build(); + + // -1 => maybe top, maybe not, 0 => definitely not top, 1 => definitely top + private int mTopState = -1; public GT_TileEntity_MegaDistillTower(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -58,106 +144,64 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati } @Override - public String[] getDescription() { - return new String[]{ - "Controller Block for the Mega Distillation Tower", - "Size(WxHxD): 15xhx15 (Hollow), with h ranging from 16 to 56", - "Controller (Front bottom)", - "1+ Input Hatch (Any bottom layer casing)", - "1+ Output Bus (Any bottom layer casing)", - "An \"Output Layer\" consists of 5 layers!", - "2-11+ Output Hatch (One or more per Output Layer)", - "1x Maintenance Hatch (Any casing)", - "1+ Energy Hatch (Any casing)", - "Fluids are only put out at the correct height", - "The correct height equals the slot number in the NEI recipe", - "Clean Stainless Steel Machine Casings for the rest (15 x h - 5 at least!)", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() - }; + protected GT_Multiblock_Tooltip_Builder createTooltip() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Distillery") + .addInfo("Controller block for the Distillation Tower") + .addInfo("Fluids are only put out at the correct height") + .addInfo("The correct height equals the slot number in the NEI recipe") + .addSeparator() + .beginVariableStructureBlock(15, 15, 16, 56, 15, 15, true) + .addController("Front bottom") + .addOtherStructurePart("Clean Stainless Steel Machine Casing", "15 x h - 5 (minimum)") + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addInputHatch("Any bottom layer casing") + .addOutputBus("Any bottom layer casing") + .addOutputHatch("2-11x Output Hatches (One per Output Layer except bottom layer)") + .addStructureInfo("An \"Output Layer\" consists of 5 layers!") + .addStructureHint("This Mega Multiblock is too big to have its structure hologram displayed fully.") + .toolTipFinisher(BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); + return tt; } - private short controllerY = 0; - @Override - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - LAYERMAP.clear(); - controllerY = aBaseMetaTileEntity.getYCoord(); - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 7; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 7; - int x, z, y = 0, casingAmount = 0; - boolean reachedTop = false; - - IGregTechTileEntity tileEntity; - Block block; - for (x = xDir - 7; x <= xDir + 7; ++x) { - for (z = zDir - 7; z <= zDir + 7; ++z) { - if (x != 0 || z != 0) { - tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z); - block = aBaseMetaTileEntity.getBlockOffset(x, y, z); - if (!this.addInputToMachineList(tileEntity, CASING_INDEX) && !this.addOutputToMachineList(tileEntity, CASING_INDEX) && !this.addMaintenanceToMachineList(tileEntity, CASING_INDEX) && !this.addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { - if (block != GregTech_API.sBlockCasings4 || aBaseMetaTileEntity.getMetaIDOffset(x, y, z) != 1) { - return false; - } + @SuppressWarnings({"rawtypes", "unchecked"}) + public IStructureDefinition getStructureDefinition() { + return (IStructureDefinition) STRUCTURE_DEFINITION; + } - ++casingAmount; - } - } - } - } - for (y = y + 1; y <= 60 && !reachedTop; ++y) { - for (x = -7; x <= 7; ++x) { - for (z = -7; z <= 7; ++z) { - tileEntity = aBaseMetaTileEntity.getIGregTechTileEntity(aBaseMetaTileEntity.getXCoord() + xDir + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + zDir + z); - block = aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getXCoord() + xDir + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + zDir + z); - final boolean middle = Math.abs(x) < 7 && Math.abs(z) != 7; - if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getXCoord() + xDir + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + zDir + z)) { - if (!middle) { - //aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getXCoord() + xDir + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + zDir + z,GregTech_API.sBlockCasings4,1,2); - return false; - } - } else { - if (middle) { - reachedTop = true; - } - if (!this.addOutputToMachineList(tileEntity, CASING_INDEX) && !this.addMaintenanceToMachineList(tileEntity, CASING_INDEX) && !this.addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { - if (block != GregTech_API.sBlockCasings4 || aBaseMetaTileEntity.getMetaID(aBaseMetaTileEntity.getXCoord() + xDir + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + zDir + z) != 1) { - return false; - } + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + // reset + mOutputHatchesByLayer.forEach(List::clear); + mHeight = 1; + mTopLayerFound = false; + mTopState = -1; - ++casingAmount; - } - } - } - } - } + // check base + if (!checkPiece(STRUCTURE_PIECE_BASE, 7, 0, 0)) + return false; - return casingAmount >= 15 * y - 5 && y >= 16 && y <= 56 && reachedTop; - } + // check each layer + while (mHeight < 12 && checkPiece(STRUCTURE_PIECE_LAYER, 7, mHeight * 5, 0) && !mTopLayerFound) { + if (mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) + // layer without output hatch + return false; + mTopState = -1; + // not top + mHeight++; + } - @Override - public boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (super.addOutputToMachineList(aTileEntity, aBaseCasingIndex)) { - if (aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output) { - int layer = aTileEntity.getYCoord() - controllerY; - layer = MathUtils.ceilInt(((double)layer) /5D)-1; - LAYERMAP.put(layer,(GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity()); - } - return true; - } - return false; + // validate final invariants... + return mCasing >= 75 * mHeight + 10 && mHeight >= 2 && mTopLayerFound && mMaintenanceHatches.size() == 1; } @Override - protected void addFluidOutputs(FluidStack[] mOutputFluids2) { - for (int i = 0; i < mOutputFluids2.length; i++) { - for (int j = 0; j < LAYERMAP.get(i).size(); j++) { - LAYERMAP.get(i).get(j).fill(new FluidStack(mOutputFluids2[i],mOutputFluids2[i].amount/LAYERMAP.get(i).size()), true); - } - } + public void construct(ItemStack stackSize, boolean hintsOnly) { + // no op, to big to be displayed } - private final ArrayListMultimap LAYERMAP = ArrayListMultimap.create(); - @Override public boolean checkRecipe(ItemStack aStack) { ArrayList tFluidList = this.getStoredFluids(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index e93d7342eb..865f06e6a7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -29,6 +29,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MegaUtils; import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -143,6 +144,15 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre return false; } + @Override + public IStructureDefinition getStructureDefinition() { + throw new UnsupportedOperationException(); + } + + @Override + public void construct(ItemStack aStack, boolean aHintsOnly) { + } + // -------------- TEC TECH COMPAT ---------------- @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 9975fd8d2d..7f0a8ef426 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -27,7 +27,6 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.tectech.TecTechResearchLoader; -import com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement.*; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -78,17 +77,6 @@ public class BartWorksCrossmod { public void init(FMLInitializationEvent init) { if (LoaderReference.GalacticraftCore) GalacticraftProxy.init(init); - //Base GT -> TT Replacement - if (LoaderReference.tectech) { - new TT_VacuumFreezer(null,null); - new TT_OilCrackingUnit(null,null); - new TT_ImplosionCompressor(null,null); - new TT_ElectronicBlastFurnace(null,null); - new TT_MultiSmelter(null,null); - new TT_PyrolyseOven(null, null); - - new BW_TT_HeatExchanger(null, null); - } } @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index f4400fab11..0c11947028 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -43,6 +43,7 @@ import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.XSTR; import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.common.GT_Worldgen_GT_Ore_Layer; import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; @@ -57,6 +58,7 @@ import java.util.function.Predicate; import java.util.stream.Collectors; import static bloodasp.galacticgreg.registry.GalacticGregRegistry.getModContainers; +import static gregtech.api.enums.GT_Values.VN; @SuppressWarnings("ALL") public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_DrillerBase { @@ -143,24 +145,28 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } @Override - public String[] getDescription() { - String casingName = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(this.getCasingBlockItem().get(1L))); - return new String[]{"Controller Block for the Void Miner "+ GT_Values.VN[this.getMinTier()], - "Size(WxHxD): 3x7x3", - "Controller (Front middle at bottom)", - "3x1x3 Base of " + casingName, - "1x3x1 " + casingName + " pillar (Center of base)", - "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", - "1x Output Bus (One of base casings)", - "Optional: 0+ Input Hatch (One of base casings)", - "1x Maintenance Hatch (One of base casings)", - "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", - "Consumes " + GT_Values.V[this.getMinTier()] + "EU/t", - "Can be supplied with 2L/s of Neon(x4), Krypton(x8), Xenon(x16) or Oganesson(x64)", - "for higher outputs.", - "Will output "+(2*TIER_MULTIPLIER)+" Ores per Second depending on the Dimension it is build in", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() - }; + protected GT_Multiblock_Tooltip_Builder createTooltip() { + String casings = getCasingBlockItem().get(0).getDisplayName(); + + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Miner") + .addInfo("Controller Block for the Void Miner "+ GT_Values.VN[this.getMinTier()]) + .addInfo("Consumes " + GT_Values.V[this.getMinTier()] + "EU/t") + .addInfo("Can be supplied with 2L/s of Neon(x4), Krypton(x8), Xenon(x16) or Oganesson(x64) for higher outputs.") + .addInfo("Will output "+(2*TIER_MULTIPLIER)+" Ores per Second depending on the Dimension it is build in") + .addSeparator() + .beginStructureBlock(3, 7, 3, false) + .addController("Front bottom") + .addStructureInfo(casings + " form the 3x1x3 Base") + .addOtherStructurePart(casings, " 1x3x1 pillar above the center of the base (2 minimum total)") + .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing") + .addMaintenanceHatch("Any base casing") + .addInputBus("Mining Pipes, optional, any base casing") + .addInputHatch("Optional noble gas, any base casing") + .addOutputBus("Any base casing") + .toolTipFinisher("Gregtech"); + return tt; } public static ArrayListMultimap, Float>> getExtraDropsDimMap() { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java deleted file mode 100644 index ae07cdfe37..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/BW_TT_HeatExchanger.java +++ /dev/null @@ -1,369 +0,0 @@ -package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; - -import com.github.technus.tectech.mechanics.structure.IStructureDefinition; -import com.github.technus.tectech.mechanics.structure.StructureDefinition; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; -import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -import java.util.Collection; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; -import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; - -public class BW_TT_HeatExchanger extends TT_Abstract_GT_Replacement { - public static float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25) - - private GT_MetaTileEntity_Hatch_Input mInputHotFluidHatch; - private GT_MetaTileEntity_Hatch_Output mOutputColdFluidHatch; - private boolean superheated = false; - private int superheated_threshold = 0; - private float water; - private byte blocks = 0; - - public BW_TT_HeatExchanger(Object unused, Object unused2) { - super(1154, "multimachine.heatexchanger", "Large Heat Exchanger"); - } - - public BW_TT_HeatExchanger(String aName) { - super(aName); - } - - private static final byte TEXTURE_INDEX = 50; - private static final byte SOLID_CASING_META = 2; - private static final byte PIPE_CASING_META = 14; - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() - .addShape("main", - transpose(new String[][]{ - {"AAA", "ACA", "AAA"}, - {"AAA", "ABA", "AAA"}, - {"AAA", "ABA", "AAA"}, - {"A~A", "ADA", "AAA"} - }) - ).addElement( - 'A', - ofChain( - ofHatchAdder( - BW_TT_HeatExchanger::addClassicToMachineList, TEXTURE_INDEX, - GregTech_API.sBlockCasings4, SOLID_CASING_META - ), - onElementPass( - x -> ++x.blocks, - ofBlock( - GregTech_API.sBlockCasings4, SOLID_CASING_META - ) - ) - ) - - ).addElement( - 'B', - ofBlock( - GregTech_API.sBlockCasings2, PIPE_CASING_META, - GregTech_API.sBlockCasings2, PIPE_CASING_META - ) - ).addElement( - 'C', - ofHatchAdder( - BW_TT_HeatExchanger::addColdFluidOutputToMachineList,TEXTURE_INDEX, - 1 - ) - ).addElement( - 'D', - ofHatchAdder( - BW_TT_HeatExchanger::addHotFluidInputToMachineList,TEXTURE_INDEX, - 2 - ) - ) - .build(); - - @Override - public IStructureDefinition getStructure_EM() { - return STRUCTURE_DEFINITION; - } - - @Override - protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - this.blocks = 0; - return this.structureCheck_EM("main", 1, 3, 0) && this.blocks >= 20; - } - - private final static String[] desc = new String[]{ - "Heat Exchanger", - "Controller Block for the Large Heat Exchanger", - "Inputs are Hot Fluids and Distilled Water", - "Outputs Cold Fluids and SH Steam/Steam", - "Requires an additional Input and Output Hatch anywhere!", - ADV_STR_CHECK, - TT_BLUEPRINT - }; - - public String[] getDescription() { - return desc; - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - superheated = aNBT.getBoolean("superheated"); - super.loadNBTData(aNBT); - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setBoolean("superheated", superheated); - super.saveNBTData(aNBT); - } - - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][50], TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).glow().build()))}; - } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][50]}; - } - - private void checkRecipeClassic(float efficiency){ - int fluidAmountToConsume = mInputHotFluidHatch.getFluidAmount(); - float steam_output_multiplier = 20f; // default: multiply output by 4 * 10 (boosted x5) - boolean do_lava = false; - // If we're working with lava, adjust the threshold and multipliers accordingly. - if (GT_ModHandler.isLava(mInputHotFluidHatch.getFluid())) { - steam_output_multiplier /= 5f; // lava is not boosted - superheated_threshold /= 4f; // unchanged - do_lava = true; - } else if (mInputHotFluidHatch.getFluid().isFluidEqual(FluidRegistry.getFluidStack("ic2hotcoolant", 1))) { - steam_output_multiplier /= 2f; // was boosted x2 on top of x5 -> total x10 -> nerf with this code back to 5x - superheated_threshold /= 5f; // 10x smaller since the Hot Things production in reactor is the same. - } - - superheated = fluidAmountToConsume >= superheated_threshold; // set the internal superheated flag if we have enough hot fluid. Used in the onRunningTick method. - fluidAmountToConsume = Math.min(fluidAmountToConsume, superheated_threshold * 2); // Don't consume too much hot fluid per second - mInputHotFluidHatch.drain(fluidAmountToConsume, true); - this.mMaxProgresstime = 20; - this.mEUt = (int) (fluidAmountToConsume * steam_output_multiplier * efficiency); - if (do_lava) { - mOutputColdFluidHatch.fill(FluidRegistry.getFluidStack("ic2pahoehoelava", fluidAmountToConsume), true); - } else { - mOutputColdFluidHatch.fill(FluidRegistry.getFluidStack("ic2coolant", fluidAmountToConsume), true); - } - this.mEfficiencyIncrease = 80; - } - - Materials last = null; - - private void checkRecipe_Additions(float efficiency){ - Materials m = null; - if (last != null && mInputHotFluidHatch.getFluid().isFluidEqual(last.getPlasma(1))) { - m = last; - } else { - for (Materials materials : Materials.values()) { - if (mInputHotFluidHatch.getFluid().isFluidEqual(materials.getPlasma(1))) { - last = m = materials; - break; - } - else if (mInputHotFluidHatch.getFluid().isFluidEqual(materials.getMolten(1))){ - GT_Log.exp.println(this.mName + " had Molten Metal Injected!"); - explodeMultiblock(); // Generate crater - return; - } - } - } - - if (m == null) - return; - - int heat = getFuelValue(mInputHotFluidHatch.getFluid(), (int) (100 * efficiency)); - - superheated_threshold /= 4f; - - superheated = heat >= superheated_threshold; // set the internal superheated flag if we have enough hot fluid. Used in the onRunningTick method. - - mInputHotFluidHatch.drain(1, true); - this.mMaxProgresstime = 20; - this.mEUt = heat; - mOutputColdFluidHatch.fill(m.getMolten(1), true); - this.mEfficiencyIncrease = 80; - } - - private int getFuelValue(FluidStack aLiquid, int efficency) { - if (aLiquid == null || getRecipes() == null) - return 0; - FluidStack tLiquid; - Collection tRecipeList = getRecipes().mRecipeList; - if (tRecipeList == null) - return 0; - for (GT_Recipe tFuel : tRecipeList) { - tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true); - if (tLiquid == null) { - continue; - } - if (!aLiquid.isFluidEqual(tLiquid)) { - continue; - } - long val = (long) tFuel.mSpecialValue * efficency / 100; - if (val > Integer.MAX_VALUE) { - throw new ArithmeticException("Integer LOOPBACK!"); - } - return (int) val; - } - return 0; - } - - private GT_Recipe.GT_Recipe_Map getRecipes() { - return GT_Recipe.GT_Recipe_Map.sPlasmaFuels; - } - - public boolean checkRecipe_EM(ItemStack aStack) { - if (mInputHotFluidHatch.getFluid() == null) - return true; - FluidStack fluid = mInputHotFluidHatch.getFluid(); // how much fluid is in hatch - superheated_threshold = 4000; // default: must have 4000L per second to generate superheated steam - float efficiency = calculateEfficiency(); - - if (GT_ModHandler.isLava(fluid) || fluid.isFluidEqual(FluidRegistry.getFluidStack("ic2hotcoolant", 1))) - checkRecipeClassic(efficiency); - else - checkRecipe_Additions(efficiency); - - return true; - } - - private float calculateEfficiency(){ - float defaultEff = 1f; // default: operate at 100% efficiency with no integrated circuitry - float penalty; // penalty to apply to output based on circuitry level (1-25). - int shs_reduction_per_config = 150; // reduce threshold 150L/s per circuitry level (1-25) - - // Do we have an integrated circuit? - if (mInventory[1] == null || mInventory[1].getItem() != GT_Utility.getIntegratedCircuit(0).getItem()) - return defaultEff; - - //valid configuration? - int circuit_config = mInventory[1].getItemDamage(); - if (circuit_config < 1 || circuit_config > 25) - return defaultEff; - - // If so, apply the penalty and reduced threshold. - penalty = (circuit_config - 1) * penalty_per_config; - superheated_threshold -= (shs_reduction_per_config * (circuit_config - 1)); - return defaultEff - penalty; - } - - private int useWater(float input) { - water = water + input; - int usage = (int) water; - water = water - usage; - return usage; - } - - public boolean onRunningTick(ItemStack aStack) { - if (this.mEUt <= 0) { - return false; - } - int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 100_00L); // APPROXIMATELY how much steam to generate. - if (tGeneratedEU <= 0) { - return false; - } - - if (superheated) - tGeneratedEU /= 2; // We produce half as much superheated steam if necessary - - int distilledConsumed = useWater(tGeneratedEU / 160f); // how much distilled water to consume - //tGeneratedEU = distilledConsumed * 160; // EXACTLY how much steam to generate, producing a perfect 1:160 ratio with distilled water consumption - - FluidStack distilledStack = GT_ModHandler.getDistilledWater(distilledConsumed); - if (depleteInput(distilledStack)) // Consume the distilled water - { - if (superheated) { - addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", tGeneratedEU)); // Generate superheated steam - } else { - addOutput(GT_ModHandler.getSteam(tGeneratedEU)); // Generate regular steam - } - } else { - GT_Log.exp.println(this.mName + " had no more Distilled water!"); - explodeMultiblock(); // Generate crater - return false; - } - return true; - } - - - public boolean addColdFluidOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) - return false; - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (!(aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output)) { - return false; - } - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - mOutputColdFluidHatch = (GT_MetaTileEntity_Hatch_Output) aMetaTileEntity; - return true; - } - - public boolean addHotFluidInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (!(aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input)) { - return false; - } - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - mInputHotFluidHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity; - mInputHotFluidHatch.mRecipeMap = null; - return true; - } - - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new BW_TT_HeatExchanger(this.mName); - } - - @Override - public String[] getInfoData() { - return new String[]{ - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + - EnumChatFormatting.GREEN + mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + - EnumChatFormatting.YELLOW + mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", - StatCollector.translateToLocal("GT5U.multiblock.usage") + " " + StatCollector.translateToLocal("GT5U.LHE.steam") + ": " + - (superheated ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW) + (superheated ? -2 * mEUt : -mEUt) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + - EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + - " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + - EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", - StatCollector.translateToLocal("GT5U.LHE.superheated") + ": " + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.BLUE) + superheated + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.LHE.superheated") + " " + StatCollector.translateToLocal("GT5U.LHE.threshold") + ": " + EnumChatFormatting.GREEN + superheated_threshold + EnumChatFormatting.RESET - }; - } - - @Override - public void construct(ItemStack itemStack, boolean b) { - this.structureBuild_EM("main", 1,3,0, b, itemStack); - } - - private static final String[] sfStructureDescription = new String[] { - "1 - Cold Fluid Output", - "2 - Hot Fluid Input", - "Needs an additional Output Hatch", - "Needs an additional Input Hatch", - "20 Casings at least!" - }; - - @Override - public String[] getStructureDescription(ItemStack itemStack) { - return sfStructureDescription; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java deleted file mode 100644 index ad7915aff0..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; - -import com.github.technus.tectech.mechanics.constructable.IConstructable; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import gregtech.api.GregTech_API; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.*; -import gregtech.api.util.GT_Recipe; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; - -public abstract class TT_Abstract_GT_Replacement extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { - - protected TT_Abstract_GT_Replacement(int newId, String aName, String aNameRegional) { - super(32765, aName, aNameRegional); - GregTech_API.METATILEENTITIES[32765] = null; - GregTech_API.METATILEENTITIES[newId] = this; - } - - protected TT_Abstract_GT_Replacement(String aName) { - super(aName); - } - - protected void setInputFilters() { - this.mInputBusses.forEach(x -> x.mRecipeMap = this.getRecipeMap()); - this.mInputHatches.forEach(x -> x.mRecipeMap = this.getRecipeMap()); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", this.ePowerPassCover, false, true); - } - - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, this.ePowerPassCover, false, true); - } - - @Override - protected boolean cyclicUpdate_EM() { - return false; - } - - @Override - public boolean isMachineBlockUpdateRecursive() { - return true; - } - - @Override - public boolean isCorrectMachinePart(ItemStack aStack) { - return true; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack aStack) { - return false; - } - - @Override - public int getMaxEfficiency(ItemStack aStack) { - return 10000; - } - - @Override - public int getDamageToComponent(ItemStack aStack) { - return 0; - } - - protected void setEfficiencyAndOc(GT_Recipe gtRecipe) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - - calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, getMaxInputVoltage()); - } - - public final boolean addEBFInputsBottom(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) - return false; - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - else - return false; - - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) - return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) - return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) - return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); - return false; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement_Coils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement_Coils.java deleted file mode 100644 index 05f573b690..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_Abstract_GT_Replacement_Coils.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; - -import com.github.bartimaeusnek.crossmod.tectech.helper.IHasCoils; -import gregtech.api.enums.HeatingCoilLevel; - -public abstract class TT_Abstract_GT_Replacement_Coils extends TT_Abstract_GT_Replacement implements IHasCoils { - - protected TT_Abstract_GT_Replacement_Coils(int newId, String aName, String aNameRegional) { - super(newId, aName, aNameRegional); - } - - protected TT_Abstract_GT_Replacement_Coils(String aName) { - super(aName); - } - - protected HeatingCoilLevel heatingCoilLevel = HeatingCoilLevel.None; - - @Override - public void setCoilHeat(HeatingCoilLevel coilMeta) { - heatingCoilLevel = coilMeta; - } - - @Override - public HeatingCoilLevel getCoilHeat() { - return heatingCoilLevel; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java deleted file mode 100644 index e4a2b0b300..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ElectronicBlastFurnace.java +++ /dev/null @@ -1,375 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; - -import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; -import com.github.technus.tectech.mechanics.structure.IStructureDefinition; -import com.github.technus.tectech.mechanics.structure.StructureDefinition; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; -import com.google.common.collect.ImmutableSet; -import gregtech.api.GregTech_API; -import gregtech.api.enums.HeatingCoilLevel; -import gregtech.api.enums.Materials; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.interfaces.tileentity.ITurnable; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.*; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidStack; - -import java.util.Set; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; -import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.GT_Values.VN; - -public class TT_ElectronicBlastFurnace extends TT_Abstract_GT_Replacement_Coils { - - public TT_ElectronicBlastFurnace(Object unused, Object unused2) { - super(1000, "multimachine.blastfurnace", "Electric Blast Furnace"); - } - - private TT_ElectronicBlastFurnace(String aName) { - super(aName); - } - - private int mHeatingCapacity = 0; - - private static final byte TEXTURE_INDEX = 11; - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() - .addShape("main", - transpose(new String[][]{ - {"AAA", "AMA", "AAA"}, - {"CCC", "C-C", "CCC"}, - {"CCC", "C-C", "CCC"}, - {"B~B", "BBB", "BBB"} - }) - ).addElement( - 'C', - CoilAdder.getINSTANCE() - ).addElement( - 'M', - ofHatchAdder( - GT_MetaTileEntity_MultiblockBase_EM::addClassicMufflerToMachineList, TEXTURE_INDEX, - 1 - ) - ).addElement( - 'A', - ofHatchAdderOptional( - TT_ElectronicBlastFurnace::addEBFInputsTop, TEXTURE_INDEX, - GregTech_API.sBlockCasings1, TEXTURE_INDEX, - GregTech_API.sBlockCasings1, TEXTURE_INDEX - ) - ).addElement( - 'B', - ofHatchAdderOptional( - TT_ElectronicBlastFurnace::addEBFInputsBottom, TEXTURE_INDEX, - GregTech_API.sBlockCasings1, TEXTURE_INDEX, - GregTech_API.sBlockCasings1, TEXTURE_INDEX - ) - ) - .build(); - - @Override - public IStructureDefinition getStructure_EM() { - return STRUCTURE_DEFINITION; - } - - @Override - protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - this.mHeatingCapacity = 0; - this.setCoilHeat(HeatingCoilLevel.None); - boolean ret = this.structureCheck_EM("main", 1, 3, 0) && this.getCoilHeat() != HeatingCoilLevel.None; - this.mMufflerHatches.forEach(x -> x.setInValidFacings(this.getExtendedFacing().getRelativeUpInWorld().getOpposite())); - - if (this.mMufflerHatches.stream() - .map(MetaTileEntity::getBaseMetaTileEntity) - .mapToInt(ITurnable::getFrontFacing) - .noneMatch(x -> x == this.getExtendedFacing().getRelativeUpInWorld().ordinal())) - return false; - - this.mHeatingCapacity = (int) this.getCoilHeat().getHeat(); - this.mHeatingCapacity += 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 2); - setInputFilters(); - return ret; - } - - @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return GT_Recipe.GT_Recipe_Map.sBlastRecipes; - } - - @Override - public void construct(ItemStack itemStack, boolean b) { - this.structureBuild_EM("main", 1,3,0, b, itemStack); - } - - public final boolean addEBFInputsTop(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) - return false; - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - else - return false; - - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); - } - - private static final Set POLLUTION_FLUID_STACKS = ImmutableSet.of( - Materials.CarbonDioxide.getGas(1000), - Materials.CarbonMonoxide.getGas(1000), - Materials.SulfurDioxide.getGas(1000) - ); - - @Override - public boolean addOutput(FluidStack aLiquid) { - if (aLiquid == null) - return false; - FluidStack tLiquid = aLiquid.copy(); - - if (POLLUTION_FLUID_STACKS.stream().anyMatch(tLiquid::isFluidEqual)) { - tLiquid.amount = tLiquid.amount * (mMufflerHatches.stream() - .filter(GT_MetaTileEntity_MultiBlockBase::isValidMetaTileEntity) - .findFirst() - .map(tHatch -> 100 - tHatch.calculatePollutionReduction(100)) - .orElse(0) + 5) / 100; - for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { - if ((isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) - ? !tHatch.outputsSteam() - : !tHatch.outputsLiquids()) - || tHatch.getBaseMetaTileEntity().getYCoord() <= this.getBaseMetaTileEntity().getYCoord() - || canNotFillOutput(tHatch, tLiquid)) - continue; - return true; - } - } else { - for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { - if ((isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) - ? !tHatch.outputsSteam() - : !tHatch.outputsLiquids()) - || tHatch.getBaseMetaTileEntity().getYCoord() > this.getBaseMetaTileEntity().getYCoord() - || canNotFillOutput(tHatch, tLiquid)) - continue; - return true; - } - } - return false; - } - - private boolean canNotFillOutput(GT_MetaTileEntity_Hatch_Output tHatch, FluidStack tLiquid){ - int tAmount = tHatch.fill(tLiquid, false); - if (tAmount >= tLiquid.amount) - return tHatch.fill(tLiquid, true) < tLiquid.amount; - else if (tAmount > 0) - tLiquid.amount = tLiquid.amount - tHatch.fill(tLiquid, true); - return true; - } - - private static final int pollutionPerTick = 20; - - private final static String[] desc = new String[]{ - "Blast Furnace", - "Controller block for the Electric Blast Furnace", - "You can use some fluids to reduce recipe time. Place the circuit in the Input Bus", - "Each 900K over the min. Heat required multiplies EU/t by 0.95", - "Each 1800K over the min. Heat required allows for one upgraded overclock instead of normal", - "Upgraded overclocks reduce recipe time to 25% (instead of 50%) and increase EU/t to 400%", - "Additionally gives +100K for every tier past MV", - "Creates up to: " + 20 * pollutionPerTick + " Pollution per Second", - ADV_STR_CHECK, - TT_BLUEPRINT - }; - - @Override - public String[] getDescription() { - return desc; - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][11], new TT_RenderedExtendedFacingTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; - } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][11]}; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new TT_ElectronicBlastFurnace(this.mName); - } - - @Override - public boolean checkRecipe_EM(ItemStack aStack) { - ItemStack[] tInputs = this.getCompactedInputs(); - FluidStack[] tFluids = this.getCompactedFluids(); - - if (tInputs.length <= 0) { - return false; - } - long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - if (tRecipe == null - || (this.mHeatingCapacity < tRecipe.mSpecialValue) - || (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) { - return false; - } - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - int tHeatCapacityDivTiers = ((this.mHeatingCapacity - tRecipe.mSpecialValue) / 900); - byte overclockCount = calculateOverclockednessEBF(tRecipe.mEUt, tRecipe.mDuration, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) - this.mEUt = (-this.mEUt); - - if (tHeatCapacityDivTiers > 0) { - this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); - this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount);//extra free overclocking if possible - if (this.mMaxProgresstime < 1) - this.mMaxProgresstime = 1;//no eu efficiency correction - } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; - this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; - updateSlots(); - return true; - } - - /** - * Calcualtes overclocked ness using long integers - * - * @param aEUt - recipe EUt - * @param aDuration - recipe Duration - */ - protected byte calculateOverclockednessEBF(int aEUt, int aDuration, long maxInputVoltage) { - byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)), timesOverclocked = 0; - if (mTier == 0) { - //Long time calculation - long xMaxProgresstime = ((long) aDuration) << 1; - if (xMaxProgresstime > Integer.MAX_VALUE - 1) { - //make impossible if too long - mEUt = Integer.MAX_VALUE - 1; - mMaxProgresstime = Integer.MAX_VALUE - 1; - } else { - mEUt = aEUt >> 2; - mMaxProgresstime = (int) xMaxProgresstime; - } - //return 0; - } else { - //Long EUt calculation - long xEUt = aEUt; - //Isnt too low EUt check? - long tempEUt = Math.max(xEUt, V[1]); - - mMaxProgresstime = aDuration; - - while (tempEUt <= V[mTier - 1]) { - tempEUt <<= 2;//this actually controls overclocking - //xEUt *= 4;//this is effect of everclocking - mMaxProgresstime >>= 1;//this is effect of overclocking - xEUt = mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power - timesOverclocked++; - } - if (xEUt > Integer.MAX_VALUE - 1) { - mEUt = Integer.MAX_VALUE - 1; - mMaxProgresstime = Integer.MAX_VALUE - 1; - } else { - mEUt = (int) xEUt; - if (mEUt == 0) - mEUt = 1; - if (mMaxProgresstime == 0) - mMaxProgresstime = 1;//set time to 1 tick - } - } - return timesOverclocked; - } - - @Override - public String[] getInfoData() { - int mPollutionReduction = 0; - for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { - if (isValidMetaTileEntity(tHatch)) { - mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); - } - } - - long storedEnergy = 0; - long maxEnergy = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { - if (isValidMetaTileEntity(tHatch)) { - storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); - } - } - - return new String[]{ - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + - EnumChatFormatting.YELLOW + mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", - StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + -mEUt + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + - EnumChatFormatting.YELLOW + VN[GT_Utility.getTier(getMaxInputVoltage())] + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + - EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + - " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + - EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", - StatCollector.translateToLocal("GT5U.EBF.heat") + ": " + - EnumChatFormatting.GREEN + mHeatingCapacity + EnumChatFormatting.RESET + " K", - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %" - }; - } - - @Override - public int getPollutionPerTick(ItemStack aStack) { - return pollutionPerTick; - } - - private static final String[] sfStructureDescription = new String[] { - "0 - Air", - "1 - Muffler", - "Required: Output Bus, Input Bus, Energy Hatch, Maintenance Hatch", - "Optional: Input Hatch, Output Hatch at Bottom, Output Hatch at top to regain CO/CO2/SO2" - }; - - @Override - public String[] getStructureDescription(ItemStack itemStack) { - return sfStructureDescription; - } - -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java deleted file mode 100644 index aec51a8d70..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_ImplosionCompressor.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; - -import com.github.bartimaeusnek.crossmod.tectech.helper.StructureDefinitions; -import com.github.technus.tectech.mechanics.structure.IStructureDefinition; -import com.github.technus.tectech.mechanics.structure.StructureDefinition; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; -import com.google.common.collect.ArrayListMultimap; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.interfaces.tileentity.ITurnable; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.*; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; - -import java.util.List; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; -import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; - -public class TT_ImplosionCompressor extends TT_Abstract_GT_Replacement { - - public TT_ImplosionCompressor(Object unused, Object unused2) { - super(1001, "multimachine.implosioncompressor", "Implosion Compressor"); - } - - private TT_ImplosionCompressor(String aName) { - super(aName); - } - - private byte blocks = 0; - - private static final byte TEXTURE_INDEX = 16; - private static final byte SOUND_INDEX = 20; - - private static final ArrayListMultimap BLOCKS = ArrayListMultimap.create(); - - static { - BLOCKS.put(GregTech_API.sBlockCasings2,0); - BLOCKS.put(GregTech_API.sBlockCasings3,4); - } - - private static final IStructureDefinition STRUCTURE_DEFINITION = - StructureDefinition.builder().addShape("main", - StructureDefinitions.CUBE_NO_MUFFLER.getDefinition() - ).addElement( - 'V', - ofChain( - onElementPass( - x -> ++x.blocks, - ofBlocksMap( - BLOCKS.asMap(),GregTech_API.sBlockCasings2, - 0 - ) - ), - ofHatchAdder( - TT_ImplosionCompressor::addImplosionHatches, - TEXTURE_INDEX, - 1 - ) - ) - ).build(); - - public final boolean addImplosionHatches(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - else - return false; - - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) - return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) - return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) - return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); - return false; - } - - @Override - protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - this.blocks = 0; - boolean ret = this.structureCheck_EM("main", 1,1,0) - && this.blocks >= 16; - this.mMufflerHatches.forEach(x -> x.setInValidFacings(this.getExtendedFacing().getRelativeUpInWorld().getOpposite())); - - if (this.mMufflerHatches.stream() - .map(MetaTileEntity::getBaseMetaTileEntity) - .mapToInt(ITurnable::getFrontFacing) - .noneMatch(x -> x == this.getExtendedFacing().getRelativeUpInWorld().ordinal())) - return false; - - setInputFilters(); - return ret; - } - - @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return GT_Recipe.GT_Recipe_Map.sImplosionRecipes; - } - - @Override - public void construct(ItemStack itemStack, boolean b) { - this.structureBuild_EM("main", 1,1,0, b, itemStack); - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new TT_ImplosionCompressor(this.mName); - } - - private static final int pollutionPerTick = 500; - - private final static String[] desc = new String[]{ - "Implosion Compressor", - "Explosions are fun", - "Controller block for the Implosion Compressor", - "Creates up to: " + 20 * pollutionPerTick + " Pollution per Second", - ADV_STR_CHECK, - TT_BLUEPRINT - }; - - @Override - public String[] getDescription() { - return desc; - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX], new TT_RenderedExtendedFacingTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR)}; - } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX]}; - } - - @Override - public IStructureDefinition getStructure_EM() { - return STRUCTURE_DEFINITION; - } - - @Override - public boolean checkRecipe_EM(ItemStack aStack) { - List tInputList = getStoredInputs(); - int tInputList_sS=tInputList.size(); - for (int i = 0; i < tInputList_sS - 1; i++) { - for (int j = i + 1; j < tInputList_sS; j++) { - if (!GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { - continue; - } - if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { - tInputList.remove(j--); - tInputList_sS=tInputList.size(); - } else { - tInputList.remove(i--); - tInputList_sS=tInputList.size(); - break; - } - } - } - ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); - if (tInputList.size() <= 0) { - return false; - } - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sImplosionRecipes.findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); - if ((tRecipe == null) || (!tRecipe.isRecipeInputEqual(true, null, tInputs))) { - return false; - } - setEfficiencyAndOc(tRecipe); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; - sendLoopStart(SOUND_INDEX); - updateSlots(); - return true; - } - - @Override - public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { - super.startSoundLoop(aIndex, aX, aY, aZ); - if (aIndex == SOUND_INDEX) { - GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); - } - } - - @Override - public int getPollutionPerTick(ItemStack aStack) { - return pollutionPerTick; - } - - private static final String[] sfStructureDescription = new String[] { - "0 - Air", - "Required: Muffler Hatch, Output Bus, Input Bus, Energy Hatch, Maintenance Hatch", - "16 Casings at least!" - }; - - @Override - public String[] getStructureDescription(ItemStack itemStack) { - return sfStructureDescription; - } - -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java deleted file mode 100644 index d38f1800ba..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_MultiSmelter.java +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; - -import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; -import com.github.technus.tectech.mechanics.structure.IStructureDefinition; -import com.github.technus.tectech.mechanics.structure.StructureDefinition; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; -import gregtech.api.GregTech_API; -import gregtech.api.enums.HeatingCoilLevel; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.interfaces.tileentity.ITurnable; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - -import java.util.ArrayList; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; -import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; -import static gregtech.api.enums.GT_Values.VN; - -public class TT_MultiSmelter extends TT_Abstract_GT_Replacement_Coils { - - private int mLevel; - private int mCostDiscount; - - public TT_MultiSmelter(Object unused, Object unused2) { - super(1003, "multimachine.multifurnace", "Multi Smelter"); - } - - private TT_MultiSmelter(String aName) { - super(aName); - } - - private static final byte TEXTURE_INDEX = 11; - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() - .addShape("main", - transpose(new String[][]{ - {"AAA", "AMA", "AAA"}, - {"CCC", "C-C", "CCC"}, - {"A~A", "AAA", "AAA"} - }) - ).addElement( - 'C', - CoilAdder.getINSTANCE() - ).addElement( - 'M', - ofHatchAdder( - GT_MetaTileEntity_MultiblockBase_EM::addClassicMufflerToMachineList, TEXTURE_INDEX, - 1 - ) - ).addElement( - 'A', - ofHatchAdderOptional( - TT_MultiSmelter::addEBFInputsBottom, TEXTURE_INDEX, - GregTech_API.sBlockCasings1, TEXTURE_INDEX, - GregTech_API.sBlockCasings1, TEXTURE_INDEX - ) - ) - .build(); - - - private static final String[] sfStructureDescription = new String[] { - "0 - Air", - "1 - Muffler", - "Required: Output Bus, Input Bus, Energy Hatch, Maintenance Hatch", - }; - - @Override - public String[] getStructureDescription(ItemStack itemStack) { - return sfStructureDescription; - } - - @Override - public IStructureDefinition getStructure_EM() { - return STRUCTURE_DEFINITION; - } - - @Override - protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - this.mLevel = 0; - this.mCostDiscount = 1; - this.setCoilHeat(HeatingCoilLevel.None); - boolean ret = this.structureCheck_EM("main", 1, 2, 0) && this.getCoilHeat() != HeatingCoilLevel.None; - - this.mMufflerHatches.forEach(x -> x.setInValidFacings(this.getExtendedFacing().getRelativeUpInWorld().getOpposite())); - - if (this.mMufflerHatches.stream() - .map(MetaTileEntity::getBaseMetaTileEntity) - .mapToInt(ITurnable::getFrontFacing) - .noneMatch(x -> x == this.getExtendedFacing().getRelativeUpInWorld().ordinal())) - return false; - - this.mLevel = this.getCoilHeat().getLevel(); - this.mCostDiscount = this.getCoilHeat().getCostDiscount(); - setInputFilters(); - return ret; - } - - @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return GT_Recipe.GT_Recipe_Map.sFurnaceRecipes; - } - - @Override - public void construct(ItemStack itemStack, boolean b) { - this.structureBuild_EM("main", 1,2,0, b, itemStack); - } - - private static final int pollutionPerTick = 20; - - private final static String[] desc = new String[]{ - "Furnace", - "Controller Block for the Multi Smelter", - "Smelts up to 8-128 items at once", - "Items smelted increases with coil tier", - "Creates up to: " + 20 * pollutionPerTick + " Pollution per Second", - ADV_STR_CHECK, - TT_BLUEPRINT - }; - - @Override - public String[] getDescription() { - return desc; - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][11], new TT_RenderedExtendedFacingTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER)}; - } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][11]}; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new TT_MultiSmelter(this.mName); - } - - @Override - public boolean checkRecipe_EM(ItemStack aStack) { - ArrayList tInputList = getStoredInputs(); - if (tInputList.isEmpty()) - return false; - - int mVolatage = GT_Utility.safeInt(getMaxInputVoltage()); - int tMaxParrallel = 8 * this.mLevel; - int tCurrenParrallel = 0; - ItemStack tSmeltStack = tInputList.get(0); - ItemStack tOutputStack = GT_ModHandler.getSmeltingOutput(tSmeltStack,false,null); - if (tOutputStack == null) - return false; - for (ItemStack item : tInputList) { - if (!tSmeltStack.isItemEqual(item)) { - continue; - } - if (item.stackSize < (tMaxParrallel - tCurrenParrallel)) { - tCurrenParrallel += item.stackSize; - item.stackSize = 0; - } else { - item.stackSize = (tCurrenParrallel + item.stackSize) - tMaxParrallel; - tCurrenParrallel = tMaxParrallel; - break; - } - } - tCurrenParrallel *= tOutputStack.stackSize; - this.mOutputItems = new ItemStack[(tCurrenParrallel/64)+1]; - for (int i = 0; i < this.mOutputItems.length; i++) { - ItemStack tNewStack = tOutputStack.copy(); - int size = Math.min(tCurrenParrallel, 64); - tNewStack.stackSize = size; - tCurrenParrallel -= size; - this.mOutputItems[i] = tNewStack; - } - - if (this.mOutputItems.length > 0) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - calculateOverclockedNessMulti(4, 512, 1, mVolatage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - - this.mEUt = GT_Utility.safeInt(((long)mEUt) * this.mLevel / (long)this.mCostDiscount,1); - if (mEUt == Integer.MAX_VALUE - 1) - return false; - - if (this.mEUt > 0) - this.mEUt = (-this.mEUt); - } - updateSlots(); - return true; - } - - @Override - public int getPollutionPerTick(ItemStack aStack) { - return pollutionPerTick; - } - - @Override - public String[] getInfoData() { - int mPollutionReduction=0; - for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) - if (isValidMetaTileEntity(tHatch)) - mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); - - long storedEnergy=0; - long maxEnergy=0; - for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) - if (isValidMetaTileEntity(tHatch)) { - storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); - } - - return new String[]{ - StatCollector.translateToLocal("GT5U.multiblock.Progress")+": "+ - EnumChatFormatting.GREEN + mProgresstime / 20 + EnumChatFormatting.RESET +" s / "+ - EnumChatFormatting.YELLOW + mMaxProgresstime / 20 + EnumChatFormatting.RESET +" s", - StatCollector.translateToLocal("GT5U.multiblock.energy")+": "+ - EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET +" EU / "+ - EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET +" EU", - StatCollector.translateToLocal("GT5U.multiblock.usage")+": "+ - EnumChatFormatting.RED + -mEUt + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei")+": "+ - EnumChatFormatting.YELLOW+ getMaxInputVoltage() +EnumChatFormatting.RESET+" EU/t(*2A) "+StatCollector.translateToLocal("GT5U.machines.tier")+": "+ - EnumChatFormatting.YELLOW+VN[GT_Utility.getTier(getMaxInputVoltage())]+ EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.problems")+": "+ - EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+ - " "+StatCollector.translateToLocal("GT5U.multiblock.efficiency")+": "+ - EnumChatFormatting.YELLOW+ mEfficiency / 100.0F +EnumChatFormatting.RESET + " %", - StatCollector.translateToLocal("GT5U.MS.multismelting")+": "+ - EnumChatFormatting.GREEN+mLevel*8+EnumChatFormatting.RESET+" Discount: (EU/t) / "+EnumChatFormatting.GREEN+mCostDiscount+EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.pollution")+": "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" - }; - } -} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java deleted file mode 100644 index 29cd0b5b0f..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_OilCrackingUnit.java +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; - -import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; -import com.github.technus.tectech.mechanics.structure.IStructureDefinition; -import com.github.technus.tectech.mechanics.structure.StructureDefinition; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; -import gregtech.api.GregTech_API; -import gregtech.api.enums.HeatingCoilLevel; -import gregtech.api.enums.Materials; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - -import java.util.ArrayList; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; -import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; - -public class TT_OilCrackingUnit extends TT_Abstract_GT_Replacement_Coils { - - public TT_OilCrackingUnit(Object unused, Object unused2) { - super(1160, "multimachine.cracker", "Oil Cracking Unit"); - } - - private TT_OilCrackingUnit(String aName) { - super(aName); - } - - private byte blocks = 0; - - private static final byte TEXTURE_INDEX = 49; - - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder().addShape("main", - transpose(new String[][]{ - {"EBGBF","EBGBF","EBGBF"}, - {"EB~BF","E---F","EBGBF"}, - {"EBGBF","EBGBF","EBGBF"} - }) - ).addElement( - 'B', - CoilAdder.getINSTANCE() - ).addElement( - 'E', - ofChain( - ofHatchAdder( - TT_OilCrackingUnit::addInputFluidHatch, - TEXTURE_INDEX, - 1), - onElementPass( - x -> ++x.blocks, - ofBlock( - GregTech_API.sBlockCasings4, - 1 - ) - ), - ofHatchAdder( - TT_OilCrackingUnit::addClassicMaintenanceToMachineList, - TEXTURE_INDEX, - 1 - ), - ofHatchAdder( - TT_OilCrackingUnit::addEnergyIOToMachineList, - TEXTURE_INDEX, - 1 - ) - ) - ).addElement( - 'F', - ofChain( - ofHatchAdder( - TT_OilCrackingUnit::addOutputFluidHatch, - TEXTURE_INDEX, - 2), - onElementPass( - x -> ++x.blocks, - ofBlock( - GregTech_API.sBlockCasings4, - 1 - ) - ), - ofHatchAdder( - TT_OilCrackingUnit::addClassicMaintenanceToMachineList, - TEXTURE_INDEX, - 1 - ), - ofHatchAdder( - TT_OilCrackingUnit::addEnergyIOToMachineList, - TEXTURE_INDEX, - 1 - ) - - ) - ).addElement( - 'G', - ofChain( - ofHatchAdder( - TT_OilCrackingUnit::addMiddleFluidHatch, - TEXTURE_INDEX, - 3), - onElementPass( - x -> ++x.blocks, - ofBlock( - GregTech_API.sBlockCasings4, - 1 - ) - ), - ofHatchAdder( - TT_OilCrackingUnit::addClassicMaintenanceToMachineList, - TEXTURE_INDEX, - 1 - ), - ofHatchAdder( - TT_OilCrackingUnit::addEnergyIOToMachineList, - TEXTURE_INDEX, - 1 - ) - - ) - ).build(); - - private static final String[] sfStructureDescription = new String[] { - "0 - Air", - "1 - Input Hatch", - "2 - Output Hatch", - "3 - 1x Input Hatch, rest Casings, Maintenance Hatch or Energy Hatch", - "Required: Maintenance Hatch, Energy Hatch, at Position 3 or instead of Casings", - "18 Casings at least!" - }; - - @Override - public String[] getStructureDescription(ItemStack itemStack) { - return sfStructureDescription; - } - - private GT_MetaTileEntity_Hatch_Input middleFluidHatch; - - public final boolean addMiddleFluidHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) - return false; - else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - ((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); - this.middleFluidHatch = (GT_MetaTileEntity_Hatch_Input)aMetaTileEntity; - return true; - } else - return false; - } - } - - @Override - protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - this.setCoilHeat(HeatingCoilLevel.None); - this.blocks = 0; - boolean ret = this.structureCheck_EM("main", 2,1,0); - setInputFilters(); - return ret && this.blocks >= 18; - } - - @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return GT_Recipe.GT_Recipe_Map.sCrakingRecipes; - } - - public final boolean addOutputFluidHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) - return false; - else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output)aMetaTileEntity); - } else - return false; - } - } - - public final boolean addInputFluidHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) - return false; - else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - ((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity); - } else - return false; - } - } - - @Override - public IStructureDefinition getStructure_EM() { - return STRUCTURE_DEFINITION; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new TT_OilCrackingUnit(this.mName); - } - - private final static String[] desc = new String[]{ - "Cracker", - "Controller block for the Oil Cracking Unit", - "Thermally cracks heavy hydrocarbons into lighter fractions", - "More efficient than the Chemical Reactor", - "Place the appropriate circuit in the controller", - "Gets 5% energy cost reduction per coil tier", - ADV_STR_CHECK, - TT_BLUEPRINT - }; - - @Override - public String[] getDescription() { - return desc; - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX], - new TT_RenderedExtendedFacingTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER)}; - } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX]}; - } - - @Override - public boolean checkRecipe_EM(ItemStack aStack) { - ArrayList tInputList = getStoredFluids(); - FluidStack[] tFluidInputs = tInputList.toArray(new FluidStack[0]); - long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCrakingRecipes.findRecipe( - getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluidInputs , mInventory[1]); - if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, tFluidInputs, mInventory[1])) { - return false; - } - setEfficiencyAndOc(tRecipe); - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - this.mEUt *= Math.pow(0.95D, this.getCoilHeat().getTier()); - - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; - return true; - } - - @Override - public ArrayList getStoredFluids() { - ArrayList rList = new ArrayList<>(); - - for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) { - tHatch.mRecipeMap = getRecipeMap(); - if (!isValidMetaTileEntity(tHatch) || tHatch.getFillableStack() == null) { - continue; - } - FluidStack tStack = tHatch.getFillableStack(); - if (!tStack.isFluidEqual(GT_ModHandler.getSteam(1000)) && !tStack.isFluidEqual(Materials.Hydrogen.getGas(1000))) - rList.add(tStack); - } - - if (this.middleFluidHatch == null || !isValidMetaTileEntity(this.middleFluidHatch) || this.middleFluidHatch.getFillableStack() == null) { - return rList; - } - this.middleFluidHatch.mRecipeMap = getRecipeMap(); - FluidStack tStack = this.middleFluidHatch.getFillableStack(); - rList.add(tStack); - - return rList; - } - - @Override - public void construct(ItemStack itemStack, boolean b) { - this.structureBuild_EM("main", 2,1,0, b, itemStack); - } -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java deleted file mode 100644 index 0c1182189c..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java +++ /dev/null @@ -1,231 +0,0 @@ -package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; - -import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; -import com.github.technus.tectech.mechanics.structure.IStructureDefinition; -import com.github.technus.tectech.mechanics.structure.StructureDefinition; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTech_API; -import gregtech.api.enums.HeatingCoilLevel; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.loaders.oreprocessing.ProcessingLog; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; -import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; - -public class TT_PyrolyseOven extends TT_Abstract_GT_Replacement_Coils { - private static final int TEXTURE_INDEX = 1090; - private static final int pollutionPerTick = 30; - - public TT_PyrolyseOven(Object unused, Object unused2) { - super(1159, "multimachine.pyro", "Pyrolyse Oven"); - } - - public TT_PyrolyseOven(String aName) { - super(aName); - } - - private static final Block casingBlock; - private static final int casingMeta; - - private int blocks = 0; - - static { - if (Loader.isModLoaded("dreamcraft")) { - casingBlock = GameRegistry.findBlock("dreamcraft", "gt.blockcasingsNH"); - casingMeta = 2; - } else { - casingBlock = GregTech_API.sBlockCasings1; - casingMeta = 0; - } - } - - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() - .addShape("main", - transpose(new String[][]{ - {"AAAAA", "ACCCA", "ACCCA", "ACCCA", "AAAAA"}, - {"AAAAA", "A---A", "A---A", "A---A", "AAAAA"}, - {"AAAAA", "A---A", "A---A", "A---A", "AAAAA"}, - {"BB~BB", "BDDDB", "BDDDB", "BDDDB", "BBBBB"} - }) - ).addElement( - 'D', - CoilAdder.getINSTANCE() - ).addElement( - 'A', - onElementPass(x -> x.blocks++, - ofBlock( - casingBlock, - casingMeta - ) - ) - ).addElement( - 'B', - ofChain( - ofHatchAdder( - TT_PyrolyseOven::addClassicOutputToMachineList, TEXTURE_INDEX, - 1 - ), - ofHatchAdder( - TT_PyrolyseOven::addEnergyIOToMachineList, TEXTURE_INDEX, - 1 - ), - ofHatchAdder( - TT_PyrolyseOven::addClassicMaintenanceToMachineList, TEXTURE_INDEX, - 1 - ), - onElementPass(x -> x.blocks++, - ofBlock( - casingBlock, - casingMeta - ) - ) - ) - - ).addElement( - 'C', - ofChain( - ofHatchAdder( - TT_PyrolyseOven::addClassicInputToMachineList, TEXTURE_INDEX, - 2 - ), - ofHatchAdder( - TT_PyrolyseOven::addClassicMufflerToMachineList, TEXTURE_INDEX, - 2 - ), - onElementPass(x -> x.blocks++, - ofBlock( - casingBlock, - casingMeta - ) - ) - ) - - ) - .build(); - - @Override - public IStructureDefinition getStructure_EM() { - return STRUCTURE_DEFINITION; - } - - @Override - protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - this.setCoilHeat(HeatingCoilLevel.None); - this.blocks = 0; - return this.structureCheck_EM("main", 2,3,0) && this.blocks >= 60; - } - - private static final String[] desc = new String[]{ - "Coke Oven", - "Controller block for the Pyrolyse Oven", - "Industrial Charcoal producer", - "Processing speed scales linearly with Coil tier:", - "CuNi: 50%, FeAlCr: 100%, Ni4Cr: 150%, Fe50CW: 200%, etc.", - "EU/t is not affected by Coil tier", - "Creates up to: " + 20 * pollutionPerTick + " Pollution per Second", - ADV_STR_CHECK, - TT_BLUEPRINT - }; - - @Override - public String[] getDescription() { - return desc; - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[8][66], TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_GLOW).glow().build()))}; - } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[8][66]}; - } - - @Override - public boolean checkRecipe_EM(ItemStack aStack) { - ItemStack[] tInputs = getCompactedInputs(); - FluidStack[] tFluids = getCompactedFluids(); - - if (tInputs.length <= 0) - return false; - - long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - - //Dynamic recipe adding for newly found logWoods - wont be visible in nei most probably - if (tRecipe == null) - tRecipe = addRecipesDynamically(tInputs, tFluids, tTier); - - if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) - return false; - setEfficiencyAndOc(tRecipe); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) - this.mEUt = (-this.mEUt); - this.mMaxProgresstime = Math.max(mMaxProgresstime * 2 / (1 + this.heatingCoilLevel.getTier()), 1); - if (tRecipe.mOutputs.length > 0) - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; - if (tRecipe.mFluidOutputs.length > 0) - this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; - updateSlots(); - return true; - } - - private GT_Recipe addRecipesDynamically(ItemStack[] tInputs, FluidStack[] tFluids, int tTier) { - if (tInputs.length <= 1 && (tInputs[0] == null || tInputs[0].getItem() == GT_Utility.getIntegratedCircuit(0).getItem())) { - return null; - } - int oreId = OreDictionary.getOreID("logWood"); - for (ItemStack is : tInputs) { - for (int id : OreDictionary.getOreIDs(is)) { - if (oreId == id) { - ProcessingLog.addPyrolyeOvenRecipes(is); - return GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - } - } - } - return null; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new TT_PyrolyseOven(this.mName); - } - - @Override - public int getPollutionPerTick(ItemStack aStack) { - return pollutionPerTick; - } - - private static final String[] sfStructureDescription = new String[] { - "0 - Air", - "1 - Output Hatch, Output Bus, Energy Hatch, Maintenance Hatch, Casing", - "2 - Input Hatch, Input Bus, Muffler Hatch, Casing", - "60 Casings at least!" - }; - - @Override - public String[] getStructureDescription(ItemStack itemStack) { - return sfStructureDescription; - } - - @Override - public void construct(ItemStack itemStack, boolean b) { - this.structureBuild_EM("main", 2,3,0, b, itemStack); - } -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java deleted file mode 100644 index 0b415a0d4c..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_VacuumFreezer.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; - -import com.github.bartimaeusnek.crossmod.tectech.helper.StructureDefinitions; -import com.github.technus.tectech.mechanics.structure.IStructureDefinition; -import com.github.technus.tectech.mechanics.structure.StructureDefinition; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.*; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; - -import java.util.ArrayList; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; -import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; - -public class TT_VacuumFreezer extends TT_Abstract_GT_Replacement { - public TT_VacuumFreezer(Object unused, Object unused2) { - super(1002, "multimachine.vacuumfreezer", "Vacuum Freezer"); - } - - private TT_VacuumFreezer(String aName) { - super(aName); - } - - private static final byte TEXTURE_INDEX = 17; - - private byte blocks = 0; - - private static final IStructureDefinition STRUCTURE_DEFINITION = - StructureDefinition.builder().addShape("main", - StructureDefinitions.CUBE_NO_MUFFLER.getDefinition() - ).addElement( - 'V', - ofChain( - onElementPass( - x -> ++x.blocks, - ofBlock( - GregTech_API.sBlockCasings2, - 1 - ) - ), - ofHatchAdder( - TT_VacuumFreezer::addVacuumFreezerHatches, - TEXTURE_INDEX, - 1 - ) - ) - ).build(); - - @Override - public IStructureDefinition getStructure_EM() { - return STRUCTURE_DEFINITION; - } - - private final static String[] desc = new String[]{ - "Vacuum Freezer", - "Controller Block for the Vacuum Freezer", - "Cools hot ingots and cells", - ADV_STR_CHECK, - TT_BLUEPRINT - }; - - private static final String[] sfStructureDescription = new String[] { - "0 - Air", - "Required: Output Bus, Input Bus, Energy Hatch, Maintenance Hatch" - }; - - @Override - public String[] getStructureDescription(ItemStack itemStack) { - return sfStructureDescription; - } - - public String[] getDescription() { - return desc; - } - - @Override - protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - this.blocks = 0; - boolean ret = this.structureCheck_EM("main", 1,1,0) - && this.blocks >= 16; - setInputFilters(); - return ret; - } - - @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return GT_Recipe.GT_Recipe_Map.sVacuumRecipes; - } - - @SideOnly(Side.CLIENT) - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX], new TT_RenderedExtendedFacingTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)}; - } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][TEXTURE_INDEX]}; - } - - @Override - public boolean checkRecipe_EM(ItemStack itemStack) { - ArrayList tInputList = getStoredInputs(); - for (ItemStack tInput : tInputList) { - long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, tInput); - if (tRecipe == null) { - continue; - } - if (!tRecipe.isRecipeInputEqual(true, null, tInput)) { - continue; - } - setEfficiencyAndOc(tRecipe); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; - updateSlots(); - return true; - } - return false; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new TT_VacuumFreezer(this.mName); - } - - @Override - public void construct(ItemStack itemStack, boolean b) { - this.structureBuild_EM("main", 1,1,0, b, itemStack); - } - - public final boolean addVacuumFreezerHatches(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - else - return false; - - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) - return this.eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) - return this.eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); - return false; - } -} -- cgit From 5e27ee9f483a7571578b9e05acaec0c35b186ec6 Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Tue, 27 Jul 2021 13:27:54 -0600 Subject: Delete no longer needed dynamic pyrolyse recipe code Former-commit-id: b84e31e09e2c4340884f5a518f8ff21d15e43a39 --- .gitignore | 1 + gradle.properties | 2 +- .../multi/GT_Replacement/TT_PyrolyseOven.java | 22 ---------------------- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index f338842ce1..ac0fe978a9 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ *.ctxt # IDEA files +.idea/ *.iml *.ipr *.iws diff --git a/gradle.properties b/gradle.properties index ff2f1c8178..8f238432bb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,7 +23,7 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 majorUpdate=0 minorUpdate=5 -buildNumber=18 +buildNumber=19 apiVersion=11 ic2Version=2.2.828-experimental applecoreVersion=1.7.10-3.1.1 diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java index 0c1182189c..6ceb2791cf 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java @@ -14,11 +14,9 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.loaders.oreprocessing.ProcessingLog; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; @@ -165,10 +163,6 @@ public class TT_PyrolyseOven extends TT_Abstract_GT_Replacement_Coils { byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - //Dynamic recipe adding for newly found logWoods - wont be visible in nei most probably - if (tRecipe == null) - tRecipe = addRecipesDynamically(tInputs, tFluids, tTier); - if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) return false; setEfficiencyAndOc(tRecipe); @@ -186,22 +180,6 @@ public class TT_PyrolyseOven extends TT_Abstract_GT_Replacement_Coils { return true; } - private GT_Recipe addRecipesDynamically(ItemStack[] tInputs, FluidStack[] tFluids, int tTier) { - if (tInputs.length <= 1 && (tInputs[0] == null || tInputs[0].getItem() == GT_Utility.getIntegratedCircuit(0).getItem())) { - return null; - } - int oreId = OreDictionary.getOreID("logWood"); - for (ItemStack is : tInputs) { - for (int id : OreDictionary.getOreIDs(is)) { - if (oreId == id) { - ProcessingLog.addPyrolyeOvenRecipes(is); - return GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - } - } - } - return null; - } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new TT_PyrolyseOven(this.mName); -- cgit From f8e44655a7b680019b0f9213446fad478eb9b48e Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Thu, 29 Jul 2021 02:15:57 -0600 Subject: Fix wrong recipe in MoltenCellLoader Former-commit-id: 8bbfe75ad384f68a025cc8f9a0e84e66415d7f0b --- .gitignore | 1 + gradle.properties | 2 +- .../system/material/werkstoff_loaders/recipe/MoltenCellLoader.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f338842ce1..ac0fe978a9 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ *.ctxt # IDEA files +.idea/ *.iml *.ipr *.iws diff --git a/gradle.properties b/gradle.properties index ff2f1c8178..8f238432bb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,7 +23,7 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 majorUpdate=0 minorUpdate=5 -buildNumber=18 +buildNumber=19 apiVersion=11 ic2Version=2.2.828-experimental applecoreVersion=1.7.10-3.1.1 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java index 295bfd144c..119b04bb9e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -73,7 +73,7 @@ public class MoltenCellLoader implements IWerkstoffRunnable { //Tank "Recipe" final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); - FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(cell), Materials.Empty.getCells(1)); + FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); GT_Utility.addFluidContainerData(data); GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(WerkstoffLoader.cellMolten), new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), GT_Values.NF); GT_Values.RA.addFluidCannerRecipe(werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); -- cgit From b72ce225d1f00be781653f659d68bb836863905f Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Fri, 30 Jul 2021 04:49:49 -0600 Subject: Delete TT_PyrolyseOven.java Fix merge conflict Former-commit-id: a2d7e02649610fc0c2c30dc480e4aa2b83ee30a6 --- .../multi/GT_Replacement/TT_PyrolyseOven.java | 209 --------------------- 1 file changed, 209 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java deleted file mode 100644 index 6ceb2791cf..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java +++ /dev/null @@ -1,209 +0,0 @@ -package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; - -import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; -import com.github.technus.tectech.mechanics.structure.IStructureDefinition; -import com.github.technus.tectech.mechanics.structure.StructureDefinition; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTech_API; -import gregtech.api.enums.HeatingCoilLevel; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; -import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; - -public class TT_PyrolyseOven extends TT_Abstract_GT_Replacement_Coils { - private static final int TEXTURE_INDEX = 1090; - private static final int pollutionPerTick = 30; - - public TT_PyrolyseOven(Object unused, Object unused2) { - super(1159, "multimachine.pyro", "Pyrolyse Oven"); - } - - public TT_PyrolyseOven(String aName) { - super(aName); - } - - private static final Block casingBlock; - private static final int casingMeta; - - private int blocks = 0; - - static { - if (Loader.isModLoaded("dreamcraft")) { - casingBlock = GameRegistry.findBlock("dreamcraft", "gt.blockcasingsNH"); - casingMeta = 2; - } else { - casingBlock = GregTech_API.sBlockCasings1; - casingMeta = 0; - } - } - - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() - .addShape("main", - transpose(new String[][]{ - {"AAAAA", "ACCCA", "ACCCA", "ACCCA", "AAAAA"}, - {"AAAAA", "A---A", "A---A", "A---A", "AAAAA"}, - {"AAAAA", "A---A", "A---A", "A---A", "AAAAA"}, - {"BB~BB", "BDDDB", "BDDDB", "BDDDB", "BBBBB"} - }) - ).addElement( - 'D', - CoilAdder.getINSTANCE() - ).addElement( - 'A', - onElementPass(x -> x.blocks++, - ofBlock( - casingBlock, - casingMeta - ) - ) - ).addElement( - 'B', - ofChain( - ofHatchAdder( - TT_PyrolyseOven::addClassicOutputToMachineList, TEXTURE_INDEX, - 1 - ), - ofHatchAdder( - TT_PyrolyseOven::addEnergyIOToMachineList, TEXTURE_INDEX, - 1 - ), - ofHatchAdder( - TT_PyrolyseOven::addClassicMaintenanceToMachineList, TEXTURE_INDEX, - 1 - ), - onElementPass(x -> x.blocks++, - ofBlock( - casingBlock, - casingMeta - ) - ) - ) - - ).addElement( - 'C', - ofChain( - ofHatchAdder( - TT_PyrolyseOven::addClassicInputToMachineList, TEXTURE_INDEX, - 2 - ), - ofHatchAdder( - TT_PyrolyseOven::addClassicMufflerToMachineList, TEXTURE_INDEX, - 2 - ), - onElementPass(x -> x.blocks++, - ofBlock( - casingBlock, - casingMeta - ) - ) - ) - - ) - .build(); - - @Override - public IStructureDefinition getStructure_EM() { - return STRUCTURE_DEFINITION; - } - - @Override - protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - this.setCoilHeat(HeatingCoilLevel.None); - this.blocks = 0; - return this.structureCheck_EM("main", 2,3,0) && this.blocks >= 60; - } - - private static final String[] desc = new String[]{ - "Coke Oven", - "Controller block for the Pyrolyse Oven", - "Industrial Charcoal producer", - "Processing speed scales linearly with Coil tier:", - "CuNi: 50%, FeAlCr: 100%, Ni4Cr: 150%, Fe50CW: 200%, etc.", - "EU/t is not affected by Coil tier", - "Creates up to: " + 20 * pollutionPerTick + " Pollution per Second", - ADV_STR_CHECK, - TT_BLUEPRINT - }; - - @Override - public String[] getDescription() { - return desc; - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[8][66], TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_GLOW).glow().build()))}; - } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[8][66]}; - } - - @Override - public boolean checkRecipe_EM(ItemStack aStack) { - ItemStack[] tInputs = getCompactedInputs(); - FluidStack[] tFluids = getCompactedFluids(); - - if (tInputs.length <= 0) - return false; - - long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - - if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) - return false; - setEfficiencyAndOc(tRecipe); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) - this.mEUt = (-this.mEUt); - this.mMaxProgresstime = Math.max(mMaxProgresstime * 2 / (1 + this.heatingCoilLevel.getTier()), 1); - if (tRecipe.mOutputs.length > 0) - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; - if (tRecipe.mFluidOutputs.length > 0) - this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; - updateSlots(); - return true; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new TT_PyrolyseOven(this.mName); - } - - @Override - public int getPollutionPerTick(ItemStack aStack) { - return pollutionPerTick; - } - - private static final String[] sfStructureDescription = new String[] { - "0 - Air", - "1 - Output Hatch, Output Bus, Energy Hatch, Maintenance Hatch, Casing", - "2 - Input Hatch, Input Bus, Muffler Hatch, Casing", - "60 Casings at least!" - }; - - @Override - public String[] getStructureDescription(ItemStack itemStack) { - return sfStructureDescription; - } - - @Override - public void construct(ItemStack itemStack, boolean b) { - this.structureBuild_EM("main", 2,3,0, b, itemStack); - } -} -- cgit From af00642874341e9a3e9b78e6fb0104151a49f041 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Fri, 30 Jul 2021 19:15:32 +0800 Subject: Use experimental branch since it's merged Former-commit-id: dea0d9300df04dc3e5fa22a53adbe1e70b923e31 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 9e27f59691..8a484f5f98 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -128,7 +128,7 @@ dependencies { //hard deps compile("net.industrial-craft:industrialcraft-2:$ic2Version:dev") //jitpack - compile("com.github.GTNewHorizons:GT5-Unofficial:structurelib-integration-SNAPSHOT:dev") { + compile("com.github.GTNewHorizons:GT5-Unofficial:experimental-SNAPSHOT:dev") { this.isChanging = true } compile ("com.github.GTNewHorizons:StructureLib:1.0.6:deobf") -- cgit From b897968dce09006991d82cd5d856f0e4668cc698 Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Wed, 4 Aug 2021 00:26:11 -0600 Subject: Fix Ross void miner Former-commit-id: 1efa09636673739423ea8e667fe0096e7eb30ee6 --- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 31 +++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index 267f9d372e..21596437e9 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -309,16 +309,18 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri multiplier = TIER_MULTIPLIER; } - private void getDropMapBartworks(ModDimensionDef finalDef, int aID) { + private void getDropMapRoss(int aID) { Consumer addToList = makeAddToList(); if (aID == ConfigHandler.ross128BID) BW_WorldGenRoss128b.sList.forEach(addToList); else if (aID == ConfigHandler.ross128BAID) BW_WorldGenRoss128ba.sList.forEach(addToList); - else { - addOresVeinsBartworks(finalDef, addToList); - addSmallOresBartworks(finalDef); - } + } + + private void getDropMapBartworks(ModDimensionDef finalDef) { + Consumer addToList = makeAddToList(); + addOresVeinsBartworks(finalDef, addToList); + addSmallOresBartworks(finalDef); } private Consumer makeAddToList() { @@ -373,18 +375,17 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri dropmap.values().forEach(f -> totalWeight += f); } - private void handleDimBasedDrops(ModDimensionDef finalDef, int id) { - if (id != ConfigHandler.ross128BID && id != ConfigHandler.ross128BAID) - getDropMapSpace(finalDef); - } - private void handleModDimDef(int id) { - if ((id <= 1 && id >= -1) || id == 7) + if ((id <= 1 && id >= -1) || id == 7) { getDropMapVanilla(); - Optional.ofNullable(makeModDimDef()).ifPresent(def -> { - handleDimBasedDrops(def, id); - getDropMapBartworks(def, id); - }); + } else if (id == ConfigHandler.ross128BID || id == ConfigHandler.ross128BAID) { + getDropMapRoss(id); + } else { + Optional.ofNullable(makeModDimDef()).ifPresent(def -> { + getDropMapSpace(def); + getDropMapBartworks(def); + }); + } } private void calculateDropMap() { -- cgit From 8a46c870fdecd5d6b08c298656912341125d0f35 Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Fri, 6 Aug 2021 15:42:41 +0200 Subject: Fix void miner ore generation Fix ores that are impossible to get because of their weight < 1 Former-commit-id: 3522bd46ed16293667c73626e16fd10f616fbe69 --- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index 21596437e9..a383eb1923 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.crossmod.galacticgreg; +//import com.github.bartimaeusnek.bartworks.MainMod; + import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_Layer_Space; import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_SmallPieces_Space; import bloodasp.galacticgreg.GalacticGreg; @@ -268,12 +270,19 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } private Pair getOreDamage() { - int curentWeight = 0; + /* + dropmap.values().forEach(f -> { + if(f < 1.f) + MainMod.LOGGER.info(f); + }); + */ + + float curentWeight = 0.f; while (true) { - int randomeint = (Math.abs(XSTR.XSTR_INSTANCE.nextInt((int) Math.ceil(totalWeight)))); + float randomnumber = XSTR.XSTR_INSTANCE.nextFloat() * totalWeight; for (Map.Entry, Float> entry : dropmap.entrySet()) { curentWeight += entry.getValue(); - if (randomeint < curentWeight) + if (randomnumber < curentWeight) return entry.getKey(); } } -- cgit From ee45c2ad5e78d3773e73102d7a7ff8d9774ba760 Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Fri, 6 Aug 2021 15:49:14 +0200 Subject: Remove comments Former-commit-id: 1062f70ea6f76f2fe2fbffdcbae8692f5cd0f7d4 --- .../crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index a383eb1923..583d01d88b 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -22,8 +22,6 @@ package com.github.bartimaeusnek.crossmod.galacticgreg; -//import com.github.bartimaeusnek.bartworks.MainMod; - import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_Layer_Space; import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_SmallPieces_Space; import bloodasp.galacticgreg.GalacticGreg; @@ -270,13 +268,6 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } private Pair getOreDamage() { - /* - dropmap.values().forEach(f -> { - if(f < 1.f) - MainMod.LOGGER.info(f); - }); - */ - float curentWeight = 0.f; while (true) { float randomnumber = XSTR.XSTR_INSTANCE.nextFloat() * totalWeight; -- cgit From 57ec3824cf15f019942a93728a526c67bd8d0f8e Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Sat, 7 Aug 2021 00:13:59 +0200 Subject: Fix ross ores & generation chances Fixes issue where ross planets have all ores from both of them & Fixes weight override when the same ore appears more than once Former-commit-id: a79536975a6362224cab0cb7844210550d2eb7ab --- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 45 +++++++++++++--------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index 583d01d88b..8b65acd176 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -215,19 +215,26 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } } + private void put(Pair key, float value){ + if(!dropmap.containsKey(key)) + dropmap.put(key, value); + else + dropmap.put(key, dropmap.get(key) + value); + } + private void getDropsVanillaVeins(Predicate oreLayerPredicate) { GT_Worldgen_GT_Ore_Layer.sList.stream().filter(gt_worldgen -> gt_worldgen.mEnabled && oreLayerPredicate.test(gt_worldgen)).forEach(element -> { - dropmap.put(new Pair<>((int) element.mPrimaryMeta,false), (float) element.mWeight); - dropmap.put(new Pair<>((int) element.mSecondaryMeta,false), (float) element.mWeight); - dropmap.put(new Pair<>((int) element.mSporadicMeta,false), (element.mWeight / 8f)); - dropmap.put(new Pair<>((int) element.mBetweenMeta,false), (element.mWeight / 8f)); + put(new Pair<>((int) element.mPrimaryMeta,false), (float) element.mWeight); + put(new Pair<>((int) element.mSecondaryMeta,false), (float) element.mWeight); + put(new Pair<>((int) element.mSporadicMeta,false), (element.mWeight / 8f)); + put(new Pair<>((int) element.mBetweenMeta,false), (element.mWeight / 8f)); } ); } private void getDropsVanillaSmallOres(Predicate smallOresPredicate) { GT_Worldgen_GT_Ore_SmallPieces.sList.stream().filter(gt_worldgen -> gt_worldgen.mEnabled && smallOresPredicate.test(gt_worldgen)).forEach(element -> - dropmap.put(new Pair<>((int) element.mMeta,false), (float) element.mAmount) + put(new Pair<>((int) element.mMeta,false), (float) element.mAmount) ); } @@ -248,10 +255,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri space.forEach( element -> { - dropmap.put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mPrimaryMeta,false), (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); - dropmap.put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSecondaryMeta,false), (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); - dropmap.put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSporadicMeta,false), (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); - dropmap.put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mBetweenMeta,false), (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); + put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mPrimaryMeta,false), (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); + put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSecondaryMeta,false), (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); + put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSporadicMeta,false), (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); + put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mBetweenMeta,false), (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); } ); } @@ -263,7 +270,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri space.forEach( element -> - dropmap.put(new Pair<>((int) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mMeta,false), (float) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mAmount) + put(new Pair<>((int) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mMeta,false), (float) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mAmount) ); } @@ -311,10 +318,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private void getDropMapRoss(int aID) { Consumer addToList = makeAddToList(); - if (aID == ConfigHandler.ross128BID) - BW_WorldGenRoss128b.sList.forEach(addToList); - else if (aID == ConfigHandler.ross128BAID) - BW_WorldGenRoss128ba.sList.forEach(addToList); + BW_OreLayer.sList.stream() + .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_OreLayer && gt_worldgen.isGenerationAllowed(null, aID, 0)) + .collect(Collectors.toSet()) + .forEach(addToList); } private void getDropMapBartworks(ModDimensionDef finalDef) { @@ -327,10 +334,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri return element -> { List> data = element.getStacksRawData(); for (int i = 0; i < data.size(); i++) { - if (i < data.size()-1) - dropmap.put(data.get(i), (float) element.mWeight); + if (i < data.size()-2) + put(data.get(i), (float) element.mWeight); else - dropmap.put(data.get(i), (element.mWeight/8f)); + put(data.get(i), (element.mWeight/8f)); } }; } @@ -361,13 +368,13 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri space.forEach( element -> - dropmap.put(new Pair<>(((BW_Worldgen_Ore_SmallOre_Space) element).mPrimaryMeta, ((BW_Worldgen_Ore_SmallOre_Space) element).bwOres != 0), (float) ((BW_Worldgen_Ore_SmallOre_Space) element).mDensity) + put(new Pair<>(((BW_Worldgen_Ore_SmallOre_Space) element).mPrimaryMeta, ((BW_Worldgen_Ore_SmallOre_Space) element).bwOres != 0), (float) ((BW_Worldgen_Ore_SmallOre_Space) element).mDensity) ); } catch (NullPointerException ignored) {} } private void handleExtraDrops(int id) { - Optional.ofNullable(getExtraDropsDimMap().get(id)).ifPresent(e -> e.forEach(f -> dropmap.put(f.getKey(), f.getValue()))); + Optional.ofNullable(getExtraDropsDimMap().get(id)).ifPresent(e -> e.forEach(f -> put(f.getKey(), f.getValue()))); } private void calculateTotalWeight() { -- cgit From eaa509aca3202388871fa482c1cc56bda4cd81e0 Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Sun, 8 Aug 2021 00:12:27 +0200 Subject: Fix server freeze when miner is placed in garden dim or any other dim without ores & name changes Former-commit-id: 2f4afe6749189afebef3e646a52be48ed70ccd4e --- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 42 ++++++++++++---------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index 8b65acd176..370a2b579e 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -140,9 +140,15 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri @Override protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { makeDropMap(); - handleFluidConsumption(); - handleOutputs(); - return true; + if(dropmap.size() > 0){ + handleFluidConsumption(); + handleOutputs(); + return true; + } + else{ + stopMachine(); + return false; + } } @Override @@ -215,7 +221,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } } - private void put(Pair key, float value){ + private void addDrop(Pair key, float value){ if(!dropmap.containsKey(key)) dropmap.put(key, value); else @@ -224,17 +230,17 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private void getDropsVanillaVeins(Predicate oreLayerPredicate) { GT_Worldgen_GT_Ore_Layer.sList.stream().filter(gt_worldgen -> gt_worldgen.mEnabled && oreLayerPredicate.test(gt_worldgen)).forEach(element -> { - put(new Pair<>((int) element.mPrimaryMeta,false), (float) element.mWeight); - put(new Pair<>((int) element.mSecondaryMeta,false), (float) element.mWeight); - put(new Pair<>((int) element.mSporadicMeta,false), (element.mWeight / 8f)); - put(new Pair<>((int) element.mBetweenMeta,false), (element.mWeight / 8f)); + addDrop(new Pair<>((int) element.mPrimaryMeta,false), (float) element.mWeight); + addDrop(new Pair<>((int) element.mSecondaryMeta,false), (float) element.mWeight); + addDrop(new Pair<>((int) element.mSporadicMeta,false), (element.mWeight / 8f)); + addDrop(new Pair<>((int) element.mBetweenMeta,false), (element.mWeight / 8f)); } ); } private void getDropsVanillaSmallOres(Predicate smallOresPredicate) { GT_Worldgen_GT_Ore_SmallPieces.sList.stream().filter(gt_worldgen -> gt_worldgen.mEnabled && smallOresPredicate.test(gt_worldgen)).forEach(element -> - put(new Pair<>((int) element.mMeta,false), (float) element.mAmount) + addDrop(new Pair<>((int) element.mMeta,false), (float) element.mAmount) ); } @@ -255,10 +261,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri space.forEach( element -> { - put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mPrimaryMeta,false), (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); - put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSecondaryMeta,false), (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); - put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSporadicMeta,false), (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); - put(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mBetweenMeta,false), (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); + addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mPrimaryMeta,false), (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); + addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSecondaryMeta,false), (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); + addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSporadicMeta,false), (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); + addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mBetweenMeta,false), (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); } ); } @@ -270,7 +276,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri space.forEach( element -> - put(new Pair<>((int) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mMeta,false), (float) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mAmount) + addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mMeta,false), (float) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mAmount) ); } @@ -335,9 +341,9 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri List> data = element.getStacksRawData(); for (int i = 0; i < data.size(); i++) { if (i < data.size()-2) - put(data.get(i), (float) element.mWeight); + addDrop(data.get(i), (float) element.mWeight); else - put(data.get(i), (element.mWeight/8f)); + addDrop(data.get(i), (element.mWeight/8f)); } }; } @@ -368,13 +374,13 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri space.forEach( element -> - put(new Pair<>(((BW_Worldgen_Ore_SmallOre_Space) element).mPrimaryMeta, ((BW_Worldgen_Ore_SmallOre_Space) element).bwOres != 0), (float) ((BW_Worldgen_Ore_SmallOre_Space) element).mDensity) + addDrop(new Pair<>(((BW_Worldgen_Ore_SmallOre_Space) element).mPrimaryMeta, ((BW_Worldgen_Ore_SmallOre_Space) element).bwOres != 0), (float) ((BW_Worldgen_Ore_SmallOre_Space) element).mDensity) ); } catch (NullPointerException ignored) {} } private void handleExtraDrops(int id) { - Optional.ofNullable(getExtraDropsDimMap().get(id)).ifPresent(e -> e.forEach(f -> put(f.getKey(), f.getValue()))); + Optional.ofNullable(getExtraDropsDimMap().get(id)).ifPresent(e -> e.forEach(f -> addDrop(f.getKey(), f.getValue()))); } private void calculateTotalWeight() { -- cgit From 97dba8b15bbcea8ae17ac46ab02ec8088a0be42e Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Sun, 8 Aug 2021 00:35:01 +0200 Subject: Change logic Former-commit-id: 0b1528224ccf3921febe2d5b74df97538ba86a06 --- .../crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index 370a2b579e..6f304fda39 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -140,7 +140,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri @Override protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { makeDropMap(); - if(dropmap.size() > 0){ + if(totalWeight != 0.f){ handleFluidConsumption(); handleOutputs(); return true; -- cgit From 9f839d9841d8a107022d16cd7605db827563363b Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Sat, 7 Aug 2021 18:10:11 -0600 Subject: Format numbers in tooltips Former-commit-id: fd8e7ed0571e12f19755312f0240aa4827986b85 --- .../bartworks/client/gui/GT_GUIContainer_LESU.java | 11 ++++++----- .../common/tileentities/multis/GT_TileEntity_LESU.java | 2 +- .../common/tileentities/tiered/GT_MetaTileEntity_Diode.java | 10 +++++++++- .../tiered/GT_MetaTileEntity_EnergyDistributor.java | 11 ++++++++++- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 10 +++++----- .../tiered/TT_MetaTileEntity_LowPowerLaserBox.java | 6 +++++- .../tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java | 4 +++- .../tiered/TT_MetaTileEntity_LowPowerLaserHatch.java | 4 +++- 8 files changed, 42 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java index c0d2ed88c6..570fe9c0b4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -30,6 +30,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_GUIContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; @@ -56,11 +57,11 @@ public class GT_GUIContainer_LESU extends GT_GUIContainer { this.drawString(this.fontRendererObj, "L.E.S.U.", 11, 8, 16448255); if (this.mContainer != null) { String percell = String.valueOf(ConfigHandler.energyPerCell).substring(1); - this.drawString(this.fontRendererObj, "EU: " + this.mContainer.mEnergy, 11, 16, 16448255); - this.drawString(this.fontRendererObj, "MAX: " + (this.c.getBaseMetaTileEntity().isActive() ? this.mContainer.mOutput + percell : Integer.toString(0)), 11, 24, 16448255); - this.drawString(this.fontRendererObj, "MAX EU/t IN: " + this.mContainer.mInput, 11, 32, 16448255); - this.drawString(this.fontRendererObj, "EU/t OUT: " + this.mContainer.mOutput, 11, 40, 16448255); - this.drawString(this.fontRendererObj, "AMP/t IN/OUT: " + this.c.getBaseMetaTileEntity().getInputAmperage(), 11, 48, 16448255); + this.drawString(this.fontRendererObj, "EU: " + GT_Utility.formatNumbers(this.mContainer.mEnergy), 11, 16, 16448255); + this.drawString(this.fontRendererObj, "MAX: " + (this.c.getBaseMetaTileEntity().isActive() ? GT_Utility.formatNumbers(this.mContainer.mOutput) + percell : Integer.toString(0)), 11, 24, 16448255); + this.drawString(this.fontRendererObj, "MAX EU/t IN: " + GT_Utility.formatNumbers(this.mContainer.mInput), 11, 32, 16448255); + this.drawString(this.fontRendererObj, "EU/t OUT: " + GT_Utility.formatNumbers(this.mContainer.mOutput), 11, 40, 16448255); + this.drawString(this.fontRendererObj, "AMP/t IN/OUT: " + GT_Utility.formatNumbers(this.c.getBaseMetaTileEntity().getInputAmperage()), 11, 48, 16448255); if (this.c.maxEUStore() >= Long.MAX_VALUE - 1) { this.drawString(this.fontRendererObj, StatCollector.translateToLocal("tooltip.LESU.0.name"), 11, 56, Color.YELLOW.getRGB()); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index e292237e58..84837e8760 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -160,7 +160,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { ArrayList e = new ArrayList<>(); String[] dsc = StatCollector.translateToLocal("tooltip.tile.lesu.0.name").split(";"); Collections.addAll(e, dsc); - e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + ConfigHandler.energyPerCell + "EU"); + e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + GT_Utility.formatNumbers(ConfigHandler.energyPerCell) + "EU"); dsc = StatCollector.translateToLocal("tooltip.tile.lesu.2.name").split(";"); Collections.addAll(e, dsc); e.add(ChatColorHelper.RED + StatCollector.translateToLocal("tooltip.tile.lesu.3.name")); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index 28e4bd2d7f..ee32f18f84 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -124,6 +124,14 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{this.mDescription, StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; + return new String[]{ + this.mDescription, + StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.maxAmperesIn()), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.maxAmperesOut()), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java index e011d08609..49f89d1592 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java @@ -29,6 +29,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Transformer; +import gregtech.api.util.GT_Utility; import net.minecraft.util.StatCollector; public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Transformer { @@ -71,7 +72,15 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans } public String[] getDescription() { - return new String[]{StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; + return new String[]{ + StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.maxAmperesIn()), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.maxAmperesOut()), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index 7b554447a2..ba0e4d7bae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -63,11 +63,11 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { int tSpecial; if (recipeDesc == null) { if (tEUt != 0) { - GT_NEI_DefaultHandler.drawText(10, lines[0], this.trans("152", "Total: ") + (long) tDuration * (long) tEUt + " EU", -16777216); - GT_NEI_DefaultHandler.drawText(10, lines[1], this.trans("153", "Usage: ") + tEUt + " EU/t", -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[0], this.trans("152", "Total: ") + GT_Utility.formatNumbers((long) tDuration * (long) tEUt) + " EU", -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[1], this.trans("153", "Usage: ") + GT_Utility.formatNumbers(tEUt) + " EU/t", -16777216); if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - GT_NEI_DefaultHandler.drawText(10, lines[2], this.trans("154", "Voltage: ") + tEUt / this.mRecipeMap.mAmperage + " EU", -16777216); - GT_NEI_DefaultHandler.drawText(10, lines[3], this.trans("155", "Amperage: ") + this.mRecipeMap.mAmperage, -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[2], this.trans("154", "Voltage: ") + GT_Utility.formatNumbers(tEUt / this.mRecipeMap.mAmperage) + " EU", -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[3], this.trans("155", "Amperage: ") + GT_Utility.formatNumbers(this.mRecipeMap.mAmperage), -16777216); } else { GT_NEI_DefaultHandler.drawText(10, lines[2], this.trans("156", "Voltage: unspecified"), -16777216); GT_NEI_DefaultHandler.drawText(10, lines[3], this.trans("157", "Amperage: unspecified"), -16777216); @@ -76,7 +76,7 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { if (tDuration > 0) { - GT_NEI_DefaultHandler.drawText(10, lines[4], this.trans("158", "Time: ") + String.format("%.2f " + this.trans("161", " secs"), 0.05F * (float) tDuration), -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[4], this.trans("158", "Time: ") + GT_Utility.formatNumbers(0.05d * tDuration) + this.trans("161", " secs"), -16777216); } tSpecial = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java index abecbe811f..3247af4861 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java @@ -28,6 +28,7 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLaserThingy { @@ -145,6 +146,9 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase @Override public String[] getDescription() { - return new String[]{"Like a Tranformer... but for LAZORZ", "Transferrate: " + ChatColorHelper.YELLOW + this.getTotalPower() + ChatColorHelper.WHITE + " EU/t", BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; + return new String[]{ + "Like a Tranformer... but for LAZORZ", + "Transfer rate: " + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + ChatColorHelper.WHITE + " EU/t", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java index 307e9307cb..eef208a71e 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java @@ -27,6 +27,7 @@ import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_H import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.util.GT_Utility; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; @@ -70,7 +71,8 @@ public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hat public String[] getDescription() { return new String[]{ this.mDescription, - StatCollector.translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": " + EnumChatFormatting.YELLOW + this.getTotalPower() + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + EnumChatFormatting.RESET + " EU/t", BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java index 922dea51a8..7274d37af5 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java @@ -27,6 +27,7 @@ import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_H import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.util.GT_Utility; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; @@ -45,7 +46,8 @@ public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatc public String[] getDescription() { return new String[]{ this.mDescription, - StatCollector.translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " + EnumChatFormatting.YELLOW + this.getTotalPower() + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + EnumChatFormatting.RESET + " EU/t", BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } -- cgit From 4bf2f1f72906c2a9fa64b4dd127a1d6a37529419 Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Sat, 7 Aug 2021 18:10:33 -0600 Subject: Handle tier out of bounds Former-commit-id: 82c6160b47472af821b83dc518442f90bbe4c365 --- .../tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java | 2 +- .../tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java | 3 ++- .../tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java | 2 +- .../emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index f13352e09d..18d075bc36 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -346,7 +346,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl FluidStack[] tFluids = this.getStoredFluids().toArray(new FluidStack[0]); long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(nominalV)); + byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); GT_Recipe tRecipe; if (circuitMode > 0 && Arrays.stream(tInputs).anyMatch(e -> GT_Utility.areStacksEqual(e, GT_Utility.getIntegratedCircuit(circuitMode), true))) { List modInputs = Arrays.stream(tInputs).filter(Objects::nonNull).filter(e -> !e.getItem().equals(GT_Utility.getIntegratedCircuit(circuitMode).getItem())).collect(Collectors.toList()); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 7c1f13d200..15105babf0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -45,6 +45,7 @@ import java.util.ArrayList; import java.util.List; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_Values.V; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_DistillationTower { @@ -219,7 +220,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati } long tVoltage = this.getMaxInputVoltage(); - byte tTier = (byte) Math.max(0, GT_Utility.getTier(tVoltage)); + byte tTier = (byte) Math.max(0, Math.min(GT_Utility.getTier(tVoltage), V.length - 1)); long nominalV = BW_Util.getnominalVoltage(this); FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 865f06e6a7..1877a88183 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -99,7 +99,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(nominalV)); + byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], null, tInputs); boolean found_Recipe = false; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java index dd0dc8f325..cb74678162 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java @@ -106,7 +106,7 @@ public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlo ItemStack outputItems = null; long tVoltage = this.getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(tVoltage), V.length - 1)); GT_Recipe tRecipe = TCRecipeHandler.alchemicalConstructHandler.findRecipe(this.getBaseMetaTileEntity(),null,false, false, V[tTier], null, stack, tInputs); ItemStack helper = (ItemStack) tRecipe.mSpecialItems; NBTTagCompound tagCompound = helper.getTagCompound(); -- cgit From eebc94f4e0b7434ff93990239f84580e5400114d Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Sun, 8 Aug 2021 08:53:49 -0600 Subject: Add formatting to getInfoData() Former-commit-id: 7a846b13949e026b7757b49406681d000e6f6c83 --- .../classic/BW_TileEntity_HeatedWaterPump.java | 6 +++++- .../tileentities/multis/GT_TileEntity_THTR.java | 10 +++++----- .../multis/mega/GT_TileEntity_MegaBlastFurnace.java | 20 +++++++++++++++++++- .../tiered/GT_MetaTileEntity_RadioHatch.java | 19 +++++++++++++++++-- .../crossmod/tectech/TecTechEnabledMulti.java | 21 +++++++++++++++++++-- 5 files changed, 65 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index e22b440150..0df48330d5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import gregtech.api.util.GT_Utility; import gregtech.common.GT_Pollution; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -328,7 +329,10 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public String[] getInfoData() { - return new String[]{StatCollector.translateToLocal("tooltip.tile.waterpump.0.name") + " " + ConfigHandler.mbWaterperSec + StatCollector.translateToLocal("tooltip.tile.waterpump.1.name"), StatCollector.translateToLocal("tooltip.tile.waterpump.2.name")}; + return new String[]{ + StatCollector.translateToLocal("tooltip.tile.waterpump.0.name") + " " + + GT_Utility.formatNumbers(ConfigHandler.mbWaterperSec) + StatCollector.translateToLocal("tooltip.tile.waterpump.1.name"), + StatCollector.translateToLocal("tooltip.tile.waterpump.2.name")}; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index a7ce0009ec..c7a06914f5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -307,11 +307,11 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public String[] getInfoData() { return new String[]{ - "Progress:", this.mProgresstime / 20 + "secs", this.mMaxProgresstime / 20 + "secs", - "BISO-Pebbles:", this.BISOPeletSupply + "pcs.", - "TRISO-Pebbles:", this.TRISOPeletSupply + "pcs.", - "Helium-Level:", this.HeliumSupply+"L / "+ GT_TileEntity_THTR.HELIUM_NEEDED +"L", - "Coolant/t:", this.savedBISO+this.savedTRISO >= 100000 ? (long) ((0.00711111111111111111111111111111D * (double) this.savedTRISO + 0.00474074074074074074074074074074D * (double) this.savedBISO))+"L/t" : "0L/t", + "Progress:", GT_Utility.formatNumbers(this.mProgresstime / 20) + "secs", GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "secs", + "BISO-Pebbles:", GT_Utility.formatNumbers(this.BISOPeletSupply) + "pcs.", + "TRISO-Pebbles:", GT_Utility.formatNumbers(this.TRISOPeletSupply) + "pcs.", + "Helium-Level:", GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + GT_Utility.formatNumbers(GT_TileEntity_THTR.HELIUM_NEEDED) + "L", + "Coolant/t:", GT_Utility.formatNumbers(this.savedBISO+this.savedTRISO >= 100000 ? (long) ((0.00711111111111111111111111111111D * (double) this.savedTRISO + 0.00474074074074074074074074074074D * (double) this.savedBISO)) : 0) + "L/t", "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 18d075bc36..8c6a8b2ce3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -311,7 +311,25 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl } } - return new String[]{StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + this.mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + this.mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + -this.lEUt + EnumChatFormatting.RESET + " EU/t", StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + this.getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(this.getMaxInputVoltage())] + EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + (this.getIdealStatus() - this.getRepairStatus()) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW + (float) this.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %"}; + return new String[]{ + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + GT_Utility.formatNumbers(-this.lEUt) + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getMaxInputVoltage()) + EnumChatFormatting.RESET + " EU/t(*2A) " + + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(this.getMaxInputVoltage())] + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + (this.getIdealStatus() - this.getRepairStatus()) + EnumChatFormatting.RESET + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + + EnumChatFormatting.YELLOW + (float) this.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %"}; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 932869da24..d4269cc534 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -250,9 +250,24 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @Override public String[] getInfoData() { if (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert) != 0) - return new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + this.material, StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + this.sievert, StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + this.mass, StatCollector.translateToLocal("tooltip.tile.radhatch.5.name") + " " + +((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert) * 60)) + StatCollector.translateToLocal("tooltip.tile.radhatch.6.name") + "/" + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 + StatCollector.translateToLocal("tooltip.tile.radhatch.7.name") + "/" + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.8.name") + "/" + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 / 60 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.9.name")}; + return new String[]{ + StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + this.material, + StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + this.sievert, + StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + this.mass, + StatCollector.translateToLocal("tooltip.tile.radhatch.5.name") + " " + + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert) * 60)) + + StatCollector.translateToLocal("tooltip.tile.radhatch.6.name") + "/" + + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 + + StatCollector.translateToLocal("tooltip.tile.radhatch.7.name") + "/" + + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 / 60 + + StatCollector.translateToLocal("tooltip.tile.radhatch.8.name") + "/" + + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 / 60 / 60 + + StatCollector.translateToLocal("tooltip.tile.radhatch.9.name")}; else - return new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + StatCollector.translateToLocal("tooltip.bw.empty.name"), StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + "0", StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + "0"}; + return new String[]{ + StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + StatCollector.translateToLocal("tooltip.bw.empty.name"), + StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + "0", + StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + "0"}; } public boolean isSimpleMachine() { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java index bda1ae72ca..aea0bd9ec9 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java @@ -82,8 +82,25 @@ public interface TecTechEnabledMulti { } return new String[]{ - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " - + EnumChatFormatting.GREEN + multiBlockBase.mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + multiBlockBase.mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + -multiBlockBase.mEUt + EnumChatFormatting.RESET + " EU/t", StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + multiBlockBase.getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(multiBlockBase.getMaxInputVoltage())] + EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + (multiBlockBase.getIdealStatus() - multiBlockBase.getRepairStatus()) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW + (float) multiBlockBase.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %", BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(multiBlockBase.mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(multiBlockBase.mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + GT_Utility.formatNumbers(-multiBlockBase.mEUt) + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(multiBlockBase.getMaxInputVoltage()) + EnumChatFormatting.RESET + " EU/t(*2A) " + + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(multiBlockBase.getMaxInputVoltage())] + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + (multiBlockBase.getIdealStatus() - multiBlockBase.getRepairStatus()) + EnumChatFormatting.RESET + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + + EnumChatFormatting.YELLOW + (float) multiBlockBase.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; } } -- cgit From ae080d03b2db755c96330717178c95f4cf8f8907 Mon Sep 17 00:00:00 2001 From: GlodBlock <60341015+GlodBlock@users.noreply.github.com> Date: Tue, 10 Aug 2021 21:06:54 +0800 Subject: stop it generating shit in GregTech.lang Former-commit-id: dd09c2b8efd59ee944c04b0008992eee16d48a23 --- .../system/material/BW_MetaGeneratedBlocks_Casing.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java index cfe8b2f28f..df268df8aa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -87,13 +87,16 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple @Override protected void doRegistrationStuff(Werkstoff tMaterial) { GregTech_API.registerMachineBlock(this, -1); - Optional.ofNullable(tMaterial) - .ifPresent(pMaterial -> + if (tMaterial == null) return; + if (tMaterial.hasItemType(OrePrefixes.plate) && tMaterial.hasItemType(OrePrefixes.gearGtSmall)) { + Optional.of(tMaterial) + .ifPresent(pMaterial -> GT_LanguageManager.addStringLocalization( this.getUnlocalizedName() + "." + pMaterial.getmID() + ".name", _prefixes.mLocalizedMaterialPre + pMaterial.getDefaultName() + _prefixes.mLocalizedMaterialPost ) - ); + ); + } } @Override @@ -139,4 +142,4 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple .map(te -> (BW_MetaGenerated_Block_TE) te) .ifPresent(te -> te.mMetaData = (short) meta); } -} \ No newline at end of file +} -- cgit From 59c6032ac47c49881d766c70668e661fe778cf94 Mon Sep 17 00:00:00 2001 From: GlodBlock <60341015+GlodBlock@users.noreply.github.com> Date: Wed, 11 Aug 2021 19:11:57 +0800 Subject: add another check for oredict Former-commit-id: 934612d5628464733524eb0870d889eaff997978 --- .../bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java index df268df8aa..74a40e6a28 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -88,7 +88,7 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple protected void doRegistrationStuff(Werkstoff tMaterial) { GregTech_API.registerMachineBlock(this, -1); if (tMaterial == null) return; - if (tMaterial.hasItemType(OrePrefixes.plate) && tMaterial.hasItemType(OrePrefixes.gearGtSmall)) { + if ((tMaterial.doesOreDictedItemExists(OrePrefixes.plate) && tMaterial.doesOreDictedItemExists(OrePrefixes.gearGtSmall)) || (tMaterial.hasItemType(OrePrefixes.plate) && tMaterial.hasItemType(OrePrefixes.gearGtSmall))) { Optional.of(tMaterial) .ifPresent(pMaterial -> GT_LanguageManager.addStringLocalization( -- cgit From b5f9f8cdde420e19ab3555051b1f453338d33490 Mon Sep 17 00:00:00 2001 From: GlodBlock <60341015+GlodBlock@users.noreply.github.com> Date: Wed, 11 Aug 2021 19:13:10 +0800 Subject: add config for block casings Former-commit-id: 1aba363d4499cf9cddc55640b24e78ed2dad074a --- .../github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 5833067110..b8e87bf046 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -70,6 +70,9 @@ public class ConfigHandler { public static byte maxTierRoss; + public static boolean disableBoltedBlocksCasing = false; + public static boolean disableReboltedBlocksCasing = false; + private static final int[][] METAFORTIERS_ENERGY = { {100, 101, 102, 105}, {1110, 1115, 1120, 1127}, @@ -122,6 +125,8 @@ public class ConfigHandler { ConfigHandler.cutoffTier = ConfigHandler.c.get("System", "Tier to nerf circuits", 5, "This switch sets the lowest unnerfed Circuit Recipe Tier. -1 to disable it completely.",-1, VOLTAGE_NAMES.length).getInt(5); ConfigHandler.cutoffTier = (ConfigHandler.cutoffTier == -1 ? VOLTAGE_NAMES.length : ConfigHandler.cutoffTier); ConfigHandler.disableExtraGassesForEBF = ConfigHandler.c.get("System", "Disable Extra Gases for EBF", false, "This switch disables extra gas recipes for the EBF, i.e. Xenon instead of Nitrogen").getBoolean(false); + ConfigHandler.disableBoltedBlocksCasing = ConfigHandler.c.get("System", "Disable Bolted Casings", false, "This switch disable the generation of bolted casings").getBoolean(false); + ConfigHandler.disableReboltedBlocksCasing = ConfigHandler.c.get("System", "Disable Rebolted Casings", false, "This switch disable the generation of rebolted casings").getBoolean(false); ConfigHandler.mbWaterperSec = ConfigHandler.c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150).getInt(150); -- cgit From e8d27da5011dd34b075f7a988797ad64d18c15ff Mon Sep 17 00:00:00 2001 From: GlodBlock <60341015+GlodBlock@users.noreply.github.com> Date: Wed, 11 Aug 2021 19:14:21 +0800 Subject: default is enabled Former-commit-id: 2dace120b5cebff5a59069c67bd5f9f373f05072 --- .../bartimaeusnek/bartworks/system/material/WerkstoffLoader.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 99164f0510..4cf650fcf3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -27,6 +27,7 @@ import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.API.WerkstoffAdderRegistry; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_CircuitsLoader; import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.GTMetaItemEnhancer; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes; @@ -1729,8 +1730,10 @@ public class WerkstoffLoader { GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.01"); GameRegistry.registerBlock(WerkstoffLoader.BWSmallOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.02"); GameRegistry.registerBlock(WerkstoffLoader.BWBlocks, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblocks.01"); - GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasings, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasing.01"); - GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasingsAdvanced, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasingadvanced.01"); + if (!ConfigHandler.disableBoltedBlocksCasing) + GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasings, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasing.01"); + if (!ConfigHandler.disableReboltedBlocksCasing) + GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasingsAdvanced, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasingadvanced.01"); GTMetaItemEnhancer.addAdditionalOreDictToForestry(); GTMetaItemEnhancer.init(); -- cgit From 622fca0aade98929759bc1fa4cdb3a56ee72849d Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Sat, 14 Aug 2021 05:23:38 +0800 Subject: Fix MBF structure tooltip Former-commit-id: ef046060480e9a087f9575b47834e5693265b393 --- .../common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 8c6a8b2ce3..7213e7de25 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -141,7 +141,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl .addPollutionAmount(20 * getPollutionPerTick(null)) .addSeparator() .beginStructureBlock(15, 20, 15, true) - .addController("Front bottom") + .addController("3rd layer center") .addCasingInfo("Heat Proof Machine Casing", 0) .addOtherStructurePart("Heating Coils", "Inner 13x18x13 (Hollow)") .addOtherStructurePart("Borosilicate Glass", "Outer 15x18x15") -- cgit From 0308ba94d41dab1637d6a03d0a02f90dd36701f8 Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Sat, 14 Aug 2021 14:21:54 -0600 Subject: Update to new Forestry API Former-commit-id: f8f4993de7b7ca8c24db1981f923e829ee99b5d2 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8a484f5f98..84b038e10f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -146,7 +146,7 @@ dependencies { compile("micdoodle8.mods:GalacticraftCore:$galacticraftVersion:Dev") compile("micdoodle8.mods:Galacticraft-Planets:$galacticraftVersion:Dev") compileOnly("li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api") - compileOnly("net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev") + compileOnly("net.sengir.forestry:forestry_1.7.10:4.4.0.0:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.19:deobf") //jitpack compileOnly("com.github.GTNewHorizons:GalacticGregGT5:master-SNAPSHOT") { -- cgit From d5305686f7b65c1a3dd09981425090a056fd6c48 Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Sun, 15 Aug 2021 14:47:13 -0600 Subject: Add number formatting for recipe special value Former-commit-id: e77b35fa3f37277fa08cd9d84eb8c888a49eb098 --- .../github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index ba0e4d7bae..33ba6e874a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -94,7 +94,7 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { } else if (tSpecialA[1] == -400) { GT_NEI_DefaultHandler.drawText(10, lines[7], this.trans("216", "Deprecated Recipe"), -16777216); } else if (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre) || GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost)) { - GT_NEI_DefaultHandler.drawText(10, lines[6], (tSpecialA[2] == 1 ? StatCollector.translateToLocal("nei.biovat.1.name") : StatCollector.translateToLocal("nei.biovat.2.name")) + this.mRecipeMap.mNEISpecialValuePre + tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier + this.mRecipeMap.mNEISpecialValuePost, -16777216); + GT_NEI_DefaultHandler.drawText(10, lines[6], (tSpecialA[2] == 1 ? StatCollector.translateToLocal("nei.biovat.1.name") : StatCollector.translateToLocal("nei.biovat.2.name")) + this.mRecipeMap.mNEISpecialValuePre + GT_Utility.formatNumbers(tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); } } else { tSpecial = 0; -- cgit From f6359df82d1c520b9043b2c0346a388d2b8beebf Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Tue, 17 Aug 2021 09:21:58 +0200 Subject: bump version Former-commit-id: 1d2b02f716a95363f1ff35f30cbe3eca7ae90ac2 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 8f238432bb..25515abd6a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,7 +23,7 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 majorUpdate=0 minorUpdate=5 -buildNumber=19 +buildNumber=20 apiVersion=11 ic2Version=2.2.828-experimental applecoreVersion=1.7.10-3.1.1 -- cgit From 5c77a1ea6c67d0bcf0cb83f6bff2c9dd6e5ee979 Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Fri, 27 Aug 2021 02:49:49 +0200 Subject: Rework THTR Former-commit-id: f1b8defe4cfd9116ba8db5e056b1232cb61a1547 --- .../tileentities/multis/GT_TileEntity_THTR.java | 269 ++++++++++++--------- 1 file changed, 150 insertions(+), 119 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index c7a06914f5..072606a48b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -37,6 +37,8 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.objects.XSTR; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; @@ -56,9 +58,10 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { private static final int BASECASINGINDEX = 44; private static final int HELIUM_NEEDED = 730000; private int HeliumSupply; - private int BISOPeletSupply, savedBISO; - private int TRISOPeletSupply, savedTRISO; + private int fueltype = -1, fuelsupply = 0; private boolean empty; + private int emptyticksnodiff = 0; + private int coolanttaking = 0; public GT_TileEntity_THTR(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -77,10 +80,8 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); this.HeliumSupply = aNBT.getInteger("HeliumSupply"); - this.BISOPeletSupply = aNBT.getInteger("BISOPeletSupply"); - this.TRISOPeletSupply = aNBT.getInteger("TRISOPeletSupply"); - this.savedBISO = aNBT.getInteger("savedBISO"); - this.savedTRISO = aNBT.getInteger("savedTRISO"); + this.fueltype = aNBT.getInteger("fueltype"); + this.fuelsupply = aNBT.getInteger("fuelsupply"); this.empty = aNBT.getBoolean("EmptyMode"); } @@ -88,45 +89,44 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); aNBT.setInteger("HeliumSupply", this.HeliumSupply); - aNBT.setInteger("BISOPeletSupply", this.BISOPeletSupply); - aNBT.setInteger("TRISOPeletSupply", this.TRISOPeletSupply); - aNBT.setInteger("savedBISO", this.savedBISO); - aNBT.setInteger("savedTRISO", this.savedTRISO); + aNBT.setInteger("fueltype", this.fueltype); + aNBT.setInteger("fuelsupply", this.fuelsupply); aNBT.setBoolean("EmptyMode", this.empty); } @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (aBaseMetaTileEntity.isServerSide()){ + if (aBaseMetaTileEntity.isServerSide() && !this.empty){ if (this.HeliumSupply < GT_TileEntity_THTR.HELIUM_NEEDED){ for (FluidStack fluidStack : this.getStoredFluids()){ - if (fluidStack.isFluidEqual(Materials.Helium.getGas(1000))) { - while (this.HeliumSupply < GT_TileEntity_THTR.HELIUM_NEEDED && fluidStack.amount > 0) { - this.HeliumSupply++; - fluidStack.amount--; - } + if (fluidStack.isFluidEqual(Materials.Helium.getGas(1))) { + int toget = Math.min(GT_TileEntity_THTR.HELIUM_NEEDED - this.HeliumSupply, fluidStack.amount); + fluidStack.amount -= toget; + this.HeliumSupply += toget; + if(GT_TileEntity_THTR.HELIUM_NEEDED == this.HeliumSupply && fluidStack.amount == 0) + fluidStack = null; } } } for (ItemStack itemStack : this.getStoredInputs()) { - if (GT_Utility.areStacksEqual(itemStack, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3))) { - if (this.BISOPeletSupply + this.TRISOPeletSupply < 675000) { - while (this.BISOPeletSupply + this.TRISOPeletSupply < 675000 && itemStack.stackSize > 0) { - itemStack.stackSize--; - this.TRISOPeletSupply++; - } - this.updateSlots(); - } - } else if (GT_Utility.areStacksEqual(itemStack, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1))) { - if (this.BISOPeletSupply + this.TRISOPeletSupply < 675000) { - while (this.BISOPeletSupply + this.TRISOPeletSupply < 675000 && itemStack.stackSize > 0) { - itemStack.stackSize--; - this.BISOPeletSupply++; - - } - this.updateSlots(); - } + int type = -1; + if(GT_Utility.areStacksEqual(itemStack, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1))) + type = 0; // BISO + if(GT_Utility.areStacksEqual(itemStack, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3))) + type = 1; // TRISO + if(type == -1) + continue; + if(this.fueltype == -1) + this.fueltype = type; + if(this.fueltype != type) + continue; + if(this.fuelsupply < 720000) + { + int toget = Math.min(720000 - this.fuelsupply, itemStack.stackSize); + this.fuelsupply += toget; + itemStack.stackSize -= toget; + this.updateSlots(); } } } @@ -134,94 +134,104 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean checkRecipe(ItemStack controllerStack) { - - if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.BISOPeletSupply + this.TRISOPeletSupply >= 100000)) + + if(this.empty) + { + this.mEfficiency = 10000; + this.mMaxProgresstime = 100; + return true; + } + if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.fuelsupply >= 72000)) return false; - reduceSupply(); - addBurnedOutBalls(); - this.updateSlots(); - - this.mOutputFluids = new FluidStack[]{FluidRegistry.getFluidStack("ic2hotcoolant",0)}; - - this.mEUt=0; - this.mMaxProgresstime=648000; - return true; - } + double eff = Math.min(Math.pow(((double)this.fuelsupply-72000D)/72000D, 2D)+19D, 100D)/100D - (double)((getIdealStatus() - getRepairStatus()) * 10); - private void reduceSupply() { - int toReduce = new XSTR().nextInt(MathUtils.floorInt(((double)this.BISOPeletSupply + (double)this.TRISOPeletSupply) / 200D)); - - this.savedBISO = BISOPeletSupply; - this.savedTRISO = TRISOPeletSupply; - - if (new XSTR().nextBoolean()) { - if (this.BISOPeletSupply > 0) - this.BISOPeletSupply -= toReduce; - else - this.TRISOPeletSupply -= toReduce; - } else { - if (this.TRISOPeletSupply > 0) - this.TRISOPeletSupply -= toReduce; - else - this.BISOPeletSupply -= toReduce; - } - } + if(eff <= 0) + return false; - private void addBurnedOutBalls() { - int burnedTRISO = this.savedTRISO - this.TRISOPeletSupply; - int burnedBISO = this.savedBISO - this.BISOPeletSupply; - int burnedTRISOBall = burnedTRISO / 64; - int burnedBISOBall = burnedBISO / 64; + int toReduce = MathUtils.floorInt((double)this.fuelsupply * 0.005D * eff); - burnedBISO -= (burnedBISOBall*64); - burnedTRISO -= (burnedTRISOBall*64); + this.fuelsupply -= toReduce; + int burnedballs = toReduce/64; + if(burnedballs > 0) + toReduce -= burnedballs*64; + + int meta = this.fueltype == 1 ? 7 : 6; this.mOutputItems = new ItemStack[] { - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, burnedTRISOBall, 6), - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, burnedTRISO, 8), - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, burnedBISOBall, 7), - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, burnedBISO, 9) + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, burnedballs, meta), + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, toReduce, meta+2) }; - } + + this.updateSlots(); + this.mEfficiency = (int)(eff*10000D); + this.mEUt=0; + this.mMaxProgresstime=72000/120; + return true; + } + @Override public boolean onRunningTick(ItemStack aStack) { - + if (this.empty){ - this.addOutput(Materials.Helium.getGas(this.HeliumSupply)); - this.addOutput(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, this.TRISOPeletSupply, 3)); - this.addOutput(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, this.BISOPeletSupply, 1)); - this.HeliumSupply = 0; - this.TRISOPeletSupply = 0; - this.BISOPeletSupply = 0; - this.savedTRISO = 0; - this.savedBISO = 0; - return true; - } - - long accessibleCoolant = 0; - for (FluidStack fluidStack : this.getStoredFluids()) { - if (fluidStack.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))) { - accessibleCoolant += fluidStack.amount; + if(emptyticksnodiff > 20 && emptyticksnodiff % 20 != 0){ + emptyticksnodiff++; + return true; + } + if(this.HeliumSupply > 0){ + this.addOutput(Materials.Helium.getGas(this.HeliumSupply)); + this.HeliumSupply = 0; + } + if(this.fuelsupply > 0) + { + ItemStack iStack = new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, this.fuelsupply, this.fueltype == 1 ? 3 : 1); + boolean storedAll = false; + for (GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) { + if(!isValidMetaTileEntity(tHatch)) + continue; + if (tHatch.storeAll(iStack)){ + storedAll = true; + break; + } + } + if(!storedAll){ + if(this.fuelsupply == iStack.stackSize) emptyticksnodiff++; + else {this.fuelsupply = iStack.stackSize; emptyticksnodiff = 0;} + } + else{ + this.fuelsupply = 0; + this.fueltype = -1; + } } + return true; } - accessibleCoolant = Math.min((long) ((0.00711111111111111111111111111111D*(double)this.savedTRISO + 0.00474074074074074074074074074074D*(double)this.savedBISO)), accessibleCoolant); - - for (FluidStack fluidStack : this.getStoredFluids()) { - if (fluidStack.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))) { - if (accessibleCoolant >= fluidStack.amount) { - accessibleCoolant -= fluidStack.amount; - fluidStack.amount = 0; - } else if (accessibleCoolant > 0) { - fluidStack.amount -= accessibleCoolant; - accessibleCoolant = 0; + + int takecoolant = (int)(4000D * (this.fueltype == 1 ? 2D : 1D) * ((double)this.mEfficiency / 10000D)); // 100 LHEs btw, why? + coolanttaking = takecoolant; + int drainedamount = 0; + + for(GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches){ + if (isValidMetaTileEntity(tHatch)) { + FluidStack tLiquid = tHatch.getFluid(); + if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))){ + FluidStack drained = tHatch.drain(takecoolant, true); + takecoolant -= drained.amount; + drainedamount += drained.amount; + if(takecoolant <= 0) + break; } } } - this.mOutputFluids[0].amount += accessibleCoolant; + this.updateSlots(); + + if(takecoolant > 0) + this.stopMachine(); + + addOutput(FluidRegistry.getFluidStack("ic2coolant", drainedamount)); + return true; } @@ -255,7 +265,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { } -// else if (!((Math.abs(x) == 4 && Math.abs(z) == 4) || (Math.abs(x) == 3 && Math.abs(z) == 3)) && !(Math.abs(x) < 3 || Math.abs(z) < 3) && !((Math.abs(x) == Math.abs(z) && Math.abs(x) == 3) || Math.abs(x) == 4 || Math.abs(z) == 4)) { + //else if (!((Math.abs(x) == 4 && Math.abs(z) == 4) || (Math.abs(x) == 3 && Math.abs(z) == 3)) && !(Math.abs(x) < 3 || Math.abs(z) < 3) && !((Math.abs(x) == Math.abs(z) && Math.abs(x) == 3) || Math.abs(x) == 4 || Math.abs(z) == 4)) { else if (!((Math.abs(z) == xz-1 && Math.abs(x) == xz))) if (!((Math.abs(z) == xz && Math.abs(x) == xz-1))) if (!((Math.abs(x) == Math.abs(z) && Math.abs(x) == xz))) @@ -307,11 +317,12 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public String[] getInfoData() { return new String[]{ - "Progress:", GT_Utility.formatNumbers(this.mProgresstime / 20) + "secs", GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "secs", - "BISO-Pebbles:", GT_Utility.formatNumbers(this.BISOPeletSupply) + "pcs.", - "TRISO-Pebbles:", GT_Utility.formatNumbers(this.TRISOPeletSupply) + "pcs.", + "Mode:", this.empty ? "Emptying" : "Normal", + "Progress:", GT_Utility.formatNumbers(this.mProgresstime / 20) + "s / " + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "s", + "Fuel type:", (this.fueltype == -1 ? "NONE" : (this.fueltype == 1 ? "TRISO" : "BISO")), + "Fuel amount:", GT_Utility.formatNumbers(this.fuelsupply) + " pcs.", "Helium-Level:", GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + GT_Utility.formatNumbers(GT_TileEntity_THTR.HELIUM_NEEDED) + "L", - "Coolant/t:", GT_Utility.formatNumbers(this.savedBISO+this.savedTRISO >= 100000 ? (long) ((0.00711111111111111111111111111111D * (double) this.savedTRISO + 0.00474074074074074074074074074074D * (double) this.savedBISO)) : 0) + "L/t", + "Coolant/t:", GT_Utility.formatNumbers(coolanttaking) + "L/t", "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; } @@ -328,8 +339,13 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if(this.mMaxProgresstime > 0) + { + GT_Utility.sendChatToPlayer(aPlayer, "THTR mode cant be changed when running."); + return; + } this.empty = !this.empty; - GT_Utility.sendChatToPlayer(aPlayer, this.empty ? "THTR will now empty itself." : "THTR is back in normal Operation"); + GT_Utility.sendChatToPlayer(aPlayer, "THTR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); } public static class THTRMaterials{ @@ -340,10 +356,10 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { "TRISOPellet", "BISOPelletBall", "TRISOPelletBall", - "BurnedOutBISOPelletBall", - "BurnedOutTRISOPelletBall", - "BurnedOutBISOPellet", - "BurnedOutTRISOPellet" + "BurnedOutBISOPelletBall", // 6 + "BurnedOutTRISOPelletBall", // 7 + "BurnedOutBISOPellet", // 8 + "BurnedOutTRISOPellet" // 9 ); public static void registeraTHR_Materials(){ GameRegistry.registerItem(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,"bw.THTRMaterials"); @@ -366,20 +382,35 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { 40, BW_Util.getMachineVoltageFromTier(5) ); - GT_Values.RA.addMixerRecipe(WerkstoffLoader.Thorium232.get(OrePrefixes.dust,10),Materials.Uranium235.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials),400,30); + GT_Values.RA.addMixerRecipe(WerkstoffLoader.Thorium232.get(OrePrefixes.dust,64),Materials.Uranium235.getDust(4),GT_Utility.getIntegratedCircuit(1),null,null,null,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials),400,30); GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials),Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),40,30); - ItemStack[] pellets = new ItemStack[6]; + ItemStack[] pellets = new ItemStack[4]; Arrays.fill(pellets,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,1)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),GT_Utility.getIntegratedCircuit(17)}, pellets,null,null,null,null,24000,30,0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),GT_Utility.getIntegratedCircuit(17)}, pellets,null,null,null,null,16000,30,0); GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),Materials.Silicon.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,2),40,30); GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,2),Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,5),40,30); - pellets = new ItemStack[6]; + pellets = new ItemStack[4]; Arrays.fill(pellets,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,3)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,5),GT_Utility.getIntegratedCircuit(17)}, pellets,null,null,null,null,48000,30,0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,5),GT_Utility.getIntegratedCircuit(17)}, pellets,null,null,null,null,32000,30,0); GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,6),GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,8)},null,null,null,null,48000,30,0); GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,7),GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,9)},null,null,null,null,48000,30,0); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,8)},new ItemStack[]{Materials.Lutetium.getDustSmall(2)},null,null,null,null,1200,30,0); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,9)},new ItemStack[]{Materials.Lutetium.getDustSmall(4)},null,null,null,null,1200,30,0); + //old + //GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,8)},new ItemStack[]{Materials.Lutetium.getDustSmall(2)},null,null,null,null,1200,30,0); + //GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,9)},new ItemStack[]{Materials.Lutetium.getDustSmall(4)},null,null,null,null,1200,30,0); + GT_Values.RA.addCentrifugeRecipe( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,8),GT_Values.NI,GT_Values.NF,GT_Values.NF, + Materials.Graphite.getDustSmall(1), + Materials.Lutetium.getDustSmall(1), WerkstoffLoader.Thorium232.get(OrePrefixes.dustSmall,1), + null, null, null, + new int[]{9000, 3750, 6250}, + 1200, 30); + GT_Values.RA.addCentrifugeRecipe( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,9),GT_Values.NI,GT_Values.NF,GT_Values.NF, + Materials.Silicon.getDustSmall(1), Materials.Graphite.getDustSmall(2), + Materials.Lutetium.getDustSmall(1), WerkstoffLoader.Thorium232.get(OrePrefixes.dustSmall,1), + null, null, + new int[]{9000, 9000, 9000, 1000}, + 1200, 30); } } -- cgit From db1d5ea08e446637420820a40210dd8ea29a1988 Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Fri, 27 Aug 2021 04:46:32 +0200 Subject: Fix calculation Former-commit-id: b07c541a2dc981743295c5476bbd3fd144216df3 --- .../bartworks/common/tileentities/multis/GT_TileEntity_THTR.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 072606a48b..f1b50cfea7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -144,7 +144,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.fuelsupply >= 72000)) return false; - double eff = Math.min(Math.pow(((double)this.fuelsupply-72000D)/72000D, 2D)+19D, 100D)/100D - (double)((getIdealStatus() - getRepairStatus()) * 10); + double eff = Math.min(Math.pow(((double)this.fuelsupply-72000D)/72000D, 2D)+19D, 100D)/100D - ((double)(getIdealStatus() - getRepairStatus()) / 10D); if(eff <= 0) return false; -- cgit From ed263ebe21ea9a60a9c950a526734532fc4fc00c Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Fri, 27 Aug 2021 22:22:07 +0200 Subject: Fix structure Former-commit-id: b885dd48b0335b456faee82763c517121da7c5cb --- .../tileentities/multis/GT_TileEntity_THTR.java | 70 ++++++++++------------ 1 file changed, 31 insertions(+), 39 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index f1b50cfea7..e50f4d25c1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -167,7 +167,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { this.mEfficiency = (int)(eff*10000D); this.mEUt=0; - this.mMaxProgresstime=72000/120; + this.mMaxProgresstime=72000; return true; } @@ -224,14 +224,15 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { } } } + + if(drainedamount > 0) + addOutput(FluidRegistry.getFluidStack("ic2coolant", drainedamount)); this.updateSlots(); if(takecoolant > 0) this.stopMachine(); - addOutput(FluidRegistry.getFluidStack("ic2coolant", drainedamount)); - return true; } @@ -241,51 +242,42 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * xz; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * xz; for (int x = -xz; x <= xz; x++) { - for (int z = -xz; z <= xz; z++) { - for (int y = 0; y < 12; y++) { - if (y == 0 || y == 11) { + for (int z = -xz; z <= xz; z++) { + for (int y = 0; y < 12; y++) { + if (x + xDir == 0 && y == 0 && z + zDir == 0) + continue; + int ax = Math.abs(x), az = Math.abs(z); + if ( + (ax < 4 && az == 5) || // X WALLS + (az < 4 && ax == 5) || // Z WALLS + (ax == 4 && az == 4) || // CORNER WALLS + ((y == 0 || y == 11) && (!(ax >= 4 && az == 5) && !(az >= 4 && ax == 5))) // FLOOR & CEILING + ) { + if (!(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 12)) { + IGregTechTileEntity tEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z); if ( - !((Math.abs(z) == xz-1 && Math.abs(x) == xz)) && - !((Math.abs(z) == xz && Math.abs(x) == xz-1)) && - !((Math.abs(x) == Math.abs(z) && Math.abs(x) == xz)) + !(y == 11 && this.addInputToMachineList(tEntity, GT_TileEntity_THTR.BASECASINGINDEX)) && + !(y == 0 && this.addOutputToMachineList(tEntity, GT_TileEntity_THTR.BASECASINGINDEX)) && + !this.addMaintenanceToMachineList(tEntity, GT_TileEntity_THTR.BASECASINGINDEX) ) { - if (x + xDir == 0 && y == 0 && z + zDir == 0) - continue; - if (!(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 12)) { - if ( - ( - !(this.addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), GT_TileEntity_THTR.BASECASINGINDEX) && y == 11) && - !(this.addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), GT_TileEntity_THTR.BASECASINGINDEX) && y == 0)) && - !this.addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), GT_TileEntity_THTR.BASECASINGINDEX) - ) { - return false; - } - } - } - } - - - //else if (!((Math.abs(x) == 4 && Math.abs(z) == 4) || (Math.abs(x) == 3 && Math.abs(z) == 3)) && !(Math.abs(x) < 3 || Math.abs(z) < 3) && !((Math.abs(x) == Math.abs(z) && Math.abs(x) == 3) || Math.abs(x) == 4 || Math.abs(z) == 4)) { - else if (!((Math.abs(z) == xz-1 && Math.abs(x) == xz))) - if (!((Math.abs(z) == xz && Math.abs(x) == xz-1))) - if (!((Math.abs(x) == Math.abs(z) && Math.abs(x) == xz))) - if (!(Math.abs(x) < xz && Math.abs(z) != xz)) - - { - if (!(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 12)) { - if ( - !this.addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), GT_TileEntity_THTR.BASECASINGINDEX)) - { return false; } } } + else if(!(ax >= 4 && az == 5) && !(az >= 4 && ax == 5)){ // inside + if(!aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z)) + return false; + } } } - } - - return this.mMaintenanceHatches.size() == 1; + return ( + this.mMaintenanceHatches.size() == 1 && + this.mInputHatches.size() > 0 && + this.mOutputHatches.size() > 0 && + this.mInputBusses.size() > 0 && + this.mOutputBusses.size() > 0 + ); } @Override -- cgit From d0a4648dfa4e3a7ba4deaf8a1d7e7cfba314e6bf Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Sat, 28 Aug 2021 18:04:33 +0200 Subject: New fuels Now only in english Former-commit-id: f7305d7dee36564afd4b1e19af28ce220a45b469 --- .../tileentities/multis/GT_TileEntity_THTR.java | 250 ++++++++++++++------- .../resources/assets/bartworks/lang/de_DE.lang | 6 - .../resources/assets/bartworks/lang/en_US.lang | 10 - .../resources/assets/bartworks/lang/fr_FR.lang | 7 +- .../resources/assets/bartworks/lang/zh_CN.lang | 7 +- .../assets/bartworks/textures/items/BISOPellet.png | Bin 253 -> 0 bytes .../bartworks/textures/items/BISOPelletBall.png | Bin 305 -> 0 bytes .../textures/items/BISOPelletCompound.png | Bin 269 -> 0 bytes .../textures/items/BurnedOutBISOPellet.png | Bin 266 -> 0 bytes .../textures/items/BurnedOutBISOPelletBall.png | Bin 346 -> 0 bytes .../textures/items/BurnedOutTRISOPellet.png | Bin 258 -> 0 bytes .../textures/items/BurnedOutTRISOPelletBall.png | Bin 291 -> 0 bytes .../items/HTGRBISOPebbleCompoundPlutonium.png | Bin 0 -> 5702 bytes .../items/HTGRBISOPebbleCompoundThorium.png | Bin 0 -> 5691 bytes .../items/HTGRBISOPebbleCompoundUranium.png | Bin 0 -> 5716 bytes .../items/HTGRBurnedOutTRISOBallPlutonium.png | Bin 0 -> 6022 bytes .../items/HTGRBurnedOutTRISOBallThorium.png | Bin 0 -> 5971 bytes .../items/HTGRBurnedOutTRISOBallUranium.png | Bin 0 -> 6020 bytes .../items/HTGRBurnedOutTRISOPebblePlutonium.png | Bin 0 -> 5726 bytes .../items/HTGRBurnedOutTRISOPebbleThorium.png | Bin 0 -> 5709 bytes .../items/HTGRBurnedOutTRISOPebbleUranium.png | Bin 0 -> 5725 bytes .../items/HTGRHTGRFuelMixturePlutonium.png | Bin 0 -> 6031 bytes .../textures/items/HTGRHTGRFuelMixtureThorium.png | Bin 0 -> 5964 bytes .../textures/items/HTGRHTGRFuelMixtureUranium.png | Bin 0 -> 6030 bytes .../textures/items/HTGRTRISOBallPlutonium.png | Bin 0 -> 5973 bytes .../textures/items/HTGRTRISOBallThorium.png | Bin 0 -> 5937 bytes .../textures/items/HTGRTRISOBallUranium.png | Bin 0 -> 5988 bytes .../items/HTGRTRISOPebbleCompoundPlutonium.png | Bin 0 -> 5932 bytes .../items/HTGRTRISOPebbleCompoundThorium.png | Bin 0 -> 5885 bytes .../items/HTGRTRISOPebbleCompoundUranium.png | Bin 0 -> 5971 bytes .../textures/items/HTGRTRISOPebblePlutonium.png | Bin 0 -> 5658 bytes .../textures/items/HTGRTRISOPebbleThorium.png | Bin 0 -> 5673 bytes .../textures/items/HTGRTRISOPebbleUranium.png | Bin 0 -> 5703 bytes .../bartworks/textures/items/TRISOPellet.png | Bin 257 -> 0 bytes .../bartworks/textures/items/TRISOPelletBall.png | Bin 305 -> 0 bytes .../textures/items/TRISOPelletCompound.png | Bin 244 -> 0 bytes 36 files changed, 168 insertions(+), 112 deletions(-) delete mode 100644 src/main/resources/assets/bartworks/textures/items/BISOPellet.png delete mode 100644 src/main/resources/assets/bartworks/textures/items/BISOPelletBall.png delete mode 100644 src/main/resources/assets/bartworks/textures/items/BISOPelletCompound.png delete mode 100644 src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPellet.png delete mode 100644 src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPelletBall.png delete mode 100644 src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPellet.png delete mode 100644 src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPelletBall.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRBISOPebbleCompoundPlutonium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRBISOPebbleCompoundThorium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRBISOPebbleCompoundUranium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOBallPlutonium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOBallThorium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOBallUranium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOPebblePlutonium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOPebbleThorium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOPebbleUranium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRHTGRFuelMixturePlutonium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRHTGRFuelMixtureThorium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRHTGRFuelMixtureUranium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRTRISOBallPlutonium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRTRISOBallThorium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRTRISOBallUranium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleCompoundPlutonium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleCompoundThorium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleCompoundUranium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebblePlutonium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleThorium.png create mode 100644 src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleUranium.png delete mode 100644 src/main/resources/assets/bartworks/textures/items/TRISOPellet.png delete mode 100644 src/main/resources/assets/bartworks/textures/items/TRISOPelletBall.png delete mode 100644 src/main/resources/assets/bartworks/textures/items/TRISOPelletCompound.png diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index e50f4d25c1..61a1e707e4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -44,6 +44,7 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gregtech.api.util.GT_LanguageManager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -52,6 +53,7 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import java.util.Arrays; +import java.util.ArrayList; public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { @@ -109,25 +111,23 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { } } } - for (ItemStack itemStack : this.getStoredInputs()) { - int type = -1; - if(GT_Utility.areStacksEqual(itemStack, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1))) - type = 0; // BISO - if(GT_Utility.areStacksEqual(itemStack, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3))) - type = 1; // TRISO - if(type == -1) - continue; - if(this.fueltype == -1) - this.fueltype = type; - if(this.fueltype != type) - continue; - if(this.fuelsupply < 720000) - { + if(this.fuelsupply < 720000){ + for (ItemStack itemStack : this.getStoredInputs()) { + int type = -1; + if(itemStack == null) continue; + if(itemStack.getItem() != THTRMaterials.aTHTR_Materials) continue; + int damage = THTRMaterials.aTHTR_Materials.getDamage(itemStack); + if(!((damage + 1) % THTRMaterials.MATERIALS_PER_FUEL == THTRMaterials.USABLE_FUEL_INDEX + 1)) continue; // is fuel + type = damage / THTRMaterials.MATERIALS_PER_FUEL; + if(this.fueltype == -1) + this.fueltype = type; + if(this.fueltype != type) + continue; int toget = Math.min(720000 - this.fuelsupply, itemStack.stackSize); this.fuelsupply += toget; itemStack.stackSize -= toget; - this.updateSlots(); } + this.updateSlots(); } } } @@ -155,25 +155,30 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { int burnedballs = toReduce/64; if(burnedballs > 0) toReduce -= burnedballs*64; - - int meta = this.fueltype == 1 ? 7 : 6; + + int meta = (this.fueltype * THTRMaterials.MATERIALS_PER_FUEL) + THTRMaterials.BURNED_OUT_FUEL_INDEX; this.mOutputItems = new ItemStack[] { - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, burnedballs, meta), - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, toReduce, meta+2) + new ItemStack(THTRMaterials.aTHTR_Materials, burnedballs, meta), + new ItemStack(THTRMaterials.aTHTR_Materials, toReduce, meta + 1) }; this.updateSlots(); + this.coolanttaking = (int)(4000D * ((this.fueltype * 0.5D) + 1) * ((double)this.mEfficiency / 10000D)) * 20; // 100 LHEs btw, why? + this.mEfficiency = (int)(eff*10000D); this.mEUt=0; this.mMaxProgresstime=72000; return true; } + private static int runningtick = 0; + @Override public boolean onRunningTick(ItemStack aStack) { - + runningtick++; + if (this.empty){ if(emptyticksnodiff > 20 && emptyticksnodiff % 20 != 0){ emptyticksnodiff++; @@ -185,7 +190,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { } if(this.fuelsupply > 0) { - ItemStack iStack = new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, this.fuelsupply, this.fueltype == 1 ? 3 : 1); + ItemStack iStack = new ItemStack(THTRMaterials.aTHTR_Materials, this.fuelsupply, (THTRMaterials.MATERIALS_PER_FUEL * this.fueltype) + THTRMaterials.USABLE_FUEL_INDEX); boolean storedAll = false; for (GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) { if(!isValidMetaTileEntity(tHatch)) @@ -207,31 +212,32 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { return true; } - - int takecoolant = (int)(4000D * (this.fueltype == 1 ? 2D : 1D) * ((double)this.mEfficiency / 10000D)); // 100 LHEs btw, why? - coolanttaking = takecoolant; - int drainedamount = 0; - - for(GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches){ - if (isValidMetaTileEntity(tHatch)) { - FluidStack tLiquid = tHatch.getFluid(); - if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))){ - FluidStack drained = tHatch.drain(takecoolant, true); - takecoolant -= drained.amount; - drainedamount += drained.amount; - if(takecoolant <= 0) - break; + if(runningtick % 20 == 0) + { + int takecoolant = coolanttaking; + int drainedamount = 0; + + for(GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches){ + if (isValidMetaTileEntity(tHatch)) { + FluidStack tLiquid = tHatch.getFluid(); + if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))){ + FluidStack drained = tHatch.drain(takecoolant, true); + takecoolant -= drained.amount; + drainedamount += drained.amount; + if(takecoolant <= 0) + break; + } } } - } - if(drainedamount > 0) - addOutput(FluidRegistry.getFluidStack("ic2coolant", drainedamount)); + if(drainedamount > 0) + addOutput(FluidRegistry.getFluidStack("ic2coolant", drainedamount)); - this.updateSlots(); + this.updateSlots(); - if(takecoolant > 0) - this.stopMachine(); + if(takecoolant > 0) + this.stopMachine(); + } return true; } @@ -311,10 +317,10 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { return new String[]{ "Mode:", this.empty ? "Emptying" : "Normal", "Progress:", GT_Utility.formatNumbers(this.mProgresstime / 20) + "s / " + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "s", - "Fuel type:", (this.fueltype == -1 ? "NONE" : (this.fueltype == 1 ? "TRISO" : "BISO")), + "Fuel type:", (this.fueltype == -1 ? "NONE" : ("TRISO (" + THTRMaterials.sTHTR_Fuel[this.fueltype].sEnglish) + ")"), "Fuel amount:", GT_Utility.formatNumbers(this.fuelsupply) + " pcs.", "Helium-Level:", GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + GT_Utility.formatNumbers(GT_TileEntity_THTR.HELIUM_NEEDED) + "L", - "Coolant/t:", GT_Utility.formatNumbers(coolanttaking) + "L/t", + "Coolant/t:", GT_Utility.formatNumbers(coolanttaking) + "L/s", "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; } @@ -340,20 +346,102 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { GT_Utility.sendChatToPlayer(aPlayer, "THTR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); } + + public static class THTRMaterials{ - static final SimpleSubItemClass aTHTR_Materials = new SimpleSubItemClass( - "BISOPelletCompound", - "BISOPellet", - "TRISOPelletCompound", - "TRISOPellet", - "BISOPelletBall", - "TRISOPelletBall", - "BurnedOutBISOPelletBall", // 6 - "BurnedOutTRISOPelletBall", // 7 - "BurnedOutBISOPellet", // 8 - "BurnedOutTRISOPellet" // 9 - ); + private static class Base_{ + public String sName; + public String sEnglish; + public String sTooltip; + public Base_(String a, String b){ + this.sName = a; + this.sEnglish = b; + this.sTooltip = ""; + } + public Base_(String a, String b, String c){ + this.sName = a; + this.sEnglish = b; + this.sTooltip = c; + } + } + static class Fuel_{ + public String sName; + public String sEnglish; + public ItemStack mainItem; + public ItemStack secondaryItem; + public ItemStack[] recycledItems = { GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI }; + public FluidStack recycledFluid; + public int[] recycleChances; + public Fuel_(String sName, String sEnglish, ItemStack mainItem, ItemStack secondaryItem, FluidStack recycledFluid, ItemStack[] recycledItems, int[] recycleChances){ + this.sName = sName; + this.sEnglish = sEnglish; + this.mainItem = mainItem; + this.secondaryItem = secondaryItem; + this.recycledFluid = recycledFluid; + for(int i = 0; i < recycledItems.length; i++) + this.recycledItems[i] = recycledItems[i]; + this.recycleChances = recycleChances; + } + } + private static class LangEntry_{ + public String sName; + public String sEnglish; + public LangEntry_(String a, String b){ + this.sName = a; + this.sEnglish = b; + } + } + + static final Base_[] sTHTR_Bases = new Base_[]{ + new Base_("HTGRFuelMixture", "HTGR fuel mixture"), + new Base_("BISOPebbleCompound", "BISO pebble compound"), + new Base_("TRISOPebbleCompound", "TRISO pebble compound"), + new Base_("TRISOBall", "TRISO ball"), + new Base_("TRISOPebble", "TRISO pebble"), + new Base_("BurnedOutTRISOBall", "Burned out TRISO Ball"), + new Base_("BurnedOutTRISOPebble", "Burned out TRISO Pebble"), + }; + static final int MATERIALS_PER_FUEL = sTHTR_Bases.length; + static final int USABLE_FUEL_INDEX = 4; + static final int BURNED_OUT_FUEL_INDEX = 5; + static final Fuel_[] sTHTR_Fuel = new Fuel_[]{ + new Fuel_("Thorium", "Thorium", WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 64), Materials.Uranium235.getDust(4), + GT_Values.NF, new ItemStack[]{ + Materials.Silicon.getDustSmall(1), Materials.Graphite.getDustSmall(1), Materials.Carbon.getDustSmall(1), + Materials.Lutetium.getDustSmall(1), WerkstoffLoader.Thorium232.get(OrePrefixes.dustSmall,1)}, + new int[]{9000, 9000, 9000, 9000, 1000}), + new Fuel_("Uranium", "Uranium", Materials.Uranium.getDust(60), Materials.Uranium235.getDust(8), + FluidRegistry.getFluidStack("krypton", 7), new ItemStack[]{ + Materials.Silicon.getDustSmall(1), Materials.Graphite.getDustSmall(1), Materials.Carbon.getDustSmall(1), + Materials.Lead.getDustSmall(1), + Materials.Uranium.getDustSmall(1)}, + new int[]{9000, 9000, 9000, 6562, 937}), + new Fuel_("Plutonium", "Plutonium", Materials.Plutonium.getDust(64), Materials.Plutonium241.getDust(4), + FluidRegistry.getFluidStack("xenon", 8), new ItemStack[]{ + Materials.Silicon.getDustSmall(1), Materials.Graphite.getDustSmall(1), Materials.Carbon.getDustSmall(1), + Materials.Lead.getDustSmall(1), + Materials.Plutonium.getDustSmall(1)}, + new int[]{9000, 9000, 9000, 7000, 1000}), + }; + static final SimpleSubItemClass aTHTR_Materials; + static final ArrayList aTHTR_Localizations = new ArrayList(); + static{ + String[] sTHTR_Materials = new String[sTHTR_Bases.length*sTHTR_Fuel.length]; + int i = 0; + for(Fuel_ fuel : sTHTR_Fuel) + for(Base_ base : sTHTR_Bases) + { + sTHTR_Materials[i] = "HTGR" + base.sName + fuel.sName; + aTHTR_Localizations.add(new LangEntry_("item." + sTHTR_Materials[i] + ".name", base.sEnglish + " (" + fuel.sEnglish + ")")); + i++; + } + aTHTR_Materials = new SimpleSubItemClass(sTHTR_Materials); + } + + public static void registeraTHR_Materials(){ + for(LangEntry_ iName : aTHTR_Localizations) + GT_LanguageManager.addStringLocalization(iName.sName, iName.sEnglish); GameRegistry.registerItem(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,"bw.THTRMaterials"); } @@ -374,35 +462,29 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { 40, BW_Util.getMachineVoltageFromTier(5) ); - GT_Values.RA.addMixerRecipe(WerkstoffLoader.Thorium232.get(OrePrefixes.dust,64),Materials.Uranium235.getDust(4),GT_Utility.getIntegratedCircuit(1),null,null,null,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials),400,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials),Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),40,30); - ItemStack[] pellets = new ItemStack[4]; - Arrays.fill(pellets,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,1)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),GT_Utility.getIntegratedCircuit(17)}, pellets,null,null,null,null,16000,30,0); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,4),Materials.Silicon.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,2),40,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,2),Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,5),40,30); - pellets = new ItemStack[4]; - Arrays.fill(pellets,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,3)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,5),GT_Utility.getIntegratedCircuit(17)}, pellets,null,null,null,null,32000,30,0); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,6),GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,8)},null,null,null,null,48000,30,0); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,7),GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,9)},null,null,null,null,48000,30,0); - //old - //GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,8)},new ItemStack[]{Materials.Lutetium.getDustSmall(2)},null,null,null,null,1200,30,0); - //GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,9)},new ItemStack[]{Materials.Lutetium.getDustSmall(4)},null,null,null,null,1200,30,0); - GT_Values.RA.addCentrifugeRecipe( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,8),GT_Values.NI,GT_Values.NF,GT_Values.NF, - Materials.Graphite.getDustSmall(1), - Materials.Lutetium.getDustSmall(1), WerkstoffLoader.Thorium232.get(OrePrefixes.dustSmall,1), - null, null, null, - new int[]{9000, 3750, 6250}, - 1200, 30); - GT_Values.RA.addCentrifugeRecipe( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,9),GT_Values.NI,GT_Values.NF,GT_Values.NF, - Materials.Silicon.getDustSmall(1), Materials.Graphite.getDustSmall(2), - Materials.Lutetium.getDustSmall(1), WerkstoffLoader.Thorium232.get(OrePrefixes.dustSmall,1), - null, null, - new int[]{9000, 9000, 9000, 1000}, - 1200, 30); + int i = 0; + for(Fuel_ fuel : sTHTR_Fuel){ + GT_Values.RA.addMixerRecipe(fuel.mainItem, fuel.secondaryItem ,GT_Utility.getIntegratedCircuit(1),null,null,null,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i),400,30); + GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i), Materials.Carbon.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i + 1),40,30); + GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i + 1), Materials.Silicon.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i + 2),40,30); + GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i + 2), Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i + 3),40,30); + ItemStack[] pellets = new ItemStack[4]; + Arrays.fill(pellets,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, i + 4)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false, new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i + 3), GT_Utility.getIntegratedCircuit(17)}, pellets, null, null, null, null, 32000, 30, 0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false, new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i + 5), GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, i + 6)}, null, null, null, null,48000,30,0); + GT_Values.RA.addCentrifugeRecipe( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i + 6), GT_Values.NI, GT_Values.NF, + fuel.recycledFluid, + fuel.recycledItems[0], + fuel.recycledItems[1], + fuel.recycledItems[2], + fuel.recycledItems[3], + fuel.recycledItems[4], + fuel.recycledItems[5], + fuel.recycleChances, + 1200, 30); + i += sTHTR_Bases.length; + } } } diff --git a/src/main/resources/assets/bartworks/lang/de_DE.lang b/src/main/resources/assets/bartworks/lang/de_DE.lang index dfeb3cfd6e..baf62d614a 100644 --- a/src/main/resources/assets/bartworks/lang/de_DE.lang +++ b/src/main/resources/assets/bartworks/lang/de_DE.lang @@ -18,9 +18,6 @@ BW_Machinery_Casings.1.name=Transformer-Wicklungs Block GT_LESU_CASING.0.name=LESU Hülle filled.item.petriDish.name=Petri Schale mit einer Kultur item.Agarose.name=Agarose -item.BISOPellet.name=BISO Kügelchen -item.BISOPelletBall.name=BISO Kügelchen Ball -item.BISOPelletCompound.name=BISO Kügelchen Material item.BW_CombinedRotor.name=Primitiver Multi-Material Rotor (nur Wind) item.BW_LeatherRotor.name=Primitiver Leder Rotor (nur Wind) item.BW_PaperRotor.name=Primitiver Papier Rotor (nur Wind) @@ -39,9 +36,6 @@ item.GT_Teslastaff_Item.name=Teslastab item.IncubationModule.name=Incubations Modul item.PlasmaMembrane.name=Plasma Membran item.PlasmidCell.name=Plasmid-Proben Flasche -item.TRISOPellet.name=TRISO Kügelchen -item.TRISOPelletBall.name=TRISO Kügelchen Ball -item.TRISOPelletCompound.name=TRISO Kügelchen Material item.completed_grindstone.name=Mahlstein item.grindstone_bottom.name=Unteres Teil des Mahlsteins item.grindstone_top.name=Oberes Teil des Mahlsteins diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 98482e3482..38d274c5b8 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -145,16 +145,6 @@ tile.bw.windmill.name=Windmill tile.manutrafo.name=Manual Trafo tooltip.tile.htr.0.name=Controller Block for the Thorium High Temperature Reactor;Size(WxHxD): 11x12x11 (Hollow);Controller: Front Center, Lowest Layer;Corners and the 2 touching blocks are air (cylindric);Once built, Helium is inserted into the Fluid Input Hatch until it doesn't accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Radiation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes up to 0.5% of total Fuel Pellets per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days -item.TRISOPellet.name=TRISO pebble -item.TRISOPelletBall.name=TRISO pebble ball -item.BISOPelletBall.name=BISO pebble ball -item.BISOPellet.name=BISO pebble -item.TRISOPelletCompound.name=TRISO pebble compound -item.BISOPelletCompound.name=BISO pebble compound -item.BurnedOutBISOPelletBall.name=Burned Out BISO pebble ball -item.BurnedOutBISOPellet.name=Burned Out BISO pebble -item.BurnedOutTRISOPelletBall.name=Burned Out TRISO pebble ball -item.BurnedOutTRISOPellet.name=Burned Out TRISO pebble itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials diff --git a/src/main/resources/assets/bartworks/lang/fr_FR.lang b/src/main/resources/assets/bartworks/lang/fr_FR.lang index 4fc3e1890f..1528e26c86 100644 --- a/src/main/resources/assets/bartworks/lang/fr_FR.lang +++ b/src/main/resources/assets/bartworks/lang/fr_FR.lang @@ -144,12 +144,7 @@ tile.radiohatch.name=Trappe Radioactive tile.bw.windmill.name=Eolienne tile.manutrafo.name=Transformateur Manuel -item.TRISOPellet.name=Galet TRISO -item.TRISOPelletBall.name=Boule De Galets TRISO -item.BISOPelletBall.name=Boule De Galets BISO -item.BISOPellet.name=Galet TRISO -item.TRISOPelletCompound.name=Composé De Galet TRISO -item.BISOPelletCompound.name=Composé De Galet BISO + itemGroup.bartworksMetaMaterials=Méta Matériaux De BartWorks tooltip.tile.eic.0.name=Bloc Contrôleur pour le Compresseur à Implosion Electrique;Taille (LxHxP): 3x9x3;Utilise de l'Electricité à la place d'Explosifs;Contrôleur: couche 3, devant, centré;Couches 1 et 9: carter de machine en acier solide, pour chaque couche: 1 Trappe d'Energie au milieu;Couche 2,3,7,8: Milieu: Bloc de Ferrite en Nickel-Zinc, Extérieur: Bloc de bobinage de Transformateur;Couche 4,5,6: Blocs de Neutronium;1+ Bus d'Entrée, 1+ Bus de Sortie, 1 trappe de maintenance n'importe où dans les Blocs Carter en Acier Solide;Ne PAS obstruer ou miner les Parties mobile pendant le fonctionnement, ou explosion garantie! diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index 419c845f96..9b54684d3c 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -145,12 +145,7 @@ tile.bw.windmill.name=风车 tile.manutrafo.name=手动变压器 tooltip.tile.htr.0.name=高温钍反应堆的控制器方块;大小(宽x高x长):11x12x11 (中空);控制器:正面中心,最低一层;角落和两个相邻的方块是空气;:一旦搭建完成,需要在输入仓中输入氦气直到不再接受;1+输出仓(任意底部机械方块);1+输入仓(任意顶部机械方块);1+输入总线(任意顶部机械方块);1x维护仓(任意机械方块);其余的为辐射防护机械方块;在运行时需要持续供应冷却液,完成工作后输出;需要至少100k卵石燃料才能开始工作(最多可使用675k个卵石);每次操作消耗1个燃料颗粒;TRISO卵石将提供30%的额外能量;每个卵石都会增加转换冷却剂的需求数量;一次工作耗时27个游戏日 -item.TRISOPellet.name=TRISO卵石 -item.TRISOPelletBall.name=TRISO卵石球 -item.BISOPelletBall.name=BISO卵石球 -item.BISOPellet.name=BISO卵石 -item.TRISOPelletCompound.name=TRISO卵石复合材料 -item.BISOPelletCompound.name=BISO卵石复合材料 + itemGroup.bartworksMetaMaterials=BartWorks-meta材料 tooltip.tile.eic.0.name=电气聚爆压缩机的控制器方块;大小(宽x高x长):3x9x3;使用电而不是爆炸物工作;控制器在第三层正面中心;第一到第九层为坚硬钢机械方块,每层中间为能量仓;第2,3,7,8层:中心为镍锌铁氧体方块,其余的为变压器线圈块;第4,5,6层为中子块;1+输入总线,1+输出总线,1个维护仓于坚硬钢机械方块;在操作过程中,请勿遮挡或挖掘移动方块,这会上演爆炸的艺术!! diff --git a/src/main/resources/assets/bartworks/textures/items/BISOPellet.png b/src/main/resources/assets/bartworks/textures/items/BISOPellet.png deleted file mode 100644 index 4fb39c473b..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/items/BISOPellet.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/items/BISOPelletBall.png b/src/main/resources/assets/bartworks/textures/items/BISOPelletBall.png deleted file mode 100644 index ea113e3f22..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/items/BISOPelletBall.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/items/BISOPelletCompound.png b/src/main/resources/assets/bartworks/textures/items/BISOPelletCompound.png deleted file mode 100644 index 029d895f31..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/items/BISOPelletCompound.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPellet.png b/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPellet.png deleted file mode 100644 index 573d4b309e..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPellet.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPelletBall.png b/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPelletBall.png deleted file mode 100644 index 72ba51bbe0..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/items/BurnedOutBISOPelletBall.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPellet.png b/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPellet.png deleted file mode 100644 index 73abda00dd..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPellet.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPelletBall.png b/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPelletBall.png deleted file mode 100644 index eb5e37eaa1..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPelletBall.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRBISOPebbleCompoundPlutonium.png b/src/main/resources/assets/bartworks/textures/items/HTGRBISOPebbleCompoundPlutonium.png new file mode 100644 index 0000000000..18ab91de32 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRBISOPebbleCompoundPlutonium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRBISOPebbleCompoundThorium.png b/src/main/resources/assets/bartworks/textures/items/HTGRBISOPebbleCompoundThorium.png new file mode 100644 index 0000000000..26f20f97f1 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRBISOPebbleCompoundThorium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRBISOPebbleCompoundUranium.png b/src/main/resources/assets/bartworks/textures/items/HTGRBISOPebbleCompoundUranium.png new file mode 100644 index 0000000000..53c59ec79c Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRBISOPebbleCompoundUranium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOBallPlutonium.png b/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOBallPlutonium.png new file mode 100644 index 0000000000..714b4806dd Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOBallPlutonium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOBallThorium.png b/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOBallThorium.png new file mode 100644 index 0000000000..2be7586764 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOBallThorium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOBallUranium.png b/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOBallUranium.png new file mode 100644 index 0000000000..6f95ff5256 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOBallUranium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOPebblePlutonium.png b/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOPebblePlutonium.png new file mode 100644 index 0000000000..e29d9dc953 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOPebblePlutonium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOPebbleThorium.png b/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOPebbleThorium.png new file mode 100644 index 0000000000..1e0c684eb1 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOPebbleThorium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOPebbleUranium.png b/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOPebbleUranium.png new file mode 100644 index 0000000000..1cbc98794d Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRBurnedOutTRISOPebbleUranium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRHTGRFuelMixturePlutonium.png b/src/main/resources/assets/bartworks/textures/items/HTGRHTGRFuelMixturePlutonium.png new file mode 100644 index 0000000000..7858c997d4 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRHTGRFuelMixturePlutonium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRHTGRFuelMixtureThorium.png b/src/main/resources/assets/bartworks/textures/items/HTGRHTGRFuelMixtureThorium.png new file mode 100644 index 0000000000..19b94a07cb Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRHTGRFuelMixtureThorium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRHTGRFuelMixtureUranium.png b/src/main/resources/assets/bartworks/textures/items/HTGRHTGRFuelMixtureUranium.png new file mode 100644 index 0000000000..324df7101b Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRHTGRFuelMixtureUranium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRTRISOBallPlutonium.png b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOBallPlutonium.png new file mode 100644 index 0000000000..28432d2d9b Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOBallPlutonium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRTRISOBallThorium.png b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOBallThorium.png new file mode 100644 index 0000000000..ada36141c6 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOBallThorium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRTRISOBallUranium.png b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOBallUranium.png new file mode 100644 index 0000000000..7054c76741 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOBallUranium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleCompoundPlutonium.png b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleCompoundPlutonium.png new file mode 100644 index 0000000000..b3b36e3bdc Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleCompoundPlutonium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleCompoundThorium.png b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleCompoundThorium.png new file mode 100644 index 0000000000..ab142635c9 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleCompoundThorium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleCompoundUranium.png b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleCompoundUranium.png new file mode 100644 index 0000000000..e7ac40c10f Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleCompoundUranium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebblePlutonium.png b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebblePlutonium.png new file mode 100644 index 0000000000..ea22c17f5c Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebblePlutonium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleThorium.png b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleThorium.png new file mode 100644 index 0000000000..b2c8003b5c Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleThorium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleUranium.png b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleUranium.png new file mode 100644 index 0000000000..0d026c2492 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/HTGRTRISOPebbleUranium.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/TRISOPellet.png b/src/main/resources/assets/bartworks/textures/items/TRISOPellet.png deleted file mode 100644 index 26109fc979..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/items/TRISOPellet.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/items/TRISOPelletBall.png b/src/main/resources/assets/bartworks/textures/items/TRISOPelletBall.png deleted file mode 100644 index 0aea0500cf..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/items/TRISOPelletBall.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/items/TRISOPelletCompound.png b/src/main/resources/assets/bartworks/textures/items/TRISOPelletCompound.png deleted file mode 100644 index 6b2835d100..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/items/TRISOPelletCompound.png and /dev/null differ -- cgit From a65f2900a108d672531f28fc2b0738326755c81b Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Sun, 29 Aug 2021 00:48:30 +0800 Subject: Fix potential race condition on client side Former-commit-id: 2616978ec4ca6bed7892afe0f135768801bb0a41 --- .../ASM/BWCoreStaticReplacementMethodes.java | 15 ++++++++++----- .../bartworks/common/commands/ClearCraftingCache.java | 4 ++-- .../material/CircuitGeneration/CircuitImprintLoader.java | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java index 6399a5119b..47705042a9 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java @@ -32,14 +32,18 @@ import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; -import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.List; public class BWCoreStaticReplacementMethodes { + private static ThreadLocal> RECENTLYUSEDRECIPES = ThreadLocal.withInitial(AccessPriorityList::new); - public static final AccessPriorityList RECENTLYUSEDRECIPES = new AccessPriorityList<>(); + public static void clearRecentlyUsedRecipes() { + // the easiest way to ensure the cache is flushed without causing synchronization overhead + // is to just replace the whole ThreadLocal instance. + RECENTLYUSEDRECIPES = ThreadLocal.withInitial(AccessPriorityList::new); + } @SuppressWarnings("ALL") public static ItemStack findCachedMatchingRecipe(InventoryCrafting inventoryCrafting, World world) { @@ -79,7 +83,8 @@ public class BWCoreStaticReplacementMethodes { } else { IRecipe iPossibleRecipe = null; - Iterator> it = RECENTLYUSEDRECIPES.nodeIterator(); + AccessPriorityList cache = RECENTLYUSEDRECIPES.get(); + Iterator> it = cache.nodeIterator(); while (it.hasNext()) { AccessPriorityListNode recipeNode = it.next(); @@ -88,7 +93,7 @@ public class BWCoreStaticReplacementMethodes { if (!iPossibleRecipe.matches(inventoryCrafting, world)) continue; - RECENTLYUSEDRECIPES.addPrioToNode(recipeNode); + cache.addPrioToNode(recipeNode); return iPossibleRecipe.getCraftingResult(inventoryCrafting); } @@ -115,7 +120,7 @@ public class BWCoreStaticReplacementMethodes { return stack; if (stack != null) - RECENTLYUSEDRECIPES.addLast(recipe); + cache.addLast(recipe); return stack; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java index 42385c60f1..f9aba701a6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java @@ -40,7 +40,7 @@ public class ClearCraftingCache extends CommandBase { @Override public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { - BWCoreStaticReplacementMethodes.RECENTLYUSEDRECIPES.clear(); - p_71515_1_.addChatMessage(new ChatComponentText("Recipe Cache cleared? "+(BWCoreStaticReplacementMethodes.RECENTLYUSEDRECIPES.size() == 0))); + BWCoreStaticReplacementMethodes.clearRecentlyUsedRecipes(); + p_71515_1_.addChatMessage(new ChatComponentText("Recipe Cache cleared ")); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index bad997cb1e..3c4cb02013 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -219,7 +219,7 @@ public class CircuitImprintLoader { private static void removeOldRecipesFromRegistries() { recipeWorldCache.forEach(CraftingManager.getInstance().getRecipeList()::remove); - BWCoreStaticReplacementMethodes.RECENTLYUSEDRECIPES.clear(); + BWCoreStaticReplacementMethodes.clearRecentlyUsedRecipes(); gtrecipeWorldCache.forEach(GT_Recipe.GT_Recipe_Map.sSlicerRecipes.mRecipeList::remove); recipeWorldCache.forEach( r -> { -- cgit From 80d9ff75799a07a6dd624dfdcb713c735dbe362a Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Sat, 28 Aug 2021 19:31:38 +0200 Subject: Name & description changed Thorium High Temperature Reactor -> High Temeperature Gas-cooled Reactor Former-commit-id: b37a05b7dff3247bc370290c04a764855c721276 --- .../bartworks/common/loaders/ItemRegistry.java | 8 +- .../bartworks/common/loaders/RecipeLoader.java | 6 +- .../tileentities/multis/GT_TileEntity_HTGR.java | 518 +++++++++++++++++++++ .../tileentities/multis/GT_TileEntity_THTR.java | 491 ------------------- .../resources/assets/bartworks/lang/de_DE.lang | 2 +- .../resources/assets/bartworks/lang/en_US.lang | 2 +- .../resources/assets/bartworks/lang/zh_CN.lang | 2 +- 7 files changed, 528 insertions(+), 501 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 10ada4ea61..d277862e9a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -37,7 +37,7 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.debug.CreativeScan import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_CircuitAssemblyLine; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_DEHP; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaBlastFurnace; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaDistillTower; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; @@ -143,7 +143,7 @@ public class ItemRegistry { public static ItemStack[] megaMachines = new ItemStack[3]; public static ItemStack dehp; public static ItemStack[] voidminer = new ItemStack[3]; - public static ItemStack thtr; + public static ItemStack HTGR; public static ItemStack eic; public static ItemStack cal; public static ItemStack compressedHatch; @@ -185,8 +185,8 @@ public class ItemRegistry { if (ConfigHandler.creativeScannerID != 0) new CreativeScanner(ConfigHandler.creativeScannerID,"Creative Debug Scanner","Creative Debug Scanner",20); ItemRegistry.eic = new GT_TileEntity_ElectricImplosionCompressor(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, "ElectricImplosionCompressor", "Electric Implosion Compressor").getStackForm(1L); - ItemRegistry.thtr = new GT_TileEntity_THTR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, "THTR", "Thorium High Temperature Reactor").getStackForm(1L); - GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials(); + ItemRegistry.HTGR = new GT_TileEntity_HTGR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, "HTGR", "High Temperature Gas-cooled Reactor").getStackForm(1L); + GT_TileEntity_HTGR.HTGRMaterials.registeraTHR_Materials(); GT_OreDictUnificator.add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(ItemRegistry.BW_BLOCKS[2])); for (int i = 0; i < GT_Values.VN.length; i++) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index b300adaa11..3e716ac8bf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -26,7 +26,7 @@ import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_LESU; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_Windmill; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -744,9 +744,9 @@ public class RecipeLoader { 'G', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), } ); - GT_TileEntity_THTR.THTRMaterials.registerTHR_Recipes(); + GT_TileEntity_HTGR.HTGRMaterials.registerTHR_Recipes(); GT_ModHandler.addCraftingRecipe( - ItemRegistry.thtr, + ItemRegistry.HTGR, RecipeLoader.BITSD, new Object[]{ "BZB", diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java new file mode 100644 index 0000000000..eb665ec035 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -0,0 +1,518 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; + +import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.MathUtils; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.objects.XSTR; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.api.util.GT_LanguageManager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import java.util.Arrays; +import java.util.List; +import java.util.ArrayList; +import java.util.HashMap; + +public class GT_TileEntity_HTGR extends GT_MetaTileEntity_MultiBlockBase { + + private static final int BASECASINGINDEX = 44; + private static final int HELIUM_NEEDED = 730000; + private int HeliumSupply; + private int fueltype = -1, fuelsupply = 0; + private boolean empty; + private int emptyticksnodiff = 0; + private int coolanttaking = 0; + + public GT_TileEntity_HTGR(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + private GT_TileEntity_HTGR(String aName) { + super(aName); + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + this.HeliumSupply = aNBT.getInteger("HeliumSupply"); + this.fueltype = aNBT.getInteger("fueltype"); + this.fuelsupply = aNBT.getInteger("fuelsupply"); + this.empty = aNBT.getBoolean("EmptyMode"); + this.coolanttaking = aNBT.getInteger("coolanttaking"); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setInteger("HeliumSupply", this.HeliumSupply); + aNBT.setInteger("fueltype", this.fueltype); + aNBT.setInteger("fuelsupply", this.fuelsupply); + aNBT.setBoolean("EmptyMode", this.empty); + aNBT.setInteger("coolanttaking", this.coolanttaking); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (aBaseMetaTileEntity.isServerSide() && !this.empty){ + if (this.HeliumSupply < GT_TileEntity_HTGR.HELIUM_NEEDED){ + for (FluidStack fluidStack : this.getStoredFluids()){ + if (fluidStack.isFluidEqual(Materials.Helium.getGas(1))) { + int toget = Math.min(GT_TileEntity_HTGR.HELIUM_NEEDED - this.HeliumSupply, fluidStack.amount); + fluidStack.amount -= toget; + this.HeliumSupply += toget; + if(GT_TileEntity_HTGR.HELIUM_NEEDED == this.HeliumSupply && fluidStack.amount == 0) + fluidStack = null; + } + } + } + if(this.fuelsupply < 720000){ + for (ItemStack itemStack : this.getStoredInputs()) { + int type = -1; + if(itemStack == null) continue; + if(itemStack.getItem() != HTGRMaterials.aHTGR_Materials) continue; + int damage = HTGRMaterials.aHTGR_Materials.getDamage(itemStack); + if(!((damage + 1) % HTGRMaterials.MATERIALS_PER_FUEL == HTGRMaterials.USABLE_FUEL_INDEX + 1)) continue; // is fuel + type = damage / HTGRMaterials.MATERIALS_PER_FUEL; + if(this.fueltype == -1) + this.fueltype = type; + if(this.fueltype != type) + continue; + int toget = Math.min(720000 - this.fuelsupply, itemStack.stackSize); + this.fuelsupply += toget; + itemStack.stackSize -= toget; + } + this.updateSlots(); + } + } + } + + @Override + public boolean checkRecipe(ItemStack controllerStack) { + + if(this.empty) + { + this.mEfficiency = 10000; + this.mMaxProgresstime = 100; + return true; + } + if (!(this.HeliumSupply >= GT_TileEntity_HTGR.HELIUM_NEEDED && this.fuelsupply >= 72000)) + return false; + + double eff = Math.min(Math.pow(((double)this.fuelsupply-72000D)/72000D, 2D)+19D, 100D)/100D - ((double)(getIdealStatus() - getRepairStatus()) / 10D); + + if(eff <= 0) + return false; + + int toReduce = MathUtils.floorInt((double)this.fuelsupply * 0.005D * eff); + + this.fuelsupply -= toReduce; + int burnedballs = toReduce/64; + if(burnedballs > 0) + toReduce -= burnedballs*64; + + int meta = (this.fueltype * HTGRMaterials.MATERIALS_PER_FUEL) + HTGRMaterials.BURNED_OUT_FUEL_INDEX; + + this.mOutputItems = new ItemStack[] { + new ItemStack(HTGRMaterials.aHTGR_Materials, burnedballs, meta), + new ItemStack(HTGRMaterials.aHTGR_Materials, toReduce, meta + 1) + }; + + this.updateSlots(); + + this.coolanttaking = (int)(4000D * ((this.fueltype * 0.5D) + 1) * ((double)this.mEfficiency / 10000D)); + + this.mEfficiency = (int)(eff*10000D); + this.mEUt=0; + this.mMaxProgresstime=72000; + return true; + } + + private int runningtick = 0; + + @Override + public boolean onRunningTick(ItemStack aStack) { + runningtick++; + + if (this.empty){ + if(emptyticksnodiff > 20 && emptyticksnodiff % 20 != 0){ + emptyticksnodiff++; + return true; + } + if(this.HeliumSupply > 0){ + this.addOutput(Materials.Helium.getGas(this.HeliumSupply)); + this.HeliumSupply = 0; + } + if(this.fuelsupply > 0) + { + ItemStack iStack = new ItemStack(HTGRMaterials.aHTGR_Materials, this.fuelsupply, (HTGRMaterials.MATERIALS_PER_FUEL * this.fueltype) + HTGRMaterials.USABLE_FUEL_INDEX); + boolean storedAll = false; + for (GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) { + if(!isValidMetaTileEntity(tHatch)) + continue; + if (tHatch.storeAll(iStack)){ + storedAll = true; + break; + } + } + if(!storedAll){ + if(this.fuelsupply == iStack.stackSize) emptyticksnodiff++; + else {this.fuelsupply = iStack.stackSize; emptyticksnodiff = 0;} + } + else{ + this.fuelsupply = 0; + this.fueltype = -1; + this.coolanttaking = 0; + } + } + return true; + } + + if(runningtick % 20 == 0) + { + int takecoolant = coolanttaking; + int drainedamount = 0; + + for(GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches){ + if (isValidMetaTileEntity(tHatch)) { + FluidStack tLiquid = tHatch.getFluid(); + if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))){ + FluidStack drained = tHatch.drain(takecoolant, true); + takecoolant -= drained.amount; + drainedamount += drained.amount; + if(takecoolant <= 0) + break; + } + } + } + + if(drainedamount > 0) + addOutput(FluidRegistry.getFluidStack("ic2coolant", drainedamount)); + + this.updateSlots(); + + if(takecoolant > 0) + this.stopMachine(); + } + + return true; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + byte xz = 5; + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * xz; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * xz; + for (int x = -xz; x <= xz; x++) { + for (int z = -xz; z <= xz; z++) { + for (int y = 0; y < 12; y++) { + if (x + xDir == 0 && y == 0 && z + zDir == 0) + continue; + int ax = Math.abs(x), az = Math.abs(z); + if ( + (ax < 4 && az == 5) || // X WALLS + (az < 4 && ax == 5) || // Z WALLS + (ax == 4 && az == 4) || // CORNER WALLS + ((y == 0 || y == 11) && (!(ax >= 4 && az == 5) && !(az >= 4 && ax == 5))) // FLOOR & CEILING + ) { + if (!(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 12)) { + IGregTechTileEntity tEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z); + if ( + !(y == 11 && this.addInputToMachineList(tEntity, GT_TileEntity_HTGR.BASECASINGINDEX)) && + !(y == 0 && this.addOutputToMachineList(tEntity, GT_TileEntity_HTGR.BASECASINGINDEX)) && + !this.addMaintenanceToMachineList(tEntity, GT_TileEntity_HTGR.BASECASINGINDEX) + ) { + return false; + } + } + } + else if(!(ax >= 4 && az == 5) && !(az >= 4 && ax == 5)){ // inside + if(!aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z)) + return false; + } + } + } + } + return ( + this.mMaintenanceHatches.size() == 1 && + this.mInputHatches.size() > 0 && + this.mOutputHatches.size() > 0 && + this.mInputBusses.size() > 0 && + this.mOutputBusses.size() > 0 + ); + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_HTGR(this.mName); + } + + + @Override + public String[] getInfoData() { + return new String[]{ + "Mode:", this.empty ? "Emptying" : "Normal", + "Progress:", GT_Utility.formatNumbers(this.mProgresstime / 20) + "s / " + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "s", + "Fuel type:", (this.fueltype == -1 ? "NONE" : ("TRISO (" + HTGRMaterials.sHTGR_Fuel[this.fueltype].sEnglish) + ")"), + "Fuel amount:", GT_Utility.formatNumbers(this.fuelsupply) + " pcs.", + "Helium-Level:", GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + GT_Utility.formatNumbers(GT_TileEntity_HTGR.HELIUM_NEEDED) + "L", + "Coolant:", GT_Utility.formatNumbers(coolanttaking) + "L/s", + "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) + }; + } + + @Override + public String[] getDescription() { + return BW_Tooltip_Reference.getTranslatedBrandedTooltip("tooltip.tile.htgr.0.name"); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).glow().build()))} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX)}; + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if(this.mMaxProgresstime > 0) + { + GT_Utility.sendChatToPlayer(aPlayer, "HTGR mode cannot be changed while the machine is running."); + return; + } + this.empty = !this.empty; + GT_Utility.sendChatToPlayer(aPlayer, "HTGR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); + } + + + + public static class HTGRMaterials{ + + private static class CustomHTGRSimpleSubItemClass extends SimpleSubItemClass{ + HashMap tooltip = null; + public CustomHTGRSimpleSubItemClass(HashMap tooltip, String... tex){ + super(tex); + this.tooltip = tooltip; + } + @Override + @SuppressWarnings("unchecked") + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { + if(tooltip.containsKey(getDamage(p_77624_1_))) + aList.add(tooltip.get(getDamage(p_77624_1_))); + aList.add("Material for High Temperature Gas-cooled Reactor"); + super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); + } + } + + private static class Base_{ + public String sName; + public String sEnglish; + public String sTooltip; + public Base_(String a, String b){ + this.sName = a; + this.sEnglish = b; + this.sTooltip = ""; + } + public Base_(String a, String b, String c){ + this.sName = a; + this.sEnglish = b; + this.sTooltip = c; + } + } + static class Fuel_{ + public String sName; + public String sEnglish; + public ItemStack mainItem; + public ItemStack secondaryItem; + public ItemStack[] recycledItems = { GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI }; + public FluidStack recycledFluid; + public int[] recycleChances; + public String tooltip; + public Fuel_(String sName, String sEnglish, ItemStack mainItem, ItemStack secondaryItem, FluidStack recycledFluid, ItemStack[] recycledItems, int[] recycleChances, String tooltip){ + this.sName = sName; + this.sEnglish = sEnglish; + this.mainItem = mainItem; + this.secondaryItem = secondaryItem; + this.recycledFluid = recycledFluid; + for(int i = 0; i < recycledItems.length; i++) + this.recycledItems[i] = recycledItems[i]; + this.recycleChances = recycleChances; + this.tooltip = tooltip; + } + } + private static class LangEntry_{ + public String sName; + public String sEnglish; + public LangEntry_(String a, String b){ + this.sName = a; + this.sEnglish = b; + } + } + + static final Base_[] sHTGR_Bases = new Base_[]{ + new Base_("HTGRFuelMixture", "HTGR fuel mixture"), + new Base_("BISOPebbleCompound", "BISO pebble compound"), + new Base_("TRISOPebbleCompound", "TRISO pebble compound"), + new Base_("TRISOBall", "TRISO ball"), + new Base_("TRISOPebble", "TRISO pebble"), + new Base_("BurnedOutTRISOBall", "Burned out TRISO Ball"), + new Base_("BurnedOutTRISOPebble", "Burned out TRISO Pebble"), + }; + static final int MATERIALS_PER_FUEL = sHTGR_Bases.length; + static final int USABLE_FUEL_INDEX = 4; + static final int BURNED_OUT_FUEL_INDEX = 5; + static final Fuel_[] sHTGR_Fuel = new Fuel_[]{ + new Fuel_("Thorium", "Thorium", WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 64), Materials.Uranium235.getDust(4), + GT_Values.NF, new ItemStack[]{ + Materials.Silicon.getDustSmall(1), Materials.Graphite.getDustSmall(1), Materials.Carbon.getDustSmall(1), + Materials.Lutetium.getDustSmall(1), WerkstoffLoader.Thorium232.get(OrePrefixes.dustSmall,1)}, + new int[]{9000, 9000, 9000, 9000, 1000}, "Multiplies coolant by 1"), + new Fuel_("Uranium", "Uranium", Materials.Uranium.getDust(60), Materials.Uranium235.getDust(8), + FluidRegistry.getFluidStack("krypton", 7), new ItemStack[]{ + Materials.Silicon.getDustSmall(1), Materials.Graphite.getDustSmall(1), Materials.Carbon.getDustSmall(1), + Materials.Lead.getDustSmall(1), + Materials.Uranium.getDustSmall(1)}, + new int[]{9000, 9000, 9000, 6562, 937}, "Multiplies coolant by 1.5"), + new Fuel_("Plutonium", "Plutonium", Materials.Plutonium.getDust(64), Materials.Plutonium241.getDust(4), + FluidRegistry.getFluidStack("xenon", 8), new ItemStack[]{ + Materials.Silicon.getDustSmall(1), Materials.Graphite.getDustSmall(1), Materials.Carbon.getDustSmall(1), + Materials.Lead.getDustSmall(1), + Materials.Plutonium.getDustSmall(1)}, + new int[]{9000, 9000, 9000, 7000, 1000}, "Multiplies coolant by 2"), + }; + static final CustomHTGRSimpleSubItemClass aHTGR_Materials; + static final ArrayList aHTGR_Localizations = new ArrayList(); + static{ + String[] sHTGR_Materials = new String[sHTGR_Bases.length*sHTGR_Fuel.length]; + HashMap tooltip = new HashMap(); + int i = 0; + for(Fuel_ fuel : sHTGR_Fuel) + for(Base_ base : sHTGR_Bases) + { + sHTGR_Materials[i] = "HTGR" + base.sName + fuel.sName; + aHTGR_Localizations.add(new LangEntry_("item." + sHTGR_Materials[i] + ".name", base.sEnglish + " (" + fuel.sEnglish + ")")); + if(((i+1) % MATERIALS_PER_FUEL == (USABLE_FUEL_INDEX + 1)) && fuel.tooltip != null && fuel.tooltip != "") + tooltip.put(i, fuel.tooltip); + i++; + } + aHTGR_Materials = new CustomHTGRSimpleSubItemClass(tooltip, sHTGR_Materials); + } + + + public static void registeraTHR_Materials(){ + for(LangEntry_ iName : aHTGR_Localizations) + GT_LanguageManager.addStringLocalization(iName.sName, iName.sEnglish); + GameRegistry.registerItem(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials,"bw.HTGRMaterials"); + } + + public static void registerTHR_Recipes(){ + GT_Values.RA.addCentrifugeRecipe( + Materials.Thorium.getDust(1),GT_Values.NI,GT_Values.NF,GT_Values.NF, + Materials.Thorium.getDustSmall(2),Materials.Thorium.getDustSmall(1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1),WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1),Materials.Lutetium.getDustTiny(1), + new int[]{1600,1500,200,200,50,50}, + 10000, BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.plateDense,Materials.Lead,6), + GT_OreDictUnificator.get(OrePrefixes.frameGt,Materials.TungstenSteel,1) + }, + Materials.Concrete.getMolten(1296), + new ItemStack(GregTech_API.sBlockCasings3,1,12), + 40, + BW_Util.getMachineVoltageFromTier(5) + ); + int i = 0; + for(Fuel_ fuel : sHTGR_Fuel){ + GT_Values.RA.addMixerRecipe(fuel.mainItem, fuel.secondaryItem ,GT_Utility.getIntegratedCircuit(1),null,null,null,new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i),400,30); + GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i), Materials.Carbon.getDust(64),new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1),40,30); + GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), Materials.Silicon.getDust(64),new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2),40,30); + GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3),40,30); + ItemStack[] pellets = new ItemStack[4]; + Arrays.fill(pellets,new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false, new ItemStack[]{new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), GT_Utility.getIntegratedCircuit(17)}, pellets, null, null, null, null, 32000, 30, 0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false, new ItemStack[]{new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5), GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 6)}, null, null, null, null,48000,30,0); + GT_Values.RA.addCentrifugeRecipe( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 6), GT_Values.NI, GT_Values.NF, + fuel.recycledFluid, + fuel.recycledItems[0], + fuel.recycledItems[1], + fuel.recycledItems[2], + fuel.recycledItems[3], + fuel.recycledItems[4], + fuel.recycledItems[5], + fuel.recycleChances, + 1200, 30); + i += sHTGR_Bases.length; + } + } + + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java deleted file mode 100644 index 61a1e707e4..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ /dev/null @@ -1,491 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities.multis; - -import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.MathUtils; -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.api.objects.XSTR; -import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.api.util.GT_LanguageManager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -import java.util.Arrays; -import java.util.ArrayList; - -public class GT_TileEntity_THTR extends GT_MetaTileEntity_MultiBlockBase { - - private static final int BASECASINGINDEX = 44; - private static final int HELIUM_NEEDED = 730000; - private int HeliumSupply; - private int fueltype = -1, fuelsupply = 0; - private boolean empty; - private int emptyticksnodiff = 0; - private int coolanttaking = 0; - - public GT_TileEntity_THTR(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - private GT_TileEntity_THTR(String aName) { - super(aName); - } - - @Override - public boolean isCorrectMachinePart(ItemStack itemStack) { - return true; - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - this.HeliumSupply = aNBT.getInteger("HeliumSupply"); - this.fueltype = aNBT.getInteger("fueltype"); - this.fuelsupply = aNBT.getInteger("fuelsupply"); - this.empty = aNBT.getBoolean("EmptyMode"); - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setInteger("HeliumSupply", this.HeliumSupply); - aNBT.setInteger("fueltype", this.fueltype); - aNBT.setInteger("fuelsupply", this.fuelsupply); - aNBT.setBoolean("EmptyMode", this.empty); - } - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - super.onPostTick(aBaseMetaTileEntity, aTick); - if (aBaseMetaTileEntity.isServerSide() && !this.empty){ - if (this.HeliumSupply < GT_TileEntity_THTR.HELIUM_NEEDED){ - for (FluidStack fluidStack : this.getStoredFluids()){ - if (fluidStack.isFluidEqual(Materials.Helium.getGas(1))) { - int toget = Math.min(GT_TileEntity_THTR.HELIUM_NEEDED - this.HeliumSupply, fluidStack.amount); - fluidStack.amount -= toget; - this.HeliumSupply += toget; - if(GT_TileEntity_THTR.HELIUM_NEEDED == this.HeliumSupply && fluidStack.amount == 0) - fluidStack = null; - } - } - } - if(this.fuelsupply < 720000){ - for (ItemStack itemStack : this.getStoredInputs()) { - int type = -1; - if(itemStack == null) continue; - if(itemStack.getItem() != THTRMaterials.aTHTR_Materials) continue; - int damage = THTRMaterials.aTHTR_Materials.getDamage(itemStack); - if(!((damage + 1) % THTRMaterials.MATERIALS_PER_FUEL == THTRMaterials.USABLE_FUEL_INDEX + 1)) continue; // is fuel - type = damage / THTRMaterials.MATERIALS_PER_FUEL; - if(this.fueltype == -1) - this.fueltype = type; - if(this.fueltype != type) - continue; - int toget = Math.min(720000 - this.fuelsupply, itemStack.stackSize); - this.fuelsupply += toget; - itemStack.stackSize -= toget; - } - this.updateSlots(); - } - } - } - - @Override - public boolean checkRecipe(ItemStack controllerStack) { - - if(this.empty) - { - this.mEfficiency = 10000; - this.mMaxProgresstime = 100; - return true; - } - if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.fuelsupply >= 72000)) - return false; - - double eff = Math.min(Math.pow(((double)this.fuelsupply-72000D)/72000D, 2D)+19D, 100D)/100D - ((double)(getIdealStatus() - getRepairStatus()) / 10D); - - if(eff <= 0) - return false; - - int toReduce = MathUtils.floorInt((double)this.fuelsupply * 0.005D * eff); - - this.fuelsupply -= toReduce; - int burnedballs = toReduce/64; - if(burnedballs > 0) - toReduce -= burnedballs*64; - - int meta = (this.fueltype * THTRMaterials.MATERIALS_PER_FUEL) + THTRMaterials.BURNED_OUT_FUEL_INDEX; - - this.mOutputItems = new ItemStack[] { - new ItemStack(THTRMaterials.aTHTR_Materials, burnedballs, meta), - new ItemStack(THTRMaterials.aTHTR_Materials, toReduce, meta + 1) - }; - - this.updateSlots(); - - this.coolanttaking = (int)(4000D * ((this.fueltype * 0.5D) + 1) * ((double)this.mEfficiency / 10000D)) * 20; // 100 LHEs btw, why? - - this.mEfficiency = (int)(eff*10000D); - this.mEUt=0; - this.mMaxProgresstime=72000; - return true; - } - - private static int runningtick = 0; - - @Override - public boolean onRunningTick(ItemStack aStack) { - runningtick++; - - if (this.empty){ - if(emptyticksnodiff > 20 && emptyticksnodiff % 20 != 0){ - emptyticksnodiff++; - return true; - } - if(this.HeliumSupply > 0){ - this.addOutput(Materials.Helium.getGas(this.HeliumSupply)); - this.HeliumSupply = 0; - } - if(this.fuelsupply > 0) - { - ItemStack iStack = new ItemStack(THTRMaterials.aTHTR_Materials, this.fuelsupply, (THTRMaterials.MATERIALS_PER_FUEL * this.fueltype) + THTRMaterials.USABLE_FUEL_INDEX); - boolean storedAll = false; - for (GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) { - if(!isValidMetaTileEntity(tHatch)) - continue; - if (tHatch.storeAll(iStack)){ - storedAll = true; - break; - } - } - if(!storedAll){ - if(this.fuelsupply == iStack.stackSize) emptyticksnodiff++; - else {this.fuelsupply = iStack.stackSize; emptyticksnodiff = 0;} - } - else{ - this.fuelsupply = 0; - this.fueltype = -1; - } - } - return true; - } - - if(runningtick % 20 == 0) - { - int takecoolant = coolanttaking; - int drainedamount = 0; - - for(GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches){ - if (isValidMetaTileEntity(tHatch)) { - FluidStack tLiquid = tHatch.getFluid(); - if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))){ - FluidStack drained = tHatch.drain(takecoolant, true); - takecoolant -= drained.amount; - drainedamount += drained.amount; - if(takecoolant <= 0) - break; - } - } - } - - if(drainedamount > 0) - addOutput(FluidRegistry.getFluidStack("ic2coolant", drainedamount)); - - this.updateSlots(); - - if(takecoolant > 0) - this.stopMachine(); - } - - return true; - } - - @Override - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - byte xz = 5; - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * xz; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * xz; - for (int x = -xz; x <= xz; x++) { - for (int z = -xz; z <= xz; z++) { - for (int y = 0; y < 12; y++) { - if (x + xDir == 0 && y == 0 && z + zDir == 0) - continue; - int ax = Math.abs(x), az = Math.abs(z); - if ( - (ax < 4 && az == 5) || // X WALLS - (az < 4 && ax == 5) || // Z WALLS - (ax == 4 && az == 4) || // CORNER WALLS - ((y == 0 || y == 11) && (!(ax >= 4 && az == 5) && !(az >= 4 && ax == 5))) // FLOOR & CEILING - ) { - if (!(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 12)) { - IGregTechTileEntity tEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z); - if ( - !(y == 11 && this.addInputToMachineList(tEntity, GT_TileEntity_THTR.BASECASINGINDEX)) && - !(y == 0 && this.addOutputToMachineList(tEntity, GT_TileEntity_THTR.BASECASINGINDEX)) && - !this.addMaintenanceToMachineList(tEntity, GT_TileEntity_THTR.BASECASINGINDEX) - ) { - return false; - } - } - } - else if(!(ax >= 4 && az == 5) && !(az >= 4 && ax == 5)){ // inside - if(!aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z)) - return false; - } - } - } - } - return ( - this.mMaintenanceHatches.size() == 1 && - this.mInputHatches.size() > 0 && - this.mOutputHatches.size() > 0 && - this.mInputBusses.size() > 0 && - this.mOutputBusses.size() > 0 - ); - } - - @Override - public int getMaxEfficiency(ItemStack itemStack) { - return 10000; - } - - @Override - public int getPollutionPerTick(ItemStack itemStack) { - return 0; - } - - @Override - public int getDamageToComponent(ItemStack itemStack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack itemStack) { - return false; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_TileEntity_THTR(this.mName); - } - - - @Override - public String[] getInfoData() { - return new String[]{ - "Mode:", this.empty ? "Emptying" : "Normal", - "Progress:", GT_Utility.formatNumbers(this.mProgresstime / 20) + "s / " + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "s", - "Fuel type:", (this.fueltype == -1 ? "NONE" : ("TRISO (" + THTRMaterials.sTHTR_Fuel[this.fueltype].sEnglish) + ")"), - "Fuel amount:", GT_Utility.formatNumbers(this.fuelsupply) + " pcs.", - "Helium-Level:", GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + GT_Utility.formatNumbers(GT_TileEntity_THTR.HELIUM_NEEDED) + "L", - "Coolant/t:", GT_Utility.formatNumbers(coolanttaking) + "L/s", - "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) - }; - } - - @Override - public String[] getDescription() { - return BW_Tooltip_Reference.getTranslatedBrandedTooltip("tooltip.tile.htr.0.name"); - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).glow().build()))} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX)}; - } - - @Override - public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if(this.mMaxProgresstime > 0) - { - GT_Utility.sendChatToPlayer(aPlayer, "THTR mode cant be changed when running."); - return; - } - this.empty = !this.empty; - GT_Utility.sendChatToPlayer(aPlayer, "THTR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); - } - - - - public static class THTRMaterials{ - private static class Base_{ - public String sName; - public String sEnglish; - public String sTooltip; - public Base_(String a, String b){ - this.sName = a; - this.sEnglish = b; - this.sTooltip = ""; - } - public Base_(String a, String b, String c){ - this.sName = a; - this.sEnglish = b; - this.sTooltip = c; - } - } - static class Fuel_{ - public String sName; - public String sEnglish; - public ItemStack mainItem; - public ItemStack secondaryItem; - public ItemStack[] recycledItems = { GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI }; - public FluidStack recycledFluid; - public int[] recycleChances; - public Fuel_(String sName, String sEnglish, ItemStack mainItem, ItemStack secondaryItem, FluidStack recycledFluid, ItemStack[] recycledItems, int[] recycleChances){ - this.sName = sName; - this.sEnglish = sEnglish; - this.mainItem = mainItem; - this.secondaryItem = secondaryItem; - this.recycledFluid = recycledFluid; - for(int i = 0; i < recycledItems.length; i++) - this.recycledItems[i] = recycledItems[i]; - this.recycleChances = recycleChances; - } - } - private static class LangEntry_{ - public String sName; - public String sEnglish; - public LangEntry_(String a, String b){ - this.sName = a; - this.sEnglish = b; - } - } - - static final Base_[] sTHTR_Bases = new Base_[]{ - new Base_("HTGRFuelMixture", "HTGR fuel mixture"), - new Base_("BISOPebbleCompound", "BISO pebble compound"), - new Base_("TRISOPebbleCompound", "TRISO pebble compound"), - new Base_("TRISOBall", "TRISO ball"), - new Base_("TRISOPebble", "TRISO pebble"), - new Base_("BurnedOutTRISOBall", "Burned out TRISO Ball"), - new Base_("BurnedOutTRISOPebble", "Burned out TRISO Pebble"), - }; - static final int MATERIALS_PER_FUEL = sTHTR_Bases.length; - static final int USABLE_FUEL_INDEX = 4; - static final int BURNED_OUT_FUEL_INDEX = 5; - static final Fuel_[] sTHTR_Fuel = new Fuel_[]{ - new Fuel_("Thorium", "Thorium", WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 64), Materials.Uranium235.getDust(4), - GT_Values.NF, new ItemStack[]{ - Materials.Silicon.getDustSmall(1), Materials.Graphite.getDustSmall(1), Materials.Carbon.getDustSmall(1), - Materials.Lutetium.getDustSmall(1), WerkstoffLoader.Thorium232.get(OrePrefixes.dustSmall,1)}, - new int[]{9000, 9000, 9000, 9000, 1000}), - new Fuel_("Uranium", "Uranium", Materials.Uranium.getDust(60), Materials.Uranium235.getDust(8), - FluidRegistry.getFluidStack("krypton", 7), new ItemStack[]{ - Materials.Silicon.getDustSmall(1), Materials.Graphite.getDustSmall(1), Materials.Carbon.getDustSmall(1), - Materials.Lead.getDustSmall(1), - Materials.Uranium.getDustSmall(1)}, - new int[]{9000, 9000, 9000, 6562, 937}), - new Fuel_("Plutonium", "Plutonium", Materials.Plutonium.getDust(64), Materials.Plutonium241.getDust(4), - FluidRegistry.getFluidStack("xenon", 8), new ItemStack[]{ - Materials.Silicon.getDustSmall(1), Materials.Graphite.getDustSmall(1), Materials.Carbon.getDustSmall(1), - Materials.Lead.getDustSmall(1), - Materials.Plutonium.getDustSmall(1)}, - new int[]{9000, 9000, 9000, 7000, 1000}), - }; - static final SimpleSubItemClass aTHTR_Materials; - static final ArrayList aTHTR_Localizations = new ArrayList(); - static{ - String[] sTHTR_Materials = new String[sTHTR_Bases.length*sTHTR_Fuel.length]; - int i = 0; - for(Fuel_ fuel : sTHTR_Fuel) - for(Base_ base : sTHTR_Bases) - { - sTHTR_Materials[i] = "HTGR" + base.sName + fuel.sName; - aTHTR_Localizations.add(new LangEntry_("item." + sTHTR_Materials[i] + ".name", base.sEnglish + " (" + fuel.sEnglish + ")")); - i++; - } - aTHTR_Materials = new SimpleSubItemClass(sTHTR_Materials); - } - - - public static void registeraTHR_Materials(){ - for(LangEntry_ iName : aTHTR_Localizations) - GT_LanguageManager.addStringLocalization(iName.sName, iName.sEnglish); - GameRegistry.registerItem(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,"bw.THTRMaterials"); - } - - public static void registerTHR_Recipes(){ - GT_Values.RA.addCentrifugeRecipe( - Materials.Thorium.getDust(1),GT_Values.NI,GT_Values.NF,GT_Values.NF, - Materials.Thorium.getDustSmall(2),Materials.Thorium.getDustSmall(1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1),WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1),Materials.Lutetium.getDustTiny(1), - new int[]{1600,1500,200,200,50,50}, - 10000, BW_Util.getMachineVoltageFromTier(4)); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - GT_OreDictUnificator.get(OrePrefixes.plateDense,Materials.Lead,6), - GT_OreDictUnificator.get(OrePrefixes.frameGt,Materials.TungstenSteel,1) - }, - Materials.Concrete.getMolten(1296), - new ItemStack(GregTech_API.sBlockCasings3,1,12), - 40, - BW_Util.getMachineVoltageFromTier(5) - ); - int i = 0; - for(Fuel_ fuel : sTHTR_Fuel){ - GT_Values.RA.addMixerRecipe(fuel.mainItem, fuel.secondaryItem ,GT_Utility.getIntegratedCircuit(1),null,null,null,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i),400,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i), Materials.Carbon.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i + 1),40,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i + 1), Materials.Silicon.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i + 2),40,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i + 2), Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i + 3),40,30); - ItemStack[] pellets = new ItemStack[4]; - Arrays.fill(pellets,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, i + 4)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false, new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i + 3), GT_Utility.getIntegratedCircuit(17)}, pellets, null, null, null, null, 32000, 30, 0); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false, new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i + 5), GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, i + 6)}, null, null, null, null,48000,30,0); - GT_Values.RA.addCentrifugeRecipe( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, i + 6), GT_Values.NI, GT_Values.NF, - fuel.recycledFluid, - fuel.recycledItems[0], - fuel.recycledItems[1], - fuel.recycledItems[2], - fuel.recycledItems[3], - fuel.recycledItems[4], - fuel.recycledItems[5], - fuel.recycleChances, - 1200, 30); - i += sTHTR_Bases.length; - } - } - - } -} diff --git a/src/main/resources/assets/bartworks/lang/de_DE.lang b/src/main/resources/assets/bartworks/lang/de_DE.lang index baf62d614a..b9c756e863 100644 --- a/src/main/resources/assets/bartworks/lang/de_DE.lang +++ b/src/main/resources/assets/bartworks/lang/de_DE.lang @@ -106,7 +106,7 @@ tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4 tooltip.tile.diode.0.name=A Simple diode that will allow Energy Flow in only one direction. tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so! tooltip.tile.energydistributor.0.name=Splits Amperage into several Sides. -tooltip.tile.htr.0.name=Controller Block für den Thorium Hoch Temperatur Reaktor;Größe(BxHxL): 11x12x11 (Innen Leer);Controller: Vorne Mitte, Unterste Schicht;Ecken und die 2 beührenden Blöcke sind Luft (Zylinder);Once build, Helium is inserted into the Fluid Input Hatch until it doesnt accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Raidation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete Operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes 1 Fuel Pellet per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days +#tooltip.tile.htgr.0.name=Controller Block für den Thorium Hoch Temperatur Reaktor;Größe(BxHxL): 11x12x11 (Innen Leer);Controller: Vorne Mitte, Unterste Schicht;Ecken und die 2 beührenden Blöcke sind Luft (Zylinder);Once build, Helium is inserted into the Fluid Input Hatch until it doesnt accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Raidation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete Operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes 1 Fuel Pellet per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days tooltip.tile.lesu.0.name=Controller Block for the GT2-Styled L.E.S.U.;Size: ANY tooltip.tile.lesu.1.name=Storage per LESU Casing: tooltip.tile.lesu.2.name=Output EU: LESU Casings amount;Input EU: Next Voltage Tier to Output EU;Input/Output Amps can be configured via 4 Circuits in GUI;Output Side has a dot on it. diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 38d274c5b8..96db7499dd 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -144,7 +144,7 @@ tile.radiohatch.name=Radio Hatch tile.bw.windmill.name=Windmill tile.manutrafo.name=Manual Trafo -tooltip.tile.htr.0.name=Controller Block for the Thorium High Temperature Reactor;Size(WxHxD): 11x12x11 (Hollow);Controller: Front Center, Lowest Layer;Corners and the 2 touching blocks are air (cylindric);Once built, Helium is inserted into the Fluid Input Hatch until it doesn't accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Radiation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes up to 0.5% of total Fuel Pellets per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days +tooltip.tile.htgr.0.name=Controller Block for the High Temperature Gas-cooled Reactor;Size(WxHxD): 11x12x11 (Hollow);Controller: Front Center, Lowest Layer;Corners and the 2 touching blocks are air (cylindric);Once built, Helium is inserted into the Fluid Input Hatch until it doesn't accept any more (730000L);1+ Output Bus (Any Bottom casing);1+ Output Hatch (Any Bottom casing);1+ Input Bus (Any Top casing);1+ Input Hatch (Any Top casing);1x Maintenance Hatch (Any casing);Radiation Proof Casings for the Rest;Needs a constant supply of coolant while running;Needs at least 72k Fuel pebbles to start operation (can hold up to 720k pebbles);Consumes up to 0.5% of total Fuel Pellets per Operation depending on efficiency;Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer;Base coolant amount is 4 000L/s multiplied by efficiency and by fuel coolant value (check tooltips);One Operation takes 1 hour itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index 9b54684d3c..c0bb7e4722 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -144,7 +144,7 @@ tile.radiohatch.name=放射仓 tile.bw.windmill.name=风车 tile.manutrafo.name=手动变压器 -tooltip.tile.htr.0.name=高温钍反应堆的控制器方块;大小(宽x高x长):11x12x11 (中空);控制器:正面中心,最低一层;角落和两个相邻的方块是空气;:一旦搭建完成,需要在输入仓中输入氦气直到不再接受;1+输出仓(任意底部机械方块);1+输入仓(任意顶部机械方块);1+输入总线(任意顶部机械方块);1x维护仓(任意机械方块);其余的为辐射防护机械方块;在运行时需要持续供应冷却液,完成工作后输出;需要至少100k卵石燃料才能开始工作(最多可使用675k个卵石);每次操作消耗1个燃料颗粒;TRISO卵石将提供30%的额外能量;每个卵石都会增加转换冷却剂的需求数量;一次工作耗时27个游戏日 +#tooltip.tile.htgr.0.name=高温钍反应堆的控制器方块;大小(宽x高x长):11x12x11 (中空);控制器:正面中心,最低一层;角落和两个相邻的方块是空气;:一旦搭建完成,需要在输入仓中输入氦气直到不再接受;1+输出仓(任意底部机械方块);1+输入仓(任意顶部机械方块);1+输入总线(任意顶部机械方块);1x维护仓(任意机械方块);其余的为辐射防护机械方块;在运行时需要持续供应冷却液,完成工作后输出;需要至少100k卵石燃料才能开始工作(最多可使用675k个卵石);每次操作消耗1个燃料颗粒;TRISO卵石将提供30%的额外能量;每个卵石都会增加转换冷却剂的需求数量;一次工作耗时27个游戏日 itemGroup.bartworksMetaMaterials=BartWorks-meta材料 -- cgit From 00ec135c2e2fbcd64a9bd84991a6b35316d09b77 Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Sat, 28 Aug 2021 20:19:57 +0200 Subject: Small mistakes Former-commit-id: dcdd7a8b45923cb099bc068808397a0a239df11b --- .../bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java | 4 ++-- src/main/resources/assets/bartworks/lang/en_US.lang | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index eb665ec035..0f888e8a32 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -169,7 +169,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_MultiBlockBase { this.updateSlots(); - this.coolanttaking = (int)(4000D * ((this.fueltype * 0.5D) + 1) * ((double)this.mEfficiency / 10000D)); + this.coolanttaking = (int)(4000D * (((this.fueltype * 0.5D) + 1)) * eff); this.mEfficiency = (int)(eff*10000D); this.mEUt=0; @@ -236,7 +236,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_MultiBlockBase { } if(drainedamount > 0) - addOutput(FluidRegistry.getFluidStack("ic2coolant", drainedamount)); + addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount)); this.updateSlots(); diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 96db7499dd..77f6189cf2 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -144,7 +144,7 @@ tile.radiohatch.name=Radio Hatch tile.bw.windmill.name=Windmill tile.manutrafo.name=Manual Trafo -tooltip.tile.htgr.0.name=Controller Block for the High Temperature Gas-cooled Reactor;Size(WxHxD): 11x12x11 (Hollow);Controller: Front Center, Lowest Layer;Corners and the 2 touching blocks are air (cylindric);Once built, Helium is inserted into the Fluid Input Hatch until it doesn't accept any more (730000L);1+ Output Bus (Any Bottom casing);1+ Output Hatch (Any Bottom casing);1+ Input Bus (Any Top casing);1+ Input Hatch (Any Top casing);1x Maintenance Hatch (Any casing);Radiation Proof Casings for the Rest;Needs a constant supply of coolant while running;Needs at least 72k Fuel pebbles to start operation (can hold up to 720k pebbles);Consumes up to 0.5% of total Fuel Pellets per Operation depending on efficiency;Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer;Base coolant amount is 4 000L/s multiplied by efficiency and by fuel coolant value (check tooltips);One Operation takes 1 hour +tooltip.tile.htgr.0.name=Controller Block for the High Temperature Gas-cooled Reactor;Size(WxHxD): 11x12x11 (Hollow);Controller: Front Center, Lowest Layer;Corners and the 2 touching blocks are air (cylindric);Once built, Helium is inserted into the Fluid Input Hatch until it doesn't accept any more (730000L);1+ Output Bus (Any Bottom casing);1+ Output Hatch (Any Bottom casing);1+ Input Bus (Any Top casing);1+ Input Hatch (Any Top casing);1x Maintenance Hatch (Any casing);Radiation Proof Casings for the Rest;Needs a constant supply of coolant while running;Needs at least 72k Fuel pebbles to start operation (can hold up to 720k pebbles);Consumes up to 0.5% of total Fuel Pellets per Operation depending on efficiency;Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer;Reactor will take 4 000L/s of coolant multiplied by efficiency and by fuel coolant value (check tooltips);One Operation takes 1 hour itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials -- cgit From bf44450897ff7de8032ae561d5e5842209448b6b Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Sun, 29 Aug 2021 00:47:43 +0200 Subject: Lower minimal efficiency Former-commit-id: d8793b8722b60acb64423b01fd278857f1a041db --- .../bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 0f888e8a32..64b5f6da12 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -148,7 +148,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_MultiBlockBase { if (!(this.HeliumSupply >= GT_TileEntity_HTGR.HELIUM_NEEDED && this.fuelsupply >= 72000)) return false; - double eff = Math.min(Math.pow(((double)this.fuelsupply-72000D)/72000D, 2D)+19D, 100D)/100D - ((double)(getIdealStatus() - getRepairStatus()) / 10D); + double eff = Math.min(Math.pow((double)this.fuelsupply/72000D, 2D), 100D)/100D - ((double)(getIdealStatus() - getRepairStatus()) / 10D); if(eff <= 0) return false; -- cgit From 35c1dd74f55a3bff5140245cad328a88de1c612c Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Sun, 29 Aug 2021 05:37:07 +0200 Subject: Structurelib integration Former-commit-id: e51fc32ee196e013088bf03404d6a1c478b62f69 --- .../tileentities/multis/GT_TileEntity_HTGR.java | 136 +++++++++++++-------- .../resources/assets/bartworks/lang/de_DE.lang | 1 - .../resources/assets/bartworks/lang/en_US.lang | 2 - .../resources/assets/bartworks/lang/zh_CN.lang | 2 - 4 files changed, 86 insertions(+), 55 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 64b5f6da12..791c0dd9f0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.IStructureElement; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; @@ -36,7 +39,7 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.objects.XSTR; @@ -45,6 +48,7 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -52,14 +56,46 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; + import java.util.Arrays; import java.util.List; import java.util.ArrayList; import java.util.HashMap; -public class GT_TileEntity_HTGR extends GT_MetaTileEntity_MultiBlockBase { +public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase { private static final int BASECASINGINDEX = 44; + + private static final String STRUCTURE_PIECE_MAIN = "main"; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {" BBBBBBB "," BBBBBBBBB ","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB"," BBBBBBBBB "," BBBBBBB "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" bbb~bbb "," bbbbbbbbb ","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb"," bbbbbbbbb "," bbbbbbb "}, + })) + .addElement('c', ofBlock(GregTech_API.sBlockCasings3, 12)) + .addElement('b', ofChain( + ofHatchAdder(GT_TileEntity_HTGR::addOutputToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_HTGR::addMaintenanceToMachineList, BASECASINGINDEX, 1), + ofBlock(GregTech_API.sBlockCasings3, 12) + )) + .addElement('B', ofHatchAdderOptional(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2, GregTech_API.sBlockCasings3, 12)) + .build(); + private static final int HELIUM_NEEDED = 730000; private int HeliumSupply; private int fueltype = -1, fuelsupply = 0; @@ -80,6 +116,53 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_MultiBlockBase { return true; } + @Override + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("High Temperature Reactor") + .addInfo("Controller block for the High Temperature Gas-cooled Reactor (HTGR)") + .addInfo("Needs a constant supply of coolant while running") + .addInfo("Needs at least 72k Fuel pebbles to start operation (can hold up to 720k pebbles)") + .addInfo("Consumes up to 0.5% of total Fuel Pellets per Operation depending on efficiency") + .addInfo("Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer") + .addInfo("Reactor will take 4 000L/s of coolant multiplied by efficiency and by fuel coolant value (check tooltips)") + .addInfo("One Operation takes 1 hour") + .addSeparator() + .beginStructureBlock(11, 12, 11, true) + .addController("Front bottom center") + .addCasingInfo("Radiation Proof Casings", 0) + .addStructureInfo("Corners and the 2 touching blocks are air (cylindric)") + .addInputBus("Any top layer casing", 2) + .addInputHatch("Any top layer casing", 2) + .addOutputBus("Any bottom layer casing", 1) + .addOutputHatch("Any bottom layer casing", 1) + .addMaintenanceHatch("Any bottom layer casing", 1) + .toolTipFinisher("Bartworks"); + return tt; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece("main", stackSize, hintsOnly, 5, 11, 0); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + return ( + checkPiece("main", 5, 11, 0) && + this.mMaintenanceHatches.size() == 1 && + this.mInputHatches.size() > 0 && + this.mOutputHatches.size() > 0 && + this.mInputBusses.size() > 0 && + this.mOutputBusses.size() > 0 + ); + } + @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); @@ -247,49 +330,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_MultiBlockBase { return true; } - @Override - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - byte xz = 5; - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * xz; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * xz; - for (int x = -xz; x <= xz; x++) { - for (int z = -xz; z <= xz; z++) { - for (int y = 0; y < 12; y++) { - if (x + xDir == 0 && y == 0 && z + zDir == 0) - continue; - int ax = Math.abs(x), az = Math.abs(z); - if ( - (ax < 4 && az == 5) || // X WALLS - (az < 4 && ax == 5) || // Z WALLS - (ax == 4 && az == 4) || // CORNER WALLS - ((y == 0 || y == 11) && (!(ax >= 4 && az == 5) && !(az >= 4 && ax == 5))) // FLOOR & CEILING - ) { - if (!(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 12)) { - IGregTechTileEntity tEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z); - if ( - !(y == 11 && this.addInputToMachineList(tEntity, GT_TileEntity_HTGR.BASECASINGINDEX)) && - !(y == 0 && this.addOutputToMachineList(tEntity, GT_TileEntity_HTGR.BASECASINGINDEX)) && - !this.addMaintenanceToMachineList(tEntity, GT_TileEntity_HTGR.BASECASINGINDEX) - ) { - return false; - } - } - } - else if(!(ax >= 4 && az == 5) && !(az >= 4 && ax == 5)){ // inside - if(!aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z)) - return false; - } - } - } - } - return ( - this.mMaintenanceHatches.size() == 1 && - this.mInputHatches.size() > 0 && - this.mOutputHatches.size() > 0 && - this.mInputBusses.size() > 0 && - this.mOutputBusses.size() > 0 - ); - } + @Override public int getMaxEfficiency(ItemStack itemStack) { @@ -330,11 +371,6 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_MultiBlockBase { }; } - @Override - public String[] getDescription() { - return BW_Tooltip_Reference.getTranslatedBrandedTooltip("tooltip.tile.htgr.0.name"); - } - @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).glow().build()))} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX)}; diff --git a/src/main/resources/assets/bartworks/lang/de_DE.lang b/src/main/resources/assets/bartworks/lang/de_DE.lang index b9c756e863..98a94abc98 100644 --- a/src/main/resources/assets/bartworks/lang/de_DE.lang +++ b/src/main/resources/assets/bartworks/lang/de_DE.lang @@ -106,7 +106,6 @@ tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4 tooltip.tile.diode.0.name=A Simple diode that will allow Energy Flow in only one direction. tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so! tooltip.tile.energydistributor.0.name=Splits Amperage into several Sides. -#tooltip.tile.htgr.0.name=Controller Block für den Thorium Hoch Temperatur Reaktor;Größe(BxHxL): 11x12x11 (Innen Leer);Controller: Vorne Mitte, Unterste Schicht;Ecken und die 2 beührenden Blöcke sind Luft (Zylinder);Once build, Helium is inserted into the Fluid Input Hatch until it doesnt accept any more;1+ Output Hatch (Any Bottom casing);1+ Input Hatch (Any Top casing);1+ Input Bus (Any Top casing);1x Maintenance Hatch (Any casing);Raidation Proof Casings for the Rest;Needs a constant supply of coolant while running, will output after complete Operation;Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles);Consumes 1 Fuel Pellet per Operation;TRISO pebbles provide 30% more Energy;Each pebble increases the amount of converted coolant;One Operation takes 27 Ingame Days tooltip.tile.lesu.0.name=Controller Block for the GT2-Styled L.E.S.U.;Size: ANY tooltip.tile.lesu.1.name=Storage per LESU Casing: tooltip.tile.lesu.2.name=Output EU: LESU Casings amount;Input EU: Next Voltage Tier to Output EU;Input/Output Amps can be configured via 4 Circuits in GUI;Output Side has a dot on it. diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 77f6189cf2..984477d20f 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -144,8 +144,6 @@ tile.radiohatch.name=Radio Hatch tile.bw.windmill.name=Windmill tile.manutrafo.name=Manual Trafo -tooltip.tile.htgr.0.name=Controller Block for the High Temperature Gas-cooled Reactor;Size(WxHxD): 11x12x11 (Hollow);Controller: Front Center, Lowest Layer;Corners and the 2 touching blocks are air (cylindric);Once built, Helium is inserted into the Fluid Input Hatch until it doesn't accept any more (730000L);1+ Output Bus (Any Bottom casing);1+ Output Hatch (Any Bottom casing);1+ Input Bus (Any Top casing);1+ Input Hatch (Any Top casing);1x Maintenance Hatch (Any casing);Radiation Proof Casings for the Rest;Needs a constant supply of coolant while running;Needs at least 72k Fuel pebbles to start operation (can hold up to 720k pebbles);Consumes up to 0.5% of total Fuel Pellets per Operation depending on efficiency;Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer;Reactor will take 4 000L/s of coolant multiplied by efficiency and by fuel coolant value (check tooltips);One Operation takes 1 hour - itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so! diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index c0bb7e4722..f4a1fa6e64 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -144,8 +144,6 @@ tile.radiohatch.name=放射仓 tile.bw.windmill.name=风车 tile.manutrafo.name=手动变压器 -#tooltip.tile.htgr.0.name=高温钍反应堆的控制器方块;大小(宽x高x长):11x12x11 (中空);控制器:正面中心,最低一层;角落和两个相邻的方块是空气;:一旦搭建完成,需要在输入仓中输入氦气直到不再接受;1+输出仓(任意底部机械方块);1+输入仓(任意顶部机械方块);1+输入总线(任意顶部机械方块);1x维护仓(任意机械方块);其余的为辐射防护机械方块;在运行时需要持续供应冷却液,完成工作后输出;需要至少100k卵石燃料才能开始工作(最多可使用675k个卵石);每次操作消耗1个燃料颗粒;TRISO卵石将提供30%的额外能量;每个卵石都会增加转换冷却剂的需求数量;一次工作耗时27个游戏日 - itemGroup.bartworksMetaMaterials=BartWorks-meta材料 tooltip.tile.eic.0.name=电气聚爆压缩机的控制器方块;大小(宽x高x长):3x9x3;使用电而不是爆炸物工作;控制器在第三层正面中心;第一到第九层为坚硬钢机械方块,每层中间为能量仓;第2,3,7,8层:中心为镍锌铁氧体方块,其余的为变压器线圈块;第4,5,6层为中子块;1+输入总线,1+输出总线,1个维护仓于坚硬钢机械方块;在操作过程中,请勿遮挡或挖掘移动方块,这会上演爆炸的艺术!! -- cgit From be6e3082b09938f3368b5878b118269948185732 Mon Sep 17 00:00:00 2001 From: GlodBlock <60341015+GlodBlock@users.noreply.github.com> Date: Sun, 29 Aug 2021 23:09:52 +0800 Subject: fix osmiridium dupe Former-commit-id: 066afd9389789638865f764545d5fcbb23e8bf3b --- .../bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java index dc1d1f7ade..bd2b9ef336 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -178,6 +178,7 @@ public class LuVTierEnhancer implements Runnable { Consumer replace = gt_recipe -> gt_recipe.mInputs = replaceArrayWith( gt_recipe.mInputs, + gt_recipe.mOutputs, Materials.Osmiridium, WerkstoffLoader.Ruridit ); @@ -187,6 +188,7 @@ public class LuVTierEnhancer implements Runnable { .forEach(recipe_assemblyLine -> recipe_assemblyLine.mInputs = replaceArrayWith( recipe_assemblyLine.mInputs, + new ItemStack[]{recipe_assemblyLine.mOutput}, Materials.Osmiridium, WerkstoffLoader.Ruridit ) @@ -204,7 +206,11 @@ public class LuVTierEnhancer implements Runnable { .forEach(replace); } - private static ItemStack[] replaceArrayWith(ItemStack[] stackArray, Materials source, Werkstoff target) { + private static ItemStack[] replaceArrayWith(ItemStack[] stackArray, ItemStack[] outputArray, Materials source, Werkstoff target) { + for (ItemStack output : outputArray) { + if (output.isItemEqual(ItemList.Casing_MiningOsmiridium.get(1))) + return stackArray; + } for (int i = 0; i < stackArray.length; i++) { ItemStack stack = stackArray[i]; if (!BW_Util.checkStackAndPrefix(stack)) -- cgit From 5eacd3797fea13f30394b5ff68961c3419a496e6 Mon Sep 17 00:00:00 2001 From: GlodBlock <60341015+GlodBlock@users.noreply.github.com> Date: Sun, 29 Aug 2021 23:24:08 +0800 Subject: remove the deprecated mega PA Former-commit-id: 23e597894b42390f1ab7cef33704729e41b33a74 --- .../mega/GT_TileEntity_MegaProcessingArray.java | 203 --------------------- 1 file changed, 203 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java deleted file mode 100644 index cd630ef2c3..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; - -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import gregtech.GT_Mod; -import gregtech.api.enums.GT_Values; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ProcessingArray; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -import org.apache.commons.lang3.ArrayUtils; - -import java.util.ArrayList; -import java.util.List; - -import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.isValidForLowGravity; -@SuppressWarnings("ALL") -public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_ProcessingArray { - private GT_Recipe mLastRecipe; - private int tTier; - private int mMult; - private String mMachine = ""; - private GT_MetaTileEntity_Hatch_InputBus machineBus; - public GT_TileEntity_MegaProcessingArray(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public GT_TileEntity_MegaProcessingArray(String aName) { - super(aName); - } - - public boolean checkRecipe(ItemStack aStack) { - if (!this.isCorrectMachinePart(this.machineBus.mInventory[0])) { - return false; - } - - GT_Recipe.GT_Recipe_Map map = this.getRecipeMap(); - if (map == null) return false; - ArrayList tInputList = this.getStoredInputs(); - - if (this.mInventory[1].getUnlocalizedName().endsWith("10")) { - this.tTier = 9; - this.mMult = 2;//u need 4x less machines and they will use 4x less power - } else if (this.mInventory[1].getUnlocalizedName().endsWith("11")) { - this.tTier = 9; - this.mMult = 4;//u need 16x less machines and they will use 16x less power - } else if (this.mInventory[1].getUnlocalizedName().endsWith("12") || - this.mInventory[1].getUnlocalizedName().endsWith("13") || - this.mInventory[1].getUnlocalizedName().endsWith("14") || - this.mInventory[1].getUnlocalizedName().endsWith("15")) { - this.tTier = 9; - this.mMult = 6;//u need 64x less machines and they will use 64x less power - } else if (this.mInventory[1].getUnlocalizedName().endsWith("1")) { - this.tTier = 1; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("2")) { - this.tTier = 2; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("3")) { - this.tTier = 3; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("4")) { - this.tTier = 4; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("5")) { - this.tTier = 5; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("6")) { - this.tTier = 6; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("7")) { - this.tTier = 7; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("8")) { - this.tTier = 8; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("9")) { - this.tTier = 9; - this.mMult = 0;//*1 - } else { - this.tTier = 0; - this.mMult = 0;//*1 - } - - if (!this.mMachine.equals(this.mInventory[1].getUnlocalizedName())) this.mLastRecipe = null; - this.mMachine = this.mInventory[1].getUnlocalizedName(); - ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); - - ArrayList tFluidList = this.getStoredFluids(); - - FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); - if (tInputList.size() > 0 || tFluids.length > 0) { - GT_Recipe tRecipe = map.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, gregtech.api.enums.GT_Values.V[this.tTier], tFluids, tInputs); - if (tRecipe != null) { - if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 && - !isValidForLowGravity(tRecipe, this.getBaseMetaTileEntity().getWorld().provider.dimensionId)) - return false; - - this.mLastRecipe = tRecipe; - this.mEUt = 0; - this.mOutputItems = null; - this.mOutputFluids = null; - int machines = Math.min(64, this.mInventory[1].stackSize << this.mMult); //Upped max Cap to 64 - int i = 0; - for (; i < machines; i++) { - if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { - if (i == 0) { - return false; - } - break; - } - } - this.mMaxProgresstime = tRecipe.mDuration; - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - BW_Util.calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, map.mAmperage, GT_Values.V[this.tTier], this); - //In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) - return false; - this.mEUt = GT_Utility.safeInt(((long) this.mEUt * i) >> this.mMult, 1); - if (this.mEUt == Integer.MAX_VALUE - 1) - return false; - - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length]; - for (int h = 0; h < tRecipe.mOutputs.length; h++) { - if (tRecipe.getOutput(h) != null) { - tOut[h] = tRecipe.getOutput(h).copy(); - tOut[h].stackSize = 0; - } - } - FluidStack tFOut = null; - if (tRecipe.getFluidOutput(0) != null) tFOut = tRecipe.getFluidOutput(0).copy(); - for (int f = 0; f < tOut.length; f++) { - if (tRecipe.mOutputs[f] != null && tOut[f] != null) { - for (int g = 0; g < i; g++) { - if (this.getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) - tOut[f].stackSize += tRecipe.mOutputs[f].stackSize; - } - } - } - if (tFOut != null) { - int tSize = tFOut.amount; - tFOut.amount = tSize * i; - } - tOut = GT_MetaTileEntity_ProcessingArray.clean(tOut); - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - List overStacks = new ArrayList<>(); - for (ItemStack itemStack : tOut) { - while (itemStack.getMaxStackSize() < itemStack.stackSize) { - ItemStack tmp = itemStack.copy(); - tmp.stackSize = tmp.getMaxStackSize(); - itemStack.stackSize = itemStack.stackSize - itemStack.getMaxStackSize(); - overStacks.add(tmp); - } - } - if (overStacks.size() > 0) { - ItemStack[] tmp = new ItemStack[overStacks.size()]; - tmp = overStacks.toArray(tmp); - tOut = ArrayUtils.addAll(tOut, tmp); - } - List tSList = new ArrayList<>(); - for (ItemStack tS : tOut) { - if (tS.stackSize > 0) tSList.add(tS); - } - tOut = tSList.toArray(new ItemStack[0]); - this.mOutputItems = tOut; - this.mOutputFluids = new FluidStack[]{tFOut}; - this.updateSlots(); - return true; - }/* else{ - ...remoteRecipeCheck() - }*/ - } - return false; - } - -} -- cgit From 167d0d6cb7e60fb45f28f16b0c6fa46f85b4ef4e Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Mon, 30 Aug 2021 11:24:34 +0200 Subject: Change recipes Add europium to casings, UV circuits in controller Former-commit-id: 297fe500731eda24cf7cb258f80621993b79bba6 --- .../github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java | 2 +- .../bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 3e716ac8bf..dbbb5f7853 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -754,7 +754,7 @@ public class RecipeLoader { "BZB", 'B', new ItemStack(GregTech_API.sBlockCasings3, 1, 12), 'R', GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), - 'Z', "circuitUltimate" + 'Z', "circuitSuperconductor" } ); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 791c0dd9f0..b696360208 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -518,7 +518,8 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase 10000, BW_Util.getMachineVoltageFromTier(4)); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ GT_OreDictUnificator.get(OrePrefixes.plateDense,Materials.Lead,6), - GT_OreDictUnificator.get(OrePrefixes.frameGt,Materials.TungstenSteel,1) + GT_OreDictUnificator.get(OrePrefixes.frameGt,Materials.TungstenSteel,1), + GT_OreDictUnificator.get(OrePrefixes.screw,Materials.Europium,24) }, Materials.Concrete.getMolten(1296), new ItemStack(GregTech_API.sBlockCasings3,1,12), -- cgit From 9a53b9f244a4d1f7d33186f94fec59b9b2957fcd Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Thu, 2 Sep 2021 00:10:01 +0200 Subject: Machine type changed To make clear this is not for POWAH Former-commit-id: b23f08b90802d1eadcb8082e0ad37848478a8e0e --- .../bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index b696360208..33ddf9ed7f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -124,7 +124,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("High Temperature Reactor") + tt.addMachineType("Breeder Reactor") .addInfo("Controller block for the High Temperature Gas-cooled Reactor (HTGR)") .addInfo("Needs a constant supply of coolant while running") .addInfo("Needs at least 72k Fuel pebbles to start operation (can hold up to 720k pebbles)") -- cgit From 6d4ce1ba3c51e95dea2aad6bbee0a57032a585c3 Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Thu, 2 Sep 2021 00:28:31 +0200 Subject: Change recipes to avoid small piles Former-commit-id: 9b891ff53ba9eb661056c0d3e999bcf690098851 --- .../tileentities/multis/GT_TileEntity_HTGR.java | 26 ++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 33ddf9ed7f..95df799c0b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -467,20 +467,20 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase static final Fuel_[] sHTGR_Fuel = new Fuel_[]{ new Fuel_("Thorium", "Thorium", WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 64), Materials.Uranium235.getDust(4), GT_Values.NF, new ItemStack[]{ - Materials.Silicon.getDustSmall(1), Materials.Graphite.getDustSmall(1), Materials.Carbon.getDustSmall(1), - Materials.Lutetium.getDustSmall(1), WerkstoffLoader.Thorium232.get(OrePrefixes.dustSmall,1)}, + Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), + Materials.Lutetium.getDust(1), WerkstoffLoader.Thorium232.get(OrePrefixes.dust,1)}, new int[]{9000, 9000, 9000, 9000, 1000}, "Multiplies coolant by 1"), - new Fuel_("Uranium", "Uranium", Materials.Uranium.getDust(60), Materials.Uranium235.getDust(8), - FluidRegistry.getFluidStack("krypton", 7), new ItemStack[]{ - Materials.Silicon.getDustSmall(1), Materials.Graphite.getDustSmall(1), Materials.Carbon.getDustSmall(1), - Materials.Lead.getDustSmall(1), - Materials.Uranium.getDustSmall(1)}, - new int[]{9000, 9000, 9000, 6562, 937}, "Multiplies coolant by 1.5"), + new Fuel_("Uranium", "Uranium", Materials.Uranium.getDust(64), Materials.Uranium235.getDust(8), + FluidRegistry.getFluidStack("krypton", 8), new ItemStack[]{ + Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), + Materials.Lead.getDust(1), + Materials.Uranium.getDust(1)}, + new int[]{9000, 9000, 9000, 7000, 1000}, "Multiplies coolant by 1.5"), new Fuel_("Plutonium", "Plutonium", Materials.Plutonium.getDust(64), Materials.Plutonium241.getDust(4), FluidRegistry.getFluidStack("xenon", 8), new ItemStack[]{ - Materials.Silicon.getDustSmall(1), Materials.Graphite.getDustSmall(1), Materials.Carbon.getDustSmall(1), - Materials.Lead.getDustSmall(1), - Materials.Plutonium.getDustSmall(1)}, + Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), + Materials.Lead.getDust(1), + Materials.Plutonium.getDust(1)}, new int[]{9000, 9000, 9000, 7000, 1000}, "Multiplies coolant by 2"), }; static final CustomHTGRSimpleSubItemClass aHTGR_Materials; @@ -532,9 +532,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i), Materials.Carbon.getDust(64),new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1),40,30); GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), Materials.Silicon.getDust(64),new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2),40,30); GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3),40,30); - ItemStack[] pellets = new ItemStack[4]; - Arrays.fill(pellets,new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false, new ItemStack[]{new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), GT_Utility.getIntegratedCircuit(17)}, pellets, null, null, null, null, 32000, 30, 0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false, new ItemStack[]{new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4)}, null, null, null, null, 32000, 30, 0); GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false, new ItemStack[]{new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5), GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 6)}, null, null, null, null,48000,30,0); GT_Values.RA.addCentrifugeRecipe( new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 6), GT_Values.NI, GT_Values.NF, -- cgit From eb70ecfef30e18cafd6aca4dfad8b15f1cab6932 Mon Sep 17 00:00:00 2001 From: GlodBlock <1356392126@qq.com> Date: Thu, 2 Sep 2021 10:03:42 +0800 Subject: add an option to add integrated circuit to auto generated mix recipes. currently all auto generated mix recipes don't use the circuit, there is going be tons of recipe conflict when bw alloy become more. Former-commit-id: 2b806369abc68220c6ee8c004829e450bbe2d954 --- .../mega/GT_TileEntity_MegaProcessingArray.java | 203 --------------------- .../bartworks/system/material/Werkstoff.java | 12 ++ .../werkstoff_loaders/recipe/DustLoader.java | 3 + 3 files changed, 15 insertions(+), 203 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java deleted file mode 100644 index cd630ef2c3..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; - -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import gregtech.GT_Mod; -import gregtech.api.enums.GT_Values; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ProcessingArray; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -import org.apache.commons.lang3.ArrayUtils; - -import java.util.ArrayList; -import java.util.List; - -import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.isValidForLowGravity; -@SuppressWarnings("ALL") -public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_ProcessingArray { - private GT_Recipe mLastRecipe; - private int tTier; - private int mMult; - private String mMachine = ""; - private GT_MetaTileEntity_Hatch_InputBus machineBus; - public GT_TileEntity_MegaProcessingArray(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public GT_TileEntity_MegaProcessingArray(String aName) { - super(aName); - } - - public boolean checkRecipe(ItemStack aStack) { - if (!this.isCorrectMachinePart(this.machineBus.mInventory[0])) { - return false; - } - - GT_Recipe.GT_Recipe_Map map = this.getRecipeMap(); - if (map == null) return false; - ArrayList tInputList = this.getStoredInputs(); - - if (this.mInventory[1].getUnlocalizedName().endsWith("10")) { - this.tTier = 9; - this.mMult = 2;//u need 4x less machines and they will use 4x less power - } else if (this.mInventory[1].getUnlocalizedName().endsWith("11")) { - this.tTier = 9; - this.mMult = 4;//u need 16x less machines and they will use 16x less power - } else if (this.mInventory[1].getUnlocalizedName().endsWith("12") || - this.mInventory[1].getUnlocalizedName().endsWith("13") || - this.mInventory[1].getUnlocalizedName().endsWith("14") || - this.mInventory[1].getUnlocalizedName().endsWith("15")) { - this.tTier = 9; - this.mMult = 6;//u need 64x less machines and they will use 64x less power - } else if (this.mInventory[1].getUnlocalizedName().endsWith("1")) { - this.tTier = 1; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("2")) { - this.tTier = 2; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("3")) { - this.tTier = 3; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("4")) { - this.tTier = 4; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("5")) { - this.tTier = 5; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("6")) { - this.tTier = 6; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("7")) { - this.tTier = 7; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("8")) { - this.tTier = 8; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("9")) { - this.tTier = 9; - this.mMult = 0;//*1 - } else { - this.tTier = 0; - this.mMult = 0;//*1 - } - - if (!this.mMachine.equals(this.mInventory[1].getUnlocalizedName())) this.mLastRecipe = null; - this.mMachine = this.mInventory[1].getUnlocalizedName(); - ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); - - ArrayList tFluidList = this.getStoredFluids(); - - FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); - if (tInputList.size() > 0 || tFluids.length > 0) { - GT_Recipe tRecipe = map.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, gregtech.api.enums.GT_Values.V[this.tTier], tFluids, tInputs); - if (tRecipe != null) { - if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 && - !isValidForLowGravity(tRecipe, this.getBaseMetaTileEntity().getWorld().provider.dimensionId)) - return false; - - this.mLastRecipe = tRecipe; - this.mEUt = 0; - this.mOutputItems = null; - this.mOutputFluids = null; - int machines = Math.min(64, this.mInventory[1].stackSize << this.mMult); //Upped max Cap to 64 - int i = 0; - for (; i < machines; i++) { - if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { - if (i == 0) { - return false; - } - break; - } - } - this.mMaxProgresstime = tRecipe.mDuration; - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - BW_Util.calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, map.mAmperage, GT_Values.V[this.tTier], this); - //In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) - return false; - this.mEUt = GT_Utility.safeInt(((long) this.mEUt * i) >> this.mMult, 1); - if (this.mEUt == Integer.MAX_VALUE - 1) - return false; - - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length]; - for (int h = 0; h < tRecipe.mOutputs.length; h++) { - if (tRecipe.getOutput(h) != null) { - tOut[h] = tRecipe.getOutput(h).copy(); - tOut[h].stackSize = 0; - } - } - FluidStack tFOut = null; - if (tRecipe.getFluidOutput(0) != null) tFOut = tRecipe.getFluidOutput(0).copy(); - for (int f = 0; f < tOut.length; f++) { - if (tRecipe.mOutputs[f] != null && tOut[f] != null) { - for (int g = 0; g < i; g++) { - if (this.getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) - tOut[f].stackSize += tRecipe.mOutputs[f].stackSize; - } - } - } - if (tFOut != null) { - int tSize = tFOut.amount; - tFOut.amount = tSize * i; - } - tOut = GT_MetaTileEntity_ProcessingArray.clean(tOut); - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - List overStacks = new ArrayList<>(); - for (ItemStack itemStack : tOut) { - while (itemStack.getMaxStackSize() < itemStack.stackSize) { - ItemStack tmp = itemStack.copy(); - tmp.stackSize = tmp.getMaxStackSize(); - itemStack.stackSize = itemStack.stackSize - itemStack.getMaxStackSize(); - overStacks.add(tmp); - } - } - if (overStacks.size() > 0) { - ItemStack[] tmp = new ItemStack[overStacks.size()]; - tmp = overStacks.toArray(tmp); - tOut = ArrayUtils.addAll(tOut, tmp); - } - List tSList = new ArrayList<>(); - for (ItemStack tS : tOut) { - if (tS.stackSize > 0) tSList.add(tS); - } - tOut = tSList.toArray(new ItemStack[0]); - this.mOutputItems = tOut; - this.mOutputFluids = new FluidStack[]{tFOut}; - this.updateSlots(); - return true; - }/* else{ - ...remoteRecipeCheck() - }*/ - } - return false; - } - -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 16cbee2d2f..107dec62c6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -386,6 +386,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.mID; } + public short getMixCircuit() { + return this.getGenerationFeatures().mixCircuit; + } + public Werkstoff.GenerationFeatures getGenerationFeatures() { return this.generationFeatures; } @@ -609,6 +613,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { * Auto add MetalWorking(crafting components) Recipe 10000 */ public byte extraRecipes; + public short mixCircuit = -1; public Werkstoff.GenerationFeatures setBlacklist(OrePrefixes p) { this.blacklist |= getPrefixDataRaw(p); @@ -670,6 +675,13 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } + public Werkstoff.GenerationFeatures addMixerRecipes(short aCircuit) { + this.extraRecipes = (byte) (this.extraRecipes | 10); + if (aCircuit >= 1 && aCircuit <=24) + this.mixCircuit = aCircuit; + return this; + } + public boolean hasMixerRecipes() { return (this.extraRecipes & 10) != 0; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java index 8f79fc85bc..b8b1d7a75e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java @@ -148,6 +148,9 @@ public class DustLoader implements IWerkstoffRunnable { if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); + short circuitID = werkstoff.getMixCircuit(); + ItemStack circuit = circuitID == -1 ? null : GT_Utility.getIntegratedCircuit(circuitID); + if (circuit != null) stOutputs.add(circuit); GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().getMass() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); } } -- cgit From c7cd34d877915954a3b9477aecd46da102152a77 Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Sat, 4 Sep 2021 12:27:18 -0700 Subject: Fix Master and remove Mega PA (Unused, deprecated, and broken due to upstream changes) Former-commit-id: b6d0974c12a8b8f37d00a8bc043bc771e9c81f23 --- .../mega/GT_TileEntity_MegaProcessingArray.java | 203 --------------------- 1 file changed, 203 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java deleted file mode 100644 index cd630ef2c3..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; - -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import gregtech.GT_Mod; -import gregtech.api.enums.GT_Values; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ProcessingArray; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -import org.apache.commons.lang3.ArrayUtils; - -import java.util.ArrayList; -import java.util.List; - -import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.isValidForLowGravity; -@SuppressWarnings("ALL") -public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_ProcessingArray { - private GT_Recipe mLastRecipe; - private int tTier; - private int mMult; - private String mMachine = ""; - private GT_MetaTileEntity_Hatch_InputBus machineBus; - public GT_TileEntity_MegaProcessingArray(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public GT_TileEntity_MegaProcessingArray(String aName) { - super(aName); - } - - public boolean checkRecipe(ItemStack aStack) { - if (!this.isCorrectMachinePart(this.machineBus.mInventory[0])) { - return false; - } - - GT_Recipe.GT_Recipe_Map map = this.getRecipeMap(); - if (map == null) return false; - ArrayList tInputList = this.getStoredInputs(); - - if (this.mInventory[1].getUnlocalizedName().endsWith("10")) { - this.tTier = 9; - this.mMult = 2;//u need 4x less machines and they will use 4x less power - } else if (this.mInventory[1].getUnlocalizedName().endsWith("11")) { - this.tTier = 9; - this.mMult = 4;//u need 16x less machines and they will use 16x less power - } else if (this.mInventory[1].getUnlocalizedName().endsWith("12") || - this.mInventory[1].getUnlocalizedName().endsWith("13") || - this.mInventory[1].getUnlocalizedName().endsWith("14") || - this.mInventory[1].getUnlocalizedName().endsWith("15")) { - this.tTier = 9; - this.mMult = 6;//u need 64x less machines and they will use 64x less power - } else if (this.mInventory[1].getUnlocalizedName().endsWith("1")) { - this.tTier = 1; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("2")) { - this.tTier = 2; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("3")) { - this.tTier = 3; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("4")) { - this.tTier = 4; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("5")) { - this.tTier = 5; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("6")) { - this.tTier = 6; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("7")) { - this.tTier = 7; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("8")) { - this.tTier = 8; - this.mMult = 0;//*1 - } else if (this.mInventory[1].getUnlocalizedName().endsWith("9")) { - this.tTier = 9; - this.mMult = 0;//*1 - } else { - this.tTier = 0; - this.mMult = 0;//*1 - } - - if (!this.mMachine.equals(this.mInventory[1].getUnlocalizedName())) this.mLastRecipe = null; - this.mMachine = this.mInventory[1].getUnlocalizedName(); - ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); - - ArrayList tFluidList = this.getStoredFluids(); - - FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); - if (tInputList.size() > 0 || tFluids.length > 0) { - GT_Recipe tRecipe = map.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, gregtech.api.enums.GT_Values.V[this.tTier], tFluids, tInputs); - if (tRecipe != null) { - if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 && - !isValidForLowGravity(tRecipe, this.getBaseMetaTileEntity().getWorld().provider.dimensionId)) - return false; - - this.mLastRecipe = tRecipe; - this.mEUt = 0; - this.mOutputItems = null; - this.mOutputFluids = null; - int machines = Math.min(64, this.mInventory[1].stackSize << this.mMult); //Upped max Cap to 64 - int i = 0; - for (; i < machines; i++) { - if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { - if (i == 0) { - return false; - } - break; - } - } - this.mMaxProgresstime = tRecipe.mDuration; - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - BW_Util.calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, map.mAmperage, GT_Values.V[this.tTier], this); - //In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) - return false; - this.mEUt = GT_Utility.safeInt(((long) this.mEUt * i) >> this.mMult, 1); - if (this.mEUt == Integer.MAX_VALUE - 1) - return false; - - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length]; - for (int h = 0; h < tRecipe.mOutputs.length; h++) { - if (tRecipe.getOutput(h) != null) { - tOut[h] = tRecipe.getOutput(h).copy(); - tOut[h].stackSize = 0; - } - } - FluidStack tFOut = null; - if (tRecipe.getFluidOutput(0) != null) tFOut = tRecipe.getFluidOutput(0).copy(); - for (int f = 0; f < tOut.length; f++) { - if (tRecipe.mOutputs[f] != null && tOut[f] != null) { - for (int g = 0; g < i; g++) { - if (this.getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) - tOut[f].stackSize += tRecipe.mOutputs[f].stackSize; - } - } - } - if (tFOut != null) { - int tSize = tFOut.amount; - tFOut.amount = tSize * i; - } - tOut = GT_MetaTileEntity_ProcessingArray.clean(tOut); - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - List overStacks = new ArrayList<>(); - for (ItemStack itemStack : tOut) { - while (itemStack.getMaxStackSize() < itemStack.stackSize) { - ItemStack tmp = itemStack.copy(); - tmp.stackSize = tmp.getMaxStackSize(); - itemStack.stackSize = itemStack.stackSize - itemStack.getMaxStackSize(); - overStacks.add(tmp); - } - } - if (overStacks.size() > 0) { - ItemStack[] tmp = new ItemStack[overStacks.size()]; - tmp = overStacks.toArray(tmp); - tOut = ArrayUtils.addAll(tOut, tmp); - } - List tSList = new ArrayList<>(); - for (ItemStack tS : tOut) { - if (tS.stackSize > 0) tSList.add(tS); - } - tOut = tSList.toArray(new ItemStack[0]); - this.mOutputItems = tOut; - this.mOutputFluids = new FluidStack[]{tFOut}; - this.updateSlots(); - return true; - }/* else{ - ...remoteRecipeCheck() - }*/ - } - return false; - } - -} -- cgit From 8b0125b3f625e961a4773417cca9ddf41eb8a1da Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Sun, 5 Sep 2021 02:16:44 +0200 Subject: Bring back THTR Multiple changes to both reactors Former-commit-id: 7c3887a984a35787aa19cf809b9b02cd1aac3982 --- .../bartworks/common/loaders/ItemRegistry.java | 6 +- .../bartworks/common/loaders/RecipeLoader.java | 16 +- .../tileentities/multis/GT_TileEntity_HTGR.java | 81 ++-- .../tileentities/multis/GT_TileEntity_THTR.java | 417 +++++++++++++++++++++ .../resources/assets/bartworks/lang/en_US.lang | 8 + .../bartworks/textures/items/BISOPelletBall.png | Bin 0 -> 305 bytes .../textures/items/BISOPelletCompound.png | Bin 0 -> 269 bytes .../textures/items/BurnedOutTRISOPellet.png | Bin 0 -> 258 bytes .../textures/items/BurnedOutTRISOPelletBall.png | Bin 0 -> 291 bytes .../bartworks/textures/items/TRISOPellet.png | Bin 0 -> 257 bytes .../bartworks/textures/items/TRISOPelletBall.png | Bin 0 -> 305 bytes .../textures/items/TRISOPelletCompound.png | Bin 0 -> 244 bytes 12 files changed, 497 insertions(+), 31 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java create mode 100644 src/main/resources/assets/bartworks/textures/items/BISOPelletBall.png create mode 100644 src/main/resources/assets/bartworks/textures/items/BISOPelletCompound.png create mode 100644 src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPellet.png create mode 100644 src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPelletBall.png create mode 100644 src/main/resources/assets/bartworks/textures/items/TRISOPellet.png create mode 100644 src/main/resources/assets/bartworks/textures/items/TRISOPelletBall.png create mode 100644 src/main/resources/assets/bartworks/textures/items/TRISOPelletCompound.png diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index d277862e9a..fbb2f6320b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -37,6 +37,7 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.debug.CreativeScan import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_CircuitAssemblyLine; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_DEHP; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaBlastFurnace; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaDistillTower; @@ -143,6 +144,7 @@ public class ItemRegistry { public static ItemStack[] megaMachines = new ItemStack[3]; public static ItemStack dehp; public static ItemStack[] voidminer = new ItemStack[3]; + public static ItemStack THTR; public static ItemStack HTGR; public static ItemStack eic; public static ItemStack cal; @@ -185,7 +187,9 @@ public class ItemRegistry { if (ConfigHandler.creativeScannerID != 0) new CreativeScanner(ConfigHandler.creativeScannerID,"Creative Debug Scanner","Creative Debug Scanner",20); ItemRegistry.eic = new GT_TileEntity_ElectricImplosionCompressor(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, "ElectricImplosionCompressor", "Electric Implosion Compressor").getStackForm(1L); - ItemRegistry.HTGR = new GT_TileEntity_HTGR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, "HTGR", "High Temperature Gas-cooled Reactor").getStackForm(1L); + ItemRegistry.THTR = new GT_TileEntity_THTR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, "THTR", "Thorium High Temperature Reactor").getStackForm(1L); + GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials(); + ItemRegistry.HTGR = new GT_TileEntity_HTGR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 48, "HTGR", "High Temperature Gas-cooled Reactor").getStackForm(1L); GT_TileEntity_HTGR.HTGRMaterials.registeraTHR_Materials(); GT_OreDictUnificator.add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(ItemRegistry.BW_BLOCKS[2])); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index dbbb5f7853..ac747e00b0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_LESU; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_Windmill; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -744,6 +745,19 @@ public class RecipeLoader { 'G', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), } ); + GT_TileEntity_THTR.THTRMaterials.registerTHR_Recipes(); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.THTR, + RecipeLoader.BITSD, + new Object[]{ + "BZB", + "BRB", + "BZB", + 'B', new ItemStack(GregTech_API.sBlockCasings3, 1, 12), + 'R', GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), + 'Z', "circuitUltimate" + } + ); GT_TileEntity_HTGR.HTGRMaterials.registerTHR_Recipes(); GT_ModHandler.addCraftingRecipe( ItemRegistry.HTGR, @@ -752,7 +766,7 @@ public class RecipeLoader { "BZB", "BRB", "BZB", - 'B', new ItemStack(GregTech_API.sBlockCasings3, 1, 12), + 'B', new ItemStack(GregTech_API.sBlockCasings8, 1, 5), 'R', GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), 'Z', "circuitSuperconductor" } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 95df799c0b..40e2a8b878 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.StructureDefinition; @@ -69,7 +70,7 @@ import java.util.HashMap; public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase { - private static final int BASECASINGINDEX = 44; + private static final int BASECASINGINDEX = 181; private static final String STRUCTURE_PIECE_MAIN = "main"; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() @@ -87,16 +88,20 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, {" bbb~bbb "," bbbbbbbbb ","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb"," bbbbbbbbb "," bbbbbbb "}, })) - .addElement('c', ofBlock(GregTech_API.sBlockCasings3, 12)) + .addElement('c', ofBlock(GregTech_API.sBlockCasings8, 5)) .addElement('b', ofChain( ofHatchAdder(GT_TileEntity_HTGR::addOutputToMachineList, BASECASINGINDEX, 1), ofHatchAdder(GT_TileEntity_HTGR::addMaintenanceToMachineList, BASECASINGINDEX, 1), - ofBlock(GregTech_API.sBlockCasings3, 12) + ofHatchAdder(GT_TileEntity_HTGR::addEnergyInputToMachineList, BASECASINGINDEX, 1), + ofBlock(GregTech_API.sBlockCasings8, 5) )) - .addElement('B', ofHatchAdderOptional(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2, GregTech_API.sBlockCasings3, 12)) + .addElement('B', ofHatchAdderOptional(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2, GregTech_API.sBlockCasings8, 5)) .build(); private static final int HELIUM_NEEDED = 730000; + private static final int powerUsage = BW_Util.getMachineVoltageFromTier(6); + private static final int maxcapacity = 720000; + private static final int mincapacity = maxcapacity/10; private int HeliumSupply; private int fueltype = -1, fuelsupply = 0; private boolean empty; @@ -131,21 +136,28 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase .addInfo("Consumes up to 0.5% of total Fuel Pellets per Operation depending on efficiency") .addInfo("Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer") .addInfo("Reactor will take 4 000L/s of coolant multiplied by efficiency and by fuel coolant value (check tooltips)") + .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t") .addInfo("One Operation takes 1 hour") .addSeparator() .beginStructureBlock(11, 12, 11, true) .addController("Front bottom center") - .addCasingInfo("Radiation Proof Casings", 0) + .addCasingInfo("Europium Reinforced Radiation Proof Casings", 0) .addStructureInfo("Corners and the 2 touching blocks are air (cylindric)") .addInputBus("Any top layer casing", 2) .addInputHatch("Any top layer casing", 2) .addOutputBus("Any bottom layer casing", 1) .addOutputHatch("Any bottom layer casing", 1) + .addEnergyHatch("Any bottom layer casing", 1) .addMaintenanceHatch("Any bottom layer casing", 1) .toolTipFinisher("Bartworks"); return tt; } + @Override + protected IAlignmentLimits getInitialAlignmentLimits() { + return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && f.isNotFlipped(); + } + @Override public void construct(ItemStack stackSize, boolean hintsOnly) { buildPiece("main", stackSize, hintsOnly, 5, 11, 0); @@ -159,7 +171,8 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase this.mInputHatches.size() > 0 && this.mOutputHatches.size() > 0 && this.mInputBusses.size() > 0 && - this.mOutputBusses.size() > 0 + this.mOutputBusses.size() > 0 && + this.mEnergyHatches.size() > 0 ); } @@ -198,7 +211,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } } } - if(this.fuelsupply < 720000){ + if(this.fuelsupply < maxcapacity){ for (ItemStack itemStack : this.getStoredInputs()) { int type = -1; if(itemStack == null) continue; @@ -210,7 +223,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase this.fueltype = type; if(this.fueltype != type) continue; - int toget = Math.min(720000 - this.fuelsupply, itemStack.stackSize); + int toget = Math.min(maxcapacity - this.fuelsupply, itemStack.stackSize); this.fuelsupply += toget; itemStack.stackSize -= toget; } @@ -224,14 +237,17 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase if(this.empty) { - this.mEfficiency = 10000; - this.mMaxProgresstime = 100; - return true; + if(this.HeliumSupply > 0 || this.fuelsupply > 0){ + this.mEfficiency = 10000; + this.mMaxProgresstime = 100; + return true; + } + return false; } - if (!(this.HeliumSupply >= GT_TileEntity_HTGR.HELIUM_NEEDED && this.fuelsupply >= 72000)) + if (!(this.HeliumSupply >= GT_TileEntity_HTGR.HELIUM_NEEDED && this.fuelsupply >= mincapacity)) return false; - double eff = Math.min(Math.pow((double)this.fuelsupply/72000D, 2D), 100D)/100D - ((double)(getIdealStatus() - getRepairStatus()) / 10D); + double eff = Math.min(Math.pow((double)this.fuelsupply/(double)mincapacity, 2D), 100D)/100D - ((double)(getIdealStatus() - getRepairStatus()) / 10D); if(eff <= 0) return false; @@ -250,12 +266,12 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase new ItemStack(HTGRMaterials.aHTGR_Materials, toReduce, meta + 1) }; - this.updateSlots(); + //this.updateSlots(); // not needed ? this.coolanttaking = (int)(4000D * (((this.fueltype * 0.5D) + 1)) * eff); this.mEfficiency = (int)(eff*10000D); - this.mEUt=0; + this.mEUt=-powerUsage; this.mMaxProgresstime=72000; return true; } @@ -300,6 +316,9 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase return true; } + if(!super.onRunningTick(aStack)) // USE DA POWAH + return false; + if(runningtick % 20 == 0) { int takecoolant = coolanttaking; @@ -373,7 +392,18 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).glow().build()))} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX)}; + if (aSide == aFacing) { + if (aActive) + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).extFacing().glow().build()}; + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER).extFacing().build(), + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).extFacing().glow().build()}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX)}; } @Override @@ -509,22 +539,15 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } public static void registerTHR_Recipes(){ - GT_Values.RA.addCentrifugeRecipe( - Materials.Thorium.getDust(1),GT_Values.NI,GT_Values.NF,GT_Values.NF, - Materials.Thorium.getDustSmall(2),Materials.Thorium.getDustSmall(1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1),WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1),Materials.Lutetium.getDustTiny(1), - new int[]{1600,1500,200,200,50,50}, - 10000, BW_Util.getMachineVoltageFromTier(4)); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - GT_OreDictUnificator.get(OrePrefixes.plateDense,Materials.Lead,6), - GT_OreDictUnificator.get(OrePrefixes.frameGt,Materials.TungstenSteel,1), + new ItemStack(GregTech_API.sBlockCasings3,1,12), + GT_OreDictUnificator.get(OrePrefixes.plate,Materials.Europium,6), GT_OreDictUnificator.get(OrePrefixes.screw,Materials.Europium,24) }, - Materials.Concrete.getMolten(1296), - new ItemStack(GregTech_API.sBlockCasings3,1,12), - 40, - BW_Util.getMachineVoltageFromTier(5) + Materials.Lead.getMolten(1296), + new ItemStack(GregTech_API.sBlockCasings8,1,5), + 200, + BW_Util.getMachineVoltageFromTier(6) ); int i = 0; for(Fuel_ fuel : sHTGR_Fuel){ diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java new file mode 100644 index 0000000000..cb0a454dce --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -0,0 +1,417 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; + +import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.IStructureElement; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.MathUtils; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.objects.XSTR; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; + +import java.util.Arrays; + +public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase { + + private static final int BASECASINGINDEX = 44; + + private static final String STRUCTURE_PIECE_MAIN = "main"; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {" BBBBBBB "," BBBBBBBBB ","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB"," BBBBBBBBB "," BBBBBBB "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, + {" bbb~bbb "," bbbbbbbbb ","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb"," bbbbbbbbb "," bbbbbbb "}, + })) + .addElement('c', ofBlock(GregTech_API.sBlockCasings3, 12)) + .addElement('b', ofChain( + ofHatchAdder(GT_TileEntity_THTR::addOutputToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_THTR::addMaintenanceToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_THTR::addEnergyInputToMachineList, BASECASINGINDEX, 1), + ofBlock(GregTech_API.sBlockCasings3, 12) + )) + .addElement('B', ofHatchAdderOptional(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2, GregTech_API.sBlockCasings3, 12)) + .build(); + + + + + private static final int HELIUM_NEEDED = 730000; + private static final int powerUsage = BW_Util.getMachineVoltageFromTier(5)/2; + private static final int maxcapacity = 675000; + private static final int mincapacity = 100000; + private int HeliumSupply; + private int fuelsupply; + private boolean empty; + private int coolanttaking = 0; + + public GT_TileEntity_THTR(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + private GT_TileEntity_THTR(String aName) { + super(aName); + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + @Override + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("High Temperature Reactor") + .addInfo("Controller block for the Thorium High Temperature Reactor (THTR)") + .addInfo("Needs a constant supply of coolant while running") + .addInfo("Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles)") + .addInfo("Consumes up to 0.5% of total Fuel Pellets per Operation depending on efficiency") + .addInfo("Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer") + .addInfo("Reactor will take 4 800L/t of coolant multiplied by efficiency") + .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t") + .addInfo("One Operation takes 9 hour") + .addSeparator() + .beginStructureBlock(11, 12, 11, true) + .addController("Front bottom center") + .addCasingInfo("Radiation Proof Casings", 0) + .addStructureInfo("Corners and the 2 touching blocks are air (cylindric)") + .addInputBus("Any top layer casing", 2) + .addInputHatch("Any top layer casing", 2) + .addOutputBus("Any bottom layer casing", 1) + .addOutputHatch("Any bottom layer casing", 1) + .addEnergyHatch("Any bottom layer casing", 1) + .addMaintenanceHatch("Any bottom layer casing", 1) + .toolTipFinisher("Bartworks"); + return tt; + } + + @Override + protected IAlignmentLimits getInitialAlignmentLimits() { + return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && f.isNotFlipped(); + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 5, 11, 0); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + return ( + checkPiece(STRUCTURE_PIECE_MAIN, 5, 11, 0) && + this.mMaintenanceHatches.size() == 1 && + this.mInputHatches.size() > 0 && + this.mOutputHatches.size() > 0 && + this.mInputBusses.size() > 0 && + this.mOutputBusses.size() > 0 && + this.mEnergyHatches.size() > 0 + ); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + this.HeliumSupply = aNBT.getInteger("HeliumSupply"); + this.fuelsupply = aNBT.getInteger("fuelsupply"); + this.coolanttaking = aNBT.getInteger("coolanttaking"); + this.empty = aNBT.getBoolean("EmptyMode"); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setInteger("HeliumSupply", this.HeliumSupply); + aNBT.setInteger("fuelsupply", this.fuelsupply); + aNBT.setInteger("coolanttaking", this.coolanttaking); + aNBT.setBoolean("EmptyMode", this.empty); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (aBaseMetaTileEntity.isServerSide() && !this.empty){ + if (this.HeliumSupply < GT_TileEntity_THTR.HELIUM_NEEDED){ + for (FluidStack fluidStack : this.getStoredFluids()){ + if (fluidStack.isFluidEqual(Materials.Helium.getGas(1))) { + int toget = Math.min(GT_TileEntity_THTR.HELIUM_NEEDED - this.HeliumSupply, fluidStack.amount); + fluidStack.amount -= toget; + this.HeliumSupply += toget; + if(GT_TileEntity_THTR.HELIUM_NEEDED == this.HeliumSupply && fluidStack.amount == 0) + fluidStack = null; + } + } + } + if(this.fuelsupply < maxcapacity){ + for (ItemStack itemStack : this.getStoredInputs()) { + if (GT_Utility.areStacksEqual(itemStack, new ItemStack(THTRMaterials.aTHTR_Materials, 1, THTRMaterials.MATERIAL_FUEL_INDEX))) { + int toget = Math.min(maxcapacity - this.fuelsupply, itemStack.stackSize); + if(toget == 0) continue; + itemStack.stackSize -= toget; + this.fuelsupply += toget; + } + } + this.updateSlots(); + } + } + } + + @Override + public boolean checkRecipe(ItemStack controllerStack) { + + if(this.empty) + { + if(this.HeliumSupply > 0 || this.fuelsupply > 0){ + this.mEfficiency = 10000; + this.mMaxProgresstime = 100; + return true; + } + return false; + } + if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.fuelsupply >= mincapacity)) + return false; + + double eff = Math.min(Math.pow((double)(this.fuelsupply - mincapacity)/((maxcapacity-mincapacity)/10D), 2D)+1, 100D)/100D - ((double)(getIdealStatus() - getRepairStatus()) / 10D); + if(eff <= 0D) + return false; + + int toReduce = MathUtils.floorInt((double)this.fuelsupply * 0.005D * eff); + + this.fuelsupply -= toReduce; + int burnedballs = toReduce/64; + if(burnedballs > 0) + toReduce -= burnedballs*64; + + int meta = THTRMaterials.MATERIAL_USED_FUEL_INDEX; + + this.mOutputItems = new ItemStack[] { + new ItemStack(THTRMaterials.aTHTR_Materials, burnedballs, meta), + new ItemStack(THTRMaterials.aTHTR_Materials, toReduce, meta + 1) + }; + + // this.updateSlots(); not needed ? + + this.coolanttaking = (int)(4800D * eff); + this.mEfficiency = (int)(eff*10000D); + this.mEUt=-powerUsage; + this.mMaxProgresstime=648000; + return true; + } + + @Override + public boolean onRunningTick(ItemStack aStack) { + + if (this.empty){ + this.addOutput(Materials.Helium.getGas(this.HeliumSupply)); + this.addOutput(new ItemStack(THTRMaterials.aTHTR_Materials, this.fuelsupply, THTRMaterials.MATERIAL_FUEL_INDEX)); + this.HeliumSupply = 0; + this.fuelsupply = 0; + this.updateSlots(); + return true; + } + + if(!super.onRunningTick(aStack)) + return false; + + int takecoolant = coolanttaking; + int drainedamount = 0; + + for(GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches){ + if (isValidMetaTileEntity(tHatch)) { + FluidStack tLiquid = tHatch.getFluid(); + if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))){ + FluidStack drained = tHatch.drain(takecoolant, true); + takecoolant -= drained.amount; + drainedamount += drained.amount; + if(takecoolant <= 0) + break; + } + } + } + + if(drainedamount > 0) + addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount)); + + this.updateSlots(); + + return true; + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_THTR(this.mName); + } + + + @Override + public String[] getInfoData() { + return new String[]{ + "Progress:", GT_Utility.formatNumbers(this.mProgresstime / 20) + "secs /" + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "secs", + "TRISO-Pebbles:", GT_Utility.formatNumbers(this.fuelsupply) + "pcs. / " + GT_Utility.formatNumbers(this.fuelsupply) + "psc.", + "Helium-Level:", GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + GT_Utility.formatNumbers(GT_TileEntity_THTR.HELIUM_NEEDED) + "L", + "Coolant/t:", GT_Utility.formatNumbers(this.mProgresstime == 0 ? 0 : coolanttaking) + "L/t", + "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) + }; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + if (aActive) + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).extFacing().glow().build()}; + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER).extFacing().build(), + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).extFacing().glow().build()}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX)}; + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if(this.mMaxProgresstime > 0) + { + GT_Utility.sendChatToPlayer(aPlayer, "THTR mode cannot be changed while the machine is running."); + return; + } + this.empty = !this.empty; + GT_Utility.sendChatToPlayer(aPlayer, "THTR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); + } + + public static class THTRMaterials{ + static final SimpleSubItemClass aTHTR_Materials = new SimpleSubItemClass( + "BISOPelletCompound", // 0 + "BISOPelletBall", // 1 + "TRISOPelletCompound", // 2 + "TRISOPelletBall", // 3 + "TRISOPellet", // 4 + "BurnedOutTRISOPelletBall", // 5 + "BurnedOutTRISOPellet" // 6 + ); + public static final int MATERIAL_FUEL_INDEX = 4; + public static final int MATERIAL_USED_FUEL_INDEX = 5; + public static void registeraTHR_Materials(){ + GameRegistry.registerItem(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,"bw.THTRMaterials"); + } + + public static void registerTHR_Recipes(){ + GT_Values.RA.addCentrifugeRecipe( + Materials.Thorium.getDust(1),GT_Values.NI,GT_Values.NF,GT_Values.NF, + Materials.Thorium.getDustSmall(2),Materials.Thorium.getDustSmall(1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1),WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1),GT_Values.NI, + new int[]{1600,1500,200,200,50}, + 10000, BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.plateDense,Materials.Lead,6), + GT_OreDictUnificator.get(OrePrefixes.frameGt,Materials.TungstenSteel,1) + }, + Materials.Concrete.getMolten(1296), + new ItemStack(GregTech_API.sBlockCasings3,1,12), + 40, + BW_Util.getMachineVoltageFromTier(5) + ); + GT_Values.RA.addMixerRecipe(WerkstoffLoader.Thorium232.get(OrePrefixes.dust,10),Materials.Uranium235.getDust(1),GT_Utility.getIntegratedCircuit(2),null,null,null,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials),400,30); + GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials),Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,1),40,30); + GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,1),Materials.Silicon.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,2),40,30); + GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,2),Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,3),40,30); + ItemStack[] pellets = new ItemStack[6]; + Arrays.fill(pellets,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,4)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,3),GT_Utility.getIntegratedCircuit(17)}, pellets,null,null,null,null,48000,30,0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,5),GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,6)},null,null,null,null,48000,30,0); + GT_Values.RA.addCentrifugeRecipe( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 6), GT_Values.NI, GT_Values.NF, GT_Values.NF, + Materials.Lead.getDust(1), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, + new int[]{300}, + 1200, 30); + } + + } +} diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 984477d20f..b2a671cd20 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -144,6 +144,14 @@ tile.radiohatch.name=Radio Hatch tile.bw.windmill.name=Windmill tile.manutrafo.name=Manual Trafo +item.TRISOPellet.name=TRISO pebble +item.TRISOPelletBall.name=TRISO pebble ball +item.BISOPelletBall.name=BISO pebble ball +item.TRISOPelletCompound.name=TRISO pebble compound +item.BISOPelletCompound.name=BISO pebble compound +item.BurnedOutTRISOPelletBall.name=Burned Out TRISO pebble ball +item.BurnedOutTRISOPellet.name=Burned Out TRISO pebble + itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so! diff --git a/src/main/resources/assets/bartworks/textures/items/BISOPelletBall.png b/src/main/resources/assets/bartworks/textures/items/BISOPelletBall.png new file mode 100644 index 0000000000..ea113e3f22 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/BISOPelletBall.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/BISOPelletCompound.png b/src/main/resources/assets/bartworks/textures/items/BISOPelletCompound.png new file mode 100644 index 0000000000..029d895f31 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/BISOPelletCompound.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPellet.png b/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPellet.png new file mode 100644 index 0000000000..73abda00dd Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPellet.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPelletBall.png b/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPelletBall.png new file mode 100644 index 0000000000..eb5e37eaa1 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/BurnedOutTRISOPelletBall.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/TRISOPellet.png b/src/main/resources/assets/bartworks/textures/items/TRISOPellet.png new file mode 100644 index 0000000000..26109fc979 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/TRISOPellet.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/TRISOPelletBall.png b/src/main/resources/assets/bartworks/textures/items/TRISOPelletBall.png new file mode 100644 index 0000000000..0aea0500cf Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/TRISOPelletBall.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/TRISOPelletCompound.png b/src/main/resources/assets/bartworks/textures/items/TRISOPelletCompound.png new file mode 100644 index 0000000000..6b2835d100 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/items/TRISOPelletCompound.png differ -- cgit From 75d448956cddf5503fefedc1746367c0e8036745 Mon Sep 17 00:00:00 2001 From: GlodBlock <60341015+GlodBlock@users.noreply.github.com> Date: Sun, 5 Sep 2021 15:39:10 +0800 Subject: make it not ugly Former-commit-id: cb5ef2c29ffc4966d3298b4522364c30165b5fce --- .../material/GT_Enhancement/LuVTierEnhancer.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java index bd2b9ef336..65c677dc55 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -178,7 +178,6 @@ public class LuVTierEnhancer implements Runnable { Consumer replace = gt_recipe -> gt_recipe.mInputs = replaceArrayWith( gt_recipe.mInputs, - gt_recipe.mOutputs, Materials.Osmiridium, WerkstoffLoader.Ruridit ); @@ -188,7 +187,6 @@ public class LuVTierEnhancer implements Runnable { .forEach(recipe_assemblyLine -> recipe_assemblyLine.mInputs = replaceArrayWith( recipe_assemblyLine.mInputs, - new ItemStack[]{recipe_assemblyLine.mOutput}, Materials.Osmiridium, WerkstoffLoader.Ruridit ) @@ -197,20 +195,24 @@ public class LuVTierEnhancer implements Runnable { GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList.stream() .filter(gt_recipe -> gt_recipe.mEUt < BW_Util.getTierVoltage(6) && - !BW_Util.checkStackAndPrefix(gt_recipe.mOutputs[0]) + !BW_Util.checkStackAndPrefix(gt_recipe.mOutputs[0]) && + !isOutputBlackListed(gt_recipe.mOutputs[0]) ) .forEach(replace); GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.stream() - .filter(gt_recipe -> gt_recipe.mEUt <= 6000) + .filter(gt_recipe -> gt_recipe.mEUt <= 6000 && + !isOutputBlackListed(gt_recipe.mOutputs[0]) + ) .forEach(replace); } - private static ItemStack[] replaceArrayWith(ItemStack[] stackArray, ItemStack[] outputArray, Materials source, Werkstoff target) { - for (ItemStack output : outputArray) { - if (output.isItemEqual(ItemList.Casing_MiningOsmiridium.get(1))) - return stackArray; - } + private static boolean isOutputBlackListed(ItemStack output) { + if (output.isItemEqual(ItemList.Casing_MiningOsmiridium.get(1))) return true; + return false; + } + + private static ItemStack[] replaceArrayWith(ItemStack[] stackArray, Materials source, Werkstoff target) { for (int i = 0; i < stackArray.length; i++) { ItemStack stack = stackArray[i]; if (!BW_Util.checkStackAndPrefix(stack)) -- cgit From d4be334d82116c6ba822e1ef1a66d9f000e0e2fa Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Mon, 6 Sep 2021 10:44:11 -0700 Subject: Make BW_MetaGeneratedBlocks_Casing implement ICustomBlockSetting from both TecTech (Unclear if this is still used) & structlib Former-commit-id: cccc1f30487ad3b7120f63588456c6deb6e9dd2c --- gradle.properties | 2 +- .../bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index 25515abd6a..185e03bb76 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,7 +23,7 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 majorUpdate=0 minorUpdate=5 -buildNumber=20 +buildNumber=21 apiVersion=11 ic2Version=2.2.828-experimental applecoreVersion=1.7.10-3.1.1 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java index 74a40e6a28..c892ead1d9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -22,7 +22,6 @@ package com.github.bartimaeusnek.bartworks.system.material; -import com.github.technus.tectech.mechanics.structure.ICustomBlockSetting; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -41,8 +40,9 @@ import net.minecraft.world.World; import java.util.List; import java.util.Optional; -@cpw.mods.fml.common.Optional.Interface(modid = "tectech", striprefs = true, iface = "com.github.technus.tectech.mechanics.structure.ICustomBlockSetting") -public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks implements ICustomBlockSetting { +public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks implements com.github.technus.tectech.mechanics.structure.ICustomBlockSetting, + com.gtnewhorizon.structurelib.structure.ICustomBlockSetting +{ public BW_MetaGeneratedBlocks_Casing(Material p_i45386_1_, Class tileEntity, String blockName, OrePrefixes prefixes) { super(p_i45386_1_, tileEntity, blockName, prefixes); @@ -128,9 +128,8 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple } /** - * DEBUG Method for TT-Blueprints! + * ICustomBlockSetting setBlock override */ - @cpw.mods.fml.common.Optional.Method(modid = "tectech") public void setBlock(World world, int x, int y, int z, int meta) { world.setBlock(x, y, z,this, meta,2); try { -- cgit From 44eae579f46b0f6720cfe950290e80d832458c17 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Thu, 9 Sep 2021 22:04:04 +0800 Subject: Make bridge materials properly load localizations Former-commit-id: 27b2106504524392a07b0a2ae3085124e6968324 --- .../werkstoff_loaders/registration/BridgeMaterialsLoader.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java index d3a5d79729..a76aa7545b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java @@ -100,7 +100,9 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { } werkstoffBridgeMaterial.mName = werkstoff.getVarName(); werkstoffBridgeMaterial.mDefaultLocalName = werkstoff.getDefaultName(); - werkstoffBridgeMaterial.mChemicalFormula = werkstoff.getToolTip(); + if ("null".equals(werkstoffBridgeMaterial.mLocalizedName)) + // only reload from lang file if not localized already + werkstoffBridgeMaterial.mLocalizedName = GT_LanguageManager.addStringLocalization("Material." + werkstoffBridgeMaterial.mName.toLowerCase(), werkstoffBridgeMaterial.mDefaultLocalName); if (LoaderReference.Thaumcraft) werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects(); werkstoffBridgeMaterial.mMaterialInto = werkstoffBridgeMaterial; -- cgit From 81560d793a582845bae891f54fde267e6040fed8 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Thu, 9 Sep 2021 22:11:01 +0800 Subject: Fix import Former-commit-id: 0be4a8f33bb63b498a92df124b980ce80d0b0028 --- .../material/werkstoff_loaders/registration/BridgeMaterialsLoader.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java index a76aa7545b..be6bdcc581 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java @@ -29,6 +29,7 @@ import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWer import com.github.bartimaeusnek.bartworks.util.BWRecipes; import gregtech.api.enchants.Enchantment_Radioactivity; import gregtech.api.enums.*; +import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.common.items.behaviors.Behaviour_DataOrb; -- cgit From 950e02389791875a9488b299abc55349e837ff10 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Thu, 9 Sep 2021 22:12:56 +0800 Subject: Fix git derp Former-commit-id: 2249373213d577cac51706fad0a54eda4600359f --- .../material/werkstoff_loaders/registration/BridgeMaterialsLoader.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java index be6bdcc581..afae6ab0b8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java @@ -101,6 +101,7 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { } werkstoffBridgeMaterial.mName = werkstoff.getVarName(); werkstoffBridgeMaterial.mDefaultLocalName = werkstoff.getDefaultName(); + werkstoffBridgeMaterial.mChemicalFormula = werkstoff.getToolTip(); if ("null".equals(werkstoffBridgeMaterial.mLocalizedName)) // only reload from lang file if not localized already werkstoffBridgeMaterial.mLocalizedName = GT_LanguageManager.addStringLocalization("Material." + werkstoffBridgeMaterial.mName.toLowerCase(), werkstoffBridgeMaterial.mDefaultLocalName); -- cgit From a22840c67691d17234eb4643e3759cd03d812c05 Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Mon, 13 Sep 2021 16:38:43 +0200 Subject: Change mass calculation to match gregtech way Former-commit-id: 3eda8c976662f213eeb4bee572c21a0eee09de0e --- .../github/bartimaeusnek/bartworks/system/material/Werkstoff.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 107dec62c6..f66b598788 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -211,14 +211,18 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } if (this.stats.mass == 0) { long tmpmass = 0; + int count = 0; for (Pair p : contents) { if (p.getKey() instanceof Materials) { tmpmass += ((Materials) p.getKey()).getMass() * p.getValue(); + count += p.getValue(); } else if (p.getKey() instanceof Werkstoff) { tmpmass += ((Werkstoff) p.getKey()).getStats().mass * p.getValue(); + count += p.getValue(); } } - this.stats = stats.setMass(tmpmass); + if(count > 0) + this.stats = stats.setMass(tmpmass/count); } if (this.stats.meltingPoint == 0) -- cgit From c02aac05dc53e11631dcc70c6194884ee574df83 Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Tue, 14 Sep 2021 22:49:34 +0200 Subject: Bug fix Former-commit-id: 64a74900020c709bd68e1e7dd8926055eea7ce2f --- .../multis/GT_TileEntity_ElectricImplosionCompressor.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 8bb604dd36..f761543f56 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -30,6 +30,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ImplosionCompressor; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -93,7 +94,16 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity return false; } - + + @Override + public boolean drainEnergyInput(long aEU) { + if (aEU <= 0) return true; + GT_MetaTileEntity_Hatch_Energy h1 = this.mEnergyHatches.get(0), h2 = this.mEnergyHatches.get(1); + if(!isValidMetaTileEntity(h1) || !isValidMetaTileEntity(h2)) return false; + if(!h1.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU/2, false) || !h2.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU/2, false)) return false; + return true; + } + @Override public boolean onRunningTick(ItemStack aStack) { if (this.mRuntime % 10 == 0) -- cgit From ea8cbfd62657c28e07c30cb8b6aed74654664a88 Mon Sep 17 00:00:00 2001 From: GlodBlock <60341015+GlodBlock@users.noreply.github.com> Date: Fri, 17 Sep 2021 21:22:49 +0800 Subject: allow CAL to accept more circuit recipes fix https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/8060 Former-commit-id: 00015926299fdb134c30c45b7ec7d7fb32548bd2 --- .../material/CircuitGeneration/CircuitImprintLoader.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 3c4cb02013..6831198a56 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -89,7 +89,8 @@ public class CircuitImprintLoader { private static void handleCircuitRecipeRebuilding(GT_Recipe circuitRecipe, HashSet toRem, HashSet toAdd) { ItemStack[] outputs = circuitRecipe.mOutputs; String name = getTypeFromOreDict(outputs); - if (name.contains("Circuit") || name.contains("circuit")) { + String unlocalizedName = outputs[0].getUnlocalizedName(); + if (name.contains("Circuit") || name.contains("circuit") || unlocalizedName.contains("Circuit") || unlocalizedName.contains("circuit")) { CircuitImprintLoader.recipeTagMap.put(CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); @@ -189,6 +190,9 @@ public class CircuitImprintLoader { //fine wires } else if (BW_Util.checkStackAndPrefix(original.mInputs[index]) && GT_OreDictUnificator.getAssociation(original.mInputs[index]).mPrefix == OrePrefixes.wireFine) { in[index] = GT_OreDictUnificator.get(OrePrefixes.wireGt04, GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, original.mInputs[index].stackSize); + if (in[index] == null) { + in[index] = GT_OreDictUnificator.get(OrePrefixes.wireFine, GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, original.mInputs[index].stackSize * 16); + } //other components } else { in[index] = original.mInputs[index].copy(); @@ -242,7 +246,7 @@ public class CircuitImprintLoader { eut = Math.min(eut, recipe.mEUt); } - eut = Math.min(eut, BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName(OreDictionary.getOreIDs(stack)[0])))); + eut = Math.min(eut, BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName((OreDictionary.getOreIDs(stack) != null && OreDictionary.getOreIDs(stack).length > 0) ? OreDictionary.getOreIDs(stack)[0] : -1)))); GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300,eut, BW_Util.CLEANROOM); gtrecipeWorldCache.add(slicingRecipe); GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); @@ -285,4 +289,4 @@ public class CircuitImprintLoader { recipeTagMap.clear(); } -} \ No newline at end of file +} -- cgit From b4b8099c8f64829dbca6198f8b3745b0164b8079 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Thu, 23 Sep 2021 09:40:08 +0200 Subject: change recipe to give full dust. Process time are not changed Former-commit-id: 563d2e63d44465686517364288e6f7dc6d813e44 --- .../system/material/GT_Enhancement/PlatinumSludgeOverHaul.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 3248c57dc7..ce21ac0e4d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -109,7 +109,7 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2),null, AmmoniumChloride.getFluidOrGas(200), PDAmmonia.getFluidOrGas(200), PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(200)}, new FluidStack[]{PDAmmonia.getFluidOrGas(200), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2)}, 1200, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{}, new FluidStack[]{PTConcentrate.getFluidOrGas(9000), AmmoniumChloride.getFluidOrGas(900)}, new FluidStack[]{PDAmmonia.getFluidOrGas(900), Materials.NitrogenDioxide.getGas(4500),Materials.DilutedSulfuricAcid.getFluid(4500)}, new ItemStack[]{PTSaltCrude.get(dust, 8), PTRawPowder.get(dust,1)}, 1200, 30); GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ PTSaltRefined.get(dust), PTSaltRefined.get(dust), -- cgit From c229a5bf29b864448f483c74527c5c40c25d8d38 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Thu, 23 Sep 2021 12:14:48 +0200 Subject: add new recipes instead of remove the old one. Former-commit-id: 3d8b062db7fbd99d18ea5e110850ae6ad733955e --- .../system/material/GT_Enhancement/PlatinumSludgeOverHaul.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index ce21ac0e4d..7c25860f77 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -109,7 +109,8 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2),null, AmmoniumChloride.getFluidOrGas(200), PDAmmonia.getFluidOrGas(200), PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{}, new FluidStack[]{PTConcentrate.getFluidOrGas(9000), AmmoniumChloride.getFluidOrGas(900)}, new FluidStack[]{PDAmmonia.getFluidOrGas(900), Materials.NitrogenDioxide.getGas(4500),Materials.DilutedSulfuricAcid.getFluid(4500)}, new ItemStack[]{PTSaltCrude.get(dust, 8), PTRawPowder.get(dust,1)}, 1200, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(200)}, new FluidStack[]{PDAmmonia.getFluidOrGas(200), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2)}, 1200, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(24)}, new FluidStack[]{PTConcentrate.getFluidOrGas(9000), AmmoniumChloride.getFluidOrGas(900)}, new FluidStack[]{PDAmmonia.getFluidOrGas(900), Materials.NitrogenDioxide.getGas(4500),Materials.DilutedSulfuricAcid.getFluid(4500)}, new ItemStack[]{PTSaltCrude.get(dust, 8), PTRawPowder.get(dust,1)}, 600, 480); GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ PTSaltRefined.get(dust), PTSaltRefined.get(dust), -- cgit From 776162fabfe4510a91bdc20c97c49834e5c41310 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Thu, 23 Sep 2021 12:33:45 +0200 Subject: change Controlcircuit Former-commit-id: 38dad050850cf80b5cd75f3b2cd4c4d841664c10 --- .../system/material/GT_Enhancement/PlatinumSludgeOverHaul.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 7c25860f77..3a91abcda1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -109,8 +109,8 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2),null, AmmoniumChloride.getFluidOrGas(200), PDAmmonia.getFluidOrGas(200), PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(200)}, new FluidStack[]{PDAmmonia.getFluidOrGas(200), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2)}, 1200, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(24)}, new FluidStack[]{PTConcentrate.getFluidOrGas(9000), AmmoniumChloride.getFluidOrGas(900)}, new FluidStack[]{PDAmmonia.getFluidOrGas(900), Materials.NitrogenDioxide.getGas(4500),Materials.DilutedSulfuricAcid.getFluid(4500)}, new ItemStack[]{PTSaltCrude.get(dust, 8), PTRawPowder.get(dust,1)}, 600, 480); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(4)}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(200)}, new FluidStack[]{PDAmmonia.getFluidOrGas(200), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2)}, 1200, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(5)}, new FluidStack[]{PTConcentrate.getFluidOrGas(9000), AmmoniumChloride.getFluidOrGas(900)}, new FluidStack[]{PDAmmonia.getFluidOrGas(900), Materials.NitrogenDioxide.getGas(4500),Materials.DilutedSulfuricAcid.getFluid(4500)}, new ItemStack[]{PTSaltCrude.get(dust, 8), PTRawPowder.get(dust,1)}, 600, 480); GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ PTSaltRefined.get(dust), PTSaltRefined.get(dust), -- cgit From c89357303ab768d80a0720b8e12240fd6b44300a Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Thu, 23 Sep 2021 13:01:16 +0200 Subject: adjust recipe time Former-commit-id: 68e32a8255b6654d49915b267c5338b4d42c04e9 --- .../system/material/GT_Enhancement/PlatinumSludgeOverHaul.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 3a91abcda1..ffb13498ed 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -110,7 +110,7 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2),null, AmmoniumChloride.getFluidOrGas(200), PDAmmonia.getFluidOrGas(200), PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(4)}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(200)}, new FluidStack[]{PDAmmonia.getFluidOrGas(200), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2)}, 1200, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(5)}, new FluidStack[]{PTConcentrate.getFluidOrGas(9000), AmmoniumChloride.getFluidOrGas(900)}, new FluidStack[]{PDAmmonia.getFluidOrGas(900), Materials.NitrogenDioxide.getGas(4500),Materials.DilutedSulfuricAcid.getFluid(4500)}, new ItemStack[]{PTSaltCrude.get(dust, 8), PTRawPowder.get(dust,1)}, 600, 480); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(5)}, new FluidStack[]{PTConcentrate.getFluidOrGas(9000), AmmoniumChloride.getFluidOrGas(900)}, new FluidStack[]{PDAmmonia.getFluidOrGas(900), Materials.NitrogenDioxide.getGas(4500),Materials.DilutedSulfuricAcid.getFluid(4500)}, new ItemStack[]{PTSaltCrude.get(dust, 8), PTRawPowder.get(dust,1)}, 320, 480); GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ PTSaltRefined.get(dust), PTSaltRefined.get(dust), -- cgit From 5e5f85d3966e58a92d5a2e9fb4a7747a75da287b Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Thu, 23 Sep 2021 15:07:05 +0200 Subject: change recipe again Former-commit-id: 917301831f8c62e4dd29e81e3c35a47a6d302228 --- .../system/material/GT_Enhancement/PlatinumSludgeOverHaul.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index ffb13498ed..7c5ab4bc3e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -109,8 +109,8 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2),null, AmmoniumChloride.getFluidOrGas(200), PDAmmonia.getFluidOrGas(200), PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(4)}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(200)}, new FluidStack[]{PDAmmonia.getFluidOrGas(200), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2)}, 1200, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(5)}, new FluidStack[]{PTConcentrate.getFluidOrGas(9000), AmmoniumChloride.getFluidOrGas(900)}, new FluidStack[]{PDAmmonia.getFluidOrGas(900), Materials.NitrogenDioxide.getGas(4500),Materials.DilutedSulfuricAcid.getFluid(4500)}, new ItemStack[]{PTSaltCrude.get(dust, 8), PTRawPowder.get(dust,1)}, 320, 480); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(1)}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(200)}, new FluidStack[]{PDAmmonia.getFluidOrGas(200), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2)}, 1200, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, new FluidStack[]{PTConcentrate.getFluidOrGas(18000), AmmoniumChloride.getFluidOrGas(1800)}, new FluidStack[]{PDAmmonia.getFluidOrGas(1800), Materials.NitrogenDioxide.getGas(9000),Materials.DilutedSulfuricAcid.getFluid(9000)}, new ItemStack[]{PTSaltCrude.get(dust, 16), PTRawPowder.get(dust,2)}, 1100, 300); GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ PTSaltRefined.get(dust), PTSaltRefined.get(dust), -- cgit From ce34f574921d77f0634419c5f81a6cad023307b0 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Thu, 23 Sep 2021 15:34:49 +0200 Subject: and changed platinum recipe again Former-commit-id: 7981470213b59b46fac36da3a77e20759c5e30fe --- .../system/material/GT_Enhancement/PlatinumSludgeOverHaul.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 7c5ab4bc3e..0426ad99a0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -110,7 +110,7 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2),null, AmmoniumChloride.getFluidOrGas(200), PDAmmonia.getFluidOrGas(200), PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(1)}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(200)}, new FluidStack[]{PDAmmonia.getFluidOrGas(200), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2)}, 1200, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, new FluidStack[]{PTConcentrate.getFluidOrGas(18000), AmmoniumChloride.getFluidOrGas(1800)}, new FluidStack[]{PDAmmonia.getFluidOrGas(1800), Materials.NitrogenDioxide.getGas(9000),Materials.DilutedSulfuricAcid.getFluid(9000)}, new ItemStack[]{PTSaltCrude.get(dust, 16), PTRawPowder.get(dust,2)}, 1100, 300); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, new FluidStack[]{PTConcentrate.getFluidOrGas(18000), AmmoniumChloride.getFluidOrGas(1800)}, new FluidStack[]{PDAmmonia.getFluidOrGas(1800), Materials.NitrogenDioxide.getGas(9000),Materials.DilutedSulfuricAcid.getFluid(9000)}, new ItemStack[]{PTSaltCrude.get(dust, 16), PTRawPowder.get(dust,2)}, 1400, 240); GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ PTSaltRefined.get(dust), PTSaltRefined.get(dust), -- cgit From e52eed0dbf2127eae9f0a74ccf1e750a215bd97d Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Thu, 23 Sep 2021 17:01:51 +0200 Subject: Change voltage in blast furnace recipes Former-commit-id: 803afcf64b7758d293ac6d3244d3cb035a650a72 --- .../bartimaeusnek/bartworks/system/material/Werkstoff.java | 14 ++++++++++++++ .../bartworks/system/material/WerkstoffLoader.java | 10 +++++----- .../material/werkstoff_loaders/recipe/DustLoader.java | 6 +++--- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index f66b598788..26af91d878 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -106,6 +106,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.stats.setGas(materials.mHasGas); this.stats.setRadioactive(materials.isRadioactive()); this.stats.setBlastFurnace(materials.mBlastFurnaceRequired); + this.stats.setMeltingVoltage(120); if (type == Types.COMPOUND){ this.stats.setElektrolysis(true); this.generationFeatures.addChemicalRecipes(); @@ -228,6 +229,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (this.stats.meltingPoint == 0) this.stats.meltingPoint = 1123; + if (this.stats.meltingVoltage == 0) + this.stats.meltingVoltage = 120; + this.texSet = texSet; switch (this.mOreByProducts.size()) { @@ -845,6 +849,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { private int durOverride; private float speedOverride; private int meltingPoint; + private int meltingVoltage; private long protons; private long neutrons; private long electrons; @@ -969,6 +974,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } + public Werkstoff.Stats setMeltingVoltage(int meltingVoltage) { + this.meltingVoltage = meltingVoltage; + return this; + } + + public int getMeltingVoltage() { + return meltingVoltage; + } + public boolean isElektrolysis() { return (this.quality & 0x10) != 0; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 4cf650fcf3..dbb486f555 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -747,7 +747,7 @@ public class WerkstoffLoader { new short[]{0x00, 0xff, 0x00}, "BArTiMaEuSNeK", "Are you serious?", - new Werkstoff.Stats().setMeltingPoint(9001).setCentrifuge(true).setBlastFurnace(true), + new Werkstoff.Stats().setMeltingPoint(9001).setCentrifuge(true).setBlastFurnace(true).setMeltingVoltage(1920), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems().addMetalItems().addMolten(), 43, @@ -1285,7 +1285,7 @@ public class WerkstoffLoader { public static final Werkstoff LuVTierMaterial = new Werkstoff( Materials.Chrome.getRGBA(), "Rhodium-Plated Palladium", - new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500), + new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500).setMeltingVoltage(480), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), 88, @@ -1306,7 +1306,7 @@ public class WerkstoffLoader { public static final Werkstoff Ruridit = new Werkstoff( new short[]{0xA4, 0xA4, 0xA4}, "Ruridit", - new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500), + new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500).setMeltingVoltage(480), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), 90, @@ -1328,7 +1328,7 @@ public class WerkstoffLoader { public static final Werkstoff HDCS = new Werkstoff( new short[]{0x33, 0x44, 0x33}, "High Durability Compound Steel", - new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(9000), + new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(9000).setMeltingVoltage(7680), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), 92, @@ -1382,7 +1382,7 @@ public class WerkstoffLoader { new short[]{0xcc, 0xcc, 0xcc}, "Ademic Steel", "The break in the line", - new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setDurOverride(6144).setMeltingPoint(1800).setSpeedOverride(12).setQualityOverride((byte) 4), + new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setDurOverride(6144).setMeltingPoint(1800).setSpeedOverride(12).setQualityOverride((byte) 4).setMeltingVoltage(1920), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().onlyDust().addMetalItems().addCraftingMetalWorkingItems().addMolten().addSimpleMetalWorkingItems().addMultipleIngotMetalWorkingItems(), 96, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java index b8b1d7a75e..8bde7d50e2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java @@ -180,11 +180,11 @@ public class DustLoader implements IWerkstoffRunnable { GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustTiny), werkstoff.get(nugget)); } else if (werkstoff.hasItemType(ingot) && werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().getMeltingPoint() != 0) { if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)) { - GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Nitrogen.getGas(1000), null, werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint(), 120, werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Nitrogen.getGas(1000), null, werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().getMeltingVoltage(), werkstoff.getStats().getMeltingPoint()); } else if (werkstoff.contains(WerkstoffLoader.NOBLE_GAS_SMELTING)) { - GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Argon.getGas(1000), null, werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint(), 120, werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Argon.getGas(1000), null, werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().getMeltingVoltage(), werkstoff.getStats().getMeltingPoint()); } else { - GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint(), 120, werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().getMeltingVoltage(), werkstoff.getStats().getMeltingPoint()); if (werkstoff.getStats().getMeltingPoint() <= 1000) { GT_Values.RA.addPrimitiveBlastRecipe(werkstoff.get(dust), null, 9, werkstoff.get(ingot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint()); GT_ModHandler.addRCBlastFurnaceRecipe(werkstoff.get(ingot), werkstoff.get(dust), werkstoff.getStats().getMeltingPoint()); -- cgit From 4087b73d265a239fe5dcd56df9831f8ba17776da Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Thu, 23 Sep 2021 21:42:39 +0200 Subject: change GT tools to new tiers Former-commit-id: f1d894240affbb02dcdad056a8ad3cb28501776c --- .../werkstoff_loaders/recipe/ToolLoader.java | 38 +++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java index 9b14e0f334..734aae09bf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java @@ -87,19 +87,19 @@ public class ToolLoader implements IWerkstoffRunnable { GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.KNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"fPh", " S ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial())}); GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PPf", "PP ", "Sh ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); - - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); + + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"II ", "IIh", "II ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', ingot.get(werkstoff.getBridgeMaterial())}); @@ -108,12 +108,12 @@ public class ToolLoader implements IWerkstoffRunnable { } if (gtnhGT) { - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, new long[]{200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Titanium), 'P', plate.get(Materials.Titanium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, new long[]{800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.TungstenSteel), 'P', plate.get(Materials.TungstenSteel), 'G', gearGtSmall.get(Materials.TungstenSteel), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); + GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); } // GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(16,1, werkstoff.getBridgeMaterial(),werkstoff.getBridgeMaterial(),null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', werkstoff.get(ingot)}); -- cgit From ef76b377b11af5d1cfb0727d5398552ec7d6de93 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Sat, 25 Sep 2021 10:15:59 +0200 Subject: bump version Former-commit-id: 32b3cf7363700c13382efcc081d1f0fe8cbd1e33 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 185e03bb76..5f17374d7c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,7 +23,7 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 majorUpdate=0 minorUpdate=5 -buildNumber=21 +buildNumber=22 apiVersion=11 ic2Version=2.2.828-experimental applecoreVersion=1.7.10-3.1.1 -- cgit From f0a62699601e8b8f947bbdbbce3ad821b95c56a1 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Mon, 27 Sep 2021 00:56:58 +0200 Subject: exchange silicondioxide with Silicon exchange Aludioxide with Alu Former-commit-id: c9531b147c7332c928170ea0bab21aa318d52487 --- .../bartworks/system/material/WerkstoffLoader.java | 28 +++++++++++----------- .../processingLoaders/AdditionalRecipes.java | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 4cf650fcf3..e43a0f15b6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -255,8 +255,8 @@ public class WerkstoffLoader { Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), new Pair<>(Materials.Sodium, 1), new Pair<>(Materials.Iron, 3), - new Pair<>(Materials.Aluminium, 6), - new Pair<>(Materials.Silicon, 6), + new Pair<>(Materials.Aluminiumoxide, 6), + new Pair<>(Materials.SiliconDioxide, 6), new Pair<>(Materials.Boron, 3), new Pair<>(Materials.Oxygen, 30), new Pair<>(Materials.Fluorine, 1) @@ -284,7 +284,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Sodium, 1), new Pair<>(Materials.Chrome, 3), new Pair<>(Materials.Magnalium, 6), - new Pair<>(Materials.Silicon, 6), + new Pair<>(Materials.SiliconDioxide, 6), new Pair<>(Materials.Boron, 3), new Pair<>(Materials.Oxygen, 31), new Pair<>(Materials.Hydrogen, 3) @@ -318,8 +318,8 @@ public class WerkstoffLoader { TextureSet.SET_RUBY, Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), new Pair<>(Materials.Sodium, 1), - new Pair<>(Materials.Aluminium, 9), - new Pair<>(Materials.Silicon, 6), + new Pair<>(Materials.Aluminiumoxide, 9), + new Pair<>(Materials.SiliconDioxide, 6), new Pair<>(Materials.Boron, 3), new Pair<>(Materials.Oxygen, 31), new Pair<>(Materials.Hydrogen, 1) @@ -440,7 +440,7 @@ public class WerkstoffLoader { TextureSet.SET_GEM_VERTICAL, Arrays.asList(WerkstoffLoader.Zirconium, Materials.Silicon), new Pair<>(WerkstoffLoader.Zirconium, 1), - new Pair<>(Materials.Silicon, 1), + new Pair<>(Materials.SiliconDioxide, 1), new Pair<>(Materials.Oxygen, 4) ); @@ -490,7 +490,7 @@ public class WerkstoffLoader { TextureSet.SET_QUARTZ, Arrays.asList(Materials.Iron, Materials.Silicon), new Pair<>(Materials.Iron, 2), - new Pair<>(Materials.Silicon, 1), + new Pair<>(Materials.SiliconDioxide, 1), new Pair<>(Materials.Oxygen, 4) ); public static final Werkstoff Forsterit = new Werkstoff( @@ -503,7 +503,7 @@ public class WerkstoffLoader { TextureSet.SET_QUARTZ, Arrays.asList(Materials.Magnesium, Materials.Silicon), new Pair<>(Materials.Magnesium, 2), - new Pair<>(Materials.Silicon, 1), + new Pair<>(Materials.SiliconDioxide, 1), new Pair<>(Materials.Oxygen, 4) ); public static final Werkstoff Hedenbergit = new Werkstoff( @@ -517,7 +517,7 @@ public class WerkstoffLoader { Arrays.asList(Materials.Iron, Materials.Calcium, Materials.Silicon), new Pair<>(Materials.Calcium, 1), new Pair<>(Materials.Iron, 1), - new Pair<>(Materials.Silicon, 2), + new Pair<>(Materials.SiliconDioxide, 2), new Pair<>(Materials.Oxygen, 6) ); public static final Werkstoff DescloiziteZNVO4 = new Werkstoff( @@ -557,10 +557,10 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures(), 28, TextureSet.SET_METALLIC, - Arrays.asList(Materials.Potassium, Materials.Aluminium, Materials.Silicon), + Arrays.asList(Materials.Potassium, Materials.Aluminiumoxide, Materials.Silicon), new Pair<>(Materials.Potassium, 1), - new Pair<>(Materials.Aluminium, 3), - new Pair<>(Materials.Silicon, 3), + new Pair<>(Materials.Aluminiumoxide, 3), + new Pair<>(Materials.SiliconDioxide, 3), new Pair<>(Materials.Oxygen, 12), new Pair<>(Materials.Hydrogen, 2) @@ -577,7 +577,7 @@ public class WerkstoffLoader { Arrays.asList(Materials.Potassium, Materials.Chrome, Materials.Silicon), new Pair<>(Materials.Potassium, 1), new Pair<>(Materials.Chrome, 3), - new Pair<>(Materials.Silicon, 3), + new Pair<>(Materials.SiliconDioxide, 3), new Pair<>(Materials.Oxygen, 12), new Pair<>(Materials.Hydrogen, 2) @@ -652,7 +652,7 @@ public class WerkstoffLoader { 35, TextureSet.SET_QUARTZ, //No Byproducts - new Pair<>(Materials.Silicon, 5), + new Pair<>(Materials.SiliconDioxide, 5), new Pair<>(Materials.Oxygen, 10), new Pair<>(Materials.Iron, 1) ); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 332cbdfb66..c6a1ca5ce2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -292,7 +292,7 @@ public class AdditionalRecipes { 400, BW_Util.getMachineVoltageFromTier(5) ); - GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust), Materials.Aluminium.getDust(1), Materials.Thorium.getDust(1), 1000); + GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust), Materials.Aluminiumoxide.getDust(1), Materials.Thorium.getDust(1), 1000); GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust), Materials.Magnesium.getDust(1), Materials.Thorium.getDust(1), 1000); GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(crushed), ItemList.Crop_Drop_Thorium.get(9), Materials.Water.getFluid(1000), Materials.Thorium.getMolten(144), WerkstoffLoader.Thorianit.get(crushedPurified, 4), 96, 24); -- cgit From 16a9d812cf97e137835ea2740941f0c6e28e31c1 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Mon, 27 Sep 2021 01:49:59 +0200 Subject: derp fix Former-commit-id: a101523edd4574f4db47da5d13c7ffa5c250223e --- .../bartworks/system/material/processingLoaders/AdditionalRecipes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index c6a1ca5ce2..332cbdfb66 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -292,7 +292,7 @@ public class AdditionalRecipes { 400, BW_Util.getMachineVoltageFromTier(5) ); - GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust), Materials.Aluminiumoxide.getDust(1), Materials.Thorium.getDust(1), 1000); + GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust), Materials.Aluminium.getDust(1), Materials.Thorium.getDust(1), 1000); GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust), Materials.Magnesium.getDust(1), Materials.Thorium.getDust(1), 1000); GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(crushed), ItemList.Crop_Drop_Thorium.get(9), Materials.Water.getFluid(1000), Materials.Thorium.getMolten(144), WerkstoffLoader.Thorianit.get(crushedPurified, 4), 96, 24); -- cgit From a42f797c22e5f921d736621b7762b8cc2fada7bb Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Mon, 27 Sep 2021 01:58:48 +0200 Subject: fix a few recipe. Need to make new Centrifuge and Electrolyzer recipes Former-commit-id: be3d5aa13a44425869695b897e1e8436d25ff131 --- .../tileentities/multis/GT_TileEntity_HTGR.java | 6 +-- .../bartworks/system/material/WerkstoffLoader.java | 46 +++++++++++----------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 40e2a8b878..ba25171e1f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -497,18 +497,18 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase static final Fuel_[] sHTGR_Fuel = new Fuel_[]{ new Fuel_("Thorium", "Thorium", WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 64), Materials.Uranium235.getDust(4), GT_Values.NF, new ItemStack[]{ - Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), + Materials.SiliconDioxide.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), Materials.Lutetium.getDust(1), WerkstoffLoader.Thorium232.get(OrePrefixes.dust,1)}, new int[]{9000, 9000, 9000, 9000, 1000}, "Multiplies coolant by 1"), new Fuel_("Uranium", "Uranium", Materials.Uranium.getDust(64), Materials.Uranium235.getDust(8), FluidRegistry.getFluidStack("krypton", 8), new ItemStack[]{ - Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), + Materials.SiliconDioxide.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), Materials.Lead.getDust(1), Materials.Uranium.getDust(1)}, new int[]{9000, 9000, 9000, 7000, 1000}, "Multiplies coolant by 1.5"), new Fuel_("Plutonium", "Plutonium", Materials.Plutonium.getDust(64), Materials.Plutonium241.getDust(4), FluidRegistry.getFluidStack("xenon", 8), new ItemStack[]{ - Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), + Materials.SiliconDioxide.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), Materials.Lead.getDust(1), Materials.Plutonium.getDust(1)}, new int[]{9000, 9000, 9000, 7000, 1000}, "Multiplies coolant by 2"), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index e43a0f15b6..8260a1a0e6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -252,11 +252,11 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 5, TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), new Pair<>(Materials.Sodium, 1), new Pair<>(Materials.Iron, 3), - new Pair<>(Materials.Aluminiumoxide, 6), - new Pair<>(Materials.SiliconDioxide, 6), + new Pair<>(Materials.Aluminium, 6), + new Pair<>(Materials.Silicon, 6), new Pair<>(Materials.Boron, 3), new Pair<>(Materials.Oxygen, 30), new Pair<>(Materials.Fluorine, 1) @@ -280,11 +280,11 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 7, TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), new Pair<>(Materials.Sodium, 1), new Pair<>(Materials.Chrome, 3), new Pair<>(Materials.Magnalium, 6), - new Pair<>(Materials.SiliconDioxide, 6), + new Pair<>(Materials.Silicon, 6), new Pair<>(Materials.Boron, 3), new Pair<>(Materials.Oxygen, 31), new Pair<>(Materials.Hydrogen, 3) @@ -298,7 +298,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 8, TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), new Pair<>(Materials.Sodium, 1), new Pair<>(Materials.Vanadium, 3), new Pair<>(Materials.Magnalium, 6), @@ -316,10 +316,10 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 9, TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), new Pair<>(Materials.Sodium, 1), - new Pair<>(Materials.Aluminiumoxide, 9), - new Pair<>(Materials.SiliconDioxide, 6), + new Pair<>(Materials.Aluminium, 9), + new Pair<>(Materials.Silicon, 6), new Pair<>(Materials.Boron, 3), new Pair<>(Materials.Oxygen, 31), new Pair<>(Materials.Hydrogen, 1) @@ -438,9 +438,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 19, TextureSet.SET_GEM_VERTICAL, - Arrays.asList(WerkstoffLoader.Zirconium, Materials.Silicon), + Arrays.asList(WerkstoffLoader.Zirconium, Materials.SiliconDioxide), new Pair<>(WerkstoffLoader.Zirconium, 1), - new Pair<>(Materials.SiliconDioxide, 1), + new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Oxygen, 4) ); @@ -488,9 +488,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 23, TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Iron, Materials.Silicon), + Arrays.asList(Materials.Iron, Materials.SiliconDioxide), new Pair<>(Materials.Iron, 2), - new Pair<>(Materials.SiliconDioxide, 1), + new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Oxygen, 4) ); public static final Werkstoff Forsterit = new Werkstoff( @@ -501,9 +501,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 24, TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Magnesium, Materials.Silicon), + Arrays.asList(Materials.Magnesium, Materials.SiliconDioxide), new Pair<>(Materials.Magnesium, 2), - new Pair<>(Materials.SiliconDioxide, 1), + new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Oxygen, 4) ); public static final Werkstoff Hedenbergit = new Werkstoff( @@ -514,10 +514,10 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 25, TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Iron, Materials.Calcium, Materials.Silicon), + Arrays.asList(Materials.Iron, Materials.Calcium, Materials.SiliconDioxide), new Pair<>(Materials.Calcium, 1), new Pair<>(Materials.Iron, 1), - new Pair<>(Materials.SiliconDioxide, 2), + new Pair<>(Materials.Silicon, 2), new Pair<>(Materials.Oxygen, 6) ); public static final Werkstoff DescloiziteZNVO4 = new Werkstoff( @@ -557,10 +557,10 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures(), 28, TextureSet.SET_METALLIC, - Arrays.asList(Materials.Potassium, Materials.Aluminiumoxide, Materials.Silicon), + Arrays.asList(Materials.Potassium, Materials.Aluminiumoxide, Materials.SiliconDioxide), new Pair<>(Materials.Potassium, 1), - new Pair<>(Materials.Aluminiumoxide, 3), - new Pair<>(Materials.SiliconDioxide, 3), + new Pair<>(Materials.Aluminium, 3), + new Pair<>(Materials.Silicon, 3), new Pair<>(Materials.Oxygen, 12), new Pair<>(Materials.Hydrogen, 2) @@ -574,10 +574,10 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures(), 29, TextureSet.SET_METALLIC, - Arrays.asList(Materials.Potassium, Materials.Chrome, Materials.Silicon), + Arrays.asList(Materials.Potassium, Materials.Chrome, Materials.SiliconDioxide), new Pair<>(Materials.Potassium, 1), new Pair<>(Materials.Chrome, 3), - new Pair<>(Materials.SiliconDioxide, 3), + new Pair<>(Materials.Silicon, 3), new Pair<>(Materials.Oxygen, 12), new Pair<>(Materials.Hydrogen, 2) @@ -652,7 +652,7 @@ public class WerkstoffLoader { 35, TextureSet.SET_QUARTZ, //No Byproducts - new Pair<>(Materials.SiliconDioxide, 5), + new Pair<>(Materials.Silicon, 5), new Pair<>(Materials.Oxygen, 10), new Pair<>(Materials.Iron, 1) ); -- cgit From 9dd3409355f2a4cad7ec6afaa95441aea07a922e Mon Sep 17 00:00:00 2001 From: GlodBlock <60341015+GlodBlock@users.noreply.github.com> Date: Mon, 27 Sep 2021 22:00:22 +0800 Subject: allow MVF accept fluid input must be merged after this: https://github.com/GTNewHorizons/GT5-Unofficial/pull/673 Former-commit-id: de48a8656788bb03fe714da369d5be98fde5ff4e --- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 1877a88183..2fdaa545dc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -40,6 +40,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_VacuumFreezer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.List; @@ -95,21 +96,30 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre @Override public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); + FluidStack[] tInputFluids = this.getStoredFluids().toArray(new FluidStack[0]); ArrayList outputItems = new ArrayList<>(); + ArrayList outputFluids = new ArrayList<>(); long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], null, tInputs); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); boolean found_Recipe = false; int processed = 0; - while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { - if (tRecipe != null && ((long) tRecipe.mEUt * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, null, tInputs)) { + while ((this.getStoredInputs().size() > 0 || this.getStoredFluids().size() > 0) && processed < ConfigHandler.megaMachinesMax) { + if (tRecipe != null && ((long) tRecipe.mEUt * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, tInputFluids, tInputs)) { found_Recipe = true; - for (int i = 0; i < tRecipe.mOutputs.length; i++) { - outputItems.add(tRecipe.getOutput(i)); + if (tRecipe.mOutputs != null) { + for (int i = 0; i < tRecipe.mOutputs.length; i++) { + outputItems.add(tRecipe.getOutput(i)); + } + } + if (tRecipe.mFluidOutputs != null) { + for (int i = 0; i < tRecipe.mFluidOutputs.length; i++) { + outputFluids.add(tRecipe.getFluidOutput(i)); + } } ++processed; } else @@ -138,6 +148,8 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = new ItemStack[outputItems.size()]; this.mOutputItems = outputItems.toArray(this.mOutputItems); + this.mOutputFluids = new FluidStack[outputFluids.size()]; + this.mOutputFluids = outputFluids.toArray(this.mOutputFluids); this.updateSlots(); return true; } @@ -168,8 +180,6 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre && BW_Util.check_layer(aBaseMetaTileEntity, 7, 1, 7, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) && BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false, false, true, GregTech_API.sBlockCasings2, 1, true, 17) ) && - !this.mInputBusses.isEmpty() && - !this.mOutputBusses.isEmpty() && !this.mMaintenanceHatches.isEmpty() && LoaderReference.tectech ? (!this.getTecTechEnergyMultis().isEmpty() || !this.getTecTechEnergyTunnels().isEmpty() || !this.mEnergyHatches.isEmpty()) : @@ -200,4 +210,4 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre public List getTecTechEnergyMultis() { return TTMultiAmp; } -} \ No newline at end of file +} -- cgit From 5fc62f31ad8c331386ff5097800b66b4f28875f5 Mon Sep 17 00:00:00 2001 From: GlodBlock <60341015+GlodBlock@users.noreply.github.com> Date: Mon, 27 Sep 2021 22:02:17 +0800 Subject: update mvf tooltip Former-commit-id: 25374e35bca04de3cb6e87037174be0b863f4337 --- src/main/resources/assets/bartworks/lang/en_US.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index b2a671cd20..be66d04b55 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -102,7 +102,7 @@ tooltip.tile.waterpump.2.name=Must be placed on the Ground. tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3rd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Borosilicate Glass;The glass tier limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Hatch/Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum tooltip.tile.mbf.1.name=Pollution per second -tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest +tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);0-1x Input Bus (Any casing);0-1x Output Bus (Any casing);0-1x Input Hatch (Any casing);0-1x Output Hatch (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom or top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radio Hatch;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! tooltip.tile.windmill.0.name=A primitive Grinder powered by Kinetic energy.;Size(WxHxD): 7x12x7;Layer 1: 7x7 Bricks, corners are air, controller at front centered.;Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,;hollow, Wall must contain at least one Dispenser;Layer 6: 5x5 Wood Planks. Corners are filled, hollow.;Layer 7: 7x7 Wood Planks. Corners are air, hollow.;Layer 8: 7x7 Wood Planks. Corners are air, hollow,;front centered must be a Primitive Kinetic Shaftbox;Layer 9: 7x7 Wood Planks. Corners are air, hollow.;Layer 10: 5x5 Wood Planks. Corners are filled, hollow.;Layer 11: 3x3 Wood Planks. Corners are filled, hollow.;Layer 12: 1x1 Wood Plank.;Needs a Wind Mill Rotor in the Shaftbox to operate;Input items in Controller;Output items will appear in the dispensers;It is faster in regions with more wind (like IC2 Windmills) tooltip.tile.lesu.0.name=Controller Block for the GT2-Styled L.E.S.U.;Size: ANY -- cgit From 33668430e9d1fae3f9e925a556a967d621867061 Mon Sep 17 00:00:00 2001 From: GlodBlock <60341015+GlodBlock@users.noreply.github.com> Date: Tue, 28 Sep 2021 16:54:06 +0800 Subject: balance comb recipe Former-commit-id: 9129f299bac69753856c8d82e854674af793aca0 --- .../system/material/GT_Enhancement/PlatinumSludgeOverHaul.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 0426ad99a0..41bd0aad4c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -252,11 +252,11 @@ public class PlatinumSludgeOverHaul { else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) toDel.add(recipe); else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) - recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); + recipe.mFluidOutputs[i] = AcidicIridiumSolution.getFluidOrGas(1000); else if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) - recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); + recipe.mFluidOutputs[i] = PTConcentrate.getFluidOrGas(1000); else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) - recipe.mFluidOutputs[i] = Materials.Water.getFluid(1000); + recipe.mFluidOutputs[i] = AcidicOsmiumSolution.getFluidOrGas(1000); } else { if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) toDel.add(recipe); @@ -577,4 +577,4 @@ public class PlatinumSludgeOverHaul { return Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); } -} \ No newline at end of file +} -- cgit From 8370f620400ddf7b5efaa4299d23288a4d2d477c Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Wed, 29 Sep 2021 11:13:59 +0200 Subject: remove auto electrolyse recipes add them manual back with oxide variants (cherry picked from commit f3c43083b0fc076c16eba965323f241de8b80890) Former-commit-id: b57da6a8a54f25425ff3496e6427f916ee415633 --- .../bartworks/common/loaders/RecipeLoader.java | 12 +++++++++++- .../bartworks/system/material/WerkstoffLoader.java | 21 +++++++++++---------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index ac747e00b0..70733182a1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -965,6 +965,16 @@ public class RecipeLoader { BW_Util.getMachineVoltageFromTier(6) ); } + GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.Forsterit.get(OrePrefixes.dust, 7), GT_Values.NI, GT_Values.NF, Materials.Oxygen.getGas(2000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnesium, 2L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 200, 90); + GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.RedZircon.get(OrePrefixes.dust, 6), GT_Values.NI, GT_Values.NF, Materials.Oxygen.getGas(2000L), WerkstoffLoader.Zirconium.get(OrePrefixes.dust, 1), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 250, 90); + GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.Fayalit.get(OrePrefixes.dust, 7), GT_Values.NI, GT_Values.NF, Materials.Oxygen.getGas(2000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 2L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 320, 90); + GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.Prasiolite.get(OrePrefixes.dust, 16), GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 5L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 580, 90); + GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.Hedenbergit.get(OrePrefixes.dust, 10), GT_Values.NI, GT_Values.NF, Materials.Oxygen.getGas(2000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Calcium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 2L), GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 300, 90); + GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.FuchsitAL.get(OrePrefixes.dust, 21), ItemList.Cell_Empty.get(2), GT_Values.NF, Materials.Oxygen.getGas(2000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2), GT_Values.NI, GT_Values.NI, null, 390, 120); + GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.FuchsitCR.get(OrePrefixes.dust, 21), ItemList.Cell_Empty.get(2), GT_Values.NF, Materials.Oxygen.getGas(2000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2), GT_Values.NI, GT_Values.NI, null, 460, 120); + GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.VanadioOxyDravit.get(OrePrefixes.dust, 53), ItemList.Cell_Empty.get(3), GT_Values.NF, Materials.Oxygen.getGas(19000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Vanadium, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), null, 710, 120); + GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.ChromoAluminoPovondrait.get(OrePrefixes.dust, 53), ItemList.Cell_Empty.get(3), GT_Values.NF, Materials.Oxygen.getGas(19000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), null, 720, 120); + GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.FluorBuergerit.get(OrePrefixes.dust, 50), ItemList.Cell_Empty.get(1), GT_Values.NF, Materials.Oxygen.getGas(6000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fluorine, 3), null, 730, 120); + GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.Olenit.get(OrePrefixes.dust, 51), ItemList.Cell_Empty.get(1), GT_Values.NF, Materials.Oxygen.getGas(1000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 9L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 1), GT_Values.NI, null, 790, 120); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 8260a1a0e6..d80ba8aba7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -248,6 +248,7 @@ public class WerkstoffLoader { new short[]{0x20, 0x20, 0x20, 0}, "Fluor-Buergerite", subscriptNumbers("NaFe3Al6(Si6O18)(BO3)3O3F"), + new Werkstoff.Stats().setElektrolysis(false), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 5, @@ -275,7 +276,7 @@ public class WerkstoffLoader { new short[]{0, 0x79, 0x6A, 0}, "Chromo-Alumino-Povondraite", subscriptNumbers("NaCr3(Al4Mg2)(Si6O18)(BO3)3(OH)3O"), - Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), + Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND).setElektrolysis(false), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 7, @@ -293,7 +294,7 @@ public class WerkstoffLoader { new short[]{0x60, 0xA0, 0xA0, 0}, "Vanadio-Oxy-Dravite", subscriptNumbers("NaV3(Al4Mg2)(Si6O18)(BO3)3(OH)3O"), - Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), + Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND).setElektrolysis(false), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 8, @@ -311,7 +312,7 @@ public class WerkstoffLoader { new short[]{210, 210, 210, 0}, "Olenite", subscriptNumbers("NaAl3Al6(Si6O18)(BO3)3O3OH"), - Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND), + Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND).setElektrolysis(false), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 9, @@ -433,7 +434,7 @@ public class WerkstoffLoader { public static final Werkstoff RedZircon = new Werkstoff( new short[]{195, 19, 19, 0}, "Red Zircon", - new Werkstoff.Stats().setElektrolysis(true).setMeltingPoint(2130), + new Werkstoff.Stats().setElektrolysis(false).setMeltingPoint(2130), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 19, @@ -483,7 +484,7 @@ public class WerkstoffLoader { public static final Werkstoff Fayalit = new Werkstoff( new short[]{50, 50, 50, 0}, "Fayalite", - new Werkstoff.Stats().setElektrolysis(true), + new Werkstoff.Stats().setElektrolysis(false), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 23, @@ -496,7 +497,7 @@ public class WerkstoffLoader { public static final Werkstoff Forsterit = new Werkstoff( new short[]{255, 255, 255, 0}, "Forsterite", - new Werkstoff.Stats().setElektrolysis(true), + new Werkstoff.Stats().setElektrolysis(false), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 24, @@ -509,7 +510,7 @@ public class WerkstoffLoader { public static final Werkstoff Hedenbergit = new Werkstoff( new short[]{100, 150, 100, 0}, "Hedenbergite", - new Werkstoff.Stats().setElektrolysis(true), + new Werkstoff.Stats().setElektrolysis(false), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 25, @@ -552,7 +553,7 @@ public class WerkstoffLoader { new short[]{0x4D, 0x7F, 0x64, 0}, "Green Fuchsite", subscriptNumbers("KAl3Si3O10(OH)2"), - new Werkstoff.Stats().setElektrolysis(true), + new Werkstoff.Stats().setElektrolysis(false), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), 28, @@ -569,7 +570,7 @@ public class WerkstoffLoader { new short[]{128, 0, 0, 0}, "Red Fuchsite", subscriptNumbers("KCr3Si3O10(OH)2"), - new Werkstoff.Stats().setElektrolysis(true), + new Werkstoff.Stats().setElektrolysis(false), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), 29, @@ -646,7 +647,7 @@ public class WerkstoffLoader { public static final Werkstoff Prasiolite = new Werkstoff( new short[]{0xD0, 0xDD, 0x95, 0}, "Prasiolite", - new Werkstoff.Stats().setElektrolysis(true).setMeltingPoint(1923), + new Werkstoff.Stats().setElektrolysis(false).setMeltingPoint(1923), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 35, -- cgit From bd049c1189527a02f76f53296d3d0dd91f1007a5 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Fri, 1 Oct 2021 12:42:09 +0200 Subject: change AlO2 to Al and SiO2 to Si Former-commit-id: c49673c71786def934e9820e60a78fac5da9a1ae --- .../bartworks/system/material/WerkstoffLoader.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index d80ba8aba7..91ba6ee440 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -253,7 +253,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 5, TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), new Pair<>(Materials.Sodium, 1), new Pair<>(Materials.Iron, 3), new Pair<>(Materials.Aluminium, 6), @@ -281,7 +281,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 7, TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), new Pair<>(Materials.Sodium, 1), new Pair<>(Materials.Chrome, 3), new Pair<>(Materials.Magnalium, 6), @@ -299,7 +299,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 8, TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), new Pair<>(Materials.Sodium, 1), new Pair<>(Materials.Vanadium, 3), new Pair<>(Materials.Magnalium, 6), @@ -317,7 +317,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 9, TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), new Pair<>(Materials.Sodium, 1), new Pair<>(Materials.Aluminium, 9), new Pair<>(Materials.Silicon, 6), @@ -439,7 +439,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 19, TextureSet.SET_GEM_VERTICAL, - Arrays.asList(WerkstoffLoader.Zirconium, Materials.SiliconDioxide), + Arrays.asList(WerkstoffLoader.Zirconium, Materials.Silicon), new Pair<>(WerkstoffLoader.Zirconium, 1), new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Oxygen, 4) @@ -489,7 +489,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 23, TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Iron, Materials.SiliconDioxide), + Arrays.asList(Materials.Iron, Materials.Silicon), new Pair<>(Materials.Iron, 2), new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Oxygen, 4) @@ -502,7 +502,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 24, TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Magnesium, Materials.SiliconDioxide), + Arrays.asList(Materials.Magnesium, Materials.Silicon), new Pair<>(Materials.Magnesium, 2), new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Oxygen, 4) @@ -515,7 +515,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 25, TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Iron, Materials.Calcium, Materials.SiliconDioxide), + Arrays.asList(Materials.Iron, Materials.Calcium, Materials.Silicon), new Pair<>(Materials.Calcium, 1), new Pair<>(Materials.Iron, 1), new Pair<>(Materials.Silicon, 2), @@ -558,7 +558,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures(), 28, TextureSet.SET_METALLIC, - Arrays.asList(Materials.Potassium, Materials.Aluminiumoxide, Materials.SiliconDioxide), + Arrays.asList(Materials.Potassium, Materials.Aluminium, Materials.Silicon), new Pair<>(Materials.Potassium, 1), new Pair<>(Materials.Aluminium, 3), new Pair<>(Materials.Silicon, 3), @@ -575,7 +575,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures(), 29, TextureSet.SET_METALLIC, - Arrays.asList(Materials.Potassium, Materials.Chrome, Materials.SiliconDioxide), + Arrays.asList(Materials.Potassium, Materials.Chrome, Materials.Silicon), new Pair<>(Materials.Potassium, 1), new Pair<>(Materials.Chrome, 3), new Pair<>(Materials.Silicon, 3), @@ -1109,7 +1109,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 71, TextureSet.SET_DULL, - new Pair<>(Materials.SiliconDioxide, 3), + new Pair<>(Materials.Silicon, 3), new Pair<>(Materials.Gold, 2) ); public static final Werkstoff AcidicOsmiumSolution = new Werkstoff( -- cgit From b025fff4c8b9148391cf71b596083b01399cd78f Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Fri, 1 Oct 2021 12:43:21 +0200 Subject: change SiO2 back to Si Former-commit-id: ad8dfa08d3309f5f40386d27b2d7274eed9cbc82 --- .../bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index ba25171e1f..40e2a8b878 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -497,18 +497,18 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase static final Fuel_[] sHTGR_Fuel = new Fuel_[]{ new Fuel_("Thorium", "Thorium", WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 64), Materials.Uranium235.getDust(4), GT_Values.NF, new ItemStack[]{ - Materials.SiliconDioxide.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), + Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), Materials.Lutetium.getDust(1), WerkstoffLoader.Thorium232.get(OrePrefixes.dust,1)}, new int[]{9000, 9000, 9000, 9000, 1000}, "Multiplies coolant by 1"), new Fuel_("Uranium", "Uranium", Materials.Uranium.getDust(64), Materials.Uranium235.getDust(8), FluidRegistry.getFluidStack("krypton", 8), new ItemStack[]{ - Materials.SiliconDioxide.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), + Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), Materials.Lead.getDust(1), Materials.Uranium.getDust(1)}, new int[]{9000, 9000, 9000, 7000, 1000}, "Multiplies coolant by 1.5"), new Fuel_("Plutonium", "Plutonium", Materials.Plutonium.getDust(64), Materials.Plutonium241.getDust(4), FluidRegistry.getFluidStack("xenon", 8), new ItemStack[]{ - Materials.SiliconDioxide.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), + Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), Materials.Lead.getDust(1), Materials.Plutonium.getDust(1)}, new int[]{9000, 9000, 9000, 7000, 1000}, "Multiplies coolant by 2"), -- cgit From fdfc0c6c5965c4668ec4a2f439be5c3c861b7fc0 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Fri, 1 Oct 2021 12:45:37 +0200 Subject: this was SiO2 by default Former-commit-id: 614dfd6ed9fd17c79e82173c92ac6e2f7350ca47 --- .../github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 91ba6ee440..2d9f445dfb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1109,7 +1109,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 71, TextureSet.SET_DULL, - new Pair<>(Materials.Silicon, 3), + new Pair<>(Materials.SiliconDioxide, 3), new Pair<>(Materials.Gold, 2) ); public static final Werkstoff AcidicOsmiumSolution = new Werkstoff( -- cgit From 178006243ad74b40aa1417dc3a1e3896e1383253 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Fri, 1 Oct 2021 13:09:31 +0200 Subject: change SI back to SiO2 and AL to AlO2 as byproduct Former-commit-id: 636cc6aae424e75bd38c36c9f2d305028712d238 --- .../bartworks/system/material/WerkstoffLoader.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 2d9f445dfb..d80ba8aba7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -253,7 +253,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 5, TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), new Pair<>(Materials.Sodium, 1), new Pair<>(Materials.Iron, 3), new Pair<>(Materials.Aluminium, 6), @@ -281,7 +281,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 7, TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), new Pair<>(Materials.Sodium, 1), new Pair<>(Materials.Chrome, 3), new Pair<>(Materials.Magnalium, 6), @@ -299,7 +299,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 8, TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), new Pair<>(Materials.Sodium, 1), new Pair<>(Materials.Vanadium, 3), new Pair<>(Materials.Magnalium, 6), @@ -317,7 +317,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 9, TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium, Materials.Boron, Materials.Silicon), + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), new Pair<>(Materials.Sodium, 1), new Pair<>(Materials.Aluminium, 9), new Pair<>(Materials.Silicon, 6), @@ -439,7 +439,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 19, TextureSet.SET_GEM_VERTICAL, - Arrays.asList(WerkstoffLoader.Zirconium, Materials.Silicon), + Arrays.asList(WerkstoffLoader.Zirconium, Materials.SiliconDioxide), new Pair<>(WerkstoffLoader.Zirconium, 1), new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Oxygen, 4) @@ -489,7 +489,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 23, TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Iron, Materials.Silicon), + Arrays.asList(Materials.Iron, Materials.SiliconDioxide), new Pair<>(Materials.Iron, 2), new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Oxygen, 4) @@ -502,7 +502,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 24, TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Magnesium, Materials.Silicon), + Arrays.asList(Materials.Magnesium, Materials.SiliconDioxide), new Pair<>(Materials.Magnesium, 2), new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Oxygen, 4) @@ -515,7 +515,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().addGems(), 25, TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Iron, Materials.Calcium, Materials.Silicon), + Arrays.asList(Materials.Iron, Materials.Calcium, Materials.SiliconDioxide), new Pair<>(Materials.Calcium, 1), new Pair<>(Materials.Iron, 1), new Pair<>(Materials.Silicon, 2), @@ -558,7 +558,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures(), 28, TextureSet.SET_METALLIC, - Arrays.asList(Materials.Potassium, Materials.Aluminium, Materials.Silicon), + Arrays.asList(Materials.Potassium, Materials.Aluminiumoxide, Materials.SiliconDioxide), new Pair<>(Materials.Potassium, 1), new Pair<>(Materials.Aluminium, 3), new Pair<>(Materials.Silicon, 3), @@ -575,7 +575,7 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures(), 29, TextureSet.SET_METALLIC, - Arrays.asList(Materials.Potassium, Materials.Chrome, Materials.Silicon), + Arrays.asList(Materials.Potassium, Materials.Chrome, Materials.SiliconDioxide), new Pair<>(Materials.Potassium, 1), new Pair<>(Materials.Chrome, 3), new Pair<>(Materials.Silicon, 3), -- cgit From 00fb20acb11e9b32b959663aaa8521da2da4628b Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Fri, 8 Oct 2021 09:49:43 +0200 Subject: use alternative ic2 source Former-commit-id: d3197b14cc97238e6a4232025e137de38106a9eb --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 84b038e10f..5478aee3c0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -91,7 +91,7 @@ configure { repositories { mavenLocal() maven("https://gregtech.overminddl1.com/") { this.name = "GT6Maven" } - maven("http://maven.ic2.player.to/") { this.name = "ic2" } + maven("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/") { this.name = "ic2" } maven("http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/") { this.name = "UsrvDE/GTNH" } ivy { this.name = "gtnh_download_source_stupid_underscore_typo" -- cgit From 8246ae355556814fe84f08ea23bf87cb13241833 Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Wed, 13 Oct 2021 21:17:20 -0600 Subject: Fix generating duplicate materials Former-commit-id: b486cc4fa135cb8aa1fa7e3908b3b198ae7d7a50 --- gradle.properties | 2 +- .../system/material/processingLoaders/AdditionalRecipes.java | 4 +++- .../system/material/werkstoff_loaders/recipe/CellLoader.java | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 5f17374d7c..8d09f2976d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,7 +23,7 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 majorUpdate=0 minorUpdate=5 -buildNumber=22 +buildNumber=23 apiVersion=11 ic2Version=2.2.828-experimental applecoreVersion=1.7.10-3.1.1 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 332cbdfb66..73cdeb8a4b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -391,10 +391,12 @@ public class AdditionalRecipes { boolean aElementSet = false; for (Element e : Element.values()) { if (e.toString().equals("Uuo")) { - werkstoffBridgeMaterial = new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName(), werkstoff.getDefaultName()); + werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : + new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName(), werkstoff.getDefaultName()); werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials.add(werkstoffBridgeMaterial); aElementSet = true; + werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); break; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java index ab589c3bec..896ea0ca23 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java @@ -158,10 +158,12 @@ public class CellLoader implements IWerkstoffRunnable { boolean ElementSet = false; for (Element e : Element.values()) { if (e.toString().equals(werkstoff.getToolTip())) { - werkstoffBridgeMaterial = new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName(), werkstoff.getDefaultName()); + werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : + new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName(), werkstoff.getDefaultName()); werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials.add(werkstoffBridgeMaterial); ElementSet = true; + werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); break; } } -- cgit From 194f9c2847e2fdc1dd8399e4b1a7a7cadaae6f37 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Sat, 16 Oct 2021 20:43:43 +0200 Subject: bump version Former-commit-id: a8687d69bcf91a09f1727e618f416e040e722a07 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 8d09f2976d..8ba81a05f4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,7 +23,7 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 majorUpdate=0 minorUpdate=5 -buildNumber=23 +buildNumber=24 apiVersion=11 ic2Version=2.2.828-experimental applecoreVersion=1.7.10-3.1.1 -- cgit From 83da93397278c1bd362c61412e5138ca571dc3b6 Mon Sep 17 00:00:00 2001 From: Alexdoru Date: Thu, 28 Oct 2021 02:14:26 +0200 Subject: fix crash #8594 Former-commit-id: 689c55c98ca9ad7a73fb12e9a6f8f106d870d65c --- .../bartworks/system/material/BW_MetaGeneratedBlock_Item.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java index d612fa211a..cbde0f80e6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java @@ -58,11 +58,16 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { @SideOnly(Side.CLIENT) @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { - if (!GT_Utility.isStackValid(aStack) || aPlayer == null || aStack.getItemDamage() <= 0) + if (!GT_Utility.isStackValid(aStack) || aPlayer == null || aStack.getItemDamage() <= 0) { return; - if (aList == null) + } + if (aList == null) { aList = new ArrayList(); - aList.add(Werkstoff.werkstoffHashMap.get((short) aStack.getItemDamage()).getToolTip()); + } + Werkstoff werkstoff = Werkstoff.werkstoffHashMap.get((short) aStack.getItemDamage()); + if(werkstoff != null) { + aList.add(werkstoff.getToolTip()); + } aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } -- cgit From 1010ea68f10e406b662d13c4dbe91fab09df2693 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 31 Oct 2021 07:17:15 -0700 Subject: Circuit Assembly Line now uses StructureLib Former-commit-id: 1400ffc3bdcb4018129c8998701c4c53688b4a0a --- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 233 ++++++++++----------- .../resources/assets/bartworks/lang/en_US.lang | 5 + 2 files changed, 115 insertions(+), 123 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 8db536319a..afaef2d36a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -22,10 +22,16 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import appeng.integration.modules.GT; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.gtnewhorizon.structurelib.alignment.IAlignment; +import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -34,19 +40,60 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.*; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.ForgeDirection; import java.util.Collection; import java.util.HashSet; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; +import static net.minecraft.util.StatCollector.translateToLocal; + +public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_EnhancedMultiBlockBase { + + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape("first", transpose(new String[][] { + {"~", "G", "G"}, + {"g", "l", "g"}, + {"b", "i", "b"}, + })) + .addShape("next", transpose(new String[][] { + {"G", "G", "G"}, + {"g", "l", "g"}, + {"b", "I", "b"}, + })) + .addElement('G', ofHatchAdderOptional(GT_TileEntity_CircuitAssemblyLine::addEnergyInputToMachineList, 16, 1, GregTech_API.sBlockCasings3, 10)) //grate machine casings + .addElement('g', ofBlockAnyMeta(GameRegistry.findBlock("IC2", "blockAlloyGlass"))) + .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 5)) //assembling line casings + .addElement('b', ofChain( + ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addMaintenanceToMachineList, 16, 2), + ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addInputHatchToMachineList, 16, 2), + ofBlock(GregTech_API.sBlockCasings2, 0) + )) + .addElement('i', ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addInputToMachineList, 16, 3)) + .addElement('I', ofChain( + ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addInputToMachineList, 16, 4), + ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addOutputToMachineList, 16, 4) + )) + .build(); -public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBlockBase { + @Override + public IStructureDefinition getStructureDefinition() { return STRUCTURE_DEFINITION; } + + //I can't get this to work properly... + protected GT_Multiblock_Tooltip_Builder createTooltip() { + return new GT_Multiblock_Tooltip_Builder(); + } public String getTypeForDisplay() { if (this.type.equals(new NBTTagCompound())) @@ -163,128 +210,6 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl this.updateSlots(); } - @Override - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; - - int xBase = aBaseMetaTileEntity.getXCoord() + xDir; - int yBase = aBaseMetaTileEntity.getYCoord(); - int zBase = aBaseMetaTileEntity.getZCoord() + zDir; - - boolean sided = xDir == 0; - - if (sided) - ++zBase; - else - ++xBase; - - int length = 0; - boolean backwards = false; - - - while (true) { - IGregTechTileEntity igtte = aBaseMetaTileEntity.getIGregTechTileEntity(sided ? xBase + length : xBase - 1, yBase - 2, sided ? zBase - 1 : zBase + length); - if (igtte == null){ - backwards = true; - length = 0; - break; - } - - if (igtte.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_OutputBus) - break; - - ++length; - - if (length > 7){ - backwards = true; - length = 0; - break; - } - - } - if (backwards) - while (true) { - IGregTechTileEntity igtte = aBaseMetaTileEntity.getIGregTechTileEntity(sided ? xBase + length : xBase - 1, yBase - 2, sided ? zBase - 1 : zBase + length); - if (igtte == null) - return false; - - if (igtte.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_OutputBus) - break; - - --length; - - if (length < -7) - return false; - - } - - if (sided) - zBase -= 2; - else - xBase -= 2; - - for (int x = (backwards && sided ? length : 0); x <= (backwards && sided ? 0 : (sided ? length : 2)); x++) { - for (int y = -2; y <= 0; y++) { - for (int z = (backwards && !sided ? length : 0); z <= (backwards && !sided ? 0 : (sided ? 2 : length)); z++) { - if (xBase + x == this.getBaseMetaTileEntity().getXCoord() && yBase + y == this.getBaseMetaTileEntity().getYCoord() && zBase + z == this.getBaseMetaTileEntity().getZCoord()) - continue; - - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntity(xBase + x, yBase + y, zBase + z); - Block block = aBaseMetaTileEntity.getBlock(xBase + x, yBase + y, zBase + z); - byte meta = aBaseMetaTileEntity.getMetaID(xBase + x, yBase + y, zBase + z); - - switch (y) { - case -2: { - switch (sided ? z : x) { - case 0: - case 2: { - if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16)) - if (block != GregTech_API.sBlockCasings2 || meta != 0) - return false; - break; - } - case 1: { - if (!this.addInputToMachineList(tTileEntity, 16) && !((sided ? x : z) == length && this.addOutputToMachineList(tTileEntity, 16))) - return false; - break; - } - default: - break; - } - break; - } - case -1: { - switch (sided ? z : x) { - case 0: - case 2: { - if (BW_Util.calculateGlassTier(block, meta) < 4) - return false; - break; - } - case 1: { - if (block != GregTech_API.sBlockCasings2 || meta != 5) - return false; - break; - } - default: - break; - } - break; - } - case 0: { - if (!this.addEnergyInputToMachineList(tTileEntity, 16)) - if (block != GregTech_API.sBlockCasings3 || meta != 10) - return false; - break; - } - } - } - } - } - return this.mEnergyHatches.size() == 1 && this.mMaintenanceHatches.size() == 1; - } - @Override public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { @@ -305,6 +230,23 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl } } + private boolean addInputHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); + return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity); + } else { + return false; + } + } + } + @Override public int getMaxEfficiency(ItemStack itemStack) { return 10000; @@ -370,4 +312,49 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(16), TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_GLOW).glow().build()))} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(16)}; } + + private static final String[] description = new String[] { + translateToLocal("BW.keyphrase.Hint_Details") + ":", + translateToLocal("BW.tile.CircuitAssemblyLine.hint.0"), //1 - Energy Input Hatch + translateToLocal("BW.tile.CircuitAssemblyLine.hint.1"), //2 - Maintenance Hatch, Input Hatch + translateToLocal("BW.tile.CircuitAssemblyLine.hint.2"), //3 - Input Bus + translateToLocal("BW.tile.CircuitAssemblyLine.hint.3"), //4 - Input Bus, Output Bus + }; + + @Override + public String[] getStructureDescription(ItemStack stackSize) { + return description; + } + + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + if (!this.checkPiece("first", 0, 0, 0)) { + return false; + } else { + return this.checkMachine(true) || this.checkMachine(false); + } + } + + private boolean checkMachine(boolean leftToRight) { + for(int i = 1; i < 7; ++i) { + if (!this.checkPiece("next", leftToRight ? -i : i, 0, 0)) { + return false; + } + + if (!this.mOutputBusses.isEmpty()) { + return !this.mEnergyHatches.isEmpty() && this.mMaintenanceHatches.size() == 1; + } + } + + return false; + } + + public void construct(ItemStack stackSize, boolean hintsOnly) { + this.buildPiece("first", stackSize, hintsOnly, 0, 0, 0); + int tLength = Math.min(stackSize.stackSize + 1, 7); + + for(int i = 1; i < tLength; ++i) { + this.buildPiece("next", stackSize, hintsOnly, -i, 0, 0); + } + + } } diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index be66d04b55..8644e693a8 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -156,6 +156,11 @@ itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so! +BW.keyphrase.Hint_Details=Hint Details +BW.tile.CircuitAssemblyLine.hint.0=1 - Energy Input Hatch +BW.tile.CircuitAssemblyLine.hint.1=2 - Maintenance Hatch, Input Hatch +BW.tile.CircuitAssemblyLine.hint.2=3 - Input Bus +BW.tile.CircuitAssemblyLine.hint.3=4 - Input Bus, Output Bus planet.Ross128b=Ross128b moon.Ross128ba=Ross128ba -- cgit From 90429312a21dff7a77ca752c34b3d34db9027e47 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 31 Oct 2021 07:25:16 -0700 Subject: Removed unused imports Former-commit-id: 48eab7a9c815b51d0285b94b7119f33dfcd79ddb --- .../tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index afaef2d36a..4865004032 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -22,13 +22,10 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; -import appeng.integration.modules.GT; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.gtnewhorizon.structurelib.alignment.IAlignment; -import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.registry.GameRegistry; @@ -43,12 +40,8 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.block.Block; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.common.util.ForgeDirection; import java.util.Collection; import java.util.HashSet; -- cgit From ec4c31321ebb35b6f919fdc4ae1090a8ecbb1c06 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 31 Oct 2021 09:27:00 -0700 Subject: Forms correctly Former-commit-id: 2e762465855383b42927fa10318c2dee29de1c69 --- .../tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 4865004032..d891a12529 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -65,7 +65,9 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance {"g", "l", "g"}, {"b", "I", "b"}, })) - .addElement('G', ofHatchAdderOptional(GT_TileEntity_CircuitAssemblyLine::addEnergyInputToMachineList, 16, 1, GregTech_API.sBlockCasings3, 10)) //grate machine casings + .addElement('G', ofChain( + ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addEnergyInputToMachineList, 16, 1), //grate machine casings + ofBlock(GregTech_API.sBlockCasings3, 10))) .addElement('g', ofBlockAnyMeta(GameRegistry.findBlock("IC2", "blockAlloyGlass"))) .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 5)) //assembling line casings .addElement('b', ofChain( @@ -334,7 +336,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance } if (!this.mOutputBusses.isEmpty()) { - return !this.mEnergyHatches.isEmpty() && this.mMaintenanceHatches.size() == 1; + return this.mEnergyHatches.size() == 1 && this.mMaintenanceHatches.size() == 1; } } -- cgit From b0cbcc5d488589cead315729b13a6385418c5e8e Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 31 Oct 2021 21:11:49 -0700 Subject: BW EV+ glasses can be part of the structure Former-commit-id: 246a550228602d296e52599110ef80f66ff6142b --- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index d891a12529..4f0c6bae2c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; @@ -40,6 +41,7 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -68,7 +70,16 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance .addElement('G', ofChain( ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addEnergyInputToMachineList, 16, 1), //grate machine casings ofBlock(GregTech_API.sBlockCasings3, 10))) - .addElement('g', ofBlockAnyMeta(GameRegistry.findBlock("IC2", "blockAlloyGlass"))) + .addElement('g', ofChain( + ofBlockAnyMeta(GameRegistry.findBlock("IC2", "blockAlloyGlass")), + //Forgive me for I have sinned. But it works... + ofBlock(ItemRegistry.bw_realglas, 1), + ofBlock(ItemRegistry.bw_realglas, 2), + ofBlock(ItemRegistry.bw_realglas, 3), + ofBlock(ItemRegistry.bw_realglas, 4), + ofBlock(ItemRegistry.bw_realglas, 5), + ofBlock(ItemRegistry.bw_realglas, 12) + )) .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 5)) //assembling line casings .addElement('b', ofChain( ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addMaintenanceToMachineList, 16, 2), -- cgit From 8b8f50976c3e74f3a72d19c2fcf577efb15d47d1 Mon Sep 17 00:00:00 2001 From: GlodBlock <1356392126@qq.com> Date: Tue, 16 Nov 2021 23:30:59 +0800 Subject: optimize parallel algorithm Former-commit-id: b4d3eeaa77c61c2597326a3e659c008c07087779 --- .../mega/GT_TileEntity_MegaBlastFurnace.java | 37 ++++++- .../mega/GT_TileEntity_MegaDistillTower.java | 26 ++++- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 36 ++++++- .../bartworks/util/RecipeFinderForParallel.java | 106 +++++++++++++++++++++ 4 files changed, 197 insertions(+), 8 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 7213e7de25..8a018d9c2a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -59,6 +59,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.*; import java.util.stream.Collectors; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAdder; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.GT_Values.V; @@ -390,7 +391,39 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl int tHeatCapacityDivTiers = (this.mHeatingCapacity - tRecipe.mSpecialValue) / 900; long precutRecipeVoltage = (long) (tRecipe.mEUt * Math.pow(0.95, tHeatCapacityDivTiers)); - while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { + long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / precutRecipeVoltage); + + if (this.mHeatingCapacity >= tRecipe.mSpecialValue) { + int tCurrentPara = handleParallelRecipe(tRecipe, tFluids, tInputs, (int) tMaxPara); + processed = tCurrentPara; + found_Recipe = true; + if (tRecipe.mOutputs != null) { + for (int i = 0; i < tRecipe.mOutputs.length; i++) { + tCurrentPara = processed; + while (tCurrentPara > 0 && tRecipe.getOutput(i) != null) { + int maxSize = tRecipe.getOutput(i).getMaxStackSize(); + if (tCurrentPara <= maxSize) { + outputItems.add(GT_Utility.copyAmount(maxSize, tRecipe.getOutput(i))); + tCurrentPara -= maxSize; + } + else { + outputItems.add(GT_Utility.copyAmount(tCurrentPara, tRecipe.getOutput(i))); + tCurrentPara = 0; + } + } + } + } + if (tRecipe.mFluidOutputs != null) { + for (int i = 0; i < tRecipe.mFluidOutputs.length; i++) { + while (tRecipe.getFluidOutput(i) != null) { + FluidStack tOutputFluid = new FluidStack(tRecipe.getFluidOutput(i).getFluid(), tRecipe.getFluidOutput(i).amount * processed); + outputFluids.add(tOutputFluid); + } + } + } + } + + /* while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { if (this.mHeatingCapacity >= tRecipe.mSpecialValue && (precutRecipeVoltage * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { found_Recipe = true; for (int i = 0; i < tRecipe.mOutputs.length; i++) { @@ -402,7 +435,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl ++processed; } else break; - } + }*/ if (found_Recipe) { this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 15105babf0..d365a75bd1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -44,6 +44,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.List; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; @@ -231,7 +232,24 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati boolean found_Recipe = false; FluidStack[] output; GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(this.getBaseMetaTileEntity(), false, GT_Values.V[tTier], new FluidStack[]{tFluid}); - while (this.getStoredFluids().size() > 0 && processed < ConfigHandler.megaMachinesMax) { + + if (tRecipe != null) { + found_Recipe = true; + long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); + int tCurrentPara = handleParallelRecipe(tRecipe, new FluidStack[]{tFluid}, null, (int) tMaxPara); + processed = tCurrentPara; + if (tRecipe.mFluidOutputs != null) { + output = new FluidStack[tRecipe.mFluidOutputs.length]; + for (int i = 0; i < tRecipe.mFluidOutputs.length; i++) { + if (tRecipe.getFluidOutput(i) != null) { + output[i] = new FluidStack(tRecipe.getFluidOutput(i).getFluid(), tRecipe.getFluidOutput(i).amount * tCurrentPara); + } + } + outputFluids.add(output); + } + } + + /* while (this.getStoredFluids().size() > 0 && processed < ConfigHandler.megaMachinesMax) { if (tRecipe != null && (tRecipe.mEUt * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, tFluids)) { found_Recipe = true; if (tRecipe.mFluidOutputs.length == 1 && tRecipe.mFluidOutputs[0].amount == 0) @@ -244,14 +262,14 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati ++processed; } else break; - } + }*/ if (!found_Recipe) continue; - for (int j = 1; j < outputFluids.size(); j++) { + /*for (int j = 1; j < outputFluids.size(); j++) { for (int k = 0; k < outputFluids.get(j).length; k++) { outputFluids.get(0)[k].amount += outputFluids.get(j)[k].amount; } - } + }*/ this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; long actualEUT = (long) (tRecipe.mEUt) * processed; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 2fdaa545dc..c9febd1fa8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -45,6 +45,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.List; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static gregtech.api.enums.GT_Values.V; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) @@ -108,7 +109,38 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre boolean found_Recipe = false; int processed = 0; - while ((this.getStoredInputs().size() > 0 || this.getStoredFluids().size() > 0) && processed < ConfigHandler.megaMachinesMax) { + if (tRecipe != null) { + found_Recipe = true; + long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); + int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); + processed = tCurrentPara; + if (tRecipe.mOutputs != null) { + for (int i = 0; i < tRecipe.mOutputs.length; i++) { + tCurrentPara = processed; + while (tCurrentPara > 0 && tRecipe.getOutput(i) != null) { + int maxSize = tRecipe.getOutput(i).getMaxStackSize(); + if (tCurrentPara <= maxSize) { + outputItems.add(GT_Utility.copyAmount(maxSize, tRecipe.getOutput(i))); + tCurrentPara -= maxSize; + } + else { + outputItems.add(GT_Utility.copyAmount(tCurrentPara, tRecipe.getOutput(i))); + tCurrentPara = 0; + } + } + } + } + if (tRecipe.mFluidOutputs != null) { + for (int i = 0; i < tRecipe.mFluidOutputs.length; i++) { + while (tRecipe.getFluidOutput(i) != null) { + FluidStack tOutputFluid = new FluidStack(tRecipe.getFluidOutput(i).getFluid(), tRecipe.getFluidOutput(i).amount * processed); + outputFluids.add(tOutputFluid); + } + } + } + } + + /*while ((this.getStoredInputs().size() > 0 || this.getStoredFluids().size() > 0) && processed < ConfigHandler.megaMachinesMax) { if (tRecipe != null && ((long) tRecipe.mEUt * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, tInputFluids, tInputs)) { found_Recipe = true; if (tRecipe.mOutputs != null) { @@ -124,7 +156,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre ++processed; } else break; - } + }*/ if (found_Recipe) { this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java new file mode 100644 index 0000000000..a0061564a6 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java @@ -0,0 +1,106 @@ +package com.github.bartimaeusnek.bartworks.util; + +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import java.util.HashMap; + +public class RecipeFinderForParallel { + + /** + This method is used for mega multis which have extremely high parallel.
+ Never use it for non parallel machines, it will have worse performance.
+ */ + + public static int handleParallelRecipe(GT_Recipe aRecipe, FluidStack[] aFluidInputs, ItemStack[] aItemStacks, int aMaxParallel) { + HashMap tCompressedFluidInput = compressFluid(aFluidInputs); + HashMap tCompressedItemInput = compressItem(aItemStacks); + HashMap tCompressedFluidRecipe = compressFluid(aRecipe.mFluidInputs); + HashMap tCompressedItemRecipe = compressItem(aRecipe.mInputs); + int tCurrentPara = aMaxParallel; + for (int tFluid : tCompressedFluidRecipe.keySet()) { + if (tCompressedFluidInput.containsKey(tFluid) && tCompressedFluidRecipe.get(tFluid) != 0) { + tCurrentPara = Math.min(tCurrentPara, tCompressedFluidInput.get(tFluid) / tCompressedFluidRecipe.get(tFluid)); + } + } + for (int tItem : tCompressedItemRecipe.keySet()) { + if (tCompressedItemInput.containsKey(tItem) && tCompressedItemRecipe.get(tItem) != 0) { + tCurrentPara = Math.min(tCurrentPara, tCompressedItemInput.get(tItem) / tCompressedItemRecipe.get(tItem)); + } + } + + for (int tFluid : tCompressedFluidRecipe.keySet()) { + int tOldSize = tCompressedFluidRecipe.get(tFluid); + tCompressedFluidRecipe.put(tFluid, tOldSize * tCurrentPara); + } + for (int tItem : tCompressedItemRecipe.keySet()) { + int tOldSize = tCompressedItemRecipe.get(tItem); + tCompressedItemRecipe.put(tItem, tOldSize * tCurrentPara); + } + + for (FluidStack tFluid : aFluidInputs) { + if (tFluid != null && tCompressedFluidRecipe.containsKey(tFluid.getFluidID())) { + if (tFluid.amount >= tCompressedFluidRecipe.get(tFluid.getFluidID())) { + tFluid.amount -= tCompressedFluidRecipe.get(tFluid.getFluidID()); + tCompressedItemRecipe.remove(tFluid.getFluidID()); + } + else { + tCompressedFluidRecipe.put(tFluid.getFluidID(), tCompressedFluidRecipe.get(tFluid.getFluidID()) - tFluid.amount); + tFluid.amount = 0; + } + } + } + + for (ItemStack tItem : aItemStacks) { + if (tItem != null && tCompressedItemRecipe.containsKey(GT_Utility.stackToInt(tItem))) { + if (tItem.stackSize >= tCompressedItemRecipe.get(GT_Utility.stackToInt(tItem))) { + tItem.stackSize -= tCompressedItemRecipe.get(GT_Utility.stackToInt(tItem)); + tCompressedItemRecipe.remove(GT_Utility.stackToInt(tItem)); + } + else { + tCompressedItemRecipe.put(GT_Utility.stackToInt(tItem), tCompressedItemRecipe.get(GT_Utility.stackToInt(tItem)) - tItem.stackSize); + tItem.stackSize = 0; + } + } + } + return tCurrentPara; + } + + public static HashMap compressItem(ItemStack[] aItemStacks) { + HashMap tCompressed = new HashMap<>(); + for (ItemStack tItem : aItemStacks) { + if (tItem != null) { + int tItemID = GT_Utility.stackToInt(tItem); + int tItemSize = tItem.stackSize; + if (tCompressed.containsKey(tItemID)) { + int tOldSize = tCompressed.get(tItemID); + tCompressed.put(tItemID, tOldSize + tItemSize); + } + else { + tCompressed.put(tItemID, tItemSize); + } + } + } + return tCompressed; + } + + public static HashMap compressFluid(FluidStack[] aFluidStack) { + HashMap tCompressed = new HashMap<>(); + for (FluidStack tFluid : aFluidStack) { + if (tFluid != null) { + int tFluidID = tFluid.getFluidID(); + int tFluidSize = tFluid.amount; + if (tCompressed.containsKey(tFluidID)) { + int tOldSize = tCompressed.get(tFluidID); + tCompressed.put(tFluidID, tOldSize + tFluidSize); + } + else { + tCompressed.put(tFluidID, tFluidSize); + } + } + } + return tCompressed; + } +} -- cgit From 116ae744161eff30f8e7e536d5193391686d2a49 Mon Sep 17 00:00:00 2001 From: GlodBlock <1356392126@qq.com> Date: Fri, 19 Nov 2021 23:05:03 +0800 Subject: merge common code Former-commit-id: 6f3a4fb6857843e310ebcc71596f127c202a81cc --- .../mega/GT_TileEntity_MegaBlastFurnace.java | 46 +++--------------- .../mega/GT_TileEntity_MegaDistillTower.java | 55 +++++----------------- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 46 ++---------------- .../bartworks/util/RecipeFinderForParallel.java | 30 ++++++++++++ 4 files changed, 51 insertions(+), 126 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 8a018d9c2a..0c99ff8947 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -59,6 +59,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.*; import java.util.stream.Collectors; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAdder; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; @@ -162,9 +163,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl } @SuppressWarnings("rawtypes") - public ArrayList TTTunnels = new ArrayList<>(); + public ArrayList TTTunnels = new ArrayList<>(); @SuppressWarnings("rawtypes") - public ArrayList TTMultiAmp = new ArrayList<>(); + public ArrayList TTMultiAmp = new ArrayList<>(); @Override public void loadNBTData(NBTTagCompound aNBT) { @@ -397,46 +398,11 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl int tCurrentPara = handleParallelRecipe(tRecipe, tFluids, tInputs, (int) tMaxPara); processed = tCurrentPara; found_Recipe = true; - if (tRecipe.mOutputs != null) { - for (int i = 0; i < tRecipe.mOutputs.length; i++) { - tCurrentPara = processed; - while (tCurrentPara > 0 && tRecipe.getOutput(i) != null) { - int maxSize = tRecipe.getOutput(i).getMaxStackSize(); - if (tCurrentPara <= maxSize) { - outputItems.add(GT_Utility.copyAmount(maxSize, tRecipe.getOutput(i))); - tCurrentPara -= maxSize; - } - else { - outputItems.add(GT_Utility.copyAmount(tCurrentPara, tRecipe.getOutput(i))); - tCurrentPara = 0; - } - } - } - } - if (tRecipe.mFluidOutputs != null) { - for (int i = 0; i < tRecipe.mFluidOutputs.length; i++) { - while (tRecipe.getFluidOutput(i) != null) { - FluidStack tOutputFluid = new FluidStack(tRecipe.getFluidOutput(i).getFluid(), tRecipe.getFluidOutput(i).amount * processed); - outputFluids.add(tOutputFluid); - } - } - } + Object[] Outputs = getMultiOutput(tRecipe, tCurrentPara); + outputFluids = (ArrayList) Outputs[0]; + outputItems = (ArrayList) Outputs[1]; } - /* while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { - if (this.mHeatingCapacity >= tRecipe.mSpecialValue && (precutRecipeVoltage * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { - found_Recipe = true; - for (int i = 0; i < tRecipe.mOutputs.length; i++) { - outputItems.add(tRecipe.getOutput(i)); - } - for (int i = 0; i < tRecipe.mFluidOutputs.length; i++) { - outputFluids.add(tRecipe.getFluidOutput(i)); - } - ++processed; - } else - break; - }*/ - if (found_Recipe) { this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index d365a75bd1..d13b5d8016 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -44,6 +44,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.List; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_Values.V; @@ -227,10 +228,11 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); if (tFluids.length > 0) { for (FluidStack tFluid : tFluids) { - ArrayList outputFluids = new ArrayList<>(); + ArrayList outputFluids = new ArrayList<>(); + ArrayList outputItems = new ArrayList<>(); + Object[] Outputs; int processed = 0; boolean found_Recipe = false; - FluidStack[] output; GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(this.getBaseMetaTileEntity(), false, GT_Values.V[tTier], new FluidStack[]{tFluid}); if (tRecipe != null) { @@ -238,38 +240,13 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); int tCurrentPara = handleParallelRecipe(tRecipe, new FluidStack[]{tFluid}, null, (int) tMaxPara); processed = tCurrentPara; - if (tRecipe.mFluidOutputs != null) { - output = new FluidStack[tRecipe.mFluidOutputs.length]; - for (int i = 0; i < tRecipe.mFluidOutputs.length; i++) { - if (tRecipe.getFluidOutput(i) != null) { - output[i] = new FluidStack(tRecipe.getFluidOutput(i).getFluid(), tRecipe.getFluidOutput(i).amount * tCurrentPara); - } - } - outputFluids.add(output); - } + Outputs = getMultiOutput(tRecipe, tCurrentPara); + outputFluids = (ArrayList) Outputs[0]; + outputItems = (ArrayList) Outputs[1]; } - /* while (this.getStoredFluids().size() > 0 && processed < ConfigHandler.megaMachinesMax) { - if (tRecipe != null && (tRecipe.mEUt * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, tFluids)) { - found_Recipe = true; - if (tRecipe.mFluidOutputs.length == 1 && tRecipe.mFluidOutputs[0].amount == 0) - tRecipe.mFluidOutputs[0].amount = tRecipe.mFluidInputs[0].amount; - output = new FluidStack[tRecipe.mFluidOutputs.length]; - for (int i = 0; i < output.length; i++) { - output[i] = new FluidStack(tRecipe.mFluidOutputs[i],tRecipe.mFluidOutputs[i].amount); - } - outputFluids.add(output); - ++processed; - } else - break; - }*/ if (!found_Recipe) continue; - /*for (int j = 1; j < outputFluids.size(); j++) { - for (int k = 0; k < outputFluids.get(j).length; k++) { - outputFluids.get(0)[k].amount += outputFluids.get(j)[k].amount; - } - }*/ this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; long actualEUT = (long) (tRecipe.mEUt) * processed; @@ -289,20 +266,10 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati this.mEUt = (-this.mEUt); } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputFluids = outputFluids.get(0).clone(); - if (tRecipe.getOutput(0) != null) { - int stacks = processed / 64; - ItemStack[] outputs = new ItemStack[stacks]; - if (stacks > 0) { - for (int i = 0; i < stacks; i++) - if (i != stacks - 1) - outputs[i] = BW_Util.setStackSize(tRecipe.getOutput(0),64); - else - outputs[i] = BW_Util.setStackSize(tRecipe.getOutput(0),processed - (64 * i)); - this.mOutputItems = outputs; - } else - this.mOutputItems = null; - } else + this.mOutputFluids = outputFluids.toArray(new FluidStack[0]); + if (!outputItems.isEmpty()) + this.mOutputItems = outputItems.toArray(new ItemStack[0]); + else this.mOutputItems = null; this.updateSlots(); return true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index c9febd1fa8..3e6506eb27 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -45,6 +45,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.List; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static gregtech.api.enums.GT_Values.V; @@ -114,50 +115,11 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); processed = tCurrentPara; - if (tRecipe.mOutputs != null) { - for (int i = 0; i < tRecipe.mOutputs.length; i++) { - tCurrentPara = processed; - while (tCurrentPara > 0 && tRecipe.getOutput(i) != null) { - int maxSize = tRecipe.getOutput(i).getMaxStackSize(); - if (tCurrentPara <= maxSize) { - outputItems.add(GT_Utility.copyAmount(maxSize, tRecipe.getOutput(i))); - tCurrentPara -= maxSize; - } - else { - outputItems.add(GT_Utility.copyAmount(tCurrentPara, tRecipe.getOutput(i))); - tCurrentPara = 0; - } - } - } - } - if (tRecipe.mFluidOutputs != null) { - for (int i = 0; i < tRecipe.mFluidOutputs.length; i++) { - while (tRecipe.getFluidOutput(i) != null) { - FluidStack tOutputFluid = new FluidStack(tRecipe.getFluidOutput(i).getFluid(), tRecipe.getFluidOutput(i).amount * processed); - outputFluids.add(tOutputFluid); - } - } - } + Object[] Outputs = getMultiOutput(tRecipe, tCurrentPara); + outputFluids = (ArrayList) Outputs[0]; + outputItems = (ArrayList) Outputs[1]; } - /*while ((this.getStoredInputs().size() > 0 || this.getStoredFluids().size() > 0) && processed < ConfigHandler.megaMachinesMax) { - if (tRecipe != null && ((long) tRecipe.mEUt * (processed + 1)) < nominalV && tRecipe.isRecipeInputEqual(true, tInputFluids, tInputs)) { - found_Recipe = true; - if (tRecipe.mOutputs != null) { - for (int i = 0; i < tRecipe.mOutputs.length; i++) { - outputItems.add(tRecipe.getOutput(i)); - } - } - if (tRecipe.mFluidOutputs != null) { - for (int i = 0; i < tRecipe.mFluidOutputs.length; i++) { - outputFluids.add(tRecipe.getFluidOutput(i)); - } - } - ++processed; - } else - break; - }*/ - if (found_Recipe) { this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java index a0061564a6..0d7da1ccd3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java @@ -5,6 +5,7 @@ import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import java.util.ArrayList; import java.util.HashMap; public class RecipeFinderForParallel { @@ -68,6 +69,35 @@ public class RecipeFinderForParallel { return tCurrentPara; } + public static Object[] getMultiOutput(GT_Recipe aRecipe, int aPall) { + ArrayList tFluidList = new ArrayList<>(); + ArrayList tItemList = new ArrayList<>(); + if (aRecipe == null) + return new Object[]{tFluidList, tItemList}; + if (aRecipe.mFluidOutputs != null && aRecipe.mFluidOutputs.length > 0) { + for (FluidStack tFluid : aRecipe.mFluidOutputs) { + if (tFluid != null && tFluid.amount > 0) { + tFluidList.add(new FluidStack(tFluid.getFluid(), tFluid.amount * aPall)); + } + } + } + if (aRecipe.mOutputs != null && aRecipe.mOutputs.length > 0) { + for (ItemStack tItem : aRecipe.mOutputs) { + if (tItem != null && tItem.stackSize > 0) { + int tAmount = tItem.stackSize * aPall; + while (tAmount > tItem.getMaxStackSize()) { + tItemList.add(GT_Utility.copyAmount(tItem.getMaxStackSize(), tItem)); + tAmount -= tItem.getMaxStackSize(); + } + tItemList.add(GT_Utility.copyAmount(tAmount, tItem)); + } + } + } + return new Object[]{ + tFluidList, tItemList + }; + } + public static HashMap compressItem(ItemStack[] aItemStacks) { HashMap tCompressed = new HashMap<>(); for (ItemStack tItem : aItemStacks) { -- cgit From 5d274d2be291d76b898f709535d316b0b672e76f Mon Sep 17 00:00:00 2001 From: GlodBlock <1356392126@qq.com> Date: Sat, 20 Nov 2021 21:52:00 +0800 Subject: remove hacky code Former-commit-id: 78faefd2b12534fcb0fe06738abd34b24c98174b --- .../mega/GT_TileEntity_MegaBlastFurnace.java | 7 +++--- .../mega/GT_TileEntity_MegaDistillTower.java | 6 ++--- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 7 +++--- .../bartworks/util/RecipeFinderForParallel.java | 26 ++++++---------------- 4 files changed, 18 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 0c99ff8947..f2af0dd849 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MegaUtils; +import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.LowPowerLaser; @@ -398,9 +399,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl int tCurrentPara = handleParallelRecipe(tRecipe, tFluids, tInputs, (int) tMaxPara); processed = tCurrentPara; found_Recipe = true; - Object[] Outputs = getMultiOutput(tRecipe, tCurrentPara); - outputFluids = (ArrayList) Outputs[0]; - outputItems = (ArrayList) Outputs[1]; + Pair, ArrayList> Outputs = getMultiOutput(tRecipe, tCurrentPara); + outputFluids = Outputs.getKey(); + outputItems = Outputs.getValue(); } if (found_Recipe) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index d13b5d8016..4604f2d230 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -230,7 +230,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati for (FluidStack tFluid : tFluids) { ArrayList outputFluids = new ArrayList<>(); ArrayList outputItems = new ArrayList<>(); - Object[] Outputs; + Pair, ArrayList> Outputs; int processed = 0; boolean found_Recipe = false; GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(this.getBaseMetaTileEntity(), false, GT_Values.V[tTier], new FluidStack[]{tFluid}); @@ -241,8 +241,8 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati int tCurrentPara = handleParallelRecipe(tRecipe, new FluidStack[]{tFluid}, null, (int) tMaxPara); processed = tCurrentPara; Outputs = getMultiOutput(tRecipe, tCurrentPara); - outputFluids = (ArrayList) Outputs[0]; - outputItems = (ArrayList) Outputs[1]; + outputFluids = Outputs.getKey(); + outputItems = Outputs.getValue(); } if (!found_Recipe) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 3e6506eb27..8a968094d3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -27,6 +27,7 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MegaUtils; +import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -115,9 +116,9 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); processed = tCurrentPara; - Object[] Outputs = getMultiOutput(tRecipe, tCurrentPara); - outputFluids = (ArrayList) Outputs[0]; - outputItems = (ArrayList) Outputs[1]; + Pair, ArrayList> Outputs = getMultiOutput(tRecipe, tCurrentPara); + outputFluids = Outputs.getKey(); + outputItems = Outputs.getValue(); } if (found_Recipe) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java index 0d7da1ccd3..ab2fd8976a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java @@ -16,6 +16,8 @@ public class RecipeFinderForParallel { */ public static int handleParallelRecipe(GT_Recipe aRecipe, FluidStack[] aFluidInputs, ItemStack[] aItemStacks, int aMaxParallel) { + if (aFluidInputs == null) aFluidInputs = new FluidStack[0]; + if (aItemStacks == null) aItemStacks = new ItemStack[0]; HashMap tCompressedFluidInput = compressFluid(aFluidInputs); HashMap tCompressedItemInput = compressItem(aItemStacks); HashMap tCompressedFluidRecipe = compressFluid(aRecipe.mFluidInputs); @@ -69,11 +71,11 @@ public class RecipeFinderForParallel { return tCurrentPara; } - public static Object[] getMultiOutput(GT_Recipe aRecipe, int aPall) { + public static Pair, ArrayList> getMultiOutput(GT_Recipe aRecipe, int aPall) { ArrayList tFluidList = new ArrayList<>(); ArrayList tItemList = new ArrayList<>(); if (aRecipe == null) - return new Object[]{tFluidList, tItemList}; + return new Pair<>(tFluidList, tItemList); if (aRecipe.mFluidOutputs != null && aRecipe.mFluidOutputs.length > 0) { for (FluidStack tFluid : aRecipe.mFluidOutputs) { if (tFluid != null && tFluid.amount > 0) { @@ -93,9 +95,7 @@ public class RecipeFinderForParallel { } } } - return new Object[]{ - tFluidList, tItemList - }; + return new Pair<>(tFluidList, tItemList); } public static HashMap compressItem(ItemStack[] aItemStacks) { @@ -104,13 +104,7 @@ public class RecipeFinderForParallel { if (tItem != null) { int tItemID = GT_Utility.stackToInt(tItem); int tItemSize = tItem.stackSize; - if (tCompressed.containsKey(tItemID)) { - int tOldSize = tCompressed.get(tItemID); - tCompressed.put(tItemID, tOldSize + tItemSize); - } - else { - tCompressed.put(tItemID, tItemSize); - } + tCompressed.merge(tItemID, tItemSize, Integer::sum); } } return tCompressed; @@ -122,13 +116,7 @@ public class RecipeFinderForParallel { if (tFluid != null) { int tFluidID = tFluid.getFluidID(); int tFluidSize = tFluid.amount; - if (tCompressed.containsKey(tFluidID)) { - int tOldSize = tCompressed.get(tFluidID); - tCompressed.put(tFluidID, tOldSize + tFluidSize); - } - else { - tCompressed.put(tFluidID, tFluidSize); - } + tCompressed.merge(tFluidID, tFluidSize, Integer::sum); } } return tCompressed; -- cgit From 2ca2b2cc799defa48e561cd84a5a1a0f024f21e2 Mon Sep 17 00:00:00 2001 From: Tom Dickson Date: Sat, 20 Nov 2021 15:07:13 -0600 Subject: correct the Forge Former-commit-id: cf787ebbc6b377568084e40531f1b35959c8cb10 --- build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 5478aee3c0..864fc15612 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,11 +25,11 @@ import net.minecraftforge.gradle.user.UserExtension buildscript { repositories { mavenCentral() - maven("https://gregtech.overminddl1.com/") + maven("https://gregtech.overminddl1.com") maven("https://jitpack.io") } dependencies { - classpath("com.github.GTNH2:ForgeGradle:FG_1.2-SNAPSHOT") + classpath("com.github.GTNewHorizons:ForgeGradle:stable-2021-11-20") } } -- cgit From 20ddcf16e4b5dd425e44127a5a3fee63c0361cb3 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Wed, 24 Nov 2021 18:29:49 +0100 Subject: added config values for BW machines Former-commit-id: e4f343233ad202d0c58bc05a50817b4f4311e72c --- .../bartimaeusnek/bartworks/common/configs/ConfigHandler.java | 7 +++++++ .../tileentities/classic/BW_TileEntity_HeatedWaterPump.java | 8 ++++++-- .../tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java | 4 ++-- src/main/resources/assets/bartworks/lang/en_US.lang | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index b8e87bf046..f7e49b0fb3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -26,6 +26,7 @@ package com.github.bartimaeusnek.bartworks.common.configs; import com.github.bartimaeusnek.ASM.BWCoreTransformer; import com.github.bartimaeusnek.bartworks.API.API_ConfigValues; import com.github.bartimaeusnek.bartworks.API.SideReference; +import jdk.nashorn.internal.runtime.regexp.joni.Config; import net.minecraftforge.common.config.Configuration; import java.util.Arrays; @@ -73,6 +74,9 @@ public class ConfigHandler { public static boolean disableBoltedBlocksCasing = false; public static boolean disableReboltedBlocksCasing = false; + public static int pollutionHeatedWaterPumpSecond = 5; + public static int basePollutionMBFTick = 5120; + private static final int[][] METAFORTIERS_ENERGY = { {100, 101, 102, 105}, {1110, 1115, 1120, 1127}, @@ -135,6 +139,9 @@ public class ConfigHandler { ConfigHandler.megaMachinesMax = ConfigHandler.c.get("Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256); ConfigHandler.bioVatMaxParallelBonus = ConfigHandler.c.get("Multiblocks","BioVat Maximum Bonus on Recipes", 1000,"This are the maximum parallel Operations the BioVat can do, when the output is half full.").getInt(1000); + ConfigHandler.pollutionHeatedWaterPumpSecond = ConfigHandler.c.get("Pollution", "Pollution produced per second by the water pump", ConfigHandler.pollutionHeatedWaterPumpSecond, "How much should the Simple Stirling Water Pump produce pollution per second").getInt(ConfigHandler.pollutionHeatedWaterPumpSecond); + ConfigHandler.basePollutionMBFTick = ConfigHandler.c.get("Pollution", "Pollution produced per tick by the MBF per ingot", ConfigHandler.basePollutionMBFTick,"How much should the MBF produce pollution per tick per ingot. Then it'll be multiplied by the amount of ingots done in parallel").getInt(ConfigHandler.basePollutionMBFTick); + if (ConfigHandler.IDOffset == 0) { ConfigHandler.IDOffset = 12600; ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index 0df48330d5..07dc78f6e1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -160,7 +160,7 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr Optional.ofNullable(this.worldObj).ifPresent(e -> { if (e.getTotalWorldTime() % 20 == 0) { Optional.ofNullable(e.getChunkFromBlockCoords(this.xCoord, this.zCoord)).ifPresent(c -> - GT_Pollution.addPollution(c, 5) + GT_Pollution.addPollution(c, ConfigHandler.pollutionHeatedWaterPumpSecond) ); } } @@ -331,7 +331,11 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr public String[] getInfoData() { return new String[]{ StatCollector.translateToLocal("tooltip.tile.waterpump.0.name") + " " + - GT_Utility.formatNumbers(ConfigHandler.mbWaterperSec) + StatCollector.translateToLocal("tooltip.tile.waterpump.1.name"), + GT_Utility.formatNumbers(ConfigHandler.mbWaterperSec) + + String.format( + StatCollector.translateToLocal("tooltip.tile.waterpump.1.name"), + ConfigHandler.pollutionHeatedWaterPumpSecond + ), StatCollector.translateToLocal("tooltip.tile.waterpump.2.name")}; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index f2af0dd849..a0d10ba151 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -121,7 +121,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl private int mHeatingCapacity; private byte glasTier; - private int polPtick = super.getPollutionPerTick(null) * ConfigHandler.megaMachinesMax; + private int polPtick = ConfigHandler.basePollutionMBFTick*ConfigHandler.megaMachinesMax; public GT_TileEntity_MegaBlastFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -426,7 +426,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.polPtick = super.getPollutionPerTick(null) * processed; + this.polPtick = ConfigHandler.basePollutionMBFTick * processed; this.mOutputItems = new ItemStack[outputItems.size()]; this.mOutputItems = outputItems.toArray(this.mOutputItems); this.mOutputFluids = new FluidStack[outputFluids.size()]; diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 8644e693a8..84930900d1 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -97,7 +97,7 @@ tooltip.labparts.7.name=A DNA Flask containing: tooltip.labparts.8.name=A Plasmid Cell containing: tooltip.tile.waterpump.0.name=Produces -tooltip.tile.waterpump.1.name=L/s Water when fueled. Causes 5 Pollution per second. +tooltip.tile.waterpump.1.name=L/s Water when fueled. Causes %d Pollution per second. tooltip.tile.waterpump.2.name=Must be placed on the Ground. tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3rd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Borosilicate Glass;The glass tier limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Hatch/Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum -- cgit From d34568fcebde9f7daf8293c292749115ba59be84 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Wed, 24 Nov 2021 18:34:49 +0100 Subject: fix typo Former-commit-id: 1170d2a2537319db91381756a1cdcb0ffb5d6941 --- .../github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index f7e49b0fb3..22d219bd9a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -75,7 +75,7 @@ public class ConfigHandler { public static boolean disableReboltedBlocksCasing = false; public static int pollutionHeatedWaterPumpSecond = 5; - public static int basePollutionMBFTick = 5120; + public static int basePollutionMBFTick = 20; private static final int[][] METAFORTIERS_ENERGY = { {100, 101, 102, 105}, -- cgit From 4b6d9e172de8642a9db5893f369c8f884413c86b Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 25 Nov 2021 02:22:38 +0100 Subject: harmonize config values to gibbl/sec Former-commit-id: c92597f3159693c6bf839d15d7ecd66de9615158 --- .../bartimaeusnek/bartworks/common/configs/ConfigHandler.java | 6 ++---- .../tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 22d219bd9a..64095f5cc4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -25,8 +25,6 @@ package com.github.bartimaeusnek.bartworks.common.configs; import com.github.bartimaeusnek.ASM.BWCoreTransformer; import com.github.bartimaeusnek.bartworks.API.API_ConfigValues; -import com.github.bartimaeusnek.bartworks.API.SideReference; -import jdk.nashorn.internal.runtime.regexp.joni.Config; import net.minecraftforge.common.config.Configuration; import java.util.Arrays; @@ -75,7 +73,7 @@ public class ConfigHandler { public static boolean disableReboltedBlocksCasing = false; public static int pollutionHeatedWaterPumpSecond = 5; - public static int basePollutionMBFTick = 20; + public static int basePollutionMBFSecond = 400; private static final int[][] METAFORTIERS_ENERGY = { {100, 101, 102, 105}, @@ -140,7 +138,7 @@ public class ConfigHandler { ConfigHandler.bioVatMaxParallelBonus = ConfigHandler.c.get("Multiblocks","BioVat Maximum Bonus on Recipes", 1000,"This are the maximum parallel Operations the BioVat can do, when the output is half full.").getInt(1000); ConfigHandler.pollutionHeatedWaterPumpSecond = ConfigHandler.c.get("Pollution", "Pollution produced per second by the water pump", ConfigHandler.pollutionHeatedWaterPumpSecond, "How much should the Simple Stirling Water Pump produce pollution per second").getInt(ConfigHandler.pollutionHeatedWaterPumpSecond); - ConfigHandler.basePollutionMBFTick = ConfigHandler.c.get("Pollution", "Pollution produced per tick by the MBF per ingot", ConfigHandler.basePollutionMBFTick,"How much should the MBF produce pollution per tick per ingot. Then it'll be multiplied by the amount of ingots done in parallel").getInt(ConfigHandler.basePollutionMBFTick); + ConfigHandler.basePollutionMBFSecond = ConfigHandler.c.get("Pollution", "Pollution produced per tick by the MBF per ingot", ConfigHandler.basePollutionMBFSecond,"How much should the MBF produce pollution per tick per ingot. Then it'll be multiplied by the amount of ingots done in parallel").getInt(ConfigHandler.basePollutionMBFSecond); if (ConfigHandler.IDOffset == 0) { ConfigHandler.IDOffset = 12600; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index a0d10ba151..6737431662 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -121,7 +121,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl private int mHeatingCapacity; private byte glasTier; - private int polPtick = ConfigHandler.basePollutionMBFTick*ConfigHandler.megaMachinesMax; + private int polPtick = ConfigHandler.basePollutionMBFSecond / 20 * ConfigHandler.megaMachinesMax; public GT_TileEntity_MegaBlastFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -426,7 +426,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.polPtick = ConfigHandler.basePollutionMBFTick * processed; + this.polPtick = ConfigHandler.basePollutionMBFSecond / 20 * processed; this.mOutputItems = new ItemStack[outputItems.size()]; this.mOutputItems = outputItems.toArray(this.mOutputItems); this.mOutputFluids = new FluidStack[outputFluids.size()]; -- cgit From ed1262752bd63ea0abae7d038613e73465b73314 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 27 Nov 2021 20:47:27 +0100 Subject: Update build.gradle.kts Former-commit-id: 2a845974e9e1d380583bbb783c1d0cf263c04516 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 864fc15612..83dc215272 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -132,7 +132,7 @@ dependencies { this.isChanging = true } compile ("com.github.GTNewHorizons:StructureLib:1.0.6:deobf") - compile("com.github.GTNewHorizons:TinkersConstruct:master-SNAPSHOT:deobf") { + compile("com.github.GTNewHorizons:TinkersConstruct:master-SNAPSHOT:dev") { this.isChanging = true } compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-1.7.10-SNAPSHOT:dev") { -- cgit From edce1850c1abf3a4a9e973dfe54a42981a47a678 Mon Sep 17 00:00:00 2001 From: bombcar Date: Sat, 27 Nov 2021 16:06:08 -0600 Subject: update to 1.2.4 Former-commit-id: 8f5f62a8365cb32c44f122ac5e8007bbea197e42 --- build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 864fc15612..3b7e21c8b1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -29,7 +29,7 @@ buildscript { maven("https://jitpack.io") } dependencies { - classpath("com.github.GTNewHorizons:ForgeGradle:stable-2021-11-20") + classpath("com.github.GTNewHorizons:ForgeGradle:1.2.4") } } @@ -132,7 +132,7 @@ dependencies { this.isChanging = true } compile ("com.github.GTNewHorizons:StructureLib:1.0.6:deobf") - compile("com.github.GTNewHorizons:TinkersConstruct:master-SNAPSHOT:deobf") { + compile("com.github.GTNewHorizons:TinkersConstruct:master-SNAPSHOT:dev") { this.isChanging = true } compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-1.7.10-SNAPSHOT:dev") { -- cgit From 1d12bccf755365e08f50bdc48eaa6265d873b260 Mon Sep 17 00:00:00 2001 From: bombcar Date: Sat, 27 Nov 2021 16:12:07 -0600 Subject: fix tinkers reference Former-commit-id: 7f3e903640691ab3fb5226d56eb9b899f2873747 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 864fc15612..83dc215272 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -132,7 +132,7 @@ dependencies { this.isChanging = true } compile ("com.github.GTNewHorizons:StructureLib:1.0.6:deobf") - compile("com.github.GTNewHorizons:TinkersConstruct:master-SNAPSHOT:deobf") { + compile("com.github.GTNewHorizons:TinkersConstruct:master-SNAPSHOT:dev") { this.isChanging = true } compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-1.7.10-SNAPSHOT:dev") { -- cgit From 90d8657e5a1c83209bf61baa59dcc53547fe09ee Mon Sep 17 00:00:00 2001 From: GlodBlock <1356392126@qq.com> Date: Mon, 29 Nov 2021 13:46:39 +0800 Subject: remove tiny dust in oreprocess Former-commit-id: c8acc58e5f33c2913a3edc5a54a9ec5b1aec642e --- .../material/werkstoff_loaders/recipe/CrushedLoader.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java index e0c44aed4d..f35d7c14a2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java @@ -60,18 +60,18 @@ public class CrushedLoader implements IWerkstoffRunnable { GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), 10, 16); GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), werkstoff.getOreByProduct(0, dust), 10, false); - GT_ModHandler.addOreWasherRecipe(werkstoff.get(crushed), 1000, werkstoff.get(crushedPurified), werkstoff.getOreByProduct(0, dustTiny), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); - GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushed), (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dustTiny), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); + GT_ModHandler.addOreWasherRecipe(werkstoff.get(crushed), new int[] {10000, 1111, 10000}, 1000, werkstoff.get(crushedPurified), werkstoff.getOreByProduct(0, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); + GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushed), new int[] {10000, 1111, 10000}, (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), 10, 16); GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), werkstoff.getOreByProduct(1, dust), 10, false); - GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushedPurified), (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dustTiny)); + GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushedPurified), new int[] {10000, 1111}, (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dust)); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(dust), 10, 16); GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(dust), werkstoff.getOreByProduct(2, dust), 10, false); - GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustImpure), 0, werkstoff.get(dust), werkstoff.getOreByProduct(0, dustTiny), null, null, null, null, (int) Math.max(1L, werkstoff.getStats().getMass() * 8L)); - GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustPure), 0, werkstoff.get(dust), werkstoff.getOreByProduct(1, dustTiny), null, null, null, null, (int) Math.max(1L, werkstoff.getStats().getMass() * 8L)); + GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustImpure), null, null, null, werkstoff.get(dust), werkstoff.getOreByProduct(0, dust), null, null, null, null, new int[] {10000, 1111}, (int) Math.max(1L, werkstoff.getStats().getMass() * 8L), 5); + GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustPure), null, null, null, werkstoff.get(dust), werkstoff.getOreByProduct(1, dust), null, null, null, null, new int[] {10000, 1111}, (int) Math.max(1L, werkstoff.getStats().getMass() * 8L), 5); if (werkstoff.contains(SubTag.CRYSTALLISABLE)) { GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustPure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); -- cgit From 25a1eb817e9fbcb6575ccd6eadf23d0c8318e591 Mon Sep 17 00:00:00 2001 From: bombcar Date: Wed, 1 Dec 2021 11:04:58 -0600 Subject: use GTNH libs Former-commit-id: deea291a5a91fd0d5c71e73c3021a07729d65c0e --- build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 3b7e21c8b1..4e3e82f528 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -165,9 +165,9 @@ dependencies { compileOnly("com.enderio:EnderIO:$enderioVersion:dev") //NEI - compile("codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev") - compile("codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev") - compile("codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev") + compile("com.github.GTNewHorizons:CodeChickenLib:master-SNAPSHOT:dev") + compile("com.github.GTNewHorizons:CodeChickenCore:master-SNAPSHOT:dev") + compile("com.github.GTNewHorizons:NotEnoughItems:master-SNAPSHOT:dev") } val Project.minecraft: UserExtension -- cgit From 43e73b77fa5d24d2a357851532ee0ba4f7a3d136 Mon Sep 17 00:00:00 2001 From: bombcar Date: Thu, 2 Dec 2021 10:12:13 -0600 Subject: fixbuild (#58) Former-commit-id: 89a03922ae69c9de8bfd9d52c1d992fe22663d13 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4e3e82f528..4d0258ed0b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -128,7 +128,7 @@ dependencies { //hard deps compile("net.industrial-craft:industrialcraft-2:$ic2Version:dev") //jitpack - compile("com.github.GTNewHorizons:GT5-Unofficial:experimental-SNAPSHOT:dev") { + compile("com.github.GTNewHorizons:GT5-Unofficial:master-SNAPSHOT:dev") { this.isChanging = true } compile ("com.github.GTNewHorizons:StructureLib:1.0.6:deobf") -- cgit From 3b5f58e4da7b186fd628b3dbcb88b5393e8ceac0 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Thu, 2 Dec 2021 18:16:56 +0100 Subject: bump version Former-commit-id: 2d62e70c46a60ad6dcc15925808fd890f19b82ea --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 8ba81a05f4..2a69f2e18f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,7 +23,7 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 majorUpdate=0 minorUpdate=5 -buildNumber=24 +buildNumber=25 apiVersion=11 ic2Version=2.2.828-experimental applecoreVersion=1.7.10-3.1.1 -- cgit From af3a51c0a8cd24a86175df8d999a79f01eb09105 Mon Sep 17 00:00:00 2001 From: Johann Bernhardt Date: Thu, 2 Dec 2021 19:59:50 +0100 Subject: Migrate to unified build script (#59) Former-commit-id: 9b48b72af5e2885baffbe3f89984364d99bc58d4 --- .github/FUNDING.yml | 12 - .github/scripts/test-no-crash-reports.sh | 9 + .github/workflows/build-and-test.yml | 45 ++ .github/workflows/gradle.yml | 26 -- .github/workflows/release-tags.yml | 45 ++ .gitignore | 73 +-- .travis.yml | 43 -- addon.gradle | 3 + build.bat | 2 - build.gradle | 517 +++++++++++++++++++++ build.gradle.kts | 236 ---------- dependencies.gradle | 32 ++ ...-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id | 1 + gradle.properties | 92 ++-- gradle/wrapper/gradle-wrapper.jar | Bin 51017 -> 55616 bytes gradle/wrapper/gradle-wrapper.properties | 3 +- gradlew | 98 ++-- gradlew.bat | 30 +- jitpack.yml | 2 + ...-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id | 1 - repositories.gradle | 26 ++ .../github/bartimaeusnek/bartworks/MainMod.java | 4 +- src/main/resources/mcmod.info | 8 +- 23 files changed, 853 insertions(+), 455 deletions(-) delete mode 100644 .github/FUNDING.yml create mode 100644 .github/scripts/test-no-crash-reports.sh create mode 100644 .github/workflows/build-and-test.yml delete mode 100644 .github/workflows/gradle.yml create mode 100644 .github/workflows/release-tags.yml delete mode 100644 .travis.yml create mode 100644 addon.gradle delete mode 100644 build.bat create mode 100644 build.gradle delete mode 100644 build.gradle.kts create mode 100644 dependencies.gradle create mode 100644 dependencies/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id create mode 100644 jitpack.yml delete mode 100644 libs/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id create mode 100644 repositories.gradle diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 8b1d0623a8..0000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: bartimaeusnek -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with a single custom sponsorship URL diff --git a/.github/scripts/test-no-crash-reports.sh b/.github/scripts/test-no-crash-reports.sh new file mode 100644 index 0000000000..c67e342c06 --- /dev/null +++ b/.github/scripts/test-no-crash-reports.sh @@ -0,0 +1,9 @@ +directory="run/crash-reports" +if [ -d $directory ]; then + echo "Crash reports detected:" + cat $directory/* + exit 1 +else + echo "No crash reports detected" + exit 0 +fi diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000000..a60a2b6468 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,45 @@ +# 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 minute + run: | + mkdir run + echo "eula=true" > run/eula.txt + timeout 60 ./gradlew runServer || true + + - name: Test no crashes happend + run: | + chmod +x .github/scripts/test-no-crash-reports.sh + .github/scripts/test-no-crash-reports.sh diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml deleted file mode 100644 index 3af6a933ed..0000000000 --- a/.github/workflows/gradle.yml +++ /dev/null @@ -1,26 +0,0 @@ -# This workflow will build a Java project with Gradle -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: Java CI with Gradle - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew build -Dorg.gradle.internal.http.socketTimeout=60000 -Dorg.gradle.internal.http.connectionTimeout=60000 diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml new file mode 100644 index 0000000000..25c354b227 --- /dev/null +++ b/.github/workflows/release-tags.yml @@ -0,0 +1,45 @@ +# 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 diff --git a/.gitignore b/.gitignore index 44a1b8107b..558ad12d27 100644 --- a/.gitignore +++ b/.gitignore @@ -1,51 +1,28 @@ -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# IDEA files -.idea/ +.gradle +.settings +/.idea/ +/run/ +/build/ +/eclipse/ +.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/ *.iml *.ipr *.iws - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar -*.bin -*.lock -*.sqlite -/old - - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* -/eclipse -/build -/out -/run -/.gradle -/venv -/libs/* -!/libs/TecTech-1.7.10-3.7.3-deobf.jar -!/libs/CodeChickenCore-1.7.10-1.0.4.35-dev.jar -!/libs/CodeChickenLib-1.7.10-1.1.1.99-dev.jar -!/libs/NotEnoughItems-1.7.10-1.0.4.95-dev.jar -!/libs/gregtech-5.09.33.32-dev.jar -!/libs/GalacticGreg-1.7.10-1.0.3.jar -SetupWorkspaces.bat -SetupDevWorkspaces.bat -Idea.bat -*.bat -.idea \ No newline at end of file +src/main/resources/mixins.*.json diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9470b6a66f..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -language: java -sudo: false -install: true -cache: - directories: - - "$HOME/.gradle/caches/2.14.1" - - "$HOME/.gradle/caches/jars-1" - - "$HOME/.gradle/caches/jars-2" - - "$HOME/.gradle/caches/jars-3" - - "$HOME/.gradle/native" - - "$HOME/.gradle/daemon" - - "$HOME/.gradle/wrapper" - - "$HOME/.gradle/minecraft" -jdk: - - openjdk8 -jobs: - include: -# - stage: sonar -# addons: -# sonarcloud: -# organization: "bartimaeusnek-github" -# token: -# secure: "KW2U8HenTpLQOXT+OxCsu4noCKH6ZkUATld36YTbwAwzVKt6aesqtKHkZuo+Y+a143GI184pdnhMcRB1F49Wf0IQTkOhvopfnSEg+AKWZJb+gAbZQaYkaoe04pVzdwnpBXPDZR0DnTJX09VJGlES0RMiYfaQDHAYuPRQRBf17mLWvhXf7ZfNshGLikmzQcXWoXMpB+z9BaJ9Vr9/+Jn4Geuh9MWsbc2xZyQU8hoTTtKxqj5sTVRkwmxTf0ooGrMKohoOQ5JeZLDWM0Z/7KW64kFCE3xDrKg2gnKyKNLU6qIwbgCtVkcqGb28tXuqNdRSZ5BHb70dZb0E2+9VGhS7xPA8iUVmktJRKKG+f34HtDlsXqA00SEF2u+fq+TDz7fcPHLM8z1IcUI2XF5c5A/6E1k161i3kMB9xpd5Rq4waywo+/2j+L2CE6u5aj7BeL7KUQKD7k5gx3bXUyIo2QdjzeJeUJTSaxchcae9iIO+W6rwc68fD5/UNHVp+O75QNz2B+pklz6hCFVaoUep8rl4LO58ODBU1GL4JfeTM0RzOofOFepPXIi39iCk89c61WBtxX8RPkv3nBDsrXCGU7UNH1thP1nmgCfB4HGRxixWBAnmPDHNLEW81RG+meGRpHX7RkWISmrl95x15QXb016hldvK3sAegxxVPUdyJxRplgE=" -# script: "./gradlew sonarqube" - - stage: buildAndDeploy - script: "./gradlew build -Dorg.gradle.internal.http.socketTimeout=60000 -Dorg.gradle.internal.http.connectionTimeout=60000" - deploy: - provider: releases - api_key: - secure: "fZcmkACyjZv8rEjG9hjsNq6ZT/przBeSGYzdfpT55YV/xWXj18Lkqr4XfrY4GiTp/pJwOGYT5dUUybRSlMM3eSMWNcAjBOW7WuJDEkZIHPKTb5/H+SJgUeuxj0W7cTqANWvYlMaNv2WSQfV2UW09xvSuMJuVMUcng1E1AZj6hF5285DrbxygEiF0ZY77Rsq+Q3l29bJxrj+x5D8ui8m2rn2tug8+W5/iCxYLpNEQ0hLcxPOh/0GbdHtsett81F9CVW+aPnVE7AlVnGK6lftWfiwPHqglpbx7lwEr6/gHBFuJIasreP5+GJvMx0D96la4KRvREFfS4eAZXLG7Syx0zzVInf6SHtMtzVM7heIY/aEnZ8clYxfnOBw10hyuev4QUdCvBb0tndsrCBI4kEIqvvNVcpHatJyzr+q0gj7mvGsXu3DIN5teo6h6DBJrbuhS6QKM2Lm/FsrboeSfIFlXE94IORmQzH0evgbk8u+CER1VNvrRHBngfEqypGd06TbXVW/uvfCedpvOZ3ewuPhLqOZHCzXbjBDAf0xzIcwWIzkEcpT4hXujHexyGAPJVHZDO2KA/7oFWEks9gCdnSJ7Qet5VwsUyDHzsDACix5+9tiYc0CFyRcEuWsvfVCqYCs1NwDJcHH0KxFceah1UzvS+6QB5MFfR5uFxhgUA4qsMd0=" - file: build/libs/*.jar - skip_cleanup: true - file_glob: true - on: - tags: false -after_success: - - wget https://raw.githubusercontent.com/bartimaeusnek/travis-ci-discord-webhook/master/send.sh - - chmod +x send.sh - - ./send.sh success $WEBHOOK_URL -after_failure: - - wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh - - chmod +x send.sh - - ./send.sh failure $WEBHOOK_URL diff --git a/addon.gradle b/addon.gradle new file mode 100644 index 0000000000..cc0f5d57e5 --- /dev/null +++ b/addon.gradle @@ -0,0 +1,3 @@ +compileJava { + options.encoding = "UTF-8" +} diff --git a/build.bat b/build.bat deleted file mode 100644 index 3c93bfe30e..0000000000 --- a/build.bat +++ /dev/null @@ -1,2 +0,0 @@ -call gradlew.bat build -pause \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000000..a380f6c76f --- /dev/null +++ b/build.gradle @@ -0,0 +1,517 @@ +//version: ffe7b130f98fdfa1ac7c6ba4bd34722a55ab28d4 +/* +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/SinTh0r4s/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.4' + } +} + +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") +} + +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") + +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/SinTh0r4s/ExampleMod1.7.10/blob/main/gradle.properties") + } +} + + +String javaSourceDir = "src/main/java/" +String scalaSourceDir = "src/main/scala/" + +String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") +String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") +if((new File(targetPackageJava).exists() || new File(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((new File(targetPackageJava).exists() || new File(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(new File(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((new File(targetPackageJava).exists() || new File(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((new File(targetFileJava).exists() || new File(targetFileScala).exists() || new File(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((new File(targetFileJava).exists() || new File(targetFileScala).exists() || new File(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 from git tag +try { + version = minecraftVersion + "-" + gitVersion() +} +catch (Exception e) { + throw new IllegalStateException("This mod must be version controlled by Git AND the repository must provide at least one tag!"); +} +group = modGroup +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) +} + +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("org.spongepowered:mixin:0.7.11-SNAPSHOT") { + // 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.3.3:dev") + } +} + +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()) { + new File(projectDir.toString() + "/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 { + manifest { + attributes(getManifestAttributes()) + } + + minimize() // This will only allow shading for actually used classes + configurations = [project.configurations.shadowImplementation] + dependsOn(relocateShadowJar) +} + +jar { + 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) { + from sourceSets.main.output + getArchiveClassifier().set("dev") + + manifest { + attributes(getManifestAttributes()) + } + + minimize() // This will only allow shading for actually used classes + configurations = [project.configurations.shadowImplementation] +} + +task relocateShadowDevJar(type: ConfigureShadowRelocation) { + target = tasks.shadowDevJar + prefix = modGroup + ".shadow" +} + +task circularResolverJar(type: Jar) { + dependsOn(relocateShadowDevJar) + dependsOn(shadowDevJar) + enabled = false +} + +task devJar(type: Jar) { + 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() + '/**' + } + + from (sourceSets.main.output) { + include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString() + '/**' + } + + from (sourceSets.main.resources.srcDirs) { + include("LICENSE") + } + + getArchiveClassifier().set('api') +} + +artifacts { + archives sourcesJar + archives devJar + if(apiPackage) { + archives apiJar + } +} + +// Updating +task updateBuildScript { + doLast { + if (updateBuildScript()) return + + print("Build script already up-to-date!") + } +} + +if (isNewBuildScriptVersionAvailable()) { + if (autoUpdateBuildScript.toBoolean()) { + updateBuildScript() + } else { + println("Build script update available! Run 'gradle updateBuildScript'") + } +} + +static URL availableBuildScriptUrl() { + new URL("https://raw.githubusercontent.com/SinTh0r4s/ExampleMod1.7.10/main/build.gradle") +} + +static boolean updateBuildScript() { + if (isNewBuildScriptVersionAvailable()) { + def buildscriptFile = new File("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 +} + +static boolean isNewBuildScriptVersionAvailable() { + Map parameters = ["connectTimeout": 2000, "readTimeout": 2000] + + String currentBuildScript = new File("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' +} diff --git a/build.gradle.kts b/build.gradle.kts deleted file mode 100644 index 4d0258ed0b..0000000000 --- a/build.gradle.kts +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -import net.minecraftforge.gradle.user.UserExtension - -buildscript { - repositories { - mavenCentral() - maven("https://gregtech.overminddl1.com") - maven("https://jitpack.io") - } - dependencies { - classpath("com.github.GTNewHorizons:ForgeGradle:1.2.4") - } -} - -plugins { - idea - java - id("org.ajoberstar.grgit") version("3.1.1") -} - -apply(plugin = "forge") - -idea { - module { - this.isDownloadJavadoc = true - this.isDownloadSources = true - } -} - -java { - this.sourceCompatibility = JavaVersion.VERSION_1_8 - this.targetCompatibility = JavaVersion.VERSION_1_8 -} - -configurations.all { - resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS) - isTransitive = false -} - -tasks.withType { - options.encoding = "UTF-8" -} - -val majorUpdate: String by project -val minorUpdate: String by project -val buildNumber: String by project - -minecraft.version = "1.7.10-10.13.4.1614-1.7.10" -version = "$majorUpdate.$minorUpdate.$buildNumber" -group = "com.github.bartimaeusnek.bartworks" - -//minecraft block -configure { - this.includes.addAll( - arrayOf( - "MainMod.java", - "API_REFERENCE.java" - ) - ) - val apiVersion: String by project - this.replacements.putAll( - mapOf( - Pair("@version@", project.version), - Pair("@apiversion@", apiVersion) - ) - ) - this.runDir = "run" -} - -repositories { - mavenLocal() - maven("https://gregtech.overminddl1.com/") { this.name = "GT6Maven" } - maven("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/") { this.name = "ic2" } - maven("http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/") { this.name = "UsrvDE/GTNH" } - ivy { - this.name = "gtnh_download_source_stupid_underscore_typo" - 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]") - } - ivy { - this.name = "vexatos" - this.artifactPattern("https://files.vexatos.com/[organisation]/[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("http://maven.tterrag.com") { this.name = "tterrag Repo" } - maven("https://jitpack.io") -} - -dependencies { - //Needed properties - val ic2Version: String by project - val galacticraftVersion: String by project - val applecoreVersion: String by project - val enderCoreVersion: String by project - val enderioVersion: String by project - - //hard deps - compile("net.industrial-craft:industrialcraft-2:$ic2Version:dev") - //jitpack - compile("com.github.GTNewHorizons:GT5-Unofficial:master-SNAPSHOT:dev") { - this.isChanging = true - } - compile ("com.github.GTNewHorizons:StructureLib:1.0.6:deobf") - compile("com.github.GTNewHorizons:TinkersConstruct:master-SNAPSHOT:dev") { - this.isChanging = true - } - compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-1.7.10-SNAPSHOT:dev") { - this.isChanging = true - } - //soft deps - compileOnly("com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf") - compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") - compileOnly("mods.railcraft:Railcraft_1.7.10:9.12.3.0:dev") - compile("micdoodle8.mods:MicdoodleCore:$galacticraftVersion:Dev") - compile("micdoodle8.mods:GalacticraftCore:$galacticraftVersion:Dev") - compile("micdoodle8.mods:Galacticraft-Planets:$galacticraftVersion:Dev") - compileOnly("li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api") - compileOnly("net.sengir.forestry:forestry_1.7.10:4.4.0.0:dev") - compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.19:deobf") - //jitpack - compileOnly("com.github.GTNewHorizons:GalacticGregGT5:master-SNAPSHOT") { - this.isChanging = true - } - //compileOnly("com.github.Technus:Tectech:master-SNAPSHOT") { - // this.isChanging = true - //} - //Files - compileOnly(fileTree("libs") { this.include("*.jar") }) - - //CoreLibs for compile-age - //compileOnly("com.github.GTNH2:Yamcl:master-SNAPSHOT") //broken jitpack.io dep - compileOnly("applecore:AppleCore:$applecoreVersion:api") - compileOnly("com.enderio.core:EnderCore:$enderCoreVersion:dev") - compileOnly("com.enderio:EnderIO:$enderioVersion:dev") - - //NEI - compile("com.github.GTNewHorizons:CodeChickenLib:master-SNAPSHOT:dev") - compile("com.github.GTNewHorizons:CodeChickenCore:master-SNAPSHOT:dev") - compile("com.github.GTNewHorizons:NotEnoughItems:master-SNAPSHOT:dev") -} - -val Project.minecraft: UserExtension - get() = extensions.getByName("minecraft") - -tasks.withType { - // this will ensure that this task is redone when the versions change. - this.inputs.properties += "version" to project.version - this.inputs.properties += "mcversion" to project.minecraft.version - this.archiveBaseName.set("bartworks[${project.minecraft.version}]-[${getVersionAppendage()}]") - - // replace stuff in mcmod.info, nothing else - this.filesMatching("/mcmod.info") { - this.expand( - mapOf( - "version" to project.version, - "mcversion" to project.minecraft.version - ) - ) - } -} - -tasks.jar { - this.exclude( - "assets/gregtech/textures/items/materialicons/copy.bat", - "assets/gregtech/textures/blocks/materialicons/copy.bat" - ) - this.manifest.attributes( - mapOf( - Pair("FMLCorePlugin","com.github.bartimaeusnek.ASM.BWCorePlugin"), - Pair("FMLCorePluginContainsFMLMod","true") - ) - ) -} - -val apiJar by tasks.creating(Jar::class) { - this.from(sourceSets.main.get().output) { - this.include( - "com/github/bartimaeusnek/bartworks/API/**", - "com/github/bartimaeusnek/bartworks/util/**", - "com/github/bartimaeusnek/bartworks/system/material/Werkstoff.class", - "com/github/bartimaeusnek/crossmod/thaumcraft/util/**" - ) - } - this.archiveClassifier.set("API") -} - -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(apiJar) - this.archives(sourcesJar) - this.archives(devJar) -} - -fun getVersionAppendage() : String { - return org.ajoberstar.grgit.Grgit.open(mapOf("currentDir" to project.rootDir)).log().last().abbreviatedId -} diff --git a/dependencies.gradle b/dependencies.gradle new file mode 100644 index 0000000000..a9bb02f4e8 --- /dev/null +++ b/dependencies.gradle @@ -0,0 +1,32 @@ +// Add your dependencies here + +dependencies { + compile("com.github.GTNewHorizons:GalacticGregGT5:master-SNAPSHOT:dev") + + compile files("dependencies/TecTech-1.7.10-4.10.4-local-b6491dd.jar") + + compileOnly("com.github.GTNewHorizons:AppleCore:master-SNAPSHOT:dev") { + transitive = false + } + compileOnly("com.github.GTNewHorizons:TinkersGregworks:master-SNAPSHOT:dev") { + transitive = false + } + compileOnly("com.github.GTNewHorizons:ForestryMC:master-SNAPSHOT:api") { + transitive = false + } + compileOnly("com.github.GTNewHorizons:Railcraft:master-SNAPSHOT:api") { + transitive = false + } + compileOnly("com.github.GTNewHorizons:EnderIO:master-SNAPSHOT:api") { + transitive = false + } + + compileOnly("li.cil.oc:OpenComputers:MC1.7.10-1.7.5.1356:api") { + transitive = false + } + compileOnly("com.mod-buildcraft:buildcraft:7.1.23:dev") { + transitive = false + } + + runtime("com.github.GTNewHorizons:Yamcl:master-SNAPSHOT:dev") +} diff --git a/dependencies/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id b/dependencies/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id new file mode 100644 index 0000000000..8f77b8280a --- /dev/null +++ b/dependencies/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id @@ -0,0 +1 @@ +dc6e19622ea5e9f310bca2ea25ad5f160dc21591 \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 2a69f2e18f..9f5ae76b21 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,32 +1,60 @@ -# -# Copyright (c) 2018-2020 bartimaeusnek -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -systemProp.org.gradle.internal.http.connectionTimeout=120000 -systemProp.org.gradle.internal.http.socketTimeout=120000 -majorUpdate=0 -minorUpdate=5 -buildNumber=25 -apiVersion=11 -ic2Version=2.2.828-experimental -applecoreVersion=1.7.10-3.1.1 -galacticraftVersion=1.7-3.0.12.504 -enderioVersion=1.7.10-2.3.0.429_beta -enderCoreVersion=1.7.10-0.2.0.39_beta \ No newline at end of file +modName = BartWorks + +# This is a case-sensitive string to identify your mod. Convention is to use lower case. +modId = bartworks + +modGroup = com.github.bartimaeusnek.bartworks + +# 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 = MainMod.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 = + +# 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 = false diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index b761216703..5c2d1cf016 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9cc785acbf..3ab0b725ef 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Wed Jul 02 15:54:47 CDT 2014 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip \ No newline at end of file diff --git a/gradlew b/gradlew index 91a7e269e1..83f2acfdc3 100755 --- a/gradlew +++ b/gradlew @@ -1,4 +1,20 @@ -#!/usr/bin/env bash +#!/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. +# ############################################################################## ## @@ -6,20 +22,38 @@ ## ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null 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"' + # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn ( ) { +warn () { echo "$*" } -die ( ) { +die () { echo echo "$*" echo @@ -30,6 +64,7 @@ die ( ) { cygwin=false msys=false darwin=false +nonstop=false case "`uname`" in CYGWIN* ) cygwin=true @@ -40,31 +75,11 @@ case "`uname`" in MINGW* ) msys=true ;; + NONSTOP* ) + nonstop=true + ;; esac -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -90,7 +105,7 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then @@ -110,10 +125,11 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` @@ -154,11 +170,19 @@ if $cygwin ; then esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " } -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 8a0b282aa6..9618d8d960 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@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 @@ -8,14 +24,14 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@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= - set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. 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" + @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome @@ -46,10 +62,9 @@ echo location of your Java installation. goto fail :init -@rem Get command-line arguments, handling Windowz variants +@rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. @@ -60,11 +75,6 @@ set _SKIP=2 if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ :execute @rem Setup the command line diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 0000000000..09bbb514fc --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,2 @@ +before_install: + - ./gradlew setupCIWorkspace \ No newline at end of file diff --git a/libs/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id b/libs/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id deleted file mode 100644 index 8f77b8280a..0000000000 --- a/libs/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -dc6e19622ea5e9f310bca2ea25ad5f160dc21591 \ No newline at end of file diff --git a/repositories.gradle b/repositories.gradle new file mode 100644 index 0000000000..130197c8aa --- /dev/null +++ b/repositories.gradle @@ -0,0 +1,26 @@ +// Add any additional repositories for your dependencies here + +repositories { + 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/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 4723d9c6ac..c3cc760025 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -78,9 +78,9 @@ import static gregtech.api.enums.GT_Values.VN; ) public final class MainMod { public static final String NAME = "BartWorks"; - public static final String VERSION = "@version@"; + public static final String VERSION = "GRADLETOKEN_VERSION"; public static final String MOD_ID = "bartworks"; - public static final String APIVERSION = "@apiversion@"; + public static final String APIVERSION = "11"; public static final Logger LOGGER = LogManager.getLogger(MainMod.NAME); public static final CreativeTabs GT2 = new GT2Tab("GT2C"); public static final CreativeTabs BIO_TAB = new BioTab("BioTab"); diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index ce4324d98d..f13aa2a23b 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,10 +1,10 @@ [ { - "modid": "bartworks", - "name": "BartWorks", + "modid": "${modId}", + "name": "${modName}", "description": "A Gregtech Addon.", - "version": "${version}", - "mcversion": "${mcversion}", + "version": "${modVersion}", + "mcversion": "${minecraftVersion}", "url": "https://github.com/bartimaeusnek/bartworks", "updateUrl": "", "authorList": ["bartimaeusnek"], -- cgit From 6c09843256bac56cc2f685766df1b43c58e44760 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Thu, 2 Dec 2021 20:49:07 +0100 Subject: ignore bat files Former-commit-id: 2620808cb131e1997756f8d037742507e11b28c1 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 558ad12d27..40fb5e4a7d 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ whitelist.json *.ipr *.iws src/main/resources/mixins.*.json +*.bat -- cgit From 48229a248951bcce901df2cc03a199ff2a2899f7 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Fri, 3 Dec 2021 21:02:20 +0800 Subject: Fix ASM problem Former-commit-id: 6126f3ee4e61efb5d0ec8fa4a5372fd742c6f659 --- addon.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addon.gradle b/addon.gradle index cc0f5d57e5..15ba866637 100644 --- a/addon.gradle +++ b/addon.gradle @@ -1,3 +1,5 @@ compileJava { options.encoding = "UTF-8" } + +project.coreModClass = "com.github.bartimaeusnek.ASM.BWCorePlugin" -- cgit From 5a34da7fbebbd9f780a1458b0d310dadbda7d78d Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Fri, 3 Dec 2021 21:47:12 +0800 Subject: Fix ASM problem attempt 2 Former-commit-id: 9e7f7e39f1dd6c8778506c203387913841f74d6c --- README.md | 2 +- addon.gradle | 2 - gradle.properties | 2 +- .../com/github/bartimaeusnek/ASM/ASMUtils.java | 66 ---- .../java/com/github/bartimaeusnek/ASM/BWCore.java | 92 ------ .../com/github/bartimaeusnek/ASM/BWCorePlugin.java | 89 ------ .../ASM/BWCoreStaticReplacementMethodes.java | 132 -------- .../bartimaeusnek/ASM/BWCoreTransformer.java | 334 --------------------- .../bartimaeusnek/bartworks/ASM/ASMUtils.java | 66 ++++ .../github/bartimaeusnek/bartworks/ASM/BWCore.java | 92 ++++++ .../bartimaeusnek/bartworks/ASM/BWCorePlugin.java | 89 ++++++ .../ASM/BWCoreStaticReplacementMethodes.java | 132 ++++++++ .../bartworks/ASM/BWCoreTransformer.java | 334 +++++++++++++++++++++ .../common/commands/ClearCraftingCache.java | 2 +- .../bartworks/common/configs/ConfigHandler.java | 2 +- .../CircuitGeneration/CircuitImprintLoader.java | 2 +- 16 files changed, 718 insertions(+), 720 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java delete mode 100644 src/main/java/com/github/bartimaeusnek/ASM/BWCore.java delete mode 100644 src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java delete mode 100644 src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java delete mode 100644 src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/ASM/ASMUtils.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java diff --git a/README.md b/README.md index af2d69b350..7fcf015b51 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,4 @@ Visit us on Twitch: https://minecraft.curseforge.com/projects/bartworks/ -Please add -Dfml.coreMods.load=com.github.bartimaeusnek.ASM.BWCorePlugin to your args when you run this in a dev enviroment! \ No newline at end of file +Please add -Dfml.coreMods.load=com.github.bartimaeusnek.bartworks.ASM.BWCorePlugin to your args when you run this in a dev enviroment! \ No newline at end of file diff --git a/addon.gradle b/addon.gradle index 15ba866637..cc0f5d57e5 100644 --- a/addon.gradle +++ b/addon.gradle @@ -1,5 +1,3 @@ compileJava { options.encoding = "UTF-8" } - -project.coreModClass = "com.github.bartimaeusnek.ASM.BWCorePlugin" diff --git a/gradle.properties b/gradle.properties index 9f5ae76b21..5472edd8cf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -50,7 +50,7 @@ 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 = +coreModClass = ASM.BWCorePlugin # 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 diff --git a/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java b/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java deleted file mode 100644 index 9055909567..0000000000 --- a/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.ASM; - -import org.objectweb.asm.tree.MethodNode; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -public class ASMUtils { - - public static String matchAny(String toCompare, String... args) { - for (String arg : args) { - if (toCompare.equalsIgnoreCase(arg)) - return arg; - } - return ""; - } - - /** - * Call this Method twice, one time for the Descriptor and one time for the Name. - */ - public static boolean isCorrectMethod(MethodNode methodNode, String... args) { - for (String arg : args) { - if (methodNode.name.equalsIgnoreCase(arg) || methodNode.desc.equalsIgnoreCase(arg)) - return true; - } - return false; - } - - public static boolean writeClassToDisk(byte[] towrite, String Classname, String Path) { - try { - if (Path.charAt(Path.length()-1) == '/' || Path.charAt(Path.length()-1) == '\\') - Path = Path.substring(0,Path.length()-1); - OutputStream os = new FileOutputStream(new File(Path + '/' + Classname + ".class")); - os.write(towrite); - } catch (IOException e) { - e.printStackTrace(); - return false; - } - return true; - } - -} diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java deleted file mode 100644 index 6592da592f..0000000000 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.ASM; - -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; -import com.google.common.eventbus.EventBus; -import com.google.common.eventbus.Subscribe; -import cpw.mods.fml.common.DummyModContainer; -import cpw.mods.fml.common.LoadController; -import cpw.mods.fml.common.ModMetadata; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.versioning.ArtifactVersion; -import cpw.mods.fml.common.versioning.DefaultArtifactVersion; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import java.util.ArrayList; -import java.util.List; - -import static com.github.bartimaeusnek.ASM.BWCoreTransformer.shouldTransform; - -@SuppressWarnings("ALL") -public class BWCore extends DummyModContainer { - - public static final String BWCORE_NAME = "BartWorks ASM Core"; - public static final Logger BWCORE_LOG = LogManager.getLogger(BWCore.BWCORE_NAME); - - public BWCore() { - super(new ModMetadata()); - ModMetadata metadata = this.getMetadata(); - metadata.modId = "BWCore"; - metadata.name = BWCore.BWCORE_NAME; - metadata.version = "0.0.1"; - metadata.authorList.add("bartimaeusnek"); - metadata.dependants = this.getDependants(); - } - - @Subscribe - public void preInit(FMLPreInitializationEvent event) { - shouldTransform[0] = ConfigHandler.enabledPatches[0]; - shouldTransform[1] = ConfigHandler.enabledPatches[1]; - shouldTransform[3] = ConfigHandler.enabledPatches[3]; - shouldTransform[4] = true; - shouldTransform[5] = ConfigHandler.enabledPatches[5]; - shouldTransform[6] = ConfigHandler.enabledPatches[6]; - //shouldTransform[6] = true; - BWCore.BWCORE_LOG.info("Extra Utilities found and ASM Patch enabled? " + shouldTransform[0]); - BWCore.BWCORE_LOG.info("Thaumcraft found and ASM Patch enabled? " + shouldTransform[3]); - BWCore.BWCORE_LOG.info("RWG found and ASM Patch enabled? " + shouldTransform[5]); - } - - @Override - public List getDependants() { - List ret = new ArrayList<>(); - ret.add(new DefaultArtifactVersion("ExtraUtilities", true)); - ret.add(new DefaultArtifactVersion("Thaumcraft", true)); - ret.add(new DefaultArtifactVersion("miscutils", true)); - ret.add(new DefaultArtifactVersion("RWG", true)); - ret.add(new DefaultArtifactVersion("gregtech", true)); - ret.add(new DefaultArtifactVersion(MainMod.MOD_ID, true)); - ret.add(new DefaultArtifactVersion(BartWorksCrossmod.MOD_ID, true)); - return ret; - } - - @Override - public boolean registerBus(EventBus bus, LoadController controller) { - bus.register(this); - return true; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java deleted file mode 100644 index bbaff54ba1..0000000000 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.ASM; - -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import cpw.mods.fml.relauncher.FMLInjectionData; -import cpw.mods.fml.relauncher.IFMLLoadingPlugin; -import net.minecraftforge.common.config.Configuration; - -import java.io.File; -import java.util.ArrayList; -import java.util.Map; - -@IFMLLoadingPlugin.SortingIndex(Integer.MAX_VALUE)//Load as late as possible (after fastcraft/OptiFine). -@IFMLLoadingPlugin.MCVersion("1.7.10") -@IFMLLoadingPlugin.TransformerExclusions("com.github.bartimaeusnek.ASM") -@IFMLLoadingPlugin.Name(BWCorePlugin.BWCORE_PLUGIN_NAME) -public class BWCorePlugin implements IFMLLoadingPlugin { - - public static final String BWCORE_PLUGIN_NAME = "BartWorks ASM Core Plugin"; - - public static File minecraftDir; - - public BWCorePlugin() { - //Injection Code taken from CodeChickenLib - if (BWCorePlugin.minecraftDir != null) - return;//get called twice, once for IFMLCallHook - BWCorePlugin.minecraftDir = (File) FMLInjectionData.data()[6]; - //do all the configuration already now... - new ConfigHandler(new Configuration(new File(new File(BWCorePlugin.minecraftDir, "config"), "bartworks.cfg"))); - BWCoreTransformer.shouldTransform[2] = false; - } - - @Override - public String[] getASMTransformerClass() { - return new String[]{BWCoreTransformer.class.getName()}; - } - - @Override - public String getModContainerClass() { - return BWCore.class.getName(); - } - - @Override - public String getSetupClass() { - return null; - } - - @Override - @SuppressWarnings("rawtypes") - public void injectData(Map data) { - if (data.get("runtimeDeobfuscationEnabled") != null) { - BWCoreTransformer.obfs = (boolean) data.get("runtimeDeobfuscationEnabled"); - } - if (data.get("coremodList") != null) { - for (Object o : (ArrayList) data.get("coremodList")) { - if (o.toString().contains("MicdoodlePlugin")) { - BWCoreTransformer.shouldTransform[2] = ConfigHandler.enabledPatches[2]; - break; - } - } - } - } - - @Override - public String getAccessTransformerClass() { - return null; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java deleted file mode 100644 index 47705042a9..0000000000 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.ASM; - -import com.github.bartimaeusnek.bartworks.util.NonNullWrappedHashSet; -import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriorityList; -import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriorityListNode; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.world.World; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -public class BWCoreStaticReplacementMethodes { - private static ThreadLocal> RECENTLYUSEDRECIPES = ThreadLocal.withInitial(AccessPriorityList::new); - - public static void clearRecentlyUsedRecipes() { - // the easiest way to ensure the cache is flushed without causing synchronization overhead - // is to just replace the whole ThreadLocal instance. - RECENTLYUSEDRECIPES = ThreadLocal.withInitial(AccessPriorityList::new); - } - - @SuppressWarnings("ALL") - public static ItemStack findCachedMatchingRecipe(InventoryCrafting inventoryCrafting, World world) { - int i = 0; - ItemStack itemstack = null; - ItemStack itemstack1 = null; - int j; - - for (j = 0; j < inventoryCrafting.getSizeInventory(); ++j) - { - ItemStack itemstack2 = inventoryCrafting.getStackInSlot(j); - - if (itemstack2 != null) - { - if (i == 0) - itemstack = itemstack2; - - if (i == 1) - itemstack1 = itemstack2; - - ++i; - } - } - - if (i == 2 && itemstack.getItem() == itemstack1.getItem() && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && itemstack.getItem().isRepairable()) { - Item item = itemstack.getItem(); - int j1 = item.getMaxDamage() - itemstack.getItemDamageForDisplay(); - int k = item.getMaxDamage() - itemstack1.getItemDamageForDisplay(); - int l = j1 + k + item.getMaxDamage() * 5 / 100; - int i1 = item.getMaxDamage() - l; - - if (i1 < 0) - i1 = 0; - - return new ItemStack(itemstack.getItem(), 1, i1); - - } else { - - IRecipe iPossibleRecipe = null; - AccessPriorityList cache = RECENTLYUSEDRECIPES.get(); - Iterator> it = cache.nodeIterator(); - - while (it.hasNext()) { - AccessPriorityListNode recipeNode = it.next(); - iPossibleRecipe = recipeNode.getELEMENT(); - - if (!iPossibleRecipe.matches(inventoryCrafting, world)) - continue; - - cache.addPrioToNode(recipeNode); - return iPossibleRecipe.getCraftingResult(inventoryCrafting); - } - - ItemStack stack = null; - - HashSet recipeSet = new NonNullWrappedHashSet<>(); - List recipeList = CraftingManager.getInstance().getRecipeList(); - - for (int k = 0; k < recipeList.size(); k++) { - IRecipe r = (IRecipe) recipeList.get(k); - if (r.matches(inventoryCrafting, world)) - recipeSet.add(r); - } - - Object[] arr = recipeSet.toArray(); - - if (arr.length == 0) - return null; - - IRecipe recipe = (IRecipe) arr[0]; - stack = recipe.getCraftingResult(inventoryCrafting); - - if (arr.length != 1) - return stack; - - if (stack != null) - cache.addLast(recipe); - - return stack; - } - } - - private BWCoreStaticReplacementMethodes() { - } - -} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java deleted file mode 100644 index 775c3fc9b1..0000000000 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.ASM; - -import net.minecraft.launchwrapper.IClassTransformer; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.tree.*; - -import java.util.Arrays; -import java.util.List; - -import static org.objectweb.asm.Opcodes.*; - -public class BWCoreTransformer implements IClassTransformer { - public static final String[] DESCRIPTIONFORCONFIG = { - "REMOVING RAIN FROM LAST MILLENIUM (EXU)", - "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", - "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS", - "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", - "PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API", - "DUCTTAPING RWG WORLDEN FAILS", - "PATCHING CRAFTING MANAGER FOR CACHING RECIPES" - // "REMOVING 12% BONUS OUTPUTS FROM GT++ SIFTER" - }; - public static final String[] CLASSESBEEINGTRANSFORMED = { - "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", - "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", - "net.minecraft.client.renderer.RenderGlobal", - "thaumcraft.common.tiles.TileWandPedestal", - "gregtech.GT_Mod", - "rwg.world.ChunkGeneratorRealistic", - "net.minecraft.item.crafting.CraftingManager" - // "gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialSifter" - }; - static boolean obfs; - - public static boolean[] shouldTransform = new boolean[BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length]; - - /** - * Made by DarkShaddow44 - */ - private static MethodNode transformThaumcraftWandPedestal(MethodNode method) { - InsnList nu = new InsnList(); - for (int j = 0; j < method.instructions.size(); j++) { - AbstractInsnNode instruction = method.instructions.get(j); - nu.add(instruction); - if (instruction.getOpcode() == INVOKEVIRTUAL) { - MethodInsnNode invokevirtual = (MethodInsnNode) instruction; - if (invokevirtual.name.equals("addVis")) { - AbstractInsnNode beginning = method.instructions.get(j - 7); - LabelNode label = new LabelNode(); - nu.insertBefore(beginning, new VarInsnNode(ALOAD, 0)); - nu.insertBefore(beginning, new FieldInsnNode(GETFIELD, "thaumcraft/common/tiles/TileWandPedestal", obfs ? "field_145850_b" : "worldObj", "Lnet/minecraft/world/World;")); - nu.insertBefore(beginning, new FieldInsnNode(GETFIELD, "net/minecraft/world/World", obfs ? "field_72995_K" : "isRemote", "Z")); - nu.insertBefore(beginning, new JumpInsnNode(IFNE, label)); - nu.add(new InsnNode(POP)); - nu.add(label); - j++; // Skip actual Pop - } - } - } - method.instructions = nu; - return method; - } - - public static byte[] transform(int id, byte[] basicClass) { - if (!BWCoreTransformer.shouldTransform[id]) { - BWCore.BWCORE_LOG.info("Patch: " + BWCoreTransformer.DESCRIPTIONFORCONFIG[id] + " is disabled, will not patch!"); - return basicClass; - } - - if (id < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length) { - BWCore.BWCORE_LOG.info(BWCoreTransformer.DESCRIPTIONFORCONFIG[id]); - ClassReader classReader = new ClassReader(basicClass); - ClassNode classNode = new ClassNode(); - classReader.accept(classNode, ClassReader.SKIP_FRAMES); - List methods = classNode.methods; - scase: - switch (id) { - case 0: { - BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - String name_deObfs = "canDoRainSnowIce"; - - String dsc_deObfs = "(Lnet/minecraft/world/chunk/Chunk;)Z"; - String dsc_Obfs = "(Lapx;)Z"; - for (int i = 0; i < methods.size(); i++) { - if (methods.get(i).name.equalsIgnoreCase(name_deObfs)) { - BWCore.BWCORE_LOG.info("Found " + name_deObfs + "! Removing!"); - methods.remove(i); - break; - } - } - BWCore.BWCORE_LOG.info("Creating new " + name_deObfs + "!"); - MethodNode nu = new MethodNode(ACC_PUBLIC, name_deObfs, - /*obfs ? dsc_Obfs :*/ dsc_deObfs, - null, - new String[0] - ); - InsnList insnList = new InsnList(); - insnList.add(new InsnNode(ICONST_0)); - insnList.add(new InsnNode(IRETURN)); - nu.instructions = insnList; - nu.maxLocals = 1; - nu.maxStack = 1; - methods.add(nu); - break; - } - case 1: { - BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - String name_deObfs = "getPossibleCreatures"; - String name_src = "func_73155_a"; - String name_Obfs = "a"; - String dsc_deObfs = "(Lnet/minecraft/entity/EnumCreatureType;III)Ljava/util/List;"; - String dsc_Obfs = "(Lsx;III)Ljava/util/List;"; - - for (int i = 0; i < methods.size(); i++) { - if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_deObfs, dsc_Obfs)) { - BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); - MethodNode toPatch = methods.get(i); - InsnList insnList = new InsnList(); - insnList.add(new InsnNode(ACONST_NULL)); - insnList.add(new InsnNode(ARETURN)); - toPatch.instructions = insnList; - toPatch.maxStack = 1; - toPatch.maxLocals = 5; - methods.set(i, toPatch); - break scase; - } - } - } - case 2: { - String name_deObfs = "renderSky"; - String name_src = "func_72714_a"; - String name_Obfs = "a"; - String dsc_universal = "(F)V"; - String field_deObfs = "locationSunPng"; - String field_src = "field_110928_i"; - BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - for (MethodNode toPatch : methods) { - if (ASMUtils.isCorrectMethod(toPatch, name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(toPatch, dsc_universal)) { - BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); - InsnList nu = new InsnList(); - LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; - - String theWorld_src = "field_72769_h"; - String renderEngine_src = "field_72770_i"; - String provider_src = "field_73011_w"; - String bindTexture_src = "func_110577_a"; - String nameFieldToPatch; - - for (int j = 0; j < toPatch.instructions.size(); j++) { - if (toPatch.instructions.get(j) instanceof FieldInsnNode && toPatch.instructions.get(j).getOpcode() == GETSTATIC && !(nameFieldToPatch = ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j)).name, field_deObfs, field_src)).isEmpty()) { - boolean useSrc = nameFieldToPatch.equals(field_src); - if (useSrc) - BWCore.BWCORE_LOG.info("Found either Optifine or Fastcraft... this patch was annoying to make compatible to them..."); - - nu.add(new VarInsnNode(ALOAD, 0)); - nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? theWorld_src : "theWorld", "Lnet/minecraft/client/multiplayer/WorldClient;")); - nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/multiplayer/WorldClient", useSrc ? provider_src : "provider", "Lnet/minecraft/world/WorldProvider;")); - nu.add(new TypeInsnNode(INSTANCEOF, "com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace")); - nu.add(new JumpInsnNode(IFEQ, LabelNodes[0])); - nu.add(new VarInsnNode(ALOAD, 0)); - nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? renderEngine_src : "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); - nu.add(new FieldInsnNode(GETSTATIC, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b", "sunTex", "Lnet/minecraft/util/ResourceLocation;")); - nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", useSrc ? bindTexture_src : "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); - nu.add(new JumpInsnNode(GOTO, LabelNodes[1])); - nu.add(LabelNodes[0]); - nu.add(new VarInsnNode(ALOAD, 0)); - nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? renderEngine_src : "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); - nu.add(new FieldInsnNode(GETSTATIC, "net/minecraft/client/renderer/RenderGlobal", useSrc ? field_src : "locationSunPng", "Lnet/minecraft/util/ResourceLocation;")); - nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", useSrc ? bindTexture_src : "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); - nu.add(LabelNodes[1]); - j++; - - } else { - if (j < toPatch.instructions.size() - 2) { - if (toPatch.instructions.get(j + 2) instanceof FieldInsnNode && toPatch.instructions.get(j + 2).getOpcode() == GETSTATIC && !ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j + 2)).name, field_deObfs, field_src).isEmpty()) - continue; - if (toPatch.instructions.get(j + 1) instanceof FieldInsnNode && toPatch.instructions.get(j + 1).getOpcode() == GETSTATIC && !ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j + 1)).name, field_deObfs, field_src).isEmpty()) - continue; - } - nu.add(toPatch.instructions.get(j)); - } - } - toPatch.instructions = nu; - break scase; - } - } - } - case 3: { - BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - String name_deObfs = "updateEntity"; - String name_src = "func_145845_h"; - String name_Obfs = "h"; - String dsc_universal = "()V"; - - for (int i = 0; i < methods.size(); i++) { - if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal, dsc_universal)) { - BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); - methods.set(i, BWCoreTransformer.transformThaumcraftWandPedestal(methods.get(i))); - break scase; - } - } - } - case 4 : { - BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - String name_deObfs = ""; - for (MethodNode toPatch : methods) { - if (ASMUtils.isCorrectMethod(toPatch, name_deObfs) && (toPatch.access & ACC_STATIC) != 0) { - BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); - InsnList nu = new InsnList(); - LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; - for (int j = 0; j < 2; j++) { - nu.add(toPatch.instructions.get(j)); - } - nu.add(new FieldInsnNode(GETSTATIC, "gregtech/api/GregTech_API", "sBeforeGTPreload", "Ljava/util/List;")); - nu.add(new TypeInsnNode(NEW, "com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload")); - nu.add(new InsnNode(DUP)); - nu.add(new MethodInsnNode(INVOKESPECIAL, "com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload", "", "()V", false)); - nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/List", "add", "(Ljava/lang/Object;)Z", true)); - nu.add(new InsnNode(POP)); - for (int j = 2; j < toPatch.instructions.size(); j++) { - nu.add(toPatch.instructions.get(j)); - } - toPatch.instructions = nu; - break scase; - } - } - } - case 5: { - BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - String name_deObfs = "getNewNoise"; - for (MethodNode toPatch : methods) { - if (ASMUtils.isCorrectMethod(toPatch, name_deObfs)) { - BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); - LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; - InsnList nu = new InsnList(); - // if (x < -28675) x %= -28675; - nu.add(new VarInsnNode(ILOAD, 2)); - nu.add(new IntInsnNode(SIPUSH, -28675)); - nu.add(new JumpInsnNode(IF_ICMPGE, LabelNodes[0])); - nu.add(new VarInsnNode(ILOAD, 2)); - nu.add(new LdcInsnNode(-28675)); - nu.add(new InsnNode(IREM)); - nu.add(new VarInsnNode(ISTORE, 2)); - nu.add(LabelNodes[0]); - // if (y < -28675) y %= -28675; - nu.add(new VarInsnNode(ILOAD, 3)); - nu.add(new IntInsnNode(SIPUSH, -28675)); - nu.add(new JumpInsnNode(IF_ICMPGE, LabelNodes[1])); - nu.add(new VarInsnNode(ILOAD, 3)); - nu.add(new LdcInsnNode(-28675)); - nu.add(new InsnNode(IREM)); - nu.add(new VarInsnNode(ISTORE, 3)); - nu.add(LabelNodes[1]); - - for (int j = 1; j < toPatch.instructions.size(); j++) { - nu.add(toPatch.instructions.get(j)); - } - - toPatch.instructions = nu; - break scase; - } - } - } - case 6: { - BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - String name_deObfs = "findMatchingRecipe"; - String name_Obfs = "a"; - String name_src = "func_82787_a"; - for (MethodNode toPatch : methods) { - if (ASMUtils.isCorrectMethod(toPatch,name_deObfs,name_Obfs,name_src)){ - toPatch.instructions = new InsnList(); - toPatch.instructions.add(new VarInsnNode(ALOAD,1)); - toPatch.instructions.add(new VarInsnNode(ALOAD,2)); - toPatch.instructions.add(new MethodInsnNode(INVOKESTATIC,"com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes","findCachedMatchingRecipe","(Lnet/minecraft/inventory/InventoryCrafting;Lnet/minecraft/world/World;)Lnet/minecraft/item/ItemStack;",false)); - toPatch.instructions.add(new InsnNode(ARETURN)); - break scase; - } - } - } - -// case 6: { -// BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); -// ((IntInsnNode) methods.get(11).instructions.get(10)).operand = 10000; -// break scase; -// } - default: { - BWCore.BWCORE_LOG.info("Could not find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - return basicClass; - } - } - - classNode.methods = methods; - ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES); - classNode.accept(classWriter); - byte[] ret = classWriter.toByteArray(); - if (Arrays.hashCode(basicClass) == Arrays.hashCode(ret)) - BWCore.BWCORE_LOG.warn("Could not patch: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - return ret; - } - return basicClass; - } - - @Override - public byte[] transform(String name, String transformedName, byte[] basicClass) { - for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) { - if (name.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i]) || transformedName.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i])) - return BWCoreTransformer.transform(i, basicClass); - } - return basicClass; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/ASMUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/ASMUtils.java new file mode 100644 index 0000000000..48a8f49d5c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/ASMUtils.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.ASM; + +import org.objectweb.asm.tree.MethodNode; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; + +public class ASMUtils { + + public static String matchAny(String toCompare, String... args) { + for (String arg : args) { + if (toCompare.equalsIgnoreCase(arg)) + return arg; + } + return ""; + } + + /** + * Call this Method twice, one time for the Descriptor and one time for the Name. + */ + public static boolean isCorrectMethod(MethodNode methodNode, String... args) { + for (String arg : args) { + if (methodNode.name.equalsIgnoreCase(arg) || methodNode.desc.equalsIgnoreCase(arg)) + return true; + } + return false; + } + + public static boolean writeClassToDisk(byte[] towrite, String Classname, String Path) { + try { + if (Path.charAt(Path.length()-1) == '/' || Path.charAt(Path.length()-1) == '\\') + Path = Path.substring(0,Path.length()-1); + OutputStream os = new FileOutputStream(new File(Path + '/' + Classname + ".class")); + os.write(towrite); + } catch (IOException e) { + e.printStackTrace(); + return false; + } + return true; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java new file mode 100644 index 0000000000..e97de8cf21 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.ASM; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import com.google.common.eventbus.EventBus; +import com.google.common.eventbus.Subscribe; +import cpw.mods.fml.common.DummyModContainer; +import cpw.mods.fml.common.LoadController; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.versioning.ArtifactVersion; +import cpw.mods.fml.common.versioning.DefaultArtifactVersion; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.ArrayList; +import java.util.List; + +import static com.github.bartimaeusnek.bartworks.ASM.BWCoreTransformer.shouldTransform; + +@SuppressWarnings("ALL") +public class BWCore extends DummyModContainer { + + public static final String BWCORE_NAME = "BartWorks ASM Core"; + public static final Logger BWCORE_LOG = LogManager.getLogger(BWCore.BWCORE_NAME); + + public BWCore() { + super(new ModMetadata()); + ModMetadata metadata = this.getMetadata(); + metadata.modId = "BWCore"; + metadata.name = BWCore.BWCORE_NAME; + metadata.version = "0.0.1"; + metadata.authorList.add("bartimaeusnek"); + metadata.dependants = this.getDependants(); + } + + @Subscribe + public void preInit(FMLPreInitializationEvent event) { + shouldTransform[0] = ConfigHandler.enabledPatches[0]; + shouldTransform[1] = ConfigHandler.enabledPatches[1]; + shouldTransform[3] = ConfigHandler.enabledPatches[3]; + shouldTransform[4] = true; + shouldTransform[5] = ConfigHandler.enabledPatches[5]; + shouldTransform[6] = ConfigHandler.enabledPatches[6]; + //shouldTransform[6] = true; + BWCore.BWCORE_LOG.info("Extra Utilities found and ASM Patch enabled? " + shouldTransform[0]); + BWCore.BWCORE_LOG.info("Thaumcraft found and ASM Patch enabled? " + shouldTransform[3]); + BWCore.BWCORE_LOG.info("RWG found and ASM Patch enabled? " + shouldTransform[5]); + } + + @Override + public List getDependants() { + List ret = new ArrayList<>(); + ret.add(new DefaultArtifactVersion("ExtraUtilities", true)); + ret.add(new DefaultArtifactVersion("Thaumcraft", true)); + ret.add(new DefaultArtifactVersion("miscutils", true)); + ret.add(new DefaultArtifactVersion("RWG", true)); + ret.add(new DefaultArtifactVersion("gregtech", true)); + ret.add(new DefaultArtifactVersion(MainMod.MOD_ID, true)); + ret.add(new DefaultArtifactVersion(BartWorksCrossmod.MOD_ID, true)); + return ret; + } + + @Override + public boolean registerBus(EventBus bus, LoadController controller) { + bus.register(this); + return true; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java new file mode 100644 index 0000000000..37a64add7c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.ASM; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import cpw.mods.fml.relauncher.FMLInjectionData; +import cpw.mods.fml.relauncher.IFMLLoadingPlugin; +import net.minecraftforge.common.config.Configuration; + +import java.io.File; +import java.util.ArrayList; +import java.util.Map; + +@IFMLLoadingPlugin.SortingIndex(Integer.MAX_VALUE)//Load as late as possible (after fastcraft/OptiFine). +@IFMLLoadingPlugin.MCVersion("1.7.10") +@IFMLLoadingPlugin.TransformerExclusions("com.github.bartimaeusnek.bartworks.ASM") +@IFMLLoadingPlugin.Name(BWCorePlugin.BWCORE_PLUGIN_NAME) +public class BWCorePlugin implements IFMLLoadingPlugin { + + public static final String BWCORE_PLUGIN_NAME = "BartWorks ASM Core Plugin"; + + public static File minecraftDir; + + public BWCorePlugin() { + //Injection Code taken from CodeChickenLib + if (BWCorePlugin.minecraftDir != null) + return;//get called twice, once for IFMLCallHook + BWCorePlugin.minecraftDir = (File) FMLInjectionData.data()[6]; + //do all the configuration already now... + new ConfigHandler(new Configuration(new File(new File(BWCorePlugin.minecraftDir, "config"), "bartworks.cfg"))); + BWCoreTransformer.shouldTransform[2] = false; + } + + @Override + public String[] getASMTransformerClass() { + return new String[]{BWCoreTransformer.class.getName()}; + } + + @Override + public String getModContainerClass() { + return BWCore.class.getName(); + } + + @Override + public String getSetupClass() { + return null; + } + + @Override + @SuppressWarnings("rawtypes") + public void injectData(Map data) { + if (data.get("runtimeDeobfuscationEnabled") != null) { + BWCoreTransformer.obfs = (boolean) data.get("runtimeDeobfuscationEnabled"); + } + if (data.get("coremodList") != null) { + for (Object o : (ArrayList) data.get("coremodList")) { + if (o.toString().contains("MicdoodlePlugin")) { + BWCoreTransformer.shouldTransform[2] = ConfigHandler.enabledPatches[2]; + break; + } + } + } + } + + @Override + public String getAccessTransformerClass() { + return null; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java new file mode 100644 index 0000000000..e4b14820c7 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.ASM; + +import com.github.bartimaeusnek.bartworks.util.NonNullWrappedHashSet; +import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriorityList; +import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriorityListNode; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.world.World; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; + +public class BWCoreStaticReplacementMethodes { + private static ThreadLocal> RECENTLYUSEDRECIPES = ThreadLocal.withInitial(AccessPriorityList::new); + + public static void clearRecentlyUsedRecipes() { + // the easiest way to ensure the cache is flushed without causing synchronization overhead + // is to just replace the whole ThreadLocal instance. + RECENTLYUSEDRECIPES = ThreadLocal.withInitial(AccessPriorityList::new); + } + + @SuppressWarnings("ALL") + public static ItemStack findCachedMatchingRecipe(InventoryCrafting inventoryCrafting, World world) { + int i = 0; + ItemStack itemstack = null; + ItemStack itemstack1 = null; + int j; + + for (j = 0; j < inventoryCrafting.getSizeInventory(); ++j) + { + ItemStack itemstack2 = inventoryCrafting.getStackInSlot(j); + + if (itemstack2 != null) + { + if (i == 0) + itemstack = itemstack2; + + if (i == 1) + itemstack1 = itemstack2; + + ++i; + } + } + + if (i == 2 && itemstack.getItem() == itemstack1.getItem() && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && itemstack.getItem().isRepairable()) { + Item item = itemstack.getItem(); + int j1 = item.getMaxDamage() - itemstack.getItemDamageForDisplay(); + int k = item.getMaxDamage() - itemstack1.getItemDamageForDisplay(); + int l = j1 + k + item.getMaxDamage() * 5 / 100; + int i1 = item.getMaxDamage() - l; + + if (i1 < 0) + i1 = 0; + + return new ItemStack(itemstack.getItem(), 1, i1); + + } else { + + IRecipe iPossibleRecipe = null; + AccessPriorityList cache = RECENTLYUSEDRECIPES.get(); + Iterator> it = cache.nodeIterator(); + + while (it.hasNext()) { + AccessPriorityListNode recipeNode = it.next(); + iPossibleRecipe = recipeNode.getELEMENT(); + + if (!iPossibleRecipe.matches(inventoryCrafting, world)) + continue; + + cache.addPrioToNode(recipeNode); + return iPossibleRecipe.getCraftingResult(inventoryCrafting); + } + + ItemStack stack = null; + + HashSet recipeSet = new NonNullWrappedHashSet<>(); + List recipeList = CraftingManager.getInstance().getRecipeList(); + + for (int k = 0; k < recipeList.size(); k++) { + IRecipe r = (IRecipe) recipeList.get(k); + if (r.matches(inventoryCrafting, world)) + recipeSet.add(r); + } + + Object[] arr = recipeSet.toArray(); + + if (arr.length == 0) + return null; + + IRecipe recipe = (IRecipe) arr[0]; + stack = recipe.getCraftingResult(inventoryCrafting); + + if (arr.length != 1) + return stack; + + if (stack != null) + cache.addLast(recipe); + + return stack; + } + } + + private BWCoreStaticReplacementMethodes() { + } + +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java new file mode 100644 index 0000000000..4ea3582bd1 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java @@ -0,0 +1,334 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.ASM; + +import net.minecraft.launchwrapper.IClassTransformer; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.tree.*; + +import java.util.Arrays; +import java.util.List; + +import static org.objectweb.asm.Opcodes.*; + +public class BWCoreTransformer implements IClassTransformer { + public static final String[] DESCRIPTIONFORCONFIG = { + "REMOVING RAIN FROM LAST MILLENIUM (EXU)", + "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", + "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS", + "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", + "PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API", + "DUCTTAPING RWG WORLDEN FAILS", + "PATCHING CRAFTING MANAGER FOR CACHING RECIPES" + // "REMOVING 12% BONUS OUTPUTS FROM GT++ SIFTER" + }; + public static final String[] CLASSESBEEINGTRANSFORMED = { + "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", + "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", + "net.minecraft.client.renderer.RenderGlobal", + "thaumcraft.common.tiles.TileWandPedestal", + "gregtech.GT_Mod", + "rwg.world.ChunkGeneratorRealistic", + "net.minecraft.item.crafting.CraftingManager" + // "gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialSifter" + }; + static boolean obfs; + + public static boolean[] shouldTransform = new boolean[BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length]; + + /** + * Made by DarkShaddow44 + */ + private static MethodNode transformThaumcraftWandPedestal(MethodNode method) { + InsnList nu = new InsnList(); + for (int j = 0; j < method.instructions.size(); j++) { + AbstractInsnNode instruction = method.instructions.get(j); + nu.add(instruction); + if (instruction.getOpcode() == INVOKEVIRTUAL) { + MethodInsnNode invokevirtual = (MethodInsnNode) instruction; + if (invokevirtual.name.equals("addVis")) { + AbstractInsnNode beginning = method.instructions.get(j - 7); + LabelNode label = new LabelNode(); + nu.insertBefore(beginning, new VarInsnNode(ALOAD, 0)); + nu.insertBefore(beginning, new FieldInsnNode(GETFIELD, "thaumcraft/common/tiles/TileWandPedestal", obfs ? "field_145850_b" : "worldObj", "Lnet/minecraft/world/World;")); + nu.insertBefore(beginning, new FieldInsnNode(GETFIELD, "net/minecraft/world/World", obfs ? "field_72995_K" : "isRemote", "Z")); + nu.insertBefore(beginning, new JumpInsnNode(IFNE, label)); + nu.add(new InsnNode(POP)); + nu.add(label); + j++; // Skip actual Pop + } + } + } + method.instructions = nu; + return method; + } + + public static byte[] transform(int id, byte[] basicClass) { + if (!BWCoreTransformer.shouldTransform[id]) { + BWCore.BWCORE_LOG.info("Patch: " + BWCoreTransformer.DESCRIPTIONFORCONFIG[id] + " is disabled, will not patch!"); + return basicClass; + } + + if (id < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length) { + BWCore.BWCORE_LOG.info(BWCoreTransformer.DESCRIPTIONFORCONFIG[id]); + ClassReader classReader = new ClassReader(basicClass); + ClassNode classNode = new ClassNode(); + classReader.accept(classNode, ClassReader.SKIP_FRAMES); + List methods = classNode.methods; + scase: + switch (id) { + case 0: { + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + String name_deObfs = "canDoRainSnowIce"; + + String dsc_deObfs = "(Lnet/minecraft/world/chunk/Chunk;)Z"; + String dsc_Obfs = "(Lapx;)Z"; + for (int i = 0; i < methods.size(); i++) { + if (methods.get(i).name.equalsIgnoreCase(name_deObfs)) { + BWCore.BWCORE_LOG.info("Found " + name_deObfs + "! Removing!"); + methods.remove(i); + break; + } + } + BWCore.BWCORE_LOG.info("Creating new " + name_deObfs + "!"); + MethodNode nu = new MethodNode(ACC_PUBLIC, name_deObfs, + /*obfs ? dsc_Obfs :*/ dsc_deObfs, + null, + new String[0] + ); + InsnList insnList = new InsnList(); + insnList.add(new InsnNode(ICONST_0)); + insnList.add(new InsnNode(IRETURN)); + nu.instructions = insnList; + nu.maxLocals = 1; + nu.maxStack = 1; + methods.add(nu); + break; + } + case 1: { + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + String name_deObfs = "getPossibleCreatures"; + String name_src = "func_73155_a"; + String name_Obfs = "a"; + String dsc_deObfs = "(Lnet/minecraft/entity/EnumCreatureType;III)Ljava/util/List;"; + String dsc_Obfs = "(Lsx;III)Ljava/util/List;"; + + for (int i = 0; i < methods.size(); i++) { + if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_deObfs, dsc_Obfs)) { + BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); + MethodNode toPatch = methods.get(i); + InsnList insnList = new InsnList(); + insnList.add(new InsnNode(ACONST_NULL)); + insnList.add(new InsnNode(ARETURN)); + toPatch.instructions = insnList; + toPatch.maxStack = 1; + toPatch.maxLocals = 5; + methods.set(i, toPatch); + break scase; + } + } + } + case 2: { + String name_deObfs = "renderSky"; + String name_src = "func_72714_a"; + String name_Obfs = "a"; + String dsc_universal = "(F)V"; + String field_deObfs = "locationSunPng"; + String field_src = "field_110928_i"; + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + for (MethodNode toPatch : methods) { + if (ASMUtils.isCorrectMethod(toPatch, name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(toPatch, dsc_universal)) { + BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); + InsnList nu = new InsnList(); + LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; + + String theWorld_src = "field_72769_h"; + String renderEngine_src = "field_72770_i"; + String provider_src = "field_73011_w"; + String bindTexture_src = "func_110577_a"; + String nameFieldToPatch; + + for (int j = 0; j < toPatch.instructions.size(); j++) { + if (toPatch.instructions.get(j) instanceof FieldInsnNode && toPatch.instructions.get(j).getOpcode() == GETSTATIC && !(nameFieldToPatch = ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j)).name, field_deObfs, field_src)).isEmpty()) { + boolean useSrc = nameFieldToPatch.equals(field_src); + if (useSrc) + BWCore.BWCORE_LOG.info("Found either Optifine or Fastcraft... this patch was annoying to make compatible to them..."); + + nu.add(new VarInsnNode(ALOAD, 0)); + nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? theWorld_src : "theWorld", "Lnet/minecraft/client/multiplayer/WorldClient;")); + nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/multiplayer/WorldClient", useSrc ? provider_src : "provider", "Lnet/minecraft/world/WorldProvider;")); + nu.add(new TypeInsnNode(INSTANCEOF, "com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace")); + nu.add(new JumpInsnNode(IFEQ, LabelNodes[0])); + nu.add(new VarInsnNode(ALOAD, 0)); + nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? renderEngine_src : "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); + nu.add(new FieldInsnNode(GETSTATIC, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b", "sunTex", "Lnet/minecraft/util/ResourceLocation;")); + nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", useSrc ? bindTexture_src : "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); + nu.add(new JumpInsnNode(GOTO, LabelNodes[1])); + nu.add(LabelNodes[0]); + nu.add(new VarInsnNode(ALOAD, 0)); + nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? renderEngine_src : "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); + nu.add(new FieldInsnNode(GETSTATIC, "net/minecraft/client/renderer/RenderGlobal", useSrc ? field_src : "locationSunPng", "Lnet/minecraft/util/ResourceLocation;")); + nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", useSrc ? bindTexture_src : "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); + nu.add(LabelNodes[1]); + j++; + + } else { + if (j < toPatch.instructions.size() - 2) { + if (toPatch.instructions.get(j + 2) instanceof FieldInsnNode && toPatch.instructions.get(j + 2).getOpcode() == GETSTATIC && !ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j + 2)).name, field_deObfs, field_src).isEmpty()) + continue; + if (toPatch.instructions.get(j + 1) instanceof FieldInsnNode && toPatch.instructions.get(j + 1).getOpcode() == GETSTATIC && !ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j + 1)).name, field_deObfs, field_src).isEmpty()) + continue; + } + nu.add(toPatch.instructions.get(j)); + } + } + toPatch.instructions = nu; + break scase; + } + } + } + case 3: { + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + String name_deObfs = "updateEntity"; + String name_src = "func_145845_h"; + String name_Obfs = "h"; + String dsc_universal = "()V"; + + for (int i = 0; i < methods.size(); i++) { + if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal, dsc_universal)) { + BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); + methods.set(i, BWCoreTransformer.transformThaumcraftWandPedestal(methods.get(i))); + break scase; + } + } + } + case 4 : { + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + String name_deObfs = ""; + for (MethodNode toPatch : methods) { + if (ASMUtils.isCorrectMethod(toPatch, name_deObfs) && (toPatch.access & ACC_STATIC) != 0) { + BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); + InsnList nu = new InsnList(); + LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; + for (int j = 0; j < 2; j++) { + nu.add(toPatch.instructions.get(j)); + } + nu.add(new FieldInsnNode(GETSTATIC, "gregtech/api/GregTech_API", "sBeforeGTPreload", "Ljava/util/List;")); + nu.add(new TypeInsnNode(NEW, "com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload")); + nu.add(new InsnNode(DUP)); + nu.add(new MethodInsnNode(INVOKESPECIAL, "com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload", "", "()V", false)); + nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/List", "add", "(Ljava/lang/Object;)Z", true)); + nu.add(new InsnNode(POP)); + for (int j = 2; j < toPatch.instructions.size(); j++) { + nu.add(toPatch.instructions.get(j)); + } + toPatch.instructions = nu; + break scase; + } + } + } + case 5: { + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + String name_deObfs = "getNewNoise"; + for (MethodNode toPatch : methods) { + if (ASMUtils.isCorrectMethod(toPatch, name_deObfs)) { + BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); + LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; + InsnList nu = new InsnList(); + // if (x < -28675) x %= -28675; + nu.add(new VarInsnNode(ILOAD, 2)); + nu.add(new IntInsnNode(SIPUSH, -28675)); + nu.add(new JumpInsnNode(IF_ICMPGE, LabelNodes[0])); + nu.add(new VarInsnNode(ILOAD, 2)); + nu.add(new LdcInsnNode(-28675)); + nu.add(new InsnNode(IREM)); + nu.add(new VarInsnNode(ISTORE, 2)); + nu.add(LabelNodes[0]); + // if (y < -28675) y %= -28675; + nu.add(new VarInsnNode(ILOAD, 3)); + nu.add(new IntInsnNode(SIPUSH, -28675)); + nu.add(new JumpInsnNode(IF_ICMPGE, LabelNodes[1])); + nu.add(new VarInsnNode(ILOAD, 3)); + nu.add(new LdcInsnNode(-28675)); + nu.add(new InsnNode(IREM)); + nu.add(new VarInsnNode(ISTORE, 3)); + nu.add(LabelNodes[1]); + + for (int j = 1; j < toPatch.instructions.size(); j++) { + nu.add(toPatch.instructions.get(j)); + } + + toPatch.instructions = nu; + break scase; + } + } + } + case 6: { + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + String name_deObfs = "findMatchingRecipe"; + String name_Obfs = "a"; + String name_src = "func_82787_a"; + for (MethodNode toPatch : methods) { + if (ASMUtils.isCorrectMethod(toPatch,name_deObfs,name_Obfs,name_src)){ + toPatch.instructions = new InsnList(); + toPatch.instructions.add(new VarInsnNode(ALOAD,1)); + toPatch.instructions.add(new VarInsnNode(ALOAD,2)); + toPatch.instructions.add(new MethodInsnNode(INVOKESTATIC,"com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes","findCachedMatchingRecipe","(Lnet/minecraft/inventory/InventoryCrafting;Lnet/minecraft/world/World;)Lnet/minecraft/item/ItemStack;",false)); + toPatch.instructions.add(new InsnNode(ARETURN)); + break scase; + } + } + } + +// case 6: { +// BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); +// ((IntInsnNode) methods.get(11).instructions.get(10)).operand = 10000; +// break scase; +// } + default: { + BWCore.BWCORE_LOG.info("Could not find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + return basicClass; + } + } + + classNode.methods = methods; + ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES); + classNode.accept(classWriter); + byte[] ret = classWriter.toByteArray(); + if (Arrays.hashCode(basicClass) == Arrays.hashCode(ret)) + BWCore.BWCORE_LOG.warn("Could not patch: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + return ret; + } + return basicClass; + } + + @Override + public byte[] transform(String name, String transformedName, byte[] basicClass) { + for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) { + if (name.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i]) || transformedName.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i])) + return BWCoreTransformer.transform(i, basicClass); + } + return basicClass; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java index f9aba701a6..0beec2c8af 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java @@ -22,7 +22,7 @@ package com.github.bartimaeusnek.bartworks.common.commands; -import com.github.bartimaeusnek.ASM.BWCoreStaticReplacementMethodes; +import com.github.bartimaeusnek.bartworks.ASM.BWCoreStaticReplacementMethodes; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 64095f5cc4..11c97e6b8e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.configs; -import com.github.bartimaeusnek.ASM.BWCoreTransformer; +import com.github.bartimaeusnek.bartworks.ASM.BWCoreTransformer; import com.github.bartimaeusnek.bartworks.API.API_ConfigValues; import net.minecraftforge.common.config.Configuration; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 6831198a56..90740455c2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -22,7 +22,7 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; -import com.github.bartimaeusnek.ASM.BWCoreStaticReplacementMethodes; +import com.github.bartimaeusnek.bartworks.ASM.BWCoreStaticReplacementMethodes; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; -- cgit From 43dde28b5afb9bd00791dcd243f66eb373efb483 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Mon, 6 Dec 2021 02:44:53 +0800 Subject: Optimize load time (#60) * Change iteration order to speedup LuVTierEnhancer cache locality, tiered memory speed and whatnot. I thought this to be the common knowledge of computer science people? * Various optimizations 1. cached reflections look up result 2. ore dict no create, and don't look into it more than necessary Former-commit-id: 475a733e37ca1b749400294d0f0326a6c55eb783 --- .../bartworks/common/loaders/BioRecipeLoader.java | 10 ++-- .../common/loaders/StaticRecipeChangeLoaders.java | 34 +++++++----- .../material/GT_Enhancement/LuVTierEnhancer.java | 63 +++++++++++----------- .../GT_Enhancement/PlatinumSludgeOverHaul.java | 17 +++--- .../bartworks/util/CachedReflectionUtils.java | 27 ++++++++++ 5 files changed, 98 insertions(+), 53 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index 686a7a0777..422285bbb4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -45,6 +45,9 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; +import java.util.ArrayList; +import java.util.List; + public class BioRecipeLoader { @SuppressWarnings("deprecation") @@ -132,9 +135,10 @@ public class BioRecipeLoader { } ); - if (LoaderReference.croploadcore && OreDictionary.getOres("cropVine").size() > 1) - for (int i = 0; i < OreDictionary.getOres("cropVine").size(); i++) { - GT_Values.RA.addExtractorRecipe(BW_Util.setStackSize(OreDictionary.getOres("cropVine").get(i),12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3)); + List oreCropVine = OreDictionary.getOres("cropVine", false); + if (LoaderReference.croploadcore && !oreCropVine.isEmpty()) + for (ItemStack stack : oreCropVine) { + GT_Values.RA.addExtractorRecipe(BW_Util.setStackSize(stack, 12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3)); } else GT_Values.RA.addExtractorRecipe(new ItemStack(Blocks.vine, 12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index c0aabd973d..f4be3df605 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -38,6 +38,7 @@ import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -135,22 +136,26 @@ public class StaticRecipeChangeLoaders { for (OrePrefixes prefixes : OrePrefixes.values()) { if (!werkstoff.hasItemType(prefixes)) continue; - if (OreDictionary.getOres(prefixes + s).size() <= 1) + String fullOreName = prefixes + s; + List ores = OreDictionary.getOres(fullOreName, false); + if (ores.isEmpty()) continue; - for (int j = 0; j < OreDictionary.getOres(prefixes + s).size(); j++) { - ItemStack toReplace = OreDictionary.getOres(prefixes + s).get(j); + for (ItemStack toReplace : ores) { ItemStack replacement = werkstoff.get(prefixes); if (toReplace == null || GT_Utility.areStacksEqual(toReplace, replacement) || replacement == null || replacement.getItem() == null) continue; for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - HashSet toRem = new HashSet<>(); - for (GT_Recipe recipe : map.mRecipeList) { - boolean removal = map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes); + nextRecipe: + for (Iterator iterator = map.mRecipeList.iterator(); iterator.hasNext(); ) { + GT_Recipe recipe = iterator.next(); + boolean removal = map.equals(GT_Recipe_Map.sFluidExtractionRecipes) || map.equals(GT_Recipe_Map.sFluidSolidficationRecipes); for (int i = 0; i < recipe.mInputs.length; i++) { if (!GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) continue; - if (removal) - toRem.add(recipe); + if (removal) { + iterator.remove(); + continue nextRecipe; + } else { int amount = recipe.mInputs[i].stackSize; recipe.mInputs[i] = BW_Util.setStackSize(replacement, amount); @@ -159,8 +164,10 @@ public class StaticRecipeChangeLoaders { for (int i = 0; i < recipe.mOutputs.length; i++) { if (!GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) continue; - if (removal) - toRem.add(recipe); + if (removal) { + iterator.remove(); + continue nextRecipe; + } else { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(replacement, amount); @@ -169,15 +176,16 @@ public class StaticRecipeChangeLoaders { if (recipe.mSpecialItems instanceof ItemStack) { if (!GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) continue; - if (removal) - toRem.add(recipe); + if (removal) { + iterator.remove(); + continue nextRecipe; + } else { int amount = ((ItemStack) recipe.mSpecialItems).stackSize; recipe.mSpecialItems = BW_Util.setStackSize(replacement, amount); } } } - map.mRecipeList.removeAll(toRem); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java index 65c677dc55..21735f43b0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -28,11 +28,11 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AfterLuVTierEnhacement; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.*; import gregtech.api.objects.ItemData; import gregtech.api.util.*; +import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; @@ -93,20 +93,25 @@ public class LuVTierEnhancer implements Runnable { private static void replaceAllRecipes(Collection LuVMachines, OrePrefixes[] LuVMaterialsGenerated, List bufferedRecipeList){ LuVTierEnhancer.replaceOsmiridiumInLuVRecipes(); - LuVMachines.stream().forEach(stack -> { - Predicate recipeFilter = obj -> obj instanceof GT_Shaped_Recipe && GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true); - - GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.forEach( - recipe -> rewriteAsslineRecipes(stack, LuVMaterialsGenerated, recipe)); - - GT_Recipe.GT_Recipe_Map.sMappings.forEach( - map -> map.mRecipeList.forEach( - recipe -> rewriteMachineRecipes(stack, LuVMaterialsGenerated, recipe))); + for (GT_Recipe_AssemblyLine sAssemblylineRecipe : GT_Recipe_AssemblyLine.sAssemblylineRecipes) { + for (ItemStack stack : LuVMachines) { + rewriteAsslineRecipes(stack, LuVMaterialsGenerated, sAssemblylineRecipe); + } + } - rewriteCraftingRecipes(bufferedRecipeList, LuVMaterialsGenerated, recipeFilter); + for (GT_Recipe_Map map : GT_Recipe_Map.sMappings) { + for (GT_Recipe recipe : map.mRecipeList) { + for (ItemStack stack : LuVMachines) { + rewriteMachineRecipes(stack, LuVMaterialsGenerated, recipe); } - ); + } + } + + for (ItemStack stack : LuVMachines) { + Predicate recipeFilter = obj -> obj instanceof GT_Shaped_Recipe && GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true); + rewriteCraftingRecipes(bufferedRecipeList, LuVMaterialsGenerated, recipeFilter); + } } private static void addDreamcraftItemListItems(Collection LuVMachines){ @@ -135,25 +140,23 @@ public class LuVTierEnhancer implements Runnable { } } - private static void rewriteMachineRecipes(ItemStack stack, OrePrefixes[] LuVMaterialsGenerated, GT_Recipe recipe){ + private static void rewriteMachineRecipes(ItemStack stack, OrePrefixes[] LuVMaterialsGenerated, GT_Recipe recipe) { + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { for (OrePrefixes prefixes : LuVMaterialsGenerated) { - if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } - if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } - } - if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); } - if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + } + if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { + for (OrePrefixes prefixes : LuVMaterialsGenerated) { + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); } + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + } } private static void rewriteAsslineRecipes(ItemStack stack, OrePrefixes[] LuVMaterialsGenerated, GT_Recipe.GT_Recipe_AssemblyLine recipe){ for (OrePrefixes prefixes : LuVMaterialsGenerated) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 41bd0aad4c..757fc9ea7b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -27,6 +27,7 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.CachedReflectionUtils; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; @@ -212,8 +213,9 @@ public class PlatinumSludgeOverHaul { //furnace for (Object entry : FurnaceRecipes.smelting().getSmeltingList().entrySet()) { Map.Entry realEntry = (Map.Entry) entry; - if (GT_Utility.isStackValid(realEntry.getKey()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getKey())) - if ((!GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dust) && !GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mPrefix.equals(dustTiny)) || !GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()).mMaterial.mMaterial.equals(Materials.Platinum)) + if (GT_Utility.isStackValid(realEntry.getKey()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getKey())) { + ItemData association = GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()); + if ((!association.mPrefix.equals(dust) && !association.mPrefix.equals(dustTiny)) || !association.mMaterial.mMaterial.equals(Materials.Platinum)) if (GT_Utility.isStackValid(realEntry.getValue()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())){ ItemData ass = GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()); if (ass.mMaterial.mMaterial.equals(Materials.Platinum)) @@ -223,6 +225,7 @@ public class PlatinumSludgeOverHaul { if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) realEntry.setValue(PDMetallicPowder.get(ass.mPrefix == nugget ? dustTiny : dust, ((ItemStack) realEntry.getValue()).stackSize * 2)); } + } } //vanilla crafting CraftingManager.getInstance().getRecipeList().forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); @@ -396,7 +399,7 @@ public class PlatinumSludgeOverHaul { else if (LoaderReference.miscutils) { try { if (Class.forName("gtPlusPlus.api.objects.minecraft.ShapedRecipe").isAssignableFrom(obj.getClass())) - obj = FieldUtils.getField(obj.getClass(),"mRecipe",true).get(obj); + obj = CachedReflectionUtils.getField(obj.getClass(),"mRecipe").get(obj); } catch (ClassNotFoundException | IllegalAccessException e) { e.printStackTrace(); } @@ -406,14 +409,14 @@ public class PlatinumSludgeOverHaul { IRecipe recipe = (IRecipe) obj; ItemStack otpt = recipe.getRecipeOutput(); - Field out = FieldUtils.getDeclaredField(recipe.getClass(), inputName, true); + Field out = CachedReflectionUtils.getDeclaredField(recipe.getClass(), inputName); if (out == null) - out = FieldUtils.getField(recipe.getClass(), inputName, true); + out = CachedReflectionUtils.getField(recipe.getClass(), inputName); - Field in = FieldUtils.getDeclaredField(recipe.getClass(), inputItemName, true); + Field in = CachedReflectionUtils.getDeclaredField(recipe.getClass(), inputItemName); if (in == null) - in = FieldUtils.getField(recipe.getClass(), inputItemName, true); + in = CachedReflectionUtils.getField(recipe.getClass(), inputItemName); if (in == null) return; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java new file mode 100644 index 0000000000..f1276c4d3d --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java @@ -0,0 +1,27 @@ +package com.github.bartimaeusnek.bartworks.util; + +import org.apache.commons.lang3.reflect.FieldUtils; + +import java.lang.reflect.Field; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; + +public class CachedReflectionUtils { + private static final ClassValue> fields = new ConcurrentMapClassValue(); + private static final ClassValue> declaredFields = new ConcurrentMapClassValue(); + + public static Field getField(final Class cls, final String fieldName) { + return fields.get(cls).computeIfAbsent(fieldName, f -> FieldUtils.getField(cls, f, true)); + } + + public static Field getDeclaredField(final Class cls, final String fieldName) { + return fields.get(cls).computeIfAbsent(fieldName, f -> FieldUtils.getDeclaredField(cls, f, true)); + } + + private static class ConcurrentMapClassValue extends ClassValue> { + @Override + protected Map computeValue(Class type) { + return new ConcurrentHashMap<>(); + } + } +} -- cgit From a4b8fd39f575b304ee2e7dc9c48dc42e7f68cb58 Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Sun, 5 Dec 2021 11:36:51 -0800 Subject: Add license (#61) Former-commit-id: 8518d39ba3d495e8b33c607c9e9495fbc1b6fd81 --- COPYING | 674 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ COPYING.LESSER | 165 ++++++++++++++ LICENSE | 11 +- 3 files changed, 849 insertions(+), 1 deletion(-) create mode 100644 COPYING create mode 100644 COPYING.LESSER diff --git a/COPYING b/COPYING new file mode 100644 index 0000000000..19d1fa01fb --- /dev/null +++ b/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +.1996 diff --git a/COPYING.LESSER b/COPYING.LESSER new file mode 100644 index 0000000000..0a041280bd --- /dev/null +++ b/COPYING.LESSER @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/LICENSE b/LICENSE index b94f54c82c..b34be33ad7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,15 @@ + +GTNH Modifications: + +LGPL v3.0 or later. See COPYING & COPYING.LESSER. Feel free to use our changes, just give back any changes you make to the community as well! + + + +Original License: + MIT License -Copyright (c) 2018-2020 +Copyright (c) bartimaeusnek 2018-2020 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal -- cgit From 9471b712e9aef672f222dcfd999683ad1a7664c5 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Tue, 7 Dec 2021 03:03:16 +0800 Subject: Fix oversight in 43dde28b5afb9bd00791dcd243f66eb373efb483 [formerly 475a733e37ca1b749400294d0f0326a6c55eb783] (#63) Former-commit-id: 6b14abb87ec60356e64997082915eee24110c4e5 --- .../bartworks/common/loaders/StaticRecipeChangeLoaders.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index f4be3df605..e843107ab8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -138,7 +138,7 @@ public class StaticRecipeChangeLoaders { continue; String fullOreName = prefixes + s; List ores = OreDictionary.getOres(fullOreName, false); - if (ores.isEmpty()) + if (ores.size() <= 1) // empty or one entry, i.e. no unification needed continue; for (ItemStack toReplace : ores) { ItemStack replacement = werkstoff.get(prefixes); -- cgit From 60dd61dc04d3edda61d619f4639722f56d089708 Mon Sep 17 00:00:00 2001 From: bombcar Date: Wed, 8 Dec 2021 08:29:20 -0600 Subject: ok (#64) Former-commit-id: 81a404d8c6b28764c9dc5630fe77286077cd3cb7 --- .../github/bartimaeusnek/bartworks/MainMod.java | 22 +- .../bartworks/util/log/STFUGTPPLOG.java | 665 --------------------- 2 files changed, 1 insertion(+), 686 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/log/STFUGTPPLOG.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index c3cc760025..8c464f2993 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -41,14 +41,11 @@ import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.log.DebugLog; -import com.github.bartimaeusnek.bartworks.util.log.STFUGTPPLOG; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -91,14 +88,6 @@ public final class MainMod { public static MainMod instance; public static BW_Network BW_Network_instance = new BW_Network(); - @SideOnly(Side.CLIENT) - private void ClientGTppWarning() { - javax.swing.JOptionPane.showMessageDialog(null, - "BartWorks was NOT meant to be played with GT++," + - " since GT++'s Multiblocks break the Platinum Processing chain. " + - "Feel free to continue, but be aware of this.","GT++ Warning", javax.swing.JOptionPane.ERROR_MESSAGE); - } - @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { @@ -109,16 +98,7 @@ public final class MainMod { LoaderReference.init(); //Check for ALL the mods. if (LoaderReference.miscutils) { - //if (SideReference.Side.Client) - //ClientGTppWarning(); - - MainMod.LOGGER.error("BartWorks was NOT meant to be played with GT++," + - " since GT++'s Multiblocks break the Platinum Processing chain. " + - "Feel free to continue, but be aware of this."); - } - - if (LoaderReference.miscutils && ConfigHandler.GTppLogDisabler) { - STFUGTPPLOG.replaceLogger(); + MainMod.LOGGER.info("Found GT++, continuing"); } if (LoaderReference.dreamcraft) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/log/STFUGTPPLOG.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/log/STFUGTPPLOG.java deleted file mode 100644 index 8199032651..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/log/STFUGTPPLOG.java +++ /dev/null @@ -1,665 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.util.log; - -import org.apache.commons.lang3.reflect.FieldUtils; -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.Marker; -import org.apache.logging.log4j.message.Message; -import org.apache.logging.log4j.message.MessageFactory; - -import java.lang.reflect.Field; - -public class STFUGTPPLOG implements Logger { - - public static void replaceLogger(){ - try { - Field loggerField = FieldUtils.getField(Class.forName("gtPlusPlus.api.objects.Logger"), "modLogger", true); - FieldUtils.removeFinalModifier(loggerField, true); - loggerField.set(null, new STFUGTPPLOG()); - } catch (IllegalAccessException | ClassNotFoundException e) { - e.printStackTrace(); - } - } - - @Override - public void catching(Level level, Throwable t) { - - } - - @Override - public void catching(Throwable t) { - - } - - @Override - public void debug(Marker marker, Message msg) { - - } - - @Override - public void debug(Marker marker, Message msg, Throwable t) { - - } - - @Override - public void debug(Marker marker, Object message) { - - } - - @Override - public void debug(Marker marker, Object message, Throwable t) { - - } - - @Override - public void debug(Marker marker, String message) { - - } - - @Override - public void debug(Marker marker, String message, Object... params) { - - } - - @Override - public void debug(Marker marker, String message, Throwable t) { - - } - - @Override - public void debug(Message msg) { - - } - - @Override - public void debug(Message msg, Throwable t) { - - } - - @Override - public void debug(Object message) { - - } - - @Override - public void debug(Object message, Throwable t) { - - } - - @Override - public void debug(String message) { - - } - - @Override - public void debug(String message, Object... params) { - - } - - @Override - public void debug(String message, Throwable t) { - - } - - @Override - public void entry() { - - } - - @Override - public void entry(Object... params) { - - } - - @Override - public void error(Marker marker, Message msg) { - - } - - @Override - public void error(Marker marker, Message msg, Throwable t) { - - } - - @Override - public void error(Marker marker, Object message) { - - } - - @Override - public void error(Marker marker, Object message, Throwable t) { - - } - - @Override - public void error(Marker marker, String message) { - - } - - @Override - public void error(Marker marker, String message, Object... params) { - - } - - @Override - public void error(Marker marker, String message, Throwable t) { - - } - - @Override - public void error(Message msg) { - - } - - @Override - public void error(Message msg, Throwable t) { - - } - - @Override - public void error(Object message) { - - } - - @Override - public void error(Object message, Throwable t) { - - } - - @Override - public void error(String message) { - - } - - @Override - public void error(String message, Object... params) { - - } - - @Override - public void error(String message, Throwable t) { - - } - - @Override - public void exit() { - - } - - @Override - public R exit(R result) { - return null; - } - - @Override - public void fatal(Marker marker, Message msg) { - - } - - @Override - public void fatal(Marker marker, Message msg, Throwable t) { - - } - - @Override - public void fatal(Marker marker, Object message) { - - } - - @Override - public void fatal(Marker marker, Object message, Throwable t) { - - } - - @Override - public void fatal(Marker marker, String message) { - - } - - @Override - public void fatal(Marker marker, String message, Object... params) { - - } - - @Override - public void fatal(Marker marker, String message, Throwable t) { - - } - - @Override - public void fatal(Message msg) { - - } - - @Override - public void fatal(Message msg, Throwable t) { - - } - - @Override - public void fatal(Object message) { - - } - - @Override - public void fatal(Object message, Throwable t) { - - } - - @Override - public void fatal(String message) { - - } - - @Override - public void fatal(String message, Object... params) { - - } - - @Override - public void fatal(String message, Throwable t) { - - } - - @Override - public MessageFactory getMessageFactory() { - return null; - } - - @Override - public String getName() { - return null; - } - - @Override - public void info(Marker marker, Message msg) { - - } - - @Override - public void info(Marker marker, Message msg, Throwable t) { - - } - - @Override - public void info(Marker marker, Object message) { - - } - - @Override - public void info(Marker marker, Object message, Throwable t) { - - } - - @Override - public void info(Marker marker, String message) { - - } - - @Override - public void info(Marker marker, String message, Object... params) { - - } - - @Override - public void info(Marker marker, String message, Throwable t) { - - } - - @Override - public void info(Message msg) { - - } - - @Override - public void info(Message msg, Throwable t) { - - } - - @Override - public void info(Object message) { - - } - - @Override - public void info(Object message, Throwable t) { - - } - - @Override - public void info(String message) { - - } - - @Override - public void info(String message, Object... params) { - - } - - @Override - public void info(String message, Throwable t) { - - } - - @Override - public boolean isDebugEnabled() { - return false; - } - - @Override - public boolean isDebugEnabled(Marker marker) { - return false; - } - - @Override - public boolean isEnabled(Level level) { - return false; - } - - @Override - public boolean isEnabled(Level level, Marker marker) { - return false; - } - - @Override - public boolean isErrorEnabled() { - return false; - } - - @Override - public boolean isErrorEnabled(Marker marker) { - return false; - } - - @Override - public boolean isFatalEnabled() { - return false; - } - - @Override - public boolean isFatalEnabled(Marker marker) { - return false; - } - - @Override - public boolean isInfoEnabled() { - return false; - } - - @Override - public boolean isInfoEnabled(Marker marker) { - return false; - } - - @Override - public boolean isTraceEnabled() { - return false; - } - - @Override - public boolean isTraceEnabled(Marker marker) { - return false; - } - - @Override - public boolean isWarnEnabled() { - return false; - } - - @Override - public boolean isWarnEnabled(Marker marker) { - return false; - } - - @Override - public void log(Level level, Marker marker, Message msg) { - - } - - @Override - public void log(Level level, Marker marker, Message msg, Throwable t) { - - } - - @Override - public void log(Level level, Marker marker, Object message) { - - } - - @Override - public void log(Level level, Marker marker, Object message, Throwable t) { - - } - - @Override - public void log(Level level, Marker marker, String message) { - - } - - @Override - public void log(Level level, Marker marker, String message, Object... params) { - - } - - @Override - public void log(Level level, Marker marker, String message, Throwable t) { - - } - - @Override - public void log(Level level, Message msg) { - - } - - @Override - public void log(Level level, Message msg, Throwable t) { - - } - - @Override - public void log(Level level, Object message) { - - } - - @Override - public void log(Level level, Object message, Throwable t) { - - } - - @Override - public void log(Level level, String message) { - - } - - @Override - public void log(Level level, String message, Object... params) { - - } - - @Override - public void log(Level level, String message, Throwable t) { - - } - - @Override - public void printf(Level level, Marker marker, String format, Object... params) { - - } - - @Override - public void printf(Level level, String format, Object... params) { - - } - - @Override - public T throwing(Level level, T t) { - return null; - } - - @Override - public T throwing(T t) { - return null; - } - - @Override - public void trace(Marker marker, Message msg) { - - } - - @Override - public void trace(Marker marker, Message msg, Throwable t) { - - } - - @Override - public void trace(Marker marker, Object message) { - - } - - @Override - public void trace(Marker marker, Object message, Throwable t) { - - } - - @Override - public void trace(Marker marker, String message) { - - } - - @Override - public void trace(Marker marker, String message, Object... params) { - - } - - @Override - public void trace(Marker marker, String message, Throwable t) { - - } - - @Override - public void trace(Message msg) { - - } - - @Override - public void trace(Message msg, Throwable t) { - - } - - @Override - public void trace(Object message) { - - } - - @Override - public void trace(Object message, Throwable t) { - - } - - @Override - public void trace(String message) { - - } - - @Override - public void trace(String message, Object... params) { - - } - - @Override - public void trace(String message, Throwable t) { - - } - - @Override - public void warn(Marker marker, Message msg) { - - } - - @Override - public void warn(Marker marker, Message msg, Throwable t) { - - } - - @Override - public void warn(Marker marker, Object message) { - - } - - @Override - public void warn(Marker marker, Object message, Throwable t) { - - } - - @Override - public void warn(Marker marker, String message) { - - } - - @Override - public void warn(Marker marker, String message, Object... params) { - - } - - @Override - public void warn(Marker marker, String message, Throwable t) { - - } - - @Override - public void warn(Message msg) { - - } - - @Override - public void warn(Message msg, Throwable t) { - - } - - @Override - public void warn(Object message) { - - } - - @Override - public void warn(Object message, Throwable t) { - - } - - @Override - public void warn(String message) { - - } - - @Override - public void warn(String message, Object... params) { - - } - - @Override - public void warn(String message, Throwable t) { - - } -} -- cgit From d1e2793ae5161a3b8576af7dfa92b5b77e7a268d Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Wed, 8 Dec 2021 22:34:46 +0800 Subject: Add circuit programmer as a tool to reprogram circuits with infinite durability (#62) Former-commit-id: 2e3051c7bafd1c934d82ef48ec65d948a0b5e6eb --- .../bartworks/common/items/Circuit_Programmer.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index b2f633c105..c65f9c42ad 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.items.GT_Generic_Item; import ic2.api.item.ElectricItem; @@ -42,12 +43,21 @@ import java.util.List; public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem { + private static final int COST_PER_USE = 100; + public Circuit_Programmer() { super("BWCircuitProgrammer", "Circuit Programmer", "Programs Integrated Circuits"); this.setMaxStackSize(1); this.setNoRepair(); this.setHasSubtypes(false); this.setCreativeTab(MainMod.BWT); + GregTech_API.registerCircuitProgrammer( + s -> s.getItem() instanceof Circuit_Programmer && ElectricItem.manager.canUse(s, COST_PER_USE), + (s, p) -> { + ElectricItem.manager.use(s, COST_PER_USE, p); + return s; + } + ); } @Override @@ -61,7 +71,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem @Override public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { - if (ElectricItem.manager.use(aStack, 100, aPlayer)) { + if (ElectricItem.manager.use(aStack, COST_PER_USE, aPlayer)) { aPlayer.openGui(MainMod.instance, 1, aWorld, 0, 0, 0); } return aStack; -- cgit From 011fc70d31e9883b990d80374f6c487eefe37495 Mon Sep 17 00:00:00 2001 From: GlodBlock <60341015+GlodBlock@users.noreply.github.com> Date: Thu, 9 Dec 2021 18:52:03 +0800 Subject: add full dust recipe in plat-line (#65) * add full dust recipe in plat-line * fix derp Former-commit-id: d30ee1ba8c33eee34820e5e66d5a4a52320abb70 --- .../material/GT_Enhancement/PlatinumSludgeOverHaul.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 757fc9ea7b..6d6f695ae7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -98,18 +98,22 @@ public class PlatinumSludgeOverHaul { for (Werkstoff w : Werkstoff.werkstoffHashSet) if (w.containsStuff(Materials.Sulfur) && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); - GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny), 250); + GT_Values.RA.addChemicalRecipe(w.get(crushedPurified, 9), GT_Utility.getIntegratedCircuit(9), AquaRegia.getFluidOrGas(1350), PTConcentrate.getFluidOrGas(1350), null, 2250); + GT_Values.RA.addChemicalRecipe(w.get(crushedPurified, 9), PTMetallicPowder.get(dust, 9), AquaRegia.getFluidOrGas(10350), PTConcentrate.getFluidOrGas(10350), PTResidue.get(dust), 2250); } for (Materials m : Materials.values()) if (PlatinumSludgeOverHaul.materialsContains(m, Materials.Sulfur) && (PlatinumSludgeOverHaul.materialsContains(m, Materials.Copper) || PlatinumSludgeOverHaul.materialsContains(m, Materials.Nickel))) { GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); - GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), PTMetallicPowder.get(dust), AquaRegia.getFluidOrGas(1150), PTConcentrate.getFluidOrGas(1150), PTResidue.get(dustTiny), 250); + GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 9), GT_Utility.getIntegratedCircuit(9), AquaRegia.getFluidOrGas(1350), PTConcentrate.getFluidOrGas(1350), null, 2250); + GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 9), PTMetallicPowder.get(dust, 9), AquaRegia.getFluidOrGas(10350), PTConcentrate.getFluidOrGas(10350), PTResidue.get(dust), 2250); } //Pt GT_Values.RA.addBlastRecipe(PTMetallicPowder.get(dust, 3), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Platinum.getNuggets(2), null, 600, 120, Materials.Platinum.mMeltingPoint); GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); - GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2),null, AmmoniumChloride.getFluidOrGas(200), PDAmmonia.getFluidOrGas(200), PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); + GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust, 9), GT_Utility.getIntegratedCircuit(9), AquaRegia.getFluidOrGas(9000), PTConcentrate.getFluidOrGas(9000), PTResidue.get(dust), 2250); + GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2), null, AmmoniumChloride.getFluidOrGas(200), PDAmmonia.getFluidOrGas(200), PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); + //GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,18), GT_Utility.getIntegratedCircuit(9), AmmoniumChloride.getFluidOrGas(1800), PDAmmonia.getFluidOrGas(1800), PTSaltCrude.get(dust, 16), PTRawPowder.get(dust,2), Materials.NitrogenDioxide.getCells(9), Materials.DilutedSulfuricAcid.getCells(9), null, null, null, 1400, 240); GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(1)}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(200)}, new FluidStack[]{PDAmmonia.getFluidOrGas(200), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2)}, 1200, 30); GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, new FluidStack[]{PTConcentrate.getFluidOrGas(18000), AmmoniumChloride.getFluidOrGas(1800)}, new FluidStack[]{PDAmmonia.getFluidOrGas(1800), Materials.NitrogenDioxide.getGas(9000),Materials.DilutedSulfuricAcid.getFluid(9000)}, new ItemStack[]{PTSaltCrude.get(dust, 16), PTRawPowder.get(dust,2)}, 1400, 240); GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ @@ -130,6 +134,7 @@ public class PlatinumSludgeOverHaul { //Pd GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), PDAmmonia.getFluidOrGas(1000), null, 250); GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dustTiny, 16), PDRawPowder.get(dustTiny, 2), 250); + GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust, 9), GT_Utility.getIntegratedCircuit(9), PDAmmonia.getFluidOrGas(9000), null, PDSalt.get(dust, 16), PDRawPowder.get(dust, 2), 2250); GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), null, PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dust), 250); GT_Values.RA.addSifterRecipe(PDSalt.get(dust), new ItemStack[]{ PDMetallicPowder.get(dust), -- cgit From b167f9ee9860a0123068e962d01939315a918d88 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Sat, 11 Dec 2021 04:37:50 +0800 Subject: turbine compact for BW material (#67) * add full dust recipe in plat-line * fix derp * turbine compact for BW material Former-commit-id: 48010f4899be5848a6961a471307328a1f309265 --- .../bartworks/system/material/Werkstoff.java | 1 + .../bartworks/system/material/WerkstoffLoader.java | 1 + .../material/werkstoff_loaders/recipe/ToolLoader.java | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 26af91d878..7ca4af3b6a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -569,6 +569,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadHammer, 0b10000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadWrench, 0b10000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadSaw, 0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.turbineBlade, 0b10000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.screw, 0b100000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.gearGt, 0b100000000); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 593c48dcd9..8f78b1d46d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1683,6 +1683,7 @@ public class WerkstoffLoader { WerkstoffLoader.items.put(toolHeadWrench, new BW_MetaGenerated_Items(toolHeadWrench)); WerkstoffLoader.items.put(toolHeadHammer, new BW_MetaGenerated_Items(toolHeadHammer)); WerkstoffLoader.items.put(toolHeadSaw, new BW_MetaGenerated_Items(toolHeadSaw)); + WerkstoffLoader.items.put(turbineBlade, new BW_MetaGenerated_Items(turbineBlade)); } if ((WerkstoffLoader.toGenerateGlobal & 0b100000000) != 0) { WerkstoffLoader.items.put(gearGt, new BW_MetaGenerated_Items(gearGt)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java index 734aae09bf..adac18c27c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java @@ -24,9 +24,7 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.rec import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; -import gregtech.api.enums.Dyes; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; +import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.common.GT_Proxy; @@ -67,6 +65,7 @@ public class ToolLoader implements IWerkstoffRunnable { GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SAW, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), new Object[]{toolHeadSaw.get(werkstoff.getBridgeMaterial()), stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.AnyRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_LV_Lithium.get(1L)}); + if (gtnhGT) { GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SOLDERING_IRON_MV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.AnyRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_MV_Lithium.get(1L)}); GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SOLDERING_IRON_HV, 1, werkstoff.getBridgeMaterial(), Materials.StyreneButadieneRubber, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.StyreneButadieneRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_HV_Lithium.get(1L)}); @@ -102,6 +101,16 @@ public class ToolLoader implements IWerkstoffRunnable { GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"II ", "IIh", "II ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', ingot.get(werkstoff.getBridgeMaterial())}); + if (werkstoff.hasItemType(plateDouble)) { + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(turbineBlade, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"fPd", "SPS", " P ", 'P', plateDouble.get(werkstoff.getBridgeMaterial()), 'S', screw.get(werkstoff.getBridgeMaterial())}); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 6), ItemList.Shape_Extruder_Turbine_Blade.get(0), werkstoff.get(turbineBlade, 1), (int) werkstoff.getStats().getMass() / 2 * 20, 120); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Turbine_Blade.get(0), werkstoff.getMolten(864), werkstoff.get(turbineBlade, 1), (int) werkstoff.getStats().getMass() * 20, 120); + GT_Values.RA.addFormingPressRecipe(werkstoff.get(plateDouble, 3), werkstoff.get(screw, 2), werkstoff.get(turbineBlade, 1), (int) werkstoff.getStats().getMass() / 4 * 20, 30); + GT_Values.RA.addAssemblerRecipe(werkstoff.get(turbineBlade, 4), GT_OreDictUnificator.get(stickLong, Materials.Magnalium, 1), GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_SMALL, 1, werkstoff.getBridgeMaterial(), Materials.Magnalium, null), 160, 100); + GT_Values.RA.addAssemblerRecipe(werkstoff.get(turbineBlade, 8), GT_OreDictUnificator.get(stickLong, Materials.Titanium, 1), GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, null), 320, 400); + GT_Values.RA.addAssemblerRecipe(werkstoff.get(turbineBlade, 12), GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 1), GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_LARGE, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, null), 640, 1600); + GT_Values.RA.addAssemblerRecipe(werkstoff.get(turbineBlade, 16), GT_OreDictUnificator.get(stickLong, Materials.Americium, 1), GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_HUGE, 1, werkstoff.getBridgeMaterial(), Materials.Americium, null), 1280, 6400); + } if (!werkstoff.hasItemType(gem)) { GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"PP ", "fh ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', ingot.get(werkstoff.getBridgeMaterial())}); -- cgit From ce50964f714e363c4ea72bfd2899fafbc363c12b Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Sun, 12 Dec 2021 23:28:21 +0800 Subject: Fix unification caching ItemStack where it should not (#69) Former-commit-id: 7ad3064608f2f56f3d842d97a9bc5df9309ad4c4 --- .../common/loaders/StaticRecipeChangeLoaders.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index e843107ab8..94bfb4c584 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -156,10 +156,7 @@ public class StaticRecipeChangeLoaders { iterator.remove(); continue nextRecipe; } - else { - int amount = recipe.mInputs[i].stackSize; - recipe.mInputs[i] = BW_Util.setStackSize(replacement, amount); - } + recipe.mInputs[i] = GT_Utility.copyAmount(recipe.mInputs[i].stackSize, replacement); } for (int i = 0; i < recipe.mOutputs.length; i++) { if (!GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) @@ -168,22 +165,17 @@ public class StaticRecipeChangeLoaders { iterator.remove(); continue nextRecipe; } - else { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util.setStackSize(replacement, amount); - } + recipe.mOutputs[i] = GT_Utility.copyAmount(recipe.mOutputs[i].stackSize, replacement); } if (recipe.mSpecialItems instanceof ItemStack) { - if (!GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) + ItemStack specialItemStack = (ItemStack) recipe.mSpecialItems; + if (!GT_Utility.areStacksEqual(specialItemStack, toReplace)) continue; if (removal) { iterator.remove(); continue nextRecipe; } - else { - int amount = ((ItemStack) recipe.mSpecialItems).stackSize; - recipe.mSpecialItems = BW_Util.setStackSize(replacement, amount); - } + recipe.mSpecialItems = GT_Utility.copyAmount((specialItemStack).stackSize, replacement); } } } -- cgit From e9a9ffe767d617f47a8376e268f0d438b132f78f Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Tue, 14 Dec 2021 00:22:04 +0800 Subject: Fix wildcard (#70) * add full dust recipe in plat-line * fix derp * turbine compact for BW material * fix wildcard stuff * remove log Former-commit-id: 8fa6886bf8c1cac10036c70a51328f52fbdef71f --- .../bartworks/util/RecipeFinderForParallel.java | 35 ++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java index ab2fd8976a..bce9676001 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java @@ -1,5 +1,6 @@ package com.github.bartimaeusnek.bartworks.util; +import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; @@ -29,7 +30,17 @@ public class RecipeFinderForParallel { } } for (int tItem : tCompressedItemRecipe.keySet()) { - if (tCompressedItemInput.containsKey(tItem) && tCompressedItemRecipe.get(tItem) != 0) { + /*Wildcard Stuff*/ + if (tItem >> 16 == Short.MAX_VALUE) { + int tCountWildcard = 0; + for (int tInputItem : tCompressedItemInput.keySet()) { + if ((tInputItem & 0xffff) == (tItem & 0xffff)) { + tCountWildcard += tCompressedItemInput.get(tInputItem); + } + } + tCurrentPara = Math.min(tCurrentPara, tCountWildcard / tCompressedItemRecipe.get(tItem)); + } + else if (tCompressedItemInput.containsKey(tItem) && tCompressedItemRecipe.get(tItem) != 0) { tCurrentPara = Math.min(tCurrentPara, tCompressedItemInput.get(tItem) / tCompressedItemRecipe.get(tItem)); } } @@ -47,7 +58,7 @@ public class RecipeFinderForParallel { if (tFluid != null && tCompressedFluidRecipe.containsKey(tFluid.getFluidID())) { if (tFluid.amount >= tCompressedFluidRecipe.get(tFluid.getFluidID())) { tFluid.amount -= tCompressedFluidRecipe.get(tFluid.getFluidID()); - tCompressedItemRecipe.remove(tFluid.getFluidID()); + tCompressedFluidRecipe.remove(tFluid.getFluidID()); } else { tCompressedFluidRecipe.put(tFluid.getFluidID(), tCompressedFluidRecipe.get(tFluid.getFluidID()) - tFluid.amount); @@ -68,6 +79,26 @@ public class RecipeFinderForParallel { } } } + /*Wildcard Stuff*/ + for (int tItem : tCompressedItemRecipe.keySet()) { + if (tItem >> 16 == Short.MAX_VALUE) { + for (ItemStack tInputItem : aItemStacks) { + int InputID = GT_Utility.stackToInt(tInputItem); + if ((InputID & 0xffff) == (tItem & 0xffff)) { + if (tInputItem.stackSize >= tCompressedItemRecipe.get(tItem)) { + tInputItem.stackSize -= tCompressedItemRecipe.get(tItem); + tCompressedItemRecipe.remove(tItem); + break; + } + else { + tCompressedItemRecipe.put(tItem, tCompressedItemRecipe.get(tItem) - tInputItem.stackSize); + tInputItem.stackSize = 0; + } + } + } + } + } + return tCurrentPara; } -- cgit From 9d091aa47ee71ddd6dc21b387bbd865fd54fcc4f Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Mon, 20 Dec 2021 02:02:09 +0800 Subject: fix energy drain logic (#72) fix https://github.com/GTNewHorizons/Dupes-Exploits-GTNH/issues/19 Former-commit-id: c6803ac0d09a412e6afcb8f41a09888321d759fa --- .../bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java index bc28090155..735b7dbe53 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java @@ -79,18 +79,20 @@ public class TecTechUtils { if (allTheEu < aEU) return false; + if (hatches == 0) return false; + long euperhatch = aEU / hatches; - boolean hasDrained = false; + boolean hasDrained = true; for (GT_MetaTileEntity_Hatch_Energy tHatch : multi.getVanillaEnergyHatches()) - hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); + hasDrained &= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : multi.getTecTechEnergyTunnels()) - hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); + hasDrained &= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : multi.getTecTechEnergyMultis()) - hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); + hasDrained &= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); return hasDrained && (multi.getVanillaEnergyHatches().size() > 0 || multi.getTecTechEnergyTunnels().size() > 0 || multi.getTecTechEnergyMultis().size() > 0); } @@ -146,4 +148,4 @@ public class TecTechUtils { public static long getEUPerTickFromLaser(GT_MetaTileEntity_Hatch_EnergyTunnel tHatch) { return tHatch.Amperes * tHatch.maxEUInput() - (tHatch.Amperes / 20); } -} \ No newline at end of file +} -- cgit From b75bfc3317dfd2f8fc91a986ea9c8c6d142688cc Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Mon, 20 Dec 2021 02:02:18 +0800 Subject: multi amps support for mega DT (#71) Former-commit-id: 6a4ddd86b3805c242742f36754540ea65a622561 --- .../mega/GT_TileEntity_MegaBlastFurnace.java | 1 + .../mega/GT_TileEntity_MegaDistillTower.java | 54 +++++++++++++++++++++- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 1 + 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 6737431662..e1965cc90c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -397,6 +397,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl if (this.mHeatingCapacity >= tRecipe.mSpecialValue) { int tCurrentPara = handleParallelRecipe(tRecipe, tFluids, tInputs, (int) tMaxPara); + if (tCurrentPara <= 0) return false; processed = tCurrentPara; found_Recipe = true; Pair, ArrayList> Outputs = getMultiOutput(tRecipe, tCurrentPara); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 4604f2d230..cb3f7a77ad 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -22,16 +22,21 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.*; +import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; +import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -50,7 +55,8 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_DistillationTower { +@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) +public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_DistillationTower implements TecTechEnabledMulti{ private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][]{ {"bbbbbbb~bbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb"}, @@ -132,6 +138,10 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati // -1 => maybe top, maybe not, 0 => definitely not top, 1 => definitely top private int mTopState = -1; + @SuppressWarnings("rawtypes") + public ArrayList TTTunnels = new ArrayList<>(); + @SuppressWarnings("rawtypes") + public ArrayList TTMultiAmp = new ArrayList<>(); public GT_TileEntity_MegaDistillTower(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -174,8 +184,19 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati return (IStructureDefinition) STRUCTURE_DEFINITION; } + @Override + public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (LoaderReference.tectech) + return TecTechUtils.addEnergyInputToMachineList(this, aTileEntity, aBaseCasingIndex); + return super.addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); + } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + if (LoaderReference.tectech) { + this.getTecTechEnergyMultis().clear(); + this.getTecTechEnergyTunnels().clear(); + } // reset mOutputHatchesByLayer.forEach(List::clear); mHeight = 1; @@ -224,7 +245,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati long tVoltage = this.getMaxInputVoltage(); byte tTier = (byte) Math.max(0, Math.min(GT_Utility.getTier(tVoltage), V.length - 1)); - long nominalV = BW_Util.getnominalVoltage(this); + long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); if (tFluids.length > 0) { for (FluidStack tFluid : tFluids) { @@ -280,6 +301,35 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati @Override public boolean drainEnergyInput(long aEU) { + if (LoaderReference.tectech) + return TecTechUtils.drainEnergyMEBFTecTech(this, aEU); return MegaUtils.drainEnergyMegaVanilla(this, aEU); } + + @Override + public long getMaxInputVoltage() { + if (LoaderReference.tectech) + return TecTechUtils.getMaxInputVoltage(this); + return super.getMaxInputVoltage(); + } + + @Override + @Optional.Method(modid = "tectech") + public List getVanillaEnergyHatches() { + return this.mEnergyHatches; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + @Optional.Method(modid = "tectech") + public List getTecTechEnergyTunnels() { + return TTTunnels; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + @Optional.Method(modid = "tectech") + public List getTecTechEnergyMultis() { + return TTMultiAmp; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 8a968094d3..95f5c0f036 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -115,6 +115,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre found_Recipe = true; long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); + if (tCurrentPara <= 0) return false; processed = tCurrentPara; Pair, ArrayList> Outputs = getMultiOutput(tRecipe, tCurrentPara); outputFluids = Outputs.getKey(); -- cgit From ac55957510cd85869aa1ff33da685fc4def22f34 Mon Sep 17 00:00:00 2001 From: Johann Bernhardt Date: Tue, 21 Dec 2021 11:25:45 +0100 Subject: Resolve todos in dependencies (#73) * Resolve todos in dependencies * Add transitive protection Former-commit-id: 887bb2a2bf374263daf60d8b6334418efe40b8fc --- build.gradle | 173 +++++++++++++++------ dependencies.gradle | 9 +- ...-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id | 1 - 3 files changed, 126 insertions(+), 57 deletions(-) delete mode 100644 dependencies/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id diff --git a/build.gradle b/build.gradle index a380f6c76f..43dfa37748 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: ffe7b130f98fdfa1ac7c6ba4bd34722a55ab28d4 +//version: 8fa7883b6196c1765266f4e6ddf3118d5043aafb /* DO NOT CHANGE THIS FILE! @@ -42,6 +42,7 @@ plugins { 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' @@ -87,33 +88,27 @@ checkPropertyExists("containsMixinsAndOrCoreModOnly") checkPropertyExists("usesShadowedDependencies") checkPropertyExists("developmentEnvironmentUserName") -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/SinTh0r4s/ExampleMod1.7.10/blob/main/gradle.properties") - } -} - String javaSourceDir = "src/main/java/" String scalaSourceDir = "src/main/scala/" String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") -if((new File(targetPackageJava).exists() || new File(targetPackageScala).exists()) == false) { +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((new File(targetPackageJava).exists() || new File(targetPackageScala).exists()) == false) { + 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(new File(targetFile).exists() == false) { + if(getFile(targetFile).exists() == false) { throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) } } @@ -125,14 +120,14 @@ if(usesMixins.toBoolean()) { targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/") targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/") - if((new File(targetPackageJava).exists() || new File(targetPackageScala).exists()) == false) { + 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((new File(targetFileJava).exists() || new File(targetFileScala).exists() || new File(targetFileScalaJava).exists()) == false) { + 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) } } @@ -141,7 +136,7 @@ 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((new File(targetFileJava).exists() || new File(targetFileScala).exists() || new File(targetFileScalaJava).exists()) == false) { + 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) } } @@ -163,8 +158,14 @@ try { catch (Exception e) { throw new IllegalStateException("This mod must be version controlled by Git AND the repository must provide at least one tag!"); } + group = modGroup -archivesBaseName = modId +if(project.hasProperty("customArchiveBaseName") && customArchiveBaseName) { + archivesBaseName = customArchiveBaseName +} +else { + archivesBaseName = modId +} minecraft { version = minecraftVersion + "-" + forgeVersion + "-" + minecraftVersion @@ -194,7 +195,9 @@ if(file("addon.gradle").exists()) { apply from: 'repositories.gradle' configurations { - implementation.extendsFrom(shadowImplementation) + implementation.extendsFrom(shadowImplementation) // TODO: remove after all uses are refactored + implementation.extendsFrom(shadowCompile) + implementation.extendsFrom(shadeCompile) } repositories { @@ -240,7 +243,7 @@ def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg" task generateAssets { if(usesMixins.toBoolean()) { - new File(projectDir.toString() + "/src/main/resources/", "mixins." + modId + ".json").text = """{ + getFile("/src/main/resources/mixins." + modId + ".json").text = """{ "required": true, "minVersion": "0.7.11", "package": "${modGroup}.${mixinsPackage}", @@ -260,16 +263,28 @@ task relocateShadowJar(type: ConfigureShadowRelocation) { } 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] + 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()) } @@ -343,31 +358,31 @@ tasks.withType(JavaExec).configureEach { } 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 - } +{ + // this will ensure that this task is redone when the versions change. + inputs.property "version", project.version + inputs.property "mcversion", project.minecraft.version - if(usesMixins.toBoolean()) { - from refMap - } + // replace stuff in mcmod.info, nothing else + from(sourceSets.main.resources.srcDirs) { + include 'mcmod.info' - // copy everything else, thats not the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude '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 = [:] @@ -400,6 +415,12 @@ task sourcesJar(type: Jar) { } 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") @@ -408,7 +429,7 @@ task shadowDevJar(type: ShadowJar) { } minimize() // This will only allow shading for actually used classes - configurations = [project.configurations.shadowImplementation] + configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile] } task relocateShadowDevJar(type: ConfigureShadowRelocation) { @@ -423,6 +444,12 @@ task circularResolverJar(type: Jar) { } 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") @@ -438,11 +465,11 @@ task devJar(type: Jar) { task apiJar(type: Jar) { from (sourceSets.main.allJava) { - include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString() + '/**' + include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**' } from (sourceSets.main.output) { - include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString() + '/**' + include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**' } from (sourceSets.main.resources.srcDirs) { @@ -460,18 +487,50 @@ artifacts { } } +// publishing +publishing { + publications { + maven(MavenPublication) { + artifact source: jar + artifact source: sourcesJar, classifier: "src" + artifact source: devJar, classifier: "dev" + if (apiPackage) { + artifact source: apiJar, classifier: "api" + } + + groupId = System.getenv("ARTIFACT_GROUP_ID") ?: group + artifactId = System.getenv("ARTIFACT_ID") ?: project.name + version = System.getenv("ARTIFACT_VERSION") ?: project.version + } + } + + repositories { + maven { + String owner = System.getenv("REPOSITORY_OWNER") ?: "Unknown" + String repositoryName = System.getenv("REPOSITORY_NAME") ?: "Unknown" + String githubRepositoryUrl = "https://maven.pkg.github.com/$owner/$repositoryName" + name = "GitHubPackages" + url = githubRepositoryUrl + credentials { + username = System.getenv("GITHUB_ACTOR") ?: "NONE" + password = System.getenv("GITHUB_TOKEN") ?: "NONE" + } + } + } +} + // Updating task updateBuildScript { doLast { - if (updateBuildScript()) return + if (performBuildScriptUpdate(projectDir.toString())) return print("Build script already up-to-date!") } } -if (isNewBuildScriptVersionAvailable()) { +if (isNewBuildScriptVersionAvailable(projectDir.toString())) { if (autoUpdateBuildScript.toBoolean()) { - updateBuildScript() + performBuildScriptUpdate(projectDir.toString()) } else { println("Build script update available! Run 'gradle updateBuildScript'") } @@ -481,9 +540,9 @@ static URL availableBuildScriptUrl() { new URL("https://raw.githubusercontent.com/SinTh0r4s/ExampleMod1.7.10/main/build.gradle") } -static boolean updateBuildScript() { - if (isNewBuildScriptVersionAvailable()) { - def buildscriptFile = new File("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 @@ -491,10 +550,10 @@ static boolean updateBuildScript() { return false } -static boolean isNewBuildScriptVersionAvailable() { +boolean isNewBuildScriptVersionAvailable(String projectDir) { Map parameters = ["connectTimeout": 2000, "readTimeout": 2000] - String currentBuildScript = new File("build.gradle").getText() + String currentBuildScript = getFile("build.gradle").getText() String currentBuildScriptHash = getVersionHash(currentBuildScript) String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText() String availableBuildScriptHash = getVersionHash(availableBuildScript) @@ -515,3 +574,15 @@ 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/SinTh0r4s/ExampleMod1.7.10/blob/main/gradle.properties") + } +} + +def getFile(String relativePath) { + return new File(projectDir, relativePath) +} diff --git a/dependencies.gradle b/dependencies.gradle index a9bb02f4e8..29aaa18377 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,9 +1,10 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GalacticGregGT5:master-SNAPSHOT:dev") - - compile files("dependencies/TecTech-1.7.10-4.10.4-local-b6491dd.jar") + compile("com.github.GTNewHorizons:TecTech:master-SNAPSHOT:dev") + compile("com.github.GTNewHorizons:GalacticGregGT5:master-SNAPSHOT:dev") { + exclude group:"com.github.GTNewHorizons", module:"bartworks" + } compileOnly("com.github.GTNewHorizons:AppleCore:master-SNAPSHOT:dev") { transitive = false @@ -27,6 +28,4 @@ dependencies { compileOnly("com.mod-buildcraft:buildcraft:7.1.23:dev") { transitive = false } - - runtime("com.github.GTNewHorizons:Yamcl:master-SNAPSHOT:dev") } diff --git a/dependencies/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id b/dependencies/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id deleted file mode 100644 index 8f77b8280a..0000000000 --- a/dependencies/TecTech-1.7.10-4.10.4-local-b6491dd.jar.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -dc6e19622ea5e9f310bca2ea25ad5f160dc21591 \ No newline at end of file -- cgit From 31a58597483821113d747ab2630adcdb31d7cef0 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Wed, 22 Dec 2021 18:55:52 +0100 Subject: Lv acid generator (#76) * add LV acid Generator add it seperate to be backwards compatiblr (cherry picked from commit b19fe31bc87512536039844fd00e32d345d2ab1a) * change LV recipe a bit (cherry picked from commit f4790058eba3649d20308da8adac93390c712e8e) Former-commit-id: 7edcce8b8f8347963c2d37ff05154c4363ea1192 --- .../bartworks/common/loaders/ItemRegistry.java | 4 ++++ .../bartworks/common/loaders/RecipeLoader.java | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index fbb2f6320b..7666983319 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -141,6 +141,7 @@ public class ItemRegistry { public static ItemStack[] diode16A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] energyDistributor = new ItemStack[GT_Values.VN.length]; public static ItemStack[] acidGens = new ItemStack[3]; + public static ItemStack acidGensLV; public static ItemStack[] megaMachines = new ItemStack[3]; public static ItemStack dehp; public static ItemStack[] voidminer = new ItemStack[3]; @@ -204,6 +205,9 @@ public class ItemRegistry { for (int i = 0; i < 3; i++) { ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "acidgenerator" + GT_Values.VN[i + 2], StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[i + 2], i + 2).getStackForm(1); } + + ItemRegistry.acidGensLV = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 65, "acidgenerator" + GT_Values.VN[1], StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[1], + 1).getStackForm(1L); + ItemRegistry.dehp = new GT_TileEntity_DEHP(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump").getStackForm(1L); ItemRegistry.megaMachines[0] = new GT_TileEntity_MegaBlastFurnace(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, "MegaBlastFurnace", StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L); ItemRegistry.megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, "MegaVacuumFreezer", StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 70733182a1..7f7d57d330 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -320,6 +320,20 @@ public class RecipeLoader { ); } + GT_ModHandler.addCraftingRecipe( + ItemRegistry.acidGensLV, + RecipeLoader.BITSD, + new Object[]{ + "HRH", + "KCK", + "HKH", + 'H', ItemList.Battery_Hull_LV.get(1L), + 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 1L), + 'C', ItemList.Hull_LV.get(1L), + 'R', ItemList.Machine_LV_ChemicalReactor.get(1L), + } + ); + for (int i = 0; i < GT_Values.VN.length; i++) { try { Materials cable = cables[i]; -- cgit From 96d9a64c3c05d116f62296b3a3e26ecf91a4f781 Mon Sep 17 00:00:00 2001 From: YannickMG Date: Thu, 23 Dec 2021 14:04:04 -0500 Subject: Windmill fixes (#75) * Fixed windmill not using up the right amount of input items * Windmill can generate clay since clay dust can be turned back into clay. Removing the extra output makes it use the normal pulverizer recipe. Former-commit-id: c59630f4289744f4f84c6f827ad11b3f589077d8 --- .../bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index ffa44e1a88..bb7ac747ad 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -107,7 +107,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { if (tRecipe == null) return false; if (tRecipe.getOutput(0) != null) { - aStack.stackSize--; + // Decrease input stack by appropriate amount (Not always 1) + tRecipe.isRecipeInputEqual(true, null, aStack); this.mOutputItems[0] = tRecipe.getOutput(0); if (new XSTR().nextInt(2) == 0) { @@ -124,7 +125,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Sugar || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Wheat || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Wood || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Clay || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Ash || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Snow || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Stone || -- cgit From d93eed3658a7688e770647ab2d8e079e877816a0 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Thu, 23 Dec 2021 21:55:14 +0100 Subject: remove rc-blastfurnace support (#77) Former-commit-id: 2fca52ff7ed1f4196ef71aa40cd532b21635de9f --- .../bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java index 8bde7d50e2..aa580c3237 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java @@ -187,7 +187,7 @@ public class DustLoader implements IWerkstoffRunnable { GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().getMeltingVoltage(), werkstoff.getStats().getMeltingPoint()); if (werkstoff.getStats().getMeltingPoint() <= 1000) { GT_Values.RA.addPrimitiveBlastRecipe(werkstoff.get(dust), null, 9, werkstoff.get(ingot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint()); - GT_ModHandler.addRCBlastFurnaceRecipe(werkstoff.get(ingot), werkstoff.get(dust), werkstoff.getStats().getMeltingPoint()); + //GT_ModHandler.addRCBlastFurnaceRecipe(werkstoff.get(ingot), werkstoff.get(dust), werkstoff.getStats().getMeltingPoint()); } } } -- cgit From 109151216f6ba3c0109ff5f8f848c3a37d543a84 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Wed, 29 Dec 2021 20:55:23 +0800 Subject: Fix copy pasting error (#78) Former-commit-id: e3ad540439325619fd59374a65a7fd88e089355d --- .../com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java index f1276c4d3d..ed9aa6b2e8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java @@ -15,7 +15,7 @@ public class CachedReflectionUtils { } public static Field getDeclaredField(final Class cls, final String fieldName) { - return fields.get(cls).computeIfAbsent(fieldName, f -> FieldUtils.getDeclaredField(cls, f, true)); + return declaredFields.get(cls).computeIfAbsent(fieldName, f -> FieldUtils.getDeclaredField(cls, f, true)); } private static class ConcurrentMapClassValue extends ClassValue> { -- cgit From 54320d45e52134ca823d3cb8bab8d2b6c87ebdcb Mon Sep 17 00:00:00 2001 From: Elisis Date: Tue, 11 Jan 2022 23:36:39 +1100 Subject: Reserve Werkstoff ID (#79) Former-commit-id: d2490021aba4cb844786ad8104e276cf4d624d4d --- .../bartimaeusnek/bartworks/system/material/WerkstoffLoader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 8f78b1d46d..3e01365617 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -192,9 +192,10 @@ public class WerkstoffLoader { } //TODO: - //FREE ID RANGE: 11_000-28_998 + //FREE ID RANGE: 11_500-28_998 //bartimaeusnek reserved 0-10_000 //GlodBlock reserved range 10_001-10_999 + //Elisis reserved range 11_000-11_499 //bot reserved range 29_899-29_999 //Tec & basdxz reserved range 30_000-31_000 //GT Material range reserved on 31_767-32_767 -- cgit From 8a51f907736f631e97bc1800ccb5f00267d62194 Mon Sep 17 00:00:00 2001 From: bombcar Date: Mon, 17 Jan 2022 10:00:16 -0600 Subject: add non tiny recipe (#80) Former-commit-id: a98e3a13482d32b80654264ad3a39adb5abdf1a9 --- build.gradle | 4 ++-- .../system/material/GT_Enhancement/PlatinumSludgeOverHaul.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 43dfa37748..e466de0fd5 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 8fa7883b6196c1765266f4e6ddf3118d5043aafb +//version: 1641429628 /* DO NOT CHANGE THIS FILE! @@ -32,7 +32,7 @@ buildscript { } } dependencies { - classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.4' + classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.5' } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 6d6f695ae7..90494ec1fa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -181,6 +181,7 @@ public class PlatinumSludgeOverHaul { //Rh GT_Values.RA.addChemicalRecipe(RHSulfate.get(cell, 11), GT_Utility.getIntegratedCircuit(1), Materials.Water.getFluid(10000), Materials.Potassium.getMolten(2000), RHSulfateSolution.get(cell, 11), LeachResidue.get(dustTiny, 10), 300, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(3)}, new FluidStack[]{Materials.Water.getFluid(36000), RHSulfate.getFluidOrGas(39600)}, new FluidStack[]{Materials.Potassium.getMolten(7200), RHSulfateSolution.getFluidOrGas(39600)}, new ItemStack[]{LeachResidue.get(dust, 4)}, 1200, 30); GT_Values.RA.addChemicalRecipe(Materials.Zinc.getDust(1), null, RHSulfateSolution.getFluidOrGas(1000), null, ZincSulfate.get(dust,6), CrudeRhMetall.get(dust), 300); GT_Values.RA.addBlastRecipe(CrudeRhMetall.get(dust), Materials.Salt.getDust(1), Materials.Chlorine.getGas(1000), null, RHSalt.get(dust, 3), null, 300, 120, 600); -- cgit From b83a44344edc518878103122570939dcf9492cbc Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Tue, 18 Jan 2022 21:18:47 -0800 Subject: maven publish buildscript update Former-commit-id: 6067746ac7f8d288a1d4c7817e5173785672ff7c --- .github/workflows/release-tags.yml | 6 +++++ CODEOWNERS | 3 +++ build.gradle | 52 +++++++++++++++++++++----------------- 3 files changed, 38 insertions(+), 23 deletions(-) create mode 100644 CODEOWNERS diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml index 25c354b227..c86d8889b7 100644 --- a/.github/workflows/release-tags.yml +++ b/.github/workflows/release-tags.yml @@ -43,3 +43,9 @@ jobs: 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/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000000..a6b5f68cd0 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,3 @@ +# Any Github changes require admin approval +/.github/** @GTNewHorizons/admin + diff --git a/build.gradle b/build.gradle index e466de0fd5..b647108772 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,9 @@ -//version: 1641429628 +//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/SinTh0r4s/ExampleMod1.7.10/blob/main/build.gradle for updates. +Please check https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/build.gradle for updates. */ @@ -88,6 +88,7 @@ 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/" @@ -151,12 +152,16 @@ configurations.all { // 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 from git tag + +// Pulls version first from the VERSION env and then git tag +String identifiedVersion try { - version = minecraftVersion + "-" + gitVersion() + 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!"); + 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 @@ -223,7 +228,7 @@ dependencies { 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("org.spongepowered:mixin:0.7.11-SNAPSHOT") { + 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" @@ -231,7 +236,7 @@ dependencies { exclude module: "commons-io" exclude module: "log4j-core" } - compile("com.github.GTNewHorizons:SpongeMixins:1.3.3:dev") + compile("com.github.GTNewHorizons:SpongeMixins:1.5.0") } } @@ -480,7 +485,9 @@ task apiJar(type: Jar) { } artifacts { - archives sourcesJar + if(!noPublishedSources) { + archives sourcesJar + } archives devJar if(apiPackage) { archives apiJar @@ -491,29 +498,28 @@ artifacts { publishing { publications { maven(MavenPublication) { - artifact source: jar - artifact source: sourcesJar, classifier: "src" - artifact source: devJar, classifier: "dev" + 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") ?: group + groupId = System.getenv("ARTIFACT_GROUP_ID") ?: "com.github.GTNewHorizons" artifactId = System.getenv("ARTIFACT_ID") ?: project.name - version = System.getenv("ARTIFACT_VERSION") ?: project.version + // Using the identified version, not project.version as it has the prepended 1.7.10 + version = System.getenv("RELEASE_VERSION") ?: identifiedVersion } } - + repositories { maven { - String owner = System.getenv("REPOSITORY_OWNER") ?: "Unknown" - String repositoryName = System.getenv("REPOSITORY_NAME") ?: "Unknown" - String githubRepositoryUrl = "https://maven.pkg.github.com/$owner/$repositoryName" - name = "GitHubPackages" - url = githubRepositoryUrl + url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases" credentials { - username = System.getenv("GITHUB_ACTOR") ?: "NONE" - password = System.getenv("GITHUB_TOKEN") ?: "NONE" + username = System.getenv("MAVEN_USER") ?: "NONE" + password = System.getenv("MAVEN_PASSWORD") ?: "NONE" } } } @@ -537,7 +543,7 @@ if (isNewBuildScriptVersionAvailable(projectDir.toString())) { } static URL availableBuildScriptUrl() { - new URL("https://raw.githubusercontent.com/SinTh0r4s/ExampleMod1.7.10/main/build.gradle") + new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/main/build.gradle") } boolean performBuildScriptUpdate(String projectDir) { @@ -579,7 +585,7 @@ configure(updateBuildScript) { 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/SinTh0r4s/ExampleMod1.7.10/blob/main/gradle.properties") + 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") } } -- cgit From 90e2815401af4f54257d44826aed270a233be8fc Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Tue, 18 Jan 2022 21:18:53 -0800 Subject: update to explicit dependencies Former-commit-id: d8074879dbcc875fe64f6e1c8614639538fd6026 --- dependencies.gradle | 25 +++++++++++++++++++------ repositories.gradle | 4 ++++ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 29aaa18377..09f3094a33 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,24 +1,37 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:TecTech:master-SNAPSHOT:dev") - compile("com.github.GTNewHorizons:GalacticGregGT5:master-SNAPSHOT:dev") { + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.18:dev") + compile("com.github.GTNewHorizons:StructureLib:1.0.14:dev") + compile("com.github.GTNewHorizons:TecTech:4.10.15:dev") + compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") + compile("com.github.GTNewHorizons:NotEnoughItems:2.1.22-GTNH:dev") + compile("com.github.GTNewHorizons:TinkersConstruct:1.9.0.10-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:Galacticraft:3.0.36-GTNH:dev") + + compile("com.github.GTNewHorizons:GalacticGregGT5:1.0.6:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } + + compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-70-GTNH:dev") { + transitive = false + } - compileOnly("com.github.GTNewHorizons:AppleCore:master-SNAPSHOT:dev") { + compileOnly("com.github.GTNewHorizons:AppleCore:3.1.6:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:TinkersGregworks:master-SNAPSHOT:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:ForestryMC:master-SNAPSHOT:api") { + compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.4:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:Railcraft:master-SNAPSHOT:api") { + compileOnly("com.github.GTNewHorizons:Railcraft:9.13.5:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:EnderIO:master-SNAPSHOT:api") { + compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.27:api") { transitive = false } diff --git a/repositories.gradle b/repositories.gradle index 130197c8aa..a161653e0f 100644 --- a/repositories.gradle +++ b/repositories.gradle @@ -1,6 +1,10 @@ // 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/" -- cgit From 2bacd44e1f24b16ad46e5e21056e059911a6df7f Mon Sep 17 00:00:00 2001 From: glowredman <35727266+glowredman@users.noreply.github.com> Date: Fri, 28 Jan 2022 21:28:18 +0100 Subject: Reserve IDs for GalaxySpace (#81) Former-commit-id: 1cfb8e9a10611aa43bdda0367f75c0b3011ba126 --- .../bartimaeusnek/bartworks/system/material/WerkstoffLoader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 3e01365617..d5639cbb8b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -192,10 +192,11 @@ public class WerkstoffLoader { } //TODO: - //FREE ID RANGE: 11_500-28_998 + //FREE ID RANGE: 12_000-28_998 //bartimaeusnek reserved 0-10_000 //GlodBlock reserved range 10_001-10_999 //Elisis reserved range 11_000-11_499 + //glowredman reserved range 11_500-11_999 //bot reserved range 29_899-29_999 //Tec & basdxz reserved range 30_000-31_000 //GT Material range reserved on 31_767-32_767 -- cgit From 7b8dc258f7352dfec196330350d2ddf22d894caf Mon Sep 17 00:00:00 2001 From: bombcar Date: Thu, 3 Feb 2022 13:46:58 -0600 Subject: LGPL-3.0 (#83) * updatebuild * update license Former-commit-id: ef47ff063e28721d0f93e0f19d3d7067664da60f --- COPYING | 674 ---------------------------------------------------- COPYING.LESSER | 165 ------------- LICENSE | 175 ++++++++++++-- README.md | 13 +- build.gradle | 143 +++++++++-- dependencies.gradle | 22 +- gradle.properties | 8 +- 7 files changed, 304 insertions(+), 896 deletions(-) delete mode 100644 COPYING delete mode 100644 COPYING.LESSER diff --git a/COPYING b/COPYING deleted file mode 100644 index 19d1fa01fb..0000000000 --- a/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -.1996 diff --git a/COPYING.LESSER b/COPYING.LESSER deleted file mode 100644 index 0a041280bd..0000000000 --- a/COPYING.LESSER +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/LICENSE b/LICENSE index b34be33ad7..0a041280bd 100644 --- a/LICENSE +++ b/LICENSE @@ -1,30 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 -GTNH Modifications: + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. -LGPL v3.0 or later. See COPYING & COPYING.LESSER. Feel free to use our changes, just give back any changes you make to the community as well! + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + 0. Additional Definitions. -Original License: + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. -MIT License + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. -Copyright (c) bartimaeusnek 2018-2020 + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/README.md b/README.md index 7fcf015b51..4a8479f856 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,16 @@ # bartworks -A Gregtech addon, that adds GT2,3,4 stuff, a BioLabor, and much more custom content. Integration for Galaxy Space, and new Ores aswell. +A Gregtech addon, that adds GT2,3,4 stuff, a BioLabor, and much more custom content. Integration for Galaxy Space, and new Ores as well. Visit us on Twitch: https://minecraft.curseforge.com/projects/bartworks/ +Please add -Dfml.coreMods.load=com.github.bartimaeusnek.bartworks.ASM.BWCorePlugin to your args when you run this in a dev environment! -Please add -Dfml.coreMods.load=com.github.bartimaeusnek.bartworks.ASM.BWCorePlugin to your args when you run this in a dev enviroment! \ No newline at end of file +Any issues with this code should be reported to the [GTNH GitHub](https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues). + +## License + +GTNH modifications Copyright (c) 2021-2022 The GTNH Team + +This code is licensed LGPL v3.0 or later. Feel free to use our changes, just give back any changes you make to the community as well! + +Original code Copyright (c) bartimaeusnek 2018-2020 and was released under the MIT license. \ No newline at end of file diff --git a/build.gradle b/build.gradle index b647108772..7914dd81b4 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1642484596 +//version: 1643020202 /* DO NOT CHANGE THIS FILE! @@ -32,16 +32,18 @@ buildscript { } } dependencies { - classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.5' + classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.7' } } plugins { id 'idea' + id 'eclipse' 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('de.undercouch.download') version('4.1.2') id("maven-publish") } @@ -172,6 +174,19 @@ else { archivesBaseName = modId } + +def arguments = [] +def jvmArguments = [] + +if(usesMixins.toBoolean()) { + arguments += [ + "--tweakClass org.spongepowered.asm.launch.MixinTweaker" + ] + jvmArguments += [ + "-Dmixin.debug.countInjections=true", "-Dmixin.debug.verbose=true", "-Dmixin.debug.export=true" + ] +} + minecraft { version = minecraftVersion + "-" + forgeVersion + "-" + minecraftVersion runDir = "run" @@ -191,6 +206,20 @@ minecraft { replace gradleTokenGroupName, modGroup } } + + clientIntellijRun { + args(arguments) + jvmArgs(jvmArguments) + + if(developmentEnvironmentUserName) { + args("--username", developmentEnvironmentUserName) + } + } + + serverIntellijRun { + args(arguments) + jvmArgs(jvmArguments) + } } if(file("addon.gradle").exists()) { @@ -322,15 +351,6 @@ afterEvaluate { } runClient { - def arguments = [] - - if(usesMixins.toBoolean()) { - arguments += [ - "--mods=../build/libs/$modId-${version}.jar", - "--tweakClass org.spongepowered.asm.launch.MixinTweaker" - ] - } - if(developmentEnvironmentUserName) { arguments += [ "--username", @@ -339,19 +359,12 @@ runClient { } args(arguments) + jvmArgs(jvmArguments) } runServer { - def arguments = [] - - if (usesMixins.toBoolean()) { - arguments += [ - "--mods=../build/libs/$modId-${version}.jar", - "--tweakClass org.spongepowered.asm.launch.MixinTweaker" - ] - } - args(arguments) + jvmArgs(jvmArguments) } tasks.withType(JavaExec).configureEach { @@ -494,11 +507,21 @@ artifacts { } } +// The gradle metadata includes all of the additional deps that we disabled from POM generation (including forgeBin with no groupID), +// and isn't strictly needed with the POM so just disable it. +tasks.withType(GenerateModuleMetadata) { + enabled = false +} + + // publishing publishing { publications { maven(MavenPublication) { - artifact source: usesShadowedDependencies.toBoolean() ? shadowJar : jar, classifier: "" + from components.java + if(usesShadowedDependencies.toBoolean()) { + artifact source: shadowJar, classifier: "" + } if(!noPublishedSources) { artifact source: sourcesJar, classifier: "src" } @@ -511,6 +534,18 @@ publishing { 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 + + // Remove all non GTNH deps here. + // Original intention was to remove an invalid forgeBin being generated without a groupId (mandatory), but + // it also removes all of the MC deps + pom.withXml { + Node pomNode = asNode() + pomNode.dependencies.'*'.findAll() { + it.groupId.text() != 'com.github.GTNewHorizons' + }.each() { + it.parent().remove(it) + } + } } } @@ -581,6 +616,72 @@ configure(updateBuildScript) { description = 'Updates the build script to the latest version' } +// Deobfuscation + +def deobf(String sourceURL) { + try { + URL url = new URL(sourceURL) + String fileName = url.getFile() + + //get rid of directories: + int lastSlash = fileName.lastIndexOf("/") + if(lastSlash > 0) { + fileName = fileName.substring(lastSlash + 1) + } + //get rid of extension: + if(fileName.endsWith(".jar")) { + fileName = fileName.substring(0, fileName.lastIndexOf(".")) + } + + String hostName = url.getHost() + if(hostName.startsWith("www.")) { + hostName = hostName.substring(4) + } + List parts = Arrays.asList(hostName.split("\\.")) + Collections.reverse(parts) + hostName = String.join(".", parts) + + return deobf(sourceURL, hostName + "/" + fileName) + } catch(Exception e) { + return deobf(sourceURL, "deobf/" + String.valueOf(sourceURL.hashCode())) + } +} + +// The method above is to be prefered. Use this method if the filename is not at the end of the URL. +def deobf(String sourceURL, String fileName) { + String cacheDir = System.getProperty("user.home") + "/.gradle/caches/" + String bon2Dir = cacheDir + "forge_gradle/deobf" + String bon2File = bon2Dir + "/BON2-2.5.0.jar" + String obfFile = cacheDir + "modules-2/files-2.1/" + fileName + ".jar" + String deobfFile = cacheDir + "modules-2/files-2.1/" + fileName + "-deobf.jar" + + if(file(deobfFile).exists()) { + return files(deobfFile) + } + + download { + src 'https://github.com/GTNewHorizons/BON2/releases/download/2.5.0/BON2-2.5.0.CUSTOM-all.jar' + dest bon2File + quiet true + overwrite false + } + + download { + src sourceURL + dest obfFile + quiet true + overwrite false + } + + exec { + commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', '1.7.10', '--mappingsVer', 'stable_12', '--notch' + workingDir bon2Dir + standardOutput = new ByteArrayOutputStream() + } + + return files(deobfFile) +} + // Helper methods def checkPropertyExists(String propertyName) { diff --git a/dependencies.gradle b/dependencies.gradle index 09f3094a33..3ac4b51b79 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,17 +1,17 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.18:dev") - compile("com.github.GTNewHorizons:StructureLib:1.0.14:dev") - compile("com.github.GTNewHorizons:TecTech:4.10.15:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.19:dev") + compile("com.github.GTNewHorizons:StructureLib:1.0.15:dev") + compile("com.github.GTNewHorizons:TecTech:4.10.16:dev") compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") - compile("com.github.GTNewHorizons:NotEnoughItems:2.1.22-GTNH:dev") - compile("com.github.GTNewHorizons:TinkersConstruct:1.9.0.10-GTNH:dev") - compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.1:dev") + compile("com.github.GTNewHorizons:NotEnoughItems:2.2.3-GTNH:dev") + compile("com.github.GTNewHorizons:TinkersConstruct:1.9.0.12-GTNH:dev") + compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.2:dev") compile("com.github.GTNewHorizons:CodeChickenCore:1.1.3:dev") - compile("com.github.GTNewHorizons:Galacticraft:3.0.36-GTNH:dev") + compile("com.github.GTNewHorizons:Galacticraft:3.0.37-GTNH:dev") - compile("com.github.GTNewHorizons:GalacticGregGT5:1.0.6:dev") { + compile("com.github.GTNewHorizons:GalacticGregGT5:1.0.7:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } @@ -19,13 +19,13 @@ dependencies { transitive = false } - compileOnly("com.github.GTNewHorizons:AppleCore:3.1.6:dev") { + compileOnly("com.github.GTNewHorizons:AppleCore:3.1.7:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:TinkersGregworks:master-SNAPSHOT:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.4:api") { + compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.5:api") { transitive = false } compileOnly("com.github.GTNewHorizons:Railcraft:9.13.5:api") { @@ -41,4 +41,6 @@ dependencies { compileOnly("com.mod-buildcraft:buildcraft:7.1.23:dev") { transitive = false } + runtime("com.github.GTNewHorizons:Yamcl:0.5.82:dev") + runtime("com.github.GTNewHorizons:ironchest:6.0.68:dev") //needed for Galacticraft } diff --git a/gradle.properties b/gradle.properties index 5472edd8cf..0773d1e210 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,11 +15,11 @@ 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 +# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you # restart Minecraft in development. Choose this dependent on your mod: # Do you need consistent player progressing (for example Thaumcraft)? -> Select a name # Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty -developmentEnvironmentUserName = "Developer" +developmentEnvironmentUserName = Developer # Define a source file of your project with: # public static final String VERSION = "GRADLETOKEN_VERSION"; @@ -32,7 +32,7 @@ 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 +# 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 = @@ -48,7 +48,7 @@ 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 +# This parameter is for legacy compatibility only # Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin coreModClass = ASM.BWCorePlugin # If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class -- cgit From b0d3533c5e412d54295f720ebd527e3c14248081 Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Fri, 4 Feb 2022 14:51:16 -0800 Subject: Updates (#84) * Update to work w/ new GT5u rendering code * explicitly depend on tectech * Remove deprecated tectech ICustomBlockSetting interface Former-commit-id: 4aa48a3f9af82af04cb39dd1c406d5245b44fbea --- .../github/bartimaeusnek/bartworks/MainMod.java | 1 + .../client/renderer/BW_Renderer_Block_Ores.java | 27 ++++++---------------- .../material/BW_MetaGeneratedBlocks_Casing.java | 3 +-- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 8c464f2993..94c91ccb94 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -68,6 +68,7 @@ import static gregtech.api.enums.GT_Values.VN; dependencies = "required-after:IC2; " + "required-after:gregtech; " + "after:berriespp; " + + "after:tectech; " + "after:GalacticraftMars; " + "after:GalacticraftCore; " + "after:Forestry; " diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index 795acbec17..364529af99 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -28,11 +28,16 @@ import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; import net.minecraft.world.IBlockAccess; import org.lwjgl.opengl.GL11; -import static gregtech.common.render.GT_Renderer_Block.*; +import static gregtech.common.render.GT_Renderer_Block.renderNegativeXFacing; +import static gregtech.common.render.GT_Renderer_Block.renderNegativeYFacing; +import static gregtech.common.render.GT_Renderer_Block.renderNegativeZFacing; +import static gregtech.common.render.GT_Renderer_Block.renderPositiveXFacing; +import static gregtech.common.render.GT_Renderer_Block.renderPositiveYFacing; +import static gregtech.common.render.GT_Renderer_Block.renderPositiveZFacing; +import static gregtech.common.render.GT_Renderer_Block.renderStandardBlock; public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { public static BW_Renderer_Block_Ores INSTANCE = new BW_Renderer_Block_Ores(); @@ -46,30 +51,12 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { aRenderer.setRenderBoundsFromBlock(aBlock); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F); renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 0), true); - Tessellator.instance.draw(); - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F); renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 1), true); - Tessellator.instance.draw(); - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F); renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 2), true); - Tessellator.instance.draw(); - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F); renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 3), true); - Tessellator.instance.draw(); - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F); renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 4), true); - Tessellator.instance.draw(); - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F); renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 5), true); - Tessellator.instance.draw(); aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); aRenderer.setRenderBoundsFromBlock(aBlock); GL11.glTranslatef(0.5F, 0.5F, 0.5F); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java index c892ead1d9..e13bca3bf5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -40,8 +40,7 @@ import net.minecraft.world.World; import java.util.List; import java.util.Optional; -public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks implements com.github.technus.tectech.mechanics.structure.ICustomBlockSetting, - com.gtnewhorizon.structurelib.structure.ICustomBlockSetting +public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks implements com.gtnewhorizon.structurelib.structure.ICustomBlockSetting { public BW_MetaGeneratedBlocks_Casing(Material p_i45386_1_, Class tileEntity, String blockName, OrePrefixes prefixes) { -- cgit From 803fad9e8b5509dcd09c374d5ee9312e89617b7a Mon Sep 17 00:00:00 2001 From: miozune Date: Sat, 5 Feb 2022 19:45:02 +0900 Subject: Fix recipe conflict with ULV Magneto Resonatic Circuit (#85) Former-commit-id: b2482ad25df9325db4ae77ee3920aba1476226ff --- .../material/processingLoaders/AdditionalRecipes.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 73cdeb8a4b..a8af99b104 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -314,7 +314,23 @@ public class AdditionalRecipes { //GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), Materials.Milk.getFluid(12000), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500, 49152, 600000000); GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(1), GT_Values.NI, Materials.Milk.getFluid(10000), Materials.Water.getFluid(8832), Materials.Sugar.getDustSmall(21), Materials.Calcium.getDustTiny(1), Materials.Magnesium.getDustTiny(1), Materials.Potassium.getDustTiny(1), Materials.Sodium.getDustTiny(4), Materials.Phosphor.getDustTiny(1), new int[]{10000, 10000, 1000, 10000, 1000, 1000}, 50, 120); - for (int i = 0; i <= 6; i++) { + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( + new BWRecipes.DynamicGTRecipe(false, + new ItemStack[]{ + BW_Meta_Items.getNEWCIRCUITS().getStack(3), + WerkstoffLoader.MagnetoResonaticDust.get(gem), + ItemList.NandChip.get(1), + ItemList.Circuit_Parts_DiodeSMD.get(4), + ItemList.Circuit_Parts_CapacitorSMD.get(4), + ItemList.Circuit_Parts_TransistorSMD.get(4) + }, + new ItemStack[]{ + BW_Meta_Items.getNEWCIRCUITS().getStack(4) + }, null, null, + new FluidStack[]{ + Materials.SolderingAlloy.getMolten(36) + }, null, 750, BW_Util.getMachineVoltageFromTier(1), CLEANROOM)); + for (int i = 1; i <= 6; i++) { GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{ -- cgit From 512e548e279bbc5139c688a3ef0d504dbc2883e8 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Sat, 5 Feb 2022 18:27:39 +0100 Subject: Remove small/tiny piles from recipe (#87) Former-commit-id: 8648aaf916c4c6231c8a8ab9b31cb13abc3bee60 --- .../bartworks/common/tileentities/multis/GT_TileEntity_THTR.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index cb0a454dce..39113db002 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -384,10 +384,10 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase public static void registerTHR_Recipes(){ GT_Values.RA.addCentrifugeRecipe( Materials.Thorium.getDust(1),GT_Values.NI,GT_Values.NF,GT_Values.NF, - Materials.Thorium.getDustSmall(2),Materials.Thorium.getDustSmall(1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1),WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dustTiny,1),GT_Values.NI, - new int[]{1600,1500,200,200,50}, + Materials.Thorium.getDust(1),Materials.Thorium.getDust(1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust,1),WerkstoffLoader.Thorium232.get(OrePrefixes.dust,1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust,1),GT_Values.NI, + new int[]{800,375,22,22,5}, 10000, BW_Util.getMachineVoltageFromTier(4)); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ GT_OreDictUnificator.get(OrePrefixes.plateDense,Materials.Lead,6), -- cgit From 3399a21e6f9befb80de63be5822bd750830c545d Mon Sep 17 00:00:00 2001 From: bombcar Date: Sun, 6 Feb 2022 16:24:00 -0600 Subject: update dependencies, including buildscript and buildcraft (#89) * update dependencies, including buildscript and buildcraft * buildcraft version Former-commit-id: b7f729464519a278c498260b5fc71fafc34e39c7 --- build.gradle | 78 +++++++++++++++++++++++++++++++++++------------------ dependencies.gradle | 28 +++++++++---------- 2 files changed, 65 insertions(+), 41 deletions(-) diff --git a/build.gradle b/build.gradle index 7914dd81b4..4f54c87f65 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1643020202 +//version: 1643844119 /* DO NOT CHANGE THIS FILE! @@ -40,11 +40,16 @@ plugins { id 'idea' id 'eclipse' 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('de.undercouch.download') version('4.1.2') - id("maven-publish") + id('org.jetbrains.kotlin.jvm') version ('1.6.10') apply false + id('org.ajoberstar.grgit') version('4.1.1') + id('com.github.johnrengelman.shadow') version('4.0.4') + id('com.palantir.git-version') version('0.13.0') apply false + id('de.undercouch.download') version('5.0.1') + id('maven-publish') +} + +if (project.file('.git/HEAD').isFile()) { + apply plugin: 'com.palantir.git-version' } apply plugin: 'forge' @@ -94,24 +99,27 @@ boolean noPublishedSources = project.findProperty("noPublishedSources") ? projec String javaSourceDir = "src/main/java/" String scalaSourceDir = "src/main/scala/" +String kotlinSourceDir = "src/main/kotlin/" 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) +String targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") +if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { + throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) } if(apiPackage) { targetPackageJava = javaSourceDir + 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) + targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { + throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) } } if(accessTransformersFile) { String targetFile = "src/main/resources/META-INF/" + accessTransformersFile - if(getFile(targetFile).exists() == false) { + if(!getFile(targetFile).exists()) { throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) } } @@ -123,15 +131,17 @@ if(usesMixins.toBoolean()) { 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) + targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/") + if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { + throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) } 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) + String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".kt" + if(!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) { + throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin) } } @@ -139,8 +149,9 @@ 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) + String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".kt" + if(!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) { + throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin) } } @@ -153,17 +164,32 @@ configurations.all { } // 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() +try { + 'git config core.fileMode false'.execute() +} +catch (Exception e) { + logger.error("\u001B[31mgit isn't installed at all\u001B[0m") +} // Pulls version first from the VERSION env and then git tag String identifiedVersion +String versionOverride = System.getenv("VERSION") ?: null 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!"); + logger.error("\n\u001B[1;31mThis mod must be version controlled by Git AND the repository must provide at least one tag,\n" + + "or the VERSION override must be set! \u001B[32m(Don't download from GitHub using the ZIP option, instead\n" + + "clone the repository, see\u001B[33m https://gtnh.miraheze.org/wiki/Development \u001B[32mfor details.)\u001B[0m\n"); + versionOverride = 'NO-GIT-TAG-SET' + identifiedVersion = versionOverride +} +version = minecraftVersion + '-' + identifiedVersion +String modVersion = identifiedVersion + +if( identifiedVersion.equals(versionOverride) ) { + logger.error('\u001B[31m\u001B[7mWe hope you know what you\'re doing using\u001B[0m\u001B[1;34m ' + modVersion + '\u001B[0m\n'); + logger.error('\7\u001B[31mGoing to blindly try to use\u001B[1;34m ' + modVersion + '\u001B[0m\u001B[31m, this probably won\'t work the way you expect!!\u001B[0m\n'); } group = modGroup @@ -200,7 +226,7 @@ minecraft { replace gradleTokenModName, modName } if(gradleTokenVersion) { - replace gradleTokenVersion, versionDetails().lastTag + replace gradleTokenVersion, modVersion } if(gradleTokenGroupName) { replace gradleTokenGroupName, modGroup @@ -380,16 +406,16 @@ 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 + "modVersion": modVersion, + "modId": modId, + "modName": modName } if(usesMixins.toBoolean()) { diff --git a/dependencies.gradle b/dependencies.gradle index 3ac4b51b79..71df9efa3d 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,25 +1,23 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.19:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.31:dev") compile("com.github.GTNewHorizons:StructureLib:1.0.15:dev") - compile("com.github.GTNewHorizons:TecTech:4.10.16:dev") - compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") - compile("com.github.GTNewHorizons:NotEnoughItems:2.2.3-GTNH:dev") - compile("com.github.GTNewHorizons:TinkersConstruct:1.9.0.12-GTNH:dev") - compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.2:dev") + compile("com.github.GTNewHorizons:TecTech:4.10.18:dev") + compile("com.github.GTNewHorizons:NotEnoughItems:2.2.5-GTNH:dev") + compile("com.github.GTNewHorizons:TinkersConstruct:1.9.0.13-GTNH:dev") + compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.3:dev") compile("com.github.GTNewHorizons:CodeChickenCore:1.1.3:dev") - compile("com.github.GTNewHorizons:Galacticraft:3.0.37-GTNH:dev") - + compile("com.github.GTNewHorizons:Galacticraft:3.0.38-GTNH:dev") compile("com.github.GTNewHorizons:GalacticGregGT5:1.0.7:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } + compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") - compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-70-GTNH:dev") { + compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-75-GTNH:dev") { transitive = false } - - compileOnly("com.github.GTNewHorizons:AppleCore:3.1.7:dev") { + compileOnly("com.github.GTNewHorizons:AppleCore:3.1.9:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:TinkersGregworks:master-SNAPSHOT:dev") { @@ -31,16 +29,16 @@ dependencies { compileOnly("com.github.GTNewHorizons:Railcraft:9.13.5:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.27:api") { + compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.28:api") { transitive = false } - compileOnly("li.cil.oc:OpenComputers:MC1.7.10-1.7.5.1356:api") { + compileOnly("com.github.GTNewHorizons:OpenComputers:1.7.5.21-GTNH:api") { transitive = false } - compileOnly("com.mod-buildcraft:buildcraft:7.1.23:dev") { + compileOnly("com.github.GTNewHorizons:BuildCraft:7.1.26:dev") { transitive = false } runtime("com.github.GTNewHorizons:Yamcl:0.5.82:dev") - runtime("com.github.GTNewHorizons:ironchest:6.0.68:dev") //needed for Galacticraft + runtime("com.github.GTNewHorizons:ironchest:6.0.69:dev") //needed for Galacticraft } -- cgit From 7eb8cdfe577a9d5846c37957d2c3771d4ae62df4 Mon Sep 17 00:00:00 2001 From: SKYCATV587 <41377439+SKYCATV587@users.noreply.github.com> Date: Wed, 9 Feb 2022 19:41:01 +0800 Subject: add MegaChemicalReactor and MegaOilCracker (#86) * add MegaChemicalReactor * add MegaOilCracker * glass tire limit energyhatches tire * fix the minor issues * fix the minor issues Former-commit-id: 0df67deb157be99b494f6996be258321f5b75a22 --- .../bartworks/common/loaders/ItemRegistry.java | 7 +- .../bartworks/common/loaders/RecipeLoader.java | 3 + .../mega/GT_TileEntity_MegaChemicalReactor.java | 305 ++++++++++++++ .../multis/mega/GT_TileEntity_MegaOilCracker.java | 455 +++++++++++++++++++++ 4 files changed, 769 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 7666983319..561674bd75 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -42,6 +42,8 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEnti import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaBlastFurnace; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaDistillTower; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaChemicalReactor; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaOilCracker; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.*; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.crossmod.galacticgreg.GT_TileEntity_VoidMiners; @@ -142,7 +144,7 @@ public class ItemRegistry { public static ItemStack[] energyDistributor = new ItemStack[GT_Values.VN.length]; public static ItemStack[] acidGens = new ItemStack[3]; public static ItemStack acidGensLV; - public static ItemStack[] megaMachines = new ItemStack[3]; + public static ItemStack[] megaMachines = new ItemStack[5]; public static ItemStack dehp; public static ItemStack[] voidminer = new ItemStack[3]; public static ItemStack THTR; @@ -215,6 +217,9 @@ public class ItemRegistry { ItemRegistry.compressedHatch = new GT_MetaTileEntity_CompressedFluidHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, "CompressedFluidHatch", "Liquid Air Fluid Hatch").getStackForm(1L); ItemRegistry.giantOutputHatch = new GT_MetaTileEntity_GiantOutputHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, "GiantOutputHatch", "Giant Output Hatch").getStackForm(1L); ItemRegistry.megaMachines[2] = new GT_TileEntity_MegaDistillTower(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, "MegaDistillationTower", "Mega Distillation Tower").getStackForm(1L); + ItemRegistry.megaMachines[3] = new GT_TileEntity_MegaChemicalReactor(ConfigHandler.IDOffset+GT_Values.VN.length * 8 + 638, "MegaChemicalReactor", "Mega Chemical Reactor").getStackForm(1L); + ItemRegistry.megaMachines[4] = new GT_TileEntity_MegaOilCracker(ConfigHandler.IDOffset+GT_Values.VN.length * 8 + 639, "MegaOilCracker", "Mega Oil Cracker").getStackForm(1L); + if (LoaderReference.galacticgreg && WerkstoffLoader.gtnhGT) { ItemRegistry.voidminer[2] = new GT_TileEntity_VoidMiners.VMUV(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 11, "VoidMiner3", "Void Miner III").getStackForm(1L); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 7f7d57d330..cf31a88cd1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -257,6 +257,9 @@ public class RecipeLoader { GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1000), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[0], 72000, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1002), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[1], 72000, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1126), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[2], 72000, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1169), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[3], 72000, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1160), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[4], 72000, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Nickel.getMolten(5184), new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 800, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), Materials.Tungsten.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), 800, BW_Util.getMachineVoltageFromTier(4)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java new file mode 100644 index 0000000000..ba6afeb0c4 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -0,0 +1,305 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; + +import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.MegaUtils; +import com.github.bartimaeusnek.bartworks.util.Pair; +import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; +import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureUtility; +import cpw.mods.fml.common.Optional; +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeChemicalReactor; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; +import java.util.List; + +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.util.GT_StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; + +@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) +public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeChemicalReactor implements TecTechEnabledMulti { + + public GT_TileEntity_MegaChemicalReactor(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_MegaChemicalReactor(String aName) { + super(aName); + } + + @Override + public GT_Multiblock_Tooltip_Builder createTooltip() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Chemical Reactor") + .addInfo("Controller block for the Chemical Reactor") + .addInfo("What molecule do you want to synthesize") + .addInfo("Or you want to replace something in this molecule") + .addInfo("The structure is too complex!") + .addInfo("Follow the Structure Lib hologram projector to build the main structure.") + .addSeparator() + .beginStructureBlock(5, 5, 9, false) + .addController("Front bottom") + .addStructureInfo("The glass tier limits the Energy Input tier") + .addEnergyHatch("Hint block ", 3) + .addMaintenanceHatch("Hint block ",2) + .addInputHatch("Hint block ",1) + .addInputBus("Hint block ",1) + .addOutputBus("Hint block ",1) + .addOutputHatch("Hint block ",1) + .toolTipFinisher(BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); + return tt; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_TileEntity_MegaChemicalReactor(this.mName); + } + + @SuppressWarnings("rawtypes") + public ArrayList TTTunnels = new ArrayList<>(); + @SuppressWarnings("rawtypes") + public ArrayList TTMultiAmp = new ArrayList<>(); + + @Override + public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (LoaderReference.tectech) { + return TecTechUtils.addEnergyInputToMachineList(this, aTileEntity, aBaseCasingIndex); + } + return super.addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); + } + + @Override + public boolean drainEnergyInput(long aEU) { + if (LoaderReference.tectech) { + return TecTechUtils.drainEnergyMEBFTecTech(this, aEU); + } + return MegaUtils.drainEnergyMegaVanilla(this, aEU); + } + + @Override + public long getMaxInputVoltage() { + if (LoaderReference.tectech) { + return TecTechUtils.getMaxInputVoltage(this); + } + return super.getMaxInputVoltage(); + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); + FluidStack[] tInputFluids = this.getStoredFluids().toArray(new FluidStack[0]); + ArrayList outputItems = new ArrayList<>(); + ArrayList outputFluids = new ArrayList<>(); + + long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + + byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); + + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); + boolean found_Recipe = false; + int processed = 0; + + if (tRecipe != null) { + found_Recipe = true; + long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); + int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); + if (tCurrentPara <= 0) { + return false; + } + processed = tCurrentPara; + Pair, ArrayList> Outputs = getMultiOutput(tRecipe, tCurrentPara); + outputFluids = Outputs.getKey(); + outputItems = Outputs.getValue(); + } + + if (found_Recipe) { + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + long actualEUT = (long) (tRecipe.mEUt) * processed; + if (actualEUT > Integer.MAX_VALUE) { + byte divider = 0; + while (actualEUT > Integer.MAX_VALUE) { + actualEUT = actualEUT / 2; + divider++; + } + calculatePerfectOverclockedNessMulti((int) actualEUT, tRecipe.mDuration * (divider * 2), 1, nominalV); + } else { + calculatePerfectOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, nominalV); + } + //In case recipe is too OP for that machine + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) { + return false; + } + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[outputItems.size()]; + this.mOutputItems = outputItems.toArray(this.mOutputItems); + this.mOutputFluids = new FluidStack[outputFluids.size()]; + this.mOutputFluids = outputFluids.toArray(this.mOutputFluids); + this.updateSlots(); + return true; + } + return false; + } + + @Override + public void construct(ItemStack aStack, boolean aHintsOnly) { + buildPiece(STRUCTURE_PIECE_MAIN,aStack,aHintsOnly,2,2,0); + } + + // -------------- TEC TECH COMPAT ---------------- + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + glasTier = 0; + if (LoaderReference.tectech) { + this.getTecTechEnergyMultis().clear(); + this.getTecTechEnergyTunnels().clear(); + } + + if(checkPiece(STRUCTURE_PIECE_MAIN,2,2,0)&&(mMaintenanceHatches.size()==1)){ + return false; + } + + if (this.glasTier != 8 && !this.mEnergyHatches.isEmpty()) { + for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) { + if (this.glasTier < hatchEnergy.mTier) { + return false; + } + } + } + + + return true; + } + + private static final int CASING_INDEX = 176; + private static final String STRUCTURE_PIECE_MAIN = "main"; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {"ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd","ttttt"}, + {"tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet"}, + {"tg~gt", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", "teret"}, + {"tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet"}, + {"ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd","ttttt"}, + })) + .addElement('p', ofBlock(GregTech_API.sBlockCasings8, 1)) + .addElement('t', ofBlock(GregTech_API.sBlockCasings8, 0)) + .addElement('d', ofChain( + ofHatchAdder(GT_TileEntity_MegaChemicalReactor::addInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_MegaChemicalReactor::addOutputToMachineList, CASING_INDEX, 1), + onElementPass(GT_TileEntity_MegaChemicalReactor::onCasingAdded, ofBlock(GregTech_API.sBlockCasings8, 0)) + )) + .addElement('r', ofChain( + ofHatchAdder(GT_TileEntity_MegaChemicalReactor::addMaintenanceToMachineList, CASING_INDEX, 2) + )) + .addElement('e', ofChain( + ofHatchAdder(GT_TileEntity_MegaChemicalReactor::addEnergyInputToMachineList, CASING_INDEX, 3), + onElementPass(GT_TileEntity_MegaChemicalReactor::onCasingAdded, ofBlock(GregTech_API.sBlockCasings8, 0)) + )) + .addElement('c', ofChain( + ofBlock(GregTech_API.sBlockCasings4, 7) + )) + .addElement('g', ofChain( + ofBlockAdder(GT_TileEntity_MegaChemicalReactor::addGlas, ItemRegistry.bw_glasses[0], 1) + )) + .build(); + + private int mCasingAmount; + + + + @Override + public IStructureDefinition getStructureDefinition() { + return (IStructureDefinition) STRUCTURE_DEFINITION; + } + + private void onCasingAdded() { + mCasingAmount++; + } + + private byte glasTier; + + private boolean addGlas(Block block, int meta) { + if (block != ItemRegistry.bw_glasses[0]) { + return false; + } + byte tier = BW_Util.getTierFromGlasMeta(meta); + if (glasTier > 0) { + return tier == glasTier; + } + glasTier = tier; + return true; + } + + @Override + public String[] getInfoData() { + return LoaderReference.tectech ? this.getInfoDataArray(this) : super.getInfoData(); + } + + @Override + @Optional.Method(modid = "tectech") + public List getVanillaEnergyHatches() { + return this.mEnergyHatches; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + @Optional.Method(modid = "tectech") + public List getTecTechEnergyTunnels() { + return TTTunnels; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + @Optional.Method(modid = "tectech") + public List getTecTechEnergyMultis() { + return TTMultiAmp; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java new file mode 100644 index 0000000000..4aef8d7c93 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -0,0 +1,455 @@ +/* + * Copyright (c) 2022 SKYCATV587 + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; + +import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.API.SideReference; +import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.system.material.*; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.MegaUtils; +import com.github.bartimaeusnek.bartworks.util.Pair; +import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; +import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; +import com.gtnewhorizon.structurelib.StructureLibAPI; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.IStructureElement; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import cpw.mods.fml.common.Optional; +import gregtech.api.GregTech_API; +import gregtech.api.enums.HeatingCoilLevel; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TextureSet; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_OilCracker; +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.util.GT_StructureUtility.*; + +@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) +public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker implements TecTechEnabledMulti { + + public GT_TileEntity_MegaOilCracker(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_MegaOilCracker(String aName) { + super(aName); + } + + @Override + public GT_Multiblock_Tooltip_Builder createTooltip() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Oil Cracking Unit") + .addInfo("Controller block for the Mega Oil Cracking") + .addInfo("Thermally cracks heavy hydrocarbons into lighter fractions") + .addInfo("More efficient than the Chemical Reactor") + .addInfo("Gives different benefits whether it hydro or steam-cracks:") + .addInfo("Hydro - Consumes 20% less Hydrogen and outputs 25% more cracked fluid") + .addInfo("Steam - Outputs 50% more cracked fluid") + .addInfo("(Values compared to cracking in the Chemical Reactor)") + .addInfo("Place the appropriate circuit in the controller") + .addSeparator() + .beginStructureBlock(13, 7, 9, true) + .addController("Front bottom") + .addStructureInfo("The glass tier limits the Energy Input tier") + .addInfo("Gets 10% EU/t reduction per coil tier, up to a maximum of 50%") + .addEnergyHatch("Hint block",1) + .addMaintenanceHatch("Hint block",1) + .addInputHatch("Hint block",2,3) + .addOutputHatch("Hint block",2,3) + .addInputHatch("Steam/Hydrogen ONLY, Hint block",4) + .toolTipFinisher(BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); + return tt; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_TileEntity_MegaOilCracker(this.mName); + } + + @SuppressWarnings("rawtypes") + public ArrayList TTTunnels = new ArrayList<>(); + @SuppressWarnings("rawtypes") + public ArrayList TTMultiAmp = new ArrayList<>(); + + @Override + public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (LoaderReference.tectech) { + return TecTechUtils.addEnergyInputToMachineList(this, aTileEntity, aBaseCasingIndex); + } + return super.addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); + } + + @Override + public boolean drainEnergyInput(long aEU) { + if (LoaderReference.tectech) { + return TecTechUtils.drainEnergyMEBFTecTech(this, aEU); + } + return MegaUtils.drainEnergyMegaVanilla(this, aEU); + } + + @Override + public long getMaxInputVoltage() { + if (LoaderReference.tectech) { + return TecTechUtils.getMaxInputVoltage(this); + } + return super.getMaxInputVoltage(); + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sCrackingRecipes; + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); + FluidStack[] tInputFluids = this.getStoredFluids().toArray(new FluidStack[0]); + ArrayList outputItems = new ArrayList<>(); + ArrayList outputFluids = new ArrayList<>(); + + long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + + byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); + + GT_Recipe tRecipe = getRecipeMap().findRecipe( + getBaseMetaTileEntity(), + false, + gregtech.api.enums.GT_Values.V[tTier], + tInputFluids, + mInventory[1] + ); + + boolean found_Recipe = false; + int processed = 0; + + if (tRecipe != null) { + found_Recipe = true; + long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); + int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); + if (tCurrentPara <= 0) { + return false; + } + processed = tCurrentPara; + Pair, ArrayList> Outputs = getMultiOutput(tRecipe, tCurrentPara); + outputFluids = Outputs.getKey(); + outputItems = Outputs.getValue(); + } + + if (found_Recipe) { + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + long actualEUT = (long) (tRecipe.mEUt) * processed; + if (actualEUT > Integer.MAX_VALUE) { + byte divider = 0; + while (actualEUT > Integer.MAX_VALUE) { + actualEUT = actualEUT / 2; + divider++; + } + calculatePerfectOverclockedNessMulti((int) actualEUT, tRecipe.mDuration * (divider * 2), 1, nominalV); + } else { + calculatePerfectOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, nominalV); + } + //In case recipe is too OP for that machine + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) { + return false; + } + + if (this.heatLevel.getTier() < 5) { + this.mEUt *= 1 - (0.1D * (this.heatLevel.getTier() + 1)); + } + else { + this.mEUt *= 0.5; + } + + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[outputItems.size()]; + this.mOutputItems = outputItems.toArray(this.mOutputItems); + this.mOutputFluids = new FluidStack[outputFluids.size()]; + this.mOutputFluids = outputFluids.toArray(this.mOutputFluids); + this.updateSlots(); + return true; + } + return false; + } + + @Override + public void construct(ItemStack aStack, boolean aHintsOnly) { + buildPiece(STRUCTURE_PIECE_MAIN,aStack,aHintsOnly,6,6,0); + } + + // -------------- TEC TECH COMPAT ---------------- + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + glasTier = 0; + + if (LoaderReference.tectech) { + this.getTecTechEnergyMultis().clear(); + this.getTecTechEnergyTunnels().clear(); + } + + if(checkPiece(STRUCTURE_PIECE_MAIN,6,6,0)&&(mMaintenanceHatches.size()==1)&&(mEnergyHatches.size()<=2)){ + return false; + } + + + if (this.glasTier != 8 && !this.mEnergyHatches.isEmpty()) { + for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) { + if (this.glasTier < hatchEnergy.mTier) { + return false; + } + } + } + + return true; + } + + private static final int CASING_INDEX = 49; + private static final String STRUCTURE_PIECE_MAIN = "main"; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {" p p ", "ppgggggggggpp", " pgggggggggp ", " pgggpppgggp ", " pgggpMpgggp ", " pgggpppgggp ", " pgggggggggp ", "ppgggggggggpp", " p p "}, + {" p p ", "pgggggggggggp", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", "pgggggggggggp", " p p "}, + {" p p ", "pgggggggggggp", " g c c c c g ", " p c c p ", " p c c c c p ", " p c c p ", " g c c c c g ", "pgggggggggggp", " p p "}, + {" p p ", "pgggggggggggp", " g c c c c g ", " p c c c c p ", " l c c c c r ", " p c c c c p ", " g c c c c g ", "pgggggggggggp", " p p "}, + {" p p ", "pgggggggggggp", " g c c c c g ", " p c c p ", " p c c c c p ", " p c c p ", " g c c c c g ", "pgggggggggggp", " p p "}, + {" p p ", "pgggggggggggp", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", "pgggggggggggp", " p p "}, + {"ppmmmm~mmmmpp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppmmmmmmmmmpp"}, + + })) + .addElement('c', ofCoil(GT_TileEntity_MegaOilCracker::setCoilLevel, GT_TileEntity_MegaOilCracker::getCoilLevel)) + .addElement('p', ofBlock(GregTech_API.sBlockCasings4, 1)) +// .addElement('s', addTileCasing(BW_GT_MaterialReference.StainlessSteel)) + .addElement('l', ofChain( + ofHatchAdder(GT_TileEntity_MegaOilCracker::addLeftHatchToMachineList, CASING_INDEX, 2) + )) + .addElement('r', ofChain( + ofHatchAdder(GT_TileEntity_MegaOilCracker::addRightHatchToMachineList, CASING_INDEX, 3) + )) + .addElement('m', ofChain( + ofHatchAdder(GT_TileEntity_MegaOilCracker::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_MegaOilCracker::addMaintenanceToMachineList, CASING_INDEX, 1), + onElementPass(GT_TileEntity_MegaOilCracker::onCasingAdded, ofBlock(GregTech_API.sBlockCasings4, 1)) + )) + .addElement('M', ofChain( + ofHatchAdder(GT_TileEntity_MegaOilCracker::addMiddleInputToMachineList, CASING_INDEX, 4) + )) + .addElement('g', ofChain( + ofBlockAdder(GT_TileEntity_MegaOilCracker::addGlas, ItemRegistry.bw_glasses[0], 1) + )) + .build(); + + private HeatingCoilLevel heatLevel; + + private int mCoilAmount; + + private boolean addLeftHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + if (mInputOnSide == 1){ + return false; + } + mInputOnSide = 0; + mOutputOnSide = 1; + GT_MetaTileEntity_Hatch_Input tHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity; + tHatch.updateTexture(aBaseCasingIndex); + tHatch.mRecipeMap = getRecipeMap(); + return mInputHatches.add(tHatch); + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { + if (mOutputOnSide == 1){ + return false; + } + mInputOnSide = 1; + mOutputOnSide = 0; + GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aMetaTileEntity; + tHatch.updateTexture(aBaseCasingIndex); + return mOutputHatches.add(tHatch); + } + return false; + } + + private boolean addRightHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + if (mInputOnSide == 0){ + return false; + } + mInputOnSide = 1; + mOutputOnSide = 0; + GT_MetaTileEntity_Hatch_Input tHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity; + tHatch.updateTexture(aBaseCasingIndex); + tHatch.mRecipeMap = getRecipeMap(); + return mInputHatches.add(tHatch); + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { + if (mOutputOnSide == 0){ + return false; + } + mInputOnSide = 0; + mOutputOnSide = 1; + GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aMetaTileEntity; + tHatch.updateTexture(aBaseCasingIndex); + return mOutputHatches.add(tHatch); + } + return false; + } + + private boolean addMiddleInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + GT_MetaTileEntity_Hatch_Input tHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity; + tHatch.updateTexture(aBaseCasingIndex); + tHatch.mRecipeMap = getRecipeMap(); + return mMiddleInputHatches.add(tHatch); + } + return false; + } + + @Override + public ArrayList getStoredFluids() { + ArrayList rList = new ArrayList<>(); + for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) { + if (!GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tHatch.getFillableStack())) { + rList.add(tHatch.getFillableStack()); + } + } + } + for (GT_MetaTileEntity_Hatch_Input tHatch : mMiddleInputHatches) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) { + FluidStack tStack = tHatch.getFillableStack(); + if (GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tStack)) { + rList.add(tStack); + } + } + } + return rList; + } + + @Override + public IStructureDefinition getStructureDefinition() { + return (IStructureDefinition) STRUCTURE_DEFINITION; + } + + private void onCasingAdded() { + mCasingAmount++; + } + + private byte glasTier; + + private boolean addGlas(Block block, int meta) { + if (block != ItemRegistry.bw_glasses[0]) { + return false; + } + byte tier = BW_Util.getTierFromGlasMeta(meta); + if (glasTier > 0) { + return tier == glasTier; + } + glasTier = tier; + return true; + } + + private void onCoilAdded() { + mCoilAmount++; + } + + + + @Override + public String[] getInfoData() { + return LoaderReference.tectech ? this.getInfoDataArray(this) : super.getInfoData(); + } + + @Override + @Optional.Method(modid = "tectech") + public List getVanillaEnergyHatches() { + return this.mEnergyHatches; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + @Optional.Method(modid = "tectech") + public List getTecTechEnergyTunnels() { + return TTTunnels; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + @Optional.Method(modid = "tectech") + public List getTecTechEnergyMultis() { + return TTMultiAmp; + } + + +} -- cgit From ee3e7a57027cfbbc5d594ea016a0b68c9bcd8dc0 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Wed, 9 Feb 2022 12:52:48 +0100 Subject: Add minimum casings to THTR and HTGR (#88) * Add minimum casings to THTR and HTGR * Fix Former-commit-id: aa7a024bdcd5797622b478d63d5fb90e62de3a88 --- .../tileentities/multis/GT_TileEntity_HTGR.java | 27 ++++++++++++++++------ .../tileentities/multis/GT_TileEntity_THTR.java | 27 ++++++++++++++++------ 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 40e2a8b878..3c9d4792b3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -57,9 +57,7 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; @@ -88,14 +86,26 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, {" bbb~bbb "," bbbbbbbbb ","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb"," bbbbbbbbb "," bbbbbbb "}, })) - .addElement('c', ofBlock(GregTech_API.sBlockCasings8, 5)) + .addElement('c', + onElementPass( + x -> x.mCasing++, + ofBlock(GregTech_API.sBlockCasings8, 5)) + ) .addElement('b', ofChain( ofHatchAdder(GT_TileEntity_HTGR::addOutputToMachineList, BASECASINGINDEX, 1), ofHatchAdder(GT_TileEntity_HTGR::addMaintenanceToMachineList, BASECASINGINDEX, 1), ofHatchAdder(GT_TileEntity_HTGR::addEnergyInputToMachineList, BASECASINGINDEX, 1), - ofBlock(GregTech_API.sBlockCasings8, 5) + onElementPass( + x -> x.mCasing++, + ofBlock(GregTech_API.sBlockCasings8, 5)) )) - .addElement('B', ofHatchAdderOptional(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2, GregTech_API.sBlockCasings8, 5)) + .addElement('B', ofChain( + ofHatchAdder(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2), + onElementPass( + x -> x.mCasing++, + ofBlock(GregTech_API.sBlockCasings8, 5)) + )) + //ofHatchAdderOptional(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2, GregTech_API.sBlockCasings8, 5)) .build(); private static final int HELIUM_NEEDED = 730000; @@ -107,6 +117,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase private boolean empty; private int emptyticksnodiff = 0; private int coolanttaking = 0; + private int mCasing = 0; public GT_TileEntity_HTGR(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -141,7 +152,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase .addSeparator() .beginStructureBlock(11, 12, 11, true) .addController("Front bottom center") - .addCasingInfo("Europium Reinforced Radiation Proof Casings", 0) + .addCasingInfo("Europium Reinforced Radiation Proof Casings", 500) .addStructureInfo("Corners and the 2 touching blocks are air (cylindric)") .addInputBus("Any top layer casing", 2) .addInputHatch("Any top layer casing", 2) @@ -165,8 +176,10 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + this.mCasing = 0; return ( checkPiece("main", 5, 11, 0) && + this.mCasing >= 500 && this.mMaintenanceHatches.size() == 1 && this.mInputHatches.size() > 0 && this.mOutputHatches.size() > 0 && diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 39113db002..d44a71796e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -55,9 +55,7 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; @@ -83,14 +81,26 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, {" bbb~bbb "," bbbbbbbbb ","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb"," bbbbbbbbb "," bbbbbbb "}, })) - .addElement('c', ofBlock(GregTech_API.sBlockCasings3, 12)) + .addElement('c', + onElementPass( + x -> x.mCasing++, + ofBlock(GregTech_API.sBlockCasings3, 12)) + ) .addElement('b', ofChain( ofHatchAdder(GT_TileEntity_THTR::addOutputToMachineList, BASECASINGINDEX, 1), ofHatchAdder(GT_TileEntity_THTR::addMaintenanceToMachineList, BASECASINGINDEX, 1), ofHatchAdder(GT_TileEntity_THTR::addEnergyInputToMachineList, BASECASINGINDEX, 1), - ofBlock(GregTech_API.sBlockCasings3, 12) + onElementPass( + x -> x.mCasing++, + ofBlock(GregTech_API.sBlockCasings3, 12)) )) - .addElement('B', ofHatchAdderOptional(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2, GregTech_API.sBlockCasings3, 12)) + .addElement('B', ofChain( + ofHatchAdder(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2), + onElementPass( + x -> x.mCasing++, + ofBlock(GregTech_API.sBlockCasings3, 12)) + )) + //ofHatchAdderOptional(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2, GregTech_API.sBlockCasings3, 12)) .build(); @@ -104,6 +114,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase private int fuelsupply; private boolean empty; private int coolanttaking = 0; + private int mCasing = 0; public GT_TileEntity_THTR(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -138,7 +149,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase .addSeparator() .beginStructureBlock(11, 12, 11, true) .addController("Front bottom center") - .addCasingInfo("Radiation Proof Casings", 0) + .addCasingInfo("Radiation Proof Casings", 500) .addStructureInfo("Corners and the 2 touching blocks are air (cylindric)") .addInputBus("Any top layer casing", 2) .addInputHatch("Any top layer casing", 2) @@ -162,8 +173,10 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + this.mCasing = 0; return ( checkPiece(STRUCTURE_PIECE_MAIN, 5, 11, 0) && + this.mCasing >= 500 && this.mMaintenanceHatches.size() == 1 && this.mInputHatches.size() > 0 && this.mOutputHatches.size() > 0 && -- cgit From 9dca8b4d7c829e84f2d230cebfdea1650a2d0c35 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Wed, 9 Feb 2022 14:44:46 +0100 Subject: Updatedeps (#91) * update dependencies, including buildscript and buildcraft * buildcraft version * more deps Co-authored-by: bombcar Former-commit-id: 912679df81e78a6233524e8a5bc6a247a60cfe9b --- dependencies.gradle | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 71df9efa3d..c0090b5a4d 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -26,10 +26,11 @@ dependencies { compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.5:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:Railcraft:9.13.5:api") { + compileOnly("com.github.GTNewHorizons:Railcraft:9.13.6:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.28:api") { + + compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.29:api") { transitive = false } -- cgit From a8af77fcd71449a38e954a1194c7b9648939f409 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Fri, 11 Feb 2022 00:59:53 +0800 Subject: fix render crash when placing bw block in world (#90) * fix render crash when placing bw block in world Former-commit-id: e8cbb2997ef95a7ebf55e3e4dafcd67641fa9c35 --- .../client/renderer/BW_Renderer_Block_Ores.java | 26 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index 364529af99..aff0f71184 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -26,7 +26,9 @@ import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Blocks; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; +import gregtech.GT_Mod; import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.world.IBlockAccess; import org.lwjgl.opengl.GL11; @@ -37,16 +39,19 @@ import static gregtech.common.render.GT_Renderer_Block.renderNegativeZFacing; import static gregtech.common.render.GT_Renderer_Block.renderPositiveXFacing; import static gregtech.common.render.GT_Renderer_Block.renderPositiveYFacing; import static gregtech.common.render.GT_Renderer_Block.renderPositiveZFacing; -import static gregtech.common.render.GT_Renderer_Block.renderStandardBlock; public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { public static BW_Renderer_Block_Ores INSTANCE = new BW_Renderer_Block_Ores(); public final int mRenderID = RenderingRegistry.getNextAvailableRenderId(); + public static final float blockMin = 0.0F; + public static final float blockMax = 1.0F; @Override public void renderInventoryBlock(Block aBlock, int aMeta, int modelId, RenderBlocks aRenderer) { BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks)aBlock).getProperTileEntityForRendering(); tTileEntity.mMetaData = (short) aMeta; + aRenderer.enableAO = false; + aRenderer.useInventoryTint = true; aBlock.setBlockBoundsForItemRender(); aRenderer.setRenderBoundsFromBlock(aBlock); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); @@ -57,14 +62,27 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 3), true); renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 4), true); renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 5), true); - aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); aRenderer.setRenderBoundsFromBlock(aBlock); + aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax); GL11.glTranslatef(0.5F, 0.5F, 0.5F); + aRenderer.useInventoryTint = false; } @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return renderStandardBlock(world, x, y, z, block, renderer); + public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int modelId, RenderBlocks aRenderer) { + BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks)aBlock).getProperTileEntityForRendering(); + tTileEntity.mMetaData = ((BW_MetaGenerated_Block_TE) aWorld.getTileEntity(aX, aY, aZ)).mMetaData; + aRenderer.useInventoryTint = false; + aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax); + aRenderer.enableAO = Minecraft.isAmbientOcclusionEnabled() && GT_Mod.gregtechproxy.mRenderTileAmbientOcclusion; + aRenderer.setRenderBoundsFromBlock(aBlock); + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tTileEntity.getTexture(aBlock, (byte) 0), true); + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tTileEntity.getTexture(aBlock, (byte) 1), true); + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tTileEntity.getTexture(aBlock, (byte) 2), true); + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tTileEntity.getTexture(aBlock, (byte) 3), true); + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tTileEntity.getTexture(aBlock, (byte) 4), true); + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tTileEntity.getTexture(aBlock, (byte) 5), true); + return true; } @Override -- cgit From 4c762f360ca91d800698824fdc06b77db6ece1bb Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Sat, 12 Feb 2022 04:09:18 +0800 Subject: fix material disappear (#82) * stop disable material and add material link * disble when a gt material exist * null check Former-commit-id: b1507b008ed7fa4fa8f1544105d3bce4ec8248fe --- .../common/loaders/StaticRecipeChangeLoaders.java | 21 ++++++++++++++++++++- .../bartworks/system/material/WerkstoffLoader.java | 4 ++-- .../werkstoff_loaders/recipe/ToolLoader.java | 2 +- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 94bfb4c584..684149c9f6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -123,6 +123,7 @@ public class StaticRecipeChangeLoaders { public static void unificationRecipeEnforcer() { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { + StaticRecipeChangeLoaders.runMaterialLinker(werkstoff); if (werkstoff.getGenerationFeatures().enforceUnification) { if (werkstoff.contains(NOBLE_GAS)) @@ -262,6 +263,24 @@ public class StaticRecipeChangeLoaders { } } + private static void runMaterialLinker(Werkstoff werkstoff) { + if (werkstoff.getType() == Werkstoff.Types.ELEMENT) { + if (werkstoff.getBridgeMaterial() != null) { + werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip()); + Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>(); + Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial()); + } + } + + for (OrePrefixes prefixes : OrePrefixes.values()) + if (werkstoff.hasItemType(prefixes) && werkstoff.getBridgeMaterial() != null) { + GT_OreDictUnificator.set(prefixes, werkstoff.getBridgeMaterial(), werkstoff.get(prefixes), true, true); + for (ItemStack stack : OreDictionary.getOres(prefixes + werkstoff.getVarName())) { + GT_OreDictUnificator.addAssociation(prefixes, werkstoff.getBridgeMaterial(), stack, false); + } + } + } + private static ArrayListMultimap getRecipesToChange(SubTag... GasTags) { ArrayListMultimap toAdd = ArrayListMultimap.create(); for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList) { @@ -557,4 +576,4 @@ public class StaticRecipeChangeLoaders { ) )); } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index d5639cbb8b..1f2f53f18f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1631,8 +1631,8 @@ public class WerkstoffLoader { } } for (OrePrefixes p : values()) - if (!werkstoff.getGenerationFeatures().enforceUnification && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(), p, 1) != null) { - DebugLog.log("Found: " + (p + werkstoff.getVarName()) + " in oreDict, disable and reroute my Items to that, also add a Tooltip."); + if (Materials.get(werkstoff.getDefaultName()) != null && Materials.get(werkstoff.getDefaultName()).mMetaItemSubID != -1 && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(), p, 1) != null) { + DebugLog.log("Found: " + (p + werkstoff.getVarName()) + " in GT material system, disable and reroute my Items to that, also add a Tooltip."); werkstoff.getGenerationFeatures().setBlacklist(p); } WerkstoffLoader.toGenerateGlobal = (WerkstoffLoader.toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java index adac18c27c..520643d1fd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java @@ -101,7 +101,7 @@ public class ToolLoader implements IWerkstoffRunnable { GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"II ", "IIh", "II ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', ingot.get(werkstoff.getBridgeMaterial())}); - if (werkstoff.hasItemType(plateDouble)) { + if (werkstoff.hasItemType(plateDouble) && werkstoff.hasItemType(cellMolten)) { GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(turbineBlade, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"fPd", "SPS", " P ", 'P', plateDouble.get(werkstoff.getBridgeMaterial()), 'S', screw.get(werkstoff.getBridgeMaterial())}); GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 6), ItemList.Shape_Extruder_Turbine_Blade.get(0), werkstoff.get(turbineBlade, 1), (int) werkstoff.getStats().getMass() / 2 * 20, 120); GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Turbine_Blade.get(0), werkstoff.getMolten(864), werkstoff.get(turbineBlade, 1), (int) werkstoff.getStats().getMass() * 20, 120); -- cgit From c1bc878822ae635c251e38358e5e3c21a09fe608 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Tue, 15 Feb 2022 05:13:42 +0800 Subject: uhv and uev glass (#92) Former-commit-id: ab8787b69208e6804c6ed8c1e086bf2cb6e2fdd8 --- .../bartworks/common/loaders/BeforeGTPreload.java | 2 ++ .../bartworks/common/loaders/ItemRegistry.java | 4 +++- .../bartworks/common/loaders/RecipeLoader.java | 4 ++++ .../multis/GT_TileEntity_CircuitAssemblyLine.java | 4 +++- .../multis/mega/GT_TileEntity_MegaBlastFurnace.java | 1 + .../mega/GT_TileEntity_MegaChemicalReactor.java | 1 + .../multis/mega/GT_TileEntity_MegaOilCracker.java | 1 + .../github/bartimaeusnek/bartworks/util/BW_Util.java | 18 ++++++++++++++++-- src/main/resources/assets/bartworks/lang/en_US.lang | 2 ++ .../EuropiumReinforcedBoronSilicateGlassBlock.png | Bin 0 -> 106 bytes .../UraniumReinforcedBoronSilicateGlassBlock.png | Bin 0 -> 185 bytes 11 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 src/main/resources/assets/bartworks/textures/blocks/EuropiumReinforcedBoronSilicateGlassBlock.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/UraniumReinforcedBoronSilicateGlassBlock.png diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java index 11c9d96f66..eb79febe39 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java @@ -102,6 +102,8 @@ public class BeforeGTPreload implements Runnable { OreDictionary.registerOre("blockGlassLuV", new ItemStack(bw_glasses[0], 1, 3)); OreDictionary.registerOre("blockGlassZPM", new ItemStack(bw_glasses[0], 1, 4)); OreDictionary.registerOre("blockGlassUV", new ItemStack(bw_glasses[0], 1, 5)); + OreDictionary.registerOre("blockGlassUHV", new ItemStack(bw_glasses[0], 1, 13)); + OreDictionary.registerOre("blockGlassUEV", new ItemStack(bw_glasses[0], 1, 14)); } catch (IllegalAccessException | NoSuchFieldException | ClassNotFoundException e) { e.printStackTrace(); FMLCommonHandler.instance().exitJava(-1, true); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 561674bd75..dbe663f3e8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -104,8 +104,10 @@ public class ItemRegistry { MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock5", MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock6", MainMod.MOD_ID + ":ThoriumYttriumGlass", + MainMod.MOD_ID + ":UraniumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":EuropiumReinforcedBoronSilicateGlassBlock", }, - new short[][]{Materials.BorosilicateGlass.getRGBA(), Materials.Nickel.getRGBA(), Materials.Tungsten.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), Materials.Osmium.getRGBA(), new short[]{0xff, 0, 0}, new short[]{0, 0xff, 0}, new short[]{0x80, 0, 0xff}, new short[]{0xff, 0xff, 0}, new short[]{0, 0xff, 0x80}, new short[]{0x80, 0x33, 0}, WerkstoffLoader.YttriumOxide.getRGBA()}, + new short[][]{Materials.BorosilicateGlass.getRGBA(), Materials.Nickel.getRGBA(), Materials.Tungsten.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), Materials.Osmium.getRGBA(), new short[]{0xff, 0, 0}, new short[]{0, 0xff, 0}, new short[]{0x80, 0, 0xff}, new short[]{0xff, 0xff, 0}, new short[]{0, 0xff, 0x80}, new short[]{0x80, 0x33, 0}, WerkstoffLoader.YttriumOxide.getRGBA(), Materials.Uranium235.getRGBA(), Materials.Europium.getRGBA()}, MainMod.BIO_TAB, true, false ); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index cf31a88cd1..b313a68b5e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -266,6 +266,8 @@ public class RecipeLoader { GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), Materials.Chrome.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), 800, BW_Util.getMachineVoltageFromTier(5)); GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), Materials.Iridium.getMolten(3888), new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), 800, BW_Util.getMachineVoltageFromTier(6)); GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), Materials.Osmium.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), 800, BW_Util.getMachineVoltageFromTier(7)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), Materials.Uranium235.getMolten(2304), new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), 800, BW_Util.getMachineVoltageFromTier(8)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), Materials.Europium.getMolten(4608), new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), 800, BW_Util.getMachineVoltageFromTier(9)); for (int i = 0; i < Dyes.dyeBrown.getSizeOfFluidList(); ++i) { GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeRed.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 6), null, null, null, 64, 2); @@ -281,6 +283,8 @@ public class RecipeLoader { GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9)}, null, 800, BW_Util.getMachineVoltageFromTier(6)); GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9), Materials.Iridium.getDust(27)}, null, 800, BW_Util.getMachineVoltageFromTier(7)); GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9), Materials.Osmiridium.getDust(36)}, null, 800, BW_Util.getMachineVoltageFromTier(8)); + GT_Values.RA.addFluidExtractionRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), Materials.Uranium235.getMolten(2304), 1000 , 800, BW_Util.getMachineVoltageFromTier(9)); + GT_Values.RA.addFluidExtractionRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), Materials.Europium.getMolten(4608), 1000 , 800, BW_Util.getMachineVoltageFromTier(10)); for (int i = 6; i < 11; i++) { GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, i), new ItemStack[]{Materials.BorosilicateGlass.getDust(9)}, null, 400, BW_Util.getMachineVoltageFromTier(1)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 4f0c6bae2c..79a10a8f7d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -78,7 +78,9 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance ofBlock(ItemRegistry.bw_realglas, 3), ofBlock(ItemRegistry.bw_realglas, 4), ofBlock(ItemRegistry.bw_realglas, 5), - ofBlock(ItemRegistry.bw_realglas, 12) + ofBlock(ItemRegistry.bw_realglas, 12), + ofBlock(ItemRegistry.bw_realglas, 13), + ofBlock(ItemRegistry.bw_realglas, 14) )) .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 5)) //assembling line casings .addElement('b', ofChain( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index e1965cc90c..f9263f140a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -459,6 +459,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl if (block != ItemRegistry.bw_glasses[0]) return false; byte tier = BW_Util.getTierFromGlasMeta(meta); + if (tier >= 8) tier = 8; if (glasTier > 0) return tier == glasTier; glasTier = tier; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index ba6afeb0c4..3aaeab8c30 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -271,6 +271,7 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeCh return false; } byte tier = BW_Util.getTierFromGlasMeta(meta); + if (tier >= 8) tier = 8; if (glasTier > 0) { return tier == glasTier; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index 4aef8d7c93..c8e9c00d58 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -413,6 +413,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i return false; } byte tier = BW_Util.getTierFromGlasMeta(meta); + if (tier >= 8) tier = 8; if (glasTier > 0) { return tier == glasTier; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index cc0c56214e..35a7c5e89d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -344,6 +344,12 @@ public class BW_Util { case 5: ret = 8; break; + case 13: + ret = 9; + break; + case 14: + ret = 10; + break; default: ret = 3; } @@ -587,8 +593,16 @@ public class BW_Util { } } - if (block.equals(bw_realglasRef)) - return meta == 12 ? 5 : meta > 1 && meta < 6 ? (byte) (meta + 3) : 4; + if (block.equals(bw_realglasRef)) { + if (meta > 12) { + return (byte) (meta - 3); + } + if (meta == 12) + return 12; + if (meta > 1 && meta < 6) + return (byte) (meta + 3); + return 4; + } if (block.getUnlocalizedName().equals("blockAlloyGlass")) return 4; diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 84930900d1..bebfa4161c 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -56,6 +56,8 @@ BW_GlasBlocks.9.name=Colored Borosilicate Glass Block (Yellow) BW_GlasBlocks.10.name=Colored Borosilicate Glass Block (Light Green) BW_GlasBlocks.11.name=Colored Borosilicate Glass Block (Brown) BW_GlasBlocks.12.name=Thorium Yttrium Glass Block +BW_GlasBlocks.13.name=Uranium Reinforced Borosilicate Glass Block +BW_GlasBlocks.14.name=Europium Reinforced Borosilicate Glass Block tooltip.glas.0.name=Glass-Tier: tooltip.LESU.0.name=Maximum Capacity! diff --git a/src/main/resources/assets/bartworks/textures/blocks/EuropiumReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/EuropiumReinforcedBoronSilicateGlassBlock.png new file mode 100644 index 0000000000..5255386cc6 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/EuropiumReinforcedBoronSilicateGlassBlock.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/UraniumReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/UraniumReinforcedBoronSilicateGlassBlock.png new file mode 100644 index 0000000000..0cc6e08ae3 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/UraniumReinforcedBoronSilicateGlassBlock.png differ -- cgit From 91b365c0bf0138dba87d4648898f78b2b76db50e Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Tue, 15 Feb 2022 17:08:00 +0800 Subject: oversight (#93) Former-commit-id: bcc55b7c390bcd64f6faa87a8eb15d9e653e451c --- src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 35a7c5e89d..f7ef9806c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -598,7 +598,7 @@ public class BW_Util { return (byte) (meta - 3); } if (meta == 12) - return 12; + return 5; if (meta > 1 && meta < 6) return (byte) (meta + 3); return 4; @@ -862,4 +862,4 @@ public class BW_Util { } } -} \ No newline at end of file +} -- cgit From 7252f84377957aadcbb3b64b1b369209f1846e95 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Fri, 18 Feb 2022 01:57:21 +0800 Subject: check all oredicts to gen cal recips (#94) some circuits failed to generate the CAL recipe after certain coremod update cuz they get additional oredicts Former-commit-id: 10de572d4a441c9313569554ab56d9221df87be6 --- .../CircuitGeneration/CircuitImprintLoader.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 90740455c2..409d69a8f4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -88,9 +88,9 @@ public class CircuitImprintLoader { private static void handleCircuitRecipeRebuilding(GT_Recipe circuitRecipe, HashSet toRem, HashSet toAdd) { ItemStack[] outputs = circuitRecipe.mOutputs; - String name = getTypeFromOreDict(outputs); + boolean isOrePass = isCircuitOreDict(outputs[0]); String unlocalizedName = outputs[0].getUnlocalizedName(); - if (name.contains("Circuit") || name.contains("circuit") || unlocalizedName.contains("Circuit") || unlocalizedName.contains("circuit")) { + if (isOrePass || unlocalizedName.contains("Circuit") || unlocalizedName.contains("circuit")) { CircuitImprintLoader.recipeTagMap.put(CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); @@ -106,6 +106,7 @@ public class CircuitImprintLoader { } } + @Deprecated private static String getTypeFromOreDict(ItemStack[] outputs) { int[] oreIDS = OreDictionary.getOreIDs(outputs[0]); @@ -115,6 +116,20 @@ public class CircuitImprintLoader { return OreDictionary.getOreName(oreIDS[0]); } + private static boolean isCircuitOreDict(ItemStack item) { + int[] oreIDS = OreDictionary.getOreIDs(item); + + if (oreIDS.length < 1) + return false; + + for (int oreID : oreIDS) { + if (OreDictionary.getOreName(oreID).contains("Circuit") || OreDictionary.getOreName(oreID).contains("circuit")) + return true; + } + + return false; + } + private static void exchangeRecipesInList(HashSet toRem, HashSet toAdd) { GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.addAll(toAdd); GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(toRem); -- cgit From d246612148b9b6dfaa4dfabd399f077ea0544096 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Wed, 23 Feb 2022 13:03:46 +0800 Subject: Consolidate boro glass stuff into a real API (#95) * Consolidate boro glass stuff into a real API * pull in changes from ExampleMod * Fix underflow * attempt to fix build Former-commit-id: 2413c93bc2bb5ab32a0e8078dbcf01a4b23b1f7d --- .editorconfig | 19 +++ .github/scripts/test-no-crash-reports.sh | 9 -- .github/scripts/test_no_error_reports | 51 +++++++ .github/workflows/build-and-test.yml | 20 +-- build.gradle | 159 ++++++++++++--------- .../bartworks/API/BorosilicateGlass.java | 152 ++++++++++++++++++++ .../bartworks/ASM/BWCoreTransformer.java | 3 + .../bartworks/common/items/BW_ItemBlocks.java | 7 +- .../mega/GT_TileEntity_MegaBlastFurnace.java | 20 +-- .../mega/GT_TileEntity_MegaChemicalReactor.java | 66 +++------ .../multis/mega/GT_TileEntity_MegaOilCracker.java | 70 ++------- .../bartimaeusnek/bartworks/util/BW_Util.java | 26 ++-- 12 files changed, 368 insertions(+), 234 deletions(-) create mode 100644 .editorconfig delete mode 100644 .github/scripts/test-no-crash-reports.sh create mode 100755 .github/scripts/test_no_error_reports create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..6effbc91a8 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +# This is the universal Text Editor Configuration +# for all GTNewHorizons projects +# See: https://editorconfig.org/ + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{bat,ini}] +end_of_line = crlf + +[*.{dtd,json,info,mcmeta,md,sh,svg,xml,xsd,xsl,yaml,yml}] +indent_size = 2 diff --git a/.github/scripts/test-no-crash-reports.sh b/.github/scripts/test-no-crash-reports.sh deleted file mode 100644 index c67e342c06..0000000000 --- a/.github/scripts/test-no-crash-reports.sh +++ /dev/null @@ -1,9 +0,0 @@ -directory="run/crash-reports" -if [ -d $directory ]; then - echo "Crash reports detected:" - cat $directory/* - exit 1 -else - echo "No crash reports detected" - exit 0 -fi diff --git a/.github/scripts/test_no_error_reports b/.github/scripts/test_no_error_reports new file mode 100755 index 0000000000..1fcc7396c6 --- /dev/null +++ b/.github/scripts/test_no_error_reports @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +# bashsupport disable=BP5006 # Global environment variables +RUNDIR="run" \ + CRASH="crash-reports" \ + SERVERLOG="server.log" + +# enable nullglob to get 0 results when no match rather than the pattern +shopt -s nullglob + +# store matches in array +crash_reports=("$RUNDIR/$CRASH/crash"*.txt) + +# if array not empty there are crash_reports +if [ "${#crash_reports[@]}" -gt 0 ]; then + # get the latest crash_report from array + latest_crash_report="${crash_reports[-1]}" + { + printf 'Latest crash report detected %s:\n' "${latest_crash_report##*/}" + cat "$latest_crash_report" + } >&2 + exit 1 +fi + +if grep --quiet --fixed-strings 'Fatal errors were detected' "$SERVERLOG"; then + { + printf 'Fatal errors detected:\n' + cat server.log + } >&2 + exit 1 +fi + +if grep --quiet --fixed-strings 'The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED' \ + "$SERVERLOG"; then + { + printf 'Server force stopped:' + cat server.log + } >&2 + exit 1 +fi + +if ! grep --quiet --perl-regexp --only-matching '.+Done \(.+\)\! For help, type "help" or "\?"' "$SERVERLOG"; then + { + printf 'Server did not finish startup:' + cat server.log + } >&2 + exit 1 +fi + +printf 'No crash reports detected' +exit 0 diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index a60a2b6468..56a1ad52cc 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -14,32 +14,32 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - with: + 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 minute + - name: Run server for 1.5 minutes run: | mkdir run - echo "eula=true" > run/eula.txt - timeout 60 ./gradlew runServer || true + echo "eula=true" > run/eula.txt + timeout 90 ./gradlew runServer 2>&1 | tee -a server.log || true - - name: Test no crashes happend + - name: Test no errors reported during server run run: | - chmod +x .github/scripts/test-no-crash-reports.sh - .github/scripts/test-no-crash-reports.sh + chmod +x .github/scripts/test_no_error_reports + .github/scripts/test_no_error_reports diff --git a/build.gradle b/build.gradle index 4f54c87f65..5906f8fc98 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,14 @@ -//version: 1643844119 +//version: 1644894948 /* 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 org.gradle.internal.logging.text.StyledTextOutput +import org.gradle.internal.logging.text.StyledTextOutputFactory +import org.gradle.internal.logging.text.StyledTextOutput.Style import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar @@ -15,20 +18,20 @@ import java.util.concurrent.TimeUnit buildscript { repositories { maven { - name = "forge" - url = "https://maven.minecraftforge.net" + name 'forge' + url 'https://maven.minecraftforge.net' } maven { - name = "sonatype" - url = "https://oss.sonatype.org/content/repositories/snapshots/" + name 'sonatype' + url 'https://oss.sonatype.org/content/repositories/snapshots/' } maven { - name = "Scala CI dependencies" - url = "https://repo1.maven.org/maven2/" + name 'Scala CI dependencies' + url 'https://repo1.maven.org/maven2/' } maven { - name = "jitpack" - url = "https://jitpack.io" + name 'jitpack' + url 'https://jitpack.io' } } dependencies { @@ -37,21 +40,26 @@ buildscript { } plugins { + id 'java-library' id 'idea' id 'eclipse' id 'scala' - id('org.jetbrains.kotlin.jvm') version ('1.6.10') apply false - id('org.ajoberstar.grgit') version('4.1.1') - id('com.github.johnrengelman.shadow') version('4.0.4') - id('com.palantir.git-version') version('0.13.0') apply false - id('de.undercouch.download') version('5.0.1') - id('maven-publish') + id 'maven-publish' + id 'org.jetbrains.kotlin.jvm' version '1.5.30' apply false + id 'org.jetbrains.kotlin.kapt' version '1.5.30' apply false + id 'org.ajoberstar.grgit' version '4.1.1' + id 'com.github.johnrengelman.shadow' version '4.0.4' + id 'com.palantir.git-version' version '0.13.0' apply false + id 'de.undercouch.download' version '5.0.1' + id 'com.github.gmazzo.buildconfig' version '3.0.3' apply false } if (project.file('.git/HEAD').isFile()) { apply plugin: 'com.palantir.git-version' } +def out = services.get(StyledTextOutputFactory).create('an-output') + apply plugin: 'forge' def projectJavaVersion = JavaLanguageVersion.of(8) @@ -167,8 +175,8 @@ configurations.all { try { 'git config core.fileMode false'.execute() } -catch (Exception e) { - logger.error("\u001B[31mgit isn't installed at all\u001B[0m") +catch (Exception ignored) { + out.style(Style.Failure).println("git isn't installed at all") } // Pulls version first from the VERSION env and then git tag @@ -177,19 +185,22 @@ String versionOverride = System.getenv("VERSION") ?: null try { identifiedVersion = versionOverride == null ? gitVersion() : versionOverride } -catch (Exception e) { - logger.error("\n\u001B[1;31mThis mod must be version controlled by Git AND the repository must provide at least one tag,\n" + - "or the VERSION override must be set! \u001B[32m(Don't download from GitHub using the ZIP option, instead\n" + - "clone the repository, see\u001B[33m https://gtnh.miraheze.org/wiki/Development \u001B[32mfor details.)\u001B[0m\n"); +catch (Exception ignored) { + out.style(Style.Failure).text( + 'This mod must be version controlled by Git AND the repository must provide at least one tag,\n' + + 'or the VERSION override must be set! ').style(Style.SuccessHeader).text('(Do NOT download from GitHub using the ZIP option, instead\n' + + 'clone the repository, see ').style(Style.Info).text('https://gtnh.miraheze.org/wiki/Development').style(Style.SuccessHeader).println(' for details.)' + ) versionOverride = 'NO-GIT-TAG-SET' identifiedVersion = versionOverride } version = minecraftVersion + '-' + identifiedVersion -String modVersion = identifiedVersion +ext { + modVersion = identifiedVersion +} -if( identifiedVersion.equals(versionOverride) ) { - logger.error('\u001B[31m\u001B[7mWe hope you know what you\'re doing using\u001B[0m\u001B[1;34m ' + modVersion + '\u001B[0m\n'); - logger.error('\7\u001B[31mGoing to blindly try to use\u001B[1;34m ' + modVersion + '\u001B[0m\u001B[31m, this probably won\'t work the way you expect!!\u001B[0m\n'); +if(identifiedVersion == versionOverride) { + out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7') } group = modGroup @@ -200,7 +211,6 @@ else { archivesBaseName = modId } - def arguments = [] def jvmArguments = [] @@ -214,8 +224,8 @@ if(usesMixins.toBoolean()) { } minecraft { - version = minecraftVersion + "-" + forgeVersion + "-" + minecraftVersion - runDir = "run" + version = minecraftVersion + '-' + forgeVersion + '-' + minecraftVersion + runDir = 'run' if (replaceGradleTokenInFile) { replaceIn replaceGradleTokenInFile @@ -248,8 +258,8 @@ minecraft { } } -if(file("addon.gradle").exists()) { - apply from: "addon.gradle" +if(file('addon.gradle').exists()) { + apply from: 'addon.gradle' } apply from: 'repositories.gradle' @@ -262,42 +272,42 @@ configurations { repositories { maven { - name = "Overmind forge repo mirror" - url = "https://gregtech.overminddl1.com/" + name 'Overmind forge repo mirror' + url 'https://gregtech.overminddl1.com/' } if(usesMixins.toBoolean()) { maven { - name = "sponge" - url = "https://repo.spongepowered.org/repository/maven-public" + name 'sponge' + url 'https://repo.spongepowered.org/repository/maven-public' } maven { - url = "https://jitpack.io" + 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") + 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") { + 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" + 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") + compile('com.github.GTNewHorizons:SpongeMixins:1.5.0') } } apply from: 'dependencies.gradle' -def mixingConfigRefMap = "mixins." + modId + ".refmap.json" +def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json' def refMap = "${tasks.compileJava.temporaryDir}" + File.separator + mixingConfigRefMap def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg" @@ -401,17 +411,16 @@ tasks.withType(JavaExec).configureEach { ) } -processResources -{ +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 + // replace modVersion and minecraftVersion expand "minecraftVersion": project.minecraft.version, "modVersion": modVersion, "modId": modId, @@ -422,7 +431,7 @@ processResources from refMap } - // copy everything else, thats not the mcmod.info + // copy everything else that's not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } @@ -430,7 +439,7 @@ processResources def getManifestAttributes() { def manifestAttributes = [:] - if(containsMixinsAndOrCoreModOnly.toBoolean() == false && (usesMixins.toBoolean() || coreModClass)) { + if(!containsMixinsAndOrCoreModOnly.toBoolean() && (usesMixins.toBoolean() || coreModClass)) { manifestAttributes += ["FMLCorePluginContainsFMLMod": true] } @@ -446,14 +455,14 @@ def getManifestAttributes() { manifestAttributes += [ "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", "MixinConfigs" : "mixins." + modId + ".json", - "ForceLoadAsMod" : containsMixinsAndOrCoreModOnly.toBoolean() == false + "ForceLoadAsMod" : !containsMixinsAndOrCoreModOnly.toBoolean() ] } return manifestAttributes } task sourcesJar(type: Jar) { - from (sourceSets.main.allJava) + from (sourceSets.main.allSource) from (file("$projectDir/LICENSE")) getArchiveClassifier().set('sources') } @@ -508,7 +517,7 @@ task devJar(type: Jar) { } task apiJar(type: Jar) { - from (sourceSets.main.allJava) { + from (sourceSets.main.allSource) { include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**' } @@ -533,14 +542,15 @@ artifacts { } } -// The gradle metadata includes all of the additional deps that we disabled from POM generation (including forgeBin with no groupID), +// The gradle metadata includes all of the additional deps that we disabled from POM generation (including forgeBin with no groupID), // and isn't strictly needed with the POM so just disable it. tasks.withType(GenerateModuleMetadata) { enabled = false } +// workaround variable hiding in pom processing +def projectConfigs = project.configurations -// publishing publishing { publications { maven(MavenPublication) { @@ -560,14 +570,21 @@ publishing { 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 - - // Remove all non GTNH deps here. - // Original intention was to remove an invalid forgeBin being generated without a groupId (mandatory), but - // it also removes all of the MC deps + + // remove extra garbage from minecraft and minecraftDeps configuration pom.withXml { + def badArtifacts = [:].withDefault {[] as Set} + for (configuration in [projectConfigs.minecraft, projectConfigs.minecraftDeps]) { + for (dependency in configuration.allDependencies) { + badArtifacts[dependency.group == null ? "" : dependency.group] += dependency.name + } + } + // example for specifying extra stuff to ignore + // badArtifacts["org.example.group"] += "artifactName" + Node pomNode = asNode() pomNode.dependencies.'*'.findAll() { - it.groupId.text() != 'com.github.GTNewHorizons' + badArtifacts[it.groupId.text()].contains(it.artifactId.text()) }.each() { it.parent().remove(it) } @@ -599,7 +616,7 @@ if (isNewBuildScriptVersionAvailable(projectDir.toString())) { if (autoUpdateBuildScript.toBoolean()) { performBuildScriptUpdate(projectDir.toString()) } else { - println("Build script update available! Run 'gradle updateBuildScript'") + out.style(Style.SuccessHeader).println("Build script update available! Run 'gradle updateBuildScript'") } } @@ -611,7 +628,7 @@ 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!") + out.style(Style.Success).print("Build script updated. Please REIMPORT the project or RESTART your IDE!") return true } return false @@ -673,26 +690,26 @@ def deobf(String sourceURL) { } } -// The method above is to be prefered. Use this method if the filename is not at the end of the URL. +// The method above is to be preferred. Use this method if the filename is not at the end of the URL. def deobf(String sourceURL, String fileName) { String cacheDir = System.getProperty("user.home") + "/.gradle/caches/" String bon2Dir = cacheDir + "forge_gradle/deobf" String bon2File = bon2Dir + "/BON2-2.5.0.jar" String obfFile = cacheDir + "modules-2/files-2.1/" + fileName + ".jar" String deobfFile = cacheDir + "modules-2/files-2.1/" + fileName + "-deobf.jar" - + if(file(deobfFile).exists()) { return files(deobfFile) } - download { + download.run { src 'https://github.com/GTNewHorizons/BON2/releases/download/2.5.0/BON2-2.5.0.CUSTOM-all.jar' dest bon2File quiet true overwrite false } - download { + download.run { src sourceURL dest obfFile quiet true @@ -711,7 +728,7 @@ def deobf(String sourceURL, String fileName) { // Helper methods def checkPropertyExists(String propertyName) { - if (project.hasProperty(propertyName) == false) { + if (!project.hasProperty(propertyName)) { throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/gradle.properties") } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java new file mode 100644 index 0000000000..e4714d059d --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java @@ -0,0 +1,152 @@ +package com.github.bartimaeusnek.bartworks.API; + +import com.gtnewhorizon.structurelib.structure.IStructureElement; +import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraft.block.Block; +import org.apache.commons.lang3.tuple.Pair; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.BiConsumer; +import java.util.function.Function; +import java.util.stream.Collectors; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAdder; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAnyMeta; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlocksTiered; + +/** + * API for bartworks borosilicate glass. + *

+ * You might have noticed this API does not expose any Block instance, but only IStructureElements. This is in case we + * add more glass blocks later, and we run out of meta id for only one block. + *

+ * IStructureElements returned from this class should not have its methods called before the game start. + */ +public class BorosilicateGlass { + + private static Block block; + private static List> representatives; + + private static Block getGlassBlock() { + if (block == null) + block = GameRegistry.findBlock("bartworks", "BW_GlasBlocks"); + return block; + } + + private static List> getRepresentatives() { + if (representatives == null) { + ArrayList> ret = new ArrayList<>(); + Block block = getGlassBlock(); + ret.add(Pair.of(block, 0)); + ret.add(Pair.of(block, 1)); + ret.add(Pair.of(block, 2)); + ret.add(Pair.of(block, 3)); + ret.add(Pair.of(block, 4)); + ret.add(Pair.of(block, 5)); + ret.add(Pair.of(block, 13)); + ret.add(Pair.of(block, 14)); + representatives = ret; + } + return representatives; + } + + private static byte checkWithinBound(byte val, byte lo, byte hi) { + return val > hi || val < lo ? -1 : val; + } + + /** + * Check if there is at least one type of boroglass in that tier. + */ + public static boolean hasGlassInTier(int tier) { + return tier >= 3 && tier <= 10; + } + + /** + * Get a structure element for a certain tier of borosilicate glass. DOES NOT accept other glass like reinforced glass, magic mirror, vanilla glass, etc. + *

+ * Use this if you just want boroglass here and doesn't care what tier it is. + */ + public static IStructureElement ofBoroGlass(int tier) { + if (!hasGlassInTier(tier)) throw new IllegalArgumentException(); + return lazy(t -> { + Pair pair = getRepresentatives().get(tier - 3); + return ofBlockAdder((t1, block1, meta) -> getTier(block1, meta) == tier, pair.getKey(), pair.getValue()); + }); + } + + /** + * Get a structure element for any kind of borosilicate glass. DOES NOT accept other glass like reinforced glass, magic mirror, vanilla glass, etc. + *

+ * Use this if you just want boroglass here and doesn't care what tier it is. + */ + public static IStructureElement ofBoroGlassAnyTier() { + return lazy(t -> ofBlockAnyMeta(getGlassBlock())); + } + + /** + * Get a structure element for borosilicate glass. DOES NOT accept other glass like reinforced glass, magic mirror, vanilla glass, etc. + *

+ * This assumes you want all glass used to be of the same tier. + *

+ * NOTE: This will accept the basic boron glass (HV tier) as well. You might not want this. Use the other overload to filter this out. + * + * @param initialValue the value set before structure check started + */ + public static IStructureElement ofBoroGlass(byte initialValue, BiConsumer setter, Function getter) { + return lazy(t -> ofBlocksTiered(BorosilicateGlass::getTier, getRepresentatives(), initialValue, setter, getter)); + } + + /** + * Get a structure element for borosilicate glass. DOES NOT accept other glass like reinforced glass, magic mirror, vanilla glass, etc. + * + * @param initialValue the value set before structure check started + * @param minTier minimal accepted tier. inclusive. must be greater than 0. + * @param maxTier maximal accepted tier. inclusive. + */ + public static IStructureElement ofBoroGlass(byte initialValue, byte minTier, byte maxTier, BiConsumer setter, Function getter) { + if (minTier > maxTier || minTier < 0) throw new IllegalArgumentException(); + return lazy(t -> ofBlocksTiered( + (block1, meta) -> checkWithinBound(getTier(block1, meta), minTier, maxTier), + getRepresentatives().stream().skip(Math.max(minTier - 3, 0)).limit(maxTier - minTier + 1).collect(Collectors.toList()), + initialValue, + setter, + getter + )); + } + + /** + * Get the tier of this borosilicate glass. DOES NOT consider other glass like reinforced glass, magic mirror, vanilla glass, etc. + */ + public static byte getTier(Block block, int meta) { + byte ret; + switch (meta) { + case 1: + ret = 4; + break; + case 2: + case 12: + ret = 5; + break; + case 3: + ret = 6; + break; + case 4: + ret = 7; + break; + case 5: + ret = 8; + break; + case 13: + ret = 9; + break; + case 14: + ret = 10; + break; + default: + ret = 3; + } + return block == getGlassBlock() ? ret : -1; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java index 4ea3582bd1..223a067ce6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java @@ -296,6 +296,9 @@ public class BWCoreTransformer implements IClassTransformer { toPatch.instructions.add(new VarInsnNode(ALOAD,2)); toPatch.instructions.add(new MethodInsnNode(INVOKESTATIC,"com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes","findCachedMatchingRecipe","(Lnet/minecraft/inventory/InventoryCrafting;Lnet/minecraft/world/World;)Lnet/minecraft/item/ItemStack;",false)); toPatch.instructions.add(new InsnNode(ARETURN)); + toPatch.localVariables.clear(); + toPatch.maxStack = 2; + toPatch.maxLocals = 3; break scase; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index e0c172f1cd..a136cfd34b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.common.items; +import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; @@ -69,8 +70,10 @@ public class BW_ItemBlocks extends ItemBlock { @SideOnly(Side.CLIENT) @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { - if (this.field_150939_a instanceof BW_GlasBlocks) - aList.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + BW_ColorUtil.getColorForTier(BW_Util.getTierFromGlasMeta(aStack.getItemDamage())) + GT_Values.VN[BW_Util.getTierFromGlasMeta(aStack.getItemDamage())]); + byte tier = BorosilicateGlass.getTier(this.field_150939_a, aStack.getItemDamage()); + if (tier >= 0) { + aList.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + BW_ColorUtil.getColorForTier(tier) + GT_Values.VN[tier]); + } if (this.field_150939_a instanceof ITileAddsInformation) { aList.addAll(Arrays.asList(((ITileAddsInformation) this.field_150939_a).getInfoData())); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index f9263f140a..b204f30502 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; @@ -77,7 +78,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl .addElement('t', ofHatchAdderOptional(GT_TileEntity_MegaBlastFurnace::addOutputHatchToTopList, CASING_INDEX, 1, GregTech_API.sBlockCasings1, CASING_INDEX)) .addElement('m', ofHatchAdder(GT_TileEntity_MegaBlastFurnace::addMufflerToMachineList, CASING_INDEX, 2)) .addElement('C', ofCoil(GT_TileEntity_MegaBlastFurnace::setCoilLevel, GT_MetaTileEntity_ElectricBlastFurnace::getCoilLevel)) - .addElement('g', ofBlockAdder(GT_TileEntity_MegaBlastFurnace::addGlas, ItemRegistry.bw_glasses[0], 1)) + .addElement('g', BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) .addElement('b', ofHatchAdderOptional(GT_TileEntity_MegaBlastFurnace::addBottomHatch, CASING_INDEX, 3, GregTech_API.sBlockCasings1, CASING_INDEX)) .build(); @@ -163,9 +164,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return tt; } - @SuppressWarnings("rawtypes") public ArrayList TTTunnels = new ArrayList<>(); - @SuppressWarnings("rawtypes") public ArrayList TTMultiAmp = new ArrayList<>(); @Override @@ -455,17 +454,6 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl buildPiece("main", stackSize, hintsOnly, 7, 17, 0); } - private boolean addGlas(Block block, int meta) { - if (block != ItemRegistry.bw_glasses[0]) - return false; - byte tier = BW_Util.getTierFromGlasMeta(meta); - if (tier >= 8) tier = 8; - if (glasTier > 0) - return tier == glasTier; - glasTier = tier; - return true; - } - @Override public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { if (LoaderReference.tectech) { @@ -489,11 +477,11 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl if (mMaintenanceHatches.size() != 1) return false; - if (LoaderReference.tectech && this.glasTier != 8) + if (LoaderReference.tectech && this.glasTier < 8) if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) return false; - if (this.glasTier != 8 && !this.mEnergyHatches.isEmpty()) + if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) if (this.glasTier < hatchEnergy.mTier) return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index 3aaeab8c30..e2383c8fa1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -22,9 +22,9 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MegaUtils; @@ -33,20 +33,15 @@ import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureUtility; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeChemicalReactor; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -55,13 +50,19 @@ import java.util.List; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.util.GT_StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeChemicalReactor implements TecTechEnabledMulti { + private final ArrayList TTTunnels = new ArrayList<>(); + private final ArrayList TTMultiAmp = new ArrayList<>(); + + private byte glasTier; public GT_TileEntity_MegaChemicalReactor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -99,11 +100,6 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeCh return new GT_TileEntity_MegaChemicalReactor(this.mName); } - @SuppressWarnings("rawtypes") - public ArrayList TTTunnels = new ArrayList<>(); - @SuppressWarnings("rawtypes") - public ArrayList TTMultiAmp = new ArrayList<>(); - @Override public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (LoaderReference.tectech) { @@ -207,7 +203,7 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeCh return false; } - if (this.glasTier != 8 && !this.mEnergyHatches.isEmpty()) { + if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) { for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) { if (this.glasTier < hatchEnergy.mTier) { return false; @@ -234,51 +230,21 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeCh .addElement('d', ofChain( ofHatchAdder(GT_TileEntity_MegaChemicalReactor::addInputToMachineList, CASING_INDEX, 1), ofHatchAdder(GT_TileEntity_MegaChemicalReactor::addOutputToMachineList, CASING_INDEX, 1), - onElementPass(GT_TileEntity_MegaChemicalReactor::onCasingAdded, ofBlock(GregTech_API.sBlockCasings8, 0)) - )) - .addElement('r', ofChain( - ofHatchAdder(GT_TileEntity_MegaChemicalReactor::addMaintenanceToMachineList, CASING_INDEX, 2) - )) - .addElement('e', ofChain( - ofHatchAdder(GT_TileEntity_MegaChemicalReactor::addEnergyInputToMachineList, CASING_INDEX, 3), - onElementPass(GT_TileEntity_MegaChemicalReactor::onCasingAdded, ofBlock(GregTech_API.sBlockCasings8, 0)) - )) - .addElement('c', ofChain( - ofBlock(GregTech_API.sBlockCasings4, 7) - )) - .addElement('g', ofChain( - ofBlockAdder(GT_TileEntity_MegaChemicalReactor::addGlas, ItemRegistry.bw_glasses[0], 1) + ofBlock(GregTech_API.sBlockCasings8, 0) )) + .addElement('r', ofHatchAdder(GT_TileEntity_MegaChemicalReactor::addMaintenanceToMachineList, CASING_INDEX, 2)) + .addElement('e', ofHatchAdderOptional(GT_TileEntity_MegaChemicalReactor::addEnergyInputToMachineList, CASING_INDEX, 3, GregTech_API.sBlockCasings8, 0)) + .addElement('c', ofBlock(GregTech_API.sBlockCasings4, 7)) + .addElement('g', BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) .build(); - private int mCasingAmount; - - + @SuppressWarnings({"unchecked", "rawtypes"}) @Override public IStructureDefinition getStructureDefinition() { return (IStructureDefinition) STRUCTURE_DEFINITION; } - private void onCasingAdded() { - mCasingAmount++; - } - - private byte glasTier; - - private boolean addGlas(Block block, int meta) { - if (block != ItemRegistry.bw_glasses[0]) { - return false; - } - byte tier = BW_Util.getTierFromGlasMeta(meta); - if (tier >= 8) tier = 8; - if (glasTier > 0) { - return tier == glasTier; - } - glasTier = tier; - return true; - } - @Override public String[] getInfoData() { return LoaderReference.tectech ? this.getInfoDataArray(this) : super.getInfoData(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index c8e9c00d58..b936958948 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -22,28 +22,19 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; -import com.github.bartimaeusnek.bartworks.API.SideReference; -import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; -import com.github.bartimaeusnek.bartworks.system.material.*; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MegaUtils; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; -import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; -import gregtech.api.enums.HeatingCoilLevel; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.TextureSet; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; @@ -53,16 +44,10 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_OilCracker; -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; @@ -74,6 +59,11 @@ import static gregtech.api.util.GT_StructureUtility.*; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker implements TecTechEnabledMulti { + private final ArrayList TTTunnels = new ArrayList<>(); + private final ArrayList TTMultiAmp = new ArrayList<>(); + + private byte glasTier; + public GT_TileEntity_MegaOilCracker(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -113,11 +103,6 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i return new GT_TileEntity_MegaOilCracker(this.mName); } - @SuppressWarnings("rawtypes") - public ArrayList TTTunnels = new ArrayList<>(); - @SuppressWarnings("rawtypes") - public ArrayList TTMultiAmp = new ArrayList<>(); - @Override public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (LoaderReference.tectech) { @@ -201,8 +186,8 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i return false; } - if (this.heatLevel.getTier() < 5) { - this.mEUt *= 1 - (0.1D * (this.heatLevel.getTier() + 1)); + if (this.getCoilLevel().getTier() < 5) { + this.mEUt *= 1 - (0.1D * (this.getCoilLevel().getTier() + 1)); } else { this.mEUt *= 0.5; @@ -243,7 +228,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i } - if (this.glasTier != 8 && !this.mEnergyHatches.isEmpty()) { + if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) { for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) { if (this.glasTier < hatchEnergy.mTier) { return false; @@ -269,7 +254,6 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i })) .addElement('c', ofCoil(GT_TileEntity_MegaOilCracker::setCoilLevel, GT_TileEntity_MegaOilCracker::getCoilLevel)) .addElement('p', ofBlock(GregTech_API.sBlockCasings4, 1)) -// .addElement('s', addTileCasing(BW_GT_MaterialReference.StainlessSteel)) .addElement('l', ofChain( ofHatchAdder(GT_TileEntity_MegaOilCracker::addLeftHatchToMachineList, CASING_INDEX, 2) )) @@ -279,20 +263,14 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i .addElement('m', ofChain( ofHatchAdder(GT_TileEntity_MegaOilCracker::addEnergyInputToMachineList, CASING_INDEX, 1), ofHatchAdder(GT_TileEntity_MegaOilCracker::addMaintenanceToMachineList, CASING_INDEX, 1), - onElementPass(GT_TileEntity_MegaOilCracker::onCasingAdded, ofBlock(GregTech_API.sBlockCasings4, 1)) + ofBlock(GregTech_API.sBlockCasings4, 1) )) .addElement('M', ofChain( ofHatchAdder(GT_TileEntity_MegaOilCracker::addMiddleInputToMachineList, CASING_INDEX, 4) )) - .addElement('g', ofChain( - ofBlockAdder(GT_TileEntity_MegaOilCracker::addGlas, ItemRegistry.bw_glasses[0], 1) - )) + .addElement('g', BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) .build(); - private HeatingCoilLevel heatLevel; - - private int mCoilAmount; - private boolean addLeftHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { return false; @@ -397,36 +375,12 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i return rList; } + @SuppressWarnings({"unchecked", "rawtypes"}) @Override public IStructureDefinition getStructureDefinition() { return (IStructureDefinition) STRUCTURE_DEFINITION; } - private void onCasingAdded() { - mCasingAmount++; - } - - private byte glasTier; - - private boolean addGlas(Block block, int meta) { - if (block != ItemRegistry.bw_glasses[0]) { - return false; - } - byte tier = BW_Util.getTierFromGlasMeta(meta); - if (tier >= 8) tier = 8; - if (glasTier > 0) { - return tier == glasTier; - } - glasTier = tier; - return true; - } - - private void onCoilAdded() { - mCoilAmount++; - } - - - @Override public String[] getInfoData() { return LoaderReference.tectech ? this.getInfoDataArray(this) : super.getInfoData(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index f7ef9806c4..dc0b26776f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.MainMod; import gregtech.api.enums.Materials; import gregtech.api.enums.OreDictNames; @@ -325,6 +326,10 @@ public class BW_Util { return 0; } + /** + * @deprecated Use stuff in {@link com.github.bartimaeusnek.bartworks.API.BorosilicateGlass} instead + */ + @Deprecated public static byte getTierFromGlasMeta(int meta) { byte ret; switch (meta) { @@ -585,24 +590,9 @@ public class BW_Util { public static byte calculateGlassTier(@Nonnull Block block, @Nonnegative byte meta) { - if (bw_realglasRef == null){ - try { - bw_realglasRef = (Block) Class.forName("com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry").getField("bw_realglas").get(null); - } catch (IllegalAccessException | NoSuchFieldException | ClassNotFoundException e) { - e.printStackTrace(); - } - } - - if (block.equals(bw_realglasRef)) { - if (meta > 12) { - return (byte) (meta - 3); - } - if (meta == 12) - return 5; - if (meta > 1 && meta < 6) - return (byte) (meta + 3); - return 4; - } + byte boroTier = BorosilicateGlass.getTier(block, meta); + if (boroTier < 0) + return boroTier; if (block.getUnlocalizedName().equals("blockAlloyGlass")) return 4; -- cgit From 6ede855f3df3491fa617cc3e794742ce7a783124 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Wed, 23 Feb 2022 16:57:25 +0800 Subject: revert ulv input bus limit in cal (#96) * revert ulv input bus limit in cal * tooltip Former-commit-id: 46d3a48b3cbc5f40e9da7a28977861e483c1ad6e --- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 26 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 79a10a8f7d..7699184abc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -45,6 +45,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; @@ -175,7 +176,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance if (!this.imprintMachine(itemStack)) return false; - if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), BW_Util.getItemsFromInputBusses(this))) { + if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), getStoredInputs().toArray(new ItemStack[0]))) { setRecipeStats(); return true; } @@ -194,7 +195,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance } for (GT_Recipe recipe : this.GT_RECIPE_COLLECTION) { - if (recipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), BW_Util.getItemsFromInputBusses(this))) + if (recipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), getStoredInputs().toArray(new ItemStack[0]))) this.bufferedRecipe = recipe; else continue; @@ -218,6 +219,23 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance this.updateSlots(); } + @Override + public ArrayList getStoredInputs() { + ArrayList rList = new ArrayList<>(); + for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch)) { + for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) { + if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null) { + rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i)); + break; + } + } + } + } + return rList; + } + @Override public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { @@ -228,7 +246,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); ((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus && ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mTier == 0) { + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); ((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); @@ -283,7 +301,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance private static final String[] DESCRIPTION = new String[]{ "Circuit Assembly Line", "Size(WxHxD): (2-7)x3x3, variable length", "Bottom: Steel Machine Casing(or 1x Maintenance or Input Hatch),", - "ULV Input Bus (Last Output Bus), Steel Machine Casing", + "Input Bus (Last Output Bus), Steel Machine Casing", "Middle: EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass", "Top: Grate Machine Casing (or Controller or 1x Energy Hatch)", "Up to 7 repeating slices, last is Output Bus", -- cgit From c8d78c16f0aefb288975338778eda53af147b714 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Sun, 27 Feb 2022 21:44:26 +0100 Subject: Fix quality design. (#97) * Fix structure check * Fix structure * Fix descriptions * Add tier check for laser hatches * Fix description My mistake + Machine type change. Former-commit-id: 36aad0273d97b72cd272221eadc46cc0f5c3c5e0 --- .../mega/GT_TileEntity_MegaChemicalReactor.java | 46 +++++++++++++++++----- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 45 ++++++++++++++++----- 2 files changed, 73 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index e2383c8fa1..d7878a7973 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -31,6 +31,7 @@ import com.github.bartimaeusnek.bartworks.util.MegaUtils; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; +import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.LowPowerLaser; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; @@ -38,6 +39,7 @@ import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -46,6 +48,7 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; @@ -83,7 +86,7 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeCh .addInfo("Follow the Structure Lib hologram projector to build the main structure.") .addSeparator() .beginStructureBlock(5, 5, 9, false) - .addController("Front bottom") + .addController("Front center") .addStructureInfo("The glass tier limits the Energy Input tier") .addEnergyHatch("Hint block ", 3) .addMaintenanceHatch("Hint block ",2) @@ -199,22 +202,47 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeCh this.getTecTechEnergyTunnels().clear(); } - if(checkPiece(STRUCTURE_PIECE_MAIN,2,2,0)&&(mMaintenanceHatches.size()==1)){ + if(!checkPiece(STRUCTURE_PIECE_MAIN,2,2,0)) return false; - } - if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) { - for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) { - if (this.glasTier < hatchEnergy.mTier) { + if(mMaintenanceHatches.size() != 1) + return false; + + if (LoaderReference.tectech && this.glasTier < 8) + if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) + return false; + + if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) + for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) + if (this.glasTier < hatchEnergy.mTier) return false; - } - } - } return true; } + + @SuppressWarnings("rawtypes") + @Optional.Method(modid = "tectech") + private boolean areThingsNotProperlyTiered(Collection collection) { + if (!collection.isEmpty()) + for (Object tecTechEnergyMulti : collection) + if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) + return true; + return false; + } + + @SuppressWarnings("rawtypes") + @Optional.Method(modid = "tectech") + private boolean areLazorsLowPowa() { + Collection collection = this.getTecTechEnergyTunnels(); + if (!collection.isEmpty()) + for (Object tecTechEnergyMulti : collection) + if (!(tecTechEnergyMulti instanceof LowPowerLaser)) + return false; + return true; + } + private static final int CASING_INDEX = 176; private static final String STRUCTURE_PIECE_MAIN = "main"; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index b936958948..ffe6d46ade 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -31,6 +31,7 @@ import com.github.bartimaeusnek.bartworks.util.MegaUtils; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; +import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.LowPowerLaser; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; @@ -40,6 +41,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -48,6 +50,7 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; @@ -75,7 +78,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i @Override public GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Oil Cracking Unit") + tt.addMachineType("Cracker") .addInfo("Controller block for the Mega Oil Cracking") .addInfo("Thermally cracks heavy hydrocarbons into lighter fractions") .addInfo("More efficient than the Chemical Reactor") @@ -223,22 +226,46 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i this.getTecTechEnergyTunnels().clear(); } - if(checkPiece(STRUCTURE_PIECE_MAIN,6,6,0)&&(mMaintenanceHatches.size()==1)&&(mEnergyHatches.size()<=2)){ + if(!checkPiece(STRUCTURE_PIECE_MAIN,6,6,0)) + return false; + + if(mMaintenanceHatches.size() != 1) return false; - } + if (LoaderReference.tectech && this.glasTier < 8) + if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) + return false; - if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) { - for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) { - if (this.glasTier < hatchEnergy.mTier) { + if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) + for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) + if (this.glasTier < hatchEnergy.mTier) return false; - } - } - } return true; } + + @SuppressWarnings("rawtypes") + @Optional.Method(modid = "tectech") + private boolean areThingsNotProperlyTiered(Collection collection) { + if (!collection.isEmpty()) + for (Object tecTechEnergyMulti : collection) + if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) + return true; + return false; + } + + @SuppressWarnings("rawtypes") + @Optional.Method(modid = "tectech") + private boolean areLazorsLowPowa() { + Collection collection = this.getTecTechEnergyTunnels(); + if (!collection.isEmpty()) + for (Object tecTechEnergyMulti : collection) + if (!(tecTechEnergyMulti instanceof LowPowerLaser)) + return false; + return true; + } + private static final int CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() -- cgit From dbab3423566f64c354977acc362ccdd3335bb865 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Fri, 4 Mar 2022 20:21:11 +0100 Subject: StructureLib integration (#99) * Implement StructureLib to Mega Vacuum Freezer * Remove unused translation * EIC StructureLib integration Electric Implosion Compressor * Bacterial Vat StructureLib integration * Remove unused translations * Change air block to isAir * Block rotation of EIC * Add recipe map to MVF * Manual Trafo StructureLib integration * Windmill StructureLib integration * Block Windmill rotation Former-commit-id: 43331bd8d46203a87bdadd234295c2e75ac82621 --- .../tileentities/multis/GT_TileEntity_BioVat.java | 178 ++++++--- .../GT_TileEntity_ElectricImplosionCompressor.java | 220 +++++++---- .../multis/GT_TileEntity_ManualTrafo.java | 427 +++++++++------------ .../multis/GT_TileEntity_Windmill.java | 183 +++++---- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 147 +++++-- .../bartimaeusnek/bartworks/util/BW_Util.java | 2 +- .../resources/assets/bartworks/lang/de_DE.lang | 3 - .../resources/assets/bartworks/lang/en_US.lang | 4 - .../resources/assets/bartworks/lang/fr_FR.lang | 4 - .../resources/assets/bartworks/lang/zh_CN.lang | 10 +- 10 files changed, 663 insertions(+), 515 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 9d1a054cb0..993099521d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -30,22 +30,27 @@ import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.net.RendererPacket; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.util.*; +import com.gtnewhorizon.structurelib.StructureLibAPI; +import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.IStructureElement; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.common.util.ForgeDirection; @@ -56,11 +61,16 @@ import net.minecraftforge.fluids.FluidStack; import java.util.*; import java.util.stream.Collectors; -public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + +public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBase { public static final HashMap staticColorMap = new HashMap<>(); - private static final byte MCASING_INDEX = 49; private static final byte TIMERDIVIDER = 20; private final HashSet playerMPHashSet = new HashSet<>(); @@ -74,6 +84,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private byte mGlassTier; private int mSievert; private int mNeededSievert; + private int mCasing = 0; public GT_TileEntity_BioVat(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -83,6 +94,88 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { super(aName); } + private static final int CASING_INDEX = 49; + private static final String STRUCTURE_PIECE_MAIN = "main"; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {"ccccc", "ccccc", "ccccc", "ccccc", "ccccc"}, + {"ggggg", "gaaag", "gaaag", "gaaag", "ggggg"}, + {"ggggg", "gaaag", "gaaag", "gaaag", "ggggg"}, + {"cc~cc", "ccccc", "ccccc", "ccccc", "ccccc"}, + })) + .addElement('c', ofChain( + ofHatchAdder(GT_TileEntity_BioVat::addMaintenanceToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addOutputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addRadiationInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addEnergyInputToMachineList, CASING_INDEX, 1), + onElementPass(e -> e.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)) + )) + .addElement('a', ofChain( + isAir(), + ofBlockAnyMeta(FluidLoader.bioFluidBlock) + )) + .addElement('g', new IStructureElement(){ + + @Override + public boolean check(GT_TileEntity_BioVat te, World world, int x, int y, int z) { + byte glasstier = BW_Util.calculateGlassTier(world.getBlock(x, y, z), (byte)world.getBlockMetadata(x, y, z)); + if(glasstier == 0) + return false; + if(te.mGlassTier == 0) + te.mGlassTier = glasstier; + return te.mGlassTier == glasstier; + } + + @Override + public boolean spawnHint(GT_TileEntity_BioVat te, World world, int x, int y, int z, ItemStack itemStack) { + StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 1 /* aDots: 2 */); + return true; + } + + @Override + public boolean placeBlock(GT_TileEntity_BioVat te, World world, int x, int y, int z, ItemStack itemStack) { + world.setBlock(x, y, z, Blocks.glass, 0, 2); + return true; + } + }) + .build(); + + @Override + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + protected IAlignmentLimits getInitialAlignmentLimits() { + return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && f.isNotFlipped(); + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt. + addMachineType("Bacterial Vat"). + addInfo("Controller block for the Bacterial Vat"). + addInfo("For maximum efficiency boost keep the Output Hatch always half filled!"). + addSeparator(). + beginStructureBlock(5, 4, 5, false). + addController("Front bottom center"). + addCasingInfo("Clean Stainless Steel Casings", 19). + addOtherStructurePart("Glass", "Hollow two middle layers", 2). + addStructureInfo("The glass can be any glass, i.e. Tinkers Construct Clear Glass"). + addStructureInfo("Some Recipes need more advanced Glass Types"). + addMaintenanceHatch("Any casing", 1). + addOtherStructurePart("Radio Hatch", "Any casing", 1). + addInputBus("Any casing", 1). + addOutputBus("Any casing", 1). + addInputHatch("Any casing", 1). + addOutputHatch("Any casing", 1). + addEnergyHatch("Any casing", 1). + toolTipFinisher("Bartworks"); + return tt; + } + public static int[] specialValueUnpack(int aSpecialValue) { int[] ret = new int[4]; ret[0] = aSpecialValue & 0xF; // = glass tier @@ -259,7 +352,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { return this.mOutputHatches.stream().map(GT_MetaTileEntity_Hatch_Output::getFluid).filter(Objects::nonNull).collect(Collectors.toSet()); } - private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity) { + private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity, int CasingIndex) { if (aTileEntity == null) { return false; } else { @@ -267,7 +360,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { if (aMetaTileEntity == null) { return false; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_RadioHatch) { - ((GT_MetaTileEntity_RadioHatch) aMetaTileEntity).updateTexture(GT_TileEntity_BioVat.MCASING_INDEX); + ((GT_MetaTileEntity_RadioHatch) aMetaTileEntity).updateTexture(CasingIndex); return this.mRadHatches.add((GT_MetaTileEntity_RadioHatch) aMetaTileEntity); } else { return false; @@ -277,49 +370,19 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; - int blockcounter = 0; this.mRadHatches.clear(); + this.mGlassTier = 0; + this.mCasing = 0; - for (int x = -2; x <= 2; x++) - for (int z = -2; z <= 2; z++) - for (int y = 0; y < 4; y++) { - IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z); - if (y == 0 || y == 3) { - //controller - if (y == 0 && xDir + x == 0 && zDir + z == 0) - continue; - if (!(this.addOutputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addRadiationInputToMachineList(tileEntity) || this.addInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addMaintenanceToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addEnergyInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX))) { - if (BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, GregTech_API.sBlockCasings4, 1)) { - ++blockcounter; - continue; - } - return false; - } - } else { - if (Math.abs(x) < 2 && Math.abs(z) != 2) { - if (!(BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, Blocks.air) || (BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, FluidLoader.bioFluidBlock)))) { - return false; - } - } else { - if (x == -2 && z == -2 && y == 1) - this.mGlassTier = BW_Util.calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + -2, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); - if (0 == this.mGlassTier || this.mGlassTier != BW_Util.calculateGlassTier(aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z), aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z))) { - return false; - } - } - } - } - - if (blockcounter > 18 && - this.mRadHatches.size() < 2 && - this.mOutputHatches.size() == 1 && - this.mMaintenanceHatches.size() == 1 && - this.mInputHatches.size() > 0) - return this.mEnergyHatches.size() > 0; + if(!checkPiece(STRUCTURE_PIECE_MAIN, 2, 3, 0)) + return false; - return false; + return this.mCasing >= 19 && + this.mRadHatches.size() <= 1 && + this.mOutputHatches.size() == 1 && + this.mMaintenanceHatches.size() == 1 && + this.mInputHatches.size() > 0 && + this.mEnergyHatches.size() > 0; } @Override @@ -567,18 +630,23 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } @Override - public String[] getDescription() { - String[] dsc = StatCollector.translateToLocal("tooltip.tile.bvat.0.name").split(";"); - String[] fdsc = new String[dsc.length + 1]; - for (int i = 0; i < dsc.length; i++) { - fdsc[i] = dsc[i]; - fdsc[dsc.length] = BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get(); + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + if (aActive) + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow().build()}; + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow().build()}; } - return fdsc; + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_BioVat.MCASING_INDEX), TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).glow().build()))} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_BioVat.MCASING_INDEX)}; + public void construct(ItemStack itemStack, boolean b) { + buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 2, 3, 0); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index f761543f56..b9c3d36c0e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -22,28 +22,39 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; +import com.gtnewhorizon.structurelib.StructureLibAPI; +import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.IStructureElement; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ImplosionCompressor; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity_ImplosionCompressor { +public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity_EnhancedMultiBlockBase { public static GT_Recipe.GT_Recipe_Map eicMap; - private Boolean piston = null; + private Boolean piston = true; public GT_TileEntity_ElectricImplosionCompressor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -53,6 +64,98 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity super(aName); } + private static final int CASING_INDEX = 16; + private static final String STRUCTURE_PIECE_MAIN = "main"; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {"ccc", "cec", "ccc"}, + {"ttt", "tft", "ttt"}, + {"ttt", "tft", "ttt"}, + {"nnn", "nnn", "nnn"}, + {"nNn", "NNN", "nNn"}, + {"nnn", "nnn", "nnn"}, + {"t~t", "tft", "ttt"}, + {"ttt", "tft", "ttt"}, + {"CCC", "CeC", "CCC"}, + })) + .addElement('c', ofChain( + ofBlock(GregTech_API.sBlockCasings2, 0), + ofBlock(GregTech_API.sBlockCasings3, 4) + )) + .addElement('t', ofBlock(BW_BLOCKS[2], 1)) + .addElement('f', ofBlock(BW_BLOCKS[2], 0)) + .addElement('n', ofBlock(GregTech_API.sBlockMetal5, 2)) + .addElement('C', ofChain( + ofHatchAdder(GT_TileEntity_ElectricImplosionCompressor::addInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_ElectricImplosionCompressor::addOutputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_ElectricImplosionCompressor::addMaintenanceToMachineList, CASING_INDEX, 1), + ofBlock(GregTech_API.sBlockCasings2, 0), + ofBlock(GregTech_API.sBlockCasings3, 4) + )) + .addElement('e', ofHatchAdder(GT_TileEntity_ElectricImplosionCompressor::addEnergyInputToMachineList, CASING_INDEX, 2)) + .addElement('N', new IStructureElement(){ + + @Override + public boolean check(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z) { + if(!te.piston && !world.isAirBlock(x, y, z)) + return false; + if(te.piston && !(world.getBlock(x, y, z) == GregTech_API.sBlockMetal5 && world.getBlockMetadata(x, y, z) == 2)) + return false; + return true; + } + + @Override + public boolean spawnHint(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z, ItemStack itemStack) { + if(te.piston) + StructureLibAPI.hintParticle(world, x, y, z, GregTech_API.sBlockMetal5, 2); + return true; + } + + @Override + public boolean placeBlock(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z, ItemStack itemStack) { + if(te.piston) + world.setBlock(x, y, z, GregTech_API.sBlockMetal5, 2, 3); + else + world.setBlockToAir(x, y, z); + return true; + } + }) + .build(); + + @Override + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + protected IAlignmentLimits getInitialAlignmentLimits() { + return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && f.isNotFlipped(); + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt. + addMachineType("Implosion Compressor"). + addInfo("Explosions are fun"). + addInfo("Controller block for the Electric Implosion Compressor"). + addInfo("Uses electricity instead of Explosives"). + addSeparator(). + beginStructureBlock(3, 9, 3, false). + addController("Front 3rd layer center"). + addCasingInfo("Solid Steel Machine Casing", 8). + addStructureInfo("Casings can be replaced with Explosion Warning Signs"). + addOtherStructurePart("Transformer-Winding Blocks", "Outer layer 2,3,7,8"). + addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Inner layer 2,3,7,8"). + addOtherStructurePart("Neutronium Blocks", "Layer 4,5,6"). + addMaintenanceHatch("Any bottom casing", 1). + addInputBus("Any bottom casing", 1). + addOutputBus("Any bottom casing", 1). + addEnergyHatch("Bottom and top middle", 2). + toolTipFinisher("Bartworks"); + return tt; + } + @Override public boolean checkRecipe(ItemStack aStack) { @@ -94,7 +197,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity return false; } - + @Override public boolean drainEnergyInput(long aEU) { if (aEU <= 0) return true; @@ -103,7 +206,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity if(!h1.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU/2, false) || !h2.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU/2, false)) return false; return true; } - + @Override public boolean onRunningTick(ItemStack aStack) { if (this.mRuntime % 10 == 0) @@ -111,17 +214,16 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity return super.onRunningTick(aStack); } + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + public void stopMachine() { this.resetPiston(); super.stopMachine(); } - @Override - public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { - if (this.piston == null) - this.piston = true; - } - private void resetPiston() { if (this.getBaseMetaTileEntity().getWorld().isRemote) return; @@ -174,75 +276,27 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity @Override public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setBoolean("piston", this.piston); super.saveNBTData(aNBT); + aNBT.setBoolean("piston", this.piston); } @Override public void loadNBTData(NBTTagCompound aNBT) { - this.piston = aNBT.getBoolean("piston"); super.loadNBTData(aNBT); + this.piston = aNBT.getBoolean("piston"); } @Override - @SuppressWarnings("ALL") public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; - - for (int x = -1; x <= 1; x++) { - for (int y = -2; y < 7; y++) { - for (int z = -1; z <= 1; z++) { - IGregTechTileEntity te = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, z + zDir); - if (y == -2 || y == 6) { - if (!(x == 0 && z == 0)) { - if (!this.addMaintenanceToMachineList(te, 16) && !this.addInputToMachineList(te, 16) && !this.addOutputToMachineList(te, 16)) { - Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z); - byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); - if ((tBlock != GregTech_API.sBlockCasings2 || tMeta != 0) && (tBlock != GregTech_API.sBlockCasings3 || tMeta != 4)) { - return false; - } - } - } else if (x == 0 && z == 0) { - if (y == -2) - if (!this.addEnergyInputToMachineList(te, 16)) - return false; - if (y == 6) - if (!this.addEnergyInputToMachineList(te, 16)) - return false; - } - } else if ((y > -2 && y < 1) || (y > 3 && y < 6)) { - if (y == 0 && xDir + x == 0 && zDir + z == 0) - continue; - Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z); - byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); - if (x == 0 && z == 0) { - if (tBlock != BW_BLOCKS[2] || tMeta != 0) - return false; - } else { - if (tBlock != BW_BLOCKS[2] || tMeta != 1) - return false; - } + if(!checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0)) + return false; + return this.mMaintenanceHatches.size() == 1 && + this.mEnergyHatches.size() == 2; + } - } else if (y == 1) { - if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 1, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 1, zDir + z)), Materials.Neutronium.getBlocks(1))) - return false; - } else if (y == 2) { - if (!this.piston) { - if (Math.abs(x) == 1 && Math.abs(z) == 1) { - if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 2, zDir + z)), Materials.Neutronium.getBlocks(1))) - return false; - } - } else if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 2, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)), Materials.Neutronium.getBlocks(1))) - return false; - } else if (y == 3) { - if (!GT_Utility.areStacksEqual(new ItemStack(aBaseMetaTileEntity.getBlockOffset(xDir + x, 3, zDir + z), 1, aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 3, zDir + z)), Materials.Neutronium.getBlocks(1))) - return false; - } - } - } - } - return true; + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; } @@ -251,13 +305,31 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity return 0; } + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new GT_TileEntity_ElectricImplosionCompressor(this.mName); } + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return aActive ? new ITexture[]{Textures.BlockIcons.casingTexturePages[0][16], TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE}).extFacing().build(), TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW}).extFacing().glow().build()} : new ITexture[]{Textures.BlockIcons.casingTexturePages[0][16], TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR}).extFacing().build(), TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW}).extFacing().glow().build()}; + } else { + return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][16]}; + } + } + @Override - public String[] getDescription() { - return BW_Tooltip_Reference.getTranslatedBrandedTooltip("tooltip.tile.eic.0.name"); + public void construct(ItemStack itemStack, boolean b) { + buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 1, 6, 0); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index e3b3e64753..a4fab93440 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -22,34 +22,35 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; +import com.gtnewhorizon.structurelib.StructureLibAPI; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.IStructureElementNoPlacement; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.metatileentity.implementations.*; import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; -public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase { +public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBlockBase { - private static final byte SINGLE_UPSTEP = 0; - private static final byte SINGLE_DOWNSTEP = 1; - private static final byte MULTI_UPSTEP = 2; - private static final byte MULTI_DOWNSTEP = 3; private byte mode; - private byte texid = 2; - private long mCoilWicks; + private int mTiers; private boolean upstep = true; public GT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) { @@ -60,6 +61,96 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase super(aName); } + private static final int CASING_INDEX = 2; + private static final String STRUCTURE_PIECE_BASE = "base"; + private static final String STRUCTURE_PIECE_LAYER = "layer"; + private static final String STRUCTURE_PIECE_TOP = "top"; + private static final String STRUCTURE_PIECE_TAP_LAYER = "taplayer"; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][]{ + {"b~b", "bbb", "bbb"} + })) + .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][]{ + {"ttt", "tft", "ttt"} + })) + .addShape(STRUCTURE_PIECE_TOP, transpose(new String[][]{ + {"ooo", "ooo", "ooo"} + })) + .addShape(STRUCTURE_PIECE_TAP_LAYER, transpose(new String[][]{ + {" TTT ", "TtttT", "TtftT", "TtttT", " TTT "} + })) + .addElement('b', ofChain( + ofHatchAdder(GT_TileEntity_ManualTrafo::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_ManualTrafo::addMaintenanceToMachineList, CASING_INDEX, 1), + ofBlock(GregTech_API.sBlockCasings1, 2) + )) + .addElement('o', ofHatchAdderOptional(GT_TileEntity_ManualTrafo::addDynamoToMachineList, CASING_INDEX, 2, GregTech_API.sBlockCasings1, 2)) + .addElement('t', ofBlock(BW_BLOCKS[2], 1)) + .addElement('f', ofBlock(BW_BLOCKS[2], 0)) + .addElement('T', new IStructureElementNoPlacement() { + @Override + public boolean check(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z) { + if(world.isAirBlock(x, y, z)) + return true; + TileEntity tileEntity = world.getTileEntity(x, y, z); + if(tileEntity == null) + return true; + if(!(tileEntity instanceof IGregTechTileEntity)) + return true; + IMetaTileEntity mte = ((IGregTechTileEntity) tileEntity).getMetaTileEntity(); + if(mte instanceof GT_MetaTileEntity_Hatch_Dynamo || mte instanceof GT_MetaTileEntity_Hatch_Energy) { + int intier = te.mEnergyHatches.get(0).mTier; + if(((GT_MetaTileEntity_TieredMachineBlock) mte).mTier == intier + (te.upstep ? te.mTiers : -te.mTiers)){ + te.addToMachineList((IGregTechTileEntity)tileEntity, CASING_INDEX); + return true; + } + else + return false; + } + return true; + } + + @Override + public boolean spawnHint(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z, ItemStack itemStack) { + StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 2 /* aDots: 3 */); + return true; + } + } + ) + .build(); + + @Override + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Transformer") + .addInfo("Controller block for the Manual Trafo") + .addInfo("Operates in 4 diffrent modes:") + .addInfo("Mode 1: Circuit 0 in controller: Direct-Upstep") + .addInfo("Mode 2: Circuit 1 in controller: Direct-Downstep") + .addInfo("Mode 3: Circuit 2 in controller: Tapped-Upstep (currently disabled)") + .addInfo("Mode 4: Circuit 2 in controller: Tapped-Downstep (currently disabled)") + .addSeparator() + .beginVariableStructureBlock(3, 3, 3, 10, 3, 3, false) + .addController("Front bottom center") + .addCasingInfo("MV Machine Casing", 0) + .addOtherStructurePart("Transformer-Winding Blocks", "1 Layer for each tier transformed") + .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Middle of Transformer-Winding Blocks") + .addMaintenanceHatch("Any bottom layer casing", 1) + .addEnergyHatch("Any bottom layer casing", 1) + .addDynamoHatch("Any top layer casing", 2) + .addStructureInfo("---------TAPPED MODE---------") + .addEnergyHatch("Touching Transformer-Winding Blocks", 3) + .addDynamoHatch("Touching Transformer-Winding Blocks", 3) + .addStructureInfo("Hatches touching Transformer-Winding Blocks must be tiered from bottom to top") + .toolTipFinisher("Bartworks"); + return tt; + } + @Override public boolean isCorrectMachinePart(ItemStack itemStack) { return true; @@ -88,8 +179,8 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase else this.mEfficiency = this.getMaxEfficiency(null); - if (this.mode > GT_TileEntity_ManualTrafo.SINGLE_DOWNSTEP) { - return this.onRunningTickTabbedMode(); + if (this.mode > 1) { + return false;//this.onRunningTickTabbedMode(); Tapped mode is disable } return this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput(this.getInputTier() * 2 * this.mEnergyHatches.size() * (long) this.mEfficiency / this.getMaxEfficiency(null)); @@ -135,215 +226,64 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase this.stopMachine(); return false; } - this.mode = this.mInventory[1] == null ? 0 : this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit") ? this.mInventory[1].getItemDamage() > 4 ? (byte) this.mInventory[1].getItemDamage() : 0 : 0; - this.upstep = (this.mode == 0 || this.mode == 2); + if(itemStack == null || !itemStack.getUnlocalizedName().startsWith("gt.integrated_circuit")) + this.mode = 0; + else + this.mode = (byte)Math.min(3, itemStack.getItemDamage()); + this.upstep = this.mode % 2 == 0; this.mProgresstime = 0; this.mMaxProgresstime = 1; this.mEfficiency = Math.max(this.mEfficiency, 100); - return this.upstep ? this.getOutputTier() - this.getInputTier() == this.mCoilWicks : this.getInputTier() - this.getOutputTier() == this.mCoilWicks; + return this.upstep ? this.getOutputTier() - this.getInputTier() == this.mTiers : this.getInputTier() - this.getOutputTier() == this.mTiers; } @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - this.mode = this.mInventory[1] == null ? 0 : this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit") ? this.mInventory[1].getItemDamage() > 4 ? (byte) this.mInventory[1].getItemDamage() : 0 : 0; - - if (this.mode <= 1) { - - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; - - //check height - int y = 1; - boolean stillcoil = true; - while (stillcoil) { - for (int x = -1; x <= 1; ++x) { - for (int z = -1; z <= 1; ++z) { - if (x != 0 || z != 0) { - stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; - if (stillcoil) { - ++this.mCoilWicks; - if (this.mCoilWicks % 8 == 0) { - ++y; - } - } else - break; - } - } - if (!stillcoil) - break; - } - } + if(itemStack == null || !itemStack.getUnlocalizedName().startsWith("gt.integrated_circuit")) + this.mode = 0; + else + this.mode = (byte)Math.min(3, itemStack.getItemDamage()); - if (this.mCoilWicks % 8 != 0) - return false; - - this.mCoilWicks = this.mCoilWicks / 8; - - //check interior (NiFeZn02 Core) - for (int i = 1; i <= this.mCoilWicks; ++i) { - if (!aBaseMetaTileEntity.getBlockOffset(xDir, i, zDir).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir, i, zDir) == 0) { - return false; - } - } + this.upstep = this.mode % 2 == 0; + boolean tapmode = this.mode > 1; - //check Bottom - for (int x = -1; x <= 1; ++x) - for (int z = -1; z <= 1; ++z) - if (xDir + x != 0 || zDir + z != 0) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addEnergyInputToMachineList(tTileEntity, this.texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } - /* - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { - return false; - } - */ - } - } - - //check Top - for (int x = -1; x <= 1; ++x) - for (int z = -1; z <= 1; ++z) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addDynamoToMachineList(tTileEntity, this.texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } - /* - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { - return false; - } - */ - } - } - - // check dynamos and energy hatches for the same tier - byte outtier = this.mDynamoHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { - if (out.mTier != outtier) - return false; - } + if(!checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0)) + return false; - byte intier = this.mEnergyHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) { - if (in.mTier != intier) - return false; - } - } else { - - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; - int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY * 2; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; - //check height - int y = 1; - boolean stillcoil = true; - while (stillcoil) { - for (int x = -1; x <= 1; ++x) { - for (int z = -1; z <= 1; ++z) { - if (x != 0 || z != 0) { - stillcoil = aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == 1; - if (stillcoil) { - ++this.mCoilWicks; - if (this.mCoilWicks % 8 == 0) { - ++y; - } - } else - break; - } - } - if (!stillcoil) - break; - } - } + if(this.mEnergyHatches.size() == 0) + return false; - if (this.mCoilWicks % 8 != 0) + byte intier = this.mEnergyHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) + if (in.mTier != intier) return false; - this.mCoilWicks = this.mCoilWicks / 8; - - //check interior (NiFeZn02 Core) - for (int i = 1; i <= this.mCoilWicks; ++i) { - if (!aBaseMetaTileEntity.getBlockOffset(xDir, i, zDir).equals(ItemRegistry.BW_BLOCKS[2]) && aBaseMetaTileEntity.getMetaIDOffset(xDir, i, zDir) == 0) { - return false; - } + int mHeight; + for(mHeight = 1; mHeight <= 8; mHeight++) { + if(tapmode) + { + this.mTiers = mHeight; + if(!checkPiece(STRUCTURE_PIECE_TAP_LAYER, 2, mHeight, 1)) + break; } + else if (!checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0)) + break; + } + if (!checkPiece(STRUCTURE_PIECE_TOP, 1, mHeight, 0)) + return false; + this.mTiers = mHeight - 1; - //check Bottom - for (int x = -2; x <= 2; ++x) - for (int z = -2; z <= 2; ++z) - if (xDir + x != 0 || zDir + z != 0) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, 0, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addEnergyInputToMachineList(tTileEntity, this.texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } - /* - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { - return false; - } - */ - } - } - - //check Top - for (int x = -2; x <= 2; ++x) - for (int z = -2; z <= 2; ++z) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addDynamoToMachineList(tTileEntity, this.texid)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, (int) this.mCoilWicks + 1, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } - /* - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, 0, zDir + z) != 11) { - return false; - } - */ - } - } + if (this.mDynamoHatches.size() == 0 || mMaintenanceHatches.size() != 1 || this.mTiers == 0) + return false; - if (this.mDynamoHatches.size() <= 0 || this.mEnergyHatches.size() <= 0) + byte outtier = this.mDynamoHatches.get(0).mTier; + for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { + if (out.mTier != outtier) return false; - - byte outtier = this.mDynamoHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { - if (out.mTier != outtier) - return false; - } - - byte intier = this.mEnergyHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) { - if (in.mTier != intier) - return false; - } - - - //check tap hull - for (int ty = 1; ty <= y; ++ty) { - - byte leveltier; - if (this.mInventory[1].getItemDamage() == 2) - leveltier = ((byte) (intier - ty)); - else if (this.mInventory[1].getItemDamage() == 3) - leveltier = ((byte) (intier + ty)); - else - return false; - - for (int x = -2; x <= 2; ++x) - for (int z = -2; z <= 2; ++z) - if (x == -2 || z == -2 || x == 2 || z == 2) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, ty, zDir + z); - if (!this.addMaintenanceToMachineList(tTileEntity, this.texid) && !this.addEnergyInputToMachineList(tTileEntity, this.texid, leveltier) && !this.addDynamoToMachineList(tTileEntity, this.texid, leveltier)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, ty, zDir + z) != GregTech_API.sBlockCasings1) { - return false; - } - } - } - } } - return !this.mDynamoHatches.isEmpty() && !this.mEnergyHatches.isEmpty(); + + return true; } @Override @@ -371,64 +311,53 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase return new GT_TileEntity_ManualTrafo(this.mName); } - @Override - public String[] getDescription() { - return BW_Tooltip_Reference.getTranslatedBrandedTooltip("tooltip.tile.manualtravo.0.name"); - } - @Override public void saveNBTData(NBTTagCompound ntag) { - ntag.setLong("mCoilWicks", this.mCoilWicks); super.saveNBTData(ntag); + ntag.setInteger("mTiers", this.mTiers); + ntag.setByte("mMode", this.mode); + ntag.setBoolean("upstep", this.upstep); } @Override public void loadNBTData(NBTTagCompound ntag) { super.loadNBTData(ntag); - this.mCoilWicks = ntag.getLong("mCoilWicks"); + this.mTiers = ntag.getInteger("mTiers"); + this.mode = ntag.getByte("mMode"); + this.upstep = ntag.getBoolean("upstep"); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(this.texid), TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW).glow().build()))} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(this.texid)}; - } - - public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex, short tier) { - if (aTileEntity == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { - if (tier == ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mTier) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - } - return false; - } else { - return false; - } + if (aSide == aFacing) { + if (aActive) + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).extFacing().glow().build()}; + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW).extFacing().glow().build()}; } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } - public boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex, short tier) { - if (aTileEntity == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { - if (tier == ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mTier) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); - } - return false; - } else { - return false; - } + @Override + public void construct(ItemStack itemStack, boolean b) { + if(this.mInventory[1] == null || !this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) + this.mode = 0; + else + this.mode = (byte)Math.min(3, this.mInventory[1].getItemDamage()); + int mHeight = Math.min(itemStack.stackSize, 8); + boolean tapmode = this.mode > 1; + buildPiece(STRUCTURE_PIECE_BASE, itemStack, b, 1, 0, 0); + for(int i = 0; i < mHeight; i++) { + if (tapmode) + buildPiece(STRUCTURE_PIECE_TAP_LAYER, itemStack, b, 2, i + 1, 1); + else + buildPiece(STRUCTURE_PIECE_LAYER, itemStack, b, 1, i + 1, 0); } + buildPiece(STRUCTURE_PIECE_TOP, itemStack, b, 1, mHeight + 1, 0); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index bb7ac747ad..15deb54ac4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -26,8 +26,11 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_Windmill; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; import com.github.bartimaeusnek.bartworks.server.container.BW_Container_Windmill; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.gtnewhorizon.structurelib.StructureLibAPI; +import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -39,9 +42,10 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; import gregtech.api.objects.XSTR; import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -55,15 +59,16 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.util.ForgeDirection; import java.util.Arrays; import java.util.HashSet; import java.util.Set; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.enums.GT_Values.V; -public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { +public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlockBase { private static final IIcon[] iIcons = new IIcon[2]; private static final IIconContainer[] iIconContainers = new IIconContainer[2]; @@ -71,7 +76,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { private static final XSTR localRandomInstance = new XSTR(); private BW_RotorBlock rotorBlock; - private byte hasDoor; + private int mDoor = 0; + private int mHardenedClay = 0; public GT_TileEntity_Windmill(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -81,6 +87,62 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { super(aName); } + private static final String STRUCTURE_PIECE_MAIN = "main"; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {" ", " ", " ", " p ", " ", " ", " "}, + {" ", " ", " ppp ", " p p ", " ppp ", " ", " "}, + {" ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " "}, + {" ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, + {" ppspp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, + {" ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, + {" ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " "}, + {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, + {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, + {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, + {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, + {" bb~bb ", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", " bbbbb "}, + })) + .addElement('p', ofBlockAnyMeta(Blocks.planks)) + .addElement('c', ofChain( + onElementPass(t -> t.mHardenedClay++, ofBlock(Blocks.hardened_clay, 0)), + ofTileAdder(GT_TileEntity_Windmill::addDispenserToOutputSet, Blocks.hardened_clay, 0), + onElementPass(t -> t.mDoor++, ofBlock(Blocks.wooden_door, 0)) + )) + .addElement('b', ofBlock(Blocks.brick_block, 0)) + .addElement('s', ofTileAdder(GT_TileEntity_Windmill::setRotorBlock, StructureLibAPI.getBlockHint(), 0)) + .build(); + + @Override + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + protected IAlignmentLimits getInitialAlignmentLimits() { + return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && f.isNotFlipped(); + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt. + addMachineType("Windmill"). + addInfo("Controller block for the Windmill"). + addInfo("A primitive Grinder powered by Kinetic energy"). + addInfo("The structure is too complex!"). + addInfo("Follow the StructureLib hologram projector to build the main structure."). + addSeparator(). + beginStructureBlock(7, 12, 7, false). + addController("Front bottom center"). + addCasingInfo("Hardened Clay block", 40). + addOtherStructurePart("Dispenser", "Any Hardened Clay block"). + addOtherStructurePart("0-1 Wooden door", "Any Hardened Clay block"). + addStructureHint("Primitive Kinetic Shaftbox", 1). + toolTipFinisher("Bartworks"); + return tt; + } + @Override public boolean isCorrectMachinePart(ItemStack itemStack) { return true; @@ -368,6 +430,14 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { return false; } + public boolean setRotorBlock(TileEntity aTileEntity){ + if (aTileEntity instanceof BW_RotorBlock) { + this.rotorBlock = (BW_RotorBlock) aTileEntity; + return true; + } + return false; + } + @SuppressWarnings("ALL") @Override public boolean addOutput(ItemStack aStack) { @@ -401,85 +471,17 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - /* - * offset x1 = 3x3 - * offset x2 = 5x5 - * offset x3 = 7x7 - * etc. - */ - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 3; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 3; - - //floor - for (int x = -3; x <= 3; x++) { - for (int z = -3; z <= 3; z++) { - if (!((Math.abs(x) == 3 && Math.abs(z) == 3) || (xDir + x == 0 && zDir + z == 0))) - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 0, zDir + z) != Blocks.brick_block) { - return false; - } - } - } - //h_clay shaft - for (int y = 1; y <= 4; y++) - for (int x = -2; x <= 2; x++) - for (int z = -2; z <= 2; z++) { - if (!((Math.abs(x) == 2 && Math.abs(z) == 2) || (Math.abs(x) < 2 && Math.abs(z) != 2))) - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) != Blocks.hardened_clay && !this.addDispenserToOutputSet(aBaseMetaTileEntity.getTileEntityOffset(xDir + x, y, zDir + z))) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) == Blocks.wooden_door && this.hasDoor < 3) { - this.hasDoor++; - continue; - } - return false; - } - } - - //plank layer 1 - for (int x = -2; x <= 2; x++) - for (int z = -2; z <= 2; z++) { - if (!(Math.abs(x) < 2 && Math.abs(z) != 2)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 5, zDir + z) != Blocks.planks) - return false; - } - } + this.tileEntityDispensers.clear(); + this.mDoor = 0; + this.mHardenedClay = 0; - //plank layer 2-4 - for (int x = -3; x <= 3; x++) - for (int y = 6; y <= 8; y++) - for (int z = -3; z <= 3; z++) - if (!(((Math.abs(x) == 3 && Math.abs(z) == 3) || (Math.abs(x) < 3 && (Math.abs(z) != 2 || Math.abs(z) != 1))) || (xDir + x == 0 && zDir + z == 0 && y == 7))) - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z) != Blocks.planks) - return false; - - //plank layer 5 - for (int x = -2; x <= 2; x++) - for (int z = -2; z <= 2; z++) - if (!(Math.abs(x) < 2 && (Math.abs(z) != 2))) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 9, zDir + z) != Blocks.planks) - return false; - } - //plank layer 6 - for (int x = -1; x <= 1; x++) - for (int z = -1; z <= 1; z++) - if (!(Math.abs(x) < 1 && (Math.abs(z) != 1))) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + x, 10, zDir + z) != Blocks.planks) - return false; - } - //plank layer 7 - if (aBaseMetaTileEntity.getBlockOffset(xDir, 11, zDir) != Blocks.planks) + if(!checkPiece(STRUCTURE_PIECE_MAIN, 3, 11, 0)) return false; - //Rotor Block - TileEntity te = this.getBaseMetaTileEntity().getWorld().getTileEntity(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord() + 7, this.getBaseMetaTileEntity().getZCoord()); - - if (te instanceof BW_RotorBlock) - this.rotorBlock = (BW_RotorBlock) te; - else + if (this.tileEntityDispensers.isEmpty() || this.mDoor > 2 || this.mHardenedClay < 40) return false; - //check for outputs - if (this.tileEntityDispensers.isEmpty()) - return false; this.mWrench = true; this.mScrewdriver = true; this.mSoftHammer = true; @@ -487,9 +489,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { this.mSolderingTool = true; this.mCrowbar = true; - //reset door cause bugs >_> - this.hasDoor = 0; - return true; } @@ -500,11 +499,9 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { if (aBaseMetaTileEntity.isServerSide()) { if (this.mEfficiency < 0) this.mEfficiency = 0; - //noinspection NonAtomicOperationOnVolatileField - if (--this.mUpdate == 0 || --this.mStartUpCheck == 0) { - this.hasDoor = 0; - this.tileEntityDispensers.clear(); - this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); + if (--this.mUpdate == 0 || --this.mStartUpCheck == 0 || this.mStructureChanged) { + checkStructure(true, aBaseMetaTileEntity); + this.mUpdate = 100; } if (this.mStartUpCheck < 0) { if (this.mMachine) { @@ -536,14 +533,14 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { } } } else { - this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); + //this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); return; } } else { this.stopMachine(); } } - aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (this.mWrench ? 0 : 1) | (this.mScrewdriver ? 0 : 2) | (this.mSoftHammer ? 0 : 4) | (this.mHardHammer ? 0 : 8) | (this.mSolderingTool ? 0 : 16) | (this.mCrowbar ? 0 : 32) | (this.mMachine ? 0 : 64)); + aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (this.mMachine ? 0 : 64)); aBaseMetaTileEntity.setActive(this.mMaxProgresstime > 0); } @@ -585,11 +582,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { return new GT_TileEntity_Windmill(this.mName); } - @Override - public String[] getDescription() { - return BW_Tooltip_Reference.getTranslatedBrandedTooltip("tooltip.tile.windmill.0.name"); - } - @Override public String[] getInfoData() { return new String[]{"Progress:", this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", this.rotorBlock.getGrindPower() + "KU/t"}; @@ -663,4 +655,9 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { return this.getBaseMetaTileEntity().getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; } + + @Override + public void construct(ItemStack itemStack, boolean b) { + buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 3, 11, 0); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 95f5c0f036..744f2a2797 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -24,21 +24,26 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MegaUtils; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_VacuumFreezer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -48,10 +53,12 @@ import java.util.List; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.util.GT_StructureUtility.*; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFreezer implements TecTechEnabledMulti { +public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_EnhancedMultiBlockBase implements TecTechEnabledMulti { public GT_TileEntity_MegaVacuumFreezer(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -61,10 +68,6 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre super(aName); } - public String[] getDescription() { - return BW_Tooltip_Reference.getTranslatedBrandedTooltip("tooltip.tile.mvf.0.name"); - } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_TileEntity_MegaVacuumFreezer(this.mName); @@ -74,6 +77,47 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre public ArrayList TTTunnels = new ArrayList<>(); @SuppressWarnings("rawtypes") public ArrayList TTMultiAmp = new ArrayList<>(); + private int mCasing = 0; + + private static final int CASING_INDEX = 17; + private static final String STRUCTURE_PIECE_MAIN = "main"; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {"ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccc~ccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc"} + })) + .addElement('c', ofChain( + ofHatchAdder(GT_TileEntity_MegaVacuumFreezer::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_MegaVacuumFreezer::addMaintenanceToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_MegaVacuumFreezer::addOutputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_MegaVacuumFreezer::addInputToMachineList, CASING_INDEX, 1), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings2, 1)) + )) + .build(); + + + @Override + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + public void construct(ItemStack aStack, boolean aHintsOnly) { + buildPiece(STRUCTURE_PIECE_MAIN, aStack, aHintsOnly, 7, 7, 0); + } @Override public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { @@ -96,6 +140,11 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre return super.getMaxInputVoltage(); } + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sVacuumRecipes; + } + @Override public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); @@ -152,14 +201,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre return false; } - @Override - public IStructureDefinition getStructureDefinition() { - throw new UnsupportedOperationException(); - } - @Override - public void construct(ItemStack aStack, boolean aHintsOnly) { - } // -------------- TEC TECH COMPAT ---------------- @@ -169,24 +211,79 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre this.getTecTechEnergyMultis().clear(); this.getTecTechEnergyTunnels().clear(); } - return ( - BW_Util.check_layer(aBaseMetaTileEntity, 7, -7, -6, GregTech_API.sBlockCasings2, 1, 7, false, false, true, GregTech_API.sBlockCasings2, 1, true, 17) - && BW_Util.check_layer(aBaseMetaTileEntity, 7, -6, 0, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) - && BW_Util.check_layer(aBaseMetaTileEntity, 7, 0, 1, GregTech_API.sBlockCasings2, 1, 7, true, false, true, Blocks.air, -1, true, 17) - && BW_Util.check_layer(aBaseMetaTileEntity, 7, 1, 7, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) - && BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false, false, true, GregTech_API.sBlockCasings2, 1, true, 17) - ) && - !this.mMaintenanceHatches.isEmpty() && - LoaderReference.tectech ? - (!this.getTecTechEnergyMultis().isEmpty() || !this.getTecTechEnergyTunnels().isEmpty() || !this.mEnergyHatches.isEmpty()) : - !this.mEnergyHatches.isEmpty(); + this.mCasing = 0; + if(!checkPiece(STRUCTURE_PIECE_MAIN, 7, 7, 0)) + return false; + return + this.mMaintenanceHatches.size() == 1 && + (LoaderReference.tectech ? + (!this.getTecTechEnergyMultis().isEmpty() || !this.getTecTechEnergyTunnels().isEmpty() || !this.mEnergyHatches.isEmpty()) : + !this.mEnergyHatches.isEmpty()) && + this.mCasing >= 900; } + @Override public String[] getInfoData() { return LoaderReference.tectech ? this.getInfoDataArray(this) : super.getInfoData(); } + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Vacuum Freezer"). + addInfo("Controller Block for the Mega Vacuum Freezer"). + addInfo("Cools hot ingots and cells"). + addSeparator(). + beginStructureBlock(15, 15, 15, true). + addController("Front center"). + addCasingInfo("Frost Proof Machine Casing", 900). + addEnergyHatch("Any casing", 1). + addMaintenanceHatch("Any casing", 1). + addInputHatch("Any casing", 1). + addOutputHatch("Any casing", 1). + addInputBus("Any casing", 1). + addOutputBus("Any casing", 1). + toolTipFinisher("Bartworks"); + return tt; + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + ITexture[] rTexture; + if (aSide == aFacing) { + if (aActive) { + rTexture = new ITexture[]{Textures.BlockIcons.casingTexturePages[0][17], TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE}).extFacing().build(), TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW}).extFacing().glow().build()}; + } else { + rTexture = new ITexture[]{Textures.BlockIcons.casingTexturePages[0][17], TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER}).extFacing().build(), TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_GLOW}).extFacing().glow().build()}; + } + } else { + rTexture = new ITexture[]{Textures.BlockIcons.casingTexturePages[0][17]}; + } + + return rTexture; + } + @Override @Optional.Method(modid = "tectech") public List getVanillaEnergyHatches() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index dc0b26776f..39cf609c14 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -591,7 +591,7 @@ public class BW_Util { public static byte calculateGlassTier(@Nonnull Block block, @Nonnegative byte meta) { byte boroTier = BorosilicateGlass.getTier(block, meta); - if (boroTier < 0) + if (boroTier != -1) return boroTier; if (block.getUnlocalizedName().equals("blockAlloyGlass")) diff --git a/src/main/resources/assets/bartworks/lang/de_DE.lang b/src/main/resources/assets/bartworks/lang/de_DE.lang index 98a94abc98..5f47ffc626 100644 --- a/src/main/resources/assets/bartworks/lang/de_DE.lang +++ b/src/main/resources/assets/bartworks/lang/de_DE.lang @@ -102,9 +102,7 @@ tooltip.teslastaff.0.name=Keine Garantie! tooltip.tile.acidgen.0.name=Ein Säure Generator tooltip.tile.acidgen.1.name=Creates Power from Chemical Energy Potentials. tooltip.tile.biolab.0.name=The BioLab, a Multi-Use Bioengineering Station -tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom and top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radiation Input Bus;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! tooltip.tile.diode.0.name=A Simple diode that will allow Energy Flow in only one direction. -tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so! tooltip.tile.energydistributor.0.name=Splits Amperage into several Sides. tooltip.tile.lesu.0.name=Controller Block for the GT2-Styled L.E.S.U.;Size: ANY tooltip.tile.lesu.1.name=Storage per LESU Casing: @@ -113,7 +111,6 @@ tooltip.tile.lesu.3.name=Only one Controller allowed, no Wallsharing! tooltip.tile.manualtravo.0.name=Controller Block for the Manual Trafo;Operates in 4 different Modes:;Mode 1: Circuit 0 in controller: Direct-Upstep;Mode 2: Circuit 1 in controller: Direct-Downstep;Mode 3: Circuit 2 in controller: Tapped-Upstep;Mode 4: Circuit 3 in controller: Tapped-Downstep;For direct Modes: 3xHx3;Base Contains at least 1 Energy Hatch;1 Layer of Transformer-Winding Blocks for each Tier transformed;Middle of Transformer-Winding Blocks needs to be a Nickel-Zinc Ferrite Block;Top Contains at least 1 Dynamo Hatch;Maintenance Hatch can be placed anywhere;Tapped Mode is disabled at the Moment. tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3nd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Borosilicate Glass;The glass limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum tooltip.tile.mbf.1.name=Pollution per second -tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);1x Input Bus (Any casing);1x Output Bus (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest tooltip.tile.radhatch.0.name=Radioactive Item Chamber for Multiblocks tooltip.tile.radhatch.1.name=Use a screwdriver to set the containment level tooltip.tile.radhatch.2.name=Material: diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index bebfa4161c..b556a2bfe5 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -104,8 +104,6 @@ tooltip.tile.waterpump.2.name=Must be placed on the Ground. tooltip.tile.mbf.0.name=Controller Block for the Mega Blast Furnace;Size(WxHxD): 15x20x15 (Hollow);Controller: 3rd Layer Middle Center;Inner 13x18x13 Heating Coils (Hollow);Outer 15x18x15 Borosilicate Glass;The glass tier limits the Energy Input tier;1+ Input Hatch/Bus (Any casing);1+ Output Hatch/Bus (Any casing);1+ Energy Hatch (Any casing);1x Maintenance Hatch (Any casing);13x13 Muffler Hatches (Top middle);Heat Proof Machine Casings for the outer 15x15 (Layer 20);1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing); Recovery scales with Muffler Hatch tier;Heat Proof Machine Casings for Base;Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively);Each 1800K over the min. Heat Capacity allows for one upgraded overclock;Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%;Causes maximum tooltip.tile.mbf.1.name=Pollution per second -tooltip.tile.mvf.0.name=Controller Block for the Mega Vacuum Freezer;Super cools hot ingots and cells;Size(WxHxD): 15x15x15 (Hollow);Controller: (Front centered);0-1x Input Bus (Any casing);0-1x Output Bus (Any casing);0-1x Input Hatch (Any casing);0-1x Output Hatch (Any casing);1x Maintenance Hatch (Any casing);1x Energy Hatch (Any casing);Frost Proof Machine Casings for the rest -tooltip.tile.bvat.0.name=Controller Block for the Bacterial Vat;Size(WxHxD): 5x4x5;Bottom and top are Stainless Steel Casings;Bottom or top must contain:;1x Maintenance, 1x Output Hatch;1 or more Input Hatches, 1 or more Input Buses, 0-1 Radio Hatch;The two middle layers must be build out of glass, hollow;The glass can be any glass, i.e. Tinkers Construct Clear Glass;Some Recipes need more advanced Glass Types;For maximum efficiency boost keep the Output Hatch always half filled! tooltip.tile.windmill.0.name=A primitive Grinder powered by Kinetic energy.;Size(WxHxD): 7x12x7;Layer 1: 7x7 Bricks, corners are air, controller at front centered.;Layer 2-5: 5x5 Hardened Clay, corners are air, can contain one door,;hollow, Wall must contain at least one Dispenser;Layer 6: 5x5 Wood Planks. Corners are filled, hollow.;Layer 7: 7x7 Wood Planks. Corners are air, hollow.;Layer 8: 7x7 Wood Planks. Corners are air, hollow,;front centered must be a Primitive Kinetic Shaftbox;Layer 9: 7x7 Wood Planks. Corners are air, hollow.;Layer 10: 5x5 Wood Planks. Corners are filled, hollow.;Layer 11: 3x3 Wood Planks. Corners are filled, hollow.;Layer 12: 1x1 Wood Plank.;Needs a Wind Mill Rotor in the Shaftbox to operate;Input items in Controller;Output items will appear in the dispensers;It is faster in regions with more wind (like IC2 Windmills) tooltip.tile.lesu.0.name=Controller Block for the GT2-Styled L.E.S.U.;Size: ANY tooltip.tile.lesu.1.name=Storage per LESU Casing: @@ -156,8 +154,6 @@ item.BurnedOutTRISOPellet.name=Burned Out TRISO pebble itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials -tooltip.tile.eic.0.name=Controller Block for the Electric Implosion Compressor;Size(WxHxD): 3x9x3;Uses Electricity instead of Explosives;Controller: Layer 3, front, center;Layer 1 and Layer 9: Solid Steel Machine Casings, each: 1 Energy Hatch in the middle;Layer 2,3,7,8: Middle: Nickel-Zinc-Ferrit Blocks, Outer: Transformer-Winding Blocks;Layer 4,5,6: Neutronium Blocks;1+ Input Bus, 1+ Output Bus, 1 Maintenance Hatch at any Solid Steel Machine Casing;Do NOT Obstruct or mine the Moving parts while in Operation, will explode if you do so! - BW.keyphrase.Hint_Details=Hint Details BW.tile.CircuitAssemblyLine.hint.0=1 - Energy Input Hatch BW.tile.CircuitAssemblyLine.hint.1=2 - Maintenance Hatch, Input Hatch diff --git a/src/main/resources/assets/bartworks/lang/fr_FR.lang b/src/main/resources/assets/bartworks/lang/fr_FR.lang index 1528e26c86..6ccf3387b2 100644 --- a/src/main/resources/assets/bartworks/lang/fr_FR.lang +++ b/src/main/resources/assets/bartworks/lang/fr_FR.lang @@ -102,8 +102,6 @@ tooltip.tile.waterpump.2.name=Doit être placé sur le sol. tooltip.tile.mbf.0.name=Bloc contrôleur pour le haut fourneau;Taille(LxHxP): 15x20x15 (creux);Contrôleur: 3ème couche centré au milieu;Intérieur 13x18x13 bobines de chauffage (creux);Extérieur 15x18x15 Verre Borosilicate;Le verre limite le tier d'énergie en entrée;1+ Trappe/Bus d'entrée (n'importe quel bloc carter);1+ bus de sortie(n'importe quel bloc carter);1+ trappe d'énergie (n'importe quel bloc carter);1x trappe de maintenance (n'importe quel bloc carter);Blocs carter de machine résistant à la chaleur pour l'extérieur 15x15 (couche 20);La récupération se câle sur le tier de la trappe d'échappement;Blocs carter de machine résistant à la chaleur pour la base;Chaque 900K supérieur à la température de base donne 5% de rapidité (multiplicativement);Chaque 1800k supérieur à la température de base donne un overclock gratuit;Chaque overclock reduit le temps de craft de 25% et augmente la consommation d'EU/t de 400%;Cause une pollution maximale. tooltip.tile.mbf.1.name=Pollution par seconde -tooltip.tile.mvf.0.name=Bloc contrôleur pour le Méga Refroidisseur A Vide;Refroidit très vite les lingots chauds et les cellules;Taille(LxHxP): 15x15x15 (Creux);Contrôleur: (centré devant);1x Bus d'entrée (n'importe quel bloc carter);1x Bus de sortie (n'importe quel bloc carter);1x Trappe de maintenance (n'importe quel bloc carter);1x Trappe d'énergie (n'importe quel bloc carter);Blocs carter de machine résistant au froid pour le reste. -tooltip.tile.bvat.0.name=Bloc contrôleur pour la Bio Cuve;Taille(LxHxP): 5x4x5;Le haut et le bas sont des bloc carter en acier inoxydable;Le haut et le bas doivent contenir:;1x trappe de Maintenance, 1x trappe de sortie;1 ou plus de trappe d'entrée, 1 ou plus de bus d'entrée, 0-1 trappe radio;Les deux couches du milieu doivent être construites avec du verre, (creux);Le verre peut être n'importe le quel, i.e. le Verre transparent de Tinkers Construct;Certaines recettes ont besoin de verre plus avancés;Pour un boost d'efficacité maximum gardez la trappe de sortie toujours remplie à moitié! tooltip.tile.windmill.0.name=Un broyeur primitif fonctionnant a l'énergie cinétique.;Taille(LxHxP): 7x12x7;Couche 1: 7x7 Briques, les coins sont laissés vide,le contrôleur est centré devant.;(creux), les mur doivent contenir au moins un Dispenseur;Couche 7: 7x7 Planches de Bois. les coins sont laissés vide, (creux).;Couche 8: 7x7 Planches de Bois. les coins sont laissés vide, (creux),;le bloc centré devant doit être une Boîte d'arbre de transmission primitive.;Couche 9: 7x7 Planches de Bois. les coins sont laissés vide, (creux).;Couche 11: 3x3 Planches de Bois. les coins sont pleins, (creux).;A besoin d'un Rotor d'éolienne dans la Boîte d'arbre de transmission pour fonctionner.;Les objets d'entrée doivent aller dans le contrôleur.;Les objets de sortie apparaîtront dans les Dispenseurs.;C'est plus rapide dans les régions venteuses (comme les éoliennes IC2). tooltip.tile.lesu.0.name=Bloc contrôleur pour le GT2-Stylé L.E.S.U.;Taille: n'importe; tooltip.tile.lesu.1.name=Stockage par carter du LESU: @@ -147,8 +145,6 @@ tile.manutrafo.name=Transformateur Manuel itemGroup.bartworksMetaMaterials=Méta Matériaux De BartWorks -tooltip.tile.eic.0.name=Bloc Contrôleur pour le Compresseur à Implosion Electrique;Taille (LxHxP): 3x9x3;Utilise de l'Electricité à la place d'Explosifs;Contrôleur: couche 3, devant, centré;Couches 1 et 9: carter de machine en acier solide, pour chaque couche: 1 Trappe d'Energie au milieu;Couche 2,3,7,8: Milieu: Bloc de Ferrite en Nickel-Zinc, Extérieur: Bloc de bobinage de Transformateur;Couche 4,5,6: Blocs de Neutronium;1+ Bus d'Entrée, 1+ Bus de Sortie, 1 trappe de maintenance n'importe où dans les Blocs Carter en Acier Solide;Ne PAS obstruer ou miner les Parties mobile pendant le fonctionnement, ou explosion garantie! - planet.Ross128b=Ross128b moon.Ross128ba=Ross128ba diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index f4a1fa6e64..b21456ded1 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -2,7 +2,7 @@ itemGroup.GT2C=GergTech2兼容 item.GT_Rockcutter_Item_LV.name=岩石切割者 LV item.GT_Rockcutter_Item_MV.name=岩石切割者 MV item.GT_Rockcutter_Item_HV.name=岩石切割者 HV -item.GT_Teslastaff_Item.name=特斯拉权杖 +item.GT_Teslastaff_Item.name=特斯拉权杖 BW_ItemBlocks.0.name=蚀刻青金石元件 BW_ItemBlocks.1.name=镀层青金石元件 GT_LESU_CASING.0.name=LESU机械方块 @@ -25,7 +25,7 @@ item.rotors.combinedParts.name=复合材料包层木框架 item.BW_SimpleWindMeter.name=简易风速计 tile.BWHeatedWaterPump.0.name=简易斯特林水泵 item.BWrawtube.name=加长玻璃管 -item.BWmotor.name=简易斯特林引擎 +item.BWmotor.name=简易斯特林引擎 item.BWstove.name=简易加热炉 itemGroup.BioTab=BartWorks-生物工程 @@ -102,8 +102,6 @@ tooltip.tile.waterpump.2.name=必须放在地上. tooltip.tile.mbf.0.name=巨型工业高炉的控制器方块;大小(宽x高x长):15x20x15(中空);控制器方块在第三层正面中央;内层13x18x13加热线圈(中空);外层15x18x15硼硅酸盐玻璃方块;玻璃等级限制了能源仓等级;1+输入仓/总线(任意机械方块);1+输出总线(任意机械方块);1+能源仓(任意机械方块);1x维护仓(任意机械方块)(注:所有底层仓室必须置于边缘);13x1x13消声仓(顶层中央);外部15x15的防热机械方块(第20层);1+输出仓以回收CO2/CO/SO2(可选,任意顶层机械方块);回收比例取决于消声仓等级;底层为隔热机械方块;自物品配方的最小炉温起,每高出900K会减少5%的能耗,使用乘法叠加;自物品配方的最小所需炉温起,每高出1800K将允许一次无损的超频;无损超频将减少加工时间至25%并提升功率至400%;每秒造成最大 tooltip.tile.mbf.1.name=污染每秒 -tooltip.tile.mvf.0.name=巨型真空冷冻机的控制器方块;将炽热的锭与单元强力冷却;大小(宽x高x长):15x15x15(中空);控制器方块(正面正中);1x输入总线(任意机械方块);1x输出总线(任意机械方块);1x维护仓(任意机械方块);1x能源仓(任意机械方块);剩余方块为防冻机械方块 -tooltip.tile.bvat.0.name=生物培养缸的控制器方块;大小(宽x高x长);5x4x5;底层和顶层为洁净不锈钢机械方块;底层或顶层必须含有:;1个维护仓,1个输出仓;1+输入仓,1个以上的输入总线,0-1个放射仓;中间两层必须由玻璃构成,中空;玻璃可以为任何玻璃,例如匠魂的通透玻璃;一些配方需要更高级的玻璃为了最大限度地提高效率,请保持输出仓始终为半满! tooltip.tile.windmill.0.name=由动能驱动的原始磨床;大小(宽x高x长):7x12x7;第1层:7x7砖块,角落空置,控制器方块在正面中央;第2-5层:5x5硬化粘土,角落空置,可包含一扇门,;中空,墙必须至少包含一个发射器;第6层:5x5木板.角落填充,中空.;第7层:7x7木板.角落空置,中空.;第8层:7x7木板.角落空置,中空,;正面中央必须是原始动力轴箱;第9层:7x7木板.角落空置,中空.;第10层:5x5木板.角落填充,中空.;第11层:3x3木板.角落填充,中空.;第12层:1x1木板;需要在轴箱中放入风车转子才可运行;在控制器中输入物品;输出物品将出现在发射器中;在风大的地区运行较快(像IC2风机一样) tooltip.tile.lesu.0.name=用于GT2风格的L.E.S.U.的控制器方块;尺寸:任意 tooltip.tile.lesu.1.name=每个LESU机械方块存储: @@ -146,8 +144,6 @@ tile.manutrafo.name=手动变压器 itemGroup.bartworksMetaMaterials=BartWorks-meta材料 -tooltip.tile.eic.0.name=电气聚爆压缩机的控制器方块;大小(宽x高x长):3x9x3;使用电而不是爆炸物工作;控制器在第三层正面中心;第一到第九层为坚硬钢机械方块,每层中间为能量仓;第2,3,7,8层:中心为镍锌铁氧体方块,其余的为变压器线圈块;第4,5,6层为中子块;1+输入总线,1+输出总线,1个维护仓于坚硬钢机械方块;在操作过程中,请勿遮挡或挖掘移动方块,这会上演爆炸的艺术!! - planet.Ross128b=罗斯128b moon.Ross128ba=罗斯128ba @@ -155,4 +151,4 @@ star.Ross128=罗斯128 solarsystem.Ross128System=罗斯128星系 itemGroup.bw.MetaItems.0=BartWorks电路更新物品 -#This zh_CN.lang is translated by huajijam for bartworks (19/7/19) \ No newline at end of file +#This zh_CN.lang is translated by huajijam for bartworks (19/7/19) -- cgit From 41a36c2ebe9834cd1d716ad89f3d2b40d093358f Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Sat, 5 Mar 2022 15:11:44 +0100 Subject: Fix invalid materials being accepted in radio hatch (#100) * Fix invalid materials being accepted in radio hatch * Dont show decay ticks when there is no material inside Former-commit-id: 707c6e793f7844f900762eed26a17d5b2de0621a --- .../tiered/GT_MetaTileEntity_RadioHatch.java | 157 +++++++++++++-------- .../server/container/GT_Container_RadioHatch.java | 40 +++--- .../crossmod/GTpp/loader/RadioHatchCompat.java | 7 +- 3 files changed, 122 insertions(+), 82 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index d4269cc534..dab124781a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -167,79 +167,123 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } } + if(this.mass >= this.cap) + return; + ItemStack lStack = this.mInventory[0]; - if (lStack == null) - return; + isStackValidRadioMaterial(lStack, true); + + } + } + + public boolean isStackValidRadioMaterial(ItemStack lStack) + { + return isStackValidRadioMaterial(lStack, false); + } - IRadMaterial radmat = null; - //gt++ compat - if (LoaderReference.miscutils) - radmat = RadioHatchCompat.GTppRadChecker(lStack); - - if (lStack.getItem() instanceof IRadMaterial || radmat != null) { - if (radmat == null) - radmat = ((IRadMaterial) lStack.getItem()); - int sv = radmat.getRadiationLevel(lStack); - if (sv > BioVatLogicAdder.RadioHatch.getMaxSv()) - BioVatLogicAdder.RadioHatch.MaxSV = sv; - if (this.mass == 0 || this.sievert == sv) { - if (this.mass + radmat.getAmountOfMaterial(lStack) <= this.cap) { - this.mass += radmat.getAmountOfMaterial(lStack); - this.sievert = sv; - this.mInventory[0].stackSize--; - this.updateSlots(); - this.colorForGUI = radmat.getColorForGUI(lStack); - this.material = radmat.getNameForGUI(lStack); - return; + public boolean isStackValidRadioMaterial(ItemStack lStack, boolean use){ + if (lStack == null) + return false; + + IRadMaterial radmat = null; + //gt++ compat + if (LoaderReference.miscutils) + radmat = RadioHatchCompat.GTppRadChecker(lStack); + + //GT++ and BW Materials check + + if (lStack.getItem() instanceof IRadMaterial || radmat != null) { + if (radmat == null) + radmat = ((IRadMaterial) lStack.getItem()); + int sv = radmat.getRadiationLevel(lStack); + int amount = radmat.getAmountOfMaterial(lStack); + if (sv > BioVatLogicAdder.RadioHatch.getMaxSv()) + BioVatLogicAdder.RadioHatch.MaxSV = sv; + if ((this.mass == 0 || this.sievert == sv) && sv > 0 && amount > 0) { + if(use) { + if (this.mass + amount <= this.cap) { + String name = radmat.getNameForGUI(lStack); + if (this.mass == 0 || this.material.equals(name)) { + this.mass += amount; + this.sievert = sv; + this.mInventory[0].stackSize--; + this.updateSlots(); + this.colorForGUI = radmat.getColorForGUI(lStack); + this.material = name; + return true; + } } + return false; } + return true; } + } - for (ItemStack varStack : BioVatLogicAdder.RadioHatch.getIsSv().keySet()) { - if (GT_Utility.areStacksEqual(varStack, lStack, true)) { - if (this.mass == 0 || this.sievert == BioVatLogicAdder.RadioHatch.getIsSv().get(varStack)) { - int massToAdd = BioVatLogicAdder.RadioHatch.getIsKg().getOrDefault(varStack,1); - if (this.mass + massToAdd <= this.cap) { - this.mass += massToAdd; - this.sievert = BioVatLogicAdder.RadioHatch.getIsSv().get(varStack); - this.mInventory[0].stackSize--; - this.updateSlots(); - this.colorForGUI = BioVatLogicAdder.RadioHatch.getIsColor().get(varStack); - this.material = StatCollector.translateToLocal(varStack.getUnlocalizedName()); - return; + // Predefined materials check + + for (ItemStack varStack : BioVatLogicAdder.RadioHatch.getIsSv().keySet()) { + if (GT_Utility.areStacksEqual(varStack, lStack, true)) { + int amount = BioVatLogicAdder.RadioHatch.getIsKg().getOrDefault(varStack,0); + int sv = BioVatLogicAdder.RadioHatch.getIsSv().get(varStack); + if ((this.mass == 0 || this.sievert == sv) && sv > 0 && amount > 0) { + if (use) { + if (this.mass + amount <= this.cap) { + String name = StatCollector.translateToLocal(varStack.getUnlocalizedName()); + if (this.mass == 0 || this.material.equals(name)) { + this.mass += amount; + this.sievert = BioVatLogicAdder.RadioHatch.getIsSv().get(varStack); + this.mInventory[0].stackSize--; + this.updateSlots(); + this.colorForGUI = BioVatLogicAdder.RadioHatch.getIsColor().get(varStack); + this.material = name; + return true; + } } + return false; } + return true; } } + } - //check material for general validity - if (GT_OreDictUnificator.getAssociation(lStack) != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial != null) { - //check orePrefix for general validity - if (GT_OreDictUnificator.getAssociation(lStack).mPrefix != null) { - OrePrefixes orePrefixes = GT_OreDictUnificator.getAssociation(lStack).mPrefix; - //check orePrefix for specialised validity - if (orePrefixes.equals(OrePrefixes.stickLong) || orePrefixes.equals(OrePrefixes.stick)) { - Materials materials = GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial; - //check material for specialised validity - if (materials.getProtons() >= 83 && materials.getProtons() != 125 || materials.getProtons() == 61 || materials.getProtons() == 43) { - if (this.mass == 0 || this.sievert == calculateSv(materials)) { - if ((this.mass + (orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1)) <= this.cap) { - this.sievert = calculateSv(materials); - this.mass += orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1; - this.mInventory[0].stackSize--; - this.updateSlots(); - this.colorForGUI = materials.mColor.mRGBa; - this.material = materials.mName; + // Rest + + //check material for general validity + if (GT_OreDictUnificator.getAssociation(lStack) != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial != null) { + //check orePrefix for general validity + if (GT_OreDictUnificator.getAssociation(lStack).mPrefix != null) { + OrePrefixes orePrefixes = GT_OreDictUnificator.getAssociation(lStack).mPrefix; + //check orePrefix for specialised validity + if (orePrefixes.equals(OrePrefixes.stickLong) || orePrefixes.equals(OrePrefixes.stick)) { + Materials materials = GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial; + //check material for specialised validity + if (materials.getProtons() >= 83 && materials.getProtons() != 125 || materials.getProtons() == 61 || materials.getProtons() == 43) { + if (use) { + int sv = calculateSv(materials); + int amount = (orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1); + if (this.mass == 0 || this.sievert == sv) { + if ((this.mass + amount) <= this.cap) { + String name = materials.mName; + if (this.mass == 0 || this.material.equals(name)) { + this.sievert = sv; + this.mass += orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1; + this.mInventory[0].stackSize--; + this.updateSlots(); + this.colorForGUI = materials.mColor.mRGBa; + this.material = materials.mName; + return true; + } } } + return false; } + return true; } } } - - } + return false; } @Override @@ -249,7 +293,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @Override public String[] getInfoData() { - if (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert) != 0) + if (this.sievert != 0) return new String[]{ StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + this.material, StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + this.sievert, @@ -291,7 +335,8 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return aSide == this.getBaseMetaTileEntity().getFrontFacing(); + return (aSide == this.getBaseMetaTileEntity().getFrontFacing() && + isStackValidRadioMaterial(aStack)); } public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java index e576296d7b..9d89ad03b3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java @@ -22,18 +22,11 @@ package com.github.bartimaeusnek.bartworks.server.container; -import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; -import com.github.bartimaeusnek.bartworks.API.IRadMaterial; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.OrePrefixes; import gregtech.api.gui.GT_Container_1by1; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.objects.ItemData; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ICrafting; @@ -43,7 +36,6 @@ import net.minecraft.item.ItemStack; import java.nio.ByteBuffer; import java.util.Iterator; -import java.util.Optional; public class GT_Container_RadioHatch extends GT_Container_1by1 { @@ -168,6 +160,21 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { return true; } + // Handle shift-clicking + @Override + public ItemStack transferStackInSlot(EntityPlayer player, int id){ + Slot slot = (Slot)this.inventorySlots.get(id); + ItemStack stack = slot.getStack(); + if(stack == null) + return null; + if(slot instanceof RadioSlot) + return super.transferStackInSlot(player, id); + else if (((GT_MetaTileEntity_RadioHatch)this.mTileEntity.getMetaTileEntity()).isStackValidRadioMaterial(stack)) + return super.transferStackInSlot(player, id); + else + return null; + } + private static class RadioSlot extends Slot{ public RadioSlot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) { super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_); @@ -175,22 +182,7 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { @Override public boolean isItemValid(ItemStack p_75214_1_) { - if (BioVatLogicAdder.RadioHatch.getIsSv() - .keySet() - .stream() - .anyMatch( - stack -> GT_Utility.areStacksEqual(stack, p_75214_1_,true) - )) - return true; - - if (!BW_Util.checkStackAndPrefix(p_75214_1_)) - return false; - - ItemData ass = GT_OreDictUnificator.getAssociation(p_75214_1_); - return IRadMaterial.class.isAssignableFrom(p_75214_1_.getItem().getClass()) || - ass.mPrefix == OrePrefixes.rod || - ass.mPrefix == OrePrefixes.stick || - ass.mPrefix == OrePrefixes.stickLong; + return ((GT_MetaTileEntity_RadioHatch)((IGregTechTileEntity)this.inventory).getMetaTileEntity()).isStackValidRadioMaterial(p_75214_1_); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java index 2b46acee0f..e362bdd5e4 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java @@ -165,7 +165,10 @@ public class RadioHatchCompat { if (RadioHatchCompat.intf.isAssignableFrom(lStack.getItem().getClass())){ if (!RadioHatchCompat.isRadioactive.getBoolean(RadioHatchCompat.f.get(lStack.getItem()))) return null; - return new RadioHatchCompat.GTPPRadAdapter(RadioHatchCompat.componentType.get(lStack.getItem()).equals(RadioHatchCompat.rod) ? 1 : RadioHatchCompat.componentType.get(lStack.getItem()).equals(RadioHatchCompat.longRod) ? 2 : 0, RadioHatchCompat.f.get(lStack.getItem())); + int amount = RadioHatchCompat.componentType.get(lStack.getItem()).equals(RadioHatchCompat.rod) ? 1 : RadioHatchCompat.componentType.get(lStack.getItem()).equals(RadioHatchCompat.longRod) ? 2 : 0; + if (amount == 0) + return null; + return new RadioHatchCompat.GTPPRadAdapter(amount, RadioHatchCompat.f.get(lStack.getItem())); } } catch (IllegalAccessException e) { e.printStackTrace(); @@ -268,4 +271,4 @@ public class RadioHatchCompat { } } -} \ No newline at end of file +} -- cgit From 29ad319c831294ca4d1df6ef17089a649a1e9358 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Sat, 5 Mar 2022 17:04:46 +0100 Subject: Update MBF description (#101) Former-commit-id: 6fc5b117a26de7a01761842473863761c13552c3 --- .../tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index b204f30502..21be004770 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -25,7 +25,6 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MegaUtils; @@ -50,7 +49,6 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; -import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -138,9 +136,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl tt.addMachineType("Blast Furnace") .addInfo("Controller block for the Mega Blast Furnace") .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") - .addInfo("Each 900K over the min. Heat required multiplies EU/t by 0.95") - .addInfo("Each 1800K over the min. Heat required allows for one upgraded overclock instead of normal") - .addInfo("Upgraded overclocks reduce recipe time to 25% (instead of 50%) and increase EU/t to 400%") + .addInfo("Each 900K over the min. Heat required reduces power consumption by 5% (multiplicatively)") + .addInfo("Each 1800K over the min. Heat required grants one perfect overclock") + .addInfo("For each perfect overclock the EBF will reduce recipe time 4 times (instead of 2) (100% efficiency)") .addInfo("Additionally gives +100K for every tier past MV") .addPollutionAmount(20 * getPollutionPerTick(null)) .addSeparator() -- cgit From 0fe957014c4725b048c43eaf196c23a181286427 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Mon, 7 Mar 2022 14:06:06 +0800 Subject: fix inventory index drift (#103) * fix inventory index drift * address even more id drift Former-commit-id: ae06354ff7a8dd01ec6dcab75f3ebae22b0f2006 --- .../tiered/GT_MetaTileEntity_BioLab.java | 86 +++++++++++----------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index c4349afa06..c477f88460 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -93,26 +93,26 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { int damage = this.getSpecialSlot().getItemDamage(); switch (damage) { case DNA_EXTRACTION_MODULE: - if (GT_Utility.isStackValid(this.mInventory[4]) && this.mInventory[4].getItem() instanceof LabParts && this.mInventory[4].getItemDamage() == 0 && this.mInventory[4].getTagCompound() != null && //checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[5]) && this.mInventory[5].getItem() instanceof LabParts && this.mInventory[5].getItemDamage() == 1 && this.mInventory[5].getTagCompound() == null && - GT_Utility.isStackValid(this.mInventory[6]) && this.mInventory[6].getItem() instanceof LabParts && this.mInventory[6].getItemDamage() == 3 && - GT_Utility.areStacksEqual(this.mInventory[7], Materials.Ethanol.getCells(1)) && + if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && this.mInventory[getInputSlot()].getItem() instanceof LabParts && this.mInventory[getInputSlot()].getItemDamage() == 0 && this.mInventory[getInputSlot()].getTagCompound() != null && //checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) && this.mInventory[getInputSlot() + 1].getItem() instanceof LabParts && this.mInventory[getInputSlot() + 1].getItemDamage() == 1 && this.mInventory[getInputSlot() + 1].getTagCompound() == null && + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) && this.mInventory[getInputSlot() + 2].getItem() instanceof LabParts && this.mInventory[getInputSlot() + 2].getItemDamage() == 3 && + GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], Materials.Ethanol.getCells(1)) && this.mFluid != null && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000 ) { - NBTTagCompound DNABioDataTag = this.mInventory[4].getTagCompound().getCompoundTag("DNA"); + NBTTagCompound DNABioDataTag = this.mInventory[getInputSlot()].getTagCompound().getCompoundTag("DNA"); if (DNABioDataTag == null) return super.checkRecipe(skipOC); - BioData cultureDNABioData = BioData.getBioDataFromName(this.mInventory[4].getTagCompound().getCompoundTag("DNA").getString("Name")); + BioData cultureDNABioData = BioData.getBioDataFromName(this.mInventory[getInputSlot()].getTagCompound().getCompoundTag("DNA").getString("Name")); if (cultureDNABioData == null) return super.checkRecipe(skipOC); if (this.mTier < rTier + cultureDNABioData.getTier()) return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 4; i < 8; i++) { - if (this.mInventory[i] != null) - this.mInventory[i].stackSize--; + for (int i = 0; i < 4; i++) { + if (this.mInventory[getInputSlot() + i] != null) + this.mInventory[getInputSlot() + i].stackSize--; } this.mFluid.amount -= 1000; @@ -127,12 +127,12 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } break; case PCR_THERMOCYCLE_MODULE: { - if (GT_Utility.isStackValid(this.mInventory[4]) && this.mInventory[4].getItem() instanceof LabParts && this.mInventory[4].getItemDamage() == 1 && this.mInventory[4].getTagCompound() != null && //checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[7]) && GT_Utility.areStacksEqual(this.mInventory[7], ItemList.Tool_DataOrb.get(1L)) && - GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], FluidLoader.BioLabFluidCells[0]) && - GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], FluidLoader.BioLabFluidCells[3]) && + if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && this.mInventory[getInputSlot()].getItem() instanceof LabParts && this.mInventory[getInputSlot()].getItemDamage() == 1 && this.mInventory[getInputSlot()].getTagCompound() != null && //checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], ItemList.Tool_DataOrb.get(1L)) && + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 1], FluidLoader.BioLabFluidCells[0]) && + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 2], FluidLoader.BioLabFluidCells[3]) && this.mFluid != null && this.mFluid.isFluidEqual(dnaFluid) && this.mFluid.amount >= 1000) { - NBTTagCompound DNABioDataTag = this.mInventory[4].getTagCompound(); + NBTTagCompound DNABioDataTag = this.mInventory[getInputSlot()].getTagCompound(); if (DNABioDataTag == null) return super.checkRecipe(skipOC); BioData cultureDNABioData = BioData.getBioDataFromName(DNABioDataTag.getString("Name")); @@ -142,9 +142,9 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 4; i < 8; i++) { - if (this.mInventory[i] != null) - this.mInventory[i].stackSize--; + for (int i = 0; i < 4; i++) { + if (this.mInventory[getInputSlot() + i] != null) + this.mInventory[getInputSlot() + i].stackSize--; } this.mFluid.amount -= 1000; @@ -171,20 +171,20 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); if ( - GT_Utility.isStackValid(this.mInventory[4]) && GT_Utility.areStacksEqual(FluidLoader.BioLabFluidCells[1], this.mInventory[4]) && //checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getPlasmidCell(null)) && - GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], ItemList.Tool_DataOrb.get(1L), true) && - Behaviour_DataOrb.getDataTitle(this.mInventory[6]).equals("DNA Sample") && (!(Behaviour_DataOrb.getDataName(this.mInventory[6]).isEmpty())) && - GT_Utility.isStackValid(this.mInventory[7]) && GT_Utility.areStacksEqual(this.mInventory[7], inp2) && + GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && GT_Utility.areStacksEqual(FluidLoader.BioLabFluidCells[1], this.mInventory[getInputSlot()]) && //checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 1], BioItemList.getPlasmidCell(null)) && + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 2], ItemList.Tool_DataOrb.get(1L), true) && + Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 2]).equals("DNA Sample") && (!(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2]).isEmpty())) && + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], inp2) && this.mFluid != null && this.mFluid.isFluidEqual(dnaFluid) && (this.mFluid.amount >= 1000)) { - BioData cultureDNABioData = BioData.getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[6])); + BioData cultureDNABioData = BioData.getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2])); if (cultureDNABioData == null) return super.checkRecipe(skipOC); if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 4; i < 6; i++) { - if (this.mInventory[i] != null) - this.mInventory[i].stackSize--; + for (int i = 0; i < 2; i++) { + if (this.mInventory[getInputSlot() + i] != null) + this.mInventory[getInputSlot() + i].stackSize--; } this.mFluid.amount -= 1000; if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { @@ -199,19 +199,19 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { break; case TRANSFORMATION_MODULE: { if ( - GT_Utility.isStackValid(this.mInventory[4]) && GT_Utility.areStacksEqual(this.mInventory[4], BioItemList.getPetriDish(null), true) && this.mInventory[4].getTagCompound() != null && - GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getPlasmidCell(null), true) && this.mInventory[5].getTagCompound() != null && - GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], FluidLoader.BioLabFluidCells[2]) && + GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot()], BioItemList.getPetriDish(null), true) && this.mInventory[getInputSlot()].getTagCompound() != null && + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 1], BioItemList.getPlasmidCell(null), true) && this.mInventory[getInputSlot() + 1].getTagCompound() != null && + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 2], FluidLoader.BioLabFluidCells[2]) && this.mFluid != null && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000) { - BioData cultureDNABioData = BioData.getBioDataFromNBTTag(this.mInventory[5].getTagCompound()); - BioCulture bioCulture = BioCulture.getBioCultureFromNBTTag(this.mInventory[4].getTagCompound()); + BioData cultureDNABioData = BioData.getBioDataFromNBTTag(this.mInventory[getInputSlot() + 1].getTagCompound()); + BioCulture bioCulture = BioCulture.getBioCultureFromNBTTag(this.mInventory[getInputSlot()].getTagCompound()); if (cultureDNABioData == null || bioCulture == null) return super.checkRecipe(skipOC); if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 4; i < 7; i++) { - if (this.mInventory[i] != null) - this.mInventory[i].stackSize--; + for (int i = 0; i < 3; i++) { + if (this.mInventory[getInputSlot() + i] != null) + this.mInventory[getInputSlot() + i].stackSize--; } this.mFluid.amount -= 1000; bioCulture = bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); @@ -230,20 +230,20 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); if ( - GT_Utility.isStackValid(this.mInventory[4]) && GT_Utility.areStacksEqual(this.mInventory[4], BioItemList.getPetriDish(null)) && - GT_Utility.isStackValid(this.mInventory[5]) && GT_Utility.areStacksEqual(this.mInventory[5], BioItemList.getOther(4)) && - GT_Utility.isStackValid(this.mInventory[6]) && GT_Utility.areStacksEqual(this.mInventory[6], ItemList.Circuit_Chip_Stemcell.get(2L)) && - GT_Utility.isStackValid(this.mInventory[7]) && GT_Utility.areStacksEqual(this.mInventory[7], ItemList.Tool_DataOrb.get(1L), true) && - Behaviour_DataOrb.getDataTitle(this.mInventory[7]).equals("DNA Sample") && this.mFluid.isFluidEqual(dnaFluid) && (this.mFluid.amount >= 8000)) { + GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot()], BioItemList.getPetriDish(null)) && + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 1], BioItemList.getOther(4)) && + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 2], ItemList.Circuit_Chip_Stemcell.get(2L)) && + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], ItemList.Tool_DataOrb.get(1L), true) && + Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 3]).equals("DNA Sample") && this.mFluid.isFluidEqual(dnaFluid) && (this.mFluid.amount >= 8000)) { - BioData cultureDNABioData = BioData.getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[7])); + BioData cultureDNABioData = BioData.getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 3])); if (cultureDNABioData == null) return super.checkRecipe(skipOC); if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 4; i < 7; i++) { - if (this.mInventory[i] != null) - this.mInventory[i].stackSize--; + for (int i = 0; i < 3; i++) { + if (this.mInventory[getInputSlot() + i] != null) + this.mInventory[getInputSlot() + i].stackSize--; } this.mFluid.amount -= 8000; if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { -- cgit From 6ebee72bbe887ea2c7d753347200ba8a38d16ea8 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Mon, 7 Mar 2022 14:06:27 +0800 Subject: fix balky nei handlers (#102) * fix balky nei handlers also cleaned up NEI plugin a bit. ore handler still looks dumb though. * add some comment to explain the magic numbers Former-commit-id: 8b96e8847c20e74a601f8fd06d68d79a4852952b --- .../bartworks/neiHandler/BW_NEI_BioLabHandler.java | 43 ++++-------- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 34 +++++++--- .../bartworks/neiHandler/BW_NEI_OreHandler.java | 1 - .../bartworks/neiHandler/NEI_BW_Config.java | 43 ++++++++++-- .../bartworks/neiHandler/NEIbartworksConfig.java | 79 ---------------------- 5 files changed, 73 insertions(+), 127 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEIbartworksConfig.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java index 0e17f16506..d1dac08766 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java @@ -32,12 +32,9 @@ import gregtech.api.util.GT_Recipe; import gregtech.nei.GT_NEI_DefaultHandler; import net.minecraft.item.ItemStack; -import java.awt.*; - public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { public BW_NEI_BioLabHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { super(aRecipeMap); - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier())); if (!NEI_BW_Config.sIsAdded) { FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); @@ -50,37 +47,23 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { } public void loadCraftingRecipes(ItemStack aResult) { - if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3) { - for (GT_Recipe recipe : this.getSortedRecipes()) { - if (aResult.getTagCompound() != null && recipe != null) - for (int i = 0; i < recipe.mOutputs.length; i++) { - if (recipe.mOutputs[i] != null) - if (aResult.getTagCompound().equals(recipe.mOutputs[i].getTagCompound())) { - this.arecipes.add(new CachedDefaultRecipe(recipe)); - break; - } - - } - } - } else + if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { + for (CachedDefaultRecipe recipe : getCache()) + if (NEI_BW_Config.checkRecipe(aResult, recipe.mOutputs)) + arecipes.add(recipe); + } else { super.loadCraftingRecipes(aResult); + } } @Override public void loadUsageRecipes(ItemStack aResult) { - if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3) { - for (GT_Recipe recipe : this.getSortedRecipes()) { - if (aResult.getTagCompound() != null && recipe != null) - for (int i = 0; i < recipe.mInputs.length; i++) { - if (recipe.mInputs[i] != null) - if (aResult.getTagCompound().equals(recipe.mInputs[i].getTagCompound())) { - this.arecipes.add(new CachedDefaultRecipe(recipe)); - break; - } - - } - } - } else - super.loadCraftingRecipes(aResult); + if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { + for (CachedDefaultRecipe recipe : getCache()) + if (NEI_BW_Config.checkRecipe(aResult, recipe.mInputs)) + arecipes.add(recipe); + } else { + super.loadUsageRecipes(aResult); + } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index 33ba6e874a..7890af3d54 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.neiHandler; +import codechicken.nei.PositionedStack; import codechicken.nei.recipe.GuiCraftingRecipe; import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; @@ -37,6 +38,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import java.awt.*; +import java.util.Collections; public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { @@ -107,23 +109,33 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { } + private void loadLabPartRecipes(ItemStack aResult) { + for (CachedDefaultRecipe recipe : getCache()) { + // dirty way of finding the special slot item + // see constructor of CachedDefaultRecipe on why relx==120 and rely==52 means special slot + for (PositionedStack stack : recipe.mInputs) { + if (stack.relx == 120 && stack.rely == 52) { + if (NEI_BW_Config.checkRecipe(aResult, Collections.singletonList(stack))) + arecipes.add(recipe); + } + } + } + } + @Override public void loadUsageRecipes(ItemStack aResult) { - if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3) - for (GT_Recipe recipe : this.getSortedRecipes()) { - if (aResult.getTagCompound() != null && recipe != null) - if (recipe.mSpecialItems instanceof ItemStack && ((ItemStack) recipe.mSpecialItems).getItem() instanceof LabParts) - if (aResult.getTagCompound().equals(((ItemStack) recipe.mSpecialItems).getTagCompound())) { - this.arecipes.add(new CachedDefaultRecipe(recipe)); - } - } - else - super.loadCraftingRecipes(aResult); + if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { + loadLabPartRecipes(aResult); + } else { + super.loadUsageRecipes(aResult); + } } @Override public void loadCraftingRecipes(ItemStack aResult) { - if (aResult == null || !(aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3)) { + if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { + loadLabPartRecipes(aResult); + } else { super.loadCraftingRecipes(aResult); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index c54667c431..8bb59713ae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -51,7 +51,6 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { if (!NEI_BW_Config.sIsAdded) { FMLInterModComms.sendRuntimeMessage(MainMod.MOD_ID, "NEIPlugins", "register-crafting-handler", MainMod.MOD_ID + "@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); -// GuiUsageRecipe.usagehandlers.add(this); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index c0f6ba3340..92779481bb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -22,24 +22,55 @@ package com.github.bartimaeusnek.bartworks.neiHandler; +import codechicken.nei.PositionedStack; import codechicken.nei.api.API; import codechicken.nei.api.IConfigureNEI; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; -import cpw.mods.fml.common.Optional; +import gregtech.api.enums.OrePrefixes; import net.minecraft.item.ItemStack; -@Optional.Interface(iface = "codechicken.nei.api.API", modid = "NotEnoughItems") public class NEI_BW_Config implements IConfigureNEI { - public static boolean sIsAdded = true; + static boolean sIsAdded = true; + static boolean checkRecipe(ItemStack labPart, Iterable stacks) { + for (PositionedStack stack : stacks) { + for (ItemStack item : stack.items) { + if (labPart.getTagCompound().equals(item.getTagCompound())) { + return true; + } + } + } + return false; + } + + @Override public void loadConfig() { API.hideItem(new ItemStack(ItemRegistry.TAB)); API.hideItem(new ItemStack(FluidLoader.bioFluidBlock)); API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses)); + ItemStack[] prefixesToHide = { + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustTiny, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustSmall, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushed, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedCentrifuged, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.nugget, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemChipped, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawed, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawless, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemExquisite, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustImpure, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustPure, WerkstoffLoader.Bismutite).copy(), + }; + for (ItemStack stack : prefixesToHide) { + stack.setItemDamage(Short.MAX_VALUE); + API.hideItem(stack); + } NEI_BW_Config.sIsAdded = false; new BW_NEI_OreHandler(); new BW_NEI_BioVatHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BACTERIALVATBYTE)); @@ -47,13 +78,13 @@ public class NEI_BW_Config implements IConfigureNEI { NEI_BW_Config.sIsAdded = true; } - @Optional.Method(modid = "NotEnoughItems") + @Override public String getName() { return "BartWorks NEI Plugin"; } - @Optional.Method(modid = "NotEnoughItems") + @Override public String getVersion() { return MainMod.APIVERSION; } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEIbartworksConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEIbartworksConfig.java deleted file mode 100644 index f05a35cdb9..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEIbartworksConfig.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.neiHandler; - -import codechicken.nei.api.API; -import codechicken.nei.api.IConfigureNEI; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import cpw.mods.fml.common.Optional; -import gregtech.api.enums.OrePrefixes; -import net.minecraft.item.ItemStack; - - -@Optional.Interface(iface = "codechicken.nei.api.API", modid = "NotEnoughItems") -public class NEIbartworksConfig implements IConfigureNEI { - - @Optional.Method(modid = "NotEnoughItems") - @Override - public String getName() { - return MainMod.NAME; - } - - @Optional.Method(modid = "NotEnoughItems") - @Override - public String getVersion() { - return MainMod.VERSION; - } - - @Optional.Method(modid = "NotEnoughItems") - @Override - public void loadConfig() { - API.hideItem(new ItemStack(ItemRegistry.TAB)); - API.hideItem(new ItemStack(FluidLoader.bioFluidBlock)); - API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses)); - ItemStack[] prefixesToHide = { - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustTiny, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustSmall, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushed, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedCentrifuged, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.nugget, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemChipped, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawed, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawless, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemExquisite, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustImpure, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustPure, WerkstoffLoader.Bismutite).copy(), - }; - for (ItemStack stack : prefixesToHide) { - stack.setItemDamage(Short.MAX_VALUE); - API.hideItem(stack); - } -// for (int i = 0; i < Short.MAX_VALUE; i++) { -// API.addItemListEntry(new ItemStack(WerkstoffLoader.BWOres,1,i)); -// } - } -} \ No newline at end of file -- cgit From b287defc65deaf49d9bbd81a5e5363002ded5012 Mon Sep 17 00:00:00 2001 From: Elisis Date: Wed, 9 Mar 2022 16:23:34 +1100 Subject: Fix bizarrely OP Ross Lava gen (#104) Now it's 1/40 what it used to be Former-commit-id: 6100cf5c61ed68db3f51fd2694098001466199df --- .../bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index 87b1abdd4e..9e1673dc83 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -70,7 +70,7 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { public static void initundergroundFluids() { String ross128b = StatCollector.translateToLocal("planet.Ross128b"); uo_dimensionList.SetConfigValues(ross128b, ross128b, "veryheavyoil", "liquid_extra_heavy_oil", 0, 625, 40, 5); - uo_dimensionList.SetConfigValues(ross128b, ross128b, "lava", FluidRegistry.getFluidName(FluidRegistry.LAVA), 0, 32767, 5, 5); + uo_dimensionList.SetConfigValues(ross128b, ross128b, "lava", FluidRegistry.getFluidName(FluidRegistry.LAVA), 0, 820, 5, 5); uo_dimensionList.SetConfigValues(ross128b, ross128b, "gas_natural_gas", "gas_natural_gas", 0, 625, 65, 5); } -- cgit From 3a35d97cc7b21bc972071b166217dd82c37761f2 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Sat, 12 Mar 2022 17:36:37 +0800 Subject: artificial mica line (#105) * new artifical mica line * fix * the same radio from NaAlO2 * remove direct al2o3 recipe * remove the same recipe * comment dismatch Former-commit-id: b625dcc2a54eefc60ef656861cdecb83ec28970c --- .../github/bartimaeusnek/bartworks/MainMod.java | 2 +- .../common/loaders/ArtificialMicaLine.java | 50 ++++++++++++++++ .../system/material/BW_GT_MaterialReference.java | 11 ++-- .../bartworks/system/material/WerkstoffLoader.java | 70 ++++++++++++++++++++++ 4 files changed, 127 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 94c91ccb94..3404faf290 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -162,7 +162,7 @@ public final class MainMod { GT_OreDictUnificator.registerOre("blockGlass" + VN[pair.getValue()], new ItemStack(pair.getKey().getBlock(), 1, pair.getKey().getaByte())); } } - + ArtificialMicaLine.runArtificialMicaRecipe(); BioObjectAdder.regenerateBioFluids(); if (ConfigHandler.newStuff) { WerkstoffLoader.run(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java new file mode 100644 index 0000000000..0063abf7c1 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java @@ -0,0 +1,50 @@ +package com.github.bartimaeusnek.bartworks.common.loaders; + +import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.system.material.BW_GT_MaterialReference; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +public class ArtificialMicaLine { + + public static void runArtificialMicaRecipe() { + //Mg + O = 2MgO + GT_Values.RA.addChemicalRecipe(Materials.Magnesium.getDust(1), null, Materials.Oxygen.getGas(1000), null, Materials.Magnesia.getDust(2), 40, 8); + //Si + 6HF = 7H2SiF6 + GT_Values.RA.addChemicalRecipe(Materials.Silicon.getDust(1), null, Materials.HydrofluoricAcid.getFluid(6000), WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(7000), null, 400, 120); + //K + Cl = 2KCl + GT_Values.RA.addChemicalRecipe(Materials.Potassium.getDust(1), GT_Utility.getIntegratedCircuit(2), Materials.Chlorine.getGas(1000), null, Materials.RockSalt.getDust(2), 20, 8); + //2KCl + H2SiF6 = 2HCl + K2SiF6 + GT_Values.RA.addMixerRecipe(Materials.RockSalt.getDust(2), null, null, null, WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000), Materials.HydrochloricAcid.getGas(2000), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 1), 20, 8); + //2K + CO2 + O = 6K2CO3 + GT_Values.RA.addChemicalRecipe(Materials.Potassium.getDust(2), Materials.CarbonDioxide.getCells(1), Materials.Oxygen.getGas(1000), null, WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), 40, 8); + //K2O + CO2 = 6K2CO3 + GT_Values.RA.addChemicalRecipe(Materials.Potash.getDust(1), Materials.CarbonDioxide.getCells(1), null, null, WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), 40, 8); + //55Quartz Dust + 20K2SiF6 + 12Al2O3 + 4K2CO3 = 91Raw Fluorophlogopite Dust + GT_Values.RA.addMixerRecipe(Materials.QuartzSand.getDust(55), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), null, null, 400, 120); + //55Quartzite/Nether Quartz Dust + 20K2SiF6 + 12Al2O3 + 4K2CO3 = 136Raw Fluorophlogopite Dust + GT_Values.RA.addMixerRecipe(Materials.Quartzite.getDust(55), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8), null, 600, 120); + GT_Values.RA.addMixerRecipe(Materials.NetherQuartz.getDust(55), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8), null, 600, 120); + //62Certus Quartz Dust + 10K2SiF6 + 12Al2O3 + 4K2CO3 = 91Raw Fluorophlogopite Dust + GT_Values.RA.addMixerRecipe(Materials.CertusQuartz.getDust(62), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 10), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), null, null, 600, 120); + //MgO(s) = MgO(l) + GT_Values.RA.addFluidExtractionRecipe(Materials.Magnesia.getDust(1), null, Materials.Magnesia.getMolten(144), 0, 20, 120); + //27Raw Fluorophlogopite Dust + 432MgO(l) = 4608Fluorophlogopite(l) + GT_Values.RA.addBlastRecipe(WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), null, BW_GT_MaterialReference.Magnesia.getMolten(432), WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(4608), Materials.Glass.getDust(1), null, 600, 480, 1700); + //144Fluorophlogopite(l) = Fluorophlogopite + GT_Recipe.GT_Recipe_Map.sVacuumRecipes.addRecipe(new GT_Recipe(false, new ItemStack[]{ItemList.Shape_Mold_Plate.get(0)}, new ItemStack[]{WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1)}, null, null, new FluidStack[]{WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(144)}, null, 10, 120, 0)); + //Fluorophlogopite = 4Insulator Foil + if (LoaderReference.dreamcraft) + GT_Values.RA.addBenderRecipe(WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1), GT_Utility.getIntegratedCircuit(1), GT_ModHandler.getModItem("dreamcraft", "item.MicaInsulatorFoil", 4), 10, 600); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java index 6d1463bdfd..2d77a0efc8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java @@ -146,13 +146,14 @@ public class BW_GT_MaterialReference { public static Werkstoff Polytetrafluoroethylene = new Werkstoff(Materials.Polytetrafluoroethylene, ADD_CASINGS_ONLY, COMPOUND,31_766+473); public static Werkstoff Plastic = new Werkstoff(Materials.Plastic, ADD_CASINGS_ONLY, COMPOUND,31_766+874); public static Werkstoff Epoxid = new Werkstoff(Materials.Epoxid, ADD_CASINGS_ONLY, COMPOUND,31_766+470); - + public static Werkstoff Magnesia = new Werkstoff(Materials.Magnesia, new Werkstoff.GenerationFeatures().disable().addMetalItems().addMolten(), COMPOUND,31_766+471); + public static void init() { MainMod.LOGGER.info("Load Elements from GT"); } // TODO: GT++ only? - + // public static Werkstoff Flerovium = new Werkstoff(Materials.Flerovium, , ,31_766+984); // public static Werkstoff HeeEndium = new Werkstoff(Materials.HeeEndium, , ,31_766+770); @@ -346,7 +347,7 @@ public class BW_GT_MaterialReference { // public static Werkstoff Obsidian = new Werkstoff(Materials.Obsidian, , ,31_766+804); // public static Werkstoff Phosphate = new Werkstoff(Materials.Phosphate, , ,31_766+833); // public static Werkstoff PigIron = new Werkstoff(Materials.PigIron, , ,31_766+307); - + // public static Polydimethylsiloxane = new MaterialBuilder // public static Werkstoff Silicone = new Werkstoff(Materials.Silicone, , ,31_766+471); // public static Werkstoff Polycaprolactam = new Werkstoff(Materials.Polycaprolactam, , ,31_766+472); @@ -517,7 +518,7 @@ public class BW_GT_MaterialReference { // public static Werkstoff Manyullyn = new Werkstoff(Materials.Manyullyn, , ,31_766+386); // public static Werkstoff Steeleaf = new Werkstoff(Materials.Steeleaf, , ,31_766+339); // public static Werkstoff Knightmetal = new Werkstoff(Materials.Knightmetal, , ,31_766+362); - + // public static Werkstoff NitroFuel = new Werkstoff(Materials.NitroFuel, , ,31_766+709); // public static Werkstoff RedAlloy = new Werkstoff(Materials.RedAlloy, , ,31_766+308); // public static Werkstoff CobaltBrass = new Werkstoff(Materials.CobaltBrass, , ,31_766+343); @@ -641,4 +642,4 @@ public class BW_GT_MaterialReference { // public static Werkstoff Tetranaquadahdiindiumhexaplatiumosminid = new Werkstoff(Materials.Tetranaquadahdiindiumhexaplatiumosminid, , , 31_766 + 992); // public static Werkstoff Longasssuperconductornameforuvwire = new Werkstoff(Materials.Longasssuperconductornameforuvwire, , , 31_766 + 986); // public static Werkstoff Longasssuperconductornameforuhvwire = new Werkstoff(Materials.Longasssuperconductornameforuhvwire, , , 31_766 + 985); -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 1f2f53f18f..c004668c33 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1407,6 +1407,76 @@ public class WerkstoffLoader { new Pair<>(Materials.VanadiumSteel, 1), new Pair<>(Materials.DamascusSteel, 1) ); + public static final Werkstoff HexafluorosilicicAcid = new Werkstoff( + new short[]{0x2c, 0x70, 0xb5}, + "Hexafluorosilicic Acid", + subscriptNumbers("H2SiF6"), + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + 98, + TextureSet.SET_FLUID + ); + public static final Werkstoff Potassiumfluorosilicate = new Werkstoff( + new short[]{0x2e, 0x97, 0xb2}, + "Potassiumfluorosilicate", + subscriptNumbers("K2SiF6"), + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 99, + TextureSet.SET_SHINY + ); + public static final Werkstoff Alumina = new Werkstoff( + new short[]{0xa0, 0xad, 0xb1}, + "Alumina", + subscriptNumbers("Al2O3"), + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 100, + TextureSet.SET_DULL + ); + public static final Werkstoff PotassiumCarbonate = new Werkstoff( + new short[]{0x7b, 0x96, 0x4f}, + "Potassium Carbonate", + subscriptNumbers("K2CO3"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 101, + TextureSet.SET_DULL, + new Pair<>(Materials.Potassium, 2), + new Pair<>(Materials.Carbon, 1), + new Pair<>(Materials.Oxygen, 3) + ); + public static final Werkstoff RawFluorophlogopite = new Werkstoff( + new short[]{0x36, 0x51, 0x0b}, + "Raw Fluorophlogopite", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 102, + TextureSet.SET_DULL + ); + public static final Werkstoff HotFluorophlogopite = new Werkstoff( + new short[]{0xbf, 0xd3, 0x55}, + "Unformed Fluorophlogopite", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 103, + TextureSet.SET_FLUID + ); + public static final Werkstoff Fluorophlogopite = new Werkstoff( + new short[]{0xbf, 0xd3, 0x55}, + "Fluorophlogopite", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems(), + 104, + TextureSet.SET_SHINY + ); public static HashMap items = new HashMap<>(); public static HashBiMap fluids = HashBiMap.create(); -- cgit From c669b6951c430fbefa6896b8305740fb6f89876c Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Sat, 12 Mar 2022 21:45:17 +0100 Subject: Fix wrong overclock (#106) Former-commit-id: 9e8828174d999951ae8ad6eff5d78562eadc00fa --- .../mega/GT_TileEntity_MegaChemicalReactor.java | 6 +++--- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 6 +++--- .../bartimaeusnek/bartworks/util/BW_Util.java | 22 +++++++++++++--------- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index d7878a7973..948bb04148 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -94,7 +94,7 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeCh .addInputBus("Hint block ",1) .addOutputBus("Hint block ",1) .addOutputHatch("Hint block ",1) - .toolTipFinisher(BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); + .toolTipFinisher("Bartworks"); return tt; } @@ -165,9 +165,9 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeCh actualEUT = actualEUT / 2; divider++; } - calculatePerfectOverclockedNessMulti((int) actualEUT, tRecipe.mDuration * (divider * 2), 1, nominalV); + BW_Util.calculatePerfectOverclockedNessMulti((int) actualEUT, tRecipe.mDuration * (divider * 2), 1, nominalV, this); } else { - calculatePerfectOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, nominalV); + BW_Util.calculatePerfectOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, nominalV, this); } //In case recipe is too OP for that machine if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index ffe6d46ade..4a7ac80aa8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -97,7 +97,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i .addInputHatch("Hint block",2,3) .addOutputHatch("Hint block",2,3) .addInputHatch("Steam/Hydrogen ONLY, Hint block",4) - .toolTipFinisher(BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); + .toolTipFinisher("Bartworks"); return tt; } @@ -180,9 +180,9 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i actualEUT = actualEUT / 2; divider++; } - calculatePerfectOverclockedNessMulti((int) actualEUT, tRecipe.mDuration * (divider * 2), 1, nominalV); + BW_Util.calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration * (divider * 2), 1, nominalV, this); } else { - calculatePerfectOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, nominalV); + BW_Util.calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, nominalV, this); } //In case recipe is too OP for that machine if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 39cf609c14..4260eb802f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -370,10 +370,14 @@ public class BW_Util { * @param mAmperage - should be 1 ? */ public static void calculateOverclockedNessMulti(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, @Nonnull GT_MetaTileEntity_MultiBlockBase base) { - calculateOverclockednessMultiInternal(aEUt, aDuration, mAmperage, maxInputVoltage, base, 2); + calculateOverclockednessMultiInternal(aEUt, aDuration, mAmperage, maxInputVoltage, base, false); } - private static void calculateOverclockednessMultiInternal(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, @Nonnull GT_MetaTileEntity_MultiBlockBase base, @Nonnegative int modifier){ + public static void calculatePerfectOverclockedNessMulti(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, @Nonnull GT_MetaTileEntity_MultiBlockBase base) { + calculateOverclockednessMultiInternal(aEUt, aDuration, mAmperage, maxInputVoltage, base, true); + } + + private static void calculateOverclockednessMultiInternal(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, @Nonnull GT_MetaTileEntity_MultiBlockBase base, @Nonnull boolean perfectOC){ byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); if (mTier == 0) { //Long time calculation @@ -383,7 +387,7 @@ public class BW_Util { base.mEUt = Integer.MAX_VALUE - 1; base.mMaxProgresstime = Integer.MAX_VALUE - 1; } else { - base.mEUt = aEUt >> modifier; + base.mEUt = aEUt >> 2; base.mMaxProgresstime = (int) xMaxProgresstime; } } else { @@ -395,21 +399,21 @@ public class BW_Util { base.mMaxProgresstime = aDuration; while (tempEUt <= V[mTier - 1] * mAmperage) { - tempEUt <<= modifier;//this actually controls overclocking + tempEUt <<= 2;//this actually controls overclocking //xEUt *= 4;//this is effect of everclocking - base.mMaxProgresstime >>= 1;//this is effect of overclocking + base.mMaxProgresstime >>= perfectOC ? 2 : 1;//this is effect of overclocking xEUt = base.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power } while (xEUt > maxInputVoltage && xEUt >= aEUt){ //downclock one notch until we are good again, we have overshot. - xEUt >>= modifier; - base.mMaxProgresstime <<= 1; + xEUt >>= 2; + base.mMaxProgresstime <<= perfectOC ? 2 : 1; } if (xEUt < aEUt){ - xEUt <<= modifier; - base.mMaxProgresstime >>= 1; + xEUt <<= 2; + base.mMaxProgresstime >>= perfectOC ? 2 : 1; } if (xEUt > Integer.MAX_VALUE - 1) { -- cgit From ada57aa08f5f233c0923a7290747c7f63d331587 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Fri, 18 Mar 2022 06:58:27 +0100 Subject: Allow all mega's to use more than MAX voltage (#107) * Allow all mega's to use more than MAX voltage * Update slots earlier * Allow laser hatches only if there is no other type Former-commit-id: aa23a6d5d6f4ae2de6decfc31fd9b6d44f97d908 --- .../mega/GT_TileEntity_MegaBlastFurnace.java | 302 ++++++++------------- .../mega/GT_TileEntity_MegaChemicalReactor.java | 121 +++------ .../mega/GT_TileEntity_MegaDistillTower.java | 135 ++++----- .../mega/GT_TileEntity_MegaMultiBlockBase.java | 296 ++++++++++++++++++++ .../multis/mega/GT_TileEntity_MegaOilCracker.java | 198 ++++++-------- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 157 +++-------- .../bartimaeusnek/bartworks/util/BW_Util.java | 29 +- .../crossmod/tectech/helper/TecTechUtils.java | 59 +++- 8 files changed, 704 insertions(+), 593 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 21be004770..292bf8e699 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -27,33 +27,28 @@ import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.MegaUtils; import com.github.bartimaeusnek.bartworks.util.Pair; -import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; -import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.LowPowerLaser; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; import gregtech.api.enums.HeatingCoilLevel; +import gregtech.api.enums.Materials; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.metatileentity.implementations.*; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; import java.util.*; @@ -61,21 +56,21 @@ import java.util.stream.Collectors; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAdder; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBlastFurnace implements TecTechEnabledMulti { +public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlockBase { private static final int CASING_INDEX = 11; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() .addShape("main", createShape()) .addElement('t', ofHatchAdderOptional(GT_TileEntity_MegaBlastFurnace::addOutputHatchToTopList, CASING_INDEX, 1, GregTech_API.sBlockCasings1, CASING_INDEX)) .addElement('m', ofHatchAdder(GT_TileEntity_MegaBlastFurnace::addMufflerToMachineList, CASING_INDEX, 2)) - .addElement('C', ofCoil(GT_TileEntity_MegaBlastFurnace::setCoilLevel, GT_MetaTileEntity_ElectricBlastFurnace::getCoilLevel)) + .addElement('C', ofCoil(GT_TileEntity_MegaBlastFurnace::setCoilLevel, GT_TileEntity_MegaBlastFurnace::getCoilLevel)) .addElement('g', BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) .addElement('b', ofHatchAdderOptional(GT_TileEntity_MegaBlastFurnace::addBottomHatch, CASING_INDEX, 3, GregTech_API.sBlockCasings1, CASING_INDEX)) .build(); @@ -118,9 +113,14 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return transpose(raw); } + private HeatingCoilLevel mCoilLevel; + protected final ArrayList mPollutionOutputHatches = new ArrayList<>(); + protected final FluidStack[] pollutionFluidStacks = {Materials.CarbonDioxide.getGas(1000), + Materials.CarbonMonoxide.getGas(1000), Materials.SulfurDioxide.getGas(1000)}; private int mHeatingCapacity; private byte glasTier; private int polPtick = ConfigHandler.basePollutionMBFSecond / 20 * ConfigHandler.megaMachinesMax; + private int mufflerTier = -1; public GT_TileEntity_MegaBlastFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -130,6 +130,11 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl super(aName); } + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_MegaBlastFurnace(this.mName); + } + @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); @@ -162,45 +167,14 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return tt; } - public ArrayList TTTunnels = new ArrayList<>(); - public ArrayList TTMultiAmp = new ArrayList<>(); - @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); this.circuitMode = aNBT.getByte("circuitMode"); this.glasTier = aNBT.getByte("glasTier"); - this.lEUt = aNBT.getLong("lEUt"); - } - - @Override - public boolean onRunningTick(ItemStack aStack) { - if (this.lEUt > 0) { - this.addEnergyOutput(this.lEUt * (long)this.mEfficiency / 10000L); - return true; - } else if (this.lEUt < 0 && !this.drainEnergyInput((-this.lEUt) * 10000L / (long)Math.max(1000, this.mEfficiency))) { - this.stopMachine(); - return false; - } else { - return true; - } - } - - - @Override - public void stopMachine() { - this.mOutputItems = null; - this.mEUt = 0; - this.lEUt = 0; - this.mEfficiency = 0; - this.mProgresstime = 0; - this.mMaxProgresstime = 0; - this.mEfficiencyIncrease = 0; - this.getBaseMetaTileEntity().disableWorking(); } private byte circuitMode = 0; - private long lEUt = 0; @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { @@ -217,143 +191,66 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl GT_Utility.sendChatToPlayer(aPlayer, circuitMode > 0 ? "MEBF will prioritise circuit: " + circuitMode : "Circuit prioritisation disabled."); } + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + if (aActive) + return new ITexture[]{ + casingTexturePages[0][CASING_INDEX], + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).extFacing().glow().build()}; + return new ITexture[]{ + casingTexturePages[0][CASING_INDEX], + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW).extFacing().glow().build()}; + } + return new ITexture[]{casingTexturePages[0][CASING_INDEX]}; + } + @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); aNBT.setByte("glasTier", glasTier); aNBT.setByte("circuitMode", circuitMode); - aNBT.setLong("lEUt", lEUt); - } - - @Override - public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (LoaderReference.tectech) - return TecTechUtils.addEnergyInputToMachineList(this, aTileEntity, aBaseCasingIndex); - return super.addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); - } - - /** - * Taken from the GTNH fork, made originally by Tec - * Calcualtes overclocked ness using long integers - * - * @param aEUt - recipe EUt - * @param aDuration - recipe Duration - */ - protected byte calculateOverclockednessEBF(long aEUt, int aDuration, long maxInputVoltage) { - byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)), timesOverclocked = 0; - if (mTier == 0) { - //Long time calculation - long xMaxProgresstime = ((long) aDuration) << 1; - if (xMaxProgresstime > Integer.MAX_VALUE - 1) { - //make impossible if too long - this.lEUt = Integer.MAX_VALUE - 1; - this.mMaxProgresstime = Integer.MAX_VALUE - 1; - } else { - this.lEUt = (int) (aEUt >> 2); - this.mMaxProgresstime = (int) xMaxProgresstime; - } - //return 0; - } else { - //Long EUt calculation - long xEUt = aEUt; - //Isnt too low EUt check? - long tempEUt = Math.max(xEUt, V[1]); - - this.mMaxProgresstime = aDuration; - while (tempEUt <= V[mTier - 1]) { - tempEUt <<= 2;//this actually controls overclocking - //xEUt *= 4;//this is effect of everclocking - this.mMaxProgresstime >>= 1;//this is effect of overclocking - xEUt = this.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power - timesOverclocked++; - } - if (xEUt > maxInputVoltage) { - //downclock one notch, we have overshot. - xEUt >>=2; - this.mMaxProgresstime <<= 1; - timesOverclocked--; - } - if (xEUt > Integer.MAX_VALUE - 1) { - this.lEUt = Integer.MAX_VALUE - 1; - this.mMaxProgresstime = Integer.MAX_VALUE - 1; - } else { - this.lEUt = (int) xEUt; - if (this.lEUt == 0) - this.lEUt = 1; - if (this.mMaxProgresstime <= 0) - this.mMaxProgresstime = 1;//set time to 1 tick - } - } - return timesOverclocked; } @Override - public String[] getInfoData() { - int mPollutionReduction = 0; - - for (GT_MetaTileEntity_Hatch_Muffler e : this.mMufflerHatches) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(e)) - mPollutionReduction = Math.max(e.calculatePollutionReduction(this.mPollution), mPollutionReduction); - - long storedEnergy = 0L; - long maxEnergy = 0L; - - if (LoaderReference.tectech) { - long[] info = getCurrentInfoData(); - storedEnergy = info[0]; - maxEnergy = info[1]; + public boolean addMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if(super.addMufflerToMachineList(aTileEntity, aBaseCasingIndex)) + { + if(mufflerTier == -1) + mufflerTier = this.mMufflerHatches.get(this.mMufflerHatches.size() - 1).mTier; + return mufflerTier == this.mMufflerHatches.get(this.mMufflerHatches.size() - 1).mTier; } - - for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); - } - } - - return new String[]{ - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", - StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + - EnumChatFormatting.RED + GT_Utility.formatNumbers(-this.lEUt) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getMaxInputVoltage()) + EnumChatFormatting.RESET + " EU/t(*2A) " + - StatCollector.translateToLocal("GT5U.machines.tier") + ": " + - EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(this.getMaxInputVoltage())] + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + - EnumChatFormatting.RED + (this.getIdealStatus() - this.getRepairStatus()) + EnumChatFormatting.RESET + " " + - StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + - EnumChatFormatting.YELLOW + (float) this.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + - EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %"}; + return false; } @Override - public boolean drainEnergyInput(long aEU) { - if (LoaderReference.tectech) - return TecTechUtils.drainEnergyMEBFTecTech(this, aEU); - return MegaUtils.drainEnergyMegaVanilla(this, aEU); + public int getPollutionPerTick(ItemStack aStack) { + return this.polPtick; } - @Override - public long getMaxInputVoltage() { - if (LoaderReference.tectech) - return TecTechUtils.getMaxInputVoltage(this); - return super.getMaxInputVoltage(); + public boolean addOutputHatchToTopList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) return false; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return mPollutionOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + } + return false; } - @Override - public int getPollutionPerTick(ItemStack aStack) { - return this.polPtick; + protected boolean addBottomHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + return addMaintenanceToMachineList(aTileEntity, aBaseCasingIndex) || + addInputToMachineList(aTileEntity, aBaseCasingIndex) || + addOutputToMachineList(aTileEntity, aBaseCasingIndex) || + addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); } @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_TileEntity_MegaBlastFurnace(this.mName); + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png"); } @Override @@ -394,6 +291,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl if (this.mHeatingCapacity >= tRecipe.mSpecialValue) { int tCurrentPara = handleParallelRecipe(tRecipe, tFluids, tInputs, (int) tMaxPara); + this.updateSlots(); if (tCurrentPara <= 0) return false; processed = tCurrentPara; found_Recipe = true; @@ -407,7 +305,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl this.mEfficiencyIncrease = 10000; long actualEUT = precutRecipeVoltage * processed; - byte overclockCount = this.calculateOverclockednessEBF(actualEUT, tRecipe.mDuration, nominalV); + byte overclockCount = this.calculateOverclockedNessMultiInternal(actualEUT, tRecipe.mDuration, nominalV, false); //In case recipe is too OP for that machine if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) @@ -429,7 +327,6 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl this.mOutputItems = outputItems.toArray(this.mOutputItems); this.mOutputFluids = new FluidStack[outputFluids.size()]; this.mOutputFluids = outputFluids.toArray(this.mOutputFluids); - this.updateSlots(); return true; } return false; @@ -441,10 +338,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl } @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public IStructureDefinition getStructureDefinition() { - // hack to get around generic - return (IStructureDefinition) STRUCTURE_DEFINITION; + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; } @Override @@ -452,6 +347,46 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl buildPiece("main", stackSize, hintsOnly, 7, 17, 0); } + public void setCoilLevel(HeatingCoilLevel aCoilLevel) { + mCoilLevel = aCoilLevel; + } + + public HeatingCoilLevel getCoilLevel() { + return mCoilLevel; + } + + @Override + public boolean addOutput(FluidStack aLiquid) { + if (aLiquid == null) + return false; + FluidStack tLiquid = aLiquid.copy(); + boolean isOutputPollution = false; + for (FluidStack pollutionFluidStack : pollutionFluidStacks) { + if (!tLiquid.isFluidEqual(pollutionFluidStack)) + continue; + + isOutputPollution = true; + break; + } + ArrayList tOutputHatches; + if (isOutputPollution) { + tOutputHatches = this.mPollutionOutputHatches; + int pollutionReduction = 0; + for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { + if (!isValidMetaTileEntity(tHatch)) + continue; + pollutionReduction = 100 - tHatch.calculatePollutionReduction(100); + break; + } + tLiquid.amount = tLiquid.amount * (pollutionReduction + 5) / 100; + } else { + tOutputHatches = this.mOutputHatches; + } + return dumpFluid(tOutputHatches, tLiquid, true) || + dumpFluid(tOutputHatches, tLiquid, false); + } + + @Override public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { if (LoaderReference.tectech) { @@ -461,6 +396,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl this.mHeatingCapacity = 0; glasTier = 0; + mufflerTier = -1; setCoilLevel(HeatingCoilLevel.None); @@ -499,34 +435,10 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return false; } - @SuppressWarnings("rawtypes") - @Optional.Method(modid = "tectech") - private boolean areLazorsLowPowa() { - Collection collection = this.getTecTechEnergyTunnels(); - if (!collection.isEmpty()) - for (Object tecTechEnergyMulti : collection) - if (!(tecTechEnergyMulti instanceof LowPowerLaser)) - return false; - return true; - } - @Override - @Optional.Method(modid = "tectech") - public List getVanillaEnergyHatches() { - return this.mEnergyHatches; + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sBlastRecipes; } - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - @Optional.Method(modid = "tectech") - public List getTecTechEnergyTunnels() { - return TTTunnels; - } - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - @Optional.Method(modid = "tectech") - public List getTecTechEnergyMultis() { - return TTMultiAmp; - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index 948bb04148..0b5f02632a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -25,31 +25,29 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.MegaUtils; import com.github.bartimaeusnek.bartworks.util.Pair; -import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; -import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.LowPowerLaser; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeChemicalReactor; +import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.Collection; -import java.util.List; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; @@ -57,13 +55,12 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeChemicalReactor implements TecTechEnabledMulti { - private final ArrayList TTTunnels = new ArrayList<>(); - private final ArrayList TTMultiAmp = new ArrayList<>(); +public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBlockBase { private byte glasTier; @@ -104,28 +101,30 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeCh } @Override - public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (LoaderReference.tectech) { - return TecTechUtils.addEnergyInputToMachineList(this, aTileEntity, aBaseCasingIndex); + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, + boolean aRedstone) { + if (aSide == aFacing) { + if (aActive) return new ITexture[]{ + casingTexturePages[1][48], + TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW).extFacing().glow().build()}; + return new ITexture[]{ + casingTexturePages[1][48], + TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW).extFacing().glow().build()}; } - return super.addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); + return new ITexture[]{casingTexturePages[1][48]}; } @Override - public boolean drainEnergyInput(long aEU) { - if (LoaderReference.tectech) { - return TecTechUtils.drainEnergyMEBFTecTech(this, aEU); - } - return MegaUtils.drainEnergyMegaVanilla(this, aEU); + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeChemicalReactor.png"); } @Override - public long getMaxInputVoltage() { - if (LoaderReference.tectech) { - return TecTechUtils.getMaxInputVoltage(this); - } - return super.getMaxInputVoltage(); - } + public boolean supportsSingleRecipeLocking() { + return false; + } // TO IMPLEMENT @Override public boolean checkRecipe(ItemStack itemStack) { @@ -146,6 +145,7 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeCh found_Recipe = true; long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); + this.updateSlots(); if (tCurrentPara <= 0) { return false; } @@ -158,30 +158,20 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeCh if (found_Recipe) { this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - long actualEUT = (long) (tRecipe.mEUt) * processed; - if (actualEUT > Integer.MAX_VALUE) { - byte divider = 0; - while (actualEUT > Integer.MAX_VALUE) { - actualEUT = actualEUT / 2; - divider++; - } - BW_Util.calculatePerfectOverclockedNessMulti((int) actualEUT, tRecipe.mDuration * (divider * 2), 1, nominalV, this); - } else { - BW_Util.calculatePerfectOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, nominalV, this); - } + long actualEUT = ((long)tRecipe.mEUt) * processed; + calculatePerfectOverclockedNessMulti(actualEUT, tRecipe.mDuration, nominalV); //In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) { + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) { return false; } - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); + if (this.lEUt > 0) { + this.lEUt = (-this.lEUt); } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = new ItemStack[outputItems.size()]; this.mOutputItems = outputItems.toArray(this.mOutputItems); this.mOutputFluids = new FluidStack[outputFluids.size()]; this.mOutputFluids = outputFluids.toArray(this.mOutputFluids); - this.updateSlots(); return true; } return false; @@ -222,26 +212,6 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeCh } - @SuppressWarnings("rawtypes") - @Optional.Method(modid = "tectech") - private boolean areThingsNotProperlyTiered(Collection collection) { - if (!collection.isEmpty()) - for (Object tecTechEnergyMulti : collection) - if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) - return true; - return false; - } - - @SuppressWarnings("rawtypes") - @Optional.Method(modid = "tectech") - private boolean areLazorsLowPowa() { - Collection collection = this.getTecTechEnergyTunnels(); - if (!collection.isEmpty()) - for (Object tecTechEnergyMulti : collection) - if (!(tecTechEnergyMulti instanceof LowPowerLaser)) - return false; - return true; - } private static final int CASING_INDEX = 176; private static final String STRUCTURE_PIECE_MAIN = "main"; @@ -267,34 +237,19 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_MetaTileEntity_LargeCh .build(); - @SuppressWarnings({"unchecked", "rawtypes"}) @Override - public IStructureDefinition getStructureDefinition() { - return (IStructureDefinition) STRUCTURE_DEFINITION; - } - - @Override - public String[] getInfoData() { - return LoaderReference.tectech ? this.getInfoDataArray(this) : super.getInfoData(); - } - - @Override - @Optional.Method(modid = "tectech") - public List getVanillaEnergyHatches() { - return this.mEnergyHatches; + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; } - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings("rawtypes") @Optional.Method(modid = "tectech") - public List getTecTechEnergyTunnels() { - return TTTunnels; + private boolean areThingsNotProperlyTiered(Collection collection) { + if (!collection.isEmpty()) + for (Object tecTechEnergyMulti : collection) + if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) + return true; + return false; } - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - @Optional.Method(modid = "tectech") - public List getTecTechEnergyMultis() { - return TTMultiAmp; - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index cb3f7a77ad..3d56b3fd3b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -25,7 +25,6 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.*; -import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -34,13 +33,17 @@ import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DistillationTower; +import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; @@ -53,10 +56,15 @@ import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.ge import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_DistillationTower implements TecTechEnabledMulti{ +public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlockBase { + protected static final int CASING_INDEX = 49; + protected static final String STRUCTURE_PIECE_BASE = "base"; + protected static final String STRUCTURE_PIECE_LAYER = "layer"; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][]{ {"bbbbbbb~bbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb"}, @@ -135,13 +143,13 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati } ) .build(); + protected final List> mOutputHatchesByLayer = new ArrayList<>(); + protected int mHeight; + protected int mCasing; + protected boolean mTopLayerFound; // -1 => maybe top, maybe not, 0 => definitely not top, 1 => definitely top private int mTopState = -1; - @SuppressWarnings("rawtypes") - public ArrayList TTTunnels = new ArrayList<>(); - @SuppressWarnings("rawtypes") - public ArrayList TTMultiAmp = new ArrayList<>(); public GT_TileEntity_MegaDistillTower(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -156,6 +164,52 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati return new GT_TileEntity_MegaDistillTower(this.mName); } + protected void onCasingFound() { + mCasing++; + } + + protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null || aTileEntity.isDead() || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) + return false; + while (mOutputHatchesByLayer.size() < mHeight) + mOutputHatchesByLayer.add(new ArrayList<>()); + GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity(); + tHatch.updateTexture(aBaseCasingIndex); + return mOutputHatchesByLayer.get(mHeight - 1).add(tHatch); + } + + protected void onTopLayerFound(boolean aIsCasing) { + mTopLayerFound = true; + if (aIsCasing) + onCasingFound(); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + if (aActive) + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow().build()}; + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow().build()}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DistillationTower.png"); + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sDistillationRecipes; + } + @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); @@ -179,16 +233,8 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati } @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public IStructureDefinition getStructureDefinition() { - return (IStructureDefinition) STRUCTURE_DEFINITION; - } - - @Override - public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (LoaderReference.tectech) - return TecTechUtils.addEnergyInputToMachineList(this, aTileEntity, aBaseCasingIndex); - return super.addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; } @Override @@ -260,6 +306,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati found_Recipe = true; long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); int tCurrentPara = handleParallelRecipe(tRecipe, new FluidStack[]{tFluid}, null, (int) tMaxPara); + this.updateSlots(); processed = tCurrentPara; Outputs = getMultiOutput(tRecipe, tCurrentPara); outputFluids = Outputs.getKey(); @@ -270,21 +317,13 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati continue; this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - long actualEUT = (long) (tRecipe.mEUt) * processed; - if (actualEUT > Integer.MAX_VALUE) { - byte divider = 0; - while (actualEUT > Integer.MAX_VALUE) { - actualEUT = actualEUT / 2; - divider++; - } - BW_Util.calculateOverclockedNessMulti((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), 1, nominalV, this); - } else - BW_Util.calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, nominalV, this); + long actualEUT = ((long)tRecipe.mEUt) * processed; + calculateOverclockedNessMulti(actualEUT, tRecipe.mDuration, nominalV); //In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); + if (this.lEUt > 0) { + this.lEUt = (-this.lEUt); } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputFluids = outputFluids.toArray(new FluidStack[0]); @@ -292,44 +331,10 @@ public class GT_TileEntity_MegaDistillTower extends GT_MetaTileEntity_Distillati this.mOutputItems = outputItems.toArray(new ItemStack[0]); else this.mOutputItems = null; - this.updateSlots(); return true; } } return false; } - @Override - public boolean drainEnergyInput(long aEU) { - if (LoaderReference.tectech) - return TecTechUtils.drainEnergyMEBFTecTech(this, aEU); - return MegaUtils.drainEnergyMegaVanilla(this, aEU); - } - - @Override - public long getMaxInputVoltage() { - if (LoaderReference.tectech) - return TecTechUtils.getMaxInputVoltage(this); - return super.getMaxInputVoltage(); - } - - @Override - @Optional.Method(modid = "tectech") - public List getVanillaEnergyHatches() { - return this.mEnergyHatches; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - @Optional.Method(modid = "tectech") - public List getTecTechEnergyTunnels() { - return TTTunnels; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - @Optional.Method(modid = "tectech") - public List getTecTechEnergyMultis() { - return TTMultiAmp; - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java new file mode 100644 index 0000000000..be3c46fd06 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java @@ -0,0 +1,296 @@ +package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; + +import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.MegaUtils; +import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; +import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; +import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.LowPowerLaser; +import cpw.mods.fml.common.Optional; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.*; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import static gregtech.api.enums.GT_Values.V; + +@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) +public abstract class GT_TileEntity_MegaMultiBlockBase> extends GT_MetaTileEntity_EnhancedMultiBlockBase implements TecTechEnabledMulti { + + protected GT_TileEntity_MegaMultiBlockBase(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_MegaMultiBlockBase(String aName) { + super(aName); + } + + long lEUt = 0; + private int energyTier = -1; + + public ArrayList TTTunnels = new ArrayList<>(); + public ArrayList TTMultiAmp = new ArrayList<>(); + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + this.lEUt = aNBT.getLong("lEUt"); + } + + @Override + public void clearHatches() { + super.clearHatches(); + this.energyTier = -1; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setLong("lEUt", lEUt); + } + + @SuppressWarnings("rawtypes") + @Optional.Method(modid = "tectech") + boolean areLazorsLowPowa() { + Collection collection = this.getTecTechEnergyTunnels(); + if (!collection.isEmpty()) + for (Object tecTechEnergyMulti : collection) + if (!(tecTechEnergyMulti instanceof LowPowerLaser)) + return false; + return true; + } + + @Override + @Optional.Method(modid = "tectech") + public List getVanillaEnergyHatches() { + return this.mEnergyHatches; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + @Optional.Method(modid = "tectech") + public List getTecTechEnergyTunnels() { + return TTTunnels; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + @Optional.Method(modid = "tectech") + public List getTecTechEnergyMultis() { + return TTMultiAmp; + } + + @Override + public boolean drainEnergyInput(long aEU) { + if (LoaderReference.tectech) + return TecTechUtils.drainEnergyMEBFTecTech(this, aEU); + return MegaUtils.drainEnergyMegaVanilla(this, aEU); + } + + @Override + public long getMaxInputVoltage() { + if (LoaderReference.tectech) + return TecTechUtils.getMaxInputVoltage(this); + return super.getMaxInputVoltage(); + } + + @Deprecated + @Override + protected void calculateOverclockedNessMulti(int aEUt, int aDuration, int mAmperage, long maxInputVoltage) { + calculateOverclockedNessMultiInternal((long)aEUt, aDuration, maxInputVoltage, false); + } + + @Deprecated + @Override + protected void calculatePerfectOverclockedNessMulti(int aEUt, int aDuration, int mAmperage, long maxInputVoltage) { + calculateOverclockedNessMultiInternal((long)aEUt, aDuration, maxInputVoltage, true); + } + + @Override + public String[] getInfoData() { + return LoaderReference.tectech ? this.getInfoDataArray(this) : super.getInfoData(); + } + + @Override + public String[] getInfoDataArray(GT_MetaTileEntity_MultiBlockBase multiBlockBase) { + int mPollutionReduction = 0; + + for (GT_MetaTileEntity_Hatch_Muffler tHatch : this.mMufflerHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); + } + } + + long[] ttHatches = getCurrentInfoData(); + long storedEnergy = ttHatches[0]; + long maxEnergy = ttHatches[1]; + + for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + } + } + + return new String[]{ + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + GT_Utility.formatNumbers(-this.lEUt) + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getMaxInputVoltage()) + EnumChatFormatting.RESET + " EU/t(*" + TecTechUtils.getMaxInputAmperage(this) + "A) " + + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + + EnumChatFormatting.YELLOW + BW_Util.getTierNameFromVoltage(this.getMaxInputVoltage()) + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + (this.getIdealStatus() - this.getRepairStatus()) + EnumChatFormatting.RESET + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + + EnumChatFormatting.YELLOW + (float) this.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; + } + + + // Special overclocking to handle over MAX voltage + protected byte calculateOverclockedNessMultiInternal(long aEUt, int aDuration, long maxInputVoltage, boolean perfectOC) { + byte mTier = (byte) Math.max(0, BW_Util.getTier(maxInputVoltage)), overclockCount = 0; + if (mTier == 0) { + //Long time calculation + long xMaxProgresstime = ((long) aDuration) << 1; + if (xMaxProgresstime > Integer.MAX_VALUE - 1) { + //make impossible if too long + this.lEUt = Integer.MAX_VALUE - 1; + this.mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + this.lEUt = aEUt >> 2; + this.mMaxProgresstime = (int) xMaxProgresstime; + } + } else { + //Long EUt calculation + long xEUt = aEUt; + //Isnt too low EUt check? + long tempEUt = Math.max(xEUt, V[1]); + + this.mMaxProgresstime = aDuration; + + while (tempEUt <= BW_Util.getTierVoltage(mTier - 1)) { + tempEUt <<= 2;//this actually controls overclocking + //xEUt *= 4;//this is effect of everclocking + this.mMaxProgresstime >>= perfectOC ? 2 : 1;//this is effect of overclocking + xEUt = this.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power + overclockCount++; + } + + while (xEUt > maxInputVoltage && xEUt >= aEUt){ + //downclock one notch until we are good again, we have overshot. + xEUt >>= 2; + this.mMaxProgresstime <<= perfectOC ? 2 : 1; + overclockCount--; + } + + if (xEUt < aEUt){ + xEUt <<= 2; + this.mMaxProgresstime >>= perfectOC ? 2 : 1; + overclockCount++; + } + + this.lEUt = xEUt; + if (this.lEUt == 0) + this.lEUt = 1; + if (this.mMaxProgresstime <= 0) + this.mMaxProgresstime = 1;//set time to 1 tick + } + return overclockCount; + } + + + protected void calculateOverclockedNessMulti(long aEUt, int aDuration, long maxInputVoltage){ + calculateOverclockedNessMultiInternal(aEUt, aDuration, maxInputVoltage, false); + } + + protected void calculatePerfectOverclockedNessMulti(long aEUt, int aDuration, long maxInputVoltage){ + calculateOverclockedNessMultiInternal(aEUt, aDuration, maxInputVoltage, true); + } + + @Override + public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (LoaderReference.tectech) { + int tier = TecTechUtils.addEnergyInputToMachineList(this, aTileEntity, aBaseCasingIndex, energyTier); + if(energyTier == -1) energyTier = tier; + return tier != -1; + } + else + { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { + if(energyTier == -1) + energyTier = ((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).mTier; + if(((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).mTier != energyTier) + return false; + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + } else { + return false; + } + } + } + } + + @Override + public void stopMachine() { + this.lEUt = 0L; + super.stopMachine(); + } + + @Override + public boolean onRunningTick(ItemStack aStack) { + if (this.lEUt > 0) { + this.addEnergyOutput(this.lEUt * (long)this.mEfficiency / 10000L); + return true; + } else if (this.lEUt < 0 && !this.drainEnergyInput((-this.lEUt) * 10000L / (long)Math.max(1000, this.mEfficiency))) { + this.stopMachine(); + return false; + } else { + return true; + } + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index 4a7ac80aa8..6c0ba378d6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -25,27 +25,27 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.MegaUtils; import com.github.bartimaeusnek.bartworks.util.Pair; -import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; -import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.LowPowerLaser; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; +import gregtech.api.enums.HeatingCoilLevel; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_OilCracker; +import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -57,15 +57,47 @@ import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.ge import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.*; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker implements TecTechEnabledMulti { - - private final ArrayList TTTunnels = new ArrayList<>(); - private final ArrayList TTMultiAmp = new ArrayList<>(); - +public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBase { + private static final int CASING_INDEX = 49; + private static final String STRUCTURE_PIECE_MAIN = "main"; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {" p p ", "ppgggggggggpp", " pgggggggggp ", " pgggpppgggp ", " pgggpMpgggp ", " pgggpppgggp ", " pgggggggggp ", "ppgggggggggpp", " p p "}, + {" p p ", "pgggggggggggp", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", "pgggggggggggp", " p p "}, + {" p p ", "pgggggggggggp", " g c c c c g ", " p c c p ", " p c c c c p ", " p c c p ", " g c c c c g ", "pgggggggggggp", " p p "}, + {" p p ", "pgggggggggggp", " g c c c c g ", " p c c c c p ", " l c c c c r ", " p c c c c p ", " g c c c c g ", "pgggggggggggp", " p p "}, + {" p p ", "pgggggggggggp", " g c c c c g ", " p c c p ", " p c c c c p ", " p c c p ", " g c c c c g ", "pgggggggggggp", " p p "}, + {" p p ", "pgggggggggggp", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", "pgggggggggggp", " p p "}, + {"ppmmmm~mmmmpp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppmmmmmmmmmpp"}, + + })) + .addElement('c', ofCoil(GT_TileEntity_MegaOilCracker::setCoilLevel, GT_TileEntity_MegaOilCracker::getCoilLevel)) + .addElement('p', ofBlock(GregTech_API.sBlockCasings4, 1)) + .addElement('l', ofChain( + ofHatchAdder(GT_TileEntity_MegaOilCracker::addLeftHatchToMachineList, CASING_INDEX, 2) + )) + .addElement('r', ofChain( + ofHatchAdder(GT_TileEntity_MegaOilCracker::addRightHatchToMachineList, CASING_INDEX, 3) + )) + .addElement('m', ofChain( + ofHatchAdder(GT_TileEntity_MegaOilCracker::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_MegaOilCracker::addMaintenanceToMachineList, CASING_INDEX, 1), + ofBlock(GregTech_API.sBlockCasings4, 1) + )) + .addElement('M', ofChain( + ofHatchAdder(GT_TileEntity_MegaOilCracker::addMiddleInputToMachineList, CASING_INDEX, 4) + )) + .addElement('g', BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) + .build(); private byte glasTier; + private HeatingCoilLevel heatLevel; + protected final List mMiddleInputHatches = new ArrayList<>(); + protected int mInputOnSide; + protected int mOutputOnSide; public GT_TileEntity_MegaOilCracker(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -107,28 +139,23 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i } @Override - public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (LoaderReference.tectech) { - return TecTechUtils.addEnergyInputToMachineList(this, aTileEntity, aBaseCasingIndex); + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + if (aActive) return new ITexture[]{casingTexturePages[0][CASING_INDEX], + TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW).extFacing().glow().build()}; + return new ITexture[]{casingTexturePages[0][CASING_INDEX], + TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW).extFacing().glow().build()}; } - return super.addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); + return new ITexture[]{casingTexturePages[0][CASING_INDEX]}; } @Override - public boolean drainEnergyInput(long aEU) { - if (LoaderReference.tectech) { - return TecTechUtils.drainEnergyMEBFTecTech(this, aEU); - } - return MegaUtils.drainEnergyMegaVanilla(this, aEU); + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "OilCrackingUnit.png"); } - @Override - public long getMaxInputVoltage() { - if (LoaderReference.tectech) { - return TecTechUtils.getMaxInputVoltage(this); - } - return super.getMaxInputVoltage(); - } @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { @@ -161,6 +188,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i found_Recipe = true; long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); + this.updateSlots(); if (tCurrentPara <= 0) { return false; } @@ -174,42 +202,40 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; long actualEUT = (long) (tRecipe.mEUt) * processed; - if (actualEUT > Integer.MAX_VALUE) { - byte divider = 0; - while (actualEUT > Integer.MAX_VALUE) { - actualEUT = actualEUT / 2; - divider++; - } - BW_Util.calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration * (divider * 2), 1, nominalV, this); - } else { - BW_Util.calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, nominalV, this); - } + calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, nominalV); //In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) { + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) { return false; } if (this.getCoilLevel().getTier() < 5) { - this.mEUt *= 1 - (0.1D * (this.getCoilLevel().getTier() + 1)); + this.lEUt *= 1 - (0.1D * (this.getCoilLevel().getTier() + 1)); } else { - this.mEUt *= 0.5; + this.lEUt *= 0.5; } - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); + if (this.lEUt > 0) { + this.lEUt = (-this.lEUt); } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = new ItemStack[outputItems.size()]; this.mOutputItems = outputItems.toArray(this.mOutputItems); this.mOutputFluids = new FluidStack[outputFluids.size()]; this.mOutputFluids = outputFluids.toArray(this.mOutputFluids); - this.updateSlots(); return true; } return false; } + public HeatingCoilLevel getCoilLevel() { + return heatLevel; + } + + public void setCoilLevel(HeatingCoilLevel aCoilLevel) { + heatLevel = aCoilLevel; + } + @Override public void construct(ItemStack aStack, boolean aHintsOnly) { buildPiece(STRUCTURE_PIECE_MAIN,aStack,aHintsOnly,6,6,0); @@ -244,60 +270,6 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i return true; } - - @SuppressWarnings("rawtypes") - @Optional.Method(modid = "tectech") - private boolean areThingsNotProperlyTiered(Collection collection) { - if (!collection.isEmpty()) - for (Object tecTechEnergyMulti : collection) - if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) - return true; - return false; - } - - @SuppressWarnings("rawtypes") - @Optional.Method(modid = "tectech") - private boolean areLazorsLowPowa() { - Collection collection = this.getTecTechEnergyTunnels(); - if (!collection.isEmpty()) - for (Object tecTechEnergyMulti : collection) - if (!(tecTechEnergyMulti instanceof LowPowerLaser)) - return false; - return true; - } - - private static final int CASING_INDEX = 49; - private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {" p p ", "ppgggggggggpp", " pgggggggggp ", " pgggpppgggp ", " pgggpMpgggp ", " pgggpppgggp ", " pgggggggggp ", "ppgggggggggpp", " p p "}, - {" p p ", "pgggggggggggp", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", "pgggggggggggp", " p p "}, - {" p p ", "pgggggggggggp", " g c c c c g ", " p c c p ", " p c c c c p ", " p c c p ", " g c c c c g ", "pgggggggggggp", " p p "}, - {" p p ", "pgggggggggggp", " g c c c c g ", " p c c c c p ", " l c c c c r ", " p c c c c p ", " g c c c c g ", "pgggggggggggp", " p p "}, - {" p p ", "pgggggggggggp", " g c c c c g ", " p c c p ", " p c c c c p ", " p c c p ", " g c c c c g ", "pgggggggggggp", " p p "}, - {" p p ", "pgggggggggggp", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", "pgggggggggggp", " p p "}, - {"ppmmmm~mmmmpp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppmmmmmmmmmpp"}, - - })) - .addElement('c', ofCoil(GT_TileEntity_MegaOilCracker::setCoilLevel, GT_TileEntity_MegaOilCracker::getCoilLevel)) - .addElement('p', ofBlock(GregTech_API.sBlockCasings4, 1)) - .addElement('l', ofChain( - ofHatchAdder(GT_TileEntity_MegaOilCracker::addLeftHatchToMachineList, CASING_INDEX, 2) - )) - .addElement('r', ofChain( - ofHatchAdder(GT_TileEntity_MegaOilCracker::addRightHatchToMachineList, CASING_INDEX, 3) - )) - .addElement('m', ofChain( - ofHatchAdder(GT_TileEntity_MegaOilCracker::addEnergyInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_MegaOilCracker::addMaintenanceToMachineList, CASING_INDEX, 1), - ofBlock(GregTech_API.sBlockCasings4, 1) - )) - .addElement('M', ofChain( - ofHatchAdder(GT_TileEntity_MegaOilCracker::addMiddleInputToMachineList, CASING_INDEX, 4) - )) - .addElement('g', BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) - .build(); - private boolean addLeftHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { return false; @@ -402,35 +374,19 @@ public class GT_TileEntity_MegaOilCracker extends GT_MetaTileEntity_OilCracker i return rList; } - @SuppressWarnings({"unchecked", "rawtypes"}) - @Override - public IStructureDefinition getStructureDefinition() { - return (IStructureDefinition) STRUCTURE_DEFINITION; - } - - @Override - public String[] getInfoData() { - return LoaderReference.tectech ? this.getInfoDataArray(this) : super.getInfoData(); - } - - @Override - @Optional.Method(modid = "tectech") - public List getVanillaEnergyHatches() { - return this.mEnergyHatches; - } - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - @Optional.Method(modid = "tectech") - public List getTecTechEnergyTunnels() { - return TTTunnels; + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; } - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings("rawtypes") @Optional.Method(modid = "tectech") - public List getTecTechEnergyMultis() { - return TTMultiAmp; + private boolean areThingsNotProperlyTiered(Collection collection) { + if (!collection.isEmpty()) + for (Object tecTechEnergyMulti : collection) + if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) + return true; + return false; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 744f2a2797..fab860bac1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -25,40 +25,35 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.MegaUtils; import com.github.bartimaeusnek.bartworks.util.Pair; -import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.init.Blocks; +import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; -import java.util.List; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.*; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_EnhancedMultiBlockBase implements TecTechEnabledMulti { +public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBlockBase { public GT_TileEntity_MegaVacuumFreezer(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -73,10 +68,6 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_EnhancedM return new GT_TileEntity_MegaVacuumFreezer(this.mName); } - @SuppressWarnings("rawtypes") - public ArrayList TTTunnels = new ArrayList<>(); - @SuppressWarnings("rawtypes") - public ArrayList TTMultiAmp = new ArrayList<>(); private int mCasing = 0; private static final int CASING_INDEX = 17; @@ -109,6 +100,26 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_EnhancedM .build(); + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Vacuum Freezer"). + addInfo("Controller Block for the Mega Vacuum Freezer"). + addInfo("Cools hot ingots and cells"). + addSeparator(). + beginStructureBlock(15, 15, 15, true). + addController("Front center"). + addCasingInfo("Frost Proof Machine Casing", 900). + addEnergyHatch("Any casing", 1). + addMaintenanceHatch("Any casing", 1). + addInputHatch("Any casing", 1). + addOutputHatch("Any casing", 1). + addInputBus("Any casing", 1). + addOutputBus("Any casing", 1). + toolTipFinisher("Bartworks"); + return tt; + } + @Override public IStructureDefinition getStructureDefinition() { return STRUCTURE_DEFINITION; @@ -120,29 +131,13 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_EnhancedM } @Override - public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (LoaderReference.tectech) - return TecTechUtils.addEnergyInputToMachineList(this, aTileEntity, aBaseCasingIndex); - return super.addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); - } - - @Override - public boolean drainEnergyInput(long aEU) { - if (LoaderReference.tectech) - return TecTechUtils.drainEnergyMEBFTecTech(this, aEU); - return MegaUtils.drainEnergyMegaVanilla(this, aEU); - } - - @Override - public long getMaxInputVoltage() { - if (LoaderReference.tectech) - return TecTechUtils.getMaxInputVoltage(this); - return super.getMaxInputVoltage(); + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sVacuumRecipes; } @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return GT_Recipe.GT_Recipe_Map.sVacuumRecipes; + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png"); } @Override @@ -164,6 +159,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_EnhancedM found_Recipe = true; long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); + this.updateSlots(); if (tCurrentPara <= 0) return false; processed = tCurrentPara; Pair, ArrayList> Outputs = getMultiOutput(tRecipe, tCurrentPara); @@ -175,27 +171,18 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_EnhancedM this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; long actualEUT = (long) (tRecipe.mEUt) * processed; - if (actualEUT > Integer.MAX_VALUE) { - byte divider = 0; - while (actualEUT > Integer.MAX_VALUE) { - actualEUT = actualEUT / 2; - divider++; - } - BW_Util.calculateOverclockedNessMulti((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), 1, nominalV, this); - } else - BW_Util.calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, nominalV, this); + calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, nominalV); //In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); + if (this.lEUt > 0) { + this.lEUt = (-this.lEUt); } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = new ItemStack[outputItems.size()]; this.mOutputItems = outputItems.toArray(this.mOutputItems); this.mOutputFluids = new FluidStack[outputFluids.size()]; this.mOutputFluids = outputFluids.toArray(this.mOutputFluids); - this.updateSlots(); return true; } return false; @@ -223,84 +210,24 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_EnhancedM } - @Override - public String[] getInfoData() { - return LoaderReference.tectech ? this.getInfoDataArray(this) : super.getInfoData(); - } - - @Override - protected GT_Multiblock_Tooltip_Builder createTooltip() { - GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Vacuum Freezer"). - addInfo("Controller Block for the Mega Vacuum Freezer"). - addInfo("Cools hot ingots and cells"). - addSeparator(). - beginStructureBlock(15, 15, 15, true). - addController("Front center"). - addCasingInfo("Frost Proof Machine Casing", 900). - addEnergyHatch("Any casing", 1). - addMaintenanceHatch("Any casing", 1). - addInputHatch("Any casing", 1). - addOutputHatch("Any casing", 1). - addInputBus("Any casing", 1). - addOutputBus("Any casing", 1). - toolTipFinisher("Bartworks"); - return tt; - } - - @Override - public boolean isCorrectMachinePart(ItemStack itemStack) { - return true; - } - - @Override - public int getMaxEfficiency(ItemStack itemStack) { - return 10000; - } - - @Override - public int getDamageToComponent(ItemStack itemStack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack itemStack) { - return false; - } - @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { ITexture[] rTexture; if (aSide == aFacing) { if (aActive) { - rTexture = new ITexture[]{Textures.BlockIcons.casingTexturePages[0][17], TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE}).extFacing().build(), TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW}).extFacing().glow().build()}; + rTexture = new ITexture[]{ + casingTexturePages[0][17], + TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW).extFacing().glow().build()}; } else { - rTexture = new ITexture[]{Textures.BlockIcons.casingTexturePages[0][17], TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER}).extFacing().build(), TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_GLOW}).extFacing().glow().build()}; + rTexture = new ITexture[]{ + casingTexturePages[0][17], + TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_GLOW).extFacing().glow().build()}; } } else { - rTexture = new ITexture[]{Textures.BlockIcons.casingTexturePages[0][17]}; + rTexture = new ITexture[]{casingTexturePages[0][17]}; } - return rTexture; } - - @Override - @Optional.Method(modid = "tectech") - public List getVanillaEnergyHatches() { - return this.mEnergyHatches; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - @Optional.Method(modid = "tectech") - public List getTecTechEnergyTunnels() { - return TTTunnels; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - @Optional.Method(modid = "tectech") - public List getTecTechEnergyMultis() { - return TTMultiAmp; - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 4260eb802f..deee5a54e1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.MainMod; +import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.OreDictNames; import gregtech.api.enums.ToolDictNames; @@ -304,8 +305,32 @@ public class BW_Util { return (int) (30 * Math.pow(4, (tier - 1))); } - public static int getTierVoltage(int tier) { - return 8 << (2 * tier); + public static long getTierVoltage(int tier) { + return getTierVoltage((byte)tier); + } + + public static long getTierVoltage(byte tier) { + return 8L << (2 * tier); + } + + public static byte getTier(long voltage){ + if(voltage <= Integer.MAX_VALUE) + return GT_Utility.getTier(voltage); + byte t = 0; + while(voltage > 8L) { + voltage >>= 2; + t++; + } + return t; + } + + public static String getTierName(byte tier){ + if(VN.length <= tier) return "MAX+"; + else return VN[tier]; + } + + public static String getTierNameFromVoltage(long voltage){ + return getTierName(getTier(voltage)); } public static boolean areStacksEqualOrNull(ItemStack aStack1, ItemStack aStack2) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java index 735b7dbe53..53a72b2903 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java @@ -32,23 +32,38 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB public class TecTechUtils { - public static boolean addEnergyInputToMachineList(TecTechEnabledMulti baseTE, IGregTechTileEntity te, int aBaseCasingIndex) { + @Deprecated + public static boolean addEnergyInputToMachineList(TecTechEnabledMulti baseTE, IGregTechTileEntity te, int aBaseCasingIndex){ + return addEnergyInputToMachineList(baseTE, te, aBaseCasingIndex, -1) != -1; + } + + public static int addEnergyInputToMachineList(TecTechEnabledMulti baseTE, IGregTechTileEntity te, int aBaseCasingIndex, int aTier) { if (te == null || !(te.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch)) - return false; + return -1; else { GT_MetaTileEntity_Hatch mte = (GT_MetaTileEntity_Hatch) te.getMetaTileEntity(); - if (mte instanceof GT_MetaTileEntity_Hatch_Energy) - baseTE.getVanillaEnergyHatches().add((GT_MetaTileEntity_Hatch_Energy) mte); - else if (mte instanceof GT_MetaTileEntity_Hatch_EnergyTunnel) - baseTE.getTecTechEnergyTunnels().add((GT_MetaTileEntity_Hatch_EnergyTunnel) mte); - else if (mte instanceof GT_MetaTileEntity_Hatch_EnergyMulti) - baseTE.getTecTechEnergyMultis().add((GT_MetaTileEntity_Hatch_EnergyMulti) mte); + if(mte.mTier != aTier && aTier != -1) + return -1; + + if (mte instanceof GT_MetaTileEntity_Hatch_EnergyTunnel) + if(baseTE.getVanillaEnergyHatches().isEmpty() && baseTE.getTecTechEnergyMultis().isEmpty()) + baseTE.getTecTechEnergyTunnels().add((GT_MetaTileEntity_Hatch_EnergyTunnel) mte); + else + return -1; + else if(baseTE.getTecTechEnergyTunnels().isEmpty()) { + if (mte instanceof GT_MetaTileEntity_Hatch_Energy) + baseTE.getVanillaEnergyHatches().add((GT_MetaTileEntity_Hatch_Energy) mte); + else if (mte instanceof GT_MetaTileEntity_Hatch_EnergyMulti) + baseTE.getTecTechEnergyMultis().add((GT_MetaTileEntity_Hatch_EnergyMulti) mte); + else + return -1; + } else - return false; + return -1; mte.updateTexture(aBaseCasingIndex); - return true; + return mte.mTier; } } @@ -80,7 +95,7 @@ public class TecTechUtils { return false; if (hatches == 0) return false; - + long euperhatch = aEU / hatches; boolean hasDrained = true; @@ -139,12 +154,32 @@ public class TecTechUtils { } for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : base.getTecTechEnergyTunnels()) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rVoltage += getEUPerTickFromLaser(tHatch); + rVoltage += tHatch.maxEUInput(); } } return rVoltage; } + public static long getMaxInputAmperage(TecTechEnabledMulti base) { + long rAmperage = 0L; + for (GT_MetaTileEntity_Hatch_Energy tHatch : base.getVanillaEnergyHatches()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + rAmperage += tHatch.getBaseMetaTileEntity().getInputAmperage(); + } + } + for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : base.getTecTechEnergyMultis()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + rAmperage += tHatch.getBaseMetaTileEntity().getInputAmperage(); + } + } + for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : base.getTecTechEnergyTunnels()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + rAmperage += tHatch.Amperes; + } + } + return rAmperage; + } + public static long getEUPerTickFromLaser(GT_MetaTileEntity_Hatch_EnergyTunnel tHatch) { return tHatch.Amperes * tHatch.maxEUInput() - (tHatch.Amperes / 20); } -- cgit From fbe26eea1b365672883f4ac7945eb45f25e64dde Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Sun, 20 Mar 2022 01:20:09 +0100 Subject: Dont override material when it cant be found (#112) Former-commit-id: 8a5a24d697a34f8a7c8984965b1997b5cbbc4613 --- .../bartworks/common/loaders/StaticRecipeChangeLoaders.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 684149c9f6..6282852d58 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -246,7 +246,7 @@ public class StaticRecipeChangeLoaders { private static void runUnficationDeleter(Werkstoff werkstoff) { if (werkstoff.getType() == Werkstoff.Types.ELEMENT) { - if (werkstoff.getBridgeMaterial() != null) { + if (werkstoff.getBridgeMaterial() != null && Element.get(werkstoff.getToolTip()) != Element._NULL) { werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip()); Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>(); Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial()); @@ -265,7 +265,7 @@ public class StaticRecipeChangeLoaders { private static void runMaterialLinker(Werkstoff werkstoff) { if (werkstoff.getType() == Werkstoff.Types.ELEMENT) { - if (werkstoff.getBridgeMaterial() != null) { + if (werkstoff.getBridgeMaterial() != null && Element.get(werkstoff.getToolTip()) != Element._NULL) { werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip()); Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>(); Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial()); -- cgit From c141f35db0bcb1934a292696ecc947d1f770876b Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Mon, 21 Mar 2022 14:07:27 +0800 Subject: fix mdt (#113) fix https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/10007 Former-commit-id: 0add3b47c6d96065ca78491e1c7cd7111b596096 --- .../tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 3d56b3fd3b..355e9dfee5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -337,4 +337,13 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock return false; } + @Override + protected void addFluidOutputs(FluidStack[] mOutputFluids2) { + for (int i = 0; i < mOutputFluids2.length && i < mOutputHatchesByLayer.size(); i++) { + FluidStack tStack = mOutputFluids2[i].copy(); + if (!dumpFluid(mOutputHatchesByLayer.get(i), tStack, true)) + dumpFluid(mOutputHatchesByLayer.get(i), tStack, false); + } + } + } -- cgit From 6889543551473a47a17b8f5a3c239ed611f97d94 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Mon, 28 Mar 2022 00:59:48 +0800 Subject: fix it stuck when handling oredict stuff (#110) Former-commit-id: 36378a368f9103dccf06891d7b33e863d28750d1 --- .../bartworks/util/RecipeFinderForParallel.java | 59 ++++++++++++++++------ 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java index bce9676001..052c29eff2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java @@ -1,6 +1,6 @@ package com.github.bartimaeusnek.bartworks.util; -import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; @@ -9,13 +9,25 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.HashMap; +/** + * Handle the parallel more efficient. + * + * @author GlodBlock + */ + public class RecipeFinderForParallel { /** - This method is used for mega multis which have extremely high parallel.
- Never use it for non parallel machines, it will have worse performance.
+ * This method is used for mega multis which have extremely high parallel. + * Never use it for non parallel machines, it will have worse performance. + * It will auto consume the inputs. + * + * @param aRecipe The target recipe that you want calculate the parallel + * @param aFluidInputs The input fluid from machine + * @param aItemStacks The input item from machine + * @param aMaxParallel The max parallel that it can reach + * @return The parallel that it can reach */ - public static int handleParallelRecipe(GT_Recipe aRecipe, FluidStack[] aFluidInputs, ItemStack[] aItemStacks, int aMaxParallel) { if (aFluidInputs == null) aFluidInputs = new FluidStack[0]; if (aItemStacks == null) aItemStacks = new ItemStack[0]; @@ -40,8 +52,17 @@ public class RecipeFinderForParallel { } tCurrentPara = Math.min(tCurrentPara, tCountWildcard / tCompressedItemRecipe.get(tItem)); } - else if (tCompressedItemInput.containsKey(tItem) && tCompressedItemRecipe.get(tItem) != 0) { - tCurrentPara = Math.min(tCurrentPara, tCompressedItemInput.get(tItem) / tCompressedItemRecipe.get(tItem)); + else if (tCompressedItemRecipe.get(tItem) != 0) { + /*OreDict Stuff*/ + int tCountOre = 0; + ItemStack tRealRecipe = GT_Utility.intToStack(tItem); + for (int tInputItem : tCompressedItemInput.keySet()) { + ItemStack tRealStack = GT_Utility.intToStack(tInputItem); + if (GT_OreDictUnificator.isInputStackEqual(tRealStack, tRealRecipe)) { + tCountOre += tCompressedItemInput.get(tInputItem); + } + } + tCurrentPara = Math.min(tCurrentPara, tCountOre / tCompressedItemRecipe.get(tItem)); } } @@ -67,16 +88,17 @@ public class RecipeFinderForParallel { } } - for (ItemStack tItem : aItemStacks) { - if (tItem != null && tCompressedItemRecipe.containsKey(GT_Utility.stackToInt(tItem))) { - if (tItem.stackSize >= tCompressedItemRecipe.get(GT_Utility.stackToInt(tItem))) { - tItem.stackSize -= tCompressedItemRecipe.get(GT_Utility.stackToInt(tItem)); - tCompressedItemRecipe.remove(GT_Utility.stackToInt(tItem)); - } - else { - tCompressedItemRecipe.put(GT_Utility.stackToInt(tItem), tCompressedItemRecipe.get(GT_Utility.stackToInt(tItem)) - tItem.stackSize); - tItem.stackSize = 0; + /*OreDict Stuff*/ + for (int tItem : tCompressedItemRecipe.keySet()) { + ItemStack tRealRecipe = GT_Utility.intToStack(tItem); + int tTargetAmount = tCompressedItemRecipe.get(tItem); + for (ItemStack input : aItemStacks) { + if (GT_OreDictUnificator.isInputStackEqual(input, tRealRecipe)) { + int d = Math.min(tTargetAmount, input.stackSize); + tTargetAmount -= d; + input.stackSize -= d; } + if (tTargetAmount == 0) break; } } /*Wildcard Stuff*/ @@ -102,6 +124,13 @@ public class RecipeFinderForParallel { return tCurrentPara; } + /** + * Get the proper packed output stacks + * + * @param aRecipe The target recipe + * @param aPall The parallel it has + * @return A pair of the output fluid and item stack, the first value is fluid, the second is item. + */ public static Pair, ArrayList> getMultiOutput(GT_Recipe aRecipe, int aPall) { ArrayList tFluidList = new ArrayList<>(); ArrayList tItemList = new ArrayList<>(); -- cgit From 4e39ecc22f7d56f81589a3bb9321aa5130385922 Mon Sep 17 00:00:00 2001 From: MuXiu1997 Date: Tue, 12 Apr 2022 00:12:22 +0800 Subject: Add Whitelist/Blacklist mode for void miners (#114) * Add whitelist mode for void miners * Add blacklist mode for void miners Former-commit-id: 310febc80c8aee69af8b9b7e486e4f2c9814b220 --- dependencies.gradle | 4 +-- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 36 +++++++++++++++++----- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index c0090b5a4d..8b725db7c8 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.31:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.42:dev") compile("com.github.GTNewHorizons:StructureLib:1.0.15:dev") compile("com.github.GTNewHorizons:TecTech:4.10.18:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.2.5-GTNH:dev") @@ -13,7 +13,7 @@ dependencies { exclude group:"com.github.GTNewHorizons", module:"bartworks" } compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") - + compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-75-GTNH:dev") { transitive = false } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index 6f304fda39..2f5dd0c7b9 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -32,9 +32,6 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer; -import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b; -import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128ba; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.Pair; import com.google.common.collect.ArrayListMultimap; import gregtech.api.GregTech_API; @@ -42,18 +39,23 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.XSTR; -import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Utility; import gregtech.common.GT_Worldgen_GT_Ore_Layer; import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraft.world.gen.ChunkProviderServer; import net.minecraftforge.fluids.FluidStack; -import java.util.*; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; import java.util.function.Consumer; import java.util.function.Predicate; import java.util.stream.Collectors; @@ -78,6 +80,8 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri protected byte TIER_MULTIPLIER; + private boolean mBlacklist = false; + public static void addMatierialToDimensionList(int DimensionID, ISubTagContainer Material, float weight) { if (Material instanceof Materials) getExtraDropsDimMap().put(DimensionID, new Pair<>(new Pair<>(((Materials)Material).mMetaItemSubID,false), weight)); @@ -98,12 +102,14 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); aNBT.setByte("TIER_MULTIPLIER",TIER_MULTIPLIER); + aNBT.setBoolean("mBlacklist", mBlacklist); } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); TIER_MULTIPLIER = aNBT.getByte("TIER_MULTIPLIER"); + mBlacklist = aNBT.getBoolean("mBlacklist"); } public GT_TileEntity_VoidMiner_Base(String aName, int tier) { @@ -161,6 +167,9 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri .addInfo("Consumes " + GT_Values.V[this.getMinTier()] + "EU/t") .addInfo("Can be supplied with 2L/s of Neon(x4), Krypton(x8), Xenon(x16) or Oganesson(x64) for higher outputs.") .addInfo("Will output "+(2*TIER_MULTIPLIER)+" Ores per Second depending on the Dimension it is build in") + .addInfo("Put the Ore into the input bus to set the Whitelist/Blacklist") + .addInfo("Use a screwdriver to toggle Whitelist/Blacklist") + .addInfo("Blacklist or non Whitelist Ore will be VOIDED") .addSeparator() .beginStructureBlock(3, 7, 3, false) .addController("Front bottom") @@ -169,7 +178,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") .addEnergyHatch(VN[getMinTier()] + "+, Any base casing") .addMaintenanceHatch("Any base casing") - .addInputBus("Mining Pipes, optional, any base casing") + .addInputBus("Mining Pipes or Ores, optional, any base casing") .addInputHatch("Optional noble gas, any base casing") .addOutputBus("Any base casing") .toolTipFinisher("Gregtech"); @@ -415,8 +424,19 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } private void handleOutputs() { - Pair stats = getOreDamage(); - this.addOutput(new ItemStack(stats.getValue() ? WerkstoffLoader.BWOres : GregTech_API.sBlockOres1, multiplier, stats.getKey())); + Pair stats = getOreDamage(); + final List inputOres = this.getStoredInputs().stream().filter(GT_Utility::isOre).collect(Collectors.toList()); + final ItemStack output = new ItemStack(stats.getValue() ? WerkstoffLoader.BWOres : GregTech_API.sBlockOres1, multiplier, stats.getKey()); + if (inputOres.size() == 0 + || (mBlacklist && inputOres.stream().allMatch(is -> !GT_Utility.areStacksEqual(is, output))) + || (!mBlacklist && inputOres.stream().anyMatch(is -> GT_Utility.areStacksEqual(is, output))) + ) this.addOutput(output); this.updateSlots(); } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + mBlacklist = !mBlacklist; + GT_Utility.sendChatToPlayer(aPlayer, "Mode: " + (mBlacklist ? "Blacklist" : "Whitelist")); + } } -- cgit From 9aa02e0c12d2ab2acd6bc01632ca1fbf8210a686 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Mon, 11 Apr 2022 19:15:00 +0200 Subject: Add Extreme Industrial Greenhouse (#111) * Add Extreme Industrial Greenhouse * Add info about crops inside the machine * Add a way to remove crops from machine * Add crafting recipe * Dont use full amp * Add glass tier requirements * Bug fix * Account for IC2 crops with two diffrent outputs * Add water requirement Former-commit-id: af761997f238aff74a2248871eedef121bdd291a --- .../bartworks/API/LoaderReference.java | 3 + .../github/bartimaeusnek/bartworks/MainMod.java | 2 + .../client/renderer/BW_CropVisualizer.java | 55 ++ .../bartworks/common/loaders/ItemRegistry.java | 8 +- .../bartworks/common/loaders/RecipeLoader.java | 14 + .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 720 +++++++++++++++++++++ .../tileentities/multis/GT_TileEntity_HTGR.java | 39 +- .../mega/GT_TileEntity_MegaMultiBlockBase.java | 2 +- 8 files changed, 818 insertions(+), 25 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java index 4cc8ad45c1..8c631fead4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java @@ -57,6 +57,8 @@ public class LoaderReference { public static boolean HardcoreEnderExpension; public static boolean betterloadingscreen; public static boolean TGregworks; + public static boolean ProjRedIllumination; + public static void init() { Natura = Loader.isModLoaded("Natura"); @@ -86,5 +88,6 @@ public class LoaderReference { HardcoreEnderExpension = Loader.isModLoaded("HardcoreEnderExpension"); betterloadingscreen = Loader.isModLoaded("betterloadingscreen"); TGregworks = Loader.isModLoaded("TGregworks"); + ProjRedIllumination = Loader.isModLoaded("ProjRed|Illumination"); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 3404faf290..1f8ed0487c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -72,6 +72,8 @@ import static gregtech.api.enums.GT_Values.VN; + "after:GalacticraftMars; " + "after:GalacticraftCore; " + "after:Forestry; " + + "after:ProjRed|Illumination; " + + "after:RandomThings; " + "before:miscutils; " ) public final class MainMod { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java new file mode 100644 index 0000000000..dd5787a871 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java @@ -0,0 +1,55 @@ +package com.github.bartimaeusnek.bartworks.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class BW_CropVisualizer extends EntityFX { + int meta; + + public BW_CropVisualizer(World world, int x, int y, int z, int meta, int age) { + super(world, (double) x, ((double) y - 0.0625d), (double) z); + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.particleMaxAge = age; + this.meta = meta; + } + + @Override + public void onUpdate() { + if (this.particleAge++ >= this.particleMaxAge) + this.setDead(); + } + + @Override + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + Tessellator tessellator = Tessellator.instance; + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDepthMask(false); + tessellator.setColorRGBA(255, 255, 255, 255); + float f11 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) p_70539_2_ - interpPosX); + float f12 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) p_70539_2_ - interpPosY); + float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) p_70539_2_ - interpPosZ); + RenderBlocks.getInstance().renderBlockCropsImpl(Blocks.wheat, meta, f11, f12, f13); + 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/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index dbe663f3e8..3ecb7fbab8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -34,11 +34,7 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBl import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_ExperimentalFloodGate; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; import com.github.bartimaeusnek.bartworks.common.tileentities.debug.CreativeScanner; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_CircuitAssemblyLine; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_DEHP; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.*; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaBlastFurnace; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaDistillTower; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; @@ -151,6 +147,7 @@ public class ItemRegistry { public static ItemStack[] voidminer = new ItemStack[3]; public static ItemStack THTR; public static ItemStack HTGR; + public static ItemStack EIG; public static ItemStack eic; public static ItemStack cal; public static ItemStack compressedHatch; @@ -196,6 +193,7 @@ public class ItemRegistry { GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials(); ItemRegistry.HTGR = new GT_TileEntity_HTGR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 48, "HTGR", "High Temperature Gas-cooled Reactor").getStackForm(1L); GT_TileEntity_HTGR.HTGRMaterials.registeraTHR_Materials(); + ItemRegistry.EIG = new GT_TileEntity_ExtremeIndustrialGreenhouse(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 49, "EIG", "Extreme Industrial Greenhouse").getStackForm(1L); GT_OreDictUnificator.add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(ItemRegistry.BW_BLOCKS[2])); for (int i = 0; i < GT_Values.VN.length; i++) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index b313a68b5e..ed946a3c1d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -793,6 +793,20 @@ public class RecipeLoader { } ); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.EIG, + RecipeLoader.BITSD, + new Object[]{ + "AZA", + "BRB", + "AZA", + 'B', new ItemStack(GregTech_API.sBlockCasings4, 1, 1), + 'R', GT_ModHandler.getModItem("EnderIO", "blockFarmStation", 1), + 'A', new ItemStack(GregTech_API.sBlockMachines, 1, 11104), + 'Z', "circuitUltimate" + } + ); + if (LoaderReference.galacticgreg) { GT_Values.RA.addAssemblylineRecipe( ItemList.OreDrill4.get(1L), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java new file mode 100644 index 0000000000..fd0238df46 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -0,0 +1,720 @@ +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; + +import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.client.renderer.BW_CropVisualizer; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +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.GregTech_API; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Utility; +import ic2.api.crops.CropCard; +import ic2.api.crops.Crops; +import ic2.core.Ic2Items; +import ic2.core.crop.TileEntityCrop; +import net.minecraft.block.Block; +import net.minecraft.block.BlockCrops; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemSeeds; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import java.util.*; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + +public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity_EnhancedMultiBlockBase { + + private int mCasing = 0; + private int mMaxSlots = 0; + private int setupphase = 1; + private boolean isIC2Mode = false; + private byte glasTier = 0; + private int waterusage = 0; + private static final int CASING_INDEX = 49; + private static final String STRUCTURE_PIECE_MAIN = "main"; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {"ccccc", "ccccc", "ccccc", "ccccc", "ccccc"}, + {"ccccc", "clllc", "clllc", "clllc", "ccccc"}, + {"ggggg", "g g", "g g", "g g", "ggggg"}, + {"ggggg", "g g", "g g", "g g", "ggggg"}, + {"ccccc", "cdddc", "cdwdc", "cdddc", "ccccc"}, + {"cc~cc", "ccccc", "ccccc", "ccccc", "ccccc"}, + })) + .addElement('c', ofChain( + onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)), + ofHatchAdder(GT_TileEntity_ExtremeIndustrialGreenhouse::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_ExtremeIndustrialGreenhouse::addMaintenanceToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_ExtremeIndustrialGreenhouse::addInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_ExtremeIndustrialGreenhouse::addOutputToMachineList, CASING_INDEX, 1) + )) + .addElement('l', LoaderReference.ProjRedIllumination ? ofBlock(Block.getBlockFromName("ProjRed|Illumination:projectred.illumination.lamp"), 10) : ofBlock(Blocks.redstone_lamp, 0)) + .addElement('g', BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) + .addElement('d', ofBlock(LoaderReference.RandomThings ? Block.getBlockFromName("RandomThings:fertilizedDirt_tilled") : Blocks.farmland, 0)) + .addElement('w', ofBlock(Blocks.water, 0)) + .build(); + + + public GT_TileEntity_ExtremeIndustrialGreenhouse(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_ExtremeIndustrialGreenhouse(String aName) { + super(aName); + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if(aPlayer.isSneaking()) + { + if(this.mMaxProgresstime > 0) + { + GT_Utility.sendChatToPlayer(aPlayer, "You cant change IC2 mode if the machine is working!"); + return; + } + if(!mStorage.isEmpty()) + { + GT_Utility.sendChatToPlayer(aPlayer, "You cant change IC2 mode if there are seeds inside!"); + return; + } + this.isIC2Mode = !this.isIC2Mode; + GT_Utility.sendChatToPlayer(aPlayer, "IC2 mode is now " + (this.isIC2Mode ? "enabled" : "disabled.")); + } + else { + if(this.mMaxProgresstime > 0) + { + GT_Utility.sendChatToPlayer(aPlayer, "You cant enable/disable setup if the machine is working!"); + return; + } + this.setupphase++; + if(this.setupphase == 3) + this.setupphase = 0; + GT_Utility.sendChatToPlayer(aPlayer, "EIG is now running in " + (this.setupphase == 1 ? "setup mode (input)." : ( this.setupphase == 2 ? "setup mode (output)." : "normal operation."))); + } + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_ExtremeIndustrialGreenhouse(this.mName); + } + + @Override + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + protected IAlignmentLimits getInitialAlignmentLimits() { + return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && f.isNotFlipped(); + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt. + addMachineType("Crop Farm"). + addInfo("Controller block for the Extreme Industrial Greenhouse"). + addInfo("Grow your crops like a chad !"). + addInfo("Use screwdriver to enable/change/disable setup mode"). + addInfo("Use screwdriver while sneaking to enable/disable IC2 mode"). + addInfo("Uses 1000L of water per crop per operation"). + addInfo("-------------------- SETUP MODE --------------------"). + addInfo("Does not take power"). + addInfo("There are two modes: input / output"). + addInfo("Input mode: machine will take seeds from input bus and plant them"). + addInfo("Output mode: machine will take planted seeds and output them"). + addInfo("-------------------- NORMAL CROPS --------------------"). + addInfo("Minimal tier: EV"). + addInfo("Starting with 1 slot"). + addInfo("Every slot gives 64 crops"). + addInfo("Every tier past EV adds additional 2 slots"). + addInfo("Base process time: 5 sec"). + addInfo("Process time is divided by number of tiers past HV (Minimum 1 sec)"). + addInfo("All crops are grown at the end of the operation"). + addInfo("Will automatically craft seeds if they are not dropped"). + addInfo("-------------------- IC2 CROPS --------------------"). + addInfo("Minimal tier: UV"). + addInfo("Need UV glass tier"). + addInfo("Starting with 4 slots"). + addInfo("Every slot gives 1 crop"). + addInfo("Every tier past UV, slots are multiplied by 4"). + addInfo("Process time: 5 sec"). + addInfo("All crops are accelerated by x32 times"). + addInfo(BW_Tooltip_Reference.TT_BLUEPRINT). + addSeparator(). + beginStructureBlock(5, 4, 5, false). + addController("Front bottom center"). + addCasingInfo("Clean Stainless Steel Casings", 70). + addOtherStructurePart("Borosilicate Glass", "Hollow two middle layers", 2). + addStructureInfo("The glass tier limits the Energy Input tier"). + addMaintenanceHatch("Any casing", 1). + addInputBus("Any casing", 1). + addOutputBus("Any casing", 1). + addInputHatch("Any casing", 1). + addEnergyHatch("Any casing", 1). + toolTipFinisher("Added by " + ChatColorHelper.GOLD + "kuba6000" + ChatColorHelper.RESET + ChatColorHelper.GREEN + " via " + BW_Tooltip_Reference.BW); + return tt; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setByte("glasTier", glasTier); + aNBT.setInteger("setupphase", setupphase); + aNBT.setBoolean("isIC2Mode", isIC2Mode); + aNBT.setInteger("mStorageSize", mStorage.size()); + for(int i = 0; i < mStorage.size(); i++) + aNBT.setTag("mStorage." + i, mStorage.get(i).toNBTTagCompound()); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + glasTier = aNBT.getByte("glasTier"); + setupphase = aNBT.getInteger("setupphase"); + isIC2Mode = aNBT.getBoolean("isIC2Mode"); + for(int i = 0; i < aNBT.getInteger("mStorageSize"); i++) + mStorage.add(new GreenHouseSlot(aNBT.getCompoundTag("mStorage." + i))); + } + + @SideOnly(Side.CLIENT) + public void spawnVisualCrop(World world, int x, int y, int z, int meta, int age){ + BW_CropVisualizer crop = new BW_CropVisualizer(world, x, y, z, meta, age); + Minecraft.getMinecraft().effectRenderer.addEffect(crop); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if(aBaseMetaTileEntity.isClientSide()) + { + if(aBaseMetaTileEntity.isActive() && aTick % 40 == 0) { + for(int x = -1; x <= 1; x++) + for(int z = -1; z <= 1; z++) { + if(x == 0 && z == 0) + continue; + int[] abc = new int[]{x, -2, z+2}; + int[] xyz = new int[]{0, 0, 0}; + this.getExtendedFacing().getWorldOffset(abc, xyz); + xyz[0] += aBaseMetaTileEntity.getXCoord(); + xyz[1] += aBaseMetaTileEntity.getYCoord(); + xyz[2] += aBaseMetaTileEntity.getZCoord(); + spawnVisualCrop(aBaseMetaTileEntity.getWorld(), xyz[0], xyz[1], xyz[2], aBaseMetaTileEntity.getRandomNumber(8), 40); + } + } + } + if(aBaseMetaTileEntity.isServerSide() && this.mMaxProgresstime > 0 && setupphase > 0 && aTick % 5 == 0) + { + if(setupphase == 1 && mStorage.size() < mMaxSlots) { + List inputs = getStoredInputs(); + for (ItemStack input : inputs) + if (addCrop(input)) + break; + this.updateSlots(); + } + else if(setupphase == 2 && mStorage.size() > 0) + { + this.addOutput(this.mStorage.get(0).input.copy()); + this.mStorage.remove(0); + this.updateSlots(); + } + } + } + + @Override + public void construct(ItemStack itemStack, boolean b) { + buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 2, 5, 0); + } + + @Override + public boolean isCorrectMachinePart(ItemStack itemStack) { + return true; + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + long v = this.getMaxInputVoltage(); + int tier = GT_Utility.getTier(v); + if(tier < (isIC2Mode ? 8 : 4)) + mMaxSlots = 0; + else if(isIC2Mode) + mMaxSlots = 4 << (2 * (tier - 8)); + else + mMaxSlots = Math.max((tier - 4) * 2, 1); + if(mStorage.size() > mMaxSlots) + { + // Void if user just downgraded power + for(int i = mMaxSlots; i < mStorage.size(); i++) + { + mStorage.remove(i); + i--; + } + } + if(setupphase > 0) { + if((mStorage.size() >= mMaxSlots && setupphase == 1) || (mStorage.size() == 0 && setupphase == 2)) + return false; + this.mMaxProgresstime = 20; + this.mEUt = 0; + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + return true; + } + if(mStorage.isEmpty()) + return false; + + waterusage = 0; + for(GreenHouseSlot s : mStorage) + waterusage += s.input.stackSize; + + if(!depleteInput(new FluidStack(FluidRegistry.WATER, waterusage * 1000))) + return false; + + // OVERCLOCK + if(isIC2Mode) + { + if(glasTier < 8) + return false; + this.mMaxProgresstime = 100; + List outputs = new ArrayList<>(); + for (int i = 0; i < Math.min(mMaxSlots, mStorage.size()); i++) + outputs.addAll(mStorage.get(i).getIC2Drops(this.mMaxProgresstime / 8)); + this.mOutputItems = outputs.toArray(new ItemStack[0]); + } + else { + this.mMaxProgresstime = Math.max(20, 100 / (tier - 3)); // Min 1 s + List outputs = new ArrayList<>(); + for (int i = 0; i < Math.min(mMaxSlots, mStorage.size()); i++) { + for (ItemStack drop : mStorage.get(i).getDrops()) + outputs.add(drop.copy()); + } + this.mOutputItems = outputs.toArray(new ItemStack[0]); + } + this.mEUt = -(int)((double)v * 0.99d); + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + return true; + } + + + @Override + public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + mCasing = 0; + glasTier = 0; + + if(!checkPiece(STRUCTURE_PIECE_MAIN, 2, 5, 0)) + return false; + + if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) + for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) + if (this.glasTier < hatchEnergy.mTier) + return false; + + return this.mMaintenanceHatches.size() == 1 && + this.mEnergyHatches.size() >= 1 && + this.mCasing >= 70; + } + + @Override + public int getMaxEfficiency(ItemStack itemStack) { + return 10000; + } + + @Override + public int getDamageToComponent(ItemStack itemStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack itemStack) { + return false; + } + + @Override + public String[] getInfoData() { + List info = new ArrayList<>(Arrays.asList( + "Running in mode: " + EnumChatFormatting.GREEN + (setupphase == 0 ? (isIC2Mode ? "IC2 crops" : "Normal crops") : ("Setup mode " + (setupphase == 1 ? "(input)" : "(output)"))) + EnumChatFormatting.RESET, + "Uses " + waterusage * 1000 + "L/s of water", + "Max slots: " + EnumChatFormatting.GREEN + this.mMaxSlots + EnumChatFormatting.RESET, + "Used slots: " + EnumChatFormatting.GREEN + this.mStorage.size() + EnumChatFormatting.RESET + )); + for(int i = 0; i < mStorage.size(); i++) + info.add("Slot " + i + ": " + EnumChatFormatting.GREEN + "x" + this.mStorage.get(i).input.stackSize + " " + this.mStorage.get(i).input.getDisplayName() + EnumChatFormatting.RESET); + info.addAll(Arrays.asList(super.getInfoData())); + return info.toArray(new String[0]); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + if (aActive) + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow().build()}; + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow().build()}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + } + + public List mStorage = new ArrayList<>(); + + public boolean addCrop(ItemStack input){ + if(!isIC2Mode) + for(GreenHouseSlot g : mStorage) + if(GT_Utility.areStacksEqual(g.input, input)) + { + g.addAll(this.getBaseMetaTileEntity().getWorld(), input); + if(input.stackSize == 0) + return true; + } + GreenHouseSlot h = new GreenHouseSlot(this, input.copy(), true, isIC2Mode); + if(h.isValid) { + if(isIC2Mode) + input.stackSize--; + else + input.stackSize = 0; + mStorage.add(h); + return true; + } + return false; + } + + private static class GreenHouseSlot extends InventoryCrafting { + + ItemStack input; + BlockCrops crop; + List drops; + boolean isValid; + boolean isIC2Crop; + int growthticks; + List> generations; + + Random rn; + IRecipe recipe; + ItemStack recipeInput; + + public NBTTagCompound toNBTTagCompound(){ + NBTTagCompound aNBT = new NBTTagCompound(); + aNBT.setTag("input", input.writeToNBT(new NBTTagCompound())); + if(!isIC2Crop) { + aNBT.setInteger("crop", Block.getIdFromBlock(crop)); + aNBT.setInteger("dropscount", drops.size()); + for (int i = 0; i < drops.size(); i++) + aNBT.setTag("drop." + i, drops.get(i).writeToNBT(new NBTTagCompound())); + } + else { + aNBT.setInteger("generationscount", generations.size()); + for(int i = 0; i < generations.size(); i++) + { + aNBT.setInteger("generation." + i + ".count", generations.get(i).size()); + for(int j = 0; j < generations.get(i).size(); j++) + aNBT.setTag("generation." + i + "." + j, generations.get(i).get(j).writeToNBT(new NBTTagCompound())); + } + } + aNBT.setBoolean("isValid", isValid); + aNBT.setBoolean("isIC2Crop", isIC2Crop); + if(isIC2Crop) aNBT.setInteger("growthticks", growthticks); + return aNBT; + } + + public GreenHouseSlot(NBTTagCompound aNBT){ + super(null, 3, 3); + isIC2Crop = aNBT.getBoolean("isIC2Crop"); + isValid = aNBT.getBoolean("isValid"); + input = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("input")); + if(!isIC2Crop) { + crop = (BlockCrops) Block.getBlockById(aNBT.getInteger("crop")); + drops = new ArrayList<>(); + for (int i = 0; i < aNBT.getInteger("dropscount"); i++) + drops.add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("drop." + i))); + } + else + { + generations = new ArrayList<>(); + for(int i = 0; i < aNBT.getInteger("generationscount"); i++) + { + generations.add(new ArrayList<>()); + for(int j = 0; j < aNBT.getInteger("generation." + i + ".count"); j++) + generations.get(i).add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("generation." + i + "." + j))); + } + growthticks = aNBT.getInteger("growthticks"); + rn = new Random(); + } + } + + public boolean addAll(World world, ItemStack input){ + if(!GT_Utility.areStacksEqual(this.input, input)) + return false; + if(this.input.stackSize == 64) + return false; + int toconsume = Math.min(64 - this.input.stackSize, input.stackSize); + int left = addDrops(world, toconsume, true); + input.stackSize -= toconsume - left; + return left == 0; + } + + public boolean findCropRecipe(World world){ + if(recipe != null) + return true; + out : for (ItemStack drop : drops) { + recipeInput = drop; + for (int j = 0; j < CraftingManager.getInstance().getRecipeList().size(); j++) { + recipe = (IRecipe) CraftingManager.getInstance().getRecipeList().get(j); + if (recipe.matches(this, world) && GT_Utility.areStacksEqual(recipe.getCraftingResult(this), input)) { + break out; + } else + recipe = null; + } + } + return recipe != null; + } + + @Override + public ItemStack getStackInSlot(int p_70301_1_) { + if(p_70301_1_ == 0) + return recipeInput.copy(); + return null; + } + + @Override + public ItemStack getStackInSlotOnClosing(int par1) { + return null; + } + + @Override + public ItemStack decrStackSize(int par1, int par2) + { + return null; + } + + @Override + public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { + return; + } + + public GreenHouseSlot(GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, ItemStack input, boolean autocraft, boolean IC2){ + super(null, 3, 3); + World world = tileEntity.getBaseMetaTileEntity().getWorld(); + this.input = input.copy(); + this.isValid = false; + if(IC2) + { + GreenHouseSlotIC2(tileEntity, world, input); + return; + } + if (!(input.getItem() instanceof ItemSeeds)) { + return; + } + Block b = ((ItemSeeds) input.getItem()).getPlant(world, 0, 0, 0); + if (!(b instanceof BlockCrops)) + return; + crop = (BlockCrops) b; + isIC2Crop = false; + if(addDrops(world, input.stackSize, autocraft) == 0){ + this.isValid = true; + } + } + + public void GreenHouseSlotIC2(GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, World world, ItemStack input){ + if(!ItemList.IC2_Crop_Seeds.isStackEqual(input, true, true)) + return; + CropCard cc = Crops.instance.getCropCard(input); + if(cc.tier() > 15) // dont process primordial + return; + this.input.stackSize = 1; + NBTTagCompound nbt = input.getTagCompound(); + byte gr = nbt.getByte("growth"); + byte ga = nbt.getByte("gain"); + byte re = nbt.getByte("resistance"); + this.isIC2Crop = true; + int[] abc = new int[]{0, -2, 3}; + int[] xyz = new int[]{0, 0, 0}; + tileEntity.getExtendedFacing().getWorldOffset(abc, xyz); + xyz[0] += tileEntity.getBaseMetaTileEntity().getXCoord(); + xyz[1] += tileEntity.getBaseMetaTileEntity().getYCoord(); + xyz[2] += tileEntity.getBaseMetaTileEntity().getZCoord(); + try{ + world.setBlock(xyz[0], xyz[1], xyz[2], Block.getBlockFromItem(Ic2Items.crop.getItem()), 0, 3); + TileEntity wte = world.getTileEntity(xyz[0], xyz[1], xyz[2]); + if(!(wte instanceof TileEntityCrop)) + { + // should not be even possible + return; + } + TileEntityCrop te = (TileEntityCrop)wte; + te.ticker = 1; // dont even think about ticking once + te.setCrop(cc); + te.setSize((byte) cc.maxSize()); + te.setGrowth(gr); + te.setGain(ga); + te.setResistance(re); + + if(!cc.canBeHarvested(te)) + return; + // GENERATE DROPS + generations = new ArrayList<>(); + for(int i = 0; i < 10; i++) // get 10 generations + { + ItemStack[] st = te.harvest_automated(false); + te.setSize((byte) cc.maxSize()); + if (st == null){ + i--; + continue; + } + if (st.length == 0) + continue; + generations.add(new ArrayList<>(Arrays.asList(st))); + } + if(generations.isEmpty()) + return; + rn = new Random(); + input.stackSize --; + + // CHECK GROWTH SPEED + te.humidity = 12; // humidity with full water storage + te.airQuality = 6; // air quality when sky is seen + te.nutrients = 8; // netrients with full nutrient storage + + int dur = cc.growthDuration(te); + int rate = te.calcGrowthRate(); + if(rate == 0) // should not be possible with those stats + return; + growthticks = dur / rate; + if(growthticks < 1) + growthticks = 1; + + this.isValid = true; + } + catch (Exception e){ + e.printStackTrace(System.err); + } + finally { + world.setBlockToAir(xyz[0], xyz[1], xyz[2]); + } + } + + public List getDrops(){ + return drops; + } + + Map dropprogress = new HashMap<>(); + static Map dropstacks = new HashMap<>(); + + public List getIC2Drops(int timeelapsed){ + int r = rn.nextInt(10); + if(generations.size() <= r) + return new ArrayList<>(); + double growthPercent = ((double)timeelapsed / (double)growthticks); + List generation = generations.get(r); + List copied = new ArrayList<>(); + for(ItemStack g : generation) + copied.add(g.copy()); + for(ItemStack s : copied) + { + double pro = ((double)s.stackSize * growthPercent); + s.stackSize = 1; + if(dropprogress.containsKey(s.toString())) + dropprogress.put(s.toString(), dropprogress.get(s.toString()) + pro); + else + dropprogress.put(s.toString(), pro); + if(!dropstacks.containsKey(s.toString())) + dropstacks.put(s.toString(), s.copy()); + } + copied.clear(); + for(Map.Entry entry : dropprogress.entrySet()) + if(entry.getValue() >= 1d) + { + copied.add(dropstacks.get(entry.getKey()).copy()); + copied.get(copied.size()-1).stackSize = entry.getValue().intValue(); + entry.setValue(entry.getValue() - (double)entry.getValue().intValue()); + } + return copied; + } + + public int addDrops(World world, int count, boolean autocraft){ + drops = new ArrayList<>(); + for(int i = 0; i < count; i++) { + List d = crop.getDrops(world, 0, 0, 0, 7, 0); + for(ItemStack x : drops) + for(ItemStack y : d) + if(GT_Utility.areStacksEqual(x, y)) + { + x.stackSize += y.stackSize; + y.stackSize = 0; + } + for(ItemStack x : d) + if(x.stackSize > 0) + drops.add(x.copy()); + } + for(int i = 0; i < drops.size(); i++) + { + if(GT_Utility.areStacksEqual(drops.get(i), input)) + { + int took = Math.min(drops.get(i).stackSize, count); + drops.get(i).stackSize -= took; + count -= took; + if(drops.get(i).stackSize == 0) { + drops.remove(i); + i--; + } + if(count == 0) { + return 0; + } + } + } + if(autocraft) + { + if(!findCropRecipe(world)) + return count; + int totake = count / recipe.getCraftingResult(this).stackSize + 1; + for(int i = 0; i < drops.size(); i++) { + if(GT_Utility.areStacksEqual(drops.get(i), recipeInput)) { + int took = Math.min(drops.get(i).stackSize, totake); + drops.get(i).stackSize -= took; + totake -= took; + if (drops.get(i).stackSize == 0) { + drops.remove(i); + i--; + } + if(totake == 0) { + return 0; + } + } + } + } + return count; + } + } + + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 3c9d4792b3..e405475de6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElement; @@ -139,7 +140,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Breeder Reactor") .addInfo("Controller block for the High Temperature Gas-cooled Reactor (HTGR)") .addInfo("Needs a constant supply of coolant while running") @@ -160,7 +161,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase .addOutputHatch("Any bottom layer casing", 1) .addEnergyHatch("Any bottom layer casing", 1) .addMaintenanceHatch("Any bottom layer casing", 1) - .toolTipFinisher("Bartworks"); + .toolTipFinisher("Added by " + ChatColorHelper.GOLD + "kuba6000" + ChatColorHelper.RESET + " via " + BW_Tooltip_Reference.BW); return tt; } @@ -247,7 +248,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public boolean checkRecipe(ItemStack controllerStack) { - + if(this.empty) { if(this.HeliumSupply > 0 || this.fuelsupply > 0){ @@ -278,7 +279,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase new ItemStack(HTGRMaterials.aHTGR_Materials, burnedballs, meta), new ItemStack(HTGRMaterials.aHTGR_Materials, toReduce, meta + 1) }; - + //this.updateSlots(); // not needed ? this.coolanttaking = (int)(4000D * (((this.fueltype * 0.5D) + 1)) * eff); @@ -288,7 +289,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase this.mMaxProgresstime=72000; return true; } - + private int runningtick = 0; @Override @@ -349,7 +350,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } } } - + if(drainedamount > 0) addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount)); @@ -358,11 +359,11 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase if(takecoolant > 0) this.stopMachine(); } - + return true; } - + @Override public int getMaxEfficiency(ItemStack itemStack) { @@ -430,8 +431,8 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase GT_Utility.sendChatToPlayer(aPlayer, "HTGR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); } - - + + public static class HTGRMaterials{ private static class CustomHTGRSimpleSubItemClass extends SimpleSubItemClass{ @@ -494,8 +495,8 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase this.sEnglish = b; } } - - static final Base_[] sHTGR_Bases = new Base_[]{ + + static final Base_[] sHTGR_Bases = new Base_[]{ new Base_("HTGRFuelMixture", "HTGR fuel mixture"), new Base_("BISOPebbleCompound", "BISO pebble compound"), new Base_("TRISOPebbleCompound", "TRISO pebble compound"), @@ -508,19 +509,19 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase static final int USABLE_FUEL_INDEX = 4; static final int BURNED_OUT_FUEL_INDEX = 5; static final Fuel_[] sHTGR_Fuel = new Fuel_[]{ - new Fuel_("Thorium", "Thorium", WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 64), Materials.Uranium235.getDust(4), - GT_Values.NF, new ItemStack[]{ + new Fuel_("Thorium", "Thorium", WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 64), Materials.Uranium235.getDust(4), + GT_Values.NF, new ItemStack[]{ Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), Materials.Lutetium.getDust(1), WerkstoffLoader.Thorium232.get(OrePrefixes.dust,1)}, new int[]{9000, 9000, 9000, 9000, 1000}, "Multiplies coolant by 1"), - new Fuel_("Uranium", "Uranium", Materials.Uranium.getDust(64), Materials.Uranium235.getDust(8), - FluidRegistry.getFluidStack("krypton", 8), new ItemStack[]{ + new Fuel_("Uranium", "Uranium", Materials.Uranium.getDust(64), Materials.Uranium235.getDust(8), + FluidRegistry.getFluidStack("krypton", 8), new ItemStack[]{ Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), Materials.Lead.getDust(1), Materials.Uranium.getDust(1)}, new int[]{9000, 9000, 9000, 7000, 1000}, "Multiplies coolant by 1.5"), - new Fuel_("Plutonium", "Plutonium", Materials.Plutonium.getDust(64), Materials.Plutonium241.getDust(4), - FluidRegistry.getFluidStack("xenon", 8), new ItemStack[]{ + new Fuel_("Plutonium", "Plutonium", Materials.Plutonium.getDust(64), Materials.Plutonium241.getDust(4), + FluidRegistry.getFluidStack("xenon", 8), new ItemStack[]{ Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), Materials.Lead.getDust(1), Materials.Plutonium.getDust(1)}, @@ -543,7 +544,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } aHTGR_Materials = new CustomHTGRSimpleSubItemClass(tooltip, sHTGR_Materials); } - + public static void registeraTHR_Materials(){ for(LangEntry_ iName : aHTGR_Localizations) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java index be3c46fd06..1c2cf770e8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java @@ -160,7 +160,7 @@ public abstract class GT_TileEntity_MegaMultiBlockBase Date: Sat, 16 Apr 2022 18:01:31 +0900 Subject: Add a way to bypass osmirium replacement (#119) Former-commit-id: 0698945beec7cce1cb65cea1072b6e896436e24e --- .../system/material/GT_Enhancement/LuVTierEnhancer.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java index 21735f43b0..f5ee1e303a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -52,6 +52,12 @@ import static gregtech.api.enums.OrePrefixes.*; @SuppressWarnings("ALL") public class LuVTierEnhancer implements Runnable { + private static List blackListForOsmiridium = new ArrayList<>(); + + static { + addToBlackListForOsmiridiumReplacement(ItemList.Casing_MiningOsmiridium.get(1)); + } + public void run() { List bufferedRecipeList = null; @@ -91,6 +97,10 @@ public class LuVTierEnhancer implements Runnable { AfterLuVTierEnhacement.run(); } + public static void addToBlackListForOsmiridiumReplacement(ItemStack stack) { + blackListForOsmiridium.add(stack); + } + private static void replaceAllRecipes(Collection LuVMachines, OrePrefixes[] LuVMaterialsGenerated, List bufferedRecipeList){ LuVTierEnhancer.replaceOsmiridiumInLuVRecipes(); @@ -211,7 +221,7 @@ public class LuVTierEnhancer implements Runnable { } private static boolean isOutputBlackListed(ItemStack output) { - if (output.isItemEqual(ItemList.Casing_MiningOsmiridium.get(1))) return true; + if (blackListForOsmiridium.stream().anyMatch(s -> s.isItemEqual(output))) return true; return false; } -- cgit From 25062bc40b54a5f89e7f47faa70815dd38f00101 Mon Sep 17 00:00:00 2001 From: MuXiu1997 Date: Sun, 17 Apr 2022 15:13:16 +0800 Subject: Add a line in the scan result of the bacterial vat to see its current efficiency (#118) * Refactor * Add info data * Fix things Former-commit-id: fc8ce830edaad436c77c745c0637c16e725d57d6 --- .../tileentities/multis/GT_TileEntity_BioVat.java | 153 +++++++++++++-------- .../resources/assets/bartworks/lang/en_US.lang | 2 + .../resources/assets/bartworks/lang/zh_CN.lang | 3 + 3 files changed, 100 insertions(+), 58 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 993099521d..094879cab0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -29,7 +29,11 @@ import com.github.bartimaeusnek.bartworks.common.items.LabParts; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.net.RendererPacket; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; -import com.github.bartimaeusnek.bartworks.util.*; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.BioCulture; +import com.github.bartimaeusnek.bartworks.util.Coords; +import com.github.bartimaeusnek.bartworks.util.MathUtils; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -51,6 +55,8 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.common.util.ForgeDirection; @@ -58,12 +64,21 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.util.*; -import java.util.stream.Collectors; +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.isAir; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static gregtech.api.enums.Textures.BlockIcons.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAnyMeta; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; @@ -85,6 +100,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa private int mSievert; private int mNeededSievert; private int mCasing = 0; + private int mExpectedTimes = 0; + private int mTimes = 0; public GT_TileEntity_BioVat(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -224,6 +241,21 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa return BWRecipes.instance.getMappingsFor(BWRecipes.BACTERIALVATBYTE); } + /** + * Calculates the expected output multiplier based on the output hatch + * @param recipeFluidOutput the recipe fluid output + * @param needEqual if the recipeFluidOutput should be equal to the fluid in the output hatch + * @return the expected output multiplier + */ + private int getExpectedTimes(@Nullable FluidStack recipeFluidOutput, boolean needEqual) { + FluidStack storedFluidOutputs = this.getStoredFluidOutputs(); + if (storedFluidOutputs == null) return 1; + if (!needEqual || storedFluidOutputs.isFluidEqual(recipeFluidOutput)) { + return this.calcMod(storedFluidOutputs.amount) + 1; + } + return 1; + } + private int calcMod(double x) { double y = (((double) this.getOutputCapacity()) / 2D), z = ConfigHandler.bioVatMaxParallelBonus; @@ -276,80 +308,67 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa public boolean checkRecipe(ItemStack itemStack) { GT_Recipe.GT_Recipe_Map gtRecipeMap = this.getRecipeMap(); - if (gtRecipeMap == null) - return false; + if (gtRecipeMap == null) return false; ItemStack[] tInputs = getItemInputs().toArray(new ItemStack[0]); FluidStack[] tFluids = getFluidInputs().toArray(new FluidStack[0]); - if (tFluids.length > 0) { + if (tFluids.length <= 0) return false; - GT_Recipe gtRecipe = gtRecipeMap.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, this.getMaxInputVoltage(), tFluids, itemStack, tInputs); + GT_Recipe gtRecipe = gtRecipeMap.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, this.getMaxInputVoltage(), tFluids, itemStack, tInputs); - if (gtRecipe == null) - return false; + if (gtRecipe == null) return false; - if (!BW_Util.areStacksEqualOrNull((ItemStack) gtRecipe.mSpecialItems, itemStack)) - return false; + assert gtRecipe.mFluidInputs.length == 1; + assert gtRecipe.mFluidOutputs.length == 1; - int[] conditions = GT_TileEntity_BioVat.specialValueUnpack(gtRecipe.mSpecialValue); + if (!BW_Util.areStacksEqualOrNull((ItemStack) gtRecipe.mSpecialItems, itemStack)) return false; - this.mNeededSievert = conditions[3]; + int[] conditions = GT_TileEntity_BioVat.specialValueUnpack(gtRecipe.mSpecialValue); - if (conditions[2] == 0 ? - (this.mSievert < this.mNeededSievert || this.mGlassTier < conditions[0]) - : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0])) - return false; + this.mNeededSievert = conditions[3]; - int times = 1; + if (conditions[2] == 0 ? + (this.mSievert < this.mNeededSievert || this.mGlassTier < conditions[0]) + : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0])) + return false; - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; + this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; - Set storedFluidOutputs = this.getStoredFluidOutputs(); + if (!gtRecipe.isRecipeInputEqual(true, tFluids, tInputs)) return false; - if (gtRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { - if (storedFluidOutputs.size() > 0) { - this.mOutputFluids = new FluidStack[gtRecipe.mFluidOutputs.length]; - for (FluidStack storedOutputFluid : storedFluidOutputs) { - if (storedOutputFluid.isFluidEqual(gtRecipe.getFluidOutput(0))) - for (FluidStack inputFluidStack : gtRecipe.mFluidInputs) { - int j = this.calcMod(storedOutputFluid.amount); - for (int i = 0; i < j; i++) - if (this.depleteInput(inputFluidStack)) - times++; - } - } - for (FluidStack storedfluidStack : storedFluidOutputs) { - for (int i = 0; i < gtRecipe.mFluidOutputs.length; i++) { - if (storedfluidStack.isFluidEqual(gtRecipe.getFluidOutput(i))) - this.mOutputFluids[i] = (new FluidStack(gtRecipe.getFluidOutput(i), times * gtRecipe.getFluidOutput(0).amount)); - } + final FluidStack recipeFluidOutput = gtRecipe.getFluidOutput(0); + final FluidStack recipeFluidInput = gtRecipe.mFluidInputs[0]; - } - } else { - this.mOutputFluids = gtRecipe.mFluidOutputs; - } - } else - return false; + this.mExpectedTimes = this.getExpectedTimes(recipeFluidOutput, true); - BW_Util.calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, this.getMaxInputVoltage(), this); + this.mTimes = 1; + for (int i = 1; i < this.mExpectedTimes; i++) { + if (this.depleteInput(recipeFluidInput)) { + this.mTimes++; + } + } - if (this.mEUt > 0) - this.mEUt = -this.mEUt; - this.mProgresstime = 0; + this.mOutputFluids = new FluidStack[]{new FluidStack(recipeFluidOutput, recipeFluidOutput.amount * this.mTimes)}; - if (gtRecipe.mCanBeBuffered) - this.mLastRecipe = gtRecipe; + BW_Util.calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, this.getMaxInputVoltage(), this); - this.updateSlots(); - return true; - } - return false; + if (this.mEUt > 0) + this.mEUt = -this.mEUt; + this.mProgresstime = 0; + + if (gtRecipe.mCanBeBuffered) + this.mLastRecipe = gtRecipe; + + this.updateSlots(); + return true; } - public Set getStoredFluidOutputs() { - return this.mOutputHatches.stream().map(GT_MetaTileEntity_Hatch_Output::getFluid).filter(Objects::nonNull).collect(Collectors.toSet()); + public FluidStack getStoredFluidOutputs() { + // Only one output Hatch + assert this.mOutputHatches.size() == 1; + return this.mOutputHatches.get(0).getFluid(); } private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity, int CasingIndex) { @@ -559,6 +578,12 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa if (this.getBaseMetaTileEntity().isActive() && this.mNeededSievert > this.mSievert) this.mOutputFluids = null; } + if (aBaseMetaTileEntity.isServerSide()) { + if (this.mMaxProgresstime <= 0) { + this.mTimes = 0; + this.mMaxProgresstime = 0; + } + } } @Override @@ -649,4 +674,16 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa public void construct(ItemStack itemStack, boolean b) { buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 2, 3, 0); } + + @Override + public String[] getInfoData() { + final String[] baseInfoData = super.getInfoData(); + final String[] infoData = new String[baseInfoData.length + 2]; + System.arraycopy(baseInfoData, 0, infoData, 0, baseInfoData.length); + infoData[infoData.length - 2] = StatCollector.translateToLocal("BW.infoData.BioVat.expectedProduction") + ": " + + EnumChatFormatting.GREEN + (mMaxProgresstime <= 0 ? getExpectedTimes(null, false) : mExpectedTimes) * 100 + EnumChatFormatting.RESET + " %"; + infoData[infoData.length - 1] = StatCollector.translateToLocal("BW.infoData.BioVat.production") + ": " + + EnumChatFormatting.GREEN + (mMaxProgresstime <= 0 ? 0 : mTimes) * 100 + EnumChatFormatting.RESET + " %"; + return infoData; + } } diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index b556a2bfe5..a13642b7fd 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -167,4 +167,6 @@ solarsystem.Ross128System=Ross128-System itemGroup.bw.MetaItems.0=BartWorks Circuit Overhaul Items +BW.infoData.BioVat.expectedProduction=Expected Production +BW.infoData.BioVat.production=Production #Liquids diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index b21456ded1..6746def6a5 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -151,4 +151,7 @@ star.Ross128=罗斯128 solarsystem.Ross128System=罗斯128星系 itemGroup.bw.MetaItems.0=BartWorks电路更新物品 + +BW.infoData.BioVat.expectedProduction=预期产量 +BW.infoData.BioVat.production=产量 #This zh_CN.lang is translated by huajijam for bartworks (19/7/19) -- cgit From 83a5a29cc744e45d35cb46451d0395759f3f37b2 Mon Sep 17 00:00:00 2001 From: miozune Date: Sat, 23 Apr 2022 00:28:09 +0900 Subject: Fix EV Laser Hatches consume 0L of soldering (#121) Former-commit-id: dabe2df9ff036afc72a4ef613087b6148d6ca7e0 --- .../bartimaeusnek/bartworks/common/loaders/RecipeLoader.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index ed946a3c1d..a8128e12d2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -937,6 +937,7 @@ public class RecipeLoader { ItemStack eInput = input[j][i]; ItemStack eDynamo = dynamo[j][i]; + int solderingAmount = Math.max(144 * i, 72) * (j + 1); GT_Values.RA.addAssemblerRecipe( new ItemStack[]{ new ItemStack(ItemRegistry.TecTechPipeEnergyLowPower.getItem(), ((j + 1) * 16), ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), @@ -946,7 +947,7 @@ public class RecipeLoader { sensors[i].get(2 * (j + 1)), ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1)), }, - Materials.SolderingAlloy.getMolten(144 * i * (j + 1)), + Materials.SolderingAlloy.getMolten(solderingAmount), converter, 200 * (j + 1), BW_Util.getMachineVoltageFromTier(4 + i)); @@ -958,7 +959,7 @@ public class RecipeLoader { sensors[i].get(2 * (j + 1)), ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1)), }, - Materials.SolderingAlloy.getMolten(144 * i * (j + 1)), + Materials.SolderingAlloy.getMolten(solderingAmount), eInput, 200 * (j + 1), BW_Util.getMachineVoltageFromTier(4 + i)); @@ -970,7 +971,7 @@ public class RecipeLoader { emitters[i].get(2 * (j + 1)), ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1)), }, - Materials.SolderingAlloy.getMolten(144 * i * (j + 1)), + Materials.SolderingAlloy.getMolten(solderingAmount), eDynamo, 200 * (j + 1), BW_Util.getMachineVoltageFromTier(4 + i)); -- cgit From 35d6cdfa50e85e2cd37301732879c32e577b9186 Mon Sep 17 00:00:00 2001 From: MuXiu1997 Date: Sun, 24 Apr 2022 16:57:15 +0800 Subject: Void miners Blacklist config (#117) * Void miners Blacklist config * Fix things Former-commit-id: ecb7ed00a5b287ef0e87f7ec32623717341008be --- .../bartworks/common/configs/ConfigHandler.java | 8 +++++++- .../crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java | 12 ++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 11c97e6b8e..5a810c82cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -23,11 +23,14 @@ package com.github.bartimaeusnek.bartworks.common.configs; -import com.github.bartimaeusnek.bartworks.ASM.BWCoreTransformer; import com.github.bartimaeusnek.bartworks.API.API_ConfigValues; +import com.github.bartimaeusnek.bartworks.ASM.BWCoreTransformer; import net.minecraftforge.common.config.Configuration; import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; public class ConfigHandler { @@ -75,6 +78,8 @@ public class ConfigHandler { public static int pollutionHeatedWaterPumpSecond = 5; public static int basePollutionMBFSecond = 400; + public static Set voidMinerBlacklist = Collections.unmodifiableSet(new HashSet<>()); + private static final int[][] METAFORTIERS_ENERGY = { {100, 101, 102, 105}, {1110, 1115, 1120, 1127}, @@ -136,6 +141,7 @@ public class ConfigHandler { ConfigHandler.DEHPDirectSteam = ConfigHandler.c.get("Multiblocks", "DEHP Direct Steam Mode", false, "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant").getBoolean(false); ConfigHandler.megaMachinesMax = ConfigHandler.c.get("Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256); ConfigHandler.bioVatMaxParallelBonus = ConfigHandler.c.get("Multiblocks","BioVat Maximum Bonus on Recipes", 1000,"This are the maximum parallel Operations the BioVat can do, when the output is half full.").getInt(1000); + ConfigHandler.voidMinerBlacklist = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(ConfigHandler.c.get("Multiblocks", "Void Miner Blacklist", new String[0], "This is a blacklist for the Void Miner, blacklisted ores will not enter the drop prize pool. Please fill in the Unique Identifier of Ore and connect Damage with a colon, For example: gregtech:gt.blockores:32").getStringList()))); ConfigHandler.pollutionHeatedWaterPumpSecond = ConfigHandler.c.get("Pollution", "Pollution produced per second by the water pump", ConfigHandler.pollutionHeatedWaterPumpSecond, "How much should the Simple Stirling Water Pump produce pollution per second").getInt(ConfigHandler.pollutionHeatedWaterPumpSecond); ConfigHandler.basePollutionMBFSecond = ConfigHandler.c.get("Pollution", "Pollution produced per tick by the MBF per ingot", ConfigHandler.basePollutionMBFSecond,"How much should the MBF produce pollution per tick per ingot. Then it'll be multiplied by the amount of ingots done in parallel").getInt(ConfigHandler.basePollutionMBFSecond); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index 2f5dd0c7b9..fbade9d8dc 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -34,6 +34,7 @@ import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer; import com.github.bartimaeusnek.bartworks.util.Pair; import com.google.common.collect.ArrayListMultimap; +import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -231,7 +232,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } private void addDrop(Pair key, float value){ - if(!dropmap.containsKey(key)) + final ItemStack ore = getOreItemStack(key); + if (ConfigHandler.voidMinerBlacklist.contains(String.format("%s:%d", GameRegistry.findUniqueIdentifierFor(ore.getItem()).toString(), ore.getItemDamage()))) + return; + if (!dropmap.containsKey(key)) dropmap.put(key, value); else dropmap.put(key, dropmap.get(key) + value); @@ -426,7 +430,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private void handleOutputs() { Pair stats = getOreDamage(); final List inputOres = this.getStoredInputs().stream().filter(GT_Utility::isOre).collect(Collectors.toList()); - final ItemStack output = new ItemStack(stats.getValue() ? WerkstoffLoader.BWOres : GregTech_API.sBlockOres1, multiplier, stats.getKey()); + final ItemStack output = getOreItemStack(stats); if (inputOres.size() == 0 || (mBlacklist && inputOres.stream().allMatch(is -> !GT_Utility.areStacksEqual(is, output))) || (!mBlacklist && inputOres.stream().anyMatch(is -> GT_Utility.areStacksEqual(is, output))) @@ -434,6 +438,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri this.updateSlots(); } + private ItemStack getOreItemStack(Pair stats) { + return new ItemStack(stats.getValue() ? WerkstoffLoader.BWOres : GregTech_API.sBlockOres1, multiplier, stats.getKey()); + } + @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { mBlacklist = !mBlacklist; -- cgit From c4a686a4f7c733c96194148ed087465cf1297378 Mon Sep 17 00:00:00 2001 From: MuXiu1997 Date: Sun, 24 Apr 2022 17:20:11 +0800 Subject: Modify the localization of `Werkstoff` and `BWGTMetaItems` (#115) * Modify the localization of `Werkstoff` and `BWGTMetaItems` * Ascending Former-commit-id: d3b111eb8923cf18f3f41309d34a1febdca63f03 --- .../system/material/BW_MetaGenerated_Items.java | 14 +++---- .../material/GT_Enhancement/BWGTMetaItems.java | 43 +++++++++++++++++----- .../bartworks/system/material/Werkstoff.java | 41 ++++++++++++++++++--- 3 files changed, 76 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index ab38546756..56dfb0c138 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -68,22 +68,23 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa }; protected final OrePrefixes orePrefixes; + protected final String itemTypeLocalizedName; public BW_MetaGenerated_Items(OrePrefixes orePrefixes, Object unused){ super("bwMetaGeneratedGTEnhancement" + orePrefixes.name(), (short) 32766, (short) 0); this.orePrefixes = orePrefixes; + this.itemTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.itemtype." + orePrefixes, orePrefixes.mLocalizedMaterialPre + "%material" + orePrefixes.mLocalizedMaterialPost); } public BW_MetaGenerated_Items(OrePrefixes orePrefixes) { super("bwMetaGenerated" + orePrefixes.name(), (short) 32766, (short) 0); this.orePrefixes = orePrefixes; + this.itemTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.itemtype." + orePrefixes, orePrefixes.mLocalizedMaterialPre + "%material" + orePrefixes.mLocalizedMaterialPost); this.setCreativeTab(BW_MetaGenerated_Items.metaTab); for (Werkstoff w : werkstoffHashSet) { ItemStack tStack = new ItemStack(this, 1, w.getmID()); if (!w.hasItemType(this.orePrefixes)) continue; - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", this.getDefaultLocalization(w)); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.getVarName(), tStack); } } @@ -136,13 +137,12 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } - public String getDefaultLocalization(Werkstoff werkstoff) { - return werkstoff != null ? this.orePrefixes.mLocalizedMaterialPre + werkstoff.getDefaultName() + this.orePrefixes.mLocalizedMaterialPost : Werkstoff.default_null_Werkstoff.getDefaultName(); - } - @Override public String getItemStackDisplayName(ItemStack aStack) { - return GT_LanguageManager.getTranslation(this.getUnlocalizedName(aStack) + ".name"); + int aMetaData = aStack.getItemDamage(); + Werkstoff werkstoff = werkstoffHashMap.get((short) aMetaData); + if (werkstoff == null) werkstoff = Werkstoff.default_null_Werkstoff; + return itemTypeLocalizedName.replace("%material", werkstoff.getLocalizedName()); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java index 4310d06156..006afcb5f9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -27,6 +27,7 @@ import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Materials; @@ -34,11 +35,11 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; -import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -71,9 +72,6 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { hiddenThings.add(i); continue; } - - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", getDefaultLocalization(material)); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", material.getToolTip()); GT_OreDictUnificator.registerOre(this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ",""), tStack); } @@ -92,14 +90,43 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { hiddenThings.add(i); continue; } - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", getDefaultLocalization(w)); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); } } } + private Materials getMaterial(ItemStack is) { + if (is == null || is.getItem() != this) + return null; + final int meta = is.getItemDamage(); + Materials material; + if (meta > 1000 && hasList) + material = NoMetaValue.get(meta - 1001); + else + material = Materials.values()[meta]; + return material; + } + + @Override + public String getItemStackDisplayName(ItemStack aStack) { + Materials material = getMaterial(aStack); + if (material == null) material = Materials._NULL; + return material.getLocalizedNameForItem(itemTypeLocalizedName); + } + + @SuppressWarnings("unchecked") @Override + protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { + Materials material = getMaterial(aStack); + if (material != null) { + if (material.getToolTip() != null) { + aList.add(material.getToolTip()); + } + } + aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); + } + + @Override public IIconContainer getIconContainer(int aMetaData) { if (this.orePrefixes.mTextureIndex == -1) return getIconContainerBartWorks(aMetaData); @@ -110,10 +137,6 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { return Materials.values()[(short) aMetaData].mIconSet.mTextures[this.orePrefixes.mTextureIndex]; } - public String getDefaultLocalization(Materials werkstoff) { - return werkstoff != null ? this.orePrefixes.mLocalizedMaterialPre + werkstoff.mDefaultLocalName + this.orePrefixes.mLocalizedMaterialPost : Materials._NULL.mDefaultLocalName; - } - @Override protected IIconContainer getIconContainerBartWorks(int aMetaData) { if (SideReference.Side.Server || PrefixTextureLinker.texMap == null) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 7ca4af3b6a..035f4f832c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -23,18 +23,36 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; -import com.github.bartimaeusnek.bartworks.util.*; +import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.MurmurHash3; +import com.github.bartimaeusnek.bartworks.util.NonNullWrappedHashMap; +import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; -import gregtech.api.enums.*; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; +import gregtech.api.enums.TC_Aspects; +import gregtech.api.enums.TextureSet; import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import java.lang.reflect.InvocationTargetException; import java.nio.ByteBuffer; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Locale; +import java.util.Objects; +import java.util.Optional; @SuppressWarnings("ALL") public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @@ -55,7 +73,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { private final HashSet SUBTAGS = new HashSet<>(); private byte[] rgb = new byte[3]; private final String defaultName; + private final String localizedName; private String toolTip; + private final String localizedToolTip; private Werkstoff.Stats stats; private final Werkstoff.Types type; @@ -161,10 +181,11 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (type == null) type = Werkstoff.Types.UNDEFINED; + this.mID = (short) mID; this.defaultName = defaultName; + this.localizedName = GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.name", this.mID), defaultName); this.stats = stats; this.type = type; - this.mID = (short) mID; this.generationFeatures = generationFeatures; this.setRgb(BW_ColorUtil.correctCorlorArray(rgba)); this.CONTENTS.addAll(Arrays.asList(contents)); @@ -199,6 +220,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { // if (this.toolTip.length() > 25) // this.toolTip = "The formula is to long..."; + this.localizedToolTip = GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.tooltip", this.mID), toolTip); + if (this.stats.protons == 0) { long tmpprotons = 0; for (Pair p : contents) { @@ -378,6 +401,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.defaultName; } + public String getLocalizedName() { + return this.localizedName; + } + public String getVarName() { return this.defaultName.replaceAll(" ", ""); } @@ -386,6 +413,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.toolTip; } + public String getLocalizedToolTip() { + return this.localizedToolTip; + } + public Werkstoff.Stats getStats() { return this.stats; } @@ -1021,4 +1052,4 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } } -} \ No newline at end of file +} -- cgit From a830c14a9f0ba4476560a9d9ee91e511523c814f Mon Sep 17 00:00:00 2001 From: MuXiu1997 Date: Sun, 24 Apr 2022 17:20:23 +0800 Subject: Modify the localization of `MetaGeneratedBlockItem` (#116) Former-commit-id: adc3bad9f25f279266fb6957af6f864c5b27160b --- .../system/material/BW_MetaGeneratedBlock_Item.java | 15 +++++++++++++-- .../system/material/BW_MetaGeneratedBlocks_Casing.java | 11 ----------- .../system/material/BW_MetaGenerated_Blocks.java | 5 +++++ .../system/material/BW_MetaGenerated_Ores.java | 4 ++-- .../system/material/BW_MetaGenerated_SmallOres.java | 2 +- .../material/BW_MetaGenerated_WerkstoffBlocks.java | 13 ++----------- .../bartworks/system/material/Werkstoff.java | 18 +++++++++--------- 7 files changed, 32 insertions(+), 36 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java index cbde0f80e6..9875da9eab 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java @@ -36,6 +36,8 @@ import net.minecraft.world.World; import java.util.ArrayList; import java.util.List; +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap; + public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { public BW_MetaGeneratedBlock_Item(Block par1) { @@ -51,6 +53,15 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { } public String getItemStackDisplayName(ItemStack aStack) { + Block block = Block.getBlockFromItem(aStack.getItem()); + if (block != null) { + if (block instanceof BW_MetaGenerated_Blocks) { + int aMetaData = aStack.getItemDamage(); + Werkstoff werkstoff = werkstoffHashMap.get((short) aMetaData); + if (werkstoff == null) werkstoff = Werkstoff.default_null_Werkstoff; + return ((BW_MetaGenerated_Blocks) block).blockTypeLocalizedName.replace("%material", werkstoff.getLocalizedName()); + } + } return GT_LanguageManager.getTranslation( getUnlocalizedName(aStack) + ".name"); } @@ -66,7 +77,7 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { } Werkstoff werkstoff = Werkstoff.werkstoffHashMap.get((short) aStack.getItemDamage()); if(werkstoff != null) { - aList.add(werkstoff.getToolTip()); + aList.add(werkstoff.getLocalizedToolTip()); } aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @@ -87,4 +98,4 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { } return true; } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java index e13bca3bf5..9736e27566 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -26,7 +26,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_LanguageManager; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; @@ -86,16 +85,6 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple @Override protected void doRegistrationStuff(Werkstoff tMaterial) { GregTech_API.registerMachineBlock(this, -1); - if (tMaterial == null) return; - if ((tMaterial.doesOreDictedItemExists(OrePrefixes.plate) && tMaterial.doesOreDictedItemExists(OrePrefixes.gearGtSmall)) || (tMaterial.hasItemType(OrePrefixes.plate) && tMaterial.hasItemType(OrePrefixes.gearGtSmall))) { - Optional.of(tMaterial) - .ifPresent(pMaterial -> - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + "." + pMaterial.getmID() + ".name", - _prefixes.mLocalizedMaterialPre + pMaterial.getDefaultName() + _prefixes.mLocalizedMaterialPost - ) - ); - } } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java index 8a2143dba7..ad6e1f24ee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_LanguageManager; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; @@ -43,6 +44,7 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { public static ThreadLocal mTemporaryTileEntity = new ThreadLocal<>(); protected OrePrefixes _prefixes; + protected String blockTypeLocalizedName; public BW_MetaGenerated_Blocks(Material p_i45386_1_, Class tileEntity, String blockName) { this(p_i45386_1_, tileEntity, blockName, null); @@ -55,6 +57,9 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { this.setBlockTextureName("stone"); this.setCreativeTab(metaTab); _prefixes = types; + if (_prefixes != null) { + this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.blocktype." + _prefixes, _prefixes.mLocalizedMaterialPre + "%material" + _prefixes.mLocalizedMaterialPost); + } Werkstoff.werkstoffHashSet.forEach(this::doRegistrationStuff); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 1f86b274af..6e0ad77b8c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -44,6 +44,7 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { public BW_MetaGenerated_Ores(Material p_i45386_1_, Class tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); + this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.blocktype." + OrePrefixes.ore, OrePrefixes.ore.mLocalizedMaterialPre + "%material" + OrePrefixes.ore.mLocalizedMaterialPost); } protected void doRegistrationStuff(Werkstoff w) { @@ -51,7 +52,6 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) return; GT_ModHandler.addValuableOre(this, w.getmID(), 1); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", w.getDefaultName() + OrePrefixes.ore.mLocalizedMaterialPost); } } @@ -127,4 +127,4 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { } return false; } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java index dc1db4303a..d95de69f0a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java @@ -36,6 +36,7 @@ import java.util.Arrays; public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { public BW_MetaGenerated_SmallOres(Material p_i45386_1_, Class tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); + this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.blocktype." + OrePrefixes.oreSmall, OrePrefixes.oreSmall.mLocalizedMaterialPre+"%material" + OrePrefixes.oreSmall.mLocalizedMaterialPost); } @Override @@ -44,7 +45,6 @@ public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) return; GT_ModHandler.addValuableOre(this, w.getmID(), 1); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", "Small " + w.getDefaultName() + OrePrefixes.oreSmall.mLocalizedMaterialPost); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java index 166f9aef8d..d27d50941e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java @@ -34,25 +34,16 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import java.util.List; -import java.util.Optional; public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks { public BW_MetaGenerated_WerkstoffBlocks(Material p_i45386_1_, Class tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); + this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.blocktype." + OrePrefixes.block, OrePrefixes.block.mLocalizedMaterialPre + "%material" + OrePrefixes.block.mLocalizedMaterialPost); } @Override - protected void doRegistrationStuff(Werkstoff tMaterial) { - Optional.ofNullable(tMaterial) - .filter(pMaterial -> pMaterial.hasItemType(OrePrefixes.gem) || pMaterial.hasItemType(OrePrefixes.ingot)) - .ifPresent(pMaterial -> - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + "." + pMaterial.getmID() + ".name", - OrePrefixes.block.mLocalizedMaterialPre + pMaterial.getDefaultName() + OrePrefixes.block.mLocalizedMaterialPost - ) - ); - } + protected void doRegistrationStuff(Werkstoff tMaterial) {} @Override public String getUnlocalizedName() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 035f4f832c..119cf017d2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -105,14 +105,14 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { */ public Werkstoff(Materials materials, Werkstoff.GenerationFeatures generationFeatures, Types type, int mID){ this( materials.mRGBa, - materials.mDefaultLocalName, - materials.getToolTip(), - type == null ? materials.mElement != null ? Types.ELEMENT : Types.UNDEFINED : type, - generationFeatures, - mID, - materials.mIconSet, - (List) materials.mOreByProducts, - new Pair<>(materials, 1) + materials.mDefaultLocalName, + materials.getToolTip(), + type == null ? materials.mElement != null ? Types.ELEMENT : Types.UNDEFINED : type, + generationFeatures, + mID, + materials.mIconSet, + (List) materials.mOreByProducts, + new Pair<>(materials, 1) ); if(!(mID > 31_766 && mID <= 32_767)) throw new IllegalArgumentException(); @@ -492,7 +492,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public float getToolSpeed() { return this.stats.getSpeedOverride() > 0f ? this.stats.getSpeedOverride() : Math.max(1f, - 2f * ((float) -this.getStats().getMass() + 0.1f * (float) this.getStats().getMeltingPoint() + (float) this.getStats().getProtons()) * 0.1f / (float) this.getContents().getKey() * 0.1f * (float) this.getToolQuality() + 2f * ((float) -this.getStats().getMass() + 0.1f * (float) this.getStats().getMeltingPoint() + (float) this.getStats().getProtons()) * 0.1f / (float) this.getContents().getKey() * 0.1f * (float) this.getToolQuality() ); } -- cgit From f0085fb59fbae807c0e241534e05822e150199cf Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Sun, 24 Apr 2022 17:22:53 +0800 Subject: limit progress update interval to prevent too many display buffer swaps (#122) Former-commit-id: 6a05302bfb54e96cbe58ce7d26b33fee08e20f37 --- .../com/github/bartimaeusnek/crossmod/cls/CLSCompat.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java index 930360bef4..13c4de03fb 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java @@ -34,6 +34,8 @@ public class CLSCompat { private CLSCompat() { } + private static final long MINIMAL_UPDATE_INTERVAL = 1000 / 30; // target 30 fps + private static long lastUpdate = 0; private static Class alexiilMinecraftDisplayer; private static Class alexiilProgressDisplayer; private static Method displayProgress; @@ -85,10 +87,14 @@ public class CLSCompat { public static int invokeStepSize(Werkstoff werkstoff, Integer[] steps, int size) { --steps[0]; - try { - displayProgress.invoke(null, werkstoff.getDefaultName(), ((float) size) / 10000); - } catch (IllegalAccessException | InvocationTargetException e) { - e.printStackTrace(); + long time = System.currentTimeMillis(); + if (time - lastUpdate >= MINIMAL_UPDATE_INTERVAL) { + try { + displayProgress.invoke(null, werkstoff.getDefaultName(), ((float) size) / 10000); + } catch (IllegalAccessException | InvocationTargetException e) { + e.printStackTrace(); + } + lastUpdate = time; } if (steps[0] == 0 && Werkstoff.werkstoffHashSet.size() >= 100) @@ -105,4 +111,4 @@ public class CLSCompat { e.printStackTrace(); } } -} \ No newline at end of file +} -- cgit From 91be949dcfcb8e551eedf25ffad7cd6fe535c920 Mon Sep 17 00:00:00 2001 From: miozune Date: Sun, 24 Apr 2022 18:24:44 +0900 Subject: Add NEI catalysts (#120) Former-commit-id: 697cd3b647c9ce88acba144773196dfd301f7237 --- dependencies.gradle | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 2 ++ .../bartworks/neiHandler/IMCForNEI.java | 23 ++++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java diff --git a/dependencies.gradle b/dependencies.gradle index 8b725db7c8..34df9bf9d4 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -4,7 +4,7 @@ dependencies { compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.42:dev") compile("com.github.GTNewHorizons:StructureLib:1.0.15:dev") compile("com.github.GTNewHorizons:TecTech:4.10.18:dev") - compile("com.github.GTNewHorizons:NotEnoughItems:2.2.5-GTNH:dev") + compile("com.github.GTNewHorizons:NotEnoughItems:2.2.12-GTNH:dev") compile("com.github.GTNewHorizons:TinkersConstruct:1.9.0.13-GTNH:dev") compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.3:dev") compile("com.github.GTNewHorizons:CodeChickenCore:1.1.3:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 1f8ed0487c..f0b1be2d03 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -32,6 +32,7 @@ import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.*; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; +import com.github.bartimaeusnek.bartworks.neiHandler.IMCForNEI; import com.github.bartimaeusnek.bartworks.server.EventHandler.ServerEventHandler; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader; @@ -153,6 +154,7 @@ public final class MainMod { } ItemRegistry.run(); RecipeLoader.run(); + IMCForNEI.IMCSender(); } @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java new file mode 100644 index 0000000000..8622f18462 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java @@ -0,0 +1,23 @@ +package com.github.bartimaeusnek.bartworks.neiHandler; + +import cpw.mods.fml.common.event.FMLInterModComms; +import net.minecraft.nbt.NBTTagCompound; + +public class IMCForNEI { + public static void IMCSender() { + sendCatalyst("gt.recipe.largechemicalreactor", "gregtech:gt.blockmachines:13366", -10); + sendCatalyst("gt.recipe.craker", "gregtech:gt.blockmachines:13367", -10); + } + + private static void sendCatalyst(String aName, String aStack, int aPriority) { + NBTTagCompound aNBT = new NBTTagCompound(); + aNBT.setString("handlerID", aName); + aNBT.setString("itemName", aStack); + aNBT.setInteger("priority", aPriority); + FMLInterModComms.sendMessage("NotEnoughItems", "registerCatalystInfo", aNBT); + } + + private static void sendCatalyst(String aName, String aStack) { + sendCatalyst(aName, aStack, 0); + } +} -- cgit From 94d42356851e3e3609bf1512ba65858ecc53fc4c Mon Sep 17 00:00:00 2001 From: miozune Date: Wed, 27 Apr 2022 16:32:08 +0900 Subject: Swap oredictionary priorities between ThY glass and Tungsten Borosilicate (#123) Former-commit-id: 89ee011b26565ff3092c6f4009f00d455f0b033f --- .../github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java index eb79febe39..96fe2a25c5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java @@ -97,8 +97,8 @@ public class BeforeGTPreload implements Runnable { OreDictionary.registerOre("blockGlassHV", new ItemStack(bw_glasses[0], 1, 0)); OreDictionary.registerOre("blockGlassEV", Ic2Items.reinforcedGlass); OreDictionary.registerOre("blockGlassEV", new ItemStack(bw_glasses[0], 1, 1)); - OreDictionary.registerOre("blockGlassIV", new ItemStack(bw_glasses[0], 1, 2)); OreDictionary.registerOre("blockGlassIV", new ItemStack(bw_glasses[0], 1, 12)); + OreDictionary.registerOre("blockGlassIV", new ItemStack(bw_glasses[0], 1, 2)); OreDictionary.registerOre("blockGlassLuV", new ItemStack(bw_glasses[0], 1, 3)); OreDictionary.registerOre("blockGlassZPM", new ItemStack(bw_glasses[0], 1, 4)); OreDictionary.registerOre("blockGlassUV", new ItemStack(bw_glasses[0], 1, 5)); -- cgit From 955b0095de3952052aacb794ee76fb6bb937d05f Mon Sep 17 00:00:00 2001 From: miozune Date: Thu, 28 Apr 2022 03:02:58 +0900 Subject: Fix Manual Trafo not being oredicted (#124) Former-commit-id: dd35a809af15aa7ec15565b87be64f902608ca51 --- .../com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index a8128e12d2..7b7b940af5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -514,7 +514,7 @@ public class RecipeLoader { 'S', GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L), 'C', new ItemStack(ItemRegistry.BW_BLOCKS[2]), 'H', ItemList.Hull_HV.get(1L), - 'Z', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1L) + 'Z', "circuitAdvanced" } ); -- cgit From 756b483819a406bcfd5774c17863498e4508c618 Mon Sep 17 00:00:00 2001 From: Jakub Szewczyk Date: Sat, 30 Apr 2022 12:50:43 +0100 Subject: Remove check for a non-air block under the stirling pump (#125) As discussed on discord, this is an undocumented and a bit silly requirement. Former-commit-id: 47ebd702ebe2a995de6b4520f86e5c0f09bf5751 --- .../common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index 07dc78f6e1..d96c3496d4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -84,7 +84,7 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr private boolean checkPreUpdate() { - return this.worldObj.isRemote || ((this.fuelstack == null || this.fuelstack.stackSize <= 0) && this.fuel <= 0) || (this.tick == 0 && this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) == Blocks.air); + return this.worldObj.isRemote || ((this.fuelstack == null || this.fuelstack.stackSize <= 0) && this.fuel <= 0); } private void fixUnderlflow() { -- cgit From 96e6e175fb68604de17292fa4bb213dd0099b360 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Mon, 2 May 2022 19:58:12 +0200 Subject: Update repositories.gradle Former-commit-id: 35fc81f9a27a4ec99d10af6428b203eb0bef1387 --- repositories.gradle | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/repositories.gradle b/repositories.gradle index a161653e0f..a6fb7f9b4e 100644 --- a/repositories.gradle +++ b/repositories.gradle @@ -20,6 +20,14 @@ repositories { mavenPom() artifact() } + } + maven { + name = "ic2" + url = "http://maven2.ic2.player.to/" + metadataSources { + mavenPom() + artifact() + } } maven { url "https://cursemaven.com" -- cgit From e8ccc7838cf5800a2575f4e5059b9ab89c07aa82 Mon Sep 17 00:00:00 2001 From: miozune Date: Sat, 14 May 2022 18:21:20 +0900 Subject: No more id shift (#128) Former-commit-id: 549b9eb4de861d1377acd470a079bf44ad431d06 --- .../CircuitGeneration/CircuitPartLoader.java | 105 ++++++++++++++++----- 1 file changed, 84 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index a82dfb452d..c0613200df 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -29,11 +29,12 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; import static gregtech.api.enums.ItemList.*; @@ -72,29 +73,91 @@ public class CircuitPartLoader implements Runnable { ){ CircuitImprintLoader.blacklistSet.add(single.get(1)); - continue; } + } + + for (ItemList single : CIRCUIT_PARTS) { + if (!single.hasBeenSet()) + continue; ItemStack itemStack = single.get(1); if (!GT_Utility.isStackValid(itemStack)) continue; - int[] oreIDS = OreDictionary.getOreIDs(itemStack); - if (oreIDS.length > 1) - continue; - String name = null; - if (oreIDS.length == 1) - name = OreDictionary.getOreName(oreIDS[0]); - if ((name == null || name.isEmpty()) && (single.toString().contains("Circuit") || single.toString().contains("circuit") || single.toString().contains("board")) && single.getBlock() == Blocks.air) { - ArrayList toolTip = new ArrayList<>(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) - single.getItem().addInformation(single.get(1).copy(), null, toolTip, true); - String tt = (toolTip.size() > 0 ? toolTip.get(0) : ""); - // tt += "Internal Name = "+single; - String localised = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); - BW_Meta_Items.getNEWCIRCUITS().addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised+"s", tt); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{single.get(16).copy(), GT_Utility.getIntegratedCircuit(16)}, Materials.Plastic.getMolten(72),BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs),600,30); - CircuitImprintLoader.circuitIIconRefs.put(CircuitImprintLoader.reverseIDs,single); - CircuitImprintLoader.reverseIDs--; - } + ArrayList toolTip = new ArrayList<>(); + if (FMLCommonHandler.instance().getEffectiveSide().isClient()) + single.getItem().addInformation(single.get(1).copy(), null, toolTip, true); + String tt = (toolTip.size() > 0 ? toolTip.get(0) : ""); + // tt += "Internal Name = "+single; + String localised = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); + BW_Meta_Items.getNEWCIRCUITS().addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised+"s", tt); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{single.get(16).copy(), GT_Utility.getIntegratedCircuit(16)}, Materials.Plastic.getMolten(72),BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs),600,30); + CircuitImprintLoader.circuitIIconRefs.put(CircuitImprintLoader.reverseIDs,single); + CircuitImprintLoader.reverseIDs--; } } + + /** + * Contains all the circuit parts we want to generate wrapped version of. + * New entries MUST be placed at the END of this list, to prevent id shift. + */ + private static final List CIRCUIT_PARTS = Collections.unmodifiableList(Arrays.asList( + Circuit_Board_Basic, + Circuit_Board_Advanced, + Circuit_Board_Elite, + Circuit_Parts_Crystal_Chip_Elite, + Circuit_Parts_Crystal_Chip_Master, + Circuit_Board_Coated, + Circuit_Board_Coated_Basic, + Circuit_Board_Phenolic, + Circuit_Board_Phenolic_Good, + Circuit_Board_Epoxy, + Circuit_Board_Epoxy_Advanced, + Circuit_Board_Fiberglass, + Circuit_Board_Fiberglass_Advanced, + Circuit_Board_Multifiberglass_Elite, + Circuit_Board_Multifiberglass, + Circuit_Board_Wetware, + Circuit_Board_Wetware_Extreme, + Circuit_Board_Plastic, + Circuit_Board_Plastic_Advanced, + Circuit_Board_Bio, + Circuit_Board_Bio_Ultra, + Circuit_Parts_ResistorSMD, + Circuit_Parts_Coil, + Circuit_Parts_DiodeSMD, + Circuit_Parts_TransistorSMD, + Circuit_Parts_CapacitorSMD, + Circuit_Parts_ResistorASMD, + Circuit_Parts_DiodeASMD, + Circuit_Parts_TransistorASMD, + Circuit_Parts_CapacitorASMD, + Circuit_Chip_ILC, + Circuit_Chip_Ram, + Circuit_Chip_NAND, + Circuit_Chip_NOR, + Circuit_Chip_CPU, + Circuit_Chip_SoC, + Circuit_Chip_SoC2, + Circuit_Chip_PIC, + Circuit_Chip_Simple_SoC, + Circuit_Chip_HPIC, + Circuit_Chip_UHPIC, + Circuit_Chip_ULPIC, + Circuit_Chip_LPIC, + Circuit_Chip_NPIC, + Circuit_Chip_PPIC, + Circuit_Chip_QPIC, + Circuit_Chip_NanoCPU, + Circuit_Chip_QuantumCPU, + Circuit_Chip_CrystalCPU, + Circuit_Chip_CrystalSoC, + Circuit_Chip_CrystalSoC2, + Circuit_Chip_NeuroCPU, + Circuit_Chip_BioCPU, + Circuit_Chip_Stemcell, + Circuit_Chip_Biocell, + Circuit_Parts_ResistorXSMD, + Circuit_Parts_DiodeXSMD, + Circuit_Parts_TransistorXSMD, + Circuit_Parts_CapacitorXSMD + )); } -- cgit From 97066413e5a0af495c21d339a0a9125e30bbb9bf Mon Sep 17 00:00:00 2001 From: miozune Date: Thu, 19 May 2022 20:49:39 +0900 Subject: Borosilicate rebalance (#127) * Borosilicate rebalance * Change texture name Former-commit-id: b527918bac7fec90a8a181462303d5389bd546ae --- .../bartworks/common/loaders/ItemRegistry.java | 12 ++++----- .../bartworks/common/loaders/RecipeLoader.java | 30 +++++++++++---------- .../resources/assets/bartworks/lang/en_US.lang | 10 +++---- .../ChromeReinforcedBoronSilicateGlassBlock.png | Bin 199 -> 0 bytes ...NeutroniumReinforcedBoronSilicateGlassBlock.png | Bin 0 -> 129 bytes .../EuropiumReinforcedBoronSilicateGlassBlock.png | Bin 106 -> 0 bytes ...erMaterialReinforcedBoronSilicateGlassBlock.png | Bin 0 -> 199 bytes ...NeutroniumReinforcedBoronSilicateGlassBlock.png | Bin 0 -> 126 bytes .../NickelReinforcedBoronSilicateGlassBlock.png | Bin 201 -> 0 bytes .../TitaniumReinforcedBoronSilicateGlassBlock.png | Bin 0 -> 130 bytes .../TungstenReinforcedBoronSilicateGlassBlock.png | Bin 198 -> 0 bytes ...gstenSteelReinforcedBoronSilicateGlassBlock.png | Bin 0 -> 125 bytes .../UraniumReinforcedBoronSilicateGlassBlock.png | Bin 185 -> 0 bytes 13 files changed, 27 insertions(+), 25 deletions(-) delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/ChromeReinforcedBoronSilicateGlassBlock.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/CosmicNeutroniumReinforcedBoronSilicateGlassBlock.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/EuropiumReinforcedBoronSilicateGlassBlock.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/LuVTierMaterialReinforcedBoronSilicateGlassBlock.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/NeutroniumReinforcedBoronSilicateGlassBlock.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/NickelReinforcedBoronSilicateGlassBlock.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/TitaniumReinforcedBoronSilicateGlassBlock.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/TungstenReinforcedBoronSilicateGlassBlock.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/TungstenSteelReinforcedBoronSilicateGlassBlock.png delete mode 100644 src/main/resources/assets/bartworks/textures/blocks/UraniumReinforcedBoronSilicateGlassBlock.png diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 3ecb7fbab8..547dbeb9cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -88,9 +88,9 @@ public class ItemRegistry { "BW_GlasBlocks", new String[]{ MainMod.MOD_ID + ":BoronSilicateGlassBlock", - MainMod.MOD_ID + ":NickelReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":TungstenReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":ChromeReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":TitaniumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":TungstenSteelReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":LuVTierMaterialReinforcedBoronSilicateGlassBlock", MainMod.MOD_ID + ":IridiumReinforcedBoronSilicateGlassBlock", MainMod.MOD_ID + ":OsmiumReinforcedBoronSilicateGlassBlock", MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock1", @@ -100,10 +100,10 @@ public class ItemRegistry { MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock5", MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock6", MainMod.MOD_ID + ":ThoriumYttriumGlass", - MainMod.MOD_ID + ":UraniumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":EuropiumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":NeutroniumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":CosmicNeutroniumReinforcedBoronSilicateGlassBlock", }, - new short[][]{Materials.BorosilicateGlass.getRGBA(), Materials.Nickel.getRGBA(), Materials.Tungsten.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), Materials.Osmium.getRGBA(), new short[]{0xff, 0, 0}, new short[]{0, 0xff, 0}, new short[]{0x80, 0, 0xff}, new short[]{0xff, 0xff, 0}, new short[]{0, 0xff, 0x80}, new short[]{0x80, 0x33, 0}, WerkstoffLoader.YttriumOxide.getRGBA(), Materials.Uranium235.getRGBA(), Materials.Europium.getRGBA()}, + new short[][]{Materials.BorosilicateGlass.getRGBA(), Materials.Titanium.getRGBA(), Materials.TungstenSteel.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), Materials.Osmium.getRGBA(), new short[]{0xff, 0, 0}, new short[]{0, 0xff, 0}, new short[]{0x80, 0, 0xff}, new short[]{0xff, 0xff, 0}, new short[]{0, 0xff, 0x80}, new short[]{0x80, 0x33, 0}, WerkstoffLoader.YttriumOxide.getRGBA(), Materials.Neutronium.getRGBA(), Materials.CosmicNeutronium.getRGBA()}, MainMod.BIO_TAB, true, false ); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 7b7b940af5..f91cfe43a1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -261,13 +261,14 @@ public class RecipeLoader { GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1160), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[4], 72000, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Nickel.getMolten(5184), new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 800, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), Materials.Tungsten.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), 800, BW_Util.getMachineVoltageFromTier(4)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), Materials.Chrome.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), 800, BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), Materials.Iridium.getMolten(3888), new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), 800, BW_Util.getMachineVoltageFromTier(6)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), Materials.Osmium.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), 800, BW_Util.getMachineVoltageFromTier(7)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), Materials.Uranium235.getMolten(2304), new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), 800, BW_Util.getMachineVoltageFromTier(8)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), Materials.Europium.getMolten(4608), new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), 800, BW_Util.getMachineVoltageFromTier(9)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Titanium.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 800, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.TungstenSteel.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), 800, BW_Util.getMachineVoltageFromTier(4)); + FluidStack LuVMaterialFluid = ConfigHandler.newStuff ? WerkstoffLoader.LuVTierMaterial.getMolten(1152) : Materials.Chrome.getMolten(1152); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), LuVMaterialFluid, new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), 800, BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Iridium.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), 800, BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Osmium.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), 800, BW_Util.getMachineVoltageFromTier(7)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Neutronium.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), 800, BW_Util.getMachineVoltageFromTier(8)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.CosmicNeutronium.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), 800, BW_Util.getMachineVoltageFromTier(9)); for (int i = 0; i < Dyes.dyeBrown.getSizeOfFluidList(); ++i) { GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeRed.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 6), null, null, null, 64, 2); @@ -278,13 +279,14 @@ public class RecipeLoader { GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeBrown.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 11), null, null, null, 64, 2); } //and reverse recipes... cause im nice :P - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nickel.getDust(36)}, null, 800, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nickel.getDust(36), Materials.Tungsten.getDust(9)}, null, 800, BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9)}, null, 800, BW_Util.getMachineVoltageFromTier(6)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9), Materials.Iridium.getDust(27)}, null, 800, BW_Util.getMachineVoltageFromTier(7)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9), Materials.Osmiridium.getDust(36)}, null, 800, BW_Util.getMachineVoltageFromTier(8)); - GT_Values.RA.addFluidExtractionRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), Materials.Uranium235.getMolten(2304), 1000 , 800, BW_Util.getMachineVoltageFromTier(9)); - GT_Values.RA.addFluidExtractionRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), Materials.Europium.getMolten(4608), 1000 , 800, BW_Util.getMachineVoltageFromTier(10)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Titanium.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.TungstenSteel.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(5)); + ItemStack LuVMaterialDust = ConfigHandler.newStuff ? WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.dust, 8) : Materials.Chrome.getDust(8); + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), LuVMaterialDust}, null, 800, BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Iridium.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(7)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Osmium.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(8)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Neutronium.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(9)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.CosmicNeutronium.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(10)); for (int i = 6; i < 11; i++) { GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, i), new ItemStack[]{Materials.BorosilicateGlass.getDust(9)}, null, 400, BW_Util.getMachineVoltageFromTier(1)); diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index a13642b7fd..cb38553b32 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -44,9 +44,9 @@ labModule.item.PlasmidSynthesisModule.name=Plasmid Synthesis Module labModule.item.TransformationModule.name=Transformation Module labModule.item.ClonalCellularSynthesisModule.name=Clonal Cellular Synthesis Module BW_GlasBlocks.0.name=Borosilicate Glass Block -BW_GlasBlocks.1.name=Nickel Reinforced Borosilicate Glass Block -BW_GlasBlocks.2.name=Tungsten Reinforced Borosilicate Glass Block -BW_GlasBlocks.3.name=Chrome Reinforced Borosilicate Glass Block +BW_GlasBlocks.1.name=Titanium Reinforced Borosilicate Glass Block +BW_GlasBlocks.2.name=Tungstensteel Reinforced Borosilicate Glass Block +BW_GlasBlocks.3.name=Rhodium-Plated Palladium Reinforced Borosilicate Glass Block BW_GlasBlocks.4.name=Iridium Reinforced Borosilicate Glass Block BW_GlasBlocks.5.name=Osmium Reinforced Borosilicate Glass Block BW_GlasBlocks.6.name=Colored Borosilicate Glass Block (Red) @@ -56,8 +56,8 @@ BW_GlasBlocks.9.name=Colored Borosilicate Glass Block (Yellow) BW_GlasBlocks.10.name=Colored Borosilicate Glass Block (Light Green) BW_GlasBlocks.11.name=Colored Borosilicate Glass Block (Brown) BW_GlasBlocks.12.name=Thorium Yttrium Glass Block -BW_GlasBlocks.13.name=Uranium Reinforced Borosilicate Glass Block -BW_GlasBlocks.14.name=Europium Reinforced Borosilicate Glass Block +BW_GlasBlocks.13.name=Neutronium Reinforced Borosilicate Glass Block +BW_GlasBlocks.14.name=Cosmic Neutronium Reinforced Borosilicate Glass Block tooltip.glas.0.name=Glass-Tier: tooltip.LESU.0.name=Maximum Capacity! diff --git a/src/main/resources/assets/bartworks/textures/blocks/ChromeReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/ChromeReinforcedBoronSilicateGlassBlock.png deleted file mode 100644 index 213f8feafd..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/ChromeReinforcedBoronSilicateGlassBlock.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/CosmicNeutroniumReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/CosmicNeutroniumReinforcedBoronSilicateGlassBlock.png new file mode 100644 index 0000000000..2f58642a18 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/CosmicNeutroniumReinforcedBoronSilicateGlassBlock.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/EuropiumReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/EuropiumReinforcedBoronSilicateGlassBlock.png deleted file mode 100644 index 5255386cc6..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/EuropiumReinforcedBoronSilicateGlassBlock.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/LuVTierMaterialReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/LuVTierMaterialReinforcedBoronSilicateGlassBlock.png new file mode 100644 index 0000000000..213f8feafd Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/LuVTierMaterialReinforcedBoronSilicateGlassBlock.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/NeutroniumReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/NeutroniumReinforcedBoronSilicateGlassBlock.png new file mode 100644 index 0000000000..c75fafb933 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/NeutroniumReinforcedBoronSilicateGlassBlock.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/NickelReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/NickelReinforcedBoronSilicateGlassBlock.png deleted file mode 100644 index 9ab096b467..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/NickelReinforcedBoronSilicateGlassBlock.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/TitaniumReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/TitaniumReinforcedBoronSilicateGlassBlock.png new file mode 100644 index 0000000000..9908141e11 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/TitaniumReinforcedBoronSilicateGlassBlock.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/TungstenReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/TungstenReinforcedBoronSilicateGlassBlock.png deleted file mode 100644 index b3823b02fc..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/TungstenReinforcedBoronSilicateGlassBlock.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/TungstenSteelReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/TungstenSteelReinforcedBoronSilicateGlassBlock.png new file mode 100644 index 0000000000..07618e28aa Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/TungstenSteelReinforcedBoronSilicateGlassBlock.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/UraniumReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/UraniumReinforcedBoronSilicateGlassBlock.png deleted file mode 100644 index 0cc6e08ae3..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/blocks/UraniumReinforcedBoronSilicateGlassBlock.png and /dev/null differ -- cgit From 7da7945935509c9e63b56c2f8be62e36a7ce9d2b Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Wed, 25 May 2022 17:37:11 +0200 Subject: EIC Fix crops from mods (#126) * Fix Natura crops * Correct info about water * Update repositories.gradle Co-authored-by: Martin Robertz Former-commit-id: 89a69254b4ba241e40a5e8a8fc79518581970019 --- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 27 +++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index fd0238df46..0c0dd2bc34 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -8,6 +8,7 @@ import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -26,7 +27,7 @@ import ic2.api.crops.Crops; import ic2.core.Ic2Items; import ic2.core.crop.TileEntityCrop; import net.minecraft.block.Block; -import net.minecraft.block.BlockCrops; +import net.minecraft.block.IGrowable; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -167,6 +168,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity addInfo("Every tier past UV, slots are multiplied by 4"). addInfo("Process time: 5 sec"). addInfo("All crops are accelerated by x32 times"). + addInfo("Cannot process primordial"). addInfo(BW_Tooltip_Reference.TT_BLUEPRINT). addSeparator(). beginStructureBlock(5, 4, 5, false). @@ -360,7 +362,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity public String[] getInfoData() { List info = new ArrayList<>(Arrays.asList( "Running in mode: " + EnumChatFormatting.GREEN + (setupphase == 0 ? (isIC2Mode ? "IC2 crops" : "Normal crops") : ("Setup mode " + (setupphase == 1 ? "(input)" : "(output)"))) + EnumChatFormatting.RESET, - "Uses " + waterusage * 1000 + "L/s of water", + "Uses " + waterusage * 1000 + "/operation of water", "Max slots: " + EnumChatFormatting.GREEN + this.mMaxSlots + EnumChatFormatting.RESET, "Used slots: " + EnumChatFormatting.GREEN + this.mStorage.size() + EnumChatFormatting.RESET )); @@ -412,7 +414,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity private static class GreenHouseSlot extends InventoryCrafting { ItemStack input; - BlockCrops crop; + Block crop; List drops; boolean isValid; boolean isIC2Crop; @@ -423,6 +425,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity IRecipe recipe; ItemStack recipeInput; + int optimalgrowth = 7; + public NBTTagCompound toNBTTagCompound(){ NBTTagCompound aNBT = new NBTTagCompound(); aNBT.setTag("input", input.writeToNBT(new NBTTagCompound())); @@ -431,6 +435,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity aNBT.setInteger("dropscount", drops.size()); for (int i = 0; i < drops.size(); i++) aNBT.setTag("drop." + i, drops.get(i).writeToNBT(new NBTTagCompound())); + aNBT.setInteger("optimalgrowth", optimalgrowth); } else { aNBT.setInteger("generationscount", generations.size()); @@ -453,10 +458,12 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity isValid = aNBT.getBoolean("isValid"); input = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("input")); if(!isIC2Crop) { - crop = (BlockCrops) Block.getBlockById(aNBT.getInteger("crop")); + crop = Block.getBlockById(aNBT.getInteger("crop")); drops = new ArrayList<>(); for (int i = 0; i < aNBT.getInteger("dropscount"); i++) drops.add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("drop." + i))); + optimalgrowth = aNBT.getInteger("optimalgrowth"); + if(optimalgrowth == 0) optimalgrowth = 7; } else { @@ -480,6 +487,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity int toconsume = Math.min(64 - this.input.stackSize, input.stackSize); int left = addDrops(world, toconsume, true); input.stackSize -= toconsume - left; + this.input.stackSize += toconsume - left; return left == 0; } @@ -536,11 +544,14 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity return; } Block b = ((ItemSeeds) input.getItem()).getPlant(world, 0, 0, 0); - if (!(b instanceof BlockCrops)) + if (!(b instanceof IGrowable)) return; - crop = (BlockCrops) b; + GameRegistry.UniqueIdentifier u = GameRegistry.findUniqueIdentifierFor(input.getItem()); + if(u != null && Objects.equals(u.modId, "Natura")) + optimalgrowth = 8; + crop = b; isIC2Crop = false; - if(addDrops(world, input.stackSize, autocraft) == 0){ + if(addDrops(world, input.stackSize, autocraft) == 0 && !drops.isEmpty()){ this.isValid = true; } } @@ -664,7 +675,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity public int addDrops(World world, int count, boolean autocraft){ drops = new ArrayList<>(); for(int i = 0; i < count; i++) { - List d = crop.getDrops(world, 0, 0, 0, 7, 0); + List d = crop.getDrops(world, 0, 0, 0, optimalgrowth, 0); for(ItemStack x : drops) for(ItemStack y : d) if(GT_Utility.areStacksEqual(x, y)) -- cgit From 2d5dc754aa1da70bf10181b8398f7a500c481a49 Mon Sep 17 00:00:00 2001 From: Steelux <70096037+Steelux8@users.noreply.github.com> Date: Fri, 27 May 2022 09:51:52 +0100 Subject: Replace Soldering Alloy with Indalloy 140 (#129) - Replaced the LV-tier Soldering Alloy in Assembly Line recipes with a higher tier, more complex solder that fits progression better. Former-commit-id: 34a4c7e5c10a12dcf2d06bd0025531e4f20da353 --- .../bartworks/common/loaders/RecipeLoader.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index f91cfe43a1..df372342f3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -45,6 +45,7 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; @@ -189,6 +190,8 @@ public class RecipeLoader { 'P', "plateAlloyIridium", }); + Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null ? FluidRegistry.getFluid("molten.indalloy140") : FluidRegistry.getFluid("molten.solderingalloy"); + if (newStuff) { GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.PUMPPARTS, 1, 0),//tube @@ -250,7 +253,7 @@ public class RecipeLoader { ItemList.Field_Generator_LuV.get(8) }, new FluidStack[]{ - Materials.SolderingAlloy.getMolten(32 * 144), + new FluidStack(solderIndalloy, 32 * 144), Materials.Polytetrafluoroethylene.getMolten(32 * 144) }, ItemRegistry.dehp, 5000, BW_Util.getMachineVoltageFromTier(6)); @@ -823,7 +826,7 @@ public class RecipeLoader { GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 36L) }, new FluidStack[]{ - Materials.SolderingAlloy.getMolten(1440), + new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Neon.getFluidOrGas(20000), }, ItemRegistry.voidminer[0].copy(), @@ -847,7 +850,7 @@ public class RecipeLoader { GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) }, new FluidStack[]{ - Materials.SolderingAlloy.getMolten(1440), + new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Krypton.getFluidOrGas(20000) }, ItemRegistry.voidminer[1].copy(), @@ -868,7 +871,7 @@ public class RecipeLoader { GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) }, new FluidStack[]{ - Materials.SolderingAlloy.getMolten(1440), + new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Oganesson.getFluidOrGas(20000) }, ItemRegistry.voidminer[2].copy(), @@ -887,7 +890,7 @@ public class RecipeLoader { ItemList.Electric_Piston_UV.get(64), }, new FluidStack[]{ - Materials.SolderingAlloy.getMolten(1440), + new FluidStack(solderIndalloy, 1440), Materials.Osmium.getMolten(1440), Materials.Neutronium.getMolten(1440) }, @@ -996,7 +999,7 @@ public class RecipeLoader { Materials.Chrome.getPlates(8) }, new FluidStack[]{ - Materials.SolderingAlloy.getMolten(1440) + new FluidStack(solderIndalloy, 1440) }, ItemRegistry.cal.copy(), 24000, -- cgit From f36ba8cf78382c60ed86bd72499dab6634657af9 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Thu, 9 Jun 2022 17:03:06 +0200 Subject: Fix wrong piston position (#132) Former-commit-id: 7977711ca7d308d22639fe621377a451e2c620dd --- .../tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index b9c3d36c0e..95e8f311ec 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -283,7 +283,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - this.piston = aNBT.getBoolean("piston"); + if(aNBT.hasKey("piston")) this.piston = aNBT.getBoolean("piston"); } @Override -- cgit From 988c30eedccf4b69e7c80de88bd9a9b316c84011 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Fri, 10 Jun 2022 08:40:02 +0200 Subject: EIG fix + info changes (#130) * Fix power usage * Add info about internal structure parts * Add more info to tricorder * Add structure description info * More checks * Remove endless loop possibility Former-commit-id: 2e9cd518d949448d727bf1e59364dd625df067f4 --- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 47 +++++++++++++++++----- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index 0c0dd2bc34..0a619a5048 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -12,6 +12,7 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -52,6 +53,8 @@ import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity_EnhancedMultiBlockBase { + private static final boolean debug = false; + private int mCasing = 0; private int mMaxSlots = 0; private int setupphase = 1; @@ -77,7 +80,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity ofHatchAdder(GT_TileEntity_ExtremeIndustrialGreenhouse::addOutputToMachineList, CASING_INDEX, 1) )) .addElement('l', LoaderReference.ProjRedIllumination ? ofBlock(Block.getBlockFromName("ProjRed|Illumination:projectred.illumination.lamp"), 10) : ofBlock(Blocks.redstone_lamp, 0)) - .addElement('g', BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) + .addElement('g', debug ? ofBlock(Blocks.glass, 0) : BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) .addElement('d', ofBlock(LoaderReference.RandomThings ? Block.getBlockFromName("RandomThings:fertilizedDirt_tilled") : Blocks.farmland, 0)) .addElement('w', ofBlock(Blocks.water, 0)) .build(); @@ -176,6 +179,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity addCasingInfo("Clean Stainless Steel Casings", 70). addOtherStructurePart("Borosilicate Glass", "Hollow two middle layers", 2). addStructureInfo("The glass tier limits the Energy Input tier"). + addStructureInfo("The dirt is from RandomThings, must be tilled"). + addStructureInfo("Purple lamps are from ProjectRedIllumination. They can be lit"). addMaintenanceHatch("Any casing", 1). addInputBus("Any casing", 1). addOutputBus("Any casing", 1). @@ -185,6 +190,14 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity return tt; } + @Override + public String[] getStructureDescription(ItemStack stackSize) { + List info = new ArrayList<>(Arrays.asList(super.getStructureDescription(stackSize))); + info.add("The dirt is from RandomThings, must be tilled"); + info.add("Purple lamps are from ProjectRedIllumination. They can be lit"); + return info.toArray(new String[]{}); + } + @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); @@ -255,6 +268,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 2, 5, 0); } + + @Override public boolean isCorrectMachinePart(ItemStack itemStack) { return true; @@ -295,7 +310,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity for(GreenHouseSlot s : mStorage) waterusage += s.input.stackSize; - if(!depleteInput(new FluidStack(FluidRegistry.WATER, waterusage * 1000))) + if(!depleteInput(new FluidStack(FluidRegistry.WATER, waterusage * 1000)) && !debug) return false; // OVERCLOCK @@ -318,7 +333,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity } this.mOutputItems = outputs.toArray(new ItemStack[0]); } - this.mEUt = -(int)((double)v * 0.99d); + this.mEUt = -(int)((double) GT_Values.V[tier] * 0.99d); this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; return true; @@ -329,6 +344,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { mCasing = 0; glasTier = 0; + if(debug) + glasTier = 8; if(!checkPiece(STRUCTURE_PIECE_MAIN, 2, 5, 0)) return false; @@ -362,12 +379,21 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity public String[] getInfoData() { List info = new ArrayList<>(Arrays.asList( "Running in mode: " + EnumChatFormatting.GREEN + (setupphase == 0 ? (isIC2Mode ? "IC2 crops" : "Normal crops") : ("Setup mode " + (setupphase == 1 ? "(input)" : "(output)"))) + EnumChatFormatting.RESET, - "Uses " + waterusage * 1000 + "/operation of water", + "Uses " + waterusage * 1000 + "L/operation of water", "Max slots: " + EnumChatFormatting.GREEN + this.mMaxSlots + EnumChatFormatting.RESET, "Used slots: " + EnumChatFormatting.GREEN + this.mStorage.size() + EnumChatFormatting.RESET )); - for(int i = 0; i < mStorage.size(); i++) - info.add("Slot " + i + ": " + EnumChatFormatting.GREEN + "x" + this.mStorage.get(i).input.stackSize + " " + this.mStorage.get(i).input.getDisplayName() + EnumChatFormatting.RESET); + for(int i = 0; i < mStorage.size(); i++) { + if(!mStorage.get(i).isValid) + continue; + StringBuilder a = new StringBuilder("Slot " + i + ": " + EnumChatFormatting.GREEN + "x" + this.mStorage.get(i).input.stackSize + " " + this.mStorage.get(i).input.getDisplayName() + " : "); + if(this.isIC2Mode) + for(Map.Entry entry : mStorage.get(i).dropprogress.entrySet()) + a.append((int) (entry.getValue() * 100d)).append("% "); + a.append(EnumChatFormatting.RESET); + info.add(a.toString()); + } + info.addAll(Arrays.asList(super.getInfoData())); return info.toArray(new String[0]); } @@ -594,16 +620,17 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity return; // GENERATE DROPS generations = new ArrayList<>(); - for(int i = 0; i < 10; i++) // get 10 generations + out: for(int i = 0; i < 10; i++) // get 10 generations { ItemStack[] st = te.harvest_automated(false); te.setSize((byte) cc.maxSize()); - if (st == null){ - i--; + if (st == null) continue; - } if (st.length == 0) continue; + for(ItemStack s : st) + if(s == null) + continue out; generations.add(new ArrayList<>(Arrays.asList(st))); } if(generations.isEmpty()) -- cgit From 5a64766746e895d60a7b3c1e419378030832b338 Mon Sep 17 00:00:00 2001 From: xSkewer <43712386+xSkewer@users.noreply.github.com> Date: Wed, 15 Jun 2022 17:37:56 -0400 Subject: Fixes circuit recipes in the Mega DT (#136) * Fixes circuit recipes in the Mega DT * Switch to getCompactedInputs Former-commit-id: ab179a17232ffb83d9abbbdb20cdffd309bc61a0 --- .../tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 355e9dfee5..3e3021f2ff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -274,6 +274,9 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock @Override public boolean checkRecipe(ItemStack aStack) { + + ItemStack[] tItems = getCompactedInputs(); + ArrayList tFluidList = this.getStoredFluids(); for (int i = 0; i < tFluidList.size() - 1; ++i) { @@ -300,7 +303,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock Pair, ArrayList> Outputs; int processed = 0; boolean found_Recipe = false; - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(this.getBaseMetaTileEntity(), false, GT_Values.V[tTier], new FluidStack[]{tFluid}); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(this.getBaseMetaTileEntity(), false, GT_Values.V[tTier], new FluidStack[]{tFluid}, tItems); if (tRecipe != null) { found_Recipe = true; -- cgit From a2e06a7f2de0df68190673cd6aa1ce341c829b16 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Thu, 16 Jun 2022 21:59:15 +0200 Subject: fix Fluor-buergerite electrolyze incorrect cell amount #10501 https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/10501 (cherry picked from commit 8c777d4ca4761b1386c060d49e5d4b005a0e5924) Former-commit-id: ba22b5b2a3a471d8ca7373c9519f633f203c2d2c --- .../com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index df372342f3..56553661fa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -1015,7 +1015,7 @@ public class RecipeLoader { GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.FuchsitCR.get(OrePrefixes.dust, 21), ItemList.Cell_Empty.get(2), GT_Values.NF, Materials.Oxygen.getGas(2000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2), GT_Values.NI, GT_Values.NI, null, 460, 120); GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.VanadioOxyDravit.get(OrePrefixes.dust, 53), ItemList.Cell_Empty.get(3), GT_Values.NF, Materials.Oxygen.getGas(19000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Vanadium, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), null, 710, 120); GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.ChromoAluminoPovondrait.get(OrePrefixes.dust, 53), ItemList.Cell_Empty.get(3), GT_Values.NF, Materials.Oxygen.getGas(19000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), null, 720, 120); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.FluorBuergerit.get(OrePrefixes.dust, 50), ItemList.Cell_Empty.get(1), GT_Values.NF, Materials.Oxygen.getGas(6000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fluorine, 3), null, 730, 120); + GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.FluorBuergerit.get(OrePrefixes.dust, 50), ItemList.Cell_Empty.get(3), GT_Values.NF, Materials.Oxygen.getGas(6000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fluorine, 3), null, 730, 120); GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.Olenit.get(OrePrefixes.dust, 51), ItemList.Cell_Empty.get(1), GT_Values.NF, Materials.Oxygen.getGas(1000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 9L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 1), GT_Values.NI, null, 790, 120); } } -- cgit From a1f9d28b85b0c31ae054fe30e53f66dcc2b80148 Mon Sep 17 00:00:00 2001 From: miozune Date: Sat, 18 Jun 2022 20:21:25 +0900 Subject: Add ingot form of Zirconium (#135) Former-commit-id: b62c5808a57a061cec0c5d9193f1489388c117d9 --- .../bartimaeusnek/bartworks/system/material/WerkstoffLoader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index c004668c33..46177597ad 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -227,9 +227,9 @@ public class WerkstoffLoader { new short[]{175, 175, 175, 0}, "Zirconium", "Zr", - new Werkstoff.Stats().setProtons(40).setMeltingPoint(2130), + new Werkstoff.Stats().setProtons(40).setBlastFurnace(true).setMeltingPoint(2130).setMeltingVoltage(480), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().onlyDust().enforceUnification(), + new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().enforceUnification(), 3, TextureSet.SET_METALLIC //No Byproducts -- cgit From 6d00f4e8d16133cf3ca132bb5903b47e7453a77e Mon Sep 17 00:00:00 2001 From: MuXiu1997 Date: Sat, 18 Jun 2022 19:21:39 +0800 Subject: Fix Werkstoff localization failure (#134) Former-commit-id: 3403a331c17a7d62ed42afe40d873b2de3eb847a --- .../bartimaeusnek/bartworks/system/material/Werkstoff.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 119cf017d2..17b390713f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -29,6 +29,7 @@ import com.github.bartimaeusnek.bartworks.util.MurmurHash3; import com.github.bartimaeusnek.bartworks.util.NonNullWrappedHashMap; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; +import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; @@ -73,9 +74,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { private final HashSet SUBTAGS = new HashSet<>(); private byte[] rgb = new byte[3]; private final String defaultName; - private final String localizedName; + private String localizedName; private String toolTip; - private final String localizedToolTip; + private String localizedToolTip; private Werkstoff.Stats stats; private final Werkstoff.Types type; @@ -183,7 +184,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.mID = (short) mID; this.defaultName = defaultName; - this.localizedName = GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.name", this.mID), defaultName); + GregTech_API.sAfterGTPreload.add(() -> { + this.localizedName = GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.name", this.mID), defaultName); + }); this.stats = stats; this.type = type; this.generationFeatures = generationFeatures; @@ -220,7 +223,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { // if (this.toolTip.length() > 25) // this.toolTip = "The formula is to long..."; - this.localizedToolTip = GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.tooltip", this.mID), toolTip); + GregTech_API.sAfterGTPreload.add(() -> { + this.localizedToolTip = GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.tooltip", this.mID), toolTip); + }); if (this.stats.protons == 0) { long tmpprotons = 0; -- cgit From 4d9a8dca09f568a26b7064badf0ac95c0dc0c770 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Sat, 18 Jun 2022 13:21:50 +0200 Subject: EIG - Add under crop block as requirement (#133) * Add under crop block as requirement * Bug fix * Fix potential casing dupe Former-commit-id: b4c4dfe431a359276b52e91aea63d6dfca27dca6 --- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 68 ++++++++++++++++++++-- 1 file changed, 62 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index 0a619a5048..fdd5f29a7d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -33,6 +33,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; import net.minecraft.item.ItemSeeds; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; @@ -153,6 +154,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity addInfo("Does not take power"). addInfo("There are two modes: input / output"). addInfo("Input mode: machine will take seeds from input bus and plant them"). + addInfo("[IC2] You need to also input block that is required under the crop"). addInfo("Output mode: machine will take planted seeds and output them"). addInfo("-------------------- NORMAL CROPS --------------------"). addInfo("Minimal tier: EV"). @@ -257,6 +259,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity else if(setupphase == 2 && mStorage.size() > 0) { this.addOutput(this.mStorage.get(0).input.copy()); + if(this.mStorage.get(0).undercrop != null) + this.addOutput(this.mStorage.get(0).undercrop.copy()); this.mStorage.remove(0); this.updateSlots(); } @@ -386,10 +390,12 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity for(int i = 0; i < mStorage.size(); i++) { if(!mStorage.get(i).isValid) continue; - StringBuilder a = new StringBuilder("Slot " + i + ": " + EnumChatFormatting.GREEN + "x" + this.mStorage.get(i).input.stackSize + " " + this.mStorage.get(i).input.getDisplayName() + " : "); - if(this.isIC2Mode) - for(Map.Entry entry : mStorage.get(i).dropprogress.entrySet()) + StringBuilder a = new StringBuilder("Slot " + i + ": " + EnumChatFormatting.GREEN + "x" + this.mStorage.get(i).input.stackSize + " " + this.mStorage.get(i).input.getDisplayName()); + if(this.isIC2Mode) { + a.append(" : "); + for (Map.Entry entry : mStorage.get(i).dropprogress.entrySet()) a.append((int) (entry.getValue() * 100d)).append("% "); + } a.append(EnumChatFormatting.RESET); info.add(a.toString()); } @@ -441,6 +447,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity ItemStack input; Block crop; + ItemStack undercrop = null; List drops; boolean isValid; boolean isIC2Crop; @@ -464,6 +471,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity aNBT.setInteger("optimalgrowth", optimalgrowth); } else { + if(undercrop != null) + aNBT.setTag("undercrop", undercrop.writeToNBT(new NBTTagCompound())); aNBT.setInteger("generationscount", generations.size()); for(int i = 0; i < generations.size(); i++) { @@ -493,6 +502,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity } else { + if(aNBT.hasKey("undercrop")) + undercrop = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("undercrop")); generations = new ArrayList<>(); for(int i = 0; i < aNBT.getInteger("generationscount"); i++) { @@ -600,8 +611,16 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity xyz[0] += tileEntity.getBaseMetaTileEntity().getXCoord(); xyz[1] += tileEntity.getBaseMetaTileEntity().getYCoord(); xyz[2] += tileEntity.getBaseMetaTileEntity().getZCoord(); + boolean cheating = false; try{ - world.setBlock(xyz[0], xyz[1], xyz[2], Block.getBlockFromItem(Ic2Items.crop.getItem()), 0, 3); + if(world.getBlock(xyz[0], xyz[1] - 2, xyz[2]) != GregTech_API.sBlockCasings4 || world.getBlockMetadata(xyz[0], xyz[1] - 2, xyz[2]) != 1) + { + // no + cheating = true; + return; + } + + world.setBlock(xyz[0], xyz[1], xyz[2], Block.getBlockFromItem(Ic2Items.crop.getItem()), 0, 0); TileEntity wte = world.getTileEntity(xyz[0], xyz[1], xyz[2]); if(!(wte instanceof TileEntityCrop)) { @@ -611,13 +630,44 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity TileEntityCrop te = (TileEntityCrop)wte; te.ticker = 1; // dont even think about ticking once te.setCrop(cc); - te.setSize((byte) cc.maxSize()); + te.setGrowth(gr); te.setGain(ga); te.setResistance(re); + ItemStack tobeused = null; + + te.setSize((byte) (cc.maxSize() - 1)); + if(!cc.canGrow(te)) + { + // needs special block + + boolean cangrow = false; + ArrayList inputs = tileEntity.getStoredInputs(); + for(ItemStack a : inputs) + { + Block b = Block.getBlockFromItem(a.getItem()); + if(b == Blocks.air) + continue; + world.setBlock(xyz[0], xyz[1] - 2, xyz[2], b, a.getItemDamage(), 0); + if(!cc.canGrow(te)) + continue; + cangrow = true; + undercrop = a.copy(); + undercrop.stackSize = 1; + tobeused = a; + break; + } + + if(!cangrow) + return; + } + + te.setSize((byte) cc.maxSize()); + if(!cc.canBeHarvested(te)) return; + // GENERATE DROPS generations = new ArrayList<>(); out: for(int i = 0; i < 10; i++) // get 10 generations @@ -636,7 +686,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity if(generations.isEmpty()) return; rn = new Random(); - input.stackSize --; + // CHECK GROWTH SPEED te.humidity = 12; // humidity with full water storage @@ -651,12 +701,18 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity if(growthticks < 1) growthticks = 1; + input.stackSize --; + if(tobeused != null) + tobeused.stackSize --; + this.isValid = true; } catch (Exception e){ e.printStackTrace(System.err); } finally { + if(!cheating) + world.setBlock(xyz[0], xyz[1] - 2, xyz[2], GregTech_API.sBlockCasings4, 1, 0); world.setBlockToAir(xyz[0], xyz[1], xyz[2]); } } -- cgit From 46788e7e579b826a2663e9161bba883568e6c4d5 Mon Sep 17 00:00:00 2001 From: boubou19 Date: Tue, 21 Jun 2022 15:36:24 +0200 Subject: documented the VM base class (#138) Former-commit-id: 0d5eb64af8e3b9a8f4d2669b4acb5adb8d0c22bc --- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 143 +++++++++++++++++---- 1 file changed, 118 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index fbade9d8dc..4472bb6f0a 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -83,6 +83,12 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private boolean mBlacklist = false; + /** + * Public method giving other mods the ability to add manually a material with an ore version into the external dromap for a specified dim id + * @param DimensionID the dim id targetted + * @param Material the material with an ore version + * @param weight the non normalised version of the given weight + */ public static void addMatierialToDimensionList(int DimensionID, ISubTagContainer Material, float weight) { if (Material instanceof Materials) getExtraDropsDimMap().put(DimensionID, new Pair<>(new Pair<>(((Materials)Material).mMetaItemSubID,false), weight)); @@ -90,6 +96,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri getExtraDropsDimMap().put(DimensionID, new Pair<>(new Pair<>((int) ((Werkstoff)Material).getmID(),true), weight)); } + //adding tellurium to OW to ensure a way to get it, as it's used in Magneto Resonatic Dust and Circuit Compound MK3 Dust static { addMatierialToDimensionList(0, Materials.Tellurium, 8.0f); } @@ -146,7 +153,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri @Override protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { - makeDropMap(); + //if the dropmap has never been initialised or if the dropmap is empty + if (dropmap == null || totalWeight == 0) + calculateDropMap(); + if(totalWeight != 0.f){ handleFluidConsumption(); handleOutputs(); @@ -186,10 +196,18 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri return tt; } + /** + * getter for the external drop map + * @return the extraDriosDimMap + */ public static ArrayListMultimap, Float>> getExtraDropsDimMap() { return extraDropsDimMap; } + /** + * Makes a predicate for the GT normal ore veins worldgen + * @return the predicate + */ private Predicate makeOreLayerPredicate() { World world = this.getBaseMetaTileEntity().getWorld(); switch (world.provider.dimensionId) { @@ -211,6 +229,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } } + /** + * Makes a predicate for the GT normal small ore worldgen + * @return the predicate + */ private Predicate makeSmallOresPredicate() { World world = this.getBaseMetaTileEntity().getWorld(); switch (world.provider.dimensionId) { @@ -231,6 +253,11 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } } + /** + * Method used to add an ore to the droplist + * @param key a Pair of where the int is the meta of the ore, and the bool is true for BW ores, false for GT ores + * @param value the non normalised weight + */ private void addDrop(Pair key, float value){ final ItemStack ore = getOreItemStack(key); if (ConfigHandler.voidMinerBlacklist.contains(String.format("%s:%d", GameRegistry.findUniqueIdentifierFor(ore.getItem()).toString(), ore.getItemDamage()))) @@ -241,6 +268,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri dropmap.put(key, dropmap.get(key) + value); } + /** + * Method to add the ores of a vanilla GT worldgen + * @param oreLayerPredicate the predicate made by makeOreLayerPredicate + */ private void getDropsVanillaVeins(Predicate oreLayerPredicate) { GT_Worldgen_GT_Ore_Layer.sList.stream().filter(gt_worldgen -> gt_worldgen.mEnabled && oreLayerPredicate.test(gt_worldgen)).forEach(element -> { addDrop(new Pair<>((int) element.mPrimaryMeta,false), (float) element.mWeight); @@ -251,22 +282,20 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri ); } + /** + * Method to add the small ores of a vanilla GT worldgen + * @param smallOresPredicate the predicate made by makeSmallOresPredicate + */ private void getDropsVanillaSmallOres(Predicate smallOresPredicate) { GT_Worldgen_GT_Ore_SmallPieces.sList.stream().filter(gt_worldgen -> gt_worldgen.mEnabled && smallOresPredicate.test(gt_worldgen)).forEach(element -> addDrop(new Pair<>((int) element.mMeta,false), (float) element.mAmount) ); } - private void getDropMapVanilla() { - getDropsVanillaVeins(makeOreLayerPredicate()); - getDropsVanillaSmallOres(makeSmallOresPredicate()); - } - - private void getDropMapSpace(ModDimensionDef finalDef) { - getDropsOreVeinsSpace(finalDef); - getDropsSmallOreSpace(finalDef); - } - + /** + * add to the dropmap the ores from the gagreg space worldgen corresponding to the target dim + * @param finalDef ModDimensionDef corresponding to the target dim + */ private void getDropsOreVeinsSpace(ModDimensionDef finalDef) { Set space = GalacticGreg.oreVeinWorldgenList.stream() .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof GT_Worldgen_GT_Ore_Layer_Space && ((GT_Worldgen_GT_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) @@ -282,6 +311,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri ); } + /** + * add to the dropmap the small ores from the gagreg space worldgen corresponding to the target dim + * @param finalDef ModDimensionDef corresponding to the target dim + */ private void getDropsSmallOreSpace(ModDimensionDef finalDef) { Set space = GalacticGreg.smallOreWorldgenList.stream() .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof GT_Worldgen_GT_Ore_SmallPieces_Space && ((GT_Worldgen_GT_Ore_SmallPieces_Space) gt_worldgen).isEnabledForDim(finalDef)) @@ -293,6 +326,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri ); } + /** + * method used to pick the next key in the dropmap that will be used to generate the ore. + * @return the chosen key + */ private Pair getOreDamage() { float curentWeight = 0.f; while (true) { @@ -305,6 +342,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } } + /** + * Method used to check the current gat and its corresponding multiplier + * @return the noble gas in the hatch. returns null if there is no noble gas found. + */ private FluidStack getNobleGasInputAndSetMultiplier() { for (FluidStack s : this.getStoredFluids()) { for (int i = 0; i < NOBLE_GASSES.length; i++) { @@ -318,6 +359,11 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri return null; } + /** + * method used to decrement the quantity of gas in the hatch + * @param gasToConsume the fluid stack in the hatch + * @return if yes or no it was able to decrement the quantity of the fluidstack + */ private boolean consumeNobleGas(FluidStack gasToConsume) { for (FluidStack s : this.getStoredFluids()) { if (s.isFluidEqual(gasToConsume) && s.amount >= 1) { @@ -329,12 +375,19 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri return false; } + /** + * handler for the fluid consumption + */ private void handleFluidConsumption() { FluidStack storedNobleGas = getNobleGasInputAndSetMultiplier(); if (storedNobleGas == null || !consumeNobleGas(storedNobleGas)) multiplier = TIER_MULTIPLIER; } + /** + * Handles the addition of Ross dims' ores into the drop map + * @param aID dim id of Ross128b or Ross128ba + */ private void getDropMapRoss(int aID) { Consumer addToList = makeAddToList(); BW_OreLayer.sList.stream() @@ -343,12 +396,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri .forEach(addToList); } - private void getDropMapBartworks(ModDimensionDef finalDef) { - Consumer addToList = makeAddToList(); - addOresVeinsBartworks(finalDef, addToList); - addSmallOresBartworks(finalDef); - } - + /** + * Method used to generate a consumer used specifically to add BW ores into the dropmap + * @return the consumer + */ private Consumer makeAddToList() { return element -> { List> data = element.getStacksRawData(); @@ -361,6 +412,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri }; } + /** + * Method used to build the ModDimensionDef object corresponding to the dimension the VM is in. + * @return the ModDimensionDef object. + */ private ModDimensionDef makeModDimDef() { return getModContainers().stream() .flatMap(modContainer -> modContainer.getDimensionList().stream()) @@ -369,6 +424,11 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri .findFirst().orElse(null); } + /** + * Handles the addition of small ores for bartwork dims + * @param finalDef the ModDimensionDef object corresponding to the dim + * @param addToList a consumer used to add the ores from the vein with proper weight + */ private void addOresVeinsBartworks(ModDimensionDef finalDef, Consumer addToList) { try { Set space = GalacticGreg.oreVeinWorldgenList.stream() @@ -379,6 +439,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } catch (NullPointerException ignored) {} } + /** + * Handles the addition of small ores for bartwork dims + * @param finalDef the ModDimensionDef object corresponding to the dim + */ private void addSmallOresBartworks(ModDimensionDef finalDef) { try { Set space = GalacticGreg.smallOreWorldgenList.stream() @@ -392,28 +456,54 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } catch (NullPointerException ignored) {} } + /** + * Handles the ores added manually with addMatierialToDimensionList + * @param id the specified dim id + */ private void handleExtraDrops(int id) { Optional.ofNullable(getExtraDropsDimMap().get(id)).ifPresent(e -> e.forEach(f -> addDrop(f.getKey(), f.getValue()))); } + /** + * Computes the total weight for normalisation + */ private void calculateTotalWeight() { totalWeight = 0.0f; dropmap.values().forEach(f -> totalWeight += f); } + /** + * Computes the ores of the dim for the specifed dim id + * @param id the dim number + */ private void handleModDimDef(int id) { + //vanilla dims or TF if ((id <= 1 && id >= -1) || id == 7) { - getDropMapVanilla(); + getDropsVanillaVeins(makeOreLayerPredicate()); + getDropsVanillaSmallOres(makeSmallOresPredicate()); + + // ross dims } else if (id == ConfigHandler.ross128BID || id == ConfigHandler.ross128BAID) { getDropMapRoss(id); + + // other space dims } else { Optional.ofNullable(makeModDimDef()).ifPresent(def -> { - getDropMapSpace(def); - getDropMapBartworks(def); + //normal space dim + getDropsOreVeinsSpace(def); + getDropsSmallOreSpace(def); + + // BW space dim + Consumer addToList = makeAddToList(); + addOresVeinsBartworks(def, addToList); + addSmallOresBartworks(def); }); } } + /** + * Computes first the ores related to the dim the VM is in, then the ores added manually, then it computes the totalweight for normalisation + */ private void calculateDropMap() { dropmap = new HashMap<>(); int id = this.getBaseMetaTileEntity().getWorld().provider.dimensionId; @@ -422,11 +512,9 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri calculateTotalWeight(); } - private void makeDropMap() { - if (dropmap == null || totalWeight == 0) - calculateDropMap(); - } - + /** + * Output logic of the VM + */ private void handleOutputs() { Pair stats = getOreDamage(); final List inputOres = this.getStoredInputs().stream().filter(GT_Utility::isOre).collect(Collectors.toList()); @@ -438,6 +526,11 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri this.updateSlots(); } + /** + * Builds the ore item stack from the key specified in the dropmap + * @param stats the key of the dropmap + * @return an ItemStack corresponding to the target ore, with a stacksize corresponding to the mutiplier induced by the gas used + */ private ItemStack getOreItemStack(Pair stats) { return new ItemStack(stats.getValue() ? WerkstoffLoader.BWOres : GregTech_API.sBlockOres1, multiplier, stats.getKey()); } -- cgit From fe0e98b1e835ce3325018ce9ae18eaf6df95da18 Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Wed, 22 Jun 2022 09:01:13 +0100 Subject: Add customizable EBF gas recipe time and gas consumption multipliers (#137) * Add customizable EBF gas recipe time and gas consumption multipliers * Add missing variables to equals&hashCode Former-commit-id: b5abf76d28994a85961a39e379cba9a4166248cd --- build.gradle | 46 +++++--- dependencies.gradle | 8 +- .../common/loaders/StaticRecipeChangeLoaders.java | 123 +++++++++++++++++---- .../bartworks/system/material/Werkstoff.java | 34 +++++- 4 files changed, 164 insertions(+), 47 deletions(-) diff --git a/build.gradle b/build.gradle index 5906f8fc98..c09bee22f3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1644894948 +//version: 1652851397 /* DO NOT CHANGE THIS FILE! @@ -6,12 +6,11 @@ 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 org.gradle.internal.logging.text.StyledTextOutput -import org.gradle.internal.logging.text.StyledTextOutputFactory -import org.gradle.internal.logging.text.StyledTextOutput.Style import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import org.gradle.internal.logging.text.StyledTextOutput.Style +import org.gradle.internal.logging.text.StyledTextOutputFactory import java.util.concurrent.TimeUnit @@ -45,13 +44,14 @@ plugins { id 'eclipse' id 'scala' id 'maven-publish' - id 'org.jetbrains.kotlin.jvm' version '1.5.30' apply false - id 'org.jetbrains.kotlin.kapt' version '1.5.30' apply false + id 'org.jetbrains.kotlin.jvm' version '1.5.30' apply false + id 'org.jetbrains.kotlin.kapt' version '1.5.30' apply false + id 'com.google.devtools.ksp' version '1.5.30-1.0.0' apply false id 'org.ajoberstar.grgit' version '4.1.1' id 'com.github.johnrengelman.shadow' version '4.0.4' - id 'com.palantir.git-version' version '0.13.0' apply false + id 'com.palantir.git-version' version '0.13.0' apply false id 'de.undercouch.download' version '5.0.1' - id 'com.github.gmazzo.buildconfig' version '3.0.3' apply false + id 'com.github.gmazzo.buildconfig' version '3.0.3' apply false } if (project.file('.git/HEAD').isFile()) { @@ -104,6 +104,7 @@ checkPropertyExists("usesShadowedDependencies") checkPropertyExists("developmentEnvironmentUserName") boolean noPublishedSources = project.findProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false +boolean usesMixinDebug = project.findProperty('usesMixinDebug') ?: project.usesMixins.toBoolean() String javaSourceDir = "src/main/java/" String scalaSourceDir = "src/main/scala/" @@ -214,13 +215,17 @@ else { def arguments = [] def jvmArguments = [] -if(usesMixins.toBoolean()) { +if (usesMixins.toBoolean()) { arguments += [ - "--tweakClass org.spongepowered.asm.launch.MixinTweaker" - ] - jvmArguments += [ - "-Dmixin.debug.countInjections=true", "-Dmixin.debug.verbose=true", "-Dmixin.debug.export=true" + "--tweakClass org.spongepowered.asm.launch.MixinTweaker" ] + if (usesMixinDebug.toBoolean()) { + jvmArguments += [ + "-Dmixin.debug.countInjections=true", + "-Dmixin.debug.verbose=true", + "-Dmixin.debug.export=true" + ] + } } minecraft { @@ -312,18 +317,23 @@ def refMap = "${tasks.compileJava.temporaryDir}" + File.separator + mixingConfig def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg" task generateAssets { - if(usesMixins.toBoolean()) { - getFile("/src/main/resources/mixins." + modId + ".json").text = """{ + if (usesMixins.toBoolean()) { + def mixinConfigFile = getFile("/src/main/resources/mixins." + modId + ".json"); + if (!mixinConfigFile.exists()) { + mixinConfigFile.text = """{ "required": true, "minVersion": "0.7.11", "package": "${modGroup}.${mixinsPackage}", "plugin": "${modGroup}.${mixinPlugin}", "refmap": "${mixingConfigRefMap}", "target": "@env(DEFAULT)", - "compatibilityLevel": "JAVA_8" + "compatibilityLevel": "JAVA_8", + "mixins": [], + "client": [], + "server": [] } - """ + } } } @@ -559,7 +569,7 @@ publishing { artifact source: shadowJar, classifier: "" } if(!noPublishedSources) { - artifact source: sourcesJar, classifier: "src" + artifact source: sourcesJar, classifier: "sources" } artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev" if (apiPackage) { diff --git a/dependencies.gradle b/dependencies.gradle index 34df9bf9d4..3e93aaf029 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,10 +1,10 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.42:dev") - compile("com.github.GTNewHorizons:StructureLib:1.0.15:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.49:dev") + compile("com.github.GTNewHorizons:StructureLib:1.0.16:dev") compile("com.github.GTNewHorizons:TecTech:4.10.18:dev") - compile("com.github.GTNewHorizons:NotEnoughItems:2.2.12-GTNH:dev") + compile("com.github.GTNewHorizons:NotEnoughItems:2.2.15-GTNH:dev") compile("com.github.GTNewHorizons:TinkersConstruct:1.9.0.13-GTNH:dev") compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.3:dev") compile("com.github.GTNewHorizons:CodeChickenCore:1.1.3:dev") @@ -14,7 +14,7 @@ dependencies { } compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") - compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-75-GTNH:dev") { + compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-86-GTNH:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:AppleCore:3.1.9:dev") { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 6282852d58..154d2a03d6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -33,7 +33,12 @@ import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.google.common.collect.ArrayListMultimap; import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.enums.*; +import gnu.trove.map.hash.TObjectDoubleHashMap; +import gregtech.api.enums.Element; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -46,23 +51,51 @@ import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.reflect.FieldUtils; import java.lang.reflect.Field; import java.lang.reflect.Modifier; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.ANAEROBE_GAS; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.NOBLE_GAS; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Oganesson; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.fluids; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.molten; import static gregtech.api.enums.GT_Values.VN; public class StaticRecipeChangeLoaders { + private static TObjectDoubleHashMap gtEbfGasRecipeTimeMultipliers = null; + private static TObjectDoubleHashMap gtEbfGasRecipeConsumptionMultipliers = null; + private StaticRecipeChangeLoaders() { } public static void addEBFGasRecipes() { + if (gtEbfGasRecipeTimeMultipliers == null) { + // For Werkstoff gases, use Werkstoff.Stats.setEbfGasRecipeTimeMultiplier + gtEbfGasRecipeTimeMultipliers = new TObjectDoubleHashMap<>(10, 0.5F, -1.0D); // keep default value as -1 + // Example to make Argon cut recipe times into a third of the original: + // gtEbfGasRecipeTimeMultipliers.put(Materials.Argon, 1.0D / 3.0D); + } + if (gtEbfGasRecipeConsumptionMultipliers == null) { + // For Werkstoff gases, use Werkstoff.Stats.setEbfGasRecipeConsumedAmountMultiplier + gtEbfGasRecipeConsumptionMultipliers = new TObjectDoubleHashMap<>(10, 0.5F, 1.0D); // keep default value as 1 + // Example to make Argon recipes use half the gas amount of the primary recipe (1000L->500L, 2000L->1000L etc.): + // gtEbfGasRecipeConsumptionMultipliers.put(Materials.Argon, 1.0D / 2.0D); + } ArrayListMultimap toChange = getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS); editRecipes(toChange, getNoGasItems(toChange)); } @@ -281,12 +314,16 @@ public class StaticRecipeChangeLoaders { } } + /** + * Constructs a list of recipes to change by scanning all EBF recipes for uses of noble gases. + * @param GasTags list of gas tags to look out for in EBF recipes + * @return A multimap from the gas tag (noble and/or anaerobic) to all the recipes containing a gas with that tag + */ private static ArrayListMultimap getRecipesToChange(SubTag... GasTags) { ArrayListMultimap toAdd = ArrayListMultimap.create(); for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList) { if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) { - String FluidString = recipe.mFluidInputs[0].getFluid().getName().replaceAll("molten", "").replaceAll("fluid", ""); - Materials mat = Materials.get(FluidString.substring(0, 1).toUpperCase() + FluidString.substring(1)); + Materials mat = getMaterialFromInputFluid(recipe); if (mat != Materials._NULL) { for (SubTag tag : GasTags) { if (mat.contains(tag)) { @@ -300,6 +337,12 @@ public class StaticRecipeChangeLoaders { return toAdd; } + /** + * Scans EBF recipes for no-gas variants of the recipes present in base. + * Adds these recipes to the base multimap. + * @param base The recipe multimap to scan and modify + * @return Set of item outputs (recipe.mOutputs[0]) of the no-gas recipes + */ private static HashSet getNoGasItems(ArrayListMultimap base) { HashSet toAdd = new HashSet<>(); ArrayListMultimap repToAdd = ArrayListMultimap.create(); @@ -321,25 +364,54 @@ public class StaticRecipeChangeLoaders { return toAdd; } - private static void editEBFMaterialRecipes(SubTag GasTag, GT_Recipe recipe, Materials mat, HashSet toAdd) { - for (Materials materials : Materials.values()) { - if (materials.contains(GasTag)) { - int time = (int) ((double) recipe.mDuration / 200D * (200D + (materials.getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) materials.getProtons() : (double) mat.getProtons() * 2.75D - (double) materials.getProtons()))); - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{materials.getGas(recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); + private static int transformEBFGasRecipeTime(int originalDuration, long originalGasProtons, long newGasProtons) { + double protonTerm = (double) originalGasProtons * (newGasProtons >= originalGasProtons ? 1.0D : 2.75D) - (double) newGasProtons; + return Math.max(1, (int) ((double) originalDuration / 200D * Math.max(200D + protonTerm, 1D))); + } + + private static int transformEBFGasRecipeTime(GT_Recipe recipe, Materials originalGas, Materials newGas) { + double newEbfMul = gtEbfGasRecipeTimeMultipliers.get(newGas); + if (newEbfMul < 0.0D) { + return transformEBFGasRecipeTime(recipe.mDuration, originalGas.getProtons(), newGas.getProtons()); + } else { + return Math.max(1, (int) ((double) recipe.mDuration * newEbfMul)); + } + } + + private static int transformEBFGasRecipeTime(GT_Recipe recipe, Materials originalGas, Werkstoff newGas) { + double newEbfMul = newGas.getStats().getEbfGasRecipeTimeMultiplier(); + if (newEbfMul < 0.0D) { + return transformEBFGasRecipeTime(recipe.mDuration, originalGas.getProtons(), newGas.getStats().getProtons()); + } else { + return Math.max(1, (int) ((double) recipe.mDuration * newEbfMul)); + } + } + + private static int transformEBFNoGasRecipeTime(GT_Recipe recipe, Materials originalGas) { + return transformEBFGasRecipeTime(recipe.mDuration, originalGas.getProtons(), 0); + } + + private static void editEBFMaterialRecipes(SubTag GasTag, GT_Recipe recipe, Materials originalGas, HashSet toAdd) { + for (Materials newGas : Materials.values()) { + if (newGas.contains(GasTag)) { + int time = transformEBFGasRecipeTime(recipe, originalGas, newGas); + int gasAmount = Math.max(1, (int) Math.round((double) recipe.mFluidInputs[0].amount * gtEbfGasRecipeConsumptionMultipliers.get(newGas))); + toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{newGas.getGas(gasAmount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); } } } - private static void editEBFWerkstoffRecipes(SubTag GasTag, GT_Recipe recipe, Materials mat, HashSet toAdd) { - for (Werkstoff werkstoff : Werkstoff.werkstoffHashMap.values()) { - if (werkstoff.contains(GasTag)) { - int time = (int) ((double) recipe.mDuration / 200D * (200D + (werkstoff.getStats().getProtons() >= mat.getProtons() ? (double) mat.getProtons() - (double) werkstoff.getStats().getProtons() : (double) mat.getProtons() * 2.75D - (double) werkstoff.getStats().getProtons()))); - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); + private static void editEBFWerkstoffRecipes(SubTag GasTag, GT_Recipe recipe, Materials originalGas, HashSet toAdd) { + for (Werkstoff newGas : Werkstoff.werkstoffHashMap.values()) { + if (newGas.contains(GasTag)) { + int time = transformEBFGasRecipeTime(recipe, originalGas, newGas); + int gasAmount = Math.max(1, (int) Math.round((double) recipe.mFluidInputs[0].amount * newGas.getStats().getEbfGasRecipeConsumedAmountMultiplier())); + toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); } } } - private static void editEBFNoGasRecipes(GT_Recipe recipe, Materials mat, HashSet toAdd, HashSet noGas) { + private static void editEBFNoGasRecipes(GT_Recipe recipe, Materials originalGas, HashSet toAdd, HashSet noGas) { for (ItemStack is : noGas) { byte circuitConfiguration = 1; if (GT_Utility.areStacksEqual(is, recipe.mOutputs[0])) { @@ -351,7 +423,7 @@ public class StaticRecipeChangeLoaders { inputs.add(stack); } inputs.add(GT_Utility.getIntegratedCircuit(circuitConfiguration)); - toAdd.add(new BWRecipes.DynamicGTRecipe(false, inputs.toArray(new ItemStack[0]), recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + ((double) mat.getProtons() * 2.75D))), recipe.mEUt, recipe.mSpecialValue)); + toAdd.add(new BWRecipes.DynamicGTRecipe(false, inputs.toArray(new ItemStack[0]), recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, transformEBFNoGasRecipeTime(recipe, originalGas), recipe.mEUt, recipe.mSpecialValue)); break; } } @@ -380,8 +452,11 @@ public class StaticRecipeChangeLoaders { } private static Materials getMaterialFromInputFluid(GT_Recipe recipe) { - String materialString = recipe.mFluidInputs[0].getFluid().getName().replaceAll("molten", "").replaceAll("fluid", ""); - return Materials.get(materialString.substring(0, 1).toUpperCase() + materialString.substring(1)); + String materialString = recipe.mFluidInputs[0].getFluid().getName(); + materialString = StringUtils.removeStart(materialString, "molten"); + materialString = StringUtils.removeStart(materialString, "fluid"); + materialString = StringUtils.capitalize(materialString); + return Materials.get(materialString); } private static void editRecipes(ArrayListMultimap base, HashSet noGas) { @@ -393,11 +468,11 @@ public class StaticRecipeChangeLoaders { for (SubTag gasTag : base.keySet()) { for (GT_Recipe recipe : base.get(gasTag)) { if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) { - Materials mat = getMaterialFromInputFluid(recipe); - if (mat != Materials._NULL) { - editEBFWerkstoffRecipes(gasTag, recipe, mat, toAdd); - editEBFMaterialRecipes(gasTag, recipe, mat, toAdd); - editEBFNoGasRecipes(recipe, mat, toAdd, noGas); + Materials originalGas = getMaterialFromInputFluid(recipe); + if (originalGas != Materials._NULL) { + editEBFWerkstoffRecipes(gasTag, recipe, originalGas, toAdd); + editEBFMaterialRecipes(gasTag, recipe, originalGas, toAdd); + editEBFNoGasRecipes(recipe, originalGas, toAdd, noGas); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 17b390713f..49672d3706 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.system.material; +import com.github.bartimaeusnek.bartworks.common.loaders.StaticRecipeChangeLoaders; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -855,6 +856,33 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } + public double getEbfGasRecipeTimeMultiplier() { + return this.ebfGasRecipeTimeMultiplier; + } + + /** + * The generated EBF recipes using this gas will have their duration multiplied by this number. + * If set to a negative value, the default proton count-based logic is used. + * For GT Materials gases, add the overrides to {@link StaticRecipeChangeLoaders#addEBFGasRecipes()} + */ + public Werkstoff.Stats setEbfGasRecipeTimeMultiplier(double timeMultiplier) { + this.ebfGasRecipeTimeMultiplier = timeMultiplier; + return this; + } + + public double getEbfGasRecipeConsumedAmountMultiplier() { + return this.ebfGasRecipeConsumedAmountMultiplier; + } + + /** + * The generated EBF recipes using this gas will have the amount of gas consumed multiplied by this number. + * For GT Materials gases, add the overrides to {@link StaticRecipeChangeLoaders#addEBFGasRecipes()} + */ + public Werkstoff.Stats setEbfGasRecipeConsumedAmountMultiplier(double amountMultiplier) { + this.ebfGasRecipeConsumedAmountMultiplier = amountMultiplier; + return this; + } + public int getDurOverride() { return durOverride; } @@ -891,6 +919,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { private long neutrons; private long electrons; private long mass; + private double ebfGasRecipeTimeMultiplier = -1.0; + private double ebfGasRecipeConsumedAmountMultiplier = 1.0; float durMod = 1f; @@ -934,12 +964,14 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (this.protons != that.protons) return false; if (this.neutrons != that.neutrons) return false; if (this.electrons != that.electrons) return false; + if (Math.abs(this.ebfGasRecipeTimeMultiplier - that.ebfGasRecipeTimeMultiplier) > 1.0e-6D) return false; + if (Math.abs(this.ebfGasRecipeConsumedAmountMultiplier - that.ebfGasRecipeConsumedAmountMultiplier) > 1.0e-6D) return false; return this.quality == that.quality; } @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(49).put(this.quality).putInt(this.boilingPoint).putInt(this.meltingPoint).putLong(this.protons).putLong(this.neutrons).putLong(this.electrons).putLong(this.mass).array(), 0, 49, 31); + return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(49).put(this.quality).putInt(this.boilingPoint).putInt(this.meltingPoint).putLong(this.protons).putLong(this.neutrons).putLong(this.electrons).putLong(this.mass).putDouble(this.ebfGasRecipeTimeMultiplier).putDouble(this.ebfGasRecipeConsumedAmountMultiplier).array(), 0, 49, 31); } public Werkstoff.Stats setMass(long mass) { -- cgit From aa705de98dfcb52142100098df225d3514985f01 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Wed, 22 Jun 2022 17:03:26 +0800 Subject: fix double consumption from wildcard and oredict (#139) * fix double consumption from wildcard and oredict sometimes the wildcard item also has oredict, it will cause double consumption * fix Former-commit-id: 36a91e713055060bc5a65b6c5bf07aebcc53898b --- .../bartworks/util/RecipeFinderForParallel.java | 28 ++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java index 052c29eff2..2988df6b7f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java @@ -89,18 +89,6 @@ public class RecipeFinderForParallel { } /*OreDict Stuff*/ - for (int tItem : tCompressedItemRecipe.keySet()) { - ItemStack tRealRecipe = GT_Utility.intToStack(tItem); - int tTargetAmount = tCompressedItemRecipe.get(tItem); - for (ItemStack input : aItemStacks) { - if (GT_OreDictUnificator.isInputStackEqual(input, tRealRecipe)) { - int d = Math.min(tTargetAmount, input.stackSize); - tTargetAmount -= d; - input.stackSize -= d; - } - if (tTargetAmount == 0) break; - } - } /*Wildcard Stuff*/ for (int tItem : tCompressedItemRecipe.keySet()) { if (tItem >> 16 == Short.MAX_VALUE) { @@ -119,6 +107,22 @@ public class RecipeFinderForParallel { } } } + else { + ItemStack tRealRecipe = GT_Utility.intToStack(tItem); + int tTargetAmount = tCompressedItemRecipe.get(tItem); + for (ItemStack input : aItemStacks) { + if (GT_OreDictUnificator.isInputStackEqual(input, tRealRecipe)) { + int d = Math.min(tTargetAmount, input.stackSize); + tTargetAmount -= d; + tCompressedItemRecipe.put(tItem, tTargetAmount); + input.stackSize -= d; + } + if (tTargetAmount == 0) { + tCompressedItemRecipe.remove(tItem); + break; + } + } + } } return tCurrentPara; -- cgit From 5729dea093673933e4e1ff7f4c25b7e318e0e29f Mon Sep 17 00:00:00 2001 From: Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com> Date: Thu, 23 Jun 2022 17:22:26 +0100 Subject: Custom EIC Recipe (#140) * Allow fluids to be accepted/outputted from EIC. * Temp recipe until GT updated for EIC only. * Unused import. * Improve coil texture (from Jimbno). * Add overclocking. * Custom recipe for EIC. * Bump gradle version. * Change to molten spacetime. * Bump dep again. Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Former-commit-id: 54df48938d82a9e8d28e77444f6c304fe1abba91 --- dependencies.gradle | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 1 + .../common/loaders/StaticRecipeChangeLoaders.java | 23 ++++++++++++++++----- .../GT_TileEntity_ElectricImplosionCompressor.java | 19 ++++++++++++----- .../bartworks/textures/blocks/TransformerCoil.png | Bin 1249 -> 665 bytes 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 3e93aaf029..39787abe10 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.49:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.56-dev:dev") compile("com.github.GTNewHorizons:StructureLib:1.0.16:dev") compile("com.github.GTNewHorizons:TecTech:4.10.18:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.2.15-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index f0b1be2d03..7b645304a2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -60,6 +60,7 @@ import java.io.IOException; import java.util.Map; import static com.github.bartimaeusnek.bartworks.common.loaders.BioRecipeLoader.runOnServerStarted; +import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.removeIC2Recipes; import static gregtech.api.enums.GT_Values.VN; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 154d2a03d6..098dd2c8d0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -32,13 +32,10 @@ import com.github.bartimaeusnek.bartworks.util.StreamUtils; import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.google.common.collect.ArrayListMultimap; +import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; import gnu.trove.map.hash.TObjectDoubleHashMap; -import gregtech.api.enums.Element; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.SubTag; +import gregtech.api.enums.*; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -73,6 +70,8 @@ import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Oganesson; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.fluids; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.molten; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static gregtech.api.enums.GT_Values.MOD_ID_FR; import static gregtech.api.enums.GT_Values.VN; public class StaticRecipeChangeLoaders { @@ -489,6 +488,20 @@ public class StaticRecipeChangeLoaders { eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream().filter(e -> e.mInputs != null).forEach(recipe -> eicMap.addRecipe(true, Arrays.stream(recipe.mInputs).filter(e -> !StaticRecipeChangeLoaders.checkForExplosives(e)).distinct().toArray(ItemStack[]::new), recipe.mOutputs, null, null, null, 1, BW_Util.getMachineVoltageFromTier(10), 0)); } + + // Custom electric implosion compressor recipe. Cannot be overclocked. + if (Loader.isModLoaded("eternalsingularity")) { + + // 1L SpaceTime -> 1 Eternal singularity. + eicMap.addRecipe( + false, + new ItemStack[]{GT_Values.NI}, + new ItemStack[]{GT_ModHandler.getModItem("eternalsingularity", "eternal_singularity", 1L)}, + null, + new FluidStack[]{Materials.SpaceTime.getMolten(1L)}, + new FluidStack[]{GT_Values.NF}, + 100*20, 128_000_000, 1); // aSpecialVaue has no meaning here. + } } private static boolean checkForExplosives(ItemStack input) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 95e8f311ec..18e0ec9272 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -43,12 +43,14 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static gregtech.api.enums.GT_Values.V; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity_EnhancedMultiBlockBase { @@ -180,15 +182,22 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } } - ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); + ItemStack[] tItemInputs = tInputList.toArray(new ItemStack[0]); + FluidStack[] tFluidInputs = getCompactedFluids(); + + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + + if (tInputList.size() > 0) { - GT_Recipe tRecipe = GT_TileEntity_ElectricImplosionCompressor.eicMap.findRecipe(this.getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); - if (tRecipe != null && tRecipe.isRecipeInputEqual(true, null, tInputs)) { + GT_Recipe tRecipe = GT_TileEntity_ElectricImplosionCompressor.eicMap.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluidInputs, tItemInputs); + if (tRecipe != null && tRecipe.isRecipeInputEqual(true, tFluidInputs, tItemInputs)) { this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; this.mEfficiencyIncrease = 10000; this.mEUt = -tRecipe.mEUt; - this.mMaxProgresstime = Math.max(1, tRecipe.mDuration); - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; + calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); + this.mOutputItems = tRecipe.mOutputs.clone(); + this.mOutputFluids = tRecipe.mFluidOutputs.clone(); this.sendLoopStart((byte) 20); this.updateSlots(); return true; diff --git a/src/main/resources/assets/bartworks/textures/blocks/TransformerCoil.png b/src/main/resources/assets/bartworks/textures/blocks/TransformerCoil.png index 205816b31f..79801b0471 100644 Binary files a/src/main/resources/assets/bartworks/textures/blocks/TransformerCoil.png and b/src/main/resources/assets/bartworks/textures/blocks/TransformerCoil.png differ -- cgit From acc30659db177dddc62d591050e9294361282492 Mon Sep 17 00:00:00 2001 From: miozune Date: Sun, 26 Jun 2022 08:12:06 +0900 Subject: Fix CAL not being adapted to extended facing (#143) Former-commit-id: 859aefed719b1e32636d90a4c2b1e74a2a2e8342 --- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 7699184abc..be9307317e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -41,7 +41,6 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -51,8 +50,8 @@ import java.util.HashSet; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; import static net.minecraft.util.StatCollector.translateToLocal; public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_EnhancedMultiBlockBase { @@ -336,7 +335,18 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(16), TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_GLOW).glow().build()))} : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(16)}; + if (aSide == aFacing) { + if (aActive) + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(16), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW).extFacing().glow().build()}; + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(16), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW).extFacing().glow().build()}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(16)}; } private static final String[] description = new String[] { -- cgit From 746f08dacdbf6be5e239e9ce1856395a1bcef7ec Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Sun, 26 Jun 2022 21:17:47 +0200 Subject: Fix Concurrent Modification Exception (#146) Former-commit-id: 168fc321d252ea1526cb076b15213c1e1454fc01 --- .../bartimaeusnek/bartworks/util/RecipeFinderForParallel.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java index 2988df6b7f..50f5f4f685 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java @@ -8,6 +8,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; /** * Handle the parallel more efficient. @@ -90,14 +91,15 @@ public class RecipeFinderForParallel { /*OreDict Stuff*/ /*Wildcard Stuff*/ - for (int tItem : tCompressedItemRecipe.keySet()) { + for (Iterator i = tCompressedItemRecipe.keySet().iterator(); i.hasNext();) { + int tItem = i.next(); if (tItem >> 16 == Short.MAX_VALUE) { for (ItemStack tInputItem : aItemStacks) { int InputID = GT_Utility.stackToInt(tInputItem); if ((InputID & 0xffff) == (tItem & 0xffff)) { if (tInputItem.stackSize >= tCompressedItemRecipe.get(tItem)) { tInputItem.stackSize -= tCompressedItemRecipe.get(tItem); - tCompressedItemRecipe.remove(tItem); + i.remove(); break; } else { @@ -118,7 +120,7 @@ public class RecipeFinderForParallel { input.stackSize -= d; } if (tTargetAmount == 0) { - tCompressedItemRecipe.remove(tItem); + i.remove(); break; } } -- cgit From 279bbc9c42ea9f51ad107d94e1e36bd25fc0f665 Mon Sep 17 00:00:00 2001 From: MuXiu1997 Date: Sat, 2 Jul 2022 11:21:44 +0800 Subject: Fix Werkstoff localization failure (#145) Former-commit-id: 63da58dca81194b18c428ed12c45215d99c68407 --- .../bartimaeusnek/bartworks/system/material/Werkstoff.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 49672d3706..9555b91ac5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -75,9 +75,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { private final HashSet SUBTAGS = new HashSet<>(); private byte[] rgb = new byte[3]; private final String defaultName; - private String localizedName; private String toolTip; - private String localizedToolTip; private Werkstoff.Stats stats; private final Werkstoff.Types type; @@ -185,8 +183,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.mID = (short) mID; this.defaultName = defaultName; + // Ensure that localization key are written to the lang file GregTech_API.sAfterGTPreload.add(() -> { - this.localizedName = GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.name", this.mID), defaultName); + this.getLocalizedName(); }); this.stats = stats; this.type = type; @@ -224,8 +223,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { // if (this.toolTip.length() > 25) // this.toolTip = "The formula is to long..."; + // Ensure that localization key are written to the lang file GregTech_API.sAfterGTPreload.add(() -> { - this.localizedToolTip = GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.tooltip", this.mID), toolTip); + this.getLocalizedToolTip(); }); if (this.stats.protons == 0) { @@ -408,7 +408,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public String getLocalizedName() { - return this.localizedName; + return GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.name", this.mID), defaultName, !GregTech_API.sPostloadFinished); } public String getVarName() { @@ -420,7 +420,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public String getLocalizedToolTip() { - return this.localizedToolTip; + return GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.tooltip", this.mID), toolTip, !GregTech_API.sPostloadFinished); } public Werkstoff.Stats getStats() { -- cgit From 68c88b0a08f0f914e10ed43f44d7c9b962b64f43 Mon Sep 17 00:00:00 2001 From: miozune Date: Sat, 2 Jul 2022 21:50:06 +0900 Subject: Add material owner tooltip (#147) * Add material owner tooltip * Improve translation Former-commit-id: 607f4e6d9fc61f32226e69da54b44784c4e333fb --- .../material/BW_MetaGeneratedBlock_Item.java | 9 ++++++- .../system/material/BW_MetaGenerated_Items.java | 8 +++++- .../bartworks/system/material/Werkstoff.java | 31 ++++++++++++++++++++++ .../bartworks/util/BW_Tooltip_Reference.java | 2 ++ .../resources/assets/bartworks/lang/en_US.lang | 1 + 5 files changed, 49 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java index 9875da9eab..c6a6f98d83 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java @@ -78,8 +78,15 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { Werkstoff werkstoff = Werkstoff.werkstoffHashMap.get((short) aStack.getItemDamage()); if(werkstoff != null) { aList.add(werkstoff.getLocalizedToolTip()); + String owner = werkstoff.getOwner(); + if (owner != null) { + aList.add(BW_Tooltip_Reference.ADDED_VIA_BARTWORKS.apply(owner)); + } else { + aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); + } + } else { + aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } - aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 56dfb0c138..7b22069f7b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -134,7 +134,13 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa if (aStack != null && aStack.getItem() instanceof BW_MetaGenerated_Items && aStack.getItemDamage() == WerkstoffLoader.Tiberium.getmID()) aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.nqgen")); - aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); + Werkstoff werkstoff = werkstoffHashMap.get((short) this.getDamage(aStack)); + String owner = werkstoff.getOwner(); + if (owner != null) { + aList.add(BW_Tooltip_Reference.ADDED_VIA_BARTWORKS.apply(owner)); + } else { + aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); + } } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 9555b91ac5..ac4a381fa6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -48,14 +48,18 @@ import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.Objects; import java.util.Optional; +import static net.minecraft.util.EnumChatFormatting.*; + @SuppressWarnings("ALL") public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @@ -63,6 +67,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static final LinkedHashMap werkstoffHashMap = new LinkedHashMap<>(); public static final LinkedHashMap werkstoffNameHashMap = new LinkedHashMap<>(); + /** + * {className, modName} + */ + public static final Map knownModNames = new HashMap(){{ + put("goodgenerator.items", GREEN + "Good Generator"); + put("com.elisis.gtnhlanth.common.register", GREEN + "GTNH: Lanthanides"); + put("galaxyspace.core.register", DARK_PURPLE + "GalaxySpace"); + }}; + private static final HashSet idHashSet = new HashSet<>(); private static final Werkstoff.Stats DEFAULT_NULL_STATS = new Werkstoff.Stats(); @@ -83,6 +96,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { private final short mID; private final TextureSet texSet; private Materials bridgeMaterial; + private final String owner; public Materials getBridgeMaterial() { return this.bridgeMaterial; @@ -288,6 +302,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.werkstoffHashSet.add(this); Werkstoff.werkstoffHashMap.put(this.mID, this); Werkstoff.werkstoffNameHashMap.put(this.defaultName, this); + + this.owner = getMaterialOwner(); } @@ -529,6 +545,21 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return OreDictHandler.getItemStack(this.getDefaultName(), prefixes,1) != null; } + public String getOwner() { + return owner; + } + + private String getMaterialOwner() { + for (StackTraceElement stacktrace : Thread.currentThread().getStackTrace()) { + for (Map.Entry entry : knownModNames.entrySet()) { + if (stacktrace.getClassName().contains(entry.getKey())) { + return entry.getValue(); + } + } + } + return null; + } + public enum Types { MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, ELEMENT, ISOTOPE, UNDEFINED; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java index c98d172148..5fc2a951ee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.util; import static net.minecraft.util.EnumChatFormatting.*; import net.minecraft.util.StatCollector; +import java.util.function.Function; import java.util.function.Supplier; public class BW_Tooltip_Reference { @@ -34,6 +35,7 @@ public class BW_Tooltip_Reference { public static final String TT = TT_NO_RESET + GRAY; public static final Supplier ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = () -> StatCollector.translateToLocal("tooltip.bw.1.name") + " " + BW; public static final Supplier ADDED_BY_BARTWORKS = () -> StatCollector.translateToLocal("tooltip.bw.0.name") + " " + BW; + public static final Function ADDED_VIA_BARTWORKS = owner -> String.format(StatCollector.translateToLocal("tooltip.bw.via.name"), owner); public static final String ADV_STR_CHECK = "Uses an advanced "+ TT +" structure check, due to "+ BW; public static final String TT_BLUEPRINT = "To see the structure, use a "+ TT + " Blueprint on the Controller!"; diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index cb38553b32..d1f9bf8606 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -85,6 +85,7 @@ tooltip.bw.tier.name=Tier: tooltip.bw.kg.0.name=kg tooltip.bw.kg.1.name=kgs tooltip.bw.empty.name=Empty +tooltip.bw.via.name=Added by %s§7 via §2BartWorks tooltip.teslastaff.0.name=No warranty! tooltip.labmodule.0.name=A Module used to change the BioLab's working Mode -- cgit From 477cd612b62264475e93feaa1d2d1cca62a5748c Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Sun, 3 Jul 2022 14:44:19 +0200 Subject: Buff Extreme Industrial Greenhouse's Speed and Lower IC2 Tier to LuV (#141) * Add possibility to get more outputs with fertilizer * Lower IC2 mode tier from UV to LUV * Typo * Add color formatting to description * License * Make Forestry fertilizer static and check if it exists * Buff EIG normal mode * Change color formatting Former-commit-id: c72c7cc266b500de50d27fb8b6904e45064e0264 --- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 88 +++++++++++++++++----- 1 file changed, 68 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index fdd5f29a7d..ecb28f0516 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2022 kuba6000 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; @@ -32,6 +49,7 @@ import net.minecraft.block.IGrowable; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; import net.minecraft.item.ItemSeeds; @@ -49,7 +67,6 @@ import java.util.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity_EnhancedMultiBlockBase { @@ -64,6 +81,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity private int waterusage = 0; private static final int CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; + private static final Item forestryfertilizer = GameRegistry.findItem("Forestry", "fertilizerCompound"); private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { {"ccccc", "ccccc", "ccccc", "ccccc", "ccccc"}, @@ -140,6 +158,10 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && f.isNotFlipped(); } + private static String tierString(int tier){ + return GT_Values.TIER_COLORS[tier] + GT_Values.VN[tier] + ChatColorHelper.RESET + ChatColorHelper.GRAY; + } + @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); @@ -150,6 +172,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity addInfo("Use screwdriver to enable/change/disable setup mode"). addInfo("Use screwdriver while sneaking to enable/disable IC2 mode"). addInfo("Uses 1000L of water per crop per operation"). + addInfo("You can insert fertilizer each operation to get more drops (max +400%)"). addInfo("-------------------- SETUP MODE --------------------"). addInfo("Does not take power"). addInfo("There are two modes: input / output"). @@ -157,22 +180,24 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity addInfo("[IC2] You need to also input block that is required under the crop"). addInfo("Output mode: machine will take planted seeds and output them"). addInfo("-------------------- NORMAL CROPS --------------------"). - addInfo("Minimal tier: EV"). + addInfo("Minimal tier: " + tierString(4)). addInfo("Starting with 1 slot"). addInfo("Every slot gives 64 crops"). - addInfo("Every tier past EV adds additional 2 slots"). + addInfo("Every tier past " + tierString(4) + ", slots are multiplied by 2"). addInfo("Base process time: 5 sec"). - addInfo("Process time is divided by number of tiers past HV (Minimum 1 sec)"). + addInfo("Process time is divided by number of tiers past " + tierString(3) + " (Minimum 1 sec)"). addInfo("All crops are grown at the end of the operation"). addInfo("Will automatically craft seeds if they are not dropped"). + addInfo("1 Fertilizer per 1 crop +200%"). addInfo("-------------------- IC2 CROPS --------------------"). - addInfo("Minimal tier: UV"). - addInfo("Need UV glass tier"). + addInfo("Minimal tier: " + tierString(6)). + addInfo("Need " + tierString(6) + " glass tier"). addInfo("Starting with 4 slots"). addInfo("Every slot gives 1 crop"). - addInfo("Every tier past UV, slots are multiplied by 4"). + addInfo("Every tier past " + tierString(6) + ", slots are multiplied by 4"). addInfo("Process time: 5 sec"). addInfo("All crops are accelerated by x32 times"). + addInfo("1 Fertilizer per 1 crop +10%"). addInfo("Cannot process primordial"). addInfo(BW_Tooltip_Reference.TT_BLUEPRINT). addSeparator(). @@ -272,8 +297,6 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 2, 5, 0); } - - @Override public boolean isCorrectMachinePart(ItemStack itemStack) { return true; @@ -283,12 +306,12 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity public boolean checkRecipe(ItemStack itemStack) { long v = this.getMaxInputVoltage(); int tier = GT_Utility.getTier(v); - if(tier < (isIC2Mode ? 8 : 4)) + if(tier < (isIC2Mode ? 6 : 4)) mMaxSlots = 0; else if(isIC2Mode) - mMaxSlots = 4 << (2 * (tier - 8)); + mMaxSlots = 4 << (2 * (tier - 6)); else - mMaxSlots = Math.max((tier - 4) * 2, 1); + mMaxSlots = 1 << (tier - 4); if(mStorage.size() > mMaxSlots) { // Void if user just downgraded power @@ -318,32 +341,58 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity return false; // OVERCLOCK + // FERTILIZER IDEA - IC2 +10% per fertilizer per crop per operation, NORMAL +200% per fertilizer per crop per operation + + int boost = 0; + int maxboost = 0; + for(GreenHouseSlot s : mStorage) + maxboost += s.input.stackSize * (isIC2Mode ? 40 : 2); + + ArrayList inputs = getStoredInputs(); + for(ItemStack i : inputs){ + if(( i.getItem() == Items.dye && i.getItemDamage() == 15) || + (forestryfertilizer != null && (i.getItem() == forestryfertilizer)) || + (GT_Utility.areStacksEqual(i, Ic2Items.fertilizer))) + { + int used = Math.min(i.stackSize, maxboost - boost); + i.stackSize -= used; + boost += used; + } + if(boost == maxboost) + break; + } + + double multiplier = 1.d + (((double)boost/(double)maxboost) * 4d); + if(isIC2Mode) { - if(glasTier < 8) + if(glasTier < 6) return false; this.mMaxProgresstime = 100; List outputs = new ArrayList<>(); for (int i = 0; i < Math.min(mMaxSlots, mStorage.size()); i++) - outputs.addAll(mStorage.get(i).getIC2Drops(this.mMaxProgresstime / 8)); + outputs.addAll(mStorage.get(i).getIC2Drops(((double)this.mMaxProgresstime / 8d) * multiplier)); this.mOutputItems = outputs.toArray(new ItemStack[0]); } else { this.mMaxProgresstime = Math.max(20, 100 / (tier - 3)); // Min 1 s List outputs = new ArrayList<>(); for (int i = 0; i < Math.min(mMaxSlots, mStorage.size()); i++) { - for (ItemStack drop : mStorage.get(i).getDrops()) - outputs.add(drop.copy()); + for (ItemStack drop : mStorage.get(i).getDrops()) { + ItemStack s = drop.copy(); + s.stackSize = (int)((double)s.stackSize * multiplier); + outputs.add(s); + } } this.mOutputItems = outputs.toArray(new ItemStack[0]); } this.mEUt = -(int)((double) GT_Values.V[tier] * 0.99d); this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; + this.updateSlots(); return true; } - @Override public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { mCasing = 0; @@ -724,11 +773,11 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity Map dropprogress = new HashMap<>(); static Map dropstacks = new HashMap<>(); - public List getIC2Drops(int timeelapsed){ + public List getIC2Drops(double timeelapsed){ int r = rn.nextInt(10); if(generations.size() <= r) return new ArrayList<>(); - double growthPercent = ((double)timeelapsed / (double)growthticks); + double growthPercent = (timeelapsed / (double)growthticks); List generation = generations.get(r); List copied = new ArrayList<>(); for(ItemStack g : generation) @@ -810,5 +859,4 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity } } - } -- cgit From 0be78e13a800968c6aa6ba9876ac0ebf212dde1a Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Mon, 4 Jul 2022 20:56:11 +0800 Subject: Standardization of BW Chemical Recipes (#144) * platline * mica line * fix cell electroize recipe * fix * misc fix * fix Former-commit-id: 0d1a1ef8eaceda791c95960606b9c37c4f6526cc --- .../common/loaders/ArtificialMicaLine.java | 32 ++-- .../GT_Enhancement/PlatinumSludgeOverHaul.java | 32 ++-- .../bartworks/system/material/WerkstoffLoader.java | 19 ++- .../processingLoaders/AdditionalRecipes.java | 8 +- .../werkstoff_loaders/recipe/CellLoader.java | 171 ++++++++++----------- 5 files changed, 138 insertions(+), 124 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java index 0063abf7c1..5ecbac56d6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java @@ -17,29 +17,29 @@ import net.minecraftforge.fluids.FluidStack; public class ArtificialMicaLine { public static void runArtificialMicaRecipe() { - //Mg + O = 2MgO + //Mg + O = MgO GT_Values.RA.addChemicalRecipe(Materials.Magnesium.getDust(1), null, Materials.Oxygen.getGas(1000), null, Materials.Magnesia.getDust(2), 40, 8); - //Si + 6HF = 7H2SiF6 - GT_Values.RA.addChemicalRecipe(Materials.Silicon.getDust(1), null, Materials.HydrofluoricAcid.getFluid(6000), WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(7000), null, 400, 120); - //K + Cl = 2KCl + //Si + 6HF = H2SiF6 + 4H + GT_Values.RA.addChemicalRecipe(Materials.Silicon.getDust(1), Materials.Empty.getCells(4), Materials.HydrofluoricAcid.getFluid(6000), WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000), Materials.Hydrogen.getCells(4), 400, 120); + //K + Cl = KCl GT_Values.RA.addChemicalRecipe(Materials.Potassium.getDust(1), GT_Utility.getIntegratedCircuit(2), Materials.Chlorine.getGas(1000), null, Materials.RockSalt.getDust(2), 20, 8); //2KCl + H2SiF6 = 2HCl + K2SiF6 - GT_Values.RA.addMixerRecipe(Materials.RockSalt.getDust(2), null, null, null, WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000), Materials.HydrochloricAcid.getGas(2000), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 1), 20, 8); - //2K + CO2 + O = 6K2CO3 - GT_Values.RA.addChemicalRecipe(Materials.Potassium.getDust(2), Materials.CarbonDioxide.getCells(1), Materials.Oxygen.getGas(1000), null, WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), 40, 8); - //K2O + CO2 = 6K2CO3 - GT_Values.RA.addChemicalRecipe(Materials.Potash.getDust(1), Materials.CarbonDioxide.getCells(1), null, null, WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), 40, 8); + GT_Values.RA.addMixerRecipe(Materials.RockSalt.getDust(4), null, null, null, WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000), Materials.HydrochloricAcid.getGas(2000), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 9), 20, 8); + //2K + CO2 + O = K2CO3 + GT_Values.RA.addChemicalRecipe(Materials.Potassium.getDust(2), Materials.CarbonDioxide.getCells(1), Materials.Oxygen.getGas(1000), null, WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), Materials.Empty.getCells(1), 40, 8); + //K2O + CO2 = K2CO3 + GT_Values.RA.addChemicalRecipe(Materials.Potash.getDust(3), Materials.CarbonDioxide.getCells(1), null, null, WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), Materials.Empty.getCells(1), 40, 8); //55Quartz Dust + 20K2SiF6 + 12Al2O3 + 4K2CO3 = 91Raw Fluorophlogopite Dust GT_Values.RA.addMixerRecipe(Materials.QuartzSand.getDust(55), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), null, null, 400, 120); - //55Quartzite/Nether Quartz Dust + 20K2SiF6 + 12Al2O3 + 4K2CO3 = 136Raw Fluorophlogopite Dust - GT_Values.RA.addMixerRecipe(Materials.Quartzite.getDust(55), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8), null, 600, 120); - GT_Values.RA.addMixerRecipe(Materials.NetherQuartz.getDust(55), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8), null, 600, 120); - //62Certus Quartz Dust + 10K2SiF6 + 12Al2O3 + 4K2CO3 = 91Raw Fluorophlogopite Dust - GT_Values.RA.addMixerRecipe(Materials.CertusQuartz.getDust(62), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 10), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), null, null, 600, 120); + //55Quartzite/Nether Quartz Dust + 20K2SiF6 + 57Al2O3 + 4K2CO3 = 136Raw Fluorophlogopite Dust + GT_Values.RA.addMixerRecipe(Materials.Quartzite.getDust(55), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8), null, 600, 120); + GT_Values.RA.addMixerRecipe(Materials.NetherQuartz.getDust(55), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8), null, 600, 120); + //62Certus Quartz Dust + 10K2SiF6 + 12Al2O3 + 7K2CO3 = 91Raw Fluorophlogopite Dust + GT_Values.RA.addMixerRecipe(Materials.CertusQuartz.getDust(62), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 10), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 7), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), null, null, 600, 120); //MgO(s) = MgO(l) GT_Values.RA.addFluidExtractionRecipe(Materials.Magnesia.getDust(1), null, Materials.Magnesia.getMolten(144), 0, 20, 120); - //27Raw Fluorophlogopite Dust + 432MgO(l) = 4608Fluorophlogopite(l) - GT_Values.RA.addBlastRecipe(WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), null, BW_GT_MaterialReference.Magnesia.getMolten(432), WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(4608), Materials.Glass.getDust(1), null, 600, 480, 1700); + //27Raw Fluorophlogopite Dust + 720MgO(l) = 4608Fluorophlogopite(l) + GT_Values.RA.addBlastRecipe(WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), null, BW_GT_MaterialReference.Magnesia.getMolten(720), WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(4608), Materials.Glass.getDust(1), null, 600, 480, 1700); //144Fluorophlogopite(l) = Fluorophlogopite GT_Recipe.GT_Recipe_Map.sVacuumRecipes.addRecipe(new GT_Recipe(false, new ItemStack[]{ItemList.Shape_Mold_Plate.get(0)}, new ItemStack[]{WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1)}, null, null, new FluidStack[]{WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(144)}, null, 10, 120, 0)); //Fluorophlogopite = 4Insulator Foil diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 90494ec1fa..fe1dbbe91b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -77,13 +77,16 @@ public class PlatinumSludgeOverHaul { private static void runHelperrecipes() { //DilutedSulfuricAcid - GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(3), Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, Materials.DilutedSulfuricAcid.getCells(4), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, Materials.SulfuricAcid.getFluid(3000), Materials.DilutedSulfuricAcid.getFluid(4000), Materials.Empty.getCells(1), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(3), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Water.getFluid(1000), Materials.DilutedSulfuricAcid.getFluid(4000), Materials.Empty.getCells(3), 30, 30); + // 2H2SO4 + H2O = 3H2SO4(d) + GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(2), Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, Materials.DilutedSulfuricAcid.getCells(3), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, Materials.SulfuricAcid.getFluid(2000), Materials.DilutedSulfuricAcid.getFluid(3000), Materials.Empty.getCells(1), 30, 30); + GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(2), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Water.getFluid(1000), Materials.DilutedSulfuricAcid.getFluid(3000), Materials.Empty.getCells(2), 30, 30); //FormicAcid - GT_Values.RA.addChemicalRecipe(Materials.CarbonMonoxide.getCells(1), Materials.SodiumHydroxide.getDust(1), null, null, Sodiumformate.get(cell), null, 15); - GT_Values.RA.addChemicalRecipe(Sodiumformate.get(cell, 2), GT_Utility.getIntegratedCircuit(1), Materials.SulfuricAcid.getFluid(1000), null, FormicAcid.get(cell, 2), Sodiumsulfate.get(dust, 1), 15); - GT_Values.RA.addChemicalRecipe(Materials.SulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Sodiumformate.getFluidOrGas(2000), FormicAcid.getFluidOrGas(2000), Materials.Empty.getCells(1), Sodiumsulfate.get(dust, 1), 15); + //CO + NaOH = CHO2Na + GT_Values.RA.addChemicalRecipe(Materials.CarbonMonoxide.getCells(1), Materials.SodiumHydroxide.getDust(3), null, null, Sodiumformate.get(cell), null, 15); + //H2SO4 + 2CHO2Na = 2CH2O2 + Na2SO4 + GT_Values.RA.addChemicalRecipe(Sodiumformate.get(cell, 2), GT_Utility.getIntegratedCircuit(1), Materials.SulfuricAcid.getFluid(1000), null, FormicAcid.get(cell, 2), Sodiumsulfate.get(dust, 7), 15); + GT_Values.RA.addChemicalRecipe(Materials.SulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Sodiumformate.getFluidOrGas(2000), FormicAcid.getFluidOrGas(2000), Materials.Empty.getCells(1), Sodiumsulfate.get(dust, 7), 15); //AquaRegia GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, AquaRegia.get(cell, 2), 30, 30); GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(2), null, null, AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(2), 30, 30); @@ -91,6 +94,7 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(4), null, null, Materials.NitricAcid.getFluid(1000), AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(1), 30, 30); //AmmoniumCloride + //NH3 + HCl = NH4Cl GT_Values.RA.addChemicalRecipe(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.HydrochloricAcid.getFluid(1000), null, AmmoniumChloride.get(cell, 1), null, 15); GT_Values.RA.addChemicalRecipe(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), AmmoniumChloride.getFluidOrGas(1000), Materials.Empty.getCells(1), null, 15); @@ -112,10 +116,10 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust, 9), GT_Utility.getIntegratedCircuit(9), AquaRegia.getFluidOrGas(9000), PTConcentrate.getFluidOrGas(9000), PTResidue.get(dust), 2250); - GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2), null, AmmoniumChloride.getFluidOrGas(200), PDAmmonia.getFluidOrGas(200), PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); + GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2), null, AmmoniumChloride.getFluidOrGas(200), PDAmmonia.getFluidOrGas(200), PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,4), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); //GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,18), GT_Utility.getIntegratedCircuit(9), AmmoniumChloride.getFluidOrGas(1800), PDAmmonia.getFluidOrGas(1800), PTSaltCrude.get(dust, 16), PTRawPowder.get(dust,2), Materials.NitrogenDioxide.getCells(9), Materials.DilutedSulfuricAcid.getCells(9), null, null, null, 1400, 240); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(1)}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(200)}, new FluidStack[]{PDAmmonia.getFluidOrGas(200), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,2)}, 1200, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, new FluidStack[]{PTConcentrate.getFluidOrGas(18000), AmmoniumChloride.getFluidOrGas(1800)}, new FluidStack[]{PDAmmonia.getFluidOrGas(1800), Materials.NitrogenDioxide.getGas(9000),Materials.DilutedSulfuricAcid.getFluid(9000)}, new ItemStack[]{PTSaltCrude.get(dust, 16), PTRawPowder.get(dust,2)}, 1400, 240); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(1)}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(200)}, new FluidStack[]{PDAmmonia.getFluidOrGas(200), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,4)}, 1200, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, new FluidStack[]{PTConcentrate.getFluidOrGas(18000), AmmoniumChloride.getFluidOrGas(1800)}, new FluidStack[]{PDAmmonia.getFluidOrGas(1800), Materials.NitrogenDioxide.getGas(9000),Materials.DilutedSulfuricAcid.getFluid(9000)}, new ItemStack[]{PTSaltCrude.get(dust, 16), PTRawPowder.get(dust,4)}, 1400, 240); GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ PTSaltRefined.get(dust), PTSaltRefined.get(dust), @@ -130,7 +134,8 @@ public class PlatinumSludgeOverHaul { 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, }, 600, 30); GT_Values.RA.addBlastRecipe(PTSaltRefined.get(dust), GT_Utility.getIntegratedCircuit(1), null, Materials.Chlorine.getGas(87), PTMetallicPowder.get(dust), null, 200, 120, 900); - GT_Values.RA.addChemicalRecipe(PTRawPowder.get(dust, 2), Materials.Calcium.getDust(1), null, null, Materials.Platinum.getDust(2), CalciumChloride.get(dust), 30); + //2PtCl + Ca = 2Pt + CaCl2 + GT_Values.RA.addChemicalRecipe(PTRawPowder.get(dust, 4), Materials.Calcium.getDust(1), null, null, Materials.Platinum.getDust(2), CalciumChloride.get(dust, 3), 30); //Pd GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), PDAmmonia.getFluidOrGas(1000), null, 250); GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dustTiny, 16), PDRawPowder.get(dustTiny, 2), 250); @@ -151,7 +156,8 @@ public class PlatinumSludgeOverHaul { }, 600, 30); GT_Values.RA.addChemicalRecipeForBasicMachineOnly(PDRawPowder.get(dust, 2), Materials.Empty.getCells(1), FormicAcid.getFluidOrGas(4000), Materials.Ammonia.getGas(2000), Materials.Palladium.getDust(2), Materials.Ethylene.getCells(1), 250, 30); GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{PDRawPowder.get(dust, 2)}, new FluidStack[]{FormicAcid.getFluidOrGas(4000)}, new FluidStack[]{Materials.Ammonia.getGas(2000), Materials.Ethylene.getGas(1000), Materials.Water.getFluid(1000)}, new ItemStack[]{Materials.Palladium.getDust(2)}, 250, 30); - GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust, 1), Materials.Hydrogen.getCells(2), null, Materials.SulfuricAcid.getFluid(1000), Materials.Sodium.getDust(2), Materials.Empty.getCells(2), 30); + //Na2SO4 + 2H = 2Na + H2SO4 + GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust, 7), Materials.Hydrogen.getCells(2), null, Materials.SulfuricAcid.getFluid(1000), Materials.Sodium.getDust(2), Materials.Empty.getCells(2), 30); //K2S2O7 // GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust,6), null, 30); //Rh/Os/Ir/Ru @@ -186,7 +192,9 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addChemicalRecipe(Materials.Zinc.getDust(1), null, RHSulfateSolution.getFluidOrGas(1000), null, ZincSulfate.get(dust,6), CrudeRhMetall.get(dust), 300); GT_Values.RA.addBlastRecipe(CrudeRhMetall.get(dust), Materials.Salt.getDust(1), Materials.Chlorine.getGas(1000), null, RHSalt.get(dust, 3), null, 300, 120, 600); GT_Values.RA.addMixerRecipe(RHSalt.get(dust, 10), null, null, null, Materials.Water.getFluid(2000), RHSaltSolution.getFluidOrGas(2000), null, 300, 30); - GT_Values.RA.addChemicalRecipe(SodiumNitrate.get(dust), GT_Utility.getIntegratedCircuit(1), RHSaltSolution.getFluidOrGas(1000), null, RHNitrate.get(dust), Materials.Salt.getDust(1), 300); + GT_Values.RA.addChemicalRecipe(SodiumNitrate.get(dust, 5), GT_Utility.getIntegratedCircuit(1), RHSaltSolution.getFluidOrGas(1000), null, RHNitrate.get(dust), Materials.Salt.getDust(2), 300); + //Na + HNO3 = NaNO3 + H + GT_Values.RA.addChemicalRecipe(Materials.Sodium.getDust(1), GT_Values.NI, Materials.NitricAcid.getFluid(1000), Materials.Hydrogen.getGas(1000), SodiumNitrate.get(dust, 5), 8, 60); GT_Values.RA.addSifterRecipe(RHNitrate.get(dust), new ItemStack[]{ RhFilterCake.get(dust), RhFilterCake.get(dust), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 46177597ad..1eefa100d5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1230,11 +1230,12 @@ public class WerkstoffLoader { subscriptNumbers("NaNO3"), new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), + new Werkstoff.GenerationFeatures().disable().onlyDust(), 82, TextureSet.SET_ROUGH, new Pair<>(Materials.Sodium, 1), - new Pair<>(Materials.NitricAcid, 1) + new Pair<>(Materials.Nitrogen, 1), + new Pair<>(Materials.Oxygen, 3) ); public static final Werkstoff RHNitrate = new Werkstoff( new short[]{0x77, 0x66, 0x49}, @@ -1411,21 +1412,27 @@ public class WerkstoffLoader { new short[]{0x2c, 0x70, 0xb5}, "Hexafluorosilicic Acid", subscriptNumbers("H2SiF6"), - new Werkstoff.Stats(), + new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().addCells(), 98, - TextureSet.SET_FLUID + TextureSet.SET_FLUID, + new Pair<>(Materials.Hydrogen, 2), + new Pair<>(Materials.Silicon, 1), + new Pair<>(Materials.Fluorine, 6) ); public static final Werkstoff Potassiumfluorosilicate = new Werkstoff( new short[]{0x2e, 0x97, 0xb2}, "Potassiumfluorosilicate", subscriptNumbers("K2SiF6"), - new Werkstoff.Stats(), + new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust(), 99, - TextureSet.SET_SHINY + TextureSet.SET_SHINY, + new Pair<>(Materials.Potassium, 2), + new Pair<>(Materials.Silicon, 1), + new Pair<>(Materials.Fluorine, 6) ); public static final Werkstoff Alumina = new Werkstoff( new short[]{0xa0, 0xad, 0xb1}, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index a8af99b104..aefb3df7b4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -292,15 +292,19 @@ public class AdditionalRecipes { 400, BW_Util.getMachineVoltageFromTier(5) ); - GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust), Materials.Aluminium.getDust(1), Materials.Thorium.getDust(1), 1000); - GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust), Materials.Magnesium.getDust(1), Materials.Thorium.getDust(1), 1000); + //3ThO2 + 4Al = 3Th + 2Al2O3 + GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust, 9), Materials.Aluminium.getDust(4), null, null, Materials.Thorium.getDust(3), Materials.Aluminiumoxide.getDust(10), 1000); + //ThO2 + 2Mg = Th + 2MgO + GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust, 3), Materials.Magnesium.getDust(2), null, null, Materials.Thorium.getDust(1), Materials.Magnesia.getDust(4), 1000); GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(crushed), ItemList.Crop_Drop_Thorium.get(9), Materials.Water.getFluid(1000), Materials.Thorium.getMolten(144), WerkstoffLoader.Thorianit.get(crushedPurified, 4), 96, 24); //Prasiolite GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), Materials.Amethyst.getDust(10), GT_Values.NF, GT_Values.NF, WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), GT_Values.NI, 800, BW_Util.getMachineVoltageFromTier(2), 500); GT_Values.RA.addPrimitiveBlastRecipe(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), Materials.Amethyst.getDust(10), 6, WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), GT_Values.NI, 800); //Cubic Circonia + //2Y + 3O = Y2O3 GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(5), Materials.Oxygen.getGas(3000), GT_Values.NF, WerkstoffLoader.YttriumOxide.get(dust, 5), 4096, BW_Util.getMachineVoltageFromTier(1)); + //Zr + 2O =Y22O3= ZrO2 GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust, 10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.CubicZirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 57600, BW_Util.getMachineVoltageFromTier(3), 2953); //Tellurium GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed, Materials.Lead, 10L), GT_Utility.getIntegratedCircuit(17), GT_Values.NF, GT_Values.NF, Materials.Lead.getIngots(10), Materials.Tellurium.getNuggets(20), 800, BW_Util.getMachineVoltageFromTier(2), 722); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java index 896ea0ca23..a452f6b4e5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java @@ -27,10 +27,9 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import com.github.bartimaeusnek.bartworks.util.BWRecipes; -import gregtech.api.enums.Element; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; +import com.github.bartimaeusnek.bartworks.util.Pair; +import gregtech.api.enums.*; +import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -40,6 +39,9 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Objects; import static gregtech.api.enums.OrePrefixes.*; @@ -47,93 +49,86 @@ import static gregtech.api.enums.OrePrefixes.cell; public class CellLoader implements IWerkstoffRunnable { @Override + @SuppressWarnings("unchecked") public void run(Werkstoff werkstoff) { if (!werkstoff.hasItemType(cell)) return; -// if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { -// List flOutputs = new ArrayList<>(); -// List stOutputs = new ArrayList<>(); -// HashMap> tracker = new HashMap<>(); -// int cells = 0; -// for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { -// if (container.getKey() instanceof Materials) { -// if (((Materials) container.getKey()).hasCorrespondingGas() || ((Materials) container.getKey()).hasCorrespondingFluid() || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { -// FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); -// if (tmpFl == null || tmpFl.getFluid() == null) { -// tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); -// } -// flOutputs.add(tmpFl); -// if (flOutputs.size() > 1) { -// if (!tracker.containsKey(container.getKey())) { -// stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); -// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); -// } else { -// stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); -// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); -// } -// cells += container.getValue(); -// } -// } else { -// if (((Materials) container.getKey()).getDust(container.getValue()) == null) -// continue; -// if (!tracker.containsKey(container.getKey())) { -// stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); -// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); -// } else { -// stOutputs.add(((Materials) container.getKey()).getDust(tracker.get(container.getKey()).getKey() + container.getValue())); -// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); -// } -// } -// } else if (container.getKey() instanceof Werkstoff) { -// if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) { -// FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); -// if (tmpFl == null || tmpFl.getFluid() == null) { -// tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); -// } -// flOutputs.add(tmpFl); -// if (flOutputs.size() > 1) { -// if (!tracker.containsKey(container.getKey())) { -// stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); -// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); -// } else { -// stOutputs.add(((Werkstoff) container.getKey()).get(cell, tracker.get(container.getKey()).getKey() + container.getValue())); -// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); -// } -// cells += container.getValue(); -// } -// } else { -// if (!((Werkstoff) container.getKey()).hasItemType(dust)) -// continue; -// if (!tracker.containsKey(container.getKey())) { -// stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); -// tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); -// } else { -// stOutputs.add(((Werkstoff) container.getKey()).get(dust, (tracker.get(container.getKey()).getKey() + container.getValue()))); -// stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); -// } -// } -// } -// } -// ItemStack input = werkstoff.get(cell); -// input.stackSize = werkstoff.getContents().getKey(); -// cells += werkstoff.getContents().getKey(); -// stOutputs.add(Materials.Empty.getCells(cells)); -// if (werkstoff.getStats().isElektrolysis()) -// GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().getProtons() * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); -// if (werkstoff.getStats().isCentrifuge()) -// GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().getMass() * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); -// if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { -// if (cells > 0) -// stOutputs.add(Materials.Empty.getCells(cells)); -// GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().getProtons() * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30,0)); -// } -// if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { -// if (cells > 0) -// stOutputs.add(Materials.Empty.getCells(cells)); -// GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]),new ItemStack[]{input},null,null,new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null},null,(int) Math.max(1L, Math.abs(werkstoff.getStats().getMass() * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5,0)); -// } -// } + if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge()) { + List flOutputs = new ArrayList<>(); + List stOutputs = new ArrayList<>(); + HashMap> tracker = new HashMap<>(); + int cells = 0; + for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { + if (container.getKey() instanceof Materials) { + if (((Materials) container.getKey()).hasCorrespondingGas() || ((Materials) container.getKey()).hasCorrespondingFluid() || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { + FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); + if (tmpFl == null || tmpFl.getFluid() == null) { + tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); + } + flOutputs.add(tmpFl); + if (flOutputs.size() > 1) { + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + } else { + stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + } + cells += container.getValue(); + } + } else { + if (((Materials) container.getKey()).getDust(container.getValue()) == null) + continue; + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + } else { + stOutputs.add(((Materials) container.getKey()).getDust(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + } + } + } else if (container.getKey() instanceof Werkstoff) { + if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) { + FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); + if (tmpFl == null || tmpFl.getFluid() == null) { + tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); + } + flOutputs.add(tmpFl); + if (flOutputs.size() > 1) { + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + } else { + stOutputs.add(((Werkstoff) container.getKey()).get(cell, tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + } + cells += container.getValue(); + } + } else { + if (!((Werkstoff) container.getKey()).hasItemType(dust)) + continue; + if (!tracker.containsKey(container.getKey())) { + stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); + tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + } else { + stOutputs.add(((Werkstoff) container.getKey()).get(dust, (tracker.get(container.getKey()).getKey() + container.getValue()))); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + } + } + } + } + ItemStack input = werkstoff.get(cell); + input.stackSize = 1; + + int cellEmpty = cells - 1; + + stOutputs.add(Materials.Empty.getCells(-cellEmpty)); + if (werkstoff.getStats().isElektrolysis()) + GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().getProtons() * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); + if (werkstoff.getStats().isCentrifuge()) + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().getMass() * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); + } //Tank "Recipe" GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(cell), Materials.Empty.getCells(1))); @@ -186,4 +181,4 @@ public class CellLoader implements IWerkstoffRunnable { //GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{Materials.Empty.getCells(1)}, new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); } } -} \ No newline at end of file +} -- cgit From 444551ffa4ae49e227e5dc60c85c8504c7d0003a Mon Sep 17 00:00:00 2001 From: Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com> Date: Tue, 5 Jul 2022 06:16:18 +0100 Subject: Spacetime adjustment (#149) Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Former-commit-id: adcf3b8945631e2abb2d95ca853b80aa0ca46495 --- .../bartworks/common/loaders/StaticRecipeChangeLoaders.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 098dd2c8d0..28bb257350 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -492,13 +492,13 @@ public class StaticRecipeChangeLoaders { // Custom electric implosion compressor recipe. Cannot be overclocked. if (Loader.isModLoaded("eternalsingularity")) { - // 1L SpaceTime -> 1 Eternal singularity. + // 72L SpaceTime -> 1 Eternal singularity. eicMap.addRecipe( false, new ItemStack[]{GT_Values.NI}, new ItemStack[]{GT_ModHandler.getModItem("eternalsingularity", "eternal_singularity", 1L)}, null, - new FluidStack[]{Materials.SpaceTime.getMolten(1L)}, + new FluidStack[]{Materials.SpaceTime.getMolten(72L)}, new FluidStack[]{GT_Values.NF}, 100*20, 128_000_000, 1); // aSpecialVaue has no meaning here. } -- cgit From bc9ed2327bc2e02add0a06647e4d572f9a7e37f6 Mon Sep 17 00:00:00 2001 From: miozune Date: Tue, 5 Jul 2022 20:20:51 +0900 Subject: Fix tooltip wierdness (#148) Former-commit-id: ba4d5186ad0a4a715777cce301be3a0c3e13b4f0 --- .../common/tileentities/multis/GT_TileEntity_BioVat.java | 3 ++- .../common/tileentities/multis/GT_TileEntity_DEHP.java | 3 ++- .../multis/GT_TileEntity_ElectricImplosionCompressor.java | 3 ++- .../multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java | 3 ++- .../common/tileentities/multis/GT_TileEntity_HTGR.java | 3 ++- .../tileentities/multis/GT_TileEntity_ManualTrafo.java | 3 ++- .../common/tileentities/multis/GT_TileEntity_THTR.java | 7 ++++--- .../tileentities/multis/GT_TileEntity_Windmill.java | 3 ++- .../multis/mega/GT_TileEntity_MegaBlastFurnace.java | 3 ++- .../multis/mega/GT_TileEntity_MegaChemicalReactor.java | 3 ++- .../multis/mega/GT_TileEntity_MegaDistillTower.java | 3 ++- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 3 ++- .../multis/mega/GT_TileEntity_MegaVacuumFreezer.java | 3 ++- .../system/material/BW_MetaGeneratedBlock_Item.java | 6 +++++- .../bartworks/system/material/BW_MetaGenerated_Items.java | 15 ++++++++++++--- .../system/material/GT_Enhancement/BWGTMetaItems.java | 5 +++-- .../bartworks/util/BW_Tooltip_Reference.java | 5 +++++ .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 3 ++- src/main/resources/assets/bartworks/lang/en_US.lang | 1 + 19 files changed, 56 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 094879cab0..5f76170b79 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -70,6 +70,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.gtnewhorizon.structurelib.structure.StructureUtility.isAir; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAnyMeta; @@ -189,7 +190,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa addInputHatch("Any casing", 1). addOutputHatch("Any casing", 1). addEnergyHatch("Any casing", 1). - toolTipFinisher("Bartworks"); + toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index 381d17463f..3b67ee2a9e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -47,6 +47,7 @@ import net.minecraftforge.fluids.FluidRegistry; import java.lang.reflect.Field; import java.util.Arrays; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; import static gregtech.api.enums.GT_Values.VN; public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @@ -131,7 +132,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { .addInputBus("Mining Pipes, optional, any base casing") .addInputHatch("Any base casing") .addOutputHatch("Any base casing") - .toolTipFinisher(BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); return tt; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 18e0ec9272..dd5edf5598 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -48,6 +48,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.enums.GT_Values.V; @@ -154,7 +155,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity addInputBus("Any bottom casing", 1). addOutputBus("Any bottom casing", 1). addEnergyHatch("Bottom and top middle", 2). - toolTipFinisher("Bartworks"); + toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index ecb28f0516..926219af39 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -65,6 +65,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.*; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_VIA_BARTWORKS; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; @@ -213,7 +214,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity addOutputBus("Any casing", 1). addInputHatch("Any casing", 1). addEnergyHatch("Any casing", 1). - toolTipFinisher("Added by " + ChatColorHelper.GOLD + "kuba6000" + ChatColorHelper.RESET + ChatColorHelper.GREEN + " via " + BW_Tooltip_Reference.BW); + toolTipFinisher(MULTIBLOCK_ADDED_VIA_BARTWORKS.apply(ChatColorHelper.GOLD + "kuba6000")); return tt; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index e405475de6..d45a7a6880 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -58,6 +58,7 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_VIA_BARTWORKS; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; @@ -161,7 +162,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase .addOutputHatch("Any bottom layer casing", 1) .addEnergyHatch("Any bottom layer casing", 1) .addMaintenanceHatch("Any bottom layer casing", 1) - .toolTipFinisher("Added by " + ChatColorHelper.GOLD + "kuba6000" + ChatColorHelper.RESET + " via " + BW_Tooltip_Reference.BW); + .toolTipFinisher(MULTIBLOCK_ADDED_VIA_BARTWORKS.apply(ChatColorHelper.GOLD + "kuba6000")); return tt; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index a4fab93440..873355ee42 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -41,6 +41,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; @@ -147,7 +148,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl .addEnergyHatch("Touching Transformer-Winding Blocks", 3) .addDynamoHatch("Touching Transformer-Winding Blocks", 3) .addStructureInfo("Hatches touching Transformer-Winding Blocks must be tiered from bottom to top") - .toolTipFinisher("Bartworks"); + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index d44a71796e..21149cec05 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -55,6 +55,7 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; @@ -157,7 +158,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase .addOutputHatch("Any bottom layer casing", 1) .addEnergyHatch("Any bottom layer casing", 1) .addMaintenanceHatch("Any bottom layer casing", 1) - .toolTipFinisher("Bartworks"); + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -235,7 +236,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public boolean checkRecipe(ItemStack controllerStack) { - + if(this.empty) { if(this.HeliumSupply > 0 || this.fuelsupply > 0){ @@ -305,7 +306,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase } } } - + if(drainedamount > 0) addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 15deb54ac4..67dfc7de26 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -64,6 +64,7 @@ import java.util.Arrays; import java.util.HashSet; import java.util.Set; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.enums.GT_Values.V; @@ -139,7 +140,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock addOtherStructurePart("Dispenser", "Any Hardened Clay block"). addOtherStructurePart("0-1 Wooden door", "Any Hardened Clay block"). addStructureHint("Primitive Kinetic Shaftbox", 1). - toolTipFinisher("Bartworks"); + toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 292bf8e699..1f9da17393 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -54,6 +54,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.*; import java.util.stream.Collectors; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; @@ -163,7 +164,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock .addStructureInfo("Recovery amount scales with Muffler Hatch tier") .addOutputHatch("Platline fluids, Any bottom layer casing") .addStructureHint("This Mega Multiblock is too big to have its structure hologram displayed fully.") - .toolTipFinisher(BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); return tt; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index 0b5f02632a..9dccfb1cf2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -49,6 +49,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.Collection; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; @@ -91,7 +92,7 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl .addInputBus("Hint block ",1) .addOutputBus("Hint block ",1) .addOutputHatch("Hint block ",1) - .toolTipFinisher("Bartworks"); + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 3e3021f2ff..4ad99f1626 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -52,6 +52,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.List; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; @@ -228,7 +229,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock .addOutputHatch("2-11x Output Hatches (One per Output Layer except bottom layer)") .addStructureInfo("An \"Output Layer\" consists of 5 layers!") .addStructureHint("This Mega Multiblock is too big to have its structure hologram displayed fully.") - .toolTipFinisher(BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); return tt; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index 6c0ba378d6..9b75d55332 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -53,6 +53,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; @@ -129,7 +130,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa .addInputHatch("Hint block",2,3) .addOutputHatch("Hint block",2,3) .addInputHatch("Steam/Hydrogen ONLY, Hint block",4) - .toolTipFinisher("Bartworks"); + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index fab860bac1..2353fc2a4f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -45,6 +45,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; @@ -116,7 +117,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc addOutputHatch("Any casing", 1). addInputBus("Any casing", 1). addOutputBus("Any casing", 1). - toolTipFinisher("Bartworks"); + toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java index c6a6f98d83..365465394b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java @@ -77,7 +77,11 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { } Werkstoff werkstoff = Werkstoff.werkstoffHashMap.get((short) aStack.getItemDamage()); if(werkstoff != null) { - aList.add(werkstoff.getLocalizedToolTip()); + String tooltip = werkstoff.getLocalizedToolTip(); + if (!tooltip.isEmpty()) { + aList.add(werkstoff.getLocalizedToolTip()); + } + String owner = werkstoff.getOwner(); if (owner != null) { aList.add(BW_Tooltip_Reference.ADDED_VIA_BARTWORKS.apply(owner)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 7b22069f7b..78f12e0801 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -135,9 +135,18 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.nqgen")); Werkstoff werkstoff = werkstoffHashMap.get((short) this.getDamage(aStack)); - String owner = werkstoff.getOwner(); - if (owner != null) { - aList.add(BW_Tooltip_Reference.ADDED_VIA_BARTWORKS.apply(owner)); + if (werkstoff != null) { + String tooltip = werkstoff.getLocalizedToolTip(); + if (!tooltip.isEmpty()) { + aList.add(werkstoff.getLocalizedToolTip()); + } + + String owner = werkstoff.getOwner(); + if (owner != null) { + aList.add(BW_Tooltip_Reference.ADDED_VIA_BARTWORKS.apply(owner)); + } else { + aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); + } } else { aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java index 006afcb5f9..500fda4653 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -119,8 +119,9 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { Materials material = getMaterial(aStack); if (material != null) { - if (material.getToolTip() != null) { - aList.add(material.getToolTip()); + String tooltip = material.getToolTip(); + if (tooltip != null && !tooltip.isEmpty()) { + aList.add(tooltip); } } aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java index 5fc2a951ee..ff6b159144 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java @@ -33,9 +33,14 @@ public class BW_Tooltip_Reference { public static final String TT_NO_RESET = BLUE + "Tec" + DARK_BLUE + "Tech"; public static final String BW = BW_NO_RESET + GRAY; public static final String TT = TT_NO_RESET + GRAY; + public static final Supplier ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = () -> StatCollector.translateToLocal("tooltip.bw.1.name") + " " + BW; public static final Supplier ADDED_BY_BARTWORKS = () -> StatCollector.translateToLocal("tooltip.bw.0.name") + " " + BW; public static final Function ADDED_VIA_BARTWORKS = owner -> String.format(StatCollector.translateToLocal("tooltip.bw.via.name"), owner); + public static final String MULTIBLOCK_ADDED_BY_BARTWORKS = BW; + public static final Function MULTIBLOCK_ADDED_VIA_BARTWORKS = owner -> String.format(StatCollector.translateToLocal("tooltip.bw.mb_via.name"), owner); + public static final String MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = MULTIBLOCK_ADDED_VIA_BARTWORKS.apply(GREEN + "bartimaeusnek"); + public static final String ADV_STR_CHECK = "Uses an advanced "+ TT +" structure check, due to "+ BW; public static final String TT_BLUEPRINT = "To see the structure, use a "+ TT + " Blueprint on the Controller!"; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index 4472bb6f0a..850bac806e 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -62,6 +62,7 @@ import java.util.function.Predicate; import java.util.stream.Collectors; import static bloodasp.galacticgreg.registry.GalacticGregRegistry.getModContainers; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static gregtech.api.enums.GT_Values.VN; @SuppressWarnings("ALL") @@ -192,7 +193,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri .addInputBus("Mining Pipes or Ores, optional, any base casing") .addInputHatch("Optional noble gas, any base casing") .addOutputBus("Any base casing") - .toolTipFinisher("Gregtech"); + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index d1f9bf8606..81b7c6b5c0 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -86,6 +86,7 @@ tooltip.bw.kg.0.name=kg tooltip.bw.kg.1.name=kgs tooltip.bw.empty.name=Empty tooltip.bw.via.name=Added by %s§7 via §2BartWorks +tooltip.bw.mb_via.name=%s§7 via §2BartWorks tooltip.teslastaff.0.name=No warranty! tooltip.labmodule.0.name=A Module used to change the BioLab's working Mode -- cgit From b3211f4c2fae64e6536a8497a3928477df925d77 Mon Sep 17 00:00:00 2001 From: miozune Date: Tue, 5 Jul 2022 20:44:52 +0900 Subject: Fix tiny oversight (#150) Former-commit-id: 0c8bc9cd74f635c8b89594d0b84c159867734dad --- .../bartworks/system/material/BW_MetaGeneratedBlock_Item.java | 2 +- .../bartworks/system/material/BW_MetaGenerated_Items.java | 2 +- .../crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java index 365465394b..630d45c467 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java @@ -79,7 +79,7 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { if(werkstoff != null) { String tooltip = werkstoff.getLocalizedToolTip(); if (!tooltip.isEmpty()) { - aList.add(werkstoff.getLocalizedToolTip()); + aList.add(tooltip); } String owner = werkstoff.getOwner(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 78f12e0801..98afa14cee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -138,7 +138,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa if (werkstoff != null) { String tooltip = werkstoff.getLocalizedToolTip(); if (!tooltip.isEmpty()) { - aList.add(werkstoff.getLocalizedToolTip()); + aList.add(tooltip); } String owner = werkstoff.getOwner(); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index 850bac806e..5d92af979d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -62,7 +62,7 @@ import java.util.function.Predicate; import java.util.stream.Collectors; import static bloodasp.galacticgreg.registry.GalacticGregRegistry.getModContainers; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; import static gregtech.api.enums.GT_Values.VN; @SuppressWarnings("ALL") @@ -193,7 +193,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri .addInputBus("Mining Pipes or Ores, optional, any base casing") .addInputHatch("Optional noble gas, any base casing") .addOutputBus("Any base casing") - .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); return tt; } -- cgit From 16ad9da1c205117afcdd4f005da25e2c5772780c Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Tue, 5 Jul 2022 13:45:47 +0200 Subject: Block hatches on inner bottom casings. (#151) Former-commit-id: 09b81454d2d2078b973988808508262dbe631231 --- .../multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index 926219af39..afdfa4f694 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -90,7 +90,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity {"ggggg", "g g", "g g", "g g", "ggggg"}, {"ggggg", "g g", "g g", "g g", "ggggg"}, {"ccccc", "cdddc", "cdwdc", "cdddc", "ccccc"}, - {"cc~cc", "ccccc", "ccccc", "ccccc", "ccccc"}, + {"cc~cc", "cCCCc", "cCCCc", "cCCCc", "ccccc"}, })) .addElement('c', ofChain( onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)), @@ -99,6 +99,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity ofHatchAdder(GT_TileEntity_ExtremeIndustrialGreenhouse::addInputToMachineList, CASING_INDEX, 1), ofHatchAdder(GT_TileEntity_ExtremeIndustrialGreenhouse::addOutputToMachineList, CASING_INDEX, 1) )) + .addElement('C', onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1))) .addElement('l', LoaderReference.ProjRedIllumination ? ofBlock(Block.getBlockFromName("ProjRed|Illumination:projectred.illumination.lamp"), 10) : ofBlock(Blocks.redstone_lamp, 0)) .addElement('g', debug ? ofBlock(Blocks.glass, 0) : BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) .addElement('d', ofBlock(LoaderReference.RandomThings ? Block.getBlockFromName("RandomThings:fertilizedDirt_tilled") : Blocks.farmland, 0)) @@ -209,11 +210,11 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity addStructureInfo("The glass tier limits the Energy Input tier"). addStructureInfo("The dirt is from RandomThings, must be tilled"). addStructureInfo("Purple lamps are from ProjectRedIllumination. They can be lit"). - addMaintenanceHatch("Any casing", 1). - addInputBus("Any casing", 1). - addOutputBus("Any casing", 1). - addInputHatch("Any casing", 1). - addEnergyHatch("Any casing", 1). + addMaintenanceHatch("Any casing (Except inner bottom ones)", 1). + addInputBus("Any casing (Except inner bottom ones)", 1). + addOutputBus("Any casing (Except inner bottom ones)", 1). + addInputHatch("Any casing (Except inner bottom ones)", 1). + addEnergyHatch("Any casing (Except inner bottom ones)", 1). toolTipFinisher(MULTIBLOCK_ADDED_VIA_BARTWORKS.apply(ChatColorHelper.GOLD + "kuba6000")); return tt; } -- cgit From 16f14d3f567375a650526c53992bce5fff096074 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Wed, 6 Jul 2022 19:47:17 +0800 Subject: fix casing te not get update after breaking (#152) fix https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/10597 Former-commit-id: 76f3cf16117ca62f96cd019407e886ec9891ee87 --- .../bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java index 9736e27566..abc49d8a53 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -74,6 +74,7 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple @Override public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + super.breakBlock(aWorld, aX, aY, aZ, aBlock, aMetaData); } @Override -- cgit From 4f83f0d063f5a7a2d9c3470e69201d1accbe62bc Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Thu, 7 Jul 2022 12:42:24 +0800 Subject: forbid electrolyz fluid when it has dust form (#153) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit it means this fluid isn't a standard fluid, so fluid electrolyz rule doesn't apply to it(like calcium chloride) Former-commit-id: 7b9995069955eddee17fa6dfd099948d8aeb6ef4 --- .../bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java index a452f6b4e5..85c0ec1516 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java @@ -54,6 +54,9 @@ public class CellLoader implements IWerkstoffRunnable { if (!werkstoff.hasItemType(cell)) return; + if (werkstoff.hasItemType(dust)) + return; + if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge()) { List flOutputs = new ArrayList<>(); List stOutputs = new ArrayList<>(); -- cgit From fa60712f515f6aeb3534e2fb82a7be63c5c6c9c9 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Thu, 7 Jul 2022 14:04:29 +0800 Subject: fix broken thing (#154) :feelsDumbMan: Former-commit-id: ef146eb4ab73c028e8b7792cfe3601642012cf03 --- .../system/material/werkstoff_loaders/recipe/CellLoader.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java index 85c0ec1516..e0997d6399 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java @@ -54,10 +54,7 @@ public class CellLoader implements IWerkstoffRunnable { if (!werkstoff.hasItemType(cell)) return; - if (werkstoff.hasItemType(dust)) - return; - - if (werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge()) { + if ((werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge()) && !werkstoff.hasItemType(dust)) { List flOutputs = new ArrayList<>(); List stOutputs = new ArrayList<>(); HashMap> tracker = new HashMap<>(); -- cgit From 99bfa31a099059fdaf68c83041f4b81975979076 Mon Sep 17 00:00:00 2001 From: xSkewer <43712386+xSkewer@users.noreply.github.com> Date: Sat, 9 Jul 2022 13:32:56 -0400 Subject: Clarify Fusion Coil requirement in MCR tooltip (#156) * Clarify Fusion Coil requirement in MCR tooltip * Fix typo Former-commit-id: 3016690fe875ad1525d075ef91cbc9cb33dee287 --- .../tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index 9dccfb1cf2..dcb1c3fc9d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -85,6 +85,10 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl .addSeparator() .beginStructureBlock(5, 5, 9, false) .addController("Front center") + .addStructureInfo("46x Chemically Inert Machine Casing (minimum)") + .addStructureInfo("7x Fusion Coil Block") + .addStructureInfo("28x PTFE Pipe Casing") + .addStructureInfo("64x Borosilicate Glass Block (any tier)") .addStructureInfo("The glass tier limits the Energy Input tier") .addEnergyHatch("Hint block ", 3) .addMaintenanceHatch("Hint block ",2) -- cgit From c25f29bdd178db7b94843c61f5ac2e63e7f8085c Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Sun, 10 Jul 2022 23:04:54 +0800 Subject: fix chlorine positive (#155) * fix chlorine positive before: 1 platium metaillic dust + 100 chlorine -> 38/45 platium metaillic dust + 184.52 chlorine now: 1 platium metaillic dust + 200 chlorine -> 38/45 platium metaillic dust + 184.52 chlorine i increased ammonium chloride usage in platium concentrate step. it also influenced the palladium output rate, which makes every unit palladium enriched ammonia contains half unit palladium and the same unit ammonia compared before. so the palladium raw power use 2x than before and output 2x ammonia * fix palladium lose Former-commit-id: c56a60bebe5eb9c4a0a1cdc49fc4e02f85518202 --- .../material/GT_Enhancement/PlatinumSludgeOverHaul.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index fe1dbbe91b..08ed4cd980 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -116,10 +116,9 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust, 9), GT_Utility.getIntegratedCircuit(9), AquaRegia.getFluidOrGas(9000), PTConcentrate.getFluidOrGas(9000), PTResidue.get(dust), 2250); - GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2), null, AmmoniumChloride.getFluidOrGas(200), PDAmmonia.getFluidOrGas(200), PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,4), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); - //GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,18), GT_Utility.getIntegratedCircuit(9), AmmoniumChloride.getFluidOrGas(1800), PDAmmonia.getFluidOrGas(1800), PTSaltCrude.get(dust, 16), PTRawPowder.get(dust,2), Materials.NitrogenDioxide.getCells(9), Materials.DilutedSulfuricAcid.getCells(9), null, null, null, 1400, 240); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(1)}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(200)}, new FluidStack[]{PDAmmonia.getFluidOrGas(200), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,4)}, 1200, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, new FluidStack[]{PTConcentrate.getFluidOrGas(18000), AmmoniumChloride.getFluidOrGas(1800)}, new FluidStack[]{PDAmmonia.getFluidOrGas(1800), Materials.NitrogenDioxide.getGas(9000),Materials.DilutedSulfuricAcid.getFluid(9000)}, new ItemStack[]{PTSaltCrude.get(dust, 16), PTRawPowder.get(dust,4)}, 1400, 240); + GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2), null, AmmoniumChloride.getFluidOrGas(400), PDAmmonia.getFluidOrGas(400), PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,4), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(1)}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(400)}, new FluidStack[]{PDAmmonia.getFluidOrGas(400), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,4)}, 1200, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, new FluidStack[]{PTConcentrate.getFluidOrGas(18000), AmmoniumChloride.getFluidOrGas(3600)}, new FluidStack[]{PDAmmonia.getFluidOrGas(3600), Materials.NitrogenDioxide.getGas(9000),Materials.DilutedSulfuricAcid.getFluid(9000)}, new ItemStack[]{PTSaltCrude.get(dust, 16), PTRawPowder.get(dust,4)}, 1400, 240); GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ PTSaltRefined.get(dust), PTSaltRefined.get(dust), @@ -154,8 +153,8 @@ public class PlatinumSludgeOverHaul { }, new int[] { 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, }, 600, 30); - GT_Values.RA.addChemicalRecipeForBasicMachineOnly(PDRawPowder.get(dust, 2), Materials.Empty.getCells(1), FormicAcid.getFluidOrGas(4000), Materials.Ammonia.getGas(2000), Materials.Palladium.getDust(2), Materials.Ethylene.getCells(1), 250, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{PDRawPowder.get(dust, 2)}, new FluidStack[]{FormicAcid.getFluidOrGas(4000)}, new FluidStack[]{Materials.Ammonia.getGas(2000), Materials.Ethylene.getGas(1000), Materials.Water.getFluid(1000)}, new ItemStack[]{Materials.Palladium.getDust(2)}, 250, 30); + GT_Values.RA.addChemicalRecipeForBasicMachineOnly(PDRawPowder.get(dust, 4), Materials.Empty.getCells(1), FormicAcid.getFluidOrGas(4000), Materials.Ammonia.getGas(4000), Materials.Palladium.getDust(2), Materials.Ethylene.getCells(1), 250, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{PDRawPowder.get(dust, 4)}, new FluidStack[]{FormicAcid.getFluidOrGas(4000)}, new FluidStack[]{Materials.Ammonia.getGas(4000), Materials.Ethylene.getGas(1000), Materials.Water.getFluid(1000)}, new ItemStack[]{Materials.Palladium.getDust(2)}, 250, 30); //Na2SO4 + 2H = 2Na + H2SO4 GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust, 7), Materials.Hydrogen.getCells(2), null, Materials.SulfuricAcid.getFluid(1000), Materials.Sodium.getDust(2), Materials.Empty.getCells(2), 30); //K2S2O7 @@ -333,13 +332,13 @@ public class PlatinumSludgeOverHaul { } if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dust), amount * 2); + recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dust), amount * 4); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dustSmall), amount * 2); + recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dustSmall), amount * 4); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dustTiny), amount * 2); + recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dustTiny), amount * 4); } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Osmium)) { for (int j = 0; j < recipe.mInputs.length; j++) { -- cgit From 284ec1a34e6ef04ee97c205ff91063ad9967745b Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Mon, 11 Jul 2022 00:11:51 +0200 Subject: Fix EIG structure (#157) Former-commit-id: d3af1ef8e38e8071a97a824e805232b163a78521 --- .../multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index afdfa4f694..fc5f134d25 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -87,8 +87,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { {"ccccc", "ccccc", "ccccc", "ccccc", "ccccc"}, {"ccccc", "clllc", "clllc", "clllc", "ccccc"}, - {"ggggg", "g g", "g g", "g g", "ggggg"}, - {"ggggg", "g g", "g g", "g g", "ggggg"}, + {"ggggg", "g---g", "g---g", "g---g", "ggggg"}, + {"ggggg", "g---g", "g---g", "g---g", "ggggg"}, {"ccccc", "cdddc", "cdwdc", "cdddc", "ccccc"}, {"cc~cc", "cCCCc", "cCCCc", "cCCCc", "ccccc"}, })) -- cgit From b6fdd4afc330cb6222c2c6c5412a2ec2890985ff Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Wed, 13 Jul 2022 17:54:16 +0800 Subject: disable formic acid electrolysis (#158) fix https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/10691 Former-commit-id: 252157248ec180ffd08792affdeff57b467010b0 --- .../github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 1eefa100d5..b5c3e17a87 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -943,7 +943,7 @@ public class WerkstoffLoader { new short[]{0xff, 0xaa, 0x77}, "Formic Acid", subscriptNumbers("CH2O2"), - new Werkstoff.Stats().setElektrolysis(true), + new Werkstoff.Stats().setElektrolysis(false), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().addCells(), 58, -- cgit From 872cf0ae43b07795e6a918613368ee0c20ff752a Mon Sep 17 00:00:00 2001 From: miozune Date: Fri, 15 Jul 2022 20:31:15 +0900 Subject: Fix accidental nerf to circuit assembler (#159) * Fix accidental nerf to circuit assembler * No hacky oredict Former-commit-id: a47e1c837c549ea03a9a3993052d90397568098b --- .../CircuitGeneration/CircuitImprintLoader.java | 17 ++--------- .../bartimaeusnek/bartworks/util/BW_Util.java | 34 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 409d69a8f4..b5e87461d8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -69,7 +69,7 @@ public class CircuitImprintLoader { rebuildCircuitAssemblerMap(toRem,toAdd); exchangeRecipesInList(toRem,toAdd); makeCircuitImprintRecipes(); - + toRem = null; toAdd = null; } @@ -117,17 +117,7 @@ public class CircuitImprintLoader { } private static boolean isCircuitOreDict(ItemStack item) { - int[] oreIDS = OreDictionary.getOreIDs(item); - - if (oreIDS.length < 1) - return false; - - for (int oreID : oreIDS) { - if (OreDictionary.getOreName(oreID).contains("Circuit") || OreDictionary.getOreName(oreID).contains("circuit")) - return true; - } - - return false; + return BW_Util.isTieredCircuit(item); } private static void exchangeRecipesInList(HashSet toRem, HashSet toAdd) { @@ -148,8 +138,7 @@ public class CircuitImprintLoader { public static GT_Recipe makeMoreExpensive(GT_Recipe original) { GT_Recipe newRecipe = original.copy(); for (ItemStack is : newRecipe.mInputs){ - int[] oreIDs = OreDictionary.getOreIDs(is); - if(oreIDs == null || oreIDs.length < 1 || !OreDictionary.getOreName(oreIDs[0]).contains("circuit")) { + if (!BW_Util.isTieredCircuit(is)) { is.stackSize = Math.min(is.stackSize * 6, 64); if (is.stackSize > is.getItem().getItemStackLimit() || is.stackSize > is.getMaxStackSize()) is.stackSize = is.getMaxStackSize(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index deee5a54e1..312c4be88a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -49,6 +49,7 @@ import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import org.apache.commons.lang3.reflect.FieldUtils; @@ -611,10 +612,43 @@ public class BW_Util { case "circuitSuperconductor": return 8; case "circuitInfinite": return 9; case "circuitBio": return 10; + case "circuitNano": + case "circuitOptical": + return 11; + case "circuitPiko": + case "circuitExotic": + return 12; + case "circuitQuantum": + case "circuitCosmic": + return 13; + case "circuitTranscendent": + return 14; default: return -1; } } + public static byte getCircuitTierFromItemStack(ItemStack stack) { + for (String oreName : getOreNames(stack)) { + byte tier = getCircuitTierFromOreDictName(oreName); + if (tier != -1) { + return tier; + } + } + return -1; + } + + public static boolean isTieredCircuit(ItemStack stack) { + return getCircuitTierFromItemStack(stack) != -1; + } + + public static List getOreNames(ItemStack stack) { + List ret = new ArrayList<>(); + for (int oreID : OreDictionary.getOreIDs(stack)) { + ret.add(OreDictionary.getOreName(oreID)); + } + return ret; + } + private static Block bw_realglasRef; public static byte calculateGlassTier(@Nonnull Block block, @Nonnegative byte meta) { -- cgit From df47370f5e65379e6c2cd705413972946418cbe2 Mon Sep 17 00:00:00 2001 From: miozune Date: Sat, 16 Jul 2022 06:51:39 +0900 Subject: Less hacky way to get material owner (#160) Former-commit-id: dd9f3b2d70fd2aaca62348cf9612a9ad3cf14377 --- .../bartworks/system/material/Werkstoff.java | 33 +++++++++++++--------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index ac4a381fa6..3175213550 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.system.material; +import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.StaticRecipeChangeLoaders; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; @@ -29,7 +30,10 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MurmurHash3; import com.github.bartimaeusnek.bartworks.util.NonNullWrappedHashMap; import com.github.bartimaeusnek.bartworks.util.Pair; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import com.github.bartimaeusnek.crossmod.tgregworks.MaterialsInjector; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; +import cpw.mods.fml.common.Loader; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -67,15 +71,16 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static final LinkedHashMap werkstoffHashMap = new LinkedHashMap<>(); public static final LinkedHashMap werkstoffNameHashMap = new LinkedHashMap<>(); - /** - * {className, modName} - */ - public static final Map knownModNames = new HashMap(){{ - put("goodgenerator.items", GREEN + "Good Generator"); - put("com.elisis.gtnhlanth.common.register", GREEN + "GTNH: Lanthanides"); - put("galaxyspace.core.register", DARK_PURPLE + "GalaxySpace"); + public static final Map modNameOverrides = new HashMap(){{ + put("GalaxySpace", DARK_PURPLE + "GalaxySpace"); }}; + private static final List BWModNames = Arrays.asList( + MainMod.NAME, + BartWorksCrossmod.NAME, + MaterialsInjector.NAME + ); + private static final HashSet idHashSet = new HashSet<>(); private static final Werkstoff.Stats DEFAULT_NULL_STATS = new Werkstoff.Stats(); @@ -550,14 +555,14 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } private String getMaterialOwner() { - for (StackTraceElement stacktrace : Thread.currentThread().getStackTrace()) { - for (Map.Entry entry : knownModNames.entrySet()) { - if (stacktrace.getClassName().contains(entry.getKey())) { - return entry.getValue(); - } - } + String modName = Loader.instance().activeModContainer().getName(); + if (modNameOverrides.get(modName) != null) { + return modNameOverrides.get(modName); } - return null; + if (BWModNames.contains(modName)) { + return null; + } + return GREEN + modName; } public enum Types { -- cgit From fd7ff8026449b9101b4c0922a2cf96576be9949e Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Sat, 16 Jul 2022 10:46:44 -0700 Subject: [ci skip] Migrate github actions to GTNH-Actions-Workflows Former-commit-id: 4c683a3f96cf515fe536bc8c38f21ec00cdcd83b --- .github/workflows/build-and-test.yml | 36 ++----------------------- .github/workflows/release-tags.yml | 51 +++++------------------------------- 2 files changed, 9 insertions(+), 78 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 56a1ad52cc..3ee2f686fd 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,5 +1,3 @@ -# 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 @@ -11,35 +9,5 @@ on: 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 2>&1 | tee -a server.log || true - - - name: Test no errors reported during server run - run: | - chmod +x .github/scripts/test_no_error_reports - .github/scripts/test_no_error_reports + uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master + secrets: inherit diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml index c86d8889b7..e4c0be6b0d 100644 --- a/.github/workflows/release-tags.yml +++ b/.github/workflows/release-tags.yml @@ -1,51 +1,14 @@ -# 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: - - '*' + 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 +permissions: + contents: write - - 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 }} +jobs: + release-tags: + uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/release-tags.yml@master + secrets: inherit -- cgit From f4adea3e8dbc877443e432f843299121b1d7511d Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Mon, 18 Jul 2022 12:47:08 +0200 Subject: EIG: Refuse to run instead of voiding when power is downgraded (#161) * Just refuse to run instead of voiding * Update GT_TileEntity_ExtremeIndustrialGreenhouse.java Co-authored-by: Martin Robertz Former-commit-id: 61e71b86cd83f3ce1755aa892acac4ac60ee92b4 --- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 38 +++++++++++++--------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index fc5f134d25..7335ed02c2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -304,8 +304,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity return true; } - @Override - public boolean checkRecipe(ItemStack itemStack) { + private void updateMaxSlots() + { long v = this.getMaxInputVoltage(); int tier = GT_Utility.getTier(v); if(tier < (isIC2Mode ? 6 : 4)) @@ -314,15 +314,13 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity mMaxSlots = 4 << (2 * (tier - 6)); else mMaxSlots = 1 << (tier - 4); - if(mStorage.size() > mMaxSlots) - { - // Void if user just downgraded power - for(int i = mMaxSlots; i < mStorage.size(); i++) - { - mStorage.remove(i); - i--; - } - } + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + long v = this.getMaxInputVoltage(); + int tier = GT_Utility.getTier(v); + updateMaxSlots(); if(setupphase > 0) { if((mStorage.size() >= mMaxSlots && setupphase == 1) || (mStorage.size() == 0 && setupphase == 2)) return false; @@ -332,6 +330,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity this.mEfficiencyIncrease = 10000; return true; } + if(mStorage.size() > mMaxSlots) + return false; if(mStorage.isEmpty()) return false; @@ -410,9 +410,14 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity if (this.glasTier < hatchEnergy.mTier) return false; - return this.mMaintenanceHatches.size() == 1 && - this.mEnergyHatches.size() >= 1 && - this.mCasing >= 70; + boolean valid = this.mMaintenanceHatches.size() == 1 && + this.mEnergyHatches.size() >= 1 && + this.mCasing >= 70; + + if(valid) + updateMaxSlots(); + + return valid; } @Override @@ -436,7 +441,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity "Running in mode: " + EnumChatFormatting.GREEN + (setupphase == 0 ? (isIC2Mode ? "IC2 crops" : "Normal crops") : ("Setup mode " + (setupphase == 1 ? "(input)" : "(output)"))) + EnumChatFormatting.RESET, "Uses " + waterusage * 1000 + "L/operation of water", "Max slots: " + EnumChatFormatting.GREEN + this.mMaxSlots + EnumChatFormatting.RESET, - "Used slots: " + EnumChatFormatting.GREEN + this.mStorage.size() + EnumChatFormatting.RESET + "Used slots: " + ((mStorage.size() > mMaxSlots) ? EnumChatFormatting.RED : EnumChatFormatting.GREEN) + this.mStorage.size() + EnumChatFormatting.RESET )); for(int i = 0; i < mStorage.size(); i++) { if(!mStorage.get(i).isValid) @@ -450,7 +455,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity a.append(EnumChatFormatting.RESET); info.add(a.toString()); } - + if(mStorage.size() > mMaxSlots) + info.add(EnumChatFormatting.DARK_RED + "There are too many crops inside to run !" + EnumChatFormatting.RESET); info.addAll(Arrays.asList(super.getInfoData())); return info.toArray(new String[0]); } -- cgit From 4f6fbfe8370e514e6629a94d8eb227af46ace2fe Mon Sep 17 00:00:00 2001 From: miozune Date: Tue, 19 Jul 2022 09:16:00 +0900 Subject: Add whitelist to ignore ItemData check for EBF no gas recipe generation (#163) Former-commit-id: 3651df53dd82bd208f88aecd425d50404ed74d2a --- .../bartworks/common/loaders/StaticRecipeChangeLoaders.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 28bb257350..ce4811cee3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -79,6 +79,10 @@ public class StaticRecipeChangeLoaders { private static TObjectDoubleHashMap gtEbfGasRecipeTimeMultipliers = null; private static TObjectDoubleHashMap gtEbfGasRecipeConsumptionMultipliers = null; + public static final List whitelistForEBFNoGasRecipeDontCheckItemData = Arrays.asList( + GT_ModHandler.getModItem("TConstruct", "materials", 1L, 12) // Raw Aluminum -> Aluminium Ingot (coremod) + ); + private StaticRecipeChangeLoaders() { } @@ -351,7 +355,14 @@ public class StaticRecipeChangeLoaders { for (GT_Recipe baseRe : base.get(tag)) { if (recipe.mInputs.length == baseRe.mInputs.length && recipe.mOutputs.length == baseRe.mOutputs.length) for (int i = 0; i < recipe.mInputs.length; i++) { - if ((recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) && BW_Util.checkStackAndPrefix(recipe.mInputs[i]) && BW_Util.checkStackAndPrefix(baseRe.mInputs[i]) && GT_OreDictUnificator.getAssociation(recipe.mInputs[i]).mMaterial.mMaterial.equals(GT_OreDictUnificator.getAssociation(baseRe.mInputs[i]).mMaterial.mMaterial) && GT_Utility.areStacksEqual(recipe.mOutputs[0], baseRe.mOutputs[0])) { + ItemStack tmpInput = recipe.mInputs[i]; + if ( + (recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) + && whitelistForEBFNoGasRecipeDontCheckItemData.stream().anyMatch(s -> GT_Utility.areStacksEqual(s, tmpInput)) + || (BW_Util.checkStackAndPrefix(recipe.mInputs[i]) + && BW_Util.checkStackAndPrefix(baseRe.mInputs[i]) + && GT_OreDictUnificator.getAssociation(recipe.mInputs[i]).mMaterial.mMaterial.equals(GT_OreDictUnificator.getAssociation(baseRe.mInputs[i]).mMaterial.mMaterial) + && GT_Utility.areStacksEqual(recipe.mOutputs[0], baseRe.mOutputs[0]))) { toAdd.add(recipe.mOutputs[0]); repToAdd.put(tag, recipe); continue recipeLoop; -- cgit From ef65dcacdd728738b0f87a06ae9492352e6c6a5b Mon Sep 17 00:00:00 2001 From: miozune Date: Wed, 20 Jul 2022 07:37:27 +0900 Subject: Fix logic error (#165) Former-commit-id: adf27be1063578c13724c1bea2402d3e4f26e1ff --- .../bartworks/common/loaders/StaticRecipeChangeLoaders.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index ce4811cee3..bfcbf94961 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -358,11 +358,11 @@ public class StaticRecipeChangeLoaders { ItemStack tmpInput = recipe.mInputs[i]; if ( (recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) - && whitelistForEBFNoGasRecipeDontCheckItemData.stream().anyMatch(s -> GT_Utility.areStacksEqual(s, tmpInput)) - || (BW_Util.checkStackAndPrefix(recipe.mInputs[i]) - && BW_Util.checkStackAndPrefix(baseRe.mInputs[i]) - && GT_OreDictUnificator.getAssociation(recipe.mInputs[i]).mMaterial.mMaterial.equals(GT_OreDictUnificator.getAssociation(baseRe.mInputs[i]).mMaterial.mMaterial) - && GT_Utility.areStacksEqual(recipe.mOutputs[0], baseRe.mOutputs[0]))) { + && (whitelistForEBFNoGasRecipeDontCheckItemData.stream().anyMatch(s -> GT_Utility.areStacksEqual(s, tmpInput)) + || (BW_Util.checkStackAndPrefix(recipe.mInputs[i]) + && BW_Util.checkStackAndPrefix(baseRe.mInputs[i]) + && GT_OreDictUnificator.getAssociation(recipe.mInputs[i]).mMaterial.mMaterial.equals(GT_OreDictUnificator.getAssociation(baseRe.mInputs[i]).mMaterial.mMaterial) + && GT_Utility.areStacksEqual(recipe.mOutputs[0], baseRe.mOutputs[0])))) { toAdd.add(recipe.mOutputs[0]); repToAdd.put(tag, recipe); continue recipeLoop; -- cgit From cab4d68fc22a05ca64d940abca854bcb69146de0 Mon Sep 17 00:00:00 2001 From: miozune Date: Thu, 21 Jul 2022 08:21:29 +0900 Subject: Replace Assline Solder in Bartworks Recipes (#166) Former-commit-id: b5fe2e62a73a53aed07a5bc07e6a953059237db6 --- .../bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java index c16a042aca..ce810e2125 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java @@ -31,12 +31,15 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; public class TecTechResearchLoader { @SuppressWarnings("deprecation") public static void runResearches() { + Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null ? FluidRegistry.getFluid("molten.indalloy140") : FluidRegistry.getFluid("molten.solderingalloy"); if (LoaderReference.galacticgreg) { @@ -56,7 +59,7 @@ public class TecTechResearchLoader { GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) }, new FluidStack[]{ - Materials.SolderingAlloy.getMolten(1440), + new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Krypton.getFluidOrGas(20000) }, ItemRegistry.voidminer[1].copy(), @@ -80,7 +83,7 @@ public class TecTechResearchLoader { GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) }, new FluidStack[]{ - Materials.SolderingAlloy.getMolten(1440), + new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Oganesson.getFluidOrGas(20000) }, ItemRegistry.voidminer[2].copy(), @@ -105,7 +108,7 @@ public class TecTechResearchLoader { ItemList.Electric_Piston_UV.get(64), }, new FluidStack[]{ - Materials.SolderingAlloy.getMolten(1440), + new FluidStack(solderIndalloy, 1440), Materials.Osmium.getMolten(1440), Materials.Neutronium.getMolten(1440) }, @@ -137,4 +140,4 @@ public class TecTechResearchLoader { // GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.removeAll(toRemVisualScanner); // GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.removeAll(toRemVisualAssLine); } -} \ No newline at end of file +} -- cgit From 93f454cf59b1bd01aab2b9ac240c292033b48a73 Mon Sep 17 00:00:00 2001 From: greesyB <73182109+greesyB@users.noreply.github.com> Date: Fri, 22 Jul 2022 21:31:04 -0500 Subject: Use accurate tanh, cache sievert decay (#168) Former-commit-id: a69570a187bcc80037c871801b582544d4ff8805 --- .../tiered/GT_MetaTileEntity_RadioHatch.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index dab124781a..55e1687df7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -47,6 +47,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; +import java.util.HashMap; import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; @@ -59,6 +60,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { private byte mass; private String material; private byte coverage; + private static HashMap sievertDecayCache = new HashMap<>(); public GT_MetaTileEntity_RadioHatch(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 1, new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name") + " " + (aTier - 2) + " " + ((aTier - 2) >= 2 ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") : StatCollector.translateToLocal("tooltip.bw.kg.0.name")), StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"), BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}); @@ -76,15 +78,20 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public static long calcDecayTicks(int x) { - long ret; + long ret = GT_MetaTileEntity_RadioHatch.sievertDecayCache.getOrDefault(x, 0L); + if (ret != 0) + return ret; + if (x == 43) ret = 5000; else if (x == 61) ret = 4500; else if (x <= 100) - ret = MathUtils.ceilLong((8000F * MathUtils.tanh(-x / 20F) + 8000F) * 1000F); + ret = MathUtils.ceilLong((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); else - ret = MathUtils.ceilLong(((8000F * MathUtils.tanh(-x / 65F) + 8000F))); + ret = MathUtils.ceilLong(((8000D * Math.tanh(-x / 65D) + 8000D))); + + GT_MetaTileEntity_RadioHatch.sievertDecayCache.put(x, ret); return ret;//*20; } @@ -156,8 +163,9 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { if (this.mass > 0) ++this.timer; - if (this.mass > 0 && this.sievert > 0 && GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert) > 0) { - if (this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) == 0) { + if (this.mass > 0 && this.sievert > 0) { + float decayTicks = GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert); + if (decayTicks > 0 && this.timer % decayTicks == 0) { this.mass--; if (this.mass == 0) { this.material = StatCollector.translateToLocal("tooltip.bw.empty.name"); -- cgit From 950940327ea729bcaf75b430811767bd431f40cf Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Wed, 27 Jul 2022 04:33:37 +0200 Subject: EIG: Add support for several seeds (#167) * Support seed food (carrot/potato) * Fix netherwart * Fix stem seeds (melon like) * Add support for cactus and sugar cane Former-commit-id: 9b9b181c42d7ccca3d2ec6b2f88d1cdc53c99b74 --- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 110 +++++++++++++++++++-- 1 file changed, 101 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index 7335ed02c2..a4933c0b5a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -40,18 +40,21 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_DummyWorld; import ic2.api.crops.CropCard; import ic2.api.crops.Crops; import ic2.core.Ic2Items; import ic2.core.crop.TileEntityCrop; import net.minecraft.block.Block; -import net.minecraft.block.IGrowable; +import net.minecraft.block.BlockBush; +import net.minecraft.block.BlockStem; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; +import net.minecraft.item.ItemSeedFood; import net.minecraft.item.ItemSeeds; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; @@ -60,6 +63,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; +import net.minecraftforge.common.IPlantable; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; @@ -517,15 +521,22 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity int optimalgrowth = 7; + boolean needsreplanting = true; + + static GreenHouseWorld fakeworld = new GreenHouseWorld(5, 5, 5); + public NBTTagCompound toNBTTagCompound(){ NBTTagCompound aNBT = new NBTTagCompound(); aNBT.setTag("input", input.writeToNBT(new NBTTagCompound())); + aNBT.setBoolean("isValid", isValid); + aNBT.setBoolean("isIC2Crop", isIC2Crop); if(!isIC2Crop) { aNBT.setInteger("crop", Block.getIdFromBlock(crop)); aNBT.setInteger("dropscount", drops.size()); for (int i = 0; i < drops.size(); i++) aNBT.setTag("drop." + i, drops.get(i).writeToNBT(new NBTTagCompound())); aNBT.setInteger("optimalgrowth", optimalgrowth); + aNBT.setBoolean("needsreplanting", needsreplanting); } else { if(undercrop != null) @@ -537,10 +548,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity for(int j = 0; j < generations.get(i).size(); j++) aNBT.setTag("generation." + i + "." + j, generations.get(i).get(j).writeToNBT(new NBTTagCompound())); } + aNBT.setInteger("growthticks", growthticks); } - aNBT.setBoolean("isValid", isValid); - aNBT.setBoolean("isIC2Crop", isIC2Crop); - if(isIC2Crop) aNBT.setInteger("growthticks", growthticks); return aNBT; } @@ -556,6 +565,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity drops.add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("drop." + i))); optimalgrowth = aNBT.getInteger("optimalgrowth"); if(optimalgrowth == 0) optimalgrowth = 7; + if(aNBT.hasKey("needsreplanting")) needsreplanting = aNBT.getBoolean("needsreplanting"); } else { @@ -634,15 +644,45 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity GreenHouseSlotIC2(tileEntity, world, input); return; } - if (!(input.getItem() instanceof ItemSeeds)) { - return; + Item i = input.getItem(); + Block b = null; + if(i instanceof IPlantable) { + if (i instanceof ItemSeeds) + b = ((ItemSeeds) i).getPlant(world, 0, 0, 0); + else if (i instanceof ItemSeedFood) + b = ((ItemSeedFood) i).getPlant(world, 0, 0, 0); + } + else { + if(i == Items.reeds) + b = Blocks.reeds; + else { + b = Block.getBlockFromItem(i); + if(!(b == Blocks.cactus)) + return; + } + needsreplanting = false; } - Block b = ((ItemSeeds) input.getItem()).getPlant(world, 0, 0, 0); - if (!(b instanceof IGrowable)) + if (!(b instanceof IPlantable)) return; - GameRegistry.UniqueIdentifier u = GameRegistry.findUniqueIdentifierFor(input.getItem()); + GameRegistry.UniqueIdentifier u = GameRegistry.findUniqueIdentifierFor(i); if(u != null && Objects.equals(u.modId, "Natura")) optimalgrowth = 8; + + if(b instanceof BlockStem){ + fakeworld.block = null; + try { + b.updateTick(fakeworld, 5, 5, 5, fakeworld.rand); + } + catch(Exception e) + { + e.printStackTrace(System.err); + } + if(fakeworld.block == null) + return; + b = fakeworld.block; + needsreplanting = false; + } + crop = b; isIC2Crop = false; if(addDrops(world, input.stackSize, autocraft) == 0 && !drops.isEmpty()){ @@ -827,6 +867,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity if(x.stackSize > 0) drops.add(x.copy()); } + if(!needsreplanting) + return 0; for(int i = 0; i < drops.size(); i++) { if(GT_Utility.areStacksEqual(drops.get(i), input)) @@ -867,4 +909,54 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity } } + private static class GreenHouseWorld extends GT_DummyWorld { + + public int x = 0,y = 0,z = 0,meta = 0; + public Block block; + GreenHouseWorld(int x, int y, int z){ + super(); + this.x = x; + this.y = y; + this.z = z; + this.rand = new GreenHouseRandom(); + } + + @Override + public int getBlockMetadata(int aX, int aY, int aZ) { + if(aX == x && aY == y && aZ == z) + return 7; + return 0; + } + + @Override + public Block getBlock(int aX, int aY, int aZ) { + if(aY == y - 1) + return Blocks.farmland; + return Blocks.air; + } + + @Override + public int getBlockLightValue(int p_72957_1_, int p_72957_2_, int p_72957_3_) { + return 10; + } + + @Override + public boolean setBlock(int aX, int aY, int aZ, Block aBlock, int aMeta, int aFlags) { + if(aBlock == Blocks.air) + return false; + if(aX == x && aY == y && aZ == z) + return false; + block = aBlock; + meta = aMeta; + return true; + } + } + + private static class GreenHouseRandom extends Random{ + @Override + public int nextInt(int bound) { + return 0; + } + } + } -- cgit From 901281ff7916eac35cb35e9c17ce017a561c51d0 Mon Sep 17 00:00:00 2001 From: Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com> Date: Wed, 27 Jul 2022 16:00:56 +0100 Subject: Fix electric implosion compressor not accepting fluid recipes. (#164) * Bump dep * Attempt to fix EIC. * actually fix not performing fluid recipes Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Co-authored-by: miozune Former-commit-id: fb5bb37ec76e3394434e2456779bcfe4b8c071a3 --- dependencies.gradle | 2 +- .../common/loaders/StaticRecipeChangeLoaders.java | 2 +- .../GT_TileEntity_ElectricImplosionCompressor.java | 48 ++++++++-------------- 3 files changed, 18 insertions(+), 34 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 39787abe10..8b8a2c544e 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.56-dev:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.75-pre:dev") compile("com.github.GTNewHorizons:StructureLib:1.0.16:dev") compile("com.github.GTNewHorizons:TecTech:4.10.18:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.2.15-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index bfcbf94961..b34818e0bd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -496,7 +496,7 @@ public class StaticRecipeChangeLoaders { @SuppressWarnings("ALL") public static void addElectricImplosionCompressorRecipes() { if (eicMap == null) { - eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); + eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 0, 0, 1, "", 1, "", true, true); GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream().filter(e -> e.mInputs != null).forEach(recipe -> eicMap.addRecipe(true, Arrays.stream(recipe.mInputs).filter(e -> !StaticRecipeChangeLoaders.checkForExplosives(e)).distinct().toArray(ItemStack[]::new), recipe.mOutputs, null, null, null, 1, BW_Util.getMachineVoltageFromTier(10), 0)); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index dd5edf5598..db66509b77 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -45,8 +45,6 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; - import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; @@ -57,6 +55,7 @@ import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity_EnhancedMultiBlockBase { public static GT_Recipe.GT_Recipe_Map eicMap; + private static boolean pistonEnabled = false; // TODO: config private Boolean piston = true; public GT_TileEntity_ElectricImplosionCompressor(int aID, String aName, String aNameRegional) { @@ -165,33 +164,14 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity if (this.mEnergyHatches.get(0).getEUVar() <= 0 || this.mEnergyHatches.get(1).getEUVar() <= 0) return false; - ArrayList tInputList = this.getStoredInputs(); - int tInputList_sS = tInputList.size(); - - for (int i = 0; i < tInputList_sS - 1; ++i) { - for (int j = i + 1; j < tInputList_sS; ++j) { - if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { - if (tInputList.get(i).stackSize < tInputList.get(j).stackSize) { - tInputList.remove(i--); - tInputList_sS = tInputList.size(); - break; - } - - tInputList.remove(j--); - tInputList_sS = tInputList.size(); - } - } - } - - ItemStack[] tItemInputs = tInputList.toArray(new ItemStack[0]); - FluidStack[] tFluidInputs = getCompactedFluids(); + ItemStack[] tItemInputs = getStoredInputs().toArray(new ItemStack[0]); + FluidStack[] tFluidInputs = getStoredFluids().toArray(new FluidStack[0]); long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - - if (tInputList.size() > 0) { - GT_Recipe tRecipe = GT_TileEntity_ElectricImplosionCompressor.eicMap.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluidInputs, tItemInputs); + if ((tItemInputs.length > 0) || (tFluidInputs.length > 0)) { + GT_Recipe tRecipe = eicMap.findRecipe(getBaseMetaTileEntity(), false, V[tTier], tFluidInputs, tItemInputs); if (tRecipe != null && tRecipe.isRecipeInputEqual(true, tFluidInputs, tItemInputs)) { this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; this.mEfficiencyIncrease = 10000; @@ -199,12 +179,13 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); this.mOutputItems = tRecipe.mOutputs.clone(); this.mOutputFluids = tRecipe.mFluidOutputs.clone(); - this.sendLoopStart((byte) 20); + if (pistonEnabled) { + this.sendLoopStart((byte) 20); + } this.updateSlots(); return true; } } - return false; } @@ -219,8 +200,10 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity @Override public boolean onRunningTick(ItemStack aStack) { - if (this.mRuntime % 10 == 0) - this.togglePiston(); + if (pistonEnabled) { + if (this.mRuntime % 10 == 0) + this.togglePiston(); + } return super.onRunningTick(aStack); } @@ -230,7 +213,9 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } public void stopMachine() { - this.resetPiston(); + if (pistonEnabled) { + this.resetPiston(); + } super.stopMachine(); } @@ -300,8 +285,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { if(!checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0)) return false; - return this.mMaintenanceHatches.size() == 1 && - this.mEnergyHatches.size() == 2; + return this.mMaintenanceHatches.size() == 1 && this.mEnergyHatches.size() == 2; } @Override -- cgit From ea1e141ade9465e1748bf23cfd819eab3fa21bf8 Mon Sep 17 00:00:00 2001 From: miozune Date: Thu, 28 Jul 2022 19:13:17 +0900 Subject: Fix negative energy usage for EIC (#170) Former-commit-id: e908e704ec6bc92899611ad140ea7fdd31b0d13c --- .../multis/GT_TileEntity_ElectricImplosionCompressor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index db66509b77..7bb70566fb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -175,8 +175,13 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity if (tRecipe != null && tRecipe.isRecipeInputEqual(true, tFluidInputs, tItemInputs)) { this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; this.mEfficiencyIncrease = 10000; - this.mEUt = -tRecipe.mEUt; calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = -this.mEUt; + } this.mOutputItems = tRecipe.mOutputs.clone(); this.mOutputFluids = tRecipe.mFluidOutputs.clone(); if (pistonEnabled) { -- cgit From 6f98699c0851e63d59110d4c46a46c2760e00aa8 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Fri, 29 Jul 2022 07:58:19 +0200 Subject: Circuit Assembly Line enhanced tooltip (#171) * Glass * Fix glass, CAL description * 1x energy hatch * Perfect OC Former-commit-id: 1349f985020a1cfd69c7958d43f139ecf188d66b --- .../tileentities/multis/GT_TileEntity_BioVat.java | 46 +------- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 123 +++++++++------------ .../bartimaeusnek/bartworks/util/BW_Util.java | 57 +++++++++- .../resources/assets/bartworks/lang/en_US.lang | 6 - 4 files changed, 115 insertions(+), 117 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 5f76170b79..50c716d15e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -29,15 +29,9 @@ import com.github.bartimaeusnek.bartworks.common.items.LabParts; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.net.RendererPacket; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.BioCulture; -import com.github.bartimaeusnek.bartworks.util.Coords; -import com.github.bartimaeusnek.bartworks.util.MathUtils; -import com.gtnewhorizon.structurelib.StructureLibAPI; +import com.github.bartimaeusnek.bartworks.util.*; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; @@ -71,16 +65,9 @@ import java.util.HashSet; import java.util.List; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.isAir; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAnyMeta; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTiered; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBase { @@ -133,30 +120,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa isAir(), ofBlockAnyMeta(FluidLoader.bioFluidBlock) )) - .addElement('g', new IStructureElement(){ - - @Override - public boolean check(GT_TileEntity_BioVat te, World world, int x, int y, int z) { - byte glasstier = BW_Util.calculateGlassTier(world.getBlock(x, y, z), (byte)world.getBlockMetadata(x, y, z)); - if(glasstier == 0) - return false; - if(te.mGlassTier == 0) - te.mGlassTier = glasstier; - return te.mGlassTier == glasstier; - } - - @Override - public boolean spawnHint(GT_TileEntity_BioVat te, World world, int x, int y, int z, ItemStack itemStack) { - StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 1 /* aDots: 2 */); - return true; - } - - @Override - public boolean placeBlock(GT_TileEntity_BioVat te, World world, int x, int y, int z, ItemStack itemStack) { - world.setBlock(x, y, z, Blocks.glass, 0, 2); - return true; - } - }) + .addElement('g', ofGlassTiered((byte)1, (byte)127, (byte)0, (te, v) -> te.mGlassTier = v, te -> te.mGlassTier, 1)) .build(); @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index be9307317e..0409cabb4a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -22,20 +22,22 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.*; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; @@ -43,64 +45,83 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTieredMixed; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -import static net.minecraft.util.StatCollector.translateToLocal; public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_EnhancedMultiBlockBase { + private static final int CASING_INDEX = 16; + + private static final String STRUCTURE_PIECE_FIRST = "first"; + private static final String STRUCTURE_PIECE_NEXT = "next"; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape("first", transpose(new String[][] { + .addShape(STRUCTURE_PIECE_FIRST, transpose(new String[][] { {"~", "G", "G"}, {"g", "l", "g"}, {"b", "i", "b"}, })) - .addShape("next", transpose(new String[][] { + .addShape(STRUCTURE_PIECE_NEXT, transpose(new String[][] { {"G", "G", "G"}, {"g", "l", "g"}, {"b", "I", "b"}, })) .addElement('G', ofChain( - ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addEnergyInputToMachineList, 16, 1), //grate machine casings + ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addEnergyInputToMachineList, CASING_INDEX, 1), //grate machine casings ofBlock(GregTech_API.sBlockCasings3, 10))) - .addElement('g', ofChain( - ofBlockAnyMeta(GameRegistry.findBlock("IC2", "blockAlloyGlass")), - //Forgive me for I have sinned. But it works... - ofBlock(ItemRegistry.bw_realglas, 1), - ofBlock(ItemRegistry.bw_realglas, 2), - ofBlock(ItemRegistry.bw_realglas, 3), - ofBlock(ItemRegistry.bw_realglas, 4), - ofBlock(ItemRegistry.bw_realglas, 5), - ofBlock(ItemRegistry.bw_realglas, 12), - ofBlock(ItemRegistry.bw_realglas, 13), - ofBlock(ItemRegistry.bw_realglas, 14) - )) + .addElement('g', ofGlassTieredMixed((byte)4, (byte)127, 5)) .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 5)) //assembling line casings .addElement('b', ofChain( - ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addMaintenanceToMachineList, 16, 2), - ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addInputHatchToMachineList, 16, 2), + ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addMaintenanceToMachineList, CASING_INDEX, 2), + ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addInputHatchToMachineList, CASING_INDEX, 2), ofBlock(GregTech_API.sBlockCasings2, 0) )) - .addElement('i', ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addInputToMachineList, 16, 3)) + .addElement('i', ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addInputToMachineList, CASING_INDEX, 3)) .addElement('I', ofChain( - ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addInputToMachineList, 16, 4), - ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addOutputToMachineList, 16, 4) + ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addInputToMachineList, CASING_INDEX, 4), + ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addOutputToMachineList, CASING_INDEX, 4) )) .build(); @Override public IStructureDefinition getStructureDefinition() { return STRUCTURE_DEFINITION; } - //I can't get this to work properly... protected GT_Multiblock_Tooltip_Builder createTooltip() { - return new GT_Multiblock_Tooltip_Builder(); + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt. + addMachineType("Circuit Assembler"). + addInfo("Controller block for the Circuit Assembly Line"). + addInfo("Imprint this machine with a Circuit Imprint,"). + addInfo("by putting the imprint in the controller"). + addInfo("Every Circuit Assembly Line can only be imprinted ONCE"). + addInfo("Does not lose efficiency when overclocked"). + addInfo(BW_Tooltip_Reference.TT_BLUEPRINT). + addSeparator(). + beginVariableStructureBlock(2, 7, 3, 3, 3, 3, false). + addStructureInfo("From Bottom to Top, Left to Right"). + addStructureInfo("Layer 1 - Solid Steel Machine Casing, Input bus (Last Output bus), Solid Steel Machine Casing"). + addStructureInfo("Layer 2 - EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass"). + addStructureInfo("Layer 3 - Grate Machine Casing"). + addStructureInfo("Up to 7 repeating slices, last is Output Bus"). + + addController("Layer 3 first slice front"). + addOtherStructurePart("1x " + StatCollector.translateToLocal("GT5U.MBTT.EnergyHatch"), "Any layer 3 casing", 1). + addInputHatch("Any layer 1 casing", 2). + addInputBus("As specified on layer 1", 3, 4). + addOutputBus("As specified in final slice on layer 1", 4). + addOtherStructurePart("EV+ Tier Glass", "As specified on layer 2", 5). + addMaintenanceHatch("Any layer 1 casing", 2). + toolTipFinisher(ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); + return tt; } public String getTypeForDisplay() { @@ -297,24 +318,6 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance return new GT_TileEntity_CircuitAssemblyLine(this.mName); } - private static final String[] DESCRIPTION = new String[]{ - "Circuit Assembly Line", "Size(WxHxD): (2-7)x3x3, variable length", - "Bottom: Steel Machine Casing(or 1x Maintenance or Input Hatch),", - "Input Bus (Last Output Bus), Steel Machine Casing", - "Middle: EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass", - "Top: Grate Machine Casing (or Controller or 1x Energy Hatch)", - "Up to 7 repeating slices, last is Output Bus", - "Imprint this machine with a Circuit Imprint,", - "by putting the imprint in the controller.", - "Every Circuit Assembly Line can only be imprinted ONCE.", - ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() - }; - - @Override - public String[] getDescription() { - return DESCRIPTION; - } - private String[] infoDataBuffer; @Override public String[] getInfoData() { @@ -328,42 +331,24 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance return infoDataBuffer; } - @Override - public boolean isGivingInformation() { - return true; - } - @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[]{ - Textures.BlockIcons.getCasingTextureForId(16), + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE).extFacing().build(), TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW).extFacing().glow().build()}; return new ITexture[]{ - Textures.BlockIcons.getCasingTextureForId(16), + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE).extFacing().build(), TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW).extFacing().glow().build()}; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(16)}; - } - - private static final String[] description = new String[] { - translateToLocal("BW.keyphrase.Hint_Details") + ":", - translateToLocal("BW.tile.CircuitAssemblyLine.hint.0"), //1 - Energy Input Hatch - translateToLocal("BW.tile.CircuitAssemblyLine.hint.1"), //2 - Maintenance Hatch, Input Hatch - translateToLocal("BW.tile.CircuitAssemblyLine.hint.2"), //3 - Input Bus - translateToLocal("BW.tile.CircuitAssemblyLine.hint.3"), //4 - Input Bus, Output Bus - }; - - @Override - public String[] getStructureDescription(ItemStack stackSize) { - return description; + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - if (!this.checkPiece("first", 0, 0, 0)) { + if (!this.checkPiece(STRUCTURE_PIECE_FIRST, 0, 0, 0)) { return false; } else { return this.checkMachine(true) || this.checkMachine(false); @@ -372,7 +357,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance private boolean checkMachine(boolean leftToRight) { for(int i = 1; i < 7; ++i) { - if (!this.checkPiece("next", leftToRight ? -i : i, 0, 0)) { + if (!this.checkPiece(STRUCTURE_PIECE_NEXT, leftToRight ? -i : i, 0, 0)) { return false; } @@ -385,11 +370,11 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance } public void construct(ItemStack stackSize, boolean hintsOnly) { - this.buildPiece("first", stackSize, hintsOnly, 0, 0, 0); + this.buildPiece(STRUCTURE_PIECE_FIRST, stackSize, hintsOnly, 0, 0, 0); int tLength = Math.min(stackSize.stackSize + 1, 7); for(int i = 1; i < tLength; ++i) { - this.buildPiece("next", stackSize, hintsOnly, -i, 0, 0); + this.buildPiece(STRUCTURE_PIECE_NEXT, stackSize, hintsOnly, -i, 0, 0); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 312c4be88a..2395109d8b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -25,7 +25,9 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.MainMod; -import gregtech.api.enums.GT_Values; +import com.gtnewhorizon.structurelib.StructureLibAPI; +import com.gtnewhorizon.structurelib.structure.IStructureElement; +import com.gtnewhorizon.structurelib.structure.IStructureElementNoPlacement; import gregtech.api.enums.Materials; import gregtech.api.enums.OreDictNames; import gregtech.api.enums.ToolDictNames; @@ -47,6 +49,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; +import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; @@ -58,6 +61,8 @@ import javax.annotation.Nonnull; import java.lang.reflect.Array; import java.lang.reflect.Field; import java.util.*; +import java.util.function.BiConsumer; +import java.util.function.Function; import java.util.stream.Collectors; import static gregtech.api.enums.GT_Values.*; @@ -673,6 +678,56 @@ public class BW_Util { return 0; } + public static IStructureElement ofGlassTiered(byte mintier, byte maxtier, byte notset, BiConsumer setter, Function getter, int aDots){ + return new IStructureElementNoPlacement(){ + @Override + public boolean check(T te, World world, int x, int y, int z) { + if(world.isAirBlock(x, y, z)) + return false; + byte glasstier = BW_Util.calculateGlassTier(world.getBlock(x, y, z), (byte)world.getBlockMetadata(x, y, z)); + if(glasstier == 0) // is not a glass ? + return false; + if(glasstier == notset) + return false; + if(glasstier < mintier) + return false; + if(glasstier > maxtier) + return false; + if(getter.apply(te) == notset) + setter.accept(te, glasstier); + return getter.apply(te) == glasstier; + } + + @Override + public boolean spawnHint(T te, World world, int x, int y, int z, ItemStack itemStack) { + StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), aDots - 1); + return true; + } + }; + } + + public static IStructureElement ofGlassTieredMixed(byte mintier, byte maxtier, int aDots){ + return new IStructureElementNoPlacement(){ + @Override + public boolean check(T te, World world, int x, int y, int z) { + if(world.isAirBlock(x, y, z)) + return false; + byte glasstier = BW_Util.calculateGlassTier(world.getBlock(x, y, z), (byte)world.getBlockMetadata(x, y, z)); + if(glasstier == 0) // is not a glass ? + return false; + return glasstier >= mintier && glasstier <= maxtier; + } + + @Override + public boolean spawnHint(T te, World world, int x, int y, int z, ItemStack itemStack) { + StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), aDots - 1); + return true; + } + }; + } + + + private static Field sBufferedRecipeList; @SuppressWarnings("unchecked") diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 81b7c6b5c0..dca5ca5d25 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -156,12 +156,6 @@ item.BurnedOutTRISOPellet.name=Burned Out TRISO pebble itemGroup.bartworksMetaMaterials=BartWorks' Meta Materials -BW.keyphrase.Hint_Details=Hint Details -BW.tile.CircuitAssemblyLine.hint.0=1 - Energy Input Hatch -BW.tile.CircuitAssemblyLine.hint.1=2 - Maintenance Hatch, Input Hatch -BW.tile.CircuitAssemblyLine.hint.2=3 - Input Bus -BW.tile.CircuitAssemblyLine.hint.3=4 - Input Bus, Output Bus - planet.Ross128b=Ross128b moon.Ross128ba=Ross128ba star.Ross128=Ross128 -- cgit From 2bd7ff102b0bdbf1c9364759e9ba43e0d6a4b402 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Fri, 29 Jul 2022 07:59:39 +0200 Subject: Enable back piston work and use compacted inputs to check the recipe. (#169) * Piston and compacted inputs * tx * Input Hatch in structure info * Maintenance hatch in structure info * Rewrite piston process * Config value Former-commit-id: 98c522eeb02d75c009213cc1df5ef50b860497ea --- .../bartworks/common/configs/ConfigHandler.java | 3 + .../GT_TileEntity_ElectricImplosionCompressor.java | 130 ++++++++++++--------- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 1 - 3 files changed, 78 insertions(+), 56 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 5a810c82cb..fdef73f046 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -80,6 +80,8 @@ public class ConfigHandler { public static Set voidMinerBlacklist = Collections.unmodifiableSet(new HashSet<>()); + public static boolean disablePistonInEIC = false; + private static final int[][] METAFORTIERS_ENERGY = { {100, 101, 102, 105}, {1110, 1115, 1120, 1127}, @@ -142,6 +144,7 @@ public class ConfigHandler { ConfigHandler.megaMachinesMax = ConfigHandler.c.get("Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256); ConfigHandler.bioVatMaxParallelBonus = ConfigHandler.c.get("Multiblocks","BioVat Maximum Bonus on Recipes", 1000,"This are the maximum parallel Operations the BioVat can do, when the output is half full.").getInt(1000); ConfigHandler.voidMinerBlacklist = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(ConfigHandler.c.get("Multiblocks", "Void Miner Blacklist", new String[0], "This is a blacklist for the Void Miner, blacklisted ores will not enter the drop prize pool. Please fill in the Unique Identifier of Ore and connect Damage with a colon, For example: gregtech:gt.blockores:32").getStringList()))); + ConfigHandler.disablePistonInEIC = ConfigHandler.c.get("Multiblocks", "Disable Electric Implosion Compressor piston", false, "This switch completely disables piston animation in Electric Implosion Compressor multiblock").getBoolean(false); ConfigHandler.pollutionHeatedWaterPumpSecond = ConfigHandler.c.get("Pollution", "Pollution produced per second by the water pump", ConfigHandler.pollutionHeatedWaterPumpSecond, "How much should the Simple Stirling Water Pump produce pollution per second").getInt(ConfigHandler.pollutionHeatedWaterPumpSecond); ConfigHandler.basePollutionMBFSecond = ConfigHandler.c.get("Pollution", "Pollution produced per tick by the MBF per ingot", ConfigHandler.basePollutionMBFSecond,"How much should the MBF produce pollution per tick per ingot. Then it'll be multiplied by the amount of ingots done in parallel").getInt(ConfigHandler.basePollutionMBFSecond); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 7bb70566fb..80fb7c64e1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -22,41 +22,46 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import java.util.ArrayList; + import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity_EnhancedMultiBlockBase { public static GT_Recipe.GT_Recipe_Map eicMap; - private static boolean pistonEnabled = false; // TODO: config + private static final boolean pistonEnabled = !ConfigHandler.disablePistonInEIC; private Boolean piston = true; + private static final String sound = GregTech_API.sSoundList.get(5); + private final ArrayList chunkCoordinates = new ArrayList<>(5); public GT_TileEntity_ElectricImplosionCompressor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -152,7 +157,9 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity addOtherStructurePart("Neutronium Blocks", "Layer 4,5,6"). addMaintenanceHatch("Any bottom casing", 1). addInputBus("Any bottom casing", 1). + addInputHatch("Any bottom casing", 1). addOutputBus("Any bottom casing", 1). + addMaintenanceHatch("Any bottom casing", 1). addEnergyHatch("Bottom and top middle", 2). toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; @@ -164,8 +171,8 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity if (this.mEnergyHatches.get(0).getEUVar() <= 0 || this.mEnergyHatches.get(1).getEUVar() <= 0) return false; - ItemStack[] tItemInputs = getStoredInputs().toArray(new ItemStack[0]); - FluidStack[] tFluidInputs = getStoredFluids().toArray(new FluidStack[0]); + ItemStack[] tItemInputs = getCompactedInputs(); + FluidStack[] tFluidInputs = getCompactedFluids(); long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); @@ -184,9 +191,6 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } this.mOutputItems = tRecipe.mOutputs.clone(); this.mOutputFluids = tRecipe.mFluidOutputs.clone(); - if (pistonEnabled) { - this.sendLoopStart((byte) 20); - } this.updateSlots(); return true; } @@ -194,6 +198,29 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity return false; } + private void updateChunkCoordinates(){ + chunkCoordinates.clear(); + + for(int x = -1; x <= 1; x++) + for(int z = -1; z <= 1; z++) { + if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) { + int[] abc = new int[]{x, -2, z + 1}; + int[] xyz = new int[]{0, 0, 0}; + this.getExtendedFacing().getWorldOffset(abc, xyz); + xyz[0] += this.getBaseMetaTileEntity().getXCoord(); + xyz[1] += this.getBaseMetaTileEntity().getYCoord(); + xyz[2] += this.getBaseMetaTileEntity().getZCoord(); + chunkCoordinates.add(new ChunkCoordinates(xyz[0], xyz[1], xyz[2])); + } + } + } + + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + super.onFirstTick(aBaseMetaTileEntity); + updateChunkCoordinates(); + } + @Override public boolean drainEnergyInput(long aEU) { if (aEU <= 0) return true; @@ -204,12 +231,18 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } @Override - public boolean onRunningTick(ItemStack aStack) { - if (pistonEnabled) { - if (this.mRuntime % 10 == 0) - this.togglePiston(); - } - return super.onRunningTick(aStack); + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + + if (pistonEnabled && aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isActive() && aTick % 10 == 0) + togglePiston(aBaseMetaTileEntity); + } + + @Override + public void setExtendedFacing(ExtendedFacing newExtendedFacing) { + super.setExtendedFacing(newExtendedFacing); + + updateChunkCoordinates(); } @Override @@ -218,60 +251,40 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } public void stopMachine() { - if (pistonEnabled) { + if (pistonEnabled) this.resetPiston(); - } super.stopMachine(); } private void resetPiston() { - if (this.getBaseMetaTileEntity().getWorld().isRemote) + IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); + if (!aBaseMetaTileEntity.isServerSide()) return; if (!this.piston && this.mMachine) { - int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; - int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; - int aX = this.getBaseMetaTileEntity().getXCoord(), aY = this.getBaseMetaTileEntity().getYCoord(), aZ = this.getBaseMetaTileEntity().getZCoord(); - for (int x = -1; x <= 1; x++) { - for (int z = -1; z <= 1; z++) { - if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) - this.getBaseMetaTileEntity().getWorld().setBlock(xDir + aX + x, aY + 2, zDir + aZ + z, GregTech_API.sBlockMetal5, 2, 3); - } - } - GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + chunkCoordinates.forEach(c -> aBaseMetaTileEntity.getWorld().setBlock(c.posX, c.posY, c.posZ, GregTech_API.sBlockMetal5, 2, 3)); this.piston = !this.piston; } } - private void togglePiston() { - if (this.getBaseMetaTileEntity().getWorld().isRemote) + private void togglePiston(IGregTechTileEntity aBaseMetaTileEntity) { + if (aBaseMetaTileEntity.getWorld().isRemote) return; - int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; - int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; - int aX = this.getBaseMetaTileEntity().getXCoord(), aY = this.getBaseMetaTileEntity().getYCoord(), aZ = this.getBaseMetaTileEntity().getZCoord(); - boolean hax = false; if (this.piston) { - for (int x = -1; x <= 1; x++) { - for (int z = -1; z <= 1; z++) { - if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) { - if (this.getBaseMetaTileEntity().getBlock(xDir + aX + x, aY + 2, zDir + aZ + z) != GregTech_API.sBlockMetal5 && this.getBaseMetaTileEntity().getMetaID(xDir + aX + x, aY + 2, zDir + aZ + z) != 2) { - hax = true; - } - this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + aX + x, aY + 2, zDir + aZ + z); - } + for(ChunkCoordinates c : chunkCoordinates) + { + if(aBaseMetaTileEntity.getBlock(c.posX, c.posY, c.posZ) != GregTech_API.sBlockMetal5 || aBaseMetaTileEntity.getMetaID(c.posX, c.posY, c.posZ) != 2) + { + this.explodeMultiblock(); + return; } + aBaseMetaTileEntity.getWorld().setBlockToAir(c.posX, c.posY, c.posZ); } + } else { - for (int x = -1; x <= 1; x++) { - for (int z = -1; z <= 1; z++) { - if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) - this.getBaseMetaTileEntity().getWorld().setBlock(xDir + aX + x, aY + 2, zDir + aZ + z, GregTech_API.sBlockMetal5, 2, 3); - } - } + chunkCoordinates.forEach(c -> aBaseMetaTileEntity.getWorld().setBlock(c.posX, c.posY, c.posZ, GregTech_API.sBlockMetal5, 2, 3)); + GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(), sound, 10, 1.0F, chunkCoordinates.get(0).posX, chunkCoordinates.get(0).posY, chunkCoordinates.get(0).posZ); } - GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); this.piston = !this.piston; - if (hax) - this.explodeMultiblock(); } @Override @@ -321,10 +334,17 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return aActive ? new ITexture[]{Textures.BlockIcons.casingTexturePages[0][16], TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE}).extFacing().build(), TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW}).extFacing().glow().build()} : new ITexture[]{Textures.BlockIcons.casingTexturePages[0][16], TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR}).extFacing().build(), TextureFactory.builder().addIcon(new IIconContainer[]{Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW}).extFacing().glow().build()}; - } else { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][16]}; + if (aActive) + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW).extFacing().glow().build()}; + return new ITexture[]{ + Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW).extFacing().glow().build()}; } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index a4933c0b5a..99e0b59664 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -46,7 +46,6 @@ import ic2.api.crops.Crops; import ic2.core.Ic2Items; import ic2.core.crop.TileEntityCrop; import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; import net.minecraft.block.BlockStem; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; -- cgit From 82c8e49dfbbaa28a8dcd73d366b44852e2a498eb Mon Sep 17 00:00:00 2001 From: Alexandre Tardif Date: Fri, 29 Jul 2022 22:03:26 -0400 Subject: Allow Bacterial Vat overclock via double hatches (#172) Co-authored-by: Alexandre Tardif Former-commit-id: ff1fe0d84153897645eeb32d28ef3df0511e5a43 --- .../common/tileentities/multis/GT_TileEntity_BioVat.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 50c716d15e..628316ccae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -68,6 +68,7 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTI import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTiered; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.enums.GT_Values.V; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBase { @@ -280,7 +281,11 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa if (tFluids.length <= 0) return false; - GT_Recipe gtRecipe = gtRecipeMap.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, this.getMaxInputVoltage(), tFluids, itemStack, tInputs); + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + long tEnergy = V[tTier]; + + GT_Recipe gtRecipe = gtRecipeMap.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, tEnergy, tFluids, itemStack, tInputs); if (gtRecipe == null) return false; @@ -317,7 +322,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa this.mOutputFluids = new FluidStack[]{new FluidStack(recipeFluidOutput, recipeFluidOutput.amount * this.mTimes)}; - BW_Util.calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, this.getMaxInputVoltage(), this); + BW_Util.calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, tEnergy, this); if (this.mEUt > 0) this.mEUt = -this.mEUt; -- cgit From e2bbcf49569538db15de1c33b375acf378aa00b0 Mon Sep 17 00:00:00 2001 From: Steelux <70096037+Steelux8@users.noreply.github.com> Date: Sun, 31 Jul 2022 08:39:16 +0100 Subject: Buffed Oganesson in Fusion to Beat Replication (#131) - Changed the Oganesson fusion recipe to reduce total EU cost from around 750M EU to 215M, which matches the EU cost in the replicator multi. - Changed the recipe time to make the crafting faster, but not nearly as fast as the replicator multi. Former-commit-id: f325233720c1dd283dff139f38559efb01b44bb5 --- .../bartworks/system/material/processingLoaders/AdditionalRecipes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index aefb3df7b4..1e39d5f39f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -309,7 +309,7 @@ public class AdditionalRecipes { //Tellurium GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed, Materials.Lead, 10L), GT_Utility.getIntegratedCircuit(17), GT_Values.NF, GT_Values.NF, Materials.Lead.getIngots(10), Materials.Tellurium.getNuggets(20), 800, BW_Util.getMachineVoltageFromTier(2), 722); GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium.getMolten(48), Materials.Beryllium.getMolten(48), WerkstoffLoader.Californium.getMolten(48), 240, 49152, 480000000); - GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(48), WerkstoffLoader.Calcium.getMolten(48), WerkstoffLoader.Oganesson.getFluidOrGas(48), 480, 49152, 600000000); + GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(32), WerkstoffLoader.Calcium.getMolten(144), WerkstoffLoader.Oganesson.getFluidOrGas(144), 420, 49152, 600000000); GT_Values.RA.addDistillationTowerRecipe(Materials.LiquidAir.getFluid(100000000), new FluidStack[]{Materials.Nitrogen.getGas(78084000), Materials.Oxygen.getGas(20946000), Materials.Argon.getGas(934000), Materials.CarbonDioxide.getGas(40700), WerkstoffLoader.Neon.getFluidOrGas(1818), Materials.Helium.getGas(524), Materials.Methane.getGas(180), WerkstoffLoader.Krypton.getFluidOrGas(114), Materials.Hydrogen.getGas(55), WerkstoffLoader.Xenon.getFluidOrGas(9)}, null, 7500, BW_Util.getMachineVoltageFromTier(4)); GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust), WerkstoffLoader.Neon.getFluidOrGas(1000), WerkstoffLoader.MagnetoResonaticDust.get(gemChipped, 9), 9000, 4500, BW_Util.getMachineVoltageFromTier(5)); GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust), WerkstoffLoader.Krypton.getFluidOrGas(1000), WerkstoffLoader.MagnetoResonaticDust.get(gem), 10000, 4500, BW_Util.getMachineVoltageFromTier(5)); -- cgit From ae66b77323f71418c97d6dcf66787bc007ed9a50 Mon Sep 17 00:00:00 2001 From: RIONDY 'POPlol333' Adam <76914762+POPlol333@users.noreply.github.com> Date: Sun, 31 Jul 2022 09:39:41 +0200 Subject: Switched diode UHV craft SC UHV->UV, a bit of comment and apparence formating (#173) Former-commit-id: 771bb6426b5ffe49d9d127e2873a29622f3b8a6b --- .../bartworks/common/loaders/RecipeLoader.java | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 56553661fa..95770f713d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -309,8 +309,32 @@ public class RecipeLoader { } ); - Materials[] cables = {Materials.Lead, Materials.Tin, Materials.AnnealedCopper, Materials.Gold, Materials.Aluminium, Materials.Tungsten, Materials.VanadiumGallium, Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; - ISubTagContainer[] hulls = {Materials.WroughtIron, Materials.Steel, Materials.Aluminium, Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, WerkstoffLoader.LuVTierMaterial, Materials.Iridium, Materials.Osmium, Materials.Naquadah}; + Materials[] cables = { //Cable material used in the acid gen, diode and energy distributor below + Materials.Lead, //ULV + Materials.Tin, //LV + Materials.AnnealedCopper, //MV + Materials.Gold, //HV + Materials.Aluminium, //EV + Materials.Tungsten, //IV + Materials.VanadiumGallium, //LuV + Materials.Naquadah, //ZPM + Materials.NaquadahAlloy, //UV + Materials.SuperconductorUV //UHV + }; + + ISubTagContainer[] hulls = { //Plate material used in the acid gen, diode and energy distributor below + Materials.WroughtIron, //ULV + Materials.Steel, //LV + Materials.Aluminium, //MV + Materials.StainlessSteel, //HV + Materials.Titanium, //EV + Materials.TungstenSteel, //IV + WerkstoffLoader.LuVTierMaterial, //LuV + Materials.Iridium, //ZPM + Materials.Osmium, //UV + Materials.Naquadah //UHV + }; + ItemStack[] bats = {ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_Hull_MV.get(1L), ItemList.Battery_Hull_HV.get(1L)}; ItemStack[] chreac = {ItemList.Machine_MV_ChemicalReactor.get(1L), ItemList.Machine_HV_ChemicalReactor.get(1L), ItemList.Machine_EV_ChemicalReactor.get(1L)}; -- cgit From db813d933d0c13deda730df24f84f5663c955677 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Mon, 1 Aug 2022 01:42:39 +0200 Subject: Fix EIC being super load and check for installed muffler upgrade (#175) Former-commit-id: eb82b1e7e1a02dc7ecb0b2afa1f6cf72083593ea --- .../tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 80fb7c64e1..7eeb3767d2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -282,7 +282,8 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } else { chunkCoordinates.forEach(c -> aBaseMetaTileEntity.getWorld().setBlock(c.posX, c.posY, c.posZ, GregTech_API.sBlockMetal5, 2, 3)); - GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(), sound, 10, 1.0F, chunkCoordinates.get(0).posX, chunkCoordinates.get(0).posY, chunkCoordinates.get(0).posZ); + if(!getBaseMetaTileEntity().hasMufflerUpgrade()) + GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(), sound, 1f, 1f, chunkCoordinates.get(0).posX, chunkCoordinates.get(0).posY, chunkCoordinates.get(0).posZ); } this.piston = !this.piston; } -- cgit From 393ce10f8760eb017cad29084b8a72a1380c97bf Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Mon, 1 Aug 2022 03:06:22 +0200 Subject: Unlock primordial crop (#174) Former-commit-id: 1fd6af213d5bec80889c4a11c28705236531b633 --- .../tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index 99e0b59664..ffe6e4b0c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -203,7 +203,6 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity addInfo("Process time: 5 sec"). addInfo("All crops are accelerated by x32 times"). addInfo("1 Fertilizer per 1 crop +10%"). - addInfo("Cannot process primordial"). addInfo(BW_Tooltip_Reference.TT_BLUEPRINT). addSeparator(). beginStructureBlock(5, 4, 5, false). @@ -693,8 +692,6 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity if(!ItemList.IC2_Crop_Seeds.isStackEqual(input, true, true)) return; CropCard cc = Crops.instance.getCropCard(input); - if(cc.tier() > 15) // dont process primordial - return; this.input.stackSize = 1; NBTTagCompound nbt = input.getTagCompound(); byte gr = nbt.getByte("growth"); -- cgit From d5a34b44349c17c8a50736d7fa653455e6f2ffc7 Mon Sep 17 00:00:00 2001 From: Alexandre Tardif Date: Mon, 1 Aug 2022 08:13:04 -0400 Subject: Allow input bus separation on the MBF (#176) Co-authored-by: Alexandre Tardif Former-commit-id: 4465a5b7226657198edb6e3ee2386227f1fdcd60 --- .../mega/GT_TileEntity_MegaBlastFurnace.java | 62 ++++++++++++++++------ 1 file changed, 47 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 1f9da17393..ffc6844539 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -50,6 +50,8 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; +import net.minecraft.util.StatCollector; + import java.util.*; import java.util.stream.Collectors; @@ -173,9 +175,11 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock super.loadNBTData(aNBT); this.circuitMode = aNBT.getByte("circuitMode"); this.glasTier = aNBT.getByte("glasTier"); + this.isBussesSeparate = aNBT.getBoolean("isBussesSeparate"); } private byte circuitMode = 0; + private boolean isBussesSeparate = false; @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { @@ -192,6 +196,13 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock GT_Utility.sendChatToPlayer(aPlayer, circuitMode > 0 ? "MEBF will prioritise circuit: " + circuitMode : "Circuit prioritisation disabled."); } + @Override + public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + isBussesSeparate = !isBussesSeparate; + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate); + return true; + } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { @@ -213,6 +224,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock super.saveNBTData(aNBT); aNBT.setByte("glasTier", glasTier); aNBT.setByte("circuitMode", circuitMode); + aNBT.setBoolean("isBussesSeparate", isBussesSeparate); } @Override @@ -256,27 +268,47 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override public boolean checkRecipe(ItemStack itemStack) { - - ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - + ItemStack[] tInputs = null; FluidStack[] tFluids = this.getStoredFluids().toArray(new FluidStack[0]); long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); - GT_Recipe tRecipe; - if (circuitMode > 0 && Arrays.stream(tInputs).anyMatch(e -> GT_Utility.areStacksEqual(e, GT_Utility.getIntegratedCircuit(circuitMode), true))) { - List modInputs = Arrays.stream(tInputs).filter(Objects::nonNull).filter(e -> !e.getItem().equals(GT_Utility.getIntegratedCircuit(circuitMode).getItem())).collect(Collectors.toList()); - modInputs.add(GT_Utility.getIntegratedCircuit(circuitMode)); - tInputs = modInputs.toArray(new ItemStack[0]); - } - tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); - if (tRecipe == null) { - if (circuitMode == 0) - return false; + GT_Recipe tRecipe = null; + + if (isBussesSeparate) { + for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) { + ArrayList tInputList = new ArrayList<>(); + tBus.mRecipeMap = getRecipeMap(); + + if (isValidMetaTileEntity(tBus)) { + for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) { + if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null) { + tInputList.add(tBus.getBaseMetaTileEntity().getStackInSlot(i)); + } + } + } + tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, tInputList.size()); + tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(false, tFluids, tInputs))) { + break; + } + } + } else { tInputs = this.getStoredInputs().toArray(new ItemStack[0]); + if (circuitMode > 0 && Arrays.stream(tInputs).anyMatch(e -> GT_Utility.areStacksEqual(e, GT_Utility.getIntegratedCircuit(circuitMode), true))) { + List modInputs = Arrays.stream(tInputs).filter(Objects::nonNull).filter(e -> !e.getItem().equals(GT_Utility.getIntegratedCircuit(circuitMode).getItem())).collect(Collectors.toList()); + modInputs.add(GT_Utility.getIntegratedCircuit(circuitMode)); + tInputs = modInputs.toArray(new ItemStack[0]); + } tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); - if (tRecipe == null) - return false; + if (tRecipe == null) { + if (circuitMode == 0) + return false; + tInputs = this.getStoredInputs().toArray(new ItemStack[0]); + tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); + if (tRecipe == null) + return false; + } } ArrayList outputItems = new ArrayList<>(); -- cgit From 82caebbae91969542827702a4da01c0d0fdc8cbe Mon Sep 17 00:00:00 2001 From: miozune Date: Tue, 2 Aug 2022 19:19:19 +0900 Subject: recipe owner adjustments (#162) * recipe owner adjustments * Fix some recipes not being added * Fix typo Co-authored-by: Martin Robertz Former-commit-id: 3dcea1bd3dbc3e2433d9fe59fce5853a7b34c953 --- dependencies.gradle | 2 +- .../common/loaders/StaticRecipeChangeLoaders.java | 21 ++++-- .../material/GT_Enhancement/LuVTierEnhancer.java | 85 ++++++++++++++-------- .../GT_Enhancement/PlatinumSludgeOverHaul.java | 27 ++++++- .../bartimaeusnek/bartworks/util/BWRecipes.java | 12 ++- 5 files changed, 106 insertions(+), 41 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 8b8a2c544e..7abb0e2f5d 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.75-pre:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.78:dev") compile("com.github.GTNewHorizons:StructureLib:1.0.16:dev") compile("com.github.GTNewHorizons:TecTech:4.10.18:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.2.15-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index b34818e0bd..4300993943 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -56,7 +56,6 @@ import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; @@ -70,8 +69,6 @@ import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Oganesson; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.fluids; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.molten; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; -import static gregtech.api.enums.GT_Values.MOD_ID_FR; import static gregtech.api.enums.GT_Values.VN; public class StaticRecipeChangeLoaders { @@ -406,7 +403,13 @@ public class StaticRecipeChangeLoaders { if (newGas.contains(GasTag)) { int time = transformEBFGasRecipeTime(recipe, originalGas, newGas); int gasAmount = Math.max(1, (int) Math.round((double) recipe.mFluidInputs[0].amount * gtEbfGasRecipeConsumptionMultipliers.get(newGas))); - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{newGas.getGas(gasAmount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); + if (recipe.mFluidInputs != null && recipe.mFluidInputs.length == 1 && recipe.mFluidInputs[0].isFluidEqual(newGas.getGas(0))) { + // preserve original recipe owner + toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{newGas.getGas(gasAmount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue, recipe)); + } else { + // new recipe + toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{newGas.getGas(gasAmount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); + } } } } @@ -416,7 +419,13 @@ public class StaticRecipeChangeLoaders { if (newGas.contains(GasTag)) { int time = transformEBFGasRecipeTime(recipe, originalGas, newGas); int gasAmount = Math.max(1, (int) Math.round((double) recipe.mFluidInputs[0].amount * newGas.getStats().getEbfGasRecipeConsumedAmountMultiplier())); - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); + if (recipe.mFluidInputs != null && recipe.mFluidInputs.length == 1 && recipe.mFluidInputs[0].isFluidEqual(new FluidStack(Objects.requireNonNull(fluids.get(newGas)), 0))) { + // preserve original recipe owner + toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue, recipe)); + } else { + // new recipe + toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); + } } } } @@ -433,7 +442,7 @@ public class StaticRecipeChangeLoaders { inputs.add(stack); } inputs.add(GT_Utility.getIntegratedCircuit(circuitConfiguration)); - toAdd.add(new BWRecipes.DynamicGTRecipe(false, inputs.toArray(new ItemStack[0]), recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, transformEBFNoGasRecipeTime(recipe, originalGas), recipe.mEUt, recipe.mSpecialValue)); + toAdd.add(new BWRecipes.DynamicGTRecipe(false, inputs.toArray(new ItemStack[0]), recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, transformEBFNoGasRecipeTime(recipe, originalGas), recipe.mEUt, recipe.mSpecialValue, recipe)); break; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java index f5ee1e303a..e1a80035e1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -47,6 +47,7 @@ import java.util.*; import java.util.function.Consumer; import java.util.function.Predicate; +import static com.github.bartimaeusnek.bartworks.MainMod.MOD_ID; import static gregtech.api.enums.OrePrefixes.*; @SuppressWarnings("ALL") @@ -141,7 +142,7 @@ public class LuVTierEnhancer implements Runnable { private static void rewriteCraftingRecipes(List bufferedRecipeList, OrePrefixes[] LuVMaterialsGenerated, Predicate recipeFilter){ for (OrePrefixes prefixes : LuVMaterialsGenerated) { - Consumer recipeAction = obj -> LuVTierEnhancer.doStacksCointainAndReplace(((GT_Shaped_Recipe) obj).getInput(), + Consumer recipeAction = obj -> LuVTierEnhancer.doStacksContainAndReplace(null, ((GT_Shaped_Recipe) obj).getInput(), GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); @@ -151,39 +152,39 @@ public class LuVTierEnhancer implements Runnable { } private static void rewriteMachineRecipes(ItemStack stack, OrePrefixes[] LuVMaterialsGenerated, GT_Recipe recipe) { - if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { + if (LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, stack, false)) { for (OrePrefixes prefixes : LuVMaterialsGenerated) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); } - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); } - if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, stack, false)) { + if (LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mOutputs, stack, false)) { for (OrePrefixes prefixes : LuVMaterialsGenerated) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); } - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); } } private static void rewriteAsslineRecipes(ItemStack stack, OrePrefixes[] LuVMaterialsGenerated, GT_Recipe.GT_Recipe_AssemblyLine recipe){ for (OrePrefixes prefixes : LuVMaterialsGenerated) { - if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksCointainAndReplace(new Object[]{recipe.mOutput}, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + if (LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, stack, false)) { + LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[]{recipe.mOutput}, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); } - if (LuVTierEnhancer.doStacksCointainAndReplace(new Object[]{recipe.mOutput}, stack, false)) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksCointainAndReplace(new Object[]{recipe.mOutput}, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + if (LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[]{recipe.mOutput}, stack, false)) { + LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[]{recipe.mOutput}, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); } } - if (LuVTierEnhancer.doStacksCointainAndReplace(recipe.mInputs, stack, false)) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + if (LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, stack, false)) { + LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); } - if (LuVTierEnhancer.doStacksCointainAndReplace(new Object[]{recipe.mOutput}, stack, false)) { - LuVTierEnhancer.doStacksCointainAndReplace(recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + if (LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[]{recipe.mOutput}, stack, false)) { + LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); } } @@ -192,7 +193,8 @@ public class LuVTierEnhancer implements Runnable { gt_recipe.mInputs = replaceArrayWith( gt_recipe.mInputs, Materials.Osmiridium, - WerkstoffLoader.Ruridit + WerkstoffLoader.Ruridit, + gt_recipe ); GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.stream() @@ -201,7 +203,8 @@ public class LuVTierEnhancer implements Runnable { recipe_assemblyLine.mInputs = replaceArrayWith( recipe_assemblyLine.mInputs, Materials.Osmiridium, - WerkstoffLoader.Ruridit + WerkstoffLoader.Ruridit, + recipe_assemblyLine ) ); @@ -225,25 +228,33 @@ public class LuVTierEnhancer implements Runnable { return false; } - private static ItemStack[] replaceArrayWith(ItemStack[] stackArray, Materials source, Werkstoff target) { + private static ItemStack[] replaceArrayWith(ItemStack[] stackArray, Materials source, Werkstoff target, Object recipe) { + boolean replaced = false; for (int i = 0; i < stackArray.length; i++) { ItemStack stack = stackArray[i]; if (!BW_Util.checkStackAndPrefix(stack)) continue; - stackArray[i] = replaceStackWith(stack, source, target); + stackArray[i] = replaceStackWith(stack, source, target, recipe); } return stackArray; } - private static ItemStack replaceStackWith(ItemStack stack, Materials source, Werkstoff target) { + private static ItemStack replaceStackWith(ItemStack stack, Materials source, Werkstoff target, Object recipe) { ItemData ass = GT_OreDictUnificator.getAssociation(stack); - if (ass.mMaterial.mMaterial.equals(source)) - if (target.hasItemType(ass.mPrefix)) + if (ass.mMaterial.mMaterial.equals(source)) { + if (target.hasItemType(ass.mPrefix)) { stack = target.get(ass.mPrefix, stack.stackSize); + if (recipe instanceof GT_Recipe) { + ((GT_Recipe) recipe).setOwner(MOD_ID); + } else if (recipe instanceof GT_Recipe_AssemblyLine) { + // todo: update NEI fake recipe + } + } + } return stack; } - private static boolean doStacksCointainAndReplace(FluidStack[] stacks, FluidStack stack, boolean replace, Fluid... replacement) { + private static boolean doStacksContainAndReplace(Object recipe, FluidStack[] stacks, FluidStack stack, boolean replace, Fluid... replacement) { boolean replaced = false; for (int i = 0; i < stacks.length; i++) { if (GT_Utility.areFluidsEqual(stack, stacks[i])) @@ -255,10 +266,17 @@ public class LuVTierEnhancer implements Runnable { replaced = true; } } + if (replace && replaced) { + if (recipe instanceof GT_Recipe) { + ((GT_Recipe) recipe).setOwner(MOD_ID); + } else if (recipe instanceof GT_Recipe_AssemblyLine) { + // todo: update NEI fake recipe + } + } return replaced; } - private static boolean doStacksCointainAndReplace(Object[] stacks, ItemStack stack, boolean replace, ItemStack... replacement) { + private static boolean doStacksContainAndReplace(Object recipe, Object[] stacks, ItemStack stack, boolean replace, ItemStack... replacement) { boolean replaced = false; for (int i = 0; i < stacks.length; i++) { if (!GT_Utility.isStackValid(stacks[i])) { @@ -284,6 +302,13 @@ public class LuVTierEnhancer implements Runnable { replaced = true; } } + if (replace && replaced) { + if (recipe instanceof GT_Recipe) { + ((GT_Recipe) recipe).setOwner(MOD_ID); + } else if (recipe instanceof GT_Recipe_AssemblyLine) { + // todo: update NEI fake recipe + } + } return replaced; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 08ed4cd980..b7b4d07894 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -267,12 +267,18 @@ public class PlatinumSludgeOverHaul { toDel.add(recipe); else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) toDel.add(recipe); - else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) + else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) { recipe.mFluidOutputs[i] = AcidicIridiumSolution.getFluidOrGas(1000); - else if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) + recipe.reloadOwner(); + } + else if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) { recipe.mFluidOutputs[i] = PTConcentrate.getFluidOrGas(1000); - else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) + recipe.reloadOwner(); + } + else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) { recipe.mFluidOutputs[i] = AcidicOsmiumSolution.getFluidOrGas(1000); + recipe.reloadOwner(); + } } else { if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) toDel.add(recipe); @@ -296,6 +302,7 @@ public class PlatinumSludgeOverHaul { continue recipeloop; int amount = recipe.mOutputs[i].stackSize * 2; recipe.mOutputs[i] = LeachResidue.get(dust, amount); + recipe.reloadOwner(); } } if (BW_Util.areStacksEqualOrNull(Rhodium.get(dust), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Rhodium.get(dustImpure), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Rhodium.get(dustPure), recipe.mOutputs[i])) { @@ -305,6 +312,7 @@ public class PlatinumSludgeOverHaul { continue recipeloop; int amount = recipe.mOutputs[i].stackSize * 2; recipe.mOutputs[i] = CrudeRhMetall.get(dust, amount); + recipe.reloadOwner(); } } if (!BW_Util.checkStackAndPrefix(recipe.mOutputs[i])) @@ -318,12 +326,15 @@ public class PlatinumSludgeOverHaul { if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dust), amount * 2); + recipe.reloadOwner(); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dustSmall), amount * 2); + recipe.reloadOwner(); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dustTiny), amount * 2); + recipe.reloadOwner(); } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Palladium)) { for (int j = 0; j < recipe.mInputs.length; j++) { @@ -333,12 +344,15 @@ public class PlatinumSludgeOverHaul { if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dust), amount * 4); + recipe.reloadOwner(); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dustSmall), amount * 4); + recipe.reloadOwner(); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dustTiny), amount * 4); + recipe.reloadOwner(); } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Osmium)) { for (int j = 0; j < recipe.mInputs.length; j++) { @@ -348,12 +362,15 @@ public class PlatinumSludgeOverHaul { if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dust), amount); + recipe.reloadOwner(); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dustSmall), amount); + recipe.reloadOwner(); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dustTiny), amount); + recipe.reloadOwner(); } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Iridium)) { for (int j = 0; j < recipe.mInputs.length; j++) { @@ -363,12 +380,15 @@ public class PlatinumSludgeOverHaul { if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dust), amount); + recipe.reloadOwner(); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dustSmall), amount); + recipe.reloadOwner(); } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dustTiny), amount); + recipe.reloadOwner(); } } } @@ -395,6 +415,7 @@ public class PlatinumSludgeOverHaul { ItemData ass = GT_OreDictUnificator.getAssociation(stack); if (BW_Util.checkStackAndPrefix(stack) && ass.mMaterial.mMaterial.equals(Materials.Platinum)) { recipe.mInputs[i] = GT_OreDictUnificator.get(ass.mPrefix,Materials.BlueAlloy,stack.stackSize); + recipe.reloadOwner(); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index c7f578fe41..4e3b6ffc4a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -22,6 +22,7 @@ package com.github.bartimaeusnek.bartworks.util; +import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -241,8 +242,17 @@ public class BWRecipes { public static class DynamicGTRecipe extends GT_Recipe { - public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue, GT_Recipe originalRecipe) { super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + if (originalRecipe != null) { + this.owners = new ArrayList<>(originalRecipe.owners); + this.stackTraces = new ArrayList<>(originalRecipe.stackTraces); + this.setOwner(MainMod.MOD_ID); + } + } + + public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + this(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue, null); } } -- cgit From 49b1f94a2e83571795482fc78a46c553ab218e77 Mon Sep 17 00:00:00 2001 From: minecraft7771 Date: Sun, 7 Aug 2022 23:25:46 +0200 Subject: Added coil and glass count to the tooltip (#177) Former-commit-id: c1d404eea9fb30e1e0adbf205a8da68b3a0a9a13 --- .../tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index ffc6844539..3bebfa21e1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -153,8 +153,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock .beginStructureBlock(15, 20, 15, true) .addController("3rd layer center") .addCasingInfo("Heat Proof Machine Casing", 0) - .addOtherStructurePart("Heating Coils", "Inner 13x18x13 (Hollow)") - .addOtherStructurePart("Borosilicate Glass", "Outer 15x18x15") + .addOtherStructurePart("864x Heating Coils", "Inner 13x18x13 (Hollow)") + .addOtherStructurePart("1007x Borosilicate Glass", "Outer 15x18x15") .addStructureInfo("The glass tier limits the Energy Input tier") .addEnergyHatch("Any bottom layer casing") .addMaintenanceHatch("Any bottom layer casing") -- cgit From 6b1ca058f85f7de08608a4605c27e1ccdc4c8eef Mon Sep 17 00:00:00 2001 From: miozune Date: Tue, 9 Aug 2022 06:29:38 +0900 Subject: Fix localization failure with driller (#178) * Fix localization failure with driller * Fix Former-commit-id: 476453a57b8b6a6be52709854e36d6b83092ac5d --- dependencies.gradle | 2 +- .../common/tileentities/multis/GT_TileEntity_DEHP.java | 7 ++++++- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 2 +- .../crossmod/galacticgreg/GT_TileEntity_VoidMiners.java | 15 +++++++++++++++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 7abb0e2f5d..cc9a6f5db4 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.78:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.88:dev") compile("com.github.GTNewHorizons:StructureLib:1.0.16:dev") compile("com.github.GTNewHorizons:TecTech:4.10.18:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.2.15-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index 3b67ee2a9e..010cc53cce 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -106,7 +106,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - String casings = getCasingBlockItem().get(0).getDisplayName(); + String casings = getCasingName() != null ? getCasingName() : "Casing"; tt.addMachineType("Geothermal Heat Pump") .addInfo("Consumes " + GT_Values.V[this.mTier + 2] + "EU/t") .addInfo("Has 4 Modes, use the Screwdriver to change them:"); @@ -141,6 +141,11 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { return ItemList.Casing_HeatProof; } + @Override + protected String getCasingName() { + return "Heat Proof Machine Casing"; + } + @Override protected Materials getFrameMaterial() { return Materials.Tungsten; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index 5d92af979d..adc7979bdd 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -171,7 +171,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { - String casings = getCasingBlockItem().get(0).getDisplayName(); + String casings = getCasingName() != null ? getCasingName() : "Casing"; final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Miner") diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java index a5058a34d7..fb87f050b8 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java @@ -44,6 +44,11 @@ public class GT_TileEntity_VoidMiners { return ItemList.Casing_UV; } + @Override + protected String getCasingName() { + return "UV Machine Casing"; + } + @Override protected Materials getFrameMaterial() { return Materials.Europium; @@ -75,6 +80,11 @@ public class GT_TileEntity_VoidMiners { return ItemList.Casing_MiningBlackPlutonium; } + @Override + protected String getCasingName() { + return "Mining Black Plutonium Casing"; + } + @Override protected Materials getFrameMaterial() { return Materials.BlackPlutonium; @@ -106,6 +116,11 @@ public class GT_TileEntity_VoidMiners { return ItemList.Casing_MiningNeutronium; } + @Override + protected String getCasingName() { + return "Mining Neutronium Casing"; + } + @Override protected Materials getFrameMaterial() { return Materials.Neutronium; -- cgit From 087a202e43c5a2bdefd877c6f70767c85fe325c2 Mon Sep 17 00:00:00 2001 From: Rukern Date: Fri, 12 Aug 2022 06:54:45 -0400 Subject: Show transformation recipe in NEI (#179) Co-authored-by: Alexandre Tardif Former-commit-id: 518ff768c3539531be39b6c6177649d4e8504da0 --- .../bartworks/common/loaders/BioCultureLoader.java | 6 ++-- .../processingLoaders/AdditionalRecipes.java | 41 ++++++++++++---------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java index fcdf63cbc0..1ece4fd6cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java @@ -51,12 +51,12 @@ public class BioCultureLoader { public static void run() { BioCultureLoader.CommonYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_YEAST), true); - BioCultureLoader.WhineYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var bayanus", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_WHINE_YEAST,EnumRarity.uncommon, true); - BioCultureLoader.BeerYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioCultureLoader.BIO_DNA_BEER_YEAST, EnumRarity.uncommon,true); + BioCultureLoader.WhineYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var bayanus", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_WHINE_YEAST), BioCultureLoader.BIO_DNA_WHINE_YEAST,EnumRarity.uncommon, true); + BioCultureLoader.BeerYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_BEER_YEAST), BioCultureLoader.BIO_DNA_BEER_YEAST, EnumRarity.uncommon,true); BioCultureLoader.rottenFleshBacteria = BioCulture.createAndRegisterBioCulture(new Color(110, 40, 25), "Escherichia cadaver", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_BETA_LACMATASE), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_BETA_LACMATASE), false); BioCultureLoader.eColi = BioCulture.createAndRegisterBioCulture(new Color(149, 132, 75), "Escherichia koli", BioPlasmid.convertDataToPlasmid(BioCultureLoader.eColiData), BioDNA.convertDataToDNA(BioCultureLoader.eColiData), true); BioCultureLoader.anaerobicOil = BioCulture.createAndRegisterBioCulture(new Color(0, 0, 0), "Pseudomonas Veronii", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_ANAEROBIC_OIL), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_ANAEROBIC_OIL), true); - BioCultureLoader.generalPurposeFermentingBacteria = BioCulture.createAndRegisterBioCulture(new Color(127, 69, 26), "Saccharomyces escherichia", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_BETA_LACMATASE), EnumRarity.epic,true); + BioCultureLoader.generalPurposeFermentingBacteria = BioCulture.createAndRegisterBioCulture(new Color(127, 69, 26), "Saccharomyces escherichia", BioCultureLoader.CommonYeast.getPlasmid(), BioCultureLoader.eColi.getdDNA(), EnumRarity.epic,true); BioCultureLoader.CommonYeast.setLocalisedName("Common Yeast"); BioCultureLoader.WhineYeast.setLocalisedName("Whine Yeast"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 1e39d5f39f..7ab619a92f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -157,27 +157,32 @@ public class AdditionalRecipes { } } - //Transformation- [Distilled Water] + Culture () + Plasmids (Gene) Cell + Penicillin Cell= Culture (Gene) + Empty Cells - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - BioItemList.getPetriDish(null).setStackDisplayName("The Culture to change"), - BioItemList.getPlasmidCell(null).setStackDisplayName("The Plasmids to Inject"), + for (ItemStack stack : BioItemList.getAllPetriDishes()) { + BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); + BioData Plasmid = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("Plasmid")); + if (DNA.getName() != Plasmid.getName()) { + sBiolab.addFakeRecipe(true, + new ItemStack[]{ + BioItemList.getPetriDish(BioCulture.getBioCulture(DNA.getName())), + BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(Plasmid)), FluidLoader.BioLabFluidCells[2], - }, - new ItemStack[]{ - BioItemList.getPetriDish(null).setStackDisplayName("The changed Culture"), + }, + new ItemStack[]{ + stack, ItemList.Cell_Universal_Fluid.get(1L) - }, - BioItemList.mBioLabParts[3], - new int[]{7500, 10000}, - new FluidStack[]{ + }, + BioItemList.mBioLabParts[3], + new int[]{10000, 10000}, + new FluidStack[]{ FluidRegistry.getFluidStack("ic2distilledwater", 1000) - }, - null, - 500, - BW_Util.getMachineVoltageFromTier(6), - BW_Util.STANDART - ); + }, + null, + 500, + BW_Util.getMachineVoltageFromTier(6), + BW_Util.STANDART + ); + } + } ItemStack Outp = ItemList.Tool_DataOrb.get(1L); -- cgit From 86889fa66c4771880a77f18aa488ac0ce1e1da8c Mon Sep 17 00:00:00 2001 From: miozune Date: Sun, 14 Aug 2022 02:05:13 +0900 Subject: Fix CAL recipe for NAND Chip Array not being generated (#181) Former-commit-id: 3452c9132898c7e5af6ace0a4b729730923b7dec --- .../system/material/CircuitGeneration/CircuitImprintLoader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index b5e87461d8..52977aa8c3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -117,7 +117,8 @@ public class CircuitImprintLoader { } private static boolean isCircuitOreDict(ItemStack item) { - return BW_Util.isTieredCircuit(item); + return BW_Util.isTieredCircuit(item) + || BW_Util.getOreNames(item).stream().anyMatch(s -> s.equals("circuitPrimitiveArray")); } private static void exchangeRecipesInList(HashSet toRem, HashSet toAdd) { -- cgit From 1e862762f1feb85b2eb60cac584847c0f754d37f Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Sat, 13 Aug 2022 20:13:15 +0100 Subject: allow indalloy circuits (#180) first try Former-commit-id: d287fee79e97b89abfb6cafc7c5cc92d2644a0a1 --- .../system/material/CircuitGeneration/CircuitImprintLoader.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 52977aa8c3..da7f880c98 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -42,6 +42,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; @@ -94,7 +96,7 @@ public class CircuitImprintLoader { CircuitImprintLoader.recipeTagMap.put(CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); - if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))) { + if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))||circuitRecipe.mFluidInputs[0].isFluidEqual(new FluidStack(FluidRegistry.getFluid("molten.indalloy140"), 0))) { GT_Recipe newRecipe = CircuitImprintLoader.reBuildRecipe(circuitRecipe); if (newRecipe != null) BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(newRecipe); -- cgit From a6d512a1f10b4c6f3507498c2e67646076ddf344 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Wed, 17 Aug 2022 10:23:50 +0200 Subject: Update dependencies.gradle Former-commit-id: e47b6ca31c6f051041958953b278096b7d288904 --- dependencies.gradle | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index cc9a6f5db4..d97464db19 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,10 +1,10 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.88:dev") - compile("com.github.GTNewHorizons:StructureLib:1.0.16:dev") - compile("com.github.GTNewHorizons:TecTech:4.10.18:dev") - compile("com.github.GTNewHorizons:NotEnoughItems:2.2.15-GTNH:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.100-pre:dev") + compile("com.github.GTNewHorizons:StructureLib:1.1.3:dev") + compile("com.github.GTNewHorizons:TecTech:5.0.19-pre:dev") + compile("com.github.GTNewHorizons:NotEnoughItems:2.2.20-GTNH:dev") compile("com.github.GTNewHorizons:TinkersConstruct:1.9.0.13-GTNH:dev") compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.3:dev") compile("com.github.GTNewHorizons:CodeChickenCore:1.1.3:dev") @@ -14,7 +14,7 @@ dependencies { } compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") - compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-86-GTNH:dev") { + compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-94-GTNH:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:AppleCore:3.1.9:dev") { -- cgit From 7597429b5f2bc30122c29028de0f95ea4fe47eaa Mon Sep 17 00:00:00 2001 From: miozune Date: Fri, 19 Aug 2022 21:10:07 +0900 Subject: Revert "Fix localization failure with driller (#178)" (#183) * Revert "Fix localization failure with driller (#178)" This reverts commit 6b1ca058f85f7de08608a4605c27e1ccdc4c8eef [formerly 476453a57b8b6a6be52709854e36d6b83092ac5d]. * Make descriptions in line with GT * Space * update GT * Fix build Co-authored-by: Martin Robertz Former-commit-id: be31b795e6394abf449922d57398e1fa25786407 --- dependencies.gradle | 6 +++--- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 3 ++- .../common/tileentities/multis/GT_TileEntity_DEHP.java | 11 +++-------- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 6 +++--- .../crossmod/galacticgreg/GT_TileEntity_VoidMiners.java | 15 --------------- 5 files changed, 11 insertions(+), 30 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index d97464db19..3fe6624709 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,10 +1,10 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.100-pre:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.00:dev") compile("com.github.GTNewHorizons:StructureLib:1.1.3:dev") - compile("com.github.GTNewHorizons:TecTech:5.0.19-pre:dev") - compile("com.github.GTNewHorizons:NotEnoughItems:2.2.20-GTNH:dev") + compile("com.github.GTNewHorizons:TecTech:5.0.22:dev") + compile("com.github.GTNewHorizons:NotEnoughItems:2.2.22:dev") compile("com.github.GTNewHorizons:TinkersConstruct:1.9.0.13-GTNH:dev") compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.3:dev") compile("com.github.GTNewHorizons:CodeChickenCore:1.1.3:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 0409cabb4a..db331896ca 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -276,7 +276,8 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance } } - private boolean addInputHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + @Override + public boolean addInputHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { return false; } else { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index 010cc53cce..80c19222a1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -106,7 +106,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - String casings = getCasingName() != null ? getCasingName() : "Casing"; + String casings = getCasingBlockItem().get(0).getDisplayName(); tt.addMachineType("Geothermal Heat Pump") .addInfo("Consumes " + GT_Values.V[this.mTier + 2] + "EU/t") .addInfo("Has 4 Modes, use the Screwdriver to change them:"); @@ -124,8 +124,8 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { tt.addSeparator() .beginStructureBlock(3, 7, 3, false) .addController("Front bottom") - .addStructureInfo(casings + " form the 3x1x3 Base") - .addOtherStructurePart(casings, " 1x3x1 pillar above the center of the base (2 minimum total)") + .addOtherStructurePart(casings, "form the 3x1x3 Base") + .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") .addEnergyHatch(VN[getMinTier()] + "+, Any base casing") .addMaintenanceHatch("Any base casing") @@ -141,11 +141,6 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { return ItemList.Casing_HeatProof; } - @Override - protected String getCasingName() { - return "Heat Proof Machine Casing"; - } - @Override protected Materials getFrameMaterial() { return Materials.Tungsten; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index adc7979bdd..ee1a5ee319 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -171,7 +171,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { - String casings = getCasingName() != null ? getCasingName() : "Casing"; + String casings = getCasingBlockItem().get(0).getDisplayName(); final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Miner") @@ -185,8 +185,8 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri .addSeparator() .beginStructureBlock(3, 7, 3, false) .addController("Front bottom") - .addStructureInfo(casings + " form the 3x1x3 Base") - .addOtherStructurePart(casings, " 1x3x1 pillar above the center of the base (2 minimum total)") + .addOtherStructurePart(casings, "form the 3x1x3 Base") + .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") .addEnergyHatch(VN[getMinTier()] + "+, Any base casing") .addMaintenanceHatch("Any base casing") diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java index fb87f050b8..a5058a34d7 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java @@ -44,11 +44,6 @@ public class GT_TileEntity_VoidMiners { return ItemList.Casing_UV; } - @Override - protected String getCasingName() { - return "UV Machine Casing"; - } - @Override protected Materials getFrameMaterial() { return Materials.Europium; @@ -80,11 +75,6 @@ public class GT_TileEntity_VoidMiners { return ItemList.Casing_MiningBlackPlutonium; } - @Override - protected String getCasingName() { - return "Mining Black Plutonium Casing"; - } - @Override protected Materials getFrameMaterial() { return Materials.BlackPlutonium; @@ -116,11 +106,6 @@ public class GT_TileEntity_VoidMiners { return ItemList.Casing_MiningNeutronium; } - @Override - protected String getCasingName() { - return "Mining Neutronium Casing"; - } - @Override protected Materials getFrameMaterial() { return Materials.Neutronium; -- cgit From 27528655ee23e1ac615af90d60babb62d49f794d Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Fri, 19 Aug 2022 20:24:45 +0800 Subject: partial autoplace integration (#182) * partial autoplace integration * fix crashes if gt++ not present * fix drawText now being an instance method Co-authored-by: Martin Robertz Former-commit-id: 838a1fb2da6699820c939af733732a6276f26c50 --- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 43 +++-- .../multis/GT_TileEntity_Windmill.java | 11 +- .../mega/GT_TileEntity_MegaBlastFurnace.java | 38 ++++- .../mega/GT_TileEntity_MegaChemicalReactor.java | 29 +++- .../mega/GT_TileEntity_MegaDistillTower.java | 185 ++++++++++++--------- .../mega/GT_TileEntity_MegaMultiBlockBase.java | 76 +++++++++ .../multis/mega/GT_TileEntity_MegaOilCracker.java | 30 ++-- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 53 +++--- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 29 ++-- .../CircuitGeneration/CircuitImprintLoader.java | 7 +- .../bartimaeusnek/bartworks/util/BW_Util.java | 19 ++- .../crossmod/tectech/helper/CoilAdder.java | 70 -------- .../tectech/helper/StructureDefinitions.java | 52 ------ 13 files changed, 361 insertions(+), 281 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/CoilAdder.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/StructureDefinitions.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index db331896ca..a84ff69ad7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -27,6 +27,8 @@ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.Circ import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; +import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.GregTech_API; @@ -43,6 +45,7 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; @@ -54,10 +57,12 @@ import java.util.HashSet; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTieredMixed; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_EnhancedMultiBlockBase { +public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable { private static final int CASING_INDEX = 16; @@ -75,21 +80,17 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance {"g", "l", "g"}, {"b", "I", "b"}, })) - .addElement('G', ofChain( - ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addEnergyInputToMachineList, CASING_INDEX, 1), //grate machine casings - ofBlock(GregTech_API.sBlockCasings3, 10))) + .addElement('G', buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) + .atLeast(Energy).casingIndex(CASING_INDEX).dot(1).buildAndChain(GregTech_API.sBlockCasings3, 10)) .addElement('g', ofGlassTieredMixed((byte)4, (byte)127, 5)) .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 5)) //assembling line casings - .addElement('b', ofChain( - ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addMaintenanceToMachineList, CASING_INDEX, 2), - ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addInputHatchToMachineList, CASING_INDEX, 2), - ofBlock(GregTech_API.sBlockCasings2, 0) - )) - .addElement('i', ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addInputToMachineList, CASING_INDEX, 3)) - .addElement('I', ofChain( - ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addInputToMachineList, CASING_INDEX, 4), - ofHatchAdder(GT_TileEntity_CircuitAssemblyLine::addOutputToMachineList, CASING_INDEX, 4) - )) + .addElement('b', buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) + .atLeast(InputHatch, Maintenance).casingIndex(CASING_INDEX).dot(2).buildAndChain(GregTech_API.sBlockCasings2, 0) + ) + .addElement('i', InputBus.newAny(CASING_INDEX, 3)) + .addElement('I', buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) + .atLeast(InputHatch, InputBus, OutputBus).casingIndex(CASING_INDEX).dot(2).buildAndChain(GregTech_API.sBlockCasings2, 0) + ) .build(); @Override @@ -377,6 +378,20 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance for(int i = 1; i < tLength; ++i) { this.buildPiece(STRUCTURE_PIECE_NEXT, stackSize, hintsOnly, -i, 0, 0); } + } + @Override + public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { + if (mMachine) return -1; + int built; + built = survivialBuildPiece(STRUCTURE_PIECE_FIRST, stackSize, 0, 0, 0, elementBudget, source, actor, false, true); + if (built >= 0) return built; + int tLength = Math.min(stackSize.stackSize + 1, 7); + + for (int i = 1; i < tLength; ++i) { + built = survivialBuildPiece(STRUCTURE_PIECE_NEXT, stackSize, -i, 0, 0, elementBudget, source, actor, false, true); + if (built >= 0) return built; + } + return -1; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 67dfc7de26..8df3503dd0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -29,6 +29,8 @@ import com.github.bartimaeusnek.bartworks.server.container.BW_Container_Windmill import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; +import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.FMLCommonHandler; @@ -51,6 +53,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -69,7 +72,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.enums.GT_Values.V; -public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlockBase { +public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable { private static final IIcon[] iIcons = new IIcon[2]; private static final IIconContainer[] iIconContainers = new IIconContainer[2]; @@ -661,4 +664,10 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock public void construct(ItemStack itemStack, boolean b) { buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 3, 11, 0); } + + @Override + public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { + if (mMachine) return -1; + return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 3, 11, 0, elementBudget, source, actor, false, true); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 3bebfa21e1..ccc4fddfb5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -25,11 +25,12 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; +import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; @@ -46,6 +47,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -60,22 +62,35 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTI import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_HatchElement.Maintenance; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.*; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlockBase { +public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { private static final int CASING_INDEX = 11; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() .addShape("main", createShape()) - .addElement('t', ofHatchAdderOptional(GT_TileEntity_MegaBlastFurnace::addOutputHatchToTopList, CASING_INDEX, 1, GregTech_API.sBlockCasings1, CASING_INDEX)) - .addElement('m', ofHatchAdder(GT_TileEntity_MegaBlastFurnace::addMufflerToMachineList, CASING_INDEX, 2)) + .addElement('=', StructureElementAirNoHint.getInstance()) + .addElement('t', + buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) + .atLeast(OutputHatch.withAdder(GT_TileEntity_MegaBlastFurnace::addOutputHatchToTopList).withCount(t -> t.mPollutionOutputHatches.size())) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX) + ) + .addElement('m', Muffler.newAny(CASING_INDEX, 2)) .addElement('C', ofCoil(GT_TileEntity_MegaBlastFurnace::setCoilLevel, GT_TileEntity_MegaBlastFurnace::getCoilLevel)) .addElement('g', BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) - .addElement('b', ofHatchAdderOptional(GT_TileEntity_MegaBlastFurnace::addBottomHatch, CASING_INDEX, 3, GregTech_API.sBlockCasings1, CASING_INDEX)) + .addElement('b', buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) + .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, TTEnabledEnergyHatchElement.INSTANCE) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX) + ) .build(); private static String[][] createShape() { @@ -93,7 +108,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock raw[1] = new String[15]; String allGlass = "ggggggggggggggg"; String allCoil = "gCCCCCCCCCCCCCg"; - String middleLine = "gC-----------Cg"; + String middleLine = "gC===========Cg"; raw[1][0] = allGlass; raw[1][1] = allCoil; raw[1][13] = allCoil; @@ -380,6 +395,15 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock buildPiece("main", stackSize, hintsOnly, 7, 17, 0); } + @Override + public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { + if (mMachine) return -1; + int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); + glasTier = 0; + setCoilLevel(HeatingCoilLevel.None); + return survivialBuildPiece("main", stackSize, 7, 17, 0, realBudget, source, actor, false, true); + } + public void setCoilLevel(HeatingCoilLevel aCoilLevel) { mCoilLevel = aCoilLevel; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index dcb1c3fc9d..ba8a34ae72 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -28,6 +28,8 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; +import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; +import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; @@ -42,6 +44,7 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -55,13 +58,15 @@ import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.ha import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBlockBase { +public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { private byte glasTier; @@ -187,7 +192,13 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl buildPiece(STRUCTURE_PIECE_MAIN,aStack,aHintsOnly,2,2,0); } - // -------------- TEC TECH COMPAT ---------------- + @Override + public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { + if (mMachine) return -1; + int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); + return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 2, 2, 0, realBudget, source, actor, false, true); + } +// -------------- TEC TECH COMPAT ---------------- @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { @@ -230,13 +241,17 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl })) .addElement('p', ofBlock(GregTech_API.sBlockCasings8, 1)) .addElement('t', ofBlock(GregTech_API.sBlockCasings8, 0)) - .addElement('d', ofChain( - ofHatchAdder(GT_TileEntity_MegaChemicalReactor::addInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_MegaChemicalReactor::addOutputToMachineList, CASING_INDEX, 1), + .addElement('d', buildHatchAdder(GT_TileEntity_MegaChemicalReactor.class) + .atLeast(InputBus, InputHatch, OutputBus, OutputHatch) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings8, 0) + ) + .addElement('r', Maintenance.newAny(CASING_INDEX, 2)) + .addElement('e', ofChain( + TTEnabledEnergyHatchElement.INSTANCE.newAny(CASING_INDEX, 3), ofBlock(GregTech_API.sBlockCasings8, 0) )) - .addElement('r', ofHatchAdder(GT_TileEntity_MegaChemicalReactor::addMaintenanceToMachineList, CASING_INDEX, 2)) - .addElement('e', ofHatchAdderOptional(GT_TileEntity_MegaChemicalReactor::addEnergyInputToMachineList, CASING_INDEX, 3, GregTech_API.sBlockCasings8, 0)) .addElement('c', ofBlock(GregTech_API.sBlockCasings4, 7)) .addElement('g', BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) .build(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 4ad99f1626..2415f4c9b4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -26,15 +26,14 @@ import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.*; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; -import com.gtnewhorizon.structurelib.StructureLibAPI; -import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.IStructureElement; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; +import com.gtnewhorizon.structurelib.structure.*; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -43,10 +42,10 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; @@ -56,94 +55,90 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTI import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlockBase { +public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { protected static final int CASING_INDEX = 49; protected static final String STRUCTURE_PIECE_BASE = "base"; protected static final String STRUCTURE_PIECE_LAYER = "layer"; - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() + protected static final String STRUCTURE_PIECE_TOP_HINT = "top"; + private static final IStructureDefinition STRUCTURE_DEFINITION; + + static { + IHatchElement layeredOutputHatch = OutputHatch + .withCount(GT_TileEntity_MegaDistillTower::getCurrentLayerOutputHatchCount) + .withAdder(GT_TileEntity_MegaDistillTower::addLayerOutputHatch); + STRUCTURE_DEFINITION = StructureDefinition.builder() .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][]{ - {"bbbbbbb~bbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb"}, + {"bbbbbbb~bbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb"}, })) .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][]{ - {"lllllllllllllll", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lllllllllllllll"}, - {"lllllllllllllll", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "lllllllllllllll"}, - {"lllllllllllllll", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "lllllllllllllll"}, - {"lllllllllllllll", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "lllllllllllllll"}, - {"lllllllllllllll", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "l-------------l", "lllllllllllllll"}, + {"lllllllllllllll", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lllllllllllllll"}, + {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, + {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, + {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, + {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, })) - .addElement('b', ofChain( - ofHatchAdder(GT_TileEntity_MegaDistillTower::addEnergyInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_MegaDistillTower::addOutputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_MegaDistillTower::addInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_MegaDistillTower::addMaintenanceToMachineList, CASING_INDEX, 1), - onElementPass(GT_TileEntity_MegaDistillTower::onCasingFound, ofBlock(GregTech_API.sBlockCasings4, 1)) - )) - .addElement('l', ofChain( - ofHatchAdder(GT_TileEntity_MegaDistillTower::addEnergyInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_MegaDistillTower::addLayerOutputHatch, CASING_INDEX, 2), - ofHatchAdder(GT_TileEntity_MegaDistillTower::addMaintenanceToMachineList, CASING_INDEX, 1), - onElementPass(GT_TileEntity_MegaDistillTower::onCasingFound, ofBlock(GregTech_API.sBlockCasings4, 1)) - )) - // this one is too complex and cannot be expressed with a combination of existing IStructureElement - .addElement('c', new IStructureElement() { - @Override - public boolean check(GT_TileEntity_MegaDistillTower t, World world, int x, int y, int z) { - if (world.isAirBlock(x, y, z)) { - if (t.mTopState < 1) { - t.mTopState = 0; - return true; - } - // definitely top - cannot be air - return false; - } - // from here on we must be looking at a top layer, since it's not air - if (t.mTopState == 0) - // must be air but failed, so no - return false; - t.mTopState = 1; - // hatch adder - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity instanceof IGregTechTileEntity) { - IGregTechTileEntity entity = (IGregTechTileEntity) tileEntity; - if (t.addLayerOutputHatch(entity, CASING_INDEX)) { - t.onTopLayerFound(false); - return true; - } - } - // block adder - if(world.getBlock(x, y, z) == GregTech_API.sBlockCasings4 && world.getBlockMetadata(x, y, z) == 1) { - t.onTopLayerFound(true); - return true; - } else { - return false; - } - } - - @Override - public boolean spawnHint(GT_TileEntity_MegaDistillTower t, World world, int x, int y, int z, ItemStack trigger) { - if (trigger.stackSize == 1) - StructureLibAPI.hintParticle(world, x, y, z, GregTech_API.sBlockCasings4, 1); - return true; - } - - @Override - public boolean placeBlock(GT_TileEntity_MegaDistillTower t, World world, int x, int y, int z, ItemStack trigger) { - if (trigger.stackSize == 1) { - world.setBlock(x, y, z, GregTech_API.sBlockCasings4, 1, 3); - return true; - } - world.setBlockToAir(x, y, z); - return false; - } - } - ) + .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][]{ + {"lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll"}, + {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, + {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, + {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, + {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, + })) + .addElement('=', StructureElementAirNoHint.getInstance()) + .addElement('b', buildHatchAdder(GT_TileEntity_MegaDistillTower.class) + .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, TTEnabledEnergyHatchElement.INSTANCE) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(onElementPass(GT_TileEntity_MegaDistillTower::onCasingFound, ofBlock(GregTech_API.sBlockCasings4, 1))) + ) + .addElement('l', buildHatchAdder(GT_TileEntity_MegaDistillTower.class) + .atLeast(layeredOutputHatch, Maintenance, TTEnabledEnergyHatchElement.INSTANCE) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(onElementPass(GT_TileEntity_MegaDistillTower::onCasingFound, ofBlock(GregTech_API.sBlockCasings4, 1))) + ) + .addElement('c', (IStructureElementCheckOnly) (t, world, x, y, z) -> { + if (world.isAirBlock(x, y, z)) { + if (t.mTopState < 1) { + t.mTopState = 0; + return true; + } + // definitely top - cannot be air + return false; + } + // from here on we must be looking at a top layer, since it's not air + if (t.mTopState == 0) + // must be air but failed, so no + return false; + t.mTopState = 1; + // hatch adder + TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity instanceof IGregTechTileEntity) { + IGregTechTileEntity entity = (IGregTechTileEntity) tileEntity; + if (t.addLayerOutputHatch(entity, CASING_INDEX)) { + t.onTopLayerFound(false); + return true; + } + } + // block adder + if (world.getBlock(x, y, z) == GregTech_API.sBlockCasings4 && world.getBlockMetadata(x, y, z) == 1) { + t.onTopLayerFound(true); + return true; + } else { + return false; + } + }) .build(); + } + protected final List> mOutputHatchesByLayer = new ArrayList<>(); protected int mHeight; protected int mCasing; @@ -169,6 +164,10 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock mCasing++; } + protected int getCurrentLayerOutputHatchCount() { + return mOutputHatchesByLayer.size() < mHeight ? 0 : mOutputHatchesByLayer.get(mHeight - 1).size(); + } + protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null || aTileEntity.isDead() || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) return false; @@ -228,7 +227,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock .addOutputBus("Any bottom layer casing") .addOutputHatch("2-11x Output Hatches (One per Output Layer except bottom layer)") .addStructureInfo("An \"Output Layer\" consists of 5 layers!") - .addStructureHint("This Mega Multiblock is too big to have its structure hologram displayed fully.") + .addStructureHint("The interior of this Mega Multiblock's hologram is empty, it should be all air.") .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); return tt; } @@ -256,7 +255,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock // check each layer while (mHeight < 12 && checkPiece(STRUCTURE_PIECE_LAYER, 7, mHeight * 5, 0) && !mTopLayerFound) { - if (mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) + if (mOutputHatchesByLayer.size() < mHeight || mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) // layer without output hatch return false; mTopState = -1; @@ -270,7 +269,29 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - // no op, to big to be displayed + buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 1, 0, 0); + int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height + for (int i = 1; i < tTotalHeight - 1; i++) { + buildPiece(STRUCTURE_PIECE_LAYER, stackSize, hintsOnly, 1, i, 0); + } + buildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, hintsOnly, 1, tTotalHeight - 1, 0); + } + + @Override + public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { + if (mMachine) return -1; + int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); + mHeight = 0; + int built = survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 1, 0, 0, realBudget, source, actor, false, true); + if (built >= 0) return built; + int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height + for (int i = 1; i < tTotalHeight - 1; i++) { + mHeight = i; + built = survivialBuildPiece(STRUCTURE_PIECE_LAYER, stackSize, 1, i, 0, realBudget, source, actor, false, true); + if (built >= 0) return built; + } + mHeight = tTotalHeight; + return survivialBuildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, 1, tTotalHeight - 1, 0, realBudget, source, actor, false, true); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java index 1c2cf770e8..4dd55c15f6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java @@ -7,20 +7,33 @@ import com.github.bartimaeusnek.bartworks.util.MegaUtils; import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.LowPowerLaser; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import com.google.common.collect.ImmutableList; +import com.gtnewhorizon.structurelib.StructureLibAPI; +import com.gtnewhorizon.structurelib.structure.IItemSource; +import com.gtnewhorizon.structurelib.structure.IStructureElement; import cpw.mods.fml.common.Optional; +import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.*; import gregtech.api.util.GT_Utility; +import gregtech.api.util.IGT_HatchAdder; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; import net.minecraft.util.StatCollector; +import net.minecraft.world.World; import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.function.Consumer; +import static gregtech.api.enums.GT_HatchElement.Energy; import static gregtech.api.enums.GT_Values.V; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) @@ -293,4 +306,67 @@ public abstract class GT_TileEntity_MegaMultiBlockBase> { + INSTANCE; + + private static final List> mteClasses; + + static { + ImmutableList.Builder> builder = ImmutableList.>builder() + .addAll(Energy.mteClasses()); + if (LoaderReference.tectech) + builder.add(GT_MetaTileEntity_Hatch_EnergyMulti.class); + mteClasses = builder.build(); + } + + @Override + public List> mteClasses() { + return mteClasses; + } + + @Override + public IGT_HatchAdder> adder() { + return GT_TileEntity_MegaMultiBlockBase::addEnergyInputToMachineList; + } + + @Override + public long count(GT_TileEntity_MegaMultiBlockBase t) { + return t.mEnergyHatches.size() + t.TTTunnels.size() + t.TTMultiAmp.size(); + } + } + + protected static class StructureElementAirNoHint implements IStructureElement { + private static final StructureElementAirNoHint INSTANCE = new StructureElementAirNoHint<>(); + @SuppressWarnings("unchecked") + public static IStructureElement getInstance() { + return (IStructureElement) INSTANCE; + } + private StructureElementAirNoHint() {} + @Override + public boolean check(T o, World world, int x, int y, int z) { + return world.isAirBlock(x, y, z); + } + + @Override + public boolean spawnHint(T o, World world, int x, int y, int z, ItemStack trigger) { + if (world.blockExists(x, y, z) && ! world.isAirBlock(x, y, z)) + // hint if this is obstructed. in case *someone* ever finish the transparent rendering + StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), StructureLibAPI.HINT_BLOCK_META_AIR); + return true; + } + + @Override + public boolean placeBlock(T o, World world, int x, int y, int z, ItemStack trigger) { + world.setBlockToAir(x, y, z); + return true; + } + + @Override + public PlaceResult survivalPlaceBlock(T o, World world, int x, int y, int z, ItemStack trigger, IItemSource s, EntityPlayerMP actor, Consumer chatter) { + if (check(o, world, x, y, z)) return PlaceResult.SKIP; + if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, actor)) return PlaceResult.REJECT; + world.setBlock(x, y, z, Blocks.air, 0, 2); + return PlaceResult.ACCEPT; + } + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index 9b75d55332..f0885a48f6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -28,6 +28,8 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; +import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; +import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; @@ -45,6 +47,7 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -57,12 +60,14 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTI import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_HatchElement.InputHatch; +import static gregtech.api.enums.GT_HatchElement.Maintenance; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.*; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBase { +public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { private static final int CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() @@ -78,20 +83,19 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa })) .addElement('c', ofCoil(GT_TileEntity_MegaOilCracker::setCoilLevel, GT_TileEntity_MegaOilCracker::getCoilLevel)) .addElement('p', ofBlock(GregTech_API.sBlockCasings4, 1)) - .addElement('l', ofChain( + .addElement('l', ofChain( // TODO figure out what to do with this ofHatchAdder(GT_TileEntity_MegaOilCracker::addLeftHatchToMachineList, CASING_INDEX, 2) )) .addElement('r', ofChain( ofHatchAdder(GT_TileEntity_MegaOilCracker::addRightHatchToMachineList, CASING_INDEX, 3) )) - .addElement('m', ofChain( - ofHatchAdder(GT_TileEntity_MegaOilCracker::addEnergyInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_MegaOilCracker::addMaintenanceToMachineList, CASING_INDEX, 1), - ofBlock(GregTech_API.sBlockCasings4, 1) - )) - .addElement('M', ofChain( - ofHatchAdder(GT_TileEntity_MegaOilCracker::addMiddleInputToMachineList, CASING_INDEX, 4) - )) + .addElement('m', buildHatchAdder(GT_TileEntity_MegaOilCracker.class) + .atLeast(TTEnabledEnergyHatchElement.INSTANCE, Maintenance) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings4, 1) + ) + .addElement('M', InputHatch.withAdder(GT_TileEntity_MegaOilCracker::addMiddleInputToMachineList).newAny(CASING_INDEX, 4)) .addElement('g', BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) .build(); private byte glasTier; @@ -242,6 +246,12 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa buildPiece(STRUCTURE_PIECE_MAIN,aStack,aHintsOnly,6,6,0); } + @Override + public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { + if (mMachine) return -1; + int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); + return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 6, 6, 0, realBudget, source, actor, false, true); + } // -------------- TEC TECH COMPAT ---------------- @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 2353fc2a4f..451d698234 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -27,6 +27,8 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; +import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; +import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; @@ -39,6 +41,7 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -49,12 +52,13 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTI import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.*; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBlockBase { +public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { public GT_TileEntity_MegaVacuumFreezer(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -76,28 +80,28 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ {"ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc"}, - {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, - {"ccccccc~ccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "c-------------c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, + {"ccccccc~ccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, + {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, {"ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc"} })) - .addElement('c', ofChain( - ofHatchAdder(GT_TileEntity_MegaVacuumFreezer::addEnergyInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_MegaVacuumFreezer::addMaintenanceToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_MegaVacuumFreezer::addOutputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_MegaVacuumFreezer::addInputToMachineList, CASING_INDEX, 1), - onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings2, 1)) - )) + .addElement('=', StructureElementAirNoHint.getInstance()) + .addElement('c', buildHatchAdder(GT_TileEntity_MegaVacuumFreezer.class) + .atLeast(TTEnabledEnergyHatchElement.INSTANCE, InputHatch, InputBus, OutputHatch, OutputBus, Maintenance) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings2, 1))) + ) .build(); @@ -131,6 +135,13 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc buildPiece(STRUCTURE_PIECE_MAIN, aStack, aHintsOnly, 7, 7, 0); } + @Override + public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { + if (mMachine) return -1; + int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); + return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 7, 7, 0, realBudget, source, actor, false, true); + } + @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sVacuumRecipes; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index 7890af3d54..7c1cffa640 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -34,6 +34,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.nei.GT_NEI_DefaultHandler; +import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; @@ -65,44 +66,44 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { int tSpecial; if (recipeDesc == null) { if (tEUt != 0) { - GT_NEI_DefaultHandler.drawText(10, lines[0], this.trans("152", "Total: ") + GT_Utility.formatNumbers((long) tDuration * (long) tEUt) + " EU", -16777216); - GT_NEI_DefaultHandler.drawText(10, lines[1], this.trans("153", "Usage: ") + GT_Utility.formatNumbers(tEUt) + " EU/t", -16777216); + drawText(10, lines[0], this.trans("152", "Total: ") + GT_Utility.formatNumbers((long) tDuration * (long) tEUt) + " EU", -16777216); + drawText(10, lines[1], this.trans("153", "Usage: ") + GT_Utility.formatNumbers(tEUt) + " EU/t", -16777216); if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - GT_NEI_DefaultHandler.drawText(10, lines[2], this.trans("154", "Voltage: ") + GT_Utility.formatNumbers(tEUt / this.mRecipeMap.mAmperage) + " EU", -16777216); - GT_NEI_DefaultHandler.drawText(10, lines[3], this.trans("155", "Amperage: ") + GT_Utility.formatNumbers(this.mRecipeMap.mAmperage), -16777216); + drawText(10, lines[2], this.trans("154", "Voltage: ") + GT_Utility.formatNumbers(tEUt / this.mRecipeMap.mAmperage) + " EU", -16777216); + drawText(10, lines[3], this.trans("155", "Amperage: ") + GT_Utility.formatNumbers(this.mRecipeMap.mAmperage), -16777216); } else { - GT_NEI_DefaultHandler.drawText(10, lines[2], this.trans("156", "Voltage: unspecified"), -16777216); - GT_NEI_DefaultHandler.drawText(10, lines[3], this.trans("157", "Amperage: unspecified"), -16777216); + drawText(10, lines[2], this.trans("156", "Voltage: unspecified"), -16777216); + drawText(10, lines[3], this.trans("157", "Amperage: unspecified"), -16777216); } } if (tDuration > 0) { - GT_NEI_DefaultHandler.drawText(10, lines[4], this.trans("158", "Time: ") + GT_Utility.formatNumbers(0.05d * tDuration) + this.trans("161", " secs"), -16777216); + drawText(10, lines[4], this.trans("158", "Time: ") + GT_Utility.formatNumbers(0.05d * tDuration) + this.trans("161", " secs"), -16777216); } tSpecial = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; int[] tSpecialA = GT_TileEntity_BioVat.specialValueUnpack(tSpecial); - GT_NEI_DefaultHandler.drawText(10, lines[5], StatCollector.translateToLocal("nei.biovat.0.name") + " " + tSpecialA[0], -16777216); + drawText(10, lines[5], StatCollector.translateToLocal("nei.biovat.0.name") + " " + tSpecialA[0], -16777216); if (tSpecialA[1] == -100 && GT_Mod.gregtechproxy.mLowGravProcessing) { - GT_NEI_DefaultHandler.drawText(10, lines[7], this.trans("159", "Needs Low Gravity"), -16777216); + drawText(10, lines[7], this.trans("159", "Needs Low Gravity"), -16777216); } else if (tSpecialA[1] == -200 && GT_Mod.gregtechproxy.mEnableCleanroom) { - GT_NEI_DefaultHandler.drawText(10, lines[7], this.trans("160", "Needs Cleanroom"), -16777216); + drawText(10, lines[7], this.trans("160", "Needs Cleanroom"), -16777216); } else if (tSpecialA[1] == -300 && GT_Mod.gregtechproxy.mEnableCleanroom) { - GT_NEI_DefaultHandler.drawText(10, lines[7], this.trans("160", "Needs Cleanroom & LowGrav"), -16777216); + drawText(10, lines[7], this.trans("160", "Needs Cleanroom & LowGrav"), -16777216); } else if (tSpecialA[1] == -400) { - GT_NEI_DefaultHandler.drawText(10, lines[7], this.trans("216", "Deprecated Recipe"), -16777216); + drawText(10, lines[7], this.trans("216", "Deprecated Recipe"), -16777216); } else if (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre) || GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost)) { - GT_NEI_DefaultHandler.drawText(10, lines[6], (tSpecialA[2] == 1 ? StatCollector.translateToLocal("nei.biovat.1.name") : StatCollector.translateToLocal("nei.biovat.2.name")) + this.mRecipeMap.mNEISpecialValuePre + GT_Utility.formatNumbers(tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); + drawText(10, lines[6], (tSpecialA[2] == 1 ? StatCollector.translateToLocal("nei.biovat.1.name") : StatCollector.translateToLocal("nei.biovat.2.name")) + this.mRecipeMap.mNEISpecialValuePre + GT_Utility.formatNumbers(tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); } } else { tSpecial = 0; for (String descLine : recipeDesc) { - GT_NEI_DefaultHandler.drawText(10, 73 + 10 * tSpecial, descLine, -16777216); + drawText(10, 73 + 10 * tSpecial, descLine, -16777216); ++tSpecial; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index da7f880c98..f3fc7ea816 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -42,6 +42,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; @@ -96,11 +97,13 @@ public class CircuitImprintLoader { CircuitImprintLoader.recipeTagMap.put(CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); - if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))||circuitRecipe.mFluidInputs[0].isFluidEqual(new FluidStack(FluidRegistry.getFluid("molten.indalloy140"), 0))) { + Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null ? FluidRegistry.getFluid("molten.indalloy140") : FluidRegistry.getFluid("molten.solderingalloy"); + + if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))||circuitRecipe.mFluidInputs[0].isFluidEqual(new FluidStack(solderIndalloy, 0))) { GT_Recipe newRecipe = CircuitImprintLoader.reBuildRecipe(circuitRecipe); if (newRecipe != null) BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(newRecipe); - addCutoffRecipeToSets(toRem,toAdd,circuitRecipe); + addCutoffRecipeToSets(toRem,toAdd,circuitRecipe); } else { if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) toRem.add(circuitRecipe); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 2395109d8b..aa66db2fc1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -26,8 +26,10 @@ import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.MainMod; import com.gtnewhorizon.structurelib.StructureLibAPI; +import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.IStructureElementNoPlacement; +import com.gtnewhorizon.structurelib.structure.StructureUtility; import gregtech.api.enums.Materials; import gregtech.api.enums.OreDictNames; import gregtech.api.enums.ToolDictNames; @@ -42,6 +44,7 @@ import gregtech.api.util.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.EnumRarity; @@ -49,6 +52,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.IChatComponent; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -62,9 +66,11 @@ import java.lang.reflect.Array; import java.lang.reflect.Field; import java.util.*; import java.util.function.BiConsumer; +import java.util.function.Consumer; import java.util.function.Function; import java.util.stream.Collectors; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static gregtech.api.enums.GT_Values.*; @SuppressWarnings({"unused","RedundantSuppression"}) @@ -679,7 +685,8 @@ public class BW_Util { } public static IStructureElement ofGlassTiered(byte mintier, byte maxtier, byte notset, BiConsumer setter, Function getter, int aDots){ - return new IStructureElementNoPlacement(){ + return new IStructureElement() { + private final IStructureElement placementDelegate = BorosilicateGlass.ofBoroGlass(notset, mintier, maxtier, setter, getter); @Override public boolean check(T te, World world, int x, int y, int z) { if(world.isAirBlock(x, y, z)) @@ -703,6 +710,16 @@ public class BW_Util { StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), aDots - 1); return true; } + + @Override + public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { + return placementDelegate.placeBlock(t, world, x, y, z, trigger); + } + + @Override + public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, IItemSource s, EntityPlayerMP actor, Consumer chatter) { + return placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, s, actor, chatter); + } }; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/CoilAdder.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/CoilAdder.java deleted file mode 100644 index 8e3dab2566..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/CoilAdder.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.tectech.helper; - -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.mechanics.structure.IStructureElement; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import gregtech.api.GregTech_API; -import gregtech.api.enums.HeatingCoilLevel; -import gregtech.api.interfaces.IHeatingCoil; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public class CoilAdder implements IStructureElement { - - private CoilAdder(){} - - @SuppressWarnings("rawtypes") - private static final CoilAdder INSTANCE = new CoilAdder(); - - @SuppressWarnings("unchecked") - public static CoilAdder getINSTANCE() { - return INSTANCE; - } - - @Override - public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { - Block coil = world.getBlock(x, y, z); - if (!(coil instanceof IHeatingCoil)) - return false; - int meta = world.getBlockMetadata(x, y, z); - HeatingCoilLevel heat = ((IHeatingCoil) coil).getCoilHeat(meta); - if (multiBlock.getCoilHeat() == HeatingCoilLevel.None) - multiBlock.setCoilHeat(heat); - return multiBlock.getCoilHeat() == heat; - } - - @Override - public boolean placeBlock(MultiBlock MultiBlock, World world, int x, int y, int z, ItemStack trigger) { - world.setBlock(x, y, z, GregTech_API.sBlockCasings5, 0, 2); - return true; - } - - @Override - public boolean spawnHint(MultiBlock MultiBlock, World world, int x, int y, int z, ItemStack trigger) { - TecTech.proxy.hint_particle(world, x, y, z, GregTech_API.sBlockCasings5, 0); - return true; - } -} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/StructureDefinitions.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/StructureDefinitions.java deleted file mode 100644 index 7e1b225a2a..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/StructureDefinitions.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.tectech.helper; - -import static com.github.technus.tectech.mechanics.structure.StructureUtility.transpose; - -public enum StructureDefinitions { - CUBE_NO_MUFFLER(transpose( - new String[][]{ - {"VVV", "VVV", "VVV"}, - {"V~V", "V-V", "VVV"}, - {"VVV", "VVV", "VVV"} - })) - , - CUBE_MUFFLER(transpose( - new String[][]{ - {"VVV", "VMV", "VVV"}, - {"V~V", "V-V", "VVV"}, - {"VVV", "VVV", "VVV"} - })) - ; - - private final String[][] definition; - - public String[][] getDefinition() { - return definition; - } - - StructureDefinitions(String[][] definition) { - this.definition = definition; - } -} -- cgit From f1cb0dd220e866ed0c68b7cbd68a58d5fca20072 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Tue, 23 Aug 2022 14:17:00 +0800 Subject: use correct texture for fluids (#186) Former-commit-id: bb6b507e785114d067ac39b5d18f1068470b2aa8 --- dependencies.gradle | 2 +- .../github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 3fe6624709..37468769cb 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.00:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.08:dev") compile("com.github.GTNewHorizons:StructureLib:1.1.3:dev") compile("com.github.GTNewHorizons:TecTech:5.0.22:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.2.22:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index b5c3e17a87..28cf7492c0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1686,7 +1686,7 @@ public class WerkstoffLoader { if (werkstoff.hasItemType(cell)) { if (!FluidRegistry.isFluidRegistered(werkstoff.getDefaultName())) { DebugLog.log("Adding new Fluid: " + werkstoff.getDefaultName()); - GT_Fluid fluid = (GT_Fluid) new GT_Fluid(werkstoff.getDefaultName(), "molten.autogenerated", werkstoff.getRGBA()).setGaseous(werkstoff.getStats().isGas()); + GT_Fluid fluid = (GT_Fluid) new GT_Fluid(werkstoff.getDefaultName(), "autogenerated", werkstoff.getRGBA()).setGaseous(werkstoff.getStats().isGas()); FluidRegistry.registerFluid(fluid); WerkstoffLoader.fluids.put(werkstoff, fluid); } else { -- cgit From e5b6012eca59835a6ec585ac23ba8552c7cc18b0 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Wed, 24 Aug 2022 00:17:42 +0200 Subject: Fix invalid heat capacity in MEBF (#185) * Fix * Optimize imports Former-commit-id: b4123f0a2cd21b4b0d758e73042e4521ed1f23d8 --- .../bartworks/API/BioVatLogicAdder.java | 3 +-- .../bartworks/API/BorosilicateGlass.java | 5 +--- .../github/bartimaeusnek/bartworks/MainMod.java | 1 - .../client/ClientEventHandler/TooltipCache.java | 5 +++- .../client/renderer/BW_Renderer_Block_Ores.java | 7 +---- .../common/blocks/BW_TileEntityContainer.java | 1 - .../bartworks/common/items/BW_ItemBlocks.java | 4 +-- .../common/loaders/ArtificialMicaLine.java | 1 - .../bartworks/common/loaders/BioRecipeLoader.java | 3 +-- .../bartworks/common/loaders/ItemRegistry.java | 6 +---- .../bartworks/common/loaders/RecipeLoader.java | 6 +---- .../common/loaders/StaticRecipeChangeLoaders.java | 15 ++--------- .../tileentities/multis/GT_TileEntity_BioVat.java | 2 +- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 4 +-- .../tileentities/multis/GT_TileEntity_DEHP.java | 1 - .../tileentities/multis/GT_TileEntity_HTGR.java | 30 ++++++++-------------- .../multis/GT_TileEntity_ManualTrafo.java | 5 +++- .../tileentities/multis/GT_TileEntity_THTR.java | 17 +++++------- .../multis/GT_TileEntity_Windmill.java | 1 - .../mega/GT_TileEntity_MegaBlastFurnace.java | 11 ++++---- .../mega/GT_TileEntity_MegaChemicalReactor.java | 6 +---- .../mega/GT_TileEntity_MegaDistillTower.java | 15 ++++++----- .../mega/GT_TileEntity_MegaMultiBlockBase.java | 10 ++++++-- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 2 +- .../tiered/GT_MetaTileEntity_RadioHatch.java | 1 + .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 1 - .../system/material/BW_GT_MaterialReference.java | 1 + .../material/GT_Enhancement/LuVTierEnhancer.java | 4 ++- .../bartworks/system/material/Werkstoff.java | 30 +++++----------------- .../bartworks/system/material/WerkstoffLoader.java | 3 ++- .../werkstoff_loaders/recipe/CellLoader.java | 1 - .../werkstoff_loaders/recipe/MoltenCellLoader.java | 3 +-- .../recipe/MultipleMetalLoader.java | 5 +--- .../recipe/SimpleMetalLoader.java | 9 +------ .../werkstoff_loaders/recipe/ToolLoader.java | 7 +++-- .../registration/BridgeMaterialsLoader.java | 1 - .../bartworks/util/BW_Tooltip_Reference.java | 3 ++- .../bartimaeusnek/bartworks/util/BW_Util.java | 6 ++--- .../bartworks/util/CachedReflectionUtils.java | 2 +- .../bartimaeusnek/bartworks/util/MathUtils.java | 2 -- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 6 +---- .../crossmod/tectech/helper/TecTechUtils.java | 2 +- 42 files changed, 87 insertions(+), 161 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java index 6562453ecc..36d4e04503 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -24,7 +24,6 @@ package com.github.bartimaeusnek.bartworks.API; import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -288,4 +287,4 @@ public final class BioVatLogicAdder { return this.aByte; } } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java index e4714d059d..178ab6f475 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java @@ -11,10 +11,7 @@ import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Collectors; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAdder; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAnyMeta; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlocksTiered; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; /** * API for bartworks borosilicate glass. diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 7b645304a2..f0b1be2d03 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -60,7 +60,6 @@ import java.io.IOException; import java.util.Map; import static com.github.bartimaeusnek.bartworks.common.loaders.BioRecipeLoader.runOnServerStarted; -import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.removeIC2Recipes; import static gregtech.api.enums.GT_Values.VN; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java index efa6f601ef..24b8834c47 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java @@ -26,7 +26,10 @@ import com.github.bartimaeusnek.bartworks.util.Pair; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; class TooltipCache { private static final HashMap, char[]> cache = new HashMap<>(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index aff0f71184..02983419a3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -33,12 +33,7 @@ import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.world.IBlockAccess; import org.lwjgl.opengl.GL11; -import static gregtech.common.render.GT_Renderer_Block.renderNegativeXFacing; -import static gregtech.common.render.GT_Renderer_Block.renderNegativeYFacing; -import static gregtech.common.render.GT_Renderer_Block.renderNegativeZFacing; -import static gregtech.common.render.GT_Renderer_Block.renderPositiveXFacing; -import static gregtech.common.render.GT_Renderer_Block.renderPositiveYFacing; -import static gregtech.common.render.GT_Renderer_Block.renderPositiveZFacing; +import static gregtech.common.render.GT_Renderer_Block.*; public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { public static BW_Renderer_Block_Ores INSTANCE = new BW_Renderer_Block_Ores(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index f14e8a70a5..8f2d60ef39 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -30,7 +30,6 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; import ic2.api.tile.IWrenchable; import ic2.core.IC2; import ic2.core.IHasGui; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index a136cfd34b..28f7087956 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -25,10 +25,8 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; @@ -101,4 +99,4 @@ public class BW_ItemBlocks extends ItemBlock { public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) { return this.field_150939_a.getIcon(0, p_77618_2_); } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java index 5ecbac56d6..86d5239eae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java @@ -11,7 +11,6 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; public class ArtificialMicaLine { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index 422285bbb4..748b18cf9b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -45,7 +45,6 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; -import java.util.ArrayList; import java.util.List; public class BioRecipeLoader { @@ -400,4 +399,4 @@ public class BioRecipeLoader { ) ); } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 547dbeb9cb..f82efc3d48 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -35,11 +35,7 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEnt import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; import com.github.bartimaeusnek.bartworks.common.tileentities.debug.CreativeScanner; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.*; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaBlastFurnace; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaDistillTower; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaChemicalReactor; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaOilCracker; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.*; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.*; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.crossmod.galacticgreg.GT_TileEntity_VoidMiners; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 95770f713d..10d4ad83a5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -24,11 +24,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_LESU; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_Windmill; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.*; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 4300993943..7a29cac216 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -53,22 +53,11 @@ import org.apache.commons.lang3.reflect.FieldUtils; import java.lang.reflect.Field; import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; import java.util.stream.Collectors; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.ANAEROBE_GAS; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.NOBLE_GAS; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Oganesson; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.fluids; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.molten; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; import static gregtech.api.enums.GT_Values.VN; public class StaticRecipeChangeLoaders { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 628316ccae..394eecf9e7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -67,8 +67,8 @@ import java.util.List; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTiered; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBase { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index a84ff69ad7..731599fed1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -56,11 +56,11 @@ import java.util.HashSet; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTieredMixed; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index 80c19222a1..f472ec766e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -23,7 +23,6 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index d45a7a6880..5461751c79 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -22,16 +22,14 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; -import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.IStructureElement; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.MathUtils; +import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -42,31 +40,23 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.api.objects.XSTR; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_VIA_BARTWORKS; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; - -import java.util.Arrays; -import java.util.List; -import java.util.ArrayList; -import java.util.HashMap; public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index 873355ee42..adfad9bcc6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -31,7 +31,10 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.*; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 21149cec05..1f98de8cb9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -22,15 +22,13 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; -import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; -import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.IStructureElement; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MathUtils; +import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -42,25 +40,22 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.api.objects.XSTR; import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import java.util.Arrays; + import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; - -import java.util.Arrays; public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 8df3503dd0..ece992b765 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -69,7 +69,6 @@ import java.util.Set; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.enums.GT_Values.V; public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index ccc4fddfb5..590223bdc4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -51,9 +51,8 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; import net.minecraft.util.StatCollector; - +import net.minecraftforge.fluids.FluidStack; import java.util.*; import java.util.stream.Collectors; @@ -63,10 +62,10 @@ import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.ge import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_HatchElement.Maintenance; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofCoil; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { @@ -476,8 +475,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) if (this.glasTier < hatchEnergy.mTier) return false; - - this.mHeatingCapacity = (int) getCoilLevel().getHeat() + 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 2); + long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + this.mHeatingCapacity = (int) getCoilLevel().getHeat() + 100 * (BW_Util.getTier(nominalV) - 2); return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index ba8a34ae72..d24df3c587 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -55,15 +55,11 @@ import java.util.Collection; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 2415f4c9b4..e07aa62364 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -24,10 +24,14 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.util.*; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; -import com.gtnewhorizon.structurelib.structure.*; +import com.gtnewhorizon.structurelib.structure.IItemSource; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.IStructureElementCheckOnly; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -58,9 +62,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; @Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { @@ -313,10 +315,9 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } } - long tVoltage = this.getMaxInputVoltage(); - byte tTier = (byte) Math.max(0, Math.min(GT_Utility.getTier(tVoltage), V.length - 1)); - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + byte tTier = (byte) Math.max(0, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); if (tFluids.length > 0) { for (FluidStack tFluid : tFluids) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java index 4dd55c15f6..8af3ff320d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java @@ -154,6 +154,10 @@ public abstract class GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 55e1687df7..1ab44a530c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -47,6 +47,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; + import java.util.HashMap; import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index 7c1cffa640..c91568946a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -34,7 +34,6 @@ import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.nei.GT_NEI_DefaultHandler; -import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java index 2d77a0efc8..7bfb9a9234 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.MainMod; import gregtech.api.enums.Materials; + import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.Types.*; public class BW_GT_MaterialReference { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java index e1a80035e1..7ce3eeb5c3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -28,7 +28,9 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AfterLuVTierEnhacement; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import gregtech.api.enums.*; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.objects.ItemData; import gregtech.api.util.*; import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 3175213550..baa19e43cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -25,21 +25,13 @@ package com.github.bartimaeusnek.bartworks.system.material; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.StaticRecipeChangeLoaders; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; -import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.MurmurHash3; -import com.github.bartimaeusnek.bartworks.util.NonNullWrappedHashMap; -import com.github.bartimaeusnek.bartworks.util.Pair; +import com.github.bartimaeusnek.bartworks.util.*; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.github.bartimaeusnek.crossmod.tgregworks.MaterialsInjector; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import cpw.mods.fml.common.Loader; import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.SubTag; -import gregtech.api.enums.TC_Aspects; -import gregtech.api.enums.TextureSet; +import gregtech.api.enums.*; import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_LanguageManager; @@ -49,20 +41,10 @@ import net.minecraftforge.fluids.FluidStack; import java.lang.reflect.InvocationTargetException; import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -import static net.minecraft.util.EnumChatFormatting.*; +import java.util.*; + +import static net.minecraft.util.EnumChatFormatting.DARK_PURPLE; +import static net.minecraft.util.EnumChatFormatting.GREEN; @SuppressWarnings("ALL") public class Werkstoff implements IColorModulationContainer, ISubTagContainer { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 28cf7492c0..7047f99438 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -49,7 +49,8 @@ import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.*; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_Fluid; -import gregtech.api.util.*; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_OreDictUnificator; import gregtech.common.items.GT_MetaGenerated_Tool_01; import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputOreDict; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java index e0997d6399..1c1e530f42 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java @@ -45,7 +45,6 @@ import java.util.List; import java.util.Objects; import static gregtech.api.enums.OrePrefixes.*; -import static gregtech.api.enums.OrePrefixes.cell; public class CellLoader implements IWerkstoffRunnable { @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java index 119b04bb9e..0e6d14d4a9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -38,7 +38,6 @@ import java.util.Objects; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.capsuleMolten; import static gregtech.api.enums.OrePrefixes.*; -import static gregtech.api.enums.OrePrefixes.dustTiny; public class MoltenCellLoader implements IWerkstoffRunnable { @Override @@ -86,4 +85,4 @@ public class MoltenCellLoader implements IWerkstoffRunnable { GT_Utility.addFluidContainerData(emptyData); GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsuleMolten), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java index c73714a302..eb8d5ab9f3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java @@ -32,10 +32,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.OrePrefixes.dust; -import static gregtech.api.enums.OrePrefixes.ingot; -import static gregtech.api.enums.OrePrefixes.plateDense; -import static gregtech.api.enums.OrePrefixes.plateDouble; +import static gregtech.api.enums.OrePrefixes.*; public class MultipleMetalLoader implements IWerkstoffRunnable { @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java index 80468f3af1..a3766d9843 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java @@ -39,14 +39,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.GT_Proxy; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.OrePrefixes.block; -import static gregtech.api.enums.OrePrefixes.dust; -import static gregtech.api.enums.OrePrefixes.dustSmall; -import static gregtech.api.enums.OrePrefixes.gem; -import static gregtech.api.enums.OrePrefixes.ingot; -import static gregtech.api.enums.OrePrefixes.plate; -import static gregtech.api.enums.OrePrefixes.stick; -import static gregtech.api.enums.OrePrefixes.stickLong; +import static gregtech.api.enums.OrePrefixes.*; public class SimpleMetalLoader implements IWerkstoffRunnable { @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java index 520643d1fd..647204e041 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java @@ -24,7 +24,10 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.rec import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; -import gregtech.api.enums.*; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.common.GT_Proxy; @@ -127,4 +130,4 @@ public class ToolLoader implements IWerkstoffRunnable { // GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(16,1, werkstoff.getBridgeMaterial(),werkstoff.getBridgeMaterial(),null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', werkstoff.get(ingot)}); } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java index afae6ab0b8..bd8c441740 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java @@ -35,7 +35,6 @@ import gregtech.api.util.GT_Recipe; import gregtech.common.items.behaviors.Behaviour_DataOrb; import net.minecraft.item.ItemStack; -import java.lang.reflect.Field; import java.util.ArrayList; import static gregtech.api.enums.OrePrefixes.*; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java index ff6b159144..2d0bff05ff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java @@ -22,12 +22,13 @@ package com.github.bartimaeusnek.bartworks.util; -import static net.minecraft.util.EnumChatFormatting.*; import net.minecraft.util.StatCollector; import java.util.function.Function; import java.util.function.Supplier; +import static net.minecraft.util.EnumChatFormatting.*; + public class BW_Tooltip_Reference { public static final String BW_NO_RESET = ChatColorHelper.DARKGREEN + "BartWorks"; public static final String TT_NO_RESET = BLUE + "Tec" + DARK_BLUE + "Tech"; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index aa66db2fc1..b0ca12b5f2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -29,7 +29,6 @@ import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.IStructureElementNoPlacement; -import com.gtnewhorizon.structurelib.structure.StructureUtility; import gregtech.api.enums.Materials; import gregtech.api.enums.OreDictNames; import gregtech.api.enums.ToolDictNames; @@ -70,7 +69,6 @@ import java.util.function.Consumer; import java.util.function.Function; import java.util.stream.Collectors; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static gregtech.api.enums.GT_Values.*; @SuppressWarnings({"unused","RedundantSuppression"}) @@ -326,7 +324,7 @@ public class BW_Util { } public static byte getTier(long voltage){ - if(voltage <= Integer.MAX_VALUE) + if(voltage <= Integer.MAX_VALUE - 7) return GT_Utility.getTier(voltage); byte t = 0; while(voltage > 8L) { @@ -337,7 +335,7 @@ public class BW_Util { } public static String getTierName(byte tier){ - if(VN.length <= tier) return "MAX+"; + if(VN.length - 1 <= tier) return "MAX+"; else return VN[tier]; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java index ed9aa6b2e8..44ac709b9f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java @@ -3,7 +3,7 @@ package com.github.bartimaeusnek.bartworks.util; import org.apache.commons.lang3.reflect.FieldUtils; import java.lang.reflect.Field; -import java.util.*; +import java.util.Map; import java.util.concurrent.ConcurrentHashMap; public class CachedReflectionUtils { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java index 0924d36f05..0cf02af8fa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java @@ -22,8 +22,6 @@ package com.github.bartimaeusnek.bartworks.util; -import net.minecraft.util.MathHelper; - /* * Faster implementations for Math stuff */ diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index ee1a5ee319..ff5e99fd64 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -52,11 +52,7 @@ import net.minecraft.world.World; import net.minecraft.world.gen.ChunkProviderServer; import net.minecraftforge.fluids.FluidStack; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; +import java.util.*; import java.util.function.Consumer; import java.util.function.Predicate; import java.util.stream.Collectors; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java index 53a72b2903..05ca3b665f 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java @@ -181,6 +181,6 @@ public class TecTechUtils { } public static long getEUPerTickFromLaser(GT_MetaTileEntity_Hatch_EnergyTunnel tHatch) { - return tHatch.Amperes * tHatch.maxEUInput() - (tHatch.Amperes / 20); + return tHatch.Amperes * tHatch.maxEUInput()/* - (tHatch.Amperes / 20)*/; } } -- cgit From fa8d3e87bec46d334e857ac6a5a13f053cf64b73 Mon Sep 17 00:00:00 2001 From: miozune Date: Wed, 24 Aug 2022 18:48:55 +0900 Subject: Purge OpV (fix error voltage) (#187) Former-commit-id: bd1de1addc4cfd96affcdce3184bb48285997f7f --- .../github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java | 2 +- .../com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java | 2 +- .../com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index 748b18cf9b..bfb6c5e3fd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -159,7 +159,7 @@ public class BioRecipeLoader { Materials[] hulls = {Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, Materials.Chrome, Materials.Iridium, Materials.Osmium, Materials.Naquadah}; Materials[] wireMat = {Materials.Kanthal, Materials.Nichrome, Materials.TungstenSteel, Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; Materials[] circuits = {Materials.Advanced, Materials.Data, Materials.Elite, Materials.Master, Materials.Ultimate, Materials.Superconductor}; - for (int i = 3; i < GT_Values.VN.length; i++) { + for (int i = 3; i < GT_Values.VN.length - 1; i++) { //12625 BioLab[(i - 3)] = new GT_MetaTileEntity_BioLab(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i, "bw.biolab" + GT_Values.VN[i], GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.biolab.name"), i).getStackForm(1L); RadioHatch[(i - 3)] = new GT_MetaTileEntity_RadioHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i, "bw.radiohatch" + GT_Values.VN[i], GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.radiohatch.name"), i).getStackForm(1L); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index f82efc3d48..2af3de8c67 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -192,7 +192,7 @@ public class ItemRegistry { ItemRegistry.EIG = new GT_TileEntity_ExtremeIndustrialGreenhouse(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 49, "EIG", "Extreme Industrial Greenhouse").getStackForm(1L); GT_OreDictUnificator.add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(ItemRegistry.BW_BLOCKS[2])); - for (int i = 0; i < GT_Values.VN.length; i++) { + for (int i = 0; i < GT_Values.VN.length - 1; i++) { ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "diode" + "2A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 2A " + GT_Values.VN[i], i).getStackForm(1L); ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "diode" + "4A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 4A " + GT_Values.VN[i], i).getStackForm(1L); ItemRegistry.diode8A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, "diode" + "8A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 8A " + GT_Values.VN[i], i).getStackForm(1L); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 10d4ad83a5..a126fea811 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -366,7 +366,7 @@ public class RecipeLoader { } ); - for (int i = 0; i < GT_Values.VN.length; i++) { + for (int i = 0; i < GT_Values.VN.length - 1; i++) { try { Materials cable = cables[i]; ItemStack hull = hulls[i] instanceof Materials ? GT_OreDictUnificator.get(OrePrefixes.plate, hulls[i], 1L) : ((Werkstoff) hulls[i]).get(OrePrefixes.plate); -- cgit From e67218cb6f0fbdb7691797366f181b0d4a13ee12 Mon Sep 17 00:00:00 2001 From: miozune Date: Wed, 24 Aug 2022 19:44:44 +0900 Subject: Fix empty formula causing incorrect tooltip displayed (#188) Former-commit-id: 83f4332711b80cdec42d0d748eecc6036046dcde --- .../bartworks/system/material/Werkstoff.java | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index baa19e43cb..fc4209ed27 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -199,23 +199,21 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (contents.length > 1) { if (p.getKey() instanceof Materials) { if (((Materials) p.getKey()).mMaterialList.size() > 1 && p.getValue() > 1) -// if (((Materials) p.getKey()).mChemicalFormula != null && Character.isDigit(((Materials) p.getKey()).mChemicalFormula.toCharArray()[((Materials) p.getKey()).mChemicalFormula.length()-1])) - this.toolTip += "(" + ((Materials) p.getKey()).mChemicalFormula + ")" + (BW_Util.subscriptNumber(p.getValue())); + this.toolTip += "(" + getFormula((Materials) p.getKey()) + ")" + (BW_Util.subscriptNumber(p.getValue())); else - this.toolTip += ((Materials) p.getKey()).mChemicalFormula + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + this.toolTip += getFormula((Materials) p.getKey()) + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } if (p.getKey() instanceof Werkstoff) { if (((Werkstoff) p.getKey()).CONTENTS.size() > 1 && p.getValue() > 1) -// if (((Werkstoff) p.getKey()).toolTip != null && Character.isDigit(((Werkstoff) p.getKey()).toolTip.toCharArray()[((Werkstoff) p.getKey()).toolTip.length()-1])) - this.toolTip += "(" + ((Werkstoff) p.getKey()).toolTip + ")" + (BW_Util.subscriptNumber(p.getValue())); + this.toolTip += "(" + getFormula((Werkstoff) p.getKey()) + ")" + (BW_Util.subscriptNumber(p.getValue())); else - this.toolTip += ((Werkstoff) p.getKey()).toolTip + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + this.toolTip += getFormula((Werkstoff) p.getKey()) + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } } else { if (p.getKey() instanceof Materials) { - this.toolTip += ((Materials) p.getKey()).mChemicalFormula + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + this.toolTip += getFormula((Materials) p.getKey()) + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } else if (p.getKey() instanceof Werkstoff) - this.toolTip += ((Werkstoff) p.getKey()).toolTip + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + this.toolTip += getFormula((Werkstoff) p.getKey()) + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } } } else @@ -293,6 +291,13 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.owner = getMaterialOwner(); } + private static String getFormula(Materials material) { + return material.mChemicalFormula.isEmpty() ? "?" : material.mChemicalFormula; + } + + private static String getFormula(Werkstoff material) { + return material.toolTip.isEmpty() ? "?" : material.toolTip; + } public Werkstoff addAdditionalOreDict(String s) { ADDITIONAL_OREDICT.add(s); -- cgit From f84ffa16206f45c76a2a81229390a49794e5c5b3 Mon Sep 17 00:00:00 2001 From: くぁーりぃ <39122497+Quarri6343@users.noreply.github.com> Date: Thu, 25 Aug 2022 05:37:53 +0900 Subject: Fix Botania Glass-Tier (#189) Former-commit-id: 87ce2c1d964a3bde3e31c05884aaa683a62070fa --- .../com/github/bartimaeusnek/bartworks/API/LoaderReference.java | 2 ++ .../bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java index 8c631fead4..09ba5e6dfd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java @@ -58,6 +58,7 @@ public class LoaderReference { public static boolean betterloadingscreen; public static boolean TGregworks; public static boolean ProjRedIllumination; + public static boolean Botania; public static void init() { @@ -89,5 +90,6 @@ public class LoaderReference { betterloadingscreen = Loader.isModLoaded("betterloadingscreen"); TGregworks = Loader.isModLoaded("TGregworks"); ProjRedIllumination = Loader.isModLoaded("ProjRed|Illumination"); + Botania = Loader.isModLoaded("Botania"); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java index 1023b23ee1..5bdf77e2ce 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java @@ -30,6 +30,7 @@ import com.github.bartimaeusnek.bartworks.API.LoaderReference; * Executed on 2019-01-03 02:08:43 * modified by bartimaeusnek to only add blocks that mods are loaded * modified by bartimaeusnek on 2020-03-22 00:20 to run statically + * modified by Quarri6343 on 2022-08-24 20:02 to add Botania Support */ public class GTNHBlocks { @@ -39,6 +40,12 @@ public class GTNHBlocks { if (LoaderReference.BloodArsenal) BioVatLogicAdder.BioVatGlass.addCustomGlass("BloodArsenal", "blood_stained_glass", 0, 3); + if (LoaderReference.Botania) { + BioVatLogicAdder.BioVatGlass.addCustomGlass("Botania", "manaGlass", 0, 4); + BioVatLogicAdder.BioVatGlass.addCustomGlass("Botania", "manaGlassPane", 0, 4); + BioVatLogicAdder.BioVatGlass.addCustomGlass("Botania", "elfGlass", 0, 5); + BioVatLogicAdder.BioVatGlass.addCustomGlass("Botania", "elfGlassPane", 0, 5); + } if (LoaderReference.Botany) BioVatLogicAdder.BioVatGlass.addCustomGlass("Botany", "stained", 0, 3); if (LoaderReference.EnderIO) @@ -93,4 +100,4 @@ public class GTNHBlocks { BioVatLogicAdder.BioVatGlass.addCustomGlass("witchery", "shadedglass", i, 3); } } -} \ No newline at end of file +} -- cgit From 64796ccb33ca0333927e1279f21f791d92b90108 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Thu, 25 Aug 2022 20:27:26 +0800 Subject: allow separately selecting coil and glass tier using channels (#190) Former-commit-id: 1071d5a84db3514f32952a992b7339f6c37a6478 --- dependencies.gradle | 2 +- repositories.gradle | 1 + .../tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 37468769cb..c953c09aa9 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,7 +2,7 @@ dependencies { compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.08:dev") - compile("com.github.GTNewHorizons:StructureLib:1.1.3:dev") + compile("com.github.GTNewHorizons:StructureLib:1.1.6:dev") compile("com.github.GTNewHorizons:TecTech:5.0.22:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.2.22:dev") compile("com.github.GTNewHorizons:TinkersConstruct:1.9.0.13-GTNH:dev") diff --git a/repositories.gradle b/repositories.gradle index a6fb7f9b4e..596dbd0df1 100644 --- a/repositories.gradle +++ b/repositories.gradle @@ -1,6 +1,7 @@ // Add any additional repositories for your dependencies here repositories { + mavenLocal() maven { name = "GTNH Maven" url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 590223bdc4..ab03d1305c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -61,6 +61,7 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTI import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.withChannel; import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; @@ -82,8 +83,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX) ) .addElement('m', Muffler.newAny(CASING_INDEX, 2)) - .addElement('C', ofCoil(GT_TileEntity_MegaBlastFurnace::setCoilLevel, GT_TileEntity_MegaBlastFurnace::getCoilLevel)) - .addElement('g', BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) + .addElement('C', withChannel("coil", ofCoil(GT_TileEntity_MegaBlastFurnace::setCoilLevel, GT_TileEntity_MegaBlastFurnace::getCoilLevel))) + .addElement('g', withChannel("glass", BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier))) .addElement('b', buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, TTEnabledEnergyHatchElement.INSTANCE) .casingIndex(CASING_INDEX) -- cgit From 52b0805be619d2ada4dd2ec7def12a80cc595d35 Mon Sep 17 00:00:00 2001 From: miozune Date: Sat, 27 Aug 2022 17:28:21 +0900 Subject: Fix color of glass tiers (#191) Former-commit-id: 741e584f4175da950d54c6668b86e2b3a7906bd4 --- .../bartimaeusnek/bartworks/util/BW_ColorUtil.java | 42 ++-------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java index a4a2a794d0..6956c68233 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.util; import gregtech.api.enums.Dyes; +import gregtech.api.enums.GT_Values; import java.util.Arrays; @SuppressWarnings("unused") @@ -243,45 +244,6 @@ public class BW_ColorUtil { } public static String getColorForTier(int tier) { - String ret; - switch (tier) { - case 0: - ret = ChatColorHelper.RED; - break; - case 1: - ret = ChatColorHelper.GRAY; - break; - case 2: - ret = ChatColorHelper.AQUA; - break; - case 3: - ret = ChatColorHelper.GOLD; - break; - case 4: - ret = ChatColorHelper.DARKPURPLE; - break; - case 5: - ret = ChatColorHelper.DARKBLUE; - break; - case 6: - ret = ChatColorHelper.LIGHT_PURPLE; - break; - case 7: - ret = ChatColorHelper.WHITE; - break; - case 8: - ret = ChatColorHelper.DARKAQUA; - break; - case 9: - ret = ChatColorHelper.DARKRED; - break; - case 10: - ret = ChatColorHelper.GREEN; - break; - default: - ret = ChatColorHelper.OBFUSCATED; - break; - } - return ret; + return GT_Values.TIER_COLORS[tier]; } } -- cgit From b5fb58403e9feb92018a737b9b6a77c559c5eda7 Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Sat, 27 Aug 2022 10:56:37 +0100 Subject: Update buildscript & apply spotless (#192) * Update dependencies * updateBuildscript & spotlessApply Former-commit-id: f780e1a8d0f0bd192ba977eef17d41ee6fcd4b12 --- .gitattributes | 35 + build.gradle | 436 +++-- dependencies.gradle | 34 +- settings.gradle | 10 + .../bartworks/API/API_ConfigValues.java | 2 +- .../bartworks/API/AcidGenFuelAdder.java | 3 +- .../bartworks/API/BioObjectAdder.java | 76 +- .../bartworks/API/BioObjectGetter.java | 6 +- .../bartworks/API/BioRecipeAdder.java | 137 +- .../bartworks/API/BioVatLogicAdder.java | 91 +- .../bartworks/API/BorosilicateGlass.java | 29 +- .../bartimaeusnek/bartworks/API/INoiseGen.java | 17 +- .../bartworks/API/ITileDropsContent.java | 3 +- .../API/ITileHasDifferentTextureSides.java | 2 - .../bartimaeusnek/bartworks/API/ITileWithGUI.java | 8 +- .../bartworks/API/LoaderReference.java | 3 +- .../bartimaeusnek/bartworks/API/SideReference.java | 13 +- .../bartworks/API/VoidMinerDropAdder.java | 23 +- .../bartimaeusnek/bartworks/API/WerkstoffAPI.java | 1 - .../bartworks/API/WerkstoffAdderRegistry.java | 6 +- .../bartimaeusnek/bartworks/API/package-info.java | 2 +- .../bartimaeusnek/bartworks/ASM/ASMUtils.java | 14 +- .../github/bartimaeusnek/bartworks/ASM/BWCore.java | 11 +- .../bartimaeusnek/bartworks/ASM/BWCorePlugin.java | 14 +- .../ASM/BWCoreStaticReplacementMethodes.java | 52 +- .../bartworks/ASM/BWCoreTransformer.java | 208 ++- .../github/bartimaeusnek/bartworks/GuiHandler.java | 12 +- .../github/bartimaeusnek/bartworks/MainMod.java | 55 +- .../client/ClientEventHandler/TooltipCache.java | 21 +- .../ClientEventHandler/TooltipEventHandler.java | 45 +- .../client/creativetabs/bartworksTab.java | 1 - .../gui/BW_GUIContainer_HeatedWaterPump.java | 14 +- .../client/gui/BW_GUIContainer_RadLevel.java | 1 - .../client/gui/BW_GUIContainer_RotorBlock.java | 26 +- .../client/gui/BW_GUIContainer_Windmill.java | 8 +- .../gui/GT_GUIContainer_CircuitProgrammer.java | 3 +- .../client/gui/GT_GUIContainer_Destructopack.java | 8 +- .../bartworks/client/gui/GT_GUIContainer_LESU.java | 53 +- .../client/gui/GT_GUIContainer_RadioHatch.java | 40 +- .../client/renderer/BW_CropVisualizer.java | 13 +- .../client/renderer/BW_GT_ItemRenderer.java | 59 +- .../client/renderer/BW_Renderer_Block_Ores.java | 11 +- .../client/renderer/RendererGlasBlock.java | 16 +- .../renderer/RendererSwitchingColorFluid.java | 87 +- .../client/textures/PrefixTextureLinker.java | 27 +- .../bartworks/common/blocks/BW_Blocks.java | 6 +- .../bartworks/common/blocks/BW_GlasBlocks.java | 23 +- .../common/blocks/BW_TileEntityContainer.java | 28 +- .../BW_TileEntityContainer_MachineBlock.java | 3 +- .../blocks/BW_TileEntityContainer_Multiple.java | 22 +- .../bartworks/common/blocks/BioFluidBlock.java | 2 +- .../bartworks/common/commands/ChangeConfig.java | 25 +- .../common/commands/GetWorkingDirectory.java | 3 +- .../common/commands/PrintRecipeListToFile.java | 14 +- .../bartworks/common/commands/SummonRuin.java | 16 +- .../bartworks/common/configs/ConfigHandler.java | 362 +++- .../bartworks/common/items/BW_ItemBlocks.java | 17 +- .../bartworks/common/items/BW_SimpleWindMeter.java | 28 +- .../bartworks/common/items/BW_Stonage_Rotors.java | 26 +- .../bartworks/common/items/Circuit_Programmer.java | 12 +- .../common/items/GT_Destructopack_Item.java | 3 +- .../bartworks/common/items/GT_Rockcutter_Item.java | 38 +- .../bartworks/common/items/GT_Teslastaff_Item.java | 9 +- .../bartworks/common/items/LabModule.java | 3 +- .../bartworks/common/items/LabParts.java | 33 +- .../bartworks/common/items/SimpleIconItem.java | 1 - .../bartworks/common/items/SimpleSubItemClass.java | 15 +- .../common/loaders/ArtificialMicaLine.java | 194 +- .../bartworks/common/loaders/BeforeGTPreload.java | 19 +- .../bartworks/common/loaders/BioCultureLoader.java | 79 +- .../bartworks/common/loaders/BioItemList.java | 46 +- .../bartworks/common/loaders/BioRecipeLoader.java | 586 +++--- .../bartworks/common/loaders/FluidLoader.java | 70 +- .../bartworks/common/loaders/GTNHBlocks.java | 24 +- .../bartworks/common/loaders/ItemRegistry.java | 352 +++- .../common/loaders/LocalisationLoader.java | 46 +- .../bartworks/common/loaders/RecipeLoader.java | 1927 ++++++++++++-------- .../common/loaders/RegisterServerCommands.java | 3 +- .../common/loaders/StaticRecipeChangeLoaders.java | 421 +++-- .../bartworks/common/net/BW_Network.java | 60 +- .../common/net/CircuitProgrammerPacket.java | 22 +- .../bartworks/common/net/MetaBlockPacket.java | 34 +- .../bartworks/common/net/OreDictCachePacket.java | 17 +- .../bartworks/common/net/RendererPacket.java | 74 +- .../bartworks/common/net/ServerJoinedPackage.java | 10 +- .../classic/BWTileEntityDimIDBridge.java | 3 +- .../common/tileentities/classic/BW_RotorBlock.java | 1 - .../BW_TileEntity_ExperimentalFloodGate.java | 30 +- .../classic/BW_TileEntity_HeatedWaterPump.java | 153 +- .../classic/BW_TileEntity_InfinityTank.java | 27 +- .../classic/BW_TileEntity_LESU_Redux.java | 67 +- .../common/tileentities/debug/CreativeScanner.java | 11 +- .../tileentities/multis/GT_TileEntity_BioVat.java | 400 ++-- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 274 +-- .../multis/GT_TileEntity_CrackingDistillTower.java | 36 +- .../tileentities/multis/GT_TileEntity_DEHP.java | 85 +- .../GT_TileEntity_ElectricImplosionCompressor.java | 297 +-- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 732 ++++---- .../tileentities/multis/GT_TileEntity_HTGR.java | 657 +++++-- .../tileentities/multis/GT_TileEntity_LESU.java | 95 +- .../multis/GT_TileEntity_ManualTrafo.java | 287 +-- .../tileentities/multis/GT_TileEntity_THTR.java | 516 ++++-- .../multis/GT_TileEntity_Windmill.java | 404 ++-- .../mega/GT_TileEntity_MegaBlastFurnace.java | 275 +-- .../mega/GT_TileEntity_MegaChemicalReactor.java | 178 +- .../mega/GT_TileEntity_MegaDistillTower.java | 452 +++-- .../mega/GT_TileEntity_MegaMultiBlockBase.java | 178 +- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 283 ++- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 430 ++++- .../tiered/GT_MetaTileEntity_AcidGenerator.java | 75 +- .../tiered/GT_MetaTileEntity_BioLab.java | 410 +++-- .../GT_MetaTileEntity_CompressedFluidHatch.java | 6 +- .../tiered/GT_MetaTileEntity_Diode.java | 53 +- .../GT_MetaTileEntity_EnergyDistributor.java | 23 +- .../tiered/GT_MetaTileEntity_GiantOutputHatch.java | 3 +- .../tiered/GT_MetaTileEntity_RadioHatch.java | 177 +- .../tiered/GT_MetaTileEntity_Transistor.java | 83 +- .../bartworks/neiHandler/BW_NEI_BioLabHandler.java | 22 +- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 82 +- .../bartworks/neiHandler/BW_NEI_OreHandler.java | 142 +- .../bartworks/neiHandler/NEI_BW_Config.java | 36 +- .../server/EventHandler/ServerEventHandler.java | 100 +- .../container/BW_Container_HeatedWaterPump.java | 23 +- .../server/container/BW_Container_RadioHatch.java | 28 +- .../server/container/BW_Container_Windmill.java | 1 - .../container/GT_Container_CircuitProgrammer.java | 67 +- .../container/GT_Container_Item_Destructopack.java | 2 +- .../server/container/GT_Container_LESU.java | 1 - .../server/container/GT_Container_RadioHatch.java | 42 +- .../server/container/Slots/BW_DelSlot.java | 2 - .../system/material/BW_GT_MaterialReference.java | 1508 +++++++++------ .../material/BW_MetaGeneratedBlock_Item.java | 44 +- .../material/BW_MetaGeneratedBlocks_Casing.java | 38 +- .../BW_MetaGeneratedBlocks_CasingAdvanced_TE.java | 10 +- .../material/BW_MetaGeneratedBlocks_Casing_TE.java | 10 +- .../system/material/BW_MetaGeneratedFrames.java | 46 +- .../system/material/BW_MetaGeneratedOreTE.java | 10 +- .../material/BW_MetaGeneratedSmallOreTE.java | 36 +- .../system/material/BW_MetaGenerated_Block_TE.java | 14 +- .../system/material/BW_MetaGenerated_Blocks.java | 30 +- .../system/material/BW_MetaGenerated_Items.java | 101 +- .../system/material/BW_MetaGenerated_Ores.java | 27 +- .../material/BW_MetaGenerated_SmallOres.java | 14 +- .../BW_MetaGenerated_WerkstoffBlock_TE.java | 12 +- .../material/BW_MetaGenerated_WerkstoffBlocks.java | 10 +- .../system/material/BW_NonMeta_MaterialItems.java | 15 +- .../CircuitGeneration/BW_CircuitsLoader.java | 7 +- .../material/CircuitGeneration/BW_Meta_Items.java | 278 +-- .../material/CircuitGeneration/CircuitData.java | 11 +- .../CircuitGeneration/CircuitImprintLoader.java | 194 +- .../CircuitGeneration/CircuitPartLoader.java | 190 +- .../material/GT_Enhancement/BWGTMetaItems.java | 113 +- .../GT_Enhancement/GTMetaItemEnhancer.java | 86 +- .../material/GT_Enhancement/LuVTierEnhancer.java | 242 ++- .../GT_Enhancement/PlatinumSludgeOverHaul.java | 1074 ++++++++--- .../bartworks/system/material/Werkstoff.java | 450 +++-- .../bartworks/system/material/WerkstoffLoader.java | 1172 ++++++------ .../processingLoaders/AdditionalRecipes.java | 710 +++++--- .../processingLoaders/AfterLuVTierEnhacement.java | 70 +- .../material/processingLoaders/DownTierLoader.java | 1 - .../processingLoaders/LoadItemContainers.java | 56 +- .../werkstoff_loaders/IWerkstoffRunnable.java | 2 +- .../werkstoff_loaders/recipe/AspectLoader.java | 19 +- .../werkstoff_loaders/recipe/BlockLoader.java | 19 +- .../werkstoff_loaders/recipe/CasingLoader.java | 79 +- .../werkstoff_loaders/recipe/CellLoader.java | 178 +- .../recipe/CraftingMaterialLoader.java | 198 +- .../werkstoff_loaders/recipe/CrushedLoader.java | 149 +- .../werkstoff_loaders/recipe/DustLoader.java | 269 ++- .../werkstoff_loaders/recipe/GemLoader.java | 95 +- .../werkstoff_loaders/recipe/MetalLoader.java | 22 +- .../werkstoff_loaders/recipe/MoltenCellLoader.java | 148 +- .../recipe/MultipleMetalLoader.java | 24 +- .../werkstoff_loaders/recipe/OreLoader.java | 19 +- .../recipe/SimpleMetalLoader.java | 108 +- .../werkstoff_loaders/recipe/ToolLoader.java | 945 +++++++++- .../registration/AssociationLoader.java | 5 +- .../registration/BridgeMaterialsLoader.java | 149 +- .../registration/CasingRegistrator.java | 20 +- .../bartworks/system/object/AbstractedStack.java | 8 +- .../bartworks/system/oredict/OreDictAdder.java | 21 +- .../bartworks/system/oredict/OreDictHandler.java | 52 +- .../bartworks/system/oregen/BW_OreLayer.java | 193 +- .../bartworks/system/oregen/BW_WordGenerator.java | 48 +- .../system/oregen/BW_WorldGenRoss128b.java | 86 +- .../system/oregen/BW_WorldGenRoss128ba.java | 114 +- .../bartworks/system/worldgen/GT_WorldgenUtil.java | 21 +- .../bartworks/system/worldgen/MapGenRuins.java | 144 +- .../bartimaeusnek/bartworks/util/BWRecipes.java | 724 ++++++-- .../bartimaeusnek/bartworks/util/BW_ColorUtil.java | 171 +- .../bartworks/util/BW_Tooltip_Reference.java | 26 +- .../bartimaeusnek/bartworks/util/BW_Util.java | 844 ++++++--- .../bartimaeusnek/bartworks/util/BioCulture.java | 119 +- .../bartimaeusnek/bartworks/util/BioDNA.java | 7 +- .../bartimaeusnek/bartworks/util/BioData.java | 42 +- .../bartimaeusnek/bartworks/util/BioPlasmid.java | 7 +- .../bartworks/util/CachedReflectionUtils.java | 3 +- .../bartworks/util/ConnectedBlocksChecker.java | 87 +- .../util/ConnectedBlocksCheckerIteration.java | 77 +- .../bartimaeusnek/bartworks/util/Coords.java | 11 +- .../bartimaeusnek/bartworks/util/EnumUtils.java | 95 +- .../bartimaeusnek/bartworks/util/MathUtils.java | 38 +- .../bartimaeusnek/bartworks/util/MegaUtils.java | 6 +- .../bartimaeusnek/bartworks/util/MurmurHash3.java | 82 +- .../bartworks/util/NoiseUtil/BartsNoise.java | 199 +- .../bartworks/util/NoiseUtil/SimplexNoise.java | 713 ++++---- .../bartworks/util/NonNullWrappedHashMap.java | 7 +- .../bartworks/util/NonNullWrappedHashSet.java | 6 +- .../github/bartimaeusnek/bartworks/util/Pair.java | 16 +- .../bartworks/util/RecipeFinderForParallel.java | 32 +- .../bartimaeusnek/bartworks/util/StreamUtils.java | 5 +- .../accessprioritylist/AccessPriorityList.java | 74 +- .../AccessPriorityListIterators.java | 15 +- .../accessprioritylist/AccessPriorityListNode.java | 6 +- .../bartworks/util/flowerset/FlowerSet.java | 20 +- .../bartimaeusnek/bartworks/util/log/DebugLog.java | 15 +- .../bartimaeusnek/bartworks/util/package-info.java | 2 +- .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 85 +- .../crossmod/GTpp/loader/RadioHatchCompat.java | 119 +- .../crossmod/ae2/ItemSingleItemStorageCell.java | 62 +- .../bartimaeusnek/crossmod/cls/CLSCompat.java | 17 +- .../crossmod/emt/recipe/TCRecipeHandler.java | 250 ++- .../multi/GT_Industrial_Alchemic_Construct.java | 46 +- .../crossmod/emt/util/EMTHandler.java | 6 +- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 216 ++- .../galacticgreg/GT_TileEntity_VoidMiners.java | 2 +- .../crossmod/galacticraft/GalacticraftProxy.java | 44 +- .../crossmod/galacticraft/PlanetsHelperClass.java | 4 +- .../galacticraft/UniversalTeleportType.java | 16 +- .../atmosphere/BWAtmosphereManager.java | 70 +- .../planets/AbstractWorldProviderSpace.java | 1 - .../planets/ross128b/ChunkProviderRoss128b.java | 44 +- .../planets/ross128b/SkyProviderRoss128b.java | 5 +- .../planets/ross128b/WorldProviderRoss128b.java | 4 +- .../planets/ross128ba/ChunkProviderRoss128ba.java | 15 +- .../solarsystems/Ross128SolarSystem.java | 40 +- .../tileEntity/DysonSwarmSunReplacement.java | 23 +- .../galaxySpace/tileEntity/GalaxySpaceProxy.java | 50 +- .../crossmod/openComputers/GT_NBT_DataBase.java | 17 +- .../openComputers/TileEntity_GTDataServer.java | 76 +- .../tectech/TT_TileEntity_ManualTrafo.java | 41 +- .../crossmod/tectech/TecTechEnabledMulti.java | 51 +- .../crossmod/tectech/TecTechResearchLoader.java | 127 +- .../crossmod/tectech/helper/IHasCoils.java | 1 + .../crossmod/tectech/helper/TecTechUtils.java | 40 +- .../tectech/tileentites/tiered/LowPowerLaser.java | 33 +- .../tiered/TT_Abstract_LowPowerLaserThingy.java | 46 +- .../tiered/TT_MetaTileEntity_LowPowerLaserBox.java | 88 +- .../TT_MetaTileEntity_LowPowerLaserDynamo.java | 20 +- .../TT_MetaTileEntity_LowPowerLaserHatch.java | 21 +- .../TT_MetaTileEntity_Pipe_Energy_LowPower.java | 69 +- .../crossmod/tgregworks/MaterialsInjector.java | 86 +- .../crossmod/thaumcraft/CustomAspects.java | 53 +- .../tile/GT_Multi_IndustrialCrucible.java | 3 +- .../crossmod/thaumcraft/tile/GT_WandBuffer.java | 5 +- .../thaumcraft/util/ThaumcraftHandler.java | 74 +- 256 files changed, 18517 insertions(+), 10274 deletions(-) create mode 100644 .gitattributes create mode 100644 settings.gradle diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..9917fc4abe --- /dev/null +++ b/.gitattributes @@ -0,0 +1,35 @@ +* text eol=lf + +*.jar binary + +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.tif binary +*.tiff binary +*.ico binary +*.svg text +*.eps binary + +*.kar binary +*.m4a binary +*.mid binary +*.midi binary +*.mp3 binary +*.ogg binary +*.ra binary + +*.7z binary +*.gz binary +*.tar binary +*.tgz binary +*.zip binary + +*.patch -text + +*.bat text eol=crlf +*.cmd text eol=crlf +*.ps1 text eol=crlf + +*autogenerated binary \ No newline at end of file diff --git a/build.gradle b/build.gradle index c09bee22f3..997b94dc30 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,9 @@ -//version: 1652851397 +//version: 1661114848 /* -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. -*/ + 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 @@ -12,14 +11,26 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import org.gradle.internal.logging.text.StyledTextOutput.Style import org.gradle.internal.logging.text.StyledTextOutputFactory +import java.nio.file.Files +import java.nio.file.Paths import java.util.concurrent.TimeUnit +import java.util.zip.ZipEntry +import java.util.zip.ZipInputStream +import java.util.zip.ZipOutputStream buildscript { repositories { + mavenCentral() + maven { name 'forge' url 'https://maven.minecraftforge.net' } + maven { + // GTNH ForgeGradle Fork + name = "GTNH Maven" + url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" + } maven { name 'sonatype' url 'https://oss.sonatype.org/content/repositories/snapshots/' @@ -28,32 +39,38 @@ buildscript { 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.7' + classpath 'net.minecraftforge.gradle:ForgeGradle:1.2.9' } } - plugins { id 'java-library' id 'idea' id 'eclipse' id 'scala' id 'maven-publish' - id 'org.jetbrains.kotlin.jvm' version '1.5.30' apply false - id 'org.jetbrains.kotlin.kapt' version '1.5.30' apply false - id 'com.google.devtools.ksp' version '1.5.30-1.0.0' apply false - id 'org.ajoberstar.grgit' version '4.1.1' + id 'org.jetbrains.kotlin.jvm' version '1.5.30' apply false + id 'org.jetbrains.kotlin.kapt' version '1.5.30' apply false + id 'com.google.devtools.ksp' version '1.5.30-1.0.0' apply false + id 'org.ajoberstar.grgit' version '4.1.1' id 'com.github.johnrengelman.shadow' version '4.0.4' - id 'com.palantir.git-version' version '0.13.0' apply false - id 'de.undercouch.download' version '5.0.1' - id 'com.github.gmazzo.buildconfig' version '3.0.3' apply false + id 'com.palantir.git-version' version '0.13.0' apply false + id 'de.undercouch.download' version '5.0.1' + id 'com.github.gmazzo.buildconfig' version '3.0.3' apply false + id 'com.diffplug.spotless' version '6.7.2' apply false +} +boolean settingsupdated = verifySettingsGradle() +settingsupdated = verifyGitAttributes() || settingsupdated +if (settingsupdated) + throw new GradleException("Settings has been updated, please re-run task.") + +dependencies { + implementation 'com.diffplug:blowdryer:1.6.0' } +apply plugin: 'com.diffplug.blowdryer' + if (project.file('.git/HEAD').isFile()) { apply plugin: 'com.palantir.git-version' } @@ -78,7 +95,14 @@ idea { } } -if(JavaVersion.current() != JavaVersion.VERSION_1_8) { +boolean disableSpotless = project.hasProperty("disableSpotless") ? project.disableSpotless.toBoolean() : false + +if (!disableSpotless) { + apply plugin: 'com.diffplug.spotless' + apply from: Blowdryer.file('spotless.gradle') +} + +if (JavaVersion.current() != JavaVersion.VERSION_1_8) { throw new GradleException("This project requires Java 8, but it's running on " + JavaVersion.current()) } @@ -103,9 +127,11 @@ checkPropertyExists("containsMixinsAndOrCoreModOnly") checkPropertyExists("usesShadowedDependencies") checkPropertyExists("developmentEnvironmentUserName") -boolean noPublishedSources = project.findProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false -boolean usesMixinDebug = project.findProperty('usesMixinDebug') ?: project.usesMixins.toBoolean() - +boolean noPublishedSources = project.hasProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false +boolean usesMixinDebug = project.hasProperty('usesMixinDebug') ?: project.usesMixins.toBoolean() +boolean forceEnableMixins = project.hasProperty('forceEnableMixins') ? project.forceEnableMixins.toBoolean() : false +String channel = project.hasProperty('channel') ? project.channel : 'stable' +String mappingsVersion = project.hasProperty('mappingsVersion') ? project.mappingsVersion : '12' String javaSourceDir = "src/main/java/" String scalaSourceDir = "src/main/scala/" String kotlinSourceDir = "src/main/kotlin/" @@ -113,53 +139,53 @@ String kotlinSourceDir = "src/main/kotlin/" String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") String targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") -if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { +if (!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) } -if(apiPackage) { +if (apiPackage) { targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") - if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { + if (!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) } } -if(accessTransformersFile) { +if (accessTransformersFile) { String targetFile = "src/main/resources/META-INF/" + accessTransformersFile - if(!getFile(targetFile).exists()) { + if (!getFile(targetFile).exists()) { throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) } } -if(usesMixins.toBoolean()) { - if(mixinsPackage.isEmpty() || mixinPlugin.isEmpty()) { +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("\\.", "/") targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/") - if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { - throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) + if (!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { + throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) } 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" String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".kt" - if(!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) { + if (!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) { throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin) } } -if(coreModClass) { +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" String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".kt" - if(!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) { + if (!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) { throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin) } } @@ -189,7 +215,7 @@ try { catch (Exception ignored) { out.style(Style.Failure).text( 'This mod must be version controlled by Git AND the repository must provide at least one tag,\n' + - 'or the VERSION override must be set! ').style(Style.SuccessHeader).text('(Do NOT download from GitHub using the ZIP option, instead\n' + + 'or the VERSION override must be set! ').style(Style.SuccessHeader).text('(Do NOT download from GitHub using the ZIP option, instead\n' + 'clone the repository, see ').style(Style.Info).text('https://gtnh.miraheze.org/wiki/Development').style(Style.SuccessHeader).println(' for details.)' ) versionOverride = 'NO-GIT-TAG-SET' @@ -200,22 +226,21 @@ ext { modVersion = identifiedVersion } -if(identifiedVersion == versionOverride) { +if (identifiedVersion == versionOverride) { out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7') } group = modGroup -if(project.hasProperty("customArchiveBaseName") && customArchiveBaseName) { +if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) { archivesBaseName = customArchiveBaseName -} -else { +} else { archivesBaseName = modId } def arguments = [] def jvmArguments = [] -if (usesMixins.toBoolean()) { +if (usesMixins.toBoolean() || forceEnableMixins) { arguments += [ "--tweakClass org.spongepowered.asm.launch.MixinTweaker" ] @@ -234,16 +259,16 @@ minecraft { if (replaceGradleTokenInFile) { replaceIn replaceGradleTokenInFile - if(gradleTokenModId) { + if (gradleTokenModId) { replace gradleTokenModId, modId } - if(gradleTokenModName) { + if (gradleTokenModName) { replace gradleTokenModName, modName } - if(gradleTokenVersion) { + if (gradleTokenVersion) { replace gradleTokenVersion, modVersion } - if(gradleTokenGroupName) { + if (gradleTokenGroupName) { replace gradleTokenGroupName, modGroup } } @@ -252,7 +277,7 @@ minecraft { args(arguments) jvmArgs(jvmArguments) - if(developmentEnvironmentUserName) { + if (developmentEnvironmentUserName) { args("--username", developmentEnvironmentUserName) } } @@ -263,7 +288,7 @@ minecraft { } } -if(file('addon.gradle').exists()) { +if (file('addon.gradle').exists()) { apply from: 'addon.gradle' } @@ -280,7 +305,7 @@ repositories { name 'Overmind forge repo mirror' url 'https://gregtech.overminddl1.com/' } - if(usesMixins.toBoolean()) { + if (usesMixins.toBoolean() || forceEnableMixins) { maven { name 'sponge' url 'https://repo.spongepowered.org/repository/maven-public' @@ -292,11 +317,13 @@ repositories { } dependencies { - if(usesMixins.toBoolean()) { + 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') + } + if (usesMixins.toBoolean() || forceEnableMixins) { // 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 @@ -354,7 +381,10 @@ shadowJar { } minimize() // This will only allow shading for actually used classes - configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile] + configurations = [ + project.configurations.shadowImplementation, + project.configurations.shadowCompile + ] dependsOn(relocateShadowJar) } @@ -369,38 +399,38 @@ jar { attributes(getManifestAttributes()) } - if(usesShadowedDependencies.toBoolean()) { + if (usesShadowedDependencies.toBoolean()) { dependsOn(shadowJar) enabled = false } } reobf { - if(usesMixins.toBoolean()) { + if (usesMixins.toBoolean()) { addExtraSrgFile mixinSrg } } afterEvaluate { - if(usesMixins.toBoolean()) { + 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" + "-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 { - if(developmentEnvironmentUserName) { + if (developmentEnvironmentUserName) { arguments += [ - "--username", - developmentEnvironmentUserName + "--username", + developmentEnvironmentUserName ] } @@ -415,9 +445,9 @@ runServer { tasks.withType(JavaExec).configureEach { javaLauncher.set( - javaToolchains.launcherFor { - languageVersion = projectJavaVersion - } + javaToolchains.launcherFor { + languageVersion = projectJavaVersion + } ) } @@ -425,6 +455,7 @@ processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version + exclude("spotless.gradle") // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { @@ -437,43 +468,44 @@ processResources { "modName": modName } - if(usesMixins.toBoolean()) { + if (usesMixins.toBoolean()) { from refMap } // copy everything else that's not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' + exclude 'spotless.gradle' } } def getManifestAttributes() { def manifestAttributes = [:] - if(!containsMixinsAndOrCoreModOnly.toBoolean() && (usesMixins.toBoolean() || coreModClass)) { + if (!containsMixinsAndOrCoreModOnly.toBoolean() && (usesMixins.toBoolean() || coreModClass)) { manifestAttributes += ["FMLCorePluginContainsFMLMod": true] } - if(accessTransformersFile) { - manifestAttributes += ["FMLAT" : accessTransformersFile.toString()] + if (accessTransformersFile) { + manifestAttributes += ["FMLAT": accessTransformersFile.toString()] } - if(coreModClass) { + if (coreModClass) { manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass] } - if(usesMixins.toBoolean()) { + if (usesMixins.toBoolean()) { manifestAttributes += [ - "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", - "MixinConfigs" : "mixins." + modId + ".json", - "ForceLoadAsMod" : !containsMixinsAndOrCoreModOnly.toBoolean() + "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", + "MixinConfigs" : "mixins." + modId + ".json", + "ForceLoadAsMod": !containsMixinsAndOrCoreModOnly.toBoolean() ] } return manifestAttributes } task sourcesJar(type: Jar) { - from (sourceSets.main.allSource) - from (file("$projectDir/LICENSE")) + from(sourceSets.main.allSource) + from(file("$projectDir/LICENSE")) getArchiveClassifier().set('sources') } @@ -492,7 +524,10 @@ task shadowDevJar(type: ShadowJar) { } minimize() // This will only allow shading for actually used classes - configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile] + configurations = [ + project.configurations.shadowImplementation, + project.configurations.shadowCompile + ] } task relocateShadowDevJar(type: ConfigureShadowRelocation) { @@ -520,22 +555,22 @@ task devJar(type: Jar) { attributes(getManifestAttributes()) } - if(usesShadowedDependencies.toBoolean()) { + if (usesShadowedDependencies.toBoolean()) { dependsOn(circularResolverJar) enabled = false } } task apiJar(type: Jar) { - from (sourceSets.main.allSource) { + from(sourceSets.main.allSource) { include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**' } - from (sourceSets.main.output) { + from(sourceSets.main.output) { include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**' } - from (sourceSets.main.resources.srcDirs) { + from(sourceSets.main.resources.srcDirs) { include("LICENSE") } @@ -543,11 +578,11 @@ task apiJar(type: Jar) { } artifacts { - if(!noPublishedSources) { + if (!noPublishedSources) { archives sourcesJar } archives devJar - if(apiPackage) { + if (apiPackage) { archives apiJar } } @@ -565,10 +600,10 @@ publishing { publications { maven(MavenPublication) { from components.java - if(usesShadowedDependencies.toBoolean()) { + if (usesShadowedDependencies.toBoolean()) { artifact source: shadowJar, classifier: "" } - if(!noPublishedSources) { + if (!noPublishedSources) { artifact source: sourcesJar, classifier: "sources" } artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev" @@ -583,8 +618,11 @@ publishing { // remove extra garbage from minecraft and minecraftDeps configuration pom.withXml { - def badArtifacts = [:].withDefault {[] as Set} - for (configuration in [projectConfigs.minecraft, projectConfigs.minecraftDeps]) { + def badArtifacts = [:].withDefault { [] as Set } + for (configuration in [ + projectConfigs.minecraft, + projectConfigs.minecraftDeps + ]) { for (dependency in configuration.allDependencies) { badArtifacts[dependency.group == null ? "" : dependency.group] += dependency.name } @@ -622,7 +660,7 @@ task updateBuildScript { } } -if (isNewBuildScriptVersionAvailable(projectDir.toString())) { +if (!project.getGradle().startParameter.isOffline() && isNewBuildScriptVersionAvailable(projectDir.toString())) { if (autoUpdateBuildScript.toBoolean()) { performBuildScriptUpdate(projectDir.toString()) } else { @@ -631,7 +669,40 @@ if (isNewBuildScriptVersionAvailable(projectDir.toString())) { } static URL availableBuildScriptUrl() { - new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/main/build.gradle") + new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/build.gradle") +} + +static URL exampleSettingsGradleUrl() { + new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/settings.gradle.example") +} + +static URL exampleGitAttributesUrl() { + new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/.gitattributes") +} + + +boolean verifyGitAttributes() { + def gitattributesFile = getFile(".gitattributes") + if (!gitattributesFile.exists()) { + println("Downloading default .gitattributes") + exampleGitAttributesUrl().withInputStream { i -> gitattributesFile.withOutputStream { it << i } } + exec { + workingDir '.' + commandLine 'git', 'add', '--renormalize', '.' + } + return true + } + return false +} + +boolean verifySettingsGradle() { + def settingsFile = getFile("settings.gradle") + if (!settingsFile.exists()) { + println("Downloading default settings.gradle") + exampleSettingsGradleUrl().withInputStream { i -> settingsFile.withOutputStream { it << i } } + return true + } + return false } boolean performBuildScriptUpdate(String projectDir) { @@ -639,6 +710,10 @@ boolean performBuildScriptUpdate(String projectDir) { def buildscriptFile = getFile("build.gradle") availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } } out.style(Style.Success).print("Build script updated. Please REIMPORT the project or RESTART your IDE!") + boolean settingsupdated = verifySettingsGradle() + settingsupdated = verifyGitAttributes() || settingsupdated + if (settingsupdated) + throw new GradleException("Settings has been updated, please re-run task.") return true } return false @@ -658,7 +733,7 @@ boolean isNewBuildScriptVersionAvailable(String projectDir) { static String getVersionHash(String buildScriptContent) { String versionLine = buildScriptContent.find("^//version: [a-z0-9]*") - if(versionLine != null) { + if (versionLine != null) { return versionLine.split(": ").last() } return "" @@ -669,7 +744,103 @@ configure(updateBuildScript) { description = 'Updates the build script to the latest version' } -// Deobfuscation +// Parameter Deobfuscation + +task deobfParams { + doLast { + + String mcpDir = "$project.gradle.gradleUserHomeDir/caches/minecraft/de/oceanlabs/mcp/mcp_$channel/$mappingsVersion" + String mcpZIP = "$mcpDir/mcp_$channel-$mappingsVersion-${minecraftVersion}.zip" + String paramsCSV = "$mcpDir/params.csv" + + download.run { + src "https://maven.minecraftforge.net/de/oceanlabs/mcp/mcp_$channel/$mappingsVersion-$minecraftVersion/mcp_$channel-$mappingsVersion-${minecraftVersion}.zip" + dest mcpZIP + overwrite false + } + + if (!file(paramsCSV).exists()) { + println("Extracting MCP archive ...") + unzip(mcpZIP, mcpDir) + } + + println("Parsing params.csv ...") + Map params = new HashMap<>() + Files.lines(Paths.get(paramsCSV)).forEach { line -> + String[] cells = line.split(",") + if (cells.length > 2 && cells[0].matches("p_i?\\d+_\\d+_")) { + params.put(cells[0], cells[1]) + } + } + + out.style(Style.Success).println("Modified ${replaceParams(file("$projectDir/src/main/java"), params)} files!") + out.style(Style.Failure).println("Don't forget to verify that the code still works as before!\n It could be broken due to duplicate variables existing now\n or parameters taking priority over other variables.") + } +} + +static int replaceParams(File file, Map params) { + int fileCount = 0 + + if (file.isDirectory()) { + for (File f : file.listFiles()) { + fileCount += replaceParams(f, params) + } + return fileCount + } + println("Visiting ${file.getName()} ...") + try { + String content = new String(Files.readAllBytes(file.toPath())) + int hash = content.hashCode() + params.forEach { key, value -> + content = content.replaceAll(key, value) + } + if (hash != content.hashCode()) { + Files.write(file.toPath(), content.getBytes("UTF-8")) + return 1 + } + } catch (Exception e) { + e.printStackTrace() + } + return 0 +} + +// Credit: bitsnaps (https://gist.github.com/bitsnaps/00947f2dce66f4bbdabc67d7e7b33681) +static unzip(String zipFileName, String outputDir) { + byte[] buffer = new byte[16384] + ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFileName)) + ZipEntry zipEntry = zis.getNextEntry() + while (zipEntry != null) { + File newFile = new File(outputDir + File.separator, zipEntry.name) + if (zipEntry.isDirectory()) { + if (!newFile.isDirectory() && !newFile.mkdirs()) { + throw new IOException("Failed to create directory $newFile") + } + } else { + // fix for Windows-created archives + File parent = newFile.parentFile + if (!parent.isDirectory() && !parent.mkdirs()) { + throw new IOException("Failed to create directory $parent") + } + // write file content + FileOutputStream fos = new FileOutputStream(newFile) + int len = 0 + while ((len = zis.read(buffer)) > 0) { + fos.write(buffer, 0, len) + } + fos.close() + } + zipEntry = zis.getNextEntry() + } + zis.closeEntry() + zis.close() +} + +configure(deobfParams) { + group = 'forgegradle' + description = 'Rename all obfuscated parameter names inherited from Minecraft classes' +} + +// Dependency Deobfuscation def deobf(String sourceURL) { try { @@ -678,42 +849,57 @@ def deobf(String sourceURL) { //get rid of directories: int lastSlash = fileName.lastIndexOf("/") - if(lastSlash > 0) { + if (lastSlash > 0) { fileName = fileName.substring(lastSlash + 1) } //get rid of extension: - if(fileName.endsWith(".jar")) { + if (fileName.endsWith(".jar") || fileName.endsWith(".litemod")) { fileName = fileName.substring(0, fileName.lastIndexOf(".")) } String hostName = url.getHost() - if(hostName.startsWith("www.")) { + if (hostName.startsWith("www.")) { hostName = hostName.substring(4) } List parts = Arrays.asList(hostName.split("\\.")) Collections.reverse(parts) hostName = String.join(".", parts) - return deobf(sourceURL, hostName + "/" + fileName) - } catch(Exception e) { - return deobf(sourceURL, "deobf/" + String.valueOf(sourceURL.hashCode())) + return deobf(sourceURL, "$hostName/$fileName") + } catch (Exception e) { + return deobf(sourceURL, "deobf/${sourceURL.hashCode()}") } } // The method above is to be preferred. Use this method if the filename is not at the end of the URL. -def deobf(String sourceURL, String fileName) { - String cacheDir = System.getProperty("user.home") + "/.gradle/caches/" - String bon2Dir = cacheDir + "forge_gradle/deobf" - String bon2File = bon2Dir + "/BON2-2.5.0.jar" - String obfFile = cacheDir + "modules-2/files-2.1/" + fileName + ".jar" - String deobfFile = cacheDir + "modules-2/files-2.1/" + fileName + "-deobf.jar" - - if(file(deobfFile).exists()) { +def deobf(String sourceURL, String rawFileName) { + String bon2Version = "2.5.1" + String fileName = URLDecoder.decode(rawFileName, "UTF-8") + String cacheDir = "$project.gradle.gradleUserHomeDir/caches" + String bon2Dir = "$cacheDir/forge_gradle/deobf" + String bon2File = "$bon2Dir/BON2-${bon2Version}.jar" + String obfFile = "$cacheDir/modules-2/files-2.1/${fileName}.jar" + String deobfFile = "$cacheDir/modules-2/files-2.1/${fileName}-deobf.jar" + + if (file(deobfFile).exists()) { return files(deobfFile) } + String mappingsVer + String remoteMappings = project.hasProperty('remoteMappings') ? project.remoteMappings : 'https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/' + if (remoteMappings) { + String id = "${forgeVersion.split("\\.")[3]}-$minecraftVersion" + String mappingsZIP = "$cacheDir/forge_gradle/maven_downloader/de/oceanlabs/mcp/mcp_snapshot_nodoc/$id/mcp_snapshot_nodoc-${id}.zip" + + zipMappings(mappingsZIP, remoteMappings, bon2Dir) + + mappingsVer = "snapshot_$id" + } else { + mappingsVer = "${channel}_$mappingsVersion" + } + download.run { - src 'https://github.com/GTNewHorizons/BON2/releases/download/2.5.0/BON2-2.5.0.CUSTOM-all.jar' + src "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/com/github/parker8283/BON2/$bon2Version-CUSTOM/BON2-$bon2Version-CUSTOM-all.jar" dest bon2File quiet true overwrite false @@ -727,14 +913,48 @@ def deobf(String sourceURL, String fileName) { } exec { - commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', '1.7.10', '--mappingsVer', 'stable_12', '--notch' + commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', minecraftVersion, '--mappingsVer', mappingsVer, '--notch' workingDir bon2Dir - standardOutput = new ByteArrayOutputStream() + standardOutput = new FileOutputStream("${deobfFile}.log") } return files(deobfFile) } +def zipMappings(String zipPath, String url, String bon2Dir) { + File zipFile = new File(zipPath) + if (zipFile.exists()) { + return + } + + String fieldsCache = "$bon2Dir/data/fields.csv" + String methodsCache = "$bon2Dir/data/methods.csv" + + download.run { + src "${url}fields.csv" + dest fieldsCache + quiet true + } + download.run { + src "${url}methods.csv" + dest methodsCache + quiet true + } + + zipFile.getParentFile().mkdirs() + ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile)) + + zos.putNextEntry(new ZipEntry("fields.csv")) + Files.copy(Paths.get(fieldsCache), zos) + zos.closeEntry() + + zos.putNextEntry(new ZipEntry("methods.csv")) + Files.copy(Paths.get(methodsCache), zos) + zos.closeEntry() + + zos.close() +} + // Helper methods def checkPropertyExists(String propertyName) { diff --git a/dependencies.gradle b/dependencies.gradle index c953c09aa9..eeac46a0aa 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,45 +1,45 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.08:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.15:dev") compile("com.github.GTNewHorizons:StructureLib:1.1.6:dev") - compile("com.github.GTNewHorizons:TecTech:5.0.22:dev") - compile("com.github.GTNewHorizons:NotEnoughItems:2.2.22:dev") - compile("com.github.GTNewHorizons:TinkersConstruct:1.9.0.13-GTNH:dev") - compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.3:dev") - compile("com.github.GTNewHorizons:CodeChickenCore:1.1.3:dev") - compile("com.github.GTNewHorizons:Galacticraft:3.0.38-GTNH:dev") - compile("com.github.GTNewHorizons:GalacticGregGT5:1.0.7:dev") { + compile("com.github.GTNewHorizons:TecTech:5.0.32:dev") + compile("com.github.GTNewHorizons:NotEnoughItems:2.2.31-GTNH:dev") + compile("com.github.GTNewHorizons:TinkersConstruct:1.9.0-17-GTNH:dev") + compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.4:dev") + compile("com.github.GTNewHorizons:CodeChickenCore:1.1.5:dev") + compile("com.github.GTNewHorizons:Galacticraft:3.0.44-GTNH:dev") + compile("com.github.GTNewHorizons:GalacticGregGT5:1.0.8:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") - compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-94-GTNH:dev") { + compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-100-GTNH:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:AppleCore:3.1.9:dev") { + compileOnly("com.github.GTNewHorizons:AppleCore:3.2.0:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:TinkersGregworks:master-SNAPSHOT:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.5:api") { + compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.14:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:Railcraft:9.13.6:api") { + compileOnly("com.github.GTNewHorizons:Railcraft:9.13.9:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.29:api") { + compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.43:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:OpenComputers:1.7.5.21-GTNH:api") { + compileOnly("com.github.GTNewHorizons:OpenComputers:1.7.5.32-GTNH:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:BuildCraft:7.1.26:dev") { + compileOnly("com.github.GTNewHorizons:BuildCraft:7.1.27:dev") { transitive = false } - runtime("com.github.GTNewHorizons:Yamcl:0.5.82:dev") - runtime("com.github.GTNewHorizons:ironchest:6.0.69:dev") //needed for Galacticraft + runtime("com.github.GTNewHorizons:Yamcl:0.5.84:dev") + runtime("com.github.GTNewHorizons:ironchest:6.0.71:dev") //needed for Galacticraft } diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000000..93c852a12c --- /dev/null +++ b/settings.gradle @@ -0,0 +1,10 @@ +plugins { + id 'com.diffplug.blowdryerSetup' version '1.6.0' +} + +apply plugin: 'com.diffplug.blowdryerSetup' + +blowdryerSetup { + github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.1.5') + //devLocal '.' // Use this when testing config updates locally +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java index 3839d28038..679e4f9cd3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java @@ -23,6 +23,6 @@ package com.github.bartimaeusnek.bartworks.API; public class API_ConfigValues { - //One-Side-Only + // One-Side-Only public static boolean debugLog = true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java index 909489a0c6..e7696f25ed 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java @@ -33,7 +33,8 @@ public final class AcidGenFuelAdder { } public static void addLiquidFuel(FluidStack fluidStack, int burn) { - ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(fluidStack, burn); + ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)) + .addLiquidFuel(fluidStack, burn); } public static void addMoltenFuel(Materials M, int burn) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java index c8806d269b..e8e9bf1f09 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -30,18 +30,19 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.objects.GT_Fluid; import gregtech.api.util.GT_Utility; +import java.awt.*; import net.minecraft.item.EnumRarity; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.awt.*; @SuppressWarnings("ALL") public final class BioObjectAdder { -// @Deprecated -// public static BioCulture createAndRegisterBioCulture(Color color, String name, long ID, BioPlasmid plasmid, BioDNA dna, EnumRarity rarity){ -// return BioCulture.createAndRegisterBioCulture(color,name,ID,plasmid,dna,rarity); -// } + // @Deprecated + // public static BioCulture createAndRegisterBioCulture(Color color, String name, long ID, BioPlasmid plasmid, + // BioDNA dna, EnumRarity rarity){ + // return BioCulture.createAndRegisterBioCulture(color,name,ID,plasmid,dna,rarity); + // } /** * @param color the color of the Culture @@ -52,11 +53,14 @@ public final class BioObjectAdder { * @param rarity visual * @return */ - public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, EnumRarity rarity, boolean breedable) { + public static BioCulture createAndRegisterBioCulture( + Color color, String name, BioPlasmid plasmid, BioDNA dna, EnumRarity rarity, boolean breedable) { if (BioCulture.BIO_CULTURE_ARRAY_LIST.size() > 1) return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, rarity, breedable); else - new Exception("Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + new Exception( + "Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -70,11 +74,14 @@ public final class BioObjectAdder { * @param breedable if the culture can be inserted into the BacterialVat * @return */ - public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, boolean breedable) { + public static BioCulture createAndRegisterBioCulture( + Color color, String name, BioPlasmid plasmid, BioDNA dna, boolean breedable) { if (BioCulture.BIO_CULTURE_ARRAY_LIST.size() > 1) return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, breedable); else - new Exception("Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + new Exception( + "Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -90,7 +97,8 @@ public final class BioObjectAdder { public static BioData createAndRegisterBioData(String aName, EnumRarity rarity, int chance, int tier) { if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) return BioData.createAndRegisterBioData(aName, rarity, chance, tier); - new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -102,9 +110,9 @@ public final class BioObjectAdder { * @return */ public static BioDNA createAndRegisterBioDNA(String aName, EnumRarity rarity) { - if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) - return BioDNA.createAndRegisterBioDNA(aName, rarity); - new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) return BioDNA.createAndRegisterBioDNA(aName, rarity); + new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -116,9 +124,9 @@ public final class BioObjectAdder { * @return */ public static BioPlasmid createAndRegisterBioPlasmid(String aName, EnumRarity rarity) { - if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) - return BioPlasmid.createAndRegisterBioPlasmid(aName, rarity); - new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) return BioPlasmid.createAndRegisterBioPlasmid(aName, rarity); + new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -130,9 +138,9 @@ public final class BioObjectAdder { * @return */ public static BioDNA createAndRegisterBioDNA(String aName, EnumRarity rarity, int chance, int tier) { - if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) - return BioDNA.createAndRegisterBioDNA(aName, rarity, chance, tier); - new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) return BioDNA.createAndRegisterBioDNA(aName, rarity, chance, tier); + new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -146,7 +154,8 @@ public final class BioObjectAdder { public static BioPlasmid createAndRegisterBioPlasmid(String aName, EnumRarity rarity, int chance, int tier) { if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) return BioPlasmid.createAndRegisterBioPlasmid(aName, rarity, chance, tier); - new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -162,15 +171,34 @@ public final class BioObjectAdder { * If you get NPE's related to BioCultures (most likely because of Load Order or creating BioCultures after the postinit Phase) execute this. */ public static void regenerateBioFluids() { - FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L); + FluidStack dnaFluid = LoaderReference.gendustry + ? FluidRegistry.getFluidStack("liquiddna", 100) + : Materials.Biomass.getFluid(100L); for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.getFluidNotSet()) { - B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()})); + B.setFluid(new GT_Fluid( + B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[] { + (short) B.getColor().getRed(), + (short) B.getColor().getBlue(), + (short) B.getColor().getGreen() + })); if (!FluidRegistry.registerFluid(B.getFluid())) new Exception("FAILED TO REGISTER FLUID FOR: " + B.getName()).printStackTrace(); - GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(10),GT_Values.NI,new FluidStack(B.getFluid(),1000),dnaFluid,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,null,500,120); + GT_Values.RA.addCentrifugeRecipe( + GT_Utility.getIntegratedCircuit(10), + GT_Values.NI, + new FluidStack(B.getFluid(), 1000), + dnaFluid, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 500, + 120); } } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java index 11ebdccb3d..145f762e30 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java @@ -27,11 +27,10 @@ import com.github.bartimaeusnek.bartworks.util.BioCulture; import com.github.bartimaeusnek.bartworks.util.BioDNA; import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; +import java.util.Collection; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import java.util.Collection; - @SuppressWarnings("ALL") public final class BioObjectGetter { @@ -83,7 +82,7 @@ public final class BioObjectGetter { return BioObjectGetter.convertDataToDNA(BioObjectGetter.convertBioPlasmidToData(bioPlasmid)); } - //UNSAFE needs to be reworked! + // UNSAFE needs to be reworked! public static Collection getAllPetriDishes() { return BioItemList.getAllPetriDishes(); @@ -121,5 +120,4 @@ public final class BioObjectGetter { public static ItemStack getOther(int selection) { return BioItemList.getOther(selection); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java index 7fb06e019e..7a355b332d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java @@ -25,11 +25,10 @@ package com.github.bartimaeusnek.bartworks.API; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BioCulture; import gregtech.api.enums.Materials; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - import javax.annotation.Nonnegative; import javax.annotation.Nonnull; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; @SuppressWarnings("ALL") public final class BioRecipeAdder { @@ -38,8 +37,18 @@ public final class BioRecipeAdder { public static final int LOWGRAVITY = -100; public static final int CLEANROOM = -200; - public static boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return BWRecipes.instance.addBioLabRecipe(aInputs, aOutput, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + public static boolean addBioLabRecipe( + ItemStack[] aInputs, + ItemStack aOutput, + ItemStack aSpecialItems, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return BWRecipes.instance.addBioLabRecipe( + aInputs, aOutput, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); } /** @@ -54,8 +63,16 @@ public final class BioRecipeAdder { * @param aSpecialValue 0 = STANDART, -100 = LowGravity, -200 = Cleanroom * @return if the recipe was added. */ - public static boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { - return BWRecipes.instance.addBioLabRecipeIncubation(aInput, aOutput, aChances, aFluidInputs, aDuration, aEUt, aSpecialValue); + public static boolean addBioLabRecipeIncubation( + ItemStack aInput, + BioCulture aOutput, + int[] aChances, + FluidStack aFluidInputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return BWRecipes.instance.addBioLabRecipeIncubation( + aInput, aOutput, aChances, aFluidInputs, aDuration, aEUt, aSpecialValue); } /** @@ -71,8 +88,19 @@ public final class BioRecipeAdder { * @param exactSv if the recipe needs EXACTLY the Sv or can use less... * @return */ - public static boolean addBacterialVatRecipe(ItemStack[] aInputs, @Nonnull BioCulture aCulture, @Nonnull FluidStack[] aFluidInputs, @Nonnull FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, int Sv, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { - return BWRecipes.instance.addBacterialVatRecipe(aInputs, aCulture, aFluidInputs, aFluidOutputs, aDuration, aEUt, Sv, glasTier, aSpecialValue, exactSv); + public static boolean addBacterialVatRecipe( + ItemStack[] aInputs, + @Nonnull BioCulture aCulture, + @Nonnull FluidStack[] aFluidInputs, + @Nonnull FluidStack[] aFluidOutputs, + @Nonnegative int aDuration, + @Nonnegative int aEUt, + int Sv, + @Nonnegative int glasTier, + int aSpecialValue, + boolean exactSv) { + return BWRecipes.instance.addBacterialVatRecipe( + aInputs, aCulture, aFluidInputs, aFluidOutputs, aDuration, aEUt, Sv, glasTier, aSpecialValue, exactSv); } /** @@ -88,38 +116,69 @@ public final class BioRecipeAdder { * @param exactSv if the recipe needs EXACTLY the Sv or can use less... * @return */ - public static boolean addBacterialVatRecipe(ItemStack[] aInputs, @Nonnull BioCulture aCulture, @Nonnull FluidStack[] aFluidInputs, @Nonnull FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, Materials material, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { - return BWRecipes.instance.addBacterialVatRecipe(aInputs, aCulture, aFluidInputs, aFluidOutputs, aDuration, aEUt, material, glasTier, aSpecialValue, exactSv); + public static boolean addBacterialVatRecipe( + ItemStack[] aInputs, + @Nonnull BioCulture aCulture, + @Nonnull FluidStack[] aFluidInputs, + @Nonnull FluidStack[] aFluidOutputs, + @Nonnegative int aDuration, + @Nonnegative int aEUt, + Materials material, + @Nonnegative int glasTier, + int aSpecialValue, + boolean exactSv) { + return BWRecipes.instance.addBacterialVatRecipe( + aInputs, + aCulture, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + material, + glasTier, + aSpecialValue, + exactSv); } -// public static boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSievert) { -// return BWRecipes.instance.addBacterialVatRecipe(aInputs, aOutputs, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert); -// } - -// @Deprecated -// public static boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ -// return BWRecipes.instance.addBioLabRecipeDNAExtraction(aInputs, aOutput, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); -// } -// -// @Deprecated -// public static boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ -// return BWRecipes.instance.addBioLabRecipePCRThermoclycling(aInputs, aOutput, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); -// } -// -// @Deprecated -// public static boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ -// return BWRecipes.instance.addBioLabRecipePlasmidSynthesis(aInputs, aOutput, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); -// } -// -// @Deprecated -// public static boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ -// return BWRecipes.instance.addBioLabRecipeTransformation(aInputs, aOutput, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); -// } -// -// @Deprecated -// public static boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ -// return BWRecipes.instance.addBioLabRecipeClonalCellularSynthesis(aInputs, aOutput, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); -// } + // public static boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] + // aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSievert) { + // return BWRecipes.instance.addBacterialVatRecipe(aInputs, aOutputs, aFluidInputs, aFluidOutputs, aDuration, + // aEUt, aSievert); + // } + // @Deprecated + // public static boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, + // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ + // return BWRecipes.instance.addBioLabRecipeDNAExtraction(aInputs, aOutput, aChances, aFluidInputs, + // aFluidOutputs, aDuration, aEUt, aSpecialValue); + // } + // + // @Deprecated + // public static boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, + // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ + // return BWRecipes.instance.addBioLabRecipePCRThermoclycling(aInputs, aOutput, aChances, aFluidInputs, + // aFluidOutputs, aDuration, aEUt, aSpecialValue); + // } + // + // @Deprecated + // public static boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, + // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ + // return BWRecipes.instance.addBioLabRecipePlasmidSynthesis(aInputs, aOutput, aChances, aFluidInputs, + // aFluidOutputs, aDuration, aEUt, aSpecialValue); + // } + // + // @Deprecated + // public static boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, + // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ + // return BWRecipes.instance.addBioLabRecipeTransformation(aInputs, aOutput, aChances, aFluidInputs, + // aFluidOutputs, aDuration, aEUt, aSpecialValue); + // } + // + // @Deprecated + // public static boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] + // aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ + // return BWRecipes.instance.addBioLabRecipeClonalCellularSynthesis(aInputs, aOutput, aChances, aFluidInputs, + // aFluidOutputs, aDuration, aEUt, aSpecialValue); + // } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java index 36d4e04503..e850e4135b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -22,27 +22,25 @@ package com.github.bartimaeusnek.bartworks.API; +import static cpw.mods.fml.common.registry.GameRegistry.findBlock; + import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.util.GT_ModHandler; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; - -import javax.annotation.Nonnegative; -import javax.annotation.Nonnull; import java.util.HashMap; import java.util.HashSet; import java.util.Objects; - -import static cpw.mods.fml.common.registry.GameRegistry.findBlock; +import javax.annotation.Nonnegative; +import javax.annotation.Nonnull; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; @SuppressWarnings("ALL") public final class BioVatLogicAdder { - public static class RadioHatch { public static void runBasicItemIntegration() { @@ -62,9 +60,12 @@ public final class BioVatLogicAdder { giveItemStackRadioHatchAbilites(ItemList.Uraniumcell_2.get(1), Materials.Uranium, 6); giveItemStackRadioHatchAbilites(ItemList.Uraniumcell_4.get(1), Materials.Uranium, 12); - giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TiberiumCell_1.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 3); - giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TiberiumCell_2.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 6); - giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TiberiumCell_4.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 12); + giveItemStackRadioHatchAbilites( + BW_NonMeta_MaterialItems.TiberiumCell_1.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 3); + giveItemStackRadioHatchAbilites( + BW_NonMeta_MaterialItems.TiberiumCell_2.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 6); + giveItemStackRadioHatchAbilites( + BW_NonMeta_MaterialItems.TiberiumCell_4.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 12); giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TheCoreCell.get(1), Materials.Naquadah, 96); @@ -76,19 +77,38 @@ public final class BioVatLogicAdder { giveItemStackRadioHatchAbilites(ItemList.Depleted_Naquadah_2.get(1), Materials.Naquadah, 6, 10); giveItemStackRadioHatchAbilites(ItemList.Depleted_Naquadah_4.get(1), Materials.Naquadah, 12, 10); - giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorMOXSimpledepleted",1), Materials.Plutonium, 3, 10); - giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorMOXDualdepleted",1), Materials.Plutonium, 6, 10); - giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorMOXQuaddepleted",1), Materials.Plutonium, 12, 10); - - giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorUraniumSimpledepleted",1), Materials.Uranium, 3, 10); - giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorUraniumDualdepleted",1), Materials.Uranium, 6, 10); - giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorUraniumQuaddepleted",1), Materials.Uranium, 12, 10); - - giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 3, 10); - giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 6, 10); - giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 12, 10); - - giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), Materials.Naquadah, 96, 10); + giveItemStackRadioHatchAbilites( + GT_ModHandler.getModItem("IC2", "reactorMOXSimpledepleted", 1), Materials.Plutonium, 3, 10); + giveItemStackRadioHatchAbilites( + GT_ModHandler.getModItem("IC2", "reactorMOXDualdepleted", 1), Materials.Plutonium, 6, 10); + giveItemStackRadioHatchAbilites( + GT_ModHandler.getModItem("IC2", "reactorMOXQuaddepleted", 1), Materials.Plutonium, 12, 10); + + giveItemStackRadioHatchAbilites( + GT_ModHandler.getModItem("IC2", "reactorUraniumSimpledepleted", 1), Materials.Uranium, 3, 10); + giveItemStackRadioHatchAbilites( + GT_ModHandler.getModItem("IC2", "reactorUraniumDualdepleted", 1), Materials.Uranium, 6, 10); + giveItemStackRadioHatchAbilites( + GT_ModHandler.getModItem("IC2", "reactorUraniumQuaddepleted", 1), Materials.Uranium, 12, 10); + + giveItemStackRadioHatchAbilites( + BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), + WerkstoffLoader.Tiberium.getBridgeMaterial(), + 3, + 10); + giveItemStackRadioHatchAbilites( + BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), + WerkstoffLoader.Tiberium.getBridgeMaterial(), + 6, + 10); + giveItemStackRadioHatchAbilites( + BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), + WerkstoffLoader.Tiberium.getBridgeMaterial(), + 12, + 10); + + giveItemStackRadioHatchAbilites( + BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), Materials.Naquadah, 96, 10); if (WerkstoffLoader.gtnhGT) { giveItemStackRadioHatchAbilites(ItemList.MNqCell_1.get(1), Materials.Naquadria, 3); @@ -158,16 +178,13 @@ public final class BioVatLogicAdder { public static int getMaxSv() { int ret = MaxSV; for (MaterialSvPair pair : RadioHatch.getMaSv()) { - if (pair.getSievert() > ret) - ret = pair.getSievert(); + if (pair.getSievert() > ret) ret = pair.getSievert(); } for (ItemStack is : RadioHatch.IsSv.keySet()) { - if (RadioHatch.IsSv.get(is) > ret) - ret = RadioHatch.IsSv.get(is); + if (RadioHatch.IsSv.get(is) > ret) ret = RadioHatch.IsSv.get(is); } return ret; } - } public static class BioVatGlass { @@ -184,10 +201,11 @@ public final class BioVatLogicAdder { public static boolean addCustomGlass(String sModname, String sUnlocBlockName, int meta, int tier) { Block block = findBlock(sModname, sUnlocBlockName); boolean ret = block != null; - if (ret) - BioVatGlass.glasses.put(new BlockMetaPair(block, (byte) meta), (byte) tier); + if (ret) BioVatGlass.glasses.put(new BlockMetaPair(block, (byte) meta), (byte) tier); else - new IllegalArgumentException("Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!").printStackTrace(); + new IllegalArgumentException( + "Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!") + .printStackTrace(); block = null; return ret; } @@ -236,8 +254,8 @@ public final class BioVatLogicAdder { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; BioVatLogicAdder.MaterialSvPair that = (BioVatLogicAdder.MaterialSvPair) o; - return Objects.equals(this.getMaterials(), that.getMaterials()) && - Objects.equals(this.getSievert(), that.getSievert()); + return Objects.equals(this.getMaterials(), that.getMaterials()) + && Objects.equals(this.getSievert(), that.getSievert()); } @Override @@ -252,8 +270,6 @@ public final class BioVatLogicAdder { public Integer getSievert() { return this.sievert; } - - } public static class BlockMetaPair { @@ -270,8 +286,7 @@ public final class BioVatLogicAdder { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; BioVatLogicAdder.BlockMetaPair that = (BioVatLogicAdder.BlockMetaPair) o; - return Objects.equals(this.getBlock(), that.getBlock()) && - Objects.equals(this.getaByte(), that.getaByte()); + return Objects.equals(this.getBlock(), that.getBlock()) && Objects.equals(this.getaByte(), that.getaByte()); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java index 178ab6f475..27d6f30e0c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java @@ -1,17 +1,16 @@ package com.github.bartimaeusnek.bartworks.API; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; + import com.gtnewhorizon.structurelib.structure.IStructureElement; import cpw.mods.fml.common.registry.GameRegistry; -import net.minecraft.block.Block; -import org.apache.commons.lang3.tuple.Pair; - import java.util.ArrayList; import java.util.List; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Collectors; - -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import net.minecraft.block.Block; +import org.apache.commons.lang3.tuple.Pair; /** * API for bartworks borosilicate glass. @@ -27,8 +26,7 @@ public class BorosilicateGlass { private static List> representatives; private static Block getGlassBlock() { - if (block == null) - block = GameRegistry.findBlock("bartworks", "BW_GlasBlocks"); + if (block == null) block = GameRegistry.findBlock("bartworks", "BW_GlasBlocks"); return block; } @@ -91,8 +89,10 @@ public class BorosilicateGlass { * * @param initialValue the value set before structure check started */ - public static IStructureElement ofBoroGlass(byte initialValue, BiConsumer setter, Function getter) { - return lazy(t -> ofBlocksTiered(BorosilicateGlass::getTier, getRepresentatives(), initialValue, setter, getter)); + public static IStructureElement ofBoroGlass( + byte initialValue, BiConsumer setter, Function getter) { + return lazy( + t -> ofBlocksTiered(BorosilicateGlass::getTier, getRepresentatives(), initialValue, setter, getter)); } /** @@ -102,15 +102,18 @@ public class BorosilicateGlass { * @param minTier minimal accepted tier. inclusive. must be greater than 0. * @param maxTier maximal accepted tier. inclusive. */ - public static IStructureElement ofBoroGlass(byte initialValue, byte minTier, byte maxTier, BiConsumer setter, Function getter) { + public static IStructureElement ofBoroGlass( + byte initialValue, byte minTier, byte maxTier, BiConsumer setter, Function getter) { if (minTier > maxTier || minTier < 0) throw new IllegalArgumentException(); return lazy(t -> ofBlocksTiered( (block1, meta) -> checkWithinBound(getTier(block1, meta), minTier, maxTier), - getRepresentatives().stream().skip(Math.max(minTier - 3, 0)).limit(maxTier - minTier + 1).collect(Collectors.toList()), + getRepresentatives().stream() + .skip(Math.max(minTier - 3, 0)) + .limit(maxTier - minTier + 1) + .collect(Collectors.toList()), initialValue, setter, - getter - )); + getter)); } /** diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java index 96a075d9c7..61ce6d2c8a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java @@ -24,10 +24,15 @@ package com.github.bartimaeusnek.bartworks.API; public interface INoiseGen { - double getNoise(int x, int z); - double[][] getNoiseForRegion(int xStart, int zStart, int xEnd, int zEnd); - void setOctaves(int octaves); - void setFrequency(double freq); - void setSeed(long seed); - void setAmplitude(double amplitude); + double getNoise(int x, int z); + + double[][] getNoiseForRegion(int xStart, int zStart, int xEnd, int zEnd); + + void setOctaves(int octaves); + + void setFrequency(double freq); + + void setSeed(long seed); + + void setAmplitude(double amplitude); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java index c10f7ffb39..22403b5cc1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java @@ -25,8 +25,7 @@ package com.github.bartimaeusnek.bartworks.API; import net.minecraft.inventory.ISidedInventory; public interface ITileDropsContent extends ISidedInventory { - default int[] getDropSlots(){ + default int[] getDropSlots() { return new int[] {0}; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java index 369a403dc1..473908c7a3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java @@ -28,7 +28,6 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; import net.minecraftforge.common.util.ForgeDirection; - public interface ITileHasDifferentTextureSides { IIcon[] texture = new IIcon[7]; @@ -45,5 +44,4 @@ public interface ITileHasDifferentTextureSides { @SideOnly(Side.CLIENT) void registerBlockIcons(IIconRegister par1IconRegister); - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java index 1318cb919f..38b762fa9a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java @@ -42,7 +42,13 @@ public interface ITileWithGUI { */ default boolean openGUI(TileEntity tileEntity, EntityPlayer player) { if (!tileEntity.getWorldObj().isRemote) - player.openGui(MainMod.MOD_ID, getGUIID(), tileEntity.getWorldObj(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); + player.openGui( + MainMod.MOD_ID, + getGUIID(), + tileEntity.getWorldObj(), + tileEntity.xCoord, + tileEntity.yCoord, + tileEntity.zCoord); return true; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java index 09ba5e6dfd..14c56e7ad9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java @@ -28,7 +28,7 @@ import cpw.mods.fml.common.Loader; * DO NOT CALL THIS IN THE CORE MOD! IT WILL __NOT__ WORK AND FUCK EVERYTHING UP! */ public class LoaderReference { - private LoaderReference(){} + private LoaderReference() {} public static boolean Natura; public static boolean RandomThings; @@ -60,7 +60,6 @@ public class LoaderReference { public static boolean ProjRedIllumination; public static boolean Botania; - public static void init() { Natura = Loader.isModLoaded("Natura"); RandomThings = Loader.isModLoaded("RandomThings"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java index 8a753938bf..a11e0c4a03 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java @@ -27,11 +27,16 @@ import cpw.mods.fml.common.FMLCommonHandler; public class SideReference { public static class EffectiveSide { - public static final boolean Server = FMLCommonHandler.instance().getEffectiveSide().isServer(); - public static final boolean Client = FMLCommonHandler.instance().getEffectiveSide().isClient(); + public static final boolean Server = + FMLCommonHandler.instance().getEffectiveSide().isServer(); + public static final boolean Client = + FMLCommonHandler.instance().getEffectiveSide().isClient(); } + public static class Side { - public static final boolean Server = FMLCommonHandler.instance().getSide().isServer(); - public static final boolean Client = FMLCommonHandler.instance().getSide().isClient(); + public static final boolean Server = + FMLCommonHandler.instance().getSide().isServer(); + public static final boolean Client = + FMLCommonHandler.instance().getSide().isClient(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java index 468885d454..29b84ae5ca 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java @@ -23,24 +23,25 @@ package com.github.bartimaeusnek.bartworks.API; import gregtech.api.interfaces.ISubTagContainer; - import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class VoidMinerDropAdder { - private static Method getExtraDropsDimMap; + private static Method getExtraDropsDimMap; - static { - try { - getExtraDropsDimMap = Class.forName("com.github.bartimaeusnek.crossmod.galacticgreg.GT_TileEntity_VoidMiner_Base").getMethod("addMatierialToDimensionList",int.class, ISubTagContainer.class, float.class); - } catch (NoSuchMethodException | ClassNotFoundException e) { - e.printStackTrace(); - } - } + static { + try { + getExtraDropsDimMap = Class.forName( + "com.github.bartimaeusnek.crossmod.galacticgreg.GT_TileEntity_VoidMiner_Base") + .getMethod("addMatierialToDimensionList", int.class, ISubTagContainer.class, float.class); + } catch (NoSuchMethodException | ClassNotFoundException e) { + e.printStackTrace(); + } + } - public static void addDropsToDim(int dimID, ISubTagContainer material, float chance) throws InvocationTargetException, IllegalAccessException { + public static void addDropsToDim(int dimID, ISubTagContainer material, float chance) + throws InvocationTargetException, IllegalAccessException { getExtraDropsDimMap.invoke(null, dimID, material, chance); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java index bb3400512c..f8079ff6ff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java @@ -40,5 +40,4 @@ public final class WerkstoffAPI { public static Werkstoff getWerkstoff(String aName) throws NoSuchFieldException, IllegalAccessException { return (Werkstoff) w.getField(aName).get(null); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java index 9eabdee449..577e9621ff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java @@ -28,15 +28,13 @@ public final class WerkstoffAdderRegistry { private static final HashSet toRun = new HashSet<>(); - private WerkstoffAdderRegistry() { - } + private WerkstoffAdderRegistry() {} public static void addWerkstoffAdder(Runnable adder) { toRun.add(adder); } public static void run() { - for (Runnable r : toRun) - r.run(); + for (Runnable r : toRun) r.run(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java index 78f721e950..7dabe8be07 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java @@ -22,4 +22,4 @@ @API(owner = "bartworks", apiVersion = API_REFERENCE.VERSION, provides = "bartworks API") package com.github.bartimaeusnek.bartworks.API; -import cpw.mods.fml.common.API; \ No newline at end of file +import cpw.mods.fml.common.API; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/ASMUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/ASMUtils.java index 48a8f49d5c..5f618c6955 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/ASMUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/ASMUtils.java @@ -22,19 +22,17 @@ package com.github.bartimaeusnek.bartworks.ASM; -import org.objectweb.asm.tree.MethodNode; - import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; +import org.objectweb.asm.tree.MethodNode; public class ASMUtils { public static String matchAny(String toCompare, String... args) { for (String arg : args) { - if (toCompare.equalsIgnoreCase(arg)) - return arg; + if (toCompare.equalsIgnoreCase(arg)) return arg; } return ""; } @@ -44,16 +42,15 @@ public class ASMUtils { */ public static boolean isCorrectMethod(MethodNode methodNode, String... args) { for (String arg : args) { - if (methodNode.name.equalsIgnoreCase(arg) || methodNode.desc.equalsIgnoreCase(arg)) - return true; + if (methodNode.name.equalsIgnoreCase(arg) || methodNode.desc.equalsIgnoreCase(arg)) return true; } return false; } public static boolean writeClassToDisk(byte[] towrite, String Classname, String Path) { try { - if (Path.charAt(Path.length()-1) == '/' || Path.charAt(Path.length()-1) == '\\') - Path = Path.substring(0,Path.length()-1); + if (Path.charAt(Path.length() - 1) == '/' || Path.charAt(Path.length() - 1) == '\\') + Path = Path.substring(0, Path.length() - 1); OutputStream os = new FileOutputStream(new File(Path + '/' + Classname + ".class")); os.write(towrite); } catch (IOException e) { @@ -62,5 +59,4 @@ public class ASMUtils { } return true; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java index e97de8cf21..f4251f2cd5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.ASM; +import static com.github.bartimaeusnek.bartworks.ASM.BWCoreTransformer.shouldTransform; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; @@ -33,13 +35,10 @@ import cpw.mods.fml.common.ModMetadata; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.versioning.ArtifactVersion; import cpw.mods.fml.common.versioning.DefaultArtifactVersion; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - import java.util.ArrayList; import java.util.List; - -import static com.github.bartimaeusnek.bartworks.ASM.BWCoreTransformer.shouldTransform; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; @SuppressWarnings("ALL") public class BWCore extends DummyModContainer { @@ -65,7 +64,7 @@ public class BWCore extends DummyModContainer { shouldTransform[4] = true; shouldTransform[5] = ConfigHandler.enabledPatches[5]; shouldTransform[6] = ConfigHandler.enabledPatches[6]; - //shouldTransform[6] = true; + // shouldTransform[6] = true; BWCore.BWCORE_LOG.info("Extra Utilities found and ASM Patch enabled? " + shouldTransform[0]); BWCore.BWCORE_LOG.info("Thaumcraft found and ASM Patch enabled? " + shouldTransform[3]); BWCore.BWCORE_LOG.info("RWG found and ASM Patch enabled? " + shouldTransform[5]); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java index 37a64add7c..9f68bfd1c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java @@ -25,13 +25,12 @@ package com.github.bartimaeusnek.bartworks.ASM; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import cpw.mods.fml.relauncher.FMLInjectionData; import cpw.mods.fml.relauncher.IFMLLoadingPlugin; -import net.minecraftforge.common.config.Configuration; - import java.io.File; import java.util.ArrayList; import java.util.Map; +import net.minecraftforge.common.config.Configuration; -@IFMLLoadingPlugin.SortingIndex(Integer.MAX_VALUE)//Load as late as possible (after fastcraft/OptiFine). +@IFMLLoadingPlugin.SortingIndex(Integer.MAX_VALUE) // Load as late as possible (after fastcraft/OptiFine). @IFMLLoadingPlugin.MCVersion("1.7.10") @IFMLLoadingPlugin.TransformerExclusions("com.github.bartimaeusnek.bartworks.ASM") @IFMLLoadingPlugin.Name(BWCorePlugin.BWCORE_PLUGIN_NAME) @@ -42,18 +41,17 @@ public class BWCorePlugin implements IFMLLoadingPlugin { public static File minecraftDir; public BWCorePlugin() { - //Injection Code taken from CodeChickenLib - if (BWCorePlugin.minecraftDir != null) - return;//get called twice, once for IFMLCallHook + // Injection Code taken from CodeChickenLib + if (BWCorePlugin.minecraftDir != null) return; // get called twice, once for IFMLCallHook BWCorePlugin.minecraftDir = (File) FMLInjectionData.data()[6]; - //do all the configuration already now... + // do all the configuration already now... new ConfigHandler(new Configuration(new File(new File(BWCorePlugin.minecraftDir, "config"), "bartworks.cfg"))); BWCoreTransformer.shouldTransform[2] = false; } @Override public String[] getASMTransformerClass() { - return new String[]{BWCoreTransformer.class.getName()}; + return new String[] {BWCoreTransformer.class.getName()}; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java index e4b14820c7..04932c3281 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java @@ -25,6 +25,9 @@ package com.github.bartimaeusnek.bartworks.ASM; import com.github.bartimaeusnek.bartworks.util.NonNullWrappedHashSet; import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriorityList; import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriorityListNode; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -32,12 +35,9 @@ import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - public class BWCoreStaticReplacementMethodes { - private static ThreadLocal> RECENTLYUSEDRECIPES = ThreadLocal.withInitial(AccessPriorityList::new); + private static ThreadLocal> RECENTLYUSEDRECIPES = + ThreadLocal.withInitial(AccessPriorityList::new); public static void clearRecentlyUsedRecipes() { // the easiest way to ensure the cache is flushed without causing synchronization overhead @@ -52,31 +52,30 @@ public class BWCoreStaticReplacementMethodes { ItemStack itemstack1 = null; int j; - for (j = 0; j < inventoryCrafting.getSizeInventory(); ++j) - { + for (j = 0; j < inventoryCrafting.getSizeInventory(); ++j) { ItemStack itemstack2 = inventoryCrafting.getStackInSlot(j); - if (itemstack2 != null) - { - if (i == 0) - itemstack = itemstack2; + if (itemstack2 != null) { + if (i == 0) itemstack = itemstack2; - if (i == 1) - itemstack1 = itemstack2; + if (i == 1) itemstack1 = itemstack2; ++i; } } - if (i == 2 && itemstack.getItem() == itemstack1.getItem() && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && itemstack.getItem().isRepairable()) { + if (i == 2 + && itemstack.getItem() == itemstack1.getItem() + && itemstack.stackSize == 1 + && itemstack1.stackSize == 1 + && itemstack.getItem().isRepairable()) { Item item = itemstack.getItem(); int j1 = item.getMaxDamage() - itemstack.getItemDamageForDisplay(); int k = item.getMaxDamage() - itemstack1.getItemDamageForDisplay(); int l = j1 + k + item.getMaxDamage() * 5 / 100; int i1 = item.getMaxDamage() - l; - if (i1 < 0) - i1 = 0; + if (i1 < 0) i1 = 0; return new ItemStack(itemstack.getItem(), 1, i1); @@ -90,8 +89,7 @@ public class BWCoreStaticReplacementMethodes { AccessPriorityListNode recipeNode = it.next(); iPossibleRecipe = recipeNode.getELEMENT(); - if (!iPossibleRecipe.matches(inventoryCrafting, world)) - continue; + if (!iPossibleRecipe.matches(inventoryCrafting, world)) continue; cache.addPrioToNode(recipeNode); return iPossibleRecipe.getCraftingResult(inventoryCrafting); @@ -104,29 +102,23 @@ public class BWCoreStaticReplacementMethodes { for (int k = 0; k < recipeList.size(); k++) { IRecipe r = (IRecipe) recipeList.get(k); - if (r.matches(inventoryCrafting, world)) - recipeSet.add(r); + if (r.matches(inventoryCrafting, world)) recipeSet.add(r); } Object[] arr = recipeSet.toArray(); - if (arr.length == 0) - return null; + if (arr.length == 0) return null; IRecipe recipe = (IRecipe) arr[0]; stack = recipe.getCraftingResult(inventoryCrafting); - if (arr.length != 1) - return stack; + if (arr.length != 1) return stack; - if (stack != null) - cache.addLast(recipe); + if (stack != null) cache.addLast(recipe); return stack; } } - private BWCoreStaticReplacementMethodes() { - } - -} \ No newline at end of file + private BWCoreStaticReplacementMethodes() {} +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java index 223a067ce6..5fdace3319 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java @@ -22,36 +22,35 @@ package com.github.bartimaeusnek.bartworks.ASM; +import static org.objectweb.asm.Opcodes.*; + +import java.util.Arrays; +import java.util.List; import net.minecraft.launchwrapper.IClassTransformer; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.tree.*; -import java.util.Arrays; -import java.util.List; - -import static org.objectweb.asm.Opcodes.*; - public class BWCoreTransformer implements IClassTransformer { public static final String[] DESCRIPTIONFORCONFIG = { - "REMOVING RAIN FROM LAST MILLENIUM (EXU)", - "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", - "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS", - "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", - "PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API", - "DUCTTAPING RWG WORLDEN FAILS", - "PATCHING CRAFTING MANAGER FOR CACHING RECIPES" - // "REMOVING 12% BONUS OUTPUTS FROM GT++ SIFTER" + "REMOVING RAIN FROM LAST MILLENIUM (EXU)", + "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", + "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS", + "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", + "PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API", + "DUCTTAPING RWG WORLDEN FAILS", + "PATCHING CRAFTING MANAGER FOR CACHING RECIPES" + // "REMOVING 12% BONUS OUTPUTS FROM GT++ SIFTER" }; public static final String[] CLASSESBEEINGTRANSFORMED = { - "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", - "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", - "net.minecraft.client.renderer.RenderGlobal", - "thaumcraft.common.tiles.TileWandPedestal", - "gregtech.GT_Mod", - "rwg.world.ChunkGeneratorRealistic", - "net.minecraft.item.crafting.CraftingManager" - // "gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialSifter" + "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", + "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", + "net.minecraft.client.renderer.RenderGlobal", + "thaumcraft.common.tiles.TileWandPedestal", + "gregtech.GT_Mod", + "rwg.world.ChunkGeneratorRealistic", + "net.minecraft.item.crafting.CraftingManager" + // "gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialSifter" }; static boolean obfs; @@ -71,8 +70,17 @@ public class BWCoreTransformer implements IClassTransformer { AbstractInsnNode beginning = method.instructions.get(j - 7); LabelNode label = new LabelNode(); nu.insertBefore(beginning, new VarInsnNode(ALOAD, 0)); - nu.insertBefore(beginning, new FieldInsnNode(GETFIELD, "thaumcraft/common/tiles/TileWandPedestal", obfs ? "field_145850_b" : "worldObj", "Lnet/minecraft/world/World;")); - nu.insertBefore(beginning, new FieldInsnNode(GETFIELD, "net/minecraft/world/World", obfs ? "field_72995_K" : "isRemote", "Z")); + nu.insertBefore( + beginning, + new FieldInsnNode( + GETFIELD, + "thaumcraft/common/tiles/TileWandPedestal", + obfs ? "field_145850_b" : "worldObj", + "Lnet/minecraft/world/World;")); + nu.insertBefore( + beginning, + new FieldInsnNode( + GETFIELD, "net/minecraft/world/World", obfs ? "field_72995_K" : "isRemote", "Z")); nu.insertBefore(beginning, new JumpInsnNode(IFNE, label)); nu.add(new InsnNode(POP)); nu.add(label); @@ -86,7 +94,8 @@ public class BWCoreTransformer implements IClassTransformer { public static byte[] transform(int id, byte[] basicClass) { if (!BWCoreTransformer.shouldTransform[id]) { - BWCore.BWCORE_LOG.info("Patch: " + BWCoreTransformer.DESCRIPTIONFORCONFIG[id] + " is disabled, will not patch!"); + BWCore.BWCORE_LOG.info( + "Patch: " + BWCoreTransformer.DESCRIPTIONFORCONFIG[id] + " is disabled, will not patch!"); return basicClass; } @@ -112,11 +121,8 @@ public class BWCoreTransformer implements IClassTransformer { } } BWCore.BWCORE_LOG.info("Creating new " + name_deObfs + "!"); - MethodNode nu = new MethodNode(ACC_PUBLIC, name_deObfs, - /*obfs ? dsc_Obfs :*/ dsc_deObfs, - null, - new String[0] - ); + MethodNode nu = new MethodNode( + ACC_PUBLIC, name_deObfs, /*obfs ? dsc_Obfs :*/ dsc_deObfs, null, new String[0]); InsnList insnList = new InsnList(); insnList.add(new InsnNode(ICONST_0)); insnList.add(new InsnNode(IRETURN)); @@ -135,7 +141,8 @@ public class BWCoreTransformer implements IClassTransformer { String dsc_Obfs = "(Lsx;III)Ljava/util/List;"; for (int i = 0; i < methods.size(); i++) { - if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_deObfs, dsc_Obfs)) { + if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) + && ASMUtils.isCorrectMethod(methods.get(i), dsc_deObfs, dsc_Obfs)) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); MethodNode toPatch = methods.get(i); InsnList insnList = new InsnList(); @@ -158,7 +165,8 @@ public class BWCoreTransformer implements IClassTransformer { String field_src = "field_110928_i"; BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); for (MethodNode toPatch : methods) { - if (ASMUtils.isCorrectMethod(toPatch, name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(toPatch, dsc_universal)) { + if (ASMUtils.isCorrectMethod(toPatch, name_deObfs, name_Obfs, name_src) + && ASMUtils.isCorrectMethod(toPatch, dsc_universal)) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); InsnList nu = new InsnList(); LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; @@ -170,35 +178,95 @@ public class BWCoreTransformer implements IClassTransformer { String nameFieldToPatch; for (int j = 0; j < toPatch.instructions.size(); j++) { - if (toPatch.instructions.get(j) instanceof FieldInsnNode && toPatch.instructions.get(j).getOpcode() == GETSTATIC && !(nameFieldToPatch = ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j)).name, field_deObfs, field_src)).isEmpty()) { + if (toPatch.instructions.get(j) instanceof FieldInsnNode + && toPatch.instructions.get(j).getOpcode() == GETSTATIC + && !(nameFieldToPatch = ASMUtils.matchAny( + ((FieldInsnNode) toPatch.instructions.get(j)).name, + field_deObfs, + field_src)) + .isEmpty()) { boolean useSrc = nameFieldToPatch.equals(field_src); if (useSrc) - BWCore.BWCORE_LOG.info("Found either Optifine or Fastcraft... this patch was annoying to make compatible to them..."); + BWCore.BWCORE_LOG.info( + "Found either Optifine or Fastcraft... this patch was annoying to make compatible to them..."); nu.add(new VarInsnNode(ALOAD, 0)); - nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? theWorld_src : "theWorld", "Lnet/minecraft/client/multiplayer/WorldClient;")); - nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/multiplayer/WorldClient", useSrc ? provider_src : "provider", "Lnet/minecraft/world/WorldProvider;")); - nu.add(new TypeInsnNode(INSTANCEOF, "com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace")); + nu.add(new FieldInsnNode( + GETFIELD, + "net/minecraft/client/renderer/RenderGlobal", + useSrc ? theWorld_src : "theWorld", + "Lnet/minecraft/client/multiplayer/WorldClient;")); + nu.add(new FieldInsnNode( + GETFIELD, + "net/minecraft/client/multiplayer/WorldClient", + useSrc ? provider_src : "provider", + "Lnet/minecraft/world/WorldProvider;")); + nu.add( + new TypeInsnNode( + INSTANCEOF, + "com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace")); nu.add(new JumpInsnNode(IFEQ, LabelNodes[0])); nu.add(new VarInsnNode(ALOAD, 0)); - nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? renderEngine_src : "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); - nu.add(new FieldInsnNode(GETSTATIC, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b", "sunTex", "Lnet/minecraft/util/ResourceLocation;")); - nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", useSrc ? bindTexture_src : "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); + nu.add(new FieldInsnNode( + GETFIELD, + "net/minecraft/client/renderer/RenderGlobal", + useSrc ? renderEngine_src : "renderEngine", + "Lnet/minecraft/client/renderer/texture/TextureManager;")); + nu.add(new FieldInsnNode( + GETSTATIC, + "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b", + "sunTex", + "Lnet/minecraft/util/ResourceLocation;")); + nu.add(new MethodInsnNode( + INVOKEVIRTUAL, + "net/minecraft/client/renderer/texture/TextureManager", + useSrc ? bindTexture_src : "bindTexture", + "(Lnet/minecraft/util/ResourceLocation;)V", + false)); nu.add(new JumpInsnNode(GOTO, LabelNodes[1])); nu.add(LabelNodes[0]); nu.add(new VarInsnNode(ALOAD, 0)); - nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? renderEngine_src : "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); - nu.add(new FieldInsnNode(GETSTATIC, "net/minecraft/client/renderer/RenderGlobal", useSrc ? field_src : "locationSunPng", "Lnet/minecraft/util/ResourceLocation;")); - nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", useSrc ? bindTexture_src : "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); + nu.add(new FieldInsnNode( + GETFIELD, + "net/minecraft/client/renderer/RenderGlobal", + useSrc ? renderEngine_src : "renderEngine", + "Lnet/minecraft/client/renderer/texture/TextureManager;")); + nu.add(new FieldInsnNode( + GETSTATIC, + "net/minecraft/client/renderer/RenderGlobal", + useSrc ? field_src : "locationSunPng", + "Lnet/minecraft/util/ResourceLocation;")); + nu.add(new MethodInsnNode( + INVOKEVIRTUAL, + "net/minecraft/client/renderer/texture/TextureManager", + useSrc ? bindTexture_src : "bindTexture", + "(Lnet/minecraft/util/ResourceLocation;)V", + false)); nu.add(LabelNodes[1]); j++; } else { if (j < toPatch.instructions.size() - 2) { - if (toPatch.instructions.get(j + 2) instanceof FieldInsnNode && toPatch.instructions.get(j + 2).getOpcode() == GETSTATIC && !ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j + 2)).name, field_deObfs, field_src).isEmpty()) - continue; - if (toPatch.instructions.get(j + 1) instanceof FieldInsnNode && toPatch.instructions.get(j + 1).getOpcode() == GETSTATIC && !ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j + 1)).name, field_deObfs, field_src).isEmpty()) - continue; + if (toPatch.instructions.get(j + 2) instanceof FieldInsnNode + && toPatch.instructions + .get(j + 2) + .getOpcode() + == GETSTATIC + && !ASMUtils.matchAny( + ((FieldInsnNode) toPatch.instructions.get(j + 2)).name, + field_deObfs, + field_src) + .isEmpty()) continue; + if (toPatch.instructions.get(j + 1) instanceof FieldInsnNode + && toPatch.instructions + .get(j + 1) + .getOpcode() + == GETSTATIC + && !ASMUtils.matchAny( + ((FieldInsnNode) toPatch.instructions.get(j + 1)).name, + field_deObfs, + field_src) + .isEmpty()) continue; } nu.add(toPatch.instructions.get(j)); } @@ -216,14 +284,15 @@ public class BWCoreTransformer implements IClassTransformer { String dsc_universal = "()V"; for (int i = 0; i < methods.size(); i++) { - if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal, dsc_universal)) { + if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) + && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal, dsc_universal)) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); methods.set(i, BWCoreTransformer.transformThaumcraftWandPedestal(methods.get(i))); break scase; } } } - case 4 : { + case 4: { BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); String name_deObfs = ""; for (MethodNode toPatch : methods) { @@ -234,11 +303,19 @@ public class BWCoreTransformer implements IClassTransformer { for (int j = 0; j < 2; j++) { nu.add(toPatch.instructions.get(j)); } - nu.add(new FieldInsnNode(GETSTATIC, "gregtech/api/GregTech_API", "sBeforeGTPreload", "Ljava/util/List;")); - nu.add(new TypeInsnNode(NEW, "com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload")); + nu.add(new FieldInsnNode( + GETSTATIC, "gregtech/api/GregTech_API", "sBeforeGTPreload", "Ljava/util/List;")); + nu.add(new TypeInsnNode( + NEW, "com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload")); nu.add(new InsnNode(DUP)); - nu.add(new MethodInsnNode(INVOKESPECIAL, "com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload", "", "()V", false)); - nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/List", "add", "(Ljava/lang/Object;)Z", true)); + nu.add(new MethodInsnNode( + INVOKESPECIAL, + "com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload", + "", + "()V", + false)); + nu.add(new MethodInsnNode( + INVOKEINTERFACE, "java/util/List", "add", "(Ljava/lang/Object;)Z", true)); nu.add(new InsnNode(POP)); for (int j = 2; j < toPatch.instructions.size(); j++) { nu.add(toPatch.instructions.get(j)); @@ -290,11 +367,16 @@ public class BWCoreTransformer implements IClassTransformer { String name_Obfs = "a"; String name_src = "func_82787_a"; for (MethodNode toPatch : methods) { - if (ASMUtils.isCorrectMethod(toPatch,name_deObfs,name_Obfs,name_src)){ + if (ASMUtils.isCorrectMethod(toPatch, name_deObfs, name_Obfs, name_src)) { toPatch.instructions = new InsnList(); - toPatch.instructions.add(new VarInsnNode(ALOAD,1)); - toPatch.instructions.add(new VarInsnNode(ALOAD,2)); - toPatch.instructions.add(new MethodInsnNode(INVOKESTATIC,"com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes","findCachedMatchingRecipe","(Lnet/minecraft/inventory/InventoryCrafting;Lnet/minecraft/world/World;)Lnet/minecraft/item/ItemStack;",false)); + toPatch.instructions.add(new VarInsnNode(ALOAD, 1)); + toPatch.instructions.add(new VarInsnNode(ALOAD, 2)); + toPatch.instructions.add(new MethodInsnNode( + INVOKESTATIC, + "com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes", + "findCachedMatchingRecipe", + "(Lnet/minecraft/inventory/InventoryCrafting;Lnet/minecraft/world/World;)Lnet/minecraft/item/ItemStack;", + false)); toPatch.instructions.add(new InsnNode(ARETURN)); toPatch.localVariables.clear(); toPatch.maxStack = 2; @@ -304,11 +386,12 @@ public class BWCoreTransformer implements IClassTransformer { } } -// case 6: { -// BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); -// ((IntInsnNode) methods.get(11).instructions.get(10)).operand = 10000; -// break scase; -// } + // case 6: { + // BWCore.BWCORE_LOG.info("Could find: " + + // BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + // ((IntInsnNode) methods.get(11).instructions.get(10)).operand = 10000; + // break scase; + // } default: { BWCore.BWCORE_LOG.info("Could not find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); return basicClass; @@ -329,7 +412,8 @@ public class BWCoreTransformer implements IClassTransformer { @Override public byte[] transform(String name, String transformedName, byte[] basicClass) { for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) { - if (name.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i]) || transformedName.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i])) + if (name.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i]) + || transformedName.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i])) return BWCoreTransformer.transform(i, basicClass); } return basicClass; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java index 63fb597213..d074e32c53 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -53,7 +53,8 @@ public class GuiHandler implements IGuiHandler { } } case 3: - return new BW_Container_HeatedWaterPump((BW_TileEntity_HeatedWaterPump) world.getTileEntity(x, y, z), player); + return new BW_Container_HeatedWaterPump( + (BW_TileEntity_HeatedWaterPump) world.getTileEntity(x, y, z), player); } return null; } @@ -69,14 +70,15 @@ public class GuiHandler implements IGuiHandler { case 2: { if (world.getTileEntity(x, y, z) instanceof IGregTechTileEntity) { IGregTechTileEntity te = (IGregTechTileEntity) world.getTileEntity(x, y, z); - return new BW_GUIContainer_RadLevel(new BW_Container_RadioHatch(player.inventory, te.getMetaTileEntity())); + return new BW_GUIContainer_RadLevel( + new BW_Container_RadioHatch(player.inventory, te.getMetaTileEntity())); } } case 3: - return new BW_GUIContainer_HeatedWaterPump(new BW_Container_HeatedWaterPump((BW_TileEntity_HeatedWaterPump) world.getTileEntity(x, y, z), player)); + return new BW_GUIContainer_HeatedWaterPump(new BW_Container_HeatedWaterPump( + (BW_TileEntity_HeatedWaterPump) world.getTileEntity(x, y, z), player)); } - } else - return getServerGuiElement(ID, player, world, x, y, z); + } else return getServerGuiElement(ID, player, world, x, y, z); return null; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index f0b1be2d03..78fafff410 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks; +import static com.github.bartimaeusnek.bartworks.common.loaders.BioRecipeLoader.runOnServerStarted; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.removeIC2Recipes; +import static gregtech.api.enums.GT_Values.VN; import com.github.bartimaeusnek.bartworks.API.*; import com.github.bartimaeusnek.bartworks.client.ClientEventHandler.TooltipEventHandler; @@ -50,22 +53,19 @@ import cpw.mods.fml.common.network.NetworkRegistry; import gregtech.api.GregTech_API; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; +import java.io.IOException; +import java.util.Map; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.io.IOException; -import java.util.Map; - -import static com.github.bartimaeusnek.bartworks.common.loaders.BioRecipeLoader.runOnServerStarted; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.removeIC2Recipes; -import static gregtech.api.enums.GT_Values.VN; - @SuppressWarnings("ALL") @Mod( - modid = MainMod.MOD_ID, name = MainMod.NAME, version = MainMod.VERSION, + modid = MainMod.MOD_ID, + name = MainMod.NAME, + version = MainMod.VERSION, dependencies = "required-after:IC2; " + "required-after:gregtech; " + "after:berriespp; " @@ -75,8 +75,7 @@ import static gregtech.api.enums.GT_Values.VN; + "after:Forestry; " + "after:ProjRed|Illumination; " + "after:RandomThings; " - + "before:miscutils; " - ) + + "before:miscutils; ") public final class MainMod { public static final String NAME = "BartWorks"; public static final String VERSION = "GRADLETOKEN_VERSION"; @@ -90,6 +89,7 @@ public final class MainMod { @Mod.Instance(MainMod.MOD_ID) public static MainMod instance; + public static BW_Network BW_Network_instance = new BW_Network(); @Mod.EventHandler @@ -99,14 +99,13 @@ public final class MainMod { MainMod.LOGGER.error("Something has loaded an old API. Please contact the Mod authors to update!"); } - LoaderReference.init(); //Check for ALL the mods. + LoaderReference.init(); // Check for ALL the mods. if (LoaderReference.miscutils) { MainMod.LOGGER.info("Found GT++, continuing"); } - if (LoaderReference.dreamcraft) - ConfigHandler.hardmode = true; + if (LoaderReference.dreamcraft) ConfigHandler.hardmode = true; ConfigHandler.hardmode = ConfigHandler.ezmode != ConfigHandler.hardmode; @@ -122,8 +121,7 @@ public final class MainMod { WerkstoffLoader.setUp(); } - if (ConfigHandler.hardmode) - MainMod.LOGGER.info(". . . ACTIVATED HARDMODE."); + if (ConfigHandler.hardmode) MainMod.LOGGER.info(". . . ACTIVATED HARDMODE."); if (ConfigHandler.BioLab) { BioCultureLoader.run(); @@ -132,10 +130,8 @@ public final class MainMod { if (ConfigHandler.newStuff) { Werkstoff.init(); GregTech_API.sAfterGTPostload.add(new CircuitPartLoader()); - if (SideReference.Side.Client) - GregTech_API.sBeforeGTLoad.add(new PrefixTextureLinker()); + if (SideReference.Side.Client) GregTech_API.sBeforeGTLoad.add(new PrefixTextureLinker()); } - } @Mod.EventHandler @@ -147,8 +143,7 @@ public final class MainMod { MinecraftForge.EVENT_BUS.register(serverEventHandler); } FMLCommonHandler.instance().bus().register(serverEventHandler); - if (ConfigHandler.BioLab) - BioLabLoader.run(); + if (ConfigHandler.BioLab) BioLabLoader.run(); if (ConfigHandler.newStuff) { WerkstoffLoader.runInit(); } @@ -162,8 +157,11 @@ public final class MainMod { NetworkRegistry.INSTANCE.registerGuiHandler(MainMod.instance, MainMod.GH); if (ConfigHandler.BioLab) { GTNHBlocks.run(); - for (Map.Entry pair : BioVatLogicAdder.BioVatGlass.getGlassMap().entrySet()) { - GT_OreDictUnificator.registerOre("blockGlass" + VN[pair.getValue()], new ItemStack(pair.getKey().getBlock(), 1, pair.getKey().getaByte())); + for (Map.Entry pair : + BioVatLogicAdder.BioVatGlass.getGlassMap().entrySet()) { + GT_OreDictUnificator.registerOre( + "blockGlass" + VN[pair.getValue()], + new ItemStack(pair.getKey().getBlock(), 1, pair.getKey().getaByte())); } } ArtificialMicaLine.runArtificialMicaRecipe(); @@ -201,22 +199,19 @@ public final class MainMod { CircuitImprintLoader.run(); BioVatLogicAdder.RadioHatch.runBasicItemIntegration(); if (!recipesAdded) { - if (!disableExtraGasRecipes) - StaticRecipeChangeLoaders.addEBFGasRecipes(); + if (!disableExtraGasRecipes) StaticRecipeChangeLoaders.addEBFGasRecipes(); - if (classicMode) - DownTierLoader.run(); + if (classicMode) DownTierLoader.run(); - //StaticRecipeChangeLoaders.patchEBFMapForCircuitUnification(); + // StaticRecipeChangeLoaders.patchEBFMapForCircuitUnification(); recipesAdded = true; } StaticRecipeChangeLoaders.fixEnergyRequirements(); - //StaticRecipeChangeLoaders.synchroniseCircuitUseMulti(); + // StaticRecipeChangeLoaders.synchroniseCircuitUseMulti(); - //Accept recipe map changes into Buffers + // Accept recipe map changes into Buffers GT_Recipe.GT_Recipe_Map.sMappings.forEach(GT_Recipe.GT_Recipe_Map::reInit); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java index 24b8834c47..c571fdbef2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java @@ -23,21 +23,19 @@ package com.github.bartimaeusnek.bartworks.client.ClientEventHandler; import com.github.bartimaeusnek.bartworks.util.Pair; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; class TooltipCache { private static final HashMap, char[]> cache = new HashMap<>(); - static boolean put(ItemStack itemStack, List tooltip){ + static boolean put(ItemStack itemStack, List tooltip) { Pair p = new Pair<>(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage()); - if (TooltipCache.cache.containsKey(p)) - return false; + if (TooltipCache.cache.containsKey(p)) return false; if (!tooltip.isEmpty()) { StringBuilder sb = new StringBuilder(); @@ -46,7 +44,7 @@ class TooltipCache { sb.append(System.lineSeparator()); } char[] rettype = sb.toString().toCharArray(); - return TooltipCache.cache.put(p,rettype) == rettype; + return TooltipCache.cache.put(p, rettype) == rettype; } else { return false; } @@ -54,17 +52,16 @@ class TooltipCache { static List getTooltip(ItemStack itemStack) { Pair p = new Pair<>(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage()); - char[] toTest= TooltipCache.cache.get(p); - if (toTest == null){ + char[] toTest = TooltipCache.cache.get(p); + if (toTest == null) { return new ArrayList<>(); } return Arrays.asList(new String(toTest).split(System.lineSeparator())); } - private static void checkSize(){ - if (TooltipCache.cache.size()> Short.MAX_VALUE*2 ){ + private static void checkSize() { + if (TooltipCache.cache.size() > Short.MAX_VALUE * 2) { TooltipCache.cache.clear(); } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java index 6c55b603e8..33892d57ae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java @@ -39,6 +39,9 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; @@ -47,10 +50,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import net.minecraftforge.event.entity.player.ItemTooltipEvent; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - @SideOnly(Side.CLIENT) public class TooltipEventHandler { @@ -58,29 +57,35 @@ public class TooltipEventHandler { @SubscribeEvent(priority = EventPriority.HIGHEST) public void getTooltip(ItemTooltipEvent event) { - if (event == null || event.itemStack == null || event.itemStack.getItem() == null) - return; + if (event == null || event.itemStack == null || event.itemStack.getItem() == null) return; if (TooltipCache.getTooltip(event.itemStack).isEmpty()) { ItemStack tmp = event.itemStack.copy(); - Pair abstractedStack = new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); + Pair abstractedStack = + new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); List tooAdd = new ArrayList<>(); - if (ConfigHandler.sharedItemStackTooltip && OreDictHandler.getNonBWCache().contains(abstractedStack)) { - for (Pair pair : OreDictHandler.getNonBWCache()) { + if (ConfigHandler.sharedItemStackTooltip + && OreDictHandler.getNonBWCache().contains(abstractedStack)) { + for (Pair pair : OreDictHandler.getNonBWCache()) { if (pair.equals(abstractedStack)) { GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); if (UI == null) UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); if (UI != null) { for (ModContainer modContainer : Loader.instance().getModList()) { - if (UI.modId.equals(MainMod.MOD_ID) || UI.modId.equals(BartWorksCrossmod.MOD_ID) || UI.modId.equals("BWCore")) - break; + if (UI.modId.equals(MainMod.MOD_ID) + || UI.modId.equals(BartWorksCrossmod.MOD_ID) + || UI.modId.equals("BWCore")) break; if (UI.modId.equals(modContainer.getModId())) { - tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + ChatColorHelper.GRAY + " and " + ChatColorHelper.RED + modContainer.getName()); + tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + + ChatColorHelper.GRAY + " and " + ChatColorHelper.RED + + modContainer.getName()); } } } else - tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + ChatColorHelper.GRAY + " and another Mod, that doesn't use the ModContainer propperly!"); + tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + + ChatColorHelper.GRAY + + " and another Mod, that doesn't use the ModContainer propperly!"); } } } @@ -91,17 +96,15 @@ public class TooltipEventHandler { TooltipCache.put(event.itemStack, tooAdd); return; } - BioVatLogicAdder.BlockMetaPair PAIR = new BioVatLogicAdder.BlockMetaPair(BLOCK, (byte) event.itemStack.getItemDamage()); + BioVatLogicAdder.BlockMetaPair PAIR = + new BioVatLogicAdder.BlockMetaPair(BLOCK, (byte) event.itemStack.getItemDamage()); HashMap GLASSMAP = BioVatLogicAdder.BioVatGlass.getGlassMap(); if (GLASSMAP.containsKey(PAIR)) { int tier = GLASSMAP.get(PAIR); - tooAdd.add( - StatCollector.translateToLocal("tooltip.glas.0.name") + - " " - + BW_ColorUtil.getColorForTier(tier) + GT_Values.VN[tier] + ChatColorHelper.RESET); + tooAdd.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + + BW_ColorUtil.getColorForTier(tier) + GT_Values.VN[tier] + ChatColorHelper.RESET); } else if (BLOCK.getMaterial().equals(Material.glass)) { - tooAdd.add(StatCollector.translateToLocal("tooltip.glas.0.name") + - " " + tooAdd.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + BW_ColorUtil.getColorForTier(3) + GT_Values.VN[3] + ChatColorHelper.RESET); } } @@ -112,4 +115,4 @@ public class TooltipEventHandler { event.toolTip.addAll(TooltipCache.getTooltip(event.itemStack)); } } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java index 68c82fc7cc..d80aa74a11 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java @@ -36,5 +36,4 @@ public class bartworksTab extends CreativeTabs { public Item getTabIconItem() { return ItemRegistry.ROCKCUTTER_HV; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java index 16cafa256d..d92ed0012f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java @@ -30,7 +30,8 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; public class BW_GUIContainer_HeatedWaterPump extends GuiContainer { - private static final ResourceLocation furnaceGuiTextures = new ResourceLocation(MainMod.MOD_ID + ":textures/GUI/GUIheatedPump.png"); + private static final ResourceLocation furnaceGuiTextures = + new ResourceLocation(MainMod.MOD_ID + ":textures/GUI/GUIheatedPump.png"); final BW_Container_HeatedWaterPump container; public BW_GUIContainer_HeatedWaterPump(Container p_i1072_1_) { @@ -45,7 +46,8 @@ public class BW_GUIContainer_HeatedWaterPump extends GuiContainer { int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); -// this.drawString(this.fontRendererObj, "Fuel:" + container.fuel + " Water:" + container.water, k, l, 0xffffff); + // this.drawString(this.fontRendererObj, "Fuel:" + container.fuel + " Water:" + container.water, k, l, + // 0xffffff); if (this.container.fuel > 0) { this.mc.getTextureManager().bindTexture(BW_GUIContainer_HeatedWaterPump.furnaceGuiTextures); @@ -54,10 +56,10 @@ public class BW_GUIContainer_HeatedWaterPump extends GuiContainer { this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 13 - i1, 14, i1 + 1); } -// if (this.container.water > 0){ -// this.mc.getTextureManager().bindTexture( new ResourceLocation("textures/blocks/water_still.png")); -// this.drawTexturedModalRect(k+85,l+32,32,32,18,18); -// } + // if (this.container.water > 0){ + // this.mc.getTextureManager().bindTexture( new ResourceLocation("textures/blocks/water_still.png")); + // this.drawTexturedModalRect(k+85,l+32,32,32,18,18); + // } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java index 7a9603ee61..6d234b69dd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java @@ -41,7 +41,6 @@ public class BW_GUIContainer_RadLevel extends GuiContainer { this.container = (BW_Container_RadioHatch) p_i1072_1_; } - @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { GL11.glColor3f(1, 1, 1); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java index 90923deee4..c3339e156d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java @@ -44,27 +44,39 @@ public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator { } protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - this.fontRendererObj.drawString(this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 6, 2157374); + this.fontRendererObj.drawString( + this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 6, 2157374); if (this.container.base.checkrotor()) { if (!this.container.base.rotorspace()) { - this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotorspace"), 27, 52, 2157374); + this.fontRendererObj.drawString( + StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotorspace"), 27, 52, 2157374); } else if (this.container.base.checkrotor() && !this.container.base.guiisminWindStrength()) { - this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.windweak1"), 27, 52, 2157374); + this.fontRendererObj.drawString( + StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.windweak1"), 27, 52, 2157374); } else { this.fontRendererObj.drawString(this.container.base.getRotorhealth() + " %", 46, 52, 2157374); if (this.container.base.guiisoverload()) { - GuiTooltipHelper.drawAreaTooltip(p_146979_1_ - this.guiLeft, p_146979_2_ - this.guiTop, StatCollector.translateToLocal("ic2.WindKineticGenerator.error.overload"), 44, 27, 79, 52); + GuiTooltipHelper.drawAreaTooltip( + p_146979_1_ - this.guiLeft, + p_146979_2_ - this.guiTop, + StatCollector.translateToLocal("ic2.WindKineticGenerator.error.overload"), + 44, + 27, + 79, + 52); } } } else { - this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotormiss"), 27, 52, 2157374); + this.fontRendererObj.drawString( + StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotormiss"), 27, 52, 2157374); } - } protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { GL11.glColor3f(0.5f, 0.25f, 0.07f); - this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUIPrimitiveKUBox.png")); + this.mc + .getTextureManager() + .bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUIPrimitiveKUBox.png")); int j = (this.width - this.xSize) / 2; int k = (this.height - this.ySize) / 2; this.drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java index 77d290504f..5b6c40c20a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java @@ -41,8 +41,7 @@ public class BW_GUIContainer_Windmill extends GT_GUIContainerMetaTile_Machine { } protected void drawGuiContainerForegroundLayer(int par1, int par2) { - if (!(this.mContainer instanceof GT_Container_MultiMachine)) - return; + if (!(this.mContainer instanceof GT_Container_MultiMachine)) return; if ((this.mContainer.mDisplayErrorCode & 64) != 0) this.fontRendererObj.drawString(this.trans("138", "Incomplete Structure."), 92, 22, 16448255); @@ -70,11 +69,10 @@ public class BW_GUIContainer_Windmill extends GT_GUIContainerMetaTile_Machine { this.drawTexturedModalRect(x + 85, y + 27, 176, (last = 32), 32, 32); else if (System.currentTimeMillis() / DIVIDER % 40 == 0) this.drawTexturedModalRect(x + 85, y + 27, 176, (last = 0), 32, 32); - else - this.drawTexturedModalRect(x + 85, y + 27, 176, last, 32, 32); + else this.drawTexturedModalRect(x + 85, y + 27, 176, last, 32, 32); } - //Soft Mallet + // Soft Mallet if (this.mContainer.mDisplayErrorCode == 0) { if (this.mContainer.mActive == 0) { this.drawTexturedModalRect(x + 66, y + 66, 176, 128, 15, 15); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java index 80970c254c..e575474b72 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java @@ -35,7 +35,8 @@ import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class GT_GUIContainer_CircuitProgrammer extends GuiContainer { - public static final ResourceLocation texture = new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUI_CircuitP.png"); + public static final ResourceLocation texture = + new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUI_CircuitP.png"); public GT_GUIContainer_CircuitProgrammer(InventoryPlayer p_i1072_1_) { super(new GT_Container_CircuitProgrammer(p_i1072_1_)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java index aa13bb4ee1..7b050d64b7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java @@ -34,7 +34,8 @@ import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class GT_GUIContainer_Destructopack extends GuiContainer { - public static final ResourceLocation texture = new ResourceLocation(MainMod.MOD_ID, "textures/GT2/gui/Destructopack.png"); + public static final ResourceLocation texture = + new ResourceLocation(MainMod.MOD_ID, "textures/GT2/gui/Destructopack.png"); public GT_GUIContainer_Destructopack(InventoryPlayer inventory) { super(new GT_Container_Item_Destructopack(inventory)); @@ -48,8 +49,5 @@ public class GT_GUIContainer_Destructopack extends GuiContainer { } @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - } - - + protected void drawGuiContainerForegroundLayer(int par1, int par2) {} } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java index 570fe9c0b4..acab43a06e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -31,14 +31,13 @@ import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_GUIContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; +import java.awt.*; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; -import java.awt.*; - @SideOnly(Side.CLIENT) public class GT_GUIContainer_LESU extends GT_GUIContainer { @@ -57,16 +56,52 @@ public class GT_GUIContainer_LESU extends GT_GUIContainer { this.drawString(this.fontRendererObj, "L.E.S.U.", 11, 8, 16448255); if (this.mContainer != null) { String percell = String.valueOf(ConfigHandler.energyPerCell).substring(1); - this.drawString(this.fontRendererObj, "EU: " + GT_Utility.formatNumbers(this.mContainer.mEnergy), 11, 16, 16448255); - this.drawString(this.fontRendererObj, "MAX: " + (this.c.getBaseMetaTileEntity().isActive() ? GT_Utility.formatNumbers(this.mContainer.mOutput) + percell : Integer.toString(0)), 11, 24, 16448255); - this.drawString(this.fontRendererObj, "MAX EU/t IN: " + GT_Utility.formatNumbers(this.mContainer.mInput), 11, 32, 16448255); - this.drawString(this.fontRendererObj, "EU/t OUT: " + GT_Utility.formatNumbers(this.mContainer.mOutput), 11, 40, 16448255); - this.drawString(this.fontRendererObj, "AMP/t IN/OUT: " + GT_Utility.formatNumbers(this.c.getBaseMetaTileEntity().getInputAmperage()), 11, 48, 16448255); + this.drawString( + this.fontRendererObj, "EU: " + GT_Utility.formatNumbers(this.mContainer.mEnergy), 11, 16, 16448255); + this.drawString( + this.fontRendererObj, + "MAX: " + + (this.c.getBaseMetaTileEntity().isActive() + ? GT_Utility.formatNumbers(this.mContainer.mOutput) + percell + : Integer.toString(0)), + 11, + 24, + 16448255); + this.drawString( + this.fontRendererObj, + "MAX EU/t IN: " + GT_Utility.formatNumbers(this.mContainer.mInput), + 11, + 32, + 16448255); + this.drawString( + this.fontRendererObj, + "EU/t OUT: " + GT_Utility.formatNumbers(this.mContainer.mOutput), + 11, + 40, + 16448255); + this.drawString( + this.fontRendererObj, + "AMP/t IN/OUT: " + + GT_Utility.formatNumbers( + this.c.getBaseMetaTileEntity().getInputAmperage()), + 11, + 48, + 16448255); if (this.c.maxEUStore() >= Long.MAX_VALUE - 1) { - this.drawString(this.fontRendererObj, StatCollector.translateToLocal("tooltip.LESU.0.name"), 11, 56, Color.YELLOW.getRGB()); + this.drawString( + this.fontRendererObj, + StatCollector.translateToLocal("tooltip.LESU.0.name"), + 11, + 56, + Color.YELLOW.getRGB()); } if (!this.c.getBaseMetaTileEntity().isActive()) { - this.drawString(this.fontRendererObj, StatCollector.translateToLocal("tooltip.LESU.1.name"), 11, 56, Color.RED.getRGB()); + this.drawString( + this.fontRendererObj, + StatCollector.translateToLocal("tooltip.LESU.1.name"), + 11, + 56, + Color.RED.getRGB()); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java index cfa0180442..13dd85c5c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java @@ -31,43 +31,60 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import java.nio.ByteBuffer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; -import java.nio.ByteBuffer; - @SideOnly(Side.CLIENT) public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine { private static int maxSv; private final String mName; public GT_GUIContainer_RadioHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { - super(new GT_Container_RadioHatch(aInventoryPlayer, aTileEntity), MainMod.MOD_ID + ":textures/GUI/RadHatch.png"); + super( + new GT_Container_RadioHatch(aInventoryPlayer, aTileEntity), + MainMod.MOD_ID + ":textures/GUI/RadHatch.png"); this.mName = "Radio Hatch"; this.mContainer.detectAndSendChanges(); GT_GUIContainer_RadioHatch.maxSv = BioVatLogicAdder.RadioHatch.getMaxSv(); } protected void drawGuiContainerForegroundLayer(int par1, int par2) { - long timer = ByteBuffer.wrap(((GT_Container_RadioHatch) this.mContainer).teTimer).getLong(); - double maxT = ((GT_Container_RadioHatch) this.mContainer).mass * (GT_MetaTileEntity_RadioHatch.calcDecayTicks(((GT_Container_RadioHatch) this.mContainer).sievert)); + long timer = ByteBuffer.wrap(((GT_Container_RadioHatch) this.mContainer).teTimer) + .getLong(); + double maxT = ((GT_Container_RadioHatch) this.mContainer).mass + * (GT_MetaTileEntity_RadioHatch.calcDecayTicks(((GT_Container_RadioHatch) this.mContainer).sievert)); double rem = maxT - timer % maxT; this.fontRendererObj.drawString(this.mName, 8, 4, 4210752); this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID + ":textures/GUI/RadHatch.png")); if (((GT_Container_RadioHatch) this.mContainer).mass > 0) { - GL11.glColor3f(((GT_Container_RadioHatch) this.mContainer).r / 255f, ((GT_Container_RadioHatch) this.mContainer).g / 255f, ((GT_Container_RadioHatch) this.mContainer).b / 255f); + GL11.glColor3f( + ((GT_Container_RadioHatch) this.mContainer).r / 255f, + ((GT_Container_RadioHatch) this.mContainer).g / 255f, + ((GT_Container_RadioHatch) this.mContainer).b / 255f); this.drawTexturedModalRect(124, 18, 124, 18, 16, 48); } GL11.glColor3f(1f, 1f, 1f); this.drawTexturedModalRect(124, 18, 176, 0, 16, 48 - MathUtils.ceilInt(48 * (rem / maxT))); - this.drawTexturedModalRect(65, 13, 192, 0, (48 * (((GT_Container_RadioHatch) this.mContainer).sv)) / (GT_GUIContainer_RadioHatch.maxSv), 16); + this.drawTexturedModalRect( + 65, + 13, + 192, + 0, + (48 * (((GT_Container_RadioHatch) this.mContainer).sv)) / (GT_GUIContainer_RadioHatch.maxSv), + 16); - -// this.fontRendererObj.drawString("Sv: " + ((GT_Container_RadioHatch) mContainer).sievert, 8, 50, BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); -// this.fontRendererObj.drawString("Kg: " + ((GT_Container_RadioHatch) mContainer).mass, 8, 68, BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); -// this.fontRendererObj.drawString("Time: " + timer, 8, 76, BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); + // this.fontRendererObj.drawString("Sv: " + ((GT_Container_RadioHatch) mContainer).sievert, 8, 50, + // BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, + // ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); + // this.fontRendererObj.drawString("Kg: " + ((GT_Container_RadioHatch) mContainer).mass, 8, 68, + // BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, + // ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); + // this.fontRendererObj.drawString("Time: " + timer, 8, 76, BW_ColorUtil.getColorFromRGBArray(new + // short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, + // ((GT_Container_RadioHatch) mContainer).b})); } @@ -77,5 +94,4 @@ public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine int y = (this.height - this.ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java index dd5787a871..c1880bfca0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java @@ -24,12 +24,18 @@ public class BW_CropVisualizer extends EntityFX { @Override public void onUpdate() { - if (this.particleAge++ >= this.particleMaxAge) - this.setDead(); + if (this.particleAge++ >= this.particleMaxAge) this.setDead(); } @Override - public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + public void renderParticle( + Tessellator p_70539_1_, + float p_70539_2_, + float p_70539_3_, + float p_70539_4_, + float p_70539_5_, + float p_70539_6_, + float p_70539_7_) { Tessellator tessellator = Tessellator.instance; GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDepthMask(false); @@ -51,5 +57,4 @@ public class BW_CropVisualizer extends EntityFX { public boolean shouldRenderInPass(int pass) { return pass == 2; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java index f11167a6bc..ab9a04fc18 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java @@ -46,25 +46,30 @@ public class BW_GT_ItemRenderer implements IItemRenderer { for (BW_Meta_Items.BW_GT_MetaGen_Item_Hook tItem : BW_Meta_Items.BW_GT_MetaGen_Item_Hook.sInstances) { MinecraftForgeClient.registerItemRenderer(tItem, this); } - } @Override public boolean handleRenderType(ItemStack aStack, IItemRenderer.ItemRenderType aType) { if (!GT_Utility.isStackInvalid(aStack) && aStack.getItemDamage() >= 0) { - return aType == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON || aType == IItemRenderer.ItemRenderType.INVENTORY || aType == IItemRenderer.ItemRenderType.EQUIPPED || aType == IItemRenderer.ItemRenderType.ENTITY; + return aType == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON + || aType == IItemRenderer.ItemRenderType.INVENTORY + || aType == IItemRenderer.ItemRenderType.EQUIPPED + || aType == IItemRenderer.ItemRenderType.ENTITY; } else { return false; } } + @Override - public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType aType, ItemStack aStack, IItemRenderer.ItemRendererHelper aHelper) { + public boolean shouldUseRenderHelper( + IItemRenderer.ItemRenderType aType, ItemStack aStack, IItemRenderer.ItemRendererHelper aHelper) { if (GT_Utility.isStackInvalid(aStack)) { return false; } else { return aType == IItemRenderer.ItemRenderType.ENTITY; } } + @Override public void renderItem(IItemRenderer.ItemRenderType type, ItemStack aStack, Object... data) { if (!GT_Utility.isStackInvalid(aStack)) { @@ -90,18 +95,38 @@ public class BW_GT_ItemRenderer implements IItemRenderer { GT_RenderUtil.renderItemIcon(tIcon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); else { for (int i = 0; i < 4; i++) { - GT_RenderUtil.renderItemIcon(tIcon, 0.0D+i*2D,0.0D+i*2D,10.0D+i*2D,10.0D+i*2D, 0.001D, 0.0F, 0.0F, -1.0F); + GT_RenderUtil.renderItemIcon( + tIcon, + 0.0D + i * 2D, + 0.0D + i * 2D, + 10.0D + i * 2D, + 10.0D + i * 2D, + 0.001D, + 0.0F, + 0.0F, + -1.0F); } } } else { if (aMetaData < CircuitImprintLoader.reverseIDs) - ItemRenderer.renderItemIn2D(Tessellator.instance,tIcon.getMaxU(), tIcon.getMinV(), tIcon.getMinU(), tIcon.getMaxV(), tIcon.getIconWidth(), tIcon.getIconHeight(), 0.0625F); -// else { -// for (int i = 0; i < 4; i++) { -// ItemRenderer.renderItemIn2D(Tessellator.instance, 0.0F+i*2F,0.0F+i*2F,10.0F+i*2F,10.0F+i*2F, tIcon.getIconWidth(), tIcon.getIconHeight(),0.0625F); -// } -// } -// ItemRenderer.renderItemIn2D(Tessellator.instance, tIcon.getMaxU(), tIcon.getMinV(), tIcon.getMinU(), tIcon.getMaxV(), tIcon.getIconWidth(), tIcon.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + tIcon.getMaxU(), + tIcon.getMinV(), + tIcon.getMinU(), + tIcon.getMaxV(), + tIcon.getIconWidth(), + tIcon.getIconHeight(), + 0.0625F); + // else { + // for (int i = 0; i < 4; i++) { + // ItemRenderer.renderItemIn2D(Tessellator.instance, + // 0.0F+i*2F,0.0F+i*2F,10.0F+i*2F,10.0F+i*2F, tIcon.getIconWidth(), tIcon.getIconHeight(),0.0625F); + // } + // } + // ItemRenderer.renderItemIn2D(Tessellator.instance, tIcon.getMaxU(), + // tIcon.getMinV(), tIcon.getMinU(), tIcon.getMaxV(), tIcon.getIconWidth(), tIcon.getIconHeight(), + // 0.0625F); } IIcon tOverlay = (IIcon) BW_Util.get2DCoordFrom1DArray(aMetaData, 1, 2, aItem.mIconList); @@ -112,7 +137,15 @@ public class BW_GT_ItemRenderer implements IItemRenderer { if (type.equals(IItemRenderer.ItemRenderType.INVENTORY)) { GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { - ItemRenderer.renderItemIn2D(Tessellator.instance, tOverlay.getMaxU(), tOverlay.getMinV(), tOverlay.getMinU(), tOverlay.getMaxV(), tOverlay.getIconWidth(), tOverlay.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + tOverlay.getMaxU(), + tOverlay.getMinV(), + tOverlay.getMinU(), + tOverlay.getMaxV(), + tOverlay.getIconWidth(), + tOverlay.getIconHeight(), + 0.0625F); } } } @@ -120,4 +153,4 @@ public class BW_GT_ItemRenderer implements IItemRenderer { GL11.glDisable(3042); } } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index 02983419a3..a55ed8be41 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.client.renderer; +import static gregtech.common.render.GT_Renderer_Block.*; + import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block_TE; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Blocks; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; @@ -33,8 +35,6 @@ import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.world.IBlockAccess; import org.lwjgl.opengl.GL11; -import static gregtech.common.render.GT_Renderer_Block.*; - public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { public static BW_Renderer_Block_Ores INSTANCE = new BW_Renderer_Block_Ores(); public final int mRenderID = RenderingRegistry.getNextAvailableRenderId(); @@ -43,7 +43,7 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { @Override public void renderInventoryBlock(Block aBlock, int aMeta, int modelId, RenderBlocks aRenderer) { - BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks)aBlock).getProperTileEntityForRendering(); + BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks) aBlock).getProperTileEntityForRendering(); tTileEntity.mMetaData = (short) aMeta; aRenderer.enableAO = false; aRenderer.useInventoryTint = true; @@ -64,8 +64,9 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { } @Override - public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int modelId, RenderBlocks aRenderer) { - BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks)aBlock).getProperTileEntityForRendering(); + public boolean renderWorldBlock( + IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int modelId, RenderBlocks aRenderer) { + BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks) aBlock).getProperTileEntityForRendering(); tTileEntity.mMetaData = ((BW_MetaGenerated_Block_TE) aWorld.getTileEntity(aX, aY, aZ)).mMetaData; aRenderer.useInventoryTint = false; aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java index a054273f6b..f464b249d8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java @@ -75,11 +75,19 @@ public class RendererGlasBlock implements ISimpleBlockRenderingHandler { } @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - //renderer.setRenderBounds(0.001,0.001,0.001,0.999,0.999,0.999); + public boolean renderWorldBlock( + IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + // renderer.setRenderBounds(0.001,0.001,0.001,0.999,0.999,0.999); renderer.renderStandardBlock(ItemRegistry.bw_fake_glasses, x, y, z); - //renderer.setRenderBounds(0,0,0,1,1,1); - renderer.renderStandardBlockWithColorMultiplier(block, x, y, z, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[0] / 255f, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[1] / 255f, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[2] / 255f); + // renderer.setRenderBounds(0,0,0,1,1,1); + renderer.renderStandardBlockWithColorMultiplier( + block, + x, + y, + z, + ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[0] / 255f, + ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[1] / 255f, + ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[2] / 255f); return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java index 612bd33b98..e659a6d2f9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java @@ -56,7 +56,8 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler int count = 0; float end = 0.0f; for (float aFlow : flow) { - if (aFlow >= RendererSwitchingColorFluid.THREE_QUARTERS_FILLED && end != RendererSwitchingColorFluid.LIGHT_Y_POS) { + if (aFlow >= RendererSwitchingColorFluid.THREE_QUARTERS_FILLED + && end != RendererSwitchingColorFluid.LIGHT_Y_POS) { end = aFlow; } if (aFlow >= 0.0f) { @@ -81,17 +82,17 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler return RendererSwitchingColorFluid.THREE_QUARTERS_FILLED; } } - return (!world.getBlock(x, y, z).getMaterial().isSolid() && world.getBlock(x, y + 1, z) == block) ? RendererSwitchingColorFluid.LIGHT_Y_POS : (block.getQuantaPercentage(world, x, y, z) * RendererSwitchingColorFluid.THREE_QUARTERS_FILLED); - } - - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { + return (!world.getBlock(x, y, z).getMaterial().isSolid() && world.getBlock(x, y + 1, z) == block) + ? RendererSwitchingColorFluid.LIGHT_Y_POS + : (block.getQuantaPercentage(world, x, y, z) * RendererSwitchingColorFluid.THREE_QUARTERS_FILLED); } + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {} @SideOnly(Side.CLIENT) - public boolean renderWorldBlock(IBlockAccess iBlockAccess, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - if ((!(block instanceof BioFluidBlock))) - return false; + public boolean renderWorldBlock( + IBlockAccess iBlockAccess, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + if ((!(block instanceof BioFluidBlock))) return false; Tessellator tessellator = Tessellator.instance; Coords blockat = new Coords(x, y, z, iBlockAccess.getTileEntity(x, y, z).getWorldObj().provider.dimensionId); Integer rgb = GT_TileEntity_BioVat.staticColorMap.get(blockat); @@ -111,14 +112,13 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler BlockFluidBase blockFluidBase = (BlockFluidBase) block; boolean renderTop = iBlockAccess.getBlock(x, y + 1, z) != blockFluidBase; - boolean renderBottom = - block.shouldSideBeRendered(iBlockAccess, x, y - 1, z, 0) - && iBlockAccess.getBlock(x, y - 1, z) != blockFluidBase; + boolean renderBottom = block.shouldSideBeRendered(iBlockAccess, x, y - 1, z, 0) + && iBlockAccess.getBlock(x, y - 1, z) != blockFluidBase; boolean[] renderSides = { - block.shouldSideBeRendered(iBlockAccess, x, y, z - 1, 2), - block.shouldSideBeRendered(iBlockAccess, x, y, z + 1, 3), - block.shouldSideBeRendered(iBlockAccess, x - 1, y, z, 4), - block.shouldSideBeRendered(iBlockAccess, x + 1, y, z, 5) + block.shouldSideBeRendered(iBlockAccess, x, y, z - 1, 2), + block.shouldSideBeRendered(iBlockAccess, x, y, z + 1, 3), + block.shouldSideBeRendered(iBlockAccess, x - 1, y, z, 4), + block.shouldSideBeRendered(iBlockAccess, x + 1, y, z, 5) }; if (!renderTop && !renderBottom && !renderSides[0] && !renderSides[1] && !renderSides[2] && !renderSides[3]) { return false; @@ -136,10 +136,18 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler float fluidHeightForRender6 = this.getFluidHeightForRender(iBlockAccess, x + 1, y, z - 1, blockFluidBase); float fluidHeightForRender7 = this.getFluidHeightForRender(iBlockAccess, x + 1, y, z, blockFluidBase); float fluidHeightForRender8 = this.getFluidHeightForRender(iBlockAccess, x + 1, y, z + 1, blockFluidBase); - heightNW = this.getFluidHeightAverage(new float[]{fluidHeightForRender1, fluidHeightForRender2, fluidHeightForRender4, fluidHeightForRender}); - heightSW = this.getFluidHeightAverage(new float[]{fluidHeightForRender2, fluidHeightForRender3, fluidHeightForRender5, fluidHeightForRender}); - heightSE = this.getFluidHeightAverage(new float[]{fluidHeightForRender5, fluidHeightForRender7, fluidHeightForRender8, fluidHeightForRender}); - heightNE = this.getFluidHeightAverage(new float[]{fluidHeightForRender4, fluidHeightForRender6, fluidHeightForRender7, fluidHeightForRender}); + heightNW = this.getFluidHeightAverage(new float[] { + fluidHeightForRender1, fluidHeightForRender2, fluidHeightForRender4, fluidHeightForRender + }); + heightSW = this.getFluidHeightAverage(new float[] { + fluidHeightForRender2, fluidHeightForRender3, fluidHeightForRender5, fluidHeightForRender + }); + heightSE = this.getFluidHeightAverage(new float[] { + fluidHeightForRender5, fluidHeightForRender7, fluidHeightForRender8, fluidHeightForRender + }); + heightNE = this.getFluidHeightAverage(new float[] { + fluidHeightForRender4, fluidHeightForRender6, fluidHeightForRender7, fluidHeightForRender + }); } else { heightNW = fluidHeightForRender; heightSW = fluidHeightForRender; @@ -157,7 +165,14 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler heightSE -= RendererSwitchingColorFluid.RENDER_OFFSET; heightNE -= RendererSwitchingColorFluid.RENDER_OFFSET; - double dInterpolatedU, dInterpolatedV, dInterpolatedU2, dInterpolatedV2, dInterpolatedU3, dInterpolatedV3, dInterpolatedU4, dInterpolatedV4; + double dInterpolatedU, + dInterpolatedV, + dInterpolatedU2, + dInterpolatedV2, + dInterpolatedU3, + dInterpolatedV3, + dInterpolatedU4, + dInterpolatedV4; if (flowDir < -999.0f) { dInterpolatedU = iconStill.getInterpolatedU(0.0); @@ -181,7 +196,10 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler } tessellator.setBrightness(block.getMixedBrightnessForBlock(iBlockAccess, x, y, z)); - tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_POS * red, RendererSwitchingColorFluid.LIGHT_Y_POS * green, RendererSwitchingColorFluid.LIGHT_Y_POS * blue); + tessellator.setColorOpaque_F( + RendererSwitchingColorFluid.LIGHT_Y_POS * red, + RendererSwitchingColorFluid.LIGHT_Y_POS * green, + RendererSwitchingColorFluid.LIGHT_Y_POS * blue); tessellator.addVertexWithUV(x, y + heightNW, z, dInterpolatedU, dInterpolatedV); tessellator.addVertexWithUV(x, y + heightSW, z + 1, dInterpolatedU2, dInterpolatedV2); @@ -191,14 +209,21 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler tessellator.addVertexWithUV(x + 1, y + heightNE, z, dInterpolatedU4, dInterpolatedV4); tessellator.addVertexWithUV(x + 1, y + heightSE, z + 1, dInterpolatedU3, dInterpolatedV3); tessellator.addVertexWithUV(x, y + heightSW, z + 1, dInterpolatedU2, dInterpolatedV2); - } if (renderer.renderAllFaces || renderBottom) { rendered = true; tessellator.setBrightness(block.getMixedBrightnessForBlock(iBlockAccess, x, y - 1, z)); - tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_NEG * red, RendererSwitchingColorFluid.LIGHT_Y_NEG * green, RendererSwitchingColorFluid.LIGHT_Y_NEG * blue); - renderer.renderFaceYNeg(block, x, y + RendererSwitchingColorFluid.RENDER_OFFSET, z, this.getNullCheckedIiconOrFallbackTexture()); + tessellator.setColorOpaque_F( + RendererSwitchingColorFluid.LIGHT_Y_NEG * red, + RendererSwitchingColorFluid.LIGHT_Y_NEG * green, + RendererSwitchingColorFluid.LIGHT_Y_NEG * blue); + renderer.renderFaceYNeg( + block, + x, + y + RendererSwitchingColorFluid.RENDER_OFFSET, + z, + this.getNullCheckedIiconOrFallbackTexture()); } for (int side = 0; side < 4; ++side) { @@ -267,7 +292,10 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler } else { sideLighting = RendererSwitchingColorFluid.LIGHT_XZ_POS; } - tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * red, RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * green, RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * blue); + tessellator.setColorOpaque_F( + RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * red, + RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * green, + RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * blue); tessellator.addVertexWithUV(dXcoord1, y + dHeight1, dZcoord1, u1Flow, v1Flow); tessellator.addVertexWithUV(dXcoord2, y + dHeight2, dZcoord2, u2Flow, v2Flow); @@ -293,6 +321,11 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler } private IIcon getNullCheckedIiconOrFallbackTexture() { - return FluidLoader.autogenIIcon != null ? FluidLoader.autogenIIcon : ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); + return FluidLoader.autogenIIcon != null + ? FluidLoader.autogenIIcon + : ((TextureMap) Minecraft.getMinecraft() + .getTextureManager() + .getTexture(TextureMap.locationBlocksTexture)) + .getAtlasSprite("missingno"); } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java index 82f0cc02dc..a849ac11ac 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java @@ -30,7 +30,6 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; - import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -45,40 +44,40 @@ public class PrefixTextureLinker implements Runnable { private static void fillBlockTexMap() { blockTexMap.put(TextureSet.SET_QUARTZ, TextureSet.INDEX_block4); - Stream.of(WerkstoffLoader.blockCasing, WerkstoffLoader.blockCasingAdvanced).forEach( - prefixes -> { + Stream.of(WerkstoffLoader.blockCasing, WerkstoffLoader.blockCasingAdvanced) + .forEach(prefixes -> { HashMap curr = new HashMap<>(); Arrays.stream(TextureSet.class.getFields()) .filter(field -> field.getName().contains("SET")) .forEach(SET -> { try { - curr.put((TextureSet) SET.get(null), - new Textures.BlockIcons.CustomIcon( - "materialicons/" + SET.getName().substring(4) + "/" + prefixes) - ); + curr.put( + (TextureSet) SET.get(null), + new Textures.BlockIcons.CustomIcon("materialicons/" + + SET.getName().substring(4) + "/" + prefixes)); } catch (IllegalAccessException e) { e.printStackTrace(); } }); texMapBlocks.put(prefixes, curr); - } - ); + }); } private static void fillItemTexMap() { Arrays.stream(OrePrefixes.values()) .filter(prefixes -> prefixes != OrePrefixes.rod - && prefixes.mTextureIndex == -1 && Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes) != 0) + && prefixes.mTextureIndex == -1 + && Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes) != 0) .forEach(prefixes -> { HashMap curr = new HashMap<>(); Arrays.stream(TextureSet.class.getFields()) .filter(field -> field.getName().contains("SET")) .forEach(SET -> { try { - curr.put((TextureSet) SET.get(null), - new Textures.ItemIcons.CustomIcon( - "materialicons/" + SET.getName().substring(4) + "/" + prefixes) - ); + curr.put( + (TextureSet) SET.get(null), + new Textures.ItemIcons.CustomIcon("materialicons/" + + SET.getName().substring(4) + "/" + prefixes)); } catch (IllegalAccessException e) { e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java index 24f3aad588..22b58a28be 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.MainMod; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -38,12 +39,11 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import java.util.List; - public class BW_Blocks extends Block { @SideOnly(Side.CLIENT) protected IIcon[] texture; + String[] textureNames; protected String name; @@ -139,4 +139,4 @@ public class BW_Blocks extends Block { public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { return false; } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java index 3661d8e3d7..451d435286 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java @@ -47,8 +47,8 @@ public class BW_GlasBlocks extends BW_Blocks { this.connectedTex = false; } - - public BW_GlasBlocks(String name, String[] texture, short[][] color, CreativeTabs tabs, boolean connectedTex, boolean fake) { + public BW_GlasBlocks( + String name, String[] texture, short[][] color, CreativeTabs tabs, boolean connectedTex, boolean fake) { super(name, texture, tabs, Material.glass); this.connectedTex = connectedTex; this.color = color; @@ -67,12 +67,10 @@ public class BW_GlasBlocks extends BW_Blocks { @Override @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockAccess worldClient, int xCoord, int yCoord, int zCoord, int aSide) { - if (worldClient.getBlock(xCoord, yCoord, zCoord) instanceof BW_GlasBlocks) - return false; + if (worldClient.getBlock(xCoord, yCoord, zCoord) instanceof BW_GlasBlocks) return false; return super.shouldSideBeRendered(worldClient, xCoord, yCoord, zCoord, aSide); } - @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { @@ -96,10 +94,7 @@ public class BW_GlasBlocks extends BW_Blocks { String[] splitname = this.textureNames[0].split(":"); for (int j = 0; j < 16; j++) { this.connectedTexture[j] = par1IconRegister.registerIcon( - splitname[0] - + ":connectedTex/" - + splitname[1] + '/' - + splitname[1] + '_' + j); + splitname[0] + ":connectedTex/" + splitname[1] + '/' + splitname[1] + '_' + j); } } } @@ -107,8 +102,7 @@ public class BW_GlasBlocks extends BW_Blocks { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(IBlockAccess worldClient, int xCoord, int yCoord, int zCoord, int aSide) { - if (!this.connectedTex) - return super.getIcon(worldClient, xCoord, yCoord, zCoord, aSide); + if (!this.connectedTex) return super.getIcon(worldClient, xCoord, yCoord, zCoord, aSide); ForgeDirection dir = ForgeDirection.getOrientation(aSide); byte sides = 0; @@ -146,7 +140,6 @@ public class BW_GlasBlocks extends BW_Blocks { if (worldClient.getBlock(xCoord, yCoord, zCoord + 1) instanceof BW_GlasBlocks) sides = (byte) (sides | 0b1000); break; - } case NORTH: { if (worldClient.getBlock(xCoord, yCoord + 1, zCoord) instanceof BW_GlasBlocks) @@ -186,10 +179,8 @@ public class BW_GlasBlocks extends BW_Blocks { @Override public int getRenderType() { - if (!this.fake && SideReference.Side.Client) - return RendererGlasBlock.RID; - else - return 0; + if (!this.fake && SideReference.Side.Client) return RendererGlasBlock.RID; + else return 0; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index 8f2d60ef39..e14ff9f491 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -66,14 +66,27 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI } @Override - public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + public boolean onBlockActivated( + World worldObj, + int x, + int y, + int z, + EntityPlayer player, + int p_149727_6_, + float p_149727_7_, + float p_149727_8_, + float p_149727_9_) { if (worldObj.isRemote) { return false; } TileEntity tile = worldObj.getTileEntity(x, y, z); if (tile instanceof BW_TileEntity_HeatedWaterPump) { - if (player.getHeldItem() != null && (player.getHeldItem().getItem().equals(Items.bucket) || player.getHeldItem().getItem() instanceof IFluidContainerItem) && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false) != null) - if (player.getHeldItem().getItem().equals(Items.bucket) && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false).amount == 1000) { + if (player.getHeldItem() != null + && (player.getHeldItem().getItem().equals(Items.bucket) + || player.getHeldItem().getItem() instanceof IFluidContainerItem) + && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false) != null) + if (player.getHeldItem().getItem().equals(Items.bucket) + && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false).amount == 1000) { ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, true); player.getHeldItem().stackSize--; if (player.getHeldItem().stackSize <= 0) @@ -125,7 +138,8 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI int[] dropSlots = ((ITileDropsContent) t).getDropSlots(); for (int dropSlot : dropSlots) { if (((ITileDropsContent) t).getStackInSlot(dropSlot) != null) - world.spawnEntityInWorld(new EntityItem(world, x, y, z, ((BW_TileEntity_HeatedWaterPump) t).getStackInSlot(dropSlot))); + world.spawnEntityInWorld(new EntityItem( + world, x, y, z, ((BW_TileEntity_HeatedWaterPump) t).getStackInSlot(dropSlot))); } } super.breakBlock(world, x, y, z, block, meta); @@ -141,8 +155,7 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI e.printStackTrace(); return super.getIcon(side, meta); } - } else - return super.getIcon(side, meta); + } else return super.getIcon(side, meta); } @Override @@ -154,8 +167,7 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI } catch (InstantiationException | IllegalAccessException e) { e.printStackTrace(); } - } else - super.registerBlockIcons(par1IconRegister); + } else super.registerBlockIcons(par1IconRegister); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java index 45f67ccfcb..ed4680dde8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java @@ -30,7 +30,8 @@ import net.minecraft.world.World; public class BW_TileEntityContainer_MachineBlock extends BW_TileEntityContainer { - public BW_TileEntityContainer_MachineBlock(Material p_i45386_1_, Class tileEntity, String blockName) { + public BW_TileEntityContainer_MachineBlock( + Material p_i45386_1_, Class tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); GregTech_API.registerMachineBlock(this, -1); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java index 6a8c62bb83..61429f10e1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java @@ -29,6 +29,7 @@ import cpw.mods.fml.relauncher.SideOnly; import ic2.api.tile.IWrenchable; import ic2.core.IC2; import ic2.core.IHasGui; +import java.util.List; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -45,17 +46,21 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import java.util.List; - public class BW_TileEntityContainer_Multiple extends BlockContainer { protected final String[] textureNames; protected final String name; protected final Class[] tileEntityArray; + @SideOnly(Side.CLIENT) protected IIcon[] texture; - public BW_TileEntityContainer_Multiple(Material p_i45386_1_, Class[] tileEntity, String blockName, String[] textureNames, CreativeTabs tabs) { + public BW_TileEntityContainer_Multiple( + Material p_i45386_1_, + Class[] tileEntity, + String blockName, + String[] textureNames, + CreativeTabs tabs) { super(p_i45386_1_); this.setHardness(15.0F); this.setResistance(30.0F); @@ -68,7 +73,16 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { } @Override - public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + public boolean onBlockActivated( + World worldObj, + int x, + int y, + int z, + EntityPlayer player, + int p_149727_6_, + float p_149727_7_, + float p_149727_8_, + float p_149727_9_) { if (worldObj.isRemote) { return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java index a135e7e315..5d06247dbc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java @@ -41,7 +41,7 @@ public class BioFluidBlock extends BlockFluidBase implements ITileEntityProvider public BioFluidBlock() { super(FluidLoader.ff, Material.water); this.setBlockName("BioFluidBlock"); - //this.setCreativeTab(MainMod.BioTab); + // this.setCreativeTab(MainMod.BioTab); this.textureName = "gregtech:fluids/fluid.molten.autogenerated"; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java index a49fbc5ae4..8b8d4c15d7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java @@ -23,12 +23,11 @@ package com.github.bartimaeusnek.bartworks.common.commands; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import java.lang.reflect.Field; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; -import java.lang.reflect.Field; - public class ChangeConfig extends CommandBase { @Override public String getCommandName() { @@ -43,7 +42,7 @@ public class ChangeConfig extends CommandBase { @Override @SuppressWarnings("rawtypes") public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { - try{ + try { Field f = ConfigHandler.class.getField(p_71515_2_[0]); Class c = f.getType(); if (c.equals(int.class)) { @@ -55,28 +54,26 @@ public class ChangeConfig extends CommandBase { return; } f.setInt(null, l); - } - else if (c.equals(long.class)) { + } else if (c.equals(long.class)) { long l; - try{ + try { l = Long.parseLong(p_71515_2_[1]); - }catch (NumberFormatException e){ + } catch (NumberFormatException e) { p_71515_1_.addChatMessage(new ChatComponentText("you need to enter a number!")); return; } f.setLong(null, l); - } - else if (c.equals(boolean.class)){ - if (p_71515_2_[1].equalsIgnoreCase("true") || p_71515_2_[1].equalsIgnoreCase("1") ) - f.setBoolean(null,true); - else if (p_71515_2_[1].equalsIgnoreCase("false") || p_71515_2_[1].equalsIgnoreCase("0") ) - f.setBoolean(null,false); + } else if (c.equals(boolean.class)) { + if (p_71515_2_[1].equalsIgnoreCase("true") || p_71515_2_[1].equalsIgnoreCase("1")) + f.setBoolean(null, true); + else if (p_71515_2_[1].equalsIgnoreCase("false") || p_71515_2_[1].equalsIgnoreCase("0")) + f.setBoolean(null, false); else { p_71515_1_.addChatMessage(new ChatComponentText("booleans need to be set to true or false")); } } p_71515_1_.addChatMessage(new ChatComponentText("Set " + p_71515_2_[0] + " to " + p_71515_2_[1])); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java index 0b179f0332..f41c1d384d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java @@ -40,6 +40,7 @@ public class GetWorkingDirectory extends CommandBase { @Override public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { - p_71515_1_.addChatMessage(new ChatComponentText(Minecraft.getMinecraft().mcDataDir.getAbsolutePath())); + p_71515_1_.addChatMessage( + new ChatComponentText(Minecraft.getMinecraft().mcDataDir.getAbsolutePath())); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java index 9b85abbedb..1a924e7322 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java @@ -22,15 +22,14 @@ package com.github.bartimaeusnek.bartworks.common.commands; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; - import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; public class PrintRecipeListToFile extends CommandBase { @Override @@ -50,9 +49,10 @@ public class PrintRecipeListToFile extends CommandBase { try { BufferedWriter fw = new BufferedWriter(new FileWriter(file)); - CraftingManager.getInstance().getRecipeList().forEach( e -> { + CraftingManager.getInstance().getRecipeList().forEach(e -> { try { - fw.write(e.toString() + " = " +((IRecipe)e).getRecipeOutput().getDisplayName() +"\n"); + fw.write(e.toString() + " = " + + ((IRecipe) e).getRecipeOutput().getDisplayName() + "\n"); } catch (IOException ex) { ex.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java index aedddf54f8..02f3454a03 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java @@ -41,14 +41,14 @@ public class SummonRuin extends CommandBase { @Override public void processCommand(ICommandSender iCommandSender, String[] p_71515_2_) { try { - new MapGenRuins.RuinsBase().generate( - iCommandSender.getEntityWorld(), - iCommandSender.getEntityWorld().rand, - Integer.parseInt(p_71515_2_[0]), - 256, - Integer.parseInt(p_71515_2_[1]) - ); - }catch (Exception e){ + new MapGenRuins.RuinsBase() + .generate( + iCommandSender.getEntityWorld(), + iCommandSender.getEntityWorld().rand, + Integer.parseInt(p_71515_2_[0]), + 256, + Integer.parseInt(p_71515_2_[1])); + } catch (Exception e) { e.printStackTrace(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index fdef73f046..6c918fb4e5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -22,15 +22,13 @@ package com.github.bartimaeusnek.bartworks.common.configs; - import com.github.bartimaeusnek.bartworks.API.API_ConfigValues; import com.github.bartimaeusnek.bartworks.ASM.BWCoreTransformer; -import net.minecraftforge.common.config.Configuration; - import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Set; +import net.minecraftforge.common.config.Configuration; public class ConfigHandler { @@ -83,108 +81,320 @@ public class ConfigHandler { public static boolean disablePistonInEIC = false; private static final int[][] METAFORTIERS_ENERGY = { - {100, 101, 102, 105}, - {1110, 1115, 1120, 1127}, - {1111, 12726, 1116, 1121, 1128}, - {1112, 12727, 1117, 1122, 1129}, - {12728, 1190, 1130, 12685}, - {1191, 1174, 695, 12686}, + {100, 101, 102, 105}, + {1110, 1115, 1120, 1127}, + {1111, 12726, 1116, 1121, 1128}, + {1112, 12727, 1117, 1122, 1129}, + {12728, 1190, 1130, 12685}, + {1191, 1174, 695, 12686}, }; private static final int[][] METAFORTIERS_BUFFER = { - {5133, 5123}, - {161, 171, 181, 191}, - {162, 172, 182, 192}, - {163, 173, 183, 193}, - {164, 174, 184, 194}, - {165, 175, 185, 195}, + {5133, 5123}, + {161, 171, 181, 191}, + {162, 172, 182, 192}, + {163, 173, 183, 193}, + {164, 174, 184, 194}, + {165, 175, 185, 195}, }; private static final int[][] METAFORTIERS_CABLE = { - {5133, 5123}, - {1210, 1230, 1250, 1270, 1290}, - {1310, 1330, 1350, 1370, 1390}, - {1410, 1430, 1450, 1470, 1490}, - {1510, 1530, 1550, 1570, 1590}, - {1650, 1670, 1690}, + {5133, 5123}, + {1210, 1230, 1250, 1270, 1290}, + {1310, 1330, 1350, 1370, 1390}, + {1410, 1430, 1450, 1470, 1490}, + {1510, 1530, 1550, 1570, 1590}, + {1650, 1670, 1690}, }; private static final int[][] METAFORTIERS_MACHINE = { - {103, 104, 106, 107, 109, 110, 112, 113, 115, 116, 118, 119}, - {201, 211, 221, 231, 241, 251, 261, 271, 281, 291, 301, 311, 321, 331, 341, 351, 361, 371, 381, 391, 401, 411, 421, 431, 441, 451, 461, 471, 481, 491, 501, 511, 521, 531, 541, 551, 561, 571, 581, 591, 601, 611, 621, 631, 641, 651, 661, 671}, - {202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 302, 312, 322, 332, 342, 352, 362, 372, 382, 392, 402, 412, 422, 432, 442, 452, 462, 472, 482, 492, 502, 512, 522, 532, 542, 552, 562, 572, 582, 592, 602, 612, 622, 632, 642, 652, 662, 672}, - {203, 213, 223, 233, 243, 253, 263, 273, 283, 293, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 403, 413, 423, 433, 443, 453, 463, 473, 483, 493, 503, 513, 523, 533, 543, 553, 563, 573, 583, 593, 603, 613, 623, 633, 643, 653, 663, 673}, - {204, 214, 224, 234, 244, 254, 264, 274, 284, 294, 304, 314, 324, 334, 344, 354, 364, 374, 384, 394, 404, 414, 424, 434, 444, 454, 464, 474, 484, 494, 504, 514, 524, 534, 544, 554, 564, 574, 584, 594, 604, 614, 624, 634, 644, 654, 664, 674}, - {205, 215, 225, 235, 245, 255, 265, 275, 285, 295, 305, 315, 325, 335, 345, 355, 365, 375, 385, 395, 405, 415, 425, 435, 445, 455, 465, 475, 485, 495, 505, 515, 525, 535, 545, 555, 565, 575, 585, 595, 605, 615, 625, 635, 645, 655, 665, 675}, + {103, 104, 106, 107, 109, 110, 112, 113, 115, 116, 118, 119}, + { + 201, 211, 221, 231, 241, 251, 261, 271, 281, 291, 301, 311, 321, 331, 341, 351, 361, 371, 381, 391, 401, + 411, 421, 431, 441, 451, 461, 471, 481, 491, 501, 511, 521, 531, 541, 551, 561, 571, 581, 591, 601, 611, + 621, 631, 641, 651, 661, 671 + }, + { + 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 302, 312, 322, 332, 342, 352, 362, 372, 382, 392, 402, + 412, 422, 432, 442, 452, 462, 472, 482, 492, 502, 512, 522, 532, 542, 552, 562, 572, 582, 592, 602, 612, + 622, 632, 642, 652, 662, 672 + }, + { + 203, 213, 223, 233, 243, 253, 263, 273, 283, 293, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 403, + 413, 423, 433, 443, 453, 463, 473, 483, 493, 503, 513, 523, 533, 543, 553, 563, 573, 583, 593, 603, 613, + 623, 633, 643, 653, 663, 673 + }, + { + 204, 214, 224, 234, 244, 254, 264, 274, 284, 294, 304, 314, 324, 334, 344, 354, 364, 374, 384, 394, 404, + 414, 424, 434, 444, 454, 464, 474, 484, 494, 504, 514, 524, 534, 544, 554, 564, 574, 584, 594, 604, 614, + 624, 634, 644, 654, 664, 674 + }, + { + 205, 215, 225, 235, 245, 255, 265, 275, 285, 295, 305, 315, 325, 335, 345, 355, 365, 375, 385, 395, 405, + 415, 425, 435, 445, 455, 465, 475, 485, 495, 505, 515, 525, 535, 545, 555, 565, 575, 585, 595, 605, 615, + 625, 635, 645, 655, 665, 675 + }, + }; + private static int[][][] defaultMetasForTiers = { + METAFORTIERS_ENERGY, METAFORTIERS_BUFFER, METAFORTIERS_CABLE, METAFORTIERS_MACHINE + }; + private static final String[] VOLTAGE_NAMES = new String[] { + "High Pressure Steam", + "Low Voltage", + "Medium Voltage", + "High Voltage", + "Extreme Voltage", + "Insane Voltage", + "Ludicrous Voltage", + "ZPM Voltage", + "Ultimate Voltage", + "Ultimate High Voltage", + "Ultimate Extreme Voltage", + "Ultimate Insane Voltage", + "Ultimate Mega Voltage", + "Ultimate Extended Mega Voltage", + "Overpowered Voltage", + "Maximum Voltage" }; - private static int[][][] defaultMetasForTiers = {METAFORTIERS_ENERGY, METAFORTIERS_BUFFER, METAFORTIERS_CABLE, METAFORTIERS_MACHINE}; - private static final String[] VOLTAGE_NAMES = new String[]{"High Pressure Steam", "Low Voltage", "Medium Voltage", "High Voltage", "Extreme Voltage", "Insane Voltage", "Ludicrous Voltage", "ZPM Voltage", "Ultimate Voltage", "Ultimate High Voltage", "Ultimate Extreme Voltage", "Ultimate Insane Voltage", "Ultimate Mega Voltage", "Ultimate Extended Mega Voltage", "Overpowered Voltage", "Maximum Voltage"}; private static final String[] names = {"Generators", "Buffers", "Cables", "Machines"}; public ConfigHandler(Configuration C) { ConfigHandler.c = C; - ConfigHandler.classicMode= ConfigHandler.c.get("System", "Enable Classic Mode", false, "Enables the classic Mode (all recipes in normal machines are doable in MV").getBoolean(false); - ConfigHandler.creativeScannerID = ConfigHandler.c.get("System", "Creative Debug Scanner", 0, "ID for the Creative Debug Scanner Block").getInt(0); - - ConfigHandler.tooltips = ConfigHandler.c.get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips").getBoolean(true); - ConfigHandler.sharedItemStackTooltip = ConfigHandler.c.get("System", "BartWorksSharedItemStackToolTips", true, "If you wish to enable \"Shared Item Stack\" tooltips").getBoolean(true); - - ConfigHandler.IDOffset = ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600); - ConfigHandler.ezmode = ConfigHandler.c.get("System", "Mode switch", false, "If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false); - ConfigHandler.teslastaff = ConfigHandler.c.get("System", "Enable Teslastaff", false, "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); - ConfigHandler.newStuff = !ConfigHandler.c.get("System", "Disable non-original-GT-stuff", false, "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false); - ConfigHandler.BioLab = !ConfigHandler.c.get("System", "Disable BioLab", false, "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!").getBoolean(false); - ConfigHandler.cutoffTier = ConfigHandler.c.get("System", "Tier to nerf circuits", 5, "This switch sets the lowest unnerfed Circuit Recipe Tier. -1 to disable it completely.",-1, VOLTAGE_NAMES.length).getInt(5); + ConfigHandler.classicMode = ConfigHandler.c + .get( + "System", + "Enable Classic Mode", + false, + "Enables the classic Mode (all recipes in normal machines are doable in MV") + .getBoolean(false); + ConfigHandler.creativeScannerID = ConfigHandler.c + .get("System", "Creative Debug Scanner", 0, "ID for the Creative Debug Scanner Block") + .getInt(0); + + ConfigHandler.tooltips = ConfigHandler.c + .get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips") + .getBoolean(true); + ConfigHandler.sharedItemStackTooltip = ConfigHandler.c + .get( + "System", + "BartWorksSharedItemStackToolTips", + true, + "If you wish to enable \"Shared Item Stack\" tooltips") + .getBoolean(true); + + ConfigHandler.IDOffset = ConfigHandler.c + .get( + "System", + "ID Offset", + 12600, + "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS") + .getInt(12600); + ConfigHandler.ezmode = ConfigHandler.c + .get( + "System", + "Mode switch", + false, + "If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.") + .getBoolean(false); + ConfigHandler.teslastaff = ConfigHandler.c + .get( + "System", + "Enable Teslastaff", + false, + "Enables the Teslastaff, an Item used to destroy Electric Armors") + .getBoolean(false); + ConfigHandler.newStuff = !ConfigHandler.c + .get( + "System", + "Disable non-original-GT-stuff", + false, + "This switch disables my new content, that is not part of the GT2 compat") + .getBoolean(false); + ConfigHandler.BioLab = !ConfigHandler.c + .get( + "System", + "Disable BioLab", + false, + "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!") + .getBoolean(false); + ConfigHandler.cutoffTier = ConfigHandler.c + .get( + "System", + "Tier to nerf circuits", + 5, + "This switch sets the lowest unnerfed Circuit Recipe Tier. -1 to disable it completely.", + -1, + VOLTAGE_NAMES.length) + .getInt(5); ConfigHandler.cutoffTier = (ConfigHandler.cutoffTier == -1 ? VOLTAGE_NAMES.length : ConfigHandler.cutoffTier); - ConfigHandler.disableExtraGassesForEBF = ConfigHandler.c.get("System", "Disable Extra Gases for EBF", false, "This switch disables extra gas recipes for the EBF, i.e. Xenon instead of Nitrogen").getBoolean(false); - ConfigHandler.disableBoltedBlocksCasing = ConfigHandler.c.get("System", "Disable Bolted Casings", false, "This switch disable the generation of bolted casings").getBoolean(false); - ConfigHandler.disableReboltedBlocksCasing = ConfigHandler.c.get("System", "Disable Rebolted Casings", false, "This switch disable the generation of rebolted casings").getBoolean(false); - - ConfigHandler.mbWaterperSec = ConfigHandler.c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150).getInt(150); - - ConfigHandler.energyPerCell = ConfigHandler.c.get("Multiblocks", "energyPerLESUCell", 1000000, "This will set Up the Energy per LESU Cell", 1000000, Integer.MAX_VALUE).getInt(1000000); - ConfigHandler.DEHPDirectSteam = ConfigHandler.c.get("Multiblocks", "DEHP Direct Steam Mode", false, "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant").getBoolean(false); - ConfigHandler.megaMachinesMax = ConfigHandler.c.get("Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256); - ConfigHandler.bioVatMaxParallelBonus = ConfigHandler.c.get("Multiblocks","BioVat Maximum Bonus on Recipes", 1000,"This are the maximum parallel Operations the BioVat can do, when the output is half full.").getInt(1000); - ConfigHandler.voidMinerBlacklist = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(ConfigHandler.c.get("Multiblocks", "Void Miner Blacklist", new String[0], "This is a blacklist for the Void Miner, blacklisted ores will not enter the drop prize pool. Please fill in the Unique Identifier of Ore and connect Damage with a colon, For example: gregtech:gt.blockores:32").getStringList()))); - ConfigHandler.disablePistonInEIC = ConfigHandler.c.get("Multiblocks", "Disable Electric Implosion Compressor piston", false, "This switch completely disables piston animation in Electric Implosion Compressor multiblock").getBoolean(false); - - ConfigHandler.pollutionHeatedWaterPumpSecond = ConfigHandler.c.get("Pollution", "Pollution produced per second by the water pump", ConfigHandler.pollutionHeatedWaterPumpSecond, "How much should the Simple Stirling Water Pump produce pollution per second").getInt(ConfigHandler.pollutionHeatedWaterPumpSecond); - ConfigHandler.basePollutionMBFSecond = ConfigHandler.c.get("Pollution", "Pollution produced per tick by the MBF per ingot", ConfigHandler.basePollutionMBFSecond,"How much should the MBF produce pollution per tick per ingot. Then it'll be multiplied by the amount of ingots done in parallel").getInt(ConfigHandler.basePollutionMBFSecond); + ConfigHandler.disableExtraGassesForEBF = ConfigHandler.c + .get( + "System", + "Disable Extra Gases for EBF", + false, + "This switch disables extra gas recipes for the EBF, i.e. Xenon instead of Nitrogen") + .getBoolean(false); + ConfigHandler.disableBoltedBlocksCasing = ConfigHandler.c + .get("System", "Disable Bolted Casings", false, "This switch disable the generation of bolted casings") + .getBoolean(false); + ConfigHandler.disableReboltedBlocksCasing = ConfigHandler.c + .get( + "System", + "Disable Rebolted Casings", + false, + "This switch disable the generation of rebolted casings") + .getBoolean(false); + + ConfigHandler.mbWaterperSec = ConfigHandler.c + .get("Singleblocks", "mL Water per Sec for the StirlingPump", 150) + .getInt(150); + + ConfigHandler.energyPerCell = ConfigHandler.c + .get( + "Multiblocks", + "energyPerLESUCell", + 1000000, + "This will set Up the Energy per LESU Cell", + 1000000, + Integer.MAX_VALUE) + .getInt(1000000); + ConfigHandler.DEHPDirectSteam = ConfigHandler.c + .get( + "Multiblocks", + "DEHP Direct Steam Mode", + false, + "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant") + .getBoolean(false); + ConfigHandler.megaMachinesMax = ConfigHandler.c + .get( + "Multiblocks", + "Mega Machines Maximum Recipes per Operation", + 256, + "This changes the Maximum Recipes per Operation to the specified Valure") + .getInt(256); + ConfigHandler.bioVatMaxParallelBonus = ConfigHandler.c + .get( + "Multiblocks", + "BioVat Maximum Bonus on Recipes", + 1000, + "This are the maximum parallel Operations the BioVat can do, when the output is half full.") + .getInt(1000); + ConfigHandler.voidMinerBlacklist = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(ConfigHandler.c + .get( + "Multiblocks", + "Void Miner Blacklist", + new String[0], + "This is a blacklist for the Void Miner, blacklisted ores will not enter the drop prize pool. Please fill in the Unique Identifier of Ore and connect Damage with a colon, For example: gregtech:gt.blockores:32") + .getStringList()))); + ConfigHandler.disablePistonInEIC = ConfigHandler.c + .get( + "Multiblocks", + "Disable Electric Implosion Compressor piston", + false, + "This switch completely disables piston animation in Electric Implosion Compressor multiblock") + .getBoolean(false); + + ConfigHandler.pollutionHeatedWaterPumpSecond = ConfigHandler.c + .get( + "Pollution", + "Pollution produced per second by the water pump", + ConfigHandler.pollutionHeatedWaterPumpSecond, + "How much should the Simple Stirling Water Pump produce pollution per second") + .getInt(ConfigHandler.pollutionHeatedWaterPumpSecond); + ConfigHandler.basePollutionMBFSecond = ConfigHandler.c + .get( + "Pollution", + "Pollution produced per tick by the MBF per ingot", + ConfigHandler.basePollutionMBFSecond, + "How much should the MBF produce pollution per tick per ingot. Then it'll be multiplied by the amount of ingots done in parallel") + .getInt(ConfigHandler.basePollutionMBFSecond); if (ConfigHandler.IDOffset == 0) { ConfigHandler.IDOffset = 12600; - ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600); + ConfigHandler.c + .get( + "System", + "ID Offset", + 12600, + "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS") + .set(12600); } - ConfigHandler.GTppLogDisabler = ConfigHandler.c.get("System", "Disable GT++ Logging", false, "Enables or Disables GT++ Logging.").getBoolean(false); - API_ConfigValues.debugLog = ConfigHandler.c.get("System", "Enable Debug Log", false, "Enables or Disables the debug log.").getBoolean(false); + ConfigHandler.GTppLogDisabler = ConfigHandler.c + .get("System", "Disable GT++ Logging", false, "Enables or Disables GT++ Logging.") + .getBoolean(false); + API_ConfigValues.debugLog = ConfigHandler.c + .get("System", "Enable Debug Log", false, "Enables or Disables the debug log.") + .getBoolean(false); for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) - BWCoreTransformer.shouldTransform[i] = ConfigHandler.c.get("ASM fixes", BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i], true).getBoolean(true); + BWCoreTransformer.shouldTransform[i] = ConfigHandler.c + .get( + "ASM fixes", + BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " + + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i], + true) + .getBoolean(true); ConfigHandler.enabledPatches = new boolean[BWCoreTransformer.shouldTransform.length]; - ConfigHandler.enabledPatches = Arrays.copyOf(BWCoreTransformer.shouldTransform,BWCoreTransformer.shouldTransform.length); - ConfigHandler.ross128BID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64); - ConfigHandler.ross128BAID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128ba", -63, "The Dim ID for Ross128ba (Ross128b's Moon)").getInt(-63); - ConfigHandler.ross128btier = ConfigHandler.c.get("CrossMod Interactions", "Rocket Tier - Ross128b", 3, "The Rocket Tier for Ross128b").getInt(3); - ConfigHandler.ross128batier = ConfigHandler.c.get("CrossMod Interactions", "Rocket Tier - Ross128ba", 3, "The Rocket Tier for Ross128a").getInt(3); - ConfigHandler.ross128bRuinChance = ConfigHandler.c.get("CrossMod Interactions", "Ruin Chance - Ross128b", 512, "Higher Values mean lesser Ruins.").getInt(512); - ConfigHandler.Ross128Enabled = ConfigHandler.c.get("CrossMod Interactions", "Galacticraft - Activate Ross128 System", true, "If the Ross128 System should be activated, DO NOT CHANGE AFTER WORLD GENERATION").getBoolean(true); - ConfigHandler.landerType = ConfigHandler.c.get("CrossMod Interactions", "LanderType", 3, "1 = Moon Lander, 2 = Landing Balloons, 3 = Asteroid Lander").getInt(3); - ConfigHandler.disableMagicalForest = ConfigHandler.c.get("CrossMod Interactions", "Disable Magical Forest - Ross128b", false, "True disables the magical Forest Biome on Ross for more performance during World generation.").getBoolean(false); - - ConfigHandler.maxTierRoss = (byte) ConfigHandler.c.get("Ross Ruin Metas", "A_Ruin Machine Tiers",6,"", 0, VOLTAGE_NAMES.length).getInt(6); + ConfigHandler.enabledPatches = + Arrays.copyOf(BWCoreTransformer.shouldTransform, BWCoreTransformer.shouldTransform.length); + ConfigHandler.ross128BID = ConfigHandler.c + .get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b") + .getInt(-64); + ConfigHandler.ross128BAID = ConfigHandler.c + .get("CrossMod Interactions", "DimID - Ross128ba", -63, "The Dim ID for Ross128ba (Ross128b's Moon)") + .getInt(-63); + ConfigHandler.ross128btier = ConfigHandler.c + .get("CrossMod Interactions", "Rocket Tier - Ross128b", 3, "The Rocket Tier for Ross128b") + .getInt(3); + ConfigHandler.ross128batier = ConfigHandler.c + .get("CrossMod Interactions", "Rocket Tier - Ross128ba", 3, "The Rocket Tier for Ross128a") + .getInt(3); + ConfigHandler.ross128bRuinChance = ConfigHandler.c + .get("CrossMod Interactions", "Ruin Chance - Ross128b", 512, "Higher Values mean lesser Ruins.") + .getInt(512); + ConfigHandler.Ross128Enabled = ConfigHandler.c + .get( + "CrossMod Interactions", + "Galacticraft - Activate Ross128 System", + true, + "If the Ross128 System should be activated, DO NOT CHANGE AFTER WORLD GENERATION") + .getBoolean(true); + ConfigHandler.landerType = ConfigHandler.c + .get( + "CrossMod Interactions", + "LanderType", + 3, + "1 = Moon Lander, 2 = Landing Balloons, 3 = Asteroid Lander") + .getInt(3); + ConfigHandler.disableMagicalForest = ConfigHandler.c + .get( + "CrossMod Interactions", + "Disable Magical Forest - Ross128b", + false, + "True disables the magical Forest Biome on Ross for more performance during World generation.") + .getBoolean(false); + + ConfigHandler.maxTierRoss = (byte) ConfigHandler.c + .get("Ross Ruin Metas", "A_Ruin Machine Tiers", 6, "", 0, VOLTAGE_NAMES.length) + .getInt(6); ConfigHandler.metasForTiers = new int[4][maxTierRoss][]; for (int i = 0; i < 4; i++) { if (maxTierRoss > ConfigHandler.defaultMetasForTiers[i].length) ConfigHandler.defaultMetasForTiers[i] = new int[maxTierRoss][0]; for (int j = 0; j < maxTierRoss; j++) - ConfigHandler.metasForTiers[i][j] = ConfigHandler.c.get("Ross Ruin Metas", j+"_Ruin " + names[i] +" Tier " + VOLTAGE_NAMES[j], ConfigHandler.defaultMetasForTiers[i][j]).getIntList(); + ConfigHandler.metasForTiers[i][j] = ConfigHandler.c + .get( + "Ross Ruin Metas", + j + "_Ruin " + names[i] + " Tier " + VOLTAGE_NAMES[j], + ConfigHandler.defaultMetasForTiers[i][j]) + .getIntList(); } ConfigHandler.setUpComments(); - if (ConfigHandler.c.hasChanged()) - ConfigHandler.c.save(); + if (ConfigHandler.c.hasChanged()) ConfigHandler.c.save(); } private static void setUpComments() { @@ -192,7 +402,9 @@ public class ConfigHandler { ConfigHandler.c.addCustomCategoryComment("Singleblocks", "Singleblock Options can be set here."); ConfigHandler.c.addCustomCategoryComment("Multiblocks", "Multiblock Options can be set here."); ConfigHandler.c.addCustomCategoryComment("System", "Different System Settings can be set here."); - ConfigHandler.c.addCustomCategoryComment("CrossMod Interactions", "CrossMod Interaction Settings can be set here. For Underground Fluid settings change the Gregtech.cfg!"); + ConfigHandler.c.addCustomCategoryComment( + "CrossMod Interactions", + "CrossMod Interaction Settings can be set here. For Underground Fluid settings change the Gregtech.cfg!"); ConfigHandler.c.addCustomCategoryComment("Ross Ruin Metas", "Ruin Metas and Tiers can be set here."); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index 28f7087956..e0565ec316 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -31,6 +31,8 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_LanguageManager; +import java.util.Arrays; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.entity.player.EntityPlayer; @@ -39,13 +41,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; -import java.util.Arrays; -import java.util.List; - public class BW_ItemBlocks extends ItemBlock { - private final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); - private final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + private final String mNoMobsToolTip = + GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + private final String mNoTileEntityToolTip = + GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); public BW_ItemBlocks(Block par1) { super(par1); @@ -70,14 +71,14 @@ public class BW_ItemBlocks extends ItemBlock { public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { byte tier = BorosilicateGlass.getTier(this.field_150939_a, aStack.getItemDamage()); if (tier >= 0) { - aList.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + BW_ColorUtil.getColorForTier(tier) + GT_Values.VN[tier]); + aList.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + BW_ColorUtil.getColorForTier(tier) + + GT_Values.VN[tier]); } if (this.field_150939_a instanceof ITileAddsInformation) { aList.addAll(Arrays.asList(((ITileAddsInformation) this.field_150939_a).getInfoData())); } aList.add(this.mNoMobsToolTip); - if (!(this.field_150939_a instanceof ITileEntityProvider)) - aList.add(this.mNoTileEntityToolTip); + if (!(this.field_150939_a instanceof ITileEntityProvider)) aList.add(this.mNoTileEntityToolTip); aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java index ff9f43cdbf..dc606f9e73 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java @@ -27,6 +27,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ic2.core.WorldData; +import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -35,8 +36,6 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import java.util.List; - public class BW_SimpleWindMeter extends Item { public BW_SimpleWindMeter() { @@ -58,20 +57,33 @@ public class BW_SimpleWindMeter extends Item { public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean p_77624_4_) { super.addInformation(itemStack, entityPlayer, list, p_77624_4_); list.add(StatCollector.translateToLocal("tooltip.windmeter.0.name")); - list.add(StatCollector.translateToLocal("tooltip.windmeter.1.name") + " " + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); + list.add(StatCollector.translateToLocal("tooltip.windmeter.1.name") + " " + + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); list.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) { - if (entityPlayer.worldObj.isRemote || world == null || WorldData.get(world) == null || WorldData.get(world).windSim == null) - return itemStack; + if (entityPlayer.worldObj.isRemote + || world == null + || WorldData.get(world) == null + || WorldData.get(world).windSim == null) return itemStack; float windStrength = (float) WorldData.get(world).windSim.getWindAt(entityPlayer.posY); - String windS = windStrength < 1f ? StatCollector.translateToLocal("tooltip.windmeter.2.name") : windStrength < 10f ? StatCollector.translateToLocal("tooltip.windmeter.3.name") : windStrength < 20f ? StatCollector.translateToLocal("tooltip.windmeter.4.name") : windStrength < 30f ? StatCollector.translateToLocal("tooltip.windmeter.5.name") : windStrength < 50f ? StatCollector.translateToLocal("tooltip.windmeter.6.name") : StatCollector.translateToLocal("tooltip.windmeter.7.name"); - entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip.windmeter.8.name") + " " + windS + ".")); + String windS = windStrength < 1f + ? StatCollector.translateToLocal("tooltip.windmeter.2.name") + : windStrength < 10f + ? StatCollector.translateToLocal("tooltip.windmeter.3.name") + : windStrength < 20f + ? StatCollector.translateToLocal("tooltip.windmeter.4.name") + : windStrength < 30f + ? StatCollector.translateToLocal("tooltip.windmeter.5.name") + : windStrength < 50f + ? StatCollector.translateToLocal("tooltip.windmeter.6.name") + : StatCollector.translateToLocal("tooltip.windmeter.7.name"); + entityPlayer.addChatMessage( + new ChatComponentText(StatCollector.translateToLocal("tooltip.windmeter.8.name") + " " + windS + ".")); itemStack.damageItem(1, entityPlayer); return itemStack; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index 9731b4da3b..f2559f3066 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.common.items; +import static ic2.api.item.IKineticRotor.GearboxType.WATER; +import static ic2.api.item.IKineticRotor.GearboxType.WIND; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; @@ -29,6 +32,7 @@ import cpw.mods.fml.relauncher.SideOnly; import ic2.api.item.IKineticRotor; import ic2.core.block.kineticgenerator.gui.GuiWaterKineticGenerator; import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator; +import java.util.List; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -37,11 +41,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; -import java.util.List; - -import static ic2.api.item.IKineticRotor.GearboxType.WATER; -import static ic2.api.item.IKineticRotor.GearboxType.WIND; - public class BW_Stonage_Rotors extends Item implements IKineticRotor { private final int[] DiaMinMax = new int[3]; @@ -50,7 +49,16 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { private final ResourceLocation tex; private final String itemTex; - public BW_Stonage_Rotors(int diameter, float eff, int min, int max, int durability, IKineticRotor.GearboxType type, ResourceLocation tex, String Name, String itemTex) { + public BW_Stonage_Rotors( + int diameter, + float eff, + int min, + int max, + int durability, + IKineticRotor.GearboxType type, + ResourceLocation tex, + String Name, + String itemTex) { this.DiaMinMax[0] = diameter; this.DiaMinMax[1] = min; this.DiaMinMax[2] = max; @@ -70,7 +78,8 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { @SuppressWarnings("unchecked") public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { - info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", this.DiaMinMax[1], this.DiaMinMax[2])); + info.add(StatCollector.translateToLocalFormatted( + "ic2.itemrotor.wind.info", this.DiaMinMax[1], this.DiaMinMax[2])); IKineticRotor.GearboxType type = null; if (Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator) { type = WATER; @@ -78,7 +87,8 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { type = WIND; } info.add(StatCollector.translateToLocal("tooltip.rotor.0.name") + " " + this.DiaMinMax[0]); - info.add(StatCollector.translateToLocal("tooltip.rotor.1.name") + " " + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); + info.add(StatCollector.translateToLocal("tooltip.rotor.1.name") + " " + + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); info.add(StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + this.eff); if (type != null) { info.add(StatCollector.translateToLocal(("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type)))); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index c65f9c42ad..fde6eaa2f4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -31,6 +31,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.items.GT_Generic_Item; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; +import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -39,8 +40,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import java.util.List; - public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem { private static final int COST_PER_USE = 100; @@ -56,8 +55,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem (s, p) -> { ElectricItem.manager.use(s, COST_PER_USE, p); return s; - } - ); + }); } @Override @@ -65,7 +63,10 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); if (aStack != null && aStack.getTagCompound() != null) - aList.add(StatCollector.translateToLocal("tooltip.cp.0.name") + " " + (aStack.getTagCompound().getBoolean("HasChip") ? StatCollector.translateToLocal("tooltip.bw.yes.name") : StatCollector.translateToLocal("tooltip.bw.no.name"))); + aList.add(StatCollector.translateToLocal("tooltip.cp.0.name") + " " + + (aStack.getTagCompound().getBoolean("HasChip") + ? StatCollector.translateToLocal("tooltip.bw.yes.name") + : StatCollector.translateToLocal("tooltip.bw.no.name"))); aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @@ -124,5 +125,4 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem public double getTransferLimit(ItemStack itemStack) { return GT_Values.V[1]; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java index 15e16008ad..c116290257 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -27,13 +27,12 @@ import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.items.GT_Generic_Item; +import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import java.util.List; - public class GT_Destructopack_Item extends GT_Generic_Item { public GT_Destructopack_Item() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index a1b222f7c3..d7e0cf19f5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -30,6 +30,9 @@ import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -46,17 +49,16 @@ import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { - private static Set mineableBlocks = Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); + private static Set mineableBlocks = + Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); private final int mCharge; private final int mTransfer; public int mTier; + @SideOnly(Side.CLIENT) private IIcon icon; + private final int multi; public GT_Rockcutter_Item(int aTier) { @@ -73,6 +75,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { this.setNoRepair(); this.setUnlocalizedName("GT_Rockcutter_Item_" + GT_Values.VN[this.mTier]); } + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { aList.add(StatCollector.translateToLocal("tooltip.bw.tier.name") + " " + GT_Values.VN[this.mTier]); @@ -89,12 +92,23 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { } } - public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + public boolean onItemUse( + ItemStack aStack, + EntityPlayer aPlayer, + World p_77648_3_, + int p_77648_4_, + int p_77648_5_, + int p_77648_6_, + int p_77648_7_, + float p_77648_8_, + float p_77648_9_, + float p_77648_10_) { ElectricItem.manager.use(aStack, 0, aPlayer); return false; } - public boolean onBlockDestroyed(ItemStack var1, World var2, Block var3, int var4, int var5, int var6, EntityLivingBase var7) { + public boolean onBlockDestroyed( + ItemStack var1, World var2, Block var3, int var4, int var5, int var6, EntityLivingBase var7) { ElectricItem.manager.use(var1, 0, var7); if (ElectricItem.manager.canUse(var1, 500 * this.multi)) { ElectricItem.manager.use(var1, 500 * this.multi, var7); @@ -106,7 +120,14 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { @Override public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) { - return par1Block.getMaterial().equals(Material.glass) || par1Block.getMaterial().equals(Material.clay) || par1Block.getMaterial().equals(Material.packedIce) || par1Block.getMaterial().equals(Material.ice) || par1Block.getMaterial().equals(Material.sand) || par1Block.getMaterial().equals(Material.ground) || par1Block.getMaterial().equals(Material.rock) || mineableBlocks.contains(par1Block); + return par1Block.getMaterial().equals(Material.glass) + || par1Block.getMaterial().equals(Material.clay) + || par1Block.getMaterial().equals(Material.packedIce) + || par1Block.getMaterial().equals(Material.ice) + || par1Block.getMaterial().equals(Material.sand) + || par1Block.getMaterial().equals(Material.ground) + || par1Block.getMaterial().equals(Material.rock) + || mineableBlocks.contains(par1Block); } @SideOnly(Side.CLIENT) @@ -123,7 +144,6 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { } } - @Override public boolean canProvideEnergy(ItemStack itemStack) { return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java index 9b4c1ba51c..00a10b7c9e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -29,6 +29,8 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; +import java.util.List; +import java.util.Set; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -42,14 +44,12 @@ import net.minecraft.item.ItemTool; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; -import java.util.List; -import java.util.Set; - public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { private static final Set effective = Sets.newHashSet(Blocks.web); private final double mCharge; private final double mTransfer; public int mTier; + @SideOnly(Side.CLIENT) private IIcon icon; @@ -77,7 +77,8 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { EntityLiving tTarget = (EntityLiving) aTarget; ElectricItem.manager.use(aStack, 9000000, aPlayer); for (int i = 1; i < 5; ++i) { - if (tTarget.getEquipmentInSlot(i) != null && tTarget.getEquipmentInSlot(i).getItem() instanceof IElectricItem) { + if (tTarget.getEquipmentInSlot(i) != null + && tTarget.getEquipmentInSlot(i).getItem() instanceof IElectricItem) { tTarget.setCurrentItemOrArmor(i, null); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java index 8d0dfcbb60..ad2a780136 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java @@ -23,12 +23,11 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; +import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; -import java.util.List; - public class LabModule extends SimpleSubItemClass { public LabModule(String[] tex) { super(tex); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java index c98bdf232a..f22ebf56aa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -22,12 +22,15 @@ package com.github.bartimaeusnek.bartworks.common.items; +import static com.github.bartimaeusnek.bartworks.common.loaders.BioItemList.*; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.BioCulture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; @@ -35,10 +38,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; -import java.util.List; - -import static com.github.bartimaeusnek.bartworks.common.loaders.BioItemList.*; - public class LabParts extends SimpleSubItemClass { public LabParts(String[] tex) { @@ -49,12 +48,12 @@ public class LabParts extends SimpleSubItemClass { @Override public EnumRarity getRarity(ItemStack itemStack) { - if (itemStack == null || itemStack.getTagCompound() == null) - return EnumRarity.common; + if (itemStack == null || itemStack.getTagCompound() == null) return EnumRarity.common; switch (itemStack.getItemDamage()) { case 0: - return BW_Util.getRarityFromByte(itemStack.getTagCompound().getCompoundTag("DNA").getByte("Rarity")); + return BW_Util.getRarityFromByte( + itemStack.getTagCompound().getCompoundTag("DNA").getByte("Rarity")); case 1: case 2: return BW_Util.getRarityFromByte(itemStack.getTagCompound().getByte("Rarity")); @@ -66,7 +65,10 @@ public class LabParts extends SimpleSubItemClass { @Override @SideOnly(Side.CLIENT) public int getColorFromItemStack(ItemStack stack, int p_82790_2_) { - if (stack.getItemDamage() == 0 && stack.getTagCompound() != null && stack.getTagCompound().getIntArray("Color") != null && stack.getTagCompound().getIntArray("Color").length > 0) { + if (stack.getItemDamage() == 0 + && stack.getTagCompound() != null + && stack.getTagCompound().getIntArray("Color") != null + && stack.getTagCompound().getIntArray("Color").length > 0) { int[] rgb = stack.getTagCompound().getIntArray("Color"); return BW_ColorUtil.getColorFromRGBArray(rgb); } @@ -76,8 +78,7 @@ public class LabParts extends SimpleSubItemClass { @Override @SuppressWarnings("unchecked") public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean b) { - if (itemStack == null) - return; + if (itemStack == null) return; if (itemStack.getTagCompound() == null) { switch (itemStack.getItemDamage()) { @@ -107,16 +108,22 @@ public class LabParts extends SimpleSubItemClass { switch (itemStack.getItemDamage()) { case 0: - list.add(StatCollector.translateToLocal("tooltip.labparts.5.name") + " " + itemStack.getTagCompound().getString("Name") + (culture != null ? " ("+culture.getLocalisedName()+")" : "")); + list.add(StatCollector.translateToLocal("tooltip.labparts.5.name") + " " + + itemStack.getTagCompound().getString("Name") + + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); if (!itemStack.getTagCompound().getBoolean("Breedable")) { list.add(StatCollector.translateToLocal("tooltip.labparts.6.name")); } break; case 1: - list.add(StatCollector.translateToLocal("tooltip.labparts.7.name") + " " + itemStack.getTagCompound().getString("Name") + (culture != null ? " ("+culture.getLocalisedName()+")" : "")); + list.add(StatCollector.translateToLocal("tooltip.labparts.7.name") + " " + + itemStack.getTagCompound().getString("Name") + + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); break; case 2: - list.add(StatCollector.translateToLocal("tooltip.labparts.8.name") + " " + itemStack.getTagCompound().getString("Name") + (culture != null ? " ("+culture.getLocalisedName()+")" : "")); + list.add(StatCollector.translateToLocal("tooltip.labparts.8.name") + " " + + itemStack.getTagCompound().getString("Name") + + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); break; default: break; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java index 2b9cb9a994..1a45731e6e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java @@ -38,6 +38,5 @@ public class SimpleIconItem extends Item { @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon("bartworks:" + this.tex); - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java index a363ab6811..0ae4dc469a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -33,11 +34,10 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import java.util.List; - public class SimpleSubItemClass extends Item { @SideOnly(Side.CLIENT) protected IIcon[] itemIcon; + String[] tex; public SimpleSubItemClass(String... tex) { @@ -52,7 +52,6 @@ public class SimpleSubItemClass extends Item { for (int i = 0; i < this.tex.length; i++) { this.itemIcon[i] = iconRegister.registerIcon(MainMod.MOD_ID + ":" + this.tex[i]); } - } @Override @@ -72,17 +71,13 @@ public class SimpleSubItemClass extends Item { @SideOnly(Side.CLIENT) public IIcon getIconFromDamage(int p_77617_1_) { - if (p_77617_1_ < this.tex.length) - return this.itemIcon[p_77617_1_]; - else - return this.itemIcon[0]; + if (p_77617_1_ < this.tex.length) return this.itemIcon[p_77617_1_]; + else return this.itemIcon[0]; } public String getUnlocalizedName(ItemStack p_77667_1_) { if (p_77667_1_.getItemDamage() < this.tex.length) return "item." + this.tex[p_77667_1_.getItemDamage()].replaceAll("/", "."); - else - return "WrongDamageItemDestroyIt"; + else return "WrongDamageItemDestroyIt"; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java index 86d5239eae..bcb2052d57 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java @@ -16,34 +16,172 @@ import net.minecraftforge.fluids.FluidStack; public class ArtificialMicaLine { public static void runArtificialMicaRecipe() { - //Mg + O = MgO - GT_Values.RA.addChemicalRecipe(Materials.Magnesium.getDust(1), null, Materials.Oxygen.getGas(1000), null, Materials.Magnesia.getDust(2), 40, 8); - //Si + 6HF = H2SiF6 + 4H - GT_Values.RA.addChemicalRecipe(Materials.Silicon.getDust(1), Materials.Empty.getCells(4), Materials.HydrofluoricAcid.getFluid(6000), WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000), Materials.Hydrogen.getCells(4), 400, 120); - //K + Cl = KCl - GT_Values.RA.addChemicalRecipe(Materials.Potassium.getDust(1), GT_Utility.getIntegratedCircuit(2), Materials.Chlorine.getGas(1000), null, Materials.RockSalt.getDust(2), 20, 8); - //2KCl + H2SiF6 = 2HCl + K2SiF6 - GT_Values.RA.addMixerRecipe(Materials.RockSalt.getDust(4), null, null, null, WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000), Materials.HydrochloricAcid.getGas(2000), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 9), 20, 8); - //2K + CO2 + O = K2CO3 - GT_Values.RA.addChemicalRecipe(Materials.Potassium.getDust(2), Materials.CarbonDioxide.getCells(1), Materials.Oxygen.getGas(1000), null, WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), Materials.Empty.getCells(1), 40, 8); - //K2O + CO2 = K2CO3 - GT_Values.RA.addChemicalRecipe(Materials.Potash.getDust(3), Materials.CarbonDioxide.getCells(1), null, null, WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), Materials.Empty.getCells(1), 40, 8); - //55Quartz Dust + 20K2SiF6 + 12Al2O3 + 4K2CO3 = 91Raw Fluorophlogopite Dust - GT_Values.RA.addMixerRecipe(Materials.QuartzSand.getDust(55), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), null, null, 400, 120); - //55Quartzite/Nether Quartz Dust + 20K2SiF6 + 57Al2O3 + 4K2CO3 = 136Raw Fluorophlogopite Dust - GT_Values.RA.addMixerRecipe(Materials.Quartzite.getDust(55), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8), null, 600, 120); - GT_Values.RA.addMixerRecipe(Materials.NetherQuartz.getDust(55), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8), null, 600, 120); - //62Certus Quartz Dust + 10K2SiF6 + 12Al2O3 + 7K2CO3 = 91Raw Fluorophlogopite Dust - GT_Values.RA.addMixerRecipe(Materials.CertusQuartz.getDust(62), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 10), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 7), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), null, null, 600, 120); - //MgO(s) = MgO(l) - GT_Values.RA.addFluidExtractionRecipe(Materials.Magnesia.getDust(1), null, Materials.Magnesia.getMolten(144), 0, 20, 120); - //27Raw Fluorophlogopite Dust + 720MgO(l) = 4608Fluorophlogopite(l) - GT_Values.RA.addBlastRecipe(WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), null, BW_GT_MaterialReference.Magnesia.getMolten(720), WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(4608), Materials.Glass.getDust(1), null, 600, 480, 1700); - //144Fluorophlogopite(l) = Fluorophlogopite - GT_Recipe.GT_Recipe_Map.sVacuumRecipes.addRecipe(new GT_Recipe(false, new ItemStack[]{ItemList.Shape_Mold_Plate.get(0)}, new ItemStack[]{WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1)}, null, null, new FluidStack[]{WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(144)}, null, 10, 120, 0)); - //Fluorophlogopite = 4Insulator Foil + // Mg + O = MgO + GT_Values.RA.addChemicalRecipe( + Materials.Magnesium.getDust(1), + null, + Materials.Oxygen.getGas(1000), + null, + Materials.Magnesia.getDust(2), + 40, + 8); + // Si + 6HF = H2SiF6 + 4H + GT_Values.RA.addChemicalRecipe( + Materials.Silicon.getDust(1), + Materials.Empty.getCells(4), + Materials.HydrofluoricAcid.getFluid(6000), + WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000), + Materials.Hydrogen.getCells(4), + 400, + 120); + // K + Cl = KCl + GT_Values.RA.addChemicalRecipe( + Materials.Potassium.getDust(1), + GT_Utility.getIntegratedCircuit(2), + Materials.Chlorine.getGas(1000), + null, + Materials.RockSalt.getDust(2), + 20, + 8); + // 2KCl + H2SiF6 = 2HCl + K2SiF6 + GT_Values.RA.addMixerRecipe( + Materials.RockSalt.getDust(4), + null, + null, + null, + WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000), + Materials.HydrochloricAcid.getGas(2000), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 9), + 20, + 8); + // 2K + CO2 + O = K2CO3 + GT_Values.RA.addChemicalRecipe( + Materials.Potassium.getDust(2), + Materials.CarbonDioxide.getCells(1), + Materials.Oxygen.getGas(1000), + null, + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), + Materials.Empty.getCells(1), + 40, + 8); + // K2O + CO2 = K2CO3 + GT_Values.RA.addChemicalRecipe( + Materials.Potash.getDust(3), + Materials.CarbonDioxide.getCells(1), + null, + null, + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), + Materials.Empty.getCells(1), + 40, + 8); + // 55Quartz Dust + 20K2SiF6 + 12Al2O3 + 4K2CO3 = 91Raw Fluorophlogopite Dust + GT_Values.RA.addMixerRecipe( + Materials.QuartzSand.getDust(55), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), + WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), + null, + GT_Utility.getIntegratedCircuit(4), + null, + null, + null, + null, + null, + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), + null, + null, + 400, + 120); + // 55Quartzite/Nether Quartz Dust + 20K2SiF6 + 57Al2O3 + 4K2CO3 = 136Raw Fluorophlogopite Dust + GT_Values.RA.addMixerRecipe( + Materials.Quartzite.getDust(55), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), + WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), + null, + GT_Utility.getIntegratedCircuit(4), + null, + null, + null, + null, + null, + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8), + null, + 600, + 120); + GT_Values.RA.addMixerRecipe( + Materials.NetherQuartz.getDust(55), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), + WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), + null, + GT_Utility.getIntegratedCircuit(4), + null, + null, + null, + null, + null, + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8), + null, + 600, + 120); + // 62Certus Quartz Dust + 10K2SiF6 + 12Al2O3 + 7K2CO3 = 91Raw Fluorophlogopite Dust + GT_Values.RA.addMixerRecipe( + Materials.CertusQuartz.getDust(62), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 10), + WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 7), + null, + GT_Utility.getIntegratedCircuit(4), + null, + null, + null, + null, + null, + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), + null, + null, + 600, + 120); + // MgO(s) = MgO(l) + GT_Values.RA.addFluidExtractionRecipe( + Materials.Magnesia.getDust(1), null, Materials.Magnesia.getMolten(144), 0, 20, 120); + // 27Raw Fluorophlogopite Dust + 720MgO(l) = 4608Fluorophlogopite(l) + GT_Values.RA.addBlastRecipe( + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), + null, + BW_GT_MaterialReference.Magnesia.getMolten(720), + WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(4608), + Materials.Glass.getDust(1), + null, + 600, + 480, + 1700); + // 144Fluorophlogopite(l) = Fluorophlogopite + GT_Recipe.GT_Recipe_Map.sVacuumRecipes.addRecipe(new GT_Recipe( + false, + new ItemStack[] {ItemList.Shape_Mold_Plate.get(0)}, + new ItemStack[] {WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1)}, + null, + null, + new FluidStack[] {WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(144)}, + null, + 10, + 120, + 0)); + // Fluorophlogopite = 4Insulator Foil if (LoaderReference.dreamcraft) - GT_Values.RA.addBenderRecipe(WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1), GT_Utility.getIntegratedCircuit(1), GT_ModHandler.getModItem("dreamcraft", "item.MicaInsulatorFoil", 4), 10, 600); + GT_Values.RA.addBenderRecipe( + WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1), + GT_Utility.getIntegratedCircuit(1), + GT_ModHandler.getModItem("dreamcraft", "item.MicaInsulatorFoil", 4), + 10, + 600); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java index 96fe2a25c5..dca6662c2e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java @@ -31,14 +31,13 @@ import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.Materials; import gregtech.api.enums.SubTag; import ic2.core.Ic2Items; +import java.lang.reflect.Field; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import org.apache.commons.lang3.reflect.FieldUtils; -import java.lang.reflect.Field; - /** * This class gets injected into GT via ASM! * DO NOT CALL IT YOURSELF! @@ -49,10 +48,10 @@ public class BeforeGTPreload implements Runnable { @Override public void run() { - if (didrun) - return; - //fixing BorosilicateGlass... -_-' - Materials.BorosilicateGlass.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); + if (didrun) return; + // fixing BorosilicateGlass... -_-' + Materials.BorosilicateGlass.add( + SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); Field activeContainer = FieldUtils.getDeclaredField(LoadController.class, "activeContainer", true); ModContainer bartworks = null; @@ -73,13 +72,11 @@ public class BeforeGTPreload implements Runnable { if (mod.getModId().equals("bartworks")) { bartworks = mod; } - if (bartworks != null) - break; + if (bartworks != null) break; } if (bartworks == null || gregtech == null) FMLCommonHandler.instance().exitJava(-1, true); - try { activeContainer.set(modController, bartworks); } catch (IllegalAccessException e) { @@ -91,7 +88,9 @@ public class BeforeGTPreload implements Runnable { Block[] bw_glasses; try { - bw_glasses = (Block[]) Class.forName("com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry").getField("bw_glasses").get(null); + bw_glasses = (Block[]) Class.forName("com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry") + .getField("bw_glasses") + .get(null); GameRegistry.registerBlock(bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); OreDictionary.registerOre("blockGlassHV", new ItemStack(Blocks.glass, 1, Short.MAX_VALUE)); OreDictionary.registerOre("blockGlassHV", new ItemStack(bw_glasses[0], 1, 0)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java index 1ece4fd6cb..6d327f594b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java @@ -26,20 +26,25 @@ import com.github.bartimaeusnek.bartworks.util.BioCulture; import com.github.bartimaeusnek.bartworks.util.BioDNA; import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; -import net.minecraft.item.EnumRarity; - import java.awt.*; - +import net.minecraft.item.EnumRarity; public class BioCultureLoader { - public static final BioData BIO_DATA_BETA_LACMATASE = BioData.createAndRegisterBioData("beta-Lactamase", EnumRarity.uncommon, 10000, 0); - private static final BioData BIO_DATA_YEAST = BioData.createAndRegisterBioData("Saccharomyces cerevisiae", EnumRarity.common); - private static final BioDNA BIO_DNA_WHINE_YEAST = BioDNA.createAndRegisterBioDNA("Saccharomyces cerevisiae var bayanus", EnumRarity.uncommon); - private static final BioDNA BIO_DNA_BEER_YEAST = BioDNA.createAndRegisterBioDNA("Saccharomyces cerevisiae var cerevisiae", EnumRarity.uncommon); - private static final BioData eColiData = BioData.createAndRegisterBioData("Escherichia koli", EnumRarity.uncommon, 10000, 0); - private static final BioDNA BIO_DNA_ANAEROBIC_OIL = BioDNA.createAndRegisterBioDNA("Pseudomonas Veronii", EnumRarity.uncommon); - private static final BioData BIO_DATA_ANAEROBIC_OIL = BioData.createAndRegisterBioData("Pseudomonas Veronii", EnumRarity.uncommon, 5000, 1); + public static final BioData BIO_DATA_BETA_LACMATASE = + BioData.createAndRegisterBioData("beta-Lactamase", EnumRarity.uncommon, 10000, 0); + private static final BioData BIO_DATA_YEAST = + BioData.createAndRegisterBioData("Saccharomyces cerevisiae", EnumRarity.common); + private static final BioDNA BIO_DNA_WHINE_YEAST = + BioDNA.createAndRegisterBioDNA("Saccharomyces cerevisiae var bayanus", EnumRarity.uncommon); + private static final BioDNA BIO_DNA_BEER_YEAST = + BioDNA.createAndRegisterBioDNA("Saccharomyces cerevisiae var cerevisiae", EnumRarity.uncommon); + private static final BioData eColiData = + BioData.createAndRegisterBioData("Escherichia koli", EnumRarity.uncommon, 10000, 0); + private static final BioDNA BIO_DNA_ANAEROBIC_OIL = + BioDNA.createAndRegisterBioDNA("Pseudomonas Veronii", EnumRarity.uncommon); + private static final BioData BIO_DATA_ANAEROBIC_OIL = + BioData.createAndRegisterBioData("Pseudomonas Veronii", EnumRarity.uncommon, 5000, 1); public static BioCulture CommonYeast; public static BioCulture WhineYeast; public static BioCulture BeerYeast; @@ -48,15 +53,52 @@ public class BioCultureLoader { public static BioCulture anaerobicOil; public static BioCulture generalPurposeFermentingBacteria; - public static void run() { - BioCultureLoader.CommonYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_YEAST), true); - BioCultureLoader.WhineYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var bayanus", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_WHINE_YEAST), BioCultureLoader.BIO_DNA_WHINE_YEAST,EnumRarity.uncommon, true); - BioCultureLoader.BeerYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_BEER_YEAST), BioCultureLoader.BIO_DNA_BEER_YEAST, EnumRarity.uncommon,true); - BioCultureLoader.rottenFleshBacteria = BioCulture.createAndRegisterBioCulture(new Color(110, 40, 25), "Escherichia cadaver", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_BETA_LACMATASE), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_BETA_LACMATASE), false); - BioCultureLoader.eColi = BioCulture.createAndRegisterBioCulture(new Color(149, 132, 75), "Escherichia koli", BioPlasmid.convertDataToPlasmid(BioCultureLoader.eColiData), BioDNA.convertDataToDNA(BioCultureLoader.eColiData), true); - BioCultureLoader.anaerobicOil = BioCulture.createAndRegisterBioCulture(new Color(0, 0, 0), "Pseudomonas Veronii", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_ANAEROBIC_OIL), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_ANAEROBIC_OIL), true); - BioCultureLoader.generalPurposeFermentingBacteria = BioCulture.createAndRegisterBioCulture(new Color(127, 69, 26), "Saccharomyces escherichia", BioCultureLoader.CommonYeast.getPlasmid(), BioCultureLoader.eColi.getdDNA(), EnumRarity.epic,true); + BioCultureLoader.CommonYeast = BioCulture.createAndRegisterBioCulture( + new Color(255, 248, 200), + "Saccharomyces cerevisiae", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), + BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_YEAST), + true); + BioCultureLoader.WhineYeast = BioCulture.createAndRegisterBioCulture( + new Color(255, 248, 200), + "Saccharomyces cerevisiae var bayanus", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_WHINE_YEAST), + BioCultureLoader.BIO_DNA_WHINE_YEAST, + EnumRarity.uncommon, + true); + BioCultureLoader.BeerYeast = BioCulture.createAndRegisterBioCulture( + new Color(255, 248, 200), + "Saccharomyces cerevisiae var cerevisiae", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_BEER_YEAST), + BioCultureLoader.BIO_DNA_BEER_YEAST, + EnumRarity.uncommon, + true); + BioCultureLoader.rottenFleshBacteria = BioCulture.createAndRegisterBioCulture( + new Color(110, 40, 25), + "Escherichia cadaver", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_BETA_LACMATASE), + BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_BETA_LACMATASE), + false); + BioCultureLoader.eColi = BioCulture.createAndRegisterBioCulture( + new Color(149, 132, 75), + "Escherichia koli", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.eColiData), + BioDNA.convertDataToDNA(BioCultureLoader.eColiData), + true); + BioCultureLoader.anaerobicOil = BioCulture.createAndRegisterBioCulture( + new Color(0, 0, 0), + "Pseudomonas Veronii", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_ANAEROBIC_OIL), + BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_ANAEROBIC_OIL), + true); + BioCultureLoader.generalPurposeFermentingBacteria = BioCulture.createAndRegisterBioCulture( + new Color(127, 69, 26), + "Saccharomyces escherichia", + BioCultureLoader.CommonYeast.getPlasmid(), + BioCultureLoader.eColi.getdDNA(), + EnumRarity.epic, + true); BioCultureLoader.CommonYeast.setLocalisedName("Common Yeast"); BioCultureLoader.WhineYeast.setLocalisedName("Whine Yeast"); @@ -66,5 +108,4 @@ public class BioCultureLoader { BioCultureLoader.anaerobicOil.setLocalisedName("Anaerobic Oil Bacteria"); BioCultureLoader.generalPurposeFermentingBacteria.setLocalisedName("General Purpose Fermenting Bacteria"); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java index 72189ce4da..8addea861c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java @@ -29,22 +29,34 @@ import com.github.bartimaeusnek.bartworks.util.BioDNA; import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; import cpw.mods.fml.common.registry.GameRegistry; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - import java.util.Collection; import java.util.HashSet; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; public class BioItemList { - private BioItemList() { - } - - private static final Item mItemBioLabParts = new LabModule(new String[]{"DNAExtractionModule", "PCRThermoclyclingModule", "PlasmidSynthesisModule", "TransformationModule", "ClonalCellularSynthesisModule"}); - public static final ItemStack[] mBioLabParts = {new ItemStack(BioItemList.mItemBioLabParts), new ItemStack(BioItemList.mItemBioLabParts, 1, 1), new ItemStack(BioItemList.mItemBioLabParts, 1, 2), new ItemStack(BioItemList.mItemBioLabParts, 1, 3), new ItemStack(BioItemList.mItemBioLabParts, 1, 4)}; - private static final Item vanillaBioLabParts = new LabParts(new String[]{"petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", "IncubationModule", "PlasmaMembrane"}); - - public static void registerBioItems(){ + private BioItemList() {} + + private static final Item mItemBioLabParts = new LabModule(new String[] { + "DNAExtractionModule", + "PCRThermoclyclingModule", + "PlasmidSynthesisModule", + "TransformationModule", + "ClonalCellularSynthesisModule" + }); + public static final ItemStack[] mBioLabParts = { + new ItemStack(BioItemList.mItemBioLabParts), + new ItemStack(BioItemList.mItemBioLabParts, 1, 1), + new ItemStack(BioItemList.mItemBioLabParts, 1, 2), + new ItemStack(BioItemList.mItemBioLabParts, 1, 3), + new ItemStack(BioItemList.mItemBioLabParts, 1, 4) + }; + private static final Item vanillaBioLabParts = new LabParts(new String[] { + "petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", "IncubationModule", "PlasmaMembrane" + }); + + public static void registerBioItems() { GameRegistry.registerItem(BioItemList.mItemBioLabParts, "BioLabModules"); GameRegistry.registerItem(BioItemList.vanillaBioLabParts, "BioLabParts"); } @@ -74,16 +86,14 @@ public class BioItemList { } public static ItemStack getPetriDish(BioCulture Culture) { - if (Culture == null) - return new ItemStack(BioItemList.vanillaBioLabParts); + if (Culture == null) return new ItemStack(BioItemList.vanillaBioLabParts); ItemStack ret = new ItemStack(BioItemList.vanillaBioLabParts); ret.setTagCompound(BioCulture.getNBTTagFromCulture(Culture)); return ret; } public static ItemStack getDNASampleFlask(BioDNA dna) { - if (dna == null) - return new ItemStack(BioItemList.vanillaBioLabParts, 1, 1); + if (dna == null) return new ItemStack(BioItemList.vanillaBioLabParts, 1, 1); ItemStack ret = new ItemStack(BioItemList.vanillaBioLabParts, 1, 1); ret.setTagCompound(BioData.getNBTTagFromBioData(dna)); @@ -91,8 +101,7 @@ public class BioItemList { } public static ItemStack getPlasmidCell(BioPlasmid plasmid) { - if (plasmid == null) - return new ItemStack(BioItemList.vanillaBioLabParts, 1, 2); + if (plasmid == null) return new ItemStack(BioItemList.vanillaBioLabParts, 1, 2); ItemStack ret = new ItemStack(BioItemList.vanillaBioLabParts, 1, 2); ret.setTagCompound(BioData.getNBTTagFromBioData(plasmid)); return ret; @@ -109,8 +118,7 @@ public class BioItemList { * @return the selected Item */ public static ItemStack getOther(int selection) { - if (selection < 1 || selection > 4) - return null; + if (selection < 1 || selection > 4) return null; return new ItemStack(BioItemList.vanillaBioLabParts, 1, 2 + selection); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index bfb6c5e3fd..dcc43adcbc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -37,6 +37,7 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.List; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -45,172 +46,291 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; -import java.util.List; - public class BioRecipeLoader { @SuppressWarnings("deprecation") public static void run() { - //DNAExtractionModule - GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[0], - RecipeLoader.BITSD, - new Object[]{ - "TET", - "CFC", - "TST", - 'T', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), - 'E', ItemList.Emitter_EV.get(1L), - 'C', GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), - 'S', ItemList.Sensor_EV.get(1L), - 'F', ItemList.Field_Generator_EV.get(1L) - } - ); - - //PCRThermoclyclingModule - GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[1], - RecipeLoader.BITSD, - new Object[]{ - "NEN", - "CFC", - "NSN", - 'N', GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), - 'E', ItemList.Emitter_EV.get(1L), - 'C', GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), - 'S', ItemList.Sensor_EV.get(1L), - 'F', ItemList.Field_Generator_EV.get(1L) - } - ); - - //PlasmidSynthesisModule - GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[2], - RecipeLoader.BITSD, - new Object[]{ - "SFE", - "CPC", - "NFN", - 'N', GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), - 'C', "circuit" + Materials.Data, - 'F', ItemList.Field_Generator_EV.get(1L), - 'E', ItemList.Emitter_EV.get(1L), - 'S', ItemList.Sensor_EV.get(1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), - } - ); - //TransformationModule - GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[3], - RecipeLoader.BITSD, - new Object[]{ - "SFE", - "CPC", - "NFN", - 'N', GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), - 'C', "circuit" + Materials.Master, - 'F', ItemList.Field_Generator_LuV.get(1L), - 'E', ItemList.Emitter_LuV.get(1L), - 'S', ItemList.Sensor_LuV.get(1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), - } - ); - - //ClonalCellularSynthesisModule - GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[4], - RecipeLoader.BITSD, - new Object[]{ - "FEF", - "CPC", - "FSF", - 'N', GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), - 'C', "circuit" + Materials.Master, - 'F', ItemList.Field_Generator_LuV.get(1L), - 'E', ItemList.Emitter_LuV.get(1L), - 'S', ItemList.Sensor_LuV.get(1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), - } - ); + // DNAExtractionModule + GT_ModHandler.addCraftingRecipe(BioItemList.mBioLabParts[0], RecipeLoader.BITSD, new Object[] { + "TET", + "CFC", + "TST", + 'T', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), + 'E', + ItemList.Emitter_EV.get(1L), + 'C', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), + 'S', + ItemList.Sensor_EV.get(1L), + 'F', + ItemList.Field_Generator_EV.get(1L) + }); + + // PCRThermoclyclingModule + GT_ModHandler.addCraftingRecipe(BioItemList.mBioLabParts[1], RecipeLoader.BITSD, new Object[] { + "NEN", + "CFC", + "NSN", + 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), + 'E', + ItemList.Emitter_EV.get(1L), + 'C', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), + 'S', + ItemList.Sensor_EV.get(1L), + 'F', + ItemList.Field_Generator_EV.get(1L) + }); + + // PlasmidSynthesisModule + GT_ModHandler.addCraftingRecipe(BioItemList.mBioLabParts[2], RecipeLoader.BITSD, new Object[] { + "SFE", + "CPC", + "NFN", + 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), + 'C', + "circuit" + Materials.Data, + 'F', + ItemList.Field_Generator_EV.get(1L), + 'E', + ItemList.Emitter_EV.get(1L), + 'S', + ItemList.Sensor_EV.get(1L), + 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), + }); + // TransformationModule + GT_ModHandler.addCraftingRecipe(BioItemList.mBioLabParts[3], RecipeLoader.BITSD, new Object[] { + "SFE", + "CPC", + "NFN", + 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), + 'C', + "circuit" + Materials.Master, + 'F', + ItemList.Field_Generator_LuV.get(1L), + 'E', + ItemList.Emitter_LuV.get(1L), + 'S', + ItemList.Sensor_LuV.get(1L), + 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), + }); + + // ClonalCellularSynthesisModule + GT_ModHandler.addCraftingRecipe(BioItemList.mBioLabParts[4], RecipeLoader.BITSD, new Object[] { + "FEF", + "CPC", + "FSF", + 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), + 'C', + "circuit" + Materials.Master, + 'F', + ItemList.Field_Generator_LuV.get(1L), + 'E', + ItemList.Emitter_LuV.get(1L), + 'S', + ItemList.Sensor_LuV.get(1L), + 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), + }); List oreCropVine = OreDictionary.getOres("cropVine", false); if (LoaderReference.croploadcore && !oreCropVine.isEmpty()) for (ItemStack stack : oreCropVine) { - GT_Values.RA.addExtractorRecipe(BW_Util.setStackSize(stack, 12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addExtractorRecipe( + BW_Util.setStackSize(stack, 12), + BioItemList.getOther(1), + 500, + BW_Util.getMachineVoltageFromTier(3)); } else - GT_Values.RA.addExtractorRecipe(new ItemStack(Blocks.vine, 12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3)); - - GT_Values.RA.addExtractorRecipe(ItemList.Circuit_Chip_Stemcell.get(1L), BioItemList.getOther(4), 500, BW_Util.getMachineVoltageFromTier(6)); - - FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); - GT_Values.RA.addMixerRecipe(GT_Utility.getIntegratedCircuit(17), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Radon, 1L), null, null, dnaFluid, new FluidStack(FluidLoader.BioLabFluidMaterials[0], 2000), Materials.Empty.getCells(1), 500, BW_Util.getMachineVoltageFromTier(3)); - - GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(17), null, new FluidStack(BioCultureLoader.eColi.getFluid(), 1000), new FluidStack(FluidLoader.BioLabFluidMaterials[1], 10), BioItemList.getOther(4), null, null, null, null, null, new int[]{1000}, 60 * 20, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(17), null, new FluidStack(FluidLoader.BioLabFluidMaterials[1], 1000), new FluidStack(FluidLoader.BioLabFluidMaterials[3], 250), null, null, null, null, null, null, null, 60 * 20, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(17), null, new FluidStack(BioCultureLoader.CommonYeast.getFluid(), 1000), new FluidStack(FluidLoader.BioLabFluidMaterials[2], 10), null, null, null, null, null, null, null, 60 * 20, BW_Util.getMachineVoltageFromTier(3)); - + GT_Values.RA.addExtractorRecipe( + new ItemStack(Blocks.vine, 12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3)); + + GT_Values.RA.addExtractorRecipe( + ItemList.Circuit_Chip_Stemcell.get(1L), + BioItemList.getOther(4), + 500, + BW_Util.getMachineVoltageFromTier(6)); + + FluidStack dnaFluid = LoaderReference.gendustry + ? FluidRegistry.getFluidStack("liquiddna", 1000) + : Materials.Biomass.getFluid(1000L); + GT_Values.RA.addMixerRecipe( + GT_Utility.getIntegratedCircuit(17), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Radon, 1L), + null, + null, + dnaFluid, + new FluidStack(FluidLoader.BioLabFluidMaterials[0], 2000), + Materials.Empty.getCells(1), + 500, + BW_Util.getMachineVoltageFromTier(3)); - ItemStack[] Pistons = {ItemList.Electric_Piston_HV.get(1L), ItemList.Electric_Piston_EV.get(1L), ItemList.Electric_Piston_IV.get(1L), ItemList.Electric_Piston_LuV.get(1L), ItemList.Electric_Piston_ZPM.get(1L), ItemList.Electric_Piston_UV.get(1L)}; + GT_Values.RA.addCentrifugeRecipe( + GT_Utility.getIntegratedCircuit(17), + null, + new FluidStack(BioCultureLoader.eColi.getFluid(), 1000), + new FluidStack(FluidLoader.BioLabFluidMaterials[1], 10), + BioItemList.getOther(4), + null, + null, + null, + null, + null, + new int[] {1000}, + 60 * 20, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addCentrifugeRecipe( + GT_Utility.getIntegratedCircuit(17), + null, + new FluidStack(FluidLoader.BioLabFluidMaterials[1], 1000), + new FluidStack(FluidLoader.BioLabFluidMaterials[3], 250), + null, + null, + null, + null, + null, + null, + null, + 60 * 20, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addCentrifugeRecipe( + GT_Utility.getIntegratedCircuit(17), + null, + new FluidStack(BioCultureLoader.CommonYeast.getFluid(), 1000), + new FluidStack(FluidLoader.BioLabFluidMaterials[2], 10), + null, + null, + null, + null, + null, + null, + null, + 60 * 20, + BW_Util.getMachineVoltageFromTier(3)); + + ItemStack[] Pistons = { + ItemList.Electric_Piston_HV.get(1L), + ItemList.Electric_Piston_EV.get(1L), + ItemList.Electric_Piston_IV.get(1L), + ItemList.Electric_Piston_LuV.get(1L), + ItemList.Electric_Piston_ZPM.get(1L), + ItemList.Electric_Piston_UV.get(1L) + }; ItemStack[] BioLab = new ItemStack[GT_Values.VN.length - 3]; ItemStack[] RadioHatch = new ItemStack[GT_Values.VN.length - 3]; - Materials[] cables = {Materials.Gold, Materials.Aluminium, Materials.Tungsten, Materials.VanadiumGallium, Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; - Materials[] hulls = {Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, Materials.Chrome, Materials.Iridium, Materials.Osmium, Materials.Naquadah}; - Materials[] wireMat = {Materials.Kanthal, Materials.Nichrome, Materials.TungstenSteel, Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; - Materials[] circuits = {Materials.Advanced, Materials.Data, Materials.Elite, Materials.Master, Materials.Ultimate, Materials.Superconductor}; + Materials[] cables = { + Materials.Gold, + Materials.Aluminium, + Materials.Tungsten, + Materials.VanadiumGallium, + Materials.Naquadah, + Materials.NaquadahAlloy, + Materials.Superconductor + }; + Materials[] hulls = { + Materials.StainlessSteel, + Materials.Titanium, + Materials.TungstenSteel, + Materials.Chrome, + Materials.Iridium, + Materials.Osmium, + Materials.Naquadah + }; + Materials[] wireMat = { + Materials.Kanthal, + Materials.Nichrome, + Materials.TungstenSteel, + Materials.Naquadah, + Materials.NaquadahAlloy, + Materials.Superconductor + }; + Materials[] circuits = { + Materials.Advanced, + Materials.Data, + Materials.Elite, + Materials.Master, + Materials.Ultimate, + Materials.Superconductor + }; for (int i = 3; i < GT_Values.VN.length - 1; i++) { - //12625 - BioLab[(i - 3)] = new GT_MetaTileEntity_BioLab(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i, "bw.biolab" + GT_Values.VN[i], GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.biolab.name"), i).getStackForm(1L); - RadioHatch[(i - 3)] = new GT_MetaTileEntity_RadioHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i, "bw.radiohatch" + GT_Values.VN[i], GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.radiohatch.name"), i).getStackForm(1L); + // 12625 + BioLab[(i - 3)] = new GT_MetaTileEntity_BioLab( + ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i, + "bw.biolab" + GT_Values.VN[i], + GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.biolab.name"), + i) + .getStackForm(1L); + RadioHatch[(i - 3)] = new GT_MetaTileEntity_RadioHatch( + ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i, + "bw.radiohatch" + GT_Values.VN[i], + GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.radiohatch.name"), + i) + .getStackForm(1L); try { ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); - GT_ModHandler.addCraftingRecipe( - BioLab[(i - 3)], - RecipeLoader.BITSD, - new Object[]{ - "PFP", - "WCW", - "OGO", - 'F', GT_OreDictUnificator.get(OrePrefixes.frameGt, hulls[(i - 3)], 1L), - 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt01, wireMat[(i - 3)], 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), - 'O', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), - 'G', "circuit" + circuits[(i - 3)], - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - RadioHatch[(i - 3)], - RecipeLoader.BITSD, - new Object[]{ - "DPD", - "DCD", - "DKD", - 'D', GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), - 'C', machinehull, - 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cables[(i - 3)], 1L), - 'P', Pistons[(i - 3)] - } - ); + GT_ModHandler.addCraftingRecipe(BioLab[(i - 3)], RecipeLoader.BITSD, new Object[] { + "PFP", + "WCW", + "OGO", + 'F', + GT_OreDictUnificator.get(OrePrefixes.frameGt, hulls[(i - 3)], 1L), + 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt01, wireMat[(i - 3)], 1L), + 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), + 'O', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), + 'G', + "circuit" + circuits[(i - 3)], + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(RadioHatch[(i - 3)], RecipeLoader.BITSD, new Object[] { + "DPD", + "DCD", + "DKD", + 'D', + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), + 'C', + machinehull, + 'K', + GT_OreDictUnificator.get(OrePrefixes.cableGt08, cables[(i - 3)], 1L), + 'P', + Pistons[(i - 3)] + }); } catch (ArrayIndexOutOfBoundsException e) { - //e.printStackTrace(); + // e.printStackTrace(); } } GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_BioVat(ConfigHandler.IDOffset + GT_Values.VN.length * 7, "bw.biovat", StatCollector.translateToLocal("tile.biovat.name")).getStackForm(1L), + new GT_TileEntity_BioVat( + ConfigHandler.IDOffset + GT_Values.VN.length * 7, + "bw.biovat", + StatCollector.translateToLocal("tile.biovat.name")) + .getStackForm(1L), RecipeLoader.BITSD, - new Object[]{ - "GCG", - "KHK", - "GCG", - 'G', new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), - 'C', "circuit" + Materials.Data, - 'K', GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Silver, 1L), - 'H', ItemList.MACHINE_HULLS[3].get(1L) - } - ); - + new Object[] { + "GCG", + "KHK", + "GCG", + 'G', + new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), + 'C', + "circuit" + Materials.Data, + 'K', + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Silver, 1L), + 'H', + ItemList.MACHINE_HULLS[3].get(1L) + }); Materials[] sterilizers = {Materials.Ammonia, Materials.Chlorine, Materials.Ethanol, Materials.Methanol}; for (Materials used : sterilizers) { @@ -220,8 +340,7 @@ public class BioRecipeLoader { BioItemList.getPetriDish(null), 10000, 100, - BW_Util.getMachineVoltageFromTier(1) - ); + BW_Util.getMachineVoltageFromTier(1)); GT_Values.RA.addAutoclaveRecipe( new ItemStack(Items.glass_bottle), @@ -229,8 +348,7 @@ public class BioRecipeLoader { BioItemList.getDNASampleFlask(null), 10000, 100, - BW_Util.getMachineVoltageFromTier(1) - ); + BW_Util.getMachineVoltageFromTier(1)); } GT_Values.RA.addLaserEngraverRecipe( @@ -238,165 +356,175 @@ public class BioRecipeLoader { GT_Utility.getIntegratedCircuit(17), BioItemList.getPlasmidCell(null), 100, - BW_Util.getMachineVoltageFromTier(1) + BW_Util.getMachineVoltageFromTier(1)); - ); - - - FluidStack[] easyFluids = {Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000)}; + FluidStack[] easyFluids = { + Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000) + }; for (FluidStack fluidStack : easyFluids) { BWRecipes.instance.addBioLabRecipeIncubation( new ItemStack(Items.rotten_flesh), BioCultureLoader.rottenFleshBacteria, - new int[]{3300}, - new FluidStack[]{fluidStack}, + new int[] {3300}, + new FluidStack[] {fluidStack}, 500, BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ); + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( new ItemStack(Items.fermented_spider_eye), BioCultureLoader.eColi, - new int[]{4500}, - new FluidStack[]{fluidStack}, + new int[] {4500}, + new FluidStack[] {fluidStack}, 500, BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ); + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( ItemList.Food_Dough.get(1L), BioCultureLoader.CommonYeast, - new int[]{7500}, - new FluidStack[]{fluidStack}, + new int[] {7500}, + new FluidStack[] {fluidStack}, 500, BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ); + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( ItemList.Food_Dough_Sugar.get(1L), BioCultureLoader.WhineYeast, - new int[]{2500}, - new FluidStack[]{fluidStack}, + new int[] {2500}, + new FluidStack[] {fluidStack}, 500, BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ); + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( ItemList.Bottle_Wine.get(1L), BioCultureLoader.WhineYeast, - new int[]{3300}, - new FluidStack[]{fluidStack}, + new int[] {3300}, + new FluidStack[] {fluidStack}, 500, BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ); + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( ItemList.Bottle_Beer.get(1L), BioCultureLoader.BeerYeast, - new int[]{2500}, - new FluidStack[]{fluidStack}, + new int[] {2500}, + new FluidStack[] {fluidStack}, 500, BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ); + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( ItemList.Bottle_Dark_Beer.get(1L), BioCultureLoader.BeerYeast, - new int[]{3300}, - new FluidStack[]{fluidStack}, + new int[] {3300}, + new FluidStack[] {fluidStack}, 500, BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ); + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( new ItemStack(Blocks.dirt), BioCultureLoader.anaerobicOil, - new int[]{100}, - new FluidStack[]{fluidStack}, + new int[] {100}, + new FluidStack[] {fluidStack}, 1500, BW_Util.getMachineVoltageFromTier(4), - BW_Util.STANDART - ); + BW_Util.STANDART); BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[]{new ItemStack(Items.sugar, 64)}, - new FluidStack[]{new FluidStack(fluidStack, 100)}, + new ItemStack[] {new ItemStack(Items.sugar, 64)}, + new FluidStack[] {new FluidStack(fluidStack, 100)}, BioCultureLoader.CommonYeast, - new FluidStack[]{(LoaderReference.berriespp ? FluidRegistry.getFluidStack("potion.ghp", 1) : Materials.Ethanol.getFluid(1L))}, + new FluidStack[] { + (LoaderReference.berriespp + ? FluidRegistry.getFluidStack("potion.ghp", 1) + : Materials.Ethanol.getFluid(1L)) + }, 350, - BW_Util.getMachineVoltageFromTier(4) - ); + BW_Util.getMachineVoltageFromTier(4)); BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[]{ItemList.Crop_Drop_Grapes.get(16)}, - new FluidStack[]{new FluidStack(fluidStack, 100)}, + new ItemStack[] {ItemList.Crop_Drop_Grapes.get(16)}, + new FluidStack[] {new FluidStack(fluidStack, 100)}, BioCultureLoader.WhineYeast, - new FluidStack[]{FluidRegistry.getFluidStack("potion.wine", 12)}, + new FluidStack[] {FluidRegistry.getFluidStack("potion.wine", 12)}, 200, - BW_Util.getMachineVoltageFromTier(2) - ); + BW_Util.getMachineVoltageFromTier(2)); BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[]{new ItemStack(Items.sugar, 4), ItemList.IC2_Hops.get(16L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 8L)}, - new FluidStack[]{new FluidStack(fluidStack, 100)}, + new ItemStack[] { + new ItemStack(Items.sugar, 4), + ItemList.IC2_Hops.get(16L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 8L) + }, + new FluidStack[] {new FluidStack(fluidStack, 100)}, BioCultureLoader.BeerYeast, - new FluidStack[]{FluidRegistry.getFluidStack("potion.beer", 5)}, + new FluidStack[] {FluidRegistry.getFluidStack("potion.beer", 5)}, 600, - BW_Util.getMachineVoltageFromTier(1) - ); + BW_Util.getMachineVoltageFromTier(1)); BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[]{ItemList.IC2_Hops.get(32L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 16L)}, - new FluidStack[]{new FluidStack(fluidStack, 100)}, + new ItemStack[] { + ItemList.IC2_Hops.get(32L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 16L) + }, + new FluidStack[] {new FluidStack(fluidStack, 100)}, BioCultureLoader.BeerYeast, - new FluidStack[]{FluidRegistry.getFluidStack("potion.darkbeer", 10)}, + new FluidStack[] {FluidRegistry.getFluidStack("potion.darkbeer", 10)}, 600, - BW_Util.getMachineVoltageFromTier(1) - ); - + BW_Util.getMachineVoltageFromTier(1)); } BWRecipes.instance.addBacterialVatRecipe( null, - new FluidStack[]{FluidRegistry.getFluidStack("potion.grapejuice", 100)}, + new FluidStack[] {FluidRegistry.getFluidStack("potion.grapejuice", 100)}, BioCultureLoader.WhineYeast, - new FluidStack[]{FluidRegistry.getFluidStack("potion.wine", 12)}, + new FluidStack[] {FluidRegistry.getFluidStack("potion.wine", 12)}, 400, - BW_Util.getMachineVoltageFromTier(1) - ); + BW_Util.getMachineVoltageFromTier(1)); BWRecipes.instance.addBacterialVatRecipe( null, - new FluidStack[]{Materials.FermentedBiomass.getFluid(10000)}, + new FluidStack[] {Materials.FermentedBiomass.getFluid(10000)}, BioCultureLoader.anaerobicOil, - new FluidStack[]{new FluidStack(FluidLoader.fulvicAcid,1000)}, + new FluidStack[] {new FluidStack(FluidLoader.fulvicAcid, 1000)}, 2748, - BW_Util.getMachineVoltageFromTier(3) - ); - GT_Values.RA.addFluidHeaterRecipe(GT_Utility.getIntegratedCircuit(10),new FluidStack(FluidLoader.fulvicAcid,1000),new FluidStack(FluidLoader.heatedfulvicAcid,1000),90, BW_Util.getMachineVoltageFromTier(2)); - GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(10),null,new FluidStack(FluidLoader.heatedfulvicAcid,1000),new FluidStack(FluidLoader.Kerogen,1000),null,75, BW_Util.getMachineVoltageFromTier(2)); - GT_Values.RA.addPyrolyseRecipe(Materials.Wood.getDust(10),new FluidStack(FluidLoader.Kerogen,1000),10,null,Materials.Oil.getFluid(1000),105, BW_Util.getMachineVoltageFromTier(3)); + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addFluidHeaterRecipe( + GT_Utility.getIntegratedCircuit(10), + new FluidStack(FluidLoader.fulvicAcid, 1000), + new FluidStack(FluidLoader.heatedfulvicAcid, 1000), + 90, + BW_Util.getMachineVoltageFromTier(2)); + GT_Values.RA.addChemicalRecipe( + GT_Utility.getIntegratedCircuit(10), + null, + new FluidStack(FluidLoader.heatedfulvicAcid, 1000), + new FluidStack(FluidLoader.Kerogen, 1000), + null, + 75, + BW_Util.getMachineVoltageFromTier(2)); + GT_Values.RA.addPyrolyseRecipe( + Materials.Wood.getDust(10), + new FluidStack(FluidLoader.Kerogen, 1000), + 10, + null, + Materials.Oil.getFluid(1000), + 105, + BW_Util.getMachineVoltageFromTier(3)); } - public static void runOnServerStarted(){ + public static void runOnServerStarted() { GT_Recipe.GT_Recipe_Map.sFermentingRecipes.mRecipeList.forEach( - recipe -> - BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[]{null}, - BioCultureLoader.generalPurposeFermentingBacteria, - recipe.mFluidInputs, - recipe.mFluidOutputs, - recipe.mDuration, - recipe.mEUt, - GT_Utility.getTier(recipe.mEUt) - ) - ); + recipe -> BWRecipes.instance.addBacterialVatRecipe( + new ItemStack[] {null}, + BioCultureLoader.generalPurposeFermentingBacteria, + recipe.mFluidInputs, + recipe.mFluidOutputs, + recipe.mDuration, + recipe.mEUt, + GT_Utility.getTier(recipe.mEUt))); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 924511cd5d..c1d149c29c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -37,6 +37,8 @@ import gregtech.api.objects.GT_Fluid; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; import ic2.core.item.ItemFluidCell; +import java.awt.*; +import java.util.Arrays; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; @@ -44,9 +46,6 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.awt.*; -import java.util.Arrays; - public class FluidLoader { public static IIcon autogenIIcon; @@ -56,8 +55,8 @@ public class FluidLoader { public static Fluid[] BioLabFluidMaterials; public static ItemStack[] BioLabFluidCells; - //OilProcessing chain - public static Fluid fulvicAcid,heatedfulvicAcid,Kerogen; + // OilProcessing chain + public static Fluid fulvicAcid, heatedfulvicAcid, Kerogen; public static void run() { FluidLoader.renderID = RenderingRegistry.getNextAvailableRenderId(); @@ -65,29 +64,53 @@ public class FluidLoader { Arrays.fill(rgb, (short) 255); FluidLoader.ff = new GT_Fluid("BWfakeFluid", "molten.autogenerated", rgb); FluidLoader.fulvicAcid = FluidLoader.createAndRegisterFluid("Fulvic Acid", new Color(20, 20, 20)); - FluidLoader.heatedfulvicAcid = FluidLoader.createAndRegisterFluid("Heated Fulvic Acid", new Color(40, 20, 20),720); + FluidLoader.heatedfulvicAcid = + FluidLoader.createAndRegisterFluid("Heated Fulvic Acid", new Color(40, 20, 20), 720); FluidLoader.Kerogen = FluidLoader.createAndRegisterFluid("Kerogen", new Color(85, 85, 85)); - FluidLoader.BioLabFluidMaterials = new Fluid[]{ - new GT_Fluid("FluorecentdDNA", "molten.autogenerated", new short[]{125, 50, 170, 0}), - new GT_Fluid("EnzymesSollution", "molten.autogenerated", new short[]{240, 200, 125, 0}), - new GT_Fluid("Penicillin", "molten.autogenerated", new short[]{255, 255, 255, 0}), - new GT_Fluid("Polymerase", "molten.autogenerated", new short[]{110, 180, 110, 0}), + FluidLoader.BioLabFluidMaterials = new Fluid[] { + new GT_Fluid("FluorecentdDNA", "molten.autogenerated", new short[] {125, 50, 170, 0}), + new GT_Fluid("EnzymesSollution", "molten.autogenerated", new short[] {240, 200, 125, 0}), + new GT_Fluid("Penicillin", "molten.autogenerated", new short[] {255, 255, 255, 0}), + new GT_Fluid("Polymerase", "molten.autogenerated", new short[] {110, 180, 110, 0}), }; FluidLoader.BioLabFluidCells = new ItemStack[FluidLoader.BioLabFluidMaterials.length]; for (int i = 0; i < FluidLoader.BioLabFluidMaterials.length; i++) { FluidRegistry.registerFluid(FluidLoader.BioLabFluidMaterials[i]); - FluidLoader.BioLabFluidCells[i] = ItemFluidCell.getUniversalFluidCell(new FluidStack(FluidLoader.BioLabFluidMaterials[i], 1000)); + FluidLoader.BioLabFluidCells[i] = + ItemFluidCell.getUniversalFluidCell(new FluidStack(FluidLoader.BioLabFluidMaterials[i], 1000)); } -// BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", BW_Util.splitColorToRBGArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB()))); - FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L); + // BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", + // BW_Util.splitColorToRBGArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB()))); + FluidStack dnaFluid = LoaderReference.gendustry + ? FluidRegistry.getFluidStack("liquiddna", 100) + : Materials.Biomass.getFluid(100L); for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.isBreedable()) { - B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()})); + B.setFluid(new GT_Fluid( + B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[] { + (short) B.getColor().getRed(), + (short) B.getColor().getBlue(), + (short) B.getColor().getGreen() + })); FluidRegistry.registerFluid(B.getFluid()); - GT_LanguageManager.addStringLocalization(B.getFluid().getUnlocalizedName(), B.getLocalisedName()+" Fluid"); - GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(10),GT_Values.NI,new FluidStack(B.getFluid(),1000),dnaFluid,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,null,500,120); + GT_LanguageManager.addStringLocalization( + B.getFluid().getUnlocalizedName(), B.getLocalisedName() + " Fluid"); + GT_Values.RA.addCentrifugeRecipe( + GT_Utility.getIntegratedCircuit(10), + GT_Values.NI, + new FluidStack(B.getFluid(), 1000), + dnaFluid, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 500, + 120); } } @@ -100,14 +123,19 @@ public class FluidLoader { } } - public static Fluid createAndRegisterFluid(String Name,Color color){ - Fluid f = new GT_Fluid(Name,"molten.autogenerated",new short[]{(short) color.getRed(),(short) color.getGreen(),(short) color.getBlue(), (short) color.getAlpha()}); + public static Fluid createAndRegisterFluid(String Name, Color color) { + Fluid f = new GT_Fluid(Name, "molten.autogenerated", new short[] { + (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(), (short) color.getAlpha() + }); GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), Name); FluidRegistry.registerFluid(f); return f; } - public static Fluid createAndRegisterFluid(String Name, Color color, int temperature){ - Fluid f = new GT_Fluid(Name,"molten.autogenerated",new short[]{(short) color.getRed(),(short) color.getGreen(),(short) color.getBlue(), (short) color.getAlpha()}); + + public static Fluid createAndRegisterFluid(String Name, Color color, int temperature) { + Fluid f = new GT_Fluid(Name, "molten.autogenerated", new short[] { + (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(), (short) color.getAlpha() + }); GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), Name); f.setTemperature(temperature); FluidRegistry.registerFluid(f); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java index 5bdf77e2ce..40de4b8812 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java @@ -46,8 +46,7 @@ public class GTNHBlocks { BioVatLogicAdder.BioVatGlass.addCustomGlass("Botania", "elfGlass", 0, 5); BioVatLogicAdder.BioVatGlass.addCustomGlass("Botania", "elfGlassPane", 0, 5); } - if (LoaderReference.Botany) - BioVatLogicAdder.BioVatGlass.addCustomGlass("Botany", "stained", 0, 3); + if (LoaderReference.Botany) BioVatLogicAdder.BioVatGlass.addCustomGlass("Botany", "stained", 0, 3); if (LoaderReference.EnderIO) for (int i = 0; i <= 5; ++i) BioVatLogicAdder.BioVatGlass.addCustomGlass("EnderIO", "blockFusedQuartz", i, 3); @@ -65,29 +64,23 @@ public class GTNHBlocks { BioVatLogicAdder.BioVatGlass.addCustomGlass("HardcoreEnderExpension", "laboratory_glass", 0, 3); if (LoaderReference.Natura) - for (int i = 0; i <= 1; ++i) - BioVatLogicAdder.BioVatGlass.addCustomGlass("Natura", "NetherGlass", i, 3); + for (int i = 0; i <= 1; ++i) BioVatLogicAdder.BioVatGlass.addCustomGlass("Natura", "NetherGlass", i, 3); if (LoaderReference.RandomThings) BioVatLogicAdder.BioVatGlass.addCustomGlass("RandomThings", "spectreGlass", 0, 3); - if (LoaderReference.TConstruct) - BioVatLogicAdder.BioVatGlass.addCustomGlass("TConstruct", "GlassBlock", 0, 3); - if (LoaderReference.tectech) - BioVatLogicAdder.BioVatGlass.addCustomGlass("tectech", "tile.quantumGlass", 0, 8); + if (LoaderReference.TConstruct) BioVatLogicAdder.BioVatGlass.addCustomGlass("TConstruct", "GlassBlock", 0, 3); + if (LoaderReference.tectech) BioVatLogicAdder.BioVatGlass.addCustomGlass("tectech", "tile.quantumGlass", 0, 8); - if (LoaderReference.chisel) - BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "glass2", 0, 3); + if (LoaderReference.chisel) BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "glass2", 0, 3); for (int i = 0; i <= 15; ++i) { BioVatLogicAdder.BioVatGlass.addCustomGlass("minecraft", "stained_glass", i, 3); if (LoaderReference.GalaxySpace) BioVatLogicAdder.BioVatGlass.addCustomGlass("GalaxySpace", "futureglasses", i, 3); - if (LoaderReference.Railcraft) - BioVatLogicAdder.BioVatGlass.addCustomGlass("Railcraft", "glass", i, 3); + if (LoaderReference.Railcraft) BioVatLogicAdder.BioVatGlass.addCustomGlass("Railcraft", "glass", i, 3); if (LoaderReference.TConstruct) BioVatLogicAdder.BioVatGlass.addCustomGlass("TConstruct", "GlassBlock.StainedClear", i, 3); - if (LoaderReference.Ztones) - BioVatLogicAdder.BioVatGlass.addCustomGlass("Ztones", "tile.glaxx", i, 3); + if (LoaderReference.Ztones) BioVatLogicAdder.BioVatGlass.addCustomGlass("Ztones", "tile.glaxx", i, 3); if (LoaderReference.chisel) { BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "glass", i, 3); BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_white", i, 3); @@ -96,8 +89,7 @@ public class GTNHBlocks { BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_brown", i, 3); BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_forestry", i, 3); } - if (LoaderReference.witchery) - BioVatLogicAdder.BioVatGlass.addCustomGlass("witchery", "shadedglass", i, 3); + if (LoaderReference.witchery) BioVatLogicAdder.BioVatGlass.addCustomGlass("witchery", "shadedglass", i, 3); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 2af3de8c67..4b976838c3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.bartworks.common.loaders; +import static com.github.bartimaeusnek.bartworks.MainMod.BWT; +import static com.github.bartimaeusnek.bartworks.MainMod.GT2; +import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; @@ -56,10 +60,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; -import static com.github.bartimaeusnek.bartworks.MainMod.BWT; -import static com.github.bartimaeusnek.bartworks.MainMod.GT2; -import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; - public class ItemRegistry { public static final Item DESTRUCTOPACK = new GT_Destructopack_Item(); @@ -68,66 +68,128 @@ public class ItemRegistry { public static final Item ROCKCUTTER_MV = new GT_Rockcutter_Item(2); public static final Item ROCKCUTTER_HV = new GT_Rockcutter_Item(3); public static final Item CIRCUIT_PROGRAMMER = new Circuit_Programmer(); - public static final Block ROTORBLOCK = new BW_TileEntityContainer_MachineBlock(Material.wood, BW_RotorBlock.class, "BWRotorBlock"); - public static final Item LEATHER_ROTOR = new BW_Stonage_Rotors(5, 0.15f, 15, 30, 2400, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorLeather.png"), "BW_LeatherRotor", "rotors/itemRotorLeather"); - public static final Item WOOL_ROTOR = new BW_Stonage_Rotors(7, 0.18f, 10, 20, 1600, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorWool.png"), "BW_WoolRotor", "rotors/itemRotorWool"); - public static final Item PAPER_ROTOR = new BW_Stonage_Rotors(9, 0.2f, 1, 10, 800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorPaper.png"), "BW_PaperRotor", "rotors/itemRotorPaper"); - public static final Item COMBINED_ROTOR = new BW_Stonage_Rotors(11, 0.22f, 1, 50, 5800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorCombined.png"), "BW_CombinedRotor", "rotors/itemRotorCombined"); - public static final Item CRAFTING_PARTS = new SimpleSubItemClass("grindstone_top", "grindstone_bottom", "completed_grindstone", "rotors/leatherParts", "rotors/woolParts", "rotors/paperParts", "rotors/combinedParts"); + public static final Block ROTORBLOCK = + new BW_TileEntityContainer_MachineBlock(Material.wood, BW_RotorBlock.class, "BWRotorBlock"); + public static final Item LEATHER_ROTOR = new BW_Stonage_Rotors( + 5, + 0.15f, + 15, + 30, + 2400, + IKineticRotor.GearboxType.WIND, + new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorLeather.png"), + "BW_LeatherRotor", + "rotors/itemRotorLeather"); + public static final Item WOOL_ROTOR = new BW_Stonage_Rotors( + 7, + 0.18f, + 10, + 20, + 1600, + IKineticRotor.GearboxType.WIND, + new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorWool.png"), + "BW_WoolRotor", + "rotors/itemRotorWool"); + public static final Item PAPER_ROTOR = new BW_Stonage_Rotors( + 9, + 0.2f, + 1, + 10, + 800, + IKineticRotor.GearboxType.WIND, + new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorPaper.png"), + "BW_PaperRotor", + "rotors/itemRotorPaper"); + public static final Item COMBINED_ROTOR = new BW_Stonage_Rotors( + 11, + 0.22f, + 1, + 50, + 5800, + IKineticRotor.GearboxType.WIND, + new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorCombined.png"), + "BW_CombinedRotor", + "rotors/itemRotorCombined"); + public static final Item CRAFTING_PARTS = new SimpleSubItemClass( + "grindstone_top", + "grindstone_bottom", + "completed_grindstone", + "rotors/leatherParts", + "rotors/woolParts", + "rotors/paperParts", + "rotors/combinedParts"); public static final Item TAB = new SimpleIconItem("GT2Coin"); public static final Item WINDMETER = new BW_SimpleWindMeter(); - public static final Block PUMPBLOCK = new BW_TileEntityContainer(Material.anvil, BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPump"); + public static final Block PUMPBLOCK = + new BW_TileEntityContainer(Material.anvil, BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPump"); public static final Item PUMPPARTS = new SimpleSubItemClass("BWrawtube", "BWmotor"); - public static final Block EXPPUMP = new BW_TileEntityContainer(Material.coral, BW_TileEntity_ExperimentalFloodGate.class, "ExpReversePump"); + public static final Block EXPPUMP = + new BW_TileEntityContainer(Material.coral, BW_TileEntity_ExperimentalFloodGate.class, "ExpReversePump"); - public static final Block bw_realglas = new BW_GlasBlocks( + public static final Block bw_realglas = new BW_GlasBlocks( "BW_GlasBlocks", - new String[]{ - MainMod.MOD_ID + ":BoronSilicateGlassBlock", - MainMod.MOD_ID + ":TitaniumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":TungstenSteelReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":LuVTierMaterialReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":IridiumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":OsmiumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock1", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock2", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock3", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock4", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock5", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock6", - MainMod.MOD_ID + ":ThoriumYttriumGlass", - MainMod.MOD_ID + ":NeutroniumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":CosmicNeutroniumReinforcedBoronSilicateGlassBlock", + new String[] { + MainMod.MOD_ID + ":BoronSilicateGlassBlock", + MainMod.MOD_ID + ":TitaniumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":TungstenSteelReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":LuVTierMaterialReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":IridiumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":OsmiumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock1", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock2", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock3", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock4", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock5", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock6", + MainMod.MOD_ID + ":ThoriumYttriumGlass", + MainMod.MOD_ID + ":NeutroniumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":CosmicNeutroniumReinforcedBoronSilicateGlassBlock", + }, + new short[][] { + Materials.BorosilicateGlass.getRGBA(), + Materials.Titanium.getRGBA(), + Materials.TungstenSteel.getRGBA(), + Materials.Chrome.getRGBA(), + Materials.Iridium.getRGBA(), + Materials.Osmium.getRGBA(), + new short[] {0xff, 0, 0}, + new short[] {0, 0xff, 0}, + new short[] {0x80, 0, 0xff}, + new short[] {0xff, 0xff, 0}, + new short[] {0, 0xff, 0x80}, + new short[] {0x80, 0x33, 0}, + WerkstoffLoader.YttriumOxide.getRGBA(), + Materials.Neutronium.getRGBA(), + Materials.CosmicNeutronium.getRGBA() }, - new short[][]{Materials.BorosilicateGlass.getRGBA(), Materials.Titanium.getRGBA(), Materials.TungstenSteel.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), Materials.Osmium.getRGBA(), new short[]{0xff, 0, 0}, new short[]{0, 0xff, 0}, new short[]{0x80, 0, 0xff}, new short[]{0xff, 0xff, 0}, new short[]{0, 0xff, 0x80}, new short[]{0x80, 0x33, 0}, WerkstoffLoader.YttriumOxide.getRGBA(), Materials.Neutronium.getRGBA(), Materials.CosmicNeutronium.getRGBA()}, MainMod.BIO_TAB, - true, false - ); + true, + false); - public static final Block[] bw_glasses = { - bw_realglas - }; - public static final Block bw_fake_glasses = - new BW_GlasBlocks("BW_GlasBlocks", new String[]{ - MainMod.MOD_ID + ":BoronSilicateGlassBlockRandlos" - }, null, null, true, true); + public static final Block[] bw_glasses = {bw_realglas}; + public static final Block bw_fake_glasses = new BW_GlasBlocks( + "BW_GlasBlocks", new String[] {MainMod.MOD_ID + ":BoronSilicateGlassBlockRandlos"}, null, null, true, true); public static final Block[] BW_BLOCKS = { - new BW_Blocks("BW_ItemBlocks", new String[] - { - MainMod.MOD_ID + ":EtchedLapisCell", - MainMod.MOD_ID + ":PlatedLapisCell", - }, GT2), - - new BW_Blocks("GT_LESU_CASING", new String[]{ + new BW_Blocks( + "BW_ItemBlocks", + new String[] { + MainMod.MOD_ID + ":EtchedLapisCell", MainMod.MOD_ID + ":PlatedLapisCell", + }, + GT2), + new BW_Blocks( + "GT_LESU_CASING", + new String[] { MainMod.MOD_ID + ":LESU_CELL", - }, GT2), - new BW_Blocks("BW_Machinery_Casings", new String[]{ - MainMod.MOD_ID + ":NickelFerriteBlocks", - MainMod.MOD_ID + ":TransformerCoil", + }, + GT2), + new BW_Blocks( + "BW_Machinery_Casings", + new String[] { + MainMod.MOD_ID + ":NickelFerriteBlocks", MainMod.MOD_ID + ":TransformerCoil", // MainMod.MOD_ID+":DEHP_Casing", // MainMod.MOD_ID+":DEHP_Casing_Base" - }, BWT), - + }, + BWT), }; public static ItemStack[] diode2A = new ItemStack[GT_Values.VN.length]; @@ -171,7 +233,7 @@ public class ItemRegistry { GameRegistry.registerBlock(ItemRegistry.EXPPUMP, BW_ItemBlocks.class, "BWExpReversePumpBlock"); } - //GT2 stuff + // GT2 stuff GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[0], BW_ItemBlocks.class, "BW_ItemBlocks"); GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[1], BW_ItemBlocks.class, "GT_LESU_CASING"); if (ConfigHandler.teslastaff) @@ -183,61 +245,181 @@ public class ItemRegistry { GameRegistry.registerItem(ItemRegistry.TAB, "tabIconGT2"); if (newStuff) { if (ConfigHandler.creativeScannerID != 0) - new CreativeScanner(ConfigHandler.creativeScannerID,"Creative Debug Scanner","Creative Debug Scanner",20); - ItemRegistry.eic = new GT_TileEntity_ElectricImplosionCompressor(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, "ElectricImplosionCompressor", "Electric Implosion Compressor").getStackForm(1L); - ItemRegistry.THTR = new GT_TileEntity_THTR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, "THTR", "Thorium High Temperature Reactor").getStackForm(1L); + new CreativeScanner( + ConfigHandler.creativeScannerID, "Creative Debug Scanner", "Creative Debug Scanner", 20); + ItemRegistry.eic = new GT_TileEntity_ElectricImplosionCompressor( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, + "ElectricImplosionCompressor", + "Electric Implosion Compressor") + .getStackForm(1L); + ItemRegistry.THTR = new GT_TileEntity_THTR( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, + "THTR", + "Thorium High Temperature Reactor") + .getStackForm(1L); GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials(); - ItemRegistry.HTGR = new GT_TileEntity_HTGR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 48, "HTGR", "High Temperature Gas-cooled Reactor").getStackForm(1L); + ItemRegistry.HTGR = new GT_TileEntity_HTGR( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 48, + "HTGR", + "High Temperature Gas-cooled Reactor") + .getStackForm(1L); GT_TileEntity_HTGR.HTGRMaterials.registeraTHR_Materials(); - ItemRegistry.EIG = new GT_TileEntity_ExtremeIndustrialGreenhouse(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 49, "EIG", "Extreme Industrial Greenhouse").getStackForm(1L); - GT_OreDictUnificator.add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); - GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(ItemRegistry.BW_BLOCKS[2])); + ItemRegistry.EIG = new GT_TileEntity_ExtremeIndustrialGreenhouse( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 49, + "EIG", + "Extreme Industrial Greenhouse") + .getStackForm(1L); + GT_OreDictUnificator.add( + OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); + GT_OreDictUnificator.registerOre( + OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(ItemRegistry.BW_BLOCKS[2])); for (int i = 0; i < GT_Values.VN.length - 1; i++) { - ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "diode" + "2A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 2A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "diode" + "4A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 4A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.diode8A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, "diode" + "8A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 8A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.diode12A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, "diode" + "12A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 12A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.diode16A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, "diode" + "16A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 16A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.energyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset + 1 + i, "energydistributor" + GT_Values.VN[i], StatCollector.translateToLocal("tile.energydistributor.name") + " " + GT_Values.VN[i], i).getStackForm(1L); + ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode( + ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, + "diode" + "2A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 2A " + GT_Values.VN[i], + i) + .getStackForm(1L); + ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode( + ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, + "diode" + "4A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 4A " + GT_Values.VN[i], + i) + .getStackForm(1L); + ItemRegistry.diode8A[i] = new GT_MetaTileEntity_Diode( + ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, + "diode" + "8A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 8A " + GT_Values.VN[i], + i) + .getStackForm(1L); + ItemRegistry.diode12A[i] = new GT_MetaTileEntity_Diode( + ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, + "diode" + "12A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 12A " + GT_Values.VN[i], + i) + .getStackForm(1L); + ItemRegistry.diode16A[i] = new GT_MetaTileEntity_Diode( + ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, + "diode" + "16A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 16A " + GT_Values.VN[i], + i) + .getStackForm(1L); + ItemRegistry.energyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor( + ConfigHandler.IDOffset + 1 + i, + "energydistributor" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.energydistributor.name") + " " + GT_Values.VN[i], + i) + .getStackForm(1L); } for (int i = 0; i < 3; i++) { - ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "acidgenerator" + GT_Values.VN[i + 2], StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[i + 2], i + 2).getStackForm(1); + ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, + "acidgenerator" + GT_Values.VN[i + 2], + StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[i + 2], + i + 2) + .getStackForm(1); } - ItemRegistry.acidGensLV = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 65, "acidgenerator" + GT_Values.VN[1], StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[1], + 1).getStackForm(1L); - - ItemRegistry.dehp = new GT_TileEntity_DEHP(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump").getStackForm(1L); - ItemRegistry.megaMachines[0] = new GT_TileEntity_MegaBlastFurnace(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, "MegaBlastFurnace", StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L); - ItemRegistry.megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, "MegaVacuumFreezer", StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L); - ItemRegistry.cal = new GT_TileEntity_CircuitAssemblyLine(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 7, "CircuitAssemblyLine", "Circuit Assembly Line").getStackForm(1L); - ItemRegistry.compressedHatch = new GT_MetaTileEntity_CompressedFluidHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, "CompressedFluidHatch", "Liquid Air Fluid Hatch").getStackForm(1L); - ItemRegistry.giantOutputHatch = new GT_MetaTileEntity_GiantOutputHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, "GiantOutputHatch", "Giant Output Hatch").getStackForm(1L); - ItemRegistry.megaMachines[2] = new GT_TileEntity_MegaDistillTower(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, "MegaDistillationTower", "Mega Distillation Tower").getStackForm(1L); - ItemRegistry.megaMachines[3] = new GT_TileEntity_MegaChemicalReactor(ConfigHandler.IDOffset+GT_Values.VN.length * 8 + 638, "MegaChemicalReactor", "Mega Chemical Reactor").getStackForm(1L); - ItemRegistry.megaMachines[4] = new GT_TileEntity_MegaOilCracker(ConfigHandler.IDOffset+GT_Values.VN.length * 8 + 639, "MegaOilCracker", "Mega Oil Cracker").getStackForm(1L); + ItemRegistry.acidGensLV = new GT_MetaTileEntity_AcidGenerator( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 65, + "acidgenerator" + GT_Values.VN[1], + StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[1], + +1) + .getStackForm(1L); + ItemRegistry.dehp = new GT_TileEntity_DEHP( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump") + .getStackForm(1L); + ItemRegistry.megaMachines[0] = new GT_TileEntity_MegaBlastFurnace( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, + "MegaBlastFurnace", + StatCollector.translateToLocal("tile.bw.mbf.name")) + .getStackForm(1L); + ItemRegistry.megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, + "MegaVacuumFreezer", + StatCollector.translateToLocal("tile.bw.mvf.name")) + .getStackForm(1L); + ItemRegistry.cal = new GT_TileEntity_CircuitAssemblyLine( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 7, + "CircuitAssemblyLine", + "Circuit Assembly Line") + .getStackForm(1L); + ItemRegistry.compressedHatch = new GT_MetaTileEntity_CompressedFluidHatch( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, + "CompressedFluidHatch", + "Liquid Air Fluid Hatch") + .getStackForm(1L); + ItemRegistry.giantOutputHatch = new GT_MetaTileEntity_GiantOutputHatch( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, + "GiantOutputHatch", + "Giant Output Hatch") + .getStackForm(1L); + ItemRegistry.megaMachines[2] = new GT_TileEntity_MegaDistillTower( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, + "MegaDistillationTower", + "Mega Distillation Tower") + .getStackForm(1L); + ItemRegistry.megaMachines[3] = new GT_TileEntity_MegaChemicalReactor( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 638, + "MegaChemicalReactor", + "Mega Chemical Reactor") + .getStackForm(1L); + ItemRegistry.megaMachines[4] = new GT_TileEntity_MegaOilCracker( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 639, + "MegaOilCracker", + "Mega Oil Cracker") + .getStackForm(1L); if (LoaderReference.galacticgreg && WerkstoffLoader.gtnhGT) { - ItemRegistry.voidminer[2] = new GT_TileEntity_VoidMiners.VMUV(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 11, "VoidMiner3", "Void Miner III").getStackForm(1L); - ItemRegistry.voidminer[1] = new GT_TileEntity_VoidMiners.VMZPM(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 12, "VoidMiner2", "Void Miner II").getStackForm(1L); - ItemRegistry.voidminer[0] = new GT_TileEntity_VoidMiners.VMLUV(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 13, "VoidMiner1", "Void Miner I").getStackForm(1L); + ItemRegistry.voidminer[2] = new GT_TileEntity_VoidMiners.VMUV( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 11, "VoidMiner3", "Void Miner III") + .getStackForm(1L); + ItemRegistry.voidminer[1] = new GT_TileEntity_VoidMiners.VMZPM( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 12, "VoidMiner2", "Void Miner II") + .getStackForm(1L); + ItemRegistry.voidminer[0] = new GT_TileEntity_VoidMiners.VMLUV( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 13, "VoidMiner1", "Void Miner I") + .getStackForm(1L); } if (LoaderReference.tectech) { - TecTechPipeEnergyLowPower = new TT_MetaTileEntity_Pipe_Energy_LowPower(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 14, "pipe.lowpowerlaser", "Low Power Laser Pipe").getStackForm(1L); + TecTechPipeEnergyLowPower = new TT_MetaTileEntity_Pipe_Energy_LowPower( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 14, + "pipe.lowpowerlaser", + "Low Power Laser Pipe") + .getStackForm(1L); int startID = ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15; for (int amps = 32; amps <= 128; amps += 32) { for (int tier = 4; tier < 8; tier++) { - TecTechLaserAdditions[0][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserBox(startID++, GT_Values.VN[tier] + "_LPLaser_Converter_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Converter", tier, amps).getStackForm(1L); + TecTechLaserAdditions[0][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserBox( + startID++, + GT_Values.VN[tier] + "_LPLaser_Converter_" + amps, + GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Converter", + tier, + amps) + .getStackForm(1L); } } for (int amps = 32; amps <= 128; amps += 32) { for (int tier = 4; tier < 8; tier++) { - TecTechLaserAdditions[1][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserHatch(startID++, GT_Values.VN[tier] + "_LPLaser_Hatch_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Target Hatch", tier, amps).getStackForm(1L); + TecTechLaserAdditions[1][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserHatch( + startID++, + GT_Values.VN[tier] + "_LPLaser_Hatch_" + amps, + GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Target Hatch", + tier, + amps) + .getStackForm(1L); } } for (int amps = 32; amps <= 128; amps += 32) { for (int tier = 4; tier < 8; tier++) { - TecTechLaserAdditions[2][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserDynamo(startID++, GT_Values.VN[tier] + "_LPLaser_Dynamo_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Source Hatch", tier, amps).getStackForm(1L); + TecTechLaserAdditions[2][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserDynamo( + startID++, + GT_Values.VN[tier] + "_LPLaser_Dynamo_" + amps, + GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Source Hatch", + tier, + amps) + .getStackForm(1L); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java index 733ba9b67b..9ca7cedec8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java @@ -26,30 +26,42 @@ import gregtech.api.util.GT_LanguageManager; public class LocalisationLoader { - private LocalisationLoader() { - } + private LocalisationLoader() {} - private static void localiseTooltips(){ - GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.purify.2","Throw into Cauldron to get clean crushed Ore"); - GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.nqgen", "Can be used as Enriched Naquadah Fuel Substitute"); + private static void localiseTooltips() { + GT_LanguageManager.addStringLocalization( + "metaitem.01.tooltip.purify.2", "Throw into Cauldron to get clean crushed Ore"); + GT_LanguageManager.addStringLocalization( + "metaitem.01.tooltip.nqgen", "Can be used as Enriched Naquadah Fuel Substitute"); } - private static void localiseAchivements(){ - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor", "Electric Implosions?"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor.desc", "Basically a giant Hammer that presses Stuff - No more TNT!"); + private static void localiseAchivements() { + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.electricimplosioncompressor", "Electric Implosions?"); + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.electricimplosioncompressor.desc", + "Basically a giant Hammer that presses Stuff - No more TNT!"); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp", "Heat from below!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp.desc", "Get ALL the thermal energy!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline", "Cheaper Circuits?"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline.desc", "Well, yes, but actually no..."); + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.dehp.desc", "Get ALL the thermal energy!"); + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.circuitassemblyline", "Cheaper Circuits?"); + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.circuitassemblyline.desc", "Well, yes, but actually no..."); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer1", "Ores from deep below!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer1.desc", "Is this some kind of Ex-Nihilo?"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer2", "Ores from deep below 2! Electric Boogaloo!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer2.desc", "Ex-Nihilo, but faster!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer3", "Ores from deep below 3! Trinity Ex-Nihilo"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer3.desc", "3x the trouble, 3x the fun!"); + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.voidminer1.desc", "Is this some kind of Ex-Nihilo?"); + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.voidminer2", "Ores from deep below 2! Electric Boogaloo!"); + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.voidminer2.desc", "Ex-Nihilo, but faster!"); + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.voidminer3", "Ores from deep below 3! Trinity Ex-Nihilo"); + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.voidminer3.desc", "3x the trouble, 3x the fun!"); } - public static void localiseAll(){ + public static void localiseAll() { localiseAchivements(); localiseTooltips(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index a126fea811..2876e70b7a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.common.loaders; +import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.*; @@ -46,11 +48,11 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; -import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; - public class RecipeLoader { - protected static final long BITSD = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE; + protected static final long BITSD = GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE; @SuppressWarnings("deprecation") public static void run() { @@ -60,33 +62,77 @@ public class RecipeLoader { * GTNH "hardmode" Recipes */ - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(Blocks.lapis_block), Materials.Iron.getMolten(1296L), new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), 100, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), Materials.Lapis.getPlates(9), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2L), GT_Utility.getIntegratedCircuit(17)}, FluidRegistry.getFluidStack("ic2coolant", 1000), new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), 100, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), Materials.Lapis.getBlocks(8), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(Blocks.lapis_block), + Materials.Iron.getMolten(1296L), + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), + 100, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), + Materials.Lapis.getPlates(9), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2L), + GT_Utility.getIntegratedCircuit(17) + }, + FluidRegistry.getFluidStack("ic2coolant", 1000), + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), + 100, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), + Materials.Lapis.getBlocks(8), + GT_Utility.getIntegratedCircuit(17) + }, + GT_Values.NF, + new ItemStack(ItemRegistry.BW_BLOCKS[1]), + 100, + BW_Util.getMachineVoltageFromTier(3)); } else { /* * Vanilla Recipes */ + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + Materials.Lapis.getBlocks(8), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L), + GT_Utility.getIntegratedCircuit(17) + }, + GT_Values.NF, + new ItemStack(ItemRegistry.BW_BLOCKS[1]), + 100, + BW_Util.getMachineVoltageFromTier(1)); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{Materials.Lapis.getBlocks(8), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, BW_Util.getMachineVoltageFromTier(1)); + GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[1]), RecipeLoader.BITSD, new Object[] { + "LLL", "LCL", "LLL", 'L', Materials.Lapis.getBlocks(1), 'C', "circuitBasic" + }); - GT_ModHandler.addCraftingRecipe( + GT_Values.RA.addCutterRecipe( + new ItemStack(ItemRegistry.BW_BLOCKS[1]), + new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), + GT_Values.NI, + 100, + BW_Util.getMachineVoltageFromTier(1)); + GT_Values.RA.addCompressorRecipe( + new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), + new ItemStack(ItemRegistry.BW_BLOCKS[1]), + 100, + BW_Util.getMachineVoltageFromTier(1)); + GT_Values.RA.addCompressorRecipe( + new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 0), new ItemStack(ItemRegistry.BW_BLOCKS[1]), + 100, + BW_Util.getMachineVoltageFromTier(1)); + GT_ModHandler.addShapelessCraftingRecipe( + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), RecipeLoader.BITSD, - new Object[]{ - "LLL", - "LCL", - "LLL", - 'L', Materials.Lapis.getBlocks(1), - 'C', "circuitBasic" - }); - - GT_Values.RA.addCutterRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[1]), new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), GT_Values.NI, 100, BW_Util.getMachineVoltageFromTier(1)); - GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, BW_Util.getMachineVoltageFromTier(1)); - GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 0), new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, BW_Util.getMachineVoltageFromTier(1)); - GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), RecipeLoader.BITSD, new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1)}); - GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), RecipeLoader.BITSD, new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0)}); + new Object[] {new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1)}); + GT_ModHandler.addShapelessCraftingRecipe( + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), + RecipeLoader.BITSD, + new Object[] {new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0)}); } /* @@ -96,468 +142,700 @@ public class RecipeLoader { GT_ModHandler.addCraftingRecipe( new GT_TileEntity_LESU(ConfigHandler.IDOffset, "LESU", "L.E.S.U.").getStackForm(1L), RecipeLoader.BITSD, - new Object[]{ - "CDC", - "SBS", - "CFC", - 'C', ConfigHandler.hardmode ? "circuitAdvanced" : "circuitBasic", - 'D', ItemList.Cover_Screen.get(1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.cableGt12, ConfigHandler.hardmode ? Materials.Platinum : Materials.AnnealedCopper, 1L), - 'B', new ItemStack(ItemRegistry.BW_BLOCKS[1]), - 'F', ConfigHandler.hardmode ? ItemList.Field_Generator_HV.get(1L) : ItemList.Field_Generator_LV.get(1L) + new Object[] { + "CDC", + "SBS", + "CFC", + 'C', + ConfigHandler.hardmode ? "circuitAdvanced" : "circuitBasic", + 'D', + ItemList.Cover_Screen.get(1L), + 'S', + GT_OreDictUnificator.get( + OrePrefixes.cableGt12, + ConfigHandler.hardmode ? Materials.Platinum : Materials.AnnealedCopper, + 1L), + 'B', + new ItemStack(ItemRegistry.BW_BLOCKS[1]), + 'F', + ConfigHandler.hardmode ? ItemList.Field_Generator_HV.get(1L) : ItemList.Field_Generator_LV.get(1L) }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.DESTRUCTOPACK), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "CPC", - "PLP", - "CPC", - 'C', "circuitAdvanced", - 'P', GT_OreDictUnificator.get(ConfigHandler.hardmode ? OrePrefixes.plateDouble : OrePrefixes.plate, Materials.Aluminium, 1L), - 'L', new ItemStack(Items.lava_bucket) + new ItemStack(ItemRegistry.DESTRUCTOPACK), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "CPC", + "PLP", + "CPC", + 'C', + "circuitAdvanced", + 'P', + GT_OreDictUnificator.get( + ConfigHandler.hardmode ? OrePrefixes.plateDouble : OrePrefixes.plate, + Materials.Aluminium, + 1L), + 'L', + new ItemStack(Items.lava_bucket) }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.DESTRUCTOPACK), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "CPC", - "PLP", - "CPC", - 'C', "circuitAdvanced", - 'P', GT_OreDictUnificator.get(ConfigHandler.hardmode ? OrePrefixes.plateDouble : OrePrefixes.plate, ConfigHandler.hardmode ? Materials.Steel : Materials.Iron, 1L), - 'L', new ItemStack(Items.lava_bucket) + new ItemStack(ItemRegistry.DESTRUCTOPACK), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "CPC", + "PLP", + "CPC", + 'C', + "circuitAdvanced", + 'P', + GT_OreDictUnificator.get( + ConfigHandler.hardmode ? OrePrefixes.plateDouble : OrePrefixes.plate, + ConfigHandler.hardmode ? Materials.Steel : Materials.Iron, + 1L), + 'L', + new ItemStack(Items.lava_bucket) }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.ROCKCUTTER_MV), - RecipeLoader.BITSD, - new Object[]{ - "DS ", - "DP ", - "DCB", - 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.stick, Materials.TungstenSteel, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 1L), - 'C', "circuitGood", - 'B', ItemList.IC2_AdvBattery.get(1L) - }); + GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.ROCKCUTTER_MV), RecipeLoader.BITSD, new Object[] { + "DS ", + "DP ", + "DCB", + 'D', + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), + 'S', + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.TungstenSteel, 1L), + 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 1L), + 'C', + "circuitGood", + 'B', + ItemList.IC2_AdvBattery.get(1L) + }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.ROCKCUTTER_LV), - RecipeLoader.BITSD, - new Object[]{ - "DS ", - "DP ", - "DCB", - 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Titanium, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), - 'C', "circuitBasic", - 'B', ItemList.IC2_ReBattery.get(1L) - }); + GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.ROCKCUTTER_LV), RecipeLoader.BITSD, new Object[] { + "DS ", + "DP ", + "DCB", + 'D', + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), + 'S', + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Titanium, 1L), + 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), + 'C', + "circuitBasic", + 'B', + ItemList.IC2_ReBattery.get(1L) + }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.ROCKCUTTER_HV), - RecipeLoader.BITSD, - new Object[]{ - "DS ", - "DP ", - "DCB", - 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Iridium, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), - 'C', "circuitAdvanced", - 'B', ItemList.IC2_EnergyCrystal.get(1L) - }); + GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.ROCKCUTTER_HV), RecipeLoader.BITSD, new Object[] { + "DS ", + "DP ", + "DCB", + 'D', + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), + 'S', + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Iridium, 1L), + 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), + 'C', + "circuitAdvanced", + 'B', + ItemList.IC2_EnergyCrystal.get(1L) + }); if (ConfigHandler.teslastaff) - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.TESLASTAFF), - RecipeLoader.BITSD, - new Object[]{ - "BO ", - "OP ", - " P", - 'O', GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Superconductor, 1L), - 'B', ItemList.Energy_LapotronicOrb.get(1L), - 'P', "plateAlloyIridium", - }); + GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.TESLASTAFF), RecipeLoader.BITSD, new Object[] { + "BO ", + "OP ", + " P", + 'O', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Superconductor, 1L), + 'B', + ItemList.Energy_LapotronicOrb.get(1L), + 'P', + "plateAlloyIridium", + }); - Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null ? FluidRegistry.getFluid("molten.indalloy140") : FluidRegistry.getFluid("molten.solderingalloy"); + Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null + ? FluidRegistry.getFluid("molten.indalloy140") + : FluidRegistry.getFluid("molten.solderingalloy"); if (newStuff) { - GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.PUMPPARTS, 1, 0),//tube - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - " fG", - " G ", - "G ", - 'G', ItemList.Circuit_Parts_Glass_Tube.get(1L) - } - ); - GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.PUMPPARTS, 1, 1),//motor + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.PUMPPARTS, 1, 0), // tube GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "GLP", - "LSd", - "PfT", - 'G', GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.Steel, 1L), - 'L', GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Steel, 1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 1L), - 'P', new ItemStack(Blocks.piston), - 'T', new ItemStack(ItemRegistry.PUMPPARTS, 1, 0) - } - ); - GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.PUMPBLOCK, 1, 0), + new Object[] {" fG", " G ", "G ", 'G', ItemList.Circuit_Parts_Glass_Tube.get(1L)}); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), // motor GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "IPI", - "PMP", - "ISI", - 'I', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Wood, 1L), - 'M', new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), - 'S', Ic2Items.ironFurnace - } - ); + new Object[] { + "GLP", + "LSd", + "PfT", + 'G', + GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.Steel, 1L), + 'L', + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Steel, 1L), + 'S', + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 1L), + 'P', + new ItemStack(Blocks.piston), + 'T', + new ItemStack(ItemRegistry.PUMPPARTS, 1, 0) + }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.PUMPBLOCK, 1, 0), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "IPI", + "PMP", + "ISI", + 'I', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), + 'P', + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Wood, 1L), + 'M', + new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), + 'S', + Ic2Items.ironFurnace + }); if (!ConfigHandler.hardmode) - GT_ModHandler.addCraftingRecipe( - ItemRegistry.dehp, - RecipeLoader.BITSD, - new Object[]{ - "GPG", - "NCN", - "GPG", - 'G', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 1L), - 'P', ItemList.Pump_IV.get(1L), - 'N', GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 1L), - 'C', ItemList.MACHINE_HULLS[5], - } - ); + GT_ModHandler.addCraftingRecipe(ItemRegistry.dehp, RecipeLoader.BITSD, new Object[] { + "GPG", + "NCN", + "GPG", + 'G', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 1L), + 'P', + ItemList.Pump_IV.get(1L), + 'N', + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 1L), + 'C', + ItemList.MACHINE_HULLS[5], + }); else - GT_Values.RA.addAssemblylineRecipe(ItemList.Pump_IV.get(1L), 72000, - new ItemStack[]{ - ItemList.Pump_IV.get(16), - GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 32L), - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), - ItemList.Field_Generator_LuV.get(8) + GT_Values.RA.addAssemblylineRecipe( + ItemList.Pump_IV.get(1L), + 72000, + new ItemStack[] { + ItemList.Pump_IV.get(16), + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 32L), + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), + ItemList.Field_Generator_LuV.get(8) }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 32 * 144), - Materials.Polytetrafluoroethylene.getMolten(32 * 144) - }, ItemRegistry.dehp, 5000, BW_Util.getMachineVoltageFromTier(6)); - - GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1000), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[0], 72000, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1002), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[1], 72000, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1126), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[2], 72000, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1169), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[3], 72000, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1160), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[4], 72000, BW_Util.getMachineVoltageFromTier(3)); + new FluidStack[] { + new FluidStack(solderIndalloy, 32 * 144), + Materials.Polytetrafluoroethylene.getMolten(32 * 144) + }, + ItemRegistry.dehp, + 5000, + BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addAssemblerRecipe( + GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1000), + GT_Utility.getIntegratedCircuit(17), + Materials.SolderingAlloy.getMolten(9216), + ItemRegistry.megaMachines[0], + 72000, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe( + GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1002), + GT_Utility.getIntegratedCircuit(17), + Materials.SolderingAlloy.getMolten(9216), + ItemRegistry.megaMachines[1], + 72000, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe( + GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1126), + GT_Utility.getIntegratedCircuit(17), + Materials.SolderingAlloy.getMolten(9216), + ItemRegistry.megaMachines[2], + 72000, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe( + GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1169), + GT_Utility.getIntegratedCircuit(17), + Materials.SolderingAlloy.getMolten(9216), + ItemRegistry.megaMachines[3], + 72000, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe( + GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1160), + GT_Utility.getIntegratedCircuit(17), + Materials.SolderingAlloy.getMolten(9216), + ItemRegistry.megaMachines[4], + 72000, + BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Titanium.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 800, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.TungstenSteel.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), 800, BW_Util.getMachineVoltageFromTier(4)); - FluidStack LuVMaterialFluid = ConfigHandler.newStuff ? WerkstoffLoader.LuVTierMaterial.getMolten(1152) : Materials.Chrome.getMolten(1152); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), LuVMaterialFluid, new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), 800, BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Iridium.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), 800, BW_Util.getMachineVoltageFromTier(6)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Osmium.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), 800, BW_Util.getMachineVoltageFromTier(7)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Neutronium.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), 800, BW_Util.getMachineVoltageFromTier(8)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.CosmicNeutronium.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), 800, BW_Util.getMachineVoltageFromTier(9)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.Titanium.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), + 800, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.TungstenSteel.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), + 800, + BW_Util.getMachineVoltageFromTier(4)); + FluidStack LuVMaterialFluid = ConfigHandler.newStuff + ? WerkstoffLoader.LuVTierMaterial.getMolten(1152) + : Materials.Chrome.getMolten(1152); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + LuVMaterialFluid, + new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), + 800, + BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.Iridium.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), + 800, + BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.Osmium.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), + 800, + BW_Util.getMachineVoltageFromTier(7)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.Neutronium.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), + 800, + BW_Util.getMachineVoltageFromTier(8)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.CosmicNeutronium.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), + 800, + BW_Util.getMachineVoltageFromTier(9)); for (int i = 0; i < Dyes.dyeBrown.getSizeOfFluidList(); ++i) { - GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeRed.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 6), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeGreen.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 7), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyePurple.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 8), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeYellow.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 9), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeLime.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 10), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeBrown.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 11), null, null, null, 64, 2); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyeRed.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 6), + null, + null, + null, + 64, + 2); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyeGreen.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 7), + null, + null, + null, + 64, + 2); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyePurple.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 8), + null, + null, + null, + 64, + 2); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyeYellow.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 9), + null, + null, + null, + 64, + 2); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyeLime.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 10), + null, + null, + null, + 64, + 2); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyeBrown.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 11), + null, + null, + null, + 64, + 2); } - //and reverse recipes... cause im nice :P - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Titanium.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(4)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.TungstenSteel.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(5)); - ItemStack LuVMaterialDust = ConfigHandler.newStuff ? WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.dust, 8) : Materials.Chrome.getDust(8); - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), LuVMaterialDust}, null, 800, BW_Util.getMachineVoltageFromTier(6)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Iridium.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(7)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Osmium.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(8)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Neutronium.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(9)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.CosmicNeutronium.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(10)); + // and reverse recipes... cause im nice :P + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.Titanium.getDust(8)}, + null, + 800, + BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.TungstenSteel.getDust(8)}, + null, + 800, + BW_Util.getMachineVoltageFromTier(5)); + ItemStack LuVMaterialDust = ConfigHandler.newStuff + ? WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.dust, 8) + : Materials.Chrome.getDust(8); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9), LuVMaterialDust}, + null, + 800, + BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.Iridium.getDust(8)}, + null, + 800, + BW_Util.getMachineVoltageFromTier(7)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.Osmium.getDust(8)}, + null, + 800, + BW_Util.getMachineVoltageFromTier(8)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.Neutronium.getDust(8)}, + null, + 800, + BW_Util.getMachineVoltageFromTier(9)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.CosmicNeutronium.getDust(8)}, + null, + 800, + BW_Util.getMachineVoltageFromTier(10)); for (int i = 6; i < 11; i++) { - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, i), new ItemStack[]{Materials.BorosilicateGlass.getDust(9)}, null, 400, BW_Util.getMachineVoltageFromTier(1)); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, i), Materials.Chlorine.getGas(50), new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), null, null, null, 64, 2); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, i), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9)}, + null, + 400, + BW_Util.getMachineVoltageFromTier(1)); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, i), + Materials.Chlorine.getGas(50), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + null, + null, + null, + 64, + 2); } GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.WINDMETER), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "SWF", - "Sf ", - "Ss ", - 'S', "stickWood", - 'W', new ItemStack(Blocks.wool, 1, Short.MAX_VALUE), - 'F', new ItemStack(Items.string), - } - ); + new ItemStack(ItemRegistry.WINDMETER), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "SWF", + "Sf ", + "Ss ", + 'S', + "stickWood", + 'W', + new ItemStack(Blocks.wool, 1, Short.MAX_VALUE), + 'F', + new ItemStack(Items.string), + }); - Materials[] cables = { //Cable material used in the acid gen, diode and energy distributor below - Materials.Lead, //ULV - Materials.Tin, //LV - Materials.AnnealedCopper, //MV - Materials.Gold, //HV - Materials.Aluminium, //EV - Materials.Tungsten, //IV - Materials.VanadiumGallium, //LuV - Materials.Naquadah, //ZPM - Materials.NaquadahAlloy, //UV - Materials.SuperconductorUV //UHV + Materials[] cables = { // Cable material used in the acid gen, diode and energy distributor below + Materials.Lead, // ULV + Materials.Tin, // LV + Materials.AnnealedCopper, // MV + Materials.Gold, // HV + Materials.Aluminium, // EV + Materials.Tungsten, // IV + Materials.VanadiumGallium, // LuV + Materials.Naquadah, // ZPM + Materials.NaquadahAlloy, // UV + Materials.SuperconductorUV // UHV }; - ISubTagContainer[] hulls = { //Plate material used in the acid gen, diode and energy distributor below - Materials.WroughtIron, //ULV - Materials.Steel, //LV - Materials.Aluminium, //MV - Materials.StainlessSteel, //HV - Materials.Titanium, //EV - Materials.TungstenSteel, //IV - WerkstoffLoader.LuVTierMaterial, //LuV - Materials.Iridium, //ZPM - Materials.Osmium, //UV - Materials.Naquadah //UHV + ISubTagContainer[] hulls = { // Plate material used in the acid gen, diode and energy distributor below + Materials.WroughtIron, // ULV + Materials.Steel, // LV + Materials.Aluminium, // MV + Materials.StainlessSteel, // HV + Materials.Titanium, // EV + Materials.TungstenSteel, // IV + WerkstoffLoader.LuVTierMaterial, // LuV + Materials.Iridium, // ZPM + Materials.Osmium, // UV + Materials.Naquadah // UHV }; - ItemStack[] bats = {ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_Hull_MV.get(1L), ItemList.Battery_Hull_HV.get(1L)}; - ItemStack[] chreac = {ItemList.Machine_MV_ChemicalReactor.get(1L), ItemList.Machine_HV_ChemicalReactor.get(1L), ItemList.Machine_EV_ChemicalReactor.get(1L)}; + ItemStack[] bats = { + ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_Hull_MV.get(1L), ItemList.Battery_Hull_HV.get(1L) + }; + ItemStack[] chreac = { + ItemList.Machine_MV_ChemicalReactor.get(1L), + ItemList.Machine_HV_ChemicalReactor.get(1L), + ItemList.Machine_EV_ChemicalReactor.get(1L) + }; for (int i = 0; i < 3; i++) { Materials cable = cables[i + 2]; ItemStack machinehull = ItemList.MACHINE_HULLS[i + 2].get(1L); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.acidGens[i], - RecipeLoader.BITSD, - new Object[]{ - "HRH", - "HCH", - "HKH", - 'H', bats[i], - 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt01, cable, 1L), - 'C', machinehull, - 'R', chreac[i] - } - ); + GT_ModHandler.addCraftingRecipe(ItemRegistry.acidGens[i], RecipeLoader.BITSD, new Object[] { + "HRH", + "HCH", + "HKH", + 'H', + bats[i], + 'K', + GT_OreDictUnificator.get(OrePrefixes.cableGt01, cable, 1L), + 'C', + machinehull, + 'R', + chreac[i] + }); } - GT_ModHandler.addCraftingRecipe( - ItemRegistry.acidGensLV, - RecipeLoader.BITSD, - new Object[]{ - "HRH", - "KCK", - "HKH", - 'H', ItemList.Battery_Hull_LV.get(1L), - 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 1L), - 'C', ItemList.Hull_LV.get(1L), - 'R', ItemList.Machine_LV_ChemicalReactor.get(1L), - } - ); + GT_ModHandler.addCraftingRecipe(ItemRegistry.acidGensLV, RecipeLoader.BITSD, new Object[] { + "HRH", + "KCK", + "HKH", + 'H', + ItemList.Battery_Hull_LV.get(1L), + 'K', + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 1L), + 'C', + ItemList.Hull_LV.get(1L), + 'R', + ItemList.Machine_LV_ChemicalReactor.get(1L), + }); for (int i = 0; i < GT_Values.VN.length - 1; i++) { try { Materials cable = cables[i]; - ItemStack hull = hulls[i] instanceof Materials ? GT_OreDictUnificator.get(OrePrefixes.plate, hulls[i], 1L) : ((Werkstoff) hulls[i]).get(OrePrefixes.plate); + ItemStack hull = hulls[i] instanceof Materials + ? GT_OreDictUnificator.get(OrePrefixes.plate, hulls[i], 1L) + : ((Werkstoff) hulls[i]).get(OrePrefixes.plate); ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); GT_ModHandler.addCraftingRecipe( - ItemRegistry.energyDistributor[i], - RecipeLoader.BITSD, - new Object[]{ - "PWP", - "WCW", - "PWP", - 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), - 'P', hull, - 'C', machinehull + ItemRegistry.energyDistributor[i], RecipeLoader.BITSD, new Object[] { + "PWP", + "WCW", + "PWP", + 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), + 'P', + hull, + 'C', + machinehull }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode12A[i], - RecipeLoader.BITSD, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode12A[i], - RecipeLoader.BITSD, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode8A[i], - RecipeLoader.BITSD, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode8A[i], - RecipeLoader.BITSD, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode4A[i], - RecipeLoader.BITSD, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode4A[i], - RecipeLoader.BITSD, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode2A[i], - RecipeLoader.BITSD, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode2A[i], - RecipeLoader.BITSD, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode16A[i], - RecipeLoader.BITSD, - new Object[]{ - "WHW", - "DCD", - "PDP", - 'H', ItemList.Circuit_Parts_Coil.get(1L), - 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode16A[i], - RecipeLoader.BITSD, - new Object[]{ - "WHW", - "DCD", - "PDP", - 'H', ItemList.Circuit_Parts_Coil.get(1L), - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode12A[i], RecipeLoader.BITSD, new Object[] { + "WDW", + "DCD", + "PDP", + 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode12A[i], RecipeLoader.BITSD, new Object[] { + "WDW", + "DCD", + "PDP", + 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode8A[i], RecipeLoader.BITSD, new Object[] { + "WDW", + "DCD", + "PDP", + 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode8A[i], RecipeLoader.BITSD, new Object[] { + "WDW", + "DCD", + "PDP", + 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode4A[i], RecipeLoader.BITSD, new Object[] { + "WDW", + "DCD", + "PDP", + 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode4A[i], RecipeLoader.BITSD, new Object[] { + "WDW", + "DCD", + "PDP", + 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode2A[i], RecipeLoader.BITSD, new Object[] { + "WDW", + "DCD", + "PDP", + 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode2A[i], RecipeLoader.BITSD, new Object[] { + "WDW", + "DCD", + "PDP", + 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode16A[i], RecipeLoader.BITSD, new Object[] { + "WHW", + "DCD", + "PDP", + 'H', + ItemList.Circuit_Parts_Coil.get(1L), + 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode16A[i], RecipeLoader.BITSD, new Object[] { + "WHW", + "DCD", + "PDP", + 'H', + ItemList.Circuit_Parts_Coil.get(1L), + 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); } catch (ArrayIndexOutOfBoundsException e) { - //e.printStackTrace(); + // e.printStackTrace(); } } GT_Values.RA.addAssemblerRecipe( - new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), GT_Utility.getIntegratedCircuit(17)}, + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), + GT_Utility.getIntegratedCircuit(17) + }, Materials.Plastic.getMolten(1152L), new ItemStack(ItemRegistry.BW_BLOCKS[2], 1, 1), 20, - BW_Util.getMachineVoltageFromTier(3) - ); + BW_Util.getMachineVoltageFromTier(3)); GT_ModHandler.addCraftingRecipe( - /*Loader.isModLoaded("tectech") ? new TT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "bw.manualtrafo", StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L) :*/ new GT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "bw.manualtrafo", StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L), + /*Loader.isModLoaded("tectech") ? new TT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "bw.manualtrafo", StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L) :*/ new GT_TileEntity_ManualTrafo( + ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, + "bw.manualtrafo", + StatCollector.translateToLocal("tile.manutrafo.name")) + .getStackForm(1L), RecipeLoader.BITSD, - new Object[]{ - "SCS", - "CHC", - "ZCZ", - 'S', GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L), - 'C', new ItemStack(ItemRegistry.BW_BLOCKS[2]), - 'H', ItemList.Hull_HV.get(1L), - 'Z', "circuitAdvanced" - } - ); + new Object[] { + "SCS", + "CHC", + "ZCZ", + 'S', + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L), + 'C', + new ItemStack(ItemRegistry.BW_BLOCKS[2]), + 'H', + ItemList.Hull_HV.get(1L), + 'Z', + "circuitAdvanced" + }); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), Materials.Aluminium.getPlates(1), ItemList.Circuit_Board_Plastic.get(1L), ItemList.Battery_RE_LV_Lithium.get(1L)}, Materials.SolderingAlloy.getMolten(288L), new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER), 600, BW_Util.getMachineVoltageFromTier(2)); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), + Materials.Aluminium.getPlates(1), + ItemList.Circuit_Board_Plastic.get(1L), + ItemList.Battery_RE_LV_Lithium.get(1L) + }, + Materials.SolderingAlloy.getMolten(288L), + new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER), + 600, + BW_Util.getMachineVoltageFromTier(2)); GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_Windmill(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 2, "bw.windmill", StatCollector.translateToLocal("tile.bw.windmill.name")).getStackForm(1L), + new GT_TileEntity_Windmill( + ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 2, + "bw.windmill", + StatCollector.translateToLocal("tile.bw.windmill.name")) + .getStackForm(1L), RecipeLoader.BITSD, - new Object[]{ - "BHB", - "WGW", - "BWB", - 'B', new ItemStack(Blocks.brick_block), - 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - 'H', new ItemStack(Blocks.hopper), - 'G', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), - } - ); + new Object[] { + "BHB", + "WGW", + "BWB", + 'B', + new ItemStack(Blocks.brick_block), + 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), + 'H', + new ItemStack(Blocks.hopper), + 'G', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), + }); String[] stones = {"stone", "stoneSmooth"}; String[] granites = {"blockGranite", "stoneGranite", "Granite", "granite"}; @@ -566,293 +844,281 @@ public class RecipeLoader { GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "SSS", - "DfD", - " h ", - 'S', stone, - 'D', new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), - } - ); + new Object[] { + "SSS", + "DfD", + " h ", + 'S', + stone, + 'D', + new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "hDf", - "SSS", - 'S', stone, - 'D', new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), - } - ); + new Object[] { + "hDf", + "SSS", + 'S', + stone, + 'D', + new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "SSS", - "DfD", - " h ", - 'S', stone, - 'D', granite, - } - ); + new Object[] { + "SSS", "DfD", " h ", 'S', stone, 'D', granite, + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "hDf", - "SSS", - 'S', stone, - 'D', granite, - } - ); + new Object[] { + "hDf", "SSS", 'S', stone, 'D', granite, + }); } GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "STS", - "h f", - "SBS", - 'S', granite, - 'T', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), - 'B', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), - } - ); + new Object[] { + "STS", + "h f", + "SBS", + 'S', + granite, + 'T', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), + 'B', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), + }); } GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "STS", - "h f", - "SBS", - 'S', new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), - 'T', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), - 'B', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), - } - ); + new Object[] { + "STS", + "h f", + "SBS", + 'S', + new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), + 'T', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), + 'B', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "WLs", - "WLh", - "WLf", - 'L', new ItemStack(Items.leather), - 'W', "logWood", - } - ); + new Object[] { + "WLs", "WLh", "WLf", 'L', new ItemStack(Items.leather), 'W', "logWood", + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "WLs", - "WLh", - "WLf", - 'L', new ItemStack(Blocks.carpet), - 'W', "logWood", - } - ); + new Object[] { + "WLs", "WLh", "WLf", 'L', new ItemStack(Blocks.carpet), 'W', "logWood", + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "WLs", - "WLh", - "WLf", - 'L', new ItemStack(Items.paper), - 'W', "logWood", - } - ); + new Object[] { + "WLs", "WLh", "WLf", 'L', new ItemStack(Items.paper), 'W', "logWood", + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "WEs", - "WZh", - "WDf", - 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', "logWood", - } - ); + new Object[] { + "WEs", + "WZh", + "WDf", + 'E', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', + "logWood", + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "WEs", - "WZh", - "WDf", - 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', "logWood", - } - ); + new Object[] { + "WEs", + "WZh", + "WDf", + 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'E', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', + "logWood", + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "WEs", - "WZh", - "WDf", - 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', "logWood", - } - ); + new Object[] { + "WEs", + "WZh", + "WDf", + 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'E', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', + "logWood", + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "WEs", - "WZh", - "WDf", - 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', "logWood", - } - ); + new Object[] { + "WEs", + "WZh", + "WDf", + 'E', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', + "logWood", + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "WEs", - "WZh", - "WDf", - 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', "logWood", - } - ); + new Object[] { + "WEs", + "WZh", + "WDf", + 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'E', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', + "logWood", + }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.LEATHER_ROTOR), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "hPf", - "PWP", - "sPr", - 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - } - ); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.WOOL_ROTOR), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "hPf", - "PWP", - "sPr", - 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - } - ); + new ItemStack(ItemRegistry.LEATHER_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "hPf", + "PWP", + "sPr", + 'P', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), + }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.PAPER_ROTOR), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "hPf", - "PWP", - "sPr", - 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - } - ); + new ItemStack(ItemRegistry.WOOL_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "hPf", + "PWP", + "sPr", + 'P', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), + }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.COMBINED_ROTOR), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "hPf", - "PWP", - "sPr", - 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), - 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - } - ); + new ItemStack(ItemRegistry.PAPER_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "hPf", + "PWP", + "sPr", + 'P', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), + }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.ROTORBLOCK), - RecipeLoader.BITSD, - new Object[]{ - "WRW", - "RGR", - "WRW", - 'R', GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Iron, 1L), - 'W', "plankWood", - 'G', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - } - ); + new ItemStack(ItemRegistry.COMBINED_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "hPf", + "PWP", + "sPr", + 'P', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), + }); + GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.ROTORBLOCK), RecipeLoader.BITSD, new Object[] { + "WRW", + "RGR", + "WRW", + 'R', + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Iron, 1L), + 'W', + "plankWood", + 'G', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), + }); GT_TileEntity_THTR.THTRMaterials.registerTHR_Recipes(); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.THTR, - RecipeLoader.BITSD, - new Object[]{ - "BZB", - "BRB", - "BZB", - 'B', new ItemStack(GregTech_API.sBlockCasings3, 1, 12), - 'R', GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), - 'Z', "circuitUltimate" - } - ); + GT_ModHandler.addCraftingRecipe(ItemRegistry.THTR, RecipeLoader.BITSD, new Object[] { + "BZB", + "BRB", + "BZB", + 'B', + new ItemStack(GregTech_API.sBlockCasings3, 1, 12), + 'R', + GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), + 'Z', + "circuitUltimate" + }); GT_TileEntity_HTGR.HTGRMaterials.registerTHR_Recipes(); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.HTGR, - RecipeLoader.BITSD, - new Object[]{ - "BZB", - "BRB", - "BZB", - 'B', new ItemStack(GregTech_API.sBlockCasings8, 1, 5), - 'R', GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), - 'Z', "circuitSuperconductor" - } - ); + GT_ModHandler.addCraftingRecipe(ItemRegistry.HTGR, RecipeLoader.BITSD, new Object[] { + "BZB", + "BRB", + "BZB", + 'B', + new ItemStack(GregTech_API.sBlockCasings8, 1, 5), + 'R', + GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), + 'Z', + "circuitSuperconductor" + }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.EIG, - RecipeLoader.BITSD, - new Object[]{ - "AZA", - "BRB", - "AZA", - 'B', new ItemStack(GregTech_API.sBlockCasings4, 1, 1), - 'R', GT_ModHandler.getModItem("EnderIO", "blockFarmStation", 1), - 'A', new ItemStack(GregTech_API.sBlockMachines, 1, 11104), - 'Z', "circuitUltimate" - } - ); + GT_ModHandler.addCraftingRecipe(ItemRegistry.EIG, RecipeLoader.BITSD, new Object[] { + "AZA", + "BRB", + "AZA", + 'B', + new ItemStack(GregTech_API.sBlockCasings4, 1, 1), + 'R', + GT_ModHandler.getModItem("EnderIO", "blockFarmStation", 1), + 'A', + new ItemStack(GregTech_API.sBlockMachines, 1, 11104), + 'Z', + "circuitUltimate" + }); if (LoaderReference.galacticgreg) { GT_Values.RA.addAssemblylineRecipe( ItemList.OreDrill4.get(1L), BW_Util.getMachineVoltageFromTier(6), - new Object[]{ - ItemList.OreDrill4.get(1L), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Europium, 9L), - Materials.Europium.getPlates(3), - ItemList.Electric_Motor_LuV.get(9L), - ItemList.Sensor_LuV.get(9L), - ItemList.Field_Generator_LuV.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 36L) + new Object[] { + ItemList.OreDrill4.get(1L), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Europium, 9L), + Materials.Europium.getPlates(3), + ItemList.Electric_Motor_LuV.get(9L), + ItemList.Sensor_LuV.get(9L), + ItemList.Field_Generator_LuV.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 36L) }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 1440), - WerkstoffLoader.Neon.getFluidOrGas(20000), + new FluidStack[] { + new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Neon.getFluidOrGas(20000), }, ItemRegistry.voidminer[0].copy(), 108000, - BW_Util.getMachineVoltageFromTier(6) - ); + BW_Util.getMachineVoltageFromTier(6)); } if (!LoaderReference.tectech) { @@ -860,101 +1126,94 @@ public class RecipeLoader { GT_Values.RA.addAssemblylineRecipe( ItemRegistry.voidminer[0].copy(), BW_Util.getMachineVoltageFromTier(7), - new Object[]{ - ItemRegistry.voidminer[0].copy(), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), - Materials.BlackPlutonium.getPlates(3), - ItemList.Electric_Motor_ZPM.get(9L), - ItemList.Sensor_ZPM.get(9L), - ItemList.Field_Generator_ZPM.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) + new Object[] { + ItemRegistry.voidminer[0].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), + Materials.BlackPlutonium.getPlates(3), + ItemList.Electric_Motor_ZPM.get(9L), + ItemList.Sensor_ZPM.get(9L), + ItemList.Field_Generator_ZPM.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 1440), - WerkstoffLoader.Krypton.getFluidOrGas(20000) + new FluidStack[] { + new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Krypton.getFluidOrGas(20000) }, ItemRegistry.voidminer[1].copy(), 216000, - BW_Util.getMachineVoltageFromTier(7) - ); + BW_Util.getMachineVoltageFromTier(7)); GT_Values.RA.addAssemblylineRecipe( ItemRegistry.voidminer[1].copy(), BW_Util.getMachineVoltageFromTier(8), - new Object[]{ - ItemRegistry.voidminer[1].copy(), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), - Materials.Neutronium.getPlates(3), - ItemList.Electric_Motor_UV.get(9L), - ItemList.Sensor_UV.get(9L), - ItemList.Field_Generator_UV.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) + new Object[] { + ItemRegistry.voidminer[1].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), + Materials.Neutronium.getPlates(3), + ItemList.Electric_Motor_UV.get(9L), + ItemList.Sensor_UV.get(9L), + ItemList.Field_Generator_UV.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 1440), - WerkstoffLoader.Oganesson.getFluidOrGas(20000) + new FluidStack[] { + new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Oganesson.getFluidOrGas(20000) }, ItemRegistry.voidminer[2].copy(), 432000, - BW_Util.getMachineVoltageFromTier(8) - ); + BW_Util.getMachineVoltageFromTier(8)); } GT_Values.RA.addAssemblylineRecipe( - ItemList.Machine_Multi_ImplosionCompressor.get(1L), 24000, - new ItemStack[]{ - ItemList.Machine_Multi_ImplosionCompressor.get(1L), - Materials.Neutronium.getBlocks(5), - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64), - ItemList.Electric_Piston_UV.get(64), + ItemList.Machine_Multi_ImplosionCompressor.get(1L), + 24000, + new ItemStack[] { + ItemList.Machine_Multi_ImplosionCompressor.get(1L), + Materials.Neutronium.getBlocks(5), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64), + ItemList.Electric_Piston_UV.get(64), }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 1440), - Materials.Osmium.getMolten(1440), - Materials.Neutronium.getMolten(1440) + new FluidStack[] { + new FluidStack(solderIndalloy, 1440), + Materials.Osmium.getMolten(1440), + Materials.Neutronium.getMolten(1440) }, ItemRegistry.eic.copy(), 240000, - BW_Util.getMachineVoltageFromTier(8) - ); + BW_Util.getMachineVoltageFromTier(8)); } else { ItemStack[][] converters = ItemRegistry.TecTechLaserAdditions[0]; ItemStack[][] input = ItemRegistry.TecTechLaserAdditions[1]; ItemStack[][] dynamo = ItemRegistry.TecTechLaserAdditions[2]; ItemList[] emitters = { - ItemList.Emitter_EV, - ItemList.Emitter_IV, - ItemList.Emitter_LuV, - ItemList.Emitter_ZPM + ItemList.Emitter_EV, ItemList.Emitter_IV, ItemList.Emitter_LuV, ItemList.Emitter_ZPM }; - ItemList[] sensors = { - ItemList.Sensor_EV, - ItemList.Sensor_IV, - ItemList.Sensor_LuV, - ItemList.Sensor_ZPM - }; + ItemList[] sensors = {ItemList.Sensor_EV, ItemList.Sensor_IV, ItemList.Sensor_LuV, ItemList.Sensor_ZPM}; OrePrefixes[] prefixes = { - WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt04 : OrePrefixes.wireGt04, - WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt08 : OrePrefixes.wireGt08, - WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt12 : OrePrefixes.wireGt12, - WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt16 : OrePrefixes.cableGt12 + WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt04 : OrePrefixes.wireGt04, + WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt08 : OrePrefixes.wireGt08, + WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt12 : OrePrefixes.wireGt12, + WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt16 : OrePrefixes.cableGt12 }; GT_Values.RA.addAssemblerRecipe( - new ItemStack[]{ - ItemList.Circuit_Parts_GlassFiber.get(32), - GT_OreDictUnificator.get(WerkstoffLoader.gtnhGT ? OrePrefixes.foil : OrePrefixes.plateDouble, Materials.Electrum, WerkstoffLoader.gtnhGT ? 8 : 1), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2) + new ItemStack[] { + ItemList.Circuit_Parts_GlassFiber.get(32), + GT_OreDictUnificator.get( + WerkstoffLoader.gtnhGT ? OrePrefixes.foil : OrePrefixes.plateDouble, + Materials.Electrum, + WerkstoffLoader.gtnhGT ? 8 : 1), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2) }, Materials.Polytetrafluoroethylene.getMolten(72), - new ItemStack(ItemRegistry.TecTechPipeEnergyLowPower.getItem(), 1, ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + 1, + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), 200, - BW_Util.getMachineVoltageFromTier(4) - ); + BW_Util.getMachineVoltageFromTier(4)); for (int j = 0; j < 4; j++) { for (int i = 0; i < 4; i++) { @@ -964,37 +1223,46 @@ public class RecipeLoader { int solderingAmount = Math.max(144 * i, 72) * (j + 1); GT_Values.RA.addAssemblerRecipe( - new ItemStack[]{ - new ItemStack(ItemRegistry.TecTechPipeEnergyLowPower.getItem(), ((j + 1) * 16), ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), - emitters[i].get(2 * (j + 1)), - sensors[i].get(2 * (j + 1)), - ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1)), + new ItemStack[] { + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + ((j + 1) * 16), + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + emitters[i].get(2 * (j + 1)), + sensors[i].get(2 * (j + 1)), + ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1)), }, Materials.SolderingAlloy.getMolten(solderingAmount), converter, 200 * (j + 1), BW_Util.getMachineVoltageFromTier(4 + i)); GT_Values.RA.addAssemblerRecipe( - new ItemStack[]{ - new ItemStack(ItemRegistry.TecTechPipeEnergyLowPower.getItem(), ((j + 1) * 16), ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), - sensors[i].get(2 * (j + 1)), - ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1)), + new ItemStack[] { + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + ((j + 1) * 16), + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + sensors[i].get(2 * (j + 1)), + ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1)), }, Materials.SolderingAlloy.getMolten(solderingAmount), eInput, 200 * (j + 1), BW_Util.getMachineVoltageFromTier(4 + i)); GT_Values.RA.addAssemblerRecipe( - new ItemStack[]{ - new ItemStack(ItemRegistry.TecTechPipeEnergyLowPower.getItem(), ((j + 1) * 16), ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), - emitters[i].get(2 * (j + 1)), - ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1)), + new ItemStack[] { + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + ((j + 1) * 16), + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + emitters[i].get(2 * (j + 1)), + ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1)), }, Materials.SolderingAlloy.getMolten(solderingAmount), eDynamo, @@ -1004,38 +1272,203 @@ public class RecipeLoader { } } - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{ItemList.Hatch_Input_HV.get(64), Materials.LiquidAir.getCells(1), GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{ItemRegistry.compressedHatch.copy()}, null, null, null, null, 300, BW_Util.getMachineVoltageFromTier(3), 0)); - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{ItemList.Hatch_Output_HV.get(64), GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{ItemRegistry.giantOutputHatch.copy()}, null, null, null, null, 300, BW_Util.getMachineVoltageFromTier(3), 0)); + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { + ItemList.Hatch_Input_HV.get(64), + Materials.LiquidAir.getCells(1), + GT_Utility.getIntegratedCircuit(17) + }, + new ItemStack[] {ItemRegistry.compressedHatch.copy()}, + null, + null, + null, + null, + 300, + BW_Util.getMachineVoltageFromTier(3), + 0)); + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] {ItemList.Hatch_Output_HV.get(64), GT_Utility.getIntegratedCircuit(17)}, + new ItemStack[] {ItemRegistry.giantOutputHatch.copy()}, + null, + null, + null, + null, + 300, + BW_Util.getMachineVoltageFromTier(3), + 0)); GT_Values.RA.addAssemblylineRecipe( - ItemList.Machine_LuV_CircuitAssembler.get(1L), 24000, - new ItemStack[]{ - ItemList.Machine_LuV_CircuitAssembler.get(1L), - ItemList.Robot_Arm_LuV.get(4L), - ItemList.Electric_Motor_LuV.get(4L), - ItemList.Field_Generator_LuV.get(1L), - ItemList.Emitter_LuV.get(1L), - ItemList.Sensor_LuV.get(1L), - Materials.Chrome.getPlates(8) - }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 1440) + ItemList.Machine_LuV_CircuitAssembler.get(1L), + 24000, + new ItemStack[] { + ItemList.Machine_LuV_CircuitAssembler.get(1L), + ItemList.Robot_Arm_LuV.get(4L), + ItemList.Electric_Motor_LuV.get(4L), + ItemList.Field_Generator_LuV.get(1L), + ItemList.Emitter_LuV.get(1L), + ItemList.Sensor_LuV.get(1L), + Materials.Chrome.getPlates(8) }, + new FluidStack[] {new FluidStack(solderIndalloy, 1440)}, ItemRegistry.cal.copy(), 24000, - BW_Util.getMachineVoltageFromTier(6) - ); + BW_Util.getMachineVoltageFromTier(6)); } - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.Forsterit.get(OrePrefixes.dust, 7), GT_Values.NI, GT_Values.NF, Materials.Oxygen.getGas(2000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnesium, 2L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 200, 90); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.RedZircon.get(OrePrefixes.dust, 6), GT_Values.NI, GT_Values.NF, Materials.Oxygen.getGas(2000L), WerkstoffLoader.Zirconium.get(OrePrefixes.dust, 1), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 250, 90); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.Fayalit.get(OrePrefixes.dust, 7), GT_Values.NI, GT_Values.NF, Materials.Oxygen.getGas(2000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 2L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 320, 90); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.Prasiolite.get(OrePrefixes.dust, 16), GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 5L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 580, 90); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.Hedenbergit.get(OrePrefixes.dust, 10), GT_Values.NI, GT_Values.NF, Materials.Oxygen.getGas(2000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Calcium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 2L), GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 300, 90); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.FuchsitAL.get(OrePrefixes.dust, 21), ItemList.Cell_Empty.get(2), GT_Values.NF, Materials.Oxygen.getGas(2000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2), GT_Values.NI, GT_Values.NI, null, 390, 120); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.FuchsitCR.get(OrePrefixes.dust, 21), ItemList.Cell_Empty.get(2), GT_Values.NF, Materials.Oxygen.getGas(2000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2), GT_Values.NI, GT_Values.NI, null, 460, 120); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.VanadioOxyDravit.get(OrePrefixes.dust, 53), ItemList.Cell_Empty.get(3), GT_Values.NF, Materials.Oxygen.getGas(19000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Vanadium, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), null, 710, 120); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.ChromoAluminoPovondrait.get(OrePrefixes.dust, 53), ItemList.Cell_Empty.get(3), GT_Values.NF, Materials.Oxygen.getGas(19000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), null, 720, 120); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.FluorBuergerit.get(OrePrefixes.dust, 50), ItemList.Cell_Empty.get(3), GT_Values.NF, Materials.Oxygen.getGas(6000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fluorine, 3), null, 730, 120); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.Olenit.get(OrePrefixes.dust, 51), ItemList.Cell_Empty.get(1), GT_Values.NF, Materials.Oxygen.getGas(1000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 9L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 1), GT_Values.NI, null, 790, 120); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.Forsterit.get(OrePrefixes.dust, 7), + GT_Values.NI, + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnesium, 2L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 200, + 90); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.RedZircon.get(OrePrefixes.dust, 6), + GT_Values.NI, + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + WerkstoffLoader.Zirconium.get(OrePrefixes.dust, 1), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 250, + 90); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.Fayalit.get(OrePrefixes.dust, 7), + GT_Values.NI, + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 2L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 320, + 90); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.Prasiolite.get(OrePrefixes.dust, 16), + GT_Values.NI, + GT_Values.NF, + GT_Values.NF, + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 5L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 580, + 90); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.Hedenbergit.get(OrePrefixes.dust, 10), + GT_Values.NI, + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Calcium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 2L), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 300, + 90); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.FuchsitAL.get(OrePrefixes.dust, 21), + ItemList.Cell_Empty.get(2), + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2), + GT_Values.NI, + GT_Values.NI, + null, + 390, + 120); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.FuchsitCR.get(OrePrefixes.dust, 21), + ItemList.Cell_Empty.get(2), + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2), + GT_Values.NI, + GT_Values.NI, + null, + 460, + 120); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.VanadioOxyDravit.get(OrePrefixes.dust, 53), + ItemList.Cell_Empty.get(3), + GT_Values.NF, + Materials.Oxygen.getGas(19000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Vanadium, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), + null, + 710, + 120); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.ChromoAluminoPovondrait.get(OrePrefixes.dust, 53), + ItemList.Cell_Empty.get(3), + GT_Values.NF, + Materials.Oxygen.getGas(19000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), + null, + 720, + 120); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.FluorBuergerit.get(OrePrefixes.dust, 50), + ItemList.Cell_Empty.get(3), + GT_Values.NF, + Materials.Oxygen.getGas(6000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fluorine, 3), + null, + 730, + 120); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.Olenit.get(OrePrefixes.dust, 51), + ItemList.Cell_Empty.get(1), + GT_Values.NF, + Materials.Oxygen.getGas(1000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 9L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 1), + GT_Values.NI, + null, + 790, + 120); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java index bac618bb95..26f268f0ef 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java @@ -27,7 +27,7 @@ import cpw.mods.fml.common.event.FMLServerStartingEvent; public class RegisterServerCommands { - public static void registerAll(FMLServerStartingEvent event){ + public static void registerAll(FMLServerStartingEvent event) { event.registerServerCommand(new SummonRuin()); event.registerServerCommand(new ChangeConfig()); event.registerServerCommand(new PrintRecipeListToFile()); @@ -35,5 +35,4 @@ public class RegisterServerCommands { event.registerServerCommand(new GetWorkingDirectory()); event.registerServerCommand(new RunGC()); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 7a29cac216..6e9ae5d852 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.bartworks.common.loaders; +import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static gregtech.api.enums.GT_Values.VN; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -42,6 +46,10 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.*; +import java.util.stream.Collectors; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidContainerRegistry; @@ -51,26 +59,16 @@ import net.minecraftforge.oredict.OreDictionary; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.reflect.FieldUtils; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.*; -import java.util.stream.Collectors; - -import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; -import static gregtech.api.enums.GT_Values.VN; - public class StaticRecipeChangeLoaders { private static TObjectDoubleHashMap gtEbfGasRecipeTimeMultipliers = null; private static TObjectDoubleHashMap gtEbfGasRecipeConsumptionMultipliers = null; public static final List whitelistForEBFNoGasRecipeDontCheckItemData = Arrays.asList( - GT_ModHandler.getModItem("TConstruct", "materials", 1L, 12) // Raw Aluminum -> Aluminium Ingot (coremod) - ); + GT_ModHandler.getModItem("TConstruct", "materials", 1L, 12) // Raw Aluminum -> Aluminium Ingot (coremod) + ); - private StaticRecipeChangeLoaders() { - } + private StaticRecipeChangeLoaders() {} public static void addEBFGasRecipes() { if (gtEbfGasRecipeTimeMultipliers == null) { @@ -81,8 +79,10 @@ public class StaticRecipeChangeLoaders { } if (gtEbfGasRecipeConsumptionMultipliers == null) { // For Werkstoff gases, use Werkstoff.Stats.setEbfGasRecipeConsumedAmountMultiplier - gtEbfGasRecipeConsumptionMultipliers = new TObjectDoubleHashMap<>(10, 0.5F, 1.0D); // keep default value as 1 - // Example to make Argon recipes use half the gas amount of the primary recipe (1000L->500L, 2000L->1000L etc.): + gtEbfGasRecipeConsumptionMultipliers = + new TObjectDoubleHashMap<>(10, 0.5F, 1.0D); // keep default value as 1 + // Example to make Argon recipes use half the gas amount of the primary recipe (1000L->500L, 2000L->1000L + // etc.): // gtEbfGasRecipeConsumptionMultipliers.put(Materials.Argon, 1.0D / 2.0D); } ArrayListMultimap toChange = getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS); @@ -92,10 +92,11 @@ public class StaticRecipeChangeLoaders { public static void fixEnergyRequirements() { GT_Recipe.GT_Recipe_Map.sMappings.stream() .filter(StreamUtils::filterVisualMaps) - .forEach(gt_recipe_map -> - gt_recipe_map.mRecipeList.parallelStream().forEach(gt_recipe -> { + .forEach(gt_recipe_map -> gt_recipe_map.mRecipeList.parallelStream() + .forEach(gt_recipe -> { for (int i = 0; i < (VN.length - 1); i++) { - if (gt_recipe.mEUt > BW_Util.getMachineVoltageFromTier(i) && gt_recipe.mEUt <= BW_Util.getTierVoltage(i)) { + if (gt_recipe.mEUt > BW_Util.getMachineVoltageFromTier(i) + && gt_recipe.mEUt <= BW_Util.getTierVoltage(i)) { gt_recipe.mEUt = BW_Util.getMachineVoltageFromTier(i); } } @@ -110,20 +111,32 @@ public class StaticRecipeChangeLoaders { } } - private static void replaceWrongFluidInput(Werkstoff werkstoff, GT_Recipe.GT_Recipe_Map map, GT_Recipe recipe, FluidStack wrongNamedFluid) { + private static void replaceWrongFluidInput( + Werkstoff werkstoff, GT_Recipe.GT_Recipe_Map map, GT_Recipe recipe, FluidStack wrongNamedFluid) { for (int i = 0; i < recipe.mFluidInputs.length; i++) { if (GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], wrongNamedFluid)) { Collection col = map.mRecipeFluidMap.get(wrongNamedFluid.getFluid()); map.mRecipeFluidMap.remove(wrongNamedFluid.getFluid()); map.mRecipeFluidMap.put(werkstoff.getFluidOrGas(1).getFluid(), col); recipe.mFluidInputs[i] = werkstoff.getFluidOrGas(recipe.mFluidInputs[i].amount); - map.mRecipeFluidNameMap.add(werkstoff.getFluidOrGas(1).getFluid().getName()); + map.mRecipeFluidNameMap.add( + werkstoff.getFluidOrGas(1).getFluid().getName()); } } } private static void addConversionRecipe(Werkstoff werkstoff, FluidStack wrongNamedFluid) { - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(false, null, null, null, null, new FluidStack[]{wrongNamedFluid}, new FluidStack[]{werkstoff.getFluidOrGas(1)}, 1, 1, 0)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe( + false, + null, + null, + null, + null, + new FluidStack[] {wrongNamedFluid}, + new FluidStack[] {werkstoff.getFluidOrGas(1)}, + 1, + 1, + 0)); } private static FluidStack getWrongNameFluid(Werkstoff werkstoff) { @@ -148,8 +161,7 @@ public class StaticRecipeChangeLoaders { StaticRecipeChangeLoaders.runMaterialLinker(werkstoff); if (werkstoff.getGenerationFeatures().enforceUnification) { - if (werkstoff.contains(NOBLE_GAS)) - enforceNobleGas(werkstoff); + if (werkstoff.contains(NOBLE_GAS)) enforceNobleGas(werkstoff); HashSet oreDictNames = new HashSet<>(werkstoff.getADDITIONAL_OREDICT()); oreDictNames.add(werkstoff.getVarName()); @@ -157,48 +169,50 @@ public class StaticRecipeChangeLoaders { StaticRecipeChangeLoaders.runUnficationDeleter(werkstoff); for (String s : oreDictNames) for (OrePrefixes prefixes : OrePrefixes.values()) { - if (!werkstoff.hasItemType(prefixes)) - continue; + if (!werkstoff.hasItemType(prefixes)) continue; String fullOreName = prefixes + s; List ores = OreDictionary.getOres(fullOreName, false); if (ores.size() <= 1) // empty or one entry, i.e. no unification needed - continue; + continue; for (ItemStack toReplace : ores) { ItemStack replacement = werkstoff.get(prefixes); - if (toReplace == null || GT_Utility.areStacksEqual(toReplace, replacement) || replacement == null || replacement.getItem() == null) - continue; + if (toReplace == null + || GT_Utility.areStacksEqual(toReplace, replacement) + || replacement == null + || replacement.getItem() == null) continue; for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { nextRecipe: for (Iterator iterator = map.mRecipeList.iterator(); iterator.hasNext(); ) { GT_Recipe recipe = iterator.next(); - boolean removal = map.equals(GT_Recipe_Map.sFluidExtractionRecipes) || map.equals(GT_Recipe_Map.sFluidSolidficationRecipes); + boolean removal = map.equals(GT_Recipe_Map.sFluidExtractionRecipes) + || map.equals(GT_Recipe_Map.sFluidSolidficationRecipes); for (int i = 0; i < recipe.mInputs.length; i++) { - if (!GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) - continue; + if (!GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) continue; if (removal) { iterator.remove(); continue nextRecipe; } - recipe.mInputs[i] = GT_Utility.copyAmount(recipe.mInputs[i].stackSize, replacement); + recipe.mInputs[i] = + GT_Utility.copyAmount(recipe.mInputs[i].stackSize, replacement); } for (int i = 0; i < recipe.mOutputs.length; i++) { - if (!GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) - continue; + if (!GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) continue; if (removal) { iterator.remove(); continue nextRecipe; } - recipe.mOutputs[i] = GT_Utility.copyAmount(recipe.mOutputs[i].stackSize, replacement); + recipe.mOutputs[i] = + GT_Utility.copyAmount(recipe.mOutputs[i].stackSize, replacement); } if (recipe.mSpecialItems instanceof ItemStack) { ItemStack specialItemStack = (ItemStack) recipe.mSpecialItems; - if (!GT_Utility.areStacksEqual(specialItemStack, toReplace)) - continue; + if (!GT_Utility.areStacksEqual(specialItemStack, toReplace)) continue; if (removal) { iterator.remove(); continue nextRecipe; } - recipe.mSpecialItems = GT_Utility.copyAmount((specialItemStack).stackSize, replacement); + recipe.mSpecialItems = + GT_Utility.copyAmount((specialItemStack).stackSize, replacement); } } } @@ -212,17 +226,22 @@ public class StaticRecipeChangeLoaders { private static void runMoltenUnificationEnfocement(Werkstoff werkstoff) { if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { try { - FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); + FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData( + new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), + werkstoff.get(WerkstoffLoader.cellMolten), + Materials.Empty.getCells(1)); Field f = GT_Utility.class.getDeclaredField("sFilledContainerToData"); f.setAccessible(true); - Map sFilledContainerToData = (Map) f.get(null); + Map sFilledContainerToData = + (Map) f.get(null); HashSet torem = new HashSet<>(); ItemStack toReplace = null; - for (Map.Entry entry : sFilledContainerToData.entrySet()) { + for (Map.Entry entry : + sFilledContainerToData.entrySet()) { final String MODID = GameRegistry.findUniqueIdentifierFor(data.filledContainer.getItem()).modId; - if (MODID.equals(MainMod.MOD_ID) || MODID.equals(BartWorksCrossmod.MOD_ID)) - continue; - if (entry.getValue().fluid.equals(data.fluid) && !entry.getValue().filledContainer.equals(data.filledContainer)) { + if (MODID.equals(MainMod.MOD_ID) || MODID.equals(BartWorksCrossmod.MOD_ID)) continue; + if (entry.getValue().fluid.equals(data.fluid) + && !entry.getValue().filledContainer.equals(data.filledContainer)) { toReplace = entry.getValue().filledContainer; torem.add(entry); } @@ -243,7 +262,9 @@ public class StaticRecipeChangeLoaders { if (GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) { torem.add(recipe); // recipe.mOutputs[i] = data.filledContainer; - if (map == GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes && GT_Utility.areStacksEqual(recipe.mOutputs[i], data.filledContainer) && !recipe.mFluidInputs[0].equals(data.fluid)) { + if (map == GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes + && GT_Utility.areStacksEqual(recipe.mOutputs[i], data.filledContainer) + && !recipe.mFluidInputs[0].equals(data.fluid)) { torem.add(recipe); // recipe.mOutputs[i] = data.filledContainer; } @@ -316,7 +337,8 @@ public class StaticRecipeChangeLoaders { if (mat != Materials._NULL) { for (SubTag tag : GasTags) { if (mat.contains(tag)) { - DebugLog.log("Found EBF Recipe to change, Output:" + BW_Util.translateGTItemStack(recipe.mOutputs[0])); + DebugLog.log("Found EBF Recipe to change, Output:" + + BW_Util.translateGTItemStack(recipe.mOutputs[0])); toAdd.put(tag, recipe); } } @@ -338,30 +360,39 @@ public class StaticRecipeChangeLoaders { for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList) { for (SubTag tag : base.keySet()) recipeLoop: - for (GT_Recipe baseRe : base.get(tag)) { - if (recipe.mInputs.length == baseRe.mInputs.length && recipe.mOutputs.length == baseRe.mOutputs.length) - for (int i = 0; i < recipe.mInputs.length; i++) { - ItemStack tmpInput = recipe.mInputs[i]; - if ( - (recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) - && (whitelistForEBFNoGasRecipeDontCheckItemData.stream().anyMatch(s -> GT_Utility.areStacksEqual(s, tmpInput)) - || (BW_Util.checkStackAndPrefix(recipe.mInputs[i]) + for (GT_Recipe baseRe : base.get(tag)) { + if (recipe.mInputs.length == baseRe.mInputs.length + && recipe.mOutputs.length == baseRe.mOutputs.length) + for (int i = 0; i < recipe.mInputs.length; i++) { + ItemStack tmpInput = recipe.mInputs[i]; + if ((recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) + && (whitelistForEBFNoGasRecipeDontCheckItemData.stream() + .anyMatch(s -> GT_Utility.areStacksEqual(s, tmpInput)) + || (BW_Util.checkStackAndPrefix(recipe.mInputs[i]) && BW_Util.checkStackAndPrefix(baseRe.mInputs[i]) - && GT_OreDictUnificator.getAssociation(recipe.mInputs[i]).mMaterial.mMaterial.equals(GT_OreDictUnificator.getAssociation(baseRe.mInputs[i]).mMaterial.mMaterial) - && GT_Utility.areStacksEqual(recipe.mOutputs[0], baseRe.mOutputs[0])))) { - toAdd.add(recipe.mOutputs[0]); - repToAdd.put(tag, recipe); - continue recipeLoop; - } - } + && GT_OreDictUnificator.getAssociation(recipe.mInputs[i]) + .mMaterial + .mMaterial + .equals(GT_OreDictUnificator.getAssociation( + baseRe.mInputs[i]) + .mMaterial + .mMaterial) + && GT_Utility.areStacksEqual( + recipe.mOutputs[0], baseRe.mOutputs[0])))) { + toAdd.add(recipe.mOutputs[0]); + repToAdd.put(tag, recipe); + continue recipeLoop; + } } + } } base.putAll(repToAdd); return toAdd; } private static int transformEBFGasRecipeTime(int originalDuration, long originalGasProtons, long newGasProtons) { - double protonTerm = (double) originalGasProtons * (newGasProtons >= originalGasProtons ? 1.0D : 2.75D) - (double) newGasProtons; + double protonTerm = (double) originalGasProtons * (newGasProtons >= originalGasProtons ? 1.0D : 2.75D) + - (double) newGasProtons; return Math.max(1, (int) ((double) originalDuration / 200D * Math.max(200D + protonTerm, 1D))); } @@ -377,7 +408,10 @@ public class StaticRecipeChangeLoaders { private static int transformEBFGasRecipeTime(GT_Recipe recipe, Materials originalGas, Werkstoff newGas) { double newEbfMul = newGas.getStats().getEbfGasRecipeTimeMultiplier(); if (newEbfMul < 0.0D) { - return transformEBFGasRecipeTime(recipe.mDuration, originalGas.getProtons(), newGas.getStats().getProtons()); + return transformEBFGasRecipeTime( + recipe.mDuration, + originalGas.getProtons(), + newGas.getStats().getProtons()); } else { return Math.max(1, (int) ((double) recipe.mDuration * newEbfMul)); } @@ -387,51 +421,125 @@ public class StaticRecipeChangeLoaders { return transformEBFGasRecipeTime(recipe.mDuration, originalGas.getProtons(), 0); } - private static void editEBFMaterialRecipes(SubTag GasTag, GT_Recipe recipe, Materials originalGas, HashSet toAdd) { + private static void editEBFMaterialRecipes( + SubTag GasTag, GT_Recipe recipe, Materials originalGas, HashSet toAdd) { for (Materials newGas : Materials.values()) { if (newGas.contains(GasTag)) { int time = transformEBFGasRecipeTime(recipe, originalGas, newGas); - int gasAmount = Math.max(1, (int) Math.round((double) recipe.mFluidInputs[0].amount * gtEbfGasRecipeConsumptionMultipliers.get(newGas))); - if (recipe.mFluidInputs != null && recipe.mFluidInputs.length == 1 && recipe.mFluidInputs[0].isFluidEqual(newGas.getGas(0))) { + int gasAmount = Math.max(1, (int) Math.round( + (double) recipe.mFluidInputs[0].amount * gtEbfGasRecipeConsumptionMultipliers.get(newGas))); + if (recipe.mFluidInputs != null + && recipe.mFluidInputs.length == 1 + && recipe.mFluidInputs[0].isFluidEqual(newGas.getGas(0))) { // preserve original recipe owner - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{newGas.getGas(gasAmount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue, recipe)); + toAdd.add(new BWRecipes.DynamicGTRecipe( + false, + recipe.mInputs, + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + new FluidStack[] {newGas.getGas(gasAmount)}, + recipe.mFluidOutputs, + time, + recipe.mEUt, + recipe.mSpecialValue, + recipe)); } else { // new recipe - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{newGas.getGas(gasAmount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); + toAdd.add(new BWRecipes.DynamicGTRecipe( + false, + recipe.mInputs, + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + new FluidStack[] {newGas.getGas(gasAmount)}, + recipe.mFluidOutputs, + time, + recipe.mEUt, + recipe.mSpecialValue)); } } } } - private static void editEBFWerkstoffRecipes(SubTag GasTag, GT_Recipe recipe, Materials originalGas, HashSet toAdd) { + private static void editEBFWerkstoffRecipes( + SubTag GasTag, GT_Recipe recipe, Materials originalGas, HashSet toAdd) { for (Werkstoff newGas : Werkstoff.werkstoffHashMap.values()) { if (newGas.contains(GasTag)) { int time = transformEBFGasRecipeTime(recipe, originalGas, newGas); - int gasAmount = Math.max(1, (int) Math.round((double) recipe.mFluidInputs[0].amount * newGas.getStats().getEbfGasRecipeConsumedAmountMultiplier())); - if (recipe.mFluidInputs != null && recipe.mFluidInputs.length == 1 && recipe.mFluidInputs[0].isFluidEqual(new FluidStack(Objects.requireNonNull(fluids.get(newGas)), 0))) { + int gasAmount = Math.max(1, (int) Math.round((double) recipe.mFluidInputs[0].amount + * newGas.getStats().getEbfGasRecipeConsumedAmountMultiplier())); + if (recipe.mFluidInputs != null + && recipe.mFluidInputs.length == 1 + && recipe.mFluidInputs[0].isFluidEqual( + new FluidStack(Objects.requireNonNull(fluids.get(newGas)), 0))) { // preserve original recipe owner - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue, recipe)); + toAdd.add(new BWRecipes.DynamicGTRecipe( + false, + recipe.mInputs, + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + new FluidStack[] {new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount)}, + recipe.mFluidOutputs, + time, + recipe.mEUt, + recipe.mSpecialValue, + recipe)); } else { // new recipe - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); + toAdd.add(new BWRecipes.DynamicGTRecipe( + false, + recipe.mInputs, + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + new FluidStack[] {new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount)}, + recipe.mFluidOutputs, + time, + recipe.mEUt, + recipe.mSpecialValue)); } } } } - private static void editEBFNoGasRecipes(GT_Recipe recipe, Materials originalGas, HashSet toAdd, HashSet noGas) { + private static void editEBFNoGasRecipes( + GT_Recipe recipe, Materials originalGas, HashSet toAdd, HashSet noGas) { for (ItemStack is : noGas) { byte circuitConfiguration = 1; if (GT_Utility.areStacksEqual(is, recipe.mOutputs[0])) { ArrayList inputs = new ArrayList<>(recipe.mInputs.length); for (ItemStack stack : recipe.mInputs) - if (!GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(11), stack) && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(14), stack) && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(19), stack)) { + if (!GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(11), stack) + && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(14), stack) + && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(19), stack)) { if (BW_Util.checkStackAndPrefix(stack)) - circuitConfiguration = (byte) (GT_OreDictUnificator.getAssociation(stack).mPrefix.equals(OrePrefixes.dustSmall) ? 4 : GT_OreDictUnificator.getAssociation(stack).mPrefix.equals(OrePrefixes.dustTiny) ? 9 : 1); + circuitConfiguration = (byte) + (GT_OreDictUnificator.getAssociation(stack) + .mPrefix + .equals(OrePrefixes.dustSmall) + ? 4 + : GT_OreDictUnificator.getAssociation(stack) + .mPrefix + .equals(OrePrefixes.dustTiny) + ? 9 + : 1); inputs.add(stack); } inputs.add(GT_Utility.getIntegratedCircuit(circuitConfiguration)); - toAdd.add(new BWRecipes.DynamicGTRecipe(false, inputs.toArray(new ItemStack[0]), recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, transformEBFNoGasRecipeTime(recipe, originalGas), recipe.mEUt, recipe.mSpecialValue, recipe)); + toAdd.add(new BWRecipes.DynamicGTRecipe( + false, + inputs.toArray(new ItemStack[0]), + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + null, + recipe.mFluidOutputs, + transformEBFNoGasRecipeTime(recipe, originalGas), + recipe.mEUt, + recipe.mSpecialValue, + recipe)); break; } } @@ -441,19 +549,20 @@ public class StaticRecipeChangeLoaders { HashSet duplicates = new HashSet<>(); for (GT_Recipe recipe : toAdd) { for (GT_Recipe recipe2 : toAdd) { - if (recipe.mEUt != recipe2.mEUt || recipe.mDuration != recipe2.mDuration || recipe.mSpecialValue != recipe2.mSpecialValue || recipe == recipe2 || recipe.mInputs.length != recipe2.mInputs.length || recipe.mFluidInputs.length != recipe2.mFluidInputs.length) - continue; + if (recipe.mEUt != recipe2.mEUt + || recipe.mDuration != recipe2.mDuration + || recipe.mSpecialValue != recipe2.mSpecialValue + || recipe == recipe2 + || recipe.mInputs.length != recipe2.mInputs.length + || recipe.mFluidInputs.length != recipe2.mFluidInputs.length) continue; boolean isSame = true; for (int i = 0; i < recipe.mInputs.length; i++) { - if (!GT_Utility.areStacksEqual(recipe.mInputs[i], recipe2.mInputs[i])) - isSame = false; + if (!GT_Utility.areStacksEqual(recipe.mInputs[i], recipe2.mInputs[i])) isSame = false; } for (int i = 0; i < recipe.mFluidInputs.length; i++) { - if (!GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], recipe2.mFluidInputs[i])) - isSame = false; + if (!GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], recipe2.mFluidInputs[i])) isSame = false; } - if (isSame) - duplicates.add(recipe2); + if (isSame) duplicates.add(recipe2); } } toAdd.removeAll(duplicates); @@ -468,15 +577,15 @@ public class StaticRecipeChangeLoaders { } private static void editRecipes(ArrayListMultimap base, HashSet noGas) { - if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeFluidNameMap.contains(Objects.requireNonNull(fluids.get(Oganesson)).getName())) - return; + if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeFluidNameMap.contains( + Objects.requireNonNull(fluids.get(Oganesson)).getName())) return; HashSet toAdd = new HashSet<>(); for (SubTag gasTag : base.keySet()) { for (GT_Recipe recipe : base.get(gasTag)) { if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) { - Materials originalGas = getMaterialFromInputFluid(recipe); + Materials originalGas = getMaterialFromInputFluid(recipe); if (originalGas != Materials._NULL) { editEBFWerkstoffRecipes(gasTag, recipe, originalGas, toAdd); editEBFMaterialRecipes(gasTag, recipe, originalGas, toAdd); @@ -494,8 +603,37 @@ public class StaticRecipeChangeLoaders { @SuppressWarnings("ALL") public static void addElectricImplosionCompressorRecipes() { if (eicMap == null) { - eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 0, 0, 1, "", 1, "", true, true); - GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream().filter(e -> e.mInputs != null).forEach(recipe -> eicMap.addRecipe(true, Arrays.stream(recipe.mInputs).filter(e -> !StaticRecipeChangeLoaders.checkForExplosives(e)).distinct().toArray(ItemStack[]::new), recipe.mOutputs, null, null, null, 1, BW_Util.getMachineVoltageFromTier(10), 0)); + eicMap = new GT_Recipe.GT_Recipe_Map( + new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), + "gt.recipe.electricimplosioncompressor", + "Electric Implosion Compressor", + (String) null, + "gregtech:textures/gui/basicmachines/Default", + 1, + 2, + 0, + 0, + 1, + "", + 1, + "", + true, + true); + GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream() + .filter(e -> e.mInputs != null) + .forEach(recipe -> eicMap.addRecipe( + true, + Arrays.stream(recipe.mInputs) + .filter(e -> !StaticRecipeChangeLoaders.checkForExplosives(e)) + .distinct() + .toArray(ItemStack[]::new), + recipe.mOutputs, + null, + null, + null, + 1, + BW_Util.getMachineVoltageFromTier(10), + 0)); } // Custom electric implosion compressor recipe. Cannot be overclocked. @@ -503,18 +641,23 @@ public class StaticRecipeChangeLoaders { // 72L SpaceTime -> 1 Eternal singularity. eicMap.addRecipe( - false, - new ItemStack[]{GT_Values.NI}, - new ItemStack[]{GT_ModHandler.getModItem("eternalsingularity", "eternal_singularity", 1L)}, - null, - new FluidStack[]{Materials.SpaceTime.getMolten(72L)}, - new FluidStack[]{GT_Values.NF}, - 100*20, 128_000_000, 1); // aSpecialVaue has no meaning here. + false, + new ItemStack[] {GT_Values.NI}, + new ItemStack[] {GT_ModHandler.getModItem("eternalsingularity", "eternal_singularity", 1L)}, + null, + new FluidStack[] {Materials.SpaceTime.getMolten(72L)}, + new FluidStack[] {GT_Values.NF}, + 100 * 20, + 128_000_000, + 1); // aSpecialVaue has no meaning here. } } private static boolean checkForExplosives(ItemStack input) { - return (GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L)) || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); + return (GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt)) + || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) + || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L)) + || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); } public static void patchEBFMapForCircuitUnification() { @@ -533,8 +676,7 @@ public class StaticRecipeChangeLoaders { public static void synchroniseCircuitUseMulti() { GT_Recipe.GT_Recipe_Map[] gt_recipe_maps = { - GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes, - GT_Recipe.GT_Recipe_Map.sBlastRecipes + GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes, GT_Recipe.GT_Recipe_Map.sBlastRecipes }; getRecipesByCircuitID(gt_recipe_maps).forEach(StaticRecipeChangeLoaders::transformCircuitRecipes); } @@ -552,17 +694,16 @@ public class StaticRecipeChangeLoaders { ret /= 10; } - if (recipe.mFluidInputs.length != 0) - ret += 10; + if (recipe.mFluidInputs.length != 0) ret += 10; return ret; } - private static int getLogicFuntion(GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe, Pair counts) { + private static int getLogicFuntion( + GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe, Pair counts) { if (gt_recipe_map == GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) return getChemicalLogic(recipe, counts); - else if (gt_recipe_map == GT_Recipe.GT_Recipe_Map.sBlastRecipes) - return getBlastLogic(recipe); + else if (gt_recipe_map == GT_Recipe.GT_Recipe_Map.sBlastRecipes) return getBlastLogic(recipe); throw new NoSuchMethodError("Could not find a Supported Method for " + gt_recipe_map.mUnlocalizedName); } @@ -571,17 +712,16 @@ public class StaticRecipeChangeLoaders { if (counts.getKey() == 0 || counts.getValue() == 0) toSet = new Pair<>(Math.max(recipe.mFluidOutputs.length, recipe.mOutputs.length), 0); - else if (counts.getValue() > 2) - toSet = new Pair<>(counts.getKey() + counts.getValue(), 1); - else - toSet = counts; + else if (counts.getValue() > 2) toSet = new Pair<>(counts.getKey() + counts.getValue(), 1); + else toSet = counts; return toSet.getValue() * 10 + toSet.getKey(); } - private static void transformCircuitRecipes(GT_Recipe.GT_Recipe_Map gtRecipeMap, Map> mapGtRecipeCounts) { - mapGtRecipeCounts.forEach((recipe, counts) -> - StaticRecipeChangeLoaders.rewriteForCorrectCircuit(gtRecipeMap, recipe, counts)); + private static void transformCircuitRecipes( + GT_Recipe.GT_Recipe_Map gtRecipeMap, Map> mapGtRecipeCounts) { + mapGtRecipeCounts.forEach( + (recipe, counts) -> StaticRecipeChangeLoaders.rewriteForCorrectCircuit(gtRecipeMap, recipe, counts)); gtRecipeMap.mRecipeList.clear(); gtRecipeMap.mRecipeList.addAll(mapGtRecipeCounts.keySet()); @@ -612,30 +752,21 @@ public class StaticRecipeChangeLoaders { } } - private static Map>> getRecipesByCircuitID(GT_Recipe.GT_Recipe_Map[] ref) { + private static Map>> getRecipesByCircuitID( + GT_Recipe.GT_Recipe_Map[] ref) { return Arrays.stream(ref) - .collect(Collectors - .toMap(k -> k, k -> - getArrayListMultiMapFromRecipeList( - gatherNoCircuitRecipes( - new HashSet<>(k.mRecipeList) - ) - ) - ) - ); - } - - private static GT_Recipe rewriteForCorrectCircuit(GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe, Pair counts) { + .collect(Collectors.toMap( + k -> k, + k -> getArrayListMultiMapFromRecipeList(gatherNoCircuitRecipes(new HashSet<>(k.mRecipeList))))); + } + + private static GT_Recipe rewriteForCorrectCircuit( + GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe, Pair counts) { ItemStack[] old = BW_Util.copyAndRemoveNulls(recipe.mInputs, ItemStack.class); ItemStack[] nu = Arrays.copyOf(old, old.length + 1); - nu[old.length] = GT_Utility.getIntegratedCircuit( //Max 24, Min 1 - Math.min( - Math.max( - getLogicFuntion(gt_recipe_map, recipe, counts), - 1), - 24) - ); + nu[old.length] = GT_Utility.getIntegratedCircuit( // Max 24, Min 1 + Math.min(Math.max(getLogicFuntion(gt_recipe_map, recipe, counts), 1), 24)); recipe.mInputs = nu; return recipe; @@ -650,7 +781,8 @@ public class StaticRecipeChangeLoaders { newColl = new HashSet<>(); } - recipeloop: for (GT_Recipe r : mRecipeList) { + recipeloop: + for (GT_Recipe r : mRecipeList) { for (int i = 0; i < r.mInputs.length; i++) if (GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(Short.MAX_VALUE), r.mInputs[i])) { continue recipeloop; @@ -661,16 +793,17 @@ public class StaticRecipeChangeLoaders { return newColl; } - private static Map> getArrayListMultiMapFromRecipeList(Collection mRecipeList) { - return mRecipeList.stream().collect(Collectors.toMap(recipe -> recipe, recipe -> - new Pair<>( - (int) Arrays.stream(recipe.mInputs) - .filter(Objects::nonNull) - .count(), - (int) Arrays.stream(recipe.mFluidInputs) - .filter(Objects::nonNull) - .count() - ) - )); + private static Map> getArrayListMultiMapFromRecipeList( + Collection mRecipeList) { + return mRecipeList.stream() + .collect(Collectors.toMap( + recipe -> recipe, + recipe -> new Pair<>( + (int) Arrays.stream(recipe.mInputs) + .filter(Objects::nonNull) + .count(), + (int) Arrays.stream(recipe.mFluidInputs) + .filter(Objects::nonNull) + .count()))); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index ca291e64bc..4ae8c10992 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -38,15 +38,14 @@ import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; import io.netty.handler.codec.MessageToMessageCodec; +import java.util.EnumMap; +import java.util.List; +import javax.annotation.Nonnull; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; -import javax.annotation.Nonnull; -import java.util.EnumMap; -import java.util.List; - /* * Original GT File slightly Modified */ @@ -59,40 +58,66 @@ public class BW_Network extends MessageToMessageCodec public BW_Network() { this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", this, new BW_Network.HandlerShared()); - this.mSubChannels = new GT_Packet[]{new RendererPacket(), new CircuitProgrammerPacket(), new MetaBlockPacket(), new OreDictCachePacket(), new ServerJoinedPackage()}; + this.mSubChannels = new GT_Packet[] { + new RendererPacket(), + new CircuitProgrammerPacket(), + new MetaBlockPacket(), + new OreDictCachePacket(), + new ServerJoinedPackage() + }; } protected void encode(ChannelHandlerContext aContext, GT_Packet aPacket, List aOutput) throws Exception { - aOutput.add(new FMLProxyPacket(Unpooled.buffer().writeByte(aPacket.getPacketID()).writeBytes(aPacket.encode()).copy(), (String) aContext.channel().attr(NetworkRegistry.FML_CHANNEL).get())); + aOutput.add(new FMLProxyPacket( + Unpooled.buffer() + .writeByte(aPacket.getPacketID()) + .writeBytes(aPacket.encode()) + .copy(), + (String) aContext.channel().attr(NetworkRegistry.FML_CHANNEL).get())); } - protected void decode(ChannelHandlerContext aContext, FMLProxyPacket aPacket, List aOutput) throws Exception { + protected void decode(ChannelHandlerContext aContext, FMLProxyPacket aPacket, List aOutput) + throws Exception { ByteArrayDataInput aData = ByteStreams.newDataInput(aPacket.payload().array()); aOutput.add(this.mSubChannels[aData.readByte()].decode(aData)); } public void sendToPlayer(@Nonnull GT_Packet aPacket, @Nonnull EntityPlayerMP aPlayer) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPlayer); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) + .attr(FMLOutboundHandler.FML_MESSAGETARGET) + .set(FMLOutboundHandler.OutboundTarget.PLAYER); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) + .attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) + .set(aPlayer); ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket); } public void sendToAllPlayersinWorld(@Nonnull GT_Packet aPacket, World world) { for (String name : FMLServerHandler.instance().getServer().getAllUsernames()) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(world.getPlayerEntityByName(name)); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) + .attr(FMLOutboundHandler.FML_MESSAGETARGET) + .set(FMLOutboundHandler.OutboundTarget.PLAYER); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) + .attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) + .set(world.getPlayerEntityByName(name)); ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket); } } public void sendToAllAround(@Nonnull GT_Packet aPacket, NetworkRegistry.TargetPoint aPosition) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPosition); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) + .attr(FMLOutboundHandler.FML_MESSAGETARGET) + .set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) + .attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) + .set(aPosition); ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket); } public void sendToServer(@Nonnull GT_Packet aPacket) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.CLIENT)).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER); + ((FMLEmbeddedChannel) this.mChannel.get(Side.CLIENT)) + .attr(FMLOutboundHandler.FML_MESSAGETARGET) + .set(FMLOutboundHandler.OutboundTarget.TOSERVER); ((FMLEmbeddedChannel) this.mChannel.get(Side.CLIENT)).writeAndFlush(aPacket); } @@ -106,7 +131,9 @@ public class BW_Network extends MessageToMessageCodec EntityPlayerMP tPlayer = (EntityPlayerMP) tObject; Chunk tChunk = aWorld.getChunkFromBlockCoords(aX, aZ); - if (tPlayer.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { + if (tPlayer.getServerForPlayer() + .getPlayerManager() + .isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { this.sendToPlayer(aPacket, tPlayer); } } @@ -115,8 +142,7 @@ public class BW_Network extends MessageToMessageCodec @Sharable static final class HandlerShared extends SimpleChannelInboundHandler { - HandlerShared() { - } + HandlerShared() {} protected void channelRead0(ChannelHandlerContext ctx, GT_Packet aPacket) throws Exception { EntityPlayer aPlayer = GT_Values.GT.getThePlayer(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java index 3b4571a4ca..11e0ed1352 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.common.net; import com.github.bartimaeusnek.bartworks.common.items.Circuit_Programmer; import com.google.common.io.ByteArrayDataInput; import gregtech.api.net.GT_Packet; +import java.nio.ByteBuffer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -33,8 +34,6 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; -import java.nio.ByteBuffer; - public class CircuitProgrammerPacket extends GT_Packet { private int dimID, playerID; @@ -60,14 +59,22 @@ public class CircuitProgrammerPacket extends GT_Packet { @Override public byte[] encode() { - return ByteBuffer.allocate(9).putInt(0, this.dimID).putInt(4, this.playerID).put(8, (this.hasChip ? this.chipCfg : -1)).array(); + return ByteBuffer.allocate(9) + .putInt(0, this.dimID) + .putInt(4, this.playerID) + .put(8, (this.hasChip ? this.chipCfg : -1)) + .array(); } @Override public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { byte[] ret = new byte[9]; byteArrayDataInput.readFully(ret); - return new CircuitProgrammerPacket(ByteBuffer.wrap(ret).getInt(0), ByteBuffer.wrap(ret).getInt(4), ByteBuffer.wrap(ret).get(8) > -1, ByteBuffer.wrap(ret).get(8)); + return new CircuitProgrammerPacket( + ByteBuffer.wrap(ret).getInt(0), + ByteBuffer.wrap(ret).getInt(4), + ByteBuffer.wrap(ret).get(8) > -1, + ByteBuffer.wrap(ret).get(8)); } @Override @@ -80,10 +87,11 @@ public class CircuitProgrammerPacket extends GT_Packet { if (item instanceof Circuit_Programmer) { NBTTagCompound nbt = stack.getTagCompound(); nbt.setBoolean("HasChip", this.hasChip); - if (this.hasChip) - nbt.setByte("ChipConfig", this.chipCfg); + if (this.hasChip) nbt.setByte("ChipConfig", this.chipCfg); stack.setTagCompound(nbt); - ((EntityPlayer) w.getEntityByID(this.playerID)).inventory.setInventorySlotContents(((EntityPlayer) w.getEntityByID(this.playerID)).inventory.currentItem, stack); + ((EntityPlayer) w.getEntityByID(this.playerID)) + .inventory.setInventorySlotContents( + ((EntityPlayer) w.getEntityByID(this.playerID)).inventory.currentItem, stack); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java index 4fa7ab4327..047631d193 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java @@ -27,12 +27,11 @@ import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block import com.github.bartimaeusnek.bartworks.util.MurmurHash3; import com.google.common.io.ByteArrayDataInput; import gregtech.api.net.GT_Packet; +import java.nio.ByteBuffer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import java.nio.ByteBuffer; - public class MetaBlockPacket extends GT_Packet { int x; @@ -59,8 +58,23 @@ public class MetaBlockPacket extends GT_Packet { @Override public byte[] encode() { - int hash = MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), 0, 12, 31); - return ByteBuffer.allocate(16).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).putInt(hash).array(); + int hash = MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(12) + .putInt(this.x) + .putInt(this.z) + .putShort(this.y) + .putShort(this.meta) + .array(), + 0, + 12, + 31); + return ByteBuffer.allocate(16) + .putInt(this.x) + .putInt(this.z) + .putShort(this.y) + .putShort(this.meta) + .putInt(hash) + .array(); } @Override @@ -73,7 +87,17 @@ public class MetaBlockPacket extends GT_Packet { this.y = buff.getShort(); this.meta = buff.getShort(); MetaBlockPacket todecode = new MetaBlockPacket(this.x, this.y, this.z, this.meta); - if (buff.getInt() != MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), 0, 12, 31)) { + if (buff.getInt() + != MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(12) + .putInt(this.x) + .putInt(this.z) + .putShort(this.y) + .putShort(this.meta) + .array(), + 0, + 12, + 31)) { MainMod.LOGGER.error("PACKET HASH DOES NOT MATCH!"); return null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java index 2831ee4ebe..14a974ea21 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java @@ -26,21 +26,19 @@ import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.Pair; import com.google.common.io.ByteArrayDataInput; import gregtech.api.net.GT_Packet; -import net.minecraft.world.IBlockAccess; - import java.nio.ByteBuffer; import java.util.HashSet; +import net.minecraft.world.IBlockAccess; public class OreDictCachePacket extends GT_Packet { - - private HashSet> hashSet = new HashSet<>(); + private HashSet> hashSet = new HashSet<>(); public OreDictCachePacket() { super(true); } - public OreDictCachePacket(HashSet> set) { + public OreDictCachePacket(HashSet> set) { super(false); this.hashSet = set; } @@ -53,9 +51,8 @@ public class OreDictCachePacket extends GT_Packet { @Override public byte[] encode() { int size = this.hashSet.size(); - ByteBuffer buff = ByteBuffer.allocate(4+size*4+size*2).putInt(size); - for(Pair p : this.hashSet) - buff.putInt(p.getKey()).putShort(p.getValue()); + ByteBuffer buff = ByteBuffer.allocate(4 + size * 4 + size * 2).putInt(size); + for (Pair p : this.hashSet) buff.putInt(p.getKey()).putShort(p.getValue()); return buff.array(); } @@ -63,7 +60,7 @@ public class OreDictCachePacket extends GT_Packet { public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { int size = byteArrayDataInput.readInt(); for (int i = 0; i < size; i++) { - this.hashSet.add(new Pair<>(byteArrayDataInput.readInt(),byteArrayDataInput.readShort())); + this.hashSet.add(new Pair<>(byteArrayDataInput.readInt(), byteArrayDataInput.readShort())); } return new OreDictCachePacket(this.hashSet); } @@ -73,4 +70,4 @@ public class OreDictCachePacket extends GT_Packet { OreDictHandler.getNonBWCache().clear(); OreDictHandler.getNonBWCache().addAll(this.hashSet); } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java index 46a7c36cc9..5ff6ad1431 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -29,9 +29,8 @@ import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.Coords; import com.google.common.io.ByteArrayDataInput; import gregtech.api.net.GT_Packet; -import net.minecraft.world.IBlockAccess; - import java.nio.ByteBuffer; +import net.minecraft.world.IBlockAccess; public class RendererPacket extends GT_Packet { @@ -41,7 +40,6 @@ public class RendererPacket extends GT_Packet { public RendererPacket() { super(true); - } public RendererPacket(Coords coords, int integer, boolean removal) { @@ -62,22 +60,39 @@ public class RendererPacket extends GT_Packet { byte r = (byte) (((this.integer >> 16) & 0xFF) + Byte.MIN_VALUE); byte g = (byte) (((this.integer >> 8) & 0xFF) + Byte.MIN_VALUE); byte b = (byte) (((this.integer) & 0xFF) + Byte.MIN_VALUE); - byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25 + this.coords.z % 25 + this.coords.wID % 25 + this.integer % 25 + this.removal); - return ByteBuffer.allocate(19).putInt(0, this.coords.x).putShort(4, this.coords.y).putInt(6, this.coords.z).putInt(10, this.coords.wID).put(14, r).put(15, g).put(16, b).put(17, this.removal).put(18, checksum).array(); + byte checksum = (byte) (this.coords.x % 25 + + this.coords.y % 25 + + this.coords.z % 25 + + this.coords.wID % 25 + + this.integer % 25 + + this.removal); + return ByteBuffer.allocate(19) + .putInt(0, this.coords.x) + .putShort(4, this.coords.y) + .putInt(6, this.coords.z) + .putInt(10, this.coords.wID) + .put(14, r) + .put(15, g) + .put(16, b) + .put(17, this.removal) + .put(18, checksum) + .array(); } -// /** -// * only use in a debug enviroment, does not do anything on its own. -// * @param buffer -// */ -// public void decodetest (byte[] buffer){ -// this.coords=new Coords(ByteBuffer.wrap(buffer).getInt(0),ByteBuffer.wrap(buffer).getShort(4),ByteBuffer.wrap(buffer).getInt(6),ByteBuffer.wrap(buffer).getInt(10)); -// int[] rgb = {ByteBuffer.wrap(buffer).get(14)-Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(15)-Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(16)-Byte.MIN_VALUE}; -// this.integer= BW_Util.getColorFromRGBArray(rgb); -// this.removal=ByteBuffer.wrap(buffer).get(17); -// -// byte checksum = (byte) (coords.x%25+coords.y%25+coords.z%25+coords.wID%25+integer%25+removal); -// } + // /** + // * only use in a debug enviroment, does not do anything on its own. + // * @param buffer + // */ + // public void decodetest (byte[] buffer){ + // this.coords=new + // Coords(ByteBuffer.wrap(buffer).getInt(0),ByteBuffer.wrap(buffer).getShort(4),ByteBuffer.wrap(buffer).getInt(6),ByteBuffer.wrap(buffer).getInt(10)); + // int[] rgb = {ByteBuffer.wrap(buffer).get(14)-Byte.MIN_VALUE, + // ByteBuffer.wrap(buffer).get(15)-Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(16)-Byte.MIN_VALUE}; + // this.integer= BW_Util.getColorFromRGBArray(rgb); + // this.removal=ByteBuffer.wrap(buffer).get(17); + // + // byte checksum = (byte) (coords.x%25+coords.y%25+coords.z%25+coords.wID%25+integer%25+removal); + // } @Override public GT_Packet decode(ByteArrayDataInput dataInput) { @@ -85,12 +100,25 @@ public class RendererPacket extends GT_Packet { byte[] buffer = new byte[19]; dataInput.readFully(buffer); - this.coords = new Coords(ByteBuffer.wrap(buffer).getInt(0), ByteBuffer.wrap(buffer).getShort(4), ByteBuffer.wrap(buffer).getInt(6), ByteBuffer.wrap(buffer).getInt(10)); - int[] rgb = {ByteBuffer.wrap(buffer).get(14) - Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(15) - Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(16) - Byte.MIN_VALUE}; + this.coords = new Coords( + ByteBuffer.wrap(buffer).getInt(0), + ByteBuffer.wrap(buffer).getShort(4), + ByteBuffer.wrap(buffer).getInt(6), + ByteBuffer.wrap(buffer).getInt(10)); + int[] rgb = { + ByteBuffer.wrap(buffer).get(14) - Byte.MIN_VALUE, + ByteBuffer.wrap(buffer).get(15) - Byte.MIN_VALUE, + ByteBuffer.wrap(buffer).get(16) - Byte.MIN_VALUE + }; this.integer = BW_ColorUtil.getColorFromRGBArray(rgb); this.removal = ByteBuffer.wrap(buffer).get(17); - byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25 + this.coords.z % 25 + this.coords.wID % 25 + this.integer % 25 + this.removal); + byte checksum = (byte) (this.coords.x % 25 + + this.coords.y % 25 + + this.coords.z % 25 + + this.coords.wID % 25 + + this.integer % 25 + + this.removal); if (checksum != ByteBuffer.wrap(buffer).get(18)) { MainMod.LOGGER.error("BW Packet was corrupted or modified!"); @@ -103,10 +131,8 @@ public class RendererPacket extends GT_Packet { @Override public void process(IBlockAccess iBlockAccess) { if (SideReference.Side.Client) { - if (this.removal == 0) - GT_TileEntity_BioVat.staticColorMap.put(this.coords, this.integer); - else - GT_TileEntity_BioVat.staticColorMap.remove(this.coords); + if (this.removal == 0) GT_TileEntity_BioVat.staticColorMap.put(this.coords, this.integer); + else GT_TileEntity_BioVat.staticColorMap.remove(this.coords); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java index 4f3eaf160e..a63388ba25 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java @@ -38,8 +38,10 @@ public class ServerJoinedPackage extends GT_Packet { public ServerJoinedPackage(Object obj) { super(false); - this.config =(byte) (ConfigHandler.classicMode && ConfigHandler.disableExtraGassesForEBF ? 3 : ConfigHandler.classicMode ? 2 : ConfigHandler.disableExtraGassesForEBF ? 1 : 0); - + this.config = (byte) + (ConfigHandler.classicMode && ConfigHandler.disableExtraGassesForEBF + ? 3 + : ConfigHandler.classicMode ? 2 : ConfigHandler.disableExtraGassesForEBF ? 1 : 0); } @Override @@ -49,7 +51,7 @@ public class ServerJoinedPackage extends GT_Packet { @Override public byte[] encode() { - return new byte[]{this.config}; + return new byte[] {this.config}; } @Override @@ -62,6 +64,6 @@ public class ServerJoinedPackage extends GT_Packet { public void process(IBlockAccess iBlockAccess) { boolean gas = (this.config & 1) != 0; boolean classic = (this.config & 0b10) != 0; - MainMod.runOnPlayerJoined(classic,gas); + MainMod.runOnPlayerJoined(classic, gas); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java index 816f43c20b..3d643349c0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java @@ -24,5 +24,4 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; import net.minecraft.tileentity.TileEntity; -public class BWTileEntityDimIDBridge extends TileEntity { -} \ No newline at end of file +public class BWTileEntityDimIDBridge extends TileEntity {} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java index f655541555..a15b043a56 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java @@ -45,5 +45,4 @@ public class BW_RotorBlock extends TileEntityWindKineticGenerator { public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin) { return new BW_GUIContainer_RotorBlock(new ContainerWindKineticGenerator(entityPlayer, this)); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java index 34f86668d7..625352aa82 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java @@ -22,22 +22,21 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; +import static net.minecraftforge.common.util.ForgeDirection.*; + import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; import com.github.bartimaeusnek.bartworks.util.Coords; +import java.util.Comparator; +import java.util.PriorityQueue; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.TileFluidHandler; -import java.util.Comparator; -import java.util.PriorityQueue; - -import static net.minecraftforge.common.util.ForgeDirection.*; - public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implements ITileAddsInformation { - private final static ForgeDirection[] allowed_directions = new ForgeDirection[]{DOWN, WEST, EAST, SOUTH, NORTH}; + private static final ForgeDirection[] allowed_directions = new ForgeDirection[] {DOWN, WEST, EAST, SOUTH, NORTH}; private PriorityQueue breadthFirstQueue = new PriorityQueue<>(Comparator.comparingInt(x -> x.y)); private boolean wasInited = false; @@ -51,8 +50,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem } public void initEntity() { - if (wasInited) - return; + if (wasInited) return; breadthFirstQueue.add(new Coords(this.xCoord, this.yCoord, this.zCoord)); wasInited = true; } @@ -61,8 +59,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem public void updateEntity() { initEntity(); Coords current = breadthFirstQueue.poll(); - if (current == null) - return; + if (current == null) return; setFluidBlock(current); for (ForgeDirection allowed_direction : allowed_directions) { addBlockToQueue(current, allowed_direction); @@ -103,18 +100,15 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem } private void setFluidBlock(Coords current) { - if (!checkForAir(current)) - return; - if (this.tank.drain(1000, false) == null || this.tank.drain(1000, false).amount != 1000) - return; + if (!checkForAir(current)) return; + if (this.tank.drain(1000, false) == null || this.tank.drain(1000, false).amount != 1000) return; FluidStack stack = this.tank.drain(1000, true); worldObj.setBlock(current.x, current.y, current.z, stack.getFluid().getBlock(), 0, 2); } private void addBlockToQueue(Coords current, ForgeDirection allowed_direction) { Coords side = current.getCoordsFromSide(allowed_direction); - if (checkForAir(side)) - breadthFirstQueue.add(side); + if (checkForAir(side)) breadthFirstQueue.add(side); } private boolean checkForAir(Coords coords) { @@ -123,6 +117,6 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem @Override public String[] getInfoData() { - return new String[]{"Experimental Machine to fill Holes with Fluids"}; + return new String[] {"Experimental Machine to fill Holes with Fluids"}; } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index d96c3496d4..ec740107da 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -30,6 +30,8 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Pollution; +import java.util.Arrays; +import java.util.Optional; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -41,10 +43,13 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.*; -import java.util.Arrays; -import java.util.Optional; - -public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDropsContent, IFluidHandler, IFluidTank, ITileWithGUI, ITileAddsInformation, ITileHasDifferentTextureSides { +public class BW_TileEntity_HeatedWaterPump extends TileEntity + implements ITileDropsContent, + IFluidHandler, + IFluidTank, + ITileWithGUI, + ITileAddsInformation, + ITileHasDifferentTextureSides { public static final int FUELSLOT = 0; public static final Fluid WATER = FluidRegistry.WATER; @@ -82,22 +87,19 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr super.readFromNBT(p_145839_1_); } - private boolean checkPreUpdate() { return this.worldObj.isRemote || ((this.fuelstack == null || this.fuelstack.stackSize <= 0) && this.fuel <= 0); } private void fixUnderlflow() { - if (this.fuel < 0) - this.fuel = 0; + if (this.fuel < 0) this.fuel = 0; } private void handleRefuel() { if (this.fuelstack != null && this.fuel == 0) { this.fuel = this.maxfuel = TileEntityFurnace.getItemBurnTime(this.fuelstack); --this.fuelstack.stackSize; - if (this.fuelstack.stackSize <= 0) - this.fuelstack = null; + if (this.fuelstack.stackSize <= 0) this.fuelstack = null; } } @@ -116,8 +118,7 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public void updateEntity() { pushWaterToAdjacentTiles(); - if (checkPreUpdate()) - return; + if (checkPreUpdate()) return; fixUnderlflow(); handleRefuel(); @@ -126,50 +127,44 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr } private void pushWaterToAdjacentTiles() { - Arrays.stream(ForgeDirection.values(), 0, 6) //All but Unknown - .forEach( - direction -> Optional.ofNullable( - this.worldObj.getTileEntity( - this.xCoord + direction.offsetX, - this.yCoord + direction.offsetY, - this.zCoord + direction.offsetZ) - ).ifPresent( - te -> { - if (te instanceof IFluidHandler) { - IFluidHandler tank = (IFluidHandler) te; - if (tank.canFill(direction.getOpposite(), this.outputstack.getFluid())) { - int drainage; - if ((drainage = tank.fill(direction.getOpposite(), this.outputstack, false)) > 0) { - tank.fill(direction.getOpposite(), this.outputstack, true); - this.drain(drainage, true); - } - } - } else if (te instanceof IFluidTank) { - IFluidTank tank = (IFluidTank) te; - int drainage; - if ((drainage = tank.fill(this.outputstack, false)) > 0) { - tank.fill(this.outputstack, true); - this.drain(drainage, true); - } + Arrays.stream(ForgeDirection.values(), 0, 6) // All but Unknown + .forEach(direction -> Optional.ofNullable(this.worldObj.getTileEntity( + this.xCoord + direction.offsetX, + this.yCoord + direction.offsetY, + this.zCoord + direction.offsetZ)) + .ifPresent(te -> { + if (te instanceof IFluidHandler) { + IFluidHandler tank = (IFluidHandler) te; + if (tank.canFill(direction.getOpposite(), this.outputstack.getFluid())) { + int drainage; + if ((drainage = tank.fill(direction.getOpposite(), this.outputstack, false)) > 0) { + tank.fill(direction.getOpposite(), this.outputstack, true); + this.drain(drainage, true); } } - )); + } else if (te instanceof IFluidTank) { + IFluidTank tank = (IFluidTank) te; + int drainage; + if ((drainage = tank.fill(this.outputstack, false)) > 0) { + tank.fill(this.outputstack, true); + this.drain(drainage, true); + } + } + })); } private void causePollution() { Optional.ofNullable(this.worldObj).ifPresent(e -> { - if (e.getTotalWorldTime() % 20 == 0) { - Optional.ofNullable(e.getChunkFromBlockCoords(this.xCoord, this.zCoord)).ifPresent(c -> - GT_Pollution.addPollution(c, ConfigHandler.pollutionHeatedWaterPumpSecond) - ); - } - } - ); + if (e.getTotalWorldTime() % 20 == 0) { + Optional.ofNullable(e.getChunkFromBlockCoords(this.xCoord, this.zCoord)) + .ifPresent(c -> GT_Pollution.addPollution(c, ConfigHandler.pollutionHeatedWaterPumpSecond)); + } + }); } @Override public int[] getAccessibleSlotsFromSide(int side) { - return new int[]{0}; + return new int[] {0}; } @Override @@ -189,16 +184,15 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public ItemStack getStackInSlot(int p_70301_1_) { - if (p_70301_1_ == 0) - return this.fuelstack; - else - return this.fakestack; + if (p_70301_1_ == 0) return this.fuelstack; + else return this.fakestack; } @Override public ItemStack decrStackSize(int slot, int ammount) { - if (slot != BW_TileEntity_HeatedWaterPump.FUELSLOT || this.fuelstack == null || ammount > this.fuelstack.stackSize) - return null; + if (slot != BW_TileEntity_HeatedWaterPump.FUELSLOT + || this.fuelstack == null + || ammount > this.fuelstack.stackSize) return null; return this.fuelstack.splitStack(ammount); } @@ -210,10 +204,8 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public void setInventorySlotContents(int slot, ItemStack p_70299_2_) { - if (slot == BW_TileEntity_HeatedWaterPump.FUELSLOT) - this.fuelstack = p_70299_2_; - else - this.fakestack = p_70299_2_; + if (slot == BW_TileEntity_HeatedWaterPump.FUELSLOT) this.fuelstack = p_70299_2_; + else this.fakestack = p_70299_2_; } @Override @@ -237,17 +229,15 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr } @Override - public void openInventory() { - } + public void openInventory() {} @Override - public void closeInventory() { - - } + public void closeInventory() {} @Override public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - return TileEntityFurnace.getItemBurnTime(p_94041_2_) > 0 && p_94041_1_ == BW_TileEntity_HeatedWaterPump.FUELSLOT; + return TileEntityFurnace.getItemBurnTime(p_94041_2_) > 0 + && p_94041_1_ == BW_TileEntity_HeatedWaterPump.FUELSLOT; } @Override @@ -278,14 +268,13 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public FluidStack drain(int maxDrain, boolean doDrain) { int actualdrain = maxDrain; - if (actualdrain > this.outputstack.amount) - actualdrain = this.outputstack.amount; + if (actualdrain > this.outputstack.amount) actualdrain = this.outputstack.amount; FluidStack ret = new FluidStack(BW_TileEntity_HeatedWaterPump.WATER, actualdrain); - if (ret.amount == 0) - ret = null; + if (ret.amount == 0) ret = null; if (doDrain) { this.outputstack.amount -= actualdrain; - FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(this.outputstack, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this, actualdrain)); + FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent( + this.outputstack, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this, actualdrain)); } return ret; } @@ -302,8 +291,9 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { - if (resource != null && resource.getFluid() == BW_TileEntity_HeatedWaterPump.WATER && this.drain(resource.amount, false) != null) - return this.drain(resource.amount, doDrain); + if (resource != null + && resource.getFluid() == BW_TileEntity_HeatedWaterPump.WATER + && this.drain(resource.amount, false) != null) return this.drain(resource.amount, doDrain); return null; } @@ -324,27 +314,30 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public FluidTankInfo[] getTankInfo(ForgeDirection from) { - return new FluidTankInfo[]{this.getInfo()}; + return new FluidTankInfo[] {this.getInfo()}; } @Override public String[] getInfoData() { - return new String[]{ - StatCollector.translateToLocal("tooltip.tile.waterpump.0.name") + " " + - GT_Utility.formatNumbers(ConfigHandler.mbWaterperSec) + - String.format( - StatCollector.translateToLocal("tooltip.tile.waterpump.1.name"), - ConfigHandler.pollutionHeatedWaterPumpSecond - ), - StatCollector.translateToLocal("tooltip.tile.waterpump.2.name")}; + return new String[] { + StatCollector.translateToLocal("tooltip.tile.waterpump.0.name") + " " + + GT_Utility.formatNumbers(ConfigHandler.mbWaterperSec) + + String.format( + StatCollector.translateToLocal("tooltip.tile.waterpump.1.name"), + ConfigHandler.pollutionHeatedWaterPumpSecond), + StatCollector.translateToLocal("tooltip.tile.waterpump.2.name") + }; } @Override public void registerBlockIcons(IIconRegister par1IconRegister) { - ITileHasDifferentTextureSides.texture[ForgeDirection.UP.ordinal()] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpTop"); - ITileHasDifferentTextureSides.texture[ForgeDirection.DOWN.ordinal()] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpDown"); + ITileHasDifferentTextureSides.texture[ForgeDirection.UP.ordinal()] = + par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpTop"); + ITileHasDifferentTextureSides.texture[ForgeDirection.DOWN.ordinal()] = + par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpDown"); for (int i = 2; i < 7; i++) { - ITileHasDifferentTextureSides.texture[i] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpSide"); + ITileHasDifferentTextureSides.texture[i] = + par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpSide"); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java index 9efc0c4cfb..7f25dd52c2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java @@ -24,14 +24,13 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.*; -import java.util.ArrayList; - public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank, IFluidHandler, ITileWithGUI { final ArrayList INTERNALTANKS = new ArrayList<>(); @@ -60,7 +59,7 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public boolean canDrain(ForgeDirection from, Fluid fluid) { - boolean ret = false; + boolean ret = false; for (FluidStack stack : this.INTERNALTANKS) { ret = GT_Utility.areFluidsEqual(stack, new FluidStack(fluid, 0)); if (ret) { @@ -79,8 +78,7 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public FluidStack getFluid() { if (this.INTERNALTANKS.get(this.selectedTank) == null || this.INTERNALTANKS.get(this.selectedTank).amount == 0) - if (this.selectedTank > 0) - this.selectedTank = this.INTERNALTANKS.size() - 1; + if (this.selectedTank > 0) this.selectedTank = this.INTERNALTANKS.size() - 1; return this.INTERNALTANKS.get(this.selectedTank); } @@ -107,7 +105,6 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank p_145841_1_.setTag("InternalTank", lInternalTank); } - @Override public int getCapacity() { return Integer.MAX_VALUE; @@ -120,11 +117,9 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public int fill(FluidStack resource, boolean doFill) { - if (this.worldObj.isRemote || resource == null || resource.amount == 0) - return 0; + if (this.worldObj.isRemote || resource == null || resource.amount == 0) return 0; - if (!doFill) - return resource.amount; + if (!doFill) return resource.amount; int id = 0; @@ -146,18 +141,16 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank public FluidStack drain(int maxDrain, boolean doDrain) { FluidStack outputstack = this.INTERNALTANKS.get(this.selectedTank); - if (this.worldObj.isRemote || maxDrain == 0 || this.getFluid() == null || outputstack == null) - return null; + if (this.worldObj.isRemote || maxDrain == 0 || this.getFluid() == null || outputstack == null) return null; int actualdrain = maxDrain; - if (actualdrain > outputstack.amount) - actualdrain = outputstack.amount; + if (actualdrain > outputstack.amount) actualdrain = outputstack.amount; FluidStack ret = new FluidStack(outputstack.getFluid(), actualdrain); - if (ret.amount == 0) - ret = null; + if (ret.amount == 0) ret = null; if (doDrain) { outputstack.amount -= actualdrain; - FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(outputstack, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this, actualdrain)); + FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent( + outputstack, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this, actualdrain)); } return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java index 49cb2f30eb..141cc4760c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java @@ -1,4 +1,4 @@ -///* +/// * // * Copyright (c) 2019 bartimaeusnek // * // * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -20,37 +20,38 @@ // * SOFTWARE. // */ // -//package com.github.bartimaeusnek.bartworks.common.tileentities.classic; -// -//import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; -//import com.github.bartimaeusnek.bartworks.API.ITileDropsContent; -//import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; -//import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; -//import com.github.bartimaeusnek.bartworks.MainMod; -//import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -//import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -//import com.github.bartimaeusnek.bartworks.util.ConnectedBlocksChecker; -//import cpw.mods.fml.common.FMLCommonHandler; -//import cpw.mods.fml.relauncher.Side; -//import gregtech.api.interfaces.tileentity.IEnergyConnected; -//import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -//import gregtech.api.objects.XSTR; -//import net.minecraft.block.Block; -//import net.minecraft.client.renderer.texture.IIconRegister; -//import net.minecraft.entity.player.EntityPlayer; -//import net.minecraft.inventory.IInventory; -//import net.minecraft.item.ItemStack; -//import net.minecraft.tileentity.TileEntity; -//import net.minecraft.util.StatCollector; -//import net.minecraft.world.World; -//import net.minecraft.world.biome.BiomeGenBase; -//import net.minecraftforge.fluids.IFluidHandler; -// -//import java.nio.ByteBuffer; -//import java.util.ArrayList; -// -// -//public class BW_TileEntity_LESU_Redux extends TileEntity implements ITileHasDifferentTextureSides, ITileAddsInformation, ITileWithGUI, ITileDropsContent, IEnergyConnected { +// package com.github.bartimaeusnek.bartworks.common.tileentities.classic; +// +// import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; +// import com.github.bartimaeusnek.bartworks.API.ITileDropsContent; +// import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; +// import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; +// import com.github.bartimaeusnek.bartworks.MainMod; +// import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +// import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +// import com.github.bartimaeusnek.bartworks.util.ConnectedBlocksChecker; +// import cpw.mods.fml.common.FMLCommonHandler; +// import cpw.mods.fml.relauncher.Side; +// import gregtech.api.interfaces.tileentity.IEnergyConnected; +// import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +// import gregtech.api.objects.XSTR; +// import net.minecraft.block.Block; +// import net.minecraft.client.renderer.texture.IIconRegister; +// import net.minecraft.entity.player.EntityPlayer; +// import net.minecraft.inventory.IInventory; +// import net.minecraft.item.ItemStack; +// import net.minecraft.tileentity.TileEntity; +// import net.minecraft.util.StatCollector; +// import net.minecraft.world.World; +// import net.minecraft.world.biome.BiomeGenBase; +// import net.minecraftforge.fluids.IFluidHandler; +// +// import java.nio.ByteBuffer; +// import java.util.ArrayList; +// +// +// public class BW_TileEntity_LESU_Redux extends TileEntity implements ITileHasDifferentTextureSides, +// ITileAddsInformation, ITileWithGUI, ITileDropsContent, IEnergyConnected { // // public ConnectedBlocksChecker connectedcells; // public ItemStack[] circuits = new ItemStack[5]; @@ -490,4 +491,4 @@ // public int[] getDropSlots() { // return new int[0]; // } -//} +// } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java index f252afa132..4fdf9bb667 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java @@ -32,13 +32,20 @@ public class CreativeScanner extends GT_MetaTileEntity_Scanner { super(aID, aName, aNameRegional, aTier); } - public CreativeScanner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public CreativeScanner( + String aName, + int aTier, + String[] aDescription, + ITexture[][][] aTextures, + String aGUIName, + String aNEIName) { super(aName, aTier, aDescription, aTextures, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new CreativeScanner(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + return new CreativeScanner( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 394eecf9e7..cbfd68b39b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -22,6 +22,13 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTiered; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -45,6 +52,11 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import javax.annotation.Nullable; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -58,19 +70,6 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTiered; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBase { public static final HashMap staticColorMap = new HashMap<>(); @@ -102,27 +101,34 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa private static final int CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"ccccc", "ccccc", "ccccc", "ccccc", "ccccc"}, - {"ggggg", "gaaag", "gaaag", "gaaag", "ggggg"}, - {"ggggg", "gaaag", "gaaag", "gaaag", "ggggg"}, - {"cc~cc", "ccccc", "ccccc", "ccccc", "ccccc"}, - })) - .addElement('c', ofChain( - ofHatchAdder(GT_TileEntity_BioVat::addMaintenanceToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_BioVat::addOutputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_BioVat::addInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_BioVat::addRadiationInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_BioVat::addEnergyInputToMachineList, CASING_INDEX, 1), - onElementPass(e -> e.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)) - )) - .addElement('a', ofChain( - isAir(), - ofBlockAnyMeta(FluidLoader.bioFluidBlock) - )) - .addElement('g', ofGlassTiered((byte)1, (byte)127, (byte)0, (te, v) -> te.mGlassTier = v, te -> te.mGlassTier, 1)) - .build(); + private static final IStructureDefinition STRUCTURE_DEFINITION = + StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {"ccccc", "ccccc", "ccccc", "ccccc", "ccccc"}, + {"ggggg", "gaaag", "gaaag", "gaaag", "ggggg"}, + {"ggggg", "gaaag", "gaaag", "gaaag", "ggggg"}, + {"cc~cc", "ccccc", "ccccc", "ccccc", "ccccc"}, + })) + .addElement( + 'c', + ofChain( + ofHatchAdder(GT_TileEntity_BioVat::addMaintenanceToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addOutputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addRadiationInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addEnergyInputToMachineList, CASING_INDEX, 1), + onElementPass(e -> e.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement('a', ofChain(isAir(), ofBlockAnyMeta(FluidLoader.bioFluidBlock))) + .addElement( + 'g', + ofGlassTiered( + (byte) 1, + (byte) 127, + (byte) 0, + (te, v) -> te.mGlassTier = v, + te -> te.mGlassTier, + 1)) + .build(); @Override public IStructureDefinition getStructureDefinition() { @@ -137,25 +143,24 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt. - addMachineType("Bacterial Vat"). - addInfo("Controller block for the Bacterial Vat"). - addInfo("For maximum efficiency boost keep the Output Hatch always half filled!"). - addSeparator(). - beginStructureBlock(5, 4, 5, false). - addController("Front bottom center"). - addCasingInfo("Clean Stainless Steel Casings", 19). - addOtherStructurePart("Glass", "Hollow two middle layers", 2). - addStructureInfo("The glass can be any glass, i.e. Tinkers Construct Clear Glass"). - addStructureInfo("Some Recipes need more advanced Glass Types"). - addMaintenanceHatch("Any casing", 1). - addOtherStructurePart("Radio Hatch", "Any casing", 1). - addInputBus("Any casing", 1). - addOutputBus("Any casing", 1). - addInputHatch("Any casing", 1). - addOutputHatch("Any casing", 1). - addEnergyHatch("Any casing", 1). - toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + tt.addMachineType("Bacterial Vat") + .addInfo("Controller block for the Bacterial Vat") + .addInfo("For maximum efficiency boost keep the Output Hatch always half filled!") + .addSeparator() + .beginStructureBlock(5, 4, 5, false) + .addController("Front bottom center") + .addCasingInfo("Clean Stainless Steel Casings", 19) + .addOtherStructurePart("Glass", "Hollow two middle layers", 2) + .addStructureInfo("The glass can be any glass, i.e. Tinkers Construct Clear Glass") + .addStructureInfo("Some Recipes need more advanced Glass Types") + .addMaintenanceHatch("Any casing", 1) + .addOtherStructurePart("Radio Hatch", "Any casing", 1) + .addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1) + .addInputHatch("Any casing", 1) + .addOutputHatch("Any casing", 1) + .addEnergyHatch("Any casing", 1) + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -163,7 +168,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa int[] ret = new int[4]; ret[0] = aSpecialValue & 0xF; // = glass tier ret[1] = aSpecialValue >>> 4 & 0b11; // = special value - ret[2] = aSpecialValue >>> 6 & 0b1; //boolean exact svt | 1 = true | 0 = false + ret[2] = aSpecialValue >>> 6 & 0b1; // boolean exact svt | 1 = true | 0 = false ret[3] = aSpecialValue >>> 7 & Integer.MAX_VALUE; // = sievert return ret; } @@ -177,18 +182,22 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } private int getInputCapacity() { - return this.mInputHatches.stream().mapToInt(GT_MetaTileEntity_Hatch_Input::getCapacity).sum(); + return this.mInputHatches.stream() + .mapToInt(GT_MetaTileEntity_Hatch_Input::getCapacity) + .sum(); } private int getOutputCapacity() { - return this.mOutputHatches.stream().mapToInt(GT_MetaTileEntity_Hatch_Output::getCapacity).sum(); + return this.mOutputHatches.stream() + .mapToInt(GT_MetaTileEntity_Hatch_Output::getCapacity) + .sum(); } @Override public int getCapacity() { int ret = 0; ret += this.getInputCapacity(); - //ret += getOutputCapacity(); + // ret += getOutputCapacity(); return ret; } @@ -223,14 +232,13 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } private int calcMod(double x) { - double y = (((double) this.getOutputCapacity()) / 2D), - z = ConfigHandler.bioVatMaxParallelBonus; + double y = (((double) this.getOutputCapacity()) / 2D), z = ConfigHandler.bioVatMaxParallelBonus; int ret = MathUtils.ceilInt(((-1D / y * Math.pow((x - y), 2D) + y) / y * z)); return MathUtils.clamp(1, ret, ConfigHandler.bioVatMaxParallelBonus); } - private List getItemInputs(){ + private List getItemInputs() { ArrayList tInputList = this.getStoredInputs(); int tInputList_sS = tInputList.size(); for (int i = 0; i < tInputList_sS - 1; i++) { @@ -250,7 +258,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa return tInputList; } - private List getFluidInputs(){ + private List getFluidInputs() { ArrayList tFluidList = this.getStoredFluids(); int tFluidList_sS = tFluidList.size(); for (int i = 0; i < tFluidList_sS - 1; i++) { @@ -285,7 +293,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); long tEnergy = V[tTier]; - GT_Recipe gtRecipe = gtRecipeMap.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, tEnergy, tFluids, itemStack, tInputs); + GT_Recipe gtRecipe = gtRecipeMap.findRecipe( + this.getBaseMetaTileEntity(), this.mLastRecipe, false, tEnergy, tFluids, itemStack, tInputs); if (gtRecipe == null) return false; @@ -298,10 +307,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa this.mNeededSievert = conditions[3]; - if (conditions[2] == 0 ? - (this.mSievert < this.mNeededSievert || this.mGlassTier < conditions[0]) - : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0])) - return false; + if (conditions[2] == 0 + ? (this.mSievert < this.mNeededSievert || this.mGlassTier < conditions[0]) + : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0])) return false; this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; @@ -320,16 +328,15 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } } - this.mOutputFluids = new FluidStack[]{new FluidStack(recipeFluidOutput, recipeFluidOutput.amount * this.mTimes)}; + this.mOutputFluids = + new FluidStack[] {new FluidStack(recipeFluidOutput, recipeFluidOutput.amount * this.mTimes)}; BW_Util.calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, tEnergy, this); - if (this.mEUt > 0) - this.mEUt = -this.mEUt; + if (this.mEUt > 0) this.mEUt = -this.mEUt; this.mProgresstime = 0; - if (gtRecipe.mCanBeBuffered) - this.mLastRecipe = gtRecipe; + if (gtRecipe.mCanBeBuffered) this.mLastRecipe = gtRecipe; this.updateSlots(); return true; @@ -363,15 +370,14 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa this.mGlassTier = 0; this.mCasing = 0; - if(!checkPiece(STRUCTURE_PIECE_MAIN, 2, 3, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 3, 0)) return false; - return this.mCasing >= 19 && - this.mRadHatches.size() <= 1 && - this.mOutputHatches.size() == 1 && - this.mMaintenanceHatches.size() == 1 && - this.mInputHatches.size() > 0 && - this.mEnergyHatches.size() > 0; + return this.mCasing >= 19 + && this.mRadHatches.size() <= 1 + && this.mOutputHatches.size() == 1 + && this.mMaintenanceHatches.size() == 1 + && this.mInputHatches.size() > 0 + && this.mEnergyHatches.size() > 0; } @Override @@ -394,8 +400,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) { for (int x = -1; x < 2; x++) for (int y = 1; y < height; y++) - for (int z = -1; z < 2; z++) - this.sendPackagesOrRenewRenderer(x, y, z, this.mCulture); + for (int z = -1; z < 2; z++) this.sendPackagesOrRenewRenderer(x, y, z, this.mCulture); } } @@ -403,8 +408,18 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; - GT_TileEntity_BioVat.staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId)); - GT_TileEntity_BioVat.staticColorMap.put(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId), lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB()); + GT_TileEntity_BioVat.staticColorMap.remove(new Coords( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId)); + GT_TileEntity_BioVat.staticColorMap.put( + new Coords( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId), + lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB()); if (SideReference.Side.Server) { MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( @@ -414,14 +429,11 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId - ), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId), lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB(), - true - ), + true), this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getZCoord() - ); + this.getBaseMetaTileEntity().getZCoord()); MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( this.getBaseMetaTileEntity().getWorld(), new RendererPacket( @@ -429,14 +441,11 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId - ), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId), lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB(), - false - ), + false), this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getZCoord() - ); + this.getBaseMetaTileEntity().getZCoord()); } this.needsVisualUpdate = true; } @@ -450,8 +459,12 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa break; } EntityPlayerMP tPlayer = (EntityPlayerMP) tObject; - Chunk tChunk = aWorld.getChunkFromBlockCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord()); - if (tPlayer.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { + Chunk tChunk = aWorld.getChunkFromBlockCoords( + this.getBaseMetaTileEntity().getXCoord(), + this.getBaseMetaTileEntity().getZCoord()); + if (tPlayer.getServerForPlayer() + .getPlayerManager() + .isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { if (!this.playerMPHashSet.contains(tPlayer)) { this.playerMPHashSet.add(tPlayer); this.sendAllRequiredRendererPackets(); @@ -459,7 +472,6 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } else { this.playerMPHashSet.remove(tPlayer); } - } } } @@ -472,19 +484,41 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa for (int x = -1; x < 2; x++) { for (int y = 0; y < this.height; y++) { for (int z = -1; z < 2; z++) { - if (this.getBaseMetaTileEntity().getWorld().getBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()).equals(Blocks.air)) - this.getBaseMetaTileEntity().getWorld().setBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), FluidLoader.bioFluidBlock); + if (this.getBaseMetaTileEntity() + .getWorld() + .getBlock( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord()) + .equals(Blocks.air)) + this.getBaseMetaTileEntity() + .getWorld() + .setBlock( + xDir + + x + + this.getBaseMetaTileEntity() + .getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + + z + + this.getBaseMetaTileEntity() + .getZCoord(), + FluidLoader.bioFluidBlock); } } } } private int reCalculateFluidAmmount() { - return this.getStoredFluids().stream().mapToInt(fluidStack -> fluidStack.amount).sum(); + return this.getStoredFluids().stream() + .mapToInt(fluidStack -> fluidStack.amount) + .sum(); } private int reCalculateHeight() { - return (this.reCalculateFluidAmmount() > ((this.getCapacity() / 4) - 1) ? (this.reCalculateFluidAmmount() >= this.getCapacity() / 2 ? 3 : 2) : 1); + return (this.reCalculateFluidAmmount() > ((this.getCapacity() / 4) - 1) + ? (this.reCalculateFluidAmmount() >= this.getCapacity() / 2 ? 3 : 2) + : 1); } public void doAllVisualThings() { @@ -492,29 +526,59 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa if (this.mMachine) { ItemStack aStack = this.mInventory[1]; BioCulture lCulture = null; - int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; - int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; + int xDir = ForgeDirection.getOrientation( + this.getBaseMetaTileEntity().getBackFacing()) + .offsetX + * 2; + int zDir = ForgeDirection.getOrientation( + this.getBaseMetaTileEntity().getBackFacing()) + .offsetZ + * 2; if (this.getBaseMetaTileEntity().getTimer() % 200 == 0) { this.check_Chunk(); } - if (this.needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 0) { + if (this.needsVisualUpdate + && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 0) { for (int x = -1; x < 2; x++) for (int y = 1; y < 3; y++) for (int z = -1; z < 2; z++) - this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()); + this.getBaseMetaTileEntity() + .getWorld() + .setBlockToAir( + xDir + + x + + this.getBaseMetaTileEntity() + .getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + + z + + this.getBaseMetaTileEntity() + .getZCoord()); } this.height = this.reCalculateHeight(); if (this.mFluid != null && this.height > 1 && this.reCalculateFluidAmmount() > 0) { - if ((!(BW_Util.areStacksEqualOrNull(aStack, this.mStack))) || (this.needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1)) { + if ((!(BW_Util.areStacksEqualOrNull(aStack, this.mStack))) + || (this.needsVisualUpdate + && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER + == 1)) { for (int x = -1; x < 2; x++) { for (int y = 1; y < this.height; y++) { for (int z = -1; z < 2; z++) { - if (aStack == null || aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0) { - if (this.mCulture == null || aStack == null || aStack.getTagCompound() == null || this.mCulture.getID() != aStack.getTagCompound().getInteger("ID")) { - lCulture = aStack == null || aStack.getTagCompound() == null ? null : BioCulture.getBioCulture(aStack.getTagCompound().getString("Name")); + if (aStack == null + || aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0) { + if (this.mCulture == null + || aStack == null + || aStack.getTagCompound() == null + || this.mCulture.getID() + != aStack.getTagCompound() + .getInteger("ID")) { + lCulture = aStack == null || aStack.getTagCompound() == null + ? null + : BioCulture.getBioCulture(aStack.getTagCompound() + .getString("Name")); this.sendPackagesOrRenewRenderer(x, y, z, lCulture); } } @@ -524,9 +588,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa this.mStack = aStack; this.mCulture = lCulture; } - if (this.needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1) { - if (this.getBaseMetaTileEntity().isClientSide()) - new Throwable().printStackTrace(); + if (this.needsVisualUpdate + && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1) { + if (this.getBaseMetaTileEntity().isClientSide()) new Throwable().printStackTrace(); this.placeFluid(); this.needsVisualUpdate = false; } @@ -540,8 +604,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (this.height != this.reCalculateHeight()) - this.needsVisualUpdate = true; + if (this.height != this.reCalculateHeight()) this.needsVisualUpdate = true; this.doAllVisualThings(); if (this.getBaseMetaTileEntity().isServerSide() && this.mRadHatches.size() == 1) { this.mSievert = this.mRadHatches.get(0).getSievert(); @@ -561,13 +624,13 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa aNBT.setInteger("mFluidHeight", this.height); if (this.mCulture != null && !this.mCulture.getName().isEmpty()) aNBT.setString("mCulture", this.mCulture.getName()); - else if ((this.mCulture == null || this.mCulture.getName().isEmpty()) && !aNBT.getString("mCulture").isEmpty()) { + else if ((this.mCulture == null || this.mCulture.getName().isEmpty()) + && !aNBT.getString("mCulture").isEmpty()) { aNBT.removeTag("mCulture"); } - if (this.mFluid != null) - aNBT.setString("mFluid", this.mFluid.getName()); - aNBT.setInteger("mSievert",this.mSievert); - aNBT.setInteger("mNeededSievert",this.mNeededSievert); + if (this.mFluid != null) aNBT.setString("mFluid", this.mFluid.getName()); + aNBT.setInteger("mSievert", this.mSievert); + aNBT.setInteger("mNeededSievert", this.mNeededSievert); super.saveNBTData(aNBT); } @@ -578,25 +641,46 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa for (int x = -1; x < 2; x++) { for (int y = 1; y < 3; y++) { for (int z = -1; z < 2; z++) { - if (this.getBaseMetaTileEntity().getWorld().getBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()).equals(FluidLoader.bioFluidBlock)) - this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()); - GT_TileEntity_BioVat.staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()), this.getBaseMetaTileEntity().getWorld().provider.dimensionId); + if (this.getBaseMetaTileEntity() + .getWorld() + .getBlock( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord()) + .equals(FluidLoader.bioFluidBlock)) + this.getBaseMetaTileEntity() + .getWorld() + .setBlockToAir( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord()); + GT_TileEntity_BioVat.staticColorMap.remove( + new Coords( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord()), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId); if (SideReference.Side.Server) MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( this.getBaseMetaTileEntity().getWorld(), new RendererPacket( new Coords( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), + xDir + + x + + this.getBaseMetaTileEntity() + .getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId - ), - this.mCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : this.mCulture.getColorRGB(), - true - ), + zDir + + z + + this.getBaseMetaTileEntity() + .getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId), + this.mCulture == null + ? BioCulture.NULLCULTURE.getColorRGB() + : this.mCulture.getColorRGB(), + true), this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getZCoord() - ); + this.getBaseMetaTileEntity().getZCoord()); } } } @@ -607,8 +691,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa public void loadNBTData(NBTTagCompound aNBT) { this.height = aNBT.getInteger("mFluidHeight"); this.mCulture = BioCulture.getBioCulture(aNBT.getString("mCulture")); - if (!aNBT.getString("mFluid").isEmpty()) - this.mFluid = FluidRegistry.getFluid(aNBT.getString("mFluid")); + if (!aNBT.getString("mFluid").isEmpty()) this.mFluid = FluidRegistry.getFluid(aNBT.getString("mFluid")); this.mSievert = aNBT.getInteger("mSievert"); this.mNeededSievert = aNBT.getInteger("mNeededSievert"); super.loadNBTData(aNBT); @@ -625,19 +708,41 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } @Override @@ -650,10 +755,13 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa final String[] baseInfoData = super.getInfoData(); final String[] infoData = new String[baseInfoData.length + 2]; System.arraycopy(baseInfoData, 0, infoData, 0, baseInfoData.length); - infoData[infoData.length - 2] = StatCollector.translateToLocal("BW.infoData.BioVat.expectedProduction") + ": " + - EnumChatFormatting.GREEN + (mMaxProgresstime <= 0 ? getExpectedTimes(null, false) : mExpectedTimes) * 100 + EnumChatFormatting.RESET + " %"; - infoData[infoData.length - 1] = StatCollector.translateToLocal("BW.infoData.BioVat.production") + ": " + - EnumChatFormatting.GREEN + (mMaxProgresstime <= 0 ? 0 : mTimes) * 100 + EnumChatFormatting.RESET + " %"; + infoData[infoData.length - 2] = StatCollector.translateToLocal("BW.infoData.BioVat.expectedProduction") + ": " + + EnumChatFormatting.GREEN + + (mMaxProgresstime <= 0 ? getExpectedTimes(null, false) : mExpectedTimes) * 100 + + EnumChatFormatting.RESET + " %"; + infoData[infoData.length - 1] = + StatCollector.translateToLocal("BW.infoData.BioVat.production") + ": " + EnumChatFormatting.GREEN + + (mMaxProgresstime <= 0 ? 0 : mTimes) * 100 + EnumChatFormatting.RESET + " %"; return infoData; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 731599fed1..e3ab8def8e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -22,6 +22,14 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTieredMixed; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; + import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; @@ -45,90 +53,99 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTieredMixed; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; - -public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable { +public class GT_TileEntity_CircuitAssemblyLine + extends GT_MetaTileEntity_EnhancedMultiBlockBase + implements ISurvivalConstructable { private static final int CASING_INDEX = 16; private static final String STRUCTURE_PIECE_FIRST = "first"; private static final String STRUCTURE_PIECE_NEXT = "next"; - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_FIRST, transpose(new String[][] { - {"~", "G", "G"}, - {"g", "l", "g"}, - {"b", "i", "b"}, - })) - .addShape(STRUCTURE_PIECE_NEXT, transpose(new String[][] { - {"G", "G", "G"}, - {"g", "l", "g"}, - {"b", "I", "b"}, - })) - .addElement('G', buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) - .atLeast(Energy).casingIndex(CASING_INDEX).dot(1).buildAndChain(GregTech_API.sBlockCasings3, 10)) - .addElement('g', ofGlassTieredMixed((byte)4, (byte)127, 5)) - .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 5)) //assembling line casings - .addElement('b', buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) - .atLeast(InputHatch, Maintenance).casingIndex(CASING_INDEX).dot(2).buildAndChain(GregTech_API.sBlockCasings2, 0) - ) - .addElement('i', InputBus.newAny(CASING_INDEX, 3)) - .addElement('I', buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) - .atLeast(InputHatch, InputBus, OutputBus).casingIndex(CASING_INDEX).dot(2).buildAndChain(GregTech_API.sBlockCasings2, 0) - ) - .build(); + private static final IStructureDefinition STRUCTURE_DEFINITION = + StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_FIRST, transpose(new String[][] { + {"~", "G", "G"}, + {"g", "l", "g"}, + {"b", "i", "b"}, + })) + .addShape(STRUCTURE_PIECE_NEXT, transpose(new String[][] { + {"G", "G", "G"}, + {"g", "l", "g"}, + {"b", "I", "b"}, + })) + .addElement( + 'G', + buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) + .atLeast(Energy) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings3, 10)) + .addElement('g', ofGlassTieredMixed((byte) 4, (byte) 127, 5)) + .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 5)) // assembling line casings + .addElement( + 'b', + buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) + .atLeast(InputHatch, Maintenance) + .casingIndex(CASING_INDEX) + .dot(2) + .buildAndChain(GregTech_API.sBlockCasings2, 0)) + .addElement('i', InputBus.newAny(CASING_INDEX, 3)) + .addElement( + 'I', + buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) + .atLeast(InputHatch, InputBus, OutputBus) + .casingIndex(CASING_INDEX) + .dot(2) + .buildAndChain(GregTech_API.sBlockCasings2, 0)) + .build(); @Override - public IStructureDefinition getStructureDefinition() { return STRUCTURE_DEFINITION; } + public IStructureDefinition getStructureDefinition() { + return STRUCTURE_DEFINITION; + } protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt. - addMachineType("Circuit Assembler"). - addInfo("Controller block for the Circuit Assembly Line"). - addInfo("Imprint this machine with a Circuit Imprint,"). - addInfo("by putting the imprint in the controller"). - addInfo("Every Circuit Assembly Line can only be imprinted ONCE"). - addInfo("Does not lose efficiency when overclocked"). - addInfo(BW_Tooltip_Reference.TT_BLUEPRINT). - addSeparator(). - beginVariableStructureBlock(2, 7, 3, 3, 3, 3, false). - addStructureInfo("From Bottom to Top, Left to Right"). - addStructureInfo("Layer 1 - Solid Steel Machine Casing, Input bus (Last Output bus), Solid Steel Machine Casing"). - addStructureInfo("Layer 2 - EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass"). - addStructureInfo("Layer 3 - Grate Machine Casing"). - addStructureInfo("Up to 7 repeating slices, last is Output Bus"). - - addController("Layer 3 first slice front"). - addOtherStructurePart("1x " + StatCollector.translateToLocal("GT5U.MBTT.EnergyHatch"), "Any layer 3 casing", 1). - addInputHatch("Any layer 1 casing", 2). - addInputBus("As specified on layer 1", 3, 4). - addOutputBus("As specified in final slice on layer 1", 4). - addOtherStructurePart("EV+ Tier Glass", "As specified on layer 2", 5). - addMaintenanceHatch("Any layer 1 casing", 2). - toolTipFinisher(ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); + tt.addMachineType("Circuit Assembler") + .addInfo("Controller block for the Circuit Assembly Line") + .addInfo("Imprint this machine with a Circuit Imprint,") + .addInfo("by putting the imprint in the controller") + .addInfo("Every Circuit Assembly Line can only be imprinted ONCE") + .addInfo("Does not lose efficiency when overclocked") + .addInfo(BW_Tooltip_Reference.TT_BLUEPRINT) + .addSeparator() + .beginVariableStructureBlock(2, 7, 3, 3, 3, 3, false) + .addStructureInfo("From Bottom to Top, Left to Right") + .addStructureInfo( + "Layer 1 - Solid Steel Machine Casing, Input bus (Last Output bus), Solid Steel Machine Casing") + .addStructureInfo("Layer 2 - EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass") + .addStructureInfo("Layer 3 - Grate Machine Casing") + .addStructureInfo("Up to 7 repeating slices, last is Output Bus") + .addController("Layer 3 first slice front") + .addOtherStructurePart( + "1x " + StatCollector.translateToLocal("GT5U.MBTT.EnergyHatch"), "Any layer 3 casing", 1) + .addInputHatch("Any layer 1 casing", 2) + .addInputBus("As specified on layer 1", 3, 4) + .addOutputBus("As specified in final slice on layer 1", 4) + .addOtherStructurePart("EV+ Tier Glass", "As specified on layer 2", 5) + .addMaintenanceHatch("Any layer 1 casing", 2) + .toolTipFinisher(ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); return tt; } public String getTypeForDisplay() { - if (this.type.equals(new NBTTagCompound())) - return ""; - return GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); + if (this.type.equals(new NBTTagCompound())) return ""; + return GT_LanguageManager.getTranslation( + GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); } private NBTTagCompound type = new NBTTagCompound(); @@ -142,12 +159,13 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance super(aName); } - private boolean imprintMachine(ItemStack itemStack){ - if (!this.type.equals(new NBTTagCompound())) - return true; - if (!GT_Utility.isStackValid(itemStack)) - return false; - if (itemStack.getItem() instanceof BW_Meta_Items.BW_GT_MetaGenCircuits && itemStack.getItemDamage() == 0 && itemStack.getTagCompound() != null && this.type.equals(new NBTTagCompound())){ + private boolean imprintMachine(ItemStack itemStack) { + if (!this.type.equals(new NBTTagCompound())) return true; + if (!GT_Utility.isStackValid(itemStack)) return false; + if (itemStack.getItem() instanceof BW_Meta_Items.BW_GT_MetaGenCircuits + && itemStack.getItemDamage() == 0 + && itemStack.getTagCompound() != null + && this.type.equals(new NBTTagCompound())) { this.type = itemStack.getTagCompound(); this.mInventory[1] = null; this.getBaseMetaTileEntity().issueBlockUpdate(); @@ -177,15 +195,13 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance @Override public void setItemNBT(NBTTagCompound aNBT) { - if (!this.type.equals(new NBTTagCompound())) - aNBT.setTag("Type", this.type); + if (!this.type.equals(new NBTTagCompound())) aNBT.setTag("Type", this.type); super.saveNBTData(aNBT); } @Override public void saveNBTData(NBTTagCompound aNBT) { - if (!this.type.equals(new NBTTagCompound())) - aNBT.setTag("Type", this.type); + if (!this.type.equals(new NBTTagCompound())) aNBT.setTag("Type", this.type); super.saveNBTData(aNBT); } @@ -193,19 +209,21 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance @Override public boolean checkRecipe(ItemStack itemStack) { - if (this.type.equals(new NBTTagCompound())) - if (!this.imprintMachine(itemStack)) - return false; - - if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), getStoredInputs().toArray(new ItemStack[0]))) { + if (this.type.equals(new NBTTagCompound())) if (!this.imprintMachine(itemStack)) return false; + + if (this.bufferedRecipe != null + && this.bufferedRecipe.isRecipeInputEqual( + true, + false, + BW_Util.getFluidsFromInputHatches(this), + getStoredInputs().toArray(new ItemStack[0]))) { setRecipeStats(); return true; } ItemStack stack = ItemStack.loadItemStackFromNBT(this.type); - if (stack == null) - return false; + if (stack == null) return false; if (this.GT_RECIPE_COLLECTION.isEmpty()) { for (GT_Recipe recipe : BWRecipes.instance.getMappingsFor((byte) 3).mRecipeList) { @@ -216,10 +234,12 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance } for (GT_Recipe recipe : this.GT_RECIPE_COLLECTION) { - if (recipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), getStoredInputs().toArray(new ItemStack[0]))) - this.bufferedRecipe = recipe; - else - continue; + if (recipe.isRecipeInputEqual( + true, + false, + BW_Util.getFluidsFromInputHatches(this), + getStoredInputs().toArray(new ItemStack[0]))) this.bufferedRecipe = recipe; + else continue; this.setRecipeStats(); return true; @@ -228,9 +248,9 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance } private void setRecipeStats() { - calculatePerfectOverclockedNessMulti(this.bufferedRecipe.mEUt, this.bufferedRecipe.mDuration, 1, this.getMaxInputVoltage()); - if (this.mEUt > 0) - this.mEUt = -this.mEUt; + calculatePerfectOverclockedNessMulti( + this.bufferedRecipe.mEUt, this.bufferedRecipe.mDuration, 1, this.getMaxInputVoltage()); + if (this.mEUt > 0) this.mEUt = -this.mEUt; this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); @@ -264,13 +284,13 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - ((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity); + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap(); + return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - ((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = this.getRecipeMap(); + return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); } else { return false; } @@ -286,9 +306,9 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance if (aMetaTileEntity == null) { return false; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - ((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity); + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap(); + return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); } else { return false; } @@ -321,32 +341,56 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance } private String[] infoDataBuffer; + @Override public String[] getInfoData() { - if (infoDataBuffer != null) - return infoDataBuffer; + if (infoDataBuffer != null) return infoDataBuffer; String[] oldInfo = super.getInfoData(); - infoDataBuffer = new String[oldInfo.length+1]; - System.arraycopy(oldInfo,0,infoDataBuffer,0, oldInfo.length); - infoDataBuffer[oldInfo.length] = "Imprinted with: "+ GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); + infoDataBuffer = new String[oldInfo.length + 1]; + System.arraycopy(oldInfo, 0, infoDataBuffer, 0, oldInfo.length); + infoDataBuffer[oldInfo.length] = "Imprinted with: " + + GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName( + CircuitImprintLoader.getStackFromTag(this.type))); return infoDataBuffer; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { @@ -358,7 +402,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance } private boolean checkMachine(boolean leftToRight) { - for(int i = 1; i < 7; ++i) { + for (int i = 1; i < 7; ++i) { if (!this.checkPiece(STRUCTURE_PIECE_NEXT, leftToRight ? -i : i, 0, 0)) { return false; } @@ -375,7 +419,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance this.buildPiece(STRUCTURE_PIECE_FIRST, stackSize, hintsOnly, 0, 0, 0); int tLength = Math.min(stackSize.stackSize + 1, 7); - for(int i = 1; i < tLength; ++i) { + for (int i = 1; i < tLength; ++i) { this.buildPiece(STRUCTURE_PIECE_NEXT, stackSize, hintsOnly, -i, 0, 0); } } @@ -384,12 +428,14 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { if (mMachine) return -1; int built; - built = survivialBuildPiece(STRUCTURE_PIECE_FIRST, stackSize, 0, 0, 0, elementBudget, source, actor, false, true); + built = survivialBuildPiece( + STRUCTURE_PIECE_FIRST, stackSize, 0, 0, 0, elementBudget, source, actor, false, true); if (built >= 0) return built; int tLength = Math.min(stackSize.stackSize + 1, 7); for (int i = 1; i < tLength; ++i) { - built = survivialBuildPiece(STRUCTURE_PIECE_NEXT, stackSize, -i, 0, 0, elementBudget, source, actor, false, true); + built = survivialBuildPiece( + STRUCTURE_PIECE_NEXT, stackSize, -i, 0, 0, elementBudget, source, actor, false, true); if (built >= 0) return built; } return -1; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java index c1c7cc0d29..268a26686d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java @@ -29,11 +29,10 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DistillationTower; +import java.util.ArrayList; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; - public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_DistillationTower { public GT_TileEntity_CrackingDistillTower(int aID, String aName, String aNameRegional) { @@ -46,8 +45,7 @@ public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_Distil @Override public boolean checkRecipe(ItemStack itemStack) { - if (!GT_Utility.areStacksEqual(itemStack, GT_Utility.getIntegratedCircuit(0), true)) - return false; + if (!GT_Utility.areStacksEqual(itemStack, GT_Utility.getIntegratedCircuit(0), true)) return false; else { FluidStack[] array = new FluidStack[0]; ArrayList fluidInputs = new ArrayList<>(); @@ -59,25 +57,35 @@ public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_Distil array = fluidInputs.toArray(array); GT_Recipe.GT_Recipe_Map rMapCracking = GT_Recipe.GT_Recipe_Map.sCrakingRecipes; GT_Recipe.GT_Recipe_Map rMapDistillTower = GT_Recipe.GT_Recipe_Map.sDistillationRecipes; - GT_Recipe recipeCracking = rMapCracking.findRecipe(this.getBaseMetaTileEntity(), false, this.getMaxInputVoltage(), array, itemStack); - if (recipeCracking == null) - return false; - GT_Recipe recipeDistill = rMapDistillTower.findRecipe(this.getBaseMetaTileEntity(), false, this.getMaxInputVoltage(), recipeCracking.mFluidOutputs); - if (recipeDistill == null) - return false; + GT_Recipe recipeCracking = rMapCracking.findRecipe( + this.getBaseMetaTileEntity(), false, this.getMaxInputVoltage(), array, itemStack); + if (recipeCracking == null) return false; + GT_Recipe recipeDistill = rMapDistillTower.findRecipe( + this.getBaseMetaTileEntity(), false, this.getMaxInputVoltage(), recipeCracking.mFluidOutputs); + if (recipeDistill == null) return false; float ratio = (float) recipeCracking.mFluidOutputs[0].amount / (float) recipeDistill.mFluidInputs[0].amount; FluidStack[] nuoutputs = new FluidStack[recipeDistill.mFluidOutputs.length]; for (int i = 0; i < nuoutputs.length; i++) { nuoutputs[i] = recipeDistill.mFluidOutputs[i]; nuoutputs[i].amount = MathUtils.floorInt(recipeDistill.mFluidOutputs[i].amount * ratio); } - BWRecipes.DynamicGTRecipe combined = new BWRecipes.DynamicGTRecipe(true, null, recipeDistill.mOutputs, null, recipeDistill.mChances, recipeCracking.mFluidInputs, nuoutputs, (MathUtils.floorInt(recipeDistill.mDuration * ratio)) + recipeCracking.mDuration, Math.max((MathUtils.floorInt(recipeDistill.mEUt * ratio)), recipeCracking.mEUt), 0); + BWRecipes.DynamicGTRecipe combined = new BWRecipes.DynamicGTRecipe( + true, + null, + recipeDistill.mOutputs, + null, + recipeDistill.mChances, + recipeCracking.mFluidInputs, + nuoutputs, + (MathUtils.floorInt(recipeDistill.mDuration * ratio)) + recipeCracking.mDuration, + Math.max((MathUtils.floorInt(recipeDistill.mEUt * ratio)), recipeCracking.mEUt), + 0); if (combined.isRecipeInputEqual(true, array)) { this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - BW_Util.calculateOverclockedNessMulti(combined.mEUt, combined.mDuration, 1, this.getMaxInputVoltage(), this); - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) - return false; + BW_Util.calculateOverclockedNessMulti( + combined.mEUt, combined.mDuration, 1, this.getMaxInputVoltage(), this); + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { this.mEUt = (-this.mEUt); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index f472ec766e..d19bd42924 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; +import static gregtech.api.enums.GT_Values.VN; + import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -36,6 +39,8 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; import ic2.core.block.reactor.tileentity.TileEntityNuclearReactorElectric; +import java.lang.reflect.Field; +import java.util.Arrays; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -43,12 +48,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; -import java.lang.reflect.Field; -import java.util.Arrays; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; -import static gregtech.api.enums.GT_Values.VN; - public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { private static float nulearHeatMod = 2f; private byte mMode; @@ -72,7 +71,12 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { Field f = c.getDeclaredField("huOutputModifier"); f.setAccessible(true); GT_TileEntity_DEHP.nulearHeatMod = f.getFloat(f); - } catch (SecurityException | IllegalArgumentException | ExceptionInInitializerError | NullPointerException | IllegalAccessException | NoSuchFieldException e) { + } catch (SecurityException + | IllegalArgumentException + | ExceptionInInitializerError + | NullPointerException + | IllegalAccessException + | NoSuchFieldException e) { e.printStackTrace(); } super.onConfigLoad(aConfig); @@ -99,7 +103,8 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "DrillingRig.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "DrillingRig.png"); } @Override @@ -112,13 +117,16 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { if (ConfigHandler.DEHPDirectSteam) { tt.addInfo("0 Idle, 1 Steam, 2 Superheated Steam (requires Distilled Water), 3 Retract") .addInfo("Explodes when it runs out of Water/Distilled Water") - .addInfo("Converts " + (long) (this.mTier * 1200 * 20) + "L/s Water(minus 10% per Maintenance Problem) to Steam") - .addInfo("Converts " + (long) (this.mTier * 600 * 20) + "L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"); + .addInfo("Converts " + (long) (this.mTier * 1200 * 20) + + "L/s Water(minus 10% per Maintenance Problem) to Steam") + .addInfo("Converts " + (long) (this.mTier * 600 * 20) + + "L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"); } else { tt.addInfo("0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract") .addInfo("Explodes when it runs out of Coolant") - .addInfo("Heats up " + (long) (this.mTier * 24 * ((double) GT_TileEntity_DEHP.nulearHeatMod)) * 20 + "L/s Coolant(minus 10% per Maintenance Problem)"); + .addInfo("Heats up " + (long) (this.mTier * 24 * ((double) GT_TileEntity_DEHP.nulearHeatMod)) * 20 + + "L/s Coolant(minus 10% per Maintenance Problem)"); } tt.addSeparator() .beginStructureBlock(3, 7, 3, false) @@ -163,8 +171,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { private long getFluidFromHatches(Fluid f) { long ret = 0; for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { - if (ih.getFluid().getFluid().equals(f)) - ret += ih.getFluidAmount(); + if (ih.getFluid().getFluid().equals(f)) ret += ih.getFluidAmount(); } return ret; } @@ -172,18 +179,18 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { private long getWaterFromHatches(boolean onlyDistilled) { Fluid toConsume1 = FluidRegistry.WATER; Fluid toConsume2 = GT_ModHandler.getDistilledWater(1L).getFluid(); - if (onlyDistilled) - toConsume1 = toConsume2; + if (onlyDistilled) toConsume1 = toConsume2; long ret = 0; for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { - if (ih.getFluid().getFluid().equals(toConsume1) || ih.getFluid().getFluid().equals(toConsume2)) - ret += ih.getFluidAmount(); + if (ih.getFluid().getFluid().equals(toConsume1) + || ih.getFluid().getFluid().equals(toConsume2)) ret += ih.getFluidAmount(); } return ret; } @Override - protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + protected boolean workingUpward( + ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { if (this.mMode != 3) { this.isPickingPipes = false; try { @@ -198,16 +205,15 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (this.getBaseMetaTileEntity().getWorld().isRemote) - return; + if (this.getBaseMetaTileEntity().getWorld().isRemote) return; ++this.mMode; - if (this.mMode >= 4) - this.mMode = 0; + if (this.mMode >= 4) this.mMode = 0; GT_Utility.sendChatToPlayer(aPlayer, "Mode: " + this.mMode); super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); } - protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + protected boolean workingDownward( + ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { if (this.mMode == 3) { this.isPickingPipes = true; try { @@ -222,8 +228,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { if (this.waitForPipes()) { return false; } else { - if (this.mMode == 0) - this.mMode = 1; + if (this.mMode == 0) this.mMode = 1; if (ConfigHandler.DEHPDirectSteam) { if (this.mMode == 1) { long steamProduced = (this.mTier * 600 * 2L * this.mEfficiency / 10000L); @@ -250,7 +255,11 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { } } else { if (this.mMode == 1 || this.mMode == 2) { - long coolantConverted = (long) (this.mTier * 24 * ((double) GT_TileEntity_DEHP.nulearHeatMod) * this.mEfficiency / 10000L); + long coolantConverted = (long) (this.mTier + * 24 + * ((double) GT_TileEntity_DEHP.nulearHeatMod) + * this.mEfficiency + / 10000L); if (this.getFluidFromHatches(FluidRegistry.getFluid("ic2coolant")) - coolantConverted > 0) { this.consumeFluid(FluidRegistry.getFluid("ic2coolant"), coolantConverted); this.addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", (int) coolantConverted)); @@ -273,23 +282,29 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { Arrays.fill(tmp, (int) (ammount / Integer.MAX_VALUE)); for (int i = 0; i < tmp.length; i++) { for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { - if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid().getFluid().equals(fluid) || ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) : ih.getFluid().getFluid().equals(fluid)) - tmp[i] -= ih.drain((int) ammount, true).amount; - if (tmp[i] <= 0) - break; + if (fluid.equals(FluidRegistry.WATER) + ? ih.getFluid().getFluid().equals(fluid) + || ih.getFluid() + .getFluid() + .equals(GT_ModHandler.getDistilledWater(1) + .getFluid()) + : ih.getFluid().getFluid().equals(fluid)) tmp[i] -= ih.drain((int) ammount, true).amount; + if (tmp[i] <= 0) break; } } return tmp[tmp.length - 1] <= 0; - } long tmp = ammount; for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { - if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid().getFluid().equals(fluid) || ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) : ih.getFluid().getFluid().equals(fluid)) - tmp -= ih.drain((int) ammount, true).amount; - if (tmp <= 0) - return true; + if (fluid.equals(FluidRegistry.WATER) + ? ih.getFluid().getFluid().equals(fluid) + || ih.getFluid() + .getFluid() + .equals(GT_ModHandler.getDistilledWater(1).getFluid()) + : ih.getFluid().getFluid().equals(fluid)) tmp -= ih.drain((int) ammount, true).amount; + if (tmp <= 0) return true; } return false; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 7eeb3767d2..2f937f1c2d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -22,6 +22,13 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; @@ -40,22 +47,15 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; - -import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - -public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity_EnhancedMultiBlockBase { +public class GT_TileEntity_ElectricImplosionCompressor + extends GT_MetaTileEntity_EnhancedMultiBlockBase { public static GT_Recipe.GT_Recipe_Map eicMap; private static final boolean pistonEnabled = !ConfigHandler.disablePistonInEIC; @@ -73,61 +73,86 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity private static final int CASING_INDEX = 16; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"ccc", "cec", "ccc"}, - {"ttt", "tft", "ttt"}, - {"ttt", "tft", "ttt"}, - {"nnn", "nnn", "nnn"}, - {"nNn", "NNN", "nNn"}, - {"nnn", "nnn", "nnn"}, - {"t~t", "tft", "ttt"}, - {"ttt", "tft", "ttt"}, - {"CCC", "CeC", "CCC"}, - })) - .addElement('c', ofChain( - ofBlock(GregTech_API.sBlockCasings2, 0), - ofBlock(GregTech_API.sBlockCasings3, 4) - )) - .addElement('t', ofBlock(BW_BLOCKS[2], 1)) - .addElement('f', ofBlock(BW_BLOCKS[2], 0)) - .addElement('n', ofBlock(GregTech_API.sBlockMetal5, 2)) - .addElement('C', ofChain( - ofHatchAdder(GT_TileEntity_ElectricImplosionCompressor::addInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_ElectricImplosionCompressor::addOutputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_ElectricImplosionCompressor::addMaintenanceToMachineList, CASING_INDEX, 1), - ofBlock(GregTech_API.sBlockCasings2, 0), - ofBlock(GregTech_API.sBlockCasings3, 4) - )) - .addElement('e', ofHatchAdder(GT_TileEntity_ElectricImplosionCompressor::addEnergyInputToMachineList, CASING_INDEX, 2)) - .addElement('N', new IStructureElement(){ - - @Override - public boolean check(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z) { - if(!te.piston && !world.isAirBlock(x, y, z)) - return false; - if(te.piston && !(world.getBlock(x, y, z) == GregTech_API.sBlockMetal5 && world.getBlockMetadata(x, y, z) == 2)) - return false; - return true; - } - - @Override - public boolean spawnHint(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z, ItemStack itemStack) { - if(te.piston) - StructureLibAPI.hintParticle(world, x, y, z, GregTech_API.sBlockMetal5, 2); - return true; - } - - @Override - public boolean placeBlock(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z, ItemStack itemStack) { - if(te.piston) - world.setBlock(x, y, z, GregTech_API.sBlockMetal5, 2, 3); - else - world.setBlockToAir(x, y, z); - return true; - } - }) - .build(); + private static final IStructureDefinition STRUCTURE_DEFINITION = + StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {"ccc", "cec", "ccc"}, + {"ttt", "tft", "ttt"}, + {"ttt", "tft", "ttt"}, + {"nnn", "nnn", "nnn"}, + {"nNn", "NNN", "nNn"}, + {"nnn", "nnn", "nnn"}, + {"t~t", "tft", "ttt"}, + {"ttt", "tft", "ttt"}, + {"CCC", "CeC", "CCC"}, + })) + .addElement( + 'c', + ofChain(ofBlock(GregTech_API.sBlockCasings2, 0), ofBlock(GregTech_API.sBlockCasings3, 4))) + .addElement('t', ofBlock(BW_BLOCKS[2], 1)) + .addElement('f', ofBlock(BW_BLOCKS[2], 0)) + .addElement('n', ofBlock(GregTech_API.sBlockMetal5, 2)) + .addElement( + 'C', + ofChain( + ofHatchAdder( + GT_TileEntity_ElectricImplosionCompressor::addInputToMachineList, + CASING_INDEX, + 1), + ofHatchAdder( + GT_TileEntity_ElectricImplosionCompressor::addOutputToMachineList, + CASING_INDEX, + 1), + ofHatchAdder( + GT_TileEntity_ElectricImplosionCompressor::addMaintenanceToMachineList, + CASING_INDEX, + 1), + ofBlock(GregTech_API.sBlockCasings2, 0), + ofBlock(GregTech_API.sBlockCasings3, 4))) + .addElement( + 'e', + ofHatchAdder( + GT_TileEntity_ElectricImplosionCompressor::addEnergyInputToMachineList, + CASING_INDEX, + 2)) + .addElement('N', new IStructureElement() { + + @Override + public boolean check( + GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z) { + if (!te.piston && !world.isAirBlock(x, y, z)) return false; + if (te.piston + && !(world.getBlock(x, y, z) == GregTech_API.sBlockMetal5 + && world.getBlockMetadata(x, y, z) == 2)) return false; + return true; + } + + @Override + public boolean spawnHint( + GT_TileEntity_ElectricImplosionCompressor te, + World world, + int x, + int y, + int z, + ItemStack itemStack) { + if (te.piston) StructureLibAPI.hintParticle(world, x, y, z, GregTech_API.sBlockMetal5, 2); + return true; + } + + @Override + public boolean placeBlock( + GT_TileEntity_ElectricImplosionCompressor te, + World world, + int x, + int y, + int z, + ItemStack itemStack) { + if (te.piston) world.setBlock(x, y, z, GregTech_API.sBlockMetal5, 2, 3); + else world.setBlockToAir(x, y, z); + return true; + } + }) + .build(); @Override public IStructureDefinition getStructureDefinition() { @@ -142,37 +167,36 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt. - addMachineType("Implosion Compressor"). - addInfo("Explosions are fun"). - addInfo("Controller block for the Electric Implosion Compressor"). - addInfo("Uses electricity instead of Explosives"). - addSeparator(). - beginStructureBlock(3, 9, 3, false). - addController("Front 3rd layer center"). - addCasingInfo("Solid Steel Machine Casing", 8). - addStructureInfo("Casings can be replaced with Explosion Warning Signs"). - addOtherStructurePart("Transformer-Winding Blocks", "Outer layer 2,3,7,8"). - addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Inner layer 2,3,7,8"). - addOtherStructurePart("Neutronium Blocks", "Layer 4,5,6"). - addMaintenanceHatch("Any bottom casing", 1). - addInputBus("Any bottom casing", 1). - addInputHatch("Any bottom casing", 1). - addOutputBus("Any bottom casing", 1). - addMaintenanceHatch("Any bottom casing", 1). - addEnergyHatch("Bottom and top middle", 2). - toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + tt.addMachineType("Implosion Compressor") + .addInfo("Explosions are fun") + .addInfo("Controller block for the Electric Implosion Compressor") + .addInfo("Uses electricity instead of Explosives") + .addSeparator() + .beginStructureBlock(3, 9, 3, false) + .addController("Front 3rd layer center") + .addCasingInfo("Solid Steel Machine Casing", 8) + .addStructureInfo("Casings can be replaced with Explosion Warning Signs") + .addOtherStructurePart("Transformer-Winding Blocks", "Outer layer 2,3,7,8") + .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Inner layer 2,3,7,8") + .addOtherStructurePart("Neutronium Blocks", "Layer 4,5,6") + .addMaintenanceHatch("Any bottom casing", 1) + .addInputBus("Any bottom casing", 1) + .addInputHatch("Any bottom casing", 1) + .addOutputBus("Any bottom casing", 1) + .addMaintenanceHatch("Any bottom casing", 1) + .addEnergyHatch("Bottom and top middle", 2) + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @Override public boolean checkRecipe(ItemStack aStack) { - if (this.mEnergyHatches.get(0).getEUVar() <= 0 || this.mEnergyHatches.get(1).getEUVar() <= 0) - return false; + if (this.mEnergyHatches.get(0).getEUVar() <= 0 + || this.mEnergyHatches.get(1).getEUVar() <= 0) return false; ItemStack[] tItemInputs = getCompactedInputs(); - FluidStack[] tFluidInputs = getCompactedFluids(); + FluidStack[] tFluidInputs = getCompactedFluids(); long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); @@ -183,9 +207,8 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; this.mEfficiencyIncrease = 10000; calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; + // In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { this.mEUt = -this.mEUt; } @@ -198,14 +221,14 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity return false; } - private void updateChunkCoordinates(){ + private void updateChunkCoordinates() { chunkCoordinates.clear(); - for(int x = -1; x <= 1; x++) - for(int z = -1; z <= 1; z++) { + for (int x = -1; x <= 1; x++) + for (int z = -1; z <= 1; z++) { if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) { - int[] abc = new int[]{x, -2, z + 1}; - int[] xyz = new int[]{0, 0, 0}; + int[] abc = new int[] {x, -2, z + 1}; + int[] xyz = new int[] {0, 0, 0}; this.getExtendedFacing().getWorldOffset(abc, xyz); xyz[0] += this.getBaseMetaTileEntity().getXCoord(); xyz[1] += this.getBaseMetaTileEntity().getYCoord(); @@ -225,8 +248,9 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity public boolean drainEnergyInput(long aEU) { if (aEU <= 0) return true; GT_MetaTileEntity_Hatch_Energy h1 = this.mEnergyHatches.get(0), h2 = this.mEnergyHatches.get(1); - if(!isValidMetaTileEntity(h1) || !isValidMetaTileEntity(h2)) return false; - if(!h1.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU/2, false) || !h2.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU/2, false)) return false; + if (!isValidMetaTileEntity(h1) || !isValidMetaTileEntity(h2)) return false; + if (!h1.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU / 2, false) + || !h2.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU / 2, false)) return false; return true; } @@ -251,29 +275,26 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } public void stopMachine() { - if (pistonEnabled) - this.resetPiston(); + if (pistonEnabled) this.resetPiston(); super.stopMachine(); } private void resetPiston() { IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); - if (!aBaseMetaTileEntity.isServerSide()) - return; + if (!aBaseMetaTileEntity.isServerSide()) return; if (!this.piston && this.mMachine) { - chunkCoordinates.forEach(c -> aBaseMetaTileEntity.getWorld().setBlock(c.posX, c.posY, c.posZ, GregTech_API.sBlockMetal5, 2, 3)); + chunkCoordinates.forEach(c -> + aBaseMetaTileEntity.getWorld().setBlock(c.posX, c.posY, c.posZ, GregTech_API.sBlockMetal5, 2, 3)); this.piston = !this.piston; } } private void togglePiston(IGregTechTileEntity aBaseMetaTileEntity) { - if (aBaseMetaTileEntity.getWorld().isRemote) - return; + if (aBaseMetaTileEntity.getWorld().isRemote) return; if (this.piston) { - for(ChunkCoordinates c : chunkCoordinates) - { - if(aBaseMetaTileEntity.getBlock(c.posX, c.posY, c.posZ) != GregTech_API.sBlockMetal5 || aBaseMetaTileEntity.getMetaID(c.posX, c.posY, c.posZ) != 2) - { + for (ChunkCoordinates c : chunkCoordinates) { + if (aBaseMetaTileEntity.getBlock(c.posX, c.posY, c.posZ) != GregTech_API.sBlockMetal5 + || aBaseMetaTileEntity.getMetaID(c.posX, c.posY, c.posZ) != 2) { this.explodeMultiblock(); return; } @@ -281,9 +302,17 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } } else { - chunkCoordinates.forEach(c -> aBaseMetaTileEntity.getWorld().setBlock(c.posX, c.posY, c.posZ, GregTech_API.sBlockMetal5, 2, 3)); - if(!getBaseMetaTileEntity().hasMufflerUpgrade()) - GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(), sound, 1f, 1f, chunkCoordinates.get(0).posX, chunkCoordinates.get(0).posY, chunkCoordinates.get(0).posZ); + chunkCoordinates.forEach(c -> + aBaseMetaTileEntity.getWorld().setBlock(c.posX, c.posY, c.posZ, GregTech_API.sBlockMetal5, 2, 3)); + if (!getBaseMetaTileEntity().hasMufflerUpgrade()) + GT_Utility.sendSoundToPlayers( + aBaseMetaTileEntity.getWorld(), + sound, + 1f, + 1f, + chunkCoordinates.get(0).posX, + chunkCoordinates.get(0).posY, + chunkCoordinates.get(0).posZ); } this.piston = !this.piston; } @@ -297,13 +326,12 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - if(aNBT.hasKey("piston")) this.piston = aNBT.getBoolean("piston"); + if (aNBT.hasKey("piston")) this.piston = aNBT.getBoolean("piston"); } @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - if(!checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0)) return false; return this.mMaintenanceHatches.size() == 1 && this.mEnergyHatches.size() == 2; } @@ -312,7 +340,6 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity return 10000; } - @Override public int getPollutionPerTick(ItemStack itemStack) { return 0; @@ -333,19 +360,41 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity return new GT_TileEntity_ElectricImplosionCompressor(this.mName); } - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index ffe6e4b0c4..0f8dca5a33 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -17,6 +17,11 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_VIA_BARTWORKS; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.client.renderer.BW_CropVisualizer; @@ -45,6 +50,7 @@ import ic2.api.crops.CropCard; import ic2.api.crops.Crops; import ic2.core.Ic2Items; import ic2.core.crop.TileEntityCrop; +import java.util.*; import net.minecraft.block.Block; import net.minecraft.block.BlockStem; import net.minecraft.client.Minecraft; @@ -66,14 +72,8 @@ import net.minecraftforge.common.IPlantable; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.util.*; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_VIA_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - -public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity_EnhancedMultiBlockBase { +public class GT_TileEntity_ExtremeIndustrialGreenhouse + extends GT_MetaTileEntity_EnhancedMultiBlockBase { private static final boolean debug = false; @@ -86,29 +86,63 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity private static final int CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; private static final Item forestryfertilizer = GameRegistry.findItem("Forestry", "fertilizerCompound"); - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { - {"ccccc", "ccccc", "ccccc", "ccccc", "ccccc"}, - {"ccccc", "clllc", "clllc", "clllc", "ccccc"}, - {"ggggg", "g---g", "g---g", "g---g", "ggggg"}, - {"ggggg", "g---g", "g---g", "g---g", "ggggg"}, - {"ccccc", "cdddc", "cdwdc", "cdddc", "ccccc"}, - {"cc~cc", "cCCCc", "cCCCc", "cCCCc", "ccccc"}, - })) - .addElement('c', ofChain( - onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)), - ofHatchAdder(GT_TileEntity_ExtremeIndustrialGreenhouse::addEnergyInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_ExtremeIndustrialGreenhouse::addMaintenanceToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_ExtremeIndustrialGreenhouse::addInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_ExtremeIndustrialGreenhouse::addOutputToMachineList, CASING_INDEX, 1) - )) - .addElement('C', onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1))) - .addElement('l', LoaderReference.ProjRedIllumination ? ofBlock(Block.getBlockFromName("ProjRed|Illumination:projectred.illumination.lamp"), 10) : ofBlock(Blocks.redstone_lamp, 0)) - .addElement('g', debug ? ofBlock(Blocks.glass, 0) : BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) - .addElement('d', ofBlock(LoaderReference.RandomThings ? Block.getBlockFromName("RandomThings:fertilizedDirt_tilled") : Blocks.farmland, 0)) - .addElement('w', ofBlock(Blocks.water, 0)) - .build(); - + private static final IStructureDefinition STRUCTURE_DEFINITION = + StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {"ccccc", "ccccc", "ccccc", "ccccc", "ccccc"}, + {"ccccc", "clllc", "clllc", "clllc", "ccccc"}, + {"ggggg", "g---g", "g---g", "g---g", "ggggg"}, + {"ggggg", "g---g", "g---g", "g---g", "ggggg"}, + {"ccccc", "cdddc", "cdwdc", "cdddc", "ccccc"}, + {"cc~cc", "cCCCc", "cCCCc", "cCCCc", "ccccc"}, + })) + .addElement( + 'c', + ofChain( + onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)), + ofHatchAdder( + GT_TileEntity_ExtremeIndustrialGreenhouse::addEnergyInputToMachineList, + CASING_INDEX, + 1), + ofHatchAdder( + GT_TileEntity_ExtremeIndustrialGreenhouse::addMaintenanceToMachineList, + CASING_INDEX, + 1), + ofHatchAdder( + GT_TileEntity_ExtremeIndustrialGreenhouse::addInputToMachineList, + CASING_INDEX, + 1), + ofHatchAdder( + GT_TileEntity_ExtremeIndustrialGreenhouse::addOutputToMachineList, + CASING_INDEX, + 1))) + .addElement('C', onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1))) + .addElement( + 'l', + LoaderReference.ProjRedIllumination + ? ofBlock( + Block.getBlockFromName("ProjRed|Illumination:projectred.illumination.lamp"), + 10) + : ofBlock(Blocks.redstone_lamp, 0)) + .addElement( + 'g', + debug + ? ofBlock(Blocks.glass, 0) + : BorosilicateGlass.ofBoroGlass( + (byte) 0, + (byte) 1, + Byte.MAX_VALUE, + (te, t) -> te.glasTier = t, + te -> te.glasTier)) + .addElement( + 'd', + ofBlock( + LoaderReference.RandomThings + ? Block.getBlockFromName("RandomThings:fertilizedDirt_tilled") + : Blocks.farmland, + 0)) + .addElement('w', ofBlock(Blocks.water, 0)) + .build(); public GT_TileEntity_ExtremeIndustrialGreenhouse(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -120,31 +154,30 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if(aPlayer.isSneaking()) - { - if(this.mMaxProgresstime > 0) - { + if (aPlayer.isSneaking()) { + if (this.mMaxProgresstime > 0) { GT_Utility.sendChatToPlayer(aPlayer, "You cant change IC2 mode if the machine is working!"); return; } - if(!mStorage.isEmpty()) - { + if (!mStorage.isEmpty()) { GT_Utility.sendChatToPlayer(aPlayer, "You cant change IC2 mode if there are seeds inside!"); return; } this.isIC2Mode = !this.isIC2Mode; GT_Utility.sendChatToPlayer(aPlayer, "IC2 mode is now " + (this.isIC2Mode ? "enabled" : "disabled.")); - } - else { - if(this.mMaxProgresstime > 0) - { + } else { + if (this.mMaxProgresstime > 0) { GT_Utility.sendChatToPlayer(aPlayer, "You cant enable/disable setup if the machine is working!"); return; } this.setupphase++; - if(this.setupphase == 3) - this.setupphase = 0; - GT_Utility.sendChatToPlayer(aPlayer, "EIG is now running in " + (this.setupphase == 1 ? "setup mode (input)." : ( this.setupphase == 2 ? "setup mode (output)." : "normal operation."))); + if (this.setupphase == 3) this.setupphase = 0; + GT_Utility.sendChatToPlayer( + aPlayer, + "EIG is now running in " + + (this.setupphase == 1 + ? "setup mode (input)." + : (this.setupphase == 2 ? "setup mode (output)." : "normal operation."))); } } @@ -163,61 +196,60 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && f.isNotFlipped(); } - private static String tierString(int tier){ + private static String tierString(int tier) { return GT_Values.TIER_COLORS[tier] + GT_Values.VN[tier] + ChatColorHelper.RESET + ChatColorHelper.GRAY; } @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt. - addMachineType("Crop Farm"). - addInfo("Controller block for the Extreme Industrial Greenhouse"). - addInfo("Grow your crops like a chad !"). - addInfo("Use screwdriver to enable/change/disable setup mode"). - addInfo("Use screwdriver while sneaking to enable/disable IC2 mode"). - addInfo("Uses 1000L of water per crop per operation"). - addInfo("You can insert fertilizer each operation to get more drops (max +400%)"). - addInfo("-------------------- SETUP MODE --------------------"). - addInfo("Does not take power"). - addInfo("There are two modes: input / output"). - addInfo("Input mode: machine will take seeds from input bus and plant them"). - addInfo("[IC2] You need to also input block that is required under the crop"). - addInfo("Output mode: machine will take planted seeds and output them"). - addInfo("-------------------- NORMAL CROPS --------------------"). - addInfo("Minimal tier: " + tierString(4)). - addInfo("Starting with 1 slot"). - addInfo("Every slot gives 64 crops"). - addInfo("Every tier past " + tierString(4) + ", slots are multiplied by 2"). - addInfo("Base process time: 5 sec"). - addInfo("Process time is divided by number of tiers past " + tierString(3) + " (Minimum 1 sec)"). - addInfo("All crops are grown at the end of the operation"). - addInfo("Will automatically craft seeds if they are not dropped"). - addInfo("1 Fertilizer per 1 crop +200%"). - addInfo("-------------------- IC2 CROPS --------------------"). - addInfo("Minimal tier: " + tierString(6)). - addInfo("Need " + tierString(6) + " glass tier"). - addInfo("Starting with 4 slots"). - addInfo("Every slot gives 1 crop"). - addInfo("Every tier past " + tierString(6) + ", slots are multiplied by 4"). - addInfo("Process time: 5 sec"). - addInfo("All crops are accelerated by x32 times"). - addInfo("1 Fertilizer per 1 crop +10%"). - addInfo(BW_Tooltip_Reference.TT_BLUEPRINT). - addSeparator(). - beginStructureBlock(5, 4, 5, false). - addController("Front bottom center"). - addCasingInfo("Clean Stainless Steel Casings", 70). - addOtherStructurePart("Borosilicate Glass", "Hollow two middle layers", 2). - addStructureInfo("The glass tier limits the Energy Input tier"). - addStructureInfo("The dirt is from RandomThings, must be tilled"). - addStructureInfo("Purple lamps are from ProjectRedIllumination. They can be lit"). - addMaintenanceHatch("Any casing (Except inner bottom ones)", 1). - addInputBus("Any casing (Except inner bottom ones)", 1). - addOutputBus("Any casing (Except inner bottom ones)", 1). - addInputHatch("Any casing (Except inner bottom ones)", 1). - addEnergyHatch("Any casing (Except inner bottom ones)", 1). - toolTipFinisher(MULTIBLOCK_ADDED_VIA_BARTWORKS.apply(ChatColorHelper.GOLD + "kuba6000")); + tt.addMachineType("Crop Farm") + .addInfo("Controller block for the Extreme Industrial Greenhouse") + .addInfo("Grow your crops like a chad !") + .addInfo("Use screwdriver to enable/change/disable setup mode") + .addInfo("Use screwdriver while sneaking to enable/disable IC2 mode") + .addInfo("Uses 1000L of water per crop per operation") + .addInfo("You can insert fertilizer each operation to get more drops (max +400%)") + .addInfo("-------------------- SETUP MODE --------------------") + .addInfo("Does not take power") + .addInfo("There are two modes: input / output") + .addInfo("Input mode: machine will take seeds from input bus and plant them") + .addInfo("[IC2] You need to also input block that is required under the crop") + .addInfo("Output mode: machine will take planted seeds and output them") + .addInfo("-------------------- NORMAL CROPS --------------------") + .addInfo("Minimal tier: " + tierString(4)) + .addInfo("Starting with 1 slot") + .addInfo("Every slot gives 64 crops") + .addInfo("Every tier past " + tierString(4) + ", slots are multiplied by 2") + .addInfo("Base process time: 5 sec") + .addInfo("Process time is divided by number of tiers past " + tierString(3) + " (Minimum 1 sec)") + .addInfo("All crops are grown at the end of the operation") + .addInfo("Will automatically craft seeds if they are not dropped") + .addInfo("1 Fertilizer per 1 crop +200%") + .addInfo("-------------------- IC2 CROPS --------------------") + .addInfo("Minimal tier: " + tierString(6)) + .addInfo("Need " + tierString(6) + " glass tier") + .addInfo("Starting with 4 slots") + .addInfo("Every slot gives 1 crop") + .addInfo("Every tier past " + tierString(6) + ", slots are multiplied by 4") + .addInfo("Process time: 5 sec") + .addInfo("All crops are accelerated by x32 times") + .addInfo("1 Fertilizer per 1 crop +10%") + .addInfo(BW_Tooltip_Reference.TT_BLUEPRINT) + .addSeparator() + .beginStructureBlock(5, 4, 5, false) + .addController("Front bottom center") + .addCasingInfo("Clean Stainless Steel Casings", 70) + .addOtherStructurePart("Borosilicate Glass", "Hollow two middle layers", 2) + .addStructureInfo("The glass tier limits the Energy Input tier") + .addStructureInfo("The dirt is from RandomThings, must be tilled") + .addStructureInfo("Purple lamps are from ProjectRedIllumination. They can be lit") + .addMaintenanceHatch("Any casing (Except inner bottom ones)", 1) + .addInputBus("Any casing (Except inner bottom ones)", 1) + .addOutputBus("Any casing (Except inner bottom ones)", 1) + .addInputHatch("Any casing (Except inner bottom ones)", 1) + .addEnergyHatch("Any casing (Except inner bottom ones)", 1) + .toolTipFinisher(MULTIBLOCK_ADDED_VIA_BARTWORKS.apply(ChatColorHelper.GOLD + "kuba6000")); return tt; } @@ -226,7 +258,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity List info = new ArrayList<>(Arrays.asList(super.getStructureDescription(stackSize))); info.add("The dirt is from RandomThings, must be tilled"); info.add("Purple lamps are from ProjectRedIllumination. They can be lit"); - return info.toArray(new String[]{}); + return info.toArray(new String[] {}); } @Override @@ -236,7 +268,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity aNBT.setInteger("setupphase", setupphase); aNBT.setBoolean("isIC2Mode", isIC2Mode); aNBT.setInteger("mStorageSize", mStorage.size()); - for(int i = 0; i < mStorage.size(); i++) + for (int i = 0; i < mStorage.size(); i++) aNBT.setTag("mStorage." + i, mStorage.get(i).toNBTTagCompound()); } @@ -246,12 +278,12 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity glasTier = aNBT.getByte("glasTier"); setupphase = aNBT.getInteger("setupphase"); isIC2Mode = aNBT.getBoolean("isIC2Mode"); - for(int i = 0; i < aNBT.getInteger("mStorageSize"); i++) + for (int i = 0; i < aNBT.getInteger("mStorageSize"); i++) mStorage.add(new GreenHouseSlot(aNBT.getCompoundTag("mStorage." + i))); } @SideOnly(Side.CLIENT) - public void spawnVisualCrop(World world, int x, int y, int z, int meta, int age){ + public void spawnVisualCrop(World world, int x, int y, int z, int meta, int age) { BW_CropVisualizer crop = new BW_CropVisualizer(world, x, y, z, meta, age); Minecraft.getMinecraft().effectRenderer.addEffect(crop); } @@ -259,36 +291,35 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if(aBaseMetaTileEntity.isClientSide()) - { - if(aBaseMetaTileEntity.isActive() && aTick % 40 == 0) { - for(int x = -1; x <= 1; x++) - for(int z = -1; z <= 1; z++) { - if(x == 0 && z == 0) - continue; - int[] abc = new int[]{x, -2, z+2}; - int[] xyz = new int[]{0, 0, 0}; + if (aBaseMetaTileEntity.isClientSide()) { + if (aBaseMetaTileEntity.isActive() && aTick % 40 == 0) { + for (int x = -1; x <= 1; x++) + for (int z = -1; z <= 1; z++) { + if (x == 0 && z == 0) continue; + int[] abc = new int[] {x, -2, z + 2}; + int[] xyz = new int[] {0, 0, 0}; this.getExtendedFacing().getWorldOffset(abc, xyz); xyz[0] += aBaseMetaTileEntity.getXCoord(); xyz[1] += aBaseMetaTileEntity.getYCoord(); xyz[2] += aBaseMetaTileEntity.getZCoord(); - spawnVisualCrop(aBaseMetaTileEntity.getWorld(), xyz[0], xyz[1], xyz[2], aBaseMetaTileEntity.getRandomNumber(8), 40); + spawnVisualCrop( + aBaseMetaTileEntity.getWorld(), + xyz[0], + xyz[1], + xyz[2], + aBaseMetaTileEntity.getRandomNumber(8), + 40); } } } - if(aBaseMetaTileEntity.isServerSide() && this.mMaxProgresstime > 0 && setupphase > 0 && aTick % 5 == 0) - { - if(setupphase == 1 && mStorage.size() < mMaxSlots) { + if (aBaseMetaTileEntity.isServerSide() && this.mMaxProgresstime > 0 && setupphase > 0 && aTick % 5 == 0) { + if (setupphase == 1 && mStorage.size() < mMaxSlots) { List inputs = getStoredInputs(); - for (ItemStack input : inputs) - if (addCrop(input)) - break; + for (ItemStack input : inputs) if (addCrop(input)) break; this.updateSlots(); - } - else if(setupphase == 2 && mStorage.size() > 0) - { + } else if (setupphase == 2 && mStorage.size() > 0) { this.addOutput(this.mStorage.get(0).input.copy()); - if(this.mStorage.get(0).undercrop != null) + if (this.mStorage.get(0).undercrop != null) this.addOutput(this.mStorage.get(0).undercrop.copy()); this.mStorage.remove(0); this.updateSlots(); @@ -306,16 +337,12 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity return true; } - private void updateMaxSlots() - { + private void updateMaxSlots() { long v = this.getMaxInputVoltage(); int tier = GT_Utility.getTier(v); - if(tier < (isIC2Mode ? 6 : 4)) - mMaxSlots = 0; - else if(isIC2Mode) - mMaxSlots = 4 << (2 * (tier - 6)); - else - mMaxSlots = 1 << (tier - 4); + if (tier < (isIC2Mode ? 6 : 4)) mMaxSlots = 0; + else if (isIC2Mode) mMaxSlots = 4 << (2 * (tier - 6)); + else mMaxSlots = 1 << (tier - 4); } @Override @@ -323,8 +350,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity long v = this.getMaxInputVoltage(); int tier = GT_Utility.getTier(v); updateMaxSlots(); - if(setupphase > 0) { - if((mStorage.size() >= mMaxSlots && setupphase == 1) || (mStorage.size() == 0 && setupphase == 2)) + if (setupphase > 0) { + if ((mStorage.size() >= mMaxSlots && setupphase == 1) || (mStorage.size() == 0 && setupphase == 2)) return false; this.mMaxProgresstime = 20; this.mEUt = 0; @@ -332,65 +359,56 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity this.mEfficiencyIncrease = 10000; return true; } - if(mStorage.size() > mMaxSlots) - return false; - if(mStorage.isEmpty()) - return false; + if (mStorage.size() > mMaxSlots) return false; + if (mStorage.isEmpty()) return false; waterusage = 0; - for(GreenHouseSlot s : mStorage) - waterusage += s.input.stackSize; + for (GreenHouseSlot s : mStorage) waterusage += s.input.stackSize; - if(!depleteInput(new FluidStack(FluidRegistry.WATER, waterusage * 1000)) && !debug) - return false; + if (!depleteInput(new FluidStack(FluidRegistry.WATER, waterusage * 1000)) && !debug) return false; // OVERCLOCK - // FERTILIZER IDEA - IC2 +10% per fertilizer per crop per operation, NORMAL +200% per fertilizer per crop per operation + // FERTILIZER IDEA - IC2 +10% per fertilizer per crop per operation, NORMAL +200% per fertilizer per crop per + // operation int boost = 0; int maxboost = 0; - for(GreenHouseSlot s : mStorage) - maxboost += s.input.stackSize * (isIC2Mode ? 40 : 2); + for (GreenHouseSlot s : mStorage) maxboost += s.input.stackSize * (isIC2Mode ? 40 : 2); ArrayList inputs = getStoredInputs(); - for(ItemStack i : inputs){ - if(( i.getItem() == Items.dye && i.getItemDamage() == 15) || - (forestryfertilizer != null && (i.getItem() == forestryfertilizer)) || - (GT_Utility.areStacksEqual(i, Ic2Items.fertilizer))) - { + for (ItemStack i : inputs) { + if ((i.getItem() == Items.dye && i.getItemDamage() == 15) + || (forestryfertilizer != null && (i.getItem() == forestryfertilizer)) + || (GT_Utility.areStacksEqual(i, Ic2Items.fertilizer))) { int used = Math.min(i.stackSize, maxboost - boost); i.stackSize -= used; boost += used; } - if(boost == maxboost) - break; + if (boost == maxboost) break; } - double multiplier = 1.d + (((double)boost/(double)maxboost) * 4d); + double multiplier = 1.d + (((double) boost / (double) maxboost) * 4d); - if(isIC2Mode) - { - if(glasTier < 6) - return false; + if (isIC2Mode) { + if (glasTier < 6) return false; this.mMaxProgresstime = 100; List outputs = new ArrayList<>(); for (int i = 0; i < Math.min(mMaxSlots, mStorage.size()); i++) - outputs.addAll(mStorage.get(i).getIC2Drops(((double)this.mMaxProgresstime / 8d) * multiplier)); + outputs.addAll(mStorage.get(i).getIC2Drops(((double) this.mMaxProgresstime / 8d) * multiplier)); this.mOutputItems = outputs.toArray(new ItemStack[0]); - } - else { + } else { this.mMaxProgresstime = Math.max(20, 100 / (tier - 3)); // Min 1 s List outputs = new ArrayList<>(); for (int i = 0; i < Math.min(mMaxSlots, mStorage.size()); i++) { for (ItemStack drop : mStorage.get(i).getDrops()) { ItemStack s = drop.copy(); - s.stackSize = (int)((double)s.stackSize * multiplier); + s.stackSize = (int) ((double) s.stackSize * multiplier); outputs.add(s); } } this.mOutputItems = outputs.toArray(new ItemStack[0]); } - this.mEUt = -(int)((double) GT_Values.V[tier] * 0.99d); + this.mEUt = -(int) ((double) GT_Values.V[tier] * 0.99d); this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; this.updateSlots(); @@ -401,23 +419,17 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { mCasing = 0; glasTier = 0; - if(debug) - glasTier = 8; + if (debug) glasTier = 8; - if(!checkPiece(STRUCTURE_PIECE_MAIN, 2, 5, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 5, 0)) return false; if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) - if (this.glasTier < hatchEnergy.mTier) - return false; + if (this.glasTier < hatchEnergy.mTier) return false; - boolean valid = this.mMaintenanceHatches.size() == 1 && - this.mEnergyHatches.size() >= 1 && - this.mCasing >= 70; + boolean valid = this.mMaintenanceHatches.size() == 1 && this.mEnergyHatches.size() >= 1 && this.mCasing >= 70; - if(valid) - updateMaxSlots(); + if (valid) updateMaxSlots(); return valid; } @@ -440,62 +452,87 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity @Override public String[] getInfoData() { List info = new ArrayList<>(Arrays.asList( - "Running in mode: " + EnumChatFormatting.GREEN + (setupphase == 0 ? (isIC2Mode ? "IC2 crops" : "Normal crops") : ("Setup mode " + (setupphase == 1 ? "(input)" : "(output)"))) + EnumChatFormatting.RESET, - "Uses " + waterusage * 1000 + "L/operation of water", - "Max slots: " + EnumChatFormatting.GREEN + this.mMaxSlots + EnumChatFormatting.RESET, - "Used slots: " + ((mStorage.size() > mMaxSlots) ? EnumChatFormatting.RED : EnumChatFormatting.GREEN) + this.mStorage.size() + EnumChatFormatting.RESET - )); - for(int i = 0; i < mStorage.size(); i++) { - if(!mStorage.get(i).isValid) - continue; - StringBuilder a = new StringBuilder("Slot " + i + ": " + EnumChatFormatting.GREEN + "x" + this.mStorage.get(i).input.stackSize + " " + this.mStorage.get(i).input.getDisplayName()); - if(this.isIC2Mode) { + "Running in mode: " + EnumChatFormatting.GREEN + + (setupphase == 0 + ? (isIC2Mode ? "IC2 crops" : "Normal crops") + : ("Setup mode " + (setupphase == 1 ? "(input)" : "(output)"))) + + EnumChatFormatting.RESET, + "Uses " + waterusage * 1000 + "L/operation of water", + "Max slots: " + EnumChatFormatting.GREEN + this.mMaxSlots + EnumChatFormatting.RESET, + "Used slots: " + ((mStorage.size() > mMaxSlots) ? EnumChatFormatting.RED : EnumChatFormatting.GREEN) + + this.mStorage.size() + EnumChatFormatting.RESET)); + for (int i = 0; i < mStorage.size(); i++) { + if (!mStorage.get(i).isValid) continue; + StringBuilder a = new StringBuilder( + "Slot " + i + ": " + EnumChatFormatting.GREEN + "x" + this.mStorage.get(i).input.stackSize + " " + + this.mStorage.get(i).input.getDisplayName()); + if (this.isIC2Mode) { a.append(" : "); - for (Map.Entry entry : mStorage.get(i).dropprogress.entrySet()) + for (Map.Entry entry : + mStorage.get(i).dropprogress.entrySet()) a.append((int) (entry.getValue() * 100d)).append("% "); } a.append(EnumChatFormatting.RESET); info.add(a.toString()); } - if(mStorage.size() > mMaxSlots) - info.add(EnumChatFormatting.DARK_RED + "There are too many crops inside to run !" + EnumChatFormatting.RESET); + if (mStorage.size() > mMaxSlots) + info.add(EnumChatFormatting.DARK_RED + "There are too many crops inside to run !" + + EnumChatFormatting.RESET); info.addAll(Arrays.asList(super.getInfoData())); return info.toArray(new String[0]); } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } public List mStorage = new ArrayList<>(); - public boolean addCrop(ItemStack input){ - if(!isIC2Mode) - for(GreenHouseSlot g : mStorage) - if(GT_Utility.areStacksEqual(g.input, input)) - { + public boolean addCrop(ItemStack input) { + if (!isIC2Mode) + for (GreenHouseSlot g : mStorage) + if (GT_Utility.areStacksEqual(g.input, input)) { g.addAll(this.getBaseMetaTileEntity().getWorld(), input); - if(input.stackSize == 0) - return true; + if (input.stackSize == 0) return true; } GreenHouseSlot h = new GreenHouseSlot(this, input.copy(), true, isIC2Mode); - if(h.isValid) { - if(isIC2Mode) - input.stackSize--; - else - input.stackSize = 0; + if (h.isValid) { + if (isIC2Mode) input.stackSize--; + else input.stackSize = 0; mStorage.add(h); return true; } @@ -523,69 +560,66 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity static GreenHouseWorld fakeworld = new GreenHouseWorld(5, 5, 5); - public NBTTagCompound toNBTTagCompound(){ + public NBTTagCompound toNBTTagCompound() { NBTTagCompound aNBT = new NBTTagCompound(); aNBT.setTag("input", input.writeToNBT(new NBTTagCompound())); aNBT.setBoolean("isValid", isValid); aNBT.setBoolean("isIC2Crop", isIC2Crop); - if(!isIC2Crop) { + if (!isIC2Crop) { aNBT.setInteger("crop", Block.getIdFromBlock(crop)); aNBT.setInteger("dropscount", drops.size()); for (int i = 0; i < drops.size(); i++) aNBT.setTag("drop." + i, drops.get(i).writeToNBT(new NBTTagCompound())); aNBT.setInteger("optimalgrowth", optimalgrowth); aNBT.setBoolean("needsreplanting", needsreplanting); - } - else { - if(undercrop != null) - aNBT.setTag("undercrop", undercrop.writeToNBT(new NBTTagCompound())); + } else { + if (undercrop != null) aNBT.setTag("undercrop", undercrop.writeToNBT(new NBTTagCompound())); aNBT.setInteger("generationscount", generations.size()); - for(int i = 0; i < generations.size(); i++) - { - aNBT.setInteger("generation." + i + ".count", generations.get(i).size()); - for(int j = 0; j < generations.get(i).size(); j++) - aNBT.setTag("generation." + i + "." + j, generations.get(i).get(j).writeToNBT(new NBTTagCompound())); + for (int i = 0; i < generations.size(); i++) { + aNBT.setInteger( + "generation." + i + ".count", generations.get(i).size()); + for (int j = 0; j < generations.get(i).size(); j++) + aNBT.setTag( + "generation." + i + "." + j, + generations.get(i).get(j).writeToNBT(new NBTTagCompound())); } aNBT.setInteger("growthticks", growthticks); } return aNBT; } - public GreenHouseSlot(NBTTagCompound aNBT){ + public GreenHouseSlot(NBTTagCompound aNBT) { super(null, 3, 3); isIC2Crop = aNBT.getBoolean("isIC2Crop"); isValid = aNBT.getBoolean("isValid"); input = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("input")); - if(!isIC2Crop) { + if (!isIC2Crop) { crop = Block.getBlockById(aNBT.getInteger("crop")); drops = new ArrayList<>(); for (int i = 0; i < aNBT.getInteger("dropscount"); i++) drops.add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("drop." + i))); optimalgrowth = aNBT.getInteger("optimalgrowth"); - if(optimalgrowth == 0) optimalgrowth = 7; - if(aNBT.hasKey("needsreplanting")) needsreplanting = aNBT.getBoolean("needsreplanting"); - } - else - { - if(aNBT.hasKey("undercrop")) + if (optimalgrowth == 0) optimalgrowth = 7; + if (aNBT.hasKey("needsreplanting")) needsreplanting = aNBT.getBoolean("needsreplanting"); + } else { + if (aNBT.hasKey("undercrop")) undercrop = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("undercrop")); generations = new ArrayList<>(); - for(int i = 0; i < aNBT.getInteger("generationscount"); i++) - { + for (int i = 0; i < aNBT.getInteger("generationscount"); i++) { generations.add(new ArrayList<>()); - for(int j = 0; j < aNBT.getInteger("generation." + i + ".count"); j++) - generations.get(i).add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("generation." + i + "." + j))); + for (int j = 0; j < aNBT.getInteger("generation." + i + ".count"); j++) + generations + .get(i) + .add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("generation." + i + "." + j))); } growthticks = aNBT.getInteger("growthticks"); rn = new Random(); } } - public boolean addAll(World world, ItemStack input){ - if(!GT_Utility.areStacksEqual(this.input, input)) - return false; - if(this.input.stackSize == 64) - return false; + public boolean addAll(World world, ItemStack input) { + if (!GT_Utility.areStacksEqual(this.input, input)) return false; + if (this.input.stackSize == 64) return false; int toconsume = Math.min(64 - this.input.stackSize, input.stackSize); int left = addDrops(world, toconsume, true); input.stackSize -= toconsume - left; @@ -593,17 +627,20 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity return left == 0; } - public boolean findCropRecipe(World world){ - if(recipe != null) - return true; - out : for (ItemStack drop : drops) { + public boolean findCropRecipe(World world) { + if (recipe != null) return true; + out: + for (ItemStack drop : drops) { recipeInput = drop; - for (int j = 0; j < CraftingManager.getInstance().getRecipeList().size(); j++) { - recipe = (IRecipe) CraftingManager.getInstance().getRecipeList().get(j); - if (recipe.matches(this, world) && GT_Utility.areStacksEqual(recipe.getCraftingResult(this), input)) { + for (int j = 0; + j < CraftingManager.getInstance().getRecipeList().size(); + j++) { + recipe = (IRecipe) + CraftingManager.getInstance().getRecipeList().get(j); + if (recipe.matches(this, world) + && GT_Utility.areStacksEqual(recipe.getCraftingResult(this), input)) { break out; - } else - recipe = null; + } else recipe = null; } } return recipe != null; @@ -611,8 +648,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity @Override public ItemStack getStackInSlot(int p_70301_1_) { - if(p_70301_1_ == 0) - return recipeInput.copy(); + if (p_70301_1_ == 0) return recipeInput.copy(); return null; } @@ -622,8 +658,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity } @Override - public ItemStack decrStackSize(int par1, int par2) - { + public ItemStack decrStackSize(int par1, int par2) { return null; } @@ -632,65 +667,55 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity return; } - public GreenHouseSlot(GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, ItemStack input, boolean autocraft, boolean IC2){ + public GreenHouseSlot( + GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, ItemStack input, boolean autocraft, boolean IC2) { super(null, 3, 3); World world = tileEntity.getBaseMetaTileEntity().getWorld(); this.input = input.copy(); this.isValid = false; - if(IC2) - { + if (IC2) { GreenHouseSlotIC2(tileEntity, world, input); return; } Item i = input.getItem(); Block b = null; - if(i instanceof IPlantable) { - if (i instanceof ItemSeeds) - b = ((ItemSeeds) i).getPlant(world, 0, 0, 0); - else if (i instanceof ItemSeedFood) - b = ((ItemSeedFood) i).getPlant(world, 0, 0, 0); - } - else { - if(i == Items.reeds) - b = Blocks.reeds; + if (i instanceof IPlantable) { + if (i instanceof ItemSeeds) b = ((ItemSeeds) i).getPlant(world, 0, 0, 0); + else if (i instanceof ItemSeedFood) b = ((ItemSeedFood) i).getPlant(world, 0, 0, 0); + } else { + if (i == Items.reeds) b = Blocks.reeds; else { b = Block.getBlockFromItem(i); - if(!(b == Blocks.cactus)) - return; + if (!(b == Blocks.cactus)) return; } needsreplanting = false; } - if (!(b instanceof IPlantable)) - return; + if (!(b instanceof IPlantable)) return; GameRegistry.UniqueIdentifier u = GameRegistry.findUniqueIdentifierFor(i); - if(u != null && Objects.equals(u.modId, "Natura")) - optimalgrowth = 8; + if (u != null && Objects.equals(u.modId, "Natura")) optimalgrowth = 8; - if(b instanceof BlockStem){ + if (b instanceof BlockStem) { fakeworld.block = null; try { b.updateTick(fakeworld, 5, 5, 5, fakeworld.rand); - } - catch(Exception e) - { + } catch (Exception e) { e.printStackTrace(System.err); } - if(fakeworld.block == null) - return; + if (fakeworld.block == null) return; b = fakeworld.block; needsreplanting = false; } crop = b; isIC2Crop = false; - if(addDrops(world, input.stackSize, autocraft) == 0 && !drops.isEmpty()){ + if (addDrops(world, input.stackSize, autocraft) == 0 && !drops.isEmpty()) { this.isValid = true; } } - public void GreenHouseSlotIC2(GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, World world, ItemStack input){ - if(!ItemList.IC2_Crop_Seeds.isStackEqual(input, true, true)) - return; + public void GreenHouseSlotIC2( + GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, World world, ItemStack input) { + if (!ItemList.IC2_Crop_Seeds.isStackEqual(input, true, true)) return; CropCard cc = Crops.instance.getCropCard(input); this.input.stackSize = 1; NBTTagCompound nbt = input.getTagCompound(); @@ -698,16 +723,16 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity byte ga = nbt.getByte("gain"); byte re = nbt.getByte("resistance"); this.isIC2Crop = true; - int[] abc = new int[]{0, -2, 3}; - int[] xyz = new int[]{0, 0, 0}; + int[] abc = new int[] {0, -2, 3}; + int[] xyz = new int[] {0, 0, 0}; tileEntity.getExtendedFacing().getWorldOffset(abc, xyz); xyz[0] += tileEntity.getBaseMetaTileEntity().getXCoord(); xyz[1] += tileEntity.getBaseMetaTileEntity().getYCoord(); xyz[2] += tileEntity.getBaseMetaTileEntity().getZCoord(); boolean cheating = false; - try{ - if(world.getBlock(xyz[0], xyz[1] - 2, xyz[2]) != GregTech_API.sBlockCasings4 || world.getBlockMetadata(xyz[0], xyz[1] - 2, xyz[2]) != 1) - { + try { + if (world.getBlock(xyz[0], xyz[1] - 2, xyz[2]) != GregTech_API.sBlockCasings4 + || world.getBlockMetadata(xyz[0], xyz[1] - 2, xyz[2]) != 1) { // no cheating = true; return; @@ -715,12 +740,11 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity world.setBlock(xyz[0], xyz[1], xyz[2], Block.getBlockFromItem(Ic2Items.crop.getItem()), 0, 0); TileEntity wte = world.getTileEntity(xyz[0], xyz[1], xyz[2]); - if(!(wte instanceof TileEntityCrop)) - { + if (!(wte instanceof TileEntityCrop)) { // should not be even possible return; } - TileEntityCrop te = (TileEntityCrop)wte; + TileEntityCrop te = (TileEntityCrop) wte; te.ticker = 1; // dont even think about ticking once te.setCrop(cc); @@ -731,20 +755,16 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity ItemStack tobeused = null; te.setSize((byte) (cc.maxSize() - 1)); - if(!cc.canGrow(te)) - { + if (!cc.canGrow(te)) { // needs special block boolean cangrow = false; ArrayList inputs = tileEntity.getStoredInputs(); - for(ItemStack a : inputs) - { + for (ItemStack a : inputs) { Block b = Block.getBlockFromItem(a.getItem()); - if(b == Blocks.air) - continue; + if (b == Blocks.air) continue; world.setBlock(xyz[0], xyz[1] - 2, xyz[2], b, a.getItemDamage(), 0); - if(!cc.canGrow(te)) - continue; + if (!cc.canGrow(te)) continue; cangrow = true; undercrop = a.copy(); undercrop.stackSize = 1; @@ -752,142 +772,116 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity break; } - if(!cangrow) - return; + if (!cangrow) return; } te.setSize((byte) cc.maxSize()); - if(!cc.canBeHarvested(te)) - return; + if (!cc.canBeHarvested(te)) return; // GENERATE DROPS generations = new ArrayList<>(); - out: for(int i = 0; i < 10; i++) // get 10 generations + out: + for (int i = 0; i < 10; i++) // get 10 generations { ItemStack[] st = te.harvest_automated(false); te.setSize((byte) cc.maxSize()); - if (st == null) - continue; - if (st.length == 0) - continue; - for(ItemStack s : st) - if(s == null) - continue out; + if (st == null) continue; + if (st.length == 0) continue; + for (ItemStack s : st) if (s == null) continue out; generations.add(new ArrayList<>(Arrays.asList(st))); } - if(generations.isEmpty()) - return; + if (generations.isEmpty()) return; rn = new Random(); - // CHECK GROWTH SPEED - te.humidity = 12; // humidity with full water storage - te.airQuality = 6; // air quality when sky is seen - te.nutrients = 8; // netrients with full nutrient storage + te.humidity = 12; // humidity with full water storage + te.airQuality = 6; // air quality when sky is seen + te.nutrients = 8; // netrients with full nutrient storage int dur = cc.growthDuration(te); int rate = te.calcGrowthRate(); - if(rate == 0) // should not be possible with those stats - return; + if (rate == 0) // should not be possible with those stats + return; growthticks = dur / rate; - if(growthticks < 1) - growthticks = 1; + if (growthticks < 1) growthticks = 1; - input.stackSize --; - if(tobeused != null) - tobeused.stackSize --; + input.stackSize--; + if (tobeused != null) tobeused.stackSize--; this.isValid = true; - } - catch (Exception e){ + } catch (Exception e) { e.printStackTrace(System.err); - } - finally { - if(!cheating) - world.setBlock(xyz[0], xyz[1] - 2, xyz[2], GregTech_API.sBlockCasings4, 1, 0); + } finally { + if (!cheating) world.setBlock(xyz[0], xyz[1] - 2, xyz[2], GregTech_API.sBlockCasings4, 1, 0); world.setBlockToAir(xyz[0], xyz[1], xyz[2]); } } - public List getDrops(){ + public List getDrops() { return drops; } Map dropprogress = new HashMap<>(); static Map dropstacks = new HashMap<>(); - public List getIC2Drops(double timeelapsed){ + public List getIC2Drops(double timeelapsed) { int r = rn.nextInt(10); - if(generations.size() <= r) - return new ArrayList<>(); - double growthPercent = (timeelapsed / (double)growthticks); + if (generations.size() <= r) return new ArrayList<>(); + double growthPercent = (timeelapsed / (double) growthticks); List generation = generations.get(r); List copied = new ArrayList<>(); - for(ItemStack g : generation) - copied.add(g.copy()); - for(ItemStack s : copied) - { - double pro = ((double)s.stackSize * growthPercent); + for (ItemStack g : generation) copied.add(g.copy()); + for (ItemStack s : copied) { + double pro = ((double) s.stackSize * growthPercent); s.stackSize = 1; - if(dropprogress.containsKey(s.toString())) + if (dropprogress.containsKey(s.toString())) dropprogress.put(s.toString(), dropprogress.get(s.toString()) + pro); - else - dropprogress.put(s.toString(), pro); - if(!dropstacks.containsKey(s.toString())) - dropstacks.put(s.toString(), s.copy()); + else dropprogress.put(s.toString(), pro); + if (!dropstacks.containsKey(s.toString())) dropstacks.put(s.toString(), s.copy()); } copied.clear(); - for(Map.Entry entry : dropprogress.entrySet()) - if(entry.getValue() >= 1d) - { + for (Map.Entry entry : dropprogress.entrySet()) + if (entry.getValue() >= 1d) { copied.add(dropstacks.get(entry.getKey()).copy()); - copied.get(copied.size()-1).stackSize = entry.getValue().intValue(); - entry.setValue(entry.getValue() - (double)entry.getValue().intValue()); + copied.get(copied.size() - 1).stackSize = entry.getValue().intValue(); + entry.setValue(entry.getValue() - (double) entry.getValue().intValue()); } return copied; } - public int addDrops(World world, int count, boolean autocraft){ + public int addDrops(World world, int count, boolean autocraft) { drops = new ArrayList<>(); - for(int i = 0; i < count; i++) { + for (int i = 0; i < count; i++) { List d = crop.getDrops(world, 0, 0, 0, optimalgrowth, 0); - for(ItemStack x : drops) - for(ItemStack y : d) - if(GT_Utility.areStacksEqual(x, y)) - { + for (ItemStack x : drops) + for (ItemStack y : d) + if (GT_Utility.areStacksEqual(x, y)) { x.stackSize += y.stackSize; y.stackSize = 0; } - for(ItemStack x : d) - if(x.stackSize > 0) - drops.add(x.copy()); + for (ItemStack x : d) if (x.stackSize > 0) drops.add(x.copy()); } - if(!needsreplanting) - return 0; - for(int i = 0; i < drops.size(); i++) - { - if(GT_Utility.areStacksEqual(drops.get(i), input)) - { + if (!needsreplanting) return 0; + for (int i = 0; i < drops.size(); i++) { + if (GT_Utility.areStacksEqual(drops.get(i), input)) { int took = Math.min(drops.get(i).stackSize, count); drops.get(i).stackSize -= took; count -= took; - if(drops.get(i).stackSize == 0) { + if (drops.get(i).stackSize == 0) { drops.remove(i); i--; } - if(count == 0) { + if (count == 0) { return 0; } } } - if(autocraft) - { - if(!findCropRecipe(world)) - return count; + if (autocraft) { + if (!findCropRecipe(world)) return count; int totake = count / recipe.getCraftingResult(this).stackSize + 1; - for(int i = 0; i < drops.size(); i++) { - if(GT_Utility.areStacksEqual(drops.get(i), recipeInput)) { + for (int i = 0; i < drops.size(); i++) { + if (GT_Utility.areStacksEqual(drops.get(i), recipeInput)) { int took = Math.min(drops.get(i).stackSize, totake); drops.get(i).stackSize -= took; totake -= took; @@ -895,7 +889,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity drops.remove(i); i--; } - if(totake == 0) { + if (totake == 0) { return 0; } } @@ -907,9 +901,10 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity private static class GreenHouseWorld extends GT_DummyWorld { - public int x = 0,y = 0,z = 0,meta = 0; + public int x = 0, y = 0, z = 0, meta = 0; public Block block; - GreenHouseWorld(int x, int y, int z){ + + GreenHouseWorld(int x, int y, int z) { super(); this.x = x; this.y = y; @@ -919,15 +914,13 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity @Override public int getBlockMetadata(int aX, int aY, int aZ) { - if(aX == x && aY == y && aZ == z) - return 7; + if (aX == x && aY == y && aZ == z) return 7; return 0; } @Override public Block getBlock(int aX, int aY, int aZ) { - if(aY == y - 1) - return Blocks.farmland; + if (aY == y - 1) return Blocks.farmland; return Blocks.air; } @@ -938,21 +931,18 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity @Override public boolean setBlock(int aX, int aY, int aZ, Block aBlock, int aMeta, int aFlags) { - if(aBlock == Blocks.air) - return false; - if(aX == x && aY == y && aZ == z) - return false; + if (aBlock == Blocks.air) return false; + if (aX == x && aY == y && aZ == z) return false; block = aBlock; meta = aMeta; return true; } } - private static class GreenHouseRandom extends Random{ + private static class GreenHouseRandom extends Random { @Override public int nextInt(int bound) { return 0; } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 5461751c79..6344ed5e6f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_VIA_BARTWORKS; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -44,66 +48,201 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; import gregtech.api.render.TextureFactory; import gregtech.api.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_VIA_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase { private static final int BASECASINGINDEX = 181; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {" BBBBBBB "," BBBBBBBBB ","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB"," BBBBBBBBB "," BBBBBBB "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" bbb~bbb "," bbbbbbbbb ","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb"," bbbbbbbbb "," bbbbbbb "}, - })) - .addElement('c', - onElementPass( - x -> x.mCasing++, - ofBlock(GregTech_API.sBlockCasings8, 5)) - ) - .addElement('b', ofChain( - ofHatchAdder(GT_TileEntity_HTGR::addOutputToMachineList, BASECASINGINDEX, 1), - ofHatchAdder(GT_TileEntity_HTGR::addMaintenanceToMachineList, BASECASINGINDEX, 1), - ofHatchAdder(GT_TileEntity_HTGR::addEnergyInputToMachineList, BASECASINGINDEX, 1), - onElementPass( - x -> x.mCasing++, - ofBlock(GregTech_API.sBlockCasings8, 5)) - )) - .addElement('B', ofChain( - ofHatchAdder(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2), - onElementPass( - x -> x.mCasing++, - ofBlock(GregTech_API.sBlockCasings8, 5)) - )) - //ofHatchAdderOptional(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2, GregTech_API.sBlockCasings8, 5)) - .build(); + private static final IStructureDefinition STRUCTURE_DEFINITION = + StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + { + " BBBBBBB ", + " BBBBBBBBB ", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + " BBBBBBBBB ", + " BBBBBBB " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " bbb~bbb ", + " bbbbbbbbb ", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + " bbbbbbbbb ", + " bbbbbbb " + }, + })) + .addElement('c', onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5))) + .addElement( + 'b', + ofChain( + ofHatchAdder(GT_TileEntity_HTGR::addOutputToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_HTGR::addMaintenanceToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_HTGR::addEnergyInputToMachineList, BASECASINGINDEX, 1), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5)))) + .addElement( + 'B', + ofChain( + ofHatchAdder(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5)))) + // ofHatchAdderOptional(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2, + // GregTech_API.sBlockCasings8, 5)) + .build(); private static final int HELIUM_NEEDED = 730000; private static final int powerUsage = BW_Util.getMachineVoltageFromTier(6); private static final int maxcapacity = 720000; - private static final int mincapacity = maxcapacity/10; + private static final int mincapacity = maxcapacity / 10; private int HeliumSupply; private int fueltype = -1, fuelsupply = 0; private boolean empty; @@ -137,8 +276,10 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase .addInfo("Needs a constant supply of coolant while running") .addInfo("Needs at least 72k Fuel pebbles to start operation (can hold up to 720k pebbles)") .addInfo("Consumes up to 0.5% of total Fuel Pellets per Operation depending on efficiency") - .addInfo("Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer") - .addInfo("Reactor will take 4 000L/s of coolant multiplied by efficiency and by fuel coolant value (check tooltips)") + .addInfo( + "Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer") + .addInfo( + "Reactor will take 4 000L/s of coolant multiplied by efficiency and by fuel coolant value (check tooltips)") .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t") .addInfo("One Operation takes 1 hour") .addSeparator() @@ -169,16 +310,14 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { this.mCasing = 0; - return ( - checkPiece("main", 5, 11, 0) && - this.mCasing >= 500 && - this.mMaintenanceHatches.size() == 1 && - this.mInputHatches.size() > 0 && - this.mOutputHatches.size() > 0 && - this.mInputBusses.size() > 0 && - this.mOutputBusses.size() > 0 && - this.mEnergyHatches.size() > 0 - ); + return (checkPiece("main", 5, 11, 0) + && this.mCasing >= 500 + && this.mMaintenanceHatches.size() == 1 + && this.mInputHatches.size() > 0 + && this.mOutputHatches.size() > 0 + && this.mInputBusses.size() > 0 + && this.mOutputBusses.size() > 0 + && this.mEnergyHatches.size() > 0); } @Override @@ -204,30 +343,29 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (aBaseMetaTileEntity.isServerSide() && !this.empty){ - if (this.HeliumSupply < GT_TileEntity_HTGR.HELIUM_NEEDED){ - for (FluidStack fluidStack : this.getStoredFluids()){ + if (aBaseMetaTileEntity.isServerSide() && !this.empty) { + if (this.HeliumSupply < GT_TileEntity_HTGR.HELIUM_NEEDED) { + for (FluidStack fluidStack : this.getStoredFluids()) { if (fluidStack.isFluidEqual(Materials.Helium.getGas(1))) { int toget = Math.min(GT_TileEntity_HTGR.HELIUM_NEEDED - this.HeliumSupply, fluidStack.amount); fluidStack.amount -= toget; this.HeliumSupply += toget; - if(GT_TileEntity_HTGR.HELIUM_NEEDED == this.HeliumSupply && fluidStack.amount == 0) + if (GT_TileEntity_HTGR.HELIUM_NEEDED == this.HeliumSupply && fluidStack.amount == 0) fluidStack = null; } } } - if(this.fuelsupply < maxcapacity){ + if (this.fuelsupply < maxcapacity) { for (ItemStack itemStack : this.getStoredInputs()) { int type = -1; - if(itemStack == null) continue; - if(itemStack.getItem() != HTGRMaterials.aHTGR_Materials) continue; + if (itemStack == null) continue; + if (itemStack.getItem() != HTGRMaterials.aHTGR_Materials) continue; int damage = HTGRMaterials.aHTGR_Materials.getDamage(itemStack); - if(!((damage + 1) % HTGRMaterials.MATERIALS_PER_FUEL == HTGRMaterials.USABLE_FUEL_INDEX + 1)) continue; // is fuel + if (!((damage + 1) % HTGRMaterials.MATERIALS_PER_FUEL == HTGRMaterials.USABLE_FUEL_INDEX + 1)) + continue; // is fuel type = damage / HTGRMaterials.MATERIALS_PER_FUEL; - if(this.fueltype == -1) - this.fueltype = type; - if(this.fueltype != type) - continue; + if (this.fueltype == -1) this.fueltype = type; + if (this.fueltype != type) continue; int toget = Math.min(maxcapacity - this.fuelsupply, itemStack.stackSize); this.fuelsupply += toget; itemStack.stackSize -= toget; @@ -240,29 +378,26 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public boolean checkRecipe(ItemStack controllerStack) { - if(this.empty) - { - if(this.HeliumSupply > 0 || this.fuelsupply > 0){ + if (this.empty) { + if (this.HeliumSupply > 0 || this.fuelsupply > 0) { this.mEfficiency = 10000; this.mMaxProgresstime = 100; return true; } return false; } - if (!(this.HeliumSupply >= GT_TileEntity_HTGR.HELIUM_NEEDED && this.fuelsupply >= mincapacity)) - return false; + if (!(this.HeliumSupply >= GT_TileEntity_HTGR.HELIUM_NEEDED && this.fuelsupply >= mincapacity)) return false; - double eff = Math.min(Math.pow((double)this.fuelsupply/(double)mincapacity, 2D), 100D)/100D - ((double)(getIdealStatus() - getRepairStatus()) / 10D); + double eff = Math.min(Math.pow((double) this.fuelsupply / (double) mincapacity, 2D), 100D) / 100D + - ((double) (getIdealStatus() - getRepairStatus()) / 10D); - if(eff <= 0) - return false; + if (eff <= 0) return false; - int toReduce = MathUtils.floorInt((double)this.fuelsupply * 0.005D * eff); + int toReduce = MathUtils.floorInt((double) this.fuelsupply * 0.005D * eff); this.fuelsupply -= toReduce; - int burnedballs = toReduce/64; - if(burnedballs > 0) - toReduce -= burnedballs*64; + int burnedballs = toReduce / 64; + if (burnedballs > 0) toReduce -= burnedballs * 64; int meta = (this.fueltype * HTGRMaterials.MATERIALS_PER_FUEL) + HTGRMaterials.BURNED_OUT_FUEL_INDEX; @@ -271,13 +406,13 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase new ItemStack(HTGRMaterials.aHTGR_Materials, toReduce, meta + 1) }; - //this.updateSlots(); // not needed ? + // this.updateSlots(); // not needed ? - this.coolanttaking = (int)(4000D * (((this.fueltype * 0.5D) + 1)) * eff); + this.coolanttaking = (int) (4000D * (((this.fueltype * 0.5D) + 1)) * eff); - this.mEfficiency = (int)(eff*10000D); - this.mEUt=-powerUsage; - this.mMaxProgresstime=72000; + this.mEfficiency = (int) (eff * 10000D); + this.mEUt = -powerUsage; + this.mMaxProgresstime = 72000; return true; } @@ -287,32 +422,35 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase public boolean onRunningTick(ItemStack aStack) { runningtick++; - if (this.empty){ - if(emptyticksnodiff > 20 && emptyticksnodiff % 20 != 0){ + if (this.empty) { + if (emptyticksnodiff > 20 && emptyticksnodiff % 20 != 0) { emptyticksnodiff++; return true; } - if(this.HeliumSupply > 0){ + if (this.HeliumSupply > 0) { this.addOutput(Materials.Helium.getGas(this.HeliumSupply)); this.HeliumSupply = 0; } - if(this.fuelsupply > 0) - { - ItemStack iStack = new ItemStack(HTGRMaterials.aHTGR_Materials, this.fuelsupply, (HTGRMaterials.MATERIALS_PER_FUEL * this.fueltype) + HTGRMaterials.USABLE_FUEL_INDEX); + if (this.fuelsupply > 0) { + ItemStack iStack = new ItemStack( + HTGRMaterials.aHTGR_Materials, + this.fuelsupply, + (HTGRMaterials.MATERIALS_PER_FUEL * this.fueltype) + HTGRMaterials.USABLE_FUEL_INDEX); boolean storedAll = false; for (GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) { - if(!isValidMetaTileEntity(tHatch)) - continue; - if (tHatch.storeAll(iStack)){ + if (!isValidMetaTileEntity(tHatch)) continue; + if (tHatch.storeAll(iStack)) { storedAll = true; break; } } - if(!storedAll){ - if(this.fuelsupply == iStack.stackSize) emptyticksnodiff++; - else {this.fuelsupply = iStack.stackSize; emptyticksnodiff = 0;} - } - else{ + if (!storedAll) { + if (this.fuelsupply == iStack.stackSize) emptyticksnodiff++; + else { + this.fuelsupply = iStack.stackSize; + emptyticksnodiff = 0; + } + } else { this.fuelsupply = 0; this.fueltype = -1; this.coolanttaking = 0; @@ -321,41 +459,35 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase return true; } - if(!super.onRunningTick(aStack)) // USE DA POWAH - return false; + if (!super.onRunningTick(aStack)) // USE DA POWAH + return false; - if(runningtick % 20 == 0) - { + if (runningtick % 20 == 0) { int takecoolant = coolanttaking; int drainedamount = 0; - for(GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches){ + for (GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) { if (isValidMetaTileEntity(tHatch)) { FluidStack tLiquid = tHatch.getFluid(); - if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))){ + if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant", 1))) { FluidStack drained = tHatch.drain(takecoolant, true); takecoolant -= drained.amount; drainedamount += drained.amount; - if(takecoolant <= 0) - break; + if (takecoolant <= 0) break; } } } - if(drainedamount > 0) - addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount)); + if (drainedamount > 0) addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount)); this.updateSlots(); - if(takecoolant > 0) - this.stopMachine(); + if (takecoolant > 0) this.stopMachine(); } return true; } - - @Override public int getMaxEfficiency(ItemStack itemStack) { return 10000; @@ -381,113 +513,155 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase return new GT_TileEntity_HTGR(this.mName); } - @Override public String[] getInfoData() { - return new String[]{ - "Mode:", this.empty ? "Emptying" : "Normal", - "Progress:", GT_Utility.formatNumbers(this.mProgresstime / 20) + "s / " + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "s", - "Fuel type:", (this.fueltype == -1 ? "NONE" : ("TRISO (" + HTGRMaterials.sHTGR_Fuel[this.fueltype].sEnglish) + ")"), - "Fuel amount:", GT_Utility.formatNumbers(this.fuelsupply) + " pcs.", - "Helium-Level:", GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + GT_Utility.formatNumbers(GT_TileEntity_HTGR.HELIUM_NEEDED) + "L", - "Coolant:", GT_Utility.formatNumbers(coolanttaking) + "L/s", - "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) + return new String[] { + "Mode:", this.empty ? "Emptying" : "Normal", + "Progress:", + GT_Utility.formatNumbers(this.mProgresstime / 20) + "s / " + + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "s", + "Fuel type:", + (this.fueltype == -1 + ? "NONE" + : ("TRISO (" + HTGRMaterials.sHTGR_Fuel[this.fueltype].sEnglish) + ")"), + "Fuel amount:", GT_Utility.formatNumbers(this.fuelsupply) + " pcs.", + "Helium-Level:", + GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + + GT_Utility.formatNumbers(GT_TileEntity_HTGR.HELIUM_NEEDED) + "L", + "Coolant:", GT_Utility.formatNumbers(coolanttaking) + "L/s", + "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ - Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER).extFacing().build(), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX)}; } @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if(this.mMaxProgresstime > 0) - { + if (this.mMaxProgresstime > 0) { GT_Utility.sendChatToPlayer(aPlayer, "HTGR mode cannot be changed while the machine is running."); return; } this.empty = !this.empty; - GT_Utility.sendChatToPlayer(aPlayer, "HTGR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); + GT_Utility.sendChatToPlayer( + aPlayer, "HTGR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); } + public static class HTGRMaterials { - - public static class HTGRMaterials{ - - private static class CustomHTGRSimpleSubItemClass extends SimpleSubItemClass{ + private static class CustomHTGRSimpleSubItemClass extends SimpleSubItemClass { HashMap tooltip = null; - public CustomHTGRSimpleSubItemClass(HashMap tooltip, String... tex){ + + public CustomHTGRSimpleSubItemClass(HashMap tooltip, String... tex) { super(tex); this.tooltip = tooltip; } + @Override @SuppressWarnings("unchecked") public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { - if(tooltip.containsKey(getDamage(p_77624_1_))) - aList.add(tooltip.get(getDamage(p_77624_1_))); + if (tooltip.containsKey(getDamage(p_77624_1_))) aList.add(tooltip.get(getDamage(p_77624_1_))); aList.add("Material for High Temperature Gas-cooled Reactor"); super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); } } - private static class Base_{ + private static class Base_ { public String sName; public String sEnglish; public String sTooltip; - public Base_(String a, String b){ + + public Base_(String a, String b) { this.sName = a; this.sEnglish = b; this.sTooltip = ""; } - public Base_(String a, String b, String c){ + + public Base_(String a, String b, String c) { this.sName = a; this.sEnglish = b; this.sTooltip = c; } } - static class Fuel_{ + + static class Fuel_ { public String sName; public String sEnglish; public ItemStack mainItem; public ItemStack secondaryItem; - public ItemStack[] recycledItems = { GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI }; + public ItemStack[] recycledItems = { + GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI + }; public FluidStack recycledFluid; public int[] recycleChances; public String tooltip; - public Fuel_(String sName, String sEnglish, ItemStack mainItem, ItemStack secondaryItem, FluidStack recycledFluid, ItemStack[] recycledItems, int[] recycleChances, String tooltip){ + + public Fuel_( + String sName, + String sEnglish, + ItemStack mainItem, + ItemStack secondaryItem, + FluidStack recycledFluid, + ItemStack[] recycledItems, + int[] recycleChances, + String tooltip) { this.sName = sName; this.sEnglish = sEnglish; this.mainItem = mainItem; this.secondaryItem = secondaryItem; this.recycledFluid = recycledFluid; - for(int i = 0; i < recycledItems.length; i++) - this.recycledItems[i] = recycledItems[i]; + for (int i = 0; i < recycledItems.length; i++) this.recycledItems[i] = recycledItems[i]; this.recycleChances = recycleChances; this.tooltip = tooltip; } } - private static class LangEntry_{ + + private static class LangEntry_ { public String sName; public String sEnglish; - public LangEntry_(String a, String b){ + + public LangEntry_(String a, String b) { this.sName = a; this.sEnglish = b; } } - static final Base_[] sHTGR_Bases = new Base_[]{ + static final Base_[] sHTGR_Bases = new Base_[] { new Base_("HTGRFuelMixture", "HTGR fuel mixture"), new Base_("BISOPebbleCompound", "BISO pebble compound"), new Base_("TRISOPebbleCompound", "TRISO pebble compound"), @@ -499,71 +673,152 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase static final int MATERIALS_PER_FUEL = sHTGR_Bases.length; static final int USABLE_FUEL_INDEX = 4; static final int BURNED_OUT_FUEL_INDEX = 5; - static final Fuel_[] sHTGR_Fuel = new Fuel_[]{ - new Fuel_("Thorium", "Thorium", WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 64), Materials.Uranium235.getDust(4), - GT_Values.NF, new ItemStack[]{ - Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), - Materials.Lutetium.getDust(1), WerkstoffLoader.Thorium232.get(OrePrefixes.dust,1)}, - new int[]{9000, 9000, 9000, 9000, 1000}, "Multiplies coolant by 1"), - new Fuel_("Uranium", "Uranium", Materials.Uranium.getDust(64), Materials.Uranium235.getDust(8), - FluidRegistry.getFluidStack("krypton", 8), new ItemStack[]{ - Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), - Materials.Lead.getDust(1), - Materials.Uranium.getDust(1)}, - new int[]{9000, 9000, 9000, 7000, 1000}, "Multiplies coolant by 1.5"), - new Fuel_("Plutonium", "Plutonium", Materials.Plutonium.getDust(64), Materials.Plutonium241.getDust(4), - FluidRegistry.getFluidStack("xenon", 8), new ItemStack[]{ - Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), - Materials.Lead.getDust(1), - Materials.Plutonium.getDust(1)}, - new int[]{9000, 9000, 9000, 7000, 1000}, "Multiplies coolant by 2"), + static final Fuel_[] sHTGR_Fuel = new Fuel_[] { + new Fuel_( + "Thorium", + "Thorium", + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 64), + Materials.Uranium235.getDust(4), + GT_Values.NF, + new ItemStack[] { + Materials.Silicon.getDust(1), + Materials.Graphite.getDust(1), + Materials.Carbon.getDust(1), + Materials.Lutetium.getDust(1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1) + }, + new int[] {9000, 9000, 9000, 9000, 1000}, + "Multiplies coolant by 1"), + new Fuel_( + "Uranium", + "Uranium", + Materials.Uranium.getDust(64), + Materials.Uranium235.getDust(8), + FluidRegistry.getFluidStack("krypton", 8), + new ItemStack[] { + Materials.Silicon.getDust(1), + Materials.Graphite.getDust(1), + Materials.Carbon.getDust(1), + Materials.Lead.getDust(1), + Materials.Uranium.getDust(1) + }, + new int[] {9000, 9000, 9000, 7000, 1000}, + "Multiplies coolant by 1.5"), + new Fuel_( + "Plutonium", + "Plutonium", + Materials.Plutonium.getDust(64), + Materials.Plutonium241.getDust(4), + FluidRegistry.getFluidStack("xenon", 8), + new ItemStack[] { + Materials.Silicon.getDust(1), + Materials.Graphite.getDust(1), + Materials.Carbon.getDust(1), + Materials.Lead.getDust(1), + Materials.Plutonium.getDust(1) + }, + new int[] {9000, 9000, 9000, 7000, 1000}, + "Multiplies coolant by 2"), }; static final CustomHTGRSimpleSubItemClass aHTGR_Materials; static final ArrayList aHTGR_Localizations = new ArrayList(); - static{ - String[] sHTGR_Materials = new String[sHTGR_Bases.length*sHTGR_Fuel.length]; + + static { + String[] sHTGR_Materials = new String[sHTGR_Bases.length * sHTGR_Fuel.length]; HashMap tooltip = new HashMap(); int i = 0; - for(Fuel_ fuel : sHTGR_Fuel) - for(Base_ base : sHTGR_Bases) - { + for (Fuel_ fuel : sHTGR_Fuel) + for (Base_ base : sHTGR_Bases) { sHTGR_Materials[i] = "HTGR" + base.sName + fuel.sName; - aHTGR_Localizations.add(new LangEntry_("item." + sHTGR_Materials[i] + ".name", base.sEnglish + " (" + fuel.sEnglish + ")")); - if(((i+1) % MATERIALS_PER_FUEL == (USABLE_FUEL_INDEX + 1)) && fuel.tooltip != null && fuel.tooltip != "") - tooltip.put(i, fuel.tooltip); + aHTGR_Localizations.add(new LangEntry_( + "item." + sHTGR_Materials[i] + ".name", base.sEnglish + " (" + fuel.sEnglish + ")")); + if (((i + 1) % MATERIALS_PER_FUEL == (USABLE_FUEL_INDEX + 1)) + && fuel.tooltip != null + && fuel.tooltip != "") tooltip.put(i, fuel.tooltip); i++; } aHTGR_Materials = new CustomHTGRSimpleSubItemClass(tooltip, sHTGR_Materials); } - - public static void registeraTHR_Materials(){ - for(LangEntry_ iName : aHTGR_Localizations) + public static void registeraTHR_Materials() { + for (LangEntry_ iName : aHTGR_Localizations) GT_LanguageManager.addStringLocalization(iName.sName, iName.sEnglish); - GameRegistry.registerItem(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials,"bw.HTGRMaterials"); + GameRegistry.registerItem(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, "bw.HTGRMaterials"); } - public static void registerTHR_Recipes(){ - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - new ItemStack(GregTech_API.sBlockCasings3,1,12), - GT_OreDictUnificator.get(OrePrefixes.plate,Materials.Europium,6), - GT_OreDictUnificator.get(OrePrefixes.screw,Materials.Europium,24) + public static void registerTHR_Recipes() { + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + new ItemStack(GregTech_API.sBlockCasings3, 1, 12), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Europium, 6), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 24) }, Materials.Lead.getMolten(1296), - new ItemStack(GregTech_API.sBlockCasings8,1,5), + new ItemStack(GregTech_API.sBlockCasings8, 1, 5), 200, - BW_Util.getMachineVoltageFromTier(6) - ); + BW_Util.getMachineVoltageFromTier(6)); int i = 0; - for(Fuel_ fuel : sHTGR_Fuel){ - GT_Values.RA.addMixerRecipe(fuel.mainItem, fuel.secondaryItem ,GT_Utility.getIntegratedCircuit(1),null,null,null,new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i),400,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i), Materials.Carbon.getDust(64),new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1),40,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), Materials.Silicon.getDust(64),new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2),40,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3),40,30); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false, new ItemStack[]{new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4)}, null, null, null, null, 32000, 30, 0); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false, new ItemStack[]{new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5), GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 6)}, null, null, null, null,48000,30,0); + for (Fuel_ fuel : sHTGR_Fuel) { + GT_Values.RA.addMixerRecipe( + fuel.mainItem, + fuel.secondaryItem, + GT_Utility.getIntegratedCircuit(1), + null, + null, + null, + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i), + 400, + 30); + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i), + Materials.Carbon.getDust(64), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), + 40, + 30); + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), + Materials.Silicon.getDust(64), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), + 40, + 30); + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), + Materials.Graphite.getDust(64), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), + 40, + 30); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( + false, + new ItemStack[] { + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), + GT_Utility.getIntegratedCircuit(17) + }, + new ItemStack[] {new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4)}, + null, + null, + null, + null, + 32000, + 30, + 0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( + false, + new ItemStack[] { + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5), + GT_Utility.getIntegratedCircuit(17) + }, + new ItemStack[] {new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 6)}, + null, + null, + null, + null, + 48000, + 30, + 0); GT_Values.RA.addCentrifugeRecipe( - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 6), GT_Values.NI, GT_Values.NF, + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 6), + GT_Values.NI, + GT_Values.NF, fuel.recycledFluid, fuel.recycledItems[0], fuel.recycledItems[1], @@ -572,10 +827,10 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase fuel.recycledItems[4], fuel.recycledItems[5], fuel.recycleChances, - 1200, 30); + 1200, + 30); i += sHTGR_Bases.length; } } - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 84837e8760..366b6cc81b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -42,6 +42,8 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.Collections; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -52,13 +54,8 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import java.util.ArrayList; -import java.util.Collections; - - public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { - private static final byte TEXID_SIDE = 0; private static final byte TEXID_CHARGING = 1; private static final byte TEXID_IDLE = 2; @@ -79,7 +76,6 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { super(aName); } - @Override public boolean isEnetOutput() { return true; @@ -99,7 +95,10 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public long maxAmperesIn() { int ret = 0; for (int i = 0; i < 5; ++i) - if (this.circuits[i] != null && this.circuits[i].getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) + if (this.circuits[i] != null + && this.circuits[i] + .getItem() + .equals(GT_Utility.getIntegratedCircuit(0).getItem())) ret += this.circuits[i].getItemDamage(); return ret > 0 ? ret : 1; } @@ -158,9 +157,11 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public String[] getDescription() { ArrayList e = new ArrayList<>(); - String[] dsc = StatCollector.translateToLocal("tooltip.tile.lesu.0.name").split(";"); + String[] dsc = + StatCollector.translateToLocal("tooltip.tile.lesu.0.name").split(";"); Collections.addAll(e, dsc); - e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + GT_Utility.formatNumbers(ConfigHandler.energyPerCell) + "EU"); + e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + + GT_Utility.formatNumbers(ConfigHandler.energyPerCell) + "EU"); dsc = StatCollector.translateToLocal("tooltip.tile.lesu.2.name").split(";"); Collections.addAll(e, dsc); e.add(ChatColorHelper.RED + StatCollector.translateToLocal("tooltip.tile.lesu.3.name")); @@ -191,7 +192,6 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } }; } - } @Override @@ -206,31 +206,36 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public boolean isClientSide() { if (this.getWorld() != null) - return this.getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; + return this.getWorld().isRemote + ? FMLCommonHandler.instance().getSide() == Side.CLIENT + : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; } - @Override @SuppressWarnings("ALL") - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { ITexture[] ret = new ITexture[0]; if (this.isClientSide()) { for (int i = 0; i < GT_TileEntity_LESU.iTextures.length; i++) { - GT_TileEntity_LESU.iTextures[i][0] = TextureFactory.of(GT_TileEntity_LESU.iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); + GT_TileEntity_LESU.iTextures[i][0] = TextureFactory.of( + GT_TileEntity_LESU.iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); } if (aSide == aFacing && this.getBaseMetaTileEntity().getUniversalEnergyStored() <= 0) ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_EMPTY]; - else if (aSide == aFacing && !aActive) - ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_IDLE]; - else if (aSide == aFacing && aActive) - ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_CHARGING]; - else - ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_SIDE]; + else if (aSide == aFacing && !aActive) ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_IDLE]; + else if (aSide == aFacing && aActive) ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_CHARGING]; + else ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_SIDE]; } return ret; @@ -253,17 +258,14 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public ItemStack getStackInSlot(int p_70301_1_) { - if (p_70301_1_ > 1) - return this.circuits[(p_70301_1_ - 2)]; + if (p_70301_1_ > 1) return this.circuits[(p_70301_1_ - 2)]; return this.mInventory[p_70301_1_]; } @Override public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { - if (p_70299_1_ < 2) - this.mInventory[p_70299_1_] = p_70299_2_; - else - this.circuits[(p_70299_1_ - 2)] = p_70299_2_; + if (p_70299_1_ < 2) this.mInventory[p_70299_1_] = p_70299_2_; + else this.circuits[(p_70299_1_ - 2)] = p_70299_2_; } @Override @@ -294,7 +296,10 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { case 1: return true; default: - return p_94041_2_ != null && p_94041_2_.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); + return p_94041_2_ != null + && p_94041_2_ + .getItem() + .equals(GT_Utility.getIntegratedCircuit(0).getItem()); } } @@ -328,8 +333,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { this.mMaxProgresstime = 1; - if (aTick % 20 == 0) - this.checkMachine(aBaseMetaTileEntity, null); + if (aTick % 20 == 0) this.checkMachine(aBaseMetaTileEntity, null); this.mWrench = true; this.mScrewdriver = true; this.mSoftHammer = true; @@ -369,9 +373,20 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { long startingTime = System.nanoTime(); this.connectedcells = new ConnectedBlocksChecker(); - this.connectedcells.get_connected(aBaseMetaTileEntity.getWorld(), aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), ItemRegistry.BW_BLOCKS[1]); - - if (this.connectedcells.get_meta_of_sideblocks(aBaseMetaTileEntity.getWorld(), this.getBaseMetaTileEntity().getMetaTileID(), new int[]{aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()}, true)) { + this.connectedcells.get_connected( + aBaseMetaTileEntity.getWorld(), + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord(), + ItemRegistry.BW_BLOCKS[1]); + + if (this.connectedcells.get_meta_of_sideblocks( + aBaseMetaTileEntity.getWorld(), + this.getBaseMetaTileEntity().getMetaTileID(), + new int[] { + aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord() + }, + true)) { this.getBaseMetaTileEntity().disableWorking(); this.getBaseMetaTileEntity().setActive(false); this.mStorage = 0; @@ -381,7 +396,10 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } this.mEfficiency = this.getMaxEfficiency(null); - this.mStorage = (ConfigHandler.energyPerCell * this.connectedcells.hashset.size() >= Long.MAX_VALUE - 1 || ConfigHandler.energyPerCell * this.connectedcells.hashset.size() < 0) ? Long.MAX_VALUE - 1 : ConfigHandler.energyPerCell * this.connectedcells.hashset.size(); + this.mStorage = (ConfigHandler.energyPerCell * this.connectedcells.hashset.size() >= Long.MAX_VALUE - 1 + || ConfigHandler.energyPerCell * this.connectedcells.hashset.size() < 0) + ? Long.MAX_VALUE - 1 + : ConfigHandler.energyPerCell * this.connectedcells.hashset.size(); this.mMaxProgresstime = 1; this.mProgresstime = 0; @@ -396,9 +414,15 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { this.getBaseMetaTileEntity().setActive(true); long finishedTime = System.nanoTime(); - //System.out.println("LESU LookUp: "+((finishedTime - startingTime) / 1000000)+"ms"); + // System.out.println("LESU LookUp: "+((finishedTime - startingTime) / 1000000)+"ms"); if (finishedTime - startingTime > 5000000) - MainMod.LOGGER.warn("LESU LookUp took longer than 5ms!(" + (finishedTime - startingTime) + "ns / " + ((finishedTime - startingTime) / 1000000) + "ms) Owner:"+this.getBaseMetaTileEntity().getOwnerName()+" Check at x:" + this.getBaseMetaTileEntity().getXCoord() + " y:" + this.getBaseMetaTileEntity().getYCoord() + " z:" + this.getBaseMetaTileEntity().getZCoord() + " DIM-ID: " + this.getBaseMetaTileEntity().getWorld().provider.dimensionId); + MainMod.LOGGER.warn("LESU LookUp took longer than 5ms!(" + (finishedTime - startingTime) + "ns / " + + ((finishedTime - startingTime) / 1000000) + "ms) Owner:" + + this.getBaseMetaTileEntity().getOwnerName() + " Check at x:" + + this.getBaseMetaTileEntity().getXCoord() + " y:" + + this.getBaseMetaTileEntity().getYCoord() + " z:" + + this.getBaseMetaTileEntity().getZCoord() + " DIM-ID: " + + this.getBaseMetaTileEntity().getWorld().provider.dimensionId); return true; } @@ -425,5 +449,4 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public World getWorld() { return this.getBaseMetaTileEntity().getWorld(); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index adfad9bcc6..38736f5849 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -22,6 +22,14 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; + import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElementNoPlacement; @@ -43,14 +51,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; - public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBlockBase { private byte mode; @@ -70,58 +70,61 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl private static final String STRUCTURE_PIECE_LAYER = "layer"; private static final String STRUCTURE_PIECE_TOP = "top"; private static final String STRUCTURE_PIECE_TAP_LAYER = "taplayer"; - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][]{ - {"b~b", "bbb", "bbb"} - })) - .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][]{ - {"ttt", "tft", "ttt"} - })) - .addShape(STRUCTURE_PIECE_TOP, transpose(new String[][]{ - {"ooo", "ooo", "ooo"} - })) - .addShape(STRUCTURE_PIECE_TAP_LAYER, transpose(new String[][]{ - {" TTT ", "TtttT", "TtftT", "TtttT", " TTT "} - })) - .addElement('b', ofChain( - ofHatchAdder(GT_TileEntity_ManualTrafo::addEnergyInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_ManualTrafo::addMaintenanceToMachineList, CASING_INDEX, 1), - ofBlock(GregTech_API.sBlockCasings1, 2) - )) - .addElement('o', ofHatchAdderOptional(GT_TileEntity_ManualTrafo::addDynamoToMachineList, CASING_INDEX, 2, GregTech_API.sBlockCasings1, 2)) - .addElement('t', ofBlock(BW_BLOCKS[2], 1)) - .addElement('f', ofBlock(BW_BLOCKS[2], 0)) - .addElement('T', new IStructureElementNoPlacement() { - @Override - public boolean check(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z) { - if(world.isAirBlock(x, y, z)) - return true; - TileEntity tileEntity = world.getTileEntity(x, y, z); - if(tileEntity == null) - return true; - if(!(tileEntity instanceof IGregTechTileEntity)) - return true; - IMetaTileEntity mte = ((IGregTechTileEntity) tileEntity).getMetaTileEntity(); - if(mte instanceof GT_MetaTileEntity_Hatch_Dynamo || mte instanceof GT_MetaTileEntity_Hatch_Energy) { - int intier = te.mEnergyHatches.get(0).mTier; - if(((GT_MetaTileEntity_TieredMachineBlock) mte).mTier == intier + (te.upstep ? te.mTiers : -te.mTiers)){ - te.addToMachineList((IGregTechTileEntity)tileEntity, CASING_INDEX); + private static final IStructureDefinition STRUCTURE_DEFINITION = + StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] {{"b~b", "bbb", "bbb"}})) + .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] {{"ttt", "tft", "ttt"}})) + .addShape(STRUCTURE_PIECE_TOP, transpose(new String[][] {{"ooo", "ooo", "ooo"}})) + .addShape( + STRUCTURE_PIECE_TAP_LAYER, + transpose(new String[][] {{" TTT ", "TtttT", "TtftT", "TtttT", " TTT "}})) + .addElement( + 'b', + ofChain( + ofHatchAdder( + GT_TileEntity_ManualTrafo::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder( + GT_TileEntity_ManualTrafo::addMaintenanceToMachineList, CASING_INDEX, 1), + ofBlock(GregTech_API.sBlockCasings1, 2))) + .addElement( + 'o', + ofHatchAdderOptional( + GT_TileEntity_ManualTrafo::addDynamoToMachineList, + CASING_INDEX, + 2, + GregTech_API.sBlockCasings1, + 2)) + .addElement('t', ofBlock(BW_BLOCKS[2], 1)) + .addElement('f', ofBlock(BW_BLOCKS[2], 0)) + .addElement('T', new IStructureElementNoPlacement() { + @Override + public boolean check(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z) { + if (world.isAirBlock(x, y, z)) return true; + TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity == null) return true; + if (!(tileEntity instanceof IGregTechTileEntity)) return true; + IMetaTileEntity mte = ((IGregTechTileEntity) tileEntity).getMetaTileEntity(); + if (mte instanceof GT_MetaTileEntity_Hatch_Dynamo + || mte instanceof GT_MetaTileEntity_Hatch_Energy) { + int intier = te.mEnergyHatches.get(0).mTier; + if (((GT_MetaTileEntity_TieredMachineBlock) mte).mTier + == intier + (te.upstep ? te.mTiers : -te.mTiers)) { + te.addToMachineList((IGregTechTileEntity) tileEntity, CASING_INDEX); + return true; + } else return false; + } return true; } - else - return false; - } - return true; - } - - @Override - public boolean spawnHint(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z, ItemStack itemStack) { - StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 2 /* aDots: 3 */); - return true; - } - } - ) - .build(); + + @Override + public boolean spawnHint( + GT_TileEntity_ManualTrafo te, World world, int x, int y, int z, ItemStack itemStack) { + StructureLibAPI.hintParticle( + world, x, y, z, StructureLibAPI.getBlockHint(), 2 /* aDots: 3 */); + return true; + } + }) + .build(); @Override public IStructureDefinition getStructureDefinition() { @@ -132,26 +135,26 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Transformer") - .addInfo("Controller block for the Manual Trafo") - .addInfo("Operates in 4 diffrent modes:") - .addInfo("Mode 1: Circuit 0 in controller: Direct-Upstep") - .addInfo("Mode 2: Circuit 1 in controller: Direct-Downstep") - .addInfo("Mode 3: Circuit 2 in controller: Tapped-Upstep (currently disabled)") - .addInfo("Mode 4: Circuit 2 in controller: Tapped-Downstep (currently disabled)") - .addSeparator() - .beginVariableStructureBlock(3, 3, 3, 10, 3, 3, false) - .addController("Front bottom center") - .addCasingInfo("MV Machine Casing", 0) - .addOtherStructurePart("Transformer-Winding Blocks", "1 Layer for each tier transformed") - .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Middle of Transformer-Winding Blocks") - .addMaintenanceHatch("Any bottom layer casing", 1) - .addEnergyHatch("Any bottom layer casing", 1) - .addDynamoHatch("Any top layer casing", 2) - .addStructureInfo("---------TAPPED MODE---------") - .addEnergyHatch("Touching Transformer-Winding Blocks", 3) - .addDynamoHatch("Touching Transformer-Winding Blocks", 3) - .addStructureInfo("Hatches touching Transformer-Winding Blocks must be tiered from bottom to top") - .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + .addInfo("Controller block for the Manual Trafo") + .addInfo("Operates in 4 diffrent modes:") + .addInfo("Mode 1: Circuit 0 in controller: Direct-Upstep") + .addInfo("Mode 2: Circuit 1 in controller: Direct-Downstep") + .addInfo("Mode 3: Circuit 2 in controller: Tapped-Upstep (currently disabled)") + .addInfo("Mode 4: Circuit 2 in controller: Tapped-Downstep (currently disabled)") + .addSeparator() + .beginVariableStructureBlock(3, 3, 3, 10, 3, 3, false) + .addController("Front bottom center") + .addCasingInfo("MV Machine Casing", 0) + .addOtherStructurePart("Transformer-Winding Blocks", "1 Layer for each tier transformed") + .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Middle of Transformer-Winding Blocks") + .addMaintenanceHatch("Any bottom layer casing", 1) + .addEnergyHatch("Any bottom layer casing", 1) + .addDynamoHatch("Any top layer casing", 2) + .addStructureInfo("---------TAPPED MODE---------") + .addEnergyHatch("Touching Transformer-Winding Blocks", 3) + .addDynamoHatch("Touching Transformer-Winding Blocks", 3) + .addStructureInfo("Hatches touching Transformer-Winding Blocks must be tiered from bottom to top") + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -162,8 +165,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (!this.getBaseMetaTileEntity().isAllowedToWork()) - this.stopMachine(); + if (!this.getBaseMetaTileEntity().isAllowedToWork()) this.stopMachine(); super.onPostTick(aBaseMetaTileEntity, aTick); } @@ -178,16 +180,19 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl this.mMaxProgresstime = 1; if (this.getBaseMetaTileEntity().getTimer() % 40 == 0) - if (this.mEfficiency < this.getMaxEfficiency(null)) - this.mEfficiency += 100; - else - this.mEfficiency = this.getMaxEfficiency(null); + if (this.mEfficiency < this.getMaxEfficiency(null)) this.mEfficiency += 100; + else this.mEfficiency = this.getMaxEfficiency(null); if (this.mode > 1) { - return false;//this.onRunningTickTabbedMode(); Tapped mode is disable + return false; // this.onRunningTickTabbedMode(); Tapped mode is disable } - return this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput(this.getInputTier() * 2 * this.mEnergyHatches.size() * (long) this.mEfficiency / this.getMaxEfficiency(null)); + return this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) + && this.addEnergyOutput(this.getInputTier() + * 2 + * this.mEnergyHatches.size() + * (long) this.mEfficiency + / this.getMaxEfficiency(null)); } public boolean onRunningTickTabbedMode() { @@ -197,8 +202,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl long vtt = I.getEUVar() >= (V[E.mTier] / 2) && E.getEUVar() < E.maxEUStore() ? I.getEUVar() : 0; - if (vtt == 0) - continue; + if (vtt == 0) continue; long vtp = E.getEUVar() + (vtt); long avt = Math.min(vtp, E.maxEUStore()); @@ -210,16 +214,17 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl return ret; } - public long getInputTier() { if (this.mEnergyHatches.size() > 0) - return GT_Utility.getTier(this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); + return GT_Utility.getTier( + this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); else return 0L; } public long getOutputTier() { if (this.mDynamoHatches.size() > 0) - return GT_Utility.getTier(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); + return GT_Utility.getTier( + this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); else return 0L; } @@ -230,61 +235,48 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl this.stopMachine(); return false; } - if(itemStack == null || !itemStack.getUnlocalizedName().startsWith("gt.integrated_circuit")) - this.mode = 0; - else - this.mode = (byte)Math.min(3, itemStack.getItemDamage()); + if (itemStack == null || !itemStack.getUnlocalizedName().startsWith("gt.integrated_circuit")) this.mode = 0; + else this.mode = (byte) Math.min(3, itemStack.getItemDamage()); this.upstep = this.mode % 2 == 0; this.mProgresstime = 0; this.mMaxProgresstime = 1; this.mEfficiency = Math.max(this.mEfficiency, 100); - return this.upstep ? this.getOutputTier() - this.getInputTier() == this.mTiers : this.getInputTier() - this.getOutputTier() == this.mTiers; + return this.upstep + ? this.getOutputTier() - this.getInputTier() == this.mTiers + : this.getInputTier() - this.getOutputTier() == this.mTiers; } @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - if(itemStack == null || !itemStack.getUnlocalizedName().startsWith("gt.integrated_circuit")) - this.mode = 0; - else - this.mode = (byte)Math.min(3, itemStack.getItemDamage()); + if (itemStack == null || !itemStack.getUnlocalizedName().startsWith("gt.integrated_circuit")) this.mode = 0; + else this.mode = (byte) Math.min(3, itemStack.getItemDamage()); this.upstep = this.mode % 2 == 0; boolean tapmode = this.mode > 1; - if(!checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0)) return false; - if(this.mEnergyHatches.size() == 0) - return false; + if (this.mEnergyHatches.size() == 0) return false; byte intier = this.mEnergyHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) - if (in.mTier != intier) - return false; + for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) if (in.mTier != intier) return false; int mHeight; - for(mHeight = 1; mHeight <= 8; mHeight++) { - if(tapmode) - { + for (mHeight = 1; mHeight <= 8; mHeight++) { + if (tapmode) { this.mTiers = mHeight; - if(!checkPiece(STRUCTURE_PIECE_TAP_LAYER, 2, mHeight, 1)) - break; - } - else if (!checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0)) - break; + if (!checkPiece(STRUCTURE_PIECE_TAP_LAYER, 2, mHeight, 1)) break; + } else if (!checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0)) break; } - if (!checkPiece(STRUCTURE_PIECE_TOP, 1, mHeight, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_TOP, 1, mHeight, 0)) return false; this.mTiers = mHeight - 1; - if (this.mDynamoHatches.size() == 0 || mMaintenanceHatches.size() != 1 || this.mTiers == 0) - return false; + if (this.mDynamoHatches.size() == 0 || mMaintenanceHatches.size() != 1 || this.mTiers == 0) return false; byte outtier = this.mDynamoHatches.get(0).mTier; for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { - if (out.mTier != outtier) - return false; + if (out.mTier != outtier) return false; } return true; @@ -332,35 +324,54 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } @Override public void construct(ItemStack itemStack, boolean b) { - if(this.mInventory[1] == null || !this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) - this.mode = 0; - else - this.mode = (byte)Math.min(3, this.mInventory[1].getItemDamage()); + if (this.mInventory[1] == null + || !this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) this.mode = 0; + else this.mode = (byte) Math.min(3, this.mInventory[1].getItemDamage()); int mHeight = Math.min(itemStack.stackSize, 8); boolean tapmode = this.mode > 1; buildPiece(STRUCTURE_PIECE_BASE, itemStack, b, 1, 0, 0); - for(int i = 0; i < mHeight; i++) { - if (tapmode) - buildPiece(STRUCTURE_PIECE_TAP_LAYER, itemStack, b, 2, i + 1, 1); - else - buildPiece(STRUCTURE_PIECE_LAYER, itemStack, b, 1, i + 1, 0); + for (int i = 0; i < mHeight; i++) { + if (tapmode) buildPiece(STRUCTURE_PIECE_TAP_LAYER, itemStack, b, 2, i + 1, 1); + else buildPiece(STRUCTURE_PIECE_LAYER, itemStack, b, 1, i + 1, 0); } buildPiece(STRUCTURE_PIECE_TOP, itemStack, b, 1, mHeight + 1, 0); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 1f98de8cb9..7ec2734fd8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -45,65 +49,197 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.Arrays; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.util.Arrays; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase { private static final int BASECASINGINDEX = 44; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {" BBBBBBB "," BBBBBBBBB ","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB"," BBBBBBBBB "," BBBBBBB "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" bbb~bbb "," bbbbbbbbb ","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb"," bbbbbbbbb "," bbbbbbb "}, - })) - .addElement('c', - onElementPass( - x -> x.mCasing++, - ofBlock(GregTech_API.sBlockCasings3, 12)) - ) - .addElement('b', ofChain( - ofHatchAdder(GT_TileEntity_THTR::addOutputToMachineList, BASECASINGINDEX, 1), - ofHatchAdder(GT_TileEntity_THTR::addMaintenanceToMachineList, BASECASINGINDEX, 1), - ofHatchAdder(GT_TileEntity_THTR::addEnergyInputToMachineList, BASECASINGINDEX, 1), - onElementPass( - x -> x.mCasing++, - ofBlock(GregTech_API.sBlockCasings3, 12)) - )) - .addElement('B', ofChain( - ofHatchAdder(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2), - onElementPass( - x -> x.mCasing++, - ofBlock(GregTech_API.sBlockCasings3, 12)) - )) - //ofHatchAdderOptional(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2, GregTech_API.sBlockCasings3, 12)) - .build(); - - - + private static final IStructureDefinition STRUCTURE_DEFINITION = + StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + { + " BBBBBBB ", + " BBBBBBBBB ", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + " BBBBBBBBB ", + " BBBBBBB " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " bbb~bbb ", + " bbbbbbbbb ", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + " bbbbbbbbb ", + " bbbbbbb " + }, + })) + .addElement('c', onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12))) + .addElement( + 'b', + ofChain( + ofHatchAdder(GT_TileEntity_THTR::addOutputToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_THTR::addMaintenanceToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_THTR::addEnergyInputToMachineList, BASECASINGINDEX, 1), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12)))) + .addElement( + 'B', + ofChain( + ofHatchAdder(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12)))) + // ofHatchAdderOptional(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2, + // GregTech_API.sBlockCasings3, 12)) + .build(); private static final int HELIUM_NEEDED = 730000; - private static final int powerUsage = BW_Util.getMachineVoltageFromTier(5)/2; + private static final int powerUsage = BW_Util.getMachineVoltageFromTier(5) / 2; private static final int maxcapacity = 675000; private static final int mincapacity = 100000; private int HeliumSupply; @@ -138,7 +274,8 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase .addInfo("Needs a constant supply of coolant while running") .addInfo("Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles)") .addInfo("Consumes up to 0.5% of total Fuel Pellets per Operation depending on efficiency") - .addInfo("Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer") + .addInfo( + "Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer") .addInfo("Reactor will take 4 800L/t of coolant multiplied by efficiency") .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t") .addInfo("One Operation takes 9 hour") @@ -170,16 +307,14 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { this.mCasing = 0; - return ( - checkPiece(STRUCTURE_PIECE_MAIN, 5, 11, 0) && - this.mCasing >= 500 && - this.mMaintenanceHatches.size() == 1 && - this.mInputHatches.size() > 0 && - this.mOutputHatches.size() > 0 && - this.mInputBusses.size() > 0 && - this.mOutputBusses.size() > 0 && - this.mEnergyHatches.size() > 0 - ); + return (checkPiece(STRUCTURE_PIECE_MAIN, 5, 11, 0) + && this.mCasing >= 500 + && this.mMaintenanceHatches.size() == 1 + && this.mInputHatches.size() > 0 + && this.mOutputHatches.size() > 0 + && this.mInputBusses.size() > 0 + && this.mOutputBusses.size() > 0 + && this.mEnergyHatches.size() > 0); } @Override @@ -203,23 +338,25 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (aBaseMetaTileEntity.isServerSide() && !this.empty){ - if (this.HeliumSupply < GT_TileEntity_THTR.HELIUM_NEEDED){ - for (FluidStack fluidStack : this.getStoredFluids()){ + if (aBaseMetaTileEntity.isServerSide() && !this.empty) { + if (this.HeliumSupply < GT_TileEntity_THTR.HELIUM_NEEDED) { + for (FluidStack fluidStack : this.getStoredFluids()) { if (fluidStack.isFluidEqual(Materials.Helium.getGas(1))) { int toget = Math.min(GT_TileEntity_THTR.HELIUM_NEEDED - this.HeliumSupply, fluidStack.amount); fluidStack.amount -= toget; this.HeliumSupply += toget; - if(GT_TileEntity_THTR.HELIUM_NEEDED == this.HeliumSupply && fluidStack.amount == 0) + if (GT_TileEntity_THTR.HELIUM_NEEDED == this.HeliumSupply && fluidStack.amount == 0) fluidStack = null; } } } - if(this.fuelsupply < maxcapacity){ + if (this.fuelsupply < maxcapacity) { for (ItemStack itemStack : this.getStoredInputs()) { - if (GT_Utility.areStacksEqual(itemStack, new ItemStack(THTRMaterials.aTHTR_Materials, 1, THTRMaterials.MATERIAL_FUEL_INDEX))) { + if (GT_Utility.areStacksEqual( + itemStack, + new ItemStack(THTRMaterials.aTHTR_Materials, 1, THTRMaterials.MATERIAL_FUEL_INDEX))) { int toget = Math.min(maxcapacity - this.fuelsupply, itemStack.stackSize); - if(toget == 0) continue; + if (toget == 0) continue; itemStack.stackSize -= toget; this.fuelsupply += toget; } @@ -232,28 +369,32 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public boolean checkRecipe(ItemStack controllerStack) { - if(this.empty) - { - if(this.HeliumSupply > 0 || this.fuelsupply > 0){ + if (this.empty) { + if (this.HeliumSupply > 0 || this.fuelsupply > 0) { this.mEfficiency = 10000; this.mMaxProgresstime = 100; return true; } return false; } - if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.fuelsupply >= mincapacity)) - return false; + if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.fuelsupply >= mincapacity)) return false; - double eff = Math.min(Math.pow((double)(this.fuelsupply - mincapacity)/((maxcapacity-mincapacity)/10D), 2D)+1, 100D)/100D - ((double)(getIdealStatus() - getRepairStatus()) / 10D); - if(eff <= 0D) - return false; + double eff = Math.min( + Math.pow( + (double) (this.fuelsupply - mincapacity) + / ((maxcapacity - mincapacity) / 10D), + 2D) + + 1, + 100D) + / 100D + - ((double) (getIdealStatus() - getRepairStatus()) / 10D); + if (eff <= 0D) return false; - int toReduce = MathUtils.floorInt((double)this.fuelsupply * 0.005D * eff); + int toReduce = MathUtils.floorInt((double) this.fuelsupply * 0.005D * eff); this.fuelsupply -= toReduce; - int burnedballs = toReduce/64; - if(burnedballs > 0) - toReduce -= burnedballs*64; + int burnedballs = toReduce / 64; + if (burnedballs > 0) toReduce -= burnedballs * 64; int meta = THTRMaterials.MATERIAL_USED_FUEL_INDEX; @@ -264,46 +405,44 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase // this.updateSlots(); not needed ? - this.coolanttaking = (int)(4800D * eff); - this.mEfficiency = (int)(eff*10000D); - this.mEUt=-powerUsage; - this.mMaxProgresstime=648000; + this.coolanttaking = (int) (4800D * eff); + this.mEfficiency = (int) (eff * 10000D); + this.mEUt = -powerUsage; + this.mMaxProgresstime = 648000; return true; } @Override public boolean onRunningTick(ItemStack aStack) { - if (this.empty){ + if (this.empty) { this.addOutput(Materials.Helium.getGas(this.HeliumSupply)); - this.addOutput(new ItemStack(THTRMaterials.aTHTR_Materials, this.fuelsupply, THTRMaterials.MATERIAL_FUEL_INDEX)); + this.addOutput( + new ItemStack(THTRMaterials.aTHTR_Materials, this.fuelsupply, THTRMaterials.MATERIAL_FUEL_INDEX)); this.HeliumSupply = 0; this.fuelsupply = 0; this.updateSlots(); return true; } - if(!super.onRunningTick(aStack)) - return false; + if (!super.onRunningTick(aStack)) return false; int takecoolant = coolanttaking; int drainedamount = 0; - for(GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches){ + for (GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) { if (isValidMetaTileEntity(tHatch)) { FluidStack tLiquid = tHatch.getFluid(); - if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))){ + if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant", 1))) { FluidStack drained = tHatch.drain(takecoolant, true); takecoolant -= drained.amount; drainedamount += drained.amount; - if(takecoolant <= 0) - break; + if (takecoolant <= 0) break; } } } - if(drainedamount > 0) - addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount)); + if (drainedamount > 0) addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount)); this.updateSlots(); @@ -335,92 +474,185 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase return new GT_TileEntity_THTR(this.mName); } - @Override public String[] getInfoData() { - return new String[]{ - "Progress:", GT_Utility.formatNumbers(this.mProgresstime / 20) + "secs /" + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "secs", - "TRISO-Pebbles:", GT_Utility.formatNumbers(this.fuelsupply) + "pcs. / " + GT_Utility.formatNumbers(this.fuelsupply) + "psc.", - "Helium-Level:", GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + GT_Utility.formatNumbers(GT_TileEntity_THTR.HELIUM_NEEDED) + "L", - "Coolant/t:", GT_Utility.formatNumbers(this.mProgresstime == 0 ? 0 : coolanttaking) + "L/t", - "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) + return new String[] { + "Progress:", + GT_Utility.formatNumbers(this.mProgresstime / 20) + "secs /" + + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "secs", + "TRISO-Pebbles:", + GT_Utility.formatNumbers(this.fuelsupply) + "pcs. / " + GT_Utility.formatNumbers(this.fuelsupply) + + "psc.", + "Helium-Level:", + GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + + GT_Utility.formatNumbers(GT_TileEntity_THTR.HELIUM_NEEDED) + "L", + "Coolant/t:", GT_Utility.formatNumbers(this.mProgresstime == 0 ? 0 : coolanttaking) + "L/t", + "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ - Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER).extFacing().build(), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX)}; } @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if(this.mMaxProgresstime > 0) - { + if (this.mMaxProgresstime > 0) { GT_Utility.sendChatToPlayer(aPlayer, "THTR mode cannot be changed while the machine is running."); return; } this.empty = !this.empty; - GT_Utility.sendChatToPlayer(aPlayer, "THTR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); + GT_Utility.sendChatToPlayer( + aPlayer, "THTR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); } - public static class THTRMaterials{ + public static class THTRMaterials { static final SimpleSubItemClass aTHTR_Materials = new SimpleSubItemClass( - "BISOPelletCompound", // 0 - "BISOPelletBall", // 1 + "BISOPelletCompound", // 0 + "BISOPelletBall", // 1 "TRISOPelletCompound", // 2 - "TRISOPelletBall", // 3 - "TRISOPellet", // 4 + "TRISOPelletBall", // 3 + "TRISOPellet", // 4 "BurnedOutTRISOPelletBall", // 5 "BurnedOutTRISOPellet" // 6 - ); + ); public static final int MATERIAL_FUEL_INDEX = 4; public static final int MATERIAL_USED_FUEL_INDEX = 5; - public static void registeraTHR_Materials(){ - GameRegistry.registerItem(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,"bw.THTRMaterials"); + + public static void registeraTHR_Materials() { + GameRegistry.registerItem(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, "bw.THTRMaterials"); } - public static void registerTHR_Recipes(){ + public static void registerTHR_Recipes() { GT_Values.RA.addCentrifugeRecipe( - Materials.Thorium.getDust(1),GT_Values.NI,GT_Values.NF,GT_Values.NF, - Materials.Thorium.getDust(1),Materials.Thorium.getDust(1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dust,1),WerkstoffLoader.Thorium232.get(OrePrefixes.dust,1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dust,1),GT_Values.NI, - new int[]{800,375,22,22,5}, - 10000, BW_Util.getMachineVoltageFromTier(4)); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - GT_OreDictUnificator.get(OrePrefixes.plateDense,Materials.Lead,6), - GT_OreDictUnificator.get(OrePrefixes.frameGt,Materials.TungstenSteel,1) + Materials.Thorium.getDust(1), + GT_Values.NI, + GT_Values.NF, + GT_Values.NF, + Materials.Thorium.getDust(1), + Materials.Thorium.getDust(1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), + GT_Values.NI, + new int[] {800, 375, 22, 22, 5}, + 10000, + BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 6), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1) }, Materials.Concrete.getMolten(1296), - new ItemStack(GregTech_API.sBlockCasings3,1,12), + new ItemStack(GregTech_API.sBlockCasings3, 1, 12), 40, - BW_Util.getMachineVoltageFromTier(5) - ); - GT_Values.RA.addMixerRecipe(WerkstoffLoader.Thorium232.get(OrePrefixes.dust,10),Materials.Uranium235.getDust(1),GT_Utility.getIntegratedCircuit(2),null,null,null,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials),400,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials),Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,1),40,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,1),Materials.Silicon.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,2),40,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,2),Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,3),40,30); + BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addMixerRecipe( + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 10), + Materials.Uranium235.getDust(1), + GT_Utility.getIntegratedCircuit(2), + null, + null, + null, + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials), + 400, + 30); + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials), + Materials.Graphite.getDust(64), + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1), + 40, + 30); + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1), + Materials.Silicon.getDust(64), + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2), + 40, + 30); + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2), + Materials.Graphite.getDust(64), + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3), + 40, + 30); ItemStack[] pellets = new ItemStack[6]; - Arrays.fill(pellets,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,4)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,3),GT_Utility.getIntegratedCircuit(17)}, pellets,null,null,null,null,48000,30,0); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,5),GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,6)},null,null,null,null,48000,30,0); + Arrays.fill(pellets, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 4)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( + false, + new ItemStack[] { + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3), + GT_Utility.getIntegratedCircuit(17) + }, + pellets, + null, + null, + null, + null, + 48000, + 30, + 0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( + false, + new ItemStack[] { + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 5), + GT_Utility.getIntegratedCircuit(17) + }, + new ItemStack[] {new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 6)}, + null, + null, + null, + null, + 48000, + 30, + 0); GT_Values.RA.addCentrifugeRecipe( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 6), GT_Values.NI, GT_Values.NF, GT_Values.NF, - Materials.Lead.getDust(1), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, - new int[]{300}, - 1200, 30); + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 6), + GT_Values.NI, + GT_Values.NF, + GT_Values.NF, + Materials.Lead.getDust(1), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + new int[] {300}, + 1200, + 30); } - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index ece992b765..78ff775ca5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_Values.V; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_Windmill; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; @@ -51,6 +55,9 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayerMP; @@ -63,15 +70,8 @@ import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_Values.V; - -public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable { +public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlockBase + implements ISurvivalConstructable { private static final IIcon[] iIcons = new IIcon[2]; private static final IIconContainer[] iIconContainers = new IIconContainer[2]; @@ -91,30 +91,34 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock } private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {" ", " ", " ", " p ", " ", " ", " "}, - {" ", " ", " ppp ", " p p ", " ppp ", " ", " "}, - {" ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " "}, - {" ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, - {" ppspp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, - {" ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, - {" ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " "}, - {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, - {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, - {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, - {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, - {" bb~bb ", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", " bbbbb "}, - })) - .addElement('p', ofBlockAnyMeta(Blocks.planks)) - .addElement('c', ofChain( - onElementPass(t -> t.mHardenedClay++, ofBlock(Blocks.hardened_clay, 0)), - ofTileAdder(GT_TileEntity_Windmill::addDispenserToOutputSet, Blocks.hardened_clay, 0), - onElementPass(t -> t.mDoor++, ofBlock(Blocks.wooden_door, 0)) - )) - .addElement('b', ofBlock(Blocks.brick_block, 0)) - .addElement('s', ofTileAdder(GT_TileEntity_Windmill::setRotorBlock, StructureLibAPI.getBlockHint(), 0)) - .build(); + private static final IStructureDefinition STRUCTURE_DEFINITION = + StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {" ", " ", " ", " p ", " ", " ", " "}, + {" ", " ", " ppp ", " p p ", " ppp ", " ", " "}, + {" ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " "}, + {" ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, + {" ppspp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, + {" ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, + {" ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " "}, + {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, + {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, + {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, + {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, + {" bb~bb ", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", " bbbbb "}, + })) + .addElement('p', ofBlockAnyMeta(Blocks.planks)) + .addElement( + 'c', + ofChain( + onElementPass(t -> t.mHardenedClay++, ofBlock(Blocks.hardened_clay, 0)), + ofTileAdder( + GT_TileEntity_Windmill::addDispenserToOutputSet, Blocks.hardened_clay, 0), + onElementPass(t -> t.mDoor++, ofBlock(Blocks.wooden_door, 0)))) + .addElement('b', ofBlock(Blocks.brick_block, 0)) + .addElement( + 's', ofTileAdder(GT_TileEntity_Windmill::setRotorBlock, StructureLibAPI.getBlockHint(), 0)) + .build(); @Override public IStructureDefinition getStructureDefinition() { @@ -129,20 +133,19 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt. - addMachineType("Windmill"). - addInfo("Controller block for the Windmill"). - addInfo("A primitive Grinder powered by Kinetic energy"). - addInfo("The structure is too complex!"). - addInfo("Follow the StructureLib hologram projector to build the main structure."). - addSeparator(). - beginStructureBlock(7, 12, 7, false). - addController("Front bottom center"). - addCasingInfo("Hardened Clay block", 40). - addOtherStructurePart("Dispenser", "Any Hardened Clay block"). - addOtherStructurePart("0-1 Wooden door", "Any Hardened Clay block"). - addStructureHint("Primitive Kinetic Shaftbox", 1). - toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + tt.addMachineType("Windmill") + .addInfo("Controller block for the Windmill") + .addInfo("A primitive Grinder powered by Kinetic energy") + .addInfo("The structure is too complex!") + .addInfo("Follow the StructureLib hologram projector to build the main structure.") + .addSeparator() + .beginStructureBlock(7, 12, 7, false) + .addController("Front bottom center") + .addCasingInfo("Hardened Clay block", 40) + .addOtherStructurePart("Dispenser", "Any Hardened Clay block") + .addOtherStructurePart("0-1 Wooden door", "Any Hardened Clay block") + .addStructureHint("Primitive Kinetic Shaftbox", 1) + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -155,8 +158,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public boolean onRunningTick(ItemStack aStack) { - if (this.mMaxProgresstime > 0) - this.mProgresstime += this.rotorBlock.getGrindPower(); + if (this.mMaxProgresstime > 0) this.mProgresstime += this.rotorBlock.getGrindPower(); return this.rotorBlock.getGrindPower() > 0; } @@ -166,37 +168,63 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock } public boolean recipe_fallback(ItemStack aStack) { - //sight... fallback to the macerator recipes + // sight... fallback to the macerator recipes GT_Recipe.GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; GT_Recipe tRecipe = tMap.findRecipe(this.getBaseMetaTileEntity(), false, false, V[1], null, aStack); - if (tRecipe == null) - return false; + if (tRecipe == null) return false; if (tRecipe.getOutput(0) != null) { // Decrease input stack by appropriate amount (Not always 1) tRecipe.isRecipeInputEqual(true, null, aStack); this.mOutputItems[0] = tRecipe.getOutput(0); if (new XSTR().nextInt(2) == 0) { - if (tRecipe.getOutput(1) != null) - this.mOutputItems[1] = tRecipe.getOutput(1); - else if (!BW_Util.checkStackAndPrefix(this.mOutputItems[0]) || - !( - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL) || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTALLISABLE) - ) - || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Flint || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Sugar || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Wheat || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Wood || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Ash || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Snow || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Stone || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.MeatRaw || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.MeatCooked - ) - this.mOutputItems[1] = tRecipe.getOutput(0); + if (tRecipe.getOutput(1) != null) this.mOutputItems[1] = tRecipe.getOutput(1); + else if (!BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + || !(BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]) + .mMaterial + .mMaterial + .mSubTags + .contains(SubTag.METAL) + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]) + .mMaterial + .mMaterial + .mSubTags + .contains(SubTag.CRYSTAL) + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]) + .mMaterial + .mMaterial + .mSubTags + .contains(SubTag.CRYSTALLISABLE)) + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.Flint + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.Sugar + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.Wheat + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.Wood + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.Ash + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.Snow + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.Stone + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.MeatRaw + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.MeatCooked) this.mOutputItems[1] = tRecipe.getOutput(0); } } this.mMaxProgresstime = (tRecipe.mDuration * 2 * 100); @@ -212,14 +240,11 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock input.stackSize -= 1; this.mMaxProgresstime = maxProgresstime; if (randomise) { - if (localRandomInstance.nextInt(2) == 0) - this.mOutputItems[0] = outputs[0]; - else - this.mOutputItems[0] = outputs[1]; + if (localRandomInstance.nextInt(2) == 0) this.mOutputItems[0] = outputs[0]; + else this.mOutputItems[0] = outputs[1]; } else { this.mOutputItems[0] = outputs[0]; - if (outputs.length == 2) - this.mOutputItems[1] = outputs[1]; + if (outputs.length == 2) this.mOutputItems[1] = outputs[1]; } return true; } @@ -227,14 +252,12 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public boolean checkRecipe(ItemStack itemStack) { - if (itemStack == null || itemStack.getItem() == null) - return false; + if (itemStack == null || itemStack.getItem() == null) return false; - if (this.mOutputItems == null) - this.mOutputItems = new ItemStack[2]; + if (this.mOutputItems == null) this.mOutputItems = new ItemStack[2]; - //Override Recipes that doesnt quite work well with OreUnificator - //Items + // Override Recipes that doesnt quite work well with OreUnificator + // Items if (itemStack.getItem().equals(Items.wheat)) { return hardOverride( 30000, @@ -244,21 +267,13 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wheat, 1L)); } else if (itemStack.getItem().equals(Items.bone)) { return hardOverride( - 30000, - true, - itemStack, - new ItemStack(Items.dye, 4, 15), - new ItemStack(Items.dye, 3, 15)); + 30000, true, itemStack, new ItemStack(Items.dye, 4, 15), new ItemStack(Items.dye, 3, 15)); } - //Blocks + // Blocks else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.gravel)) { - return hardOverride( - 60000, - true, - itemStack, - new ItemStack(Items.flint, 2), - new ItemStack(Items.flint)); - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.cobblestone) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stone)) { + return hardOverride(60000, true, itemStack, new ItemStack(Items.flint, 2), new ItemStack(Items.flint)); + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.cobblestone) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stone)) { return hardOverride( 120000, true, @@ -266,38 +281,19 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 2L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.sandstone)) { - return hardOverride( - 120000, - true, - itemStack, - new ItemStack(Blocks.sand, 3), - new ItemStack(Blocks.sand, 2)); - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.hardened_clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stained_hardened_clay)) { - return hardOverride( - 120000, - true, - itemStack, - Materials.Clay.getDust(2), - Materials.Clay.getDust(1)); + return hardOverride(120000, true, itemStack, new ItemStack(Blocks.sand, 3), new ItemStack(Blocks.sand, 2)); + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.clay) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.hardened_clay) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stained_hardened_clay)) { + return hardOverride(120000, true, itemStack, Materials.Clay.getDust(2), Materials.Clay.getDust(1)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.redstone_block)) { - return hardOverride( - 120000, - false, - itemStack, - Materials.Redstone.getDust(9)); + return hardOverride(120000, false, itemStack, Materials.Redstone.getDust(9)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glass)) { return hardOverride( - 120000, - false, - itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glass, 1L))); + 120000, false, itemStack, (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glass, 1L))); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.wool)) { return hardOverride( - 120000, - true, - itemStack, - new ItemStack(Items.string, 3), - new ItemStack(Items.string, 2)); + 120000, true, itemStack, new ItemStack(Items.string, 3), new ItemStack(Items.string, 2)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glowstone)) { return hardOverride( 120000, @@ -335,84 +331,111 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock new ItemStack(Items.pumpkin_seeds, 1)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.melon_block)) { return hardOverride( - 30000, - true, - itemStack, - new ItemStack(Items.melon_seeds, 2), - new ItemStack(Items.melon_seeds, 1)); + 30000, true, itemStack, new ItemStack(Items.melon_seeds, 2), new ItemStack(Items.melon_seeds, 1)); } - //null checks for GT shit - if (GT_OreDictUnificator.getAssociation(itemStack) == null || - GT_OreDictUnificator.getAssociation(itemStack).mPrefix == null || - GT_OreDictUnificator.getAssociation(itemStack).mMaterial == null || - GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial == null || - GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.getDust(1) == null - ) - return this.recipe_fallback(itemStack); //fallback for all non-unificated Items - - //Ore Unificator shit for balance - if (OrePrefixes.ingot.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.gem.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { + // null checks for GT shit + if (GT_OreDictUnificator.getAssociation(itemStack) == null + || GT_OreDictUnificator.getAssociation(itemStack).mPrefix == null + || GT_OreDictUnificator.getAssociation(itemStack).mMaterial == null + || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial == null + || GT_OreDictUnificator.getAssociation(itemStack) + .mMaterial + .mMaterial + .getDust(1) + == null) return this.recipe_fallback(itemStack); // fallback for all non-unificated Items + + // Ore Unificator shit for balance + if (OrePrefixes.ingot.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.gem.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { return hardOverride( 90000, false, itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); + (GT_OreDictUnificator.get( + OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); } else if (OrePrefixes.ore.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { return hardOverride( 120000, false, itemStack, - (GT_OreDictUnificator.get(OrePrefixes.crushed, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); + (GT_OreDictUnificator.get( + OrePrefixes.crushed, + GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, + 1L))); } else if (OrePrefixes.nugget.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { return hardOverride( 30000, false, itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dustTiny, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); + (GT_OreDictUnificator.get( + OrePrefixes.dustTiny, + GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, + 1L))); } else if (OrePrefixes.crushed.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { return hardOverride( 60000, false, itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dustImpure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); + (GT_OreDictUnificator.get( + OrePrefixes.dustImpure, + GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, + 1L))); } else if (OrePrefixes.crushedPurified.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { return hardOverride( 60000, false, itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dustPure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); + (GT_OreDictUnificator.get( + OrePrefixes.dustPure, + GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, + 1L))); } else if (OrePrefixes.crushedCentrifuged.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { return hardOverride( 60000, false, itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); + (GT_OreDictUnificator.get( + OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); } else if (OrePrefixes.block.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { return hardOverride( 120000, false, itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, (GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL)) ? 9L : 1L))); - } else if ( - OrePrefixes.stone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneChiseled.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneCobble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneCracked.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneMossy.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneMossyBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneSmooth.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.cobblestone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - ) { + (GT_OreDictUnificator.get( + OrePrefixes.dust, + GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, + (GT_OreDictUnificator.getAssociation(itemStack) + .mMaterial + .mMaterial + .mSubTags + .contains(SubTag.METAL) + || GT_OreDictUnificator.getAssociation(itemStack) + .mMaterial + .mMaterial + .mSubTags + .contains(SubTag.CRYSTAL)) + ? 9L + : 1L))); + } else if (OrePrefixes.stone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneChiseled.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneCobble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneCracked.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneMossy.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneMossyBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneSmooth.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.cobblestone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { return hardOverride( 120000, true, itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 2L)), - (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); + (GT_OreDictUnificator.get( + OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 2L)), + (GT_OreDictUnificator.get( + OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); } - return this.recipe_fallback(itemStack); //2nd fallback + return this.recipe_fallback(itemStack); // 2nd fallback } @Override @@ -433,7 +456,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock return false; } - public boolean setRotorBlock(TileEntity aTileEntity){ + public boolean setRotorBlock(TileEntity aTileEntity) { if (aTileEntity instanceof BW_RotorBlock) { this.rotorBlock = (BW_RotorBlock) aTileEntity; return true; @@ -444,12 +467,13 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @SuppressWarnings("ALL") @Override public boolean addOutput(ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack)) - return false; + if (GT_Utility.isStackInvalid(aStack)) return false; for (TileEntityDispenser tHatch : this.tileEntityDispensers) { for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) { - if (tHatch.getStackInSlot(i) == null || GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack) && aStack.stackSize + tHatch.getStackInSlot(i).stackSize <= 64) { + if (tHatch.getStackInSlot(i) == null + || GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack) + && aStack.stackSize + tHatch.getStackInSlot(i).stackSize <= 64) { if (GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack)) { ItemStack merge = tHatch.getStackInSlot(i).copy(); merge.stackSize = aStack.stackSize + tHatch.getStackInSlot(i).stackSize; @@ -479,11 +503,9 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock this.mDoor = 0; this.mHardenedClay = 0; - if(!checkPiece(STRUCTURE_PIECE_MAIN, 3, 11, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 3, 11, 0)) return false; - if (this.tileEntityDispensers.isEmpty() || this.mDoor > 2 || this.mHardenedClay < 40) - return false; + if (this.tileEntityDispensers.isEmpty() || this.mDoor > 2 || this.mHardenedClay < 40) return false; this.mWrench = true; this.mScrewdriver = true; @@ -495,13 +517,11 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock return true; } - @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { this.mProgresstime++; if (aBaseMetaTileEntity.isServerSide()) { - if (this.mEfficiency < 0) - this.mEfficiency = 0; + if (this.mEfficiency < 0) this.mEfficiency = 0; if (--this.mUpdate == 0 || --this.mStartUpCheck == 0 || this.mStructureChanged) { checkStructure(true, aBaseMetaTileEntity); this.mUpdate = 100; @@ -522,28 +542,29 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock this.mMaxProgresstime = 0; this.mEfficiencyIncrease = 0; if (aBaseMetaTileEntity.isAllowedToWork()) { - if (this.checkRecipe(this.mInventory[1])) - this.updateSlots(); + if (this.checkRecipe(this.mInventory[1])) this.updateSlots(); } } } } else { - if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) { + if (aTick % 100 == 0 + || aBaseMetaTileEntity.hasWorkJustBeenEnabled() + || aBaseMetaTileEntity.hasInventoryBeenModified()) { if (aBaseMetaTileEntity.isAllowedToWork()) { - if (this.checkRecipe(this.mInventory[1])) - this.updateSlots(); + if (this.checkRecipe(this.mInventory[1])) this.updateSlots(); } } } } else { - //this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); + // this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); return; } } else { this.stopMachine(); } } - aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (this.mMachine ? 0 : 64)); + aBaseMetaTileEntity.setErrorDisplayID( + (aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (this.mMachine ? 0 : 64)); aBaseMetaTileEntity.setActive(this.mMaxProgresstime > 0); } @@ -579,7 +600,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock return false; } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new GT_TileEntity_Windmill(this.mName); @@ -587,7 +607,12 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public String[] getInfoData() { - return new String[]{"Progress:", this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", this.rotorBlock.getGrindPower() + "KU/t"}; + return new String[] { + "Progress:", + this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", + "GrindPower:", + this.rotorBlock.getGrindPower() + "KU/t" + }; } @SideOnly(Side.CLIENT) @@ -628,12 +653,16 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock return new ResourceLocation(MainMod.MOD_ID + ":windmill_top"); } }; - - } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { ITexture[] ret = new ITexture[6]; @@ -655,7 +684,9 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock public boolean isClientSide() { if (this.getBaseMetaTileEntity().getWorld() != null) - return this.getBaseMetaTileEntity().getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; + return this.getBaseMetaTileEntity().getWorld().isRemote + ? FMLCommonHandler.instance().getSide() == Side.CLIENT + : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; } @@ -667,6 +698,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { if (mMachine) return -1; - return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 3, 11, 0, elementBudget, source, actor, false, true); + return survivialBuildPiece( + STRUCTURE_PIECE_MAIN, stackSize, 3, 11, 0, elementBudget, source, actor, false, true); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index ab03d1305c..3ab76bcef1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -22,6 +22,17 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.withChannel; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofCoil; + import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -46,6 +57,8 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.*; +import java.util.stream.Collectors; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; @@ -54,50 +67,65 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; -import java.util.*; -import java.util.stream.Collectors; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.withChannel; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofCoil; - -@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { +@Optional.Interface( + iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", + modid = "tectech", + striprefs = true) +public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlockBase + implements ISurvivalConstructable { private static final int CASING_INDEX = 11; - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape("main", createShape()) - .addElement('=', StructureElementAirNoHint.getInstance()) - .addElement('t', - buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) - .atLeast(OutputHatch.withAdder(GT_TileEntity_MegaBlastFurnace::addOutputHatchToTopList).withCount(t -> t.mPollutionOutputHatches.size())) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX) - ) - .addElement('m', Muffler.newAny(CASING_INDEX, 2)) - .addElement('C', withChannel("coil", ofCoil(GT_TileEntity_MegaBlastFurnace::setCoilLevel, GT_TileEntity_MegaBlastFurnace::getCoilLevel))) - .addElement('g', withChannel("glass", BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier))) - .addElement('b', buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) - .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, TTEnabledEnergyHatchElement.INSTANCE) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX) - ) - .build(); + private static final IStructureDefinition STRUCTURE_DEFINITION = + StructureDefinition.builder() + .addShape("main", createShape()) + .addElement('=', StructureElementAirNoHint.getInstance()) + .addElement( + 't', + buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) + .atLeast(OutputHatch.withAdder( + GT_TileEntity_MegaBlastFurnace::addOutputHatchToTopList) + .withCount(t -> t.mPollutionOutputHatches.size())) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX)) + .addElement('m', Muffler.newAny(CASING_INDEX, 2)) + .addElement( + 'C', + withChannel( + "coil", + ofCoil( + GT_TileEntity_MegaBlastFurnace::setCoilLevel, + GT_TileEntity_MegaBlastFurnace::getCoilLevel))) + .addElement( + 'g', + withChannel( + "glass", + BorosilicateGlass.ofBoroGlass( + (byte) 0, + (byte) 1, + Byte.MAX_VALUE, + (te, t) -> te.glasTier = t, + te -> te.glasTier))) + .addElement( + 'b', + buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) + .atLeast( + InputHatch, + OutputHatch, + InputBus, + OutputBus, + Maintenance, + TTEnabledEnergyHatchElement.INSTANCE) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX)) + .build(); private static String[][] createShape() { String[][] raw = new String[20][]; raw[0] = new String[15]; - String topCasing = "ttttttttttttttt"; + String topCasing = "ttttttttttttttt"; String mufflerLine = "tmmmmmmmmmmmmmt"; raw[0][0] = topCasing; for (int i = 1; i < 14; i++) { @@ -106,8 +134,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock raw[0][14] = topCasing; raw[1] = new String[15]; - String allGlass = "ggggggggggggggg"; - String allCoil = "gCCCCCCCCCCCCCg"; + String allGlass = "ggggggggggggggg"; + String allCoil = "gCCCCCCCCCCCCCg"; String middleLine = "gC===========Cg"; raw[1][0] = allGlass; raw[1][1] = allCoil; @@ -133,8 +161,11 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock private HeatingCoilLevel mCoilLevel; protected final ArrayList mPollutionOutputHatches = new ArrayList<>(); - protected final FluidStack[] pollutionFluidStacks = {Materials.CarbonDioxide.getGas(1000), - Materials.CarbonMonoxide.getGas(1000), Materials.SulfurDioxide.getGas(1000)}; + protected final FluidStack[] pollutionFluidStacks = { + Materials.CarbonDioxide.getGas(1000), + Materials.CarbonMonoxide.getGas(1000), + Materials.SulfurDioxide.getGas(1000) + }; private int mHeatingCapacity; private byte glasTier; private int polPtick = ConfigHandler.basePollutionMBFSecond / 20 * ConfigHandler.megaMachinesMax; @@ -161,7 +192,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") .addInfo("Each 900K over the min. Heat required reduces power consumption by 5% (multiplicatively)") .addInfo("Each 1800K over the min. Heat required grants one perfect overclock") - .addInfo("For each perfect overclock the EBF will reduce recipe time 4 times (instead of 2) (100% efficiency)") + .addInfo( + "For each perfect overclock the EBF will reduce recipe time 4 times (instead of 2) (100% efficiency)") .addInfo("Additionally gives +100K for every tier past MV") .addPollutionAmount(20 * getPollutionPerTick(null)) .addSeparator() @@ -200,38 +232,62 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { --circuitMode; - if (circuitMode < 0) - circuitMode = 24; + if (circuitMode < 0) circuitMode = 24; } else { ++circuitMode; - if (circuitMode > 24) - circuitMode = 0; + if (circuitMode > 24) circuitMode = 0; } - GT_Utility.sendChatToPlayer(aPlayer, circuitMode > 0 ? "MEBF will prioritise circuit: " + circuitMode : "Circuit prioritisation disabled."); + GT_Utility.sendChatToPlayer( + aPlayer, + circuitMode > 0 ? "MEBF will prioritise circuit: " + circuitMode : "Circuit prioritisation disabled."); } @Override - public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onWireCutterRightClick( + byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { isBussesSeparate = !isBussesSeparate; - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate); + GT_Utility.sendChatToPlayer( + aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate); return true; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{casingTexturePages[0][CASING_INDEX]}; + return new ITexture[] {casingTexturePages[0][CASING_INDEX]}; } @Override @@ -244,10 +300,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override public boolean addMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if(super.addMufflerToMachineList(aTileEntity, aBaseCasingIndex)) - { - if(mufflerTier == -1) - mufflerTier = this.mMufflerHatches.get(this.mMufflerHatches.size() - 1).mTier; + if (super.addMufflerToMachineList(aTileEntity, aBaseCasingIndex)) { + if (mufflerTier == -1) mufflerTier = this.mMufflerHatches.get(this.mMufflerHatches.size() - 1).mTier; return mufflerTier == this.mMufflerHatches.get(this.mMufflerHatches.size() - 1).mTier; } return false; @@ -270,22 +324,24 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock } protected boolean addBottomHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - return addMaintenanceToMachineList(aTileEntity, aBaseCasingIndex) || - addInputToMachineList(aTileEntity, aBaseCasingIndex) || - addOutputToMachineList(aTileEntity, aBaseCasingIndex) || - addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); + return addMaintenanceToMachineList(aTileEntity, aBaseCasingIndex) + || addInputToMachineList(aTileEntity, aBaseCasingIndex) + || addOutputToMachineList(aTileEntity, aBaseCasingIndex) + || addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png"); } @Override public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = null; FluidStack[] tFluids = this.getStoredFluids().toArray(new FluidStack[0]); - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + long nominalV = + LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); GT_Recipe tRecipe = null; @@ -302,27 +358,37 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock } } } - tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, tInputList.size()); - tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + tInputs = + Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, tInputList.size()); + tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe( + this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(false, tFluids, tInputs))) { break; } } } else { tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - if (circuitMode > 0 && Arrays.stream(tInputs).anyMatch(e -> GT_Utility.areStacksEqual(e, GT_Utility.getIntegratedCircuit(circuitMode), true))) { - List modInputs = Arrays.stream(tInputs).filter(Objects::nonNull).filter(e -> !e.getItem().equals(GT_Utility.getIntegratedCircuit(circuitMode).getItem())).collect(Collectors.toList()); + if (circuitMode > 0 + && Arrays.stream(tInputs) + .anyMatch(e -> + GT_Utility.areStacksEqual(e, GT_Utility.getIntegratedCircuit(circuitMode), true))) { + List modInputs = Arrays.stream(tInputs) + .filter(Objects::nonNull) + .filter(e -> !e.getItem() + .equals(GT_Utility.getIntegratedCircuit(circuitMode) + .getItem())) + .collect(Collectors.toList()); modInputs.add(GT_Utility.getIntegratedCircuit(circuitMode)); tInputs = modInputs.toArray(new ItemStack[0]); } - tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); + tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe( + this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); if (tRecipe == null) { - if (circuitMode == 0) - return false; + if (circuitMode == 0) return false; tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); - if (tRecipe == null) - return false; + tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe( + this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); + if (tRecipe == null) return false; } } @@ -353,19 +419,18 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock this.mEfficiencyIncrease = 10000; long actualEUT = precutRecipeVoltage * processed; - byte overclockCount = this.calculateOverclockedNessMultiInternal(actualEUT, tRecipe.mDuration, nominalV, false); + byte overclockCount = + this.calculateOverclockedNessMultiInternal(actualEUT, tRecipe.mDuration, nominalV, false); - //In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) - return false; + // In case recipe is too OP for that machine + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) return false; - if (this.lEUt > 0) - this.lEUt = (-this.lEUt); + if (this.lEUt > 0) this.lEUt = (-this.lEUt); if (tHeatCapacityDivTiers > 0) { - this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount); //extra free overclocking if possible - if (this.mMaxProgresstime < 1) - this.mMaxProgresstime = 1; //no eu efficiency correction + this.mMaxProgresstime >>= + Math.min(tHeatCapacityDivTiers / 2, overclockCount); // extra free overclocking if possible + if (this.mMaxProgresstime < 1) this.mMaxProgresstime = 1; // no eu efficiency correction } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); @@ -414,13 +479,11 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override public boolean addOutput(FluidStack aLiquid) { - if (aLiquid == null) - return false; + if (aLiquid == null) return false; FluidStack tLiquid = aLiquid.copy(); boolean isOutputPollution = false; for (FluidStack pollutionFluidStack : pollutionFluidStacks) { - if (!tLiquid.isFluidEqual(pollutionFluidStack)) - continue; + if (!tLiquid.isFluidEqual(pollutionFluidStack)) continue; isOutputPollution = true; break; @@ -430,8 +493,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock tOutputHatches = this.mPollutionOutputHatches; int pollutionReduction = 0; for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { - if (!isValidMetaTileEntity(tHatch)) - continue; + if (!isValidMetaTileEntity(tHatch)) continue; pollutionReduction = 100 - tHatch.calculatePollutionReduction(100); break; } @@ -439,11 +501,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock } else { tOutputHatches = this.mOutputHatches; } - return dumpFluid(tOutputHatches, tLiquid, true) || - dumpFluid(tOutputHatches, tLiquid, false); + return dumpFluid(tOutputHatches, tLiquid, true) || dumpFluid(tOutputHatches, tLiquid, false); } - @Override public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { if (LoaderReference.tectech) { @@ -459,24 +519,22 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock this.mPollutionOutputHatches.clear(); - if (!checkPiece("main", 7, 17, 0)) - return false; + if (!checkPiece("main", 7, 17, 0)) return false; - if (getCoilLevel() == HeatingCoilLevel.None) - return false; + if (getCoilLevel() == HeatingCoilLevel.None) return false; - if (mMaintenanceHatches.size() != 1) - return false; + if (mMaintenanceHatches.size() != 1) return false; if (LoaderReference.tectech && this.glasTier < 8) - if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) - return false; + if (!areLazorsLowPowa() + || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) + || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) return false; if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) - if (this.glasTier < hatchEnergy.mTier) - return false; - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + if (this.glasTier < hatchEnergy.mTier) return false; + long nominalV = + LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); this.mHeatingCapacity = (int) getCoilLevel().getHeat() + 100 * (BW_Util.getTier(nominalV) - 2); return true; @@ -487,8 +545,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock private boolean areThingsNotProperlyTiered(Collection collection) { if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) - if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) - return true; + if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; return false; } @@ -496,6 +553,4 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sBlastRecipes; } - - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index d24df3c587..1a9b1e7130 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -22,6 +22,15 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; + import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -44,25 +53,19 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.Collection; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.Collection; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; - -@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { +@Optional.Interface( + iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", + modid = "tectech", + striprefs = true) +public class GT_TileEntity_MegaChemicalReactor + extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { private byte glasTier; @@ -84,7 +87,7 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl .addInfo("The structure is too complex!") .addInfo("Follow the Structure Lib hologram projector to build the main structure.") .addSeparator() - .beginStructureBlock(5, 5, 9, false) + .beginStructureBlock(5, 5, 9, false) .addController("Front center") .addStructureInfo("46x Chemically Inert Machine Casing (minimum)") .addStructureInfo("7x Fusion Coil Block") @@ -92,11 +95,11 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl .addStructureInfo("64x Borosilicate Glass Block (any tier)") .addStructureInfo("The glass tier limits the Energy Input tier") .addEnergyHatch("Hint block ", 3) - .addMaintenanceHatch("Hint block ",2) - .addInputHatch("Hint block ",1) - .addInputBus("Hint block ",1) - .addOutputBus("Hint block ",1) - .addOutputHatch("Hint block ",1) + .addMaintenanceHatch("Hint block ", 2) + .addInputHatch("Hint block ", 1) + .addInputBus("Hint block ", 1) + .addOutputBus("Hint block ", 1) + .addOutputHatch("Hint block ", 1) .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -107,24 +110,47 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { - if (aActive) return new ITexture[]{ + if (aActive) + return new ITexture[] { + casingTexturePages[1][48], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { casingTexturePages[1][48], - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ - casingTexturePages[1][48], - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{casingTexturePages[1][48]}; + return new ITexture[] {casingTexturePages[1][48]}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeChemicalReactor.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeChemicalReactor.png"); } @Override @@ -139,11 +165,13 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl ArrayList outputItems = new ArrayList<>(); ArrayList outputFluids = new ArrayList<>(); - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + long nominalV = + LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.findRecipe( + this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); boolean found_Recipe = false; int processed = 0; @@ -164,9 +192,9 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl if (found_Recipe) { this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - long actualEUT = ((long)tRecipe.mEUt) * processed; + long actualEUT = ((long) tRecipe.mEUt) * processed; calculatePerfectOverclockedNessMulti(actualEUT, tRecipe.mDuration, nominalV); - //In case recipe is too OP for that machine + // In case recipe is too OP for that machine if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) { return false; } @@ -185,7 +213,7 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl @Override public void construct(ItemStack aStack, boolean aHintsOnly) { - buildPiece(STRUCTURE_PIECE_MAIN,aStack,aHintsOnly,2,2,0); + buildPiece(STRUCTURE_PIECE_MAIN, aStack, aHintsOnly, 2, 2, 0); } @Override @@ -194,7 +222,7 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 2, 2, 0, realBudget, source, actor, false, true); } -// -------------- TEC TECH COMPAT ---------------- + // -------------- TEC TECH COMPAT ---------------- @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { @@ -204,54 +232,54 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl this.getTecTechEnergyTunnels().clear(); } - if(!checkPiece(STRUCTURE_PIECE_MAIN,2,2,0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 0)) return false; - if(mMaintenanceHatches.size() != 1) - return false; + if (mMaintenanceHatches.size() != 1) return false; if (LoaderReference.tectech && this.glasTier < 8) - if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) - return false; + if (!areLazorsLowPowa() + || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) + || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) return false; if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) - if (this.glasTier < hatchEnergy.mTier) - return false; - + if (this.glasTier < hatchEnergy.mTier) return false; return true; } - - private static final int CASING_INDEX = 176; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd","ttttt"}, - {"tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet"}, - {"tg~gt", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", "teret"}, - {"tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet"}, - {"ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd","ttttt"}, - })) - .addElement('p', ofBlock(GregTech_API.sBlockCasings8, 1)) - .addElement('t', ofBlock(GregTech_API.sBlockCasings8, 0)) - .addElement('d', buildHatchAdder(GT_TileEntity_MegaChemicalReactor.class) - .atLeast(InputBus, InputHatch, OutputBus, OutputHatch) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(GregTech_API.sBlockCasings8, 0) - ) - .addElement('r', Maintenance.newAny(CASING_INDEX, 2)) - .addElement('e', ofChain( - TTEnabledEnergyHatchElement.INSTANCE.newAny(CASING_INDEX, 3), - ofBlock(GregTech_API.sBlockCasings8, 0) - )) - .addElement('c', ofBlock(GregTech_API.sBlockCasings4, 7)) - .addElement('g', BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) - .build(); - + private static final IStructureDefinition STRUCTURE_DEFINITION = + StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {"ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "ttttt"}, + {"tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet"}, + {"tg~gt", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", "teret"}, + {"tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet"}, + {"ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "ttttt"}, + })) + .addElement('p', ofBlock(GregTech_API.sBlockCasings8, 1)) + .addElement('t', ofBlock(GregTech_API.sBlockCasings8, 0)) + .addElement( + 'd', + buildHatchAdder(GT_TileEntity_MegaChemicalReactor.class) + .atLeast(InputBus, InputHatch, OutputBus, OutputHatch) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings8, 0)) + .addElement('r', Maintenance.newAny(CASING_INDEX, 2)) + .addElement( + 'e', + ofChain( + TTEnabledEnergyHatchElement.INSTANCE.newAny(CASING_INDEX, 3), + ofBlock(GregTech_API.sBlockCasings8, 0))) + .addElement('c', ofBlock(GregTech_API.sBlockCasings4, 7)) + .addElement( + 'g', + BorosilicateGlass.ofBoroGlass( + (byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) + .build(); @Override public IStructureDefinition getStructureDefinition() { @@ -263,9 +291,7 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl private boolean areThingsNotProperlyTiered(Collection collection) { if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) - if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) - return true; + if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; return false; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index e07aa62364..0a6154d086 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -22,6 +22,15 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -46,26 +55,20 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.List; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.List; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; - -@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { +@Optional.Interface( + iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", + modid = "tectech", + striprefs = true) +public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlockBase + implements ISurvivalConstructable { protected static final int CASING_INDEX = 49; protected static final String STRUCTURE_PIECE_BASE = "base"; protected static final String STRUCTURE_PIECE_LAYER = "layer"; @@ -73,72 +76,261 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock private static final IStructureDefinition STRUCTURE_DEFINITION; static { - IHatchElement layeredOutputHatch = OutputHatch - .withCount(GT_TileEntity_MegaDistillTower::getCurrentLayerOutputHatchCount) - .withAdder(GT_TileEntity_MegaDistillTower::addLayerOutputHatch); + IHatchElement layeredOutputHatch = OutputHatch.withCount( + GT_TileEntity_MegaDistillTower::getCurrentLayerOutputHatchCount) + .withAdder(GT_TileEntity_MegaDistillTower::addLayerOutputHatch); STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][]{ - {"bbbbbbb~bbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb"}, - })) - .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][]{ - {"lllllllllllllll", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lllllllllllllll"}, - {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, - {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, - {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, - {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, - })) - .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][]{ - {"lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll"}, - {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, - {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, - {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, - {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, - })) - .addElement('=', StructureElementAirNoHint.getInstance()) - .addElement('b', buildHatchAdder(GT_TileEntity_MegaDistillTower.class) - .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, TTEnabledEnergyHatchElement.INSTANCE) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(onElementPass(GT_TileEntity_MegaDistillTower::onCasingFound, ofBlock(GregTech_API.sBlockCasings4, 1))) - ) - .addElement('l', buildHatchAdder(GT_TileEntity_MegaDistillTower.class) - .atLeast(layeredOutputHatch, Maintenance, TTEnabledEnergyHatchElement.INSTANCE) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(onElementPass(GT_TileEntity_MegaDistillTower::onCasingFound, ofBlock(GregTech_API.sBlockCasings4, 1))) - ) - .addElement('c', (IStructureElementCheckOnly) (t, world, x, y, z) -> { - if (world.isAirBlock(x, y, z)) { - if (t.mTopState < 1) { - t.mTopState = 0; - return true; + .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] { + { + "bbbbbbb~bbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb" + }, + })) + .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] { + { + "lllllllllllllll", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lllllllllllllll" + }, + { + "lllllllllllllll", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "lllllllllllllll" + }, + { + "lllllllllllllll", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "lllllllllllllll" + }, + { + "lllllllllllllll", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "lllllllllllllll" + }, + { + "lllllllllllllll", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "lllllllllllllll" + }, + })) + .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][] { + { + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll" + }, + { + "lllllllllllllll", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "lllllllllllllll" + }, + { + "lllllllllllllll", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "lllllllllllllll" + }, + { + "lllllllllllllll", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "lllllllllllllll" + }, + { + "lllllllllllllll", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "lllllllllllllll" + }, + })) + .addElement('=', StructureElementAirNoHint.getInstance()) + .addElement( + 'b', + buildHatchAdder(GT_TileEntity_MegaDistillTower.class) + .atLeast( + InputHatch, + OutputHatch, + InputBus, + OutputBus, + Maintenance, + TTEnabledEnergyHatchElement.INSTANCE) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(onElementPass( + GT_TileEntity_MegaDistillTower::onCasingFound, + ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement( + 'l', + buildHatchAdder(GT_TileEntity_MegaDistillTower.class) + .atLeast(layeredOutputHatch, Maintenance, TTEnabledEnergyHatchElement.INSTANCE) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(onElementPass( + GT_TileEntity_MegaDistillTower::onCasingFound, + ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement('c', (IStructureElementCheckOnly) (t, world, x, y, z) -> { + if (world.isAirBlock(x, y, z)) { + if (t.mTopState < 1) { + t.mTopState = 0; + return true; + } + // definitely top - cannot be air + return false; } - // definitely top - cannot be air - return false; - } - // from here on we must be looking at a top layer, since it's not air - if (t.mTopState == 0) - // must be air but failed, so no - return false; - t.mTopState = 1; - // hatch adder - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity instanceof IGregTechTileEntity) { - IGregTechTileEntity entity = (IGregTechTileEntity) tileEntity; - if (t.addLayerOutputHatch(entity, CASING_INDEX)) { - t.onTopLayerFound(false); + // from here on we must be looking at a top layer, since it's not air + if (t.mTopState == 0) + // must be air but failed, so no + return false; + t.mTopState = 1; + // hatch adder + TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity instanceof IGregTechTileEntity) { + IGregTechTileEntity entity = (IGregTechTileEntity) tileEntity; + if (t.addLayerOutputHatch(entity, CASING_INDEX)) { + t.onTopLayerFound(false); + return true; + } + } + // block adder + if (world.getBlock(x, y, z) == GregTech_API.sBlockCasings4 + && world.getBlockMetadata(x, y, z) == 1) { + t.onTopLayerFound(true); return true; + } else { + return false; } - } - // block adder - if (world.getBlock(x, y, z) == GregTech_API.sBlockCasings4 && world.getBlockMetadata(x, y, z) == 1) { - t.onTopLayerFound(true); - return true; - } else { - return false; - } - }) - .build(); + }) + .build(); } protected final List> mOutputHatchesByLayer = new ArrayList<>(); @@ -167,14 +359,16 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } protected int getCurrentLayerOutputHatchCount() { - return mOutputHatchesByLayer.size() < mHeight ? 0 : mOutputHatchesByLayer.get(mHeight - 1).size(); + return mOutputHatchesByLayer.size() < mHeight + ? 0 + : mOutputHatchesByLayer.get(mHeight - 1).size(); } protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null || aTileEntity.isDead() || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) - return false; - while (mOutputHatchesByLayer.size() < mHeight) - mOutputHatchesByLayer.add(new ArrayList<>()); + if (aTileEntity == null + || aTileEntity.isDead() + || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) return false; + while (mOutputHatchesByLayer.size() < mHeight) mOutputHatchesByLayer.add(new ArrayList<>()); GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity(); tHatch.updateTexture(aBaseCasingIndex); return mOutputHatchesByLayer.get(mHeight - 1).add(tHatch); @@ -182,29 +376,51 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock protected void onTopLayerFound(boolean aIsCasing) { mTopLayerFound = true; - if (aIsCasing) - onCasingFound(); + if (aIsCasing) onCasingFound(); } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DistillationTower.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DistillationTower.png"); } @Override @@ -252,18 +468,18 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock mTopState = -1; // check base - if (!checkPiece(STRUCTURE_PIECE_BASE, 7, 0, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_BASE, 7, 0, 0)) return false; // check each layer while (mHeight < 12 && checkPiece(STRUCTURE_PIECE_LAYER, 7, mHeight * 5, 0) && !mTopLayerFound) { - if (mOutputHatchesByLayer.size() < mHeight || mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) - // layer without output hatch - return false; - mTopState = -1; - // not top - mHeight++; - } + if (mOutputHatchesByLayer.size() < mHeight + || mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) + // layer without output hatch + return false; + mTopState = -1; + // not top + mHeight++; + } // validate final invariants... return mCasing >= 75 * mHeight + 10 && mHeight >= 2 && mTopLayerFound && mMaintenanceHatches.size() == 1; @@ -284,16 +500,19 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock if (mMachine) return -1; int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); mHeight = 0; - int built = survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 1, 0, 0, realBudget, source, actor, false, true); + int built = + survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 1, 0, 0, realBudget, source, actor, false, true); if (built >= 0) return built; int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height for (int i = 1; i < tTotalHeight - 1; i++) { mHeight = i; - built = survivialBuildPiece(STRUCTURE_PIECE_LAYER, stackSize, 1, i, 0, realBudget, source, actor, false, true); + built = survivialBuildPiece( + STRUCTURE_PIECE_LAYER, stackSize, 1, i, 0, realBudget, source, actor, false, true); if (built >= 0) return built; } mHeight = tTotalHeight; - return survivialBuildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, 1, tTotalHeight - 1, 0, realBudget, source, actor, false, true); + return survivialBuildPiece( + STRUCTURE_PIECE_TOP_HINT, stackSize, 1, tTotalHeight - 1, 0, realBudget, source, actor, false, true); } @Override @@ -315,7 +534,8 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } } - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + long nominalV = + LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(0, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); @@ -326,12 +546,13 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock Pair, ArrayList> Outputs; int processed = 0; boolean found_Recipe = false; - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(this.getBaseMetaTileEntity(), false, GT_Values.V[tTier], new FluidStack[]{tFluid}, tItems); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe( + this.getBaseMetaTileEntity(), false, GT_Values.V[tTier], new FluidStack[] {tFluid}, tItems); if (tRecipe != null) { found_Recipe = true; long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); - int tCurrentPara = handleParallelRecipe(tRecipe, new FluidStack[]{tFluid}, null, (int) tMaxPara); + int tCurrentPara = handleParallelRecipe(tRecipe, new FluidStack[] {tFluid}, null, (int) tMaxPara); this.updateSlots(); processed = tCurrentPara; Outputs = getMultiOutput(tRecipe, tCurrentPara); @@ -339,24 +560,20 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock outputItems = Outputs.getValue(); } - if (!found_Recipe) - continue; + if (!found_Recipe) continue; this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - long actualEUT = ((long)tRecipe.mEUt) * processed; + long actualEUT = ((long) tRecipe.mEUt) * processed; calculateOverclockedNessMulti(actualEUT, tRecipe.mDuration, nominalV); - //In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) - return false; + // In case recipe is too OP for that machine + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) return false; if (this.lEUt > 0) { this.lEUt = (-this.lEUt); } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputFluids = outputFluids.toArray(new FluidStack[0]); - if (!outputItems.isEmpty()) - this.mOutputItems = outputItems.toArray(new ItemStack[0]); - else - this.mOutputItems = null; + if (!outputItems.isEmpty()) this.mOutputItems = outputItems.toArray(new ItemStack[0]); + else this.mOutputItems = null; return true; } } @@ -371,5 +588,4 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock dumpFluid(mOutputHatchesByLayer.get(i), tStack, false); } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java index 8af3ff320d..7cd9595d00 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java @@ -1,5 +1,8 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import static gregtech.api.enums.GT_HatchElement.Energy; +import static gregtech.api.enums.GT_Values.V; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -19,6 +22,10 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.*; import gregtech.api.util.GT_Utility; import gregtech.api.util.IGT_HatchAdder; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.function.Consumer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -28,16 +35,12 @@ import net.minecraft.util.IChatComponent; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.function.Consumer; - -import static gregtech.api.enums.GT_HatchElement.Energy; -import static gregtech.api.enums.GT_Values.V; - -@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public abstract class GT_TileEntity_MegaMultiBlockBase> extends GT_MetaTileEntity_EnhancedMultiBlockBase implements TecTechEnabledMulti { +@Optional.Interface( + iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", + modid = "tectech", + striprefs = true) +public abstract class GT_TileEntity_MegaMultiBlockBase> + extends GT_MetaTileEntity_EnhancedMultiBlockBase implements TecTechEnabledMulti { protected GT_TileEntity_MegaMultiBlockBase(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -77,8 +80,7 @@ public abstract class GT_TileEntity_MegaMultiBlockBase Integer.MAX_VALUE - 1) { - //make impossible if too long + // make impossible if too long this.lEUt = Integer.MAX_VALUE - 1; this.mMaxProgresstime = Integer.MAX_VALUE - 1; } else { @@ -198,49 +204,48 @@ public abstract class GT_TileEntity_MegaMultiBlockBase>= perfectOC ? 2 : 1;//this is effect of overclocking - xEUt = this.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power + tempEUt <<= 2; // this actually controls overclocking + // xEUt *= 4;//this is effect of everclocking + this.mMaxProgresstime >>= perfectOC ? 2 : 1; // this is effect of overclocking + xEUt = this.mMaxProgresstime <= 0 + ? xEUt >> 1 + : xEUt << 2; // U know, if the time is less than 1 tick make the machine use less power overclockCount++; } - while (xEUt > maxInputVoltage && xEUt >= aEUt){ - //downclock one notch until we are good again, we have overshot. + while (xEUt > maxInputVoltage && xEUt >= aEUt) { + // downclock one notch until we are good again, we have overshot. xEUt >>= 2; this.mMaxProgresstime <<= perfectOC ? 2 : 1; overclockCount--; } - if (xEUt < aEUt){ + if (xEUt < aEUt) { xEUt <<= 2; this.mMaxProgresstime >>= perfectOC ? 2 : 1; overclockCount++; } this.lEUt = xEUt; - if (this.lEUt == 0) - this.lEUt = 1; - if (this.mMaxProgresstime <= 0) - this.mMaxProgresstime = 1;//set time to 1 tick + if (this.lEUt == 0) this.lEUt = 1; + if (this.mMaxProgresstime <= 0) this.mMaxProgresstime = 1; // set time to 1 tick } return overclockCount; } - - protected void calculateOverclockedNessMulti(long aEUt, int aDuration, long maxInputVoltage){ + protected void calculateOverclockedNessMulti(long aEUt, int aDuration, long maxInputVoltage) { calculateOverclockedNessMultiInternal(aEUt, aDuration, maxInputVoltage, false); } - protected void calculatePerfectOverclockedNessMulti(long aEUt, int aDuration, long maxInputVoltage){ + protected void calculatePerfectOverclockedNessMulti(long aEUt, int aDuration, long maxInputVoltage) { calculateOverclockedNessMultiInternal(aEUt, aDuration, maxInputVoltage, true); } @@ -248,11 +253,9 @@ public abstract class GT_TileEntity_MegaMultiBlockBase 0) { - this.addEnergyOutput(this.lEUt * (long)this.mEfficiency / 10000L); + this.addEnergyOutput(this.lEUt * (long) this.mEfficiency / 10000L); return true; - } else if (this.lEUt < 0 && !this.drainEnergyInput((-this.lEUt) * 10000L / (long)Math.max(1000, this.mEfficiency))) { + } else if (this.lEUt < 0 + && !this.drainEnergyInput((-this.lEUt) * 10000L / (long) Math.max(1000, this.mEfficiency))) { this.stopMachine(); return false; } else { @@ -318,10 +320,9 @@ public abstract class GT_TileEntity_MegaMultiBlockBase> mteClasses; static { - ImmutableList.Builder> builder = ImmutableList.>builder() - .addAll(Energy.mteClasses()); - if (LoaderReference.tectech) - builder.add(GT_MetaTileEntity_Hatch_EnergyMulti.class); + ImmutableList.Builder> builder = + ImmutableList.>builder().addAll(Energy.mteClasses()); + if (LoaderReference.tectech) builder.add(GT_MetaTileEntity_Hatch_EnergyMulti.class); mteClasses = builder.build(); } @@ -343,11 +344,14 @@ public abstract class GT_TileEntity_MegaMultiBlockBase implements IStructureElement { private static final StructureElementAirNoHint INSTANCE = new StructureElementAirNoHint<>(); + @SuppressWarnings("unchecked") public static IStructureElement getInstance() { return (IStructureElement) INSTANCE; } + private StructureElementAirNoHint() {} + @Override public boolean check(T o, World world, int x, int y, int z) { return world.isAirBlock(x, y, z); @@ -355,9 +359,10 @@ public abstract class GT_TileEntity_MegaMultiBlockBase chatter) { + public PlaceResult survivalPlaceBlock( + T o, + World world, + int x, + int y, + int z, + ItemStack trigger, + IItemSource s, + EntityPlayerMP actor, + Consumer chatter) { if (check(o, world, x, y, z)) return PlaceResult.SKIP; if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, actor)) return PlaceResult.REJECT; world.setBlock(x, y, z, Blocks.air, 0, 2); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index f0885a48f6..3d3babc9cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -22,6 +22,16 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_HatchElement.InputHatch; +import static gregtech.api.enums.GT_HatchElement.Maintenance; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.*; + import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -47,57 +57,134 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_HatchElement.InputHatch; -import static gregtech.api.enums.GT_HatchElement.Maintenance; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.*; - -@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { +@Optional.Interface( + iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", + modid = "tectech", + striprefs = true) +public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBase + implements ISurvivalConstructable { private static final int CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {" p p ", "ppgggggggggpp", " pgggggggggp ", " pgggpppgggp ", " pgggpMpgggp ", " pgggpppgggp ", " pgggggggggp ", "ppgggggggggpp", " p p "}, - {" p p ", "pgggggggggggp", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", "pgggggggggggp", " p p "}, - {" p p ", "pgggggggggggp", " g c c c c g ", " p c c p ", " p c c c c p ", " p c c p ", " g c c c c g ", "pgggggggggggp", " p p "}, - {" p p ", "pgggggggggggp", " g c c c c g ", " p c c c c p ", " l c c c c r ", " p c c c c p ", " g c c c c g ", "pgggggggggggp", " p p "}, - {" p p ", "pgggggggggggp", " g c c c c g ", " p c c p ", " p c c c c p ", " p c c p ", " g c c c c g ", "pgggggggggggp", " p p "}, - {" p p ", "pgggggggggggp", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", "pgggggggggggp", " p p "}, - {"ppmmmm~mmmmpp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppmmmmmmmmmpp"}, - - })) - .addElement('c', ofCoil(GT_TileEntity_MegaOilCracker::setCoilLevel, GT_TileEntity_MegaOilCracker::getCoilLevel)) - .addElement('p', ofBlock(GregTech_API.sBlockCasings4, 1)) - .addElement('l', ofChain( // TODO figure out what to do with this - ofHatchAdder(GT_TileEntity_MegaOilCracker::addLeftHatchToMachineList, CASING_INDEX, 2) - )) - .addElement('r', ofChain( - ofHatchAdder(GT_TileEntity_MegaOilCracker::addRightHatchToMachineList, CASING_INDEX, 3) - )) - .addElement('m', buildHatchAdder(GT_TileEntity_MegaOilCracker.class) - .atLeast(TTEnabledEnergyHatchElement.INSTANCE, Maintenance) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(GregTech_API.sBlockCasings4, 1) - ) - .addElement('M', InputHatch.withAdder(GT_TileEntity_MegaOilCracker::addMiddleInputToMachineList).newAny(CASING_INDEX, 4)) - .addElement('g', BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) - .build(); + private static final IStructureDefinition STRUCTURE_DEFINITION = + StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + { + " p p ", + "ppgggggggggpp", + " pgggggggggp ", + " pgggpppgggp ", + " pgggpMpgggp ", + " pgggpppgggp ", + " pgggggggggp ", + "ppgggggggggpp", + " p p " + }, + { + " p p ", + "pgggggggggggp", + " g c c c c g ", + " g c c c c g ", + " g c c c c g ", + " g c c c c g ", + " g c c c c g ", + "pgggggggggggp", + " p p " + }, + { + " p p ", + "pgggggggggggp", + " g c c c c g ", + " p c c p ", + " p c c c c p ", + " p c c p ", + " g c c c c g ", + "pgggggggggggp", + " p p " + }, + { + " p p ", + "pgggggggggggp", + " g c c c c g ", + " p c c c c p ", + " l c c c c r ", + " p c c c c p ", + " g c c c c g ", + "pgggggggggggp", + " p p " + }, + { + " p p ", + "pgggggggggggp", + " g c c c c g ", + " p c c p ", + " p c c c c p ", + " p c c p ", + " g c c c c g ", + "pgggggggggggp", + " p p " + }, + { + " p p ", + "pgggggggggggp", + " g c c c c g ", + " g c c c c g ", + " g c c c c g ", + " g c c c c g ", + " g c c c c g ", + "pgggggggggggp", + " p p " + }, + { + "ppmmmm~mmmmpp", + "ppppppppppppp", + "ppppppppppppp", + "ppppppppppppp", + "ppppppppppppp", + "ppppppppppppp", + "ppppppppppppp", + "ppppppppppppp", + "ppmmmmmmmmmpp" + }, + })) + .addElement( + 'c', + ofCoil( + GT_TileEntity_MegaOilCracker::setCoilLevel, + GT_TileEntity_MegaOilCracker::getCoilLevel)) + .addElement('p', ofBlock(GregTech_API.sBlockCasings4, 1)) + .addElement( + 'l', + ofChain( // TODO figure out what to do with this + ofHatchAdder( + GT_TileEntity_MegaOilCracker::addLeftHatchToMachineList, CASING_INDEX, 2))) + .addElement( + 'r', + ofChain(ofHatchAdder( + GT_TileEntity_MegaOilCracker::addRightHatchToMachineList, CASING_INDEX, 3))) + .addElement( + 'm', + buildHatchAdder(GT_TileEntity_MegaOilCracker.class) + .atLeast(TTEnabledEnergyHatchElement.INSTANCE, Maintenance) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings4, 1)) + .addElement( + 'M', + InputHatch.withAdder(GT_TileEntity_MegaOilCracker::addMiddleInputToMachineList) + .newAny(CASING_INDEX, 4)) + .addElement( + 'g', + BorosilicateGlass.ofBoroGlass( + (byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) + .build(); private byte glasTier; private HeatingCoilLevel heatLevel; protected final List mMiddleInputHatches = new ArrayList<>(); @@ -129,11 +216,11 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa .addController("Front bottom") .addStructureInfo("The glass tier limits the Energy Input tier") .addInfo("Gets 10% EU/t reduction per coil tier, up to a maximum of 50%") - .addEnergyHatch("Hint block",1) - .addMaintenanceHatch("Hint block",1) - .addInputHatch("Hint block",2,3) - .addOutputHatch("Hint block",2,3) - .addInputHatch("Steam/Hydrogen ONLY, Hint block",4) + .addEnergyHatch("Hint block", 1) + .addMaintenanceHatch("Hint block", 1) + .addInputHatch("Hint block", 2, 3) + .addOutputHatch("Hint block", 2, 3) + .addInputHatch("Steam/Hydrogen ONLY, Hint block", 4) .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -144,24 +231,49 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { - if (aActive) return new ITexture[]{casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW).extFacing().glow().build()}; + if (aActive) + return new ITexture[] { + casingTexturePages[0][CASING_INDEX], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + casingTexturePages[0][CASING_INDEX], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{casingTexturePages[0][CASING_INDEX]}; + return new ITexture[] {casingTexturePages[0][CASING_INDEX]}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "OilCrackingUnit.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "OilCrackingUnit.png"); } - @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sCrackingRecipes; @@ -174,17 +286,18 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa ArrayList outputItems = new ArrayList<>(); ArrayList outputFluids = new ArrayList<>(); - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + long nominalV = + LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); - GT_Recipe tRecipe = getRecipeMap().findRecipe( - getBaseMetaTileEntity(), - false, - gregtech.api.enums.GT_Values.V[tTier], - tInputFluids, - mInventory[1] - ); + GT_Recipe tRecipe = getRecipeMap() + .findRecipe( + getBaseMetaTileEntity(), + false, + gregtech.api.enums.GT_Values.V[tTier], + tInputFluids, + mInventory[1]); boolean found_Recipe = false; int processed = 0; @@ -208,15 +321,14 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa this.mEfficiencyIncrease = 10000; long actualEUT = (long) (tRecipe.mEUt) * processed; calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, nominalV); - //In case recipe is too OP for that machine + // In case recipe is too OP for that machine if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) { return false; } if (this.getCoilLevel().getTier() < 5) { this.lEUt *= 1 - (0.1D * (this.getCoilLevel().getTier() + 1)); - } - else { + } else { this.lEUt *= 0.5; } @@ -243,7 +355,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa @Override public void construct(ItemStack aStack, boolean aHintsOnly) { - buildPiece(STRUCTURE_PIECE_MAIN,aStack,aHintsOnly,6,6,0); + buildPiece(STRUCTURE_PIECE_MAIN, aStack, aHintsOnly, 6, 6, 0); } @Override @@ -263,22 +375,20 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa this.getTecTechEnergyTunnels().clear(); } - if(!checkPiece(STRUCTURE_PIECE_MAIN,6,6,0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 6, 6, 0)) return false; - if(mMaintenanceHatches.size() != 1) - return false; + if (mMaintenanceHatches.size() != 1) return false; if (LoaderReference.tectech && this.glasTier < 8) - if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) - return false; + if (!areLazorsLowPowa() + || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) + || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) return false; if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) - if (this.glasTier < hatchEnergy.mTier) - return false; + if (this.glasTier < hatchEnergy.mTier) return false; - return true; + return true; } private boolean addLeftHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { @@ -290,7 +400,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa return false; } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - if (mInputOnSide == 1){ + if (mInputOnSide == 1) { return false; } mInputOnSide = 0; @@ -301,7 +411,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa return mInputHatches.add(tHatch); } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - if (mOutputOnSide == 1){ + if (mOutputOnSide == 1) { return false; } mInputOnSide = 1; @@ -322,7 +432,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa return false; } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - if (mInputOnSide == 0){ + if (mInputOnSide == 0) { return false; } mInputOnSide = 1; @@ -333,7 +443,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa return mInputHatches.add(tHatch); } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - if (mOutputOnSide == 0){ + if (mOutputOnSide == 0) { return false; } mInputOnSide = 0; @@ -395,10 +505,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa private boolean areThingsNotProperlyTiered(Collection collection) { if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) - if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) - return true; + if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; return false; } - - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index e252a7e10e..93f6cf6aa3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -22,6 +22,15 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -41,24 +50,18 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; - -@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { +@Optional.Interface( + iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", + modid = "tectech", + striprefs = true) +public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBlockBase + implements ISurvivalConstructable { public GT_TileEntity_MegaVacuumFreezer(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -77,51 +80,299 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc private static final int CASING_INDEX = 17; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccc~ccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc"} - })) - .addElement('=', StructureElementAirNoHint.getInstance()) - .addElement('c', buildHatchAdder(GT_TileEntity_MegaVacuumFreezer.class) - .atLeast(TTEnabledEnergyHatchElement.INSTANCE, InputHatch, InputBus, OutputHatch, OutputBus, Maintenance) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings2, 1))) - ) - .build(); - + private static final IStructureDefinition STRUCTURE_DEFINITION = + StructureDefinition.builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + { + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccc~ccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc" + } + })) + .addElement('=', StructureElementAirNoHint.getInstance()) + .addElement( + 'c', + buildHatchAdder(GT_TileEntity_MegaVacuumFreezer.class) + .atLeast( + TTEnabledEnergyHatchElement.INSTANCE, + InputHatch, + InputBus, + OutputHatch, + OutputBus, + Maintenance) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain( + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings2, 1)))) + .build(); @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Vacuum Freezer"). - addInfo("Controller Block for the Mega Vacuum Freezer"). - addInfo("Cools hot ingots and cells"). - addSeparator(). - beginStructureBlock(15, 15, 15, true). - addController("Front center"). - addCasingInfo("Frost Proof Machine Casing", 900). - addEnergyHatch("Any casing", 1). - addMaintenanceHatch("Any casing", 1). - addInputHatch("Any casing", 1). - addOutputHatch("Any casing", 1). - addInputBus("Any casing", 1). - addOutputBus("Any casing", 1). - toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + tt.addMachineType("Vacuum Freezer") + .addInfo("Controller Block for the Mega Vacuum Freezer") + .addInfo("Cools hot ingots and cells") + .addSeparator() + .beginStructureBlock(15, 15, 15, true) + .addController("Front center") + .addCasingInfo("Frost Proof Machine Casing", 900) + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addInputHatch("Any casing", 1) + .addOutputHatch("Any casing", 1) + .addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1) + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -149,7 +400,8 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png"); } @Override @@ -159,11 +411,13 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc ArrayList outputItems = new ArrayList<>(); ArrayList outputFluids = new ArrayList<>(); - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + long nominalV = + LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe( + this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); boolean found_Recipe = false; int processed = 0; @@ -184,9 +438,8 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc this.mEfficiencyIncrease = 10000; long actualEUT = (long) (tRecipe.mEUt) * processed; calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, nominalV); - //In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) - return false; + // In case recipe is too OP for that machine + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) return false; if (this.lEUt > 0) { this.lEUt = (-this.lEUt); } @@ -200,8 +453,6 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc return false; } - - // -------------- TEC TECH COMPAT ---------------- @Override @@ -211,34 +462,55 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc this.getTecTechEnergyTunnels().clear(); } this.mCasing = 0; - if(!checkPiece(STRUCTURE_PIECE_MAIN, 7, 7, 0)) - return false; - return - this.mMaintenanceHatches.size() == 1 && - (LoaderReference.tectech ? - (!this.getTecTechEnergyMultis().isEmpty() || !this.getTecTechEnergyTunnels().isEmpty() || !this.mEnergyHatches.isEmpty()) : - !this.mEnergyHatches.isEmpty()) && - this.mCasing >= 900; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 7, 7, 0)) return false; + return this.mMaintenanceHatches.size() == 1 + && (LoaderReference.tectech + ? (!this.getTecTechEnergyMultis().isEmpty() + || !this.getTecTechEnergyTunnels().isEmpty() + || !this.mEnergyHatches.isEmpty()) + : !this.mEnergyHatches.isEmpty()) + && this.mCasing >= 900; } - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { ITexture[] rTexture; if (aSide == aFacing) { if (aActive) { - rTexture = new ITexture[]{ + rTexture = new ITexture[] { casingTexturePages[0][17], - TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; } else { - rTexture = new ITexture[]{ + rTexture = new ITexture[] { casingTexturePages[0][17], - TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_GLOW) + .extFacing() + .glow() + .build() + }; } } else { - rTexture = new ITexture[]{casingTexturePages[0][17]}; + rTexture = new ITexture[] {casingTexturePages[0][17]}; } return rTexture; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index e22641040f..044a53105b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -37,8 +37,9 @@ import net.minecraft.util.StatCollector; public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGenerator { - public GT_MetaTileEntity_AcidGenerator(int aID, String aName, String aNameRegional, int aTier, ITexture... aTextures) { - super(aID, aName, aNameRegional, aTier, new String[]{}, aTextures); + public GT_MetaTileEntity_AcidGenerator( + int aID, String aName, String aNameRegional, int aTier, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, new String[] {}, aTextures); } public GT_MetaTileEntity_AcidGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { @@ -66,43 +67,81 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene } public ITexture[] getFront(byte aColor) { - return new ITexture[]{super.getFront(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[] { + super.getFront(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] + }; } public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[] { + super.getBack(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) + }; } public ITexture[] getBottom(byte aColor) { - return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[] { + super.getBottom(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) + }; } public ITexture[] getTop(byte aColor) { - return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")).glow().build()}; + return new ITexture[] { + super.getTop(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")) + .glow() + .build() + }; } public ITexture[] getSides(byte aColor) { - return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[] { + super.getSides(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) + }; } public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{super.getFrontActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[] { + super.getFrontActive(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] + }; } public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{super.getBackActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[] { + super.getBackActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) + }; } public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{super.getBottomActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[] { + super.getBottomActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) + }; } public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{super.getTopActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")).glow().build()}; + return new ITexture[] { + super.getTopActive(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), + TextureFactory.of( + new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")) + .glow() + .build() + }; } public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{super.getSidesActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[] { + super.getSidesActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) + }; } public boolean isOutputFacing(byte aSide) { @@ -110,6 +149,16 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene } public String[] getDescription() { - return new String[]{StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + ChatColorHelper.YELLOW + this.getEfficiency(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; + return new String[] { + StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), + StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + + GT_Values.V[this.mTier], + StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + ChatColorHelper.YELLOW + + this.getEfficiency(), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + + this.maxAmperesOut(), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index c477f88460..2bba0d833e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -60,17 +60,91 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { private static final int INCUBATION_MODULE = 5; public GT_MetaTileEntity_BioLab(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, (String) null, 6, 2, GT_MetaTileEntity_BioLab.MGUINAME, null, TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE_GLOW")).glow().build()), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_GLOW")).glow().build()), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE_GLOW")).glow().build()), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_GLOW")).glow().build()), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")).glow().build()/*this is topactive*/), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")).glow().build()/*this is top*/), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE_GLOW")).glow().build()), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_GLOW")).glow().build())); + super( + aID, + aName, + aNameRegional, + aTier, + 1, + (String) null, + 6, + 2, + GT_MetaTileEntity_BioLab.MGUINAME, + null, + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon( + "basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of( + new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/fluid_extractor/OVERLAY_SIDE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of( + new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/microwave/OVERLAY_FRONT_ACTIVE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/microwave/OVERLAY_FRONT_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon( + "basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")) + .glow() + .build() /*this is topactive*/), + TextureFactory.of( + TextureFactory.of( + new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")) + .glow() + .build() /*this is top*/), + TextureFactory.of( + TextureFactory.of( + new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/polarizer/OVERLAY_BOTTOM_GLOW")) + .glow() + .build())); } - public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, String aNEIName) { + public GT_MetaTileEntity_BioLab( + String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, String aNEIName) { super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2, GT_MetaTileEntity_BioLab.MGUINAME, aNEIName); } @Override @SuppressWarnings("deprecation") public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_MetaTileEntity_BioLab(this.mName, this.mTier, this.mAmperage, this.mDescription, this.mTextures, this.mNEIName); + return new GT_MetaTileEntity_BioLab( + this.mName, this.mTier, this.mAmperage, this.mDescription, this.mTextures, this.mNEIName); } @Override @@ -87,25 +161,40 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { public int checkRecipe(boolean skipOC) { int rTier = 3; - FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); + FluidStack dnaFluid = LoaderReference.gendustry + ? FluidRegistry.getFluidStack("liquiddna", 1000) + : Materials.Biomass.getFluid(1000L); if (this.getSpecialSlot() != null && this.getSpecialSlot().getItem() instanceof LabModule) { int damage = this.getSpecialSlot().getItemDamage(); switch (damage) { case DNA_EXTRACTION_MODULE: - if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && this.mInventory[getInputSlot()].getItem() instanceof LabParts && this.mInventory[getInputSlot()].getItemDamage() == 0 && this.mInventory[getInputSlot()].getTagCompound() != null && //checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) && this.mInventory[getInputSlot() + 1].getItem() instanceof LabParts && this.mInventory[getInputSlot() + 1].getItemDamage() == 1 && this.mInventory[getInputSlot() + 1].getTagCompound() == null && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) && this.mInventory[getInputSlot() + 2].getItem() instanceof LabParts && this.mInventory[getInputSlot() + 2].getItemDamage() == 3 && - GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], Materials.Ethanol.getCells(1)) && - this.mFluid != null && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000 - ) { + if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) + && this.mInventory[getInputSlot()].getItem() instanceof LabParts + && this.mInventory[getInputSlot()].getItemDamage() == 0 + && this.mInventory[getInputSlot()].getTagCompound() != null + && // checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) + && this.mInventory[getInputSlot() + 1].getItem() instanceof LabParts + && this.mInventory[getInputSlot() + 1].getItemDamage() == 1 + && this.mInventory[getInputSlot() + 1].getTagCompound() == null + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + && this.mInventory[getInputSlot() + 2].getItem() instanceof LabParts + && this.mInventory[getInputSlot() + 2].getItemDamage() == 3 + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 3], Materials.Ethanol.getCells(1)) + && this.mFluid != null + && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) + && this.mFluid.amount >= 1000) { - NBTTagCompound DNABioDataTag = this.mInventory[getInputSlot()].getTagCompound().getCompoundTag("DNA"); - if (DNABioDataTag == null) - return super.checkRecipe(skipOC); - BioData cultureDNABioData = BioData.getBioDataFromName(this.mInventory[getInputSlot()].getTagCompound().getCompoundTag("DNA").getString("Name")); - if (cultureDNABioData == null) - return super.checkRecipe(skipOC); + NBTTagCompound DNABioDataTag = + this.mInventory[getInputSlot()].getTagCompound().getCompoundTag("DNA"); + if (DNABioDataTag == null) return super.checkRecipe(skipOC); + BioData cultureDNABioData = BioData.getBioDataFromName(this.mInventory[getInputSlot()] + .getTagCompound() + .getCompoundTag("DNA") + .getString("Name")); + if (cultureDNABioData == null) return super.checkRecipe(skipOC); if (this.mTier < rTier + cultureDNABioData.getTier()) return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -118,146 +207,194 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mFluid.amount -= 1000; if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(cultureDNABioData)); + this.mOutputItems[0] = + BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(cultureDNABioData)); } this.mOutputItems[1] = GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L); - this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(rTier + cultureDNABioData.getTier()), 500); + this.calculateOverclockedNess( + BW_Util.getMachineVoltageFromTier(rTier + cultureDNABioData.getTier()), 500); return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } break; - case PCR_THERMOCYCLE_MODULE: { - if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && this.mInventory[getInputSlot()].getItem() instanceof LabParts && this.mInventory[getInputSlot()].getItemDamage() == 1 && this.mInventory[getInputSlot()].getTagCompound() != null && //checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], ItemList.Tool_DataOrb.get(1L)) && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 1], FluidLoader.BioLabFluidCells[0]) && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 2], FluidLoader.BioLabFluidCells[3]) && - this.mFluid != null && this.mFluid.isFluidEqual(dnaFluid) && this.mFluid.amount >= 1000) { - NBTTagCompound DNABioDataTag = this.mInventory[getInputSlot()].getTagCompound(); - if (DNABioDataTag == null) - return super.checkRecipe(skipOC); - BioData cultureDNABioData = BioData.getBioDataFromName(DNABioDataTag.getString("Name")); - if (cultureDNABioData == null) - return super.checkRecipe(skipOC); + case PCR_THERMOCYCLE_MODULE: + { + if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) + && this.mInventory[getInputSlot()].getItem() instanceof LabParts + && this.mInventory[getInputSlot()].getItemDamage() == 1 + && this.mInventory[getInputSlot()].getTagCompound() != null + && // checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 3], ItemList.Tool_DataOrb.get(1L)) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 1], FluidLoader.BioLabFluidCells[0]) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 2], FluidLoader.BioLabFluidCells[3]) + && this.mFluid != null + && this.mFluid.isFluidEqual(dnaFluid) + && this.mFluid.amount >= 1000) { + NBTTagCompound DNABioDataTag = this.mInventory[getInputSlot()].getTagCompound(); + if (DNABioDataTag == null) return super.checkRecipe(skipOC); + BioData cultureDNABioData = BioData.getBioDataFromName(DNABioDataTag.getString("Name")); + if (cultureDNABioData == null) return super.checkRecipe(skipOC); - if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) - return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - - for (int i = 0; i < 4; i++) { - if (this.mInventory[getInputSlot() + i] != null) - this.mInventory[getInputSlot() + i].stackSize--; - } + if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - this.mFluid.amount -= 1000; + for (int i = 0; i < 4; i++) { + if (this.mInventory[getInputSlot() + i] != null) + this.mInventory[getInputSlot() + i].stackSize--; + } - ItemStack Outp = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); - Behaviour_DataOrb.setDataName(Outp, cultureDNABioData.getName()); + this.mFluid.amount -= 1000; - if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = Outp; - } else - this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L); - this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(2L); + ItemStack Outp = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); + Behaviour_DataOrb.setDataName(Outp, cultureDNABioData.getName()); - this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + this.mOutputItems[0] = Outp; + } else this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L); + this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(2L); - return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; + this.calculateOverclockedNess( + BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); - } - } - break; - case PLASMID_SYNTHESIS_MODULE: { - ItemStack inp2 = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); - Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); - if ( - GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && GT_Utility.areStacksEqual(FluidLoader.BioLabFluidCells[1], this.mInventory[getInputSlot()]) && //checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 1], BioItemList.getPlasmidCell(null)) && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 2], ItemList.Tool_DataOrb.get(1L), true) && - Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 2]).equals("DNA Sample") && (!(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2]).isEmpty())) && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], inp2) && - this.mFluid != null && this.mFluid.isFluidEqual(dnaFluid) && (this.mFluid.amount >= 1000)) { - BioData cultureDNABioData = BioData.getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2])); - if (cultureDNABioData == null) - return super.checkRecipe(skipOC); - if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) - return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 0; i < 2; i++) { - if (this.mInventory[getInputSlot() + i] != null) - this.mInventory[getInputSlot() + i].stackSize--; + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } - this.mFluid.amount -= 1000; - if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); - } - this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); - this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); - return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } - - } - break; - case TRANSFORMATION_MODULE: { - if ( - GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot()], BioItemList.getPetriDish(null), true) && this.mInventory[getInputSlot()].getTagCompound() != null && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 1], BioItemList.getPlasmidCell(null), true) && this.mInventory[getInputSlot() + 1].getTagCompound() != null && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 2], FluidLoader.BioLabFluidCells[2]) && - this.mFluid != null && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000) { - BioData cultureDNABioData = BioData.getBioDataFromNBTTag(this.mInventory[getInputSlot() + 1].getTagCompound()); - BioCulture bioCulture = BioCulture.getBioCultureFromNBTTag(this.mInventory[getInputSlot()].getTagCompound()); - if (cultureDNABioData == null || bioCulture == null) - return super.checkRecipe(skipOC); - if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) - return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 0; i < 3; i++) { - if (this.mInventory[getInputSlot() + i] != null) - this.mInventory[getInputSlot() + i].stackSize--; + break; + case PLASMID_SYNTHESIS_MODULE: + { + ItemStack inp2 = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); + Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); + if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) + && GT_Utility.areStacksEqual( + FluidLoader.BioLabFluidCells[1], this.mInventory[getInputSlot()]) + && // checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 1], BioItemList.getPlasmidCell(null)) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 2], ItemList.Tool_DataOrb.get(1L), true) + && Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 2]) + .equals("DNA Sample") + && (!(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2]) + .isEmpty())) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) + && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], inp2) + && this.mFluid != null + && this.mFluid.isFluidEqual(dnaFluid) + && (this.mFluid.amount >= 1000)) { + BioData cultureDNABioData = BioData.getBioDataFromName( + Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2])); + if (cultureDNABioData == null) return super.checkRecipe(skipOC); + if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + for (int i = 0; i < 2; i++) { + if (this.mInventory[getInputSlot() + i] != null) + this.mInventory[getInputSlot() + i].stackSize--; + } + this.mFluid.amount -= 1000; + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + this.mOutputItems[0] = + BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + } + this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); + this.calculateOverclockedNess( + BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } - this.mFluid.amount -= 1000; - bioCulture = bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); - if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = BioItemList.getPetriDish(bioCulture); + } + break; + case TRANSFORMATION_MODULE: + { + if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot()], BioItemList.getPetriDish(null), true) + && this.mInventory[getInputSlot()].getTagCompound() != null + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 1], BioItemList.getPlasmidCell(null), true) + && this.mInventory[getInputSlot() + 1].getTagCompound() != null + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 2], FluidLoader.BioLabFluidCells[2]) + && this.mFluid != null + && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) + && this.mFluid.amount >= 1000) { + BioData cultureDNABioData = + BioData.getBioDataFromNBTTag(this.mInventory[getInputSlot() + 1].getTagCompound()); + BioCulture bioCulture = BioCulture.getBioCultureFromNBTTag( + this.mInventory[getInputSlot()].getTagCompound()); + if (cultureDNABioData == null || bioCulture == null) return super.checkRecipe(skipOC); + if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + for (int i = 0; i < 3; i++) { + if (this.mInventory[getInputSlot() + i] != null) + this.mInventory[getInputSlot() + i].stackSize--; + } + this.mFluid.amount -= 1000; + bioCulture = bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + this.mOutputItems[0] = BioItemList.getPetriDish(bioCulture); + } + this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); + this.calculateOverclockedNess( + BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } - this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); - this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); - return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } - } - break; - case CLONAL_CELLULAR_SYNTHESIS_MODULE: { - - ItemStack Outp = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); + break; + case CLONAL_CELLULAR_SYNTHESIS_MODULE: + { + ItemStack Outp = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); - if ( - GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot()], BioItemList.getPetriDish(null)) && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 1], BioItemList.getOther(4)) && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 2], ItemList.Circuit_Chip_Stemcell.get(2L)) && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], ItemList.Tool_DataOrb.get(1L), true) && - Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 3]).equals("DNA Sample") && this.mFluid.isFluidEqual(dnaFluid) && (this.mFluid.amount >= 8000)) { + if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot()], BioItemList.getPetriDish(null)) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 1], BioItemList.getOther(4)) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 2], ItemList.Circuit_Chip_Stemcell.get(2L)) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 3], ItemList.Tool_DataOrb.get(1L), true) + && Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 3]) + .equals("DNA Sample") + && this.mFluid.isFluidEqual(dnaFluid) + && (this.mFluid.amount >= 8000)) { - BioData cultureDNABioData = BioData.getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 3])); - if (cultureDNABioData == null) - return super.checkRecipe(skipOC); - if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) - return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 0; i < 3; i++) { - if (this.mInventory[getInputSlot() + i] != null) - this.mInventory[getInputSlot() + i].stackSize--; - } - this.mFluid.amount -= 8000; - if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - BioCulture out = BioCulture.getBioCulture(BioDNA.convertDataToDNA(cultureDNABioData)); - if (out == null) - return GT_MetaTileEntity_BasicMachine.DID_NOT_FIND_RECIPE; - out = out.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); - this.mOutputItems[0] = BioItemList.getPetriDish(out); + BioData cultureDNABioData = BioData.getBioDataFromName( + Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 3])); + if (cultureDNABioData == null) return super.checkRecipe(skipOC); + if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + for (int i = 0; i < 3; i++) { + if (this.mInventory[getInputSlot() + i] != null) + this.mInventory[getInputSlot() + i].stackSize--; + } + this.mFluid.amount -= 8000; + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + BioCulture out = BioCulture.getBioCulture(BioDNA.convertDataToDNA(cultureDNABioData)); + if (out == null) return GT_MetaTileEntity_BasicMachine.DID_NOT_FIND_RECIPE; + out = out.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + this.mOutputItems[0] = BioItemList.getPetriDish(out); + } + this.calculateOverclockedNess( + BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } - this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); - return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } - } - break; + break; case INCUBATION_MODULE: default: break; @@ -268,6 +405,9 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { @Override public String[] getDescription() { - return new String[]{StatCollector.translateToLocal("tooltip.tile.biolab.0.name"), BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; + return new String[] { + StatCollector.translateToLocal("tooltip.tile.biolab.0.name"), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java index 4105c99c3c..998b87a606 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java @@ -36,7 +36,8 @@ public class GT_MetaTileEntity_CompressedFluidHatch extends GT_MetaTileEntity_Ha this.mDescriptionArray[1] = "Capacity: 100000000L"; } - public GT_MetaTileEntity_CompressedFluidHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_CompressedFluidHatch( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -52,6 +53,7 @@ public class GT_MetaTileEntity_CompressedFluidHatch extends GT_MetaTileEntity_Ha @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_CompressedFluidHatch(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_CompressedFluidHatch( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index ee32f18f84..41bc0490c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -63,17 +63,14 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); - if (this.getBaseMetaTileEntity().getWorld().isRemote) - return; + if (this.getBaseMetaTileEntity().getWorld().isRemote) return; if (!aPlayer.isSneaking()) { --this.aAmps; - if (this.aAmps < 0) - this.aAmps = this.maxAmps; + if (this.aAmps < 0) this.aAmps = this.maxAmps; GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + this.aAmps); - }else{ + } else { ++this.aAmps; - if (this.aAmps > this.maxAmps) - this.aAmps = 0; + if (this.aAmps > this.maxAmps) this.aAmps = 0; GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + this.aAmps); } } @@ -108,30 +105,30 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { } private long getAmpsfromMeta(int meta) { - if (meta > ConfigHandler.IDOffset + GT_Values.VN.length && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 2) - return 2L; - else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 2 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 3) - return 4L; - else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 3 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 4) - return 8L; - else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 4 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 5) - return 12L; - else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 5 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 6) - return 16L; - else - return 0L; + if (meta > ConfigHandler.IDOffset + GT_Values.VN.length + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 2) return 2L; + else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 2 + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 3) return 4L; + else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 3 + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 4) return 8L; + else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 4 + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 5) return 12L; + else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 5 + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 6) return 16L; + else return 0L; } @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{ - this.mDescription, - StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + - ChatColorHelper.YELLOW + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + - ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.maxAmperesIn()), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + - ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.maxAmperesOut()), - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; + return new String[] { + this.mDescription, + StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.maxAmperesIn()), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.maxAmperesOut()), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java index 49f89d1592..c7914e59cf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java @@ -42,7 +42,8 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans super(aName, aTier, aDescription, aTextures); } - public GT_MetaTileEntity_EnergyDistributor(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_EnergyDistributor( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -72,15 +73,15 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans } public String[] getDescription() { - return new String[]{ - StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " - + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " - + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.maxAmperesIn()), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " - + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.maxAmperesOut()), - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; + return new String[] { + StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.maxAmperesIn()), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.maxAmperesOut()), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + }; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java index 1aa313c19b..9478cdf222 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java @@ -34,7 +34,8 @@ public class GT_MetaTileEntity_GiantOutputHatch extends GT_MetaTileEntity_Hatch_ this.mDescriptionArray[1] = "Capacity: 100000000L"; } - public GT_MetaTileEntity_GiantOutputHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_GiantOutputHatch( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 1ab44a530c..d82181ea08 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; + import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.API.IRadMaterial; import com.github.bartimaeusnek.bartworks.API.LoaderReference; @@ -42,16 +44,13 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import java.util.HashMap; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; -import java.util.HashMap; - -import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; - public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { private final int cap; @@ -64,7 +63,15 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { private static HashMap sievertDecayCache = new HashMap<>(); public GT_MetaTileEntity_RadioHatch(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name") + " " + (aTier - 2) + " " + ((aTier - 2) >= 2 ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") : StatCollector.translateToLocal("tooltip.bw.kg.0.name")), StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"), BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}); + super(aID, aName, aNameRegional, aTier, 1, new String[] { + StatCollector.translateToLocal("tooltip.tile.radhatch.0.name"), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name") + " " + (aTier - 2) + " " + + ((aTier - 2) >= 2 + ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") + : StatCollector.translateToLocal("tooltip.bw.kg.0.name")), + StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + }); this.cap = aTier - 2; } @@ -80,20 +87,15 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { public static long calcDecayTicks(int x) { long ret = GT_MetaTileEntity_RadioHatch.sievertDecayCache.getOrDefault(x, 0L); - if (ret != 0) - return ret; - - if (x == 43) - ret = 5000; - else if (x == 61) - ret = 4500; - else if (x <= 100) - ret = MathUtils.ceilLong((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); - else - ret = MathUtils.ceilLong(((8000D * Math.tanh(-x / 65D) + 8000D))); + if (ret != 0) return ret; + + if (x == 43) ret = 5000; + else if (x == 61) ret = 4500; + else if (x <= 100) ret = MathUtils.ceilLong((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); + else ret = MathUtils.ceilLong(((8000D * Math.tanh(-x / 65D) + 8000D))); GT_MetaTileEntity_RadioHatch.sievertDecayCache.put(x, ret); - return ret;//*20; + return ret; // *20; } public int getSievert() { @@ -101,9 +103,8 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public short[] getColorForGUI() { - if (this.colorForGUI != null) - return this.colorForGUI; - return new short[]{0xFA, 0xFA, 0xFF}; + if (this.colorForGUI != null) return this.colorForGUI; + return new short[] {0xFA, 0xFA, 0xFF}; } public byte getMass() { @@ -116,21 +117,18 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { public void setCoverage(short coverage) { byte nu; - if (coverage > 100) - nu = 100; - else if (coverage < 0) - nu = 0; - else - nu = (byte) coverage; + if (coverage > 100) nu = 100; + else if (coverage < 0) nu = 0; + else nu = (byte) coverage; this.coverage = nu; } public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + return new ITexture[] {aBaseTexture, TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_IN)}; } public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + return new ITexture[] {aBaseTexture, TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_IN)}; } @Override @@ -140,8 +138,14 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - aPlayer.openGui(MainMod.MOD_ID, 2, this.getBaseMetaTileEntity().getWorld(), this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()); - //super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + aPlayer.openGui( + MainMod.MOD_ID, + 2, + this.getBaseMetaTileEntity().getWorld(), + this.getBaseMetaTileEntity().getXCoord(), + this.getBaseMetaTileEntity().getYCoord(), + this.getBaseMetaTileEntity().getZCoord()); + // super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); } public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { @@ -154,15 +158,13 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public void updateSlots() { - if (this.mInventory[0] != null && this.mInventory[0].stackSize <= 0) - this.mInventory[0] = null; + if (this.mInventory[0] != null && this.mInventory[0].stackSize <= 0) this.mInventory[0] = null; } public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { if (this.getBaseMetaTileEntity().isServerSide()) { - if (this.mass > 0) - ++this.timer; + if (this.mass > 0) ++this.timer; if (this.mass > 0 && this.sievert > 0) { float decayTicks = GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert); @@ -176,41 +178,34 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } } - if(this.mass >= this.cap) - return; + if (this.mass >= this.cap) return; ItemStack lStack = this.mInventory[0]; isStackValidRadioMaterial(lStack, true); - } } - public boolean isStackValidRadioMaterial(ItemStack lStack) - { + public boolean isStackValidRadioMaterial(ItemStack lStack) { return isStackValidRadioMaterial(lStack, false); } - public boolean isStackValidRadioMaterial(ItemStack lStack, boolean use){ - if (lStack == null) - return false; + public boolean isStackValidRadioMaterial(ItemStack lStack, boolean use) { + if (lStack == null) return false; IRadMaterial radmat = null; - //gt++ compat - if (LoaderReference.miscutils) - radmat = RadioHatchCompat.GTppRadChecker(lStack); + // gt++ compat + if (LoaderReference.miscutils) radmat = RadioHatchCompat.GTppRadChecker(lStack); - //GT++ and BW Materials check + // GT++ and BW Materials check if (lStack.getItem() instanceof IRadMaterial || radmat != null) { - if (radmat == null) - radmat = ((IRadMaterial) lStack.getItem()); + if (radmat == null) radmat = ((IRadMaterial) lStack.getItem()); int sv = radmat.getRadiationLevel(lStack); int amount = radmat.getAmountOfMaterial(lStack); - if (sv > BioVatLogicAdder.RadioHatch.getMaxSv()) - BioVatLogicAdder.RadioHatch.MaxSV = sv; + if (sv > BioVatLogicAdder.RadioHatch.getMaxSv()) BioVatLogicAdder.RadioHatch.MaxSV = sv; if ((this.mass == 0 || this.sievert == sv) && sv > 0 && amount > 0) { - if(use) { + if (use) { if (this.mass + amount <= this.cap) { String name = radmat.getNameForGUI(lStack); if (this.mass == 0 || this.material.equals(name)) { @@ -233,7 +228,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { for (ItemStack varStack : BioVatLogicAdder.RadioHatch.getIsSv().keySet()) { if (GT_Utility.areStacksEqual(varStack, lStack, true)) { - int amount = BioVatLogicAdder.RadioHatch.getIsKg().getOrDefault(varStack,0); + int amount = BioVatLogicAdder.RadioHatch.getIsKg().getOrDefault(varStack, 0); int sv = BioVatLogicAdder.RadioHatch.getIsSv().get(varStack); if ((this.mass == 0 || this.sievert == sv) && sv > 0 && amount > 0) { if (use) { @@ -241,10 +236,12 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { String name = StatCollector.translateToLocal(varStack.getUnlocalizedName()); if (this.mass == 0 || this.material.equals(name)) { this.mass += amount; - this.sievert = BioVatLogicAdder.RadioHatch.getIsSv().get(varStack); + this.sievert = + BioVatLogicAdder.RadioHatch.getIsSv().get(varStack); this.mInventory[0].stackSize--; this.updateSlots(); - this.colorForGUI = BioVatLogicAdder.RadioHatch.getIsColor().get(varStack); + this.colorForGUI = + BioVatLogicAdder.RadioHatch.getIsColor().get(varStack); this.material = name; return true; } @@ -258,16 +255,20 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { // Rest - //check material for general validity - if (GT_OreDictUnificator.getAssociation(lStack) != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial != null) { - //check orePrefix for general validity + // check material for general validity + if (GT_OreDictUnificator.getAssociation(lStack) != null + && GT_OreDictUnificator.getAssociation(lStack).mMaterial != null + && GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial != null) { + // check orePrefix for general validity if (GT_OreDictUnificator.getAssociation(lStack).mPrefix != null) { OrePrefixes orePrefixes = GT_OreDictUnificator.getAssociation(lStack).mPrefix; - //check orePrefix for specialised validity + // check orePrefix for specialised validity if (orePrefixes.equals(OrePrefixes.stickLong) || orePrefixes.equals(OrePrefixes.stick)) { Materials materials = GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial; - //check material for specialised validity - if (materials.getProtons() >= 83 && materials.getProtons() != 125 || materials.getProtons() == 61 || materials.getProtons() == 43) { + // check material for specialised validity + if (materials.getProtons() >= 83 && materials.getProtons() != 125 + || materials.getProtons() == 61 + || materials.getProtons() == 43) { if (use) { int sv = calculateSv(materials); int amount = (orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1); @@ -303,24 +304,40 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @Override public String[] getInfoData() { if (this.sievert != 0) - return new String[]{ - StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + this.material, - StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + this.sievert, - StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + this.mass, - StatCollector.translateToLocal("tooltip.tile.radhatch.5.name") + " " + - ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert) * 60)) + - StatCollector.translateToLocal("tooltip.tile.radhatch.6.name") + "/" + - ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 + - StatCollector.translateToLocal("tooltip.tile.radhatch.7.name") + "/" + - ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 / 60 + - StatCollector.translateToLocal("tooltip.tile.radhatch.8.name") + "/" + - ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 / 60 / 60 + - StatCollector.translateToLocal("tooltip.tile.radhatch.9.name")}; + return new String[] { + StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + this.material, + StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + this.sievert, + StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + this.mass, + StatCollector.translateToLocal("tooltip.tile.radhatch.5.name") + " " + + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) + - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert) * 60)) + + StatCollector.translateToLocal("tooltip.tile.radhatch.6.name") + + "/" + + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) + - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) + / 20 + + StatCollector.translateToLocal("tooltip.tile.radhatch.7.name") + + "/" + + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) + - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) + / 20 + / 60 + + StatCollector.translateToLocal("tooltip.tile.radhatch.8.name") + + "/" + + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) + - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) + / 20 + / 60 + / 60 + + StatCollector.translateToLocal("tooltip.tile.radhatch.9.name") + }; else - return new String[]{ - StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + StatCollector.translateToLocal("tooltip.bw.empty.name"), - StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + "0", - StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + "0"}; + return new String[] { + StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + + StatCollector.translateToLocal("tooltip.bw.empty.name"), + StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + "0", + StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + "0" + }; } public boolean isSimpleMachine() { @@ -344,8 +361,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (aSide == this.getBaseMetaTileEntity().getFrontFacing() && - isStackValidRadioMaterial(aStack)); + return (aSide == this.getBaseMetaTileEntity().getFrontFacing() && isStackValidRadioMaterial(aStack)); } public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { @@ -362,8 +378,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { aNBT.setByte("mSv", (byte) (this.sievert - 100)); aNBT.setByte("mCoverage", this.coverage); aNBT.setInteger("mTextColor", BW_ColorUtil.getColorFromRGBArray(this.getColorForGUI())); - if (this.material != null && !this.material.isEmpty()) - aNBT.setString("mMaterial", this.material); + if (this.material != null && !this.material.isEmpty()) aNBT.setString("mMaterial", this.material); aNBT.setLong("timer", this.timer); super.saveNBTData(aNBT); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java index d5afddb264..90fd02b3e2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java @@ -37,11 +37,13 @@ import net.minecraftforge.common.util.ForgeDirection; public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachineBlock { boolean powered; - public GT_MetaTileEntity_Transistor(int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) { + public GT_MetaTileEntity_Transistor( + int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 0, aDescription, aTextures); } - public GT_MetaTileEntity_Transistor(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, ITexture... aTextures) { + public GT_MetaTileEntity_Transistor( + int aID, String aName, String aNameRegional, int aTier, String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 0, aDescription, aTextures); } @@ -58,18 +60,54 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin ITexture[][][] rTextures = new ITexture[12][17][]; for (byte i = -1; i < 16; ++i) { - rTextures[0][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; - rTextures[1][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; - rTextures[2][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; - rTextures[3][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; - rTextures[4][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; - rTextures[5][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; - rTextures[6][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]}; - rTextures[7][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]}; - rTextures[8][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]}; - rTextures[9][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; - rTextures[10][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; - rTextures[11][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; + rTextures[0][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] + }; + rTextures[1][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] + }; + rTextures[2][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] + }; + rTextures[3][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] + }; + rTextures[4][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] + }; + rTextures[5][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] + }; + rTextures[6][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] + }; + rTextures[7][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] + }; + rTextures[8][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] + }; + rTextures[9][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] + }; + rTextures[10][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] + }; + rTextures[11][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] + }; } return rTextures; @@ -81,9 +119,7 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin } @Override - public void saveNBTData(NBTTagCompound nbtTagCompound) { - - } + public void saveNBTData(NBTTagCompound nbtTagCompound) {} public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { @@ -95,7 +131,8 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin return; } IBasicEnergyContainer tileAtSide = (IBasicEnergyContainer) tTileEntity; - if (!tileAtSide.outputsEnergyTo((byte) ForgeDirection.WEST.flag) || !tileAtSide.isUniversalEnergyStored(4L)) { + if (!tileAtSide.outputsEnergyTo((byte) ForgeDirection.WEST.flag) + || !tileAtSide.isUniversalEnergyStored(4L)) { this.powered = false; return; } @@ -108,8 +145,7 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin } } - if (aBaseMetaTileEntity.isAllowedToWork()) - this.powered = !this.powered; + if (aBaseMetaTileEntity.isAllowedToWork()) this.powered = !this.powered; } } @@ -132,9 +168,7 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin } @Override - public void loadNBTData(NBTTagCompound nbtTagCompound) { - - } + public void loadNBTData(NBTTagCompound nbtTagCompound) {} @Override public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { @@ -147,7 +181,8 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin } @Override - public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + public ITexture[] getTexture( + IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { return new ITexture[0]; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java index d1dac08766..616219ef8c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java @@ -36,7 +36,11 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { public BW_NEI_BioLabHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { super(aRecipeMap); if (!NEI_BW_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); + FMLInterModComms.sendRuntimeMessage( + GT_Values.GT, + "NEIPlugins", + "register-crafting-handler", + "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); GuiUsageRecipe.usagehandlers.add(this); } @@ -47,10 +51,12 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { } public void loadCraftingRecipes(ItemStack aResult) { - if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { + if (aResult != null + && aResult.getItem() instanceof LabParts + && aResult.getItemDamage() < 3 + && aResult.getTagCompound() != null) { for (CachedDefaultRecipe recipe : getCache()) - if (NEI_BW_Config.checkRecipe(aResult, recipe.mOutputs)) - arecipes.add(recipe); + if (NEI_BW_Config.checkRecipe(aResult, recipe.mOutputs)) arecipes.add(recipe); } else { super.loadCraftingRecipes(aResult); } @@ -58,10 +64,12 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { @Override public void loadUsageRecipes(ItemStack aResult) { - if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { + if (aResult != null + && aResult.getItem() instanceof LabParts + && aResult.getItemDamage() < 3 + && aResult.getTagCompound() != null) { for (CachedDefaultRecipe recipe : getCache()) - if (NEI_BW_Config.checkRecipe(aResult, recipe.mInputs)) - arecipes.add(recipe); + if (NEI_BW_Config.checkRecipe(aResult, recipe.mInputs)) arecipes.add(recipe); } else { super.loadUsageRecipes(aResult); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index c91568946a..1ae67d1360 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -34,19 +34,23 @@ import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.nei.GT_NEI_DefaultHandler; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; - import java.awt.*; import java.util.Collections; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { public BW_NEI_BioVatHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { super(aRecipeMap); - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier())); + this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect( + new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier())); if (!NEI_BW_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); + FMLInterModComms.sendRuntimeMessage( + GT_Values.GT, + "NEIPlugins", + "register-crafting-handler", + "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); GuiUsageRecipe.usagehandlers.add(this); } @@ -61,27 +65,51 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { int[] lines = {base, base + 8, base + 16, base + 24, base + 32, base + 40, base + 48, base + 56, base + 64}; int tEUt = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; int tDuration = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - String[] recipeDesc = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.getNeiDesc(); + String[] recipeDesc = + ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.getNeiDesc(); int tSpecial; if (recipeDesc == null) { if (tEUt != 0) { - drawText(10, lines[0], this.trans("152", "Total: ") + GT_Utility.formatNumbers((long) tDuration * (long) tEUt) + " EU", -16777216); - drawText(10, lines[1], this.trans("153", "Usage: ") + GT_Utility.formatNumbers(tEUt) + " EU/t", -16777216); + drawText( + 10, + lines[0], + this.trans("152", "Total: ") + GT_Utility.formatNumbers((long) tDuration * (long) tEUt) + " EU", + -16777216); + drawText( + 10, + lines[1], + this.trans("153", "Usage: ") + GT_Utility.formatNumbers(tEUt) + " EU/t", + -16777216); if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, lines[2], this.trans("154", "Voltage: ") + GT_Utility.formatNumbers(tEUt / this.mRecipeMap.mAmperage) + " EU", -16777216); - drawText(10, lines[3], this.trans("155", "Amperage: ") + GT_Utility.formatNumbers(this.mRecipeMap.mAmperage), -16777216); + drawText( + 10, + lines[2], + this.trans("154", "Voltage: ") + GT_Utility.formatNumbers(tEUt / this.mRecipeMap.mAmperage) + + " EU", + -16777216); + drawText( + 10, + lines[3], + this.trans("155", "Amperage: ") + GT_Utility.formatNumbers(this.mRecipeMap.mAmperage), + -16777216); } else { drawText(10, lines[2], this.trans("156", "Voltage: unspecified"), -16777216); drawText(10, lines[3], this.trans("157", "Amperage: unspecified"), -16777216); } } - if (tDuration > 0) { - drawText(10, lines[4], this.trans("158", "Time: ") + GT_Utility.formatNumbers(0.05d * tDuration) + this.trans("161", " secs"), -16777216); + drawText( + 10, + lines[4], + this.trans("158", "Time: ") + + GT_Utility.formatNumbers(0.05d * tDuration) + + this.trans("161", " secs"), + -16777216); } - tSpecial = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; + tSpecial = + ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; int[] tSpecialA = GT_TileEntity_BioVat.specialValueUnpack(tSpecial); @@ -95,8 +123,18 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { drawText(10, lines[7], this.trans("160", "Needs Cleanroom & LowGrav"), -16777216); } else if (tSpecialA[1] == -400) { drawText(10, lines[7], this.trans("216", "Deprecated Recipe"), -16777216); - } else if (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre) || GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost)) { - drawText(10, lines[6], (tSpecialA[2] == 1 ? StatCollector.translateToLocal("nei.biovat.1.name") : StatCollector.translateToLocal("nei.biovat.2.name")) + this.mRecipeMap.mNEISpecialValuePre + GT_Utility.formatNumbers(tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); + } else if (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre) + || GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost)) { + drawText( + 10, + lines[6], + (tSpecialA[2] == 1 + ? StatCollector.translateToLocal("nei.biovat.1.name") + : StatCollector.translateToLocal("nei.biovat.2.name")) + + this.mRecipeMap.mNEISpecialValuePre + + GT_Utility.formatNumbers(tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier) + + this.mRecipeMap.mNEISpecialValuePost, + -16777216); } } else { tSpecial = 0; @@ -106,7 +144,6 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { ++tSpecial; } } - } private void loadLabPartRecipes(ItemStack aResult) { @@ -115,8 +152,7 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { // see constructor of CachedDefaultRecipe on why relx==120 and rely==52 means special slot for (PositionedStack stack : recipe.mInputs) { if (stack.relx == 120 && stack.rely == 52) { - if (NEI_BW_Config.checkRecipe(aResult, Collections.singletonList(stack))) - arecipes.add(recipe); + if (NEI_BW_Config.checkRecipe(aResult, Collections.singletonList(stack))) arecipes.add(recipe); } } } @@ -124,7 +160,10 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { @Override public void loadUsageRecipes(ItemStack aResult) { - if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { + if (aResult != null + && aResult.getItem() instanceof LabParts + && aResult.getItemDamage() < 3 + && aResult.getTagCompound() != null) { loadLabPartRecipes(aResult); } else { super.loadUsageRecipes(aResult); @@ -133,7 +172,10 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { @Override public void loadCraftingRecipes(ItemStack aResult) { - if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { + if (aResult != null + && aResult.getItem() instanceof LabParts + && aResult.getItemDamage() < 3 + && aResult.getTagCompound() != null) { loadLabPartRecipes(aResult); } else { super.loadCraftingRecipes(aResult); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index 8bb59713ae..727aa9fb97 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -36,20 +36,23 @@ import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128ba; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.enums.OrePrefixes; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; - import java.awt.*; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Objects; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; public class BW_NEI_OreHandler extends TemplateRecipeHandler { public BW_NEI_OreHandler() { if (!NEI_BW_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(MainMod.MOD_ID, "NEIPlugins", "register-crafting-handler", MainMod.MOD_ID + "@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); + FMLInterModComms.sendRuntimeMessage( + MainMod.MOD_ID, + "NEIPlugins", + "register-crafting-handler", + MainMod.MOD_ID + "@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); } } @@ -61,7 +64,8 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void loadTransferRects() { - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(0,40,40,120),"quickanddirtyneihandler")); + this.transferRects.add( + new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(0, 40, 40, 120), "quickanddirtyneihandler")); } @Override @@ -73,10 +77,14 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public void loadCraftingRecipes(String outputId, Object... results) { if (outputId.equalsIgnoreCase("quickanddirtyneihandler")) { HashSet result = new HashSet<>(); - Werkstoff.werkstoffHashSet.stream().filter(w -> w.hasGenerationFeature(OrePrefixes.ore)).forEach(w -> result.add(w.get(OrePrefixes.ore))); + Werkstoff.werkstoffHashSet.stream() + .filter(w -> w.hasGenerationFeature(OrePrefixes.ore)) + .forEach(w -> result.add(w.get(OrePrefixes.ore))); result.forEach(this::loadCraftingRecipes); result.clear(); - Werkstoff.werkstoffHashSet.stream().filter(w -> w.hasGenerationFeature(OrePrefixes.ore)).forEach(w -> result.add(w.get(OrePrefixes.oreSmall))); + Werkstoff.werkstoffHashSet.stream() + .filter(w -> w.hasGenerationFeature(OrePrefixes.ore)) + .forEach(w -> result.add(w.get(OrePrefixes.oreSmall))); result.forEach(this::loadCraftingRecipes); result.clear(); HashSet hashSet = new HashSet<>(this.arecipes); @@ -84,7 +92,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { this.arecipes.addAll(hashSet); } if (outputId.equals("item")) { - this.loadCraftingRecipes((ItemStack)results[0]); + this.loadCraftingRecipes((ItemStack) results[0]); HashSet hashSet = new HashSet<>(this.arecipes); this.arecipes.clear(); this.arecipes.addAll(hashSet); @@ -93,42 +101,50 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void drawExtras(int recipe) { - if ((recipe < this.arecipes.size()) && (this.arecipes.get(recipe) instanceof CachedOreRecipe) ) { - CachedOreRecipe cachedOreRecipe = (CachedOreRecipe) this.arecipes.get(recipe); - - if (cachedOreRecipe == null || cachedOreRecipe.getOtherStacks() == null || cachedOreRecipe.getOtherStacks().size() == 0) - return; - - if (!cachedOreRecipe.small) { - if (cachedOreRecipe.getOtherStacks().get(0) == null || cachedOreRecipe.getOtherStacks().get(0).item == null - || cachedOreRecipe.getOtherStacks().get(1) == null - || cachedOreRecipe.getOtherStacks().get(2) == null || cachedOreRecipe.getOtherStacks().get(3) == null || cachedOreRecipe.getOtherStacks().get(1).item == null - || cachedOreRecipe.getOtherStacks().get(2).item == null || cachedOreRecipe.getOtherStacks().get(3).item == null - ) - return; - } else if (cachedOreRecipe.getOtherStacks().get(0) == null || cachedOreRecipe.getOtherStacks().get(0).item == null) - return; - - if (cachedOreRecipe.worldGen != null) - GuiDraw.drawString(ChatColorHelper.BOLD + "DIM: " + ChatColorHelper.RESET + cachedOreRecipe.worldGen.getDimName(), 0, 40, 0, false); - - GuiDraw.drawString(ChatColorHelper.BOLD + "Primary:", 0, 50, 0, false); - GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(0).item.getDisplayName(), 0, 60, 0, false); - - if (!cachedOreRecipe.small) { - GuiDraw.drawString(ChatColorHelper.BOLD + "Secondary:", 0, 70, 0, false); - GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(1).item.getDisplayName(), 0, 80, 0, false); - GuiDraw.drawString(ChatColorHelper.BOLD + "InBetween:", 0, 90, 0, false); - GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(2).item.getDisplayName(), 0, 100, 0, false); - GuiDraw.drawString(ChatColorHelper.BOLD + "Sporadic:", 0, 110, 0, false); - GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(3).item.getDisplayName(), 0, 120, 0, false); - } else { - if (cachedOreRecipe.worldGen != null) { - GuiDraw.drawString(ChatColorHelper.BOLD + "Amount per Chunk:", 0, 70, 0, false); - GuiDraw.drawString(cachedOreRecipe.worldGen.mDensity + "", 0, 80, 0, false); + if ((recipe < this.arecipes.size()) && (this.arecipes.get(recipe) instanceof CachedOreRecipe)) { + CachedOreRecipe cachedOreRecipe = (CachedOreRecipe) this.arecipes.get(recipe); + + if (cachedOreRecipe == null + || cachedOreRecipe.getOtherStacks() == null + || cachedOreRecipe.getOtherStacks().size() == 0) return; + + if (!cachedOreRecipe.small) { + if (cachedOreRecipe.getOtherStacks().get(0) == null + || cachedOreRecipe.getOtherStacks().get(0).item == null + || cachedOreRecipe.getOtherStacks().get(1) == null + || cachedOreRecipe.getOtherStacks().get(2) == null + || cachedOreRecipe.getOtherStacks().get(3) == null + || cachedOreRecipe.getOtherStacks().get(1).item == null + || cachedOreRecipe.getOtherStacks().get(2).item == null + || cachedOreRecipe.getOtherStacks().get(3).item == null) return; + } else if (cachedOreRecipe.getOtherStacks().get(0) == null + || cachedOreRecipe.getOtherStacks().get(0).item == null) return; + + if (cachedOreRecipe.worldGen != null) + GuiDraw.drawString( + ChatColorHelper.BOLD + "DIM: " + ChatColorHelper.RESET + cachedOreRecipe.worldGen.getDimName(), + 0, + 40, + 0, + false); + + GuiDraw.drawString(ChatColorHelper.BOLD + "Primary:", 0, 50, 0, false); + GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(0).item.getDisplayName(), 0, 60, 0, false); + + if (!cachedOreRecipe.small) { + GuiDraw.drawString(ChatColorHelper.BOLD + "Secondary:", 0, 70, 0, false); + GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(1).item.getDisplayName(), 0, 80, 0, false); + GuiDraw.drawString(ChatColorHelper.BOLD + "InBetween:", 0, 90, 0, false); + GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(2).item.getDisplayName(), 0, 100, 0, false); + GuiDraw.drawString(ChatColorHelper.BOLD + "Sporadic:", 0, 110, 0, false); + GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(3).item.getDisplayName(), 0, 120, 0, false); + } else { + if (cachedOreRecipe.worldGen != null) { + GuiDraw.drawString(ChatColorHelper.BOLD + "Amount per Chunk:", 0, 70, 0, false); + GuiDraw.drawString(cachedOreRecipe.worldGen.mDensity + "", 0, 80, 0, false); + } } } - } super.drawExtras(recipe); } @@ -136,13 +152,12 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public void loadCraftingRecipes(ItemStack result) { Block ore = Block.getBlockFromItem(result.getItem()); if (ore instanceof BW_MetaGenerated_Ores) { - BW_OreLayer.NEIMAP.get( - (short) result.getItemDamage()) - .stream() - .filter(l -> !(ore instanceof BW_MetaGenerated_SmallOres) || - !(l.getClass().equals(BW_WorldGenRoss128b.class) || - l.getClass().equals(BW_WorldGenRoss128ba.class))) - .forEach(l -> this.arecipes.add(new CachedOreRecipe(l, result, ore instanceof BW_MetaGenerated_SmallOres))); + BW_OreLayer.NEIMAP.get((short) result.getItemDamage()).stream() + .filter(l -> !(ore instanceof BW_MetaGenerated_SmallOres) + || !(l.getClass().equals(BW_WorldGenRoss128b.class) + || l.getClass().equals(BW_WorldGenRoss128ba.class))) + .forEach(l -> this.arecipes.add( + new CachedOreRecipe(l, result, ore instanceof BW_MetaGenerated_SmallOres))); } } @@ -156,32 +171,33 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { return "BartWorks Ores"; } - class CachedOreRecipe extends TemplateRecipeHandler.CachedRecipe{ + class CachedOreRecipe extends TemplateRecipeHandler.CachedRecipe { public CachedOreRecipe(BW_OreLayer worldGen, ItemStack result, boolean smallOres) { this.worldGen = worldGen; this.stack = new PositionedStack(result, 0, 0); this.small = smallOres; } + boolean small; BW_OreLayer worldGen; PositionedStack stack; - @Override - public PositionedStack getResult() { - return this.stack; - } + @Override + public PositionedStack getResult() { + return this.stack; + } - @Override - public List getOtherStacks() { - List ret = new ArrayList<>(); - int x = 0; - for (int i = 0; i < (small ? 1 : 4); i++) { - x += 20; - ret.add(new PositionedStack(worldGen.getStacks().get(i), x, 12)); - } - return ret; + @Override + public List getOtherStacks() { + List ret = new ArrayList<>(); + int x = 0; + for (int i = 0; i < (small ? 1 : 4); i++) { + x += 20; + ret.add(new PositionedStack(worldGen.getStacks().get(i), x, 12)); } + return ret; + } @Override public boolean equals(Object o) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index 92779481bb..fad6574627 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -54,18 +54,30 @@ public class NEI_BW_Config implements IConfigureNEI { API.hideItem(new ItemStack(FluidLoader.bioFluidBlock)); API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses)); ItemStack[] prefixesToHide = { - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustTiny, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustSmall, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushed, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedCentrifuged, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.nugget, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemChipped, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawed, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawless, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemExquisite, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustImpure, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustPure, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustTiny, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustSmall, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushed, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedCentrifuged, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.nugget, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemChipped, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawed, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawless, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemExquisite, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustImpure, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustPure, WerkstoffLoader.Bismutite) + .copy(), }; for (ItemStack stack : prefixesToHide) { stack.setItemDamage(Short.MAX_VALUE); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java index a2943e67e1..c2125a8e70 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java @@ -40,68 +40,66 @@ import net.minecraftforge.oredict.OreDictionary; public class ServerEventHandler { - //MinecraftForge.EVENT_BUS + // MinecraftForge.EVENT_BUS @SubscribeEvent(priority = EventPriority.LOWEST) public void EntityJoinWorldEvent(EntityJoinWorldEvent event) { - if (event == null || !(event.entity instanceof EntityPlayerMP) || !SideReference.Side.Server) - return; - MainMod.BW_Network_instance.sendToPlayer(new OreDictCachePacket(OreDictHandler.getNonBWCache()), (EntityPlayerMP) event.entity); - MainMod.BW_Network_instance.sendToPlayer(new ServerJoinedPackage(null),(EntityPlayerMP) event.entity); + if (event == null || !(event.entity instanceof EntityPlayerMP) || !SideReference.Side.Server) return; + MainMod.BW_Network_instance.sendToPlayer( + new OreDictCachePacket(OreDictHandler.getNonBWCache()), (EntityPlayerMP) event.entity); + MainMod.BW_Network_instance.sendToPlayer(new ServerJoinedPackage(null), (EntityPlayerMP) event.entity); } - //FMLCommonHandler.instance().bus() + // FMLCommonHandler.instance().bus() @SubscribeEvent(priority = EventPriority.HIGHEST) public void onPlayerTickEventServer(TickEvent.PlayerTickEvent event) { - if (event == null || !(event.player instanceof EntityPlayerMP)) - return; + if (event == null || !(event.player instanceof EntityPlayerMP)) return; - if (event.player.worldObj.getTotalWorldTime() % 20 != 0) - return; + if (event.player.worldObj.getTotalWorldTime() % 20 != 0) return; boolean replace = false; ItemStack toReplace = null; for (int i = 0; i < event.player.inventory.mainInventory.length; i++) { - ItemStack stack = event.player.inventory.mainInventory[i]; - if (stack == null) - continue; - int[] oreIDs = OreDictionary.getOreIDs(stack); + ItemStack stack = event.player.inventory.mainInventory[i]; + if (stack == null) continue; + int[] oreIDs = OreDictionary.getOreIDs(stack); - if (oreIDs.length > 0){ - loop: for (int oreID : oreIDs) { - String oreDictName = OreDictionary.getOreName(oreID); - for (Werkstoff e : Werkstoff.werkstoffHashSet) { - replace = e.getGenerationFeatures().enforceUnification; - if (replace) { - if (oreDictName.contains(e.getVarName())) { - String prefix = oreDictName.replace(e.getVarName(), ""); - OrePrefixes prefixes = OrePrefixes.getPrefix(prefix); - if (prefixes == null) { - continue; - } - toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize); - break loop; - } else { - for (String s : e.getADDITIONAL_OREDICT()) { - if (oreDictName.contains(s)) { - String prefix = oreDictName.replace(s, ""); - OrePrefixes prefixes = OrePrefixes.getPrefix(prefix); - if (prefixes == null) { - continue; - } - toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize); - break loop; - } - } - } - } - replace = false; - } - } - } - if (replace && toReplace != null) { - event.player.inventory.setInventorySlotContents(i, toReplace); - replace = false; - } - } + if (oreIDs.length > 0) { + loop: + for (int oreID : oreIDs) { + String oreDictName = OreDictionary.getOreName(oreID); + for (Werkstoff e : Werkstoff.werkstoffHashSet) { + replace = e.getGenerationFeatures().enforceUnification; + if (replace) { + if (oreDictName.contains(e.getVarName())) { + String prefix = oreDictName.replace(e.getVarName(), ""); + OrePrefixes prefixes = OrePrefixes.getPrefix(prefix); + if (prefixes == null) { + continue; + } + toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize); + break loop; + } else { + for (String s : e.getADDITIONAL_OREDICT()) { + if (oreDictName.contains(s)) { + String prefix = oreDictName.replace(s, ""); + OrePrefixes prefixes = OrePrefixes.getPrefix(prefix); + if (prefixes == null) { + continue; + } + toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize); + break loop; + } + } + } + } + replace = false; + } + } + } + if (replace && toReplace != null) { + event.player.inventory.setInventorySlotContents(i, toReplace); + replace = false; + } + } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java index ee959d878a..0d9cd5731b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java @@ -27,6 +27,8 @@ import com.github.bartimaeusnek.bartworks.server.container.Slots.BW_FuelSlot; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_Slot_Render; +import java.nio.ByteBuffer; +import java.util.Iterator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; @@ -34,9 +36,6 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import java.nio.ByteBuffer; -import java.util.Iterator; - public class BW_Container_HeatedWaterPump extends Container { final BW_TileEntity_HeatedWaterPump TILE; @@ -79,8 +78,10 @@ public class BW_Container_HeatedWaterPump extends Container { slot.putStack(null); } } - } - else if (p_82846_2_ > 1 && slot.getStack() != null && ((Slot) this.inventorySlots.get(0)).getStack() == null && ((Slot) this.inventorySlots.get(0)).isItemValid(slot.getStack())){ + } else if (p_82846_2_ > 1 + && slot.getStack() != null + && ((Slot) this.inventorySlots.get(0)).getStack() == null + && ((Slot) this.inventorySlots.get(0)).isItemValid(slot.getStack())) { ((Slot) this.inventorySlots.get(0)).putStack(slot.getStack()); slot.putStack(null); } @@ -91,8 +92,7 @@ public class BW_Container_HeatedWaterPump extends Container { @SuppressWarnings("rawtypes") public void detectAndSendChanges() { super.detectAndSendChanges(); - if (this.TILE.getWorldObj().isRemote) - return; + if (this.TILE.getWorldObj().isRemote) return; this.fuel = this.TILE.fuel; this.maxfuel = this.TILE.maxfuel; @@ -101,8 +101,7 @@ public class BW_Container_HeatedWaterPump extends Container { this.netmaxfuel = ByteBuffer.allocate(8).putInt(this.maxfuel).array(); ++this.timer; Iterator var2 = this.crafters.iterator(); - if (this.timer >= Long.MAX_VALUE - 1) - this.timer = 0; + if (this.timer >= Long.MAX_VALUE - 1) this.timer = 0; while (true) { do { if (!var2.hasNext()) { @@ -129,10 +128,8 @@ public class BW_Container_HeatedWaterPump extends Container { @Override @SideOnly(Side.CLIENT) public void updateProgressBar(int packetID, int valure) { - if (this.netfuel == null) - this.netfuel = new byte[8]; - if (this.netmaxfuel == null) - this.netmaxfuel = new byte[8]; + if (this.netfuel == null) this.netfuel = new byte[8]; + if (this.netmaxfuel == null) this.netmaxfuel = new byte[8]; switch (packetID) { case 0: { this.water = valure; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java index 918713a50a..b53e3301db 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.server.container; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import gregtech.api.gui.GT_Slot_Holo; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import java.util.Iterator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -33,8 +34,6 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import java.util.Iterator; - public class BW_Container_RadioHatch extends Container { public byte coverage, dcoverage; @@ -66,9 +65,7 @@ public class BW_Container_RadioHatch extends Container { } @Override - public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { - - } + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {} @Override public String getInventoryName() { @@ -86,9 +83,7 @@ public class BW_Container_RadioHatch extends Container { } @Override - public void markDirty() { - - } + public void markDirty() {} @Override public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { @@ -96,14 +91,10 @@ public class BW_Container_RadioHatch extends Container { } @Override - public void openInventory() { - - } + public void openInventory() {} @Override - public void closeInventory() { - - } + public void closeInventory() {} @Override public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { @@ -128,12 +119,12 @@ public class BW_Container_RadioHatch extends Container { @Override @SuppressWarnings("rawtypes") public void detectAndSendChanges() { - if (!this.iGregTechTileEntity.getBaseMetaTileEntity().isClientSide() && this.iGregTechTileEntity.getBaseMetaTileEntity().getMetaTileEntity() != null) { + if (!this.iGregTechTileEntity.getBaseMetaTileEntity().isClientSide() + && this.iGregTechTileEntity.getBaseMetaTileEntity().getMetaTileEntity() != null) { this.coverage = this.iGregTechTileEntity.getCoverage(); ++this.timer; Iterator var2 = this.crafters.iterator(); - if (this.timer >= Long.MAX_VALUE - 1) - this.timer = 0; + if (this.timer >= Long.MAX_VALUE - 1) this.timer = 0; while (true) { do { if (!var2.hasNext()) { @@ -150,8 +141,7 @@ public class BW_Container_RadioHatch extends Container { @Override public void updateProgressBar(int p_75137_1_, int p_75137_2_) { - if (p_75137_1_ == 0) - this.coverage = (byte) p_75137_2_; + if (p_75137_1_ == 0) this.coverage = (byte) p_75137_2_; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java index fc11974864..f80986f198 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java @@ -33,7 +33,6 @@ public class BW_Container_Windmill extends GT_Container_MultiMachine { super(aInventoryPlayer, aTileEntity); } - public void addSlots(InventoryPlayer aInventoryPlayer) { this.addSlotToContainer(new Slot(this.mTileEntity, 1, 60, 36)); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java index 95ac8a9a09..bbb09a2c2a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -51,7 +51,7 @@ public class GT_Container_CircuitProgrammer extends Container { IInventory inv = new pinv(this.player); - this.addSlotToContainer(new Slot(inv, 0, 44, 61));//-45, 84)); + this.addSlotToContainer(new Slot(inv, 0, 44, 61)); // -45, 84)); for (int i = 1; i < 13; i++) { this.addSlotToContainer(new GT_Slot_Holo(inv, i, -64 + i * 18, 22, false, false, 1)); @@ -67,10 +67,10 @@ public class GT_Container_CircuitProgrammer extends Container { } for (int i = 0; i < 9; i++) { - if (GT_Utility.isStackValid(inventory.getStackInSlot(i)) && inventory.getStackInSlot(i).getItem() instanceof Circuit_Programmer) + if (GT_Utility.isStackValid(inventory.getStackInSlot(i)) + && inventory.getStackInSlot(i).getItem() instanceof Circuit_Programmer) this.addSlotToContainer(new GT_Slot_Render(inventory, i, 8 + i * 18, 142)); - else - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); + else this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); } } @@ -97,7 +97,11 @@ public class GT_Container_CircuitProgrammer extends Container { Slot chipslot = (Slot) this.inventorySlots.get(0); if (SlotNR > 24) { Slot slot = (Slot) this.inventorySlots.get(SlotNR); - if (slot != null && slot.getStack() != null && slot.getStack().getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) { + if (slot != null + && slot.getStack() != null + && slot.getStack() + .getItem() + .equals(GT_Utility.getIntegratedCircuit(0).getItem())) { if (chipslot.getStack() == null) { chipslot.putStack(slot.getStack().copy()); slot.decrStackSize(1); @@ -162,8 +166,12 @@ public class GT_Container_CircuitProgrammer extends Container { @Override public void setInventorySlotContents(int slotNR, ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() != null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) { - this.Slot = BW_Util.setStackSize(itemStack.copy(),1); + if (itemStack != null + && itemStack.getItem() != null + && itemStack + .getItem() + .equals(GT_Utility.getIntegratedCircuit(0).getItem())) { + this.Slot = BW_Util.setStackSize(itemStack.copy(), 1); itemStack.stackSize--; this.tag = this.toBind.getTagCompound(); this.tag.setBoolean("HasChip", true); @@ -171,8 +179,15 @@ public class GT_Container_CircuitProgrammer extends Container { this.toBind.setTagCompound(this.tag); this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); if (!this.Player.isClientWorld()) - MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), true, (byte) itemStack.getItemDamage())); - } else if (BW_Util.checkStackAndPrefix(itemStack) && GT_OreDictUnificator.getAssociation(itemStack).mPrefix.equals(OrePrefixes.circuit) && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.equals(Materials.Basic)) { + MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket( + this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), true, (byte) + itemStack.getItemDamage())); + } else if (BW_Util.checkStackAndPrefix(itemStack) + && GT_OreDictUnificator.getAssociation(itemStack).mPrefix.equals(OrePrefixes.circuit) + && GT_OreDictUnificator.getAssociation(itemStack) + .mMaterial + .mMaterial + .equals(Materials.Basic)) { this.Slot = GT_Utility.getIntegratedCircuit(0); this.Slot.stackSize = 1; itemStack.stackSize--; @@ -182,19 +197,21 @@ public class GT_Container_CircuitProgrammer extends Container { this.toBind.setTagCompound(this.tag); this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); if (!this.Player.isClientWorld()) - MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), true, (byte) 0)); - }/* else if (GT_Utility.isStackValid(itemStack) && itemStack.getItem() instanceof Circuit_Programmer) { - ForgeHooks.onPlayerTossEvent(Player, itemStack, false); - this.closeInventory(); - Player.closeScreen(); - }*/ else { + MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket( + this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), true, (byte) 0)); + } /* else if (GT_Utility.isStackValid(itemStack) && itemStack.getItem() instanceof Circuit_Programmer) { + ForgeHooks.onPlayerTossEvent(Player, itemStack, false); + this.closeInventory(); + Player.closeScreen(); + }*/ else { ForgeHooks.onPlayerTossEvent(this.Player, itemStack, false); this.tag = this.toBind.getTagCompound(); this.tag.setBoolean("HasChip", false); this.toBind.setTagCompound(this.tag); this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); if (!this.Player.isClientWorld()) - MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), false, (byte) 0)); + MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket( + this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), false, (byte) 0)); } } @@ -214,9 +231,7 @@ public class GT_Container_CircuitProgrammer extends Container { } @Override - public void markDirty() { - - } + public void markDirty() {} @Override public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { @@ -224,19 +239,17 @@ public class GT_Container_CircuitProgrammer extends Container { } @Override - public void openInventory() { - - } + public void openInventory() {} @Override - public void closeInventory() { - - } + public void closeInventory() {} @Override public boolean isItemValidForSlot(int p_94041_1_, ItemStack itemStack) { - return itemStack != null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); + return itemStack != null + && itemStack + .getItem() + .equals(GT_Utility.getIntegratedCircuit(0).getItem()); } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java index 7f82680495..60f849e766 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java @@ -63,4 +63,4 @@ public class GT_Container_Item_Destructopack extends Container { Slot slotObject = (Slot) this.inventorySlots.get(0); slotObject.decrStackSize(0); } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java index 5541256158..198ff69c23 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java @@ -53,5 +53,4 @@ public class GT_Container_LESU extends GT_Container_MultiMachine { public int getShiftClickSlotCount() { return 6; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java index 9d89ad03b3..855d73bb75 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java @@ -27,6 +27,8 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_Container_1by1; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import java.nio.ByteBuffer; +import java.util.Iterator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ICrafting; @@ -34,9 +36,6 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import java.nio.ByteBuffer; -import java.util.Iterator; - public class GT_Container_RadioHatch extends GT_Container_1by1 { public byte mass, dmass; @@ -68,8 +67,7 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { this.teTimer = ByteBuffer.allocate(8).putLong(this.TE.getTimer()).array(); ++this.timer; Iterator var2 = this.crafters.iterator(); - if (this.timer >= Long.MAX_VALUE - 1) - this.timer = 0; + if (this.timer >= Long.MAX_VALUE - 1) this.timer = 0; while (true) { do { if (!var2.hasNext()) { @@ -88,25 +86,20 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { var1.sendProgressBarUpdate(this, 21, this.mass); if (this.timer % 500 == 10 || this.dsievert != this.sievert) var1.sendProgressBarUpdate(this, 22, (this.sievert - 100)); - if (this.timer % 500 == 10 || this.dr != this.r) - var1.sendProgressBarUpdate(this, 23, this.r); - if (this.timer % 500 == 10 || this.dg != this.g) - var1.sendProgressBarUpdate(this, 24, this.g); - if (this.timer % 500 == 10 || this.db != this.b) - var1.sendProgressBarUpdate(this, 25, this.b); + if (this.timer % 500 == 10 || this.dr != this.r) var1.sendProgressBarUpdate(this, 23, this.r); + if (this.timer % 500 == 10 || this.dg != this.g) var1.sendProgressBarUpdate(this, 24, this.g); + if (this.timer % 500 == 10 || this.db != this.b) var1.sendProgressBarUpdate(this, 25, this.b); if (this.timer % 500 == 10 || this.dteTimer != this.teTimer) for (int i = 0; i < this.teTimer.length; i++) { var1.sendProgressBarUpdate(this, 26 + i, this.teTimer[i]); } - if (this.timer % 500 == 10 || this.dsv != this.sv) - var1.sendProgressBarUpdate(this, 34, this.sv); + if (this.timer % 500 == 10 || this.dsv != this.sv) var1.sendProgressBarUpdate(this, 34, this.sv); } while (this.timer % 500 != 10 && this.dmass == this.mass); } } } - @SideOnly(Side.CLIENT) public void updateProgressBar(int par1, int par2) { super.updateProgressBar(par1, par2); @@ -162,28 +155,25 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { // Handle shift-clicking @Override - public ItemStack transferStackInSlot(EntityPlayer player, int id){ - Slot slot = (Slot)this.inventorySlots.get(id); + public ItemStack transferStackInSlot(EntityPlayer player, int id) { + Slot slot = (Slot) this.inventorySlots.get(id); ItemStack stack = slot.getStack(); - if(stack == null) - return null; - if(slot instanceof RadioSlot) + if (stack == null) return null; + if (slot instanceof RadioSlot) return super.transferStackInSlot(player, id); + else if (((GT_MetaTileEntity_RadioHatch) this.mTileEntity.getMetaTileEntity()).isStackValidRadioMaterial(stack)) return super.transferStackInSlot(player, id); - else if (((GT_MetaTileEntity_RadioHatch)this.mTileEntity.getMetaTileEntity()).isStackValidRadioMaterial(stack)) - return super.transferStackInSlot(player, id); - else - return null; + else return null; } - private static class RadioSlot extends Slot{ + private static class RadioSlot extends Slot { public RadioSlot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) { super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_); } @Override public boolean isItemValid(ItemStack p_75214_1_) { - return ((GT_MetaTileEntity_RadioHatch)((IGregTechTileEntity)this.inventory).getMetaTileEntity()).isStackValidRadioMaterial(p_75214_1_); + return ((GT_MetaTileEntity_RadioHatch) ((IGregTechTileEntity) this.inventory).getMetaTileEntity()) + .isStackValidRadioMaterial(p_75214_1_); } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java index 3ce3219bde..1ebf203610 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java @@ -36,6 +36,4 @@ public class BW_DelSlot extends Slot { p_75215_1_ = null; this.onSlotChanged(); } - - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java index 7bfb9a9234..d898826ed9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java @@ -21,626 +21,948 @@ */ package com.github.bartimaeusnek.bartworks.system.material; +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.Types.*; + import com.github.bartimaeusnek.bartworks.MainMod; import gregtech.api.enums.Materials; -import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.Types.*; - public class BW_GT_MaterialReference { - private static final Werkstoff.GenerationFeatures ADD_CASINGS_ONLY = new Werkstoff.GenerationFeatures().disable().addCasings(); + private static final Werkstoff.GenerationFeatures ADD_CASINGS_ONLY = + new Werkstoff.GenerationFeatures().disable().addCasings(); - public static Werkstoff Aluminium = new Werkstoff(Materials.Aluminium, ADD_CASINGS_ONLY, ELEMENT,31_766+19); - public static Werkstoff Americium = new Werkstoff(Materials.Americium, ADD_CASINGS_ONLY, ELEMENT,31_766+103); - public static Werkstoff Antimony = new Werkstoff(Materials.Antimony, ADD_CASINGS_ONLY, ELEMENT, 31_766+58); -// public static Werkstoff Argon = new Werkstoff(Materials.Argon, ADD_CASINGS_ONLY, ELEMENT, 31_766+24); - public static Werkstoff Arsenic = new Werkstoff(Materials.Arsenic, ADD_CASINGS_ONLY, ELEMENT, 31_766+39); - public static Werkstoff Barium = new Werkstoff(Materials.Barium, ADD_CASINGS_ONLY, ELEMENT, 31_766+63); - public static Werkstoff Beryllium = new Werkstoff(Materials.Beryllium, ADD_CASINGS_ONLY, ELEMENT, 31_766+8); - public static Werkstoff Bismuth = new Werkstoff(Materials.Bismuth, ADD_CASINGS_ONLY, ELEMENT, 31_766+90); - public static Werkstoff Boron = new Werkstoff(Materials.Boron, ADD_CASINGS_ONLY, ELEMENT, 31_766+9); - public static Werkstoff Caesium = new Werkstoff(Materials.Caesium, ADD_CASINGS_ONLY, ELEMENT, 31_766+62); -// public static Werkstoff Calcium = new Werkstoff(Materials.Calcium, ADD_CASINGS_ONLY, ELEMENT, 31_766+26); - public static Werkstoff Carbon = new Werkstoff(Materials.Carbon, ADD_CASINGS_ONLY, ELEMENT, 31_766+10); - public static Werkstoff Cadmium = new Werkstoff(Materials.Cadmium, ADD_CASINGS_ONLY, ELEMENT, 31_766+55); - public static Werkstoff Cerium = new Werkstoff(Materials.Cerium, ADD_CASINGS_ONLY, ELEMENT, 31_766+65); -// public static Werkstoff Chlorine = new Werkstoff(Materials.Chlorine, ADD_CASINGS_ONLY, ELEMENT, 31_766+23); - public static Werkstoff Chrome = new Werkstoff(Materials.Chrome, ADD_CASINGS_ONLY, ELEMENT, 31_766+30); - public static Werkstoff Cobalt = new Werkstoff(Materials.Cobalt, ADD_CASINGS_ONLY, ELEMENT, 31_766+33); - public static Werkstoff Copper = new Werkstoff(Materials.Copper, ADD_CASINGS_ONLY, ELEMENT, 31_766+35); -// public static Werkstoff Deuterium = new Werkstoff(Materials.Deuterium, ADD_CASINGS_ONLY, ELEMENT, 31_766+2); - public static Werkstoff Dysprosium = new Werkstoff(Materials.Dysprosium, ADD_CASINGS_ONLY, ELEMENT, 31_766+73); -// public static Werkstoff Empty = new Werkstoff(Materials.Empty, ADD_CASINGS_ONLY, ELEMENT, 31_766+0); - public static Werkstoff Erbium = new Werkstoff(Materials.Erbium, ADD_CASINGS_ONLY, ELEMENT, 31_766+75); - public static Werkstoff Europium = new Werkstoff(Materials.Europium, ADD_CASINGS_ONLY, ELEMENT, 31_766+70); -// public static Werkstoff Fluorine = new Werkstoff(Materials.Fluorine, ADD_CASINGS_ONLY, ELEMENT, 31_766+14); - public static Werkstoff Gadolinium = new Werkstoff(Materials.Gadolinium, ADD_CASINGS_ONLY, ELEMENT, 31_766+71); - public static Werkstoff Gallium = new Werkstoff(Materials.Gallium, ADD_CASINGS_ONLY, ELEMENT, 31_766+37); - public static Werkstoff Gold = new Werkstoff(Materials.Gold, ADD_CASINGS_ONLY, ELEMENT, 31_766+86); - public static Werkstoff Holmium = new Werkstoff(Materials.Holmium, ADD_CASINGS_ONLY, ELEMENT, 31_766+74); -// public static Werkstoff Hydrogen = new Werkstoff(Materials.Hydrogen, ADD_CASINGS_ONLY, ELEMENT, 31_766+1); -// public static Werkstoff Helium = new Werkstoff(Materials.Helium, ADD_CASINGS_ONLY, ELEMENT, 31_766+4); -// public static Werkstoff Helium_3 = new Werkstoff(Materials.Helium_3, ADD_CASINGS_ONLY, ELEMENT, 31_766+5); - public static Werkstoff Indium = new Werkstoff(Materials.Indium, ADD_CASINGS_ONLY, ELEMENT, 31_766+56); - public static Werkstoff Iridium = new Werkstoff(Materials.Iridium, ADD_CASINGS_ONLY, ELEMENT, 31_766+84); - public static Werkstoff Iron = new Werkstoff(Materials.Iron, ADD_CASINGS_ONLY, ELEMENT, 31_766+32); - public static Werkstoff Lanthanum = new Werkstoff(Materials.Lanthanum, ADD_CASINGS_ONLY, ELEMENT, 31_766+64); - public static Werkstoff Lead = new Werkstoff(Materials.Lead, ADD_CASINGS_ONLY, ELEMENT, 31_766+89); - public static Werkstoff Lithium = new Werkstoff(Materials.Lithium, ADD_CASINGS_ONLY, ELEMENT, 31_766+6); - public static Werkstoff Lutetium = new Werkstoff(Materials.Lutetium, ADD_CASINGS_ONLY, ELEMENT, 31_766+78); - public static Werkstoff Magnesium = new Werkstoff(Materials.Magnesium, ADD_CASINGS_ONLY, ELEMENT, 31_766+18); - public static Werkstoff Manganese = new Werkstoff(Materials.Manganese, ADD_CASINGS_ONLY, ELEMENT, 31_766+31); -// public static Werkstoff Mercury = new Werkstoff(Materials.Mercury, ADD_CASINGS_ONLY, ELEMENT, 31_766+87); - public static Werkstoff Molybdenum = new Werkstoff(Materials.Molybdenum, ADD_CASINGS_ONLY, ELEMENT, 31_766+48); - public static Werkstoff Neodymium = new Werkstoff(Materials.Neodymium, ADD_CASINGS_ONLY, ELEMENT, 31_766+67); - public static Werkstoff Neutronium = new Werkstoff(Materials.Neutronium, ADD_CASINGS_ONLY, ELEMENT,31_766+129); - public static Werkstoff Nickel = new Werkstoff(Materials.Nickel, ADD_CASINGS_ONLY, ELEMENT, 31_766+34); - public static Werkstoff Niobium = new Werkstoff(Materials.Niobium, ADD_CASINGS_ONLY, ELEMENT, 31_766+47); -// public static Werkstoff Nitrogen = new Werkstoff(Materials.Nitrogen, ADD_CASINGS_ONLY, ELEMENT, 31_766+12); - public static Werkstoff Osmium = new Werkstoff(Materials.Osmium, ADD_CASINGS_ONLY, ELEMENT, 31_766+83); -// public static Werkstoff Oxygen = new Werkstoff(Materials.Oxygen, ADD_CASINGS_ONLY, ELEMENT, 31_766+13); - public static Werkstoff Palladium = new Werkstoff(Materials.Palladium, ADD_CASINGS_ONLY, ELEMENT, 31_766+52); - public static Werkstoff Phosphorus = new Werkstoff(Materials.Phosphorus, ADD_CASINGS_ONLY, ELEMENT, 31_766+21); - public static Werkstoff Platinum = new Werkstoff(Materials.Platinum, ADD_CASINGS_ONLY, ELEMENT, 31_766+85); - public static Werkstoff Plutonium = new Werkstoff(Materials.Plutonium, ADD_CASINGS_ONLY, ELEMENT,31_766+100); - public static Werkstoff Plutonium241 = new Werkstoff(Materials.Plutonium241, ADD_CASINGS_ONLY, ISOTOPE,31_766+101); - public static Werkstoff Potassium = new Werkstoff(Materials.Potassium, ADD_CASINGS_ONLY, ELEMENT, 31_766+25); - public static Werkstoff Praseodymium = new Werkstoff(Materials.Praseodymium, ADD_CASINGS_ONLY, ELEMENT, 31_766+66); - public static Werkstoff Promethium = new Werkstoff(Materials.Promethium, ADD_CASINGS_ONLY, ELEMENT, 31_766+68); -// public static Werkstoff Radon = new Werkstoff(Materials.Radon, ADD_CASINGS_ONLY, ELEMENT, 31_766+93); - public static Werkstoff Rubidium = new Werkstoff(Materials.Rubidium, ADD_CASINGS_ONLY, ELEMENT, 31_766+43); - public static Werkstoff Samarium = new Werkstoff(Materials.Samarium, ADD_CASINGS_ONLY, ELEMENT, 31_766+69); - public static Werkstoff Scandium = new Werkstoff(Materials.Scandium, ADD_CASINGS_ONLY, ELEMENT, 31_766+27); - public static Werkstoff Silicon = new Werkstoff(Materials.Silicon, ADD_CASINGS_ONLY, ELEMENT, 31_766+20); - public static Werkstoff Silver = new Werkstoff(Materials.Silver, ADD_CASINGS_ONLY, ELEMENT, 31_766+54); - public static Werkstoff Sodium = new Werkstoff(Materials.Sodium, ADD_CASINGS_ONLY, ELEMENT, 31_766+17); - public static Werkstoff Strontium = new Werkstoff(Materials.Strontium, ADD_CASINGS_ONLY, ELEMENT, 31_766+44); - public static Werkstoff Sulfur = new Werkstoff(Materials.Sulfur, ADD_CASINGS_ONLY, ELEMENT, 31_766+22); - public static Werkstoff Tantalum = new Werkstoff(Materials.Tantalum, ADD_CASINGS_ONLY, ELEMENT, 31_766+80); -// public static Werkstoff Tellurium = new Werkstoff(Materials.Tellurium, ADD_CASINGS_ONLY, ELEMENT, 31_766+59); - public static Werkstoff Terbium = new Werkstoff(Materials.Terbium, ADD_CASINGS_ONLY, ELEMENT, 31_766+72); - public static Werkstoff Thorium = new Werkstoff(Materials.Thorium, ADD_CASINGS_ONLY, ELEMENT, 31_766+96); - public static Werkstoff Thulium = new Werkstoff(Materials.Thulium, ADD_CASINGS_ONLY, ELEMENT, 31_766+76); - public static Werkstoff Tin = new Werkstoff(Materials.Tin, ADD_CASINGS_ONLY, ELEMENT, 31_766+57); - public static Werkstoff Titanium = new Werkstoff(Materials.Titanium, ADD_CASINGS_ONLY, ELEMENT, 31_766+28); - public static Werkstoff Tritanium = new Werkstoff(Materials.Tritanium, ADD_CASINGS_ONLY, ELEMENT,31_766+329); - public static Werkstoff Tritium = new Werkstoff(Materials.Tritium, ADD_CASINGS_ONLY, ELEMENT, 31_766+3); - public static Werkstoff Tungsten = new Werkstoff(Materials.Tungsten, ADD_CASINGS_ONLY, ELEMENT, 31_766+81); - public static Werkstoff Uranium = new Werkstoff(Materials.Uranium, ADD_CASINGS_ONLY, ELEMENT, 31_766+98); - public static Werkstoff Uranium235 = new Werkstoff(Materials.Uranium235, ADD_CASINGS_ONLY, ISOTOPE, 31_766+97); - public static Werkstoff Vanadium = new Werkstoff(Materials.Vanadium, ADD_CASINGS_ONLY, ELEMENT, 31_766+29); - public static Werkstoff Ytterbium = new Werkstoff(Materials.Ytterbium, ADD_CASINGS_ONLY, ELEMENT, 31_766+77); - public static Werkstoff Yttrium = new Werkstoff(Materials.Yttrium, ADD_CASINGS_ONLY, ELEMENT, 31_766+45); - public static Werkstoff Zinc = new Werkstoff(Materials.Zinc, ADD_CASINGS_ONLY, ELEMENT, 31_766+36); - public static Werkstoff Ardite = new Werkstoff(Materials.Ardite, ADD_CASINGS_ONLY, ELEMENT,31_766+382); - public static Werkstoff Naquadah = new Werkstoff(Materials.Naquadah, ADD_CASINGS_ONLY, ELEMENT,31_766+324); - public static Werkstoff NaquadahAlloy = new Werkstoff(Materials.NaquadahAlloy, ADD_CASINGS_ONLY, COMPOUND,31_766+325); - public static Werkstoff NaquadahEnriched = new Werkstoff(Materials.NaquadahEnriched, ADD_CASINGS_ONLY, ISOTOPE,31_766+326); - public static Werkstoff Naquadria = new Werkstoff(Materials.Naquadria, ADD_CASINGS_ONLY, ELEMENT,31_766+327); - public static Werkstoff WroughtIron = new Werkstoff(Materials.WroughtIron, ADD_CASINGS_ONLY, ISOTOPE,31_766+304); - public static Werkstoff AnnealedCopper = new Werkstoff(Materials.AnnealedCopper, ADD_CASINGS_ONLY, ISOTOPE,31_766+345); + public static Werkstoff Aluminium = new Werkstoff(Materials.Aluminium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 19); + public static Werkstoff Americium = new Werkstoff(Materials.Americium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 103); + public static Werkstoff Antimony = new Werkstoff(Materials.Antimony, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 58); + // public static Werkstoff Argon = new Werkstoff(Materials.Argon, ADD_CASINGS_ONLY, ELEMENT, 31_766+24); + public static Werkstoff Arsenic = new Werkstoff(Materials.Arsenic, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 39); + public static Werkstoff Barium = new Werkstoff(Materials.Barium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 63); + public static Werkstoff Beryllium = new Werkstoff(Materials.Beryllium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 8); + public static Werkstoff Bismuth = new Werkstoff(Materials.Bismuth, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 90); + public static Werkstoff Boron = new Werkstoff(Materials.Boron, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 9); + public static Werkstoff Caesium = new Werkstoff(Materials.Caesium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 62); + // public static Werkstoff Calcium = new Werkstoff(Materials.Calcium, ADD_CASINGS_ONLY, ELEMENT, 31_766+26); + public static Werkstoff Carbon = new Werkstoff(Materials.Carbon, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 10); + public static Werkstoff Cadmium = new Werkstoff(Materials.Cadmium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 55); + public static Werkstoff Cerium = new Werkstoff(Materials.Cerium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 65); + // public static Werkstoff Chlorine = new Werkstoff(Materials.Chlorine, ADD_CASINGS_ONLY, ELEMENT, 31_766+23); + public static Werkstoff Chrome = new Werkstoff(Materials.Chrome, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 30); + public static Werkstoff Cobalt = new Werkstoff(Materials.Cobalt, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 33); + public static Werkstoff Copper = new Werkstoff(Materials.Copper, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 35); + // public static Werkstoff Deuterium = new Werkstoff(Materials.Deuterium, ADD_CASINGS_ONLY, ELEMENT, 31_766+2); + public static Werkstoff Dysprosium = new Werkstoff(Materials.Dysprosium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 73); + // public static Werkstoff Empty = new Werkstoff(Materials.Empty, ADD_CASINGS_ONLY, ELEMENT, 31_766+0); + public static Werkstoff Erbium = new Werkstoff(Materials.Erbium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 75); + public static Werkstoff Europium = new Werkstoff(Materials.Europium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 70); + // public static Werkstoff Fluorine = new Werkstoff(Materials.Fluorine, ADD_CASINGS_ONLY, ELEMENT, 31_766+14); + public static Werkstoff Gadolinium = new Werkstoff(Materials.Gadolinium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 71); + public static Werkstoff Gallium = new Werkstoff(Materials.Gallium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 37); + public static Werkstoff Gold = new Werkstoff(Materials.Gold, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 86); + public static Werkstoff Holmium = new Werkstoff(Materials.Holmium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 74); + // public static Werkstoff Hydrogen = new Werkstoff(Materials.Hydrogen, ADD_CASINGS_ONLY, ELEMENT, 31_766+1); + // public static Werkstoff Helium = new Werkstoff(Materials.Helium, ADD_CASINGS_ONLY, ELEMENT, 31_766+4); + // public static Werkstoff Helium_3 = new Werkstoff(Materials.Helium_3, ADD_CASINGS_ONLY, ELEMENT, 31_766+5); + public static Werkstoff Indium = new Werkstoff(Materials.Indium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 56); + public static Werkstoff Iridium = new Werkstoff(Materials.Iridium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 84); + public static Werkstoff Iron = new Werkstoff(Materials.Iron, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 32); + public static Werkstoff Lanthanum = new Werkstoff(Materials.Lanthanum, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 64); + public static Werkstoff Lead = new Werkstoff(Materials.Lead, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 89); + public static Werkstoff Lithium = new Werkstoff(Materials.Lithium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 6); + public static Werkstoff Lutetium = new Werkstoff(Materials.Lutetium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 78); + public static Werkstoff Magnesium = new Werkstoff(Materials.Magnesium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 18); + public static Werkstoff Manganese = new Werkstoff(Materials.Manganese, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 31); + // public static Werkstoff Mercury = new Werkstoff(Materials.Mercury, ADD_CASINGS_ONLY, ELEMENT, 31_766+87); + public static Werkstoff Molybdenum = new Werkstoff(Materials.Molybdenum, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 48); + public static Werkstoff Neodymium = new Werkstoff(Materials.Neodymium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 67); + public static Werkstoff Neutronium = new Werkstoff(Materials.Neutronium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 129); + public static Werkstoff Nickel = new Werkstoff(Materials.Nickel, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 34); + public static Werkstoff Niobium = new Werkstoff(Materials.Niobium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 47); + // public static Werkstoff Nitrogen = new Werkstoff(Materials.Nitrogen, ADD_CASINGS_ONLY, ELEMENT, 31_766+12); + public static Werkstoff Osmium = new Werkstoff(Materials.Osmium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 83); + // public static Werkstoff Oxygen = new Werkstoff(Materials.Oxygen, ADD_CASINGS_ONLY, ELEMENT, 31_766+13); + public static Werkstoff Palladium = new Werkstoff(Materials.Palladium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 52); + public static Werkstoff Phosphorus = new Werkstoff(Materials.Phosphorus, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 21); + public static Werkstoff Platinum = new Werkstoff(Materials.Platinum, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 85); + public static Werkstoff Plutonium = new Werkstoff(Materials.Plutonium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 100); + public static Werkstoff Plutonium241 = + new Werkstoff(Materials.Plutonium241, ADD_CASINGS_ONLY, ISOTOPE, 31_766 + 101); + public static Werkstoff Potassium = new Werkstoff(Materials.Potassium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 25); + public static Werkstoff Praseodymium = + new Werkstoff(Materials.Praseodymium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 66); + public static Werkstoff Promethium = new Werkstoff(Materials.Promethium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 68); + // public static Werkstoff Radon = new Werkstoff(Materials.Radon, ADD_CASINGS_ONLY, ELEMENT, 31_766+93); + public static Werkstoff Rubidium = new Werkstoff(Materials.Rubidium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 43); + public static Werkstoff Samarium = new Werkstoff(Materials.Samarium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 69); + public static Werkstoff Scandium = new Werkstoff(Materials.Scandium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 27); + public static Werkstoff Silicon = new Werkstoff(Materials.Silicon, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 20); + public static Werkstoff Silver = new Werkstoff(Materials.Silver, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 54); + public static Werkstoff Sodium = new Werkstoff(Materials.Sodium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 17); + public static Werkstoff Strontium = new Werkstoff(Materials.Strontium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 44); + public static Werkstoff Sulfur = new Werkstoff(Materials.Sulfur, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 22); + public static Werkstoff Tantalum = new Werkstoff(Materials.Tantalum, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 80); + // public static Werkstoff Tellurium = new Werkstoff(Materials.Tellurium, ADD_CASINGS_ONLY, ELEMENT, 31_766+59); + public static Werkstoff Terbium = new Werkstoff(Materials.Terbium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 72); + public static Werkstoff Thorium = new Werkstoff(Materials.Thorium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 96); + public static Werkstoff Thulium = new Werkstoff(Materials.Thulium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 76); + public static Werkstoff Tin = new Werkstoff(Materials.Tin, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 57); + public static Werkstoff Titanium = new Werkstoff(Materials.Titanium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 28); + public static Werkstoff Tritanium = new Werkstoff(Materials.Tritanium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 329); + public static Werkstoff Tritium = new Werkstoff(Materials.Tritium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 3); + public static Werkstoff Tungsten = new Werkstoff(Materials.Tungsten, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 81); + public static Werkstoff Uranium = new Werkstoff(Materials.Uranium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 98); + public static Werkstoff Uranium235 = new Werkstoff(Materials.Uranium235, ADD_CASINGS_ONLY, ISOTOPE, 31_766 + 97); + public static Werkstoff Vanadium = new Werkstoff(Materials.Vanadium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 29); + public static Werkstoff Ytterbium = new Werkstoff(Materials.Ytterbium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 77); + public static Werkstoff Yttrium = new Werkstoff(Materials.Yttrium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 45); + public static Werkstoff Zinc = new Werkstoff(Materials.Zinc, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 36); + public static Werkstoff Ardite = new Werkstoff(Materials.Ardite, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 382); + public static Werkstoff Naquadah = new Werkstoff(Materials.Naquadah, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 324); + public static Werkstoff NaquadahAlloy = + new Werkstoff(Materials.NaquadahAlloy, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 325); + public static Werkstoff NaquadahEnriched = + new Werkstoff(Materials.NaquadahEnriched, ADD_CASINGS_ONLY, ISOTOPE, 31_766 + 326); + public static Werkstoff Naquadria = new Werkstoff(Materials.Naquadria, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 327); + public static Werkstoff WroughtIron = new Werkstoff(Materials.WroughtIron, ADD_CASINGS_ONLY, ISOTOPE, 31_766 + 304); + public static Werkstoff AnnealedCopper = + new Werkstoff(Materials.AnnealedCopper, ADD_CASINGS_ONLY, ISOTOPE, 31_766 + 345); - public static Werkstoff Osmiridium = new Werkstoff(Materials.Osmiridium, ADD_CASINGS_ONLY, MIXTURE,31_766+317); - public static Werkstoff SterlingSilver = new Werkstoff(Materials.SterlingSilver, ADD_CASINGS_ONLY, MIXTURE,31_766+350); - public static Werkstoff RoseGold = new Werkstoff(Materials.RoseGold, ADD_CASINGS_ONLY, MIXTURE,31_766+351); - public static Werkstoff BlackBronze = new Werkstoff(Materials.BlackBronze, ADD_CASINGS_ONLY, MIXTURE,31_766+352); - public static Werkstoff BismuthBronze = new Werkstoff(Materials.BismuthBronze, ADD_CASINGS_ONLY, MIXTURE,31_766+353); - public static Werkstoff BlackSteel = new Werkstoff(Materials.BlackSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+334); - public static Werkstoff RedSteel = new Werkstoff(Materials.RedSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+348); - public static Werkstoff BlueSteel = new Werkstoff(Materials.BlueSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+349); - public static Werkstoff DamascusSteel = new Werkstoff(Materials.DamascusSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+335); - public static Werkstoff TungstenSteel = new Werkstoff(Materials.TungstenSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+316); - public static Werkstoff Ultimet = new Werkstoff(Materials.Ultimet, ADD_CASINGS_ONLY, MIXTURE,31_766+344); - public static Werkstoff TungstenCarbide = new Werkstoff(Materials.TungstenCarbide, ADD_CASINGS_ONLY, MIXTURE,31_766+370); - public static Werkstoff VanadiumSteel = new Werkstoff(Materials.VanadiumSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+371); - public static Werkstoff HSSG = new Werkstoff(Materials.HSSG, ADD_CASINGS_ONLY, MIXTURE,31_766+372); - public static Werkstoff HSSE = new Werkstoff(Materials.HSSE, ADD_CASINGS_ONLY, MIXTURE,31_766+373); - public static Werkstoff HSSS = new Werkstoff(Materials.HSSS, ADD_CASINGS_ONLY, MIXTURE,31_766+374); - public static Werkstoff StainlessSteel = new Werkstoff(Materials.StainlessSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+306); - public static Werkstoff Brass = new Werkstoff(Materials.Brass, ADD_CASINGS_ONLY, MIXTURE,31_766+301); - public static Werkstoff Bronze = new Werkstoff(Materials.Bronze, ADD_CASINGS_ONLY, MIXTURE,31_766+300); + public static Werkstoff Osmiridium = new Werkstoff(Materials.Osmiridium, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 317); + public static Werkstoff SterlingSilver = + new Werkstoff(Materials.SterlingSilver, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 350); + public static Werkstoff RoseGold = new Werkstoff(Materials.RoseGold, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 351); + public static Werkstoff BlackBronze = new Werkstoff(Materials.BlackBronze, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 352); + public static Werkstoff BismuthBronze = + new Werkstoff(Materials.BismuthBronze, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 353); + public static Werkstoff BlackSteel = new Werkstoff(Materials.BlackSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 334); + public static Werkstoff RedSteel = new Werkstoff(Materials.RedSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 348); + public static Werkstoff BlueSteel = new Werkstoff(Materials.BlueSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 349); + public static Werkstoff DamascusSteel = + new Werkstoff(Materials.DamascusSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 335); + public static Werkstoff TungstenSteel = + new Werkstoff(Materials.TungstenSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 316); + public static Werkstoff Ultimet = new Werkstoff(Materials.Ultimet, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 344); + public static Werkstoff TungstenCarbide = + new Werkstoff(Materials.TungstenCarbide, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 370); + public static Werkstoff VanadiumSteel = + new Werkstoff(Materials.VanadiumSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 371); + public static Werkstoff HSSG = new Werkstoff(Materials.HSSG, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 372); + public static Werkstoff HSSE = new Werkstoff(Materials.HSSE, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 373); + public static Werkstoff HSSS = new Werkstoff(Materials.HSSS, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 374); + public static Werkstoff StainlessSteel = + new Werkstoff(Materials.StainlessSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 306); + public static Werkstoff Brass = new Werkstoff(Materials.Brass, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 301); + public static Werkstoff Bronze = new Werkstoff(Materials.Bronze, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 300); - public static Werkstoff Wood = new Werkstoff(Materials.Wood, ADD_CASINGS_ONLY, BIOLOGICAL,31_766+809); - // public static Werkstoff WoodSealed = new Werkstoff(Materials.WoodSealed, ADD_CASINGS_ONLY, BIOLOGICAL,31_766+889); - //public static Werkstoff Cheese = new Werkstoff(Materials.Cheese, new Werkstoff.GenerationFeatures().addCasings().addMetalItems().addMultipleIngotMetalWorkingItems().enforceUnification(), BIOLOGICAL,31_766+894); + public static Werkstoff Wood = new Werkstoff(Materials.Wood, ADD_CASINGS_ONLY, BIOLOGICAL, 31_766 + 809); + // public static Werkstoff WoodSealed = new Werkstoff(Materials.WoodSealed, ADD_CASINGS_ONLY, + // BIOLOGICAL,31_766+889); + // public static Werkstoff Cheese = new Werkstoff(Materials.Cheese, new + // Werkstoff.GenerationFeatures().addCasings().addMetalItems().addMultipleIngotMetalWorkingItems().enforceUnification(), BIOLOGICAL,31_766+894); - public static Werkstoff Steel = new Werkstoff(Materials.Steel, ADD_CASINGS_ONLY, COMPOUND,31_766+305); - public static Werkstoff Polytetrafluoroethylene = new Werkstoff(Materials.Polytetrafluoroethylene, ADD_CASINGS_ONLY, COMPOUND,31_766+473); - public static Werkstoff Plastic = new Werkstoff(Materials.Plastic, ADD_CASINGS_ONLY, COMPOUND,31_766+874); - public static Werkstoff Epoxid = new Werkstoff(Materials.Epoxid, ADD_CASINGS_ONLY, COMPOUND,31_766+470); - public static Werkstoff Magnesia = new Werkstoff(Materials.Magnesia, new Werkstoff.GenerationFeatures().disable().addMetalItems().addMolten(), COMPOUND,31_766+471); + public static Werkstoff Steel = new Werkstoff(Materials.Steel, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 305); + public static Werkstoff Polytetrafluoroethylene = + new Werkstoff(Materials.Polytetrafluoroethylene, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 473); + public static Werkstoff Plastic = new Werkstoff(Materials.Plastic, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 874); + public static Werkstoff Epoxid = new Werkstoff(Materials.Epoxid, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 470); + public static Werkstoff Magnesia = new Werkstoff( + Materials.Magnesia, + new Werkstoff.GenerationFeatures().disable().addMetalItems().addMolten(), + COMPOUND, + 31_766 + 471); public static void init() { MainMod.LOGGER.info("Load Elements from GT"); } -// TODO: GT++ only? + // TODO: GT++ only? -// public static Werkstoff Flerovium = new Werkstoff(Materials.Flerovium, , ,31_766+984); + // public static Werkstoff Flerovium = new Werkstoff(Materials.Flerovium, , + // ,31_766+984); -// public static Werkstoff HeeEndium = new Werkstoff(Materials.HeeEndium, , ,31_766+770); -// public static Werkstoff PlatinumGroupSludge = new Werkstoff(Materials.PlatinumGroupSludge, , ,31_766+241); -// public static Werkstoff Draconium = new Werkstoff(Materials.Draconium, , ,31_766+975); -// public static Werkstoff DraconiumAwakened = new Werkstoff(Materials.DraconiumAwakened, , ,31_766+976); -// public static Werkstoff Adamantium = new Werkstoff(Materials.Adamantium, , ,31_766+319); -// public static Werkstoff Alduorite = new Werkstoff(Materials.Alduorite, , ,31_766+485); -// public static Werkstoff Amber = new Werkstoff(Materials.Amber, , ,31_766+514); -// public static Werkstoff Angmallen = new Werkstoff(Materials.Angmallen, , ,31_766+958); + // public static Werkstoff HeeEndium = new Werkstoff(Materials.HeeEndium, , + // ,31_766+770); + // public static Werkstoff PlatinumGroupSludge = new Werkstoff(Materials.PlatinumGroupSludge, + // , ,31_766+241); + // public static Werkstoff Draconium = new Werkstoff(Materials.Draconium, , + // ,31_766+975); + // public static Werkstoff DraconiumAwakened = new Werkstoff(Materials.DraconiumAwakened, , + // ,31_766+976); + // public static Werkstoff Adamantium = new Werkstoff(Materials.Adamantium, , + // ,31_766+319); + // public static Werkstoff Alduorite = new Werkstoff(Materials.Alduorite, , + // ,31_766+485); + // public static Werkstoff Amber = new Werkstoff(Materials.Amber, , ,31_766+514); + // public static Werkstoff Angmallen = new Werkstoff(Materials.Angmallen, , + // ,31_766+958); -// public static Werkstoff Atlarus = new Werkstoff(Materials.Atlarus, , ,31_766+965); -// public static Werkstoff Blizz = new Werkstoff(Materials.Blizz, , ,31_766+851); -// public static Werkstoff Blueschist = new Werkstoff(Materials.Blueschist, , ,31_766+852); -// public static Werkstoff Bluestone = new Werkstoff(Materials.Bluestone, , ,31_766+813); -// public static Werkstoff Carmot = new Werkstoff(Materials.Carmot, , ,31_766+962); -// public static Werkstoff Celenegil = new Werkstoff(Materials.Celenegil, , ,31_766+964); -// public static Werkstoff CertusQuartz = new Werkstoff(Materials.CertusQuartz, , ,31_766+516); -// public static Werkstoff Ceruclase = new Werkstoff(Materials.Ceruclase, , ,31_766+952); -// public static Werkstoff CobaltHexahydrate = new Werkstoff(Materials.CobaltHexahydrate, , ,31_766+853); -// public static Werkstoff ConstructionFoam = new Werkstoff(Materials.ConstructionFoam, , ,31_766+854); -// public static Werkstoff Chert = new Werkstoff(Materials.Chert, , ,31_766+857); -// public static Werkstoff CrudeOil = new Werkstoff(Materials.CrudeOil, , ,31_766+858); -// public static Werkstoff Dacite = new Werkstoff(Materials.Dacite, , ,31_766+859); -// public static Werkstoff DarkIron = new Werkstoff(Materials.DarkIron, , ,31_766+342); -// public static Werkstoff Desh = new Werkstoff(Materials.Desh, , ,31_766+884); -// public static Werkstoff Dilithium = new Werkstoff(Materials.Dilithium, , ,31_766+515); -// public static Werkstoff Duranium = new Werkstoff(Materials.Duranium, , ,31_766+328); -// public static Werkstoff Eclogite = new Werkstoff(Materials.Eclogite, , ,31_766+860); -// public static Werkstoff ElectrumFlux = new Werkstoff(Materials.ElectrumFlux, , ,31_766+320); -// public static Werkstoff Emery = new Werkstoff(Materials.Emery, , ,31_766+861); -// public static Werkstoff EnderiumBase = new Werkstoff(Materials.EnderiumBase, , ,31_766+380); -// public static Werkstoff Epidote = new Werkstoff(Materials.Epidote, , ,31_766+862); -// public static Werkstoff Eximite = new Werkstoff(Materials.Eximite, , ,31_766+959); -// public static Werkstoff FierySteel = new Werkstoff(Materials.FierySteel, , ,31_766+346); -// public static Werkstoff Firestone = new Werkstoff(Materials.Firestone, , ,31_766+347); -// public static Werkstoff FoolsRuby = new Werkstoff(Materials.FoolsRuby, , ,31_766+512); -// public static Werkstoff Force = new Werkstoff(Materials.Force, , ,31_766+521); -// public static Werkstoff Forcicium = new Werkstoff(Materials.Forcicium, , ,31_766+518); -// public static Werkstoff Forcillium = new Werkstoff(Materials.Forcillium, , ,31_766+519); -// public static Werkstoff Gabbro = new Werkstoff(Materials.Gabbro, , ,31_766+863); -// public static Werkstoff Glowstone = new Werkstoff(Materials.Glowstone, , ,31_766+811); -// public static Werkstoff Gneiss = new Werkstoff(Materials.Gneiss, , ,31_766+864); -// public static Werkstoff Graphite = new Werkstoff(Materials.Graphite, , ,31_766+865); -// public static Werkstoff Graphene = new Werkstoff(Materials.Graphene, , ,31_766+819); -// public static Werkstoff Greenschist = new Werkstoff(Materials.Greenschist, , ,31_766+866); -// public static Werkstoff Greenstone = new Werkstoff(Materials.Greenstone, , ,31_766+867); -// public static Werkstoff Greywacke = new Werkstoff(Materials.Greywacke, , ,31_766+897); -// public static Werkstoff Haderoth = new Werkstoff(Materials.Haderoth, , ,31_766+963); -// public static Werkstoff Hepatizon = new Werkstoff(Materials.Hepatizon, , ,31_766+957); -// public static Werkstoff HSLA = new Werkstoff(Materials.HSLA, , ,31_766+322); -// public static Werkstoff Ignatius = new Werkstoff(Materials.Ignatius, , ,31_766+950); -// public static Werkstoff Infuscolium = new Werkstoff(Materials.Infuscolium, , ,31_766+490); -// public static Werkstoff InfusedGold = new Werkstoff(Materials.InfusedGold, , ,31_766+323); -// public static Werkstoff InfusedAir = new Werkstoff(Materials.InfusedAir, , ,31_766+540); -// public static Werkstoff InfusedFire = new Werkstoff(Materials.InfusedFire, , ,31_766+541); -// public static Werkstoff InfusedEarth = new Werkstoff(Materials.InfusedEarth, , ,31_766+542); -// public static Werkstoff InfusedWater = new Werkstoff(Materials.InfusedWater, , ,31_766+543); -// public static Werkstoff InfusedEntropy = new Werkstoff(Materials.InfusedEntropy, , ,31_766+544); -// public static Werkstoff InfusedOrder = new Werkstoff(Materials.InfusedOrder, , ,31_766+545); -// public static Werkstoff Inolashite = new Werkstoff(Materials.Inolashite, , ,31_766+954); -// public static Werkstoff Jade = new Werkstoff(Materials.Jade, , ,31_766+537); -// public static Werkstoff Jasper = new Werkstoff(Materials.Jasper, , ,31_766+511); -// public static Werkstoff Kalendrite = new Werkstoff(Materials.Kalendrite, , ,31_766+953); -// public static Werkstoff Komatiite = new Werkstoff(Materials.Komatiite, , ,31_766+869); -// public static Werkstoff Lava = new Werkstoff(Materials.Lava, , ,31_766+700); -// public static Werkstoff Lemurite = new Werkstoff(Materials.Lemurite, , ,31_766+486); -// public static Werkstoff MeteoricIron = new Werkstoff(Materials.MeteoricIron, , ,31_766+340); -// public static Werkstoff MeteoricSteel = new Werkstoff(Materials.MeteoricSteel, , ,31_766+341); -// public static Werkstoff Meutoite = new Werkstoff(Materials.Meutoite, , ,31_766+487); -// public static Werkstoff Migmatite = new Werkstoff(Materials.Migmatite, , ,31_766+872); + // public static Werkstoff Atlarus = new Werkstoff(Materials.Atlarus, , + // ,31_766+965); + // public static Werkstoff Blizz = new Werkstoff(Materials.Blizz, , ,31_766+851); + // public static Werkstoff Blueschist = new Werkstoff(Materials.Blueschist, , + // ,31_766+852); + // public static Werkstoff Bluestone = new Werkstoff(Materials.Bluestone, , + // ,31_766+813); + // public static Werkstoff Carmot = new Werkstoff(Materials.Carmot, , ,31_766+962); + // public static Werkstoff Celenegil = new Werkstoff(Materials.Celenegil, , + // ,31_766+964); + // public static Werkstoff CertusQuartz = new Werkstoff(Materials.CertusQuartz, , + // ,31_766+516); + // public static Werkstoff Ceruclase = new Werkstoff(Materials.Ceruclase, , + // ,31_766+952); + // public static Werkstoff CobaltHexahydrate = new Werkstoff(Materials.CobaltHexahydrate, , + // ,31_766+853); + // public static Werkstoff ConstructionFoam = new Werkstoff(Materials.ConstructionFoam, , + // ,31_766+854); + // public static Werkstoff Chert = new Werkstoff(Materials.Chert, , ,31_766+857); + // public static Werkstoff CrudeOil = new Werkstoff(Materials.CrudeOil, , + // ,31_766+858); + // public static Werkstoff Dacite = new Werkstoff(Materials.Dacite, , ,31_766+859); + // public static Werkstoff DarkIron = new Werkstoff(Materials.DarkIron, , + // ,31_766+342); + // public static Werkstoff Desh = new Werkstoff(Materials.Desh, , ,31_766+884); + // public static Werkstoff Dilithium = new Werkstoff(Materials.Dilithium, , + // ,31_766+515); + // public static Werkstoff Duranium = new Werkstoff(Materials.Duranium, , + // ,31_766+328); + // public static Werkstoff Eclogite = new Werkstoff(Materials.Eclogite, , + // ,31_766+860); + // public static Werkstoff ElectrumFlux = new Werkstoff(Materials.ElectrumFlux, , + // ,31_766+320); + // public static Werkstoff Emery = new Werkstoff(Materials.Emery, , ,31_766+861); + // public static Werkstoff EnderiumBase = new Werkstoff(Materials.EnderiumBase, , + // ,31_766+380); + // public static Werkstoff Epidote = new Werkstoff(Materials.Epidote, , + // ,31_766+862); + // public static Werkstoff Eximite = new Werkstoff(Materials.Eximite, , + // ,31_766+959); + // public static Werkstoff FierySteel = new Werkstoff(Materials.FierySteel, , + // ,31_766+346); + // public static Werkstoff Firestone = new Werkstoff(Materials.Firestone, , + // ,31_766+347); + // public static Werkstoff FoolsRuby = new Werkstoff(Materials.FoolsRuby, , + // ,31_766+512); + // public static Werkstoff Force = new Werkstoff(Materials.Force, , ,31_766+521); + // public static Werkstoff Forcicium = new Werkstoff(Materials.Forcicium, , + // ,31_766+518); + // public static Werkstoff Forcillium = new Werkstoff(Materials.Forcillium, , + // ,31_766+519); + // public static Werkstoff Gabbro = new Werkstoff(Materials.Gabbro, , ,31_766+863); + // public static Werkstoff Glowstone = new Werkstoff(Materials.Glowstone, , + // ,31_766+811); + // public static Werkstoff Gneiss = new Werkstoff(Materials.Gneiss, , ,31_766+864); + // public static Werkstoff Graphite = new Werkstoff(Materials.Graphite, , + // ,31_766+865); + // public static Werkstoff Graphene = new Werkstoff(Materials.Graphene, , + // ,31_766+819); + // public static Werkstoff Greenschist = new Werkstoff(Materials.Greenschist, , + // ,31_766+866); + // public static Werkstoff Greenstone = new Werkstoff(Materials.Greenstone, , + // ,31_766+867); + // public static Werkstoff Greywacke = new Werkstoff(Materials.Greywacke, , + // ,31_766+897); + // public static Werkstoff Haderoth = new Werkstoff(Materials.Haderoth, , + // ,31_766+963); + // public static Werkstoff Hepatizon = new Werkstoff(Materials.Hepatizon, , + // ,31_766+957); + // public static Werkstoff HSLA = new Werkstoff(Materials.HSLA, , ,31_766+322); + // public static Werkstoff Ignatius = new Werkstoff(Materials.Ignatius, , + // ,31_766+950); + // public static Werkstoff Infuscolium = new Werkstoff(Materials.Infuscolium, , + // ,31_766+490); + // public static Werkstoff InfusedGold = new Werkstoff(Materials.InfusedGold, , + // ,31_766+323); + // public static Werkstoff InfusedAir = new Werkstoff(Materials.InfusedAir, , + // ,31_766+540); + // public static Werkstoff InfusedFire = new Werkstoff(Materials.InfusedFire, , + // ,31_766+541); + // public static Werkstoff InfusedEarth = new Werkstoff(Materials.InfusedEarth, , + // ,31_766+542); + // public static Werkstoff InfusedWater = new Werkstoff(Materials.InfusedWater, , + // ,31_766+543); + // public static Werkstoff InfusedEntropy = new Werkstoff(Materials.InfusedEntropy, , + // ,31_766+544); + // public static Werkstoff InfusedOrder = new Werkstoff(Materials.InfusedOrder, , + // ,31_766+545); + // public static Werkstoff Inolashite = new Werkstoff(Materials.Inolashite, , + // ,31_766+954); + // public static Werkstoff Jade = new Werkstoff(Materials.Jade, , ,31_766+537); + // public static Werkstoff Jasper = new Werkstoff(Materials.Jasper, , ,31_766+511); + // public static Werkstoff Kalendrite = new Werkstoff(Materials.Kalendrite, , + // ,31_766+953); + // public static Werkstoff Komatiite = new Werkstoff(Materials.Komatiite, , + // ,31_766+869); + // public static Werkstoff Lava = new Werkstoff(Materials.Lava, , ,31_766+700); + // public static Werkstoff Lemurite = new Werkstoff(Materials.Lemurite, , + // ,31_766+486); + // public static Werkstoff MeteoricIron = new Werkstoff(Materials.MeteoricIron, , + // ,31_766+340); + // public static Werkstoff MeteoricSteel = new Werkstoff(Materials.MeteoricSteel, , + // ,31_766+341); + // public static Werkstoff Meutoite = new Werkstoff(Materials.Meutoite, , + // ,31_766+487); + // public static Werkstoff Migmatite = new Werkstoff(Materials.Migmatite, , + // ,31_766+872); -// public static Werkstoff NetherBrick = new Werkstoff(Materials.NetherBrick, , ,31_766+814); -// public static Werkstoff NetherQuartz = new Werkstoff(Materials.NetherQuartz, , ,31_766+522); -// public static Werkstoff NetherStar = new Werkstoff(Materials.NetherStar, , ,31_766+506); -// public static Werkstoff Oilsands = new Werkstoff(Materials.Oilsands, , ,31_766+878); -// public static Werkstoff Orichalcum = new Werkstoff(Materials.Orichalcum, , ,31_766+966); -// public static Werkstoff Oureclase = new Werkstoff(Materials.Oureclase, , ,31_766+961); -// public static Werkstoff Prometheum = new Werkstoff(Materials.Prometheum, , ,31_766+960); -// public static Werkstoff Quartzite = new Werkstoff(Materials.Quartzite, , ,31_766+523); -// public static Werkstoff Rhyolite = new Werkstoff(Materials.Rhyolite, , ,31_766+875); -// public static Werkstoff Rubracium = new Werkstoff(Materials.Rubracium, , ,31_766+488); -// public static Werkstoff Sanguinite = new Werkstoff(Materials.Sanguinite, , ,31_766+955); -// public static Werkstoff Siltstone = new Werkstoff(Materials.Siltstone, , ,31_766+876); -// public static Werkstoff Tartarite = new Werkstoff(Materials.Tartarite, , ,31_766+956); -// public static Werkstoff UUAmplifier = new Werkstoff(Materials.UUAmplifier, , ,31_766+721); -// public static Werkstoff UUMatter = new Werkstoff(Materials.UUMatter, , ,31_766+703); -// public static Werkstoff Void = new Werkstoff(Materials.Void, , ,31_766+970); -// public static Werkstoff Vulcanite = new Werkstoff(Materials.Vulcanite, , ,31_766+489); -// public static Werkstoff Vyroxeres = new Werkstoff(Materials.Vyroxeres, , ,31_766+951); -// public static Werkstoff BioFuel = new Werkstoff(Materials.BioFuel, , ,31_766+705); -// public static Werkstoff Biomass = new Werkstoff(Materials.Biomass, , ,31_766+704); -// public static CharcoalByproducts = new MaterialBuilder + // public static Werkstoff NetherBrick = new Werkstoff(Materials.NetherBrick, , + // ,31_766+814); + // public static Werkstoff NetherQuartz = new Werkstoff(Materials.NetherQuartz, , + // ,31_766+522); + // public static Werkstoff NetherStar = new Werkstoff(Materials.NetherStar, , + // ,31_766+506); + // public static Werkstoff Oilsands = new Werkstoff(Materials.Oilsands, , + // ,31_766+878); + // public static Werkstoff Orichalcum = new Werkstoff(Materials.Orichalcum, , + // ,31_766+966); + // public static Werkstoff Oureclase = new Werkstoff(Materials.Oureclase, , + // ,31_766+961); + // public static Werkstoff Prometheum = new Werkstoff(Materials.Prometheum, , + // ,31_766+960); + // public static Werkstoff Quartzite = new Werkstoff(Materials.Quartzite, , + // ,31_766+523); + // public static Werkstoff Rhyolite = new Werkstoff(Materials.Rhyolite, , + // ,31_766+875); + // public static Werkstoff Rubracium = new Werkstoff(Materials.Rubracium, , + // ,31_766+488); + // public static Werkstoff Sanguinite = new Werkstoff(Materials.Sanguinite, , + // ,31_766+955); + // public static Werkstoff Siltstone = new Werkstoff(Materials.Siltstone, , + // ,31_766+876); + // public static Werkstoff Tartarite = new Werkstoff(Materials.Tartarite, , + // ,31_766+956); + // public static Werkstoff UUAmplifier = new Werkstoff(Materials.UUAmplifier, , + // ,31_766+721); + // public static Werkstoff UUMatter = new Werkstoff(Materials.UUMatter, , + // ,31_766+703); + // public static Werkstoff Void = new Werkstoff(Materials.Void, , ,31_766+970); + // public static Werkstoff Vulcanite = new Werkstoff(Materials.Vulcanite, , + // ,31_766+489); + // public static Werkstoff Vyroxeres = new Werkstoff(Materials.Vyroxeres, , + // ,31_766+951); + // public static Werkstoff BioFuel = new Werkstoff(Materials.BioFuel, , + // ,31_766+705); + // public static Werkstoff Biomass = new Werkstoff(Materials.Biomass, , + // ,31_766+704); + // public static CharcoalByproducts = new MaterialBuilder -// public static Werkstoff Chili = new Werkstoff(Materials.Chili, , ,31_766+895); -// public static Werkstoff Chocolate = new Werkstoff(Materials.Chocolate, , ,31_766+886); -// public static Werkstoff CoalFuel = new Werkstoff(Materials.CoalFuel, , ,31_766+710); -// public static Werkstoff Cocoa = new Werkstoff(Materials.Cocoa, , ,31_766+887); -// public static Werkstoff Coffee = new Werkstoff(Materials.Coffee, , ,31_766+888); -// public static Werkstoff Creosote = new Werkstoff(Materials.Creosote, , ,31_766+712); -// public static Werkstoff Ethanol = new Werkstoff(Materials.Ethanol, , ,31_766+706); -// public static FermentedBiomass = new MaterialBuilder -// public static Werkstoff Fuel = new Werkstoff(Materials.Fuel, , ,31_766+708); -// public static Werkstoff Glue = new Werkstoff(Materials.Glue, , ,31_766+726); -// public static Werkstoff Gunpowder = new Werkstoff(Materials.Gunpowder, , ,31_766+800); -// public static Werkstoff FryingOilHot = new Werkstoff(Materials.FryingOilHot, , ,31_766+727); -// public static Werkstoff Honey = new Werkstoff(Materials.Honey, , ,31_766+725); -// public static Werkstoff Lubricant = new Werkstoff(Materials.Lubricant, , ,31_766+724); -// public static Werkstoff McGuffium239 = new Werkstoff(Materials.McGuffium239, , ,31_766+999); -// public static Werkstoff MeatRaw = new Werkstoff(Materials.MeatRaw, , ,31_766+892); -// public static Werkstoff MeatCooked = new Werkstoff(Materials.MeatCooked, , ,31_766+893); -// public static Werkstoff Milk = new Werkstoff(Materials.Milk, , ,31_766+885); -// public static Werkstoff Oil = new Werkstoff(Materials.Oil, , ,31_766+707); -// public static Werkstoff Paper = new Werkstoff(Materials.Paper, , ,31_766+879); -// public static Werkstoff RareEarth = new Werkstoff(Materials.RareEarth, , ,31_766+891); -// public static Werkstoff Reinforced = new Werkstoff(Materials.Reinforced, , ,31_766+383); -// public static Werkstoff SeedOil = new Werkstoff(Materials.SeedOil, , ,31_766+713); -// public static Werkstoff SeedOilHemp = new Werkstoff(Materials.SeedOilHemp, , ,31_766+722); -// public static Werkstoff SeedOilLin = new Werkstoff(Materials.SeedOilLin, , ,31_766+723); -// public static Werkstoff Stone = new Werkstoff(Materials.Stone, , ,31_766+299); -// public static Werkstoff Unstable = new Werkstoff(Materials.Unstable, , ,31_766+396); -// public static Vinegar = new MaterialBuilder -// public static Werkstoff Wheat = new Werkstoff(Materials.Wheat, , ,31_766+881); -// public static WoodGas = new MaterialBuilder -// public static WoodTar = new MaterialBuilder -// public static WoodVinegar = new MaterialBuilder + // public static Werkstoff Chili = new Werkstoff(Materials.Chili, , ,31_766+895); + // public static Werkstoff Chocolate = new Werkstoff(Materials.Chocolate, , + // ,31_766+886); + // public static Werkstoff CoalFuel = new Werkstoff(Materials.CoalFuel, , + // ,31_766+710); + // public static Werkstoff Cocoa = new Werkstoff(Materials.Cocoa, , ,31_766+887); + // public static Werkstoff Coffee = new Werkstoff(Materials.Coffee, , ,31_766+888); + // public static Werkstoff Creosote = new Werkstoff(Materials.Creosote, , + // ,31_766+712); + // public static Werkstoff Ethanol = new Werkstoff(Materials.Ethanol, , + // ,31_766+706); + // public static FermentedBiomass = new MaterialBuilder + // public static Werkstoff Fuel = new Werkstoff(Materials.Fuel, , ,31_766+708); + // public static Werkstoff Glue = new Werkstoff(Materials.Glue, , ,31_766+726); + // public static Werkstoff Gunpowder = new Werkstoff(Materials.Gunpowder, , + // ,31_766+800); + // public static Werkstoff FryingOilHot = new Werkstoff(Materials.FryingOilHot, , + // ,31_766+727); + // public static Werkstoff Honey = new Werkstoff(Materials.Honey, , ,31_766+725); + // public static Werkstoff Lubricant = new Werkstoff(Materials.Lubricant, , + // ,31_766+724); + // public static Werkstoff McGuffium239 = new Werkstoff(Materials.McGuffium239, , + // ,31_766+999); + // public static Werkstoff MeatRaw = new Werkstoff(Materials.MeatRaw, , + // ,31_766+892); + // public static Werkstoff MeatCooked = new Werkstoff(Materials.MeatCooked, , + // ,31_766+893); + // public static Werkstoff Milk = new Werkstoff(Materials.Milk, , ,31_766+885); + // public static Werkstoff Oil = new Werkstoff(Materials.Oil, , ,31_766+707); + // public static Werkstoff Paper = new Werkstoff(Materials.Paper, , ,31_766+879); + // public static Werkstoff RareEarth = new Werkstoff(Materials.RareEarth, , + // ,31_766+891); + // public static Werkstoff Reinforced = new Werkstoff(Materials.Reinforced, , + // ,31_766+383); + // public static Werkstoff SeedOil = new Werkstoff(Materials.SeedOil, , + // ,31_766+713); + // public static Werkstoff SeedOilHemp = new Werkstoff(Materials.SeedOilHemp, , + // ,31_766+722); + // public static Werkstoff SeedOilLin = new Werkstoff(Materials.SeedOilLin, , + // ,31_766+723); + // public static Werkstoff Stone = new Werkstoff(Materials.Stone, , ,31_766+299); + // public static Werkstoff Unstable = new Werkstoff(Materials.Unstable, , + // ,31_766+396); + // public static Vinegar = new MaterialBuilder + // public static Werkstoff Wheat = new Werkstoff(Materials.Wheat, , ,31_766+881); + // public static WoodGas = new MaterialBuilder + // public static WoodTar = new MaterialBuilder + // public static WoodVinegar = new MaterialBuilder -// public static Werkstoff Sunnarium = new Werkstoff(Materials.Sunnarium, , ,31_766+318); -// public static Werkstoff Endstone = new Werkstoff(Materials.Endstone, , ,31_766+808); -// public static Werkstoff Netherrack = new Werkstoff(Materials.Netherrack, , ,31_766+807); -// public static Werkstoff Methane = new Werkstoff(Materials.Methane, , ,31_766+715); -// public static Werkstoff CarbonDioxide = new Werkstoff(Materials.CarbonDioxide, , ,31_766+497); -// public static Werkstoff NobleGases = new Werkstoff(Materials.NobleGases, , ,31_766+496); -// public static Werkstoff LiquidAir = new Werkstoff(Materials.LiquidAir, , ,31_766+495); -// public static Werkstoff LiquidNitrogen = new Werkstoff(Materials.LiquidNitrogen, , ,31_766+494); -// public static Werkstoff LiquidOxygen = new Werkstoff(Materials.LiquidOxygen, , ,31_766+493); -// public static Werkstoff Almandine = new Werkstoff(Materials.Almandine, , ,31_766+820); -// public static Werkstoff Andradite = new Werkstoff(Materials.Andradite, , ,31_766+821); + // public static Werkstoff Sunnarium = new Werkstoff(Materials.Sunnarium, , + // ,31_766+318); + // public static Werkstoff Endstone = new Werkstoff(Materials.Endstone, , + // ,31_766+808); + // public static Werkstoff Netherrack = new Werkstoff(Materials.Netherrack, , + // ,31_766+807); + // public static Werkstoff Methane = new Werkstoff(Materials.Methane, , + // ,31_766+715); + // public static Werkstoff CarbonDioxide = new Werkstoff(Materials.CarbonDioxide, , + // ,31_766+497); + // public static Werkstoff NobleGases = new Werkstoff(Materials.NobleGases, , + // ,31_766+496); + // public static Werkstoff LiquidAir = new Werkstoff(Materials.LiquidAir, , + // ,31_766+495); + // public static Werkstoff LiquidNitrogen = new Werkstoff(Materials.LiquidNitrogen, , + // ,31_766+494); + // public static Werkstoff LiquidOxygen = new Werkstoff(Materials.LiquidOxygen, , + // ,31_766+493); + // public static Werkstoff Almandine = new Werkstoff(Materials.Almandine, , + // ,31_766+820); + // public static Werkstoff Andradite = new Werkstoff(Materials.Andradite, , + // ,31_766+821); -// public static Werkstoff Asbestos = new Werkstoff(Materials.Asbestos, , ,31_766+946); -// public static Werkstoff Ash = new Werkstoff(Materials.Ash, , ,31_766+815); -// public static Werkstoff BandedIron = new Werkstoff(Materials.BandedIron, , ,31_766+917); -// public static Werkstoff BatteryAlloy = new Werkstoff(Materials.BatteryAlloy, , ,31_766+315); -// public static Werkstoff BlueTopaz = new Werkstoff(Materials.BlueTopaz, , ,31_766+513); -// public static Werkstoff Bone = new Werkstoff(Materials.Bone, , ,31_766+806); + // public static Werkstoff Asbestos = new Werkstoff(Materials.Asbestos, , + // ,31_766+946); + // public static Werkstoff Ash = new Werkstoff(Materials.Ash, , ,31_766+815); + // public static Werkstoff BandedIron = new Werkstoff(Materials.BandedIron, , + // ,31_766+917); + // public static Werkstoff BatteryAlloy = new Werkstoff(Materials.BatteryAlloy, , + // ,31_766+315); + // public static Werkstoff BlueTopaz = new Werkstoff(Materials.BlueTopaz, , + // ,31_766+513); + // public static Werkstoff Bone = new Werkstoff(Materials.Bone, , ,31_766+806); -// public static Werkstoff BrownLimonite = new Werkstoff(Materials.BrownLimonite, , ,31_766+930); -// public static Werkstoff Calcite = new Werkstoff(Materials.Calcite, , ,31_766+823); -// public static Werkstoff Cassiterite = new Werkstoff(Materials.Cassiterite, , ,31_766+824); -// public static Werkstoff CassiteriteSand = new Werkstoff(Materials.CassiteriteSand, , ,31_766+937); -// public static Werkstoff Chalcopyrite = new Werkstoff(Materials.Chalcopyrite, , ,31_766+855); -// public static Werkstoff Charcoal = new Werkstoff(Materials.Charcoal, , ,31_766+536); -// public static Werkstoff Chromite = new Werkstoff(Materials.Chromite, , ,31_766+825); -// public static Werkstoff ChromiumDioxide = new Werkstoff(Materials.ChromiumDioxide, , ,31_766+361); -// public static Werkstoff Cinnabar = new Werkstoff(Materials.Cinnabar, , ,31_766+826); -// public static Werkstoff Water = new Werkstoff(Materials.Water, , ,31_766+701); -// public static Werkstoff Clay = new Werkstoff(Materials.Clay, , ,31_766+805); -// public static Werkstoff Coal = new Werkstoff(Materials.Coal, , ,31_766+535); -// public static Werkstoff Cobaltite = new Werkstoff(Materials.Cobaltite, , ,31_766+827); -// public static Werkstoff Cooperite = new Werkstoff(Materials.Cooperite, , ,31_766+828); -// public static Werkstoff Cupronickel = new Werkstoff(Materials.Cupronickel, , ,31_766+310); -// public static Werkstoff DarkAsh = new Werkstoff(Materials.DarkAsh, , ,31_766+816); -// public static Werkstoff DeepIron = new Werkstoff(Materials.DeepIron, , ,31_766+829); -// public static Werkstoff Diamond = new Werkstoff(Materials.Diamond, , ,31_766+500); -// public static Werkstoff Electrum = new Werkstoff(Materials.Electrum, , ,31_766+303); -// public static Werkstoff Emerald = new Werkstoff(Materials.Emerald, , ,31_766+501); -// public static Werkstoff Galena = new Werkstoff(Materials.Galena, , ,31_766+830); -// public static Werkstoff Garnierite = new Werkstoff(Materials.Garnierite, , ,31_766+906); -// public static Werkstoff Glyceryl = new Werkstoff(Materials.Glyceryl, , ,31_766+714); -// public static Werkstoff GreenSapphire = new Werkstoff(Materials.GreenSapphire, , ,31_766+504); -// public static Werkstoff Grossular = new Werkstoff(Materials.Grossular, , ,31_766+831); -// public static Werkstoff HolyWater = new Werkstoff(Materials.HolyWater, , ,31_766+729); -// public static Werkstoff Ice = new Werkstoff(Materials.Ice, , ,31_766+702); -// public static Werkstoff Ilmenite = new Werkstoff(Materials.Ilmenite, , ,31_766+918); -// public static Werkstoff Rutile = new Werkstoff(Materials.Rutile, , ,31_766+375); -// public static Werkstoff Bauxite = new Werkstoff(Materials.Bauxite, , ,31_766+822); -// public static Werkstoff Titaniumtetrachloride = new Werkstoff(Materials.Titaniumtetrachloride, , ,31_766+376); -// public static Werkstoff Magnesiumchloride = new Werkstoff(Materials.Magnesiumchloride, , ,31_766+377); -// public static Werkstoff Invar = new Werkstoff(Materials.Invar, , ,31_766+302); -// public static Werkstoff Kanthal = new Werkstoff(Materials.Kanthal, , ,31_766+312); -// public static Werkstoff Lazurite = new Werkstoff(Materials.Lazurite, , ,31_766+524); -// public static Werkstoff Magnalium = new Werkstoff(Materials.Magnalium, , ,31_766+313); -// public static Werkstoff Magnesite = new Werkstoff(Materials.Magnesite, , ,31_766+908); -// public static Werkstoff Magnetite = new Werkstoff(Materials.Magnetite, , ,31_766+870); -// public static Werkstoff Molybdenite = new Werkstoff(Materials.Molybdenite, , ,31_766+942); -// public static Werkstoff Nichrome = new Werkstoff(Materials.Nichrome, , ,31_766+311); -// public static Werkstoff NiobiumNitride = new Werkstoff(Materials.NiobiumNitride, , ,31_766+359); -// public static Werkstoff NiobiumTitanium = new Werkstoff(Materials.NiobiumTitanium, , ,31_766+360); -// public static Werkstoff NitroCarbon = new Werkstoff(Materials.NitroCarbon, , ,31_766+716); -// public static Werkstoff NitrogenDioxide = new Werkstoff(Materials.NitrogenDioxide, , ,31_766+717); -// public static Werkstoff Obsidian = new Werkstoff(Materials.Obsidian, , ,31_766+804); -// public static Werkstoff Phosphate = new Werkstoff(Materials.Phosphate, , ,31_766+833); -// public static Werkstoff PigIron = new Werkstoff(Materials.PigIron, , ,31_766+307); + // public static Werkstoff BrownLimonite = new Werkstoff(Materials.BrownLimonite, , + // ,31_766+930); + // public static Werkstoff Calcite = new Werkstoff(Materials.Calcite, , + // ,31_766+823); + // public static Werkstoff Cassiterite = new Werkstoff(Materials.Cassiterite, , + // ,31_766+824); + // public static Werkstoff CassiteriteSand = new Werkstoff(Materials.CassiteriteSand, , + // ,31_766+937); + // public static Werkstoff Chalcopyrite = new Werkstoff(Materials.Chalcopyrite, , + // ,31_766+855); + // public static Werkstoff Charcoal = new Werkstoff(Materials.Charcoal, , + // ,31_766+536); + // public static Werkstoff Chromite = new Werkstoff(Materials.Chromite, , + // ,31_766+825); + // public static Werkstoff ChromiumDioxide = new Werkstoff(Materials.ChromiumDioxide, , + // ,31_766+361); + // public static Werkstoff Cinnabar = new Werkstoff(Materials.Cinnabar, , + // ,31_766+826); + // public static Werkstoff Water = new Werkstoff(Materials.Water, , ,31_766+701); + // public static Werkstoff Clay = new Werkstoff(Materials.Clay, , ,31_766+805); + // public static Werkstoff Coal = new Werkstoff(Materials.Coal, , ,31_766+535); + // public static Werkstoff Cobaltite = new Werkstoff(Materials.Cobaltite, , + // ,31_766+827); + // public static Werkstoff Cooperite = new Werkstoff(Materials.Cooperite, , + // ,31_766+828); + // public static Werkstoff Cupronickel = new Werkstoff(Materials.Cupronickel, , + // ,31_766+310); + // public static Werkstoff DarkAsh = new Werkstoff(Materials.DarkAsh, , + // ,31_766+816); + // public static Werkstoff DeepIron = new Werkstoff(Materials.DeepIron, , + // ,31_766+829); + // public static Werkstoff Diamond = new Werkstoff(Materials.Diamond, , + // ,31_766+500); + // public static Werkstoff Electrum = new Werkstoff(Materials.Electrum, , + // ,31_766+303); + // public static Werkstoff Emerald = new Werkstoff(Materials.Emerald, , + // ,31_766+501); + // public static Werkstoff Galena = new Werkstoff(Materials.Galena, , ,31_766+830); + // public static Werkstoff Garnierite = new Werkstoff(Materials.Garnierite, , + // ,31_766+906); + // public static Werkstoff Glyceryl = new Werkstoff(Materials.Glyceryl, , + // ,31_766+714); + // public static Werkstoff GreenSapphire = new Werkstoff(Materials.GreenSapphire, , + // ,31_766+504); + // public static Werkstoff Grossular = new Werkstoff(Materials.Grossular, , + // ,31_766+831); + // public static Werkstoff HolyWater = new Werkstoff(Materials.HolyWater, , + // ,31_766+729); + // public static Werkstoff Ice = new Werkstoff(Materials.Ice, , ,31_766+702); + // public static Werkstoff Ilmenite = new Werkstoff(Materials.Ilmenite, , + // ,31_766+918); + // public static Werkstoff Rutile = new Werkstoff(Materials.Rutile, , ,31_766+375); + // public static Werkstoff Bauxite = new Werkstoff(Materials.Bauxite, , + // ,31_766+822); + // public static Werkstoff Titaniumtetrachloride = new Werkstoff(Materials.Titaniumtetrachloride, + // , ,31_766+376); + // public static Werkstoff Magnesiumchloride = new Werkstoff(Materials.Magnesiumchloride, , + // ,31_766+377); + // public static Werkstoff Invar = new Werkstoff(Materials.Invar, , ,31_766+302); + // public static Werkstoff Kanthal = new Werkstoff(Materials.Kanthal, , + // ,31_766+312); + // public static Werkstoff Lazurite = new Werkstoff(Materials.Lazurite, , + // ,31_766+524); + // public static Werkstoff Magnalium = new Werkstoff(Materials.Magnalium, , + // ,31_766+313); + // public static Werkstoff Magnesite = new Werkstoff(Materials.Magnesite, , + // ,31_766+908); + // public static Werkstoff Magnetite = new Werkstoff(Materials.Magnetite, , + // ,31_766+870); + // public static Werkstoff Molybdenite = new Werkstoff(Materials.Molybdenite, , + // ,31_766+942); + // public static Werkstoff Nichrome = new Werkstoff(Materials.Nichrome, , + // ,31_766+311); + // public static Werkstoff NiobiumNitride = new Werkstoff(Materials.NiobiumNitride, , + // ,31_766+359); + // public static Werkstoff NiobiumTitanium = new Werkstoff(Materials.NiobiumTitanium, , + // ,31_766+360); + // public static Werkstoff NitroCarbon = new Werkstoff(Materials.NitroCarbon, , + // ,31_766+716); + // public static Werkstoff NitrogenDioxide = new Werkstoff(Materials.NitrogenDioxide, , + // ,31_766+717); + // public static Werkstoff Obsidian = new Werkstoff(Materials.Obsidian, , + // ,31_766+804); + // public static Werkstoff Phosphate = new Werkstoff(Materials.Phosphate, , + // ,31_766+833); + // public static Werkstoff PigIron = new Werkstoff(Materials.PigIron, , + // ,31_766+307); -// public static Polydimethylsiloxane = new MaterialBuilder -// public static Werkstoff Silicone = new Werkstoff(Materials.Silicone, , ,31_766+471); -// public static Werkstoff Polycaprolactam = new Werkstoff(Materials.Polycaprolactam, , ,31_766+472); + // public static Polydimethylsiloxane = new MaterialBuilder + // public static Werkstoff Silicone = new Werkstoff(Materials.Silicone, , + // ,31_766+471); + // public static Werkstoff Polycaprolactam = new Werkstoff(Materials.Polycaprolactam, , + // ,31_766+472); -// public static Werkstoff Powellite = new Werkstoff(Materials.Powellite, , ,31_766+883); -// public static Werkstoff Pumice = new Werkstoff(Materials.Pumice, , ,31_766+926); -// public static Werkstoff Pyrite = new Werkstoff(Materials.Pyrite, , ,31_766+834); -// public static Werkstoff Pyrolusite = new Werkstoff(Materials.Pyrolusite, , ,31_766+943); -// public static Werkstoff Pyrope = new Werkstoff(Materials.Pyrope, , ,31_766+835); -// public static Werkstoff RockSalt = new Werkstoff(Materials.RockSalt, , ,31_766+944); -// public static Werkstoff Rubber = new Werkstoff(Materials.Rubber, , ,31_766+880); -// public static Werkstoff RawRubber = new Werkstoff(Materials.RawRubber, , ,31_766+896); -// public static Werkstoff Ruby = new Werkstoff(Materials.Ruby, , ,31_766+502); -// public static Werkstoff Salt = new Werkstoff(Materials.Salt, , ,31_766+817); -// public static Werkstoff Saltpeter = new Werkstoff(Materials.Saltpeter, , ,31_766+836); -// public static Werkstoff Sapphire = new Werkstoff(Materials.Sapphire, , ,31_766+503); -// public static Werkstoff Scheelite = new Werkstoff(Materials.Scheelite, , ,31_766+910); -// public static Werkstoff SiliconDioxide = new Werkstoff(Materials.SiliconDioxide, , ,31_766+837); -// public static Werkstoff Snow = new Werkstoff(Materials.Snow, , ,31_766+728); -// public static Werkstoff Sodalite = new Werkstoff(Materials.Sodalite, , ,31_766+525); -// public static Werkstoff SodiumPersulfate = new Werkstoff(Materials.SodiumPersulfate, , ,31_766+718); -// public static Werkstoff SodiumSulfide = new Werkstoff(Materials.SodiumSulfide, , ,31_766+719); -// public static Werkstoff HydricSulfide = new Werkstoff(Materials.HydricSulfide, , ,31_766+460); -// public static Werkstoff OilHeavy = new Werkstoff(Materials.OilHeavy, , ,31_766+730); -// public static Werkstoff OilMedium = new Werkstoff(Materials.OilMedium, , ,31_766+731); -// public static Werkstoff OilLight = new Werkstoff(Materials.OilLight, , ,31_766+732); -// public static Werkstoff NatruralGas = new Werkstoff(Materials.NatruralGas, , ,31_766+733); -// public static Werkstoff SulfuricGas = new Werkstoff(Materials.SulfuricGas, , ,31_766+734); -// public static Werkstoff Gas = new Werkstoff(Materials.Gas, , ,31_766+735); -// public static Werkstoff SulfuricNaphtha = new Werkstoff(Materials.SulfuricNaphtha, , ,31_766+736); -// public static Werkstoff SulfuricLightFuel = new Werkstoff(Materials.SulfuricLightFuel, , ,31_766+737); -// public static Werkstoff SulfuricHeavyFuel = new Werkstoff(Materials.SulfuricHeavyFuel, , ,31_766+738); -// public static Werkstoff Naphtha = new Werkstoff(Materials.Naphtha, , ,31_766+739); -// public static Werkstoff LightFuel = new Werkstoff(Materials.LightFuel, , ,31_766+740); -// public static Werkstoff HeavyFuel = new Werkstoff(Materials.HeavyFuel, , ,31_766+741); -// public static Werkstoff LPG = new Werkstoff(Materials.LPG, , ,31_766+742); -// public static FluidNaquadahFuel = new MaterialBuilder -// public static EnrichedNaquadria = new MaterialBuilder -// public static ReinforceGlass = new MaterialBuilder -// public static BioMediumRaw = new MaterialBuilder -// public static BioMediumSterilized = new MaterialBuilder -// public static Chlorobenzene = new MaterialBuild -// public static DilutedHydrochloricAcid = new MaterialBuild -// public static Pyrochlore = new MaterialBuild -// public static GrowthMediumRaw = new MaterialBuild -// public static GrowthMediumSterilized = new MaterialBuild -// public static FerriteMixture = new MaterialBuild -// public static NickelZincFerrite = new MaterialBuild -// public static Massicot = new MaterialBuild -// public static ArsenicTrioxide = new MaterialBuild -// public static CobaltOxide = new MaterialBuild -// public static Zincite = new MaterialBuild -// public static AntimonyTrioxide = new MaterialBuild -// public static CupricOxide = new MaterialBuild -// public static Ferrosilite = new MaterialBuild -// public static Magnesia = new MaterialBuild -// public static Quicklime = new MaterialBuild -// public static Potash = new MaterialBuild -// public static SodaAsh = new MaterialBuild -// public static Brick = new MaterialBuild -// public static Fireclay = new MaterialBuild -// public static BioDiesel = new MaterialBuild -// public static NitrationMixture = new MaterialBuild -// public static Glycerol = new MaterialBuild -// public static SodiumBisulfate = new MaterialBuild -// public static PolyphenyleneSulfide = new MaterialBuild -// public static Dichlorobenzene = new MaterialBuild -// public static Polystyrene = new MaterialBuild -// public static Styrene = new MaterialBuild -// public static Isoprene = new MaterialBuild -// public static Tetranitromethane = new MaterialBuild -// public static Ethenone = new MaterialBuild -// public static Ethane = new MaterialBuild -// public static Propane = new MaterialBuild -// public static Butane = new MaterialBuild -// public static Butene = new MaterialBuild -// public static Butadiene = new MaterialBuild -// public static RawStyreneButadieneRubber = new MaterialBuild -// public static StyreneButadieneRubber = new MaterialBuild -// public static Toluene = new MaterialBuild -// public static Epichlorohydrin = new MaterialBuild -// public static PolyvinylChloride = new MaterialBuild -// public static VinylChloride = new MaterialBuild -// public static SulfurDioxide = new MaterialBuild -// public static SulfurTrioxide = new MaterialBuild -// public static NitricAcid = new MaterialBuild -// public static Dimethylhydrazine = new MaterialBuild -// public static Chloramine = new MaterialBuild -// public static Dimethylamine = new MaterialBuild -// public static DinitrogenTetroxide = new MaterialBuild -// public static NitricOxide = new MaterialBuild -// public static Ammonia = new MaterialBuild -// public static Dimethyldichlorosilane = new MaterialBuild -// public static Chloromethane = new MaterialBuild -// public static PhosphorousPentoxide = new MaterialBuild -// public static Tetrafluoroethylene = new MaterialBuild -// public static HydrofluoricAcid = new MaterialBuild -// public static Chloroform = new MaterialBuild -// public static BisphenolA = new MaterialBuild -// public static AceticAcid = new MaterialBuild -// public static CalciumAcetateSolution = new MaterialBuild -// public static Acetone = new MaterialBuild -// public static Methanol = new MaterialBuild -// public static CarbonMonoxide = new MaterialBuild -// public static MetalMixture = new MaterialBuild -// public static Ethylene = new MaterialBuild -// public static Propene = new MaterialBuild -// public static VinylAcetate = new MaterialBuild -// public static PolyvinylAcetate = new MaterialBuild -// public static MethylAcetate = new MaterialBuild -// public static AllylChloride = new MaterialBuild -// public static HydrochloricAcid = new MaterialBuild -// public static HypochlorousAcid = new MaterialBuild -// public static SodiumHydroxide = new MaterialBuild -// public static Benzene = new MaterialBuild -// public static Phenol = new MaterialBuild -// public static Cumene = new MaterialBuild -// public static PhosphoricAcid = new MaterialBuild -// public static SaltWater = new MaterialBuild -// public static IronIIIChloride = new MaterialBuild -// public static LifeEssence = new MaterialBuild -// public static Werkstoff SolderingAlloy = new Werkstoff(Materials.SolderingAlloy, , ,31_766+314); -// public static Werkstoff GalliumArsenide = new Werkstoff(Materials.GalliumArsenide, , ,31_766+980); -// public static Werkstoff IndiumGalliumPhosphide = new Werkstoff(Materials.IndiumGalliumPhosphide, , ,31_766+981); -// public static Werkstoff Spessartine = new Werkstoff(Materials.Spessartine, , ,31_766+838); -// public static Werkstoff Sphalerite = new Werkstoff(Materials.Sphalerite, , ,31_766+839); + // public static Werkstoff Powellite = new Werkstoff(Materials.Powellite, , + // ,31_766+883); + // public static Werkstoff Pumice = new Werkstoff(Materials.Pumice, , ,31_766+926); + // public static Werkstoff Pyrite = new Werkstoff(Materials.Pyrite, , ,31_766+834); + // public static Werkstoff Pyrolusite = new Werkstoff(Materials.Pyrolusite, , + // ,31_766+943); + // public static Werkstoff Pyrope = new Werkstoff(Materials.Pyrope, , ,31_766+835); + // public static Werkstoff RockSalt = new Werkstoff(Materials.RockSalt, , + // ,31_766+944); + // public static Werkstoff Rubber = new Werkstoff(Materials.Rubber, , ,31_766+880); + // public static Werkstoff RawRubber = new Werkstoff(Materials.RawRubber, , + // ,31_766+896); + // public static Werkstoff Ruby = new Werkstoff(Materials.Ruby, , ,31_766+502); + // public static Werkstoff Salt = new Werkstoff(Materials.Salt, , ,31_766+817); + // public static Werkstoff Saltpeter = new Werkstoff(Materials.Saltpeter, , + // ,31_766+836); + // public static Werkstoff Sapphire = new Werkstoff(Materials.Sapphire, , + // ,31_766+503); + // public static Werkstoff Scheelite = new Werkstoff(Materials.Scheelite, , + // ,31_766+910); + // public static Werkstoff SiliconDioxide = new Werkstoff(Materials.SiliconDioxide, , + // ,31_766+837); + // public static Werkstoff Snow = new Werkstoff(Materials.Snow, , ,31_766+728); + // public static Werkstoff Sodalite = new Werkstoff(Materials.Sodalite, , + // ,31_766+525); + // public static Werkstoff SodiumPersulfate = new Werkstoff(Materials.SodiumPersulfate, , + // ,31_766+718); + // public static Werkstoff SodiumSulfide = new Werkstoff(Materials.SodiumSulfide, , + // ,31_766+719); + // public static Werkstoff HydricSulfide = new Werkstoff(Materials.HydricSulfide, , + // ,31_766+460); + // public static Werkstoff OilHeavy = new Werkstoff(Materials.OilHeavy, , + // ,31_766+730); + // public static Werkstoff OilMedium = new Werkstoff(Materials.OilMedium, , + // ,31_766+731); + // public static Werkstoff OilLight = new Werkstoff(Materials.OilLight, , + // ,31_766+732); + // public static Werkstoff NatruralGas = new Werkstoff(Materials.NatruralGas, , + // ,31_766+733); + // public static Werkstoff SulfuricGas = new Werkstoff(Materials.SulfuricGas, , + // ,31_766+734); + // public static Werkstoff Gas = new Werkstoff(Materials.Gas, , ,31_766+735); + // public static Werkstoff SulfuricNaphtha = new Werkstoff(Materials.SulfuricNaphtha, , + // ,31_766+736); + // public static Werkstoff SulfuricLightFuel = new Werkstoff(Materials.SulfuricLightFuel, , + // ,31_766+737); + // public static Werkstoff SulfuricHeavyFuel = new Werkstoff(Materials.SulfuricHeavyFuel, , + // ,31_766+738); + // public static Werkstoff Naphtha = new Werkstoff(Materials.Naphtha, , + // ,31_766+739); + // public static Werkstoff LightFuel = new Werkstoff(Materials.LightFuel, , + // ,31_766+740); + // public static Werkstoff HeavyFuel = new Werkstoff(Materials.HeavyFuel, , + // ,31_766+741); + // public static Werkstoff LPG = new Werkstoff(Materials.LPG, , ,31_766+742); + // public static FluidNaquadahFuel = new MaterialBuilder + // public static EnrichedNaquadria = new MaterialBuilder + // public static ReinforceGlass = new MaterialBuilder + // public static BioMediumRaw = new MaterialBuilder + // public static BioMediumSterilized = new MaterialBuilder + // public static Chlorobenzene = new MaterialBuild + // public static DilutedHydrochloricAcid = new MaterialBuild + // public static Pyrochlore = new MaterialBuild + // public static GrowthMediumRaw = new MaterialBuild + // public static GrowthMediumSterilized = new MaterialBuild + // public static FerriteMixture = new MaterialBuild + // public static NickelZincFerrite = new MaterialBuild + // public static Massicot = new MaterialBuild + // public static ArsenicTrioxide = new MaterialBuild + // public static CobaltOxide = new MaterialBuild + // public static Zincite = new MaterialBuild + // public static AntimonyTrioxide = new MaterialBuild + // public static CupricOxide = new MaterialBuild + // public static Ferrosilite = new MaterialBuild + // public static Magnesia = new MaterialBuild + // public static Quicklime = new MaterialBuild + // public static Potash = new MaterialBuild + // public static SodaAsh = new MaterialBuild + // public static Brick = new MaterialBuild + // public static Fireclay = new MaterialBuild + // public static BioDiesel = new MaterialBuild + // public static NitrationMixture = new MaterialBuild + // public static Glycerol = new MaterialBuild + // public static SodiumBisulfate = new MaterialBuild + // public static PolyphenyleneSulfide = new MaterialBuild + // public static Dichlorobenzene = new MaterialBuild + // public static Polystyrene = new MaterialBuild + // public static Styrene = new MaterialBuild + // public static Isoprene = new MaterialBuild + // public static Tetranitromethane = new MaterialBuild + // public static Ethenone = new MaterialBuild + // public static Ethane = new MaterialBuild + // public static Propane = new MaterialBuild + // public static Butane = new MaterialBuild + // public static Butene = new MaterialBuild + // public static Butadiene = new MaterialBuild + // public static RawStyreneButadieneRubber = new MaterialBuild + // public static StyreneButadieneRubber = new MaterialBuild + // public static Toluene = new MaterialBuild + // public static Epichlorohydrin = new MaterialBuild + // public static PolyvinylChloride = new MaterialBuild + // public static VinylChloride = new MaterialBuild + // public static SulfurDioxide = new MaterialBuild + // public static SulfurTrioxide = new MaterialBuild + // public static NitricAcid = new MaterialBuild + // public static Dimethylhydrazine = new MaterialBuild + // public static Chloramine = new MaterialBuild + // public static Dimethylamine = new MaterialBuild + // public static DinitrogenTetroxide = new MaterialBuild + // public static NitricOxide = new MaterialBuild + // public static Ammonia = new MaterialBuild + // public static Dimethyldichlorosilane = new MaterialBuild + // public static Chloromethane = new MaterialBuild + // public static PhosphorousPentoxide = new MaterialBuild + // public static Tetrafluoroethylene = new MaterialBuild + // public static HydrofluoricAcid = new MaterialBuild + // public static Chloroform = new MaterialBuild + // public static BisphenolA = new MaterialBuild + // public static AceticAcid = new MaterialBuild + // public static CalciumAcetateSolution = new MaterialBuild + // public static Acetone = new MaterialBuild + // public static Methanol = new MaterialBuild + // public static CarbonMonoxide = new MaterialBuild + // public static MetalMixture = new MaterialBuild + // public static Ethylene = new MaterialBuild + // public static Propene = new MaterialBuild + // public static VinylAcetate = new MaterialBuild + // public static PolyvinylAcetate = new MaterialBuild + // public static MethylAcetate = new MaterialBuild + // public static AllylChloride = new MaterialBuild + // public static HydrochloricAcid = new MaterialBuild + // public static HypochlorousAcid = new MaterialBuild + // public static SodiumHydroxide = new MaterialBuild + // public static Benzene = new MaterialBuild + // public static Phenol = new MaterialBuild + // public static Cumene = new MaterialBuild + // public static PhosphoricAcid = new MaterialBuild + // public static SaltWater = new MaterialBuild + // public static IronIIIChloride = new MaterialBuild + // public static LifeEssence = new MaterialBuild + // public static Werkstoff SolderingAlloy = new Werkstoff(Materials.SolderingAlloy, , + // ,31_766+314); + // public static Werkstoff GalliumArsenide = new Werkstoff(Materials.GalliumArsenide, , + // ,31_766+980); + // public static Werkstoff IndiumGalliumPhosphide = new Werkstoff(Materials.IndiumGalliumPhosphide, + // , ,31_766+981); + // public static Werkstoff Spessartine = new Werkstoff(Materials.Spessartine, , + // ,31_766+838); + // public static Werkstoff Sphalerite = new Werkstoff(Materials.Sphalerite, , + // ,31_766+839); -// public static Werkstoff Stibnite = new Werkstoff(Materials.Stibnite, , ,31_766+945); -// public static Werkstoff SulfuricAcid = new Werkstoff(Materials.SulfuricAcid, , ,31_766+720); -// public static Werkstoff Tanzanite = new Werkstoff(Materials.Tanzanite, , ,31_766+508); -// public static Werkstoff Tetrahedrite = new Werkstoff(Materials.Tetrahedrite, , ,31_766+840); -// public static Werkstoff TinAlloy = new Werkstoff(Materials.TinAlloy, , ,31_766+363); -// public static Werkstoff Topaz = new Werkstoff(Materials.Topaz, , ,31_766+507); -// public static Werkstoff Tungstate = new Werkstoff(Materials.Tungstate, , ,31_766+841); + // public static Werkstoff Stibnite = new Werkstoff(Materials.Stibnite, , + // ,31_766+945); + // public static Werkstoff SulfuricAcid = new Werkstoff(Materials.SulfuricAcid, , + // ,31_766+720); + // public static Werkstoff Tanzanite = new Werkstoff(Materials.Tanzanite, , + // ,31_766+508); + // public static Werkstoff Tetrahedrite = new Werkstoff(Materials.Tetrahedrite, , + // ,31_766+840); + // public static Werkstoff TinAlloy = new Werkstoff(Materials.TinAlloy, , + // ,31_766+363); + // public static Werkstoff Topaz = new Werkstoff(Materials.Topaz, , ,31_766+507); + // public static Werkstoff Tungstate = new Werkstoff(Materials.Tungstate, , + // ,31_766+841); -// public static Werkstoff Uraninite = new Werkstoff(Materials.Uraninite, , ,31_766+922); -// public static Werkstoff Uvarovite = new Werkstoff(Materials.Uvarovite, , ,31_766+842); -// public static Werkstoff VanadiumGallium = new Werkstoff(Materials.VanadiumGallium, , ,31_766+357); + // public static Werkstoff Uraninite = new Werkstoff(Materials.Uraninite, , + // ,31_766+922); + // public static Werkstoff Uvarovite = new Werkstoff(Materials.Uvarovite, , + // ,31_766+842); + // public static Werkstoff VanadiumGallium = new Werkstoff(Materials.VanadiumGallium, , + // ,31_766+357); -// public static Werkstoff Wulfenite = new Werkstoff(Materials.Wulfenite, , ,31_766+882); -// public static Werkstoff YellowLimonite = new Werkstoff(Materials.YellowLimonite, , ,31_766+931); -// public static Werkstoff YttriumBariumCuprate = new Werkstoff(Materials.YttriumBariumCuprate, , ,31_766+358); + // public static Werkstoff Wulfenite = new Werkstoff(Materials.Wulfenite, , + // ,31_766+882); + // public static Werkstoff YellowLimonite = new Werkstoff(Materials.YellowLimonite, , + // ,31_766+931); + // public static Werkstoff YttriumBariumCuprate = new Werkstoff(Materials.YttriumBariumCuprate, + // , ,31_766+358); -// public static Werkstoff LiveRoot = new Werkstoff(Materials.LiveRoot, , ,31_766+832); -// public static Werkstoff IronWood = new Werkstoff(Materials.IronWood, , ,31_766+338); -// public static Werkstoff Glass = new Werkstoff(Materials.Glass, , ,31_766+890); -// public static Werkstoff BorosilicateGlass = new Werkstoff(Materials.BorosilicateGlass, Werkstoff.GenerationFeatures.DISABLED, Werkstoff.Types.COMPOUND, 31_766+611); -// public static Werkstoff Perlite = new Werkstoff(Materials.Perlite, , ,31_766+925); -// public static Werkstoff Borax = new Werkstoff(Materials.Borax, , ,31_766+941); -// public static Werkstoff Lignite = new Werkstoff(Materials.Lignite, , ,31_766+538); -// public static Werkstoff Olivine = new Werkstoff(Materials.Olivine, , ,31_766+505); -// public static Werkstoff Opal = new Werkstoff(Materials.Opal, , ,31_766+510); -// public static Werkstoff Amethyst = new Werkstoff(Materials.Amethyst, , ,31_766+509); -// public static Werkstoff Redstone = new Werkstoff(Materials.Redstone, , ,31_766+810); -// public static Werkstoff Lapis = new Werkstoff(Materials.Lapis, , ,31_766+526); -// public static Werkstoff Blaze = new Werkstoff(Materials.Blaze, , ,31_766+801); -// public static Werkstoff EnderPearl = new Werkstoff(Materials.EnderPearl, , ,31_766+532); -// public static Werkstoff EnderEye = new Werkstoff(Materials.EnderEye, , ,31_766+533); -// public static Werkstoff Flint = new Werkstoff(Materials.Flint, , ,31_766+802); -// public static Werkstoff Diatomite = new Werkstoff(Materials.Diatomite, , ,31_766+948); -// public static Werkstoff VolcanicAsh = new Werkstoff(Materials.VolcanicAsh, , ,31_766+940); -// public static Werkstoff Niter = new Werkstoff(Materials.Niter, , ,31_766+531); -// public static Werkstoff Pyrotheum = new Werkstoff(Materials.Pyrotheum, , ,31_766+843); -// public static Werkstoff Cryotheum = new Werkstoff(Materials.Cryotheum, , ,31_766+898); -// public static Werkstoff HydratedCoal = new Werkstoff(Materials.HydratedCoal, , ,31_766+818); -// public static Werkstoff Apatite = new Werkstoff(Materials.Apatite, , ,31_766+530); -// public static Werkstoff Alumite = new Werkstoff(Materials.Alumite, , ,31_766+400); -// public static Werkstoff Manyullyn = new Werkstoff(Materials.Manyullyn, , ,31_766+386); -// public static Werkstoff Steeleaf = new Werkstoff(Materials.Steeleaf, , ,31_766+339); -// public static Werkstoff Knightmetal = new Werkstoff(Materials.Knightmetal, , ,31_766+362); + // public static Werkstoff LiveRoot = new Werkstoff(Materials.LiveRoot, , + // ,31_766+832); + // public static Werkstoff IronWood = new Werkstoff(Materials.IronWood, , + // ,31_766+338); + // public static Werkstoff Glass = new Werkstoff(Materials.Glass, , ,31_766+890); + // public static Werkstoff BorosilicateGlass = new Werkstoff(Materials.BorosilicateGlass, + // Werkstoff.GenerationFeatures.DISABLED, Werkstoff.Types.COMPOUND, 31_766+611); + // public static Werkstoff Perlite = new Werkstoff(Materials.Perlite, , + // ,31_766+925); + // public static Werkstoff Borax = new Werkstoff(Materials.Borax, , ,31_766+941); + // public static Werkstoff Lignite = new Werkstoff(Materials.Lignite, , + // ,31_766+538); + // public static Werkstoff Olivine = new Werkstoff(Materials.Olivine, , + // ,31_766+505); + // public static Werkstoff Opal = new Werkstoff(Materials.Opal, , ,31_766+510); + // public static Werkstoff Amethyst = new Werkstoff(Materials.Amethyst, , + // ,31_766+509); + // public static Werkstoff Redstone = new Werkstoff(Materials.Redstone, , + // ,31_766+810); + // public static Werkstoff Lapis = new Werkstoff(Materials.Lapis, , ,31_766+526); + // public static Werkstoff Blaze = new Werkstoff(Materials.Blaze, , ,31_766+801); + // public static Werkstoff EnderPearl = new Werkstoff(Materials.EnderPearl, , + // ,31_766+532); + // public static Werkstoff EnderEye = new Werkstoff(Materials.EnderEye, , + // ,31_766+533); + // public static Werkstoff Flint = new Werkstoff(Materials.Flint, , ,31_766+802); + // public static Werkstoff Diatomite = new Werkstoff(Materials.Diatomite, , + // ,31_766+948); + // public static Werkstoff VolcanicAsh = new Werkstoff(Materials.VolcanicAsh, , + // ,31_766+940); + // public static Werkstoff Niter = new Werkstoff(Materials.Niter, , ,31_766+531); + // public static Werkstoff Pyrotheum = new Werkstoff(Materials.Pyrotheum, , + // ,31_766+843); + // public static Werkstoff Cryotheum = new Werkstoff(Materials.Cryotheum, , + // ,31_766+898); + // public static Werkstoff HydratedCoal = new Werkstoff(Materials.HydratedCoal, , + // ,31_766+818); + // public static Werkstoff Apatite = new Werkstoff(Materials.Apatite, , + // ,31_766+530); + // public static Werkstoff Alumite = new Werkstoff(Materials.Alumite, , + // ,31_766+400); + // public static Werkstoff Manyullyn = new Werkstoff(Materials.Manyullyn, , + // ,31_766+386); + // public static Werkstoff Steeleaf = new Werkstoff(Materials.Steeleaf, , + // ,31_766+339); + // public static Werkstoff Knightmetal = new Werkstoff(Materials.Knightmetal, , + // ,31_766+362); -// public static Werkstoff NitroFuel = new Werkstoff(Materials.NitroFuel, , ,31_766+709); -// public static Werkstoff RedAlloy = new Werkstoff(Materials.RedAlloy, , ,31_766+308); -// public static Werkstoff CobaltBrass = new Werkstoff(Materials.CobaltBrass, , ,31_766+343); -// public static Werkstoff TricalciumPhosphate = new Werkstoff(Materials.TricalciumPhosphate, , ,31_766+534); -// public static Werkstoff Basalt = new Werkstoff(Materials.Basalt, , ,31_766+844); -// public static Werkstoff GarnetRed = new Werkstoff(Materials.GarnetRed, , ,31_766+527); -// public static Werkstoff GarnetYellow = new Werkstoff(Materials.GarnetYellow, , ,31_766+528); -// public static Werkstoff Marble = new Werkstoff(Materials.Marble, , ,31_766+845); -// public static Werkstoff Sugar = new Werkstoff(Materials.Sugar, , ,31_766+803); -// public static Werkstoff Thaumium = new Werkstoff(Materials.Thaumium, , ,31_766+330); -// public static Werkstoff Vinteum = new Werkstoff(Materials.Vinteum, , ,31_766+529); -// public static Werkstoff Redrock = new Werkstoff(Materials.Redrock, , ,31_766+846); -// public static Werkstoff PotassiumFeldspar = new Werkstoff(Materials.PotassiumFeldspar, , ,31_766+847); -// public static Werkstoff Biotite = new Werkstoff(Materials.Biotite, , ,31_766+848); -// public static Werkstoff GraniteBlack = new Werkstoff(Materials.GraniteBlack, , ,31_766+849); -// public static Werkstoff GraniteRed = new Werkstoff(Materials.GraniteRed, , ,31_766+850); -// public static Werkstoff Chrysotile = new Werkstoff(Materials.Chrysotile, , ,31_766+912); -// public static Werkstoff Realgar = new Werkstoff(Materials.Realgar, , ,31_766+913); -// public static Werkstoff VanadiumMagnetite = new Werkstoff(Materials.VanadiumMagnetite, , ,31_766+923); -// public static Werkstoff BasalticMineralSand = new Werkstoff(Materials.BasalticMineralSand, , ,31_766+935); -// public static Werkstoff GraniticMineralSand = new Werkstoff(Materials.GraniticMineralSand, , ,31_766+936); -// public static Werkstoff GarnetSand = new Werkstoff(Materials.GarnetSand, , ,31_766+938); -// public static Werkstoff QuartzSand = new Werkstoff(Materials.QuartzSand, , ,31_766+939); -// public static Werkstoff Bastnasite = new Werkstoff(Materials.Bastnasite, , ,31_766+905); -// public static Werkstoff Pentlandite = new Werkstoff(Materials.Pentlandite, , ,31_766+909); -// public static Werkstoff Spodumene = new Werkstoff(Materials.Spodumene, , ,31_766+920); -// public static Werkstoff Pollucite = new Werkstoff(Materials.Pollucite, , ,31_766+919); -// public static Werkstoff Tantalite = new Werkstoff(Materials.Tantalite, , ,31_766+921); -// public static Werkstoff Lepidolite = new Werkstoff(Materials.Lepidolite, , ,31_766+907); -// public static Werkstoff Glauconite = new Werkstoff(Materials.Glauconite, , ,31_766+933); -// public static Werkstoff GlauconiteSand = new Werkstoff(Materials.GlauconiteSand, , ,31_766+949); -// public static Werkstoff Vermiculite = new Werkstoff(Materials.Vermiculite, , ,31_766+932); -// public static Werkstoff Bentonite = new Werkstoff(Materials.Bentonite, , ,31_766+927); -// public static Werkstoff FullersEarth = new Werkstoff(Materials.FullersEarth, , ,31_766+928); -// public static Werkstoff Pitchblende = new Werkstoff(Materials.Pitchblende, , ,31_766+873); -// public static Werkstoff Monazite = new Werkstoff(Materials.Monazite, , ,31_766+520); -// public static Werkstoff Malachite = new Werkstoff(Materials.Malachite, , ,31_766+871); -// public static Werkstoff Mirabilite = new Werkstoff(Materials.Mirabilite, , ,31_766+900); -// public static Werkstoff Mica = new Werkstoff(Materials.Mica, , ,31_766+901); -// public static Werkstoff Trona = new Werkstoff(Materials.Trona, , ,31_766+903); -// public static Werkstoff Barite = new Werkstoff(Materials.Barite, , ,31_766+904); -// public static Werkstoff Gypsum = new Werkstoff(Materials.Gypsum, , ,31_766+934); -// public static Werkstoff Alunite = new Werkstoff(Materials.Alunite, , ,31_766+911); -// public static Werkstoff Dolomite = new Werkstoff(Materials.Dolomite, , ,31_766+914); -// public static Werkstoff Wollastonite = new Werkstoff(Materials.Wollastonite, , ,31_766+915); -// public static Werkstoff Zeolite = new Werkstoff(Materials.Zeolite, , ,31_766+916); -// public static Werkstoff Kyanite = new Werkstoff(Materials.Kyanite, , ,31_766+924); -// public static Werkstoff Kaolinite = new Werkstoff(Materials.Kaolinite, , ,31_766+929); -// public static Werkstoff Talc = new Werkstoff(Materials.Talc, , ,31_766+902); -// public static Werkstoff Soapstone = new Werkstoff(Materials.Soapstone, , ,31_766+877); -// public static Werkstoff Concrete = new Werkstoff(Materials.Concrete, , ,31_766+947); -// public static Werkstoff IronMagnetic = new Werkstoff(Materials.IronMagnetic, , ,31_766+354); -// public static Werkstoff SteelMagnetic = new Werkstoff(Materials.SteelMagnetic, , ,31_766+355); -// public static Werkstoff NeodymiumMagnetic = new Werkstoff(Materials.NeodymiumMagnetic, , ,31_766+356); -// public static Werkstoff SamariumMagnetic = new Werkstoff(Materials.SamariumMagnetic, , ,31_766+399); + // public static Werkstoff NitroFuel = new Werkstoff(Materials.NitroFuel, , + // ,31_766+709); + // public static Werkstoff RedAlloy = new Werkstoff(Materials.RedAlloy, , + // ,31_766+308); + // public static Werkstoff CobaltBrass = new Werkstoff(Materials.CobaltBrass, , + // ,31_766+343); + // public static Werkstoff TricalciumPhosphate = new Werkstoff(Materials.TricalciumPhosphate, + // , ,31_766+534); + // public static Werkstoff Basalt = new Werkstoff(Materials.Basalt, , ,31_766+844); + // public static Werkstoff GarnetRed = new Werkstoff(Materials.GarnetRed, , + // ,31_766+527); + // public static Werkstoff GarnetYellow = new Werkstoff(Materials.GarnetYellow, , + // ,31_766+528); + // public static Werkstoff Marble = new Werkstoff(Materials.Marble, , ,31_766+845); + // public static Werkstoff Sugar = new Werkstoff(Materials.Sugar, , ,31_766+803); + // public static Werkstoff Thaumium = new Werkstoff(Materials.Thaumium, , + // ,31_766+330); + // public static Werkstoff Vinteum = new Werkstoff(Materials.Vinteum, , + // ,31_766+529); + // public static Werkstoff Redrock = new Werkstoff(Materials.Redrock, , + // ,31_766+846); + // public static Werkstoff PotassiumFeldspar = new Werkstoff(Materials.PotassiumFeldspar, , + // ,31_766+847); + // public static Werkstoff Biotite = new Werkstoff(Materials.Biotite, , + // ,31_766+848); + // public static Werkstoff GraniteBlack = new Werkstoff(Materials.GraniteBlack, , + // ,31_766+849); + // public static Werkstoff GraniteRed = new Werkstoff(Materials.GraniteRed, , + // ,31_766+850); + // public static Werkstoff Chrysotile = new Werkstoff(Materials.Chrysotile, , + // ,31_766+912); + // public static Werkstoff Realgar = new Werkstoff(Materials.Realgar, , + // ,31_766+913); + // public static Werkstoff VanadiumMagnetite = new Werkstoff(Materials.VanadiumMagnetite, , + // ,31_766+923); + // public static Werkstoff BasalticMineralSand = new Werkstoff(Materials.BasalticMineralSand, + // , ,31_766+935); + // public static Werkstoff GraniticMineralSand = new Werkstoff(Materials.GraniticMineralSand, + // , ,31_766+936); + // public static Werkstoff GarnetSand = new Werkstoff(Materials.GarnetSand, , + // ,31_766+938); + // public static Werkstoff QuartzSand = new Werkstoff(Materials.QuartzSand, , + // ,31_766+939); + // public static Werkstoff Bastnasite = new Werkstoff(Materials.Bastnasite, , + // ,31_766+905); + // public static Werkstoff Pentlandite = new Werkstoff(Materials.Pentlandite, , + // ,31_766+909); + // public static Werkstoff Spodumene = new Werkstoff(Materials.Spodumene, , + // ,31_766+920); + // public static Werkstoff Pollucite = new Werkstoff(Materials.Pollucite, , + // ,31_766+919); + // public static Werkstoff Tantalite = new Werkstoff(Materials.Tantalite, , + // ,31_766+921); + // public static Werkstoff Lepidolite = new Werkstoff(Materials.Lepidolite, , + // ,31_766+907); + // public static Werkstoff Glauconite = new Werkstoff(Materials.Glauconite, , + // ,31_766+933); + // public static Werkstoff GlauconiteSand = new Werkstoff(Materials.GlauconiteSand, , + // ,31_766+949); + // public static Werkstoff Vermiculite = new Werkstoff(Materials.Vermiculite, , + // ,31_766+932); + // public static Werkstoff Bentonite = new Werkstoff(Materials.Bentonite, , + // ,31_766+927); + // public static Werkstoff FullersEarth = new Werkstoff(Materials.FullersEarth, , + // ,31_766+928); + // public static Werkstoff Pitchblende = new Werkstoff(Materials.Pitchblende, , + // ,31_766+873); + // public static Werkstoff Monazite = new Werkstoff(Materials.Monazite, , + // ,31_766+520); + // public static Werkstoff Malachite = new Werkstoff(Materials.Malachite, , + // ,31_766+871); + // public static Werkstoff Mirabilite = new Werkstoff(Materials.Mirabilite, , + // ,31_766+900); + // public static Werkstoff Mica = new Werkstoff(Materials.Mica, , ,31_766+901); + // public static Werkstoff Trona = new Werkstoff(Materials.Trona, , ,31_766+903); + // public static Werkstoff Barite = new Werkstoff(Materials.Barite, , ,31_766+904); + // public static Werkstoff Gypsum = new Werkstoff(Materials.Gypsum, , ,31_766+934); + // public static Werkstoff Alunite = new Werkstoff(Materials.Alunite, , + // ,31_766+911); + // public static Werkstoff Dolomite = new Werkstoff(Materials.Dolomite, , + // ,31_766+914); + // public static Werkstoff Wollastonite = new Werkstoff(Materials.Wollastonite, , + // ,31_766+915); + // public static Werkstoff Zeolite = new Werkstoff(Materials.Zeolite, , + // ,31_766+916); + // public static Werkstoff Kyanite = new Werkstoff(Materials.Kyanite, , + // ,31_766+924); + // public static Werkstoff Kaolinite = new Werkstoff(Materials.Kaolinite, , + // ,31_766+929); + // public static Werkstoff Talc = new Werkstoff(Materials.Talc, , ,31_766+902); + // public static Werkstoff Soapstone = new Werkstoff(Materials.Soapstone, , + // ,31_766+877); + // public static Werkstoff Concrete = new Werkstoff(Materials.Concrete, , + // ,31_766+947); + // public static Werkstoff IronMagnetic = new Werkstoff(Materials.IronMagnetic, , + // ,31_766+354); + // public static Werkstoff SteelMagnetic = new Werkstoff(Materials.SteelMagnetic, , + // ,31_766+355); + // public static Werkstoff NeodymiumMagnetic = new Werkstoff(Materials.NeodymiumMagnetic, , + // ,31_766+356); + // public static Werkstoff SamariumMagnetic = new Werkstoff(Materials.SamariumMagnetic, , + // ,31_766+399); -// public static DilutedSulfuricAcid = new MaterialBuilder(31_766+640) -// public static Werkstoff EpoxidFiberReinforced = new Werkstoff(Materials.EpoxidFiberReinforced, , ,31_766+610); -// public static PotassiumNitrade = new MaterialBuilder(59 -// public static ChromiumTrioxide = new MaterialBuilder(31_766+591) -// public static Nitrochlorobenzene = new MaterialBuilder(31_766+592) -// public static Dimethylbenzene = new MaterialBuilder(31_766+593) -// public static Potassiumdichromate = new MaterialBuilder(594 -// public static PhthalicAcid = new MaterialBuilder(31_766+595) -// public static Dichlorobenzidine = new MaterialBuilder(31_766+596) -// public static Diaminobenzidin = new MaterialBuilder(31_766+597) -// public static Diphenylisophthalate = new MaterialBuilder(59 -// public static Werkstoff Polybenzimidazole = new Werkstoff(Materials.Polybenzimidazole, , , 31_766+599); -// public static NitrousOxide = new MaterialBuilder(31_766+993) -// public static AntiKnock = new MaterialBuilder(31_766+994) -// public static Octane = new MaterialBuilder(31_766+995) -// public static GasolineRaw = new MaterialBuilder(31_766+996) -// public static GasolineRegular = new MaterialBuilder(31_766+997) -// public static GasolinePremium = new MaterialBuilder(31_766+998) -// public static Werkstoff Electrotine = new Werkstoff(Materials.Electrotine, , ,31_766+812); -// public static Galgadorian = new Werkstoff(Materials.Galgadorian, , ,31_766+384); -// public static Werkstoff EnhancedGalgadorian = new Werkstoff(Materials.EnhancedGalgadorian, , ,31_766+385); -// public static Werkstoff BloodInfusedIron = new Werkstoff(Materials.BloodInfusedIron, , ,31_766+977); -// public static Werkstoff Shadow = new Werkstoff(Materials.Shadow, , ,31_766+368); -// public static Werkstoff Ledox = new Werkstoff(Materials.Ledox, , ,31_766+390); -// public static Werkstoff Quantium = new Werkstoff(Materials.Quantium, , ,31_766+391); -// public static Werkstoff Mytryl = new Werkstoff(Materials.Mytryl, , ,31_766+387); -// public static Werkstoff BlackPlutonium = new Werkstoff(Materials.BlackPlutonium, , ,31_766+388); -// public static Werkstoff CallistoIce = new Werkstoff(Materials.CallistoIce, , ,31_766+389); -// public static Werkstoff Duralumin = new Werkstoff(Materials.Duralumin, , ,31_766+392); -// public static Werkstoff Oriharukon = new Werkstoff(Materials.Oriharukon, , ,31_766+393); -// public static Werkstoff MysteriousCrystal = new Werkstoff(Materials.MysteriousCrystal, , ,31_766+398); -// public static Werkstoff RedstoneAlloy = new Werkstoff(Materials.RedstoneAlloy, , ,31_766+381); -// public static Werkstoff Soularium = new Werkstoff(Materials.Soularium, , ,31_766+379); -// public static Werkstoff ConductiveIron = new Werkstoff(Materials.ConductiveIron, , ,31_766+369); -// public static Werkstoff ElectricalSteel = new Werkstoff(Materials.ElectricalSteel, , ,31_766+365); -// public static Werkstoff EnergeticAlloy = new Werkstoff(Materials.EnergeticAlloy, , ,31_766+366); -// public static Werkstoff VibrantAlloy = new Werkstoff(Materials.VibrantAlloy, , ,31_766+367); -// public static Werkstoff PulsatingIron = new Werkstoff(Materials.PulsatingIron, , ,31_766+378); -// public static Werkstoff DarkSteel = new Werkstoff(Materials.DarkSteel, , ,31_766+364); -// public static Werkstoff EndSteel = new Werkstoff(Materials.EndSteel, , ,31_766+401); -// public static Werkstoff CrudeSteel = new Werkstoff(Materials.CrudeSteel, , ,31_766+402); -// public static Werkstoff CrystallineAlloy = new Werkstoff(Materials.CrystallineAlloy, , ,31_766+403); -// public static Werkstoff MelodicAlloy = new Werkstoff(Materials.MelodicAlloy, , ,31_766+404); -// public static Werkstoff StellarAlloy = new Werkstoff(Materials.StellarAlloy, , ,31_766+405); -// public static Werkstoff CrystallinePinkSlime = new Werkstoff(Materials.CrystallinePinkSlime, , ,31_766+406); -// public static Werkstoff EnergeticSilver = new Werkstoff(Materials.EnergeticSilver, , ,31_766+407); -// public static Werkstoff VividAlloy = new Werkstoff(Materials.VividAlloy, , ,31_766+408); -// public static Werkstoff Enderium = new Werkstoff(Materials.Enderium, , ,31_766+321); -// public static Werkstoff Mithril = new Werkstoff(Materials.Mithril, , ,31_766+331); -// public static Werkstoff BlueAlloy = new Werkstoff(Materials.BlueAlloy, , ,31_766+309); -// public static Werkstoff ShadowIron = new Werkstoff(Materials.ShadowIron, , ,31_766+336); -// public static Werkstoff ShadowSteel = new Werkstoff(Materials.ShadowSteel, , ,31_766+337); -// public static Werkstoff AstralSilver = new Werkstoff(Materials.AstralSilver, , ,31_766+333); -// public static Werkstoff InfinityCatalyst = new Werkstoff(Materials.InfinityCatalyst, , , 31_766 + 394); -// public static Werkstoff Infinity = new Werkstoff(Materials.Infinity, , , 31_766 + 397); -// public static Werkstoff Bedrockium = new Werkstoff(Materials.Bedrockium, , , 31_766 + 395); -// public static Werkstoff Trinium = new Werkstoff(Materials.Trinium, , , 31_766 + 868); -// public static Werkstoff Ichorium = new Werkstoff(Materials.Ichorium, , , 31_766 + 978); -// public static Werkstoff CosmicNeutronium = new Werkstoff(Materials.CosmicNeutronium, , , 31_766 + 982); -// public static Werkstoff Pentacadmiummagnesiumhexaoxid = new Werkstoff(Materials.Pentacadmiummagnesiumhexaoxid, , , 31_766 + 987); -// public static Werkstoff Titaniumonabariumdecacoppereikosaoxid = new Werkstoff(Materials.Titaniumonabariumdecacoppereikosaoxid, , , 31_766 + 988); -// public static Werkstoff Uraniumtriplatinid = new Werkstoff(Materials.Uraniumtriplatinid, , , 31_766 + 989); -// public static Werkstoff Vanadiumtriindinid = new Werkstoff(Materials.Vanadiumtriindinid, , , 31_766 + 990); -// public static Werkstoff Tetraindiumditindibariumtitaniumheptacoppertetrakaidekaoxid = new Werkstoff(Materials.Tetraindiumditindibariumtitaniumheptacoppertetrakaidekaoxid, , , 31_766 + 991); -// public static Werkstoff Tetranaquadahdiindiumhexaplatiumosminid = new Werkstoff(Materials.Tetranaquadahdiindiumhexaplatiumosminid, , , 31_766 + 992); -// public static Werkstoff Longasssuperconductornameforuvwire = new Werkstoff(Materials.Longasssuperconductornameforuvwire, , , 31_766 + 986); -// public static Werkstoff Longasssuperconductornameforuhvwire = new Werkstoff(Materials.Longasssuperconductornameforuhvwire, , , 31_766 + 985); + // public static DilutedSulfuricAcid = new MaterialBuilder(31_766+640) + // public static Werkstoff EpoxidFiberReinforced = new Werkstoff(Materials.EpoxidFiberReinforced, + // , ,31_766+610); + // public static PotassiumNitrade = new MaterialBuilder(59 + // public static ChromiumTrioxide = new MaterialBuilder(31_766+591) + // public static Nitrochlorobenzene = new MaterialBuilder(31_766+592) + // public static Dimethylbenzene = new MaterialBuilder(31_766+593) + // public static Potassiumdichromate = new MaterialBuilder(594 + // public static PhthalicAcid = new MaterialBuilder(31_766+595) + // public static Dichlorobenzidine = new MaterialBuilder(31_766+596) + // public static Diaminobenzidin = new MaterialBuilder(31_766+597) + // public static Diphenylisophthalate = new MaterialBuilder(59 + // public static Werkstoff Polybenzimidazole = new Werkstoff(Materials.Polybenzimidazole, , + // , 31_766+599); + // public static NitrousOxide = new MaterialBuilder(31_766+993) + // public static AntiKnock = new MaterialBuilder(31_766+994) + // public static Octane = new MaterialBuilder(31_766+995) + // public static GasolineRaw = new MaterialBuilder(31_766+996) + // public static GasolineRegular = new MaterialBuilder(31_766+997) + // public static GasolinePremium = new MaterialBuilder(31_766+998) + // public static Werkstoff Electrotine = new Werkstoff(Materials.Electrotine, , + // ,31_766+812); + // public static Galgadorian = new Werkstoff(Materials.Galgadorian, , ,31_766+384); + // public static Werkstoff EnhancedGalgadorian = new Werkstoff(Materials.EnhancedGalgadorian, + // , ,31_766+385); + // public static Werkstoff BloodInfusedIron = new Werkstoff(Materials.BloodInfusedIron, , + // ,31_766+977); + // public static Werkstoff Shadow = new Werkstoff(Materials.Shadow, , ,31_766+368); + // public static Werkstoff Ledox = new Werkstoff(Materials.Ledox, , ,31_766+390); + // public static Werkstoff Quantium = new Werkstoff(Materials.Quantium, , + // ,31_766+391); + // public static Werkstoff Mytryl = new Werkstoff(Materials.Mytryl, , ,31_766+387); + // public static Werkstoff BlackPlutonium = new Werkstoff(Materials.BlackPlutonium, , + // ,31_766+388); + // public static Werkstoff CallistoIce = new Werkstoff(Materials.CallistoIce, , + // ,31_766+389); + // public static Werkstoff Duralumin = new Werkstoff(Materials.Duralumin, , + // ,31_766+392); + // public static Werkstoff Oriharukon = new Werkstoff(Materials.Oriharukon, , + // ,31_766+393); + // public static Werkstoff MysteriousCrystal = new Werkstoff(Materials.MysteriousCrystal, , + // ,31_766+398); + // public static Werkstoff RedstoneAlloy = new Werkstoff(Materials.RedstoneAlloy, , + // ,31_766+381); + // public static Werkstoff Soularium = new Werkstoff(Materials.Soularium, , + // ,31_766+379); + // public static Werkstoff ConductiveIron = new Werkstoff(Materials.ConductiveIron, , + // ,31_766+369); + // public static Werkstoff ElectricalSteel = new Werkstoff(Materials.ElectricalSteel, , + // ,31_766+365); + // public static Werkstoff EnergeticAlloy = new Werkstoff(Materials.EnergeticAlloy, , + // ,31_766+366); + // public static Werkstoff VibrantAlloy = new Werkstoff(Materials.VibrantAlloy, , + // ,31_766+367); + // public static Werkstoff PulsatingIron = new Werkstoff(Materials.PulsatingIron, , + // ,31_766+378); + // public static Werkstoff DarkSteel = new Werkstoff(Materials.DarkSteel, , + // ,31_766+364); + // public static Werkstoff EndSteel = new Werkstoff(Materials.EndSteel, , + // ,31_766+401); + // public static Werkstoff CrudeSteel = new Werkstoff(Materials.CrudeSteel, , + // ,31_766+402); + // public static Werkstoff CrystallineAlloy = new Werkstoff(Materials.CrystallineAlloy, , + // ,31_766+403); + // public static Werkstoff MelodicAlloy = new Werkstoff(Materials.MelodicAlloy, , + // ,31_766+404); + // public static Werkstoff StellarAlloy = new Werkstoff(Materials.StellarAlloy, , + // ,31_766+405); + // public static Werkstoff CrystallinePinkSlime = new Werkstoff(Materials.CrystallinePinkSlime, + // , ,31_766+406); + // public static Werkstoff EnergeticSilver = new Werkstoff(Materials.EnergeticSilver, , + // ,31_766+407); + // public static Werkstoff VividAlloy = new Werkstoff(Materials.VividAlloy, , + // ,31_766+408); + // public static Werkstoff Enderium = new Werkstoff(Materials.Enderium, , + // ,31_766+321); + // public static Werkstoff Mithril = new Werkstoff(Materials.Mithril, , + // ,31_766+331); + // public static Werkstoff BlueAlloy = new Werkstoff(Materials.BlueAlloy, , + // ,31_766+309); + // public static Werkstoff ShadowIron = new Werkstoff(Materials.ShadowIron, , + // ,31_766+336); + // public static Werkstoff ShadowSteel = new Werkstoff(Materials.ShadowSteel, , + // ,31_766+337); + // public static Werkstoff AstralSilver = new Werkstoff(Materials.AstralSilver, , + // ,31_766+333); + // public static Werkstoff InfinityCatalyst = new Werkstoff(Materials.InfinityCatalyst, , + // , 31_766 + 394); + // public static Werkstoff Infinity = new Werkstoff(Materials.Infinity, , , 31_766 + + // 397); + // public static Werkstoff Bedrockium = new Werkstoff(Materials.Bedrockium, , , + // 31_766 + 395); + // public static Werkstoff Trinium = new Werkstoff(Materials.Trinium, , , 31_766 + + // 868); + // public static Werkstoff Ichorium = new Werkstoff(Materials.Ichorium, , , 31_766 + + // 978); + // public static Werkstoff CosmicNeutronium = new Werkstoff(Materials.CosmicNeutronium, , + // , 31_766 + 982); + // public static Werkstoff Pentacadmiummagnesiumhexaoxid = new Werkstoff(Materials.Pentacadmiummagnesiumhexaoxid, + // , , 31_766 + 987); + // public static Werkstoff Titaniumonabariumdecacoppereikosaoxid = new + // Werkstoff(Materials.Titaniumonabariumdecacoppereikosaoxid, , , 31_766 + 988); + // public static Werkstoff Uraniumtriplatinid = new Werkstoff(Materials.Uraniumtriplatinid, , + // , 31_766 + 989); + // public static Werkstoff Vanadiumtriindinid = new Werkstoff(Materials.Vanadiumtriindinid, , + // , 31_766 + 990); + // public static Werkstoff Tetraindiumditindibariumtitaniumheptacoppertetrakaidekaoxid = new + // Werkstoff(Materials.Tetraindiumditindibariumtitaniumheptacoppertetrakaidekaoxid, , , + // 31_766 + 991); + // public static Werkstoff Tetranaquadahdiindiumhexaplatiumosminid = new + // Werkstoff(Materials.Tetranaquadahdiindiumhexaplatiumosminid, , , 31_766 + 992); + // public static Werkstoff Longasssuperconductornameforuvwire = new + // Werkstoff(Materials.Longasssuperconductornameforuvwire, , , 31_766 + 986); + // public static Werkstoff Longasssuperconductornameforuhvwire = new + // Werkstoff(Materials.Longasssuperconductornameforuhvwire, , , 31_766 + 985); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java index 630d45c467..d0c177e8f3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java @@ -22,29 +22,38 @@ package com.github.bartimaeusnek.bartworks.system.material; +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap; + import com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import java.util.ArrayList; -import java.util.List; - -import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap; - public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { public BW_MetaGeneratedBlock_Item(Block par1) { super(par1); } - public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + ItemStack stack, + EntityPlayer player, + World world, + int x, + int y, + int z, + int side, + float hitX, + float hitY, + float hitZ) { return false; } @@ -59,10 +68,11 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { int aMetaData = aStack.getItemDamage(); Werkstoff werkstoff = werkstoffHashMap.get((short) aMetaData); if (werkstoff == null) werkstoff = Werkstoff.default_null_Werkstoff; - return ((BW_MetaGenerated_Blocks) block).blockTypeLocalizedName.replace("%material", werkstoff.getLocalizedName()); + return ((BW_MetaGenerated_Blocks) block) + .blockTypeLocalizedName.replace("%material", werkstoff.getLocalizedName()); } } - return GT_LanguageManager.getTranslation( getUnlocalizedName(aStack) + ".name"); + return GT_LanguageManager.getTranslation(getUnlocalizedName(aStack) + ".name"); } @Override @@ -76,7 +86,7 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { aList = new ArrayList(); } Werkstoff werkstoff = Werkstoff.werkstoffHashMap.get((short) aStack.getItemDamage()); - if(werkstoff != null) { + if (werkstoff != null) { String tooltip = werkstoff.getLocalizedToolTip(); if (!tooltip.isEmpty()) { aList.add(tooltip); @@ -93,7 +103,18 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { } } - public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { + public boolean placeBlockAt( + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int side, + float hitX, + float hitY, + float hitZ, + int aMeta) { short tDamage = (short) this.getDamage(aStack); if (tDamage > 0) { if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) { @@ -101,8 +122,7 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { } BW_MetaGenerated_Block_TE tTileEntity = (BW_MetaGenerated_Block_TE) aWorld.getTileEntity(aX, aY, aZ); tTileEntity.mMetaData = tDamage; - } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, 0, 3)) - return false; + } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, 0, 3)) return false; if (aWorld.getBlock(aX, aY, aZ) == this.field_150939_a) { this.field_150939_a.onBlockPlacedBy(aWorld, aX, aY, aZ, aPlayer, aStack); this.field_150939_a.onPostBlockPlaced(aWorld, aX, aY, aZ, tDamage); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java index abc49d8a53..6893bb3ae5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -26,6 +26,8 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; +import java.util.List; +import java.util.Optional; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; @@ -36,13 +38,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import java.util.List; -import java.util.Optional; - -public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks implements com.gtnewhorizon.structurelib.structure.ICustomBlockSetting -{ +public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks + implements com.gtnewhorizon.structurelib.structure.ICustomBlockSetting { - public BW_MetaGeneratedBlocks_Casing(Material p_i45386_1_, Class tileEntity, String blockName, OrePrefixes prefixes) { + public BW_MetaGeneratedBlocks_Casing( + Material p_i45386_1_, Class tileEntity, String blockName, OrePrefixes prefixes) { super(p_i45386_1_, tileEntity, blockName, prefixes); } @@ -79,7 +79,7 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple @Override public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { - super.onBlockAdded(aWorld,aX,aY,aZ); + super.onBlockAdded(aWorld, aX, aY, aZ); GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } @@ -90,10 +90,8 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple @Override public String getUnlocalizedName() { - if (_prefixes == WerkstoffLoader.blockCasing) - return "bw.werkstoffblockscasing.01"; - else if (_prefixes == WerkstoffLoader.blockCasingAdvanced) - return "bw.werkstoffblockscasingadvanced.01"; + if (_prefixes == WerkstoffLoader.blockCasing) return "bw.werkstoffblockscasing.01"; + else if (_prefixes == WerkstoffLoader.blockCasingAdvanced) return "bw.werkstoffblockscasingadvanced.01"; return ""; } @@ -102,16 +100,13 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple @SuppressWarnings("unchecked") public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { Werkstoff.werkstoffHashSet.stream() - .filter(pMaterial -> - pMaterial.getType().equals(Werkstoff.Types.BIOLOGICAL) + .filter(pMaterial -> pMaterial.getType().equals(Werkstoff.Types.BIOLOGICAL) && pMaterial.hasGenerationFeature(WerkstoffLoader.blockCasing) - || - pMaterial.doesOreDictedItemExists(OrePrefixes.plate) + || pMaterial.doesOreDictedItemExists(OrePrefixes.plate) && pMaterial.doesOreDictedItemExists(OrePrefixes.screw) && pMaterial.doesOreDictedItemExists(OrePrefixes.plateDouble) && pMaterial.doesOreDictedItemExists(OrePrefixes.gearGt) - && pMaterial.doesOreDictedItemExists(OrePrefixes.gearGtSmall) - ) + && pMaterial.doesOreDictedItemExists(OrePrefixes.gearGtSmall)) .map(pMaterial -> new ItemStack(aItem, 1, pMaterial.getmID())) .forEach(aList::add); } @@ -120,12 +115,13 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple * ICustomBlockSetting setBlock override */ public void setBlock(World world, int x, int y, int z, int meta) { - world.setBlock(x, y, z,this, meta,2); + world.setBlock(x, y, z, this, meta, 2); try { Thread.sleep(1); - //Fucking Minecraft TE settings. - } catch (InterruptedException ignored) {} - Optional.ofNullable(world.getTileEntity(x,y,z)) + // Fucking Minecraft TE settings. + } catch (InterruptedException ignored) { + } + Optional.ofNullable(world.getTileEntity(x, y, z)) .filter(te -> te instanceof BW_MetaGenerated_Block_TE) .map(te -> (BW_MetaGenerated_Block_TE) te) .ifPresent(te -> te.mMetaData = (short) meta); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java index 9d0fd5811b..4a1e088679 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java @@ -48,11 +48,13 @@ public class BW_MetaGeneratedBlocks_CasingAdvanced_TE extends BW_MetaGenerated_B PrefixTextureLinker.texMapBlocks .get(WerkstoffLoader.blockCasingAdvanced) .getOrDefault(set, TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]), - aMaterial.getRGBA() - ); - return new ITexture[]{TextureFactory.of(Blocks.iron_block), aIconSet}; + aMaterial.getRGBA()); + return new ITexture[] {TextureFactory.of(Blocks.iron_block), aIconSet}; } } - return new ITexture[]{TextureFactory.of(Blocks.iron_block), TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; + return new ITexture[] { + TextureFactory.of(Blocks.iron_block), + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) + }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java index 4d81419f2a..9c06ed7f25 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java @@ -48,11 +48,13 @@ public class BW_MetaGeneratedBlocks_Casing_TE extends BW_MetaGenerated_Block_TE PrefixTextureLinker.texMapBlocks .get(WerkstoffLoader.blockCasing) .getOrDefault(set, TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]), - aMaterial.getRGBA() - ); - return new ITexture[]{TextureFactory.of(Blocks.iron_block), aIconSet}; + aMaterial.getRGBA()); + return new ITexture[] {TextureFactory.of(Blocks.iron_block), aIconSet}; } } - return new ITexture[]{TextureFactory.of(Blocks.iron_block), TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; + return new ITexture[] { + TextureFactory.of(Blocks.iron_block), + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) + }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java index af5706a80b..789a802d20 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material; +import static gregtech.api.enums.GT_Values.RA; + import gregtech.api.enums.Dyes; import gregtech.api.enums.ItemList; import gregtech.api.enums.OrePrefixes; @@ -36,8 +38,6 @@ import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import static gregtech.api.enums.GT_Values.RA; - public class BW_MetaGeneratedFrames extends MetaPipeEntity { public final Werkstoff mMaterial; @@ -47,8 +47,16 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { mMaterial = aMaterial; GT_OreDictUnificator.registerOre(OrePrefixes.frameGt, aMaterial, getStackForm(1)); - GT_ModHandler.addCraftingRecipe(getStackForm(2), RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SSS", "SwS", "SSS", 'S', mMaterial.get(OrePrefixes.stick)}); - RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.getVarName(), 4), ItemList.Circuit_Integrated.getWithDamage(0, 4), getStackForm(1), 64, 8); + GT_ModHandler.addCraftingRecipe( + getStackForm(2), + RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] {"SSS", "SwS", "SSS", 'S', mMaterial.get(OrePrefixes.stick)}); + RA.addAssemblerRecipe( + GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.getVarName(), 4), + ItemList.Circuit_Integrated.getWithDamage(0, 4), + getStackForm(1), + 64, + 8); } private BW_MetaGeneratedFrames(String aName, Werkstoff aMaterial) { @@ -67,13 +75,23 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { - return new ITexture[]{TextureFactory.of(this.mMaterial.getTexSet().mTextures[OrePrefixes.frameGt.mTextureIndex], Dyes.getModulation(aColorIndex, this.mMaterial.getRGBA()))}; + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aConnections, + byte aColorIndex, + boolean aConnected, + boolean aRedstone) { + return new ITexture[] { + TextureFactory.of( + this.mMaterial.getTexSet().mTextures[OrePrefixes.frameGt.mTextureIndex], + Dyes.getModulation(aColorIndex, this.mMaterial.getRGBA())) + }; } @Override public String[] getDescription() { - return new String[]{"Just something you can put a Cover or CFoam on."}; + return new String[] {"Just something you can put a Cover or CFoam on."}; } @Override @@ -102,18 +120,24 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { } @Override - public final void saveNBTData(NBTTagCompound aNBT) {/*Do nothing*/} + public final void saveNBTData(NBTTagCompound aNBT) { + /*Do nothing*/ + } @Override - public final void loadNBTData(NBTTagCompound aNBT) {/*Do nothing*/} + public final void loadNBTData(NBTTagCompound aNBT) { + /*Do nothing*/ + } @Override - public final boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + public final boolean allowPutStack( + IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return false; } @Override - public final boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + public final boolean allowPullStack( + IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return false; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index 63245b588a..a32db89a1c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -34,10 +34,14 @@ public class BW_MetaGeneratedOreTE extends BW_MetaGenerated_Block_TE { public ITexture[] getTexture(Block aBlock, byte aSide) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if ((aMaterial != null)) { - ITexture aIconSet = TextureFactory.of(aMaterial.getTexSet().mTextures[OrePrefixes.ore.mTextureIndex], aMaterial.getRGBA()); - return new ITexture[]{TextureFactory.of(Blocks.stone), aIconSet}; + ITexture aIconSet = TextureFactory.of( + aMaterial.getTexSet().mTextures[OrePrefixes.ore.mTextureIndex], aMaterial.getRGBA()); + return new ITexture[] {TextureFactory.of(Blocks.stone), aIconSet}; } - return new ITexture[]{TextureFactory.of(Blocks.stone), TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex])}; + return new ITexture[] { + TextureFactory.of(Blocks.stone), + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex]) + }; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java index cbf6b9482b..fd73fde587 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java @@ -29,13 +29,12 @@ import gregtech.api.objects.XSTR; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.Random; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import java.util.ArrayList; -import java.util.Random; - public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { public ArrayList getDrops(int aFortune) { @@ -46,13 +45,15 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { Random tRandom = new XSTR(this.xCoord ^ this.yCoord ^ this.zCoord); ArrayList tSelector = new ArrayList<>(); - ItemStack tStack = GT_OreDictUnificator.get(OrePrefixes.gemExquisite, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); + ItemStack tStack = GT_OreDictUnificator.get( + OrePrefixes.gemExquisite, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); if (tStack != null) { for (int i = 0; i < 1; i++) { tSelector.add(tStack); } } - tStack = GT_OreDictUnificator.get(OrePrefixes.gemFlawless, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); + tStack = GT_OreDictUnificator.get( + OrePrefixes.gemFlawless, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); if (tStack != null) { for (int i = 0; i < 2; i++) { tSelector.add(tStack); @@ -64,7 +65,8 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { tSelector.add(tStack); } } - tStack = GT_OreDictUnificator.get(OrePrefixes.gemFlawed, aMaterial, GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L), 1L); + tStack = GT_OreDictUnificator.get( + OrePrefixes.gemFlawed, aMaterial, GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L), 1L); if (tStack != null) { for (int i = 0; i < 5; i++) { tSelector.add(tStack); @@ -76,7 +78,11 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { tSelector.add(tStack); } } - tStack = GT_OreDictUnificator.get(OrePrefixes.gemChipped, aMaterial, GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L), 1L); + tStack = GT_OreDictUnificator.get( + OrePrefixes.gemChipped, + aMaterial, + GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L), + 1L); if (tStack != null) { for (int i = 0; i < 5; i++) { tSelector.add(tStack); @@ -91,13 +97,13 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { if (tSelector.size() > 0) { int i = 0; - for(int j = Math.max(1, (aFortune > 0 ? tRandom.nextInt(1 + aFortune) : 0)); i < j; ++i) { + for (int j = Math.max(1, (aFortune > 0 ? tRandom.nextInt(1 + aFortune) : 0)); i < j; ++i) { rList.add(GT_Utility.copyAmount(1L, tSelector.get(tRandom.nextInt(tSelector.size())))); } - } if (tRandom.nextInt(3 + aFortune) > 1) { - rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Stone, 1L)); + rList.add(GT_OreDictUnificator.get( + tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Stone, 1L)); } } return rList; @@ -107,10 +113,14 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { public ITexture[] getTexture(Block aBlock, byte aSide) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if ((aMaterial != null)) { - ITexture aIconSet = TextureFactory.of(aMaterial.getTexSet().mTextures[OrePrefixes.oreSmall.mTextureIndex], aMaterial.getRGBA()); - return new ITexture[]{TextureFactory.of(Blocks.stone), aIconSet}; + ITexture aIconSet = TextureFactory.of( + aMaterial.getTexSet().mTextures[OrePrefixes.oreSmall.mTextureIndex], aMaterial.getRGBA()); + return new ITexture[] {TextureFactory.of(Blocks.stone), aIconSet}; } - return new ITexture[]{TextureFactory.of(Blocks.stone), TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.oreSmall.mTextureIndex])}; + return new ITexture[] { + TextureFactory.of(Blocks.stone), + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.oreSmall.mTextureIndex]) + }; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java index 9ad31b32cd..d3ba33be2f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java @@ -22,8 +22,11 @@ package com.github.bartimaeusnek.bartworks.system.material; +import static com.github.bartimaeusnek.bartworks.MainMod.BW_Network_instance; + import com.github.bartimaeusnek.bartworks.common.net.MetaBlockPacket; import gregtech.api.interfaces.tileentity.ITexturedTileEntity; +import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -31,10 +34,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.Packet; import net.minecraft.tileentity.TileEntity; -import java.util.ArrayList; - -import static com.github.bartimaeusnek.bartworks.MainMod.BW_Network_instance; - public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements ITexturedTileEntity { public short mMetaData; @@ -56,7 +55,11 @@ public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements IT @Override public Packet getDescriptionPacket() { if (!this.worldObj.isRemote) - BW_Network_instance.sendPacketToAllPlayersInRange(this.worldObj, new MetaBlockPacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); + BW_Network_instance.sendPacketToAllPlayersInRange( + this.worldObj, + new MetaBlockPacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), + this.xCoord, + this.zCoord); return null; } @@ -71,5 +74,4 @@ public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements IT rList.add(new ItemStack(GetProperBlock(), 1, this.mMetaData)); return rList; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java index ad6e1f24ee..0defff39f6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material; +import static com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items.metaTab; + import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -29,6 +31,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; +import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; @@ -36,10 +39,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import java.util.ArrayList; - -import static com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items.metaTab; - public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { public static ThreadLocal mTemporaryTileEntity = new ThreadLocal<>(); @@ -50,7 +49,8 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { this(p_i45386_1_, tileEntity, blockName, null); } - public BW_MetaGenerated_Blocks(Material p_i45386_1_, Class tileEntity, String blockName, OrePrefixes types) { + public BW_MetaGenerated_Blocks( + Material p_i45386_1_, Class tileEntity, String blockName, OrePrefixes types) { super(p_i45386_1_, tileEntity, blockName); this.setHardness(5.0F); this.setResistance(5.0F); @@ -58,7 +58,9 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { this.setCreativeTab(metaTab); _prefixes = types; if (_prefixes != null) { - this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.blocktype." + _prefixes, _prefixes.mLocalizedMaterialPre + "%material" + _prefixes.mLocalizedMaterialPost); + this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization( + "bw.blocktype." + _prefixes, + _prefixes.mLocalizedMaterialPre + "%material" + _prefixes.mLocalizedMaterialPost); } Werkstoff.werkstoffHashSet.forEach(this::doRegistrationStuff); } @@ -66,14 +68,14 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { @Override public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { super.onBlockAdded(aWorld, aX, aY, aZ); - //Waste some time to allow the TE to be set, do not use thread sleep here, it doesnt allow for nanoseconds. - //This will just waste a few cpu cycles to allow the TE to be set + // Waste some time to allow the TE to be set, do not use thread sleep here, it doesnt allow for nanoseconds. + // This will just waste a few cpu cycles to allow the TE to be set BW_Util.shortSleep(0); } @SideOnly(Side.CLIENT) public final BW_MetaGenerated_Block_TE getProperTileEntityForRendering() { - return (BW_MetaGenerated_Block_TE) createNewTileEntity(null,0); + return (BW_MetaGenerated_Block_TE) createNewTileEntity(null, 0); } protected abstract void doRegistrationStuff(Werkstoff w); @@ -88,8 +90,7 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { } public int getRenderType() { - if (BW_Renderer_Block_Ores.INSTANCE == null) - return super.getRenderType(); + if (BW_Renderer_Block_Ores.INSTANCE == null) return super.getRenderType(); return BW_Renderer_Block_Ores.INSTANCE.mRenderID; } @@ -103,7 +104,7 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { @Override public TileEntity createTileEntity(World world, int metadata) { - return ((ITileEntityProvider)this).createNewTileEntity(world, metadata); + return ((ITileEntityProvider) this).createNewTileEntity(world, metadata); } @Override @@ -124,7 +125,8 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) { return ((BW_MetaGenerated_Block_TE) tTileEntity).getDrops(aFortune); } - return mTemporaryTileEntity.get() == null ? new ArrayList<>() : mTemporaryTileEntity.get().getDrops(aFortune); + return mTemporaryTileEntity.get() == null + ? new ArrayList<>() + : mTemporaryTileEntity.get().getDrops(aFortune); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 98afa14cee..b75edf88a0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material; +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap; +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashSet; + import com.github.bartimaeusnek.bartworks.API.IRadMaterial; import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; @@ -36,6 +39,7 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import ic2.core.IC2Potion; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; @@ -51,11 +55,6 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; -import java.util.List; - -import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap; -import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashSet; - public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRadMaterial { public static final CreativeTabs metaTab = new CreativeTabs("bartworksMetaMaterials") { @@ -64,33 +63,37 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa public Item getTabIconItem() { return new ItemStack(Blocks.iron_ore).getItem(); } - }; protected final OrePrefixes orePrefixes; protected final String itemTypeLocalizedName; - public BW_MetaGenerated_Items(OrePrefixes orePrefixes, Object unused){ + public BW_MetaGenerated_Items(OrePrefixes orePrefixes, Object unused) { super("bwMetaGeneratedGTEnhancement" + orePrefixes.name(), (short) 32766, (short) 0); this.orePrefixes = orePrefixes; - this.itemTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.itemtype." + orePrefixes, orePrefixes.mLocalizedMaterialPre + "%material" + orePrefixes.mLocalizedMaterialPost); + this.itemTypeLocalizedName = GT_LanguageManager.addStringLocalization( + "bw.itemtype." + orePrefixes, + orePrefixes.mLocalizedMaterialPre + "%material" + orePrefixes.mLocalizedMaterialPost); } public BW_MetaGenerated_Items(OrePrefixes orePrefixes) { super("bwMetaGenerated" + orePrefixes.name(), (short) 32766, (short) 0); this.orePrefixes = orePrefixes; - this.itemTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.itemtype." + orePrefixes, orePrefixes.mLocalizedMaterialPre + "%material" + orePrefixes.mLocalizedMaterialPost); + this.itemTypeLocalizedName = GT_LanguageManager.addStringLocalization( + "bw.itemtype." + orePrefixes, + orePrefixes.mLocalizedMaterialPre + "%material" + orePrefixes.mLocalizedMaterialPost); this.setCreativeTab(BW_MetaGenerated_Items.metaTab); for (Werkstoff w : werkstoffHashSet) { ItemStack tStack = new ItemStack(this, 1, w.getmID()); - if (!w.hasItemType(this.orePrefixes)) - continue; + if (!w.hasItemType(this.orePrefixes)) continue; GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.getVarName(), tStack); } } public boolean onEntityItemUpdate(EntityItem aItemEntity) { - if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure || this.orePrefixes == OrePrefixes.crushed) { + if (this.orePrefixes == OrePrefixes.dustImpure + || this.orePrefixes == OrePrefixes.dustPure + || this.orePrefixes == OrePrefixes.crushed) { int aDamage = aItemEntity.getEntityItem().getItemDamage(); if ((aDamage >= 0) && (!aItemEntity.worldObj.isRemote)) { Werkstoff aMaterial = werkstoffHashMap.get((short) aDamage); @@ -102,13 +105,15 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((this.orePrefixes == OrePrefixes.dustImpure) || (this.orePrefixes == OrePrefixes.dustPure)) { if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { - aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dust, aMaterial, aItemEntity.getEntityItem().stackSize)); + aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack( + OrePrefixes.dust, aMaterial, aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } } else { if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { - aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, aMaterial, aItemEntity.getEntityItem().stackSize)); + aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack( + OrePrefixes.crushedPurified, aMaterial, aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } @@ -122,16 +127,18 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override @SuppressWarnings("unchecked") protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { -// String tooltip = GT_LanguageManager.getTranslation(this.getUnlocalizedName(aStack) + ".tooltip"); -// if (!tooltip.isEmpty()) -// aList.add(tooltip); + // String tooltip = GT_LanguageManager.getTranslation(this.getUnlocalizedName(aStack) + ".tooltip"); + // if (!tooltip.isEmpty()) + // aList.add(tooltip); if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure) { aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify")); } if (this.orePrefixes == OrePrefixes.crushed) aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify.2")); - if (aStack != null && aStack.getItem() instanceof BW_MetaGenerated_Items && aStack.getItemDamage() == WerkstoffLoader.Tiberium.getmID()) + if (aStack != null + && aStack.getItem() instanceof BW_MetaGenerated_Items + && aStack.getItemDamage() == WerkstoffLoader.Tiberium.getmID()) aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.nqgen")); Werkstoff werkstoff = werkstoffHashMap.get((short) this.getDamage(aStack)); @@ -162,16 +169,16 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public IIconContainer getIconContainer(int aMetaData) { - if (werkstoffHashMap.get((short) aMetaData) == null) - return null; - if (this.orePrefixes.mTextureIndex == -1) - return getIconContainerBartWorks(aMetaData); + if (werkstoffHashMap.get((short) aMetaData) == null) return null; + if (this.orePrefixes.mTextureIndex == -1) return getIconContainerBartWorks(aMetaData); return werkstoffHashMap.get((short) aMetaData).getTexSet().mTextures[this.orePrefixes.mTextureIndex]; } protected IIconContainer getIconContainerBartWorks(int aMetaData) { if (SideReference.Side.Client) - return PrefixTextureLinker.texMap.get(this.orePrefixes).get(werkstoffHashMap.get((short) aMetaData).getTexSet()); + return PrefixTextureLinker.texMap + .get(this.orePrefixes) + .get(werkstoffHashMap.get((short) aMetaData).getTexSet()); return null; } @@ -185,7 +192,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa aList.add(tStack); } } - //super.getSubItems(var1, aCreativeTab, aList); + // super.getSubItems(var1, aCreativeTab, aList); } @Override @@ -197,34 +204,28 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public void onUpdate(ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) { super.onUpdate(aStack, aWorld, aPlayer, aTimer, aIsInHand); - if (aStack == null || aStack.getItem() == null || !(aPlayer instanceof EntityLivingBase)) - return; + if (aStack == null || aStack.getItem() == null || !(aPlayer instanceof EntityLivingBase)) return; EntityLivingBase bPlayer = (EntityPlayer) aPlayer; - Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage()); - if (w == null || w.getStats() == null) - return; + Werkstoff w = werkstoffHashMap.get((short) aStack.getItemDamage()); + if (w == null || w.getStats() == null) return; - if (w.getStats().isToxic() && !GT_Utility.isWearingFullBioHazmat(bPlayer)){ - bPlayer.addPotionEffect(new PotionEffect(Potion.poison.getId(),80,4)); + if (w.getStats().isToxic() && !GT_Utility.isWearingFullBioHazmat(bPlayer)) { + bPlayer.addPotionEffect(new PotionEffect(Potion.poison.getId(), 80, 4)); } - if (w.getStats().isRadioactive() && !GT_Utility.isWearingFullRadioHazmat(bPlayer)){ - bPlayer.addPotionEffect(new PotionEffect(IC2Potion.radiation.id,80,4)); + if (w.getStats().isRadioactive() && !GT_Utility.isWearingFullRadioHazmat(bPlayer)) { + bPlayer.addPotionEffect(new PotionEffect(IC2Potion.radiation.id, 80, 4)); } - } @Override public final IIcon getIconFromDamage(int aMetaData) { - if (aMetaData < 0) - return null; + if (aMetaData < 0) return null; Werkstoff tMaterial = werkstoffHashMap.get((short) aMetaData); - if (tMaterial == null) - return null; + if (tMaterial == null) return null; IIconContainer tIcon = this.getIconContainer(aMetaData); - if (tIcon != null) - return tIcon.getIcon(); + if (tIcon != null) return tIcon.getIcon(); return null; } @@ -235,7 +236,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public int getRadiationLevel(ItemStack aStack) { - Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage()); + Werkstoff w = werkstoffHashMap.get((short) aStack.getItemDamage()); return w.getStats().isRadioactive() ? (int) w.getStats().getProtons() : 0; } @@ -246,23 +247,33 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public short[] getColorForGUI(ItemStack aStack) { - Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage()); + Werkstoff w = werkstoffHashMap.get((short) aStack.getItemDamage()); return w.getRGBA(); } @Override public String getNameForGUI(ItemStack aStack) { - Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage()); + Werkstoff w = werkstoffHashMap.get((short) aStack.getItemDamage()); return w.getDefaultName(); } @Override public int getCapacity(ItemStack aStack) { - return this.orePrefixes == OrePrefixes.capsule || this.orePrefixes == OrePrefixes.cell || this.orePrefixes == OrePrefixes.cellPlasma ? 1000 : this.orePrefixes == WerkstoffLoader.cellMolten || this.orePrefixes == WerkstoffLoader.capsuleMolten ? 144 : 0; + return this.orePrefixes == OrePrefixes.capsule + || this.orePrefixes == OrePrefixes.cell + || this.orePrefixes == OrePrefixes.cellPlasma + ? 1000 + : this.orePrefixes == WerkstoffLoader.cellMolten || this.orePrefixes == WerkstoffLoader.capsuleMolten + ? 144 + : 0; } @Override public ItemStack getContainerItem(ItemStack aStack) { - return this.orePrefixes == OrePrefixes.cell ||this.orePrefixes == OrePrefixes.cellPlasma || this.orePrefixes == WerkstoffLoader.cellMolten ? Materials.Empty.getCells(1) : null; + return this.orePrefixes == OrePrefixes.cell + || this.orePrefixes == OrePrefixes.cellPlasma + || this.orePrefixes == WerkstoffLoader.cellMolten + ? Materials.Empty.getCells(1) + : null; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 6e0ad77b8c..51107af501 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -26,6 +26,8 @@ import com.github.bartimaeusnek.bartworks.util.MathUtils; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; +import java.util.Arrays; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; @@ -37,27 +39,26 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import java.util.Arrays; -import java.util.List; - public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { public BW_MetaGenerated_Ores(Material p_i45386_1_, Class tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); - this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.blocktype." + OrePrefixes.ore, OrePrefixes.ore.mLocalizedMaterialPre + "%material" + OrePrefixes.ore.mLocalizedMaterialPost); + this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization( + "bw.blocktype." + OrePrefixes.ore, + OrePrefixes.ore.mLocalizedMaterialPre + "%material" + OrePrefixes.ore.mLocalizedMaterialPost); } protected void doRegistrationStuff(Werkstoff w) { if (w != null) { - if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) - return; + if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) return; GT_ModHandler.addValuableOre(this, w.getmID(), 1); } } - public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, int[] aBlockMeta) { + public static boolean setOreBlock( + World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, int[] aBlockMeta) { if (!air) { - aY = MathUtils.clamp(aY,1, aWorld.getActualHeight()); + aY = MathUtils.clamp(aY, 1, aWorld.getActualHeight()); } Block tBlock = aWorld.getBlock(aX, aY, aZ); @@ -107,7 +108,9 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { @SuppressWarnings("unchecked") public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { for (Werkstoff tMaterial : Werkstoff.werkstoffHashSet) { - if ((tMaterial != null) && tMaterial.hasItemType(OrePrefixes.ore) && ((tMaterial.getGenerationFeatures().blacklist & 0x8) == 0)) { + if ((tMaterial != null) + && tMaterial.hasItemType(OrePrefixes.ore) + && ((tMaterial.getGenerationFeatures().blacklist & 0x8) == 0)) { aList.add(new ItemStack(aItem, 1, tMaterial.getmID())); } } @@ -118,10 +121,8 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { for (int z = -1; z <= 1; z++) { - if (x == 0 && y == 0 && z == 0) - continue; - if (aWorld.getBlock(aX+x,aY+y,aZ+z).isAir(aWorld,aX+x,aY+y,aZ+z)) - return true; + if (x == 0 && y == 0 && z == 0) continue; + if (aWorld.getBlock(aX + x, aY + y, aZ + z).isAir(aWorld, aX + x, aY + y, aZ + z)) return true; } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java index d95de69f0a..98507565a5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java @@ -25,25 +25,25 @@ package com.github.bartimaeusnek.bartworks.system.material; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; +import java.util.Arrays; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import java.util.Arrays; - public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { public BW_MetaGenerated_SmallOres(Material p_i45386_1_, Class tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); - this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.blocktype." + OrePrefixes.oreSmall, OrePrefixes.oreSmall.mLocalizedMaterialPre+"%material" + OrePrefixes.oreSmall.mLocalizedMaterialPost); + this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization( + "bw.blocktype." + OrePrefixes.oreSmall, + OrePrefixes.oreSmall.mLocalizedMaterialPre + "%material" + OrePrefixes.oreSmall.mLocalizedMaterialPost); } @Override protected void doRegistrationStuff(Werkstoff w) { if (w != null) { - if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) - return; + if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) return; GT_ModHandler.addValuableOre(this, w.getmID(), 1); } } @@ -53,7 +53,8 @@ public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { return "bw.blockores.02"; } - public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, int[] aBlockMeta) { + public static boolean setOreBlock( + World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, int[] aBlockMeta) { if (!air) { aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); } @@ -81,5 +82,4 @@ public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { return true; } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java index 4dd28d9af7..d2ce3fe266 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java @@ -40,12 +40,16 @@ public class BW_MetaGenerated_WerkstoffBlock_TE extends BW_MetaGenerated_Block_T if ((aMaterial != null)) { TextureSet set = aMaterial.getTexSet(); ITexture aIconSet = TextureFactory.of( - set.mTextures[PrefixTextureLinker.blockTexMap.getOrDefault(set, OrePrefixes.block.mTextureIndex)], aMaterial.getRGBA() - ); - return new ITexture[]{TextureFactory.of(Blocks.iron_block), aIconSet}; + set.mTextures[ + PrefixTextureLinker.blockTexMap.getOrDefault(set, OrePrefixes.block.mTextureIndex)], + aMaterial.getRGBA()); + return new ITexture[] {TextureFactory.of(Blocks.iron_block), aIconSet}; } } - return new ITexture[]{TextureFactory.of(Blocks.iron_block), TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; + return new ITexture[] { + TextureFactory.of(Blocks.iron_block), + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) + }; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java index d27d50941e..44f3a90f2b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; +import java.util.List; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; @@ -33,13 +34,14 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; -import java.util.List; - public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks { - public BW_MetaGenerated_WerkstoffBlocks(Material p_i45386_1_, Class tileEntity, String blockName) { + public BW_MetaGenerated_WerkstoffBlocks( + Material p_i45386_1_, Class tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); - this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.blocktype." + OrePrefixes.block, OrePrefixes.block.mLocalizedMaterialPre + "%material" + OrePrefixes.block.mLocalizedMaterialPost); + this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization( + "bw.blocktype." + OrePrefixes.block, + OrePrefixes.block.mLocalizedMaterialPre + "%material" + OrePrefixes.block.mLocalizedMaterialPost); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java index fd3a74b470..5c64a2075d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material; +import static gregtech.api.enums.GT_Values.W; + import gregtech.api.interfaces.IItemContainer; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -30,12 +32,15 @@ import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.GT_Values.W; - public enum BW_NonMeta_MaterialItems implements IItemContainer { - Depleted_Tiberium_1,Depleted_Tiberium_2,Depleted_Tiberium_4, - TiberiumCell_1,TiberiumCell_2,TiberiumCell_4, - TheCoreCell,Depleted_TheCoreCell; + Depleted_Tiberium_1, + Depleted_Tiberium_2, + Depleted_Tiberium_4, + TiberiumCell_1, + TiberiumCell_2, + TiberiumCell_4, + TheCoreCell, + Depleted_TheCoreCell; private ItemStack mStack; private boolean mHasNotBeenSet = true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java index 98fcfb7878..8f34416122 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java @@ -26,8 +26,7 @@ public class BW_CircuitsLoader { private static final BW_Meta_Items NEW_CIRCUITS = new BW_Meta_Items(); - private BW_CircuitsLoader() { - } + private BW_CircuitsLoader() {} public static BW_Meta_Items getNewCircuits() { return BW_CircuitsLoader.NEW_CIRCUITS; @@ -44,6 +43,6 @@ public class BW_CircuitsLoader { BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(7, 11, "Ultimate Magneto Resonatic Circuit"); BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(8, 12, "Superconductor Magneto Resonatic Circuit"); BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(9, 13, "Infinite Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(10,14, "Bio Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(10, 14, "Bio Magneto Resonatic Circuit"); } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index 1747471adf..caaa55b252 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -37,6 +37,7 @@ import gregtech.api.interfaces.IItemContainer; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.objects.ItemData; import gregtech.api.util.*; +import java.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -46,9 +47,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IIcon; import net.minecraftforge.fluids.FluidStack; -import java.util.*; - - public class BW_Meta_Items { public static BW_Meta_Items.BW_GT_MetaGenCircuits getNEWCIRCUITS() { @@ -57,66 +55,117 @@ public class BW_Meta_Items { private static final BW_Meta_Items.BW_GT_MetaGenCircuits NEWCIRCUITS = new BW_Meta_Items.BW_GT_MetaGenCircuits(); - static{ - BW_Meta_Items.NEWCIRCUITS.addItem(0,"Circuit Imprint","",SubTag.NO_UNIFICATION,SubTag.NO_RECYCLING); - BW_Meta_Items.NEWCIRCUITS.addItem(1,"Sliced Circuit","",SubTag.NO_UNIFICATION,SubTag.NO_RECYCLING); - BW_Meta_Items.NEWCIRCUITS.addItem(2,"Raw Imprint supporting Board","A Raw Board needed for Circuit Imprints"); - BW_Meta_Items.NEWCIRCUITS.addItem(3,"Imprint supporting Board","A Board needed for Circuit Imprints"); - GT_Values.RA.addFormingPressRecipe(WerkstoffLoader.MagnetoResonaticDust.get(OrePrefixes.dust,1),WerkstoffLoader.ArInGaPhoBiBoTe.get(OrePrefixes.dust,4),BW_Meta_Items.NEWCIRCUITS.getStack(2),300,480); - GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{BW_Meta_Items.NEWCIRCUITS.getStack(2)},new ItemStack[]{BW_Meta_Items.NEWCIRCUITS.getStack(3)},null,new int[]{7500},new FluidStack[]{Materials.SolderingAlloy.getMolten(576)},null,300, BW_Util.getMachineVoltageFromTier(4), BW_Util.CLEANROOM)); + static { + BW_Meta_Items.NEWCIRCUITS.addItem(0, "Circuit Imprint", "", SubTag.NO_UNIFICATION, SubTag.NO_RECYCLING); + BW_Meta_Items.NEWCIRCUITS.addItem(1, "Sliced Circuit", "", SubTag.NO_UNIFICATION, SubTag.NO_RECYCLING); + BW_Meta_Items.NEWCIRCUITS.addItem(2, "Raw Imprint supporting Board", "A Raw Board needed for Circuit Imprints"); + BW_Meta_Items.NEWCIRCUITS.addItem(3, "Imprint supporting Board", "A Board needed for Circuit Imprints"); + GT_Values.RA.addFormingPressRecipe( + WerkstoffLoader.MagnetoResonaticDust.get(OrePrefixes.dust, 1), + WerkstoffLoader.ArInGaPhoBiBoTe.get(OrePrefixes.dust, 4), + BW_Meta_Items.NEWCIRCUITS.getStack(2), + 300, + 480); + GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.add(new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] {BW_Meta_Items.NEWCIRCUITS.getStack(2)}, + new ItemStack[] {BW_Meta_Items.NEWCIRCUITS.getStack(3)}, + null, + new int[] {7500}, + new FluidStack[] {Materials.SolderingAlloy.getMolten(576)}, + null, + 300, + BW_Util.getMachineVoltageFromTier(4), + BW_Util.CLEANROOM)); } @SuppressWarnings("deprecation") - public void addNewCircuit(int aTier, int aID, String aName){ + public void addNewCircuit(int aTier, int aID, String aName) { String additionalOreDictData = ""; String tooltip = ""; String aOreDictPrefix = OrePrefixes.circuit.toString(); - switch (aTier){ - case 0: additionalOreDictData = Materials.Primitive.toString(); tooltip = Materials.Primitive.getToolTip(); break; - case 1: additionalOreDictData = Materials.Basic.toString(); tooltip = Materials.Basic.getToolTip(); break; - case 2: additionalOreDictData = Materials.Good.toString(); tooltip = Materials.Good.getToolTip(); break; - case 3: additionalOreDictData = Materials.Advanced.toString(); tooltip = Materials.Advanced.getToolTip(); break; - case 4: additionalOreDictData = Materials.Data.toString(); tooltip = Materials.Data.getToolTip(); break; - case 5: additionalOreDictData = Materials.Elite.toString(); tooltip = Materials.Elite.getToolTip(); break; - case 6: additionalOreDictData = Materials.Master.toString(); tooltip = Materials.Master.getToolTip(); break; - case 7: additionalOreDictData = Materials.Ultimate.toString(); tooltip = Materials.Ultimate.getToolTip(); break; - case 8: additionalOreDictData = Materials.Superconductor.toString(); tooltip = Materials.Superconductor.getToolTip(); break; - case 9: additionalOreDictData = "Infinite"; tooltip = "An Infinite Circuit"; break; - case 10: additionalOreDictData = "Bio"; tooltip = "A Bio Circuit"; break; + switch (aTier) { + case 0: + additionalOreDictData = Materials.Primitive.toString(); + tooltip = Materials.Primitive.getToolTip(); + break; + case 1: + additionalOreDictData = Materials.Basic.toString(); + tooltip = Materials.Basic.getToolTip(); + break; + case 2: + additionalOreDictData = Materials.Good.toString(); + tooltip = Materials.Good.getToolTip(); + break; + case 3: + additionalOreDictData = Materials.Advanced.toString(); + tooltip = Materials.Advanced.getToolTip(); + break; + case 4: + additionalOreDictData = Materials.Data.toString(); + tooltip = Materials.Data.getToolTip(); + break; + case 5: + additionalOreDictData = Materials.Elite.toString(); + tooltip = Materials.Elite.getToolTip(); + break; + case 6: + additionalOreDictData = Materials.Master.toString(); + tooltip = Materials.Master.getToolTip(); + break; + case 7: + additionalOreDictData = Materials.Ultimate.toString(); + tooltip = Materials.Ultimate.getToolTip(); + break; + case 8: + additionalOreDictData = Materials.Superconductor.toString(); + tooltip = Materials.Superconductor.getToolTip(); + break; + case 9: + additionalOreDictData = "Infinite"; + tooltip = "An Infinite Circuit"; + break; + case 10: + additionalOreDictData = "Bio"; + tooltip = "A Bio Circuit"; + break; } - ItemStack tStack = BW_Meta_Items.NEWCIRCUITS.addCircuit(aID,aName,tooltip,aTier); + ItemStack tStack = BW_Meta_Items.NEWCIRCUITS.addCircuit(aID, aName, tooltip, aTier); - GT_OreDictUnificator.registerOre((aOreDictPrefix + additionalOreDictData).replaceAll(" ",""), tStack); + GT_OreDictUnificator.registerOre((aOreDictPrefix + additionalOreDictData).replaceAll(" ", ""), tStack); } - public static class BW_GT_MetaGenCircuits extends BW_Meta_Items.BW_GT_MetaGen_Item_Hook{ - + public static class BW_GT_MetaGenCircuits extends BW_Meta_Items.BW_GT_MetaGen_Item_Hook { public BW_GT_MetaGenCircuits() { super("bwMetaGeneratedItem0"); } - public final ItemStack addCircuit(int aID, String aEnglish, String aToolTip, int tier){ - CircuitImprintLoader.bwCircuitTagMap.put(new CircuitData(BW_Util.getMachineVoltageFromTier(Math.min(1,(tier-2))),tier > 2 ? BW_Util.CLEANROOM : 0,(byte)tier), new ItemStack(BW_Meta_Items.NEWCIRCUITS,1,aID)); - return this.addItem(aID, aEnglish, aToolTip,SubTag.NO_UNIFICATION); + public final ItemStack addCircuit(int aID, String aEnglish, String aToolTip, int tier) { + CircuitImprintLoader.bwCircuitTagMap.put( + new CircuitData( + BW_Util.getMachineVoltageFromTier(Math.min(1, (tier - 2))), + tier > 2 ? BW_Util.CLEANROOM : 0, + (byte) tier), + new ItemStack(BW_Meta_Items.NEWCIRCUITS, 1, aID)); + return this.addItem(aID, aEnglish, aToolTip, SubTag.NO_UNIFICATION); } - public final ItemStack getStack(int... meta_amount){ + public final ItemStack getStack(int... meta_amount) { ItemStack ret = new ItemStack(this); - if (meta_amount.length <= 0 || meta_amount.length > 2) - return ret; + if (meta_amount.length <= 0 || meta_amount.length > 2) return ret; if (meta_amount.length == 1) { ret.setItemDamage(meta_amount[0]); return ret; } ret.setItemDamage(meta_amount[0]); - ret.stackSize=meta_amount[1]; + ret.stackSize = meta_amount[1]; return ret; } - public final ItemStack getStackWithNBT(NBTTagCompound tag, int... meta_amount){ + public final ItemStack getStackWithNBT(NBTTagCompound tag, int... meta_amount) { ItemStack ret = this.getStack(meta_amount); ret.setTagCompound(tag); return ret; @@ -126,8 +175,8 @@ public class BW_Meta_Items { @SuppressWarnings("unchecked") public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { if (aCreativeTab == this.getCreativeTab()) - for (NBTTagCompound tag : CircuitImprintLoader.recipeTagMap.keySet()){ - ItemStack stack = new ItemStack(BW_Meta_Items.NEWCIRCUITS,1,0); + for (NBTTagCompound tag : CircuitImprintLoader.recipeTagMap.keySet()) { + ItemStack stack = new ItemStack(BW_Meta_Items.NEWCIRCUITS, 1, 0); stack.setTagCompound(tag); aList.add(stack); } @@ -137,35 +186,53 @@ public class BW_Meta_Items { @SideOnly(Side.CLIENT) public final void registerIcons(IIconRegister aIconRegister) { - for(short i = 0; i < CircuitImprintLoader.reverseIDs; ++i) { + for (short i = 0; i < CircuitImprintLoader.reverseIDs; ++i) { if (this.mEnabledItems.get(i)) { - BW_Util.set2DCoordTo1DArray(i,0,2,aIconRegister.registerIcon("gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + "/" + i)),this.mIconList); + BW_Util.set2DCoordTo1DArray( + i, + 0, + 2, + aIconRegister.registerIcon( + "gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + "/" + i)), + this.mIconList); } } for (short i = CircuitImprintLoader.reverseIDs; i < Short.MAX_VALUE; i++) { if (this.mEnabledItems.get(i)) { - BW_Util.set2DCoordTo1DArray(i,0,2, Objects.requireNonNull(CircuitImprintLoader.circuitIIconRefs.get(i)).get(1).getIconIndex(),this.mIconList); - BW_Util.set2DCoordTo1DArray(i,1,2,aIconRegister.registerIcon(MainMod.MOD_ID+":WrapOverlay"),this.mIconList); - //aIconRegister.registerIcon("gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + "/" + i)); + BW_Util.set2DCoordTo1DArray( + i, + 0, + 2, + Objects.requireNonNull(CircuitImprintLoader.circuitIIconRefs.get(i)) + .get(1) + .getIconIndex(), + this.mIconList); + BW_Util.set2DCoordTo1DArray( + i, 1, 2, aIconRegister.registerIcon(MainMod.MOD_ID + ":WrapOverlay"), this.mIconList); + // aIconRegister.registerIcon("gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + + // "/" + i)); } } - } @Override @SuppressWarnings("unchecked") protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { - if (aStack.getItemDamage() == 0 ) - if (aStack.getTagCompound() != null && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) - aList.add("An Imprint for: "+GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); - else - aList.add("An Imprint for a Circuit"); - else if (aStack.getItemDamage() == 1 ) - if (aStack.getTagCompound() != null && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) - aList.add("A Sliced "+GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); - else - aList.add("A Sliced Circuit"); + if (aStack.getItemDamage() == 0) + if (aStack.getTagCompound() != null + && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) + aList.add("An Imprint for: " + + GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName( + CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); + else aList.add("An Imprint for a Circuit"); + else if (aStack.getItemDamage() == 1) + if (aStack.getTagCompound() != null + && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) + aList.add("A Sliced " + + GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName( + CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); + else aList.add("A Sliced Circuit"); super.addAdditionalToolTips(aList, aStack, aPlayer); } } @@ -174,8 +241,9 @@ public class BW_Meta_Items { public static final HashSet sInstances = new HashSet<>(); public final IIcon[] mIconList; public final BitSet mEnabledItems; + { - this.mIconList = new IIcon[Short.MAX_VALUE*2]; + this.mIconList = new IIcon[Short.MAX_VALUE * 2]; this.mEnabledItems = new BitSet(Short.MAX_VALUE); } @@ -203,70 +271,69 @@ public class BW_Meta_Items { return null; } - @SuppressWarnings({"unchecked","rawtypes"}) + @SuppressWarnings({"unchecked", "rawtypes"}) public final ItemStack addItem(int aID, String aEnglish, String aToolTip, Object... aRandomData) { if (aToolTip == null) { aToolTip = ""; } - ItemStack rStack = new ItemStack(this, 1, aID); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".name", aEnglish); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".tooltip", aToolTip); - List tAspects = new ArrayList<>(); - this.mEnabledItems.set(aID); - Object[] var7 = aRandomData; - int var8 = aRandomData.length; - - int var9; - Object tRandomData; - for(var9 = 0; var9 < var8; ++var9) { - tRandomData = var7[var9]; - if (tRandomData instanceof SubTag) { - if (tRandomData == SubTag.NO_UNIFICATION) { - GT_OreDictUnificator.addToBlacklist(rStack); - } + ItemStack rStack = new ItemStack(this, 1, aID); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".name", aEnglish); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".tooltip", aToolTip); + List tAspects = new ArrayList<>(); + this.mEnabledItems.set(aID); + Object[] var7 = aRandomData; + int var8 = aRandomData.length; + + int var9; + Object tRandomData; + for (var9 = 0; var9 < var8; ++var9) { + tRandomData = var7[var9]; + if (tRandomData instanceof SubTag) { + if (tRandomData == SubTag.NO_UNIFICATION) { + GT_OreDictUnificator.addToBlacklist(rStack); } } + } - var7 = aRandomData; - var8 = aRandomData.length; + var7 = aRandomData; + var8 = aRandomData.length; - for(var9 = 0; var9 < var8; ++var9) { - tRandomData = var7[var9]; - if (tRandomData != null) { - boolean tUseOreDict = true; + for (var9 = 0; var9 < var8; ++var9) { + tRandomData = var7[var9]; + if (tRandomData != null) { + boolean tUseOreDict = true; - if (tRandomData instanceof IItemBehaviour) { - this.addItemBehavior(aID, - (IItemBehaviour) tRandomData); - tUseOreDict = false; - } + if (tRandomData instanceof IItemBehaviour) { + this.addItemBehavior(aID, (IItemBehaviour) tRandomData); + tUseOreDict = false; + } - if (tRandomData instanceof IItemContainer) { - ((IItemContainer)tRandomData).set(rStack); - tUseOreDict = false; - } + if (tRandomData instanceof IItemContainer) { + ((IItemContainer) tRandomData).set(rStack); + tUseOreDict = false; + } - if (!(tRandomData instanceof SubTag)) { - if (tRandomData instanceof TC_Aspects.TC_AspectStack) { - ((TC_Aspects.TC_AspectStack)tRandomData).addToAspectList(tAspects); - } else if (tRandomData instanceof ItemData) { - if (GT_Utility.isStringValid(tRandomData)) { - GT_OreDictUnificator.registerOre(tRandomData, rStack); - } else { - GT_OreDictUnificator.addItemData(rStack, (ItemData)tRandomData); - } - } else if (tUseOreDict) { + if (!(tRandomData instanceof SubTag)) { + if (tRandomData instanceof TC_Aspects.TC_AspectStack) { + ((TC_Aspects.TC_AspectStack) tRandomData).addToAspectList(tAspects); + } else if (tRandomData instanceof ItemData) { + if (GT_Utility.isStringValid(tRandomData)) { GT_OreDictUnificator.registerOre(tRandomData, rStack); + } else { + GT_OreDictUnificator.addItemData(rStack, (ItemData) tRandomData); } + } else if (tUseOreDict) { + GT_OreDictUnificator.registerOre(tRandomData, rStack); } } } + } - if (GregTech_API.sThaumcraftCompat != null) { - GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false); - } + if (GregTech_API.sThaumcraftCompat != null) { + GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false); + } - return rStack; + return rStack; } @SideOnly(Side.CLIENT) @@ -274,14 +341,13 @@ public class BW_Meta_Items { public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { int j = this.mEnabledItems.length(); - for(int i = 0; i < j; ++i) { + for (int i = 0; i < j; ++i) { if (this.mEnabledItems.get(i)) { ItemStack tStack = new ItemStack(this, 1, i); this.isItemStackUsable(tStack); aList.add(tStack); } } - } @Override @@ -298,13 +364,13 @@ public class BW_Meta_Items { @Override public IIcon getIconFromDamage(int i) { - if (this.mEnabledItems.get(i)) - return (IIcon) BW_Util.get2DCoordFrom1DArray(i,0,2,this.mIconList); + if (this.mEnabledItems.get(i)) return (IIcon) BW_Util.get2DCoordFrom1DArray(i, 0, 2, this.mIconList); return null; } @Override - public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { + public IIcon getIcon( + ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { return this.getIconFromDamage(stack.getItemDamage()); } @@ -313,4 +379,4 @@ public class BW_Meta_Items { return this.getIconFromDamage(stack.getItemDamage()); } } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java index 33658ef8e9..19bf5bb662 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java @@ -23,7 +23,6 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; import com.github.bartimaeusnek.bartworks.util.MurmurHash3; - import java.nio.ByteBuffer; public class CircuitData { @@ -50,7 +49,15 @@ public class CircuitData { @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(13).put(this.aTier).putInt(this.aSpecial).putLong(this.aVoltage).array(),0,13,31); + return MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(13) + .put(this.aTier) + .putInt(this.aSpecial) + .putLong(this.aVoltage) + .array(), + 0, + 13, + 31); } public long getaVoltage() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index f3fc7ea816..1176712cc7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -38,6 +38,7 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.HashSet; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; @@ -48,65 +49,70 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; -import java.util.HashSet; - public class CircuitImprintLoader { - public static short reverseIDs = Short.MAX_VALUE-1; + public static short reverseIDs = Short.MAX_VALUE - 1; - public static final ArrayListMultimap recipeTagMap = ArrayListMultimap.create(); + public static final ArrayListMultimap recipeTagMap = ArrayListMultimap.create(); public static final HashBiMap circuitIIconRefs = HashBiMap.create(20); public static final HashSet blacklistSet = new HashSet<>(); - static final HashBiMap bwCircuitTagMap = HashBiMap.create(20); + static final HashBiMap bwCircuitTagMap = HashBiMap.create(20); private static final HashSet recipeWorldCache = new HashSet<>(); private static final HashSet gtrecipeWorldCache = new HashSet<>(); private static final HashSet ORIGINAL_CAL_RECIPES = new HashSet<>(); private static final HashSet MODIFIED_CAL_RECIPES = new HashSet<>(); - @SuppressWarnings({"unused","RedundantSuppression"}) + @SuppressWarnings({"unused", "RedundantSuppression"}) public static void run() { HashSet toRem = new HashSet<>(); HashSet toAdd = new HashSet<>(); deleteCALRecipesAndTags(); - rebuildCircuitAssemblerMap(toRem,toAdd); - exchangeRecipesInList(toRem,toAdd); + rebuildCircuitAssemblerMap(toRem, toAdd); + exchangeRecipesInList(toRem, toAdd); makeCircuitImprintRecipes(); toRem = null; toAdd = null; } - private static void reAddOriginalRecipes(){ + private static void reAddOriginalRecipes() { GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(MODIFIED_CAL_RECIPES); GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.addAll(ORIGINAL_CAL_RECIPES); ORIGINAL_CAL_RECIPES.clear(); MODIFIED_CAL_RECIPES.clear(); } - private static void rebuildCircuitAssemblerMap(HashSet toRem,HashSet toAdd) { + private static void rebuildCircuitAssemblerMap(HashSet toRem, HashSet toAdd) { reAddOriginalRecipes(); - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.forEach(e -> CircuitImprintLoader.handleCircuitRecipeRebuilding(e, toRem, toAdd)); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.forEach( + e -> CircuitImprintLoader.handleCircuitRecipeRebuilding(e, toRem, toAdd)); } - private static void handleCircuitRecipeRebuilding(GT_Recipe circuitRecipe, HashSet toRem, HashSet toAdd) { + private static void handleCircuitRecipeRebuilding( + GT_Recipe circuitRecipe, HashSet toRem, HashSet toAdd) { ItemStack[] outputs = circuitRecipe.mOutputs; boolean isOrePass = isCircuitOreDict(outputs[0]); String unlocalizedName = outputs[0].getUnlocalizedName(); if (isOrePass || unlocalizedName.contains("Circuit") || unlocalizedName.contains("circuit")) { - CircuitImprintLoader.recipeTagMap.put(CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); + CircuitImprintLoader.recipeTagMap.put( + CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); - Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null ? FluidRegistry.getFluid("molten.indalloy140") : FluidRegistry.getFluid("molten.solderingalloy"); + Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null + ? FluidRegistry.getFluid("molten.indalloy140") + : FluidRegistry.getFluid("molten.solderingalloy"); - if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))||circuitRecipe.mFluidInputs[0].isFluidEqual(new FluidStack(solderIndalloy, 0))) { + if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0)) + || circuitRecipe.mFluidInputs[0].isFluidEqual(new FluidStack(solderIndalloy, 0))) { GT_Recipe newRecipe = CircuitImprintLoader.reBuildRecipe(circuitRecipe); if (newRecipe != null) - BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(newRecipe); - addCutoffRecipeToSets(toRem,toAdd,circuitRecipe); + BWRecipes.instance + .getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE) + .addRecipe(newRecipe); + addCutoffRecipeToSets(toRem, toAdd, circuitRecipe); } else { - if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) - toRem.add(circuitRecipe); + if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) toRem.add(circuitRecipe); } } } @@ -115,15 +121,14 @@ public class CircuitImprintLoader { private static String getTypeFromOreDict(ItemStack[] outputs) { int[] oreIDS = OreDictionary.getOreIDs(outputs[0]); - if (oreIDS.length < 1) - return ""; + if (oreIDS.length < 1) return ""; return OreDictionary.getOreName(oreIDS[0]); } private static boolean isCircuitOreDict(ItemStack item) { return BW_Util.isTieredCircuit(item) - || BW_Util.getOreNames(item).stream().anyMatch(s -> s.equals("circuitPrimitiveArray")); + || BW_Util.getOreNames(item).stream().anyMatch(s -> s.equals("circuitPrimitiveArray")); } private static void exchangeRecipesInList(HashSet toRem, HashSet toAdd) { @@ -133,7 +138,8 @@ public class CircuitImprintLoader { MODIFIED_CAL_RECIPES.addAll(toAdd); } - private static void addCutoffRecipeToSets(HashSet toRem, HashSet toAdd, GT_Recipe circuitRecipe) { + private static void addCutoffRecipeToSets( + HashSet toRem, HashSet toAdd, GT_Recipe circuitRecipe) { if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) { toRem.add(circuitRecipe); toAdd.add(CircuitImprintLoader.makeMoreExpensive(circuitRecipe)); @@ -143,7 +149,7 @@ public class CircuitImprintLoader { @SuppressWarnings("deprecation") public static GT_Recipe makeMoreExpensive(GT_Recipe original) { GT_Recipe newRecipe = original.copy(); - for (ItemStack is : newRecipe.mInputs){ + for (ItemStack is : newRecipe.mInputs) { if (!BW_Util.isTieredCircuit(is)) { is.stackSize = Math.min(is.stackSize * 6, 64); if (is.stackSize > is.getItem().getItemStackLimit() || is.stackSize > is.getMaxStackSize()) @@ -161,8 +167,8 @@ public class CircuitImprintLoader { for (int i = 0; i < 6; i++) { try { - replaceCircuits(inversed,original,in,i); - replaceComponents(in,original,i); + replaceCircuits(inversed, original, in, i); + replaceComponents(in, original, i); } catch (ArrayIndexOutOfBoundsException e) { break; } catch (NullPointerException e) { @@ -174,40 +180,66 @@ public class CircuitImprintLoader { return null; } - return new BWRecipes.DynamicGTRecipe(false, in, new ItemStack[]{getOutputMultiplied(original)}, BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]), 0, 0), null, original.mFluidInputs, null, original.mDuration * 12, original.mEUt, 0); + return new BWRecipes.DynamicGTRecipe( + false, + in, + new ItemStack[] {getOutputMultiplied(original)}, + BW_Meta_Items.getNEWCIRCUITS() + .getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]), 0, 0), + null, + original.mFluidInputs, + null, + original.mDuration * 12, + original.mEUt, + 0); } - private static ItemStack getOutputMultiplied(GT_Recipe original){ + private static ItemStack getOutputMultiplied(GT_Recipe original) { ItemStack out = original.copy().getOutput(0); out.stackSize *= 16; return out; } - private static void replaceCircuits(BiMap inversed, GT_Recipe original, ItemStack[] in, int index){ + private static void replaceCircuits( + BiMap inversed, GT_Recipe original, ItemStack[] in, int index) { for (ItemList il : inversed.keySet()) { if (GT_Utility.areStacksEqual(il.get(1), original.mInputs[index])) { - in[index] = BW_Meta_Items.getNEWCIRCUITS().getStack(inversed.get(il), original.mInputs[index].stackSize); + in[index] = + BW_Meta_Items.getNEWCIRCUITS().getStack(inversed.get(il), original.mInputs[index].stackSize); } } } @SuppressWarnings("deprecation") - private static void replaceComponents(ItemStack[] in, GT_Recipe original, int index) throws ArrayIndexOutOfBoundsException { + private static void replaceComponents(ItemStack[] in, GT_Recipe original, int index) + throws ArrayIndexOutOfBoundsException { if (original.mInputs[index] != null && in[index] == null) { - //big wires - if (BW_Util.checkStackAndPrefix(original.mInputs[index]) && GT_OreDictUnificator.getAssociation(original.mInputs[index]).mPrefix == OrePrefixes.wireGt01) { - in[index] = GT_OreDictUnificator.get(OrePrefixes.wireGt16, GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, original.mInputs[index].stackSize); - //fine wires - } else if (BW_Util.checkStackAndPrefix(original.mInputs[index]) && GT_OreDictUnificator.getAssociation(original.mInputs[index]).mPrefix == OrePrefixes.wireFine) { - in[index] = GT_OreDictUnificator.get(OrePrefixes.wireGt04, GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, original.mInputs[index].stackSize); + // big wires + if (BW_Util.checkStackAndPrefix(original.mInputs[index]) + && GT_OreDictUnificator.getAssociation(original.mInputs[index]).mPrefix == OrePrefixes.wireGt01) { + in[index] = GT_OreDictUnificator.get( + OrePrefixes.wireGt16, + GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, + original.mInputs[index].stackSize); + // fine wires + } else if (BW_Util.checkStackAndPrefix(original.mInputs[index]) + && GT_OreDictUnificator.getAssociation(original.mInputs[index]).mPrefix == OrePrefixes.wireFine) { + in[index] = GT_OreDictUnificator.get( + OrePrefixes.wireGt04, + GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, + original.mInputs[index].stackSize); if (in[index] == null) { - in[index] = GT_OreDictUnificator.get(OrePrefixes.wireFine, GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, original.mInputs[index].stackSize * 16); + in[index] = GT_OreDictUnificator.get( + OrePrefixes.wireFine, + GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, + original.mInputs[index].stackSize * 16); } - //other components + // other components } else { in[index] = original.mInputs[index].copy(); in[index].stackSize *= 16; - if (in[index].stackSize > in[index].getItem().getItemStackLimit() || in[index].stackSize > in[index].getMaxStackSize()) + if (in[index].stackSize > in[index].getItem().getItemStackLimit() + || in[index].stackSize > in[index].getMaxStackSize()) in[index].stackSize = in[index].getMaxStackSize(); } } @@ -222,10 +254,9 @@ public class CircuitImprintLoader { } private static boolean checkForBlacklistedComponents(ItemStack[] itemStacks) { - for (ItemStack is: itemStacks){ - for (ItemStack is2 : CircuitImprintLoader.blacklistSet){ - if (GT_Utility.areStacksEqual(is,is2)) - return true; + for (ItemStack is : itemStacks) { + for (ItemStack is2 : CircuitImprintLoader.blacklistSet) { + if (GT_Utility.areStacksEqual(is, is2)) return true; } } return false; @@ -235,15 +266,13 @@ public class CircuitImprintLoader { recipeWorldCache.forEach(CraftingManager.getInstance().getRecipeList()::remove); BWCoreStaticReplacementMethodes.clearRecentlyUsedRecipes(); gtrecipeWorldCache.forEach(GT_Recipe.GT_Recipe_Map.sSlicerRecipes.mRecipeList::remove); - recipeWorldCache.forEach( r -> - { - try { - BW_Util.getGTBufferedRecipeList().remove(r); - } catch (Exception e) { - e.printStackTrace(); - } - } - ); + recipeWorldCache.forEach(r -> { + try { + BW_Util.getGTBufferedRecipeList().remove(r); + } catch (Exception e) { + e.printStackTrace(); + } + }); recipeWorldCache.clear(); gtrecipeWorldCache.clear(); } @@ -256,37 +285,60 @@ public class CircuitImprintLoader { eut = Math.min(eut, recipe.mEUt); } - eut = Math.min(eut, BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName((OreDictionary.getOreIDs(stack) != null && OreDictionary.getOreIDs(stack).length > 0) ? OreDictionary.getOreIDs(stack)[0] : -1)))); - GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300,eut, BW_Util.CLEANROOM); + eut = Math.min( + eut, + BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName( + (OreDictionary.getOreIDs(stack) != null && OreDictionary.getOreIDs(stack).length > 0) + ? OreDictionary.getOreIDs(stack)[0] + : -1)))); + GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe( + true, + new ItemStack[] {stack, ItemList.Shape_Slicer_Flat.get(0)}, + new ItemStack[] {BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag, 1, 1)}, + null, + null, + null, + null, + 300, + eut, + BW_Util.CLEANROOM); gtrecipeWorldCache.add(slicingRecipe); GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); } private static void makeAndAddCraftingRecipes(NBTTagCompound tag) { - ItemStack circuit = BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1); + ItemStack circuit = BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag, 0, 1); Object[] imprintRecipe = { - " X ", - "GPG", - " X ", - 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1), - 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1), - 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3) + " X ", + "GPG", + " X ", + 'P', + BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag, 1, 1), + 'G', + WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite, 1), + 'X', + BW_Meta_Items.getNEWCIRCUITS().getStack(3) }; - IRecipe bwrecipe = new BWRecipes.BWNBTDependantCraftingRecipe(circuit,imprintRecipe); - ShapedOreRecipe gtrecipe = BW_Util.createGTCraftingRecipe(circuit, GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED, imprintRecipe); + IRecipe bwrecipe = new BWRecipes.BWNBTDependantCraftingRecipe(circuit, imprintRecipe); + ShapedOreRecipe gtrecipe = BW_Util.createGTCraftingRecipe( + circuit, + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.KEEPNBT + | GT_ModHandler.RecipeBits.BUFFERED, + imprintRecipe); - //Adds the actual recipe + // Adds the actual recipe recipeWorldCache.add(bwrecipe); GameRegistry.addRecipe(bwrecipe); - //Adds the NEI visual recipe + // Adds the NEI visual recipe recipeWorldCache.add(gtrecipe); GameRegistry.addRecipe(gtrecipe); } public static NBTTagCompound getTagFromStack(ItemStack stack) { if (GT_Utility.isStackValid(stack)) - return BW_Util.setStackSize(stack.copy(),1).writeToNBT(new NBTTagCompound()); + return BW_Util.setStackSize(stack.copy(), 1).writeToNBT(new NBTTagCompound()); return new NBTTagCompound(); } @@ -295,8 +347,10 @@ public class CircuitImprintLoader { } private static void deleteCALRecipesAndTags() { - BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).mRecipeList.clear(); - recipeTagMap.clear(); + BWRecipes.instance + .getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE) + .mRecipeList + .clear(); + recipeTagMap.clear(); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index c0613200df..fbec204c80 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; +import static gregtech.api.enums.ItemList.*; + import com.github.bartimaeusnek.bartworks.client.renderer.BW_GT_ItemRenderer; import cpw.mods.fml.common.FMLCommonHandler; import gregtech.api.enums.GT_Values; @@ -29,68 +31,65 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; - import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; - -import static gregtech.api.enums.ItemList.*; +import net.minecraft.item.ItemStack; public class CircuitPartLoader implements Runnable { @Override public void run() { CircuitPartLoader.makeCircuitParts(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) - new BW_GT_ItemRenderer(); + if (FMLCommonHandler.instance().getEffectiveSide().isClient()) new BW_GT_ItemRenderer(); } public static void makeCircuitParts() { ItemList[] itemLists = values(); for (ItemList single : itemLists) { - if (!single.hasBeenSet()) - continue; - if ( - single.toString().contains("Wafer") || - single.toString().contains("Circuit_Silicon_Ingot") || - single.toString().contains("Raw") || - single.toString().contains("raw") || - single.toString().contains("Glass_Tube") || - single == Circuit_Parts_GlassFiber || - single == Circuit_Parts_Advanced || - single == Circuit_Parts_Wiring_Advanced || - single == Circuit_Parts_Wiring_Elite || - single == Circuit_Parts_Wiring_Basic || - single == Circuit_Integrated || - single == Circuit_Parts_PetriDish || - single == Circuit_Parts_Vacuum_Tube || - single == Circuit_Integrated_Good || - single == Circuit_Parts_Capacitor || - single == Circuit_Parts_Diode || - single == Circuit_Parts_Resistor || - single == Circuit_Parts_Transistor + if (!single.hasBeenSet()) continue; + if (single.toString().contains("Wafer") + || single.toString().contains("Circuit_Silicon_Ingot") + || single.toString().contains("Raw") + || single.toString().contains("raw") + || single.toString().contains("Glass_Tube") + || single == Circuit_Parts_GlassFiber + || single == Circuit_Parts_Advanced + || single == Circuit_Parts_Wiring_Advanced + || single == Circuit_Parts_Wiring_Elite + || single == Circuit_Parts_Wiring_Basic + || single == Circuit_Integrated + || single == Circuit_Parts_PetriDish + || single == Circuit_Parts_Vacuum_Tube + || single == Circuit_Integrated_Good + || single == Circuit_Parts_Capacitor + || single == Circuit_Parts_Diode + || single == Circuit_Parts_Resistor + || single == Circuit_Parts_Transistor) { - ){ CircuitImprintLoader.blacklistSet.add(single.get(1)); } } for (ItemList single : CIRCUIT_PARTS) { - if (!single.hasBeenSet()) - continue; + if (!single.hasBeenSet()) continue; ItemStack itemStack = single.get(1); - if (!GT_Utility.isStackValid(itemStack)) - continue; + if (!GT_Utility.isStackValid(itemStack)) continue; ArrayList toolTip = new ArrayList<>(); if (FMLCommonHandler.instance().getEffectiveSide().isClient()) single.getItem().addInformation(single.get(1).copy(), null, toolTip, true); String tt = (toolTip.size() > 0 ? toolTip.get(0) : ""); // tt += "Internal Name = "+single; - String localised = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); - BW_Meta_Items.getNEWCIRCUITS().addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised+"s", tt); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{single.get(16).copy(), GT_Utility.getIntegratedCircuit(16)}, Materials.Plastic.getMolten(72),BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs),600,30); - CircuitImprintLoader.circuitIIconRefs.put(CircuitImprintLoader.reverseIDs,single); + String localised = + GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); + BW_Meta_Items.getNEWCIRCUITS().addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised + "s", tt); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] {single.get(16).copy(), GT_Utility.getIntegratedCircuit(16)}, + Materials.Plastic.getMolten(72), + BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs), + 600, + 30); + CircuitImprintLoader.circuitIIconRefs.put(CircuitImprintLoader.reverseIDs, single); CircuitImprintLoader.reverseIDs--; } } @@ -100,64 +99,63 @@ public class CircuitPartLoader implements Runnable { * New entries MUST be placed at the END of this list, to prevent id shift. */ private static final List CIRCUIT_PARTS = Collections.unmodifiableList(Arrays.asList( - Circuit_Board_Basic, - Circuit_Board_Advanced, - Circuit_Board_Elite, - Circuit_Parts_Crystal_Chip_Elite, - Circuit_Parts_Crystal_Chip_Master, - Circuit_Board_Coated, - Circuit_Board_Coated_Basic, - Circuit_Board_Phenolic, - Circuit_Board_Phenolic_Good, - Circuit_Board_Epoxy, - Circuit_Board_Epoxy_Advanced, - Circuit_Board_Fiberglass, - Circuit_Board_Fiberglass_Advanced, - Circuit_Board_Multifiberglass_Elite, - Circuit_Board_Multifiberglass, - Circuit_Board_Wetware, - Circuit_Board_Wetware_Extreme, - Circuit_Board_Plastic, - Circuit_Board_Plastic_Advanced, - Circuit_Board_Bio, - Circuit_Board_Bio_Ultra, - Circuit_Parts_ResistorSMD, - Circuit_Parts_Coil, - Circuit_Parts_DiodeSMD, - Circuit_Parts_TransistorSMD, - Circuit_Parts_CapacitorSMD, - Circuit_Parts_ResistorASMD, - Circuit_Parts_DiodeASMD, - Circuit_Parts_TransistorASMD, - Circuit_Parts_CapacitorASMD, - Circuit_Chip_ILC, - Circuit_Chip_Ram, - Circuit_Chip_NAND, - Circuit_Chip_NOR, - Circuit_Chip_CPU, - Circuit_Chip_SoC, - Circuit_Chip_SoC2, - Circuit_Chip_PIC, - Circuit_Chip_Simple_SoC, - Circuit_Chip_HPIC, - Circuit_Chip_UHPIC, - Circuit_Chip_ULPIC, - Circuit_Chip_LPIC, - Circuit_Chip_NPIC, - Circuit_Chip_PPIC, - Circuit_Chip_QPIC, - Circuit_Chip_NanoCPU, - Circuit_Chip_QuantumCPU, - Circuit_Chip_CrystalCPU, - Circuit_Chip_CrystalSoC, - Circuit_Chip_CrystalSoC2, - Circuit_Chip_NeuroCPU, - Circuit_Chip_BioCPU, - Circuit_Chip_Stemcell, - Circuit_Chip_Biocell, - Circuit_Parts_ResistorXSMD, - Circuit_Parts_DiodeXSMD, - Circuit_Parts_TransistorXSMD, - Circuit_Parts_CapacitorXSMD - )); + Circuit_Board_Basic, + Circuit_Board_Advanced, + Circuit_Board_Elite, + Circuit_Parts_Crystal_Chip_Elite, + Circuit_Parts_Crystal_Chip_Master, + Circuit_Board_Coated, + Circuit_Board_Coated_Basic, + Circuit_Board_Phenolic, + Circuit_Board_Phenolic_Good, + Circuit_Board_Epoxy, + Circuit_Board_Epoxy_Advanced, + Circuit_Board_Fiberglass, + Circuit_Board_Fiberglass_Advanced, + Circuit_Board_Multifiberglass_Elite, + Circuit_Board_Multifiberglass, + Circuit_Board_Wetware, + Circuit_Board_Wetware_Extreme, + Circuit_Board_Plastic, + Circuit_Board_Plastic_Advanced, + Circuit_Board_Bio, + Circuit_Board_Bio_Ultra, + Circuit_Parts_ResistorSMD, + Circuit_Parts_Coil, + Circuit_Parts_DiodeSMD, + Circuit_Parts_TransistorSMD, + Circuit_Parts_CapacitorSMD, + Circuit_Parts_ResistorASMD, + Circuit_Parts_DiodeASMD, + Circuit_Parts_TransistorASMD, + Circuit_Parts_CapacitorASMD, + Circuit_Chip_ILC, + Circuit_Chip_Ram, + Circuit_Chip_NAND, + Circuit_Chip_NOR, + Circuit_Chip_CPU, + Circuit_Chip_SoC, + Circuit_Chip_SoC2, + Circuit_Chip_PIC, + Circuit_Chip_Simple_SoC, + Circuit_Chip_HPIC, + Circuit_Chip_UHPIC, + Circuit_Chip_ULPIC, + Circuit_Chip_LPIC, + Circuit_Chip_NPIC, + Circuit_Chip_PPIC, + Circuit_Chip_QPIC, + Circuit_Chip_NanoCPU, + Circuit_Chip_QuantumCPU, + Circuit_Chip_CrystalCPU, + Circuit_Chip_CrystalSoC, + Circuit_Chip_CrystalSoC2, + Circuit_Chip_NeuroCPU, + Circuit_Chip_BioCPU, + Circuit_Chip_Stemcell, + Circuit_Chip_Biocell, + Circuit_Parts_ResistorXSMD, + Circuit_Parts_DiodeXSMD, + Circuit_Parts_TransistorXSMD, + Circuit_Parts_CapacitorXSMD)); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java index 500fda4653..69b43684ce 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; +import static com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.GTMetaItemEnhancer.NoMetaValue; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; @@ -36,6 +38,10 @@ import gregtech.api.enums.TextureSet; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.util.GT_OreDictUnificator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; @@ -45,65 +51,61 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import static com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.GTMetaItemEnhancer.NoMetaValue; - public class BWGTMetaItems extends BW_MetaGenerated_Items { private boolean hasList; private final Set hiddenThings = new HashSet<>(); public BWGTMetaItems(OrePrefixes orePrefixes, List noSubIDMaterials) { - super(orePrefixes,null); - //materialloop: + super(orePrefixes, null); + // materialloop: for (int i = 0; i < Materials.values().length; i++) { ItemStack tStack = new ItemStack(this, 1, i); Materials material = Materials.values()[i]; - if (((material.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((material.getFluid(1) == null && material.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) - continue; - //for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) + if (((material.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) + || ((material.getFluid(1) == null && material.getGas(1) == null) + && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; + // for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) // if (material.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) // continue materialloop; - if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ",""))){ + if (OreDictionary.doesOreNameExist( + this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ", ""))) { hiddenThings.add(i); continue; } - GT_OreDictUnificator.registerOre(this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ",""), tStack); + GT_OreDictUnificator.registerOre( + this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ", ""), tStack); } if (noSubIDMaterials != null) { hasList = true; - //materialloop: + // materialloop: for (int i = 0; i < noSubIDMaterials.size(); i++) { - ItemStack tStack = new ItemStack(this, 1, i+1001); + ItemStack tStack = new ItemStack(this, 1, i + 1001); Materials w = noSubIDMaterials.get(i); - if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) + if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) + || ((w.getFluid(1) == null && w.getGas(1) == null) + && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; - //for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) + // for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) // if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) // continue materialloop; - if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""))){ + if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ", ""))) { hiddenThings.add(i); continue; } - GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); + GT_OreDictUnificator.registerOre( + this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ", ""), tStack); } } } private Materials getMaterial(ItemStack is) { - if (is == null || is.getItem() != this) - return null; + if (is == null || is.getItem() != this) return null; final int meta = is.getItemDamage(); Materials material; - if (meta > 1000 && hasList) - material = NoMetaValue.get(meta - 1001); - else - material = Materials.values()[meta]; + if (meta > 1000 && hasList) material = NoMetaValue.get(meta - 1001); + else material = Materials.values()[meta]; return material; } @@ -127,12 +129,11 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } - @Override + @Override public IIconContainer getIconContainer(int aMetaData) { - if (this.orePrefixes.mTextureIndex == -1) - return getIconContainerBartWorks(aMetaData); + if (this.orePrefixes.mTextureIndex == -1) return getIconContainerBartWorks(aMetaData); if (aMetaData > 1000 && hasList) - return NoMetaValue.get(aMetaData-1001).mIconSet.mTextures[this.orePrefixes.mTextureIndex]; + return NoMetaValue.get(aMetaData - 1001).mIconSet.mTextures[this.orePrefixes.mTextureIndex]; if (aMetaData < 0 || aMetaData > Materials.values().length || Materials.values()[(short) aMetaData] == null) return null; return Materials.values()[(short) aMetaData].mIconSet.mTextures[this.orePrefixes.mTextureIndex]; @@ -140,23 +141,18 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { @Override protected IIconContainer getIconContainerBartWorks(int aMetaData) { - if (SideReference.Side.Server || PrefixTextureLinker.texMap == null) - return null; + if (SideReference.Side.Server || PrefixTextureLinker.texMap == null) return null; HashMap iconLink = PrefixTextureLinker.texMap.get(this.orePrefixes); - if (iconLink == null) - return null; + if (iconLink == null) return null; Materials material; - if (aMetaData > 1000 && hasList) - material = NoMetaValue.get(aMetaData-1001); - else - material = Materials.values()[aMetaData]; + if (aMetaData > 1000 && hasList) material = NoMetaValue.get(aMetaData - 1001); + else material = Materials.values()[aMetaData]; - if (material == null || material.mIconSet == null) - return null; + if (material == null || material.mIconSet == null) return null; return iconLink.get(material.mIconSet); } @@ -167,50 +163,49 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { for (int i = 0; i < Materials.values().length; i++) { Materials w = Materials.values()[i]; - if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) - continue; - else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) - continue; - else if (hiddenThings.contains(i)) - continue; + if ((w == null) + || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 + && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) continue; + else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) + || ((w.getFluid(1) == null && w.getGas(1) == null) + && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; + else if (hiddenThings.contains(i)) continue; aList.add(new ItemStack(this, 1, i)); } if (hasList) for (int i = 0; i < NoMetaValue.size(); i++) { Materials w = NoMetaValue.get(i); - if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) - continue; - else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) - continue; - else if (hiddenThings.contains(i)) + if ((w == null) + || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 + && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) continue; + else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) + || ((w.getFluid(1) == null && w.getGas(1) == null) + && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; + else if (hiddenThings.contains(i)) continue; aList.add(new ItemStack(this, 1, i + 1001)); } } @Override public short[] getColorForGUI(ItemStack aStack) { - if (aStack.getItemDamage() > 1000 && hasList) - return NoMetaValue.get(aStack.getItemDamage()-1001).mRGBa; + if (aStack.getItemDamage() > 1000 && hasList) return NoMetaValue.get(aStack.getItemDamage() - 1001).mRGBa; return Materials.values()[aStack.getItemDamage()].mRGBa; } @Override public String getNameForGUI(ItemStack aStack) { if (aStack.getItemDamage() > 1000 && hasList) - return NoMetaValue.get(aStack.getItemDamage()-1001).mDefaultLocalName; + return NoMetaValue.get(aStack.getItemDamage() - 1001).mDefaultLocalName; return Materials.values()[aStack.getItemDamage()].mDefaultLocalName; } @Override - public void onUpdate(ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) { - - } + public void onUpdate(ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) {} @Override public short[] getRGBa(ItemStack aStack) { - if (aStack.getItemDamage() > 1000 && hasList) - return NoMetaValue.get(aStack.getItemDamage()-1001).mRGBa; + if (aStack.getItemDamage() > 1000 && hasList) return NoMetaValue.get(aStack.getItemDamage() - 1001).mRGBa; return Materials.values()[aStack.getItemDamage()].mRGBa; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java index 75a2846172..5f0730b1a3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -30,6 +30,8 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import java.util.List; +import java.util.stream.Collectors; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; @@ -37,14 +39,10 @@ import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; -import java.util.List; -import java.util.stream.Collectors; - public class GTMetaItemEnhancer { - static List NoMetaValue; + static List NoMetaValue; - private GTMetaItemEnhancer() { - } + private GTMetaItemEnhancer() {} public static void init() { if (!WerkstoffLoader.gtnhGT) { @@ -52,64 +50,86 @@ public class GTMetaItemEnhancer { Materials[] values = Materials.values(); for (int i = 0, valuesLength = values.length; i < valuesLength; i++) { Materials m = values[i]; - if (m == null || m.mStandardMoltenFluid == null) - continue; - final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(m.getMolten(144), new ItemStack(moltenCell, 1, i), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L)); + if (m == null || m.mStandardMoltenFluid == null) continue; + final FluidContainerRegistry.FluidContainerData emptyData = + new FluidContainerRegistry.FluidContainerData( + m.getMolten(144), + new ItemStack(moltenCell, 1, i), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L)); FluidContainerRegistry.registerFluidContainer(emptyData); GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), new ItemStack(moltenCell, 1, i), m.getMolten(144), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(new ItemStack(moltenCell, 1, i), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), GT_Values.NF, m.getMolten(144)); + GT_Values.RA.addFluidCannerRecipe( + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), + new ItemStack(moltenCell, 1, i), + m.getMolten(144), + GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe( + new ItemStack(moltenCell, 1, i), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), + GT_Values.NF, + m.getMolten(144)); } } if (!LoaderReference.Forestry) { return; } - NoMetaValue = Materials.getMaterialsMap().values().stream().filter(m -> m.mMetaItemSubID == -1).collect(Collectors.toList()); + NoMetaValue = Materials.getMaterialsMap().values().stream() + .filter(m -> m.mMetaItemSubID == -1) + .collect(Collectors.toList()); Item moltenCapsuls = new BWGTMetaItems(WerkstoffLoader.capsuleMolten, null); Item capsuls = new BWGTMetaItems(OrePrefixes.capsule, NoMetaValue); - //Item bottles = new BWGTMetaItems(OrePrefixes.bottle, NoMetaValue); + // Item bottles = new BWGTMetaItems(OrePrefixes.bottle, NoMetaValue); Materials[] values = Materials.values(); for (int i = 0, valuesLength = values.length; i < valuesLength; i++) { Materials m = values[i]; if (m.mStandardMoltenFluid != null && GT_OreDictUnificator.get(WerkstoffLoader.cellMolten, m, 1) != null) { - final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(m.getMolten(144), new ItemStack(moltenCapsuls, 1, i), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + final FluidContainerRegistry.FluidContainerData emptyData = + new FluidContainerRegistry.FluidContainerData( + m.getMolten(144), + new ItemStack(moltenCapsuls, 1, i), + GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); FluidContainerRegistry.registerFluidContainer(emptyData); GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe(GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1), new ItemStack(moltenCapsuls, 1, i), m.getMolten(144), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(new ItemStack(moltenCapsuls, 1, i), GT_Values.NI, GT_Values.NF, m.getMolten(144)); + GT_Values.RA.addFluidCannerRecipe( + GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1), + new ItemStack(moltenCapsuls, 1, i), + m.getMolten(144), + GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe( + new ItemStack(moltenCapsuls, 1, i), GT_Values.NI, GT_Values.NF, m.getMolten(144)); } - if (m.getFluid(1) == null && m.getGas(1) == null) - continue; - if (OreDictionary.doesOreNameExist("capsule"+m.mName)) - continue; + if (m.getFluid(1) == null && m.getGas(1) == null) continue; + if (OreDictionary.doesOreNameExist("capsule" + m.mName)) continue; addFluidData(m, GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), capsuls, 1000, i, true); // addFluidData(m, new ItemStack(Items.glass_bottle), bottles, 250, i, false); } for (int i = 0, valuesLength = NoMetaValue.size(); i < valuesLength; i++) { Materials m = NoMetaValue.get(i); - if (m.getFluid(1) == null && m.getGas(1) == null) - continue; - if (OreDictionary.doesOreNameExist("capsule"+m.mName)) - continue; + if (m.getFluid(1) == null && m.getGas(1) == null) continue; + if (OreDictionary.doesOreNameExist("capsule" + m.mName)) continue; addFluidData(m, GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), capsuls, 1000, i + 1001, true); // addFluidData(m, new ItemStack(Items.glass_bottle), bottles, 250, i + 1001, false); } - } - private static void addFluidData(Materials m, ItemStack container, Item filled, int amount, int it, boolean empty){ + private static void addFluidData(Materials m, ItemStack container, Item filled, int amount, int it, boolean empty) { Fluid f = m.getFluid(1) != null ? m.getFluid(1).getFluid() : m.getGas(1).getFluid(); - final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(f, amount), new ItemStack(filled, 1, it), container); + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( + new FluidStack(f, amount), new ItemStack(filled, 1, it), container); FluidContainerRegistry.registerFluidContainer(emptyData); GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe(container, new ItemStack(filled, 1, it), new FluidStack(f, amount), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(new ItemStack(filled, 1, it), empty ? GT_Values.NI : container, GT_Values.NF, new FluidStack(f, amount)); + GT_Values.RA.addFluidCannerRecipe( + container, new ItemStack(filled, 1, it), new FluidStack(f, amount), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe( + new ItemStack(filled, 1, it), + empty ? GT_Values.NI : container, + GT_Values.NF, + new FluidStack(f, amount)); } - public static void addAdditionalOreDictToForestry(){ - if (!LoaderReference.Forestry) - return; + public static void addAdditionalOreDictToForestry() { + if (!LoaderReference.Forestry) return; OreDictionary.registerOre("capsuleWater", getForestryItem("waxCapsuleWater")); OreDictionary.registerOre("capsuleIce", getForestryItem("waxCapsuleIce")); OreDictionary.registerOre("capsuleHoney", getForestryItem("waxCapsuleHoney")); @@ -124,7 +144,7 @@ public class GTMetaItemEnhancer { OreDictionary.registerOre("capsuleLava", getForestryItem("refractoryLava")); } - private static ItemStack getForestryItem(String itemName){ + private static ItemStack getForestryItem(String itemName) { return GT_ModHandler.getModItem("Forestry", itemName, 1); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java index 7ce3eeb5c3..47989db5cc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; +import static com.github.bartimaeusnek.bartworks.MainMod.MOD_ID; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -35,6 +38,11 @@ import gregtech.api.objects.ItemData; import gregtech.api.util.*; import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.*; +import java.util.function.Consumer; +import java.util.function.Predicate; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; @@ -43,15 +51,6 @@ import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.reflect.FieldUtils; import org.apache.commons.lang3.reflect.MethodUtils; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.*; -import java.util.function.Consumer; -import java.util.function.Predicate; - -import static com.github.bartimaeusnek.bartworks.MainMod.MOD_ID; -import static gregtech.api.enums.OrePrefixes.*; - @SuppressWarnings("ALL") public class LuVTierEnhancer implements Runnable { @@ -66,7 +65,9 @@ public class LuVTierEnhancer implements Runnable { List bufferedRecipeList = null; try { - bufferedRecipeList = (List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null); + bufferedRecipeList = + (List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true) + .get(null); } catch (IllegalAccessException e) { e.printStackTrace(); } @@ -77,25 +78,21 @@ public class LuVTierEnhancer implements Runnable { Arrays.stream(ItemList.values()) .filter(item -> item.toString().contains("LuV") && item.hasBeenSet()) - .forEach(item -> LuVMachines.add(item.get(1))); + .forEach(item -> LuVMachines.add(item.get(1))); if (LoaderReference.dreamcraft) { addDreamcraftItemListItems(LuVMachines); } - GT_ModHandler.addCraftingRecipe(ItemList.Casing_LuV.get(1), - GT_ModHandler.RecipeBits.BUFFERED | - GT_ModHandler.RecipeBits.REVERSIBLE | - GT_ModHandler.RecipeBits.NOT_REMOVABLE | - GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, - new Object[]{ - "PPP", - "PwP", - "PPP", - 'P', WerkstoffLoader.LuVTierMaterial.get(plate) - }); + GT_ModHandler.addCraftingRecipe( + ItemList.Casing_LuV.get(1), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.REVERSIBLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, + new Object[] {"PPP", "PwP", "PPP", 'P', WerkstoffLoader.LuVTierMaterial.get(plate)}); - replaceAllRecipes(LuVMachines,LuVMaterialsGenerated,bufferedRecipeList); + replaceAllRecipes(LuVMachines, LuVMaterialsGenerated, bufferedRecipeList); AfterLuVTierEnhacement.run(); } @@ -104,7 +101,8 @@ public class LuVTierEnhancer implements Runnable { blackListForOsmiridium.add(stack); } - private static void replaceAllRecipes(Collection LuVMachines, OrePrefixes[] LuVMaterialsGenerated, List bufferedRecipeList){ + private static void replaceAllRecipes( + Collection LuVMachines, OrePrefixes[] LuVMaterialsGenerated, List bufferedRecipeList) { LuVTierEnhancer.replaceOsmiridiumInLuVRecipes(); for (GT_Recipe_AssemblyLine sAssemblylineRecipe : GT_Recipe_AssemblyLine.sAssemblylineRecipes) { @@ -122,17 +120,19 @@ public class LuVTierEnhancer implements Runnable { } for (ItemStack stack : LuVMachines) { - Predicate recipeFilter = obj -> obj instanceof GT_Shaped_Recipe && GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true); + Predicate recipeFilter = obj -> obj instanceof GT_Shaped_Recipe + && GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true); rewriteCraftingRecipes(bufferedRecipeList, LuVMaterialsGenerated, recipeFilter); } } - private static void addDreamcraftItemListItems(Collection LuVMachines){ + private static void addDreamcraftItemListItems(Collection LuVMachines) { try { Class customItemListClass = Class.forName("com.dreammaster.gthandler.CustomItemList"); Method hasnotBeenSet = MethodUtils.getAccessibleMethod(customItemListClass, "hasBeenSet"); Method get = MethodUtils.getAccessibleMethod(customItemListClass, "get", long.class, Object[].class); - for (Enum customItemList : (Enum[]) FieldUtils.getField(customItemListClass, "$VALUES", true).get(null)) { + for (Enum customItemList : (Enum[]) + FieldUtils.getField(customItemListClass, "$VALUES", true).get(null)) { if (customItemList.toString().contains("LuV") && (boolean) hasnotBeenSet.invoke(customItemList)) LuVMachines.add((ItemStack) get.invoke(customItemList, 1, new Object[0])); } @@ -141,14 +141,20 @@ public class LuVTierEnhancer implements Runnable { } } - private static void rewriteCraftingRecipes(List bufferedRecipeList, OrePrefixes[] LuVMaterialsGenerated, Predicate recipeFilter){ + private static void rewriteCraftingRecipes( + List bufferedRecipeList, OrePrefixes[] LuVMaterialsGenerated, Predicate recipeFilter) { for (OrePrefixes prefixes : LuVMaterialsGenerated) { - Consumer recipeAction = obj -> LuVTierEnhancer.doStacksContainAndReplace(null, ((GT_Shaped_Recipe) obj).getInput(), - GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, + Consumer recipeAction = obj -> LuVTierEnhancer.doStacksContainAndReplace( + null, + ((GT_Shaped_Recipe) obj).getInput(), + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - CraftingManager.getInstance().getRecipeList().stream().filter(recipeFilter).forEach(recipeAction); + CraftingManager.getInstance().getRecipeList().stream() + .filter(recipeFilter) + .forEach(recipeAction); bufferedRecipeList.stream().filter(recipeFilter).forEach(recipeAction); } } @@ -156,72 +162,132 @@ public class LuVTierEnhancer implements Runnable { private static void rewriteMachineRecipes(ItemStack stack, OrePrefixes[] LuVMaterialsGenerated, GT_Recipe recipe) { if (LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, stack, false)) { for (OrePrefixes prefixes : LuVMaterialsGenerated) { - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mInputs, + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, + WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mOutputs, + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, + WerkstoffLoader.LuVTierMaterial.get(prefixes)); } - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mFluidInputs, + Materials.Chrome.getMolten(1), + true, + WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mFluidOutputs, + Materials.Chrome.getMolten(1), + true, + WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); } if (LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mOutputs, stack, false)) { for (OrePrefixes prefixes : LuVMaterialsGenerated) { - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mInputs, + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, + WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mOutputs, + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, + WerkstoffLoader.LuVTierMaterial.get(prefixes)); } - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mFluidInputs, + Materials.Chrome.getMolten(1), + true, + WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mFluidOutputs, + Materials.Chrome.getMolten(1), + true, + WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); } } - private static void rewriteAsslineRecipes(ItemStack stack, OrePrefixes[] LuVMaterialsGenerated, GT_Recipe.GT_Recipe_AssemblyLine recipe){ + + private static void rewriteAsslineRecipes( + ItemStack stack, OrePrefixes[] LuVMaterialsGenerated, GT_Recipe.GT_Recipe_AssemblyLine recipe) { for (OrePrefixes prefixes : LuVMaterialsGenerated) { if (LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, stack, false)) { - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[]{recipe.mOutput}, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mInputs, + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, + WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + new Object[] {recipe.mOutput}, + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, + WerkstoffLoader.LuVTierMaterial.get(prefixes)); } - if (LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[]{recipe.mOutput}, stack, false)) { - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[]{recipe.mOutput}, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + if (LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[] {recipe.mOutput}, stack, false)) { + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mInputs, + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, + WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + new Object[] {recipe.mOutput}, + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, + WerkstoffLoader.LuVTierMaterial.get(prefixes)); } } if (LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, stack, false)) { - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mFluidInputs, + Materials.Chrome.getMolten(1), + true, + WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); } - if (LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[]{recipe.mOutput}, stack, false)) { - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + if (LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[] {recipe.mOutput}, stack, false)) { + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mFluidInputs, + Materials.Chrome.getMolten(1), + true, + WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); } } private static void replaceOsmiridiumInLuVRecipes() { - Consumer replace = gt_recipe -> - gt_recipe.mInputs = replaceArrayWith( - gt_recipe.mInputs, - Materials.Osmiridium, - WerkstoffLoader.Ruridit, - gt_recipe - ); + Consumer replace = gt_recipe -> gt_recipe.mInputs = + replaceArrayWith(gt_recipe.mInputs, Materials.Osmiridium, WerkstoffLoader.Ruridit, gt_recipe); GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.stream() .filter(recipe_assemblyLine -> recipe_assemblyLine.mEUt <= 6000) - .forEach(recipe_assemblyLine -> - recipe_assemblyLine.mInputs = replaceArrayWith( - recipe_assemblyLine.mInputs, - Materials.Osmiridium, - WerkstoffLoader.Ruridit, - recipe_assemblyLine - ) - ); + .forEach(recipe_assemblyLine -> recipe_assemblyLine.mInputs = replaceArrayWith( + recipe_assemblyLine.mInputs, + Materials.Osmiridium, + WerkstoffLoader.Ruridit, + recipe_assemblyLine)); GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList.stream() - .filter(gt_recipe -> - gt_recipe.mEUt < BW_Util.getTierVoltage(6) && - !BW_Util.checkStackAndPrefix(gt_recipe.mOutputs[0]) && - !isOutputBlackListed(gt_recipe.mOutputs[0]) - ) + .filter(gt_recipe -> gt_recipe.mEUt < BW_Util.getTierVoltage(6) + && !BW_Util.checkStackAndPrefix(gt_recipe.mOutputs[0]) + && !isOutputBlackListed(gt_recipe.mOutputs[0])) .forEach(replace); GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.stream() - .filter(gt_recipe -> gt_recipe.mEUt <= 6000 && - !isOutputBlackListed(gt_recipe.mOutputs[0]) - ) + .filter(gt_recipe -> gt_recipe.mEUt <= 6000 && !isOutputBlackListed(gt_recipe.mOutputs[0])) .forEach(replace); } @@ -230,12 +296,12 @@ public class LuVTierEnhancer implements Runnable { return false; } - private static ItemStack[] replaceArrayWith(ItemStack[] stackArray, Materials source, Werkstoff target, Object recipe) { + private static ItemStack[] replaceArrayWith( + ItemStack[] stackArray, Materials source, Werkstoff target, Object recipe) { boolean replaced = false; for (int i = 0; i < stackArray.length; i++) { ItemStack stack = stackArray[i]; - if (!BW_Util.checkStackAndPrefix(stack)) - continue; + if (!BW_Util.checkStackAndPrefix(stack)) continue; stackArray[i] = replaceStackWith(stack, source, target, recipe); } return stackArray; @@ -249,19 +315,19 @@ public class LuVTierEnhancer implements Runnable { if (recipe instanceof GT_Recipe) { ((GT_Recipe) recipe).setOwner(MOD_ID); } else if (recipe instanceof GT_Recipe_AssemblyLine) { - // todo: update NEI fake recipe + // todo: update NEI fake recipe } } } return stack; } - private static boolean doStacksContainAndReplace(Object recipe, FluidStack[] stacks, FluidStack stack, boolean replace, Fluid... replacement) { + private static boolean doStacksContainAndReplace( + Object recipe, FluidStack[] stacks, FluidStack stack, boolean replace, Fluid... replacement) { boolean replaced = false; for (int i = 0; i < stacks.length; i++) { if (GT_Utility.areFluidsEqual(stack, stacks[i])) - if (!replace) - return true; + if (!replace) return true; else { int amount = stacks[i].amount; stacks[i] = new FluidStack(replacement[0], amount); @@ -278,26 +344,24 @@ public class LuVTierEnhancer implements Runnable { return replaced; } - private static boolean doStacksContainAndReplace(Object recipe, Object[] stacks, ItemStack stack, boolean replace, ItemStack... replacement) { + private static boolean doStacksContainAndReplace( + Object recipe, Object[] stacks, ItemStack stack, boolean replace, ItemStack... replacement) { boolean replaced = false; for (int i = 0; i < stacks.length; i++) { if (!GT_Utility.isStackValid(stacks[i])) { - if (stacks[i] instanceof ArrayList && ((ArrayList)stacks[i]).size() > 0) { - if (GT_Utility.areStacksEqual(stack, (ItemStack) ((ArrayList)stacks[i]).get(0), true)) - if (!replace) - return true; + if (stacks[i] instanceof ArrayList && ((ArrayList) stacks[i]).size() > 0) { + if (GT_Utility.areStacksEqual(stack, (ItemStack) ((ArrayList) stacks[i]).get(0), true)) + if (!replace) return true; else { - int amount = ((ItemStack) ((ArrayList)stacks[i]).get(0)).stackSize; + int amount = ((ItemStack) ((ArrayList) stacks[i]).get(0)).stackSize; stacks[i] = new ArrayList<>(); - ((ArrayList)stacks[i]).add(BW_Util.setStackSize(replacement[0], amount)); + ((ArrayList) stacks[i]).add(BW_Util.setStackSize(replacement[0], amount)); replaced = true; } - } else - continue; + } else continue; } else if (GT_Utility.areStacksEqual(stack, (ItemStack) stacks[i], true)) - if (!replace) - return true; + if (!replace) return true; else { int amount = ((ItemStack) stacks[i]).stackSize; stacks[i] = BW_Util.setStackSize(replacement[0], amount); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index b7b4d07894..773c23812b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; @@ -44,6 +47,9 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Block_Ores_Abstract; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.*; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.*; @@ -52,217 +58,654 @@ import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; import org.apache.commons.lang3.reflect.FieldUtils; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.*; - -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; -import static gregtech.api.enums.OrePrefixes.*; - public class PlatinumSludgeOverHaul { private static final Materials[] BLACKLIST = { - Materials.HSSS, - Materials.EnderiumBase, - Materials.Osmiridium, - Materials.get("Uraniumtriplatinid"), - Materials.get("Tetranaquadahdiindiumhexaplatiumosminid"), - Materials.get("Longasssuperconductornameforuvwire"), + Materials.HSSS, + Materials.EnderiumBase, + Materials.Osmiridium, + Materials.get("Uraniumtriplatinid"), + Materials.get("Tetranaquadahdiindiumhexaplatiumosminid"), + Materials.get("Longasssuperconductornameforuvwire"), }; private static final OrePrefixes[] OPBLACKLIST = { - crushedCentrifuged,crushed,crushedPurified,dustPure,dustImpure,dustRefined,dust,dustTiny,dustSmall + crushedCentrifuged, crushed, crushedPurified, dustPure, dustImpure, dustRefined, dust, dustTiny, dustSmall }; - private PlatinumSludgeOverHaul() { - } + private PlatinumSludgeOverHaul() {} private static void runHelperrecipes() { - //DilutedSulfuricAcid + // DilutedSulfuricAcid // 2H2SO4 + H2O = 3H2SO4(d) - GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(2), Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, Materials.DilutedSulfuricAcid.getCells(3), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, Materials.SulfuricAcid.getFluid(2000), Materials.DilutedSulfuricAcid.getFluid(3000), Materials.Empty.getCells(1), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(2), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Water.getFluid(1000), Materials.DilutedSulfuricAcid.getFluid(3000), Materials.Empty.getCells(2), 30, 30); - //FormicAcid - //CO + NaOH = CHO2Na - GT_Values.RA.addChemicalRecipe(Materials.CarbonMonoxide.getCells(1), Materials.SodiumHydroxide.getDust(3), null, null, Sodiumformate.get(cell), null, 15); - //H2SO4 + 2CHO2Na = 2CH2O2 + Na2SO4 - GT_Values.RA.addChemicalRecipe(Sodiumformate.get(cell, 2), GT_Utility.getIntegratedCircuit(1), Materials.SulfuricAcid.getFluid(1000), null, FormicAcid.get(cell, 2), Sodiumsulfate.get(dust, 7), 15); - GT_Values.RA.addChemicalRecipe(Materials.SulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Sodiumformate.getFluidOrGas(2000), FormicAcid.getFluidOrGas(2000), Materials.Empty.getCells(1), Sodiumsulfate.get(dust, 7), 15); - //AquaRegia - GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, AquaRegia.get(cell, 2), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(2), null, null, AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(2), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(3), null, null, Materials.DilutedSulfuricAcid.getFluid(1000), AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(1), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(4), null, null, Materials.NitricAcid.getFluid(1000), AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(1), 30, 30); - - //AmmoniumCloride - //NH3 + HCl = NH4Cl - GT_Values.RA.addChemicalRecipe(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.HydrochloricAcid.getFluid(1000), null, AmmoniumChloride.get(cell, 1), null, 15); - GT_Values.RA.addChemicalRecipe(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), AmmoniumChloride.getFluidOrGas(1000), Materials.Empty.getCells(1), null, 15); - - //base sollution + GT_Values.RA.addMixerRecipe( + Materials.SulfuricAcid.getCells(2), + Materials.Water.getCells(1), + GT_Utility.getIntegratedCircuit(1), + null, + null, + null, + Materials.DilutedSulfuricAcid.getCells(3), + 30, + 30); + GT_Values.RA.addMixerRecipe( + Materials.Water.getCells(1), + GT_Utility.getIntegratedCircuit(1), + null, + null, + Materials.SulfuricAcid.getFluid(2000), + Materials.DilutedSulfuricAcid.getFluid(3000), + Materials.Empty.getCells(1), + 30, + 30); + GT_Values.RA.addMixerRecipe( + Materials.SulfuricAcid.getCells(2), + GT_Utility.getIntegratedCircuit(1), + null, + null, + Materials.Water.getFluid(1000), + Materials.DilutedSulfuricAcid.getFluid(3000), + Materials.Empty.getCells(2), + 30, + 30); + // FormicAcid + // CO + NaOH = CHO2Na + GT_Values.RA.addChemicalRecipe( + Materials.CarbonMonoxide.getCells(1), + Materials.SodiumHydroxide.getDust(3), + null, + null, + Sodiumformate.get(cell), + null, + 15); + // H2SO4 + 2CHO2Na = 2CH2O2 + Na2SO4 + GT_Values.RA.addChemicalRecipe( + Sodiumformate.get(cell, 2), + GT_Utility.getIntegratedCircuit(1), + Materials.SulfuricAcid.getFluid(1000), + null, + FormicAcid.get(cell, 2), + Sodiumsulfate.get(dust, 7), + 15); + GT_Values.RA.addChemicalRecipe( + Materials.SulfuricAcid.getCells(1), + GT_Utility.getIntegratedCircuit(1), + Sodiumformate.getFluidOrGas(2000), + FormicAcid.getFluidOrGas(2000), + Materials.Empty.getCells(1), + Sodiumsulfate.get(dust, 7), + 15); + // AquaRegia + GT_Values.RA.addMixerRecipe( + Materials.DilutedSulfuricAcid.getCells(1), + Materials.NitricAcid.getCells(1), + GT_Utility.getIntegratedCircuit(1), + null, + null, + null, + AquaRegia.get(cell, 2), + 30, + 30); + GT_Values.RA.addMixerRecipe( + Materials.DilutedSulfuricAcid.getCells(1), + Materials.NitricAcid.getCells(1), + GT_Utility.getIntegratedCircuit(2), + null, + null, + AquaRegia.getFluidOrGas(2000), + Materials.Empty.getCells(2), + 30, + 30); + GT_Values.RA.addMixerRecipe( + Materials.NitricAcid.getCells(1), + GT_Utility.getIntegratedCircuit(3), + null, + null, + Materials.DilutedSulfuricAcid.getFluid(1000), + AquaRegia.getFluidOrGas(2000), + Materials.Empty.getCells(1), + 30, + 30); + GT_Values.RA.addMixerRecipe( + Materials.DilutedSulfuricAcid.getCells(1), + GT_Utility.getIntegratedCircuit(4), + null, + null, + Materials.NitricAcid.getFluid(1000), + AquaRegia.getFluidOrGas(2000), + Materials.Empty.getCells(1), + 30, + 30); + + // AmmoniumCloride + // NH3 + HCl = NH4Cl + GT_Values.RA.addChemicalRecipe( + Materials.Ammonia.getCells(1), + GT_Utility.getIntegratedCircuit(1), + Materials.HydrochloricAcid.getFluid(1000), + null, + AmmoniumChloride.get(cell, 1), + null, + 15); + GT_Values.RA.addChemicalRecipe( + Materials.HydrochloricAcid.getCells(1), + GT_Utility.getIntegratedCircuit(1), + Materials.Ammonia.getGas(1000), + AmmoniumChloride.getFluidOrGas(1000), + Materials.Empty.getCells(1), + null, + 15); + + // base sollution for (Werkstoff w : Werkstoff.werkstoffHashSet) - if (w.containsStuff(Materials.Sulfur) && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { - GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); - GT_Values.RA.addChemicalRecipe(w.get(crushedPurified, 9), GT_Utility.getIntegratedCircuit(9), AquaRegia.getFluidOrGas(1350), PTConcentrate.getFluidOrGas(1350), null, 2250); - GT_Values.RA.addChemicalRecipe(w.get(crushedPurified, 9), PTMetallicPowder.get(dust, 9), AquaRegia.getFluidOrGas(10350), PTConcentrate.getFluidOrGas(10350), PTResidue.get(dust), 2250); + if (w.containsStuff(Materials.Sulfur) + && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { + GT_Values.RA.addChemicalRecipe( + w.get(crushedPurified), + GT_Utility.getIntegratedCircuit(1), + AquaRegia.getFluidOrGas(150), + PTConcentrate.getFluidOrGas(150), + null, + 250); + GT_Values.RA.addChemicalRecipe( + w.get(crushedPurified, 9), + GT_Utility.getIntegratedCircuit(9), + AquaRegia.getFluidOrGas(1350), + PTConcentrate.getFluidOrGas(1350), + null, + 2250); + GT_Values.RA.addChemicalRecipe( + w.get(crushedPurified, 9), + PTMetallicPowder.get(dust, 9), + AquaRegia.getFluidOrGas(10350), + PTConcentrate.getFluidOrGas(10350), + PTResidue.get(dust), + 2250); } for (Materials m : Materials.values()) - if (PlatinumSludgeOverHaul.materialsContains(m, Materials.Sulfur) && (PlatinumSludgeOverHaul.materialsContains(m, Materials.Copper) || PlatinumSludgeOverHaul.materialsContains(m, Materials.Nickel))) { - GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); - GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 9), GT_Utility.getIntegratedCircuit(9), AquaRegia.getFluidOrGas(1350), PTConcentrate.getFluidOrGas(1350), null, 2250); - GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 9), PTMetallicPowder.get(dust, 9), AquaRegia.getFluidOrGas(10350), PTConcentrate.getFluidOrGas(10350), PTResidue.get(dust), 2250); + if (PlatinumSludgeOverHaul.materialsContains(m, Materials.Sulfur) + && (PlatinumSludgeOverHaul.materialsContains(m, Materials.Copper) + || PlatinumSludgeOverHaul.materialsContains(m, Materials.Nickel))) { + GT_Values.RA.addChemicalRecipe( + GT_OreDictUnificator.get(crushedPurified, m, 1), + GT_Utility.getIntegratedCircuit(1), + AquaRegia.getFluidOrGas(150), + PTConcentrate.getFluidOrGas(150), + null, + 250); + GT_Values.RA.addChemicalRecipe( + GT_OreDictUnificator.get(crushedPurified, m, 9), + GT_Utility.getIntegratedCircuit(9), + AquaRegia.getFluidOrGas(1350), + PTConcentrate.getFluidOrGas(1350), + null, + 2250); + GT_Values.RA.addChemicalRecipe( + GT_OreDictUnificator.get(crushedPurified, m, 9), + PTMetallicPowder.get(dust, 9), + AquaRegia.getFluidOrGas(10350), + PTConcentrate.getFluidOrGas(10350), + PTResidue.get(dust), + 2250); } - //Pt - GT_Values.RA.addBlastRecipe(PTMetallicPowder.get(dust, 3), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Platinum.getNuggets(2), null, 600, 120, Materials.Platinum.mMeltingPoint); - - GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); - GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust, 9), GT_Utility.getIntegratedCircuit(9), AquaRegia.getFluidOrGas(9000), PTConcentrate.getFluidOrGas(9000), PTResidue.get(dust), 2250); - GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2), null, AmmoniumChloride.getFluidOrGas(400), PDAmmonia.getFluidOrGas(400), PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,4), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(1)}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(400)}, new FluidStack[]{PDAmmonia.getFluidOrGas(400), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,4)}, 1200, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, new FluidStack[]{PTConcentrate.getFluidOrGas(18000), AmmoniumChloride.getFluidOrGas(3600)}, new FluidStack[]{PDAmmonia.getFluidOrGas(3600), Materials.NitrogenDioxide.getGas(9000),Materials.DilutedSulfuricAcid.getFluid(9000)}, new ItemStack[]{PTSaltCrude.get(dust, 16), PTRawPowder.get(dust,4)}, 1400, 240); - GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), + // Pt + GT_Values.RA.addBlastRecipe( + PTMetallicPowder.get(dust, 3), + GT_Utility.getIntegratedCircuit(1), + null, + null, + Materials.Platinum.getNuggets(2), + null, + 600, + 120, + Materials.Platinum.mMeltingPoint); + + GT_Values.RA.addChemicalRecipe( + PTMetallicPowder.get(dust), + GT_Utility.getIntegratedCircuit(1), + AquaRegia.getFluidOrGas(1000), + PTConcentrate.getFluidOrGas(1000), + PTResidue.get(dustTiny), + 250); + GT_Values.RA.addChemicalRecipe( + PTMetallicPowder.get(dust, 9), + GT_Utility.getIntegratedCircuit(9), + AquaRegia.getFluidOrGas(9000), + PTConcentrate.getFluidOrGas(9000), + PTResidue.get(dust), + 2250); + GT_Values.RA.addCentrifugeRecipe( + PTConcentrate.get(cell, 2), + null, + AmmoniumChloride.getFluidOrGas(400), + PDAmmonia.getFluidOrGas(400), + PTSaltCrude.get(dustTiny, 16), + PTRawPowder.get(dustTiny, 4), + Materials.NitrogenDioxide.getCells(1), + Materials.DilutedSulfuricAcid.getCells(1), + null, + null, + null, + 1200, + 30); + GT_Values.RA.addMultiblockChemicalRecipe( + new ItemStack[] {GT_Utility.getIntegratedCircuit(1)}, + new FluidStack[] {PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(400)}, + new FluidStack[] { + PDAmmonia.getFluidOrGas(400), + Materials.NitrogenDioxide.getGas(1000), + Materials.DilutedSulfuricAcid.getFluid(1000) + }, + new ItemStack[] {PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny, 4)}, + 1200, + 30); + GT_Values.RA.addMultiblockChemicalRecipe( + new ItemStack[] {GT_Utility.getIntegratedCircuit(2)}, + new FluidStack[] {PTConcentrate.getFluidOrGas(18000), AmmoniumChloride.getFluidOrGas(3600)}, + new FluidStack[] { + PDAmmonia.getFluidOrGas(3600), + Materials.NitrogenDioxide.getGas(9000), + Materials.DilutedSulfuricAcid.getFluid(9000) + }, + new ItemStack[] {PTSaltCrude.get(dust, 16), PTRawPowder.get(dust, 4)}, + 1400, + 240); + GT_Values.RA.addSifterRecipe( + PTSaltCrude.get(dust), + new ItemStack[] { + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + }, + new int[] { + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, + }, + 600, + 30); + GT_Values.RA.addBlastRecipe( PTSaltRefined.get(dust), - }, new int[] { - 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, - }, 600, 30); - GT_Values.RA.addBlastRecipe(PTSaltRefined.get(dust), GT_Utility.getIntegratedCircuit(1), null, Materials.Chlorine.getGas(87), PTMetallicPowder.get(dust), null, 200, 120, 900); - //2PtCl + Ca = 2Pt + CaCl2 - GT_Values.RA.addChemicalRecipe(PTRawPowder.get(dust, 4), Materials.Calcium.getDust(1), null, null, Materials.Platinum.getDust(2), CalciumChloride.get(dust, 3), 30); - //Pd - GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), PDAmmonia.getFluidOrGas(1000), null, 250); - GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dustTiny, 16), PDRawPowder.get(dustTiny, 2), 250); - GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust, 9), GT_Utility.getIntegratedCircuit(9), PDAmmonia.getFluidOrGas(9000), null, PDSalt.get(dust, 16), PDRawPowder.get(dust, 2), 2250); - GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), null, PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dust), 250); - GT_Values.RA.addSifterRecipe(PDSalt.get(dust), new ItemStack[]{ - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), + GT_Utility.getIntegratedCircuit(1), + null, + Materials.Chlorine.getGas(87), + PTMetallicPowder.get(dust), + null, + 200, + 120, + 900); + // 2PtCl + Ca = 2Pt + CaCl2 + GT_Values.RA.addChemicalRecipe( + PTRawPowder.get(dust, 4), + Materials.Calcium.getDust(1), + null, + null, + Materials.Platinum.getDust(2), + CalciumChloride.get(dust, 3), + 30); + // Pd + GT_Values.RA.addChemicalRecipe( PDMetallicPowder.get(dust), + GT_Utility.getIntegratedCircuit(1), + Materials.Ammonia.getGas(1000), + PDAmmonia.getFluidOrGas(1000), + null, + 250); + GT_Values.RA.addChemicalRecipe( PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - }, new int[] { - 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, - }, 600, 30); - GT_Values.RA.addChemicalRecipeForBasicMachineOnly(PDRawPowder.get(dust, 4), Materials.Empty.getCells(1), FormicAcid.getFluidOrGas(4000), Materials.Ammonia.getGas(4000), Materials.Palladium.getDust(2), Materials.Ethylene.getCells(1), 250, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{PDRawPowder.get(dust, 4)}, new FluidStack[]{FormicAcid.getFluidOrGas(4000)}, new FluidStack[]{Materials.Ammonia.getGas(4000), Materials.Ethylene.getGas(1000), Materials.Water.getFluid(1000)}, new ItemStack[]{Materials.Palladium.getDust(2)}, 250, 30); - //Na2SO4 + 2H = 2Na + H2SO4 - GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust, 7), Materials.Hydrogen.getCells(2), null, Materials.SulfuricAcid.getFluid(1000), Materials.Sodium.getDust(2), Materials.Empty.getCells(2), 30); - //K2S2O7 - // GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust,6), null, 30); - //Rh/Os/Ir/Ru - GT_Values.RA.addBlastRecipe(PTResidue.get(dust), GT_Utility.getIntegratedCircuit(11), PotassiumDisulfate.getMolten(360), RHSulfate.getFluidOrGas(360), LeachResidue.get(dust), null, 200, 120, 775); - - //Ru - GT_Values.RA.addBlastRecipe(LeachResidue.get(dust, 10), Materials.Saltpeter.getDust(10), Materials.SaltWater.getFluid(1000), GT_ModHandler.getSteam(1000), SodiumRuthenate.get(dust, 3), IrOsLeachResidue.get(dust, 6), 200, 120, 775); - GT_Values.RA.addChemicalRecipe(SodiumRuthenate.get(dust, 6), Materials.Chlorine.getCells(3), null, RutheniumTetroxideSollution.getFluidOrGas(9000), Materials.Empty.getCells(3), 300); - GT_Values.RA.addFluidHeaterRecipe(GT_Utility.getIntegratedCircuit(1), RutheniumTetroxideSollution.getFluidOrGas(800), HotRutheniumTetroxideSollution.getFluidOrGas(800), 300, 480); - GT_Values.RA.addCrackingRecipe(17, RutheniumTetroxideSollution.getFluidOrGas(1000), GT_ModHandler.getSteam(1000), HotRutheniumTetroxideSollution.getFluidOrGas(2000), 150, 480); - GT_Values.RA.addDistillationTowerRecipe(HotRutheniumTetroxideSollution.getFluidOrGas(9000), new FluidStack[]{ - Materials.Water.getFluid(1800), - RutheniumTetroxide.getFluidOrGas(7200) - }, Materials.Salt.getDust(6), 1500, 480); - GT_Values.RA.addChemicalRecipe(RutheniumTetroxide.get(dust, 1), Materials.HydrochloricAcid.getCells(6), null, Materials.Water.getFluid(2000), Ruthenium.get(dust), Materials.Chlorine.getCells(6), 300); - - //Os - GT_Values.RA.addBlastRecipe(IrOsLeachResidue.get(dust, 4), GT_Utility.getIntegratedCircuit(11), Materials.HydrochloricAcid.getFluid(1000), AcidicOsmiumSolution.getFluidOrGas(2000), IrLeachResidue.get(dust, 2), null, 200, 120, 775); - GT_Values.RA.addDistillationTowerRecipe(AcidicOsmiumSolution.getFluidOrGas(1000), new FluidStack[]{OsmiumSolution.getFluidOrGas(100), Materials.Water.getFluid(900)}, null, 150, BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addChemicalRecipe(OsmiumSolution.get(cell), Materials.HydrochloricAcid.getCells(6), null, Materials.Water.getFluid(2000), Materials.Osmium.getDust(1), Materials.Chlorine.getCells(7), 300); - - //Ir - GT_Values.RA.addBlastRecipe(IrLeachResidue.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, PGSDResidue.get(dust), IridiumDioxide.get(dust), 200, 120, 775); - GT_Values.RA.addChemicalRecipe(IridiumDioxide.get(dust), Materials.HydrochloricAcid.getCells(1), null, AcidicIridiumSolution.getFluidOrGas(1000), Materials.Empty.getCells(1), null, 300); - GT_Values.RA.addChemicalRecipe(AcidicIridiumSolution.get(cell), AmmoniumChloride.get(cell, 3), null, Materials.Ammonia.getGas(3000), Materials.Empty.getCells(4), IridiumChloride.get(dust), 300); - GT_Values.RA.addChemicalRecipe(IridiumChloride.get(dust), Materials.Calcium.getDust(3), null, CalciumChloride.getFluidOrGas(3000), PGSDResidue2.get(dust), Materials.Iridium.getDust(1), 300, 1920); - - //Rh - GT_Values.RA.addChemicalRecipe(RHSulfate.get(cell, 11), GT_Utility.getIntegratedCircuit(1), Materials.Water.getFluid(10000), Materials.Potassium.getMolten(2000), RHSulfateSolution.get(cell, 11), LeachResidue.get(dustTiny, 10), 300, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(3)}, new FluidStack[]{Materials.Water.getFluid(36000), RHSulfate.getFluidOrGas(39600)}, new FluidStack[]{Materials.Potassium.getMolten(7200), RHSulfateSolution.getFluidOrGas(39600)}, new ItemStack[]{LeachResidue.get(dust, 4)}, 1200, 30); - - GT_Values.RA.addChemicalRecipe(Materials.Zinc.getDust(1), null, RHSulfateSolution.getFluidOrGas(1000), null, ZincSulfate.get(dust,6), CrudeRhMetall.get(dust), 300); - GT_Values.RA.addBlastRecipe(CrudeRhMetall.get(dust), Materials.Salt.getDust(1), Materials.Chlorine.getGas(1000), null, RHSalt.get(dust, 3), null, 300, 120, 600); - GT_Values.RA.addMixerRecipe(RHSalt.get(dust, 10), null, null, null, Materials.Water.getFluid(2000), RHSaltSolution.getFluidOrGas(2000), null, 300, 30); - GT_Values.RA.addChemicalRecipe(SodiumNitrate.get(dust, 5), GT_Utility.getIntegratedCircuit(1), RHSaltSolution.getFluidOrGas(1000), null, RHNitrate.get(dust), Materials.Salt.getDust(2), 300); - //Na + HNO3 = NaNO3 + H - GT_Values.RA.addChemicalRecipe(Materials.Sodium.getDust(1), GT_Values.NI, Materials.NitricAcid.getFluid(1000), Materials.Hydrogen.getGas(1000), SodiumNitrate.get(dust, 5), 8, 60); - GT_Values.RA.addSifterRecipe(RHNitrate.get(dust), new ItemStack[]{ - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), + GT_Utility.getIntegratedCircuit(1), + PDAmmonia.getFluidOrGas(1000), + null, + PDSalt.get(dustTiny, 16), + PDRawPowder.get(dustTiny, 2), + 250); + GT_Values.RA.addChemicalRecipe( + PDMetallicPowder.get(dust, 9), + GT_Utility.getIntegratedCircuit(9), + PDAmmonia.getFluidOrGas(9000), + null, + PDSalt.get(dust, 16), + PDRawPowder.get(dust, 2), + 2250); + GT_Values.RA.addChemicalRecipe( + GT_Utility.getIntegratedCircuit(2), null, PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dust), 250); + GT_Values.RA.addSifterRecipe( + PDSalt.get(dust), + new ItemStack[] { + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + }, + new int[] { + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, + }, + 600, + 30); + GT_Values.RA.addChemicalRecipeForBasicMachineOnly( + PDRawPowder.get(dust, 4), + Materials.Empty.getCells(1), + FormicAcid.getFluidOrGas(4000), + Materials.Ammonia.getGas(4000), + Materials.Palladium.getDust(2), + Materials.Ethylene.getCells(1), + 250, + 30); + GT_Values.RA.addMultiblockChemicalRecipe( + new ItemStack[] {PDRawPowder.get(dust, 4)}, + new FluidStack[] {FormicAcid.getFluidOrGas(4000)}, + new FluidStack[] { + Materials.Ammonia.getGas(4000), Materials.Ethylene.getGas(1000), Materials.Water.getFluid(1000) + }, + new ItemStack[] {Materials.Palladium.getDust(2)}, + 250, + 30); + // Na2SO4 + 2H = 2Na + H2SO4 + GT_Values.RA.addChemicalRecipe( + Sodiumsulfate.get(dust, 7), + Materials.Hydrogen.getCells(2), + null, + Materials.SulfuricAcid.getFluid(1000), + Materials.Sodium.getDust(2), + Materials.Empty.getCells(2), + 30); + // K2S2O7 + // GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), + // Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust,6), null, 30); + // Rh/Os/Ir/Ru + GT_Values.RA.addBlastRecipe( + PTResidue.get(dust), + GT_Utility.getIntegratedCircuit(11), + PotassiumDisulfate.getMolten(360), + RHSulfate.getFluidOrGas(360), + LeachResidue.get(dust), + null, + 200, + 120, + 775); + + // Ru + GT_Values.RA.addBlastRecipe( + LeachResidue.get(dust, 10), + Materials.Saltpeter.getDust(10), + Materials.SaltWater.getFluid(1000), + GT_ModHandler.getSteam(1000), + SodiumRuthenate.get(dust, 3), + IrOsLeachResidue.get(dust, 6), + 200, + 120, + 775); + GT_Values.RA.addChemicalRecipe( + SodiumRuthenate.get(dust, 6), + Materials.Chlorine.getCells(3), + null, + RutheniumTetroxideSollution.getFluidOrGas(9000), + Materials.Empty.getCells(3), + 300); + GT_Values.RA.addFluidHeaterRecipe( + GT_Utility.getIntegratedCircuit(1), + RutheniumTetroxideSollution.getFluidOrGas(800), + HotRutheniumTetroxideSollution.getFluidOrGas(800), + 300, + 480); + GT_Values.RA.addCrackingRecipe( + 17, + RutheniumTetroxideSollution.getFluidOrGas(1000), + GT_ModHandler.getSteam(1000), + HotRutheniumTetroxideSollution.getFluidOrGas(2000), + 150, + 480); + GT_Values.RA.addDistillationTowerRecipe( + HotRutheniumTetroxideSollution.getFluidOrGas(9000), + new FluidStack[] {Materials.Water.getFluid(1800), RutheniumTetroxide.getFluidOrGas(7200)}, + Materials.Salt.getDust(6), + 1500, + 480); + GT_Values.RA.addChemicalRecipe( + RutheniumTetroxide.get(dust, 1), + Materials.HydrochloricAcid.getCells(6), + null, + Materials.Water.getFluid(2000), + Ruthenium.get(dust), + Materials.Chlorine.getCells(6), + 300); + + // Os + GT_Values.RA.addBlastRecipe( + IrOsLeachResidue.get(dust, 4), + GT_Utility.getIntegratedCircuit(11), + Materials.HydrochloricAcid.getFluid(1000), + AcidicOsmiumSolution.getFluidOrGas(2000), + IrLeachResidue.get(dust, 2), + null, + 200, + 120, + 775); + GT_Values.RA.addDistillationTowerRecipe( + AcidicOsmiumSolution.getFluidOrGas(1000), + new FluidStack[] {OsmiumSolution.getFluidOrGas(100), Materials.Water.getFluid(900)}, + null, + 150, + BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addChemicalRecipe( + OsmiumSolution.get(cell), + Materials.HydrochloricAcid.getCells(6), + null, + Materials.Water.getFluid(2000), + Materials.Osmium.getDust(1), + Materials.Chlorine.getCells(7), + 300); + + // Ir + GT_Values.RA.addBlastRecipe( + IrLeachResidue.get(dust), + GT_Utility.getIntegratedCircuit(1), + null, + null, + PGSDResidue.get(dust), + IridiumDioxide.get(dust), + 200, + 120, + 775); + GT_Values.RA.addChemicalRecipe( + IridiumDioxide.get(dust), + Materials.HydrochloricAcid.getCells(1), + null, + AcidicIridiumSolution.getFluidOrGas(1000), + Materials.Empty.getCells(1), + null, + 300); + GT_Values.RA.addChemicalRecipe( + AcidicIridiumSolution.get(cell), + AmmoniumChloride.get(cell, 3), + null, + Materials.Ammonia.getGas(3000), + Materials.Empty.getCells(4), + IridiumChloride.get(dust), + 300); + GT_Values.RA.addChemicalRecipe( + IridiumChloride.get(dust), + Materials.Calcium.getDust(3), + null, + CalciumChloride.getFluidOrGas(3000), + PGSDResidue2.get(dust), + Materials.Iridium.getDust(1), + 300, + 1920); + + // Rh + GT_Values.RA.addChemicalRecipe( + RHSulfate.get(cell, 11), + GT_Utility.getIntegratedCircuit(1), + Materials.Water.getFluid(10000), + Materials.Potassium.getMolten(2000), + RHSulfateSolution.get(cell, 11), + LeachResidue.get(dustTiny, 10), + 300, + 30); + GT_Values.RA.addMultiblockChemicalRecipe( + new ItemStack[] {GT_Utility.getIntegratedCircuit(3)}, + new FluidStack[] {Materials.Water.getFluid(36000), RHSulfate.getFluidOrGas(39600)}, + new FluidStack[] {Materials.Potassium.getMolten(7200), RHSulfateSolution.getFluidOrGas(39600)}, + new ItemStack[] {LeachResidue.get(dust, 4)}, + 1200, + 30); + + GT_Values.RA.addChemicalRecipe( + Materials.Zinc.getDust(1), + null, + RHSulfateSolution.getFluidOrGas(1000), + null, + ZincSulfate.get(dust, 6), + CrudeRhMetall.get(dust), + 300); + GT_Values.RA.addBlastRecipe( + CrudeRhMetall.get(dust), + Materials.Salt.getDust(1), + Materials.Chlorine.getGas(1000), + null, + RHSalt.get(dust, 3), + null, + 300, + 120, + 600); + GT_Values.RA.addMixerRecipe( + RHSalt.get(dust, 10), + null, + null, + null, + Materials.Water.getFluid(2000), + RHSaltSolution.getFluidOrGas(2000), + null, + 300, + 30); + GT_Values.RA.addChemicalRecipe( + SodiumNitrate.get(dust, 5), + GT_Utility.getIntegratedCircuit(1), + RHSaltSolution.getFluidOrGas(1000), + null, + RHNitrate.get(dust), + Materials.Salt.getDust(2), + 300); + // Na + HNO3 = NaNO3 + H + GT_Values.RA.addChemicalRecipe( + Materials.Sodium.getDust(1), + GT_Values.NI, + Materials.NitricAcid.getFluid(1000), + Materials.Hydrogen.getGas(1000), + SodiumNitrate.get(dust, 5), + 8, + 60); + GT_Values.RA.addSifterRecipe( + RHNitrate.get(dust), + new ItemStack[] { + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + }, + new int[] { + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, + }, + 600, + 30); + GT_Values.RA.addMixerRecipe( RhFilterCake.get(dust), - }, new int[] { - 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, - }, 600, 30); - GT_Values.RA.addMixerRecipe(RhFilterCake.get(dust), null, null, null, Materials.Water.getFluid(1000), RHFilterCakeSolution.getFluidOrGas(1000), null, 300, 30); - GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), null, RHFilterCakeSolution.getFluidOrGas(1000), null, ReRh.get(dust), null, 300); - GT_Values.RA.addChemicalRecipe(ReRh.get(dust), Materials.Empty.getCells(1), Materials.HydrochloricAcid.getFluid(1000), Materials.Chlorine.getGas(1000), Rhodium.get(dust), Materials.Ammonia.getCells(1), 300); + null, + null, + null, + Materials.Water.getFluid(1000), + RHFilterCakeSolution.getFluidOrGas(1000), + null, + 300, + 30); + GT_Values.RA.addChemicalRecipe( + GT_Utility.getIntegratedCircuit(2), + null, + RHFilterCakeSolution.getFluidOrGas(1000), + null, + ReRh.get(dust), + null, + 300); + GT_Values.RA.addChemicalRecipe( + ReRh.get(dust), + Materials.Empty.getCells(1), + Materials.HydrochloricAcid.getFluid(1000), + Materials.Chlorine.getGas(1000), + Rhodium.get(dust), + Materials.Ammonia.getCells(1), + 300); } private static boolean materialsContains(Materials one, ISubTagContainer other) { - if (one == null || one.mMaterialList == null || one.mMaterialList.isEmpty()) - return false; - for (MaterialStack stack : one.mMaterialList) - if (stack.mMaterial.equals(other)) - return true; + if (one == null || one.mMaterialList == null || one.mMaterialList.isEmpty()) return false; + for (MaterialStack stack : one.mMaterialList) if (stack.mMaterial.equals(other)) return true; return false; } - @SuppressWarnings({"unchecked","rawtypes"}) + @SuppressWarnings({"unchecked", "rawtypes"}) public static void replacePureElements() { - //furnace + // furnace for (Object entry : FurnaceRecipes.smelting().getSmeltingList().entrySet()) { Map.Entry realEntry = (Map.Entry) entry; - if (GT_Utility.isStackValid(realEntry.getKey()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getKey())) { + if (GT_Utility.isStackValid(realEntry.getKey()) + && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getKey())) { ItemData association = GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()); - if ((!association.mPrefix.equals(dust) && !association.mPrefix.equals(dustTiny)) || !association.mMaterial.mMaterial.equals(Materials.Platinum)) - if (GT_Utility.isStackValid(realEntry.getValue()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())){ + if ((!association.mPrefix.equals(dust) && !association.mPrefix.equals(dustTiny)) + || !association.mMaterial.mMaterial.equals(Materials.Platinum)) + if (GT_Utility.isStackValid(realEntry.getValue()) + && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())) { ItemData ass = GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()); if (ass.mMaterial.mMaterial.equals(Materials.Platinum)) if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) - realEntry.setValue(PTMetallicPowder.get(ass.mPrefix == nugget ? dustTiny : dust, ((ItemStack) realEntry.getValue()).stackSize * 2)); - else if (ass.mMaterial.mMaterial.equals(Materials.Palladium)) - if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) - realEntry.setValue(PDMetallicPowder.get(ass.mPrefix == nugget ? dustTiny : dust, ((ItemStack) realEntry.getValue()).stackSize * 2)); + realEntry.setValue(PTMetallicPowder.get( + ass.mPrefix == nugget ? dustTiny : dust, + ((ItemStack) realEntry.getValue()).stackSize * 2)); + else if (ass.mMaterial.mMaterial.equals(Materials.Palladium)) + if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) + realEntry.setValue(PDMetallicPowder.get( + ass.mPrefix == nugget ? dustTiny : dust, + ((ItemStack) realEntry.getValue()).stackSize * 2)); } } } - //vanilla crafting + // vanilla crafting CraftingManager.getInstance().getRecipeList().forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); - //gt crafting + // gt crafting try { - ((List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null)).forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); + ((List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true) + .get(null)) + .forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); } catch (IllegalAccessException e) { e.printStackTrace(); } - //gt machines + // gt machines maploop: for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - if (map == GT_Recipe.GT_Recipe_Map.sFusionRecipes || map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes) - continue; + if (map == GT_Recipe.GT_Recipe_Map.sFusionRecipes + || map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes + || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes) continue; HashSet toDel = new HashSet<>(); recipeloop: for (GT_Recipe recipe : map.mRecipeList) { - if (recipe.mFakeRecipe) - continue maploop; + if (recipe.mFakeRecipe) continue maploop; for (int i = 0; i < recipe.mFluidOutputs.length; i++) { - if (map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes)) - continue maploop; - else if (map.equals(GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sChemicalRecipes)) { + if (map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes)) continue maploop; + else if (map.equals(GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) + || map.equals(GT_Recipe.GT_Recipe_Map.sChemicalRecipes)) { if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) toDel.add(recipe); else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) @@ -270,12 +713,11 @@ public class PlatinumSludgeOverHaul { else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) { recipe.mFluidOutputs[i] = AcidicIridiumSolution.getFluidOrGas(1000); recipe.reloadOwner(); - } - else if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) { + } else if (GT_Utility.areFluidsEqual( + Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) { recipe.mFluidOutputs[i] = PTConcentrate.getFluidOrGas(1000); recipe.reloadOwner(); - } - else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) { + } else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) { recipe.mFluidOutputs[i] = AcidicOsmiumSolution.getFluidOrGas(1000); recipe.reloadOwner(); } @@ -293,99 +735,155 @@ public class PlatinumSludgeOverHaul { } } for (int i = 0; i < recipe.mOutputs.length; i++) { - if (!GT_Utility.isStackValid(recipe.mOutputs[i])) - continue; - if (BW_Util.areStacksEqualOrNull(Ruthenium.get(dust), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustImpure), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustPure), recipe.mOutputs[i])) { + if (!GT_Utility.isStackValid(recipe.mOutputs[i])) continue; + if (BW_Util.areStacksEqualOrNull(Ruthenium.get(dust), recipe.mOutputs[i]) + || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustImpure), recipe.mOutputs[i]) + || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustPure), recipe.mOutputs[i])) { if (!BW_Util.areStacksEqualOrNull(Ruthenium.get(ingot), recipe.mInputs[0])) { for (int j = 0; j < recipe.mInputs.length; j++) - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; int amount = recipe.mOutputs[i].stackSize * 2; recipe.mOutputs[i] = LeachResidue.get(dust, amount); recipe.reloadOwner(); } } - if (BW_Util.areStacksEqualOrNull(Rhodium.get(dust), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Rhodium.get(dustImpure), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Rhodium.get(dustPure), recipe.mOutputs[i])) { + if (BW_Util.areStacksEqualOrNull(Rhodium.get(dust), recipe.mOutputs[i]) + || BW_Util.areStacksEqualOrNull(Rhodium.get(dustImpure), recipe.mOutputs[i]) + || BW_Util.areStacksEqualOrNull(Rhodium.get(dustPure), recipe.mOutputs[i])) { if (!BW_Util.areStacksEqualOrNull(Rhodium.get(ingot), recipe.mInputs[0])) { for (int j = 0; j < recipe.mInputs.length; j++) - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; int amount = recipe.mOutputs[i].stackSize * 2; recipe.mOutputs[i] = CrudeRhMetall.get(dust, amount); recipe.reloadOwner(); } } - if (!BW_Util.checkStackAndPrefix(recipe.mOutputs[i])) - continue; - //Pt - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Platinum)) { + if (!BW_Util.checkStackAndPrefix(recipe.mOutputs[i])) continue; + // Pt + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mMaterial + .mMaterial + .equals(Materials.Platinum)) { for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dust) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustImpure) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dust), amount * 2); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dustSmall), amount * 2); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dustTiny), amount * 2); recipe.reloadOwner(); } - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Palladium)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mMaterial + .mMaterial + .equals(Materials.Palladium)) { for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dust) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustImpure) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dust), amount * 4); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dustSmall), amount * 4); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dustTiny), amount * 4); recipe.reloadOwner(); } - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Osmium)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mMaterial + .mMaterial + .equals(Materials.Osmium)) { for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dust) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustImpure) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dust), amount); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dustSmall), amount); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dustTiny), amount); recipe.reloadOwner(); } - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Iridium)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mMaterial + .mMaterial + .equals(Materials.Iridium)) { for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dust) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustImpure) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dust), amount); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dustSmall), amount); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dustTiny), amount); recipe.reloadOwner(); @@ -395,26 +893,34 @@ public class PlatinumSludgeOverHaul { } map.mRecipeList.removeAll(toDel); } - //TODO: remove EnderIO recipes + // TODO: remove EnderIO recipes - //fix HV tier + // fix HV tier PlatinumSludgeOverHaul.replaceHVCircuitMaterials(); - //add new recipes + // add new recipes PlatinumSludgeOverHaul.runHelperrecipes(); } @SuppressWarnings("deprecation") - private static void replaceHVCircuitMaterials(){ - GT_Values.RA.addMixerRecipe(Materials.Redstone.getDust(1),Materials.Electrum.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,Materials.Nikolite.getDust(8),1800,120); - for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList){ - if (recipe.mEUt > 512) - continue; + private static void replaceHVCircuitMaterials() { + GT_Values.RA.addMixerRecipe( + Materials.Redstone.getDust(1), + Materials.Electrum.getDust(1), + GT_Utility.getIntegratedCircuit(1), + null, + null, + null, + Materials.Nikolite.getDust(8), + 1800, + 120); + for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList) { + if (recipe.mEUt > 512) continue; if (BW_Util.checkStackAndPrefix(recipe.mOutputs[0])) { for (int i = 0; i < recipe.mInputs.length; i++) { ItemStack stack = recipe.mInputs[i]; ItemData ass = GT_OreDictUnificator.getAssociation(stack); if (BW_Util.checkStackAndPrefix(stack) && ass.mMaterial.mMaterial.equals(Materials.Platinum)) { - recipe.mInputs[i] = GT_OreDictUnificator.get(ass.mPrefix,Materials.BlueAlloy,stack.stackSize); + recipe.mInputs[i] = GT_OreDictUnificator.get(ass.mPrefix, Materials.BlueAlloy, stack.stackSize); recipe.reloadOwner(); } } @@ -425,18 +931,19 @@ public class PlatinumSludgeOverHaul { private static void setnewMaterialInRecipe(Object obj) { String inputName = "output"; String inputItemName = "input"; - if (!(obj instanceof ShapedOreRecipe || obj instanceof ShapelessOreRecipe)){ - if (obj instanceof ShapedRecipes || (obj instanceof ShapelessRecipes)) { - inputName = "recipeOutput"; - inputItemName = "recipeItems"; + if (!(obj instanceof ShapedOreRecipe || obj instanceof ShapelessOreRecipe)) { + if (obj instanceof ShapedRecipes || (obj instanceof ShapelessRecipes)) { + inputName = "recipeOutput"; + inputItemName = "recipeItems"; + } else if (LoaderReference.miscutils) { + try { + if (Class.forName("gtPlusPlus.api.objects.minecraft.ShapedRecipe") + .isAssignableFrom(obj.getClass())) + obj = CachedReflectionUtils.getField(obj.getClass(), "mRecipe") + .get(obj); + } catch (ClassNotFoundException | IllegalAccessException e) { + e.printStackTrace(); } - else if (LoaderReference.miscutils) { - try { - if (Class.forName("gtPlusPlus.api.objects.minecraft.ShapedRecipe").isAssignableFrom(obj.getClass())) - obj = CachedReflectionUtils.getField(obj.getClass(),"mRecipe").get(obj); - } catch (ClassNotFoundException | IllegalAccessException e) { - e.printStackTrace(); - } } } @@ -444,18 +951,15 @@ public class PlatinumSludgeOverHaul { ItemStack otpt = recipe.getRecipeOutput(); Field out = CachedReflectionUtils.getDeclaredField(recipe.getClass(), inputName); - if (out == null) - out = CachedReflectionUtils.getField(recipe.getClass(), inputName); - + if (out == null) out = CachedReflectionUtils.getField(recipe.getClass(), inputName); Field in = CachedReflectionUtils.getDeclaredField(recipe.getClass(), inputItemName); - if (in == null) - in = CachedReflectionUtils.getField(recipe.getClass(), inputItemName); - if (in == null) - return; + if (in == null) in = CachedReflectionUtils.getField(recipe.getClass(), inputItemName); + if (in == null) return; - //directly copied from the apache commons collection, cause GTNH had problems with that particular function for some reason? - //this part here is NOT MIT LICENSED BUT LICSENSED UNDER THE Apache License, Version 2.0! + // directly copied from the apache commons collection, cause GTNH had problems with that particular function for + // some reason? + // this part here is NOT MIT LICENSED BUT LICSENSED UNDER THE Apache License, Version 2.0! try { if (Modifier.isFinal(in.getModifiers())) { // Do all JREs implement Field with a private ivar called "modifiers"? @@ -488,32 +992,28 @@ public class PlatinumSludgeOverHaul { } if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Platinum.getDust(1), true)) { - if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Platinum)) - return; + if (PlatinumSludgeOverHaul.checkRecipe(input, Materials.Platinum)) return; try { out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize * 2)); } catch (IllegalAccessException e) { e.printStackTrace(); } } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Palladium.getDust(1), true)) { - if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Palladium)) - return; + if (PlatinumSludgeOverHaul.checkRecipe(input, Materials.Palladium)) return; try { out.set(recipe, PDMetallicPowder.get(dust, otpt.stackSize * 2)); } catch (IllegalAccessException e) { e.printStackTrace(); } } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Iridium.getDust(1), true)) { - if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Iridium)) - return; + if (PlatinumSludgeOverHaul.checkRecipe(input, Materials.Iridium)) return; try { out.set(recipe, IrLeachResidue.get(dust, otpt.stackSize)); } catch (IllegalAccessException e) { e.printStackTrace(); } } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Osmium.getDust(1), true)) { - if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Osmium)) - return; + if (PlatinumSludgeOverHaul.checkRecipe(input, Materials.Osmium)) return; try { out.set(recipe, IrOsLeachResidue.get(dust, otpt.stackSize)); } catch (IllegalAccessException e) { @@ -522,29 +1022,24 @@ public class PlatinumSludgeOverHaul { } } - @SuppressWarnings({"rawtypes","unchecked"}) - private static boolean checkRecipe(Object input,Materials mat){ + @SuppressWarnings({"rawtypes", "unchecked"}) + private static boolean checkRecipe(Object input, Materials mat) { if (input instanceof List || input instanceof Object[]) { - Set lists = new HashSet(), stacks= new HashSet(); - List ip = input instanceof List ? (List)input : new ArrayList(); - Object[] ip2 = input instanceof Object[] ? (Object[])input : new Object[0]; - - for (Object o : ip){ - if (o instanceof List) - lists.add(o); - else if (o instanceof ItemStack) - stacks.add(o); + Set lists = new HashSet(), stacks = new HashSet(); + List ip = input instanceof List ? (List) input : new ArrayList(); + Object[] ip2 = input instanceof Object[] ? (Object[]) input : new Object[0]; + + for (Object o : ip) { + if (o instanceof List) lists.add(o); + else if (o instanceof ItemStack) stacks.add(o); } - for (Object o : ip2){ - if (o instanceof List) - lists.add(o); - else if (o instanceof ItemStack) - stacks.add(o); + for (Object o : ip2) { + if (o instanceof List) lists.add(o); + else if (o instanceof ItemStack) stacks.add(o); } for (Object o : lists) { - if (!((List) o).isEmpty()) - stacks.add(((List) o).get(0)); + if (!((List) o).isEmpty()) stacks.add(((List) o).get(0)); } for (Object stack : stacks) { @@ -557,13 +1052,16 @@ public class PlatinumSludgeOverHaul { boolean allSame = false; for (Object stack : stacks) { if (stack instanceof ItemStack) { - allSame = BW_Util.checkStackAndPrefix((ItemStack) stack) && GT_OreDictUnificator.getAssociation((ItemStack) stack).mMaterial.mMaterial.equals(mat); + allSame = BW_Util.checkStackAndPrefix((ItemStack) stack) + && GT_OreDictUnificator.getAssociation((ItemStack) stack) + .mMaterial + .mMaterial + .equals(mat); } else { allSame = false; break; } - if (!allSame) - break; + if (!allSame) break; } return allSame; } @@ -571,47 +1069,51 @@ public class PlatinumSludgeOverHaul { } private static boolean isInBlackList(ItemStack stack) { - if (stack == null) - return true; + if (stack == null) return true; - if (stack.getItem() instanceof BW_MetaGenerated_Items) - return true; + if (stack.getItem() instanceof BW_MetaGenerated_Items) return true; - if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(MainMod.MOD_ID)) - return true; + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(MainMod.MOD_ID)) return true; - if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(BartWorksCrossmod.MOD_ID)) - return true; + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(BartWorksCrossmod.MOD_ID)) return true; - if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals("dreamcraft") && !stack.getUnlocalizedName().contains("dust") && !stack.getUnlocalizedName().contains("Dust") ) - return true; + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals("dreamcraft") + && !stack.getUnlocalizedName().contains("dust") + && !stack.getUnlocalizedName().contains("Dust")) return true; - if (Block.getBlockFromItem(stack.getItem()) instanceof GT_Generic_Block && !(Block.getBlockFromItem(stack.getItem()) instanceof GT_Block_Ores_Abstract)) - return true; + if (Block.getBlockFromItem(stack.getItem()) instanceof GT_Generic_Block + && !(Block.getBlockFromItem(stack.getItem()) instanceof GT_Block_Ores_Abstract)) return true; - if (Arrays.stream(ItemList.values()).filter(ItemList::hasBeenSet).anyMatch(e -> !BW_Util.checkStackAndPrefix(stack) && GT_Utility.areStacksEqual(e.get(1), stack, true))) + if (Arrays.stream(ItemList.values()) + .filter(ItemList::hasBeenSet) + .anyMatch(e -> !BW_Util.checkStackAndPrefix(stack) && GT_Utility.areStacksEqual(e.get(1), stack, true))) return true; if (stack.getItem() instanceof GT_Generic_Item) { - if (!BW_Util.checkStackAndPrefix(stack)) - return false; - return (!Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mPrefix)) || Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); + if (!BW_Util.checkStackAndPrefix(stack)) return false; + return (!Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST) + .contains(GT_OreDictUnificator.getAssociation(stack).mPrefix)) + || Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST) + .contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); } if (LoaderReference.miscutils) { try { - if (Class.forName("gtPlusPlus.core.item.base.BaseItemComponent").isAssignableFrom(stack.getItem().getClass()) && !(stack.getUnlocalizedName().contains("dust") || stack.getUnlocalizedName().contains("Dust"))) - return true; - if (Class.forName("gtPlusPlus.core.block.base.BlockBaseModular").isAssignableFrom(Block.getBlockFromItem(stack.getItem()).getClass())) - return true; + if (Class.forName("gtPlusPlus.core.item.base.BaseItemComponent") + .isAssignableFrom(stack.getItem().getClass()) + && !(stack.getUnlocalizedName().contains("dust") + || stack.getUnlocalizedName().contains("Dust"))) return true; + if (Class.forName("gtPlusPlus.core.block.base.BlockBaseModular") + .isAssignableFrom( + Block.getBlockFromItem(stack.getItem()).getClass())) return true; } catch (ClassNotFoundException e) { e.printStackTrace(); } } - if (!BW_Util.checkStackAndPrefix(stack)) - return false; + if (!BW_Util.checkStackAndPrefix(stack)) return false; - return Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); + return Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST) + .contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index fc4209ed27..58c0811d93 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material; +import static net.minecraft.util.EnumChatFormatting.DARK_PURPLE; +import static net.minecraft.util.EnumChatFormatting.GREEN; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.StaticRecipeChangeLoaders; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; @@ -36,15 +39,11 @@ import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - import java.lang.reflect.InvocationTargetException; import java.nio.ByteBuffer; import java.util.*; - -import static net.minecraft.util.EnumChatFormatting.DARK_PURPLE; -import static net.minecraft.util.EnumChatFormatting.GREEN; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; @SuppressWarnings("ALL") public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @@ -53,20 +52,20 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static final LinkedHashMap werkstoffHashMap = new LinkedHashMap<>(); public static final LinkedHashMap werkstoffNameHashMap = new LinkedHashMap<>(); - public static final Map modNameOverrides = new HashMap(){{ - put("GalaxySpace", DARK_PURPLE + "GalaxySpace"); - }}; + public static final Map modNameOverrides = new HashMap() { + { + put("GalaxySpace", DARK_PURPLE + "GalaxySpace"); + } + }; - private static final List BWModNames = Arrays.asList( - MainMod.NAME, - BartWorksCrossmod.NAME, - MaterialsInjector.NAME - ); + private static final List BWModNames = + Arrays.asList(MainMod.NAME, BartWorksCrossmod.NAME, MaterialsInjector.NAME); private static final HashSet idHashSet = new HashSet<>(); private static final Werkstoff.Stats DEFAULT_NULL_STATS = new Werkstoff.Stats(); - private static final Werkstoff.GenerationFeatures DEFAULT_NULL_GENERATION_FEATURES = new Werkstoff.GenerationFeatures().disable(); + private static final Werkstoff.GenerationFeatures DEFAULT_NULL_GENERATION_FEATURES = + new Werkstoff.GenerationFeatures().disable(); public static Werkstoff default_null_Werkstoff; private final HashSet ADDITIONAL_OREDICT = new HashSet<>(); @@ -94,7 +93,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public static void init() { - Werkstoff.default_null_Werkstoff = new Werkstoff(new short[3], "_NULL", "Default null Werkstoff", Werkstoff.DEFAULT_NULL_STATS, Werkstoff.Types.UNDEFINED, Werkstoff.DEFAULT_NULL_GENERATION_FEATURES, -1, TextureSet.SET_NONE); + Werkstoff.default_null_Werkstoff = new Werkstoff( + new short[3], + "_NULL", + "Default null Werkstoff", + Werkstoff.DEFAULT_NULL_STATS, + Werkstoff.Types.UNDEFINED, + Werkstoff.DEFAULT_NULL_GENERATION_FEATURES, + -1, + TextureSet.SET_NONE); } /** @@ -104,19 +111,18 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { * @param type - self explainatory * @param mID > 31_766 && <= 32_767 */ - public Werkstoff(Materials materials, Werkstoff.GenerationFeatures generationFeatures, Types type, int mID){ - this( materials.mRGBa, - materials.mDefaultLocalName, - materials.getToolTip(), - type == null ? materials.mElement != null ? Types.ELEMENT : Types.UNDEFINED : type, - generationFeatures, - mID, - materials.mIconSet, - (List) materials.mOreByProducts, - new Pair<>(materials, 1) - ); - if(!(mID > 31_766 && mID <= 32_767)) - throw new IllegalArgumentException(); + public Werkstoff(Materials materials, Werkstoff.GenerationFeatures generationFeatures, Types type, int mID) { + this( + materials.mRGBa, + materials.mDefaultLocalName, + materials.getToolTip(), + type == null ? materials.mElement != null ? Types.ELEMENT : Types.UNDEFINED : type, + generationFeatures, + mID, + materials.mIconSet, + (List) materials.mOreByProducts, + new Pair<>(materials, 1)); + if (!(mID > 31_766 && mID <= 32_767)) throw new IllegalArgumentException(); this.stats.mass = materials.getMass(); this.stats.protons = materials.getProtons(); this.stats.meltingPoint = materials.mMeltingPoint; @@ -128,59 +134,178 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.stats.setRadioactive(materials.isRadioactive()); this.stats.setBlastFurnace(materials.mBlastFurnaceRequired); this.stats.setMeltingVoltage(120); - if (type == Types.COMPOUND){ + if (type == Types.COMPOUND) { this.stats.setElektrolysis(true); this.generationFeatures.addChemicalRecipes(); - } - else if (type == Types.MIXTURE) { + } else if (type == Types.MIXTURE) { this.stats.setCentrifuge(true); this.generationFeatures.addMixerRecipes(); } } - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { - this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), type, generationFeatures, mID, texSet, contents); + public Werkstoff( + short[] rgba, + String defaultName, + Werkstoff.Types type, + int meltingpoint, + Werkstoff.GenerationFeatures generationFeatures, + int mID, + TextureSet texSet, + Pair... contents) { + this( + rgba, + defaultName, + Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), + type, + generationFeatures, + mID, + texSet, + contents); } - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { - this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, contents); + public Werkstoff( + short[] rgba, + String defaultName, + Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, + int mID, + TextureSet texSet, + Pair... contents) { + this( + rgba, + defaultName, + Werkstoff.Types.getDefaultStatForType(type), + type, + generationFeatures, + mID, + texSet, + contents); } - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { - this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), type, generationFeatures, mID, texSet, oreByProduct, contents); + public Werkstoff( + short[] rgba, + String defaultName, + Werkstoff.Types type, + int meltingpoint, + Werkstoff.GenerationFeatures generationFeatures, + int mID, + TextureSet texSet, + List oreByProduct, + Pair... contents) { + this( + rgba, + defaultName, + Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), + type, + generationFeatures, + mID, + texSet, + oreByProduct, + contents); } - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { - this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents); + public Werkstoff( + short[] rgba, + String defaultName, + Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, + int mID, + TextureSet texSet, + List oreByProduct, + Pair... contents) { + this( + rgba, + defaultName, + Werkstoff.Types.getDefaultStatForType(type), + type, + generationFeatures, + mID, + texSet, + oreByProduct, + contents); } - public Werkstoff(short[] rgba, String toolTip, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { - this(rgba, toolTip, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents); + public Werkstoff( + short[] rgba, + String toolTip, + String defaultName, + Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, + int mID, + TextureSet texSet, + List oreByProduct, + Pair... contents) { + this( + rgba, + toolTip, + defaultName, + Werkstoff.Types.getDefaultStatForType(type), + type, + generationFeatures, + mID, + texSet, + oreByProduct, + contents); } - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { + public Werkstoff( + short[] rgba, + String defaultName, + Werkstoff.Stats stats, + Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, + int mID, + TextureSet texSet, + List oreByProduct, + Pair... contents) { this(rgba, defaultName, "", stats, type, generationFeatures, mID, texSet, contents); this.mOreByProducts.clear(); this.mOreByProducts.addAll(oreByProduct); } - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { + public Werkstoff( + short[] rgba, + String defaultName, + Werkstoff.Stats stats, + Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, + int mID, + TextureSet texSet, + Pair... contents) { this(rgba, defaultName, "", stats, type, generationFeatures, mID, texSet, contents); } - public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { + public Werkstoff( + short[] rgba, + String defaultName, + String toolTip, + Werkstoff.Stats stats, + Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, + int mID, + TextureSet texSet, + List oreByProduct, + Pair... contents) { this(rgba, defaultName, toolTip, stats, type, generationFeatures, mID, texSet, contents); this.mOreByProducts.clear(); this.mOreByProducts.addAll(oreByProduct); } - public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { + public Werkstoff( + short[] rgba, + String defaultName, + String toolTip, + Werkstoff.Stats stats, + Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, + int mID, + TextureSet texSet, + Pair... contents) { if (Werkstoff.idHashSet.contains((short) mID)) throw new UnsupportedOperationException("ID (" + mID + ") is already in use!"); Werkstoff.idHashSet.add((short) mID); - if (type == null) - type = Werkstoff.Types.UNDEFINED; + if (type == null) type = Werkstoff.Types.UNDEFINED; this.mID = (short) mID; this.defaultName = defaultName; @@ -199,28 +324,33 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (contents.length > 1) { if (p.getKey() instanceof Materials) { if (((Materials) p.getKey()).mMaterialList.size() > 1 && p.getValue() > 1) - this.toolTip += "(" + getFormula((Materials) p.getKey()) + ")" + (BW_Util.subscriptNumber(p.getValue())); + this.toolTip += "(" + getFormula((Materials) p.getKey()) + ")" + + (BW_Util.subscriptNumber(p.getValue())); else - this.toolTip += getFormula((Materials) p.getKey()) + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + this.toolTip += getFormula((Materials) p.getKey()) + + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } if (p.getKey() instanceof Werkstoff) { if (((Werkstoff) p.getKey()).CONTENTS.size() > 1 && p.getValue() > 1) - this.toolTip += "(" + getFormula((Werkstoff) p.getKey()) + ")" + (BW_Util.subscriptNumber(p.getValue())); + this.toolTip += "(" + getFormula((Werkstoff) p.getKey()) + ")" + + (BW_Util.subscriptNumber(p.getValue())); else - this.toolTip += getFormula((Werkstoff) p.getKey()) + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + this.toolTip += getFormula((Werkstoff) p.getKey()) + + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } } else { if (p.getKey() instanceof Materials) { - this.toolTip += getFormula((Materials) p.getKey()) + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + this.toolTip += getFormula((Materials) p.getKey()) + + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } else if (p.getKey() instanceof Werkstoff) - this.toolTip += getFormula((Werkstoff) p.getKey()) + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + this.toolTip += getFormula((Werkstoff) p.getKey()) + + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } } - } else - this.toolTip = toolTip; + } else this.toolTip = toolTip; -// if (this.toolTip.length() > 25) -// this.toolTip = "The formula is to long..."; + // if (this.toolTip.length() > 25) + // this.toolTip = "The formula is to long..."; // Ensure that localization key are written to the lang file GregTech_API.sAfterGTPreload.add(() -> { @@ -250,15 +380,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { count += p.getValue(); } } - if(count > 0) - this.stats = stats.setMass(tmpmass/count); + if (count > 0) this.stats = stats.setMass(tmpmass / count); } - if (this.stats.meltingPoint == 0) - this.stats.meltingPoint = 1123; + if (this.stats.meltingPoint == 0) this.stats.meltingPoint = 1123; - if (this.stats.meltingVoltage == 0) - this.stats.meltingVoltage = 120; + if (this.stats.meltingVoltage == 0) this.stats.meltingVoltage = 120; this.texSet = texSet; @@ -317,12 +444,11 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { HashSet tc_aspectStacks = new HashSet<>(); HashSet> set = new HashSet<>(); for (Pair p : this.getContents().getValue()) { - if (p.getKey() instanceof Materials) - tc_aspectStacks.addAll(((Materials) p.getKey()).mAspects); - if (p.getKey() instanceof Werkstoff) - set.addAll(Arrays.asList(((Werkstoff) p.getKey()).getTCAspects())); + if (p.getKey() instanceof Materials) tc_aspectStacks.addAll(((Materials) p.getKey()).mAspects); + if (p.getKey() instanceof Werkstoff) set.addAll(Arrays.asList(((Werkstoff) p.getKey()).getTCAspects())); } - tc_aspectStacks.forEach(tc_aspectStack -> set.add(new Pair<>(tc_aspectStack.mAspect.mAspect, (int) tc_aspectStack.mAmount))); + tc_aspectStacks.forEach(tc_aspectStack -> + set.add(new Pair<>(tc_aspectStack.mAspect.mAspect, (int) tc_aspectStack.mAmount))); this.stats.mTC_Aspects = set.toArray(new Pair[0]); } Pair[] ret = this.stats.mTC_Aspects.clone(); @@ -336,7 +462,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { final List ret = new ArrayList<>(); Arrays.stream(getTCAspects()).forEach(objectIntegerPair -> { try { - new TC_Aspects.TC_AspectStack(TC_Aspects.valueOf(((String) ThaumcraftHandler.AspectAdder.getName.invoke(objectIntegerPair.getKey())).toUpperCase(Locale.US)), objectIntegerPair.getValue()).addToAspectList(ret); + new TC_Aspects.TC_AspectStack( + TC_Aspects.valueOf(((String) ThaumcraftHandler.AspectAdder.getName.invoke( + objectIntegerPair.getKey())) + .toUpperCase(Locale.US)), + objectIntegerPair.getValue()) + .addToAspectList(ret); } catch (IllegalAccessException | InvocationTargetException ignored) { } }); @@ -353,8 +484,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public boolean containsStuff(ISubTagContainer stuff) { for (Pair pair : this.CONTENTS) { - if (pair.getKey().equals(stuff)) - return true; + if (pair.getKey().equals(stuff)) return true; } return false; } @@ -382,32 +512,23 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public ISubTagContainer getOreByProductRaw(int aNumber) { - if (this.mOreByProducts.size() == 0) - return null; - if (aNumber < 0) - aNumber = this.mOreByProducts.size() + aNumber; - while (aNumber >= this.mOreByProducts.size()) - aNumber--; + if (this.mOreByProducts.size() == 0) return null; + if (aNumber < 0) aNumber = this.mOreByProducts.size() + aNumber; + while (aNumber >= this.mOreByProducts.size()) aNumber--; ISubTagContainer o = this.mOreByProducts.get(aNumber); - if (o == null || o.equals(Werkstoff.default_null_Werkstoff) || o.equals(Materials._NULL)) - return this; + if (o == null || o.equals(Werkstoff.default_null_Werkstoff) || o.equals(Materials._NULL)) return this; return o; } public ItemStack getOreByProduct(int aNumber, OrePrefixes prefixes) { - if (this.mOreByProducts.size() == 0) - return null; - if (aNumber < 0) - aNumber = this.mOreByProducts.size() + aNumber; - while (aNumber >= this.mOreByProducts.size()) - aNumber--; + if (this.mOreByProducts.size() == 0) return null; + if (aNumber < 0) aNumber = this.mOreByProducts.size() + aNumber; + while (aNumber >= this.mOreByProducts.size()) aNumber--; Object o = this.mOreByProducts.get(aNumber); if (o == null || o.equals(Werkstoff.default_null_Werkstoff) || o.equals(Materials._NULL)) return this.get(prefixes); - if (o instanceof Werkstoff) - return WerkstoffLoader.getCorrespondingItemStack(prefixes, (Werkstoff) o); - if (o instanceof Materials) - return GT_OreDictUnificator.get(prefixes, o, 1L); + if (o instanceof Werkstoff) return WerkstoffLoader.getCorrespondingItemStack(prefixes, (Werkstoff) o); + if (o instanceof Materials) return GT_OreDictUnificator.get(prefixes, o, 1L); return null; } @@ -416,7 +537,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public String getLocalizedName() { - return GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.name", this.mID), defaultName, !GregTech_API.sPostloadFinished); + return GT_LanguageManager.addStringLocalization( + String.format("bw.werkstoff.%05d.name", this.mID), defaultName, !GregTech_API.sPostloadFinished); } public String getVarName() { @@ -428,7 +550,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public String getLocalizedToolTip() { - return GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.tooltip", this.mID), toolTip, !GregTech_API.sPostloadFinished); + return GT_LanguageManager.addStringLocalization( + String.format("bw.werkstoff.%05d.tooltip", this.mID), toolTip, !GregTech_API.sPostloadFinished); } public Werkstoff.Stats getStats() { @@ -452,20 +575,21 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public void setRgb(short[] rgb) { - this.rgb = new byte[]{(byte) (rgb[0] - 128), (byte) (rgb[1] - 128), (byte) (rgb[2] - 128)}; + this.rgb = new byte[] {(byte) (rgb[0] - 128), (byte) (rgb[1] - 128), (byte) (rgb[2] - 128)}; } @Override public short[] getRGBA() { - return new short[]{(short) (this.rgb[0] + 128), (short) (this.rgb[1] + 128), (short) (this.rgb[2] + 128), 0}; + return new short[] {(short) (this.rgb[0] + 128), (short) (this.rgb[1] + 128), (short) (this.rgb[2] + 128), 0}; } @Override public boolean contains(SubTag subTag) { - if (!subTag.equals(WerkstoffLoader.NOBLE_GAS) && !subTag.equals(WerkstoffLoader.ANAEROBE_GAS) && !subTag.equals(WerkstoffLoader.NO_BLAST)) + if (!subTag.equals(WerkstoffLoader.NOBLE_GAS) + && !subTag.equals(WerkstoffLoader.ANAEROBE_GAS) + && !subTag.equals(WerkstoffLoader.NO_BLAST)) for (Pair p : this.CONTENTS) - if (p.getKey().contains(subTag)) - return true; + if (p.getKey().contains(subTag)) return true; return this.SUBTAGS.contains(subTag); } @@ -501,17 +625,37 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public byte getToolQuality() { - return this.stats.getQualityOverride() > 0 ? this.stats.getQualityOverride() : (byte) ((15f * (((float) this.getStats().getProtons() / 188f) + (float) this.getStats().getMeltingPoint() / 10801f)) / (float) this.getContents().getKey()); + return this.stats.getQualityOverride() > 0 + ? this.stats.getQualityOverride() + : (byte) ((15f + * (((float) this.getStats().getProtons() / 188f) + + (float) this.getStats().getMeltingPoint() / 10801f)) + / (float) this.getContents().getKey()); } public float getToolSpeed() { - return this.stats.getSpeedOverride() > 0f ? this.stats.getSpeedOverride() : Math.max(1f, - 2f * ((float) -this.getStats().getMass() + 0.1f * (float) this.getStats().getMeltingPoint() + (float) this.getStats().getProtons()) * 0.1f / (float) this.getContents().getKey() * 0.1f * (float) this.getToolQuality() - ); + return this.stats.getSpeedOverride() > 0f + ? this.stats.getSpeedOverride() + : Math.max( + 1f, + 2f + * ((float) -this.getStats().getMass() + + 0.1f * (float) this.getStats().getMeltingPoint() + + (float) this.getStats().getProtons()) + * 0.1f + / (float) this.getContents().getKey() + * 0.1f + * (float) this.getToolQuality()); } public int getDurability() { - return this.stats.getDurOverride() > 0 ? this.stats.getDurOverride() : (int) (this.stats.durMod * ((0.01f * (float) this.getStats().getMeltingPoint() * (float) this.getStats().getMass()) / (float) this.getContents().getKey())); + return this.stats.getDurOverride() > 0 + ? this.stats.getDurOverride() + : (int) (this.stats.durMod + * ((0.01f + * (float) this.getStats().getMeltingPoint() + * (float) this.getStats().getMass()) + / (float) this.getContents().getKey())); } /** @@ -519,13 +663,14 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { */ public boolean hasItemType(OrePrefixes prefixes) { int unpacked = Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes); - return (this.getGenerationFeatures().toGenerate & unpacked) != 0 && (this.getGenerationFeatures().blacklist & unpacked) == 0; + return (this.getGenerationFeatures().toGenerate & unpacked) != 0 + && (this.getGenerationFeatures().blacklist & unpacked) == 0; } /** * DOES NOT CHECK BLACKLIST! */ - public boolean hasGenerationFeature(OrePrefixes prefixes){ + public boolean hasGenerationFeature(OrePrefixes prefixes) { int unpacked = Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes); return (this.getGenerationFeatures().toGenerate & unpacked) != 0; } @@ -534,7 +679,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { * Checks if the Actual Stack exists in the OreDict */ public boolean doesOreDictedItemExists(OrePrefixes prefixes) { - return OreDictHandler.getItemStack(this.getDefaultName(), prefixes,1) != null; + return OreDictHandler.getItemStack(this.getDefaultName(), prefixes, 1) != null; } public String getOwner() { @@ -553,7 +698,13 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public enum Types { - MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, ELEMENT, ISOTOPE, UNDEFINED; + MATERIAL, + COMPOUND, + MIXTURE, + BIOLOGICAL, + ELEMENT, + ISOTOPE, + UNDEFINED; public static Werkstoff.Stats getDefaultStatForType(Werkstoff.Types T) { switch (T) { @@ -571,7 +722,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static class GenerationFeatures { public static final GenerationFeatures DISABLED = new GenerationFeatures().disable(); long toGenerate = 0b0001001; - //logic gate shit + // logic gate shit /* dust 1 metal 10 (ingot, nugget) @@ -587,8 +738,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { private boolean isExtension; private static final NonNullWrappedHashMap prefixLogic = new NonNullWrappedHashMap<>(0); - public GenerationFeatures() { - } + public GenerationFeatures() {} public static void initPrefixLogic() { Arrays.stream(OrePrefixes.values()).forEach(e -> prefixLogic.put(e, 0)); @@ -660,8 +810,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public static int getPrefixDataRaw(OrePrefixes prefixes) { - if (prefixes == null) - throw new IllegalArgumentException("OrePrefixes is NULL!"); + if (prefixes == null) throw new IllegalArgumentException("OrePrefixes is NULL!"); return GenerationFeatures.prefixLogic.get(prefixes); } @@ -669,7 +818,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return isExtension; } - //public byte toGenerateSecondary = 0b0000000; + // public byte toGenerateSecondary = 0b0000000; public byte blacklist; public boolean enforceUnification; @@ -711,22 +860,19 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @Deprecated public Werkstoff.GenerationFeatures removeGems() { - if (this.hasGems()) - this.toGenerate = (long) (this.toGenerate ^ 0b100); + if (this.hasGems()) this.toGenerate = (long) (this.toGenerate ^ 0b100); return this; } @Deprecated public Werkstoff.GenerationFeatures removeDusts() { - if (this.hasDusts()) - this.toGenerate = (long) (this.toGenerate ^ 0b1); + if (this.hasDusts()) this.toGenerate = (long) (this.toGenerate ^ 0b1); return this; } @Deprecated public Werkstoff.GenerationFeatures removeOres() { - if (this.hasOres()) - this.toGenerate = (long) (this.toGenerate ^ 0b1000); + if (this.hasOres()) this.toGenerate = (long) (this.toGenerate ^ 0b1000); return this; } @@ -746,8 +892,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public Werkstoff.GenerationFeatures addMixerRecipes(short aCircuit) { this.extraRecipes = (byte) (this.extraRecipes | 10); - if (aCircuit >= 1 && aCircuit <=24) - this.mixCircuit = aCircuit; + if (aCircuit >= 1 && aCircuit <= 24) this.mixCircuit = aCircuit; return this; } @@ -755,7 +900,6 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return (this.extraRecipes & 10) != 0; } - public Werkstoff.GenerationFeatures addSifterRecipes() { this.extraRecipes = (byte) (this.extraRecipes | 100); return this; @@ -956,7 +1100,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } private Pair[] mTC_Aspects; - //logic gate shit + // logic gate shit byte quality = ~0b1111111; public Werkstoff.Stats setmTC_AspectsArray(Pair[] mTC_Aspects) { @@ -988,13 +1132,28 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (this.neutrons != that.neutrons) return false; if (this.electrons != that.electrons) return false; if (Math.abs(this.ebfGasRecipeTimeMultiplier - that.ebfGasRecipeTimeMultiplier) > 1.0e-6D) return false; - if (Math.abs(this.ebfGasRecipeConsumedAmountMultiplier - that.ebfGasRecipeConsumedAmountMultiplier) > 1.0e-6D) return false; + if (Math.abs(this.ebfGasRecipeConsumedAmountMultiplier - that.ebfGasRecipeConsumedAmountMultiplier) + > 1.0e-6D) return false; return this.quality == that.quality; } @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(49).put(this.quality).putInt(this.boilingPoint).putInt(this.meltingPoint).putLong(this.protons).putLong(this.neutrons).putLong(this.electrons).putLong(this.mass).putDouble(this.ebfGasRecipeTimeMultiplier).putDouble(this.ebfGasRecipeConsumedAmountMultiplier).array(), 0, 49, 31); + return MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(49) + .put(this.quality) + .putInt(this.boilingPoint) + .putInt(this.meltingPoint) + .putLong(this.protons) + .putLong(this.neutrons) + .putLong(this.electrons) + .putLong(this.mass) + .putDouble(this.ebfGasRecipeTimeMultiplier) + .putDouble(this.ebfGasRecipeConsumedAmountMultiplier) + .array(), + 0, + 49, + 31); } public Werkstoff.Stats setMass(long mass) { @@ -1012,10 +1171,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.Stats setSublimation(boolean sublimation) { - if (sublimation) - this.quality = (byte) (this.quality | 0b000001); - else - this.quality = (byte) (this.quality & 0b1111110); + if (sublimation) this.quality = (byte) (this.quality | 0b000001); + else this.quality = (byte) (this.quality & 0b1111110); return this; } @@ -1024,10 +1181,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.Stats setToxic(boolean toxic) { - if (toxic) - this.quality = (byte) (this.quality | 0b000010); - else - this.quality = (byte) (this.quality & 0b1111101); + if (toxic) this.quality = (byte) (this.quality | 0b000010); + else this.quality = (byte) (this.quality & 0b1111101); return this; } @@ -1047,10 +1202,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.Stats setRadioactive(boolean radioactive) { - if (radioactive) - this.quality = (byte) (this.quality | 0b000100); - else - this.quality = (byte) (this.quality & 0b1111011); + if (radioactive) this.quality = (byte) (this.quality | 0b000100); + else this.quality = (byte) (this.quality & 0b1111011); return this; } @@ -1059,10 +1212,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.Stats setBlastFurnace(boolean blastFurnace) { - if (blastFurnace) - this.quality = (byte) (this.quality | 0b001000); - else - this.quality = (byte) (this.quality & 0b1110111); + if (blastFurnace) this.quality = (byte) (this.quality | 0b001000); + else this.quality = (byte) (this.quality & 0b1110111); return this; } @@ -1080,10 +1231,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.Stats setElektrolysis(boolean elektrolysis) { - if (elektrolysis) - this.quality = (byte) (this.quality | 0x10); - else - this.quality = (byte) (this.quality & 0b1101111); + if (elektrolysis) this.quality = (byte) (this.quality | 0x10); + else this.quality = (byte) (this.quality & 0b1101111); return this; } @@ -1092,10 +1241,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.Stats setCentrifuge(boolean centrifuge) { - if (centrifuge) - this.quality = (byte) (this.quality | 0x20); - else - this.quality = (byte) (this.quality & 0b1011111); + if (centrifuge) this.quality = (byte) (this.quality | 0x20); + else this.quality = (byte) (this.quality & 0b1011111); return this; } @@ -1104,12 +1251,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.Stats setGas(boolean gas) { - if (gas) - this.quality = (byte) (this.quality | 0x40); - else - this.quality = (byte) (this.quality & 0b0111111); + if (gas) this.quality = (byte) (this.quality | 0x40); + else this.quality = (byte) (this.quality & 0b0111111); return this; } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 7047f99438..ac5c1948c1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.bartworks.system.material; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.subscriptNumbers; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.superscriptNumbers; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.API.WerkstoffAdderRegistry; @@ -56,6 +60,8 @@ import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputOreDict; import ic2.api.recipe.RecipeOutput; import ic2.api.recipe.Recipes; +import java.lang.reflect.Field; +import java.util.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.ItemStack; @@ -64,17 +70,9 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.oredict.OreDictionary; import org.apache.logging.log4j.Level; -import java.lang.reflect.Field; -import java.util.*; - -import static com.github.bartimaeusnek.bartworks.util.BW_Util.subscriptNumbers; -import static com.github.bartimaeusnek.bartworks.util.BW_Util.superscriptNumbers; -import static gregtech.api.enums.OrePrefixes.*; - @SuppressWarnings({"unchecked", "deprecation"}) public class WerkstoffLoader { - private WerkstoffLoader() { - } + private WerkstoffLoader() {} public static final SubTag NOBLE_GAS = SubTag.getNewSubTag("NobleGas"); public static final SubTag ANAEROBE_GAS = SubTag.getNewSubTag("AnaerobeGas"); @@ -93,15 +91,15 @@ public class WerkstoffLoader { public static boolean gtnhGT = false; public static void setUp() { - //GTNH detection hack + // GTNH detection hack try { Field f = GT_MetaGenerated_Tool_01.class.getField("SOLDERING_IRON_MV"); gtnhGT = true; } catch (Exception ignored) { gtnhGT = false; } - //GTNH detection hack #2 - //GTNH hack for molten cells + // GTNH detection hack #2 + // GTNH hack for molten cells for (OrePrefixes prefix : values()) { if (prefix.toString().equals("cellMolten")) { WerkstoffLoader.cellMolten = prefix; @@ -116,13 +114,24 @@ public class WerkstoffLoader { if (WerkstoffLoader.cellMolten == null) { WerkstoffLoader.cellMolten = EnumUtils.addNewOrePrefix( - "cellMolten","Cells of Molten stuff", "Molten ", - " Cell", true, true, - true, true, false, - false, false, true, - false, false, 0b1000000, - 3628800L, 64, 31 - ); + "cellMolten", + "Cells of Molten stuff", + "Molten ", + " Cell", + true, + true, + true, + true, + false, + false, + false, + true, + false, + false, + 0b1000000, + 3628800L, + 64, + 31); // GT_LanguageManager.addStringLocalization(".name", this.getDefaultLocalization(w)); } else { WerkstoffLoader.cellMolten.mMaterialGenerationBits = 0b1000000; @@ -137,11 +146,13 @@ public class WerkstoffLoader { } catch (NullPointerException | IllegalArgumentException ignored) { } - //add tiberium + // add tiberium Element t = EnumUtils.createNewElement("Tr", 123L, 203L, 0L, -1L, null, "Tiberium", false); - blockCasing = EnumUtils.addNewOrePrefix("blockCasing", + blockCasing = EnumUtils.addNewOrePrefix( + "blockCasing", "A Casing block for a Multiblock-Machine", - "Bolted ", " Casing", + "Bolted ", + " Casing", true, true, true, @@ -156,9 +167,11 @@ public class WerkstoffLoader { 32659200L, 64, -1); - blockCasingAdvanced = EnumUtils.addNewOrePrefix("blockCasingAdvanced", + blockCasingAdvanced = EnumUtils.addNewOrePrefix( + "blockCasingAdvanced", "An Advanced Casing block for a Multiblock-Machine", - "Rebolted ", " Casing", + "Rebolted ", + " Casing", true, true, true, @@ -173,16 +186,27 @@ public class WerkstoffLoader { 32659200L, 64, -1); - //add molten & regular capsuls + // add molten & regular capsuls if (LoaderReference.Forestry) { capsuleMolten = EnumUtils.addNewOrePrefix( - "capsuleMolten", "Capsule of Molten stuff", "Molten ", - " Capsule", true, true, - true, true, false, - false, false, true, - false, false, 0b1000000, - 3628800L, 64, -1 - ); + "capsuleMolten", + "Capsule of Molten stuff", + "Molten ", + " Capsule", + true, + true, + true, + true, + false, + false, + false, + true, + false, + false, + 0b1000000, + 3628800L, + 64, + -1); capsule.mMaterialGenerationBits = 0b100000; capsule.mDefaultStackSize = 64; } @@ -192,17 +216,17 @@ public class WerkstoffLoader { BW_GT_MaterialReference.init(); } - //TODO: - //FREE ID RANGE: 12_000-28_998 - //bartimaeusnek reserved 0-10_000 - //GlodBlock reserved range 10_001-10_999 - //Elisis reserved range 11_000-11_499 - //glowredman reserved range 11_500-11_999 - //bot reserved range 29_899-29_999 - //Tec & basdxz reserved range 30_000-31_000 - //GT Material range reserved on 31_767-32_767 + // TODO: + // FREE ID RANGE: 12_000-28_998 + // bartimaeusnek reserved 0-10_000 + // GlodBlock reserved range 10_001-10_999 + // Elisis reserved range 11_000-11_499 + // glowredman reserved range 11_500-11_999 + // bot reserved range 29_899-29_999 + // Tec & basdxz reserved range 30_000-31_000 + // GT Material range reserved on 31_767-32_767 public static final Werkstoff Bismutite = new Werkstoff( - new short[]{255, 233, 0, 0}, + new short[] {255, 233, 0, 0}, "Bismutite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), @@ -211,10 +235,9 @@ public class WerkstoffLoader { Collections.singletonList(Materials.Bismuth), new Pair<>(Materials.Bismuth, 2), new Pair<>(Materials.Oxygen, 2), - new Pair<>(Materials.CarbonDioxide, 2) - ); + new Pair<>(Materials.CarbonDioxide, 2)); public static final Werkstoff Bismuthinit = new Werkstoff( - new short[]{192, 192, 192, 0}, + new short[] {192, 192, 192, 0}, "Bismuthinite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -222,21 +245,28 @@ public class WerkstoffLoader { TextureSet.SET_METALLIC, Arrays.asList(Materials.Bismuth, Materials.Sulfur), new Pair<>(Materials.Bismuth, 2), - new Pair<>(Materials.Sulfur, 3) - ); + new Pair<>(Materials.Sulfur, 3)); public static final Werkstoff Zirconium = new Werkstoff( - new short[]{175, 175, 175, 0}, + new short[] {175, 175, 175, 0}, "Zirconium", "Zr", - new Werkstoff.Stats().setProtons(40).setBlastFurnace(true).setMeltingPoint(2130).setMeltingVoltage(480), + new Werkstoff.Stats() + .setProtons(40) + .setBlastFurnace(true) + .setMeltingPoint(2130) + .setMeltingVoltage(480), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().enforceUnification(), + new Werkstoff.GenerationFeatures() + .disable() + .onlyDust() + .addMetalItems() + .enforceUnification(), 3, TextureSet.SET_METALLIC - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff CubicZirconia = new Werkstoff( - new short[]{255, 255, 255, 0}, + new short[] {255, 255, 255, 0}, "Cubic Zirconia", Werkstoff.Types.COMPOUND, 3273, @@ -245,10 +275,9 @@ public class WerkstoffLoader { TextureSet.SET_DIAMOND, Collections.singletonList(WerkstoffLoader.Zirconium), new Pair<>(WerkstoffLoader.Zirconium, 1), - new Pair<>(Materials.Oxygen, 2) - ); + new Pair<>(Materials.Oxygen, 2)); public static final Werkstoff FluorBuergerit = new Werkstoff( - new short[]{0x20, 0x20, 0x20, 0}, + new short[] {0x20, 0x20, 0x20, 0}, "Fluor-Buergerite", subscriptNumbers("NaFe3Al6(Si6O18)(BO3)3O3F"), new Werkstoff.Stats().setElektrolysis(false), @@ -263,20 +292,20 @@ public class WerkstoffLoader { new Pair<>(Materials.Silicon, 6), new Pair<>(Materials.Boron, 3), new Pair<>(Materials.Oxygen, 30), - new Pair<>(Materials.Fluorine, 1) - ); + new Pair<>(Materials.Fluorine, 1)); public static final Werkstoff YttriumOxide = new Werkstoff( - new short[]{255, 255, 255, 0}, + new short[] {255, 255, 255, 0}, "Yttrium Oxide", Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().onlyDust().enforceUnification(), //No autoadd here to gate this material by hand + new Werkstoff.GenerationFeatures() + .onlyDust() + .enforceUnification(), // No autoadd here to gate this material by hand 6, TextureSet.SET_DULL, new Pair<>(Materials.Yttrium, 2), - new Pair<>(Materials.Oxygen, 3) - ); + new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff ChromoAluminoPovondrait = new Werkstoff( - new short[]{0, 0x79, 0x6A, 0}, + new short[] {0, 0x79, 0x6A, 0}, "Chromo-Alumino-Povondraite", subscriptNumbers("NaCr3(Al4Mg2)(Si6O18)(BO3)3(OH)3O"), Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND).setElektrolysis(false), @@ -291,10 +320,9 @@ public class WerkstoffLoader { new Pair<>(Materials.Silicon, 6), new Pair<>(Materials.Boron, 3), new Pair<>(Materials.Oxygen, 31), - new Pair<>(Materials.Hydrogen, 3) - ); + new Pair<>(Materials.Hydrogen, 3)); public static final Werkstoff VanadioOxyDravit = new Werkstoff( - new short[]{0x60, 0xA0, 0xA0, 0}, + new short[] {0x60, 0xA0, 0xA0, 0}, "Vanadio-Oxy-Dravite", subscriptNumbers("NaV3(Al4Mg2)(Si6O18)(BO3)3(OH)3O"), Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND).setElektrolysis(false), @@ -309,10 +337,9 @@ public class WerkstoffLoader { new Pair<>(Materials.Silicon, 6), new Pair<>(Materials.Boron, 3), new Pair<>(Materials.Oxygen, 31), - new Pair<>(Materials.Hydrogen, 3) - ); + new Pair<>(Materials.Hydrogen, 3)); public static final Werkstoff Olenit = new Werkstoff( - new short[]{210, 210, 210, 0}, + new short[] {210, 210, 210, 0}, "Olenite", subscriptNumbers("NaAl3Al6(Si6O18)(BO3)3O3OH"), Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND).setElektrolysis(false), @@ -326,10 +353,9 @@ public class WerkstoffLoader { new Pair<>(Materials.Silicon, 6), new Pair<>(Materials.Boron, 3), new Pair<>(Materials.Oxygen, 31), - new Pair<>(Materials.Hydrogen, 1) - ); + new Pair<>(Materials.Hydrogen, 1)); public static final Werkstoff Arsenopyrite = new Werkstoff( - new short[]{0xB0, 0xB0, 0xB0, 0}, + new short[] {0xB0, 0xB0, 0xB0, 0}, "Arsenopyrite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -338,10 +364,9 @@ public class WerkstoffLoader { Arrays.asList(Materials.Sulfur, Materials.Arsenic, Materials.Iron), new Pair<>(Materials.Iron, 1), new Pair<>(Materials.Arsenic, 1), - new Pair<>(Materials.Sulfur, 1) - ); + new Pair<>(Materials.Sulfur, 1)); public static final Werkstoff Ferberite = new Werkstoff( - new short[]{0xB0, 0xB0, 0xB0, 0}, + new short[] {0xB0, 0xB0, 0xB0, 0}, "Ferberite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -350,10 +375,9 @@ public class WerkstoffLoader { Arrays.asList(Materials.Iron, Materials.Tungsten), new Pair<>(Materials.Iron, 1), new Pair<>(Materials.Tungsten, 1), - new Pair<>(Materials.Oxygen, 3) - ); + new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff Loellingit = new Werkstoff( - new short[]{0xD0, 0xD0, 0xD0, 0}, + new short[] {0xD0, 0xD0, 0xD0, 0}, "Loellingite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -361,10 +385,9 @@ public class WerkstoffLoader { TextureSet.SET_METALLIC, Arrays.asList(Materials.Iron, Materials.Arsenic), new Pair<>(Materials.Iron, 1), - new Pair<>(Materials.Arsenic, 2) - ); + new Pair<>(Materials.Arsenic, 2)); public static final Werkstoff Roquesit = new Werkstoff( - new short[]{0xA0, 0xA0, 0xA0, 0}, + new short[] {0xA0, 0xA0, 0xA0, 0}, "Roquesite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -373,10 +396,9 @@ public class WerkstoffLoader { Arrays.asList(Materials.Copper, Materials.Sulfur), new Pair<>(Materials.Copper, 1), new Pair<>(Materials.Indium, 1), - new Pair<>(Materials.Sulfur, 2) - ); + new Pair<>(Materials.Sulfur, 2)); public static final Werkstoff Bornite = new Werkstoff( - new short[]{0x97, 0x66, 0x2B, 0}, + new short[] {0x97, 0x66, 0x2B, 0}, "Bornite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -385,8 +407,7 @@ public class WerkstoffLoader { Arrays.asList(Materials.Copper, Materials.Iron, Materials.Sulfur), new Pair<>(Materials.Copper, 5), new Pair<>(Materials.Iron, 1), - new Pair<>(Materials.Sulfur, 4) - ); + new Pair<>(Materials.Sulfur, 4)); public static final Werkstoff Wittichenit = new Werkstoff( Materials.Copper.mRGBa, "Wittichenite", @@ -397,10 +418,9 @@ public class WerkstoffLoader { Arrays.asList(Materials.Copper, Materials.Bismuth, Materials.Sulfur), new Pair<>(Materials.Copper, 5), new Pair<>(Materials.Bismuth, 1), - new Pair<>(Materials.Sulfur, 4) - ); + new Pair<>(Materials.Sulfur, 4)); public static final Werkstoff Djurleit = new Werkstoff( - new short[]{0x60, 0x60, 0x60, 0}, + new short[] {0x60, 0x60, 0x60, 0}, "Djurleite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -408,10 +428,9 @@ public class WerkstoffLoader { TextureSet.SET_METALLIC, Arrays.asList(Materials.Copper, Materials.Copper, Materials.Sulfur), new Pair<>(Materials.Copper, 31), - new Pair<>(Materials.Sulfur, 16) - ); + new Pair<>(Materials.Sulfur, 16)); public static final Werkstoff Huebnerit = new Werkstoff( - new short[]{0x80, 0x60, 0x60, 0}, + new short[] {0x80, 0x60, 0x60, 0}, "Huebnerite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -420,10 +439,9 @@ public class WerkstoffLoader { Arrays.asList(Materials.Manganese, Materials.Tungsten), new Pair<>(Materials.Manganese, 1), new Pair<>(Materials.Tungsten, 1), - new Pair<>(Materials.Oxygen, 3) - ); + new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff Thorianit = new Werkstoff( - new short[]{0x30, 0x30, 0x30, 0}, + new short[] {0x30, 0x30, 0x30, 0}, "Thorianite", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -432,10 +450,9 @@ public class WerkstoffLoader { TextureSet.SET_METALLIC, Collections.singletonList(Materials.Thorium), new Pair<>(Materials.Thorium, 1), - new Pair<>(Materials.Oxygen, 2) - ); + new Pair<>(Materials.Oxygen, 2)); public static final Werkstoff RedZircon = new Werkstoff( - new short[]{195, 19, 19, 0}, + new short[] {195, 19, 19, 0}, "Red Zircon", new Werkstoff.Stats().setElektrolysis(false).setMeltingPoint(2130), Werkstoff.Types.COMPOUND, @@ -445,10 +462,9 @@ public class WerkstoffLoader { Arrays.asList(WerkstoffLoader.Zirconium, Materials.SiliconDioxide), new Pair<>(WerkstoffLoader.Zirconium, 1), new Pair<>(Materials.Silicon, 1), - new Pair<>(Materials.Oxygen, 4) - ); + new Pair<>(Materials.Oxygen, 4)); - //GT Enhancements + // GT Enhancements public static final Werkstoff Salt = new Werkstoff( Materials.Salt.mRGBa, "Salt", @@ -458,8 +474,7 @@ public class WerkstoffLoader { 20, TextureSet.SET_FLINT, Arrays.asList(Materials.RockSalt, Materials.Borax), - new Pair<>(Materials.Salt, 1) - ); + new Pair<>(Materials.Salt, 1)); public static final Werkstoff Spodumen = new Werkstoff( Materials.Spodumene.mRGBa, "Spodumene", @@ -469,8 +484,7 @@ public class WerkstoffLoader { 21, TextureSet.SET_FLINT, Collections.singletonList(Materials.Spodumene), - new Pair<>(Materials.Spodumene, 1) - ); + new Pair<>(Materials.Spodumene, 1)); public static final Werkstoff RockSalt = new Werkstoff( Materials.RockSalt.mRGBa, "Rock Salt", @@ -480,12 +494,11 @@ public class WerkstoffLoader { 22, TextureSet.SET_FLINT, Arrays.asList(Materials.RockSalt, Materials.Borax), - new Pair<>(Materials.RockSalt, 1) - ); + new Pair<>(Materials.RockSalt, 1)); - //More NonGT Stuff + // More NonGT Stuff public static final Werkstoff Fayalit = new Werkstoff( - new short[]{50, 50, 50, 0}, + new short[] {50, 50, 50, 0}, "Fayalite", new Werkstoff.Stats().setElektrolysis(false), Werkstoff.Types.COMPOUND, @@ -495,10 +508,9 @@ public class WerkstoffLoader { Arrays.asList(Materials.Iron, Materials.SiliconDioxide), new Pair<>(Materials.Iron, 2), new Pair<>(Materials.Silicon, 1), - new Pair<>(Materials.Oxygen, 4) - ); + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff Forsterit = new Werkstoff( - new short[]{255, 255, 255, 0}, + new short[] {255, 255, 255, 0}, "Forsterite", new Werkstoff.Stats().setElektrolysis(false), Werkstoff.Types.COMPOUND, @@ -508,10 +520,9 @@ public class WerkstoffLoader { Arrays.asList(Materials.Magnesium, Materials.SiliconDioxide), new Pair<>(Materials.Magnesium, 2), new Pair<>(Materials.Silicon, 1), - new Pair<>(Materials.Oxygen, 4) - ); + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff Hedenbergit = new Werkstoff( - new short[]{100, 150, 100, 0}, + new short[] {100, 150, 100, 0}, "Hedenbergite", new Werkstoff.Stats().setElektrolysis(false), Werkstoff.Types.COMPOUND, @@ -522,11 +533,10 @@ public class WerkstoffLoader { new Pair<>(Materials.Calcium, 1), new Pair<>(Materials.Iron, 1), new Pair<>(Materials.Silicon, 2), - new Pair<>(Materials.Oxygen, 6) - ); + new Pair<>(Materials.Oxygen, 6)); public static final Werkstoff DescloiziteZNVO4 = new Werkstoff( - new short[]{0xBF, 0x18, 0x0F, 0}, - "Red Descloizite",//Pb(Zn,Cu)[OH|VO4 + new short[] {0xBF, 0x18, 0x0F, 0}, + "Red Descloizite", // Pb(Zn,Cu)[OH|VO4 new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -536,11 +546,10 @@ public class WerkstoffLoader { new Pair<>(Materials.Lead, 1), new Pair<>(Materials.Zinc, 1), new Pair<>(Materials.Vanadium, 1), - new Pair<>(Materials.Oxygen, 4) - ); + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff DescloiziteCUVO4 = new Werkstoff( - new short[]{0xf9, 0x6d, 0x18, 0}, - "Orange Descloizite",//Pb(Zn,Cu)[OH|VO4 + new short[] {0xf9, 0x6d, 0x18, 0}, + "Orange Descloizite", // Pb(Zn,Cu)[OH|VO4 new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -550,10 +559,9 @@ public class WerkstoffLoader { new Pair<>(Materials.Lead, 1), new Pair<>(Materials.Copper, 1), new Pair<>(Materials.Vanadium, 1), - new Pair<>(Materials.Oxygen, 4) - ); + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff FuchsitAL = new Werkstoff( - new short[]{0x4D, 0x7F, 0x64, 0}, + new short[] {0x4D, 0x7F, 0x64, 0}, "Green Fuchsite", subscriptNumbers("KAl3Si3O10(OH)2"), new Werkstoff.Stats().setElektrolysis(false), @@ -566,11 +574,10 @@ public class WerkstoffLoader { new Pair<>(Materials.Aluminium, 3), new Pair<>(Materials.Silicon, 3), new Pair<>(Materials.Oxygen, 12), - new Pair<>(Materials.Hydrogen, 2) + new Pair<>(Materials.Hydrogen, 2)); - ); public static final Werkstoff FuchsitCR = new Werkstoff( - new short[]{128, 0, 0, 0}, + new short[] {128, 0, 0, 0}, "Red Fuchsite", subscriptNumbers("KCr3Si3O10(OH)2"), new Werkstoff.Stats().setElektrolysis(false), @@ -583,11 +590,10 @@ public class WerkstoffLoader { new Pair<>(Materials.Chrome, 3), new Pair<>(Materials.Silicon, 3), new Pair<>(Materials.Oxygen, 12), - new Pair<>(Materials.Hydrogen, 2) + new Pair<>(Materials.Hydrogen, 2)); - ); public static final Werkstoff Thorium232 = new Werkstoff( - new short[]{0, 64, 0, 0}, + new short[] {0, 64, 0, 0}, "Thorium 232", superscriptNumbers("Th232"), new Werkstoff.Stats().setRadioactive(true), @@ -595,88 +601,82 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust().enforceUnification(), 30, TextureSet.SET_METALLIC - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff BismuthTellurite = new Werkstoff( - new short[]{32, 72, 32, 0}, + new short[] {32, 72, 32, 0}, "Bismuth Tellurite", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), 31, TextureSet.SET_METALLIC, - //No Byproducts + // No Byproducts new Pair<>(Materials.Bismuth, 2), - new Pair<>(Materials.Tellurium, 3) - ); + new Pair<>(Materials.Tellurium, 3)); public static final Werkstoff Tellurium = new Werkstoff( - new short[]{0xff, 0xff, 0xff, 0}, + new short[] {0xff, 0xff, 0xff, 0}, "Tellurium", new Werkstoff.Stats(), Werkstoff.Types.ELEMENT, new Werkstoff.GenerationFeatures().addMetalItems().removePrefix(ore), 32, TextureSet.SET_METALLIC, - //No Byproducts - new Pair<>(Materials.Tellurium, 1) - ); + // No Byproducts + new Pair<>(Materials.Tellurium, 1)); public static final Werkstoff BismuthHydroBorat = new Werkstoff( - new short[]{72, 144, 72, 0}, + new short[] {72, 144, 72, 0}, "Dibismuthhydroborat", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), 33, TextureSet.SET_METALLIC, - //No Byproducts + // No Byproducts new Pair<>(Materials.Bismuth, 2), new Pair<>(Materials.Boron, 1), - new Pair<>(Materials.Hydrogen, 1) - ); + new Pair<>(Materials.Hydrogen, 1)); public static final Werkstoff ArInGaPhoBiBoTe = new Werkstoff( - new short[]{36, 36, 36, 0}, + new short[] {36, 36, 36, 0}, "Circuit Compound MK3", new Werkstoff.Stats().setCentrifuge(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust().addMixerRecipes(), 34, TextureSet.SET_METALLIC, - //No Byproducts + // No Byproducts new Pair<>(Materials.IndiumGalliumPhosphide, 1), new Pair<>(WerkstoffLoader.BismuthHydroBorat, 3), - new Pair<>(WerkstoffLoader.BismuthTellurite, 2) - ); + new Pair<>(WerkstoffLoader.BismuthTellurite, 2)); public static final Werkstoff Prasiolite = new Werkstoff( - new short[]{0xD0, 0xDD, 0x95, 0}, + new short[] {0xD0, 0xDD, 0x95, 0}, "Prasiolite", new Werkstoff.Stats().setElektrolysis(false).setMeltingPoint(1923), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 35, TextureSet.SET_QUARTZ, - //No Byproducts + // No Byproducts new Pair<>(Materials.Silicon, 5), new Pair<>(Materials.Oxygen, 10), - new Pair<>(Materials.Iron, 1) - ); + new Pair<>(Materials.Iron, 1)); public static final Werkstoff MagnetoResonaticDust = new Werkstoff( - new short[]{0xDD, 0x77, 0xDD, 0}, + new short[] {0xDD, 0x77, 0xDD, 0}, "Magneto Resonatic", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().onlyDust().addMixerRecipes().addGems(), 36, TextureSet.SET_MAGNETIC, - //No Byproducts + // No Byproducts new Pair<>(WerkstoffLoader.Prasiolite, 3), new Pair<>(WerkstoffLoader.BismuthTellurite, 4), new Pair<>(WerkstoffLoader.CubicZirconia, 1), - new Pair<>(Materials.SteelMagnetic, 1) - ); + new Pair<>(Materials.SteelMagnetic, 1)); public static final Werkstoff Xenon = new Werkstoff( - new short[]{0x14, 0x39, 0x7F, 0}, + new short[] {0x14, 0x39, 0x7F, 0}, "Xenon", "Xe", new Werkstoff.Stats().setProtons(54).setMass(131).setGas(true), @@ -684,11 +684,11 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), 37, TextureSet.SET_FLUID - //No Byproducts - //No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff Oganesson = new Werkstoff( - new short[]{0x14, 0x39, 0x7F, 0}, + new short[] {0x14, 0x39, 0x7F, 0}, "Oganesson", "Og", new Werkstoff.Stats().setProtons(118).setMass(294).setGas(true), @@ -696,71 +696,94 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().addCells(), 38, TextureSet.SET_FLUID - //No Byproducts - //No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff Californium = new Werkstoff( - new short[]{0xAA, 0xAA, 0xAA, 0}, + new short[] {0xAA, 0xAA, 0xAA, 0}, "Californium", "Cf", - new Werkstoff.Stats().setProtons(98).setMass(251).setBlastFurnace(true).setMeltingPoint(900), + new Werkstoff.Stats() + .setProtons(98) + .setMass(251) + .setBlastFurnace(true) + .setMeltingPoint(900), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten().enforceUnification(), + new Werkstoff.GenerationFeatures() + .disable() + .onlyDust() + .addMetalItems() + .addMolten() + .enforceUnification(), 39, TextureSet.SET_METALLIC - //No Byproducts - //No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff Calcium = new Werkstoff( Materials.Calcium.mRGBa, "Calcium", "Ca", - new Werkstoff.Stats().setProtons(Element.Ca.mProtons).setMass(Element.Ca.getMass()).setBlastFurnace(true).setMeltingPoint(1115).setBoilingPoint(1757), + new Werkstoff.Stats() + .setProtons(Element.Ca.mProtons) + .setMass(Element.Ca.getMass()) + .setBlastFurnace(true) + .setMeltingPoint(1115) + .setBoilingPoint(1757), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten(), + new Werkstoff.GenerationFeatures() + .disable() + .onlyDust() + .addMetalItems() + .addMolten(), 40, Materials.Calcium.mIconSet, - //No Byproducts - new Pair<>(Materials.Calcium,1) - ); + // No Byproducts + new Pair<>(Materials.Calcium, 1)); public static final Werkstoff Neon = new Werkstoff( - new short[]{0xff, 0x07, 0x3a}, + new short[] {0xff, 0x07, 0x3a}, "Neon", "Ne", - new Werkstoff.Stats().setProtons(Element.Ne.mProtons).setMass(Element.Ne.getMass()).setGas(true), + new Werkstoff.Stats() + .setProtons(Element.Ne.mProtons) + .setMass(Element.Ne.getMass()) + .setGas(true), Werkstoff.Types.ELEMENT, new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), 41, TextureSet.SET_FLUID - //No Byproducts - //No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff Krypton = new Werkstoff( - new short[]{0xb1, 0xff, 0x32}, + new short[] {0xb1, 0xff, 0x32}, "Krypton", "Kr", - new Werkstoff.Stats().setProtons(Element.Kr.mProtons).setMass(Element.Kr.getMass()).setGas(true), + new Werkstoff.Stats() + .setProtons(Element.Kr.mProtons) + .setMass(Element.Kr.getMass()) + .setGas(true), Werkstoff.Types.ELEMENT, new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), 42, TextureSet.SET_FLUID - //No Byproducts - //No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff BArTiMaEuSNeK = new Werkstoff( - new short[]{0x00, 0xff, 0x00}, + new short[] {0x00, 0xff, 0x00}, "BArTiMaEuSNeK", "Are you serious?", - new Werkstoff.Stats().setMeltingPoint(9001).setCentrifuge(true).setBlastFurnace(true).setMeltingVoltage(1920), + new Werkstoff.Stats() + .setMeltingPoint(9001) + .setCentrifuge(true) + .setBlastFurnace(true) + .setMeltingVoltage(1920), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems().addMetalItems().addMolten(), 43, TextureSet.SET_DIAMOND, - Arrays.asList( - Materials.Boron, - Materials.Titanium, - Materials.Europium - ), + Arrays.asList(Materials.Boron, Materials.Titanium, Materials.Europium), new Pair<>(Materials.Boron, 1), new Pair<>(Materials.Argon, 1), new Pair<>(Materials.Titanium, 1), @@ -768,8 +791,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Europium, 1), new Pair<>(Materials.Sulfur, 1), new Pair<>(WerkstoffLoader.Neon, 1), - new Pair<>(Materials.Potassium, 1) - ); + new Pair<>(Materials.Potassium, 1)); public static final Werkstoff PTConcentrate = new Werkstoff( Materials.Platinum.getRGBA(), "Platinum Concentrate", @@ -779,9 +801,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().addCells(), 44, TextureSet.SET_FLUID - //No Byproducts - //No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff PTSaltCrude = new Werkstoff( Materials.Platinum.getRGBA(), "Platinum Salt", @@ -791,9 +813,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 45, TextureSet.SET_DULL - //No Byproducts - //No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff PTSaltRefined = new Werkstoff( Materials.Platinum.getRGBA(), "Refined Platinum Salt", @@ -803,9 +825,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 46, TextureSet.SET_METALLIC - //No Byproducts - //No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff PTMetallicPowder = new Werkstoff( Materials.Platinum.getRGBA(), "Platinum Metallic Powder", @@ -815,24 +837,22 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures(), 47, TextureSet.SET_METALLIC, - //No Byproducts + // No Byproducts new Pair<>(Materials.Platinum, 1), - new Pair<>(Materials.Stone, 2) - ); + new Pair<>(Materials.Stone, 2)); public static final Werkstoff AquaRegia = new Werkstoff( - new short[]{0xff, 0xb1, 0x32}, + new short[] {0xff, 0xb1, 0x32}, "Aqua Regia", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().addCells(), 48, TextureSet.SET_FLUID, - //No Byproducts + // No Byproducts new Pair<>(Materials.DilutedSulfuricAcid, 1), - new Pair<>(Materials.NitricAcid, 1) - ); + new Pair<>(Materials.NitricAcid, 1)); public static final Werkstoff PTResidue = new Werkstoff( - new short[]{0x64, 0x63, 0x2E}, + new short[] {0x64, 0x63, 0x2E}, "Platinum Residue", "??IrOsRhRu??", new Werkstoff.Stats(), @@ -840,10 +860,10 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 49, TextureSet.SET_ROUGH - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff AmmoniumChloride = new Werkstoff( - new short[]{0xff, 0xff, 0xff}, + new short[] {0xff, 0xff, 0xff}, "Ammonium Chloride", subscriptNumbers("NH4Cl"), new Werkstoff.Stats(), @@ -851,10 +871,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().addCells(), 50, TextureSet.SET_FLUID, - //No Byproducts + // No Byproducts new Pair<>(Materials.Ammonium, 1), - new Pair<>(Materials.HydrochloricAcid, 1) - ); + new Pair<>(Materials.HydrochloricAcid, 1)); public static final Werkstoff PTRawPowder = new Werkstoff( Materials.Platinum.getRGBA(), "Reprecipitated Platinum", @@ -864,8 +883,8 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 51, TextureSet.SET_METALLIC - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff PDAmmonia = new Werkstoff( Materials.Palladium.getRGBA(), "Palladium Enriched Ammonia", @@ -874,10 +893,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().addCells(), 52, TextureSet.SET_FLUID, - //No Byproducts + // No Byproducts new Pair<>(Materials.Ammonium, 1), - new Pair<>(Materials.Palladium, 1) - ); + new Pair<>(Materials.Palladium, 1)); public static final Werkstoff PDMetallicPowder = new Werkstoff( Materials.Palladium.getRGBA(), "Palladium Metallic Powder", @@ -887,10 +905,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures(), 53, TextureSet.SET_METALLIC, - //No Byproducts + // No Byproducts new Pair<>(Materials.Palladium, 1), - new Pair<>(Materials.Stone, 2) - ); + new Pair<>(Materials.Stone, 2)); public static final Werkstoff PDRawPowder = new Werkstoff( Materials.Palladium.getRGBA(), "Reprecipitated Palladium", @@ -900,9 +917,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 54, TextureSet.SET_METALLIC - //No Byproducts - //No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff PDSalt = new Werkstoff( Materials.Palladium.getRGBA(), "Palladium Salt", @@ -911,11 +928,11 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 55, TextureSet.SET_METALLIC - //No Byproducts - //No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff Sodiumformate = new Werkstoff( - new short[]{0xff, 0xaa, 0xaa}, + new short[] {0xff, 0xaa, 0xaa}, "Sodium Formate", "HCOONa", new Werkstoff.Stats(), @@ -923,25 +940,23 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().addCells(), 56, TextureSet.SET_FLUID, - //No Byproducts + // No Byproducts new Pair<>(Materials.SodiumHydroxide, 1), - new Pair<>(Materials.CarbonMonoxide, 1) - ); + new Pair<>(Materials.CarbonMonoxide, 1)); public static final Werkstoff Sodiumsulfate = new Werkstoff( - new short[]{0xff, 0xff, 0xff}, + new short[] {0xff, 0xff, 0xff}, "Sodium Sulfate", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust(), 57, TextureSet.SET_FLUID, - //No Byproducts + // No Byproducts new Pair<>(Materials.Sodium, 2), new Pair<>(Materials.Sulfur, 1), - new Pair<>(Materials.Oxygen, 4) - ); + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff FormicAcid = new Werkstoff( - new short[]{0xff, 0xaa, 0x77}, + new short[] {0xff, 0xaa, 0x77}, "Formic Acid", subscriptNumbers("CH2O2"), new Werkstoff.Stats().setElektrolysis(false), @@ -949,26 +964,24 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().addCells(), 58, TextureSet.SET_FLUID, - //No Byproducts + // No Byproducts new Pair<>(Materials.Carbon, 1), new Pair<>(Materials.Hydrogen, 2), - new Pair<>(Materials.Oxygen, 2) - ); + new Pair<>(Materials.Oxygen, 2)); public static final Werkstoff PotassiumDisulfate = new Werkstoff( - new short[]{0xfb, 0xbb, 0x66}, + new short[] {0xfb, 0xbb, 0x66}, "Potassium Disulfate", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addChemicalRecipes(), 59, TextureSet.SET_DULL, - //No Byproducts + // No Byproducts new Pair<>(Materials.Potassium, 2), new Pair<>(Materials.Sulfur, 2), - new Pair<>(Materials.Oxygen, 7) - ); + new Pair<>(Materials.Oxygen, 7)); public static final Werkstoff LeachResidue = new Werkstoff( - new short[]{0x64, 0x46, 0x29}, + new short[] {0x64, 0x46, 0x29}, "Leach Residue", "??IrOsRu??", new Werkstoff.Stats(), @@ -976,30 +989,30 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures(), 60, TextureSet.SET_ROUGH - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff RHSulfate = new Werkstoff( - new short[]{0xee, 0xaa, 0x55}, + new short[] {0xee, 0xaa, 0x55}, "Rhodium Sulfate", new Werkstoff.Stats().setGas(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().addCells(), 61, TextureSet.SET_FLUID - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff RHSulfateSolution = new Werkstoff( - new short[]{0xff, 0xbb, 0x66}, + new short[] {0xff, 0xbb, 0x66}, "Rhodium Sulfate Solution", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().addCells(), 62, TextureSet.SET_FLUID - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff CalciumChloride = new Werkstoff( - new short[]{0xff, 0xff, 0xff}, + new short[] {0xff, 0xff, 0xff}, "Calcium Chloride", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -1008,21 +1021,29 @@ public class WerkstoffLoader { TextureSet.SET_DULL, new Pair<>(Materials.Calcium, 1), new Pair<>(Materials.Chlorine, 2) - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff Ruthenium = new Werkstoff( - new short[]{0x64, 0x64, 0x64}, + new short[] {0x64, 0x64, 0x64}, "Ruthenium", "Ru", - new Werkstoff.Stats().setBlastFurnace(true).setMeltingPoint(2607).setMass(Element.Ru.getMass()).setProtons(Element.Ru.mProtons), + new Werkstoff.Stats() + .setBlastFurnace(true) + .setMeltingPoint(2607) + .setMass(Element.Ru.getMass()) + .setProtons(Element.Ru.mProtons), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().onlyDust().addMolten().addMetalItems().enforceUnification(), + new Werkstoff.GenerationFeatures() + .onlyDust() + .addMolten() + .addMetalItems() + .enforceUnification(), 64, TextureSet.SET_METALLIC - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff SodiumRuthenate = new Werkstoff( - new short[]{0x3a, 0x40, 0xcb}, + new short[] {0x3a, 0x40, 0xcb}, "Sodium Ruthenate", new Werkstoff.Stats(), Werkstoff.Types.COMPOUND, @@ -1032,10 +1053,10 @@ public class WerkstoffLoader { new Pair<>(Materials.Sodium, 2), new Pair<>(Ruthenium, 1), new Pair<>(Materials.Oxygen, 3) - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff RutheniumTetroxide = new Werkstoff( - new short[]{0xc7, 0xc7, 0xc7}, + new short[] {0xc7, 0xc7, 0xc7}, "Ruthenium Tetroxide", new Werkstoff.Stats().setMeltingPoint(313), Werkstoff.Types.COMPOUND, @@ -1044,10 +1065,10 @@ public class WerkstoffLoader { TextureSet.SET_DULL, new Pair<>(WerkstoffLoader.Ruthenium, 1), new Pair<>(Materials.Oxygen, 4) - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff HotRutheniumTetroxideSollution = new Werkstoff( - new short[]{0xc7, 0xc7, 0xc7}, + new short[] {0xc7, 0xc7, 0xc7}, "Hot Ruthenium Tetroxide Solution", "???", new Werkstoff.Stats().setGas(true).setMeltingPoint(700), @@ -1060,10 +1081,10 @@ public class WerkstoffLoader { new Pair<>(Materials.Chlorine, 2), new Pair<>(Materials.Sodium, 2), new Pair<>(Materials.Water, 2) - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff RutheniumTetroxideSollution = new Werkstoff( - new short[]{0xc7, 0xc7, 0xc7}, + new short[] {0xc7, 0xc7, 0xc7}, "Ruthenium Tetroxide Solution", "???", new Werkstoff.Stats().setMeltingPoint(313), @@ -1076,10 +1097,10 @@ public class WerkstoffLoader { new Pair<>(Materials.Chlorine, 2), new Pair<>(Materials.Sodium, 2), new Pair<>(Materials.Water, 2) - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff IrOsLeachResidue = new Werkstoff( - new short[]{0x64, 0x46, 0x29}, + new short[] {0x64, 0x46, 0x29}, "Rarest Metal Residue", "??OsIr??", new Werkstoff.Stats(), @@ -1087,12 +1108,11 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures(), 69, TextureSet.SET_ROUGH, - //No Byproducts + // No Byproducts new Pair<>(Materials.Osmiridium, 1), - new Pair<>(Materials.Stone, 2) - ); + new Pair<>(Materials.Stone, 2)); public static final Werkstoff IrLeachResidue = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Iridium Metal Residue", "??Ir??", new Werkstoff.Stats(), @@ -1102,10 +1122,10 @@ public class WerkstoffLoader { TextureSet.SET_ROUGH, new Pair<>(Materials.Iridium, 1), new Pair<>(Materials.Stone, 2) - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff PGSDResidue = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Sludge Dust Residue", new Werkstoff.Stats().setCentrifuge(true), Werkstoff.Types.MIXTURE, @@ -1113,10 +1133,9 @@ public class WerkstoffLoader { 71, TextureSet.SET_DULL, new Pair<>(Materials.SiliconDioxide, 3), - new Pair<>(Materials.Gold, 2) - ); + new Pair<>(Materials.Gold, 2)); public static final Werkstoff AcidicOsmiumSolution = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Acidic Osmium Solution", "???", new Werkstoff.Stats(), @@ -1125,10 +1144,9 @@ public class WerkstoffLoader { 72, TextureSet.SET_FLUID, new Pair<>(Materials.Osmium, 1), - new Pair<>(Materials.HydrochloricAcid, 1) - ); + new Pair<>(Materials.HydrochloricAcid, 1)); public static final Werkstoff IridiumDioxide = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Iridium Dioxide", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -1136,10 +1154,9 @@ public class WerkstoffLoader { 73, TextureSet.SET_FLUID, new Pair<>(Materials.Iridium, 1), - new Pair<>(Materials.Oxygen, 2) - ); + new Pair<>(Materials.Oxygen, 2)); public static final Werkstoff OsmiumSolution = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Osmium Solution", "???", new Werkstoff.Stats(), @@ -1148,10 +1165,9 @@ public class WerkstoffLoader { 74, TextureSet.SET_FLUID, new Pair<>(Materials.Osmium, 1), - new Pair<>(Materials.Hydrogen, 1) - ); + new Pair<>(Materials.Hydrogen, 1)); public static final Werkstoff AcidicIridiumSolution = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Acidic Iridium Solution", "???", new Werkstoff.Stats(), @@ -1160,10 +1176,9 @@ public class WerkstoffLoader { 75, TextureSet.SET_FLUID, new Pair<>(Materials.Iridium, 1), - new Pair<>(Materials.Hydrogen, 1) - ); + new Pair<>(Materials.Hydrogen, 1)); public static final Werkstoff IridiumChloride = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Iridium Chloride", subscriptNumbers("IrCl3"), new Werkstoff.Stats(), @@ -1172,10 +1187,9 @@ public class WerkstoffLoader { 76, TextureSet.SET_LAPIS, new Pair<>(Materials.Iridium, 1), - new Pair<>(Materials.Chlorine, 3) - ); + new Pair<>(Materials.Chlorine, 3)); public static final Werkstoff PGSDResidue2 = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Metallic Sludge Dust Residue", new Werkstoff.Stats().setCentrifuge(true), Werkstoff.Types.MIXTURE, @@ -1183,20 +1197,27 @@ public class WerkstoffLoader { 77, TextureSet.SET_DULL, new Pair<>(Materials.Nickel, 1), - new Pair<>(Materials.Copper, 1) - ); + new Pair<>(Materials.Copper, 1)); public static final Werkstoff Rhodium = new Werkstoff( - new short[]{0xF4, 0xF4, 0xF4}, + new short[] {0xF4, 0xF4, 0xF4}, "Rhodium", "Rh", - new Werkstoff.Stats().setProtons(Element.Rh.mProtons).setMass(Element.Rh.getMass()).setBlastFurnace(true).setMeltingPoint(2237), + new Werkstoff.Stats() + .setProtons(Element.Rh.mProtons) + .setMass(Element.Rh.getMass()) + .setBlastFurnace(true) + .setMeltingPoint(2237), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten().enforceUnification(), + new Werkstoff.GenerationFeatures() + .disable() + .onlyDust() + .addMetalItems() + .addMolten() + .enforceUnification(), 78, - TextureSet.SET_METALLIC - ); + TextureSet.SET_METALLIC); public static final Werkstoff CrudeRhMetall = new Werkstoff( - new short[]{0x66, 0x66, 0x66}, + new short[] {0x66, 0x66, 0x66}, "Crude Rhodium Metal", "??Rh??", new Werkstoff.Stats(), @@ -1205,28 +1226,25 @@ public class WerkstoffLoader { 79, TextureSet.SET_DULL, new Pair<>(Rhodium, 1), - new Pair<>(Materials.Stone, 1) - ); + new Pair<>(Materials.Stone, 1)); public static final Werkstoff RHSalt = new Werkstoff( - new short[]{0x84, 0x84, 0x84}, + new short[] {0x84, 0x84, 0x84}, "Rhodium Salt", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().onlyDust(), 80, - TextureSet.SET_GEM_VERTICAL - ); + TextureSet.SET_GEM_VERTICAL); public static final Werkstoff RHSaltSolution = new Werkstoff( - new short[]{0x66, 0x77, 0x88}, + new short[] {0x66, 0x77, 0x88}, "Rhodium Salt Solution", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().addCells(), 81, - TextureSet.SET_FLUID - ); + TextureSet.SET_FLUID); public static final Werkstoff SodiumNitrate = new Werkstoff( - new short[]{0x84, 0x66, 0x84}, + new short[] {0x84, 0x66, 0x84}, "Sodium Nitrate", subscriptNumbers("NaNO3"), new Werkstoff.Stats(), @@ -1236,19 +1254,17 @@ public class WerkstoffLoader { TextureSet.SET_ROUGH, new Pair<>(Materials.Sodium, 1), new Pair<>(Materials.Nitrogen, 1), - new Pair<>(Materials.Oxygen, 3) - ); + new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff RHNitrate = new Werkstoff( - new short[]{0x77, 0x66, 0x49}, + new short[] {0x77, 0x66, 0x49}, "Rhodium Nitrate", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().onlyDust(), 83, - TextureSet.SET_QUARTZ - ); + TextureSet.SET_QUARTZ); public static final Werkstoff ZincSulfate = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Zinc Sulfate", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.MIXTURE, @@ -1257,70 +1273,96 @@ public class WerkstoffLoader { TextureSet.SET_QUARTZ, new Pair<>(Materials.Zinc, 1), new Pair<>(Materials.Sulfur, 1), - new Pair<>(Materials.Oxygen, 4) - ); + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff RhFilterCake = new Werkstoff( - new short[]{0x77, 0x66, 0x49}, + new short[] {0x77, 0x66, 0x49}, "Rhodium Filter Cake", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().onlyDust(), 85, - TextureSet.SET_QUARTZ - ); + TextureSet.SET_QUARTZ); public static final Werkstoff RHFilterCakeSolution = new Werkstoff( - new short[]{0x66, 0x77, 0x88}, + new short[] {0x66, 0x77, 0x88}, "Rhodium Filter Cake Solution", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().addCells(), 86, - TextureSet.SET_FLUID - ); + TextureSet.SET_FLUID); public static final Werkstoff ReRh = new Werkstoff( - new short[]{0x77, 0x66, 0x49}, + new short[] {0x77, 0x66, 0x49}, "Reprecipitated Rhodium", subscriptNumbers("Rh2NH4"), new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().onlyDust(), 87, - TextureSet.SET_QUARTZ - ); + TextureSet.SET_QUARTZ); public static final Werkstoff LuVTierMaterial = new Werkstoff( Materials.Chrome.getRGBA(), "Rhodium-Plated Palladium", - new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500).setMeltingVoltage(480), + new Werkstoff.Stats() + .setCentrifuge(true) + .setBlastFurnace(true) + .setMeltingPoint(4500) + .setMeltingVoltage(480), Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), + new Werkstoff.GenerationFeatures() + .disable() + .onlyDust() + .addMolten() + .addMetalItems() + .addMixerRecipes() + .addSimpleMetalWorkingItems() + .addCraftingMetalWorkingItems() + .addMultipleIngotMetalWorkingItems(), 88, TextureSet.SET_METALLIC, new Pair<>(Materials.Palladium, 3), - new Pair<>(WerkstoffLoader.Rhodium, 1) - ); + new Pair<>(WerkstoffLoader.Rhodium, 1)); public static final Werkstoff Tiberium = new Werkstoff( - new short[]{0x22, 0xEE, 0x22}, + new short[] {0x22, 0xEE, 0x22}, "Tiberium", "Tr", - new Werkstoff.Stats().setProtons(123).setMass(326).setBlastFurnace(true).setMeltingPoint(1800).setRadioactive(true).setToxic(true), + new Werkstoff.Stats() + .setProtons(123) + .setMass(326) + .setBlastFurnace(true) + .setMeltingPoint(1800) + .setRadioactive(true) + .setToxic(true), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().addGems().addCraftingMetalWorkingItems().addSimpleMetalWorkingItems(), + new Werkstoff.GenerationFeatures() + .addGems() + .addCraftingMetalWorkingItems() + .addSimpleMetalWorkingItems(), 89, - TextureSet.SET_DIAMOND - ); + TextureSet.SET_DIAMOND); public static final Werkstoff Ruridit = new Werkstoff( - new short[]{0xA4, 0xA4, 0xA4}, + new short[] {0xA4, 0xA4, 0xA4}, "Ruridit", - new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500).setMeltingVoltage(480), + new Werkstoff.Stats() + .setCentrifuge(true) + .setBlastFurnace(true) + .setMeltingPoint(4500) + .setMeltingVoltage(480), Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), + new Werkstoff.GenerationFeatures() + .disable() + .onlyDust() + .addMolten() + .addMetalItems() + .addMixerRecipes() + .addSimpleMetalWorkingItems() + .addCraftingMetalWorkingItems() + .addMultipleIngotMetalWorkingItems(), 90, TextureSet.SET_METALLIC, new Pair<>(WerkstoffLoader.Ruthenium, 2), - new Pair<>(Materials.Iridium, 1) - ); + new Pair<>(Materials.Iridium, 1)); public static final Werkstoff Fluorspar = new Werkstoff( - new short[]{185, 69, 251}, + new short[] {185, 69, 251}, "Fluorspar", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -1328,14 +1370,25 @@ public class WerkstoffLoader { 91, TextureSet.SET_GEM_VERTICAL, new Pair<>(Materials.Calcium, 1), - new Pair<>(Materials.Fluorine, 2) - ); + new Pair<>(Materials.Fluorine, 2)); public static final Werkstoff HDCS = new Werkstoff( - new short[]{0x33, 0x44, 0x33}, + new short[] {0x33, 0x44, 0x33}, "High Durability Compound Steel", - new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(9000).setMeltingVoltage(7680), + new Werkstoff.Stats() + .setCentrifuge(true) + .setBlastFurnace(true) + .setMeltingPoint(9000) + .setMeltingVoltage(7680), Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), + new Werkstoff.GenerationFeatures() + .disable() + .onlyDust() + .addMolten() + .addMetalItems() + .addMixerRecipes() + .addSimpleMetalWorkingItems() + .addCraftingMetalWorkingItems() + .addMultipleIngotMetalWorkingItems(), 92, TextureSet.SET_SHINY, new Pair<>(Materials.TungstenSteel, 12), @@ -1343,10 +1396,9 @@ public class WerkstoffLoader { new Pair<>(Materials.HSSG, 6), new Pair<>(WerkstoffLoader.Ruridit, 3), new Pair<>(WerkstoffLoader.MagnetoResonaticDust, 2), - new Pair<>(Materials.Plutonium, 1) - ); + new Pair<>(Materials.Plutonium, 1)); public static final Werkstoff Atheneite = new Werkstoff( - new short[]{175, 175, 175}, + new short[] {175, 175, 175}, "Atheneite", subscriptNumbers("(Pd,Hg)3As"), new Werkstoff.Stats().setElektrolysis(true), @@ -1356,10 +1408,9 @@ public class WerkstoffLoader { TextureSet.SET_SHINY, new Pair<>(WerkstoffLoader.PDMetallicPowder, 3), new Pair<>(Materials.Mercury, 3), - new Pair<>(Materials.Arsenic, 1) - ); + new Pair<>(Materials.Arsenic, 1)); public static final Werkstoff Temagamite = new Werkstoff( - new short[]{245, 245, 245}, + new short[] {245, 245, 245}, "Temagamite", subscriptNumbers("Pd3HgTe"), new Werkstoff.Stats().setElektrolysis(true), @@ -1369,10 +1420,9 @@ public class WerkstoffLoader { TextureSet.SET_ROUGH, new Pair<>(WerkstoffLoader.PDMetallicPowder, 3), new Pair<>(Materials.Mercury, 1), - new Pair<>(Materials.Tellurium, 1) - ); + new Pair<>(Materials.Tellurium, 1)); public static final Werkstoff Terlinguaite = new Werkstoff( - new short[]{245, 245, 245}, + new short[] {245, 245, 245}, "Terlinguaite", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -1381,24 +1431,35 @@ public class WerkstoffLoader { TextureSet.SET_GEM_HORIZONTAL, new Pair<>(Materials.Mercury, 2), new Pair<>(Materials.Chlorine, 1), - new Pair<>(Materials.Oxygen, 1) - ); + new Pair<>(Materials.Oxygen, 1)); public static final Werkstoff AdemicSteel = new Werkstoff( - new short[]{0xcc, 0xcc, 0xcc}, + new short[] {0xcc, 0xcc, 0xcc}, "Ademic Steel", "The break in the line", - new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setDurOverride(6144).setMeltingPoint(1800).setSpeedOverride(12).setQualityOverride((byte) 4).setMeltingVoltage(1920), + new Werkstoff.Stats() + .setCentrifuge(true) + .setBlastFurnace(true) + .setDurOverride(6144) + .setMeltingPoint(1800) + .setSpeedOverride(12) + .setQualityOverride((byte) 4) + .setMeltingVoltage(1920), Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().onlyDust().addMetalItems().addCraftingMetalWorkingItems().addMolten().addSimpleMetalWorkingItems().addMultipleIngotMetalWorkingItems(), + new Werkstoff.GenerationFeatures() + .onlyDust() + .addMetalItems() + .addCraftingMetalWorkingItems() + .addMolten() + .addSimpleMetalWorkingItems() + .addMultipleIngotMetalWorkingItems(), 96, TextureSet.SET_METALLIC, new Pair<>(Materials.Steel, 2), new Pair<>(Materials.VanadiumSteel, 1), new Pair<>(Materials.DamascusSteel, 1), - new Pair<>(Materials.Carbon, 4) - ); + new Pair<>(Materials.Carbon, 4)); public static final Werkstoff RawAdemicSteel = new Werkstoff( - new short[]{0xed, 0xed, 0xed}, + new short[] {0xed, 0xed, 0xed}, "Raw Ademic Steel", new Werkstoff.Stats().setCentrifuge(true), Werkstoff.Types.MIXTURE, @@ -1407,84 +1468,76 @@ public class WerkstoffLoader { TextureSet.SET_ROUGH, new Pair<>(Materials.Steel, 2), new Pair<>(Materials.VanadiumSteel, 1), - new Pair<>(Materials.DamascusSteel, 1) - ); + new Pair<>(Materials.DamascusSteel, 1)); public static final Werkstoff HexafluorosilicicAcid = new Werkstoff( - new short[]{0x2c, 0x70, 0xb5}, - "Hexafluorosilicic Acid", - subscriptNumbers("H2SiF6"), - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().addCells(), - 98, - TextureSet.SET_FLUID, - new Pair<>(Materials.Hydrogen, 2), - new Pair<>(Materials.Silicon, 1), - new Pair<>(Materials.Fluorine, 6) - ); + new short[] {0x2c, 0x70, 0xb5}, + "Hexafluorosilicic Acid", + subscriptNumbers("H2SiF6"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + 98, + TextureSet.SET_FLUID, + new Pair<>(Materials.Hydrogen, 2), + new Pair<>(Materials.Silicon, 1), + new Pair<>(Materials.Fluorine, 6)); public static final Werkstoff Potassiumfluorosilicate = new Werkstoff( - new short[]{0x2e, 0x97, 0xb2}, - "Potassiumfluorosilicate", - subscriptNumbers("K2SiF6"), - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 99, - TextureSet.SET_SHINY, - new Pair<>(Materials.Potassium, 2), - new Pair<>(Materials.Silicon, 1), - new Pair<>(Materials.Fluorine, 6) - ); + new short[] {0x2e, 0x97, 0xb2}, + "Potassiumfluorosilicate", + subscriptNumbers("K2SiF6"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 99, + TextureSet.SET_SHINY, + new Pair<>(Materials.Potassium, 2), + new Pair<>(Materials.Silicon, 1), + new Pair<>(Materials.Fluorine, 6)); public static final Werkstoff Alumina = new Werkstoff( - new short[]{0xa0, 0xad, 0xb1}, - "Alumina", - subscriptNumbers("Al2O3"), - new Werkstoff.Stats(), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 100, - TextureSet.SET_DULL - ); + new short[] {0xa0, 0xad, 0xb1}, + "Alumina", + subscriptNumbers("Al2O3"), + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 100, + TextureSet.SET_DULL); public static final Werkstoff PotassiumCarbonate = new Werkstoff( - new short[]{0x7b, 0x96, 0x4f}, - "Potassium Carbonate", - subscriptNumbers("K2CO3"), - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 101, - TextureSet.SET_DULL, - new Pair<>(Materials.Potassium, 2), - new Pair<>(Materials.Carbon, 1), - new Pair<>(Materials.Oxygen, 3) - ); + new short[] {0x7b, 0x96, 0x4f}, + "Potassium Carbonate", + subscriptNumbers("K2CO3"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 101, + TextureSet.SET_DULL, + new Pair<>(Materials.Potassium, 2), + new Pair<>(Materials.Carbon, 1), + new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff RawFluorophlogopite = new Werkstoff( - new short[]{0x36, 0x51, 0x0b}, - "Raw Fluorophlogopite", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 102, - TextureSet.SET_DULL - ); + new short[] {0x36, 0x51, 0x0b}, + "Raw Fluorophlogopite", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 102, + TextureSet.SET_DULL); public static final Werkstoff HotFluorophlogopite = new Werkstoff( - new short[]{0xbf, 0xd3, 0x55}, - "Unformed Fluorophlogopite", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().addCells(), - 103, - TextureSet.SET_FLUID - ); + new short[] {0xbf, 0xd3, 0x55}, + "Unformed Fluorophlogopite", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 103, + TextureSet.SET_FLUID); public static final Werkstoff Fluorophlogopite = new Werkstoff( - new short[]{0xbf, 0xd3, 0x55}, - "Fluorophlogopite", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems(), - 104, - TextureSet.SET_SHINY - ); + new short[] {0xbf, 0xd3, 0x55}, + "Fluorophlogopite", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems(), + 104, + TextureSet.SET_SHINY); public static HashMap items = new HashMap<>(); public static HashBiMap fluids = HashBiMap.create(); @@ -1514,34 +1567,31 @@ public class WerkstoffLoader { public static ItemStack getCorrespondingItemStackUnsafe(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { if (!werkstoff.getGenerationFeatures().enforceUnification) { ItemStack ret = GT_OreDictUnificator.get(orePrefixes, werkstoff.getBridgeMaterial(), amount); - if (ret != null) - return ret; + if (ret != null) return ret; ret = OreDictHandler.getItemStack(werkstoff.getVarName(), orePrefixes, amount); - if (ret != null) - return ret; + if (ret != null) return ret; } - if (orePrefixes == ore) - return new ItemStack(WerkstoffLoader.BWOres, amount, werkstoff.getmID()); - else if (orePrefixes == oreSmall) - return new ItemStack(WerkstoffLoader.BWSmallOres, amount, werkstoff.getmID()); - else if (orePrefixes == block) - return new ItemStack(WerkstoffLoader.BWBlocks, amount, werkstoff.getmID()); + if (orePrefixes == ore) return new ItemStack(WerkstoffLoader.BWOres, amount, werkstoff.getmID()); + else if (orePrefixes == oreSmall) return new ItemStack(WerkstoffLoader.BWSmallOres, amount, werkstoff.getmID()); + else if (orePrefixes == block) return new ItemStack(WerkstoffLoader.BWBlocks, amount, werkstoff.getmID()); else if (orePrefixes == WerkstoffLoader.blockCasing) return new ItemStack(WerkstoffLoader.BWBlockCasings, amount, werkstoff.getmID()); else if (orePrefixes == WerkstoffLoader.blockCasingAdvanced) return new ItemStack(WerkstoffLoader.BWBlockCasingsAdvanced, amount, werkstoff.getmID()); - else if (WerkstoffLoader.items.get(orePrefixes) == null) - return null; + else if (WerkstoffLoader.items.get(orePrefixes) == null) return null; return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); } public static ItemStack getCorrespondingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { ItemStack stack = getCorrespondingItemStackUnsafe(orePrefixes, werkstoff, amount); - if (stack != null) - return stack; + if (stack != null) return stack; else - MainMod.LOGGER.catching(Level.ERROR, new Exception("NO SUCH ITEM! " + orePrefixes + werkstoff.getVarName() + " If you encounter this as a user, make sure to contact the authors of the pack/the mods you're playing! " + - "If you are a Developer, you forgot to enable " + orePrefixes + " OrePrefix for Werkstoff " + werkstoff.getDefaultName())); + MainMod.LOGGER.catching( + Level.ERROR, + new Exception("NO SUCH ITEM! " + orePrefixes + werkstoff.getVarName() + + " If you encounter this as a user, make sure to contact the authors of the pack/the mods you're playing! " + + "If you are a Developer, you forgot to enable " + orePrefixes + + " OrePrefix for Werkstoff " + werkstoff.getDefaultName())); return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); } @@ -1553,51 +1603,52 @@ public class WerkstoffLoader { addItemsForGeneration(); runAdditionalOreDict(); long timepost = System.nanoTime(); - MainMod.LOGGER.info("Making Meta Items for BW Materials took " + (timepost - timepre) + "ns/" + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); + MainMod.LOGGER.info("Making Meta Items for BW Materials took " + (timepost - timepre) + "ns/" + + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); } public static void run() { if (!registered) { MainMod.LOGGER.info("Loading Processing Recipes for BW Materials"); long timepre = System.nanoTime(); - ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashSet.size() + 1); + ProgressManager.ProgressBar progressBar = + ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashSet.size() + 1); DebugLog.log("Loading Recipes" + (System.nanoTime() - timepre)); Integer[] clsArr = new Integer[0]; int size = 0; - if (LoaderReference.betterloadingscreen) - clsArr = CLSCompat.initCls(); + if (LoaderReference.betterloadingscreen) clsArr = CLSCompat.initCls(); - IWerkstoffRunnable[] werkstoffRunnables = new IWerkstoffRunnable[]{ - new ToolLoader(), - new DustLoader(), - new GemLoader(), - new SimpleMetalLoader(), - new CasingLoader(), - new AspectLoader(), - new OreLoader(), - new CrushedLoader(), - new CraftingMaterialLoader(), - new CellLoader(), - new MoltenCellLoader(), - new MultipleMetalLoader(), - new MetalLoader(), - new BlockLoader() + IWerkstoffRunnable[] werkstoffRunnables = new IWerkstoffRunnable[] { + new ToolLoader(), + new DustLoader(), + new GemLoader(), + new SimpleMetalLoader(), + new CasingLoader(), + new AspectLoader(), + new OreLoader(), + new CrushedLoader(), + new CraftingMaterialLoader(), + new CellLoader(), + new MoltenCellLoader(), + new MultipleMetalLoader(), + new MetalLoader(), + new BlockLoader() }; long timepreone = 0; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { timepreone = System.nanoTime(); - DebugLog.log("Werkstoff is null or id < 0 ? " + (werkstoff == null || werkstoff.getmID() < 0) + " " + (System.nanoTime() - timepreone)); + DebugLog.log("Werkstoff is null or id < 0 ? " + (werkstoff == null || werkstoff.getmID() < 0) + " " + + (System.nanoTime() - timepreone)); if (werkstoff == null || werkstoff.getmID() < 0) { progressBar.step(""); continue; } - if (LoaderReference.betterloadingscreen) - size = CLSCompat.invokeStepSize(werkstoff, clsArr, size); + if (LoaderReference.betterloadingscreen) size = CLSCompat.invokeStepSize(werkstoff, clsArr, size); DebugLog.log("Werkstoff: " + werkstoff.getDefaultName() + " " + (System.nanoTime() - timepreone)); for (IWerkstoffRunnable runnable : werkstoffRunnables) { String loaderName = runnable.getClass().getSimpleName(); - DebugLog.log( loaderName + " started " + (System.nanoTime() - timepreone)); + DebugLog.log(loaderName + " started " + (System.nanoTime() - timepreone)); runnable.run(werkstoff); DebugLog.log(loaderName + " done " + (System.nanoTime() - timepreone)); } @@ -1607,14 +1658,14 @@ public class WerkstoffLoader { DebugLog.log("Loading New Circuits" + " " + (System.nanoTime() - timepreone)); BW_CircuitsLoader.initNewCircuits(); - if (LoaderReference.betterloadingscreen) - CLSCompat.disableCls(); + if (LoaderReference.betterloadingscreen) CLSCompat.disableCls(); progressBar.step("Load Additional Recipes"); AdditionalRecipes.run(); ProgressManager.pop(progressBar); long timepost = System.nanoTime(); - MainMod.LOGGER.info("Loading Processing Recipes for BW Materials took " + (timepost - timepre) + "ns/" + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); + MainMod.LOGGER.info("Loading Processing Recipes for BW Materials took " + (timepost - timepre) + "ns/" + + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); registered = true; } } @@ -1641,7 +1692,7 @@ public class WerkstoffLoader { WerkstoffLoader.MagnetoResonaticDust.add(WerkstoffLoader.NO_BLAST); - //Calcium Smelting block + // Calcium Smelting block Materials.Calcium.mBlastFurnaceRequired = true; Materials.Salt.mDurability = WerkstoffLoader.Salt.getDurability(); @@ -1660,7 +1711,8 @@ public class WerkstoffLoader { Materials.Calcium.mToolQuality = WerkstoffLoader.Calcium.getToolQuality(); for (Werkstoff W : Werkstoff.werkstoffHashSet) { - for (Pair pair : W.getContents().getValue().toArray(new Pair[0])) { + for (Pair pair : + W.getContents().getValue().toArray(new Pair[0])) { if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Neodymium) { W.add(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM); @@ -1687,7 +1739,9 @@ public class WerkstoffLoader { if (werkstoff.hasItemType(cell)) { if (!FluidRegistry.isFluidRegistered(werkstoff.getDefaultName())) { DebugLog.log("Adding new Fluid: " + werkstoff.getDefaultName()); - GT_Fluid fluid = (GT_Fluid) new GT_Fluid(werkstoff.getDefaultName(), "autogenerated", werkstoff.getRGBA()).setGaseous(werkstoff.getStats().isGas()); + GT_Fluid fluid = + (GT_Fluid) new GT_Fluid(werkstoff.getDefaultName(), "autogenerated", werkstoff.getRGBA()) + .setGaseous(werkstoff.getStats().isGas()); FluidRegistry.registerFluid(fluid); WerkstoffLoader.fluids.put(werkstoff, fluid); } else { @@ -1697,23 +1751,31 @@ public class WerkstoffLoader { if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { if (!FluidRegistry.isFluidRegistered("molten." + werkstoff.getDefaultName())) { DebugLog.log("Adding new Molten: " + werkstoff.getDefaultName()); - Fluid fluid = new GT_Fluid("molten." + werkstoff.getDefaultName(), "molten.autogenerated", werkstoff.getRGBA()); + Fluid fluid = new GT_Fluid( + "molten." + werkstoff.getDefaultName(), "molten.autogenerated", werkstoff.getRGBA()); if (werkstoff.getStats().getMeltingPoint() > 0) fluid = fluid.setTemperature(werkstoff.getStats().getMeltingPoint()); FluidRegistry.registerFluid(fluid); - //GT_LanguageManager.addStringLocalization("Molten." + werkstoff.getDefaultName(), "Molten "+ werkstoff.getDefaultName()); - GT_LanguageManager.addStringLocalization(fluid.getUnlocalizedName(), "Molten " + werkstoff.getDefaultName()); + // GT_LanguageManager.addStringLocalization("Molten." + werkstoff.getDefaultName(), "Molten "+ + // werkstoff.getDefaultName()); + GT_LanguageManager.addStringLocalization( + fluid.getUnlocalizedName(), "Molten " + werkstoff.getDefaultName()); WerkstoffLoader.molten.put(werkstoff, fluid); } else { WerkstoffLoader.molten.put(werkstoff, FluidRegistry.getFluid(werkstoff.getDefaultName())); } } for (OrePrefixes p : values()) - if (Materials.get(werkstoff.getDefaultName()) != null && Materials.get(werkstoff.getDefaultName()).mMetaItemSubID != -1 && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(), p, 1) != null) { - DebugLog.log("Found: " + (p + werkstoff.getVarName()) + " in GT material system, disable and reroute my Items to that, also add a Tooltip."); + if (Materials.get(werkstoff.getDefaultName()) != null + && Materials.get(werkstoff.getDefaultName()).mMetaItemSubID != -1 + && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 + && OreDictHandler.getItemStack(werkstoff.getDefaultName(), p, 1) != null) { + DebugLog.log("Found: " + (p + werkstoff.getVarName()) + + " in GT material system, disable and reroute my Items to that, also add a Tooltip."); werkstoff.getGenerationFeatures().setBlacklist(p); } - WerkstoffLoader.toGenerateGlobal = (WerkstoffLoader.toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); + WerkstoffLoader.toGenerateGlobal = + (WerkstoffLoader.toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); } DebugLog.log("GlobalGeneration: " + WerkstoffLoader.toGenerateGlobal); if ((WerkstoffLoader.toGenerateGlobal & 0b1) != 0) { @@ -1723,7 +1785,7 @@ public class WerkstoffLoader { } if ((WerkstoffLoader.toGenerateGlobal & 0b10) != 0) { WerkstoffLoader.items.put(ingot, new BW_MetaGenerated_Items(ingot)); - WerkstoffLoader.items.put(ingotHot, new BW_MetaGenerated_Items(ingotHot)); //1750 + WerkstoffLoader.items.put(ingotHot, new BW_MetaGenerated_Items(ingotHot)); // 1750 WerkstoffLoader.items.put(nugget, new BW_MetaGenerated_Items(nugget)); } if ((WerkstoffLoader.toGenerateGlobal & 0b100) != 0) { @@ -1744,15 +1806,15 @@ public class WerkstoffLoader { } if ((WerkstoffLoader.toGenerateGlobal & 0b10000) != 0) { WerkstoffLoader.items.put(cell, new BW_MetaGenerated_Items(cell)); - //WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle)); - if (LoaderReference.Forestry) - WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); + // WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle)); + if (LoaderReference.Forestry) WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); } if ((WerkstoffLoader.toGenerateGlobal & 0b100000) != 0) { WerkstoffLoader.items.put(cellPlasma, new BW_MetaGenerated_Items(cellPlasma)); } if ((WerkstoffLoader.toGenerateGlobal & 0b1000000) != 0) { - WerkstoffLoader.items.put(WerkstoffLoader.cellMolten, new BW_MetaGenerated_Items(WerkstoffLoader.cellMolten)); + WerkstoffLoader.items.put( + WerkstoffLoader.cellMolten, new BW_MetaGenerated_Items(WerkstoffLoader.cellMolten)); if (LoaderReference.Forestry) WerkstoffLoader.items.put(capsuleMolten, new BW_MetaGenerated_Items(capsuleMolten)); } @@ -1794,79 +1856,67 @@ public class WerkstoffLoader { } static void gameRegistryHandler() { - if (SideReference.Side.Client) - RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); + if (SideReference.Side.Client) RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); GameRegistry.registerTileEntity(BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmallTE"); GameRegistry.registerTileEntity(BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblockTE"); GameRegistry.registerTileEntity(BW_MetaGeneratedBlocks_Casing_TE.class, "bw.werkstoffblockcasingTE"); - GameRegistry.registerTileEntity(BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, "bw.werkstoffblockscasingadvancedTE"); + GameRegistry.registerTileEntity( + BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, "bw.werkstoffblockscasingadvancedTE"); WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); - WerkstoffLoader.BWSmallOres = new BW_MetaGenerated_SmallOres(Material.rock, BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmall"); - WerkstoffLoader.BWBlocks = new BW_MetaGenerated_WerkstoffBlocks(Material.iron, BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblocks"); - WerkstoffLoader.BWBlockCasings = new BW_MetaGeneratedBlocks_Casing(Material.iron, BW_MetaGeneratedBlocks_Casing_TE.class, "bw.werkstoffblockscasing", blockCasing); - WerkstoffLoader.BWBlockCasingsAdvanced = new BW_MetaGeneratedBlocks_Casing(Material.iron, BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, "bw.werkstoffblockscasingadvanced", blockCasingAdvanced); + WerkstoffLoader.BWSmallOres = + new BW_MetaGenerated_SmallOres(Material.rock, BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmall"); + WerkstoffLoader.BWBlocks = new BW_MetaGenerated_WerkstoffBlocks( + Material.iron, BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblocks"); + WerkstoffLoader.BWBlockCasings = new BW_MetaGeneratedBlocks_Casing( + Material.iron, BW_MetaGeneratedBlocks_Casing_TE.class, "bw.werkstoffblockscasing", blockCasing); + WerkstoffLoader.BWBlockCasingsAdvanced = new BW_MetaGeneratedBlocks_Casing( + Material.iron, + BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, + "bw.werkstoffblockscasingadvanced", + blockCasingAdvanced); GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.01"); GameRegistry.registerBlock(WerkstoffLoader.BWSmallOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.02"); GameRegistry.registerBlock(WerkstoffLoader.BWBlocks, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblocks.01"); if (!ConfigHandler.disableBoltedBlocksCasing) - GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasings, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasing.01"); + GameRegistry.registerBlock( + WerkstoffLoader.BWBlockCasings, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasing.01"); if (!ConfigHandler.disableReboltedBlocksCasing) - GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasingsAdvanced, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasingadvanced.01"); + GameRegistry.registerBlock( + WerkstoffLoader.BWBlockCasingsAdvanced, + BW_MetaGeneratedBlock_Item.class, + "bw.werkstoffblockscasingadvanced.01"); GTMetaItemEnhancer.addAdditionalOreDictToForestry(); GTMetaItemEnhancer.init(); } private static void runGTItemDataRegistrator() { - IWerkstoffRunnable[] registrations = new IWerkstoffRunnable[] { - new BridgeMaterialsLoader(), - new AssociationLoader(), - new CasingRegistrator() - }; + IWerkstoffRunnable[] registrations = + new IWerkstoffRunnable[] {new BridgeMaterialsLoader(), new AssociationLoader(), new CasingRegistrator() + }; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { for (IWerkstoffRunnable registration : registrations) { - registration.run(werkstoff); + registration.run(werkstoff); } } addFakeItemDataToInWorldBlocksAndCleanUpFakeData(); addVanillaCasingsToGTOreDictUnificator(); } - public static void addVanillaCasingsToGTOreDictUnificator(){ - GT_OreDictUnificator.addAssociation( - blockCasing, Materials.Aluminium, - ItemList.Casing_FrostProof.get(1L), - false - ); - GT_OreDictUnificator.addAssociation( - blockCasing, Materials.Nickel, - ItemList.Casing_HeatProof.get(1L), - false - ); - GT_OreDictUnificator.addAssociation( - blockCasing, Materials.Lead, - ItemList.Casing_RadiationProof.get(1L), - false - ); + public static void addVanillaCasingsToGTOreDictUnificator() { GT_OreDictUnificator.addAssociation( - blockCasing, Materials.Steel, - ItemList.Casing_SolidSteel.get(1L), - false - ); + blockCasing, Materials.Aluminium, ItemList.Casing_FrostProof.get(1L), false); + GT_OreDictUnificator.addAssociation(blockCasing, Materials.Nickel, ItemList.Casing_HeatProof.get(1L), false); + GT_OreDictUnificator.addAssociation(blockCasing, Materials.Lead, ItemList.Casing_RadiationProof.get(1L), false); + GT_OreDictUnificator.addAssociation(blockCasing, Materials.Steel, ItemList.Casing_SolidSteel.get(1L), false); GT_OreDictUnificator.addAssociation( - blockCasing, Materials.TungstenSteel, - ItemList.Casing_RobustTungstenSteel.get(1L), - false - ); + blockCasing, Materials.TungstenSteel, ItemList.Casing_RobustTungstenSteel.get(1L), false); GT_OreDictUnificator.addAssociation( - blockCasing, Materials.Polytetrafluoroethylene, - ItemList.Casing_Chemically_Inert.get(1L), - false - ); + blockCasing, Materials.Polytetrafluoroethylene, ItemList.Casing_Chemically_Inert.get(1L), false); } /** @@ -1886,8 +1936,7 @@ public class WerkstoffLoader { e.printStackTrace(); } - if (MATERIALS_MAP == null) - throw new NullPointerException("MATERIALS_MAP null!"); + if (MATERIALS_MAP == null) throw new NullPointerException("MATERIALS_MAP null!"); Materials oreMat = new Materials(-1, null, 0, 0, 0, false, "bwores", "bwores", null, true, null); Materials smallOreMat = new Materials(-1, null, 0, 0, 0, false, "bwsmallores", "bwsmallores", null, true, null); @@ -1907,14 +1956,14 @@ public class WerkstoffLoader { public static void removeIC2Recipes() { try { Set> remset = new HashSet<>(); - for (Map.Entry curr : Recipes.macerator.getRecipes().entrySet()) { + for (Map.Entry curr : + Recipes.macerator.getRecipes().entrySet()) { if (curr.getKey() instanceof RecipeInputOreDict) { if (((RecipeInputOreDict) curr.getKey()).input.equalsIgnoreCase("oreNULL")) { remset.add(curr); } for (ItemStack stack : curr.getValue().items) { - if (stack.getItem() instanceof BW_MetaGenerated_Items) - remset.add(curr); + if (stack.getItem() instanceof BW_MetaGenerated_Items) remset.add(curr); } } } @@ -1930,22 +1979,29 @@ public class WerkstoffLoader { GT_OreDictUnificator.registerOre(ore + werkstoff.getVarName(), werkstoff.get(ore)); GT_OreDictUnificator.registerOre(oreSmall + werkstoff.getVarName(), werkstoff.get(oreSmall)); werkstoff.getADDITIONAL_OREDICT().forEach(e -> OreDictionary.registerOre(ore + e, werkstoff.get(ore))); - werkstoff.getADDITIONAL_OREDICT().forEach(e -> OreDictionary.registerOre(oreSmall + e, werkstoff.get(oreSmall))); + werkstoff + .getADDITIONAL_OREDICT() + .forEach(e -> OreDictionary.registerOre(oreSmall + e, werkstoff.get(oreSmall))); } if (werkstoff.hasItemType(gem)) - OreDictionary.registerOre("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens)); + OreDictionary.registerOre( + "craftingLens" + + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()) + .mName + .replace(" ", ""), + werkstoff.get(lens)); if (werkstoff.hasItemType(gem) || werkstoff.hasItemType(ingot)) { GT_OreDictUnificator.registerOre(block + werkstoff.getVarName(), werkstoff.get(block)); - werkstoff.getADDITIONAL_OREDICT().forEach(e -> OreDictionary.registerOre(block + e, werkstoff.get(block))); + werkstoff + .getADDITIONAL_OREDICT() + .forEach(e -> OreDictionary.registerOre(block + e, werkstoff.get(block))); } - werkstoff.getADDITIONAL_OREDICT() - .forEach(s -> ENABLED_ORE_PREFIXES - .stream() - .filter(o -> Objects.nonNull(werkstoff.get(o))) - .forEach(od -> OreDictionary.registerOre(od + s, werkstoff.get(od)))); + werkstoff.getADDITIONAL_OREDICT().forEach(s -> ENABLED_ORE_PREFIXES.stream() + .filter(o -> Objects.nonNull(werkstoff.get(o))) + .forEach(od -> OreDictionary.registerOre(od + s, werkstoff.get(od)))); } GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 7ab619a92f..149bd67629 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.CLEANROOM; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; @@ -41,56 +44,52 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; import ic2.core.item.ItemFluidCell; +import java.lang.reflect.Field; +import java.util.Map; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.reflect.FieldUtils; -import java.lang.reflect.Field; -import java.util.Map; - -import static com.github.bartimaeusnek.bartworks.util.BW_Util.CLEANROOM; -import static gregtech.api.enums.OrePrefixes.*; - public class AdditionalRecipes { - private static BWRecipes.BW_Recipe_Map_LiquidFuel sAcidGenFuels = ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)); - private static BWRecipes.BacteriaVatRecipeMap sBacteriaVat = ((BWRecipes.BacteriaVatRecipeMap) BWRecipes.instance.getMappingsFor((byte) 1)); + private static BWRecipes.BW_Recipe_Map_LiquidFuel sAcidGenFuels = + ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)); + private static BWRecipes.BacteriaVatRecipeMap sBacteriaVat = + ((BWRecipes.BacteriaVatRecipeMap) BWRecipes.instance.getMappingsFor((byte) 1)); private static GT_Recipe.GT_Recipe_Map sBiolab = BWRecipes.instance.getMappingsFor((byte) 0); - private static void runBWRecipes(){ + private static void runBWRecipes() { if (ConfigHandler.BioLab) { - FluidStack[] dnaFluid = {LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L)}; + FluidStack[] dnaFluid = { + LoaderReference.gendustry + ? FluidRegistry.getFluidStack("liquiddna", 1000) + : Materials.Biomass.getFluid(1000L) + }; for (ItemStack stack : BioItemList.getAllPetriDishes()) { - BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); + BioData DNA = + BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); if (DNA != null) { ItemStack Detergent = BioItemList.getOther(1); ItemStack DNAFlask = BioItemList.getDNASampleFlask(null); ItemStack EthanolCell = Materials.Ethanol.getCells(1); - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - stack, - DNAFlask, - Detergent, - EthanolCell - }, - new ItemStack[]{ - BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(DNA)), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L) + sBiolab.addFakeRecipe( + false, + new ItemStack[] {stack, DNAFlask, Detergent, EthanolCell}, + new ItemStack[] { + BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(DNA)), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L) }, BioItemList.mBioLabParts[0], - new int[]{DNA.getChance(), 10000}, - new FluidStack[]{ - FluidRegistry.getFluidStack("ic2distilledwater", 1000) - }, + new int[] {DNA.getChance(), 10000}, + new FluidStack[] {FluidRegistry.getFluidStack("ic2distilledwater", 1000)}, null, 500, BW_Util.getMachineVoltageFromTier(3 + DNA.getTier()), - BW_Util.STANDART - ); + BW_Util.STANDART); } } @@ -102,25 +101,22 @@ public class AdditionalRecipes { Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); Behaviour_DataOrb.setDataName(Outp, DNA.getName()); - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - stack, - FluidLoader.BioLabFluidCells[0], - FluidLoader.BioLabFluidCells[3], - ItemList.Tool_DataOrb.get(1L) - }, - new ItemStack[]{ - Outp, - ItemList.Cell_Universal_Fluid.get(2L) + sBiolab.addFakeRecipe( + false, + new ItemStack[] { + stack, + FluidLoader.BioLabFluidCells[0], + FluidLoader.BioLabFluidCells[3], + ItemList.Tool_DataOrb.get(1L) }, + new ItemStack[] {Outp, ItemList.Cell_Universal_Fluid.get(2L)}, BioItemList.mBioLabParts[1], - new int[]{DNA.getChance(), 10000}, + new int[] {DNA.getChance(), 10000}, dnaFluid, null, 500, BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), - BW_Util.STANDART - ); + BW_Util.STANDART); } } @@ -135,130 +131,117 @@ public class AdditionalRecipes { Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - FluidLoader.BioLabFluidCells[1], - BioItemList.getPlasmidCell(null), - inp, - inp2 - }, - new ItemStack[]{ - stack, - ItemList.Cell_Universal_Fluid.get(1L) + sBiolab.addFakeRecipe( + false, + new ItemStack[] { + FluidLoader.BioLabFluidCells[1], BioItemList.getPlasmidCell(null), inp, inp2 }, + new ItemStack[] {stack, ItemList.Cell_Universal_Fluid.get(1L)}, BioItemList.mBioLabParts[2], - new int[]{DNA.getChance(), 10000}, + new int[] {DNA.getChance(), 10000}, dnaFluid, null, 500, BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), - BW_Util.STANDART - ); + BW_Util.STANDART); } } for (ItemStack stack : BioItemList.getAllPetriDishes()) { - BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); - BioData Plasmid = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("Plasmid")); + BioData DNA = + BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); + BioData Plasmid = + BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("Plasmid")); if (DNA.getName() != Plasmid.getName()) { - sBiolab.addFakeRecipe(true, - new ItemStack[]{ - BioItemList.getPetriDish(BioCulture.getBioCulture(DNA.getName())), - BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(Plasmid)), - FluidLoader.BioLabFluidCells[2], - }, - new ItemStack[]{ - stack, - ItemList.Cell_Universal_Fluid.get(1L) - }, - BioItemList.mBioLabParts[3], - new int[]{10000, 10000}, - new FluidStack[]{ - FluidRegistry.getFluidStack("ic2distilledwater", 1000) - }, - null, - 500, - BW_Util.getMachineVoltageFromTier(6), - BW_Util.STANDART - ); + sBiolab.addFakeRecipe( + true, + new ItemStack[] { + BioItemList.getPetriDish(BioCulture.getBioCulture(DNA.getName())), + BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(Plasmid)), + FluidLoader.BioLabFluidCells[2], + }, + new ItemStack[] {stack, ItemList.Cell_Universal_Fluid.get(1L)}, + BioItemList.mBioLabParts[3], + new int[] {10000, 10000}, + new FluidStack[] {FluidRegistry.getFluidStack("ic2distilledwater", 1000)}, + null, + 500, + BW_Util.getMachineVoltageFromTier(6), + BW_Util.STANDART); } } - ItemStack Outp = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); Behaviour_DataOrb.setDataName(Outp, "Any DNA"); - //Clonal Cellular Synthesis- [Liquid DNA] + Medium Petri Dish + Plasma Membrane + Stem Cells + Genome Data - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - BioItemList.getPetriDish(null), - BioItemList.getOther(4), - ItemList.Circuit_Chip_Stemcell.get(2L), - Outp + // Clonal Cellular Synthesis- [Liquid DNA] + Medium Petri Dish + Plasma Membrane + Stem Cells + Genome Data + sBiolab.addFakeRecipe( + false, + new ItemStack[] { + BioItemList.getPetriDish(null), + BioItemList.getOther(4), + ItemList.Circuit_Chip_Stemcell.get(2L), + Outp }, - new ItemStack[]{ - BioItemList.getPetriDish(null).setStackDisplayName("The Culture made from DNA"), + new ItemStack[] { + BioItemList.getPetriDish(null).setStackDisplayName("The Culture made from DNA"), }, BioItemList.mBioLabParts[4], - new int[]{7500, 10000}, - new FluidStack[]{new FluidStack(dnaFluid[0].getFluid(), 9000)}, + new int[] {7500, 10000}, + new FluidStack[] {new FluidStack(dnaFluid[0].getFluid(), 9000)}, null, 500, BW_Util.getMachineVoltageFromTier(6), - BW_Util.STANDART - ); + BW_Util.STANDART); - FluidStack[] easyFluids = {Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000)}; + FluidStack[] easyFluids = { + Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000) + }; for (FluidStack fluidStack : easyFluids) { for (BioCulture bioCulture : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (bioCulture.isBreedable() && bioCulture.getTier() == 0) { sBacteriaVat.addRecipe( - //boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue + // boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, + // int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, + // int aEUt, int aSpecialValue new BWRecipes.BacteriaVatRecipe( true, - new ItemStack[]{ - GT_Utility.getIntegratedCircuit(0), - new ItemStack(Items.sugar, 64) + new ItemStack[] { + GT_Utility.getIntegratedCircuit(0), new ItemStack(Items.sugar, 64) }, null, BioItemList.getPetriDish(bioCulture), null, - new FluidStack[]{ - fluidStack - }, - new FluidStack[]{ - new FluidStack(bioCulture.getFluid(), 10) - }, + new FluidStack[] {fluidStack}, + new FluidStack[] {new FluidStack(bioCulture.getFluid(), 10)}, 1000, BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ), true - ); - //aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue - sBiolab.addRecipe( - new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[]{ - BioItemList.getPetriDish(null), - fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Water.getCells(1) : ItemFluidCell.getUniversalFluidCell(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) - }, - new ItemStack[]{ - BioItemList.getPetriDish(bioCulture), - fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Empty.getCells(1) : ItemList.Cell_Universal_Fluid.get(1L) - }, - null, - new int[]{ - bioCulture.getChance(), - 10000 - }, - new FluidStack[]{ - new FluidStack(bioCulture.getFluid(), 1000) - }, - null, - 500, - BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - )); + BW_Util.STANDART), + true); + // aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, + // aDuration, aEUt, aSpecialValue + sBiolab.addRecipe(new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { + BioItemList.getPetriDish(null), + fluidStack.equals(Materials.Water.getFluid(1000L)) + ? Materials.Water.getCells(1) + : ItemFluidCell.getUniversalFluidCell( + FluidRegistry.getFluidStack("ic2distilledwater", 1000)) + }, + new ItemStack[] { + BioItemList.getPetriDish(bioCulture), + fluidStack.equals(Materials.Water.getFluid(1000L)) + ? Materials.Empty.getCells(1) + : ItemList.Cell_Universal_Fluid.get(1L) + }, + null, + new int[] {bioCulture.getChance(), 10000}, + new FluidStack[] {new FluidStack(bioCulture.getFluid(), 1000)}, + null, + 500, + BW_Util.getMachineVoltageFromTier(3), + BW_Util.STANDART)); } } } @@ -280,129 +263,340 @@ public class AdditionalRecipes { @SuppressWarnings("deprecation") public static void run() { runBWRecipes(); - GT_Values.RA.addImplosionRecipe(WerkstoffLoader.RawAdemicSteel.get(dust), 4, WerkstoffLoader.AdemicSteel.get(dust), null); - ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(WerkstoffLoader.FormicAcid.getBridgeMaterial(), 40); - //Thorium/Yttrium Glas - GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall, 2), WerkstoffLoader.Thorianit.get(dustSmall, 2), Materials.Glass.getMolten(144), null, new ItemStack(ItemRegistry.bw_glasses[0], 1, 12), null, 800, BW_Util.getMachineVoltageFromTier(5), 3663); - //Thorianit recipes - GT_Values.RA.addSifterRecipe(WerkstoffLoader.Thorianit.get(crushedPurified), - new ItemStack[]{ - WerkstoffLoader.Thorianit.get(dust), - WerkstoffLoader.Thorianit.get(dust), - WerkstoffLoader.Thorianit.get(dust), - Materials.Thorium.getDust(1), - Materials.Thorium.getDust(1), - WerkstoffLoader.Thorium232.get(dust), - }, new int[]{7000, 1300, 700, 600, 300, 100}, + GT_Values.RA.addImplosionRecipe( + WerkstoffLoader.RawAdemicSteel.get(dust), 4, WerkstoffLoader.AdemicSteel.get(dust), null); + ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)) + .addLiquidFuel(WerkstoffLoader.FormicAcid.getBridgeMaterial(), 40); + // Thorium/Yttrium Glas + GT_Values.RA.addBlastRecipe( + WerkstoffLoader.YttriumOxide.get(dustSmall, 2), + WerkstoffLoader.Thorianit.get(dustSmall, 2), + Materials.Glass.getMolten(144), + null, + new ItemStack(ItemRegistry.bw_glasses[0], 1, 12), + null, + 800, + BW_Util.getMachineVoltageFromTier(5), + 3663); + // Thorianit recipes + GT_Values.RA.addSifterRecipe( + WerkstoffLoader.Thorianit.get(crushedPurified), + new ItemStack[] { + WerkstoffLoader.Thorianit.get(dust), + WerkstoffLoader.Thorianit.get(dust), + WerkstoffLoader.Thorianit.get(dust), + Materials.Thorium.getDust(1), + Materials.Thorium.getDust(1), + WerkstoffLoader.Thorium232.get(dust), + }, + new int[] {7000, 1300, 700, 600, 300, 100}, 400, - BW_Util.getMachineVoltageFromTier(5) - ); - //3ThO2 + 4Al = 3Th + 2Al2O3 - GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust, 9), Materials.Aluminium.getDust(4), null, null, Materials.Thorium.getDust(3), Materials.Aluminiumoxide.getDust(10), 1000); - //ThO2 + 2Mg = Th + 2MgO - GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust, 3), Materials.Magnesium.getDust(2), null, null, Materials.Thorium.getDust(1), Materials.Magnesia.getDust(4), 1000); - GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(crushed), ItemList.Crop_Drop_Thorium.get(9), Materials.Water.getFluid(1000), Materials.Thorium.getMolten(144), WerkstoffLoader.Thorianit.get(crushedPurified, 4), 96, 24); + BW_Util.getMachineVoltageFromTier(5)); + // 3ThO2 + 4Al = 3Th + 2Al2O3 + GT_Values.RA.addChemicalRecipe( + WerkstoffLoader.Thorianit.get(dust, 9), + Materials.Aluminium.getDust(4), + null, + null, + Materials.Thorium.getDust(3), + Materials.Aluminiumoxide.getDust(10), + 1000); + // ThO2 + 2Mg = Th + 2MgO + GT_Values.RA.addChemicalRecipe( + WerkstoffLoader.Thorianit.get(dust, 3), + Materials.Magnesium.getDust(2), + null, + null, + Materials.Thorium.getDust(1), + Materials.Magnesia.getDust(4), + 1000); + GT_Values.RA.addChemicalRecipe( + WerkstoffLoader.Thorianit.get(crushed), + ItemList.Crop_Drop_Thorium.get(9), + Materials.Water.getFluid(1000), + Materials.Thorium.getMolten(144), + WerkstoffLoader.Thorianit.get(crushedPurified, 4), + 96, + 24); - //Prasiolite - GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), Materials.Amethyst.getDust(10), GT_Values.NF, GT_Values.NF, WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), GT_Values.NI, 800, BW_Util.getMachineVoltageFromTier(2), 500); - GT_Values.RA.addPrimitiveBlastRecipe(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), Materials.Amethyst.getDust(10), 6, WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), GT_Values.NI, 800); - //Cubic Circonia - //2Y + 3O = Y2O3 - GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(5), Materials.Oxygen.getGas(3000), GT_Values.NF, WerkstoffLoader.YttriumOxide.get(dust, 5), 4096, BW_Util.getMachineVoltageFromTier(1)); - //Zr + 2O =Y22O3= ZrO2 - GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust, 10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.CubicZirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 57600, BW_Util.getMachineVoltageFromTier(3), 2953); - //Tellurium - GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed, Materials.Lead, 10L), GT_Utility.getIntegratedCircuit(17), GT_Values.NF, GT_Values.NF, Materials.Lead.getIngots(10), Materials.Tellurium.getNuggets(20), 800, BW_Util.getMachineVoltageFromTier(2), 722); - GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium.getMolten(48), Materials.Beryllium.getMolten(48), WerkstoffLoader.Californium.getMolten(48), 240, 49152, 480000000); - GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(32), WerkstoffLoader.Calcium.getMolten(144), WerkstoffLoader.Oganesson.getFluidOrGas(144), 420, 49152, 600000000); - GT_Values.RA.addDistillationTowerRecipe(Materials.LiquidAir.getFluid(100000000), new FluidStack[]{Materials.Nitrogen.getGas(78084000), Materials.Oxygen.getGas(20946000), Materials.Argon.getGas(934000), Materials.CarbonDioxide.getGas(40700), WerkstoffLoader.Neon.getFluidOrGas(1818), Materials.Helium.getGas(524), Materials.Methane.getGas(180), WerkstoffLoader.Krypton.getFluidOrGas(114), Materials.Hydrogen.getGas(55), WerkstoffLoader.Xenon.getFluidOrGas(9)}, null, 7500, BW_Util.getMachineVoltageFromTier(4)); - GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust), WerkstoffLoader.Neon.getFluidOrGas(1000), WerkstoffLoader.MagnetoResonaticDust.get(gemChipped, 9), 9000, 4500, BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust), WerkstoffLoader.Krypton.getFluidOrGas(1000), WerkstoffLoader.MagnetoResonaticDust.get(gem), 10000, 4500, BW_Util.getMachineVoltageFromTier(5)); + // Prasiolite + GT_Values.RA.addBlastRecipe( + GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), + Materials.Amethyst.getDust(10), + GT_Values.NF, + GT_Values.NF, + WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), + GT_Values.NI, + 800, + BW_Util.getMachineVoltageFromTier(2), + 500); + GT_Values.RA.addPrimitiveBlastRecipe( + GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), + Materials.Amethyst.getDust(10), + 6, + WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), + GT_Values.NI, + 800); + // Cubic Circonia + // 2Y + 3O = Y2O3 + GT_Values.RA.addChemicalRecipe( + Materials.Yttrium.getDust(2), + GT_Utility.getIntegratedCircuit(5), + Materials.Oxygen.getGas(3000), + GT_Values.NF, + WerkstoffLoader.YttriumOxide.get(dust, 5), + 4096, + BW_Util.getMachineVoltageFromTier(1)); + // Zr + 2O =Y22O3= ZrO2 + GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe( + false, + new ItemStack[] {WerkstoffLoader.Zirconium.get(dust, 10), WerkstoffLoader.YttriumOxide.get(dust)}, + new ItemStack[] { + WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.CubicZirconia.get(gemFlawed, 40) + }, + null, + null, + new FluidStack[] {Materials.Oxygen.getGas(20000)}, + null, + 57600, + BW_Util.getMachineVoltageFromTier(3), + 2953); + // Tellurium + GT_Values.RA.addBlastRecipe( + GT_OreDictUnificator.get(crushed, Materials.Lead, 10L), + GT_Utility.getIntegratedCircuit(17), + GT_Values.NF, + GT_Values.NF, + Materials.Lead.getIngots(10), + Materials.Tellurium.getNuggets(20), + 800, + BW_Util.getMachineVoltageFromTier(2), + 722); + GT_Values.RA.addFusionReactorRecipe( + Materials.Plutonium.getMolten(48), + Materials.Beryllium.getMolten(48), + WerkstoffLoader.Californium.getMolten(48), + 240, + 49152, + 480000000); + GT_Values.RA.addFusionReactorRecipe( + WerkstoffLoader.Californium.getMolten(32), + WerkstoffLoader.Calcium.getMolten(144), + WerkstoffLoader.Oganesson.getFluidOrGas(144), + 420, + 49152, + 600000000); + GT_Values.RA.addDistillationTowerRecipe( + Materials.LiquidAir.getFluid(100000000), + new FluidStack[] { + Materials.Nitrogen.getGas(78084000), + Materials.Oxygen.getGas(20946000), + Materials.Argon.getGas(934000), + Materials.CarbonDioxide.getGas(40700), + WerkstoffLoader.Neon.getFluidOrGas(1818), + Materials.Helium.getGas(524), + Materials.Methane.getGas(180), + WerkstoffLoader.Krypton.getFluidOrGas(114), + Materials.Hydrogen.getGas(55), + WerkstoffLoader.Xenon.getFluidOrGas(9) + }, + null, + 7500, + BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.addAutoclaveRecipe( + WerkstoffLoader.MagnetoResonaticDust.get(dust), + WerkstoffLoader.Neon.getFluidOrGas(1000), + WerkstoffLoader.MagnetoResonaticDust.get(gemChipped, 9), + 9000, + 4500, + BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addAutoclaveRecipe( + WerkstoffLoader.MagnetoResonaticDust.get(dust), + WerkstoffLoader.Krypton.getFluidOrGas(1000), + WerkstoffLoader.MagnetoResonaticDust.get(gem), + 10000, + 4500, + BW_Util.getMachineVoltageFromTier(5)); - //Milk - //GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), Materials.Milk.getFluid(12000), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500, 49152, 600000000); - GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(1), GT_Values.NI, Materials.Milk.getFluid(10000), Materials.Water.getFluid(8832), Materials.Sugar.getDustSmall(21), Materials.Calcium.getDustTiny(1), Materials.Magnesium.getDustTiny(1), Materials.Potassium.getDustTiny(1), Materials.Sodium.getDustTiny(4), Materials.Phosphor.getDustTiny(1), new int[]{10000, 10000, 1000, 10000, 1000, 1000}, 50, 120); + // Milk + // GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), + // Materials.Milk.getFluid(12000), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500, 49152, 600000000); + GT_Values.RA.addCentrifugeRecipe( + GT_Utility.getIntegratedCircuit(1), + GT_Values.NI, + Materials.Milk.getFluid(10000), + Materials.Water.getFluid(8832), + Materials.Sugar.getDustSmall(21), + Materials.Calcium.getDustTiny(1), + Materials.Magnesium.getDustTiny(1), + Materials.Potassium.getDustTiny(1), + Materials.Sodium.getDustTiny(4), + Materials.Phosphor.getDustTiny(1), + new int[] {10000, 10000, 1000, 10000, 1000, 1000}, + 50, + 120); - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( - new BWRecipes.DynamicGTRecipe(false, - new ItemStack[]{ - BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gem), - ItemList.NandChip.get(1), - ItemList.Circuit_Parts_DiodeSMD.get(4), - ItemList.Circuit_Parts_CapacitorSMD.get(4), - ItemList.Circuit_Parts_TransistorSMD.get(4) - }, - new ItemStack[]{ - BW_Meta_Items.getNEWCIRCUITS().getStack(4) - }, null, null, - new FluidStack[]{ - Materials.SolderingAlloy.getMolten(36) - }, null, 750, BW_Util.getMachineVoltageFromTier(1), CLEANROOM)); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { + BW_Meta_Items.getNEWCIRCUITS().getStack(3), + WerkstoffLoader.MagnetoResonaticDust.get(gem), + ItemList.NandChip.get(1), + ItemList.Circuit_Parts_DiodeSMD.get(4), + ItemList.Circuit_Parts_CapacitorSMD.get(4), + ItemList.Circuit_Parts_TransistorSMD.get(4) + }, + new ItemStack[] {BW_Meta_Items.getNEWCIRCUITS().getStack(4)}, + null, + null, + new FluidStack[] {Materials.SolderingAlloy.getMolten(36)}, + null, + 750, + BW_Util.getMachineVoltageFromTier(1), + CLEANROOM)); for (int i = 1; i <= 6; i++) { - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( - new BWRecipes.DynamicGTRecipe(false, - new ItemStack[]{ - BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gem), - BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), - ItemList.Circuit_Parts_DiodeSMD.get((i + 1) * 4), - ItemList.Circuit_Parts_CapacitorSMD.get((i + 1) * 4), - ItemList.Circuit_Parts_TransistorSMD.get((i + 1) * 4) - }, - new ItemStack[]{ - BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4) - }, null, null, - new FluidStack[]{ - Materials.SolderingAlloy.getMolten((i + 1) * 36) - }, null, (i + 1) * 750, BW_Util.getMachineVoltageFromTier((i + 1)), CLEANROOM)); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { + BW_Meta_Items.getNEWCIRCUITS().getStack(3), + WerkstoffLoader.MagnetoResonaticDust.get(gem), + BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), + ItemList.Circuit_Parts_DiodeSMD.get((i + 1) * 4), + ItemList.Circuit_Parts_CapacitorSMD.get((i + 1) * 4), + ItemList.Circuit_Parts_TransistorSMD.get((i + 1) * 4) + }, + new ItemStack[] {BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4)}, + null, + null, + new FluidStack[] {Materials.SolderingAlloy.getMolten((i + 1) * 36)}, + null, + (i + 1) * 750, + BW_Util.getMachineVoltageFromTier((i + 1)), + CLEANROOM)); } for (int i = 7; i <= 10; i++) { - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( - new BWRecipes.DynamicGTRecipe(false, - new ItemStack[]{ - BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (1)), - BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), - ItemList.Circuit_Parts_DiodeSMD.get((i + 6) * 4), - ItemList.Circuit_Parts_CapacitorSMD.get((i + 6) * 4), - ItemList.Circuit_Parts_TransistorSMD.get((i + 6) * 4) - }, - new ItemStack[]{ - BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4) - }, null, null, - new FluidStack[]{ - Materials.SolderingAlloy.getMolten((i + 1) * 144) - }, null, (i + 1) * 1500, BW_Util.getMachineVoltageFromTier(i + 1), CLEANROOM)); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { + BW_Meta_Items.getNEWCIRCUITS().getStack(3), + WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (1)), + BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), + ItemList.Circuit_Parts_DiodeSMD.get((i + 6) * 4), + ItemList.Circuit_Parts_CapacitorSMD.get((i + 6) * 4), + ItemList.Circuit_Parts_TransistorSMD.get((i + 6) * 4) + }, + new ItemStack[] {BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4)}, + null, + null, + new FluidStack[] {Materials.SolderingAlloy.getMolten((i + 1) * 144)}, + null, + (i + 1) * 1500, + BW_Util.getMachineVoltageFromTier(i + 1), + CLEANROOM)); } - GT_Recipe.GT_Recipe_Map.sSmallNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(bolt)}, new ItemStack[]{}, null, null, null, 0, 0, 12500); - GT_Recipe.GT_Recipe_Map.sLargeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stick)}, new ItemStack[]{}, null, null, null, 0, 0, 62500); + GT_Recipe.GT_Recipe_Map.sSmallNaquadahReactorFuels.addRecipe( + true, + new ItemStack[] {WerkstoffLoader.Tiberium.get(bolt)}, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 12500); + GT_Recipe.GT_Recipe_Map.sLargeNaquadahReactorFuels.addRecipe( + true, + new ItemStack[] {WerkstoffLoader.Tiberium.get(stick)}, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 62500); try { Class map = GT_Recipe.GT_Recipe_Map.class; - GT_Recipe.GT_Recipe_Map sHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map, "sHugeNaquadahReactorFuels").get(null); - GT_Recipe.GT_Recipe_Map sExtremeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map, "sExtremeNaquadahReactorFuels").get(null); - GT_Recipe.GT_Recipe_Map sUltraHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map, "sUltraHugeNaquadahReactorFuels").get(null); - sHugeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stickLong)}, new ItemStack[]{}, null, null, null, 0, 0, 125000); - sExtremeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stick)}, new ItemStack[]{}, null, null, null, 0, 0, 31250); - sUltraHugeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stickLong)}, new ItemStack[]{}, null, null, null, 0, 0, 125000); - } catch (NullPointerException | IllegalAccessException ignored) {} + GT_Recipe.GT_Recipe_Map sHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) + FieldUtils.getField(map, "sHugeNaquadahReactorFuels").get(null); + GT_Recipe.GT_Recipe_Map sExtremeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) + FieldUtils.getField(map, "sExtremeNaquadahReactorFuels").get(null); + GT_Recipe.GT_Recipe_Map sUltraHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) + FieldUtils.getField(map, "sUltraHugeNaquadahReactorFuels").get(null); + sHugeNaquadahReactorFuels.addRecipe( + true, + new ItemStack[] {WerkstoffLoader.Tiberium.get(stickLong)}, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 125000); + sExtremeNaquadahReactorFuels.addRecipe( + true, + new ItemStack[] {WerkstoffLoader.Tiberium.get(stick)}, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 31250); + sUltraHugeNaquadahReactorFuels.addRecipe( + true, + new ItemStack[] {WerkstoffLoader.Tiberium.get(stickLong)}, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 125000); + } catch (NullPointerException | IllegalAccessException ignored) { + } LoadItemContainers.run(); - GT_Values.RA.addCannerRecipe(ItemList.Large_Fluid_Cell_TungstenSteel.get(1L), WerkstoffLoader.Tiberium.get(dust, 3), BW_NonMeta_MaterialItems.TiberiumCell_1.get(1L), null, 30, 16); - GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_1.get(2L), GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), BW_NonMeta_MaterialItems.TiberiumCell_2.get(1L), 100, 400); - GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_1.get(4L), GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 6L), BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), 150, 400); - GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_2.get(2L), GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), 100, 400); + GT_Values.RA.addCannerRecipe( + ItemList.Large_Fluid_Cell_TungstenSteel.get(1L), + WerkstoffLoader.Tiberium.get(dust, 3), + BW_NonMeta_MaterialItems.TiberiumCell_1.get(1L), + null, + 30, + 16); + GT_Values.RA.addAssemblerRecipe( + BW_NonMeta_MaterialItems.TiberiumCell_1.get(2L), + GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), + BW_NonMeta_MaterialItems.TiberiumCell_2.get(1L), + 100, + 400); + GT_Values.RA.addAssemblerRecipe( + BW_NonMeta_MaterialItems.TiberiumCell_1.get(4L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 6L), + BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), + 150, + 400); + GT_Values.RA.addAssemblerRecipe( + BW_NonMeta_MaterialItems.TiberiumCell_2.get(2L), + GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), + BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), + 100, + 400); GT_Values.RA.addAssemblerRecipe( - new ItemStack[]{ItemList.NaquadahCell_1.get(32L), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), - WerkstoffLoader.Tiberium.get(dust, 64), - WerkstoffLoader.Tiberium.get(dust, 64) - }, null, BW_NonMeta_MaterialItems.TheCoreCell.get(1L), 100, BW_Util.getMachineVoltageFromTier(6)); + new ItemStack[] { + ItemList.NaquadahCell_1.get(32L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), + WerkstoffLoader.Tiberium.get(dust, 64), + WerkstoffLoader.Tiberium.get(dust, 64) + }, + null, + BW_NonMeta_MaterialItems.TheCoreCell.get(1L), + 100, + BW_Util.getMachineVoltageFromTier(6)); GregTech_API.sAfterGTPostload.add(new LuVTierEnhancer()); AdditionalRecipes.oldGThelperMethod(); @@ -410,14 +604,23 @@ public class AdditionalRecipes { @SuppressWarnings("unchecked") private static void oldGThelperMethod() { - //manual override for older GT + // manual override for older GT Werkstoff werkstoff = WerkstoffLoader.Oganesson; Materials werkstoffBridgeMaterial = null; boolean aElementSet = false; for (Element e : Element.values()) { if (e.toString().equals("Uuo")) { - werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : - new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName(), werkstoff.getDefaultName()); + werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null + ? werkstoff.getBridgeMaterial() + : new Materials( + -1, + werkstoff.getTexSet(), + 0, + 0, + 0, + false, + werkstoff.getDefaultName(), + werkstoff.getDefaultName()); werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials.add(werkstoffBridgeMaterial); aElementSet = true; @@ -425,8 +628,7 @@ public class AdditionalRecipes { break; } } - if (!aElementSet) - return; + if (!aElementSet) return; GT_OreDictUnificator.addAssociation(cell, werkstoffBridgeMaterial, werkstoff.get(cell), false); try { @@ -440,7 +642,31 @@ public class AdditionalRecipes { ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{Materials.Empty.getCells(1)}, new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( + false, + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] {werkstoff.get(cell)}, + new ItemStack[] {scannerOutput}, + ItemList.Tool_DataOrb.get(1L), + null, + null, + null, + (int) (werkstoffBridgeMaterial.getMass() * 8192L), + 30, + 0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe( + false, + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] {Materials.Empty.getCells(1)}, + new ItemStack[] {werkstoff.get(cell)}, + scannerOutput, + null, + new FluidStack[] {Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, + null, + (int) (werkstoffBridgeMaterial.getMass() * 512L), + 30, + 0)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java index a162f4ed45..f1ac227c5e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.dustSmall; + import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import gregtech.api.enums.GT_Values; @@ -29,49 +32,70 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.util.GT_OreDictUnificator; -import static gregtech.api.enums.OrePrefixes.dust; -import static gregtech.api.enums.OrePrefixes.dustSmall; - public class AfterLuVTierEnhacement { - private AfterLuVTierEnhacement(){} + private AfterLuVTierEnhacement() {} public static void run() { - GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(1), + GT_Values.RA.addCentrifugeRecipe( + BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), + null, + null, + WerkstoffLoader.Xenon.getFluidOrGas(1), WerkstoffLoader.Zirconium.get(dust), WerkstoffLoader.Zirconium.get(dust), - WerkstoffLoader.Tiberium.get(dustSmall,2), - WerkstoffLoader.Zirconium.get(dust,2), + WerkstoffLoader.Tiberium.get(dustSmall, 2), + WerkstoffLoader.Zirconium.get(dust, 2), GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 8L), GT_OreDictUnificator.get(dust, Materials.Platinum, 1L), - new int[]{10_000,5_000,5_000,2_500,10_000,10_000},250,2000); + new int[] {10_000, 5_000, 5_000, 2_500, 10_000, 10_000}, + 250, + 2000); - GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(2), - WerkstoffLoader.Zirconium.get(dust,2), - WerkstoffLoader.Zirconium.get(dust,2), + GT_Values.RA.addCentrifugeRecipe( + BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), + null, + null, + WerkstoffLoader.Xenon.getFluidOrGas(2), + WerkstoffLoader.Zirconium.get(dust, 2), + WerkstoffLoader.Zirconium.get(dust, 2), WerkstoffLoader.Tiberium.get(dust), - WerkstoffLoader.Zirconium.get(dust,4), + WerkstoffLoader.Zirconium.get(dust, 4), GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 18L), GT_OreDictUnificator.get(dust, Materials.Platinum, 2L), - new int[]{10_000,5_000,5_000,2_500,10_000,10_000},500,2000); + new int[] {10_000, 5_000, 5_000, 2_500, 10_000, 10_000}, + 500, + 2000); - GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(4), - WerkstoffLoader.Zirconium.get(dust,4), - WerkstoffLoader.Zirconium.get(dust,4), - WerkstoffLoader.Tiberium.get(dust,2), - WerkstoffLoader.Zirconium.get(dust,8), + GT_Values.RA.addCentrifugeRecipe( + BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), + null, + null, + WerkstoffLoader.Xenon.getFluidOrGas(4), + WerkstoffLoader.Zirconium.get(dust, 4), + WerkstoffLoader.Zirconium.get(dust, 4), + WerkstoffLoader.Tiberium.get(dust, 2), + WerkstoffLoader.Zirconium.get(dust, 8), GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 38L), GT_OreDictUnificator.get(dust, Materials.Platinum, 4L), - new int[]{10_000,5_000,5_000,2_500,10_000,10_000},1000,2000); + new int[] {10_000, 5_000, 5_000, 2_500, 10_000, 10_000}, + 1000, + 2000); - GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), null,null,null, + GT_Values.RA.addCentrifugeRecipe( + BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), + null, + null, + null, ItemList.Depleted_Naquadah_4.get(8), - WerkstoffLoader.Zirconium.get(dust,64), - WerkstoffLoader.Zirconium.get(dust,64), + WerkstoffLoader.Zirconium.get(dust, 64), + WerkstoffLoader.Zirconium.get(dust, 64), null, null, null, - new int[]{10_000,5_000,5_000},2000,8000); + new int[] {10_000, 5_000, 5_000}, + 2000, + 8000); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java index c6768aad7b..54bd8d3942 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java @@ -25,7 +25,6 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.StreamUtils; import gregtech.api.util.GT_Recipe; - import java.util.HashSet; import java.util.Objects; import java.util.Set; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java index c008588477..a613708f29 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java @@ -29,13 +29,53 @@ import gregtech.common.items.GT_DepletetCell_Item; public class LoadItemContainers { public static void run() { - BW_NonMeta_MaterialItems.Depleted_Tiberium_1.set(new GT_DepletetCell_Item("TiberiumcellDep", "Fuel Rod (Depleted Tiberium)", 1)); - BW_NonMeta_MaterialItems.Depleted_Tiberium_2.set(new GT_DepletetCell_Item("Double_TiberiumcellDep", "Dual Fuel Rod (Depleted Tiberium)", 1)); - BW_NonMeta_MaterialItems.Depleted_Tiberium_4.set(new GT_DepletetCell_Item("Quad_TiberiumcellDep", "Quad Fuel Rod (Depleted Tiberium)", 1)); - BW_NonMeta_MaterialItems.TiberiumCell_1.set(new GT_RadioactiveCellIC_Item("Tiberiumcell", "Fuel Rod (Tiberium)", 1, 50000, 2F, 1, 0.5F, BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), false)); - BW_NonMeta_MaterialItems.TiberiumCell_2.set(new GT_RadioactiveCellIC_Item("Double_Tiberiumcell", "Dual Fuel Rod (Tiberium)", 2, 50000, 2F, 1, 0.5F, BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), false)); - BW_NonMeta_MaterialItems.TiberiumCell_4.set(new GT_RadioactiveCellIC_Item("Quad_Tiberiumcell", "Quad Fuel Rod (Tiberium)", 4, 50000, 2F, 1, 0.5F, BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), false)); - BW_NonMeta_MaterialItems.Depleted_TheCoreCell.set(new GT_DepletetCell_Item("Core_Reactor_CellDep", "Depleted \"The Core\" Cell", 32)); - BW_NonMeta_MaterialItems.TheCoreCell.set(new GT_RadioactiveCellIC_Item("Core_Reactor_Cell", "\"The Core\" Cell", 32, 100000, 8F, 32, 1F, BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), false)); + BW_NonMeta_MaterialItems.Depleted_Tiberium_1.set( + new GT_DepletetCell_Item("TiberiumcellDep", "Fuel Rod (Depleted Tiberium)", 1)); + BW_NonMeta_MaterialItems.Depleted_Tiberium_2.set( + new GT_DepletetCell_Item("Double_TiberiumcellDep", "Dual Fuel Rod (Depleted Tiberium)", 1)); + BW_NonMeta_MaterialItems.Depleted_Tiberium_4.set( + new GT_DepletetCell_Item("Quad_TiberiumcellDep", "Quad Fuel Rod (Depleted Tiberium)", 1)); + BW_NonMeta_MaterialItems.TiberiumCell_1.set(new GT_RadioactiveCellIC_Item( + "Tiberiumcell", + "Fuel Rod (Tiberium)", + 1, + 50000, + 2F, + 1, + 0.5F, + BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), + false)); + BW_NonMeta_MaterialItems.TiberiumCell_2.set(new GT_RadioactiveCellIC_Item( + "Double_Tiberiumcell", + "Dual Fuel Rod (Tiberium)", + 2, + 50000, + 2F, + 1, + 0.5F, + BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), + false)); + BW_NonMeta_MaterialItems.TiberiumCell_4.set(new GT_RadioactiveCellIC_Item( + "Quad_Tiberiumcell", + "Quad Fuel Rod (Tiberium)", + 4, + 50000, + 2F, + 1, + 0.5F, + BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), + false)); + BW_NonMeta_MaterialItems.Depleted_TheCoreCell.set( + new GT_DepletetCell_Item("Core_Reactor_CellDep", "Depleted \"The Core\" Cell", 32)); + BW_NonMeta_MaterialItems.TheCoreCell.set(new GT_RadioactiveCellIC_Item( + "Core_Reactor_Cell", + "\"The Core\" Cell", + 32, + 100000, + 8F, + 32, + 1F, + BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), + false)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/IWerkstoffRunnable.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/IWerkstoffRunnable.java index ae7f85ed68..6e68abc432 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/IWerkstoffRunnable.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/IWerkstoffRunnable.java @@ -26,4 +26,4 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; public interface IWerkstoffRunnable { void run(Werkstoff werkstoff); -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java index 822706fb77..7b1d649b50 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java @@ -31,31 +31,32 @@ import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TC_Aspects; - import java.util.Objects; public class AspectLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - if (!LoaderReference.Thaumcraft) - return; + if (!LoaderReference.Thaumcraft) return; for (OrePrefixes enabledOrePrefixes : WerkstoffLoader.ENABLED_ORE_PREFIXES) { if (werkstoff.hasItemType(enabledOrePrefixes)) { if (enabledOrePrefixes.mMaterialAmount >= 3628800L || enabledOrePrefixes == OrePrefixes.ore) { - DebugLog.log("OrePrefix: " + enabledOrePrefixes.name() + " mMaterialAmount: " + enabledOrePrefixes.mMaterialAmount / 3628800L); + DebugLog.log("OrePrefix: " + enabledOrePrefixes.name() + " mMaterialAmount: " + + enabledOrePrefixes.mMaterialAmount / 3628800L); if (Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes))) ThaumcraftHandler.AspectAdder.addAspectViaBW( werkstoff.get(enabledOrePrefixes), - werkstoff.getTCAspects(enabledOrePrefixes == OrePrefixes.ore ? 1 : - (int) (enabledOrePrefixes.mMaterialAmount / 3628800L)) - ); + werkstoff.getTCAspects( + enabledOrePrefixes == OrePrefixes.ore + ? 1 + : (int) (enabledOrePrefixes.mMaterialAmount / 3628800L))); } else if (enabledOrePrefixes.mMaterialAmount >= 0L) { if (Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes))) //noinspection unchecked - ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(enabledOrePrefixes), new Pair<>(TC_Aspects.PERDITIO.mAspect, 1)); + ThaumcraftHandler.AspectAdder.addAspectViaBW( + werkstoff.get(enabledOrePrefixes), new Pair<>(TC_Aspects.PERDITIO.mAspect, 1)); } } } } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java index 369423817f..9d3cbc4b96 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java @@ -22,27 +22,32 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import gregtech.api.enums.GT_Values; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.OrePrefixes.*; - public class BlockLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - if (!werkstoff.hasItemType(block)) - return; + if (!werkstoff.hasItemType(block)) return; if (werkstoff.hasItemType(ingot)) { - GT_Values.RA.addArcFurnaceRecipe(werkstoff.get(block), new ItemStack[]{werkstoff.get(ingot, 9)}, null, 16, 90, false); + GT_Values.RA.addArcFurnaceRecipe( + werkstoff.get(block), new ItemStack[] {werkstoff.get(ingot, 9)}, null, 16, 90, false); } if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(block), null, werkstoff.getMolten(1296), 0, 288, 8); } if (werkstoff.hasItemType(plate)) { - GT_Values.RA.addCutterRecipe(werkstoff.get(block), werkstoff.get(plate, 9), null, (int) Math.max(werkstoff.getStats().getMass() * 10L, 1L), 30); + GT_Values.RA.addCutterRecipe( + werkstoff.get(block), + werkstoff.get(plate, 9), + null, + (int) Math.max(werkstoff.getStats().getMass() * 10L, 1L), + 30); } } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java index a1db413dca..d774ff166d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasing; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasingAdvanced; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.system.material.BW_GT_MaterialReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; @@ -30,59 +34,52 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import net.minecraft.item.ItemStack; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasing; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasingAdvanced; -import static gregtech.api.enums.OrePrefixes.*; - public class CasingLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff == BW_GT_MaterialReference.Wood /*|| werkstoff == BW_GT_MaterialReference.WoodSealed*/) { addCasingRecipes(werkstoff, plank); } else { - if (! - ( - werkstoff.hasGenerationFeature(blockCasing) && - werkstoff.doesOreDictedItemExists(plate) && - werkstoff.doesOreDictedItemExists(screw) && - werkstoff.doesOreDictedItemExists(gearGtSmall) && - werkstoff.doesOreDictedItemExists(gearGt) && - werkstoff.doesOreDictedItemExists(plateDouble) - ) - ) - return; + if (!(werkstoff.hasGenerationFeature(blockCasing) + && werkstoff.doesOreDictedItemExists(plate) + && werkstoff.doesOreDictedItemExists(screw) + && werkstoff.doesOreDictedItemExists(gearGtSmall) + && werkstoff.doesOreDictedItemExists(gearGt) + && werkstoff.doesOreDictedItemExists(plateDouble))) return; addCasingRecipes(werkstoff, plateDouble); } } - private static void addCasingRecipes(Werkstoff werkstoff, OrePrefixes reboltedCasingsOuterStuff){ - GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasing), new Object[]{ - "PSP", - "PGP", - "PSP", - 'P', werkstoff.get(plate), - 'S', werkstoff.get(screw), - 'G', werkstoff.get(gearGtSmall) + private static void addCasingRecipes(Werkstoff werkstoff, OrePrefixes reboltedCasingsOuterStuff) { + GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasing), new Object[] { + "PSP", "PGP", "PSP", 'P', werkstoff.get(plate), 'S', werkstoff.get(screw), 'G', werkstoff.get(gearGtSmall) }); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - werkstoff.get(plate, 6), - werkstoff.get(screw, 2), - werkstoff.get(gearGtSmall) - }, GT_Values.NF, werkstoff.get(blockCasing), 200, 30); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] {werkstoff.get(plate, 6), werkstoff.get(screw, 2), werkstoff.get(gearGtSmall)}, + GT_Values.NF, + werkstoff.get(blockCasing), + 200, + 30); - GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasingAdvanced), new Object[]{ - "PSP", - "PGP", - "PSP", - 'P', werkstoff.get(reboltedCasingsOuterStuff), - 'S', werkstoff.get(screw), - 'G', werkstoff.get(gearGt) + GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasingAdvanced), new Object[] { + "PSP", + "PGP", + "PSP", + 'P', + werkstoff.get(reboltedCasingsOuterStuff), + 'S', + werkstoff.get(screw), + 'G', + werkstoff.get(gearGt) }); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - werkstoff.get(reboltedCasingsOuterStuff, 6), - werkstoff.get(screw, 2), - werkstoff.get(gearGt) - }, GT_Values.NF, werkstoff.get(blockCasingAdvanced), 200, 30); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + werkstoff.get(reboltedCasingsOuterStuff, 6), werkstoff.get(screw, 2), werkstoff.get(gearGt) + }, + GT_Values.NF, + werkstoff.get(blockCasingAdvanced), + 200, + 30); } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java index 1c1e530f42..a1de8695a0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -35,32 +37,32 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Objects; - -import static gregtech.api.enums.OrePrefixes.*; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; public class CellLoader implements IWerkstoffRunnable { @Override @SuppressWarnings("unchecked") public void run(Werkstoff werkstoff) { - if (!werkstoff.hasItemType(cell)) - return; + if (!werkstoff.hasItemType(cell)) return; - if ((werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge()) && !werkstoff.hasItemType(dust)) { + if ((werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge()) + && !werkstoff.hasItemType(dust)) { List flOutputs = new ArrayList<>(); List stOutputs = new ArrayList<>(); HashMap> tracker = new HashMap<>(); int cells = 0; - for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { + for (Pair container : + werkstoff.getContents().getValue().toArray(new Pair[0])) { if (container.getKey() instanceof Materials) { - if (((Materials) container.getKey()).hasCorrespondingGas() || ((Materials) container.getKey()).hasCorrespondingFluid() || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { + if (((Materials) container.getKey()).hasCorrespondingGas() + || ((Materials) container.getKey()).hasCorrespondingFluid() + || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); @@ -71,24 +73,27 @@ public class CellLoader implements IWerkstoffRunnable { stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.add(((Materials) container.getKey()) + .getCells( + tracker.get(container.getKey()).getKey() + container.getValue())); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } cells += container.getValue(); } } else { - if (((Materials) container.getKey()).getDust(container.getValue()) == null) - continue; + if (((Materials) container.getKey()).getDust(container.getValue()) == null) continue; if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Materials) container.getKey()).getDust(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.add(((Materials) container.getKey()) + .getDust(tracker.get(container.getKey()).getKey() + container.getValue())); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } } } else if (container.getKey() instanceof Werkstoff) { - if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) { + if (((Werkstoff) container.getKey()).getStats().isGas() + || ((Werkstoff) container.getKey()).hasItemType(cell)) { FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); @@ -99,19 +104,22 @@ public class CellLoader implements IWerkstoffRunnable { stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Werkstoff) container.getKey()).get(cell, tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.add(((Werkstoff) container.getKey()) + .get( + cell, + tracker.get(container.getKey()).getKey() + container.getValue())); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } cells += container.getValue(); } } else { - if (!((Werkstoff) container.getKey()).hasItemType(dust)) - continue; + if (!((Werkstoff) container.getKey()).hasItemType(dust)) continue; if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Werkstoff) container.getKey()).get(dust, (tracker.get(container.getKey()).getKey() + container.getValue()))); + stOutputs.add(((Werkstoff) container.getKey()) + .get(dust, (tracker.get(container.getKey()).getKey() + container.getValue()))); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } } @@ -124,27 +132,84 @@ public class CellLoader implements IWerkstoffRunnable { stOutputs.add(Materials.Empty.getCells(-cellEmpty)); if (werkstoff.getStats().isElektrolysis()) - GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().getProtons() * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); + GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe( + true, + new ItemStack[] {input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null}, + stOutputs.toArray(new ItemStack[0]), + null, + null, + new FluidStack[] {null}, + new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, + (int) Math.max( + 1L, + Math.abs(werkstoff.getStats().getProtons() + * werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 30, + 0)); if (werkstoff.getStats().isCentrifuge()) - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().getMass() * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe( + true, + new ItemStack[] {input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null}, + stOutputs.toArray(new ItemStack[0]), + null, + null, + new FluidStack[] {null}, + new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, + (int) Math.max( + 1L, + Math.abs(werkstoff.getStats().getMass() + * werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 5, + 0)); } - //Tank "Recipe" - GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(cell), Materials.Empty.getCells(1))); - FluidContainerRegistry.registerFluidContainer(werkstoff.getFluidOrGas(1).getFluid(), werkstoff.get(cell), Materials.Empty.getCells(1)); - GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)); + // Tank "Recipe" + GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData( + new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), + werkstoff.get(cell), + Materials.Empty.getCells(1))); + FluidContainerRegistry.registerFluidContainer( + werkstoff.getFluidOrGas(1).getFluid(), werkstoff.get(cell), Materials.Empty.getCells(1)); + GT_Values.RA.addFluidCannerRecipe( + Materials.Empty.getCells(1), + werkstoff.get(cell), + new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), + GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe( + werkstoff.get(cell), + Materials.Empty.getCells(1), + GT_Values.NF, + new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)); if (LoaderReference.Forestry) { - FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(capsule), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), true); + FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( + new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), + werkstoff.get(capsule), + GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), + true); GT_Utility.addFluidContainerData(emptyData); FluidContainerRegistry.registerFluidContainer(emptyData); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsule), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)); + GT_Values.RA.addFluidCannerRecipe( + werkstoff.get(capsule), + GT_Values.NI, + GT_Values.NF, + new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)); } if (werkstoff.hasItemType(dust)) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust), null, werkstoff.getFluidOrGas(1000), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe(GT_Utility.getIntegratedCircuit(1), werkstoff.getFluidOrGas(1000), werkstoff.get(dust), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(dust), + null, + werkstoff.getFluidOrGas(1000), + 0, + (int) werkstoff.getStats().getMass(), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe( + GT_Utility.getIntegratedCircuit(1), + werkstoff.getFluidOrGas(1000), + werkstoff.get(dust), + (int) werkstoff.getStats().getMass(), + werkstoff.getStats().getMass() > 128 ? 64 : 30); } if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { @@ -152,8 +217,17 @@ public class CellLoader implements IWerkstoffRunnable { boolean ElementSet = false; for (Element e : Element.values()) { if (e.toString().equals(werkstoff.getToolTip())) { - werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : - new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName(), werkstoff.getDefaultName()); + werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null + ? werkstoff.getBridgeMaterial() + : new Materials( + -1, + werkstoff.getTexSet(), + 0, + 0, + 0, + false, + werkstoff.getDefaultName(), + werkstoff.getDefaultName()); werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials.add(werkstoffBridgeMaterial); ElementSet = true; @@ -161,23 +235,37 @@ public class CellLoader implements IWerkstoffRunnable { break; } } - if (!ElementSet) - return; + if (!ElementSet) return; GT_OreDictUnificator.addAssociation(cell, werkstoffBridgeMaterial, werkstoff.get(cell), false); -// try { -// Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); -// f.setAccessible(true); -// Map MATERIALS_MAP = (Map) f.get(null); -// MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); -// } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { -// e.printStackTrace(); -// } + // try { + // Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); + // f.setAccessible(true); + // Map MATERIALS_MAP = (Map) f.get(null); + // MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); + // } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { + // e.printStackTrace(); + // } ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); - //GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{Materials.Empty.getCells(1)}, new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( + false, + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] {werkstoff.get(cell)}, + new ItemStack[] {scannerOutput}, + ItemList.Tool_DataOrb.get(1L), + null, + null, + null, + (int) (werkstoffBridgeMaterial.getMass() * 8192L), + 30, + 0)); + // GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, + // new ItemStack[]{Materials.Empty.getCells(1)}, new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, + // new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) + // (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java index 0302f12a59..d82f7aa559 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -33,74 +35,170 @@ import gregtech.api.util.GT_ModHandler; import gregtech.common.GT_Proxy; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.OrePrefixes.*; - public class CraftingMaterialLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(screw)) { int tVoltageMultiplier = werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15; - //bolt - GT_Values.RA.addExtruderRecipe(werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(ingot), ItemList.Shape_Extruder_Bolt.get(0L), werkstoff.get(bolt, 8), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 8 * tVoltageMultiplier); - GT_Values.RA.addCutterRecipe(werkstoff.get(stick), werkstoff.get(bolt, 4), null, (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 4); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(bolt), new ItemStack[]{werkstoff.get(dustTiny, 1)}, null, 2, 8); - - //screw - GT_Values.RA.addLatheRecipe(werkstoff.get(bolt), werkstoff.get(screw), null, (int) Math.max(werkstoff.getStats().getMass() / 8L, 1L), 4); - GT_ModHandler.addCraftingRecipe(werkstoff.get(screw), GT_Proxy.tBits, new Object[]{"fX", "X ", 'X', werkstoff.get(bolt)}); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(screw), new ItemStack[]{werkstoff.get(dustTiny, 1)}, null, 2, 8); - - if (werkstoff.hasItemType(gem)) - return; - - //ring - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Ring.get(0L), werkstoff.get(ring, 4), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 6 * tVoltageMultiplier); - GT_ModHandler.addCraftingRecipe(werkstoff.get(ring), GT_Proxy.tBits, new Object[]{"h ", "fX", 'X', werkstoff.get(stick)}); - - //Gear - GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGt), GT_Proxy.tBits, new Object[]{"SPS", "PwP", "SPS", 'P', werkstoff.get(plate), 'S', werkstoff.get(stick)}); - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 4), ItemList.Shape_Extruder_Gear.get(0L), werkstoff.get(gearGt), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1), 8 * tVoltageMultiplier); - - //wireFine - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Wire.get(0L), werkstoff.get(wireFine, 8), (int) Math.max(werkstoff.getStats().getMass() * 1.5F, 1F), 8 * tVoltageMultiplier); - GT_Values.RA.addWiremillRecipe(werkstoff.get(ingot), werkstoff.get(wireFine, 8), (int) Math.max(werkstoff.getStats().getMass(), 1), 8 * tVoltageMultiplier); - GT_Values.RA.addWiremillRecipe(werkstoff.get(stick), werkstoff.get(wireFine, 4), (int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F), 8 * tVoltageMultiplier); - - //smallGear + // bolt + GT_Values.RA.addExtruderRecipe( + werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(ingot), + ItemList.Shape_Extruder_Bolt.get(0L), + werkstoff.get(bolt, 8), + (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), + 8 * tVoltageMultiplier); + GT_Values.RA.addCutterRecipe( + werkstoff.get(stick), + werkstoff.get(bolt, 4), + null, + (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), + 4); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(bolt), new ItemStack[] {werkstoff.get(dustTiny, 1)}, null, 2, 8); + + // screw + GT_Values.RA.addLatheRecipe( + werkstoff.get(bolt), + werkstoff.get(screw), + null, + (int) Math.max(werkstoff.getStats().getMass() / 8L, 1L), + 4); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(screw), GT_Proxy.tBits, new Object[] {"fX", "X ", 'X', werkstoff.get(bolt)}); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(screw), new ItemStack[] {werkstoff.get(dustTiny, 1)}, null, 2, 8); + + if (werkstoff.hasItemType(gem)) return; + + // ring + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot), + ItemList.Shape_Extruder_Ring.get(0L), + werkstoff.get(ring, 4), + (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), + 6 * tVoltageMultiplier); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(ring), GT_Proxy.tBits, new Object[] {"h ", "fX", 'X', werkstoff.get(stick)}); + + // Gear + GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGt), GT_Proxy.tBits, new Object[] { + "SPS", "PwP", "SPS", 'P', werkstoff.get(plate), 'S', werkstoff.get(stick) + }); + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot, 4), + ItemList.Shape_Extruder_Gear.get(0L), + werkstoff.get(gearGt), + (int) Math.max(werkstoff.getStats().getMass() * 5L, 1), + 8 * tVoltageMultiplier); + + // wireFine + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot), + ItemList.Shape_Extruder_Wire.get(0L), + werkstoff.get(wireFine, 8), + (int) Math.max(werkstoff.getStats().getMass() * 1.5F, 1F), + 8 * tVoltageMultiplier); + GT_Values.RA.addWiremillRecipe( + werkstoff.get(ingot), + werkstoff.get(wireFine, 8), + (int) Math.max(werkstoff.getStats().getMass(), 1), + 8 * tVoltageMultiplier); + GT_Values.RA.addWiremillRecipe( + werkstoff.get(stick), + werkstoff.get(wireFine, 4), + (int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F), + 8 * tVoltageMultiplier); + + // smallGear if (WerkstoffLoader.smallGearShape != null) - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), WerkstoffLoader.smallGearShape.get(0L), werkstoff.get(gearGtSmall), (int) werkstoff.getStats().getMass(), 8 * tVoltageMultiplier); + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot), + WerkstoffLoader.smallGearShape.get(0L), + werkstoff.get(gearGtSmall), + (int) werkstoff.getStats().getMass(), + 8 * tVoltageMultiplier); if (ConfigHandler.hardmode) - GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{" S ", "hPx", " S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[] { + " S ", "hPx", " S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate) + }); else - GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{"P ", " h ", 'P', werkstoff.get(plate)}); - - //Rotor - GT_ModHandler.addCraftingRecipe(werkstoff.get(rotor), GT_Proxy.tBits, new Object[]{"PhP", "SRf", "PdP", 'P', werkstoff.get(plate), 'R', werkstoff.get(ring), 'S', werkstoff.get(screw)}); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.Tin.getMolten(32), werkstoff.get(rotor), 240, 24); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.Lead.getMolten(48), werkstoff.get(rotor), 240, 24); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.SolderingAlloy.getMolten(16), werkstoff.get(rotor), 240, 24); + GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[] { + "P ", " h ", 'P', werkstoff.get(plate) + }); + + // Rotor + GT_ModHandler.addCraftingRecipe(werkstoff.get(rotor), GT_Proxy.tBits, new Object[] { + "PhP", "SRf", "PdP", 'P', werkstoff.get(plate), 'R', werkstoff.get(ring), 'S', werkstoff.get(screw) + }); + GT_Values.RA.addAssemblerRecipe( + werkstoff.get(plate, 4), + werkstoff.get(ring), + Materials.Tin.getMolten(32), + werkstoff.get(rotor), + 240, + 24); + GT_Values.RA.addAssemblerRecipe( + werkstoff.get(plate, 4), + werkstoff.get(ring), + Materials.Lead.getMolten(48), + werkstoff.get(rotor), + 240, + 24); + GT_Values.RA.addAssemblerRecipe( + werkstoff.get(plate, 4), + werkstoff.get(ring), + Materials.SolderingAlloy.getMolten(16), + werkstoff.get(rotor), + 240, + 24); if (WerkstoffLoader.rotorShape != null) - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 5), WerkstoffLoader.rotorShape.get(0L), werkstoff.get(rotor), 200, 60); + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot, 5), WerkstoffLoader.rotorShape.get(0L), werkstoff.get(rotor), 200, 60); - //molten -> metal + // molten -> metal if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear.get(0L), werkstoff.getMolten(576), werkstoff.get(gearGt), 128, 8); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear_Small.get(0L), werkstoff.getMolten(144), werkstoff.get(gearGtSmall), 16, 8); + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Gear.get(0L), werkstoff.getMolten(576), werkstoff.get(gearGt), 128, 8); + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Gear_Small.get(0L), + werkstoff.getMolten(144), + werkstoff.get(gearGtSmall), + 16, + 8); if (WerkstoffLoader.ringMold != null) - GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.ringMold.get(0L), werkstoff.getMolten(36), werkstoff.get(ring), 100, 4 * tVoltageMultiplier); + GT_Values.RA.addFluidSolidifierRecipe( + WerkstoffLoader.ringMold.get(0L), + werkstoff.getMolten(36), + werkstoff.get(ring), + 100, + 4 * tVoltageMultiplier); if (WerkstoffLoader.boltMold != null) - GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.boltMold.get(0L), werkstoff.getMolten(18), werkstoff.get(bolt), 50, 2 * tVoltageMultiplier); + GT_Values.RA.addFluidSolidifierRecipe( + WerkstoffLoader.boltMold.get(0L), + werkstoff.getMolten(18), + werkstoff.get(bolt), + 50, + 2 * tVoltageMultiplier); if (WerkstoffLoader.rotorMold != null) - GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.rotorMold.get(0L), werkstoff.getMolten(612), werkstoff.get(rotor), 100, 60); + GT_Values.RA.addFluidSolidifierRecipe( + WerkstoffLoader.rotorMold.get(0L), werkstoff.getMolten(612), werkstoff.get(rotor), 100, 60); } - GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGt), new ItemStack[]{werkstoff.get(dust, 4)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGtSmall), new ItemStack[]{werkstoff.get(dust, 1)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(rotor), new ItemStack[]{werkstoff.get(dust, 4), werkstoff.get(dustSmall)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(ring), new ItemStack[]{werkstoff.get(dustSmall, 1)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(gearGt), new ItemStack[] {werkstoff.get(dust, 4)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(gearGtSmall), new ItemStack[] {werkstoff.get(dust, 1)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(rotor), + new ItemStack[] {werkstoff.get(dust, 4), werkstoff.get(dustSmall)}, + null, + 2, + 8); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(ring), new ItemStack[] {werkstoff.get(dustSmall, 1)}, null, 2, 8); } } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java index f35d7c14a2..3967a56e6e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import gregtech.GT_Mod; @@ -31,13 +33,10 @@ import gregtech.api.enums.SubTag; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; -import static gregtech.api.enums.OrePrefixes.*; - public class CrushedLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - if (!werkstoff.hasItemType(ore) || !werkstoff.hasItemType(dust)) - return; + if (!werkstoff.hasItemType(ore) || !werkstoff.hasItemType(dust)) return; if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) { if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { @@ -54,40 +53,140 @@ public class CrushedLoader implements IWerkstoffRunnable { GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); } - GT_ModHandler.addCraftingRecipe(werkstoff.get(dustImpure), new Object[]{"h ", "W ", 'W', werkstoff.get(crushed)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(dustPure), new Object[]{"h ", "W ", 'W', werkstoff.get(crushedPurified)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{"h ", "W ", 'W', werkstoff.get(crushedCentrifuged)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(dustImpure), new Object[] {"h ", "W ", 'W', werkstoff.get(crushed)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(dustPure), new Object[] {"h ", "W ", 'W', werkstoff.get(crushedPurified)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(dust), new Object[] {"h ", "W ", 'W', werkstoff.get(crushedCentrifuged)}); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), 10, 16); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), werkstoff.getOreByProduct(0, dust), 10, false); - GT_ModHandler.addOreWasherRecipe(werkstoff.get(crushed), new int[] {10000, 1111, 10000}, 1000, werkstoff.get(crushedPurified), werkstoff.getOreByProduct(0, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); - GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushed), new int[] {10000, 1111, 10000}, (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); + GT_ModHandler.addPulverisationRecipe( + werkstoff.get(crushed), werkstoff.get(dustImpure), werkstoff.getOreByProduct(0, dust), 10, false); + GT_ModHandler.addOreWasherRecipe( + werkstoff.get(crushed), + new int[] {10000, 1111, 10000}, + 1000, + werkstoff.get(crushedPurified), + werkstoff.getOreByProduct(0, dust), + GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); + GT_ModHandler.addThermalCentrifugeRecipe( + werkstoff.get(crushed), + new int[] {10000, 1111, 10000}, + (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), + werkstoff.get(crushedCentrifuged), + werkstoff.getOreByProduct(1, dust), + GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), 10, 16); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), werkstoff.getOreByProduct(1, dust), 10, false); - GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushedPurified), new int[] {10000, 1111}, (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dust)); + GT_ModHandler.addPulverisationRecipe( + werkstoff.get(crushedPurified), werkstoff.get(dustPure), werkstoff.getOreByProduct(1, dust), 10, false); + GT_ModHandler.addThermalCentrifugeRecipe( + werkstoff.get(crushedPurified), + new int[] {10000, 1111}, + (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), + werkstoff.get(crushedCentrifuged), + werkstoff.getOreByProduct(1, dust)); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(dust), 10, 16); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(dust), werkstoff.getOreByProduct(2, dust), 10, false); + GT_ModHandler.addPulverisationRecipe( + werkstoff.get(crushedCentrifuged), werkstoff.get(dust), werkstoff.getOreByProduct(2, dust), 10, false); - GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustImpure), null, null, null, werkstoff.get(dust), werkstoff.getOreByProduct(0, dust), null, null, null, null, new int[] {10000, 1111}, (int) Math.max(1L, werkstoff.getStats().getMass() * 8L), 5); - GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustPure), null, null, null, werkstoff.get(dust), werkstoff.getOreByProduct(1, dust), null, null, null, null, new int[] {10000, 1111}, (int) Math.max(1L, werkstoff.getStats().getMass() * 8L), 5); + GT_Values.RA.addCentrifugeRecipe( + werkstoff.get(dustImpure), + null, + null, + null, + werkstoff.get(dust), + werkstoff.getOreByProduct(0, dust), + null, + null, + null, + null, + new int[] {10000, 1111}, + (int) Math.max(1L, werkstoff.getStats().getMass() * 8L), + 5); + GT_Values.RA.addCentrifugeRecipe( + werkstoff.get(dustPure), + null, + null, + null, + werkstoff.get(dust), + werkstoff.getOreByProduct(1, dust), + null, + null, + null, + null, + new int[] {10000, 1111}, + (int) Math.max(1L, werkstoff.getStats().getMass() * 8L), + 5); if (werkstoff.contains(SubTag.CRYSTALLISABLE)) { - GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustPure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); - GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustImpure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); - GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustPure), gregtech.api.util.GT_ModHandler.getDistilledWater(200L), werkstoff.get(gem), 9500, 1500, 24); - GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustImpure), gregtech.api.util.GT_ModHandler.getDistilledWater(200L), werkstoff.get(gem), 9500, 1500, 24); + GT_Values.RA.addAutoclaveRecipe( + werkstoff.get(dustPure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); + GT_Values.RA.addAutoclaveRecipe( + werkstoff.get(dustImpure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); + GT_Values.RA.addAutoclaveRecipe( + werkstoff.get(dustPure), + gregtech.api.util.GT_ModHandler.getDistilledWater(200L), + werkstoff.get(gem), + 9500, + 1500, + 24); + GT_Values.RA.addAutoclaveRecipe( + werkstoff.get(dustImpure), + gregtech.api.util.GT_ModHandler.getDistilledWater(200L), + werkstoff.get(gem), + 9500, + 1500, + 24); } if (werkstoff.contains(SubTag.WASHING_MERCURY)) - GT_Values.RA.addChemicalBathRecipe(werkstoff.get(crushed), Materials.Mercury.getFluid(1000L), werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); + GT_Values.RA.addChemicalBathRecipe( + werkstoff.get(crushed), + Materials.Mercury.getFluid(1000L), + werkstoff.get(crushedPurified), + werkstoff.getOreByProduct(1, dust), + GT_OreDictUnificator.get(dust, Materials.Stone, 1L), + new int[] {10000, 7000, 4000}, + 800, + 8); if (werkstoff.contains(SubTag.WASHING_SODIUMPERSULFATE)) - GT_Values.RA.addChemicalBathRecipe(werkstoff.get(crushed), Materials.SodiumPersulfate.getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L), werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); + GT_Values.RA.addChemicalBathRecipe( + werkstoff.get(crushed), + Materials.SodiumPersulfate.getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L), + werkstoff.get(crushedPurified), + werkstoff.getOreByProduct(1, dust), + GT_OreDictUnificator.get(dust, Materials.Stone, 1L), + new int[] {10000, 7000, 4000}, + 800, + 8); if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_GOLD)) - GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Gold, 1L), GT_OreDictUnificator.get(nugget, Materials.Gold, 1L), new int[]{10000, 4000, 2000}, 400, 24); + GT_Values.RA.addElectromagneticSeparatorRecipe( + werkstoff.get(dustPure), + werkstoff.get(dust), + GT_OreDictUnificator.get(dustSmall, Materials.Gold, 1L), + GT_OreDictUnificator.get(nugget, Materials.Gold, 1L), + new int[] {10000, 4000, 2000}, + 400, + 24); else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_IRON)) - GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Iron, 1L), GT_OreDictUnificator.get(nugget, Materials.Iron, 1L), new int[]{10000, 4000, 2000}, 400, 24); + GT_Values.RA.addElectromagneticSeparatorRecipe( + werkstoff.get(dustPure), + werkstoff.get(dust), + GT_OreDictUnificator.get(dustSmall, Materials.Iron, 1L), + GT_OreDictUnificator.get(nugget, Materials.Iron, 1L), + new int[] {10000, 4000, 2000}, + 400, + 24); else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM)) - GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Neodymium, 1L), GT_OreDictUnificator.get(nugget, Materials.Neodymium, 1L), new int[]{10000, 4000, 2000}, 400, 24); + GT_Values.RA.addElectromagneticSeparatorRecipe( + werkstoff.get(dustPure), + werkstoff.get(dust), + GT_OreDictUnificator.get(dustSmall, Materials.Neodymium, 1L), + GT_OreDictUnificator.get(nugget, Materials.Neodymium, 1L), + new int[] {10000, 4000, 2000}, + 400, + 24); } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java index aa580c3237..de1a0d1b34 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; @@ -35,14 +37,11 @@ import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; - -import static gregtech.api.enums.OrePrefixes.*; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; public class DustLoader implements IWerkstoffRunnable { @@ -55,10 +54,16 @@ public class DustLoader implements IWerkstoffRunnable { HashMap> tracker = new HashMap<>(); int cells = 0; - if (werkstoff.getGenerationFeatures().hasMixerRecipes() || werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { - for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { + if (werkstoff.getGenerationFeatures().hasMixerRecipes() + || werkstoff.getStats().isElektrolysis() + || werkstoff.getStats().isCentrifuge() + || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { + for (Pair container : + werkstoff.getContents().getValue().toArray(new Pair[0])) { if (container.getKey() instanceof Materials) { - if (((Materials) container.getKey()).getGas(0) != null || ((Materials) container.getKey()).getFluid(0) != null || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { + if (((Materials) container.getKey()).getGas(0) != null + || ((Materials) container.getKey()).getFluid(0) != null + || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); @@ -67,45 +72,63 @@ public class DustLoader implements IWerkstoffRunnable { if (flOutputs.size() > 1) { if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + tracker.put( + container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + stOutputs.add(((Materials) container.getKey()) + .getCells(tracker.get(container.getKey()) + .getKey() + + container.getValue())); + stOutputs.remove( + tracker.get(container.getKey()).getValue() + 1); } cells += container.getValue(); } } else { if (((Materials) container.getKey()).getDust(container.getValue()) == null) { - if (((Materials) container.getKey()).getCells(container.getValue()) != null && (((Materials) container.getKey()).getMolten(0) != null || ((Materials) container.getKey()).getSolid(0) != null)) { - FluidStack tmpFl = ((Materials) container.getKey()).getMolten(1000 * container.getValue()); + if (((Materials) container.getKey()).getCells(container.getValue()) != null + && (((Materials) container.getKey()).getMolten(0) != null + || ((Materials) container.getKey()).getSolid(0) != null)) { + FluidStack tmpFl = + ((Materials) container.getKey()).getMolten(1000 * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = ((Materials) container.getKey()).getSolid(1000 * container.getValue()); } flOutputs.add(tmpFl); if (flOutputs.size() > 1) { if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + stOutputs.add( + ((Materials) container.getKey()).getCells(container.getValue())); + tracker.put( + container.getKey(), + new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + stOutputs.add(((Materials) container.getKey()) + .getCells(tracker.get(container.getKey()) + .getKey() + + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()) + .getValue() + + 1); } cells += container.getValue(); } - } else - continue; + } else continue; } if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Materials) container.getKey()).getDust(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.add(((Materials) container.getKey()) + .getDust(tracker.get(container.getKey()).getKey() + container.getValue())); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } } } else if (container.getKey() instanceof Werkstoff) { - if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) { - FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); + if (((Werkstoff) container.getKey()).getStats().isGas() + || ((Werkstoff) container.getKey()).hasItemType(cell)) { + FluidStack tmpFl = + ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); } @@ -113,21 +136,30 @@ public class DustLoader implements IWerkstoffRunnable { if (flOutputs.size() > 1) { if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + tracker.put( + container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Werkstoff) container.getKey()).get(cell, tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + stOutputs.add(((Werkstoff) container.getKey()) + .get( + cell, + tracker.get(container.getKey()) + .getKey() + + container.getValue())); + stOutputs.remove( + tracker.get(container.getKey()).getValue() + 1); } cells += container.getValue(); } } else { - if (!((Werkstoff) container.getKey()).hasItemType(dust)) - continue; + if (!((Werkstoff) container.getKey()).hasItemType(dust)) continue; if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Werkstoff) container.getKey()).get(dust, (tracker.get(container.getKey()).getKey() + container.getValue()))); + stOutputs.add(((Werkstoff) container.getKey()) + .get( + dust, + (tracker.get(container.getKey()).getKey() + container.getValue()))); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } } @@ -136,64 +168,175 @@ public class DustLoader implements IWerkstoffRunnable { ItemStack input = werkstoff.get(dust); input.stackSize = werkstoff.getContents().getKey(); if (werkstoff.getStats().isElektrolysis()) - GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().getProtons() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); + GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe( + true, + new ItemStack[] {input, cells > 0 ? Materials.Empty.getCells(cells) : null}, + stOutputs.toArray(new ItemStack[0]), + null, + null, + new FluidStack[] {null}, + new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, + (int) Math.max( + 1L, + Math.abs(werkstoff.getStats().getProtons() + / werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 30, + 0)); if (werkstoff.getStats().isCentrifuge()) - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().getMass() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe( + true, + new ItemStack[] {input, cells > 0 ? Materials.Empty.getCells(cells) : null}, + stOutputs.toArray(new ItemStack[0]), + null, + null, + new FluidStack[] {null}, + new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, + (int) Math.max( + 1L, + Math.abs(werkstoff.getStats().getMass() + / werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 5, + 0)); if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { - if (cells > 0) - stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().getProtons() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); - GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().getProtons() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); + if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); + GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe( + true, + stOutputs.toArray(new ItemStack[0]), + new ItemStack[] {input}, + null, + null, + new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, + null, + (int) Math.max( + 1L, + Math.abs(werkstoff.getStats().getProtons() + / werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 30, + 0)); + GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe( + true, + stOutputs.toArray(new ItemStack[0]), + new ItemStack[] {input}, + null, + null, + new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, + null, + (int) Math.max( + 1L, + Math.abs(werkstoff.getStats().getProtons() + / werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 30, + 0); } if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { - if (cells > 0) - stOutputs.add(Materials.Empty.getCells(cells)); + if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); short circuitID = werkstoff.getMixCircuit(); ItemStack circuit = circuitID == -1 ? null : GT_Utility.getIntegratedCircuit(circuitID); if (circuit != null) stOutputs.add(circuit); - GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().getMass() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); + GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe( + true, + stOutputs.toArray(new ItemStack[0]), + new ItemStack[] {input}, + null, + null, + new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, + null, + (int) Math.max( + 1L, + Math.abs(werkstoff.getStats().getMass() + / werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 5, + 0)); } } - GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{ - "TTT", "TTT", "TTT", 'T', - werkstoff.get(dustTiny) - }); - GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{ - "TT ", "TT ", 'T', - WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff) - }); - GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff, 4), new Object[]{ - " T ", 'T', werkstoff.get(dust) - }); - GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff, 9), new Object[]{ - "T ", 'T', werkstoff.get(dust) - }); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(dust), new Object[] {"TTT", "TTT", "TTT", 'T', werkstoff.get(dustTiny)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(dust), + new Object[] {"TT ", "TT ", 'T', WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff)}); + GT_ModHandler.addCraftingRecipe( + WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff, 4), + new Object[] {" T ", 'T', werkstoff.get(dust)}); + GT_ModHandler.addCraftingRecipe( + WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff, 9), + new Object[] {"T ", 'T', werkstoff.get(dust)}); - GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny, 9), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); - GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall, 4), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); - GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny, 9), ItemList.Schematic_3by3.get(0L), werkstoff.get(dust), 100, 4); - GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall, 4), ItemList.Schematic_2by2.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe( + werkstoff.get(dustTiny, 9), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe( + werkstoff.get(dustSmall, 4), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe( + werkstoff.get(dustTiny, 9), ItemList.Schematic_3by3.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe( + werkstoff.get(dustSmall, 4), ItemList.Schematic_2by2.get(0L), werkstoff.get(dust), 100, 4); if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) { GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustTiny), werkstoff.get(nugget)); - } else if (werkstoff.hasItemType(ingot) && werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().getMeltingPoint() != 0) { + } else if (werkstoff.hasItemType(ingot) + && werkstoff.getStats().isBlastFurnace() + && werkstoff.getStats().getMeltingPoint() != 0) { if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)) { - GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Nitrogen.getGas(1000), null, werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().getMeltingVoltage(), werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.addBlastRecipe( + werkstoff.get(dust), + GT_Utility.getIntegratedCircuit(11), + Materials.Nitrogen.getGas(1000), + null, + werkstoff.getStats().getMeltingPoint() < 1750 + ? werkstoff.get(ingot) + : werkstoff.get(ingotHot), + null, + (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) + * werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().getMeltingVoltage(), + werkstoff.getStats().getMeltingPoint()); } else if (werkstoff.contains(WerkstoffLoader.NOBLE_GAS_SMELTING)) { - GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Argon.getGas(1000), null, werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().getMeltingVoltage(), werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.addBlastRecipe( + werkstoff.get(dust), + GT_Utility.getIntegratedCircuit(11), + Materials.Argon.getGas(1000), + null, + werkstoff.getStats().getMeltingPoint() < 1750 + ? werkstoff.get(ingot) + : werkstoff.get(ingotHot), + null, + (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) + * werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().getMeltingVoltage(), + werkstoff.getStats().getMeltingPoint()); } else { - GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().getMeltingVoltage(), werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.addBlastRecipe( + werkstoff.get(dust), + GT_Utility.getIntegratedCircuit(1), + null, + null, + werkstoff.getStats().getMeltingPoint() < 1750 + ? werkstoff.get(ingot) + : werkstoff.get(ingotHot), + null, + (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) + * werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().getMeltingVoltage(), + werkstoff.getStats().getMeltingPoint()); if (werkstoff.getStats().getMeltingPoint() <= 1000) { - GT_Values.RA.addPrimitiveBlastRecipe(werkstoff.get(dust), null, 9, werkstoff.get(ingot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint()); - //GT_ModHandler.addRCBlastFurnaceRecipe(werkstoff.get(ingot), werkstoff.get(dust), werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.addPrimitiveBlastRecipe( + werkstoff.get(dust), + null, + 9, + werkstoff.get(ingot), + null, + (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) + * werkstoff.getStats().getMeltingPoint()); + // GT_ModHandler.addRCBlastFurnaceRecipe(werkstoff.get(ingot), werkstoff.get(dust), + // werkstoff.getStats().getMeltingPoint()); } } } if (werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().getMeltingPoint() > 1750) { - GT_Values.RA.addVacuumFreezerRecipe(werkstoff.get(ingotHot), werkstoff.get(ingot), (int) Math.max(werkstoff.getStats().getMass() * 3L, 1L)); + GT_Values.RA.addVacuumFreezerRecipe(werkstoff.get(ingotHot), werkstoff.get(ingot), (int) + Math.max(werkstoff.getStats().getMass() * 3L, 1L)); } if (werkstoff.hasItemType(ingot)) { @@ -205,4 +348,4 @@ public class DustLoader implements IWerkstoffRunnable { } } } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java index 194ab143d9..d8ee81065b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; @@ -36,33 +38,29 @@ import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; -import static gregtech.api.enums.OrePrefixes.*; - public class GemLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(gem)) { - if (werkstoff.getGenerationFeatures().hasSifterRecipes() || (werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust))) { + if (werkstoff.getGenerationFeatures().hasSifterRecipes() + || (werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust))) { GT_ModHandler.addCompressionRecipe(werkstoff.get(gem, 9), werkstoff.get(block)); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(block), werkstoff.get(gem, 9), 100, 24); GT_Values.RA.addSifterRecipe( werkstoff.get(crushedPurified), - new ItemStack[]{ - werkstoff.get(gemExquisite), - werkstoff.get(gemFlawless), - werkstoff.get(gem), - werkstoff.get(gemFlawed), - werkstoff.get(gemChipped), - werkstoff.get(dust) - }, - new int[]{ - 200, 1000, 2500, 2000, 4000, 5000 + new ItemStack[] { + werkstoff.get(gemExquisite), + werkstoff.get(gemFlawless), + werkstoff.get(gem), + werkstoff.get(gemFlawed), + werkstoff.get(gemChipped), + werkstoff.get(dust) }, + new int[] {200, 1000, 2500, 2000, 4000, 5000}, 800, - 16 - ); + 16); } GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemExquisite), werkstoff.get(dust, 4)); @@ -71,10 +69,14 @@ public class GemLoader implements IWerkstoffRunnable { GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawed), werkstoff.get(dustSmall, 2)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemChipped), werkstoff.get(dustSmall)); - GT_ModHandler.addCraftingRecipe(werkstoff.get(gemFlawless, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gemExquisite)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(gem, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gemFlawless)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(gemFlawed, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gem)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(gemChipped, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gemFlawed)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(gemFlawless, 2), 0, new Object[] {"h ", "W ", 'W', werkstoff.get(gemExquisite)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(gem, 2), 0, new Object[] {"h ", "W ", 'W', werkstoff.get(gemFlawless)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(gemFlawed, 2), 0, new Object[] {"h ", "W ", 'W', werkstoff.get(gem)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(gemChipped, 2), 0, new Object[] {"h ", "W ", 'W', werkstoff.get(gemFlawed)}); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemExquisite), werkstoff.get(gemFlawless, 2), 64, 16); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawless), werkstoff.get(gem, 2), 64, 16); @@ -83,28 +85,59 @@ public class GemLoader implements IWerkstoffRunnable { GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemChipped), werkstoff.get(dustTiny), 64, 16); if (!werkstoff.contains(WerkstoffLoader.NO_BLAST)) { - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawless, 3), 8, werkstoff.get(gemExquisite), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gem, 3), 8, werkstoff.get(gemFlawless), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawed, 3), 8, werkstoff.get(gem), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemChipped, 3), 8, werkstoff.get(gemFlawed), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe( + werkstoff.get(gemFlawless, 3), + 8, + werkstoff.get(gemExquisite), + GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe( + werkstoff.get(gem, 3), + 8, + werkstoff.get(gemFlawless), + GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe( + werkstoff.get(gemFlawed, 3), + 8, + werkstoff.get(gem), + GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe( + werkstoff.get(gemChipped, 3), + 8, + werkstoff.get(gemFlawed), + GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(dust, 4), 24, werkstoff.get(gem, 3), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)); + GT_Values.RA.addImplosionRecipe( + werkstoff.get(dust, 4), + 24, + werkstoff.get(gem, 3), + GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)); } if (werkstoff.hasItemType(plate)) { - GT_Values.RA.addLatheRecipe(werkstoff.get(plate), werkstoff.get(lens), werkstoff.get(dustSmall), 1200, 120); + GT_Values.RA.addLatheRecipe( + werkstoff.get(plate), werkstoff.get(lens), werkstoff.get(dustSmall), 1200, 120); } - GT_Values.RA.addLatheRecipe(werkstoff.get(gemExquisite), werkstoff.get(lens), werkstoff.get(dust, 2), 2400, 30); - GregTech_API.registerCover(werkstoff.get(lens), TextureFactory.of(Textures.BlockIcons.MACHINE_CASINGS[2][0], TextureFactory.of(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false)), new gregtech.common.covers.GT_Cover_Lens(BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex)); + GT_Values.RA.addLatheRecipe( + werkstoff.get(gemExquisite), werkstoff.get(lens), werkstoff.get(dust, 2), 2400, 30); + GregTech_API.registerCover( + werkstoff.get(lens), + TextureFactory.of( + Textures.BlockIcons.MACHINE_CASINGS[2][0], + TextureFactory.of(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false)), + new gregtech.common.covers.GT_Cover_Lens(BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(lens), werkstoff.get(dustSmall, 3)); - for (ItemStack is : OreDictionary.getOres("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) { + for (ItemStack is : OreDictionary.getOres("craftingLens" + + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) { is.stackSize = 0; - GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemChipped, 3), is, werkstoff.get(gemFlawed, 1), 600, 30); + GT_Values.RA.addLaserEngraverRecipe( + werkstoff.get(gemChipped, 3), is, werkstoff.get(gemFlawed, 1), 600, 30); GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemFlawed, 3), is, werkstoff.get(gem, 1), 600, 120); - GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gem, 3), is, werkstoff.get(gemFlawless, 1), 1200, 480); - GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemFlawless, 3), is, werkstoff.get(gemExquisite, 1), 2400, 2000); + GT_Values.RA.addLaserEngraverRecipe( + werkstoff.get(gem, 3), is, werkstoff.get(gemFlawless, 1), 1200, 480); + GT_Values.RA.addLaserEngraverRecipe( + werkstoff.get(gemFlawless, 3), is, werkstoff.get(gemExquisite, 1), 2400, 2000); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java index 9db7e8f26a..874d82859d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java @@ -22,22 +22,32 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.block; +import static gregtech.api.enums.OrePrefixes.ingot; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.util.GT_ModHandler; -import static gregtech.api.enums.OrePrefixes.block; -import static gregtech.api.enums.OrePrefixes.ingot; - public class MetalLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(ingot)) { GT_ModHandler.addCompressionRecipe(werkstoff.get(ingot, 9), werkstoff.get(block)); - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 9), ItemList.Shape_Extruder_Block.get(0), werkstoff.get(block), (int) werkstoff.getStats().getMass(), 8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); - GT_Values.RA.addAlloySmelterRecipe(werkstoff.get(ingot, 9), ItemList.Shape_Mold_Block.get(0L), werkstoff.get(block), (int) (werkstoff.getStats().getMass() / 2), 4 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot, 9), + ItemList.Shape_Extruder_Block.get(0), + werkstoff.get(block), + (int) werkstoff.getStats().getMass(), + 8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); + GT_Values.RA.addAlloySmelterRecipe( + werkstoff.get(ingot, 9), + ItemList.Shape_Mold_Block.get(0L), + werkstoff.get(block), + (int) (werkstoff.getStats().getMass() / 2), + 4 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); } } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java index 0e6d14d4a9..153f131383 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.capsuleMolten; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -31,58 +34,137 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; +import java.util.Objects; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; -import java.util.Objects; - -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.capsuleMolten; -import static gregtech.api.enums.OrePrefixes.*; - public class MoltenCellLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - if (!werkstoff.hasItemType(WerkstoffLoader.cellMolten)) - return; + if (!werkstoff.hasItemType(WerkstoffLoader.cellMolten)) return; if (!werkstoff.hasItemType(ingot)) { - if (!werkstoff.hasItemType(dust)) - return; - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall), null, werkstoff.getMolten(36), 0, (int) ((double) werkstoff.getStats().getMass() / 4D), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny), null, werkstoff.getMolten(16), 0, (int) ((double) werkstoff.getStats().getMass() / 9D), werkstoff.getStats().getMass() > 128 ? 64 : 30); + if (!werkstoff.hasItemType(dust)) return; + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(dust), + null, + werkstoff.getMolten(144), + 0, + (int) werkstoff.getStats().getMass(), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(dustSmall), + null, + werkstoff.getMolten(36), + 0, + (int) ((double) werkstoff.getStats().getMass() / 4D), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(dustTiny), + null, + werkstoff.getMolten(16), + 0, + (int) ((double) werkstoff.getStats().getMass() / 9D), + werkstoff.getStats().getMass() > 128 ? 64 : 30); } else { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(ingot), + null, + werkstoff.getMolten(144), + 0, + (int) werkstoff.getStats().getMass(), + werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget), null, werkstoff.getMolten(16), 0, (int) ((double) werkstoff.getStats().getMass() / 9D), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(nugget), + null, + werkstoff.getMolten(16), + 0, + (int) ((double) werkstoff.getStats().getMass() / 9D), + werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), (int) ((double) werkstoff.getStats().getMass() / 9D), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(1296), werkstoff.get(block), (int) werkstoff.getStats().getMass() * 9, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Ingot.get(0), + werkstoff.getMolten(144), + werkstoff.get(ingot), + (int) werkstoff.getStats().getMass(), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + // GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), + // werkstoff.get(block), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : + // 30); + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Nugget.get(0), + werkstoff.getMolten(16), + werkstoff.get(nugget), + (int) ((double) werkstoff.getStats().getMass() / 9D), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Block.get(0), + werkstoff.getMolten(1296), + werkstoff.get(block), + (int) werkstoff.getStats().getMass() * 9, + werkstoff.getStats().getMass() > 128 ? 64 : 30); - if (!werkstoff.hasItemType(plate)) - return; + if (!werkstoff.hasItemType(plate)) return; - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick), null, werkstoff.getMolten(72), 0, (int) ((double) werkstoff.getStats().getMass() / 2D), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(stickLong), + null, + werkstoff.getMolten(144), + 0, + (int) werkstoff.getStats().getMass(), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(plate), + null, + werkstoff.getMolten(144), + 0, + (int) werkstoff.getStats().getMass(), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(stick), + null, + werkstoff.getMolten(72), + 0, + (int) ((double) werkstoff.getStats().getMass() / 2D), + werkstoff.getStats().getMass() > 128 ? 64 : 30); } - //Tank "Recipe" - final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); - FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); + // Tank "Recipe" + final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData( + new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), + werkstoff.get(WerkstoffLoader.cellMolten), + Materials.Empty.getCells(1)); + FluidContainerRegistry.registerFluidContainer( + werkstoff.getMolten(144), werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); GT_Utility.addFluidContainerData(data); - GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(WerkstoffLoader.cellMolten), new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); + GT_Values.RA.addFluidCannerRecipe( + Materials.Empty.getCells(1), + werkstoff.get(WerkstoffLoader.cellMolten), + new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), + GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe( + werkstoff.get(WerkstoffLoader.cellMolten), + Materials.Empty.getCells(1), + GT_Values.NF, + new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); - if (!LoaderReference.Forestry) - return; + if (!LoaderReference.Forestry) return; - final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); - FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( + new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), + werkstoff.get(capsuleMolten), + GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + FluidContainerRegistry.registerFluidContainer( + werkstoff.getMolten(144), + werkstoff.get(capsuleMolten), + GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsuleMolten), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); + GT_Values.RA.addFluidCannerRecipe( + werkstoff.get(capsuleMolten), + GT_Values.NI, + GT_Values.NF, + new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java index eb8d5ab9f3..135ee00218 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import com.github.bartimaeusnek.bartworks.util.BWRecipes; @@ -32,15 +34,27 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.OrePrefixes.*; - public class MultipleMetalLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(plateDense)) { - GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{werkstoff.get(ingot, 2), GT_Utility.getIntegratedCircuit(2)}, new ItemStack[]{werkstoff.get(plateDouble)}, null, null, null, null, (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), 60, 0)); - GregTech_API.registerCover(werkstoff.get(plateDouble), TextureFactory.of(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false), null); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(plateDouble), new ItemStack[]{werkstoff.get(dust, 2)}, null, 2, 8); + GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe( + true, + new ItemStack[] {werkstoff.get(ingot, 2), GT_Utility.getIntegratedCircuit(2)}, + new ItemStack[] {werkstoff.get(plateDouble)}, + null, + null, + null, + null, + (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), + 60, + 0)); + GregTech_API.registerCover( + werkstoff.get(plateDouble), + TextureFactory.of(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false), + null); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(plateDouble), new ItemStack[] {werkstoff.get(dust, 2)}, null, 2, 8); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java index 7700ff74c6..a17efb4e6e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; @@ -30,16 +32,21 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.SubTag; import gregtech.api.util.GT_ModHandler; -import static gregtech.api.enums.OrePrefixes.*; - public class OreLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - if (werkstoff.hasItemType(ore) && werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) - GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), werkstoff.get(ingot)); + if (werkstoff.hasItemType(ore) + && werkstoff.hasItemType(ingot) + && !werkstoff.getStats().isBlastFurnace()) + GT_ModHandler.addSmeltingRecipe( + WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), werkstoff.get(ingot)); if (werkstoff.hasItemType(ore)) { - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ore), werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(crushed), 16, 10); + GT_Values.RA.addForgeHammerRecipe( + werkstoff.get(ore), + werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(crushed), + 16, + 10); GT_ModHandler.addPulverisationRecipe( werkstoff.get(ore), werkstoff.get(crushed, 2), @@ -50,4 +57,4 @@ public class OreLoader implements IWerkstoffRunnable { true); } } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java index a3766d9843..fd8d5be39e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -39,47 +41,103 @@ import gregtech.api.util.GT_Utility; import gregtech.common.GT_Proxy; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.OrePrefixes.*; - public class SimpleMetalLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(plate)) { if (werkstoff.hasItemType(gem)) { - GT_Values.RA.addLatheRecipe(werkstoff.get(gem), werkstoff.get(stick), werkstoff.get(dustSmall, 2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); - GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(gem)}); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); + GT_Values.RA.addLatheRecipe( + werkstoff.get(gem), + werkstoff.get(stick), + werkstoff.get(dustSmall, 2), + (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), + 16); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[] {"s", "X", 'X', werkstoff.get(stickLong) + }); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(stick), GT_Proxy.tBits, new Object[] {"f ", " X", 'X', werkstoff.get(gem)}); + GT_Values.RA.addForgeHammerRecipe( + werkstoff.get(stick, 2), + werkstoff.get(stickLong), + (int) Math.max(werkstoff.getStats().getMass(), 1L), + 16); TextureSet texSet = werkstoff.getTexSet(); - ITexture texture = SideReference.Side.Client ? - TextureFactory.of(texSet.mTextures[PrefixTextureLinker.blockTexMap.getOrDefault(texSet, block.mTextureIndex)], werkstoff.getRGBA(), false) : - TextureFactory.of(texSet.mTextures[block.mTextureIndex], werkstoff.getRGBA(), false); - GregTech_API.registerCover(werkstoff.get(plate),texture,null); + ITexture texture = SideReference.Side.Client + ? TextureFactory.of( + texSet.mTextures[ + PrefixTextureLinker.blockTexMap.getOrDefault(texSet, block.mTextureIndex)], + werkstoff.getRGBA(), + false) + : TextureFactory.of(texSet.mTextures[block.mTextureIndex], werkstoff.getRGBA(), false); + GregTech_API.registerCover(werkstoff.get(plate), texture, null); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(plate), new ItemStack[] {werkstoff.get(dust)}, null, 2, 8); return; } - GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(ingot)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(plate), GT_Proxy.tBits, new Object[]{"h", "X", "X", 'X', werkstoff.get(ingot)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[] {"s", "X", 'X', werkstoff.get(stickLong)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(stick), GT_Proxy.tBits, new Object[] {"f ", " X", 'X', werkstoff.get(ingot)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(plate), GT_Proxy.tBits, new Object[] {"h", "X", "X", 'X', werkstoff.get(ingot)}); - GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(1)}, new ItemStack[]{werkstoff.get(plate)}, null, null, null, null, (int) Math.max(werkstoff.getStats().getMass(), 1L), 24, 0)); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ingot, 3), werkstoff.get(plate, 2), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); - GregTech_API.registerCover(werkstoff.get(plate), TextureFactory.of(werkstoff.getTexSet().mTextures[71], werkstoff.getRGBA(), false), null); + GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe( + true, + new ItemStack[] {werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(1)}, + new ItemStack[] {werkstoff.get(plate)}, + null, + null, + null, + null, + (int) Math.max(werkstoff.getStats().getMass(), 1L), + 24, + 0)); + GT_Values.RA.addForgeHammerRecipe( + werkstoff.get(ingot, 3), + werkstoff.get(plate, 2), + (int) Math.max(werkstoff.getStats().getMass(), 1L), + 16); + GregTech_API.registerCover( + werkstoff.get(plate), + TextureFactory.of(werkstoff.getTexSet().mTextures[71], werkstoff.getRGBA(), false), + null); - GT_Values.RA.addLatheRecipe(werkstoff.get(ingot), werkstoff.get(stick), werkstoff.get(dustSmall, 2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); + GT_Values.RA.addLatheRecipe( + werkstoff.get(ingot), + werkstoff.get(stick), + werkstoff.get(dustSmall, 2), + (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), + 16); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); + GT_Values.RA.addForgeHammerRecipe( + werkstoff.get(stick, 2), + werkstoff.get(stickLong), + (int) Math.max(werkstoff.getStats().getMass(), 1L), + 16); - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Plate.get(0), werkstoff.get(plate), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Rod.get(0), werkstoff.get(stick, 2), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot), + ItemList.Shape_Extruder_Plate.get(0), + werkstoff.get(plate), + (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), + 45); + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot), + ItemList.Shape_Extruder_Rod.get(0), + werkstoff.get(stick, 2), + (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), + 45); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(ingot), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(stickLong), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(stick), new ItemStack[]{werkstoff.get(dustSmall, 2)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(ingot), new ItemStack[] {werkstoff.get(dust)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[] {werkstoff.get(dust)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(stickLong), new ItemStack[] {werkstoff.get(dust)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(stick), new ItemStack[] {werkstoff.get(dustSmall, 2)}, null, 2, 8); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java index 647204e041..9744bdf89c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.gtnhGT; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import gregtech.api.enums.Dyes; @@ -35,99 +38,917 @@ import gregtech.common.items.GT_MetaGenerated_Tool_01; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.gtnhGT; -import static gregtech.api.enums.OrePrefixes.*; - public class ToolLoader implements IWerkstoffRunnable { - //GTNH-Specific + // GTNH-Specific public static final short SCREWDRIVER_MV = 152; public static final short SCREWDRIVER_HV = 154; public static final short SOLDERING_IRON_MV = 162; public static final short SOLDERING_IRON_HV = 164; public void run(Werkstoff werkstoff) { - if (werkstoff.getBridgeMaterial().mDurability == 0) - return; + if (werkstoff.getBridgeMaterial().mDurability == 0) return; if (werkstoff.hasItemType(gem)) { if (!werkstoff.getGenerationFeatures().isExtension()) - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', gem.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"GGf", 'G', gem.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.HARDHAMMER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "XX ", + "XXS", + "XX ", + 'X', + gem.get(werkstoff.getBridgeMaterial()), + 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) + }); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), + GT_Proxy.tBits, + new Object[] {"GGf", 'G', gem.get(werkstoff.getBridgeMaterial())}); } - if (!werkstoff.hasItemType(plate)) - return; + if (!werkstoff.hasItemType(plate)) return; - //Disable recipe gen with handle Material for GT Materials + // Disable recipe gen with handle Material for GT Materials if (!werkstoff.getGenerationFeatures().isExtension()) { - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{" fS", " Sh", "W ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadWrench, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"hXW", "XRX", "WXd", 'X', plate.get(werkstoff.getBridgeMaterial()), 'S', plate.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'R', ring.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'W', screw.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{toolHeadHammer.get(werkstoff.getBridgeMaterial()), stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.FILE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P", "P", "S", 'P', plate.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SAW, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), new Object[]{toolHeadSaw.get(werkstoff.getBridgeMaterial()), stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.AnyRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_LV_Lithium.get(1L)}); - + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SCREWDRIVER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + " fS", + " Sh", + "W ", + 'S', + stick.get(werkstoff.getBridgeMaterial()), + 'W', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) + }); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(toolHeadWrench, werkstoff.getBridgeMaterial(), 1L), + GT_Proxy.tBits, + new Object[] { + "hXW", + "XRX", + "WXd", + 'X', + plate.get(werkstoff.getBridgeMaterial()), + 'S', + plate.get(werkstoff.getBridgeMaterial().mHandleMaterial), + 'R', + ring.get(werkstoff.getBridgeMaterial().mHandleMaterial), + 'W', + screw.get(werkstoff.getBridgeMaterial().mHandleMaterial) + }); + GT_ModHandler.addShapelessCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.HARDHAMMER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + toolHeadHammer.get(werkstoff.getBridgeMaterial()), + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.FILE, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + GT_ModHandler.RecipeBits.MIRRORED + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "P", + "P", + "S", + 'P', + plate.get(werkstoff.getBridgeMaterial()), + 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) + }); + GT_ModHandler.addShapelessCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SAW, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + new Object[] { + toolHeadSaw.get(werkstoff.getBridgeMaterial()), + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Rubber, + new long[] {100000L, 32L, 1L, -1L}), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "LBf", + "Sd ", + "P ", + 'B', + bolt.get(werkstoff.getBridgeMaterial()), + 'P', + plate.get(Materials.AnyRubber), + 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), + 'L', + ItemList.Battery_RE_LV_Lithium.get(1L) + }); if (gtnhGT) { - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SOLDERING_IRON_MV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.AnyRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_MV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SOLDERING_IRON_HV, 1, werkstoff.getBridgeMaterial(), Materials.StyreneButadieneRubber, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.StyreneButadieneRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_HV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SOLDERING_IRON_MV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[] { + 400000L, 128L, 2L, -1L + }), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "LBf", + "Sd ", + "P ", + 'B', + bolt.get(werkstoff.getBridgeMaterial()), + 'P', + plate.get(Materials.AnyRubber), + 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), + 'L', + ItemList.Battery_RE_MV_Lithium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SOLDERING_IRON_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StyreneButadieneRubber, + new long[] {1600000L, 512L, 3L, -1L}), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "LBf", + "Sd ", + "P ", + 'B', + bolt.get(werkstoff.getBridgeMaterial()), + 'P', + plate.get(Materials.StyreneButadieneRubber), + 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), + 'L', + ItemList.Battery_RE_HV_Lithium.get(1L) + }); } if (!werkstoff.hasItemType(gem)) { - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', ingot.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.HARDHAMMER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "XX ", + "XXS", + "XX ", + 'X', + ingot.get(werkstoff.getBridgeMaterial()), + 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) + }); } } - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.PLUNGER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"xRR", " SR", "S f", 'S', stick.get(werkstoff.getBridgeMaterial()), 'R', plate.get(Materials.AnyRubber)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', ingot.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"hDS", "DSD", "SDf", 'S', stick.get(werkstoff.getBridgeMaterial()), 'D', Dyes.dyeBlue}); - - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WIRECUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "hPd", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCOOP, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SWS", "SSS", "xSh", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', new ItemStack(Blocks.wool, 1, 32767)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BRANCHCUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "PdP", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.KNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"fPh", " S ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PPf", "PP ", "Sh ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial())}); - - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); - - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); - - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"II ", "IIh", "II ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', ingot.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.PLUNGER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "xRR", + " SR", + "S f", + 'S', + stick.get(werkstoff.getBridgeMaterial()), + 'R', + plate.get(Materials.AnyRubber) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] {"IhI", "III", " I ", 'I', ingot.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.CROWBAR, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] {"hDS", "DSD", "SDf", 'S', stick.get(werkstoff.getBridgeMaterial()), 'D', Dyes.dyeBlue}); + + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WIRECUTTER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PfP", + "hPd", + "STS", + 'S', + stick.get(werkstoff.getBridgeMaterial()), + 'P', + plate.get(werkstoff.getBridgeMaterial()), + 'T', + screw.get(werkstoff.getBridgeMaterial()) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SCOOP, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SWS", + "SSS", + "xSh", + 'S', + stick.get(werkstoff.getBridgeMaterial()), + 'W', + new ItemStack(Blocks.wool, 1, 32767) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.BRANCHCUTTER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PfP", + "PdP", + "STS", + 'S', + stick.get(werkstoff.getBridgeMaterial()), + 'P', + plate.get(werkstoff.getBridgeMaterial()), + 'T', + screw.get(werkstoff.getBridgeMaterial()) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.KNIFE, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "fPh", + " S ", + 'S', + stick.get(werkstoff.getBridgeMaterial()), + 'P', + plate.get(werkstoff.getBridgeMaterial()) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PPf", + "PP ", + "Sh ", + 'S', + stick.get(werkstoff.getBridgeMaterial()), + 'P', + plate.get(werkstoff.getBridgeMaterial()) + }); + + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] {100000L, 32L, 1L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_LV.get(1L), + 'S', + screw.get(Materials.Steel), + 'P', + plate.get(Materials.Steel), + 'G', + gearGtSmall.get(Materials.Steel), + 'B', + ItemList.Battery_RE_LV_Lithium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] {75000L, 32L, 1L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_LV.get(1L), + 'S', + screw.get(Materials.Steel), + 'P', + plate.get(Materials.Steel), + 'G', + gearGtSmall.get(Materials.Steel), + 'B', + ItemList.Battery_RE_LV_Cadmium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] {50000L, 32L, 1L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_LV.get(1L), + 'S', + screw.get(Materials.Steel), + 'P', + plate.get(Materials.Steel), + 'G', + gearGtSmall.get(Materials.Steel), + 'B', + ItemList.Battery_RE_LV_Sodium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] {400000L, 128L, 2L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_MV.get(1L), + 'S', + screw.get(Materials.Aluminium), + 'P', + plate.get(Materials.Aluminium), + 'G', + gearGtSmall.get(Materials.Aluminium), + 'B', + ItemList.Battery_RE_MV_Lithium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] {300000L, 128L, 2L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_MV.get(1L), + 'S', + screw.get(Materials.Aluminium), + 'P', + plate.get(Materials.Aluminium), + 'G', + gearGtSmall.get(Materials.Aluminium), + 'B', + ItemList.Battery_RE_MV_Cadmium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] {200000L, 128L, 2L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_MV.get(1L), + 'S', + screw.get(Materials.Aluminium), + 'P', + plate.get(Materials.Aluminium), + 'G', + gearGtSmall.get(Materials.Aluminium), + 'B', + ItemList.Battery_RE_MV_Sodium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] {1600000L, 512L, 3L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_HV.get(1L), + 'S', + screw.get(Materials.StainlessSteel), + 'P', + plate.get(Materials.StainlessSteel), + 'G', + gearGtSmall.get(Materials.StainlessSteel), + 'B', + ItemList.Battery_RE_HV_Lithium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] {1200000L, 512L, 3L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_HV.get(1L), + 'S', + screw.get(Materials.StainlessSteel), + 'P', + plate.get(Materials.StainlessSteel), + 'G', + gearGtSmall.get(Materials.StainlessSteel), + 'B', + ItemList.Battery_RE_HV_Cadmium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] {800000L, 512L, 3L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_HV.get(1L), + 'S', + screw.get(Materials.StainlessSteel), + 'P', + plate.get(Materials.StainlessSteel), + 'G', + gearGtSmall.get(Materials.StainlessSteel), + 'B', + ItemList.Battery_RE_HV_Sodium.get(1L) + }); + + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] {100000L, 32L, 1L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_LV.get(1L), + 'S', + screw.get(Materials.Steel), + 'P', + plate.get(Materials.Steel), + 'G', + gearGtSmall.get(Materials.Steel), + 'B', + ItemList.Battery_RE_LV_Lithium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] {75000L, 32L, 1L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_LV.get(1L), + 'S', + screw.get(Materials.Steel), + 'P', + plate.get(Materials.Steel), + 'G', + gearGtSmall.get(Materials.Steel), + 'B', + ItemList.Battery_RE_LV_Cadmium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] {50000L, 32L, 1L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_LV.get(1L), + 'S', + screw.get(Materials.Steel), + 'P', + plate.get(Materials.Steel), + 'G', + gearGtSmall.get(Materials.Steel), + 'B', + ItemList.Battery_RE_LV_Sodium.get(1L) + }); + + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), + GT_Proxy.tBits, + new Object[] { + "II ", + "IIh", + "II ", + 'P', + plate.get(werkstoff.getBridgeMaterial()), + 'I', + ingot.get(werkstoff.getBridgeMaterial()) + }); if (werkstoff.hasItemType(plateDouble) && werkstoff.hasItemType(cellMolten)) { - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(turbineBlade, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"fPd", "SPS", " P ", 'P', plateDouble.get(werkstoff.getBridgeMaterial()), 'S', screw.get(werkstoff.getBridgeMaterial())}); - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 6), ItemList.Shape_Extruder_Turbine_Blade.get(0), werkstoff.get(turbineBlade, 1), (int) werkstoff.getStats().getMass() / 2 * 20, 120); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Turbine_Blade.get(0), werkstoff.getMolten(864), werkstoff.get(turbineBlade, 1), (int) werkstoff.getStats().getMass() * 20, 120); - GT_Values.RA.addFormingPressRecipe(werkstoff.get(plateDouble, 3), werkstoff.get(screw, 2), werkstoff.get(turbineBlade, 1), (int) werkstoff.getStats().getMass() / 4 * 20, 30); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(turbineBlade, 4), GT_OreDictUnificator.get(stickLong, Materials.Magnalium, 1), GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_SMALL, 1, werkstoff.getBridgeMaterial(), Materials.Magnalium, null), 160, 100); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(turbineBlade, 8), GT_OreDictUnificator.get(stickLong, Materials.Titanium, 1), GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, null), 320, 400); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(turbineBlade, 12), GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 1), GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_LARGE, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, null), 640, 1600); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(turbineBlade, 16), GT_OreDictUnificator.get(stickLong, Materials.Americium, 1), GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_HUGE, 1, werkstoff.getBridgeMaterial(), Materials.Americium, null), 1280, 6400); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(turbineBlade, werkstoff.getBridgeMaterial(), 1L), + GT_Proxy.tBits, + new Object[] { + "fPd", + "SPS", + " P ", + 'P', + plateDouble.get(werkstoff.getBridgeMaterial()), + 'S', + screw.get(werkstoff.getBridgeMaterial()) + }); + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot, 6), + ItemList.Shape_Extruder_Turbine_Blade.get(0), + werkstoff.get(turbineBlade, 1), + (int) werkstoff.getStats().getMass() / 2 * 20, + 120); + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Turbine_Blade.get(0), + werkstoff.getMolten(864), + werkstoff.get(turbineBlade, 1), + (int) werkstoff.getStats().getMass() * 20, + 120); + GT_Values.RA.addFormingPressRecipe( + werkstoff.get(plateDouble, 3), + werkstoff.get(screw, 2), + werkstoff.get(turbineBlade, 1), + (int) werkstoff.getStats().getMass() / 4 * 20, + 30); + GT_Values.RA.addAssemblerRecipe( + werkstoff.get(turbineBlade, 4), + GT_OreDictUnificator.get(stickLong, Materials.Magnalium, 1), + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE_SMALL, + 1, + werkstoff.getBridgeMaterial(), + Materials.Magnalium, + null), + 160, + 100); + GT_Values.RA.addAssemblerRecipe( + werkstoff.get(turbineBlade, 8), + GT_OreDictUnificator.get(stickLong, Materials.Titanium, 1), + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE, + 1, + werkstoff.getBridgeMaterial(), + Materials.Titanium, + null), + 320, + 400); + GT_Values.RA.addAssemblerRecipe( + werkstoff.get(turbineBlade, 12), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 1), + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE_LARGE, + 1, + werkstoff.getBridgeMaterial(), + Materials.TungstenSteel, + null), + 640, + 1600); + GT_Values.RA.addAssemblerRecipe( + werkstoff.get(turbineBlade, 16), + GT_OreDictUnificator.get(stickLong, Materials.Americium, 1), + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE_HUGE, + 1, + werkstoff.getBridgeMaterial(), + Materials.Americium, + null), + 1280, + 6400); } if (!werkstoff.hasItemType(gem)) { - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"PP ", "fh ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', ingot.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), + GT_Proxy.tBits, + new Object[] { + "PP ", + "fh ", + 'P', + plate.get(werkstoff.getBridgeMaterial()), + 'I', + ingot.get(werkstoff.getBridgeMaterial()) + }); } if (gtnhGT) { - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[] { + 400000L, 128L, 2L, -1L + }), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_MV.get(1L), + 'S', + screw.get(Materials.Aluminium), + 'P', + plate.get(Materials.Aluminium), + 'G', + gearGtSmall.get(Materials.Titanium), + 'B', + ItemList.Battery_RE_MV_Lithium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[] { + 300000L, 128L, 2L, -1L + }), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_MV.get(1L), + 'S', + screw.get(Materials.Aluminium), + 'P', + plate.get(Materials.Aluminium), + 'G', + gearGtSmall.get(Materials.Titanium), + 'B', + ItemList.Battery_RE_MV_Cadmium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[] { + 200000L, 128L, 2L, -1L + }), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_MV.get(1L), + 'S', + screw.get(Materials.Aluminium), + 'P', + plate.get(Materials.Aluminium), + 'G', + gearGtSmall.get(Materials.Titanium), + 'B', + ItemList.Battery_RE_MV_Sodium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[] { + 1600000L, 512L, 3L, -1L + }), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_HV.get(1L), + 'S', + screw.get(Materials.StainlessSteel), + 'P', + plate.get(Materials.StainlessSteel), + 'G', + gearGtSmall.get(Materials.StainlessSteel), + 'B', + ItemList.Battery_RE_HV_Lithium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[] { + 1200000L, 512L, 3L, -1L + }), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_HV.get(1L), + 'S', + screw.get(Materials.StainlessSteel), + 'P', + plate.get(Materials.StainlessSteel), + 'G', + gearGtSmall.get(Materials.StainlessSteel), + 'B', + ItemList.Battery_RE_HV_Cadmium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[] { + 800000L, 512L, 3L, -1L + }), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_HV.get(1L), + 'S', + screw.get(Materials.StainlessSteel), + 'P', + plate.get(Materials.StainlessSteel), + 'G', + gearGtSmall.get(Materials.StainlessSteel), + 'B', + ItemList.Battery_RE_HV_Sodium.get(1L) + }); } - // GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(16,1, werkstoff.getBridgeMaterial(),werkstoff.getBridgeMaterial(),null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', werkstoff.get(ingot)}); + // GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(16,1, + // werkstoff.getBridgeMaterial(),werkstoff.getBridgeMaterial(),null), + // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", + // "III", " I ", 'I', werkstoff.get(ingot)}); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/AssociationLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/AssociationLoader.java index 44c35c8543..3852602d72 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/AssociationLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/AssociationLoader.java @@ -34,8 +34,7 @@ public class AssociationLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { for (OrePrefixes prefixes : OrePrefixes.values()) { - if (!werkstoff.hasItemType(prefixes)) - continue; + if (!werkstoff.hasItemType(prefixes)) continue; Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial(); ItemStack stack = WerkstoffLoader.getCorrespondingItemStackUnsafe(prefixes, werkstoff, 1); @@ -46,4 +45,4 @@ public class AssociationLoader implements IWerkstoffRunnable { } } } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java index bd8c441740..292e796e70 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -33,19 +35,45 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.common.items.behaviors.Behaviour_DataOrb; -import net.minecraft.item.ItemStack; - import java.util.ArrayList; - -import static gregtech.api.enums.OrePrefixes.*; +import net.minecraft.item.ItemStack; public class BridgeMaterialsLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - //int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, String aConfigSection, boolean aCustomOre, String aCustomID - Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : - new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(), 0, werkstoff.getRGBA()[0], werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getVarName(), werkstoff.getDefaultName(), 0, 0, werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().isBlastFurnace(), false, 0, 1, 1, null); + // int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int + // aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, int aFuelPower, int + // aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int + // aDensityMultiplier, int aDensityDivider, Dyes aColor, String aConfigSection, boolean aCustomOre, String + // aCustomID + Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null + ? werkstoff.getBridgeMaterial() + : Materials.get(werkstoff.getVarName()) != Materials._NULL + ? Materials.get(werkstoff.getVarName()) + : new Materials( + -1, + werkstoff.getTexSet(), + werkstoff.getToolSpeed(), + werkstoff.getDurability(), + werkstoff.getToolQuality(), + 0, + werkstoff.getRGBA()[0], + werkstoff.getRGBA()[1], + werkstoff.getRGBA()[2], + werkstoff.getRGBA()[3], + werkstoff.getVarName(), + werkstoff.getDefaultName(), + 0, + 0, + werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().isBlastFurnace(), + false, + 0, + 1, + 1, + null); for (OrePrefixes prefixes : values()) { if (!(prefixes == cell && werkstoff.getType().equals(Werkstoff.Types.ELEMENT))) { if (prefixes == dust && werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { @@ -53,37 +81,80 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { boolean ElementSet = false; for (Element e : Element.values()) { if (e.toString().equals(werkstoff.getToolTip())) { - if (e.mLinkedMaterials.size() > 0) - break; - werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : - new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(), 0, werkstoff.getRGBA()[0], werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getVarName(), werkstoff.getDefaultName(), 0, 0, werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().isBlastFurnace(), false, 0, 1, 1, null); + if (e.mLinkedMaterials.size() > 0) break; + werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null + ? werkstoff.getBridgeMaterial() + : Materials.get(werkstoff.getVarName()) != Materials._NULL + ? Materials.get(werkstoff.getVarName()) + : new Materials( + -1, + werkstoff.getTexSet(), + werkstoff.getToolSpeed(), + werkstoff.getDurability(), + werkstoff.getToolQuality(), + 0, + werkstoff.getRGBA()[0], + werkstoff.getRGBA()[1], + werkstoff.getRGBA()[2], + werkstoff.getRGBA()[3], + werkstoff.getVarName(), + werkstoff.getDefaultName(), + 0, + 0, + werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().isBlastFurnace(), + false, + 0, + 1, + 1, + null); werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials = new ArrayList<>(); e.mLinkedMaterials.add(werkstoffBridgeMaterial); if (werkstoff.hasItemType(dust)) { - GT_OreDictUnificator.addAssociation(dust, werkstoffBridgeMaterial, werkstoff.get(dust), false); - GT_OreDictUnificator.set(dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true); + GT_OreDictUnificator.addAssociation( + dust, werkstoffBridgeMaterial, werkstoff.get(dust), false); + GT_OreDictUnificator.set( + dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true); } ElementSet = true; break; } } - if (!ElementSet) - continue; -// try { -// Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); -// f.setAccessible(true); -// Map MATERIALS_MAP = (Map) f.get(null); -// MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); -// } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { -// e.printStackTrace(); -// } + if (!ElementSet) continue; + // try { + // Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); + // f.setAccessible(true); + // Map MATERIALS_MAP = (Map) f.get(null); + // MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); + // } catch (NoSuchFieldException | IllegalAccessException | + // ClassCastException e) { + // e.printStackTrace(); + // } if (werkstoff.hasItemType(dust)) { ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(prefixes)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); - //GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, null, new ItemStack[]{werkstoff.get(prefixes)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( + false, + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] {werkstoff.get(prefixes)}, + new ItemStack[] {scannerOutput}, + ItemList.Tool_DataOrb.get(1L), + null, + null, + null, + (int) (werkstoffBridgeMaterial.getMass() * 8192L), + 30, + 0)); + // GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new + // BWRecipes.DynamicGTRecipe(false, null, new ItemStack[]{werkstoff.get(prefixes)}, + // scannerOutput, null, new + // FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) + // (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); } } } @@ -96,24 +167,36 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { } if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { - werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid(); + werkstoffBridgeMaterial.mStandardMoltenFluid = + werkstoff.getMolten(1).getFluid(); } werkstoffBridgeMaterial.mName = werkstoff.getVarName(); werkstoffBridgeMaterial.mDefaultLocalName = werkstoff.getDefaultName(); werkstoffBridgeMaterial.mChemicalFormula = werkstoff.getToolTip(); if ("null".equals(werkstoffBridgeMaterial.mLocalizedName)) // only reload from lang file if not localized already - werkstoffBridgeMaterial.mLocalizedName = GT_LanguageManager.addStringLocalization("Material." + werkstoffBridgeMaterial.mName.toLowerCase(), werkstoffBridgeMaterial.mDefaultLocalName); - if (LoaderReference.Thaumcraft) - werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects(); + werkstoffBridgeMaterial.mLocalizedName = GT_LanguageManager.addStringLocalization( + "Material." + werkstoffBridgeMaterial.mName.toLowerCase(), + werkstoffBridgeMaterial.mDefaultLocalName); + if (LoaderReference.Thaumcraft) werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects(); werkstoffBridgeMaterial.mMaterialInto = werkstoffBridgeMaterial; - werkstoffBridgeMaterial.mHandleMaterial = werkstoff.contains(SubTag.BURNING) ? Materials.Blaze : werkstoff.contains(SubTag.MAGICAL) ? Materials.Thaumium : werkstoffBridgeMaterial.mDurability > 5120 ? Materials.TungstenSteel : werkstoffBridgeMaterial.mDurability > 1280 ? Materials.Steel : Materials.Wood; + werkstoffBridgeMaterial.mHandleMaterial = werkstoff.contains(SubTag.BURNING) + ? Materials.Blaze + : werkstoff.contains(SubTag.MAGICAL) + ? Materials.Thaumium + : werkstoffBridgeMaterial.mDurability > 5120 + ? Materials.TungstenSteel + : werkstoffBridgeMaterial.mDurability > 1280 ? Materials.Steel : Materials.Wood; if (werkstoff.getStats().isRadioactive()) { - werkstoffBridgeMaterial.setEnchantmentForArmors(Enchantment_Radioactivity.INSTANCE, werkstoff.getStats().getEnchantmentlvl()); - werkstoffBridgeMaterial.setEnchantmentForTools(Enchantment_Radioactivity.INSTANCE, werkstoff.getStats().getEnchantmentlvl()); + werkstoffBridgeMaterial.setEnchantmentForArmors( + Enchantment_Radioactivity.INSTANCE, + werkstoff.getStats().getEnchantmentlvl()); + werkstoffBridgeMaterial.setEnchantmentForTools( + Enchantment_Radioactivity.INSTANCE, + werkstoff.getStats().getEnchantmentlvl()); } werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); - //if (WerkstoffLoader.items.get(prefixes) != null) + // if (WerkstoffLoader.items.get(prefixes) != null) } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java index 8ffd3ea552..8caecb277c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java @@ -22,27 +22,27 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasing; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasingAdvanced; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasing; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasingAdvanced; - public class CasingRegistrator implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { GT_OreDictUnificator.addAssociation( - blockCasing, werkstoff.getBridgeMaterial(), + blockCasing, + werkstoff.getBridgeMaterial(), new ItemStack(WerkstoffLoader.BWBlockCasings, 1, werkstoff.getmID()), - false - ); + false); GT_OreDictUnificator.addAssociation( - blockCasingAdvanced, werkstoff.getBridgeMaterial(), + blockCasingAdvanced, + werkstoff.getBridgeMaterial(), new ItemStack(WerkstoffLoader.BWBlockCasingsAdvanced, 1, werkstoff.getmID()), - false - ); + false); } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java index 8d4fe889cb..288213d821 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java @@ -23,15 +23,14 @@ package com.github.bartimaeusnek.bartworks.system.object; import com.github.bartimaeusnek.bartworks.util.Pair; +import java.io.*; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import java.io.*; - public class AbstractedStack implements Serializable { - final Pair idDamage; + final Pair idDamage; final NBTTagCompound mTag; @Override @@ -67,8 +66,7 @@ public class AbstractedStack implements Serializable { } public AbstractedStack(ItemStack itemStack) { - if (itemStack == null) - throw new UnsupportedOperationException(); + if (itemStack == null) throw new UnsupportedOperationException(); this.idDamage = new Pair<>(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage()); this.mTag = itemStack.getTagCompound(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java index afa6aaa98a..9229b08847 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java @@ -24,29 +24,26 @@ package com.github.bartimaeusnek.bartworks.system.oredict; import com.github.bartimaeusnek.bartworks.util.Pair; import gregtech.api.util.GT_OreDictUnificator; -import net.minecraft.item.ItemStack; - import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import net.minecraft.item.ItemStack; public class OreDictAdder { private static final ConcurrentHashMap toAddMap = new ConcurrentHashMap<>(); - public static synchronized void addToMap(Pair element){ - OreDictAdder.toAddMap.put(element.getKey(),element.getValue()); + public static synchronized void addToMap(Pair element) { + OreDictAdder.toAddMap.put(element.getKey(), element.getValue()); } @SafeVarargs - public static synchronized void addToMap(Pair... elements){ - for (Pair p : elements) - OreDictAdder.toAddMap.put(p.getKey(),p.getValue()); + public static synchronized void addToMap(Pair... elements) { + for (Pair p : elements) OreDictAdder.toAddMap.put(p.getKey(), p.getValue()); } - public static void addToOreDict(){ - for (Map.Entry entry: OreDictAdder.toAddMap.entrySet()){ - GT_OreDictUnificator.registerOre(entry.getKey(),entry.getValue()); + public static void addToOreDict() { + for (Map.Entry entry : OreDictAdder.toAddMap.entrySet()) { + GT_OreDictUnificator.registerOre(entry.getKey(), entry.getValue()); } } - -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java index 3e5984df6d..4e8efeeabd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java @@ -28,43 +28,45 @@ import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; - public class OreDictHandler { - private static final HashMap> cache = new HashMap<>(); - private static final HashSet> cacheNonBW = new HashSet<>(); + private static final HashMap> cache = new HashMap<>(); + private static final HashSet> cacheNonBW = new HashSet<>(); - public static HashMap> getCache() { + public static HashMap> getCache() { return OreDictHandler.cache; } - public static HashSet> getNonBWCache(){ + public static HashSet> getNonBWCache() { return OreDictHandler.cacheNonBW; } - public static void adaptCacheForWorld(){ + public static void adaptCacheForWorld() { Set used = new HashSet<>(OreDictHandler.cache.keySet()); OreDictHandler.cache.clear(); OreDictHandler.cacheNonBW.clear(); for (String s : used) { if (!OreDictionary.getOres(s).isEmpty()) { ItemStack tmpstack = OreDictionary.getOres(s).get(0).copy(); - Pair p = new Pair<>(Item.getIdFromItem(tmpstack.getItem()), (short) tmpstack.getItemDamage()); + Pair p = + new Pair<>(Item.getIdFromItem(tmpstack.getItem()), (short) tmpstack.getItemDamage()); OreDictHandler.cache.put(s, p); for (ItemStack tmp : OreDictionary.getOres(s)) { - Pair p2 = new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); + Pair p2 = + new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); - if (UI == null) - UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); - if (!UI.modId.equals(MainMod.MOD_ID) && !UI.modId.equals(BartWorksCrossmod.MOD_ID) && !UI.modId.equals("BWCore")) { + if (UI == null) UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); + if (!UI.modId.equals(MainMod.MOD_ID) + && !UI.modId.equals(BartWorksCrossmod.MOD_ID) + && !UI.modId.equals("BWCore")) { OreDictHandler.cacheNonBW.add(p2); } } @@ -72,14 +74,20 @@ public class OreDictHandler { } } - public static ItemStack getItemStack(String elementName, OrePrefixes prefixes, int amount){ - if (OreDictHandler.cache.get(prefixes+elementName.replaceAll(" ","")) != null){ - Pair p = OreDictHandler.cache.get(prefixes+elementName.replaceAll(" ","")); - return new ItemStack(Item.getItemById(p.getKey()),amount,p.getValue()); - } else if (!OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).isEmpty()){ - ItemStack tmp = GT_OreDictUnificator.get(OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).get(0).copy()).copy(); - OreDictHandler.cache.put(prefixes+elementName.replaceAll(" ",""),new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage())); - tmp.stackSize=amount; + public static ItemStack getItemStack(String elementName, OrePrefixes prefixes, int amount) { + if (OreDictHandler.cache.get(prefixes + elementName.replaceAll(" ", "")) != null) { + Pair p = OreDictHandler.cache.get(prefixes + elementName.replaceAll(" ", "")); + return new ItemStack(Item.getItemById(p.getKey()), amount, p.getValue()); + } else if (!OreDictionary.getOres(prefixes + elementName.replaceAll(" ", "")) + .isEmpty()) { + ItemStack tmp = GT_OreDictUnificator.get(OreDictionary.getOres(prefixes + elementName.replaceAll(" ", "")) + .get(0) + .copy()) + .copy(); + OreDictHandler.cache.put( + prefixes + elementName.replaceAll(" ", ""), + new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage())); + tmp.stackSize = amount; return tmp; } return null; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java index aa1023c9ba..b57e5c8914 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java @@ -32,6 +32,10 @@ import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.world.GT_Worldgen; import gregtech.common.blocks.GT_TileEntity_Ores; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -40,27 +44,35 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - /** * Original GT File Stripped and adjusted to work with this mod */ public abstract class BW_OreLayer extends GT_Worldgen { public static final List sList = new ArrayList<>(); - public static final ArrayListMultimap NEIMAP = ArrayListMultimap.create(); + public static final ArrayListMultimap NEIMAP = ArrayListMultimap.create(); private static final boolean logOregenRoss128 = false; public static int sWeight; public byte bwOres; public int mMinY, mWeight, mDensity, mSize, mMaxY, mPrimaryMeta, mSecondaryMeta, mBetweenMeta, mSporadicMeta; public abstract Block getDefaultBlockToReplace(); + public abstract int[] getDefaultDamageToReplace(); + public abstract String getDimName(); - public BW_OreLayer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { + public BW_OreLayer( + String aName, + boolean aDefault, + int aMinY, + int aMaxY, + int aWeight, + int aDensity, + int aSize, + ISubTagContainer top, + ISubTagContainer bottom, + ISubTagContainer between, + ISubTagContainer sprinkled) { super(aName, BW_OreLayer.sList, aDefault); this.mMinY = (short) aMinY; this.mMaxY = (short) aMaxY; @@ -68,59 +80,58 @@ public abstract class BW_OreLayer extends GT_Worldgen { this.mDensity = (short) aDensity; this.mSize = (short) Math.max(1, aSize); - if (this.mEnabled) - BW_OreLayer.sWeight += this.mWeight; - - if (top instanceof Werkstoff) - this.bwOres = (byte) (this.bwOres | 0b1000); - if (bottom instanceof Werkstoff) - this.bwOres = (byte) (this.bwOres | 0b0100); - if (between instanceof Werkstoff) - this.bwOres = (byte) (this.bwOres | 0b0010); - if (sprinkled instanceof Werkstoff) - this.bwOres = (byte) (this.bwOres | 0b0001); - - short aPrimary = top instanceof Materials ? - (short) ((Materials) top).mMetaItemSubID : - top instanceof Werkstoff ? - ((Werkstoff) top).getmID() : - 0; - short aSecondary = bottom instanceof Materials ? - (short) ((Materials) bottom).mMetaItemSubID : - bottom instanceof Werkstoff ? - ((Werkstoff) bottom).getmID() : - 0; - short aBetween = between instanceof Materials ? - (short) ((Materials) between).mMetaItemSubID : - between instanceof Werkstoff ? - ((Werkstoff) between).getmID() : - 0; - short aSporadic = sprinkled instanceof Materials ? - (short) ((Materials) sprinkled).mMetaItemSubID : - sprinkled instanceof Werkstoff ? - ((Werkstoff) sprinkled).getmID() : - 0; + if (this.mEnabled) BW_OreLayer.sWeight += this.mWeight; + + if (top instanceof Werkstoff) this.bwOres = (byte) (this.bwOres | 0b1000); + if (bottom instanceof Werkstoff) this.bwOres = (byte) (this.bwOres | 0b0100); + if (between instanceof Werkstoff) this.bwOres = (byte) (this.bwOres | 0b0010); + if (sprinkled instanceof Werkstoff) this.bwOres = (byte) (this.bwOres | 0b0001); + + short aPrimary = top instanceof Materials + ? (short) ((Materials) top).mMetaItemSubID + : top instanceof Werkstoff ? ((Werkstoff) top).getmID() : 0; + short aSecondary = bottom instanceof Materials + ? (short) ((Materials) bottom).mMetaItemSubID + : bottom instanceof Werkstoff ? ((Werkstoff) bottom).getmID() : 0; + short aBetween = between instanceof Materials + ? (short) ((Materials) between).mMetaItemSubID + : between instanceof Werkstoff ? ((Werkstoff) between).getmID() : 0; + short aSporadic = sprinkled instanceof Materials + ? (short) ((Materials) sprinkled).mMetaItemSubID + : sprinkled instanceof Werkstoff ? ((Werkstoff) sprinkled).getmID() : 0; this.mPrimaryMeta = aPrimary; this.mSecondaryMeta = aSecondary; this.mBetweenMeta = aBetween; this.mSporadicMeta = aSporadic; - NEIMAP.put((short) this.mPrimaryMeta,this); - NEIMAP.put((short) this.mSecondaryMeta,this); - NEIMAP.put((short) this.mBetweenMeta,this); - NEIMAP.put((short) this.mSporadicMeta,this); + NEIMAP.put((short) this.mPrimaryMeta, this); + NEIMAP.put((short) this.mSecondaryMeta, this); + NEIMAP.put((short) this.mBetweenMeta, this); + NEIMAP.put((short) this.mSporadicMeta, this); } - public List getStacks(){ + public List getStacks() { ArrayList ret = new ArrayList<>(); - ret.add((this.bwOres & 0b1000) != 0 ? new ItemStack(WerkstoffLoader.BWOres,1,this.mPrimaryMeta) : new ItemStack ( GregTech_API.sBlockOres1,1,this.mPrimaryMeta)); - ret.add((this.bwOres & 0b0100) != 0 ? new ItemStack(WerkstoffLoader.BWOres,1,this.mSecondaryMeta) : new ItemStack ( GregTech_API.sBlockOres1,1,this.mSecondaryMeta)); - ret.add((this.bwOres & 0b0010) != 0 ? new ItemStack(WerkstoffLoader.BWOres,1,this.mBetweenMeta) : new ItemStack ( GregTech_API.sBlockOres1,1,this.mBetweenMeta)); - ret.add((this.bwOres & 0b0001) != 0 ? new ItemStack(WerkstoffLoader.BWOres,1,this.mSporadicMeta) : new ItemStack ( GregTech_API.sBlockOres1,1,this.mSporadicMeta)); + ret.add( + (this.bwOres & 0b1000) != 0 + ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mPrimaryMeta) + : new ItemStack(GregTech_API.sBlockOres1, 1, this.mPrimaryMeta)); + ret.add( + (this.bwOres & 0b0100) != 0 + ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mSecondaryMeta) + : new ItemStack(GregTech_API.sBlockOres1, 1, this.mSecondaryMeta)); + ret.add( + (this.bwOres & 0b0010) != 0 + ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mBetweenMeta) + : new ItemStack(GregTech_API.sBlockOres1, 1, this.mBetweenMeta)); + ret.add( + (this.bwOres & 0b0001) != 0 + ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mSporadicMeta) + : new ItemStack(GregTech_API.sBlockOres1, 1, this.mSporadicMeta)); return ret; } - public List> getStacksRawData(){ - ArrayList> ret = new ArrayList<>(); + public List> getStacksRawData() { + ArrayList> ret = new ArrayList<>(); ret.add(new Pair<>(this.mPrimaryMeta, (this.bwOres & 0b1000) != 0)); ret.add(new Pair<>(this.mSecondaryMeta, (this.bwOres & 0b0100) != 0)); ret.add(new Pair<>(this.mBetweenMeta, (this.bwOres & 0b0010) != 0)); @@ -129,8 +140,16 @@ public abstract class BW_OreLayer extends GT_Worldgen { } @Override - public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { { - + public boolean executeWorldgen( + World aWorld, + Random aRandom, + String aBiome, + int aDimensionType, + int aChunkX, + int aChunkZ, + IChunkProvider aChunkGenerator, + IChunkProvider aChunkProvider) { + { int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); int cX = aChunkX - aRandom.nextInt(this.mSize); int eX = aChunkX + 16 + aRandom.nextInt(this.mSize); @@ -152,7 +171,8 @@ public abstract class BW_OreLayer extends GT_Worldgen { } if (this.mBetweenMeta > 0 && shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { - wasPlaced = this.setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); + wasPlaced = this.setOreBlock( + aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); } if (this.mPrimaryMeta > 0) { @@ -164,7 +184,8 @@ public abstract class BW_OreLayer extends GT_Worldgen { } if (this.mSporadicMeta > 0 && (shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ))) { - wasPlaced = this.setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); + wasPlaced = this.setOreBlock( + aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); } } } @@ -178,27 +199,49 @@ public abstract class BW_OreLayer extends GT_Worldgen { } private boolean shouldPlace(Random aRandom, int cX, int eX, int tX, int cZ, int eZ, int tZ) { - if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0) - return true; - if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) - return true; + if (aRandom.nextInt( + Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) + == 0) return true; + if (aRandom.nextInt( + Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) + == 0) return true; return false; } public boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre) { - //security stuff to prevent crashes with 2 TileEntites on the same Spot - TileEntity te = aWorld.getTileEntity(aX,aY,aZ); - if (te instanceof BW_MetaGeneratedOreTE || te instanceof GT_TileEntity_Ores) - return true; + // security stuff to prevent crashes with 2 TileEntites on the same Spot + TileEntity te = aWorld.getTileEntity(aX, aY, aZ); + if (te instanceof BW_MetaGeneratedOreTE || te instanceof GT_TileEntity_Ores) return true; - if ((aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0) || (aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0) || (aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0) || (aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0)) { - return isSmallOre ? BW_MetaGenerated_SmallOres.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, this.getDefaultBlockToReplace(),this.getDefaultDamageToReplace()) : BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, this.getDefaultBlockToReplace(),this.getDefaultDamageToReplace()); + if ((aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0) + || (aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0) + || (aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0) + || (aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0)) { + return isSmallOre + ? BW_MetaGenerated_SmallOres.setOreBlock( + aWorld, + aX, + aY, + aZ, + aMetaData, + false, + this.getDefaultBlockToReplace(), + this.getDefaultDamageToReplace()) + : BW_MetaGenerated_Ores.setOreBlock( + aWorld, + aX, + aY, + aZ, + aMetaData, + false, + this.getDefaultBlockToReplace(), + this.getDefaultDamageToReplace()); } return this.setGTOreBlockSpace(aWorld, aX, aY, aZ, aMetaData, this.getDefaultBlockToReplace()); } - public boolean setGTOreBlockSpace(World aWorld, int aX, int aY, int aZ, int aMetaData, Block block){ + public boolean setGTOreBlockSpace(World aWorld, int aX, int aY, int aZ, int aMetaData, Block block) { if (!GT_TileEntity_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, false)) { aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); Block tBlock = aWorld.getBlock(aX, aY, aZ); @@ -217,8 +260,7 @@ public abstract class BW_OreLayer extends GT_Worldgen { } return true; } - }else - return true; + } else return true; } @Override @@ -242,6 +284,21 @@ public abstract class BW_OreLayer extends GT_Worldgen { @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(37).put(bwOres).putInt(mMinY).putInt(mWeight).putInt(mDensity).putInt(mSize).putInt(mMaxY).putInt(mPrimaryMeta).putInt(mSecondaryMeta).putInt(mBetweenMeta).putInt(mSporadicMeta).array(),0,37,31); + return MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(37) + .put(bwOres) + .putInt(mMinY) + .putInt(mWeight) + .putInt(mDensity) + .putInt(mSize) + .putInt(mMaxY) + .putInt(mPrimaryMeta) + .putInt(mSecondaryMeta) + .putInt(mBetweenMeta) + .putInt(mSporadicMeta) + .array(), + 0, + 37, + 31); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java index 6677e6ab79..47f2a85ae7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java @@ -22,30 +22,36 @@ package com.github.bartimaeusnek.bartworks.system.oregen; - import cpw.mods.fml.common.IWorldGenerator; import gregtech.api.objects.XSTR; import gregtech.api.util.GT_Log; +import java.util.HashSet; +import java.util.Random; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; -import java.util.HashSet; -import java.util.Random; - /** * Original GT File Stripped and adjusted to work with this mod */ public class BW_WordGenerator implements IWorldGenerator { public BW_WordGenerator() { - //GT_NH Override... wont be actually registered to force its generation directly in the ChunkProvider - //GameRegistry.registerWorldGenerator(this, 1073741823); + // GT_NH Override... wont be actually registered to force its generation directly in the ChunkProvider + // GameRegistry.registerWorldGenerator(this, 1073741823); } - public synchronized void generate(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - new BW_WordGenerator.WorldGenContainer(aX * 16, aZ * 16, aWorld.provider.dimensionId, aWorld, aChunkGenerator, aChunkProvider).run(); + public synchronized void generate( + Random aRandom, + int aX, + int aZ, + World aWorld, + IChunkProvider aChunkGenerator, + IChunkProvider aChunkProvider) { + new BW_WordGenerator.WorldGenContainer( + aX * 16, aZ * 16, aWorld.provider.dimensionId, aWorld, aChunkGenerator, aChunkProvider) + .run(); } public static class WorldGenContainer implements Runnable { @@ -57,7 +63,13 @@ public class BW_WordGenerator implements IWorldGenerator { public int mX; public int mZ; - public WorldGenContainer(int aX, int aZ, int aDimensionType, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + public WorldGenContainer( + int aX, + int aZ, + int aDimensionType, + World aWorld, + IChunkProvider aChunkGenerator, + IChunkProvider aChunkProvider) { this.mX = aX; this.mZ = aZ; this.mDimensionType = aDimensionType; @@ -66,7 +78,7 @@ public class BW_WordGenerator implements IWorldGenerator { this.mChunkProvider = aChunkProvider; } - //returns a coordinate of a center chunk of 3x3 square; the argument belongs to this square + // returns a coordinate of a center chunk of 3x3 square; the argument belongs to this square public int getVeinCenterCoordinate(int c) { c += c < 0 ? 1 : 3; return c - c % 3 - 2; @@ -93,7 +105,8 @@ public class BW_WordGenerator implements IWorldGenerator { xCenter <<= 4; zCenter <<= 4; ChunkCoordIntPair centerChunk = new ChunkCoordIntPair(xCenter, zCenter); - if (!BW_WordGenerator.WorldGenContainer.mGenerated.contains(centerChunk) && this.surroundingChunksLoaded(xCenter, zCenter)) { + if (!BW_WordGenerator.WorldGenContainer.mGenerated.contains(centerChunk) + && this.surroundingChunksLoaded(xCenter, zCenter)) { BW_WordGenerator.WorldGenContainer.mGenerated.add(centerChunk); if ((BW_OreLayer.sWeight > 0) && (BW_OreLayer.sList.size() > 0)) { boolean temp = true; @@ -109,10 +122,17 @@ public class BW_WordGenerator implements IWorldGenerator { boolean placed; int attempts = 0; do { - placed = tWorldGen.executeWorldgen(this.mWorld, random, "", this.mDimensionType, xCenter, zCenter, this.mChunkGenerator, this.mChunkProvider); + placed = tWorldGen.executeWorldgen( + this.mWorld, + random, + "", + this.mDimensionType, + xCenter, + zCenter, + this.mChunkGenerator, + this.mChunkProvider); ++attempts; - } - while ((!placed) && attempts < 25); + } while ((!placed) && attempts < 25); temp = false; break; } catch (Throwable e) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index 9e1673dc83..d7135a8d5d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.bartworks.system.oregen; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; +import static gregtech.api.enums.Materials.*; + import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import gregtech.api.interfaces.ISubTagContainer; import net.minecraft.block.Block; @@ -30,19 +34,15 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidRegistry; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; -import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; -import static gregtech.api.enums.Materials.*; - public class BW_WorldGenRoss128b extends BW_OreLayer { - public Block getDefaultBlockToReplace(){ + public Block getDefaultBlockToReplace() { return Blocks.stone; } @Override public int[] getDefaultDamageToReplace() { - return new int[]{0}; + return new int[] {0}; } @Override @@ -50,27 +50,78 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { return StatCollector.translateToLocal("planet.Ross128b"); } - public BW_WorldGenRoss128b(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { + public BW_WorldGenRoss128b( + String aName, + boolean aDefault, + int aMinY, + int aMaxY, + int aWeight, + int aDensity, + int aSize, + ISubTagContainer top, + ISubTagContainer bottom, + ISubTagContainer between, + ISubTagContainer sprinkled) { super(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, top, bottom, between, sprinkled); } public static void initOres() { - new BW_WorldGenRoss128b("ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, Thorianit, Uraninite, Lepidolite, Spodumene); + new BW_WorldGenRoss128b( + "ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, Thorianit, Uraninite, Lepidolite, Spodumene); new BW_WorldGenRoss128b("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Graphite, Diamond, Coal, Graphite); - new BW_WorldGenRoss128b("ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, Bismuthinit, Stibnite, Bismuth, Bismutite); - new BW_WorldGenRoss128b("ore.mix.ross128.TurmalinAlkali", true, 5, 80, 15, 4, 48, Olenit, FluorBuergerit, ChromoAluminoPovondrait, VanadioOxyDravit); - new BW_WorldGenRoss128b("ore.mix.ross128.Roquesit", true, 30, 50, 3, 1, 12, Arsenopyrite, Ferberite, Loellingit, Roquesit); - new BW_WorldGenRoss128b("ore.mix.ross128.Tungstate", true, 5, 40, 10, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite); - new BW_WorldGenRoss128b("ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, Djurleit, Bornite, Wittichenit, Tetrahedrite); - new BW_WorldGenRoss128b("ore.mix.ross128.Forsterit", true, 20, 90, 50, 2, 32, Forsterit, Fayalit, DescloiziteCUVO4, DescloiziteZNVO4); - new BW_WorldGenRoss128b("ore.mix.ross128.Hedenbergit", true, 20, 90, 50, 2, 32, Hedenbergit, Fayalit, DescloiziteCUVO4, DescloiziteZNVO4); - new BW_WorldGenRoss128b("ore.mix.ross128.RedZircon", true, 10, 80, 40, 3, 24, Fayalit, FuchsitAL, RedZircon, FuchsitCR); + new BW_WorldGenRoss128b( + "ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, Bismuthinit, Stibnite, Bismuth, Bismutite); + new BW_WorldGenRoss128b( + "ore.mix.ross128.TurmalinAlkali", + true, + 5, + 80, + 15, + 4, + 48, + Olenit, + FluorBuergerit, + ChromoAluminoPovondrait, + VanadioOxyDravit); + new BW_WorldGenRoss128b( + "ore.mix.ross128.Roquesit", true, 30, 50, 3, 1, 12, Arsenopyrite, Ferberite, Loellingit, Roquesit); + new BW_WorldGenRoss128b( + "ore.mix.ross128.Tungstate", true, 5, 40, 10, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite); + new BW_WorldGenRoss128b( + "ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, Djurleit, Bornite, Wittichenit, Tetrahedrite); + new BW_WorldGenRoss128b( + "ore.mix.ross128.Forsterit", + true, + 20, + 90, + 50, + 2, + 32, + Forsterit, + Fayalit, + DescloiziteCUVO4, + DescloiziteZNVO4); + new BW_WorldGenRoss128b( + "ore.mix.ross128.Hedenbergit", + true, + 20, + 90, + 50, + 2, + 32, + Hedenbergit, + Fayalit, + DescloiziteCUVO4, + DescloiziteZNVO4); + new BW_WorldGenRoss128b( + "ore.mix.ross128.RedZircon", true, 10, 80, 40, 3, 24, Fayalit, FuchsitAL, RedZircon, FuchsitCR); } public static void initundergroundFluids() { String ross128b = StatCollector.translateToLocal("planet.Ross128b"); uo_dimensionList.SetConfigValues(ross128b, ross128b, "veryheavyoil", "liquid_extra_heavy_oil", 0, 625, 40, 5); - uo_dimensionList.SetConfigValues(ross128b, ross128b, "lava", FluidRegistry.getFluidName(FluidRegistry.LAVA), 0, 820, 5, 5); + uo_dimensionList.SetConfigValues( + ross128b, ross128b, "lava", FluidRegistry.getFluidName(FluidRegistry.LAVA), 0, 820, 5, 5); uo_dimensionList.SetConfigValues(ross128b, ross128b, "gas_natural_gas", "gas_natural_gas", 0, 625, 65, 5); } @@ -78,5 +129,4 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { return aDimensionType == ConfigHandler.ross128BID; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java index f0682e53b4..074e1fc6b5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java @@ -22,19 +22,30 @@ package com.github.bartimaeusnek.bartworks.system.oregen; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; +import static gregtech.api.enums.Materials.*; + import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import gregtech.api.interfaces.ISubTagContainer; import net.minecraft.block.Block; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; -import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; -import static gregtech.api.enums.Materials.*; - -public class BW_WorldGenRoss128ba extends BW_OreLayer { +public class BW_WorldGenRoss128ba extends BW_OreLayer { - public BW_WorldGenRoss128ba(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { + public BW_WorldGenRoss128ba( + String aName, + boolean aDefault, + int aMinY, + int aMaxY, + int aWeight, + int aDensity, + int aSize, + ISubTagContainer top, + ISubTagContainer bottom, + ISubTagContainer between, + ISubTagContainer sprinkled) { super(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, top, bottom, between, sprinkled); } @@ -42,12 +53,12 @@ public class BW_WorldGenRoss128ba extends BW_OreLayer { public Block getDefaultBlockToReplace() { return Block.getBlockFromName("GalacticraftCore:tile.moonBlock"); } + @Override - public int[] getDefaultDamageToReplace(){ + public int[] getDefaultDamageToReplace() { int[] ret = new int[12]; for (int i = 0; i < 12; i++) { - if (i != 5 && i != 3) - ret[i] = i; + if (i != 5 && i != 3) ret[i] = i; } return ret; } @@ -58,25 +69,88 @@ public class BW_WorldGenRoss128ba extends BW_OreLayer { } public static void init_Ores() { - new BW_WorldGenRoss128ba("ore.mix.ross128ba.tib", true, 30, 60, 6, 1, 16, Tiberium, Tiberium, NaquadahEnriched, NaquadahEnriched); - new BW_WorldGenRoss128ba("ore.mix.ross128ba.Tungstate", true, 5, 40, 60, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite); - new BW_WorldGenRoss128ba("ore.mix.ross128ba.bart", true, 30, 60, 1, 1, 1, BArTiMaEuSNeK, BArTiMaEuSNeK, BArTiMaEuSNeK, BArTiMaEuSNeK); - new BW_WorldGenRoss128ba("ore.mix.ross128ba.TurmalinAlkali", true, 5, 80, 60, 4, 48, Olenit, FluorBuergerit, ChromoAluminoPovondrait, VanadioOxyDravit); - new BW_WorldGenRoss128ba("ore.mix.ross128ba.Amethyst", true, 5, 80, 35, 2, 8, Amethyst, Olivine, Prasiolite, Hedenbergit); - new BW_WorldGenRoss128ba("ore.mix.ross128ba.CopperSulfits", true, 40, 70, 80, 3, 24, Djurleit, Bornite, Wittichenit, Tetrahedrite); - new BW_WorldGenRoss128ba("ore.mix.ross128ba.RedZircon", true, 10, 80, 40, 3, 24, Fayalit, FuchsitAL, RedZircon, FuchsitCR); - new BW_WorldGenRoss128ba("ore.mix.ross128ba.Fluorspar", true, 10, 80, 35, 4, 8, Galena, Sphalerite, Fluorspar, Barite); + new BW_WorldGenRoss128ba( + "ore.mix.ross128ba.tib", + true, + 30, + 60, + 6, + 1, + 16, + Tiberium, + Tiberium, + NaquadahEnriched, + NaquadahEnriched); + new BW_WorldGenRoss128ba( + "ore.mix.ross128ba.Tungstate", true, 5, 40, 60, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite); + new BW_WorldGenRoss128ba( + "ore.mix.ross128ba.bart", + true, + 30, + 60, + 1, + 1, + 1, + BArTiMaEuSNeK, + BArTiMaEuSNeK, + BArTiMaEuSNeK, + BArTiMaEuSNeK); + new BW_WorldGenRoss128ba( + "ore.mix.ross128ba.TurmalinAlkali", + true, + 5, + 80, + 60, + 4, + 48, + Olenit, + FluorBuergerit, + ChromoAluminoPovondrait, + VanadioOxyDravit); + new BW_WorldGenRoss128ba( + "ore.mix.ross128ba.Amethyst", true, 5, 80, 35, 2, 8, Amethyst, Olivine, Prasiolite, Hedenbergit); + new BW_WorldGenRoss128ba( + "ore.mix.ross128ba.CopperSulfits", + true, + 40, + 70, + 80, + 3, + 24, + Djurleit, + Bornite, + Wittichenit, + Tetrahedrite); + new BW_WorldGenRoss128ba( + "ore.mix.ross128ba.RedZircon", true, 10, 80, 40, 3, 24, Fayalit, FuchsitAL, RedZircon, FuchsitCR); + new BW_WorldGenRoss128ba( + "ore.mix.ross128ba.Fluorspar", true, 10, 80, 35, 4, 8, Galena, Sphalerite, Fluorspar, Barite); } public static void init_undergroundFluids() { String ross128b = StatCollector.translateToLocal("moon.Ross128ba"); - uo_dimensionList.SetConfigValues(ross128b, ross128b, SaltWater.getFluid(1).getFluid().getName(), SaltWater.getFluid(1).getFluid().getName(), 0, 1250, 40, 5); - uo_dimensionList.SetConfigValues(ross128b, ross128b, Helium_3.getGas(1).getFluid().getName(), Helium_3.getGas(1).getFluid().getName(), 0, 1250, 60, 5); + uo_dimensionList.SetConfigValues( + ross128b, + ross128b, + SaltWater.getFluid(1).getFluid().getName(), + SaltWater.getFluid(1).getFluid().getName(), + 0, + 1250, + 40, + 5); + uo_dimensionList.SetConfigValues( + ross128b, + ross128b, + Helium_3.getGas(1).getFluid().getName(), + Helium_3.getGas(1).getFluid().getName(), + 0, + 1250, + 60, + 5); } @Override public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { return aDimensionType == ConfigHandler.ross128BAID; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java index 33c36d270a..3d55084ade 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java @@ -24,9 +24,8 @@ package com.github.bartimaeusnek.bartworks.system.worldgen; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import gregtech.api.GregTech_API; -import net.minecraft.block.Block; - import java.util.Random; +import net.minecraft.block.Block; public class GT_WorldgenUtil { @@ -34,23 +33,23 @@ public class GT_WorldgenUtil { public static final Block GT_TILES = GregTech_API.sBlockMachines; - public static short getGenerator(Random rand,int tier){ + public static short getGenerator(Random rand, int tier) { int meta = ConfigHandler.metasForTiers[0][tier][rand.nextInt(ConfigHandler.metasForTiers[0][tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getGenerator(rand,tier); + return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getGenerator(rand, tier); } - public static short getBuffer(Random rand,int tier){ + public static short getBuffer(Random rand, int tier) { int meta = ConfigHandler.metasForTiers[1][tier][rand.nextInt(ConfigHandler.metasForTiers[1][tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getBuffer(rand,tier); + return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getBuffer(rand, tier); } - public static short getCable(Random rand,int tier){ + public static short getCable(Random rand, int tier) { int meta = ConfigHandler.metasForTiers[2][tier][rand.nextInt(ConfigHandler.metasForTiers[2][tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getCable(rand,tier); + return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getCable(rand, tier); } - public static short getMachine(Random rand,int tier){ + public static short getMachine(Random rand, int tier) { int meta = ConfigHandler.metasForTiers[3][tier][rand.nextInt(ConfigHandler.metasForTiers[3][tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getMachine(rand,tier); + return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getMachine(rand, tier); } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java index 29eb79ebdc..7c0fd41935 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.worldgen; +import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.maxTierRoss; +import static net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST; + import com.github.bartimaeusnek.bartworks.util.Pair; import gregtech.api.GregTech_API; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -31,6 +34,8 @@ import gregtech.api.metatileentity.MetaPipeEntity; import gregtech.api.objects.XSTR; import gregtech.api.threads.GT_Runnable_MachineBlockUpdate; import gregtech.api.util.GT_Utility; +import java.security.SecureRandom; +import java.util.Random; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; @@ -40,11 +45,6 @@ import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.ChestGenHooks; -import java.security.SecureRandom; -import java.util.Random; - -import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.maxTierRoss; -import static net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST; @SuppressWarnings({"ALL"}) public abstract class MapGenRuins extends WorldGenerator { @@ -85,11 +85,10 @@ public abstract class MapGenRuins extends WorldGenerator { int[] statBlocks = new int[4]; - protected void setRandomBlockWAirChance(World worldObj, int x, int y, int z, Random rand, int airchance, Pair... blocks) { - if (rand.nextInt(100) > airchance) - this.setRandomBlock(worldObj, x, y, z, rand, blocks); - else - this.setBlock(worldObj, x, y, z, Blocks.air, 0); + protected void setRandomBlockWAirChance( + World worldObj, int x, int y, int z, Random rand, int airchance, Pair... blocks) { + if (rand.nextInt(100) > airchance) this.setRandomBlock(worldObj, x, y, z, rand, blocks); + else this.setBlock(worldObj, x, y, z, Blocks.air, 0); } protected void setRandomBlock(World worldObj, int x, int y, int z, Random rand, Pair... blocks) { @@ -115,7 +114,13 @@ public abstract class MapGenRuins extends WorldGenerator { } if (isEnabled) throw new IllegalStateException("Machine Block Runnable needs to be disabled while creating world!"); - this.setBlockAndNotifyAdequately(worldObj, x, y, z, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); + this.setBlockAndNotifyAdequately( + worldObj, + x, + y, + z, + GT_WorldgenUtil.GT_TILES, + GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); TileEntity tile = worldObj.getTileEntity(x, y, z); ((IGregTechTileEntity) tile).setInitialValuesAsNBT(null, (short) meta); return tile; @@ -130,15 +135,13 @@ public abstract class MapGenRuins extends WorldGenerator { protected void setGTMachineBlockWChance(World worldObj, int x, int y, int z, Random rand, int airchance, int meta) { if (rand.nextInt(100) > airchance) { this.setGTMachineBlock(worldObj, x, y, z, meta); - } else - this.setBlock(worldObj, x, y, z, Blocks.air, 0); + } else this.setBlock(worldObj, x, y, z, Blocks.air, 0); } protected void setGTCablekWChance(World worldObj, int x, int y, int z, Random rand, int airchance, int meta) { if (rand.nextInt(100) > airchance) { this.setGTCable(worldObj, x, y, z, meta); - } else - this.setBlock(worldObj, x, y, z, Blocks.air, 0); + } else this.setBlock(worldObj, x, y, z, Blocks.air, 0); } protected void setGTMachine(World worldObj, int x, int y, int z, int meta, String ownerName, byte facing) { @@ -158,7 +161,16 @@ public abstract class MapGenRuins extends WorldGenerator { } } - private void checkTile(BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, byte facing, int depth) { + private void checkTile( + BaseMetaTileEntity BTE, + World worldObj, + int x, + int y, + int z, + int meta, + String ownerName, + byte facing, + int depth) { if (depth < 25) { if (BTE.getMetaTileID() != meta || worldObj.getTileEntity(x, y, z) != BTE || BTE.isInvalid()) { redoTile(BTE, worldObj, x, y, z, meta, ownerName, facing); @@ -170,7 +182,8 @@ public abstract class MapGenRuins extends WorldGenerator { } } - private void redoTile(BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, byte facing) { + private void redoTile( + BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, byte facing) { reSetGTTileEntity(BTE, worldObj, x, y, z, meta); BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z); BTE.setOwnerName(ownerName); @@ -217,11 +230,11 @@ public abstract class MapGenRuins extends WorldGenerator { } } - this.setFloorBlocks(new int[]{0, 0, 0}, Blocks.brick_block, Blocks.double_stone_slab, Blocks.stonebrick); - this.setWallBlocks(new int[]{0, 1, 2, 1, 1}, Blocks.stonebrick); - this.setRoofBlocks(new int[]{9}, Blocks.log); - this.setMiscBlocks(new int[]{1}, Blocks.log); - this.statBlocks = new int[]{rand.nextInt(this.ToBuildWith[0].length)}; + this.setFloorBlocks(new int[] {0, 0, 0}, Blocks.brick_block, Blocks.double_stone_slab, Blocks.stonebrick); + this.setWallBlocks(new int[] {0, 1, 2, 1, 1}, Blocks.stonebrick); + this.setRoofBlocks(new int[] {9}, Blocks.log); + this.setMiscBlocks(new int[] {1}, Blocks.log); + this.statBlocks = new int[] {rand.nextInt(this.ToBuildWith[0].length)}; int colored = rand.nextInt(15); int tier = secureRandom.nextInt(maxTierRoss); boolean useColor = rand.nextBoolean(); @@ -239,25 +252,40 @@ public abstract class MapGenRuins extends WorldGenerator { this.setBlock(worldObj, x + dx, y + 0, z + dz, floor.getKey(), floor.getValue()); } else if (dy > 0 && dy < 4) { if (Math.abs(dx) == 5 && Math.abs(dz) == 5) { - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 5, this.ToBuildWith[3][0]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + dy, z + dz, rand, 5, this.ToBuildWith[3][0]); } else if ((dx == 0) && dz == -5 && (dy == 1 || dy == 2)) { - if (dy == 1) - this.setBlock(worldObj, x + dx, y + 1, z + -5, Blocks.iron_door, 1); - if (dy == 2) - this.setBlock(worldObj, x + dx, y + 2, z + dz, Blocks.iron_door, 8); + if (dy == 1) this.setBlock(worldObj, x + dx, y + 1, z + -5, Blocks.iron_door, 1); + if (dy == 2) this.setBlock(worldObj, x + dx, y + 2, z + dz, Blocks.iron_door, 8); } else if (Math.abs(dx) == 5 && Math.abs(dz) < 5 || Math.abs(dz) == 5 && Math.abs(dx) < 5) { - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); if (dy == 2) { if (rand.nextInt(100) < 12) if (useColor) - this.setRandomBlockWAirChance(worldObj, x + dx, y + 2, z + dz, rand, 25, new Pair<>(Blocks.stained_glass_pane, colored)); + this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + 2, + z + dz, + rand, + 25, + new Pair<>(Blocks.stained_glass_pane, colored)); else - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, new Pair<>(Blocks.glass_pane, 0)); + this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 25, + new Pair<>(Blocks.glass_pane, 0)); } } if (dy == 3 && Math.abs(dx) == 6) { - this.setRandomBlockWAirChance(worldObj, x + dx, y + 3, z + dz, rand, 25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + 3, z + dz, rand, 25, this.ToBuildWith[2]); } if (dy == 1) { @@ -268,13 +296,24 @@ public abstract class MapGenRuins extends WorldGenerator { this.setBlock(worldObj, x + -3, y + dy, z + dz, Blocks.chest, 5); IInventory chest = (IInventory) worldObj.getTileEntity(x + dx, y + dy, z + dz); if (chest != null) { - WeightedRandomChestContent.generateChestContents(secureRandom, ChestGenHooks.getItems(PYRAMID_JUNGLE_CHEST, rand), chest, ChestGenHooks.getCount(PYRAMID_JUNGLE_CHEST, rand)); + WeightedRandomChestContent.generateChestContents( + secureRandom, + ChestGenHooks.getItems(PYRAMID_JUNGLE_CHEST, rand), + chest, + ChestGenHooks.getCount(PYRAMID_JUNGLE_CHEST, rand)); } } if (dx == 4 && dz == 4) { short meta = GT_WorldgenUtil.getGenerator(secureRandom, tier); - this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, tier > 0 ? (byte) 4 : (byte) 2); + this.setGTMachine( + worldObj, + x + dx, + y + dy, + z + dz, + meta, + owner, + tier > 0 ? (byte) 4 : (byte) 2); } else if (dx == 3 && dz == 4) { if (tier > 0) { short meta = GT_WorldgenUtil.getBuffer(secureRandom, tier); @@ -294,34 +333,42 @@ public abstract class MapGenRuins extends WorldGenerator { lastset = true; } else { lastset = rand.nextBoolean(); - if (lastset) - treeinaRow++; + if (lastset) treeinaRow++; } } } } else if (dy == 4) { if (Math.abs(dx) == 5) - this.setRandomBlockWAirChance(worldObj, x + dx, y + 4, z + dz, rand, 25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + 4, z + dz, rand, 25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 5) - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); } else if (dy == 5) { if (Math.abs(dx) == 4) - this.setRandomBlockWAirChance(worldObj, x + dx, y + 5, z + dz, rand, 25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + 5, z + dz, rand, 25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 4) - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); } else if (dy == 6) { if (Math.abs(dx) == 3) - this.setRandomBlockWAirChance(worldObj, x + dx, y + 6, z + dz, rand, 25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + 6, z + dz, rand, 25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 3) - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); } else if (dy == 7) { if (Math.abs(dx) == 2) - this.setRandomBlockWAirChance(worldObj, x + dx, y + 7, z + dz, rand, 25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + 7, z + dz, rand, 25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 2) - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); } else if (dy == 8) { if (Math.abs(dx) == 1 || Math.abs(dx) == 0) - this.setRandomBlockWAirChance(worldObj, x + dx, y + 8, z + dz, rand, 25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + 8, z + dz, rand, 25, this.ToBuildWith[2]); } } } @@ -341,15 +388,12 @@ public abstract class MapGenRuins extends WorldGenerator { lastset = true; } else { lastset = rand.nextBoolean(); - if (lastset) - treeinaRow++; + if (lastset) treeinaRow++; } - } else - break tosetloop; + } else break tosetloop; } } return true; } } - -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 4e3b6ffc4a..7f9150f0dc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.util; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.specialToByte; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; import gregtech.api.GregTech_API; @@ -34,6 +37,8 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import ic2.core.Ic2Items; import ic2.core.item.ItemFluidCell; +import java.util.*; +import javax.annotation.Nonnegative; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; @@ -41,12 +46,6 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; -import javax.annotation.Nonnegative; -import java.util.*; - -import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; -import static com.github.bartimaeusnek.bartworks.util.BW_Util.specialToByte; - public class BWRecipes { public static final BWRecipes instance = new BWRecipes(); @@ -61,36 +60,67 @@ public class BWRecipes { StatCollector.translateToLocal("tile.biolab.name"), null, "gregtech:textures/gui/basicmachines/BW.GUI.BioLab", - 6, 2, 1, 1, 1, - "", 1, "", true, false //special handler - ); + 6, + 2, + 1, + 1, + 1, + "", + 1, + "", + true, + false // special handler + ); private final BacteriaVatRecipeMap sBacteriaVat = new BacteriaVatRecipeMap( new HashSet<>(50), "bw.recipe.BacteriaVat", StatCollector.translateToLocal("tile.biovat.name"), null, "gregtech:textures/gui/basicmachines/Default", - 6, 2, 0, 1, 1, - " Sievert: ", 1, " Sv", true, false //special handler - ); + 6, + 2, + 0, + 1, + 1, + " Sievert: ", + 1, + " Sv", + true, + false // special handler + ); private final BW_Recipe_Map_LiquidFuel sAcidGenFuels = new BW_Recipe_Map_LiquidFuel( new HashSet<>(10), "bw.fuels.acidgens", StatCollector.translateToLocal("tile.acidgenerator.name"), null, "gregtech:textures/gui/basicmachines/Default", - 1, 1, 1, 1, 1, - "EU generated: ", 1000, "", false, true - ); + 1, + 1, + 1, + 1, + 1, + "EU generated: ", + 1000, + "", + false, + true); private final BWRecipes.SpecialObjectSensitiveMap sCircuitAssemblyLineMap = new SpecialObjectSensitiveMap( new HashSet<>(60), "bw.recipe.cal", "Circuit Assembly Line", null, "gregtech:textures/gui/basicmachines/Default", - 6, 6, 1, 1, 1, - "", 1, "", true, true //special handler - ); + 6, + 6, + 1, + 1, + 1, + "", + 1, + "", + true, + true // special handler + ); /** * @param machine 0 = biolab; 1 = BacterialVat; 2 = sAcidGenFuels; 3 = circuitAssemblyLine @@ -108,71 +138,270 @@ public class BWRecipes { default: return null; } - } - public boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; + public boolean addBioLabRecipe( + ItemStack[] aInputs, + ItemStack aOutput, + ItemStack aSpecialItems, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return sBiolab.addRecipe(new DynamicGTRecipe( + true, + aInputs, + new ItemStack[] {aOutput}, + aSpecialItems, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)) + != null; } - public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, aFluidInputs, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null; + public boolean addBioLabRecipeIncubation( + ItemStack aInput, + BioCulture aOutput, + int[] aChances, + FluidStack[] aFluidInputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return sBiolab.addRecipe(new DynamicGTRecipe( + true, + new ItemStack[] {BioItemList.getPetriDish(null), aInput}, + new ItemStack[] {BioItemList.getPetriDish(aOutput)}, + null, + aChances, + aFluidInputs, + new FluidStack[] {GT_Values.NF}, + aDuration, + aEUt, + aSpecialValue)) + != null; } - public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, new FluidStack[]{aFluidInputs}, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null; + public boolean addBioLabRecipeIncubation( + ItemStack aInput, + BioCulture aOutput, + int[] aChances, + FluidStack aFluidInputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return sBiolab.addRecipe(new DynamicGTRecipe( + true, + new ItemStack[] {BioItemList.getPetriDish(null), aInput}, + new ItemStack[] {BioItemList.getPetriDish(aOutput)}, + null, + aChances, + new FluidStack[] {aFluidInputs}, + new FluidStack[] {GT_Values.NF}, + aDuration, + aEUt, + aSpecialValue)) + != null; } @Deprecated - public boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[0], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; + public boolean addBioLabRecipeDNAExtraction( + ItemStack[] aInputs, + ItemStack aOutput, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return sBiolab.addRecipe(new DynamicGTRecipe( + true, + aInputs, + new ItemStack[] {aOutput}, + BioItemList.mBioLabParts[0], + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)) + != null; } @Deprecated - public boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[1], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; + public boolean addBioLabRecipePCRThermoclycling( + ItemStack[] aInputs, + ItemStack aOutput, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return sBiolab.addRecipe(new DynamicGTRecipe( + true, + aInputs, + new ItemStack[] {aOutput}, + BioItemList.mBioLabParts[1], + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)) + != null; } @Deprecated - public boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[2], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; + public boolean addBioLabRecipePlasmidSynthesis( + ItemStack[] aInputs, + ItemStack aOutput, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return sBiolab.addRecipe(new DynamicGTRecipe( + true, + aInputs, + new ItemStack[] {aOutput}, + BioItemList.mBioLabParts[2], + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)) + != null; } @Deprecated - public boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[3], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; + public boolean addBioLabRecipeTransformation( + ItemStack[] aInputs, + ItemStack aOutput, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return sBiolab.addRecipe(new DynamicGTRecipe( + true, + aInputs, + new ItemStack[] {aOutput}, + BioItemList.mBioLabParts[3], + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)) + != null; } @Deprecated - public boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[4], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; + public boolean addBioLabRecipeClonalCellularSynthesis( + ItemStack[] aInputs, + ItemStack aOutput, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return sBiolab.addRecipe(new DynamicGTRecipe( + true, + aInputs, + new ItemStack[] {aOutput}, + BioItemList.mBioLabParts[4], + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)) + != null; } @Deprecated - public boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative byte glasTier) { + public boolean addBacterialVatRecipe( + ItemStack[] aInputs, + ItemStack[] aOutputs, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + Materials material, + @Nonnegative byte glasTier) { int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) aSievert += calculateSv(material); aSievert = aSievert << 6; aSievert = aSievert | glasTier; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + false, + aInputs, + aOutputs, + null, + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSievert)) + != null; } - public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, @Nonnegative int aSv, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { + public boolean addBacterialVatRecipe( + ItemStack[] aInputs, + BioCulture aCulture, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + @Nonnegative int aDuration, + @Nonnegative int aEUt, + @Nonnegative int aSv, + @Nonnegative int glasTier, + int aSpecialValue, + boolean exactSv) { byte gTier = (byte) glasTier; int aSievert = 0; - if (aSv >= 83 || aSv == 61 || aSv == 43) - aSievert += aSv; + if (aSv >= 83 || aSv == 61 || aSv == 43) aSievert += aSv; aSievert = aSievert << 1; aSievert = aSievert | (exactSv ? 1 : 0); aSievert = aSievert << 2; aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + false, + aInputs, + null, + BioItemList.getPetriDish(aCulture), + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSievert)) + != null; } - public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { + public boolean addBacterialVatRecipe( + ItemStack[] aInputs, + BioCulture aCulture, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + Materials material, + @Nonnegative int glasTier, + int aSpecialValue, + boolean exactSv) { byte gTier = (byte) glasTier; int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) @@ -183,21 +412,60 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + false, + aInputs, + null, + BioItemList.getPetriDish(aCulture), + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSievert)) + != null; } @Deprecated - public boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, boolean exactSv) { + public boolean addBacterialVatRecipe( + ItemStack[] aInputs, + ItemStack[] aOutputs, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + Materials material, + boolean exactSv) { int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) aSievert += calculateSv(material); aSievert = aSievert << 1; aSievert = aSievert | (exactSv ? 1 : 0); aSievert = aSievert << 6; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + false, + aInputs, + aOutputs, + null, + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSievert)) + != null; } - public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture culture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, int aSpecialValue, boolean exactSv) { + public boolean addBacterialVatRecipe( + ItemStack[] aInputs, + BioCulture culture, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + Materials material, + int aSpecialValue, + boolean exactSv) { int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) aSievert += calculateSv(material); @@ -206,27 +474,82 @@ public class BWRecipes { aSievert = aSievert << 2; aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + false, + aInputs, + null, + BioItemList.getPetriDish(culture), + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSievert)) + != null; } /** * Adds a Vat recipe without Rad requirements but with Glas requirements */ - public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture culture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, byte glasTier) { + public boolean addBacterialVatRecipe( + ItemStack[] aInputs, + BioCulture culture, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + byte glasTier) { int aSievert = 0; aSievert = aSievert | glasTier; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + false, + aInputs, + null, + BioItemList.getPetriDish(culture), + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSievert)) + != null; } /** * Adds a Vat recipe without Rad or Glas requirements */ - public boolean addBacterialVatRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, BioCulture culture, FluidStack[] aFluidOutputs, int aDuration, int aEUt) { - return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, 0)) != null; + public boolean addBacterialVatRecipe( + ItemStack[] aInputs, + FluidStack[] aFluidInputs, + BioCulture culture, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt) { + return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + false, + aInputs, + null, + BioItemList.getPetriDish(culture), + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + 0)) + != null; } - - public boolean addTrimmedBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { + public boolean addTrimmedBacterialVatRecipe( + ItemStack[] aInputs, + BioCulture aCulture, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + Materials material, + @Nonnegative int glasTier, + int aSpecialValue, + boolean exactSv) { byte gTier = (byte) glasTier; int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) @@ -237,13 +560,45 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe(true, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + true, + aInputs, + null, + BioItemList.getPetriDish(aCulture), + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSievert)) + != null; } public static class DynamicGTRecipe extends GT_Recipe { - public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue, GT_Recipe originalRecipe) { - super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + public DynamicGTRecipe( + boolean aOptimize, + ItemStack[] aInputs, + ItemStack[] aOutputs, + Object aSpecialItems, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue, + GT_Recipe originalRecipe) { + super( + aOptimize, + aInputs, + aOutputs, + aSpecialItems, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue); if (originalRecipe != null) { this.owners = new ArrayList<>(originalRecipe.owners); this.stackTraces = new ArrayList<>(originalRecipe.stackTraces); @@ -251,16 +606,66 @@ public class BWRecipes { } } - public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - this(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue, null); + public DynamicGTRecipe( + boolean aOptimize, + ItemStack[] aInputs, + ItemStack[] aOutputs, + Object aSpecialItems, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + this( + aOptimize, + aInputs, + aOutputs, + aSpecialItems, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue, + null); } - } public static class BW_Recipe_Map_LiquidFuel extends GT_Recipe.GT_Recipe_Map_Fuel { - public BW_Recipe_Map_LiquidFuel(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { - super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + public BW_Recipe_Map_LiquidFuel( + Collection aRecipeList, + String aUnlocalizedName, + String aLocalName, + String aNEIName, + String aNEIGUIPath, + int aUsualInputCount, + int aUsualOutputCount, + int aMinimalInputItems, + int aMinimalInputFluids, + int aAmperage, + String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, + boolean aShowVoltageAmperageInNEI, + boolean aNEIAllowed) { + super( + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } public GT_Recipe addLiquidFuel(Materials M, int burn) { @@ -268,51 +673,108 @@ public class BWRecipes { } public GT_Recipe addMoltenFuel(Materials M, int burn) { - return super.addFuel(ItemFluidCell.getUniversalFluidCell(M.getMolten(144L)), Ic2Items.FluidCell.copy(), burn); + return super.addFuel( + ItemFluidCell.getUniversalFluidCell(M.getMolten(144L)), Ic2Items.FluidCell.copy(), burn); } public GT_Recipe addLiquidFuel(FluidStack fluidStack, int burn) { return super.addFuel(ItemFluidCell.getUniversalFluidCell(fluidStack), Ic2Items.FluidCell.copy(), burn); } - } public static class BacteriaVatRecipe extends GT_Recipe { - public BacteriaVatRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + public BacteriaVatRecipe( + boolean aOptimize, + ItemStack[] aInputs, + ItemStack[] aOutputs, + ItemStack aSpecialItems, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + super( + aOptimize, + aInputs, + aOutputs, + aSpecialItems, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue); } - } public static class BacteriaVatRecipeMap extends BWRecipes.SpecialObjectSensitiveMap { - public BacteriaVatRecipeMap(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { - super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + public BacteriaVatRecipeMap( + Collection aRecipeList, + String aUnlocalizedName, + String aLocalName, + String aNEIName, + String aNEIGUIPath, + int aUsualInputCount, + int aUsualOutputCount, + int aMinimalInputItems, + int aMinimalInputFluids, + int aAmperage, + String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, + boolean aShowVoltageAmperageInNEI, + boolean aNEIAllowed) { + super( + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } - protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) { + protected GT_Recipe addRecipe( + GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) { aRecipe.mHidden = aHidden; aRecipe.mFakeRecipe = aFakeRecipe; - GT_Recipe isthere = this.findRecipe(null, false, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs); + GT_Recipe isthere = + this.findRecipe(null, false, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs); - if (aRecipe.mFluidInputs.length < this.mMinimalInputFluids && aRecipe.mInputs.length < this.mMinimalInputItems) { + if (aRecipe.mFluidInputs.length < this.mMinimalInputFluids + && aRecipe.mInputs.length < this.mMinimalInputItems) { return null; } else { - return aCheckForCollisions && isthere != null && BW_Util.areStacksEqualOrNull((ItemStack) isthere.mSpecialItems, (ItemStack) aRecipe.mSpecialItems) ? null : this.add(aRecipe); + return aCheckForCollisions + && isthere != null + && BW_Util.areStacksEqualOrNull( + (ItemStack) isthere.mSpecialItems, (ItemStack) aRecipe.mSpecialItems) + ? null + : this.add(aRecipe); } } public GT_Recipe addRecipe(GT_Recipe aRecipe, boolean VanillaGT) { - if (VanillaGT) - return addRecipe(aRecipe, true, false, false); - else - return addRecipe(aRecipe); + if (VanillaGT) return addRecipe(aRecipe, true, false, false); + else return addRecipe(aRecipe); } public GT_Recipe addRecipe(GT_Recipe aRecipe) { - if (aRecipe.mInputs.length > 0 && GT_Utility.areStacksEqual(aRecipe.mInputs[aRecipe.mInputs.length - 1], GT_Utility.getIntegratedCircuit(32767))) + if (aRecipe.mInputs.length > 0 + && GT_Utility.areStacksEqual( + aRecipe.mInputs[aRecipe.mInputs.length - 1], GT_Utility.getIntegratedCircuit(32767))) return aRecipe; else { ItemStack[] nu1 = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1); @@ -326,21 +788,49 @@ public class BWRecipes { nu[nu.length - 1] = GT_Utility.getIntegratedCircuit(i); i++; aRecipe.mInputs = nu; - if (i > 24) - i = 1; - if (i == 9 + nu.length) - return null; - } - while (this.findRecipe(null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null); + if (i > 24) i = 1; + if (i == 9 + nu.length) return null; + } while (this.findRecipe(null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) + != null); } return this.addRecipe(aRecipe, false, false, false); } } - public static class SpecialObjectSensitiveMap extends GT_Recipe.GT_Recipe_Map{ - - public SpecialObjectSensitiveMap(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { - super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + public static class SpecialObjectSensitiveMap extends GT_Recipe.GT_Recipe_Map { + + public SpecialObjectSensitiveMap( + Collection aRecipeList, + String aUnlocalizedName, + String aLocalName, + String aNEIName, + String aNEIGUIPath, + int aUsualInputCount, + int aUsualOutputCount, + int aMinimalInputItems, + int aMinimalInputFluids, + int aAmperage, + String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, + boolean aShowVoltageAmperageInNEI, + boolean aNEIAllowed) { + super( + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } /** @@ -356,12 +846,22 @@ public class BWRecipes { * @param aInputs the Item Inputs * @return the Recipe it has found or null for no matching Recipe */ - public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + public GT_Recipe findRecipe( + IHasWorldObjectAndCoords aTileEntity, + GT_Recipe aRecipe, + boolean aNotUnificated, + boolean aDontCheckStackSizes, + long aVoltage, + FluidStack[] aFluids, + ItemStack aSpecialSlot, + ItemStack... aInputs) { // No Recipes? Well, nothing to be found then. if (mRecipeList.isEmpty()) return null; - // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 Stack" or "at least 2 Stacks" before they start searching for Recipes. - // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in their Machines to select Sub Recipes. + // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 + // Stack" or "at least 2 Stacks" before they start searching for Recipes. + // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in + // their Machines to select Sub Recipes. if (GregTech_API.sPostloadFinished) { if (mMinimalInputFluids > 0) { if (aFluids == null) return null; @@ -382,7 +882,10 @@ public class BWRecipes { // Check the Recipe which has been used last time in order to not have to search for it again, if possible. if (aRecipe != null) - if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) aRecipe.mSpecialItems, aSpecialSlot)) + if (!aRecipe.mFakeRecipe + && aRecipe.mCanBeBuffered + && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) + && BW_Util.areStacksEqualOrNull((ItemStack) aRecipe.mSpecialItems, aSpecialSlot)) return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. @@ -392,23 +895,34 @@ public class BWRecipes { Collection tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack)); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) + if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) + && BW_Util.areStacksEqualOrNull( + (ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(GT_Values.W, tStack))); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) + if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) + && BW_Util.areStacksEqualOrNull( + (ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; } - // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that Map too. + // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that + // Map too. if (mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids) if (aFluid != null) { Collection tRecipes = mRecipeFluidMap.get(aFluid.getFluid()); - if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) - return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; + if (tRecipes != null) + for (GT_Recipe tRecipe : tRecipes) + if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) + && BW_Util.areStacksEqualOrNull( + (ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) + return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; } // And nothing has been found. @@ -419,17 +933,17 @@ public class BWRecipes { public static class BWNBTDependantCraftingRecipe implements IRecipe { ItemStack result; - Map charToStackMap = new HashMap<>(9,1); + Map charToStackMap = new HashMap<>(9, 1); String[] shape; @SuppressWarnings({"SuspiciousSystemArraycopy"}) public BWNBTDependantCraftingRecipe(ItemStack result, Object... recipe) { this.result = result; this.shape = new String[3]; - System.arraycopy(recipe,0, this.shape,0,3); + System.arraycopy(recipe, 0, this.shape, 0, 3); this.charToStackMap.put(' ', null); - for (int i = 3; i < recipe.length; i+=2) { - this.charToStackMap.put((char)recipe[i],((ItemStack)recipe[i+1]).copy()); + for (int i = 3; i < recipe.length; i += 2) { + this.charToStackMap.put((char) recipe[i], ((ItemStack) recipe[i + 1]).copy()); } } @@ -441,8 +955,7 @@ public class BWRecipes { BWRecipes.BWNBTDependantCraftingRecipe that = (BWRecipes.BWNBTDependantCraftingRecipe) o; if (!Objects.equals(this.result, that.result)) return false; - if (!Objects.equals(this.charToStackMap, that.charToStackMap)) - return false; + if (!Objects.equals(this.charToStackMap, that.charToStackMap)) return false; // Probably incorrect - comparing Object[] arrays with Arrays.equals return Arrays.equals(this.shape, that.shape); } @@ -459,10 +972,9 @@ public class BWRecipes { public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) { for (int x = 0; x < 3; x++) { for (int y = 0; y < 3; y++) { - ItemStack toCheck = p_77569_1_.getStackInRowAndColumn(y,x); + ItemStack toCheck = p_77569_1_.getStackInRowAndColumn(y, x); ItemStack ref = this.charToStackMap.get(this.shape[x].toCharArray()[y]); - if (!BW_Util.areStacksEqualOrNull(toCheck,ref)) - return false; + if (!BW_Util.areStacksEqualOrNull(toCheck, ref)) return false; } } return true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java index 6956c68233..94a6f5c558 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java @@ -24,29 +24,25 @@ package com.github.bartimaeusnek.bartworks.util; import gregtech.api.enums.Dyes; import gregtech.api.enums.GT_Values; - import java.util.Arrays; + @SuppressWarnings("unused") public class BW_ColorUtil { - private BW_ColorUtil(){} + private BW_ColorUtil() {} - public static byte getDarknessFromColor (short[] rgba, int index){ + public static byte getDarknessFromColor(short[] rgba, int index) { int g = rgba[index]; - if (g >= 0 && g < 64) - return 0; - else if (g >= 64 && g < 160) - return 1; - else if (g >= 160 && g < 223) - return 2; - else if (g >= 233 && g <= 255) - return 3; + if (g >= 0 && g < 64) return 0; + else if (g >= 64 && g < 160) return 1; + else if (g >= 160 && g < 223) return 2; + else if (g >= 233 && g <= 255) return 3; return 4; } - public static Dyes getDyeFromColor(short[] rgba){ - rgba=correctCorlorArray(rgba); - if (isGrayScale(rgba,2)){ - switch (getDarknessFromColor(rgba,0)) { + public static Dyes getDyeFromColor(short[] rgba) { + rgba = correctCorlorArray(rgba); + if (isGrayScale(rgba, 2)) { + switch (getDarknessFromColor(rgba, 0)) { case 0: return Dyes.dyeBlack; case 1: @@ -58,25 +54,23 @@ public class BW_ColorUtil { } } else { short[] tmp = roundColor(rgba, 2); - if (isRedScale(tmp)){ + if (isRedScale(tmp)) { if (isPurpleScale(tmp)) { switch (getDarknessFromColor(rgba, 0)) { case 0: case 1: - if (rgba[3] - 50 > rgba[0]) - return Dyes.dyePurple; + if (rgba[3] - 50 > rgba[0]) return Dyes.dyePurple; else return Dyes.dyeRed; case 2: case 3: - if (rgba[3] - 50 > rgba[0]) - return Dyes.dyeMagenta; - else if (rgba[0] > 200 && rgba[2] > 140) - return Dyes.dyePink; - else if (rgba[0] > rgba[1]+rgba[1]/10 && rgba[0] > rgba[2]+rgba[2]/10 && rgba[1]>>4 == rgba[2]>>4 && rgba[1]+50 > rgba[0]) { + if (rgba[3] - 50 > rgba[0]) return Dyes.dyeMagenta; + else if (rgba[0] > 200 && rgba[2] > 140) return Dyes.dyePink; + else if (rgba[0] > rgba[1] + rgba[1] / 10 + && rgba[0] > rgba[2] + rgba[2] / 10 + && rgba[1] >> 4 == rgba[2] >> 4 + && rgba[1] + 50 > rgba[0]) { return Dyes.dyeBrown; - } - else - return Dyes.dyeRed; + } else return Dyes.dyeRed; case 4: return Dyes._NULL; } @@ -87,27 +81,25 @@ public class BW_ColorUtil { case 1: return Dyes.dyeBrown; case 2: - case 3:{ - if (rgba[0]>>5 > rgba[1]>>5) - return Dyes.dyeOrange; - else - return Dyes.dyeYellow; + case 3: { + if (rgba[0] >> 5 > rgba[1] >> 5) return Dyes.dyeOrange; + else return Dyes.dyeYellow; } case 4: return Dyes._NULL; } return Dyes.dyePink; - } else if (isGrenScale(tmp)){ + } else if (isGrenScale(tmp)) { if (isCyanScale(tmp)) { - if (rgba[2]+40 < rgba[1]) - switch (getDarknessFromColor(rgba,0)) { - case 0: - case 1: - return Dyes.dyeGreen; - case 2: - case 3: - return Dyes.dyeLime; - } + if (rgba[2] + 40 < rgba[1]) + switch (getDarknessFromColor(rgba, 0)) { + case 0: + case 1: + return Dyes.dyeGreen; + case 2: + case 3: + return Dyes.dyeLime; + } return Dyes.dyeCyan; } if (isYellowScale(tmp)) @@ -116,14 +108,12 @@ public class BW_ColorUtil { case 1: return Dyes.dyeBrown; case 2: - case 3:{ - if (rgba[0]>>5 > rgba[1]>>5) - return Dyes.dyeOrange; - else - return Dyes.dyeYellow; + case 3: { + if (rgba[0] >> 5 > rgba[1] >> 5) return Dyes.dyeOrange; + else return Dyes.dyeYellow; } } - switch (getDarknessFromColor(rgba,0)) { + switch (getDarknessFromColor(rgba, 0)) { case 0: case 1: return Dyes.dyeGreen; @@ -131,7 +121,7 @@ public class BW_ColorUtil { case 3: return Dyes.dyeLime; } - } else if (isBlueScale(tmp)){ + } else if (isBlueScale(tmp)) { if (isPurpleScale(tmp)) { switch (getDarknessFromColor(rgba, 0)) { case 0: @@ -141,11 +131,10 @@ public class BW_ColorUtil { case 3: return Dyes.dyeMagenta; } - } - else if (isCyanScale(tmp)){ + } else if (isCyanScale(tmp)) { return Dyes.dyeCyan; } - switch (getDarknessFromColor(rgba,0)) { + switch (getDarknessFromColor(rgba, 0)) { case 0: case 1: return Dyes.dyeBlue; @@ -158,81 +147,73 @@ public class BW_ColorUtil { return Dyes._NULL; } - public static boolean isCyanScale(short[] rgba){ + public static boolean isCyanScale(short[] rgba) { return !isRedScale(rgba); } - public static boolean isPurpleScale(short[] rgba){ + public static boolean isPurpleScale(short[] rgba) { return !isGrenScale(rgba); } - public static boolean isYellowScale(short[] rgba){ - return !isBlueScale(rgba); + public static boolean isYellowScale(short[] rgba) { + return !isBlueScale(rgba); } - public static boolean isBlueScale(short[] rgba){ - rgba=correctCorlorArray(rgba); - return (rgba[2]*2) >= (rgba[1]+rgba[0]); + public static boolean isBlueScale(short[] rgba) { + rgba = correctCorlorArray(rgba); + return (rgba[2] * 2) >= (rgba[1] + rgba[0]); } - public static boolean isGrenScale(short[] rgba){ - rgba=correctCorlorArray(rgba); - return (rgba[1]*2) >= (rgba[0]+rgba[2]); + public static boolean isGrenScale(short[] rgba) { + rgba = correctCorlorArray(rgba); + return (rgba[1] * 2) >= (rgba[0] + rgba[2]); } - public static boolean isRedScale(short[] rgba){ - rgba=correctCorlorArray(rgba); - return (rgba[0]*2) >= (rgba[1]+rgba[2]); + public static boolean isRedScale(short[] rgba) { + rgba = correctCorlorArray(rgba); + return (rgba[0] * 2) >= (rgba[1] + rgba[2]); } - public static boolean isGrayScale(short[] rgba, int magin){ - rgba=correctCorlorArray(rgba); - return rgba[0]>>magin==rgba[1]>>magin && rgba[1]>>magin==rgba[2]>>magin; + public static boolean isGrayScale(short[] rgba, int magin) { + rgba = correctCorlorArray(rgba); + return rgba[0] >> magin == rgba[1] >> magin && rgba[1] >> magin == rgba[2] >> magin; } - public static short[] roundColor(short[] rgba, int magin){ - short[]tmp = Arrays.copyOf(rgba,4); - tmp[0] = (short) (rgba[0]>>magin); - tmp[1] = (short) (rgba[1]>>magin); - tmp[2] = (short) (rgba[2]>>magin); + public static short[] roundColor(short[] rgba, int magin) { + short[] tmp = Arrays.copyOf(rgba, 4); + tmp[0] = (short) (rgba[0] >> magin); + tmp[1] = (short) (rgba[1] >> magin); + tmp[2] = (short) (rgba[2] >> magin); return tmp; } - public static boolean isGrayScale(short[] rgba){ - rgba=correctCorlorArray(rgba); - return rgba[0]==rgba[1] && rgba[1] == rgba[2]; + public static boolean isGrayScale(short[] rgba) { + rgba = correctCorlorArray(rgba); + return rgba[0] == rgba[1] && rgba[1] == rgba[2]; } - public static short[] correctCorlorArray(short[] rgba){ + public static short[] correctCorlorArray(short[] rgba) { if (rgba.length > 4) { - rgba = Arrays.copyOfRange(rgba, 0,4); + rgba = Arrays.copyOfRange(rgba, 0, 4); } if (rgba.length < 4) { short[] tmp = Arrays.copyOf(rgba, 4); - Arrays.fill(tmp,rgba.length,4, (short) 0); + Arrays.fill(tmp, rgba.length, 4, (short) 0); rgba = tmp; } - if (rgba[0] > 255) - rgba[0] = 255; - if (rgba[1] > 255) - rgba[1] = 255; - if (rgba[2] > 255) - rgba[2] = 255; - if (rgba[3] > 255) - rgba[3] = 255; - if (rgba[0] < 0) - rgba[0] = 0; - if (rgba[1] < 0) - rgba[1] = 0; - if (rgba[2] < 0) - rgba[2] = 0; - if (rgba[3] < 0) - rgba[3] = 0; + if (rgba[0] > 255) rgba[0] = 255; + if (rgba[1] > 255) rgba[1] = 255; + if (rgba[2] > 255) rgba[2] = 255; + if (rgba[3] > 255) rgba[3] = 255; + if (rgba[0] < 0) rgba[0] = 0; + if (rgba[1] < 0) rgba[1] = 0; + if (rgba[2] < 0) rgba[2] = 0; + if (rgba[3] < 0) rgba[3] = 0; return rgba; } public static short[] splitColorToRBGArray(int rgb) { - return new short[]{(short) ((rgb >> 16) & 0xFF), (short) ((rgb >> 8) & 0xFF), (short) (rgb & 0xFF)}; + return new short[] {(short) ((rgb >> 16) & 0xFF), (short) ((rgb >> 8) & 0xFF), (short) (rgb & 0xFF)}; } public static int getColorFromRGBArray(short[] color) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java index 2d0bff05ff..42b8ae5e13 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java @@ -22,12 +22,11 @@ package com.github.bartimaeusnek.bartworks.util; -import net.minecraft.util.StatCollector; +import static net.minecraft.util.EnumChatFormatting.*; import java.util.function.Function; import java.util.function.Supplier; - -import static net.minecraft.util.EnumChatFormatting.*; +import net.minecraft.util.StatCollector; public class BW_Tooltip_Reference { public static final String BW_NO_RESET = ChatColorHelper.DARKGREEN + "BartWorks"; @@ -35,17 +34,22 @@ public class BW_Tooltip_Reference { public static final String BW = BW_NO_RESET + GRAY; public static final String TT = TT_NO_RESET + GRAY; - public static final Supplier ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = () -> StatCollector.translateToLocal("tooltip.bw.1.name") + " " + BW; - public static final Supplier ADDED_BY_BARTWORKS = () -> StatCollector.translateToLocal("tooltip.bw.0.name") + " " + BW; - public static final Function ADDED_VIA_BARTWORKS = owner -> String.format(StatCollector.translateToLocal("tooltip.bw.via.name"), owner); + public static final Supplier ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = + () -> StatCollector.translateToLocal("tooltip.bw.1.name") + " " + BW; + public static final Supplier ADDED_BY_BARTWORKS = + () -> StatCollector.translateToLocal("tooltip.bw.0.name") + " " + BW; + public static final Function ADDED_VIA_BARTWORKS = + owner -> String.format(StatCollector.translateToLocal("tooltip.bw.via.name"), owner); public static final String MULTIBLOCK_ADDED_BY_BARTWORKS = BW; - public static final Function MULTIBLOCK_ADDED_VIA_BARTWORKS = owner -> String.format(StatCollector.translateToLocal("tooltip.bw.mb_via.name"), owner); - public static final String MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = MULTIBLOCK_ADDED_VIA_BARTWORKS.apply(GREEN + "bartimaeusnek"); + public static final Function MULTIBLOCK_ADDED_VIA_BARTWORKS = + owner -> String.format(StatCollector.translateToLocal("tooltip.bw.mb_via.name"), owner); + public static final String MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = + MULTIBLOCK_ADDED_VIA_BARTWORKS.apply(GREEN + "bartimaeusnek"); - public static final String ADV_STR_CHECK = "Uses an advanced "+ TT +" structure check, due to "+ BW; - public static final String TT_BLUEPRINT = "To see the structure, use a "+ TT + " Blueprint on the Controller!"; + public static final String ADV_STR_CHECK = "Uses an advanced " + TT + " structure check, due to " + BW; + public static final String TT_BLUEPRINT = "To see the structure, use a " + TT + " Blueprint on the Controller!"; - public static String[] getTranslatedBrandedTooltip(String key){ + public static String[] getTranslatedBrandedTooltip(String key) { String[] dsc = StatCollector.translateToLocal(key).split(";"); String[] fdsc = new String[dsc.length + 1]; System.arraycopy(dsc, 0, fdsc, 0, dsc.length); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index b0ca12b5f2..365c79d496 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.util; +import static gregtech.api.enums.GT_Values.*; + import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.MainMod; @@ -40,6 +42,15 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.ItemData; import gregtech.api.util.*; +import java.lang.reflect.Array; +import java.lang.reflect.Field; +import java.util.*; +import java.util.function.BiConsumer; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.stream.Collectors; +import javax.annotation.Nonnegative; +import javax.annotation.Nonnull; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.enchantment.Enchantment; @@ -59,31 +70,17 @@ import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import org.apache.commons.lang3.reflect.FieldUtils; -import javax.annotation.Nonnegative; -import javax.annotation.Nonnull; -import java.lang.reflect.Array; -import java.lang.reflect.Field; -import java.util.*; -import java.util.function.BiConsumer; -import java.util.function.Consumer; -import java.util.function.Function; -import java.util.stream.Collectors; - -import static gregtech.api.enums.GT_Values.*; - -@SuppressWarnings({"unused","RedundantSuppression"}) +@SuppressWarnings({"unused", "RedundantSuppression"}) public class BW_Util { public static final int STANDART = 0; public static final int LOWGRAVITY = -100; public static final int CLEANROOM = -200; - public static String translateGTItemStack(ItemStack itemStack){ - if (!GT_Utility.isStackValid(itemStack)) - return "Not a Valid ItemStack:"+itemStack; + public static String translateGTItemStack(ItemStack itemStack) { + if (!GT_Utility.isStackValid(itemStack)) return "Not a Valid ItemStack:" + itemStack; String ret = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); - if (!ret.contains("%material")) - return ret; + if (!ret.contains("%material")) return ret; String matname = ""; if (BW_Util.checkStackAndPrefix(itemStack)) matname = GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mDefaultLocalName; @@ -95,12 +92,12 @@ public class BW_Util { array[index] = value; } - public static Object get2DCoordFrom1DArray(int indexX, int indexY, int sizeY, Object[] array){ + public static Object get2DCoordFrom1DArray(int indexX, int indexY, int sizeY, Object[] array) { int index = indexX * sizeY + indexY; return array[index]; } - public static GT_Recipe copyAndSetTierToNewRecipe(GT_Recipe recipe, byte tier){ + public static GT_Recipe copyAndSetTierToNewRecipe(GT_Recipe recipe, byte tier) { byte oldTier = GT_Utility.getTier(recipe.mEUt); int newTime = recipe.mDuration; int newVoltage = recipe.mEUt; @@ -116,83 +113,163 @@ public class BW_Util { return recipe; } - public static String subscriptNumbers(String b){ + public static String subscriptNumbers(String b) { char[] chars = b.toCharArray(); char[] nu = new char[chars.length]; for (int i = 0; i < chars.length; i++) { - switch (chars[i]){ - case '0': nu[i] = '₀'; continue; - case '1': nu[i] = '₁'; continue; - case '2': nu[i] = '₂'; continue; - case '3': nu[i] = '₃'; continue; - case '4': nu[i] = '₄'; continue; - case '5': nu[i] = '₅'; continue; - case '6': nu[i] = '₆'; continue; - case '7': nu[i] = '₇'; continue; - case '8': nu[i] = '₈'; continue; - case '9': nu[i] = '₉'; continue; - default: nu[i] = chars[i]; + switch (chars[i]) { + case '0': + nu[i] = '₀'; + continue; + case '1': + nu[i] = '₁'; + continue; + case '2': + nu[i] = '₂'; + continue; + case '3': + nu[i] = '₃'; + continue; + case '4': + nu[i] = '₄'; + continue; + case '5': + nu[i] = '₅'; + continue; + case '6': + nu[i] = '₆'; + continue; + case '7': + nu[i] = '₇'; + continue; + case '8': + nu[i] = '₈'; + continue; + case '9': + nu[i] = '₉'; + continue; + default: + nu[i] = chars[i]; } } return new String(nu); } - public static String subscriptNumber(Number b){ - char[] chars = Long.toString(b.longValue()).toCharArray(); + public static String subscriptNumber(Number b) { + char[] chars = Long.toString(b.longValue()).toCharArray(); char[] nu = new char[chars.length]; for (int i = 0; i < chars.length; i++) { - switch (chars[i]){ - case '0': nu[i] = '₀'; continue; - case '1': nu[i] = '₁'; continue; - case '2': nu[i] = '₂'; continue; - case '3': nu[i] = '₃'; continue; - case '4': nu[i] = '₄'; continue; - case '5': nu[i] = '₅'; continue; - case '6': nu[i] = '₆'; continue; - case '7': nu[i] = '₇'; continue; - case '8': nu[i] = '₈'; continue; - case '9': nu[i] = '₉'; + switch (chars[i]) { + case '0': + nu[i] = '₀'; + continue; + case '1': + nu[i] = '₁'; + continue; + case '2': + nu[i] = '₂'; + continue; + case '3': + nu[i] = '₃'; + continue; + case '4': + nu[i] = '₄'; + continue; + case '5': + nu[i] = '₅'; + continue; + case '6': + nu[i] = '₆'; + continue; + case '7': + nu[i] = '₇'; + continue; + case '8': + nu[i] = '₈'; + continue; + case '9': + nu[i] = '₉'; } } return new String(nu); } - public static String superscriptNumbers(String b){ + public static String superscriptNumbers(String b) { char[] chars = b.toCharArray(); char[] nu = new char[chars.length]; for (int i = 0; i < chars.length; i++) { - switch (chars[i]){ - case '0': nu[i] = '⁰'; continue; - case '1': nu[i] = '¹'; continue; - case '2': nu[i] = '²'; continue; - case '3': nu[i] = '³'; continue; - case '4': nu[i] = '⁴'; continue; - case '5': nu[i] = '⁵'; continue; - case '6': nu[i] = '⁶'; continue; - case '7': nu[i] = '⁷'; continue; - case '8': nu[i] = '⁸'; continue; - case '9': nu[i] = '⁹'; continue; - default: nu[i] = chars[i]; + switch (chars[i]) { + case '0': + nu[i] = '⁰'; + continue; + case '1': + nu[i] = '¹'; + continue; + case '2': + nu[i] = '²'; + continue; + case '3': + nu[i] = '³'; + continue; + case '4': + nu[i] = '⁴'; + continue; + case '5': + nu[i] = '⁵'; + continue; + case '6': + nu[i] = '⁶'; + continue; + case '7': + nu[i] = '⁷'; + continue; + case '8': + nu[i] = '⁸'; + continue; + case '9': + nu[i] = '⁹'; + continue; + default: + nu[i] = chars[i]; } } return new String(nu); } - public static String superscriptNumber(Number b){ - char[] chars = Long.toString(b.longValue()).toCharArray(); + public static String superscriptNumber(Number b) { + char[] chars = Long.toString(b.longValue()).toCharArray(); char[] nu = new char[chars.length]; for (int i = 0; i < chars.length; i++) { - switch (chars[i]){ - case '0': nu[i] = '⁰'; continue; - case '1': nu[i] = '¹'; continue; - case '2': nu[i] = '²'; continue; - case '3': nu[i] = '³'; continue; - case '4': nu[i] = '⁴'; continue; - case '5': nu[i] = '⁵'; continue; - case '6': nu[i] = '⁶'; continue; - case '7': nu[i] = '⁷'; continue; - case '8': nu[i] = '⁸'; continue; - case '9': nu[i] = '⁹'; + switch (chars[i]) { + case '0': + nu[i] = '⁰'; + continue; + case '1': + nu[i] = '¹'; + continue; + case '2': + nu[i] = '²'; + continue; + case '3': + nu[i] = '³'; + continue; + case '4': + nu[i] = '⁴'; + continue; + case '5': + nu[i] = '⁵'; + continue; + case '6': + nu[i] = '⁶'; + continue; + case '7': + nu[i] = '⁷'; + continue; + case '8': + nu[i] = '⁸'; + continue; + case '9': + nu[i] = '⁹'; } } return new String(nu); @@ -200,61 +277,71 @@ public class BW_Util { public static byte specialToByte(int aSpecialValue) { byte special = 0; - if (aSpecialValue == (LOWGRAVITY)) - special = 1; - else if (aSpecialValue == (CLEANROOM)) - special = 2; - else if (aSpecialValue == (LOWGRAVITY | CLEANROOM)) - special = 3; + if (aSpecialValue == (LOWGRAVITY)) special = 1; + else if (aSpecialValue == (CLEANROOM)) special = 2; + else if (aSpecialValue == (LOWGRAVITY | CLEANROOM)) special = 3; return special; } - public static boolean addBlockToMachine(int x, int y, int z, int offsetsize, IGregTechTileEntity aBaseMetaTileEntity, Block block) { + public static boolean addBlockToMachine( + int x, int y, int z, int offsetsize, IGregTechTileEntity aBaseMetaTileEntity, Block block) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offsetsize; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offsetsize; - return block == Blocks.air ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block); + return block == Blocks.air + ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) + : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block); } - public static boolean addBlockToMachine(int x, int y, int z, int offsetsize, IGregTechTileEntity aBaseMetaTileEntity, Block block, int damage) { + public static boolean addBlockToMachine( + int x, int y, int z, int offsetsize, IGregTechTileEntity aBaseMetaTileEntity, Block block, int damage) { byte dmg = (byte) damage; int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offsetsize; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offsetsize; - return block == Blocks.air ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == dmg; + return block == Blocks.air + ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) + : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) + && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == dmg; } public static int calculateSv(Materials materials) { for (BioVatLogicAdder.MaterialSvPair pair : BioVatLogicAdder.RadioHatch.getMaSv()) { - if (pair.getMaterials().equals(materials)) - return pair.getSievert(); + if (pair.getMaterials().equals(materials)) return pair.getSievert(); } - return (int) (materials.getProtons() == 43L ? (materials.equals(Materials.NaquadahEnriched) ? 140 : materials.equals(Materials.Naquadria) ? 150 : materials.equals(Materials.Naquadah) ? 130 : 43) : materials.getProtons()); + return (int) + (materials.getProtons() == 43L + ? (materials.equals(Materials.NaquadahEnriched) + ? 140 + : materials.equals(Materials.Naquadria) + ? 150 + : materials.equals(Materials.Naquadah) ? 130 : 43) + : materials.getProtons()); } public static ItemStack setStackSize(ItemStack stack, int size) { - if (stack != null) - stack.stackSize = size; + if (stack != null) stack.stackSize = size; return stack; } public static boolean checkStackAndPrefix(ItemStack itemStack) { - return itemStack != null && GT_OreDictUnificator.getAssociation(itemStack) != null && GT_OreDictUnificator.getAssociation(itemStack).mPrefix != null && GT_OreDictUnificator.getAssociation(itemStack).mMaterial != null && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial != null; + return itemStack != null + && GT_OreDictUnificator.getAssociation(itemStack) != null + && GT_OreDictUnificator.getAssociation(itemStack).mPrefix != null + && GT_OreDictUnificator.getAssociation(itemStack).mMaterial != null + && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial != null; } - public static Map getInputsFromOutput(Collection gt_recipes, ItemStack... inputs) { + public static Map getInputsFromOutput( + Collection gt_recipes, ItemStack... inputs) { return gt_recipes.stream() - .filter(ar -> - Arrays.stream(inputs) - .anyMatch(st -> GT_Utility.areStacksEqual(st, ar.mOutputs[0]))) + .filter(ar -> Arrays.stream(inputs).anyMatch(st -> GT_Utility.areStacksEqual(st, ar.mOutputs[0]))) .collect(Collectors.toMap(k -> k.mOutputs[0], k -> k.mInputs)); } public static Map getAsslineInputsFromOutputs(ItemStack... inputs) { return GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.stream() - .filter(ar -> - Arrays.stream(inputs) - .anyMatch(st -> GT_Utility.areStacksEqual(st, ar.mOutput))) + .filter(ar -> Arrays.stream(inputs).anyMatch(st -> GT_Utility.areStacksEqual(st, ar.mOutput))) .collect(Collectors.toMap(k -> k.mOutput, k -> k.mInputs)); } @@ -296,17 +383,13 @@ public class BW_Util { @SuppressWarnings({"unchecked"}) public static T[] copyAndRemoveNulls(T[] input, Class clazz) { - List ret = Arrays.stream(input) - .filter(Objects::nonNull) - .collect(Collectors.toList()); + List ret = Arrays.stream(input).filter(Objects::nonNull).collect(Collectors.toList()); - if (ret.size() <= 0) - return (T[]) Array.newInstance(clazz, 0); + if (ret.size() <= 0) return (T[]) Array.newInstance(clazz, 0); T[] retArr = (T[]) Array.newInstance(clazz, ret.size()); - for (int i = 0; i < ret.size(); i++) - retArr[i] = ret.get(i); + for (int i = 0; i < ret.size(); i++) retArr[i] = ret.get(i); return retArr; } @@ -316,30 +399,29 @@ public class BW_Util { } public static long getTierVoltage(int tier) { - return getTierVoltage((byte)tier); + return getTierVoltage((byte) tier); } public static long getTierVoltage(byte tier) { return 8L << (2 * tier); } - public static byte getTier(long voltage){ - if(voltage <= Integer.MAX_VALUE - 7) - return GT_Utility.getTier(voltage); + public static byte getTier(long voltage) { + if (voltage <= Integer.MAX_VALUE - 7) return GT_Utility.getTier(voltage); byte t = 0; - while(voltage > 8L) { + while (voltage > 8L) { voltage >>= 2; t++; } return t; } - public static String getTierName(byte tier){ - if(VN.length - 1 <= tier) return "MAX+"; + public static String getTierName(byte tier) { + if (VN.length - 1 <= tier) return "MAX+"; else return VN[tier]; } - public static String getTierNameFromVoltage(long voltage){ + public static String getTierNameFromVoltage(long voltage) { return getTierName(getTier(voltage)); } @@ -352,12 +434,9 @@ public class BW_Util { } public static byte getByteFromRarity(EnumRarity rarity) { - if (rarity.equals(EnumRarity.uncommon)) - return 1; - else if (rarity.equals(EnumRarity.epic)) - return 2; - else if (rarity.equals(EnumRarity.rare)) - return 3; + if (rarity.equals(EnumRarity.uncommon)) return 1; + else if (rarity.equals(EnumRarity.epic)) return 2; + else if (rarity.equals(EnumRarity.rare)) return 3; return 0; } @@ -404,21 +483,37 @@ public class BW_Util { * @param aDuration - recipe Duration * @param mAmperage - should be 1 ? */ - public static void calculateOverclockedNessMulti(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, @Nonnull GT_MetaTileEntity_MultiBlockBase base) { + public static void calculateOverclockedNessMulti( + @Nonnegative int aEUt, + @Nonnegative int aDuration, + @Nonnegative int mAmperage, + @Nonnegative long maxInputVoltage, + @Nonnull GT_MetaTileEntity_MultiBlockBase base) { calculateOverclockednessMultiInternal(aEUt, aDuration, mAmperage, maxInputVoltage, base, false); } - public static void calculatePerfectOverclockedNessMulti(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, @Nonnull GT_MetaTileEntity_MultiBlockBase base) { + public static void calculatePerfectOverclockedNessMulti( + @Nonnegative int aEUt, + @Nonnegative int aDuration, + @Nonnegative int mAmperage, + @Nonnegative long maxInputVoltage, + @Nonnull GT_MetaTileEntity_MultiBlockBase base) { calculateOverclockednessMultiInternal(aEUt, aDuration, mAmperage, maxInputVoltage, base, true); } - private static void calculateOverclockednessMultiInternal(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, @Nonnull GT_MetaTileEntity_MultiBlockBase base, @Nonnull boolean perfectOC){ + private static void calculateOverclockednessMultiInternal( + @Nonnegative int aEUt, + @Nonnegative int aDuration, + @Nonnegative int mAmperage, + @Nonnegative long maxInputVoltage, + @Nonnull GT_MetaTileEntity_MultiBlockBase base, + @Nonnull boolean perfectOC) { byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); if (mTier == 0) { - //Long time calculation + // Long time calculation long xMaxProgresstime = ((long) aDuration) << 1; if (xMaxProgresstime > Integer.MAX_VALUE - 1) { - //make impossible if too long + // make impossible if too long base.mEUt = Integer.MAX_VALUE - 1; base.mMaxProgresstime = Integer.MAX_VALUE - 1; } else { @@ -426,27 +521,29 @@ public class BW_Util { base.mMaxProgresstime = (int) xMaxProgresstime; } } else { - //Long EUt calculation + // Long EUt calculation long xEUt = aEUt; - //Isnt too low EUt check? + // Isnt too low EUt check? long tempEUt = Math.max(xEUt, V[1]); base.mMaxProgresstime = aDuration; while (tempEUt <= V[mTier - 1] * mAmperage) { - tempEUt <<= 2;//this actually controls overclocking - //xEUt *= 4;//this is effect of everclocking - base.mMaxProgresstime >>= perfectOC ? 2 : 1;//this is effect of overclocking - xEUt = base.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power + tempEUt <<= 2; // this actually controls overclocking + // xEUt *= 4;//this is effect of everclocking + base.mMaxProgresstime >>= perfectOC ? 2 : 1; // this is effect of overclocking + xEUt = base.mMaxProgresstime <= 0 + ? xEUt >> 1 + : xEUt << 2; // U know, if the time is less than 1 tick make the machine use less power } - while (xEUt > maxInputVoltage && xEUt >= aEUt){ - //downclock one notch until we are good again, we have overshot. + while (xEUt > maxInputVoltage && xEUt >= aEUt) { + // downclock one notch until we are good again, we have overshot. xEUt >>= 2; base.mMaxProgresstime <<= perfectOC ? 2 : 1; } - if (xEUt < aEUt){ + if (xEUt < aEUt) { xEUt <<= 2; base.mMaxProgresstime >>= perfectOC ? 2 : 1; } @@ -456,10 +553,8 @@ public class BW_Util { base.mMaxProgresstime = Integer.MAX_VALUE - 1; } else { base.mEUt = (int) xEUt; - if (base.mEUt == 0) - base.mEUt = 1; - if (base.mMaxProgresstime <= 0) - base.mMaxProgresstime = 1;//set time to 1 tick + if (base.mEUt == 0) base.mEUt = 1; + if (base.mMaxProgresstime <= 0) base.mMaxProgresstime = 1; // set time to 1 tick } } } @@ -478,17 +573,17 @@ public class BW_Util { return rVoltage * rAmperage; } - public static FluidStack[] getFluidsFromInputHatches(GT_MetaTileEntity_MultiBlockBase aBaseMetaTileEntity){ + public static FluidStack[] getFluidsFromInputHatches(GT_MetaTileEntity_MultiBlockBase aBaseMetaTileEntity) { ArrayList tmp = new ArrayList<>(); - for (GT_MetaTileEntity_Hatch_Input fip : aBaseMetaTileEntity.mInputHatches){ + for (GT_MetaTileEntity_Hatch_Input fip : aBaseMetaTileEntity.mInputHatches) { tmp.add(fip.getFluid()); } return tmp.toArray(new FluidStack[0]); } - public static ItemStack[] getItemsFromInputBusses(GT_MetaTileEntity_MultiBlockBase aBaseMetaTileEntity){ + public static ItemStack[] getItemsFromInputBusses(GT_MetaTileEntity_MultiBlockBase aBaseMetaTileEntity) { ArrayList tmp = new ArrayList<>(); - for (GT_MetaTileEntity_Hatch_InputBus fip : aBaseMetaTileEntity.mInputBusses){ + for (GT_MetaTileEntity_Hatch_InputBus fip : aBaseMetaTileEntity.mInputBusses) { tmp.addAll(Arrays.asList(fip.mInventory)); } return tmp.toArray(new ItemStack[0]); @@ -507,24 +602,125 @@ public class BW_Util { } } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean insideCheck, Block inside, int dmginside, int aBaseCasingIndex) { - return BW_Util.check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, insideCheck, inside, dmginside, aBaseCasingIndex); + public static boolean check_layer( + IGregTechTileEntity aBaseMetaTileEntity, + int radius, + int yLevel, + int height, + Block block, + int dmg, + int offset, + boolean insideCheck, + Block inside, + int dmginside, + int aBaseCasingIndex) { + return BW_Util.check_layer( + aBaseMetaTileEntity, + radius, + yLevel, + height, + block, + dmg, + offset, + false, + insideCheck, + inside, + dmginside, + aBaseCasingIndex); } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, int aBaseCasingIndex) { - return BW_Util.check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, aBaseCasingIndex); + public static boolean check_layer( + IGregTechTileEntity aBaseMetaTileEntity, + int radius, + int yLevel, + int height, + Block block, + int dmg, + int offset, + int aBaseCasingIndex) { + return BW_Util.check_layer( + aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, aBaseCasingIndex); } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, int aBaseCasingIndex) { - return BW_Util.check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, false, aBaseCasingIndex); + public static boolean check_layer( + IGregTechTileEntity aBaseMetaTileEntity, + int radius, + int yLevel, + int height, + Block block, + int dmg, + int offset, + boolean controllerLayer, + int aBaseCasingIndex) { + return BW_Util.check_layer( + aBaseMetaTileEntity, + radius, + yLevel, + height, + block, + dmg, + offset, + controllerLayer, + false, + aBaseCasingIndex); } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, int aBaseCasingIndex) { - return BW_Util.check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, freeCorners, false, block, dmg, true, aBaseCasingIndex); + public static boolean check_layer( + IGregTechTileEntity aBaseMetaTileEntity, + int radius, + int yLevel, + int height, + Block block, + int dmg, + int offset, + boolean controllerLayer, + boolean freeCorners, + int aBaseCasingIndex) { + return BW_Util.check_layer( + aBaseMetaTileEntity, + radius, + yLevel, + height, + block, + dmg, + offset, + controllerLayer, + freeCorners, + false, + block, + dmg, + true, + aBaseCasingIndex); } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean insideCheck, Block inside, int dmginside, int aBaseCasingIndex) { - return BW_Util.check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, false, insideCheck, inside, dmginside, true, aBaseCasingIndex); + public static boolean check_layer( + IGregTechTileEntity aBaseMetaTileEntity, + int radius, + int yLevel, + int height, + Block block, + int dmg, + int offset, + boolean controllerLayer, + boolean insideCheck, + Block inside, + int dmginside, + int aBaseCasingIndex) { + return BW_Util.check_layer( + aBaseMetaTileEntity, + radius, + yLevel, + height, + block, + dmg, + offset, + controllerLayer, + false, + insideCheck, + inside, + dmginside, + true, + aBaseCasingIndex); } /** @@ -542,40 +738,113 @@ public class BW_Util { * @param aBaseCasingIndex the Index for the hatches texture * @return if the layer check was completed */ - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck, Block inside, int dmginside, boolean allowHatches, int aBaseCasingIndex) { + public static boolean check_layer( + IGregTechTileEntity aBaseMetaTileEntity, + int radius, + int yLevel, + int height, + Block block, + int dmg, + int offset, + boolean controllerLayer, + boolean freeCorners, + boolean insideCheck, + Block inside, + int dmginside, + boolean allowHatches, + int aBaseCasingIndex) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offset; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offset; for (int x = -radius; x <= radius; x++) { for (int y = yLevel; y < height; y++) { for (int z = -radius; z <= radius; z++) { - if (freeCorners && (((Math.abs(x) == radius && Math.abs(z) == radius)))) - continue; - if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) - continue; + if (freeCorners && (((Math.abs(x) == radius && Math.abs(z) == radius)))) continue; + if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) continue; boolean b = Math.abs(x) < radius && Math.abs(z) != radius; if (insideCheck && b) { - if (! (inside.equals(Blocks.air) ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside) ) && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside || dmginside > (-1))) { - if (!(allowHatches && ( - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addDynamoToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) - ))) { + if (!(inside.equals(Blocks.air) + ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) + : aBaseMetaTileEntity + .getBlockOffset(xDir + x, y, zDir + z) + .equals(inside)) + && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside + || dmginside > (-1))) { + if (!(allowHatches + && (((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) + .addDynamoToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) + aBaseMetaTileEntity.getMetaTileEntity()) + .addEnergyInputToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) + aBaseMetaTileEntity.getMetaTileEntity()) + .addMaintenanceToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) + aBaseMetaTileEntity.getMetaTileEntity()) + .addMufflerToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) + aBaseMetaTileEntity.getMetaTileEntity()) + .addInputToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) + aBaseMetaTileEntity.getMetaTileEntity()) + .addOutputToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex)))) { return false; } } } - if (!b && !aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmg || dmg > (-1))) { - if (!(allowHatches && ( - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addDynamoToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) - ))) { + if (!b + && !aBaseMetaTileEntity + .getBlockOffset(xDir + x, y, zDir + z) + .equals(block) + && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmg || dmg > (-1))) { + if (!(allowHatches + && (((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) + .addDynamoToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) + .addEnergyInputToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) + .addMaintenanceToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) + .addMufflerToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) + .addInputToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) + .addOutputToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex)))) { return false; } } @@ -585,20 +854,25 @@ public class BW_Util { return true; } - public static List getMetasFromLayer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck) { + public static List getMetasFromLayer( + IGregTechTileEntity aBaseMetaTileEntity, + int radius, + int yLevel, + int height, + int offset, + boolean controllerLayer, + boolean freeCorners, + boolean insideCheck) { ArrayList ret = new ArrayList<>(); int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offset; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offset; for (int x = -radius; x <= radius; x++) { for (int y = yLevel; y < height; y++) { for (int z = -radius; z <= radius; z++) { - if (freeCorners && (((Math.abs(x) == radius && Math.abs(z) == radius)))) - continue; - if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) - continue; + if (freeCorners && (((Math.abs(x) == radius && Math.abs(z) == radius)))) continue; + if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) continue; final boolean inside = Math.abs(x) < radius && Math.abs(z) != radius; - if (insideCheck && inside) - ret.add(aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); + if (insideCheck && inside) ret.add(aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); if (!inside) { ret.add(aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); } @@ -609,18 +883,29 @@ public class BW_Util { } public static byte getCircuitTierFromOreDictName(String name) { - switch (name){ - case "circuitPrimitive": return 0; - case "circuitBasic": return 1; - case "circuitGood": return 2; - case "circuitAdvanced": return 3; - case "circuitData": return 4; - case "circuitElite": return 5; - case "circuitMaster": return 6; - case "circuitUltimate": return 7; - case "circuitSuperconductor": return 8; - case "circuitInfinite": return 9; - case "circuitBio": return 10; + switch (name) { + case "circuitPrimitive": + return 0; + case "circuitBasic": + return 1; + case "circuitGood": + return 2; + case "circuitAdvanced": + return 3; + case "circuitData": + return 4; + case "circuitElite": + return 5; + case "circuitMaster": + return 6; + case "circuitUltimate": + return 7; + case "circuitSuperconductor": + return 8; + case "circuitInfinite": + return 9; + case "circuitBio": + return 10; case "circuitNano": case "circuitOptical": return 11; @@ -632,7 +917,8 @@ public class BW_Util { return 13; case "circuitTranscendent": return 14; - default: return -1; + default: + return -1; } } @@ -663,43 +949,39 @@ public class BW_Util { public static byte calculateGlassTier(@Nonnull Block block, @Nonnegative byte meta) { byte boroTier = BorosilicateGlass.getTier(block, meta); - if (boroTier != -1) - return boroTier; + if (boroTier != -1) return boroTier; - if (block.getUnlocalizedName().equals("blockAlloyGlass")) - return 4; + if (block.getUnlocalizedName().equals("blockAlloyGlass")) return 4; - if (block.equals(Blocks.glass)) - return 3; + if (block.equals(Blocks.glass)) return 3; - for (BioVatLogicAdder.BlockMetaPair B : BioVatLogicAdder.BioVatGlass.getGlassMap().keySet()) + for (BioVatLogicAdder.BlockMetaPair B : + BioVatLogicAdder.BioVatGlass.getGlassMap().keySet()) if (B.getBlock().equals(block) && B.getaByte().equals(meta)) return BioVatLogicAdder.BioVatGlass.getGlassMap().get(B); - if (block.getMaterial().equals(Material.glass)) - return 3; + if (block.getMaterial().equals(Material.glass)) return 3; return 0; } - public static IStructureElement ofGlassTiered(byte mintier, byte maxtier, byte notset, BiConsumer setter, Function getter, int aDots){ + public static IStructureElement ofGlassTiered( + byte mintier, byte maxtier, byte notset, BiConsumer setter, Function getter, int aDots) { return new IStructureElement() { - private final IStructureElement placementDelegate = BorosilicateGlass.ofBoroGlass(notset, mintier, maxtier, setter, getter); + private final IStructureElement placementDelegate = + BorosilicateGlass.ofBoroGlass(notset, mintier, maxtier, setter, getter); + @Override public boolean check(T te, World world, int x, int y, int z) { - if(world.isAirBlock(x, y, z)) - return false; - byte glasstier = BW_Util.calculateGlassTier(world.getBlock(x, y, z), (byte)world.getBlockMetadata(x, y, z)); - if(glasstier == 0) // is not a glass ? - return false; - if(glasstier == notset) - return false; - if(glasstier < mintier) - return false; - if(glasstier > maxtier) - return false; - if(getter.apply(te) == notset) - setter.accept(te, glasstier); + if (world.isAirBlock(x, y, z)) return false; + byte glasstier = + BW_Util.calculateGlassTier(world.getBlock(x, y, z), (byte) world.getBlockMetadata(x, y, z)); + if (glasstier == 0) // is not a glass ? + return false; + if (glasstier == notset) return false; + if (glasstier < mintier) return false; + if (glasstier > maxtier) return false; + if (getter.apply(te) == notset) setter.accept(te, glasstier); return getter.apply(te) == glasstier; } @@ -715,21 +997,30 @@ public class BW_Util { } @Override - public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, IItemSource s, EntityPlayerMP actor, Consumer chatter) { + public PlaceResult survivalPlaceBlock( + T t, + World world, + int x, + int y, + int z, + ItemStack trigger, + IItemSource s, + EntityPlayerMP actor, + Consumer chatter) { return placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, s, actor, chatter); } }; } - public static IStructureElement ofGlassTieredMixed(byte mintier, byte maxtier, int aDots){ - return new IStructureElementNoPlacement(){ + public static IStructureElement ofGlassTieredMixed(byte mintier, byte maxtier, int aDots) { + return new IStructureElementNoPlacement() { @Override public boolean check(T te, World world, int x, int y, int z) { - if(world.isAirBlock(x, y, z)) - return false; - byte glasstier = BW_Util.calculateGlassTier(world.getBlock(x, y, z), (byte)world.getBlockMetadata(x, y, z)); - if(glasstier == 0) // is not a glass ? - return false; + if (world.isAirBlock(x, y, z)) return false; + byte glasstier = + BW_Util.calculateGlassTier(world.getBlock(x, y, z), (byte) world.getBlockMetadata(x, y, z)); + if (glasstier == 0) // is not a glass ? + return false; return glasstier >= mintier && glasstier <= maxtier; } @@ -741,27 +1032,60 @@ public class BW_Util { }; } - - private static Field sBufferedRecipeList; @SuppressWarnings("unchecked") - public static List getGTBufferedRecipeList() throws SecurityException, IllegalArgumentException, IllegalAccessException{ + public static List getGTBufferedRecipeList() + throws SecurityException, IllegalArgumentException, IllegalAccessException { if (sBufferedRecipeList == null) { - sBufferedRecipeList = FieldUtils.getDeclaredField(GT_ModHandler.class,"sBufferRecipeList",true); + sBufferedRecipeList = FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true); } if (sBufferedRecipeList == null) { - sBufferedRecipeList = FieldUtils.getField(GT_ModHandler.class,"sBufferRecipeList",true); + sBufferedRecipeList = FieldUtils.getField(GT_ModHandler.class, "sBufferRecipeList", true); } return (List) sBufferedRecipeList.get(null); } public static ShapedOreRecipe createGTCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) { - return createGTCraftingRecipe(aResult, new Enchantment[0], new int[0], (aBitMask & GT_ModHandler.RecipeBits.MIRRORED) != 0L, (aBitMask & GT_ModHandler.RecipeBits.BUFFERED) != 0L, (aBitMask & GT_ModHandler.RecipeBits.KEEPNBT) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DISMANTLEABLE) != 0L, (aBitMask & GT_ModHandler.RecipeBits.NOT_REMOVABLE) == 0L, (aBitMask & GT_ModHandler.RecipeBits.REVERSIBLE) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES_IF_SAME_NBT) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_SHAPED_RECIPES) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_NATIVE_RECIPES) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS) == 0L, (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_THERE_IS_ANOTHER_RECIPE_FOR_IT) != 0L, (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL) != 0L, aRecipe); + return createGTCraftingRecipe( + aResult, + new Enchantment[0], + new int[0], + (aBitMask & GT_ModHandler.RecipeBits.MIRRORED) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.BUFFERED) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.KEEPNBT) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DISMANTLEABLE) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.NOT_REMOVABLE) == 0L, + (aBitMask & GT_ModHandler.RecipeBits.REVERSIBLE) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES_IF_SAME_NBT) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_SHAPED_RECIPES) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_NATIVE_RECIPES) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS) == 0L, + (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_THERE_IS_ANOTHER_RECIPE_FOR_IT) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL) != 0L, + aRecipe); } - @SuppressWarnings({"rawtypes","unchecked"}) - public static ShapedOreRecipe createGTCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput, boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, boolean aRemoveAllOtherShapedsWithSameOutput, boolean aRemoveAllOtherNativeRecipes, boolean aCheckForCollisions, boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, boolean aOnlyAddIfResultIsNotNull, Object[] aRecipe) { + @SuppressWarnings({"rawtypes", "unchecked"}) + public static ShapedOreRecipe createGTCraftingRecipe( + ItemStack aResult, + Enchantment[] aEnchantmentsAdded, + int[] aEnchantmentLevelsAdded, + boolean aMirrored, + boolean aBuffered, + boolean aKeepNBT, + boolean aDismantleable, + boolean aRemovable, + boolean aReversible, + boolean aRemoveAllOthersWithSameOutput, + boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, + boolean aRemoveAllOtherShapedsWithSameOutput, + boolean aRemoveAllOtherNativeRecipes, + boolean aCheckForCollisions, + boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, + boolean aOnlyAddIfResultIsNotNull, + Object[] aRecipe) { aResult = GT_OreDictUnificator.get(true, aResult); if (aOnlyAddIfResultIsNotNull && aResult == null) return null; if (aResult != null && Items.feather.getDamage(aResult) == W) Items.feather.setDamage(aResult, 0); @@ -770,12 +1094,13 @@ public class BW_Util { boolean tThereWasARecipe = false; for (byte i = 0; i < aRecipe.length; i++) { - if (aRecipe[i] instanceof IItemContainer) - aRecipe[i] = ((IItemContainer) aRecipe[i]).get(1); - else if (aRecipe[i] instanceof Enum) - aRecipe[i] = ((Enum) aRecipe[i]).name(); - else if (!(aRecipe[i] == null || aRecipe[i] instanceof ItemStack || aRecipe[i] instanceof ItemData || aRecipe[i] instanceof String || aRecipe[i] instanceof Character)) - aRecipe[i] = aRecipe[i].toString(); + if (aRecipe[i] instanceof IItemContainer) aRecipe[i] = ((IItemContainer) aRecipe[i]).get(1); + else if (aRecipe[i] instanceof Enum) aRecipe[i] = ((Enum) aRecipe[i]).name(); + else if (!(aRecipe[i] == null + || aRecipe[i] instanceof ItemStack + || aRecipe[i] instanceof ItemData + || aRecipe[i] instanceof String + || aRecipe[i] instanceof Character)) aRecipe[i] = aRecipe[i].toString(); } try { @@ -869,7 +1194,8 @@ public class BW_Util { for (; idx < aRecipe.length; idx += 2) { if (aRecipe[idx] == null || aRecipe[idx + 1] == null) { if (D1) { - GT_Log.err.println("WARNING: Missing Item for shaped Recipe: " + (aResult == null ? "null" : aResult.getDisplayName())); + GT_Log.err.println("WARNING: Missing Item for shaped Recipe: " + + (aResult == null ? "null" : aResult.getDisplayName())); for (Object tContent : aRecipe) GT_Log.err.println(tContent); } return null; @@ -899,10 +1225,8 @@ public class BW_Util { break; } ItemStack tStack = GT_OreDictUnificator.getFirstOre(in, 1); - if (tStack == null) - tRemoveRecipe = false; - else - tItemStackMap.put(chr, tStack); + if (tStack == null) tRemoveRecipe = false; + else tItemStackMap.put(chr, tStack); aRecipe[idx + 1] = in.toString(); } else if (in instanceof String) { if (in.equals(OreDictNames.craftingChest.toString())) @@ -949,17 +1273,28 @@ public class BW_Util { if (aResult == null || aResult.stackSize <= 0) return null; - if (aRemoveAllOthersWithSameOutput || aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT || aRemoveAllOtherShapedsWithSameOutput || aRemoveAllOtherNativeRecipes) - tThereWasARecipe = GT_ModHandler.removeRecipeByOutput(aResult, !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, aRemoveAllOtherShapedsWithSameOutput, aRemoveAllOtherNativeRecipes) || tThereWasARecipe; + if (aRemoveAllOthersWithSameOutput + || aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT + || aRemoveAllOtherShapedsWithSameOutput + || aRemoveAllOtherNativeRecipes) + tThereWasARecipe = GT_ModHandler.removeRecipeByOutput( + aResult, + !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, + aRemoveAllOtherShapedsWithSameOutput, + aRemoveAllOtherNativeRecipes) + || tThereWasARecipe; if (aOnlyAddIfThereIsAnyRecipeOutputtingThis && !tThereWasARecipe) { - ArrayList tList = (ArrayList) CraftingManager.getInstance().getRecipeList(); - int tList_sS=tList.size(); + ArrayList tList = + (ArrayList) CraftingManager.getInstance().getRecipeList(); + int tList_sS = tList.size(); for (int i = 0; i < tList_sS && !tThereWasARecipe; i++) { IRecipe tRecipe = tList.get(i); - if (GT_ModHandler.sSpecialRecipeClasses.contains(tRecipe.getClass().getName())) continue; + if (GT_ModHandler.sSpecialRecipeClasses.contains( + tRecipe.getClass().getName())) continue; if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tRecipe.getRecipeOutput()), aResult, true)) { - tList.remove(i--); tList_sS=tList.size(); + tList.remove(i--); + tList_sS = tList.size(); tThereWasARecipe = true; } } @@ -970,7 +1305,15 @@ public class BW_Util { GT_Utility.updateItemStack(aResult); - return new GT_Shaped_Recipe(GT_Utility.copy(aResult), aDismantleable, aRemovable, aKeepNBT, aEnchantmentsAdded, aEnchantmentLevelsAdded, aRecipe).setMirrored(aMirrored); + return new GT_Shaped_Recipe( + GT_Utility.copy(aResult), + aDismantleable, + aRemovable, + aKeepNBT, + aEnchantmentsAdded, + aEnchantmentLevelsAdded, + aRecipe) + .setMirrored(aMirrored); } public static void shortSleep(long nanos) { @@ -979,10 +1322,9 @@ public class BW_Util { long end; do { end = System.nanoTime(); - } while(start + nanos >= end); + } while (start + nanos >= end); } catch (Exception e) { MainMod.LOGGER.catching(e); } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index 5d728b8d2a..16a4d38e30 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -22,30 +22,29 @@ package com.github.bartimaeusnek.bartworks.util; - import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.util.GT_LanguageManager; -import net.minecraft.item.EnumRarity; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; - import java.awt.*; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Objects; +import net.minecraft.item.EnumRarity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; public class BioCulture extends BioData implements IColorModulationContainer { public static final ArrayList BIO_CULTURE_ARRAY_LIST = new ArrayList<>(); - public static final BioCulture NULLCULTURE = BioCulture.createAndRegisterBioCulture(Color.BLUE, "", BioPlasmid.NULLPLASMID, BioDNA.NULLDNA, false); //fallback NULL culture, also Blue =) + public static final BioCulture NULLCULTURE = BioCulture.createAndRegisterBioCulture( + Color.BLUE, "", BioPlasmid.NULLPLASMID, BioDNA.NULLDNA, false); // fallback NULL culture, also Blue =) public String getLocalisedName() { return GT_LanguageManager.getTranslation(this.getName()); } public void setLocalisedName(String localisedName) { - GT_LanguageManager.addStringLocalization(this.getName(),localisedName); + GT_LanguageManager.addStringLocalization(this.getName(), localisedName); } Color color; @@ -54,7 +53,8 @@ public class BioCulture extends BioData implements IColorModulationContainer { boolean bBreedable; Fluid mFluid; - protected BioCulture(Color color, String name, int ID, BioPlasmid plasmid, BioDNA dDNA, EnumRarity rarity, boolean bBreedable) { + protected BioCulture( + Color color, String name, int ID, BioPlasmid plasmid, BioDNA dDNA, EnumRarity rarity, boolean bBreedable) { super(name, ID, rarity); this.color = color; this.plasmid = plasmid; @@ -69,37 +69,39 @@ public class BioCulture extends BioData implements IColorModulationContainer { this.dDNA = dDNA; } - public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, EnumRarity rarity, boolean breedable) { + public static BioCulture createAndRegisterBioCulture( + Color color, String name, BioPlasmid plasmid, BioDNA dna, EnumRarity rarity, boolean breedable) { BioCulture ret = new BioCulture(color, name, BIO_CULTURE_ARRAY_LIST.size(), plasmid, dna, rarity, breedable); BIO_CULTURE_ARRAY_LIST.add(ret); return ret; } - public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, boolean breedable) { - BioCulture ret = new BioCulture(color, name, BIO_CULTURE_ARRAY_LIST.size(), plasmid, dna, dna.getRarity(), breedable); + public static BioCulture createAndRegisterBioCulture( + Color color, String name, BioPlasmid plasmid, BioDNA dna, boolean breedable) { + BioCulture ret = + new BioCulture(color, name, BIO_CULTURE_ARRAY_LIST.size(), plasmid, dna, dna.getRarity(), breedable); BIO_CULTURE_ARRAY_LIST.add(ret); return ret; } public static NBTTagCompound getNBTTagFromCulture(BioCulture bioCulture) { - if (bioCulture == null) - return new NBTTagCompound(); + if (bioCulture == null) return new NBTTagCompound(); NBTTagCompound ret = new NBTTagCompound(); ret.setString("Name", bioCulture.name); - //ret.setInteger("ID", bioCulture.ID); - ret.setIntArray("Color", new int[]{bioCulture.color.getRed(), bioCulture.color.getGreen(), bioCulture.color.getBlue()}); + // ret.setInteger("ID", bioCulture.ID); + ret.setIntArray( + "Color", + new int[] {bioCulture.color.getRed(), bioCulture.color.getGreen(), bioCulture.color.getBlue()}); ret.setTag("Plasmid", BioData.getNBTTagFromBioData(BioData.convertBioPlasmidToBioData(bioCulture.plasmid))); ret.setTag("DNA", BioData.getNBTTagFromBioData(BioData.convertBioDNAToBioData(bioCulture.dDNA))); ret.setBoolean("Breedable", bioCulture.bBreedable); ret.setByte("Rarety", BW_Util.getByteFromRarity(bioCulture.rarity)); - if (bioCulture.bBreedable) - ret.setString("Fluid", bioCulture.getFluid().getName()); + if (bioCulture.bBreedable) ret.setString("Fluid", bioCulture.getFluid().getName()); return ret; } public static BioCulture getBioCultureFromNBTTag(NBTTagCompound tag) { - if (tag == null || tag.getIntArray("Color").length == 0) - return null; + if (tag == null || tag.getIntArray("Color").length == 0) return null; BioCulture ret = getBioCulture(tag.getString("Name")); if (ret == null) @@ -109,28 +111,21 @@ public class BioCulture extends BioData implements IColorModulationContainer { BioPlasmid.convertDataToPlasmid(getBioDataFromNBTTag(tag.getCompoundTag("Plasmid"))), BioDNA.convertDataToDNA(getBioDataFromNBTTag(tag.getCompoundTag("DNA"))), BW_Util.getRarityFromByte(tag.getByte("Rarety")), - tag.getBoolean("Breedable") - ); - if (ret.bBreedable) - ret.setFluid(FluidRegistry.getFluid(tag.getString("Fluid"))); - if (ret.getFluidNotSet()) //should never happen, but better safe than sorry - ret.setbBreedable(false); + tag.getBoolean("Breedable")); + if (ret.bBreedable) ret.setFluid(FluidRegistry.getFluid(tag.getString("Fluid"))); + if (ret.getFluidNotSet()) // should never happen, but better safe than sorry + ret.setbBreedable(false); return ret; } public static BioCulture getBioCulture(String Name) { - if (Name == null || Name.isEmpty()) - return null; - for (BioCulture b : BIO_CULTURE_ARRAY_LIST) - if (b.name.equals(Name)) - return b; + if (Name == null || Name.isEmpty()) return null; + for (BioCulture b : BIO_CULTURE_ARRAY_LIST) if (b.name.equals(Name)) return b; return null; } public static BioCulture getBioCulture(BioDNA DNA) { - for (BioCulture b : BIO_CULTURE_ARRAY_LIST) - if (b.getdDNA().equals(DNA)) - return b; + for (BioCulture b : BIO_CULTURE_ARRAY_LIST) if (b.getdDNA().equals(DNA)) return b; return null; } @@ -157,7 +152,8 @@ public class BioCulture extends BioData implements IColorModulationContainer { } public int getColorRGB() { - return BW_ColorUtil.getColorFromRGBArray(new int[]{this.color.getRed(), this.color.getGreen(), this.color.getBlue()}); + return BW_ColorUtil.getColorFromRGBArray( + new int[] {this.color.getRed(), this.color.getGreen(), this.color.getBlue()}); } public Color getColor() { @@ -168,26 +164,26 @@ public class BioCulture extends BioData implements IColorModulationContainer { this.color = color; } -// public static BioCulture createAndRegisterBioCulture(Color color, String name, long ID, BioPlasmid plasmid, BioDNA dDNA,EnumRarity rarity){ -// BioCulture ret =new BioCulture(color,name,ID,plasmid,dDNA,rarity); -// BIO_CULTURE_ARRAY_LIST.add(ret); -// return ret; -// } + // public static BioCulture createAndRegisterBioCulture(Color color, String name, long ID, BioPlasmid plasmid, + // BioDNA dDNA,EnumRarity rarity){ + // BioCulture ret =new BioCulture(color,name,ID,plasmid,dDNA,rarity); + // BIO_CULTURE_ARRAY_LIST.add(ret); + // return ret; + // } public BioPlasmid getPlasmid() { return this.plasmid; } public BioCulture setPlasmid(BioPlasmid plasmid) { - return checkForExisting(new BioCulture(this.color, this.name, this.ID, plasmid, this.dDNA, this.rarity, this.bBreedable)); + return checkForExisting( + new BioCulture(this.color, this.name, this.ID, plasmid, this.dDNA, this.rarity, this.bBreedable)); } private BioCulture checkForExisting(BioCulture culture) { - if (culture == null) - return null; + if (culture == null) return null; for (BioCulture bc : BioCulture.BIO_CULTURE_ARRAY_LIST) - if (culture.getdDNA().equals(bc.getdDNA()) && culture.getPlasmid().equals(bc.getPlasmid())) - return bc; + if (culture.getdDNA().equals(bc.getdDNA()) && culture.getPlasmid().equals(bc.getPlasmid())) return bc; return culture; } @@ -201,7 +197,8 @@ public class BioCulture extends BioData implements IColorModulationContainer { } public BioCulture setdDNA(BioDNA dDNA) { - return checkForExisting(new BioCulture(this.color, this.name, this.ID, this.plasmid, dDNA, this.rarity, this.bBreedable)); + return checkForExisting( + new BioCulture(this.color, this.name, this.ID, this.plasmid, dDNA, this.rarity, this.bBreedable)); } public BioCulture setdDNAUnsafe(BioDNA dDNA) { @@ -215,20 +212,36 @@ public class BioCulture extends BioData implements IColorModulationContainer { if (o == null || this.getClass() != o.getClass()) return false; if (!super.equals(o)) return false; BioCulture culture = (BioCulture) o; - return this.isBreedable() == culture.isBreedable() && - Objects.equals(this.getColor(), culture.getColor()) && - Objects.equals(this.getPlasmid(), culture.getPlasmid()) && - Objects.equals(this.getdDNA(), culture.getdDNA()) && - Objects.equals(this.mFluid, culture.mFluid); + return this.isBreedable() == culture.isBreedable() + && Objects.equals(this.getColor(), culture.getColor()) + && Objects.equals(this.getPlasmid(), culture.getPlasmid()) + && Objects.equals(this.getdDNA(), culture.getdDNA()) + && Objects.equals(this.mFluid, culture.mFluid); } @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(17).putInt(MurmurHash3.murmurhash3_x86_32(this.getName(), 0, this.getName().length(), 31)).putInt(this.getColorRGB()).putInt(this.getPlasmid().ID).putInt(this.getdDNA().ID).put((byte) (isBreedable() ? 1 : 0)).array(), 0, 17, 31); + return MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(17) + .putInt(MurmurHash3.murmurhash3_x86_32( + this.getName(), 0, this.getName().length(), 31)) + .putInt(this.getColorRGB()) + .putInt(this.getPlasmid().ID) + .putInt(this.getdDNA().ID) + .put((byte) (isBreedable() ? 1 : 0)) + .array(), + 0, + 17, + 31); } @Override public short[] getRGBA() { - return new short[]{(short) getColor().getRed(), (short) getColor().getGreen(), (short) getColor().getBlue(), (short) getColor().getAlpha()}; + return new short[] { + (short) getColor().getRed(), + (short) getColor().getGreen(), + (short) getColor().getBlue(), + (short) getColor().getAlpha() + }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java index 7bb8e427cb..91606cf6ff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java @@ -55,11 +55,6 @@ public class BioDNA extends BioData { @Override public String toString() { - return "BioDNA{" + - "name='" + name + '\'' + - ", ID=" + ID + - '}'; + return "BioDNA{" + "name='" + name + '\'' + ", ID=" + ID + '}'; } - - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java index b64e508abd..98b1f0ecea 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java @@ -22,12 +22,11 @@ package com.github.bartimaeusnek.bartworks.util; -import net.minecraft.item.EnumRarity; -import net.minecraft.nbt.NBTTagCompound; - import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Objects; +import net.minecraft.item.EnumRarity; +import net.minecraft.nbt.NBTTagCompound; public class BioData { public static final ArrayList BIO_DATA_ARRAY_LIST = new ArrayList<>(); @@ -86,22 +85,19 @@ public class BioData { NBTTagCompound ret = new NBTTagCompound(); ret.setByte("Rarity", BW_Util.getByteFromRarity(bioData.rarity)); ret.setString("Name", bioData.name); - //ret.setInteger("ID", bioData.ID); buggy when load Order changes + // ret.setInteger("ID", bioData.ID); buggy when load Order changes ret.setInteger("Chance", bioData.chance); ret.setInteger("Tier", bioData.tier); return ret; } public static BioData getBioDataFromNBTTag(NBTTagCompound tag) { - if (tag == null) - return null; + if (tag == null) return null; return getBioDataFromName(tag.getString("Name")); } public static BioData getBioDataFromName(String Name) { - for (BioData bd : BIO_DATA_ARRAY_LIST) - if (bd.name.equals(Name)) - return bd; + for (BioData bd : BIO_DATA_ARRAY_LIST) if (bd.name.equals(Name)) return bd; return null; } @@ -110,16 +106,26 @@ public class BioData { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; BioData bioData = (BioData) o; - return this.getID() == bioData.getID() || ( - this.getChance() == bioData.getChance() && - this.getTier() == bioData.getTier() && - Objects.equals(this.getName(), bioData.getName()) && - this.getRarity() == bioData.getRarity()); + return this.getID() == bioData.getID() + || (this.getChance() == bioData.getChance() + && this.getTier() == bioData.getTier() + && Objects.equals(this.getName(), bioData.getName()) + && this.getRarity() == bioData.getRarity()); } @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(13).putInt(MurmurHash3.murmurhash3_x86_32(this.getName(), 0, this.getName().length(), 31)).put(BW_Util.getByteFromRarity(this.getRarity())).putInt(this.getChance()).putInt(this.getTier()).array(), 0, 13, 31); + return MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(13) + .putInt(MurmurHash3.murmurhash3_x86_32( + this.getName(), 0, this.getName().length(), 31)) + .put(BW_Util.getByteFromRarity(this.getRarity())) + .putInt(this.getChance()) + .putInt(this.getTier()) + .array(), + 0, + 13, + 31); } public int getTier() { @@ -132,10 +138,7 @@ public class BioData { @Override public String toString() { - return "BioData{" + - "name='" + name + '\'' + - ", ID=" + ID + - '}'; + return "BioData{" + "name='" + name + '\'' + ", ID=" + ID + '}'; } public EnumRarity getRarity() { @@ -170,5 +173,4 @@ public class BioData { public int getID() { return this.ID; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java index 9cadce5239..8cdf435da6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java @@ -55,11 +55,6 @@ public class BioPlasmid extends BioData { @Override public String toString() { - return "BioPlasmid{" + - "name='" + name + '\'' + - ", ID=" + ID + - '}'; + return "BioPlasmid{" + "name='" + name + '\'' + ", ID=" + ID + '}'; } - - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java index 44ac709b9f..c1885b1272 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java @@ -1,10 +1,9 @@ package com.github.bartimaeusnek.bartworks.util; -import org.apache.commons.lang3.reflect.FieldUtils; - import java.lang.reflect.Field; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import org.apache.commons.lang3.reflect.FieldUtils; public class CachedReflectionUtils { private static final ClassValue> fields = new ConcurrentMapClassValue(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java index 0e8c18f93c..988c9b1610 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java @@ -23,13 +23,12 @@ package com.github.bartimaeusnek.bartworks.util; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import java.util.HashSet; import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; -import java.util.HashSet; - public class ConnectedBlocksChecker { public final HashSet hashset = new HashSet<>(2048); @@ -39,24 +38,17 @@ public class ConnectedBlocksChecker { World w = DimensionManager.getWorld(C.wID); int x = C.x, y = C.y, z = C.z; - if (w.getBlock(x + 1, y, z).equals(b)) - ret = (byte) (ret | 0b000100); + if (w.getBlock(x + 1, y, z).equals(b)) ret = (byte) (ret | 0b000100); - if (w.getBlock(x - 1, y, z).equals(b)) - ret = (byte) (ret | 0b001000); + if (w.getBlock(x - 1, y, z).equals(b)) ret = (byte) (ret | 0b001000); - if (w.getBlock(x, y, z + 1).equals(b)) - ret = (byte) (ret | 0b010000); + if (w.getBlock(x, y, z + 1).equals(b)) ret = (byte) (ret | 0b010000); - if (w.getBlock(x, y, z - 1).equals(b)) - ret = (byte) (ret | 0b100000); + if (w.getBlock(x, y, z - 1).equals(b)) ret = (byte) (ret | 0b100000); - if (w.getBlock(x, y + 1, z).equals(b)) - ret = (byte) (ret | 0b000001); - - if (w.getBlock(x, y - 1, z).equals(b)) - ret = (byte) (ret | 0b000010); + if (w.getBlock(x, y + 1, z).equals(b)) ret = (byte) (ret | 0b000001); + if (w.getBlock(x, y - 1, z).equals(b)) ret = (byte) (ret | 0b000010); return ret; } @@ -88,7 +80,6 @@ public class ConnectedBlocksChecker { ret += get_connected(w, x, y, z - 1, b); } - if (((sides | 0b111110) == 0b111111) && !hashset.contains(new Coords(x, y + 1, z, wID))) { ret++; ret += get_connected(w, x, y + 1, z, b); @@ -107,28 +98,21 @@ public class ConnectedBlocksChecker { byte ret = 0; int wID = w.provider.dimensionId; - if (hashset.contains(new Coords(x, y, z, wID))) - return ret; + if (hashset.contains(new Coords(x, y, z, wID))) return ret; hashset.add(new Coords(x, y, z, wID)); - if (w.getBlock(x + 1, y, z).equals(b)) - ret = (byte) (ret | 0b000100); + if (w.getBlock(x + 1, y, z).equals(b)) ret = (byte) (ret | 0b000100); - if (w.getBlock(x - 1, y, z).equals(b)) - ret = (byte) (ret | 0b001000); + if (w.getBlock(x - 1, y, z).equals(b)) ret = (byte) (ret | 0b001000); - if (w.getBlock(x, y, z + 1).equals(b)) - ret = (byte) (ret | 0b010000); + if (w.getBlock(x, y, z + 1).equals(b)) ret = (byte) (ret | 0b010000); - if (w.getBlock(x, y, z - 1).equals(b)) - ret = (byte) (ret | 0b100000); + if (w.getBlock(x, y, z - 1).equals(b)) ret = (byte) (ret | 0b100000); - if (w.getBlock(x, y + 1, z).equals(b)) - ret = (byte) (ret | 0b000001); + if (w.getBlock(x, y + 1, z).equals(b)) ret = (byte) (ret | 0b000001); - if (w.getBlock(x, y - 1, z).equals(b)) - ret = (byte) (ret | 0b000010); + if (w.getBlock(x, y - 1, z).equals(b)) ret = (byte) (ret | 0b000010); return ret; } @@ -144,55 +128,48 @@ public class ConnectedBlocksChecker { t = w.getTileEntity(C.x, C.y + 1, C.z); if (t != null && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x, C.y - 1, C.z); if (t != null && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x + 1, C.y, C.z); if (t != null && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x - 1, C.y, C.z); if (t != null && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x, C.y, C.z + 1); if (t != null && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x, C.y, C.z - 1); if (t != null && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } } else { - if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x, C.y - 1, C.z) && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) - return true; + if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) + && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x, C.y - 1, C.z) + && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) + && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) + && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) + && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) + && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) return true; } } return false; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java index 8282b132ee..e794b21a0c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java @@ -23,14 +23,12 @@ package com.github.bartimaeusnek.bartworks.util; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - import java.util.HashSet; import java.util.LinkedList; import java.util.Queue; - +import net.minecraft.block.Block; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; /** * This implementation is for some reason slower than the Recursive Check.... @@ -42,35 +40,41 @@ public class ConnectedBlocksCheckerIteration { public final HashSet checked = new HashSet<>(4096); private final Queue kwoe = new LinkedList<>(); - public long get_connected(World w, int x, int y, int z, Block b){ - kwoe.add(new Coords(x,y,z,w.provider.dimensionId)); - hashset.add(new Coords(x,y,z,w.provider.dimensionId)); - while (!kwoe.isEmpty()){ + public long get_connected(World w, int x, int y, int z, Block b) { + kwoe.add(new Coords(x, y, z, w.provider.dimensionId)); + hashset.add(new Coords(x, y, z, w.provider.dimensionId)); + while (!kwoe.isEmpty()) { Coords tocheck = kwoe.poll(); int wID = w.provider.dimensionId; checked.add(tocheck); Coords c; - if (!checked.contains(c = new Coords(tocheck.x + 1, tocheck.y, tocheck.z, wID)) && w.getBlock(tocheck.x + 1, tocheck.y, tocheck.z).equals(b)) { + if (!checked.contains(c = new Coords(tocheck.x + 1, tocheck.y, tocheck.z, wID)) + && w.getBlock(tocheck.x + 1, tocheck.y, tocheck.z).equals(b)) { kwoe.add(c); hashset.add(c); } - if (!checked.contains(c = new Coords(tocheck.x - 1, tocheck.y, tocheck.z, wID)) && w.getBlock(tocheck.x - 1, tocheck.y, tocheck.z).equals(b)) { + if (!checked.contains(c = new Coords(tocheck.x - 1, tocheck.y, tocheck.z, wID)) + && w.getBlock(tocheck.x - 1, tocheck.y, tocheck.z).equals(b)) { kwoe.add(c); hashset.add(c); } - if (!checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z + 1, wID)) && w.getBlock(tocheck.x, tocheck.y, tocheck.z + 1).equals(b)) { + if (!checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z + 1, wID)) + && w.getBlock(tocheck.x, tocheck.y, tocheck.z + 1).equals(b)) { kwoe.add(c); hashset.add(c); } - if (!checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z - 1, wID)) && w.getBlock(tocheck.x, tocheck.y, tocheck.z - 1).equals(b)) { + if (!checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z - 1, wID)) + && w.getBlock(tocheck.x, tocheck.y, tocheck.z - 1).equals(b)) { kwoe.add(c); hashset.add(c); } - if (!checked.contains(c = new Coords(tocheck.x, tocheck.y + 1, tocheck.z, wID)) && w.getBlock(tocheck.x, tocheck.y + 1, tocheck.z).equals(b)) { + if (!checked.contains(c = new Coords(tocheck.x, tocheck.y + 1, tocheck.z, wID)) + && w.getBlock(tocheck.x, tocheck.y + 1, tocheck.z).equals(b)) { kwoe.add(c); hashset.add(c); } - if (!checked.contains(c = new Coords(tocheck.x, tocheck.y - 1, tocheck.z, wID)) && w.getBlock(tocheck.x, tocheck.y - 1, tocheck.z).equals(b)) { + if (!checked.contains(c = new Coords(tocheck.x, tocheck.y - 1, tocheck.z, wID)) + && w.getBlock(tocheck.x, tocheck.y - 1, tocheck.z).equals(b)) { kwoe.add(c); hashset.add(c); } @@ -89,55 +93,48 @@ public class ConnectedBlocksCheckerIteration { t = w.getTileEntity(C.x, C.y + 1, C.z); if (t != null && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x, C.y - 1, C.z); if (t != null && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x + 1, C.y, C.z); if (t != null && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x - 1, C.y, C.z); if (t != null && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x, C.y, C.z + 1); if (t != null && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x, C.y, C.z - 1); if (t != null && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } } else { - if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x, C.y - 1, C.z) && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) - return true; + if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) + && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x, C.y - 1, C.z) + && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) + && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) + && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) + && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) + && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) return true; } } return false; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java index ef213ea16b..403f4bbf3e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java @@ -62,15 +62,10 @@ public class Coords { @Override public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || this.getClass() != o.getClass()) - return false; + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; Coords coords = (Coords) o; - return this.x == coords.x && - this.y == coords.y && - this.z == coords.z && - this.wID == coords.wID; + return this.x == coords.x && this.y == coords.y && this.z == coords.z && this.wID == coords.wID; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java index d18eb37eca..f4198466f0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java @@ -27,42 +27,69 @@ import gregtech.api.enums.OrePrefixes; import net.minecraftforge.common.util.EnumHelper; public class EnumUtils { - private EnumUtils() { - } + private EnumUtils() {} - public static OrePrefixes addNewOrePrefix(String enumName, String aRegularLocalName, String aLocalizedMaterialPre, String aLocalizedMaterialPost, - boolean aIsUnificatable, boolean aIsMaterialBased, boolean aIsSelfReferencing, - boolean aIsContainer, boolean aDontUnificateActively, boolean aIsUsedForBlocks, - boolean aAllowNormalRecycling, boolean aGenerateDefaultItem, boolean aIsEnchantable, - boolean aIsUsedForOreProcessing, int aMaterialGenerationBits, long aMaterialAmount, - int aDefaultStackSize, int aTextureindex) { - return EnumHelper.addEnum(OrePrefixes.class, enumName, new Class[]{ - String.class, String.class, String.class, - boolean.class, boolean.class, boolean.class, - boolean.class, boolean.class, boolean.class, - boolean.class, boolean.class, boolean.class, - boolean.class, int.class, long.class, - int.class, int.class - }, new Object[]{ - aRegularLocalName, aLocalizedMaterialPre, aLocalizedMaterialPost, - aIsUnificatable, aIsMaterialBased, aIsSelfReferencing, - aIsContainer, aDontUnificateActively, aIsUsedForBlocks, - aAllowNormalRecycling, aGenerateDefaultItem, aIsEnchantable, - aIsUsedForOreProcessing, aMaterialGenerationBits, aMaterialAmount, - aDefaultStackSize, aTextureindex - }); + public static OrePrefixes addNewOrePrefix( + String enumName, + String aRegularLocalName, + String aLocalizedMaterialPre, + String aLocalizedMaterialPost, + boolean aIsUnificatable, + boolean aIsMaterialBased, + boolean aIsSelfReferencing, + boolean aIsContainer, + boolean aDontUnificateActively, + boolean aIsUsedForBlocks, + boolean aAllowNormalRecycling, + boolean aGenerateDefaultItem, + boolean aIsEnchantable, + boolean aIsUsedForOreProcessing, + int aMaterialGenerationBits, + long aMaterialAmount, + int aDefaultStackSize, + int aTextureindex) { + return EnumHelper.addEnum( + OrePrefixes.class, + enumName, + new Class[] { + String.class, String.class, String.class, + boolean.class, boolean.class, boolean.class, + boolean.class, boolean.class, boolean.class, + boolean.class, boolean.class, boolean.class, + boolean.class, int.class, long.class, + int.class, int.class + }, + new Object[] { + aRegularLocalName, aLocalizedMaterialPre, aLocalizedMaterialPost, + aIsUnificatable, aIsMaterialBased, aIsSelfReferencing, + aIsContainer, aDontUnificateActively, aIsUsedForBlocks, + aAllowNormalRecycling, aGenerateDefaultItem, aIsEnchantable, + aIsUsedForOreProcessing, aMaterialGenerationBits, aMaterialAmount, + aDefaultStackSize, aTextureindex + }); } - public static Element createNewElement(String enumName, long aProtons, long aNeutrons, long aAdditionalMass, - long aHalfLifeSeconds, String aDecayTo, String aName, boolean aIsIsotope) { - return EnumHelper.addEnum(Element.class, enumName, new Class[]{ - long.class, long.class, long.class, - long.class, String.class, String.class, - boolean.class - }, new Object[]{ - aProtons, aNeutrons, aAdditionalMass, - aHalfLifeSeconds, aDecayTo, aName, - aIsIsotope - }); + public static Element createNewElement( + String enumName, + long aProtons, + long aNeutrons, + long aAdditionalMass, + long aHalfLifeSeconds, + String aDecayTo, + String aName, + boolean aIsIsotope) { + return EnumHelper.addEnum( + Element.class, + enumName, + new Class[] { + long.class, long.class, long.class, + long.class, String.class, String.class, + boolean.class + }, + new Object[] { + aProtons, aNeutrons, aAdditionalMass, + aHalfLifeSeconds, aDecayTo, aName, + aIsIsotope + }); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java index 0cf02af8fa..7a3fa2c3ee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java @@ -28,52 +28,44 @@ package com.github.bartimaeusnek.bartworks.util; @SuppressWarnings("unused") public class MathUtils { - public static long floorLong(double x) { - if (Double.isInfinite(x) || Double.isNaN(x)) - return (long) x; + if (Double.isInfinite(x) || Double.isNaN(x)) return (long) x; long xi = (long) x; return x < xi ? xi - 1 : xi; } public static long ceilLong(double x) { - if (Double.isInfinite(x) || Double.isNaN(x)) - return (long) x; + if (Double.isInfinite(x) || Double.isNaN(x)) return (long) x; long xi = (long) x; return x > xi ? xi + 1 : xi; } public static int floorInt(double x) { - if (Double.isInfinite(x) || Double.isNaN(x)) - return (int) x; + if (Double.isInfinite(x) || Double.isNaN(x)) return (int) x; int xi = (int) x; return x < xi ? xi - 1 : xi; } public static int ceilInt(float x) { - if (Float.isInfinite(x) || Float.isNaN(x)) - return (int) x; + if (Float.isInfinite(x) || Float.isNaN(x)) return (int) x; int xi = (int) x; return x > xi ? xi + 1 : xi; } public static int ceilInt(double x) { - if (Double.isInfinite(x) || Double.isNaN(x)) - return (int) x; + if (Double.isInfinite(x) || Double.isNaN(x)) return (int) x; int xi = (int) x; return x > xi ? xi + 1 : xi; } public static double floor(double x) { - if (Double.isInfinite(x) || Double.isNaN(x)) - return x; + if (Double.isInfinite(x) || Double.isNaN(x)) return x; int xi = (int) x; return x < xi ? xi - 1 : xi; } public static double ceil(double x) { - if (Double.isInfinite(x) || Double.isNaN(x)) - return x; + if (Double.isInfinite(x) || Double.isNaN(x)) return x; int xi = (int) x; return x > xi ? xi + 1 : xi; } @@ -108,20 +100,20 @@ public class MathUtils { return (val.compareTo(min) < 0) ? min : (val.compareTo(max) > 0) ? max : val; } - public static int wrap(int input, int bound){ - return (((input % bound)+bound) % bound); + public static int wrap(int input, int bound) { + return (((input % bound) + bound) % bound); } - public static long wrap(long input, long bound){ - return (((input % bound)+bound) % bound); + public static long wrap(long input, long bound) { + return (((input % bound) + bound) % bound); } - public static double wrap(double input, double bound){ - return (((input % bound)+bound) % bound); + public static double wrap(double input, double bound) { + return (((input % bound) + bound) % bound); } - public static float wrap(float input, float bound){ - return (((input % bound)+bound) % bound); + public static float wrap(float input, float bound) { + return (((input % bound) + bound) % bound); } public static float tanh(float x) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java index 95588a4cf2..7b7a0d75f8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java @@ -28,8 +28,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB public class MegaUtils { public static boolean drainEnergyMegaVanilla(GT_MetaTileEntity_MultiBlockBase multiBlockBase, long aEU) { - if (aEU <= 0) - return true; + if (aEU <= 0) return true; long allTheEu = 0; int hatches = 0; @@ -39,8 +38,7 @@ public class MegaUtils { hatches++; } - if (allTheEu < aEU) - return false; + if (allTheEu < aEU) return false; long euperhatch = aEU / hatches; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java index cbb10fa312..dec3a8eb42 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java @@ -20,7 +20,6 @@ */ package com.github.bartimaeusnek.bartworks.util; - public final class MurmurHash3 { public static final int fmix32(int h) { @@ -45,14 +44,14 @@ public final class MurmurHash3 { * Gets a long from a byte buffer in little endian byte order. */ public static final long getLongLittleEndian(byte[] buf, int offset) { - return ((long) buf[offset + 7] << 56) // no mask needed + return ((long) buf[offset + 7] << 56) // no mask needed | ((buf[offset + 6] & 0xffL) << 48) | ((buf[offset + 5] & 0xffL) << 40) | ((buf[offset + 4] & 0xffL) << 32) | ((buf[offset + 3] & 0xffL) << 24) | ((buf[offset + 2] & 0xffL) << 16) | ((buf[offset + 1] & 0xffL) << 8) - | ((buf[offset] & 0xffL)); // no shift needed + | ((buf[offset] & 0xffL)); // no shift needed } /** @@ -64,17 +63,18 @@ public final class MurmurHash3 { final int c2 = 0x1b873593; int h1 = seed; - int roundedEnd = offset + (len & 0xfffffffc); // round down to 4 byte block + int roundedEnd = offset + (len & 0xfffffffc); // round down to 4 byte block for (int i = offset; i < roundedEnd; i += 4) { // little endian load order - int k1 = (data[i] & 0xff) | ((data[i + 1] & 0xff) << 8) | ((data[i + 2] & 0xff) << 16) | (data[i + 3] << 24); + int k1 = + (data[i] & 0xff) | ((data[i + 1] & 0xff) << 8) | ((data[i + 2] & 0xff) << 16) | (data[i + 3] << 24); k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); k1 *= c2; h1 ^= k1; - h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); + h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); h1 = h1 * 5 + 0xe6546b64; } @@ -91,7 +91,7 @@ public final class MurmurHash3 { case 1: k1 |= (data[roundedEnd] & 0xff); k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); k1 *= c2; h1 ^= k1; } @@ -127,8 +127,7 @@ public final class MurmurHash3 { int k2 = 0; int shift = 0; int bits = 0; - int nBytes = 0; // length in UTF8 bytes - + int nBytes = 0; // length in UTF8 bytes while (pos < end) { int code = data.charAt(pos++); @@ -137,37 +136,33 @@ public final class MurmurHash3 { bits = 8; /*** - // optimized ascii implementation (currently slower!!! code size?) - if (shift == 24) { - k1 = k1 | (code << 24); - - k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); - k1 *= c2; - - h1 ^= k1; - h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); - h1 = h1*5+0xe6546b64; - - shift = 0; - nBytes += 4; - k1 = 0; - } else { - k1 |= code << shift; - shift += 8; - } - continue; + * // optimized ascii implementation (currently slower!!! code size?) + * if (shift == 24) { + * k1 = k1 | (code << 24); + * + * k1 *= c1; + * k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + * k1 *= c2; + * + * h1 ^= k1; + * h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); + * h1 = h1*5+0xe6546b64; + * + * shift = 0; + * nBytes += 4; + * k1 = 0; + * } else { + * k1 |= code << shift; + * shift += 8; + * } + * continue; ***/ - } else if (code < 0x800) { - k2 = (0xC0 | (code >> 6)) - | ((0x80 | (code & 0x3F)) << 8); + k2 = (0xC0 | (code >> 6)) | ((0x80 | (code & 0x3F)) << 8); bits = 16; } else if (code < 0xD800 || code > 0xDFFF || pos >= end) { // we check for pos>=end to encode an unpaired surrogate as 3 bytes. - k2 = (0xE0 | (code >> 12)) - | ((0x80 | ((code >> 6) & 0x3F)) << 8) - | ((0x80 | (code & 0x3F)) << 16); + k2 = (0xE0 | (code >> 12)) | ((0x80 | ((code >> 6) & 0x3F)) << 8) | ((0x80 | (code & 0x3F)) << 16); bits = 24; } else { // surrogate pair @@ -181,7 +176,6 @@ public final class MurmurHash3 { bits = 32; } - k1 |= k2 << shift; // int used_bits = 32 - shift; // how many bits of k2 were used in k1. @@ -192,30 +186,29 @@ public final class MurmurHash3 { // mix after we have a complete word k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); k1 *= c2; h1 ^= k1; - h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); + h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); h1 = h1 * 5 + 0xe6546b64; shift -= 32; // unfortunately, java won't let you shift 32 bits off, so we need to check for 0 if (shift != 0) { - k1 = k2 >>> (bits - shift); // bits used == bits - newshift + k1 = k2 >>> (bits - shift); // bits used == bits - newshift } else { k1 = 0; } nBytes += 4; } - } // inner // handle tail if (shift > 0) { nBytes += shift >> 3; k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); k1 *= c2; h1 ^= k1; } @@ -245,7 +238,7 @@ public final class MurmurHash3 { final long c1 = 0x87c37b91114253d5L; final long c2 = 0x4cf5ad432745937fL; - int roundedEnd = offset + (len & 0xFFFFFFF0); // round down to 16 byte block + int roundedEnd = offset + (len & 0xFFFFFFF0); // round down to 16 byte block for (int i = offset; i < roundedEnd; i += 16) { long k1 = getLongLittleEndian(key, i); long k2 = getLongLittleEndian(key, i + 8); @@ -309,7 +302,7 @@ public final class MurmurHash3 { h1 ^= k1; } - //---------- + // ---------- // finalization h1 ^= len; @@ -335,5 +328,4 @@ public final class MurmurHash3 { public long val1; public long val2; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java index 3e27fe94c3..e5f9c42bf7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java @@ -25,7 +25,6 @@ package com.github.bartimaeusnek.bartworks.util.NoiseUtil; import com.github.bartimaeusnek.bartworks.API.INoiseGen; import com.github.bartimaeusnek.bartworks.util.MathUtils; import gregtech.api.objects.XSTR; - import java.util.Random; public class BartsNoise implements INoiseGen { @@ -44,13 +43,20 @@ public class BartsNoise implements INoiseGen { long seed; Random random; - public enum NoiseColor{ - Red(-1),Pink(-0.5),White(0),Blue(0.5),Violet(1); + public enum NoiseColor { + Red(-1), + Pink(-0.5), + White(0), + Blue(0.5), + Violet(1); + NoiseColor(double num) { - this.ampl=num; + this.ampl = num; } + double ampl; - public BartsNoise getColoredNoise(){ + + public BartsNoise getColoredNoise() { BartsNoise noise = new BartsNoise(); noise.setAmplitude(this.ampl); return noise; @@ -81,104 +87,101 @@ public class BartsNoise implements INoiseGen { this.amplitude = this.random.nextGaussian(); } - public BartsNoise copy(){ - return new BartsNoise(this.octaves,this.frequency,this.amplitude,this.seed); - } - public BartsNoise copy(long seed){ - return new BartsNoise(this.octaves,this.frequency,this.amplitude,seed); - } -// public static void main(String[] args) throws IOException { -// -// BartsNoise noiseGen1 = new BartsNoise(2,0.005F,1D,System.nanoTime()); -//// BartsNoise noiseGen2 = new BartsNoise(1,0.002F,-1D,System.nanoTime()); -//// BartsNoise noiseGen3 = new BartsNoise(1,0.002F,-1D,System.nanoTime()); -// -// noiseGen1.setUsePhase(false); -//// noiseGen2.setUsePhase(false); -//// noiseGen3.setUsePhase(false); -// -// -// BufferedImage image = new BufferedImage(640, 640, BufferedImage.TYPE_INT_RGB); -// -// for (int chunkX = 0; chunkX < 40; chunkX++) { -// for (int chunkZ = 0; chunkZ < 40; chunkZ++) { -// for (int x = 0; x < 16; ++x) { -// for (int z = 0; z < 16; ++z) { -// double d = noiseGen1.getNoise(x + chunkX * 16, z + chunkZ * 16) * 2D; -//// double d2 = noiseGen2.getNoise(x + chunkX * 16, z + chunkZ * 16) * 2D; -//// double d3 = (noiseGen3.getNoise(x + chunkX * 16, z + chunkZ * 16) - 0.5D); -//// d3 *= 2; -// double yDev; -//// if (d3 < 0.0D) { -//// yDev = d; -//// } else if (d3 > 1.0D) { -//// yDev = d2; -//// } else { -// yDev = d*4; -//// } -// yDev=wrap(yDev,1); -// image.setRGB(x + chunkX * 16,z + chunkZ * 16,new Color((float)(1f*yDev),(float)(1f*yDev),(float)(1f*yDev)).getRGB()); -// } -// } -// } -// } -// File file = new File("myimage.png"); -// ImageIO.write(image, "png", file); -//// BartsNoise redNoise = NoiseColor.Blue.getColoredNoise(); -//// redNoise.setOctaves(1); -//// redNoise.setFrequency(0.05F); -//// for (int i = 40; i < 50; i++) { -//// String line = ""; -//// for (int j = 0; j < 10; j++) { -//// double num = (redNoise.getNoise(i,j)-0.5D); -//// line += num+","; -//// } -//// System.out.println(line); -//// } -// } - - public double getCosNoise(double x, double y){ + public BartsNoise copy() { + return new BartsNoise(this.octaves, this.frequency, this.amplitude, this.seed); + } + + public BartsNoise copy(long seed) { + return new BartsNoise(this.octaves, this.frequency, this.amplitude, seed); + } + // public static void main(String[] args) throws IOException { + // + // BartsNoise noiseGen1 = new BartsNoise(2,0.005F,1D,System.nanoTime()); + //// BartsNoise noiseGen2 = new BartsNoise(1,0.002F,-1D,System.nanoTime()); + //// BartsNoise noiseGen3 = new BartsNoise(1,0.002F,-1D,System.nanoTime()); + // + // noiseGen1.setUsePhase(false); + //// noiseGen2.setUsePhase(false); + //// noiseGen3.setUsePhase(false); + // + // + // BufferedImage image = new BufferedImage(640, 640, BufferedImage.TYPE_INT_RGB); + // + // for (int chunkX = 0; chunkX < 40; chunkX++) { + // for (int chunkZ = 0; chunkZ < 40; chunkZ++) { + // for (int x = 0; x < 16; ++x) { + // for (int z = 0; z < 16; ++z) { + // double d = noiseGen1.getNoise(x + chunkX * 16, z + chunkZ * 16) * 2D; + //// double d2 = noiseGen2.getNoise(x + chunkX * 16, z + chunkZ * 16) * 2D; + //// double d3 = (noiseGen3.getNoise(x + chunkX * 16, z + chunkZ * 16) - 0.5D); + //// d3 *= 2; + // double yDev; + //// if (d3 < 0.0D) { + //// yDev = d; + //// } else if (d3 > 1.0D) { + //// yDev = d2; + //// } else { + // yDev = d*4; + //// } + // yDev=wrap(yDev,1); + // image.setRGB(x + chunkX * 16,z + chunkZ * 16,new + // Color((float)(1f*yDev),(float)(1f*yDev),(float)(1f*yDev)).getRGB()); + // } + // } + // } + // } + // File file = new File("myimage.png"); + // ImageIO.write(image, "png", file); + //// BartsNoise redNoise = NoiseColor.Blue.getColoredNoise(); + //// redNoise.setOctaves(1); + //// redNoise.setFrequency(0.05F); + //// for (int i = 40; i < 50; i++) { + //// String line = ""; + //// for (int j = 0; j < 10; j++) { + //// double num = (redNoise.getNoise(i,j)-0.5D); + //// line += num+","; + //// } + //// System.out.println(line); + //// } + // } + + public double getCosNoise(double x, double y) { double pr = x * this.frequency; double r1 = Math.cos(pr); - if (r1 < 0) - r1 = Math.abs(r1); + if (r1 < 0) r1 = Math.abs(r1); double result = Math.pow(r1, this.amplitude); double pr2 = y * this.frequency; double r2 = Math.cos(pr2); - if (r2 < 0) - r2 = Math.abs(r2); + if (r2 < 0) r2 = Math.abs(r2); double result2 = Math.pow(r2, this.amplitude); result *= result2; - if (result == Double.POSITIVE_INFINITY) - result = Double.MAX_VALUE; - if (result == Double.NEGATIVE_INFINITY) - result = Double.MIN_VALUE; - return MathUtils.wrap(result,1D); + if (result == Double.POSITIVE_INFINITY) result = Double.MAX_VALUE; + if (result == Double.NEGATIVE_INFINITY) result = Double.MIN_VALUE; + return MathUtils.wrap(result, 1D); } - - double getNonOctavedNoise(double x, double y){ - double phase = SimplexNoise.noise( Math.pow(x*this.frequency,this.amplitude),Math.pow(y*this.frequency,this.amplitude)); - return MathUtils.wrap(phase,1); - + double getNonOctavedNoise(double x, double y) { + double phase = SimplexNoise.noise( + Math.pow(x * this.frequency, this.amplitude), Math.pow(y * this.frequency, this.amplitude)); + return MathUtils.wrap(phase, 1); } - public double getNeighbouringNoise(int x, int y){ - return (this.getNoiseSingle(x-1,y-1)+ - this.getNoiseSingle(x,y-1) + - this.getNoiseSingle(x-1,y) + - this.getNoiseSingle(x+1,y) + - this.getNoiseSingle(x,y+1) + - this.getNoiseSingle(x+1,y+1) + - this.getNoiseSingle(x-1,y+1)+ - this.getNoiseSingle(x+1,y-1) - )/8; + public double getNeighbouringNoise(int x, int y) { + return (this.getNoiseSingle(x - 1, y - 1) + + this.getNoiseSingle(x, y - 1) + + this.getNoiseSingle(x - 1, y) + + this.getNoiseSingle(x + 1, y) + + this.getNoiseSingle(x, y + 1) + + this.getNoiseSingle(x + 1, y + 1) + + this.getNoiseSingle(x - 1, y + 1) + + this.getNoiseSingle(x + 1, y - 1)) + / 8; } - public double getNoiseSingle(int x, int y){ + public double getNoiseSingle(int x, int y) { double result = 0; for (double i = 1; i <= this.octaves; i++) { - result += 1d/i * this.getNonOctavedNoise(i * x, i * y); + result += 1d / i * this.getNonOctavedNoise(i * x, i * y); } return result; } @@ -187,20 +190,20 @@ public class BartsNoise implements INoiseGen { public double getNoise(int x, int y) { double result = 0; for (double i = 1; i <= this.octaves; i++) { - result += 1d/i * this.getNonOctavedNoise(i * x, y); + result += 1d / i * this.getNonOctavedNoise(i * x, y); } - //result = (this.getNeighbouringNoise(x,y)+result)/2; - return MathUtils.wrap(result,1D); + // result = (this.getNeighbouringNoise(x,y)+result)/2; + return MathUtils.wrap(result, 1D); } @Override public double[][] getNoiseForRegion(int xStart, int zStart, int xEnd, int zEnd) { -// double[][] results = new double[Math.abs(xEnd)-Math.abs(xStart)][Math.abs(zEnd)-Math.abs(zStart)]; -// for (int i = xStart; i < xEnd; i++) { -// for (int j = zStart; j < zEnd; j++) { -// results -// } -// } + // double[][] results = new double[Math.abs(xEnd)-Math.abs(xStart)][Math.abs(zEnd)-Math.abs(zStart)]; + // for (int i = xStart; i < xEnd; i++) { + // for (int j = zStart; j < zEnd; j++) { + // results + // } + // } return new double[0][0]; } @@ -221,6 +224,6 @@ public class BartsNoise implements INoiseGen { @Override public void setSeed(long seed) { - this.seed=seed; + this.seed = seed; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java index 9c9e9ebd8d..427cf5919e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java @@ -18,341 +18,418 @@ package com.github.bartimaeusnek.bartworks.util.NoiseUtil; import com.github.bartimaeusnek.bartworks.util.MathUtils; -public class SimplexNoise { // Simplex noise in 2D, 3D and 4D - private static Grad[] grad3 = {new Grad(1,1,0),new Grad(-1,1,0),new Grad(1,-1,0),new Grad(-1,-1,0), - new Grad(1,0,1),new Grad(-1,0,1),new Grad(1,0,-1),new Grad(-1,0,-1), - new Grad(0,1,1),new Grad(0,-1,1),new Grad(0,1,-1),new Grad(0,-1,-1)}; +public class SimplexNoise { // Simplex noise in 2D, 3D and 4D + private static Grad[] grad3 = { + new Grad(1, 1, 0), new Grad(-1, 1, 0), new Grad(1, -1, 0), new Grad(-1, -1, 0), + new Grad(1, 0, 1), new Grad(-1, 0, 1), new Grad(1, 0, -1), new Grad(-1, 0, -1), + new Grad(0, 1, 1), new Grad(0, -1, 1), new Grad(0, 1, -1), new Grad(0, -1, -1) + }; - private static Grad[] grad4 = {new Grad(0,1,1,1),new Grad(0,1,1,-1),new Grad(0,1,-1,1),new Grad(0,1,-1,-1), - new Grad(0,-1,1,1),new Grad(0,-1,1,-1),new Grad(0,-1,-1,1),new Grad(0,-1,-1,-1), - new Grad(1,0,1,1),new Grad(1,0,1,-1),new Grad(1,0,-1,1),new Grad(1,0,-1,-1), - new Grad(-1,0,1,1),new Grad(-1,0,1,-1),new Grad(-1,0,-1,1),new Grad(-1,0,-1,-1), - new Grad(1,1,0,1),new Grad(1,1,0,-1),new Grad(1,-1,0,1),new Grad(1,-1,0,-1), - new Grad(-1,1,0,1),new Grad(-1,1,0,-1),new Grad(-1,-1,0,1),new Grad(-1,-1,0,-1), - new Grad(1,1,1,0),new Grad(1,1,-1,0),new Grad(1,-1,1,0),new Grad(1,-1,-1,0), - new Grad(-1,1,1,0),new Grad(-1,1,-1,0),new Grad(-1,-1,1,0),new Grad(-1,-1,-1,0)}; + private static Grad[] grad4 = { + new Grad(0, 1, 1, 1), + new Grad(0, 1, 1, -1), + new Grad(0, 1, -1, 1), + new Grad(0, 1, -1, -1), + new Grad(0, -1, 1, 1), + new Grad(0, -1, 1, -1), + new Grad(0, -1, -1, 1), + new Grad(0, -1, -1, -1), + new Grad(1, 0, 1, 1), + new Grad(1, 0, 1, -1), + new Grad(1, 0, -1, 1), + new Grad(1, 0, -1, -1), + new Grad(-1, 0, 1, 1), + new Grad(-1, 0, 1, -1), + new Grad(-1, 0, -1, 1), + new Grad(-1, 0, -1, -1), + new Grad(1, 1, 0, 1), + new Grad(1, 1, 0, -1), + new Grad(1, -1, 0, 1), + new Grad(1, -1, 0, -1), + new Grad(-1, 1, 0, 1), + new Grad(-1, 1, 0, -1), + new Grad(-1, -1, 0, 1), + new Grad(-1, -1, 0, -1), + new Grad(1, 1, 1, 0), + new Grad(1, 1, -1, 0), + new Grad(1, -1, 1, 0), + new Grad(1, -1, -1, 0), + new Grad(-1, 1, 1, 0), + new Grad(-1, 1, -1, 0), + new Grad(-1, -1, 1, 0), + new Grad(-1, -1, -1, 0) + }; - private static short[] p = {151,160,137,91,90,15, - 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23, - 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33, - 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166, - 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244, - 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196, - 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123, - 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42, - 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9, - 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228, - 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107, - 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254, - 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180}; - // To remove the need for index wrapping, double the permutation table length - private static short[] perm = new short[512]; - private static short[] permMod12 = new short[512]; - static { - for(int i=0; i<512; i++) - { - perm[i]=p[i & 255]; - permMod12[i] = (short)(perm[i] % 12); - } - } - - // Skewing and unskewing factors for 2, 3, and 4 dimensions - private static final double F2 = 0.5*(Math.sqrt(3.0)-1.0); - private static final double G2 = (3.0-Math.sqrt(3.0))/6.0; - private static final double F3 = 1.0/3.0; - private static final double G3 = 1.0/6.0; - private static final double F4 = (Math.sqrt(5.0)-1.0)/4.0; - private static final double G4 = (5.0-Math.sqrt(5.0))/20.0; - - // This method is a *lot* faster than using (int)Math.floor(x) - private static int fastfloor(double x) { - return MathUtils.floorInt(x); - } - - private static double dot(Grad g, double x, double y) { - return g.x*x + g.y*y; } - - private static double dot(Grad g, double x, double y, double z) { - return g.x*x + g.y*y + g.z*z; } + private static short[] p = { + 151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, 103, 30, 69, 142, 8, 99, 37, + 240, 21, 10, 23, 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117, 35, 11, 32, 57, 177, + 33, 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, 134, 139, 48, 27, 166, 77, 146, + 158, 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, 55, 46, 245, 40, 244, 102, 143, 54, 65, 25, + 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, 18, 169, 200, 196, 135, 130, 116, 188, 159, 86, 164, 100, + 109, 198, 173, 186, 3, 64, 52, 217, 226, 250, 124, 123, 5, 202, 38, 147, 118, 126, 255, 82, 85, 212, 207, 206, + 59, 227, 47, 16, 58, 17, 182, 189, 28, 42, 223, 183, 170, 213, 119, 248, 152, 2, 44, 154, 163, 70, 221, 153, + 101, 155, 167, 43, 172, 9, 129, 22, 39, 253, 19, 98, 108, 110, 79, 113, 224, 232, 178, 185, 112, 104, 218, 246, + 97, 228, 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241, 81, 51, 145, 235, 249, 14, 239, 107, 49, 192, + 214, 31, 181, 199, 106, 157, 184, 84, 204, 176, 115, 121, 50, 45, 127, 4, 150, 254, 138, 236, 205, 93, 222, 114, + 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, 61, 156, 180 + }; + // To remove the need for index wrapping, double the permutation table length + private static short[] perm = new short[512]; + private static short[] permMod12 = new short[512]; - private static double dot(Grad g, double x, double y, double z, double w) { - return g.x*x + g.y*y + g.z*z + g.w*w; } - - - // 2D simplex noise - public static double noise(double xin, double yin) { - double n0, n1, n2; // Noise contributions from the three corners - // Skew the input space to determine which simplex cell we're in - double s = (xin+yin)*F2; // Hairy factor for 2D - int i = fastfloor(xin+s); - int j = fastfloor(yin+s); - double t = (i+j)*G2; - double X0 = i-t; // Unskew the cell origin back to (x,y) space - double Y0 = j-t; - double x0 = xin-X0; // The x,y distances from the cell origin - double y0 = yin-Y0; - // For the 2D case, the simplex shape is an equilateral triangle. - // Determine which simplex we are in. - int i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords - if(x0>y0) {i1=1; j1=0;} // lower triangle, XY order: (0,0)->(1,0)->(1,1) - else {i1=0; j1=1;} // upper triangle, YX order: (0,0)->(0,1)->(1,1) - // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and - // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where - // c = (3-sqrt(3))/6 - double x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords - double y1 = y0 - j1 + G2; - double x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords - double y2 = y0 - 1.0 + 2.0 * G2; - // Work out the hashed gradient indices of the three simplex corners - int ii = i & 255; - int jj = j & 255; - int gi0 = permMod12[ii+perm[jj]]; - int gi1 = permMod12[ii+i1+perm[jj+j1]]; - int gi2 = permMod12[ii+1+perm[jj+1]]; - // Calculate the contribution from the three corners - double t0 = 0.5 - x0*x0-y0*y0; - if(t0<0) n0 = 0.0; - else { - t0 *= t0; - n0 = t0 * t0 * dot(grad3[gi0], x0, y0); // (x,y) of grad3 used for 2D gradient - } - double t1 = 0.5 - x1*x1-y1*y1; - if(t1<0) n1 = 0.0; - else { - t1 *= t1; - n1 = t1 * t1 * dot(grad3[gi1], x1, y1); + static { + for (int i = 0; i < 512; i++) { + perm[i] = p[i & 255]; + permMod12[i] = (short) (perm[i] % 12); + } } - double t2 = 0.5 - x2*x2-y2*y2; - if(t2<0) n2 = 0.0; - else { - t2 *= t2; - n2 = t2 * t2 * dot(grad3[gi2], x2, y2); - } - // Add contributions from each corner to get the final noise value. - // The result is scaled to return values in the interval [-1,1]. - return 70.0 * (n0 + n1 + n2); - } + // Skewing and unskewing factors for 2, 3, and 4 dimensions + private static final double F2 = 0.5 * (Math.sqrt(3.0) - 1.0); + private static final double G2 = (3.0 - Math.sqrt(3.0)) / 6.0; + private static final double F3 = 1.0 / 3.0; + private static final double G3 = 1.0 / 6.0; + private static final double F4 = (Math.sqrt(5.0) - 1.0) / 4.0; + private static final double G4 = (5.0 - Math.sqrt(5.0)) / 20.0; - // 3D simplex noise - public static double noise(double xin, double yin, double zin) { - double n0, n1, n2, n3; // Noise contributions from the four corners - // Skew the input space to determine which simplex cell we're in - double s = (xin+yin+zin)*F3; // Very nice and simple skew factor for 3D - int i = fastfloor(xin+s); - int j = fastfloor(yin+s); - int k = fastfloor(zin+s); - double t = (i+j+k)*G3; - double X0 = i-t; // Unskew the cell origin back to (x,y,z) space - double Y0 = j-t; - double Z0 = k-t; - double x0 = xin-X0; // The x,y,z distances from the cell origin - double y0 = yin-Y0; - double z0 = zin-Z0; - // For the 3D case, the simplex shape is a slightly irregular tetrahedron. - // Determine which simplex we are in. - int i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords - int i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords - if(x0>=y0) { - if(y0>=z0) - { i1=1; j1=0; k1=0; i2=1; j2=1; k2=0; } // X Y Z order - else if(x0>=z0) { i1=1; j1=0; k1=0; i2=1; j2=0; k2=1; } // X Z Y order - else { i1=0; j1=0; k1=1; i2=1; j2=0; k2=1; } // Z X Y order - } - else { // x0 y0) { + i1 = 1; + j1 = 0; + } // lower triangle, XY order: (0,0)->(1,0)->(1,1) + else { + i1 = 0; + j1 = 1; + } // upper triangle, YX order: (0,0)->(0,1)->(1,1) + // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and + // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where + // c = (3-sqrt(3))/6 + double x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords + double y1 = y0 - j1 + G2; + double x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords + double y2 = y0 - 1.0 + 2.0 * G2; + // Work out the hashed gradient indices of the three simplex corners + int ii = i & 255; + int jj = j & 255; + int gi0 = permMod12[ii + perm[jj]]; + int gi1 = permMod12[ii + i1 + perm[jj + j1]]; + int gi2 = permMod12[ii + 1 + perm[jj + 1]]; + // Calculate the contribution from the three corners + double t0 = 0.5 - x0 * x0 - y0 * y0; + if (t0 < 0) n0 = 0.0; + else { + t0 *= t0; + n0 = t0 * t0 * dot(grad3[gi0], x0, y0); // (x,y) of grad3 used for 2D gradient + } + double t1 = 0.5 - x1 * x1 - y1 * y1; + if (t1 < 0) n1 = 0.0; + else { + t1 *= t1; + n1 = t1 * t1 * dot(grad3[gi1], x1, y1); + } + double t2 = 0.5 - x2 * x2 - y2 * y2; + if (t2 < 0) n2 = 0.0; + else { + t2 *= t2; + n2 = t2 * t2 * dot(grad3[gi2], x2, y2); + } + // Add contributions from each corner to get the final noise value. + // The result is scaled to return values in the interval [-1,1]. + return 70.0 * (n0 + n1 + n2); } - // Add contributions from each corner to get the final noise value. - // The result is scaled to stay just inside [-1,1] - return 32.0*(n0 + n1 + n2 + n3); - } + // 3D simplex noise + public static double noise(double xin, double yin, double zin) { + double n0, n1, n2, n3; // Noise contributions from the four corners + // Skew the input space to determine which simplex cell we're in + double s = (xin + yin + zin) * F3; // Very nice and simple skew factor for 3D + int i = fastfloor(xin + s); + int j = fastfloor(yin + s); + int k = fastfloor(zin + s); + double t = (i + j + k) * G3; + double X0 = i - t; // Unskew the cell origin back to (x,y,z) space + double Y0 = j - t; + double Z0 = k - t; + double x0 = xin - X0; // The x,y,z distances from the cell origin + double y0 = yin - Y0; + double z0 = zin - Z0; + // For the 3D case, the simplex shape is a slightly irregular tetrahedron. + // Determine which simplex we are in. + int i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords + int i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords + if (x0 >= y0) { + if (y0 >= z0) { + i1 = 1; + j1 = 0; + k1 = 0; + i2 = 1; + j2 = 1; + k2 = 0; + } // X Y Z order + else if (x0 >= z0) { + i1 = 1; + j1 = 0; + k1 = 0; + i2 = 1; + j2 = 0; + k2 = 1; + } // X Z Y order + else { + i1 = 0; + j1 = 0; + k1 = 1; + i2 = 1; + j2 = 0; + k2 = 1; + } // Z X Y order + } else { // x0 y0) rankx++; else ranky++; - if(x0 > z0) rankx++; else rankz++; - if(x0 > w0) rankx++; else rankw++; - if(y0 > z0) ranky++; else rankz++; - if(y0 > w0) ranky++; else rankw++; - if(z0 > w0) rankz++; else rankw++; - int i1, j1, k1, l1; // The integer offsets for the second simplex corner - int i2, j2, k2, l2; // The integer offsets for the third simplex corner - int i3, j3, k3, l3; // The integer offsets for the fourth simplex corner - // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order. - // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0; - j1 = ranky >= 3 ? 1 : 0; - k1 = rankz >= 3 ? 1 : 0; - l1 = rankw >= 3 ? 1 : 0; - // Rank 2 denotes the second largest coordinate. - i2 = rankx >= 2 ? 1 : 0; - j2 = ranky >= 2 ? 1 : 0; - k2 = rankz >= 2 ? 1 : 0; - l2 = rankw >= 2 ? 1 : 0; - // Rank 1 denotes the second smallest coordinate. - i3 = rankx >= 1 ? 1 : 0; - j3 = ranky >= 1 ? 1 : 0; - k3 = rankz >= 1 ? 1 : 0; - l3 = rankw >= 1 ? 1 : 0; - // The fifth corner has all coordinate offsets = 1, so no need to compute that. - double x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords - double y1 = y0 - j1 + G4; - double z1 = z0 - k1 + G4; - double w1 = w0 - l1 + G4; - double x2 = x0 - i2 + 2.0*G4; // Offsets for third corner in (x,y,z,w) coords - double y2 = y0 - j2 + 2.0*G4; - double z2 = z0 - k2 + 2.0*G4; - double w2 = w0 - l2 + 2.0*G4; - double x3 = x0 - i3 + 3.0*G4; // Offsets for fourth corner in (x,y,z,w) coords - double y3 = y0 - j3 + 3.0*G4; - double z3 = z0 - k3 + 3.0*G4; - double w3 = w0 - l3 + 3.0*G4; - double x4 = x0 - 1.0 + 4.0*G4; // Offsets for last corner in (x,y,z,w) coords - double y4 = y0 - 1.0 + 4.0*G4; - double z4 = z0 - 1.0 + 4.0*G4; - double w4 = w0 - 1.0 + 4.0*G4; - // Work out the hashed gradient indices of the five simplex corners - int ii = i & 255; - int jj = j & 255; - int kk = k & 255; - int ll = l & 255; - int gi0 = perm[ii+perm[jj+perm[kk+perm[ll]]]] % 32; - int gi1 = perm[ii+i1+perm[jj+j1+perm[kk+k1+perm[ll+l1]]]] % 32; - int gi2 = perm[ii+i2+perm[jj+j2+perm[kk+k2+perm[ll+l2]]]] % 32; - int gi3 = perm[ii+i3+perm[jj+j3+perm[kk+k3+perm[ll+l3]]]] % 32; - int gi4 = perm[ii+1+perm[jj+1+perm[kk+1+perm[ll+1]]]] % 32; - // Calculate the contribution from the five corners - double t0 = 0.6 - x0*x0 - y0*y0 - z0*z0 - w0*w0; - if(t0<0) n0 = 0.0; - else { - t0 *= t0; - n0 = t0 * t0 * dot(grad4[gi0], x0, y0, z0, w0); - } - double t1 = 0.6 - x1*x1 - y1*y1 - z1*z1 - w1*w1; - if(t1<0) n1 = 0.0; - else { - t1 *= t1; - n1 = t1 * t1 * dot(grad4[gi1], x1, y1, z1, w1); + double n0, n1, n2, n3, n4; // Noise contributions from the five corners + // Skew the (x,y,z,w) space to determine which cell of 24 simplices we're in + double s = (x + y + z + w) * F4; // Factor for 4D skewing + int i = fastfloor(x + s); + int j = fastfloor(y + s); + int k = fastfloor(z + s); + int l = fastfloor(w + s); + double t = (i + j + k + l) * G4; // Factor for 4D unskewing + double X0 = i - t; // Unskew the cell origin back to (x,y,z,w) space + double Y0 = j - t; + double Z0 = k - t; + double W0 = l - t; + double x0 = x - X0; // The x,y,z,w distances from the cell origin + double y0 = y - Y0; + double z0 = z - Z0; + double w0 = w - W0; + // For the 4D case, the simplex is a 4D shape I won't even try to describe. + // To find out which of the 24 possible simplices we're in, we need to + // determine the magnitude ordering of x0, y0, z0 and w0. + // Six pair-wise comparisons are performed between each possible pair + // of the four coordinates, and the results are used to rank the numbers. + int rankx = 0; + int ranky = 0; + int rankz = 0; + int rankw = 0; + if (x0 > y0) rankx++; + else ranky++; + if (x0 > z0) rankx++; + else rankz++; + if (x0 > w0) rankx++; + else rankw++; + if (y0 > z0) ranky++; + else rankz++; + if (y0 > w0) ranky++; + else rankw++; + if (z0 > w0) rankz++; + else rankw++; + int i1, j1, k1, l1; // The integer offsets for the second simplex corner + int i2, j2, k2, l2; // The integer offsets for the third simplex corner + int i3, j3, k3, l3; // The integer offsets for the fourth simplex corner + // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order. + // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0; + j1 = ranky >= 3 ? 1 : 0; + k1 = rankz >= 3 ? 1 : 0; + l1 = rankw >= 3 ? 1 : 0; + // Rank 2 denotes the second largest coordinate. + i2 = rankx >= 2 ? 1 : 0; + j2 = ranky >= 2 ? 1 : 0; + k2 = rankz >= 2 ? 1 : 0; + l2 = rankw >= 2 ? 1 : 0; + // Rank 1 denotes the second smallest coordinate. + i3 = rankx >= 1 ? 1 : 0; + j3 = ranky >= 1 ? 1 : 0; + k3 = rankz >= 1 ? 1 : 0; + l3 = rankw >= 1 ? 1 : 0; + // The fifth corner has all coordinate offsets = 1, so no need to compute that. + double x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords + double y1 = y0 - j1 + G4; + double z1 = z0 - k1 + G4; + double w1 = w0 - l1 + G4; + double x2 = x0 - i2 + 2.0 * G4; // Offsets for third corner in (x,y,z,w) coords + double y2 = y0 - j2 + 2.0 * G4; + double z2 = z0 - k2 + 2.0 * G4; + double w2 = w0 - l2 + 2.0 * G4; + double x3 = x0 - i3 + 3.0 * G4; // Offsets for fourth corner in (x,y,z,w) coords + double y3 = y0 - j3 + 3.0 * G4; + double z3 = z0 - k3 + 3.0 * G4; + double w3 = w0 - l3 + 3.0 * G4; + double x4 = x0 - 1.0 + 4.0 * G4; // Offsets for last corner in (x,y,z,w) coords + double y4 = y0 - 1.0 + 4.0 * G4; + double z4 = z0 - 1.0 + 4.0 * G4; + double w4 = w0 - 1.0 + 4.0 * G4; + // Work out the hashed gradient indices of the five simplex corners + int ii = i & 255; + int jj = j & 255; + int kk = k & 255; + int ll = l & 255; + int gi0 = perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32; + int gi1 = perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32; + int gi2 = perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32; + int gi3 = perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32; + int gi4 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32; + // Calculate the contribution from the five corners + double t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0; + if (t0 < 0) n0 = 0.0; + else { + t0 *= t0; + n0 = t0 * t0 * dot(grad4[gi0], x0, y0, z0, w0); + } + double t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1; + if (t1 < 0) n1 = 0.0; + else { + t1 *= t1; + n1 = t1 * t1 * dot(grad4[gi1], x1, y1, z1, w1); + } + double t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2; + if (t2 < 0) n2 = 0.0; + else { + t2 *= t2; + n2 = t2 * t2 * dot(grad4[gi2], x2, y2, z2, w2); + } + double t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3; + if (t3 < 0) n3 = 0.0; + else { + t3 *= t3; + n3 = t3 * t3 * dot(grad4[gi3], x3, y3, z3, w3); + } + double t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4; + if (t4 < 0) n4 = 0.0; + else { + t4 *= t4; + n4 = t4 * t4 * dot(grad4[gi4], x4, y4, z4, w4); + } + // Sum up and scale the result to cover the range [-1,1] + return 27.0 * (n0 + n1 + n2 + n3 + n4); } - double t2 = 0.6 - x2*x2 - y2*y2 - z2*z2 - w2*w2; - if(t2<0) n2 = 0.0; - else { - t2 *= t2; - n2 = t2 * t2 * dot(grad4[gi2], x2, y2, z2, w2); - } - double t3 = 0.6 - x3*x3 - y3*y3 - z3*z3 - w3*w3; - if(t3<0) n3 = 0.0; - else { - t3 *= t3; - n3 = t3 * t3 * dot(grad4[gi3], x3, y3, z3, w3); - } - double t4 = 0.6 - x4*x4 - y4*y4 - z4*z4 - w4*w4; - if(t4<0) n4 = 0.0; - else { - t4 *= t4; - n4 = t4 * t4 * dot(grad4[gi4], x4, y4, z4, w4); - } - // Sum up and scale the result to cover the range [-1,1] - return 27.0 * (n0 + n1 + n2 + n3 + n4); - } - // Inner class to speed upp gradient computations - // (array access is a lot slower than member access) - private static class Grad - { - double x, y, z, w; + // Inner class to speed upp gradient computations + // (array access is a lot slower than member access) + private static class Grad { + double x, y, z, w; - Grad(double x, double y, double z) - { - this.x = x; - this.y = y; - this.z = z; - } + Grad(double x, double y, double z) { + this.x = x; + this.y = y; + this.z = z; + } - Grad(double x, double y, double z, double w) - { - this.x = x; - this.y = y; - this.z = z; - this.w = w; + Grad(double x, double y, double z, double w) { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } } - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java index 3ea9983d80..2ccc22d1dd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java @@ -27,7 +27,7 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -public class NonNullWrappedHashMap extends HashMap { +public class NonNullWrappedHashMap extends HashMap { private V defaultValue; @@ -57,6 +57,7 @@ public class NonNullWrappedHashMap extends HashMap { @Override public V getOrDefault(Object key, V defaultValue) { - return Objects.requireNonNull(Optional.ofNullable(super.getOrDefault(key, defaultValue)).orElse(this.defaultValue)); + return Objects.requireNonNull( + Optional.ofNullable(super.getOrDefault(key, defaultValue)).orElse(this.defaultValue)); } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java index f7ed76278e..cb677be388 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java @@ -45,16 +45,14 @@ public class NonNullWrappedHashSet extends HashSet { } public boolean add(E e) { - if (e != null) - return super.add(e); + if (e != null) return super.add(e); return false; } public boolean addAll(Collection c) { boolean wasChanged = false; for (E element : c) { - if (element != null) - wasChanged |= this.add(element); + if (element != null) wasChanged |= this.add(element); } return wasChanged; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java index a64793676c..0ebb5a4c37 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java @@ -30,7 +30,6 @@ import java.util.Map; public class Pair implements Map.Entry { Object[] pair = new Object[2]; - public Pair(Object[] pair) { this.pair = pair; } @@ -53,7 +52,14 @@ public class Pair implements Map.Entry { @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(8).putInt(pair[0].hashCode()).putInt(pair[1].hashCode()).array(), 0, 8, 31); + return MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(8) + .putInt(pair[0].hashCode()) + .putInt(pair[1].hashCode()) + .array(), + 0, + 8, + 31); } @Override @@ -72,11 +78,11 @@ public class Pair implements Map.Entry { return (B) pair[1]; } - public Pair copyWithNewValue(B value){ - return new Pair<>((A)this.pair[0],value); + public Pair copyWithNewValue(B value) { + return new Pair<>((A) this.pair[0], value); } - public Pair replaceValue(B value){ + public Pair replaceValue(B value) { this.setValue(value); return this; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java index 50f5f4f685..daa9994053 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java @@ -3,19 +3,17 @@ package com.github.bartimaeusnek.bartworks.util; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; /** * Handle the parallel more efficient. * * @author GlodBlock */ - public class RecipeFinderForParallel { /** @@ -29,7 +27,8 @@ public class RecipeFinderForParallel { * @param aMaxParallel The max parallel that it can reach * @return The parallel that it can reach */ - public static int handleParallelRecipe(GT_Recipe aRecipe, FluidStack[] aFluidInputs, ItemStack[] aItemStacks, int aMaxParallel) { + public static int handleParallelRecipe( + GT_Recipe aRecipe, FluidStack[] aFluidInputs, ItemStack[] aItemStacks, int aMaxParallel) { if (aFluidInputs == null) aFluidInputs = new FluidStack[0]; if (aItemStacks == null) aItemStacks = new ItemStack[0]; HashMap tCompressedFluidInput = compressFluid(aFluidInputs); @@ -39,7 +38,8 @@ public class RecipeFinderForParallel { int tCurrentPara = aMaxParallel; for (int tFluid : tCompressedFluidRecipe.keySet()) { if (tCompressedFluidInput.containsKey(tFluid) && tCompressedFluidRecipe.get(tFluid) != 0) { - tCurrentPara = Math.min(tCurrentPara, tCompressedFluidInput.get(tFluid) / tCompressedFluidRecipe.get(tFluid)); + tCurrentPara = + Math.min(tCurrentPara, tCompressedFluidInput.get(tFluid) / tCompressedFluidRecipe.get(tFluid)); } } for (int tItem : tCompressedItemRecipe.keySet()) { @@ -52,8 +52,7 @@ public class RecipeFinderForParallel { } } tCurrentPara = Math.min(tCurrentPara, tCountWildcard / tCompressedItemRecipe.get(tItem)); - } - else if (tCompressedItemRecipe.get(tItem) != 0) { + } else if (tCompressedItemRecipe.get(tItem) != 0) { /*OreDict Stuff*/ int tCountOre = 0; ItemStack tRealRecipe = GT_Utility.intToStack(tItem); @@ -81,9 +80,9 @@ public class RecipeFinderForParallel { if (tFluid.amount >= tCompressedFluidRecipe.get(tFluid.getFluidID())) { tFluid.amount -= tCompressedFluidRecipe.get(tFluid.getFluidID()); tCompressedFluidRecipe.remove(tFluid.getFluidID()); - } - else { - tCompressedFluidRecipe.put(tFluid.getFluidID(), tCompressedFluidRecipe.get(tFluid.getFluidID()) - tFluid.amount); + } else { + tCompressedFluidRecipe.put( + tFluid.getFluidID(), tCompressedFluidRecipe.get(tFluid.getFluidID()) - tFluid.amount); tFluid.amount = 0; } } @@ -91,7 +90,7 @@ public class RecipeFinderForParallel { /*OreDict Stuff*/ /*Wildcard Stuff*/ - for (Iterator i = tCompressedItemRecipe.keySet().iterator(); i.hasNext();) { + for (Iterator i = tCompressedItemRecipe.keySet().iterator(); i.hasNext(); ) { int tItem = i.next(); if (tItem >> 16 == Short.MAX_VALUE) { for (ItemStack tInputItem : aItemStacks) { @@ -101,15 +100,13 @@ public class RecipeFinderForParallel { tInputItem.stackSize -= tCompressedItemRecipe.get(tItem); i.remove(); break; - } - else { + } else { tCompressedItemRecipe.put(tItem, tCompressedItemRecipe.get(tItem) - tInputItem.stackSize); tInputItem.stackSize = 0; } } } - } - else { + } else { ItemStack tRealRecipe = GT_Utility.intToStack(tItem); int tTargetAmount = tCompressedItemRecipe.get(tItem); for (ItemStack input : aItemStacks) { @@ -140,8 +137,7 @@ public class RecipeFinderForParallel { public static Pair, ArrayList> getMultiOutput(GT_Recipe aRecipe, int aPall) { ArrayList tFluidList = new ArrayList<>(); ArrayList tItemList = new ArrayList<>(); - if (aRecipe == null) - return new Pair<>(tFluidList, tItemList); + if (aRecipe == null) return new Pair<>(tFluidList, tItemList); if (aRecipe.mFluidOutputs != null && aRecipe.mFluidOutputs.length > 0) { for (FluidStack tFluid : aRecipe.mFluidOutputs) { if (tFluid != null && tFluid.amount > 0) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java index 9083ee468f..b1d1bac0d1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java @@ -23,15 +23,14 @@ package com.github.bartimaeusnek.bartworks.util; import gregtech.api.util.GT_Recipe; - import java.util.Optional; import java.util.function.Predicate; public class StreamUtils { - private StreamUtils(){} + private StreamUtils() {} public static Predicate filterVisualMaps() { - return gt_recipe_map -> { + return gt_recipe_map -> { Optional op = gt_recipe_map.mRecipeList.stream().findAny(); return op.isPresent() && !op.get().mFakeRecipe; }; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java index 4529aa5202..22e2a4e719 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java @@ -22,9 +22,8 @@ package com.github.bartimaeusnek.bartworks.util.accessprioritylist; -import org.apache.commons.lang3.NotImplementedException; - import java.util.*; +import org.apache.commons.lang3.NotImplementedException; @SuppressWarnings("ALL") public class AccessPriorityList implements List, Deque, Set { @@ -37,18 +36,15 @@ public class AccessPriorityList implements List, Deque, Set { return new AccessPriorityList(); } - public AccessPriorityList() { - } + public AccessPriorityList() {} @Override public void addFirst(E t) { final AccessPriorityListNode first = head; final AccessPriorityListNode newNode = new AccessPriorityListNode<>(null, t, first); head = newNode; - if (first == null) - tail = newNode; - else - first.setBefore(newNode); + if (first == null) tail = newNode; + else first.setBefore(newNode); size++; } @@ -57,10 +53,8 @@ public class AccessPriorityList implements List, Deque, Set { final AccessPriorityListNode last = tail; final AccessPriorityListNode newNode = new AccessPriorityListNode<>(last, t, null); tail = newNode; - if (last == null) - head = newNode; - else - last.setNext(newNode); + if (last == null) head = newNode; + else last.setNext(newNode); size++; } @@ -162,7 +156,6 @@ public class AccessPriorityList implements List, Deque, Set { return new AccessPriorityListIterators.AccessPriorityListNodeIterator<>(head); } - @Override public Iterator descendingIterator() { return new AccessPriorityListIterators.AccessPriorityListReverseIterator<>(tail); @@ -172,8 +165,7 @@ public class AccessPriorityList implements List, Deque, Set { public Object[] toArray() { Object[] ret = new Object[size]; int index = 0; - for (Iterator it = iterator(); it.hasNext(); index++) - ret[index] = it.next(); + for (Iterator it = iterator(); it.hasNext(); index++) ret[index] = it.next(); return ret; } @@ -181,8 +173,7 @@ public class AccessPriorityList implements List, Deque, Set { public T[] toArray(T[] a) { T[] ret = (T[]) new Object[size]; int index = 0; - for (Iterator it = (Iterator) iterator(); it.hasNext(); index++) - ret[index] = it.next(); + for (Iterator it = (Iterator) iterator(); it.hasNext(); index++) ret[index] = it.next(); return ret; } @@ -193,8 +184,7 @@ public class AccessPriorityList implements List, Deque, Set { } private void moveNodeUp(AccessPriorityListNode node) { - if (node == head || node.getBefore() == null) - return; + if (node == head || node.getBefore() == null) return; final AccessPriorityListNode before = node.getBefore(); final AccessPriorityListNode beforeBefore = before.getBefore(); final AccessPriorityListNode next = node.getNext(); @@ -204,10 +194,8 @@ public class AccessPriorityList implements List, Deque, Set { node.setBefore(beforeBefore); // <0,1,2> <1,2,3> N<0,3,4> <3,4,5> - if (beforeBefore != null) - beforeBefore.setNext(node); - else - head = node; + if (beforeBefore != null) beforeBefore.setNext(node); + else head = node; // <0,1,3> <1,2,3> N<0,3,4> <3,4,5> before.setBefore(node); @@ -216,10 +204,8 @@ public class AccessPriorityList implements List, Deque, Set { before.setNext(next); // <0,1,3> <3,2,4> N<0,3,4> <3,4,5> - if (next != null) - next.setBefore(before); - else - tail = before; + if (next != null) next.setBefore(before); + else tail = before; // <0,1,3> N<0,3,4> <3,2,4> <2,4,5> node.setNext(before); @@ -229,13 +215,11 @@ public class AccessPriorityList implements List, Deque, Set { AccessPriorityListNode getNode(int index) { if (index <= (size / 2)) { AccessPriorityListNode x = head; - for (int i = 0; i < index; i++) - x = x.getNext(); + for (int i = 0; i < index; i++) x = x.getNext(); return x; } else { AccessPriorityListNode x = tail; - for (int i = size - 1; i > index; i--) - x = x.getBefore(); + for (int i = size - 1; i > index; i--) x = x.getBefore(); return x; } } @@ -246,8 +230,7 @@ public class AccessPriorityList implements List, Deque, Set { } private boolean isValidIndex(int index) { - if (index >= 0 && index < size) - return true; + if (index >= 0 && index < size) return true; throw new ArrayIndexOutOfBoundsException("NOT A VAILD INDEX!"); } @@ -283,10 +266,10 @@ public class AccessPriorityList implements List, Deque, Set { @Override public boolean remove(Object o) { -// Object p; -// for (Iterator it = this.iterator(); it.hasNext(); o.equals(p)){ -// p = it.next(); -// } + // Object p; + // for (Iterator it = this.iterator(); it.hasNext(); o.equals(p)){ + // p = it.next(); + // } throw new NotImplementedException(""); } @@ -297,8 +280,7 @@ public class AccessPriorityList implements List, Deque, Set { @Override public boolean addAll(Collection c) { - if (c == null) - return false; + if (c == null) return false; c.forEach(this::addLast); return true; } @@ -338,20 +320,19 @@ public class AccessPriorityList implements List, Deque, Set { addPrioToNode(node, 1L); } - public void addPrioToNode(AccessPriorityListNode node, long prio){ + public void addPrioToNode(AccessPriorityListNode node, long prio) { long current = node.getPriority(); if (current == Long.MAX_VALUE || (current > 0 && prio > 0 && prio + current < 0)) node.setPriority(Long.MAX_VALUE); - else - node.setPriority(current + prio); - while (node.getBefore() != null && node.getPriority() >= node.getBefore().getPriority()) { + else node.setPriority(current + prio); + while (node.getBefore() != null + && node.getPriority() >= node.getBefore().getPriority()) { moveNodeUp(node); } } public void addPrioToNode(int index, long prio) { - if (!isValidIndex(index)) - return; + if (!isValidIndex(index)) return; AccessPriorityListNode node = getNode(index); addPrioToNode(node, prio); } @@ -362,8 +343,7 @@ public class AccessPriorityList implements List, Deque, Set { @Override public E get(int index) { - if (!isValidIndex(index)) - return null; + if (!isValidIndex(index)) return null; AccessPriorityListNode node = getNode(index); return node.getELEMENT(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java index ec842ede30..4e423b0654 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java @@ -22,21 +22,21 @@ package com.github.bartimaeusnek.bartworks.util.accessprioritylist; -import org.apache.commons.lang3.NotImplementedException; - import java.util.Iterator; import java.util.ListIterator; +import org.apache.commons.lang3.NotImplementedException; public class AccessPriorityListIterators { - public static class AccessPriorityListListIterator implements ListIterator { final AccessPriorityListNode head; final AccessPriorityListNode tail; AccessPriorityListNode current; int counter = 0; boolean reverse; - public AccessPriorityListListIterator(AccessPriorityListNode head, AccessPriorityListNode tail, boolean reverse) { + + public AccessPriorityListListIterator( + AccessPriorityListNode head, AccessPriorityListNode tail, boolean reverse) { this.head = head; this.tail = tail; current = reverse ? tail : head; @@ -78,12 +78,12 @@ public class AccessPriorityListIterators { @Override public int nextIndex() { - return counter+1; + return counter + 1; } @Override public int previousIndex() { - return counter-1; + return counter - 1; } @Override @@ -105,6 +105,7 @@ public class AccessPriorityListIterators { public static class AccessPriorityListIterator implements Iterator { final AccessPriorityListNode head; AccessPriorityListNode current; + public AccessPriorityListIterator(AccessPriorityListNode head) { this.head = this.current = head; } @@ -146,6 +147,7 @@ public class AccessPriorityListIterators { public static class AccessPriorityListNodeIterator implements Iterator> { final AccessPriorityListNode head; AccessPriorityListNode current; + public AccessPriorityListNodeIterator(AccessPriorityListNode head) { this.head = this.current = head; } @@ -162,5 +164,4 @@ public class AccessPriorityListIterators { return ret; } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java index 3c0a037a88..1abeeb6e45 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java @@ -24,7 +24,7 @@ package com.github.bartimaeusnek.bartworks.util.accessprioritylist; public class AccessPriorityListNode { - public final static AccessPriorityListNode EMPTY_NODE = new AccessPriorityListNode(null); + public static final AccessPriorityListNode EMPTY_NODE = new AccessPriorityListNode(null); private final E ELEMENT; private long priority = Long.MIN_VALUE; @@ -40,7 +40,7 @@ public class AccessPriorityListNode { connect(next, before); } - public void connect(AccessPriorityListNode next, AccessPriorityListNode before){ + public void connect(AccessPriorityListNode next, AccessPriorityListNode before) { this.setNext(next); this.setBefore(before); } @@ -73,7 +73,7 @@ public class AccessPriorityListNode { this.before = before; } - void destroy(){ + void destroy() { this.before = null; this.next = null; this.priority = 0L; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java index 3a43bba536..5fd9dac817 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java @@ -106,9 +106,7 @@ public class FlowerSet implements Set { } @Override - public void clear() { - - } + public void clear() {} static class FlowerNode { private final FlowerSet map; @@ -124,19 +122,14 @@ public class FlowerSet implements Set { private static final int DEPTH = 20480; public void TryToSetSingleNode(FlowerNode node, FlowerNode toset, int place, int depth) { - if (depth > DEPTH) - throw new IllegalStateException("Recursive Call went too deep."); - if (node.links[place] == null) - node.links[place] = toset; - else - TryToSetSingleNode(node.links[place], toset, place, depth++); + if (depth > DEPTH) throw new IllegalStateException("Recursive Call went too deep."); + if (node.links[place] == null) node.links[place] = toset; + else TryToSetSingleNode(node.links[place], toset, place, depth++); } public void TryToSetSingleNode(FlowerNode node, FlowerNode toset, int place) { - if (node.links[place] == null) - node.links[place] = toset; - else - TryToSetSingleNode(node.links[place], toset, place, 0); + if (node.links[place] == null) node.links[place] = toset; + else TryToSetSingleNode(node.links[place], toset, place, 0); } @SafeVarargs @@ -153,5 +146,4 @@ public class FlowerSet implements Set { return function -> function.hashCode() % function.map.petals; } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java index 1009ed4bc1..a52491c353 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java @@ -23,7 +23,6 @@ package com.github.bartimaeusnek.bartworks.util.log; import cpw.mods.fml.common.event.FMLPreInitializationEvent; - import java.io.File; import java.io.IOException; import java.text.SimpleDateFormat; @@ -40,9 +39,10 @@ public class DebugLog { private static Logger utilLog; public static void initDebugLog(FMLPreInitializationEvent event) throws IOException { - if (DebugLog.init) - return; - DebugLog.fh = new FileHandler(new File(new File(event.getModConfigurationDirectory().getParentFile(),"logs"),"BWLog.log").toString()); + if (DebugLog.init) return; + DebugLog.fh = new FileHandler( + new File(new File(event.getModConfigurationDirectory().getParentFile(), "logs"), "BWLog.log") + .toString()); DebugLog.utilLog = Logger.getLogger("DebugLog"); DebugLog.utilLog.setUseParentHandlers(false); DebugLog.utilLog.addHandler(DebugLog.fh); @@ -53,7 +53,7 @@ public class DebugLog { Calendar cal = new GregorianCalendar(); cal.setTimeInMillis(record.getMillis()); return "Level: " + record.getLevel() - +" at " + logTime.format(cal.getTime()) + + " at " + logTime.format(cal.getTime()) + " " + record.getMessage() + "\n"; } }; @@ -61,9 +61,8 @@ public class DebugLog { DebugLog.init = true; } - public static void log(String record){ - if (!DebugLog.init) - return; + public static void log(String record) { + if (!DebugLog.init) return; DebugLog.utilLog.info(record); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java index a8fd428baa..0e846834ca 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java @@ -23,4 +23,4 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.API_REFERENCE; -import cpw.mods.fml.common.API; \ No newline at end of file +import cpw.mods.fml.common.API; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 7f0a8ef426..a37db6b509 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -33,27 +33,25 @@ import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; +import java.io.StringReader; import net.minecraft.util.StringTranslate; import org.apache.commons.io.input.ReaderInputStream; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.io.StringReader; - @Mod( - modid = BartWorksCrossmod.MOD_ID, - name = BartWorksCrossmod.NAME, - version = BartWorksCrossmod.VERSION, - dependencies = "required-after:IC2; " - + "required-after:gregtech; " - + "required-after:bartworks;" - + "after:GalacticraftMars; " - + "after:GalacticraftCore; " - + "after:Micdoodlecore; " - + "after:miscutils; " - + "after:EMT; " - + "after:tectech; " -) + modid = BartWorksCrossmod.MOD_ID, + name = BartWorksCrossmod.NAME, + version = BartWorksCrossmod.VERSION, + dependencies = "required-after:IC2; " + + "required-after:gregtech; " + + "required-after:bartworks;" + + "after:GalacticraftMars; " + + "after:GalacticraftCore; " + + "after:Micdoodlecore; " + + "after:miscutils; " + + "after:EMT; " + + "after:tectech; ") public class BartWorksCrossmod { public static final String NAME = "BartWorks Mod Additions"; public static final String VERSION = MainMod.VERSION; @@ -65,53 +63,46 @@ public class BartWorksCrossmod { @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { -// if (LoaderReference.appliedenergistics2) -// new ItemSingleItemStorageCell("singleItemStorageCell"); - if (LoaderReference.GalacticraftCore) - GalacticraftProxy.preInit(preinit); - if (LoaderReference.Thaumcraft) - new CustomAspects(); + // if (LoaderReference.appliedenergistics2) + // new ItemSingleItemStorageCell("singleItemStorageCell"); + if (LoaderReference.GalacticraftCore) GalacticraftProxy.preInit(preinit); + if (LoaderReference.Thaumcraft) new CustomAspects(); } @Mod.EventHandler public void init(FMLInitializationEvent init) { - if (LoaderReference.GalacticraftCore) - GalacticraftProxy.init(init); + if (LoaderReference.GalacticraftCore) GalacticraftProxy.init(init); } @Mod.EventHandler public void postInit(FMLPostInitializationEvent init) { - if (LoaderReference.GalacticraftCore) - GalacticraftProxy.postInit(init); - if (LoaderReference.miscutils) - RadioHatchCompat.run(); - if (LoaderReference.tectech) - TecTechResearchLoader.runResearches(); + if (LoaderReference.GalacticraftCore) GalacticraftProxy.postInit(init); + if (LoaderReference.miscutils) RadioHatchCompat.run(); + if (LoaderReference.tectech) TecTechResearchLoader.runResearches(); } -// @Mod.EventHandler -// public void onFMLMissingMappingsEvent(FMLMissingMappingsEvent event){ -// for (FMLMissingMappingsEvent.MissingMapping mapping : event.getAll()){ -// if (mapping.name.equalsIgnoreCase()) -// } -// } - + // @Mod.EventHandler + // public void onFMLMissingMappingsEvent(FMLMissingMappingsEvent event){ + // for (FMLMissingMappingsEvent.MissingMapping mapping : event.getAll()){ + // if (mapping.name.equalsIgnoreCase()) + // } + // } -// @Mod.EventHandler -// public void onServerStarted(FMLServerStartedEvent event) { -// if (LoaderReference.EMT){ -// try { -// TCRecipeHandler.init(); -// } catch (IllegalAccessException | InvocationTargetException e) { -// e.printStackTrace(); -// } -// } -// } + // @Mod.EventHandler + // public void onServerStarted(FMLServerStartedEvent event) { + // if (LoaderReference.EMT){ + // try { + // TCRecipeHandler.init(); + // } catch (IllegalAccessException | InvocationTargetException e) { + // e.printStackTrace(); + // } + // } + // } @Mod.EventHandler public void onFMLServerStart(FMLServerStartingEvent event) { if (LoaderReference.miscutils) - for (Object s : RadioHatchCompat.TranslateSet){ + for (Object s : RadioHatchCompat.TranslateSet) { StringTranslate.inject(new ReaderInputStream(new StringReader((String) s))); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java index e362bdd5e4..14ebcb50cc 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java @@ -29,16 +29,16 @@ import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.registry.GameData; import cpw.mods.fml.common.registry.GameRegistry; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.util.*; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.RegistryNamespaced; import net.minecraftforge.oredict.OreDictionary; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.util.*; -@SuppressWarnings({"unchecked","rawtypes","unused"}) +@SuppressWarnings({"unchecked", "rawtypes", "unused"}) public class RadioHatchCompat { private static Class intf; @@ -63,7 +63,7 @@ public class RadioHatchCompat { public static HashSet TranslateSet = new HashSet<>(); - static{ + static { try { RadioHatchCompat.intf = Class.forName("gtPlusPlus.core.item.base.BaseItemComponent"); RadioHatchCompat.enu = Class.forName("gtPlusPlus.core.item.base.BaseItemComponent$ComponentTypes"); @@ -90,13 +90,10 @@ public class RadioHatchCompat { RadioHatchCompat.unlocalizedName.setAccessible(true); Object[] arr = RadioHatchCompat.enu.getEnumConstants(); - for (Object o : arr){ - if (RadioHatchCompat.rod != null && RadioHatchCompat.longRod != null) - break; - else if (o.toString().equalsIgnoreCase("ROD")) - RadioHatchCompat.rod = o; - else if (o.toString().equalsIgnoreCase("RODLONG")) - RadioHatchCompat.longRod = o; + for (Object o : arr) { + if (RadioHatchCompat.rod != null && RadioHatchCompat.longRod != null) break; + else if (o.toString().equalsIgnoreCase("ROD")) RadioHatchCompat.rod = o; + else if (o.toString().equalsIgnoreCase("RODLONG")) RadioHatchCompat.longRod = o; } } catch (NoSuchFieldException | ClassNotFoundException e) { @@ -115,59 +112,69 @@ public class RadioHatchCompat { cOwners.setAccessible(true); Field map = RegistryNamespaced.class.getDeclaredField("field_148758_b"); map.setAccessible(true); - Map UniqueIdentifierMap = (Map) map.get(GameData.getItemRegistry()); + Map UniqueIdentifierMap = (Map) map.get(GameData.getItemRegistry()); - Map ownerItems = (Map) cOwners.get(null); + Map ownerItems = + (Map) cOwners.get(null); ModContainer gtpp = null; ModContainer bartworks = null; - for (ModContainer container : Loader.instance().getModList()){ - if (gtpp != null && bartworks != null) - break; - else if (container.getModId().equalsIgnoreCase(BartWorksCrossmod.MOD_ID)) - bartworks=container; - else if (container.getModId().equalsIgnoreCase("miscutils")) - gtpp=container; + for (ModContainer container : Loader.instance().getModList()) { + if (gtpp != null && bartworks != null) break; + else if (container.getModId().equalsIgnoreCase(BartWorksCrossmod.MOD_ID)) bartworks = container; + else if (container.getModId().equalsIgnoreCase("miscutils")) gtpp = container; } - for (Object mats : (Set) RadioHatchCompat.materialClass.getField("mMaterialMap").get(null)) { + for (Object mats : (Set) + RadioHatchCompat.materialClass.getField("mMaterialMap").get(null)) { if (RadioHatchCompat.isRadioactive.getBoolean(mats)) { - if (OreDictionary.getOres("stick" + RadioHatchCompat.unlocalizedName.get(mats)).isEmpty()) { + if (OreDictionary.getOres("stick" + RadioHatchCompat.unlocalizedName.get(mats)) + .isEmpty()) { Item it = c1.newInstance(mats); - UniqueIdentifierMap.replace(it,"miscutils:"+it.getUnlocalizedName()); + UniqueIdentifierMap.replace(it, "miscutils:" + it.getUnlocalizedName()); GameRegistry.UniqueIdentifier ui = GameRegistry.findUniqueIdentifierFor(it); - ownerItems.replace(ui,bartworks,gtpp); + ownerItems.replace(ui, bartworks, gtpp); - String tanslate = it.getUnlocalizedName()+".name="+RadioHatchCompat.localizedName.get(mats)+" Rod"; + String tanslate = + it.getUnlocalizedName() + ".name=" + RadioHatchCompat.localizedName.get(mats) + " Rod"; RadioHatchCompat.TranslateSet.add(tanslate); DebugLog.log(tanslate); DebugLog.log("Generate: " + RadioHatchCompat.rod + RadioHatchCompat.unlocalizedName.get(mats)); } - if (OreDictionary.getOres("stickLong" + RadioHatchCompat.unlocalizedName.get(mats)).isEmpty()) { + if (OreDictionary.getOres("stickLong" + RadioHatchCompat.unlocalizedName.get(mats)) + .isEmpty()) { Item it2 = c2.newInstance(mats); - UniqueIdentifierMap.replace(it2,"miscutils:"+it2.getUnlocalizedName()); + UniqueIdentifierMap.replace(it2, "miscutils:" + it2.getUnlocalizedName()); GameRegistry.UniqueIdentifier ui2 = GameRegistry.findUniqueIdentifierFor(it2); - ownerItems.replace(ui2,bartworks,gtpp); + ownerItems.replace(ui2, bartworks, gtpp); - DebugLog.log("Generate: " + RadioHatchCompat.longRod + RadioHatchCompat.unlocalizedName.get(mats)); + DebugLog.log( + "Generate: " + RadioHatchCompat.longRod + RadioHatchCompat.unlocalizedName.get(mats)); } } } - } catch (NoSuchFieldException | IllegalAccessException | NoSuchMethodException | InvocationTargetException | InstantiationException | ClassNotFoundException e) { + } catch (NoSuchFieldException + | IllegalAccessException + | NoSuchMethodException + | InvocationTargetException + | InstantiationException + | ClassNotFoundException e) { e.printStackTrace(); } } - public static IRadMaterial GTppRadChecker(ItemStack lStack){ + public static IRadMaterial GTppRadChecker(ItemStack lStack) { try { - if (RadioHatchCompat.intf.isAssignableFrom(lStack.getItem().getClass())){ - if (!RadioHatchCompat.isRadioactive.getBoolean(RadioHatchCompat.f.get(lStack.getItem()))) - return null; - int amount = RadioHatchCompat.componentType.get(lStack.getItem()).equals(RadioHatchCompat.rod) ? 1 : RadioHatchCompat.componentType.get(lStack.getItem()).equals(RadioHatchCompat.longRod) ? 2 : 0; - if (amount == 0) - return null; + if (RadioHatchCompat.intf.isAssignableFrom(lStack.getItem().getClass())) { + if (!RadioHatchCompat.isRadioactive.getBoolean(RadioHatchCompat.f.get(lStack.getItem()))) return null; + int amount = RadioHatchCompat.componentType + .get(lStack.getItem()) + .equals(RadioHatchCompat.rod) + ? 1 + : RadioHatchCompat.componentType.get(lStack.getItem()).equals(RadioHatchCompat.longRod) ? 2 : 0; + if (amount == 0) return null; return new RadioHatchCompat.GTPPRadAdapter(amount, RadioHatchCompat.f.get(lStack.getItem())); } } catch (IllegalAccessException e) { @@ -176,9 +183,9 @@ public class RadioHatchCompat { return null; } - static class GTPPRadAdapter implements IRadMaterial{ + static class GTPPRadAdapter implements IRadMaterial { - static final HashMap BUFFER = new HashMap<>(); + static final HashMap BUFFER = new HashMap<>(); GTPPRadAdapter(Object m) { this.m = m; @@ -198,36 +205,36 @@ public class RadioHatchCompat { } private static boolean isElement(Object GTPPMaterial) throws IllegalAccessException { - return RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial).isEmpty(); + return RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial) + .isEmpty(); } private static List getElemets(Object GTPPMaterial) throws IllegalAccessException { ArrayList elements = new ArrayList(); Queue toCheck = new LinkedList(); ArrayList materialInputs = RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial); - if (materialInputs.isEmpty()) - return Collections.singletonList(GTPPMaterial); - for (Object materialStack : materialInputs){ + if (materialInputs.isEmpty()) return Collections.singletonList(GTPPMaterial); + for (Object materialStack : materialInputs) { if (!RadioHatchCompat.GTPPRadAdapter.isElement(RadioHatchCompat.stackMaterial.get(materialStack))) toCheck.add(RadioHatchCompat.stackMaterial.get(materialStack)); - else - elements.add(RadioHatchCompat.stackMaterial.get(materialStack)); + else elements.add(RadioHatchCompat.stackMaterial.get(materialStack)); } - while (!toCheck.isEmpty()){ + while (!toCheck.isEmpty()) { elements.addAll(GTPPRadAdapter.getElemets(toCheck.poll())); } return elements; } - private static Integer calulateRad(Object m){ + private static Integer calulateRad(Object m) { int ret = 0; try { List pureElements = RadioHatchCompat.GTPPRadAdapter.getElemets(m); for (Object materialObj : pureElements) if (RadioHatchCompat.isRadioactive.getBoolean(materialObj)) - ret += ((int) RadioHatchCompat.radlevel.getByte(m) + RadioHatchCompat.GTPPRadAdapter.clampToZero(RadioHatchCompat.protons.getLong(materialObj))); - else - ret += RadioHatchCompat.radlevel.getByte(m); + ret += ((int) RadioHatchCompat.radlevel.getByte(m) + + RadioHatchCompat.GTPPRadAdapter.clampToZero( + RadioHatchCompat.protons.getLong(materialObj))); + else ret += RadioHatchCompat.radlevel.getByte(m); } catch (IllegalAccessException e) { e.printStackTrace(); } @@ -236,10 +243,11 @@ public class RadioHatchCompat { @Override public int getRadiationLevel(ItemStack aStack) { - return RadioHatchCompat.GTPPRadAdapter.BUFFER.computeIfAbsent(this.m, radlvl -> RadioHatchCompat.GTPPRadAdapter.calulateRad(this.m)); + return RadioHatchCompat.GTPPRadAdapter.BUFFER.computeIfAbsent( + this.m, radlvl -> RadioHatchCompat.GTPPRadAdapter.calulateRad(this.m)); } - private static long clampToZero(long number){ + private static long clampToZero(long number) { return number > 0 ? number : 0; } @@ -250,7 +258,7 @@ public class RadioHatchCompat { @Override public short[] getColorForGUI(ItemStack aStack) { - short[] rgba = {0,0,0,0}; + short[] rgba = {0, 0, 0, 0}; try { rgba = (short[]) RadioHatchCompat.RGBA.get(this.m); } catch (IllegalAccessException e) { @@ -269,6 +277,5 @@ public class RadioHatchCompat { } return ret; } - } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java b/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java index af653781be..a9ac64b5fb 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java @@ -1,27 +1,27 @@ -//package com.github.bartimaeusnek.crossmod.ae2; -// -//import appeng.api.AEApi; -//import appeng.api.config.FuzzyMode; -//import appeng.api.config.IncludeExclude; -//import appeng.api.implementations.items.IStorageCell; -//import appeng.api.storage.*; -//import appeng.api.storage.data.IAEItemStack; -//import appeng.core.localization.GuiText; -//import appeng.items.contents.CellUpgrades; -//import appeng.util.Platform; -//import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; -//import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; -//import cpw.mods.fml.common.registry.GameRegistry; -//import cpw.mods.fml.relauncher.Side; -//import cpw.mods.fml.relauncher.SideOnly; -//import net.minecraft.entity.player.EntityPlayer; -//import net.minecraft.inventory.IInventory; -//import net.minecraft.item.Item; -//import net.minecraft.item.ItemStack; -// -//import java.util.List; -// -//public class ItemSingleItemStorageCell extends SimpleSubItemClass implements IStorageCell { +// package com.github.bartimaeusnek.crossmod.ae2; +// +// import appeng.api.AEApi; +// import appeng.api.config.FuzzyMode; +// import appeng.api.config.IncludeExclude; +// import appeng.api.implementations.items.IStorageCell; +// import appeng.api.storage.*; +// import appeng.api.storage.data.IAEItemStack; +// import appeng.core.localization.GuiText; +// import appeng.items.contents.CellUpgrades; +// import appeng.util.Platform; +// import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; +// import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +// import cpw.mods.fml.common.registry.GameRegistry; +// import cpw.mods.fml.relauncher.Side; +// import cpw.mods.fml.relauncher.SideOnly; +// import net.minecraft.entity.player.EntityPlayer; +// import net.minecraft.inventory.IInventory; +// import net.minecraft.item.Item; +// import net.minecraft.item.ItemStack; +// +// import java.util.List; +// +// public class ItemSingleItemStorageCell extends SimpleSubItemClass implements IStorageCell { // // public ItemSingleItemStorageCell(String tex) { // super(tex); @@ -32,15 +32,19 @@ // @Override // @SideOnly(Side.CLIENT) // public void addInformation(ItemStack stack, EntityPlayer p_77624_2_, List lines, boolean p_77624_4_) { -// IMEInventoryHandler inventory = AEApi.instance().registries().cell().getCellInventory(stack, (ISaveProvider)null, StorageChannel.ITEMS); +// IMEInventoryHandler inventory = AEApi.instance().registries().cell().getCellInventory(stack, +// (ISaveProvider)null, StorageChannel.ITEMS); // if (inventory instanceof ICellInventoryHandler) { // ICellInventoryHandler handler = (ICellInventoryHandler)inventory; // ICellInventory cellInventory = handler.getCellInv(); // if (cellInventory != null) { -// lines.add(cellInventory.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal()); -// lines.add(cellInventory.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalItemTypes() + ' ' + GuiText.Types.getLocal()); +// lines.add(cellInventory.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + +// cellInventory.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal()); +// lines.add(cellInventory.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' + +// cellInventory.getTotalItemTypes() + ' ' + GuiText.Types.getLocal()); // if (handler.isPreformatted()) { -// String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : GuiText.Excluded).getLocal(); +// String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : +// GuiText.Excluded).getLocal(); // if (handler.isFuzzy()) { // lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Fuzzy.getLocal()); // } else { @@ -119,4 +123,4 @@ // public void setFuzzyMode(ItemStack is, FuzzyMode fzMode) { // Platform.openNbtData(is).setString("FuzzyMode", fzMode.name()); // } -//} +// } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java index 13c4de03fb..134b541021 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java @@ -23,16 +23,14 @@ package com.github.bartimaeusnek.crossmod.cls; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; - import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Optional; -@SuppressWarnings({"rawtypes","unchecked"}) +@SuppressWarnings({"rawtypes", "unchecked"}) public class CLSCompat { - private CLSCompat() { - } + private CLSCompat() {} private static final long MINIMAL_UPDATE_INTERVAL = 1000 / 30; // target 30 fps private static long lastUpdate = 0; @@ -76,12 +74,10 @@ public class CLSCompat { e.printStackTrace(); } - if (Werkstoff.werkstoffHashSet.size() >= 100) - sizeStep = Werkstoff.werkstoffHashSet.size() / 100 - 1; - else - sizeStep = sizeStep2 = Werkstoff.werkstoffHashSet.size(); + if (Werkstoff.werkstoffHashSet.size() >= 100) sizeStep = Werkstoff.werkstoffHashSet.size() / 100 - 1; + else sizeStep = sizeStep2 = Werkstoff.werkstoffHashSet.size(); - return new Integer[]{sizeStep, sizeStep2, sizeStep}; + return new Integer[] {sizeStep, sizeStep2, sizeStep}; } public static int invokeStepSize(Werkstoff werkstoff, Integer[] steps, int size) { @@ -97,8 +93,7 @@ public class CLSCompat { lastUpdate = time; } - if (steps[0] == 0 && Werkstoff.werkstoffHashSet.size() >= 100) - steps[0] = steps[2]; + if (steps[0] == 0 && Werkstoff.werkstoffHashSet.size() >= 100) steps[0] = steps[2]; size += steps[1]; return size; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java index 7045e27bd1..fa3cf70882 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.crossmod.emt.recipe; +import static com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler.AspectAdder; + import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; @@ -33,30 +35,35 @@ import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; - import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; - -import static com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler.AspectAdder; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; @SuppressWarnings("ALL") public class TCRecipeHandler { - public static final GT_Recipe.GT_Recipe_Map alchemicalConstructHandler = new TCRecipeHandler.TCRecipeMap(new HashSet<>(15000), + public static final GT_Recipe.GT_Recipe_Map alchemicalConstructHandler = new TCRecipeHandler.TCRecipeMap( + new HashSet<>(15000), "bwcm.recipe.alchemicalConstruct", "Industrical Alchemical Construct", null, "gregtech:textures/gui/basicmachines/Default", - 2, 1, 2, 0, 1, - "", 1, "", true, true - ); + 2, + 1, + 2, + 0, + 1, + "", + 1, + "", + true, + true); static Class aCrucibleRecipeClass; static Class aThaumcraftAPI; static Field craftingRecipes; @@ -93,18 +100,18 @@ public class TCRecipeHandler { ArrayList tcCraftingList = (ArrayList) craftingRecipes.get(null); HashSet crucibleRecipes = new HashSet(); for (Object o : tcCraftingList) { - if (TCRecipeHandler.aCrucibleRecipeClass.isInstance(o)) - crucibleRecipes.add(o); + if (TCRecipeHandler.aCrucibleRecipeClass.isInstance(o)) crucibleRecipes.add(o); } TCRecipeHandler.convertCrucibleRecipesToGTRecipes(crucibleRecipes); } - public static void convertCrucibleRecipesToGTRecipes(HashSet crucibleRecipes) throws IllegalAccessException, InvocationTargetException { + public static void convertCrucibleRecipesToGTRecipes(HashSet crucibleRecipes) + throws IllegalAccessException, InvocationTargetException { HashSet ret = new HashSet<>(); - ArrayListMultimap itemToCircuitConfigMap = ArrayListMultimap.create(); - ArrayListMultimap itemToAspectsMap = ArrayListMultimap.create(); - ArrayListMultimap itemToOutputMap = ArrayListMultimap.create(); - ArrayListMultimap itemToResearchMap = ArrayListMultimap.create(); + ArrayListMultimap itemToCircuitConfigMap = ArrayListMultimap.create(); + ArrayListMultimap itemToAspectsMap = ArrayListMultimap.create(); + ArrayListMultimap itemToOutputMap = ArrayListMultimap.create(); + ArrayListMultimap itemToResearchMap = ArrayListMultimap.create(); for (Object o : crucibleRecipes) { @@ -114,45 +121,47 @@ public class TCRecipeHandler { Object cat = TCRecipeHandler.aCrucibleRecipeCatalyst.get(o); if (cat instanceof ItemStack) { - itemToAspectsMap.put((ItemStack)cat,aspects); - itemToOutputMap.put((ItemStack)cat,out); - itemToResearchMap.put((ItemStack)cat,key); + itemToAspectsMap.put((ItemStack) cat, aspects); + itemToOutputMap.put((ItemStack) cat, out); + itemToResearchMap.put((ItemStack) cat, key); } else if (cat instanceof String) { for (ItemStack stack : OreDictionary.getOres((String) cat)) { - itemToAspectsMap.put(stack,aspects); - itemToOutputMap.put(stack,out); - itemToResearchMap.put(stack,key); + itemToAspectsMap.put(stack, aspects); + itemToOutputMap.put(stack, out); + itemToResearchMap.put(stack, key); } } else if (cat instanceof ArrayList && ((ArrayList) cat).size() > 0) { for (ItemStack stack : ((ArrayList) cat)) { - itemToAspectsMap.put(stack,aspects); - itemToOutputMap.put(stack,out); - itemToResearchMap.put(stack,key); - + itemToAspectsMap.put(stack, aspects); + itemToOutputMap.put(stack, out); + itemToResearchMap.put(stack, key); } } } - for (ItemStack o : itemToAspectsMap.keySet()){ - if (o.getItemDamage() == Short.MAX_VALUE) - itemToCircuitConfigMap.put(o,24); + for (ItemStack o : itemToAspectsMap.keySet()) { + if (o.getItemDamage() == Short.MAX_VALUE) itemToCircuitConfigMap.put(o, 24); else for (int j = 1; j <= itemToAspectsMap.get(o).size(); j++) { - itemToCircuitConfigMap.put(o,j%24); + itemToCircuitConfigMap.put(o, j % 24); } - - for (int j = 0; j < itemToAspectsMap.get(o).size() ; j++) { - ret.add(addRecipes(itemToResearchMap.get(o).get(j),itemToOutputMap.get(o).get(j),itemToAspectsMap.get(o).get(j),o,itemToCircuitConfigMap.get(o).get(j))); + for (int j = 0; j < itemToAspectsMap.get(o).size(); j++) { + ret.add(addRecipes( + itemToResearchMap.get(o).get(j), + itemToOutputMap.get(o).get(j), + itemToAspectsMap.get(o).get(j), + o, + itemToCircuitConfigMap.get(o).get(j))); } } - for (GT_Recipe recipe : ret){ + for (GT_Recipe recipe : ret) { TCRecipeHandler.alchemicalConstructHandler.add(recipe); } - } - public static GT_Recipe addRecipes(String key, ItemStack out, Object aspects, ItemStack cat, int config) throws InvocationTargetException, IllegalAccessException { + public static GT_Recipe addRecipes(String key, ItemStack out, Object aspects, ItemStack cat, int config) + throws InvocationTargetException, IllegalAccessException { NBTTagCompound toWrite = new NBTTagCompound(); ThaumcraftHandler.AspectAdder.writeAspectListToNBT.invoke(aspects, toWrite); @@ -161,69 +170,106 @@ public class TCRecipeHandler { fake.setStackDisplayName(key); GT_Recipe recipe = new BWRecipes.DynamicGTRecipe( false, - new ItemStack[]{cat, GT_Utility.getIntegratedCircuit(config)}, - new ItemStack[]{out}, + new ItemStack[] {cat, GT_Utility.getIntegratedCircuit(config)}, + new ItemStack[] {out}, fake, null, null, null, 60, 480, - 0 - ); + 0); return recipe; } static class TCRecipeMap extends GT_Recipe.GT_Recipe_Map { - public TCRecipeMap(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { - super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + public TCRecipeMap( + Collection aRecipeList, + String aUnlocalizedName, + String aLocalName, + String aNEIName, + String aNEIGUIPath, + int aUsualInputCount, + int aUsualOutputCount, + int aMinimalInputItems, + int aMinimalInputFluids, + int aAmperage, + String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, + boolean aShowVoltageAmperageInNEI, + boolean aNEIAllowed) { + super( + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override - public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + public GT_Recipe findRecipe( + IHasWorldObjectAndCoords aTileEntity, + GT_Recipe aRecipe, + boolean aNotUnificated, + boolean aDontCheckStackSizes, + long aVoltage, + FluidStack[] aFluids, + ItemStack aSpecialSlot, + ItemStack... aInputs) { // No Recipes? Well, nothing to be found then. if (mRecipeList.isEmpty()) return null; - // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 Stack" or "at least 2 Stacks" before they start searching for Recipes. - // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in their Machines to select Sub Recipes. + // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 + // Stack" or "at least 2 Stacks" before they start searching for Recipes. + // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in + // their Machines to select Sub Recipes. if (GregTech_API.sPostloadFinished) { if (this.mMinimalInputItems > 0) { - if (aInputs == null) - return null; + if (aInputs == null) return null; int tAmount = 0; - for (ItemStack aInput : aInputs) - if (aInput != null) - tAmount++; - if (tAmount < this.mMinimalInputItems) - return null; + for (ItemStack aInput : aInputs) if (aInput != null) tAmount++; + if (tAmount < this.mMinimalInputItems) return null; } } // Unification happens here in case the Input isn't already unificated. - if (aNotUnificated) - aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs); - -// // Check the Recipe which has been used last time in order to not have to search for it again, if possible. -// if (aRecipe != null) -// if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { -// NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); -// NBTTagCompound givenNBT = ((ItemStack)aRecipe.mSpecialItems).getTagCompound(); -// Object aAspectListToCheck = null; -// Object aGivenAspectList = null; -// try { -// aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); -// aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); -// AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck,toCheckNBT); -// AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList,givenNBT); -// if (!TCRecipeHandler.TCRecipeMap.containsAspects(aAspectListToCheck,aGivenAspectList)) -// return null; -// } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { -// e.printStackTrace(); -// return null; -// } -// return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; -// } - + if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs); + + // // Check the Recipe which has been used last time in order to not have to search for it again, + // if possible. + // if (aRecipe != null) + // if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, + // aDontCheckStackSizes, aFluids, aInputs)) { + // NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); + // NBTTagCompound givenNBT = ((ItemStack)aRecipe.mSpecialItems).getTagCompound(); + // Object aAspectListToCheck = null; + // Object aGivenAspectList = null; + // try { + // aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); + // aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); + // AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck,toCheckNBT); + // AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList,givenNBT); + // if + // (!TCRecipeHandler.TCRecipeMap.containsAspects(aAspectListToCheck,aGivenAspectList)) + // return null; + // } catch (InstantiationException | IllegalAccessException | InvocationTargetException + // e) { + // e.printStackTrace(); + // return null; + // } + // return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; + // } // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. if (this.mUsualInputCount > 0 && aInputs != null) @@ -232,19 +278,22 @@ public class TCRecipeHandler { Collection tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack)); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { + if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); - NBTTagCompound givenNBT = ((ItemStack)aRecipe.mSpecialItems).getTagCompound(); + NBTTagCompound givenNBT = ((ItemStack) aRecipe.mSpecialItems).getTagCompound(); Object aAspectListToCheck = null; Object aGivenAspectList = null; try { aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); - AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck,toCheckNBT); - AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList,givenNBT); - if (!TCRecipeHandler.TCRecipeMap.containsAspects(aAspectListToCheck,aGivenAspectList)) - continue; - } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { + AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck, toCheckNBT); + AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList, givenNBT); + if (!TCRecipeHandler.TCRecipeMap.containsAspects( + aAspectListToCheck, aGivenAspectList)) continue; + } catch (InstantiationException + | IllegalAccessException + | InvocationTargetException e) { e.printStackTrace(); return null; } @@ -253,19 +302,24 @@ public class TCRecipeHandler { tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(GT_Values.W, tStack))); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) { + if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) + && BW_Util.areStacksEqualOrNull( + (ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) { NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); - NBTTagCompound givenNBT = ((ItemStack)aRecipe.mSpecialItems).getTagCompound(); + NBTTagCompound givenNBT = ((ItemStack) aRecipe.mSpecialItems).getTagCompound(); Object aAspectListToCheck = null; Object aGivenAspectList = null; try { aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); - AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck,toCheckNBT); - AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList,givenNBT); - if (!TCRecipeHandler.TCRecipeMap.containsAspects(aAspectListToCheck,aGivenAspectList)) - continue; - } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { + AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck, toCheckNBT); + AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList, givenNBT); + if (!TCRecipeHandler.TCRecipeMap.containsAspects( + aAspectListToCheck, aGivenAspectList)) continue; + } catch (InstantiationException + | IllegalAccessException + | InvocationTargetException e) { e.printStackTrace(); return null; } @@ -276,15 +330,15 @@ public class TCRecipeHandler { return null; } - - private static boolean containsAspects(Object aAspectListToCheck, Object aGivenAspectList) throws InvocationTargetException, IllegalAccessException { + private static boolean containsAspects(Object aAspectListToCheck, Object aGivenAspectList) + throws InvocationTargetException, IllegalAccessException { Object[] aspects = (Object[]) ThaumcraftHandler.AspectAdder.getAspects.invoke(aGivenAspectList); for (int i = 0; i < aspects.length; i++) { - if ((int) ThaumcraftHandler.AspectAdder.getAmount.invoke(aAspectListToCheck,aspects[i]) < (int) ThaumcraftHandler.AspectAdder.getAmount.invoke(aGivenAspectList,aspects[i])) + if ((int) ThaumcraftHandler.AspectAdder.getAmount.invoke(aAspectListToCheck, aspects[i]) + < (int) ThaumcraftHandler.AspectAdder.getAmount.invoke(aGivenAspectList, aspects[i])) return false; } return true; } - } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java index cb74678162..ce5efcd1a4 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.crossmod.emt.tileentities.multi; +import static gregtech.api.enums.GT_Values.V; + import com.github.bartimaeusnek.crossmod.emt.recipe.TCRecipeHandler; import com.github.bartimaeusnek.crossmod.emt.util.EMTHandler; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; @@ -32,18 +34,15 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; - import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; - -import static gregtech.api.enums.GT_Values.V; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; @SuppressWarnings("ALL") public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlockBase { @@ -64,7 +63,7 @@ public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlo if (aMetaTileEntity == null) { return false; } else if (aTileEntity.getClass().isInstance(EMTHandler.aEssentiaInputHatch)) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return this.mEssentiaHatches.add(aMetaTileEntity); } else { return false; @@ -94,9 +93,10 @@ public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlo allAspects = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); for (Object o : this.mEssentiaHatches) { Object aspectList = EMTHandler.aAspectField.get(o); - ThaumcraftHandler.AspectAdder.add.invoke(allAspects,aspectList); + ThaumcraftHandler.AspectAdder.add.invoke(allAspects, aspectList); } - NBTTagCompound toWrite = (NBTTagCompound)ThaumcraftHandler.AspectAdder.writeAspectListToNBT.invoke(allAspects,new NBTTagCompound()); + NBTTagCompound toWrite = (NBTTagCompound) + ThaumcraftHandler.AspectAdder.writeAspectListToNBT.invoke(allAspects, new NBTTagCompound()); stack.setTagCompound(toWrite); } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) { e.printStackTrace(); @@ -107,30 +107,29 @@ public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlo long tVoltage = this.getMaxInputVoltage(); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(tVoltage), V.length - 1)); - GT_Recipe tRecipe = TCRecipeHandler.alchemicalConstructHandler.findRecipe(this.getBaseMetaTileEntity(),null,false, false, V[tTier], null, stack, tInputs); + GT_Recipe tRecipe = TCRecipeHandler.alchemicalConstructHandler.findRecipe( + this.getBaseMetaTileEntity(), null, false, false, V[tTier], null, stack, tInputs); ItemStack helper = (ItemStack) tRecipe.mSpecialItems; NBTTagCompound tagCompound = helper.getTagCompound(); String research = tagCompound.getCompoundTag("display").getString("Name"); Object aspectList = null; try { aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); - ThaumcraftHandler.AspectAdder.readAspectListFromNBT.invoke(aspectList,tagCompound); - } catch (IllegalAccessException | InvocationTargetException | InstantiationException e) { + ThaumcraftHandler.AspectAdder.readAspectListFromNBT.invoke(aspectList, tagCompound); + } catch (IllegalAccessException | InvocationTargetException | InstantiationException e) { e.printStackTrace(); return false; } boolean complete = false; try { - complete = (boolean) ThaumcraftHandler.AspectAdder.isResearchComplete.invoke(null,owner,research); + complete = (boolean) ThaumcraftHandler.AspectAdder.isResearchComplete.invoke(null, owner, research); } catch (IllegalAccessException | InvocationTargetException e) { e.printStackTrace(); } - if (!complete) - return false; - if (!tRecipe.isRecipeInputEqual(true,new FluidStack[0],tInputs)) - return false; - LinkedHashMap list = null; - LinkedHashMap needed = null; + if (!complete) return false; + if (!tRecipe.isRecipeInputEqual(true, new FluidStack[0], tInputs)) return false; + LinkedHashMap list = null; + LinkedHashMap needed = null; try { list = (LinkedHashMap) ThaumcraftHandler.AspectAdder.linkedAspektList.get(allAspects); needed = (LinkedHashMap) ThaumcraftHandler.AspectAdder.linkedAspektList.get(aspectList); @@ -140,8 +139,8 @@ public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlo } assert list != null; assert needed != null; - for (Map.Entry toTake : needed.entrySet()){ - list.replace(toTake.getKey(),list.get(toTake.getKey())-toTake.getValue()); + for (Map.Entry toTake : needed.entrySet()) { + list.replace(toTake.getKey(), list.get(toTake.getKey()) - toTake.getValue()); } this.addOutput(tRecipe.mOutputs[0]); this.updateSlots(); @@ -184,7 +183,8 @@ public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlo } @Override - public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + public ITexture[] getTexture( + IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { return new ITexture[0]; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java index b75a9fcd1a..b369480116 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java @@ -23,15 +23,17 @@ package com.github.bartimaeusnek.crossmod.emt.util; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; - import java.lang.reflect.Field; + @SuppressWarnings("unchecked") public class EMTHandler { public static Class aEssentiaInputHatch; public static Field aAspectField; + static { try { - aEssentiaInputHatch = (Class) Class.forName("emt.gthandler.common.implementations.EssentiaHatch"); + aEssentiaInputHatch = (Class) + Class.forName("emt.gthandler.common.implementations.EssentiaHatch"); aAspectField = aEssentiaInputHatch.getDeclaredField("current"); aAspectField.setAccessible(true); } catch (ClassNotFoundException | NoSuchFieldException e) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index ff5e99fd64..f8e5827b0c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.crossmod.galacticgreg; +import static bloodasp.galacticgreg.registry.GalacticGregRegistry.getModContainers; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; +import static gregtech.api.enums.GT_Values.VN; + import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_Layer_Space; import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_SmallPieces_Space; import bloodasp.galacticgreg.GalacticGreg; @@ -45,6 +49,10 @@ import gregtech.api.util.GT_Utility; import gregtech.common.GT_Worldgen_GT_Ore_Layer; import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; +import java.util.*; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.stream.Collectors; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -52,27 +60,19 @@ import net.minecraft.world.World; import net.minecraft.world.gen.ChunkProviderServer; import net.minecraftforge.fluids.FluidStack; -import java.util.*; -import java.util.function.Consumer; -import java.util.function.Predicate; -import java.util.stream.Collectors; - -import static bloodasp.galacticgreg.registry.GalacticGregRegistry.getModContainers; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; -import static gregtech.api.enums.GT_Values.VN; - @SuppressWarnings("ALL") public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_DrillerBase { - private static ArrayListMultimap, Float>> extraDropsDimMap = ArrayListMultimap.create(); - private static FluidStack[] NOBLE_GASSES = new FluidStack[]{ - WerkstoffLoader.Neon.getFluidOrGas(1), - WerkstoffLoader.Krypton.getFluidOrGas(1), - WerkstoffLoader.Xenon.getFluidOrGas(1), - WerkstoffLoader.Oganesson.getFluidOrGas(1) + private static ArrayListMultimap, Float>> extraDropsDimMap = + ArrayListMultimap.create(); + private static FluidStack[] NOBLE_GASSES = new FluidStack[] { + WerkstoffLoader.Neon.getFluidOrGas(1), + WerkstoffLoader.Krypton.getFluidOrGas(1), + WerkstoffLoader.Xenon.getFluidOrGas(1), + WerkstoffLoader.Oganesson.getFluidOrGas(1) }; - private HashMap, Float> dropmap = null; + private HashMap, Float> dropmap = null; private float totalWeight; private int multiplier = 1; @@ -88,12 +88,15 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ public static void addMatierialToDimensionList(int DimensionID, ISubTagContainer Material, float weight) { if (Material instanceof Materials) - getExtraDropsDimMap().put(DimensionID, new Pair<>(new Pair<>(((Materials)Material).mMetaItemSubID,false), weight)); + getExtraDropsDimMap() + .put(DimensionID, new Pair<>(new Pair<>(((Materials) Material).mMetaItemSubID, false), weight)); else if (Material instanceof Werkstoff) - getExtraDropsDimMap().put(DimensionID, new Pair<>(new Pair<>((int) ((Werkstoff)Material).getmID(),true), weight)); + getExtraDropsDimMap() + .put(DimensionID, new Pair<>(new Pair<>((int) ((Werkstoff) Material).getmID(), true), weight)); } - //adding tellurium to OW to ensure a way to get it, as it's used in Magneto Resonatic Dust and Circuit Compound MK3 Dust + // adding tellurium to OW to ensure a way to get it, as it's used in Magneto Resonatic Dust and Circuit Compound MK3 + // Dust static { addMatierialToDimensionList(0, Materials.Tellurium, 8.0f); } @@ -106,7 +109,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setByte("TIER_MULTIPLIER",TIER_MULTIPLIER); + aNBT.setByte("TIER_MULTIPLIER", TIER_MULTIPLIER); aNBT.setBoolean("mBlacklist", mBlacklist); } @@ -124,7 +127,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri @Override protected int getMinTier() { - return this.TIER_MULTIPLIER + 5; //min tier = LuV + return this.TIER_MULTIPLIER + 5; // min tier = LuV } @Override @@ -149,17 +152,16 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } @Override - protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { - //if the dropmap has never been initialised or if the dropmap is empty - if (dropmap == null || totalWeight == 0) - calculateDropMap(); + protected boolean workingAtBottom( + ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + // if the dropmap has never been initialised or if the dropmap is empty + if (dropmap == null || totalWeight == 0) calculateDropMap(); - if(totalWeight != 0.f){ + if (totalWeight != 0.f) { handleFluidConsumption(); handleOutputs(); return true; - } - else{ + } else { stopMachine(); return false; } @@ -171,10 +173,12 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Miner") - .addInfo("Controller Block for the Void Miner "+ GT_Values.VN[this.getMinTier()]) + .addInfo("Controller Block for the Void Miner " + GT_Values.VN[this.getMinTier()]) .addInfo("Consumes " + GT_Values.V[this.getMinTier()] + "EU/t") - .addInfo("Can be supplied with 2L/s of Neon(x4), Krypton(x8), Xenon(x16) or Oganesson(x64) for higher outputs.") - .addInfo("Will output "+(2*TIER_MULTIPLIER)+" Ores per Second depending on the Dimension it is build in") + .addInfo( + "Can be supplied with 2L/s of Neon(x4), Krypton(x8), Xenon(x16) or Oganesson(x64) for higher outputs.") + .addInfo("Will output " + (2 * TIER_MULTIPLIER) + + " Ores per Second depending on the Dimension it is build in") .addInfo("Put the Ore into the input bus to set the Whitelist/Blacklist") .addInfo("Use a screwdriver to toggle Whitelist/Blacklist") .addInfo("Blacklist or non Whitelist Ore will be VOIDED") @@ -255,14 +259,12 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @param key a Pair of where the int is the meta of the ore, and the bool is true for BW ores, false for GT ores * @param value the non normalised weight */ - private void addDrop(Pair key, float value){ + private void addDrop(Pair key, float value) { final ItemStack ore = getOreItemStack(key); - if (ConfigHandler.voidMinerBlacklist.contains(String.format("%s:%d", GameRegistry.findUniqueIdentifierFor(ore.getItem()).toString(), ore.getItemDamage()))) - return; - if (!dropmap.containsKey(key)) - dropmap.put(key, value); - else - dropmap.put(key, dropmap.get(key) + value); + if (ConfigHandler.voidMinerBlacklist.contains(String.format( + "%s:%d", GameRegistry.findUniqueIdentifierFor(ore.getItem()).toString(), ore.getItemDamage()))) return; + if (!dropmap.containsKey(key)) dropmap.put(key, value); + else dropmap.put(key, dropmap.get(key) + value); } /** @@ -270,13 +272,14 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @param oreLayerPredicate the predicate made by makeOreLayerPredicate */ private void getDropsVanillaVeins(Predicate oreLayerPredicate) { - GT_Worldgen_GT_Ore_Layer.sList.stream().filter(gt_worldgen -> gt_worldgen.mEnabled && oreLayerPredicate.test(gt_worldgen)).forEach(element -> { - addDrop(new Pair<>((int) element.mPrimaryMeta,false), (float) element.mWeight); - addDrop(new Pair<>((int) element.mSecondaryMeta,false), (float) element.mWeight); - addDrop(new Pair<>((int) element.mSporadicMeta,false), (element.mWeight / 8f)); - addDrop(new Pair<>((int) element.mBetweenMeta,false), (element.mWeight / 8f)); - } - ); + GT_Worldgen_GT_Ore_Layer.sList.stream() + .filter(gt_worldgen -> gt_worldgen.mEnabled && oreLayerPredicate.test(gt_worldgen)) + .forEach(element -> { + addDrop(new Pair<>((int) element.mPrimaryMeta, false), (float) element.mWeight); + addDrop(new Pair<>((int) element.mSecondaryMeta, false), (float) element.mWeight); + addDrop(new Pair<>((int) element.mSporadicMeta, false), (element.mWeight / 8f)); + addDrop(new Pair<>((int) element.mBetweenMeta, false), (element.mWeight / 8f)); + }); } /** @@ -284,9 +287,9 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @param smallOresPredicate the predicate made by makeSmallOresPredicate */ private void getDropsVanillaSmallOres(Predicate smallOresPredicate) { - GT_Worldgen_GT_Ore_SmallPieces.sList.stream().filter(gt_worldgen -> gt_worldgen.mEnabled && smallOresPredicate.test(gt_worldgen)).forEach(element -> - addDrop(new Pair<>((int) element.mMeta,false), (float) element.mAmount) - ); + GT_Worldgen_GT_Ore_SmallPieces.sList.stream() + .filter(gt_worldgen -> gt_worldgen.mEnabled && smallOresPredicate.test(gt_worldgen)) + .forEach(element -> addDrop(new Pair<>((int) element.mMeta, false), (float) element.mAmount)); } /** @@ -295,17 +298,23 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private void getDropsOreVeinsSpace(ModDimensionDef finalDef) { Set space = GalacticGreg.oreVeinWorldgenList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof GT_Worldgen_GT_Ore_Layer_Space && ((GT_Worldgen_GT_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) + .filter(gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof GT_Worldgen_GT_Ore_Layer_Space + && ((GT_Worldgen_GT_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) .collect(Collectors.toSet()); - space.forEach( - element -> { - addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mPrimaryMeta,false), (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); - addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSecondaryMeta,false), (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); - addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSporadicMeta,false), (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); - addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mBetweenMeta,false), (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); - } - ); + space.forEach(element -> { + addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mPrimaryMeta, false), (float) + ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); + addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSecondaryMeta, false), (float) + ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); + addDrop( + new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSporadicMeta, false), + (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); + addDrop( + new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mBetweenMeta, false), + (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); + }); } /** @@ -314,27 +323,27 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private void getDropsSmallOreSpace(ModDimensionDef finalDef) { Set space = GalacticGreg.smallOreWorldgenList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof GT_Worldgen_GT_Ore_SmallPieces_Space && ((GT_Worldgen_GT_Ore_SmallPieces_Space) gt_worldgen).isEnabledForDim(finalDef)) + .filter(gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof GT_Worldgen_GT_Ore_SmallPieces_Space + && ((GT_Worldgen_GT_Ore_SmallPieces_Space) gt_worldgen).isEnabledForDim(finalDef)) .collect(Collectors.toSet()); - space.forEach( - element -> - addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mMeta,false), (float) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mAmount) - ); + space.forEach(element -> + addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mMeta, false), (float) + ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mAmount)); } /** * method used to pick the next key in the dropmap that will be used to generate the ore. * @return the chosen key */ - private Pair getOreDamage() { + private Pair getOreDamage() { float curentWeight = 0.f; while (true) { float randomnumber = XSTR.XSTR_INSTANCE.nextFloat() * totalWeight; - for (Map.Entry, Float> entry : dropmap.entrySet()) { + for (Map.Entry, Float> entry : dropmap.entrySet()) { curentWeight += entry.getValue(); - if (randomnumber < curentWeight) - return entry.getKey(); + if (randomnumber < curentWeight) return entry.getKey(); } } } @@ -348,7 +357,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri for (int i = 0; i < NOBLE_GASSES.length; i++) { FluidStack ng = NOBLE_GASSES[i]; if (ng.isFluidEqual(s)) { - multiplier = TIER_MULTIPLIER * (2 << (i == NOBLE_GASSES.length - 1 ? (i+2) : (i+1))); + multiplier = TIER_MULTIPLIER * (2 << (i == NOBLE_GASSES.length - 1 ? (i + 2) : (i + 1))); return s; } } @@ -377,8 +386,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private void handleFluidConsumption() { FluidStack storedNobleGas = getNobleGasInputAndSetMultiplier(); - if (storedNobleGas == null || !consumeNobleGas(storedNobleGas)) - multiplier = TIER_MULTIPLIER; + if (storedNobleGas == null || !consumeNobleGas(storedNobleGas)) multiplier = TIER_MULTIPLIER; } /** @@ -388,7 +396,9 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private void getDropMapRoss(int aID) { Consumer addToList = makeAddToList(); BW_OreLayer.sList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_OreLayer && gt_worldgen.isGenerationAllowed(null, aID, 0)) + .filter(gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof BW_OreLayer + && gt_worldgen.isGenerationAllowed(null, aID, 0)) .collect(Collectors.toSet()) .forEach(addToList); } @@ -399,12 +409,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private Consumer makeAddToList() { return element -> { - List> data = element.getStacksRawData(); + List> data = element.getStacksRawData(); for (int i = 0; i < data.size(); i++) { - if (i < data.size()-2) - addDrop(data.get(i), (float) element.mWeight); - else - addDrop(data.get(i), (element.mWeight/8f)); + if (i < data.size() - 2) addDrop(data.get(i), (float) element.mWeight); + else addDrop(data.get(i), (element.mWeight / 8f)); } }; } @@ -416,9 +424,15 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private ModDimensionDef makeModDimDef() { return getModContainers().stream() .flatMap(modContainer -> modContainer.getDimensionList().stream()) - .filter(modDimensionDef -> modDimensionDef.getChunkProviderName() - .equals(((ChunkProviderServer) this.getBaseMetaTileEntity().getWorld().getChunkProvider()).currentChunkProvider.getClass().getName())) - .findFirst().orElse(null); + .filter(modDimensionDef -> modDimensionDef + .getChunkProviderName() + .equals(((ChunkProviderServer) + this.getBaseMetaTileEntity().getWorld().getChunkProvider()) + .currentChunkProvider + .getClass() + .getName())) + .findFirst() + .orElse(null); } /** @@ -429,11 +443,14 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private void addOresVeinsBartworks(ModDimensionDef finalDef, Consumer addToList) { try { Set space = GalacticGreg.oreVeinWorldgenList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_Worldgen_Ore_Layer_Space && ((BW_Worldgen_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) + .filter(gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof BW_Worldgen_Ore_Layer_Space + && ((BW_Worldgen_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) .collect(Collectors.toSet()); space.forEach(addToList); - } catch (NullPointerException ignored) {} + } catch (NullPointerException ignored) { + } } /** @@ -443,14 +460,18 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private void addSmallOresBartworks(ModDimensionDef finalDef) { try { Set space = GalacticGreg.smallOreWorldgenList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_Worldgen_Ore_SmallOre_Space && ((BW_Worldgen_Ore_SmallOre_Space) gt_worldgen).isEnabledForDim(finalDef)) + .filter(gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof BW_Worldgen_Ore_SmallOre_Space + && ((BW_Worldgen_Ore_SmallOre_Space) gt_worldgen).isEnabledForDim(finalDef)) .collect(Collectors.toSet()); - space.forEach( - element -> - addDrop(new Pair<>(((BW_Worldgen_Ore_SmallOre_Space) element).mPrimaryMeta, ((BW_Worldgen_Ore_SmallOre_Space) element).bwOres != 0), (float) ((BW_Worldgen_Ore_SmallOre_Space) element).mDensity) - ); - } catch (NullPointerException ignored) {} + space.forEach(element -> addDrop( + new Pair<>( + ((BW_Worldgen_Ore_SmallOre_Space) element).mPrimaryMeta, + ((BW_Worldgen_Ore_SmallOre_Space) element).bwOres != 0), + (float) ((BW_Worldgen_Ore_SmallOre_Space) element).mDensity)); + } catch (NullPointerException ignored) { + } } /** @@ -458,7 +479,8 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @param id the specified dim id */ private void handleExtraDrops(int id) { - Optional.ofNullable(getExtraDropsDimMap().get(id)).ifPresent(e -> e.forEach(f -> addDrop(f.getKey(), f.getValue()))); + Optional.ofNullable(getExtraDropsDimMap().get(id)) + .ifPresent(e -> e.forEach(f -> addDrop(f.getKey(), f.getValue()))); } /** @@ -474,19 +496,19 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @param id the dim number */ private void handleModDimDef(int id) { - //vanilla dims or TF + // vanilla dims or TF if ((id <= 1 && id >= -1) || id == 7) { getDropsVanillaVeins(makeOreLayerPredicate()); getDropsVanillaSmallOres(makeSmallOresPredicate()); - // ross dims + // ross dims } else if (id == ConfigHandler.ross128BID || id == ConfigHandler.ross128BAID) { getDropMapRoss(id); - // other space dims + // other space dims } else { Optional.ofNullable(makeModDimDef()).ifPresent(def -> { - //normal space dim + // normal space dim getDropsOreVeinsSpace(def); getDropsSmallOreSpace(def); @@ -514,12 +536,13 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private void handleOutputs() { Pair stats = getOreDamage(); - final List inputOres = this.getStoredInputs().stream().filter(GT_Utility::isOre).collect(Collectors.toList()); + final List inputOres = + this.getStoredInputs().stream().filter(GT_Utility::isOre).collect(Collectors.toList()); final ItemStack output = getOreItemStack(stats); if (inputOres.size() == 0 - || (mBlacklist && inputOres.stream().allMatch(is -> !GT_Utility.areStacksEqual(is, output))) - || (!mBlacklist && inputOres.stream().anyMatch(is -> GT_Utility.areStacksEqual(is, output))) - ) this.addOutput(output); + || (mBlacklist && inputOres.stream().allMatch(is -> !GT_Utility.areStacksEqual(is, output))) + || (!mBlacklist && inputOres.stream().anyMatch(is -> GT_Utility.areStacksEqual(is, output)))) + this.addOutput(output); this.updateSlots(); } @@ -529,7 +552,8 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @return an ItemStack corresponding to the target ore, with a stacksize corresponding to the mutiplier induced by the gas used */ private ItemStack getOreItemStack(Pair stats) { - return new ItemStack(stats.getValue() ? WerkstoffLoader.BWOres : GregTech_API.sBlockOres1, multiplier, stats.getKey()); + return new ItemStack( + stats.getValue() ? WerkstoffLoader.BWOres : GregTech_API.sBlockOres1, multiplier, stats.getKey()); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java index a5058a34d7..6898b81ded 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java @@ -27,7 +27,7 @@ import gregtech.api.enums.Materials; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -public class GT_TileEntity_VoidMiners { +public class GT_TileEntity_VoidMiners { public static class VMLUV extends GT_TileEntity_VoidMiner_Base { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java index 447909e03d..d458ea07af 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java @@ -32,18 +32,17 @@ import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import gregtech.api.objects.GT_UO_DimensionList; +import java.io.File; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.config.Configuration; -import java.io.File; - public class GalacticraftProxy { public static GT_UO_DimensionList uo_dimensionList = new GT_UO_DimensionList(); static Configuration gtConf; - private GalacticraftProxy() { - } - public static void postInit(FMLPostInitializationEvent e){ + private GalacticraftProxy() {} + + public static void postInit(FMLPostInitializationEvent e) { if (SideReference.Side.Server || SideReference.EffectiveSide.Server) { GalacticraftProxy.serverPostInit(e); } else { @@ -61,20 +60,17 @@ public class GalacticraftProxy { GalacticraftProxy.commonpreInit(e); } - private static void serverpreInit(FMLPreInitializationEvent e) { + private static void serverpreInit(FMLPreInitializationEvent e) {} - } - - private static void clientpreInit(FMLPreInitializationEvent e) { - } + private static void clientpreInit(FMLPreInitializationEvent e) {} private static void commonpreInit(FMLPreInitializationEvent e) { - GalacticraftProxy.gtConf = new Configuration(new File(new File(e.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg")); + GalacticraftProxy.gtConf = + new Configuration(new File(new File(e.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg")); GalacticraftProxy.uo_dimensionList.getConfig(GalacticraftProxy.gtConf, "undergroundfluid"); BW_WorldGenRoss128b.initundergroundFluids(); BW_WorldGenRoss128ba.init_undergroundFluids(); - if (GalacticraftProxy.gtConf.hasChanged()) - GalacticraftProxy.gtConf.save(); + if (GalacticraftProxy.gtConf.hasChanged()) GalacticraftProxy.gtConf.save(); BW_WorldGenRoss128b.initOres(); BW_WorldGenRoss128ba.init_Ores(); MinecraftForge.EVENT_BUS.register(BWAtmosphereManager.INSTANCE); @@ -89,27 +85,17 @@ public class GalacticraftProxy { GalacticraftProxy.commonInit(e); } - private static void serverInit(FMLInitializationEvent e) { + private static void serverInit(FMLInitializationEvent e) {} - } - - private static void clientInit(FMLInitializationEvent e) { - - } + private static void clientInit(FMLInitializationEvent e) {} private static void commonInit(FMLInitializationEvent e) { - if (ConfigHandler.Ross128Enabled) - Ross128SolarSystem.init(); - } - private static void serverPostInit(FMLPostInitializationEvent e) { - + if (ConfigHandler.Ross128Enabled) Ross128SolarSystem.init(); } - private static void clientPostInit(FMLPostInitializationEvent e) { - - } + private static void serverPostInit(FMLPostInitializationEvent e) {} - private static void commonPostInit(FMLPostInitializationEvent e) { + private static void clientPostInit(FMLPostInitializationEvent e) {} - } + private static void commonPostInit(FMLPostInitializationEvent e) {} } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java index 8f6f1f9164..a0381dd0e9 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java @@ -31,9 +31,9 @@ import net.minecraft.entity.player.EntityPlayerMP; public class PlanetsHelperClass { - public static EntityLanderBase getLanderType(EntityPlayerMP player){ + public static EntityLanderBase getLanderType(EntityPlayerMP player) { EntityLanderBase elb; - switch (ConfigHandler.landerType){ + switch (ConfigHandler.landerType) { case 1: elb = new EntityLander(player); break; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java index 74b0f94a26..ff53bfcfa8 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.crossmod.galacticraft; import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import java.util.Random; import micdoodle8.mods.galacticraft.api.vector.Vector3; import micdoodle8.mods.galacticraft.api.world.ITeleportType; import micdoodle8.mods.galacticraft.core.entities.EntityLander; @@ -33,8 +34,6 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.world.World; import net.minecraft.world.WorldServer; -import java.util.Random; - public class UniversalTeleportType implements ITeleportType { @Override @@ -63,18 +62,15 @@ public class UniversalTeleportType implements ITeleportType { @Override public void onSpaceDimensionChanged(World newWorld, EntityPlayerMP player, boolean ridingAutoRocket) { - if (ridingAutoRocket) - return; + if (ridingAutoRocket) return; if ((player != null) && (GCPlayerStats.get(player).teleportCooldown <= 0)) { if (player.capabilities.isFlying) { player.capabilities.isFlying = false; } EntityLanderBase elb; - if (LoaderReference.GalacticraftMars) - elb=PlanetsHelperClass.getLanderType(player); - else - elb = new EntityLander(player); + if (LoaderReference.GalacticraftMars) elb = PlanetsHelperClass.getLanderType(player); + else elb = new EntityLander(player); if (!newWorld.isRemote) { newWorld.spawnEntityInWorld(elb); @@ -84,7 +80,5 @@ public class UniversalTeleportType implements ITeleportType { } @Override - public void setupAdventureSpawn(EntityPlayerMP player) { - - } + public void setupAdventureSpawn(EntityPlayerMP player) {} } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java index 5faa82b6e6..79f4db3734 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java @@ -30,84 +30,90 @@ import com.google.common.collect.ArrayListMultimap; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; +import java.util.*; import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; -import java.util.*; - @SuppressWarnings({"unused", "RedundantSuppression"}) public final class BWAtmosphereManager { - private static final Map COEFFICIENT_MAP = new HashMap<>(); + private static final Map COEFFICIENT_MAP = new HashMap<>(); private BWAtmosphereManager() { - BWAtmosphereManager.COEFFICIENT_MAP.put(1, new Integer[]{100}); - BWAtmosphereManager.COEFFICIENT_MAP.put(2,new Integer[]{70,30}); - BWAtmosphereManager.COEFFICIENT_MAP.put(3,new Integer[]{60,25,15}); - BWAtmosphereManager.COEFFICIENT_MAP.put(4,new Integer[]{50,25,15,10}); - BWAtmosphereManager.COEFFICIENT_MAP.put(5,new Integer[]{45,25,15,10,5}); - BWAtmosphereManager.COEFFICIENT_MAP.put(6,new Integer[]{45,20,15,10,5,5}); - BWAtmosphereManager.COEFFICIENT_MAP.put(7,new Integer[]{40,20,15,10,5,5,5}); - BWAtmosphereManager.COEFFICIENT_MAP.put(8,new Integer[]{35,20,15,10,5,5,5,5}); - BWAtmosphereManager.COEFFICIENT_MAP.put(9,new Integer[]{35,15,15,10,5,5,5,5,5}); + BWAtmosphereManager.COEFFICIENT_MAP.put(1, new Integer[] {100}); + BWAtmosphereManager.COEFFICIENT_MAP.put(2, new Integer[] {70, 30}); + BWAtmosphereManager.COEFFICIENT_MAP.put(3, new Integer[] {60, 25, 15}); + BWAtmosphereManager.COEFFICIENT_MAP.put(4, new Integer[] {50, 25, 15, 10}); + BWAtmosphereManager.COEFFICIENT_MAP.put(5, new Integer[] {45, 25, 15, 10, 5}); + BWAtmosphereManager.COEFFICIENT_MAP.put(6, new Integer[] {45, 20, 15, 10, 5, 5}); + BWAtmosphereManager.COEFFICIENT_MAP.put(7, new Integer[] {40, 20, 15, 10, 5, 5, 5}); + BWAtmosphereManager.COEFFICIENT_MAP.put(8, new Integer[] {35, 20, 15, 10, 5, 5, 5, 5}); + BWAtmosphereManager.COEFFICIENT_MAP.put(9, new Integer[] {35, 15, 15, 10, 5, 5, 5, 5, 5}); } public static final BWAtmosphereManager INSTANCE = new BWAtmosphereManager(); - private static final ArrayListMultimap> gasConcentration = ArrayListMultimap.create(); + private static final ArrayListMultimap> gasConcentration = + ArrayListMultimap.create(); - public static List> getGasFromWorldID(int worldID){ + public static List> getGasFromWorldID(int worldID) { return BWAtmosphereManager.gasConcentration.get(worldID); } - public static void removeGasFromWorld(int worldID, ISubTagContainer gas){ - for (Pair pair : BWAtmosphereManager.gasConcentration.get(worldID)){ - if (pair.getKey().equals(gas)){ + public static void removeGasFromWorld(int worldID, ISubTagContainer gas) { + for (Pair pair : BWAtmosphereManager.gasConcentration.get(worldID)) { + if (pair.getKey().equals(gas)) { BWAtmosphereManager.gasConcentration.get(worldID).remove(pair); return; } } } - public static void addGasToWorld(int worldID, ISubTagContainer gas, int amount){ - Pair toadd = new Pair<>(gas,amount); - BWAtmosphereManager.gasConcentration.put(worldID,toadd); + public static void addGasToWorld(int worldID, ISubTagContainer gas, int amount) { + Pair toadd = new Pair<>(gas, amount); + BWAtmosphereManager.gasConcentration.put(worldID, toadd); } - public static void addGasToWorld(int worldID, Pair toPut){ - BWAtmosphereManager.gasConcentration.put(worldID,toPut); + public static void addGasToWorld(int worldID, Pair toPut) { + BWAtmosphereManager.gasConcentration.put(worldID, toPut); } @SafeVarargs - public static void addGasToWorld(int worldID, Pair... toPut){ + public static void addGasToWorld(int worldID, Pair... toPut) { Arrays.stream(toPut).forEach(toadd -> BWAtmosphereManager.gasConcentration.put(worldID, toadd)); } - private static boolean addGCGasToWorld(int worldID, IAtmosphericGas gas, int aNumber, int aMaxNumber){ + private static boolean addGCGasToWorld(int worldID, IAtmosphericGas gas, int aNumber, int aMaxNumber) { if (gas.equals(IAtmosphericGas.CO2)) { - BWAtmosphereManager.addGasToWorld(worldID, Materials.CarbonDioxide, BWAtmosphereManager.COEFFICIENT_MAP.get(aMaxNumber)[aNumber]); + BWAtmosphereManager.addGasToWorld( + worldID, + Materials.CarbonDioxide, + BWAtmosphereManager.COEFFICIENT_MAP.get(aMaxNumber)[aNumber]); return true; } String name = gas.toString(); - name = name.charAt(0)+name.substring(1).toLowerCase(Locale.US); + name = name.charAt(0) + name.substring(1).toLowerCase(Locale.US); ISubTagContainer mat = Materials.get(name); - if (mat == Materials._NULL){ + if (mat == Materials._NULL) { mat = WerkstoffLoader.getWerkstoff(name); } - if (mat == Werkstoff.default_null_Werkstoff){ + if (mat == Werkstoff.default_null_Werkstoff) { return false; } - BWAtmosphereManager.addGasToWorld(worldID, mat, BWAtmosphereManager.COEFFICIENT_MAP.get(aMaxNumber)[aNumber]); + BWAtmosphereManager.addGasToWorld( + worldID, mat, BWAtmosphereManager.COEFFICIENT_MAP.get(aMaxNumber)[aNumber]); return true; } @SubscribeEvent - public void gcAutoRegister(GalaxyRegistry.PlanetRegisterEvent event){ + public void gcAutoRegister(GalaxyRegistry.PlanetRegisterEvent event) { CelestialBody planet = GalaxyRegistry.getRegisteredPlanets().get(event.planetName); for (int i = 0; i < planet.atmosphere.size(); i++) { - if (!BWAtmosphereManager.addGCGasToWorld(planet.getDimensionID(),planet.atmosphere.get(i),i,planet.atmosphere.size())) - BartWorksCrossmod.LOGGER.warn("Unidentified Fluid ("+planet.atmosphere.get(i)+") in the Atmosphere of: "+planet.getLocalizedName()); + if (!BWAtmosphereManager.addGCGasToWorld( + planet.getDimensionID(), planet.atmosphere.get(i), i, planet.atmosphere.size())) + BartWorksCrossmod.LOGGER.warn("Unidentified Fluid (" + planet.atmosphere.get(i) + + ") in the Atmosphere of: " + planet.getLocalizedName()); } } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java index ecc243a3d0..5f1d2a98e6 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java @@ -41,5 +41,4 @@ public abstract class AbstractWorldProviderSpace extends WorldProviderSpace impl public boolean hasSunset() { return true; } - } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index 6fc3ed11ec..2d5928bb37 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -22,12 +22,16 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b; +import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE; +import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WordGenerator; import com.github.bartimaeusnek.bartworks.system.worldgen.MapGenRuins; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import gregtech.api.objects.XSTR; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.BlockFalling; import net.minecraft.entity.EnumCreatureType; @@ -45,11 +49,6 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.PopulateChunkEvent; import net.minecraftforge.event.terraingen.TerrainGen; -import java.util.List; - -import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE; -import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE; - public class ChunkProviderRoss128b extends ChunkProviderGenerate { XSTR rand = new XSTR(); private BiomeGenBase[] biomesForGeneration; @@ -75,7 +74,9 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { Block[] ablock = new Block[65536]; byte[] abyte = new byte[65536]; this.func_147424_a(p_73154_1_, p_73154_2_, ablock); - this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); + this.biomesForGeneration = this.worldObj + .getWorldChunkManager() + .loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); for (int i = 0; i < this.biomesForGeneration.length; i++) { BiomeGenBase biomeGenBase = this.biomesForGeneration[i]; if (biomeGenBase.biomeID == BiomeGenBase.mushroomIsland.biomeID) { @@ -86,7 +87,8 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { if (LoaderReference.Thaumcraft) { if (ThaumcraftHandler.isTaintBiome(biomeGenBase.biomeID)) this.biomesForGeneration[i] = BiomeGenBase.taiga; - else if (ConfigHandler.disableMagicalForest && ThaumcraftHandler.isMagicalForestBiome(biomeGenBase.biomeID)) + else if (ConfigHandler.disableMagicalForest + && ThaumcraftHandler.isMagicalForestBiome(biomeGenBase.biomeID)) this.biomesForGeneration[i] = BiomeGenBase.birchForest; } } @@ -118,22 +120,27 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { this.rand.setSeed((long) p_73153_2_ * i1 + (long) p_73153_3_ * j1 ^ this.worldObj.getSeed()); } - MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); + MinecraftForge.EVENT_BUS.post( + new PopulateChunkEvent.Pre(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); int x1; int y1; int z1; - if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, LAKE)) { + if (biomegenbase != BiomeGenBase.desert + && biomegenbase != BiomeGenBase.desertHills + && TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, LAKE)) { x1 = k + this.rand.nextInt(16) + 8; y1 = this.rand.nextInt(256); z1 = l + this.rand.nextInt(16) + 8; int rni = this.rand.nextInt(8); - if (rni == 0) - (new WorldGenLakes(Blocks.ice)).generate(this.worldObj, this.rand, x1, y1, z1); - else if (rni == 4) - (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, x1, y1, z1); + if (rni == 0) (new WorldGenLakes(Blocks.ice)).generate(this.worldObj, this.rand, x1, y1, z1); + else if (rni == 4) (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, x1, y1, z1); } - if (biomegenbase != BiomeGenBase.ocean && biomegenbase != BiomeGenBase.deepOcean && biomegenbase != BiomeGenBase.river && biomegenbase != BiomeGenBase.frozenOcean && biomegenbase != BiomeGenBase.frozenRiver + if (biomegenbase != BiomeGenBase.ocean + && biomegenbase != BiomeGenBase.deepOcean + && biomegenbase != BiomeGenBase.river + && biomegenbase != BiomeGenBase.frozenOcean + && biomegenbase != BiomeGenBase.frozenRiver && this.rand.nextInt(ConfigHandler.ross128bRuinChance) == 0) { x1 = k + this.rand.nextInt(16) + 3; y1 = this.rand.nextInt(256); @@ -162,17 +169,18 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { } BWOreGen.generate(this.rand, p_73153_2_, p_73153_3_, this.worldObj, this, this); - MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); + MinecraftForge.EVENT_BUS.post( + new PopulateChunkEvent.Post(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); BlockFalling.fallInstantly = false; } @Override - public void recreateStructures(int p_82695_1_, int p_82695_2_) { - } + public void recreateStructures(int p_82695_1_, int p_82695_2_) {} @Override - public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] blocks, byte[] metas, BiomeGenBase[] p_147422_5_) { + public void replaceBlocksForBiome( + int p_147422_1_, int p_147422_2_, Block[] blocks, byte[] metas, BiomeGenBase[] p_147422_5_) { super.replaceBlocksForBiome(p_147422_1_, p_147422_2_, blocks, metas, p_147422_5_); for (int i = 0; i < blocks.length; i++) { if (blocks[i] == Blocks.grass) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java index ddb37b9941..e8962ed14a 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import net.minecraft.util.ResourceLocation; public class SkyProviderRoss128b { - //ASM enables this texture - public static final ResourceLocation sunTex = new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/World/SunRoss128.png"); + // ASM enables this texture + public static final ResourceLocation sunTex = + new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/World/SunRoss128.png"); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java index 2c8eac2cd9..5a6c5b6dca 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java @@ -60,10 +60,9 @@ public class WorldProviderRoss128b extends AbstractWorldProviderSpace { return Vec3.createVectorHelper(red, green, blue); } - @Override public Vector3 getFogColor() { - //unused + // unused return null; } @@ -159,5 +158,4 @@ public class WorldProviderRoss128b extends AbstractWorldProviderSpace { public boolean hasBreathableAtmosphere() { return true; } - } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java index 78cbd986ac..ec7ecb17c1 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java @@ -25,6 +25,8 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba; import com.github.bartimaeusnek.bartworks.util.NoiseUtil.BartsNoise; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.ChunkProviderRoss128b; import gregtech.api.objects.XSTR; +import java.util.Arrays; +import java.util.Random; import micdoodle8.mods.galacticraft.api.prefab.world.gen.MapGenBaseMeta; import micdoodle8.mods.galacticraft.core.blocks.GCBlocks; import micdoodle8.mods.galacticraft.core.world.gen.BiomeGenBaseMoon; @@ -38,9 +40,6 @@ import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; -import java.util.Arrays; -import java.util.Random; - public class ChunkProviderRoss128ba extends ChunkProviderMoon { private final XSTR rand = new XSTR(); @@ -50,7 +49,7 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { public ChunkProviderRoss128ba(World world, long seed, boolean mapFeaturesEnabled) { super(world, seed, mapFeaturesEnabled); - this.biomesForGeneration = new BiomeGenBase[]{BiomeGenBaseMoon.moonFlat}; + this.biomesForGeneration = new BiomeGenBase[] {BiomeGenBaseMoon.moonFlat}; this.caveGenerator = new MapGenCavesMoon(); this.worldObj = world; } @@ -61,7 +60,9 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { byte[] meta = new byte[65536]; Arrays.fill(ids, Blocks.air); this.generateTerrain(cx, cz, ids, meta); - this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, cx * 16, cz * 16, 16, 16); + this.biomesForGeneration = this.worldObj + .getWorldChunkManager() + .loadBlockGeneratorData(this.biomesForGeneration, cx * 16, cz * 16, 16, 16); this.createCraters(cx, cz, ids, meta); this.replaceBlocksForBiome(cx, cz, ids, meta, this.biomesForGeneration); this.caveGenerator.generate(this, this.worldObj, cx, cz, ids, meta); @@ -70,8 +71,7 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { return Chunk; } - public void decoratePlanet(World par1World, Random par2Random, int par3, int par4) { - } + public void decoratePlanet(World par1World, Random par2Random, int par3, int par4) {} @Override public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { @@ -108,6 +108,5 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { } } } - } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index bc47a60f4a..6bc6aafc09 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.WorldProviderRoss128b; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba.WorldProviderRoss128ba; +import java.util.Arrays; import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; import micdoodle8.mods.galacticraft.api.galaxies.*; import micdoodle8.mods.galacticraft.api.vector.Vector3; @@ -35,8 +36,6 @@ import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; import micdoodle8.mods.galacticraft.core.GalacticraftCore; import net.minecraft.util.ResourceLocation; -import java.util.Arrays; - public class Ross128SolarSystem { public static SolarSystem Ross128System; @@ -44,40 +43,51 @@ public class Ross128SolarSystem { public static Planet Ross128b; public static Moon Ross128ba; - private Ross128SolarSystem() { - } + private Ross128SolarSystem() {} public static void init() { - Ross128SolarSystem.Ross128System = new SolarSystem("Ross128System", "milkyWay").setMapPosition(new Vector3(-1.0D, 1.3D, 0.0D)); - Ross128SolarSystem.Ross128 = (Star) new Star("Ross128").setParentSolarSystem(Ross128SolarSystem.Ross128System).setTierRequired(-1); + Ross128SolarSystem.Ross128System = + new SolarSystem("Ross128System", "milkyWay").setMapPosition(new Vector3(-1.0D, 1.3D, 0.0D)); + Ross128SolarSystem.Ross128 = (Star) new Star("Ross128") + .setParentSolarSystem(Ross128SolarSystem.Ross128System) + .setTierRequired(-1); Ross128SolarSystem.Ross128.setUnreachable(); - Ross128SolarSystem.Ross128.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128.png")); + Ross128SolarSystem.Ross128.setBodyIcon( + new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128.png")); Ross128SolarSystem.Ross128System.setMainStar(Ross128SolarSystem.Ross128); Ross128SolarSystem.Ross128b = new Planet("Ross128b").setParentSolarSystem(Ross128SolarSystem.Ross128System); Ross128SolarSystem.Ross128b.setRingColorRGB((0x9F) / 255f, (0x8A) / 255f, (0x79) / 255f); Ross128SolarSystem.Ross128b.setPhaseShift(1.25F); - Ross128SolarSystem.Ross128b.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128b.png")); + Ross128SolarSystem.Ross128b.setBodyIcon( + new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128b.png")); Ross128SolarSystem.Ross128b.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(0.75F, 1.75F)); Ross128SolarSystem.Ross128b.setRelativeOrbitTime(0.65F); - Ross128SolarSystem.Ross128b.atmosphere.addAll(Arrays.asList(IAtmosphericGas.OXYGEN, IAtmosphericGas.NITROGEN, IAtmosphericGas.ARGON)); + Ross128SolarSystem.Ross128b.atmosphere.addAll( + Arrays.asList(IAtmosphericGas.OXYGEN, IAtmosphericGas.NITROGEN, IAtmosphericGas.ARGON)); Ross128SolarSystem.Ross128b.setDimensionInfo(ConfigHandler.ross128BID, WorldProviderRoss128b.class); Ross128SolarSystem.Ross128b.setTierRequired(ConfigHandler.ross128btier); Ross128SolarSystem.Ross128ba = new Moon("Ross128ba").setParentPlanet(Ross128SolarSystem.Ross128b); - Ross128SolarSystem.Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)).setRelativeOrbitTime(1 / 0.01F); - Ross128SolarSystem.Ross128ba.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); + Ross128SolarSystem.Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)) + .setRelativeOrbitTime(1 / 0.01F); + Ross128SolarSystem.Ross128ba.setBodyIcon( + new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128ba.class); - Ross128SolarSystem.Ross128ba.setTierRequired(LoaderReference.GalaxySpace ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3); + Ross128SolarSystem.Ross128ba.setTierRequired( + LoaderReference.GalaxySpace ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3); GalaxyRegistry.registerSolarSystem(Ross128SolarSystem.Ross128System); GalaxyRegistry.registerPlanet(Ross128SolarSystem.Ross128b); GalaxyRegistry.registerMoon(Ross128SolarSystem.Ross128ba); - GalacticraftRegistry.registerRocketGui(WorldProviderRoss128b.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/overworldRocketGui.png")); - GalacticraftRegistry.registerRocketGui(WorldProviderRoss128ba.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/moonRocketGui.png")); + GalacticraftRegistry.registerRocketGui( + WorldProviderRoss128b.class, + new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/overworldRocketGui.png")); + GalacticraftRegistry.registerRocketGui( + WorldProviderRoss128ba.class, + new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/moonRocketGui.png")); GalacticraftRegistry.registerTeleportType(WorldProviderRoss128b.class, new UniversalTeleportType()); GalacticraftRegistry.registerTeleportType(WorldProviderRoss128ba.class, new UniversalTeleportType()); } - } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java index a2f3f78861..e2271aaeff 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java @@ -37,7 +37,6 @@ public class DysonSwarmSunReplacement extends MetaTileEntity { private static long dysonObjs; private static long swarmControllers; - public DysonSwarmSunReplacement(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) { super(aID, aBasicName, aRegionalName, aInvSlotCount); } @@ -46,13 +45,18 @@ public class DysonSwarmSunReplacement extends MetaTileEntity { super(aName, aInvSlotCount); } - - public void toggle(){ + public void toggle() { if (!wasBuild) { - GalacticraftCore.solarSystemSol.getMainStar().setBodyIcon(new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/moon.png")); + GalacticraftCore.solarSystemSol + .getMainStar() + .setBodyIcon(new ResourceLocation( + GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/moon.png")); wasBuild = !wasBuild; } else { - GalacticraftCore.solarSystemSol.getMainStar().setBodyIcon(new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/sun.png")); + GalacticraftCore.solarSystemSol + .getMainStar() + .setBodyIcon(new ResourceLocation( + GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/sun.png")); wasBuild = !wasBuild; } } @@ -75,7 +79,7 @@ public class DysonSwarmSunReplacement extends MetaTileEntity { @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new DysonSwarmSunReplacement(this.mName,this.mInventory.length); + return new DysonSwarmSunReplacement(this.mName, this.mInventory.length); } @Override @@ -90,7 +94,8 @@ public class DysonSwarmSunReplacement extends MetaTileEntity { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - aBaseMetaTileEntity.increaseStoredEnergyUnits((DysonSwarmSunReplacement.dysonObjs*10000)/ swarmControllers, true); + aBaseMetaTileEntity.increaseStoredEnergyUnits( + (DysonSwarmSunReplacement.dysonObjs * 10000) / swarmControllers, true); } public boolean isEnetOutput() { @@ -113,8 +118,8 @@ public class DysonSwarmSunReplacement extends MetaTileEntity { } @Override - public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + public ITexture[] getTexture( + IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { return new ITexture[0]; } - } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java index 1fbddb01b1..77dc5c2c22 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java @@ -28,53 +28,29 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; public class GalaxySpaceProxy { - private GalaxySpaceProxy() { - } + private GalaxySpaceProxy() {} - public static void postInit(FMLPostInitializationEvent e){ + public static void postInit(FMLPostInitializationEvent e) {} - } + public static void preInit(FMLPreInitializationEvent e) {} - public static void preInit(FMLPreInitializationEvent e) { + private static void serverpreInit(FMLPreInitializationEvent e) {} - } + private static void clientpreInit(FMLPreInitializationEvent e) {} - private static void serverpreInit(FMLPreInitializationEvent e) { + private static void commonpreInit(FMLPreInitializationEvent e) {} - } + public static void init(FMLInitializationEvent e) {} - private static void clientpreInit(FMLPreInitializationEvent e) { - } + private static void serverInit(FMLInitializationEvent e) {} - private static void commonpreInit(FMLPreInitializationEvent e) { + private static void clientInit(FMLInitializationEvent e) {} - } + private static void commonInit(FMLInitializationEvent e) {} - public static void init(FMLInitializationEvent e) { + private static void serverPostInit(FMLPostInitializationEvent e) {} - } - - private static void serverInit(FMLInitializationEvent e) { - - } - - private static void clientInit(FMLInitializationEvent e) { - - } - - private static void commonInit(FMLInitializationEvent e) { - - } - private static void serverPostInit(FMLPostInitializationEvent e) { - - } - - private static void clientPostInit(FMLPostInitializationEvent e) { - - } - - private static void commonPostInit(FMLPostInitializationEvent e) { - - } + private static void clientPostInit(FMLPostInitializationEvent e) {} + private static void commonPostInit(FMLPostInitializationEvent e) {} } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java index 7a01028a61..ea4e349ca8 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java @@ -31,7 +31,7 @@ public class GT_NBT_DataBase { private static final BiMap tagIdBiMap = HashBiMap.create(); private static final BiMap GTNBTBIMAP = HashBiMap.create(); - private static long maxID = Long.MIN_VALUE+1; + private static long maxID = Long.MIN_VALUE + 1; private final NBTTagCompound tagCompound; @@ -45,23 +45,23 @@ public class GT_NBT_DataBase { this.tagCompound = tagCompound; this.id = GT_NBT_DataBase.maxID; GT_NBT_DataBase.tagIdBiMap.put(tagCompound, this.id); - GT_NBT_DataBase.GTNBTBIMAP.put(this,this.id); + GT_NBT_DataBase.GTNBTBIMAP.put(this, this.id); ++GT_NBT_DataBase.maxID; } - static GT_NBT_DataBase getGTTagFromId(Long id){ + static GT_NBT_DataBase getGTTagFromId(Long id) { return GT_NBT_DataBase.GTNBTBIMAP.inverse().get(id); } - static Long getIdFromGTTag(GT_NBT_DataBase tagCompound){ + static Long getIdFromGTTag(GT_NBT_DataBase tagCompound) { return GT_NBT_DataBase.GTNBTBIMAP.get(tagCompound); } - static NBTTagCompound getTagFromId(Long id){ + static NBTTagCompound getTagFromId(Long id) { return GT_NBT_DataBase.tagIdBiMap.inverse().get(id); } - static Long getIdFromTag(NBTTagCompound tagCompound){ + static Long getIdFromTag(NBTTagCompound tagCompound) { return GT_NBT_DataBase.tagIdBiMap.get(tagCompound); } @@ -96,7 +96,8 @@ public class GT_NBT_DataBase { this.id = id; } - public static GT_NBT_DataBase makeNewWithoutRegister(String mDataName, String mDataTitle, NBTTagCompound tagCompound){ - return new GT_NBT_DataBase(tagCompound,mDataName,mDataTitle,Long.MIN_VALUE); + public static GT_NBT_DataBase makeNewWithoutRegister( + String mDataName, String mDataTitle, NBTTagCompound tagCompound) { + return new GT_NBT_DataBase(tagCompound, mDataName, mDataTitle, Long.MIN_VALUE); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java index 082b7307d1..fd69d50483 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java @@ -32,6 +32,9 @@ import cpw.mods.fml.common.Optional; import gregtech.api.enums.ItemList; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; import li.cil.oc.api.machine.Arguments; import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; @@ -42,14 +45,11 @@ import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers") -public class TileEntity_GTDataServer extends TileEntity implements ISidedInventory, ITileWithGUI, ITileAddsInformation, ITileHasDifferentTextureSides, SimpleComponent { +public class TileEntity_GTDataServer extends TileEntity + implements ISidedInventory, ITileWithGUI, ITileAddsInformation, ITileHasDifferentTextureSides, SimpleComponent { - private final BiMap OrbDataBase = HashBiMap.create(); + private final BiMap OrbDataBase = HashBiMap.create(); private ItemStack[] mItems = new ItemStack[2]; private byte TickTimer; @@ -63,8 +63,9 @@ public class TileEntity_GTDataServer extends TileEntity implements ISidedInvento @Callback public Object[] listData(Context context, Arguments args) { Set ret = new HashSet<>(); - for (Map.Entry entry : OrbDataBase.entrySet()){ - ret.add((entry.getValue().getId()+Long.MAX_VALUE)+". "+entry.getValue().getmDataTitle()); + for (Map.Entry entry : OrbDataBase.entrySet()) { + ret.add((entry.getValue().getId() + Long.MAX_VALUE) + ". " + + entry.getValue().getmDataTitle()); } return ret.toArray(new String[0]); } @@ -72,21 +73,19 @@ public class TileEntity_GTDataServer extends TileEntity implements ISidedInvento @Optional.Method(modid = "OpenComputers") @Callback public Object[] imprintOrb(Context context, Arguments args) { - return new Object[]{false}; + return new Object[] {false}; } - - private boolean isServerSide(){ + private boolean isServerSide() { return !this.worldObj.isRemote || SideReference.Side.Server; } @Override public void updateEntity() { - if (this.TickTimer++ % 20 != 0) - return; - + if (this.TickTimer++ % 20 != 0) return; + if (this.isServerSide()) { - if (GT_Utility.areStacksEqual(this.mItems[0],ItemList.Tool_DataOrb.get(1))) { + if (GT_Utility.areStacksEqual(this.mItems[0], ItemList.Tool_DataOrb.get(1))) { if (this.mItems[0].hasTagCompound()) { if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) { this.OrbDataBase.put( @@ -94,37 +93,33 @@ public class TileEntity_GTDataServer extends TileEntity implements ISidedInvento new GT_NBT_DataBase( Behaviour_DataOrb.getDataName(this.mItems[0]), Behaviour_DataOrb.getDataTitle(this.mItems[0]), - this.mItems[0].getTagCompound() - ) - ); + this.mItems[0].getTagCompound())); } else { long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()); - this.OrbDataBase.put(id,GT_NBT_DataBase.getGTTagFromId(id)); + this.OrbDataBase.put(id, GT_NBT_DataBase.getGTTagFromId(id)); } } } - if (GT_Utility.areStacksEqual(this.mItems[0],ItemList.Tool_DataStick.get(1))) { + if (GT_Utility.areStacksEqual(this.mItems[0], ItemList.Tool_DataStick.get(1))) { if (this.mItems[0].hasTagCompound()) { - + String bookTitle = GT_Utility.ItemNBT.getBookTitle(this.mItems[0]); String punchcardData = GT_Utility.ItemNBT.getPunchCardData(this.mItems[0]); short mapID = GT_Utility.ItemNBT.getMapID(this.mItems[0]); byte data = (byte) (bookTitle.isEmpty() ? punchcardData.isEmpty() ? mapID != -1 ? 3 : -1 : 2 : 1); - - String title = data == 1 ? bookTitle : data == 2 ? punchcardData : data == 3 ? ""+mapID : "Custom Data"; - String name = data == 1 ? "eBook" : data == 2 ? "Punch Card Data" : data == 3 ? "Map Data" : "Custom Data"; + + String title = + data == 1 ? bookTitle : data == 2 ? punchcardData : data == 3 ? "" + mapID : "Custom Data"; + String name = data == 1 + ? "eBook" + : data == 2 ? "Punch Card Data" : data == 3 ? "Map Data" : "Custom Data"; if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) { this.OrbDataBase.put( GT_NBT_DataBase.getMaxID(), - new GT_NBT_DataBase( - name, - title, - this.mItems[0].getTagCompound() - ) - ); + new GT_NBT_DataBase(name, title, this.mItems[0].getTagCompound())); } else { - long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()); - this.OrbDataBase.put(id,GT_NBT_DataBase.getGTTagFromId(id)); + long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()); + this.OrbDataBase.put(id, GT_NBT_DataBase.getGTTagFromId(id)); } } } @@ -137,9 +132,7 @@ public class TileEntity_GTDataServer extends TileEntity implements ISidedInvento } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - - } + public void registerBlockIcons(IIconRegister par1IconRegister) {} @Override public int getGUIID() { @@ -183,9 +176,8 @@ public class TileEntity_GTDataServer extends TileEntity implements ISidedInvento @Override public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { - if (p_70299_1_ > 1 || p_70299_1_ < 0) - return; - this.mItems[p_70299_1_]=p_70299_2_; + if (p_70299_1_ > 1 || p_70299_1_ < 0) return; + this.mItems[p_70299_1_] = p_70299_2_; } @Override @@ -209,14 +201,10 @@ public class TileEntity_GTDataServer extends TileEntity implements ISidedInvento } @Override - public void openInventory() { - - } + public void openInventory() {} @Override - public void closeInventory() { - - } + public void closeInventory() {} @Override public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java index ffac1554d4..7caac936d5 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java @@ -29,15 +29,15 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; - import java.util.ArrayList; import java.util.Iterator; -@SuppressWarnings({"unused","RedundantSuppression"}) +@SuppressWarnings({"unused", "RedundantSuppression"}) public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { ArrayList mTTEnergyHatches = new ArrayList<>(); ArrayList mTTDynamos = new ArrayList<>(); + public TT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -46,21 +46,19 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { super(aName); } - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new TT_TileEntity_ManualTrafo(this.mName); } - public boolean addEnergyOutput(long aEU) { if (aEU <= 0L) { return true; } else { - return mTTDynamos.size() > 0 || this.mDynamoHatches.size() > 0 && this.addEnergyOutputMultipleDynamos(aEU, true); + return mTTDynamos.size() > 0 + || this.mDynamoHatches.size() > 0 && this.addEnergyOutputMultipleDynamos(aEU, true); } } - public boolean addEnergyOutputMultipleDynamos(long aEU, boolean aAllowMixedVoltageDynamos) { int injected = 0; long totalOutput = 0L; @@ -69,7 +67,7 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { Iterator var10 = this.mDynamoHatches.iterator(); long aVoltage; - while(var10.hasNext()) { + while (var10.hasNext()) { GT_MetaTileEntity_Hatch_Dynamo aDynamo = var10.next(); if (aDynamo == null) { return false; @@ -94,7 +92,7 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { } else { Iterator var17 = this.mDynamoHatches.iterator(); - while(true) { + while (true) { GT_MetaTileEntity_Hatch_Dynamo aDynamo; do { if (!var17.hasNext()) { @@ -102,20 +100,20 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { } aDynamo = var17.next(); - } while(!isValidMetaTileEntity(aDynamo)); + } while (!isValidMetaTileEntity(aDynamo)); - long leftToInject = aEU - (long)injected; + long leftToInject = aEU - (long) injected; aVoltage = aDynamo.maxEUOutput(); - int aAmpsToInject = (int)(leftToInject / aVoltage); - int aRemainder = (int)(leftToInject - (long)aAmpsToInject * aVoltage); - int ampsOnCurrentHatch = (int)Math.min(aDynamo.maxAmperesOut(), aAmpsToInject); + int aAmpsToInject = (int) (leftToInject / aVoltage); + int aRemainder = (int) (leftToInject - (long) aAmpsToInject * aVoltage); + int ampsOnCurrentHatch = (int) Math.min(aDynamo.maxAmperesOut(), aAmpsToInject); - for(int i = 0; i < ampsOnCurrentHatch; ++i) { + for (int i = 0; i < ampsOnCurrentHatch; ++i) { aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage, false); } - injected = (int)((long)injected + aVoltage * (long)ampsOnCurrentHatch); - if (aRemainder > 0 && (long)ampsOnCurrentHatch < aDynamo.maxAmperesOut()) { + injected = (int) ((long) injected + aVoltage * (long) ampsOnCurrentHatch); + if (aRemainder > 0 && (long) ampsOnCurrentHatch < aDynamo.maxAmperesOut()) { aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aRemainder, false); injected += aRemainder; } @@ -123,8 +121,6 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { } } - - public boolean drainEnergyInput(long aEU) { if (aEU > 0L) { { @@ -137,7 +133,8 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { } tHatch = var3.next(); - } while (!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); + } while (!isValidMetaTileEntity(tHatch) + || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); } { Iterator var3 = this.mEnergyHatches.iterator(); @@ -149,10 +146,10 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { } tHatch = var3.next(); - } while (!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); + } while (!isValidMetaTileEntity(tHatch) + || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); } - } return true; } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java index aea0bd9ec9..593fcf33b8 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java @@ -30,11 +30,10 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Utility; +import java.util.List; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; -import java.util.List; - public interface TecTechEnabledMulti { List getVanillaEnergyHatches(); @@ -58,7 +57,7 @@ public interface TecTechEnabledMulti { maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); } } - return new long[]{storedEnergy, maxEnergy}; + return new long[] {storedEnergy, maxEnergy}; } default String[] getInfoDataArray(GT_MetaTileEntity_MultiBlockBase multiBlockBase) { @@ -81,26 +80,30 @@ public interface TecTechEnabledMulti { } } - return new String[]{ - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(multiBlockBase.mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(multiBlockBase.mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", - StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + - EnumChatFormatting.RED + GT_Utility.formatNumbers(-multiBlockBase.mEUt) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(multiBlockBase.getMaxInputVoltage()) + EnumChatFormatting.RESET + " EU/t(*2A) " + - StatCollector.translateToLocal("GT5U.machines.tier") + ": " + - EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(multiBlockBase.getMaxInputVoltage())] + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + - EnumChatFormatting.RED + (multiBlockBase.getIdealStatus() - multiBlockBase.getRepairStatus()) + EnumChatFormatting.RESET + " " + - StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + - EnumChatFormatting.YELLOW + (float) multiBlockBase.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + - EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; + return new String[] { + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(multiBlockBase.mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(multiBlockBase.mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(-multiBlockBase.mEUt) + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(multiBlockBase.getMaxInputVoltage()) + EnumChatFormatting.RESET + + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + EnumChatFormatting.YELLOW + + GT_Values.VN[GT_Utility.getTier(multiBlockBase.getMaxInputVoltage())] + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + + (multiBlockBase.getIdealStatus() - multiBlockBase.getRepairStatus()) + EnumChatFormatting.RESET + + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + EnumChatFormatting.YELLOW + + (float) multiBlockBase.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + + mPollutionReduction + EnumChatFormatting.RESET + " %", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + }; } - } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java index ce810e2125..83d1604d11 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java @@ -39,7 +39,9 @@ public class TecTechResearchLoader { @SuppressWarnings("deprecation") public static void runResearches() { - Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null ? FluidRegistry.getFluid("molten.indalloy140") : FluidRegistry.getFluid("molten.solderingalloy"); + Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null + ? FluidRegistry.getFluid("molten.indalloy140") + : FluidRegistry.getFluid("molten.solderingalloy"); if (LoaderReference.galacticgreg) { @@ -49,23 +51,20 @@ public class TecTechResearchLoader { 256, BW_Util.getMachineVoltageFromTier(7), 24, - new Object[]{ - ItemRegistry.voidminer[0].copy(), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), - Materials.BlackPlutonium.getPlates(3), - ItemList.Electric_Motor_ZPM.get(9L), - ItemList.Sensor_ZPM.get(9L), - ItemList.Field_Generator_ZPM.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) + new Object[] { + ItemRegistry.voidminer[0].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), + Materials.BlackPlutonium.getPlates(3), + ItemList.Electric_Motor_ZPM.get(9L), + ItemList.Sensor_ZPM.get(9L), + ItemList.Field_Generator_ZPM.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 1440), - WerkstoffLoader.Krypton.getFluidOrGas(20000) + new FluidStack[] {new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Krypton.getFluidOrGas(20000) }, ItemRegistry.voidminer[1].copy(), 216000, - BW_Util.getMachineVoltageFromTier(7) - ); + BW_Util.getMachineVoltageFromTier(7)); TT_recipeAdder.addResearchableAssemblylineRecipe( ItemRegistry.voidminer[1].copy(), @@ -73,24 +72,21 @@ public class TecTechResearchLoader { 512, BW_Util.getMachineVoltageFromTier(8), 64, - new Object[]{ - ItemRegistry.voidminer[1].copy(), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), - Materials.Neutronium.getPlates(3), - ItemList.Electric_Motor_UV.get(9L), - ItemList.Sensor_UV.get(9L), - ItemList.Field_Generator_UV.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) + new Object[] { + ItemRegistry.voidminer[1].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), + Materials.Neutronium.getPlates(3), + ItemList.Electric_Motor_UV.get(9L), + ItemList.Sensor_UV.get(9L), + ItemList.Field_Generator_UV.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 1440), - WerkstoffLoader.Oganesson.getFluidOrGas(20000) + new FluidStack[] { + new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Oganesson.getFluidOrGas(20000) }, ItemRegistry.voidminer[2].copy(), 432000, - BW_Util.getMachineVoltageFromTier(8) - ); - + BW_Util.getMachineVoltageFromTier(8)); } TT_recipeAdder.addResearchableAssemblylineRecipe( @@ -99,45 +95,50 @@ public class TecTechResearchLoader { 48, BW_Util.getMachineVoltageFromTier(8), 8, - new Object[]{ - ItemList.Machine_Multi_ImplosionCompressor.get(1L), - Materials.Neutronium.getBlocks(5), - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64), - ItemList.Electric_Piston_UV.get(64), + new Object[] { + ItemList.Machine_Multi_ImplosionCompressor.get(1L), + Materials.Neutronium.getBlocks(5), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64), + ItemList.Electric_Piston_UV.get(64), }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 1440), - Materials.Osmium.getMolten(1440), - Materials.Neutronium.getMolten(1440) + new FluidStack[] { + new FluidStack(solderIndalloy, 1440), + Materials.Osmium.getMolten(1440), + Materials.Neutronium.getMolten(1440) }, ItemRegistry.eic.copy(), 240000, - BW_Util.getMachineVoltageFromTier(8) - ); + BW_Util.getMachineVoltageFromTier(8)); -// BartWorksCrossmod.LOGGER.info("Nerfing Assembly Lines >= LuV Recipes to run with TecTech!"); -// HashSet toRem = new HashSet<>(); -// for (GT_Recipe.GT_Recipe_AssemblyLine recipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){ -// if (recipe.mEUt >= BW_Util.getTierVoltage(6) && !GT_Utility.areStacksEqual(recipe.mResearchItem, CustomItemList.UnusedStuff.get(1L))){ -// String modId = GameRegistry.findUniqueIdentifierFor(recipe.mOutput.getItem()).modId; -// if (!modId.equalsIgnoreCase("tectech")) -// if (!modId.equalsIgnoreCase("gregtech") || modId.equalsIgnoreCase("gregtech") && (recipe.mOutput.getItemDamage() < 15000 || recipe.mOutput.getItemDamage() > 16999)) -// toRem.add(recipe); -// } -// } -// HashSet toRemVisualScanner = new HashSet<>(); -// HashSet toRemVisualAssLine = new HashSet<>(); -// GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.removeAll(toRem); -// -// for (GT_Recipe.GT_Recipe_AssemblyLine recipe : toRem){ -// GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.stream().filter(re -> GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisualAssLine::add); -// GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.stream().filter(re -> GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisualScanner::add); -// TT_recipeAdder.addResearchableAssemblylineRecipe(recipe.mResearchItem, recipe.mResearchTime, recipe.mResearchTime/1000, recipe.mEUt, GT_Utility.getTier(recipe.mEUt)-2, recipe.mInputs, recipe.mFluidInputs, recipe.mOutput, recipe.mDuration, recipe.mEUt); -// } -// -// GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.removeAll(toRemVisualScanner); -// GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.removeAll(toRemVisualAssLine); + // BartWorksCrossmod.LOGGER.info("Nerfing Assembly Lines >= LuV Recipes to run with TecTech!"); + // HashSet toRem = new HashSet<>(); + // for (GT_Recipe.GT_Recipe_AssemblyLine recipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){ + // if (recipe.mEUt >= BW_Util.getTierVoltage(6) && !GT_Utility.areStacksEqual(recipe.mResearchItem, + // CustomItemList.UnusedStuff.get(1L))){ + // String modId = GameRegistry.findUniqueIdentifierFor(recipe.mOutput.getItem()).modId; + // if (!modId.equalsIgnoreCase("tectech")) + // if (!modId.equalsIgnoreCase("gregtech") || modId.equalsIgnoreCase("gregtech") && + // (recipe.mOutput.getItemDamage() < 15000 || recipe.mOutput.getItemDamage() > 16999)) + // toRem.add(recipe); + // } + // } + // HashSet toRemVisualScanner = new HashSet<>(); + // HashSet toRemVisualAssLine = new HashSet<>(); + // GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.removeAll(toRem); + // + // for (GT_Recipe.GT_Recipe_AssemblyLine recipe : toRem){ + // GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.stream().filter(re -> + // GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisualAssLine::add); + // GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.stream().filter(re -> + // GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisualScanner::add); + // TT_recipeAdder.addResearchableAssemblylineRecipe(recipe.mResearchItem, recipe.mResearchTime, + // recipe.mResearchTime/1000, recipe.mEUt, GT_Utility.getTier(recipe.mEUt)-2, recipe.mInputs, + // recipe.mFluidInputs, recipe.mOutput, recipe.mDuration, recipe.mEUt); + // } + // + // GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.removeAll(toRemVisualScanner); + // GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.removeAll(toRemVisualAssLine); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java index c392754c0c..f8d0db5ea6 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java @@ -26,5 +26,6 @@ import gregtech.api.enums.HeatingCoilLevel; public interface IHasCoils { void setCoilHeat(HeatingCoilLevel coilMeta); + HeatingCoilLevel getCoilHeat(); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java index 05ca3b665f..af3059ea7c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java @@ -33,34 +33,31 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB public class TecTechUtils { @Deprecated - public static boolean addEnergyInputToMachineList(TecTechEnabledMulti baseTE, IGregTechTileEntity te, int aBaseCasingIndex){ + public static boolean addEnergyInputToMachineList( + TecTechEnabledMulti baseTE, IGregTechTileEntity te, int aBaseCasingIndex) { return addEnergyInputToMachineList(baseTE, te, aBaseCasingIndex, -1) != -1; } - public static int addEnergyInputToMachineList(TecTechEnabledMulti baseTE, IGregTechTileEntity te, int aBaseCasingIndex, int aTier) { - if (te == null || !(te.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch)) - return -1; + public static int addEnergyInputToMachineList( + TecTechEnabledMulti baseTE, IGregTechTileEntity te, int aBaseCasingIndex, int aTier) { + if (te == null || !(te.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch)) return -1; else { GT_MetaTileEntity_Hatch mte = (GT_MetaTileEntity_Hatch) te.getMetaTileEntity(); - if(mte.mTier != aTier && aTier != -1) - return -1; + if (mte.mTier != aTier && aTier != -1) return -1; if (mte instanceof GT_MetaTileEntity_Hatch_EnergyTunnel) - if(baseTE.getVanillaEnergyHatches().isEmpty() && baseTE.getTecTechEnergyMultis().isEmpty()) + if (baseTE.getVanillaEnergyHatches().isEmpty() + && baseTE.getTecTechEnergyMultis().isEmpty()) baseTE.getTecTechEnergyTunnels().add((GT_MetaTileEntity_Hatch_EnergyTunnel) mte); - else - return -1; - else if(baseTE.getTecTechEnergyTunnels().isEmpty()) { + else return -1; + else if (baseTE.getTecTechEnergyTunnels().isEmpty()) { if (mte instanceof GT_MetaTileEntity_Hatch_Energy) baseTE.getVanillaEnergyHatches().add((GT_MetaTileEntity_Hatch_Energy) mte); else if (mte instanceof GT_MetaTileEntity_Hatch_EnergyMulti) baseTE.getTecTechEnergyMultis().add((GT_MetaTileEntity_Hatch_EnergyMulti) mte); - else - return -1; - } - else - return -1; + else return -1; + } else return -1; mte.updateTexture(aBaseCasingIndex); return mte.mTier; @@ -68,8 +65,7 @@ public class TecTechUtils { } public static boolean drainEnergyMEBFTecTech(TecTechEnabledMulti multi, long aEU) { - if (aEU <= 0) - return true; + if (aEU <= 0) return true; long allTheEu = 0; int hatches = 0; @@ -91,8 +87,7 @@ public class TecTechUtils { hatches++; } - if (allTheEu < aEU) - return false; + if (allTheEu < aEU) return false; if (hatches == 0) return false; @@ -109,7 +104,10 @@ public class TecTechUtils { for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : multi.getTecTechEnergyMultis()) hasDrained &= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); - return hasDrained && (multi.getVanillaEnergyHatches().size() > 0 || multi.getTecTechEnergyTunnels().size() > 0 || multi.getTecTechEnergyMultis().size() > 0); + return hasDrained + && (multi.getVanillaEnergyHatches().size() > 0 + || multi.getTecTechEnergyTunnels().size() > 0 + || multi.getTecTechEnergyMultis().size() > 0); } public static long getnominalVoltageTT(TecTechEnabledMulti base) { @@ -181,6 +179,6 @@ public class TecTechUtils { } public static long getEUPerTickFromLaser(GT_MetaTileEntity_Hatch_EnergyTunnel tHatch) { - return tHatch.Amperes * tHatch.maxEUInput()/* - (tHatch.Amperes / 20)*/; + return tHatch.Amperes * tHatch.maxEUInput() /* - (tHatch.Amperes / 20)*/; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java index 9cc15b6773..77677ed79b 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java @@ -40,8 +40,7 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel return false; } - default void setEUVar(long aEnergy) { - } + default void setEUVar(long aEnergy) {} default long getAMPERES() { return -1; @@ -70,7 +69,8 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel byte opposite = GT_Utility.getOppositeSide(front); for (short dist = 1; dist < 250; ++dist) { - IGregTechTileEntity tGTTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSideAndDistance(front, dist); + IGregTechTileEntity tGTTileEntity = + aBaseMetaTileEntity.getIGregTechTileEntityAtSideAndDistance(front, dist); if (tGTTileEntity == null || tGTTileEntity.getColorization() != color) { return; } @@ -80,23 +80,35 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel return; } - if (aMetaTileEntity instanceof LowPowerLaser && ((LowPowerLaser) aMetaTileEntity).isReceiver() && opposite == tGTTileEntity.getFrontFacing()) { - if (this.maxEUOutput() > ((LowPowerLaser) aMetaTileEntity).maxEUInput() || this.getAMPERES() > ((LowPowerLaser) aMetaTileEntity).getAMPERES()) { + if (aMetaTileEntity instanceof LowPowerLaser + && ((LowPowerLaser) aMetaTileEntity).isReceiver() + && opposite == tGTTileEntity.getFrontFacing()) { + if (this.maxEUOutput() > ((LowPowerLaser) aMetaTileEntity).maxEUInput() + || this.getAMPERES() > ((LowPowerLaser) aMetaTileEntity).getAMPERES()) { aMetaTileEntity.doExplosion(this.maxEUOutput()); this.setEUVar(aBaseMetaTileEntity.getStoredEU() - this.maxEUOutput()); return; } if (this.maxEUOutput() == ((LowPowerLaser) aMetaTileEntity).maxEUInput()) { - long diff = Math.min(this.getAMPERES() * 20L * this.maxEUOutput(), Math.min(((LowPowerLaser) aMetaTileEntity).maxEUStore() - aMetaTileEntity.getBaseMetaTileEntity().getStoredEU(), aBaseMetaTileEntity.getStoredEU())); + long diff = Math.min( + this.getAMPERES() * 20L * this.maxEUOutput(), + Math.min( + ((LowPowerLaser) aMetaTileEntity).maxEUStore() + - aMetaTileEntity + .getBaseMetaTileEntity() + .getStoredEU(), + aBaseMetaTileEntity.getStoredEU())); this.setEUVar(aBaseMetaTileEntity.getStoredEU() - diff); - ((LowPowerLaser) aMetaTileEntity).setEUVar(aMetaTileEntity.getBaseMetaTileEntity().getStoredEU() + diff); + ((LowPowerLaser) aMetaTileEntity) + .setEUVar( + aMetaTileEntity.getBaseMetaTileEntity().getStoredEU() + diff); } return; } - - if ((!(aMetaTileEntity instanceof LowPowerLaser) || !((LowPowerLaser) aMetaTileEntity).isTunnel()) && !(aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy)) { + if ((!(aMetaTileEntity instanceof LowPowerLaser) || !((LowPowerLaser) aMetaTileEntity).isTunnel()) + && !(aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy)) { return; } @@ -107,8 +119,7 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel ((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).markUsed(); } else if (aMetaTileEntity instanceof LowPowerLaser && ((LowPowerLaser) aMetaTileEntity).isTunnel()) { - if (!((LowPowerLaser) aMetaTileEntity).isConnectedCorrectly(front)) - return; + if (!((LowPowerLaser) aMetaTileEntity).isConnectedCorrectly(front)) return; } } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java index 34473eab6c..f6db55e4d3 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java @@ -26,32 +26,55 @@ import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import java.util.Optional; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import java.util.Optional; - -public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_TieredMachineBlock implements LowPowerLaser { +public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_TieredMachineBlock + implements LowPowerLaser { protected long AMPERES; - public TT_Abstract_LowPowerLaserThingy(int aID, String aName, String aNameRegional, int aTier, long aAmperes, int aInvSlotCount, String aDescription, ITexture... aTextures) { + public TT_Abstract_LowPowerLaserThingy( + int aID, + String aName, + String aNameRegional, + int aTier, + long aAmperes, + int aInvSlotCount, + String aDescription, + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); this.AMPERES = aAmperes; } - public TT_Abstract_LowPowerLaserThingy(int aID, String aName, String aNameRegional, int aTier, long aAmperes, int aInvSlotCount, String[] aDescription, ITexture... aTextures) { + public TT_Abstract_LowPowerLaserThingy( + int aID, + String aName, + String aNameRegional, + int aTier, + long aAmperes, + int aInvSlotCount, + String[] aDescription, + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); this.AMPERES = aAmperes; } - public TT_Abstract_LowPowerLaserThingy(String aName, int aTier, long aAmperes, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + public TT_Abstract_LowPowerLaserThingy( + String aName, int aTier, long aAmperes, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); this.AMPERES = aAmperes; } - public TT_Abstract_LowPowerLaserThingy(String aName, int aTier, long aAmperes, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + public TT_Abstract_LowPowerLaserThingy( + String aName, + int aTier, + long aAmperes, + int aInvSlotCount, + String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); this.AMPERES = aAmperes; } @@ -93,16 +116,12 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_ @Override public void saveNBTData(NBTTagCompound nbtTagCompound) { - Optional.ofNullable(nbtTagCompound).ifPresent( - tag -> tag.setLong("AMPERES", AMPERES) - ); + Optional.ofNullable(nbtTagCompound).ifPresent(tag -> tag.setLong("AMPERES", AMPERES)); } @Override public void loadNBTData(NBTTagCompound nbtTagCompound) { - Optional.ofNullable(nbtTagCompound).ifPresent( - tag -> AMPERES = tag.getLong("AMPERES") - ); + Optional.ofNullable(nbtTagCompound).ifPresent(tag -> AMPERES = tag.getLong("AMPERES")); } @Override @@ -154,5 +173,4 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_ public long maxEUStore() { return 512L + GT_Values.V[this.mTier + 1] * 24L * AMPERES; } - } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java index 3247af4861..996a106b4b 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java @@ -32,11 +32,13 @@ import gregtech.api.util.GT_Utility; public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLaserThingy { - public TT_MetaTileEntity_LowPowerLaserBox(int aID, String aName, String aNameRegional, int aTier, long aAmperes, ITexture... aTextures) { + public TT_MetaTileEntity_LowPowerLaserBox( + int aID, String aName, String aNameRegional, int aTier, long aAmperes, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aAmperes, 0, new String[0], aTextures); } - public TT_MetaTileEntity_LowPowerLaserBox(String aName, int aTier, long aAmperes, String[] aDescription, ITexture[][][] aTextures) { + public TT_MetaTileEntity_LowPowerLaserBox( + String aName, int aTier, long aAmperes, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aAmperes, 0, aDescription, aTextures); } @@ -92,7 +94,8 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new TT_MetaTileEntity_LowPowerLaserBox(this.mName, this.mTier, this.AMPERES, this.mDescriptionArray, this.mTextures); + return new TT_MetaTileEntity_LowPowerLaserBox( + this.mName, this.mTier, this.AMPERES, this.mDescriptionArray, this.mTextures); } @Override @@ -116,39 +119,82 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase } } - @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[12][17][]; for (byte i = -1; i < 16; ++i) { - rTextures[0][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; - rTextures[1][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; - rTextures[2][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; - rTextures[3][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier]}; - rTextures[4][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier]}; - rTextures[5][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier]}; - rTextures[6][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; - rTextures[7][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; - rTextures[8][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; - rTextures[9][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier]}; - rTextures[10][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier]}; - rTextures[11][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier]}; + rTextures[0][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] + }; + rTextures[1][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] + }; + rTextures[2][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] + }; + rTextures[3][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] + }; + rTextures[4][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] + }; + rTextures[5][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] + }; + rTextures[6][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] + }; + rTextures[7][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] + }; + rTextures[8][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] + }; + rTextures[9][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] + }; + rTextures[10][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] + }; + rTextures[11][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] + }; } return rTextures; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { return this.mTextures[Math.min(2, aSide) + (aSide == aFacing ? 3 : 0) + (aActive ? 0 : 6)][aColorIndex + 1]; } @Override public String[] getDescription() { - return new String[]{ - "Like a Tranformer... but for LAZORZ", - "Transfer rate: " + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + ChatColorHelper.WHITE + " EU/t", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; + return new String[] { + "Like a Tranformer... but for LAZORZ", + "Transfer rate: " + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + + ChatColorHelper.WHITE + " EU/t", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + }; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java index eef208a71e..0aa5cbee2d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java @@ -32,19 +32,22 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; @SuppressWarnings("deprecation") -public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hatch_DynamoTunnel implements LowPowerLaser { +public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hatch_DynamoTunnel + implements LowPowerLaser { public TT_MetaTileEntity_LowPowerLaserDynamo(int aID, String aName, String aNameRegional, int aTier, int aAmp) { super(aID, aName, aNameRegional, aTier, aAmp); } - public TT_MetaTileEntity_LowPowerLaserDynamo(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { + public TT_MetaTileEntity_LowPowerLaserDynamo( + String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aAmp, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new TT_MetaTileEntity_LowPowerLaserDynamo(this.mName, this.mTier, this.Amperes, this.mDescription, this.mTextures); + return new TT_MetaTileEntity_LowPowerLaserDynamo( + this.mName, this.mTier, this.Amperes, this.mDescription, this.mTextures); } @Override @@ -69,11 +72,12 @@ public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hat @Override public String[] getDescription() { - return new String[]{ - this.mDescription, - StatCollector.translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": " - + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + EnumChatFormatting.RESET + " EU/t", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + return new String[] { + this.mDescription, + StatCollector.translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + + EnumChatFormatting.RESET + " EU/t", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java index 7274d37af5..3cacc5e843 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java @@ -32,29 +32,33 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; @SuppressWarnings("deprecation") -public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatch_EnergyTunnel implements LowPowerLaser { +public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatch_EnergyTunnel + implements LowPowerLaser { public TT_MetaTileEntity_LowPowerLaserHatch(int aID, String aName, String aNameRegional, int aTier, int aAmp) { super(aID, aName, aNameRegional, aTier, aAmp); } - public TT_MetaTileEntity_LowPowerLaserHatch(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { + public TT_MetaTileEntity_LowPowerLaserHatch( + String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aAmp, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[]{ - this.mDescription, - StatCollector.translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " - + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + EnumChatFormatting.RESET + " EU/t", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + return new String[] { + this.mDescription, + StatCollector.translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + + EnumChatFormatting.RESET + " EU/t", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new TT_MetaTileEntity_LowPowerLaserHatch(this.mName, this.mTier, this.Amperes, this.mDescription, this.mTextures); + return new TT_MetaTileEntity_LowPowerLaserHatch( + this.mName, this.mTier, this.Amperes, this.mDescription, this.mTextures); } @Override @@ -76,5 +80,4 @@ public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatc public long getAMPERES() { return this.Amperes; } - } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java index f66014596c..4be79bfd10 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java @@ -35,26 +35,41 @@ import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Client; import ic2.core.Ic2Items; +import java.util.ArrayList; +import java.util.HashSet; import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; -import java.util.ArrayList; -import java.util.HashSet; - public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Cable implements LowPowerLaser { public TT_MetaTileEntity_Pipe_Energy_LowPower(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 0.25f, Materials.BorosilicateGlass, 0, 0, 0, false, false); } - public TT_MetaTileEntity_Pipe_Energy_LowPower(String aName, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) { + public TT_MetaTileEntity_Pipe_Energy_LowPower( + String aName, + float aThickNess, + Materials aMaterial, + long aCableLossPerMeter, + long aAmperage, + long aVoltage, + boolean aInsulated, + boolean aCanShock) { super(aName, aThickNess, aMaterial, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new TT_MetaTileEntity_Pipe_Energy_LowPower(this.mName, this.mThickNess, this.mMaterial, this.mCableLossPerMeter, this.mAmperage, this.mVoltage, this.mInsulated, this.mCanShock); + return new TT_MetaTileEntity_Pipe_Energy_LowPower( + this.mName, + this.mThickNess, + this.mMaterial, + this.mCableLossPerMeter, + this.mAmperage, + this.mVoltage, + this.mInsulated, + this.mCanShock); } @Override @@ -65,24 +80,32 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { - return new ITexture[]{ - TextureFactory.of( - Block.getBlockFromItem(Ic2Items.glassFiberCableBlock.getItem()), - Ic2Items.glassFiberCableBlock.getItemDamage(), - ForgeDirection.getOrientation(aSide) - ) + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aConnections, + byte aColorIndex, + boolean aConnected, + boolean aRedstone) { + return new ITexture[] { + TextureFactory.of( + Block.getBlockFromItem(Ic2Items.glassFiberCableBlock.getItem()), + Ic2Items.glassFiberCableBlock.getItemDamage(), + ForgeDirection.getOrientation(aSide)) }; } @Override public String[] getDescription() { - return new String[]{ - "Primitive Laser Cable intended for Low Power Applications", - "Does not auto-connect", - "Does not turn or bend", - ChatColorHelper.WHITE + "Must be " + ChatColorHelper.YELLOW + "c" + ChatColorHelper.RED + "o" + ChatColorHelper.BLUE + "l" + ChatColorHelper.DARKPURPLE + "o" + ChatColorHelper.GOLD + "r" + ChatColorHelper.DARKRED + "e" + ChatColorHelper.DARKGREEN + "d" + ChatColorHelper.WHITE + " in order to work", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + return new String[] { + "Primitive Laser Cable intended for Low Power Applications", + "Does not auto-connect", + "Does not turn or bend", + ChatColorHelper.WHITE + "Must be " + ChatColorHelper.YELLOW + "c" + ChatColorHelper.RED + "o" + + ChatColorHelper.BLUE + "l" + ChatColorHelper.DARKPURPLE + "o" + ChatColorHelper.GOLD + "r" + + ChatColorHelper.DARKRED + "e" + ChatColorHelper.DARKGREEN + "d" + ChatColorHelper.WHITE + + " in order to work", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } @@ -126,11 +149,11 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca return 0L; } - @Override @Deprecated @SuppressWarnings("deprecation") - public long transferElectricity(byte aSide, long aVoltage, long aAmperage, ArrayList aAlreadyPassedTileEntityList) { + public long transferElectricity( + byte aSide, long aVoltage, long aAmperage, ArrayList aAlreadyPassedTileEntityList) { return 0L; } @@ -140,12 +163,14 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca } @Override - public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + public boolean letsIn( + GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } @Override - public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + public boolean letsOut( + GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java index a4cff256bb..e64bcab13f 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java @@ -8,6 +8,11 @@ import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; import net.minecraftforge.common.config.Property; import tconstruct.library.TConstructRegistry; import vexatos.tgregworks.TGregworks; @@ -15,20 +20,15 @@ import vexatos.tgregworks.integration.TGregRegistry; import vexatos.tgregworks.item.ItemTGregPart; import vexatos.tgregworks.reference.Config; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; - @Mod( - modid = MaterialsInjector.MOD_ID, name = MaterialsInjector.NAME, version = MaterialsInjector.VERSION, + modid = MaterialsInjector.MOD_ID, + name = MaterialsInjector.NAME, + version = MaterialsInjector.VERSION, dependencies = "required-after:IC2; " + "required-after:gregtech; " + "required-after:bartworks;" + "before:TGregworks;" - + "before:miscutils; " -) + + "before:miscutils; ") @SuppressWarnings("unchecked") public class MaterialsInjector { @@ -57,19 +57,17 @@ public class MaterialsInjector { try { getFields(); getMethodes(); - } catch ( - IllegalArgumentException + } catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | NoSuchMethodException - | SecurityException - e) { + | SecurityException e) { MainMod.LOGGER.catching(e); FMLCommonHandler.instance().exitJava(1, true); } } - private static void getFields() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException { + private static void getFields() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException { Field configPropsField = TGregRegistry.class.getDeclaredField("configProps"); configPropsField.setAccessible(true); configProps = (HashMap) configPropsField.get(TGregworks.registry); @@ -83,7 +81,8 @@ public class MaterialsInjector { getGlobalMultiplierMethod = TGregRegistry.class.getDeclaredMethod("getGlobalMultiplier", String.class); getGlobalMultiplierMethod.setAccessible(true); - getGlobalMultiplierMethodTwoArguments = TGregRegistry.class.getDeclaredMethod("getGlobalMultiplier", String.class, double.class); + getGlobalMultiplierMethodTwoArguments = + TGregRegistry.class.getDeclaredMethod("getGlobalMultiplier", String.class, double.class); getGlobalMultiplierMethodTwoArguments.setAccessible(true); getMultiplierMethod = TGregRegistry.class.getDeclaredMethod("getMultiplier", Materials.class, String.class); @@ -134,10 +133,11 @@ public class MaterialsInjector { } } - private static void setConfigProps(Materials m){ + private static void setConfigProps(Materials m) { if (TGregworks.config.get(Config.Category.Enable, m.mName, true).getBoolean(true)) { TGregworks.registry.toolMaterials.add(m); - Property configProp = TGregworks.config.get(Config.onMaterial(Config.MaterialID), m.mName, 0, null, 0, 100000); + Property configProp = + TGregworks.config.get(Config.onMaterial(Config.MaterialID), m.mName, 0, null, 0, 100000); configProps.put(m, configProp); configIDs.add(configProp.getInt()); } @@ -145,25 +145,53 @@ public class MaterialsInjector { private static void addToolMaterial(int matID, Materials m) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { - TConstructRegistry.addToolMaterial(matID, m.mName, m.mLocalizedName, m.mToolQuality, - (int) (m.mDurability * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.Durability) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.Durability)), // Durability - (int) (m.mToolSpeed * 100F * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.MiningSpeed) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.MiningSpeed)), // Mining speed - (int) (m.mToolQuality * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.Attack) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.Attack)), // Attack - (m.mToolQuality - 0.5F) * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.HandleModifier) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.HandleModifier), // Handle Modifier - (int) getReinforcedLevelMethod.invoke(TGregworks.registry, m), (float) getStoneboundLevelMethod.invoke(TGregworks.registry, m), "", (m.getRGBA()[0] << 16) | (m.getRGBA()[1] << 8) | (m.getRGBA()[2])); + TConstructRegistry.addToolMaterial( + matID, + m.mName, + m.mLocalizedName, + m.mToolQuality, + (int) (m.mDurability + * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.Durability) + * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.Durability)), // Durability + (int) (m.mToolSpeed + * 100F + * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.MiningSpeed) + * (float) + getMultiplierMethod.invoke(TGregworks.registry, m, Config.MiningSpeed)), // Mining speed + (int) (m.mToolQuality + * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.Attack) + * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.Attack)), // Attack + (m.mToolQuality - 0.5F) + * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.HandleModifier) + * (float) getMultiplierMethod.invoke( + TGregworks.registry, m, Config.HandleModifier), // Handle Modifier + (int) getReinforcedLevelMethod.invoke(TGregworks.registry, m), + (float) getStoneboundLevelMethod.invoke(TGregworks.registry, m), + "", + (m.getRGBA()[0] << 16) | (m.getRGBA()[1] << 8) | (m.getRGBA()[2])); } private static void addBowMaterial(int matID, Materials m) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { - TConstructRegistry.addBowMaterial(matID, - (int) ((float) m.mToolQuality * 10F * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.BowDrawSpeed) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.BowDrawSpeed)), - (((float) m.mToolQuality) - 0.5F) * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.BowFlightSpeed) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.BowFlightSpeed)); + TConstructRegistry.addBowMaterial( + matID, + (int) ((float) m.mToolQuality + * 10F + * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.BowDrawSpeed) + * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.BowDrawSpeed)), + (((float) m.mToolQuality) - 0.5F) + * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.BowFlightSpeed) + * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.BowFlightSpeed)); } private static void addArrowMaterial(int matID, Materials m) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { - TConstructRegistry.addArrowMaterial(matID, - (float) ((((double) m.getMass()) / 10F) * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.ArrowMass) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.ArrowMass)), - (float) getGlobalMultiplierMethodTwoArguments.invoke(TGregworks.registry, Config.ArrowBreakChance, 0.9) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.ArrowBreakChance)); + TConstructRegistry.addArrowMaterial( + matID, + (float) ((((double) m.getMass()) / 10F) + * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.ArrowMass) + * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.ArrowMass)), + (float) getGlobalMultiplierMethodTwoArguments.invoke(TGregworks.registry, Config.ArrowBreakChance, 0.9) + * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.ArrowBreakChance)); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java index bacd18c894..07adc7e752 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java @@ -23,28 +23,33 @@ package com.github.bartimaeusnek.crossmod.thaumcraft; public class CustomAspects { -// static Constructor aspectConstructor; -// static Object TRADE; -// static Object UNIVERSE; -// static Object SCIENCE; -// static Object[] tmpArray = new Object[3]; -// static{ -// try { -// aspectConstructor = ThaumcraftHandler.AspectAdder.mAspectClass.getConstructor(String.class,int.class, Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,1).getClass(), ResourceLocation.class,int.class); -// tmpArray[0] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); -// tmpArray[1] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); -// tmpArray[2] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); -// Array.set(tmpArray[0],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("EXCHANGE").get(null)); -// Array.set(tmpArray[0],1,ThaumcraftHandler.AspectAdder.mAspectClass.getField("GREED").get(null)); -// TRADE = aspectConstructor.newInstance("Artis",0x00FF00, tmpArray[0],new ResourceLocation(MainMod.MOD_ID+":Aspects/Artis.png"),1); -// Array.set(tmpArray[1],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("MAGIC").get(null)); -// Array.set(tmpArray[1],1,ThaumcraftHandler.AspectAdder.mAspectClass.getField("ELDRITCH").get(null)); -// UNIVERSE = aspectConstructor.newInstance("Universum",0x0000FF, tmpArray[1],new ResourceLocation(MainMod.MOD_ID+":Aspects/Universum.png"),1); -// Array.set(tmpArray[2],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("MAN").get(null)); -// Array.set(tmpArray[2],1,UNIVERSE); -// SCIENCE = aspectConstructor.newInstance("Scientia",0x00FFFF, tmpArray[2],new ResourceLocation(MainMod.MOD_ID+":Aspects/Scientia.png"),1); -// } catch (NoSuchMethodException | NoSuchFieldException | IllegalAccessException | InstantiationException | InvocationTargetException e) { -// e.printStackTrace(); -// } -// } + // static Constructor aspectConstructor; + // static Object TRADE; + // static Object UNIVERSE; + // static Object SCIENCE; + // static Object[] tmpArray = new Object[3]; + // static{ + // try { + // aspectConstructor = ThaumcraftHandler.AspectAdder.mAspectClass.getConstructor(String.class,int.class, + // Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,1).getClass(), ResourceLocation.class,int.class); + // tmpArray[0] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); + // tmpArray[1] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); + // tmpArray[2] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); + // Array.set(tmpArray[0],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("EXCHANGE").get(null)); + // Array.set(tmpArray[0],1,ThaumcraftHandler.AspectAdder.mAspectClass.getField("GREED").get(null)); + // TRADE = aspectConstructor.newInstance("Artis",0x00FF00, tmpArray[0],new + // ResourceLocation(MainMod.MOD_ID+":Aspects/Artis.png"),1); + // Array.set(tmpArray[1],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("MAGIC").get(null)); + // Array.set(tmpArray[1],1,ThaumcraftHandler.AspectAdder.mAspectClass.getField("ELDRITCH").get(null)); + // UNIVERSE = aspectConstructor.newInstance("Universum",0x0000FF, tmpArray[1],new + // ResourceLocation(MainMod.MOD_ID+":Aspects/Universum.png"),1); + // Array.set(tmpArray[2],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("MAN").get(null)); + // Array.set(tmpArray[2],1,UNIVERSE); + // SCIENCE = aspectConstructor.newInstance("Scientia",0x00FFFF, tmpArray[2],new + // ResourceLocation(MainMod.MOD_ID+":Aspects/Scientia.png"),1); + // } catch (NoSuchMethodException | NoSuchFieldException | IllegalAccessException | InstantiationException | + // InvocationTargetException e) { + // e.printStackTrace(); + // } + // } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java index ee22ca8ab2..3c0c8abf3e 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java @@ -84,7 +84,8 @@ public class GT_Multi_IndustrialCrucible extends GT_MetaTileEntity_MultiBlockBas } @Override - public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + public ITexture[] getTexture( + IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { return new ITexture[0]; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java index 08fc1d0e5c..813aa16d74 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java @@ -59,7 +59,6 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { } } } - } public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { @@ -115,8 +114,6 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { tStored = 9223372036854775807L; } - return new long[]{tStored, tScale}; + return new long[] {tStored, tScale}; } - - } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index 872970b2f2..1cca3a9f8d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -26,17 +26,16 @@ import com.github.bartimaeusnek.bartworks.API.API_ConfigValues; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import gregtech.api.enums.TC_Aspects; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.biome.BiomeGenBase; - import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.biome.BiomeGenBase; -@SuppressWarnings({"rawtypes","unchecked","unused"}) +@SuppressWarnings({"rawtypes", "unchecked", "unused"}) public class ThaumcraftHandler { - private ThaumcraftHandler(){} + private ThaumcraftHandler() {} private static Integer taintBiomeID; private static Integer magicalForestBiomeID; @@ -52,16 +51,21 @@ public class ThaumcraftHandler { public static boolean isWand(ItemStack aStack) { try { - return aStack != null && ThaumcraftHandler.mWandInterface.isAssignableFrom(aStack.getItem().getClass()); + return aStack != null + && ThaumcraftHandler.mWandInterface.isAssignableFrom( + aStack.getItem().getClass()); } catch (Throwable var3) { return false; } } - public static boolean isMagicalForestBiome(int biomeID){ + public static boolean isMagicalForestBiome(int biomeID) { if (ThaumcraftHandler.magicalForestBiomeID == null) { try { - BiomeGenBase biome = (BiomeGenBase) Class.forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator").getField("biomeMagicalForest").get(null); + BiomeGenBase biome = + (BiomeGenBase) Class.forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator") + .getField("biomeMagicalForest") + .get(null); return biomeID == (ThaumcraftHandler.magicalForestBiomeID = biome.biomeID); } catch (ClassCastException | ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); @@ -71,10 +75,13 @@ public class ThaumcraftHandler { return biomeID == ThaumcraftHandler.magicalForestBiomeID; } - public static boolean isTaintBiome(int biomeID){ + public static boolean isTaintBiome(int biomeID) { if (ThaumcraftHandler.taintBiomeID == null) { try { - BiomeGenBase TaintBiome = (BiomeGenBase) Class.forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator").getField("biomeTaint").get(null); + BiomeGenBase TaintBiome = + (BiomeGenBase) Class.forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator") + .getField("biomeTaint") + .get(null); return biomeID == (ThaumcraftHandler.taintBiomeID = TaintBiome.biomeID); } catch (ClassCastException | ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); @@ -102,33 +109,45 @@ public class ThaumcraftHandler { try { ThaumcraftHandler.AspectAdder.mAspectListClass = Class.forName("thaumcraft.api.aspects.AspectList"); ThaumcraftHandler.AspectAdder.mAspectClass = Class.forName("thaumcraft.api.aspects.Aspect"); - ThaumcraftHandler.AspectAdder.addToList = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("add", ThaumcraftHandler.AspectAdder.mAspectClass,int.class); - ThaumcraftHandler.AspectAdder.registerObjectTag = Class.forName("thaumcraft.api.ThaumcraftApi").getMethod("registerObjectTag",ItemStack.class, ThaumcraftHandler.AspectAdder.mAspectListClass); + ThaumcraftHandler.AspectAdder.addToList = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod( + "add", ThaumcraftHandler.AspectAdder.mAspectClass, int.class); + ThaumcraftHandler.AspectAdder.registerObjectTag = Class.forName("thaumcraft.api.ThaumcraftApi") + .getMethod( + "registerObjectTag", ItemStack.class, ThaumcraftHandler.AspectAdder.mAspectListClass); ThaumcraftHandler.AspectAdder.getName = ThaumcraftHandler.AspectAdder.mAspectClass.getMethod("getName"); - ThaumcraftHandler.AspectAdder.writeAspectListToNBT = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("writeToNBT", NBTTagCompound.class); - ThaumcraftHandler.AspectAdder.add = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("add", ThaumcraftHandler.AspectAdder.mAspectListClass); - ThaumcraftHandler.AspectAdder.getAmount = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("getAmount", ThaumcraftHandler.AspectAdder.mAspectClass); - ThaumcraftHandler.AspectAdder.getAspects = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("getAspects"); - ThaumcraftHandler.AspectAdder.readAspectListFromNBT = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("readFromNBT", NBTTagCompound.class); - ThaumcraftHandler.AspectAdder.isResearchComplete = Class.forName("thaumcraft.common.lib.research.ResearchManager").getMethod("isResearchComplete",String.class,String.class); - ThaumcraftHandler.AspectAdder.linkedAspektList = ThaumcraftHandler.AspectAdder.mAspectListClass.getField("aspects"); + ThaumcraftHandler.AspectAdder.writeAspectListToNBT = + ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("writeToNBT", NBTTagCompound.class); + ThaumcraftHandler.AspectAdder.add = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod( + "add", ThaumcraftHandler.AspectAdder.mAspectListClass); + ThaumcraftHandler.AspectAdder.getAmount = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod( + "getAmount", ThaumcraftHandler.AspectAdder.mAspectClass); + ThaumcraftHandler.AspectAdder.getAspects = + ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("getAspects"); + ThaumcraftHandler.AspectAdder.readAspectListFromNBT = + ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("readFromNBT", NBTTagCompound.class); + ThaumcraftHandler.AspectAdder.isResearchComplete = Class.forName( + "thaumcraft.common.lib.research.ResearchManager") + .getMethod("isResearchComplete", String.class, String.class); + ThaumcraftHandler.AspectAdder.linkedAspektList = + ThaumcraftHandler.AspectAdder.mAspectListClass.getField("aspects"); } catch (ClassNotFoundException | NoSuchMethodException | NoSuchFieldException e) { e.printStackTrace(); } } - public static void addAspectViaBW(ItemStack stack, Pair... aspectPair) { - if (stack == null || stack.getItem() == null || stack.getUnlocalizedName() == null) - return; + public static void addAspectViaBW(ItemStack stack, Pair... aspectPair) { + if (stack == null || stack.getItem() == null || stack.getUnlocalizedName() == null) return; try { Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); for (Pair a : aspectPair) { if (API_ConfigValues.debugLog) - DebugLog.log("Stack:"+ stack.getDisplayName() + " Damage:" +stack.getItemDamage() + " aspectPair: " + ThaumcraftHandler.AspectAdder.getName.invoke(a.getKey()) + " / " + a.getValue()); + DebugLog.log("Stack:" + stack.getDisplayName() + " Damage:" + stack.getItemDamage() + + " aspectPair: " + ThaumcraftHandler.AspectAdder.getName.invoke(a.getKey()) + " / " + + a.getValue()); ThaumcraftHandler.AspectAdder.addToList.invoke(aspectList, a.getKey(), a.getValue()); } ThaumcraftHandler.AspectAdder.registerObjectTag.invoke(null, stack, aspectList); - }catch (IllegalAccessException | InstantiationException | InvocationTargetException e){ + } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) { e.printStackTrace(); } } @@ -137,9 +156,10 @@ public class ThaumcraftHandler { try { Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); for (TC_Aspects.TC_AspectStack tc_aspects : tc_aspectStacks) - ThaumcraftHandler.AspectAdder.addToList.invoke(aspectList, tc_aspects.mAspect.mAspect, (int) tc_aspects.mAmount); + ThaumcraftHandler.AspectAdder.addToList.invoke( + aspectList, tc_aspects.mAspect.mAspect, (int) tc_aspects.mAmount); ThaumcraftHandler.AspectAdder.registerObjectTag.invoke(null, stack, aspectList); - }catch (IllegalAccessException | InstantiationException | InvocationTargetException e){ + } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) { e.printStackTrace(); } } -- cgit From 0bd94a1cde3c333b36d832f4c4572cd3ab0f0985 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Mon, 29 Aug 2022 06:39:02 +0200 Subject: HTGR Buffing (#193) * Buff htgr * More buff + Fake recipe map * fix * spotlessApply (#194) Co-authored-by: Jakub <53441451+kuba6000@users.noreply.github.com> Co-authored-by: GitHub GTNH Actions <> * bw * Fix * Bigger buff, fixes * Fix insane time Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Former-commit-id: eb92fbdb92cce66cd32e6b51b46a0bfb2aed36a1 --- .../tileentities/multis/GT_TileEntity_HTGR.java | 127 ++++++++++++--------- .../bartworks/neiHandler/BW_NEI_HTGRHandler.java | 23 ++++ .../bartworks/neiHandler/IMCForNEI.java | 17 +++ .../bartworks/neiHandler/NEI_BW_Config.java | 2 + 4 files changed, 117 insertions(+), 52 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_HTGRHandler.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 6344ed5e6f..d2f174991d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -1,23 +1,18 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek + * Copyright (C) 2022 kuba6000 * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; @@ -50,6 +45,7 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.*; import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -239,6 +235,22 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase // GregTech_API.sBlockCasings8, 5)) .build(); + public static final GT_Recipe.GT_Recipe_Map fakeRecipeMap = new GT_Recipe.GT_Recipe_Map( + new HashSet<>(), + "bw.recipe.htgr", + "High Temperature Gas-cooled Reactor", + null, + "gregtech:textures/gui/basicmachines/Default", + 1, + 1, + 1, + 0, + 1, + "", + 1, + "", + false, + false); private static final int HELIUM_NEEDED = 730000; private static final int powerUsage = BW_Util.getMachineVoltageFromTier(6); private static final int maxcapacity = 720000; @@ -273,11 +285,13 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Breeder Reactor") .addInfo("Controller block for the High Temperature Gas-cooled Reactor (HTGR)") + .addInfo("You can clear internal buffer by changing the mode with a screwdriver") .addInfo("Needs a constant supply of coolant while running") .addInfo("Needs at least 72k Fuel pebbles to start operation (can hold up to 720k pebbles)") - .addInfo("Consumes up to 0.5% of total Fuel Pellets per Operation depending on efficiency") + .addInfo("Consumes up to 2.5% of total Fuel Pellets per Operation depending on efficiency") .addInfo( "Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer") + .addInfo("and affects total recipe time (at 100% eff, -50% total recipe time") .addInfo( "Reactor will take 4 000L/s of coolant multiplied by efficiency and by fuel coolant value (check tooltips)") .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t") @@ -344,18 +358,19 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isServerSide() && !this.empty) { + boolean updateneeded = false; if (this.HeliumSupply < GT_TileEntity_HTGR.HELIUM_NEEDED) { for (FluidStack fluidStack : this.getStoredFluids()) { if (fluidStack.isFluidEqual(Materials.Helium.getGas(1))) { int toget = Math.min(GT_TileEntity_HTGR.HELIUM_NEEDED - this.HeliumSupply, fluidStack.amount); fluidStack.amount -= toget; this.HeliumSupply += toget; - if (GT_TileEntity_HTGR.HELIUM_NEEDED == this.HeliumSupply && fluidStack.amount == 0) - fluidStack = null; + updateneeded = true; } } } if (this.fuelsupply < maxcapacity) { + for (ItemStack itemStack : this.getStoredInputs()) { int type = -1; if (itemStack == null) continue; @@ -369,9 +384,10 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase int toget = Math.min(maxcapacity - this.fuelsupply, itemStack.stackSize); this.fuelsupply += toget; itemStack.stackSize -= toget; + updateneeded = true; } - this.updateSlots(); } + if (updateneeded) this.updateSlots(); } } @@ -393,7 +409,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase if (eff <= 0) return false; - int toReduce = MathUtils.floorInt((double) this.fuelsupply * 0.005D * eff); + int toReduce = MathUtils.floorInt((double) this.fuelsupply * 0.025D * eff); this.fuelsupply -= toReduce; int burnedballs = toReduce / 64; @@ -411,8 +427,9 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase this.coolanttaking = (int) (4000D * (((this.fueltype * 0.5D) + 1)) * eff); this.mEfficiency = (int) (eff * 10000D); + this.mEfficiencyIncrease = 0; this.mEUt = -powerUsage; - this.mMaxProgresstime = 72000; + this.mMaxProgresstime = (int) (72000 * (1d - (eff / 2d))); return true; } @@ -458,9 +475,11 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } return true; } - - if (!super.onRunningTick(aStack)) // USE DA POWAH - return false; + // USE DA POWAH + if (!drainEnergyInput(-mEUt)) { + criticalStopMachine(); + return false; + } if (runningtick % 20 == 0) { int takecoolant = coolanttaking; @@ -604,18 +623,10 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase private static class Base_ { public String sName; public String sEnglish; - public String sTooltip; public Base_(String a, String b) { this.sName = a; this.sEnglish = b; - this.sTooltip = ""; - } - - public Base_(String a, String b, String c) { - this.sName = a; - this.sEnglish = b; - this.sTooltip = c; } } @@ -645,7 +656,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase this.mainItem = mainItem; this.secondaryItem = secondaryItem; this.recycledFluid = recycledFluid; - for (int i = 0; i < recycledItems.length; i++) this.recycledItems[i] = recycledItems[i]; + System.arraycopy(recycledItems, 0, this.recycledItems, 0, recycledItems.length); this.recycleChances = recycleChances; this.tooltip = tooltip; } @@ -687,14 +698,14 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase Materials.Lutetium.getDust(1), WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1) }, - new int[] {9000, 9000, 9000, 9000, 1000}, + new int[] {9900 / 4, 9900 / 4, 9900 / 4, 9900 / 4, 162 / 4}, "Multiplies coolant by 1"), new Fuel_( "Uranium", "Uranium", Materials.Uranium.getDust(64), Materials.Uranium235.getDust(8), - FluidRegistry.getFluidStack("krypton", 8), + FluidRegistry.getFluidStack("krypton", 4), new ItemStack[] { Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), @@ -702,14 +713,14 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase Materials.Lead.getDust(1), Materials.Uranium.getDust(1) }, - new int[] {9000, 9000, 9000, 7000, 1000}, + new int[] {9900 / 4, 9900 / 4, 9900 / 4, 5000 / 4, 5000 / 4}, "Multiplies coolant by 1.5"), new Fuel_( "Plutonium", "Plutonium", Materials.Plutonium.getDust(64), Materials.Plutonium241.getDust(4), - FluidRegistry.getFluidStack("xenon", 8), + FluidRegistry.getFluidStack("xenon", 4), new ItemStack[] { Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), @@ -717,15 +728,15 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase Materials.Lead.getDust(1), Materials.Plutonium.getDust(1) }, - new int[] {9000, 9000, 9000, 7000, 1000}, + new int[] {9900 / 4, 9900 / 4, 9900 / 4, 5000 / 4, 5000 / 4}, "Multiplies coolant by 2"), }; static final CustomHTGRSimpleSubItemClass aHTGR_Materials; - static final ArrayList aHTGR_Localizations = new ArrayList(); + static final ArrayList aHTGR_Localizations = new ArrayList<>(); static { String[] sHTGR_Materials = new String[sHTGR_Bases.length * sHTGR_Fuel.length]; - HashMap tooltip = new HashMap(); + HashMap tooltip = new HashMap<>(); int i = 0; for (Fuel_ fuel : sHTGR_Fuel) for (Base_ base : sHTGR_Bases) { @@ -734,7 +745,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase "item." + sHTGR_Materials[i] + ".name", base.sEnglish + " (" + fuel.sEnglish + ")")); if (((i + 1) % MATERIALS_PER_FUEL == (USABLE_FUEL_INDEX + 1)) && fuel.tooltip != null - && fuel.tooltip != "") tooltip.put(i, fuel.tooltip); + && !fuel.tooltip.isEmpty()) tooltip.put(i, fuel.tooltip); i++; } aHTGR_Materials = new CustomHTGRSimpleSubItemClass(tooltip, sHTGR_Materials); @@ -750,23 +761,20 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase GT_Values.RA.addAssemblerRecipe( new ItemStack[] { new ItemStack(GregTech_API.sBlockCasings3, 1, 12), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Europium, 6), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Europium, 6), GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 24) }, - Materials.Lead.getMolten(1296), + Materials.Lead.getMolten(864), new ItemStack(GregTech_API.sBlockCasings8, 1, 5), 200, BW_Util.getMachineVoltageFromTier(6)); int i = 0; for (Fuel_ fuel : sHTGR_Fuel) { GT_Values.RA.addMixerRecipe( - fuel.mainItem, - fuel.secondaryItem, - GT_Utility.getIntegratedCircuit(1), - null, + new ItemStack[] {fuel.mainItem, fuel.secondaryItem, GT_Utility.getIntegratedCircuit(1)}, null, + new ItemStack[] {new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i)}, null, - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i), 400, 30); GT_Values.RA.addFormingPressRecipe( @@ -793,12 +801,17 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), GT_Utility.getIntegratedCircuit(17) }, - new ItemStack[] {new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4)}, + new ItemStack[] { + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4) + }, null, null, null, null, - 32000, + 12000, 30, 0); GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( @@ -812,9 +825,19 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase null, null, null, - 48000, + 3000, 30, 0); + fakeRecipeMap.addFakeRecipe( + false, + new ItemStack[] {new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4)}, + new ItemStack[] {new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5)}, + null, + null, + null, + 72000, + powerUsage, + 0); GT_Values.RA.addCentrifugeRecipe( new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 6), GT_Values.NI, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_HTGRHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_HTGRHandler.java new file mode 100644 index 0000000000..56ad735bcd --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_HTGRHandler.java @@ -0,0 +1,23 @@ +package com.github.bartimaeusnek.bartworks.neiHandler; + +import codechicken.nei.recipe.GuiCraftingRecipe; +import codechicken.nei.recipe.GuiUsageRecipe; +import com.github.bartimaeusnek.bartworks.MainMod; +import cpw.mods.fml.common.event.FMLInterModComms; +import gregtech.api.util.GT_Recipe; +import gregtech.nei.GT_NEI_DefaultHandler; + +public class BW_NEI_HTGRHandler extends GT_NEI_DefaultHandler { + public BW_NEI_HTGRHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { + super(aRecipeMap); + if (!NEI_BW_Config.sIsAdded) { + FMLInterModComms.sendRuntimeMessage( + MainMod.instance, + "NEIPlugins", + "register-crafting-handler", + "bartworks@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); + GuiCraftingRecipe.craftinghandlers.add(this); + GuiUsageRecipe.usagehandlers.add(this); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java index 8622f18462..ff7fc3f1d1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java @@ -1,5 +1,6 @@ package com.github.bartimaeusnek.bartworks.neiHandler; +import com.github.bartimaeusnek.bartworks.MainMod; import cpw.mods.fml.common.event.FMLInterModComms; import net.minecraft.nbt.NBTTagCompound; @@ -7,6 +8,22 @@ public class IMCForNEI { public static void IMCSender() { sendCatalyst("gt.recipe.largechemicalreactor", "gregtech:gt.blockmachines:13366", -10); sendCatalyst("gt.recipe.craker", "gregtech:gt.blockmachines:13367", -10); + sendHandler("bw.recipe.htgr", "gregtech:gt.blockmachines:12791"); + sendCatalyst("bw.recipe.htgr", "gregtech:gt.blockmachines:12791"); + } + + private static void sendHandler(String name, String block) { + NBTTagCompound aNBT = new NBTTagCompound(); + aNBT.setString("handler", name); + aNBT.setString("modName", MainMod.NAME); + aNBT.setString("modId", MainMod.MOD_ID); + aNBT.setBoolean("modRequired", true); + aNBT.setString("itemName", block); + aNBT.setInteger("handlerHeight", 135); + aNBT.setInteger("handlerWidth", 166); + aNBT.setInteger("maxRecipesPerPage", 2); + aNBT.setInteger("yShift", 6); + FMLInterModComms.sendMessage("NotEnoughItems", "registerHandlerInfo", aNBT); } private static void sendCatalyst(String aName, String aStack, int aPriority) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index fad6574627..55533b1c38 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -28,6 +28,7 @@ import codechicken.nei.api.IConfigureNEI; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import gregtech.api.enums.OrePrefixes; @@ -87,6 +88,7 @@ public class NEI_BW_Config implements IConfigureNEI { new BW_NEI_OreHandler(); new BW_NEI_BioVatHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BACTERIALVATBYTE)); new BW_NEI_BioLabHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BIOLABBYTE)); + new BW_NEI_HTGRHandler(GT_TileEntity_HTGR.fakeRecipeMap); NEI_BW_Config.sIsAdded = true; } -- cgit From 0f34afff08436727ecd1cb8eb682f2c82871de87 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Sat, 3 Sep 2022 16:22:09 +0800 Subject: fix DT construct and survivalConstruct having wrong offset (#198) Former-commit-id: 87fc6525c65036bf156319144cd6095713070998 --- .../multis/mega/GT_TileEntity_MegaDistillTower.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 0a6154d086..0fb7362b39 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -487,12 +487,12 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 1, 0, 0); + buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 7, 0, 0); int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height for (int i = 1; i < tTotalHeight - 1; i++) { - buildPiece(STRUCTURE_PIECE_LAYER, stackSize, hintsOnly, 1, i, 0); + buildPiece(STRUCTURE_PIECE_LAYER, stackSize, hintsOnly, 7, 5 * i, 0); } - buildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, hintsOnly, 1, tTotalHeight - 1, 0); + buildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, hintsOnly, 7, 5 * (tTotalHeight - 1), 0); } @Override @@ -501,18 +501,18 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); mHeight = 0; int built = - survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 1, 0, 0, realBudget, source, actor, false, true); + survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 7, 0, 0, realBudget, source, actor, false, true); if (built >= 0) return built; int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height for (int i = 1; i < tTotalHeight - 1; i++) { mHeight = i; built = survivialBuildPiece( - STRUCTURE_PIECE_LAYER, stackSize, 1, i, 0, realBudget, source, actor, false, true); + STRUCTURE_PIECE_LAYER, stackSize, 7, 5 * mHeight, 0, realBudget, source, actor, false, true); if (built >= 0) return built; } - mHeight = tTotalHeight; + mHeight = tTotalHeight - 1; return survivialBuildPiece( - STRUCTURE_PIECE_TOP_HINT, stackSize, 1, tTotalHeight - 1, 0, realBudget, source, actor, false, true); + STRUCTURE_PIECE_TOP_HINT, stackSize, 7, 5 * mHeight, 0, realBudget, source, actor, false, true); } @Override -- cgit From dec7edc32cfe606580a859ba111ea33085518bfd Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Tue, 6 Sep 2022 21:59:09 +0800 Subject: add nei page and code rewrite for radhatch (#195) * add neihandler for radhatch * spotlessApply (#196) Co-authored-by: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Co-authored-by: GitHub GTNH Actions <> * gui container and recipe logic rewrite * clean up * spotlessApply (#197) Co-authored-by: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Co-authored-by: GitHub GTNH Actions <> * request change * add sievert display and sound effect * Spotless apply for branch radhatch for #195 (#199) * fix DT construct and survivalConstruct having wrong offset (#198) * spotlessApply Co-authored-by: Glease <4586901+Glease@users.noreply.github.com> Co-authored-by: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Co-authored-by: GitHub GTNH Actions <> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Glease <4586901+Glease@users.noreply.github.com> Former-commit-id: bac12a5f712ca340284bdb6f3be4bb26a43f9594 --- .../github/bartimaeusnek/bartworks/MainMod.java | 1 + .../client/gui/GT_GUIContainer_RadioHatch.java | 40 ++-- .../common/loaders/RadioHatchMaterialLoader.java | 192 ++++++++++++++++ .../tiered/GT_MetaTileEntity_RadioHatch.java | 242 ++++++++------------- .../neiHandler/BW_NEI_RadHatchHandler.java | 46 ++++ .../bartworks/neiHandler/IMCForNEI.java | 13 ++ .../bartworks/neiHandler/NEI_BW_Config.java | 1 + .../server/container/GT_Container_RadioHatch.java | 143 +++++------- .../bartimaeusnek/bartworks/util/BWRecipes.java | 61 ++++++ .../resources/assets/bartworks/lang/en_US.lang | 4 + src/main/resources/assets/bartworks/sounds.json | 11 + .../resources/assets/bartworks/sounds/radhatch.ogg | Bin 0 -> 236744 bytes .../gui/basicmachines/BW.GUI.Radioactive.png | Bin 0 -> 2899 bytes 13 files changed, 501 insertions(+), 253 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_RadHatchHandler.java create mode 100644 src/main/resources/assets/bartworks/sounds.json create mode 100644 src/main/resources/assets/bartworks/sounds/radhatch.ogg create mode 100644 src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.Radioactive.png diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 78fafff410..13bff6e0d6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -170,6 +170,7 @@ public final class MainMod { WerkstoffLoader.run(); LocalisationLoader.localiseAll(); } + RadioHatchMaterialLoader.run(); } @Mod.EventHandler diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java index 13dd85c5c4..b77417131c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java @@ -24,16 +24,15 @@ package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; import com.github.bartimaeusnek.bartworks.util.MathUtils; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import java.nio.ByteBuffer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) @@ -51,13 +50,12 @@ public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine } protected void drawGuiContainerForegroundLayer(int par1, int par2) { - long timer = ByteBuffer.wrap(((GT_Container_RadioHatch) this.mContainer).teTimer) - .getLong(); - double maxT = ((GT_Container_RadioHatch) this.mContainer).mass - * (GT_MetaTileEntity_RadioHatch.calcDecayTicks(((GT_Container_RadioHatch) this.mContainer).sievert)); + + long timer = ((GT_Container_RadioHatch) this.mContainer).teTimer; + double maxT = ((GT_Container_RadioHatch) this.mContainer).decayTime; double rem = maxT - timer % maxT; - this.fontRendererObj.drawString(this.mName, 8, 4, 4210752); + this.fontRendererObj.drawString(this.mName, 5, 4, 4210752); this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID + ":textures/GUI/RadHatch.png")); if (((GT_Container_RadioHatch) this.mContainer).mass > 0) { GL11.glColor3f( @@ -67,7 +65,11 @@ public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine this.drawTexturedModalRect(124, 18, 124, 18, 16, 48); } GL11.glColor3f(1f, 1f, 1f); - this.drawTexturedModalRect(124, 18, 176, 0, 16, 48 - MathUtils.ceilInt(48 * (rem / maxT))); + if (((GT_Container_RadioHatch) this.mContainer).mass <= 0) { + this.drawTexturedModalRect(124, 18, 176, 0, 16, 48); + } else { + this.drawTexturedModalRect(124, 18, 176, 0, 16, 48 - MathUtils.ceilInt(48 * (rem / maxT))); + } this.drawTexturedModalRect( 65, 13, @@ -76,16 +78,18 @@ public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine (48 * (((GT_Container_RadioHatch) this.mContainer).sv)) / (GT_GUIContainer_RadioHatch.maxSv), 16); - // this.fontRendererObj.drawString("Sv: " + ((GT_Container_RadioHatch) mContainer).sievert, 8, 50, - // BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, - // ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); - // this.fontRendererObj.drawString("Kg: " + ((GT_Container_RadioHatch) mContainer).mass, 8, 68, - // BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, - // ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); - // this.fontRendererObj.drawString("Time: " + timer, 8, 76, BW_ColorUtil.getColorFromRGBArray(new - // short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, - // ((GT_Container_RadioHatch) mContainer).b})); - + this.fontRendererObj.drawString( + StatCollector.translateToLocalFormatted( + "BW.NEI.display.radhatch.1", ((GT_Container_RadioHatch) this.mContainer).mass), + 65, + 62, + 4210752); + this.fontRendererObj.drawString( + StatCollector.translateToLocalFormatted( + "BW.NEI.display.radhatch.0", ((GT_Container_RadioHatch) this.mContainer).sv), + 60, + 72, + 4210752); } protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java new file mode 100644 index 0000000000..8d0bdd1b48 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java @@ -0,0 +1,192 @@ +package com.github.bartimaeusnek.bartworks.common.loaders; + +import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; + +public class RadioHatchMaterialLoader { + + public static void run() { + + for (Werkstoff material : Werkstoff.werkstoffHashSet) { + if (material != null && material.getStats().isRadioactive()) { + int level = (int) material.getStats().getProtons(); + short[] rgba = material.getRGBA(); + if (material.hasItemType(OrePrefixes.stick)) + BWRecipes.instance.addRadHatch(material.get(OrePrefixes.stick), level, 1, rgba); + if (material.hasItemType(OrePrefixes.stickLong)) + BWRecipes.instance.addRadHatch(material.get(OrePrefixes.stickLong), level, 2, rgba); + } + } + + for (Materials material : Materials.getAll()) { + if (material == null || material.mElement == null) continue; + boolean validProton = material.getProtons() >= 83 + && !material.equals(Materials.Tritanium) // No Tritanium + && !material.equals(Materials.Naquadah); // Naquadah needs spacial value + if (validProton) { + int level = (int) material.getProtons(); + short[] rgba = material.getRGBA(); + if (GT_OreDictUnificator.get(OrePrefixes.stick, material, 1) != null) + BWRecipes.instance.addRadHatch( + GT_OreDictUnificator.get(OrePrefixes.stick, material, 1), level, 1, rgba); + if (GT_OreDictUnificator.get(OrePrefixes.stickLong, material, 1) != null) + BWRecipes.instance.addRadHatch( + GT_OreDictUnificator.get(OrePrefixes.stickLong, material, 1), level, 2, rgba); + } + } + + Materials[] spacialMaterial = + new Materials[] {Materials.Naquadah, Materials.NaquadahEnriched, Materials.Naquadria}; + int[] spacialValue = new int[] {130, 140, 150}; + + for (int i = 0; i < spacialMaterial.length; i++) { + if (GT_OreDictUnificator.get(OrePrefixes.stick, spacialMaterial[i], 1) != null) + BWRecipes.instance.addRadHatch( + GT_OreDictUnificator.get(OrePrefixes.stick, spacialMaterial[i], 1), + spacialValue[i], + 1, + spacialMaterial[i].mRGBa); + if (GT_OreDictUnificator.get(OrePrefixes.stickLong, spacialMaterial[i], 1) != null) + BWRecipes.instance.addRadHatch( + GT_OreDictUnificator.get(OrePrefixes.stickLong, spacialMaterial[i], 1), + spacialValue[i], + 2, + spacialMaterial[i].mRGBa); + } + + BWRecipes.instance.addRadHatch( + ItemList.ThoriumCell_1.get(1), (int) Materials.Thorium.getProtons(), 3, Materials.Thorium.mRGBa); + BWRecipes.instance.addRadHatch( + ItemList.ThoriumCell_2.get(1), (int) Materials.Thorium.getProtons(), 6, Materials.Thorium.mRGBa); + BWRecipes.instance.addRadHatch( + ItemList.ThoriumCell_4.get(1), (int) Materials.Thorium.getProtons(), 12, Materials.Thorium.mRGBa); + + BWRecipes.instance.addRadHatch(ItemList.NaquadahCell_1.get(1), 140, 3, Materials.NaquadahEnriched.mRGBa); + BWRecipes.instance.addRadHatch(ItemList.NaquadahCell_2.get(1), 140, 6, Materials.NaquadahEnriched.mRGBa); + BWRecipes.instance.addRadHatch(ItemList.NaquadahCell_4.get(1), 140, 12, Materials.NaquadahEnriched.mRGBa); + + BWRecipes.instance.addRadHatch( + ItemList.Moxcell_1.get(1), (int) Materials.Plutonium.getProtons(), 3, Materials.Plutonium.mRGBa); + BWRecipes.instance.addRadHatch( + ItemList.Moxcell_2.get(1), (int) Materials.Plutonium.getProtons(), 6, Materials.Plutonium.mRGBa); + BWRecipes.instance.addRadHatch( + ItemList.Moxcell_4.get(1), (int) Materials.Plutonium.getProtons(), 12, Materials.Plutonium.mRGBa); + + BWRecipes.instance.addRadHatch( + ItemList.Uraniumcell_1.get(1), (int) Materials.Uranium.getProtons(), 3, Materials.Uranium.mRGBa); + BWRecipes.instance.addRadHatch( + ItemList.Uraniumcell_2.get(1), (int) Materials.Uranium.getProtons(), 6, Materials.Uranium.mRGBa); + BWRecipes.instance.addRadHatch( + ItemList.Uraniumcell_4.get(1), (int) Materials.Uranium.getProtons(), 12, Materials.Uranium.mRGBa); + + BWRecipes.instance.addRadHatch( + BW_NonMeta_MaterialItems.TiberiumCell_1.get(1), + (int) WerkstoffLoader.Tiberium.getBridgeMaterial().getProtons(), + 3, + WerkstoffLoader.Tiberium.getRGBA()); + BWRecipes.instance.addRadHatch( + BW_NonMeta_MaterialItems.TiberiumCell_2.get(1), + (int) WerkstoffLoader.Tiberium.getBridgeMaterial().getProtons(), + 6, + WerkstoffLoader.Tiberium.getRGBA()); + BWRecipes.instance.addRadHatch( + BW_NonMeta_MaterialItems.TiberiumCell_4.get(1), + (int) WerkstoffLoader.Tiberium.getBridgeMaterial().getProtons(), + 12, + WerkstoffLoader.Tiberium.getRGBA()); + + BWRecipes.instance.addRadHatch( + BW_NonMeta_MaterialItems.TheCoreCell.get(1), 140, 96, Materials.NaquadahEnriched.mRGBa); + + BWRecipes.instance.addRadHatch( + ItemList.Depleted_Thorium_1.get(1), + (int) Materials.Thorium.getProtons() / 10, + 3, + Materials.Thorium.mRGBa); + BWRecipes.instance.addRadHatch( + ItemList.Depleted_Thorium_2.get(1), + (int) Materials.Thorium.getProtons() / 10, + 6, + Materials.Thorium.mRGBa); + BWRecipes.instance.addRadHatch( + ItemList.Depleted_Thorium_4.get(1), + (int) Materials.Thorium.getProtons() / 10, + 12, + Materials.Thorium.mRGBa); + + BWRecipes.instance.addRadHatch( + ItemList.Depleted_Naquadah_1.get(1), 140 / 10, 3, Materials.NaquadahEnriched.mRGBa); + BWRecipes.instance.addRadHatch( + ItemList.Depleted_Naquadah_2.get(1), 140 / 10, 6, Materials.NaquadahEnriched.mRGBa); + BWRecipes.instance.addRadHatch( + ItemList.Depleted_Naquadah_4.get(1), 140 / 10, 12, Materials.NaquadahEnriched.mRGBa); + + BWRecipes.instance.addRadHatch( + GT_ModHandler.getModItem("IC2", "reactorMOXSimpledepleted", 1), + (int) Materials.Plutonium.getProtons() / 10, + 3, + Materials.Plutonium.mRGBa); + BWRecipes.instance.addRadHatch( + GT_ModHandler.getModItem("IC2", "reactorMOXDualdepleted", 1), + (int) Materials.Plutonium.getProtons() / 10, + 6, + Materials.Plutonium.mRGBa); + BWRecipes.instance.addRadHatch( + GT_ModHandler.getModItem("IC2", "reactorMOXQuaddepleted", 1), + (int) Materials.Plutonium.getProtons() / 10, + 12, + Materials.Plutonium.mRGBa); + + BWRecipes.instance.addRadHatch( + GT_ModHandler.getModItem("IC2", "reactorUraniumSimpledepleted", 1), + (int) Materials.Uranium.getProtons() / 10, + 3, + Materials.Uranium.mRGBa); + BWRecipes.instance.addRadHatch( + GT_ModHandler.getModItem("IC2", "reactorUraniumDualdepleted", 1), + (int) Materials.Uranium.getProtons() / 10, + 6, + Materials.Uranium.mRGBa); + BWRecipes.instance.addRadHatch( + GT_ModHandler.getModItem("IC2", "reactorUraniumQuaddepleted", 1), + (int) Materials.Uranium.getProtons() / 10, + 12, + Materials.Uranium.mRGBa); + + BWRecipes.instance.addRadHatch( + BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), + (int) WerkstoffLoader.Tiberium.getBridgeMaterial().getProtons() / 10, + 3, + WerkstoffLoader.Tiberium.getRGBA()); + BWRecipes.instance.addRadHatch( + BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), + (int) WerkstoffLoader.Tiberium.getBridgeMaterial().getProtons() / 10, + 6, + WerkstoffLoader.Tiberium.getRGBA()); + BWRecipes.instance.addRadHatch( + BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), + (int) WerkstoffLoader.Tiberium.getBridgeMaterial().getProtons() / 10, + 12, + WerkstoffLoader.Tiberium.getRGBA()); + + BWRecipes.instance.addRadHatch( + BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), 130 / 10, 96, Materials.Naquadah.mRGBa); + + if (WerkstoffLoader.gtnhGT) { + BWRecipes.instance.addRadHatch(ItemList.MNqCell_1.get(1), 150, 3, Materials.Naquadria.mRGBa); + BWRecipes.instance.addRadHatch(ItemList.MNqCell_2.get(1), 150, 6, Materials.Naquadria.mRGBa); + BWRecipes.instance.addRadHatch(ItemList.MNqCell_4.get(1), 150, 12, Materials.Naquadria.mRGBa); + + BWRecipes.instance.addRadHatch(ItemList.Depleted_MNq_1.get(1), 150 / 10, 3, Materials.Naquadria.mRGBa); + BWRecipes.instance.addRadHatch(ItemList.Depleted_MNq_2.get(1), 150 / 10, 6, Materials.Naquadria.mRGBa); + BWRecipes.instance.addRadHatch(ItemList.Depleted_MNq_4.get(1), 150 / 10, 12, Materials.Naquadria.mRGBa); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index d82181ea08..28fa80e963 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -22,33 +22,29 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; -import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; +import static gregtech.api.enums.GT_Values.ticksBetweenSounds; -import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; -import com.github.bartimaeusnek.bartworks.API.IRadMaterial; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.MathUtils; -import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import java.util.HashMap; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @@ -56,11 +52,14 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { private final int cap; public int sievert; private long timer = 1; + private long decayTime = 1; private short[] colorForGUI; private byte mass; private String material; private byte coverage; - private static HashMap sievertDecayCache = new HashMap<>(); + private ItemStack lastUsedItem = null; + private boolean lastFail = false; + private GT_Recipe lastRecipe = null; public GT_MetaTileEntity_RadioHatch(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 1, new String[] { @@ -85,19 +84,6 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { this.cap = aTier - 2; } - public static long calcDecayTicks(int x) { - long ret = GT_MetaTileEntity_RadioHatch.sievertDecayCache.getOrDefault(x, 0L); - if (ret != 0) return ret; - - if (x == 43) ret = 5000; - else if (x == 61) ret = 4500; - else if (x <= 100) ret = MathUtils.ceilLong((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); - else ret = MathUtils.ceilLong(((8000D * Math.tanh(-x / 65D) + 8000D))); - - GT_MetaTileEntity_RadioHatch.sievertDecayCache.put(x, ret); - return ret; // *20; - } - public int getSievert() { return this.sievert - MathUtils.ceilInt((float) this.sievert / 100f * (float) this.coverage); } @@ -115,6 +101,10 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { return this.coverage; } + public long getDecayTime() { + return this.decayTime; + } + public void setCoverage(short coverage) { byte nu; if (coverage > 100) nu = 100; @@ -145,16 +135,13 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()); - // super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); } public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) { - return true; - } else { + if (!aBaseMetaTileEntity.isClientSide()) { aBaseMetaTileEntity.openGUI(aPlayer); - return true; } + return true; } public void updateSlots() { @@ -162,13 +149,15 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { - if (this.getBaseMetaTileEntity().isServerSide()) { + BaseMetaTileEntity myMetaTileEntity = ((BaseMetaTileEntity) this.getBaseMetaTileEntity()); + if (myMetaTileEntity.isServerSide()) { - if (this.mass > 0) ++this.timer; + if (this.mass > 0) { + ++this.timer; + } - if (this.mass > 0 && this.sievert > 0) { - float decayTicks = GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert); - if (decayTicks > 0 && this.timer % decayTicks == 0) { + if (this.mass > 0) { + if (this.decayTime == 0 || (this.decayTime > 0 && this.timer % this.decayTime == 0)) { this.mass--; if (this.mass == 0) { this.material = StatCollector.translateToLocal("tooltip.bw.empty.name"); @@ -178,122 +167,68 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } } - if (this.mass >= this.cap) return; + if (myMetaTileEntity.mTickTimer > (myMetaTileEntity.mLastSoundTick + ticksBetweenSounds)) { + if (this.sievert > 0) { + sendLoopStart((byte) 1); + myMetaTileEntity.mLastSoundTick = myMetaTileEntity.mTickTimer; + } + } - ItemStack lStack = this.mInventory[0]; + if (this.mass == 0) { + ItemStack lStack = this.mInventory[0]; - isStackValidRadioMaterial(lStack, true); - } - } - - public boolean isStackValidRadioMaterial(ItemStack lStack) { - return isStackValidRadioMaterial(lStack, false); - } + if (lStack == null) { + return; + } - public boolean isStackValidRadioMaterial(ItemStack lStack, boolean use) { - if (lStack == null) return false; - - IRadMaterial radmat = null; - // gt++ compat - if (LoaderReference.miscutils) radmat = RadioHatchCompat.GTppRadChecker(lStack); - - // GT++ and BW Materials check - - if (lStack.getItem() instanceof IRadMaterial || radmat != null) { - if (radmat == null) radmat = ((IRadMaterial) lStack.getItem()); - int sv = radmat.getRadiationLevel(lStack); - int amount = radmat.getAmountOfMaterial(lStack); - if (sv > BioVatLogicAdder.RadioHatch.getMaxSv()) BioVatLogicAdder.RadioHatch.MaxSV = sv; - if ((this.mass == 0 || this.sievert == sv) && sv > 0 && amount > 0) { - if (use) { - if (this.mass + amount <= this.cap) { - String name = radmat.getNameForGUI(lStack); - if (this.mass == 0 || this.material.equals(name)) { - this.mass += amount; - this.sievert = sv; - this.mInventory[0].stackSize--; - this.updateSlots(); - this.colorForGUI = radmat.getColorForGUI(lStack); - this.material = name; - return true; - } - } - return false; + if (this.lastFail && GT_Utility.areStacksEqual(this.lastUsedItem, lStack, true)) { + return; } - return true; - } - } - // Predefined materials check - - for (ItemStack varStack : BioVatLogicAdder.RadioHatch.getIsSv().keySet()) { - if (GT_Utility.areStacksEqual(varStack, lStack, true)) { - int amount = BioVatLogicAdder.RadioHatch.getIsKg().getOrDefault(varStack, 0); - int sv = BioVatLogicAdder.RadioHatch.getIsSv().get(varStack); - if ((this.mass == 0 || this.sievert == sv) && sv > 0 && amount > 0) { - if (use) { - if (this.mass + amount <= this.cap) { - String name = StatCollector.translateToLocal(varStack.getUnlocalizedName()); - if (this.mass == 0 || this.material.equals(name)) { - this.mass += amount; - this.sievert = - BioVatLogicAdder.RadioHatch.getIsSv().get(varStack); - this.mInventory[0].stackSize--; - this.updateSlots(); - this.colorForGUI = - BioVatLogicAdder.RadioHatch.getIsColor().get(varStack); - this.material = name; - return true; - } - } - return false; + if (!this.lastFail && this.lastUsedItem != null && this.lastRecipe != null) { + if (GT_Utility.areStacksEqual(this.lastUsedItem, lStack, true)) { + this.mass = (byte) this.lastRecipe.mDuration; + this.decayTime = this.lastRecipe.mSpecialValue; + this.sievert = this.lastRecipe.mEUt; + this.material = this.lastUsedItem.getDisplayName(); + lStack.stackSize--; + updateSlots(); + } else { + this.lastRecipe = null; } - return true; } - } - } - // Rest - - // check material for general validity - if (GT_OreDictUnificator.getAssociation(lStack) != null - && GT_OreDictUnificator.getAssociation(lStack).mMaterial != null - && GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial != null) { - // check orePrefix for general validity - if (GT_OreDictUnificator.getAssociation(lStack).mPrefix != null) { - OrePrefixes orePrefixes = GT_OreDictUnificator.getAssociation(lStack).mPrefix; - // check orePrefix for specialised validity - if (orePrefixes.equals(OrePrefixes.stickLong) || orePrefixes.equals(OrePrefixes.stick)) { - Materials materials = GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial; - // check material for specialised validity - if (materials.getProtons() >= 83 && materials.getProtons() != 125 - || materials.getProtons() == 61 - || materials.getProtons() == 43) { - if (use) { - int sv = calculateSv(materials); - int amount = (orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1); - if (this.mass == 0 || this.sievert == sv) { - if ((this.mass + amount) <= this.cap) { - String name = materials.mName; - if (this.mass == 0 || this.material.equals(name)) { - this.sievert = sv; - this.mass += orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1; - this.mInventory[0].stackSize--; - this.updateSlots(); - this.colorForGUI = materials.mColor.mRGBa; - this.material = materials.mName; - return true; - } - } - } - return false; + if (this.lastRecipe == null || this.lastFail) { + this.lastRecipe = BWRecipes.instance + .getMappingsFor(BWRecipes.RADHATCH) + .findRecipe( + this.getBaseMetaTileEntity(), false, Integer.MAX_VALUE - 7, null, mInventory[0]); + if (this.lastRecipe == null) { + this.lastFail = true; + this.lastUsedItem = this.mInventory[0] == null ? null : this.mInventory[0].copy(); + } else { + if (this.lastRecipe.mDuration > this.cap) { + this.lastFail = true; + this.lastUsedItem = this.mInventory[0].copy(); + return; } - return true; + this.lastFail = false; + this.lastUsedItem = this.mInventory[0].copy(); + this.mass = (byte) this.lastRecipe.mDuration; + this.decayTime = this.lastRecipe.mSpecialValue; + this.sievert = this.lastRecipe.mEUt; + this.colorForGUI = new short[] { + (short) this.lastRecipe.mChances[0], + (short) this.lastRecipe.mChances[1], + (short) this.lastRecipe.mChances[2] + }; + this.material = lStack.getDisplayName(); + lStack.stackSize--; + updateSlots(); } } } } - return false; } @Override @@ -305,30 +240,21 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { public String[] getInfoData() { if (this.sievert != 0) return new String[] { - StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + this.material, + StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + + StatCollector.translateToLocal(this.material), StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + this.sievert, StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + this.mass, StatCollector.translateToLocal("tooltip.tile.radhatch.5.name") + " " - + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert) * 60)) + + (this.decayTime - this.timer % (this.decayTime * 60)) + StatCollector.translateToLocal("tooltip.tile.radhatch.6.name") + "/" - + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) - / 20 + + (this.decayTime - this.timer % this.decayTime) / 20 + StatCollector.translateToLocal("tooltip.tile.radhatch.7.name") + "/" - + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) - / 20 - / 60 + + (this.decayTime - this.timer % this.decayTime) / 20 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.8.name") + "/" - + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) - / 20 - / 60 - / 60 + + (this.decayTime - this.timer % this.decayTime) / 20 / 60 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.9.name") }; else @@ -361,7 +287,8 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (aSide == this.getBaseMetaTileEntity().getFrontFacing() && isStackValidRadioMaterial(aStack)); + return aSide == this.getBaseMetaTileEntity().getFrontFacing() + && BWRecipes.instance.getMappingsFor(BWRecipes.RADHATCH).containsInput(aStack); } public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { @@ -380,6 +307,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { aNBT.setInteger("mTextColor", BW_ColorUtil.getColorFromRGBArray(this.getColorForGUI())); if (this.material != null && !this.material.isEmpty()) aNBT.setString("mMaterial", this.material); aNBT.setLong("timer", this.timer); + aNBT.setLong("decay", this.decayTime); super.saveNBTData(aNBT); } @@ -395,6 +323,16 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { this.coverage = aNBT.getByte("mCoverage"); this.colorForGUI = BW_ColorUtil.splitColorToRBGArray(aNBT.getInteger("mTextColor")); this.material = aNBT.getString("mMaterial"); + this.decayTime = aNBT.getLong("decay"); super.loadNBTData(aNBT); } + + @Override + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { + super.startSoundLoop(aIndex, aX, aY, aZ); + ResourceLocation rl = new ResourceLocation(MainMod.MOD_ID, "hatch.RadOn"); + if (aIndex == 1) { + GT_Utility.doSoundAtClient(rl, 10, 1.0F, aX, aY, aZ); + } + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_RadHatchHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_RadHatchHandler.java new file mode 100644 index 0000000000..8c3a8f66f6 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_RadHatchHandler.java @@ -0,0 +1,46 @@ +package com.github.bartimaeusnek.bartworks.neiHandler; + +import codechicken.nei.recipe.GuiCraftingRecipe; +import codechicken.nei.recipe.GuiUsageRecipe; +import codechicken.nei.recipe.TemplateRecipeHandler; +import com.github.bartimaeusnek.bartworks.MainMod; +import cpw.mods.fml.common.event.FMLInterModComms; +import gregtech.api.util.GT_Recipe; +import gregtech.nei.GT_NEI_DefaultHandler; +import net.minecraft.util.StatCollector; + +public class BW_NEI_RadHatchHandler extends GT_NEI_DefaultHandler { + + public BW_NEI_RadHatchHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { + super(aRecipeMap); + if (!NEI_BW_Config.sIsAdded) { + FMLInterModComms.sendRuntimeMessage( + MainMod.instance, + "NEIPlugins", + "register-crafting-handler", + "bartworks@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); + GuiCraftingRecipe.craftinghandlers.add(this); + GuiUsageRecipe.usagehandlers.add(this); + } + } + + @Override + public TemplateRecipeHandler newInstance() { + return new BW_NEI_RadHatchHandler(this.mRecipeMap); + } + + @Override + public void drawExtras(int aRecipeIndex) { + GT_Recipe recipe = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe; + int radioLevel = recipe.mEUt; + int amount = recipe.mDuration; + long time = recipe.mSpecialValue; + drawText(10, 73, StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.0", radioLevel), -16777216); + drawText(10, 83, StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", amount), -16777216); + drawText( + 10, + 93, + StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.2", time * amount / 20.0), + -16777216); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java index ff7fc3f1d1..3f5868a349 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java @@ -10,6 +10,19 @@ public class IMCForNEI { sendCatalyst("gt.recipe.craker", "gregtech:gt.blockmachines:13367", -10); sendHandler("bw.recipe.htgr", "gregtech:gt.blockmachines:12791"); sendCatalyst("bw.recipe.htgr", "gregtech:gt.blockmachines:12791"); + sendHandler("bw.recipe.radhatch", "gregtech:gt.blockmachines:12713"); + sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12713"); + sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12714"); + sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12715"); + sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12716"); + sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12717"); + sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12718"); + sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12719"); + sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12720"); + sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12721"); + sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12722"); + sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12723"); + sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12724"); } private static void sendHandler(String name, String block) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index 55533b1c38..2fbb6a2d33 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -88,6 +88,7 @@ public class NEI_BW_Config implements IConfigureNEI { new BW_NEI_OreHandler(); new BW_NEI_BioVatHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BACTERIALVATBYTE)); new BW_NEI_BioLabHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BIOLABBYTE)); + new BW_NEI_RadHatchHandler(BWRecipes.instance.getMappingsFor(BWRecipes.RADHATCH)); new BW_NEI_HTGRHandler(GT_TileEntity_HTGR.fakeRecipeMap); NEI_BW_Config.sIsAdded = true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java index 855d73bb75..7d1f887200 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java @@ -23,12 +23,12 @@ package com.github.bartimaeusnek.bartworks.server.container; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_Container_1by1; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import java.nio.ByteBuffer; -import java.util.Iterator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ICrafting; @@ -38,11 +38,14 @@ import net.minecraft.item.ItemStack; public class GT_Container_RadioHatch extends GT_Container_1by1 { - public byte mass, dmass; - public short sv, dsv, sievert, r, g, b, dsievert, dr, dg, db; - public byte[] teTimer = new byte[8], dteTimer = new byte[8]; + public byte mass; + public short sv, sievert, r, g, b; + public long teTimer, decayTime; GT_MetaTileEntity_RadioHatch TE; private long timer; + private static final int packetSize = Byte.BYTES + Short.BYTES * 5 + Long.BYTES * 2; + + private ByteBuffer buffer; public GT_Container_RadioHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); @@ -55,6 +58,9 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { @SuppressWarnings("rawtypes") public void detectAndSendChanges() { super.detectAndSendChanges(); + if (this.buffer == null) { + this.buffer = ByteBuffer.allocate(128); + } if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) { this.TE = (GT_MetaTileEntity_RadioHatch) this.mTileEntity.getMetaTileEntity(); this.mass = this.TE.getMass(); @@ -64,88 +70,60 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { this.g = rgb[1]; this.b = rgb[2]; this.sv = (short) this.TE.getSievert(); - this.teTimer = ByteBuffer.allocate(8).putLong(this.TE.getTimer()).array(); + this.teTimer = this.TE.getTimer(); + this.decayTime = this.TE.getDecayTime(); ++this.timer; - Iterator var2 = this.crafters.iterator(); if (this.timer >= Long.MAX_VALUE - 1) this.timer = 0; - while (true) { - do { - if (!var2.hasNext()) { - this.dmass = this.mass; - this.dsievert = this.sievert; - this.dr = this.r; - this.dg = this.g; - this.db = this.b; - this.dteTimer = this.teTimer; - this.dsv = this.sv; - return; - } - ICrafting var1 = (ICrafting) var2.next(); - - if (this.timer % 500 == 10 || this.dmass != this.mass) - var1.sendProgressBarUpdate(this, 21, this.mass); - if (this.timer % 500 == 10 || this.dsievert != this.sievert) - var1.sendProgressBarUpdate(this, 22, (this.sievert - 100)); - if (this.timer % 500 == 10 || this.dr != this.r) var1.sendProgressBarUpdate(this, 23, this.r); - if (this.timer % 500 == 10 || this.dg != this.g) var1.sendProgressBarUpdate(this, 24, this.g); - if (this.timer % 500 == 10 || this.db != this.b) var1.sendProgressBarUpdate(this, 25, this.b); - if (this.timer % 500 == 10 || this.dteTimer != this.teTimer) - for (int i = 0; i < this.teTimer.length; i++) { - var1.sendProgressBarUpdate(this, 26 + i, this.teTimer[i]); - } - if (this.timer % 500 == 10 || this.dsv != this.sv) var1.sendProgressBarUpdate(this, 34, this.sv); - - } while (this.timer % 500 != 10 && this.dmass == this.mass); + this.buffer.put(0, mass); + this.buffer.putShort(Byte.BYTES, sv); + this.buffer.putShort(Byte.BYTES + Short.BYTES, sievert); + this.buffer.putShort(Byte.BYTES + Short.BYTES * 2, r); + this.buffer.putShort(Byte.BYTES + Short.BYTES * 3, g); + this.buffer.putShort(Byte.BYTES + Short.BYTES * 4, b); + this.buffer.putLong(Byte.BYTES + Short.BYTES * 5, teTimer); + this.buffer.putLong(Byte.BYTES + Short.BYTES * 5 + Long.BYTES, decayTime); + for (Object clientHandle : this.crafters) { + sendStateUpdate((ICrafting) clientHandle); } } } + private void sendStateUpdate(ICrafting clientHandle) { + for (int i = 0; i < packetSize; i++) { + clientHandle.sendProgressBarUpdate(this, i + 300, buffer.get(i)); + } + } + + @Override + public void addCraftingToCrafters(ICrafting clientHandle) { + super.addCraftingToCrafters(clientHandle); + this.buffer.put(0, mass); + this.buffer.putShort(Byte.BYTES, sv); + this.buffer.putShort(Byte.BYTES + Short.BYTES, sievert); + this.buffer.putShort(Byte.BYTES + Short.BYTES * 2, r); + this.buffer.putShort(Byte.BYTES + Short.BYTES * 3, g); + this.buffer.putShort(Byte.BYTES + Short.BYTES * 4, b); + this.buffer.putLong(Byte.BYTES + Short.BYTES * 5, teTimer); + this.buffer.putLong(Byte.BYTES + Short.BYTES * 5 + Long.BYTES, decayTime); + sendStateUpdate(clientHandle); + } + @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - switch (par1) { - case 21: - this.mass = (byte) par2; - break; - case 22: - this.sievert = (short) (par2 + 100); - break; - case 23: - this.r = (short) par2; - break; - case 24: - this.g = (short) par2; - break; - case 25: - this.b = (short) par2; - break; - case 26: - this.teTimer[0] = (byte) par2; - break; - case 27: - this.teTimer[1] = (byte) par2; - break; - case 28: - this.teTimer[2] = (byte) par2; - break; - case 29: - this.teTimer[3] = (byte) par2; - break; - case 30: - this.teTimer[4] = (byte) par2; - break; - case 31: - this.teTimer[5] = (byte) par2; - break; - case 32: - this.teTimer[6] = (byte) par2; - break; - case 33: - this.teTimer[7] = (byte) par2; - break; - case 34: - this.sv = (short) par2; - break; + public void updateProgressBar(int index, int value) { + super.updateProgressBar(index, value); + index = index - 300; + if (index >= 0 && index < buffer.capacity()) { + this.buffer.put(index, (byte) value); + } + if (index >= packetSize - 1) { + this.mass = this.buffer.get(0); + this.sv = this.buffer.getShort(Byte.BYTES); + this.sievert = this.buffer.getShort(Byte.BYTES + Short.BYTES); + this.r = this.buffer.getShort(Byte.BYTES + Short.BYTES * 2); + this.g = this.buffer.getShort(Byte.BYTES + Short.BYTES * 3); + this.b = this.buffer.getShort(Byte.BYTES + Short.BYTES * 4); + this.teTimer = this.buffer.getLong(Byte.BYTES + Short.BYTES * 5); + this.decayTime = this.buffer.getLong(Byte.BYTES + Short.BYTES * 5 + Long.BYTES); } } @@ -160,7 +138,7 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { ItemStack stack = slot.getStack(); if (stack == null) return null; if (slot instanceof RadioSlot) return super.transferStackInSlot(player, id); - else if (((GT_MetaTileEntity_RadioHatch) this.mTileEntity.getMetaTileEntity()).isStackValidRadioMaterial(stack)) + else if (BWRecipes.instance.getMappingsFor(BWRecipes.RADHATCH).containsInput(stack)) return super.transferStackInSlot(player, id); else return null; } @@ -171,9 +149,8 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { } @Override - public boolean isItemValid(ItemStack p_75214_1_) { - return ((GT_MetaTileEntity_RadioHatch) ((IGregTechTileEntity) this.inventory).getMetaTileEntity()) - .isStackValidRadioMaterial(p_75214_1_); + public boolean isItemValid(ItemStack stack) { + return BWRecipes.instance.getMappingsFor(BWRecipes.RADHATCH).containsInput(stack); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 7f9150f0dc..a0e2f1ae4b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -53,6 +53,7 @@ public class BWRecipes { public static final byte BACTERIALVATBYTE = 1; public static final byte ACIDGENMAPBYTE = 2; public static final byte CIRCUITASSEMBLYLINE = 3; + public static final byte RADHATCH = 4; private final GT_Recipe.GT_Recipe_Map sBiolab = new GT_Recipe.GT_Recipe_Map( new HashSet<>(150), @@ -121,6 +122,23 @@ public class BWRecipes { true, true // special handler ); + private final GT_Recipe.GT_Recipe_Map sRadHatch = new GT_Recipe.GT_Recipe_Map( + new HashSet<>(150), + "bw.recipe.radhatch", + "Radio Hatch Material List", + null, + "gregtech:textures/gui/basicmachines/BW.GUI.Radioactive", + 1, + 0, + 1, + 0, + 1, + "", + 0, + "", + false, + false // special handler + ); /** * @param machine 0 = biolab; 1 = BacterialVat; 2 = sAcidGenFuels; 3 = circuitAssemblyLine @@ -135,11 +153,52 @@ public class BWRecipes { return sAcidGenFuels; case 3: return sCircuitAssemblyLineMap; + case 4: + return sRadHatch; default: return null; } } + public static long calcDecayTicks(int x) { + long ret; + if (x == 43) ret = 5000; + else if (x == 61) ret = 4500; + else if (x <= 100) ret = MathUtils.ceilLong((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); + else ret = MathUtils.ceilLong(((8000D * Math.tanh(-x / 65D) + 8000D))); + return ret; + } + + public boolean addRadHatch(ItemStack item, int radioLevel, int amount, short[] rgba) { + return sRadHatch.addRecipe(new DynamicGTRecipe( + false, + new ItemStack[] {item}, + null, + null, + new int[] {rgba[0], rgba[1], rgba[2]}, + null, + null, + amount, + radioLevel, + (int) calcDecayTicks(radioLevel))) + != null; + } + + public boolean addRadHatch(ItemStack item, int radioLevel, int amount, int time, short[] rgba) { + return sRadHatch.addRecipe(new DynamicGTRecipe( + false, + new ItemStack[] {item}, + null, + null, + new int[] {rgba[0], rgba[1], rgba[2]}, + null, + null, + amount, + radioLevel, + time)) + != null; + } + public boolean addBioLabRecipe( ItemStack[] aInputs, ItemStack aOutput, @@ -391,6 +450,7 @@ public class BWRecipes { != null; } + @Deprecated public boolean addBacterialVatRecipe( ItemStack[] aInputs, BioCulture aCulture, @@ -456,6 +516,7 @@ public class BWRecipes { != null; } + @Deprecated public boolean addBacterialVatRecipe( ItemStack[] aInputs, BioCulture culture, diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index dca5ca5d25..951ceca7dd 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -165,4 +165,8 @@ itemGroup.bw.MetaItems.0=BartWorks Circuit Overhaul Items BW.infoData.BioVat.expectedProduction=Expected Production BW.infoData.BioVat.production=Production + +BW.NEI.display.radhatch.0=Sievert: %s Sv +BW.NEI.display.radhatch.1=Mass: %s kg +BW.NEI.display.radhatch.2=Time: %s s #Liquids diff --git a/src/main/resources/assets/bartworks/sounds.json b/src/main/resources/assets/bartworks/sounds.json new file mode 100644 index 0000000000..0c1dea7fcc --- /dev/null +++ b/src/main/resources/assets/bartworks/sounds.json @@ -0,0 +1,11 @@ +{ + "hatch.RadOn": { + "category": "block", + "sounds": [ + { + "name": "radhatch", + "stream": false + } + ] + } +} diff --git a/src/main/resources/assets/bartworks/sounds/radhatch.ogg b/src/main/resources/assets/bartworks/sounds/radhatch.ogg new file mode 100644 index 0000000000..754711c999 Binary files /dev/null and b/src/main/resources/assets/bartworks/sounds/radhatch.ogg differ diff --git a/src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.Radioactive.png b/src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.Radioactive.png new file mode 100644 index 0000000000..9c6f03f8ed Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.Radioactive.png differ -- cgit From a409dd4fc30d29fe14f39b152c24fdd8786bb5c2 Mon Sep 17 00:00:00 2001 From: miozune Date: Sat, 10 Sep 2022 04:23:12 +0900 Subject: Adapt to Wiremill Configuration Circuit support (#201) Former-commit-id: 125f0ce37b416ce53662728e8b21439534ff6e4b --- dependencies.gradle | 2 +- .../material/werkstoff_loaders/recipe/CraftingMaterialLoader.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index eeac46a0aa..518d4481d2 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.15:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.34:dev") compile("com.github.GTNewHorizons:StructureLib:1.1.6:dev") compile("com.github.GTNewHorizons:TecTech:5.0.32:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.2.31-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java index d82f7aa559..55bbb89e52 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java @@ -32,6 +32,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; import gregtech.common.GT_Proxy; import net.minecraft.item.ItemStack; @@ -101,11 +102,13 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { 8 * tVoltageMultiplier); GT_Values.RA.addWiremillRecipe( werkstoff.get(ingot), + GT_Utility.getIntegratedCircuit(3), werkstoff.get(wireFine, 8), (int) Math.max(werkstoff.getStats().getMass(), 1), 8 * tVoltageMultiplier); GT_Values.RA.addWiremillRecipe( werkstoff.get(stick), + GT_Utility.getIntegratedCircuit(3), werkstoff.get(wireFine, 4), (int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F), 8 * tVoltageMultiplier); -- cgit From 162095fafa0926886ac843b28fdc3e75353eeca5 Mon Sep 17 00:00:00 2001 From: くぁーりぃ <39122497+Quarri6343@users.noreply.github.com> Date: Mon, 19 Sep 2022 14:24:33 +0900 Subject: fix aoobe (#204) Former-commit-id: bc1366ad8a911565cd162dca1d8ed3c29f5e2872 --- .../common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 0fb7362b39..c6b2954f90 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -359,7 +359,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } protected int getCurrentLayerOutputHatchCount() { - return mOutputHatchesByLayer.size() < mHeight + return mOutputHatchesByLayer.size() < mHeight || mHeight <= 0 ? 0 : mOutputHatchesByLayer.get(mHeight - 1).size(); } -- cgit From 3625039dd10595211bf3124c839b0f285a2de359 Mon Sep 17 00:00:00 2001 From: iouter <62897714+iouter@users.noreply.github.com> Date: Fri, 23 Sep 2022 23:27:26 +0800 Subject: Windmill-reblance (#205) * Windmill-reblance * resolve * new dmg Former-commit-id: ec3b7688cb3669e13181c5327f9187aeb6bade95 --- .../bartworks/common/items/BW_Stonage_Rotors.java | 53 ++- .../bartworks/common/loaders/ItemRegistry.java | 32 +- .../multis/GT_TileEntity_Windmill.java | 417 ++++++--------------- .../resources/assets/bartworks/lang/en_US.lang | 2 + 4 files changed, 186 insertions(+), 318 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index f2559f3066..92969360bd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -40,6 +40,8 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; +import net.minecraft.nbt.NBTTagCompound; +import ic2.core.util.StackUtil; public class BW_Stonage_Rotors extends Item implements IKineticRotor { @@ -48,10 +50,16 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { private final IKineticRotor.GearboxType type; private final ResourceLocation tex; private final String itemTex; + private final int speed; + private final float mRotor; + private final int maxDamageEx; + private int dura; public BW_Stonage_Rotors( int diameter, float eff, + int speed, + float mRotor, int min, int max, int durability, @@ -63,9 +71,12 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { this.DiaMinMax[1] = min; this.DiaMinMax[2] = max; this.eff = eff; + this.mRotor = mRotor; + this.speed = speed; this.type = type; this.tex = tex; - this.setMaxDamage(durability); + this.setMaxDamage(30000); + this.maxDamageEx = durability; this.setUnlocalizedName(Name); this.setCreativeTab(MainMod.BWT); this.itemTex = itemTex; @@ -88,8 +99,10 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { } info.add(StatCollector.translateToLocal("tooltip.rotor.0.name") + " " + this.DiaMinMax[0]); info.add(StatCollector.translateToLocal("tooltip.rotor.1.name") + " " - + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); + + ((this.getMaxDamageEx() - this.getDamageOfStack(itemStack)) / 100) + "/" + (this.getMaxDamageEx() / 100)); info.add(StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + this.eff); + info.add(StatCollector.translateToLocal("tooltip.rotor.3.name") + " " + this.speed); + info.add(StatCollector.translateToLocal("tooltip.rotor.4.name") + " " + this.mRotor); if (type != null) { info.add(StatCollector.translateToLocal(("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type)))); } @@ -125,4 +138,40 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { public boolean isAcceptedType(ItemStack itemStack, IKineticRotor.GearboxType gearboxType) { return gearboxType.equals(this.type); } + + public int getSpeed() { + return speed; + } + + public float getmRotor() { + return mRotor; + } + + public void setDamageForStack(ItemStack stack, int advDmg) { + NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack); + nbtData.setInteger("DmgEx", advDmg); + if (this.maxDamageEx > 0) { + double p = (double) advDmg / (double) this.maxDamageEx; + int newDmg = (int) (stack.getMaxDamage() * p); + if (newDmg >= stack.getMaxDamage()) { + newDmg = stack.getMaxDamage() - 1; + } + stack.setItemDamage(newDmg); + this.dura = newDmg; + } + } + + public int getDamageOfStack(ItemStack stack) { + NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack); + this.dura = nbtData.getInteger("DmgEx"); + return this.dura; + } + + public int getMaxDamageEx() { + return this.maxDamageEx; + } + + public void damageItemStack(ItemStack stack, int Dmg) { + setDamageForStack(stack, getDamageOfStack(stack) + Dmg); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 4b976838c3..95f3943cd8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -71,11 +71,13 @@ public class ItemRegistry { public static final Block ROTORBLOCK = new BW_TileEntityContainer_MachineBlock(Material.wood, BW_RotorBlock.class, "BWRotorBlock"); public static final Item LEATHER_ROTOR = new BW_Stonage_Rotors( - 5, + 7, 0.15f, - 15, - 30, - 2400, + 5, + 1.15f, + 1, + 50, + 10000000, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorLeather.png"), "BW_LeatherRotor", @@ -83,29 +85,35 @@ public class ItemRegistry { public static final Item WOOL_ROTOR = new BW_Stonage_Rotors( 7, 0.18f, - 10, - 20, - 1600, + 3, + 1.35f, + 1, + 50, + 9000000, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorWool.png"), "BW_WoolRotor", "rotors/itemRotorWool"); public static final Item PAPER_ROTOR = new BW_Stonage_Rotors( - 9, + 7, 0.2f, + 12, + 0.9f, 1, - 10, - 800, + 50, + 800000, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorPaper.png"), "BW_PaperRotor", "rotors/itemRotorPaper"); public static final Item COMBINED_ROTOR = new BW_Stonage_Rotors( - 11, + 9, 0.22f, + 7, + 1.05f, 1, 50, - 5800, + 6000000, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorCombined.png"), "BW_CombinedRotor", diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 78ff775ca5..3735c52cba 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -29,6 +29,7 @@ import static gregtech.api.enums.GT_Values.V; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_Windmill; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; +import com.github.bartimaeusnek.bartworks.common.items.BW_Stonage_Rotors; import com.github.bartimaeusnek.bartworks.server.container.BW_Container_Windmill; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.gtnewhorizon.structurelib.StructureLibAPI; @@ -58,6 +59,8 @@ import gregtech.api.util.GT_Utility; import java.util.Arrays; import java.util.HashSet; import java.util.Set; +import java.util.List; +import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayerMP; @@ -69,6 +72,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; +import ic2.api.item.IKineticRotor; public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable { @@ -81,6 +85,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock private BW_RotorBlock rotorBlock; private int mDoor = 0; private int mHardenedClay = 0; + private int mMulti = 16; public GT_TileEntity_Windmill(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -136,6 +141,9 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock tt.addMachineType("Windmill") .addInfo("Controller block for the Windmill") .addInfo("A primitive Grinder powered by Kinetic energy") + .addInfo("Speed and output will be affected by wind speed, recipe and rotor") + .addInfo("Please use the Primitive Rotor") + .addInfo("Macerates 16 items at a time") .addInfo("The structure is too complex!") .addInfo("Follow the StructureLib hologram projector to build the main structure.") .addSeparator() @@ -159,6 +167,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public boolean onRunningTick(ItemStack aStack) { if (this.mMaxProgresstime > 0) this.mProgresstime += this.rotorBlock.getGrindPower(); + if (!rotorBlock.rotorSlot.isEmpty()) this.setRotorDamage(rotorBlock, this.rotorBlock.getGrindPower()); return this.rotorBlock.getGrindPower() > 0; } @@ -167,275 +176,97 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock return true; } - public boolean recipe_fallback(ItemStack aStack) { - // sight... fallback to the macerator recipes - GT_Recipe.GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; - GT_Recipe tRecipe = tMap.findRecipe(this.getBaseMetaTileEntity(), false, false, V[1], null, aStack); - if (tRecipe == null) return false; - if (tRecipe.getOutput(0) != null) { - // Decrease input stack by appropriate amount (Not always 1) - tRecipe.isRecipeInputEqual(true, null, aStack); - this.mOutputItems[0] = tRecipe.getOutput(0); - - if (new XSTR().nextInt(2) == 0) { - if (tRecipe.getOutput(1) != null) this.mOutputItems[1] = tRecipe.getOutput(1); - else if (!BW_Util.checkStackAndPrefix(this.mOutputItems[0]) - || !(BW_Util.checkStackAndPrefix(this.mOutputItems[0]) - && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]) - .mMaterial - .mMaterial - .mSubTags - .contains(SubTag.METAL) - || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) - && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]) - .mMaterial - .mMaterial - .mSubTags - .contains(SubTag.CRYSTAL) - || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) - && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]) - .mMaterial - .mMaterial - .mSubTags - .contains(SubTag.CRYSTALLISABLE)) - || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) - && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial - == Materials.Flint - || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) - && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial - == Materials.Sugar - || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) - && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial - == Materials.Wheat - || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) - && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial - == Materials.Wood - || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) - && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial - == Materials.Ash - || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) - && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial - == Materials.Snow - || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) - && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial - == Materials.Stone - || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) - && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial - == Materials.MeatRaw - || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) - && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial - == Materials.MeatCooked) this.mOutputItems[1] = tRecipe.getOutput(0); - } - } - this.mMaxProgresstime = (tRecipe.mDuration * 2 * 100); - return true; - } - @Override public boolean doRandomMaintenanceDamage() { return true; } - private boolean hardOverride(int maxProgresstime, boolean randomise, ItemStack input, ItemStack... outputs) { - input.stackSize -= 1; - this.mMaxProgresstime = maxProgresstime; - if (randomise) { - if (localRandomInstance.nextInt(2) == 0) this.mOutputItems[0] = outputs[0]; - else this.mOutputItems[0] = outputs[1]; - } else { - this.mOutputItems[0] = outputs[0]; - if (outputs.length == 2) this.mOutputItems[1] = outputs[1]; - } - return true; + private float[] multiplierRecipe(ItemStack itemStack) { + //will return max and min value of the multiplier, the average of these is used to calculate the multiplier. + if (itemStack.getItem().equals(Items.wheat)) return new float[] {1.13f, 1.5f}; + else if (itemStack.getItem().equals(Items.bone) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glowstone) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.pumpkin)) return new float[] {0.8f, 1f}; + else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.gravel) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.cobblestone) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stone) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.sandstone) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.clay) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.hardened_clay) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stained_hardened_clay) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.wool) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.netherrack) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log2)) return new float[] {1f, 1.5f}; + else if (GT_OreDictUnificator.getAssociation(itemStack) == null + || GT_OreDictUnificator.getAssociation(itemStack).mPrefix == null + || GT_OreDictUnificator.getAssociation(itemStack).mMaterial == null + || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial == null + || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.getDust(1) == null) return new float[] {1f, 1f}; + else if (OrePrefixes.ore.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.oreNetherrack.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.oreEndstone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.oreBlackgranite.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.oreRedgranite.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.oreMarble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.oreBasalt.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) return new float[] {0.5f, 1f}; + else if (OrePrefixes.stone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneChiseled.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneCobble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneCracked.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneMossy.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneMossyBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneSmooth.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.cobblestone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) return new float[] {1f, 1.5f}; + return new float[] {1f, 1f}; } @Override public boolean checkRecipe(ItemStack itemStack) { - if (itemStack == null || itemStack.getItem() == null) return false; if (this.mOutputItems == null) this.mOutputItems = new ItemStack[2]; - // Override Recipes that doesnt quite work well with OreUnificator - // Items - if (itemStack.getItem().equals(Items.wheat)) { - return hardOverride( - 30000, - false, - itemStack, - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 1L), - GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wheat, 1L)); - } else if (itemStack.getItem().equals(Items.bone)) { - return hardOverride( - 30000, true, itemStack, new ItemStack(Items.dye, 4, 15), new ItemStack(Items.dye, 3, 15)); - } - // Blocks - else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.gravel)) { - return hardOverride(60000, true, itemStack, new ItemStack(Items.flint, 2), new ItemStack(Items.flint)); - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.cobblestone) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stone)) { - return hardOverride( - 120000, - true, - itemStack, - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 2L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L)); - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.sandstone)) { - return hardOverride(120000, true, itemStack, new ItemStack(Blocks.sand, 3), new ItemStack(Blocks.sand, 2)); - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.clay) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.hardened_clay) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stained_hardened_clay)) { - return hardOverride(120000, true, itemStack, Materials.Clay.getDust(2), Materials.Clay.getDust(1)); - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.redstone_block)) { - return hardOverride(120000, false, itemStack, Materials.Redstone.getDust(9)); - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glass)) { - return hardOverride( - 120000, false, itemStack, (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glass, 1L))); - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.wool)) { - return hardOverride( - 120000, true, itemStack, new ItemStack(Items.string, 3), new ItemStack(Items.string, 2)); - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glowstone)) { - return hardOverride( - 120000, - true, - itemStack, - new ItemStack(Items.glowstone_dust, 4), - new ItemStack(Items.glowstone_dust, 3)); - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.netherrack)) { - return hardOverride( - 120000, - true, - itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Netherrack, 2L)), - (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Netherrack, 1L))); - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log)) { - return hardOverride( - 120000, - true, - itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 12L)), - (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 6L))); - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log2)) { - return hardOverride( - 120000, - true, - itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 12L)), - (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 6L))); - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.pumpkin)) { - return hardOverride( - 30000, - true, - itemStack, - new ItemStack(Items.pumpkin_seeds, 2), - new ItemStack(Items.pumpkin_seeds, 1)); - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.melon_block)) { - return hardOverride( - 30000, true, itemStack, new ItemStack(Items.melon_seeds, 2), new ItemStack(Items.melon_seeds, 1)); + GT_Recipe.GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; + GT_Recipe tRecipe = tMap.findRecipe(this.getBaseMetaTileEntity(), false, false, V[1], null, itemStack); + if (tRecipe == null) { + return false; } - // null checks for GT shit - if (GT_OreDictUnificator.getAssociation(itemStack) == null - || GT_OreDictUnificator.getAssociation(itemStack).mPrefix == null - || GT_OreDictUnificator.getAssociation(itemStack).mMaterial == null - || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial == null - || GT_OreDictUnificator.getAssociation(itemStack) - .mMaterial - .mMaterial - .getDust(1) - == null) return this.recipe_fallback(itemStack); // fallback for all non-unificated Items - - // Ore Unificator shit for balance - if (OrePrefixes.ingot.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.gem.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - return hardOverride( - 90000, - false, - itemStack, - (GT_OreDictUnificator.get( - OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); - } else if (OrePrefixes.ore.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - return hardOverride( - 120000, - false, - itemStack, - (GT_OreDictUnificator.get( - OrePrefixes.crushed, - GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, - 1L))); - } else if (OrePrefixes.nugget.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - return hardOverride( - 30000, - false, - itemStack, - (GT_OreDictUnificator.get( - OrePrefixes.dustTiny, - GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, - 1L))); - } else if (OrePrefixes.crushed.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - return hardOverride( - 60000, - false, - itemStack, - (GT_OreDictUnificator.get( - OrePrefixes.dustImpure, - GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, - 1L))); - } else if (OrePrefixes.crushedPurified.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - return hardOverride( - 60000, - false, - itemStack, - (GT_OreDictUnificator.get( - OrePrefixes.dustPure, - GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, - 1L))); - } else if (OrePrefixes.crushedCentrifuged.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - return hardOverride( - 60000, - false, - itemStack, - (GT_OreDictUnificator.get( - OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); - } else if (OrePrefixes.block.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - return hardOverride( - 120000, - false, - itemStack, - (GT_OreDictUnificator.get( - OrePrefixes.dust, - GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, - (GT_OreDictUnificator.getAssociation(itemStack) - .mMaterial - .mMaterial - .mSubTags - .contains(SubTag.METAL) - || GT_OreDictUnificator.getAssociation(itemStack) - .mMaterial - .mMaterial - .mSubTags - .contains(SubTag.CRYSTAL)) - ? 9L - : 1L))); - } else if (OrePrefixes.stone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneChiseled.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneCobble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneCracked.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneMossy.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneMossyBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneSmooth.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.cobblestone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { - return hardOverride( - 120000, - true, - itemStack, - (GT_OreDictUnificator.get( - OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 2L)), - (GT_OreDictUnificator.get( - OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); + if (tRecipe.getOutput(0) != null) { + // Decrease input stack by appropriate amount (Not always 1) + for (int i = 0; i < this.mMulti; i++) { + if (!tRecipe.isRecipeInputEqual(true, null, itemStack)) { + this.mMulti = i + 1; + break; + } + } + this.updateSlots(); + this.mOutputItems[0] = tRecipe.getOutput(0); + float[] mRecipe = multiplierRecipe(itemStack); + float multiper = Math.min(mRecipe[1], Math.max(mRecipe[0] , + 2f * ((float) Math.sqrt((float)1 / (this.rotorBlock.getWindStrength() + 1))) + * OutputMultiplier(rotorBlock) + * (mRecipe[0] + mRecipe[1]))); + int amount = Math.round(multiper * (this.mOutputItems[0].stackSize * this.mMulti)); + + //Split ItemStack --by gtpp + List splitStacks = new ArrayList<>(); + while (amount > this.mOutputItems[0].getMaxStackSize()) { + ItemStack tmp = this.mOutputItems[0]; + tmp.stackSize = this.mOutputItems[0].getMaxStackSize(); + amount -= this.mOutputItems[0].getMaxStackSize(); + splitStacks.add(tmp); + } + ItemStack tmp = this.mOutputItems[0]; + tmp.stackSize = amount; + splitStacks.add(tmp); + mOutputItems = splitStacks.toArray(new ItemStack[splitStacks.size()]); } - return this.recipe_fallback(itemStack); // 2nd fallback + this.mMaxProgresstime = (tRecipe.mDuration * 2 * 100 * this.mMulti) / (int) getSpeed(rotorBlock); + this.mMulti = 16; + return true; } @Override @@ -448,6 +279,11 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock return new BW_Container_Windmill(aPlayerInventory, aBaseMetaTileEntity); } + @Override + public void stopMachine() { + getBaseMetaTileEntity().disableWorking(); + } + public boolean addDispenserToOutputSet(TileEntity aTileEntity) { if (aTileEntity instanceof TileEntityDispenser) { this.tileEntityDispensers.add((TileEntityDispenser) aTileEntity); @@ -517,57 +353,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock return true; } - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - this.mProgresstime++; - if (aBaseMetaTileEntity.isServerSide()) { - if (this.mEfficiency < 0) this.mEfficiency = 0; - if (--this.mUpdate == 0 || --this.mStartUpCheck == 0 || this.mStructureChanged) { - checkStructure(true, aBaseMetaTileEntity); - this.mUpdate = 100; - } - if (this.mStartUpCheck < 0) { - if (this.mMachine) { - if (this.mMaxProgresstime > 0) { - if (this.onRunningTick(this.mInventory[1])) { - if (this.mMaxProgresstime > 0 && this.mProgresstime >= this.mMaxProgresstime) { - if (this.mOutputItems != null) - for (ItemStack tStack : this.mOutputItems) - if (tStack != null) { - this.addOutput(tStack); - } - this.mEfficiency = 10000; - this.mOutputItems = new ItemStack[2]; - this.mProgresstime = 0; - this.mMaxProgresstime = 0; - this.mEfficiencyIncrease = 0; - if (aBaseMetaTileEntity.isAllowedToWork()) { - if (this.checkRecipe(this.mInventory[1])) this.updateSlots(); - } - } - } - } else { - if (aTick % 100 == 0 - || aBaseMetaTileEntity.hasWorkJustBeenEnabled() - || aBaseMetaTileEntity.hasInventoryBeenModified()) { - if (aBaseMetaTileEntity.isAllowedToWork()) { - if (this.checkRecipe(this.mInventory[1])) this.updateSlots(); - } - } - } - } else { - // this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); - return; - } - } else { - this.stopMachine(); - } - } - aBaseMetaTileEntity.setErrorDisplayID( - (aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (this.mMachine ? 0 : 64)); - aBaseMetaTileEntity.setActive(this.mMaxProgresstime > 0); - } - @Override public int getCurrentEfficiency(ItemStack itemStack) { return 10000; @@ -701,4 +486,28 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock return survivialBuildPiece( STRUCTURE_PIECE_MAIN, stackSize, 3, 11, 0, elementBudget, source, actor, false, true); } + + public float OutputMultiplier(BW_RotorBlock rotorBlock) { + try { + return ((BW_Stonage_Rotors) rotorBlock.rotorSlot.get().getItem()).getmRotor(); + } catch (Exception e){ + return 1f; + } + } + + public int getSpeed(BW_RotorBlock rotorBlock) { + try { + return ((BW_Stonage_Rotors) rotorBlock.rotorSlot.get().getItem()).getSpeed(); + } catch (Exception e){ + return 1; + } + } + + public void setRotorDamage(BW_RotorBlock rotorBlock, int damage) { + try { + ((BW_Stonage_Rotors) rotorBlock.rotorSlot.get().getItem()).damageItemStack(rotorBlock.rotorSlot.get() , damage); + } catch (Exception e){ + rotorBlock.rotorSlot.damage(damage, false); + } + } } diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 951ceca7dd..5fbbd79986 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -75,6 +75,8 @@ tooltip.windmeter.8.name=The wind here seems to be tooltip.rotor.0.name=Diameter: tooltip.rotor.1.name=Durability: tooltip.rotor.2.name=Efficiency: +tooltip.rotor.3.name=Speed: +tooltip.rotor.4.name=Output: tooltip.cp.0.name=Has Circuit inside? tooltip.bw.0.name=Added by -- cgit From b495b16beb319412ba1f3869e03f535bee9151a5 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Fri, 23 Sep 2022 18:41:23 +0200 Subject: Update BS+SA Former-commit-id: 5278be337dd97c7e548b8b7dc123713b55806177 --- build.gradle | 139 ++++++++++++++++++++- .../bartworks/common/items/BW_Stonage_Rotors.java | 7 +- .../multis/GT_TileEntity_Windmill.java | 103 ++++++++------- 3 files changed, 192 insertions(+), 57 deletions(-) diff --git a/build.gradle b/build.gradle index 997b94dc30..252dac4ea1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1661114848 +//version: 1662920829 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -8,6 +8,10 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import com.matthewprenger.cursegradle.CurseArtifact +import com.matthewprenger.cursegradle.CurseRelation +import com.modrinth.minotaur.dependencies.ModDependency +import com.modrinth.minotaur.dependencies.VersionDependency import org.gradle.internal.logging.text.StyledTextOutput.Style import org.gradle.internal.logging.text.StyledTextOutputFactory @@ -59,6 +63,8 @@ plugins { id 'de.undercouch.download' version '5.0.1' id 'com.github.gmazzo.buildconfig' version '3.0.3' apply false id 'com.diffplug.spotless' version '6.7.2' apply false + id 'com.modrinth.minotaur' version '2.+' apply false + id 'com.matthewprenger.cursegradle' version '1.4.0' apply false } boolean settingsupdated = verifySettingsGradle() settingsupdated = verifyGitAttributes() || settingsupdated @@ -127,11 +133,16 @@ checkPropertyExists("containsMixinsAndOrCoreModOnly") checkPropertyExists("usesShadowedDependencies") checkPropertyExists("developmentEnvironmentUserName") -boolean noPublishedSources = project.hasProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false -boolean usesMixinDebug = project.hasProperty('usesMixinDebug') ?: project.usesMixins.toBoolean() -boolean forceEnableMixins = project.hasProperty('forceEnableMixins') ? project.forceEnableMixins.toBoolean() : false -String channel = project.hasProperty('channel') ? project.channel : 'stable' -String mappingsVersion = project.hasProperty('mappingsVersion') ? project.mappingsVersion : '12' +propertyDefaultIfUnset("noPublishedSources", false) +propertyDefaultIfUnset("usesMixinDebug", project.usesMixins) +propertyDefaultIfUnset("forceEnableMixins", false) +propertyDefaultIfUnset("channel", "stable") +propertyDefaultIfUnset("mappingsVersion", "12") +propertyDefaultIfUnset("modrinthProjectId", "") +propertyDefaultIfUnset("modrinthRelations", "") +propertyDefaultIfUnset("curseForgeProjectId", "") +propertyDefaultIfUnset("curseForgeRelations", "") + String javaSourceDir = "src/main/java/" String scalaSourceDir = "src/main/scala/" String kotlinSourceDir = "src/main/kotlin/" @@ -651,6 +662,107 @@ publishing { } } +if (modrinthProjectId.size() != 0) { + apply plugin: 'com.modrinth.minotaur' + + File changelogFile = new File("CHANGELOG.md") + + modrinth { + token = System.getenv("MODRINTH_TOKEN") + projectId = modrinthProjectId + versionNumber = identifiedVersion + versionType = identifiedVersion.endsWith("-pre") ? "beta" : "release" + changelog = changelogFile.exists() ? changelogFile.getText("UTF-8") : "" + uploadFile = jar + additionalFiles = getSecondaryArtifacts() + gameVersions = [minecraftVersion] + loaders = ["forge"] + debugMode = false + } + + if (modrinthRelations.size() != 0) { + String[] deps = modrinthRelations.split(";") + deps.each { dep -> + if (dep.size() == 0) { + return + } + String[] parts = dep.split(":") + String[] qual = parts[0].split("-") + addModrinthDep(qual[0], qual[1], parts[1]) + } + } + tasks.modrinth.dependsOn(build) + tasks.publish.dependsOn(tasks.modrinth) +} + +if (curseForgeProjectId.size() != 0) { + apply plugin: 'com.matthewprenger.cursegradle' + + File changelogFile = new File("CHANGELOG.md") + + curseforge { + apiKey = System.getenv("CURSEFORGE_TOKEN") + project { + id = curseForgeProjectId + if (changelogFile.exists()) { + changelogType = "markdown" + changelog = changelogFile + } + releaseType = identifiedVersion.endsWith("-pre") ? "beta" : "release" + addGameVersion minecraftVersion + addGameVersion "Forge" + mainArtifact jar + for (artifact in getSecondaryArtifacts()) addArtifact artifact + } + + options { + javaIntegration = false + forgeGradleIntegration = false + debug = false + } + } + + if (curseForgeRelations.size() != 0) { + String[] deps = curseForgeRelations.split(";") + deps.each { dep -> + if (dep.size() == 0) { + return + } + String[] parts = dep.split(":") + addCurseForgeRelation(parts[0], parts[1]) + } + } + tasks.curseforge.dependsOn(build) + tasks.publish.dependsOn(tasks.curseforge) +} + +def addModrinthDep(scope, type, name) { + com.modrinth.minotaur.dependencies.Dependency dep; + if (!(scope in ["required", "optional", "incompatible", "embedded"])) { + throw new Exception("Invalid modrinth dependency scope: " + scope) + } + switch (type) { + case "project": + dep = new ModDependency(name, scope) + break + case "version": + dep = new VersionDependency(name, scope) + break + default: + throw new Exception("Invalid modrinth dependency type: " + type) + } + project.modrinth.dependencies.add(dep) +} + +def addCurseForgeRelation(type, name) { + if (!(type in ["requiredDependency", "embeddedLibrary", "optionalDependency", "tool", "incompatible"])) { + throw new Exception("Invalid CurseForge relation type: " + type) + } + CurseArtifact artifact = project.curseforge.curseProjects[0].mainArtifact + CurseRelation rel = (artifact.curseRelations ?: (artifact.curseRelations = new CurseRelation())) + rel."$type"(name) +} + // Updating task updateBuildScript { doLast { @@ -963,6 +1075,21 @@ def checkPropertyExists(String propertyName) { } } +def propertyDefaultIfUnset(String propertyName, defaultValue) { + if (!project.hasProperty(propertyName) || project.property(propertyName) == "") { + project.ext.setProperty(propertyName, defaultValue) + } +} + def getFile(String relativePath) { return new File(projectDir, relativePath) } + +def getSecondaryArtifacts() { + // Because noPublishedSources from the beginning of the script is somehow not visible here... + boolean noPublishedSources = project.hasProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false + def secondaryArtifacts = [devJar] + if (!noPublishedSources) secondaryArtifacts += [sourcesJar] + if (apiPackage) secondaryArtifacts += [apiJar] + return secondaryArtifacts +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index 92969360bd..414f862cd6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -32,16 +32,16 @@ import cpw.mods.fml.relauncher.SideOnly; import ic2.api.item.IKineticRotor; import ic2.core.block.kineticgenerator.gui.GuiWaterKineticGenerator; import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator; +import ic2.core.util.StackUtil; import java.util.List; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; -import net.minecraft.nbt.NBTTagCompound; -import ic2.core.util.StackUtil; public class BW_Stonage_Rotors extends Item implements IKineticRotor { @@ -99,7 +99,8 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { } info.add(StatCollector.translateToLocal("tooltip.rotor.0.name") + " " + this.DiaMinMax[0]); info.add(StatCollector.translateToLocal("tooltip.rotor.1.name") + " " - + ((this.getMaxDamageEx() - this.getDamageOfStack(itemStack)) / 100) + "/" + (this.getMaxDamageEx() / 100)); + + ((this.getMaxDamageEx() - this.getDamageOfStack(itemStack)) / 100) + "/" + + (this.getMaxDamageEx() / 100)); info.add(StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + this.eff); info.add(StatCollector.translateToLocal("tooltip.rotor.3.name") + " " + this.speed); info.add(StatCollector.translateToLocal("tooltip.rotor.4.name") + " " + this.mRotor); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 3735c52cba..e65d5d1ebb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -28,10 +28,9 @@ import static gregtech.api.enums.GT_Values.V; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_Windmill; -import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; import com.github.bartimaeusnek.bartworks.common.items.BW_Stonage_Rotors; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; import com.github.bartimaeusnek.bartworks.server.container.BW_Container_Windmill; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; @@ -41,9 +40,7 @@ import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.SubTag; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; @@ -56,11 +53,11 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; -import java.util.Set; import java.util.List; -import java.util.ArrayList; +import java.util.Set; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayerMP; @@ -72,7 +69,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; -import ic2.api.item.IKineticRotor; public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable { @@ -182,43 +178,49 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock } private float[] multiplierRecipe(ItemStack itemStack) { - //will return max and min value of the multiplier, the average of these is used to calculate the multiplier. + // will return max and min value of the multiplier, the average of these is used to calculate the multiplier. if (itemStack.getItem().equals(Items.wheat)) return new float[] {1.13f, 1.5f}; else if (itemStack.getItem().equals(Items.bone) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glowstone) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.pumpkin)) return new float[] {0.8f, 1f}; + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glowstone) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.pumpkin)) return new float[] {0.8f, 1f}; else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.gravel) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.cobblestone) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stone) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.sandstone) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.clay) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.hardened_clay) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stained_hardened_clay) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.wool) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.netherrack) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log2)) return new float[] {1f, 1.5f}; + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.cobblestone) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stone) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.sandstone) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.clay) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.hardened_clay) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stained_hardened_clay) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.wool) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.netherrack) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log2)) return new float[] {1f, 1.5f}; else if (GT_OreDictUnificator.getAssociation(itemStack) == null - || GT_OreDictUnificator.getAssociation(itemStack).mPrefix == null - || GT_OreDictUnificator.getAssociation(itemStack).mMaterial == null - || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial == null - || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.getDust(1) == null) return new float[] {1f, 1f}; + || GT_OreDictUnificator.getAssociation(itemStack).mPrefix == null + || GT_OreDictUnificator.getAssociation(itemStack).mMaterial == null + || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial == null + || GT_OreDictUnificator.getAssociation(itemStack) + .mMaterial + .mMaterial + .getDust(1) + == null) return new float[] {1f, 1f}; else if (OrePrefixes.ore.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.oreNetherrack.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.oreEndstone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.oreBlackgranite.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.oreRedgranite.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.oreMarble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.oreBasalt.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) return new float[] {0.5f, 1f}; + || OrePrefixes.oreNetherrack.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.oreEndstone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.oreBlackgranite.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.oreRedgranite.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.oreMarble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.oreBasalt.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) + return new float[] {0.5f, 1f}; else if (OrePrefixes.stone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneChiseled.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneCobble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneCracked.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneMossy.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneMossyBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneSmooth.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.cobblestone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) return new float[] {1f, 1.5f}; + || OrePrefixes.stoneBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneChiseled.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneCobble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneCracked.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneMossy.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneMossyBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneSmooth.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.cobblestone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) + return new float[] {1f, 1.5f}; return new float[] {1f, 1f}; } @@ -245,13 +247,17 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock this.updateSlots(); this.mOutputItems[0] = tRecipe.getOutput(0); float[] mRecipe = multiplierRecipe(itemStack); - float multiper = Math.min(mRecipe[1], Math.max(mRecipe[0] , - 2f * ((float) Math.sqrt((float)1 / (this.rotorBlock.getWindStrength() + 1))) - * OutputMultiplier(rotorBlock) - * (mRecipe[0] + mRecipe[1]))); + float multiper = Math.min( + mRecipe[1], + Math.max( + mRecipe[0], + 2f + * ((float) Math.sqrt((float) 1 / (this.rotorBlock.getWindStrength() + 1))) + * OutputMultiplier(rotorBlock) + * (mRecipe[0] + mRecipe[1]))); int amount = Math.round(multiper * (this.mOutputItems[0].stackSize * this.mMulti)); - //Split ItemStack --by gtpp + // Split ItemStack --by gtpp List splitStacks = new ArrayList<>(); while (amount > this.mOutputItems[0].getMaxStackSize()) { ItemStack tmp = this.mOutputItems[0]; @@ -264,7 +270,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock splitStacks.add(tmp); mOutputItems = splitStacks.toArray(new ItemStack[splitStacks.size()]); } - this.mMaxProgresstime = (tRecipe.mDuration * 2 * 100 * this.mMulti) / (int) getSpeed(rotorBlock); + this.mMaxProgresstime = (tRecipe.mDuration * 2 * 100 * this.mMulti) / (int) getSpeed(rotorBlock); this.mMulti = 16; return true; } @@ -490,7 +496,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock public float OutputMultiplier(BW_RotorBlock rotorBlock) { try { return ((BW_Stonage_Rotors) rotorBlock.rotorSlot.get().getItem()).getmRotor(); - } catch (Exception e){ + } catch (Exception e) { return 1f; } } @@ -498,15 +504,16 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock public int getSpeed(BW_RotorBlock rotorBlock) { try { return ((BW_Stonage_Rotors) rotorBlock.rotorSlot.get().getItem()).getSpeed(); - } catch (Exception e){ + } catch (Exception e) { return 1; } } public void setRotorDamage(BW_RotorBlock rotorBlock, int damage) { try { - ((BW_Stonage_Rotors) rotorBlock.rotorSlot.get().getItem()).damageItemStack(rotorBlock.rotorSlot.get() , damage); - } catch (Exception e){ + ((BW_Stonage_Rotors) rotorBlock.rotorSlot.get().getItem()) + .damageItemStack(rotorBlock.rotorSlot.get(), damage); + } catch (Exception e) { rotorBlock.rotorSlot.damage(damage, false); } } -- cgit From ba133dc404381b7a3d3392e8bddab105facf9fac Mon Sep 17 00:00:00 2001 From: Maxim Date: Mon, 26 Sep 2022 15:10:16 +0200 Subject: Added start and end processing calls to machines that work with inputs in onPostTick (#206) Former-commit-id: 34f1e0867e65c8aeae02e1391e4502e9a8498a03 --- .../tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java | 2 ++ .../bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java | 3 ++- .../bartworks/common/tileentities/multis/GT_TileEntity_THTR.java | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index 0f8dca5a33..a1b32c92c8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -313,6 +313,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse } } if (aBaseMetaTileEntity.isServerSide() && this.mMaxProgresstime > 0 && setupphase > 0 && aTick % 5 == 0) { + startRecipeProcessing(); if (setupphase == 1 && mStorage.size() < mMaxSlots) { List inputs = getStoredInputs(); for (ItemStack input : inputs) if (addCrop(input)) break; @@ -324,6 +325,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse this.mStorage.remove(0); this.updateSlots(); } + endRecipeProcessing(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index d2f174991d..2442089032 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -370,7 +370,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } } if (this.fuelsupply < maxcapacity) { - + startRecipeProcessing(); for (ItemStack itemStack : this.getStoredInputs()) { int type = -1; if (itemStack == null) continue; @@ -386,6 +386,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase itemStack.stackSize -= toget; updateneeded = true; } + endRecipeProcessing(); } if (updateneeded) this.updateSlots(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 7ec2734fd8..af69cef98a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -351,6 +351,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase } } if (this.fuelsupply < maxcapacity) { + startRecipeProcessing(); for (ItemStack itemStack : this.getStoredInputs()) { if (GT_Utility.areStacksEqual( itemStack, @@ -361,6 +362,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase this.fuelsupply += toget; } } + endRecipeProcessing(); this.updateSlots(); } } -- cgit From d1b6588d63183cbdaff1fb9bc314944355388f61 Mon Sep 17 00:00:00 2001 From: iouter <62897714+iouter@users.noreply.github.com> Date: Sat, 1 Oct 2022 16:52:53 +0800 Subject: no-more-duplicate-key (#207) Former-commit-id: 950d0d9246903c4482aeee5084d380fd4b5e76f1 --- .../github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index 1ae67d1360..fb1ce389df 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -120,7 +120,7 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { } else if (tSpecialA[1] == -200 && GT_Mod.gregtechproxy.mEnableCleanroom) { drawText(10, lines[7], this.trans("160", "Needs Cleanroom"), -16777216); } else if (tSpecialA[1] == -300 && GT_Mod.gregtechproxy.mEnableCleanroom) { - drawText(10, lines[7], this.trans("160", "Needs Cleanroom & LowGrav"), -16777216); + drawText(10, lines[7], this.trans("160.1", "Needs Cleanroom & LowGrav"), -16777216); } else if (tSpecialA[1] == -400) { drawText(10, lines[7], this.trans("216", "Deprecated Recipe"), -16777216); } else if (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre) -- cgit From f151eee7b946e25eb11a3a97bb974a993fd4fcf2 Mon Sep 17 00:00:00 2001 From: BlueWeabo <76872108+BlueWeabo@users.noreply.github.com> Date: Sat, 1 Oct 2022 13:16:33 +0300 Subject: Add Compat for bartworks and Cell-less PA change (#200) * make sure that recipes are added elsewhere * actual fix to the dusts Former-commit-id: 0870a2e1c0106a90f7d5337f2d90c3162b74085b --- .../werkstoff_loaders/recipe/DustLoader.java | 42 +++++++++++++++++++--- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java index de1a0d1b34..324e7905e8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java @@ -167,8 +167,8 @@ public class DustLoader implements IWerkstoffRunnable { } ItemStack input = werkstoff.get(dust); input.stackSize = werkstoff.getContents().getKey(); - if (werkstoff.getStats().isElektrolysis()) - GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe( + if (werkstoff.getStats().isElektrolysis()) { + GT_Recipe tRecipe = new BWRecipes.DynamicGTRecipe( true, new ItemStack[] {input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), @@ -181,8 +181,11 @@ public class DustLoader implements IWerkstoffRunnable { Math.abs(werkstoff.getStats().getProtons() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, - 0)); - if (werkstoff.getStats().isCentrifuge()) + 0); + GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(tRecipe); + GT_Recipe.GT_Recipe_Map.sMultiblockElectrolyzerRecipes.add(tRecipe); + } + if (werkstoff.getStats().isCentrifuge()) { GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe( true, new ItemStack[] {input, cells > 0 ? Materials.Empty.getCells(cells) : null}, @@ -197,6 +200,22 @@ public class DustLoader implements IWerkstoffRunnable { / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); + GT_Recipe tRecipe = new GT_Recipe( + false, + stOutputs.toArray(new ItemStack[0]), + new ItemStack[] {input}, + null, + null, + new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, + null, + (int) Math.max( + 1L, + Math.abs(werkstoff.getStats().getProtons() + / werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 30, + 0); + GT_Recipe.GT_Recipe_Map.sMultiblockCentrifugeRecipes.add(tRecipe); + } if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe( @@ -247,6 +266,21 @@ public class DustLoader implements IWerkstoffRunnable { / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); + GT_Recipe tRecipe = new GT_Recipe( + false, + stOutputs.toArray(new ItemStack[0]), + new ItemStack[] {input}, + null, + null, + new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, + null, + (int) Math.max( + 1L, + Math.abs(werkstoff.getStats().getProtons() + / werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 30, + 0); + GT_Recipe.GT_Recipe_Map.sMultiblockMixerRecipes.add(tRecipe); } } -- cgit From 97fececd3323f6c4a175fee62b53a8f61bbd5708 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 1 Oct 2022 12:34:26 +0200 Subject: update dep file update BS+SA Former-commit-id: 8e42dd9b2fbcb12e5d46a9328f49b91a1b99432c --- build.gradle | 2 +- dependencies.gradle | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index 252dac4ea1..b961a5e176 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1662920829 +//version: 1664372158 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. diff --git a/dependencies.gradle b/dependencies.gradle index 518d4481d2..9712e97210 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,36 +1,36 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.34:dev") - compile("com.github.GTNewHorizons:StructureLib:1.1.6:dev") - compile("com.github.GTNewHorizons:TecTech:5.0.32:dev") - compile("com.github.GTNewHorizons:NotEnoughItems:2.2.31-GTNH:dev") - compile("com.github.GTNewHorizons:TinkersConstruct:1.9.0-17-GTNH:dev") - compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.4:dev") - compile("com.github.GTNewHorizons:CodeChickenCore:1.1.5:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.65:dev") + compile("com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev") + compile("com.github.GTNewHorizons:TecTech:5.0.41:dev") + compile("com.github.GTNewHorizons:NotEnoughItems:2.3.7-GTNH:dev") + compile("com.github.GTNewHorizons:TinkersConstruct:1.9.4-GTNH:dev") + compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.5:dev") + compile("com.github.GTNewHorizons:CodeChickenCore:1.1.6:dev") compile("com.github.GTNewHorizons:Galacticraft:3.0.44-GTNH:dev") compile("com.github.GTNewHorizons:GalacticGregGT5:1.0.8:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") - compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-100-GTNH:dev") { + compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-107-GTNH:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:AppleCore:3.2.0:dev") { + compileOnly("com.github.GTNewHorizons:AppleCore:3.2.2:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:TinkersGregworks:master-SNAPSHOT:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.14:api") { + compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.15:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:Railcraft:9.13.9:api") { + compileOnly("com.github.GTNewHorizons:Railcraft:9.13.12:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.43:api") { + compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.47o:api") { transitive = false } -- cgit From a60374e67a9a1bd8bc496224541c40e295933468 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 1 Oct 2022 12:46:06 +0200 Subject: derp Former-commit-id: 2a67e0b33f806ccc351820a54dcef1108384a8c0 --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 9712e97210..995be70387 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -30,7 +30,7 @@ dependencies { transitive = false } - compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.47o:api") { + compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.47:api") { transitive = false } -- cgit From 1d8d7e2eda84eac7c68b2d459dbb6878ba37b12e Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 1 Oct 2022 12:54:35 +0200 Subject: udate dep Former-commit-id: e9a70e6cfd99a1c592aa4c208ae2ae9db0768a02 --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 995be70387..066d0b0a63 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -3,7 +3,7 @@ dependencies { compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.65:dev") compile("com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev") - compile("com.github.GTNewHorizons:TecTech:5.0.41:dev") + compile("com.github.GTNewHorizons:TecTech:5.0.42:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.3.7-GTNH:dev") compile("com.github.GTNewHorizons:TinkersConstruct:1.9.4-GTNH:dev") compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.5:dev") -- cgit From 36c3f093237b90bb0ad7d42a5e2e10f73725097c Mon Sep 17 00:00:00 2001 From: BlueWeabo <76872108+BlueWeabo@users.noreply.github.com> Date: Fri, 7 Oct 2022 22:23:55 +0300 Subject: add the glass (#208) Former-commit-id: 708159b2af4bd7f321f0e17122819393b1230ea0 --- .../bartworks/API/BorosilicateGlass.java | 31 +++- .../client/renderer/RendererGlasBlock.java | 32 ++-- .../bartworks/common/blocks/BW_GlasBlocks2.java | 172 +++++++++++++++++++++ .../bartworks/common/loaders/BeforeGTPreload.java | 3 + .../bartworks/common/loaders/ItemRegistry.java | 26 +++- .../bartworks/common/loaders/RecipeLoader.java | 24 +++ .../bartworks/neiHandler/NEI_BW_Config.java | 1 + .../resources/assets/bartworks/lang/en_US.lang | 2 + .../InfinityReinforcedBoronSilicateGlassBlock.png | Bin 0 -> 336 bytes ...endentallyReinforcedBoronSilicateGlassBlock.png | Bin 0 -> 227 bytes 10 files changed, 273 insertions(+), 18 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java create mode 100644 src/main/resources/assets/bartworks/textures/blocks/InfinityReinforcedBoronSilicateGlassBlock.png create mode 100644 src/main/resources/assets/bartworks/textures/blocks/TranscendentallyReinforcedBoronSilicateGlassBlock.png diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java index 27d6f30e0c..1e5946b78d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java @@ -2,6 +2,8 @@ package com.github.bartimaeusnek.bartworks.API; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks2; import com.gtnewhorizon.structurelib.structure.IStructureElement; import cpw.mods.fml.common.registry.GameRegistry; import java.util.ArrayList; @@ -26,7 +28,14 @@ public class BorosilicateGlass { private static List> representatives; private static Block getGlassBlock() { - if (block == null) block = GameRegistry.findBlock("bartworks", "BW_GlasBlocks"); + if (block == null || !(block instanceof BW_GlasBlocks)) + block = GameRegistry.findBlock("bartworks", "BW_GlasBlocks"); + return block; + } + + private static Block getGlassBlock2() { + if (block == null || !(block instanceof BW_GlasBlocks2)) + block = GameRegistry.findBlock("bartworks", "BW_GlasBlocks2"); return block; } @@ -42,6 +51,9 @@ public class BorosilicateGlass { ret.add(Pair.of(block, 5)); ret.add(Pair.of(block, 13)); ret.add(Pair.of(block, 14)); + ret.add(Pair.of(block, 15)); + block = getGlassBlock2(); + ret.add(Pair.of(block, 0)); representatives = ret; } return representatives; @@ -55,7 +67,7 @@ public class BorosilicateGlass { * Check if there is at least one type of boroglass in that tier. */ public static boolean hasGlassInTier(int tier) { - return tier >= 3 && tier <= 10; + return tier >= 3 && tier <= 12; } /** @@ -121,6 +133,7 @@ public class BorosilicateGlass { */ public static byte getTier(Block block, int meta) { byte ret; + if (block instanceof BW_GlasBlocks2) meta += 16; switch (meta) { case 1: ret = 4; @@ -144,9 +157,21 @@ public class BorosilicateGlass { case 14: ret = 10; break; + case 15: + ret = 11; + break; + case 16: + ret = 12; + break; default: ret = 3; } - return block == getGlassBlock() ? ret : -1; + if (block instanceof BW_GlasBlocks) { + return block == getGlassBlock() ? ret : -1; + } + if (block instanceof BW_GlasBlocks2) { + return block == getGlassBlock2() ? ret : -1; + } + return -1; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java index f464b249d8..1e0ee45c9d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.bartworks.client.renderer; import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks2; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; @@ -78,16 +79,29 @@ public class RendererGlasBlock implements ISimpleBlockRenderingHandler { public boolean renderWorldBlock( IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { // renderer.setRenderBounds(0.001,0.001,0.001,0.999,0.999,0.999); - renderer.renderStandardBlock(ItemRegistry.bw_fake_glasses, x, y, z); // renderer.setRenderBounds(0,0,0,1,1,1); - renderer.renderStandardBlockWithColorMultiplier( - block, - x, - y, - z, - ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[0] / 255f, - ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[1] / 255f, - ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[2] / 255f); + if (block instanceof BW_GlasBlocks) { + renderer.renderStandardBlock(ItemRegistry.bw_fake_glasses, x, y, z); + renderer.renderStandardBlockWithColorMultiplier( + block, + x, + y, + z, + ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[0] / 255f, + ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[1] / 255f, + ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[2] / 255f); + } + if (block instanceof BW_GlasBlocks2) { + renderer.renderStandardBlock(ItemRegistry.bw_fake_glasses2, x, y, z); + renderer.renderStandardBlockWithColorMultiplier( + block, + x, + y, + z, + ((BW_GlasBlocks2) block).getColor(world.getBlockMetadata(x, y, z))[0] / 255f, + ((BW_GlasBlocks2) block).getColor(world.getBlockMetadata(x, y, z))[1] / 255f, + ((BW_GlasBlocks2) block).getColor(world.getBlockMetadata(x, y, z))[2] / 255f); + } return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java new file mode 100644 index 0000000000..d2d149fd6e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java @@ -0,0 +1,172 @@ +package com.github.bartimaeusnek.bartworks.common.blocks; + +import com.github.bartimaeusnek.bartworks.API.SideReference; +import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.util.ForgeDirection; + +public class BW_GlasBlocks2 extends BW_Blocks { + @SideOnly(Side.CLIENT) + private IIcon[] connectedTexture; + + private final boolean connectedTex; + private boolean fake; + private short[][] color = new short[this.textureNames.length][3]; + + public BW_GlasBlocks2(String name, String[] texture, CreativeTabs tabs) { + super(name, texture, tabs, Material.glass); + this.connectedTex = false; + } + + public BW_GlasBlocks2( + String name, String[] texture, short[][] color, CreativeTabs tabs, boolean connectedTex, boolean fake) { + super(name, texture, tabs, Material.glass); + this.connectedTex = connectedTex; + this.color = color; + this.fake = fake; + } + + public short[] getColor(int meta) { + return meta < this.texture.length ? this.color[meta] : this.color[0]; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldClient, int xCoord, int yCoord, int zCoord, int aSide) { + if (worldClient.getBlock(xCoord, yCoord, zCoord) instanceof BW_GlasBlocks2) return false; + return super.shouldSideBeRendered(worldClient, xCoord, yCoord, zCoord, aSide); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + return meta < this.texture.length ? this.texture[meta] : this.texture[0]; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) { + if (!this.connectedTex) { + this.texture = new IIcon[this.textureNames.length]; + for (int i = 0; i < this.textureNames.length; i++) { + this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]); + } + return; + } + this.texture = new IIcon[this.textureNames.length]; + this.connectedTexture = new IIcon[16]; + for (int i = 0; i < this.textureNames.length; i++) { + this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]); + String[] splitname = this.textureNames[0].split(":"); + for (int j = 0; j < 16; j++) { + this.connectedTexture[j] = par1IconRegister.registerIcon(splitname[0] + ":connectedTex/" + + "BoronSilicateGlassBlock" + '/' + "BoronSilicateGlassBlock" + '_' + j); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess worldClient, int xCoord, int yCoord, int zCoord, int aSide) { + if (!this.connectedTex) return super.getIcon(worldClient, xCoord, yCoord, zCoord, aSide); + + ForgeDirection dir = ForgeDirection.getOrientation(aSide); + byte sides = 0; + switch (dir) { + case UP: + case DOWN: { + if (worldClient.getBlock(xCoord, yCoord, zCoord - 1) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b0001); + if (worldClient.getBlock(xCoord, yCoord, zCoord + 1) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b0010); + if (worldClient.getBlock(xCoord - 1, yCoord, zCoord) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b0100); + if (worldClient.getBlock(xCoord + 1, yCoord, zCoord) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b1000); + break; + } + case EAST: { + if (worldClient.getBlock(xCoord, yCoord + 1, zCoord) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b0001); + if (worldClient.getBlock(xCoord, yCoord - 1, zCoord) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b0010); + if (worldClient.getBlock(xCoord, yCoord, zCoord + 1) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b0100); + if (worldClient.getBlock(xCoord, yCoord, zCoord - 1) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b1000); + break; + } + case WEST: { + if (worldClient.getBlock(xCoord, yCoord + 1, zCoord) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b0001); + if (worldClient.getBlock(xCoord, yCoord - 1, zCoord) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b0010); + if (worldClient.getBlock(xCoord, yCoord, zCoord - 1) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b0100); + if (worldClient.getBlock(xCoord, yCoord, zCoord + 1) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b1000); + break; + } + case NORTH: { + if (worldClient.getBlock(xCoord, yCoord + 1, zCoord) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b0001); + if (worldClient.getBlock(xCoord, yCoord - 1, zCoord) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b0010); + if (worldClient.getBlock(xCoord + 1, yCoord, zCoord) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b0100); + if (worldClient.getBlock(xCoord - 1, yCoord, zCoord) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b1000); + break; + } + case SOUTH: { + if (worldClient.getBlock(xCoord, yCoord + 1, zCoord) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b0001); + if (worldClient.getBlock(xCoord, yCoord - 1, zCoord) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b0010); + if (worldClient.getBlock(xCoord - 1, yCoord, zCoord) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b0100); + if (worldClient.getBlock(xCoord + 1, yCoord, zCoord) instanceof BW_GlasBlocks2) + sides = (byte) (sides | 0b1000); + break; + } + case UNKNOWN: + default: { + break; + } + } + return this.connectedTexture[sides]; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() { + return 1; + } + + @Override + public int getRenderType() { + if (!this.fake && SideReference.Side.Client) return RendererGlasBlock.RID; + else return 0; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + protected boolean canSilkHarvest() { + return false; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java index dca6662c2e..bba88a0859 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java @@ -92,6 +92,7 @@ public class BeforeGTPreload implements Runnable { .getField("bw_glasses") .get(null); GameRegistry.registerBlock(bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); + GameRegistry.registerBlock(bw_glasses[1], BW_ItemBlocks.class, "BW_GlasBlocks2"); OreDictionary.registerOre("blockGlassHV", new ItemStack(Blocks.glass, 1, Short.MAX_VALUE)); OreDictionary.registerOre("blockGlassHV", new ItemStack(bw_glasses[0], 1, 0)); OreDictionary.registerOre("blockGlassEV", Ic2Items.reinforcedGlass); @@ -103,6 +104,8 @@ public class BeforeGTPreload implements Runnable { OreDictionary.registerOre("blockGlassUV", new ItemStack(bw_glasses[0], 1, 5)); OreDictionary.registerOre("blockGlassUHV", new ItemStack(bw_glasses[0], 1, 13)); OreDictionary.registerOre("blockGlassUEV", new ItemStack(bw_glasses[0], 1, 14)); + OreDictionary.registerOre("blockGlassUIV", new ItemStack(bw_glasses[0], 1, 15)); + OreDictionary.registerOre("blockGlassUMV", new ItemStack(bw_glasses[1], 1, 0)); } catch (IllegalAccessException | NoSuchFieldException | ClassNotFoundException e) { e.printStackTrace(); FMLCommonHandler.instance().exitJava(-1, true); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 95f3943cd8..c6ee62871b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -28,10 +28,7 @@ import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.ne import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer_MachineBlock; +import com.github.bartimaeusnek.bartworks.common.blocks.*; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.items.*; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; @@ -152,6 +149,7 @@ public class ItemRegistry { MainMod.MOD_ID + ":ThoriumYttriumGlass", MainMod.MOD_ID + ":NeutroniumReinforcedBoronSilicateGlassBlock", MainMod.MOD_ID + ":CosmicNeutroniumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":InfinityReinforcedBoronSilicateGlassBlock", }, new short[][] { Materials.BorosilicateGlass.getRGBA(), @@ -168,15 +166,30 @@ public class ItemRegistry { new short[] {0x80, 0x33, 0}, WerkstoffLoader.YttriumOxide.getRGBA(), Materials.Neutronium.getRGBA(), - Materials.CosmicNeutronium.getRGBA() + Materials.CosmicNeutronium.getRGBA(), + new short[] {0xda, 0xeb, 0xff}, }, MainMod.BIO_TAB, true, false); + public static final Block bw_realglas2 = new BW_GlasBlocks2( + "BW_GlasBlocks2", + new String[] {MainMod.MOD_ID + ":TranscendentallyReinforcedBoronSilicateGlassBlock"}, + new short[][] {new short[] {50, 50, 50}}, + MainMod.BIO_TAB, + true, + false); - public static final Block[] bw_glasses = {bw_realglas}; + public static final Block[] bw_glasses = {bw_realglas, bw_realglas2}; public static final Block bw_fake_glasses = new BW_GlasBlocks( "BW_GlasBlocks", new String[] {MainMod.MOD_ID + ":BoronSilicateGlassBlockRandlos"}, null, null, true, true); + public static final Block bw_fake_glasses2 = new BW_GlasBlocks2( + "BW_GlasBlocks2", + new String[] {MainMod.MOD_ID + ":BoronSilicateGlassBlockRandlos"}, + null, + null, + true, + true); public static final Block[] BW_BLOCKS = { new BW_Blocks( "BW_ItemBlocks", @@ -225,6 +238,7 @@ public class ItemRegistry { public static void run() { if (newStuff) { GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses, "BW_FakeGlasBlock"); + GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses2, "BW_FakeGlasBlocks2"); GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[2], BW_ItemBlocks.class, "BW_Machinery_Casings"); GameRegistry.registerItem(ItemRegistry.LEATHER_ROTOR, "BW_LeatherRotor"); GameRegistry.registerItem(ItemRegistry.WOOL_ROTOR, "BW_WoolRotor"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 2876e70b7a..f6bef99113 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -411,6 +411,18 @@ public class RecipeLoader { new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), 800, BW_Util.getMachineVoltageFromTier(9)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.Infinity.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 15), + 800, + BW_Util.getMachineVoltageFromTier(10)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.TranscendentMetal.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[1], 1, 0), + 800, + BW_Util.getMachineVoltageFromTier(11)); for (int i = 0; i < Dyes.dyeBrown.getSizeOfFluidList(); ++i) { GT_Values.RA.addChemicalBathRecipe( @@ -514,6 +526,18 @@ public class RecipeLoader { null, 800, BW_Util.getMachineVoltageFromTier(10)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 15), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.Infinity.getDust(8)}, + null, + 800, + BW_Util.getMachineVoltageFromTier(11)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[1], 1, 0), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.TranscendentMetal.getDust(8)}, + null, + 800, + BW_Util.getMachineVoltageFromTier(12)); for (int i = 6; i < 11; i++) { GT_Values.RA.addPulveriserRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index 2fbb6a2d33..de9aa9b70b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -54,6 +54,7 @@ public class NEI_BW_Config implements IConfigureNEI { API.hideItem(new ItemStack(ItemRegistry.TAB)); API.hideItem(new ItemStack(FluidLoader.bioFluidBlock)); API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses)); + API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses2)); ItemStack[] prefixesToHide = { WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustTiny, WerkstoffLoader.Bismutite) .copy(), diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 5fbbd79986..21208346cd 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -58,6 +58,8 @@ BW_GlasBlocks.11.name=Colored Borosilicate Glass Block (Brown) BW_GlasBlocks.12.name=Thorium Yttrium Glass Block BW_GlasBlocks.13.name=Neutronium Reinforced Borosilicate Glass Block BW_GlasBlocks.14.name=Cosmic Neutronium Reinforced Borosilicate Glass Block +BW_GlasBlocks.15.name=Infinity Reinforced Borosilicate Glass Block +BW_GlasBlocks2.0.name=Transcendentally Reinforced Borosilicate Glass Block tooltip.glas.0.name=Glass-Tier: tooltip.LESU.0.name=Maximum Capacity! diff --git a/src/main/resources/assets/bartworks/textures/blocks/InfinityReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/InfinityReinforcedBoronSilicateGlassBlock.png new file mode 100644 index 0000000000..4710c28436 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/InfinityReinforcedBoronSilicateGlassBlock.png differ diff --git a/src/main/resources/assets/bartworks/textures/blocks/TranscendentallyReinforcedBoronSilicateGlassBlock.png b/src/main/resources/assets/bartworks/textures/blocks/TranscendentallyReinforcedBoronSilicateGlassBlock.png new file mode 100644 index 0000000000..220e85e57c Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/blocks/TranscendentallyReinforcedBoronSilicateGlassBlock.png differ -- cgit From 6ded282109c1d13635b8439773472cd9beaf33f2 Mon Sep 17 00:00:00 2001 From: くぁーりぃ <39122497+Quarri6343@users.noreply.github.com> Date: Sat, 8 Oct 2022 16:25:43 +0900 Subject: add Bio Fluid Block lang key (#209) Former-commit-id: 171eafe6e82a43a265843f4087f76a045639ef1e --- src/main/resources/assets/bartworks/lang/en_US.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 21208346cd..e581657820 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -149,6 +149,7 @@ tile.biovat.name=Bacterial Vat tile.radiohatch.name=Radio Hatch tile.bw.windmill.name=Windmill tile.manutrafo.name=Manual Trafo +tile.BioFluidBlock.name=Bio Fluid Block item.TRISOPellet.name=TRISO pebble item.TRISOPelletBall.name=TRISO pebble ball -- cgit From bb7f5830fe27e75a9f24197878058f2e25a8b7c0 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Sat, 8 Oct 2022 13:11:26 +0200 Subject: EIG: Fix multiple input hatches beeing ignored & Make setup modes faster. (#210) * Deplete water from all hatches * Make setup modes fast * spotlessApply (#211) Co-authored-by: Jakub <53441451+kuba6000@users.noreply.github.com> Co-authored-by: GitHub GTNH Actions <> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Former-commit-id: 918011dfc525f5a884281dd5f4874dda1b4fa8a3 --- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 59 ++++++++++++++++++---- 1 file changed, 49 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index a1b32c92c8..7342c35b63 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -40,12 +40,12 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.*; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; import gregtech.common.GT_DummyWorld; +import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_OutputBus_ME; import ic2.api.crops.CropCard; import ic2.api.crops.Crops; import ic2.core.Ic2Items; @@ -316,13 +316,26 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse startRecipeProcessing(); if (setupphase == 1 && mStorage.size() < mMaxSlots) { List inputs = getStoredInputs(); - for (ItemStack input : inputs) if (addCrop(input)) break; + for (ItemStack input : inputs) addCrop(input); this.updateSlots(); } else if (setupphase == 2 && mStorage.size() > 0) { - this.addOutput(this.mStorage.get(0).input.copy()); - if (this.mStorage.get(0).undercrop != null) - this.addOutput(this.mStorage.get(0).undercrop.copy()); - this.mStorage.remove(0); + int emptySlots = 0; + boolean ignoreEmptiness = false; + for (GT_MetaTileEntity_Hatch_OutputBus i : mOutputBusses) { + if (i instanceof GT_MetaTileEntity_Hatch_OutputBus_ME) { + ignoreEmptiness = true; + break; + } + for (int j = 0; j < i.getSizeInventory(); j++) + if (i.isValidSlot(j)) if (i.getStackInSlot(j) == null) emptySlots++; + } + while (mStorage.size() > 0) { + if (!ignoreEmptiness && (emptySlots -= 2) < 0) break; + this.addOutput(this.mStorage.get(0).input.copy()); + if (this.mStorage.get(0).undercrop != null) + this.addOutput(this.mStorage.get(0).undercrop.copy()); + this.mStorage.remove(0); + } this.updateSlots(); } endRecipeProcessing(); @@ -366,8 +379,34 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse waterusage = 0; for (GreenHouseSlot s : mStorage) waterusage += s.input.stackSize; - - if (!depleteInput(new FluidStack(FluidRegistry.WATER, waterusage * 1000)) && !debug) return false; + waterusage *= 1000; + + List fluids = mInputHatches; + List fluidsToUse = new ArrayList<>(fluids.size()); + int watercheck = waterusage; + FluidStack waterStack = new FluidStack(FluidRegistry.WATER, 1); + for (GT_MetaTileEntity_Hatch_Input i : fluids) { + if (!isValidMetaTileEntity(i)) continue; + if (i instanceof GT_MetaTileEntity_Hatch_MultiInput) { + int amount = ((GT_MetaTileEntity_Hatch_MultiInput) i).getFluidAmount(waterStack); + if (amount == 0) continue; + watercheck -= amount; + } else { + FluidStack stack = i.getDrainableStack(); + if (stack == null) continue; + if (!stack.isFluidEqual(waterStack)) continue; + if (stack.amount <= 0) continue; + watercheck -= stack.amount; + } + fluidsToUse.add(i); + if (watercheck <= 0) break; + } + if (watercheck > 0 && !debug) return false; + watercheck = waterusage; + for (GT_MetaTileEntity_Hatch_Input i : fluidsToUse) { + int used = i.drain(watercheck, true).amount; + watercheck -= used; + } // OVERCLOCK // FERTILIZER IDEA - IC2 +10% per fertilizer per crop per operation, NORMAL +200% per fertilizer per crop per @@ -459,7 +498,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse ? (isIC2Mode ? "IC2 crops" : "Normal crops") : ("Setup mode " + (setupphase == 1 ? "(input)" : "(output)"))) + EnumChatFormatting.RESET, - "Uses " + waterusage * 1000 + "L/operation of water", + "Uses " + waterusage + "L/operation of water", "Max slots: " + EnumChatFormatting.GREEN + this.mMaxSlots + EnumChatFormatting.RESET, "Used slots: " + ((mStorage.size() > mMaxSlots) ? EnumChatFormatting.RED : EnumChatFormatting.GREEN) + this.mStorage.size() + EnumChatFormatting.RESET)); -- cgit From e6a5c248d80aa69b60f0e95e9583f85dab1093f6 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Sat, 8 Oct 2022 21:04:25 +0800 Subject: inductor warp (#212) Former-commit-id: 040b4fffe0212c3a3dfcb4079c30c9df5047a3a4 --- .../system/material/CircuitGeneration/CircuitPartLoader.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index fbec204c80..648d377e1c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -65,7 +65,8 @@ public class CircuitPartLoader implements Runnable { || single == Circuit_Parts_Capacitor || single == Circuit_Parts_Diode || single == Circuit_Parts_Resistor - || single == Circuit_Parts_Transistor) { + || single == Circuit_Parts_Transistor + || single == Circuit_Parts_Coil) { CircuitImprintLoader.blacklistSet.add(single.get(1)); } @@ -121,7 +122,7 @@ public class CircuitPartLoader implements Runnable { Circuit_Board_Bio, Circuit_Board_Bio_Ultra, Circuit_Parts_ResistorSMD, - Circuit_Parts_Coil, + Circuit_Parts_InductorSMD, Circuit_Parts_DiodeSMD, Circuit_Parts_TransistorSMD, Circuit_Parts_CapacitorSMD, @@ -157,5 +158,7 @@ public class CircuitPartLoader implements Runnable { Circuit_Parts_ResistorXSMD, Circuit_Parts_DiodeXSMD, Circuit_Parts_TransistorXSMD, - Circuit_Parts_CapacitorXSMD)); + Circuit_Parts_CapacitorXSMD, + Circuit_Parts_InductorASMD, + Circuit_Parts_InductorXSMD)); } -- cgit From 4f05ff3638399c6b32953620c4673f726c8c8264 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Sat, 8 Oct 2022 22:58:34 +0800 Subject: add foil for bw material (#213) * add foil for bw material * forget something Former-commit-id: 3c870fc78e13967b71446cb61fec601fba01aa6c --- .../bartimaeusnek/bartworks/system/material/Werkstoff.java | 1 + .../bartimaeusnek/bartworks/system/material/WerkstoffLoader.java | 1 + .../material/werkstoff_loaders/recipe/SimpleMetalLoader.java | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 58c0811d93..6d1a7ace26 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -774,6 +774,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten, 0b1000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plate, 0b10000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.foil, 0b10000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stick, 0b10000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.stickLong, 0b10000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.toolHeadHammer, 0b10000000); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index ac5c1948c1..c2cf281663 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1820,6 +1820,7 @@ public class WerkstoffLoader { } if ((WerkstoffLoader.toGenerateGlobal & 0b10000000) != 0) { WerkstoffLoader.items.put(plate, new BW_MetaGenerated_Items(plate)); + WerkstoffLoader.items.put(foil, new BW_MetaGenerated_Items(foil)); WerkstoffLoader.items.put(stick, new BW_MetaGenerated_Items(stick)); WerkstoffLoader.items.put(stickLong, new BW_MetaGenerated_Items(stickLong)); WerkstoffLoader.items.put(toolHeadWrench, new BW_MetaGenerated_Items(toolHeadWrench)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java index fd8d5be39e..20ba0564ac 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java @@ -84,6 +84,8 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { werkstoff.get(stick), GT_Proxy.tBits, new Object[] {"f ", " X", 'X', werkstoff.get(ingot)}); GT_ModHandler.addCraftingRecipe( werkstoff.get(plate), GT_Proxy.tBits, new Object[] {"h", "X", "X", 'X', werkstoff.get(ingot)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(foil, 2), GT_Proxy.tBits, new Object[] {"hX", 'X', werkstoff.get(plate)}); GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe( true, @@ -113,6 +115,13 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); + GT_Values.RA.addBenderRecipe( + werkstoff.get(plate), + GT_Utility.getIntegratedCircuit(1), + werkstoff.get(foil, 4), + (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), + 48); + GT_Values.RA.addForgeHammerRecipe( werkstoff.get(stick, 2), werkstoff.get(stickLong), -- cgit From 6c5910a4e7f342b09fcf3a642dfd3cac8879545d Mon Sep 17 00:00:00 2001 From: iouter <62897714+iouter@users.noreply.github.com> Date: Sun, 9 Oct 2022 18:03:54 +0800 Subject: Update GT_TileEntity_Windmill.java (#214) Former-commit-id: da53075b7721e68af4fcb6ee3bf48d011953cac3 --- .../bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index e65d5d1ebb..a1e643abd0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -240,7 +240,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock // Decrease input stack by appropriate amount (Not always 1) for (int i = 0; i < this.mMulti; i++) { if (!tRecipe.isRecipeInputEqual(true, null, itemStack)) { - this.mMulti = i + 1; + this.mMulti = i; break; } } @@ -255,7 +255,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock * ((float) Math.sqrt((float) 1 / (this.rotorBlock.getWindStrength() + 1))) * OutputMultiplier(rotorBlock) * (mRecipe[0] + mRecipe[1]))); - int amount = Math.round(multiper * (this.mOutputItems[0].stackSize * this.mMulti)); + int amount = (int) Math.floor(multiper * (this.mOutputItems[0].stackSize * this.mMulti)); // Split ItemStack --by gtpp List splitStacks = new ArrayList<>(); -- cgit From 166c7411daeb523cd8411e6db2822a8de6705a22 Mon Sep 17 00:00:00 2001 From: miozune Date: Thu, 13 Oct 2022 02:01:45 +0900 Subject: Remove circuit 0 (#215) Former-commit-id: 82d1d14bcd56ba299ec21a8282aae977fc3c9ed9 --- .../bartworks/system/material/processingLoaders/AdditionalRecipes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 149bd67629..6df9b03f4a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -207,7 +207,7 @@ public class AdditionalRecipes { new BWRecipes.BacteriaVatRecipe( true, new ItemStack[] { - GT_Utility.getIntegratedCircuit(0), new ItemStack(Items.sugar, 64) + GT_Utility.getIntegratedCircuit(1), new ItemStack(Items.sugar, 64) }, null, BioItemList.getPetriDish(bioCulture), -- cgit From 819069c6d6cbbe1815b78e0b89926de036418255 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Thu, 13 Oct 2022 20:38:03 +0200 Subject: Fix accidental block dupe (#216) * Fix dupe * Move setup process to checkRecipe Former-commit-id: f72a6bd720ae66d8d722658e8d467a239b969ec3 --- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 56 +++++++++++----------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index 7342c35b63..c64050ed0e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -312,34 +312,6 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse } } } - if (aBaseMetaTileEntity.isServerSide() && this.mMaxProgresstime > 0 && setupphase > 0 && aTick % 5 == 0) { - startRecipeProcessing(); - if (setupphase == 1 && mStorage.size() < mMaxSlots) { - List inputs = getStoredInputs(); - for (ItemStack input : inputs) addCrop(input); - this.updateSlots(); - } else if (setupphase == 2 && mStorage.size() > 0) { - int emptySlots = 0; - boolean ignoreEmptiness = false; - for (GT_MetaTileEntity_Hatch_OutputBus i : mOutputBusses) { - if (i instanceof GT_MetaTileEntity_Hatch_OutputBus_ME) { - ignoreEmptiness = true; - break; - } - for (int j = 0; j < i.getSizeInventory(); j++) - if (i.isValidSlot(j)) if (i.getStackInSlot(j) == null) emptySlots++; - } - while (mStorage.size() > 0) { - if (!ignoreEmptiness && (emptySlots -= 2) < 0) break; - this.addOutput(this.mStorage.get(0).input.copy()); - if (this.mStorage.get(0).undercrop != null) - this.addOutput(this.mStorage.get(0).undercrop.copy()); - this.mStorage.remove(0); - } - this.updateSlots(); - } - endRecipeProcessing(); - } } @Override @@ -368,7 +340,32 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse if (setupphase > 0) { if ((mStorage.size() >= mMaxSlots && setupphase == 1) || (mStorage.size() == 0 && setupphase == 2)) return false; - this.mMaxProgresstime = 20; + + if (setupphase == 1) { + List inputs = getStoredInputs(); + for (ItemStack input : inputs) addCrop(input); + } else if (setupphase == 2) { + int emptySlots = 0; + boolean ignoreEmptiness = false; + for (GT_MetaTileEntity_Hatch_OutputBus i : mOutputBusses) { + if (i instanceof GT_MetaTileEntity_Hatch_OutputBus_ME) { + ignoreEmptiness = true; + break; + } + for (int j = 0; j < i.getSizeInventory(); j++) + if (i.isValidSlot(j)) if (i.getStackInSlot(j) == null) emptySlots++; + } + while (mStorage.size() > 0) { + if (!ignoreEmptiness && (emptySlots -= 2) < 0) break; + this.addOutput(this.mStorage.get(0).input.copy()); + if (this.mStorage.get(0).undercrop != null) + this.addOutput(this.mStorage.get(0).undercrop.copy()); + this.mStorage.remove(0); + } + } + + this.updateSlots(); + this.mMaxProgresstime = 5; this.mEUt = 0; this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; @@ -802,6 +799,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse boolean cangrow = false; ArrayList inputs = tileEntity.getStoredInputs(); for (ItemStack a : inputs) { + if (a.stackSize <= 0) continue; Block b = Block.getBlockFromItem(a.getItem()); if (b == Blocks.air) continue; world.setBlock(xyz[0], xyz[1] - 2, xyz[2], b, a.getItemDamage(), 0); -- cgit From e9d22462675a982a414b5c46be085bf0ba9a8ca4 Mon Sep 17 00:00:00 2001 From: iouter <62897714+iouter@users.noreply.github.com> Date: Fri, 14 Oct 2022 22:03:15 +0800 Subject: Update GT_TileEntity_Windmill.java (#217) Former-commit-id: e74cf9861c474c4457a94827ba5c5cff2e77d317 --- .../common/tileentities/multis/GT_TileEntity_Windmill.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index a1e643abd0..fddf307ec1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -260,17 +260,17 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock // Split ItemStack --by gtpp List splitStacks = new ArrayList<>(); while (amount > this.mOutputItems[0].getMaxStackSize()) { - ItemStack tmp = this.mOutputItems[0]; + ItemStack tmp = this.mOutputItems[0].copy(); tmp.stackSize = this.mOutputItems[0].getMaxStackSize(); amount -= this.mOutputItems[0].getMaxStackSize(); splitStacks.add(tmp); } - ItemStack tmp = this.mOutputItems[0]; + ItemStack tmp = this.mOutputItems[0].copy(); tmp.stackSize = amount; splitStacks.add(tmp); mOutputItems = splitStacks.toArray(new ItemStack[splitStacks.size()]); } - this.mMaxProgresstime = (tRecipe.mDuration * 2 * 100 * this.mMulti) / (int) getSpeed(rotorBlock); + this.mMaxProgresstime = (tRecipe.mDuration * 2 * 100 * this.mMulti) / getSpeed(rotorBlock); this.mMulti = 16; return true; } -- cgit From 7a84c71f5aab56f482b229189e0ac40de2f48d2e Mon Sep 17 00:00:00 2001 From: miozune Date: Sun, 16 Oct 2022 18:50:47 +0900 Subject: Fix oredicted circuit parts preventing CAL recipe generation (#219) Former-commit-id: b7a314b15f5ba04c9423bbf2bd49d1c49b5f26ff --- .../CircuitGeneration/CircuitImprintLoader.java | 25 +++++++++++++++++++++- .../CircuitGeneration/CircuitPartLoader.java | 7 +----- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 1176712cc7..2abfb4e066 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -27,6 +27,7 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.Pair; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; @@ -38,7 +39,10 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.Arrays; +import java.util.Collections; import java.util.HashSet; +import java.util.List; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; @@ -203,13 +207,32 @@ public class CircuitImprintLoader { private static void replaceCircuits( BiMap inversed, GT_Recipe original, ItemStack[] in, int index) { for (ItemList il : inversed.keySet()) { - if (GT_Utility.areStacksEqual(il.get(1), original.mInputs[index])) { + if (GT_Utility.areStacksEqual(il.get(1), replaceCircuitParts(original.mInputs[index]))) { in[index] = BW_Meta_Items.getNEWCIRCUITS().getStack(inversed.get(il), original.mInputs[index].stackSize); } } } + private static final List> circuitPartsToReplace = + Collections.unmodifiableList(Arrays.asList( + new Pair<>(ItemList.Circuit_Parts_Resistor.get(1), ItemList.Circuit_Parts_ResistorSMD.get(1)), + new Pair<>(ItemList.Circuit_Parts_Diode.get(1), ItemList.Circuit_Parts_DiodeSMD.get(1)), + new Pair<>(ItemList.Circuit_Parts_Transistor.get(1), ItemList.Circuit_Parts_TransistorSMD.get(1)), + new Pair<>(ItemList.Circuit_Parts_Capacitor.get(1), ItemList.Circuit_Parts_CapacitorSMD.get(1)), + new Pair<>(ItemList.Circuit_Parts_Coil.get(1), ItemList.Circuit_Parts_InductorSMD.get(1)))); + + private static ItemStack replaceCircuitParts(ItemStack stack) { + for (Pair pair : circuitPartsToReplace) { + if (GT_Utility.areStacksEqual(pair.getKey(), stack)) { + ItemStack newStack = pair.getValue(); + newStack.stackSize = stack.stackSize; + return newStack; + } + } + return stack; + } + @SuppressWarnings("deprecation") private static void replaceComponents(ItemStack[] in, GT_Recipe original, int index) throws ArrayIndexOutOfBoundsException { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index 648d377e1c..6ba0d7da55 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -61,12 +61,7 @@ public class CircuitPartLoader implements Runnable { || single == Circuit_Integrated || single == Circuit_Parts_PetriDish || single == Circuit_Parts_Vacuum_Tube - || single == Circuit_Integrated_Good - || single == Circuit_Parts_Capacitor - || single == Circuit_Parts_Diode - || single == Circuit_Parts_Resistor - || single == Circuit_Parts_Transistor - || single == Circuit_Parts_Coil) { + || single == Circuit_Integrated_Good) { CircuitImprintLoader.blacklistSet.add(single.get(1)); } -- cgit From 2d4f350fcf33d76a98d45bd9e2053cd97de2f419 Mon Sep 17 00:00:00 2001 From: Maxim Date: Mon, 17 Oct 2022 21:11:57 +0200 Subject: Fix EIG structure tooltip (#221) * Added coil and glass count to the tooltip * Fixed EIG structure tooltip Former-commit-id: abf30070b86f563c789f12be1b72053de1056113 --- .../multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index c64050ed0e..f5eb642046 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -237,10 +237,10 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse .addInfo("1 Fertilizer per 1 crop +10%") .addInfo(BW_Tooltip_Reference.TT_BLUEPRINT) .addSeparator() - .beginStructureBlock(5, 4, 5, false) + .beginStructureBlock(5, 6, 5, false) .addController("Front bottom center") .addCasingInfo("Clean Stainless Steel Casings", 70) - .addOtherStructurePart("Borosilicate Glass", "Hollow two middle layers", 2) + .addOtherStructurePart("Borosilicate Glass", "Hollow two middle layers") .addStructureInfo("The glass tier limits the Energy Input tier") .addStructureInfo("The dirt is from RandomThings, must be tilled") .addStructureInfo("Purple lamps are from ProjectRedIllumination. They can be lit") -- cgit From 3d38b348e19a3e2cd3676316b8a849bd747b7393 Mon Sep 17 00:00:00 2001 From: GDCloud <93287602+GDCloudstrike@users.noreply.github.com> Date: Wed, 19 Oct 2022 21:34:47 +0200 Subject: New high density compression recipes (#218) Former-commit-id: 7731726608afcdec2b69e77ff06becb50198f41c --- .../common/loaders/StaticRecipeChangeLoaders.java | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 6e9ae5d852..73f56dc0d0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -651,6 +651,39 @@ public class StaticRecipeChangeLoaders { 128_000_000, 1); // aSpecialVaue has no meaning here. } + + eicMap.addRecipe( + false, + new ItemStack[] {GT_ModHandler.getModItem("GoodGenerator", "highDensityPlutoniumNugget", 5L)}, + new ItemStack[] {GT_ModHandler.getModItem("GoodGenerator", "highDensityPlutonium", 1L)}, + null, + new FluidStack[] {Materials.Infinity.getMolten(9L)}, + new FluidStack[] {GT_Values.NF}, + 1, + 7_864_320, + 1); + + eicMap.addRecipe( + false, + new ItemStack[] {GT_ModHandler.getModItem("GoodGenerator", "highDensityUraniumNugget", 5L)}, + new ItemStack[] {GT_ModHandler.getModItem("GoodGenerator", "highDensityUranium", 1L)}, + null, + new FluidStack[] {Materials.Infinity.getMolten(9L)}, + new FluidStack[] {GT_Values.NF}, + 1, + 7_864_320, + 1); + + eicMap.addRecipe( + false, + new ItemStack[] {GT_ModHandler.getModItem("GoodGenerator", "highDensityThoriumNugget", 5L)}, + new ItemStack[] {GT_ModHandler.getModItem("GoodGenerator", "highDensityThorium", 1L)}, + null, + new FluidStack[] {Materials.Infinity.getMolten(9L)}, + new FluidStack[] {GT_Values.NF}, + 1, + 7_864_320, + 1); } private static boolean checkForExplosives(ItemStack input) { -- cgit From 5112a88b168aa81d158366b02f4f9dc4a3f17006 Mon Sep 17 00:00:00 2001 From: Sampsa <69092953+S4mpsa@users.noreply.github.com> Date: Mon, 24 Oct 2022 23:23:52 +0300 Subject: Add balanced batch mode to MEBF, MVF, MCR & MDT (#225) * Add batch mode to Mega Blast Furnace * Add batch mode to Mega Chemical Reactor and Mega Vacuum Freezer * Apply spotless * do required changes * fix wrong eu/t being used when batch mode is enabled * Fix batchmode to be a float and add MDT to batching mode * Spotless apply for branch batch_megas for #220 (#222) * Fix EIG structure tooltip (#221) * Added coil and glass count to the tooltip * Fixed EIG structure tooltip * spotlessApply Co-authored-by: Maxim Co-authored-by: Sampsa <69092953+S4mpsa@users.noreply.github.com> Co-authored-by: GitHub GTNH Actions <> * Fix imports hopefully * Spotless apply for branch batch_megas for #220 (#223) * Fix EIG structure tooltip (#221) * Added coil and glass count to the tooltip * Fixed EIG structure tooltip * spotlessApply Co-authored-by: Maxim Co-authored-by: Sampsa <69092953+S4mpsa@users.noreply.github.com> Co-authored-by: GitHub GTNH Actions <> * do Sampsas wanted changes * Spotless apply for branch batch_megas for #220 (#224) * Fix EIG structure tooltip (#221) * Added coil and glass count to the tooltip * Fixed EIG structure tooltip * spotlessApply Co-authored-by: Maxim Co-authored-by: Sampsa <69092953+S4mpsa@users.noreply.github.com> Co-authored-by: GitHub GTNH Actions <> * Simplify logic, remove batch mode tick limit bypass * Apply spotless * Fix unintentional speedup of batches less than 256 Co-authored-by: BlueWeabo <76872108+BlueWeabo@users.noreply.github.com> Co-authored-by: PGE Programirane Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Maxim Former-commit-id: 3ba950f0f7852e20ee08dac6ae119da7fd880ad8 --- .../mega/GT_TileEntity_MegaBlastFurnace.java | 35 ++++++++++++--- .../mega/GT_TileEntity_MegaChemicalReactor.java | 51 ++++++++++++++++++++- .../mega/GT_TileEntity_MegaDistillTower.java | 52 ++++++++++++++++++++-- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 51 ++++++++++++++++++++- .../resources/assets/bartworks/lang/en_US.lang | 3 ++ 5 files changed, 179 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 3ab76bcef1..67dc33c702 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -223,10 +223,12 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock this.circuitMode = aNBT.getByte("circuitMode"); this.glasTier = aNBT.getByte("glasTier"); this.isBussesSeparate = aNBT.getBoolean("isBussesSeparate"); + this.mUseMultiparallelMode = aNBT.getBoolean("mUseMultiparallelMode"); } private byte circuitMode = 0; private boolean isBussesSeparate = false; + private boolean mUseMultiparallelMode = false; @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { @@ -246,10 +248,20 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override public boolean onWireCutterRightClick( byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - isBussesSeparate = !isBussesSeparate; - GT_Utility.sendChatToPlayer( - aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate); - return true; + if (aPlayer.isSneaking()) { + mUseMultiparallelMode = !mUseMultiparallelMode; + if (mUseMultiparallelMode) { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); + } else { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); + } + return true; + } else { + isBussesSeparate = !isBussesSeparate; + GT_Utility.sendChatToPlayer( + aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate); + return true; + } } @Override @@ -296,6 +308,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock aNBT.setByte("glasTier", glasTier); aNBT.setByte("circuitMode", circuitMode); aNBT.setBoolean("isBussesSeparate", isBussesSeparate); + aNBT.setBoolean("mUseMultiparallelMode", mUseMultiparallelMode); } @Override @@ -402,12 +415,17 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock long precutRecipeVoltage = (long) (tRecipe.mEUt * Math.pow(0.95, tHeatCapacityDivTiers)); long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / precutRecipeVoltage); - + if (mUseMultiparallelMode && tMaxPara == ConfigHandler.megaMachinesMax) { + tMaxPara *= 128; + } + float tBatchMultiplier = 1.0f; if (this.mHeatingCapacity >= tRecipe.mSpecialValue) { int tCurrentPara = handleParallelRecipe(tRecipe, tFluids, tInputs, (int) tMaxPara); + tBatchMultiplier = + mUseMultiparallelMode ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) : 1.0f; this.updateSlots(); if (tCurrentPara <= 0) return false; - processed = tCurrentPara; + processed = Math.min(tCurrentPara, ConfigHandler.megaMachinesMax); found_Recipe = true; Pair, ArrayList> Outputs = getMultiOutput(tRecipe, tCurrentPara); outputFluids = Outputs.getKey(); @@ -419,6 +437,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock this.mEfficiencyIncrease = 10000; long actualEUT = precutRecipeVoltage * processed; + byte overclockCount = this.calculateOverclockedNessMultiInternal(actualEUT, tRecipe.mDuration, nominalV, false); @@ -433,6 +452,10 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock if (this.mMaxProgresstime < 1) this.mMaxProgresstime = 1; // no eu efficiency correction } + if (mUseMultiparallelMode) { + this.mMaxProgresstime = (int) Math.ceil(this.mMaxProgresstime * tBatchMultiplier); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.polPtick = ConfigHandler.basePollutionMBFSecond / 20 * processed; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index 1a9b1e7130..b65ff1697c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -55,9 +55,12 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import java.util.ArrayList; import java.util.Collection; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; @Optional.Interface( @@ -158,6 +161,35 @@ public class GT_TileEntity_MegaChemicalReactor return false; } // TO IMPLEMENT + private boolean mUseMultiparallelMode = false; + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setBoolean("mUseMultiparallelMode", mUseMultiparallelMode); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + this.mUseMultiparallelMode = aNBT.getBoolean("mUseMultiparallelMode"); + } + + @Override + public boolean onWireCutterRightClick( + byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (aPlayer.isSneaking()) { + mUseMultiparallelMode = !mUseMultiparallelMode; + if (mUseMultiparallelMode) { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); + } else { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); + } + return true; + } + return false; + } + @Override public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); @@ -174,16 +206,24 @@ public class GT_TileEntity_MegaChemicalReactor this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); boolean found_Recipe = false; int processed = 0; + float tBatchMultiplier = 1.0f; if (tRecipe != null) { found_Recipe = true; long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); + if (mUseMultiparallelMode && tMaxPara == ConfigHandler.megaMachinesMax) { + tMaxPara *= 128; + } + int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); + tBatchMultiplier = + mUseMultiparallelMode ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) : 1.0f; + this.updateSlots(); if (tCurrentPara <= 0) { return false; } - processed = tCurrentPara; + processed = Math.min(tCurrentPara, ConfigHandler.megaMachinesMax); Pair, ArrayList> Outputs = getMultiOutput(tRecipe, tCurrentPara); outputFluids = Outputs.getKey(); outputItems = Outputs.getValue(); @@ -192,12 +232,19 @@ public class GT_TileEntity_MegaChemicalReactor if (found_Recipe) { this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - long actualEUT = ((long) tRecipe.mEUt) * processed; + + long actualEUT = (long) (tRecipe.mEUt) * processed; + calculatePerfectOverclockedNessMulti(actualEUT, tRecipe.mDuration, nominalV); // In case recipe is too OP for that machine if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) { return false; } + + if (mUseMultiparallelMode) { + this.mMaxProgresstime = (int) Math.ceil(this.mMaxProgresstime * tBatchMultiplier); + } + if (this.lEUt > 0) { this.lEUt = (-this.lEUt); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index c6b2954f90..c7e5c9b934 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -57,10 +57,13 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import java.util.ArrayList; import java.util.List; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; @Optional.Interface( @@ -515,6 +518,35 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock STRUCTURE_PIECE_TOP_HINT, stackSize, 7, 5 * mHeight, 0, realBudget, source, actor, false, true); } + private boolean mUseMultiparallelMode = false; + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setBoolean("mUseMultiparallelMode", mUseMultiparallelMode); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + this.mUseMultiparallelMode = aNBT.getBoolean("mUseMultiparallelMode"); + } + + @Override + public boolean onWireCutterRightClick( + byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (aPlayer.isSneaking()) { + mUseMultiparallelMode = !mUseMultiparallelMode; + if (mUseMultiparallelMode) { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); + } else { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); + } + return true; + } + return false; + } + @Override public boolean checkRecipe(ItemStack aStack) { @@ -548,13 +580,19 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock boolean found_Recipe = false; GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe( this.getBaseMetaTileEntity(), false, GT_Values.V[tTier], new FluidStack[] {tFluid}, tItems); - + float tBatchMultiplier = 1.0f; if (tRecipe != null) { found_Recipe = true; long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); + if (mUseMultiparallelMode && tMaxPara == ConfigHandler.megaMachinesMax) { + tMaxPara *= 128; + } int tCurrentPara = handleParallelRecipe(tRecipe, new FluidStack[] {tFluid}, null, (int) tMaxPara); + tBatchMultiplier = mUseMultiparallelMode + ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) + : 1.0f; this.updateSlots(); - processed = tCurrentPara; + processed = Math.min(tCurrentPara, ConfigHandler.megaMachinesMax); Outputs = getMultiOutput(tRecipe, tCurrentPara); outputFluids = Outputs.getKey(); outputItems = Outputs.getValue(); @@ -563,13 +601,21 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock if (!found_Recipe) continue; this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - long actualEUT = ((long) tRecipe.mEUt) * processed; + + long actualEUT = (long) (tRecipe.mEUt) * processed; + calculateOverclockedNessMulti(actualEUT, tRecipe.mDuration, nominalV); + // In case recipe is too OP for that machine if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) return false; if (this.lEUt > 0) { this.lEUt = (-this.lEUt); } + + if (mUseMultiparallelMode) { + this.mMaxProgresstime = (int) Math.ceil(this.mMaxProgresstime * tBatchMultiplier); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputFluids = outputFluids.toArray(new FluidStack[0]); if (!outputItems.isEmpty()) this.mOutputItems = outputItems.toArray(new ItemStack[0]); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 93f6cf6aa3..c77a0a7af9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -51,9 +51,12 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import java.util.ArrayList; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; @Optional.Interface( @@ -404,6 +407,35 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png"); } + private boolean mUseMultiparallelMode = false; + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setBoolean("mUseMultiparallelMode", mUseMultiparallelMode); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + this.mUseMultiparallelMode = aNBT.getBoolean("mUseMultiparallelMode"); + } + + @Override + public boolean onWireCutterRightClick( + byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (aPlayer.isSneaking()) { + mUseMultiparallelMode = !mUseMultiparallelMode; + if (mUseMultiparallelMode) { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); + } else { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); + } + return true; + } + return false; + } + @Override public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); @@ -420,14 +452,23 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); boolean found_Recipe = false; int processed = 0; + float tBatchMultiplier = 1.0f; if (tRecipe != null) { found_Recipe = true; long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); + + if (mUseMultiparallelMode && tMaxPara == ConfigHandler.megaMachinesMax) { + tMaxPara *= 128; + } + int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); + tBatchMultiplier = + mUseMultiparallelMode ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) : 1.0f; + this.updateSlots(); if (tCurrentPara <= 0) return false; - processed = tCurrentPara; + processed = Math.min(tCurrentPara, ConfigHandler.megaMachinesMax); Pair, ArrayList> Outputs = getMultiOutput(tRecipe, tCurrentPara); outputFluids = Outputs.getKey(); outputItems = Outputs.getValue(); @@ -436,13 +477,19 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc if (found_Recipe) { this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; + long actualEUT = (long) (tRecipe.mEUt) * processed; - calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, nominalV); + calculateOverclockedNessMulti(actualEUT, tRecipe.mDuration, nominalV); // In case recipe is too OP for that machine if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) return false; if (this.lEUt > 0) { this.lEUt = (-this.lEUt); } + + if (mUseMultiparallelMode) { + this.mMaxProgresstime = (int) Math.ceil(this.mMaxProgresstime * tBatchMultiplier); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = new ItemStack[outputItems.size()]; this.mOutputItems = outputItems.toArray(this.mOutputItems); diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index e581657820..62e21aa642 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -174,4 +174,7 @@ BW.infoData.BioVat.production=Production BW.NEI.display.radhatch.0=Sievert: %s Sv BW.NEI.display.radhatch.1=Mass: %s kg BW.NEI.display.radhatch.2=Time: %s s + +misc.BatchModeTextOn=Batch recipes +misc.BatchModeTextOff=Don't batch recipes #Liquids -- cgit From 1f057256b61183f1510df60e17987ebf497bb206 Mon Sep 17 00:00:00 2001 From: miozune Date: Tue, 25 Oct 2022 23:10:09 +0900 Subject: Fix Osmiridium Turbine recipe replaced by Ruridit (#226) Former-commit-id: c73ebaa1a4933e77a8e98f76e4deab5389f9d797 --- .../system/material/GT_Enhancement/LuVTierEnhancer.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java index 47989db5cc..7cad4fd11a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -38,6 +38,7 @@ import gregtech.api.objects.ItemData; import gregtech.api.util.*; import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.common.items.GT_MetaGenerated_Tool_01; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.*; @@ -58,6 +59,15 @@ public class LuVTierEnhancer implements Runnable { static { addToBlackListForOsmiridiumReplacement(ItemList.Casing_MiningOsmiridium.get(1)); + addToBlackListForOsmiridiumReplacement(GT_OreDictUnificator.get(OrePrefixes.turbine, Materials.Osmiridium, 1)); + addToBlackListForOsmiridiumReplacement(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + 170, 1, Materials.Osmiridium, Materials.Osmiridium, null)); + addToBlackListForOsmiridiumReplacement(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + 172, 1, Materials.Osmiridium, Materials.Osmiridium, null)); + addToBlackListForOsmiridiumReplacement(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + 174, 1, Materials.Osmiridium, Materials.Osmiridium, null)); + addToBlackListForOsmiridiumReplacement(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + 176, 1, Materials.Osmiridium, Materials.Osmiridium, null)); } public void run() { @@ -97,6 +107,9 @@ public class LuVTierEnhancer implements Runnable { AfterLuVTierEnhacement.run(); } + /** + * @param stack Output item to disable Ruridit replacement in recipes + */ public static void addToBlackListForOsmiridiumReplacement(ItemStack stack) { blackListForOsmiridium.add(stack); } -- cgit From eb6fa3c3ae9580d958ef046a853354e71e539758 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Wed, 26 Oct 2022 18:35:10 +0800 Subject: fix decompose recipe (#227) * prefer to use dust instead of fluid in decompose recipe * sa Former-commit-id: f3cd61eb988ae59fd7cf712f3520685de42ee769 --- dependencies.gradle | 5 ++++- .../material/werkstoff_loaders/recipe/CellLoader.java | 11 ++++++----- .../material/werkstoff_loaders/recipe/DustLoader.java | 15 ++++++++------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 066d0b0a63..055cd143d2 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.65:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.99:dev") compile("com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev") compile("com.github.GTNewHorizons:TecTech:5.0.42:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.3.7-GTNH:dev") @@ -40,6 +40,9 @@ dependencies { compileOnly("com.github.GTNewHorizons:BuildCraft:7.1.27:dev") { transitive = false } + compileOnly("com.github.GTNewHorizons:ProjectRed:4.7.7-GTNH:dev") { + transitive = false + } runtime("com.github.GTNewHorizons:Yamcl:0.5.84:dev") runtime("com.github.GTNewHorizons:ironchest:6.0.71:dev") //needed for Galacticraft } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java index a1de8695a0..32e72c96e6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java @@ -60,12 +60,13 @@ public class CellLoader implements IWerkstoffRunnable { for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { if (container.getKey() instanceof Materials) { - if (((Materials) container.getKey()).hasCorrespondingGas() - || ((Materials) container.getKey()).hasCorrespondingFluid() - || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { - FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); + if ((((Materials) container.getKey()).hasCorrespondingGas() + || ((Materials) container.getKey()).hasCorrespondingFluid() + || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) + && ((Materials) container.getKey()).getDust(0) == null) { + FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000L * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { - tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); + tmpFl = ((Materials) container.getKey()).getFluid(1000L * container.getValue()); } flOutputs.add(tmpFl); if (flOutputs.size() > 1) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java index 324e7905e8..3abe76739a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java @@ -61,12 +61,13 @@ public class DustLoader implements IWerkstoffRunnable { for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { if (container.getKey() instanceof Materials) { - if (((Materials) container.getKey()).getGas(0) != null - || ((Materials) container.getKey()).getFluid(0) != null - || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { - FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); + if ((((Materials) container.getKey()).getGas(0) != null + || ((Materials) container.getKey()).getFluid(0) != null + || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) + && ((Materials) container.getKey()).getDust(0) == null) { + FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000L * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { - tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); + tmpFl = ((Materials) container.getKey()).getFluid(1000L * container.getValue()); } flOutputs.add(tmpFl); if (flOutputs.size() > 1) { @@ -90,9 +91,9 @@ public class DustLoader implements IWerkstoffRunnable { && (((Materials) container.getKey()).getMolten(0) != null || ((Materials) container.getKey()).getSolid(0) != null)) { FluidStack tmpFl = - ((Materials) container.getKey()).getMolten(1000 * container.getValue()); + ((Materials) container.getKey()).getMolten(1000L * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { - tmpFl = ((Materials) container.getKey()).getSolid(1000 * container.getValue()); + tmpFl = ((Materials) container.getKey()).getSolid(1000L * container.getValue()); } flOutputs.add(tmpFl); if (flOutputs.size() > 1) { -- cgit From 2652f4b051c37a280f132602eda4ab4c4f39a15a Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Wed, 26 Oct 2022 20:26:16 +0200 Subject: update BS Former-commit-id: e9cdd98cef9e219dbbfbed30e7e5e12140bf48f4 --- build.gradle | 112 ++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 60 insertions(+), 52 deletions(-) diff --git a/build.gradle b/build.gradle index b961a5e176..bc7fcfd33f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1664372158 +//version: 1666118075 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -147,17 +147,21 @@ String javaSourceDir = "src/main/java/" String scalaSourceDir = "src/main/scala/" String kotlinSourceDir = "src/main/kotlin/" -String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") -String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") -String targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + +final String modGroupPath = modGroup.toString().replaceAll("\\.", "/") +final String apiPackagePath = apiPackage.toString().replaceAll("\\.", "/") + +String targetPackageJava = javaSourceDir + modGroupPath +String targetPackageScala = scalaSourceDir + modGroupPath +String targetPackageKotlin = kotlinSourceDir + modGroupPath if (!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) } if (apiPackage) { - targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") - targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") - targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + targetPackageJava = javaSourceDir + modGroupPath + "/" + apiPackagePath + targetPackageScala = scalaSourceDir + modGroupPath + "/" + apiPackagePath + targetPackageKotlin = kotlinSourceDir + modGroupPath + "/" + apiPackagePath if (!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) } @@ -171,31 +175,36 @@ if (accessTransformersFile) { } if (usesMixins.toBoolean()) { - if (mixinsPackage.isEmpty() || mixinPlugin.isEmpty()) { - throw new GradleException("\"mixinPlugin\" requires \"mixinsPackage\" and \"mixinPlugin\" to be set!") + if (mixinsPackage.isEmpty()) { + throw new GradleException("\"usesMixins\" requires \"mixinsPackage\" to be set!") } + final String mixinPackagePath = mixinsPackage.toString().replaceAll("\\.", "/") + final String mixinPluginPath = mixinPlugin.toString().replaceAll("\\.", "/") - targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/") - targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/") - targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/") + targetPackageJava = javaSourceDir + modGroupPath + "/" + mixinPackagePath + targetPackageScala = scalaSourceDir + modGroupPath + "/" + mixinPackagePath + targetPackageKotlin = kotlinSourceDir + modGroupPath + "/" + mixinPackagePath if (!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) } - 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" - String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".kt" - if (!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) { - throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin) + if (!mixinPlugin.isEmpty()) { + String targetFileJava = javaSourceDir + modGroupPath + "/" + mixinPluginPath + ".java" + String targetFileScala = scalaSourceDir + modGroupPath + "/" + mixinPluginPath + ".scala" + String targetFileScalaJava = scalaSourceDir + modGroupPath + "/" + mixinPluginPath + ".java" + String targetFileKotlin = kotlinSourceDir + modGroupPath + "/" + mixinPluginPath + ".kt" + if (!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) { + throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin) + } } } if (coreModClass) { - 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" - String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".kt" + final String coreModPath = coreModClass.toString().replaceAll("\\.", "/") + String targetFileJava = javaSourceDir + modGroupPath + "/" + coreModPath + ".java" + String targetFileScala = scalaSourceDir + modGroupPath + "/" + coreModPath + ".scala" + String targetFileScalaJava = scalaSourceDir + modGroupPath + "/" + coreModPath + ".java" + String targetFileKotlin = kotlinSourceDir + modGroupPath + "/" + coreModPath + ".kt" if (!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) { throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin) } @@ -251,7 +260,7 @@ if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) { def arguments = [] def jvmArguments = [] -if (usesMixins.toBoolean() || forceEnableMixins) { +if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { arguments += [ "--tweakClass org.spongepowered.asm.launch.MixinTweaker" ] @@ -316,13 +325,10 @@ repositories { name 'Overmind forge repo mirror' url 'https://gregtech.overminddl1.com/' } - if (usesMixins.toBoolean() || forceEnableMixins) { + if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { maven { - name 'sponge' - url 'https://repo.spongepowered.org/repository/maven-public' - } - maven { - url 'https://jitpack.io' + name = "GTNH Maven" + url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" } } } @@ -332,19 +338,10 @@ dependencies { annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3') annotationProcessor('com.google.guava:guava:24.1.1-jre') annotationProcessor('com.google.code.gson:gson:2.8.6') - annotationProcessor('org.spongepowered:mixin:0.8-SNAPSHOT') - } - if (usesMixins.toBoolean() || forceEnableMixins) { - // 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') + annotationProcessor('org.spongepowered:mixin:0.8.5-GTNH:processor') + } + if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { + compile('com.gtnewhorizon:gtnhmixins:2.0.1') } } @@ -356,13 +353,18 @@ def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg" task generateAssets { if (usesMixins.toBoolean()) { - def mixinConfigFile = getFile("/src/main/resources/mixins." + modId + ".json"); + def mixinConfigFile = getFile("/src/main/resources/mixins." + modId + ".json") if (!mixinConfigFile.exists()) { + def mixinPluginLine = "" + if(!mixinPlugin.isEmpty()) { + // We might not have a mixin plugin if we're using early/late mixins + mixinPluginLine += """\n "plugin": "${modGroup}.${mixinPlugin}", """ + } + mixinConfigFile.text = """{ "required": true, - "minVersion": "0.7.11", - "package": "${modGroup}.${mixinsPackage}", - "plugin": "${modGroup}.${mixinPlugin}", + "minVersion": "0.8.5-GTNH", + "package": "${modGroup}.${mixinsPackage}",${mixinPluginLine} "refmap": "${mixingConfigRefMap}", "target": "@env(DEFAULT)", "compatibilityLevel": "JAVA_8", @@ -574,11 +576,11 @@ task devJar(type: Jar) { task apiJar(type: Jar) { from(sourceSets.main.allSource) { - include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**' + include modGroupPath + "/" + apiPackagePath + '/**' } from(sourceSets.main.output) { - include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**' + include modGroupPath + "/" + apiPackagePath + '/**' } from(sourceSets.main.resources.srcDirs) { @@ -662,10 +664,10 @@ publishing { } } -if (modrinthProjectId.size() != 0) { +if (modrinthProjectId.size() != 0 && System.getenv("MODRINTH_TOKEN") != null) { apply plugin: 'com.modrinth.minotaur' - File changelogFile = new File("CHANGELOG.md") + File changelogFile = new File(System.getenv("CHANGELOG_FILE") ?: "CHANGELOG.md") modrinth { token = System.getenv("MODRINTH_TOKEN") @@ -691,14 +693,17 @@ if (modrinthProjectId.size() != 0) { addModrinthDep(qual[0], qual[1], parts[1]) } } + if (usesMixins.toBoolean()) { + addModrinthDep("required", "version", "gtnhmixins") + } tasks.modrinth.dependsOn(build) tasks.publish.dependsOn(tasks.modrinth) } -if (curseForgeProjectId.size() != 0) { +if (curseForgeProjectId.size() != 0 && System.getenv("CURSEFORGE_TOKEN") != null) { apply plugin: 'com.matthewprenger.cursegradle' - File changelogFile = new File("CHANGELOG.md") + File changelogFile = new File(System.getenv("CHANGELOG_FILE") ?: "CHANGELOG.md") curseforge { apiKey = System.getenv("CURSEFORGE_TOKEN") @@ -732,6 +737,9 @@ if (curseForgeProjectId.size() != 0) { addCurseForgeRelation(parts[0], parts[1]) } } + if (usesMixins.toBoolean()) { + addCurseForgeRelation("requiredDependency", "gtnhmixins") + } tasks.curseforge.dependsOn(build) tasks.publish.dependsOn(tasks.curseforge) } -- cgit From 0093be04e46484d89f1c55eaee4d83e50833ca5e Mon Sep 17 00:00:00 2001 From: Elisis Date: Tue, 1 Nov 2022 02:56:11 +1100 Subject: Werkstoff Fluid Solidifier Recipe Generation (#228) * Add options to autogenerate fluid solidifier recipes for a werkstoff material, remove pre-existing hardcoded gear, bolt, rotor, ring solidifier recipe generation * spotlessApply (#229) Co-authored-by: Elisis Co-authored-by: GitHub GTNH Actions <> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Former-commit-id: 59a66065becb404415651f8d59b3ee851b6b563c --- .../bartworks/system/material/Werkstoff.java | 36 ++++++++++ .../recipe/CraftingMaterialLoader.java | 54 ++++++++------- .../werkstoff_loaders/recipe/MoltenCellLoader.java | 80 ++++++++++++++++++++++ 3 files changed, 145 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 6d1a7ace26..a0c5e63ef3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -832,6 +832,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { * Auto add MetalWorking(crafting components) Recipe 10000 */ public byte extraRecipes; + + /* + * Here so that new recipes don't fuck with existing functionality + * Auto add Crafting Metal Solidifier recipes 1 + * Auto add Meta Crafting Metal Solidifier recipes 10 + * Auto add Multiple Ingot Metal Solidifier recipes 100 (Unused) + */ + public byte extraRecipes2; + public short mixCircuit = -1; public Werkstoff.GenerationFeatures setBlacklist(OrePrefixes p) { @@ -886,6 +895,33 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return (this.extraRecipes & 1) != 0; } + public Werkstoff.GenerationFeatures addMetalCraftingSolidifierRecipes() { + this.extraRecipes2 = (byte) (this.extraRecipes2 | 1); + return this; + } + + public boolean hasMetalCraftingSolidifierRecipes() { + return (this.extraRecipes2 & 1) != 0; + } + + public Werkstoff.GenerationFeatures addMetaSolidifierRecipes() { + this.extraRecipes2 = (byte) (this.extraRecipes2 | 10); + return this; + } + + public boolean hasMetaSolidifierRecipes() { + return (this.extraRecipes2 & 10) != 0; + } + + public Werkstoff.GenerationFeatures addMultipleMetalSolidifierRecipes() { + this.extraRecipes2 = (byte) (this.extraRecipes2 | 100); + return this; + } + + public boolean hasMultipleMetalSolidifierRecipes() { + return (this.extraRecipes2 & 100) != 0; + } + public Werkstoff.GenerationFeatures addMixerRecipes() { this.extraRecipes = (byte) (this.extraRecipes | 10); return this; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java index 55bbb89e52..9abca71e18 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java @@ -162,32 +162,36 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { // molten -> metal if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { + + /* !! No more hardcoded gear, etc. recipe gen, now must go through GenerationFeatures() !! + GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Gear.get(0L), werkstoff.getMolten(576), werkstoff.get(gearGt), 128, 8); - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Gear_Small.get(0L), - werkstoff.getMolten(144), - werkstoff.get(gearGtSmall), - 16, - 8); - if (WerkstoffLoader.ringMold != null) - GT_Values.RA.addFluidSolidifierRecipe( - WerkstoffLoader.ringMold.get(0L), - werkstoff.getMolten(36), - werkstoff.get(ring), - 100, - 4 * tVoltageMultiplier); - if (WerkstoffLoader.boltMold != null) - GT_Values.RA.addFluidSolidifierRecipe( - WerkstoffLoader.boltMold.get(0L), - werkstoff.getMolten(18), - werkstoff.get(bolt), - 50, - 2 * tVoltageMultiplier); - - if (WerkstoffLoader.rotorMold != null) - GT_Values.RA.addFluidSolidifierRecipe( - WerkstoffLoader.rotorMold.get(0L), werkstoff.getMolten(612), werkstoff.get(rotor), 100, 60); + ItemList.Shape_Mold_Gear.get(0L), werkstoff.getMolten(576), werkstoff.get(gearGt), 128, 8); + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Gear_Small.get(0L), + werkstoff.getMolten(144), + werkstoff.get(gearGtSmall), + 16, + 8); + if (WerkstoffLoader.ringMold != null) + GT_Values.RA.addFluidSolidifierRecipe( + WerkstoffLoader.ringMold.get(0L), + werkstoff.getMolten(36), + werkstoff.get(ring), + 100, + 4 * tVoltageMultiplier); + if (WerkstoffLoader.boltMold != null) + GT_Values.RA.addFluidSolidifierRecipe( + WerkstoffLoader.boltMold.get(0L), + werkstoff.getMolten(18), + werkstoff.get(bolt), + 50, + 2 * tVoltageMultiplier); + + if (WerkstoffLoader.rotorMold != null) + GT_Values.RA.addFluidSolidifierRecipe( + WerkstoffLoader.rotorMold.get(0L), werkstoff.getMolten(612), werkstoff.get(rotor), 100, 60); + */ } GT_Values.RA.addPulveriserRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java index 153f131383..a54f15fcd3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -131,6 +131,86 @@ public class MoltenCellLoader implements IWerkstoffRunnable { werkstoff.getStats().getMass() > 128 ? 64 : 30); } + if (werkstoff.getGenerationFeatures().hasMetalCraftingSolidifierRecipes()) { + + if (!werkstoff.hasItemType(plate)) return; + + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Rod_Long.get(0), + werkstoff.getMolten(144), + werkstoff.get(stickLong), + (int) Math.max(werkstoff.getStats().getMass(), 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Rod.get(0), + werkstoff.getMolten(72), + werkstoff.get(stick), + (int) Math.max(werkstoff.getStats().getMass() / 2, 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Plate.get(0), + werkstoff.getMolten(144), + werkstoff.get(plate), + (int) Math.max(werkstoff.getStats().getMass(), 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + } + + if (werkstoff.getGenerationFeatures().hasMetaSolidifierRecipes()) { + if (!werkstoff.hasItemType(screw)) return; + + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Screw.get(0), + werkstoff.getMolten(18), + werkstoff.get(screw), + (int) Math.max(werkstoff.getStats().getMass() / 8, 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Gear.get(0), + werkstoff.getMolten(576), + werkstoff.get(gearGt), + (int) Math.max(werkstoff.getStats().getMass() / 4, 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Gear_Small.get(0), + werkstoff.getMolten(144), + werkstoff.get(gearGtSmall), + (int) Math.max(werkstoff.getStats().getMass(), 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Bolt.get(0), + werkstoff.getMolten(18), + werkstoff.get(bolt), + (int) Math.max(werkstoff.getStats().getMass() / 8, 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Ring.get(0), + werkstoff.getMolten(36), + werkstoff.get(ring), + (int) Math.max(werkstoff.getStats().getMass() / 4, 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + + // No Spring Molds + + if (WerkstoffLoader.rotorMold == null) return; + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Rotor.get(0), + werkstoff.getMolten(612), + werkstoff.get(rotor), + (int) Math.max(werkstoff.getStats().getMass() * 4.25, 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + } + + if (werkstoff.getGenerationFeatures().hasMultipleMetalSolidifierRecipes()) { + if (!werkstoff.hasItemType(plateDouble)) return; + // No multiple plate molds + } + // Tank "Recipe" final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData( new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), -- cgit From 973c7c450512224722cebbd62c817bfb96bc3784 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Mon, 31 Oct 2022 17:09:23 +0100 Subject: EIG: Fix stocking input bus exploit (#230) * Disgusting * Fix exploit * Maybe fix black wheat blocks inside * Ok we will fight then * Cosmetics * Proper fix Former-commit-id: 75e23bbf8e9abce88b1a4108a9dc1aa85a6f2ff6 --- .../bartworks/client/renderer/BW_CropVisualizer.java | 17 ++++++++++++++--- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 17 +++++++++-------- .../common/tileentities/multis/GT_TileEntity_HTGR.java | 2 ++ 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java index c1880bfca0..7fb7c82463 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java @@ -2,6 +2,7 @@ package com.github.bartimaeusnek.bartworks.client.renderer; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import java.lang.reflect.Field; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; @@ -12,6 +13,7 @@ import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class BW_CropVisualizer extends EntityFX { int meta; + Field tessellatorHasBrightnessField = null; public BW_CropVisualizer(World world, int x, int y, int z, int meta, int age) { super(world, (double) x, ((double) y - 0.0625d), (double) z); @@ -39,10 +41,19 @@ public class BW_CropVisualizer extends EntityFX { Tessellator tessellator = Tessellator.instance; GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDepthMask(false); + double f11 = this.prevPosX + (this.posX - this.prevPosX) * (double) p_70539_2_ - interpPosX; + double f12 = this.prevPosY + (this.posY - this.prevPosY) * (double) p_70539_2_ - interpPosY; + double f13 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double) p_70539_2_ - interpPosZ; + try { + if (tessellatorHasBrightnessField == null) { + tessellatorHasBrightnessField = Tessellator.class.getDeclaredField("hasBrightness"); + tessellatorHasBrightnessField.setAccessible(true); + } + tessellatorHasBrightnessField.set(tessellator, false); + } catch (NoSuchFieldException | IllegalAccessException e) { + throw new RuntimeException(e); + } tessellator.setColorRGBA(255, 255, 255, 255); - float f11 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) p_70539_2_ - interpPosX); - float f12 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) p_70539_2_ - interpPosY); - float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) p_70539_2_ - interpPosZ); RenderBlocks.getInstance().renderBlockCropsImpl(Blocks.wheat, meta, f11, f12, f13); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDepthMask(true); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index f5eb642046..7ab04ae24b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -19,6 +19,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_VIA_BARTWORKS; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_Values.AuthorKuba; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; @@ -205,6 +206,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Crop Farm") .addInfo("Controller block for the Extreme Industrial Greenhouse") + .addInfo(AuthorKuba) .addInfo("Grow your crops like a chad !") .addInfo("Use screwdriver to enable/change/disable setup mode") .addInfo("Use screwdriver while sneaking to enable/disable IC2 mode") @@ -563,14 +565,12 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse public boolean addCrop(ItemStack input) { if (!isIC2Mode) for (GreenHouseSlot g : mStorage) - if (GT_Utility.areStacksEqual(g.input, input)) { + if (g.input.stackSize < 64 && GT_Utility.areStacksEqual(g.input, input)) { g.addAll(this.getBaseMetaTileEntity().getWorld(), input); if (input.stackSize == 0) return true; } - GreenHouseSlot h = new GreenHouseSlot(this, input.copy(), true, isIC2Mode); + GreenHouseSlot h = new GreenHouseSlot(this, input, true, isIC2Mode); if (h.isValid) { - if (isIC2Mode) input.stackSize--; - else input.stackSize = 0; mStorage.add(h); return true; } @@ -724,7 +724,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse if (i == Items.reeds) b = Blocks.reeds; else { b = Block.getBlockFromItem(i); - if (!(b == Blocks.cactus)) return; + if (b != Blocks.cactus) return; } needsreplanting = false; } @@ -746,7 +746,9 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse crop = b; isIC2Crop = false; - if (addDrops(world, input.stackSize, autocraft) == 0 && !drops.isEmpty()) { + int toUse = Math.min(64, input.stackSize); + if (addDrops(world, toUse, autocraft) == 0 && !drops.isEmpty()) { + input.stackSize -= toUse; this.isValid = true; } } @@ -840,8 +842,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse int dur = cc.growthDuration(te); int rate = te.calcGrowthRate(); - if (rate == 0) // should not be possible with those stats - return; + if (rate == 0) return; // should not be possible with those stats growthticks = dur / rate; if (growthticks < 1) growthticks = 1; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 2442089032..9c0fdecd74 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -19,6 +19,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_VIA_BARTWORKS; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_Values.AuthorKuba; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; @@ -285,6 +286,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Breeder Reactor") .addInfo("Controller block for the High Temperature Gas-cooled Reactor (HTGR)") + .addInfo(AuthorKuba) .addInfo("You can clear internal buffer by changing the mode with a screwdriver") .addInfo("Needs a constant supply of coolant while running") .addInfo("Needs at least 72k Fuel pebbles to start operation (can hold up to 720k pebbles)") -- cgit From fa0fec058c3ad09b188d9c0b24a5b93ff8e0a696 Mon Sep 17 00:00:00 2001 From: Maxim Date: Thu, 3 Nov 2022 22:13:48 +0100 Subject: High tier cable diodes (#231) Former-commit-id: 35907ef7039f9fa03e0ef0a8e2b328ec321bfbe8 --- .../com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index f6bef99113..d2ba8f2d59 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -637,7 +637,7 @@ public class RecipeLoader { ItemList.Machine_LV_ChemicalReactor.get(1L), }); - for (int i = 0; i < GT_Values.VN.length - 1; i++) { + for (int i = 0; i < 9; i++) { try { Materials cable = cables[i]; ItemStack hull = hulls[i] instanceof Materials -- cgit From ea3c57b36173c9c92d3096cdae1dcc8f1b564a4c Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Fri, 4 Nov 2022 22:17:26 +0100 Subject: Update build.gradle Former-commit-id: dfb11ce2a48f8be60f4183a0d960e743638ad9f5 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index bc7fcfd33f..030dc18539 100644 --- a/build.gradle +++ b/build.gradle @@ -45,7 +45,7 @@ buildscript { } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:1.2.9' + classpath 'net.minecraftforge.gradle:ForgeGradle:1.2.11' } } plugins { -- cgit From 70c04f045086fb7c91ed7087681d4f3223201094 Mon Sep 17 00:00:00 2001 From: xSkewer <43712386+xSkewer@users.noreply.github.com> Date: Sat, 5 Nov 2022 14:11:06 -0400 Subject: No Humidity Mode for the EIG (#233) * Add 0 humidity mode to the EIG * Readd imports that got removed for some reason * Remove static and add scanner info * Fix NBT saving * Add import that got lost for some reason * Add tooltip and change scanner display to only IC2 mode * Import got lost again Former-commit-id: 3eb612279d4575dde0ff348c4c4a62e88b929247 --- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 35 ++++++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index 7ab04ae24b..77260c4dad 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -84,6 +84,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse private boolean isIC2Mode = false; private byte glasTier = 0; private int waterusage = 0; + private boolean isNoHumidity = false; private static final int CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; private static final Item forestryfertilizer = GameRegistry.findItem("Forestry", "fertilizerCompound"); @@ -182,6 +183,14 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse } } + @Override + public boolean onWireCutterRightClick( + byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + isNoHumidity = !isNoHumidity; + GT_Utility.sendChatToPlayer(aPlayer, "Give incoming crops no humidity " + isNoHumidity); + return true; + } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new GT_TileEntity_ExtremeIndustrialGreenhouse(this.mName); @@ -210,6 +219,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse .addInfo("Grow your crops like a chad !") .addInfo("Use screwdriver to enable/change/disable setup mode") .addInfo("Use screwdriver while sneaking to enable/disable IC2 mode") + .addInfo("Use wire cutters to give incoming IC2 crops 0 humidity") .addInfo("Uses 1000L of water per crop per operation") .addInfo("You can insert fertilizer each operation to get more drops (max +400%)") .addInfo("-------------------- SETUP MODE --------------------") @@ -269,6 +279,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse aNBT.setByte("glasTier", glasTier); aNBT.setInteger("setupphase", setupphase); aNBT.setBoolean("isIC2Mode", isIC2Mode); + aNBT.setBoolean("isNoHumidity", isNoHumidity); aNBT.setInteger("mStorageSize", mStorage.size()); for (int i = 0; i < mStorage.size(); i++) aNBT.setTag("mStorage." + i, mStorage.get(i).toNBTTagCompound()); @@ -280,6 +291,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse glasTier = aNBT.getByte("glasTier"); setupphase = aNBT.getInteger("setupphase"); isIC2Mode = aNBT.getBoolean("isIC2Mode"); + isNoHumidity = aNBT.getBoolean("isNoHumidity"); for (int i = 0; i < aNBT.getInteger("mStorageSize"); i++) mStorage.add(new GreenHouseSlot(aNBT.getCompoundTag("mStorage." + i))); } @@ -507,7 +519,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse "Slot " + i + ": " + EnumChatFormatting.GREEN + "x" + this.mStorage.get(i).input.stackSize + " " + this.mStorage.get(i).input.getDisplayName()); if (this.isIC2Mode) { - a.append(" : "); + a.append(" | Humidity: " + (this.mStorage.get(i).noHumidity ? 0 : 12) + " : "); for (Map.Entry entry : mStorage.get(i).dropprogress.entrySet()) a.append((int) (entry.getValue() * 100d)).append("% "); @@ -569,7 +581,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse g.addAll(this.getBaseMetaTileEntity().getWorld(), input); if (input.stackSize == 0) return true; } - GreenHouseSlot h = new GreenHouseSlot(this, input, true, isIC2Mode); + GreenHouseSlot h = new GreenHouseSlot(this, input, true, isIC2Mode, isNoHumidity); if (h.isValid) { mStorage.add(h); return true; @@ -585,6 +597,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse List drops; boolean isValid; boolean isIC2Crop; + boolean noHumidity; int growthticks; List> generations; @@ -622,6 +635,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse generations.get(i).get(j).writeToNBT(new NBTTagCompound())); } aNBT.setInteger("growthticks", growthticks); + aNBT.setBoolean("noHumidity", noHumidity); } return aNBT; } @@ -651,6 +665,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse .add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("generation." + i + "." + j))); } growthticks = aNBT.getInteger("growthticks"); + noHumidity = aNBT.getBoolean("noHumidity"); rn = new Random(); } } @@ -706,13 +721,18 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse } public GreenHouseSlot( - GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, ItemStack input, boolean autocraft, boolean IC2) { + GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, + ItemStack input, + boolean autocraft, + boolean IC2, + boolean noHumidity) { super(null, 3, 3); World world = tileEntity.getBaseMetaTileEntity().getWorld(); this.input = input.copy(); this.isValid = false; + this.noHumidity = noHumidity; if (IC2) { - GreenHouseSlotIC2(tileEntity, world, input); + GreenHouseSlotIC2(tileEntity, world, input, noHumidity); return; } Item i = input.getItem(); @@ -754,7 +774,10 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse } public void GreenHouseSlotIC2( - GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, World world, ItemStack input) { + GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, + World world, + ItemStack input, + boolean noHumidity) { if (!ItemList.IC2_Crop_Seeds.isStackEqual(input, true, true)) return; CropCard cc = Crops.instance.getCropCard(input); this.input.stackSize = 1; @@ -836,7 +859,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse rn = new Random(); // CHECK GROWTH SPEED - te.humidity = 12; // humidity with full water storage + te.humidity = (byte) (noHumidity ? 0 : 12); // humidity with full water storage or 0 humidity te.airQuality = 6; // air quality when sky is seen te.nutrients = 8; // netrients with full nutrient storage -- cgit From 8541341a5903ef4ca9d757a7fe5c4ced42693268 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Wed, 9 Nov 2022 21:49:48 +0100 Subject: EIG: Bug fixes (including small IC2 mode nerf) (#232) * Yes yes yes, obfuscation * Fix GT Ores not working as a roots in IC2 mode * ' * BEANS * Get rid of some warnings in code inspection * Fix wrong IC2 crop calculation (EIG NERF) * Use constants * Autocraft is always enabled * Recalculate all crops on math updates * Fix dupe * Remove Mana Bean support Former-commit-id: 8b7ab9f4385ead75e69b86952279afeb21a860eb --- .../client/renderer/BW_CropVisualizer.java | 8 +- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 396 +++++++++++++-------- 2 files changed, 244 insertions(+), 160 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java index 7fb7c82463..ed710e18de 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java @@ -7,13 +7,14 @@ import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.init.Blocks; +import net.minecraft.launchwrapper.Launch; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class BW_CropVisualizer extends EntityFX { int meta; - Field tessellatorHasBrightnessField = null; + static Field tessellatorHasBrightnessField = null; public BW_CropVisualizer(World world, int x, int y, int z, int meta, int age) { super(world, (double) x, ((double) y - 0.0625d), (double) z); @@ -46,7 +47,10 @@ public class BW_CropVisualizer extends EntityFX { double f13 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double) p_70539_2_ - interpPosZ; try { if (tessellatorHasBrightnessField == null) { - tessellatorHasBrightnessField = Tessellator.class.getDeclaredField("hasBrightness"); + tessellatorHasBrightnessField = Tessellator.class.getDeclaredField( + (boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment") + ? "hasBrightness" + : "field_78414_p"); tessellatorHasBrightnessField.setAccessible(true); } tessellatorHasBrightnessField.set(tessellator, false); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index 77260c4dad..71077a3a31 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -46,6 +46,9 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; import gregtech.common.GT_DummyWorld; +import gregtech.common.blocks.GT_Block_Ores_Abstract; +import gregtech.common.blocks.GT_Item_Ores; +import gregtech.common.blocks.GT_TileEntity_Ores; import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_OutputBus_ME; import ic2.api.crops.CropCard; import ic2.api.crops.Crops; @@ -59,10 +62,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.Item; -import net.minecraft.item.ItemSeedFood; -import net.minecraft.item.ItemSeeds; -import net.minecraft.item.ItemStack; +import net.minecraft.item.*; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.nbt.NBTTagCompound; @@ -77,7 +77,9 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity_EnhancedMultiBlockBase { private static final boolean debug = false; + private static final int EIG_MATH_VERSION = 0; + private int oldVersion = 0; private int mCasing = 0; private int mMaxSlots = 0; private int setupphase = 1; @@ -255,7 +257,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse .addOtherStructurePart("Borosilicate Glass", "Hollow two middle layers") .addStructureInfo("The glass tier limits the Energy Input tier") .addStructureInfo("The dirt is from RandomThings, must be tilled") - .addStructureInfo("Purple lamps are from ProjectRedIllumination. They can be lit") + .addStructureInfo("Purple lamps are from ProjectRedIllumination. They can be powered and/or inverted") .addMaintenanceHatch("Any casing (Except inner bottom ones)", 1) .addInputBus("Any casing (Except inner bottom ones)", 1) .addOutputBus("Any casing (Except inner bottom ones)", 1) @@ -269,13 +271,14 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse public String[] getStructureDescription(ItemStack stackSize) { List info = new ArrayList<>(Arrays.asList(super.getStructureDescription(stackSize))); info.add("The dirt is from RandomThings, must be tilled"); - info.add("Purple lamps are from ProjectRedIllumination. They can be lit"); + info.add("Purple lamps are from ProjectRedIllumination. They can be powered and/or inverted"); return info.toArray(new String[] {}); } @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); + aNBT.setInteger("EIG_MATH_VERSION", EIG_MATH_VERSION); aNBT.setByte("glasTier", glasTier); aNBT.setInteger("setupphase", setupphase); aNBT.setBoolean("isIC2Mode", isIC2Mode); @@ -288,6 +291,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); + oldVersion = aNBT.hasKey("EIG_MATH_VERSION") ? aNBT.getInteger("EIG_MATH_VERSION") : -1; glasTier = aNBT.getByte("glasTier"); setupphase = aNBT.getInteger("setupphase"); isIC2Mode = aNBT.getBoolean("isIC2Mode"); @@ -351,6 +355,13 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse long v = this.getMaxInputVoltage(); int tier = GT_Utility.getTier(v); updateMaxSlots(); + + if (oldVersion != EIG_MATH_VERSION) { + for (GreenHouseSlot slot : mStorage) + slot.recalculate(this, getBaseMetaTileEntity().getWorld()); + oldVersion = EIG_MATH_VERSION; + } + if (setupphase > 0) { if ((mStorage.size() >= mMaxSlots && setupphase == 1) || (mStorage.size() == 0 && setupphase == 2)) return false; @@ -420,8 +431,9 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse } // OVERCLOCK - // FERTILIZER IDEA - IC2 +10% per fertilizer per crop per operation, NORMAL +200% per fertilizer per crop per - // operation + // FERTILIZER IDEA: + // IC2 +10% per fertilizer per crop per operation + // NORMAL +200% per fertilizer per crop per operation int boost = 0; int maxboost = 0; @@ -446,7 +458,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse this.mMaxProgresstime = 100; List outputs = new ArrayList<>(); for (int i = 0; i < Math.min(mMaxSlots, mStorage.size()); i++) - outputs.addAll(mStorage.get(i).getIC2Drops(((double) this.mMaxProgresstime / 8d) * multiplier)); + outputs.addAll(mStorage.get(i).getIC2Drops(((double) this.mMaxProgresstime * 32d) * multiplier)); this.mOutputItems = outputs.toArray(new ItemStack[0]); } else { this.mMaxProgresstime = Math.max(20, 100 / (tier - 3)); // Min 1 s @@ -572,7 +584,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } - public List mStorage = new ArrayList<>(); + public final List mStorage = new ArrayList<>(); public boolean addCrop(ItemStack input) { if (!isIC2Mode) @@ -581,7 +593,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse g.addAll(this.getBaseMetaTileEntity().getWorld(), input); if (input.stackSize == 0) return true; } - GreenHouseSlot h = new GreenHouseSlot(this, input, true, isIC2Mode, isNoHumidity); + GreenHouseSlot h = new GreenHouseSlot(this, input, isIC2Mode, isNoHumidity); if (h.isValid) { mStorage.add(h); return true; @@ -591,8 +603,9 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse private static class GreenHouseSlot extends InventoryCrafting { - ItemStack input; + final ItemStack input; Block crop; + ArrayList customDrops = null; ItemStack undercrop = null; List drops; boolean isValid; @@ -609,7 +622,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse boolean needsreplanting = true; - static GreenHouseWorld fakeworld = new GreenHouseWorld(5, 5, 5); + static final GreenHouseWorld fakeworld = new GreenHouseWorld(5, 5, 5); public NBTTagCompound toNBTTagCompound() { NBTTagCompound aNBT = new NBTTagCompound(); @@ -618,6 +631,11 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse aNBT.setBoolean("isIC2Crop", isIC2Crop); if (!isIC2Crop) { aNBT.setInteger("crop", Block.getIdFromBlock(crop)); + if (customDrops != null && customDrops.size() > 0) { + aNBT.setInteger("customDropsCount", customDrops.size()); + for (int i = 0; i < customDrops.size(); i++) + aNBT.setTag("customDrop." + i, customDrops.get(i).writeToNBT(new NBTTagCompound())); + } aNBT.setInteger("dropscount", drops.size()); for (int i = 0; i < drops.size(); i++) aNBT.setTag("drop." + i, drops.get(i).writeToNBT(new NBTTagCompound())); @@ -647,6 +665,12 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse input = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("input")); if (!isIC2Crop) { crop = Block.getBlockById(aNBT.getInteger("crop")); + if (aNBT.hasKey("customDropsCount")) { + int imax = aNBT.getInteger("customDropsCount"); + customDrops = new ArrayList<>(imax); + for (int i = 0; i < imax; i++) + customDrops.add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("customDrop." + i))); + } drops = new ArrayList<>(); for (int i = 0; i < aNBT.getInteger("dropscount"); i++) drops.add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("drop." + i))); @@ -674,7 +698,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse if (!GT_Utility.areStacksEqual(this.input, input)) return false; if (this.input.stackSize == 64) return false; int toconsume = Math.min(64 - this.input.stackSize, input.stackSize); - int left = addDrops(world, toconsume, true); + int left = addDrops(world, toconsume); input.stackSize -= toconsume - left; this.input.stackSize += toconsume - left; return left == 0; @@ -715,15 +739,13 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse return null; } + @SuppressWarnings("EmptyMethod") @Override - public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { - return; - } + public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {} public GreenHouseSlot( GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, ItemStack input, - boolean autocraft, boolean IC2, boolean noHumidity) { super(null, 3, 3); @@ -737,38 +759,42 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse } Item i = input.getItem(); Block b = null; - if (i instanceof IPlantable) { - if (i instanceof ItemSeeds) b = ((ItemSeeds) i).getPlant(world, 0, 0, 0); - else if (i instanceof ItemSeedFood) b = ((ItemSeedFood) i).getPlant(world, 0, 0, 0); - } else { - if (i == Items.reeds) b = Blocks.reeds; - else { - b = Block.getBlockFromItem(i); - if (b != Blocks.cactus) return; + boolean detectedCustomHandler = false; + // There will be custom handlers here some day + if (!detectedCustomHandler) { + if (i instanceof IPlantable) { + if (i instanceof ItemSeeds) b = ((ItemSeeds) i).getPlant(world, 0, 0, 0); + else if (i instanceof ItemSeedFood) b = ((ItemSeedFood) i).getPlant(world, 0, 0, 0); + } else { + if (i == Items.reeds) b = Blocks.reeds; + else { + b = Block.getBlockFromItem(i); + if (b != Blocks.cactus) return; + } + needsreplanting = false; } - needsreplanting = false; - } - if (!(b instanceof IPlantable)) return; - GameRegistry.UniqueIdentifier u = GameRegistry.findUniqueIdentifierFor(i); - if (u != null && Objects.equals(u.modId, "Natura")) optimalgrowth = 8; - - if (b instanceof BlockStem) { - fakeworld.block = null; - try { - b.updateTick(fakeworld, 5, 5, 5, fakeworld.rand); - } catch (Exception e) { - e.printStackTrace(System.err); + if (!(b instanceof IPlantable)) return; + GameRegistry.UniqueIdentifier u = GameRegistry.findUniqueIdentifierFor(i); + if (u != null && Objects.equals(u.modId, "Natura")) optimalgrowth = 8; + + if (b instanceof BlockStem) { + fakeworld.block = null; + try { + b.updateTick(fakeworld, 5, 5, 5, fakeworld.rand); + } catch (Exception e) { + e.printStackTrace(System.err); + } + if (fakeworld.block == null) return; + b = fakeworld.block; + needsreplanting = false; } - if (fakeworld.block == null) return; - b = fakeworld.block; - needsreplanting = false; } - crop = b; isIC2Crop = false; int toUse = Math.min(64, input.stackSize); - if (addDrops(world, toUse, autocraft) == 0 && !drops.isEmpty()) { + if (addDrops(world, toUse) == 0 && !drops.isEmpty()) { input.stackSize -= toUse; + this.input.stackSize = toUse; this.isValid = true; } } @@ -779,105 +805,139 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse ItemStack input, boolean noHumidity) { if (!ItemList.IC2_Crop_Seeds.isStackEqual(input, true, true)) return; - CropCard cc = Crops.instance.getCropCard(input); - this.input.stackSize = 1; - NBTTagCompound nbt = input.getTagCompound(); - byte gr = nbt.getByte("growth"); - byte ga = nbt.getByte("gain"); - byte re = nbt.getByte("resistance"); this.isIC2Crop = true; - int[] abc = new int[] {0, -2, 3}; - int[] xyz = new int[] {0, 0, 0}; - tileEntity.getExtendedFacing().getWorldOffset(abc, xyz); - xyz[0] += tileEntity.getBaseMetaTileEntity().getXCoord(); - xyz[1] += tileEntity.getBaseMetaTileEntity().getYCoord(); - xyz[2] += tileEntity.getBaseMetaTileEntity().getZCoord(); - boolean cheating = false; - try { - if (world.getBlock(xyz[0], xyz[1] - 2, xyz[2]) != GregTech_API.sBlockCasings4 - || world.getBlockMetadata(xyz[0], xyz[1] - 2, xyz[2]) != 1) { - // no - cheating = true; - return; - } - - world.setBlock(xyz[0], xyz[1], xyz[2], Block.getBlockFromItem(Ic2Items.crop.getItem()), 0, 0); - TileEntity wte = world.getTileEntity(xyz[0], xyz[1], xyz[2]); - if (!(wte instanceof TileEntityCrop)) { - // should not be even possible - return; - } - TileEntityCrop te = (TileEntityCrop) wte; - te.ticker = 1; // dont even think about ticking once - te.setCrop(cc); - - te.setGrowth(gr); - te.setGain(ga); - te.setResistance(re); - - ItemStack tobeused = null; - - te.setSize((byte) (cc.maxSize() - 1)); - if (!cc.canGrow(te)) { - // needs special block - - boolean cangrow = false; - ArrayList inputs = tileEntity.getStoredInputs(); - for (ItemStack a : inputs) { - if (a.stackSize <= 0) continue; - Block b = Block.getBlockFromItem(a.getItem()); - if (b == Blocks.air) continue; - world.setBlock(xyz[0], xyz[1] - 2, xyz[2], b, a.getItemDamage(), 0); - if (!cc.canGrow(te)) continue; - cangrow = true; - undercrop = a.copy(); - undercrop.stackSize = 1; - tobeused = a; - break; - } + recalculate(tileEntity, world); + if (this.isValid) input.stackSize--; + } - if (!cangrow) return; + private boolean setBlock(ItemStack a, int x, int y, int z, World world) { + Item item = a.getItem(); + Block b = Block.getBlockFromItem(item); + if (b == Blocks.air || !(item instanceof ItemBlock)) return false; + short tDamage = (short) item.getDamage(a); + if (item instanceof GT_Item_Ores && tDamage > 0) { + if (!world.setBlock( + x, + y, + z, + b, + GT_TileEntity_Ores.getHarvestData( + tDamage, ((GT_Block_Ores_Abstract) b).getBaseBlockHarvestLevel(tDamage % 16000 / 1000)), + 0)) { + return false; } + GT_TileEntity_Ores tTileEntity = (GT_TileEntity_Ores) world.getTileEntity(x, y, z); + tTileEntity.mMetaData = tDamage; + tTileEntity.mNatural = false; + } else world.setBlock(x, y, z, b, tDamage, 0); + return true; + } - te.setSize((byte) cc.maxSize()); + public void recalculate(GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, World world) { + if (isIC2Crop) { + CropCard cc = Crops.instance.getCropCard(input); + this.input.stackSize = 1; + NBTTagCompound nbt = input.getTagCompound(); + byte gr = nbt.getByte("growth"); + byte ga = nbt.getByte("gain"); + byte re = nbt.getByte("resistance"); + int[] abc = new int[] {0, -2, 3}; + int[] xyz = new int[] {0, 0, 0}; + tileEntity.getExtendedFacing().getWorldOffset(abc, xyz); + xyz[0] += tileEntity.getBaseMetaTileEntity().getXCoord(); + xyz[1] += tileEntity.getBaseMetaTileEntity().getYCoord(); + xyz[2] += tileEntity.getBaseMetaTileEntity().getZCoord(); + boolean cheating = false; + try { + if (world.getBlock(xyz[0], xyz[1] - 2, xyz[2]) != GregTech_API.sBlockCasings4 + || world.getBlockMetadata(xyz[0], xyz[1] - 2, xyz[2]) != 1) { + // no + cheating = true; + return; + } - if (!cc.canBeHarvested(te)) return; + world.setBlock(xyz[0], xyz[1], xyz[2], Block.getBlockFromItem(Ic2Items.crop.getItem()), 0, 0); + TileEntity wte = world.getTileEntity(xyz[0], xyz[1], xyz[2]); + if (!(wte instanceof TileEntityCrop)) { + // should not be even possible + return; + } + TileEntityCrop te = (TileEntityCrop) wte; + te.ticker = 1; // don't even think about ticking once + te.setCrop(cc); + + te.setGrowth(gr); + te.setGain(ga); + te.setResistance(re); + + ItemStack tobeused = null; + + if (undercrop != null) setBlock(undercrop, xyz[0], xyz[1] - 2, xyz[2], world); + else { + te.setSize((byte) (cc.maxSize() - 1)); + if (!cc.canGrow(te)) { + // needs special block + + boolean cangrow = false; + ArrayList inputs = tileEntity.getStoredInputs(); + for (ItemStack a : inputs) { + if (a.stackSize <= 0) continue; + if (!setBlock(a, xyz[0], xyz[1] - 2, xyz[2], world)) continue; + if (!cc.canGrow(te)) continue; + cangrow = true; + undercrop = a.copy(); + undercrop.stackSize = 1; + tobeused = a; + break; + } + + if (!cangrow) return; + } + } - // GENERATE DROPS - generations = new ArrayList<>(); - out: - for (int i = 0; i < 10; i++) // get 10 generations - { - ItemStack[] st = te.harvest_automated(false); te.setSize((byte) cc.maxSize()); - if (st == null) continue; - if (st.length == 0) continue; - for (ItemStack s : st) if (s == null) continue out; - generations.add(new ArrayList<>(Arrays.asList(st))); - } - if (generations.isEmpty()) return; - rn = new Random(); - // CHECK GROWTH SPEED - te.humidity = (byte) (noHumidity ? 0 : 12); // humidity with full water storage or 0 humidity - te.airQuality = 6; // air quality when sky is seen - te.nutrients = 8; // netrients with full nutrient storage + if (!cc.canBeHarvested(te)) return; + + // GENERATE DROPS + generations = new ArrayList<>(); + out: + for (int i = 0; i < 10; i++) // get 10 generations + { + ItemStack[] st = te.harvest_automated(false); + te.setSize((byte) cc.maxSize()); + if (st == null) continue; + if (st.length == 0) continue; + for (ItemStack s : st) if (s == null) continue out; + generations.add(new ArrayList<>(Arrays.asList(st))); + } + if (generations.isEmpty()) return; + rn = new Random(); - int dur = cc.growthDuration(te); - int rate = te.calcGrowthRate(); - if (rate == 0) return; // should not be possible with those stats - growthticks = dur / rate; - if (growthticks < 1) growthticks = 1; + // CHECK GROWTH SPEED + te.humidity = (byte) (noHumidity ? 0 : 12); // humidity with full water storage or 0 humidity + te.airQuality = 6; // air quality when sky is seen + te.nutrients = 8; // nutrients with full nutrient storage - input.stackSize--; - if (tobeused != null) tobeused.stackSize--; + int dur = cc.growthDuration(te); + int rate = te.calcGrowthRate(); + if (rate == 0) return; // should not be possible with those stats + growthticks = (int) Math.ceil( + ((double) dur / (double) rate) * (double) cc.maxSize() * (double) TileEntityCrop.tickRate); + if (growthticks < 1) growthticks = 1; - this.isValid = true; - } catch (Exception e) { - e.printStackTrace(System.err); - } finally { - if (!cheating) world.setBlock(xyz[0], xyz[1] - 2, xyz[2], GregTech_API.sBlockCasings4, 1, 0); - world.setBlockToAir(xyz[0], xyz[1], xyz[2]); + if (tobeused != null) tobeused.stackSize--; + + this.isValid = true; + } catch (Exception e) { + e.printStackTrace(System.err); + } finally { + if (!cheating) world.setBlock(xyz[0], xyz[1] - 2, xyz[2], GregTech_API.sBlockCasings4, 1, 0); + world.setBlockToAir(xyz[0], xyz[1], xyz[2]); + } + } else { + drops = new ArrayList<>(); + addDrops(world, input.stackSize); } } @@ -885,8 +945,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse return drops; } - Map dropprogress = new HashMap<>(); - static Map dropstacks = new HashMap<>(); + final Map dropprogress = new HashMap<>(); + static final Map dropstacks = new HashMap<>(); public List getIC2Drops(double timeelapsed) { int r = rn.nextInt(10); @@ -913,17 +973,39 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse return copied; } - public int addDrops(World world, int count, boolean autocraft) { - drops = new ArrayList<>(); - for (int i = 0; i < count; i++) { - List d = crop.getDrops(world, 0, 0, 0, optimalgrowth, 0); - for (ItemStack x : drops) - for (ItemStack y : d) + public int addDrops(World world, int count) { + if (drops == null) drops = new ArrayList<>(); + if (customDrops != null && customDrops.size() > 0) { + @SuppressWarnings("unchecked") + ArrayList d = (ArrayList) customDrops.clone(); + for (ItemStack x : drops) { + for (Iterator iterator = d.iterator(); iterator.hasNext(); ) { + ItemStack y = iterator.next(); if (GT_Utility.areStacksEqual(x, y)) { - x.stackSize += y.stackSize; - y.stackSize = 0; + x.stackSize += y.stackSize * count; + iterator.remove(); } - for (ItemStack x : d) if (x.stackSize > 0) drops.add(x.copy()); + } + } + final int finalCount = count; + d.forEach(stack -> { + ItemStack i = stack.copy(); + i.stackSize *= finalCount; + drops.add(i); + }); + return 0; + } else { + if (crop == null) return count; + for (int i = 0; i < count; i++) { + List d = crop.getDrops(world, 0, 0, 0, optimalgrowth, 0); + for (ItemStack x : drops) + for (ItemStack y : d) + if (GT_Utility.areStacksEqual(x, y)) { + x.stackSize += y.stackSize; + y.stackSize = 0; + } + for (ItemStack x : d) if (x.stackSize > 0) drops.add(x.copy()); + } } if (!needsreplanting) return 0; for (int i = 0; i < drops.size(); i++) { @@ -940,21 +1022,19 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse } } } - if (autocraft) { - if (!findCropRecipe(world)) return count; - int totake = count / recipe.getCraftingResult(this).stackSize + 1; - for (int i = 0; i < drops.size(); i++) { - if (GT_Utility.areStacksEqual(drops.get(i), recipeInput)) { - int took = Math.min(drops.get(i).stackSize, totake); - drops.get(i).stackSize -= took; - totake -= took; - if (drops.get(i).stackSize == 0) { - drops.remove(i); - i--; - } - if (totake == 0) { - return 0; - } + if (!findCropRecipe(world)) return count; + int totake = count / recipe.getCraftingResult(this).stackSize + 1; + for (int i = 0; i < drops.size(); i++) { + if (GT_Utility.areStacksEqual(drops.get(i), recipeInput)) { + int took = Math.min(drops.get(i).stackSize, totake); + drops.get(i).stackSize -= took; + totake -= took; + if (drops.get(i).stackSize == 0) { + drops.remove(i); + i--; + } + if (totake == 0) { + return 0; } } } @@ -964,7 +1044,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse private static class GreenHouseWorld extends GT_DummyWorld { - public int x = 0, y = 0, z = 0, meta = 0; + public int x, y, z, meta = 0; public Block block; GreenHouseWorld(int x, int y, int z) { -- cgit From b4209dc1c8571eabf60d43525ac162c58bf6b177 Mon Sep 17 00:00:00 2001 From: miozune Date: Thu, 10 Nov 2022 05:50:53 +0900 Subject: Fix NPE causing LuVTierEnhancer failure (#234) Former-commit-id: 134f3ac6bae12f1593797f19fd2545fa8ab19655 --- .../bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java index 7cad4fd11a..91596427b6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -59,7 +59,6 @@ public class LuVTierEnhancer implements Runnable { static { addToBlackListForOsmiridiumReplacement(ItemList.Casing_MiningOsmiridium.get(1)); - addToBlackListForOsmiridiumReplacement(GT_OreDictUnificator.get(OrePrefixes.turbine, Materials.Osmiridium, 1)); addToBlackListForOsmiridiumReplacement(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( 170, 1, Materials.Osmiridium, Materials.Osmiridium, null)); addToBlackListForOsmiridiumReplacement(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( @@ -305,7 +304,7 @@ public class LuVTierEnhancer implements Runnable { } private static boolean isOutputBlackListed(ItemStack output) { - if (blackListForOsmiridium.stream().anyMatch(s -> s.isItemEqual(output))) return true; + if (blackListForOsmiridium.stream().anyMatch(s -> GT_Utility.areStacksEqual(s, output))) return true; return false; } -- cgit From dc436cf61864bc23ab6ebe662f6db3ffba8b21c7 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Tue, 15 Nov 2022 00:49:59 +0800 Subject: fix too much calcium (#236) Former-commit-id: 156dfa3ad12fd673984d219a30d7e29ac2fb45dc --- .../system/material/GT_Enhancement/PlatinumSludgeOverHaul.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 773c23812b..cb9084e608 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -532,7 +532,7 @@ public class PlatinumSludgeOverHaul { 300); GT_Values.RA.addChemicalRecipe( IridiumChloride.get(dust), - Materials.Calcium.getDust(3), + Materials.Calcium.getDust(1), null, CalciumChloride.getFluidOrGas(3000), PGSDResidue2.get(dust), -- cgit From a54d284d4536d9bbb6e6932ebbbc32781c53e375 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Mon, 14 Nov 2022 21:13:28 +0100 Subject: Structures fixes (#237) * Fix * Windmill Former-commit-id: 1b13177de01df5f05f0b87a2ada3da9ed4bf30c1 --- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 14 ++-- .../multis/GT_TileEntity_Windmill.java | 79 +++++++++++++++++++--- .../bartimaeusnek/bartworks/util/BW_Util.java | 40 +++++------ 3 files changed, 95 insertions(+), 38 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index e3ab8def8e..d3254fc894 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -27,6 +27,7 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTieredMixed import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.SoundResource.IC2_MACHINES_MAGNETIZER_LOOP; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; @@ -36,8 +37,8 @@ import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; -import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; @@ -56,7 +57,6 @@ import gregtech.api.util.GT_Utility; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; @@ -183,7 +183,7 @@ public class GT_TileEntity_CircuitAssemblyLine public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 20) { - GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(212), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(IC2_MACHINES_MAGNETIZER_LOOP, 10, 1.0F, aX, aY, aZ); } } @@ -425,17 +425,15 @@ public class GT_TileEntity_CircuitAssemblyLine } @Override - public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { + public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { if (mMachine) return -1; int built; - built = survivialBuildPiece( - STRUCTURE_PIECE_FIRST, stackSize, 0, 0, 0, elementBudget, source, actor, false, true); + built = survivialBuildPiece(STRUCTURE_PIECE_FIRST, stackSize, 0, 0, 0, elementBudget, env, false, true); if (built >= 0) return built; int tLength = Math.min(stackSize.stackSize + 1, 7); for (int i = 1; i < tLength; ++i) { - built = survivialBuildPiece( - STRUCTURE_PIECE_NEXT, stackSize, -i, 0, 0, elementBudget, source, actor, false, true); + built = survivialBuildPiece(STRUCTURE_PIECE_NEXT, stackSize, -i, 0, 0, elementBudget, env, false, true); if (built >= 0) return built; } return -1; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index fddf307ec1..83075e48e0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -29,14 +29,13 @@ import static gregtech.api.enums.GT_Values.V; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_Windmill; import com.github.bartimaeusnek.bartworks.common.items.BW_Stonage_Rotors; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; import com.github.bartimaeusnek.bartworks.server.container.BW_Container_Windmill; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; -import com.gtnewhorizon.structurelib.structure.IItemSource; -import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import com.gtnewhorizon.structurelib.structure.*; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -60,7 +59,6 @@ import java.util.List; import java.util.Set; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -69,6 +67,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable { @@ -115,10 +114,71 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock onElementPass(t -> t.mHardenedClay++, ofBlock(Blocks.hardened_clay, 0)), ofTileAdder( GT_TileEntity_Windmill::addDispenserToOutputSet, Blocks.hardened_clay, 0), - onElementPass(t -> t.mDoor++, ofBlock(Blocks.wooden_door, 0)))) + onElementPass( + t -> t.mDoor++, new IStructureElementNoPlacement() { + private final IStructureElement delegate = + ofBlock(Blocks.wooden_door, 0); + + @Override + public boolean check( + GT_TileEntity_Windmill gt_tileEntity_windmill, + World world, + int x, + int y, + int z) { + return delegate.check(gt_tileEntity_windmill, world, x, y, z); + } + + @Override + public boolean spawnHint( + GT_TileEntity_Windmill gt_tileEntity_windmill, + World world, + int x, + int y, + int z, + ItemStack trigger) { + return delegate.spawnHint( + gt_tileEntity_windmill, world, x, y, z, trigger); + } + }))) .addElement('b', ofBlock(Blocks.brick_block, 0)) - .addElement( - 's', ofTileAdder(GT_TileEntity_Windmill::setRotorBlock, StructureLibAPI.getBlockHint(), 0)) + .addElement('s', new IStructureElement() { + @Override + public boolean check(GT_TileEntity_Windmill t, World world, int x, int y, int z) { + TileEntity tileEntity = world.getTileEntity(x, y, z); + return t.setRotorBlock(tileEntity); + } + + @Override + public boolean spawnHint( + GT_TileEntity_Windmill t, World world, int x, int y, int z, ItemStack trigger) { + StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 0); + return true; + } + + @Override + public boolean placeBlock( + GT_TileEntity_Windmill gt_tileEntity_windmill, + World world, + int x, + int y, + int z, + ItemStack trigger) { + return false; + } + + @Override + public BlocksToPlace getBlocksToPlace( + GT_TileEntity_Windmill gt_tileEntity_windmill, + World world, + int x, + int y, + int z, + ItemStack trigger, + AutoPlaceEnvironment env) { + return BlocksToPlace.create(new ItemStack(ItemRegistry.ROTORBLOCK)); + } + }) .build(); @Override @@ -487,10 +547,9 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock } @Override - public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { + public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { if (mMachine) return -1; - return survivialBuildPiece( - STRUCTURE_PIECE_MAIN, stackSize, 3, 11, 0, elementBudget, source, actor, false, true); + return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 3, 11, 0, elementBudget, env, false, true); } public float OutputMultiplier(BW_RotorBlock rotorBlock) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 365c79d496..de6037095f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -28,9 +28,8 @@ import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.MainMod; import com.gtnewhorizon.structurelib.StructureLibAPI; -import com.gtnewhorizon.structurelib.structure.IItemSource; +import com.gtnewhorizon.structurelib.structure.AutoPlaceEnvironment; import com.gtnewhorizon.structurelib.structure.IStructureElement; -import com.gtnewhorizon.structurelib.structure.IStructureElementNoPlacement; import gregtech.api.enums.Materials; import gregtech.api.enums.OreDictNames; import gregtech.api.enums.ToolDictNames; @@ -46,7 +45,6 @@ import java.lang.reflect.Array; import java.lang.reflect.Field; import java.util.*; import java.util.function.BiConsumer; -import java.util.function.Consumer; import java.util.function.Function; import java.util.stream.Collectors; import javax.annotation.Nonnegative; @@ -54,7 +52,6 @@ import javax.annotation.Nonnull; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.enchantment.Enchantment; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.EnumRarity; @@ -62,7 +59,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; -import net.minecraft.util.IChatComponent; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -976,8 +972,7 @@ public class BW_Util { if (world.isAirBlock(x, y, z)) return false; byte glasstier = BW_Util.calculateGlassTier(world.getBlock(x, y, z), (byte) world.getBlockMetadata(x, y, z)); - if (glasstier == 0) // is not a glass ? - return false; + if (glasstier == 0) return false; // is not a glass ? if (glasstier == notset) return false; if (glasstier < mintier) return false; if (glasstier > maxtier) return false; @@ -998,29 +993,23 @@ public class BW_Util { @Override public PlaceResult survivalPlaceBlock( - T t, - World world, - int x, - int y, - int z, - ItemStack trigger, - IItemSource s, - EntityPlayerMP actor, - Consumer chatter) { - return placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, s, actor, chatter); + T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { + return placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, env); } }; } public static IStructureElement ofGlassTieredMixed(byte mintier, byte maxtier, int aDots) { - return new IStructureElementNoPlacement() { + return new IStructureElement() { + private final IStructureElement placementDelegate = + BorosilicateGlass.ofBoroGlass((byte) 0, mintier, maxtier, (v1, v2) -> {}, (v1) -> (byte) 0); + @Override public boolean check(T te, World world, int x, int y, int z) { if (world.isAirBlock(x, y, z)) return false; byte glasstier = BW_Util.calculateGlassTier(world.getBlock(x, y, z), (byte) world.getBlockMetadata(x, y, z)); - if (glasstier == 0) // is not a glass ? - return false; + if (glasstier == 0) return false; // is not a glass ? return glasstier >= mintier && glasstier <= maxtier; } @@ -1029,6 +1018,17 @@ public class BW_Util { StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), aDots - 1); return true; } + + @Override + public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { + return placementDelegate.placeBlock(t, world, x, y, z, trigger); + } + + @Override + public PlaceResult survivalPlaceBlock( + T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { + return placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, env); + } }; } -- cgit From cf7b6f2e63ca1f30a567ec4ec07f7a3d2b09013c Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Thu, 24 Nov 2022 21:44:23 +0100 Subject: Prevent player inventory corruption (#235) * Ugh * Merge same slots * Remove growth progress * Update GT_TileEntity_ExtremeIndustrialGreenhouse.java Co-authored-by: Martin Robertz Former-commit-id: 1878ef170e99a2285c153075e58ba58fcc0235a8 --- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index 71077a3a31..b9123478e5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -525,20 +525,18 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse "Max slots: " + EnumChatFormatting.GREEN + this.mMaxSlots + EnumChatFormatting.RESET, "Used slots: " + ((mStorage.size() > mMaxSlots) ? EnumChatFormatting.RED : EnumChatFormatting.GREEN) + this.mStorage.size() + EnumChatFormatting.RESET)); - for (int i = 0; i < mStorage.size(); i++) { - if (!mStorage.get(i).isValid) continue; - StringBuilder a = new StringBuilder( - "Slot " + i + ": " + EnumChatFormatting.GREEN + "x" + this.mStorage.get(i).input.stackSize + " " - + this.mStorage.get(i).input.getDisplayName()); + HashMap storageList = new HashMap<>(); + for (GreenHouseSlot greenHouseSlot : mStorage) { + if (!greenHouseSlot.isValid) continue; + StringBuilder a = new StringBuilder(EnumChatFormatting.GREEN + "x" + greenHouseSlot.input.stackSize + " " + + greenHouseSlot.input.getDisplayName()); if (this.isIC2Mode) { - a.append(" | Humidity: " + (this.mStorage.get(i).noHumidity ? 0 : 12) + " : "); - for (Map.Entry entry : - mStorage.get(i).dropprogress.entrySet()) - a.append((int) (entry.getValue() * 100d)).append("% "); + a.append(" | Humidity: ").append(greenHouseSlot.noHumidity ? 0 : 12); } a.append(EnumChatFormatting.RESET); - info.add(a.toString()); + storageList.merge(a.toString(), 1, Integer::sum); } + storageList.forEach((k, v) -> info.add("x" + v + " " + k)); if (mStorage.size() > mMaxSlots) info.add(EnumChatFormatting.DARK_RED + "There are too many crops inside to run !" + EnumChatFormatting.RESET); -- cgit From 735212f8b19e7baf9850a25a8f023d7e208139be Mon Sep 17 00:00:00 2001 From: Maxim Date: Mon, 28 Nov 2022 13:41:48 +0100 Subject: Fix autoplace of mega oil cracker (#238) Former-commit-id: 04f1c1b55b0ce17152553985b0d47bae0b1b38a4 --- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index 3d3babc9cb..47666a18d8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -26,8 +26,7 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTI import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_HatchElement.InputHatch; -import static gregtech.api.enums.GT_HatchElement.Maintenance; +import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.*; @@ -162,13 +161,12 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa .addElement('p', ofBlock(GregTech_API.sBlockCasings4, 1)) .addElement( 'l', - ofChain( // TODO figure out what to do with this - ofHatchAdder( - GT_TileEntity_MegaOilCracker::addLeftHatchToMachineList, CASING_INDEX, 2))) + InputHatch.withAdder(GT_TileEntity_MegaOilCracker::addLeftHatchToMachineList) + .newAny(CASING_INDEX, 2)) .addElement( 'r', - ofChain(ofHatchAdder( - GT_TileEntity_MegaOilCracker::addRightHatchToMachineList, CASING_INDEX, 3))) + OutputHatch.withAdder(GT_TileEntity_MegaOilCracker::addRightHatchToMachineList) + .newAny(CASING_INDEX, 3)) .addElement( 'm', buildHatchAdder(GT_TileEntity_MegaOilCracker.class) @@ -188,8 +186,8 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa private byte glasTier; private HeatingCoilLevel heatLevel; protected final List mMiddleInputHatches = new ArrayList<>(); - protected int mInputOnSide; - protected int mOutputOnSide; + protected int mInputOnSide = -1; + protected int mOutputOnSide = -1; public GT_TileEntity_MegaOilCracker(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -369,6 +367,9 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { glasTier = 0; + mInputOnSide = -1; + mOutputOnSide = -1; + mMiddleInputHatches.clear(); if (LoaderReference.tectech) { this.getTecTechEnergyMultis().clear(); -- cgit From cbd693f6a29a3c1b2d056cd23f47b610d96c2b34 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Fri, 2 Dec 2022 18:47:58 +0800 Subject: add API to register other simple block as valid boroglass in multi (#240) * add API to register other simple block as valid boroglass in multi * remove raw access to allLevels * fix copy paste error Former-commit-id: e11e3f9634c16d15c69862c170c98d30669b0a8e --- build.gradle | 8 +- .../bartworks/API/BorosilicateGlass.java | 141 ++++++++++++--------- .../GT_TileEntity_ElectricImplosionCompressor.java | 25 ++++ .../mega/GT_TileEntity_MegaMultiBlockBase.java | 23 ++-- 4 files changed, 116 insertions(+), 81 deletions(-) diff --git a/build.gradle b/build.gradle index 030dc18539..89350b8a35 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ -//version: 1666118075 +//version: 1669411416 /* 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. + Please check https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/master/build.gradle for updates. */ @@ -338,10 +338,10 @@ dependencies { annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3') annotationProcessor('com.google.guava:guava:24.1.1-jre') annotationProcessor('com.google.code.gson:gson:2.8.6') - annotationProcessor('org.spongepowered:mixin:0.8.5-GTNH:processor') + annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.1:processor') } if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { - compile('com.gtnewhorizon:gtnhmixins:2.0.1') + compile('com.gtnewhorizon:gtnhmixins:2.1.1') } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java index 1e5946b78d..35b6bb8f82 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java @@ -2,12 +2,17 @@ package com.github.bartimaeusnek.bartworks.API; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks2; +import com.google.common.collect.HashBasedTable; +import com.google.common.collect.LinkedHashMultimap; +import com.google.common.collect.SetMultimap; +import com.google.common.collect.Table; import com.gtnewhorizon.structurelib.structure.IStructureElement; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.LoaderState; import cpw.mods.fml.common.registry.GameRegistry; import java.util.ArrayList; import java.util.List; +import java.util.PriorityQueue; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Collectors; @@ -20,40 +25,66 @@ import org.apache.commons.lang3.tuple.Pair; * You might have noticed this API does not expose any Block instance, but only IStructureElements. This is in case we * add more glass blocks later, and we run out of meta id for only one block. *

- * IStructureElements returned from this class should not have its methods called before the game start. + * IStructureElements returned from this class SHOULD NOT have its methods called before post init, or else + * you might end up with wrong autoplace hints. */ public class BorosilicateGlass { - private static Block block; + private static Block block, block2; private static List> representatives; + private static SetMultimap> allLevels; + private static final Table allLevelsReverse = HashBasedTable.create(); + + private static boolean isValidTier(int tier) { + return tier > 0 && tier <= Byte.MAX_VALUE; + } private static Block getGlassBlock() { - if (block == null || !(block instanceof BW_GlasBlocks)) - block = GameRegistry.findBlock("bartworks", "BW_GlasBlocks"); + if (block == null) block = GameRegistry.findBlock("bartworks", "BW_GlasBlocks"); return block; } private static Block getGlassBlock2() { - if (block == null || !(block instanceof BW_GlasBlocks2)) - block = GameRegistry.findBlock("bartworks", "BW_GlasBlocks2"); - return block; + if (block2 == null) block2 = GameRegistry.findBlock("bartworks", "BW_GlasBlocks2"); + return block2; + } + + private static void doRegister( + byte level, Block block, int meta, SetMultimap> allLevels) { + allLevels.put(level, Pair.of(block, meta)); + allLevelsReverse.put(block, meta, level); + } + + private static SetMultimap> getAllLevels() { + if (allLevels == null) { + SetMultimap> ret = LinkedHashMultimap.create(); + Block block = getGlassBlock(); + doRegister((byte) 3, block, 0, ret); + doRegister((byte) 4, block, 1, ret); + doRegister((byte) 5, block, 2, ret); + doRegister((byte) 6, block, 3, ret); + doRegister((byte) 7, block, 4, ret); + doRegister((byte) 8, block, 5, ret); + for (int i = 6; i < 13; i++) { + doRegister((byte) 3, block, i, ret); + } + doRegister((byte) 9, block, 13, ret); + doRegister((byte) 10, block, 14, ret); + doRegister((byte) 11, block, 15, ret); + block = getGlassBlock2(); + doRegister((byte) 12, block, 0, ret); + allLevels = ret; + } + return allLevels; } private static List> getRepresentatives() { if (representatives == null) { + SetMultimap> allLevels = getAllLevels(); ArrayList> ret = new ArrayList<>(); - Block block = getGlassBlock(); - ret.add(Pair.of(block, 0)); - ret.add(Pair.of(block, 1)); - ret.add(Pair.of(block, 2)); - ret.add(Pair.of(block, 3)); - ret.add(Pair.of(block, 4)); - ret.add(Pair.of(block, 5)); - ret.add(Pair.of(block, 13)); - ret.add(Pair.of(block, 14)); - ret.add(Pair.of(block, 15)); - block = getGlassBlock2(); - ret.add(Pair.of(block, 0)); + for (Byte level : new PriorityQueue<>(allLevels.keySet())) { + ret.add(allLevels.get(level).iterator().next()); + } representatives = ret; } return representatives; @@ -63,15 +94,32 @@ public class BorosilicateGlass { return val > hi || val < lo ? -1 : val; } + /** + * Register a new block as valid borosilicate glass with given tier (even if it doesn't contain boron at all) + * + * Does not support matching by more complex stuff like tile entity! + * + * Can only be called at INIT stage. + */ + public static void registerGlass(Block block, int meta, byte tier) { + if (Loader.instance().hasReachedState(LoaderState.POSTINITIALIZATION)) + throw new IllegalStateException("register too late!"); + if (!Loader.instance().hasReachedState(LoaderState.INITIALIZATION)) + throw new IllegalStateException("register too early!"); + if (!isValidTier(tier)) throw new IllegalArgumentException("not a valid tier: " + tier); + doRegister(tier, block, meta, getAllLevels()); + } + /** * Check if there is at least one type of boroglass in that tier. */ public static boolean hasGlassInTier(int tier) { - return tier >= 3 && tier <= 12; + return getAllLevels().containsKey((byte) tier); } /** * Get a structure element for a certain tier of borosilicate glass. DOES NOT accept other glass like reinforced glass, magic mirror, vanilla glass, etc. + * unless these glass are explicitly registered as a borosilicate glass. *

* Use this if you just want boroglass here and doesn't care what tier it is. */ @@ -85,6 +133,7 @@ public class BorosilicateGlass { /** * Get a structure element for any kind of borosilicate glass. DOES NOT accept other glass like reinforced glass, magic mirror, vanilla glass, etc. + * unless these glass are explicitly registered as a borosilicate glass. *

* Use this if you just want boroglass here and doesn't care what tier it is. */ @@ -94,6 +143,7 @@ public class BorosilicateGlass { /** * Get a structure element for borosilicate glass. DOES NOT accept other glass like reinforced glass, magic mirror, vanilla glass, etc. + * unless these glass are explicitly registered as a borosilicate glass. *

* This assumes you want all glass used to be of the same tier. *

@@ -109,6 +159,7 @@ public class BorosilicateGlass { /** * Get a structure element for borosilicate glass. DOES NOT accept other glass like reinforced glass, magic mirror, vanilla glass, etc. + * unless these glass are explicitly registered as a borosilicate glass. * * @param initialValue the value set before structure check started * @param minTier minimal accepted tier. inclusive. must be greater than 0. @@ -130,48 +181,12 @@ public class BorosilicateGlass { /** * Get the tier of this borosilicate glass. DOES NOT consider other glass like reinforced glass, magic mirror, vanilla glass, etc. + * unless these glass are explicitly registered as a borosilicate glass. + * + * @return glass tier, or -1 if is not a borosilicate glass */ public static byte getTier(Block block, int meta) { - byte ret; - if (block instanceof BW_GlasBlocks2) meta += 16; - switch (meta) { - case 1: - ret = 4; - break; - case 2: - case 12: - ret = 5; - break; - case 3: - ret = 6; - break; - case 4: - ret = 7; - break; - case 5: - ret = 8; - break; - case 13: - ret = 9; - break; - case 14: - ret = 10; - break; - case 15: - ret = 11; - break; - case 16: - ret = 12; - break; - default: - ret = 3; - } - if (block instanceof BW_GlasBlocks) { - return block == getGlassBlock() ? ret : -1; - } - if (block instanceof BW_GlasBlocks2) { - return block == getGlassBlock2() ? ret : -1; - } - return -1; + Byte ret = allLevelsReverse.get(block, meta); + return ret == null ? -1 : ret; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 2f937f1c2d..c643b3c23d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -33,6 +33,7 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing; +import com.gtnewhorizon.structurelib.structure.AutoPlaceEnvironment; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.StructureDefinition; @@ -151,6 +152,30 @@ public class GT_TileEntity_ElectricImplosionCompressor else world.setBlockToAir(x, y, z); return true; } + + @Override + public BlocksToPlace getBlocksToPlace( + GT_TileEntity_ElectricImplosionCompressor t, + World world, + int x, + int y, + int z, + ItemStack trigger, + AutoPlaceEnvironment env) { + return BlocksToPlace.createEmpty(); + } + + @Override + public PlaceResult survivalPlaceBlock( + GT_TileEntity_ElectricImplosionCompressor t, + World world, + int x, + int y, + int z, + ItemStack trigger, + AutoPlaceEnvironment env) { + return isAir().survivalPlaceBlock(t, world, x, y, z, trigger, env); + } }) .build(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java index 7cd9595d00..a985814a2d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java @@ -13,7 +13,7 @@ import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.LowPowerLase import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.google.common.collect.ImmutableList; import com.gtnewhorizon.structurelib.StructureLibAPI; -import com.gtnewhorizon.structurelib.structure.IItemSource; +import com.gtnewhorizon.structurelib.structure.AutoPlaceEnvironment; import com.gtnewhorizon.structurelib.structure.IStructureElement; import cpw.mods.fml.common.Optional; import gregtech.api.interfaces.IHatchElement; @@ -25,13 +25,10 @@ import gregtech.api.util.IGT_HatchAdder; import java.util.ArrayList; import java.util.Collection; import java.util.List; -import java.util.function.Consumer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; import net.minecraft.util.StatCollector; import net.minecraft.world.World; @@ -372,19 +369,17 @@ public abstract class GT_TileEntity_MegaMultiBlockBase chatter) { + T o, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { if (check(o, world, x, y, z)) return PlaceResult.SKIP; - if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, actor)) return PlaceResult.REJECT; + if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, env.getActor())) return PlaceResult.REJECT; world.setBlock(x, y, z, Blocks.air, 0, 2); return PlaceResult.ACCEPT; } -- cgit From fd6750ad7c16c749db5ce30b63fb8518e62b3cb7 Mon Sep 17 00:00:00 2001 From: miozune Date: Fri, 2 Dec 2022 19:50:23 +0900 Subject: Rewrite GUIs with ModularUI (#239) * port most of the radio hatch to modularuii * be done with this radio hatch. fuck colors * radio hatch right bar color woooo * spotless hell * final color fix ffs * a bit of tweak * NEI * Windmill * LESU * cleanup * Water Pump, Destructopack, cleanup * Circuit Programmer, Radiation Shutter * Use new MUI method for setOnScrollNumbers Co-authored-by: BlueWeabo <76872108+BlueWeabo@users.noreply.github.com> Co-authored-by: Martin Robertz Former-commit-id: a717aa0117091559dd00bc0a10e54db2025979fc --- .gitignore | 1 + dependencies.gradle | 12 +- gradle.properties | 3 + .../bartimaeusnek/bartworks/API/ITileWithGUI.java | 54 ----- .../bartworks/API/modularUI/BW_UITextures.java | 56 +++++ .../github/bartimaeusnek/bartworks/GuiHandler.java | 41 ---- .../gui/BW_GUIContainer_HeatedWaterPump.java | 65 ------ .../client/gui/BW_GUIContainer_RadLevel.java | 60 ----- .../client/gui/BW_GUIContainer_Windmill.java | 82 ------- .../gui/GT_GUIContainer_CircuitProgrammer.java | 51 ----- .../client/gui/GT_GUIContainer_Destructopack.java | 53 ----- .../bartworks/client/gui/GT_GUIContainer_LESU.java | 121 ---------- .../client/gui/GT_GUIContainer_RadioHatch.java | 101 -------- .../common/blocks/BW_TileEntityContainer.java | 10 +- .../blocks/BW_TileEntityContainer_Multiple.java | 9 +- .../bartworks/common/items/Circuit_Programmer.java | 115 +++++++++- .../common/items/GT_Destructopack_Item.java | 37 ++- .../classic/BW_TileEntity_HeatedWaterPump.java | 43 +++- .../classic/BW_TileEntity_InfinityTank.java | 8 +- .../classic/BW_TileEntity_LESU_Redux.java | 8 +- .../tileentities/multis/GT_TileEntity_DEHP.java | 8 - .../tileentities/multis/GT_TileEntity_LESU.java | 123 ++++++++-- .../multis/GT_TileEntity_Windmill.java | 104 +++++++-- .../mega/GT_TileEntity_MegaBlastFurnace.java | 8 - .../mega/GT_TileEntity_MegaChemicalReactor.java | 8 - .../mega/GT_TileEntity_MegaDistillTower.java | 8 - .../multis/mega/GT_TileEntity_MegaOilCracker.java | 8 - .../mega/GT_TileEntity_MegaVacuumFreezer.java | 8 - .../tiered/GT_MetaTileEntity_RadioHatch.java | 204 +++++++++++++---- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 2 +- .../neiHandler/BW_NEI_RadHatchHandler.java | 9 +- .../container/BW_Container_HeatedWaterPump.java | 195 ---------------- .../server/container/BW_Container_RadioHatch.java | 207 ----------------- .../server/container/BW_Container_Windmill.java | 39 ---- .../container/GT_Container_CircuitProgrammer.java | 255 --------------------- .../container/GT_Container_Item_Destructopack.java | 66 ------ .../server/container/GT_Container_LESU.java | 56 ----- .../server/container/GT_Container_RadioHatch.java | 156 ------------- .../server/container/Slots/BW_DelSlot.java | 39 ---- .../server/container/Slots/BW_FuelSlot.java | 39 ---- .../bartimaeusnek/bartworks/util/BWRecipes.java | 155 ++++++++----- .../openComputers/TileEntity_GTDataServer.java | 8 +- .../bartworks/textures/GT2/gui/Destructopack.png | Bin 908 -> 0 bytes .../assets/bartworks/textures/GT2/gui/LESU.png | Bin 1158 -> 0 bytes .../assets/bartworks/textures/GUI/GUI_CircuitP.png | Bin 1466 -> 0 bytes .../assets/bartworks/textures/GUI/GUI_RSC.png | Bin 1340 -> 0 bytes .../assets/bartworks/textures/GUI/GUI_Windmill.png | Bin 4857 -> 0 bytes .../bartworks/textures/GUI/GUIheatedPump.png | Bin 763 -> 0 bytes .../assets/bartworks/textures/GUI/RadHatch.png | Bin 1214 -> 0 bytes .../bartworks/textures/GUI/background/brown.png | Bin 0 -> 438 bytes .../textures/GUI/background/circuit_programmer.png | Bin 0 -> 994 bytes .../bartworks/textures/GUI/overlay_slot/cross.png | Bin 0 -> 169 bytes .../bartworks/textures/GUI/overlay_slot/dish.png | Bin 0 -> 202 bytes .../textures/GUI/overlay_slot/dna_flask.png | Bin 0 -> 170 bytes .../bartworks/textures/GUI/overlay_slot/module.png | Bin 0 -> 196 bytes .../bartworks/textures/GUI/overlay_slot/rod.png | Bin 0 -> 261 bytes .../textures/GUI/picture/bw_logo_47x21.png | Bin 0 -> 215 bytes .../textures/GUI/picture/decay_time_container.png | Bin 0 -> 240 bytes .../textures/GUI/picture/decay_time_inside.png | Bin 0 -> 146 bytes .../bartworks/textures/GUI/picture/radiation.png | Bin 0 -> 243 bytes .../GUI/picture/radiation_shutter_frame.png | Bin 0 -> 156 bytes .../GUI/picture/radiation_shutter_inside.png | Bin 0 -> 133 bytes .../textures/GUI/picture/sievert_container.png | Bin 0 -> 230 bytes .../textures/GUI/picture/stored_eu_frame.png | Bin 0 -> 132 bytes .../textures/GUI/picture/windmill_empty.png | Bin 0 -> 435 bytes .../textures/GUI/picture/windmill_rotating.png | Bin 0 -> 1002 bytes .../bartworks/textures/GUI/progressbar/fuel.png | Bin 0 -> 236 bytes .../bartworks/textures/GUI/progressbar/sievert.png | Bin 0 -> 249 bytes .../textures/GUI/progressbar/stored_eu_116.png | Bin 0 -> 145 bytes .../assets/bartworks/textures/GUI/slot/brown.png | Bin 0 -> 109 bytes .../textures/GUI/tab/title_angular_brown.png | Bin 0 -> 130 bytes .../bartworks/textures/GUI/tab/title_brown.png | Bin 0 -> 154 bytes .../textures/GUI/tab/title_dark_brown.png | Bin 0 -> 150 bytes .../textures/gui/basicmachines/BW.GUI.BioLab.png | Bin 2000 -> 0 bytes .../gui/basicmachines/BW.GUI.Radioactive.png | Bin 2899 -> 0 bytes 75 files changed, 739 insertions(+), 1896 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/modularUI/BW_UITextures.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java delete mode 100644 src/main/resources/assets/bartworks/textures/GT2/gui/Destructopack.png delete mode 100644 src/main/resources/assets/bartworks/textures/GT2/gui/LESU.png delete mode 100644 src/main/resources/assets/bartworks/textures/GUI/GUI_CircuitP.png delete mode 100644 src/main/resources/assets/bartworks/textures/GUI/GUI_RSC.png delete mode 100644 src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png delete mode 100644 src/main/resources/assets/bartworks/textures/GUI/GUIheatedPump.png delete mode 100644 src/main/resources/assets/bartworks/textures/GUI/RadHatch.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/background/brown.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/background/circuit_programmer.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/overlay_slot/cross.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/overlay_slot/dish.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/overlay_slot/dna_flask.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/overlay_slot/module.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/overlay_slot/rod.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/picture/bw_logo_47x21.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/picture/decay_time_container.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/picture/decay_time_inside.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/picture/radiation.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/picture/radiation_shutter_frame.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/picture/radiation_shutter_inside.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/picture/sievert_container.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/picture/stored_eu_frame.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/picture/windmill_empty.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/picture/windmill_rotating.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/progressbar/fuel.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/progressbar/sievert.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/progressbar/stored_eu_116.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/slot/brown.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/tab/title_angular_brown.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/tab/title_brown.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/tab/title_dark_brown.png delete mode 100644 src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.BioLab.png delete mode 100644 src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.Radioactive.png diff --git a/.gitignore b/.gitignore index 40fb5e4a7d..5fcf044de6 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ whitelist.json *.iws src/main/resources/mixins.*.json *.bat +.vscode/ \ No newline at end of file diff --git a/dependencies.gradle b/dependencies.gradle index 055cd143d2..bf9bf42c0a 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,14 +1,18 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.99:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.148:dev") compile("com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev") - compile("com.github.GTNewHorizons:TecTech:5.0.42:dev") - compile("com.github.GTNewHorizons:NotEnoughItems:2.3.7-GTNH:dev") + compile("com.github.GTNewHorizons:TecTech:5.0.52:dev") + compile("com.github.GTNewHorizons:NotEnoughItems:2.3.14-GTNH:dev") compile("com.github.GTNewHorizons:TinkersConstruct:1.9.4-GTNH:dev") compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.5:dev") compile("com.github.GTNewHorizons:CodeChickenCore:1.1.6:dev") - compile("com.github.GTNewHorizons:Galacticraft:3.0.44-GTNH:dev") + compile("com.github.GTNewHorizons:Galacticraft:3.0.47-GTNH:dev") { + exclude group:"com.github.GTNewHorizons", module:"SpongePoweredMixin" + exclude group:"com.github.GTNewHorizons", module:"SpongeMixins" + } + compile("com.github.GTNewHorizons:ModularUI:1.0.23:dev") compile("com.github.GTNewHorizons:GalacticGregGT5:1.0.8:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } diff --git a/gradle.properties b/gradle.properties index 0773d1e210..973bce915d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -55,6 +55,9 @@ coreModClass = ASM.BWCorePlugin # that is annotated with @Mod) you want this to be true. When in doubt: leave it on false! containsMixinsAndOrCoreModOnly = false +# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins. +forceEnableMixins = true + # 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 = false diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java deleted file mode 100644 index 38b762fa9a..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.API; - -import com.github.bartimaeusnek.bartworks.MainMod; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; - -public interface ITileWithGUI { - - /** - * @return the ID of the GUI, see @link com.github.bartimaeusnek.bartworks.GuiHandler - */ - int getGUIID(); - - /** - * gets called from BW_TileEntityContainer(or _Multiple) when right clicked. - * - * @param tileEntity this tile entity - * @param player the player right clicking it - * @return true always. - */ - default boolean openGUI(TileEntity tileEntity, EntityPlayer player) { - if (!tileEntity.getWorldObj().isRemote) - player.openGui( - MainMod.MOD_ID, - getGUIID(), - tileEntity.getWorldObj(), - tileEntity.xCoord, - tileEntity.yCoord, - tileEntity.zCoord); - return true; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/modularUI/BW_UITextures.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/modularUI/BW_UITextures.java new file mode 100644 index 0000000000..86d9d2c0b8 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/modularUI/BW_UITextures.java @@ -0,0 +1,56 @@ +package com.github.bartimaeusnek.bartworks.API.modularUI; + +import static com.github.bartimaeusnek.bartworks.MainMod.MOD_ID; + +import com.gtnewhorizons.modularui.api.drawable.AdaptableUITexture; +import com.gtnewhorizons.modularui.api.drawable.UITexture; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +public class BW_UITextures { + + public static final AdaptableUITexture BACKGROUND_BROWN = + AdaptableUITexture.of(MOD_ID, "GUI/background/brown", 176, 166, 3); + public static final UITexture BACKGROUND_CIRCUIT_PROGRAMMER = + UITexture.fullImage(MOD_ID, "GUI/background/circuit_programmer"); + + public static final AdaptableUITexture SLOT_BROWN = AdaptableUITexture.of(MOD_ID, "GUI/slot/brown", 18, 18, 1); + + public static final UITexture OVERLAY_SLOT_DISH = UITexture.fullImage(MOD_ID, "GUI/overlay_slot/dish"); + public static final UITexture OVERLAY_SLOT_DNA_FLASK = UITexture.fullImage(MOD_ID, "GUI/overlay_slot/dna_flask"); + public static final UITexture OVERLAY_SLOT_MODULE = UITexture.fullImage(MOD_ID, "GUI/overlay_slot/module"); + public static final UITexture OVERLAY_SLOT_ROD = UITexture.fullImage(MOD_ID, "GUI/overlay_slot/rod"); + public static final UITexture OVERLAY_SLOT_CROSS = UITexture.fullImage(MOD_ID, "GUI/overlay_slot/cross"); + + public static final UITexture PROGRESSBAR_SIEVERT = UITexture.fullImage(MOD_ID, "GUI/progressbar/sievert"); + public static final UITexture PROGRESSBAR_STORED_EU_116 = + UITexture.fullImage(MOD_ID, "GUI/progressbar/stored_eu_116"); + public static final UITexture PROGRESSBAR_FUEL = UITexture.fullImage(MOD_ID, "GUI/progressbar/fuel"); + + public static final UITexture PICTURE_BW_LOGO_47X21 = UITexture.fullImage(MOD_ID, "GUI/picture/bw_logo_47x21"); + public static final UITexture PICTURE_SIEVERT_CONTAINER = + UITexture.fullImage(MOD_ID, "GUI/picture/sievert_container"); + public static final UITexture PICTURE_DECAY_TIME_CONTAINER = + UITexture.fullImage(MOD_ID, "GUI/picture/decay_time_container"); + public static final UITexture PICTURE_DECAY_TIME_INSIDE = + UITexture.fullImage(MOD_ID, "GUI/picture/decay_time_inside"); + public static final UITexture PICTURE_RADIATION = UITexture.fullImage(MOD_ID, "GUI/picture/radiation"); + public static final UITexture PICTURE_WINDMILL_EMPTY = UITexture.fullImage(MOD_ID, "GUI/picture/windmill_empty"); + public static final UITexture[] PICTURE_WINDMILL_ROTATING = IntStream.range(0, 4) + .mapToObj(i -> + UITexture.partly(MOD_ID, "GUI/picture/windmill_rotating", 32, 128, 0, i * 32, 32, (i + 1) * 32)) + .collect(Collectors.toList()) + .toArray(new UITexture[0]); + public static final UITexture PICTURE_STORED_EU_FRAME = UITexture.fullImage(MOD_ID, "GUI/picture/stored_eu_frame"); + public static final UITexture PICTURE_RADIATION_SHUTTER_FRAME = + UITexture.fullImage(MOD_ID, "GUI/picture/radiation_shutter_frame"); + public static final AdaptableUITexture PICTURE_RADIATION_SHUTTER_INSIDE = + AdaptableUITexture.of(MOD_ID, "GUI/picture/radiation_shutter_inside", 51, 48, 1); + + public static final AdaptableUITexture TAB_TITLE_BROWN = + AdaptableUITexture.of(MOD_ID, "GUI/tab/title_brown", 28, 28, 4); + public static final AdaptableUITexture TAB_TITLE_DARK_BROWN = + AdaptableUITexture.of(MOD_ID, "GUI/tab/title_dark_brown", 28, 28, 4); + public static final AdaptableUITexture TAB_TITLE_ANGULAR_BROWN = + AdaptableUITexture.of(MOD_ID, "GUI/tab/title_angular_brown", 28, 28, 4); +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java index d074e32c53..28dbaf5250 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -23,17 +23,7 @@ package com.github.bartimaeusnek.bartworks; import com.github.bartimaeusnek.bartworks.API.SideReference; -import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_HeatedWaterPump; -import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_RadLevel; -import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_CircuitProgrammer; -import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_Destructopack; -import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; -import com.github.bartimaeusnek.bartworks.server.container.BW_Container_HeatedWaterPump; -import com.github.bartimaeusnek.bartworks.server.container.BW_Container_RadioHatch; -import com.github.bartimaeusnek.bartworks.server.container.GT_Container_CircuitProgrammer; -import com.github.bartimaeusnek.bartworks.server.container.GT_Container_Item_Destructopack; import cpw.mods.fml.common.network.IGuiHandler; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; @@ -41,43 +31,12 @@ public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - switch (ID) { - case 0: - return new GT_Container_Item_Destructopack(player.inventory); - case 1: - return new GT_Container_CircuitProgrammer(player.inventory); - case 2: { - if (world.getTileEntity(x, y, z) instanceof IGregTechTileEntity) { - IGregTechTileEntity te = (IGregTechTileEntity) world.getTileEntity(x, y, z); - return new BW_Container_RadioHatch(player.inventory, te.getMetaTileEntity()); - } - } - case 3: - return new BW_Container_HeatedWaterPump( - (BW_TileEntity_HeatedWaterPump) world.getTileEntity(x, y, z), player); - } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if (SideReference.Side.Client) { - switch (ID) { - case 0: - return new GT_GUIContainer_Destructopack(player.inventory); - case 1: - return new GT_GUIContainer_CircuitProgrammer(player.inventory); - case 2: { - if (world.getTileEntity(x, y, z) instanceof IGregTechTileEntity) { - IGregTechTileEntity te = (IGregTechTileEntity) world.getTileEntity(x, y, z); - return new BW_GUIContainer_RadLevel( - new BW_Container_RadioHatch(player.inventory, te.getMetaTileEntity())); - } - } - case 3: - return new BW_GUIContainer_HeatedWaterPump(new BW_Container_HeatedWaterPump( - (BW_TileEntity_HeatedWaterPump) world.getTileEntity(x, y, z), player)); - } } else return getServerGuiElement(ID, player, world, x, y, z); return null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java deleted file mode 100644 index d92ed0012f..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.client.gui; - -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.server.container.BW_Container_HeatedWaterPump; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.inventory.Container; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; - -public class BW_GUIContainer_HeatedWaterPump extends GuiContainer { - private static final ResourceLocation furnaceGuiTextures = - new ResourceLocation(MainMod.MOD_ID + ":textures/GUI/GUIheatedPump.png"); - final BW_Container_HeatedWaterPump container; - - public BW_GUIContainer_HeatedWaterPump(Container p_i1072_1_) { - super(p_i1072_1_); - this.container = (BW_Container_HeatedWaterPump) p_i1072_1_; - } - - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(BW_GUIContainer_HeatedWaterPump.furnaceGuiTextures); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - // this.drawString(this.fontRendererObj, "Fuel:" + container.fuel + " Water:" + container.water, k, l, - // 0xffffff); - - if (this.container.fuel > 0) { - this.mc.getTextureManager().bindTexture(BW_GUIContainer_HeatedWaterPump.furnaceGuiTextures); - int ik = Math.max(this.container.maxfuel, 200); - int i1 = ((this.container.fuel * 13) / ik); - this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 13 - i1, 14, i1 + 1); - } - - // if (this.container.water > 0){ - // this.mc.getTextureManager().bindTexture( new ResourceLocation("textures/blocks/water_still.png")); - // this.drawTexturedModalRect(k+85,l+32,32,32,18,18); - // } - - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java deleted file mode 100644 index 6d234b69dd..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.client.gui; - -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.server.container.BW_Container_RadioHatch; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.inventory.Container; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; - -@SideOnly(Side.CLIENT) -public class BW_GUIContainer_RadLevel extends GuiContainer { - final BW_Container_RadioHatch container; - - public BW_GUIContainer_RadLevel(Container p_i1072_1_) { - super(p_i1072_1_); - this.container = (BW_Container_RadioHatch) p_i1072_1_; - } - - @Override - protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GL11.glColor3f(1, 1, 1); - this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUI_RSC.png")); - this.drawTexturedModalRect(this.guiLeft - 79, this.guiTop, 0, 0, 256, 165); - } - - @Override - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - int y = 51 + (this.container.coverage / 2 - 3); - int x = -63; - if (this.container.coverage != 100 && this.container.coverage != 0) - Gui.drawRect(x, y, x + 51, y + 1, 0xFF60D82E); - Gui.drawRect(x, 48, x + 51, y, 0xFF8B8B8B); - this.fontRendererObj.drawString(Byte.toString(this.container.coverage), 88 - 79, 50, 16448255); - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java deleted file mode 100644 index 5b6c40c20a..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.client.gui; - -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.server.container.BW_Container_Windmill; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_Container_MultiMachine; -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_LanguageManager; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; - -@SideOnly(Side.CLIENT) -public class BW_GUIContainer_Windmill extends GT_GUIContainerMetaTile_Machine { - - public BW_GUIContainer_Windmill(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new BW_Container_Windmill(aInventoryPlayer, aTileEntity), ""); - } - - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - if (!(this.mContainer instanceof GT_Container_MultiMachine)) return; - - if ((this.mContainer.mDisplayErrorCode & 64) != 0) - this.fontRendererObj.drawString(this.trans("138", "Incomplete Structure."), 92, 22, 16448255); - } - - public String trans(String aKey, String aEnglish) { - return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false); - } - - private static final int DIVIDER = 125; - private byte last = 0; - - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUI_Windmill.png")); - - int x = (this.width - this.xSize) / 2; - int y = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - if (this.mContainer.mMaxProgressTime > 0) { - if (System.currentTimeMillis() / DIVIDER % 40 == 30) - this.drawTexturedModalRect(x + 85, y + 27, 176, (last = 96), 32, 32); - else if (System.currentTimeMillis() / DIVIDER % 40 == 20) - this.drawTexturedModalRect(x + 85, y + 27, 176, (last = 64), 32, 32); - else if (System.currentTimeMillis() / DIVIDER % 40 == 10) - this.drawTexturedModalRect(x + 85, y + 27, 176, (last = 32), 32, 32); - else if (System.currentTimeMillis() / DIVIDER % 40 == 0) - this.drawTexturedModalRect(x + 85, y + 27, 176, (last = 0), 32, 32); - else this.drawTexturedModalRect(x + 85, y + 27, 176, last, 32, 32); - } - - // Soft Mallet - if (this.mContainer.mDisplayErrorCode == 0) { - if (this.mContainer.mActive == 0) { - this.drawTexturedModalRect(x + 66, y + 66, 176, 128, 15, 15); - } - } - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java deleted file mode 100644 index e575474b72..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.client.gui; - -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.server.container.GT_Container_CircuitProgrammer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; - -@SideOnly(Side.CLIENT) -public class GT_GUIContainer_CircuitProgrammer extends GuiContainer { - - public static final ResourceLocation texture = - new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUI_CircuitP.png"); - - public GT_GUIContainer_CircuitProgrammer(InventoryPlayer p_i1072_1_) { - super(new GT_Container_CircuitProgrammer(p_i1072_1_)); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GL11.glColor4f(1F, 1F, 1F, 1F); - Minecraft.getMinecraft().getTextureManager().bindTexture(GT_GUIContainer_CircuitProgrammer.texture); - this.drawTexturedModalRect(this.guiLeft - 79, this.guiTop, 0, 0, 256, 165); - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java deleted file mode 100644 index 7b050d64b7..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.client.gui; - -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.server.container.GT_Container_Item_Destructopack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; - -@SideOnly(Side.CLIENT) -public class GT_GUIContainer_Destructopack extends GuiContainer { - public static final ResourceLocation texture = - new ResourceLocation(MainMod.MOD_ID, "textures/GT2/gui/Destructopack.png"); - - public GT_GUIContainer_Destructopack(InventoryPlayer inventory) { - super(new GT_Container_Item_Destructopack(inventory)); - } - - @Override - public void drawGuiContainerBackgroundLayer(float f, int j, int i) { - GL11.glColor4f(1F, 1F, 1F, 1F); - Minecraft.getMinecraft().getTextureManager().bindTexture(GT_GUIContainer_Destructopack.texture); - this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 175, 165); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) {} -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java deleted file mode 100644 index acab43a06e..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.client.gui; - -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_LESU; -import com.github.bartimaeusnek.bartworks.server.container.GT_Container_LESU; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_GUIContainer; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_Utility; -import java.awt.*; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import org.lwjgl.opengl.GL11; - -@SideOnly(Side.CLIENT) -public class GT_GUIContainer_LESU extends GT_GUIContainer { - - public static final ResourceLocation texture = new ResourceLocation(MainMod.MOD_ID, "textures/GT2/gui/LESU.png"); - protected GT_Container_LESU mContainer; - private final GT_TileEntity_LESU c; - - public GT_GUIContainer_LESU(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_LESU(aInventoryPlayer, aTileEntity), GT_GUIContainer_LESU.texture.getResourceDomain()); - this.mContainer = ((GT_Container_LESU) this.inventorySlots); - this.c = ((GT_TileEntity_LESU) (this.mContainer.mTileEntity.getMetaTileEntity())); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - this.drawString(this.fontRendererObj, "L.E.S.U.", 11, 8, 16448255); - if (this.mContainer != null) { - String percell = String.valueOf(ConfigHandler.energyPerCell).substring(1); - this.drawString( - this.fontRendererObj, "EU: " + GT_Utility.formatNumbers(this.mContainer.mEnergy), 11, 16, 16448255); - this.drawString( - this.fontRendererObj, - "MAX: " - + (this.c.getBaseMetaTileEntity().isActive() - ? GT_Utility.formatNumbers(this.mContainer.mOutput) + percell - : Integer.toString(0)), - 11, - 24, - 16448255); - this.drawString( - this.fontRendererObj, - "MAX EU/t IN: " + GT_Utility.formatNumbers(this.mContainer.mInput), - 11, - 32, - 16448255); - this.drawString( - this.fontRendererObj, - "EU/t OUT: " + GT_Utility.formatNumbers(this.mContainer.mOutput), - 11, - 40, - 16448255); - this.drawString( - this.fontRendererObj, - "AMP/t IN/OUT: " - + GT_Utility.formatNumbers( - this.c.getBaseMetaTileEntity().getInputAmperage()), - 11, - 48, - 16448255); - if (this.c.maxEUStore() >= Long.MAX_VALUE - 1) { - this.drawString( - this.fontRendererObj, - StatCollector.translateToLocal("tooltip.LESU.0.name"), - 11, - 56, - Color.YELLOW.getRGB()); - } - if (!this.c.getBaseMetaTileEntity().isActive()) { - this.drawString( - this.fontRendererObj, - StatCollector.translateToLocal("tooltip.LESU.1.name"), - 11, - 56, - Color.RED.getRGB()); - } - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - Minecraft.getMinecraft().getTextureManager().bindTexture(GT_GUIContainer_LESU.texture); - int x = (this.width - this.xSize) / 2; - int y = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - if (this.mContainer != null) { - long tScale = this.mContainer.mEnergy / Math.max(1, this.c.maxEUStore() / 116); - this.drawTexturedModalRect(x + 8, y + 73, 0, 251, (int) tScale, 5); - } - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java deleted file mode 100644 index b77417131c..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.client.gui; - -import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; -import com.github.bartimaeusnek.bartworks.util.MathUtils; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import org.lwjgl.opengl.GL11; - -@SideOnly(Side.CLIENT) -public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine { - private static int maxSv; - private final String mName; - - public GT_GUIContainer_RadioHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { - super( - new GT_Container_RadioHatch(aInventoryPlayer, aTileEntity), - MainMod.MOD_ID + ":textures/GUI/RadHatch.png"); - this.mName = "Radio Hatch"; - this.mContainer.detectAndSendChanges(); - GT_GUIContainer_RadioHatch.maxSv = BioVatLogicAdder.RadioHatch.getMaxSv(); - } - - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - - long timer = ((GT_Container_RadioHatch) this.mContainer).teTimer; - double maxT = ((GT_Container_RadioHatch) this.mContainer).decayTime; - double rem = maxT - timer % maxT; - - this.fontRendererObj.drawString(this.mName, 5, 4, 4210752); - this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID + ":textures/GUI/RadHatch.png")); - if (((GT_Container_RadioHatch) this.mContainer).mass > 0) { - GL11.glColor3f( - ((GT_Container_RadioHatch) this.mContainer).r / 255f, - ((GT_Container_RadioHatch) this.mContainer).g / 255f, - ((GT_Container_RadioHatch) this.mContainer).b / 255f); - this.drawTexturedModalRect(124, 18, 124, 18, 16, 48); - } - GL11.glColor3f(1f, 1f, 1f); - if (((GT_Container_RadioHatch) this.mContainer).mass <= 0) { - this.drawTexturedModalRect(124, 18, 176, 0, 16, 48); - } else { - this.drawTexturedModalRect(124, 18, 176, 0, 16, 48 - MathUtils.ceilInt(48 * (rem / maxT))); - } - this.drawTexturedModalRect( - 65, - 13, - 192, - 0, - (48 * (((GT_Container_RadioHatch) this.mContainer).sv)) / (GT_GUIContainer_RadioHatch.maxSv), - 16); - - this.fontRendererObj.drawString( - StatCollector.translateToLocalFormatted( - "BW.NEI.display.radhatch.1", ((GT_Container_RadioHatch) this.mContainer).mass), - 65, - 62, - 4210752); - this.fontRendererObj.drawString( - StatCollector.translateToLocalFormatted( - "BW.NEI.display.radhatch.0", ((GT_Container_RadioHatch) this.mContainer).sv), - 60, - 72, - 4210752); - } - - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (this.width - this.xSize) / 2; - int y = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index e14ff9f491..7b10ace417 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -25,9 +25,10 @@ package com.github.bartimaeusnek.bartworks.common.blocks; import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; import com.github.bartimaeusnek.bartworks.API.ITileDropsContent; import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; -import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; +import com.gtnewhorizons.modularui.api.UIInfos; +import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ic2.api.tile.IWrenchable; @@ -98,8 +99,11 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI if (!player.isSneaking()) { if (tile instanceof IHasGui) { return worldObj.isRemote || IC2.platform.launchGui(player, (IHasGui) tile); - } else if (tile instanceof ITileWithGUI) { - return worldObj.isRemote || ((ITileWithGUI) tile).openGUI(tile, player); + } else if (tile instanceof ITileWithModularUI) { + if (!worldObj.isRemote) { + UIInfos.TILE_MODULAR_UI.open(player, worldObj, x, y, z); + } + return true; } } return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java index 61429f10e1..184e02dc00 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java @@ -22,8 +22,9 @@ package com.github.bartimaeusnek.bartworks.common.blocks; -import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; import com.github.bartimaeusnek.bartworks.MainMod; +import com.gtnewhorizons.modularui.api.UIInfos; +import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ic2.api.tile.IWrenchable; @@ -90,8 +91,10 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { TileEntity tile = worldObj.getTileEntity(x, y, z); if (tile instanceof IHasGui) { return worldObj.isRemote || IC2.platform.launchGui(player, (IHasGui) tile); - } else if (tile instanceof ITileWithGUI) { - return worldObj.isRemote || ((ITileWithGUI) tile).openGUI(tile, player); + } else if (tile instanceof ITileWithModularUI) { + if (!worldObj.isRemote) { + UIInfos.TILE_MODULAR_UI.open(player, worldObj, x, y, z); + } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index fde6eaa2f4..bfc0a9d239 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -22,13 +22,32 @@ package com.github.bartimaeusnek.bartworks.common.items; +import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.gtnewhorizons.modularui.api.ModularUITextures; +import com.gtnewhorizons.modularui.api.forge.IItemHandlerModifiable; +import com.gtnewhorizons.modularui.api.forge.ItemStackHandler; +import com.gtnewhorizons.modularui.api.math.Pos2d; +import com.gtnewhorizons.modularui.api.screen.IItemWithModularUI; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; +import com.gtnewhorizons.modularui.common.widget.ButtonWidget; +import com.gtnewhorizons.modularui.common.widget.SlotWidget; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.items.GT_Generic_Item; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; import java.util.List; @@ -37,10 +56,11 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem { +public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem, IItemWithModularUI { private static final int COST_PER_USE = 100; @@ -73,11 +93,12 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem @Override public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { if (ElectricItem.manager.use(aStack, COST_PER_USE, aPlayer)) { - aPlayer.openGui(MainMod.instance, 1, aWorld, 0, 0, 0); + GT_UIInfos.openPlayerHeldItemUI(aPlayer); } return aStack; } + @Override @SideOnly(Side.CLIENT) @SuppressWarnings("unchecked") public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { @@ -92,11 +113,13 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem } } + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aIconRegister) { this.mIcon = aIconRegister.registerIcon("bartworks:CircuitProgrammer"); } + @Override public int getTier(ItemStack var1) { return 1; } @@ -125,4 +148,92 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem public double getTransferLimit(ItemStack itemStack) { return GT_Values.V[1]; } + + private static final String NBT_KEY_HAS_CHIP = "HasChip"; + private static final String NBT_KEY_CHIP_CONFIG = "ChipConfig"; + + @Override + public ModularWindow createWindow(UIBuildContext buildContext, ItemStack heldStack) { + ModularWindow.Builder builder = ModularWindow.builder(256, 166); + builder.setBackground(BW_UITextures.BACKGROUND_CIRCUIT_PROGRAMMER); + builder.bindPlayerInventory(buildContext.getPlayer(), new Pos2d(86, 83), ModularUITextures.ITEM_SLOT); + + ItemStackHandler inventoryHandler = new ItemStackHandler(1) { + @Override + public int getSlotLimit(int slot) { + return 1; + } + }; + SlotWidget circuitSlotWidget = new SlotWidget(new BaseSlot(inventoryHandler, 0) { + @Override + public void putStack(ItemStack stack) { + if (isLVCircuit(stack)) { + stack = createRealCircuit(0); + } + ((IItemHandlerModifiable) this.getItemHandler()).setStackInSlot(getSlotIndex(), stack); + this.onSlotChanged(); + } + }); + + ItemStack initialStack = null; + NBTTagCompound tag = heldStack.getTagCompound(); + if (tag != null && tag.getBoolean(NBT_KEY_HAS_CHIP)) { + initialStack = createRealCircuit(tag.getByte(NBT_KEY_CHIP_CONFIG)); + } + circuitSlotWidget.getMcSlot().putStack(initialStack); + + builder.widget(circuitSlotWidget + .setChangeListener(widget -> { + ItemStack stack = widget.getMcSlot().getStack(); + ItemStack heldItem = widget.getContext().getPlayer().getHeldItem(); + NBTTagCompound tag2 = heldItem.getTagCompound(); + if (tag2 == null) { + tag2 = new NBTTagCompound(); + } + + if (stack != null) { + tag2.setBoolean(NBT_KEY_HAS_CHIP, true); + tag2.setByte(NBT_KEY_CHIP_CONFIG, (byte) stack.getItemDamage()); + } else { + tag2.setBoolean(NBT_KEY_HAS_CHIP, false); + } + heldItem.setTagCompound(tag2); + }) + .setFilter(stack -> isProgrammedCircuit(stack) || isLVCircuit(stack)) + .setBackground(ModularUITextures.ITEM_SLOT, GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT) + .setPos(122, 60)); + + for (int i = 0; i < 24; i++) { + final int index = i; + builder.widget(new ButtonWidget() + .setOnClick((clickData, widget) -> { + if (circuitSlotWidget.getMcSlot().getHasStack() + && isProgrammedCircuit( + circuitSlotWidget.getMcSlot().getStack())) { + circuitSlotWidget.getMcSlot().putStack(createRealCircuit(index + 1)); + } + }) + .setPos(32 + (i % 12) * 18, 21 + (i / 12) * 18) + .setSize(18, 18)); + } + + return builder.build(); + } + + private ItemStack createRealCircuit(int config) { + return ItemList.Circuit_Integrated.getWithDamage(1, config); + } + + private boolean isProgrammedCircuit(ItemStack stack) { + return stack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); + } + + private boolean isLVCircuit(ItemStack stack) { + return BW_Util.checkStackAndPrefix(stack) + && GT_OreDictUnificator.getAssociation(stack).mPrefix.equals(OrePrefixes.circuit) + && GT_OreDictUnificator.getAssociation(stack) + .mMaterial + .mMaterial + .equals(Materials.Basic); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java index c116290257..714cc51f2e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -22,10 +22,21 @@ package com.github.bartimaeusnek.bartworks.common.items; +import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; +import com.gtnewhorizons.modularui.api.ModularUITextures; +import com.gtnewhorizons.modularui.api.forge.ItemStackHandler; +import com.gtnewhorizons.modularui.api.screen.IItemWithModularUI; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.SlotWidget; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.items.GT_Generic_Item; import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; @@ -33,7 +44,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -public class GT_Destructopack_Item extends GT_Generic_Item { +public class GT_Destructopack_Item extends GT_Generic_Item implements IItemWithModularUI { public GT_Destructopack_Item() { super("GT2Destructopack", "Destructopack", "Mobile Trash Bin"); @@ -52,7 +63,7 @@ public class GT_Destructopack_Item extends GT_Generic_Item { @Override public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { - aPlayer.openGui(MainMod.instance, 0, aWorld, 0, 0, 0); + GT_UIInfos.openPlayerHeldItemUI(aPlayer); return aStack; } @@ -60,4 +71,26 @@ public class GT_Destructopack_Item extends GT_Generic_Item { public void registerIcons(IIconRegister aIconRegister) { this.mIcon = aIconRegister.registerIcon("bartworks:gt.GT2Destructopack"); } + + @Override + public ModularWindow createWindow(UIBuildContext buildContext, ItemStack heldStack) { + ModularWindow.Builder builder = ModularWindow.builder(176, 166); + builder.setBackground(ModularUITextures.VANILLA_BACKGROUND); + builder.bindPlayerInventory(buildContext.getPlayer()); + + builder.widget(new SlotWidget(new BaseSlot(new ItemStackHandler(), 0) { + @Override + public void putStack(ItemStack stack) { + onSlotChanged(); + } + }) + .setBackground(ModularUITextures.ITEM_SLOT, BW_UITextures.OVERLAY_SLOT_CROSS) + .setPos(79, 16)) + .widget(new DrawableWidget() + .setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT) + .setSize(17, 17) + .setPos(152, 63)); + + return builder.build(); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index ec740107da..6bf5546ce6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -25,9 +25,17 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; import com.github.bartimaeusnek.bartworks.API.ITileDropsContent; import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; -import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; +import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.gtnewhorizons.modularui.api.ModularUITextures; +import com.gtnewhorizons.modularui.api.forge.IItemHandlerModifiable; +import com.gtnewhorizons.modularui.api.forge.InvWrapper; +import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.widget.ProgressBar; +import com.gtnewhorizons.modularui.common.widget.SlotWidget; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Pollution; import java.util.Arrays; @@ -47,7 +55,7 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDropsContent, IFluidHandler, IFluidTank, - ITileWithGUI, + ITileWithModularUI, ITileAddsInformation, ITileHasDifferentTextureSides { @@ -88,7 +96,7 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity } private boolean checkPreUpdate() { - return this.worldObj.isRemote || ((this.fuelstack == null || this.fuelstack.stackSize <= 0) && this.fuel <= 0); + return (this.fuelstack == null || this.fuelstack.stackSize <= 0) && this.fuel <= 0; } private void fixUnderlflow() { @@ -117,7 +125,10 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity @Override public void updateEntity() { + if (this.worldObj.isRemote) return; + pushWaterToAdjacentTiles(); + fakestack.setStackDisplayName(outputstack.amount + "L Water"); if (checkPreUpdate()) return; fixUnderlflow(); @@ -279,11 +290,6 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity return ret; } - @Override - public int getGUIID() { - return 3; - } - @Override public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { return 0; @@ -340,4 +346,25 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpSide"); } } + + @Override + public ModularWindow createWindow(UIBuildContext buildContext) { + ModularWindow.Builder builder = ModularWindow.builder(176, 166); + builder.setBackground(ModularUITextures.VANILLA_BACKGROUND); + builder.bindPlayerInventory(buildContext.getPlayer()); + final IItemHandlerModifiable invWrapper = new InvWrapper(this); + + builder.widget(new SlotWidget(invWrapper, 0) + .setFilter(stack -> TileEntityFurnace.getItemBurnTime(stack) > 0) + .setPos(55, 52)) + .widget(SlotWidget.phantom(invWrapper, 1).disableInteraction().setPos(85, 32)) + .widget(new ProgressBar() + .setProgress(() -> (float) fuel / maxfuel) + .setTexture(BW_UITextures.PROGRESSBAR_FUEL, 14) + .setDirection(ProgressBar.Direction.UP) + .setPos(56, 36) + .setSize(14, 14)); + + return builder.build(); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java index 7f25dd52c2..2fcf82d36c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java @@ -22,7 +22,6 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; -import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; import gregtech.api.util.GT_Utility; import java.util.ArrayList; import net.minecraft.nbt.NBTTagCompound; @@ -31,7 +30,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.*; -public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank, IFluidHandler, ITileWithGUI { +public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank, IFluidHandler { final ArrayList INTERNALTANKS = new ArrayList<>(); @@ -154,9 +153,4 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank } return ret; } - - @Override - public int getGUIID() { - return 4; - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java index 141cc4760c..e5a07a9505 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java @@ -25,7 +25,6 @@ // import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; // import com.github.bartimaeusnek.bartworks.API.ITileDropsContent; // import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; -// import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; // import com.github.bartimaeusnek.bartworks.MainMod; // import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; // import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; @@ -51,7 +50,7 @@ // // // public class BW_TileEntity_LESU_Redux extends TileEntity implements ITileHasDifferentTextureSides, -// ITileAddsInformation, ITileWithGUI, ITileDropsContent, IEnergyConnected { +// ITileAddsInformation, ITileDropsContent, IEnergyConnected { // // public ConnectedBlocksChecker connectedcells; // public ItemStack[] circuits = new ItemStack[5]; @@ -83,11 +82,6 @@ // } // // @Override -// public int getGUIID() { -// return 0; -// } -// -// @Override // public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { // if (inputEnergyFrom(aSide)){ // diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index d19bd42924..a420fa6933 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -29,7 +29,6 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; -import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; @@ -42,7 +41,6 @@ import ic2.core.block.reactor.tileentity.TileEntityNuclearReactorElectric; import java.lang.reflect.Field; import java.util.Arrays; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.Fluid; @@ -101,12 +99,6 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { return new GT_TileEntity_DEHP(this.mName, this.mTier); } - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine( - aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "DrillingRig.png"); - } - @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 366b6cc81b..6ed572e976 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -22,19 +22,29 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_LESU; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; -import com.github.bartimaeusnek.bartworks.server.container.GT_Container_LESU; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.ConnectedBlocksChecker; +import com.gtnewhorizons.modularui.api.drawable.Text; +import com.gtnewhorizons.modularui.api.forge.ItemStackHandler; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn; +import com.gtnewhorizons.modularui.common.widget.ProgressBar; +import com.gtnewhorizons.modularui.common.widget.SlotWidget; +import com.gtnewhorizons.modularui.common.widget.TextWidget; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Dyes; import gregtech.api.enums.GT_Values; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -42,11 +52,11 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; +import java.awt.*; import java.util.ArrayList; import java.util.Collections; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IIcon; @@ -64,7 +74,13 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { private static final IIconContainer[] iIconContainers = new IIconContainer[4]; private static final ITexture[][] iTextures = new ITexture[4][1]; public ConnectedBlocksChecker connectedcells; - public ItemStack[] circuits = new ItemStack[5]; + public final ItemStack[] circuits = new ItemStack[5]; + private final ItemStackHandler circuitsInventoryHandler = new ItemStackHandler(circuits) { + @Override + public int getSlotLimit(int slot) { + return 1; + } + }; private long mStorage; public GT_TileEntity_LESU(int aID, String aName, String aNameRegional) { @@ -194,16 +210,6 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } } - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_LESU(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_LESU(aPlayerInventory, aBaseMetaTileEntity); - } - public boolean isClientSide() { if (this.getWorld() != null) return this.getWorld().isRemote @@ -449,4 +455,93 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public World getWorld() { return this.getBaseMetaTileEntity().getWorld(); } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY) + .setSize(17, 17) + .setPos(105, 51)); + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.widget(new DrawableWidget() + .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setPos(7, 4) + .setSize(118, 67)) + .widget(new SlotWidget(new BaseSlot(inventoryHandler, 1) { + @Override + public int getSlotStackLimit() { + return 1; + } + }) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN) + .setPos(127, 13)) + .widget(new SlotWidget(new BaseSlot(inventoryHandler, 0) { + @Override + public int getSlotStackLimit() { + return 1; + } + }) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CHARGER) + .setPos(127, 49)); + for (int i = 0; i < 4; i++) { + builder.widget(new SlotWidget(circuitsInventoryHandler, i) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT) + .setPos(151, 4 + i * 18)); + } + + final DynamicPositionedColumn screenElements = new DynamicPositionedColumn(); + drawTexts(screenElements); + builder.widget(screenElements); + + builder.widget(new DrawableWidget() + .setDrawable(BW_UITextures.PICTURE_STORED_EU_FRAME) + .setPos(7, 72) + .setSize(118, 7)) + .widget(new ProgressBar() + .setProgress(() -> (float) getBaseMetaTileEntity().getStoredEU() + / getBaseMetaTileEntity().getEUCapacity()) + .setDirection(ProgressBar.Direction.RIGHT) + .setTexture(BW_UITextures.PROGRESSBAR_STORED_EU_116, 116) + .setPos(8, 73) + .setSize(116, 5)); + } + + private void drawTexts(DynamicPositionedColumn screenElements) { + screenElements.setSpace(0).setPos(11, 8); + + screenElements + .widget(TextWidget.dynamicString(() -> "EU: " + + GT_Utility.formatNumbers( + getBaseMetaTileEntity().getStoredEU())) + .setDefaultColor(COLOR_TEXT_WHITE.get())) + .widget(TextWidget.dynamicString(() -> "MAX: " + + (getBaseMetaTileEntity().isActive() + ? GT_Utility.formatNumbers( + getBaseMetaTileEntity().getOutputVoltage()) + + String.valueOf(ConfigHandler.energyPerCell) + .substring(1) + : Integer.toString(0))) + .setDefaultColor(COLOR_TEXT_WHITE.get())) + .widget(TextWidget.dynamicString(() -> "MAX EU/t IN: " + + GT_Utility.formatNumbers( + getBaseMetaTileEntity().getInputVoltage())) + .setDefaultColor(COLOR_TEXT_WHITE.get())) + .widget(TextWidget.dynamicString(() -> "EU/t OUT: " + + GT_Utility.formatNumbers( + getBaseMetaTileEntity().getOutputVoltage())) + .setDefaultColor(COLOR_TEXT_WHITE.get())) + .widget(TextWidget.dynamicString(() -> "AMP/t IN/OUT: " + + GT_Utility.formatNumbers( + getBaseMetaTileEntity().getInputAmperage())) + .setDefaultColor(COLOR_TEXT_WHITE.get())) + .widget(new TextWidget(Text.localised("tooltip.LESU.0.name")) + .setDefaultColor(Color.YELLOW.getRGB()) + .setEnabled(widget -> maxEUStore() >= Long.MAX_VALUE - 1)) + .widget(new TextWidget(Text.localised("tooltip.LESU.1.name")) + .setDefaultColor(Color.RED.getRGB()) + .setEnabled(widget -> !getBaseMetaTileEntity().isActive())); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 83075e48e0..93b003e1b8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -26,24 +26,37 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTI import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_Values.V; +import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_Windmill; import com.github.bartimaeusnek.bartworks.common.items.BW_Stonage_Rotors; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; -import com.github.bartimaeusnek.bartworks.server.container.BW_Container_Windmill; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; -import com.gtnewhorizon.structurelib.structure.*; +import com.gtnewhorizon.structurelib.structure.AutoPlaceEnvironment; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.IStructureElement; +import com.gtnewhorizon.structurelib.structure.IStructureElementNoPlacement; +import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import com.gtnewhorizons.modularui.api.drawable.ItemDrawable; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; +import com.gtnewhorizons.modularui.common.widget.SlotWidget; +import com.gtnewhorizons.modularui.common.widget.TextWidget; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GUITextureSet; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.modularui.IGetTitleColor; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; import gregtech.api.objects.XSTR; @@ -52,6 +65,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gregtech.common.items.GT_MetaGenerated_Tool_01; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; @@ -59,7 +73,6 @@ import java.util.List; import java.util.Set; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -70,7 +83,7 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlockBase - implements ISurvivalConstructable { + implements ISurvivalConstructable, IGetTitleColor { private static final IIcon[] iIcons = new IIcon[2]; private static final IIconContainer[] iIconContainers = new IIconContainer[2]; @@ -335,16 +348,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock return true; } - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new BW_GUIContainer_Windmill(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new BW_Container_Windmill(aPlayerInventory, aBaseMetaTileEntity); - } - @Override public void stopMachine() { getBaseMetaTileEntity().disableWorking(); @@ -576,4 +579,75 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock rotorBlock.rotorSlot.damage(damage, false); } } + + @Override + public GUITextureSet getGUITextureSet() { + return new GUITextureSet() + .setMainBackground(BW_UITextures.BACKGROUND_BROWN) + .setItemSlot(BW_UITextures.SLOT_BROWN) + .setTitleTab( + BW_UITextures.TAB_TITLE_BROWN, + BW_UITextures.TAB_TITLE_DARK_BROWN, + BW_UITextures.TAB_TITLE_ANGULAR_BROWN); + } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(BW_UITextures.PICTURE_BW_LOGO_47X21) + .setSize(47, 21) + .setPos(123, 59)); + } + + @Override + public int getTitleColor() { + return COLOR_TITLE_WHITE.get(); + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.widget(new SlotWidget(inventoryHandler, 1) + .setBackground(getGUITextureSet().getItemSlot()) + .setPos(59, 35)) + .widget( + new DrawableWidget() { + private static final int DIVIDER = 125; + + @Override + public void onScreenUpdate() { + super.onScreenUpdate(); + if (mMaxProgresstime > 0) { + if (System.currentTimeMillis() / DIVIDER % 40 == 30) + setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[3]); + else if (System.currentTimeMillis() / DIVIDER % 40 == 20) + setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[2]); + else if (System.currentTimeMillis() / DIVIDER % 40 == 10) + setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[1]); + else if (System.currentTimeMillis() / DIVIDER % 40 == 0) + setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[0]); + } else { + setDrawable(BW_UITextures.PICTURE_WINDMILL_EMPTY); + } + } + }.setDrawable(BW_UITextures.PICTURE_WINDMILL_EMPTY) + .setPos(85, 27) + .setSize(32, 32)) + .widget(new FakeSyncWidget.IntegerSyncer(() -> mMaxProgresstime, val -> mMaxProgresstime = val)) + .widget(new ItemDrawable( + () -> mMachine && !getBaseMetaTileEntity().isActive() + ? GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SOFTMALLET, 1, null, null, null) + : null) + .asWidget() + .setPos(66, 66)) + .widget(new FakeSyncWidget.BooleanSyncer( + () -> getBaseMetaTileEntity().isActive(), + val -> getBaseMetaTileEntity().setActive(val))) + .widget(new TextWidget(GT_Utility.trans("138", "Incomplete Structure.")) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setMaxWidth(150) + .setEnabled(widget -> !mMachine) + .setPos(92, 22)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val)); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 67dc33c702..3a116ce85b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -48,7 +48,6 @@ import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.Materials; -import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -61,7 +60,6 @@ import java.util.*; import java.util.stream.Collectors; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; @@ -343,12 +341,6 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock || addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); } - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine( - aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png"); - } - @Override public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = null; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index b65ff1697c..5fe08809ff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -43,7 +43,6 @@ import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; -import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -57,7 +56,6 @@ import java.util.ArrayList; import java.util.Collection; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; @@ -150,12 +148,6 @@ public class GT_TileEntity_MegaChemicalReactor return new ITexture[] {casingTexturePages[1][48]}; } - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine( - aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeChemicalReactor.png"); - } - @Override public boolean supportsSingleRecipeLocking() { return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index c7e5c9b934..25d21399f8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -45,7 +45,6 @@ import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; -import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -59,7 +58,6 @@ import java.util.ArrayList; import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -420,12 +418,6 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine( - aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DistillationTower.png"); - } - @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sDistillationRecipes; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index 47666a18d8..a12f177545 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -44,7 +44,6 @@ import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.enums.HeatingCoilLevel; -import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -60,7 +59,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -266,12 +264,6 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa return new ITexture[] {casingTexturePages[0][CASING_INDEX]}; } - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine( - aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "OilCrackingUnit.png"); - } - @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sCrackingRecipes; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index c77a0a7af9..5057280257 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -42,7 +42,6 @@ import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; -import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -53,7 +52,6 @@ import gregtech.api.util.GT_Utility; import java.util.ArrayList; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; @@ -401,12 +399,6 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc return GT_Recipe.GT_Recipe_Map.sVacuumRecipes; } - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine( - aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png"); - } - private boolean mUseMultiparallelMode = false; @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 28fa80e963..851e49e3e4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -24,36 +24,57 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; import static gregtech.api.enums.GT_Values.ticksBetweenSounds; +import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_RadioHatch; -import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.MathUtils; +import com.gtnewhorizons.modularui.api.ModularUITextures; +import com.gtnewhorizons.modularui.api.drawable.ItemDrawable; +import com.gtnewhorizons.modularui.api.drawable.shapes.Rectangle; +import com.gtnewhorizons.modularui.api.math.Alignment; +import com.gtnewhorizons.modularui.api.math.Color; +import com.gtnewhorizons.modularui.api.math.Pos2d; +import com.gtnewhorizons.modularui.api.math.Size; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.widget.ButtonWidget; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; +import com.gtnewhorizons.modularui.common.widget.ProgressBar; +import com.gtnewhorizons.modularui.common.widget.ProgressBar.Direction; +import com.gtnewhorizons.modularui.common.widget.TextWidget; +import com.gtnewhorizons.modularui.common.widget.textfield.TextFieldWidget; +import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.gui.modularui.GUITextureSet; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.modularui.IAddGregtechLogo; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gregtech.common.items.GT_MetaGenerated_Tool_01; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; -public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { +public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implements IAddGregtechLogo { private final int cap; public int sievert; private long timer = 1; private long decayTime = 1; - private short[] colorForGUI; + private short[] colorForGUI = {0x02, 0x02, 0x02}; private byte mass; private String material; private byte coverage; @@ -90,7 +111,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { public short[] getColorForGUI() { if (this.colorForGUI != null) return this.colorForGUI; - return new short[] {0xFA, 0xFA, 0xFF}; + return colorForGUI = new short[] {0xFA, 0xFA, 0xFF}; } public byte getMass() { @@ -101,10 +122,6 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { return this.coverage; } - public long getDecayTime() { - return this.decayTime; - } - public void setCoverage(short coverage) { byte nu; if (coverage > 100) nu = 100; @@ -113,10 +130,12 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { this.coverage = nu; } + @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { return new ITexture[] {aBaseTexture, TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_IN)}; } + @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { return new ITexture[] {aBaseTexture, TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_IN)}; } @@ -127,20 +146,8 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } @Override - public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - aPlayer.openGui( - MainMod.MOD_ID, - 2, - this.getBaseMetaTileEntity().getWorld(), - this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getYCoord(), - this.getBaseMetaTileEntity().getZCoord()); - } - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (!aBaseMetaTileEntity.isClientSide()) { - aBaseMetaTileEntity.openGUI(aPlayer); - } + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -148,6 +155,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { if (this.mInventory[0] != null && this.mInventory[0].stackSize <= 0) this.mInventory[0] = null; } + @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { BaseMetaTileEntity myMetaTileEntity = ((BaseMetaTileEntity) this.getBaseMetaTileEntity()); if (myMetaTileEntity.isServerSide()) { @@ -178,7 +186,11 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { ItemStack lStack = this.mInventory[0]; if (lStack == null) { + this.colorForGUI = new short[] {0x37, 0x37, 0x37}; return; + } else { + Materials mat = GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial; + this.colorForGUI = new short[] {mat.getRGBA()[0], mat.getRGBA()[1], mat.getRGBA()[2]}; } if (this.lastFail && GT_Utility.areStacksEqual(this.lastUsedItem, lStack, true)) { @@ -217,11 +229,6 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { this.mass = (byte) this.lastRecipe.mDuration; this.decayTime = this.lastRecipe.mSpecialValue; this.sievert = this.lastRecipe.mEUt; - this.colorForGUI = new short[] { - (short) this.lastRecipe.mChances[0], - (short) this.lastRecipe.mChances[1], - (short) this.lastRecipe.mChances[2] - }; this.material = lStack.getDisplayName(); lStack.stackSize--; updateSlots(); @@ -266,39 +273,37 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { }; } + @Override public boolean isSimpleMachine() { return true; } + @Override public boolean isFacingValid(byte aFacing) { return true; } + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) { return true; } + @Override public boolean isValidSlot(int aIndex) { return true; } + @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return false; } + @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return aSide == this.getBaseMetaTileEntity().getFrontFacing() && BWRecipes.instance.getMappingsFor(BWRecipes.RADHATCH).containsInput(aStack); } - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_RadioHatch(aPlayerInventory, aBaseMetaTileEntity); - } - - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_RadioHatch(aPlayerInventory, aBaseMetaTileEntity, this.mName); - } - @Override public void saveNBTData(NBTTagCompound aNBT) { aNBT.setByte("mMass", this.mass); @@ -311,10 +316,6 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { super.saveNBTData(aNBT); } - public long getTimer() { - return this.timer; - } - @Override public void loadNBTData(NBTTagCompound aNBT) { this.timer = aNBT.getLong("timer"); @@ -335,4 +336,127 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { GT_Utility.doSoundAtClient(rl, 10, 1.0F, aX, aY, aZ); } } + + private static final int RADIATION_SHUTTER_WINDOW_ID = 999; + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + buildContext.addSyncedWindow(RADIATION_SHUTTER_WINDOW_ID, this::createShutterWindow); + + getBaseMetaTileEntity().add1by1Slot(builder); + builder.widget(new DrawableWidget() + .setBackground(BW_UITextures.PICTURE_SIEVERT_CONTAINER) + .setPos(61, 9) + .setSize(56, 24)) + .widget(new ProgressBar() + .setProgress(() -> getSievert() / 148f) + .setDirection(Direction.RIGHT) + .setTexture(BW_UITextures.PROGRESSBAR_SIEVERT, 24) + .setPos(65, 13) + .setSize(48, 16)) + .widget(new DrawableWidget() + .setBackground(BW_UITextures.PICTURE_DECAY_TIME_INSIDE) + .setPos(124, 18) + .setSize(16, 48)) + .widget( + new DrawableWidget() { + @Override + public void draw(float partialTicks) { + if (decayTime > 0) { + int height = MathUtils.ceilInt( + 48 * ((decayTime - timer % decayTime) / (float) decayTime)); + new Rectangle() + .setColor(Color.argb(colorForGUI[0], colorForGUI[1], colorForGUI[2], 255)) + .draw(new Pos2d(0, 48 - height), new Size(16, height), partialTicks); + } + } + }.setPos(124, 18).setSize(16, 48)) + .widget(new FakeSyncWidget.ShortSyncer(() -> colorForGUI[0], val -> colorForGUI[0] = val)) + .widget(new FakeSyncWidget.ShortSyncer(() -> colorForGUI[1], val -> colorForGUI[1] = val)) + .widget(new FakeSyncWidget.ShortSyncer(() -> colorForGUI[2], val -> colorForGUI[2] = val)) + .widget(new DrawableWidget() + .setBackground(BW_UITextures.PICTURE_DECAY_TIME_CONTAINER) + .setPos(120, 14) + .setSize(24, 56)) + .widget(new FakeSyncWidget.LongSyncer(() -> decayTime, val -> decayTime = val)) + .widget(new FakeSyncWidget.LongSyncer(() -> timer, val -> timer = val)) + .widget(TextWidget.dynamicString( + () -> StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", mass)) + .setTextAlignment(Alignment.Center) + .setPos(65, 62)) + .widget(TextWidget.dynamicString( + () -> StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.0", sievert)) + .setTextAlignment(Alignment.Center) + .setPos(60, 72)) + .widget(new ButtonWidget() + .setOnClick((clickData, widget) -> { + if (!widget.isClient()) { + widget.getContext().openSyncedWindow(RADIATION_SHUTTER_WINDOW_ID); + } + }) + .addTooltip("Radiation Shutter") + .setBackground(GT_UITextures.BUTTON_STANDARD) + .setPos(153, 5) + .setSize(18, 18)) + .widget(new ItemDrawable(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, null, null, null)) + .asWidget() + .setPos(154, 6)); + } + + private ModularWindow createShutterWindow(EntityPlayer player) { + ModularWindow.Builder builder = ModularWindow.builder(176, 107); + builder.setBackground(ModularUITextures.VANILLA_BACKGROUND); + builder.setGuiTint(getGUIColorization()); + + builder.widget(new TextWidget("Radiation Shutter Control") + .setDefaultColor(COLOR_TITLE.get()) + .setPos(10, 9)) + .widget(new DrawableWidget() + .setDrawable(BW_UITextures.PICTURE_RADIATION_SHUTTER_FRAME) + .setPos(14, 27) + .setSize(55, 54)) + .widget(new DrawableWidget() + .setDrawable(() -> coverage < 100 ? BW_UITextures.PICTURE_RADIATION_SHUTTER_INSIDE : null) + .setPos(16, 29) + .setSize(51, 50) + .attachSyncer( + new FakeSyncWidget.ByteSyncer(this::getCoverage, this::setCoverage), + builder, + (widget, val) -> + widget.setPos(16, 29 + coverage / 2).setSize(51, 50 - coverage / 2))) + .widget(new TextFieldWidget() + .setSetterInt(val -> coverage = val.byteValue()) + .setGetterInt(() -> (int) coverage) + .setNumbers(0, 100) + .setTextColor(Color.WHITE.dark(1)) + .setOnScrollNumbers(1, 5, 50) + .setTextAlignment(Alignment.CenterLeft) + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD.withOffset(-1, -1, 2, 2)) + .setPos(86, 27) + .setSize(30, 12)) + .widget(ButtonWidget.closeWindowButton(true).setPos(176 - 15, 3)); + + return builder.build(); + } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(BW_UITextures.PICTURE_BW_LOGO_47X21) + .setSize(47, 21) + .setPos(10, 53)); + } + + @Override + public GUITextureSet getGUITextureSet() { + return new GUITextureSet() + .setMainBackground(GT_UITextures.BACKGROUND_SINGLEBLOCK_DEFAULT) + .setGregTechLogo(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT); + } + + @Override + public boolean useModularUI() { + return true; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index fb1ce389df..2a2e2102ca 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -61,7 +61,7 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { } public void drawExtras(int aRecipeIndex) { - int base = 70; + int base = getDescriptionYOffset() - 2; int[] lines = {base, base + 8, base + 16, base + 24, base + 32, base + 40, base + 48, base + 56, base + 64}; int tEUt = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; int tDuration = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_RadHatchHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_RadHatchHandler.java index 8c3a8f66f6..0ae2453934 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_RadHatchHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_RadHatchHandler.java @@ -35,11 +35,14 @@ public class BW_NEI_RadHatchHandler extends GT_NEI_DefaultHandler { int radioLevel = recipe.mEUt; int amount = recipe.mDuration; long time = recipe.mSpecialValue; - drawText(10, 73, StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.0", radioLevel), -16777216); - drawText(10, 83, StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", amount), -16777216); + int y = getDescriptionYOffset(); + drawText(10, y, StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.0", radioLevel), -16777216); + y += 10; + drawText(10, y, StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", amount), -16777216); + y += 10; drawText( 10, - 93, + y, StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.2", time * amount / 20.0), -16777216); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java deleted file mode 100644 index 0d9cd5731b..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.server.container; - -import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; -import com.github.bartimaeusnek.bartworks.server.container.Slots.BW_FuelSlot; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_Slot_Render; -import java.nio.ByteBuffer; -import java.util.Iterator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class BW_Container_HeatedWaterPump extends Container { - - final BW_TileEntity_HeatedWaterPump TILE; - final IInventory INVENTORY; - public int fuel, water, awater, maxfuel; - long timer; - byte[] anetfuel, netfuel, anetmaxfuel, netmaxfuel; - - public BW_Container_HeatedWaterPump(BW_TileEntity_HeatedWaterPump TILE, EntityPlayer INVENTORY) { - this.TILE = TILE; - this.INVENTORY = INVENTORY.inventory; - - this.addSlotToContainer(new BW_FuelSlot(TILE, 0, 56, 53)); - this.addSlotToContainer(new GT_Slot_Render(TILE, 1, 86, 33)); - int i; - - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(this.INVENTORY, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(this.INVENTORY, i, 8 + i * 18, 142)); - } - } - - @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { - return true; - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { - Slot slot = this.getSlot(p_82846_2_); - if (p_82846_2_ == 0 && slot.getStack() != null) { - for (int i = 25; i < this.inventorySlots.size(); i++) { - if (((Slot) this.inventorySlots.get(i)).getStack() == null) { - ((Slot) this.inventorySlots.get(i)).putStack(slot.getStack()); - slot.putStack(null); - } - } - } else if (p_82846_2_ > 1 - && slot.getStack() != null - && ((Slot) this.inventorySlots.get(0)).getStack() == null - && ((Slot) this.inventorySlots.get(0)).isItemValid(slot.getStack())) { - ((Slot) this.inventorySlots.get(0)).putStack(slot.getStack()); - slot.putStack(null); - } - return null; - } - - @Override - @SuppressWarnings("rawtypes") - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (this.TILE.getWorldObj().isRemote) return; - - this.fuel = this.TILE.fuel; - this.maxfuel = this.TILE.maxfuel; - this.water = this.TILE.outputstack.amount; - this.netfuel = ByteBuffer.allocate(8).putInt(this.fuel).array(); - this.netmaxfuel = ByteBuffer.allocate(8).putInt(this.maxfuel).array(); - ++this.timer; - Iterator var2 = this.crafters.iterator(); - if (this.timer >= Long.MAX_VALUE - 1) this.timer = 0; - while (true) { - do { - if (!var2.hasNext()) { - this.netfuel = this.anetfuel; - this.netmaxfuel = this.anetmaxfuel; - this.water = this.awater; - return; - } - ICrafting var1 = (ICrafting) var2.next(); - if (this.timer % 500 == 10 || this.water != this.awater) - var1.sendProgressBarUpdate(this, 0, this.water); - if (this.timer % 500 == 10 || this.netfuel != this.anetfuel) - for (int i = 0; i < this.netfuel.length; i++) { - var1.sendProgressBarUpdate(this, i + 1, this.netfuel[i]); - } - if (this.timer % 500 == 10 || this.netmaxfuel != this.anetmaxfuel) - for (int i = 0; i < this.netmaxfuel.length; i++) { - var1.sendProgressBarUpdate(this, i + 9, this.netmaxfuel[i]); - } - } while (this.timer % 500 != 10 && this.water != this.awater); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int packetID, int valure) { - if (this.netfuel == null) this.netfuel = new byte[8]; - if (this.netmaxfuel == null) this.netmaxfuel = new byte[8]; - switch (packetID) { - case 0: { - this.water = valure; - this.getSlot(1).putStack(this.getSlot(1).getStack().setStackDisplayName(this.water + "L Water")); - break; - } - case 1: - this.netfuel[0] = (byte) valure; - break; - case 2: - this.netfuel[1] = (byte) valure; - break; - case 3: - this.netfuel[2] = (byte) valure; - break; - case 4: - this.netfuel[3] = (byte) valure; - break; - case 5: - this.netfuel[4] = (byte) valure; - break; - case 6: - this.netfuel[5] = (byte) valure; - break; - case 7: - this.netfuel[6] = (byte) valure; - break; - case 8: - this.netfuel[7] = (byte) valure; - break; - case 9: - this.netmaxfuel[0] = (byte) valure; - break; - case 10: - this.netmaxfuel[1] = (byte) valure; - break; - case 11: - this.netmaxfuel[2] = (byte) valure; - break; - case 12: - this.netmaxfuel[3] = (byte) valure; - break; - case 13: - this.netmaxfuel[4] = (byte) valure; - break; - case 14: - this.netmaxfuel[5] = (byte) valure; - break; - case 15: - this.netmaxfuel[6] = (byte) valure; - break; - case 16: - this.netmaxfuel[7] = (byte) valure; - break; - default: - break; - } - if (packetID > 0 && packetID < 9) - this.fuel = ByteBuffer.wrap(this.netfuel).getInt(); - if (packetID > 8 && packetID < 17) - this.maxfuel = ByteBuffer.wrap(this.netmaxfuel).getInt(); - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java deleted file mode 100644 index b53e3301db..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.server.container; - -import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import java.util.Iterator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class BW_Container_RadioHatch extends Container { - - public byte coverage, dcoverage; - long timer; - private final GT_MetaTileEntity_RadioHatch iGregTechTileEntity; - - public BW_Container_RadioHatch(InventoryPlayer inventory, IMetaTileEntity iGregTechTileEntity) { - this.iGregTechTileEntity = (GT_MetaTileEntity_RadioHatch) iGregTechTileEntity; - - IInventory inv = new IInventory() { - @Override - public int getSizeInventory() { - return 0; - } - - @Override - public ItemStack getStackInSlot(int p_70301_1_) { - return null; - } - - @Override - public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { - return null; - } - - @Override - public ItemStack getStackInSlotOnClosing(int p_70304_1_) { - return null; - } - - @Override - public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {} - - @Override - public String getInventoryName() { - return null; - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public int getInventoryStackLimit() { - return 0; - } - - @Override - public void markDirty() {} - - @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { - return false; - } - - @Override - public void openInventory() {} - - @Override - public void closeInventory() {} - - @Override - public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - return false; - } - }; - - for (int i = 0; i < 12; i++) { - this.addSlotToContainer(new GT_Slot_Holo(inv, i, -64 + i * 18, 22, false, false, 1)); - } - - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 9; j++) { - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - for (int i = 0; i < 9; i++) { - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); - } - } - - @Override - @SuppressWarnings("rawtypes") - public void detectAndSendChanges() { - if (!this.iGregTechTileEntity.getBaseMetaTileEntity().isClientSide() - && this.iGregTechTileEntity.getBaseMetaTileEntity().getMetaTileEntity() != null) { - this.coverage = this.iGregTechTileEntity.getCoverage(); - ++this.timer; - Iterator var2 = this.crafters.iterator(); - if (this.timer >= Long.MAX_VALUE - 1) this.timer = 0; - while (true) { - do { - if (!var2.hasNext()) { - this.dcoverage = this.coverage; - return; - } - ICrafting var1 = (ICrafting) var2.next(); - if (this.timer % 500 == 10 || this.dcoverage != this.coverage) - var1.sendProgressBarUpdate(this, 0, this.coverage); - } while (this.timer % 500 != 10 && this.dcoverage != this.coverage); - } - } - } - - @Override - public void updateProgressBar(int p_75137_1_, int p_75137_2_) { - if (p_75137_1_ == 0) this.coverage = (byte) p_75137_2_; - } - - @Override - public ItemStack slotClick(int slot, int button, int aShifthold, EntityPlayer entityPlayer) { - if (slot >= 0 && slot < 12) { - byte setto; - switch (slot) { - case 0: - setto = -100; - break; - case 1: - setto = -75; - break; - case 2: - setto = -50; - break; - case 3: - setto = -25; - break; - case 4: - setto = -10; - break; - case 5: - setto = -1; - break; - case 6: - setto = 1; - break; - case 7: - setto = 10; - break; - case 8: - setto = 25; - break; - case 9: - setto = 50; - break; - case 10: - setto = 75; - break; - case 11: - setto = 100; - break; - default: - setto = 0; - } - this.iGregTechTileEntity.setCoverage((short) (this.iGregTechTileEntity.getCoverage() + setto)); - this.detectAndSendChanges(); - return null; - } - return super.slotClick(slot, button, aShifthold, entityPlayer); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int SlotNR) { - return null; - } - - @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { - return true; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java deleted file mode 100644 index f80986f198..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.server.container; - -import gregtech.api.gui.GT_Container_MultiMachine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; - -public class BW_Container_Windmill extends GT_Container_MultiMachine { - - public BW_Container_Windmill(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - public void addSlots(InventoryPlayer aInventoryPlayer) { - this.addSlotToContainer(new Slot(this.mTileEntity, 1, 60, 36)); - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java deleted file mode 100644 index bbb09a2c2a..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.server.container; - -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.items.Circuit_Programmer; -import com.github.bartimaeusnek.bartworks.common.net.CircuitProgrammerPacket; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.gui.GT_Slot_Render; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.ForgeHooks; - -public class GT_Container_CircuitProgrammer extends Container { - - EntityPlayer player; - - public GT_Container_CircuitProgrammer(InventoryPlayer inventory) { - - this.player = inventory.player; - - IInventory inv = new pinv(this.player); - - this.addSlotToContainer(new Slot(inv, 0, 44, 61)); // -45, 84)); - - for (int i = 1; i < 13; i++) { - this.addSlotToContainer(new GT_Slot_Holo(inv, i, -64 + i * 18, 22, false, false, 1)); - } - for (int i = 0; i < 12; i++) { - this.addSlotToContainer(new GT_Slot_Holo(inv, i + 12, -46 + i * 18, 40, false, false, 1)); - } - - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 9; j++) { - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - - for (int i = 0; i < 9; i++) { - if (GT_Utility.isStackValid(inventory.getStackInSlot(i)) - && inventory.getStackInSlot(i).getItem() instanceof Circuit_Programmer) - this.addSlotToContainer(new GT_Slot_Render(inventory, i, 8 + i * 18, 142)); - else this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); - } - } - - @Override - public ItemStack slotClick(int slot, int button, int aShifthold, EntityPlayer entityPlayer) { - if (slot > 0 && slot < 25 && ((Slot) this.inventorySlots.get(0)).getStack() != null) { - ItemStack iCircuit = GT_Utility.getIntegratedCircuit(slot); - iCircuit.stackSize = 1; - ((Slot) this.inventorySlots.get(0)).putStack(iCircuit); - this.detectAndSendChanges(); - return ((Slot) this.inventorySlots.get(0)).getStack(); - } - this.detectAndSendChanges(); - return super.slotClick(slot, button, aShifthold, entityPlayer); - } - - @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { - return true; - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int SlotNR) { - Slot chipslot = (Slot) this.inventorySlots.get(0); - if (SlotNR > 24) { - Slot slot = (Slot) this.inventorySlots.get(SlotNR); - if (slot != null - && slot.getStack() != null - && slot.getStack() - .getItem() - .equals(GT_Utility.getIntegratedCircuit(0).getItem())) { - if (chipslot.getStack() == null) { - chipslot.putStack(slot.getStack().copy()); - slot.decrStackSize(1); - } - } - } else if (SlotNR == 0 && chipslot.getStack() != null) { - for (int i = 25; i < this.inventorySlots.size(); i++) { - if (((Slot) this.inventorySlots.get(i)).getStack() == null) { - Slot empty = ((Slot) this.inventorySlots.get(i)); - empty.putStack(chipslot.getStack().copy()); - chipslot.decrStackSize(1); - break; - } - } - } - this.detectAndSendChanges(); - return null; - } - - class pinv implements IInventory { - - ItemStack toBind; - EntityPlayer Player; - ItemStack Slot; - NBTTagCompound tag; - - public pinv(EntityPlayer Player) { - this.Player = Player; - this.toBind = Player.inventory.getCurrentItem(); - this.tag = this.toBind.getTagCompound(); - if (this.tag.getBoolean("HasChip")) { - this.Slot = GT_Utility.getIntegratedCircuit(this.tag.getByte("ChipConfig")); - this.Slot.stackSize = 1; - } - } - - @Override - public int getSizeInventory() { - return 1; - } - - @Override - public ItemStack getStackInSlot(int slot) { - return slot == 0 ? this.Slot : null; - } - - @Override - public ItemStack decrStackSize(int slotNR, int count) { - ItemStack ret = this.Slot.copy(); - this.Slot = null; - this.tag = this.toBind.getTagCompound(); - this.tag.setBoolean("HasChip", false); - this.toBind.setTagCompound(this.tag); - this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); - return ret; - } - - @Override - public ItemStack getStackInSlotOnClosing(int p_70304_1_) { - return this.Slot; - } - - @Override - public void setInventorySlotContents(int slotNR, ItemStack itemStack) { - if (itemStack != null - && itemStack.getItem() != null - && itemStack - .getItem() - .equals(GT_Utility.getIntegratedCircuit(0).getItem())) { - this.Slot = BW_Util.setStackSize(itemStack.copy(), 1); - itemStack.stackSize--; - this.tag = this.toBind.getTagCompound(); - this.tag.setBoolean("HasChip", true); - this.tag.setByte("ChipConfig", (byte) itemStack.getItemDamage()); - this.toBind.setTagCompound(this.tag); - this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); - if (!this.Player.isClientWorld()) - MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket( - this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), true, (byte) - itemStack.getItemDamage())); - } else if (BW_Util.checkStackAndPrefix(itemStack) - && GT_OreDictUnificator.getAssociation(itemStack).mPrefix.equals(OrePrefixes.circuit) - && GT_OreDictUnificator.getAssociation(itemStack) - .mMaterial - .mMaterial - .equals(Materials.Basic)) { - this.Slot = GT_Utility.getIntegratedCircuit(0); - this.Slot.stackSize = 1; - itemStack.stackSize--; - this.tag = this.toBind.getTagCompound(); - this.tag.setBoolean("HasChip", true); - this.tag.setByte("ChipConfig", (byte) 0); - this.toBind.setTagCompound(this.tag); - this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); - if (!this.Player.isClientWorld()) - MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket( - this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), true, (byte) 0)); - } /* else if (GT_Utility.isStackValid(itemStack) && itemStack.getItem() instanceof Circuit_Programmer) { - ForgeHooks.onPlayerTossEvent(Player, itemStack, false); - this.closeInventory(); - Player.closeScreen(); - }*/ else { - ForgeHooks.onPlayerTossEvent(this.Player, itemStack, false); - this.tag = this.toBind.getTagCompound(); - this.tag.setBoolean("HasChip", false); - this.toBind.setTagCompound(this.tag); - this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); - if (!this.Player.isClientWorld()) - MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket( - this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), false, (byte) 0)); - } - } - - @Override - public String getInventoryName() { - return null; - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public int getInventoryStackLimit() { - return 1; - } - - @Override - public void markDirty() {} - - @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { - return true; - } - - @Override - public void openInventory() {} - - @Override - public void closeInventory() {} - - @Override - public boolean isItemValidForSlot(int p_94041_1_, ItemStack itemStack) { - return itemStack != null - && itemStack - .getItem() - .equals(GT_Utility.getIntegratedCircuit(0).getItem()); - } - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java deleted file mode 100644 index 60f849e766..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.server.container; - -import com.github.bartimaeusnek.bartworks.server.container.Slots.BW_DelSlot; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_Item_Destructopack extends Container { - - public GT_Container_Item_Destructopack(InventoryPlayer inventory) { - - this.addSlotToContainer(new BW_DelSlot()); - - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 9; j++) { - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - for (int i = 0; i < 9; i++) { - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); - } - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int aSlotIndex) { - Slot slotObject = (Slot) this.inventorySlots.get(aSlotIndex); - slotObject.putStack(null); - return null; - } - - @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { - return true; - } - - @Override - public void onCraftMatrixChanged(IInventory p_75130_1_) { - Slot slotObject = (Slot) this.inventorySlots.get(0); - slotObject.decrStackSize(0); - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java deleted file mode 100644 index 198ff69c23..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.server.container; - -import gregtech.api.gui.GT_Container_MultiMachine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; - -public class GT_Container_LESU extends GT_Container_MultiMachine { - - public GT_Container_LESU(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - public GT_Container_LESU(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, boolean bindInventory) { - super(aInventoryPlayer, aTileEntity, bindInventory); - } - - public void addSlots(InventoryPlayer aInventoryPlayer) { - this.addSlotToContainer(new Slot(this.mTileEntity, 1, 128, 14)); - this.addSlotToContainer(new Slot(this.mTileEntity, 0, 128, 50)); - this.addSlotToContainer(new Slot(this.mTileEntity, 2, 152, 5)); - this.addSlotToContainer(new Slot(this.mTileEntity, 3, 152, 23)); - this.addSlotToContainer(new Slot(this.mTileEntity, 4, 152, 41)); - this.addSlotToContainer(new Slot(this.mTileEntity, 5, 152, 59)); - } - - public int getSlotCount() { - return 6; - } - - public int getShiftClickSlotCount() { - return 6; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java deleted file mode 100644 index 7d1f887200..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.server.container; - -import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_Container_1by1; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import java.nio.ByteBuffer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_RadioHatch extends GT_Container_1by1 { - - public byte mass; - public short sv, sievert, r, g, b; - public long teTimer, decayTime; - GT_MetaTileEntity_RadioHatch TE; - private long timer; - private static final int packetSize = Byte.BYTES + Short.BYTES * 5 + Long.BYTES * 2; - - private ByteBuffer buffer; - - public GT_Container_RadioHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - public void addSlots(InventoryPlayer aInventoryPlayer) { - this.addSlotToContainer(new RadioSlot(this.mTileEntity, 0, 80, 35)); - } - - @SuppressWarnings("rawtypes") - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (this.buffer == null) { - this.buffer = ByteBuffer.allocate(128); - } - if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) { - this.TE = (GT_MetaTileEntity_RadioHatch) this.mTileEntity.getMetaTileEntity(); - this.mass = this.TE.getMass(); - this.sievert = (short) this.TE.sievert; - short[] rgb = this.TE.getColorForGUI(); - this.r = rgb[0]; - this.g = rgb[1]; - this.b = rgb[2]; - this.sv = (short) this.TE.getSievert(); - this.teTimer = this.TE.getTimer(); - this.decayTime = this.TE.getDecayTime(); - ++this.timer; - if (this.timer >= Long.MAX_VALUE - 1) this.timer = 0; - this.buffer.put(0, mass); - this.buffer.putShort(Byte.BYTES, sv); - this.buffer.putShort(Byte.BYTES + Short.BYTES, sievert); - this.buffer.putShort(Byte.BYTES + Short.BYTES * 2, r); - this.buffer.putShort(Byte.BYTES + Short.BYTES * 3, g); - this.buffer.putShort(Byte.BYTES + Short.BYTES * 4, b); - this.buffer.putLong(Byte.BYTES + Short.BYTES * 5, teTimer); - this.buffer.putLong(Byte.BYTES + Short.BYTES * 5 + Long.BYTES, decayTime); - for (Object clientHandle : this.crafters) { - sendStateUpdate((ICrafting) clientHandle); - } - } - } - - private void sendStateUpdate(ICrafting clientHandle) { - for (int i = 0; i < packetSize; i++) { - clientHandle.sendProgressBarUpdate(this, i + 300, buffer.get(i)); - } - } - - @Override - public void addCraftingToCrafters(ICrafting clientHandle) { - super.addCraftingToCrafters(clientHandle); - this.buffer.put(0, mass); - this.buffer.putShort(Byte.BYTES, sv); - this.buffer.putShort(Byte.BYTES + Short.BYTES, sievert); - this.buffer.putShort(Byte.BYTES + Short.BYTES * 2, r); - this.buffer.putShort(Byte.BYTES + Short.BYTES * 3, g); - this.buffer.putShort(Byte.BYTES + Short.BYTES * 4, b); - this.buffer.putLong(Byte.BYTES + Short.BYTES * 5, teTimer); - this.buffer.putLong(Byte.BYTES + Short.BYTES * 5 + Long.BYTES, decayTime); - sendStateUpdate(clientHandle); - } - - @SideOnly(Side.CLIENT) - public void updateProgressBar(int index, int value) { - super.updateProgressBar(index, value); - index = index - 300; - if (index >= 0 && index < buffer.capacity()) { - this.buffer.put(index, (byte) value); - } - if (index >= packetSize - 1) { - this.mass = this.buffer.get(0); - this.sv = this.buffer.getShort(Byte.BYTES); - this.sievert = this.buffer.getShort(Byte.BYTES + Short.BYTES); - this.r = this.buffer.getShort(Byte.BYTES + Short.BYTES * 2); - this.g = this.buffer.getShort(Byte.BYTES + Short.BYTES * 3); - this.b = this.buffer.getShort(Byte.BYTES + Short.BYTES * 4); - this.teTimer = this.buffer.getLong(Byte.BYTES + Short.BYTES * 5); - this.decayTime = this.buffer.getLong(Byte.BYTES + Short.BYTES * 5 + Long.BYTES); - } - } - - public boolean canInteractWith(EntityPlayer player) { - return true; - } - - // Handle shift-clicking - @Override - public ItemStack transferStackInSlot(EntityPlayer player, int id) { - Slot slot = (Slot) this.inventorySlots.get(id); - ItemStack stack = slot.getStack(); - if (stack == null) return null; - if (slot instanceof RadioSlot) return super.transferStackInSlot(player, id); - else if (BWRecipes.instance.getMappingsFor(BWRecipes.RADHATCH).containsInput(stack)) - return super.transferStackInSlot(player, id); - else return null; - } - - private static class RadioSlot extends Slot { - public RadioSlot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) { - super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_); - } - - @Override - public boolean isItemValid(ItemStack stack) { - return BWRecipes.instance.getMappingsFor(BWRecipes.RADHATCH).containsInput(stack); - } - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java deleted file mode 100644 index 1ebf203610..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.server.container.Slots; - -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class BW_DelSlot extends Slot { - public BW_DelSlot() { - super(new InventoryPlayer(null), 0, 80, 17); - } - - @SuppressWarnings("ALL") - public void putStack(ItemStack p_75215_1_) { - p_75215_1_ = null; - this.onSlotChanged(); - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java deleted file mode 100644 index 0cc1cf956b..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.server.container.Slots; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntityFurnace; - -public class BW_FuelSlot extends Slot { - public BW_FuelSlot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) { - super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_); - } - - @Override - public boolean isItemValid(ItemStack itemStack) { - return TileEntityFurnace.getItemBurnTime(itemStack) > 0; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index a0e2f1ae4b..1b95d363df 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -25,11 +25,17 @@ package com.github.bartimaeusnek.bartworks.util; import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; import static com.github.bartimaeusnek.bartworks.util.BW_Util.specialToByte; +import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import com.gtnewhorizons.modularui.api.drawable.IDrawable; +import com.gtnewhorizons.modularui.api.math.Pos2d; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_OreDictUnificator; @@ -38,6 +44,7 @@ import gregtech.api.util.GT_Utility; import ic2.core.Ic2Items; import ic2.core.item.ItemFluidCell; import java.util.*; +import java.util.function.Supplier; import javax.annotation.Nonnegative; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; @@ -45,6 +52,7 @@ import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; +import org.jetbrains.annotations.Nullable; public class BWRecipes { @@ -71,57 +79,88 @@ public class BWRecipes { "", true, false // special handler - ); - private final BacteriaVatRecipeMap sBacteriaVat = new BacteriaVatRecipeMap( - new HashSet<>(50), - "bw.recipe.BacteriaVat", - StatCollector.translateToLocal("tile.biovat.name"), - null, - "gregtech:textures/gui/basicmachines/Default", - 6, - 2, - 0, - 1, - 1, - " Sievert: ", - 1, - " Sv", - true, - false // special handler - ); - private final BW_Recipe_Map_LiquidFuel sAcidGenFuels = new BW_Recipe_Map_LiquidFuel( - new HashSet<>(10), - "bw.fuels.acidgens", - StatCollector.translateToLocal("tile.acidgenerator.name"), - null, - "gregtech:textures/gui/basicmachines/Default", - 1, - 1, - 1, - 1, - 1, - "EU generated: ", - 1000, - "", - false, - true); - private final BWRecipes.SpecialObjectSensitiveMap sCircuitAssemblyLineMap = new SpecialObjectSensitiveMap( - new HashSet<>(60), - "bw.recipe.cal", - "Circuit Assembly Line", - null, - "gregtech:textures/gui/basicmachines/Default", - 6, - 6, - 1, - 1, - 1, - "", - 1, - "", - true, - true // special handler - ); + ) { + @Nullable + @Override + public IDrawable getOverlayForSlot(boolean isFluid, boolean isOutput, int index, boolean isSpecial) { + if (!isFluid && !isOutput && !isSpecial) { + switch (index) { + case 0: + return BW_UITextures.OVERLAY_SLOT_DISH; + case 1: + return BW_UITextures.OVERLAY_SLOT_DNA_FLASK; + case 2: + return GT_UITextures.OVERLAY_SLOT_CIRCUIT; + case 3: + return GT_UITextures.OVERLAY_SLOT_MOLECULAR_1; + case 4: + return GT_UITextures.OVERLAY_SLOT_MOLECULAR_2; + case 5: + return GT_UITextures.OVERLAY_SLOT_DATA_ORB; + } + } else if (isFluid && !isOutput) { + return GT_UITextures.OVERLAY_SLOT_VIAL_2; + } else if (isSpecial) { + return BW_UITextures.OVERLAY_SLOT_MODULE; + } + return super.getOverlayForSlot(isFluid, isOutput, index, false); + } + }.setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE) + .setLogo(BW_UITextures.PICTURE_BW_LOGO_47X21) + .setLogoPos(125, 3) + .setLogoSize(47, 21); + private final GT_Recipe.GT_Recipe_Map sBacteriaVat = new BacteriaVatRecipeMap( + new HashSet<>(50), + "bw.recipe.BacteriaVat", + StatCollector.translateToLocal("tile.biovat.name"), + null, + "gregtech:textures/gui/basicmachines/Default", + 6, + 2, + 0, + 1, + 1, + " Sievert: ", + 1, + " Sv", + true, + false // special handler + ) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE); + private final GT_Recipe.GT_Recipe_Map sAcidGenFuels = new BW_Recipe_Map_LiquidFuel( + new HashSet<>(10), + "bw.fuels.acidgens", + StatCollector.translateToLocal("tile.acidgenerator.name"), + null, + "gregtech:textures/gui/basicmachines/Default", + 1, + 1, + 1, + 1, + 1, + "EU generated: ", + 1000, + "", + false, + true) + .useModularUI(true); + private final GT_Recipe.GT_Recipe_Map sCircuitAssemblyLineMap = new SpecialObjectSensitiveMap( + new HashSet<>(60), + "bw.recipe.cal", + "Circuit Assembly Line", + null, + "gregtech:textures/gui/basicmachines/Default", + 6, + 1, + 1, + 1, + 1, + "", + 1, + "", + true, + true) + .setProgressBar(GT_UITextures.PROGRESSBAR_CIRCUIT_ASSEMBLER); private final GT_Recipe.GT_Recipe_Map sRadHatch = new GT_Recipe.GT_Recipe_Map( new HashSet<>(150), "bw.recipe.radhatch", @@ -138,7 +177,19 @@ public class BWRecipes { "", false, false // special handler - ); + ) { + @Override + public void addProgressBarUI( + ModularWindow.Builder builder, Supplier progressSupplier, Pos2d windowOffset) { + builder.widget(new DrawableWidget() + .setDrawable(BW_UITextures.PICTURE_RADIATION) + .setPos(new Pos2d(74, 20).add(windowOffset)) + .setSize(29, 27)); + } + }.setSlotOverlay(false, false, BW_UITextures.OVERLAY_SLOT_ROD) + .setLogo(BW_UITextures.PICTURE_BW_LOGO_47X21) + .setLogoPos(118, 55) + .setLogoSize(47, 21); /** * @param machine 0 = biolab; 1 = BacterialVat; 2 = sAcidGenFuels; 3 = circuitAssemblyLine diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java index fd69d50483..80c52c56a3 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java @@ -24,7 +24,6 @@ package com.github.bartimaeusnek.crossmod.openComputers; import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; -import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; import com.github.bartimaeusnek.bartworks.API.SideReference; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; @@ -47,7 +46,7 @@ import net.minecraft.tileentity.TileEntity; @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers") public class TileEntity_GTDataServer extends TileEntity - implements ISidedInventory, ITileWithGUI, ITileAddsInformation, ITileHasDifferentTextureSides, SimpleComponent { + implements ISidedInventory, ITileAddsInformation, ITileHasDifferentTextureSides, SimpleComponent { private final BiMap OrbDataBase = HashBiMap.create(); @@ -134,11 +133,6 @@ public class TileEntity_GTDataServer extends TileEntity @Override public void registerBlockIcons(IIconRegister par1IconRegister) {} - @Override - public int getGUIID() { - return 0; - } - @Override public int[] getAccessibleSlotsFromSide(int p_94128_1_) { return new int[0]; diff --git a/src/main/resources/assets/bartworks/textures/GT2/gui/Destructopack.png b/src/main/resources/assets/bartworks/textures/GT2/gui/Destructopack.png deleted file mode 100644 index 7c30308cc5..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/GT2/gui/Destructopack.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/GT2/gui/LESU.png b/src/main/resources/assets/bartworks/textures/GT2/gui/LESU.png deleted file mode 100644 index 837692be60..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/GT2/gui/LESU.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/GUI_CircuitP.png b/src/main/resources/assets/bartworks/textures/GUI/GUI_CircuitP.png deleted file mode 100644 index 6ec05f5f55..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/GUI/GUI_CircuitP.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/GUI_RSC.png b/src/main/resources/assets/bartworks/textures/GUI/GUI_RSC.png deleted file mode 100644 index dd561b81dd..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/GUI/GUI_RSC.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png b/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png deleted file mode 100644 index 9a340eca30..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/GUI/GUI_Windmill.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/GUIheatedPump.png b/src/main/resources/assets/bartworks/textures/GUI/GUIheatedPump.png deleted file mode 100644 index 62deeffa50..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/GUI/GUIheatedPump.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/RadHatch.png b/src/main/resources/assets/bartworks/textures/GUI/RadHatch.png deleted file mode 100644 index 12922890d2..0000000000 Binary files a/src/main/resources/assets/bartworks/textures/GUI/RadHatch.png and /dev/null differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/background/brown.png b/src/main/resources/assets/bartworks/textures/GUI/background/brown.png new file mode 100644 index 0000000000..2db03dff22 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/background/brown.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/background/circuit_programmer.png b/src/main/resources/assets/bartworks/textures/GUI/background/circuit_programmer.png new file mode 100644 index 0000000000..c14cfb78ae Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/background/circuit_programmer.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/overlay_slot/cross.png b/src/main/resources/assets/bartworks/textures/GUI/overlay_slot/cross.png new file mode 100644 index 0000000000..4244b6256b Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/overlay_slot/cross.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/overlay_slot/dish.png b/src/main/resources/assets/bartworks/textures/GUI/overlay_slot/dish.png new file mode 100644 index 0000000000..d051681c1e Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/overlay_slot/dish.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/overlay_slot/dna_flask.png b/src/main/resources/assets/bartworks/textures/GUI/overlay_slot/dna_flask.png new file mode 100644 index 0000000000..fb7483a9a7 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/overlay_slot/dna_flask.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/overlay_slot/module.png b/src/main/resources/assets/bartworks/textures/GUI/overlay_slot/module.png new file mode 100644 index 0000000000..5dc78c8271 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/overlay_slot/module.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/overlay_slot/rod.png b/src/main/resources/assets/bartworks/textures/GUI/overlay_slot/rod.png new file mode 100644 index 0000000000..ca3b11d69d Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/overlay_slot/rod.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/picture/bw_logo_47x21.png b/src/main/resources/assets/bartworks/textures/GUI/picture/bw_logo_47x21.png new file mode 100644 index 0000000000..34b2b59e0e Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/picture/bw_logo_47x21.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/picture/decay_time_container.png b/src/main/resources/assets/bartworks/textures/GUI/picture/decay_time_container.png new file mode 100644 index 0000000000..de259fc32a Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/picture/decay_time_container.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/picture/decay_time_inside.png b/src/main/resources/assets/bartworks/textures/GUI/picture/decay_time_inside.png new file mode 100644 index 0000000000..8b6425b8cf Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/picture/decay_time_inside.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/picture/radiation.png b/src/main/resources/assets/bartworks/textures/GUI/picture/radiation.png new file mode 100644 index 0000000000..c2f1271f62 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/picture/radiation.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/picture/radiation_shutter_frame.png b/src/main/resources/assets/bartworks/textures/GUI/picture/radiation_shutter_frame.png new file mode 100644 index 0000000000..e5cf55abd4 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/picture/radiation_shutter_frame.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/picture/radiation_shutter_inside.png b/src/main/resources/assets/bartworks/textures/GUI/picture/radiation_shutter_inside.png new file mode 100644 index 0000000000..eb908f863a Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/picture/radiation_shutter_inside.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/picture/sievert_container.png b/src/main/resources/assets/bartworks/textures/GUI/picture/sievert_container.png new file mode 100644 index 0000000000..fc6478c29f Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/picture/sievert_container.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/picture/stored_eu_frame.png b/src/main/resources/assets/bartworks/textures/GUI/picture/stored_eu_frame.png new file mode 100644 index 0000000000..4a54ac5781 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/picture/stored_eu_frame.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/picture/windmill_empty.png b/src/main/resources/assets/bartworks/textures/GUI/picture/windmill_empty.png new file mode 100644 index 0000000000..f9e55beeb9 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/picture/windmill_empty.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/picture/windmill_rotating.png b/src/main/resources/assets/bartworks/textures/GUI/picture/windmill_rotating.png new file mode 100644 index 0000000000..3840d7fd45 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/picture/windmill_rotating.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/progressbar/fuel.png b/src/main/resources/assets/bartworks/textures/GUI/progressbar/fuel.png new file mode 100644 index 0000000000..0dfe303cf0 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/progressbar/fuel.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/progressbar/sievert.png b/src/main/resources/assets/bartworks/textures/GUI/progressbar/sievert.png new file mode 100644 index 0000000000..7a324ebf38 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/progressbar/sievert.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/progressbar/stored_eu_116.png b/src/main/resources/assets/bartworks/textures/GUI/progressbar/stored_eu_116.png new file mode 100644 index 0000000000..b302f4e89e Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/progressbar/stored_eu_116.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/slot/brown.png b/src/main/resources/assets/bartworks/textures/GUI/slot/brown.png new file mode 100644 index 0000000000..4d8405e02c Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/slot/brown.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/tab/title_angular_brown.png b/src/main/resources/assets/bartworks/textures/GUI/tab/title_angular_brown.png new file mode 100644 index 0000000000..73893b9036 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/tab/title_angular_brown.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/tab/title_brown.png b/src/main/resources/assets/bartworks/textures/GUI/tab/title_brown.png new file mode 100644 index 0000000000..d5c9ae0825 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/tab/title_brown.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/tab/title_dark_brown.png b/src/main/resources/assets/bartworks/textures/GUI/tab/title_dark_brown.png new file mode 100644 index 0000000000..5b3c3edec0 Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/tab/title_dark_brown.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.BioLab.png b/src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.BioLab.png deleted file mode 100644 index eb72a755d6..0000000000 Binary files a/src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.BioLab.png and /dev/null differ diff --git a/src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.Radioactive.png b/src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.Radioactive.png deleted file mode 100644 index 9c6f03f8ed..0000000000 Binary files a/src/main/resources/assets/gregtech/textures/gui/basicmachines/BW.GUI.Radioactive.png and /dev/null differ -- cgit From 1ba0be9f2746403843082589b75fe3353d71b4e4 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Mon, 5 Dec 2022 13:34:58 +0800 Subject: fix IOOBE in bio vat (#241) Former-commit-id: 344a9899f5bb84dd966add9b097382ddf3e9e4c1 --- .../common/tileentities/multis/GT_TileEntity_BioVat.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index cbfd68b39b..6d3ec8383c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -88,7 +88,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa private int mSievert; private int mNeededSievert; private int mCasing = 0; - private int mExpectedTimes = 0; + private int mExpectedMultiplier = 0; private int mTimes = 0; public GT_TileEntity_BioVat(int aID, String aName, String aNameRegional) { @@ -222,7 +222,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa * @param needEqual if the recipeFluidOutput should be equal to the fluid in the output hatch * @return the expected output multiplier */ - private int getExpectedTimes(@Nullable FluidStack recipeFluidOutput, boolean needEqual) { + private int getExpectedMultiplier(@Nullable FluidStack recipeFluidOutput, boolean needEqual) { FluidStack storedFluidOutputs = this.getStoredFluidOutputs(); if (storedFluidOutputs == null) return 1; if (!needEqual || storedFluidOutputs.isFluidEqual(recipeFluidOutput)) { @@ -319,10 +319,10 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa final FluidStack recipeFluidOutput = gtRecipe.getFluidOutput(0); final FluidStack recipeFluidInput = gtRecipe.mFluidInputs[0]; - this.mExpectedTimes = this.getExpectedTimes(recipeFluidOutput, true); + this.mExpectedMultiplier = this.getExpectedMultiplier(recipeFluidOutput, true); this.mTimes = 1; - for (int i = 1; i < this.mExpectedTimes; i++) { + for (int i = 1; i < this.mExpectedMultiplier; i++) { if (this.depleteInput(recipeFluidInput)) { this.mTimes++; } @@ -755,9 +755,13 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa final String[] baseInfoData = super.getInfoData(); final String[] infoData = new String[baseInfoData.length + 2]; System.arraycopy(baseInfoData, 0, infoData, 0, baseInfoData.length); + // See https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/11923 + // here we must check the machine is well-formed as otherwise getExpectedMultiplier might error out! infoData[infoData.length - 2] = StatCollector.translateToLocal("BW.infoData.BioVat.expectedProduction") + ": " + EnumChatFormatting.GREEN - + (mMaxProgresstime <= 0 ? getExpectedTimes(null, false) : mExpectedTimes) * 100 + + (mMachine + ? (mMaxProgresstime <= 0 ? getExpectedMultiplier(null, false) : mExpectedMultiplier) * 100 + : -1) + EnumChatFormatting.RESET + " %"; infoData[infoData.length - 1] = StatCollector.translateToLocal("BW.infoData.BioVat.production") + ": " + EnumChatFormatting.GREEN -- cgit From 2d35e3100ddf25f107e9a398a3db50e2f84d0ab3 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Wed, 7 Dec 2022 18:43:29 +0800 Subject: put fluid lang key in gregtech.lang (#242) Former-commit-id: 519a2a5f31d06587401e9df88cf26a65bc7ea1d8 --- .../bartimaeusnek/bartworks/system/material/WerkstoffLoader.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index c2cf281663..1ddf4a90e8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1743,6 +1743,7 @@ public class WerkstoffLoader { (GT_Fluid) new GT_Fluid(werkstoff.getDefaultName(), "autogenerated", werkstoff.getRGBA()) .setGaseous(werkstoff.getStats().isGas()); FluidRegistry.registerFluid(fluid); + GT_LanguageManager.addStringLocalization(fluid.getUnlocalizedName(), werkstoff.getDefaultName()); WerkstoffLoader.fluids.put(werkstoff, fluid); } else { WerkstoffLoader.fluids.put(werkstoff, FluidRegistry.getFluid(werkstoff.getDefaultName())); @@ -1756,8 +1757,6 @@ public class WerkstoffLoader { if (werkstoff.getStats().getMeltingPoint() > 0) fluid = fluid.setTemperature(werkstoff.getStats().getMeltingPoint()); FluidRegistry.registerFluid(fluid); - // GT_LanguageManager.addStringLocalization("Molten." + werkstoff.getDefaultName(), "Molten "+ - // werkstoff.getDefaultName()); GT_LanguageManager.addStringLocalization( fluid.getUnlocalizedName(), "Molten " + werkstoff.getDefaultName()); WerkstoffLoader.molten.put(werkstoff, fluid); -- cgit From 895c26835484f2abd2a58114cda076cc70180633 Mon Sep 17 00:00:00 2001 From: Maxim Date: Thu, 8 Dec 2022 14:09:47 +0100 Subject: Fix NPE when using seperated input busses on MEBF (#243) * Fix NPE when using seperated input busses on MEBF * spotlessApply (#244) Co-authored-by: Maxim Co-authored-by: GitHub GTNH Actions <> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Former-commit-id: f001622f509d017476cb42830e2f13112a47defc --- .../tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 3a116ce85b..1402c4614a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -393,10 +393,11 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock tInputs = this.getStoredInputs().toArray(new ItemStack[0]); tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe( this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); - if (tRecipe == null) return false; } } + if (tRecipe == null) return false; + ArrayList outputItems = new ArrayList<>(); ArrayList outputFluids = new ArrayList<>(); -- cgit From 70c6945c945ad54220e56fe2a3bc160ecadcdcfa Mon Sep 17 00:00:00 2001 From: miozune Date: Sat, 10 Dec 2022 23:14:00 +0900 Subject: Add tooltip for remaining seconds for radio hatch (#245) * Add tooltip for remaining seconds for radio hatch * Add space Former-commit-id: 98a3e97b40c98745223e9a47e52e262b79108999 --- .../tiered/GT_MetaTileEntity_RadioHatch.java | 22 +++++++++++++++++----- .../resources/assets/bartworks/lang/en_US.lang | 1 + 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 851e49e3e4..6a63ae7dd0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -62,6 +62,7 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; +import java.util.Collections; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -370,7 +371,20 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem .draw(new Pos2d(0, 48 - height), new Size(16, height), partialTicks); } } - }.setPos(124, 18).setSize(16, 48)) + }.dynamicTooltip(() -> Collections.singletonList(StatCollector.translateToLocalFormatted( + "tooltip.tile.radhatch.10.name", + timer <= 1 ? 0 : (decayTime - timer) / 20, + timer <= 1 ? 0 : decayTime / 20))) + .setPos(124, 18) + .setSize(16, 48) + .attachSyncer( + new FakeSyncWidget.LongSyncer(() -> decayTime, val -> decayTime = val), + builder, + (widget, val) -> widget.notifyTooltipChange()) + .attachSyncer( + new FakeSyncWidget.LongSyncer(() -> timer, val -> timer = val), + builder, + (widget, val) -> widget.notifyTooltipChange())) .widget(new FakeSyncWidget.ShortSyncer(() -> colorForGUI[0], val -> colorForGUI[0] = val)) .widget(new FakeSyncWidget.ShortSyncer(() -> colorForGUI[1], val -> colorForGUI[1] = val)) .widget(new FakeSyncWidget.ShortSyncer(() -> colorForGUI[2], val -> colorForGUI[2] = val)) @@ -378,14 +392,12 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem .setBackground(BW_UITextures.PICTURE_DECAY_TIME_CONTAINER) .setPos(120, 14) .setSize(24, 56)) - .widget(new FakeSyncWidget.LongSyncer(() -> decayTime, val -> decayTime = val)) - .widget(new FakeSyncWidget.LongSyncer(() -> timer, val -> timer = val)) .widget(TextWidget.dynamicString( () -> StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", mass)) .setTextAlignment(Alignment.Center) .setPos(65, 62)) - .widget(TextWidget.dynamicString( - () -> StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.0", sievert)) + .widget(TextWidget.dynamicString(() -> + StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.0", getSievert())) .setTextAlignment(Alignment.Center) .setPos(60, 72)) .widget(new ButtonWidget() diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 62e21aa642..5574af759c 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -133,6 +133,7 @@ tooltip.tile.radhatch.6.name=t tooltip.tile.radhatch.7.name=s tooltip.tile.radhatch.8.name=m tooltip.tile.radhatch.9.name=h +tooltip.tile.radhatch.10.name=Remaining: %s s / %s s tooltip.tile.acidgen.0.name=An Acid Generator tooltip.tile.acidgen.1.name=Creates Power from Chemical Energy Potentials. nei.biovat.0.name=Needs Glass Tier: -- cgit From 346b2b703af30bdd7db794a707d0c98858b563fc Mon Sep 17 00:00:00 2001 From: miozune Date: Wed, 14 Dec 2022 06:50:08 +0900 Subject: Migrate to ModularUI part 2 (#246) * Migrate to ModularUI part 2 * bad copy-paste Former-commit-id: 9cee6f273d6d9286d8b53d80248ae70d2c4f7f82 --- .../common/loaders/StaticRecipeChangeLoaders.java | 34 ++++++++++++---------- .../tileentities/multis/GT_TileEntity_HTGR.java | 31 ++++++++++---------- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 73f56dc0d0..71eb970abb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -36,10 +36,12 @@ import com.github.bartimaeusnek.bartworks.util.StreamUtils; import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.google.common.collect.ArrayListMultimap; +import com.gtnewhorizons.modularui.common.widget.ProgressBar; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; import gnu.trove.map.hash.TObjectDoubleHashMap; import gregtech.api.enums.*; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -604,21 +606,23 @@ public class StaticRecipeChangeLoaders { public static void addElectricImplosionCompressorRecipes() { if (eicMap == null) { eicMap = new GT_Recipe.GT_Recipe_Map( - new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), - "gt.recipe.electricimplosioncompressor", - "Electric Implosion Compressor", - (String) null, - "gregtech:textures/gui/basicmachines/Default", - 1, - 2, - 0, - 0, - 1, - "", - 1, - "", - true, - true); + new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), + "gt.recipe.electricimplosioncompressor", + "Electric Implosion Compressor", + (String) null, + "gregtech:textures/gui/basicmachines/Default", + 1, + 2, + 0, + 0, + 1, + "", + 1, + "", + true, + true) + .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_IMPLOSION) + .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT); GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream() .filter(e -> e.mInputs != null) .forEach(recipe -> eicMap.addRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 9c0fdecd74..ace13e1801 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -237,21 +237,22 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase .build(); public static final GT_Recipe.GT_Recipe_Map fakeRecipeMap = new GT_Recipe.GT_Recipe_Map( - new HashSet<>(), - "bw.recipe.htgr", - "High Temperature Gas-cooled Reactor", - null, - "gregtech:textures/gui/basicmachines/Default", - 1, - 1, - 1, - 0, - 1, - "", - 1, - "", - false, - false); + new HashSet<>(), + "bw.recipe.htgr", + "High Temperature Gas-cooled Reactor", + null, + "gregtech:textures/gui/basicmachines/Default", + 1, + 1, + 1, + 0, + 1, + "", + 1, + "", + false, + false) + .useModularUI(true); private static final int HELIUM_NEEDED = 730000; private static final int powerUsage = BW_Util.getMachineVoltageFromTier(6); private static final int maxcapacity = 720000; -- cgit From 8de914010c1743b57572af6de10fc046f89abea6 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Wed, 14 Dec 2022 14:14:59 +0800 Subject: fix thorium yttrium glass being recognized as HV glass (#247) Former-commit-id: cc432459a070b253b90931f62928a441fb8bc21b --- .../java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java index 35b6bb8f82..6390dcc19b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java @@ -61,11 +61,12 @@ public class BorosilicateGlass { Block block = getGlassBlock(); doRegister((byte) 3, block, 0, ret); doRegister((byte) 4, block, 1, ret); + doRegister((byte) 5, block, 12, ret); doRegister((byte) 5, block, 2, ret); doRegister((byte) 6, block, 3, ret); doRegister((byte) 7, block, 4, ret); doRegister((byte) 8, block, 5, ret); - for (int i = 6; i < 13; i++) { + for (int i = 6; i < 12; i++) { doRegister((byte) 3, block, i, ret); } doRegister((byte) 9, block, 13, ret); -- cgit From 18bdd470fea79ef3e111c48018eebfa7bac0d305 Mon Sep 17 00:00:00 2001 From: iouter <62897714+iouter@users.noreply.github.com> Date: Fri, 16 Dec 2022 21:31:24 +0800 Subject: Use new GT Fluid API (#248) * Use new GT Fluid API * spotlessApply (#249) Co-authored-by: iouter <62897714+iouter@users.noreply.github.com> Co-authored-by: GitHub GTNH Actions <> * molten * spotlessApply (#250) Co-authored-by: iouter <62897714+iouter@users.noreply.github.com> Co-authored-by: GitHub GTNH Actions <> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Former-commit-id: a79338de40ca9c0dd4b6a601cbec6ae7ef80bed7 --- .../bartworks/system/material/Werkstoff.java | 8 ++++++ .../bartworks/system/material/WerkstoffLoader.java | 33 +++++++++++++--------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index a0c5e63ef3..9de2ff0549 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -1287,6 +1287,14 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return (this.quality & 0x40) != 0; } + public FluidState getFluidState() { + if ((this.quality & 0x40) != 0) { + return FluidState.GAS; + } else { + return FluidState.LIQUID; + } + } + public Werkstoff.Stats setGas(boolean gas) { if (gas) this.quality = (byte) (this.quality | 0x40); else this.quality = (byte) (this.quality & 0b0111111); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 1ddf4a90e8..ef42104e64 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -51,9 +51,8 @@ import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.ProgressManager; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.*; +import gregtech.api.fluid.GT_FluidFactory; import gregtech.api.interfaces.ISubTagContainer; -import gregtech.api.objects.GT_Fluid; -import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; import gregtech.common.items.GT_MetaGenerated_Tool_01; import ic2.api.recipe.IRecipeInput; @@ -1739,11 +1738,13 @@ public class WerkstoffLoader { if (werkstoff.hasItemType(cell)) { if (!FluidRegistry.isFluidRegistered(werkstoff.getDefaultName())) { DebugLog.log("Adding new Fluid: " + werkstoff.getDefaultName()); - GT_Fluid fluid = - (GT_Fluid) new GT_Fluid(werkstoff.getDefaultName(), "autogenerated", werkstoff.getRGBA()) - .setGaseous(werkstoff.getStats().isGas()); - FluidRegistry.registerFluid(fluid); - GT_LanguageManager.addStringLocalization(fluid.getUnlocalizedName(), werkstoff.getDefaultName()); + Fluid fluid = GT_FluidFactory.builder(werkstoff.getDefaultName()) + .withLocalizedName(werkstoff.getDefaultName()) + .withStateAndTemperature(werkstoff.getStats().getFluidState(), 300) + .withColorRGBA(werkstoff.getRGBA()) + .withTextureName("autogenerated") + .buildAndRegister() + .asFluid(); WerkstoffLoader.fluids.put(werkstoff, fluid); } else { WerkstoffLoader.fluids.put(werkstoff, FluidRegistry.getFluid(werkstoff.getDefaultName())); @@ -1752,13 +1753,17 @@ public class WerkstoffLoader { if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { if (!FluidRegistry.isFluidRegistered("molten." + werkstoff.getDefaultName())) { DebugLog.log("Adding new Molten: " + werkstoff.getDefaultName()); - Fluid fluid = new GT_Fluid( - "molten." + werkstoff.getDefaultName(), "molten.autogenerated", werkstoff.getRGBA()); - if (werkstoff.getStats().getMeltingPoint() > 0) - fluid = fluid.setTemperature(werkstoff.getStats().getMeltingPoint()); - FluidRegistry.registerFluid(fluid); - GT_LanguageManager.addStringLocalization( - fluid.getUnlocalizedName(), "Molten " + werkstoff.getDefaultName()); + Fluid fluid = GT_FluidFactory.builder("molten." + werkstoff.getDefaultName()) + .withLocalizedName("Molten " + werkstoff.getDefaultName()) + .withStateAndTemperature( + FluidState.MOLTEN, + werkstoff.getStats().getMeltingPoint() > 0 + ? werkstoff.getStats().getMeltingPoint() + : 300) + .withColorRGBA(werkstoff.getRGBA()) + .withTextureName("molten.autogenerated") + .buildAndRegister() + .asFluid(); WerkstoffLoader.molten.put(werkstoff, fluid); } else { WerkstoffLoader.molten.put(werkstoff, FluidRegistry.getFluid(werkstoff.getDefaultName())); -- cgit From 6c0754925ee51bc8828b23533af946e4ee596d6d Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Mon, 19 Dec 2022 12:42:21 +0100 Subject: Make EIC animation only visual (#251) * ITS RENDERING ! * Ok * Stupid muffler upgrade * Fix * Fix Former-commit-id: 0b341e9b42530c41572a2b743f788cff4ffc653f --- .../client/renderer/BW_EICPistonVisualizer.java | 69 +++++++++++++++ .../bartworks/common/net/BW_Network.java | 3 +- .../bartworks/common/net/EICPacket.java | 56 +++++++++++++ .../GT_TileEntity_ElectricImplosionCompressor.java | 98 ++++++++++++++-------- 4 files changed, 192 insertions(+), 34 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/net/EICPacket.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java new file mode 100644 index 0000000000..4aebcab47a --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java @@ -0,0 +1,69 @@ +package com.github.bartimaeusnek.bartworks.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class BW_EICPistonVisualizer extends EntityFX { + + public BW_EICPistonVisualizer(World world, int x, int y, int z, int age) { + super(world, (double) x, ((double) y), (double) z); + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.particleMaxAge = age; + } + + @Override + public void onUpdate() { + if (this.particleAge++ >= this.particleMaxAge) this.setDead(); + } + + @Override + public void renderParticle( + Tessellator p_70539_1_, + float p_70539_2_, + float p_70539_3_, + float p_70539_4_, + float p_70539_5_, + float p_70539_6_, + float p_70539_7_) { + Tessellator tessellator = Tessellator.instance; + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDepthMask(false); + double f11 = this.prevPosX + (this.posX - this.prevPosX) * (double) p_70539_2_ - interpPosX; + double f12 = this.prevPosY + (this.posY - this.prevPosY) * (double) p_70539_2_ - interpPosY; + double f13 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double) p_70539_2_ - interpPosZ; + + RenderBlocks.getInstance().blockAccess = this.worldObj; + tessellator.setTranslation(f11 - this.posX, f12 - this.posY, f13 - this.posZ); + RenderBlocks.getInstance().setRenderFromInside(false); + RenderBlocks.getInstance() + .renderBlockUsingTexture( + GregTech_API.sBlockMetal5, + (int) this.posX, + (int) this.posY, + (int) this.posZ, + GregTech_API.sBlockMetal5.getIcon(0, 2)); + tessellator.setTranslation(0d, 0d, 0d); + + 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/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index 4ae8c10992..611c208456 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -63,7 +63,8 @@ public class BW_Network extends MessageToMessageCodec new CircuitProgrammerPacket(), new MetaBlockPacket(), new OreDictCachePacket(), - new ServerJoinedPackage() + new ServerJoinedPackage(), + new EICPacket() }; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EICPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EICPacket.java new file mode 100644 index 0000000000..b62d880c4c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EICPacket.java @@ -0,0 +1,56 @@ +package com.github.bartimaeusnek.bartworks.common.net; + +import com.github.bartimaeusnek.bartworks.API.SideReference; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; +import com.github.bartimaeusnek.bartworks.util.Coords; +import com.google.common.io.ByteArrayDataInput; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.net.GT_Packet_New; +import io.netty.buffer.ByteBuf; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; + +public class EICPacket extends GT_Packet_New { + private Coords coords; + private boolean bool; + + public EICPacket() { + super(true); + } + + public EICPacket(Coords coords, boolean bool) { + super(false); + this.coords = coords; + this.bool = bool; + } + + @Override + public byte getPacketID() { + return 5; + } + + @Override + public void encode(ByteBuf aOut) { + aOut.writeInt(coords.x); + aOut.writeInt(coords.y); + aOut.writeInt(coords.z); + aOut.writeBoolean(bool); + } + + @Override + public GT_Packet_New decode(ByteArrayDataInput aData) { + return new EICPacket(new Coords(aData.readInt(), aData.readInt(), aData.readInt()), aData.readBoolean()); + } + + @Override + public void process(IBlockAccess aWorld) { + if (SideReference.Side.Client) { + TileEntity te = aWorld.getTileEntity(coords.x, coords.y, coords.z); + if (!(te instanceof IGregTechTileEntity)) return; + IMetaTileEntity mte = ((IGregTechTileEntity) te).getMetaTileEntity(); + if (!(mte instanceof GT_TileEntity_ElectricImplosionCompressor)) return; + if (bool && !((IGregTechTileEntity) te).hasMufflerUpgrade()) ((IGregTechTileEntity) te).addMufflerUpgrade(); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index c643b3c23d..c3ef47c98a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -29,7 +29,11 @@ import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.client.renderer.BW_EICPistonVisualizer; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.net.EICPacket; +import com.github.bartimaeusnek.bartworks.util.Coords; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing; @@ -37,7 +41,10 @@ import com.gtnewhorizon.structurelib.structure.AutoPlaceEnvironment; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; +import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -49,6 +56,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import java.util.ArrayList; +import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChunkCoordinates; @@ -61,7 +69,7 @@ public class GT_TileEntity_ElectricImplosionCompressor public static GT_Recipe.GT_Recipe_Map eicMap; private static final boolean pistonEnabled = !ConfigHandler.disablePistonInEIC; private Boolean piston = true; - private static final String sound = GregTech_API.sSoundList.get(5); + private static final SoundResource sound = SoundResource.RANDOM_EXPLODE; private final ArrayList chunkCoordinates = new ArrayList<>(5); public GT_TileEntity_ElectricImplosionCompressor(int aID, String aName, String aNameRegional) { @@ -208,7 +216,6 @@ public class GT_TileEntity_ElectricImplosionCompressor .addInputBus("Any bottom casing", 1) .addInputHatch("Any bottom casing", 1) .addOutputBus("Any bottom casing", 1) - .addMaintenanceHatch("Any bottom casing", 1) .addEnergyHatch("Bottom and top middle", 2) .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; @@ -283,13 +290,25 @@ public class GT_TileEntity_ElectricImplosionCompressor public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (pistonEnabled && aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isActive() && aTick % 10 == 0) - togglePiston(aBaseMetaTileEntity); + if (pistonEnabled && aBaseMetaTileEntity.isActive() && aTick % 20 == 0) { + if (aBaseMetaTileEntity.isClientSide()) animatePiston(aBaseMetaTileEntity); + else if (aBaseMetaTileEntity.hasMufflerUpgrade()) + MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( + aBaseMetaTileEntity.getWorld(), + new EICPacket( + new Coords( + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord()), + true), + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getZCoord()); + } } @Override public void setExtendedFacing(ExtendedFacing newExtendedFacing) { - super.setExtendedFacing(newExtendedFacing); + super.setExtendedFacing(newExtendedFacing); // Will call stopMachine updateChunkCoordinates(); } @@ -300,46 +319,52 @@ public class GT_TileEntity_ElectricImplosionCompressor } public void stopMachine() { - if (pistonEnabled) this.resetPiston(); + this.resetPiston(); super.stopMachine(); } private void resetPiston() { + if (!pistonEnabled) return; IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); if (!aBaseMetaTileEntity.isServerSide()) return; - if (!this.piston && this.mMachine) { + if (!this.piston) { chunkCoordinates.forEach(c -> aBaseMetaTileEntity.getWorld().setBlock(c.posX, c.posY, c.posZ, GregTech_API.sBlockMetal5, 2, 3)); this.piston = !this.piston; } } - private void togglePiston(IGregTechTileEntity aBaseMetaTileEntity) { - if (aBaseMetaTileEntity.getWorld().isRemote) return; + private void activatePiston() { + if (!pistonEnabled) return; + IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); + if (!aBaseMetaTileEntity.isServerSide()) return; if (this.piston) { - for (ChunkCoordinates c : chunkCoordinates) { - if (aBaseMetaTileEntity.getBlock(c.posX, c.posY, c.posZ) != GregTech_API.sBlockMetal5 - || aBaseMetaTileEntity.getMetaID(c.posX, c.posY, c.posZ) != 2) { - this.explodeMultiblock(); - return; - } - aBaseMetaTileEntity.getWorld().setBlockToAir(c.posX, c.posY, c.posZ); - } - - } else { - chunkCoordinates.forEach(c -> - aBaseMetaTileEntity.getWorld().setBlock(c.posX, c.posY, c.posZ, GregTech_API.sBlockMetal5, 2, 3)); - if (!getBaseMetaTileEntity().hasMufflerUpgrade()) - GT_Utility.sendSoundToPlayers( - aBaseMetaTileEntity.getWorld(), - sound, - 1f, - 1f, - chunkCoordinates.get(0).posX, - chunkCoordinates.get(0).posY, - chunkCoordinates.get(0).posZ); + chunkCoordinates.forEach(c -> aBaseMetaTileEntity.getWorld().setBlockToAir(c.posX, c.posY, c.posZ)); + this.piston = !this.piston; } - this.piston = !this.piston; + } + + private void animatePiston(IGregTechTileEntity aBaseMetaTileEntity) { + if (!aBaseMetaTileEntity.getWorld().isRemote) return; + + if (!getBaseMetaTileEntity().hasMufflerUpgrade()) + GT_Utility.doSoundAtClient( + sound, + 10, + 1f, + 1f, + chunkCoordinates.get(0).posX, + chunkCoordinates.get(0).posY, + chunkCoordinates.get(0).posZ); + chunkCoordinates.forEach(c -> { + spawnVisualPistonBlock(aBaseMetaTileEntity.getWorld(), c.posX, c.posY, c.posZ, 10); + }); + } + + @SideOnly(Side.CLIENT) + private void spawnVisualPistonBlock(World world, int x, int y, int z, int age) { + BW_EICPistonVisualizer pistonVisualizer = new BW_EICPistonVisualizer(world, x, y, z, age); + Minecraft.getMinecraft().effectRenderer.addEffect(pistonVisualizer); } @Override @@ -356,8 +381,15 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - if (!checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0)) return false; - return this.mMaintenanceHatches.size() == 1 && this.mEnergyHatches.size() == 2; + boolean isOK = checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0); + isOK = isOK && this.mMaintenanceHatches.size() == 1 && this.mEnergyHatches.size() == 2; + if (isOK) { + activatePiston(); + return true; + } else { + resetPiston(); + return false; + } } @Override -- cgit From 14d878af5ad43181de40ce6d41db6d250b879e3b Mon Sep 17 00:00:00 2001 From: miozune Date: Tue, 20 Dec 2022 03:00:49 +0900 Subject: Add configuration circuit to mixer recipes for Ruridit and Rhodium-Plated Palladium (#253) Former-commit-id: 74b4b025a28f90e41432ed4179c271c1efc3693d --- .../bartimaeusnek/bartworks/system/material/WerkstoffLoader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index ef42104e64..e58033fd0b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1312,7 +1312,7 @@ public class WerkstoffLoader { .onlyDust() .addMolten() .addMetalItems() - .addMixerRecipes() + .addMixerRecipes((short) 1) .addSimpleMetalWorkingItems() .addCraftingMetalWorkingItems() .addMultipleIngotMetalWorkingItems(), @@ -1352,7 +1352,7 @@ public class WerkstoffLoader { .onlyDust() .addMolten() .addMetalItems() - .addMixerRecipes() + .addMixerRecipes((short) 1) .addSimpleMetalWorkingItems() .addCraftingMetalWorkingItems() .addMultipleIngotMetalWorkingItems(), -- cgit From de6ee59646975b4353dd839185d1e166526fed19 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Thu, 29 Dec 2022 23:38:35 +0100 Subject: Add flowers to EIG (#254) * Add flowers to EIG * There are custom handlers now Former-commit-id: ed1e0053dbbc1b30497f85111fda61e1469357e2 --- .../multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index b9123478e5..020137ea39 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -56,6 +56,7 @@ import ic2.core.Ic2Items; import ic2.core.crop.TileEntityCrop; import java.util.*; import net.minecraft.block.Block; +import net.minecraft.block.BlockFlower; import net.minecraft.block.BlockStem; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; @@ -758,7 +759,16 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse Item i = input.getItem(); Block b = null; boolean detectedCustomHandler = false; - // There will be custom handlers here some day + // Custom handlers + // FLOWERS // + Block bb = Block.getBlockFromItem(i); + if (bb == Blocks.air) bb = null; + if (bb instanceof BlockFlower) { + detectedCustomHandler = true; + needsreplanting = false; + customDrops = new ArrayList<>(Collections.singletonList(input.copy())); + customDrops.get(0).stackSize = 1; + } if (!detectedCustomHandler) { if (i instanceof IPlantable) { if (i instanceof ItemSeeds) b = ((ItemSeeds) i).getPlant(world, 0, 0, 0); -- cgit From 9e023c309dbd8ed04375923db1080406b1380efd Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Tue, 3 Jan 2023 17:53:10 +0100 Subject: Add enchanced GUI to EIG (#255) * Add enchanced GUI to EIG * Spawn 1 render entity instead of 8 * Spawn 1 render entity instead of 5 in EIC * Spelling * Dont overshot Former-commit-id: e99544ed0539a5f04084c4f9d693ca63442a9b3d --- .../client/renderer/BW_CropVisualizer.java | 20 +- .../client/renderer/BW_EICPistonVisualizer.java | 50 ++- .../bartworks/common/net/BW_Network.java | 3 +- .../bartworks/common/net/EIGPacket.java | 56 +++ .../GT_TileEntity_ElectricImplosionCompressor.java | 11 +- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 380 +++++++++++++++++++-- 6 files changed, 474 insertions(+), 46 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/net/EIGPacket.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java index ed710e18de..58ef11827a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java @@ -13,16 +13,16 @@ import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class BW_CropVisualizer extends EntityFX { - int meta; + int[] meta = new int[8]; static Field tessellatorHasBrightnessField = null; - public BW_CropVisualizer(World world, int x, int y, int z, int meta, int age) { + public BW_CropVisualizer(World world, int x, int y, int z, int age) { super(world, (double) x, ((double) y - 0.0625d), (double) z); this.prevPosX = this.posX; this.prevPosY = this.posY; this.prevPosZ = this.posZ; this.particleMaxAge = age; - this.meta = meta; + for (int i = 0; i < 8; i++) this.meta[i] = this.rand.nextInt(8); } @Override @@ -42,9 +42,6 @@ public class BW_CropVisualizer extends EntityFX { Tessellator tessellator = Tessellator.instance; GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDepthMask(false); - double f11 = this.prevPosX + (this.posX - this.prevPosX) * (double) p_70539_2_ - interpPosX; - double f12 = this.prevPosY + (this.posY - this.prevPosY) * (double) p_70539_2_ - interpPosY; - double f13 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double) p_70539_2_ - interpPosZ; try { if (tessellatorHasBrightnessField == null) { tessellatorHasBrightnessField = Tessellator.class.getDeclaredField( @@ -58,7 +55,16 @@ public class BW_CropVisualizer extends EntityFX { throw new RuntimeException(e); } tessellator.setColorRGBA(255, 255, 255, 255); - RenderBlocks.getInstance().renderBlockCropsImpl(Blocks.wheat, meta, f11, f12, f13); + double f12 = this.posY - interpPosY; + int i = 0; + for (int x = -1; x <= 1; x++) + for (int z = -1; z <= 1; z++) { + if (x == 0 && z == 0) continue; + double f11 = (this.posX + (double) x) - interpPosX; + double f13 = (this.posZ + (double) z) - interpPosZ; + RenderBlocks.getInstance().renderBlockCropsImpl(Blocks.wheat, meta[i++], f11, f12, f13); + } + GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDepthMask(true); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java index 4aebcab47a..01a08ed8a2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java @@ -6,6 +6,7 @@ import gregtech.api.GregTech_API; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; @@ -37,20 +38,49 @@ public class BW_EICPistonVisualizer extends EntityFX { Tessellator tessellator = Tessellator.instance; GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDepthMask(false); - double f11 = this.prevPosX + (this.posX - this.prevPosX) * (double) p_70539_2_ - interpPosX; - double f12 = this.prevPosY + (this.posY - this.prevPosY) * (double) p_70539_2_ - interpPosY; - double f13 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double) p_70539_2_ - interpPosZ; RenderBlocks.getInstance().blockAccess = this.worldObj; - tessellator.setTranslation(f11 - this.posX, f12 - this.posY, f13 - this.posZ); RenderBlocks.getInstance().setRenderFromInside(false); + + IIcon icon = GregTech_API.sBlockMetal5.getIcon(0, 2); + + double x = this.posX + 1; + double z = this.posZ; + + double f11 = x - interpPosX; + double f12 = this.posY - interpPosY; + double f13 = z - interpPosZ; + tessellator.setTranslation(f11 - x, f12 - this.posY, f13 - z); RenderBlocks.getInstance() - .renderBlockUsingTexture( - GregTech_API.sBlockMetal5, - (int) this.posX, - (int) this.posY, - (int) this.posZ, - GregTech_API.sBlockMetal5.getIcon(0, 2)); + .renderBlockUsingTexture(GregTech_API.sBlockMetal5, (int) x, (int) this.posY, (int) z, icon); + + x = this.posX - 1; + z = this.posZ; + + f11 = x - interpPosX; + f13 = z - interpPosZ; + tessellator.setTranslation(f11 - x, f12 - this.posY, f13 - z); + RenderBlocks.getInstance() + .renderBlockUsingTexture(GregTech_API.sBlockMetal5, (int) x, (int) this.posY, (int) z, icon); + + x = this.posX; + z = this.posZ + 1; + + f11 = x - interpPosX; + f13 = z - interpPosZ; + tessellator.setTranslation(f11 - x, f12 - this.posY, f13 - z); + RenderBlocks.getInstance() + .renderBlockUsingTexture(GregTech_API.sBlockMetal5, (int) x, (int) this.posY, (int) z, icon); + + x = this.posX; + z = this.posZ - 1; + + f11 = x - interpPosX; + f13 = z - interpPosZ; + tessellator.setTranslation(f11 - x, f12 - this.posY, f13 - z); + RenderBlocks.getInstance() + .renderBlockUsingTexture(GregTech_API.sBlockMetal5, (int) x, (int) this.posY, (int) z, icon); + tessellator.setTranslation(0d, 0d, 0d); GL11.glEnable(GL11.GL_CULL_FACE); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index 611c208456..212cc0ae20 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -64,7 +64,8 @@ public class BW_Network extends MessageToMessageCodec new MetaBlockPacket(), new OreDictCachePacket(), new ServerJoinedPackage(), - new EICPacket() + new EICPacket(), + new EIGPacket() }; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EIGPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EIGPacket.java new file mode 100644 index 0000000000..c65568530b --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EIGPacket.java @@ -0,0 +1,56 @@ +package com.github.bartimaeusnek.bartworks.common.net; + +import com.github.bartimaeusnek.bartworks.API.SideReference; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ExtremeIndustrialGreenhouse; +import com.github.bartimaeusnek.bartworks.util.Coords; +import com.google.common.io.ByteArrayDataInput; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.net.GT_Packet_New; +import io.netty.buffer.ByteBuf; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; + +public class EIGPacket extends GT_Packet_New { + private Coords coords; + private int mMaxSlots; + + public EIGPacket() { + super(true); + } + + public EIGPacket(Coords coords, int mMaxSlots) { + super(false); + this.coords = coords; + this.mMaxSlots = mMaxSlots; + } + + @Override + public byte getPacketID() { + return 6; + } + + @Override + public void encode(ByteBuf aOut) { + aOut.writeInt(coords.x); + aOut.writeInt(coords.y); + aOut.writeInt(coords.z); + aOut.writeInt(mMaxSlots); + } + + @Override + public GT_Packet_New decode(ByteArrayDataInput aData) { + return new EIGPacket(new Coords(aData.readInt(), aData.readInt(), aData.readInt()), aData.readInt()); + } + + @Override + public void process(IBlockAccess aWorld) { + if (SideReference.Side.Client) { + TileEntity te = aWorld.getTileEntity(coords.x, coords.y, coords.z); + if (!(te instanceof IGregTechTileEntity)) return; + IMetaTileEntity mte = ((IGregTechTileEntity) te).getMetaTileEntity(); + if (!(mte instanceof GT_TileEntity_ExtremeIndustrialGreenhouse)) return; + ((GT_TileEntity_ExtremeIndustrialGreenhouse) mte).mMaxSlots = this.mMaxSlots; + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index c3ef47c98a..17ddf53248 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -356,13 +356,16 @@ public class GT_TileEntity_ElectricImplosionCompressor chunkCoordinates.get(0).posX, chunkCoordinates.get(0).posY, chunkCoordinates.get(0).posZ); - chunkCoordinates.forEach(c -> { - spawnVisualPistonBlock(aBaseMetaTileEntity.getWorld(), c.posX, c.posY, c.posZ, 10); - }); + spawnVisualPistonBlocks( + aBaseMetaTileEntity.getWorld(), + chunkCoordinates.get(2).posX, + chunkCoordinates.get(2).posY, + chunkCoordinates.get(2).posZ, + 10); } @SideOnly(Side.CLIENT) - private void spawnVisualPistonBlock(World world, int x, int y, int z, int age) { + private void spawnVisualPistonBlocks(World world, int x, int y, int z, int age) { BW_EICPistonVisualizer pistonVisualizer = new BW_EICPistonVisualizer(world, x, y, z, age); Minecraft.getMinecraft().effectRenderer.addEffect(pistonVisualizer); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index 020137ea39..e51b099e49 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -25,12 +25,24 @@ import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.renderer.BW_CropVisualizer; +import com.github.bartimaeusnek.bartworks.common.net.EIGPacket; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import com.github.bartimaeusnek.bartworks.util.Coords; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import com.gtnewhorizons.modularui.api.ModularUITextures; +import com.gtnewhorizons.modularui.api.drawable.IDrawable; +import com.gtnewhorizons.modularui.api.drawable.ItemDrawable; +import com.gtnewhorizons.modularui.api.drawable.Text; +import com.gtnewhorizons.modularui.api.math.Color; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.api.widget.Widget; +import com.gtnewhorizons.modularui.common.widget.*; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -38,6 +50,7 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -54,12 +67,16 @@ import ic2.api.crops.CropCard; import ic2.api.crops.Crops; import ic2.core.Ic2Items; import ic2.core.crop.TileEntityCrop; +import java.io.IOException; import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; import net.minecraft.block.Block; import net.minecraft.block.BlockFlower; import net.minecraft.block.BlockStem; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.InventoryCrafting; @@ -79,10 +96,11 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse private static final boolean debug = false; private static final int EIG_MATH_VERSION = 0; + private static final int CONFIGURATION_WINDOW_ID = 999; private int oldVersion = 0; private int mCasing = 0; - private int mMaxSlots = 0; + public int mMaxSlots = 0; private int setupphase = 1; private boolean isIC2Mode = false; private byte glasTier = 0; @@ -161,18 +179,18 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { if (this.mMaxProgresstime > 0) { - GT_Utility.sendChatToPlayer(aPlayer, "You cant change IC2 mode if the machine is working!"); + GT_Utility.sendChatToPlayer(aPlayer, "You can't change IC2 mode if the machine is working!"); return; } if (!mStorage.isEmpty()) { - GT_Utility.sendChatToPlayer(aPlayer, "You cant change IC2 mode if there are seeds inside!"); + GT_Utility.sendChatToPlayer(aPlayer, "You can't change IC2 mode if there are seeds inside!"); return; } this.isIC2Mode = !this.isIC2Mode; GT_Utility.sendChatToPlayer(aPlayer, "IC2 mode is now " + (this.isIC2Mode ? "enabled" : "disabled.")); } else { if (this.mMaxProgresstime > 0) { - GT_Utility.sendChatToPlayer(aPlayer, "You cant enable/disable setup if the machine is working!"); + GT_Utility.sendChatToPlayer(aPlayer, "You can't enable/disable setup if the machine is working!"); return; } this.setupphase++; @@ -302,8 +320,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse } @SideOnly(Side.CLIENT) - public void spawnVisualCrop(World world, int x, int y, int z, int meta, int age) { - BW_CropVisualizer crop = new BW_CropVisualizer(world, x, y, z, meta, age); + public void spawnVisualCrops(World world, int x, int y, int z, int age) { + BW_CropVisualizer crop = new BW_CropVisualizer(world, x, y, z, age); Minecraft.getMinecraft().effectRenderer.addEffect(crop); } @@ -312,25 +330,27 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isClientSide()) { if (aBaseMetaTileEntity.isActive() && aTick % 40 == 0) { - for (int x = -1; x <= 1; x++) - for (int z = -1; z <= 1; z++) { - if (x == 0 && z == 0) continue; - int[] abc = new int[] {x, -2, z + 2}; - int[] xyz = new int[] {0, 0, 0}; - this.getExtendedFacing().getWorldOffset(abc, xyz); - xyz[0] += aBaseMetaTileEntity.getXCoord(); - xyz[1] += aBaseMetaTileEntity.getYCoord(); - xyz[2] += aBaseMetaTileEntity.getZCoord(); - spawnVisualCrop( - aBaseMetaTileEntity.getWorld(), - xyz[0], - xyz[1], - xyz[2], - aBaseMetaTileEntity.getRandomNumber(8), - 40); - } + int[] abc = new int[] {0, -2, 2}; + int[] xyz = new int[] {0, 0, 0}; + this.getExtendedFacing().getWorldOffset(abc, xyz); + xyz[0] += aBaseMetaTileEntity.getXCoord(); + xyz[1] += aBaseMetaTileEntity.getYCoord(); + xyz[2] += aBaseMetaTileEntity.getZCoord(); + spawnVisualCrops(aBaseMetaTileEntity.getWorld(), xyz[0], xyz[1], xyz[2], 40); } } + if (aBaseMetaTileEntity.isServerSide()) { + MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( + aBaseMetaTileEntity.getWorld(), + new EIGPacket( + new Coords( + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord()), + mMaxSlots), + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getZCoord()); + } } @Override @@ -369,7 +389,10 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse if (setupphase == 1) { List inputs = getStoredInputs(); - for (ItemStack input : inputs) addCrop(input); + for (ItemStack input : inputs) { + addCrop(input); + if (mStorage.size() >= mMaxSlots) break; + } } else if (setupphase == 2) { int emptySlots = 0; boolean ignoreEmptiness = false; @@ -514,6 +537,315 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse return false; } + @Override + public boolean useModularUI() { + return true; + } + + private final Function isFixed = widget -> getIdealStatus() == getRepairStatus() && mMachine; + + private static final Function toggleButtonBackgroundGetter = val -> { + if (val == 0) return new IDrawable[] {GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CROSS}; + else return new IDrawable[] {GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CHECKMARK}; + }; + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.widget(new DrawableWidget() + .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setPos(7, 4) + .setSize(143, 75) + .setEnabled(widget -> !isFixed.apply(widget))); + + buildContext.addSyncedWindow(CONFIGURATION_WINDOW_ID, this::createConfigurationWindow); + EntityPlayer player = buildContext.getPlayer(); + + // Slot is not needed + + builder.widget(new DynamicPositionedColumn() + .setSynced(false) + .widget(new CycleButtonWidget() + .setToggle(() -> getBaseMetaTileEntity().isAllowedToWork(), works -> { + if (works) getBaseMetaTileEntity().enableWorking(); + else getBaseMetaTileEntity().disableWorking(); + + if (!(player instanceof EntityPlayerMP)) return; + String tChat = GT_Utility.trans("090", "Machine Processing: ") + + (works + ? GT_Utility.trans("088", "Enabled") + : GT_Utility.trans("087", "Disabled")); + if (hasAlternativeModeText()) tChat = getAlternativeModeText(); + GT_Utility.sendChatToPlayer(player, tChat); + }) + .addTooltip(0, new Text("Disabled").color(Color.RED.dark(3))) + .addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3))) + .setVariableBackgroundGetter(toggleButtonBackgroundGetter) + .setSize(18, 18) + .addTooltip("Working status")) + .widget(new ButtonWidget() + .setOnClick((clickData, widget) -> { + if (!widget.isClient()) widget.getContext().openSyncedWindow(CONFIGURATION_WINDOW_ID); + }) + .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CYCLIC) + .addTooltip("Configuration") + .setSize(18, 18)) + .setPos(151, 4)); + + final List drawables = new ArrayList<>(mMaxSlots); + final int perRow = 7; + + Scrollable cropsContainer = new Scrollable().setVerticalScroll(); + + if (mMaxSlots > 0) + for (int i = 0, imax = ((mMaxSlots - 1) / perRow); i <= imax; i++) { + DynamicPositionedRow row = new DynamicPositionedRow().setSynced(false); + for (int j = 0, jmax = (i == imax ? (mMaxSlots - 1) % perRow : (perRow - 1)); j <= jmax; j++) { + final int finalI = i * perRow; + final int finalJ = j; + final int ID = finalI + finalJ; + row.widget(new ButtonWidget() + .setOnClick((clickData, widget) -> { + if (!(player instanceof EntityPlayerMP)) return; + if (mStorage.size() <= ID) return; + if (this.mMaxProgresstime > 0) { + GT_Utility.sendChatToPlayer(player, "Can't eject while running !"); + return; + } + GreenHouseSlot removed = mStorage.remove(ID); + addOutput(removed.input); + GT_Utility.sendChatToPlayer(player, "Crop ejected !"); + }) + .setBackground(() -> new IDrawable[] { + getBaseMetaTileEntity().getGUITextureSet().getItemSlot(), + new ItemDrawable(drawables.size() > ID ? drawables.get(ID) : null) + .withFixedSize(16, 16, 1, 1) + }) + .dynamicTooltip(() -> { + if (drawables.size() > ID) + return Arrays.asList( + drawables.get(ID).getDisplayName(), + "Amount: " + drawables.get(ID).stackSize, + EnumChatFormatting.GRAY + "Left click to eject"); + return Collections.emptyList(); + }) + .setSize(18, 18)); + } + cropsContainer.widget(row.setPos(0, i * 18).setEnabled(widget -> { + int y = widget.getPos().y; + int cy = cropsContainer.getVerticalScrollOffset(); + int ch = cropsContainer.getVisibleHeight(); + return y >= cy - ch && y <= cy + ch; + })); + } + cropsContainer.attachSyncer( + new FakeSyncWidget.ListSyncer<>( + () -> mStorage.stream().map(s -> s.input).collect(Collectors.toList()), + l -> { + drawables.clear(); + drawables.addAll(l); + }, + (buffer, i) -> { + try { + buffer.writeItemStackToBuffer(i); + } catch (IOException e) { + throw new RuntimeException(e); + } + }, + buffer -> { + try { + return buffer.readItemStackFromBuffer(); + } catch (IOException e) { + throw new RuntimeException(e); + } + }), + builder); + + builder.widget(cropsContainer.setPos(10, 16).setSize(128, 60)); + + final DynamicPositionedColumn screenElements = new DynamicPositionedColumn(); + drawTexts(screenElements, null); + builder.widget(screenElements); + } + + protected ModularWindow createConfigurationWindow(final EntityPlayer player) { + ModularWindow.Builder builder = ModularWindow.builder(200, 100); + builder.setBackground(ModularUITextures.VANILLA_BACKGROUND); + builder.widget(new DrawableWidget() + .setDrawable(GT_UITextures.OVERLAY_BUTTON_CYCLIC) + .setPos(5, 5) + .setSize(16, 16)) + .widget(new TextWidget("Configuration").setPos(25, 9)) + .widget(ButtonWidget.closeWindowButton(true).setPos(185, 3)) + .widget(new Column() + .widget(new CycleButtonWidget() + .setLength(3) + .setGetter(() -> setupphase) + .setSetter(val -> { + if (!(player instanceof EntityPlayerMP)) return; + if (this.mMaxProgresstime > 0) { + GT_Utility.sendChatToPlayer( + player, "You can't enable/disable setup if the machine is working!"); + return; + } + this.setupphase = val; + GT_Utility.sendChatToPlayer( + player, + "EIG is now running in " + + (this.setupphase == 1 + ? "setup mode (input)." + : (this.setupphase == 2 + ? "setup mode (output)." + : "normal operation."))); + }) + .addTooltip(0, new Text("Operating").color(Color.GREEN.dark(3))) + .addTooltip(1, new Text("Input").color(Color.YELLOW.dark(3))) + .addTooltip(2, new Text("Output").color(Color.YELLOW.dark(3))) + .setVariableBackgroundGetter(i -> new IDrawable[] { + ModularUITextures.VANILLA_BACKGROUND, + GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18), + i == 0 + ? new Text("Operating") + .color(Color.GREEN.dark(3)) + .withFixedSize(70 - 18, 18, 15, 0) + : i == 1 + ? new Text("Input") + .color(Color.YELLOW.dark(3)) + .withFixedSize(70 - 18, 18, 15, 0) + : new Text("Output") + .color(Color.YELLOW.dark(3)) + .withFixedSize(70 - 18, 18, 15, 0) + }) + .setSize(70, 18) + .addTooltip("Setup mode")) + .widget(new CycleButtonWidget() + .setLength(2) + .setGetter(() -> isIC2Mode ? 1 : 0) + .setSetter(val -> { + if (!(player instanceof EntityPlayerMP)) return; + if (this.mMaxProgresstime > 0) { + GT_Utility.sendChatToPlayer( + player, "You can't change IC2 mode if the machine is working!"); + return; + } + if (!mStorage.isEmpty()) { + GT_Utility.sendChatToPlayer( + player, "You can't change IC2 mode if there are seeds inside!"); + return; + } + this.isIC2Mode = val == 1; + GT_Utility.sendChatToPlayer( + player, "IC2 mode is now " + (this.isIC2Mode ? "enabled" : "disabled.")); + }) + .addTooltip(0, new Text("Disabled").color(Color.RED.dark(3))) + .addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3))) + .setVariableBackgroundGetter(i -> new IDrawable[] { + ModularUITextures.VANILLA_BACKGROUND, + GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18), + i == 0 + ? new Text("Disabled") + .color(Color.RED.dark(3)) + .withFixedSize(70 - 18, 18, 15, 0) + : new Text("Enabled") + .color(Color.GREEN.dark(3)) + .withFixedSize(70 - 18, 18, 15, 0) + }) + .setSize(70, 18) + .addTooltip("IC2 mode")) + .widget(new CycleButtonWidget() + .setLength(2) + .setGetter(() -> isNoHumidity ? 1 : 0) + .setSetter(val -> { + if (!(player instanceof EntityPlayerMP)) return; + isNoHumidity = val == 1; + GT_Utility.sendChatToPlayer( + player, "Give incoming crops no humidity " + isNoHumidity); + }) + .addTooltip(0, new Text("Disabled").color(Color.RED.dark(3))) + .addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3))) + .setVariableBackgroundGetter(i -> new IDrawable[] { + ModularUITextures.VANILLA_BACKGROUND, + GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18), + i == 0 + ? new Text("Disabled") + .color(Color.RED.dark(3)) + .withFixedSize(70 - 18, 18, 15, 0) + : new Text("Enabled") + .color(Color.GREEN.dark(3)) + .withFixedSize(70 - 18, 18, 15, 0) + }) + .setSize(70, 18) + .addTooltip("No Humidity mode")) + .setEnabled(widget -> !getBaseMetaTileEntity().isActive()) + .setPos(10, 30)) + .widget(new Column() + .widget(new TextWidget("Setup mode").setSize(100, 18)) + .widget(new TextWidget("IC2 mode").setSize(100, 18)) + .widget(new TextWidget("No Humidity mode").setSize(100, 18)) + .setEnabled(widget -> !getBaseMetaTileEntity().isActive()) + .setPos(80, 30)) + .widget(new DrawableWidget() + .setDrawable(GT_UITextures.OVERLAY_BUTTON_CROSS) + .setSize(18, 18) + .setPos(10, 30) + .addTooltip(new Text("Can't change configuration when running !").color(Color.RED.dark(3))) + .setEnabled(widget -> getBaseMetaTileEntity().isActive())); + return builder.build(); + } + + @Override + protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inventorySlot) { + screenElements.setSynced(false).setSpace(0).setPos(10, 7); + + screenElements.widget(new DynamicPositionedRow() + .setSynced(false) + .widget(new TextWidget("Status: ").setDefaultColor(COLOR_TEXT_GRAY.get())) + .widget(new DynamicTextWidget(() -> { + if (getBaseMetaTileEntity().isActive()) return new Text("Working !").color(Color.GREEN.dark(3)); + else if (getBaseMetaTileEntity().isAllowedToWork()) + return new Text("Enabled").color(Color.GREEN.dark(3)); + else if (getBaseMetaTileEntity().wasShutdown()) + return new Text("Shutdown (CRITICAL)").color(Color.RED.dark(3)); + else return new Text("Disabled").color(Color.RED.dark(3)); + })) + .setEnabled(isFixed)); + + screenElements + .widget(new TextWidget(GT_Utility.trans("132", "Pipe is loose.")) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> !mWrench)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> mWrench, val -> mWrench = val)); + screenElements + .widget(new TextWidget(GT_Utility.trans("133", "Screws are loose.")) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> !mScrewdriver)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> mScrewdriver, val -> mScrewdriver = val)); + screenElements + .widget(new TextWidget(GT_Utility.trans("134", "Something is stuck.")) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> !mSoftHammer)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> mSoftHammer, val -> mSoftHammer = val)); + screenElements + .widget(new TextWidget(GT_Utility.trans("135", "Platings are dented.")) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> !mHardHammer)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> mHardHammer, val -> mHardHammer = val)); + screenElements + .widget(new TextWidget(GT_Utility.trans("136", "Circuitry burned out.")) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> !mSolderingTool)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> mSolderingTool, val -> mSolderingTool = val)); + screenElements + .widget(new TextWidget(GT_Utility.trans("137", "That doesn't belong there.")) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> !mCrowbar)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> mCrowbar, val -> mCrowbar = val)); + screenElements + .widget(new TextWidget(GT_Utility.trans("138", "Incomplete Structure.")) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> !mMachine)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val)); + } + @Override public String[] getInfoData() { List info = new ArrayList<>(Arrays.asList( -- cgit From 71c95c98a094895743d628c944a43b64e58d5522 Mon Sep 17 00:00:00 2001 From: miozune Date: Wed, 4 Jan 2023 02:01:19 +0900 Subject: Move NEI handlers to new recipemap methods (#256) Former-commit-id: 957958aec407d1613200aaae8958904f54a5229a --- dependencies.gradle | 2 +- .../tileentities/multis/GT_TileEntity_HTGR.java | 2 +- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 93 +--------------------- .../bartworks/neiHandler/BW_NEI_HTGRHandler.java | 23 ------ .../neiHandler/BW_NEI_RadHatchHandler.java | 49 ------------ .../bartworks/neiHandler/NEI_BW_Config.java | 3 - .../bartimaeusnek/bartworks/util/BWRecipes.java | 33 +++++++- 7 files changed, 32 insertions(+), 173 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_HTGRHandler.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_RadHatchHandler.java diff --git a/dependencies.gradle b/dependencies.gradle index bf9bf42c0a..59ce54381d 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.148:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.195:dev") compile("com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev") compile("com.github.GTNewHorizons:TecTech:5.0.52:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.3.14-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index ace13e1801..aa63d8958d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -251,7 +251,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase 1, "", false, - false) + true) .useModularUI(true); private static final int HELIUM_NEEDED = 730000; private static final int powerUsage = BW_Util.getMachineVoltageFromTier(6); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index 2a2e2102ca..fbf30a9350 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -27,24 +27,18 @@ import codechicken.nei.recipe.GuiCraftingRecipe; import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; import com.github.bartimaeusnek.bartworks.common.items.LabParts; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.GT_Mod; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; import gregtech.nei.GT_NEI_DefaultHandler; import java.awt.*; import java.util.Collections; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { public BW_NEI_BioVatHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { super(aRecipeMap); - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect( - new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier())); if (!NEI_BW_Config.sIsAdded) { FMLInterModComms.sendRuntimeMessage( GT_Values.GT, @@ -56,96 +50,11 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { } } + @Override public TemplateRecipeHandler newInstance() { return new BW_NEI_BioVatHandler(this.mRecipeMap); } - public void drawExtras(int aRecipeIndex) { - int base = getDescriptionYOffset() - 2; - int[] lines = {base, base + 8, base + 16, base + 24, base + 32, base + 40, base + 48, base + 56, base + 64}; - int tEUt = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - int tDuration = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - String[] recipeDesc = - ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.getNeiDesc(); - int tSpecial; - if (recipeDesc == null) { - if (tEUt != 0) { - drawText( - 10, - lines[0], - this.trans("152", "Total: ") + GT_Utility.formatNumbers((long) tDuration * (long) tEUt) + " EU", - -16777216); - drawText( - 10, - lines[1], - this.trans("153", "Usage: ") + GT_Utility.formatNumbers(tEUt) + " EU/t", - -16777216); - if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText( - 10, - lines[2], - this.trans("154", "Voltage: ") + GT_Utility.formatNumbers(tEUt / this.mRecipeMap.mAmperage) - + " EU", - -16777216); - drawText( - 10, - lines[3], - this.trans("155", "Amperage: ") + GT_Utility.formatNumbers(this.mRecipeMap.mAmperage), - -16777216); - } else { - drawText(10, lines[2], this.trans("156", "Voltage: unspecified"), -16777216); - drawText(10, lines[3], this.trans("157", "Amperage: unspecified"), -16777216); - } - } - - if (tDuration > 0) { - drawText( - 10, - lines[4], - this.trans("158", "Time: ") - + GT_Utility.formatNumbers(0.05d * tDuration) - + this.trans("161", " secs"), - -16777216); - } - - tSpecial = - ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; - - int[] tSpecialA = GT_TileEntity_BioVat.specialValueUnpack(tSpecial); - - drawText(10, lines[5], StatCollector.translateToLocal("nei.biovat.0.name") + " " + tSpecialA[0], -16777216); - - if (tSpecialA[1] == -100 && GT_Mod.gregtechproxy.mLowGravProcessing) { - drawText(10, lines[7], this.trans("159", "Needs Low Gravity"), -16777216); - } else if (tSpecialA[1] == -200 && GT_Mod.gregtechproxy.mEnableCleanroom) { - drawText(10, lines[7], this.trans("160", "Needs Cleanroom"), -16777216); - } else if (tSpecialA[1] == -300 && GT_Mod.gregtechproxy.mEnableCleanroom) { - drawText(10, lines[7], this.trans("160.1", "Needs Cleanroom & LowGrav"), -16777216); - } else if (tSpecialA[1] == -400) { - drawText(10, lines[7], this.trans("216", "Deprecated Recipe"), -16777216); - } else if (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre) - || GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost)) { - drawText( - 10, - lines[6], - (tSpecialA[2] == 1 - ? StatCollector.translateToLocal("nei.biovat.1.name") - : StatCollector.translateToLocal("nei.biovat.2.name")) - + this.mRecipeMap.mNEISpecialValuePre - + GT_Utility.formatNumbers(tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier) - + this.mRecipeMap.mNEISpecialValuePost, - -16777216); - } - } else { - tSpecial = 0; - - for (String descLine : recipeDesc) { - drawText(10, 73 + 10 * tSpecial, descLine, -16777216); - ++tSpecial; - } - } - } - private void loadLabPartRecipes(ItemStack aResult) { for (CachedDefaultRecipe recipe : getCache()) { // dirty way of finding the special slot item diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_HTGRHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_HTGRHandler.java deleted file mode 100644 index 56ad735bcd..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_HTGRHandler.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.github.bartimaeusnek.bartworks.neiHandler; - -import codechicken.nei.recipe.GuiCraftingRecipe; -import codechicken.nei.recipe.GuiUsageRecipe; -import com.github.bartimaeusnek.bartworks.MainMod; -import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.api.util.GT_Recipe; -import gregtech.nei.GT_NEI_DefaultHandler; - -public class BW_NEI_HTGRHandler extends GT_NEI_DefaultHandler { - public BW_NEI_HTGRHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { - super(aRecipeMap); - if (!NEI_BW_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage( - MainMod.instance, - "NEIPlugins", - "register-crafting-handler", - "bartworks@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); - GuiCraftingRecipe.craftinghandlers.add(this); - GuiUsageRecipe.usagehandlers.add(this); - } - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_RadHatchHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_RadHatchHandler.java deleted file mode 100644 index 0ae2453934..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_RadHatchHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.github.bartimaeusnek.bartworks.neiHandler; - -import codechicken.nei.recipe.GuiCraftingRecipe; -import codechicken.nei.recipe.GuiUsageRecipe; -import codechicken.nei.recipe.TemplateRecipeHandler; -import com.github.bartimaeusnek.bartworks.MainMod; -import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.api.util.GT_Recipe; -import gregtech.nei.GT_NEI_DefaultHandler; -import net.minecraft.util.StatCollector; - -public class BW_NEI_RadHatchHandler extends GT_NEI_DefaultHandler { - - public BW_NEI_RadHatchHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { - super(aRecipeMap); - if (!NEI_BW_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage( - MainMod.instance, - "NEIPlugins", - "register-crafting-handler", - "bartworks@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); - GuiCraftingRecipe.craftinghandlers.add(this); - GuiUsageRecipe.usagehandlers.add(this); - } - } - - @Override - public TemplateRecipeHandler newInstance() { - return new BW_NEI_RadHatchHandler(this.mRecipeMap); - } - - @Override - public void drawExtras(int aRecipeIndex) { - GT_Recipe recipe = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe; - int radioLevel = recipe.mEUt; - int amount = recipe.mDuration; - long time = recipe.mSpecialValue; - int y = getDescriptionYOffset(); - drawText(10, y, StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.0", radioLevel), -16777216); - y += 10; - drawText(10, y, StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", amount), -16777216); - y += 10; - drawText( - 10, - y, - StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.2", time * amount / 20.0), - -16777216); - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index de9aa9b70b..f14b220e52 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -28,7 +28,6 @@ import codechicken.nei.api.IConfigureNEI; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import gregtech.api.enums.OrePrefixes; @@ -89,8 +88,6 @@ public class NEI_BW_Config implements IConfigureNEI { new BW_NEI_OreHandler(); new BW_NEI_BioVatHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BACTERIALVATBYTE)); new BW_NEI_BioLabHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BIOLABBYTE)); - new BW_NEI_RadHatchHandler(BWRecipes.instance.getMappingsFor(BWRecipes.RADHATCH)); - new BW_NEI_HTGRHandler(GT_TileEntity_HTGR.fakeRecipeMap); NEI_BW_Config.sIsAdded = true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 1b95d363df..25f4a0e523 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -28,6 +28,7 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Util.specialToByte; import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.api.math.Pos2d; import com.gtnewhorizons.modularui.api.screen.ModularWindow; @@ -41,6 +42,7 @@ import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gregtech.nei.NEIRecipeInfo; import ic2.core.Ic2Items; import ic2.core.item.ItemFluidCell; import java.util.*; @@ -126,7 +128,16 @@ public class BWRecipes { true, false // special handler ) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE); + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE) + .setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> { + int[] tSpecialA = GT_TileEntity_BioVat.specialValueUnpack(recipeInfo.recipe.mSpecialValue); + return Arrays.asList( + StatCollector.translateToLocal("nei.biovat.0.name") + " " + tSpecialA[0], + (tSpecialA[2] == 1 + ? StatCollector.translateToLocal("nei.biovat.1.name") + : StatCollector.translateToLocal("nei.biovat.2.name")) + + applyPrefixAndSuffix.apply(tSpecialA[3])); + }); private final GT_Recipe.GT_Recipe_Map sAcidGenFuels = new BW_Recipe_Map_LiquidFuel( new HashSet<>(10), "bw.fuels.acidgens", @@ -176,8 +187,7 @@ public class BWRecipes { 0, "", false, - false // special handler - ) { + true) { @Override public void addProgressBarUI( ModularWindow.Builder builder, Supplier progressSupplier, Pos2d windowOffset) { @@ -186,10 +196,25 @@ public class BWRecipes { .setPos(new Pos2d(74, 20).add(windowOffset)) .setSize(29, 27)); } + + @Override + protected void drawNEIEnergyInfo(NEIRecipeInfo recipeInfo) {} + + @Override + protected void drawNEIDurationInfo(NEIRecipeInfo recipeInfo) {} }.setSlotOverlay(false, false, BW_UITextures.OVERLAY_SLOT_ROD) .setLogo(BW_UITextures.PICTURE_BW_LOGO_47X21) .setLogoPos(118, 55) - .setLogoSize(47, 21); + .setLogoSize(47, 21) + .setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> { + int radioLevel = recipeInfo.recipe.mEUt; + int amount = recipeInfo.recipe.mDuration; + long time = recipeInfo.recipe.mSpecialValue; + return Arrays.asList( + StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.0", radioLevel), + StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", amount), + StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.2", time * amount / 20.0)); + }); /** * @param machine 0 = biolab; 1 = BacterialVat; 2 = sAcidGenFuels; 3 = circuitAssemblyLine -- cgit From a3a51c8e14351bacc232cf9620d775ccd5f730ef Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Fri, 6 Jan 2023 21:24:59 +0100 Subject: One step foil (#258) * addapt gt recipes * update dep file * update BS+SA Former-commit-id: c08935c941af4f9553b7abac32d717d0145ae2f2 --- build.gradle | 27 +++++++++++++----- dependencies.gradle | 32 +++++++++++----------- .../recipe/SimpleMetalLoader.java | 11 ++++++-- 3 files changed, 45 insertions(+), 25 deletions(-) diff --git a/build.gradle b/build.gradle index 89350b8a35..fa88ae1be7 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1669411416 +//version: 1671313514 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -31,7 +31,7 @@ buildscript { url 'https://maven.minecraftforge.net' } maven { - // GTNH ForgeGradle Fork + // GTNH ForgeGradle and ASM Fork name = "GTNH Maven" url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" } @@ -45,7 +45,9 @@ buildscript { } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:1.2.11' + //Overwrite the current ASM version to fix shading newer than java 8 applicatations. + classpath 'org.ow2.asm:asm-debug-all-custom:5.0.3' + classpath 'net.minecraftforge.gradle:ForgeGradle:1.2.13' } } plugins { @@ -278,7 +280,9 @@ minecraft { runDir = 'run' if (replaceGradleTokenInFile) { - replaceIn replaceGradleTokenInFile + for (f in replaceGradleTokenInFile.split(',')) { + replaceIn f + } if (gradleTokenModId) { replace gradleTokenModId, modId } @@ -330,6 +334,12 @@ repositories { name = "GTNH Maven" url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" } + if (usesMixinDebug.toBoolean()) { + maven { + name = "Fabric Maven" + url = "https://maven.fabricmc.net/" + } + } } } @@ -338,10 +348,13 @@ dependencies { annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3') annotationProcessor('com.google.guava:guava:24.1.1-jre') annotationProcessor('com.google.code.gson:gson:2.8.6') - annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.1:processor') + annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.3:processor') + if (usesMixinDebug.toBoolean()) { + runtimeOnly('org.jetbrains:intellij-fernflower:1.2.1.16') + } } if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { - compile('com.gtnewhorizon:gtnhmixins:2.1.1') + compile('com.gtnewhorizon:gtnhmixins:2.1.3') } } @@ -694,7 +707,7 @@ if (modrinthProjectId.size() != 0 && System.getenv("MODRINTH_TOKEN") != null) { } } if (usesMixins.toBoolean()) { - addModrinthDep("required", "version", "gtnhmixins") + addModrinthDep("required", "project", "gtnhmixins") } tasks.modrinth.dependsOn(build) tasks.publish.dependsOn(tasks.modrinth) diff --git a/dependencies.gradle b/dependencies.gradle index 59ce54381d..2f07a7bb64 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,50 +1,50 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.195:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.204:dev") compile("com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev") - compile("com.github.GTNewHorizons:TecTech:5.0.52:dev") - compile("com.github.GTNewHorizons:NotEnoughItems:2.3.14-GTNH:dev") - compile("com.github.GTNewHorizons:TinkersConstruct:1.9.4-GTNH:dev") - compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.5:dev") - compile("com.github.GTNewHorizons:CodeChickenCore:1.1.6:dev") - compile("com.github.GTNewHorizons:Galacticraft:3.0.47-GTNH:dev") { + compile("com.github.GTNewHorizons:TecTech:5.0.67:dev") + compile("com.github.GTNewHorizons:NotEnoughItems:2.3.20-GTNH:dev") + compile("com.github.GTNewHorizons:TinkersConstruct:1.9.11-GTNH:dev") + compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.6:dev") + compile("com.github.GTNewHorizons:CodeChickenCore:1.1.7:dev") + compile("com.github.GTNewHorizons:Galacticraft:3.0.62-GTNH:dev") { exclude group:"com.github.GTNewHorizons", module:"SpongePoweredMixin" exclude group:"com.github.GTNewHorizons", module:"SpongeMixins" } - compile("com.github.GTNewHorizons:ModularUI:1.0.23:dev") + compile("com.github.GTNewHorizons:ModularUI:1.0.38:dev") compile("com.github.GTNewHorizons:GalacticGregGT5:1.0.8:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") - compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-107-GTNH:dev") { + compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-134-GTNH:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:AppleCore:3.2.2:dev") { + compileOnly("com.github.GTNewHorizons:AppleCore:3.2.4:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:TinkersGregworks:master-SNAPSHOT:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.15:api") { + compileOnly("com.github.GTNewHorizons:ForestryMC:4.5.6:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:Railcraft:9.13.12:api") { + compileOnly("com.github.GTNewHorizons:Railcraft:9.13.14:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.47:api") { + compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.49:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:OpenComputers:1.7.5.32-GTNH:api") { + compileOnly("com.github.GTNewHorizons:OpenComputers:1.8.0.2-GTNH:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:BuildCraft:7.1.27:dev") { + compileOnly("com.github.GTNewHorizons:BuildCraft:7.1.28:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:ProjectRed:4.7.7-GTNH:dev") { + compileOnly("com.github.GTNewHorizons:ProjectRed:4.7.9-GTNH:dev") { transitive = false } runtime("com.github.GTNewHorizons:Yamcl:0.5.84:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java index 20ba0564ac..a2418deed6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java @@ -119,8 +119,15 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { werkstoff.get(plate), GT_Utility.getIntegratedCircuit(1), werkstoff.get(foil, 4), - (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), - 48); + (int) Math.max(werkstoff.getStats().getMass() * 1L, 1L), + 24); + + GT_Values.RA.addBenderRecipe( + werkstoff.get(ingot), + GT_Utility.getIntegratedCircuit(10), + werkstoff.get(foil, 4), + (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), + 24); GT_Values.RA.addForgeHammerRecipe( werkstoff.get(stick, 2), -- cgit From 302709099ae506ccee8f1183f89826b9472d0ad8 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Sat, 7 Jan 2023 13:02:07 +0100 Subject: Add Weed-EX 9000 consumption in EIG (#257) * Update GT5 * Add Weed-EX Consumption * Add info Former-commit-id: 381c787fa9f659b776ec48cc77f3ab7181399174 --- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index e51b099e49..7ddfca22b2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -49,6 +49,7 @@ import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; @@ -88,6 +89,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.IPlantable; +import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; @@ -105,10 +107,12 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse private boolean isIC2Mode = false; private byte glasTier = 0; private int waterusage = 0; + private int weedexusage = 0; private boolean isNoHumidity = false; private static final int CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; private static final Item forestryfertilizer = GameRegistry.findItem("Forestry", "fertilizerCompound"); + private static final Fluid weedex = Materials.WeedEX9000.mFluid; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { @@ -242,6 +246,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse .addInfo("Use screwdriver while sneaking to enable/disable IC2 mode") .addInfo("Use wire cutters to give incoming IC2 crops 0 humidity") .addInfo("Uses 1000L of water per crop per operation") + .addInfo("If there are >= 1000 crops -> Uses 1L of Weed-EX 9000 per crop per second") + .addInfo("Otherwise, around 1% of crops will die each operation") .addInfo("You can insert fertilizer each operation to get more drops (max +400%)") .addInfo("-------------------- SETUP MODE --------------------") .addInfo("Does not take power") @@ -424,7 +430,9 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse if (mStorage.isEmpty()) return false; waterusage = 0; + weedexusage = 0; for (GreenHouseSlot s : mStorage) waterusage += s.input.stackSize; + if (waterusage >= 1000) weedexusage = waterusage; waterusage *= 1000; List fluids = mInputHatches; @@ -454,6 +462,16 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse watercheck -= used; } + // weedex + if (weedexusage > 0 && !this.depleteInput(new FluidStack(weedex, isIC2Mode ? weedexusage * 5 : weedexusage))) { + IGregTechTileEntity baseMTE = this.getBaseMetaTileEntity(); + int tokill = baseMTE.getRandomNumber((int) ((double) weedexusage * 0.02d) + 1); + for (int i = 0; i < tokill; ) { + GreenHouseSlot removed = mStorage.remove(baseMTE.getRandomNumber(mStorage.size())); + i -= removed.input.stackSize; + } + } + // OVERCLOCK // FERTILIZER IDEA: // IC2 +10% per fertilizer per crop per operation @@ -855,6 +873,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse : ("Setup mode " + (setupphase == 1 ? "(input)" : "(output)"))) + EnumChatFormatting.RESET, "Uses " + waterusage + "L/operation of water", + "Uses " + weedexusage + "L/second of Weed-EX 9000", "Max slots: " + EnumChatFormatting.GREEN + this.mMaxSlots + EnumChatFormatting.RESET, "Used slots: " + ((mStorage.size() > mMaxSlots) ? EnumChatFormatting.RED : EnumChatFormatting.GREEN) + this.mStorage.size() + EnumChatFormatting.RESET)); -- cgit From 97df769701737dab869d5120aeadae5a8670c5c6 Mon Sep 17 00:00:00 2001 From: Maxim Date: Sat, 7 Jan 2023 13:31:29 +0100 Subject: Switched from internal OC calc function to new GT_OverclockCalculator (#259) * Switched from internal OC calc function to new GT_OverclockCalculator * Spotless * Removed try-catch Former-commit-id: 554533aa8c7a6f88dc2ef7e71d3dc583d02fc212 --- dependencies.gradle | 2 +- .../mega/GT_TileEntity_MegaBlastFurnace.java | 22 +++++++++------ .../mega/GT_TileEntity_MegaChemicalReactor.java | 13 +++++++-- .../mega/GT_TileEntity_MegaDistillTower.java | 11 ++++++-- .../mega/GT_TileEntity_MegaMultiBlockBase.java | 32 +++++++++++++++++++++- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 14 ++++++++-- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 13 +++++++-- 7 files changed, 88 insertions(+), 19 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 2f07a7bb64..5e437113a4 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.204:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.205:dev") compile("com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev") compile("com.github.GTNewHorizons:TecTech:5.0.67:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.3.20-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 1402c4614a..845ba95beb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -54,6 +54,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.*; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_OverclockCalculator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import java.util.*; @@ -429,22 +430,25 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - long actualEUT = precutRecipeVoltage * processed; + GT_OverclockCalculator calculator = new GT_OverclockCalculator() + .setRecipeEUt(tRecipe.mEUt) + .setParallel(processed) + .setDuration(tRecipe.mDuration) + .setEUt(nominalV) + .setRecipeHeat(tRecipe.mSpecialValue) + .setMultiHeat(mHeatingCapacity) + .enableHeatOC() + .enableHeatDiscount() + .calculate(); - byte overclockCount = - this.calculateOverclockedNessMultiInternal(actualEUT, tRecipe.mDuration, nominalV, false); + this.mMaxProgresstime = calculator.getDuration(); + this.lEUt = calculator.getConsumption(); // In case recipe is too OP for that machine if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) return false; if (this.lEUt > 0) this.lEUt = (-this.lEUt); - if (tHeatCapacityDivTiers > 0) { - this.mMaxProgresstime >>= - Math.min(tHeatCapacityDivTiers / 2, overclockCount); // extra free overclocking if possible - if (this.mMaxProgresstime < 1) this.mMaxProgresstime = 1; // no eu efficiency correction - } - if (mUseMultiparallelMode) { this.mMaxProgresstime = (int) Math.ceil(this.mMaxProgresstime * tBatchMultiplier); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index 5fe08809ff..8351b773de 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -50,6 +50,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_OverclockCalculator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import java.util.ArrayList; @@ -225,9 +226,17 @@ public class GT_TileEntity_MegaChemicalReactor this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - long actualEUT = (long) (tRecipe.mEUt) * processed; + GT_OverclockCalculator calculator = new GT_OverclockCalculator() + .setRecipeEUt(tRecipe.mEUt) + .setParallel(processed) + .setDuration(tRecipe.mDuration) + .setEUt(nominalV) + .enablePerfectOC() + .calculate(); + + this.mMaxProgresstime = calculator.getDuration(); + this.lEUt = calculator.getConsumption(); - calculatePerfectOverclockedNessMulti(actualEUT, tRecipe.mDuration, nominalV); // In case recipe is too OP for that machine if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) { return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 25d21399f8..85cfa191b1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -52,6 +52,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_OverclockCalculator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import java.util.ArrayList; @@ -594,9 +595,15 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - long actualEUT = (long) (tRecipe.mEUt) * processed; + GT_OverclockCalculator calculator = new GT_OverclockCalculator() + .setRecipeEUt(tRecipe.mEUt) + .setParallel(processed) + .setDuration(tRecipe.mDuration) + .setEUt(nominalV) + .calculate(); - calculateOverclockedNessMulti(actualEUT, tRecipe.mDuration, nominalV); + this.mMaxProgresstime = calculator.getDuration(); + this.lEUt = calculator.getConsumption(); // In case recipe is too OP for that machine if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java index a985814a2d..6374f59613 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java @@ -185,7 +185,18 @@ public abstract class GT_TileEntity_MegaMultiBlockBase 0) { -- cgit From 152020d020f02275cf9a9363b0bcfcbe25470b2d Mon Sep 17 00:00:00 2001 From: miozune Date: Mon, 9 Jan 2023 01:58:31 +0900 Subject: Fix Bacterial Vat NEI recognizing Petri Dish as output (#260) Former-commit-id: bae69eb3ab703005682200a36d9bed36014869f4 --- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index fbf30a9350..139d8607fa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -78,16 +78,4 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { super.loadUsageRecipes(aResult); } } - - @Override - public void loadCraftingRecipes(ItemStack aResult) { - if (aResult != null - && aResult.getItem() instanceof LabParts - && aResult.getItemDamage() < 3 - && aResult.getTagCompound() != null) { - loadLabPartRecipes(aResult); - } else { - super.loadCraftingRecipes(aResult); - } - } } -- cgit From 87584d9f0361525f9437acf828ff3b75a7716d4c Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Mon, 9 Jan 2023 03:01:50 +0800 Subject: prevent incorrect fluid from being forced into liquid air hatch (#261) * prevent incorrect fluid from being forced into liquid air hatch * Spotless apply for branch fix/restrictive-hatch-gui for #261 (#262) Co-authored-by: Glease <4586901+Glease@users.noreply.github.com> Co-authored-by: GitHub GTNH Actions <> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Former-commit-id: 96355205d1e00f596bb23514933e89355f8b71eb --- dependencies.gradle | 2 +- .../tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 5e437113a4..c2a0702cfc 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.205:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.207:dev") compile("com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev") compile("com.github.GTNewHorizons:TecTech:5.0.67:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.3.20-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java index 998b87a606..204fe62687 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java @@ -28,6 +28,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.util.GT_Utility; +import gregtech.common.gui.modularui.widget.FluidDisplaySlotWidget; import net.minecraftforge.fluids.FluidStack; public class GT_MetaTileEntity_CompressedFluidHatch extends GT_MetaTileEntity_Hatch_Input { @@ -56,4 +57,9 @@ public class GT_MetaTileEntity_CompressedFluidHatch extends GT_MetaTileEntity_Ha return new GT_MetaTileEntity_CompressedFluidHatch( this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } + + @Override + protected FluidDisplaySlotWidget createDrainableFluidSlot() { + return super.createDrainableFluidSlot().setEmptyCanFillFilter(f -> f == Materials.LiquidAir.mFluid); + } } -- cgit From 69e636b0102f4a95153ea386bd8d8d0c8d7666b6 Mon Sep 17 00:00:00 2001 From: miozune Date: Wed, 11 Jan 2023 02:23:15 +0900 Subject: Remove Universal Fluid Cells from recipes (#263) Former-commit-id: 6f82e9b3964288213fc21f3dd84267bf980af352 --- dependencies.gradle | 2 +- .../bartworks/common/loaders/FluidLoader.java | 14 +++++++++++--- .../tileentities/tiered/GT_MetaTileEntity_BioLab.java | 6 +++--- .../material/processingLoaders/AdditionalRecipes.java | 19 +++++++------------ .../bartimaeusnek/bartworks/util/BWRecipes.java | 3 ++- 5 files changed, 24 insertions(+), 20 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index c2a0702cfc..37ef834fde 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.207:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.211:dev") compile("com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev") compile("com.github.GTNewHorizons:TecTech:5.0.67:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.3.20-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index c1d149c29c..ba11127fe5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -36,7 +36,7 @@ import gregtech.api.enums.Materials; import gregtech.api.objects.GT_Fluid; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; -import ic2.core.item.ItemFluidCell; +import gregtech.common.items.GT_MetaGenerated_Item_98; import java.awt.*; import java.util.Arrays; import net.minecraft.block.Block; @@ -77,8 +77,16 @@ public class FluidLoader { FluidLoader.BioLabFluidCells = new ItemStack[FluidLoader.BioLabFluidMaterials.length]; for (int i = 0; i < FluidLoader.BioLabFluidMaterials.length; i++) { FluidRegistry.registerFluid(FluidLoader.BioLabFluidMaterials[i]); - FluidLoader.BioLabFluidCells[i] = - ItemFluidCell.getUniversalFluidCell(new FluidStack(FluidLoader.BioLabFluidMaterials[i], 1000)); + } + + GT_MetaGenerated_Item_98.FluidCell[] fluidCells = new GT_MetaGenerated_Item_98.FluidCell[] { + GT_MetaGenerated_Item_98.FluidCell.FLUORESCENT_DNA, + GT_MetaGenerated_Item_98.FluidCell.ENZYME_SOLUTION, + GT_MetaGenerated_Item_98.FluidCell.PENICILLIN, + GT_MetaGenerated_Item_98.FluidCell.POLYMERASE, + }; + for (int i = 0; i < fluidCells.length; i++) { + FluidLoader.BioLabFluidCells[i] = fluidCells[i].get(); } // BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index 2bba0d833e..f8fa74dce3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -258,7 +258,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { this.mOutputItems[0] = Outp; } else this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L); - this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(2L); + this.mOutputItems[1] = ItemList.Cell_Empty.get(2L); this.calculateOverclockedNess( BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); @@ -305,7 +305,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mOutputItems[0] = BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); } - this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); + this.mOutputItems[1] = ItemList.Cell_Empty.get(1L); this.calculateOverclockedNess( BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; @@ -344,7 +344,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { this.mOutputItems[0] = BioItemList.getPetriDish(bioCulture); } - this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); + this.mOutputItems[1] = ItemList.Cell_Empty.get(1L); this.calculateOverclockedNess( BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 6df9b03f4a..9774620098 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -39,11 +39,11 @@ import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.*; import gregtech.api.GregTech_API; import gregtech.api.enums.*; +import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; -import ic2.core.item.ItemFluidCell; import java.lang.reflect.Field; import java.util.Map; import net.minecraft.init.Items; @@ -109,7 +109,7 @@ public class AdditionalRecipes { FluidLoader.BioLabFluidCells[3], ItemList.Tool_DataOrb.get(1L) }, - new ItemStack[] {Outp, ItemList.Cell_Universal_Fluid.get(2L)}, + new ItemStack[] {Outp, ItemList.Cell_Empty.get(2L)}, BioItemList.mBioLabParts[1], new int[] {DNA.getChance(), 10000}, dnaFluid, @@ -136,7 +136,7 @@ public class AdditionalRecipes { new ItemStack[] { FluidLoader.BioLabFluidCells[1], BioItemList.getPlasmidCell(null), inp, inp2 }, - new ItemStack[] {stack, ItemList.Cell_Universal_Fluid.get(1L)}, + new ItemStack[] {stack, ItemList.Cell_Empty.get(1L)}, BioItemList.mBioLabParts[2], new int[] {DNA.getChance(), 10000}, dnaFluid, @@ -160,7 +160,7 @@ public class AdditionalRecipes { BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(Plasmid)), FluidLoader.BioLabFluidCells[2], }, - new ItemStack[] {stack, ItemList.Cell_Universal_Fluid.get(1L)}, + new ItemStack[] {stack, ItemList.Cell_Empty.get(1L)}, BioItemList.mBioLabParts[3], new int[] {10000, 10000}, new FluidStack[] {FluidRegistry.getFluidStack("ic2distilledwater", 1000)}, @@ -226,15 +226,10 @@ public class AdditionalRecipes { BioItemList.getPetriDish(null), fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Water.getCells(1) - : ItemFluidCell.getUniversalFluidCell( - FluidRegistry.getFluidStack("ic2distilledwater", 1000)) - }, - new ItemStack[] { - BioItemList.getPetriDish(bioCulture), - fluidStack.equals(Materials.Water.getFluid(1000L)) - ? Materials.Empty.getCells(1) - : ItemList.Cell_Universal_Fluid.get(1L) + : GT_Utility.getContainersFromFluid(GT_ModHandler.getDistilledWater(1000)) + .get(0) }, + new ItemStack[] {BioItemList.getPetriDish(bioCulture), Materials.Empty.getCells(1)}, null, new int[] {bioCulture.getChance(), 10000}, new FluidStack[] {new FluidStack(bioCulture.getFluid(), 1000)}, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 25f4a0e523..6c597ced06 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -36,6 +36,7 @@ import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.objects.GT_ItemStack; @@ -811,7 +812,7 @@ public class BWRecipes { public GT_Recipe addMoltenFuel(Materials M, int burn) { return super.addFuel( - ItemFluidCell.getUniversalFluidCell(M.getMolten(144L)), Ic2Items.FluidCell.copy(), burn); + GT_OreDictUnificator.get(OrePrefixes.cellMolten, M, 1), Materials.Empty.getCells(1), burn); } public GT_Recipe addLiquidFuel(FluidStack fluidStack, int burn) { -- cgit From 0ab242b0faf31226614e9bc31f4ae9b081bbb13d Mon Sep 17 00:00:00 2001 From: RaitGamerGR <70205464+RaitGamerGR@users.noreply.github.com> Date: Sun, 15 Jan 2023 01:06:06 +0300 Subject: Changed processing of Depleted "The Core" Cell (#264) * Changed "The Core" recipe * Small fix Former-commit-id: dea4166b4904037315ae9e6c62d9e6adb8dd6bf5 --- .../system/material/processingLoaders/AfterLuVTierEnhacement.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java index f1ac227c5e..f14acac2bc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java @@ -91,10 +91,10 @@ public class AfterLuVTierEnhacement { ItemList.Depleted_Naquadah_4.get(8), WerkstoffLoader.Zirconium.get(dust, 64), WerkstoffLoader.Zirconium.get(dust, 64), - null, - null, - null, - new int[] {10_000, 5_000, 5_000}, + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 48L), + new int[] {10_000, 5_000, 5_000, 10_000, 10_000, 10_000}, 2000, 8000); } -- cgit From 14a684e3cf336f9d2214e6e0903433806a784cae Mon Sep 17 00:00:00 2001 From: glowredman <35727266+glowredman@users.noreply.github.com> Date: Mon, 16 Jan 2023 23:38:53 +0100 Subject: Add Version Token Replacment for API (#266) * Change version token for main api * Enable version token replacement for api info Former-commit-id: ff47528934261eb0e57d871bb2c81867e806489c --- gradle.properties | 2 +- src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 973bce915d..6fa91ac230 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,7 +26,7 @@ developmentEnvironmentUserName = Developer # 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 = MainMod.java +replaceGradleTokenInFile = MainMod.java,API_REFERENCE.java gradleTokenModId = gradleTokenModName = gradleTokenVersion = GRADLETOKEN_VERSION diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java index 74c6a7c778..97de86473e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java @@ -22,5 +22,5 @@ package com.github.bartimaeusnek.bartworks.API; public final class API_REFERENCE { - public static final String VERSION = "@apiversion@"; + public static final String VERSION = "GRADLETOKEN_VERSION"; } -- cgit From cfa09c7ed0d172494461c22fdd2831d037c709a1 Mon Sep 17 00:00:00 2001 From: glowredman <35727266+glowredman@users.noreply.github.com> Date: Tue, 17 Jan 2023 08:05:58 +0100 Subject: Add modinfo for child mods (#265) * Update BWCore.java * Update mcmod.info Former-commit-id: 8ba5b13abb55d34186acbf589e1d262aab5c6d2a --- .../github/bartimaeusnek/bartworks/ASM/BWCore.java | 1 + src/main/resources/mcmod.info | 67 +++++++++++++++++----- 2 files changed, 54 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java index f4251f2cd5..c09bb3e77e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java @@ -54,6 +54,7 @@ public class BWCore extends DummyModContainer { metadata.version = "0.0.1"; metadata.authorList.add("bartimaeusnek"); metadata.dependants = this.getDependants(); + metadata.parent = MainMod.MOD_ID; } @Subscribe diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index f13aa2a23b..d2b71dd111 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,16 +1,55 @@ -[ { - "modid": "${modId}", - "name": "${modName}", - "description": "A Gregtech Addon.", - "version": "${modVersion}", - "mcversion": "${minecraftVersion}", - "url": "https://github.com/bartimaeusnek/bartworks", - "updateUrl": "", - "authorList": ["bartimaeusnek"], - "credits": "Gregorius Techneticies for making gregtech and allowing me to port his old stuff.\n Austin Appleby and Yonik Seeley for creating and putting the MurmurHash3 into the public domain.\n Spluff and EmeraldsEmerald for the Awesome Textures aswell.", - "logoFile": "", - "screenshots": [], - "dependencies": [] + "modListVersion": 2, + "modList": [{ + "modid": "${modId}", + "name": "${modName}", + "description": "A Gregtech Addon.", + "version": "${modVersion}", + "mcversion": "${minecraftVersion}", + "url": "https://github.com/bartimaeusnek/bartworks", + "updateUrl": "", + "authorList": ["bartimaeusnek"], + "credits": "Gregorius Techneticies for making gregtech and allowing me to port his old stuff.\n Austin Appleby and Yonik Seeley for creating and putting the MurmurHash3 into the public domain.\n Spluff and EmeraldsEmerald for the Awesome Textures aswell.", + "logoFile": "", + "screenshots": [], + "parent": "", + "requiredMods": [], + "dependencies": [], + "dependants": [], + "useDependencyInformation": true + },{ + "modid": "bartworkscrossmod", + "name": "BartWorks Mod Additions", + "description": "", + "version": "${modVersion}", + "mcversion": "${minecraftVersion}", + "url": "https://github.com/bartimaeusnek/bartworks", + "updateUrl": "", + "authorList": ["bartimaeusnek"], + "credits": "", + "logoFile": "", + "screenshots": [], + "parent": "bartworks", + "requiredMods": [], + "dependencies": [], + "dependants": [], + "useDependencyInformation": true + },{ + "modid": "bartworkscrossmodtgregworkscontainer", + "name": "BartWorks Mod Additions - TGregworks Container", + "description": "", + "version": "${modVersion}", + "mcversion": "${minecraftVersion}", + "url": "https://github.com/bartimaeusnek/bartworks", + "updateUrl": "", + "authorList": ["bartimaeusnek"], + "credits": "", + "logoFile": "", + "screenshots": [], + "parent": "bartworks", + "requiredMods": [], + "dependencies": [], + "dependants": [], + "useDependencyInformation": true + }] } -] -- cgit From db29de6794a229dff55b5361a7866fbf921ab28d Mon Sep 17 00:00:00 2001 From: miozune Date: Tue, 17 Jan 2023 19:50:11 +0900 Subject: Fix loading order (#267) * Update buildscript & dependencies * Set useDependencyInformation to false Former-commit-id: 93f055437b49cad56c15c1af6266a4f6c9d198d0 --- build.gradle | 17 +++++++++++------ dependencies.gradle | 5 +---- src/main/resources/mcmod.info | 6 +++--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index fa88ae1be7..2dc32c9f20 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1671313514 +//version: 1673027205 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -46,7 +46,7 @@ buildscript { } dependencies { //Overwrite the current ASM version to fix shading newer than java 8 applicatations. - classpath 'org.ow2.asm:asm-debug-all-custom:5.0.3' + classpath 'org.ow2.asm:asm-debug-all-custom:5.0.3' classpath 'net.minecraftforge.gradle:ForgeGradle:1.2.13' } } @@ -319,9 +319,13 @@ if (file('addon.gradle').exists()) { apply from: 'repositories.gradle' configurations { - implementation.extendsFrom(shadowImplementation) // TODO: remove after all uses are refactored - implementation.extendsFrom(shadowCompile) - implementation.extendsFrom(shadeCompile) + // TODO: remove Compile after all uses are refactored to Implementation + for (config in [shadowImplementation, shadowCompile, shadeCompile]) { + compileClasspath.extendsFrom(config) + runtimeClasspath.extendsFrom(config) + testCompileClasspath.extendsFrom(config) + testRuntimeClasspath.extendsFrom(config) + } } repositories { @@ -350,7 +354,8 @@ dependencies { annotationProcessor('com.google.code.gson:gson:2.8.6') annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.3:processor') if (usesMixinDebug.toBoolean()) { - runtimeOnly('org.jetbrains:intellij-fernflower:1.2.1.16') + runtimeClasspath('org.jetbrains:intellij-fernflower:1.2.1.16') + testRuntimeClasspath('org.jetbrains:intellij-fernflower:1.2.1.16') } } if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { diff --git a/dependencies.gradle b/dependencies.gradle index 37ef834fde..9111782b83 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -8,10 +8,7 @@ dependencies { compile("com.github.GTNewHorizons:TinkersConstruct:1.9.11-GTNH:dev") compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.6:dev") compile("com.github.GTNewHorizons:CodeChickenCore:1.1.7:dev") - compile("com.github.GTNewHorizons:Galacticraft:3.0.62-GTNH:dev") { - exclude group:"com.github.GTNewHorizons", module:"SpongePoweredMixin" - exclude group:"com.github.GTNewHorizons", module:"SpongeMixins" - } + compile("com.github.GTNewHorizons:Galacticraft:3.0.63-GTNH:dev") compile("com.github.GTNewHorizons:ModularUI:1.0.38:dev") compile("com.github.GTNewHorizons:GalacticGregGT5:1.0.8:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index d2b71dd111..a7205e0523 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -16,7 +16,7 @@ "requiredMods": [], "dependencies": [], "dependants": [], - "useDependencyInformation": true + "useDependencyInformation": false },{ "modid": "bartworkscrossmod", "name": "BartWorks Mod Additions", @@ -33,7 +33,7 @@ "requiredMods": [], "dependencies": [], "dependants": [], - "useDependencyInformation": true + "useDependencyInformation": false },{ "modid": "bartworkscrossmodtgregworkscontainer", "name": "BartWorks Mod Additions - TGregworks Container", @@ -50,6 +50,6 @@ "requiredMods": [], "dependencies": [], "dependants": [], - "useDependencyInformation": true + "useDependencyInformation": false }] } -- cgit From 921ef86ace548fce3a1de13380060b00db0af390 Mon Sep 17 00:00:00 2001 From: Elisis Date: Wed, 18 Jan 2023 19:07:59 +1100 Subject: Add plate & ingot types for Thorium-232 (#268) * Add plate & ingot types for Thorium-232 * spotlessApply (#269) Co-authored-by: Elisis Co-authored-by: GitHub GTNH Actions <> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Former-commit-id: ee526305b47f0602d0ca3d8be4a051cec828af42 --- .../bartworks/system/material/WerkstoffLoader.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index e58033fd0b..22265423e8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -595,9 +595,17 @@ public class WerkstoffLoader { new short[] {0, 64, 0, 0}, "Thorium 232", superscriptNumbers("Th232"), - new Werkstoff.Stats().setRadioactive(true), + new Werkstoff.Stats() + .setRadioactive(true) + .setBlastFurnace(true) + .setMass(232) + .setProtons(Element.Th.mProtons), Werkstoff.Types.ISOTOPE, - new Werkstoff.GenerationFeatures().disable().onlyDust().enforceUnification(), + new Werkstoff.GenerationFeatures() + .disable() + .onlyDust() + .addMetalItems() + .enforceUnification(), 30, TextureSet.SET_METALLIC // No Byproducts -- cgit From e8c4263f04632d505fbb5828b1bd5e9b9f825ace Mon Sep 17 00:00:00 2001 From: RIONDY 'POPlol333' Adam <76914762+POPlol333@users.noreply.github.com> Date: Thu, 19 Jan 2023 07:40:36 +0100 Subject: MCR_Aesthetic (#270) Former-commit-id: fb96ce1cf99b06f8fed03e693badd9c122a83024 --- .../tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index 8351b773de..c9e2a9d3f9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -322,7 +322,9 @@ public class GT_TileEntity_MegaChemicalReactor ofChain( TTEnabledEnergyHatchElement.INSTANCE.newAny(CASING_INDEX, 3), ofBlock(GregTech_API.sBlockCasings8, 0))) - .addElement('c', ofBlock(GregTech_API.sBlockCasings4, 7)) + .addElement( + 'c', + ofChain(ofBlock(GregTech_API.sBlockCasings4, 7), ofBlock(GregTech_API.sBlockCasings5, 13))) .addElement( 'g', BorosilicateGlass.ofBoroGlass( -- cgit From a5064b298efd9f0df2a39b225f7f42ba55dea9e4 Mon Sep 17 00:00:00 2001 From: miozune Date: Mon, 23 Jan 2023 01:44:24 +0900 Subject: Remove GT ASM (#271) * Remove GT ASM * Put into constructor Former-commit-id: 4324bf86a3e8e35967f2e8e6cc6c4041a49d5495 --- .../github/bartimaeusnek/bartworks/ASM/BWCore.java | 3 +- .../bartworks/ASM/BWCoreTransformer.java | 34 ++-------------------- .../github/bartimaeusnek/bartworks/MainMod.java | 4 +++ 3 files changed, 7 insertions(+), 34 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java index c09bb3e77e..331dc32534 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java @@ -62,7 +62,7 @@ public class BWCore extends DummyModContainer { shouldTransform[0] = ConfigHandler.enabledPatches[0]; shouldTransform[1] = ConfigHandler.enabledPatches[1]; shouldTransform[3] = ConfigHandler.enabledPatches[3]; - shouldTransform[4] = true; + shouldTransform[4] = false; shouldTransform[5] = ConfigHandler.enabledPatches[5]; shouldTransform[6] = ConfigHandler.enabledPatches[6]; // shouldTransform[6] = true; @@ -78,7 +78,6 @@ public class BWCore extends DummyModContainer { ret.add(new DefaultArtifactVersion("Thaumcraft", true)); ret.add(new DefaultArtifactVersion("miscutils", true)); ret.add(new DefaultArtifactVersion("RWG", true)); - ret.add(new DefaultArtifactVersion("gregtech", true)); ret.add(new DefaultArtifactVersion(MainMod.MOD_ID, true)); ret.add(new DefaultArtifactVersion(BartWorksCrossmod.MOD_ID, true)); return ret; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java index 5fdace3319..1120323d7c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java @@ -37,7 +37,7 @@ public class BWCoreTransformer implements IClassTransformer { "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS", "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", - "PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API", + "[UNUSED] PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API", "DUCTTAPING RWG WORLDEN FAILS", "PATCHING CRAFTING MANAGER FOR CACHING RECIPES" // "REMOVING 12% BONUS OUTPUTS FROM GT++ SIFTER" @@ -293,37 +293,7 @@ public class BWCoreTransformer implements IClassTransformer { } } case 4: { - BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - String name_deObfs = ""; - for (MethodNode toPatch : methods) { - if (ASMUtils.isCorrectMethod(toPatch, name_deObfs) && (toPatch.access & ACC_STATIC) != 0) { - BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); - InsnList nu = new InsnList(); - LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; - for (int j = 0; j < 2; j++) { - nu.add(toPatch.instructions.get(j)); - } - nu.add(new FieldInsnNode( - GETSTATIC, "gregtech/api/GregTech_API", "sBeforeGTPreload", "Ljava/util/List;")); - nu.add(new TypeInsnNode( - NEW, "com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload")); - nu.add(new InsnNode(DUP)); - nu.add(new MethodInsnNode( - INVOKESPECIAL, - "com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload", - "", - "()V", - false)); - nu.add(new MethodInsnNode( - INVOKEINTERFACE, "java/util/List", "add", "(Ljava/lang/Object;)Z", true)); - nu.add(new InsnNode(POP)); - for (int j = 2; j < toPatch.instructions.size(); j++) { - nu.add(toPatch.instructions.get(j)); - } - toPatch.instructions = nu; - break scase; - } - } + break; } case 5: { BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 13bff6e0d6..3dc2ef474e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -92,6 +92,10 @@ public final class MainMod { public static BW_Network BW_Network_instance = new BW_Network(); + public MainMod() { + GregTech_API.sBeforeGTPreload.add(new BeforeGTPreload()); + } + @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { -- cgit From d011703990735b4f366c7effea5487c7b05059c3 Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Tue, 24 Jan 2023 13:10:26 +0000 Subject: Make reflection Java 12+ compatible (#274) * Make reflection Java 12+ compatible * Remove unused methods * Remove gtnhlib as it is no longer needed Former-commit-id: 250fd0442765e59b2a6d19707c852ec498b5ae40 --- dependencies.gradle | 6 ++--- .../common/loaders/StaticRecipeChangeLoaders.java | 23 ------------------ .../GT_Enhancement/PlatinumSludgeOverHaul.java | 27 ---------------------- 3 files changed, 3 insertions(+), 53 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 9111782b83..0e76c84eaf 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -6,7 +6,7 @@ dependencies { compile("com.github.GTNewHorizons:TecTech:5.0.67:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.3.20-GTNH:dev") compile("com.github.GTNewHorizons:TinkersConstruct:1.9.11-GTNH:dev") - compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.6:dev") + compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.7:dev") compile("com.github.GTNewHorizons:CodeChickenCore:1.1.7:dev") compile("com.github.GTNewHorizons:Galacticraft:3.0.63-GTNH:dev") compile("com.github.GTNewHorizons:ModularUI:1.0.38:dev") @@ -44,6 +44,6 @@ dependencies { compileOnly("com.github.GTNewHorizons:ProjectRed:4.7.9-GTNH:dev") { transitive = false } - runtime("com.github.GTNewHorizons:Yamcl:0.5.84:dev") - runtime("com.github.GTNewHorizons:ironchest:6.0.71:dev") //needed for Galacticraft + runtimeOnly("com.github.GTNewHorizons:Yamcl:0.5.84:dev") + runtimeOnly("com.github.GTNewHorizons:ironchest:6.0.71:dev") //needed for Galacticraft } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 71eb970abb..c272985aa4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -49,7 +49,6 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import java.lang.reflect.Field; -import java.lang.reflect.Modifier; import java.util.*; import java.util.stream.Collectors; import net.minecraft.init.Blocks; @@ -59,7 +58,6 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.reflect.FieldUtils; public class StaticRecipeChangeLoaders { @@ -697,27 +695,6 @@ public class StaticRecipeChangeLoaders { || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); } - public static void patchEBFMapForCircuitUnification() { - Field mUsualInputCount = FieldUtils.getField(GT_Recipe.GT_Recipe_Map.class, "mUsualInputCount", true); - mUsualInputCount.setAccessible(true); - - try { - Field modifiersField = Field.class.getDeclaredField("modifiers"); - modifiersField.setAccessible(true); - modifiersField.setInt(mUsualInputCount, mUsualInputCount.getModifiers() & ~Modifier.FINAL); - mUsualInputCount.setInt(GT_Recipe.GT_Recipe_Map.sBlastRecipes, 3); - } catch (IllegalAccessException | NoSuchFieldException e) { - e.printStackTrace(); - } - } - - public static void synchroniseCircuitUseMulti() { - GT_Recipe.GT_Recipe_Map[] gt_recipe_maps = { - GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes, GT_Recipe.GT_Recipe_Map.sBlastRecipes - }; - getRecipesByCircuitID(gt_recipe_maps).forEach(StaticRecipeChangeLoaders::transformCircuitRecipes); - } - private static int getBlastLogic(GT_Recipe recipe) { int ret = 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index cb9084e608..92c6dc696c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -48,7 +48,6 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Block_Ores_Abstract; import java.lang.reflect.Field; -import java.lang.reflect.Modifier; import java.util.*; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; @@ -957,32 +956,6 @@ public class PlatinumSludgeOverHaul { if (in == null) in = CachedReflectionUtils.getField(recipe.getClass(), inputItemName); if (in == null) return; - // directly copied from the apache commons collection, cause GTNH had problems with that particular function for - // some reason? - // this part here is NOT MIT LICENSED BUT LICSENSED UNDER THE Apache License, Version 2.0! - try { - if (Modifier.isFinal(in.getModifiers())) { - // Do all JREs implement Field with a private ivar called "modifiers"? - Field modifiersField = Field.class.getDeclaredField("modifiers"); - boolean doForceAccess = !modifiersField.isAccessible(); - if (doForceAccess) { - modifiersField.setAccessible(true); - } - try { - modifiersField.setInt(in, in.getModifiers() & ~Modifier.FINAL); - } finally { - if (doForceAccess) { - modifiersField.setAccessible(false); - } - } - } - } catch (NoSuchFieldException ignored) { - // The field class contains always a modifiers field - } catch (IllegalAccessException ignored) { - // The modifiers field is made accessible - } - // END OF APACHE COMMONS COLLECTION COPY - Object input; try { input = in.get(obj); -- cgit From f2cf70f795e6a585c9b2595856d1e9be0f97e4be Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Wed, 25 Jan 2023 14:14:56 +0800 Subject: allow EIC to get structure updates from upper half (#273) Former-commit-id: 66ea5d36a839904914ad3d98fa4ecc9a277157de --- .../github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index c6ee62871b..3ec699d6cc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -45,6 +45,7 @@ import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileE import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileEntity_LowPowerLaserHatch; import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileEntity_Pipe_Energy_LowPower; import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -274,6 +275,9 @@ public class ItemRegistry { "ElectricImplosionCompressor", "Electric Implosion Compressor") .getStackForm(1L); + // EIC depend on neutronium block to pass on structure updates + int bitmask = GregTech_API.sMachineIDs.getOrDefault(GregTech_API.sBlockMetal5, 0) | (1 << 2); + GregTech_API.registerMachineBlock(GregTech_API.sBlockMetal5, bitmask); ItemRegistry.THTR = new GT_TileEntity_THTR( ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, "THTR", -- cgit From 14d80f41d96ac72170be52d7c65e0dd1002cc2e3 Mon Sep 17 00:00:00 2001 From: miozune Date: Sun, 29 Jan 2023 02:49:38 +0900 Subject: Fix chance not shown on NEI with culture transformation recipe (#275) Former-commit-id: f9be5f2722bda610635759de68551803ed8993a7 --- .../system/material/processingLoaders/AdditionalRecipes.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 9774620098..a4bd7cd792 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -46,6 +46,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; import java.lang.reflect.Field; import java.util.Map; +import java.util.Objects; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; @@ -152,7 +153,7 @@ public class AdditionalRecipes { BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); BioData Plasmid = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("Plasmid")); - if (DNA.getName() != Plasmid.getName()) { + if (!Objects.equals(DNA.getName(), Plasmid.getName())) { sBiolab.addFakeRecipe( true, new ItemStack[] { @@ -162,7 +163,7 @@ public class AdditionalRecipes { }, new ItemStack[] {stack, ItemList.Cell_Empty.get(1L)}, BioItemList.mBioLabParts[3], - new int[] {10000, 10000}, + new int[] {Plasmid.getChance(), 10000}, new FluidStack[] {FluidRegistry.getFluidStack("ic2distilledwater", 1000)}, null, 500, -- cgit From 4794931406c190dc9a851b99113ac792170e4750 Mon Sep 17 00:00:00 2001 From: miozune Date: Sun, 29 Jan 2023 18:56:52 +0900 Subject: Fix incorrect amount of Liquid DNA shown on NEI for culture synthesis recipe (#277) Former-commit-id: 46332cbaf4478791298104e1f40dcd8ec3365227 --- .../bartworks/system/material/processingLoaders/AdditionalRecipes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index a4bd7cd792..cb2786bc54 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -189,7 +189,7 @@ public class AdditionalRecipes { }, BioItemList.mBioLabParts[4], new int[] {7500, 10000}, - new FluidStack[] {new FluidStack(dnaFluid[0].getFluid(), 9000)}, + new FluidStack[] {new FluidStack(dnaFluid[0].getFluid(), 8000)}, null, 500, BW_Util.getMachineVoltageFromTier(6), -- cgit From 8803e0516f894a6aebb23ffea2ab419c23a06dba Mon Sep 17 00:00:00 2001 From: GDCloud <93287602+GDCloudstrike@users.noreply.github.com> Date: Mon, 30 Jan 2023 08:47:51 +0100 Subject: Optical Circuit recipes (#272) * Bump Dep * Add wraps for optical parts * Raw exposed optical chip recipe * Allow mutated living solder in CAL * update bs * Fix chance not shown on NEI with culture transformation recipe (#275) (#276) Co-authored-by: miozune * merge master in (#278) * Fix chance not shown on NEI with culture transformation recipe (#275) * Fix incorrect amount of Liquid DNA shown on NEI for culture synthesis recipe (#277) --------- Co-authored-by: miozune * Up chip tier by 1 --------- Co-authored-by: Martin Robertz Co-authored-by: miozune Former-commit-id: e1ee12ac98200eb6358f7634ddd2a0c499fe788c --- build.gradle | 11 ++++++++--- dependencies.gradle | 2 +- .../common/loaders/StaticRecipeChangeLoaders.java | 20 +++++++++++++++++++- .../CircuitGeneration/CircuitImprintLoader.java | 7 ++++++- .../CircuitGeneration/CircuitPartLoader.java | 7 ++++++- 5 files changed, 40 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 2dc32c9f20..505ad92b1a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1673027205 +//version: 1674409054 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -144,6 +144,7 @@ propertyDefaultIfUnset("modrinthProjectId", "") propertyDefaultIfUnset("modrinthRelations", "") propertyDefaultIfUnset("curseForgeProjectId", "") propertyDefaultIfUnset("curseForgeRelations", "") +propertyDefaultIfUnset("minimizeShadowedDependencies", true) String javaSourceDir = "src/main/java/" String scalaSourceDir = "src/main/scala/" @@ -411,7 +412,9 @@ shadowJar { attributes(getManifestAttributes()) } - minimize() // This will only allow shading for actually used classes + if (minimizeShadowedDependencies.toBoolean()) { + minimize() // This will only allow shading for actually used classes + } configurations = [ project.configurations.shadowImplementation, project.configurations.shadowCompile @@ -554,7 +557,9 @@ task shadowDevJar(type: ShadowJar) { attributes(getManifestAttributes()) } - minimize() // This will only allow shading for actually used classes + if (minimizeShadowedDependencies.toBoolean()) { + minimize() // This will only allow shading for actually used classes + } configurations = [ project.configurations.shadowImplementation, project.configurations.shadowCompile diff --git a/dependencies.gradle b/dependencies.gradle index 0e76c84eaf..6438489b5a 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.211:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.232:dev") compile("com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev") compile("com.github.GTNewHorizons:TecTech:5.0.67:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.3.20-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index c272985aa4..146cf36eac 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -609,7 +609,7 @@ public class StaticRecipeChangeLoaders { "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", - 1, + 2, 2, 0, 0, @@ -654,6 +654,24 @@ public class StaticRecipeChangeLoaders { 1); // aSpecialVaue has no meaning here. } + if (Loader.isModLoaded("universalsingularities")) { + + // Raw Exposed Optical Chip + eicMap.addRecipe( + false, + new ItemStack[] { + ItemList.Circuit_Silicon_Wafer7.get(1L), + GT_ModHandler.getModItem("universalsingularities", "universal.general.singularity", 1L, 20) + }, + new ItemStack[] {ItemList.Circuit_Chip_Optical.get(16L)}, + null, + new FluidStack[] {GT_Values.NF}, + new FluidStack[] {GT_Values.NF}, + 5 * 20, + 125_829_120, + 1); + } + eicMap.addRecipe( false, new ItemStack[] {GT_ModHandler.getModItem("GoodGenerator", "highDensityPlutoniumNugget", 5L)}, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 2abfb4e066..6cfe902668 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -107,8 +107,13 @@ public class CircuitImprintLoader { ? FluidRegistry.getFluid("molten.indalloy140") : FluidRegistry.getFluid("molten.solderingalloy"); + Fluid solderUEV = FluidRegistry.getFluid("molten.mutatedlivingsolder") != null + ? FluidRegistry.getFluid("molten.mutatedlivingsolder") + : FluidRegistry.getFluid("molten.solderingalloy"); + if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0)) - || circuitRecipe.mFluidInputs[0].isFluidEqual(new FluidStack(solderIndalloy, 0))) { + || circuitRecipe.mFluidInputs[0].isFluidEqual(new FluidStack(solderIndalloy, 0)) + || circuitRecipe.mFluidInputs[0].isFluidEqual(new FluidStack(solderUEV, 0))) { GT_Recipe newRecipe = CircuitImprintLoader.reBuildRecipe(circuitRecipe); if (newRecipe != null) BWRecipes.instance diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index 6ba0d7da55..617609a850 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -155,5 +155,10 @@ public class CircuitPartLoader implements Runnable { Circuit_Parts_TransistorXSMD, Circuit_Parts_CapacitorXSMD, Circuit_Parts_InductorASMD, - Circuit_Parts_InductorXSMD)); + Circuit_Parts_InductorXSMD, + Circuit_Chip_Optical, + Circuit_Board_Optical, + Optically_Perfected_CPU, + Optical_Cpu_Containment_Housing, + Optically_Compatible_Memory)); } -- cgit From ffb601bc958f75913e7dce1425b427d962397fbb Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Mon, 30 Jan 2023 10:36:10 -0800 Subject: [ci skip] Update buildscript to RetroFuturaGradle Former-commit-id: ce16201175530a1f948434ee5fee474987635de4 --- .gitattributes | 75 +-- build.gradle | 846 ++++++++++++++++++------------- gradle/wrapper/gradle-wrapper.jar | Bin 55616 -> 61608 bytes gradle/wrapper/gradle-wrapper.properties | 3 +- gradlew | 272 ++++++---- gradlew.bat | 38 +- settings.gradle | 24 +- 7 files changed, 740 insertions(+), 518 deletions(-) diff --git a/.gitattributes b/.gitattributes index 9917fc4abe..fd2792b6cb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,35 +1,44 @@ * text eol=lf -*.jar binary - -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.tif binary -*.tiff binary -*.ico binary -*.svg text -*.eps binary - -*.kar binary -*.m4a binary -*.mid binary -*.midi binary -*.mp3 binary -*.ogg binary -*.ra binary - -*.7z binary -*.gz binary -*.tar binary -*.tgz binary -*.zip binary - -*.patch -text - -*.bat text eol=crlf -*.cmd text eol=crlf -*.ps1 text eol=crlf - -*autogenerated binary \ No newline at end of file +*.[jJ][aA][rR] binary + +*.[pP][nN][gG] binary +*.[jJ][pP][gG] binary +*.[jJ][pP][eE][gG] binary +*.[gG][iI][fF] binary +*.[tT][iI][fF] binary +*.[tT][iI][fF][fF] binary +*.[iI][cC][oO] binary +*.[sS][vV][gG] text +*.[eE][pP][sS] binary +*.[xX][cC][fF] binary + +*.[kK][aA][rR] binary +*.[mM]4[aA] binary +*.[mM][iI][dD] binary +*.[mM][iI][dD][iI] binary +*.[mM][pP]3 binary +*.[oO][gG][gG] binary +*.[rR][aA] binary + +*.7[zZ] binary +*.[gG][zZ] binary +*.[tT][aA][rR] binary +*.[tT][gG][zZ] binary +*.[zZ][iI][pP] binary + +*.[tT][cC][nN] binary +*.[sS][oO] binary +*.[dD][lL][lL] binary +*.[dD][yY][lL][iI][bB] binary +*.[pP][sS][dD] binary +*.[tT][tT][fF] binary +*.[oO][tT][fF] binary + +*.[pP][aA][tT][cC][hH] -text + +*.[bB][aA][tT] text eol=crlf +*.[cC][mM][dD] text eol=crlf +*.[pP][sS]1 text eol=crlf + +*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary diff --git a/build.gradle b/build.gradle index 505ad92b1a..0197e406bb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1674409054 +//version: 1675084541 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -6,24 +6,27 @@ */ +import com.diffplug.blowdryer.Blowdryer import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import com.gtnewhorizons.retrofuturagradle.mcp.ReobfuscatedJar import com.matthewprenger.cursegradle.CurseArtifact import com.matthewprenger.cursegradle.CurseRelation import com.modrinth.minotaur.dependencies.ModDependency import com.modrinth.minotaur.dependencies.VersionDependency import org.gradle.internal.logging.text.StyledTextOutput.Style import org.gradle.internal.logging.text.StyledTextOutputFactory +import org.jetbrains.gradle.ext.* import java.nio.file.Files import java.nio.file.Paths import java.util.concurrent.TimeUnit import java.util.zip.ZipEntry -import java.util.zip.ZipInputStream import java.util.zip.ZipOutputStream buildscript { repositories { + mavenLocal() mavenCentral() maven { @@ -31,9 +34,10 @@ buildscript { url 'https://maven.minecraftforge.net' } maven { - // GTNH ForgeGradle and ASM Fork - name = "GTNH Maven" - url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" + // GTNH RetroFuturaGradle and ASM Fork + name "GTNH Maven" + url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" + allowInsecureProtocol = true } maven { name 'sonatype' @@ -44,76 +48,41 @@ buildscript { url 'https://repo1.maven.org/maven2/' } } - dependencies { - //Overwrite the current ASM version to fix shading newer than java 8 applicatations. - classpath 'org.ow2.asm:asm-debug-all-custom:5.0.3' - classpath 'net.minecraftforge.gradle:ForgeGradle:1.2.13' - } } plugins { id 'java-library' - id 'idea' + id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7" id 'eclipse' id 'scala' id 'maven-publish' - id 'org.jetbrains.kotlin.jvm' version '1.5.30' apply false - id 'org.jetbrains.kotlin.kapt' version '1.5.30' apply false - id 'com.google.devtools.ksp' version '1.5.30-1.0.0' apply false - id 'org.ajoberstar.grgit' version '4.1.1' - id 'com.github.johnrengelman.shadow' version '4.0.4' - id 'com.palantir.git-version' version '0.13.0' apply false - id 'de.undercouch.download' version '5.0.1' - id 'com.github.gmazzo.buildconfig' version '3.0.3' apply false + id 'org.jetbrains.kotlin.jvm' version '1.8.0' apply false + id 'org.jetbrains.kotlin.kapt' version '1.8.0' apply false + id 'com.google.devtools.ksp' version '1.8.0-1.0.9' apply false + id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version ,unused, available for addon.gradle + id 'com.github.johnrengelman.shadow' version '7.1.2' apply false + id 'com.palantir.git-version' version '0.13.0' apply false // 0.13.0 is the last jvm8 supporting version + id 'de.undercouch.download' version '5.3.0' + id 'com.github.gmazzo.buildconfig' version '3.1.0' apply false // Unused, available for addon.gradle id 'com.diffplug.spotless' version '6.7.2' apply false id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false + id 'com.gtnewhorizons.retrofuturagradle' version '1.0.18' } boolean settingsupdated = verifySettingsGradle() settingsupdated = verifyGitAttributes() || settingsupdated if (settingsupdated) throw new GradleException("Settings has been updated, please re-run task.") -dependencies { - implementation 'com.diffplug:blowdryer:1.6.0' -} - -apply plugin: 'com.diffplug.blowdryer' - if (project.file('.git/HEAD').isFile()) { apply plugin: 'com.palantir.git-version' } def out = services.get(StyledTextOutputFactory).create('an-output') -apply plugin: 'forge' - def projectJavaVersion = JavaLanguageVersion.of(8) -java { - toolchain { - languageVersion.set(projectJavaVersion) - } -} - -idea { - module { - inheritOutputDirs = true - downloadJavadoc = true - downloadSources = true - } -} - boolean disableSpotless = project.hasProperty("disableSpotless") ? project.disableSpotless.toBoolean() : false -if (!disableSpotless) { - apply plugin: 'com.diffplug.spotless' - apply from: Blowdryer.file('spotless.gradle') -} - -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") @@ -121,10 +90,7 @@ checkPropertyExists("autoUpdateBuildScript") checkPropertyExists("minecraftVersion") checkPropertyExists("forgeVersion") checkPropertyExists("replaceGradleTokenInFile") -checkPropertyExists("gradleTokenModId") -checkPropertyExists("gradleTokenModName") checkPropertyExists("gradleTokenVersion") -checkPropertyExists("gradleTokenGroupName") checkPropertyExists("apiPackage") checkPropertyExists("accessTransformersFile") checkPropertyExists("usesMixins") @@ -135,6 +101,8 @@ checkPropertyExists("containsMixinsAndOrCoreModOnly") checkPropertyExists("usesShadowedDependencies") checkPropertyExists("developmentEnvironmentUserName") +propertyDefaultIfUnset("generateGradleTokenClass", "") +propertyDefaultIfUnset("includeWellKnownRepositories", true) propertyDefaultIfUnset("noPublishedSources", false) propertyDefaultIfUnset("usesMixinDebug", project.usesMixins) propertyDefaultIfUnset("forceEnableMixins", false) @@ -145,14 +113,109 @@ propertyDefaultIfUnset("modrinthRelations", "") propertyDefaultIfUnset("curseForgeProjectId", "") propertyDefaultIfUnset("curseForgeRelations", "") propertyDefaultIfUnset("minimizeShadowedDependencies", true) +propertyDefaultIfUnset("relocateShadowedDependencies", true) +// Deprecated properties (kept for backwards compat) +propertyDefaultIfUnset("gradleTokenModId", "") +propertyDefaultIfUnset("gradleTokenModName", "") +propertyDefaultIfUnset("gradleTokenGroupName", "") + +propertyDefaultIfUnset("enableModernJavaSyntax", false) // On by default for new projects only +propertyDefaultIfUnset("enableGenericInjection", false) // On by default for new projects only + +project.extensions.add(Blowdryer, "Blowdryer", Blowdryer) // Make blowdryer available in "apply from:" scripts +if (!disableSpotless) { + apply plugin: 'com.diffplug.spotless' + apply from: Blowdryer.file('spotless.gradle') +} String javaSourceDir = "src/main/java/" String scalaSourceDir = "src/main/scala/" String kotlinSourceDir = "src/main/kotlin/" +if (usesShadowedDependencies.toBoolean()) { + apply plugin: "com.github.johnrengelman.shadow" +} + +java { + toolchain { + if (enableModernJavaSyntax.toBoolean()) { + languageVersion.set(JavaLanguageVersion.of(17)) + } else { + languageVersion.set(projectJavaVersion) + } + vendor.set(JvmVendorSpec.ADOPTIUM) + } + if (!noPublishedSources) { + withSourcesJar() + } +} + +pluginManager.withPlugin('org.jetbrains.kotlin.jvm') { + // If Kotlin is enabled in the project + kotlin { + jvmToolchain(8) + } + // Kotlin hacks our source sets, so we hack Kotlin's tasks + def disabledKotlinTaskList = [ + "kaptGenerateStubsMcLauncherKotlin", + "kaptGenerateStubsPatchedMcKotlin", + "kaptGenerateStubsInjectedTagsKotlin", + "compileMcLauncherKotlin", + "compilePatchedMcKotlin", + "compileInjectedTagsKotlin", + "kaptMcLauncherKotlin", + "kaptPatchedMcKotlin", + "kaptInjectedTagsKotlin", + "kspMcLauncherKotlin", + "kspPatchedMcKotlin", + "kspInjectedTagsKotlin", + ] + tasks.configureEach { task -> + if (task.name in disabledKotlinTaskList) { + task.enabled = false + } + } +} -final String modGroupPath = modGroup.toString().replaceAll("\\.", "/") -final String apiPackagePath = apiPackage.toString().replaceAll("\\.", "/") +configurations { + create("runtimeOnlyNonPublishable") { + description = "Runtime only dependencies that are not published alongside the jar" + canBeConsumed = false + canBeResolved = false + } +} + +if (enableModernJavaSyntax.toBoolean()) { + dependencies { + annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:1.0.0' + compileOnly('com.github.bsideup.jabel:jabel-javac-plugin:1.0.0') { + transitive = false // We only care about the 1 annotation class + } + } + + tasks.withType(JavaCompile).configureEach { + if (it.name in ["compileMcLauncherJava", "compilePatchedMcJava"]) { + return + } + sourceCompatibility = 17 // for the IDE support + options.release.set(8) + + javaCompiler.set(javaToolchains.compilerFor { + languageVersion.set(JavaLanguageVersion.of(17)) + vendor.set(JvmVendorSpec.ADOPTIUM) + }) + } +} + +eclipse { + classpath { + downloadSources = true + downloadJavadoc = true + } +} + +final String modGroupPath = modGroup.toString().replace('.' as char, '/' as char) +final String apiPackagePath = apiPackage.toString().replace('.' as char, '/' as char) String targetPackageJava = javaSourceDir + modGroupPath String targetPackageScala = scalaSourceDir + modGroupPath @@ -175,6 +238,27 @@ if (accessTransformersFile) { if (!getFile(targetFile).exists()) { throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) } + tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(targetFile) + tasks.srgifyBinpatchedJar.accessTransformerFiles.from(targetFile) +} else { + boolean atsFound = false + for (File at : sourceSets.getByName("main").resources.files) { + if (at.name.toLowerCase().endsWith("_at.cfg")) { + atsFound = true + tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(at) + tasks.srgifyBinpatchedJar.accessTransformerFiles.from(at) + } + } + for (File at : sourceSets.getByName("api").resources.files) { + if (at.name.toLowerCase().endsWith("_at.cfg")) { + atsFound = true + tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(at) + tasks.srgifyBinpatchedJar.accessTransformerFiles.from(at) + } + } + if (atsFound) { + logger.warn("Found and added access transformers in the resources folder, please configure gradle.properties to explicitly mention them by name") + } } if (usesMixins.toBoolean()) { @@ -213,7 +297,7 @@ if (coreModClass) { } } -configurations.all { +configurations.configureEach { resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS) // Make sure GregTech build won't time out @@ -244,7 +328,7 @@ catch (Exception ignored) { versionOverride = 'NO-GIT-TAG-SET' identifiedVersion = versionOverride } -version = minecraftVersion + '-' + identifiedVersion +version = identifiedVersion ext { modVersion = identifiedVersion } @@ -260,56 +344,72 @@ if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) { archivesBaseName = modId } -def arguments = [] -def jvmArguments = [] - -if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { - arguments += [ - "--tweakClass org.spongepowered.asm.launch.MixinTweaker" - ] - if (usesMixinDebug.toBoolean()) { - jvmArguments += [ - "-Dmixin.debug.countInjections=true", - "-Dmixin.debug.verbose=true", - "-Dmixin.debug.export=true" - ] - } -} minecraft { - version = minecraftVersion + '-' + forgeVersion + '-' + minecraftVersion - runDir = 'run' - if (replaceGradleTokenInFile) { for (f in replaceGradleTokenInFile.split(',')) { - replaceIn f - } - if (gradleTokenModId) { - replace gradleTokenModId, modId + tagReplacementFiles.add f } - if (gradleTokenModName) { - replace gradleTokenModName, modName - } - if (gradleTokenVersion) { - replace gradleTokenVersion, modVersion - } - if (gradleTokenGroupName) { - replace gradleTokenGroupName, modGroup + } + if (gradleTokenModId) { + injectedTags.put gradleTokenModId, modId + } + if (gradleTokenModName) { + injectedTags.put gradleTokenModName, modName + } + if (gradleTokenVersion) { + injectedTags.put gradleTokenVersion, modVersion + } + if (gradleTokenGroupName) { + injectedTags.put gradleTokenGroupName, modGroup + } + if (enableGenericInjection.toBoolean()) { + injectMissingGenerics.set(true) + } + + // Enable assertions in the current mod + extraRunJvmArguments.add("-ea:${modGroup}") + + if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { + extraTweakClasses.add("org.spongepowered.asm.launch.MixinTweaker") + + if (usesMixinDebug.toBoolean()) { + extraRunJvmArguments.addAll([ + "-Dmixin.debug.countInjections=true", + "-Dmixin.debug.verbose=true", + "-Dmixin.debug.export=true" + ]) } } - clientIntellijRun { - args(arguments) - jvmArgs(jvmArguments) + // Blowdryer is present in some old mod builds, do not propagate it further as a dependency + // IC2 has no reobf jars in its Maven + groupsToExcludeFromAutoReobfMapping.addAll(["com.diffplug", "com.diffplug.durian", "net.industrial-craft"]) +} + +if (generateGradleTokenClass) { + tasks.injectTags.outputClassName.set(generateGradleTokenClass) +} - if (developmentEnvironmentUserName) { - args("--username", developmentEnvironmentUserName) +// Custom reobf auto-mappings +configurations.configureEach { + dependencies.configureEach { dep -> + if (dep instanceof org.gradle.api.artifacts.ExternalModuleDependency) { + if (dep.group == "net.industrial-craft" && dep.name == "industrialcraft-2") { + // https://www.curseforge.com/minecraft/mc-mods/industrial-craft/files/2353971 + project.dependencies.reobfJarConfiguration("curse.maven:ic2-242638:2353971") + } } } +} - serverIntellijRun { - args(arguments) - jvmArgs(jvmArguments) +// Ensure tests have access to minecraft classes +sourceSets { + test { + java { + compileClasspath += sourceSets.patchedMc.output + sourceSets.mcLauncher.output + runtimeClasspath += sourceSets.patchedMc.output + sourceSets.mcLauncher.output + } } } @@ -317,15 +417,49 @@ if (file('addon.gradle').exists()) { apply from: 'addon.gradle' } +// Allow unsafe repos but warn +repositories.configureEach { repo -> + if (repo instanceof org.gradle.api.artifacts.repositories.UrlArtifactRepository) { + if (repo.getUrl() != null && repo.getUrl().getScheme() == "http" && !repo.allowInsecureProtocol) { + logger.warn("Deprecated: Allowing insecure connections for repo '${repo.name}' - add 'allowInsecureProtocol = true'") + repo.allowInsecureProtocol = true + } + } +} + apply from: 'repositories.gradle' configurations { - // TODO: remove Compile after all uses are refactored to Implementation - for (config in [shadowImplementation, shadowCompile, shadeCompile]) { - compileClasspath.extendsFrom(config) - runtimeClasspath.extendsFrom(config) - testCompileClasspath.extendsFrom(config) - testRuntimeClasspath.extendsFrom(config) + for (config in [compileClasspath, runtimeClasspath, testCompileClasspath, testRuntimeClasspath]) { + config.extendsFrom(runtimeOnlyNonPublishable) + if (usesShadowedDependencies.toBoolean()) { + config.extendsFrom(shadowImplementation) + // TODO: remove Compile after all uses are refactored to Implementation + config.extendsFrom(shadeCompile) + config.extendsFrom(shadowCompile) + } + } + // A "bag-of-dependencies"-style configuration for backwards compatibility, gets put in "api" + create("compile") { + description = "Deprecated: use api or implementation instead, gets put in api" + canBeConsumed = false + canBeResolved = false + visible = false + } + create("testCompile") { + description = "Deprecated: use testImplementation instead" + canBeConsumed = false + canBeResolved = false + visible = false + } + api.extendsFrom(compile) + testImplementation.extendsFrom(testCompile) +} + +afterEvaluate { + if (!configurations.compile.allDependencies.empty || !configurations.testCompile.allDependencies.empty) { + logger.warn("This project uses deprecated `compile` dependencies, please migrate to using `api` and `implementation`") + logger.warn("For more details, see https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/master/dependencies.gradle") } } @@ -333,12 +467,16 @@ repositories { maven { name 'Overmind forge repo mirror' url 'https://gregtech.overminddl1.com/' + mavenContent { + excludeGroup("net.minecraftforge") // missing the `universal` artefact + } + } + maven { + name = "GTNH Maven" + url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" + allowInsecureProtocol = true } if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { - maven { - name = "GTNH Maven" - url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" - } if (usesMixinDebug.toBoolean()) { maven { name = "Fabric Maven" @@ -346,6 +484,35 @@ repositories { } } } + if (includeWellKnownRepositories.toBoolean()) { + maven { + name "CurseMaven" + url "https://cursemaven.com" + content { + includeGroup "curse.maven" + } + } + maven { + name = "ic2" + url = "https://maven.ic2.player.to/" + metadataSources { + mavenPom() + artifact() + } + } + maven { + name = "ic2-mirror" + url = "https://maven2.ic2.player.to/" + metadataSources { + mavenPom() + artifact() + } + } + maven { + name "MMD Maven" + url "https://maven.mcmoddev.com/" + } + } } dependencies { @@ -353,31 +520,42 @@ dependencies { annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3') annotationProcessor('com.google.guava:guava:24.1.1-jre') annotationProcessor('com.google.code.gson:gson:2.8.6') - annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.3:processor') + annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.10:processor') if (usesMixinDebug.toBoolean()) { - runtimeClasspath('org.jetbrains:intellij-fernflower:1.2.1.16') - testRuntimeClasspath('org.jetbrains:intellij-fernflower:1.2.1.16') + runtimeOnlyNonPublishable('org.jetbrains:intellij-fernflower:1.2.1.16') } } if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { - compile('com.gtnewhorizon:gtnhmixins:2.1.3') + implementation('com.gtnewhorizon:gtnhmixins:2.1.10') + } +} + +pluginManager.withPlugin('org.jetbrains.kotlin.kapt') { + if (usesMixins.toBoolean()) { + dependencies { + kapt('com.gtnewhorizon:gtnhmixins:2.1.10:processor') + } } } 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()) { +def mixinTmpDir = buildDir.path + File.separator + 'tmp' + File.separator + 'mixins' +def refMap = "${mixinTmpDir}" + File.separator + mixingConfigRefMap +def mixinSrg = "${mixinTmpDir}" + File.separator + "mixins.srg" + +tasks.register('generateAssets') { + group = "GTNH Buildscript" + description = "Generates a mixin config file at /src/main/resources/mixins.modid.json if needed" + onlyIf { usesMixins.toBoolean() } + doLast { def mixinConfigFile = getFile("/src/main/resources/mixins." + modId + ".json") if (!mixinConfigFile.exists()) { def mixinPluginLine = "" - if(!mixinPlugin.isEmpty()) { + if (!mixinPlugin.isEmpty()) { // We might not have a mixin plugin if we're using early/late mixins - mixinPluginLine += """\n "plugin": "${modGroup}.${mixinPlugin}", """ + mixinPluginLine += """\n "plugin": "${modGroup}.${mixinPlugin}", """ } mixinConfigFile.text = """{ @@ -396,107 +574,58 @@ task generateAssets { } } -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()) +if (usesMixins.toBoolean()) { + tasks.named("reobfJar", ReobfuscatedJar).configure { + extraSrgFiles.from(mixinSrg) } - if (minimizeShadowedDependencies.toBoolean()) { - minimize() // This will only allow shading for actually used classes + tasks.named("processResources").configure { + dependsOn("generateAssets") } - configurations = [ - project.configurations.shadowImplementation, - project.configurations.shadowCompile - ] - dependsOn(relocateShadowJar) -} -jar { - project.configurations.shadeCompile.each { dep -> - from(project.zipTree(dep)) { - exclude 'META-INF', 'META-INF/**' + tasks.named("compileJava", JavaCompile).configure { + doFirst { + new File(mixinTmpDir).mkdirs() } + options.compilerArgs += [ + "-AreobfSrgFile=${tasks.reobfJar.srg.get().asFile}", + "-AoutSrgFile=${mixinSrg}", + "-AoutRefMapFile=${refMap}", + // Elan: from what I understand they are just some linter configs so you get some warning on how to properly code + "-XDenableSunApiLintControl", + "-XDignore.symbol.file" + ] } - 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" - ] + pluginManager.withPlugin('org.jetbrains.kotlin.kapt') { + kapt { + correctErrorTypes = true + javacOptions { + option("-AreobfSrgFile=${tasks.reobfJar.srg.get().asFile}") + option("-AoutSrgFile=$mixinSrg") + option("-AoutRefMapFile=$refMap") + } + } + tasks.configureEach { task -> + if (task.name == "kaptKotlin") { + task.doFirst { + new File(mixinTmpDir).mkdirs() + } + } } - } -} - -runClient { - if (developmentEnvironmentUserName) { - arguments += [ - "--username", - developmentEnvironmentUserName - ] } - args(arguments) - jvmArgs(jvmArguments) } -runServer { - args(arguments) - jvmArgs(jvmArguments) -} - -tasks.withType(JavaExec).configureEach { - javaLauncher.set( - javaToolchains.launcherFor { - languageVersion = projectJavaVersion - } - ) -} - -processResources { +tasks.named("processResources", ProcessResources).configure { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version - inputs.property "mcversion", project.minecraft.version + inputs.property "mcversion", project.minecraft.mcVersion exclude("spotless.gradle") - // replace stuff in mcmod.info, nothing else - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' - - // replace modVersion and minecraftVersion - expand "minecraftVersion": project.minecraft.version, + // replace stuff in mcmod.info, nothing else. replaces ${key} with value in text + filesMatching("mcmod.info") { + expand "minecraftVersion": project.minecraft.mcVersion, "modVersion": modVersion, "modId": modId, "modName": modName @@ -505,12 +634,6 @@ processResources { if (usesMixins.toBoolean()) { from refMap } - - // copy everything else that's not the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' - exclude 'spotless.gradle' - } } def getManifestAttributes() { @@ -537,67 +660,71 @@ def getManifestAttributes() { return manifestAttributes } -task sourcesJar(type: Jar) { - from(sourceSets.main.allSource) - 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") - +tasks.named("jar", Jar).configure { manifest { attributes(getManifestAttributes()) } - - if (minimizeShadowedDependencies.toBoolean()) { - 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 -} +if (usesShadowedDependencies.toBoolean()) { + tasks.register('relocateShadowJar', ConfigureShadowRelocation) { + target = tasks.shadowJar + prefix = modGroup + ".shadow" + enabled = minimizeShadowedDependencies.toBoolean() + } + tasks.named("shadowJar", ShadowJar).configure { + manifest { + attributes(getManifestAttributes()) + } -task devJar(type: Jar) { - project.configurations.shadeCompile.each { dep -> - from(project.zipTree(dep)) { - exclude 'META-INF', 'META-INF/**' + if (minimizeShadowedDependencies.toBoolean()) { + minimize() // This will only allow shading for actually used classes + } + configurations = [ + project.configurations.shadowImplementation, + project.configurations.shadowCompile, + project.configurations.shadeCompile + ] + archiveClassifier.set('dev') + if (minimizeShadowedDependencies.toBoolean()) { + dependsOn(relocateShadowJar) } } - - from sourceSets.main.output - getArchiveClassifier().set("dev") - - manifest { - attributes(getManifestAttributes()) + configurations.runtimeElements.outgoing.artifacts.clear() + configurations.apiElements.outgoing.artifacts.clear() + configurations.runtimeElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar)) + configurations.apiElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar)) + tasks.named("jar", Jar) { + enabled = false + finalizedBy(tasks.shadowJar) + } + tasks.named("reobfJar", ReobfuscatedJar) { + inputJar.set(tasks.named("shadowJar", ShadowJar).flatMap({it.archiveFile})) } + AdhocComponentWithVariants javaComponent = (AdhocComponentWithVariants) project.components.findByName("java") + javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements) { + skip() + } + for (runTask in ["runClient", "runServer"]) { + tasks.named(runTask).configure { + dependsOn("shadowJar") + } + } +} +ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar +ext.publishableObfJar = tasks.reobfJar - if (usesShadowedDependencies.toBoolean()) { - dependsOn(circularResolverJar) - enabled = false +tasks.named('extractForgeUserdev', Copy).configure { efu -> + doLast { + // Fix CoFH-repackaged CCL not finding mappings + project.copy { + from(mcpTasks.userdevDir("conf")) + into(new File(project.buildDir, "unpacked/conf")) + } } } -task apiJar(type: Jar) { +tasks.register('apiJar', Jar) { from(sourceSets.main.allSource) { include modGroupPath + "/" + apiPackagePath + '/**' } @@ -615,18 +742,78 @@ task apiJar(type: Jar) { artifacts { if (!noPublishedSources) { - archives sourcesJar + archives tasks.named("sourcesJar") } - archives devJar if (apiPackage) { - archives apiJar + archives tasks.named("apiJar") } } -// The gradle metadata includes all of the additional deps that we disabled from POM generation (including forgeBin with no groupID), -// and isn't strictly needed with the POM so just disable it. -tasks.withType(GenerateModuleMetadata) { - enabled = false +idea { + module { + downloadJavadoc = true + downloadSources = true + } + project { + settings { + runConfigurations { + "1. Run Client"(Gradle) { + taskNames = ["runClient"] + } + "2. Run Server"(Gradle) { + taskNames = ["runServer"] + } + "3. Run Obfuscated Client"(Gradle) { + taskNames = ["runObfClient"] + } + "4. Run Obfuscated Server"(Gradle) { + taskNames = ["runObfServer"] + } + if (!disableSpotless) { + "5. Apply spotless"(Gradle) { + taskNames = ["spotlessApply"] + } + } + def coreModArgs = "" + if (coreModClass) { + coreModArgs = ' "-Dfml.coreMods.load=' + modGroup + '.' + coreModClass + '"' + } + "Run Client (IJ Native)"(Application) { + mainClass = "GradleStart" + moduleName = project.name + ".main" + afterEvaluate { + workingDirectory = tasks.runClient.workingDir.absolutePath + programParameters = tasks.runClient.calculateArgs(project).collect { '"' + it + '"' }.join(' ') + jvmArgs = tasks.runClient.calculateJvmArgs(project).collect { '"' + it + '"' }.join(' ') + + ' ' + tasks.runClient.systemProperties.collect { '"-D' + it.key + '=' + it.value.toString() + '"' }.join(' ') + + coreModArgs + } + } + "Run Server (IJ Native)"(Application) { + mainClass = "GradleStartServer" + moduleName = project.name + ".main" + afterEvaluate { + workingDirectory = tasks.runServer.workingDir.absolutePath + programParameters = tasks.runServer.calculateArgs(project).collect { '"' + it + '"' }.join(' ') + jvmArgs = tasks.runServer.calculateJvmArgs(project).collect { '"' + it + '"' }.join(' ') + + ' ' + tasks.runServer.systemProperties.collect { '"-D' + it.key + '=' + it.value.toString() + '"' }.join(' ') + + coreModArgs + } + } + } + compiler.javac { + afterEvaluate { + moduleJavacAdditionalOptions = [ + (project.name + ".main"): tasks.compileJava.options.compilerArgs.collect { '"' + it + '"' }.join(' ') + ] + } + } + } + } +} + +tasks.named("processIdeaSettings").configure { + dependsOn("injectTags") } // workaround variable hiding in pom processing @@ -634,51 +821,24 @@ def projectConfigs = project.configurations publishing { publications { - maven(MavenPublication) { + create("maven", MavenPublication) { from components.java - if (usesShadowedDependencies.toBoolean()) { - artifact source: shadowJar, classifier: "" - } - if (!noPublishedSources) { - artifact source: sourcesJar, classifier: "sources" - } - artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev" + if (apiPackage) { - artifact source: apiJar, classifier: "api" + artifact apiJar } 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 - - // remove extra garbage from minecraft and minecraftDeps configuration - pom.withXml { - def badArtifacts = [:].withDefault { [] as Set } - for (configuration in [ - projectConfigs.minecraft, - projectConfigs.minecraftDeps - ]) { - for (dependency in configuration.allDependencies) { - badArtifacts[dependency.group == null ? "" : dependency.group] += dependency.name - } - } - // example for specifying extra stuff to ignore - // badArtifacts["org.example.group"] += "artifactName" - - Node pomNode = asNode() - pomNode.dependencies.'*'.findAll() { - badArtifacts[it.groupId.text()].contains(it.artifactId.text()) - }.each() { - it.parent().remove(it) - } - } } } repositories { maven { url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases" + allowInsecureProtocol = true credentials { username = System.getenv("MAVEN_USER") ?: "NONE" password = System.getenv("MAVEN_PASSWORD") ?: "NONE" @@ -698,7 +858,7 @@ if (modrinthProjectId.size() != 0 && System.getenv("MODRINTH_TOKEN") != null) { versionNumber = identifiedVersion versionType = identifiedVersion.endsWith("-pre") ? "beta" : "release" changelog = changelogFile.exists() ? changelogFile.getText("UTF-8") : "" - uploadFile = jar + uploadFile = publishableObfJar additionalFiles = getSecondaryArtifacts() gameVersions = [minecraftVersion] loaders = ["forge"] @@ -739,7 +899,7 @@ if (curseForgeProjectId.size() != 0 && System.getenv("CURSEFORGE_TOKEN") != null releaseType = identifiedVersion.endsWith("-pre") ? "beta" : "release" addGameVersion minecraftVersion addGameVersion "Forge" - mainArtifact jar + mainArtifact publishableObfJar for (artifact in getSecondaryArtifacts()) addArtifact artifact } @@ -767,7 +927,7 @@ if (curseForgeProjectId.size() != 0 && System.getenv("CURSEFORGE_TOKEN") != null tasks.publish.dependsOn(tasks.curseforge) } -def addModrinthDep(scope, type, name) { +def addModrinthDep(String scope, String type, String name) { com.modrinth.minotaur.dependencies.Dependency dep; if (!(scope in ["required", "optional", "incompatible", "embedded"])) { throw new Exception("Invalid modrinth dependency scope: " + scope) @@ -785,7 +945,7 @@ def addModrinthDep(scope, type, name) { project.modrinth.dependencies.add(dep) } -def addCurseForgeRelation(type, name) { +def addCurseForgeRelation(String type, String name) { if (!(type in ["requiredDependency", "embeddedLibrary", "optionalDependency", "tool", "incompatible"])) { throw new Exception("Invalid CurseForge relation type: " + type) } @@ -795,17 +955,20 @@ def addCurseForgeRelation(type, name) { } // Updating -task updateBuildScript { +tasks.register('updateBuildScript') { + group = 'GTNH Buildscript' + description = 'Updates the build script to the latest version' + doLast { - if (performBuildScriptUpdate(projectDir.toString())) return + if (performBuildScriptUpdate()) return print("Build script already up-to-date!") } } -if (!project.getGradle().startParameter.isOffline() && isNewBuildScriptVersionAvailable(projectDir.toString())) { +if (!project.getGradle().startParameter.isOffline() && !Boolean.getBoolean('DISABLE_BUILDSCRIPT_UPDATE_CHECK') && isNewBuildScriptVersionAvailable()) { if (autoUpdateBuildScript.toBoolean()) { - performBuildScriptUpdate(projectDir.toString()) + performBuildScriptUpdate() } else { out.style(Style.SuccessHeader).println("Build script update available! Run 'gradle updateBuildScript'") } @@ -848,10 +1011,11 @@ boolean verifySettingsGradle() { return false } -boolean performBuildScriptUpdate(String projectDir) { - if (isNewBuildScriptVersionAvailable(projectDir)) { +boolean performBuildScriptUpdate() { + if (isNewBuildScriptVersionAvailable()) { def buildscriptFile = getFile("build.gradle") availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } } + def out = services.get(StyledTextOutputFactory).create('buildscript-update-output') out.style(Style.Success).print("Build script updated. Please REIMPORT the project or RESTART your IDE!") boolean settingsupdated = verifySettingsGradle() settingsupdated = verifyGitAttributes() || settingsupdated @@ -862,7 +1026,7 @@ boolean performBuildScriptUpdate(String projectDir) { return false } -boolean isNewBuildScriptVersionAvailable(String projectDir) { +boolean isNewBuildScriptVersionAvailable() { Map parameters = ["connectTimeout": 2000, "readTimeout": 2000] String currentBuildScript = getFile("build.gradle").getText() @@ -882,15 +1046,12 @@ static String getVersionHash(String buildScriptContent) { return "" } -configure(updateBuildScript) { - group = 'forgegradle' - description = 'Updates the build script to the latest version' -} - // Parameter Deobfuscation -task deobfParams { - doLast { +tasks.register('deobfParams') { + group = 'GTNH Buildscript' + description = 'Rename all obfuscated parameter names inherited from Minecraft classes' + doLast { // TODO String mcpDir = "$project.gradle.gradleUserHomeDir/caches/minecraft/de/oceanlabs/mcp/mcp_$channel/$mappingsVersion" String mcpZIP = "$mcpDir/mcp_$channel-$mappingsVersion-${minecraftVersion}.zip" @@ -904,7 +1065,10 @@ task deobfParams { if (!file(paramsCSV).exists()) { println("Extracting MCP archive ...") - unzip(mcpZIP, mcpDir) + copy { + from(zipTree(mcpZIP)) + into(mcpDir) + } } println("Parsing params.csv ...") @@ -947,42 +1111,6 @@ static int replaceParams(File file, Map params) { return 0 } -// Credit: bitsnaps (https://gist.github.com/bitsnaps/00947f2dce66f4bbdabc67d7e7b33681) -static unzip(String zipFileName, String outputDir) { - byte[] buffer = new byte[16384] - ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFileName)) - ZipEntry zipEntry = zis.getNextEntry() - while (zipEntry != null) { - File newFile = new File(outputDir + File.separator, zipEntry.name) - if (zipEntry.isDirectory()) { - if (!newFile.isDirectory() && !newFile.mkdirs()) { - throw new IOException("Failed to create directory $newFile") - } - } else { - // fix for Windows-created archives - File parent = newFile.parentFile - if (!parent.isDirectory() && !parent.mkdirs()) { - throw new IOException("Failed to create directory $parent") - } - // write file content - FileOutputStream fos = new FileOutputStream(newFile) - int len = 0 - while ((len = zis.read(buffer)) > 0) { - fos.write(buffer, 0, len) - } - fos.close() - } - zipEntry = zis.getNextEntry() - } - zis.closeEntry() - zis.close() -} - -configure(deobfParams) { - group = 'forgegradle' - description = 'Rename all obfuscated parameter names inherited from Minecraft classes' -} - // Dependency Deobfuscation def deobf(String sourceURL) { @@ -1009,11 +1137,29 @@ def deobf(String sourceURL) { hostName = String.join(".", parts) return deobf(sourceURL, "$hostName/$fileName") - } catch (Exception e) { + } catch (Exception ignored) { return deobf(sourceURL, "deobf/${sourceURL.hashCode()}") } } +def deobfMaven(String repoURL, String mavenDep) { + if (!repoURL.endsWith("/")) { + repoURL += "/" + } + String[] parts = mavenDep.split(":") + parts[0] = parts[0].replace('.', '/') + def jarURL = repoURL + parts[0] + "/" + parts[1] + "/" + parts[2] + "/" + parts[1] + "-" + parts[2] + ".jar" + return deobf(jarURL) +} + +def deobfCurse(String curseDep) { + try { + return deobfMaven("https://www.cursemaven.com/", "curse.maven:$curseDep") + } catch (Exception ignored) { + out.style(Style.Failure).println("Failed to get $curseDep from cursemaven.") + } +} + // The method above is to be preferred. Use this method if the filename is not at the end of the URL. def deobf(String sourceURL, String rawFileName) { String bon2Version = "2.5.1" @@ -1119,7 +1265,7 @@ def getFile(String relativePath) { def getSecondaryArtifacts() { // Because noPublishedSources from the beginning of the script is somehow not visible here... boolean noPublishedSources = project.hasProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false - def secondaryArtifacts = [devJar] + def secondaryArtifacts = [publishableDevJar] if (!noPublishedSources) secondaryArtifacts += [sourcesJar] if (apiPackage) secondaryArtifacts += [apiJar] return secondaryArtifacts diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 5c2d1cf016..ccebba7710 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3ab0b725ef..f398c33c4b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ 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-7.6-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 83f2acfdc3..79a61d421c 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,78 +17,113 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -97,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -105,84 +140,105 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=$((i+1)) + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 9618d8d960..93e3f59f13 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,10 +25,14 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @@ -37,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -51,7 +55,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -61,38 +65,26 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/settings.gradle b/settings.gradle index 93c852a12c..01ea5f121a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,10 +1,28 @@ + +pluginManagement { + repositories { + maven { + // RetroFuturaGradle + name "GTNH Maven" + url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" + allowInsecureProtocol = true + mavenContent { + includeGroup("com.gtnewhorizons.retrofuturagradle") + } + } + gradlePluginPortal() + mavenCentral() + mavenLocal() + } +} + plugins { id 'com.diffplug.blowdryerSetup' version '1.6.0' + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains } -apply plugin: 'com.diffplug.blowdryerSetup' - blowdryerSetup { - github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.1.5') + repoSubfolder 'gtnhShared' + github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0') //devLocal '.' // Use this when testing config updates locally } -- cgit From 22f6d159f03be976170add434a10634ef7b0fc52 Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Mon, 30 Jan 2023 10:37:15 -0800 Subject: [ci skip] spotlessApply with the new settings Former-commit-id: 40aec322188926e1bc5d4d7742af9730dcf4a7b7 --- dependencies.gradle | 2 +- .../bartworks/API/API_ConfigValues.java | 30 +- .../bartimaeusnek/bartworks/API/API_REFERENCE.java | 30 +- .../bartworks/API/AcidGenFuelAdder.java | 32 +- .../bartworks/API/BioObjectAdder.java | 88 +- .../bartworks/API/BioObjectGetter.java | 42 +- .../bartworks/API/BioRecipeAdder.java | 163 ++- .../bartworks/API/BioVatLogicAdder.java | 100 +- .../bartworks/API/BorosilicateGlass.java | 77 +- .../bartimaeusnek/bartworks/API/INoiseGen.java | 29 +- .../bartimaeusnek/bartworks/API/IRadMaterial.java | 29 +- .../bartworks/API/ITileAddsInformation.java | 30 +- .../bartworks/API/ITileDropsContent.java | 32 +- .../API/ITileHasDifferentTextureSides.java | 34 +- .../bartworks/API/LoaderReference.java | 30 +- .../bartimaeusnek/bartworks/API/SideReference.java | 43 +- .../bartworks/API/VoidMinerDropAdder.java | 36 +- .../bartimaeusnek/bartworks/API/WerkstoffAPI.java | 29 +- .../bartworks/API/WerkstoffAdderRegistry.java | 29 +- .../bartworks/API/modularUI/BW_UITextures.java | 59 +- .../bartimaeusnek/bartworks/API/package-info.java | 29 +- .../bartimaeusnek/bartworks/ASM/ASMUtils.java | 30 +- .../github/bartimaeusnek/bartworks/ASM/BWCore.java | 40 +- .../bartimaeusnek/bartworks/ASM/BWCorePlugin.java | 40 +- .../ASM/BWCoreStaticReplacementMethodes.java | 45 +- .../bartworks/ASM/BWCoreTransformer.java | 237 ++-- .../github/bartimaeusnek/bartworks/GuiHandler.java | 37 +- .../github/bartimaeusnek/bartworks/MainMod.java | 55 +- .../client/ClientEventHandler/TooltipCache.java | 34 +- .../ClientEventHandler/TooltipEventHandler.java | 104 +- .../bartworks/client/creativetabs/BioTab.java | 32 +- .../bartworks/client/creativetabs/GT2Tab.java | 32 +- .../client/creativetabs/bartworksTab.java | 32 +- .../client/gui/BW_GUIContainer_RotorBlock.java | 61 +- .../client/renderer/BW_CropVisualizer.java | 34 +- .../client/renderer/BW_EICPistonVisualizer.java | 18 +- .../client/renderer/BW_GT_ItemRenderer.java | 82 +- .../client/renderer/BW_GT_Vanilla_Texture.java | 36 +- .../client/renderer/BW_Renderer_Block_Ores.java | 47 +- .../client/renderer/RendererGlasBlock.java | 46 +- .../renderer/RendererSwitchingColorFluid.java | 103 +- .../client/textures/PrefixTextureLinker.java | 84 +- .../bartworks/common/blocks/BW_Blocks.java | 40 +- .../bartworks/common/blocks/BW_GlasBlocks.java | 47 +- .../bartworks/common/blocks/BW_GlasBlocks2.java | 24 +- .../common/blocks/BW_TileEntityContainer.java | 86 +- .../BW_TileEntityContainer_MachineBlock.java | 36 +- .../blocks/BW_TileEntityContainer_Multiple.java | 68 +- .../bartworks/common/blocks/BioFluidBlock.java | 39 +- .../bartworks/common/commands/ChangeConfig.java | 34 +- .../common/commands/ClearCraftingCache.java | 33 +- .../common/commands/GetWorkingDirectory.java | 33 +- .../common/commands/PrintRecipeListToFile.java | 34 +- .../bartworks/common/commands/RunGC.java | 30 +- .../bartworks/common/commands/SummonRuin.java | 45 +- .../bartworks/common/configs/ConfigHandler.java | 384 +++--- .../bartworks/common/items/BW_ItemBlocks.java | 64 +- .../bartworks/common/items/BW_SimpleWindMeter.java | 67 +- .../bartworks/common/items/BW_Stonage_Rotors.java | 75 +- .../bartworks/common/items/Circuit_Programmer.java | 120 +- .../common/items/GT_Destructopack_Item.java | 59 +- .../bartworks/common/items/GT_Rockcutter_Item.java | 73 +- .../bartworks/common/items/GT_Teslastaff_Item.java | 47 +- .../bartworks/common/items/LabModule.java | 34 +- .../bartworks/common/items/LabParts.java | 71 +- .../bartworks/common/items/SimpleIconItem.java | 34 +- .../bartworks/common/items/SimpleSubItemClass.java | 41 +- .../common/loaders/ArtificialMicaLine.java | 49 +- .../bartworks/common/loaders/BeforeGTPreload.java | 58 +- .../bartworks/common/loaders/BioCultureLoader.java | 63 +- .../bartworks/common/loaders/BioItemList.java | 71 +- .../bartworks/common/loaders/BioLabLoader.java | 29 +- .../bartworks/common/loaders/BioRecipeLoader.java | 424 +++---- .../bartworks/common/loaders/FluidLoader.java | 105 +- .../bartworks/common/loaders/GTNHBlocks.java | 42 +- .../bartworks/common/loaders/ItemRegistry.java | 396 +++---- .../common/loaders/LocalisationLoader.java | 68 +- .../common/loaders/RadioHatchMaterialLoader.java | 86 +- .../bartworks/common/loaders/RecipeLoader.java | 1245 +++++++------------- .../common/loaders/RegisterServerCommands.java | 29 +- .../common/loaders/StaticRecipeChangeLoaders.java | 585 +++++---- .../bartworks/common/net/BW_Network.java | 94 +- .../common/net/CircuitProgrammerPacket.java | 50 +- .../bartworks/common/net/EICPacket.java | 7 +- .../bartworks/common/net/EIGPacket.java | 7 +- .../bartworks/common/net/MetaBlockPacket.java | 69 +- .../bartworks/common/net/OreDictCachePacket.java | 37 +- .../bartworks/common/net/RendererPacket.java | 82 +- .../bartworks/common/net/ServerJoinedPackage.java | 40 +- .../classic/BWTileEntityDimIDBridge.java | 32 +- .../common/tileentities/classic/BW_RotorBlock.java | 35 +- .../BW_TileEntity_ExperimentalFloodGate.java | 39 +- .../classic/BW_TileEntity_HeatedWaterPump.java | 179 ++- .../classic/BW_TileEntity_InfinityTank.java | 53 +- .../classic/BW_TileEntity_LESU_Redux.java | 862 +++++++------- .../common/tileentities/debug/CreativeScanner.java | 44 +- .../tileentities/multis/GT_TileEntity_BioVat.java | 394 +++---- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 196 ++- .../multis/GT_TileEntity_CrackingDistillTower.java | 53 +- .../tileentities/multis/GT_TileEntity_DEHP.java | 123 +- .../GT_TileEntity_ElectricImplosionCompressor.java | 351 +++--- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 782 ++++++------ .../tileentities/multis/GT_TileEntity_HTGR.java | 581 ++++----- .../tileentities/multis/GT_TileEntity_LESU.java | 258 ++-- .../multis/GT_TileEntity_ManualTrafo.java | 223 ++-- .../tileentities/multis/GT_TileEntity_THTR.java | 413 ++----- .../multis/GT_TileEntity_Windmill.java | 379 +++--- .../mega/GT_TileEntity_MegaBlastFurnace.java | 277 ++--- .../mega/GT_TileEntity_MegaChemicalReactor.java | 220 ++-- .../mega/GT_TileEntity_MegaDistillTower.java | 459 +++----- .../mega/GT_TileEntity_MegaMultiBlockBase.java | 180 +-- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 308 ++--- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 488 ++------ .../tiered/GT_MetaTileEntity_AcidGenerator.java | 140 +-- .../tiered/GT_MetaTileEntity_BioLab.java | 489 ++++---- .../GT_MetaTileEntity_CompressedFluidHatch.java | 42 +- .../tiered/GT_MetaTileEntity_Diode.java | 73 +- .../GT_MetaTileEntity_EnergyDistributor.java | 58 +- .../tiered/GT_MetaTileEntity_GiantOutputHatch.java | 33 +- .../tiered/GT_MetaTileEntity_RadioHatch.java | 265 ++--- .../tiered/GT_MetaTileEntity_Transistor.java | 123 +- .../bartworks/neiHandler/BW_NEI_BioLabHandler.java | 41 +- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 42 +- .../bartworks/neiHandler/BW_NEI_OreHandler.java | 90 +- .../bartworks/neiHandler/IMCForNEI.java | 4 +- .../bartworks/neiHandler/NEI_BW_Config.java | 72 +- .../server/EventHandler/ServerEventHandler.java | 46 +- .../system/material/BW_GT_MaterialReference.java | 1106 ++++++++--------- .../material/BW_MetaGeneratedBlock_Item.java | 75 +- .../material/BW_MetaGeneratedBlocks_Casing.java | 68 +- .../BW_MetaGeneratedBlocks_CasingAdvanced_TE.java | 46 +- .../material/BW_MetaGeneratedBlocks_Casing_TE.java | 46 +- .../system/material/BW_MetaGeneratedFrames.java | 69 +- .../system/material/BW_MetaGeneratedOreTE.java | 46 +- .../material/BW_MetaGeneratedSmallOreTE.java | 75 +- .../system/material/BW_MetaGenerated_Block_TE.java | 46 +- .../system/material/BW_MetaGenerated_Blocks.java | 54 +- .../system/material/BW_MetaGenerated_Items.java | 110 +- .../system/material/BW_MetaGenerated_Ores.java | 47 +- .../material/BW_MetaGenerated_SmallOres.java | 42 +- .../BW_MetaGenerated_WerkstoffBlock_TE.java | 47 +- .../material/BW_MetaGenerated_WerkstoffBlocks.java | 42 +- .../system/material/BW_NonMeta_MaterialItems.java | 38 +- .../CircuitGeneration/BW_CircuitsLoader.java | 29 +- .../material/CircuitGeneration/BW_Meta_Items.java | 119 +- .../material/CircuitGeneration/CircuitData.java | 38 +- .../CircuitGeneration/CircuitImprintLoader.java | 167 ++- .../CircuitGeneration/CircuitPartLoader.java | 193 ++- .../material/GT_Enhancement/BWGTMetaItems.java | 113 +- .../GT_Enhancement/GTMetaItemEnhancer.java | 87 +- .../material/GT_Enhancement/LuVTierEnhancer.java | 183 ++- .../GT_Enhancement/PlatinumSludgeOverHaul.java | 621 +++++----- .../bartworks/system/material/Werkstoff.java | 314 ++--- .../bartworks/system/material/WerkstoffLoader.java | 728 +++++------- .../processingLoaders/AdditionalRecipes.java | 383 +++--- .../processingLoaders/AfterLuVTierEnhacement.java | 38 +- .../material/processingLoaders/DownTierLoader.java | 39 +- .../processingLoaders/LoadItemContainers.java | 130 +- .../werkstoff_loaders/IWerkstoffRunnable.java | 30 +- .../werkstoff_loaders/recipe/AspectLoader.java | 47 +- .../werkstoff_loaders/recipe/BlockLoader.java | 40 +- .../werkstoff_loaders/recipe/CasingLoader.java | 71 +- .../werkstoff_loaders/recipe/CellLoader.java | 171 +-- .../recipe/CraftingMaterialLoader.java | 166 +-- .../werkstoff_loaders/recipe/CrushedLoader.java | 141 ++- .../werkstoff_loaders/recipe/DustLoader.java | 387 +++--- .../werkstoff_loaders/recipe/GemLoader.java | 89 +- .../werkstoff_loaders/recipe/MetalLoader.java | 31 +- .../werkstoff_loaders/recipe/MoltenCellLoader.java | 43 +- .../recipe/MultipleMetalLoader.java | 63 +- .../werkstoff_loaders/recipe/OreLoader.java | 39 +- .../recipe/SimpleMetalLoader.java | 104 +- .../werkstoff_loaders/recipe/ToolLoader.java | 802 ++++--------- .../registration/AssociationLoader.java | 34 +- .../registration/BridgeMaterialsLoader.java | 82 +- .../registration/CasingRegistrator.java | 33 +- .../bartworks/system/object/AbstractedStack.java | 33 +- .../bartworks/system/oredict/OreDictAdder.java | 35 +- .../bartworks/system/oredict/OreDictHandler.java | 66 +- .../bartworks/system/oregen/BW_OreLayer.java | 133 +-- .../bartworks/system/oregen/BW_WordGenerator.java | 60 +- .../system/oregen/BW_WorldGenRoss128b.java | 130 +- .../system/oregen/BW_WorldGenRoss128ba.java | 95 +- .../bartworks/system/worldgen/GT_WorldgenUtil.java | 35 +- .../bartworks/system/worldgen/MapGenRuins.java | 255 ++-- .../bartimaeusnek/bartworks/util/BWRecipes.java | 660 ++++------- .../bartimaeusnek/bartworks/util/BW_ColorUtil.java | 100 +- .../bartworks/util/BW_Tooltip_Reference.java | 52 +- .../bartimaeusnek/bartworks/util/BW_Util.java | 454 +++---- .../bartimaeusnek/bartworks/util/BioCulture.java | 118 +- .../bartimaeusnek/bartworks/util/BioDNA.java | 29 +- .../bartimaeusnek/bartworks/util/BioData.java | 43 +- .../bartimaeusnek/bartworks/util/BioPlasmid.java | 29 +- .../bartworks/util/CachedReflectionUtils.java | 3 + .../bartworks/util/ChatColorHelper.java | 29 +- .../bartworks/util/ConnectedBlocksChecker.java | 51 +- .../util/ConnectedBlocksCheckerIteration.java | 55 +- .../bartimaeusnek/bartworks/util/Coords.java | 29 +- .../bartimaeusnek/bartworks/util/EnumUtils.java | 103 +- .../bartimaeusnek/bartworks/util/MathUtils.java | 29 +- .../bartimaeusnek/bartworks/util/MegaUtils.java | 29 +- .../bartimaeusnek/bartworks/util/MurmurHash3.java | 67 +- .../bartworks/util/NoiseUtil/BartsNoise.java | 154 ++- .../bartworks/util/NoiseUtil/SimplexNoise.java | 101 +- .../bartworks/util/NonNullWrappedHashMap.java | 33 +- .../bartworks/util/NonNullWrappedHashSet.java | 29 +- .../github/bartimaeusnek/bartworks/util/Pair.java | 35 +- .../bartworks/util/RecipeFinderForParallel.java | 51 +- .../bartimaeusnek/bartworks/util/StreamUtils.java | 33 +- .../accessprioritylist/AccessPriorityList.java | 41 +- .../AccessPriorityListIterators.java | 38 +- .../accessprioritylist/AccessPriorityListNode.java | 29 +- .../bartworks/util/flowerset/FlowerSet.java | 31 +- .../bartimaeusnek/bartworks/util/log/DebugLog.java | 39 +- .../bartimaeusnek/bartworks/util/package-info.java | 29 +- .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 90 +- .../crossmod/GTpp/loader/RadioHatchCompat.java | 98 +- .../crossmod/ae2/ItemSingleItemStorageCell.java | 192 +-- .../bartimaeusnek/crossmod/cls/CLSCompat.java | 37 +- .../crossmod/emt/recipe/TCRecipeHandler.java | 244 ++-- .../multi/GT_Industrial_Alchemic_Construct.java | 62 +- .../crossmod/emt/util/EMTHandler.java | 37 +- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 252 ++-- .../galacticgreg/GT_TileEntity_VoidMiners.java | 29 +- .../crossmod/galacticraft/GalacticraftProxy.java | 43 +- .../crossmod/galacticraft/PlanetsHelperClass.java | 33 +- .../galacticraft/UniversalTeleportType.java | 34 +- .../atmosphere/BWAtmosphereManager.java | 77 +- .../galacticraft/blocks/UniversalSpaceBlocks.java | 34 +- .../galacticraft/creativetabs/SpaceTab.java | 32 +- .../planets/AbstractWorldProviderSpace.java | 30 +- .../planets/ross128b/ChunkProviderRoss128b.java | 65 +- .../planets/ross128b/SkyProviderRoss128b.java | 37 +- .../planets/ross128b/WorldProviderRoss128b.java | 40 +- .../planets/ross128ba/ChunkProviderRoss128ba.java | 43 +- .../planets/ross128ba/WorldProviderRoss128ba.java | 38 +- .../solarsystems/Ross128SolarSystem.java | 59 +- .../tileEntity/DysonSwarmSunReplacement.java | 60 +- .../galaxySpace/tileEntity/GalaxySpaceProxy.java | 29 +- .../crossmod/openComputers/GT_NBT_DataBase.java | 36 +- .../openComputers/TileEntity_GTDataServer.java | 63 +- .../tectech/TT_TileEntity_ManualTrafo.java | 37 +- .../crossmod/tectech/TecTechEnabledMulti.java | 114 +- .../crossmod/tectech/TecTechResearchLoader.java | 134 +-- .../crossmod/tectech/helper/IHasCoils.java | 30 +- .../crossmod/tectech/helper/TecTechUtils.java | 49 +- .../tectech/tileentites/tiered/LowPowerLaser.java | 44 +- .../tiered/TT_Abstract_LowPowerLaserThingy.java | 74 +- .../tiered/TT_MetaTileEntity_LowPowerLaserBox.java | 137 +-- .../TT_MetaTileEntity_LowPowerLaserDynamo.java | 59 +- .../TT_MetaTileEntity_LowPowerLaserHatch.java | 59 +- .../TT_MetaTileEntity_Pipe_Energy_LowPower.java | 114 +- .../crossmod/tgregworks/MaterialsInjector.java | 60 +- .../crossmod/thaumcraft/CustomAspects.java | 77 +- .../tile/GT_Multi_IndustrialCrucible.java | 36 +- .../crossmod/thaumcraft/tile/GT_WandBuffer.java | 36 +- .../thaumcraft/util/ThaumcraftHandler.java | 114 +- 257 files changed, 12670 insertions(+), 17078 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 6438489b5a..a4f0718b63 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.232:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.254:dev") compile("com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev") compile("com.github.GTNewHorizons:TecTech:5.0.67:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.3.20-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java index 679e4f9cd3..68a88b39ce 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java @@ -1,28 +1,20 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.API; public class API_ConfigValues { + // One-Side-Only public static boolean debugLog = true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java index 97de86473e..fea78559ad 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java @@ -1,26 +1,18 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.API; public final class API_REFERENCE { + public static final String VERSION = "GRADLETOKEN_VERSION"; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java index e7696f25ed..59324c8002 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java @@ -1,30 +1,22 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.API; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.util.BWRecipes; import gregtech.api.enums.Materials; -import net.minecraftforge.fluids.FluidStack; public final class AcidGenFuelAdder { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java index e8e9bf1f09..a4a2c1b799 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -1,48 +1,42 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.API; +import java.awt.*; + +import net.minecraft.item.EnumRarity; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.util.BioCulture; import com.github.bartimaeusnek.bartworks.util.BioDNA; import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.objects.GT_Fluid; import gregtech.api.util.GT_Utility; -import java.awt.*; -import net.minecraft.item.EnumRarity; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; @SuppressWarnings("ALL") public final class BioObjectAdder { - // @Deprecated - // public static BioCulture createAndRegisterBioCulture(Color color, String name, long ID, BioPlasmid plasmid, + // @Deprecated + // public static BioCulture createAndRegisterBioCulture(Color color, String name, long ID, BioPlasmid plasmid, // BioDNA dna, EnumRarity rarity){ - // return BioCulture.createAndRegisterBioCulture(color,name,ID,plasmid,dna,rarity); - // } + // return BioCulture.createAndRegisterBioCulture(color,name,ID,plasmid,dna,rarity); + // } /** * @param color the color of the Culture @@ -53,14 +47,13 @@ public final class BioObjectAdder { * @param rarity visual * @return */ - public static BioCulture createAndRegisterBioCulture( - Color color, String name, BioPlasmid plasmid, BioDNA dna, EnumRarity rarity, boolean breedable) { + public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, + EnumRarity rarity, boolean breedable) { if (BioCulture.BIO_CULTURE_ARRAY_LIST.size() > 1) return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, rarity, breedable); - else - new Exception( - "Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!") - .printStackTrace(); + else new Exception( + "Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -74,14 +67,13 @@ public final class BioObjectAdder { * @param breedable if the culture can be inserted into the BacterialVat * @return */ - public static BioCulture createAndRegisterBioCulture( - Color color, String name, BioPlasmid plasmid, BioDNA dna, boolean breedable) { + public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, + boolean breedable) { if (BioCulture.BIO_CULTURE_ARRAY_LIST.size() > 1) return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, breedable); - else - new Exception( - "Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!") - .printStackTrace(); + else new Exception( + "Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -168,20 +160,20 @@ public final class BioObjectAdder { } /** - * If you get NPE's related to BioCultures (most likely because of Load Order or creating BioCultures after the postinit Phase) execute this. + * If you get NPE's related to BioCultures (most likely because of Load Order or creating BioCultures after the + * postinit Phase) execute this. */ public static void regenerateBioFluids() { - FluidStack dnaFluid = LoaderReference.gendustry - ? FluidRegistry.getFluidStack("liquiddna", 100) + FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L); for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.getFluidNotSet()) { - B.setFluid(new GT_Fluid( - B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[] { - (short) B.getColor().getRed(), - (short) B.getColor().getBlue(), - (short) B.getColor().getGreen() - })); + B.setFluid( + new GT_Fluid( + B.getName().replaceAll(" ", "").toLowerCase() + "fluid", + "molten.autogenerated", + new short[] { (short) B.getColor().getRed(), (short) B.getColor().getBlue(), + (short) B.getColor().getGreen() })); if (!FluidRegistry.registerFluid(B.getFluid())) new Exception("FAILED TO REGISTER FLUID FOR: " + B.getName()).printStackTrace(); GT_Values.RA.addCentrifugeRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java index 145f762e30..35c12e1cae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java @@ -1,35 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.API; +import java.util.Collection; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; import com.github.bartimaeusnek.bartworks.util.BioCulture; import com.github.bartimaeusnek.bartworks.util.BioDNA; import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; -import java.util.Collection; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; @SuppressWarnings("ALL") public final class BioObjectGetter { @@ -109,10 +102,7 @@ public final class BioObjectGetter { } /** - * 1 - DetergentPowder - * 2 - Agarose - * 3 - IncubationModule - * 4 - Plasma Membrane + * 1 - DetergentPowder 2 - Agarose 3 - IncubationModule 4 - Plasma Membrane * * @param selection * @return the selected Item diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java index 7a355b332d..aadc5d53ae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java @@ -1,35 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.API; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; -import com.github.bartimaeusnek.bartworks.util.BioCulture; -import gregtech.api.enums.Materials; import javax.annotation.Nonnegative; import javax.annotation.Nonnull; + import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.BioCulture; +import gregtech.api.enums.Materials; + @SuppressWarnings("ALL") public final class BioRecipeAdder { @@ -37,18 +30,19 @@ public final class BioRecipeAdder { public static final int LOWGRAVITY = -100; public static final int CLEANROOM = -200; - public static boolean addBioLabRecipe( - ItemStack[] aInputs, - ItemStack aOutput, - ItemStack aSpecialItems, - int[] aChances, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, + public static boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, ItemStack aSpecialItems, + int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { return BWRecipes.instance.addBioLabRecipe( - aInputs, aOutput, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + aInputs, + aOutput, + aSpecialItems, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue); } /** @@ -63,20 +57,15 @@ public final class BioRecipeAdder { * @param aSpecialValue 0 = STANDART, -100 = LowGravity, -200 = Cleanroom * @return if the recipe was added. */ - public static boolean addBioLabRecipeIncubation( - ItemStack aInput, - BioCulture aOutput, - int[] aChances, - FluidStack aFluidInputs, - int aDuration, - int aEUt, - int aSpecialValue) { - return BWRecipes.instance.addBioLabRecipeIncubation( - aInput, aOutput, aChances, aFluidInputs, aDuration, aEUt, aSpecialValue); + public static boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, + FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { + return BWRecipes.instance + .addBioLabRecipeIncubation(aInput, aOutput, aChances, aFluidInputs, aDuration, aEUt, aSpecialValue); } /** - * @param aInputs Item Inputs, DO NOT PUT INTEGRATED CIRCUITS IN HERE! THEY WILL GET ADDED AUTOMATICALLY!, can be null + * @param aInputs Item Inputs, DO NOT PUT INTEGRATED CIRCUITS IN HERE! THEY WILL GET ADDED AUTOMATICALLY!, can + * be null * @param aCulture the bio culture * @param aFluidInputs may not be null * @param aFluidOutputs may not be null @@ -88,23 +77,25 @@ public final class BioRecipeAdder { * @param exactSv if the recipe needs EXACTLY the Sv or can use less... * @return */ - public static boolean addBacterialVatRecipe( - ItemStack[] aInputs, - @Nonnull BioCulture aCulture, - @Nonnull FluidStack[] aFluidInputs, - @Nonnull FluidStack[] aFluidOutputs, - @Nonnegative int aDuration, - @Nonnegative int aEUt, - int Sv, - @Nonnegative int glasTier, - int aSpecialValue, - boolean exactSv) { + public static boolean addBacterialVatRecipe(ItemStack[] aInputs, @Nonnull BioCulture aCulture, + @Nonnull FluidStack[] aFluidInputs, @Nonnull FluidStack[] aFluidOutputs, @Nonnegative int aDuration, + @Nonnegative int aEUt, int Sv, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { return BWRecipes.instance.addBacterialVatRecipe( - aInputs, aCulture, aFluidInputs, aFluidOutputs, aDuration, aEUt, Sv, glasTier, aSpecialValue, exactSv); + aInputs, + aCulture, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + Sv, + glasTier, + aSpecialValue, + exactSv); } /** - * @param aInputs Item Inputs, DO NOT PUT INTEGRATED CIRCUITS IN HERE! THEY WILL GET ADDED AUTOMATICALLY!, can be null + * @param aInputs Item Inputs, DO NOT PUT INTEGRATED CIRCUITS IN HERE! THEY WILL GET ADDED AUTOMATICALLY!, can + * be null * @param aCulture the bio culture * @param aFluidInputs may not be null * @param aFluidOutputs may not be null @@ -116,17 +107,9 @@ public final class BioRecipeAdder { * @param exactSv if the recipe needs EXACTLY the Sv or can use less... * @return */ - public static boolean addBacterialVatRecipe( - ItemStack[] aInputs, - @Nonnull BioCulture aCulture, - @Nonnull FluidStack[] aFluidInputs, - @Nonnull FluidStack[] aFluidOutputs, - @Nonnegative int aDuration, - @Nonnegative int aEUt, - Materials material, - @Nonnegative int glasTier, - int aSpecialValue, - boolean exactSv) { + public static boolean addBacterialVatRecipe(ItemStack[] aInputs, @Nonnull BioCulture aCulture, + @Nonnull FluidStack[] aFluidInputs, @Nonnull FluidStack[] aFluidOutputs, @Nonnegative int aDuration, + @Nonnegative int aEUt, Materials material, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { return BWRecipes.instance.addBacterialVatRecipe( aInputs, aCulture, @@ -140,45 +123,45 @@ public final class BioRecipeAdder { exactSv); } - // public static boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] + // public static boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] // aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSievert) { - // return BWRecipes.instance.addBacterialVatRecipe(aInputs, aOutputs, aFluidInputs, aFluidOutputs, aDuration, + // return BWRecipes.instance.addBacterialVatRecipe(aInputs, aOutputs, aFluidInputs, aFluidOutputs, aDuration, // aEUt, aSievert); - // } + // } - // @Deprecated - // public static boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, + // @Deprecated + // public static boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ - // return BWRecipes.instance.addBioLabRecipeDNAExtraction(aInputs, aOutput, aChances, aFluidInputs, + // return BWRecipes.instance.addBioLabRecipeDNAExtraction(aInputs, aOutput, aChances, aFluidInputs, // aFluidOutputs, aDuration, aEUt, aSpecialValue); - // } + // } // - // @Deprecated - // public static boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, + // @Deprecated + // public static boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ - // return BWRecipes.instance.addBioLabRecipePCRThermoclycling(aInputs, aOutput, aChances, aFluidInputs, + // return BWRecipes.instance.addBioLabRecipePCRThermoclycling(aInputs, aOutput, aChances, aFluidInputs, // aFluidOutputs, aDuration, aEUt, aSpecialValue); - // } + // } // - // @Deprecated - // public static boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, + // @Deprecated + // public static boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ - // return BWRecipes.instance.addBioLabRecipePlasmidSynthesis(aInputs, aOutput, aChances, aFluidInputs, + // return BWRecipes.instance.addBioLabRecipePlasmidSynthesis(aInputs, aOutput, aChances, aFluidInputs, // aFluidOutputs, aDuration, aEUt, aSpecialValue); - // } + // } // - // @Deprecated - // public static boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, + // @Deprecated + // public static boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ - // return BWRecipes.instance.addBioLabRecipeTransformation(aInputs, aOutput, aChances, aFluidInputs, + // return BWRecipes.instance.addBioLabRecipeTransformation(aInputs, aOutput, aChances, aFluidInputs, // aFluidOutputs, aDuration, aEUt, aSpecialValue); - // } + // } // - // @Deprecated - // public static boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] + // @Deprecated + // public static boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] // aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ - // return BWRecipes.instance.addBioLabRecipeClonalCellularSynthesis(aInputs, aOutput, aChances, aFluidInputs, + // return BWRecipes.instance.addBioLabRecipeClonalCellularSynthesis(aInputs, aOutput, aChances, aFluidInputs, // aFluidOutputs, aDuration, aEUt, aSpecialValue); - // } + // } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java index e850e4135b..56601399e4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -1,43 +1,38 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.API; import static cpw.mods.fml.common.registry.GameRegistry.findBlock; -import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.util.GT_ModHandler; import java.util.HashMap; import java.util.HashSet; import java.util.Objects; + import javax.annotation.Nonnegative; import javax.annotation.Nonnull; + import net.minecraft.block.Block; import net.minecraft.item.ItemStack; +import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Util; + +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_ModHandler; + @SuppressWarnings("ALL") public final class BioVatLogicAdder { @@ -61,11 +56,17 @@ public final class BioVatLogicAdder { giveItemStackRadioHatchAbilites(ItemList.Uraniumcell_4.get(1), Materials.Uranium, 12); giveItemStackRadioHatchAbilites( - BW_NonMeta_MaterialItems.TiberiumCell_1.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 3); + BW_NonMeta_MaterialItems.TiberiumCell_1.get(1), + WerkstoffLoader.Tiberium.getBridgeMaterial(), + 3); giveItemStackRadioHatchAbilites( - BW_NonMeta_MaterialItems.TiberiumCell_2.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 6); + BW_NonMeta_MaterialItems.TiberiumCell_2.get(1), + WerkstoffLoader.Tiberium.getBridgeMaterial(), + 6); giveItemStackRadioHatchAbilites( - BW_NonMeta_MaterialItems.TiberiumCell_4.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 12); + BW_NonMeta_MaterialItems.TiberiumCell_4.get(1), + WerkstoffLoader.Tiberium.getBridgeMaterial(), + 12); giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TheCoreCell.get(1), Materials.Naquadah, 96); @@ -78,18 +79,36 @@ public final class BioVatLogicAdder { giveItemStackRadioHatchAbilites(ItemList.Depleted_Naquadah_4.get(1), Materials.Naquadah, 12, 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem("IC2", "reactorMOXSimpledepleted", 1), Materials.Plutonium, 3, 10); + GT_ModHandler.getModItem("IC2", "reactorMOXSimpledepleted", 1), + Materials.Plutonium, + 3, + 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem("IC2", "reactorMOXDualdepleted", 1), Materials.Plutonium, 6, 10); + GT_ModHandler.getModItem("IC2", "reactorMOXDualdepleted", 1), + Materials.Plutonium, + 6, + 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem("IC2", "reactorMOXQuaddepleted", 1), Materials.Plutonium, 12, 10); + GT_ModHandler.getModItem("IC2", "reactorMOXQuaddepleted", 1), + Materials.Plutonium, + 12, + 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem("IC2", "reactorUraniumSimpledepleted", 1), Materials.Uranium, 3, 10); + GT_ModHandler.getModItem("IC2", "reactorUraniumSimpledepleted", 1), + Materials.Uranium, + 3, + 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem("IC2", "reactorUraniumDualdepleted", 1), Materials.Uranium, 6, 10); + GT_ModHandler.getModItem("IC2", "reactorUraniumDualdepleted", 1), + Materials.Uranium, + 6, + 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem("IC2", "reactorUraniumQuaddepleted", 1), Materials.Uranium, 12, 10); + GT_ModHandler.getModItem("IC2", "reactorUraniumQuaddepleted", 1), + Materials.Uranium, + 12, + 10); giveItemStackRadioHatchAbilites( BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), @@ -108,7 +127,10 @@ public final class BioVatLogicAdder { 10); giveItemStackRadioHatchAbilites( - BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), Materials.Naquadah, 96, 10); + BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), + Materials.Naquadah, + 96, + 10); if (WerkstoffLoader.gtnhGT) { giveItemStackRadioHatchAbilites(ItemList.MNqCell_1.get(1), Materials.Naquadria, 3); @@ -202,10 +224,8 @@ public final class BioVatLogicAdder { Block block = findBlock(sModname, sUnlocBlockName); boolean ret = block != null; if (ret) BioVatGlass.glasses.put(new BlockMetaPair(block, (byte) meta), (byte) tier); - else - new IllegalArgumentException( - "Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!") - .printStackTrace(); + else new IllegalArgumentException( + "Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!").printStackTrace(); block = null; return ret; } @@ -241,6 +261,7 @@ public final class BioVatLogicAdder { } public static class MaterialSvPair { + final Materials materials; final Integer sievert; @@ -273,6 +294,7 @@ public final class BioVatLogicAdder { } public static class BlockMetaPair { + final Block block; final Byte aByte; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java index 6390dcc19b..0242fd3650 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java @@ -2,31 +2,35 @@ package com.github.bartimaeusnek.bartworks.API; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import com.google.common.collect.HashBasedTable; -import com.google.common.collect.LinkedHashMultimap; -import com.google.common.collect.SetMultimap; -import com.google.common.collect.Table; -import com.gtnewhorizon.structurelib.structure.IStructureElement; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.LoaderState; -import cpw.mods.fml.common.registry.GameRegistry; import java.util.ArrayList; import java.util.List; import java.util.PriorityQueue; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Collectors; + import net.minecraft.block.Block; + import org.apache.commons.lang3.tuple.Pair; +import com.google.common.collect.HashBasedTable; +import com.google.common.collect.LinkedHashMultimap; +import com.google.common.collect.SetMultimap; +import com.google.common.collect.Table; +import com.gtnewhorizon.structurelib.structure.IStructureElement; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.LoaderState; +import cpw.mods.fml.common.registry.GameRegistry; + /** * API for bartworks borosilicate glass. *

* You might have noticed this API does not expose any Block instance, but only IStructureElements. This is in case we * add more glass blocks later, and we run out of meta id for only one block. *

- * IStructureElements returned from this class SHOULD NOT have its methods called before post init, or else - * you might end up with wrong autoplace hints. + * IStructureElements returned from this class SHOULD NOT have its methods called before post init, or else you + * might end up with wrong autoplace hints. */ public class BorosilicateGlass { @@ -49,8 +53,8 @@ public class BorosilicateGlass { return block2; } - private static void doRegister( - byte level, Block block, int meta, SetMultimap> allLevels) { + private static void doRegister(byte level, Block block, int meta, + SetMultimap> allLevels) { allLevels.put(level, Pair.of(block, meta)); allLevelsReverse.put(block, meta, level); } @@ -119,8 +123,9 @@ public class BorosilicateGlass { } /** - * Get a structure element for a certain tier of borosilicate glass. DOES NOT accept other glass like reinforced glass, magic mirror, vanilla glass, etc. - * unless these glass are explicitly registered as a borosilicate glass. + * Get a structure element for a certain tier of borosilicate glass. DOES NOT accept other glass like + * reinforced glass, magic mirror, vanilla glass, etc. unless these glass are explicitly registered as a + * borosilicate glass. *

* Use this if you just want boroglass here and doesn't care what tier it is. */ @@ -133,8 +138,8 @@ public class BorosilicateGlass { } /** - * Get a structure element for any kind of borosilicate glass. DOES NOT accept other glass like reinforced glass, magic mirror, vanilla glass, etc. - * unless these glass are explicitly registered as a borosilicate glass. + * Get a structure element for any kind of borosilicate glass. DOES NOT accept other glass like reinforced + * glass, magic mirror, vanilla glass, etc. unless these glass are explicitly registered as a borosilicate glass. *

* Use this if you just want boroglass here and doesn't care what tier it is. */ @@ -143,46 +148,46 @@ public class BorosilicateGlass { } /** - * Get a structure element for borosilicate glass. DOES NOT accept other glass like reinforced glass, magic mirror, vanilla glass, etc. - * unless these glass are explicitly registered as a borosilicate glass. + * Get a structure element for borosilicate glass. DOES NOT accept other glass like reinforced glass, magic + * mirror, vanilla glass, etc. unless these glass are explicitly registered as a borosilicate glass. *

* This assumes you want all glass used to be of the same tier. *

- * NOTE: This will accept the basic boron glass (HV tier) as well. You might not want this. Use the other overload to filter this out. + * NOTE: This will accept the basic boron glass (HV tier) as well. You might not want this. Use the other overload + * to filter this out. * * @param initialValue the value set before structure check started */ - public static IStructureElement ofBoroGlass( - byte initialValue, BiConsumer setter, Function getter) { + public static IStructureElement ofBoroGlass(byte initialValue, BiConsumer setter, + Function getter) { return lazy( t -> ofBlocksTiered(BorosilicateGlass::getTier, getRepresentatives(), initialValue, setter, getter)); } /** - * Get a structure element for borosilicate glass. DOES NOT accept other glass like reinforced glass, magic mirror, vanilla glass, etc. - * unless these glass are explicitly registered as a borosilicate glass. + * Get a structure element for borosilicate glass. DOES NOT accept other glass like reinforced glass, magic + * mirror, vanilla glass, etc. unless these glass are explicitly registered as a borosilicate glass. * * @param initialValue the value set before structure check started * @param minTier minimal accepted tier. inclusive. must be greater than 0. * @param maxTier maximal accepted tier. inclusive. */ - public static IStructureElement ofBoroGlass( - byte initialValue, byte minTier, byte maxTier, BiConsumer setter, Function getter) { + public static IStructureElement ofBoroGlass(byte initialValue, byte minTier, byte maxTier, + BiConsumer setter, Function getter) { if (minTier > maxTier || minTier < 0) throw new IllegalArgumentException(); - return lazy(t -> ofBlocksTiered( - (block1, meta) -> checkWithinBound(getTier(block1, meta), minTier, maxTier), - getRepresentatives().stream() - .skip(Math.max(minTier - 3, 0)) - .limit(maxTier - minTier + 1) - .collect(Collectors.toList()), - initialValue, - setter, - getter)); + return lazy( + t -> ofBlocksTiered( + (block1, meta) -> checkWithinBound(getTier(block1, meta), minTier, maxTier), + getRepresentatives().stream().skip(Math.max(minTier - 3, 0)).limit(maxTier - minTier + 1) + .collect(Collectors.toList()), + initialValue, + setter, + getter)); } /** - * Get the tier of this borosilicate glass. DOES NOT consider other glass like reinforced glass, magic mirror, vanilla glass, etc. - * unless these glass are explicitly registered as a borosilicate glass. + * Get the tier of this borosilicate glass. DOES NOT consider other glass like reinforced glass, magic + * mirror, vanilla glass, etc. unless these glass are explicitly registered as a borosilicate glass. * * @return glass tier, or -1 if is not a borosilicate glass */ diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java index 61ce6d2c8a..4a85029994 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.API; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java index 19f422265b..9d2e2d7829 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.API; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java index d7de7ee822..d74263115b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java @@ -1,27 +1,19 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.API; public interface ITileAddsInformation { + String[] getInfoData(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java index 22403b5cc1..1f75115752 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.API; @@ -25,7 +16,8 @@ package com.github.bartimaeusnek.bartworks.API; import net.minecraft.inventory.ISidedInventory; public interface ITileDropsContent extends ISidedInventory { + default int[] getDropSlots() { - return new int[] {0}; + return new int[] { 0 }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java index 473908c7a3..4100b17760 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java @@ -1,33 +1,25 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.API; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public interface ITileHasDifferentTextureSides { IIcon[] texture = new IIcon[7]; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java index 14c56e7ad9..acc2da9ede 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.API; @@ -28,6 +19,7 @@ import cpw.mods.fml.common.Loader; * DO NOT CALL THIS IN THE CORE MOD! IT WILL __NOT__ WORK AND FUCK EVERYTHING UP! */ public class LoaderReference { + private LoaderReference() {} public static boolean Natura; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java index a11e0c4a03..041096d4f6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.API; @@ -27,16 +18,14 @@ import cpw.mods.fml.common.FMLCommonHandler; public class SideReference { public static class EffectiveSide { - public static final boolean Server = - FMLCommonHandler.instance().getEffectiveSide().isServer(); - public static final boolean Client = - FMLCommonHandler.instance().getEffectiveSide().isClient(); + + public static final boolean Server = FMLCommonHandler.instance().getEffectiveSide().isServer(); + public static final boolean Client = FMLCommonHandler.instance().getEffectiveSide().isClient(); } public static class Side { - public static final boolean Server = - FMLCommonHandler.instance().getSide().isServer(); - public static final boolean Client = - FMLCommonHandler.instance().getSide().isClient(); + + public static final boolean Server = FMLCommonHandler.instance().getSide().isServer(); + public static final boolean Client = FMLCommonHandler.instance().getSide().isClient(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java index 29b84ae5ca..7dd376c310 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java @@ -1,39 +1,31 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.API; -import gregtech.api.interfaces.ISubTagContainer; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import gregtech.api.interfaces.ISubTagContainer; + public class VoidMinerDropAdder { private static Method getExtraDropsDimMap; static { try { - getExtraDropsDimMap = Class.forName( - "com.github.bartimaeusnek.crossmod.galacticgreg.GT_TileEntity_VoidMiner_Base") + getExtraDropsDimMap = Class + .forName("com.github.bartimaeusnek.crossmod.galacticgreg.GT_TileEntity_VoidMiner_Base") .getMethod("addMatierialToDimensionList", int.class, ISubTagContainer.class, float.class); } catch (NoSuchMethodException | ClassNotFoundException e) { e.printStackTrace(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java index f8079ff6ff..17a33e768d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.API; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java index 577e9621ff..2cd29281f4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.API; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/modularUI/BW_UITextures.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/modularUI/BW_UITextures.java index 86d9d2c0b8..590486cf6e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/modularUI/BW_UITextures.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/modularUI/BW_UITextures.java @@ -2,17 +2,18 @@ package com.github.bartimaeusnek.bartworks.API.modularUI; import static com.github.bartimaeusnek.bartworks.MainMod.MOD_ID; -import com.gtnewhorizons.modularui.api.drawable.AdaptableUITexture; -import com.gtnewhorizons.modularui.api.drawable.UITexture; import java.util.stream.Collectors; import java.util.stream.IntStream; +import com.gtnewhorizons.modularui.api.drawable.AdaptableUITexture; +import com.gtnewhorizons.modularui.api.drawable.UITexture; + public class BW_UITextures { - public static final AdaptableUITexture BACKGROUND_BROWN = - AdaptableUITexture.of(MOD_ID, "GUI/background/brown", 176, 166, 3); - public static final UITexture BACKGROUND_CIRCUIT_PROGRAMMER = - UITexture.fullImage(MOD_ID, "GUI/background/circuit_programmer"); + public static final AdaptableUITexture BACKGROUND_BROWN = AdaptableUITexture + .of(MOD_ID, "GUI/background/brown", 176, 166, 3); + public static final UITexture BACKGROUND_CIRCUIT_PROGRAMMER = UITexture + .fullImage(MOD_ID, "GUI/background/circuit_programmer"); public static final AdaptableUITexture SLOT_BROWN = AdaptableUITexture.of(MOD_ID, "GUI/slot/brown", 18, 18, 1); @@ -23,34 +24,32 @@ public class BW_UITextures { public static final UITexture OVERLAY_SLOT_CROSS = UITexture.fullImage(MOD_ID, "GUI/overlay_slot/cross"); public static final UITexture PROGRESSBAR_SIEVERT = UITexture.fullImage(MOD_ID, "GUI/progressbar/sievert"); - public static final UITexture PROGRESSBAR_STORED_EU_116 = - UITexture.fullImage(MOD_ID, "GUI/progressbar/stored_eu_116"); + public static final UITexture PROGRESSBAR_STORED_EU_116 = UITexture + .fullImage(MOD_ID, "GUI/progressbar/stored_eu_116"); public static final UITexture PROGRESSBAR_FUEL = UITexture.fullImage(MOD_ID, "GUI/progressbar/fuel"); public static final UITexture PICTURE_BW_LOGO_47X21 = UITexture.fullImage(MOD_ID, "GUI/picture/bw_logo_47x21"); - public static final UITexture PICTURE_SIEVERT_CONTAINER = - UITexture.fullImage(MOD_ID, "GUI/picture/sievert_container"); - public static final UITexture PICTURE_DECAY_TIME_CONTAINER = - UITexture.fullImage(MOD_ID, "GUI/picture/decay_time_container"); - public static final UITexture PICTURE_DECAY_TIME_INSIDE = - UITexture.fullImage(MOD_ID, "GUI/picture/decay_time_inside"); + public static final UITexture PICTURE_SIEVERT_CONTAINER = UITexture + .fullImage(MOD_ID, "GUI/picture/sievert_container"); + public static final UITexture PICTURE_DECAY_TIME_CONTAINER = UITexture + .fullImage(MOD_ID, "GUI/picture/decay_time_container"); + public static final UITexture PICTURE_DECAY_TIME_INSIDE = UITexture + .fullImage(MOD_ID, "GUI/picture/decay_time_inside"); public static final UITexture PICTURE_RADIATION = UITexture.fullImage(MOD_ID, "GUI/picture/radiation"); public static final UITexture PICTURE_WINDMILL_EMPTY = UITexture.fullImage(MOD_ID, "GUI/picture/windmill_empty"); - public static final UITexture[] PICTURE_WINDMILL_ROTATING = IntStream.range(0, 4) - .mapToObj(i -> - UITexture.partly(MOD_ID, "GUI/picture/windmill_rotating", 32, 128, 0, i * 32, 32, (i + 1) * 32)) - .collect(Collectors.toList()) - .toArray(new UITexture[0]); + public static final UITexture[] PICTURE_WINDMILL_ROTATING = IntStream.range(0, 4).mapToObj( + i -> UITexture.partly(MOD_ID, "GUI/picture/windmill_rotating", 32, 128, 0, i * 32, 32, (i + 1) * 32)) + .collect(Collectors.toList()).toArray(new UITexture[0]); public static final UITexture PICTURE_STORED_EU_FRAME = UITexture.fullImage(MOD_ID, "GUI/picture/stored_eu_frame"); - public static final UITexture PICTURE_RADIATION_SHUTTER_FRAME = - UITexture.fullImage(MOD_ID, "GUI/picture/radiation_shutter_frame"); - public static final AdaptableUITexture PICTURE_RADIATION_SHUTTER_INSIDE = - AdaptableUITexture.of(MOD_ID, "GUI/picture/radiation_shutter_inside", 51, 48, 1); - - public static final AdaptableUITexture TAB_TITLE_BROWN = - AdaptableUITexture.of(MOD_ID, "GUI/tab/title_brown", 28, 28, 4); - public static final AdaptableUITexture TAB_TITLE_DARK_BROWN = - AdaptableUITexture.of(MOD_ID, "GUI/tab/title_dark_brown", 28, 28, 4); - public static final AdaptableUITexture TAB_TITLE_ANGULAR_BROWN = - AdaptableUITexture.of(MOD_ID, "GUI/tab/title_angular_brown", 28, 28, 4); + public static final UITexture PICTURE_RADIATION_SHUTTER_FRAME = UITexture + .fullImage(MOD_ID, "GUI/picture/radiation_shutter_frame"); + public static final AdaptableUITexture PICTURE_RADIATION_SHUTTER_INSIDE = AdaptableUITexture + .of(MOD_ID, "GUI/picture/radiation_shutter_inside", 51, 48, 1); + + public static final AdaptableUITexture TAB_TITLE_BROWN = AdaptableUITexture + .of(MOD_ID, "GUI/tab/title_brown", 28, 28, 4); + public static final AdaptableUITexture TAB_TITLE_DARK_BROWN = AdaptableUITexture + .of(MOD_ID, "GUI/tab/title_dark_brown", 28, 28, 4); + public static final AdaptableUITexture TAB_TITLE_ANGULAR_BROWN = AdaptableUITexture + .of(MOD_ID, "GUI/tab/title_angular_brown", 28, 28, 4); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java index 7dabe8be07..bf495440e5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ @API(owner = "bartworks", apiVersion = API_REFERENCE.VERSION, provides = "bartworks API") package com.github.bartimaeusnek.bartworks.API; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/ASMUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/ASMUtils.java index 5f618c6955..725a0135a4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/ASMUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/ASMUtils.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.ASM; @@ -26,6 +17,7 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; + import org.objectweb.asm.tree.MethodNode; public class ASMUtils { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java index 331dc32534..a747c95f7f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java @@ -1,44 +1,38 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.ASM; import static com.github.bartimaeusnek.bartworks.ASM.BWCoreTransformer.shouldTransform; +import java.util.ArrayList; +import java.util.List; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.google.common.eventbus.EventBus; import com.google.common.eventbus.Subscribe; + import cpw.mods.fml.common.DummyModContainer; import cpw.mods.fml.common.LoadController; import cpw.mods.fml.common.ModMetadata; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.versioning.ArtifactVersion; import cpw.mods.fml.common.versioning.DefaultArtifactVersion; -import java.util.ArrayList; -import java.util.List; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; @SuppressWarnings("ALL") public class BWCore extends DummyModContainer { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java index 9f68bfd1c4..7227780e37 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java @@ -1,35 +1,29 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.ASM; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import cpw.mods.fml.relauncher.FMLInjectionData; -import cpw.mods.fml.relauncher.IFMLLoadingPlugin; import java.io.File; import java.util.ArrayList; import java.util.Map; + import net.minecraftforge.common.config.Configuration; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; + +import cpw.mods.fml.relauncher.FMLInjectionData; +import cpw.mods.fml.relauncher.IFMLLoadingPlugin; + @IFMLLoadingPlugin.SortingIndex(Integer.MAX_VALUE) // Load as late as possible (after fastcraft/OptiFine). @IFMLLoadingPlugin.MCVersion("1.7.10") @IFMLLoadingPlugin.TransformerExclusions("com.github.bartimaeusnek.bartworks.ASM") @@ -51,7 +45,7 @@ public class BWCorePlugin implements IFMLLoadingPlugin { @Override public String[] getASMTransformerClass() { - return new String[] {BWCoreTransformer.class.getName()}; + return new String[] { BWCoreTransformer.class.getName() }; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java index 04932c3281..86480db53c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java @@ -1,33 +1,22 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.ASM; -import com.github.bartimaeusnek.bartworks.util.NonNullWrappedHashSet; -import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriorityList; -import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriorityListNode; import java.util.HashSet; import java.util.Iterator; import java.util.List; + import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -35,9 +24,14 @@ import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import com.github.bartimaeusnek.bartworks.util.NonNullWrappedHashSet; +import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriorityList; +import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriorityListNode; + public class BWCoreStaticReplacementMethodes { - private static ThreadLocal> RECENTLYUSEDRECIPES = - ThreadLocal.withInitial(AccessPriorityList::new); + + private static ThreadLocal> RECENTLYUSEDRECIPES = ThreadLocal + .withInitial(AccessPriorityList::new); public static void clearRecentlyUsedRecipes() { // the easiest way to ensure the cache is flushed without causing synchronization overhead @@ -64,8 +58,7 @@ public class BWCoreStaticReplacementMethodes { } } - if (i == 2 - && itemstack.getItem() == itemstack1.getItem() + if (i == 2 && itemstack.getItem() == itemstack1.getItem() && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && itemstack.getItem().isRepairable()) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java index 1120323d7c..58d65ddec5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.ASM; @@ -26,31 +17,28 @@ import static org.objectweb.asm.Opcodes.*; import java.util.Arrays; import java.util.List; + import net.minecraft.launchwrapper.IClassTransformer; + import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.tree.*; public class BWCoreTransformer implements IClassTransformer { - public static final String[] DESCRIPTIONFORCONFIG = { - "REMOVING RAIN FROM LAST MILLENIUM (EXU)", - "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", - "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS", - "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", - "[UNUSED] PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API", - "DUCTTAPING RWG WORLDEN FAILS", - "PATCHING CRAFTING MANAGER FOR CACHING RECIPES" - // "REMOVING 12% BONUS OUTPUTS FROM GT++ SIFTER" + + public static final String[] DESCRIPTIONFORCONFIG = { "REMOVING RAIN FROM LAST MILLENIUM (EXU)", + "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS", + "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", + "[UNUSED] PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API", "DUCTTAPING RWG WORLDEN FAILS", + "PATCHING CRAFTING MANAGER FOR CACHING RECIPES" + // "REMOVING 12% BONUS OUTPUTS FROM GT++ SIFTER" }; public static final String[] CLASSESBEEINGTRANSFORMED = { - "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", - "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", - "net.minecraft.client.renderer.RenderGlobal", - "thaumcraft.common.tiles.TileWandPedestal", - "gregtech.GT_Mod", - "rwg.world.ChunkGeneratorRealistic", - "net.minecraft.item.crafting.CraftingManager" - // "gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialSifter" + "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", + "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", + "net.minecraft.client.renderer.RenderGlobal", "thaumcraft.common.tiles.TileWandPedestal", "gregtech.GT_Mod", + "rwg.world.ChunkGeneratorRealistic", "net.minecraft.item.crafting.CraftingManager" + // "gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialSifter" }; static boolean obfs; @@ -80,7 +68,10 @@ public class BWCoreTransformer implements IClassTransformer { nu.insertBefore( beginning, new FieldInsnNode( - GETFIELD, "net/minecraft/world/World", obfs ? "field_72995_K" : "isRemote", "Z")); + GETFIELD, + "net/minecraft/world/World", + obfs ? "field_72995_K" : "isRemote", + "Z")); nu.insertBefore(beginning, new JumpInsnNode(IFNE, label)); nu.add(new InsnNode(POP)); nu.add(label); @@ -94,8 +85,8 @@ public class BWCoreTransformer implements IClassTransformer { public static byte[] transform(int id, byte[] basicClass) { if (!BWCoreTransformer.shouldTransform[id]) { - BWCore.BWCORE_LOG.info( - "Patch: " + BWCoreTransformer.DESCRIPTIONFORCONFIG[id] + " is disabled, will not patch!"); + BWCore.BWCORE_LOG + .info("Patch: " + BWCoreTransformer.DESCRIPTIONFORCONFIG[id] + " is disabled, will not patch!"); return basicClass; } @@ -105,8 +96,7 @@ public class BWCoreTransformer implements IClassTransformer { ClassNode classNode = new ClassNode(); classReader.accept(classNode, ClassReader.SKIP_FRAMES); List methods = classNode.methods; - scase: - switch (id) { + scase: switch (id) { case 0: { BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); String name_deObfs = "canDoRainSnowIce"; @@ -122,7 +112,11 @@ public class BWCoreTransformer implements IClassTransformer { } BWCore.BWCORE_LOG.info("Creating new " + name_deObfs + "!"); MethodNode nu = new MethodNode( - ACC_PUBLIC, name_deObfs, /*obfs ? dsc_Obfs :*/ dsc_deObfs, null, new String[0]); + ACC_PUBLIC, + name_deObfs, + /* obfs ? dsc_Obfs : */ dsc_deObfs, + null, + new String[0]); InsnList insnList = new InsnList(); insnList.add(new InsnNode(ICONST_0)); insnList.add(new InsnNode(IRETURN)); @@ -169,7 +163,7 @@ public class BWCoreTransformer implements IClassTransformer { && ASMUtils.isCorrectMethod(toPatch, dsc_universal)) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); InsnList nu = new InsnList(); - LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; + LabelNode[] LabelNodes = { new LabelNode(), new LabelNode() }; String theWorld_src = "field_72769_h"; String renderEngine_src = "field_72770_i"; @@ -181,92 +175,92 @@ public class BWCoreTransformer implements IClassTransformer { if (toPatch.instructions.get(j) instanceof FieldInsnNode && toPatch.instructions.get(j).getOpcode() == GETSTATIC && !(nameFieldToPatch = ASMUtils.matchAny( - ((FieldInsnNode) toPatch.instructions.get(j)).name, - field_deObfs, - field_src)) - .isEmpty()) { + ((FieldInsnNode) toPatch.instructions.get(j)).name, + field_deObfs, + field_src)).isEmpty()) { boolean useSrc = nameFieldToPatch.equals(field_src); - if (useSrc) - BWCore.BWCORE_LOG.info( - "Found either Optifine or Fastcraft... this patch was annoying to make compatible to them..."); + if (useSrc) BWCore.BWCORE_LOG.info( + "Found either Optifine or Fastcraft... this patch was annoying to make compatible to them..."); nu.add(new VarInsnNode(ALOAD, 0)); - nu.add(new FieldInsnNode( - GETFIELD, - "net/minecraft/client/renderer/RenderGlobal", - useSrc ? theWorld_src : "theWorld", - "Lnet/minecraft/client/multiplayer/WorldClient;")); - nu.add(new FieldInsnNode( - GETFIELD, - "net/minecraft/client/multiplayer/WorldClient", - useSrc ? provider_src : "provider", - "Lnet/minecraft/world/WorldProvider;")); + nu.add( + new FieldInsnNode( + GETFIELD, + "net/minecraft/client/renderer/RenderGlobal", + useSrc ? theWorld_src : "theWorld", + "Lnet/minecraft/client/multiplayer/WorldClient;")); + nu.add( + new FieldInsnNode( + GETFIELD, + "net/minecraft/client/multiplayer/WorldClient", + useSrc ? provider_src : "provider", + "Lnet/minecraft/world/WorldProvider;")); nu.add( new TypeInsnNode( INSTANCEOF, "com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace")); nu.add(new JumpInsnNode(IFEQ, LabelNodes[0])); nu.add(new VarInsnNode(ALOAD, 0)); - nu.add(new FieldInsnNode( - GETFIELD, - "net/minecraft/client/renderer/RenderGlobal", - useSrc ? renderEngine_src : "renderEngine", - "Lnet/minecraft/client/renderer/texture/TextureManager;")); - nu.add(new FieldInsnNode( - GETSTATIC, - "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b", - "sunTex", - "Lnet/minecraft/util/ResourceLocation;")); - nu.add(new MethodInsnNode( - INVOKEVIRTUAL, - "net/minecraft/client/renderer/texture/TextureManager", - useSrc ? bindTexture_src : "bindTexture", - "(Lnet/minecraft/util/ResourceLocation;)V", - false)); + nu.add( + new FieldInsnNode( + GETFIELD, + "net/minecraft/client/renderer/RenderGlobal", + useSrc ? renderEngine_src : "renderEngine", + "Lnet/minecraft/client/renderer/texture/TextureManager;")); + nu.add( + new FieldInsnNode( + GETSTATIC, + "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b", + "sunTex", + "Lnet/minecraft/util/ResourceLocation;")); + nu.add( + new MethodInsnNode( + INVOKEVIRTUAL, + "net/minecraft/client/renderer/texture/TextureManager", + useSrc ? bindTexture_src : "bindTexture", + "(Lnet/minecraft/util/ResourceLocation;)V", + false)); nu.add(new JumpInsnNode(GOTO, LabelNodes[1])); nu.add(LabelNodes[0]); nu.add(new VarInsnNode(ALOAD, 0)); - nu.add(new FieldInsnNode( - GETFIELD, - "net/minecraft/client/renderer/RenderGlobal", - useSrc ? renderEngine_src : "renderEngine", - "Lnet/minecraft/client/renderer/texture/TextureManager;")); - nu.add(new FieldInsnNode( - GETSTATIC, - "net/minecraft/client/renderer/RenderGlobal", - useSrc ? field_src : "locationSunPng", - "Lnet/minecraft/util/ResourceLocation;")); - nu.add(new MethodInsnNode( - INVOKEVIRTUAL, - "net/minecraft/client/renderer/texture/TextureManager", - useSrc ? bindTexture_src : "bindTexture", - "(Lnet/minecraft/util/ResourceLocation;)V", - false)); + nu.add( + new FieldInsnNode( + GETFIELD, + "net/minecraft/client/renderer/RenderGlobal", + useSrc ? renderEngine_src : "renderEngine", + "Lnet/minecraft/client/renderer/texture/TextureManager;")); + nu.add( + new FieldInsnNode( + GETSTATIC, + "net/minecraft/client/renderer/RenderGlobal", + useSrc ? field_src : "locationSunPng", + "Lnet/minecraft/util/ResourceLocation;")); + nu.add( + new MethodInsnNode( + INVOKEVIRTUAL, + "net/minecraft/client/renderer/texture/TextureManager", + useSrc ? bindTexture_src : "bindTexture", + "(Lnet/minecraft/util/ResourceLocation;)V", + false)); nu.add(LabelNodes[1]); j++; } else { if (j < toPatch.instructions.size() - 2) { if (toPatch.instructions.get(j + 2) instanceof FieldInsnNode - && toPatch.instructions - .get(j + 2) - .getOpcode() - == GETSTATIC + && toPatch.instructions.get(j + 2).getOpcode() == GETSTATIC && !ASMUtils.matchAny( - ((FieldInsnNode) toPatch.instructions.get(j + 2)).name, - field_deObfs, - field_src) - .isEmpty()) continue; + ((FieldInsnNode) toPatch.instructions.get(j + 2)).name, + field_deObfs, + field_src).isEmpty()) + continue; if (toPatch.instructions.get(j + 1) instanceof FieldInsnNode - && toPatch.instructions - .get(j + 1) - .getOpcode() - == GETSTATIC + && toPatch.instructions.get(j + 1).getOpcode() == GETSTATIC && !ASMUtils.matchAny( - ((FieldInsnNode) toPatch.instructions.get(j + 1)).name, - field_deObfs, - field_src) - .isEmpty()) continue; + ((FieldInsnNode) toPatch.instructions.get(j + 1)).name, + field_deObfs, + field_src).isEmpty()) + continue; } nu.add(toPatch.instructions.get(j)); } @@ -301,7 +295,7 @@ public class BWCoreTransformer implements IClassTransformer { for (MethodNode toPatch : methods) { if (ASMUtils.isCorrectMethod(toPatch, name_deObfs)) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); - LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; + LabelNode[] LabelNodes = { new LabelNode(), new LabelNode() }; InsnList nu = new InsnList(); // if (x < -28675) x %= -28675; nu.add(new VarInsnNode(ILOAD, 2)); @@ -341,12 +335,13 @@ public class BWCoreTransformer implements IClassTransformer { toPatch.instructions = new InsnList(); toPatch.instructions.add(new VarInsnNode(ALOAD, 1)); toPatch.instructions.add(new VarInsnNode(ALOAD, 2)); - toPatch.instructions.add(new MethodInsnNode( - INVOKESTATIC, - "com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes", - "findCachedMatchingRecipe", - "(Lnet/minecraft/inventory/InventoryCrafting;Lnet/minecraft/world/World;)Lnet/minecraft/item/ItemStack;", - false)); + toPatch.instructions.add( + new MethodInsnNode( + INVOKESTATIC, + "com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes", + "findCachedMatchingRecipe", + "(Lnet/minecraft/inventory/InventoryCrafting;Lnet/minecraft/world/World;)Lnet/minecraft/item/ItemStack;", + false)); toPatch.instructions.add(new InsnNode(ARETURN)); toPatch.localVariables.clear(); toPatch.maxStack = 2; @@ -356,12 +351,12 @@ public class BWCoreTransformer implements IClassTransformer { } } - // case 6: { - // BWCore.BWCORE_LOG.info("Could find: " + - // BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - // ((IntInsnNode) methods.get(11).instructions.get(10)).operand = 10000; - // break scase; - // } + // case 6: { + // BWCore.BWCORE_LOG.info("Could find: " + + // BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + // ((IntInsnNode) methods.get(11).instructions.get(10)).operand = 10000; + // break scase; + // } default: { BWCore.BWCORE_LOG.info("Could not find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); return basicClass; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java index 28dbaf5250..d4a1e0015f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -1,32 +1,24 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks; -import com.github.bartimaeusnek.bartworks.API.SideReference; -import cpw.mods.fml.common.network.IGuiHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; +import com.github.bartimaeusnek.bartworks.API.SideReference; +import cpw.mods.fml.common.network.IGuiHandler; + public class GuiHandler implements IGuiHandler { @Override @@ -36,8 +28,7 @@ public class GuiHandler implements IGuiHandler { @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - if (SideReference.Side.Client) { - } else return getServerGuiElement(ID, player, world, x, y, z); + if (SideReference.Side.Client) {} else return getServerGuiElement(ID, player, world, x, y, z); return null; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 3dc2ef474e..2a873977a9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks; @@ -26,6 +17,16 @@ import static com.github.bartimaeusnek.bartworks.common.loaders.BioRecipeLoader. import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.removeIC2Recipes; import static gregtech.api.enums.GT_Values.VN; +import java.io.IOException; +import java.util.Map; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.MinecraftForge; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + import com.github.bartimaeusnek.bartworks.API.*; import com.github.bartimaeusnek.bartworks.client.ClientEventHandler.TooltipEventHandler; import com.github.bartimaeusnek.bartworks.client.creativetabs.BioTab; @@ -45,6 +46,7 @@ import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.log.DebugLog; + import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.*; @@ -53,21 +55,13 @@ import cpw.mods.fml.common.network.NetworkRegistry; import gregtech.api.GregTech_API; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; -import java.io.IOException; -import java.util.Map; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.MinecraftForge; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; @SuppressWarnings("ALL") @Mod( modid = MainMod.MOD_ID, name = MainMod.NAME, version = MainMod.VERSION, - dependencies = "required-after:IC2; " - + "required-after:gregtech; " + dependencies = "required-after:IC2; " + "required-after:gregtech; " + "after:berriespp; " + "after:tectech; " + "after:GalacticraftMars; " @@ -77,6 +71,7 @@ import org.apache.logging.log4j.Logger; + "after:RandomThings; " + "before:miscutils; ") public final class MainMod { + public static final String NAME = "BartWorks"; public static final String VERSION = "GRADLETOKEN_VERSION"; public static final String MOD_ID = "bartworks"; @@ -161,8 +156,8 @@ public final class MainMod { NetworkRegistry.INSTANCE.registerGuiHandler(MainMod.instance, MainMod.GH); if (ConfigHandler.BioLab) { GTNHBlocks.run(); - for (Map.Entry pair : - BioVatLogicAdder.BioVatGlass.getGlassMap().entrySet()) { + for (Map.Entry pair : BioVatLogicAdder.BioVatGlass.getGlassMap() + .entrySet()) { GT_OreDictUnificator.registerOre( "blockGlass" + VN[pair.getValue()], new ItemStack(pair.getKey().getBlock(), 1, pair.getKey().getaByte())); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java index c571fdbef2..4c59aa38ef 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java @@ -1,36 +1,30 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.client.ClientEventHandler; -import com.github.bartimaeusnek.bartworks.util.Pair; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; + import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import com.github.bartimaeusnek.bartworks.util.Pair; + class TooltipCache { + private static final HashMap, char[]> cache = new HashMap<>(); static boolean put(ItemStack itemStack, List tooltip) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java index 33892d57ae..1c004ec151 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java @@ -1,27 +1,30 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.client.ClientEventHandler; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraftforge.event.entity.player.ItemTooltipEvent; + import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; @@ -31,6 +34,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; + import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.eventhandler.EventPriority; @@ -39,16 +43,6 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraftforge.event.entity.player.ItemTooltipEvent; @SideOnly(Side.CLIENT) public class TooltipEventHandler { @@ -61,11 +55,11 @@ public class TooltipEventHandler { if (TooltipCache.getTooltip(event.itemStack).isEmpty()) { ItemStack tmp = event.itemStack.copy(); - Pair abstractedStack = - new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); + Pair abstractedStack = new Pair<>( + Item.getIdFromItem(tmp.getItem()), + (short) tmp.getItemDamage()); List tooAdd = new ArrayList<>(); - if (ConfigHandler.sharedItemStackTooltip - && OreDictHandler.getNonBWCache().contains(abstractedStack)) { + if (ConfigHandler.sharedItemStackTooltip && OreDictHandler.getNonBWCache().contains(abstractedStack)) { for (Pair pair : OreDictHandler.getNonBWCache()) { if (pair.equals(abstractedStack)) { GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); @@ -73,19 +67,24 @@ public class TooltipEventHandler { UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); if (UI != null) { for (ModContainer modContainer : Loader.instance().getModList()) { - if (UI.modId.equals(MainMod.MOD_ID) - || UI.modId.equals(BartWorksCrossmod.MOD_ID) - || UI.modId.equals("BWCore")) break; + if (UI.modId.equals(MainMod.MOD_ID) || UI.modId.equals(BartWorksCrossmod.MOD_ID) + || UI.modId.equals("BWCore")) + break; if (UI.modId.equals(modContainer.getModId())) { - tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" - + ChatColorHelper.GRAY + " and " + ChatColorHelper.RED - + modContainer.getName()); + tooAdd.add( + "Shared ItemStack between " + ChatColorHelper.DARKGREEN + + "BartWorks" + + ChatColorHelper.GRAY + + " and " + + ChatColorHelper.RED + + modContainer.getName()); } } - } else - tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" - + ChatColorHelper.GRAY - + " and another Mod, that doesn't use the ModContainer propperly!"); + } else tooAdd.add( + "Shared ItemStack between " + ChatColorHelper.DARKGREEN + + "BartWorks" + + ChatColorHelper.GRAY + + " and another Mod, that doesn't use the ModContainer propperly!"); } } } @@ -96,16 +95,23 @@ public class TooltipEventHandler { TooltipCache.put(event.itemStack, tooAdd); return; } - BioVatLogicAdder.BlockMetaPair PAIR = - new BioVatLogicAdder.BlockMetaPair(BLOCK, (byte) event.itemStack.getItemDamage()); + BioVatLogicAdder.BlockMetaPair PAIR = new BioVatLogicAdder.BlockMetaPair( + BLOCK, + (byte) event.itemStack.getItemDamage()); HashMap GLASSMAP = BioVatLogicAdder.BioVatGlass.getGlassMap(); if (GLASSMAP.containsKey(PAIR)) { int tier = GLASSMAP.get(PAIR); - tooAdd.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " - + BW_ColorUtil.getColorForTier(tier) + GT_Values.VN[tier] + ChatColorHelper.RESET); + tooAdd.add( + StatCollector.translateToLocal("tooltip.glas.0.name") + " " + + BW_ColorUtil.getColorForTier(tier) + + GT_Values.VN[tier] + + ChatColorHelper.RESET); } else if (BLOCK.getMaterial().equals(Material.glass)) { - tooAdd.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " - + BW_ColorUtil.getColorForTier(3) + GT_Values.VN[3] + ChatColorHelper.RESET); + tooAdd.add( + StatCollector.translateToLocal("tooltip.glas.0.name") + " " + + BW_ColorUtil.getColorForTier(3) + + GT_Values.VN[3] + + ChatColorHelper.RESET); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java index 0360502170..efd085f320 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java @@ -1,31 +1,23 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.client.creativetabs; -import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; + public class BioTab extends CreativeTabs { public BioTab(String lable) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java index a300c63802..5a42164597 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java @@ -1,31 +1,23 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.client.creativetabs; -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; + public class GT2Tab extends CreativeTabs { public GT2Tab(String lable) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java index d80aa74a11..53be7436ce 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java @@ -1,31 +1,23 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.client.creativetabs; -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; + public class bartworksTab extends CreativeTabs { public bartworksTab(String lable) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java index c3339e156d..ccacef6c3f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java @@ -1,39 +1,34 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.client.gui; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +import org.lwjgl.opengl.GL11; + import com.github.bartimaeusnek.bartworks.MainMod; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ic2.core.block.kineticgenerator.container.ContainerWindKineticGenerator; import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator; import ic2.core.util.GuiTooltipHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator { + public ContainerWindKineticGenerator container; public String name; @@ -44,15 +39,21 @@ public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator { } protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - this.fontRendererObj.drawString( - this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 6, 2157374); + this.fontRendererObj + .drawString(this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 6, 2157374); if (this.container.base.checkrotor()) { if (!this.container.base.rotorspace()) { this.fontRendererObj.drawString( - StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotorspace"), 27, 52, 2157374); + StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotorspace"), + 27, + 52, + 2157374); } else if (this.container.base.checkrotor() && !this.container.base.guiisminWindStrength()) { this.fontRendererObj.drawString( - StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.windweak1"), 27, 52, 2157374); + StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.windweak1"), + 27, + 52, + 2157374); } else { this.fontRendererObj.drawString(this.container.base.getRotorhealth() + " %", 46, 52, 2157374); if (this.container.base.guiisoverload()) { @@ -68,14 +69,16 @@ public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator { } } else { this.fontRendererObj.drawString( - StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotormiss"), 27, 52, 2157374); + StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotormiss"), + 27, + 52, + 2157374); } } protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { GL11.glColor3f(0.5f, 0.25f, 0.07f); - this.mc - .getTextureManager() + this.mc.getTextureManager() .bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUIPrimitiveKUBox.png")); int j = (this.width - this.xSize) / 2; int k = (this.height - this.ySize) / 2; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java index 58ef11827a..1bef2a4a2e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java @@ -1,18 +1,22 @@ package com.github.bartimaeusnek.bartworks.client.renderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.lang.reflect.Field; + import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.init.Blocks; import net.minecraft.launchwrapper.Launch; import net.minecraft.world.World; + import org.lwjgl.opengl.GL11; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + @SideOnly(Side.CLIENT) public class BW_CropVisualizer extends EntityFX { + int[] meta = new int[8]; static Field tessellatorHasBrightnessField = null; @@ -31,22 +35,15 @@ public class BW_CropVisualizer extends EntityFX { } @Override - public void renderParticle( - Tessellator p_70539_1_, - float p_70539_2_, - float p_70539_3_, - float p_70539_4_, - float p_70539_5_, - float p_70539_6_, - float p_70539_7_) { + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, + float p_70539_5_, float p_70539_6_, float p_70539_7_) { Tessellator tessellator = Tessellator.instance; GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDepthMask(false); try { if (tessellatorHasBrightnessField == null) { tessellatorHasBrightnessField = Tessellator.class.getDeclaredField( - (boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment") - ? "hasBrightness" + (boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment") ? "hasBrightness" : "field_78414_p"); tessellatorHasBrightnessField.setAccessible(true); } @@ -57,13 +54,12 @@ public class BW_CropVisualizer extends EntityFX { tessellator.setColorRGBA(255, 255, 255, 255); double f12 = this.posY - interpPosY; int i = 0; - for (int x = -1; x <= 1; x++) - for (int z = -1; z <= 1; z++) { - if (x == 0 && z == 0) continue; - double f11 = (this.posX + (double) x) - interpPosX; - double f13 = (this.posZ + (double) z) - interpPosZ; - RenderBlocks.getInstance().renderBlockCropsImpl(Blocks.wheat, meta[i++], f11, f12, f13); - } + for (int x = -1; x <= 1; x++) for (int z = -1; z <= 1; z++) { + if (x == 0 && z == 0) continue; + double f11 = (this.posX + (double) x) - interpPosX; + double f13 = (this.posZ + (double) z) - interpPosZ; + RenderBlocks.getInstance().renderBlockCropsImpl(Blocks.wheat, meta[i++], f11, f12, f13); + } GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDepthMask(true); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java index 01a08ed8a2..37e55767bb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java @@ -1,15 +1,17 @@ package com.github.bartimaeusnek.bartworks.client.renderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.IIcon; import net.minecraft.world.World; + import org.lwjgl.opengl.GL11; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; + @SideOnly(Side.CLIENT) public class BW_EICPistonVisualizer extends EntityFX { @@ -27,14 +29,8 @@ public class BW_EICPistonVisualizer extends EntityFX { } @Override - public void renderParticle( - Tessellator p_70539_1_, - float p_70539_2_, - float p_70539_3_, - float p_70539_4_, - float p_70539_5_, - float p_70539_6_, - float p_70539_7_) { + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, + float p_70539_5_, float p_70539_6_, float p_70539_7_) { Tessellator tessellator = Tessellator.instance; GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDepthMask(false); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java index ab9a04fc18..b375a1c1b0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java @@ -1,34 +1,18 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.client.renderer; -import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; -import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.util.GT_Utility; -import gregtech.common.render.GT_RenderUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.Tessellator; @@ -38,10 +22,21 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.MinecraftForgeClient; + import org.lwjgl.opengl.GL11; +import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; +import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.util.GT_Utility; +import gregtech.common.render.GT_RenderUtil; + @SideOnly(Side.CLIENT) public class BW_GT_ItemRenderer implements IItemRenderer { + public BW_GT_ItemRenderer() { for (BW_Meta_Items.BW_GT_MetaGen_Item_Hook tItem : BW_Meta_Items.BW_GT_MetaGen_Item_Hook.sInstances) { MinecraftForgeClient.registerItemRenderer(tItem, this); @@ -61,8 +56,8 @@ public class BW_GT_ItemRenderer implements IItemRenderer { } @Override - public boolean shouldUseRenderHelper( - IItemRenderer.ItemRenderType aType, ItemStack aStack, IItemRenderer.ItemRendererHelper aHelper) { + public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType aType, ItemStack aStack, + IItemRenderer.ItemRendererHelper aHelper) { if (GT_Utility.isStackInvalid(aStack)) { return false; } else { @@ -108,23 +103,22 @@ public class BW_GT_ItemRenderer implements IItemRenderer { } } } else { - if (aMetaData < CircuitImprintLoader.reverseIDs) - ItemRenderer.renderItemIn2D( - Tessellator.instance, - tIcon.getMaxU(), - tIcon.getMinV(), - tIcon.getMinU(), - tIcon.getMaxV(), - tIcon.getIconWidth(), - tIcon.getIconHeight(), - 0.0625F); - // else { - // for (int i = 0; i < 4; i++) { - // ItemRenderer.renderItemIn2D(Tessellator.instance, + if (aMetaData < CircuitImprintLoader.reverseIDs) ItemRenderer.renderItemIn2D( + Tessellator.instance, + tIcon.getMaxU(), + tIcon.getMinV(), + tIcon.getMinU(), + tIcon.getMaxV(), + tIcon.getIconWidth(), + tIcon.getIconHeight(), + 0.0625F); + // else { + // for (int i = 0; i < 4; i++) { + // ItemRenderer.renderItemIn2D(Tessellator.instance, // 0.0F+i*2F,0.0F+i*2F,10.0F+i*2F,10.0F+i*2F, tIcon.getIconWidth(), tIcon.getIconHeight(),0.0625F); - // } - // } - // ItemRenderer.renderItemIn2D(Tessellator.instance, tIcon.getMaxU(), + // } + // } + // ItemRenderer.renderItemIn2D(Tessellator.instance, tIcon.getMaxU(), // tIcon.getMinV(), tIcon.getMinU(), tIcon.getMaxV(), tIcon.getIconWidth(), tIcon.getIconHeight(), // 0.0625F); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java index bad6170263..a082a44d31 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java @@ -1,35 +1,27 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.client.renderer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.interfaces.IIconContainer; import net.minecraft.block.Block; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.interfaces.IIconContainer; + @SideOnly(Side.CLIENT) public class BW_GT_Vanilla_Texture implements IIconContainer { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index a55ed8be41..c298b6a321 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -1,41 +1,36 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.client.renderer; import static gregtech.common.render.GT_Renderer_Block.*; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block_TE; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Blocks; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; -import cpw.mods.fml.client.registry.RenderingRegistry; -import gregtech.GT_Mod; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.world.IBlockAccess; + import org.lwjgl.opengl.GL11; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block_TE; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Blocks; + +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; +import gregtech.GT_Mod; + public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { + public static BW_Renderer_Block_Ores INSTANCE = new BW_Renderer_Block_Ores(); public final int mRenderID = RenderingRegistry.getNextAvailableRenderId(); public static final float blockMin = 0.0F; @@ -64,8 +59,8 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { } @Override - public boolean renderWorldBlock( - IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int modelId, RenderBlocks aRenderer) { + public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int modelId, + RenderBlocks aRenderer) { BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks) aBlock).getProperTileEntityForRendering(); tTileEntity.mMetaData = ((BW_MetaGenerated_Block_TE) aWorld.getTileEntity(aX, aY, aZ)).mMetaData; aRenderer.useInventoryTint = false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java index 1e0ee45c9d..244d7e5c7c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java @@ -1,39 +1,33 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.client.renderer; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.IBlockAccess; + +import org.lwjgl.opengl.GL11; + import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks2; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; + import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.world.IBlockAccess; -import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class RendererGlasBlock implements ISimpleBlockRenderingHandler { @@ -76,8 +70,8 @@ public class RendererGlasBlock implements ISimpleBlockRenderingHandler { } @Override - public boolean renderWorldBlock( - IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { // renderer.setRenderBounds(0.001,0.001,0.001,0.999,0.999,0.999); // renderer.setRenderBounds(0,0,0,1,1,1); if (block instanceof BW_GlasBlocks) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java index e659a6d2f9..894d15cf4c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java @@ -1,34 +1,18 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.client.renderer; -import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock; -import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; -import com.github.bartimaeusnek.bartworks.util.Coords; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; @@ -40,8 +24,18 @@ import net.minecraft.world.IBlockAccess; import net.minecraftforge.fluids.BlockFluidBase; import net.minecraftforge.fluids.IFluidBlock; +import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock; +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; +import com.github.bartimaeusnek.bartworks.util.Coords; + +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + @SideOnly(Side.CLIENT) public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler { + private static final float LIGHT_Y_NEG = 0.5f; private static final float LIGHT_Y_POS = 1f; private static final float LIGHT_XZ_NEG = 0.8f; @@ -90,8 +84,8 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {} @SideOnly(Side.CLIENT) - public boolean renderWorldBlock( - IBlockAccess iBlockAccess, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + public boolean renderWorldBlock(IBlockAccess iBlockAccess, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { if ((!(block instanceof BioFluidBlock))) return false; Tessellator tessellator = Tessellator.instance; Coords blockat = new Coords(x, y, z, iBlockAccess.getTileEntity(x, y, z).getWorldObj().provider.dimensionId); @@ -114,12 +108,10 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler boolean renderTop = iBlockAccess.getBlock(x, y + 1, z) != blockFluidBase; boolean renderBottom = block.shouldSideBeRendered(iBlockAccess, x, y - 1, z, 0) && iBlockAccess.getBlock(x, y - 1, z) != blockFluidBase; - boolean[] renderSides = { - block.shouldSideBeRendered(iBlockAccess, x, y, z - 1, 2), - block.shouldSideBeRendered(iBlockAccess, x, y, z + 1, 3), - block.shouldSideBeRendered(iBlockAccess, x - 1, y, z, 4), - block.shouldSideBeRendered(iBlockAccess, x + 1, y, z, 5) - }; + boolean[] renderSides = { block.shouldSideBeRendered(iBlockAccess, x, y, z - 1, 2), + block.shouldSideBeRendered(iBlockAccess, x, y, z + 1, 3), + block.shouldSideBeRendered(iBlockAccess, x - 1, y, z, 4), + block.shouldSideBeRendered(iBlockAccess, x + 1, y, z, 5) }; if (!renderTop && !renderBottom && !renderSides[0] && !renderSides[1] && !renderSides[2] && !renderSides[3]) { return false; } @@ -136,18 +128,18 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler float fluidHeightForRender6 = this.getFluidHeightForRender(iBlockAccess, x + 1, y, z - 1, blockFluidBase); float fluidHeightForRender7 = this.getFluidHeightForRender(iBlockAccess, x + 1, y, z, blockFluidBase); float fluidHeightForRender8 = this.getFluidHeightForRender(iBlockAccess, x + 1, y, z + 1, blockFluidBase); - heightNW = this.getFluidHeightAverage(new float[] { - fluidHeightForRender1, fluidHeightForRender2, fluidHeightForRender4, fluidHeightForRender - }); - heightSW = this.getFluidHeightAverage(new float[] { - fluidHeightForRender2, fluidHeightForRender3, fluidHeightForRender5, fluidHeightForRender - }); - heightSE = this.getFluidHeightAverage(new float[] { - fluidHeightForRender5, fluidHeightForRender7, fluidHeightForRender8, fluidHeightForRender - }); - heightNE = this.getFluidHeightAverage(new float[] { - fluidHeightForRender4, fluidHeightForRender6, fluidHeightForRender7, fluidHeightForRender - }); + heightNW = this.getFluidHeightAverage( + new float[] { fluidHeightForRender1, fluidHeightForRender2, fluidHeightForRender4, + fluidHeightForRender }); + heightSW = this.getFluidHeightAverage( + new float[] { fluidHeightForRender2, fluidHeightForRender3, fluidHeightForRender5, + fluidHeightForRender }); + heightSE = this.getFluidHeightAverage( + new float[] { fluidHeightForRender5, fluidHeightForRender7, fluidHeightForRender8, + fluidHeightForRender }); + heightNE = this.getFluidHeightAverage( + new float[] { fluidHeightForRender4, fluidHeightForRender6, fluidHeightForRender7, + fluidHeightForRender }); } else { heightNW = fluidHeightForRender; heightSW = fluidHeightForRender; @@ -165,14 +157,8 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler heightSE -= RendererSwitchingColorFluid.RENDER_OFFSET; heightNE -= RendererSwitchingColorFluid.RENDER_OFFSET; - double dInterpolatedU, - dInterpolatedV, - dInterpolatedU2, - dInterpolatedV2, - dInterpolatedU3, - dInterpolatedV3, - dInterpolatedU4, - dInterpolatedV4; + double dInterpolatedU, dInterpolatedV, dInterpolatedU2, dInterpolatedV2, dInterpolatedU3, dInterpolatedV3, + dInterpolatedU4, dInterpolatedV4; if (flowDir < -999.0f) { dInterpolatedU = iconStill.getInterpolatedU(0.0); @@ -321,11 +307,8 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler } private IIcon getNullCheckedIiconOrFallbackTexture() { - return FluidLoader.autogenIIcon != null - ? FluidLoader.autogenIIcon - : ((TextureMap) Minecraft.getMinecraft() - .getTextureManager() - .getTexture(TextureMap.locationBlocksTexture)) - .getAtlasSprite("missingno"); + return FluidLoader.autogenIIcon != null ? FluidLoader.autogenIIcon + : ((TextureMap) Minecraft.getMinecraft().getTextureManager() + .getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java index a849ac11ac..84d37b0e9c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java @@ -1,39 +1,32 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.client.textures; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.stream.Stream; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import java.util.stream.Stream; @SideOnly(Side.CLIENT) public class PrefixTextureLinker implements Runnable { @@ -44,40 +37,37 @@ public class PrefixTextureLinker implements Runnable { private static void fillBlockTexMap() { blockTexMap.put(TextureSet.SET_QUARTZ, TextureSet.INDEX_block4); - Stream.of(WerkstoffLoader.blockCasing, WerkstoffLoader.blockCasingAdvanced) - .forEach(prefixes -> { - HashMap curr = new HashMap<>(); - Arrays.stream(TextureSet.class.getFields()) - .filter(field -> field.getName().contains("SET")) - .forEach(SET -> { - try { - curr.put( - (TextureSet) SET.get(null), - new Textures.BlockIcons.CustomIcon("materialicons/" - + SET.getName().substring(4) + "/" + prefixes)); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - }); - texMapBlocks.put(prefixes, curr); - }); + Stream.of(WerkstoffLoader.blockCasing, WerkstoffLoader.blockCasingAdvanced).forEach(prefixes -> { + HashMap curr = new HashMap<>(); + Arrays.stream(TextureSet.class.getFields()).filter(field -> field.getName().contains("SET")) + .forEach(SET -> { + try { + curr.put( + (TextureSet) SET.get(null), + new Textures.BlockIcons.CustomIcon( + "materialicons/" + SET.getName().substring(4) + "/" + prefixes)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + }); + texMapBlocks.put(prefixes, curr); + }); } private static void fillItemTexMap() { Arrays.stream(OrePrefixes.values()) - .filter(prefixes -> prefixes != OrePrefixes.rod - && prefixes.mTextureIndex == -1 - && Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes) != 0) + .filter( + prefixes -> prefixes != OrePrefixes.rod && prefixes.mTextureIndex == -1 + && Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes) != 0) .forEach(prefixes -> { HashMap curr = new HashMap<>(); - Arrays.stream(TextureSet.class.getFields()) - .filter(field -> field.getName().contains("SET")) + Arrays.stream(TextureSet.class.getFields()).filter(field -> field.getName().contains("SET")) .forEach(SET -> { try { curr.put( (TextureSet) SET.get(null), - new Textures.ItemIcons.CustomIcon("materialicons/" - + SET.getName().substring(4) + "/" + prefixes)); + new Textures.ItemIcons.CustomIcon( + "materialicons/" + SET.getName().substring(4) + "/" + prefixes)); } catch (IllegalAccessException e) { e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java index 22b58a28be..3dccd88475 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java @@ -1,32 +1,20 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.blocks; -import com.github.bartimaeusnek.bartworks.MainMod; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -39,6 +27,12 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import com.github.bartimaeusnek.bartworks.MainMod; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; + public class BW_Blocks extends Block { @SideOnly(Side.CLIENT) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java index 451d435286..8bd57edaf9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java @@ -1,31 +1,18 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.blocks; -import com.github.bartimaeusnek.bartworks.API.SideReference; -import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -33,6 +20,12 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; +import com.github.bartimaeusnek.bartworks.API.SideReference; +import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BW_GlasBlocks extends BW_Blocks { @SideOnly(Side.CLIENT) @@ -47,8 +40,8 @@ public class BW_GlasBlocks extends BW_Blocks { this.connectedTex = false; } - public BW_GlasBlocks( - String name, String[] texture, short[][] color, CreativeTabs tabs, boolean connectedTex, boolean fake) { + public BW_GlasBlocks(String name, String[] texture, short[][] color, CreativeTabs tabs, boolean connectedTex, + boolean fake) { super(name, texture, tabs, Material.glass); this.connectedTex = connectedTex; this.color = color; @@ -93,8 +86,8 @@ public class BW_GlasBlocks extends BW_Blocks { this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]); String[] splitname = this.textureNames[0].split(":"); for (int j = 0; j < 16; j++) { - this.connectedTexture[j] = par1IconRegister.registerIcon( - splitname[0] + ":connectedTex/" + splitname[1] + '/' + splitname[1] + '_' + j); + this.connectedTexture[j] = par1IconRegister + .registerIcon(splitname[0] + ":connectedTex/" + splitname[1] + '/' + splitname[1] + '_' + j); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java index d2d149fd6e..16688fbc33 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java @@ -1,9 +1,5 @@ package com.github.bartimaeusnek.bartworks.common.blocks; -import com.github.bartimaeusnek.bartworks.API.SideReference; -import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -11,7 +7,14 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; +import com.github.bartimaeusnek.bartworks.API.SideReference; +import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BW_GlasBlocks2 extends BW_Blocks { + @SideOnly(Side.CLIENT) private IIcon[] connectedTexture; @@ -24,8 +27,8 @@ public class BW_GlasBlocks2 extends BW_Blocks { this.connectedTex = false; } - public BW_GlasBlocks2( - String name, String[] texture, short[][] color, CreativeTabs tabs, boolean connectedTex, boolean fake) { + public BW_GlasBlocks2(String name, String[] texture, short[][] color, CreativeTabs tabs, boolean connectedTex, + boolean fake) { super(name, texture, tabs, Material.glass); this.connectedTex = connectedTex; this.color = color; @@ -70,8 +73,13 @@ public class BW_GlasBlocks2 extends BW_Blocks { this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]); String[] splitname = this.textureNames[0].split(":"); for (int j = 0; j < 16; j++) { - this.connectedTexture[j] = par1IconRegister.registerIcon(splitname[0] + ":connectedTex/" - + "BoronSilicateGlassBlock" + '/' + "BoronSilicateGlassBlock" + '_' + j); + this.connectedTexture[j] = par1IconRegister.registerIcon( + splitname[0] + ":connectedTex/" + + "BoronSilicateGlassBlock" + + '/' + + "BoronSilicateGlassBlock" + + '_' + + j); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index 7b10ace417..2cfc787a1d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -1,39 +1,18 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.blocks; -import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; -import com.github.bartimaeusnek.bartworks.API.ITileDropsContent; -import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; -import com.gtnewhorizons.modularui.api.UIInfos; -import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.api.tile.IWrenchable; -import ic2.core.IC2; -import ic2.core.IHasGui; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -52,6 +31,20 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fluids.IFluidContainerItem; +import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; +import com.github.bartimaeusnek.bartworks.API.ITileDropsContent; +import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; +import com.gtnewhorizons.modularui.api.UIInfos; +import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.tile.IWrenchable; +import ic2.core.IC2; +import ic2.core.IHasGui; + public class BW_TileEntityContainer extends BlockContainer implements ITileAddsInformation { protected Class tileEntity; @@ -67,16 +60,8 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI } @Override - public boolean onBlockActivated( - World worldObj, - int x, - int y, - int z, - EntityPlayer player, - int p_149727_6_, - float p_149727_7_, - float p_149727_8_, - float p_149727_9_) { + public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int p_149727_6_, + float p_149727_7_, float p_149727_8_, float p_149727_9_) { if (worldObj.isRemote) { return false; } @@ -88,13 +73,13 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false) != null) if (player.getHeldItem().getItem().equals(Items.bucket) && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false).amount == 1000) { - ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, true); - player.getHeldItem().stackSize--; - if (player.getHeldItem().stackSize <= 0) - player.inventory.setInventorySlotContents(player.inventory.currentItem, null); - player.inventory.addItemStackToInventory(new ItemStack(Items.water_bucket)); - return true; - } + ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, true); + player.getHeldItem().stackSize--; + if (player.getHeldItem().stackSize <= 0) + player.inventory.setInventorySlotContents(player.inventory.currentItem, null); + player.inventory.addItemStackToInventory(new ItemStack(Items.water_bucket)); + return true; + } } if (!player.isSneaking()) { if (tile instanceof IHasGui) { @@ -141,9 +126,8 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI if (t instanceof ITileDropsContent) { int[] dropSlots = ((ITileDropsContent) t).getDropSlots(); for (int dropSlot : dropSlots) { - if (((ITileDropsContent) t).getStackInSlot(dropSlot) != null) - world.spawnEntityInWorld(new EntityItem( - world, x, y, z, ((BW_TileEntity_HeatedWaterPump) t).getStackInSlot(dropSlot))); + if (((ITileDropsContent) t).getStackInSlot(dropSlot) != null) world.spawnEntityInWorld( + new EntityItem(world, x, y, z, ((BW_TileEntity_HeatedWaterPump) t).getStackInSlot(dropSlot))); } } super.breakBlock(world, x, y, z, block, meta); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java index ed4680dde8..89d7dfae75 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java @@ -1,37 +1,29 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.blocks; -import gregtech.api.GregTech_API; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import gregtech.api.GregTech_API; + public class BW_TileEntityContainer_MachineBlock extends BW_TileEntityContainer { - public BW_TileEntityContainer_MachineBlock( - Material p_i45386_1_, Class tileEntity, String blockName) { + public BW_TileEntityContainer_MachineBlock(Material p_i45386_1_, Class tileEntity, + String blockName) { super(p_i45386_1_, tileEntity, blockName); GregTech_API.registerMachineBlock(this, -1); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java index 184e02dc00..22b14db261 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java @@ -1,36 +1,20 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.blocks; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.gtnewhorizons.modularui.api.UIInfos; -import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.api.tile.IWrenchable; -import ic2.core.IC2; -import ic2.core.IHasGui; import java.util.List; + import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -47,6 +31,16 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.gtnewhorizons.modularui.api.UIInfos; +import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.tile.IWrenchable; +import ic2.core.IC2; +import ic2.core.IHasGui; + public class BW_TileEntityContainer_Multiple extends BlockContainer { protected final String[] textureNames; @@ -56,12 +50,8 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { @SideOnly(Side.CLIENT) protected IIcon[] texture; - public BW_TileEntityContainer_Multiple( - Material p_i45386_1_, - Class[] tileEntity, - String blockName, - String[] textureNames, - CreativeTabs tabs) { + public BW_TileEntityContainer_Multiple(Material p_i45386_1_, Class[] tileEntity, + String blockName, String[] textureNames, CreativeTabs tabs) { super(p_i45386_1_); this.setHardness(15.0F); this.setResistance(30.0F); @@ -74,16 +64,8 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { } @Override - public boolean onBlockActivated( - World worldObj, - int x, - int y, - int z, - EntityPlayer player, - int p_149727_6_, - float p_149727_7_, - float p_149727_8_, - float p_149727_9_) { + public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int p_149727_6_, + float p_149727_7_, float p_149727_8_, float p_149727_9_) { if (worldObj.isRemote) { return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java index 5d06247dbc..fa984b8ee9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java @@ -1,31 +1,18 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.blocks; -import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BWTileEntityDimIDBridge; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -36,6 +23,12 @@ import net.minecraft.world.World; import net.minecraftforge.fluids.BlockFluidBase; import net.minecraftforge.fluids.FluidStack; +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BWTileEntityDimIDBridge; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BioFluidBlock extends BlockFluidBase implements ITileEntityProvider { public BioFluidBlock() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java index 8b8d4c15d7..c294bcbabc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java @@ -1,34 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.commands; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import java.lang.reflect.Field; + import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; + public class ChangeConfig extends CommandBase { + @Override public String getCommandName() { return "bwcfg"; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java index 0beec2c8af..138542bd4b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java @@ -1,33 +1,26 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.commands; -import com.github.bartimaeusnek.bartworks.ASM.BWCoreStaticReplacementMethodes; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; +import com.github.bartimaeusnek.bartworks.ASM.BWCoreStaticReplacementMethodes; + public class ClearCraftingCache extends CommandBase { + @Override public String getCommandName() { return "bwclr"; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java index f41c1d384d..e3dd2d13c5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.commands; @@ -28,6 +19,7 @@ import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; public class GetWorkingDirectory extends CommandBase { + @Override public String getCommandName() { return "bwgwd"; @@ -40,7 +32,6 @@ public class GetWorkingDirectory extends CommandBase { @Override public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { - p_71515_1_.addChatMessage( - new ChatComponentText(Minecraft.getMinecraft().mcDataDir.getAbsolutePath())); + p_71515_1_.addChatMessage(new ChatComponentText(Minecraft.getMinecraft().mcDataDir.getAbsolutePath())); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java index 1a924e7322..1646b8e750 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.commands; @@ -26,12 +17,14 @@ import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; + import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; public class PrintRecipeListToFile extends CommandBase { + @Override public String getCommandName() { return "prltf"; @@ -51,8 +44,7 @@ public class PrintRecipeListToFile extends CommandBase { BufferedWriter fw = new BufferedWriter(new FileWriter(file)); CraftingManager.getInstance().getRecipeList().forEach(e -> { try { - fw.write(e.toString() + " = " - + ((IRecipe) e).getRecipeOutput().getDisplayName() + "\n"); + fw.write(e.toString() + " = " + ((IRecipe) e).getRecipeOutput().getDisplayName() + "\n"); } catch (IOException ex) { ex.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java index 00a1fc4c4c..35cdae5bbc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.commands; @@ -27,6 +18,7 @@ import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; public class RunGC extends CommandBase { + @Override public String getCommandName() { return "bwgc"; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java index 02f3454a03..ece4708722 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java @@ -1,31 +1,23 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.commands; -import com.github.bartimaeusnek.bartworks.system.worldgen.MapGenRuins; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; +import com.github.bartimaeusnek.bartworks.system.worldgen.MapGenRuins; + public class SummonRuin extends CommandBase { @Override @@ -41,13 +33,12 @@ public class SummonRuin extends CommandBase { @Override public void processCommand(ICommandSender iCommandSender, String[] p_71515_2_) { try { - new MapGenRuins.RuinsBase() - .generate( - iCommandSender.getEntityWorld(), - iCommandSender.getEntityWorld().rand, - Integer.parseInt(p_71515_2_[0]), - 256, - Integer.parseInt(p_71515_2_[1])); + new MapGenRuins.RuinsBase().generate( + iCommandSender.getEntityWorld(), + iCommandSender.getEntityWorld().rand, + Integer.parseInt(p_71515_2_[0]), + 256, + Integer.parseInt(p_71515_2_[1])); } catch (Exception e) { e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 6c918fb4e5..8d5e071bd3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -1,35 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.configs; -import com.github.bartimaeusnek.bartworks.API.API_ConfigValues; -import com.github.bartimaeusnek.bartworks.ASM.BWCoreTransformer; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Set; + import net.minecraftforge.common.config.Configuration; +import com.github.bartimaeusnek.bartworks.API.API_ConfigValues; +import com.github.bartimaeusnek.bartworks.ASM.BWCoreTransformer; + public class ConfigHandler { private static final int IDU = 10 * 8 + 5; @@ -80,112 +73,63 @@ public class ConfigHandler { public static boolean disablePistonInEIC = false; - private static final int[][] METAFORTIERS_ENERGY = { - {100, 101, 102, 105}, - {1110, 1115, 1120, 1127}, - {1111, 12726, 1116, 1121, 1128}, - {1112, 12727, 1117, 1122, 1129}, - {12728, 1190, 1130, 12685}, - {1191, 1174, 695, 12686}, - }; - private static final int[][] METAFORTIERS_BUFFER = { - {5133, 5123}, - {161, 171, 181, 191}, - {162, 172, 182, 192}, - {163, 173, 183, 193}, - {164, 174, 184, 194}, - {165, 175, 185, 195}, - }; - private static final int[][] METAFORTIERS_CABLE = { - {5133, 5123}, - {1210, 1230, 1250, 1270, 1290}, - {1310, 1330, 1350, 1370, 1390}, - {1410, 1430, 1450, 1470, 1490}, - {1510, 1530, 1550, 1570, 1590}, - {1650, 1670, 1690}, - }; + private static final int[][] METAFORTIERS_ENERGY = { { 100, 101, 102, 105 }, { 1110, 1115, 1120, 1127 }, + { 1111, 12726, 1116, 1121, 1128 }, { 1112, 12727, 1117, 1122, 1129 }, { 12728, 1190, 1130, 12685 }, + { 1191, 1174, 695, 12686 }, }; + private static final int[][] METAFORTIERS_BUFFER = { { 5133, 5123 }, { 161, 171, 181, 191 }, { 162, 172, 182, 192 }, + { 163, 173, 183, 193 }, { 164, 174, 184, 194 }, { 165, 175, 185, 195 }, }; + private static final int[][] METAFORTIERS_CABLE = { { 5133, 5123 }, { 1210, 1230, 1250, 1270, 1290 }, + { 1310, 1330, 1350, 1370, 1390 }, { 1410, 1430, 1450, 1470, 1490 }, { 1510, 1530, 1550, 1570, 1590 }, + { 1650, 1670, 1690 }, }; private static final int[][] METAFORTIERS_MACHINE = { - {103, 104, 106, 107, 109, 110, 112, 113, 115, 116, 118, 119}, - { - 201, 211, 221, 231, 241, 251, 261, 271, 281, 291, 301, 311, 321, 331, 341, 351, 361, 371, 381, 391, 401, - 411, 421, 431, 441, 451, 461, 471, 481, 491, 501, 511, 521, 531, 541, 551, 561, 571, 581, 591, 601, 611, - 621, 631, 641, 651, 661, 671 - }, - { - 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 302, 312, 322, 332, 342, 352, 362, 372, 382, 392, 402, - 412, 422, 432, 442, 452, 462, 472, 482, 492, 502, 512, 522, 532, 542, 552, 562, 572, 582, 592, 602, 612, - 622, 632, 642, 652, 662, 672 - }, - { - 203, 213, 223, 233, 243, 253, 263, 273, 283, 293, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 403, - 413, 423, 433, 443, 453, 463, 473, 483, 493, 503, 513, 523, 533, 543, 553, 563, 573, 583, 593, 603, 613, - 623, 633, 643, 653, 663, 673 - }, - { - 204, 214, 224, 234, 244, 254, 264, 274, 284, 294, 304, 314, 324, 334, 344, 354, 364, 374, 384, 394, 404, - 414, 424, 434, 444, 454, 464, 474, 484, 494, 504, 514, 524, 534, 544, 554, 564, 574, 584, 594, 604, 614, - 624, 634, 644, 654, 664, 674 - }, - { - 205, 215, 225, 235, 245, 255, 265, 275, 285, 295, 305, 315, 325, 335, 345, 355, 365, 375, 385, 395, 405, - 415, 425, 435, 445, 455, 465, 475, 485, 495, 505, 515, 525, 535, 545, 555, 565, 575, 585, 595, 605, 615, - 625, 635, 645, 655, 665, 675 - }, - }; - private static int[][][] defaultMetasForTiers = { - METAFORTIERS_ENERGY, METAFORTIERS_BUFFER, METAFORTIERS_CABLE, METAFORTIERS_MACHINE - }; - private static final String[] VOLTAGE_NAMES = new String[] { - "High Pressure Steam", - "Low Voltage", - "Medium Voltage", - "High Voltage", - "Extreme Voltage", - "Insane Voltage", - "Ludicrous Voltage", - "ZPM Voltage", - "Ultimate Voltage", - "Ultimate High Voltage", - "Ultimate Extreme Voltage", - "Ultimate Insane Voltage", - "Ultimate Mega Voltage", - "Ultimate Extended Mega Voltage", - "Overpowered Voltage", - "Maximum Voltage" - }; - private static final String[] names = {"Generators", "Buffers", "Cables", "Machines"}; + { 103, 104, 106, 107, 109, 110, 112, 113, 115, 116, 118, 119 }, + { 201, 211, 221, 231, 241, 251, 261, 271, 281, 291, 301, 311, 321, 331, 341, 351, 361, 371, 381, 391, 401, + 411, 421, 431, 441, 451, 461, 471, 481, 491, 501, 511, 521, 531, 541, 551, 561, 571, 581, 591, 601, + 611, 621, 631, 641, 651, 661, 671 }, + { 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 302, 312, 322, 332, 342, 352, 362, 372, 382, 392, 402, + 412, 422, 432, 442, 452, 462, 472, 482, 492, 502, 512, 522, 532, 542, 552, 562, 572, 582, 592, 602, + 612, 622, 632, 642, 652, 662, 672 }, + { 203, 213, 223, 233, 243, 253, 263, 273, 283, 293, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 403, + 413, 423, 433, 443, 453, 463, 473, 483, 493, 503, 513, 523, 533, 543, 553, 563, 573, 583, 593, 603, + 613, 623, 633, 643, 653, 663, 673 }, + { 204, 214, 224, 234, 244, 254, 264, 274, 284, 294, 304, 314, 324, 334, 344, 354, 364, 374, 384, 394, 404, + 414, 424, 434, 444, 454, 464, 474, 484, 494, 504, 514, 524, 534, 544, 554, 564, 574, 584, 594, 604, + 614, 624, 634, 644, 654, 664, 674 }, + { 205, 215, 225, 235, 245, 255, 265, 275, 285, 295, 305, 315, 325, 335, 345, 355, 365, 375, 385, 395, 405, + 415, 425, 435, 445, 455, 465, 475, 485, 495, 505, 515, 525, 535, 545, 555, 565, 575, 585, 595, 605, + 615, 625, 635, 645, 655, 665, 675 }, }; + private static int[][][] defaultMetasForTiers = { METAFORTIERS_ENERGY, METAFORTIERS_BUFFER, METAFORTIERS_CABLE, + METAFORTIERS_MACHINE }; + private static final String[] VOLTAGE_NAMES = new String[] { "High Pressure Steam", "Low Voltage", "Medium Voltage", + "High Voltage", "Extreme Voltage", "Insane Voltage", "Ludicrous Voltage", "ZPM Voltage", "Ultimate Voltage", + "Ultimate High Voltage", "Ultimate Extreme Voltage", "Ultimate Insane Voltage", "Ultimate Mega Voltage", + "Ultimate Extended Mega Voltage", "Overpowered Voltage", "Maximum Voltage" }; + private static final String[] names = { "Generators", "Buffers", "Cables", "Machines" }; public ConfigHandler(Configuration C) { ConfigHandler.c = C; - ConfigHandler.classicMode = ConfigHandler.c - .get( - "System", - "Enable Classic Mode", - false, - "Enables the classic Mode (all recipes in normal machines are doable in MV") - .getBoolean(false); + ConfigHandler.classicMode = ConfigHandler.c.get( + "System", + "Enable Classic Mode", + false, + "Enables the classic Mode (all recipes in normal machines are doable in MV").getBoolean(false); ConfigHandler.creativeScannerID = ConfigHandler.c - .get("System", "Creative Debug Scanner", 0, "ID for the Creative Debug Scanner Block") - .getInt(0); + .get("System", "Creative Debug Scanner", 0, "ID for the Creative Debug Scanner Block").getInt(0); ConfigHandler.tooltips = ConfigHandler.c - .get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips") - .getBoolean(true); - ConfigHandler.sharedItemStackTooltip = ConfigHandler.c - .get( - "System", - "BartWorksSharedItemStackToolTips", - true, - "If you wish to enable \"Shared Item Stack\" tooltips") - .getBoolean(true); + .get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips").getBoolean(true); + ConfigHandler.sharedItemStackTooltip = ConfigHandler.c.get( + "System", + "BartWorksSharedItemStackToolTips", + true, + "If you wish to enable \"Shared Item Stack\" tooltips").getBoolean(true); - ConfigHandler.IDOffset = ConfigHandler.c - .get( - "System", - "ID Offset", - 12600, - "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU - + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS") + ConfigHandler.IDOffset = ConfigHandler.c.get( + "System", + "ID Offset", + 12600, + "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS") .getInt(12600); ConfigHandler.ezmode = ConfigHandler.c .get( @@ -194,36 +138,29 @@ public class ConfigHandler { false, "If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.") .getBoolean(false); - ConfigHandler.teslastaff = ConfigHandler.c - .get( - "System", - "Enable Teslastaff", - false, - "Enables the Teslastaff, an Item used to destroy Electric Armors") - .getBoolean(false); - ConfigHandler.newStuff = !ConfigHandler.c - .get( - "System", - "Disable non-original-GT-stuff", - false, - "This switch disables my new content, that is not part of the GT2 compat") - .getBoolean(false); - ConfigHandler.BioLab = !ConfigHandler.c - .get( - "System", - "Disable BioLab", - false, - "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!") + ConfigHandler.teslastaff = ConfigHandler.c.get( + "System", + "Enable Teslastaff", + false, + "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); + ConfigHandler.newStuff = !ConfigHandler.c.get( + "System", + "Disable non-original-GT-stuff", + false, + "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false); + ConfigHandler.BioLab = !ConfigHandler.c.get( + "System", + "Disable BioLab", + false, + "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!") .getBoolean(false); - ConfigHandler.cutoffTier = ConfigHandler.c - .get( - "System", - "Tier to nerf circuits", - 5, - "This switch sets the lowest unnerfed Circuit Recipe Tier. -1 to disable it completely.", - -1, - VOLTAGE_NAMES.length) - .getInt(5); + ConfigHandler.cutoffTier = ConfigHandler.c.get( + "System", + "Tier to nerf circuits", + 5, + "This switch sets the lowest unnerfed Circuit Recipe Tier. -1 to disable it completely.", + -1, + VOLTAGE_NAMES.length).getInt(5); ConfigHandler.cutoffTier = (ConfigHandler.cutoffTier == -1 ? VOLTAGE_NAMES.length : ConfigHandler.cutoffTier); ConfigHandler.disableExtraGassesForEBF = ConfigHandler.c .get( @@ -235,41 +172,33 @@ public class ConfigHandler { ConfigHandler.disableBoltedBlocksCasing = ConfigHandler.c .get("System", "Disable Bolted Casings", false, "This switch disable the generation of bolted casings") .getBoolean(false); - ConfigHandler.disableReboltedBlocksCasing = ConfigHandler.c - .get( - "System", - "Disable Rebolted Casings", - false, - "This switch disable the generation of rebolted casings") - .getBoolean(false); + ConfigHandler.disableReboltedBlocksCasing = ConfigHandler.c.get( + "System", + "Disable Rebolted Casings", + false, + "This switch disable the generation of rebolted casings").getBoolean(false); - ConfigHandler.mbWaterperSec = ConfigHandler.c - .get("Singleblocks", "mL Water per Sec for the StirlingPump", 150) + ConfigHandler.mbWaterperSec = ConfigHandler.c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150) .getInt(150); - ConfigHandler.energyPerCell = ConfigHandler.c - .get( - "Multiblocks", - "energyPerLESUCell", - 1000000, - "This will set Up the Energy per LESU Cell", - 1000000, - Integer.MAX_VALUE) - .getInt(1000000); - ConfigHandler.DEHPDirectSteam = ConfigHandler.c - .get( - "Multiblocks", - "DEHP Direct Steam Mode", - false, - "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant") + ConfigHandler.energyPerCell = ConfigHandler.c.get( + "Multiblocks", + "energyPerLESUCell", + 1000000, + "This will set Up the Energy per LESU Cell", + 1000000, + Integer.MAX_VALUE).getInt(1000000); + ConfigHandler.DEHPDirectSteam = ConfigHandler.c.get( + "Multiblocks", + "DEHP Direct Steam Mode", + false, + "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant") .getBoolean(false); - ConfigHandler.megaMachinesMax = ConfigHandler.c - .get( - "Multiblocks", - "Mega Machines Maximum Recipes per Operation", - 256, - "This changes the Maximum Recipes per Operation to the specified Valure") - .getInt(256); + ConfigHandler.megaMachinesMax = ConfigHandler.c.get( + "Multiblocks", + "Mega Machines Maximum Recipes per Operation", + 256, + "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256); ConfigHandler.bioVatMaxParallelBonus = ConfigHandler.c .get( "Multiblocks", @@ -277,13 +206,15 @@ public class ConfigHandler { 1000, "This are the maximum parallel Operations the BioVat can do, when the output is half full.") .getInt(1000); - ConfigHandler.voidMinerBlacklist = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(ConfigHandler.c - .get( - "Multiblocks", - "Void Miner Blacklist", - new String[0], - "This is a blacklist for the Void Miner, blacklisted ores will not enter the drop prize pool. Please fill in the Unique Identifier of Ore and connect Damage with a colon, For example: gregtech:gt.blockores:32") - .getStringList()))); + ConfigHandler.voidMinerBlacklist = Collections.unmodifiableSet( + new HashSet<>( + Arrays.asList( + ConfigHandler.c.get( + "Multiblocks", + "Void Miner Blacklist", + new String[0], + "This is a blacklist for the Void Miner, blacklisted ores will not enter the drop prize pool. Please fill in the Unique Identifier of Ore and connect Damage with a colon, For example: gregtech:gt.blockores:32") + .getStringList()))); ConfigHandler.disablePistonInEIC = ConfigHandler.c .get( "Multiblocks", @@ -299,57 +230,48 @@ public class ConfigHandler { ConfigHandler.pollutionHeatedWaterPumpSecond, "How much should the Simple Stirling Water Pump produce pollution per second") .getInt(ConfigHandler.pollutionHeatedWaterPumpSecond); - ConfigHandler.basePollutionMBFSecond = ConfigHandler.c - .get( - "Pollution", - "Pollution produced per tick by the MBF per ingot", - ConfigHandler.basePollutionMBFSecond, - "How much should the MBF produce pollution per tick per ingot. Then it'll be multiplied by the amount of ingots done in parallel") + ConfigHandler.basePollutionMBFSecond = ConfigHandler.c.get( + "Pollution", + "Pollution produced per tick by the MBF per ingot", + ConfigHandler.basePollutionMBFSecond, + "How much should the MBF produce pollution per tick per ingot. Then it'll be multiplied by the amount of ingots done in parallel") .getInt(ConfigHandler.basePollutionMBFSecond); if (ConfigHandler.IDOffset == 0) { ConfigHandler.IDOffset = 12600; - ConfigHandler.c - .get( - "System", - "ID Offset", - 12600, - "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU - + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS") + ConfigHandler.c.get( + "System", + "ID Offset", + 12600, + "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS") .set(12600); } ConfigHandler.GTppLogDisabler = ConfigHandler.c - .get("System", "Disable GT++ Logging", false, "Enables or Disables GT++ Logging.") - .getBoolean(false); + .get("System", "Disable GT++ Logging", false, "Enables or Disables GT++ Logging.").getBoolean(false); API_ConfigValues.debugLog = ConfigHandler.c - .get("System", "Enable Debug Log", false, "Enables or Disables the debug log.") - .getBoolean(false); + .get("System", "Enable Debug Log", false, "Enables or Disables the debug log.").getBoolean(false); for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) - BWCoreTransformer.shouldTransform[i] = ConfigHandler.c - .get( - "ASM fixes", - BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " - + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i], - true) - .getBoolean(true); + BWCoreTransformer.shouldTransform[i] = ConfigHandler.c.get( + "ASM fixes", + BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " + + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i], + true).getBoolean(true); ConfigHandler.enabledPatches = new boolean[BWCoreTransformer.shouldTransform.length]; - ConfigHandler.enabledPatches = - Arrays.copyOf(BWCoreTransformer.shouldTransform, BWCoreTransformer.shouldTransform.length); + ConfigHandler.enabledPatches = Arrays + .copyOf(BWCoreTransformer.shouldTransform, BWCoreTransformer.shouldTransform.length); ConfigHandler.ross128BID = ConfigHandler.c - .get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b") - .getInt(-64); + .get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64); ConfigHandler.ross128BAID = ConfigHandler.c .get("CrossMod Interactions", "DimID - Ross128ba", -63, "The Dim ID for Ross128ba (Ross128b's Moon)") .getInt(-63); ConfigHandler.ross128btier = ConfigHandler.c - .get("CrossMod Interactions", "Rocket Tier - Ross128b", 3, "The Rocket Tier for Ross128b") - .getInt(3); + .get("CrossMod Interactions", "Rocket Tier - Ross128b", 3, "The Rocket Tier for Ross128b").getInt(3); ConfigHandler.ross128batier = ConfigHandler.c - .get("CrossMod Interactions", "Rocket Tier - Ross128ba", 3, "The Rocket Tier for Ross128a") - .getInt(3); + .get("CrossMod Interactions", "Rocket Tier - Ross128ba", 3, "The Rocket Tier for Ross128a").getInt(3); ConfigHandler.ross128bRuinChance = ConfigHandler.c .get("CrossMod Interactions", "Ruin Chance - Ross128b", 512, "Higher Values mean lesser Ruins.") .getInt(512); @@ -360,13 +282,11 @@ public class ConfigHandler { true, "If the Ross128 System should be activated, DO NOT CHANGE AFTER WORLD GENERATION") .getBoolean(true); - ConfigHandler.landerType = ConfigHandler.c - .get( - "CrossMod Interactions", - "LanderType", - 3, - "1 = Moon Lander, 2 = Landing Balloons, 3 = Asteroid Lander") - .getInt(3); + ConfigHandler.landerType = ConfigHandler.c.get( + "CrossMod Interactions", + "LanderType", + 3, + "1 = Moon Lander, 2 = Landing Balloons, 3 = Asteroid Lander").getInt(3); ConfigHandler.disableMagicalForest = ConfigHandler.c .get( "CrossMod Interactions", @@ -376,20 +296,16 @@ public class ConfigHandler { .getBoolean(false); ConfigHandler.maxTierRoss = (byte) ConfigHandler.c - .get("Ross Ruin Metas", "A_Ruin Machine Tiers", 6, "", 0, VOLTAGE_NAMES.length) - .getInt(6); + .get("Ross Ruin Metas", "A_Ruin Machine Tiers", 6, "", 0, VOLTAGE_NAMES.length).getInt(6); ConfigHandler.metasForTiers = new int[4][maxTierRoss][]; for (int i = 0; i < 4; i++) { if (maxTierRoss > ConfigHandler.defaultMetasForTiers[i].length) ConfigHandler.defaultMetasForTiers[i] = new int[maxTierRoss][0]; - for (int j = 0; j < maxTierRoss; j++) - ConfigHandler.metasForTiers[i][j] = ConfigHandler.c - .get( - "Ross Ruin Metas", - j + "_Ruin " + names[i] + " Tier " + VOLTAGE_NAMES[j], - ConfigHandler.defaultMetasForTiers[i][j]) - .getIntList(); + for (int j = 0; j < maxTierRoss; j++) ConfigHandler.metasForTiers[i][j] = ConfigHandler.c.get( + "Ross Ruin Metas", + j + "_Ruin " + names[i] + " Tier " + VOLTAGE_NAMES[j], + ConfigHandler.defaultMetasForTiers[i][j]).getIntList(); } ConfigHandler.setUpComments(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index e0565ec316..33876e557c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -1,38 +1,21 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.items; -import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; -import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.GT_Values; -import gregtech.api.util.GT_LanguageManager; import java.util.Arrays; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.entity.player.EntityPlayer; @@ -41,12 +24,23 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; +import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; +import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.GT_Values; +import gregtech.api.util.GT_LanguageManager; + public class BW_ItemBlocks extends ItemBlock { - private final String mNoMobsToolTip = - GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); - private final String mNoTileEntityToolTip = - GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + private final String mNoMobsToolTip = GT_LanguageManager + .addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + private final String mNoTileEntityToolTip = GT_LanguageManager + .addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); public BW_ItemBlocks(Block par1) { super(par1); @@ -71,8 +65,10 @@ public class BW_ItemBlocks extends ItemBlock { public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { byte tier = BorosilicateGlass.getTier(this.field_150939_a, aStack.getItemDamage()); if (tier >= 0) { - aList.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + BW_ColorUtil.getColorForTier(tier) - + GT_Values.VN[tier]); + aList.add( + StatCollector.translateToLocal("tooltip.glas.0.name") + " " + + BW_ColorUtil.getColorForTier(tier) + + GT_Values.VN[tier]); } if (this.field_150939_a instanceof ITileAddsInformation) { aList.addAll(Arrays.asList(((ITileAddsInformation) this.field_150939_a).getInfoData())); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java index dc606f9e73..8a3ec95073 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java @@ -1,33 +1,20 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.items; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.core.WorldData; import java.util.List; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -36,6 +23,13 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.WorldData; + public class BW_SimpleWindMeter extends Item { public BW_SimpleWindMeter() { @@ -57,27 +51,26 @@ public class BW_SimpleWindMeter extends Item { public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean p_77624_4_) { super.addInformation(itemStack, entityPlayer, list, p_77624_4_); list.add(StatCollector.translateToLocal("tooltip.windmeter.0.name")); - list.add(StatCollector.translateToLocal("tooltip.windmeter.1.name") + " " - + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); + list.add( + StatCollector.translateToLocal("tooltip.windmeter.1.name") + " " + + (this.getMaxDamage() - this.getDamage(itemStack)) + + "/" + + this.getMaxDamage()); list.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) { - if (entityPlayer.worldObj.isRemote - || world == null + if (entityPlayer.worldObj.isRemote || world == null || WorldData.get(world) == null - || WorldData.get(world).windSim == null) return itemStack; + || WorldData.get(world).windSim == null) + return itemStack; float windStrength = (float) WorldData.get(world).windSim.getWindAt(entityPlayer.posY); - String windS = windStrength < 1f - ? StatCollector.translateToLocal("tooltip.windmeter.2.name") - : windStrength < 10f - ? StatCollector.translateToLocal("tooltip.windmeter.3.name") - : windStrength < 20f - ? StatCollector.translateToLocal("tooltip.windmeter.4.name") - : windStrength < 30f - ? StatCollector.translateToLocal("tooltip.windmeter.5.name") + String windS = windStrength < 1f ? StatCollector.translateToLocal("tooltip.windmeter.2.name") + : windStrength < 10f ? StatCollector.translateToLocal("tooltip.windmeter.3.name") + : windStrength < 20f ? StatCollector.translateToLocal("tooltip.windmeter.4.name") + : windStrength < 30f ? StatCollector.translateToLocal("tooltip.windmeter.5.name") : windStrength < 50f ? StatCollector.translateToLocal("tooltip.windmeter.6.name") : StatCollector.translateToLocal("tooltip.windmeter.7.name"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index 414f862cd6..ce55f220b4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.items; @@ -25,15 +16,8 @@ package com.github.bartimaeusnek.bartworks.common.items; import static ic2.api.item.IKineticRotor.GearboxType.WATER; import static ic2.api.item.IKineticRotor.GearboxType.WIND; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.api.item.IKineticRotor; -import ic2.core.block.kineticgenerator.gui.GuiWaterKineticGenerator; -import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator; -import ic2.core.util.StackUtil; import java.util.List; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -43,6 +27,16 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.item.IKineticRotor; +import ic2.core.block.kineticgenerator.gui.GuiWaterKineticGenerator; +import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator; +import ic2.core.util.StackUtil; + public class BW_Stonage_Rotors extends Item implements IKineticRotor { private final int[] DiaMinMax = new int[3]; @@ -55,18 +49,8 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { private final int maxDamageEx; private int dura; - public BW_Stonage_Rotors( - int diameter, - float eff, - int speed, - float mRotor, - int min, - int max, - int durability, - IKineticRotor.GearboxType type, - ResourceLocation tex, - String Name, - String itemTex) { + public BW_Stonage_Rotors(int diameter, float eff, int speed, float mRotor, int min, int max, int durability, + IKineticRotor.GearboxType type, ResourceLocation tex, String Name, String itemTex) { this.DiaMinMax[0] = diameter; this.DiaMinMax[1] = min; this.DiaMinMax[2] = max; @@ -89,8 +73,9 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { @SuppressWarnings("unchecked") public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { - info.add(StatCollector.translateToLocalFormatted( - "ic2.itemrotor.wind.info", this.DiaMinMax[1], this.DiaMinMax[2])); + info.add( + StatCollector + .translateToLocalFormatted("ic2.itemrotor.wind.info", this.DiaMinMax[1], this.DiaMinMax[2])); IKineticRotor.GearboxType type = null; if (Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator) { type = WATER; @@ -98,9 +83,11 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { type = WIND; } info.add(StatCollector.translateToLocal("tooltip.rotor.0.name") + " " + this.DiaMinMax[0]); - info.add(StatCollector.translateToLocal("tooltip.rotor.1.name") + " " - + ((this.getMaxDamageEx() - this.getDamageOfStack(itemStack)) / 100) + "/" - + (this.getMaxDamageEx() / 100)); + info.add( + StatCollector.translateToLocal("tooltip.rotor.1.name") + " " + + ((this.getMaxDamageEx() - this.getDamageOfStack(itemStack)) / 100) + + "/" + + (this.getMaxDamageEx() / 100)); info.add(StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + this.eff); info.add(StatCollector.translateToLocal("tooltip.rotor.3.name") + " " + this.speed); info.add(StatCollector.translateToLocal("tooltip.rotor.4.name") + " " + this.mRotor); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index bfc0a9d239..ebe2c0fa43 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -1,27 +1,29 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.items; +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; @@ -36,6 +38,7 @@ import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; import com.gtnewhorizons.modularui.common.widget.ButtonWidget; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -50,15 +53,6 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; -import java.util.List; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem, IItemWithModularUI { @@ -82,11 +76,11 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); - if (aStack != null && aStack.getTagCompound() != null) - aList.add(StatCollector.translateToLocal("tooltip.cp.0.name") + " " - + (aStack.getTagCompound().getBoolean("HasChip") - ? StatCollector.translateToLocal("tooltip.bw.yes.name") - : StatCollector.translateToLocal("tooltip.bw.no.name"))); + if (aStack != null && aStack.getTagCompound() != null) aList.add( + StatCollector.translateToLocal("tooltip.cp.0.name") + " " + + (aStack.getTagCompound().getBoolean("HasChip") + ? StatCollector.translateToLocal("tooltip.bw.yes.name") + : StatCollector.translateToLocal("tooltip.bw.no.name"))); aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @@ -159,12 +153,14 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem builder.bindPlayerInventory(buildContext.getPlayer(), new Pos2d(86, 83), ModularUITextures.ITEM_SLOT); ItemStackHandler inventoryHandler = new ItemStackHandler(1) { + @Override public int getSlotLimit(int slot) { return 1; } }; SlotWidget circuitSlotWidget = new SlotWidget(new BaseSlot(inventoryHandler, 0) { + @Override public void putStack(ItemStack stack) { if (isLVCircuit(stack)) { @@ -182,39 +178,32 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem } circuitSlotWidget.getMcSlot().putStack(initialStack); - builder.widget(circuitSlotWidget - .setChangeListener(widget -> { - ItemStack stack = widget.getMcSlot().getStack(); - ItemStack heldItem = widget.getContext().getPlayer().getHeldItem(); - NBTTagCompound tag2 = heldItem.getTagCompound(); - if (tag2 == null) { - tag2 = new NBTTagCompound(); - } - - if (stack != null) { - tag2.setBoolean(NBT_KEY_HAS_CHIP, true); - tag2.setByte(NBT_KEY_CHIP_CONFIG, (byte) stack.getItemDamage()); - } else { - tag2.setBoolean(NBT_KEY_HAS_CHIP, false); - } - heldItem.setTagCompound(tag2); - }) - .setFilter(stack -> isProgrammedCircuit(stack) || isLVCircuit(stack)) - .setBackground(ModularUITextures.ITEM_SLOT, GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT) - .setPos(122, 60)); + builder.widget(circuitSlotWidget.setChangeListener(widget -> { + ItemStack stack = widget.getMcSlot().getStack(); + ItemStack heldItem = widget.getContext().getPlayer().getHeldItem(); + NBTTagCompound tag2 = heldItem.getTagCompound(); + if (tag2 == null) { + tag2 = new NBTTagCompound(); + } + + if (stack != null) { + tag2.setBoolean(NBT_KEY_HAS_CHIP, true); + tag2.setByte(NBT_KEY_CHIP_CONFIG, (byte) stack.getItemDamage()); + } else { + tag2.setBoolean(NBT_KEY_HAS_CHIP, false); + } + heldItem.setTagCompound(tag2); + }).setFilter(stack -> isProgrammedCircuit(stack) || isLVCircuit(stack)) + .setBackground(ModularUITextures.ITEM_SLOT, GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT).setPos(122, 60)); for (int i = 0; i < 24; i++) { final int index = i; - builder.widget(new ButtonWidget() - .setOnClick((clickData, widget) -> { - if (circuitSlotWidget.getMcSlot().getHasStack() - && isProgrammedCircuit( - circuitSlotWidget.getMcSlot().getStack())) { - circuitSlotWidget.getMcSlot().putStack(createRealCircuit(index + 1)); - } - }) - .setPos(32 + (i % 12) * 18, 21 + (i / 12) * 18) - .setSize(18, 18)); + builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> { + if (circuitSlotWidget.getMcSlot().getHasStack() + && isProgrammedCircuit(circuitSlotWidget.getMcSlot().getStack())) { + circuitSlotWidget.getMcSlot().putStack(createRealCircuit(index + 1)); + } + }).setPos(32 + (i % 12) * 18, 21 + (i / 12) * 18).setSize(18, 18)); } return builder.build(); @@ -231,9 +220,6 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem private boolean isLVCircuit(ItemStack stack) { return BW_Util.checkStackAndPrefix(stack) && GT_OreDictUnificator.getAssociation(stack).mPrefix.equals(OrePrefixes.circuit) - && GT_OreDictUnificator.getAssociation(stack) - .mMaterial - .mMaterial - .equals(Materials.Basic); + && GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial.equals(Materials.Basic); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java index 714cc51f2e..7d3327761c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -1,27 +1,25 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.items; +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; @@ -33,16 +31,12 @@ import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.items.GT_Generic_Item; -import java.util.List; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class GT_Destructopack_Item extends GT_Generic_Item implements IItemWithModularUI { @@ -79,16 +73,13 @@ public class GT_Destructopack_Item extends GT_Generic_Item implements IItemWithM builder.bindPlayerInventory(buildContext.getPlayer()); builder.widget(new SlotWidget(new BaseSlot(new ItemStackHandler(), 0) { - @Override - public void putStack(ItemStack stack) { - onSlotChanged(); - } - }) - .setBackground(ModularUITextures.ITEM_SLOT, BW_UITextures.OVERLAY_SLOT_CROSS) - .setPos(79, 16)) - .widget(new DrawableWidget() - .setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT) - .setSize(17, 17) + + @Override + public void putStack(ItemStack stack) { + onSlotChanged(); + } + }).setBackground(ModularUITextures.ITEM_SLOT, BW_UITextures.OVERLAY_SLOT_CROSS).setPos(79, 16)).widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT).setSize(17, 17) .setPos(152, 63)); return builder.build(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index d7e0cf19f5..5207a345c1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -1,38 +1,22 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.items; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; -import com.google.common.collect.Sets; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.GT_Values; -import ic2.api.item.ElectricItem; -import ic2.api.item.IElectricItem; import java.util.HashSet; import java.util.List; import java.util.Set; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -49,9 +33,20 @@ import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; +import com.google.common.collect.Sets; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.GT_Values; +import ic2.api.item.ElectricItem; +import ic2.api.item.IElectricItem; + public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { - private static Set mineableBlocks = - Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); + + private static Set mineableBlocks = Sets + .newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); private final int mCharge; private final int mTransfer; public int mTier; @@ -92,23 +87,14 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { } } - public boolean onItemUse( - ItemStack aStack, - EntityPlayer aPlayer, - World p_77648_3_, - int p_77648_4_, - int p_77648_5_, - int p_77648_6_, - int p_77648_7_, - float p_77648_8_, - float p_77648_9_, - float p_77648_10_) { + public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World p_77648_3_, int p_77648_4_, int p_77648_5_, + int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { ElectricItem.manager.use(aStack, 0, aPlayer); return false; } - public boolean onBlockDestroyed( - ItemStack var1, World var2, Block var3, int var4, int var5, int var6, EntityLivingBase var7) { + public boolean onBlockDestroyed(ItemStack var1, World var2, Block var3, int var4, int var5, int var6, + EntityLivingBase var7) { ElectricItem.manager.use(var1, 0, var7); if (ElectricItem.manager.canUse(var1, 500 * this.multi)) { ElectricItem.manager.use(var1, 500 * this.multi, var7); @@ -120,8 +106,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { @Override public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) { - return par1Block.getMaterial().equals(Material.glass) - || par1Block.getMaterial().equals(Material.clay) + return par1Block.getMaterial().equals(Material.glass) || par1Block.getMaterial().equals(Material.clay) || par1Block.getMaterial().equals(Material.packedIce) || par1Block.getMaterial().equals(Material.ice) || par1Block.getMaterial().equals(Material.sand) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java index 00a10b7c9e..0c05642998 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -1,36 +1,21 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.items; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; -import com.google.common.collect.Sets; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ic2.api.item.ElectricItem; -import ic2.api.item.IElectricItem; import java.util.List; import java.util.Set; + import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -44,7 +29,17 @@ import net.minecraft.item.ItemTool; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; +import com.google.common.collect.Sets; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.item.ElectricItem; +import ic2.api.item.IElectricItem; + public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { + private static final Set effective = Sets.newHashSet(Blocks.web); private final double mCharge; private final double mTransfer; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java index ad2a780136..cc7977b5cc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java @@ -1,34 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.items; -import com.github.bartimaeusnek.bartworks.MainMod; import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; +import com.github.bartimaeusnek.bartworks.MainMod; + public class LabModule extends SimpleSubItemClass { + public LabModule(String[] tex) { super(tex); this.setCreativeTab(MainMod.BIO_TAB); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java index f22ebf56aa..3ae2981575 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -1,36 +1,22 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.items; import static com.github.bartimaeusnek.bartworks.common.loaders.BioItemList.*; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.BioCulture; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; @@ -38,6 +24,14 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.BioCulture; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class LabParts extends SimpleSubItemClass { public LabParts(String[] tex) { @@ -52,8 +46,7 @@ public class LabParts extends SimpleSubItemClass { switch (itemStack.getItemDamage()) { case 0: - return BW_Util.getRarityFromByte( - itemStack.getTagCompound().getCompoundTag("DNA").getByte("Rarity")); + return BW_Util.getRarityFromByte(itemStack.getTagCompound().getCompoundTag("DNA").getByte("Rarity")); case 1: case 2: return BW_Util.getRarityFromByte(itemStack.getTagCompound().getByte("Rarity")); @@ -65,8 +58,7 @@ public class LabParts extends SimpleSubItemClass { @Override @SideOnly(Side.CLIENT) public int getColorFromItemStack(ItemStack stack, int p_82790_2_) { - if (stack.getItemDamage() == 0 - && stack.getTagCompound() != null + if (stack.getItemDamage() == 0 && stack.getTagCompound() != null && stack.getTagCompound().getIntArray("Color") != null && stack.getTagCompound().getIntArray("Color").length > 0) { int[] rgb = stack.getTagCompound().getIntArray("Color"); @@ -108,22 +100,25 @@ public class LabParts extends SimpleSubItemClass { switch (itemStack.getItemDamage()) { case 0: - list.add(StatCollector.translateToLocal("tooltip.labparts.5.name") + " " - + itemStack.getTagCompound().getString("Name") - + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); + list.add( + StatCollector.translateToLocal("tooltip.labparts.5.name") + " " + + itemStack.getTagCompound().getString("Name") + + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); if (!itemStack.getTagCompound().getBoolean("Breedable")) { list.add(StatCollector.translateToLocal("tooltip.labparts.6.name")); } break; case 1: - list.add(StatCollector.translateToLocal("tooltip.labparts.7.name") + " " - + itemStack.getTagCompound().getString("Name") - + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); + list.add( + StatCollector.translateToLocal("tooltip.labparts.7.name") + " " + + itemStack.getTagCompound().getString("Name") + + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); break; case 2: - list.add(StatCollector.translateToLocal("tooltip.labparts.8.name") + " " - + itemStack.getTagCompound().getString("Name") - + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); + list.add( + StatCollector.translateToLocal("tooltip.labparts.8.name") + " " + + itemStack.getTagCompound().getString("Name") + + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); break; default: break; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java index 1a45731e6e..bd192efbe5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java @@ -1,32 +1,24 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.items; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.Item; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class SimpleIconItem extends Item { private final String tex; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java index 0ae4dc469a..346f9e84c7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -1,32 +1,20 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.items; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.List; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -34,7 +22,14 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class SimpleSubItemClass extends Item { + @SideOnly(Side.CLIENT) protected IIcon[] itemIcon; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java index bcb2052d57..60f7b1f30e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java @@ -1,8 +1,12 @@ package com.github.bartimaeusnek.bartworks.common.loaders; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.BW_GT_MaterialReference; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -10,8 +14,6 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class ArtificialMicaLine { @@ -151,7 +153,12 @@ public class ArtificialMicaLine { 120); // MgO(s) = MgO(l) GT_Values.RA.addFluidExtractionRecipe( - Materials.Magnesia.getDust(1), null, Materials.Magnesia.getMolten(144), 0, 20, 120); + Materials.Magnesia.getDust(1), + null, + Materials.Magnesia.getMolten(144), + 0, + 20, + 120); // 27Raw Fluorophlogopite Dust + 720MgO(l) = 4608Fluorophlogopite(l) GT_Values.RA.addBlastRecipe( WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), @@ -164,24 +171,24 @@ public class ArtificialMicaLine { 480, 1700); // 144Fluorophlogopite(l) = Fluorophlogopite - GT_Recipe.GT_Recipe_Map.sVacuumRecipes.addRecipe(new GT_Recipe( - false, - new ItemStack[] {ItemList.Shape_Mold_Plate.get(0)}, - new ItemStack[] {WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1)}, - null, - null, - new FluidStack[] {WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(144)}, - null, - 10, - 120, - 0)); + GT_Recipe.GT_Recipe_Map.sVacuumRecipes.addRecipe( + new GT_Recipe( + false, + new ItemStack[] { ItemList.Shape_Mold_Plate.get(0) }, + new ItemStack[] { WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1) }, + null, + null, + new FluidStack[] { WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(144) }, + null, + 10, + 120, + 0)); // Fluorophlogopite = 4Insulator Foil - if (LoaderReference.dreamcraft) - GT_Values.RA.addBenderRecipe( - WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1), - GT_Utility.getIntegratedCircuit(1), - GT_ModHandler.getModItem("dreamcraft", "item.MicaInsulatorFoil", 4), - 10, - 600); + if (LoaderReference.dreamcraft) GT_Values.RA.addBenderRecipe( + WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1), + GT_Utility.getIntegratedCircuit(1), + GT_ModHandler.getModItem("dreamcraft", "item.MicaInsulatorFoil", 4), + 10, + 600); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java index bba88a0859..7f10a18de0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java @@ -1,28 +1,29 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.loaders; +import java.lang.reflect.Field; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +import org.apache.commons.lang3.reflect.FieldUtils; + import com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; + import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.LoadController; import cpw.mods.fml.common.Loader; @@ -31,16 +32,9 @@ import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.Materials; import gregtech.api.enums.SubTag; import ic2.core.Ic2Items; -import java.lang.reflect.Field; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import org.apache.commons.lang3.reflect.FieldUtils; /** - * This class gets injected into GT via ASM! - * DO NOT CALL IT YOURSELF! + * This class gets injected into GT via ASM! DO NOT CALL IT YOURSELF! */ public class BeforeGTPreload implements Runnable { @@ -50,8 +44,8 @@ public class BeforeGTPreload implements Runnable { public void run() { if (didrun) return; // fixing BorosilicateGlass... -_-' - Materials.BorosilicateGlass.add( - SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); + Materials.BorosilicateGlass + .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); Field activeContainer = FieldUtils.getDeclaredField(LoadController.class, "activeContainer", true); ModContainer bartworks = null; @@ -74,8 +68,7 @@ public class BeforeGTPreload implements Runnable { } if (bartworks != null) break; } - if (bartworks == null || gregtech == null) - FMLCommonHandler.instance().exitJava(-1, true); + if (bartworks == null || gregtech == null) FMLCommonHandler.instance().exitJava(-1, true); try { activeContainer.set(modController, bartworks); @@ -89,8 +82,7 @@ public class BeforeGTPreload implements Runnable { Block[] bw_glasses; try { bw_glasses = (Block[]) Class.forName("com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry") - .getField("bw_glasses") - .get(null); + .getField("bw_glasses").get(null); GameRegistry.registerBlock(bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); GameRegistry.registerBlock(bw_glasses[1], BW_ItemBlocks.class, "BW_GlasBlocks2"); OreDictionary.registerOre("blockGlassHV", new ItemStack(Blocks.glass, 1, Short.MAX_VALUE)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java index 6d327f594b..61e62e640e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java @@ -1,50 +1,43 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.loaders; +import java.awt.*; + +import net.minecraft.item.EnumRarity; + import com.github.bartimaeusnek.bartworks.util.BioCulture; import com.github.bartimaeusnek.bartworks.util.BioDNA; import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; -import java.awt.*; -import net.minecraft.item.EnumRarity; public class BioCultureLoader { - public static final BioData BIO_DATA_BETA_LACMATASE = - BioData.createAndRegisterBioData("beta-Lactamase", EnumRarity.uncommon, 10000, 0); - private static final BioData BIO_DATA_YEAST = - BioData.createAndRegisterBioData("Saccharomyces cerevisiae", EnumRarity.common); - private static final BioDNA BIO_DNA_WHINE_YEAST = - BioDNA.createAndRegisterBioDNA("Saccharomyces cerevisiae var bayanus", EnumRarity.uncommon); - private static final BioDNA BIO_DNA_BEER_YEAST = - BioDNA.createAndRegisterBioDNA("Saccharomyces cerevisiae var cerevisiae", EnumRarity.uncommon); - private static final BioData eColiData = - BioData.createAndRegisterBioData("Escherichia koli", EnumRarity.uncommon, 10000, 0); - private static final BioDNA BIO_DNA_ANAEROBIC_OIL = - BioDNA.createAndRegisterBioDNA("Pseudomonas Veronii", EnumRarity.uncommon); - private static final BioData BIO_DATA_ANAEROBIC_OIL = - BioData.createAndRegisterBioData("Pseudomonas Veronii", EnumRarity.uncommon, 5000, 1); + public static final BioData BIO_DATA_BETA_LACMATASE = BioData + .createAndRegisterBioData("beta-Lactamase", EnumRarity.uncommon, 10000, 0); + private static final BioData BIO_DATA_YEAST = BioData + .createAndRegisterBioData("Saccharomyces cerevisiae", EnumRarity.common); + private static final BioDNA BIO_DNA_WHINE_YEAST = BioDNA + .createAndRegisterBioDNA("Saccharomyces cerevisiae var bayanus", EnumRarity.uncommon); + private static final BioDNA BIO_DNA_BEER_YEAST = BioDNA + .createAndRegisterBioDNA("Saccharomyces cerevisiae var cerevisiae", EnumRarity.uncommon); + private static final BioData eColiData = BioData + .createAndRegisterBioData("Escherichia koli", EnumRarity.uncommon, 10000, 0); + private static final BioDNA BIO_DNA_ANAEROBIC_OIL = BioDNA + .createAndRegisterBioDNA("Pseudomonas Veronii", EnumRarity.uncommon); + private static final BioData BIO_DATA_ANAEROBIC_OIL = BioData + .createAndRegisterBioData("Pseudomonas Veronii", EnumRarity.uncommon, 5000, 1); public static BioCulture CommonYeast; public static BioCulture WhineYeast; public static BioCulture BeerYeast; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java index 8addea861c..dbc172487d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java @@ -1,27 +1,24 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.loaders; +import java.util.Collection; +import java.util.HashSet; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + import com.github.bartimaeusnek.bartworks.common.items.LabModule; import com.github.bartimaeusnek.bartworks.common.items.LabParts; import com.github.bartimaeusnek.bartworks.util.BioCulture; @@ -29,32 +26,20 @@ import com.github.bartimaeusnek.bartworks.util.BioDNA; import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; import cpw.mods.fml.common.registry.GameRegistry; -import java.util.Collection; -import java.util.HashSet; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; public class BioItemList { private BioItemList() {} - private static final Item mItemBioLabParts = new LabModule(new String[] { - "DNAExtractionModule", - "PCRThermoclyclingModule", - "PlasmidSynthesisModule", - "TransformationModule", - "ClonalCellularSynthesisModule" - }); - public static final ItemStack[] mBioLabParts = { - new ItemStack(BioItemList.mItemBioLabParts), - new ItemStack(BioItemList.mItemBioLabParts, 1, 1), - new ItemStack(BioItemList.mItemBioLabParts, 1, 2), - new ItemStack(BioItemList.mItemBioLabParts, 1, 3), - new ItemStack(BioItemList.mItemBioLabParts, 1, 4) - }; - private static final Item vanillaBioLabParts = new LabParts(new String[] { - "petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", "IncubationModule", "PlasmaMembrane" - }); + private static final Item mItemBioLabParts = new LabModule( + new String[] { "DNAExtractionModule", "PCRThermoclyclingModule", "PlasmidSynthesisModule", + "TransformationModule", "ClonalCellularSynthesisModule" }); + public static final ItemStack[] mBioLabParts = { new ItemStack(BioItemList.mItemBioLabParts), + new ItemStack(BioItemList.mItemBioLabParts, 1, 1), new ItemStack(BioItemList.mItemBioLabParts, 1, 2), + new ItemStack(BioItemList.mItemBioLabParts, 1, 3), new ItemStack(BioItemList.mItemBioLabParts, 1, 4) }; + private static final Item vanillaBioLabParts = new LabParts( + new String[] { "petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", + "IncubationModule", "PlasmaMembrane" }); public static void registerBioItems() { GameRegistry.registerItem(BioItemList.mItemBioLabParts, "BioLabModules"); @@ -108,11 +93,7 @@ public class BioItemList { } /** - * 1 - Detergent Powder - * 2 - Agarose - * 3 - Incubation Module - * 4 - Plasma Membrane - * others are null + * 1 - Detergent Powder 2 - Agarose 3 - Incubation Module 4 - Plasma Membrane others are null * * @param selection see above * @return the selected Item diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java index f72cd1f0aa..28ad279e28 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.loaders; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index dcc43adcbc..d51b0f3c04 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -1,27 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.loaders; +import java.util.List; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; @@ -29,6 +30,7 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTile import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -37,14 +39,6 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import java.util.List; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; public class BioRecipeLoader { @@ -52,107 +46,67 @@ public class BioRecipeLoader { public static void run() { // DNAExtractionModule - GT_ModHandler.addCraftingRecipe(BioItemList.mBioLabParts[0], RecipeLoader.BITSD, new Object[] { - "TET", - "CFC", - "TST", - 'T', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), - 'E', - ItemList.Emitter_EV.get(1L), - 'C', - GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), - 'S', - ItemList.Sensor_EV.get(1L), - 'F', - ItemList.Field_Generator_EV.get(1L) - }); + GT_ModHandler.addCraftingRecipe( + BioItemList.mBioLabParts[0], + RecipeLoader.BITSD, + new Object[] { "TET", "CFC", "TST", 'T', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), 'E', + ItemList.Emitter_EV.get(1L), 'C', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), 'S', + ItemList.Sensor_EV.get(1L), 'F', ItemList.Field_Generator_EV.get(1L) }); // PCRThermoclyclingModule - GT_ModHandler.addCraftingRecipe(BioItemList.mBioLabParts[1], RecipeLoader.BITSD, new Object[] { - "NEN", - "CFC", - "NSN", - 'N', - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), - 'E', - ItemList.Emitter_EV.get(1L), - 'C', - GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), - 'S', - ItemList.Sensor_EV.get(1L), - 'F', - ItemList.Field_Generator_EV.get(1L) - }); + GT_ModHandler.addCraftingRecipe( + BioItemList.mBioLabParts[1], + RecipeLoader.BITSD, + new Object[] { "NEN", "CFC", "NSN", 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), 'E', + ItemList.Emitter_EV.get(1L), 'C', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), 'S', + ItemList.Sensor_EV.get(1L), 'F', ItemList.Field_Generator_EV.get(1L) }); // PlasmidSynthesisModule - GT_ModHandler.addCraftingRecipe(BioItemList.mBioLabParts[2], RecipeLoader.BITSD, new Object[] { - "SFE", - "CPC", - "NFN", - 'N', - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), - 'C', - "circuit" + Materials.Data, - 'F', - ItemList.Field_Generator_EV.get(1L), - 'E', - ItemList.Emitter_EV.get(1L), - 'S', - ItemList.Sensor_EV.get(1L), - 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), - }); + GT_ModHandler.addCraftingRecipe( + BioItemList.mBioLabParts[2], + RecipeLoader.BITSD, + new Object[] { "SFE", "CPC", "NFN", 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), 'C', + "circuit" + Materials.Data, 'F', ItemList.Field_Generator_EV.get(1L), 'E', + ItemList.Emitter_EV.get(1L), 'S', ItemList.Sensor_EV.get(1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), }); // TransformationModule - GT_ModHandler.addCraftingRecipe(BioItemList.mBioLabParts[3], RecipeLoader.BITSD, new Object[] { - "SFE", - "CPC", - "NFN", - 'N', - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), - 'C', - "circuit" + Materials.Master, - 'F', - ItemList.Field_Generator_LuV.get(1L), - 'E', - ItemList.Emitter_LuV.get(1L), - 'S', - ItemList.Sensor_LuV.get(1L), - 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), - }); + GT_ModHandler.addCraftingRecipe( + BioItemList.mBioLabParts[3], + RecipeLoader.BITSD, + new Object[] { "SFE", "CPC", "NFN", 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), 'C', + "circuit" + Materials.Master, 'F', ItemList.Field_Generator_LuV.get(1L), 'E', + ItemList.Emitter_LuV.get(1L), 'S', ItemList.Sensor_LuV.get(1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), }); // ClonalCellularSynthesisModule - GT_ModHandler.addCraftingRecipe(BioItemList.mBioLabParts[4], RecipeLoader.BITSD, new Object[] { - "FEF", - "CPC", - "FSF", - 'N', - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), - 'C', - "circuit" + Materials.Master, - 'F', - ItemList.Field_Generator_LuV.get(1L), - 'E', - ItemList.Emitter_LuV.get(1L), - 'S', - ItemList.Sensor_LuV.get(1L), - 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), - }); + GT_ModHandler.addCraftingRecipe( + BioItemList.mBioLabParts[4], + RecipeLoader.BITSD, + new Object[] { "FEF", "CPC", "FSF", 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), 'C', + "circuit" + Materials.Master, 'F', ItemList.Field_Generator_LuV.get(1L), 'E', + ItemList.Emitter_LuV.get(1L), 'S', ItemList.Sensor_LuV.get(1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), }); List oreCropVine = OreDictionary.getOres("cropVine", false); - if (LoaderReference.croploadcore && !oreCropVine.isEmpty()) - for (ItemStack stack : oreCropVine) { - GT_Values.RA.addExtractorRecipe( - BW_Util.setStackSize(stack, 12), - BioItemList.getOther(1), - 500, - BW_Util.getMachineVoltageFromTier(3)); - } - else + if (LoaderReference.croploadcore && !oreCropVine.isEmpty()) for (ItemStack stack : oreCropVine) { GT_Values.RA.addExtractorRecipe( - new ItemStack(Blocks.vine, 12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3)); + BW_Util.setStackSize(stack, 12), + BioItemList.getOther(1), + 500, + BW_Util.getMachineVoltageFromTier(3)); + } + else GT_Values.RA.addExtractorRecipe( + new ItemStack(Blocks.vine, 12), + BioItemList.getOther(1), + 500, + BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addExtractorRecipe( ItemList.Circuit_Chip_Stemcell.get(1L), @@ -160,8 +114,7 @@ public class BioRecipeLoader { 500, BW_Util.getMachineVoltageFromTier(6)); - FluidStack dnaFluid = LoaderReference.gendustry - ? FluidRegistry.getFluidStack("liquiddna", 1000) + FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); GT_Values.RA.addMixerRecipe( GT_Utility.getIntegratedCircuit(17), @@ -185,7 +138,7 @@ public class BioRecipeLoader { null, null, null, - new int[] {1000}, + new int[] { 1000 }, 60 * 20, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addCentrifugeRecipe( @@ -217,122 +170,65 @@ public class BioRecipeLoader { 60 * 20, BW_Util.getMachineVoltageFromTier(3)); - ItemStack[] Pistons = { - ItemList.Electric_Piston_HV.get(1L), - ItemList.Electric_Piston_EV.get(1L), - ItemList.Electric_Piston_IV.get(1L), - ItemList.Electric_Piston_LuV.get(1L), - ItemList.Electric_Piston_ZPM.get(1L), - ItemList.Electric_Piston_UV.get(1L) - }; + ItemStack[] Pistons = { ItemList.Electric_Piston_HV.get(1L), ItemList.Electric_Piston_EV.get(1L), + ItemList.Electric_Piston_IV.get(1L), ItemList.Electric_Piston_LuV.get(1L), + ItemList.Electric_Piston_ZPM.get(1L), ItemList.Electric_Piston_UV.get(1L) }; ItemStack[] BioLab = new ItemStack[GT_Values.VN.length - 3]; ItemStack[] RadioHatch = new ItemStack[GT_Values.VN.length - 3]; - Materials[] cables = { - Materials.Gold, - Materials.Aluminium, - Materials.Tungsten, - Materials.VanadiumGallium, - Materials.Naquadah, - Materials.NaquadahAlloy, - Materials.Superconductor - }; - Materials[] hulls = { - Materials.StainlessSteel, - Materials.Titanium, - Materials.TungstenSteel, - Materials.Chrome, - Materials.Iridium, - Materials.Osmium, - Materials.Naquadah - }; - Materials[] wireMat = { - Materials.Kanthal, - Materials.Nichrome, - Materials.TungstenSteel, - Materials.Naquadah, - Materials.NaquadahAlloy, - Materials.Superconductor - }; - Materials[] circuits = { - Materials.Advanced, - Materials.Data, - Materials.Elite, - Materials.Master, - Materials.Ultimate, - Materials.Superconductor - }; + Materials[] cables = { Materials.Gold, Materials.Aluminium, Materials.Tungsten, Materials.VanadiumGallium, + Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor }; + Materials[] hulls = { Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, Materials.Chrome, + Materials.Iridium, Materials.Osmium, Materials.Naquadah }; + Materials[] wireMat = { Materials.Kanthal, Materials.Nichrome, Materials.TungstenSteel, Materials.Naquadah, + Materials.NaquadahAlloy, Materials.Superconductor }; + Materials[] circuits = { Materials.Advanced, Materials.Data, Materials.Elite, Materials.Master, + Materials.Ultimate, Materials.Superconductor }; for (int i = 3; i < GT_Values.VN.length - 1; i++) { // 12625 BioLab[(i - 3)] = new GT_MetaTileEntity_BioLab( - ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i, - "bw.biolab" + GT_Values.VN[i], - GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.biolab.name"), - i) - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i, + "bw.biolab" + GT_Values.VN[i], + GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.biolab.name"), + i).getStackForm(1L); RadioHatch[(i - 3)] = new GT_MetaTileEntity_RadioHatch( - ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i, - "bw.radiohatch" + GT_Values.VN[i], - GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.radiohatch.name"), - i) - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i, + "bw.radiohatch" + GT_Values.VN[i], + GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.radiohatch.name"), + i).getStackForm(1L); try { ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); - GT_ModHandler.addCraftingRecipe(BioLab[(i - 3)], RecipeLoader.BITSD, new Object[] { - "PFP", - "WCW", - "OGO", - 'F', - GT_OreDictUnificator.get(OrePrefixes.frameGt, hulls[(i - 3)], 1L), - 'W', - GT_OreDictUnificator.get(OrePrefixes.wireGt01, wireMat[(i - 3)], 1L), - 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), - 'O', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), - 'G', - "circuit" + circuits[(i - 3)], - 'C', - machinehull - }); - GT_ModHandler.addCraftingRecipe(RadioHatch[(i - 3)], RecipeLoader.BITSD, new Object[] { - "DPD", - "DCD", - "DKD", - 'D', - GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), - 'C', - machinehull, - 'K', - GT_OreDictUnificator.get(OrePrefixes.cableGt08, cables[(i - 3)], 1L), - 'P', - Pistons[(i - 3)] - }); + GT_ModHandler.addCraftingRecipe( + BioLab[(i - 3)], + RecipeLoader.BITSD, + new Object[] { "PFP", "WCW", "OGO", 'F', + GT_OreDictUnificator.get(OrePrefixes.frameGt, hulls[(i - 3)], 1L), 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt01, wireMat[(i - 3)], 1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G', + "circuit" + circuits[(i - 3)], 'C', machinehull }); + GT_ModHandler.addCraftingRecipe( + RadioHatch[(i - 3)], + RecipeLoader.BITSD, + new Object[] { "DPD", "DCD", "DKD", 'D', + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), 'C', machinehull, + 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cables[(i - 3)], 1L), 'P', + Pistons[(i - 3)] }); } catch (ArrayIndexOutOfBoundsException e) { // e.printStackTrace(); } } GT_ModHandler.addCraftingRecipe( new GT_TileEntity_BioVat( - ConfigHandler.IDOffset + GT_Values.VN.length * 7, - "bw.biovat", - StatCollector.translateToLocal("tile.biovat.name")) - .getStackForm(1L), + ConfigHandler.IDOffset + GT_Values.VN.length * 7, + "bw.biovat", + StatCollector.translateToLocal("tile.biovat.name")).getStackForm(1L), RecipeLoader.BITSD, - new Object[] { - "GCG", - "KHK", - "GCG", - 'G', - new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), - 'C', - "circuit" + Materials.Data, - 'K', - GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Silver, 1L), - 'H', - ItemList.MACHINE_HULLS[3].get(1L) - }); - - Materials[] sterilizers = {Materials.Ammonia, Materials.Chlorine, Materials.Ethanol, Materials.Methanol}; + new Object[] { "GCG", "KHK", "GCG", 'G', new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 'C', + "circuit" + Materials.Data, 'K', + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Silver, 1L), 'H', + ItemList.MACHINE_HULLS[3].get(1L) }); + + Materials[] sterilizers = { Materials.Ammonia, Materials.Chlorine, Materials.Ethanol, Materials.Methanol }; for (Materials used : sterilizers) { GT_Values.RA.addAutoclaveRecipe( ItemList.Circuit_Parts_PetriDish.get(1L), @@ -358,16 +254,15 @@ public class BioRecipeLoader { 100, BW_Util.getMachineVoltageFromTier(1)); - FluidStack[] easyFluids = { - Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000) - }; + FluidStack[] easyFluids = { Materials.Water.getFluid(1000L), + FluidRegistry.getFluidStack("ic2distilledwater", 1000) }; for (FluidStack fluidStack : easyFluids) { BWRecipes.instance.addBioLabRecipeIncubation( new ItemStack(Items.rotten_flesh), BioCultureLoader.rottenFleshBacteria, - new int[] {3300}, - new FluidStack[] {fluidStack}, + new int[] { 3300 }, + new FluidStack[] { fluidStack }, 500, BW_Util.getMachineVoltageFromTier(3), BW_Util.STANDART); @@ -375,8 +270,8 @@ public class BioRecipeLoader { BWRecipes.instance.addBioLabRecipeIncubation( new ItemStack(Items.fermented_spider_eye), BioCultureLoader.eColi, - new int[] {4500}, - new FluidStack[] {fluidStack}, + new int[] { 4500 }, + new FluidStack[] { fluidStack }, 500, BW_Util.getMachineVoltageFromTier(3), BW_Util.STANDART); @@ -384,8 +279,8 @@ public class BioRecipeLoader { BWRecipes.instance.addBioLabRecipeIncubation( ItemList.Food_Dough.get(1L), BioCultureLoader.CommonYeast, - new int[] {7500}, - new FluidStack[] {fluidStack}, + new int[] { 7500 }, + new FluidStack[] { fluidStack }, 500, BW_Util.getMachineVoltageFromTier(3), BW_Util.STANDART); @@ -393,8 +288,8 @@ public class BioRecipeLoader { BWRecipes.instance.addBioLabRecipeIncubation( ItemList.Food_Dough_Sugar.get(1L), BioCultureLoader.WhineYeast, - new int[] {2500}, - new FluidStack[] {fluidStack}, + new int[] { 2500 }, + new FluidStack[] { fluidStack }, 500, BW_Util.getMachineVoltageFromTier(3), BW_Util.STANDART); @@ -402,8 +297,8 @@ public class BioRecipeLoader { BWRecipes.instance.addBioLabRecipeIncubation( ItemList.Bottle_Wine.get(1L), BioCultureLoader.WhineYeast, - new int[] {3300}, - new FluidStack[] {fluidStack}, + new int[] { 3300 }, + new FluidStack[] { fluidStack }, 500, BW_Util.getMachineVoltageFromTier(3), BW_Util.STANDART); @@ -411,8 +306,8 @@ public class BioRecipeLoader { BWRecipes.instance.addBioLabRecipeIncubation( ItemList.Bottle_Beer.get(1L), BioCultureLoader.BeerYeast, - new int[] {2500}, - new FluidStack[] {fluidStack}, + new int[] { 2500 }, + new FluidStack[] { fluidStack }, 500, BW_Util.getMachineVoltageFromTier(3), BW_Util.STANDART); @@ -420,8 +315,8 @@ public class BioRecipeLoader { BWRecipes.instance.addBioLabRecipeIncubation( ItemList.Bottle_Dark_Beer.get(1L), BioCultureLoader.BeerYeast, - new int[] {3300}, - new FluidStack[] {fluidStack}, + new int[] { 3300 }, + new FluidStack[] { fluidStack }, 500, BW_Util.getMachineVoltageFromTier(3), BW_Util.STANDART); @@ -429,67 +324,60 @@ public class BioRecipeLoader { BWRecipes.instance.addBioLabRecipeIncubation( new ItemStack(Blocks.dirt), BioCultureLoader.anaerobicOil, - new int[] {100}, - new FluidStack[] {fluidStack}, + new int[] { 100 }, + new FluidStack[] { fluidStack }, 1500, BW_Util.getMachineVoltageFromTier(4), BW_Util.STANDART); BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[] {new ItemStack(Items.sugar, 64)}, - new FluidStack[] {new FluidStack(fluidStack, 100)}, + new ItemStack[] { new ItemStack(Items.sugar, 64) }, + new FluidStack[] { new FluidStack(fluidStack, 100) }, BioCultureLoader.CommonYeast, - new FluidStack[] { - (LoaderReference.berriespp - ? FluidRegistry.getFluidStack("potion.ghp", 1) - : Materials.Ethanol.getFluid(1L)) - }, + new FluidStack[] { (LoaderReference.berriespp ? FluidRegistry.getFluidStack("potion.ghp", 1) + : Materials.Ethanol.getFluid(1L)) }, 350, BW_Util.getMachineVoltageFromTier(4)); BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[] {ItemList.Crop_Drop_Grapes.get(16)}, - new FluidStack[] {new FluidStack(fluidStack, 100)}, + new ItemStack[] { ItemList.Crop_Drop_Grapes.get(16) }, + new FluidStack[] { new FluidStack(fluidStack, 100) }, BioCultureLoader.WhineYeast, - new FluidStack[] {FluidRegistry.getFluidStack("potion.wine", 12)}, + new FluidStack[] { FluidRegistry.getFluidStack("potion.wine", 12) }, 200, BW_Util.getMachineVoltageFromTier(2)); BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[] { - new ItemStack(Items.sugar, 4), - ItemList.IC2_Hops.get(16L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 8L) - }, - new FluidStack[] {new FluidStack(fluidStack, 100)}, + new ItemStack[] { new ItemStack(Items.sugar, 4), ItemList.IC2_Hops.get(16L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 8L) }, + new FluidStack[] { new FluidStack(fluidStack, 100) }, BioCultureLoader.BeerYeast, - new FluidStack[] {FluidRegistry.getFluidStack("potion.beer", 5)}, + new FluidStack[] { FluidRegistry.getFluidStack("potion.beer", 5) }, 600, BW_Util.getMachineVoltageFromTier(1)); BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[] { - ItemList.IC2_Hops.get(32L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 16L) - }, - new FluidStack[] {new FluidStack(fluidStack, 100)}, + new ItemStack[] { ItemList.IC2_Hops.get(32L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 16L) }, + new FluidStack[] { new FluidStack(fluidStack, 100) }, BioCultureLoader.BeerYeast, - new FluidStack[] {FluidRegistry.getFluidStack("potion.darkbeer", 10)}, + new FluidStack[] { FluidRegistry.getFluidStack("potion.darkbeer", 10) }, 600, BW_Util.getMachineVoltageFromTier(1)); } BWRecipes.instance.addBacterialVatRecipe( null, - new FluidStack[] {FluidRegistry.getFluidStack("potion.grapejuice", 100)}, + new FluidStack[] { FluidRegistry.getFluidStack("potion.grapejuice", 100) }, BioCultureLoader.WhineYeast, - new FluidStack[] {FluidRegistry.getFluidStack("potion.wine", 12)}, + new FluidStack[] { FluidRegistry.getFluidStack("potion.wine", 12) }, 400, BW_Util.getMachineVoltageFromTier(1)); BWRecipes.instance.addBacterialVatRecipe( null, - new FluidStack[] {Materials.FermentedBiomass.getFluid(10000)}, + new FluidStack[] { Materials.FermentedBiomass.getFluid(10000) }, BioCultureLoader.anaerobicOil, - new FluidStack[] {new FluidStack(FluidLoader.fulvicAcid, 1000)}, + new FluidStack[] { new FluidStack(FluidLoader.fulvicAcid, 1000) }, 2748, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addFluidHeaterRecipe( @@ -519,7 +407,7 @@ public class BioRecipeLoader { public static void runOnServerStarted() { GT_Recipe.GT_Recipe_Map.sFermentingRecipes.mRecipeList.forEach( recipe -> BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[] {null}, + new ItemStack[] { null }, BioCultureLoader.generalPurposeFermentingBacteria, recipe.mFluidInputs, recipe.mFluidOutputs, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index ba11127fe5..9bf41ba172 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -1,27 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.loaders; +import java.awt.*; +import java.util.Arrays; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock; @@ -29,6 +30,7 @@ import com.github.bartimaeusnek.bartworks.client.renderer.RendererSwitchingColor import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BWTileEntityDimIDBridge; import com.github.bartimaeusnek.bartworks.util.BioCulture; + import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; @@ -37,14 +39,6 @@ import gregtech.api.objects.GT_Fluid; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Item_98; -import java.awt.*; -import java.util.Arrays; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; public class FluidLoader { @@ -64,15 +58,14 @@ public class FluidLoader { Arrays.fill(rgb, (short) 255); FluidLoader.ff = new GT_Fluid("BWfakeFluid", "molten.autogenerated", rgb); FluidLoader.fulvicAcid = FluidLoader.createAndRegisterFluid("Fulvic Acid", new Color(20, 20, 20)); - FluidLoader.heatedfulvicAcid = - FluidLoader.createAndRegisterFluid("Heated Fulvic Acid", new Color(40, 20, 20), 720); + FluidLoader.heatedfulvicAcid = FluidLoader + .createAndRegisterFluid("Heated Fulvic Acid", new Color(40, 20, 20), 720); FluidLoader.Kerogen = FluidLoader.createAndRegisterFluid("Kerogen", new Color(85, 85, 85)); FluidLoader.BioLabFluidMaterials = new Fluid[] { - new GT_Fluid("FluorecentdDNA", "molten.autogenerated", new short[] {125, 50, 170, 0}), - new GT_Fluid("EnzymesSollution", "molten.autogenerated", new short[] {240, 200, 125, 0}), - new GT_Fluid("Penicillin", "molten.autogenerated", new short[] {255, 255, 255, 0}), - new GT_Fluid("Polymerase", "molten.autogenerated", new short[] {110, 180, 110, 0}), - }; + new GT_Fluid("FluorecentdDNA", "molten.autogenerated", new short[] { 125, 50, 170, 0 }), + new GT_Fluid("EnzymesSollution", "molten.autogenerated", new short[] { 240, 200, 125, 0 }), + new GT_Fluid("Penicillin", "molten.autogenerated", new short[] { 255, 255, 255, 0 }), + new GT_Fluid("Polymerase", "molten.autogenerated", new short[] { 110, 180, 110, 0 }), }; FluidLoader.BioLabFluidCells = new ItemStack[FluidLoader.BioLabFluidMaterials.length]; for (int i = 0; i < FluidLoader.BioLabFluidMaterials.length; i++) { @@ -80,31 +73,27 @@ public class FluidLoader { } GT_MetaGenerated_Item_98.FluidCell[] fluidCells = new GT_MetaGenerated_Item_98.FluidCell[] { - GT_MetaGenerated_Item_98.FluidCell.FLUORESCENT_DNA, - GT_MetaGenerated_Item_98.FluidCell.ENZYME_SOLUTION, - GT_MetaGenerated_Item_98.FluidCell.PENICILLIN, - GT_MetaGenerated_Item_98.FluidCell.POLYMERASE, - }; + GT_MetaGenerated_Item_98.FluidCell.FLUORESCENT_DNA, GT_MetaGenerated_Item_98.FluidCell.ENZYME_SOLUTION, + GT_MetaGenerated_Item_98.FluidCell.PENICILLIN, GT_MetaGenerated_Item_98.FluidCell.POLYMERASE, }; for (int i = 0; i < fluidCells.length; i++) { FluidLoader.BioLabFluidCells[i] = fluidCells[i].get(); } - // BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", + // BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", // BW_Util.splitColorToRBGArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB()))); - FluidStack dnaFluid = LoaderReference.gendustry - ? FluidRegistry.getFluidStack("liquiddna", 100) + FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L); for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.isBreedable()) { - B.setFluid(new GT_Fluid( - B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[] { - (short) B.getColor().getRed(), - (short) B.getColor().getBlue(), - (short) B.getColor().getGreen() - })); + B.setFluid( + new GT_Fluid( + B.getName().replaceAll(" ", "").toLowerCase() + "fluid", + "molten.autogenerated", + new short[] { (short) B.getColor().getRed(), (short) B.getColor().getBlue(), + (short) B.getColor().getGreen() })); FluidRegistry.registerFluid(B.getFluid()); - GT_LanguageManager.addStringLocalization( - B.getFluid().getUnlocalizedName(), B.getLocalisedName() + " Fluid"); + GT_LanguageManager + .addStringLocalization(B.getFluid().getUnlocalizedName(), B.getLocalisedName() + " Fluid"); GT_Values.RA.addCentrifugeRecipe( GT_Utility.getIntegratedCircuit(10), GT_Values.NI, @@ -132,18 +121,22 @@ public class FluidLoader { } public static Fluid createAndRegisterFluid(String Name, Color color) { - Fluid f = new GT_Fluid(Name, "molten.autogenerated", new short[] { - (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(), (short) color.getAlpha() - }); + Fluid f = new GT_Fluid( + Name, + "molten.autogenerated", + new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(), + (short) color.getAlpha() }); GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), Name); FluidRegistry.registerFluid(f); return f; } public static Fluid createAndRegisterFluid(String Name, Color color, int temperature) { - Fluid f = new GT_Fluid(Name, "molten.autogenerated", new short[] { - (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(), (short) color.getAlpha() - }); + Fluid f = new GT_Fluid( + Name, + "molten.autogenerated", + new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(), + (short) color.getAlpha() }); GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), Name); f.setTemperature(temperature); FluidRegistry.registerFluid(f); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java index 40de4b8812..13aaa69461 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.loaders; @@ -26,11 +17,9 @@ import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.API.LoaderReference; /** - * Autogenerated run file, script Created on Wed Jan 2 19:11:07 2019 by boubou_19 and bartimaeusnek - * Executed on 2019-01-03 02:08:43 - * modified by bartimaeusnek to only add blocks that mods are loaded - * modified by bartimaeusnek on 2020-03-22 00:20 to run statically - * modified by Quarri6343 on 2022-08-24 20:02 to add Botania Support + * Autogenerated run file, script Created on Wed Jan 2 19:11:07 2019 by boubou_19 and bartimaeusnek Executed on + * 2019-01-03 02:08:43 modified by bartimaeusnek to only add blocks that mods are loaded modified by bartimaeusnek on + * 2020-03-22 00:20 to run statically modified by Quarri6343 on 2022-08-24 20:02 to add Botania Support */ public class GTNHBlocks { @@ -47,9 +36,8 @@ public class GTNHBlocks { BioVatLogicAdder.BioVatGlass.addCustomGlass("Botania", "elfGlassPane", 0, 5); } if (LoaderReference.Botany) BioVatLogicAdder.BioVatGlass.addCustomGlass("Botany", "stained", 0, 3); - if (LoaderReference.EnderIO) - for (int i = 0; i <= 5; ++i) - BioVatLogicAdder.BioVatGlass.addCustomGlass("EnderIO", "blockFusedQuartz", i, 3); + if (LoaderReference.EnderIO) for (int i = 0; i <= 5; ++i) + BioVatLogicAdder.BioVatGlass.addCustomGlass("EnderIO", "blockFusedQuartz", i, 3); if (LoaderReference.ExtraUtilities) { BioVatLogicAdder.BioVatGlass.addCustomGlass("ExtraUtilities", "decorativeBlock1", 9, 3); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 3ec699d6cc..a66ad633d5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.loaders; @@ -26,6 +17,13 @@ import static com.github.bartimaeusnek.bartworks.MainMod.BWT; import static com.github.bartimaeusnek.bartworks.MainMod.GT2; import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.blocks.*; @@ -44,6 +42,7 @@ import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileE import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileEntity_LowPowerLaserDynamo; import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileEntity_LowPowerLaserHatch; import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileEntity_Pipe_Energy_LowPower; + import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -51,12 +50,6 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; import ic2.api.item.IKineticRotor; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; public class ItemRegistry { @@ -66,8 +59,10 @@ public class ItemRegistry { public static final Item ROCKCUTTER_MV = new GT_Rockcutter_Item(2); public static final Item ROCKCUTTER_HV = new GT_Rockcutter_Item(3); public static final Item CIRCUIT_PROGRAMMER = new Circuit_Programmer(); - public static final Block ROTORBLOCK = - new BW_TileEntityContainer_MachineBlock(Material.wood, BW_RotorBlock.class, "BWRotorBlock"); + public static final Block ROTORBLOCK = new BW_TileEntityContainer_MachineBlock( + Material.wood, + BW_RotorBlock.class, + "BWRotorBlock"); public static final Item LEATHER_ROTOR = new BW_Stonage_Rotors( 7, 0.15f, @@ -126,93 +121,79 @@ public class ItemRegistry { "rotors/combinedParts"); public static final Item TAB = new SimpleIconItem("GT2Coin"); public static final Item WINDMETER = new BW_SimpleWindMeter(); - public static final Block PUMPBLOCK = - new BW_TileEntityContainer(Material.anvil, BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPump"); + public static final Block PUMPBLOCK = new BW_TileEntityContainer( + Material.anvil, + BW_TileEntity_HeatedWaterPump.class, + "BWHeatedWaterPump"); public static final Item PUMPPARTS = new SimpleSubItemClass("BWrawtube", "BWmotor"); - public static final Block EXPPUMP = - new BW_TileEntityContainer(Material.coral, BW_TileEntity_ExperimentalFloodGate.class, "ExpReversePump"); + public static final Block EXPPUMP = new BW_TileEntityContainer( + Material.coral, + BW_TileEntity_ExperimentalFloodGate.class, + "ExpReversePump"); public static final Block bw_realglas = new BW_GlasBlocks( "BW_GlasBlocks", - new String[] { - MainMod.MOD_ID + ":BoronSilicateGlassBlock", - MainMod.MOD_ID + ":TitaniumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":TungstenSteelReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":LuVTierMaterialReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":IridiumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":OsmiumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock1", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock2", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock3", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock4", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock5", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock6", - MainMod.MOD_ID + ":ThoriumYttriumGlass", - MainMod.MOD_ID + ":NeutroniumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":CosmicNeutroniumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":InfinityReinforcedBoronSilicateGlassBlock", - }, - new short[][] { - Materials.BorosilicateGlass.getRGBA(), - Materials.Titanium.getRGBA(), - Materials.TungstenSteel.getRGBA(), - Materials.Chrome.getRGBA(), - Materials.Iridium.getRGBA(), - Materials.Osmium.getRGBA(), - new short[] {0xff, 0, 0}, - new short[] {0, 0xff, 0}, - new short[] {0x80, 0, 0xff}, - new short[] {0xff, 0xff, 0}, - new short[] {0, 0xff, 0x80}, - new short[] {0x80, 0x33, 0}, - WerkstoffLoader.YttriumOxide.getRGBA(), - Materials.Neutronium.getRGBA(), - Materials.CosmicNeutronium.getRGBA(), - new short[] {0xda, 0xeb, 0xff}, - }, + new String[] { MainMod.MOD_ID + ":BoronSilicateGlassBlock", + MainMod.MOD_ID + ":TitaniumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":TungstenSteelReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":LuVTierMaterialReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":IridiumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":OsmiumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock1", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock2", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock3", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock4", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock5", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock6", MainMod.MOD_ID + ":ThoriumYttriumGlass", + MainMod.MOD_ID + ":NeutroniumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":CosmicNeutroniumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":InfinityReinforcedBoronSilicateGlassBlock", }, + new short[][] { Materials.BorosilicateGlass.getRGBA(), Materials.Titanium.getRGBA(), + Materials.TungstenSteel.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), + Materials.Osmium.getRGBA(), new short[] { 0xff, 0, 0 }, new short[] { 0, 0xff, 0 }, + new short[] { 0x80, 0, 0xff }, new short[] { 0xff, 0xff, 0 }, new short[] { 0, 0xff, 0x80 }, + new short[] { 0x80, 0x33, 0 }, WerkstoffLoader.YttriumOxide.getRGBA(), + Materials.Neutronium.getRGBA(), Materials.CosmicNeutronium.getRGBA(), + new short[] { 0xda, 0xeb, 0xff }, }, MainMod.BIO_TAB, true, false); public static final Block bw_realglas2 = new BW_GlasBlocks2( "BW_GlasBlocks2", - new String[] {MainMod.MOD_ID + ":TranscendentallyReinforcedBoronSilicateGlassBlock"}, - new short[][] {new short[] {50, 50, 50}}, + new String[] { MainMod.MOD_ID + ":TranscendentallyReinforcedBoronSilicateGlassBlock" }, + new short[][] { new short[] { 50, 50, 50 } }, MainMod.BIO_TAB, true, false); - public static final Block[] bw_glasses = {bw_realglas, bw_realglas2}; + public static final Block[] bw_glasses = { bw_realglas, bw_realglas2 }; public static final Block bw_fake_glasses = new BW_GlasBlocks( - "BW_GlasBlocks", new String[] {MainMod.MOD_ID + ":BoronSilicateGlassBlockRandlos"}, null, null, true, true); + "BW_GlasBlocks", + new String[] { MainMod.MOD_ID + ":BoronSilicateGlassBlockRandlos" }, + null, + null, + true, + true); public static final Block bw_fake_glasses2 = new BW_GlasBlocks2( "BW_GlasBlocks2", - new String[] {MainMod.MOD_ID + ":BoronSilicateGlassBlockRandlos"}, + new String[] { MainMod.MOD_ID + ":BoronSilicateGlassBlockRandlos" }, null, null, true, true); public static final Block[] BW_BLOCKS = { - new BW_Blocks( - "BW_ItemBlocks", - new String[] { - MainMod.MOD_ID + ":EtchedLapisCell", MainMod.MOD_ID + ":PlatedLapisCell", - }, - GT2), - new BW_Blocks( - "GT_LESU_CASING", - new String[] { - MainMod.MOD_ID + ":LESU_CELL", - }, - GT2), - new BW_Blocks( - "BW_Machinery_Casings", - new String[] { - MainMod.MOD_ID + ":NickelFerriteBlocks", MainMod.MOD_ID + ":TransformerCoil", + new BW_Blocks( + "BW_ItemBlocks", + new String[] { MainMod.MOD_ID + ":EtchedLapisCell", MainMod.MOD_ID + ":PlatedLapisCell", }, + GT2), + new BW_Blocks("GT_LESU_CASING", new String[] { MainMod.MOD_ID + ":LESU_CELL", }, GT2), + new BW_Blocks( + "BW_Machinery_Casings", + new String[] { MainMod.MOD_ID + ":NickelFerriteBlocks", MainMod.MOD_ID + ":TransformerCoil", // MainMod.MOD_ID+":DEHP_Casing", // MainMod.MOD_ID+":DEHP_Casing_Base" - }, - BWT), - }; + }, + BWT), }; public static ItemStack[] diode2A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] diode4A = new ItemStack[GT_Values.VN.length]; @@ -267,185 +248,172 @@ public class ItemRegistry { GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_HV, ItemRegistry.ROCKCUTTER_HV.getUnlocalizedName()); GameRegistry.registerItem(ItemRegistry.TAB, "tabIconGT2"); if (newStuff) { - if (ConfigHandler.creativeScannerID != 0) - new CreativeScanner( - ConfigHandler.creativeScannerID, "Creative Debug Scanner", "Creative Debug Scanner", 20); + if (ConfigHandler.creativeScannerID != 0) new CreativeScanner( + ConfigHandler.creativeScannerID, + "Creative Debug Scanner", + "Creative Debug Scanner", + 20); ItemRegistry.eic = new GT_TileEntity_ElectricImplosionCompressor( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, - "ElectricImplosionCompressor", - "Electric Implosion Compressor") - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, + "ElectricImplosionCompressor", + "Electric Implosion Compressor").getStackForm(1L); // EIC depend on neutronium block to pass on structure updates int bitmask = GregTech_API.sMachineIDs.getOrDefault(GregTech_API.sBlockMetal5, 0) | (1 << 2); GregTech_API.registerMachineBlock(GregTech_API.sBlockMetal5, bitmask); ItemRegistry.THTR = new GT_TileEntity_THTR( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, - "THTR", - "Thorium High Temperature Reactor") - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, + "THTR", + "Thorium High Temperature Reactor").getStackForm(1L); GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials(); ItemRegistry.HTGR = new GT_TileEntity_HTGR( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 48, - "HTGR", - "High Temperature Gas-cooled Reactor") - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 48, + "HTGR", + "High Temperature Gas-cooled Reactor").getStackForm(1L); GT_TileEntity_HTGR.HTGRMaterials.registeraTHR_Materials(); ItemRegistry.EIG = new GT_TileEntity_ExtremeIndustrialGreenhouse( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 49, - "EIG", - "Extreme Industrial Greenhouse") - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 49, + "EIG", + "Extreme Industrial Greenhouse").getStackForm(1L); GT_OreDictUnificator.add( - OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); + OrePrefixes.block, + Materials.BorosilicateGlass, + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); GT_OreDictUnificator.registerOre( - OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(ItemRegistry.BW_BLOCKS[2])); + OrePrefixes.block, + Materials.NickelZincFerrite, + new ItemStack(ItemRegistry.BW_BLOCKS[2])); for (int i = 0; i < GT_Values.VN.length - 1; i++) { ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode( - ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, - "diode" + "2A" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.diode.name") + " 2A " + GT_Values.VN[i], - i) - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, + "diode" + "2A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 2A " + GT_Values.VN[i], + i).getStackForm(1L); ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode( - ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, - "diode" + "4A" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.diode.name") + " 4A " + GT_Values.VN[i], - i) - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, + "diode" + "4A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 4A " + GT_Values.VN[i], + i).getStackForm(1L); ItemRegistry.diode8A[i] = new GT_MetaTileEntity_Diode( - ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, - "diode" + "8A" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.diode.name") + " 8A " + GT_Values.VN[i], - i) - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, + "diode" + "8A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 8A " + GT_Values.VN[i], + i).getStackForm(1L); ItemRegistry.diode12A[i] = new GT_MetaTileEntity_Diode( - ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, - "diode" + "12A" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.diode.name") + " 12A " + GT_Values.VN[i], - i) - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, + "diode" + "12A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 12A " + GT_Values.VN[i], + i).getStackForm(1L); ItemRegistry.diode16A[i] = new GT_MetaTileEntity_Diode( - ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, - "diode" + "16A" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.diode.name") + " 16A " + GT_Values.VN[i], - i) - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, + "diode" + "16A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 16A " + GT_Values.VN[i], + i).getStackForm(1L); ItemRegistry.energyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor( - ConfigHandler.IDOffset + 1 + i, - "energydistributor" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.energydistributor.name") + " " + GT_Values.VN[i], - i) - .getStackForm(1L); + ConfigHandler.IDOffset + 1 + i, + "energydistributor" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.energydistributor.name") + " " + GT_Values.VN[i], + i).getStackForm(1L); } for (int i = 0; i < 3; i++) { ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, - "acidgenerator" + GT_Values.VN[i + 2], - StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[i + 2], - i + 2) - .getStackForm(1); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, + "acidgenerator" + GT_Values.VN[i + 2], + StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[i + 2], + i + 2).getStackForm(1); } ItemRegistry.acidGensLV = new GT_MetaTileEntity_AcidGenerator( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 65, - "acidgenerator" + GT_Values.VN[1], - StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[1], - +1) - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 65, + "acidgenerator" + GT_Values.VN[1], + StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[1], + +1).getStackForm(1L); ItemRegistry.dehp = new GT_TileEntity_DEHP( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump") - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, + 1, + "DEHP", + "Deep Earth Heating Pump").getStackForm(1L); ItemRegistry.megaMachines[0] = new GT_TileEntity_MegaBlastFurnace( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, - "MegaBlastFurnace", - StatCollector.translateToLocal("tile.bw.mbf.name")) - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, + "MegaBlastFurnace", + StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L); ItemRegistry.megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, - "MegaVacuumFreezer", - StatCollector.translateToLocal("tile.bw.mvf.name")) - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, + "MegaVacuumFreezer", + StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L); ItemRegistry.cal = new GT_TileEntity_CircuitAssemblyLine( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 7, - "CircuitAssemblyLine", - "Circuit Assembly Line") - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 7, + "CircuitAssemblyLine", + "Circuit Assembly Line").getStackForm(1L); ItemRegistry.compressedHatch = new GT_MetaTileEntity_CompressedFluidHatch( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, - "CompressedFluidHatch", - "Liquid Air Fluid Hatch") - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, + "CompressedFluidHatch", + "Liquid Air Fluid Hatch").getStackForm(1L); ItemRegistry.giantOutputHatch = new GT_MetaTileEntity_GiantOutputHatch( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, - "GiantOutputHatch", - "Giant Output Hatch") - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, + "GiantOutputHatch", + "Giant Output Hatch").getStackForm(1L); ItemRegistry.megaMachines[2] = new GT_TileEntity_MegaDistillTower( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, - "MegaDistillationTower", - "Mega Distillation Tower") - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, + "MegaDistillationTower", + "Mega Distillation Tower").getStackForm(1L); ItemRegistry.megaMachines[3] = new GT_TileEntity_MegaChemicalReactor( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 638, - "MegaChemicalReactor", - "Mega Chemical Reactor") - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 638, + "MegaChemicalReactor", + "Mega Chemical Reactor").getStackForm(1L); ItemRegistry.megaMachines[4] = new GT_TileEntity_MegaOilCracker( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 639, - "MegaOilCracker", - "Mega Oil Cracker") - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 639, + "MegaOilCracker", + "Mega Oil Cracker").getStackForm(1L); if (LoaderReference.galacticgreg && WerkstoffLoader.gtnhGT) { ItemRegistry.voidminer[2] = new GT_TileEntity_VoidMiners.VMUV( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 11, "VoidMiner3", "Void Miner III") - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 11, + "VoidMiner3", + "Void Miner III").getStackForm(1L); ItemRegistry.voidminer[1] = new GT_TileEntity_VoidMiners.VMZPM( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 12, "VoidMiner2", "Void Miner II") - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 12, + "VoidMiner2", + "Void Miner II").getStackForm(1L); ItemRegistry.voidminer[0] = new GT_TileEntity_VoidMiners.VMLUV( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 13, "VoidMiner1", "Void Miner I") - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 13, + "VoidMiner1", + "Void Miner I").getStackForm(1L); } if (LoaderReference.tectech) { TecTechPipeEnergyLowPower = new TT_MetaTileEntity_Pipe_Energy_LowPower( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 14, - "pipe.lowpowerlaser", - "Low Power Laser Pipe") - .getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 14, + "pipe.lowpowerlaser", + "Low Power Laser Pipe").getStackForm(1L); int startID = ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15; for (int amps = 32; amps <= 128; amps += 32) { for (int tier = 4; tier < 8; tier++) { TecTechLaserAdditions[0][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserBox( - startID++, - GT_Values.VN[tier] + "_LPLaser_Converter_" + amps, - GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Converter", - tier, - amps) - .getStackForm(1L); + startID++, + GT_Values.VN[tier] + "_LPLaser_Converter_" + amps, + GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Converter", + tier, + amps).getStackForm(1L); } } for (int amps = 32; amps <= 128; amps += 32) { for (int tier = 4; tier < 8; tier++) { TecTechLaserAdditions[1][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserHatch( - startID++, - GT_Values.VN[tier] + "_LPLaser_Hatch_" + amps, - GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Target Hatch", - tier, - amps) - .getStackForm(1L); + startID++, + GT_Values.VN[tier] + "_LPLaser_Hatch_" + amps, + GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Target Hatch", + tier, + amps).getStackForm(1L); } } for (int amps = 32; amps <= 128; amps += 32) { for (int tier = 4; tier < 8; tier++) { TecTechLaserAdditions[2][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserDynamo( - startID++, - GT_Values.VN[tier] + "_LPLaser_Dynamo_" + amps, - GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Source Hatch", - tier, - amps) - .getStackForm(1L); + startID++, + GT_Values.VN[tier] + "_LPLaser_Dynamo_" + amps, + GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Source Hatch", + tier, + amps).getStackForm(1L); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java index 9ca7cedec8..4307dca78c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.loaders; @@ -29,36 +20,41 @@ public class LocalisationLoader { private LocalisationLoader() {} private static void localiseTooltips() { - GT_LanguageManager.addStringLocalization( - "metaitem.01.tooltip.purify.2", "Throw into Cauldron to get clean crushed Ore"); - GT_LanguageManager.addStringLocalization( - "metaitem.01.tooltip.nqgen", "Can be used as Enriched Naquadah Fuel Substitute"); + GT_LanguageManager + .addStringLocalization("metaitem.01.tooltip.purify.2", "Throw into Cauldron to get clean crushed Ore"); + GT_LanguageManager + .addStringLocalization("metaitem.01.tooltip.nqgen", "Can be used as Enriched Naquadah Fuel Substitute"); } private static void localiseAchivements() { GT_LanguageManager.addStringLocalization( - "achievement.gt.blockmachines.electricimplosioncompressor", "Electric Implosions?"); + "achievement.gt.blockmachines.electricimplosioncompressor", + "Electric Implosions?"); GT_LanguageManager.addStringLocalization( "achievement.gt.blockmachines.electricimplosioncompressor.desc", "Basically a giant Hammer that presses Stuff - No more TNT!"); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp", "Heat from below!"); + GT_LanguageManager + .addStringLocalization("achievement.gt.blockmachines.dehp.desc", "Get ALL the thermal energy!"); + GT_LanguageManager + .addStringLocalization("achievement.gt.blockmachines.circuitassemblyline", "Cheaper Circuits?"); GT_LanguageManager.addStringLocalization( - "achievement.gt.blockmachines.dehp.desc", "Get ALL the thermal energy!"); - GT_LanguageManager.addStringLocalization( - "achievement.gt.blockmachines.circuitassemblyline", "Cheaper Circuits?"); - GT_LanguageManager.addStringLocalization( - "achievement.gt.blockmachines.circuitassemblyline.desc", "Well, yes, but actually no..."); + "achievement.gt.blockmachines.circuitassemblyline.desc", + "Well, yes, but actually no..."); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer1", "Ores from deep below!"); GT_LanguageManager.addStringLocalization( - "achievement.gt.blockmachines.voidminer1.desc", "Is this some kind of Ex-Nihilo?"); - GT_LanguageManager.addStringLocalization( - "achievement.gt.blockmachines.voidminer2", "Ores from deep below 2! Electric Boogaloo!"); - GT_LanguageManager.addStringLocalization( - "achievement.gt.blockmachines.voidminer2.desc", "Ex-Nihilo, but faster!"); + "achievement.gt.blockmachines.voidminer1.desc", + "Is this some kind of Ex-Nihilo?"); GT_LanguageManager.addStringLocalization( - "achievement.gt.blockmachines.voidminer3", "Ores from deep below 3! Trinity Ex-Nihilo"); + "achievement.gt.blockmachines.voidminer2", + "Ores from deep below 2! Electric Boogaloo!"); + GT_LanguageManager + .addStringLocalization("achievement.gt.blockmachines.voidminer2.desc", "Ex-Nihilo, but faster!"); GT_LanguageManager.addStringLocalization( - "achievement.gt.blockmachines.voidminer3.desc", "3x the trouble, 3x the fun!"); + "achievement.gt.blockmachines.voidminer3", + "Ores from deep below 3! Trinity Ex-Nihilo"); + GT_LanguageManager + .addStringLocalization("achievement.gt.blockmachines.voidminer3.desc", "3x the trouble, 3x the fun!"); } public static void localiseAll() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java index 8d0bdd1b48..ee839f56c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java @@ -4,6 +4,7 @@ import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialIte import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; + import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -27,24 +28,21 @@ public class RadioHatchMaterialLoader { for (Materials material : Materials.getAll()) { if (material == null || material.mElement == null) continue; - boolean validProton = material.getProtons() >= 83 - && !material.equals(Materials.Tritanium) // No Tritanium + boolean validProton = material.getProtons() >= 83 && !material.equals(Materials.Tritanium) // No Tritanium && !material.equals(Materials.Naquadah); // Naquadah needs spacial value if (validProton) { int level = (int) material.getProtons(); short[] rgba = material.getRGBA(); - if (GT_OreDictUnificator.get(OrePrefixes.stick, material, 1) != null) - BWRecipes.instance.addRadHatch( - GT_OreDictUnificator.get(OrePrefixes.stick, material, 1), level, 1, rgba); - if (GT_OreDictUnificator.get(OrePrefixes.stickLong, material, 1) != null) - BWRecipes.instance.addRadHatch( - GT_OreDictUnificator.get(OrePrefixes.stickLong, material, 1), level, 2, rgba); + if (GT_OreDictUnificator.get(OrePrefixes.stick, material, 1) != null) BWRecipes.instance + .addRadHatch(GT_OreDictUnificator.get(OrePrefixes.stick, material, 1), level, 1, rgba); + if (GT_OreDictUnificator.get(OrePrefixes.stickLong, material, 1) != null) BWRecipes.instance + .addRadHatch(GT_OreDictUnificator.get(OrePrefixes.stickLong, material, 1), level, 2, rgba); } } - Materials[] spacialMaterial = - new Materials[] {Materials.Naquadah, Materials.NaquadahEnriched, Materials.Naquadria}; - int[] spacialValue = new int[] {130, 140, 150}; + Materials[] spacialMaterial = new Materials[] { Materials.Naquadah, Materials.NaquadahEnriched, + Materials.Naquadria }; + int[] spacialValue = new int[] { 130, 140, 150 }; for (int i = 0; i < spacialMaterial.length; i++) { if (GT_OreDictUnificator.get(OrePrefixes.stick, spacialMaterial[i], 1) != null) @@ -62,29 +60,56 @@ public class RadioHatchMaterialLoader { } BWRecipes.instance.addRadHatch( - ItemList.ThoriumCell_1.get(1), (int) Materials.Thorium.getProtons(), 3, Materials.Thorium.mRGBa); + ItemList.ThoriumCell_1.get(1), + (int) Materials.Thorium.getProtons(), + 3, + Materials.Thorium.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.ThoriumCell_2.get(1), (int) Materials.Thorium.getProtons(), 6, Materials.Thorium.mRGBa); + ItemList.ThoriumCell_2.get(1), + (int) Materials.Thorium.getProtons(), + 6, + Materials.Thorium.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.ThoriumCell_4.get(1), (int) Materials.Thorium.getProtons(), 12, Materials.Thorium.mRGBa); + ItemList.ThoriumCell_4.get(1), + (int) Materials.Thorium.getProtons(), + 12, + Materials.Thorium.mRGBa); BWRecipes.instance.addRadHatch(ItemList.NaquadahCell_1.get(1), 140, 3, Materials.NaquadahEnriched.mRGBa); BWRecipes.instance.addRadHatch(ItemList.NaquadahCell_2.get(1), 140, 6, Materials.NaquadahEnriched.mRGBa); BWRecipes.instance.addRadHatch(ItemList.NaquadahCell_4.get(1), 140, 12, Materials.NaquadahEnriched.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.Moxcell_1.get(1), (int) Materials.Plutonium.getProtons(), 3, Materials.Plutonium.mRGBa); + ItemList.Moxcell_1.get(1), + (int) Materials.Plutonium.getProtons(), + 3, + Materials.Plutonium.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.Moxcell_2.get(1), (int) Materials.Plutonium.getProtons(), 6, Materials.Plutonium.mRGBa); + ItemList.Moxcell_2.get(1), + (int) Materials.Plutonium.getProtons(), + 6, + Materials.Plutonium.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.Moxcell_4.get(1), (int) Materials.Plutonium.getProtons(), 12, Materials.Plutonium.mRGBa); + ItemList.Moxcell_4.get(1), + (int) Materials.Plutonium.getProtons(), + 12, + Materials.Plutonium.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.Uraniumcell_1.get(1), (int) Materials.Uranium.getProtons(), 3, Materials.Uranium.mRGBa); + ItemList.Uraniumcell_1.get(1), + (int) Materials.Uranium.getProtons(), + 3, + Materials.Uranium.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.Uraniumcell_2.get(1), (int) Materials.Uranium.getProtons(), 6, Materials.Uranium.mRGBa); + ItemList.Uraniumcell_2.get(1), + (int) Materials.Uranium.getProtons(), + 6, + Materials.Uranium.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.Uraniumcell_4.get(1), (int) Materials.Uranium.getProtons(), 12, Materials.Uranium.mRGBa); + ItemList.Uraniumcell_4.get(1), + (int) Materials.Uranium.getProtons(), + 12, + Materials.Uranium.mRGBa); BWRecipes.instance.addRadHatch( BW_NonMeta_MaterialItems.TiberiumCell_1.get(1), @@ -102,8 +127,8 @@ public class RadioHatchMaterialLoader { 12, WerkstoffLoader.Tiberium.getRGBA()); - BWRecipes.instance.addRadHatch( - BW_NonMeta_MaterialItems.TheCoreCell.get(1), 140, 96, Materials.NaquadahEnriched.mRGBa); + BWRecipes.instance + .addRadHatch(BW_NonMeta_MaterialItems.TheCoreCell.get(1), 140, 96, Materials.NaquadahEnriched.mRGBa); BWRecipes.instance.addRadHatch( ItemList.Depleted_Thorium_1.get(1), @@ -121,12 +146,12 @@ public class RadioHatchMaterialLoader { 12, Materials.Thorium.mRGBa); - BWRecipes.instance.addRadHatch( - ItemList.Depleted_Naquadah_1.get(1), 140 / 10, 3, Materials.NaquadahEnriched.mRGBa); - BWRecipes.instance.addRadHatch( - ItemList.Depleted_Naquadah_2.get(1), 140 / 10, 6, Materials.NaquadahEnriched.mRGBa); - BWRecipes.instance.addRadHatch( - ItemList.Depleted_Naquadah_4.get(1), 140 / 10, 12, Materials.NaquadahEnriched.mRGBa); + BWRecipes.instance + .addRadHatch(ItemList.Depleted_Naquadah_1.get(1), 140 / 10, 3, Materials.NaquadahEnriched.mRGBa); + BWRecipes.instance + .addRadHatch(ItemList.Depleted_Naquadah_2.get(1), 140 / 10, 6, Materials.NaquadahEnriched.mRGBa); + BWRecipes.instance + .addRadHatch(ItemList.Depleted_Naquadah_4.get(1), 140 / 10, 12, Materials.NaquadahEnriched.mRGBa); BWRecipes.instance.addRadHatch( GT_ModHandler.getModItem("IC2", "reactorMOXSimpledepleted", 1), @@ -177,7 +202,10 @@ public class RadioHatchMaterialLoader { WerkstoffLoader.Tiberium.getRGBA()); BWRecipes.instance.addRadHatch( - BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), 130 / 10, 96, Materials.Naquadah.mRGBa); + BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), + 130 / 10, + 96, + Materials.Naquadah.mRGBa); if (WerkstoffLoader.gtnhGT) { BWRecipes.instance.addRadHatch(ItemList.MNqCell_1.get(1), 150, 3, Materials.Naquadria.mRGBa); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index d2ba8f2d59..bfcf0eadc3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -1,29 +1,29 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.loaders; import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.*; @@ -31,6 +31,7 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; + import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.interfaces.ISubTagContainer; @@ -39,19 +40,10 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import ic2.core.Ic2Items; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; public class RecipeLoader { - protected static final long BITSD = GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + protected static final long BITSD = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE; @SuppressWarnings("deprecation") @@ -69,22 +61,16 @@ public class RecipeLoader { 100, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), - Materials.Lapis.getPlates(9), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2L), - GT_Utility.getIntegratedCircuit(17) - }, + new ItemStack[] { new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), Materials.Lapis.getPlates(9), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2L), + GT_Utility.getIntegratedCircuit(17) }, FluidRegistry.getFluidStack("ic2coolant", 1000), new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), 100, BW_Util.getMachineVoltageFromTier(3)); GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), - Materials.Lapis.getBlocks(8), - GT_Utility.getIntegratedCircuit(17) - }, + new ItemStack[] { new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), Materials.Lapis.getBlocks(8), + GT_Utility.getIntegratedCircuit(17) }, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, @@ -95,19 +81,18 @@ public class RecipeLoader { */ GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - Materials.Lapis.getBlocks(8), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L), - GT_Utility.getIntegratedCircuit(17) - }, + new ItemStack[] { Materials.Lapis.getBlocks(8), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L), + GT_Utility.getIntegratedCircuit(17) }, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, BW_Util.getMachineVoltageFromTier(1)); - GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[1]), RecipeLoader.BITSD, new Object[] { - "LLL", "LCL", "LLL", 'L', Materials.Lapis.getBlocks(1), 'C', "circuitBasic" - }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.BW_BLOCKS[1]), + RecipeLoader.BITSD, + new Object[] { "LLL", "LCL", "LLL", 'L', Materials.Lapis.getBlocks(1), 'C', "circuitBasic" }); GT_Values.RA.addCutterRecipe( new ItemStack(ItemRegistry.BW_BLOCKS[1]), @@ -128,11 +113,11 @@ public class RecipeLoader { GT_ModHandler.addShapelessCraftingRecipe( new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), RecipeLoader.BITSD, - new Object[] {new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1)}); + new Object[] { new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1) }); GT_ModHandler.addShapelessCraftingRecipe( new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), RecipeLoader.BITSD, - new Object[] {new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0)}); + new Object[] { new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0) }); } /* @@ -142,117 +127,69 @@ public class RecipeLoader { GT_ModHandler.addCraftingRecipe( new GT_TileEntity_LESU(ConfigHandler.IDOffset, "LESU", "L.E.S.U.").getStackForm(1L), RecipeLoader.BITSD, - new Object[] { - "CDC", - "SBS", - "CFC", - 'C', - ConfigHandler.hardmode ? "circuitAdvanced" : "circuitBasic", - 'D', - ItemList.Cover_Screen.get(1L), - 'S', - GT_OreDictUnificator.get( - OrePrefixes.cableGt12, - ConfigHandler.hardmode ? Materials.Platinum : Materials.AnnealedCopper, - 1L), - 'B', - new ItemStack(ItemRegistry.BW_BLOCKS[1]), - 'F', - ConfigHandler.hardmode ? ItemList.Field_Generator_HV.get(1L) : ItemList.Field_Generator_LV.get(1L) - }); + new Object[] { "CDC", "SBS", "CFC", 'C', ConfigHandler.hardmode ? "circuitAdvanced" : "circuitBasic", + 'D', ItemList.Cover_Screen.get(1L), 'S', + GT_OreDictUnificator.get( + OrePrefixes.cableGt12, + ConfigHandler.hardmode ? Materials.Platinum : Materials.AnnealedCopper, + 1L), + 'B', new ItemStack(ItemRegistry.BW_BLOCKS[1]), 'F', + ConfigHandler.hardmode ? ItemList.Field_Generator_HV.get(1L) + : ItemList.Field_Generator_LV.get(1L) }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.DESTRUCTOPACK), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { - "CPC", - "PLP", - "CPC", - 'C', - "circuitAdvanced", - 'P', - GT_OreDictUnificator.get( - ConfigHandler.hardmode ? OrePrefixes.plateDouble : OrePrefixes.plate, - Materials.Aluminium, - 1L), - 'L', - new ItemStack(Items.lava_bucket) - }); + new ItemStack(ItemRegistry.DESTRUCTOPACK), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "CPC", "PLP", "CPC", 'C', "circuitAdvanced", 'P', + GT_OreDictUnificator.get( + ConfigHandler.hardmode ? OrePrefixes.plateDouble : OrePrefixes.plate, + Materials.Aluminium, + 1L), + 'L', new ItemStack(Items.lava_bucket) }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.DESTRUCTOPACK), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { - "CPC", - "PLP", - "CPC", - 'C', - "circuitAdvanced", - 'P', - GT_OreDictUnificator.get( - ConfigHandler.hardmode ? OrePrefixes.plateDouble : OrePrefixes.plate, - ConfigHandler.hardmode ? Materials.Steel : Materials.Iron, - 1L), - 'L', - new ItemStack(Items.lava_bucket) - }); + new ItemStack(ItemRegistry.DESTRUCTOPACK), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "CPC", "PLP", "CPC", 'C', "circuitAdvanced", 'P', + GT_OreDictUnificator.get( + ConfigHandler.hardmode ? OrePrefixes.plateDouble : OrePrefixes.plate, + ConfigHandler.hardmode ? Materials.Steel : Materials.Iron, + 1L), + 'L', new ItemStack(Items.lava_bucket) }); - GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.ROCKCUTTER_MV), RecipeLoader.BITSD, new Object[] { - "DS ", - "DP ", - "DCB", - 'D', - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), - 'S', - GT_OreDictUnificator.get(OrePrefixes.stick, Materials.TungstenSteel, 1L), - 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 1L), - 'C', - "circuitGood", - 'B', - ItemList.IC2_AdvBattery.get(1L) - }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.ROCKCUTTER_MV), + RecipeLoader.BITSD, + new Object[] { "DS ", "DP ", "DCB", 'D', + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), 'S', + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.TungstenSteel, 1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 1L), 'C', "circuitGood", + 'B', ItemList.IC2_AdvBattery.get(1L) }); - GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.ROCKCUTTER_LV), RecipeLoader.BITSD, new Object[] { - "DS ", - "DP ", - "DCB", - 'D', - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), - 'S', - GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Titanium, 1L), - 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), - 'C', - "circuitBasic", - 'B', - ItemList.IC2_ReBattery.get(1L) - }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.ROCKCUTTER_LV), + RecipeLoader.BITSD, + new Object[] { "DS ", "DP ", "DCB", 'D', + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), 'S', + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Titanium, 1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), 'C', "circuitBasic", 'B', + ItemList.IC2_ReBattery.get(1L) }); - GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.ROCKCUTTER_HV), RecipeLoader.BITSD, new Object[] { - "DS ", - "DP ", - "DCB", - 'D', - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), - 'S', - GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Iridium, 1L), - 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), - 'C', - "circuitAdvanced", - 'B', - ItemList.IC2_EnergyCrystal.get(1L) - }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.ROCKCUTTER_HV), + RecipeLoader.BITSD, + new Object[] { "DS ", "DP ", "DCB", 'D', + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), 'S', + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Iridium, 1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), 'C', "circuitAdvanced", 'B', + ItemList.IC2_EnergyCrystal.get(1L) }); - if (ConfigHandler.teslastaff) - GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.TESLASTAFF), RecipeLoader.BITSD, new Object[] { - "BO ", - "OP ", - " P", - 'O', - GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Superconductor, 1L), - 'B', - ItemList.Energy_LapotronicOrb.get(1L), - 'P', - "plateAlloyIridium", - }); + if (ConfigHandler.teslastaff) GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.TESLASTAFF), + RecipeLoader.BITSD, + new Object[] { "BO ", "OP ", " P", 'O', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Superconductor, 1L), 'B', + ItemList.Energy_LapotronicOrb.get(1L), 'P', "plateAlloyIridium", }); Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null ? FluidRegistry.getFluid("molten.indalloy140") @@ -263,72 +200,44 @@ public class RecipeLoader { GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.PUMPPARTS, 1, 0), // tube GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] {" fG", " G ", "G ", 'G', ItemList.Circuit_Parts_Glass_Tube.get(1L)}); + new Object[] { " fG", " G ", "G ", 'G', ItemList.Circuit_Parts_Glass_Tube.get(1L) }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), // motor GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { - "GLP", - "LSd", - "PfT", - 'G', - GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.Steel, 1L), - 'L', - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Steel, 1L), - 'S', - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 1L), - 'P', - new ItemStack(Blocks.piston), - 'T', - new ItemStack(ItemRegistry.PUMPPARTS, 1, 0) - }); + new Object[] { "GLP", "LSd", "PfT", 'G', + GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.Steel, 1L), 'L', + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Steel, 1L), 'S', + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 1L), 'P', + new ItemStack(Blocks.piston), 'T', new ItemStack(ItemRegistry.PUMPPARTS, 1, 0) }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.PUMPBLOCK, 1, 0), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { - "IPI", - "PMP", - "ISI", - 'I', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), - 'P', - GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Wood, 1L), - 'M', - new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), - 'S', - Ic2Items.ironFurnace - }); + new ItemStack(ItemRegistry.PUMPBLOCK, 1, 0), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "IPI", "PMP", "ISI", 'I', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Wood, 1L), 'M', + new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), 'S', Ic2Items.ironFurnace }); - if (!ConfigHandler.hardmode) - GT_ModHandler.addCraftingRecipe(ItemRegistry.dehp, RecipeLoader.BITSD, new Object[] { - "GPG", - "NCN", - "GPG", - 'G', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 1L), - 'P', + if (!ConfigHandler.hardmode) GT_ModHandler.addCraftingRecipe( + ItemRegistry.dehp, + RecipeLoader.BITSD, + new Object[] { "GPG", "NCN", "GPG", 'G', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 1L), 'P', + ItemList.Pump_IV.get(1L), 'N', + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 1L), 'C', + ItemList.MACHINE_HULLS[5], }); + else GT_Values.RA.addAssemblylineRecipe( ItemList.Pump_IV.get(1L), - 'N', - GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 1L), - 'C', - ItemList.MACHINE_HULLS[5], - }); - else - GT_Values.RA.addAssemblylineRecipe( - ItemList.Pump_IV.get(1L), - 72000, - new ItemStack[] { - ItemList.Pump_IV.get(16), + 72000, + new ItemStack[] { ItemList.Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 32L), GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), - ItemList.Field_Generator_LuV.get(8) - }, - new FluidStack[] { - new FluidStack(solderIndalloy, 32 * 144), - Materials.Polytetrafluoroethylene.getMolten(32 * 144) - }, - ItemRegistry.dehp, - 5000, - BW_Util.getMachineVoltageFromTier(6)); + ItemList.Field_Generator_LuV.get(8) }, + new FluidStack[] { new FluidStack(solderIndalloy, 32 * 144), + Materials.Polytetrafluoroethylene.getMolten(32 * 144) }, + ItemRegistry.dehp, + 5000, + BW_Util.getMachineVoltageFromTier(6)); GT_Values.RA.addAssemblerRecipe( GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1000), @@ -378,8 +287,7 @@ public class RecipeLoader { new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), 800, BW_Util.getMachineVoltageFromTier(4)); - FluidStack LuVMaterialFluid = ConfigHandler.newStuff - ? WerkstoffLoader.LuVTierMaterial.getMolten(1152) + FluidStack LuVMaterialFluid = ConfigHandler.newStuff ? WerkstoffLoader.LuVTierMaterial.getMolten(1152) : Materials.Chrome.getMolten(1152); GT_Values.RA.addFluidSolidifierRecipe( new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), @@ -483,13 +391,13 @@ public class RecipeLoader { // and reverse recipes... cause im nice :P GT_Values.RA.addPulveriserRecipe( new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), - new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.Titanium.getDust(8)}, + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Titanium.getDust(8) }, null, 800, BW_Util.getMachineVoltageFromTier(4)); GT_Values.RA.addPulveriserRecipe( new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), - new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.TungstenSteel.getDust(8)}, + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.TungstenSteel.getDust(8) }, null, 800, BW_Util.getMachineVoltageFromTier(5)); @@ -498,43 +406,43 @@ public class RecipeLoader { : Materials.Chrome.getDust(8); GT_Values.RA.addPulveriserRecipe( new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), - new ItemStack[] {Materials.BorosilicateGlass.getDust(9), LuVMaterialDust}, + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), LuVMaterialDust }, null, 800, BW_Util.getMachineVoltageFromTier(6)); GT_Values.RA.addPulveriserRecipe( new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), - new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.Iridium.getDust(8)}, + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Iridium.getDust(8) }, null, 800, BW_Util.getMachineVoltageFromTier(7)); GT_Values.RA.addPulveriserRecipe( new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), - new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.Osmium.getDust(8)}, + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Osmium.getDust(8) }, null, 800, BW_Util.getMachineVoltageFromTier(8)); GT_Values.RA.addPulveriserRecipe( new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), - new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.Neutronium.getDust(8)}, + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Neutronium.getDust(8) }, null, 800, BW_Util.getMachineVoltageFromTier(9)); GT_Values.RA.addPulveriserRecipe( new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), - new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.CosmicNeutronium.getDust(8)}, + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.CosmicNeutronium.getDust(8) }, null, 800, BW_Util.getMachineVoltageFromTier(10)); GT_Values.RA.addPulveriserRecipe( new ItemStack(ItemRegistry.bw_glasses[0], 1, 15), - new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.Infinity.getDust(8)}, + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Infinity.getDust(8) }, null, 800, BW_Util.getMachineVoltageFromTier(11)); GT_Values.RA.addPulveriserRecipe( new ItemStack(ItemRegistry.bw_glasses[1], 1, 0), - new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.TranscendentMetal.getDust(8)}, + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.TranscendentMetal.getDust(8) }, null, 800, BW_Util.getMachineVoltageFromTier(12)); @@ -542,7 +450,7 @@ public class RecipeLoader { for (int i = 6; i < 11; i++) { GT_Values.RA.addPulveriserRecipe( new ItemStack(ItemRegistry.bw_glasses[0], 1, i), - new ItemStack[] {Materials.BorosilicateGlass.getDust(9)}, + new ItemStack[] { Materials.BorosilicateGlass.getDust(9) }, null, 400, BW_Util.getMachineVoltageFromTier(1)); @@ -558,84 +466,59 @@ public class RecipeLoader { } GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.WINDMETER), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { - "SWF", - "Sf ", - "Ss ", - 'S', - "stickWood", - 'W', - new ItemStack(Blocks.wool, 1, Short.MAX_VALUE), - 'F', - new ItemStack(Items.string), - }); + new ItemStack(ItemRegistry.WINDMETER), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "SWF", "Sf ", "Ss ", 'S', "stickWood", 'W', + new ItemStack(Blocks.wool, 1, Short.MAX_VALUE), 'F', new ItemStack(Items.string), }); Materials[] cables = { // Cable material used in the acid gen, diode and energy distributor below - Materials.Lead, // ULV - Materials.Tin, // LV - Materials.AnnealedCopper, // MV - Materials.Gold, // HV - Materials.Aluminium, // EV - Materials.Tungsten, // IV - Materials.VanadiumGallium, // LuV - Materials.Naquadah, // ZPM - Materials.NaquadahAlloy, // UV - Materials.SuperconductorUV // UHV + Materials.Lead, // ULV + Materials.Tin, // LV + Materials.AnnealedCopper, // MV + Materials.Gold, // HV + Materials.Aluminium, // EV + Materials.Tungsten, // IV + Materials.VanadiumGallium, // LuV + Materials.Naquadah, // ZPM + Materials.NaquadahAlloy, // UV + Materials.SuperconductorUV // UHV }; ISubTagContainer[] hulls = { // Plate material used in the acid gen, diode and energy distributor below - Materials.WroughtIron, // ULV - Materials.Steel, // LV - Materials.Aluminium, // MV - Materials.StainlessSteel, // HV - Materials.Titanium, // EV - Materials.TungstenSteel, // IV - WerkstoffLoader.LuVTierMaterial, // LuV - Materials.Iridium, // ZPM - Materials.Osmium, // UV - Materials.Naquadah // UHV + Materials.WroughtIron, // ULV + Materials.Steel, // LV + Materials.Aluminium, // MV + Materials.StainlessSteel, // HV + Materials.Titanium, // EV + Materials.TungstenSteel, // IV + WerkstoffLoader.LuVTierMaterial, // LuV + Materials.Iridium, // ZPM + Materials.Osmium, // UV + Materials.Naquadah // UHV }; - ItemStack[] bats = { - ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_Hull_MV.get(1L), ItemList.Battery_Hull_HV.get(1L) - }; - ItemStack[] chreac = { - ItemList.Machine_MV_ChemicalReactor.get(1L), - ItemList.Machine_HV_ChemicalReactor.get(1L), - ItemList.Machine_EV_ChemicalReactor.get(1L) - }; + ItemStack[] bats = { ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_Hull_MV.get(1L), + ItemList.Battery_Hull_HV.get(1L) }; + ItemStack[] chreac = { ItemList.Machine_MV_ChemicalReactor.get(1L), + ItemList.Machine_HV_ChemicalReactor.get(1L), ItemList.Machine_EV_ChemicalReactor.get(1L) }; for (int i = 0; i < 3; i++) { Materials cable = cables[i + 2]; ItemStack machinehull = ItemList.MACHINE_HULLS[i + 2].get(1L); - GT_ModHandler.addCraftingRecipe(ItemRegistry.acidGens[i], RecipeLoader.BITSD, new Object[] { - "HRH", - "HCH", - "HKH", - 'H', - bats[i], - 'K', - GT_OreDictUnificator.get(OrePrefixes.cableGt01, cable, 1L), - 'C', - machinehull, - 'R', - chreac[i] - }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.acidGens[i], + RecipeLoader.BITSD, + new Object[] { "HRH", "HCH", "HKH", 'H', bats[i], 'K', + GT_OreDictUnificator.get(OrePrefixes.cableGt01, cable, 1L), 'C', machinehull, 'R', + chreac[i] }); } - GT_ModHandler.addCraftingRecipe(ItemRegistry.acidGensLV, RecipeLoader.BITSD, new Object[] { - "HRH", - "KCK", - "HKH", - 'H', - ItemList.Battery_Hull_LV.get(1L), - 'K', - GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 1L), - 'C', - ItemList.Hull_LV.get(1L), - 'R', - ItemList.Machine_LV_ChemicalReactor.get(1L), - }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.acidGensLV, + RecipeLoader.BITSD, + new Object[] { "HRH", "KCK", "HKH", 'H', ItemList.Battery_Hull_LV.get(1L), 'K', + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 1L), 'C', + ItemList.Hull_LV.get(1L), 'R', ItemList.Machine_LV_ChemicalReactor.get(1L), }); for (int i = 0; i < 9; i++) { try { @@ -646,151 +529,81 @@ public class RecipeLoader { ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); GT_ModHandler.addCraftingRecipe( - ItemRegistry.energyDistributor[i], RecipeLoader.BITSD, new Object[] { - "PWP", - "WCW", - "PWP", - 'W', - GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), - 'P', - hull, - 'C', - machinehull - }); - GT_ModHandler.addCraftingRecipe(ItemRegistry.diode12A[i], RecipeLoader.BITSD, new Object[] { - "WDW", - "DCD", - "PDP", - 'D', - ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), - 'P', - hull, - 'C', - machinehull - }); - GT_ModHandler.addCraftingRecipe(ItemRegistry.diode12A[i], RecipeLoader.BITSD, new Object[] { - "WDW", - "DCD", - "PDP", - 'D', - ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), - 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), - 'P', - hull, - 'C', - machinehull - }); - GT_ModHandler.addCraftingRecipe(ItemRegistry.diode8A[i], RecipeLoader.BITSD, new Object[] { - "WDW", - "DCD", - "PDP", - 'D', - ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), - 'P', - hull, - 'C', - machinehull - }); - GT_ModHandler.addCraftingRecipe(ItemRegistry.diode8A[i], RecipeLoader.BITSD, new Object[] { - "WDW", - "DCD", - "PDP", - 'D', - ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), - 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), - 'P', - hull, - 'C', - machinehull - }); - GT_ModHandler.addCraftingRecipe(ItemRegistry.diode4A[i], RecipeLoader.BITSD, new Object[] { - "WDW", - "DCD", - "PDP", - 'D', - ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), - 'P', - hull, - 'C', - machinehull - }); - GT_ModHandler.addCraftingRecipe(ItemRegistry.diode4A[i], RecipeLoader.BITSD, new Object[] { - "WDW", - "DCD", - "PDP", - 'D', - ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), - 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), - 'P', - hull, - 'C', - machinehull - }); - GT_ModHandler.addCraftingRecipe(ItemRegistry.diode2A[i], RecipeLoader.BITSD, new Object[] { - "WDW", - "DCD", - "PDP", - 'D', - ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), - 'P', - hull, - 'C', - machinehull - }); - GT_ModHandler.addCraftingRecipe(ItemRegistry.diode2A[i], RecipeLoader.BITSD, new Object[] { - "WDW", - "DCD", - "PDP", - 'D', - ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), - 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), - 'P', - hull, - 'C', - machinehull - }); - GT_ModHandler.addCraftingRecipe(ItemRegistry.diode16A[i], RecipeLoader.BITSD, new Object[] { - "WHW", - "DCD", - "PDP", - 'H', - ItemList.Circuit_Parts_Coil.get(1L), - 'D', - ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', - GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), - 'P', - hull, - 'C', - machinehull - }); - GT_ModHandler.addCraftingRecipe(ItemRegistry.diode16A[i], RecipeLoader.BITSD, new Object[] { - "WHW", - "DCD", - "PDP", - 'H', - ItemList.Circuit_Parts_Coil.get(1L), - 'D', - ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), - 'W', - GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), - 'P', - hull, - 'C', - machinehull - }); + ItemRegistry.energyDistributor[i], + RecipeLoader.BITSD, + new Object[] { "PWP", "WCW", "PWP", 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode12A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode12A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode8A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode8A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode4A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode4A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode2A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode2A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode16A[i], + RecipeLoader.BITSD, + new Object[] { "WHW", "DCD", "PDP", 'H', ItemList.Circuit_Parts_Coil.get(1L), 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode16A[i], + RecipeLoader.BITSD, + new Object[] { "WHW", "DCD", "PDP", 'H', ItemList.Circuit_Parts_Coil.get(1L), 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), 'P', hull, 'C', + machinehull }); } catch (ArrayIndexOutOfBoundsException e) { // e.printStackTrace(); @@ -798,43 +611,32 @@ public class RecipeLoader { } GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), - GT_Utility.getIntegratedCircuit(17) - }, + new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), + GT_Utility.getIntegratedCircuit(17) }, Materials.Plastic.getMolten(1152L), new ItemStack(ItemRegistry.BW_BLOCKS[2], 1, 1), 20, BW_Util.getMachineVoltageFromTier(3)); GT_ModHandler.addCraftingRecipe( - /*Loader.isModLoaded("tectech") ? new TT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "bw.manualtrafo", StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L) :*/ new GT_TileEntity_ManualTrafo( - ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, - "bw.manualtrafo", - StatCollector.translateToLocal("tile.manutrafo.name")) - .getStackForm(1L), + /* + * Loader.isModLoaded("tectech") ? new TT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + + * GT_Values.VN.length * 6 + 1, "bw.manualtrafo", + * StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L) : + */ new GT_TileEntity_ManualTrafo( + ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, + "bw.manualtrafo", + StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L), RecipeLoader.BITSD, - new Object[] { - "SCS", - "CHC", - "ZCZ", - 'S', - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L), - 'C', - new ItemStack(ItemRegistry.BW_BLOCKS[2]), - 'H', - ItemList.Hull_HV.get(1L), - 'Z', - "circuitAdvanced" - }); + new Object[] { "SCS", "CHC", "ZCZ", 'S', + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L), 'C', + new ItemStack(ItemRegistry.BW_BLOCKS[2]), 'H', ItemList.Hull_HV.get(1L), 'Z', + "circuitAdvanced" }); GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), - Materials.Aluminium.getPlates(1), - ItemList.Circuit_Board_Plastic.get(1L), - ItemList.Battery_RE_LV_Lithium.get(1L) - }, + new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), + Materials.Aluminium.getPlates(1), ItemList.Circuit_Board_Plastic.get(1L), + ItemList.Battery_RE_LV_Lithium.get(1L) }, Materials.SolderingAlloy.getMolten(288L), new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER), 600, @@ -842,304 +644,156 @@ public class RecipeLoader { GT_ModHandler.addCraftingRecipe( new GT_TileEntity_Windmill( - ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 2, - "bw.windmill", - StatCollector.translateToLocal("tile.bw.windmill.name")) - .getStackForm(1L), + ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 2, + "bw.windmill", + StatCollector.translateToLocal("tile.bw.windmill.name")).getStackForm(1L), RecipeLoader.BITSD, - new Object[] { - "BHB", - "WGW", - "BWB", - 'B', - new ItemStack(Blocks.brick_block), - 'W', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - 'H', - new ItemStack(Blocks.hopper), - 'G', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), - }); + new Object[] { "BHB", "WGW", "BWB", 'B', new ItemStack(Blocks.brick_block), 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), 'H', + new ItemStack(Blocks.hopper), 'G', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), }); - String[] stones = {"stone", "stoneSmooth"}; - String[] granites = {"blockGranite", "stoneGranite", "Granite", "granite"}; + String[] stones = { "stone", "stoneSmooth" }; + String[] granites = { "blockGranite", "stoneGranite", "Granite", "granite" }; for (String granite : granites) { for (String stone : stones) { GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { - "SSS", - "DfD", - " h ", - 'S', - stone, - 'D', - new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), - }); + new Object[] { "SSS", "DfD", " h ", 'S', stone, 'D', + new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { - "hDf", - "SSS", - 'S', - stone, - 'D', - new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), - }); + new Object[] { "hDf", "SSS", 'S', stone, 'D', + new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { - "SSS", "DfD", " h ", 'S', stone, 'D', granite, - }); + new Object[] { "SSS", "DfD", " h ", 'S', stone, 'D', granite, }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { - "hDf", "SSS", 'S', stone, 'D', granite, - }); + new Object[] { "hDf", "SSS", 'S', stone, 'D', granite, }); } GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { - "STS", - "h f", - "SBS", - 'S', - granite, - 'T', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), - 'B', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), - }); + new Object[] { "STS", "h f", "SBS", 'S', granite, 'T', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), 'B', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), }); } GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { - "STS", - "h f", - "SBS", - 'S', - new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), - 'T', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), - 'B', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), - }); + new Object[] { "STS", "h f", "SBS", 'S', + new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), 'T', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), 'B', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { - "WLs", "WLh", "WLf", 'L', new ItemStack(Items.leather), 'W', "logWood", - }); + new Object[] { "WLs", "WLh", "WLf", 'L', new ItemStack(Items.leather), 'W', "logWood", }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { - "WLs", "WLh", "WLf", 'L', new ItemStack(Blocks.carpet), 'W', "logWood", - }); + new Object[] { "WLs", "WLh", "WLf", 'L', new ItemStack(Blocks.carpet), 'W', "logWood", }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { - "WLs", "WLh", "WLf", 'L', new ItemStack(Items.paper), 'W', "logWood", - }); + new Object[] { "WLs", "WLh", "WLf", 'L', new ItemStack(Items.paper), 'W', "logWood", }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { - "WEs", - "WZh", - "WDf", - 'E', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'Z', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'D', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', - "logWood", - }); + new Object[] { "WEs", "WZh", "WDf", 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { - "WEs", - "WZh", - "WDf", - 'Z', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'E', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'D', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', - "logWood", - }); + new Object[] { "WEs", "WZh", "WDf", 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'E', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { - "WEs", - "WZh", - "WDf", - 'D', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'Z', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'E', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', - "logWood", - }); + new Object[] { "WEs", "WZh", "WDf", 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'E', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { - "WEs", - "WZh", - "WDf", - 'E', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'D', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'Z', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', - "logWood", - }); + new Object[] { "WEs", "WZh", "WDf", 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { - "WEs", - "WZh", - "WDf", - 'Z', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'D', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'E', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', - "logWood", - }); + new Object[] { "WEs", "WZh", "WDf", 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'E', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.LEATHER_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { - "hPf", - "PWP", - "sPr", - 'P', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'W', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - }); + new ItemStack(ItemRegistry.LEATHER_ROTOR), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.WOOL_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { - "hPf", - "PWP", - "sPr", - 'P', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'W', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - }); + new ItemStack(ItemRegistry.WOOL_ROTOR), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.PAPER_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { - "hPf", - "PWP", - "sPr", - 'P', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - }); + new ItemStack(ItemRegistry.PAPER_ROTOR), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.COMBINED_ROTOR), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.COMBINED_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { - "hPf", - "PWP", - "sPr", - 'P', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), - 'W', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - }); - GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.ROTORBLOCK), RecipeLoader.BITSD, new Object[] { - "WRW", - "RGR", - "WRW", - 'R', - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Iron, 1L), - 'W', - "plankWood", - 'G', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - }); + new ItemStack(ItemRegistry.ROTORBLOCK), + RecipeLoader.BITSD, + new Object[] { "WRW", "RGR", "WRW", 'R', + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Iron, 1L), 'W', "plankWood", 'G', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); GT_TileEntity_THTR.THTRMaterials.registerTHR_Recipes(); - GT_ModHandler.addCraftingRecipe(ItemRegistry.THTR, RecipeLoader.BITSD, new Object[] { - "BZB", - "BRB", - "BZB", - 'B', - new ItemStack(GregTech_API.sBlockCasings3, 1, 12), - 'R', - GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), - 'Z', - "circuitUltimate" - }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.THTR, + RecipeLoader.BITSD, + new Object[] { "BZB", "BRB", "BZB", 'B', new ItemStack(GregTech_API.sBlockCasings3, 1, 12), 'R', + GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), 'Z', "circuitUltimate" }); GT_TileEntity_HTGR.HTGRMaterials.registerTHR_Recipes(); - GT_ModHandler.addCraftingRecipe(ItemRegistry.HTGR, RecipeLoader.BITSD, new Object[] { - "BZB", - "BRB", - "BZB", - 'B', - new ItemStack(GregTech_API.sBlockCasings8, 1, 5), - 'R', - GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), - 'Z', - "circuitSuperconductor" - }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.HTGR, + RecipeLoader.BITSD, + new Object[] { "BZB", "BRB", "BZB", 'B', new ItemStack(GregTech_API.sBlockCasings8, 1, 5), 'R', + GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), 'Z', "circuitSuperconductor" }); - GT_ModHandler.addCraftingRecipe(ItemRegistry.EIG, RecipeLoader.BITSD, new Object[] { - "AZA", - "BRB", - "AZA", - 'B', - new ItemStack(GregTech_API.sBlockCasings4, 1, 1), - 'R', - GT_ModHandler.getModItem("EnderIO", "blockFarmStation", 1), - 'A', - new ItemStack(GregTech_API.sBlockMachines, 1, 11104), - 'Z', - "circuitUltimate" - }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.EIG, + RecipeLoader.BITSD, + new Object[] { "AZA", "BRB", "AZA", 'B', new ItemStack(GregTech_API.sBlockCasings4, 1, 1), 'R', + GT_ModHandler.getModItem("EnderIO", "blockFarmStation", 1), 'A', + new ItemStack(GregTech_API.sBlockMachines, 1, 11104), 'Z', "circuitUltimate" }); if (LoaderReference.galacticgreg) { GT_Values.RA.addAssemblylineRecipe( ItemList.OreDrill4.get(1L), BW_Util.getMachineVoltageFromTier(6), - new Object[] { - ItemList.OreDrill4.get(1L), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Europium, 9L), - Materials.Europium.getPlates(3), - ItemList.Electric_Motor_LuV.get(9L), - ItemList.Sensor_LuV.get(9L), - ItemList.Field_Generator_LuV.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 36L) - }, - new FluidStack[] { - new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Neon.getFluidOrGas(20000), - }, + new Object[] { ItemList.OreDrill4.get(1L), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Europium, 9L), + Materials.Europium.getPlates(3), ItemList.Electric_Motor_LuV.get(9L), + ItemList.Sensor_LuV.get(9L), ItemList.Field_Generator_LuV.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 36L) }, + new FluidStack[] { new FluidStack(solderIndalloy, 1440), + WerkstoffLoader.Neon.getFluidOrGas(20000), }, ItemRegistry.voidminer[0].copy(), 108000, BW_Util.getMachineVoltageFromTier(6)); @@ -1150,18 +804,13 @@ public class RecipeLoader { GT_Values.RA.addAssemblylineRecipe( ItemRegistry.voidminer[0].copy(), BW_Util.getMachineVoltageFromTier(7), - new Object[] { - ItemRegistry.voidminer[0].copy(), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), - Materials.BlackPlutonium.getPlates(3), - ItemList.Electric_Motor_ZPM.get(9L), - ItemList.Sensor_ZPM.get(9L), - ItemList.Field_Generator_ZPM.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) - }, - new FluidStack[] { - new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Krypton.getFluidOrGas(20000) - }, + new Object[] { ItemRegistry.voidminer[0].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), + Materials.BlackPlutonium.getPlates(3), ItemList.Electric_Motor_ZPM.get(9L), + ItemList.Sensor_ZPM.get(9L), ItemList.Field_Generator_ZPM.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) }, + new FluidStack[] { new FluidStack(solderIndalloy, 1440), + WerkstoffLoader.Krypton.getFluidOrGas(20000) }, ItemRegistry.voidminer[1].copy(), 216000, BW_Util.getMachineVoltageFromTier(7)); @@ -1169,18 +818,13 @@ public class RecipeLoader { GT_Values.RA.addAssemblylineRecipe( ItemRegistry.voidminer[1].copy(), BW_Util.getMachineVoltageFromTier(8), - new Object[] { - ItemRegistry.voidminer[1].copy(), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), - Materials.Neutronium.getPlates(3), - ItemList.Electric_Motor_UV.get(9L), - ItemList.Sensor_UV.get(9L), - ItemList.Field_Generator_UV.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) - }, - new FluidStack[] { - new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Oganesson.getFluidOrGas(20000) - }, + new Object[] { ItemRegistry.voidminer[1].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), + Materials.Neutronium.getPlates(3), ItemList.Electric_Motor_UV.get(9L), + ItemList.Sensor_UV.get(9L), ItemList.Field_Generator_UV.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) }, + new FluidStack[] { new FluidStack(solderIndalloy, 1440), + WerkstoffLoader.Oganesson.getFluidOrGas(20000) }, ItemRegistry.voidminer[2].copy(), 432000, BW_Util.getMachineVoltageFromTier(8)); @@ -1188,19 +832,14 @@ public class RecipeLoader { GT_Values.RA.addAssemblylineRecipe( ItemList.Machine_Multi_ImplosionCompressor.get(1L), 24000, - new ItemStack[] { - ItemList.Machine_Multi_ImplosionCompressor.get(1L), - Materials.Neutronium.getBlocks(5), - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64), - ItemList.Electric_Piston_UV.get(64), - }, - new FluidStack[] { - new FluidStack(solderIndalloy, 1440), - Materials.Osmium.getMolten(1440), - Materials.Neutronium.getMolten(1440) - }, + new ItemStack[] { ItemList.Machine_Multi_ImplosionCompressor.get(1L), + Materials.Neutronium.getBlocks(5), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64), + ItemList.Electric_Piston_UV.get(64), }, + new FluidStack[] { new FluidStack(solderIndalloy, 1440), Materials.Osmium.getMolten(1440), + Materials.Neutronium.getMolten(1440) }, ItemRegistry.eic.copy(), 240000, BW_Util.getMachineVoltageFromTier(8)); @@ -1209,28 +848,24 @@ public class RecipeLoader { ItemStack[][] input = ItemRegistry.TecTechLaserAdditions[1]; ItemStack[][] dynamo = ItemRegistry.TecTechLaserAdditions[2]; - ItemList[] emitters = { - ItemList.Emitter_EV, ItemList.Emitter_IV, ItemList.Emitter_LuV, ItemList.Emitter_ZPM - }; + ItemList[] emitters = { ItemList.Emitter_EV, ItemList.Emitter_IV, ItemList.Emitter_LuV, + ItemList.Emitter_ZPM }; - ItemList[] sensors = {ItemList.Sensor_EV, ItemList.Sensor_IV, ItemList.Sensor_LuV, ItemList.Sensor_ZPM}; + ItemList[] sensors = { ItemList.Sensor_EV, ItemList.Sensor_IV, ItemList.Sensor_LuV, + ItemList.Sensor_ZPM }; - OrePrefixes[] prefixes = { - WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt04 : OrePrefixes.wireGt04, - WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt08 : OrePrefixes.wireGt08, - WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt12 : OrePrefixes.wireGt12, - WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt16 : OrePrefixes.cableGt12 - }; + OrePrefixes[] prefixes = { WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt04 : OrePrefixes.wireGt04, + WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt08 : OrePrefixes.wireGt08, + WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt12 : OrePrefixes.wireGt12, + WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt16 : OrePrefixes.cableGt12 }; GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - ItemList.Circuit_Parts_GlassFiber.get(32), - GT_OreDictUnificator.get( - WerkstoffLoader.gtnhGT ? OrePrefixes.foil : OrePrefixes.plateDouble, - Materials.Electrum, - WerkstoffLoader.gtnhGT ? 8 : 1), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2) - }, + new ItemStack[] { ItemList.Circuit_Parts_GlassFiber.get(32), + GT_OreDictUnificator.get( + WerkstoffLoader.gtnhGT ? OrePrefixes.foil : OrePrefixes.plateDouble, + Materials.Electrum, + WerkstoffLoader.gtnhGT ? 8 : 1), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2) }, Materials.Polytetrafluoroethylene.getMolten(72), new ItemStack( ItemRegistry.TecTechPipeEnergyLowPower.getItem(), @@ -1248,46 +883,41 @@ public class RecipeLoader { int solderingAmount = Math.max(144 * i, 72) * (j + 1); GT_Values.RA.addAssemblerRecipe( new ItemStack[] { - new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - ((j + 1) * 16), - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), - emitters[i].get(2 * (j + 1)), - sensors[i].get(2 * (j + 1)), - ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1)), - }, + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + ((j + 1) * 16), + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + emitters[i].get(2 * (j + 1)), sensors[i].get(2 * (j + 1)), + ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1)), }, Materials.SolderingAlloy.getMolten(solderingAmount), converter, 200 * (j + 1), BW_Util.getMachineVoltageFromTier(4 + i)); GT_Values.RA.addAssemblerRecipe( new ItemStack[] { - new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - ((j + 1) * 16), - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), - sensors[i].get(2 * (j + 1)), - ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1)), - }, + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + ((j + 1) * 16), + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + sensors[i].get(2 * (j + 1)), ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1)), }, Materials.SolderingAlloy.getMolten(solderingAmount), eInput, 200 * (j + 1), BW_Util.getMachineVoltageFromTier(4 + i)); GT_Values.RA.addAssemblerRecipe( new ItemStack[] { - new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - ((j + 1) * 16), - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), - emitters[i].get(2 * (j + 1)), - ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1)), - }, + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + ((j + 1) * 16), + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + emitters[i].get(2 * (j + 1)), + ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1)), }, Materials.SolderingAlloy.getMolten(solderingAmount), eDynamo, 200 * (j + 1), @@ -1296,46 +926,39 @@ public class RecipeLoader { } } - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[] { - ItemList.Hatch_Input_HV.get(64), - Materials.LiquidAir.getCells(1), - GT_Utility.getIntegratedCircuit(17) - }, - new ItemStack[] {ItemRegistry.compressedHatch.copy()}, - null, - null, - null, - null, - 300, - BW_Util.getMachineVoltageFromTier(3), - 0)); - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[] {ItemList.Hatch_Output_HV.get(64), GT_Utility.getIntegratedCircuit(17)}, - new ItemStack[] {ItemRegistry.giantOutputHatch.copy()}, - null, - null, - null, - null, - 300, - BW_Util.getMachineVoltageFromTier(3), - 0)); + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add( + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { ItemList.Hatch_Input_HV.get(64), Materials.LiquidAir.getCells(1), + GT_Utility.getIntegratedCircuit(17) }, + new ItemStack[] { ItemRegistry.compressedHatch.copy() }, + null, + null, + null, + null, + 300, + BW_Util.getMachineVoltageFromTier(3), + 0)); + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add( + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { ItemList.Hatch_Output_HV.get(64), GT_Utility.getIntegratedCircuit(17) }, + new ItemStack[] { ItemRegistry.giantOutputHatch.copy() }, + null, + null, + null, + null, + 300, + BW_Util.getMachineVoltageFromTier(3), + 0)); GT_Values.RA.addAssemblylineRecipe( ItemList.Machine_LuV_CircuitAssembler.get(1L), 24000, - new ItemStack[] { - ItemList.Machine_LuV_CircuitAssembler.get(1L), - ItemList.Robot_Arm_LuV.get(4L), - ItemList.Electric_Motor_LuV.get(4L), - ItemList.Field_Generator_LuV.get(1L), - ItemList.Emitter_LuV.get(1L), - ItemList.Sensor_LuV.get(1L), - Materials.Chrome.getPlates(8) - }, - new FluidStack[] {new FluidStack(solderIndalloy, 1440)}, + new ItemStack[] { ItemList.Machine_LuV_CircuitAssembler.get(1L), ItemList.Robot_Arm_LuV.get(4L), + ItemList.Electric_Motor_LuV.get(4L), ItemList.Field_Generator_LuV.get(1L), + ItemList.Emitter_LuV.get(1L), ItemList.Sensor_LuV.get(1L), Materials.Chrome.getPlates(8) }, + new FluidStack[] { new FluidStack(solderIndalloy, 1440) }, ItemRegistry.cal.copy(), 24000, BW_Util.getMachineVoltageFromTier(6)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java index 26f268f0ef..3f150f46f5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.loaders; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 146cf36eac..8ffe956261 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.loaders; @@ -26,6 +17,19 @@ import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_T import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; import static gregtech.api.enums.GT_Values.VN; +import java.lang.reflect.Field; +import java.util.*; +import java.util.stream.Collectors; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + +import org.apache.commons.lang3.StringUtils; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -37,6 +41,7 @@ import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.google.common.collect.ArrayListMultimap; import com.gtnewhorizons.modularui.common.widget.ProgressBar; + import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; import gnu.trove.map.hash.TObjectDoubleHashMap; @@ -48,24 +53,15 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; -import java.lang.reflect.Field; -import java.util.*; -import java.util.stream.Collectors; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; -import org.apache.commons.lang3.StringUtils; public class StaticRecipeChangeLoaders { private static TObjectDoubleHashMap gtEbfGasRecipeTimeMultipliers = null; private static TObjectDoubleHashMap gtEbfGasRecipeConsumptionMultipliers = null; - public static final List whitelistForEBFNoGasRecipeDontCheckItemData = Arrays.asList( - GT_ModHandler.getModItem("TConstruct", "materials", 1L, 12) // Raw Aluminum -> Aluminium Ingot (coremod) + public static final List whitelistForEBFNoGasRecipeDontCheckItemData = Arrays + .asList(GT_ModHandler.getModItem("TConstruct", "materials", 1L, 12) // Raw Aluminum -> Aluminium Ingot + // (coremod) ); private StaticRecipeChangeLoaders() {} @@ -79,8 +75,8 @@ public class StaticRecipeChangeLoaders { } if (gtEbfGasRecipeConsumptionMultipliers == null) { // For Werkstoff gases, use Werkstoff.Stats.setEbfGasRecipeConsumedAmountMultiplier - gtEbfGasRecipeConsumptionMultipliers = - new TObjectDoubleHashMap<>(10, 0.5F, 1.0D); // keep default value as 1 + gtEbfGasRecipeConsumptionMultipliers = new TObjectDoubleHashMap<>(10, 0.5F, 1.0D); // keep default value as + // 1 // Example to make Argon recipes use half the gas amount of the primary recipe (1000L->500L, 2000L->1000L // etc.): // gtEbfGasRecipeConsumptionMultipliers.put(Materials.Argon, 1.0D / 2.0D); @@ -90,17 +86,15 @@ public class StaticRecipeChangeLoaders { } public static void fixEnergyRequirements() { - GT_Recipe.GT_Recipe_Map.sMappings.stream() - .filter(StreamUtils::filterVisualMaps) - .forEach(gt_recipe_map -> gt_recipe_map.mRecipeList.parallelStream() - .forEach(gt_recipe -> { - for (int i = 0; i < (VN.length - 1); i++) { - if (gt_recipe.mEUt > BW_Util.getMachineVoltageFromTier(i) - && gt_recipe.mEUt <= BW_Util.getTierVoltage(i)) { - gt_recipe.mEUt = BW_Util.getMachineVoltageFromTier(i); - } - } - })); + GT_Recipe.GT_Recipe_Map.sMappings.stream().filter(StreamUtils::filterVisualMaps) + .forEach(gt_recipe_map -> gt_recipe_map.mRecipeList.parallelStream().forEach(gt_recipe -> { + for (int i = 0; i < (VN.length - 1); i++) { + if (gt_recipe.mEUt > BW_Util.getMachineVoltageFromTier(i) + && gt_recipe.mEUt <= BW_Util.getTierVoltage(i)) { + gt_recipe.mEUt = BW_Util.getMachineVoltageFromTier(i); + } + } + })); } private static void replaceWrongFluidOutput(Werkstoff werkstoff, GT_Recipe recipe, FluidStack wrongNamedFluid) { @@ -111,32 +105,32 @@ public class StaticRecipeChangeLoaders { } } - private static void replaceWrongFluidInput( - Werkstoff werkstoff, GT_Recipe.GT_Recipe_Map map, GT_Recipe recipe, FluidStack wrongNamedFluid) { + private static void replaceWrongFluidInput(Werkstoff werkstoff, GT_Recipe.GT_Recipe_Map map, GT_Recipe recipe, + FluidStack wrongNamedFluid) { for (int i = 0; i < recipe.mFluidInputs.length; i++) { if (GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], wrongNamedFluid)) { Collection col = map.mRecipeFluidMap.get(wrongNamedFluid.getFluid()); map.mRecipeFluidMap.remove(wrongNamedFluid.getFluid()); map.mRecipeFluidMap.put(werkstoff.getFluidOrGas(1).getFluid(), col); recipe.mFluidInputs[i] = werkstoff.getFluidOrGas(recipe.mFluidInputs[i].amount); - map.mRecipeFluidNameMap.add( - werkstoff.getFluidOrGas(1).getFluid().getName()); + map.mRecipeFluidNameMap.add(werkstoff.getFluidOrGas(1).getFluid().getName()); } } } private static void addConversionRecipe(Werkstoff werkstoff, FluidStack wrongNamedFluid) { - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe( - false, - null, - null, - null, - null, - new FluidStack[] {wrongNamedFluid}, - new FluidStack[] {werkstoff.getFluidOrGas(1)}, - 1, - 1, - 0)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add( + new BWRecipes.DynamicGTRecipe( + false, + null, + null, + null, + null, + new FluidStack[] { wrongNamedFluid }, + new FluidStack[] { werkstoff.getFluidOrGas(1) }, + 1, + 1, + 0)); } private static FluidStack getWrongNameFluid(Werkstoff werkstoff) { @@ -167,57 +161,55 @@ public class StaticRecipeChangeLoaders { oreDictNames.add(werkstoff.getVarName()); StaticRecipeChangeLoaders.runMoltenUnificationEnfocement(werkstoff); StaticRecipeChangeLoaders.runUnficationDeleter(werkstoff); - for (String s : oreDictNames) - for (OrePrefixes prefixes : OrePrefixes.values()) { - if (!werkstoff.hasItemType(prefixes)) continue; - String fullOreName = prefixes + s; - List ores = OreDictionary.getOres(fullOreName, false); - if (ores.size() <= 1) // empty or one entry, i.e. no unification needed + for (String s : oreDictNames) for (OrePrefixes prefixes : OrePrefixes.values()) { + if (!werkstoff.hasItemType(prefixes)) continue; + String fullOreName = prefixes + s; + List ores = OreDictionary.getOres(fullOreName, false); + if (ores.size() <= 1) // empty or one entry, i.e. no unification needed continue; - for (ItemStack toReplace : ores) { - ItemStack replacement = werkstoff.get(prefixes); - if (toReplace == null - || GT_Utility.areStacksEqual(toReplace, replacement) - || replacement == null - || replacement.getItem() == null) continue; - for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - nextRecipe: - for (Iterator iterator = map.mRecipeList.iterator(); iterator.hasNext(); ) { - GT_Recipe recipe = iterator.next(); - boolean removal = map.equals(GT_Recipe_Map.sFluidExtractionRecipes) - || map.equals(GT_Recipe_Map.sFluidSolidficationRecipes); - for (int i = 0; i < recipe.mInputs.length; i++) { - if (!GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) continue; - if (removal) { - iterator.remove(); - continue nextRecipe; - } - recipe.mInputs[i] = - GT_Utility.copyAmount(recipe.mInputs[i].stackSize, replacement); + for (ItemStack toReplace : ores) { + ItemStack replacement = werkstoff.get(prefixes); + if (toReplace == null || GT_Utility.areStacksEqual(toReplace, replacement) + || replacement == null + || replacement.getItem() == null) + continue; + for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + nextRecipe: for (Iterator iterator = map.mRecipeList.iterator(); iterator + .hasNext();) { + GT_Recipe recipe = iterator.next(); + boolean removal = map.equals(GT_Recipe_Map.sFluidExtractionRecipes) + || map.equals(GT_Recipe_Map.sFluidSolidficationRecipes); + for (int i = 0; i < recipe.mInputs.length; i++) { + if (!GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) continue; + if (removal) { + iterator.remove(); + continue nextRecipe; } - for (int i = 0; i < recipe.mOutputs.length; i++) { - if (!GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) continue; - if (removal) { - iterator.remove(); - continue nextRecipe; - } - recipe.mOutputs[i] = - GT_Utility.copyAmount(recipe.mOutputs[i].stackSize, replacement); + recipe.mInputs[i] = GT_Utility.copyAmount(recipe.mInputs[i].stackSize, replacement); + } + for (int i = 0; i < recipe.mOutputs.length; i++) { + if (!GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) continue; + if (removal) { + iterator.remove(); + continue nextRecipe; } - if (recipe.mSpecialItems instanceof ItemStack) { - ItemStack specialItemStack = (ItemStack) recipe.mSpecialItems; - if (!GT_Utility.areStacksEqual(specialItemStack, toReplace)) continue; - if (removal) { - iterator.remove(); - continue nextRecipe; - } - recipe.mSpecialItems = - GT_Utility.copyAmount((specialItemStack).stackSize, replacement); + recipe.mOutputs[i] = GT_Utility + .copyAmount(recipe.mOutputs[i].stackSize, replacement); + } + if (recipe.mSpecialItems instanceof ItemStack) { + ItemStack specialItemStack = (ItemStack) recipe.mSpecialItems; + if (!GT_Utility.areStacksEqual(specialItemStack, toReplace)) continue; + if (removal) { + iterator.remove(); + continue nextRecipe; } + recipe.mSpecialItems = GT_Utility + .copyAmount((specialItemStack).stackSize, replacement); } } } } + } } } } @@ -232,12 +224,12 @@ public class StaticRecipeChangeLoaders { Materials.Empty.getCells(1)); Field f = GT_Utility.class.getDeclaredField("sFilledContainerToData"); f.setAccessible(true); - Map sFilledContainerToData = - (Map) f.get(null); + Map sFilledContainerToData = (Map) f + .get(null); HashSet torem = new HashSet<>(); ItemStack toReplace = null; - for (Map.Entry entry : - sFilledContainerToData.entrySet()) { + for (Map.Entry entry : sFilledContainerToData + .entrySet()) { final String MODID = GameRegistry.findUniqueIdentifierFor(data.filledContainer.getItem()).modId; if (MODID.equals(MainMod.MOD_ID) || MODID.equals(BartWorksCrossmod.MOD_ID)) continue; if (entry.getValue().fluid.equals(data.fluid) @@ -273,7 +265,7 @@ public class StaticRecipeChangeLoaders { if (recipe.mSpecialItems instanceof ItemStack) { if (GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) { torem.add(recipe); - // recipe.mSpecialItems = data.filledContainer; + // recipe.mSpecialItems = data.filledContainer; } } } @@ -296,14 +288,13 @@ public class StaticRecipeChangeLoaders { } } - for (OrePrefixes prefixes : OrePrefixes.values()) - if (werkstoff.hasItemType(prefixes)) { - GT_OreDictUnificator.set(prefixes, werkstoff.getBridgeMaterial(), werkstoff.get(prefixes), true, true); - for (ItemStack stack : OreDictionary.getOres(prefixes + werkstoff.getVarName())) { - GT_OreDictUnificator.addAssociation(prefixes, werkstoff.getBridgeMaterial(), stack, false); - GT_OreDictUnificator.getAssociation(stack).mUnificationTarget = werkstoff.get(prefixes); - } + for (OrePrefixes prefixes : OrePrefixes.values()) if (werkstoff.hasItemType(prefixes)) { + GT_OreDictUnificator.set(prefixes, werkstoff.getBridgeMaterial(), werkstoff.get(prefixes), true, true); + for (ItemStack stack : OreDictionary.getOres(prefixes + werkstoff.getVarName())) { + GT_OreDictUnificator.addAssociation(prefixes, werkstoff.getBridgeMaterial(), stack, false); + GT_OreDictUnificator.getAssociation(stack).mUnificationTarget = werkstoff.get(prefixes); } + } } private static void runMaterialLinker(Werkstoff werkstoff) { @@ -326,6 +317,7 @@ public class StaticRecipeChangeLoaders { /** * Constructs a list of recipes to change by scanning all EBF recipes for uses of noble gases. + * * @param GasTags list of gas tags to look out for in EBF recipes * @return A multimap from the gas tag (noble and/or anaerobic) to all the recipes containing a gas with that tag */ @@ -337,8 +329,9 @@ public class StaticRecipeChangeLoaders { if (mat != Materials._NULL) { for (SubTag tag : GasTags) { if (mat.contains(tag)) { - DebugLog.log("Found EBF Recipe to change, Output:" - + BW_Util.translateGTItemStack(recipe.mOutputs[0])); + DebugLog.log( + "Found EBF Recipe to change, Output:" + + BW_Util.translateGTItemStack(recipe.mOutputs[0])); toAdd.put(tag, recipe); } } @@ -349,8 +342,8 @@ public class StaticRecipeChangeLoaders { } /** - * Scans EBF recipes for no-gas variants of the recipes present in base. - * Adds these recipes to the base multimap. + * Scans EBF recipes for no-gas variants of the recipes present in base. Adds these recipes to the base multimap. + * * @param base The recipe multimap to scan and modify * @return Set of item outputs (recipe.mOutputs[0]) of the no-gas recipes */ @@ -358,33 +351,27 @@ public class StaticRecipeChangeLoaders { HashSet toAdd = new HashSet<>(); ArrayListMultimap repToAdd = ArrayListMultimap.create(); for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList) { - for (SubTag tag : base.keySet()) - recipeLoop: - for (GT_Recipe baseRe : base.get(tag)) { - if (recipe.mInputs.length == baseRe.mInputs.length - && recipe.mOutputs.length == baseRe.mOutputs.length) - for (int i = 0; i < recipe.mInputs.length; i++) { - ItemStack tmpInput = recipe.mInputs[i]; - if ((recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) - && (whitelistForEBFNoGasRecipeDontCheckItemData.stream() - .anyMatch(s -> GT_Utility.areStacksEqual(s, tmpInput)) - || (BW_Util.checkStackAndPrefix(recipe.mInputs[i]) - && BW_Util.checkStackAndPrefix(baseRe.mInputs[i]) - && GT_OreDictUnificator.getAssociation(recipe.mInputs[i]) - .mMaterial - .mMaterial - .equals(GT_OreDictUnificator.getAssociation( - baseRe.mInputs[i]) - .mMaterial - .mMaterial) - && GT_Utility.areStacksEqual( - recipe.mOutputs[0], baseRe.mOutputs[0])))) { - toAdd.add(recipe.mOutputs[0]); - repToAdd.put(tag, recipe); - continue recipeLoop; - } + for (SubTag tag : base.keySet()) recipeLoop: for (GT_Recipe baseRe : base.get(tag)) { + if (recipe.mInputs.length == baseRe.mInputs.length && recipe.mOutputs.length == baseRe.mOutputs.length) + for (int i = 0; i < recipe.mInputs.length; i++) { + ItemStack tmpInput = recipe.mInputs[i]; + if ((recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) + && (whitelistForEBFNoGasRecipeDontCheckItemData.stream() + .anyMatch(s -> GT_Utility.areStacksEqual(s, tmpInput)) + || (BW_Util.checkStackAndPrefix(recipe.mInputs[i]) + && BW_Util.checkStackAndPrefix(baseRe.mInputs[i]) + && GT_OreDictUnificator + .getAssociation(recipe.mInputs[i]).mMaterial.mMaterial.equals( + GT_OreDictUnificator.getAssociation( + baseRe.mInputs[i]).mMaterial.mMaterial) + && GT_Utility + .areStacksEqual(recipe.mOutputs[0], baseRe.mOutputs[0])))) { + toAdd.add(recipe.mOutputs[0]); + repToAdd.put(tag, recipe); + continue recipeLoop; } - } + } + } } base.putAll(repToAdd); return toAdd; @@ -421,91 +408,101 @@ public class StaticRecipeChangeLoaders { return transformEBFGasRecipeTime(recipe.mDuration, originalGas.getProtons(), 0); } - private static void editEBFMaterialRecipes( - SubTag GasTag, GT_Recipe recipe, Materials originalGas, HashSet toAdd) { + private static void editEBFMaterialRecipes(SubTag GasTag, GT_Recipe recipe, Materials originalGas, + HashSet toAdd) { for (Materials newGas : Materials.values()) { if (newGas.contains(GasTag)) { int time = transformEBFGasRecipeTime(recipe, originalGas, newGas); - int gasAmount = Math.max(1, (int) Math.round( - (double) recipe.mFluidInputs[0].amount * gtEbfGasRecipeConsumptionMultipliers.get(newGas))); - if (recipe.mFluidInputs != null - && recipe.mFluidInputs.length == 1 + int gasAmount = Math.max( + 1, + (int) Math.round( + (double) recipe.mFluidInputs[0].amount + * gtEbfGasRecipeConsumptionMultipliers.get(newGas))); + if (recipe.mFluidInputs != null && recipe.mFluidInputs.length == 1 && recipe.mFluidInputs[0].isFluidEqual(newGas.getGas(0))) { // preserve original recipe owner - toAdd.add(new BWRecipes.DynamicGTRecipe( - false, - recipe.mInputs, - recipe.mOutputs, - recipe.mSpecialItems, - recipe.mChances, - new FluidStack[] {newGas.getGas(gasAmount)}, - recipe.mFluidOutputs, - time, - recipe.mEUt, - recipe.mSpecialValue, - recipe)); + toAdd.add( + new BWRecipes.DynamicGTRecipe( + false, + recipe.mInputs, + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + new FluidStack[] { newGas.getGas(gasAmount) }, + recipe.mFluidOutputs, + time, + recipe.mEUt, + recipe.mSpecialValue, + recipe)); } else { // new recipe - toAdd.add(new BWRecipes.DynamicGTRecipe( - false, - recipe.mInputs, - recipe.mOutputs, - recipe.mSpecialItems, - recipe.mChances, - new FluidStack[] {newGas.getGas(gasAmount)}, - recipe.mFluidOutputs, - time, - recipe.mEUt, - recipe.mSpecialValue)); + toAdd.add( + new BWRecipes.DynamicGTRecipe( + false, + recipe.mInputs, + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + new FluidStack[] { newGas.getGas(gasAmount) }, + recipe.mFluidOutputs, + time, + recipe.mEUt, + recipe.mSpecialValue)); } } } } - private static void editEBFWerkstoffRecipes( - SubTag GasTag, GT_Recipe recipe, Materials originalGas, HashSet toAdd) { + private static void editEBFWerkstoffRecipes(SubTag GasTag, GT_Recipe recipe, Materials originalGas, + HashSet toAdd) { for (Werkstoff newGas : Werkstoff.werkstoffHashMap.values()) { if (newGas.contains(GasTag)) { int time = transformEBFGasRecipeTime(recipe, originalGas, newGas); - int gasAmount = Math.max(1, (int) Math.round((double) recipe.mFluidInputs[0].amount - * newGas.getStats().getEbfGasRecipeConsumedAmountMultiplier())); - if (recipe.mFluidInputs != null - && recipe.mFluidInputs.length == 1 - && recipe.mFluidInputs[0].isFluidEqual( - new FluidStack(Objects.requireNonNull(fluids.get(newGas)), 0))) { + int gasAmount = Math.max( + 1, + (int) Math.round( + (double) recipe.mFluidInputs[0].amount + * newGas.getStats().getEbfGasRecipeConsumedAmountMultiplier())); + if (recipe.mFluidInputs != null && recipe.mFluidInputs.length == 1 + && recipe.mFluidInputs[0] + .isFluidEqual(new FluidStack(Objects.requireNonNull(fluids.get(newGas)), 0))) { // preserve original recipe owner - toAdd.add(new BWRecipes.DynamicGTRecipe( - false, - recipe.mInputs, - recipe.mOutputs, - recipe.mSpecialItems, - recipe.mChances, - new FluidStack[] {new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount)}, - recipe.mFluidOutputs, - time, - recipe.mEUt, - recipe.mSpecialValue, - recipe)); + toAdd.add( + new BWRecipes.DynamicGTRecipe( + false, + recipe.mInputs, + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + new FluidStack[] { + new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount) }, + recipe.mFluidOutputs, + time, + recipe.mEUt, + recipe.mSpecialValue, + recipe)); } else { // new recipe - toAdd.add(new BWRecipes.DynamicGTRecipe( - false, - recipe.mInputs, - recipe.mOutputs, - recipe.mSpecialItems, - recipe.mChances, - new FluidStack[] {new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount)}, - recipe.mFluidOutputs, - time, - recipe.mEUt, - recipe.mSpecialValue)); + toAdd.add( + new BWRecipes.DynamicGTRecipe( + false, + recipe.mInputs, + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + new FluidStack[] { + new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount) }, + recipe.mFluidOutputs, + time, + recipe.mEUt, + recipe.mSpecialValue)); } } } } - private static void editEBFNoGasRecipes( - GT_Recipe recipe, Materials originalGas, HashSet toAdd, HashSet noGas) { + private static void editEBFNoGasRecipes(GT_Recipe recipe, Materials originalGas, HashSet toAdd, + HashSet noGas) { for (ItemStack is : noGas) { byte circuitConfiguration = 1; if (GT_Utility.areStacksEqual(is, recipe.mOutputs[0])) { @@ -514,32 +511,27 @@ public class StaticRecipeChangeLoaders { if (!GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(11), stack) && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(14), stack) && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(19), stack)) { - if (BW_Util.checkStackAndPrefix(stack)) - circuitConfiguration = (byte) - (GT_OreDictUnificator.getAssociation(stack) - .mPrefix - .equals(OrePrefixes.dustSmall) - ? 4 - : GT_OreDictUnificator.getAssociation(stack) - .mPrefix - .equals(OrePrefixes.dustTiny) - ? 9 - : 1); - inputs.add(stack); - } + if (BW_Util.checkStackAndPrefix(stack)) + circuitConfiguration = (byte) (GT_OreDictUnificator.getAssociation(stack).mPrefix + .equals(OrePrefixes.dustSmall) ? 4 + : GT_OreDictUnificator.getAssociation(stack).mPrefix + .equals(OrePrefixes.dustTiny) ? 9 : 1); + inputs.add(stack); + } inputs.add(GT_Utility.getIntegratedCircuit(circuitConfiguration)); - toAdd.add(new BWRecipes.DynamicGTRecipe( - false, - inputs.toArray(new ItemStack[0]), - recipe.mOutputs, - recipe.mSpecialItems, - recipe.mChances, - null, - recipe.mFluidOutputs, - transformEBFNoGasRecipeTime(recipe, originalGas), - recipe.mEUt, - recipe.mSpecialValue, - recipe)); + toAdd.add( + new BWRecipes.DynamicGTRecipe( + false, + inputs.toArray(new ItemStack[0]), + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + null, + recipe.mFluidOutputs, + transformEBFNoGasRecipeTime(recipe, originalGas), + recipe.mEUt, + recipe.mSpecialValue, + recipe)); break; } } @@ -549,12 +541,12 @@ public class StaticRecipeChangeLoaders { HashSet duplicates = new HashSet<>(); for (GT_Recipe recipe : toAdd) { for (GT_Recipe recipe2 : toAdd) { - if (recipe.mEUt != recipe2.mEUt - || recipe.mDuration != recipe2.mDuration + if (recipe.mEUt != recipe2.mEUt || recipe.mDuration != recipe2.mDuration || recipe.mSpecialValue != recipe2.mSpecialValue || recipe == recipe2 || recipe.mInputs.length != recipe2.mInputs.length - || recipe.mFluidInputs.length != recipe2.mFluidInputs.length) continue; + || recipe.mFluidInputs.length != recipe2.mFluidInputs.length) + continue; boolean isSame = true; for (int i = 0; i < recipe.mInputs.length; i++) { if (!GT_Utility.areStacksEqual(recipe.mInputs[i], recipe2.mInputs[i])) isSame = false; @@ -577,8 +569,9 @@ public class StaticRecipeChangeLoaders { } private static void editRecipes(ArrayListMultimap base, HashSet noGas) { - if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeFluidNameMap.contains( - Objects.requireNonNull(fluids.get(Oganesson)).getName())) return; + if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeFluidNameMap + .contains(Objects.requireNonNull(fluids.get(Oganesson)).getName())) + return; HashSet toAdd = new HashSet<>(); @@ -604,31 +597,27 @@ public class StaticRecipeChangeLoaders { public static void addElectricImplosionCompressorRecipes() { if (eicMap == null) { eicMap = new GT_Recipe.GT_Recipe_Map( - new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), - "gt.recipe.electricimplosioncompressor", - "Electric Implosion Compressor", - (String) null, - "gregtech:textures/gui/basicmachines/Default", - 2, - 2, - 0, - 0, - 1, - "", - 1, - "", - true, - true) - .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_IMPLOSION) - .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT); - GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream() - .filter(e -> e.mInputs != null) - .forEach(recipe -> eicMap.addRecipe( + new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), + "gt.recipe.electricimplosioncompressor", + "Electric Implosion Compressor", + (String) null, + "gregtech:textures/gui/basicmachines/Default", + 2, + 2, + 0, + 0, + 1, + "", + 1, + "", + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_IMPLOSION) + .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT); + GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream().filter(e -> e.mInputs != null).forEach( + recipe -> eicMap.addRecipe( true, - Arrays.stream(recipe.mInputs) - .filter(e -> !StaticRecipeChangeLoaders.checkForExplosives(e)) - .distinct() - .toArray(ItemStack[]::new), + Arrays.stream(recipe.mInputs).filter(e -> !StaticRecipeChangeLoaders.checkForExplosives(e)) + .distinct().toArray(ItemStack[]::new), recipe.mOutputs, null, null, @@ -644,11 +633,11 @@ public class StaticRecipeChangeLoaders { // 72L SpaceTime -> 1 Eternal singularity. eicMap.addRecipe( false, - new ItemStack[] {GT_Values.NI}, - new ItemStack[] {GT_ModHandler.getModItem("eternalsingularity", "eternal_singularity", 1L)}, + new ItemStack[] { GT_Values.NI }, + new ItemStack[] { GT_ModHandler.getModItem("eternalsingularity", "eternal_singularity", 1L) }, null, - new FluidStack[] {Materials.SpaceTime.getMolten(72L)}, - new FluidStack[] {GT_Values.NF}, + new FluidStack[] { Materials.SpaceTime.getMolten(72L) }, + new FluidStack[] { GT_Values.NF }, 100 * 20, 128_000_000, 1); // aSpecialVaue has no meaning here. @@ -659,14 +648,13 @@ public class StaticRecipeChangeLoaders { // Raw Exposed Optical Chip eicMap.addRecipe( false, - new ItemStack[] { - ItemList.Circuit_Silicon_Wafer7.get(1L), - GT_ModHandler.getModItem("universalsingularities", "universal.general.singularity", 1L, 20) - }, - new ItemStack[] {ItemList.Circuit_Chip_Optical.get(16L)}, + new ItemStack[] { ItemList.Circuit_Silicon_Wafer7.get(1L), + GT_ModHandler + .getModItem("universalsingularities", "universal.general.singularity", 1L, 20) }, + new ItemStack[] { ItemList.Circuit_Chip_Optical.get(16L) }, null, - new FluidStack[] {GT_Values.NF}, - new FluidStack[] {GT_Values.NF}, + new FluidStack[] { GT_Values.NF }, + new FluidStack[] { GT_Values.NF }, 5 * 20, 125_829_120, 1); @@ -674,33 +662,33 @@ public class StaticRecipeChangeLoaders { eicMap.addRecipe( false, - new ItemStack[] {GT_ModHandler.getModItem("GoodGenerator", "highDensityPlutoniumNugget", 5L)}, - new ItemStack[] {GT_ModHandler.getModItem("GoodGenerator", "highDensityPlutonium", 1L)}, + new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityPlutoniumNugget", 5L) }, + new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityPlutonium", 1L) }, null, - new FluidStack[] {Materials.Infinity.getMolten(9L)}, - new FluidStack[] {GT_Values.NF}, + new FluidStack[] { Materials.Infinity.getMolten(9L) }, + new FluidStack[] { GT_Values.NF }, 1, 7_864_320, 1); eicMap.addRecipe( false, - new ItemStack[] {GT_ModHandler.getModItem("GoodGenerator", "highDensityUraniumNugget", 5L)}, - new ItemStack[] {GT_ModHandler.getModItem("GoodGenerator", "highDensityUranium", 1L)}, + new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityUraniumNugget", 5L) }, + new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityUranium", 1L) }, null, - new FluidStack[] {Materials.Infinity.getMolten(9L)}, - new FluidStack[] {GT_Values.NF}, + new FluidStack[] { Materials.Infinity.getMolten(9L) }, + new FluidStack[] { GT_Values.NF }, 1, 7_864_320, 1); eicMap.addRecipe( false, - new ItemStack[] {GT_ModHandler.getModItem("GoodGenerator", "highDensityThoriumNugget", 5L)}, - new ItemStack[] {GT_ModHandler.getModItem("GoodGenerator", "highDensityThorium", 1L)}, + new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityThoriumNugget", 5L) }, + new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityThorium", 1L) }, null, - new FluidStack[] {Materials.Infinity.getMolten(9L)}, - new FluidStack[] {GT_Values.NF}, + new FluidStack[] { Materials.Infinity.getMolten(9L) }, + new FluidStack[] { GT_Values.NF }, 1, 7_864_320, 1); @@ -731,8 +719,8 @@ public class StaticRecipeChangeLoaders { return ret; } - private static int getLogicFuntion( - GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe, Pair counts) { + private static int getLogicFuntion(GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe, + Pair counts) { if (gt_recipe_map == GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) return getChemicalLogic(recipe, counts); else if (gt_recipe_map == GT_Recipe.GT_Recipe_Map.sBlastRecipes) return getBlastLogic(recipe); @@ -750,8 +738,8 @@ public class StaticRecipeChangeLoaders { return toSet.getValue() * 10 + toSet.getKey(); } - private static void transformCircuitRecipes( - GT_Recipe.GT_Recipe_Map gtRecipeMap, Map> mapGtRecipeCounts) { + private static void transformCircuitRecipes(GT_Recipe.GT_Recipe_Map gtRecipeMap, + Map> mapGtRecipeCounts) { mapGtRecipeCounts.forEach( (recipe, counts) -> StaticRecipeChangeLoaders.rewriteForCorrectCircuit(gtRecipeMap, recipe, counts)); @@ -786,14 +774,14 @@ public class StaticRecipeChangeLoaders { private static Map>> getRecipesByCircuitID( GT_Recipe.GT_Recipe_Map[] ref) { - return Arrays.stream(ref) - .collect(Collectors.toMap( + return Arrays.stream(ref).collect( + Collectors.toMap( k -> k, k -> getArrayListMultiMapFromRecipeList(gatherNoCircuitRecipes(new HashSet<>(k.mRecipeList))))); } - private static GT_Recipe rewriteForCorrectCircuit( - GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe, Pair counts) { + private static GT_Recipe rewriteForCorrectCircuit(GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe, + Pair counts) { ItemStack[] old = BW_Util.copyAndRemoveNulls(recipe.mInputs, ItemStack.class); ItemStack[] nu = Arrays.copyOf(old, old.length + 1); @@ -813,8 +801,7 @@ public class StaticRecipeChangeLoaders { newColl = new HashSet<>(); } - recipeloop: - for (GT_Recipe r : mRecipeList) { + recipeloop: for (GT_Recipe r : mRecipeList) { for (int i = 0; i < r.mInputs.length; i++) if (GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(Short.MAX_VALUE), r.mInputs[i])) { continue recipeloop; @@ -827,15 +814,11 @@ public class StaticRecipeChangeLoaders { private static Map> getArrayListMultiMapFromRecipeList( Collection mRecipeList) { - return mRecipeList.stream() - .collect(Collectors.toMap( + return mRecipeList.stream().collect( + Collectors.toMap( recipe -> recipe, recipe -> new Pair<>( - (int) Arrays.stream(recipe.mInputs) - .filter(Objects::nonNull) - .count(), - (int) Arrays.stream(recipe.mFluidInputs) - .filter(Objects::nonNull) - .count()))); + (int) Arrays.stream(recipe.mInputs).filter(Objects::nonNull).count(), + (int) Arrays.stream(recipe.mFluidInputs).filter(Objects::nonNull).count()))); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index 212cc0ae20..a1d7d23c46 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -1,29 +1,31 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.net; +import java.util.EnumMap; +import java.util.List; + +import javax.annotation.Nonnull; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; + import com.google.common.io.ByteArrayDataInput; import com.google.common.io.ByteStreams; + import cpw.mods.fml.common.network.FMLEmbeddedChannel; import cpw.mods.fml.common.network.FMLOutboundHandler; import cpw.mods.fml.common.network.NetworkRegistry; @@ -38,13 +40,6 @@ import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; import io.netty.handler.codec.MessageToMessageCodec; -import java.util.EnumMap; -import java.util.List; -import javax.annotation.Nonnull; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; /* * Original GT File slightly Modified @@ -58,24 +53,16 @@ public class BW_Network extends MessageToMessageCodec public BW_Network() { this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", this, new BW_Network.HandlerShared()); - this.mSubChannels = new GT_Packet[] { - new RendererPacket(), - new CircuitProgrammerPacket(), - new MetaBlockPacket(), - new OreDictCachePacket(), - new ServerJoinedPackage(), - new EICPacket(), - new EIGPacket() - }; + this.mSubChannels = new GT_Packet[] { new RendererPacket(), new CircuitProgrammerPacket(), + new MetaBlockPacket(), new OreDictCachePacket(), new ServerJoinedPackage(), new EICPacket(), + new EIGPacket() }; } protected void encode(ChannelHandlerContext aContext, GT_Packet aPacket, List aOutput) throws Exception { - aOutput.add(new FMLProxyPacket( - Unpooled.buffer() - .writeByte(aPacket.getPacketID()) - .writeBytes(aPacket.encode()) - .copy(), - (String) aContext.channel().attr(NetworkRegistry.FML_CHANNEL).get())); + aOutput.add( + new FMLProxyPacket( + Unpooled.buffer().writeByte(aPacket.getPacketID()).writeBytes(aPacket.encode()).copy(), + (String) aContext.channel().attr(NetworkRegistry.FML_CHANNEL).get())); } protected void decode(ChannelHandlerContext aContext, FMLProxyPacket aPacket, List aOutput) @@ -85,40 +72,33 @@ public class BW_Network extends MessageToMessageCodec } public void sendToPlayer(@Nonnull GT_Packet aPacket, @Nonnull EntityPlayerMP aPlayer) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) - .attr(FMLOutboundHandler.FML_MESSAGETARGET) + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET) .set(FMLOutboundHandler.OutboundTarget.PLAYER); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) - .attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) .set(aPlayer); ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket); } public void sendToAllPlayersinWorld(@Nonnull GT_Packet aPacket, World world) { for (String name : FMLServerHandler.instance().getServer().getAllUsernames()) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) - .attr(FMLOutboundHandler.FML_MESSAGETARGET) + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET) .set(FMLOutboundHandler.OutboundTarget.PLAYER); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) - .attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) .set(world.getPlayerEntityByName(name)); ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket); } } public void sendToAllAround(@Nonnull GT_Packet aPacket, NetworkRegistry.TargetPoint aPosition) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) - .attr(FMLOutboundHandler.FML_MESSAGETARGET) + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET) .set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) - .attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) .set(aPosition); ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket); } public void sendToServer(@Nonnull GT_Packet aPacket) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.CLIENT)) - .attr(FMLOutboundHandler.FML_MESSAGETARGET) + ((FMLEmbeddedChannel) this.mChannel.get(Side.CLIENT)).attr(FMLOutboundHandler.FML_MESSAGETARGET) .set(FMLOutboundHandler.OutboundTarget.TOSERVER); ((FMLEmbeddedChannel) this.mChannel.get(Side.CLIENT)).writeAndFlush(aPacket); } @@ -133,8 +113,7 @@ public class BW_Network extends MessageToMessageCodec EntityPlayerMP tPlayer = (EntityPlayerMP) tObject; Chunk tChunk = aWorld.getChunkFromBlockCoords(aX, aZ); - if (tPlayer.getServerForPlayer() - .getPlayerManager() + if (tPlayer.getServerForPlayer().getPlayerManager() .isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { this.sendToPlayer(aPacket, tPlayer); } @@ -144,6 +123,7 @@ public class BW_Network extends MessageToMessageCodec @Sharable static final class HandlerShared extends SimpleChannelInboundHandler { + HandlerShared() {} protected void channelRead0(ChannelHandlerContext ctx, GT_Packet aPacket) throws Exception { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java index 11e0ed1352..0e428285e4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java @@ -1,31 +1,20 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.net; -import com.github.bartimaeusnek.bartworks.common.items.Circuit_Programmer; -import com.google.common.io.ByteArrayDataInput; -import gregtech.api.net.GT_Packet; import java.nio.ByteBuffer; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -34,6 +23,10 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; +import com.github.bartimaeusnek.bartworks.common.items.Circuit_Programmer; +import com.google.common.io.ByteArrayDataInput; +import gregtech.api.net.GT_Packet; + public class CircuitProgrammerPacket extends GT_Packet { private int dimID, playerID; @@ -59,11 +52,8 @@ public class CircuitProgrammerPacket extends GT_Packet { @Override public byte[] encode() { - return ByteBuffer.allocate(9) - .putInt(0, this.dimID) - .putInt(4, this.playerID) - .put(8, (this.hasChip ? this.chipCfg : -1)) - .array(); + return ByteBuffer.allocate(9).putInt(0, this.dimID).putInt(4, this.playerID) + .put(8, (this.hasChip ? this.chipCfg : -1)).array(); } @Override @@ -89,9 +79,9 @@ public class CircuitProgrammerPacket extends GT_Packet { nbt.setBoolean("HasChip", this.hasChip); if (this.hasChip) nbt.setByte("ChipConfig", this.chipCfg); stack.setTagCompound(nbt); - ((EntityPlayer) w.getEntityByID(this.playerID)) - .inventory.setInventorySlotContents( - ((EntityPlayer) w.getEntityByID(this.playerID)).inventory.currentItem, stack); + ((EntityPlayer) w.getEntityByID(this.playerID)).inventory.setInventorySlotContents( + ((EntityPlayer) w.getEntityByID(this.playerID)).inventory.currentItem, + stack); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EICPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EICPacket.java index b62d880c4c..95a79e9344 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EICPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EICPacket.java @@ -1,17 +1,20 @@ package com.github.bartimaeusnek.bartworks.common.net; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; import com.github.bartimaeusnek.bartworks.util.Coords; import com.google.common.io.ByteArrayDataInput; + import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.net.GT_Packet_New; import io.netty.buffer.ByteBuf; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IBlockAccess; public class EICPacket extends GT_Packet_New { + private Coords coords; private boolean bool; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EIGPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EIGPacket.java index c65568530b..f21960d65f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EIGPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EIGPacket.java @@ -1,17 +1,20 @@ package com.github.bartimaeusnek.bartworks.common.net; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ExtremeIndustrialGreenhouse; import com.github.bartimaeusnek.bartworks.util.Coords; import com.google.common.io.ByteArrayDataInput; + import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.net.GT_Packet_New; import io.netty.buffer.ByteBuf; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IBlockAccess; public class EIGPacket extends GT_Packet_New { + private Coords coords; private int mMaxSlots; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java index 047631d193..3b454c73ad 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java @@ -1,36 +1,29 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.net; +import java.nio.ByteBuffer; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block_TE; import com.github.bartimaeusnek.bartworks.util.MurmurHash3; import com.google.common.io.ByteArrayDataInput; import gregtech.api.net.GT_Packet; -import java.nio.ByteBuffer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; public class MetaBlockPacket extends GT_Packet { @@ -59,21 +52,11 @@ public class MetaBlockPacket extends GT_Packet { @Override public byte[] encode() { int hash = MurmurHash3.murmurhash3_x86_32( - ByteBuffer.allocate(12) - .putInt(this.x) - .putInt(this.z) - .putShort(this.y) - .putShort(this.meta) - .array(), + ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), 0, 12, 31); - return ByteBuffer.allocate(16) - .putInt(this.x) - .putInt(this.z) - .putShort(this.y) - .putShort(this.meta) - .putInt(hash) + return ByteBuffer.allocate(16).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).putInt(hash) .array(); } @@ -87,17 +70,11 @@ public class MetaBlockPacket extends GT_Packet { this.y = buff.getShort(); this.meta = buff.getShort(); MetaBlockPacket todecode = new MetaBlockPacket(this.x, this.y, this.z, this.meta); - if (buff.getInt() - != MurmurHash3.murmurhash3_x86_32( - ByteBuffer.allocate(12) - .putInt(this.x) - .putInt(this.z) - .putShort(this.y) - .putShort(this.meta) - .array(), - 0, - 12, - 31)) { + if (buff.getInt() != MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), + 0, + 12, + 31)) { MainMod.LOGGER.error("PACKET HASH DOES NOT MATCH!"); return null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java index 14a974ea21..6d252b8ad4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java @@ -1,34 +1,27 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.net; +import java.nio.ByteBuffer; +import java.util.HashSet; + +import net.minecraft.world.IBlockAccess; + import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.Pair; import com.google.common.io.ByteArrayDataInput; import gregtech.api.net.GT_Packet; -import java.nio.ByteBuffer; -import java.util.HashSet; -import net.minecraft.world.IBlockAccess; public class OreDictCachePacket extends GT_Packet { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java index 5ff6ad1431..0cfb24d44c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -1,27 +1,22 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.net; +import java.nio.ByteBuffer; + +import net.minecraft.world.IBlockAccess; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; @@ -29,8 +24,6 @@ import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.Coords; import com.google.common.io.ByteArrayDataInput; import gregtech.api.net.GT_Packet; -import java.nio.ByteBuffer; -import net.minecraft.world.IBlockAccess; public class RendererPacket extends GT_Packet { @@ -60,39 +53,30 @@ public class RendererPacket extends GT_Packet { byte r = (byte) (((this.integer >> 16) & 0xFF) + Byte.MIN_VALUE); byte g = (byte) (((this.integer >> 8) & 0xFF) + Byte.MIN_VALUE); byte b = (byte) (((this.integer) & 0xFF) + Byte.MIN_VALUE); - byte checksum = (byte) (this.coords.x % 25 - + this.coords.y % 25 + byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25 + this.coords.z % 25 + this.coords.wID % 25 + this.integer % 25 + this.removal); - return ByteBuffer.allocate(19) - .putInt(0, this.coords.x) - .putShort(4, this.coords.y) - .putInt(6, this.coords.z) - .putInt(10, this.coords.wID) - .put(14, r) - .put(15, g) - .put(16, b) - .put(17, this.removal) - .put(18, checksum) + return ByteBuffer.allocate(19).putInt(0, this.coords.x).putShort(4, this.coords.y).putInt(6, this.coords.z) + .putInt(10, this.coords.wID).put(14, r).put(15, g).put(16, b).put(17, this.removal).put(18, checksum) .array(); } - // /** - // * only use in a debug enviroment, does not do anything on its own. - // * @param buffer - // */ - // public void decodetest (byte[] buffer){ - // this.coords=new + // /** + // * only use in a debug enviroment, does not do anything on its own. + // * @param buffer + // */ + // public void decodetest (byte[] buffer){ + // this.coords=new // Coords(ByteBuffer.wrap(buffer).getInt(0),ByteBuffer.wrap(buffer).getShort(4),ByteBuffer.wrap(buffer).getInt(6),ByteBuffer.wrap(buffer).getInt(10)); - // int[] rgb = {ByteBuffer.wrap(buffer).get(14)-Byte.MIN_VALUE, + // int[] rgb = {ByteBuffer.wrap(buffer).get(14)-Byte.MIN_VALUE, // ByteBuffer.wrap(buffer).get(15)-Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(16)-Byte.MIN_VALUE}; - // this.integer= BW_Util.getColorFromRGBArray(rgb); - // this.removal=ByteBuffer.wrap(buffer).get(17); + // this.integer= BW_Util.getColorFromRGBArray(rgb); + // this.removal=ByteBuffer.wrap(buffer).get(17); // - // byte checksum = (byte) (coords.x%25+coords.y%25+coords.z%25+coords.wID%25+integer%25+removal); - // } + // byte checksum = (byte) (coords.x%25+coords.y%25+coords.z%25+coords.wID%25+integer%25+removal); + // } @Override public GT_Packet decode(ByteArrayDataInput dataInput) { @@ -105,16 +89,12 @@ public class RendererPacket extends GT_Packet { ByteBuffer.wrap(buffer).getShort(4), ByteBuffer.wrap(buffer).getInt(6), ByteBuffer.wrap(buffer).getInt(10)); - int[] rgb = { - ByteBuffer.wrap(buffer).get(14) - Byte.MIN_VALUE, - ByteBuffer.wrap(buffer).get(15) - Byte.MIN_VALUE, - ByteBuffer.wrap(buffer).get(16) - Byte.MIN_VALUE - }; + int[] rgb = { ByteBuffer.wrap(buffer).get(14) - Byte.MIN_VALUE, + ByteBuffer.wrap(buffer).get(15) - Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(16) - Byte.MIN_VALUE }; this.integer = BW_ColorUtil.getColorFromRGBArray(rgb); this.removal = ByteBuffer.wrap(buffer).get(17); - byte checksum = (byte) (this.coords.x % 25 - + this.coords.y % 25 + byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25 + this.coords.z % 25 + this.coords.wID % 25 + this.integer % 25 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java index a63388ba25..1c48d28528 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java @@ -1,32 +1,24 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.net; +import net.minecraft.world.IBlockAccess; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.google.common.io.ByteArrayDataInput; import gregtech.api.net.GT_Packet; -import net.minecraft.world.IBlockAccess; public class ServerJoinedPackage extends GT_Packet { @@ -38,10 +30,8 @@ public class ServerJoinedPackage extends GT_Packet { public ServerJoinedPackage(Object obj) { super(false); - this.config = (byte) - (ConfigHandler.classicMode && ConfigHandler.disableExtraGassesForEBF - ? 3 - : ConfigHandler.classicMode ? 2 : ConfigHandler.disableExtraGassesForEBF ? 1 : 0); + this.config = (byte) (ConfigHandler.classicMode && ConfigHandler.disableExtraGassesForEBF ? 3 + : ConfigHandler.classicMode ? 2 : ConfigHandler.disableExtraGassesForEBF ? 1 : 0); } @Override @@ -51,7 +41,7 @@ public class ServerJoinedPackage extends GT_Packet { @Override public byte[] encode() { - return new byte[] {this.config}; + return new byte[] { this.config }; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java index 3d643349c0..208bd24c29 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java @@ -1,27 +1,19 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; import net.minecraft.tileentity.TileEntity; -public class BWTileEntityDimIDBridge extends TileEntity {} +public class BWTileEntityDimIDBridge extends TileEntity { +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java index a15b043a56..a437dc8285 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java @@ -1,34 +1,27 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; + import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_RotorBlock; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ic2.core.block.kineticgenerator.container.ContainerWindKineticGenerator; import ic2.core.block.kineticgenerator.tileentity.TileEntityWindKineticGenerator; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; public class BW_RotorBlock extends TileEntityWindKineticGenerator { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java index 625352aa82..e735a93dc9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java @@ -1,42 +1,35 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; import static net.minecraftforge.common.util.ForgeDirection.*; -import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; -import com.github.bartimaeusnek.bartworks.util.Coords; import java.util.Comparator; import java.util.PriorityQueue; + import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.TileFluidHandler; +import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; +import com.github.bartimaeusnek.bartworks.util.Coords; + public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implements ITileAddsInformation { - private static final ForgeDirection[] allowed_directions = new ForgeDirection[] {DOWN, WEST, EAST, SOUTH, NORTH}; + private static final ForgeDirection[] allowed_directions = new ForgeDirection[] { DOWN, WEST, EAST, SOUTH, NORTH }; private PriorityQueue breadthFirstQueue = new PriorityQueue<>(Comparator.comparingInt(x -> x.y)); private boolean wasInited = false; @@ -117,6 +110,6 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem @Override public String[] getInfoData() { - return new String[] {"Experimental Machine to fill Holes with Fluids"}; + return new String[] { "Experimental Machine to fill Holes with Fluids" }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index 6bf5546ce6..8641a78adf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -1,27 +1,32 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; +import java.util.Arrays; +import java.util.Optional; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.*; + import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; import com.github.bartimaeusnek.bartworks.API.ITileDropsContent; import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; @@ -36,28 +41,12 @@ import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.ProgressBar; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import gregtech.api.util.GT_Utility; import gregtech.common.GT_Pollution; -import java.util.Arrays; -import java.util.Optional; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityFurnace; -import net.minecraft.util.StatCollector; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.*; -public class BW_TileEntity_HeatedWaterPump extends TileEntity - implements ITileDropsContent, - IFluidHandler, - IFluidTank, - ITileWithModularUI, - ITileAddsInformation, - ITileHasDifferentTextureSides { +public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDropsContent, IFluidHandler, IFluidTank, + ITileWithModularUI, ITileAddsInformation, ITileHasDifferentTextureSides { public static final int FUELSLOT = 0; public static final Fluid WATER = FluidRegistry.WATER; @@ -139,29 +128,32 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity private void pushWaterToAdjacentTiles() { Arrays.stream(ForgeDirection.values(), 0, 6) // All but Unknown - .forEach(direction -> Optional.ofNullable(this.worldObj.getTileEntity( - this.xCoord + direction.offsetX, - this.yCoord + direction.offsetY, - this.zCoord + direction.offsetZ)) - .ifPresent(te -> { - if (te instanceof IFluidHandler) { - IFluidHandler tank = (IFluidHandler) te; - if (tank.canFill(direction.getOpposite(), this.outputstack.getFluid())) { - int drainage; - if ((drainage = tank.fill(direction.getOpposite(), this.outputstack, false)) > 0) { - tank.fill(direction.getOpposite(), this.outputstack, true); - this.drain(drainage, true); + .forEach( + direction -> Optional.ofNullable( + this.worldObj.getTileEntity( + this.xCoord + direction.offsetX, + this.yCoord + direction.offsetY, + this.zCoord + direction.offsetZ)) + .ifPresent(te -> { + if (te instanceof IFluidHandler) { + IFluidHandler tank = (IFluidHandler) te; + if (tank.canFill(direction.getOpposite(), this.outputstack.getFluid())) { + int drainage; + if ((drainage = tank.fill(direction.getOpposite(), this.outputstack, false)) + > 0) { + tank.fill(direction.getOpposite(), this.outputstack, true); + this.drain(drainage, true); + } + } + } else if (te instanceof IFluidTank) { + IFluidTank tank = (IFluidTank) te; + int drainage; + if ((drainage = tank.fill(this.outputstack, false)) > 0) { + tank.fill(this.outputstack, true); + this.drain(drainage, true); + } } - } - } else if (te instanceof IFluidTank) { - IFluidTank tank = (IFluidTank) te; - int drainage; - if ((drainage = tank.fill(this.outputstack, false)) > 0) { - tank.fill(this.outputstack, true); - this.drain(drainage, true); - } - } - })); + })); } private void causePollution() { @@ -175,7 +167,7 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity @Override public int[] getAccessibleSlotsFromSide(int side) { - return new int[] {0}; + return new int[] { 0 }; } @Override @@ -201,9 +193,9 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity @Override public ItemStack decrStackSize(int slot, int ammount) { - if (slot != BW_TileEntity_HeatedWaterPump.FUELSLOT - || this.fuelstack == null - || ammount > this.fuelstack.stackSize) return null; + if (slot != BW_TileEntity_HeatedWaterPump.FUELSLOT || this.fuelstack == null + || ammount > this.fuelstack.stackSize) + return null; return this.fuelstack.splitStack(ammount); } @@ -284,8 +276,15 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity if (ret.amount == 0) ret = null; if (doDrain) { this.outputstack.amount -= actualdrain; - FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent( - this.outputstack, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this, actualdrain)); + FluidEvent.fireEvent( + new FluidEvent.FluidDrainingEvent( + this.outputstack, + this.getWorldObj(), + this.xCoord, + this.yCoord, + this.zCoord, + this, + actualdrain)); } return ret; } @@ -297,9 +296,9 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity @Override public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { - if (resource != null - && resource.getFluid() == BW_TileEntity_HeatedWaterPump.WATER - && this.drain(resource.amount, false) != null) return this.drain(resource.amount, doDrain); + if (resource != null && resource.getFluid() == BW_TileEntity_HeatedWaterPump.WATER + && this.drain(resource.amount, false) != null) + return this.drain(resource.amount, doDrain); return null; } @@ -320,30 +319,29 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity @Override public FluidTankInfo[] getTankInfo(ForgeDirection from) { - return new FluidTankInfo[] {this.getInfo()}; + return new FluidTankInfo[] { this.getInfo() }; } @Override public String[] getInfoData() { return new String[] { - StatCollector.translateToLocal("tooltip.tile.waterpump.0.name") + " " - + GT_Utility.formatNumbers(ConfigHandler.mbWaterperSec) - + String.format( - StatCollector.translateToLocal("tooltip.tile.waterpump.1.name"), - ConfigHandler.pollutionHeatedWaterPumpSecond), - StatCollector.translateToLocal("tooltip.tile.waterpump.2.name") - }; + StatCollector.translateToLocal("tooltip.tile.waterpump.0.name") + " " + + GT_Utility.formatNumbers(ConfigHandler.mbWaterperSec) + + String.format( + StatCollector.translateToLocal("tooltip.tile.waterpump.1.name"), + ConfigHandler.pollutionHeatedWaterPumpSecond), + StatCollector.translateToLocal("tooltip.tile.waterpump.2.name") }; } @Override public void registerBlockIcons(IIconRegister par1IconRegister) { - ITileHasDifferentTextureSides.texture[ForgeDirection.UP.ordinal()] = - par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpTop"); - ITileHasDifferentTextureSides.texture[ForgeDirection.DOWN.ordinal()] = - par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpDown"); + ITileHasDifferentTextureSides.texture[ForgeDirection.UP.ordinal()] = par1IconRegister + .registerIcon(MainMod.MOD_ID + ":heatedWaterPumpTop"); + ITileHasDifferentTextureSides.texture[ForgeDirection.DOWN.ordinal()] = par1IconRegister + .registerIcon(MainMod.MOD_ID + ":heatedWaterPumpDown"); for (int i = 2; i < 7; i++) { - ITileHasDifferentTextureSides.texture[i] = - par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpSide"); + ITileHasDifferentTextureSides.texture[i] = par1IconRegister + .registerIcon(MainMod.MOD_ID + ":heatedWaterPumpSide"); } } @@ -354,16 +352,13 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity builder.bindPlayerInventory(buildContext.getPlayer()); final IItemHandlerModifiable invWrapper = new InvWrapper(this); - builder.widget(new SlotWidget(invWrapper, 0) - .setFilter(stack -> TileEntityFurnace.getItemBurnTime(stack) > 0) + builder.widget( + new SlotWidget(invWrapper, 0).setFilter(stack -> TileEntityFurnace.getItemBurnTime(stack) > 0) .setPos(55, 52)) - .widget(SlotWidget.phantom(invWrapper, 1).disableInteraction().setPos(85, 32)) - .widget(new ProgressBar() - .setProgress(() -> (float) fuel / maxfuel) - .setTexture(BW_UITextures.PROGRESSBAR_FUEL, 14) - .setDirection(ProgressBar.Direction.UP) - .setPos(56, 36) - .setSize(14, 14)); + .widget(SlotWidget.phantom(invWrapper, 1).disableInteraction().setPos(85, 32)).widget( + new ProgressBar().setProgress(() -> (float) fuel / maxfuel) + .setTexture(BW_UITextures.PROGRESSBAR_FUEL, 14).setDirection(ProgressBar.Direction.UP) + .setPos(56, 36).setSize(14, 14)); return builder.build(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java index 2fcf82d36c..d3160d14a7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java @@ -1,35 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; -import gregtech.api.util.GT_Utility; import java.util.ArrayList; + import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.*; +import gregtech.api.util.GT_Utility; + public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank, IFluidHandler { final ArrayList INTERNALTANKS = new ArrayList<>(); @@ -123,11 +116,10 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank int id = 0; if (this.canDrain(null, resource.getFluid())) { - for (FluidStack stack : this.INTERNALTANKS) - if (GT_Utility.areFluidsEqual(stack, resource)) { - this.INTERNALTANKS.get(id = this.INTERNALTANKS.indexOf(stack)).amount += resource.amount; - this.selectedTank = id; - } + for (FluidStack stack : this.INTERNALTANKS) if (GT_Utility.areFluidsEqual(stack, resource)) { + this.INTERNALTANKS.get(id = this.INTERNALTANKS.indexOf(stack)).amount += resource.amount; + this.selectedTank = id; + } } else { this.INTERNALTANKS.add(resource); id = this.INTERNALTANKS.size() - 1; @@ -148,8 +140,15 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank if (ret.amount == 0) ret = null; if (doDrain) { outputstack.amount -= actualdrain; - FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent( - outputstack, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this, actualdrain)); + FluidEvent.fireEvent( + new FluidEvent.FluidDrainingEvent( + outputstack, + this.getWorldObj(), + this.xCoord, + this.yCoord, + this.zCoord, + this, + actualdrain)); } return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java index e5a07a9505..b9b8ba24b3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java @@ -52,437 +52,437 @@ // public class BW_TileEntity_LESU_Redux extends TileEntity implements ITileHasDifferentTextureSides, // ITileAddsInformation, ITileDropsContent, IEnergyConnected { // -// public ConnectedBlocksChecker connectedcells; -// public ItemStack[] circuits = new ItemStack[5]; -// private long[] storage; -// private long input; -// private long output; -// ByteBuffer eu; -// -// @Override -// public String[] getInfoData() { -// ArrayList e = new ArrayList<>(); -// String[] dsc = StatCollector.translateToLocal("tooltip.tile.lesu.0.name").split(";"); -// for (int i = 0; i < dsc.length; i++) { -// e.add(dsc[i]); -// } -// e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + ConfigHandler.energyPerCell + "EU"); -// dsc = StatCollector.translateToLocal("tooltip.tile.lesu.2.name").split(";"); -// for (int i = 0; i < dsc.length; i++) { -// e.add(dsc[i]); -// } -// e.add(ChatColorHelper.RED + StatCollector.translateToLocal("tooltip.tile.lesu.3.name")); -// e.add(StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"); -// return e.toArray(new String[0]); -// } -// -// @Override -// public void registerBlockIcons(IIconRegister par1IconRegister) { -// par1IconRegister.registerIcon(MainMod.MOD_ID + ":LESU_CASING_" + i); -// } -// -// @Override -// public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { -// if (inputEnergyFrom(aSide)){ -// -// } -// return 0; -// } -// -// @Override -// public boolean inputEnergyFrom(byte b) { -// return true; -// } -// -// @Override -// public boolean outputsEnergyTo(byte b) { -// return false; -// } -// -// @Override -// public byte getColorization() { -// return 0; -// } -// -// @Override -// public byte setColorization(byte b) { -// return 0; -// } -// -// @Override -// public World getWorld() { -// return null; -// } -// -// @Override -// public int getXCoord() { -// return 0; -// } -// -// @Override -// public short getYCoord() { -// return 0; -// } -// -// @Override -// public int getZCoord() { -// return 0; -// } -// -// @Override -// public boolean isServerSide() { -// return !isClientSide(); -// } -// -// @Override -// public boolean isClientSide() { -// if (getWorld() != null) -// return getWorld().isRemote; -// return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; -// } -// -// @Override -// public int getRandomNumber(int i) { -// return new XSTR().nextInt(i); -// } -// -// @Override -// public TileEntity getTileEntity(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public TileEntity getTileEntityOffset(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public TileEntity getTileEntityAtSide(byte b) { -// return null; -// } -// -// @Override -// public TileEntity getTileEntityAtSideAndDistance(byte b, int i) { -// return null; -// } -// -// @Override -// public IInventory getIInventory(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public IInventory getIInventoryOffset(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public IInventory getIInventoryAtSide(byte b) { -// return null; -// } -// -// @Override -// public IInventory getIInventoryAtSideAndDistance(byte b, int i) { -// return null; -// } -// -// @Override -// public IFluidHandler getITankContainer(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public IFluidHandler getITankContainerOffset(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public IFluidHandler getITankContainerAtSide(byte b) { -// return null; -// } -// -// @Override -// public IFluidHandler getITankContainerAtSideAndDistance(byte b, int i) { -// return null; -// } -// -// @Override -// public IGregTechTileEntity getIGregTechTileEntity(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public IGregTechTileEntity getIGregTechTileEntityOffset(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public IGregTechTileEntity getIGregTechTileEntityAtSide(byte b) { -// return null; -// } -// -// @Override -// public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte b, int i) { -// return null; -// } -// -// @Override -// public Block getBlock(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public Block getBlockOffset(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public Block getBlockAtSide(byte b) { -// return null; -// } -// -// @Override -// public Block getBlockAtSideAndDistance(byte b, int i) { -// return null; -// } -// -// @Override -// public byte getMetaID(int i, int i1, int i2) { -// return 0; -// } -// -// @Override -// public byte getMetaIDOffset(int i, int i1, int i2) { -// return 0; -// } -// -// @Override -// public byte getMetaIDAtSide(byte b) { -// return 0; -// } -// -// @Override -// public byte getMetaIDAtSideAndDistance(byte b, int i) { -// return 0; -// } -// -// @Override -// public byte getLightLevel(int i, int i1, int i2) { -// return 0; -// } -// -// @Override -// public byte getLightLevelOffset(int i, int i1, int i2) { -// return 0; -// } -// -// @Override -// public byte getLightLevelAtSide(byte b) { -// return 0; -// } -// -// @Override -// public byte getLightLevelAtSideAndDistance(byte b, int i) { -// return 0; -// } -// -// @Override -// public boolean getOpacity(int i, int i1, int i2) { -// return false; -// } -// -// @Override -// public boolean getOpacityOffset(int i, int i1, int i2) { -// return false; -// } -// -// @Override -// public boolean getOpacityAtSide(byte b) { -// return false; -// } -// -// @Override -// public boolean getOpacityAtSideAndDistance(byte b, int i) { -// return false; -// } -// -// @Override -// public boolean getSky(int i, int i1, int i2) { -// return false; -// } -// -// @Override -// public boolean getSkyOffset(int i, int i1, int i2) { -// return false; -// } -// -// @Override -// public boolean getSkyAtSide(byte b) { -// return false; -// } -// -// @Override -// public boolean getSkyAtSideAndDistance(byte b, int i) { -// return false; -// } -// -// @Override -// public boolean getAir(int i, int i1, int i2) { -// return false; -// } -// -// @Override -// public boolean getAirOffset(int i, int i1, int i2) { -// return false; -// } -// -// @Override -// public boolean getAirAtSide(byte b) { -// return false; -// } -// -// @Override -// public boolean getAirAtSideAndDistance(byte b, int i) { -// return false; -// } -// -// @Override -// public BiomeGenBase getBiome() { -// return null; -// } -// -// @Override -// public BiomeGenBase getBiome(int i, int i1) { -// return null; -// } -// -// @Override -// public int getOffsetX(byte b, int i) { -// return 0; -// } -// -// @Override -// public short getOffsetY(byte b, int i) { -// return 0; -// } -// -// @Override -// public int getOffsetZ(byte b, int i) { -// return 0; -// } -// -// @Override -// public boolean isDead() { -// return false; -// } -// -// @Override -// public void sendBlockEvent(byte b, byte b1) { -// -// } -// -// @Override -// public long getTimer() { -// return 0; -// } -// -// @Override -// public void setLightValue(byte b) { -// -// } -// -// @Override -// public boolean isInvalidTileEntity() { -// return false; -// } -// -// @Override -// public boolean openGUI(EntityPlayer entityPlayer, int i) { -// return false; -// } -// -// @Override -// public boolean openGUI(EntityPlayer entityPlayer) { -// return false; -// } -// -// @Override -// public int[] getAccessibleSlotsFromSide(int p_94128_1_) { -// return new int[0]; -// } -// -// @Override -// public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) { -// return false; -// } -// -// @Override -// public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) { -// return false; -// } -// -// @Override -// public int getSizeInventory() { -// return 0; -// } -// -// @Override -// public ItemStack getStackInSlot(int p_70301_1_) { -// return null; -// } -// -// @Override -// public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { -// return null; -// } -// -// @Override -// public ItemStack getStackInSlotOnClosing(int p_70304_1_) { -// return null; -// } -// -// @Override -// public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { -// -// } -// -// @Override -// public String getInventoryName() { -// return null; -// } -// -// @Override -// public boolean hasCustomInventoryName() { -// return false; -// } -// -// @Override -// public int getInventoryStackLimit() { -// return 0; -// } -// -// @Override -// public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { -// return false; -// } -// -// @Override -// public void openInventory() { -// -// } +// public ConnectedBlocksChecker connectedcells; +// public ItemStack[] circuits = new ItemStack[5]; +// private long[] storage; +// private long input; +// private long output; +// ByteBuffer eu; +// +// @Override +// public String[] getInfoData() { +// ArrayList e = new ArrayList<>(); +// String[] dsc = StatCollector.translateToLocal("tooltip.tile.lesu.0.name").split(";"); +// for (int i = 0; i < dsc.length; i++) { +// e.add(dsc[i]); +// } +// e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + ConfigHandler.energyPerCell + "EU"); +// dsc = StatCollector.translateToLocal("tooltip.tile.lesu.2.name").split(";"); +// for (int i = 0; i < dsc.length; i++) { +// e.add(dsc[i]); +// } +// e.add(ChatColorHelper.RED + StatCollector.translateToLocal("tooltip.tile.lesu.3.name")); +// e.add(StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"); +// return e.toArray(new String[0]); +// } +// +// @Override +// public void registerBlockIcons(IIconRegister par1IconRegister) { +// par1IconRegister.registerIcon(MainMod.MOD_ID + ":LESU_CASING_" + i); +// } +// +// @Override +// public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { +// if (inputEnergyFrom(aSide)){ +// +// } +// return 0; +// } +// +// @Override +// public boolean inputEnergyFrom(byte b) { +// return true; +// } +// +// @Override +// public boolean outputsEnergyTo(byte b) { +// return false; +// } +// +// @Override +// public byte getColorization() { +// return 0; +// } +// +// @Override +// public byte setColorization(byte b) { +// return 0; +// } +// +// @Override +// public World getWorld() { +// return null; +// } +// +// @Override +// public int getXCoord() { +// return 0; +// } +// +// @Override +// public short getYCoord() { +// return 0; +// } +// +// @Override +// public int getZCoord() { +// return 0; +// } +// +// @Override +// public boolean isServerSide() { +// return !isClientSide(); +// } +// +// @Override +// public boolean isClientSide() { +// if (getWorld() != null) +// return getWorld().isRemote; +// return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; +// } +// +// @Override +// public int getRandomNumber(int i) { +// return new XSTR().nextInt(i); +// } +// +// @Override +// public TileEntity getTileEntity(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public TileEntity getTileEntityOffset(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public TileEntity getTileEntityAtSide(byte b) { +// return null; +// } +// +// @Override +// public TileEntity getTileEntityAtSideAndDistance(byte b, int i) { +// return null; +// } +// +// @Override +// public IInventory getIInventory(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public IInventory getIInventoryOffset(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public IInventory getIInventoryAtSide(byte b) { +// return null; +// } +// +// @Override +// public IInventory getIInventoryAtSideAndDistance(byte b, int i) { +// return null; +// } +// +// @Override +// public IFluidHandler getITankContainer(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public IFluidHandler getITankContainerOffset(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public IFluidHandler getITankContainerAtSide(byte b) { +// return null; +// } +// +// @Override +// public IFluidHandler getITankContainerAtSideAndDistance(byte b, int i) { +// return null; +// } +// +// @Override +// public IGregTechTileEntity getIGregTechTileEntity(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public IGregTechTileEntity getIGregTechTileEntityOffset(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public IGregTechTileEntity getIGregTechTileEntityAtSide(byte b) { +// return null; +// } +// +// @Override +// public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte b, int i) { +// return null; +// } +// +// @Override +// public Block getBlock(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public Block getBlockOffset(int i, int i1, int i2) { +// return null; +// } +// +// @Override +// public Block getBlockAtSide(byte b) { +// return null; +// } +// +// @Override +// public Block getBlockAtSideAndDistance(byte b, int i) { +// return null; +// } +// +// @Override +// public byte getMetaID(int i, int i1, int i2) { +// return 0; +// } +// +// @Override +// public byte getMetaIDOffset(int i, int i1, int i2) { +// return 0; +// } +// +// @Override +// public byte getMetaIDAtSide(byte b) { +// return 0; +// } +// +// @Override +// public byte getMetaIDAtSideAndDistance(byte b, int i) { +// return 0; +// } +// +// @Override +// public byte getLightLevel(int i, int i1, int i2) { +// return 0; +// } +// +// @Override +// public byte getLightLevelOffset(int i, int i1, int i2) { +// return 0; +// } +// +// @Override +// public byte getLightLevelAtSide(byte b) { +// return 0; +// } // -// @Override -// public void closeInventory() { -// -// } +// @Override +// public byte getLightLevelAtSideAndDistance(byte b, int i) { +// return 0; +// } +// +// @Override +// public boolean getOpacity(int i, int i1, int i2) { +// return false; +// } +// +// @Override +// public boolean getOpacityOffset(int i, int i1, int i2) { +// return false; +// } +// +// @Override +// public boolean getOpacityAtSide(byte b) { +// return false; +// } +// +// @Override +// public boolean getOpacityAtSideAndDistance(byte b, int i) { +// return false; +// } +// +// @Override +// public boolean getSky(int i, int i1, int i2) { +// return false; +// } +// +// @Override +// public boolean getSkyOffset(int i, int i1, int i2) { +// return false; +// } +// +// @Override +// public boolean getSkyAtSide(byte b) { +// return false; +// } +// +// @Override +// public boolean getSkyAtSideAndDistance(byte b, int i) { +// return false; +// } +// +// @Override +// public boolean getAir(int i, int i1, int i2) { +// return false; +// } +// +// @Override +// public boolean getAirOffset(int i, int i1, int i2) { +// return false; +// } +// +// @Override +// public boolean getAirAtSide(byte b) { +// return false; +// } +// +// @Override +// public boolean getAirAtSideAndDistance(byte b, int i) { +// return false; +// } +// +// @Override +// public BiomeGenBase getBiome() { +// return null; +// } +// +// @Override +// public BiomeGenBase getBiome(int i, int i1) { +// return null; +// } +// +// @Override +// public int getOffsetX(byte b, int i) { +// return 0; +// } +// +// @Override +// public short getOffsetY(byte b, int i) { +// return 0; +// } +// +// @Override +// public int getOffsetZ(byte b, int i) { +// return 0; +// } +// +// @Override +// public boolean isDead() { +// return false; +// } +// +// @Override +// public void sendBlockEvent(byte b, byte b1) { +// +// } +// +// @Override +// public long getTimer() { +// return 0; +// } +// +// @Override +// public void setLightValue(byte b) { // -// @Override -// public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { -// return false; -// } -// -// @Override -// public int[] getDropSlots() { -// return new int[0]; -// } +// } +// +// @Override +// public boolean isInvalidTileEntity() { +// return false; +// } +// +// @Override +// public boolean openGUI(EntityPlayer entityPlayer, int i) { +// return false; +// } +// +// @Override +// public boolean openGUI(EntityPlayer entityPlayer) { +// return false; +// } +// +// @Override +// public int[] getAccessibleSlotsFromSide(int p_94128_1_) { +// return new int[0]; +// } +// +// @Override +// public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) { +// return false; +// } +// +// @Override +// public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) { +// return false; +// } +// +// @Override +// public int getSizeInventory() { +// return 0; +// } +// +// @Override +// public ItemStack getStackInSlot(int p_70301_1_) { +// return null; +// } +// +// @Override +// public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { +// return null; +// } +// +// @Override +// public ItemStack getStackInSlotOnClosing(int p_70304_1_) { +// return null; +// } +// +// @Override +// public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { +// +// } +// +// @Override +// public String getInventoryName() { +// return null; +// } +// +// @Override +// public boolean hasCustomInventoryName() { +// return false; +// } +// +// @Override +// public int getInventoryStackLimit() { +// return 0; +// } +// +// @Override +// public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { +// return false; +// } +// +// @Override +// public void openInventory() { +// +// } +// +// @Override +// public void closeInventory() { +// +// } +// +// @Override +// public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { +// return false; +// } +// +// @Override +// public int[] getDropSlots() { +// return new int[0]; +// } // } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java index 4fdf9bb667..95938fc39d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.debug; @@ -28,16 +19,12 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_Scanner; public class CreativeScanner extends GT_MetaTileEntity_Scanner { + public CreativeScanner(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier); } - public CreativeScanner( - String aName, - int aTier, - String[] aDescription, - ITexture[][][] aTextures, - String aGUIName, + public CreativeScanner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, aDescription, aTextures, aGUIName, aNEIName); } @@ -45,7 +32,12 @@ public class CreativeScanner extends GT_MetaTileEntity_Scanner { @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new CreativeScanner( - this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures, + this.mGUIName, + this.mNEIName); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 6d3ec8383c..3aeab597fe 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; @@ -29,6 +20,26 @@ import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; + +import javax.annotation.Nullable; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -40,6 +51,7 @@ import com.github.bartimaeusnek.bartworks.util.*; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -52,23 +64,6 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import javax.annotation.Nullable; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBase { @@ -101,34 +96,29 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa private static final int CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition STRUCTURE_DEFINITION = - StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { - {"ccccc", "ccccc", "ccccc", "ccccc", "ccccc"}, - {"ggggg", "gaaag", "gaaag", "gaaag", "ggggg"}, - {"ggggg", "gaaag", "gaaag", "gaaag", "ggggg"}, - {"cc~cc", "ccccc", "ccccc", "ccccc", "ccccc"}, - })) - .addElement( - 'c', - ofChain( - ofHatchAdder(GT_TileEntity_BioVat::addMaintenanceToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_BioVat::addOutputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_BioVat::addInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_BioVat::addRadiationInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_BioVat::addEnergyInputToMachineList, CASING_INDEX, 1), - onElementPass(e -> e.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)))) - .addElement('a', ofChain(isAir(), ofBlockAnyMeta(FluidLoader.bioFluidBlock))) - .addElement( - 'g', - ofGlassTiered( - (byte) 1, - (byte) 127, - (byte) 0, - (te, v) -> te.mGlassTier = v, - te -> te.mGlassTier, - 1)) - .build(); + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { "ccccc", "ccccc", "ccccc", "ccccc", "ccccc" }, + { "ggggg", "gaaag", "gaaag", "gaaag", "ggggg" }, + { "ggggg", "gaaag", "gaaag", "gaaag", "ggggg" }, + { "cc~cc", "ccccc", "ccccc", "ccccc", "ccccc" }, })) + .addElement( + 'c', + ofChain( + ofHatchAdder(GT_TileEntity_BioVat::addMaintenanceToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addOutputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addRadiationInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addEnergyInputToMachineList, CASING_INDEX, 1), + onElementPass(e -> e.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement('a', ofChain(isAir(), ofBlockAnyMeta(FluidLoader.bioFluidBlock))) + .addElement( + 'g', + ofGlassTiered((byte) 1, (byte) 127, (byte) 0, (te, v) -> te.mGlassTier = v, te -> te.mGlassTier, 1)) + .build(); @Override public IStructureDefinition getStructureDefinition() { @@ -143,24 +133,16 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Bacterial Vat") - .addInfo("Controller block for the Bacterial Vat") - .addInfo("For maximum efficiency boost keep the Output Hatch always half filled!") - .addSeparator() - .beginStructureBlock(5, 4, 5, false) - .addController("Front bottom center") + tt.addMachineType("Bacterial Vat").addInfo("Controller block for the Bacterial Vat") + .addInfo("For maximum efficiency boost keep the Output Hatch always half filled!").addSeparator() + .beginStructureBlock(5, 4, 5, false).addController("Front bottom center") .addCasingInfo("Clean Stainless Steel Casings", 19) .addOtherStructurePart("Glass", "Hollow two middle layers", 2) .addStructureInfo("The glass can be any glass, i.e. Tinkers Construct Clear Glass") - .addStructureInfo("Some Recipes need more advanced Glass Types") - .addMaintenanceHatch("Any casing", 1) - .addOtherStructurePart("Radio Hatch", "Any casing", 1) - .addInputBus("Any casing", 1) - .addOutputBus("Any casing", 1) - .addInputHatch("Any casing", 1) - .addOutputHatch("Any casing", 1) - .addEnergyHatch("Any casing", 1) - .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + .addStructureInfo("Some Recipes need more advanced Glass Types").addMaintenanceHatch("Any casing", 1) + .addOtherStructurePart("Radio Hatch", "Any casing", 1).addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1).addInputHatch("Any casing", 1).addOutputHatch("Any casing", 1) + .addEnergyHatch("Any casing", 1).toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -182,15 +164,11 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } private int getInputCapacity() { - return this.mInputHatches.stream() - .mapToInt(GT_MetaTileEntity_Hatch_Input::getCapacity) - .sum(); + return this.mInputHatches.stream().mapToInt(GT_MetaTileEntity_Hatch_Input::getCapacity).sum(); } private int getOutputCapacity() { - return this.mOutputHatches.stream() - .mapToInt(GT_MetaTileEntity_Hatch_Output::getCapacity) - .sum(); + return this.mOutputHatches.stream().mapToInt(GT_MetaTileEntity_Hatch_Output::getCapacity).sum(); } @Override @@ -218,8 +196,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa /** * Calculates the expected output multiplier based on the output hatch + * * @param recipeFluidOutput the recipe fluid output - * @param needEqual if the recipeFluidOutput should be equal to the fluid in the output hatch + * @param needEqual if the recipeFluidOutput should be equal to the fluid in the output hatch * @return the expected output multiplier */ private int getExpectedMultiplier(@Nullable FluidStack recipeFluidOutput, boolean needEqual) { @@ -294,7 +273,13 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa long tEnergy = V[tTier]; GT_Recipe gtRecipe = gtRecipeMap.findRecipe( - this.getBaseMetaTileEntity(), this.mLastRecipe, false, tEnergy, tFluids, itemStack, tInputs); + this.getBaseMetaTileEntity(), + this.mLastRecipe, + false, + tEnergy, + tFluids, + itemStack, + tInputs); if (gtRecipe == null) return false; @@ -307,9 +292,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa this.mNeededSievert = conditions[3]; - if (conditions[2] == 0 - ? (this.mSievert < this.mNeededSievert || this.mGlassTier < conditions[0]) - : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0])) return false; + if (conditions[2] == 0 ? (this.mSievert < this.mNeededSievert || this.mGlassTier < conditions[0]) + : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0])) + return false; this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; @@ -328,8 +313,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } } - this.mOutputFluids = - new FluidStack[] {new FluidStack(recipeFluidOutput, recipeFluidOutput.amount * this.mTimes)}; + this.mOutputFluids = new FluidStack[] { + new FluidStack(recipeFluidOutput, recipeFluidOutput.amount * this.mTimes) }; BW_Util.calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, tEnergy, this); @@ -372,8 +357,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 3, 0)) return false; - return this.mCasing >= 19 - && this.mRadHatches.size() <= 1 + return this.mCasing >= 19 && this.mRadHatches.size() <= 1 && this.mOutputHatches.size() == 1 && this.mMaintenanceHatches.size() == 1 && this.mInputHatches.size() > 0 @@ -398,9 +382,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa private void sendAllRequiredRendererPackets() { int height = this.reCalculateHeight(); if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) { - for (int x = -1; x < 2; x++) - for (int y = 1; y < height; y++) - for (int z = -1; z < 2; z++) this.sendPackagesOrRenewRenderer(x, y, z, this.mCulture); + for (int x = -1; x < 2; x++) for (int y = 1; y < height; y++) + for (int z = -1; z < 2; z++) this.sendPackagesOrRenewRenderer(x, y, z, this.mCulture); } } @@ -408,11 +391,12 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; - GT_TileEntity_BioVat.staticColorMap.remove(new Coords( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId)); + GT_TileEntity_BioVat.staticColorMap.remove( + new Coords( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId)); GT_TileEntity_BioVat.staticColorMap.put( new Coords( xDir + x + this.getBaseMetaTileEntity().getXCoord(), @@ -462,8 +446,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa Chunk tChunk = aWorld.getChunkFromBlockCoords( this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord()); - if (tPlayer.getServerForPlayer() - .getPlayerManager() + if (tPlayer.getServerForPlayer().getPlayerManager() .isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { if (!this.playerMPHashSet.contains(tPlayer)) { this.playerMPHashSet.add(tPlayer); @@ -480,39 +463,27 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; this.height = this.reCalculateHeight(); - if (this.mFluid != null && this.height > 1 && this.reCalculateFluidAmmount() > 0) - for (int x = -1; x < 2; x++) { - for (int y = 0; y < this.height; y++) { - for (int z = -1; z < 2; z++) { - if (this.getBaseMetaTileEntity() - .getWorld() - .getBlock( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord()) - .equals(Blocks.air)) - this.getBaseMetaTileEntity() - .getWorld() - .setBlock( - xDir - + x - + this.getBaseMetaTileEntity() - .getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir - + z - + this.getBaseMetaTileEntity() - .getZCoord(), - FluidLoader.bioFluidBlock); - } + if (this.mFluid != null && this.height > 1 && this.reCalculateFluidAmmount() > 0) for (int x = -1; x < 2; x++) { + for (int y = 0; y < this.height; y++) { + for (int z = -1; z < 2; z++) { + if (this.getBaseMetaTileEntity().getWorld() + .getBlock( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord()) + .equals(Blocks.air)) + this.getBaseMetaTileEntity().getWorld().setBlock( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord(), + FluidLoader.bioFluidBlock); } } + } } private int reCalculateFluidAmmount() { - return this.getStoredFluids().stream() - .mapToInt(fluidStack -> fluidStack.amount) - .sum(); + return this.getStoredFluids().stream().mapToInt(fluidStack -> fluidStack.amount).sum(); } private int reCalculateHeight() { @@ -526,14 +497,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa if (this.mMachine) { ItemStack aStack = this.mInventory[1]; BioCulture lCulture = null; - int xDir = ForgeDirection.getOrientation( - this.getBaseMetaTileEntity().getBackFacing()) - .offsetX - * 2; - int zDir = ForgeDirection.getOrientation( - this.getBaseMetaTileEntity().getBackFacing()) - .offsetZ - * 2; + int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; + int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; if (this.getBaseMetaTileEntity().getTimer() % 200 == 0) { this.check_Chunk(); @@ -541,44 +506,28 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa if (this.needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 0) { - for (int x = -1; x < 2; x++) - for (int y = 1; y < 3; y++) - for (int z = -1; z < 2; z++) - this.getBaseMetaTileEntity() - .getWorld() - .setBlockToAir( - xDir - + x - + this.getBaseMetaTileEntity() - .getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir - + z - + this.getBaseMetaTileEntity() - .getZCoord()); + for (int x = -1; x < 2; x++) for (int y = 1; y < 3; y++) + for (int z = -1; z < 2; z++) this.getBaseMetaTileEntity().getWorld().setBlockToAir( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord()); } this.height = this.reCalculateHeight(); if (this.mFluid != null && this.height > 1 && this.reCalculateFluidAmmount() > 0) { - if ((!(BW_Util.areStacksEqualOrNull(aStack, this.mStack))) - || (this.needsVisualUpdate - && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER - == 1)) { + if ((!(BW_Util.areStacksEqualOrNull(aStack, this.mStack))) || (this.needsVisualUpdate + && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1)) { for (int x = -1; x < 2; x++) { for (int y = 1; y < this.height; y++) { for (int z = -1; z < 2; z++) { if (aStack == null || aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0) { - if (this.mCulture == null - || aStack == null + if (this.mCulture == null || aStack == null || aStack.getTagCompound() == null - || this.mCulture.getID() - != aStack.getTagCompound() - .getInteger("ID")) { - lCulture = aStack == null || aStack.getTagCompound() == null - ? null - : BioCulture.getBioCulture(aStack.getTagCompound() - .getString("Name")); + || this.mCulture.getID() != aStack.getTagCompound().getInteger("ID")) { + lCulture = aStack == null || aStack.getTagCompound() == null ? null + : BioCulture + .getBioCulture(aStack.getTagCompound().getString("Name")); this.sendPackagesOrRenewRenderer(x, y, z, lCulture); } } @@ -626,8 +575,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa aNBT.setString("mCulture", this.mCulture.getName()); else if ((this.mCulture == null || this.mCulture.getName().isEmpty()) && !aNBT.getString("mCulture").isEmpty()) { - aNBT.removeTag("mCulture"); - } + aNBT.removeTag("mCulture"); + } if (this.mFluid != null) aNBT.setString("mFluid", this.mFluid.getName()); aNBT.setInteger("mSievert", this.mSievert); aNBT.setInteger("mNeededSievert", this.mNeededSievert); @@ -641,46 +590,35 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa for (int x = -1; x < 2; x++) { for (int y = 1; y < 3; y++) { for (int z = -1; z < 2; z++) { - if (this.getBaseMetaTileEntity() - .getWorld() + if (this.getBaseMetaTileEntity().getWorld() .getBlock( xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()) .equals(FluidLoader.bioFluidBlock)) - this.getBaseMetaTileEntity() - .getWorld() - .setBlockToAir( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord()); + this.getBaseMetaTileEntity().getWorld().setBlockToAir( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord()); GT_TileEntity_BioVat.staticColorMap.remove( new Coords( xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()), this.getBaseMetaTileEntity().getWorld().provider.dimensionId); - if (SideReference.Side.Server) - MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( - this.getBaseMetaTileEntity().getWorld(), - new RendererPacket( - new Coords( - xDir - + x - + this.getBaseMetaTileEntity() - .getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir - + z - + this.getBaseMetaTileEntity() - .getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId), - this.mCulture == null - ? BioCulture.NULLCULTURE.getColorRGB() - : this.mCulture.getColorRGB(), - true), - this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getZCoord()); + if (SideReference.Side.Server) MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( + this.getBaseMetaTileEntity().getWorld(), + new RendererPacket( + new Coords( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId), + this.mCulture == null ? BioCulture.NULLCULTURE.getColorRGB() + : this.mCulture.getColorRGB(), + true), + this.getBaseMetaTileEntity().getXCoord(), + this.getBaseMetaTileEntity().getZCoord()); } } } @@ -708,41 +646,19 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - if (aActive) - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW) - .extFacing() - .glow() - .build() - }; - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW) - .extFacing() - .glow() - .build() - }; + if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow() + .build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow() + .build() }; } - return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) }; } @Override @@ -759,13 +675,15 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa // here we must check the machine is well-formed as otherwise getExpectedMultiplier might error out! infoData[infoData.length - 2] = StatCollector.translateToLocal("BW.infoData.BioVat.expectedProduction") + ": " + EnumChatFormatting.GREEN - + (mMachine - ? (mMaxProgresstime <= 0 ? getExpectedMultiplier(null, false) : mExpectedMultiplier) * 100 + + (mMachine ? (mMaxProgresstime <= 0 ? getExpectedMultiplier(null, false) : mExpectedMultiplier) * 100 : -1) - + EnumChatFormatting.RESET + " %"; - infoData[infoData.length - 1] = - StatCollector.translateToLocal("BW.infoData.BioVat.production") + ": " + EnumChatFormatting.GREEN - + (mMaxProgresstime <= 0 ? 0 : mTimes) * 100 + EnumChatFormatting.RESET + " %"; + + EnumChatFormatting.RESET + + " %"; + infoData[infoData.length - 1] = StatCollector.translateToLocal("BW.infoData.BioVat.production") + ": " + + EnumChatFormatting.GREEN + + (mMaxProgresstime <= 0 ? 0 : mTimes) * 100 + + EnumChatFormatting.RESET + + " %"; return infoData; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index d3254fc894..01cf3bd854 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; @@ -31,6 +22,14 @@ import static gregtech.api.enums.SoundResource.IC2_MACHINES_MAGNETIZER_LOOP; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; + import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; @@ -40,6 +39,7 @@ import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructa import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -54,59 +54,39 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; -public class GT_TileEntity_CircuitAssemblyLine - extends GT_MetaTileEntity_EnhancedMultiBlockBase - implements ISurvivalConstructable { +public class GT_TileEntity_CircuitAssemblyLine extends + GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable { private static final int CASING_INDEX = 16; private static final String STRUCTURE_PIECE_FIRST = "first"; private static final String STRUCTURE_PIECE_NEXT = "next"; - private static final IStructureDefinition STRUCTURE_DEFINITION = - StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_FIRST, transpose(new String[][] { - {"~", "G", "G"}, - {"g", "l", "g"}, - {"b", "i", "b"}, - })) - .addShape(STRUCTURE_PIECE_NEXT, transpose(new String[][] { - {"G", "G", "G"}, - {"g", "l", "g"}, - {"b", "I", "b"}, - })) - .addElement( - 'G', - buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) - .atLeast(Energy) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(GregTech_API.sBlockCasings3, 10)) - .addElement('g', ofGlassTieredMixed((byte) 4, (byte) 127, 5)) - .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 5)) // assembling line casings - .addElement( - 'b', - buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) - .atLeast(InputHatch, Maintenance) - .casingIndex(CASING_INDEX) - .dot(2) - .buildAndChain(GregTech_API.sBlockCasings2, 0)) - .addElement('i', InputBus.newAny(CASING_INDEX, 3)) - .addElement( - 'I', - buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) - .atLeast(InputHatch, InputBus, OutputBus) - .casingIndex(CASING_INDEX) - .dot(2) - .buildAndChain(GregTech_API.sBlockCasings2, 0)) - .build(); + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape( + STRUCTURE_PIECE_FIRST, + transpose(new String[][] { { "~", "G", "G" }, { "g", "l", "g" }, { "b", "i", "b" }, })) + .addShape( + STRUCTURE_PIECE_NEXT, + transpose(new String[][] { { "G", "G", "G" }, { "g", "l", "g" }, { "b", "I", "b" }, })) + .addElement( + 'G', + buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class).atLeast(Energy).casingIndex(CASING_INDEX) + .dot(1).buildAndChain(GregTech_API.sBlockCasings3, 10)) + .addElement('g', ofGlassTieredMixed((byte) 4, (byte) 127, 5)) + .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 5)) // assembling line casings + .addElement( + 'b', + buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class).atLeast(InputHatch, Maintenance) + .casingIndex(CASING_INDEX).dot(2).buildAndChain(GregTech_API.sBlockCasings2, 0)) + .addElement('i', InputBus.newAny(CASING_INDEX, 3)) + .addElement( + 'I', + buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class).atLeast(InputHatch, InputBus, OutputBus) + .casingIndex(CASING_INDEX).dot(2).buildAndChain(GregTech_API.sBlockCasings2, 0)) + .build(); @Override public IStructureDefinition getStructureDefinition() { @@ -115,15 +95,12 @@ public class GT_TileEntity_CircuitAssemblyLine protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Circuit Assembler") - .addInfo("Controller block for the Circuit Assembly Line") + tt.addMachineType("Circuit Assembler").addInfo("Controller block for the Circuit Assembly Line") .addInfo("Imprint this machine with a Circuit Imprint,") .addInfo("by putting the imprint in the controller") .addInfo("Every Circuit Assembly Line can only be imprinted ONCE") - .addInfo("Does not lose efficiency when overclocked") - .addInfo(BW_Tooltip_Reference.TT_BLUEPRINT) - .addSeparator() - .beginVariableStructureBlock(2, 7, 3, 3, 3, 3, false) + .addInfo("Does not lose efficiency when overclocked").addInfo(BW_Tooltip_Reference.TT_BLUEPRINT) + .addSeparator().beginVariableStructureBlock(2, 7, 3, 3, 3, 3, false) .addStructureInfo("From Bottom to Top, Left to Right") .addStructureInfo( "Layer 1 - Solid Steel Machine Casing, Input bus (Last Output bus), Solid Steel Machine Casing") @@ -132,9 +109,10 @@ public class GT_TileEntity_CircuitAssemblyLine .addStructureInfo("Up to 7 repeating slices, last is Output Bus") .addController("Layer 3 first slice front") .addOtherStructurePart( - "1x " + StatCollector.translateToLocal("GT5U.MBTT.EnergyHatch"), "Any layer 3 casing", 1) - .addInputHatch("Any layer 1 casing", 2) - .addInputBus("As specified on layer 1", 3, 4) + "1x " + StatCollector.translateToLocal("GT5U.MBTT.EnergyHatch"), + "Any layer 3 casing", + 1) + .addInputHatch("Any layer 1 casing", 2).addInputBus("As specified on layer 1", 3, 4) .addOutputBus("As specified in final slice on layer 1", 4) .addOtherStructurePart("EV+ Tier Glass", "As specified on layer 2", 5) .addMaintenanceHatch("Any layer 1 casing", 2) @@ -162,8 +140,7 @@ public class GT_TileEntity_CircuitAssemblyLine private boolean imprintMachine(ItemStack itemStack) { if (!this.type.equals(new NBTTagCompound())) return true; if (!GT_Utility.isStackValid(itemStack)) return false; - if (itemStack.getItem() instanceof BW_Meta_Items.BW_GT_MetaGenCircuits - && itemStack.getItemDamage() == 0 + if (itemStack.getItem() instanceof BW_Meta_Items.BW_GT_MetaGenCircuits && itemStack.getItemDamage() == 0 && itemStack.getTagCompound() != null && this.type.equals(new NBTTagCompound())) { this.type = itemStack.getTagCompound(); @@ -211,12 +188,11 @@ public class GT_TileEntity_CircuitAssemblyLine public boolean checkRecipe(ItemStack itemStack) { if (this.type.equals(new NBTTagCompound())) if (!this.imprintMachine(itemStack)) return false; - if (this.bufferedRecipe != null - && this.bufferedRecipe.isRecipeInputEqual( - true, - false, - BW_Util.getFluidsFromInputHatches(this), - getStoredInputs().toArray(new ItemStack[0]))) { + if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual( + true, + false, + BW_Util.getFluidsFromInputHatches(this), + getStoredInputs().toArray(new ItemStack[0]))) { setRecipeStats(); return true; } @@ -238,7 +214,8 @@ public class GT_TileEntity_CircuitAssemblyLine true, false, BW_Util.getFluidsFromInputHatches(this), - getStoredInputs().toArray(new ItemStack[0]))) this.bufferedRecipe = recipe; + getStoredInputs().toArray(new ItemStack[0]))) + this.bufferedRecipe = recipe; else continue; this.setRecipeStats(); @@ -249,7 +226,10 @@ public class GT_TileEntity_CircuitAssemblyLine private void setRecipeStats() { calculatePerfectOverclockedNessMulti( - this.bufferedRecipe.mEUt, this.bufferedRecipe.mDuration, 1, this.getMaxInputVoltage()); + this.bufferedRecipe.mEUt, + this.bufferedRecipe.mDuration, + 1, + this.getMaxInputVoltage()); if (this.mEUt > 0) this.mEUt = -this.mEUt; this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; @@ -349,48 +329,24 @@ public class GT_TileEntity_CircuitAssemblyLine String[] oldInfo = super.getInfoData(); infoDataBuffer = new String[oldInfo.length + 1]; System.arraycopy(oldInfo, 0, infoDataBuffer, 0, oldInfo.length); - infoDataBuffer[oldInfo.length] = "Imprinted with: " - + GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName( - CircuitImprintLoader.getStackFromTag(this.type))); + infoDataBuffer[oldInfo.length] = "Imprinted with: " + GT_LanguageManager.getTranslation( + GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); return infoDataBuffer; } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - if (aActive) - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW) - .extFacing() - .glow() - .build() - }; - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW) - .extFacing() - .glow() - .build() - }; + if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW).extFacing().glow() + .build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW).extFacing().glow().build() }; } - return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) }; } public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java index 268a26686d..2f14088a3d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java @@ -1,37 +1,31 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MathUtils; + import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DistillationTower; -import java.util.ArrayList; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_DistillationTower { @@ -57,11 +51,14 @@ public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_Distil array = fluidInputs.toArray(array); GT_Recipe.GT_Recipe_Map rMapCracking = GT_Recipe.GT_Recipe_Map.sCrakingRecipes; GT_Recipe.GT_Recipe_Map rMapDistillTower = GT_Recipe.GT_Recipe_Map.sDistillationRecipes; - GT_Recipe recipeCracking = rMapCracking.findRecipe( - this.getBaseMetaTileEntity(), false, this.getMaxInputVoltage(), array, itemStack); + GT_Recipe recipeCracking = rMapCracking + .findRecipe(this.getBaseMetaTileEntity(), false, this.getMaxInputVoltage(), array, itemStack); if (recipeCracking == null) return false; GT_Recipe recipeDistill = rMapDistillTower.findRecipe( - this.getBaseMetaTileEntity(), false, this.getMaxInputVoltage(), recipeCracking.mFluidOutputs); + this.getBaseMetaTileEntity(), + false, + this.getMaxInputVoltage(), + recipeCracking.mFluidOutputs); if (recipeDistill == null) return false; float ratio = (float) recipeCracking.mFluidOutputs[0].amount / (float) recipeDistill.mFluidInputs[0].amount; FluidStack[] nuoutputs = new FluidStack[recipeDistill.mFluidOutputs.length]; @@ -84,7 +81,11 @@ public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_Distil this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; BW_Util.calculateOverclockedNessMulti( - combined.mEUt, combined.mDuration, 1, this.getMaxInputVoltage(), this); + combined.mEUt, + combined.mDuration, + 1, + this.getMaxInputVoltage(), + this); if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { this.mEUt = (-this.mEUt); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index a420fa6933..90cbda832b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; @@ -25,7 +16,17 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; import static gregtech.api.enums.GT_Values.VN; +import java.lang.reflect.Field; +import java.util.Arrays; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; + import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -38,15 +39,9 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; import ic2.core.block.reactor.tileentity.TileEntityNuclearReactorElectric; -import java.lang.reflect.Field; -import java.util.Arrays; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { + private static float nulearHeatMod = 2f; private byte mMode; private byte mTier; @@ -69,12 +64,8 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { Field f = c.getDeclaredField("huOutputModifier"); f.setAccessible(true); GT_TileEntity_DEHP.nulearHeatMod = f.getFloat(f); - } catch (SecurityException - | IllegalArgumentException - | ExceptionInInitializerError - | NullPointerException - | IllegalAccessException - | NoSuchFieldException e) { + } catch (SecurityException | IllegalArgumentException | ExceptionInInitializerError | NullPointerException + | IllegalAccessException | NoSuchFieldException e) { e.printStackTrace(); } super.onConfigLoad(aConfig); @@ -103,35 +94,31 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); String casings = getCasingBlockItem().get(0).getDisplayName(); - tt.addMachineType("Geothermal Heat Pump") - .addInfo("Consumes " + GT_Values.V[this.mTier + 2] + "EU/t") + tt.addMachineType("Geothermal Heat Pump").addInfo("Consumes " + GT_Values.V[this.mTier + 2] + "EU/t") .addInfo("Has 4 Modes, use the Screwdriver to change them:"); if (ConfigHandler.DEHPDirectSteam) { tt.addInfo("0 Idle, 1 Steam, 2 Superheated Steam (requires Distilled Water), 3 Retract") .addInfo("Explodes when it runs out of Water/Distilled Water") - .addInfo("Converts " + (long) (this.mTier * 1200 * 20) - + "L/s Water(minus 10% per Maintenance Problem) to Steam") - .addInfo("Converts " + (long) (this.mTier * 600 * 20) - + "L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"); + .addInfo( + "Converts " + (long) (this.mTier * 1200 * 20) + + "L/s Water(minus 10% per Maintenance Problem) to Steam") + .addInfo( + "Converts " + (long) (this.mTier * 600 * 20) + + "L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"); } else { tt.addInfo("0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract") - .addInfo("Explodes when it runs out of Coolant") - .addInfo("Heats up " + (long) (this.mTier * 24 * ((double) GT_TileEntity_DEHP.nulearHeatMod)) * 20 - + "L/s Coolant(minus 10% per Maintenance Problem)"); + .addInfo("Explodes when it runs out of Coolant").addInfo( + "Heats up " + (long) (this.mTier * 24 * ((double) GT_TileEntity_DEHP.nulearHeatMod)) * 20 + + "L/s Coolant(minus 10% per Maintenance Problem)"); } - tt.addSeparator() - .beginStructureBlock(3, 7, 3, false) - .addController("Front bottom") + tt.addSeparator().beginStructureBlock(3, 7, 3, false).addController("Front bottom") .addOtherStructurePart(casings, "form the 3x1x3 Base") .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") - .addEnergyHatch(VN[getMinTier()] + "+, Any base casing") - .addMaintenanceHatch("Any base casing") - .addInputBus("Mining Pipes, optional, any base casing") - .addInputHatch("Any base casing") - .addOutputHatch("Any base casing") - .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing").addMaintenanceHatch("Any base casing") + .addInputBus("Mining Pipes, optional, any base casing").addInputHatch("Any base casing") + .addOutputHatch("Any base casing").toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); return tt; } @@ -174,22 +161,21 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { if (onlyDistilled) toConsume1 = toConsume2; long ret = 0; for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { - if (ih.getFluid().getFluid().equals(toConsume1) - || ih.getFluid().getFluid().equals(toConsume2)) ret += ih.getFluidAmount(); + if (ih.getFluid().getFluid().equals(toConsume1) || ih.getFluid().getFluid().equals(toConsume2)) + ret += ih.getFluidAmount(); } return ret; } @Override - protected boolean workingUpward( - ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, + int yHead, int oldYHead) { if (this.mMode != 3) { this.isPickingPipes = false; try { Field workState = this.getClass().getField("workState"); workState.setInt(this, 0); - } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException ignored) { - } + } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException ignored) {} return true; } return super.workingUpward(aStack, xDrill, yDrill, zDrill, xPipe, zPipe, yHead, oldYHead); @@ -204,15 +190,14 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); } - protected boolean workingDownward( - ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, + int yHead, int oldYHead) { if (this.mMode == 3) { this.isPickingPipes = true; try { Field workState = this.getClass().getSuperclass().getDeclaredField("workState"); workState.setInt(this, 2); - } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException ignored) { - } + } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException ignored) {} return true; } @@ -247,8 +232,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { } } else { if (this.mMode == 1 || this.mMode == 2) { - long coolantConverted = (long) (this.mTier - * 24 + long coolantConverted = (long) (this.mTier * 24 * ((double) GT_TileEntity_DEHP.nulearHeatMod) * this.mEfficiency / 10000L); @@ -276,11 +260,9 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid().getFluid().equals(fluid) - || ih.getFluid() - .getFluid() - .equals(GT_ModHandler.getDistilledWater(1) - .getFluid()) - : ih.getFluid().getFluid().equals(fluid)) tmp[i] -= ih.drain((int) ammount, true).amount; + || ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) + : ih.getFluid().getFluid().equals(fluid)) + tmp[i] -= ih.drain((int) ammount, true).amount; if (tmp[i] <= 0) break; } } @@ -292,10 +274,9 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid().getFluid().equals(fluid) - || ih.getFluid() - .getFluid() - .equals(GT_ModHandler.getDistilledWater(1).getFluid()) - : ih.getFluid().getFluid().equals(fluid)) tmp -= ih.drain((int) ammount, true).amount; + || ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) + : ih.getFluid().getFluid().equals(fluid)) + tmp -= ih.drain((int) ammount, true).amount; if (tmp <= 0) return true; } return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 17ddf53248..c4e89b4105 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; @@ -29,6 +20,15 @@ import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import java.util.ArrayList; + +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.renderer.BW_EICPistonVisualizer; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -41,6 +41,7 @@ import com.gtnewhorizon.structurelib.structure.AutoPlaceEnvironment; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -55,13 +56,6 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import java.util.ArrayList; -import net.minecraft.client.Minecraft; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidStack; public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity_EnhancedMultiBlockBase { @@ -82,110 +76,78 @@ public class GT_TileEntity_ElectricImplosionCompressor private static final int CASING_INDEX = 16; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition STRUCTURE_DEFINITION = - StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { - {"ccc", "cec", "ccc"}, - {"ttt", "tft", "ttt"}, - {"ttt", "tft", "ttt"}, - {"nnn", "nnn", "nnn"}, - {"nNn", "NNN", "nNn"}, - {"nnn", "nnn", "nnn"}, - {"t~t", "tft", "ttt"}, - {"ttt", "tft", "ttt"}, - {"CCC", "CeC", "CCC"}, - })) - .addElement( - 'c', - ofChain(ofBlock(GregTech_API.sBlockCasings2, 0), ofBlock(GregTech_API.sBlockCasings3, 4))) - .addElement('t', ofBlock(BW_BLOCKS[2], 1)) - .addElement('f', ofBlock(BW_BLOCKS[2], 0)) - .addElement('n', ofBlock(GregTech_API.sBlockMetal5, 2)) - .addElement( - 'C', - ofChain( - ofHatchAdder( - GT_TileEntity_ElectricImplosionCompressor::addInputToMachineList, - CASING_INDEX, - 1), - ofHatchAdder( - GT_TileEntity_ElectricImplosionCompressor::addOutputToMachineList, - CASING_INDEX, - 1), - ofHatchAdder( - GT_TileEntity_ElectricImplosionCompressor::addMaintenanceToMachineList, - CASING_INDEX, - 1), - ofBlock(GregTech_API.sBlockCasings2, 0), - ofBlock(GregTech_API.sBlockCasings3, 4))) - .addElement( - 'e', + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { "ccc", "cec", "ccc" }, { "ttt", "tft", "ttt" }, { "ttt", "tft", "ttt" }, + { "nnn", "nnn", "nnn" }, { "nNn", "NNN", "nNn" }, { "nnn", "nnn", "nnn" }, + { "t~t", "tft", "ttt" }, { "ttt", "tft", "ttt" }, { "CCC", "CeC", "CCC" }, })) + .addElement('c', ofChain(ofBlock(GregTech_API.sBlockCasings2, 0), ofBlock(GregTech_API.sBlockCasings3, 4))) + .addElement('t', ofBlock(BW_BLOCKS[2], 1)).addElement('f', ofBlock(BW_BLOCKS[2], 0)) + .addElement('n', ofBlock(GregTech_API.sBlockMetal5, 2)) + .addElement( + 'C', + ofChain( ofHatchAdder( - GT_TileEntity_ElectricImplosionCompressor::addEnergyInputToMachineList, + GT_TileEntity_ElectricImplosionCompressor::addInputToMachineList, CASING_INDEX, - 2)) - .addElement('N', new IStructureElement() { - - @Override - public boolean check( - GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z) { - if (!te.piston && !world.isAirBlock(x, y, z)) return false; - if (te.piston - && !(world.getBlock(x, y, z) == GregTech_API.sBlockMetal5 - && world.getBlockMetadata(x, y, z) == 2)) return false; - return true; - } - - @Override - public boolean spawnHint( - GT_TileEntity_ElectricImplosionCompressor te, - World world, - int x, - int y, - int z, - ItemStack itemStack) { - if (te.piston) StructureLibAPI.hintParticle(world, x, y, z, GregTech_API.sBlockMetal5, 2); - return true; - } - - @Override - public boolean placeBlock( - GT_TileEntity_ElectricImplosionCompressor te, - World world, - int x, - int y, - int z, - ItemStack itemStack) { - if (te.piston) world.setBlock(x, y, z, GregTech_API.sBlockMetal5, 2, 3); - else world.setBlockToAir(x, y, z); - return true; - } - - @Override - public BlocksToPlace getBlocksToPlace( - GT_TileEntity_ElectricImplosionCompressor t, - World world, - int x, - int y, - int z, - ItemStack trigger, - AutoPlaceEnvironment env) { - return BlocksToPlace.createEmpty(); - } - - @Override - public PlaceResult survivalPlaceBlock( - GT_TileEntity_ElectricImplosionCompressor t, - World world, - int x, - int y, - int z, - ItemStack trigger, - AutoPlaceEnvironment env) { - return isAir().survivalPlaceBlock(t, world, x, y, z, trigger, env); - } - }) - .build(); + 1), + ofHatchAdder( + GT_TileEntity_ElectricImplosionCompressor::addOutputToMachineList, + CASING_INDEX, + 1), + ofHatchAdder( + GT_TileEntity_ElectricImplosionCompressor::addMaintenanceToMachineList, + CASING_INDEX, + 1), + ofBlock(GregTech_API.sBlockCasings2, 0), + ofBlock(GregTech_API.sBlockCasings3, 4))) + .addElement( + 'e', + ofHatchAdder( + GT_TileEntity_ElectricImplosionCompressor::addEnergyInputToMachineList, + CASING_INDEX, + 2)) + .addElement('N', new IStructureElement() { + + @Override + public boolean check(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z) { + if (!te.piston && !world.isAirBlock(x, y, z)) return false; + if (te.piston && !(world.getBlock(x, y, z) == GregTech_API.sBlockMetal5 + && world.getBlockMetadata(x, y, z) == 2)) + return false; + return true; + } + + @Override + public boolean spawnHint(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z, + ItemStack itemStack) { + if (te.piston) StructureLibAPI.hintParticle(world, x, y, z, GregTech_API.sBlockMetal5, 2); + return true; + } + + @Override + public boolean placeBlock(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, + int z, ItemStack itemStack) { + if (te.piston) world.setBlock(x, y, z, GregTech_API.sBlockMetal5, 2, 3); + else world.setBlockToAir(x, y, z); + return true; + } + + @Override + public BlocksToPlace getBlocksToPlace(GT_TileEntity_ElectricImplosionCompressor t, World world, int x, + int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { + return BlocksToPlace.createEmpty(); + } + + @Override + public PlaceResult survivalPlaceBlock(GT_TileEntity_ElectricImplosionCompressor t, World world, int x, + int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { + return isAir().survivalPlaceBlock(t, world, x, y, z, trigger, env); + } + }).build(); @Override public IStructureDefinition getStructureDefinition() { @@ -200,23 +162,16 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Implosion Compressor") - .addInfo("Explosions are fun") + tt.addMachineType("Implosion Compressor").addInfo("Explosions are fun") .addInfo("Controller block for the Electric Implosion Compressor") - .addInfo("Uses electricity instead of Explosives") - .addSeparator() - .beginStructureBlock(3, 9, 3, false) - .addController("Front 3rd layer center") - .addCasingInfo("Solid Steel Machine Casing", 8) + .addInfo("Uses electricity instead of Explosives").addSeparator().beginStructureBlock(3, 9, 3, false) + .addController("Front 3rd layer center").addCasingInfo("Solid Steel Machine Casing", 8) .addStructureInfo("Casings can be replaced with Explosion Warning Signs") .addOtherStructurePart("Transformer-Winding Blocks", "Outer layer 2,3,7,8") .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Inner layer 2,3,7,8") - .addOtherStructurePart("Neutronium Blocks", "Layer 4,5,6") - .addMaintenanceHatch("Any bottom casing", 1) - .addInputBus("Any bottom casing", 1) - .addInputHatch("Any bottom casing", 1) - .addOutputBus("Any bottom casing", 1) - .addEnergyHatch("Bottom and top middle", 2) + .addOtherStructurePart("Neutronium Blocks", "Layer 4,5,6").addMaintenanceHatch("Any bottom casing", 1) + .addInputBus("Any bottom casing", 1).addInputHatch("Any bottom casing", 1) + .addOutputBus("Any bottom casing", 1).addEnergyHatch("Bottom and top middle", 2) .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -224,8 +179,7 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override public boolean checkRecipe(ItemStack aStack) { - if (this.mEnergyHatches.get(0).getEUVar() <= 0 - || this.mEnergyHatches.get(1).getEUVar() <= 0) return false; + if (this.mEnergyHatches.get(0).getEUVar() <= 0 || this.mEnergyHatches.get(1).getEUVar() <= 0) return false; ItemStack[] tItemInputs = getCompactedInputs(); FluidStack[] tFluidInputs = getCompactedFluids(); @@ -256,18 +210,17 @@ public class GT_TileEntity_ElectricImplosionCompressor private void updateChunkCoordinates() { chunkCoordinates.clear(); - for (int x = -1; x <= 1; x++) - for (int z = -1; z <= 1; z++) { - if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) { - int[] abc = new int[] {x, -2, z + 1}; - int[] xyz = new int[] {0, 0, 0}; - this.getExtendedFacing().getWorldOffset(abc, xyz); - xyz[0] += this.getBaseMetaTileEntity().getXCoord(); - xyz[1] += this.getBaseMetaTileEntity().getYCoord(); - xyz[2] += this.getBaseMetaTileEntity().getZCoord(); - chunkCoordinates.add(new ChunkCoordinates(xyz[0], xyz[1], xyz[2])); - } + for (int x = -1; x <= 1; x++) for (int z = -1; z <= 1; z++) { + if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) { + int[] abc = new int[] { x, -2, z + 1 }; + int[] xyz = new int[] { 0, 0, 0 }; + this.getExtendedFacing().getWorldOffset(abc, xyz); + xyz[0] += this.getBaseMetaTileEntity().getXCoord(); + xyz[1] += this.getBaseMetaTileEntity().getYCoord(); + xyz[2] += this.getBaseMetaTileEntity().getZCoord(); + chunkCoordinates.add(new ChunkCoordinates(xyz[0], xyz[1], xyz[2])); } + } } @Override @@ -282,7 +235,8 @@ public class GT_TileEntity_ElectricImplosionCompressor GT_MetaTileEntity_Hatch_Energy h1 = this.mEnergyHatches.get(0), h2 = this.mEnergyHatches.get(1); if (!isValidMetaTileEntity(h1) || !isValidMetaTileEntity(h2)) return false; if (!h1.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU / 2, false) - || !h2.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU / 2, false)) return false; + || !h2.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU / 2, false)) + return false; return true; } @@ -292,17 +246,16 @@ public class GT_TileEntity_ElectricImplosionCompressor if (pistonEnabled && aBaseMetaTileEntity.isActive() && aTick % 20 == 0) { if (aBaseMetaTileEntity.isClientSide()) animatePiston(aBaseMetaTileEntity); - else if (aBaseMetaTileEntity.hasMufflerUpgrade()) - MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( - aBaseMetaTileEntity.getWorld(), - new EICPacket( - new Coords( - aBaseMetaTileEntity.getXCoord(), - aBaseMetaTileEntity.getYCoord(), - aBaseMetaTileEntity.getZCoord()), - true), - aBaseMetaTileEntity.getXCoord(), - aBaseMetaTileEntity.getZCoord()); + else if (aBaseMetaTileEntity.hasMufflerUpgrade()) MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( + aBaseMetaTileEntity.getWorld(), + new EICPacket( + new Coords( + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord()), + true), + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getZCoord()); } } @@ -328,8 +281,9 @@ public class GT_TileEntity_ElectricImplosionCompressor IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); if (!aBaseMetaTileEntity.isServerSide()) return; if (!this.piston) { - chunkCoordinates.forEach(c -> - aBaseMetaTileEntity.getWorld().setBlock(c.posX, c.posY, c.posZ, GregTech_API.sBlockMetal5, 2, 3)); + chunkCoordinates.forEach( + c -> aBaseMetaTileEntity.getWorld() + .setBlock(c.posX, c.posY, c.posZ, GregTech_API.sBlockMetal5, 2, 3)); this.piston = !this.piston; } } @@ -347,15 +301,14 @@ public class GT_TileEntity_ElectricImplosionCompressor private void animatePiston(IGregTechTileEntity aBaseMetaTileEntity) { if (!aBaseMetaTileEntity.getWorld().isRemote) return; - if (!getBaseMetaTileEntity().hasMufflerUpgrade()) - GT_Utility.doSoundAtClient( - sound, - 10, - 1f, - 1f, - chunkCoordinates.get(0).posX, - chunkCoordinates.get(0).posY, - chunkCoordinates.get(0).posZ); + if (!getBaseMetaTileEntity().hasMufflerUpgrade()) GT_Utility.doSoundAtClient( + sound, + 10, + 1f, + 1f, + chunkCoordinates.get(0).posX, + chunkCoordinates.get(0).posY, + chunkCoordinates.get(0).posZ); spawnVisualPistonBlocks( aBaseMetaTileEntity.getWorld(), chunkCoordinates.get(2).posX, @@ -420,41 +373,19 @@ public class GT_TileEntity_ElectricImplosionCompressor return new GT_TileEntity_ElectricImplosionCompressor(this.mName); } - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - if (aActive) - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW) - .extFacing() - .glow() - .build() - }; - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW) - .extFacing() - .glow() - .build() - }; + if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW).extFacing().glow() + .build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW).extFacing().glow() + .build() }; } - return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) }; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index 7ddfca22b2..28527a171a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -1,18 +1,10 @@ /* - * Copyright (C) 2022 kuba6000 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Copyright (C) 2022 kuba6000 This program is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; @@ -23,6 +15,32 @@ import static gregtech.api.enums.GT_Values.AuthorKuba; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import java.io.IOException; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.BlockStem; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.*; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.IPlantable; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; @@ -43,6 +61,7 @@ import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.api.widget.Widget; import com.gtnewhorizons.modularui.common.widget.*; + import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -68,30 +87,6 @@ import ic2.api.crops.CropCard; import ic2.api.crops.Crops; import ic2.core.Ic2Items; import ic2.core.crop.TileEntityCrop; -import java.io.IOException; -import java.util.*; -import java.util.function.Function; -import java.util.stream.Collectors; -import net.minecraft.block.Block; -import net.minecraft.block.BlockFlower; -import net.minecraft.block.BlockStem; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.*; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import net.minecraftforge.common.IPlantable; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity_EnhancedMultiBlockBase { @@ -113,63 +108,59 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse private static final String STRUCTURE_PIECE_MAIN = "main"; private static final Item forestryfertilizer = GameRegistry.findItem("Forestry", "fertilizerCompound"); private static final Fluid weedex = Materials.WeedEX9000.mFluid; - private static final IStructureDefinition STRUCTURE_DEFINITION = - StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { - {"ccccc", "ccccc", "ccccc", "ccccc", "ccccc"}, - {"ccccc", "clllc", "clllc", "clllc", "ccccc"}, - {"ggggg", "g---g", "g---g", "g---g", "ggggg"}, - {"ggggg", "g---g", "g---g", "g---g", "ggggg"}, - {"ccccc", "cdddc", "cdwdc", "cdddc", "ccccc"}, - {"cc~cc", "cCCCc", "cCCCc", "cCCCc", "ccccc"}, - })) - .addElement( - 'c', - ofChain( - onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)), - ofHatchAdder( - GT_TileEntity_ExtremeIndustrialGreenhouse::addEnergyInputToMachineList, - CASING_INDEX, - 1), - ofHatchAdder( - GT_TileEntity_ExtremeIndustrialGreenhouse::addMaintenanceToMachineList, - CASING_INDEX, - 1), - ofHatchAdder( - GT_TileEntity_ExtremeIndustrialGreenhouse::addInputToMachineList, - CASING_INDEX, - 1), - ofHatchAdder( - GT_TileEntity_ExtremeIndustrialGreenhouse::addOutputToMachineList, - CASING_INDEX, - 1))) - .addElement('C', onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1))) - .addElement( - 'l', - LoaderReference.ProjRedIllumination - ? ofBlock( - Block.getBlockFromName("ProjRed|Illumination:projectred.illumination.lamp"), - 10) - : ofBlock(Blocks.redstone_lamp, 0)) - .addElement( - 'g', - debug - ? ofBlock(Blocks.glass, 0) - : BorosilicateGlass.ofBoroGlass( - (byte) 0, - (byte) 1, - Byte.MAX_VALUE, - (te, t) -> te.glasTier = t, - te -> te.glasTier)) - .addElement( - 'd', - ofBlock( - LoaderReference.RandomThings - ? Block.getBlockFromName("RandomThings:fertilizedDirt_tilled") - : Blocks.farmland, - 0)) - .addElement('w', ofBlock(Blocks.water, 0)) - .build(); + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { "ccccc", "ccccc", "ccccc", "ccccc", "ccccc" }, + { "ccccc", "clllc", "clllc", "clllc", "ccccc" }, + { "ggggg", "g---g", "g---g", "g---g", "ggggg" }, + { "ggggg", "g---g", "g---g", "g---g", "ggggg" }, + { "ccccc", "cdddc", "cdwdc", "cdddc", "ccccc" }, + { "cc~cc", "cCCCc", "cCCCc", "cCCCc", "ccccc" }, })) + .addElement( + 'c', + ofChain( + onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)), + ofHatchAdder( + GT_TileEntity_ExtremeIndustrialGreenhouse::addEnergyInputToMachineList, + CASING_INDEX, + 1), + ofHatchAdder( + GT_TileEntity_ExtremeIndustrialGreenhouse::addMaintenanceToMachineList, + CASING_INDEX, + 1), + ofHatchAdder( + GT_TileEntity_ExtremeIndustrialGreenhouse::addInputToMachineList, + CASING_INDEX, + 1), + ofHatchAdder( + GT_TileEntity_ExtremeIndustrialGreenhouse::addOutputToMachineList, + CASING_INDEX, + 1))) + .addElement('C', onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1))) + .addElement( + 'l', + LoaderReference.ProjRedIllumination + ? ofBlock(Block.getBlockFromName("ProjRed|Illumination:projectred.illumination.lamp"), 10) + : ofBlock(Blocks.redstone_lamp, 0)) + .addElement( + 'g', + debug ? ofBlock(Blocks.glass, 0) + : BorosilicateGlass.ofBoroGlass( + (byte) 0, + (byte) 1, + Byte.MAX_VALUE, + (te, t) -> te.glasTier = t, + te -> te.glasTier)) + .addElement( + 'd', + ofBlock( + LoaderReference.RandomThings ? Block.getBlockFromName("RandomThings:fertilizedDirt_tilled") + : Blocks.farmland, + 0)) + .addElement('w', ofBlock(Blocks.water, 0)).build(); public GT_TileEntity_ExtremeIndustrialGreenhouse(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -201,16 +192,14 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse if (this.setupphase == 3) this.setupphase = 0; GT_Utility.sendChatToPlayer( aPlayer, - "EIG is now running in " - + (this.setupphase == 1 - ? "setup mode (input)." - : (this.setupphase == 2 ? "setup mode (output)." : "normal operation."))); + "EIG is now running in " + (this.setupphase == 1 ? "setup mode (input)." + : (this.setupphase == 2 ? "setup mode (output)." : "normal operation."))); } } @Override - public boolean onWireCutterRightClick( - byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, + float aZ) { isNoHumidity = !isNoHumidity; GT_Utility.sendChatToPlayer(aPlayer, "Give incoming crops no humidity " + isNoHumidity); return true; @@ -238,10 +227,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Crop Farm") - .addInfo("Controller block for the Extreme Industrial Greenhouse") - .addInfo(AuthorKuba) - .addInfo("Grow your crops like a chad !") + tt.addMachineType("Crop Farm").addInfo("Controller block for the Extreme Industrial Greenhouse") + .addInfo(AuthorKuba).addInfo("Grow your crops like a chad !") .addInfo("Use screwdriver to enable/change/disable setup mode") .addInfo("Use screwdriver while sneaking to enable/disable IC2 mode") .addInfo("Use wire cutters to give incoming IC2 crops 0 humidity") @@ -249,15 +236,13 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse .addInfo("If there are >= 1000 crops -> Uses 1L of Weed-EX 9000 per crop per second") .addInfo("Otherwise, around 1% of crops will die each operation") .addInfo("You can insert fertilizer each operation to get more drops (max +400%)") - .addInfo("-------------------- SETUP MODE --------------------") - .addInfo("Does not take power") + .addInfo("-------------------- SETUP MODE --------------------").addInfo("Does not take power") .addInfo("There are two modes: input / output") .addInfo("Input mode: machine will take seeds from input bus and plant them") .addInfo("[IC2] You need to also input block that is required under the crop") .addInfo("Output mode: machine will take planted seeds and output them") .addInfo("-------------------- NORMAL CROPS --------------------") - .addInfo("Minimal tier: " + tierString(4)) - .addInfo("Starting with 1 slot") + .addInfo("Minimal tier: " + tierString(4)).addInfo("Starting with 1 slot") .addInfo("Every slot gives 64 crops") .addInfo("Every tier past " + tierString(4) + ", slots are multiplied by 2") .addInfo("Base process time: 5 sec") @@ -266,18 +251,12 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse .addInfo("Will automatically craft seeds if they are not dropped") .addInfo("1 Fertilizer per 1 crop +200%") .addInfo("-------------------- IC2 CROPS --------------------") - .addInfo("Minimal tier: " + tierString(6)) - .addInfo("Need " + tierString(6) + " glass tier") - .addInfo("Starting with 4 slots") - .addInfo("Every slot gives 1 crop") + .addInfo("Minimal tier: " + tierString(6)).addInfo("Need " + tierString(6) + " glass tier") + .addInfo("Starting with 4 slots").addInfo("Every slot gives 1 crop") .addInfo("Every tier past " + tierString(6) + ", slots are multiplied by 4") - .addInfo("Process time: 5 sec") - .addInfo("All crops are accelerated by x32 times") - .addInfo("1 Fertilizer per 1 crop +10%") - .addInfo(BW_Tooltip_Reference.TT_BLUEPRINT) - .addSeparator() - .beginStructureBlock(5, 6, 5, false) - .addController("Front bottom center") + .addInfo("Process time: 5 sec").addInfo("All crops are accelerated by x32 times") + .addInfo("1 Fertilizer per 1 crop +10%").addInfo(BW_Tooltip_Reference.TT_BLUEPRINT).addSeparator() + .beginStructureBlock(5, 6, 5, false).addController("Front bottom center") .addCasingInfo("Clean Stainless Steel Casings", 70) .addOtherStructurePart("Borosilicate Glass", "Hollow two middle layers") .addStructureInfo("The glass tier limits the Energy Input tier") @@ -309,8 +288,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse aNBT.setBoolean("isIC2Mode", isIC2Mode); aNBT.setBoolean("isNoHumidity", isNoHumidity); aNBT.setInteger("mStorageSize", mStorage.size()); - for (int i = 0; i < mStorage.size(); i++) - aNBT.setTag("mStorage." + i, mStorage.get(i).toNBTTagCompound()); + for (int i = 0; i < mStorage.size(); i++) aNBT.setTag("mStorage." + i, mStorage.get(i).toNBTTagCompound()); } @Override @@ -336,8 +314,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isClientSide()) { if (aBaseMetaTileEntity.isActive() && aTick % 40 == 0) { - int[] abc = new int[] {0, -2, 2}; - int[] xyz = new int[] {0, 0, 0}; + int[] abc = new int[] { 0, -2, 2 }; + int[] xyz = new int[] { 0, 0, 0 }; this.getExtendedFacing().getWorldOffset(abc, xyz); xyz[0] += aBaseMetaTileEntity.getXCoord(); xyz[1] += aBaseMetaTileEntity.getYCoord(); @@ -384,8 +362,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse updateMaxSlots(); if (oldVersion != EIG_MATH_VERSION) { - for (GreenHouseSlot slot : mStorage) - slot.recalculate(this, getBaseMetaTileEntity().getWorld()); + for (GreenHouseSlot slot : mStorage) slot.recalculate(this, getBaseMetaTileEntity().getWorld()); oldVersion = EIG_MATH_VERSION; } @@ -413,8 +390,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse while (mStorage.size() > 0) { if (!ignoreEmptiness && (emptySlots -= 2) < 0) break; this.addOutput(this.mStorage.get(0).input.copy()); - if (this.mStorage.get(0).undercrop != null) - this.addOutput(this.mStorage.get(0).undercrop.copy()); + if (this.mStorage.get(0).undercrop != null) this.addOutput(this.mStorage.get(0).undercrop.copy()); this.mStorage.remove(0); } } @@ -466,7 +442,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse if (weedexusage > 0 && !this.depleteInput(new FluidStack(weedex, isIC2Mode ? weedexusage * 5 : weedexusage))) { IGregTechTileEntity baseMTE = this.getBaseMetaTileEntity(); int tokill = baseMTE.getRandomNumber((int) ((double) weedexusage * 0.02d) + 1); - for (int i = 0; i < tokill; ) { + for (int i = 0; i < tokill;) { GreenHouseSlot removed = mStorage.remove(baseMTE.getRandomNumber(mStorage.size())); i -= removed.input.stackSize; } @@ -474,7 +450,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse // OVERCLOCK // FERTILIZER IDEA: - // IC2 +10% per fertilizer per crop per operation + // IC2 +10% per fertilizer per crop per operation // NORMAL +200% per fertilizer per crop per operation int boost = 0; @@ -563,98 +539,90 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse private final Function isFixed = widget -> getIdealStatus() == getRepairStatus() && mMachine; private static final Function toggleButtonBackgroundGetter = val -> { - if (val == 0) return new IDrawable[] {GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CROSS}; - else return new IDrawable[] {GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CHECKMARK}; + if (val == 0) return new IDrawable[] { GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CROSS }; + else return new IDrawable[] { GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CHECKMARK }; }; @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new DrawableWidget() - .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(7, 4) - .setSize(143, 75) - .setEnabled(widget -> !isFixed.apply(widget))); + builder.widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(7, 4).setSize(143, 75) + .setEnabled(widget -> !isFixed.apply(widget))); buildContext.addSyncedWindow(CONFIGURATION_WINDOW_ID, this::createConfigurationWindow); EntityPlayer player = buildContext.getPlayer(); // Slot is not needed - builder.widget(new DynamicPositionedColumn() - .setSynced(false) - .widget(new CycleButtonWidget() - .setToggle(() -> getBaseMetaTileEntity().isAllowedToWork(), works -> { + builder.widget( + new DynamicPositionedColumn().setSynced(false).widget( + new CycleButtonWidget().setToggle(() -> getBaseMetaTileEntity().isAllowedToWork(), works -> { if (works) getBaseMetaTileEntity().enableWorking(); else getBaseMetaTileEntity().disableWorking(); if (!(player instanceof EntityPlayerMP)) return; String tChat = GT_Utility.trans("090", "Machine Processing: ") - + (works - ? GT_Utility.trans("088", "Enabled") + + (works ? GT_Utility.trans("088", "Enabled") : GT_Utility.trans("087", "Disabled")); if (hasAlternativeModeText()) tChat = getAlternativeModeText(); GT_Utility.sendChatToPlayer(player, tChat); - }) - .addTooltip(0, new Text("Disabled").color(Color.RED.dark(3))) - .addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3))) - .setVariableBackgroundGetter(toggleButtonBackgroundGetter) - .setSize(18, 18) - .addTooltip("Working status")) - .widget(new ButtonWidget() - .setOnClick((clickData, widget) -> { - if (!widget.isClient()) widget.getContext().openSyncedWindow(CONFIGURATION_WINDOW_ID); - }) - .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CYCLIC) - .addTooltip("Configuration") - .setSize(18, 18)) - .setPos(151, 4)); + }).addTooltip(0, new Text("Disabled").color(Color.RED.dark(3))) + .addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3))) + .setVariableBackgroundGetter(toggleButtonBackgroundGetter).setSize(18, 18) + .addTooltip("Working status")) + .widget( + new ButtonWidget() + .setOnClick( + (clickData, widget) -> { + if (!widget.isClient()) + widget.getContext().openSyncedWindow(CONFIGURATION_WINDOW_ID); + }) + .setBackground( + GT_UITextures.BUTTON_STANDARD, + GT_UITextures.OVERLAY_BUTTON_CYCLIC) + .addTooltip("Configuration").setSize(18, 18)) + .setPos(151, 4)); final List drawables = new ArrayList<>(mMaxSlots); final int perRow = 7; Scrollable cropsContainer = new Scrollable().setVerticalScroll(); - if (mMaxSlots > 0) - for (int i = 0, imax = ((mMaxSlots - 1) / perRow); i <= imax; i++) { - DynamicPositionedRow row = new DynamicPositionedRow().setSynced(false); - for (int j = 0, jmax = (i == imax ? (mMaxSlots - 1) % perRow : (perRow - 1)); j <= jmax; j++) { - final int finalI = i * perRow; - final int finalJ = j; - final int ID = finalI + finalJ; - row.widget(new ButtonWidget() - .setOnClick((clickData, widget) -> { - if (!(player instanceof EntityPlayerMP)) return; - if (mStorage.size() <= ID) return; - if (this.mMaxProgresstime > 0) { - GT_Utility.sendChatToPlayer(player, "Can't eject while running !"); - return; - } - GreenHouseSlot removed = mStorage.remove(ID); - addOutput(removed.input); - GT_Utility.sendChatToPlayer(player, "Crop ejected !"); - }) - .setBackground(() -> new IDrawable[] { - getBaseMetaTileEntity().getGUITextureSet().getItemSlot(), + if (mMaxSlots > 0) for (int i = 0, imax = ((mMaxSlots - 1) / perRow); i <= imax; i++) { + DynamicPositionedRow row = new DynamicPositionedRow().setSynced(false); + for (int j = 0, jmax = (i == imax ? (mMaxSlots - 1) % perRow : (perRow - 1)); j <= jmax; j++) { + final int finalI = i * perRow; + final int finalJ = j; + final int ID = finalI + finalJ; + row.widget(new ButtonWidget().setOnClick((clickData, widget) -> { + if (!(player instanceof EntityPlayerMP)) return; + if (mStorage.size() <= ID) return; + if (this.mMaxProgresstime > 0) { + GT_Utility.sendChatToPlayer(player, "Can't eject while running !"); + return; + } + GreenHouseSlot removed = mStorage.remove(ID); + addOutput(removed.input); + GT_Utility.sendChatToPlayer(player, "Crop ejected !"); + }).setBackground( + () -> new IDrawable[] { getBaseMetaTileEntity().getGUITextureSet().getItemSlot(), new ItemDrawable(drawables.size() > ID ? drawables.get(ID) : null) - .withFixedSize(16, 16, 1, 1) - }) - .dynamicTooltip(() -> { - if (drawables.size() > ID) - return Arrays.asList( - drawables.get(ID).getDisplayName(), - "Amount: " + drawables.get(ID).stackSize, - EnumChatFormatting.GRAY + "Left click to eject"); - return Collections.emptyList(); - }) - .setSize(18, 18)); - } - cropsContainer.widget(row.setPos(0, i * 18).setEnabled(widget -> { - int y = widget.getPos().y; - int cy = cropsContainer.getVerticalScrollOffset(); - int ch = cropsContainer.getVisibleHeight(); - return y >= cy - ch && y <= cy + ch; - })); + .withFixedSize(16, 16, 1, 1) }) + .dynamicTooltip(() -> { + if (drawables.size() > ID) return Arrays.asList( + drawables.get(ID).getDisplayName(), + "Amount: " + drawables.get(ID).stackSize, + EnumChatFormatting.GRAY + "Left click to eject"); + return Collections.emptyList(); + }).setSize(18, 18)); } + cropsContainer.widget(row.setPos(0, i * 18).setEnabled(widget -> { + int y = widget.getPos().y; + int cy = cropsContainer.getVerticalScrollOffset(); + int ch = cropsContainer.getVisibleHeight(); + return y >= cy - ch && y <= cy + ch; + })); + } cropsContainer.attachSyncer( new FakeSyncWidget.ListSyncer<>( () -> mStorage.stream().map(s -> s.input).collect(Collectors.toList()), @@ -688,125 +656,102 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse protected ModularWindow createConfigurationWindow(final EntityPlayer player) { ModularWindow.Builder builder = ModularWindow.builder(200, 100); builder.setBackground(ModularUITextures.VANILLA_BACKGROUND); - builder.widget(new DrawableWidget() - .setDrawable(GT_UITextures.OVERLAY_BUTTON_CYCLIC) - .setPos(5, 5) - .setSize(16, 16)) + builder.widget( + new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CYCLIC).setPos(5, 5).setSize(16, 16)) .widget(new TextWidget("Configuration").setPos(25, 9)) .widget(ButtonWidget.closeWindowButton(true).setPos(185, 3)) - .widget(new Column() - .widget(new CycleButtonWidget() - .setLength(3) - .setGetter(() -> setupphase) - .setSetter(val -> { + .widget( + new Column().widget( + new CycleButtonWidget().setLength(3).setGetter(() -> setupphase).setSetter(val -> { if (!(player instanceof EntityPlayerMP)) return; if (this.mMaxProgresstime > 0) { GT_Utility.sendChatToPlayer( - player, "You can't enable/disable setup if the machine is working!"); + player, + "You can't enable/disable setup if the machine is working!"); return; } this.setupphase = val; GT_Utility.sendChatToPlayer( player, - "EIG is now running in " - + (this.setupphase == 1 - ? "setup mode (input)." - : (this.setupphase == 2 - ? "setup mode (output)." - : "normal operation."))); - }) - .addTooltip(0, new Text("Operating").color(Color.GREEN.dark(3))) - .addTooltip(1, new Text("Input").color(Color.YELLOW.dark(3))) - .addTooltip(2, new Text("Output").color(Color.YELLOW.dark(3))) - .setVariableBackgroundGetter(i -> new IDrawable[] { - ModularUITextures.VANILLA_BACKGROUND, - GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18), - i == 0 - ? new Text("Operating") - .color(Color.GREEN.dark(3)) - .withFixedSize(70 - 18, 18, 15, 0) - : i == 1 - ? new Text("Input") - .color(Color.YELLOW.dark(3)) - .withFixedSize(70 - 18, 18, 15, 0) - : new Text("Output") - .color(Color.YELLOW.dark(3)) - .withFixedSize(70 - 18, 18, 15, 0) - }) - .setSize(70, 18) - .addTooltip("Setup mode")) - .widget(new CycleButtonWidget() - .setLength(2) - .setGetter(() -> isIC2Mode ? 1 : 0) - .setSetter(val -> { - if (!(player instanceof EntityPlayerMP)) return; - if (this.mMaxProgresstime > 0) { - GT_Utility.sendChatToPlayer( - player, "You can't change IC2 mode if the machine is working!"); - return; - } - if (!mStorage.isEmpty()) { - GT_Utility.sendChatToPlayer( - player, "You can't change IC2 mode if there are seeds inside!"); - return; - } - this.isIC2Mode = val == 1; - GT_Utility.sendChatToPlayer( - player, "IC2 mode is now " + (this.isIC2Mode ? "enabled" : "disabled.")); - }) - .addTooltip(0, new Text("Disabled").color(Color.RED.dark(3))) - .addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3))) - .setVariableBackgroundGetter(i -> new IDrawable[] { - ModularUITextures.VANILLA_BACKGROUND, - GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18), - i == 0 - ? new Text("Disabled") - .color(Color.RED.dark(3)) - .withFixedSize(70 - 18, 18, 15, 0) - : new Text("Enabled") - .color(Color.GREEN.dark(3)) - .withFixedSize(70 - 18, 18, 15, 0) - }) - .setSize(70, 18) - .addTooltip("IC2 mode")) - .widget(new CycleButtonWidget() - .setLength(2) - .setGetter(() -> isNoHumidity ? 1 : 0) - .setSetter(val -> { - if (!(player instanceof EntityPlayerMP)) return; - isNoHumidity = val == 1; - GT_Utility.sendChatToPlayer( - player, "Give incoming crops no humidity " + isNoHumidity); - }) - .addTooltip(0, new Text("Disabled").color(Color.RED.dark(3))) - .addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3))) - .setVariableBackgroundGetter(i -> new IDrawable[] { - ModularUITextures.VANILLA_BACKGROUND, - GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18), - i == 0 - ? new Text("Disabled") - .color(Color.RED.dark(3)) - .withFixedSize(70 - 18, 18, 15, 0) - : new Text("Enabled") - .color(Color.GREEN.dark(3)) - .withFixedSize(70 - 18, 18, 15, 0) - }) - .setSize(70, 18) - .addTooltip("No Humidity mode")) - .setEnabled(widget -> !getBaseMetaTileEntity().isActive()) - .setPos(10, 30)) - .widget(new Column() - .widget(new TextWidget("Setup mode").setSize(100, 18)) - .widget(new TextWidget("IC2 mode").setSize(100, 18)) - .widget(new TextWidget("No Humidity mode").setSize(100, 18)) - .setEnabled(widget -> !getBaseMetaTileEntity().isActive()) - .setPos(80, 30)) - .widget(new DrawableWidget() - .setDrawable(GT_UITextures.OVERLAY_BUTTON_CROSS) - .setSize(18, 18) - .setPos(10, 30) - .addTooltip(new Text("Can't change configuration when running !").color(Color.RED.dark(3))) - .setEnabled(widget -> getBaseMetaTileEntity().isActive())); + "EIG is now running in " + (this.setupphase == 1 ? "setup mode (input)." + : (this.setupphase == 2 ? "setup mode (output)." + : "normal operation."))); + }).addTooltip(0, new Text("Operating").color(Color.GREEN.dark(3))) + .addTooltip(1, new Text("Input").color(Color.YELLOW.dark(3))) + .addTooltip(2, new Text("Output").color(Color.YELLOW.dark(3))) + .setVariableBackgroundGetter( + i -> new IDrawable[] { ModularUITextures.VANILLA_BACKGROUND, + GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18), + i == 0 ? new Text("Operating").color(Color.GREEN.dark(3)) + .withFixedSize(70 - 18, 18, 15, 0) + : i == 1 ? new Text("Input").color(Color.YELLOW.dark(3)) + .withFixedSize(70 - 18, 18, 15, 0) + : new Text("Output").color(Color.YELLOW.dark(3)) + .withFixedSize(70 - 18, 18, 15, 0) }) + .setSize(70, 18).addTooltip("Setup mode")) + .widget( + new CycleButtonWidget().setLength(2).setGetter(() -> isIC2Mode ? 1 : 0) + .setSetter(val -> { + if (!(player instanceof EntityPlayerMP)) return; + if (this.mMaxProgresstime > 0) { + GT_Utility.sendChatToPlayer( + player, + "You can't change IC2 mode if the machine is working!"); + return; + } + if (!mStorage.isEmpty()) { + GT_Utility.sendChatToPlayer( + player, + "You can't change IC2 mode if there are seeds inside!"); + return; + } + this.isIC2Mode = val == 1; + GT_Utility.sendChatToPlayer( + player, + "IC2 mode is now " + + (this.isIC2Mode ? "enabled" : "disabled.")); + }).addTooltip(0, new Text("Disabled").color(Color.RED.dark(3))) + .addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3))) + .setVariableBackgroundGetter( + i -> new IDrawable[] { ModularUITextures.VANILLA_BACKGROUND, + GT_UITextures.OVERLAY_BUTTON_CYCLIC + .withFixedSize(18, 18), + i == 0 ? new Text("Disabled").color(Color.RED.dark(3)) + .withFixedSize(70 - 18, 18, 15, 0) + : new Text("Enabled").color(Color.GREEN.dark(3)) + .withFixedSize(70 - 18, 18, 15, 0) }) + .setSize(70, 18).addTooltip("IC2 mode")) + .widget( + new CycleButtonWidget().setLength(2).setGetter(() -> isNoHumidity ? 1 : 0) + .setSetter(val -> { + if (!(player instanceof EntityPlayerMP)) return; + isNoHumidity = val == 1; + GT_Utility.sendChatToPlayer( + player, + "Give incoming crops no humidity " + isNoHumidity); + }).addTooltip(0, new Text("Disabled").color(Color.RED.dark(3))) + .addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3))) + .setVariableBackgroundGetter( + i -> new IDrawable[] { ModularUITextures.VANILLA_BACKGROUND, + GT_UITextures.OVERLAY_BUTTON_CYCLIC + .withFixedSize(18, 18), + i == 0 ? new Text("Disabled").color(Color.RED.dark(3)) + .withFixedSize(70 - 18, 18, 15, 0) + : new Text("Enabled").color(Color.GREEN.dark(3)) + .withFixedSize(70 - 18, 18, 15, 0) }) + .setSize(70, 18).addTooltip("No Humidity mode")) + .setEnabled(widget -> !getBaseMetaTileEntity().isActive()).setPos(10, 30)) + .widget( + new Column().widget(new TextWidget("Setup mode").setSize(100, 18)) + .widget(new TextWidget("IC2 mode").setSize(100, 18)) + .widget(new TextWidget("No Humidity mode").setSize(100, 18)) + .setEnabled(widget -> !getBaseMetaTileEntity().isActive()).setPos(80, 30)) + .widget( + new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CROSS).setSize(18, 18) + .setPos(10, 30) + .addTooltip( + new Text("Can't change configuration when running !").color(Color.RED.dark(3))) + .setEnabled(widget -> getBaseMetaTileEntity().isActive())); return builder.build(); } @@ -814,74 +759,79 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inventorySlot) { screenElements.setSynced(false).setSpace(0).setPos(10, 7); - screenElements.widget(new DynamicPositionedRow() - .setSynced(false) - .widget(new TextWidget("Status: ").setDefaultColor(COLOR_TEXT_GRAY.get())) - .widget(new DynamicTextWidget(() -> { - if (getBaseMetaTileEntity().isActive()) return new Text("Working !").color(Color.GREEN.dark(3)); - else if (getBaseMetaTileEntity().isAllowedToWork()) - return new Text("Enabled").color(Color.GREEN.dark(3)); - else if (getBaseMetaTileEntity().wasShutdown()) - return new Text("Shutdown (CRITICAL)").color(Color.RED.dark(3)); - else return new Text("Disabled").color(Color.RED.dark(3)); - })) - .setEnabled(isFixed)); + screenElements.widget( + new DynamicPositionedRow().setSynced(false) + .widget(new TextWidget("Status: ").setDefaultColor(COLOR_TEXT_GRAY.get())) + .widget(new DynamicTextWidget(() -> { + if (getBaseMetaTileEntity().isActive()) + return new Text("Working !").color(Color.GREEN.dark(3)); + else if (getBaseMetaTileEntity().isAllowedToWork()) + return new Text("Enabled").color(Color.GREEN.dark(3)); + else if (getBaseMetaTileEntity().wasShutdown()) + return new Text("Shutdown (CRITICAL)").color(Color.RED.dark(3)); + else return new Text("Disabled").color(Color.RED.dark(3)); + })).setEnabled(isFixed)); screenElements - .widget(new TextWidget(GT_Utility.trans("132", "Pipe is loose.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mWrench)) + .widget( + new TextWidget(GT_Utility.trans("132", "Pipe is loose.")) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mWrench)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mWrench, val -> mWrench = val)); screenElements - .widget(new TextWidget(GT_Utility.trans("133", "Screws are loose.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mScrewdriver)) + .widget( + new TextWidget(GT_Utility.trans("133", "Screws are loose.")) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mScrewdriver)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mScrewdriver, val -> mScrewdriver = val)); screenElements - .widget(new TextWidget(GT_Utility.trans("134", "Something is stuck.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mSoftHammer)) + .widget( + new TextWidget(GT_Utility.trans("134", "Something is stuck.")) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mSoftHammer)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mSoftHammer, val -> mSoftHammer = val)); screenElements - .widget(new TextWidget(GT_Utility.trans("135", "Platings are dented.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mHardHammer)) + .widget( + new TextWidget(GT_Utility.trans("135", "Platings are dented.")) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mHardHammer)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mHardHammer, val -> mHardHammer = val)); screenElements - .widget(new TextWidget(GT_Utility.trans("136", "Circuitry burned out.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mSolderingTool)) + .widget( + new TextWidget(GT_Utility.trans("136", "Circuitry burned out.")) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mSolderingTool)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mSolderingTool, val -> mSolderingTool = val)); screenElements - .widget(new TextWidget(GT_Utility.trans("137", "That doesn't belong there.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mCrowbar)) + .widget( + new TextWidget(GT_Utility.trans("137", "That doesn't belong there.")) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mCrowbar)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mCrowbar, val -> mCrowbar = val)); screenElements - .widget(new TextWidget(GT_Utility.trans("138", "Incomplete Structure.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mMachine)) + .widget( + new TextWidget(GT_Utility.trans("138", "Incomplete Structure.")) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mMachine)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val)); } @Override public String[] getInfoData() { - List info = new ArrayList<>(Arrays.asList( - "Running in mode: " + EnumChatFormatting.GREEN - + (setupphase == 0 - ? (isIC2Mode ? "IC2 crops" : "Normal crops") - : ("Setup mode " + (setupphase == 1 ? "(input)" : "(output)"))) - + EnumChatFormatting.RESET, - "Uses " + waterusage + "L/operation of water", - "Uses " + weedexusage + "L/second of Weed-EX 9000", - "Max slots: " + EnumChatFormatting.GREEN + this.mMaxSlots + EnumChatFormatting.RESET, - "Used slots: " + ((mStorage.size() > mMaxSlots) ? EnumChatFormatting.RED : EnumChatFormatting.GREEN) - + this.mStorage.size() + EnumChatFormatting.RESET)); + List info = new ArrayList<>( + Arrays.asList( + "Running in mode: " + EnumChatFormatting.GREEN + + (setupphase == 0 ? (isIC2Mode ? "IC2 crops" : "Normal crops") + : ("Setup mode " + (setupphase == 1 ? "(input)" : "(output)"))) + + EnumChatFormatting.RESET, + "Uses " + waterusage + "L/operation of water", + "Uses " + weedexusage + "L/second of Weed-EX 9000", + "Max slots: " + EnumChatFormatting.GREEN + this.mMaxSlots + EnumChatFormatting.RESET, + "Used slots: " + + ((mStorage.size() > mMaxSlots) ? EnumChatFormatting.RED : EnumChatFormatting.GREEN) + + this.mStorage.size() + + EnumChatFormatting.RESET)); HashMap storageList = new HashMap<>(); for (GreenHouseSlot greenHouseSlot : mStorage) { if (!greenHouseSlot.isValid) continue; - StringBuilder a = new StringBuilder(EnumChatFormatting.GREEN + "x" + greenHouseSlot.input.stackSize + " " - + greenHouseSlot.input.getDisplayName()); + StringBuilder a = new StringBuilder( + EnumChatFormatting.GREEN + "x" + + greenHouseSlot.input.stackSize + + " " + + greenHouseSlot.input.getDisplayName()); if (this.isIC2Mode) { a.append(" | Humidity: ").append(greenHouseSlot.noHumidity ? 0 : 12); } @@ -889,60 +839,36 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse storageList.merge(a.toString(), 1, Integer::sum); } storageList.forEach((k, v) -> info.add("x" + v + " " + k)); - if (mStorage.size() > mMaxSlots) - info.add(EnumChatFormatting.DARK_RED + "There are too many crops inside to run !" - + EnumChatFormatting.RESET); + if (mStorage.size() > mMaxSlots) info.add( + EnumChatFormatting.DARK_RED + "There are too many crops inside to run !" + EnumChatFormatting.RESET); info.addAll(Arrays.asList(super.getInfoData())); return info.toArray(new String[0]); } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - if (aActive) - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW) - .extFacing() - .glow() - .build() - }; - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW) - .extFacing() - .glow() - .build() - }; + if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow() + .build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow() + .build() }; } - return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) }; } public final List mStorage = new ArrayList<>(); public boolean addCrop(ItemStack input) { if (!isIC2Mode) - for (GreenHouseSlot g : mStorage) - if (g.input.stackSize < 64 && GT_Utility.areStacksEqual(g.input, input)) { - g.addAll(this.getBaseMetaTileEntity().getWorld(), input); - if (input.stackSize == 0) return true; - } + for (GreenHouseSlot g : mStorage) if (g.input.stackSize < 64 && GT_Utility.areStacksEqual(g.input, input)) { + g.addAll(this.getBaseMetaTileEntity().getWorld(), input); + if (input.stackSize == 0) return true; + } GreenHouseSlot h = new GreenHouseSlot(this, input, isIC2Mode, isNoHumidity); if (h.isValid) { mStorage.add(h); @@ -995,12 +921,10 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse if (undercrop != null) aNBT.setTag("undercrop", undercrop.writeToNBT(new NBTTagCompound())); aNBT.setInteger("generationscount", generations.size()); for (int i = 0; i < generations.size(); i++) { - aNBT.setInteger( - "generation." + i + ".count", generations.get(i).size()); - for (int j = 0; j < generations.get(i).size(); j++) - aNBT.setTag( - "generation." + i + "." + j, - generations.get(i).get(j).writeToNBT(new NBTTagCompound())); + aNBT.setInteger("generation." + i + ".count", generations.get(i).size()); + for (int j = 0; j < generations.get(i).size(); j++) aNBT.setTag( + "generation." + i + "." + j, + generations.get(i).get(j).writeToNBT(new NBTTagCompound())); } aNBT.setInteger("growthticks", growthticks); aNBT.setBoolean("noHumidity", noHumidity); @@ -1033,10 +957,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse generations = new ArrayList<>(); for (int i = 0; i < aNBT.getInteger("generationscount"); i++) { generations.add(new ArrayList<>()); - for (int j = 0; j < aNBT.getInteger("generation." + i + ".count"); j++) - generations - .get(i) - .add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("generation." + i + "." + j))); + for (int j = 0; j < aNBT.getInteger("generation." + i + ".count"); j++) generations.get(i) + .add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("generation." + i + "." + j))); } growthticks = aNBT.getInteger("growthticks"); noHumidity = aNBT.getBoolean("noHumidity"); @@ -1056,14 +978,10 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse public boolean findCropRecipe(World world) { if (recipe != null) return true; - out: - for (ItemStack drop : drops) { + out: for (ItemStack drop : drops) { recipeInput = drop; - for (int j = 0; - j < CraftingManager.getInstance().getRecipeList().size(); - j++) { - recipe = (IRecipe) - CraftingManager.getInstance().getRecipeList().get(j); + for (int j = 0; j < CraftingManager.getInstance().getRecipeList().size(); j++) { + recipe = (IRecipe) CraftingManager.getInstance().getRecipeList().get(j); if (recipe.matches(this, world) && GT_Utility.areStacksEqual(recipe.getCraftingResult(this), input)) { break out; @@ -1093,10 +1011,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse @Override public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {} - public GreenHouseSlot( - GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, - ItemStack input, - boolean IC2, + public GreenHouseSlot(GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, ItemStack input, boolean IC2, boolean noHumidity) { super(null, 3, 3); World world = tileEntity.getBaseMetaTileEntity().getWorld(); @@ -1158,11 +1073,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse } } - public void GreenHouseSlotIC2( - GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, - World world, - ItemStack input, - boolean noHumidity) { + public void GreenHouseSlotIC2(GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, World world, + ItemStack input, boolean noHumidity) { if (!ItemList.IC2_Crop_Seeds.isStackEqual(input, true, true)) return; this.isIC2Crop = true; recalculate(tileEntity, world); @@ -1181,7 +1093,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse z, b, GT_TileEntity_Ores.getHarvestData( - tDamage, ((GT_Block_Ores_Abstract) b).getBaseBlockHarvestLevel(tDamage % 16000 / 1000)), + tDamage, + ((GT_Block_Ores_Abstract) b).getBaseBlockHarvestLevel(tDamage % 16000 / 1000)), 0)) { return false; } @@ -1200,8 +1113,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse byte gr = nbt.getByte("growth"); byte ga = nbt.getByte("gain"); byte re = nbt.getByte("resistance"); - int[] abc = new int[] {0, -2, 3}; - int[] xyz = new int[] {0, 0, 0}; + int[] abc = new int[] { 0, -2, 3 }; + int[] xyz = new int[] { 0, 0, 0 }; tileEntity.getExtendedFacing().getWorldOffset(abc, xyz); xyz[0] += tileEntity.getBaseMetaTileEntity().getXCoord(); xyz[1] += tileEntity.getBaseMetaTileEntity().getYCoord(); @@ -1260,8 +1173,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse // GENERATE DROPS generations = new ArrayList<>(); - out: - for (int i = 0; i < 10; i++) // get 10 generations + out: for (int i = 0; i < 10; i++) // get 10 generations { ItemStack[] st = te.harvest_automated(false); te.setSize((byte) cc.maxSize()); @@ -1323,12 +1235,11 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse if (!dropstacks.containsKey(s.toString())) dropstacks.put(s.toString(), s.copy()); } copied.clear(); - for (Map.Entry entry : dropprogress.entrySet()) - if (entry.getValue() >= 1d) { - copied.add(dropstacks.get(entry.getKey()).copy()); - copied.get(copied.size() - 1).stackSize = entry.getValue().intValue(); - entry.setValue(entry.getValue() - (double) entry.getValue().intValue()); - } + for (Map.Entry entry : dropprogress.entrySet()) if (entry.getValue() >= 1d) { + copied.add(dropstacks.get(entry.getKey()).copy()); + copied.get(copied.size() - 1).stackSize = entry.getValue().intValue(); + entry.setValue(entry.getValue() - (double) entry.getValue().intValue()); + } return copied; } @@ -1338,7 +1249,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse @SuppressWarnings("unchecked") ArrayList d = (ArrayList) customDrops.clone(); for (ItemStack x : drops) { - for (Iterator iterator = d.iterator(); iterator.hasNext(); ) { + for (Iterator iterator = d.iterator(); iterator.hasNext();) { ItemStack y = iterator.next(); if (GT_Utility.areStacksEqual(x, y)) { x.stackSize += y.stackSize * count; @@ -1357,12 +1268,10 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse if (crop == null) return count; for (int i = 0; i < count; i++) { List d = crop.getDrops(world, 0, 0, 0, optimalgrowth, 0); - for (ItemStack x : drops) - for (ItemStack y : d) - if (GT_Utility.areStacksEqual(x, y)) { - x.stackSize += y.stackSize; - y.stackSize = 0; - } + for (ItemStack x : drops) for (ItemStack y : d) if (GT_Utility.areStacksEqual(x, y)) { + x.stackSize += y.stackSize; + y.stackSize = 0; + } for (ItemStack x : d) if (x.stackSize > 0) drops.add(x.copy()); } } @@ -1442,6 +1351,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse } private static class GreenHouseRandom extends Random { + @Override public int nextInt(int bound) { return 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index aa63d8958d..656d9a38d2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -1,18 +1,10 @@ /* - * Copyright (C) 2022 kuba6000 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Copyright (C) 2022 kuba6000 This program is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; @@ -22,6 +14,17 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_Values.AuthorKuba; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -30,6 +33,7 @@ import com.github.bartimaeusnek.bartworks.util.MathUtils; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -44,215 +48,87 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; import gregtech.api.render.TextureFactory; import gregtech.api.util.*; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase { private static final int BASECASINGINDEX = 181; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition STRUCTURE_DEFINITION = - StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { - { - " BBBBBBB ", - " BBBBBBBBB ", - "BBBBBBBBBBB", - "BBBBBBBBBBB", - "BBBBBBBBBBB", - "BBBBBBBBBBB", - "BBBBBBBBBBB", - "BBBBBBBBBBB", - "BBBBBBBBBBB", - " BBBBBBBBB ", - " BBBBBBB " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " bbb~bbb ", - " bbbbbbbbb ", - "bbbbbbbbbbb", - "bbbbbbbbbbb", - "bbbbbbbbbbb", - "bbbbbbbbbbb", - "bbbbbbbbbbb", - "bbbbbbbbbbb", - "bbbbbbbbbbb", - " bbbbbbbbb ", - " bbbbbbb " - }, - })) - .addElement('c', onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5))) - .addElement( - 'b', - ofChain( - ofHatchAdder(GT_TileEntity_HTGR::addOutputToMachineList, BASECASINGINDEX, 1), - ofHatchAdder(GT_TileEntity_HTGR::addMaintenanceToMachineList, BASECASINGINDEX, 1), - ofHatchAdder(GT_TileEntity_HTGR::addEnergyInputToMachineList, BASECASINGINDEX, 1), - onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5)))) - .addElement( - 'B', - ofChain( - ofHatchAdder(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2), - onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5)))) - // ofHatchAdderOptional(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2, - // GregTech_API.sBlockCasings8, 5)) - .build(); + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { + { " BBBBBBB ", " BBBBBBBBB ", "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", + "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", " BBBBBBBBB ", + " BBBBBBB " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " bbb~bbb ", " bbbbbbbbb ", "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", + "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", " bbbbbbbbb ", + " bbbbbbb " }, })) + .addElement('c', onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5))) + .addElement( + 'b', + ofChain( + ofHatchAdder(GT_TileEntity_HTGR::addOutputToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_HTGR::addMaintenanceToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_HTGR::addEnergyInputToMachineList, BASECASINGINDEX, 1), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5)))) + .addElement( + 'B', + ofChain( + ofHatchAdder(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5)))) + // ofHatchAdderOptional(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2, + // GregTech_API.sBlockCasings8, 5)) + .build(); public static final GT_Recipe.GT_Recipe_Map fakeRecipeMap = new GT_Recipe.GT_Recipe_Map( - new HashSet<>(), - "bw.recipe.htgr", - "High Temperature Gas-cooled Reactor", - null, - "gregtech:textures/gui/basicmachines/Default", - 1, - 1, - 1, - 0, - 1, - "", - 1, - "", - false, - true) - .useModularUI(true); + new HashSet<>(), + "bw.recipe.htgr", + "High Temperature Gas-cooled Reactor", + null, + "gregtech:textures/gui/basicmachines/Default", + 1, + 1, + 1, + 0, + 1, + "", + 1, + "", + false, + true).useModularUI(true); private static final int HELIUM_NEEDED = 730000; private static final int powerUsage = BW_Util.getMachineVoltageFromTier(6); private static final int maxcapacity = 720000; @@ -286,8 +162,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Breeder Reactor") - .addInfo("Controller block for the High Temperature Gas-cooled Reactor (HTGR)") - .addInfo(AuthorKuba) + .addInfo("Controller block for the High Temperature Gas-cooled Reactor (HTGR)").addInfo(AuthorKuba) .addInfo("You can clear internal buffer by changing the mode with a screwdriver") .addInfo("Needs a constant supply of coolant while running") .addInfo("Needs at least 72k Fuel pebbles to start operation (can hold up to 720k pebbles)") @@ -297,19 +172,13 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase .addInfo("and affects total recipe time (at 100% eff, -50% total recipe time") .addInfo( "Reactor will take 4 000L/s of coolant multiplied by efficiency and by fuel coolant value (check tooltips)") - .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t") - .addInfo("One Operation takes 1 hour") - .addSeparator() - .beginStructureBlock(11, 12, 11, true) - .addController("Front bottom center") + .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t").addInfo("One Operation takes 1 hour") + .addSeparator().beginStructureBlock(11, 12, 11, true).addController("Front bottom center") .addCasingInfo("Europium Reinforced Radiation Proof Casings", 500) .addStructureInfo("Corners and the 2 touching blocks are air (cylindric)") - .addInputBus("Any top layer casing", 2) - .addInputHatch("Any top layer casing", 2) - .addOutputBus("Any bottom layer casing", 1) - .addOutputHatch("Any bottom layer casing", 1) - .addEnergyHatch("Any bottom layer casing", 1) - .addMaintenanceHatch("Any bottom layer casing", 1) + .addInputBus("Any top layer casing", 2).addInputHatch("Any top layer casing", 2) + .addOutputBus("Any bottom layer casing", 1).addOutputHatch("Any bottom layer casing", 1) + .addEnergyHatch("Any bottom layer casing", 1).addMaintenanceHatch("Any bottom layer casing", 1) .toolTipFinisher(MULTIBLOCK_ADDED_VIA_BARTWORKS.apply(ChatColorHelper.GOLD + "kuba6000")); return tt; } @@ -327,8 +196,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { this.mCasing = 0; - return (checkPiece("main", 5, 11, 0) - && this.mCasing >= 500 + return (checkPiece("main", 5, 11, 0) && this.mCasing >= 500 && this.mMaintenanceHatches.size() == 1 && this.mInputHatches.size() > 0 && this.mOutputHatches.size() > 0 @@ -421,10 +289,8 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase int meta = (this.fueltype * HTGRMaterials.MATERIALS_PER_FUEL) + HTGRMaterials.BURNED_OUT_FUEL_INDEX; - this.mOutputItems = new ItemStack[] { - new ItemStack(HTGRMaterials.aHTGR_Materials, burnedballs, meta), - new ItemStack(HTGRMaterials.aHTGR_Materials, toReduce, meta + 1) - }; + this.mOutputItems = new ItemStack[] { new ItemStack(HTGRMaterials.aHTGR_Materials, burnedballs, meta), + new ItemStack(HTGRMaterials.aHTGR_Materials, toReduce, meta + 1) }; // this.updateSlots(); // not needed ? @@ -538,60 +404,37 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public String[] getInfoData() { - return new String[] { - "Mode:", this.empty ? "Emptying" : "Normal", - "Progress:", - GT_Utility.formatNumbers(this.mProgresstime / 20) + "s / " - + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "s", - "Fuel type:", - (this.fueltype == -1 - ? "NONE" - : ("TRISO (" + HTGRMaterials.sHTGR_Fuel[this.fueltype].sEnglish) + ")"), - "Fuel amount:", GT_Utility.formatNumbers(this.fuelsupply) + " pcs.", - "Helium-Level:", - GT_Utility.formatNumbers(this.HeliumSupply) + "L / " - + GT_Utility.formatNumbers(GT_TileEntity_HTGR.HELIUM_NEEDED) + "L", - "Coolant:", GT_Utility.formatNumbers(coolanttaking) + "L/s", - "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) - }; + return new String[] { "Mode:", this.empty ? "Emptying" : "Normal", "Progress:", + GT_Utility.formatNumbers(this.mProgresstime / 20) + "s / " + + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + + "s", + "Fuel type:", + (this.fueltype == -1 ? "NONE" : ("TRISO (" + HTGRMaterials.sHTGR_Fuel[this.fueltype].sEnglish) + ")"), + "Fuel amount:", GT_Utility.formatNumbers(this.fuelsupply) + " pcs.", "Helium-Level:", + GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + + GT_Utility.formatNumbers(GT_TileEntity_HTGR.HELIUM_NEEDED) + + "L", + "Coolant:", GT_Utility.formatNumbers(coolanttaking) + "L/s", "Problems:", + String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), - TextureFactory.builder() - .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) - .extFacing() + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) + .extFacing().build(), + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW) + .extFacing().glow().build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER).extFacing() .build(), - TextureFactory.builder() - .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW) - .extFacing() - .glow() - .build() - }; - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), - TextureFactory.builder() - .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW) - .extFacing() - .glow() - .build() - }; + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).extFacing() + .glow().build() }; } - return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX)}; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX) }; } @Override @@ -602,12 +445,14 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } this.empty = !this.empty; GT_Utility.sendChatToPlayer( - aPlayer, "HTGR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); + aPlayer, + "HTGR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); } public static class HTGRMaterials { private static class CustomHTGRSimpleSubItemClass extends SimpleSubItemClass { + HashMap tooltip = null; public CustomHTGRSimpleSubItemClass(HashMap tooltip, String... tex) { @@ -625,6 +470,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } private static class Base_ { + public String sName; public String sEnglish; @@ -635,26 +481,19 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } static class Fuel_ { + public String sName; public String sEnglish; public ItemStack mainItem; public ItemStack secondaryItem; - public ItemStack[] recycledItems = { - GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI - }; + public ItemStack[] recycledItems = { GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, + GT_Values.NI }; public FluidStack recycledFluid; public int[] recycleChances; public String tooltip; - public Fuel_( - String sName, - String sEnglish, - ItemStack mainItem, - ItemStack secondaryItem, - FluidStack recycledFluid, - ItemStack[] recycledItems, - int[] recycleChances, - String tooltip) { + public Fuel_(String sName, String sEnglish, ItemStack mainItem, ItemStack secondaryItem, + FluidStack recycledFluid, ItemStack[] recycledItems, int[] recycleChances, String tooltip) { this.sName = sName; this.sEnglish = sEnglish; this.mainItem = mainItem; @@ -667,6 +506,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } private static class LangEntry_ { + public String sName; public String sEnglish; @@ -676,65 +516,47 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } } - static final Base_[] sHTGR_Bases = new Base_[] { - new Base_("HTGRFuelMixture", "HTGR fuel mixture"), - new Base_("BISOPebbleCompound", "BISO pebble compound"), - new Base_("TRISOPebbleCompound", "TRISO pebble compound"), - new Base_("TRISOBall", "TRISO ball"), - new Base_("TRISOPebble", "TRISO pebble"), - new Base_("BurnedOutTRISOBall", "Burned out TRISO Ball"), - new Base_("BurnedOutTRISOPebble", "Burned out TRISO Pebble"), - }; + static final Base_[] sHTGR_Bases = new Base_[] { new Base_("HTGRFuelMixture", "HTGR fuel mixture"), + new Base_("BISOPebbleCompound", "BISO pebble compound"), + new Base_("TRISOPebbleCompound", "TRISO pebble compound"), new Base_("TRISOBall", "TRISO ball"), + new Base_("TRISOPebble", "TRISO pebble"), new Base_("BurnedOutTRISOBall", "Burned out TRISO Ball"), + new Base_("BurnedOutTRISOPebble", "Burned out TRISO Pebble"), }; static final int MATERIALS_PER_FUEL = sHTGR_Bases.length; static final int USABLE_FUEL_INDEX = 4; static final int BURNED_OUT_FUEL_INDEX = 5; static final Fuel_[] sHTGR_Fuel = new Fuel_[] { - new Fuel_( - "Thorium", - "Thorium", - WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 64), - Materials.Uranium235.getDust(4), - GT_Values.NF, - new ItemStack[] { - Materials.Silicon.getDust(1), - Materials.Graphite.getDust(1), - Materials.Carbon.getDust(1), - Materials.Lutetium.getDust(1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1) - }, - new int[] {9900 / 4, 9900 / 4, 9900 / 4, 9900 / 4, 162 / 4}, - "Multiplies coolant by 1"), - new Fuel_( - "Uranium", - "Uranium", - Materials.Uranium.getDust(64), - Materials.Uranium235.getDust(8), - FluidRegistry.getFluidStack("krypton", 4), - new ItemStack[] { - Materials.Silicon.getDust(1), - Materials.Graphite.getDust(1), - Materials.Carbon.getDust(1), - Materials.Lead.getDust(1), - Materials.Uranium.getDust(1) - }, - new int[] {9900 / 4, 9900 / 4, 9900 / 4, 5000 / 4, 5000 / 4}, - "Multiplies coolant by 1.5"), - new Fuel_( - "Plutonium", - "Plutonium", - Materials.Plutonium.getDust(64), - Materials.Plutonium241.getDust(4), - FluidRegistry.getFluidStack("xenon", 4), - new ItemStack[] { - Materials.Silicon.getDust(1), - Materials.Graphite.getDust(1), - Materials.Carbon.getDust(1), - Materials.Lead.getDust(1), - Materials.Plutonium.getDust(1) - }, - new int[] {9900 / 4, 9900 / 4, 9900 / 4, 5000 / 4, 5000 / 4}, - "Multiplies coolant by 2"), - }; + new Fuel_( + "Thorium", + "Thorium", + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 64), + Materials.Uranium235.getDust(4), + GT_Values.NF, + new ItemStack[] { Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), + Materials.Carbon.getDust(1), Materials.Lutetium.getDust(1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1) }, + new int[] { 9900 / 4, 9900 / 4, 9900 / 4, 9900 / 4, 162 / 4 }, + "Multiplies coolant by 1"), + new Fuel_( + "Uranium", + "Uranium", + Materials.Uranium.getDust(64), + Materials.Uranium235.getDust(8), + FluidRegistry.getFluidStack("krypton", 4), + new ItemStack[] { Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), + Materials.Carbon.getDust(1), Materials.Lead.getDust(1), Materials.Uranium.getDust(1) }, + new int[] { 9900 / 4, 9900 / 4, 9900 / 4, 5000 / 4, 5000 / 4 }, + "Multiplies coolant by 1.5"), + new Fuel_( + "Plutonium", + "Plutonium", + Materials.Plutonium.getDust(64), + Materials.Plutonium241.getDust(4), + FluidRegistry.getFluidStack("xenon", 4), + new ItemStack[] { Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), + Materials.Carbon.getDust(1), Materials.Lead.getDust(1), + Materials.Plutonium.getDust(1) }, + new int[] { 9900 / 4, 9900 / 4, 9900 / 4, 5000 / 4, 5000 / 4 }, + "Multiplies coolant by 2"), }; static final CustomHTGRSimpleSubItemClass aHTGR_Materials; static final ArrayList aHTGR_Localizations = new ArrayList<>(); @@ -742,16 +564,17 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase String[] sHTGR_Materials = new String[sHTGR_Bases.length * sHTGR_Fuel.length]; HashMap tooltip = new HashMap<>(); int i = 0; - for (Fuel_ fuel : sHTGR_Fuel) - for (Base_ base : sHTGR_Bases) { - sHTGR_Materials[i] = "HTGR" + base.sName + fuel.sName; - aHTGR_Localizations.add(new LangEntry_( - "item." + sHTGR_Materials[i] + ".name", base.sEnglish + " (" + fuel.sEnglish + ")")); - if (((i + 1) % MATERIALS_PER_FUEL == (USABLE_FUEL_INDEX + 1)) - && fuel.tooltip != null - && !fuel.tooltip.isEmpty()) tooltip.put(i, fuel.tooltip); - i++; - } + for (Fuel_ fuel : sHTGR_Fuel) for (Base_ base : sHTGR_Bases) { + sHTGR_Materials[i] = "HTGR" + base.sName + fuel.sName; + aHTGR_Localizations.add( + new LangEntry_( + "item." + sHTGR_Materials[i] + ".name", + base.sEnglish + " (" + fuel.sEnglish + ")")); + if (((i + 1) % MATERIALS_PER_FUEL == (USABLE_FUEL_INDEX + 1)) && fuel.tooltip != null + && !fuel.tooltip.isEmpty()) + tooltip.put(i, fuel.tooltip); + i++; + } aHTGR_Materials = new CustomHTGRSimpleSubItemClass(tooltip, sHTGR_Materials); } @@ -763,11 +586,9 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase public static void registerTHR_Recipes() { GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - new ItemStack(GregTech_API.sBlockCasings3, 1, 12), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Europium, 6), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 24) - }, + new ItemStack[] { new ItemStack(GregTech_API.sBlockCasings3, 1, 12), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Europium, 6), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 24) }, Materials.Lead.getMolten(864), new ItemStack(GregTech_API.sBlockCasings8, 1, 5), 200, @@ -775,9 +596,9 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase int i = 0; for (Fuel_ fuel : sHTGR_Fuel) { GT_Values.RA.addMixerRecipe( - new ItemStack[] {fuel.mainItem, fuel.secondaryItem, GT_Utility.getIntegratedCircuit(1)}, + new ItemStack[] { fuel.mainItem, fuel.secondaryItem, GT_Utility.getIntegratedCircuit(1) }, null, - new ItemStack[] {new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i)}, + new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i) }, null, 400, 30); @@ -801,16 +622,12 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase 30); GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( false, - new ItemStack[] { - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), - GT_Utility.getIntegratedCircuit(17) - }, - new ItemStack[] { - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4) - }, + new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), + GT_Utility.getIntegratedCircuit(17) }, + new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4) }, null, null, null, @@ -820,11 +637,9 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase 0); GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( false, - new ItemStack[] { - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5), - GT_Utility.getIntegratedCircuit(17) - }, - new ItemStack[] {new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 6)}, + new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5), + GT_Utility.getIntegratedCircuit(17) }, + new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 6) }, null, null, null, @@ -834,8 +649,8 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase 0); fakeRecipeMap.addFakeRecipe( false, - new ItemStack[] {new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4)}, - new ItemStack[] {new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5)}, + new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4) }, + new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5) }, null, null, null, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 6ed572e976..9e69a9cb88 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -1,27 +1,31 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import java.awt.*; +import java.util.ArrayList; +import java.util.Collections; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -39,6 +43,7 @@ import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn; import com.gtnewhorizons.modularui.common.widget.ProgressBar; import com.gtnewhorizons.modularui.common.widget.SlotWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; + import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -52,17 +57,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; -import java.awt.*; -import java.util.ArrayList; -import java.util.Collections; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @@ -76,6 +70,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public ConnectedBlocksChecker connectedcells; public final ItemStack[] circuits = new ItemStack[5]; private final ItemStackHandler circuitsInventoryHandler = new ItemStackHandler(circuits) { + @Override public int getSlotLimit(int slot) { return 1; @@ -110,12 +105,9 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public long maxAmperesIn() { int ret = 0; - for (int i = 0; i < 5; ++i) - if (this.circuits[i] != null - && this.circuits[i] - .getItem() - .equals(GT_Utility.getIntegratedCircuit(0).getItem())) - ret += this.circuits[i].getItemDamage(); + for (int i = 0; i < 5; ++i) if (this.circuits[i] != null + && this.circuits[i].getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) + ret += this.circuits[i].getItemDamage(); return ret > 0 ? ret : 1; } @@ -173,11 +165,12 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public String[] getDescription() { ArrayList e = new ArrayList<>(); - String[] dsc = - StatCollector.translateToLocal("tooltip.tile.lesu.0.name").split(";"); + String[] dsc = StatCollector.translateToLocal("tooltip.tile.lesu.0.name").split(";"); Collections.addAll(e, dsc); - e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " - + GT_Utility.formatNumbers(ConfigHandler.energyPerCell) + "EU"); + e.add( + StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + + GT_Utility.formatNumbers(ConfigHandler.energyPerCell) + + "EU"); dsc = StatCollector.translateToLocal("tooltip.tile.lesu.2.name").split(";"); Collections.addAll(e, dsc); e.add(ChatColorHelper.RED + StatCollector.translateToLocal("tooltip.tile.lesu.3.name")); @@ -192,6 +185,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { GT_TileEntity_LESU.iIcons[i] = aBlockIconRegister.registerIcon(MainMod.MOD_ID + ":LESU_CASING_" + i); int finalI = i; GT_TileEntity_LESU.iIconContainers[i] = new IIconContainer() { + @Override public IIcon getIcon() { return GT_TileEntity_LESU.iIcons[finalI]; @@ -212,29 +206,23 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public boolean isClientSide() { if (this.getWorld() != null) - return this.getWorld().isRemote - ? FMLCommonHandler.instance().getSide() == Side.CLIENT + return this.getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; } @Override @SuppressWarnings("ALL") - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { ITexture[] ret = new ITexture[0]; if (this.isClientSide()) { for (int i = 0; i < GT_TileEntity_LESU.iTextures.length; i++) { - GT_TileEntity_LESU.iTextures[i][0] = TextureFactory.of( - GT_TileEntity_LESU.iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); + GT_TileEntity_LESU.iTextures[i][0] = TextureFactory + .of(GT_TileEntity_LESU.iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); } if (aSide == aFacing && this.getBaseMetaTileEntity().getUniversalEnergyStored() <= 0) @@ -302,10 +290,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { case 1: return true; default: - return p_94041_2_ != null - && p_94041_2_ - .getItem() - .equals(GT_Utility.getIntegratedCircuit(0).getItem()); + return p_94041_2_ != null && p_94041_2_.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); } } @@ -389,9 +374,8 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { if (this.connectedcells.get_meta_of_sideblocks( aBaseMetaTileEntity.getWorld(), this.getBaseMetaTileEntity().getMetaTileID(), - new int[] { - aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord() - }, + new int[] { aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord() }, true)) { this.getBaseMetaTileEntity().disableWorking(); this.getBaseMetaTileEntity().setActive(false); @@ -403,9 +387,8 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { this.mEfficiency = this.getMaxEfficiency(null); this.mStorage = (ConfigHandler.energyPerCell * this.connectedcells.hashset.size() >= Long.MAX_VALUE - 1 - || ConfigHandler.energyPerCell * this.connectedcells.hashset.size() < 0) - ? Long.MAX_VALUE - 1 - : ConfigHandler.energyPerCell * this.connectedcells.hashset.size(); + || ConfigHandler.energyPerCell * this.connectedcells.hashset.size() < 0) ? Long.MAX_VALUE - 1 + : ConfigHandler.energyPerCell * this.connectedcells.hashset.size(); this.mMaxProgresstime = 1; this.mProgresstime = 0; @@ -421,14 +404,20 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { long finishedTime = System.nanoTime(); // System.out.println("LESU LookUp: "+((finishedTime - startingTime) / 1000000)+"ms"); - if (finishedTime - startingTime > 5000000) - MainMod.LOGGER.warn("LESU LookUp took longer than 5ms!(" + (finishedTime - startingTime) + "ns / " - + ((finishedTime - startingTime) / 1000000) + "ms) Owner:" - + this.getBaseMetaTileEntity().getOwnerName() + " Check at x:" - + this.getBaseMetaTileEntity().getXCoord() + " y:" - + this.getBaseMetaTileEntity().getYCoord() + " z:" - + this.getBaseMetaTileEntity().getZCoord() + " DIM-ID: " - + this.getBaseMetaTileEntity().getWorld().provider.dimensionId); + if (finishedTime - startingTime > 5000000) MainMod.LOGGER.warn( + "LESU LookUp took longer than 5ms!(" + (finishedTime - startingTime) + + "ns / " + + ((finishedTime - startingTime) / 1000000) + + "ms) Owner:" + + this.getBaseMetaTileEntity().getOwnerName() + + " Check at x:" + + this.getBaseMetaTileEntity().getXCoord() + + " y:" + + this.getBaseMetaTileEntity().getYCoord() + + " z:" + + this.getBaseMetaTileEntity().getZCoord() + + " DIM-ID: " + + this.getBaseMetaTileEntity().getWorld().provider.dimensionId); return true; } @@ -458,90 +447,91 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public void addGregTechLogo(ModularWindow.Builder builder) { - builder.widget(new DrawableWidget() - .setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY) - .setSize(17, 17) - .setPos(105, 51)); + builder.widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY).setSize(17, 17) + .setPos(105, 51)); } @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new DrawableWidget() - .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(7, 4) - .setSize(118, 67)) + builder.widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(7, 4).setSize(118, 67)) .widget(new SlotWidget(new BaseSlot(inventoryHandler, 1) { - @Override - public int getSlotStackLimit() { - return 1; - } - }) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN) - .setPos(127, 13)) + + @Override + public int getSlotStackLimit() { + return 1; + } + }).setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN).setPos(127, 13)) .widget(new SlotWidget(new BaseSlot(inventoryHandler, 0) { - @Override - public int getSlotStackLimit() { - return 1; - } - }) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CHARGER) - .setPos(127, 49)); + + @Override + public int getSlotStackLimit() { + return 1; + } + }).setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CHARGER).setPos(127, 49)); for (int i = 0; i < 4; i++) { - builder.widget(new SlotWidget(circuitsInventoryHandler, i) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT) - .setPos(151, 4 + i * 18)); + builder.widget( + new SlotWidget(circuitsInventoryHandler, i) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT) + .setPos(151, 4 + i * 18)); } final DynamicPositionedColumn screenElements = new DynamicPositionedColumn(); drawTexts(screenElements); builder.widget(screenElements); - builder.widget(new DrawableWidget() - .setDrawable(BW_UITextures.PICTURE_STORED_EU_FRAME) - .setPos(7, 72) - .setSize(118, 7)) - .widget(new ProgressBar() - .setProgress(() -> (float) getBaseMetaTileEntity().getStoredEU() - / getBaseMetaTileEntity().getEUCapacity()) - .setDirection(ProgressBar.Direction.RIGHT) - .setTexture(BW_UITextures.PROGRESSBAR_STORED_EU_116, 116) - .setPos(8, 73) - .setSize(116, 5)); + builder.widget( + new DrawableWidget().setDrawable(BW_UITextures.PICTURE_STORED_EU_FRAME).setPos(7, 72).setSize(118, 7)) + .widget( + new ProgressBar() + .setProgress( + () -> (float) getBaseMetaTileEntity().getStoredEU() + / getBaseMetaTileEntity().getEUCapacity()) + .setDirection(ProgressBar.Direction.RIGHT) + .setTexture(BW_UITextures.PROGRESSBAR_STORED_EU_116, 116).setPos(8, 73) + .setSize(116, 5)); } private void drawTexts(DynamicPositionedColumn screenElements) { screenElements.setSpace(0).setPos(11, 8); screenElements - .widget(TextWidget.dynamicString(() -> "EU: " - + GT_Utility.formatNumbers( - getBaseMetaTileEntity().getStoredEU())) - .setDefaultColor(COLOR_TEXT_WHITE.get())) - .widget(TextWidget.dynamicString(() -> "MAX: " - + (getBaseMetaTileEntity().isActive() - ? GT_Utility.formatNumbers( - getBaseMetaTileEntity().getOutputVoltage()) - + String.valueOf(ConfigHandler.energyPerCell) - .substring(1) + .widget( + TextWidget + .dynamicString( + () -> "EU: " + GT_Utility.formatNumbers(getBaseMetaTileEntity().getStoredEU())) + .setDefaultColor(COLOR_TEXT_WHITE.get())) + .widget( + TextWidget.dynamicString( + () -> "MAX: " + (getBaseMetaTileEntity().isActive() + ? GT_Utility.formatNumbers(getBaseMetaTileEntity().getOutputVoltage()) + + String.valueOf(ConfigHandler.energyPerCell).substring(1) : Integer.toString(0))) - .setDefaultColor(COLOR_TEXT_WHITE.get())) - .widget(TextWidget.dynamicString(() -> "MAX EU/t IN: " - + GT_Utility.formatNumbers( - getBaseMetaTileEntity().getInputVoltage())) - .setDefaultColor(COLOR_TEXT_WHITE.get())) - .widget(TextWidget.dynamicString(() -> "EU/t OUT: " - + GT_Utility.formatNumbers( - getBaseMetaTileEntity().getOutputVoltage())) - .setDefaultColor(COLOR_TEXT_WHITE.get())) - .widget(TextWidget.dynamicString(() -> "AMP/t IN/OUT: " - + GT_Utility.formatNumbers( - getBaseMetaTileEntity().getInputAmperage())) - .setDefaultColor(COLOR_TEXT_WHITE.get())) - .widget(new TextWidget(Text.localised("tooltip.LESU.0.name")) - .setDefaultColor(Color.YELLOW.getRGB()) - .setEnabled(widget -> maxEUStore() >= Long.MAX_VALUE - 1)) - .widget(new TextWidget(Text.localised("tooltip.LESU.1.name")) - .setDefaultColor(Color.RED.getRGB()) - .setEnabled(widget -> !getBaseMetaTileEntity().isActive())); + .setDefaultColor(COLOR_TEXT_WHITE.get())) + .widget( + TextWidget + .dynamicString( + () -> "MAX EU/t IN: " + + GT_Utility.formatNumbers(getBaseMetaTileEntity().getInputVoltage())) + .setDefaultColor(COLOR_TEXT_WHITE.get())) + .widget( + TextWidget + .dynamicString( + () -> "EU/t OUT: " + + GT_Utility.formatNumbers(getBaseMetaTileEntity().getOutputVoltage())) + .setDefaultColor(COLOR_TEXT_WHITE.get())) + .widget( + TextWidget + .dynamicString( + () -> "AMP/t IN/OUT: " + + GT_Utility.formatNumbers(getBaseMetaTileEntity().getInputAmperage())) + .setDefaultColor(COLOR_TEXT_WHITE.get())) + .widget( + new TextWidget(Text.localised("tooltip.LESU.0.name")).setDefaultColor(Color.YELLOW.getRGB()) + .setEnabled(widget -> maxEUStore() >= Long.MAX_VALUE - 1)) + .widget( + new TextWidget(Text.localised("tooltip.LESU.1.name")).setDefaultColor(Color.RED.getRGB()) + .setEnabled(widget -> !getBaseMetaTileEntity().isActive())); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index 38736f5849..caa178b893 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; @@ -30,10 +21,16 @@ import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElementNoPlacement; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -46,10 +43,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachi import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBlockBase { @@ -70,61 +63,57 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl private static final String STRUCTURE_PIECE_LAYER = "layer"; private static final String STRUCTURE_PIECE_TOP = "top"; private static final String STRUCTURE_PIECE_TAP_LAYER = "taplayer"; - private static final IStructureDefinition STRUCTURE_DEFINITION = - StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] {{"b~b", "bbb", "bbb"}})) - .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] {{"ttt", "tft", "ttt"}})) - .addShape(STRUCTURE_PIECE_TOP, transpose(new String[][] {{"ooo", "ooo", "ooo"}})) - .addShape( - STRUCTURE_PIECE_TAP_LAYER, - transpose(new String[][] {{" TTT ", "TtttT", "TtftT", "TtttT", " TTT "}})) - .addElement( - 'b', - ofChain( - ofHatchAdder( - GT_TileEntity_ManualTrafo::addEnergyInputToMachineList, CASING_INDEX, 1), - ofHatchAdder( - GT_TileEntity_ManualTrafo::addMaintenanceToMachineList, CASING_INDEX, 1), - ofBlock(GregTech_API.sBlockCasings1, 2))) - .addElement( - 'o', - ofHatchAdderOptional( - GT_TileEntity_ManualTrafo::addDynamoToMachineList, - CASING_INDEX, - 2, - GregTech_API.sBlockCasings1, - 2)) - .addElement('t', ofBlock(BW_BLOCKS[2], 1)) - .addElement('f', ofBlock(BW_BLOCKS[2], 0)) - .addElement('T', new IStructureElementNoPlacement() { - @Override - public boolean check(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z) { - if (world.isAirBlock(x, y, z)) return true; - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null) return true; - if (!(tileEntity instanceof IGregTechTileEntity)) return true; - IMetaTileEntity mte = ((IGregTechTileEntity) tileEntity).getMetaTileEntity(); - if (mte instanceof GT_MetaTileEntity_Hatch_Dynamo - || mte instanceof GT_MetaTileEntity_Hatch_Energy) { - int intier = te.mEnergyHatches.get(0).mTier; - if (((GT_MetaTileEntity_TieredMachineBlock) mte).mTier - == intier + (te.upstep ? te.mTiers : -te.mTiers)) { - te.addToMachineList((IGregTechTileEntity) tileEntity, CASING_INDEX); - return true; - } else return false; - } - return true; - } - - @Override - public boolean spawnHint( - GT_TileEntity_ManualTrafo te, World world, int x, int y, int z, ItemStack itemStack) { - StructureLibAPI.hintParticle( - world, x, y, z, StructureLibAPI.getBlockHint(), 2 /* aDots: 3 */); + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] { { "b~b", "bbb", "bbb" } })) + .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] { { "ttt", "tft", "ttt" } })) + .addShape(STRUCTURE_PIECE_TOP, transpose(new String[][] { { "ooo", "ooo", "ooo" } })) + .addShape( + STRUCTURE_PIECE_TAP_LAYER, + transpose(new String[][] { { " TTT ", "TtttT", "TtftT", "TtttT", " TTT " } })) + .addElement( + 'b', + ofChain( + ofHatchAdder(GT_TileEntity_ManualTrafo::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_ManualTrafo::addMaintenanceToMachineList, CASING_INDEX, 1), + ofBlock(GregTech_API.sBlockCasings1, 2))) + .addElement( + 'o', + ofHatchAdderOptional( + GT_TileEntity_ManualTrafo::addDynamoToMachineList, + CASING_INDEX, + 2, + GregTech_API.sBlockCasings1, + 2)) + .addElement('t', ofBlock(BW_BLOCKS[2], 1)).addElement('f', ofBlock(BW_BLOCKS[2], 0)) + .addElement('T', new IStructureElementNoPlacement() { + + @Override + public boolean check(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z) { + if (world.isAirBlock(x, y, z)) return true; + TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity == null) return true; + if (!(tileEntity instanceof IGregTechTileEntity)) return true; + IMetaTileEntity mte = ((IGregTechTileEntity) tileEntity).getMetaTileEntity(); + if (mte instanceof GT_MetaTileEntity_Hatch_Dynamo + || mte instanceof GT_MetaTileEntity_Hatch_Energy) { + int intier = te.mEnergyHatches.get(0).mTier; + if (((GT_MetaTileEntity_TieredMachineBlock) mte).mTier + == intier + (te.upstep ? te.mTiers : -te.mTiers)) { + te.addToMachineList((IGregTechTileEntity) tileEntity, CASING_INDEX); return true; - } - }) - .build(); + } else return false; + } + return true; + } + + @Override + public boolean spawnHint(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z, + ItemStack itemStack) { + StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 2 /* aDots: 3 */); + return true; + } + }).build(); @Override public IStructureDefinition getStructureDefinition() { @@ -134,23 +123,17 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Transformer") - .addInfo("Controller block for the Manual Trafo") - .addInfo("Operates in 4 diffrent modes:") - .addInfo("Mode 1: Circuit 0 in controller: Direct-Upstep") + tt.addMachineType("Transformer").addInfo("Controller block for the Manual Trafo") + .addInfo("Operates in 4 diffrent modes:").addInfo("Mode 1: Circuit 0 in controller: Direct-Upstep") .addInfo("Mode 2: Circuit 1 in controller: Direct-Downstep") .addInfo("Mode 3: Circuit 2 in controller: Tapped-Upstep (currently disabled)") - .addInfo("Mode 4: Circuit 2 in controller: Tapped-Downstep (currently disabled)") - .addSeparator() - .beginVariableStructureBlock(3, 3, 3, 10, 3, 3, false) - .addController("Front bottom center") + .addInfo("Mode 4: Circuit 2 in controller: Tapped-Downstep (currently disabled)").addSeparator() + .beginVariableStructureBlock(3, 3, 3, 10, 3, 3, false).addController("Front bottom center") .addCasingInfo("MV Machine Casing", 0) .addOtherStructurePart("Transformer-Winding Blocks", "1 Layer for each tier transformed") .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Middle of Transformer-Winding Blocks") - .addMaintenanceHatch("Any bottom layer casing", 1) - .addEnergyHatch("Any bottom layer casing", 1) - .addDynamoHatch("Any top layer casing", 2) - .addStructureInfo("---------TAPPED MODE---------") + .addMaintenanceHatch("Any bottom layer casing", 1).addEnergyHatch("Any bottom layer casing", 1) + .addDynamoHatch("Any top layer casing", 2).addStructureInfo("---------TAPPED MODE---------") .addEnergyHatch("Touching Transformer-Winding Blocks", 3) .addDynamoHatch("Touching Transformer-Winding Blocks", 3) .addStructureInfo("Hatches touching Transformer-Winding Blocks must be tiered from bottom to top") @@ -187,9 +170,8 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl return false; // this.onRunningTickTabbedMode(); Tapped mode is disable } - return this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) - && this.addEnergyOutput(this.getInputTier() - * 2 + return this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput( + this.getInputTier() * 2 * this.mEnergyHatches.size() * (long) this.mEfficiency / this.getMaxEfficiency(null)); @@ -216,15 +198,13 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl public long getInputTier() { if (this.mEnergyHatches.size() > 0) - return GT_Utility.getTier( - this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); + return GT_Utility.getTier(this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); else return 0L; } public long getOutputTier() { if (this.mDynamoHatches.size() > 0) - return GT_Utility.getTier( - this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); + return GT_Utility.getTier(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); else return 0L; } @@ -241,8 +221,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl this.mProgresstime = 0; this.mMaxProgresstime = 1; this.mEfficiency = Math.max(this.mEfficiency, 100); - return this.upstep - ? this.getOutputTier() - this.getInputTier() == this.mTiers + return this.upstep ? this.getOutputTier() - this.getInputTier() == this.mTiers : this.getInputTier() - this.getOutputTier() == this.mTiers; } @@ -324,47 +303,25 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - if (aActive) - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW) - .extFacing() - .glow() - .build() - }; - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW) - .extFacing() - .glow() - .build() - }; + if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).extFacing() + .glow().build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW).extFacing().glow() + .build() }; } - return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) }; } @Override public void construct(ItemStack itemStack, boolean b) { - if (this.mInventory[1] == null - || !this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) this.mode = 0; + if (this.mInventory[1] == null || !this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) + this.mode = 0; else this.mode = (byte) Math.min(3, this.mInventory[1].getItemDamage()); int mHeight = Math.min(itemStack.stackSize, 8); boolean tapmode = this.mode > 1; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index af69cef98a..4616dfabf8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; @@ -26,6 +17,14 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTI import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import java.util.Arrays; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -33,6 +32,7 @@ import com.github.bartimaeusnek.bartworks.util.MathUtils; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -49,194 +49,70 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import java.util.Arrays; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase { private static final int BASECASINGINDEX = 44; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition STRUCTURE_DEFINITION = - StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { - { - " BBBBBBB ", - " BBBBBBBBB ", - "BBBBBBBBBBB", - "BBBBBBBBBBB", - "BBBBBBBBBBB", - "BBBBBBBBBBB", - "BBBBBBBBBBB", - "BBBBBBBBBBB", - "BBBBBBBBBBB", - " BBBBBBBBB ", - " BBBBBBB " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " ccccccc ", - " c-------c ", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - "c---------c", - " c-------c ", - " ccccccc " - }, - { - " bbb~bbb ", - " bbbbbbbbb ", - "bbbbbbbbbbb", - "bbbbbbbbbbb", - "bbbbbbbbbbb", - "bbbbbbbbbbb", - "bbbbbbbbbbb", - "bbbbbbbbbbb", - "bbbbbbbbbbb", - " bbbbbbbbb ", - " bbbbbbb " - }, - })) - .addElement('c', onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12))) - .addElement( - 'b', - ofChain( - ofHatchAdder(GT_TileEntity_THTR::addOutputToMachineList, BASECASINGINDEX, 1), - ofHatchAdder(GT_TileEntity_THTR::addMaintenanceToMachineList, BASECASINGINDEX, 1), - ofHatchAdder(GT_TileEntity_THTR::addEnergyInputToMachineList, BASECASINGINDEX, 1), - onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12)))) - .addElement( - 'B', - ofChain( - ofHatchAdder(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2), - onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12)))) - // ofHatchAdderOptional(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2, - // GregTech_API.sBlockCasings3, 12)) - .build(); + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { + { " BBBBBBB ", " BBBBBBBBB ", "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", + "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", " BBBBBBBBB ", + " BBBBBBB " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", + " ccccccc " }, + { " bbb~bbb ", " bbbbbbbbb ", "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", + "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", " bbbbbbbbb ", + " bbbbbbb " }, })) + .addElement('c', onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12))) + .addElement( + 'b', + ofChain( + ofHatchAdder(GT_TileEntity_THTR::addOutputToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_THTR::addMaintenanceToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_THTR::addEnergyInputToMachineList, BASECASINGINDEX, 1), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12)))) + .addElement( + 'B', + ofChain( + ofHatchAdder(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12)))) + // ofHatchAdderOptional(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2, + // GregTech_API.sBlockCasings3, 12)) + .build(); private static final int HELIUM_NEEDED = 730000; private static final int powerUsage = BW_Util.getMachineVoltageFromTier(5) / 2; @@ -277,19 +153,13 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase .addInfo( "Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer") .addInfo("Reactor will take 4 800L/t of coolant multiplied by efficiency") - .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t") - .addInfo("One Operation takes 9 hour") - .addSeparator() - .beginStructureBlock(11, 12, 11, true) - .addController("Front bottom center") + .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t").addInfo("One Operation takes 9 hour") + .addSeparator().beginStructureBlock(11, 12, 11, true).addController("Front bottom center") .addCasingInfo("Radiation Proof Casings", 500) .addStructureInfo("Corners and the 2 touching blocks are air (cylindric)") - .addInputBus("Any top layer casing", 2) - .addInputHatch("Any top layer casing", 2) - .addOutputBus("Any bottom layer casing", 1) - .addOutputHatch("Any bottom layer casing", 1) - .addEnergyHatch("Any bottom layer casing", 1) - .addMaintenanceHatch("Any bottom layer casing", 1) + .addInputBus("Any top layer casing", 2).addInputHatch("Any top layer casing", 2) + .addOutputBus("Any bottom layer casing", 1).addOutputHatch("Any bottom layer casing", 1) + .addEnergyHatch("Any bottom layer casing", 1).addMaintenanceHatch("Any bottom layer casing", 1) .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -307,8 +177,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { this.mCasing = 0; - return (checkPiece(STRUCTURE_PIECE_MAIN, 5, 11, 0) - && this.mCasing >= 500 + return (checkPiece(STRUCTURE_PIECE_MAIN, 5, 11, 0) && this.mCasing >= 500 && this.mMaintenanceHatches.size() == 1 && this.mInputHatches.size() > 0 && this.mOutputHatches.size() > 0 @@ -382,14 +251,8 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.fuelsupply >= mincapacity)) return false; double eff = Math.min( - Math.pow( - (double) (this.fuelsupply - mincapacity) - / ((maxcapacity - mincapacity) / 10D), - 2D) - + 1, - 100D) - / 100D - - ((double) (getIdealStatus() - getRepairStatus()) / 10D); + Math.pow((double) (this.fuelsupply - mincapacity) / ((maxcapacity - mincapacity) / 10D), 2D) + 1, + 100D) / 100D - ((double) (getIdealStatus() - getRepairStatus()) / 10D); if (eff <= 0D) return false; int toReduce = MathUtils.floorInt((double) this.fuelsupply * 0.005D * eff); @@ -400,10 +263,8 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase int meta = THTRMaterials.MATERIAL_USED_FUEL_INDEX; - this.mOutputItems = new ItemStack[] { - new ItemStack(THTRMaterials.aTHTR_Materials, burnedballs, meta), - new ItemStack(THTRMaterials.aTHTR_Materials, toReduce, meta + 1) - }; + this.mOutputItems = new ItemStack[] { new ItemStack(THTRMaterials.aTHTR_Materials, burnedballs, meta), + new ItemStack(THTRMaterials.aTHTR_Materials, toReduce, meta + 1) }; // this.updateSlots(); not needed ? @@ -478,57 +339,39 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public String[] getInfoData() { - return new String[] { - "Progress:", - GT_Utility.formatNumbers(this.mProgresstime / 20) + "secs /" - + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "secs", - "TRISO-Pebbles:", - GT_Utility.formatNumbers(this.fuelsupply) + "pcs. / " + GT_Utility.formatNumbers(this.fuelsupply) - + "psc.", - "Helium-Level:", - GT_Utility.formatNumbers(this.HeliumSupply) + "L / " - + GT_Utility.formatNumbers(GT_TileEntity_THTR.HELIUM_NEEDED) + "L", - "Coolant/t:", GT_Utility.formatNumbers(this.mProgresstime == 0 ? 0 : coolanttaking) + "L/t", - "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) - }; + return new String[] { "Progress:", + GT_Utility.formatNumbers(this.mProgresstime / 20) + "secs /" + + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + + "secs", + "TRISO-Pebbles:", + GT_Utility.formatNumbers(this.fuelsupply) + "pcs. / " + + GT_Utility.formatNumbers(this.fuelsupply) + + "psc.", + "Helium-Level:", + GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + + GT_Utility.formatNumbers(GT_TileEntity_THTR.HELIUM_NEEDED) + + "L", + "Coolant/t:", GT_Utility.formatNumbers(this.mProgresstime == 0 ? 0 : coolanttaking) + "L/t", + "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), - TextureFactory.builder() - .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) - .extFacing() + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) + .extFacing().build(), + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW) + .extFacing().glow().build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER).extFacing() .build(), - TextureFactory.builder() - .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW) - .extFacing() - .glow() - .build() - }; - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), - TextureFactory.builder() - .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW) - .extFacing() - .glow() - .build() - }; + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).extFacing() + .glow().build() }; } - return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX)}; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX) }; } @Override @@ -539,10 +382,12 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase } this.empty = !this.empty; GT_Utility.sendChatToPlayer( - aPlayer, "THTR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); + aPlayer, + "THTR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); } public static class THTRMaterials { + static final SimpleSubItemClass aTHTR_Materials = new SimpleSubItemClass( "BISOPelletCompound", // 0 "BISOPelletBall", // 1 @@ -551,7 +396,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase "TRISOPellet", // 4 "BurnedOutTRISOPelletBall", // 5 "BurnedOutTRISOPellet" // 6 - ); + ); public static final int MATERIAL_FUEL_INDEX = 4; public static final int MATERIAL_USED_FUEL_INDEX = 5; @@ -571,14 +416,12 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), GT_Values.NI, - new int[] {800, 375, 22, 22, 5}, + new int[] { 800, 375, 22, 22, 5 }, 10000, BW_Util.getMachineVoltageFromTier(4)); GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 6), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1) - }, + new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 6), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1) }, Materials.Concrete.getMolten(1296), new ItemStack(GregTech_API.sBlockCasings3, 1, 12), 40, @@ -615,10 +458,8 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase Arrays.fill(pellets, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 4)); GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( false, - new ItemStack[] { - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3), - GT_Utility.getIntegratedCircuit(17) - }, + new ItemStack[] { new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3), + GT_Utility.getIntegratedCircuit(17) }, pellets, null, null, @@ -629,11 +470,9 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase 0); GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( false, - new ItemStack[] { - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 5), - GT_Utility.getIntegratedCircuit(17) - }, - new ItemStack[] {new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 6)}, + new ItemStack[] { new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 5), + GT_Utility.getIntegratedCircuit(17) }, + new ItemStack[] { new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 6) }, null, null, null, @@ -652,7 +491,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase GT_Values.NI, GT_Values.NI, GT_Values.NI, - new int[] {300}, + new int[] { 300 }, 1200, 30); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 93b003e1b8..8c54264fb7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; @@ -26,6 +17,23 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTI import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_Values.V; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.items.BW_Stonage_Rotors; @@ -47,6 +55,7 @@ import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.SlotWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; + import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -66,21 +75,6 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityDispenser; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable, IGetTitleColor { @@ -104,95 +98,76 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock } private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition STRUCTURE_DEFINITION = - StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { - {" ", " ", " ", " p ", " ", " ", " "}, - {" ", " ", " ppp ", " p p ", " ppp ", " ", " "}, - {" ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " "}, - {" ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, - {" ppspp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, - {" ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, - {" ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " "}, - {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, - {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, - {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, - {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, - {" bb~bb ", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", " bbbbb "}, - })) - .addElement('p', ofBlockAnyMeta(Blocks.planks)) - .addElement( - 'c', - ofChain( - onElementPass(t -> t.mHardenedClay++, ofBlock(Blocks.hardened_clay, 0)), - ofTileAdder( - GT_TileEntity_Windmill::addDispenserToOutputSet, Blocks.hardened_clay, 0), - onElementPass( - t -> t.mDoor++, new IStructureElementNoPlacement() { - private final IStructureElement delegate = - ofBlock(Blocks.wooden_door, 0); - - @Override - public boolean check( - GT_TileEntity_Windmill gt_tileEntity_windmill, - World world, - int x, - int y, - int z) { - return delegate.check(gt_tileEntity_windmill, world, x, y, z); - } - - @Override - public boolean spawnHint( - GT_TileEntity_Windmill gt_tileEntity_windmill, - World world, - int x, - int y, - int z, - ItemStack trigger) { - return delegate.spawnHint( - gt_tileEntity_windmill, world, x, y, z, trigger); - } - }))) - .addElement('b', ofBlock(Blocks.brick_block, 0)) - .addElement('s', new IStructureElement() { - @Override - public boolean check(GT_TileEntity_Windmill t, World world, int x, int y, int z) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - return t.setRotorBlock(tileEntity); - } + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { + { " ", " ", " ", " p ", " ", " ", " " }, + { " ", " ", " ppp ", " p p ", " ppp ", " ", " " }, + { " ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " " }, + { " ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp " }, + { " ppspp ", "p p", "p p", "p p", "p p", "p p", " ppppp " }, + { " ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp " }, + { " ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " " }, + { " ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " " }, + { " ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " " }, + { " ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " " }, + { " ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " " }, + { " bb~bb ", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", " bbbbb " }, })) + .addElement('p', ofBlockAnyMeta(Blocks.planks)) + .addElement( + 'c', + ofChain( + onElementPass(t -> t.mHardenedClay++, ofBlock(Blocks.hardened_clay, 0)), + ofTileAdder(GT_TileEntity_Windmill::addDispenserToOutputSet, Blocks.hardened_clay, 0), + onElementPass(t -> t.mDoor++, new IStructureElementNoPlacement() { + + private final IStructureElement delegate = ofBlock( + Blocks.wooden_door, + 0); + + @Override + public boolean check(GT_TileEntity_Windmill gt_tileEntity_windmill, World world, int x, + int y, int z) { + return delegate.check(gt_tileEntity_windmill, world, x, y, z); + } - @Override - public boolean spawnHint( - GT_TileEntity_Windmill t, World world, int x, int y, int z, ItemStack trigger) { - StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 0); - return true; - } + @Override + public boolean spawnHint(GT_TileEntity_Windmill gt_tileEntity_windmill, World world, + int x, int y, int z, ItemStack trigger) { + return delegate.spawnHint(gt_tileEntity_windmill, world, x, y, z, trigger); + } + }))) + .addElement('b', ofBlock(Blocks.brick_block, 0)) + .addElement('s', new IStructureElement() { + + @Override + public boolean check(GT_TileEntity_Windmill t, World world, int x, int y, int z) { + TileEntity tileEntity = world.getTileEntity(x, y, z); + return t.setRotorBlock(tileEntity); + } - @Override - public boolean placeBlock( - GT_TileEntity_Windmill gt_tileEntity_windmill, - World world, - int x, - int y, - int z, - ItemStack trigger) { - return false; - } + @Override + public boolean spawnHint(GT_TileEntity_Windmill t, World world, int x, int y, int z, + ItemStack trigger) { + StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 0); + return true; + } - @Override - public BlocksToPlace getBlocksToPlace( - GT_TileEntity_Windmill gt_tileEntity_windmill, - World world, - int x, - int y, - int z, - ItemStack trigger, - AutoPlaceEnvironment env) { - return BlocksToPlace.create(new ItemStack(ItemRegistry.ROTORBLOCK)); - } - }) - .build(); + @Override + public boolean placeBlock(GT_TileEntity_Windmill gt_tileEntity_windmill, World world, int x, int y, + int z, ItemStack trigger) { + return false; + } + + @Override + public BlocksToPlace getBlocksToPlace(GT_TileEntity_Windmill gt_tileEntity_windmill, World world, int x, + int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { + return BlocksToPlace.create(new ItemStack(ItemRegistry.ROTORBLOCK)); + } + }).build(); @Override public IStructureDefinition getStructureDefinition() { @@ -207,22 +182,16 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Windmill") - .addInfo("Controller block for the Windmill") + tt.addMachineType("Windmill").addInfo("Controller block for the Windmill") .addInfo("A primitive Grinder powered by Kinetic energy") .addInfo("Speed and output will be affected by wind speed, recipe and rotor") - .addInfo("Please use the Primitive Rotor") - .addInfo("Macerates 16 items at a time") + .addInfo("Please use the Primitive Rotor").addInfo("Macerates 16 items at a time") .addInfo("The structure is too complex!") - .addInfo("Follow the StructureLib hologram projector to build the main structure.") - .addSeparator() - .beginStructureBlock(7, 12, 7, false) - .addController("Front bottom center") - .addCasingInfo("Hardened Clay block", 40) - .addOtherStructurePart("Dispenser", "Any Hardened Clay block") + .addInfo("Follow the StructureLib hologram projector to build the main structure.").addSeparator() + .beginStructureBlock(7, 12, 7, false).addController("Front bottom center") + .addCasingInfo("Hardened Clay block", 40).addOtherStructurePart("Dispenser", "Any Hardened Clay block") .addOtherStructurePart("0-1 Wooden door", "Any Hardened Clay block") - .addStructureHint("Primitive Kinetic Shaftbox", 1) - .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + .addStructureHint("Primitive Kinetic Shaftbox", 1).toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -252,10 +221,11 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock private float[] multiplierRecipe(ItemStack itemStack) { // will return max and min value of the multiplier, the average of these is used to calculate the multiplier. - if (itemStack.getItem().equals(Items.wheat)) return new float[] {1.13f, 1.5f}; + if (itemStack.getItem().equals(Items.wheat)) return new float[] { 1.13f, 1.5f }; else if (itemStack.getItem().equals(Items.bone) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glowstone) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.pumpkin)) return new float[] {0.8f, 1f}; + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.pumpkin)) + return new float[] { 0.8f, 1f }; else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.gravel) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.cobblestone) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stone) @@ -266,16 +236,14 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.wool) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.netherrack) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log2)) return new float[] {1f, 1.5f}; + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log2)) + return new float[] { 1f, 1.5f }; else if (GT_OreDictUnificator.getAssociation(itemStack) == null || GT_OreDictUnificator.getAssociation(itemStack).mPrefix == null || GT_OreDictUnificator.getAssociation(itemStack).mMaterial == null || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial == null - || GT_OreDictUnificator.getAssociation(itemStack) - .mMaterial - .mMaterial - .getDust(1) - == null) return new float[] {1f, 1f}; + || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.getDust(1) == null) + return new float[] { 1f, 1f }; else if (OrePrefixes.ore.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.oreNetherrack.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.oreEndstone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) @@ -283,7 +251,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock || OrePrefixes.oreRedgranite.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.oreMarble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.oreBasalt.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) - return new float[] {0.5f, 1f}; + return new float[] { 0.5f, 1f }; else if (OrePrefixes.stone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.stoneBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.stoneChiseled.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) @@ -293,8 +261,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock || OrePrefixes.stoneMossyBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.stoneSmooth.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.cobblestone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) - return new float[] {1f, 1.5f}; - return new float[] {1f, 1f}; + return new float[] { 1f, 1.5f }; + return new float[] { 1f, 1f }; } @Override @@ -324,8 +292,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock mRecipe[1], Math.max( mRecipe[0], - 2f - * ((float) Math.sqrt((float) 1 / (this.rotorBlock.getWindStrength() + 1))) + 2f * ((float) Math.sqrt((float) 1 / (this.rotorBlock.getWindStrength() + 1))) * OutputMultiplier(rotorBlock) * (mRecipe[0] + mRecipe[1]))); int amount = (int) Math.floor(multiper * (this.mOutputItems[0].stackSize * this.mMulti)); @@ -376,9 +343,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock for (TileEntityDispenser tHatch : this.tileEntityDispensers) { for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) { - if (tHatch.getStackInSlot(i) == null - || GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack) - && aStack.stackSize + tHatch.getStackInSlot(i).stackSize <= 64) { + if (tHatch.getStackInSlot(i) == null || GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack) + && aStack.stackSize + tHatch.getStackInSlot(i).stackSize <= 64) { if (GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack)) { ItemStack merge = tHatch.getStackInSlot(i).copy(); merge.stackSize = aStack.stackSize + tHatch.getStackInSlot(i).stackSize; @@ -461,12 +427,9 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public String[] getInfoData() { - return new String[] { - "Progress:", - this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", - "GrindPower:", - this.rotorBlock.getGrindPower() + "KU/t" - }; + return new String[] { "Progress:", + this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", + this.rotorBlock.getGrindPower() + "KU/t" }; } @SideOnly(Side.CLIENT) @@ -474,6 +437,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock public void registerIcons(IIconRegister aBlockIconRegister) { GT_TileEntity_Windmill.iIcons[0] = Blocks.brick_block.getIcon(0, 0); GT_TileEntity_Windmill.iIconContainers[0] = new IIconContainer() { + @Override public IIcon getIcon() { return GT_TileEntity_Windmill.iIcons[0]; @@ -492,6 +456,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock GT_TileEntity_Windmill.iIcons[1] = aBlockIconRegister.registerIcon(MainMod.MOD_ID + ":windmill_top"); GT_TileEntity_Windmill.iIconContainers[1] = new IIconContainer() { + @Override public IIcon getIcon() { return GT_TileEntity_Windmill.iIcons[1]; @@ -510,13 +475,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { ITexture[] ret = new ITexture[6]; @@ -537,10 +497,9 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock } public boolean isClientSide() { - if (this.getBaseMetaTileEntity().getWorld() != null) - return this.getBaseMetaTileEntity().getWorld().isRemote - ? FMLCommonHandler.instance().getSide() == Side.CLIENT - : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; + if (this.getBaseMetaTileEntity().getWorld() != null) return this.getBaseMetaTileEntity().getWorld().isRemote + ? FMLCommonHandler.instance().getSide() == Side.CLIENT + : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; } @@ -582,10 +541,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public GUITextureSet getGUITextureSet() { - return new GUITextureSet() - .setMainBackground(BW_UITextures.BACKGROUND_BROWN) - .setItemSlot(BW_UITextures.SLOT_BROWN) - .setTitleTab( + return new GUITextureSet().setMainBackground(BW_UITextures.BACKGROUND_BROWN) + .setItemSlot(BW_UITextures.SLOT_BROWN).setTitleTab( BW_UITextures.TAB_TITLE_BROWN, BW_UITextures.TAB_TITLE_DARK_BROWN, BW_UITextures.TAB_TITLE_ANGULAR_BROWN); @@ -593,10 +550,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public void addGregTechLogo(ModularWindow.Builder builder) { - builder.widget(new DrawableWidget() - .setDrawable(BW_UITextures.PICTURE_BW_LOGO_47X21) - .setSize(47, 21) - .setPos(123, 59)); + builder.widget( + new DrawableWidget().setDrawable(BW_UITextures.PICTURE_BW_LOGO_47X21).setSize(47, 21).setPos(123, 59)); } @Override @@ -606,48 +561,48 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new SlotWidget(inventoryHandler, 1) - .setBackground(getGUITextureSet().getItemSlot()) - .setPos(59, 35)) - .widget( - new DrawableWidget() { - private static final int DIVIDER = 125; - - @Override - public void onScreenUpdate() { - super.onScreenUpdate(); - if (mMaxProgresstime > 0) { - if (System.currentTimeMillis() / DIVIDER % 40 == 30) - setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[3]); - else if (System.currentTimeMillis() / DIVIDER % 40 == 20) - setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[2]); - else if (System.currentTimeMillis() / DIVIDER % 40 == 10) - setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[1]); - else if (System.currentTimeMillis() / DIVIDER % 40 == 0) - setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[0]); - } else { - setDrawable(BW_UITextures.PICTURE_WINDMILL_EMPTY); - } - } - }.setDrawable(BW_UITextures.PICTURE_WINDMILL_EMPTY) - .setPos(85, 27) - .setSize(32, 32)) + builder.widget( + new SlotWidget(inventoryHandler, 1).setBackground(getGUITextureSet().getItemSlot()).setPos(59, 35)) + .widget(new DrawableWidget() { + + private static final int DIVIDER = 125; + + @Override + public void onScreenUpdate() { + super.onScreenUpdate(); + if (mMaxProgresstime > 0) { + if (System.currentTimeMillis() / DIVIDER % 40 == 30) + setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[3]); + else if (System.currentTimeMillis() / DIVIDER % 40 == 20) + setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[2]); + else if (System.currentTimeMillis() / DIVIDER % 40 == 10) + setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[1]); + else if (System.currentTimeMillis() / DIVIDER % 40 == 0) + setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[0]); + } else { + setDrawable(BW_UITextures.PICTURE_WINDMILL_EMPTY); + } + } + }.setDrawable(BW_UITextures.PICTURE_WINDMILL_EMPTY).setPos(85, 27).setSize(32, 32)) .widget(new FakeSyncWidget.IntegerSyncer(() -> mMaxProgresstime, val -> mMaxProgresstime = val)) - .widget(new ItemDrawable( + .widget( + new ItemDrawable( () -> mMachine && !getBaseMetaTileEntity().isActive() ? GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SOFTMALLET, 1, null, null, null) - : null) - .asWidget() - .setPos(66, 66)) - .widget(new FakeSyncWidget.BooleanSyncer( - () -> getBaseMetaTileEntity().isActive(), - val -> getBaseMetaTileEntity().setActive(val))) - .widget(new TextWidget(GT_Utility.trans("138", "Incomplete Structure.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setMaxWidth(150) - .setEnabled(widget -> !mMachine) - .setPos(92, 22)) + GT_MetaGenerated_Tool_01.SOFTMALLET, + 1, + null, + null, + null) + : null).asWidget().setPos(66, 66)) + .widget( + new FakeSyncWidget.BooleanSyncer( + () -> getBaseMetaTileEntity().isActive(), + val -> getBaseMetaTileEntity().setActive(val))) + .widget( + new TextWidget(GT_Utility.trans("138", "Incomplete Structure.")) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setMaxWidth(150) + .setEnabled(widget -> !mMachine).setPos(92, 22)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 845ba95beb..bb00ef8063 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; @@ -33,6 +24,16 @@ import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofCoil; +import java.util.*; +import java.util.stream.Collectors; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -44,6 +45,7 @@ import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructa import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.enums.HeatingCoilLevel; @@ -57,14 +59,6 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OverclockCalculator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import java.util.*; -import java.util.stream.Collectors; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidStack; @Optional.Interface( iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", @@ -74,51 +68,46 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock implements ISurvivalConstructable { private static final int CASING_INDEX = 11; - private static final IStructureDefinition STRUCTURE_DEFINITION = - StructureDefinition.builder() - .addShape("main", createShape()) - .addElement('=', StructureElementAirNoHint.getInstance()) - .addElement( - 't', - buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) - .atLeast(OutputHatch.withAdder( - GT_TileEntity_MegaBlastFurnace::addOutputHatchToTopList) + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder().addShape("main", createShape()) + .addElement('=', StructureElementAirNoHint.getInstance()) + .addElement( + 't', + buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) + .atLeast( + OutputHatch.withAdder(GT_TileEntity_MegaBlastFurnace::addOutputHatchToTopList) .withCount(t -> t.mPollutionOutputHatches.size())) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX)) - .addElement('m', Muffler.newAny(CASING_INDEX, 2)) - .addElement( - 'C', - withChannel( - "coil", - ofCoil( - GT_TileEntity_MegaBlastFurnace::setCoilLevel, - GT_TileEntity_MegaBlastFurnace::getCoilLevel))) - .addElement( - 'g', - withChannel( - "glass", - BorosilicateGlass.ofBoroGlass( - (byte) 0, - (byte) 1, - Byte.MAX_VALUE, - (te, t) -> te.glasTier = t, - te -> te.glasTier))) - .addElement( - 'b', - buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) - .atLeast( - InputHatch, - OutputHatch, - InputBus, - OutputBus, - Maintenance, - TTEnabledEnergyHatchElement.INSTANCE) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX)) - .build(); + .casingIndex(CASING_INDEX).dot(1).buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX)) + .addElement('m', Muffler.newAny(CASING_INDEX, 2)) + .addElement( + 'C', + withChannel( + "coil", + ofCoil( + GT_TileEntity_MegaBlastFurnace::setCoilLevel, + GT_TileEntity_MegaBlastFurnace::getCoilLevel))) + .addElement( + 'g', + withChannel( + "glass", + BorosilicateGlass.ofBoroGlass( + (byte) 0, + (byte) 1, + Byte.MAX_VALUE, + (te, t) -> te.glasTier = t, + te -> te.glasTier))) + .addElement( + 'b', + buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) + .atLeast( + InputHatch, + OutputHatch, + InputBus, + OutputBus, + Maintenance, + TTEnabledEnergyHatchElement.INSTANCE) + .casingIndex(CASING_INDEX).dot(1).buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX)) + .build(); private static String[][] createShape() { String[][] raw = new String[20][]; @@ -160,11 +149,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock private HeatingCoilLevel mCoilLevel; protected final ArrayList mPollutionOutputHatches = new ArrayList<>(); - protected final FluidStack[] pollutionFluidStacks = { - Materials.CarbonDioxide.getGas(1000), - Materials.CarbonMonoxide.getGas(1000), - Materials.SulfurDioxide.getGas(1000) - }; + protected final FluidStack[] pollutionFluidStacks = { Materials.CarbonDioxide.getGas(1000), + Materials.CarbonMonoxide.getGas(1000), Materials.SulfurDioxide.getGas(1000) }; private int mHeatingCapacity; private byte glasTier; private int polPtick = ConfigHandler.basePollutionMBFSecond / 20 * ConfigHandler.megaMachinesMax; @@ -186,28 +172,21 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Blast Furnace") - .addInfo("Controller block for the Mega Blast Furnace") + tt.addMachineType("Blast Furnace").addInfo("Controller block for the Mega Blast Furnace") .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") .addInfo("Each 900K over the min. Heat required reduces power consumption by 5% (multiplicatively)") .addInfo("Each 1800K over the min. Heat required grants one perfect overclock") .addInfo( "For each perfect overclock the EBF will reduce recipe time 4 times (instead of 2) (100% efficiency)") .addInfo("Additionally gives +100K for every tier past MV") - .addPollutionAmount(20 * getPollutionPerTick(null)) - .addSeparator() - .beginStructureBlock(15, 20, 15, true) - .addController("3rd layer center") - .addCasingInfo("Heat Proof Machine Casing", 0) + .addPollutionAmount(20 * getPollutionPerTick(null)).addSeparator().beginStructureBlock(15, 20, 15, true) + .addController("3rd layer center").addCasingInfo("Heat Proof Machine Casing", 0) .addOtherStructurePart("864x Heating Coils", "Inner 13x18x13 (Hollow)") .addOtherStructurePart("1007x Borosilicate Glass", "Outer 15x18x15") .addStructureInfo("The glass tier limits the Energy Input tier") - .addEnergyHatch("Any bottom layer casing") - .addMaintenanceHatch("Any bottom layer casing") - .addMufflerHatch("Top middle 13x13") - .addInputBus("Any bottom layer casing") - .addInputHatch("Any bottom layer casing") - .addOutputBus("Any bottom layer casing") + .addEnergyHatch("Any bottom layer casing").addMaintenanceHatch("Any bottom layer casing") + .addMufflerHatch("Top middle 13x13").addInputBus("Any bottom layer casing") + .addInputHatch("Any bottom layer casing").addOutputBus("Any bottom layer casing") .addOutputHatch("Gasses, Any top layer casing") .addStructureInfo("Recovery amount scales with Muffler Hatch tier") .addOutputHatch("Platline fluids, Any bottom layer casing") @@ -245,8 +224,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock } @Override - public boolean onWireCutterRightClick( - byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, + float aZ) { if (aPlayer.isSneaking()) { mUseMultiparallelMode = !mUseMultiparallelMode; if (mUseMultiparallelMode) { @@ -258,47 +237,26 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock } else { isBussesSeparate = !isBussesSeparate; GT_Utility.sendChatToPlayer( - aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate); + aPlayer, + StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate); return true; } } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - if (aActive) - return new ITexture[] { - casingTexturePages[0][CASING_INDEX], - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW) - .extFacing() - .glow() - .build() - }; - return new ITexture[] { - casingTexturePages[0][CASING_INDEX], - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW) - .extFacing() - .glow() - .build() - }; + if (aActive) return new ITexture[] { casingTexturePages[0][CASING_INDEX], + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).extFacing() + .glow().build() }; + return new ITexture[] { casingTexturePages[0][CASING_INDEX], + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW).extFacing().glow() + .build() }; } - return new ITexture[] {casingTexturePages[0][CASING_INDEX]}; + return new ITexture[] { casingTexturePages[0][CASING_INDEX] }; } @Override @@ -346,8 +304,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = null; FluidStack[] tFluids = this.getStoredFluids().toArray(new FluidStack[0]); - long nominalV = - LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) + : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); GT_Recipe tRecipe = null; @@ -364,36 +322,35 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock } } } - tInputs = - Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, tInputList.size()); + tInputs = Arrays + .copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, tInputList.size()); tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe( - this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + this.getBaseMetaTileEntity(), + false, + gregtech.api.enums.GT_Values.V[tTier], + tFluids, + tInputs); if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(false, tFluids, tInputs))) { break; } } } else { tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - if (circuitMode > 0 - && Arrays.stream(tInputs) - .anyMatch(e -> - GT_Utility.areStacksEqual(e, GT_Utility.getIntegratedCircuit(circuitMode), true))) { - List modInputs = Arrays.stream(tInputs) - .filter(Objects::nonNull) - .filter(e -> !e.getItem() - .equals(GT_Utility.getIntegratedCircuit(circuitMode) - .getItem())) + if (circuitMode > 0 && Arrays.stream(tInputs) + .anyMatch(e -> GT_Utility.areStacksEqual(e, GT_Utility.getIntegratedCircuit(circuitMode), true))) { + List modInputs = Arrays.stream(tInputs).filter(Objects::nonNull) + .filter(e -> !e.getItem().equals(GT_Utility.getIntegratedCircuit(circuitMode).getItem())) .collect(Collectors.toList()); modInputs.add(GT_Utility.getIntegratedCircuit(circuitMode)); tInputs = modInputs.toArray(new ItemStack[0]); } - tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe( - this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); + tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes + .findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); if (tRecipe == null) { if (circuitMode == 0) return false; tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe( - this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); + tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes + .findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); } } @@ -415,8 +372,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock float tBatchMultiplier = 1.0f; if (this.mHeatingCapacity >= tRecipe.mSpecialValue) { int tCurrentPara = handleParallelRecipe(tRecipe, tFluids, tInputs, (int) tMaxPara); - tBatchMultiplier = - mUseMultiparallelMode ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) : 1.0f; + tBatchMultiplier = mUseMultiparallelMode + ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) + : 1.0f; this.updateSlots(); if (tCurrentPara <= 0) return false; processed = Math.min(tCurrentPara, ConfigHandler.megaMachinesMax); @@ -430,16 +388,10 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(tRecipe.mEUt) - .setParallel(processed) - .setDuration(tRecipe.mDuration) - .setEUt(nominalV) - .setRecipeHeat(tRecipe.mSpecialValue) - .setMultiHeat(mHeatingCapacity) - .enableHeatOC() - .enableHeatDiscount() - .calculate(); + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt) + .setParallel(processed).setDuration(tRecipe.mDuration).setEUt(nominalV) + .setRecipeHeat(tRecipe.mSpecialValue).setMultiHeat(mHeatingCapacity).enableHeatOC() + .enableHeatDiscount().calculate(); this.mMaxProgresstime = calculator.getDuration(); this.lEUt = calculator.getConsumption(); @@ -546,15 +498,15 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock if (mMaintenanceHatches.size() != 1) return false; if (LoaderReference.tectech && this.glasTier < 8) - if (!areLazorsLowPowa() - || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) - || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) return false; + if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) + || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) + return false; if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) if (this.glasTier < hatchEnergy.mTier) return false; - long nominalV = - LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) + : BW_Util.getnominalVoltage(this); this.mHeatingCapacity = (int) getCoilLevel().getHeat() + 100 * (BW_Util.getTier(nominalV) - 2); return true; @@ -563,9 +515,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @SuppressWarnings("rawtypes") @Optional.Method(modid = "tectech") private boolean areThingsNotProperlyTiered(Collection collection) { - if (!collection.isEmpty()) - for (Object tecTechEnergyMulti : collection) - if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; + if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) + if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; return false; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index c9e2a9d3f9..b8dda555e6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; @@ -31,6 +22,16 @@ import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; +import java.util.Collection; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -41,6 +42,7 @@ import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructa import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.interfaces.ITexture; @@ -53,14 +55,6 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OverclockCalculator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import java.util.ArrayList; -import java.util.Collection; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidStack; @Optional.Interface( iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", @@ -82,26 +76,17 @@ public class GT_TileEntity_MegaChemicalReactor @Override public GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Chemical Reactor") - .addInfo("Controller block for the Chemical Reactor") + tt.addMachineType("Chemical Reactor").addInfo("Controller block for the Chemical Reactor") .addInfo("What molecule do you want to synthesize") - .addInfo("Or you want to replace something in this molecule") - .addInfo("The structure is too complex!") - .addInfo("Follow the Structure Lib hologram projector to build the main structure.") - .addSeparator() - .beginStructureBlock(5, 5, 9, false) - .addController("Front center") + .addInfo("Or you want to replace something in this molecule").addInfo("The structure is too complex!") + .addInfo("Follow the Structure Lib hologram projector to build the main structure.").addSeparator() + .beginStructureBlock(5, 5, 9, false).addController("Front center") .addStructureInfo("46x Chemically Inert Machine Casing (minimum)") - .addStructureInfo("7x Fusion Coil Block") - .addStructureInfo("28x PTFE Pipe Casing") + .addStructureInfo("7x Fusion Coil Block").addStructureInfo("28x PTFE Pipe Casing") .addStructureInfo("64x Borosilicate Glass Block (any tier)") - .addStructureInfo("The glass tier limits the Energy Input tier") - .addEnergyHatch("Hint block ", 3) - .addMaintenanceHatch("Hint block ", 2) - .addInputHatch("Hint block ", 1) - .addInputBus("Hint block ", 1) - .addOutputBus("Hint block ", 1) - .addOutputHatch("Hint block ", 1) + .addStructureInfo("The glass tier limits the Energy Input tier").addEnergyHatch("Hint block ", 3) + .addMaintenanceHatch("Hint block ", 2).addInputHatch("Hint block ", 1).addInputBus("Hint block ", 1) + .addOutputBus("Hint block ", 1).addOutputHatch("Hint block ", 1) .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -112,41 +97,19 @@ public class GT_TileEntity_MegaChemicalReactor } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - if (aActive) - return new ITexture[] { - casingTexturePages[1][48], - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW) - .extFacing() - .glow() - .build() - }; - return new ITexture[] { - casingTexturePages[1][48], - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW) - .extFacing() - .glow() - .build() - }; + if (aActive) return new ITexture[] { casingTexturePages[1][48], + TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW).extFacing() + .glow().build() }; + return new ITexture[] { casingTexturePages[1][48], + TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW).extFacing().glow() + .build() }; } - return new ITexture[] {casingTexturePages[1][48]}; + return new ITexture[] { casingTexturePages[1][48] }; } @Override @@ -169,8 +132,8 @@ public class GT_TileEntity_MegaChemicalReactor } @Override - public boolean onWireCutterRightClick( - byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, + float aZ) { if (aPlayer.isSneaking()) { mUseMultiparallelMode = !mUseMultiparallelMode; if (mUseMultiparallelMode) { @@ -190,13 +153,13 @@ public class GT_TileEntity_MegaChemicalReactor ArrayList outputItems = new ArrayList<>(); ArrayList outputFluids = new ArrayList<>(); - long nominalV = - LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) + : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.findRecipe( - this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes + .findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); boolean found_Recipe = false; int processed = 0; float tBatchMultiplier = 1.0f; @@ -209,8 +172,9 @@ public class GT_TileEntity_MegaChemicalReactor } int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); - tBatchMultiplier = - mUseMultiparallelMode ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) : 1.0f; + tBatchMultiplier = mUseMultiparallelMode + ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) + : 1.0f; this.updateSlots(); if (tCurrentPara <= 0) { @@ -226,12 +190,8 @@ public class GT_TileEntity_MegaChemicalReactor this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(tRecipe.mEUt) - .setParallel(processed) - .setDuration(tRecipe.mDuration) - .setEUt(nominalV) - .enablePerfectOC() + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt) + .setParallel(processed).setDuration(tRecipe.mDuration).setEUt(nominalV).enablePerfectOC() .calculate(); this.mMaxProgresstime = calculator.getDuration(); @@ -285,9 +245,9 @@ public class GT_TileEntity_MegaChemicalReactor if (mMaintenanceHatches.size() != 1) return false; if (LoaderReference.tectech && this.glasTier < 8) - if (!areLazorsLowPowa() - || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) - || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) return false; + if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) + || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) + return false; if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) @@ -298,38 +258,41 @@ public class GT_TileEntity_MegaChemicalReactor private static final int CASING_INDEX = 176; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition STRUCTURE_DEFINITION = - StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { - {"ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "ttttt"}, - {"tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet"}, - {"tg~gt", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", "teret"}, - {"tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet"}, - {"ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "ttttt"}, - })) - .addElement('p', ofBlock(GregTech_API.sBlockCasings8, 1)) - .addElement('t', ofBlock(GregTech_API.sBlockCasings8, 0)) - .addElement( - 'd', - buildHatchAdder(GT_TileEntity_MegaChemicalReactor.class) - .atLeast(InputBus, InputHatch, OutputBus, OutputHatch) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(GregTech_API.sBlockCasings8, 0)) - .addElement('r', Maintenance.newAny(CASING_INDEX, 2)) - .addElement( - 'e', - ofChain( - TTEnabledEnergyHatchElement.INSTANCE.newAny(CASING_INDEX, 3), - ofBlock(GregTech_API.sBlockCasings8, 0))) - .addElement( - 'c', - ofChain(ofBlock(GregTech_API.sBlockCasings4, 7), ofBlock(GregTech_API.sBlockCasings5, 13))) - .addElement( - 'g', - BorosilicateGlass.ofBoroGlass( - (byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) - .build(); + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { + { "ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "ttttt" }, + { "tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet" }, + { "tg~gt", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", "teret" }, + { "tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet" }, + { "ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", + "ttttt" }, })) + .addElement('p', ofBlock(GregTech_API.sBlockCasings8, 1)) + .addElement('t', ofBlock(GregTech_API.sBlockCasings8, 0)) + .addElement( + 'd', + buildHatchAdder(GT_TileEntity_MegaChemicalReactor.class) + .atLeast(InputBus, InputHatch, OutputBus, OutputHatch).casingIndex(CASING_INDEX).dot(1) + .buildAndChain(GregTech_API.sBlockCasings8, 0)) + .addElement('r', Maintenance.newAny(CASING_INDEX, 2)) + .addElement( + 'e', + ofChain( + TTEnabledEnergyHatchElement.INSTANCE.newAny(CASING_INDEX, 3), + ofBlock(GregTech_API.sBlockCasings8, 0))) + .addElement('c', ofChain(ofBlock(GregTech_API.sBlockCasings4, 7), ofBlock(GregTech_API.sBlockCasings5, 13))) + .addElement( + 'g', + BorosilicateGlass.ofBoroGlass( + (byte) 0, + (byte) 1, + Byte.MAX_VALUE, + (te, t) -> te.glasTier = t, + te -> te.glasTier)) + .build(); @Override public IStructureDefinition getStructureDefinition() { @@ -339,9 +302,8 @@ public class GT_TileEntity_MegaChemicalReactor @SuppressWarnings("rawtypes") @Optional.Method(modid = "tectech") private boolean areThingsNotProperlyTiered(Collection collection) { - if (!collection.isEmpty()) - for (Object tecTechEnergyMulti : collection) - if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; + if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) + if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; return false; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 85cfa191b1..2cc880e4b0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; @@ -31,6 +22,17 @@ import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -41,6 +43,7 @@ import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElementCheckOnly; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -55,15 +58,6 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OverclockCalculator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidStack; @Optional.Interface( iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", @@ -71,6 +65,7 @@ import net.minecraftforge.fluids.FluidStack; striprefs = true) public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { + protected static final int CASING_INDEX = 49; protected static final String STRUCTURE_PIECE_BASE = "base"; protected static final String STRUCTURE_PIECE_LAYER = "layer"; @@ -78,203 +73,70 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock private static final IStructureDefinition STRUCTURE_DEFINITION; static { - IHatchElement layeredOutputHatch = OutputHatch.withCount( - GT_TileEntity_MegaDistillTower::getCurrentLayerOutputHatchCount) + IHatchElement layeredOutputHatch = OutputHatch + .withCount(GT_TileEntity_MegaDistillTower::getCurrentLayerOutputHatchCount) .withAdder(GT_TileEntity_MegaDistillTower::addLayerOutputHatch); - STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] { - { - "bbbbbbb~bbbbbbb", - "bbbbbbbbbbbbbbb", - "bbbbbbbbbbbbbbb", - "bbbbbbbbbbbbbbb", - "bbbbbbbbbbbbbbb", - "bbbbbbbbbbbbbbb", - "bbbbbbbbbbbbbbb", - "bbbbbbbbbbbbbbb", - "bbbbbbbbbbbbbbb", - "bbbbbbbbbbbbbbb", - "bbbbbbbbbbbbbbb", - "bbbbbbbbbbbbbbb", - "bbbbbbbbbbbbbbb", - "bbbbbbbbbbbbbbb", - "bbbbbbbbbbbbbbb" - }, - })) - .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] { - { - "lllllllllllllll", - "lcccccccccccccl", - "lcccccccccccccl", - "lcccccccccccccl", - "lcccccccccccccl", - "lcccccccccccccl", - "lcccccccccccccl", - "lcccccccccccccl", - "lcccccccccccccl", - "lcccccccccccccl", - "lcccccccccccccl", - "lcccccccccccccl", - "lcccccccccccccl", - "lcccccccccccccl", - "lllllllllllllll" - }, - { - "lllllllllllllll", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "lllllllllllllll" - }, - { - "lllllllllllllll", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "lllllllllllllll" - }, - { - "lllllllllllllll", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "lllllllllllllll" - }, - { - "lllllllllllllll", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "lllllllllllllll" - }, - })) - .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][] { - { - "lllllllllllllll", - "lllllllllllllll", - "lllllllllllllll", - "lllllllllllllll", - "lllllllllllllll", - "lllllllllllllll", - "lllllllllllllll", - "lllllllllllllll", - "lllllllllllllll", - "lllllllllllllll", - "lllllllllllllll", - "lllllllllllllll", - "lllllllllllllll", - "lllllllllllllll", - "lllllllllllllll" - }, - { - "lllllllllllllll", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "lllllllllllllll" - }, - { - "lllllllllllllll", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "lllllllllllllll" - }, - { - "lllllllllllllll", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "lllllllllllllll" - }, - { - "lllllllllllllll", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "l=============l", - "lllllllllllllll" - }, - })) + STRUCTURE_DEFINITION = StructureDefinition.builder().addShape( + STRUCTURE_PIECE_BASE, + transpose( + new String[][] { { "bbbbbbb~bbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb" }, })) + .addShape( + STRUCTURE_PIECE_LAYER, + transpose( + new String[][] { { "lllllllllllllll", "lcccccccccccccl", "lcccccccccccccl", + "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", + "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", + "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lllllllllllllll" }, + { "lllllllllllllll", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "lllllllllllllll" }, + { "lllllllllllllll", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "lllllllllllllll" }, + { "lllllllllllllll", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "lllllllllllllll" }, + { "lllllllllllllll", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "lllllllllllllll" }, })) + .addShape( + STRUCTURE_PIECE_TOP_HINT, + transpose( + new String[][] { { "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", + "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", + "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", + "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll" }, + { "lllllllllllllll", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "lllllllllllllll" }, + { "lllllllllllllll", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "lllllllllllllll" }, + { "lllllllllllllll", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "lllllllllllllll" }, + { "lllllllllllllll", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", + "l=============l", "lllllllllllllll" }, })) .addElement('=', StructureElementAirNoHint.getInstance()) .addElement( 'b', @@ -286,20 +148,18 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock OutputBus, Maintenance, TTEnabledEnergyHatchElement.INSTANCE) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(onElementPass( - GT_TileEntity_MegaDistillTower::onCasingFound, - ofBlock(GregTech_API.sBlockCasings4, 1)))) + .casingIndex(CASING_INDEX).dot(1).buildAndChain( + onElementPass( + GT_TileEntity_MegaDistillTower::onCasingFound, + ofBlock(GregTech_API.sBlockCasings4, 1)))) .addElement( 'l', buildHatchAdder(GT_TileEntity_MegaDistillTower.class) .atLeast(layeredOutputHatch, Maintenance, TTEnabledEnergyHatchElement.INSTANCE) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(onElementPass( - GT_TileEntity_MegaDistillTower::onCasingFound, - ofBlock(GregTech_API.sBlockCasings4, 1)))) + .casingIndex(CASING_INDEX).dot(1).buildAndChain( + onElementPass( + GT_TileEntity_MegaDistillTower::onCasingFound, + ofBlock(GregTech_API.sBlockCasings4, 1)))) .addElement('c', (IStructureElementCheckOnly) (t, world, x, y, z) -> { if (world.isAirBlock(x, y, z)) { if (t.mTopState < 1) { @@ -331,8 +191,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } else { return false; } - }) - .build(); + }).build(); } protected final List> mOutputHatchesByLayer = new ArrayList<>(); @@ -361,15 +220,14 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } protected int getCurrentLayerOutputHatchCount() { - return mOutputHatchesByLayer.size() < mHeight || mHeight <= 0 - ? 0 + return mOutputHatchesByLayer.size() < mHeight || mHeight <= 0 ? 0 : mOutputHatchesByLayer.get(mHeight - 1).size(); } protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null - || aTileEntity.isDead() - || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) return false; + if (aTileEntity == null || aTileEntity.isDead() + || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) + return false; while (mOutputHatchesByLayer.size() < mHeight) mOutputHatchesByLayer.add(new ArrayList<>()); GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity(); tHatch.updateTexture(aBaseCasingIndex); @@ -382,41 +240,19 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - if (aActive) - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW) - .extFacing() - .glow() - .build() - }; - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW) - .extFacing() - .glow() - .build() - }; + if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow() + .build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow() + .build() }; } - return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) }; } @Override @@ -427,17 +263,12 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Distillery") - .addInfo("Controller block for the Distillation Tower") + tt.addMachineType("Distillery").addInfo("Controller block for the Distillation Tower") .addInfo("Fluids are only put out at the correct height") - .addInfo("The correct height equals the slot number in the NEI recipe") - .addSeparator() - .beginVariableStructureBlock(15, 15, 16, 56, 15, 15, true) - .addController("Front bottom") + .addInfo("The correct height equals the slot number in the NEI recipe").addSeparator() + .beginVariableStructureBlock(15, 15, 16, 56, 15, 15, true).addController("Front bottom") .addOtherStructurePart("Clean Stainless Steel Machine Casing", "15 x h - 5 (minimum)") - .addEnergyHatch("Any casing") - .addMaintenanceHatch("Any casing") - .addInputHatch("Any bottom layer casing") + .addEnergyHatch("Any casing").addMaintenanceHatch("Any casing").addInputHatch("Any bottom layer casing") .addOutputBus("Any bottom layer casing") .addOutputHatch("2-11x Output Hatches (One per Output Layer except bottom layer)") .addStructureInfo("An \"Output Layer\" consists of 5 layers!") @@ -468,8 +299,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock // check each layer while (mHeight < 12 && checkPiece(STRUCTURE_PIECE_LAYER, 7, mHeight * 5, 0) && !mTopLayerFound) { - if (mOutputHatchesByLayer.size() < mHeight - || mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) + if (mOutputHatchesByLayer.size() < mHeight || mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) // layer without output hatch return false; mTopState = -1; @@ -496,19 +326,46 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock if (mMachine) return -1; int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); mHeight = 0; - int built = - survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 7, 0, 0, realBudget, source, actor, false, true); + int built = survivialBuildPiece( + STRUCTURE_PIECE_BASE, + stackSize, + 7, + 0, + 0, + realBudget, + source, + actor, + false, + true); if (built >= 0) return built; int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height for (int i = 1; i < tTotalHeight - 1; i++) { mHeight = i; built = survivialBuildPiece( - STRUCTURE_PIECE_LAYER, stackSize, 7, 5 * mHeight, 0, realBudget, source, actor, false, true); + STRUCTURE_PIECE_LAYER, + stackSize, + 7, + 5 * mHeight, + 0, + realBudget, + source, + actor, + false, + true); if (built >= 0) return built; } mHeight = tTotalHeight - 1; return survivialBuildPiece( - STRUCTURE_PIECE_TOP_HINT, stackSize, 7, 5 * mHeight, 0, realBudget, source, actor, false, true); + STRUCTURE_PIECE_TOP_HINT, + stackSize, + 7, + 5 * mHeight, + 0, + realBudget, + source, + actor, + false, + true); } private boolean mUseMultiparallelMode = false; @@ -526,8 +383,8 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } @Override - public boolean onWireCutterRightClick( - byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, + float aZ) { if (aPlayer.isSneaking()) { mUseMultiparallelMode = !mUseMultiparallelMode; if (mUseMultiparallelMode) { @@ -559,8 +416,8 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } } - long nominalV = - LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) + : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(0, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); @@ -572,7 +429,11 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock int processed = 0; boolean found_Recipe = false; GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe( - this.getBaseMetaTileEntity(), false, GT_Values.V[tTier], new FluidStack[] {tFluid}, tItems); + this.getBaseMetaTileEntity(), + false, + GT_Values.V[tTier], + new FluidStack[] { tFluid }, + tItems); float tBatchMultiplier = 1.0f; if (tRecipe != null) { found_Recipe = true; @@ -580,7 +441,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock if (mUseMultiparallelMode && tMaxPara == ConfigHandler.megaMachinesMax) { tMaxPara *= 128; } - int tCurrentPara = handleParallelRecipe(tRecipe, new FluidStack[] {tFluid}, null, (int) tMaxPara); + int tCurrentPara = handleParallelRecipe(tRecipe, new FluidStack[] { tFluid }, null, (int) tMaxPara); tBatchMultiplier = mUseMultiparallelMode ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) : 1.0f; @@ -595,12 +456,8 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(tRecipe.mEUt) - .setParallel(processed) - .setDuration(tRecipe.mDuration) - .setEUt(nominalV) - .calculate(); + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt) + .setParallel(processed).setDuration(tRecipe.mDuration).setEUt(nominalV).calculate(); this.mMaxProgresstime = calculator.getDuration(); this.lEUt = calculator.getConsumption(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java index 6374f59613..abe44efdc7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java @@ -3,6 +3,17 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import static gregtech.api.enums.GT_HatchElement.Energy; import static gregtech.api.enums.GT_Values.V; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -15,6 +26,7 @@ import com.google.common.collect.ImmutableList; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.structure.AutoPlaceEnvironment; import com.gtnewhorizon.structurelib.structure.IStructureElement; + import cpw.mods.fml.common.Optional; import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -22,15 +34,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.*; import gregtech.api.util.GT_Utility; import gregtech.api.util.IGT_HatchAdder; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; @Optional.Interface( iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", @@ -75,9 +78,8 @@ public abstract class GT_TileEntity_MegaMultiBlockBase>= perfectOC ? 2 : 1; // this is effect of overclocking - xEUt = this.mMaxProgresstime <= 0 - ? xEUt >> 1 - : xEUt << 2; // U know, if the time is less than 1 tick make the machine use less power + xEUt = this.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2; // U know, if the time is less than 1 tick + // make the machine use less power overclockCount++; } @@ -251,11 +280,11 @@ public abstract class GT_TileEntity_MegaMultiBlockBase> { + INSTANCE; private static final List> mteClasses; static { - ImmutableList.Builder> builder = - ImmutableList.>builder().addAll(Energy.mteClasses()); + ImmutableList.Builder> builder = ImmutableList + .>builder().addAll(Energy.mteClasses()); if (LoaderReference.tectech) builder.add(GT_MetaTileEntity_Hatch_EnergyMulti.class); mteClasses = builder.build(); } @@ -370,6 +400,7 @@ public abstract class GT_TileEntity_MegaMultiBlockBase implements IStructureElement { + private static final StructureElementAirNoHint INSTANCE = new StructureElementAirNoHint<>(); @SuppressWarnings("unchecked") @@ -389,7 +420,12 @@ public abstract class GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { + private static final int CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition STRUCTURE_DEFINITION = - StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { - { - " p p ", - "ppgggggggggpp", - " pgggggggggp ", - " pgggpppgggp ", - " pgggpMpgggp ", - " pgggpppgggp ", - " pgggggggggp ", - "ppgggggggggpp", - " p p " - }, - { - " p p ", - "pgggggggggggp", - " g c c c c g ", - " g c c c c g ", - " g c c c c g ", - " g c c c c g ", - " g c c c c g ", - "pgggggggggggp", - " p p " - }, - { - " p p ", - "pgggggggggggp", - " g c c c c g ", - " p c c p ", - " p c c c c p ", - " p c c p ", - " g c c c c g ", - "pgggggggggggp", - " p p " - }, - { - " p p ", - "pgggggggggggp", - " g c c c c g ", - " p c c c c p ", - " l c c c c r ", - " p c c c c p ", - " g c c c c g ", - "pgggggggggggp", - " p p " - }, - { - " p p ", - "pgggggggggggp", - " g c c c c g ", - " p c c p ", - " p c c c c p ", - " p c c p ", - " g c c c c g ", - "pgggggggggggp", - " p p " - }, - { - " p p ", - "pgggggggggggp", - " g c c c c g ", - " g c c c c g ", - " g c c c c g ", - " g c c c c g ", - " g c c c c g ", - "pgggggggggggp", - " p p " - }, - { - "ppmmmm~mmmmpp", - "ppppppppppppp", - "ppppppppppppp", - "ppppppppppppp", - "ppppppppppppp", - "ppppppppppppp", - "ppppppppppppp", - "ppppppppppppp", - "ppmmmmmmmmmpp" - }, - })) - .addElement( - 'c', - ofCoil( - GT_TileEntity_MegaOilCracker::setCoilLevel, - GT_TileEntity_MegaOilCracker::getCoilLevel)) - .addElement('p', ofBlock(GregTech_API.sBlockCasings4, 1)) - .addElement( - 'l', - InputHatch.withAdder(GT_TileEntity_MegaOilCracker::addLeftHatchToMachineList) - .newAny(CASING_INDEX, 2)) - .addElement( - 'r', - OutputHatch.withAdder(GT_TileEntity_MegaOilCracker::addRightHatchToMachineList) - .newAny(CASING_INDEX, 3)) - .addElement( - 'm', - buildHatchAdder(GT_TileEntity_MegaOilCracker.class) - .atLeast(TTEnabledEnergyHatchElement.INSTANCE, Maintenance) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(GregTech_API.sBlockCasings4, 1)) - .addElement( - 'M', - InputHatch.withAdder(GT_TileEntity_MegaOilCracker::addMiddleInputToMachineList) - .newAny(CASING_INDEX, 4)) - .addElement( - 'g', - BorosilicateGlass.ofBoroGlass( - (byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) - .build(); + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { + { " p p ", "ppgggggggggpp", " pgggggggggp ", " pgggpppgggp ", + " pgggpMpgggp ", " pgggpppgggp ", " pgggggggggp ", "ppgggggggggpp", + " p p " }, + { " p p ", "pgggggggggggp", " g c c c c g ", " g c c c c g ", + " g c c c c g ", " g c c c c g ", " g c c c c g ", "pgggggggggggp", + " p p " }, + { " p p ", "pgggggggggggp", " g c c c c g ", " p c c p ", + " p c c c c p ", " p c c p ", " g c c c c g ", "pgggggggggggp", + " p p " }, + { " p p ", "pgggggggggggp", " g c c c c g ", " p c c c c p ", + " l c c c c r ", " p c c c c p ", " g c c c c g ", "pgggggggggggp", + " p p " }, + { " p p ", "pgggggggggggp", " g c c c c g ", " p c c p ", + " p c c c c p ", " p c c p ", " g c c c c g ", "pgggggggggggp", + " p p " }, + { " p p ", "pgggggggggggp", " g c c c c g ", " g c c c c g ", + " g c c c c g ", " g c c c c g ", " g c c c c g ", "pgggggggggggp", + " p p " }, + { "ppmmmm~mmmmpp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", + "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", + "ppmmmmmmmmmpp" }, })) + .addElement( + 'c', + ofCoil(GT_TileEntity_MegaOilCracker::setCoilLevel, GT_TileEntity_MegaOilCracker::getCoilLevel)) + .addElement('p', ofBlock(GregTech_API.sBlockCasings4, 1)) + .addElement( + 'l', + InputHatch.withAdder(GT_TileEntity_MegaOilCracker::addLeftHatchToMachineList) + .newAny(CASING_INDEX, 2)) + .addElement( + 'r', + OutputHatch.withAdder(GT_TileEntity_MegaOilCracker::addRightHatchToMachineList) + .newAny(CASING_INDEX, 3)) + .addElement( + 'm', + buildHatchAdder(GT_TileEntity_MegaOilCracker.class) + .atLeast(TTEnabledEnergyHatchElement.INSTANCE, Maintenance).casingIndex(CASING_INDEX).dot(1) + .buildAndChain(GregTech_API.sBlockCasings4, 1)) + .addElement( + 'M', + InputHatch.withAdder(GT_TileEntity_MegaOilCracker::addMiddleInputToMachineList) + .newAny(CASING_INDEX, 4)) + .addElement( + 'g', + BorosilicateGlass.ofBoroGlass( + (byte) 0, + (byte) 1, + Byte.MAX_VALUE, + (te, t) -> te.glasTier = t, + te -> te.glasTier)) + .build(); private byte glasTier; private HeatingCoilLevel heatLevel; protected final List mMiddleInputHatches = new ArrayList<>(); @@ -199,25 +140,19 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa @Override public GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Cracker") - .addInfo("Controller block for the Mega Oil Cracking") + tt.addMachineType("Cracker").addInfo("Controller block for the Mega Oil Cracking") .addInfo("Thermally cracks heavy hydrocarbons into lighter fractions") .addInfo("More efficient than the Chemical Reactor") .addInfo("Gives different benefits whether it hydro or steam-cracks:") .addInfo("Hydro - Consumes 20% less Hydrogen and outputs 25% more cracked fluid") .addInfo("Steam - Outputs 50% more cracked fluid") .addInfo("(Values compared to cracking in the Chemical Reactor)") - .addInfo("Place the appropriate circuit in the controller") - .addSeparator() - .beginStructureBlock(13, 7, 9, true) - .addController("Front bottom") + .addInfo("Place the appropriate circuit in the controller").addSeparator() + .beginStructureBlock(13, 7, 9, true).addController("Front bottom") .addStructureInfo("The glass tier limits the Energy Input tier") .addInfo("Gets 10% EU/t reduction per coil tier, up to a maximum of 50%") - .addEnergyHatch("Hint block", 1) - .addMaintenanceHatch("Hint block", 1) - .addInputHatch("Hint block", 2, 3) - .addOutputHatch("Hint block", 2, 3) - .addInputHatch("Steam/Hydrogen ONLY, Hint block", 4) + .addEnergyHatch("Hint block", 1).addMaintenanceHatch("Hint block", 1).addInputHatch("Hint block", 2, 3) + .addOutputHatch("Hint block", 2, 3).addInputHatch("Steam/Hydrogen ONLY, Hint block", 4) .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -228,41 +163,18 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - if (aActive) - return new ITexture[] { - casingTexturePages[0][CASING_INDEX], - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW) - .extFacing() - .glow() - .build() - }; - return new ITexture[] { - casingTexturePages[0][CASING_INDEX], - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_OIL_CRACKER) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW) - .extFacing() - .glow() - .build() - }; + if (aActive) return new ITexture[] { casingTexturePages[0][CASING_INDEX], + TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW).extFacing().glow() + .build() }; + return new ITexture[] { casingTexturePages[0][CASING_INDEX], + TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW).extFacing().glow().build() }; } - return new ITexture[] {casingTexturePages[0][CASING_INDEX]}; + return new ITexture[] { casingTexturePages[0][CASING_INDEX] }; } @Override @@ -277,18 +189,17 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa ArrayList outputItems = new ArrayList<>(); ArrayList outputFluids = new ArrayList<>(); - long nominalV = - LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) + : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); - GT_Recipe tRecipe = getRecipeMap() - .findRecipe( - getBaseMetaTileEntity(), - false, - gregtech.api.enums.GT_Values.V[tTier], - tInputFluids, - mInventory[1]); + GT_Recipe tRecipe = getRecipeMap().findRecipe( + getBaseMetaTileEntity(), + false, + gregtech.api.enums.GT_Values.V[tTier], + tInputFluids, + mInventory[1]); boolean found_Recipe = false; int processed = 0; @@ -311,12 +222,8 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(tRecipe.mEUt) - .setParallel(processed) - .setDuration(tRecipe.mDuration) - .setEUt(nominalV) - .calculate(); + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt) + .setParallel(processed).setDuration(tRecipe.mDuration).setEUt(nominalV).calculate(); this.mMaxProgresstime = calculator.getDuration(); this.lEUt = calculator.getConsumption(); @@ -383,9 +290,9 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa if (mMaintenanceHatches.size() != 1) return false; if (LoaderReference.tectech && this.glasTier < 8) - if (!areLazorsLowPowa() - || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) - || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) return false; + if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) + || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) + return false; if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) @@ -506,9 +413,8 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa @SuppressWarnings("rawtypes") @Optional.Method(modid = "tectech") private boolean areThingsNotProperlyTiered(Collection collection) { - if (!collection.isEmpty()) - for (Object tecTechEnergyMulti : collection) - if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; + if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) + if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; return false; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 0607ba5615..9ea2d56114 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; @@ -31,6 +22,15 @@ import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -40,6 +40,7 @@ import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructa import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.interfaces.ITexture; @@ -50,13 +51,6 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OverclockCalculator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import java.util.ArrayList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidStack; @Optional.Interface( iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", @@ -82,298 +76,93 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc private static final int CASING_INDEX = 17; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition STRUCTURE_DEFINITION = - StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { - { - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc" - }, - { - "ccccccccccccccc", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "ccccccccccccccc" - }, - { - "ccccccccccccccc", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "ccccccccccccccc" - }, - { - "ccccccccccccccc", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "ccccccccccccccc" - }, - { - "ccccccccccccccc", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "ccccccccccccccc" - }, - { - "ccccccccccccccc", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "ccccccccccccccc" - }, - { - "ccccccccccccccc", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "ccccccccccccccc" - }, - { - "ccccccc~ccccccc", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "ccccccccccccccc" - }, - { - "ccccccccccccccc", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "ccccccccccccccc" - }, - { - "ccccccccccccccc", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "ccccccccccccccc" - }, - { - "ccccccccccccccc", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "ccccccccccccccc" - }, - { - "ccccccccccccccc", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "ccccccccccccccc" - }, - { - "ccccccccccccccc", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "ccccccccccccccc" - }, - { - "ccccccccccccccc", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "c=============c", - "ccccccccccccccc" - }, - { - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc", - "ccccccccccccccc" - } - })) - .addElement('=', StructureElementAirNoHint.getInstance()) - .addElement( - 'c', - buildHatchAdder(GT_TileEntity_MegaVacuumFreezer.class) - .atLeast( - TTEnabledEnergyHatchElement.INSTANCE, - InputHatch, - InputBus, - OutputHatch, - OutputBus, - Maintenance) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain( - onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings2, 1)))) - .build(); + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { + { "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", + "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", + "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", + "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccc~ccccccc", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", + "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", + "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", + "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc" } })) + .addElement('=', StructureElementAirNoHint.getInstance()) + .addElement( + 'c', + buildHatchAdder(GT_TileEntity_MegaVacuumFreezer.class).atLeast( + TTEnabledEnergyHatchElement.INSTANCE, + InputHatch, + InputBus, + OutputHatch, + OutputBus, + Maintenance).casingIndex(CASING_INDEX).dot(1) + .buildAndChain(onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings2, 1)))) + .build(); @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Vacuum Freezer") - .addInfo("Controller Block for the Mega Vacuum Freezer") - .addInfo("Cools hot ingots and cells") - .addSeparator() - .beginStructureBlock(15, 15, 15, true) - .addController("Front center") - .addCasingInfo("Frost Proof Machine Casing", 900) - .addEnergyHatch("Any casing", 1) - .addMaintenanceHatch("Any casing", 1) - .addInputHatch("Any casing", 1) - .addOutputHatch("Any casing", 1) - .addInputBus("Any casing", 1) - .addOutputBus("Any casing", 1) + tt.addMachineType("Vacuum Freezer").addInfo("Controller Block for the Mega Vacuum Freezer") + .addInfo("Cools hot ingots and cells").addSeparator().beginStructureBlock(15, 15, 15, true) + .addController("Front center").addCasingInfo("Frost Proof Machine Casing", 900) + .addEnergyHatch("Any casing", 1).addMaintenanceHatch("Any casing", 1).addInputHatch("Any casing", 1) + .addOutputHatch("Any casing", 1).addInputBus("Any casing", 1).addOutputBus("Any casing", 1) .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -415,8 +204,8 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc } @Override - public boolean onWireCutterRightClick( - byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, + float aZ) { if (aPlayer.isSneaking()) { mUseMultiparallelMode = !mUseMultiparallelMode; if (mUseMultiparallelMode) { @@ -436,13 +225,13 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc ArrayList outputItems = new ArrayList<>(); ArrayList outputFluids = new ArrayList<>(); - long nominalV = - LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) + : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe( - this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes + .findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); boolean found_Recipe = false; int processed = 0; float tBatchMultiplier = 1.0f; @@ -456,8 +245,9 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc } int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); - tBatchMultiplier = - mUseMultiparallelMode ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) : 1.0f; + tBatchMultiplier = mUseMultiparallelMode + ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) + : 1.0f; this.updateSlots(); if (tCurrentPara <= 0) return false; @@ -471,12 +261,8 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(tRecipe.mEUt) - .setParallel(processed) - .setDuration(tRecipe.mDuration) - .setEUt(nominalV) - .calculate(); + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt) + .setParallel(processed).setDuration(tRecipe.mDuration).setEUt(nominalV).calculate(); this.mMaxProgresstime = calculator.getDuration(); this.lEUt = calculator.getConsumption(); @@ -513,52 +299,30 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc if (!checkPiece(STRUCTURE_PIECE_MAIN, 7, 7, 0)) return false; return this.mMaintenanceHatches.size() == 1 && (LoaderReference.tectech - ? (!this.getTecTechEnergyMultis().isEmpty() - || !this.getTecTechEnergyTunnels().isEmpty() + ? (!this.getTecTechEnergyMultis().isEmpty() || !this.getTecTechEnergyTunnels().isEmpty() || !this.mEnergyHatches.isEmpty()) : !this.mEnergyHatches.isEmpty()) && this.mCasing >= 900; } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { ITexture[] rTexture; if (aSide == aFacing) { if (aActive) { - rTexture = new ITexture[] { - casingTexturePages[0][17], - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW) - .extFacing() - .glow() - .build() - }; + rTexture = new ITexture[] { casingTexturePages[0][17], + TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW).extFacing().glow() + .build() }; } else { - rTexture = new ITexture[] { - casingTexturePages[0][17], - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_VACUUM_FREEZER) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_GLOW) - .extFacing() - .glow() - .build() - }; + rTexture = new ITexture[] { casingTexturePages[0][17], + TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_GLOW).extFacing().glow() + .build() }; } } else { - rTexture = new ITexture[] {casingTexturePages[0][17]}; + rTexture = new ITexture[] { casingTexturePages[0][17] }; } return rTexture; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index 044a53105b..21cf8c4ed0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -1,30 +1,24 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; +import net.minecraft.util.StatCollector; + import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -33,12 +27,11 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; -import net.minecraft.util.StatCollector; public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGenerator { - public GT_MetaTileEntity_AcidGenerator( - int aID, String aName, String aNameRegional, int aTier, ITexture... aTextures) { + public GT_MetaTileEntity_AcidGenerator(int aID, String aName, String aNameRegional, int aTier, + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, new String[] {}, aTextures); } @@ -67,81 +60,65 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene } public ITexture[] getFront(byte aColor) { - return new ITexture[] { - super.getFront(aColor)[0], - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] - }; + return new ITexture[] { super.getFront(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; } public ITexture[] getBack(byte aColor) { - return new ITexture[] { - super.getBack(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) - }; + return new ITexture[] { super.getBack(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } public ITexture[] getBottom(byte aColor) { - return new ITexture[] { - super.getBottom(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) - }; + return new ITexture[] { super.getBottom(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } public ITexture[] getTop(byte aColor) { - return new ITexture[] { - super.getTop(aColor)[0], - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), - TextureFactory.builder() - .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")) - .glow() - .build() - }; + return new ITexture[] { super.getTop(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), + TextureFactory.builder() + .addIcon( + new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")) + .glow().build() }; } public ITexture[] getSides(byte aColor) { - return new ITexture[] { - super.getSides(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) - }; + return new ITexture[] { super.getSides(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } public ITexture[] getFrontActive(byte aColor) { - return new ITexture[] { - super.getFrontActive(aColor)[0], - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] - }; + return new ITexture[] { super.getFrontActive(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; } public ITexture[] getBackActive(byte aColor) { - return new ITexture[] { - super.getBackActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) - }; + return new ITexture[] { super.getBackActive(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } public ITexture[] getBottomActive(byte aColor) { - return new ITexture[] { - super.getBottomActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) - }; + return new ITexture[] { super.getBottomActive(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } public ITexture[] getTopActive(byte aColor) { - return new ITexture[] { - super.getTopActive(aColor)[0], - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), - TextureFactory.of( - new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), - TextureFactory.builder() - .addIcon(new Textures.BlockIcons.CustomIcon( - "basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")) - .glow() - .build() - }; + return new ITexture[] { super.getTopActive(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), + TextureFactory + .of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), + TextureFactory.builder().addIcon( + new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")) + .glow().build() }; } public ITexture[] getSidesActive(byte aColor) { - return new ITexture[] { - super.getSidesActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) - }; + return new ITexture[] { super.getSidesActive(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } public boolean isOutputFacing(byte aSide) { @@ -149,16 +126,17 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene } public String[] getDescription() { - return new String[] { - StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), - StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW - + GT_Values.V[this.mTier], - StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + ChatColorHelper.YELLOW - + this.getEfficiency(), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW - + this.maxAmperesOut(), - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() - }; + return new String[] { StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), + StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + + ChatColorHelper.YELLOW + + GT_Values.V[this.mTier], + StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + + ChatColorHelper.YELLOW + + this.getEfficiency(), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + + ChatColorHelper.YELLOW + + this.maxAmperesOut(), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index f8fa74dce3..db5d0dbfb3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -1,27 +1,24 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.items.LabModule; import com.github.bartimaeusnek.bartworks.common.items.LabParts; @@ -29,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.util.*; + import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -43,11 +41,6 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { @@ -71,72 +64,64 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { 2, GT_MetaTileEntity_BioLab.MGUINAME, null, - TextureFactory.of( - TextureFactory.of(new Textures.BlockIcons.CustomIcon( - "basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), - TextureFactory.builder() - .addIcon(new Textures.BlockIcons.CustomIcon( - "basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE_GLOW")) - .glow() - .build()), TextureFactory.of( TextureFactory.of( - new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), + new Textures.BlockIcons.CustomIcon( + "basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), TextureFactory.builder() - .addIcon(new Textures.BlockIcons.CustomIcon( - "basicmachines/fluid_extractor/OVERLAY_SIDE_GLOW")) - .glow() - .build()), + .addIcon( + new Textures.BlockIcons.CustomIcon( + "basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE_GLOW")) + .glow().build()), TextureFactory.of( - TextureFactory.of( - new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), - TextureFactory.builder() - .addIcon(new Textures.BlockIcons.CustomIcon( - "basicmachines/microwave/OVERLAY_FRONT_ACTIVE_GLOW")) - .glow() - .build()), + TextureFactory + .of(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), + TextureFactory.builder().addIcon( + new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_GLOW")) + .glow().build()), + TextureFactory.of( + TextureFactory + .of(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), + TextureFactory.builder().addIcon( + new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE_GLOW")) + .glow().build()), TextureFactory.of( TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), - TextureFactory.builder() - .addIcon(new Textures.BlockIcons.CustomIcon( - "basicmachines/microwave/OVERLAY_FRONT_GLOW")) - .glow() + TextureFactory.builder().addIcon( + new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_GLOW")).glow() .build()), - TextureFactory.of( - TextureFactory.of(new Textures.BlockIcons.CustomIcon( - "basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), - TextureFactory.builder() - .addIcon(new Textures.BlockIcons.CustomIcon( - "basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")) - .glow() - .build() /*this is topactive*/), TextureFactory.of( TextureFactory.of( - new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), + new Textures.BlockIcons.CustomIcon( + "basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), TextureFactory.builder() - .addIcon(new Textures.BlockIcons.CustomIcon( - "basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")) - .glow() - .build() /*this is top*/), + .addIcon( + new Textures.BlockIcons.CustomIcon( + "basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")) + .glow().build() /* this is topactive */), + TextureFactory.of( + TextureFactory + .of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), + TextureFactory.builder().addIcon( + new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")) + .glow().build() /* this is top */), TextureFactory.of( TextureFactory.of( new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), TextureFactory.builder() - .addIcon(new Textures.BlockIcons.CustomIcon( - "basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE_GLOW")) - .glow() - .build()), + .addIcon( + new Textures.BlockIcons.CustomIcon( + "basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE_GLOW")) + .glow().build()), TextureFactory.of( TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM")), - TextureFactory.builder() - .addIcon(new Textures.BlockIcons.CustomIcon( - "basicmachines/polarizer/OVERLAY_BOTTOM_GLOW")) - .glow() - .build())); + TextureFactory.builder().addIcon( + new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_GLOW")) + .glow().build())); } - public GT_MetaTileEntity_BioLab( - String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, String aNEIName) { + public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String aDescription, + ITexture[][][] aTextures, String aNEIName) { super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2, GT_MetaTileEntity_BioLab.MGUINAME, aNEIName); } @@ -144,7 +129,12 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { @SuppressWarnings("deprecation") public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new GT_MetaTileEntity_BioLab( - this.mName, this.mTier, this.mAmperage, this.mDescription, this.mTextures, this.mNEIName); + this.mName, + this.mTier, + this.mAmperage, + this.mDescription, + this.mTextures, + this.mNEIName); } @Override @@ -161,8 +151,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { public int checkRecipe(boolean skipOC) { int rTier = 3; - FluidStack dnaFluid = LoaderReference.gendustry - ? FluidRegistry.getFluidStack("liquiddna", 1000) + FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); if (this.getSpecialSlot() != null && this.getSpecialSlot().getItem() instanceof LabModule) { @@ -181,19 +170,18 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) && this.mInventory[getInputSlot() + 2].getItem() instanceof LabParts && this.mInventory[getInputSlot() + 2].getItemDamage() == 3 - && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 3], Materials.Ethanol.getCells(1)) + && GT_Utility + .areStacksEqual(this.mInventory[getInputSlot() + 3], Materials.Ethanol.getCells(1)) && this.mFluid != null && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000) { - NBTTagCompound DNABioDataTag = - this.mInventory[getInputSlot()].getTagCompound().getCompoundTag("DNA"); + NBTTagCompound DNABioDataTag = this.mInventory[getInputSlot()].getTagCompound() + .getCompoundTag("DNA"); if (DNABioDataTag == null) return super.checkRecipe(skipOC); - BioData cultureDNABioData = BioData.getBioDataFromName(this.mInventory[getInputSlot()] - .getTagCompound() - .getCompoundTag("DNA") - .getString("Name")); + BioData cultureDNABioData = BioData.getBioDataFromName( + this.mInventory[getInputSlot()].getTagCompound().getCompoundTag("DNA") + .getString("Name")); if (cultureDNABioData == null) return super.checkRecipe(skipOC); if (this.mTier < rTier + cultureDNABioData.getTier()) @@ -207,193 +195,200 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mFluid.amount -= 1000; if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = - BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(cultureDNABioData)); + this.mOutputItems[0] = BioItemList + .getDNASampleFlask(BioDNA.convertDataToDNA(cultureDNABioData)); } this.mOutputItems[1] = GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L); this.calculateOverclockedNess( - BW_Util.getMachineVoltageFromTier(rTier + cultureDNABioData.getTier()), 500); + BW_Util.getMachineVoltageFromTier(rTier + cultureDNABioData.getTier()), + 500); return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } break; - case PCR_THERMOCYCLE_MODULE: - { - if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) - && this.mInventory[getInputSlot()].getItem() instanceof LabParts - && this.mInventory[getInputSlot()].getItemDamage() == 1 - && this.mInventory[getInputSlot()].getTagCompound() != null - && // checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) - && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 3], ItemList.Tool_DataOrb.get(1L)) - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) - && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 1], FluidLoader.BioLabFluidCells[0]) - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) - && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 2], FluidLoader.BioLabFluidCells[3]) - && this.mFluid != null - && this.mFluid.isFluidEqual(dnaFluid) - && this.mFluid.amount >= 1000) { - NBTTagCompound DNABioDataTag = this.mInventory[getInputSlot()].getTagCompound(); - if (DNABioDataTag == null) return super.checkRecipe(skipOC); - BioData cultureDNABioData = BioData.getBioDataFromName(DNABioDataTag.getString("Name")); - if (cultureDNABioData == null) return super.checkRecipe(skipOC); + case PCR_THERMOCYCLE_MODULE: { + if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) + && this.mInventory[getInputSlot()].getItem() instanceof LabParts + && this.mInventory[getInputSlot()].getItemDamage() == 1 + && this.mInventory[getInputSlot()].getTagCompound() != null + && // checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) + && GT_Utility + .areStacksEqual(this.mInventory[getInputSlot() + 3], ItemList.Tool_DataOrb.get(1L)) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 1], + FluidLoader.BioLabFluidCells[0]) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 2], + FluidLoader.BioLabFluidCells[3]) + && this.mFluid != null + && this.mFluid.isFluidEqual(dnaFluid) + && this.mFluid.amount >= 1000) { + NBTTagCompound DNABioDataTag = this.mInventory[getInputSlot()].getTagCompound(); + if (DNABioDataTag == null) return super.checkRecipe(skipOC); + BioData cultureDNABioData = BioData.getBioDataFromName(DNABioDataTag.getString("Name")); + if (cultureDNABioData == null) return super.checkRecipe(skipOC); - if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) - return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 0; i < 4; i++) { - if (this.mInventory[getInputSlot() + i] != null) - this.mInventory[getInputSlot() + i].stackSize--; - } + for (int i = 0; i < 4; i++) { + if (this.mInventory[getInputSlot() + i] != null) + this.mInventory[getInputSlot() + i].stackSize--; + } - this.mFluid.amount -= 1000; + this.mFluid.amount -= 1000; - ItemStack Outp = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); - Behaviour_DataOrb.setDataName(Outp, cultureDNABioData.getName()); + ItemStack Outp = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); + Behaviour_DataOrb.setDataName(Outp, cultureDNABioData.getName()); - if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = Outp; - } else this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L); - this.mOutputItems[1] = ItemList.Cell_Empty.get(2L); + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + this.mOutputItems[0] = Outp; + } else this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L); + this.mOutputItems[1] = ItemList.Cell_Empty.get(2L); - this.calculateOverclockedNess( - BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); + this.calculateOverclockedNess( + BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), + 500); - return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; - } + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } + } break; - case PLASMID_SYNTHESIS_MODULE: - { - ItemStack inp2 = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); - Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); - if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) - && GT_Utility.areStacksEqual( - FluidLoader.BioLabFluidCells[1], this.mInventory[getInputSlot()]) - && // checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) - && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 1], BioItemList.getPlasmidCell(null)) - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) - && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 2], ItemList.Tool_DataOrb.get(1L), true) - && Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 2]) - .equals("DNA Sample") - && (!(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2]) - .isEmpty())) - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) - && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], inp2) - && this.mFluid != null - && this.mFluid.isFluidEqual(dnaFluid) - && (this.mFluid.amount >= 1000)) { - BioData cultureDNABioData = BioData.getBioDataFromName( - Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2])); - if (cultureDNABioData == null) return super.checkRecipe(skipOC); - if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) - return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 0; i < 2; i++) { - if (this.mInventory[getInputSlot() + i] != null) - this.mInventory[getInputSlot() + i].stackSize--; - } - this.mFluid.amount -= 1000; - if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = - BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); - } - this.mOutputItems[1] = ItemList.Cell_Empty.get(1L); - this.calculateOverclockedNess( - BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); - return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; + case PLASMID_SYNTHESIS_MODULE: { + ItemStack inp2 = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); + Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); + if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) + && GT_Utility + .areStacksEqual(FluidLoader.BioLabFluidCells[1], this.mInventory[getInputSlot()]) + && // checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 1], + BioItemList.getPlasmidCell(null)) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 2], + ItemList.Tool_DataOrb.get(1L), + true) + && Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 2]).equals("DNA Sample") + && (!(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2]).isEmpty())) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) + && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], inp2) + && this.mFluid != null + && this.mFluid.isFluidEqual(dnaFluid) + && (this.mFluid.amount >= 1000)) { + BioData cultureDNABioData = BioData + .getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2])); + if (cultureDNABioData == null) return super.checkRecipe(skipOC); + if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + for (int i = 0; i < 2; i++) { + if (this.mInventory[getInputSlot() + i] != null) + this.mInventory[getInputSlot() + i].stackSize--; + } + this.mFluid.amount -= 1000; + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + this.mOutputItems[0] = BioItemList + .getPlasmidCell(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); } + this.mOutputItems[1] = ItemList.Cell_Empty.get(1L); + this.calculateOverclockedNess( + BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), + 500); + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } + } break; - case TRANSFORMATION_MODULE: - { - if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) - && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot()], BioItemList.getPetriDish(null), true) - && this.mInventory[getInputSlot()].getTagCompound() != null - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) - && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 1], BioItemList.getPlasmidCell(null), true) - && this.mInventory[getInputSlot() + 1].getTagCompound() != null - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) - && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 2], FluidLoader.BioLabFluidCells[2]) - && this.mFluid != null - && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) - && this.mFluid.amount >= 1000) { - BioData cultureDNABioData = - BioData.getBioDataFromNBTTag(this.mInventory[getInputSlot() + 1].getTagCompound()); - BioCulture bioCulture = BioCulture.getBioCultureFromNBTTag( - this.mInventory[getInputSlot()].getTagCompound()); - if (cultureDNABioData == null || bioCulture == null) return super.checkRecipe(skipOC); - if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) - return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 0; i < 3; i++) { - if (this.mInventory[getInputSlot() + i] != null) - this.mInventory[getInputSlot() + i].stackSize--; - } - this.mFluid.amount -= 1000; - bioCulture = bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); - if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = BioItemList.getPetriDish(bioCulture); - } - this.mOutputItems[1] = ItemList.Cell_Empty.get(1L); - this.calculateOverclockedNess( - BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); - return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; + case TRANSFORMATION_MODULE: { + if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && GT_Utility + .areStacksEqual(this.mInventory[getInputSlot()], BioItemList.getPetriDish(null), true) + && this.mInventory[getInputSlot()].getTagCompound() != null + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 1], + BioItemList.getPlasmidCell(null), + true) + && this.mInventory[getInputSlot() + 1].getTagCompound() != null + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 2], + FluidLoader.BioLabFluidCells[2]) + && this.mFluid != null + && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) + && this.mFluid.amount >= 1000) { + BioData cultureDNABioData = BioData + .getBioDataFromNBTTag(this.mInventory[getInputSlot() + 1].getTagCompound()); + BioCulture bioCulture = BioCulture + .getBioCultureFromNBTTag(this.mInventory[getInputSlot()].getTagCompound()); + if (cultureDNABioData == null || bioCulture == null) return super.checkRecipe(skipOC); + if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + for (int i = 0; i < 3; i++) { + if (this.mInventory[getInputSlot() + i] != null) + this.mInventory[getInputSlot() + i].stackSize--; + } + this.mFluid.amount -= 1000; + bioCulture = bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + this.mOutputItems[0] = BioItemList.getPetriDish(bioCulture); } + this.mOutputItems[1] = ItemList.Cell_Empty.get(1L); + this.calculateOverclockedNess( + BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), + 500); + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } + } break; - case CLONAL_CELLULAR_SYNTHESIS_MODULE: - { - ItemStack Outp = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); + case CLONAL_CELLULAR_SYNTHESIS_MODULE: { + ItemStack Outp = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); - if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) - && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot()], BioItemList.getPetriDish(null)) - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) - && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 1], BioItemList.getOther(4)) - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) - && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 2], ItemList.Circuit_Chip_Stemcell.get(2L)) - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) - && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 3], ItemList.Tool_DataOrb.get(1L), true) - && Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 3]) - .equals("DNA Sample") - && this.mFluid.isFluidEqual(dnaFluid) - && (this.mFluid.amount >= 8000)) { + if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) + && GT_Utility + .areStacksEqual(this.mInventory[getInputSlot()], BioItemList.getPetriDish(null)) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) + && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 1], BioItemList.getOther(4)) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 2], + ItemList.Circuit_Chip_Stemcell.get(2L)) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 3], + ItemList.Tool_DataOrb.get(1L), + true) + && Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 3]).equals("DNA Sample") + && this.mFluid.isFluidEqual(dnaFluid) + && (this.mFluid.amount >= 8000)) { - BioData cultureDNABioData = BioData.getBioDataFromName( - Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 3])); - if (cultureDNABioData == null) return super.checkRecipe(skipOC); - if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) - return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 0; i < 3; i++) { - if (this.mInventory[getInputSlot() + i] != null) - this.mInventory[getInputSlot() + i].stackSize--; - } - this.mFluid.amount -= 8000; - if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - BioCulture out = BioCulture.getBioCulture(BioDNA.convertDataToDNA(cultureDNABioData)); - if (out == null) return GT_MetaTileEntity_BasicMachine.DID_NOT_FIND_RECIPE; - out = out.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); - this.mOutputItems[0] = BioItemList.getPetriDish(out); - } - this.calculateOverclockedNess( - BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); - return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; + BioData cultureDNABioData = BioData + .getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 3])); + if (cultureDNABioData == null) return super.checkRecipe(skipOC); + if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + for (int i = 0; i < 3; i++) { + if (this.mInventory[getInputSlot() + i] != null) + this.mInventory[getInputSlot() + i].stackSize--; + } + this.mFluid.amount -= 8000; + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + BioCulture out = BioCulture.getBioCulture(BioDNA.convertDataToDNA(cultureDNABioData)); + if (out == null) return GT_MetaTileEntity_BasicMachine.DID_NOT_FIND_RECIPE; + out = out.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + this.mOutputItems[0] = BioItemList.getPetriDish(out); } + this.calculateOverclockedNess( + BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), + 500); + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } + } break; case INCUBATION_MODULE: default: @@ -405,9 +400,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { @Override public String[] getDescription() { - return new String[] { - StatCollector.translateToLocal("tooltip.tile.biolab.0.name"), - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() - }; + return new String[] { StatCollector.translateToLocal("tooltip.tile.biolab.0.name"), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java index 204fe62687..b917fe90fc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java @@ -1,27 +1,20 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.Materials; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -29,16 +22,16 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.util.GT_Utility; import gregtech.common.gui.modularui.widget.FluidDisplaySlotWidget; -import net.minecraftforge.fluids.FluidStack; public class GT_MetaTileEntity_CompressedFluidHatch extends GT_MetaTileEntity_Hatch_Input { + public GT_MetaTileEntity_CompressedFluidHatch(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 0); this.mDescriptionArray[1] = "Capacity: 100000000L"; } - public GT_MetaTileEntity_CompressedFluidHatch( - String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_CompressedFluidHatch(String aName, int aTier, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -55,7 +48,10 @@ public class GT_MetaTileEntity_CompressedFluidHatch extends GT_MetaTileEntity_Ha @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_CompressedFluidHatch( - this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index 41bc0490c4..68647d372c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -1,39 +1,32 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; + import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; + import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull; import gregtech.api.util.GT_Utility; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { @@ -106,29 +99,35 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { private long getAmpsfromMeta(int meta) { if (meta > ConfigHandler.IDOffset + GT_Values.VN.length - && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 2) return 2L; + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 2) + return 2L; else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 2 - && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 3) return 4L; + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 3) + return 4L; else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 3 - && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 4) return 8L; + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 4) + return 8L; else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 4 - && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 5) return 12L; + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 5) + return 12L; else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 5 - && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 6) return 16L; + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 6) + return 16L; else return 0L; } @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[] { - this.mDescription, - StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW - + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW - + GT_Utility.formatNumbers(this.maxAmperesIn()), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW - + GT_Utility.formatNumbers(this.maxAmperesOut()), - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() - }; + return new String[] { this.mDescription, + StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.maxAmperesIn()), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.maxAmperesOut()), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java index c7914e59cf..f2345fce09 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java @@ -1,36 +1,29 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; +import net.minecraft.util.StatCollector; + import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; + import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Transformer; import gregtech.api.util.GT_Utility; -import net.minecraft.util.StatCollector; public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Transformer { @@ -42,8 +35,8 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans super(aName, aTier, aDescription, aTextures); } - public GT_MetaTileEntity_EnergyDistributor( - String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_EnergyDistributor(String aName, int aTier, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -73,15 +66,16 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans } public String[] getDescription() { - return new String[] { - StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW - + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW - + GT_Utility.formatNumbers(this.maxAmperesIn()), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW - + GT_Utility.formatNumbers(this.maxAmperesOut()), - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() - }; + return new String[] { StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.maxAmperesIn()), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.maxAmperesOut()), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java index 9478cdf222..c004b0db4e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; @@ -34,8 +25,8 @@ public class GT_MetaTileEntity_GiantOutputHatch extends GT_MetaTileEntity_Hatch_ this.mDescriptionArray[1] = "Capacity: 100000000L"; } - public GT_MetaTileEntity_GiantOutputHatch( - String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_GiantOutputHatch(String aName, int aTier, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 6a63ae7dd0..3a7e60d518 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -1,29 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; import static gregtech.api.enums.GT_Values.ticksBetweenSounds; +import java.util.Collections; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.util.BWRecipes; @@ -46,6 +45,7 @@ import com.gtnewhorizons.modularui.common.widget.ProgressBar; import com.gtnewhorizons.modularui.common.widget.ProgressBar.Direction; import com.gtnewhorizons.modularui.common.widget.TextWidget; import com.gtnewhorizons.modularui.common.widget.textfield.TextFieldWidget; + import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GT_UIInfos; @@ -62,12 +62,6 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; -import java.util.Collections; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implements IAddGregtechLogo { @@ -75,7 +69,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem public int sievert; private long timer = 1; private long decayTime = 1; - private short[] colorForGUI = {0x02, 0x02, 0x02}; + private short[] colorForGUI = { 0x02, 0x02, 0x02 }; private byte mass; private String material; private byte coverage; @@ -84,15 +78,20 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem private GT_Recipe lastRecipe = null; public GT_MetaTileEntity_RadioHatch(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, new String[] { - StatCollector.translateToLocal("tooltip.tile.radhatch.0.name"), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name") + " " + (aTier - 2) + " " - + ((aTier - 2) >= 2 - ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") - : StatCollector.translateToLocal("tooltip.bw.kg.0.name")), - StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"), - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() - }); + super( + aID, + aName, + aNameRegional, + aTier, + 1, + new String[] { StatCollector.translateToLocal("tooltip.tile.radhatch.0.name"), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name") + " " + + (aTier - 2) + + " " + + ((aTier - 2) >= 2 ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") + : StatCollector.translateToLocal("tooltip.bw.kg.0.name")), + StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }); this.cap = aTier - 2; } @@ -112,7 +111,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem public short[] getColorForGUI() { if (this.colorForGUI != null) return this.colorForGUI; - return colorForGUI = new short[] {0xFA, 0xFA, 0xFF}; + return colorForGUI = new short[] { 0xFA, 0xFA, 0xFF }; } public byte getMass() { @@ -133,12 +132,12 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + return new ITexture[] { aBaseTexture, TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_IN) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + return new ITexture[] { aBaseTexture, TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_IN) }; } @Override @@ -187,11 +186,11 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem ItemStack lStack = this.mInventory[0]; if (lStack == null) { - this.colorForGUI = new short[] {0x37, 0x37, 0x37}; + this.colorForGUI = new short[] { 0x37, 0x37, 0x37 }; return; } else { Materials mat = GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial; - this.colorForGUI = new short[] {mat.getRGBA()[0], mat.getRGBA()[1], mat.getRGBA()[2]}; + this.colorForGUI = new short[] { mat.getRGBA()[0], mat.getRGBA()[1], mat.getRGBA()[2] }; } if (this.lastFail && GT_Utility.areStacksEqual(this.lastUsedItem, lStack, true)) { @@ -212,10 +211,12 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem } if (this.lastRecipe == null || this.lastFail) { - this.lastRecipe = BWRecipes.instance - .getMappingsFor(BWRecipes.RADHATCH) - .findRecipe( - this.getBaseMetaTileEntity(), false, Integer.MAX_VALUE - 7, null, mInventory[0]); + this.lastRecipe = BWRecipes.instance.getMappingsFor(BWRecipes.RADHATCH).findRecipe( + this.getBaseMetaTileEntity(), + false, + Integer.MAX_VALUE - 7, + null, + mInventory[0]); if (this.lastRecipe == null) { this.lastFail = true; this.lastUsedItem = this.mInventory[0] == null ? null : this.mInventory[0].copy(); @@ -246,8 +247,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem @Override public String[] getInfoData() { - if (this.sievert != 0) - return new String[] { + if (this.sievert != 0) return new String[] { StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + StatCollector.translateToLocal(this.material), StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + this.sievert, @@ -263,15 +263,12 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem + StatCollector.translateToLocal("tooltip.tile.radhatch.8.name") + "/" + (this.decayTime - this.timer % this.decayTime) / 20 / 60 / 60 - + StatCollector.translateToLocal("tooltip.tile.radhatch.9.name") - }; - else - return new String[] { + + StatCollector.translateToLocal("tooltip.tile.radhatch.9.name") }; + else return new String[] { StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + StatCollector.translateToLocal("tooltip.bw.empty.name"), StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + "0", - StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + "0" - }; + StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + "0" }; } @Override @@ -345,75 +342,67 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem buildContext.addSyncedWindow(RADIATION_SHUTTER_WINDOW_ID, this::createShutterWindow); getBaseMetaTileEntity().add1by1Slot(builder); - builder.widget(new DrawableWidget() - .setBackground(BW_UITextures.PICTURE_SIEVERT_CONTAINER) - .setPos(61, 9) + builder.widget( + new DrawableWidget().setBackground(BW_UITextures.PICTURE_SIEVERT_CONTAINER).setPos(61, 9) .setSize(56, 24)) - .widget(new ProgressBar() - .setProgress(() -> getSievert() / 148f) - .setDirection(Direction.RIGHT) - .setTexture(BW_UITextures.PROGRESSBAR_SIEVERT, 24) - .setPos(65, 13) - .setSize(48, 16)) - .widget(new DrawableWidget() - .setBackground(BW_UITextures.PICTURE_DECAY_TIME_INSIDE) - .setPos(124, 18) - .setSize(16, 48)) .widget( - new DrawableWidget() { - @Override - public void draw(float partialTicks) { - if (decayTime > 0) { - int height = MathUtils.ceilInt( - 48 * ((decayTime - timer % decayTime) / (float) decayTime)); - new Rectangle() - .setColor(Color.argb(colorForGUI[0], colorForGUI[1], colorForGUI[2], 255)) - .draw(new Pos2d(0, 48 - height), new Size(16, height), partialTicks); - } - } - }.dynamicTooltip(() -> Collections.singletonList(StatCollector.translateToLocalFormatted( + new ProgressBar().setProgress(() -> getSievert() / 148f).setDirection(Direction.RIGHT) + .setTexture(BW_UITextures.PROGRESSBAR_SIEVERT, 24).setPos(65, 13).setSize(48, 16)) + .widget( + new DrawableWidget().setBackground(BW_UITextures.PICTURE_DECAY_TIME_INSIDE).setPos(124, 18) + .setSize(16, 48)) + .widget(new DrawableWidget() { + + @Override + public void draw(float partialTicks) { + if (decayTime > 0) { + int height = MathUtils.ceilInt(48 * ((decayTime - timer % decayTime) / (float) decayTime)); + new Rectangle().setColor(Color.argb(colorForGUI[0], colorForGUI[1], colorForGUI[2], 255)) + .draw(new Pos2d(0, 48 - height), new Size(16, height), partialTicks); + } + } + }.dynamicTooltip( + () -> Collections.singletonList( + StatCollector.translateToLocalFormatted( "tooltip.tile.radhatch.10.name", timer <= 1 ? 0 : (decayTime - timer) / 20, timer <= 1 ? 0 : decayTime / 20))) - .setPos(124, 18) - .setSize(16, 48) - .attachSyncer( - new FakeSyncWidget.LongSyncer(() -> decayTime, val -> decayTime = val), - builder, - (widget, val) -> widget.notifyTooltipChange()) - .attachSyncer( - new FakeSyncWidget.LongSyncer(() -> timer, val -> timer = val), - builder, - (widget, val) -> widget.notifyTooltipChange())) + .setPos(124, 18).setSize(16, 48) + .attachSyncer( + new FakeSyncWidget.LongSyncer(() -> decayTime, val -> decayTime = val), + builder, + (widget, val) -> widget.notifyTooltipChange()) + .attachSyncer( + new FakeSyncWidget.LongSyncer(() -> timer, val -> timer = val), + builder, + (widget, val) -> widget.notifyTooltipChange())) .widget(new FakeSyncWidget.ShortSyncer(() -> colorForGUI[0], val -> colorForGUI[0] = val)) .widget(new FakeSyncWidget.ShortSyncer(() -> colorForGUI[1], val -> colorForGUI[1] = val)) .widget(new FakeSyncWidget.ShortSyncer(() -> colorForGUI[2], val -> colorForGUI[2] = val)) - .widget(new DrawableWidget() - .setBackground(BW_UITextures.PICTURE_DECAY_TIME_CONTAINER) - .setPos(120, 14) - .setSize(24, 56)) - .widget(TextWidget.dynamicString( + .widget( + new DrawableWidget().setBackground(BW_UITextures.PICTURE_DECAY_TIME_CONTAINER).setPos(120, 14) + .setSize(24, 56)) + .widget( + TextWidget.dynamicString( () -> StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", mass)) - .setTextAlignment(Alignment.Center) - .setPos(65, 62)) - .widget(TextWidget.dynamicString(() -> - StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.0", getSievert())) - .setTextAlignment(Alignment.Center) - .setPos(60, 72)) - .widget(new ButtonWidget() - .setOnClick((clickData, widget) -> { - if (!widget.isClient()) { - widget.getContext().openSyncedWindow(RADIATION_SHUTTER_WINDOW_ID); - } - }) - .addTooltip("Radiation Shutter") - .setBackground(GT_UITextures.BUTTON_STANDARD) - .setPos(153, 5) + .setTextAlignment(Alignment.Center).setPos(65, 62)) + .widget( + TextWidget + .dynamicString( + () -> StatCollector + .translateToLocalFormatted("BW.NEI.display.radhatch.0", getSievert())) + .setTextAlignment(Alignment.Center).setPos(60, 72)) + .widget(new ButtonWidget().setOnClick((clickData, widget) -> { + if (!widget.isClient()) { + widget.getContext().openSyncedWindow(RADIATION_SHUTTER_WINDOW_ID); + } + }).addTooltip("Radiation Shutter").setBackground(GT_UITextures.BUTTON_STANDARD).setPos(153, 5) .setSize(18, 18)) - .widget(new ItemDrawable(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, null, null, null)) - .asWidget() - .setPos(154, 6)); + .widget( + new ItemDrawable( + GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, null, null, null)) + .asWidget().setPos(154, 6)); } private ModularWindow createShutterWindow(EntityPlayer player) { @@ -421,32 +410,25 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem builder.setBackground(ModularUITextures.VANILLA_BACKGROUND); builder.setGuiTint(getGUIColorization()); - builder.widget(new TextWidget("Radiation Shutter Control") - .setDefaultColor(COLOR_TITLE.get()) - .setPos(10, 9)) - .widget(new DrawableWidget() - .setDrawable(BW_UITextures.PICTURE_RADIATION_SHUTTER_FRAME) - .setPos(14, 27) - .setSize(55, 54)) - .widget(new DrawableWidget() - .setDrawable(() -> coverage < 100 ? BW_UITextures.PICTURE_RADIATION_SHUTTER_INSIDE : null) - .setPos(16, 29) - .setSize(51, 50) - .attachSyncer( - new FakeSyncWidget.ByteSyncer(this::getCoverage, this::setCoverage), - builder, - (widget, val) -> - widget.setPos(16, 29 + coverage / 2).setSize(51, 50 - coverage / 2))) - .widget(new TextFieldWidget() - .setSetterInt(val -> coverage = val.byteValue()) - .setGetterInt(() -> (int) coverage) - .setNumbers(0, 100) - .setTextColor(Color.WHITE.dark(1)) - .setOnScrollNumbers(1, 5, 50) - .setTextAlignment(Alignment.CenterLeft) - .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD.withOffset(-1, -1, 2, 2)) - .setPos(86, 27) - .setSize(30, 12)) + builder.widget(new TextWidget("Radiation Shutter Control").setDefaultColor(COLOR_TITLE.get()).setPos(10, 9)) + .widget( + new DrawableWidget().setDrawable(BW_UITextures.PICTURE_RADIATION_SHUTTER_FRAME).setPos(14, 27) + .setSize(55, 54)) + .widget( + new DrawableWidget() + .setDrawable( + () -> coverage < 100 ? BW_UITextures.PICTURE_RADIATION_SHUTTER_INSIDE : null) + .setPos(16, 29).setSize(51, 50).attachSyncer( + new FakeSyncWidget.ByteSyncer(this::getCoverage, this::setCoverage), + builder, + (widget, val) -> widget.setPos(16, 29 + coverage / 2) + .setSize(51, 50 - coverage / 2))) + .widget( + new TextFieldWidget().setSetterInt(val -> coverage = val.byteValue()) + .setGetterInt(() -> (int) coverage).setNumbers(0, 100).setTextColor(Color.WHITE.dark(1)) + .setOnScrollNumbers(1, 5, 50).setTextAlignment(Alignment.CenterLeft) + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD.withOffset(-1, -1, 2, 2)) + .setPos(86, 27).setSize(30, 12)) .widget(ButtonWidget.closeWindowButton(true).setPos(176 - 15, 3)); return builder.build(); @@ -454,16 +436,13 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem @Override public void addGregTechLogo(ModularWindow.Builder builder) { - builder.widget(new DrawableWidget() - .setDrawable(BW_UITextures.PICTURE_BW_LOGO_47X21) - .setSize(47, 21) - .setPos(10, 53)); + builder.widget( + new DrawableWidget().setDrawable(BW_UITextures.PICTURE_BW_LOGO_47X21).setSize(47, 21).setPos(10, 53)); } @Override public GUITextureSet getGUITextureSet() { - return new GUITextureSet() - .setMainBackground(GT_UITextures.BACKGROUND_SINGLEBLOCK_DEFAULT) + return new GUITextureSet().setMainBackground(GT_UITextures.BACKGROUND_SINGLEBLOCK_DEFAULT) .setGregTechLogo(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java index 90fd02b3e2..4e91a40272 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java @@ -1,27 +1,23 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -29,21 +25,18 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IBasicEnergyContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachineBlock { + boolean powered; - public GT_MetaTileEntity_Transistor( - int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) { + public GT_MetaTileEntity_Transistor(int aID, String aName, String aNameRegional, int aTier, String aDescription, + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 0, aDescription, aTextures); } - public GT_MetaTileEntity_Transistor( - int aID, String aName, String aNameRegional, int aTier, String[] aDescription, ITexture... aTextures) { + public GT_MetaTileEntity_Transistor(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 0, aDescription, aTextures); } @@ -60,54 +53,30 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin ITexture[][][] rTextures = new ITexture[12][17][]; for (byte i = -1; i < 16; ++i) { - rTextures[0][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] - }; - rTextures[1][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] - }; - rTextures[2][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] - }; - rTextures[3][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] - }; - rTextures[4][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] - }; - rTextures[5][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] - }; - rTextures[6][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] - }; - rTextures[7][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] - }; - rTextures[8][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] - }; - rTextures[9][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - }; - rTextures[10][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - }; - rTextures[11][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - }; + rTextures[0][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; + rTextures[1][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; + rTextures[2][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; + rTextures[3][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; + rTextures[4][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; + rTextures[5][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; + rTextures[6][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] }; + rTextures[7][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] }; + rTextures[8][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] }; + rTextures[9][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; + rTextures[10][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; + rTextures[11][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; } return rTextures; @@ -181,8 +150,8 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin } @Override - public ITexture[] getTexture( - IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, + boolean b4) { return new ITexture[0]; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java index 616219ef8c..485b0244a2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java @@ -1,38 +1,33 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.neiHandler; +import net.minecraft.item.ItemStack; + import codechicken.nei.recipe.GuiCraftingRecipe; import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; + import com.github.bartimaeusnek.bartworks.common.items.LabParts; + import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Recipe; import gregtech.nei.GT_NEI_DefaultHandler; -import net.minecraft.item.ItemStack; public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { + public BW_NEI_BioLabHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { super(aRecipeMap); if (!NEI_BW_Config.sIsAdded) { @@ -51,8 +46,7 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { } public void loadCraftingRecipes(ItemStack aResult) { - if (aResult != null - && aResult.getItem() instanceof LabParts + if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { for (CachedDefaultRecipe recipe : getCache()) @@ -64,8 +58,7 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { @Override public void loadUsageRecipes(ItemStack aResult) { - if (aResult != null - && aResult.getItem() instanceof LabParts + if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { for (CachedDefaultRecipe recipe : getCache()) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index 139d8607fa..14ad95d48a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -1,39 +1,34 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.neiHandler; +import java.awt.*; +import java.util.Collections; + +import net.minecraft.item.ItemStack; + import codechicken.nei.PositionedStack; import codechicken.nei.recipe.GuiCraftingRecipe; import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; + import com.github.bartimaeusnek.bartworks.common.items.LabParts; + import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Recipe; import gregtech.nei.GT_NEI_DefaultHandler; -import java.awt.*; -import java.util.Collections; -import net.minecraft.item.ItemStack; public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { @@ -69,8 +64,7 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { @Override public void loadUsageRecipes(ItemStack aResult) { - if (aResult != null - && aResult.getItem() instanceof LabParts + if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { loadLabPartRecipes(aResult); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index 727aa9fb97..711f5e7732 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -1,31 +1,32 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.neiHandler; +import java.awt.*; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import codechicken.lib.gui.GuiDraw; import codechicken.nei.PositionedStack; import codechicken.nei.recipe.GuiCraftingRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_SmallOres; @@ -34,15 +35,9 @@ import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128ba; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; + import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.enums.OrePrefixes; -import java.awt.*; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Objects; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; public class BW_NEI_OreHandler extends TemplateRecipeHandler { @@ -77,13 +72,11 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public void loadCraftingRecipes(String outputId, Object... results) { if (outputId.equalsIgnoreCase("quickanddirtyneihandler")) { HashSet result = new HashSet<>(); - Werkstoff.werkstoffHashSet.stream() - .filter(w -> w.hasGenerationFeature(OrePrefixes.ore)) + Werkstoff.werkstoffHashSet.stream().filter(w -> w.hasGenerationFeature(OrePrefixes.ore)) .forEach(w -> result.add(w.get(OrePrefixes.ore))); result.forEach(this::loadCraftingRecipes); result.clear(); - Werkstoff.werkstoffHashSet.stream() - .filter(w -> w.hasGenerationFeature(OrePrefixes.ore)) + Werkstoff.werkstoffHashSet.stream().filter(w -> w.hasGenerationFeature(OrePrefixes.ore)) .forEach(w -> result.add(w.get(OrePrefixes.oreSmall))); result.forEach(this::loadCraftingRecipes); result.clear(); @@ -104,9 +97,9 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { if ((recipe < this.arecipes.size()) && (this.arecipes.get(recipe) instanceof CachedOreRecipe)) { CachedOreRecipe cachedOreRecipe = (CachedOreRecipe) this.arecipes.get(recipe); - if (cachedOreRecipe == null - || cachedOreRecipe.getOtherStacks() == null - || cachedOreRecipe.getOtherStacks().size() == 0) return; + if (cachedOreRecipe == null || cachedOreRecipe.getOtherStacks() == null + || cachedOreRecipe.getOtherStacks().size() == 0) + return; if (!cachedOreRecipe.small) { if (cachedOreRecipe.getOtherStacks().get(0) == null @@ -116,17 +109,18 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { || cachedOreRecipe.getOtherStacks().get(3) == null || cachedOreRecipe.getOtherStacks().get(1).item == null || cachedOreRecipe.getOtherStacks().get(2).item == null - || cachedOreRecipe.getOtherStacks().get(3).item == null) return; + || cachedOreRecipe.getOtherStacks().get(3).item == null) + return; } else if (cachedOreRecipe.getOtherStacks().get(0) == null - || cachedOreRecipe.getOtherStacks().get(0).item == null) return; + || cachedOreRecipe.getOtherStacks().get(0).item == null) + return; - if (cachedOreRecipe.worldGen != null) - GuiDraw.drawString( - ChatColorHelper.BOLD + "DIM: " + ChatColorHelper.RESET + cachedOreRecipe.worldGen.getDimName(), - 0, - 40, - 0, - false); + if (cachedOreRecipe.worldGen != null) GuiDraw.drawString( + ChatColorHelper.BOLD + "DIM: " + ChatColorHelper.RESET + cachedOreRecipe.worldGen.getDimName(), + 0, + 40, + 0, + false); GuiDraw.drawString(ChatColorHelper.BOLD + "Primary:", 0, 50, 0, false); GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(0).item.getDisplayName(), 0, 60, 0, false); @@ -153,11 +147,13 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { Block ore = Block.getBlockFromItem(result.getItem()); if (ore instanceof BW_MetaGenerated_Ores) { BW_OreLayer.NEIMAP.get((short) result.getItemDamage()).stream() - .filter(l -> !(ore instanceof BW_MetaGenerated_SmallOres) - || !(l.getClass().equals(BW_WorldGenRoss128b.class) - || l.getClass().equals(BW_WorldGenRoss128ba.class))) - .forEach(l -> this.arecipes.add( - new CachedOreRecipe(l, result, ore instanceof BW_MetaGenerated_SmallOres))); + .filter( + l -> !(ore instanceof BW_MetaGenerated_SmallOres) + || !(l.getClass().equals(BW_WorldGenRoss128b.class) + || l.getClass().equals(BW_WorldGenRoss128ba.class))) + .forEach( + l -> this.arecipes + .add(new CachedOreRecipe(l, result, ore instanceof BW_MetaGenerated_SmallOres))); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java index 3f5868a349..80f283d080 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java @@ -1,10 +1,12 @@ package com.github.bartimaeusnek.bartworks.neiHandler; +import net.minecraft.nbt.NBTTagCompound; + import com.github.bartimaeusnek.bartworks.MainMod; import cpw.mods.fml.common.event.FMLInterModComms; -import net.minecraft.nbt.NBTTagCompound; public class IMCForNEI { + public static void IMCSender() { sendCatalyst("gt.recipe.largechemicalreactor", "gregtech:gt.blockmachines:13366", -10); sendCatalyst("gt.recipe.craker", "gregtech:gt.blockmachines:13367", -10); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index f14b220e52..724e392994 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -1,37 +1,30 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.neiHandler; +import net.minecraft.item.ItemStack; + import codechicken.nei.PositionedStack; import codechicken.nei.api.API; import codechicken.nei.api.IConfigureNEI; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import gregtech.api.enums.OrePrefixes; -import net.minecraft.item.ItemStack; public class NEI_BW_Config implements IConfigureNEI { @@ -55,31 +48,20 @@ public class NEI_BW_Config implements IConfigureNEI { API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses)); API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses2)); ItemStack[] prefixesToHide = { - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustTiny, WerkstoffLoader.Bismutite) - .copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustSmall, WerkstoffLoader.Bismutite) - .copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushed, WerkstoffLoader.Bismutite) - .copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, WerkstoffLoader.Bismutite) - .copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedCentrifuged, WerkstoffLoader.Bismutite) - .copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.nugget, WerkstoffLoader.Bismutite) - .copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemChipped, WerkstoffLoader.Bismutite) - .copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawed, WerkstoffLoader.Bismutite) - .copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawless, WerkstoffLoader.Bismutite) - .copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemExquisite, WerkstoffLoader.Bismutite) - .copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustImpure, WerkstoffLoader.Bismutite) - .copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustPure, WerkstoffLoader.Bismutite) - .copy(), - }; + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustTiny, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustSmall, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushed, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedCentrifuged, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.nugget, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemChipped, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawed, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawless, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemExquisite, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustImpure, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustPure, WerkstoffLoader.Bismutite).copy(), }; for (ItemStack stack : prefixesToHide) { stack.setItemDamage(Short.MAX_VALUE); API.hideItem(stack); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java index c2125a8e70..7231995517 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java @@ -1,42 +1,35 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.server.EventHandler; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.oredict.OreDictionary; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.net.OreDictCachePacket; import com.github.bartimaeusnek.bartworks.common.net.ServerJoinedPackage; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; + import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.oredict.OreDictionary; public class ServerEventHandler { @@ -44,8 +37,8 @@ public class ServerEventHandler { @SubscribeEvent(priority = EventPriority.LOWEST) public void EntityJoinWorldEvent(EntityJoinWorldEvent event) { if (event == null || !(event.entity instanceof EntityPlayerMP) || !SideReference.Side.Server) return; - MainMod.BW_Network_instance.sendToPlayer( - new OreDictCachePacket(OreDictHandler.getNonBWCache()), (EntityPlayerMP) event.entity); + MainMod.BW_Network_instance + .sendToPlayer(new OreDictCachePacket(OreDictHandler.getNonBWCache()), (EntityPlayerMP) event.entity); MainMod.BW_Network_instance.sendToPlayer(new ServerJoinedPackage(null), (EntityPlayerMP) event.entity); } @@ -64,8 +57,7 @@ public class ServerEventHandler { int[] oreIDs = OreDictionary.getOreIDs(stack); if (oreIDs.length > 0) { - loop: - for (int oreID : oreIDs) { + loop: for (int oreID : oreIDs) { String oreDictName = OreDictionary.getOreName(oreID); for (Werkstoff e : Werkstoff.werkstoffHashSet) { replace = e.getGenerationFeatures().enforceUnification; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java index d898826ed9..04be1f4129 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; @@ -27,40 +18,41 @@ import com.github.bartimaeusnek.bartworks.MainMod; import gregtech.api.enums.Materials; public class BW_GT_MaterialReference { - private static final Werkstoff.GenerationFeatures ADD_CASINGS_ONLY = - new Werkstoff.GenerationFeatures().disable().addCasings(); + + private static final Werkstoff.GenerationFeatures ADD_CASINGS_ONLY = new Werkstoff.GenerationFeatures().disable() + .addCasings(); public static Werkstoff Aluminium = new Werkstoff(Materials.Aluminium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 19); public static Werkstoff Americium = new Werkstoff(Materials.Americium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 103); public static Werkstoff Antimony = new Werkstoff(Materials.Antimony, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 58); - // public static Werkstoff Argon = new Werkstoff(Materials.Argon, ADD_CASINGS_ONLY, ELEMENT, 31_766+24); + // public static Werkstoff Argon = new Werkstoff(Materials.Argon, ADD_CASINGS_ONLY, ELEMENT, 31_766+24); public static Werkstoff Arsenic = new Werkstoff(Materials.Arsenic, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 39); public static Werkstoff Barium = new Werkstoff(Materials.Barium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 63); public static Werkstoff Beryllium = new Werkstoff(Materials.Beryllium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 8); public static Werkstoff Bismuth = new Werkstoff(Materials.Bismuth, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 90); public static Werkstoff Boron = new Werkstoff(Materials.Boron, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 9); public static Werkstoff Caesium = new Werkstoff(Materials.Caesium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 62); - // public static Werkstoff Calcium = new Werkstoff(Materials.Calcium, ADD_CASINGS_ONLY, ELEMENT, 31_766+26); + // public static Werkstoff Calcium = new Werkstoff(Materials.Calcium, ADD_CASINGS_ONLY, ELEMENT, 31_766+26); public static Werkstoff Carbon = new Werkstoff(Materials.Carbon, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 10); public static Werkstoff Cadmium = new Werkstoff(Materials.Cadmium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 55); public static Werkstoff Cerium = new Werkstoff(Materials.Cerium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 65); - // public static Werkstoff Chlorine = new Werkstoff(Materials.Chlorine, ADD_CASINGS_ONLY, ELEMENT, 31_766+23); + // public static Werkstoff Chlorine = new Werkstoff(Materials.Chlorine, ADD_CASINGS_ONLY, ELEMENT, 31_766+23); public static Werkstoff Chrome = new Werkstoff(Materials.Chrome, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 30); public static Werkstoff Cobalt = new Werkstoff(Materials.Cobalt, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 33); public static Werkstoff Copper = new Werkstoff(Materials.Copper, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 35); - // public static Werkstoff Deuterium = new Werkstoff(Materials.Deuterium, ADD_CASINGS_ONLY, ELEMENT, 31_766+2); + // public static Werkstoff Deuterium = new Werkstoff(Materials.Deuterium, ADD_CASINGS_ONLY, ELEMENT, 31_766+2); public static Werkstoff Dysprosium = new Werkstoff(Materials.Dysprosium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 73); - // public static Werkstoff Empty = new Werkstoff(Materials.Empty, ADD_CASINGS_ONLY, ELEMENT, 31_766+0); + // public static Werkstoff Empty = new Werkstoff(Materials.Empty, ADD_CASINGS_ONLY, ELEMENT, 31_766+0); public static Werkstoff Erbium = new Werkstoff(Materials.Erbium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 75); public static Werkstoff Europium = new Werkstoff(Materials.Europium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 70); - // public static Werkstoff Fluorine = new Werkstoff(Materials.Fluorine, ADD_CASINGS_ONLY, ELEMENT, 31_766+14); + // public static Werkstoff Fluorine = new Werkstoff(Materials.Fluorine, ADD_CASINGS_ONLY, ELEMENT, 31_766+14); public static Werkstoff Gadolinium = new Werkstoff(Materials.Gadolinium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 71); public static Werkstoff Gallium = new Werkstoff(Materials.Gallium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 37); public static Werkstoff Gold = new Werkstoff(Materials.Gold, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 86); public static Werkstoff Holmium = new Werkstoff(Materials.Holmium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 74); - // public static Werkstoff Hydrogen = new Werkstoff(Materials.Hydrogen, ADD_CASINGS_ONLY, ELEMENT, 31_766+1); - // public static Werkstoff Helium = new Werkstoff(Materials.Helium, ADD_CASINGS_ONLY, ELEMENT, 31_766+4); - // public static Werkstoff Helium_3 = new Werkstoff(Materials.Helium_3, ADD_CASINGS_ONLY, ELEMENT, 31_766+5); + // public static Werkstoff Hydrogen = new Werkstoff(Materials.Hydrogen, ADD_CASINGS_ONLY, ELEMENT, 31_766+1); + // public static Werkstoff Helium = new Werkstoff(Materials.Helium, ADD_CASINGS_ONLY, ELEMENT, 31_766+4); + // public static Werkstoff Helium_3 = new Werkstoff(Materials.Helium_3, ADD_CASINGS_ONLY, ELEMENT, 31_766+5); public static Werkstoff Indium = new Werkstoff(Materials.Indium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 56); public static Werkstoff Iridium = new Werkstoff(Materials.Iridium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 84); public static Werkstoff Iron = new Werkstoff(Materials.Iron, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 32); @@ -70,26 +62,32 @@ public class BW_GT_MaterialReference { public static Werkstoff Lutetium = new Werkstoff(Materials.Lutetium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 78); public static Werkstoff Magnesium = new Werkstoff(Materials.Magnesium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 18); public static Werkstoff Manganese = new Werkstoff(Materials.Manganese, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 31); - // public static Werkstoff Mercury = new Werkstoff(Materials.Mercury, ADD_CASINGS_ONLY, ELEMENT, 31_766+87); + // public static Werkstoff Mercury = new Werkstoff(Materials.Mercury, ADD_CASINGS_ONLY, ELEMENT, 31_766+87); public static Werkstoff Molybdenum = new Werkstoff(Materials.Molybdenum, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 48); public static Werkstoff Neodymium = new Werkstoff(Materials.Neodymium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 67); public static Werkstoff Neutronium = new Werkstoff(Materials.Neutronium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 129); public static Werkstoff Nickel = new Werkstoff(Materials.Nickel, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 34); public static Werkstoff Niobium = new Werkstoff(Materials.Niobium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 47); - // public static Werkstoff Nitrogen = new Werkstoff(Materials.Nitrogen, ADD_CASINGS_ONLY, ELEMENT, 31_766+12); + // public static Werkstoff Nitrogen = new Werkstoff(Materials.Nitrogen, ADD_CASINGS_ONLY, ELEMENT, 31_766+12); public static Werkstoff Osmium = new Werkstoff(Materials.Osmium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 83); - // public static Werkstoff Oxygen = new Werkstoff(Materials.Oxygen, ADD_CASINGS_ONLY, ELEMENT, 31_766+13); + // public static Werkstoff Oxygen = new Werkstoff(Materials.Oxygen, ADD_CASINGS_ONLY, ELEMENT, 31_766+13); public static Werkstoff Palladium = new Werkstoff(Materials.Palladium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 52); public static Werkstoff Phosphorus = new Werkstoff(Materials.Phosphorus, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 21); public static Werkstoff Platinum = new Werkstoff(Materials.Platinum, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 85); public static Werkstoff Plutonium = new Werkstoff(Materials.Plutonium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 100); - public static Werkstoff Plutonium241 = - new Werkstoff(Materials.Plutonium241, ADD_CASINGS_ONLY, ISOTOPE, 31_766 + 101); + public static Werkstoff Plutonium241 = new Werkstoff( + Materials.Plutonium241, + ADD_CASINGS_ONLY, + ISOTOPE, + 31_766 + 101); public static Werkstoff Potassium = new Werkstoff(Materials.Potassium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 25); - public static Werkstoff Praseodymium = - new Werkstoff(Materials.Praseodymium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 66); + public static Werkstoff Praseodymium = new Werkstoff( + Materials.Praseodymium, + ADD_CASINGS_ONLY, + ELEMENT, + 31_766 + 66); public static Werkstoff Promethium = new Werkstoff(Materials.Promethium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 68); - // public static Werkstoff Radon = new Werkstoff(Materials.Radon, ADD_CASINGS_ONLY, ELEMENT, 31_766+93); + // public static Werkstoff Radon = new Werkstoff(Materials.Radon, ADD_CASINGS_ONLY, ELEMENT, 31_766+93); public static Werkstoff Rubidium = new Werkstoff(Materials.Rubidium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 43); public static Werkstoff Samarium = new Werkstoff(Materials.Samarium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 69); public static Werkstoff Scandium = new Werkstoff(Materials.Scandium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 27); @@ -99,7 +97,7 @@ public class BW_GT_MaterialReference { public static Werkstoff Strontium = new Werkstoff(Materials.Strontium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 44); public static Werkstoff Sulfur = new Werkstoff(Materials.Sulfur, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 22); public static Werkstoff Tantalum = new Werkstoff(Materials.Tantalum, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 80); - // public static Werkstoff Tellurium = new Werkstoff(Materials.Tellurium, ADD_CASINGS_ONLY, ELEMENT, 31_766+59); + // public static Werkstoff Tellurium = new Werkstoff(Materials.Tellurium, ADD_CASINGS_ONLY, ELEMENT, 31_766+59); public static Werkstoff Terbium = new Werkstoff(Materials.Terbium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 72); public static Werkstoff Thorium = new Werkstoff(Materials.Thorium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 96); public static Werkstoff Thulium = new Werkstoff(Materials.Thulium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 76); @@ -116,39 +114,69 @@ public class BW_GT_MaterialReference { public static Werkstoff Zinc = new Werkstoff(Materials.Zinc, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 36); public static Werkstoff Ardite = new Werkstoff(Materials.Ardite, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 382); public static Werkstoff Naquadah = new Werkstoff(Materials.Naquadah, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 324); - public static Werkstoff NaquadahAlloy = - new Werkstoff(Materials.NaquadahAlloy, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 325); - public static Werkstoff NaquadahEnriched = - new Werkstoff(Materials.NaquadahEnriched, ADD_CASINGS_ONLY, ISOTOPE, 31_766 + 326); + public static Werkstoff NaquadahAlloy = new Werkstoff( + Materials.NaquadahAlloy, + ADD_CASINGS_ONLY, + COMPOUND, + 31_766 + 325); + public static Werkstoff NaquadahEnriched = new Werkstoff( + Materials.NaquadahEnriched, + ADD_CASINGS_ONLY, + ISOTOPE, + 31_766 + 326); public static Werkstoff Naquadria = new Werkstoff(Materials.Naquadria, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 327); public static Werkstoff WroughtIron = new Werkstoff(Materials.WroughtIron, ADD_CASINGS_ONLY, ISOTOPE, 31_766 + 304); - public static Werkstoff AnnealedCopper = - new Werkstoff(Materials.AnnealedCopper, ADD_CASINGS_ONLY, ISOTOPE, 31_766 + 345); + public static Werkstoff AnnealedCopper = new Werkstoff( + Materials.AnnealedCopper, + ADD_CASINGS_ONLY, + ISOTOPE, + 31_766 + 345); public static Werkstoff Osmiridium = new Werkstoff(Materials.Osmiridium, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 317); - public static Werkstoff SterlingSilver = - new Werkstoff(Materials.SterlingSilver, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 350); + public static Werkstoff SterlingSilver = new Werkstoff( + Materials.SterlingSilver, + ADD_CASINGS_ONLY, + MIXTURE, + 31_766 + 350); public static Werkstoff RoseGold = new Werkstoff(Materials.RoseGold, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 351); public static Werkstoff BlackBronze = new Werkstoff(Materials.BlackBronze, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 352); - public static Werkstoff BismuthBronze = - new Werkstoff(Materials.BismuthBronze, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 353); + public static Werkstoff BismuthBronze = new Werkstoff( + Materials.BismuthBronze, + ADD_CASINGS_ONLY, + MIXTURE, + 31_766 + 353); public static Werkstoff BlackSteel = new Werkstoff(Materials.BlackSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 334); public static Werkstoff RedSteel = new Werkstoff(Materials.RedSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 348); public static Werkstoff BlueSteel = new Werkstoff(Materials.BlueSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 349); - public static Werkstoff DamascusSteel = - new Werkstoff(Materials.DamascusSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 335); - public static Werkstoff TungstenSteel = - new Werkstoff(Materials.TungstenSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 316); + public static Werkstoff DamascusSteel = new Werkstoff( + Materials.DamascusSteel, + ADD_CASINGS_ONLY, + MIXTURE, + 31_766 + 335); + public static Werkstoff TungstenSteel = new Werkstoff( + Materials.TungstenSteel, + ADD_CASINGS_ONLY, + MIXTURE, + 31_766 + 316); public static Werkstoff Ultimet = new Werkstoff(Materials.Ultimet, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 344); - public static Werkstoff TungstenCarbide = - new Werkstoff(Materials.TungstenCarbide, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 370); - public static Werkstoff VanadiumSteel = - new Werkstoff(Materials.VanadiumSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 371); + public static Werkstoff TungstenCarbide = new Werkstoff( + Materials.TungstenCarbide, + ADD_CASINGS_ONLY, + MIXTURE, + 31_766 + 370); + public static Werkstoff VanadiumSteel = new Werkstoff( + Materials.VanadiumSteel, + ADD_CASINGS_ONLY, + MIXTURE, + 31_766 + 371); public static Werkstoff HSSG = new Werkstoff(Materials.HSSG, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 372); public static Werkstoff HSSE = new Werkstoff(Materials.HSSE, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 373); public static Werkstoff HSSS = new Werkstoff(Materials.HSSS, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 374); - public static Werkstoff StainlessSteel = - new Werkstoff(Materials.StainlessSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 306); + public static Werkstoff StainlessSteel = new Werkstoff( + Materials.StainlessSteel, + ADD_CASINGS_ONLY, + MIXTURE, + 31_766 + 306); public static Werkstoff Brass = new Werkstoff(Materials.Brass, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 301); public static Werkstoff Bronze = new Werkstoff(Materials.Bronze, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 300); @@ -156,11 +184,15 @@ public class BW_GT_MaterialReference { // public static Werkstoff WoodSealed = new Werkstoff(Materials.WoodSealed, ADD_CASINGS_ONLY, // BIOLOGICAL,31_766+889); // public static Werkstoff Cheese = new Werkstoff(Materials.Cheese, new - // Werkstoff.GenerationFeatures().addCasings().addMetalItems().addMultipleIngotMetalWorkingItems().enforceUnification(), BIOLOGICAL,31_766+894); + // Werkstoff.GenerationFeatures().addCasings().addMetalItems().addMultipleIngotMetalWorkingItems().enforceUnification(), + // BIOLOGICAL,31_766+894); public static Werkstoff Steel = new Werkstoff(Materials.Steel, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 305); - public static Werkstoff Polytetrafluoroethylene = - new Werkstoff(Materials.Polytetrafluoroethylene, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 473); + public static Werkstoff Polytetrafluoroethylene = new Werkstoff( + Materials.Polytetrafluoroethylene, + ADD_CASINGS_ONLY, + COMPOUND, + 31_766 + 473); public static Werkstoff Plastic = new Werkstoff(Materials.Plastic, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 874); public static Werkstoff Epoxid = new Werkstoff(Materials.Epoxid, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 470); public static Werkstoff Magnesia = new Werkstoff( @@ -173,796 +205,796 @@ public class BW_GT_MaterialReference { MainMod.LOGGER.info("Load Elements from GT"); } - // TODO: GT++ only? + // TODO: GT++ only? - // public static Werkstoff Flerovium = new Werkstoff(Materials.Flerovium, , + // public static Werkstoff Flerovium = new Werkstoff(Materials.Flerovium, , // ,31_766+984); - // public static Werkstoff HeeEndium = new Werkstoff(Materials.HeeEndium, , + // public static Werkstoff HeeEndium = new Werkstoff(Materials.HeeEndium, , // ,31_766+770); - // public static Werkstoff PlatinumGroupSludge = new Werkstoff(Materials.PlatinumGroupSludge, + // public static Werkstoff PlatinumGroupSludge = new Werkstoff(Materials.PlatinumGroupSludge, // , ,31_766+241); - // public static Werkstoff Draconium = new Werkstoff(Materials.Draconium, , + // public static Werkstoff Draconium = new Werkstoff(Materials.Draconium, , // ,31_766+975); - // public static Werkstoff DraconiumAwakened = new Werkstoff(Materials.DraconiumAwakened, , + // public static Werkstoff DraconiumAwakened = new Werkstoff(Materials.DraconiumAwakened, , // ,31_766+976); - // public static Werkstoff Adamantium = new Werkstoff(Materials.Adamantium, , + // public static Werkstoff Adamantium = new Werkstoff(Materials.Adamantium, , // ,31_766+319); - // public static Werkstoff Alduorite = new Werkstoff(Materials.Alduorite, , + // public static Werkstoff Alduorite = new Werkstoff(Materials.Alduorite, , // ,31_766+485); - // public static Werkstoff Amber = new Werkstoff(Materials.Amber, , ,31_766+514); - // public static Werkstoff Angmallen = new Werkstoff(Materials.Angmallen, , + // public static Werkstoff Amber = new Werkstoff(Materials.Amber, , ,31_766+514); + // public static Werkstoff Angmallen = new Werkstoff(Materials.Angmallen, , // ,31_766+958); - // public static Werkstoff Atlarus = new Werkstoff(Materials.Atlarus, , + // public static Werkstoff Atlarus = new Werkstoff(Materials.Atlarus, , // ,31_766+965); - // public static Werkstoff Blizz = new Werkstoff(Materials.Blizz, , ,31_766+851); - // public static Werkstoff Blueschist = new Werkstoff(Materials.Blueschist, , + // public static Werkstoff Blizz = new Werkstoff(Materials.Blizz, , ,31_766+851); + // public static Werkstoff Blueschist = new Werkstoff(Materials.Blueschist, , // ,31_766+852); - // public static Werkstoff Bluestone = new Werkstoff(Materials.Bluestone, , + // public static Werkstoff Bluestone = new Werkstoff(Materials.Bluestone, , // ,31_766+813); - // public static Werkstoff Carmot = new Werkstoff(Materials.Carmot, , ,31_766+962); - // public static Werkstoff Celenegil = new Werkstoff(Materials.Celenegil, , + // public static Werkstoff Carmot = new Werkstoff(Materials.Carmot, , ,31_766+962); + // public static Werkstoff Celenegil = new Werkstoff(Materials.Celenegil, , // ,31_766+964); - // public static Werkstoff CertusQuartz = new Werkstoff(Materials.CertusQuartz, , + // public static Werkstoff CertusQuartz = new Werkstoff(Materials.CertusQuartz, , // ,31_766+516); - // public static Werkstoff Ceruclase = new Werkstoff(Materials.Ceruclase, , + // public static Werkstoff Ceruclase = new Werkstoff(Materials.Ceruclase, , // ,31_766+952); - // public static Werkstoff CobaltHexahydrate = new Werkstoff(Materials.CobaltHexahydrate, , + // public static Werkstoff CobaltHexahydrate = new Werkstoff(Materials.CobaltHexahydrate, , // ,31_766+853); - // public static Werkstoff ConstructionFoam = new Werkstoff(Materials.ConstructionFoam, , + // public static Werkstoff ConstructionFoam = new Werkstoff(Materials.ConstructionFoam, , // ,31_766+854); - // public static Werkstoff Chert = new Werkstoff(Materials.Chert, , ,31_766+857); - // public static Werkstoff CrudeOil = new Werkstoff(Materials.CrudeOil, , + // public static Werkstoff Chert = new Werkstoff(Materials.Chert, , ,31_766+857); + // public static Werkstoff CrudeOil = new Werkstoff(Materials.CrudeOil, , // ,31_766+858); - // public static Werkstoff Dacite = new Werkstoff(Materials.Dacite, , ,31_766+859); - // public static Werkstoff DarkIron = new Werkstoff(Materials.DarkIron, , + // public static Werkstoff Dacite = new Werkstoff(Materials.Dacite, , ,31_766+859); + // public static Werkstoff DarkIron = new Werkstoff(Materials.DarkIron, , // ,31_766+342); - // public static Werkstoff Desh = new Werkstoff(Materials.Desh, , ,31_766+884); - // public static Werkstoff Dilithium = new Werkstoff(Materials.Dilithium, , + // public static Werkstoff Desh = new Werkstoff(Materials.Desh, , ,31_766+884); + // public static Werkstoff Dilithium = new Werkstoff(Materials.Dilithium, , // ,31_766+515); - // public static Werkstoff Duranium = new Werkstoff(Materials.Duranium, , + // public static Werkstoff Duranium = new Werkstoff(Materials.Duranium, , // ,31_766+328); - // public static Werkstoff Eclogite = new Werkstoff(Materials.Eclogite, , + // public static Werkstoff Eclogite = new Werkstoff(Materials.Eclogite, , // ,31_766+860); - // public static Werkstoff ElectrumFlux = new Werkstoff(Materials.ElectrumFlux, , + // public static Werkstoff ElectrumFlux = new Werkstoff(Materials.ElectrumFlux, , // ,31_766+320); - // public static Werkstoff Emery = new Werkstoff(Materials.Emery, , ,31_766+861); - // public static Werkstoff EnderiumBase = new Werkstoff(Materials.EnderiumBase, , + // public static Werkstoff Emery = new Werkstoff(Materials.Emery, , ,31_766+861); + // public static Werkstoff EnderiumBase = new Werkstoff(Materials.EnderiumBase, , // ,31_766+380); - // public static Werkstoff Epidote = new Werkstoff(Materials.Epidote, , + // public static Werkstoff Epidote = new Werkstoff(Materials.Epidote, , // ,31_766+862); - // public static Werkstoff Eximite = new Werkstoff(Materials.Eximite, , + // public static Werkstoff Eximite = new Werkstoff(Materials.Eximite, , // ,31_766+959); - // public static Werkstoff FierySteel = new Werkstoff(Materials.FierySteel, , + // public static Werkstoff FierySteel = new Werkstoff(Materials.FierySteel, , // ,31_766+346); - // public static Werkstoff Firestone = new Werkstoff(Materials.Firestone, , + // public static Werkstoff Firestone = new Werkstoff(Materials.Firestone, , // ,31_766+347); - // public static Werkstoff FoolsRuby = new Werkstoff(Materials.FoolsRuby, , + // public static Werkstoff FoolsRuby = new Werkstoff(Materials.FoolsRuby, , // ,31_766+512); - // public static Werkstoff Force = new Werkstoff(Materials.Force, , ,31_766+521); - // public static Werkstoff Forcicium = new Werkstoff(Materials.Forcicium, , + // public static Werkstoff Force = new Werkstoff(Materials.Force, , ,31_766+521); + // public static Werkstoff Forcicium = new Werkstoff(Materials.Forcicium, , // ,31_766+518); - // public static Werkstoff Forcillium = new Werkstoff(Materials.Forcillium, , + // public static Werkstoff Forcillium = new Werkstoff(Materials.Forcillium, , // ,31_766+519); - // public static Werkstoff Gabbro = new Werkstoff(Materials.Gabbro, , ,31_766+863); - // public static Werkstoff Glowstone = new Werkstoff(Materials.Glowstone, , + // public static Werkstoff Gabbro = new Werkstoff(Materials.Gabbro, , ,31_766+863); + // public static Werkstoff Glowstone = new Werkstoff(Materials.Glowstone, , // ,31_766+811); - // public static Werkstoff Gneiss = new Werkstoff(Materials.Gneiss, , ,31_766+864); - // public static Werkstoff Graphite = new Werkstoff(Materials.Graphite, , + // public static Werkstoff Gneiss = new Werkstoff(Materials.Gneiss, , ,31_766+864); + // public static Werkstoff Graphite = new Werkstoff(Materials.Graphite, , // ,31_766+865); - // public static Werkstoff Graphene = new Werkstoff(Materials.Graphene, , + // public static Werkstoff Graphene = new Werkstoff(Materials.Graphene, , // ,31_766+819); - // public static Werkstoff Greenschist = new Werkstoff(Materials.Greenschist, , + // public static Werkstoff Greenschist = new Werkstoff(Materials.Greenschist, , // ,31_766+866); - // public static Werkstoff Greenstone = new Werkstoff(Materials.Greenstone, , + // public static Werkstoff Greenstone = new Werkstoff(Materials.Greenstone, , // ,31_766+867); - // public static Werkstoff Greywacke = new Werkstoff(Materials.Greywacke, , + // public static Werkstoff Greywacke = new Werkstoff(Materials.Greywacke, , // ,31_766+897); - // public static Werkstoff Haderoth = new Werkstoff(Materials.Haderoth, , + // public static Werkstoff Haderoth = new Werkstoff(Materials.Haderoth, , // ,31_766+963); - // public static Werkstoff Hepatizon = new Werkstoff(Materials.Hepatizon, , + // public static Werkstoff Hepatizon = new Werkstoff(Materials.Hepatizon, , // ,31_766+957); - // public static Werkstoff HSLA = new Werkstoff(Materials.HSLA, , ,31_766+322); - // public static Werkstoff Ignatius = new Werkstoff(Materials.Ignatius, , + // public static Werkstoff HSLA = new Werkstoff(Materials.HSLA, , ,31_766+322); + // public static Werkstoff Ignatius = new Werkstoff(Materials.Ignatius, , // ,31_766+950); - // public static Werkstoff Infuscolium = new Werkstoff(Materials.Infuscolium, , + // public static Werkstoff Infuscolium = new Werkstoff(Materials.Infuscolium, , // ,31_766+490); - // public static Werkstoff InfusedGold = new Werkstoff(Materials.InfusedGold, , + // public static Werkstoff InfusedGold = new Werkstoff(Materials.InfusedGold, , // ,31_766+323); - // public static Werkstoff InfusedAir = new Werkstoff(Materials.InfusedAir, , + // public static Werkstoff InfusedAir = new Werkstoff(Materials.InfusedAir, , // ,31_766+540); - // public static Werkstoff InfusedFire = new Werkstoff(Materials.InfusedFire, , + // public static Werkstoff InfusedFire = new Werkstoff(Materials.InfusedFire, , // ,31_766+541); - // public static Werkstoff InfusedEarth = new Werkstoff(Materials.InfusedEarth, , + // public static Werkstoff InfusedEarth = new Werkstoff(Materials.InfusedEarth, , // ,31_766+542); - // public static Werkstoff InfusedWater = new Werkstoff(Materials.InfusedWater, , + // public static Werkstoff InfusedWater = new Werkstoff(Materials.InfusedWater, , // ,31_766+543); - // public static Werkstoff InfusedEntropy = new Werkstoff(Materials.InfusedEntropy, , + // public static Werkstoff InfusedEntropy = new Werkstoff(Materials.InfusedEntropy, , // ,31_766+544); - // public static Werkstoff InfusedOrder = new Werkstoff(Materials.InfusedOrder, , + // public static Werkstoff InfusedOrder = new Werkstoff(Materials.InfusedOrder, , // ,31_766+545); - // public static Werkstoff Inolashite = new Werkstoff(Materials.Inolashite, , + // public static Werkstoff Inolashite = new Werkstoff(Materials.Inolashite, , // ,31_766+954); - // public static Werkstoff Jade = new Werkstoff(Materials.Jade, , ,31_766+537); - // public static Werkstoff Jasper = new Werkstoff(Materials.Jasper, , ,31_766+511); - // public static Werkstoff Kalendrite = new Werkstoff(Materials.Kalendrite, , + // public static Werkstoff Jade = new Werkstoff(Materials.Jade, , ,31_766+537); + // public static Werkstoff Jasper = new Werkstoff(Materials.Jasper, , ,31_766+511); + // public static Werkstoff Kalendrite = new Werkstoff(Materials.Kalendrite, , // ,31_766+953); - // public static Werkstoff Komatiite = new Werkstoff(Materials.Komatiite, , + // public static Werkstoff Komatiite = new Werkstoff(Materials.Komatiite, , // ,31_766+869); - // public static Werkstoff Lava = new Werkstoff(Materials.Lava, , ,31_766+700); - // public static Werkstoff Lemurite = new Werkstoff(Materials.Lemurite, , + // public static Werkstoff Lava = new Werkstoff(Materials.Lava, , ,31_766+700); + // public static Werkstoff Lemurite = new Werkstoff(Materials.Lemurite, , // ,31_766+486); - // public static Werkstoff MeteoricIron = new Werkstoff(Materials.MeteoricIron, , + // public static Werkstoff MeteoricIron = new Werkstoff(Materials.MeteoricIron, , // ,31_766+340); - // public static Werkstoff MeteoricSteel = new Werkstoff(Materials.MeteoricSteel, , + // public static Werkstoff MeteoricSteel = new Werkstoff(Materials.MeteoricSteel, , // ,31_766+341); - // public static Werkstoff Meutoite = new Werkstoff(Materials.Meutoite, , + // public static Werkstoff Meutoite = new Werkstoff(Materials.Meutoite, , // ,31_766+487); - // public static Werkstoff Migmatite = new Werkstoff(Materials.Migmatite, , + // public static Werkstoff Migmatite = new Werkstoff(Materials.Migmatite, , // ,31_766+872); - // public static Werkstoff NetherBrick = new Werkstoff(Materials.NetherBrick, , + // public static Werkstoff NetherBrick = new Werkstoff(Materials.NetherBrick, , // ,31_766+814); - // public static Werkstoff NetherQuartz = new Werkstoff(Materials.NetherQuartz, , + // public static Werkstoff NetherQuartz = new Werkstoff(Materials.NetherQuartz, , // ,31_766+522); - // public static Werkstoff NetherStar = new Werkstoff(Materials.NetherStar, , + // public static Werkstoff NetherStar = new Werkstoff(Materials.NetherStar, , // ,31_766+506); - // public static Werkstoff Oilsands = new Werkstoff(Materials.Oilsands, , + // public static Werkstoff Oilsands = new Werkstoff(Materials.Oilsands, , // ,31_766+878); - // public static Werkstoff Orichalcum = new Werkstoff(Materials.Orichalcum, , + // public static Werkstoff Orichalcum = new Werkstoff(Materials.Orichalcum, , // ,31_766+966); - // public static Werkstoff Oureclase = new Werkstoff(Materials.Oureclase, , + // public static Werkstoff Oureclase = new Werkstoff(Materials.Oureclase, , // ,31_766+961); - // public static Werkstoff Prometheum = new Werkstoff(Materials.Prometheum, , + // public static Werkstoff Prometheum = new Werkstoff(Materials.Prometheum, , // ,31_766+960); - // public static Werkstoff Quartzite = new Werkstoff(Materials.Quartzite, , + // public static Werkstoff Quartzite = new Werkstoff(Materials.Quartzite, , // ,31_766+523); - // public static Werkstoff Rhyolite = new Werkstoff(Materials.Rhyolite, , + // public static Werkstoff Rhyolite = new Werkstoff(Materials.Rhyolite, , // ,31_766+875); - // public static Werkstoff Rubracium = new Werkstoff(Materials.Rubracium, , + // public static Werkstoff Rubracium = new Werkstoff(Materials.Rubracium, , // ,31_766+488); - // public static Werkstoff Sanguinite = new Werkstoff(Materials.Sanguinite, , + // public static Werkstoff Sanguinite = new Werkstoff(Materials.Sanguinite, , // ,31_766+955); - // public static Werkstoff Siltstone = new Werkstoff(Materials.Siltstone, , + // public static Werkstoff Siltstone = new Werkstoff(Materials.Siltstone, , // ,31_766+876); - // public static Werkstoff Tartarite = new Werkstoff(Materials.Tartarite, , + // public static Werkstoff Tartarite = new Werkstoff(Materials.Tartarite, , // ,31_766+956); - // public static Werkstoff UUAmplifier = new Werkstoff(Materials.UUAmplifier, , + // public static Werkstoff UUAmplifier = new Werkstoff(Materials.UUAmplifier, , // ,31_766+721); - // public static Werkstoff UUMatter = new Werkstoff(Materials.UUMatter, , + // public static Werkstoff UUMatter = new Werkstoff(Materials.UUMatter, , // ,31_766+703); - // public static Werkstoff Void = new Werkstoff(Materials.Void, , ,31_766+970); - // public static Werkstoff Vulcanite = new Werkstoff(Materials.Vulcanite, , + // public static Werkstoff Void = new Werkstoff(Materials.Void, , ,31_766+970); + // public static Werkstoff Vulcanite = new Werkstoff(Materials.Vulcanite, , // ,31_766+489); - // public static Werkstoff Vyroxeres = new Werkstoff(Materials.Vyroxeres, , + // public static Werkstoff Vyroxeres = new Werkstoff(Materials.Vyroxeres, , // ,31_766+951); - // public static Werkstoff BioFuel = new Werkstoff(Materials.BioFuel, , + // public static Werkstoff BioFuel = new Werkstoff(Materials.BioFuel, , // ,31_766+705); - // public static Werkstoff Biomass = new Werkstoff(Materials.Biomass, , + // public static Werkstoff Biomass = new Werkstoff(Materials.Biomass, , // ,31_766+704); - // public static CharcoalByproducts = new MaterialBuilder + // public static CharcoalByproducts = new MaterialBuilder - // public static Werkstoff Chili = new Werkstoff(Materials.Chili, , ,31_766+895); - // public static Werkstoff Chocolate = new Werkstoff(Materials.Chocolate, , + // public static Werkstoff Chili = new Werkstoff(Materials.Chili, , ,31_766+895); + // public static Werkstoff Chocolate = new Werkstoff(Materials.Chocolate, , // ,31_766+886); - // public static Werkstoff CoalFuel = new Werkstoff(Materials.CoalFuel, , + // public static Werkstoff CoalFuel = new Werkstoff(Materials.CoalFuel, , // ,31_766+710); - // public static Werkstoff Cocoa = new Werkstoff(Materials.Cocoa, , ,31_766+887); - // public static Werkstoff Coffee = new Werkstoff(Materials.Coffee, , ,31_766+888); - // public static Werkstoff Creosote = new Werkstoff(Materials.Creosote, , + // public static Werkstoff Cocoa = new Werkstoff(Materials.Cocoa, , ,31_766+887); + // public static Werkstoff Coffee = new Werkstoff(Materials.Coffee, , ,31_766+888); + // public static Werkstoff Creosote = new Werkstoff(Materials.Creosote, , // ,31_766+712); - // public static Werkstoff Ethanol = new Werkstoff(Materials.Ethanol, , + // public static Werkstoff Ethanol = new Werkstoff(Materials.Ethanol, , // ,31_766+706); - // public static FermentedBiomass = new MaterialBuilder - // public static Werkstoff Fuel = new Werkstoff(Materials.Fuel, , ,31_766+708); - // public static Werkstoff Glue = new Werkstoff(Materials.Glue, , ,31_766+726); - // public static Werkstoff Gunpowder = new Werkstoff(Materials.Gunpowder, , + // public static FermentedBiomass = new MaterialBuilder + // public static Werkstoff Fuel = new Werkstoff(Materials.Fuel, , ,31_766+708); + // public static Werkstoff Glue = new Werkstoff(Materials.Glue, , ,31_766+726); + // public static Werkstoff Gunpowder = new Werkstoff(Materials.Gunpowder, , // ,31_766+800); - // public static Werkstoff FryingOilHot = new Werkstoff(Materials.FryingOilHot, , + // public static Werkstoff FryingOilHot = new Werkstoff(Materials.FryingOilHot, , // ,31_766+727); - // public static Werkstoff Honey = new Werkstoff(Materials.Honey, , ,31_766+725); - // public static Werkstoff Lubricant = new Werkstoff(Materials.Lubricant, , + // public static Werkstoff Honey = new Werkstoff(Materials.Honey, , ,31_766+725); + // public static Werkstoff Lubricant = new Werkstoff(Materials.Lubricant, , // ,31_766+724); - // public static Werkstoff McGuffium239 = new Werkstoff(Materials.McGuffium239, , + // public static Werkstoff McGuffium239 = new Werkstoff(Materials.McGuffium239, , // ,31_766+999); - // public static Werkstoff MeatRaw = new Werkstoff(Materials.MeatRaw, , + // public static Werkstoff MeatRaw = new Werkstoff(Materials.MeatRaw, , // ,31_766+892); - // public static Werkstoff MeatCooked = new Werkstoff(Materials.MeatCooked, , + // public static Werkstoff MeatCooked = new Werkstoff(Materials.MeatCooked, , // ,31_766+893); - // public static Werkstoff Milk = new Werkstoff(Materials.Milk, , ,31_766+885); - // public static Werkstoff Oil = new Werkstoff(Materials.Oil, , ,31_766+707); - // public static Werkstoff Paper = new Werkstoff(Materials.Paper, , ,31_766+879); - // public static Werkstoff RareEarth = new Werkstoff(Materials.RareEarth, , + // public static Werkstoff Milk = new Werkstoff(Materials.Milk, , ,31_766+885); + // public static Werkstoff Oil = new Werkstoff(Materials.Oil, , ,31_766+707); + // public static Werkstoff Paper = new Werkstoff(Materials.Paper, , ,31_766+879); + // public static Werkstoff RareEarth = new Werkstoff(Materials.RareEarth, , // ,31_766+891); - // public static Werkstoff Reinforced = new Werkstoff(Materials.Reinforced, , + // public static Werkstoff Reinforced = new Werkstoff(Materials.Reinforced, , // ,31_766+383); - // public static Werkstoff SeedOil = new Werkstoff(Materials.SeedOil, , + // public static Werkstoff SeedOil = new Werkstoff(Materials.SeedOil, , // ,31_766+713); - // public static Werkstoff SeedOilHemp = new Werkstoff(Materials.SeedOilHemp, , + // public static Werkstoff SeedOilHemp = new Werkstoff(Materials.SeedOilHemp, , // ,31_766+722); - // public static Werkstoff SeedOilLin = new Werkstoff(Materials.SeedOilLin, , + // public static Werkstoff SeedOilLin = new Werkstoff(Materials.SeedOilLin, , // ,31_766+723); - // public static Werkstoff Stone = new Werkstoff(Materials.Stone, , ,31_766+299); - // public static Werkstoff Unstable = new Werkstoff(Materials.Unstable, , + // public static Werkstoff Stone = new Werkstoff(Materials.Stone, , ,31_766+299); + // public static Werkstoff Unstable = new Werkstoff(Materials.Unstable, , // ,31_766+396); - // public static Vinegar = new MaterialBuilder - // public static Werkstoff Wheat = new Werkstoff(Materials.Wheat, , ,31_766+881); - // public static WoodGas = new MaterialBuilder - // public static WoodTar = new MaterialBuilder - // public static WoodVinegar = new MaterialBuilder + // public static Vinegar = new MaterialBuilder + // public static Werkstoff Wheat = new Werkstoff(Materials.Wheat, , ,31_766+881); + // public static WoodGas = new MaterialBuilder + // public static WoodTar = new MaterialBuilder + // public static WoodVinegar = new MaterialBuilder - // public static Werkstoff Sunnarium = new Werkstoff(Materials.Sunnarium, , + // public static Werkstoff Sunnarium = new Werkstoff(Materials.Sunnarium, , // ,31_766+318); - // public static Werkstoff Endstone = new Werkstoff(Materials.Endstone, , + // public static Werkstoff Endstone = new Werkstoff(Materials.Endstone, , // ,31_766+808); - // public static Werkstoff Netherrack = new Werkstoff(Materials.Netherrack, , + // public static Werkstoff Netherrack = new Werkstoff(Materials.Netherrack, , // ,31_766+807); - // public static Werkstoff Methane = new Werkstoff(Materials.Methane, , + // public static Werkstoff Methane = new Werkstoff(Materials.Methane, , // ,31_766+715); - // public static Werkstoff CarbonDioxide = new Werkstoff(Materials.CarbonDioxide, , + // public static Werkstoff CarbonDioxide = new Werkstoff(Materials.CarbonDioxide, , // ,31_766+497); - // public static Werkstoff NobleGases = new Werkstoff(Materials.NobleGases, , + // public static Werkstoff NobleGases = new Werkstoff(Materials.NobleGases, , // ,31_766+496); - // public static Werkstoff LiquidAir = new Werkstoff(Materials.LiquidAir, , + // public static Werkstoff LiquidAir = new Werkstoff(Materials.LiquidAir, , // ,31_766+495); - // public static Werkstoff LiquidNitrogen = new Werkstoff(Materials.LiquidNitrogen, , + // public static Werkstoff LiquidNitrogen = new Werkstoff(Materials.LiquidNitrogen, , // ,31_766+494); - // public static Werkstoff LiquidOxygen = new Werkstoff(Materials.LiquidOxygen, , + // public static Werkstoff LiquidOxygen = new Werkstoff(Materials.LiquidOxygen, , // ,31_766+493); - // public static Werkstoff Almandine = new Werkstoff(Materials.Almandine, , + // public static Werkstoff Almandine = new Werkstoff(Materials.Almandine, , // ,31_766+820); - // public static Werkstoff Andradite = new Werkstoff(Materials.Andradite, , + // public static Werkstoff Andradite = new Werkstoff(Materials.Andradite, , // ,31_766+821); - // public static Werkstoff Asbestos = new Werkstoff(Materials.Asbestos, , + // public static Werkstoff Asbestos = new Werkstoff(Materials.Asbestos, , // ,31_766+946); - // public static Werkstoff Ash = new Werkstoff(Materials.Ash, , ,31_766+815); - // public static Werkstoff BandedIron = new Werkstoff(Materials.BandedIron, , + // public static Werkstoff Ash = new Werkstoff(Materials.Ash, , ,31_766+815); + // public static Werkstoff BandedIron = new Werkstoff(Materials.BandedIron, , // ,31_766+917); - // public static Werkstoff BatteryAlloy = new Werkstoff(Materials.BatteryAlloy, , + // public static Werkstoff BatteryAlloy = new Werkstoff(Materials.BatteryAlloy, , // ,31_766+315); - // public static Werkstoff BlueTopaz = new Werkstoff(Materials.BlueTopaz, , + // public static Werkstoff BlueTopaz = new Werkstoff(Materials.BlueTopaz, , // ,31_766+513); - // public static Werkstoff Bone = new Werkstoff(Materials.Bone, , ,31_766+806); + // public static Werkstoff Bone = new Werkstoff(Materials.Bone, , ,31_766+806); - // public static Werkstoff BrownLimonite = new Werkstoff(Materials.BrownLimonite, , + // public static Werkstoff BrownLimonite = new Werkstoff(Materials.BrownLimonite, , // ,31_766+930); - // public static Werkstoff Calcite = new Werkstoff(Materials.Calcite, , + // public static Werkstoff Calcite = new Werkstoff(Materials.Calcite, , // ,31_766+823); - // public static Werkstoff Cassiterite = new Werkstoff(Materials.Cassiterite, , + // public static Werkstoff Cassiterite = new Werkstoff(Materials.Cassiterite, , // ,31_766+824); - // public static Werkstoff CassiteriteSand = new Werkstoff(Materials.CassiteriteSand, , + // public static Werkstoff CassiteriteSand = new Werkstoff(Materials.CassiteriteSand, , // ,31_766+937); - // public static Werkstoff Chalcopyrite = new Werkstoff(Materials.Chalcopyrite, , + // public static Werkstoff Chalcopyrite = new Werkstoff(Materials.Chalcopyrite, , // ,31_766+855); - // public static Werkstoff Charcoal = new Werkstoff(Materials.Charcoal, , + // public static Werkstoff Charcoal = new Werkstoff(Materials.Charcoal, , // ,31_766+536); - // public static Werkstoff Chromite = new Werkstoff(Materials.Chromite, , + // public static Werkstoff Chromite = new Werkstoff(Materials.Chromite, , // ,31_766+825); - // public static Werkstoff ChromiumDioxide = new Werkstoff(Materials.ChromiumDioxide, , + // public static Werkstoff ChromiumDioxide = new Werkstoff(Materials.ChromiumDioxide, , // ,31_766+361); - // public static Werkstoff Cinnabar = new Werkstoff(Materials.Cinnabar, , + // public static Werkstoff Cinnabar = new Werkstoff(Materials.Cinnabar, , // ,31_766+826); - // public static Werkstoff Water = new Werkstoff(Materials.Water, , ,31_766+701); - // public static Werkstoff Clay = new Werkstoff(Materials.Clay, , ,31_766+805); - // public static Werkstoff Coal = new Werkstoff(Materials.Coal, , ,31_766+535); - // public static Werkstoff Cobaltite = new Werkstoff(Materials.Cobaltite, , + // public static Werkstoff Water = new Werkstoff(Materials.Water, , ,31_766+701); + // public static Werkstoff Clay = new Werkstoff(Materials.Clay, , ,31_766+805); + // public static Werkstoff Coal = new Werkstoff(Materials.Coal, , ,31_766+535); + // public static Werkstoff Cobaltite = new Werkstoff(Materials.Cobaltite, , // ,31_766+827); - // public static Werkstoff Cooperite = new Werkstoff(Materials.Cooperite, , + // public static Werkstoff Cooperite = new Werkstoff(Materials.Cooperite, , // ,31_766+828); - // public static Werkstoff Cupronickel = new Werkstoff(Materials.Cupronickel, , + // public static Werkstoff Cupronickel = new Werkstoff(Materials.Cupronickel, , // ,31_766+310); - // public static Werkstoff DarkAsh = new Werkstoff(Materials.DarkAsh, , + // public static Werkstoff DarkAsh = new Werkstoff(Materials.DarkAsh, , // ,31_766+816); - // public static Werkstoff DeepIron = new Werkstoff(Materials.DeepIron, , + // public static Werkstoff DeepIron = new Werkstoff(Materials.DeepIron, , // ,31_766+829); - // public static Werkstoff Diamond = new Werkstoff(Materials.Diamond, , + // public static Werkstoff Diamond = new Werkstoff(Materials.Diamond, , // ,31_766+500); - // public static Werkstoff Electrum = new Werkstoff(Materials.Electrum, , + // public static Werkstoff Electrum = new Werkstoff(Materials.Electrum, , // ,31_766+303); - // public static Werkstoff Emerald = new Werkstoff(Materials.Emerald, , + // public static Werkstoff Emerald = new Werkstoff(Materials.Emerald, , // ,31_766+501); - // public static Werkstoff Galena = new Werkstoff(Materials.Galena, , ,31_766+830); - // public static Werkstoff Garnierite = new Werkstoff(Materials.Garnierite, , + // public static Werkstoff Galena = new Werkstoff(Materials.Galena, , ,31_766+830); + // public static Werkstoff Garnierite = new Werkstoff(Materials.Garnierite, , // ,31_766+906); - // public static Werkstoff Glyceryl = new Werkstoff(Materials.Glyceryl, , + // public static Werkstoff Glyceryl = new Werkstoff(Materials.Glyceryl, , // ,31_766+714); - // public static Werkstoff GreenSapphire = new Werkstoff(Materials.GreenSapphire, , + // public static Werkstoff GreenSapphire = new Werkstoff(Materials.GreenSapphire, , // ,31_766+504); - // public static Werkstoff Grossular = new Werkstoff(Materials.Grossular, , + // public static Werkstoff Grossular = new Werkstoff(Materials.Grossular, , // ,31_766+831); - // public static Werkstoff HolyWater = new Werkstoff(Materials.HolyWater, , + // public static Werkstoff HolyWater = new Werkstoff(Materials.HolyWater, , // ,31_766+729); - // public static Werkstoff Ice = new Werkstoff(Materials.Ice, , ,31_766+702); - // public static Werkstoff Ilmenite = new Werkstoff(Materials.Ilmenite, , + // public static Werkstoff Ice = new Werkstoff(Materials.Ice, , ,31_766+702); + // public static Werkstoff Ilmenite = new Werkstoff(Materials.Ilmenite, , // ,31_766+918); - // public static Werkstoff Rutile = new Werkstoff(Materials.Rutile, , ,31_766+375); - // public static Werkstoff Bauxite = new Werkstoff(Materials.Bauxite, , + // public static Werkstoff Rutile = new Werkstoff(Materials.Rutile, , ,31_766+375); + // public static Werkstoff Bauxite = new Werkstoff(Materials.Bauxite, , // ,31_766+822); - // public static Werkstoff Titaniumtetrachloride = new Werkstoff(Materials.Titaniumtetrachloride, + // public static Werkstoff Titaniumtetrachloride = new Werkstoff(Materials.Titaniumtetrachloride, // , ,31_766+376); - // public static Werkstoff Magnesiumchloride = new Werkstoff(Materials.Magnesiumchloride, , + // public static Werkstoff Magnesiumchloride = new Werkstoff(Materials.Magnesiumchloride, , // ,31_766+377); - // public static Werkstoff Invar = new Werkstoff(Materials.Invar, , ,31_766+302); - // public static Werkstoff Kanthal = new Werkstoff(Materials.Kanthal, , + // public static Werkstoff Invar = new Werkstoff(Materials.Invar, , ,31_766+302); + // public static Werkstoff Kanthal = new Werkstoff(Materials.Kanthal, , // ,31_766+312); - // public static Werkstoff Lazurite = new Werkstoff(Materials.Lazurite, , + // public static Werkstoff Lazurite = new Werkstoff(Materials.Lazurite, , // ,31_766+524); - // public static Werkstoff Magnalium = new Werkstoff(Materials.Magnalium, , + // public static Werkstoff Magnalium = new Werkstoff(Materials.Magnalium, , // ,31_766+313); - // public static Werkstoff Magnesite = new Werkstoff(Materials.Magnesite, , + // public static Werkstoff Magnesite = new Werkstoff(Materials.Magnesite, , // ,31_766+908); - // public static Werkstoff Magnetite = new Werkstoff(Materials.Magnetite, , + // public static Werkstoff Magnetite = new Werkstoff(Materials.Magnetite, , // ,31_766+870); - // public static Werkstoff Molybdenite = new Werkstoff(Materials.Molybdenite, , + // public static Werkstoff Molybdenite = new Werkstoff(Materials.Molybdenite, , // ,31_766+942); - // public static Werkstoff Nichrome = new Werkstoff(Materials.Nichrome, , + // public static Werkstoff Nichrome = new Werkstoff(Materials.Nichrome, , // ,31_766+311); - // public static Werkstoff NiobiumNitride = new Werkstoff(Materials.NiobiumNitride, , + // public static Werkstoff NiobiumNitride = new Werkstoff(Materials.NiobiumNitride, , // ,31_766+359); - // public static Werkstoff NiobiumTitanium = new Werkstoff(Materials.NiobiumTitanium, , + // public static Werkstoff NiobiumTitanium = new Werkstoff(Materials.NiobiumTitanium, , // ,31_766+360); - // public static Werkstoff NitroCarbon = new Werkstoff(Materials.NitroCarbon, , + // public static Werkstoff NitroCarbon = new Werkstoff(Materials.NitroCarbon, , // ,31_766+716); - // public static Werkstoff NitrogenDioxide = new Werkstoff(Materials.NitrogenDioxide, , + // public static Werkstoff NitrogenDioxide = new Werkstoff(Materials.NitrogenDioxide, , // ,31_766+717); - // public static Werkstoff Obsidian = new Werkstoff(Materials.Obsidian, , + // public static Werkstoff Obsidian = new Werkstoff(Materials.Obsidian, , // ,31_766+804); - // public static Werkstoff Phosphate = new Werkstoff(Materials.Phosphate, , + // public static Werkstoff Phosphate = new Werkstoff(Materials.Phosphate, , // ,31_766+833); - // public static Werkstoff PigIron = new Werkstoff(Materials.PigIron, , + // public static Werkstoff PigIron = new Werkstoff(Materials.PigIron, , // ,31_766+307); - // public static Polydimethylsiloxane = new MaterialBuilder - // public static Werkstoff Silicone = new Werkstoff(Materials.Silicone, , + // public static Polydimethylsiloxane = new MaterialBuilder + // public static Werkstoff Silicone = new Werkstoff(Materials.Silicone, , // ,31_766+471); - // public static Werkstoff Polycaprolactam = new Werkstoff(Materials.Polycaprolactam, , + // public static Werkstoff Polycaprolactam = new Werkstoff(Materials.Polycaprolactam, , // ,31_766+472); - // public static Werkstoff Powellite = new Werkstoff(Materials.Powellite, , + // public static Werkstoff Powellite = new Werkstoff(Materials.Powellite, , // ,31_766+883); - // public static Werkstoff Pumice = new Werkstoff(Materials.Pumice, , ,31_766+926); - // public static Werkstoff Pyrite = new Werkstoff(Materials.Pyrite, , ,31_766+834); - // public static Werkstoff Pyrolusite = new Werkstoff(Materials.Pyrolusite, , + // public static Werkstoff Pumice = new Werkstoff(Materials.Pumice, , ,31_766+926); + // public static Werkstoff Pyrite = new Werkstoff(Materials.Pyrite, , ,31_766+834); + // public static Werkstoff Pyrolusite = new Werkstoff(Materials.Pyrolusite, , // ,31_766+943); - // public static Werkstoff Pyrope = new Werkstoff(Materials.Pyrope, , ,31_766+835); - // public static Werkstoff RockSalt = new Werkstoff(Materials.RockSalt, , + // public static Werkstoff Pyrope = new Werkstoff(Materials.Pyrope, , ,31_766+835); + // public static Werkstoff RockSalt = new Werkstoff(Materials.RockSalt, , // ,31_766+944); - // public static Werkstoff Rubber = new Werkstoff(Materials.Rubber, , ,31_766+880); - // public static Werkstoff RawRubber = new Werkstoff(Materials.RawRubber, , + // public static Werkstoff Rubber = new Werkstoff(Materials.Rubber, , ,31_766+880); + // public static Werkstoff RawRubber = new Werkstoff(Materials.RawRubber, , // ,31_766+896); - // public static Werkstoff Ruby = new Werkstoff(Materials.Ruby, , ,31_766+502); - // public static Werkstoff Salt = new Werkstoff(Materials.Salt, , ,31_766+817); - // public static Werkstoff Saltpeter = new Werkstoff(Materials.Saltpeter, , + // public static Werkstoff Ruby = new Werkstoff(Materials.Ruby, , ,31_766+502); + // public static Werkstoff Salt = new Werkstoff(Materials.Salt, , ,31_766+817); + // public static Werkstoff Saltpeter = new Werkstoff(Materials.Saltpeter, , // ,31_766+836); - // public static Werkstoff Sapphire = new Werkstoff(Materials.Sapphire, , + // public static Werkstoff Sapphire = new Werkstoff(Materials.Sapphire, , // ,31_766+503); - // public static Werkstoff Scheelite = new Werkstoff(Materials.Scheelite, , + // public static Werkstoff Scheelite = new Werkstoff(Materials.Scheelite, , // ,31_766+910); - // public static Werkstoff SiliconDioxide = new Werkstoff(Materials.SiliconDioxide, , + // public static Werkstoff SiliconDioxide = new Werkstoff(Materials.SiliconDioxide, , // ,31_766+837); - // public static Werkstoff Snow = new Werkstoff(Materials.Snow, , ,31_766+728); - // public static Werkstoff Sodalite = new Werkstoff(Materials.Sodalite, , + // public static Werkstoff Snow = new Werkstoff(Materials.Snow, , ,31_766+728); + // public static Werkstoff Sodalite = new Werkstoff(Materials.Sodalite, , // ,31_766+525); - // public static Werkstoff SodiumPersulfate = new Werkstoff(Materials.SodiumPersulfate, , + // public static Werkstoff SodiumPersulfate = new Werkstoff(Materials.SodiumPersulfate, , // ,31_766+718); - // public static Werkstoff SodiumSulfide = new Werkstoff(Materials.SodiumSulfide, , + // public static Werkstoff SodiumSulfide = new Werkstoff(Materials.SodiumSulfide, , // ,31_766+719); - // public static Werkstoff HydricSulfide = new Werkstoff(Materials.HydricSulfide, , + // public static Werkstoff HydricSulfide = new Werkstoff(Materials.HydricSulfide, , // ,31_766+460); - // public static Werkstoff OilHeavy = new Werkstoff(Materials.OilHeavy, , + // public static Werkstoff OilHeavy = new Werkstoff(Materials.OilHeavy, , // ,31_766+730); - // public static Werkstoff OilMedium = new Werkstoff(Materials.OilMedium, , + // public static Werkstoff OilMedium = new Werkstoff(Materials.OilMedium, , // ,31_766+731); - // public static Werkstoff OilLight = new Werkstoff(Materials.OilLight, , + // public static Werkstoff OilLight = new Werkstoff(Materials.OilLight, , // ,31_766+732); - // public static Werkstoff NatruralGas = new Werkstoff(Materials.NatruralGas, , + // public static Werkstoff NatruralGas = new Werkstoff(Materials.NatruralGas, , // ,31_766+733); - // public static Werkstoff SulfuricGas = new Werkstoff(Materials.SulfuricGas, , + // public static Werkstoff SulfuricGas = new Werkstoff(Materials.SulfuricGas, , // ,31_766+734); - // public static Werkstoff Gas = new Werkstoff(Materials.Gas, , ,31_766+735); - // public static Werkstoff SulfuricNaphtha = new Werkstoff(Materials.SulfuricNaphtha, , + // public static Werkstoff Gas = new Werkstoff(Materials.Gas, , ,31_766+735); + // public static Werkstoff SulfuricNaphtha = new Werkstoff(Materials.SulfuricNaphtha, , // ,31_766+736); - // public static Werkstoff SulfuricLightFuel = new Werkstoff(Materials.SulfuricLightFuel, , + // public static Werkstoff SulfuricLightFuel = new Werkstoff(Materials.SulfuricLightFuel, , // ,31_766+737); - // public static Werkstoff SulfuricHeavyFuel = new Werkstoff(Materials.SulfuricHeavyFuel, , + // public static Werkstoff SulfuricHeavyFuel = new Werkstoff(Materials.SulfuricHeavyFuel, , // ,31_766+738); - // public static Werkstoff Naphtha = new Werkstoff(Materials.Naphtha, , + // public static Werkstoff Naphtha = new Werkstoff(Materials.Naphtha, , // ,31_766+739); - // public static Werkstoff LightFuel = new Werkstoff(Materials.LightFuel, , + // public static Werkstoff LightFuel = new Werkstoff(Materials.LightFuel, , // ,31_766+740); - // public static Werkstoff HeavyFuel = new Werkstoff(Materials.HeavyFuel, , + // public static Werkstoff HeavyFuel = new Werkstoff(Materials.HeavyFuel, , // ,31_766+741); - // public static Werkstoff LPG = new Werkstoff(Materials.LPG, , ,31_766+742); - // public static FluidNaquadahFuel = new MaterialBuilder - // public static EnrichedNaquadria = new MaterialBuilder - // public static ReinforceGlass = new MaterialBuilder - // public static BioMediumRaw = new MaterialBuilder - // public static BioMediumSterilized = new MaterialBuilder - // public static Chlorobenzene = new MaterialBuild - // public static DilutedHydrochloricAcid = new MaterialBuild - // public static Pyrochlore = new MaterialBuild - // public static GrowthMediumRaw = new MaterialBuild - // public static GrowthMediumSterilized = new MaterialBuild - // public static FerriteMixture = new MaterialBuild - // public static NickelZincFerrite = new MaterialBuild - // public static Massicot = new MaterialBuild - // public static ArsenicTrioxide = new MaterialBuild - // public static CobaltOxide = new MaterialBuild - // public static Zincite = new MaterialBuild - // public static AntimonyTrioxide = new MaterialBuild - // public static CupricOxide = new MaterialBuild - // public static Ferrosilite = new MaterialBuild - // public static Magnesia = new MaterialBuild - // public static Quicklime = new MaterialBuild - // public static Potash = new MaterialBuild - // public static SodaAsh = new MaterialBuild - // public static Brick = new MaterialBuild - // public static Fireclay = new MaterialBuild - // public static BioDiesel = new MaterialBuild - // public static NitrationMixture = new MaterialBuild - // public static Glycerol = new MaterialBuild - // public static SodiumBisulfate = new MaterialBuild - // public static PolyphenyleneSulfide = new MaterialBuild - // public static Dichlorobenzene = new MaterialBuild - // public static Polystyrene = new MaterialBuild - // public static Styrene = new MaterialBuild - // public static Isoprene = new MaterialBuild - // public static Tetranitromethane = new MaterialBuild - // public static Ethenone = new MaterialBuild - // public static Ethane = new MaterialBuild - // public static Propane = new MaterialBuild - // public static Butane = new MaterialBuild - // public static Butene = new MaterialBuild - // public static Butadiene = new MaterialBuild - // public static RawStyreneButadieneRubber = new MaterialBuild - // public static StyreneButadieneRubber = new MaterialBuild - // public static Toluene = new MaterialBuild - // public static Epichlorohydrin = new MaterialBuild - // public static PolyvinylChloride = new MaterialBuild - // public static VinylChloride = new MaterialBuild - // public static SulfurDioxide = new MaterialBuild - // public static SulfurTrioxide = new MaterialBuild - // public static NitricAcid = new MaterialBuild - // public static Dimethylhydrazine = new MaterialBuild - // public static Chloramine = new MaterialBuild - // public static Dimethylamine = new MaterialBuild - // public static DinitrogenTetroxide = new MaterialBuild - // public static NitricOxide = new MaterialBuild - // public static Ammonia = new MaterialBuild - // public static Dimethyldichlorosilane = new MaterialBuild - // public static Chloromethane = new MaterialBuild - // public static PhosphorousPentoxide = new MaterialBuild - // public static Tetrafluoroethylene = new MaterialBuild - // public static HydrofluoricAcid = new MaterialBuild - // public static Chloroform = new MaterialBuild - // public static BisphenolA = new MaterialBuild - // public static AceticAcid = new MaterialBuild - // public static CalciumAcetateSolution = new MaterialBuild - // public static Acetone = new MaterialBuild - // public static Methanol = new MaterialBuild - // public static CarbonMonoxide = new MaterialBuild - // public static MetalMixture = new MaterialBuild - // public static Ethylene = new MaterialBuild - // public static Propene = new MaterialBuild - // public static VinylAcetate = new MaterialBuild - // public static PolyvinylAcetate = new MaterialBuild - // public static MethylAcetate = new MaterialBuild - // public static AllylChloride = new MaterialBuild - // public static HydrochloricAcid = new MaterialBuild - // public static HypochlorousAcid = new MaterialBuild - // public static SodiumHydroxide = new MaterialBuild - // public static Benzene = new MaterialBuild - // public static Phenol = new MaterialBuild - // public static Cumene = new MaterialBuild - // public static PhosphoricAcid = new MaterialBuild - // public static SaltWater = new MaterialBuild - // public static IronIIIChloride = new MaterialBuild - // public static LifeEssence = new MaterialBuild - // public static Werkstoff SolderingAlloy = new Werkstoff(Materials.SolderingAlloy, , + // public static Werkstoff LPG = new Werkstoff(Materials.LPG, , ,31_766+742); + // public static FluidNaquadahFuel = new MaterialBuilder + // public static EnrichedNaquadria = new MaterialBuilder + // public static ReinforceGlass = new MaterialBuilder + // public static BioMediumRaw = new MaterialBuilder + // public static BioMediumSterilized = new MaterialBuilder + // public static Chlorobenzene = new MaterialBuild + // public static DilutedHydrochloricAcid = new MaterialBuild + // public static Pyrochlore = new MaterialBuild + // public static GrowthMediumRaw = new MaterialBuild + // public static GrowthMediumSterilized = new MaterialBuild + // public static FerriteMixture = new MaterialBuild + // public static NickelZincFerrite = new MaterialBuild + // public static Massicot = new MaterialBuild + // public static ArsenicTrioxide = new MaterialBuild + // public static CobaltOxide = new MaterialBuild + // public static Zincite = new MaterialBuild + // public static AntimonyTrioxide = new MaterialBuild + // public static CupricOxide = new MaterialBuild + // public static Ferrosilite = new MaterialBuild + // public static Magnesia = new MaterialBuild + // public static Quicklime = new MaterialBuild + // public static Potash = new MaterialBuild + // public static SodaAsh = new MaterialBuild + // public static Brick = new MaterialBuild + // public static Fireclay = new MaterialBuild + // public static BioDiesel = new MaterialBuild + // public static NitrationMixture = new MaterialBuild + // public static Glycerol = new MaterialBuild + // public static SodiumBisulfate = new MaterialBuild + // public static PolyphenyleneSulfide = new MaterialBuild + // public static Dichlorobenzene = new MaterialBuild + // public static Polystyrene = new MaterialBuild + // public static Styrene = new MaterialBuild + // public static Isoprene = new MaterialBuild + // public static Tetranitromethane = new MaterialBuild + // public static Ethenone = new MaterialBuild + // public static Ethane = new MaterialBuild + // public static Propane = new MaterialBuild + // public static Butane = new MaterialBuild + // public static Butene = new MaterialBuild + // public static Butadiene = new MaterialBuild + // public static RawStyreneButadieneRubber = new MaterialBuild + // public static StyreneButadieneRubber = new MaterialBuild + // public static Toluene = new MaterialBuild + // public static Epichlorohydrin = new MaterialBuild + // public static PolyvinylChloride = new MaterialBuild + // public static VinylChloride = new MaterialBuild + // public static SulfurDioxide = new MaterialBuild + // public static SulfurTrioxide = new MaterialBuild + // public static NitricAcid = new MaterialBuild + // public static Dimethylhydrazine = new MaterialBuild + // public static Chloramine = new MaterialBuild + // public static Dimethylamine = new MaterialBuild + // public static DinitrogenTetroxide = new MaterialBuild + // public static NitricOxide = new MaterialBuild + // public static Ammonia = new MaterialBuild + // public static Dimethyldichlorosilane = new MaterialBuild + // public static Chloromethane = new MaterialBuild + // public static PhosphorousPentoxide = new MaterialBuild + // public static Tetrafluoroethylene = new MaterialBuild + // public static HydrofluoricAcid = new MaterialBuild + // public static Chloroform = new MaterialBuild + // public static BisphenolA = new MaterialBuild + // public static AceticAcid = new MaterialBuild + // public static CalciumAcetateSolution = new MaterialBuild + // public static Acetone = new MaterialBuild + // public static Methanol = new MaterialBuild + // public static CarbonMonoxide = new MaterialBuild + // public static MetalMixture = new MaterialBuild + // public static Ethylene = new MaterialBuild + // public static Propene = new MaterialBuild + // public static VinylAcetate = new MaterialBuild + // public static PolyvinylAcetate = new MaterialBuild + // public static MethylAcetate = new MaterialBuild + // public static AllylChloride = new MaterialBuild + // public static HydrochloricAcid = new MaterialBuild + // public static HypochlorousAcid = new MaterialBuild + // public static SodiumHydroxide = new MaterialBuild + // public static Benzene = new MaterialBuild + // public static Phenol = new MaterialBuild + // public static Cumene = new MaterialBuild + // public static PhosphoricAcid = new MaterialBuild + // public static SaltWater = new MaterialBuild + // public static IronIIIChloride = new MaterialBuild + // public static LifeEssence = new MaterialBuild + // public static Werkstoff SolderingAlloy = new Werkstoff(Materials.SolderingAlloy, , // ,31_766+314); - // public static Werkstoff GalliumArsenide = new Werkstoff(Materials.GalliumArsenide, , + // public static Werkstoff GalliumArsenide = new Werkstoff(Materials.GalliumArsenide, , // ,31_766+980); - // public static Werkstoff IndiumGalliumPhosphide = new Werkstoff(Materials.IndiumGalliumPhosphide, + // public static Werkstoff IndiumGalliumPhosphide = new Werkstoff(Materials.IndiumGalliumPhosphide, // , ,31_766+981); - // public static Werkstoff Spessartine = new Werkstoff(Materials.Spessartine, , + // public static Werkstoff Spessartine = new Werkstoff(Materials.Spessartine, , // ,31_766+838); - // public static Werkstoff Sphalerite = new Werkstoff(Materials.Sphalerite, , + // public static Werkstoff Sphalerite = new Werkstoff(Materials.Sphalerite, , // ,31_766+839); - // public static Werkstoff Stibnite = new Werkstoff(Materials.Stibnite, , + // public static Werkstoff Stibnite = new Werkstoff(Materials.Stibnite, , // ,31_766+945); - // public static Werkstoff SulfuricAcid = new Werkstoff(Materials.SulfuricAcid, , + // public static Werkstoff SulfuricAcid = new Werkstoff(Materials.SulfuricAcid, , // ,31_766+720); - // public static Werkstoff Tanzanite = new Werkstoff(Materials.Tanzanite, , + // public static Werkstoff Tanzanite = new Werkstoff(Materials.Tanzanite, , // ,31_766+508); - // public static Werkstoff Tetrahedrite = new Werkstoff(Materials.Tetrahedrite, , + // public static Werkstoff Tetrahedrite = new Werkstoff(Materials.Tetrahedrite, , // ,31_766+840); - // public static Werkstoff TinAlloy = new Werkstoff(Materials.TinAlloy, , + // public static Werkstoff TinAlloy = new Werkstoff(Materials.TinAlloy, , // ,31_766+363); - // public static Werkstoff Topaz = new Werkstoff(Materials.Topaz, , ,31_766+507); - // public static Werkstoff Tungstate = new Werkstoff(Materials.Tungstate, , + // public static Werkstoff Topaz = new Werkstoff(Materials.Topaz, , ,31_766+507); + // public static Werkstoff Tungstate = new Werkstoff(Materials.Tungstate, , // ,31_766+841); - // public static Werkstoff Uraninite = new Werkstoff(Materials.Uraninite, , + // public static Werkstoff Uraninite = new Werkstoff(Materials.Uraninite, , // ,31_766+922); - // public static Werkstoff Uvarovite = new Werkstoff(Materials.Uvarovite, , + // public static Werkstoff Uvarovite = new Werkstoff(Materials.Uvarovite, , // ,31_766+842); - // public static Werkstoff VanadiumGallium = new Werkstoff(Materials.VanadiumGallium, , + // public static Werkstoff VanadiumGallium = new Werkstoff(Materials.VanadiumGallium, , // ,31_766+357); - // public static Werkstoff Wulfenite = new Werkstoff(Materials.Wulfenite, , + // public static Werkstoff Wulfenite = new Werkstoff(Materials.Wulfenite, , // ,31_766+882); - // public static Werkstoff YellowLimonite = new Werkstoff(Materials.YellowLimonite, , + // public static Werkstoff YellowLimonite = new Werkstoff(Materials.YellowLimonite, , // ,31_766+931); - // public static Werkstoff YttriumBariumCuprate = new Werkstoff(Materials.YttriumBariumCuprate, + // public static Werkstoff YttriumBariumCuprate = new Werkstoff(Materials.YttriumBariumCuprate, // , ,31_766+358); - // public static Werkstoff LiveRoot = new Werkstoff(Materials.LiveRoot, , + // public static Werkstoff LiveRoot = new Werkstoff(Materials.LiveRoot, , // ,31_766+832); - // public static Werkstoff IronWood = new Werkstoff(Materials.IronWood, , + // public static Werkstoff IronWood = new Werkstoff(Materials.IronWood, , // ,31_766+338); - // public static Werkstoff Glass = new Werkstoff(Materials.Glass, , ,31_766+890); - // public static Werkstoff BorosilicateGlass = new Werkstoff(Materials.BorosilicateGlass, + // public static Werkstoff Glass = new Werkstoff(Materials.Glass, , ,31_766+890); + // public static Werkstoff BorosilicateGlass = new Werkstoff(Materials.BorosilicateGlass, // Werkstoff.GenerationFeatures.DISABLED, Werkstoff.Types.COMPOUND, 31_766+611); - // public static Werkstoff Perlite = new Werkstoff(Materials.Perlite, , + // public static Werkstoff Perlite = new Werkstoff(Materials.Perlite, , // ,31_766+925); - // public static Werkstoff Borax = new Werkstoff(Materials.Borax, , ,31_766+941); - // public static Werkstoff Lignite = new Werkstoff(Materials.Lignite, , + // public static Werkstoff Borax = new Werkstoff(Materials.Borax, , ,31_766+941); + // public static Werkstoff Lignite = new Werkstoff(Materials.Lignite, , // ,31_766+538); - // public static Werkstoff Olivine = new Werkstoff(Materials.Olivine, , + // public static Werkstoff Olivine = new Werkstoff(Materials.Olivine, , // ,31_766+505); - // public static Werkstoff Opal = new Werkstoff(Materials.Opal, , ,31_766+510); - // public static Werkstoff Amethyst = new Werkstoff(Materials.Amethyst, , + // public static Werkstoff Opal = new Werkstoff(Materials.Opal, , ,31_766+510); + // public static Werkstoff Amethyst = new Werkstoff(Materials.Amethyst, , // ,31_766+509); - // public static Werkstoff Redstone = new Werkstoff(Materials.Redstone, , + // public static Werkstoff Redstone = new Werkstoff(Materials.Redstone, , // ,31_766+810); - // public static Werkstoff Lapis = new Werkstoff(Materials.Lapis, , ,31_766+526); - // public static Werkstoff Blaze = new Werkstoff(Materials.Blaze, , ,31_766+801); - // public static Werkstoff EnderPearl = new Werkstoff(Materials.EnderPearl, , + // public static Werkstoff Lapis = new Werkstoff(Materials.Lapis, , ,31_766+526); + // public static Werkstoff Blaze = new Werkstoff(Materials.Blaze, , ,31_766+801); + // public static Werkstoff EnderPearl = new Werkstoff(Materials.EnderPearl, , // ,31_766+532); - // public static Werkstoff EnderEye = new Werkstoff(Materials.EnderEye, , + // public static Werkstoff EnderEye = new Werkstoff(Materials.EnderEye, , // ,31_766+533); - // public static Werkstoff Flint = new Werkstoff(Materials.Flint, , ,31_766+802); - // public static Werkstoff Diatomite = new Werkstoff(Materials.Diatomite, , + // public static Werkstoff Flint = new Werkstoff(Materials.Flint, , ,31_766+802); + // public static Werkstoff Diatomite = new Werkstoff(Materials.Diatomite, , // ,31_766+948); - // public static Werkstoff VolcanicAsh = new Werkstoff(Materials.VolcanicAsh, , + // public static Werkstoff VolcanicAsh = new Werkstoff(Materials.VolcanicAsh, , // ,31_766+940); - // public static Werkstoff Niter = new Werkstoff(Materials.Niter, , ,31_766+531); - // public static Werkstoff Pyrotheum = new Werkstoff(Materials.Pyrotheum, , + // public static Werkstoff Niter = new Werkstoff(Materials.Niter, , ,31_766+531); + // public static Werkstoff Pyrotheum = new Werkstoff(Materials.Pyrotheum, , // ,31_766+843); - // public static Werkstoff Cryotheum = new Werkstoff(Materials.Cryotheum, , + // public static Werkstoff Cryotheum = new Werkstoff(Materials.Cryotheum, , // ,31_766+898); - // public static Werkstoff HydratedCoal = new Werkstoff(Materials.HydratedCoal, , + // public static Werkstoff HydratedCoal = new Werkstoff(Materials.HydratedCoal, , // ,31_766+818); - // public static Werkstoff Apatite = new Werkstoff(Materials.Apatite, , + // public static Werkstoff Apatite = new Werkstoff(Materials.Apatite, , // ,31_766+530); - // public static Werkstoff Alumite = new Werkstoff(Materials.Alumite, , + // public static Werkstoff Alumite = new Werkstoff(Materials.Alumite, , // ,31_766+400); - // public static Werkstoff Manyullyn = new Werkstoff(Materials.Manyullyn, , + // public static Werkstoff Manyullyn = new Werkstoff(Materials.Manyullyn, , // ,31_766+386); - // public static Werkstoff Steeleaf = new Werkstoff(Materials.Steeleaf, , + // public static Werkstoff Steeleaf = new Werkstoff(Materials.Steeleaf, , // ,31_766+339); - // public static Werkstoff Knightmetal = new Werkstoff(Materials.Knightmetal, , + // public static Werkstoff Knightmetal = new Werkstoff(Materials.Knightmetal, , // ,31_766+362); - // public static Werkstoff NitroFuel = new Werkstoff(Materials.NitroFuel, , + // public static Werkstoff NitroFuel = new Werkstoff(Materials.NitroFuel, , // ,31_766+709); - // public static Werkstoff RedAlloy = new Werkstoff(Materials.RedAlloy, , + // public static Werkstoff RedAlloy = new Werkstoff(Materials.RedAlloy, , // ,31_766+308); - // public static Werkstoff CobaltBrass = new Werkstoff(Materials.CobaltBrass, , + // public static Werkstoff CobaltBrass = new Werkstoff(Materials.CobaltBrass, , // ,31_766+343); - // public static Werkstoff TricalciumPhosphate = new Werkstoff(Materials.TricalciumPhosphate, + // public static Werkstoff TricalciumPhosphate = new Werkstoff(Materials.TricalciumPhosphate, // , ,31_766+534); - // public static Werkstoff Basalt = new Werkstoff(Materials.Basalt, , ,31_766+844); - // public static Werkstoff GarnetRed = new Werkstoff(Materials.GarnetRed, , + // public static Werkstoff Basalt = new Werkstoff(Materials.Basalt, , ,31_766+844); + // public static Werkstoff GarnetRed = new Werkstoff(Materials.GarnetRed, , // ,31_766+527); - // public static Werkstoff GarnetYellow = new Werkstoff(Materials.GarnetYellow, , + // public static Werkstoff GarnetYellow = new Werkstoff(Materials.GarnetYellow, , // ,31_766+528); - // public static Werkstoff Marble = new Werkstoff(Materials.Marble, , ,31_766+845); - // public static Werkstoff Sugar = new Werkstoff(Materials.Sugar, , ,31_766+803); - // public static Werkstoff Thaumium = new Werkstoff(Materials.Thaumium, , + // public static Werkstoff Marble = new Werkstoff(Materials.Marble, , ,31_766+845); + // public static Werkstoff Sugar = new Werkstoff(Materials.Sugar, , ,31_766+803); + // public static Werkstoff Thaumium = new Werkstoff(Materials.Thaumium, , // ,31_766+330); - // public static Werkstoff Vinteum = new Werkstoff(Materials.Vinteum, , + // public static Werkstoff Vinteum = new Werkstoff(Materials.Vinteum, , // ,31_766+529); - // public static Werkstoff Redrock = new Werkstoff(Materials.Redrock, , + // public static Werkstoff Redrock = new Werkstoff(Materials.Redrock, , // ,31_766+846); - // public static Werkstoff PotassiumFeldspar = new Werkstoff(Materials.PotassiumFeldspar, , + // public static Werkstoff PotassiumFeldspar = new Werkstoff(Materials.PotassiumFeldspar, , // ,31_766+847); - // public static Werkstoff Biotite = new Werkstoff(Materials.Biotite, , + // public static Werkstoff Biotite = new Werkstoff(Materials.Biotite, , // ,31_766+848); - // public static Werkstoff GraniteBlack = new Werkstoff(Materials.GraniteBlack, , + // public static Werkstoff GraniteBlack = new Werkstoff(Materials.GraniteBlack, , // ,31_766+849); - // public static Werkstoff GraniteRed = new Werkstoff(Materials.GraniteRed, , + // public static Werkstoff GraniteRed = new Werkstoff(Materials.GraniteRed, , // ,31_766+850); - // public static Werkstoff Chrysotile = new Werkstoff(Materials.Chrysotile, , + // public static Werkstoff Chrysotile = new Werkstoff(Materials.Chrysotile, , // ,31_766+912); - // public static Werkstoff Realgar = new Werkstoff(Materials.Realgar, , + // public static Werkstoff Realgar = new Werkstoff(Materials.Realgar, , // ,31_766+913); - // public static Werkstoff VanadiumMagnetite = new Werkstoff(Materials.VanadiumMagnetite, , + // public static Werkstoff VanadiumMagnetite = new Werkstoff(Materials.VanadiumMagnetite, , // ,31_766+923); - // public static Werkstoff BasalticMineralSand = new Werkstoff(Materials.BasalticMineralSand, + // public static Werkstoff BasalticMineralSand = new Werkstoff(Materials.BasalticMineralSand, // , ,31_766+935); - // public static Werkstoff GraniticMineralSand = new Werkstoff(Materials.GraniticMineralSand, + // public static Werkstoff GraniticMineralSand = new Werkstoff(Materials.GraniticMineralSand, // , ,31_766+936); - // public static Werkstoff GarnetSand = new Werkstoff(Materials.GarnetSand, , + // public static Werkstoff GarnetSand = new Werkstoff(Materials.GarnetSand, , // ,31_766+938); - // public static Werkstoff QuartzSand = new Werkstoff(Materials.QuartzSand, , + // public static Werkstoff QuartzSand = new Werkstoff(Materials.QuartzSand, , // ,31_766+939); - // public static Werkstoff Bastnasite = new Werkstoff(Materials.Bastnasite, , + // public static Werkstoff Bastnasite = new Werkstoff(Materials.Bastnasite, , // ,31_766+905); - // public static Werkstoff Pentlandite = new Werkstoff(Materials.Pentlandite, , + // public static Werkstoff Pentlandite = new Werkstoff(Materials.Pentlandite, , // ,31_766+909); - // public static Werkstoff Spodumene = new Werkstoff(Materials.Spodumene, , + // public static Werkstoff Spodumene = new Werkstoff(Materials.Spodumene, , // ,31_766+920); - // public static Werkstoff Pollucite = new Werkstoff(Materials.Pollucite, , + // public static Werkstoff Pollucite = new Werkstoff(Materials.Pollucite, , // ,31_766+919); - // public static Werkstoff Tantalite = new Werkstoff(Materials.Tantalite, , + // public static Werkstoff Tantalite = new Werkstoff(Materials.Tantalite, , // ,31_766+921); - // public static Werkstoff Lepidolite = new Werkstoff(Materials.Lepidolite, , + // public static Werkstoff Lepidolite = new Werkstoff(Materials.Lepidolite, , // ,31_766+907); - // public static Werkstoff Glauconite = new Werkstoff(Materials.Glauconite, , + // public static Werkstoff Glauconite = new Werkstoff(Materials.Glauconite, , // ,31_766+933); - // public static Werkstoff GlauconiteSand = new Werkstoff(Materials.GlauconiteSand, , + // public static Werkstoff GlauconiteSand = new Werkstoff(Materials.GlauconiteSand, , // ,31_766+949); - // public static Werkstoff Vermiculite = new Werkstoff(Materials.Vermiculite, , + // public static Werkstoff Vermiculite = new Werkstoff(Materials.Vermiculite, , // ,31_766+932); - // public static Werkstoff Bentonite = new Werkstoff(Materials.Bentonite, , + // public static Werkstoff Bentonite = new Werkstoff(Materials.Bentonite, , // ,31_766+927); - // public static Werkstoff FullersEarth = new Werkstoff(Materials.FullersEarth, , + // public static Werkstoff FullersEarth = new Werkstoff(Materials.FullersEarth, , // ,31_766+928); - // public static Werkstoff Pitchblende = new Werkstoff(Materials.Pitchblende, , + // public static Werkstoff Pitchblende = new Werkstoff(Materials.Pitchblende, , // ,31_766+873); - // public static Werkstoff Monazite = new Werkstoff(Materials.Monazite, , + // public static Werkstoff Monazite = new Werkstoff(Materials.Monazite, , // ,31_766+520); - // public static Werkstoff Malachite = new Werkstoff(Materials.Malachite, , + // public static Werkstoff Malachite = new Werkstoff(Materials.Malachite, , // ,31_766+871); - // public static Werkstoff Mirabilite = new Werkstoff(Materials.Mirabilite, , + // public static Werkstoff Mirabilite = new Werkstoff(Materials.Mirabilite, , // ,31_766+900); - // public static Werkstoff Mica = new Werkstoff(Materials.Mica, , ,31_766+901); - // public static Werkstoff Trona = new Werkstoff(Materials.Trona, , ,31_766+903); - // public static Werkstoff Barite = new Werkstoff(Materials.Barite, , ,31_766+904); - // public static Werkstoff Gypsum = new Werkstoff(Materials.Gypsum, , ,31_766+934); - // public static Werkstoff Alunite = new Werkstoff(Materials.Alunite, , + // public static Werkstoff Mica = new Werkstoff(Materials.Mica, , ,31_766+901); + // public static Werkstoff Trona = new Werkstoff(Materials.Trona, , ,31_766+903); + // public static Werkstoff Barite = new Werkstoff(Materials.Barite, , ,31_766+904); + // public static Werkstoff Gypsum = new Werkstoff(Materials.Gypsum, , ,31_766+934); + // public static Werkstoff Alunite = new Werkstoff(Materials.Alunite, , // ,31_766+911); - // public static Werkstoff Dolomite = new Werkstoff(Materials.Dolomite, , + // public static Werkstoff Dolomite = new Werkstoff(Materials.Dolomite, , // ,31_766+914); - // public static Werkstoff Wollastonite = new Werkstoff(Materials.Wollastonite, , + // public static Werkstoff Wollastonite = new Werkstoff(Materials.Wollastonite, , // ,31_766+915); - // public static Werkstoff Zeolite = new Werkstoff(Materials.Zeolite, , + // public static Werkstoff Zeolite = new Werkstoff(Materials.Zeolite, , // ,31_766+916); - // public static Werkstoff Kyanite = new Werkstoff(Materials.Kyanite, , + // public static Werkstoff Kyanite = new Werkstoff(Materials.Kyanite, , // ,31_766+924); - // public static Werkstoff Kaolinite = new Werkstoff(Materials.Kaolinite, , + // public static Werkstoff Kaolinite = new Werkstoff(Materials.Kaolinite, , // ,31_766+929); - // public static Werkstoff Talc = new Werkstoff(Materials.Talc, , ,31_766+902); - // public static Werkstoff Soapstone = new Werkstoff(Materials.Soapstone, , + // public static Werkstoff Talc = new Werkstoff(Materials.Talc, , ,31_766+902); + // public static Werkstoff Soapstone = new Werkstoff(Materials.Soapstone, , // ,31_766+877); - // public static Werkstoff Concrete = new Werkstoff(Materials.Concrete, , + // public static Werkstoff Concrete = new Werkstoff(Materials.Concrete, , // ,31_766+947); - // public static Werkstoff IronMagnetic = new Werkstoff(Materials.IronMagnetic, , + // public static Werkstoff IronMagnetic = new Werkstoff(Materials.IronMagnetic, , // ,31_766+354); - // public static Werkstoff SteelMagnetic = new Werkstoff(Materials.SteelMagnetic, , + // public static Werkstoff SteelMagnetic = new Werkstoff(Materials.SteelMagnetic, , // ,31_766+355); - // public static Werkstoff NeodymiumMagnetic = new Werkstoff(Materials.NeodymiumMagnetic, , + // public static Werkstoff NeodymiumMagnetic = new Werkstoff(Materials.NeodymiumMagnetic, , // ,31_766+356); - // public static Werkstoff SamariumMagnetic = new Werkstoff(Materials.SamariumMagnetic, , + // public static Werkstoff SamariumMagnetic = new Werkstoff(Materials.SamariumMagnetic, , // ,31_766+399); - // public static DilutedSulfuricAcid = new MaterialBuilder(31_766+640) - // public static Werkstoff EpoxidFiberReinforced = new Werkstoff(Materials.EpoxidFiberReinforced, + // public static DilutedSulfuricAcid = new MaterialBuilder(31_766+640) + // public static Werkstoff EpoxidFiberReinforced = new Werkstoff(Materials.EpoxidFiberReinforced, // , ,31_766+610); - // public static PotassiumNitrade = new MaterialBuilder(59 - // public static ChromiumTrioxide = new MaterialBuilder(31_766+591) - // public static Nitrochlorobenzene = new MaterialBuilder(31_766+592) - // public static Dimethylbenzene = new MaterialBuilder(31_766+593) - // public static Potassiumdichromate = new MaterialBuilder(594 - // public static PhthalicAcid = new MaterialBuilder(31_766+595) - // public static Dichlorobenzidine = new MaterialBuilder(31_766+596) - // public static Diaminobenzidin = new MaterialBuilder(31_766+597) - // public static Diphenylisophthalate = new MaterialBuilder(59 - // public static Werkstoff Polybenzimidazole = new Werkstoff(Materials.Polybenzimidazole, , - // , 31_766+599); - // public static NitrousOxide = new MaterialBuilder(31_766+993) - // public static AntiKnock = new MaterialBuilder(31_766+994) - // public static Octane = new MaterialBuilder(31_766+995) - // public static GasolineRaw = new MaterialBuilder(31_766+996) - // public static GasolineRegular = new MaterialBuilder(31_766+997) - // public static GasolinePremium = new MaterialBuilder(31_766+998) - // public static Werkstoff Electrotine = new Werkstoff(Materials.Electrotine, , + // public static PotassiumNitrade = new MaterialBuilder(59 + // public static ChromiumTrioxide = new MaterialBuilder(31_766+591) + // public static Nitrochlorobenzene = new MaterialBuilder(31_766+592) + // public static Dimethylbenzene = new MaterialBuilder(31_766+593) + // public static Potassiumdichromate = new MaterialBuilder(594 + // public static PhthalicAcid = new MaterialBuilder(31_766+595) + // public static Dichlorobenzidine = new MaterialBuilder(31_766+596) + // public static Diaminobenzidin = new MaterialBuilder(31_766+597) + // public static Diphenylisophthalate = new MaterialBuilder(59 + // public static Werkstoff Polybenzimidazole = new Werkstoff(Materials.Polybenzimidazole, , + // , 31_766+599); + // public static NitrousOxide = new MaterialBuilder(31_766+993) + // public static AntiKnock = new MaterialBuilder(31_766+994) + // public static Octane = new MaterialBuilder(31_766+995) + // public static GasolineRaw = new MaterialBuilder(31_766+996) + // public static GasolineRegular = new MaterialBuilder(31_766+997) + // public static GasolinePremium = new MaterialBuilder(31_766+998) + // public static Werkstoff Electrotine = new Werkstoff(Materials.Electrotine, , // ,31_766+812); - // public static Galgadorian = new Werkstoff(Materials.Galgadorian, , ,31_766+384); - // public static Werkstoff EnhancedGalgadorian = new Werkstoff(Materials.EnhancedGalgadorian, + // public static Galgadorian = new Werkstoff(Materials.Galgadorian, , ,31_766+384); + // public static Werkstoff EnhancedGalgadorian = new Werkstoff(Materials.EnhancedGalgadorian, // , ,31_766+385); - // public static Werkstoff BloodInfusedIron = new Werkstoff(Materials.BloodInfusedIron, , + // public static Werkstoff BloodInfusedIron = new Werkstoff(Materials.BloodInfusedIron, , // ,31_766+977); - // public static Werkstoff Shadow = new Werkstoff(Materials.Shadow, , ,31_766+368); - // public static Werkstoff Ledox = new Werkstoff(Materials.Ledox, , ,31_766+390); - // public static Werkstoff Quantium = new Werkstoff(Materials.Quantium, , + // public static Werkstoff Shadow = new Werkstoff(Materials.Shadow, , ,31_766+368); + // public static Werkstoff Ledox = new Werkstoff(Materials.Ledox, , ,31_766+390); + // public static Werkstoff Quantium = new Werkstoff(Materials.Quantium, , // ,31_766+391); - // public static Werkstoff Mytryl = new Werkstoff(Materials.Mytryl, , ,31_766+387); - // public static Werkstoff BlackPlutonium = new Werkstoff(Materials.BlackPlutonium, , + // public static Werkstoff Mytryl = new Werkstoff(Materials.Mytryl, , ,31_766+387); + // public static Werkstoff BlackPlutonium = new Werkstoff(Materials.BlackPlutonium, , // ,31_766+388); - // public static Werkstoff CallistoIce = new Werkstoff(Materials.CallistoIce, , + // public static Werkstoff CallistoIce = new Werkstoff(Materials.CallistoIce, , // ,31_766+389); - // public static Werkstoff Duralumin = new Werkstoff(Materials.Duralumin, , + // public static Werkstoff Duralumin = new Werkstoff(Materials.Duralumin, , // ,31_766+392); - // public static Werkstoff Oriharukon = new Werkstoff(Materials.Oriharukon, , + // public static Werkstoff Oriharukon = new Werkstoff(Materials.Oriharukon, , // ,31_766+393); - // public static Werkstoff MysteriousCrystal = new Werkstoff(Materials.MysteriousCrystal, , + // public static Werkstoff MysteriousCrystal = new Werkstoff(Materials.MysteriousCrystal, , // ,31_766+398); - // public static Werkstoff RedstoneAlloy = new Werkstoff(Materials.RedstoneAlloy, , + // public static Werkstoff RedstoneAlloy = new Werkstoff(Materials.RedstoneAlloy, , // ,31_766+381); - // public static Werkstoff Soularium = new Werkstoff(Materials.Soularium, , + // public static Werkstoff Soularium = new Werkstoff(Materials.Soularium, , // ,31_766+379); - // public static Werkstoff ConductiveIron = new Werkstoff(Materials.ConductiveIron, , + // public static Werkstoff ConductiveIron = new Werkstoff(Materials.ConductiveIron, , // ,31_766+369); - // public static Werkstoff ElectricalSteel = new Werkstoff(Materials.ElectricalSteel, , + // public static Werkstoff ElectricalSteel = new Werkstoff(Materials.ElectricalSteel, , // ,31_766+365); - // public static Werkstoff EnergeticAlloy = new Werkstoff(Materials.EnergeticAlloy, , + // public static Werkstoff EnergeticAlloy = new Werkstoff(Materials.EnergeticAlloy, , // ,31_766+366); - // public static Werkstoff VibrantAlloy = new Werkstoff(Materials.VibrantAlloy, , + // public static Werkstoff VibrantAlloy = new Werkstoff(Materials.VibrantAlloy, , // ,31_766+367); - // public static Werkstoff PulsatingIron = new Werkstoff(Materials.PulsatingIron, , + // public static Werkstoff PulsatingIron = new Werkstoff(Materials.PulsatingIron, , // ,31_766+378); - // public static Werkstoff DarkSteel = new Werkstoff(Materials.DarkSteel, , + // public static Werkstoff DarkSteel = new Werkstoff(Materials.DarkSteel, , // ,31_766+364); - // public static Werkstoff EndSteel = new Werkstoff(Materials.EndSteel, , + // public static Werkstoff EndSteel = new Werkstoff(Materials.EndSteel, , // ,31_766+401); - // public static Werkstoff CrudeSteel = new Werkstoff(Materials.CrudeSteel, , + // public static Werkstoff CrudeSteel = new Werkstoff(Materials.CrudeSteel, , // ,31_766+402); - // public static Werkstoff CrystallineAlloy = new Werkstoff(Materials.CrystallineAlloy, , + // public static Werkstoff CrystallineAlloy = new Werkstoff(Materials.CrystallineAlloy, , // ,31_766+403); - // public static Werkstoff MelodicAlloy = new Werkstoff(Materials.MelodicAlloy, , + // public static Werkstoff MelodicAlloy = new Werkstoff(Materials.MelodicAlloy, , // ,31_766+404); - // public static Werkstoff StellarAlloy = new Werkstoff(Materials.StellarAlloy, , + // public static Werkstoff StellarAlloy = new Werkstoff(Materials.StellarAlloy, , // ,31_766+405); - // public static Werkstoff CrystallinePinkSlime = new Werkstoff(Materials.CrystallinePinkSlime, + // public static Werkstoff CrystallinePinkSlime = new Werkstoff(Materials.CrystallinePinkSlime, // , ,31_766+406); - // public static Werkstoff EnergeticSilver = new Werkstoff(Materials.EnergeticSilver, , + // public static Werkstoff EnergeticSilver = new Werkstoff(Materials.EnergeticSilver, , // ,31_766+407); - // public static Werkstoff VividAlloy = new Werkstoff(Materials.VividAlloy, , + // public static Werkstoff VividAlloy = new Werkstoff(Materials.VividAlloy, , // ,31_766+408); - // public static Werkstoff Enderium = new Werkstoff(Materials.Enderium, , + // public static Werkstoff Enderium = new Werkstoff(Materials.Enderium, , // ,31_766+321); - // public static Werkstoff Mithril = new Werkstoff(Materials.Mithril, , + // public static Werkstoff Mithril = new Werkstoff(Materials.Mithril, , // ,31_766+331); - // public static Werkstoff BlueAlloy = new Werkstoff(Materials.BlueAlloy, , + // public static Werkstoff BlueAlloy = new Werkstoff(Materials.BlueAlloy, , // ,31_766+309); - // public static Werkstoff ShadowIron = new Werkstoff(Materials.ShadowIron, , + // public static Werkstoff ShadowIron = new Werkstoff(Materials.ShadowIron, , // ,31_766+336); - // public static Werkstoff ShadowSteel = new Werkstoff(Materials.ShadowSteel, , + // public static Werkstoff ShadowSteel = new Werkstoff(Materials.ShadowSteel, , // ,31_766+337); - // public static Werkstoff AstralSilver = new Werkstoff(Materials.AstralSilver, , + // public static Werkstoff AstralSilver = new Werkstoff(Materials.AstralSilver, , // ,31_766+333); - // public static Werkstoff InfinityCatalyst = new Werkstoff(Materials.InfinityCatalyst, , + // public static Werkstoff InfinityCatalyst = new Werkstoff(Materials.InfinityCatalyst, , // , 31_766 + 394); - // public static Werkstoff Infinity = new Werkstoff(Materials.Infinity, , , 31_766 + + // public static Werkstoff Infinity = new Werkstoff(Materials.Infinity, , , 31_766 + // 397); - // public static Werkstoff Bedrockium = new Werkstoff(Materials.Bedrockium, , , + // public static Werkstoff Bedrockium = new Werkstoff(Materials.Bedrockium, , , // 31_766 + 395); - // public static Werkstoff Trinium = new Werkstoff(Materials.Trinium, , , 31_766 + + // public static Werkstoff Trinium = new Werkstoff(Materials.Trinium, , , 31_766 + // 868); - // public static Werkstoff Ichorium = new Werkstoff(Materials.Ichorium, , , 31_766 + + // public static Werkstoff Ichorium = new Werkstoff(Materials.Ichorium, , , 31_766 + // 978); - // public static Werkstoff CosmicNeutronium = new Werkstoff(Materials.CosmicNeutronium, , + // public static Werkstoff CosmicNeutronium = new Werkstoff(Materials.CosmicNeutronium, , // , 31_766 + 982); - // public static Werkstoff Pentacadmiummagnesiumhexaoxid = new Werkstoff(Materials.Pentacadmiummagnesiumhexaoxid, + // public static Werkstoff Pentacadmiummagnesiumhexaoxid = new Werkstoff(Materials.Pentacadmiummagnesiumhexaoxid, // , , 31_766 + 987); - // public static Werkstoff Titaniumonabariumdecacoppereikosaoxid = new + // public static Werkstoff Titaniumonabariumdecacoppereikosaoxid = new // Werkstoff(Materials.Titaniumonabariumdecacoppereikosaoxid, , , 31_766 + 988); - // public static Werkstoff Uraniumtriplatinid = new Werkstoff(Materials.Uraniumtriplatinid, , + // public static Werkstoff Uraniumtriplatinid = new Werkstoff(Materials.Uraniumtriplatinid, , // , 31_766 + 989); - // public static Werkstoff Vanadiumtriindinid = new Werkstoff(Materials.Vanadiumtriindinid, , + // public static Werkstoff Vanadiumtriindinid = new Werkstoff(Materials.Vanadiumtriindinid, , // , 31_766 + 990); - // public static Werkstoff Tetraindiumditindibariumtitaniumheptacoppertetrakaidekaoxid = new + // public static Werkstoff Tetraindiumditindibariumtitaniumheptacoppertetrakaidekaoxid = new // Werkstoff(Materials.Tetraindiumditindibariumtitaniumheptacoppertetrakaidekaoxid, , , // 31_766 + 991); - // public static Werkstoff Tetranaquadahdiindiumhexaplatiumosminid = new + // public static Werkstoff Tetranaquadahdiindiumhexaplatiumosminid = new // Werkstoff(Materials.Tetranaquadahdiindiumhexaplatiumosminid, , , 31_766 + 992); - // public static Werkstoff Longasssuperconductornameforuvwire = new + // public static Werkstoff Longasssuperconductornameforuvwire = new // Werkstoff(Materials.Longasssuperconductornameforuvwire, , , 31_766 + 986); - // public static Werkstoff Longasssuperconductornameforuhvwire = new + // public static Werkstoff Longasssuperconductornameforuhvwire = new // Werkstoff(Materials.Longasssuperconductornameforuhvwire, , , 31_766 + 985); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java index d0c177e8f3..651bf98047 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java @@ -1,59 +1,44 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap; -import com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_Utility; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Utility; + public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { public BW_MetaGeneratedBlock_Item(Block par1) { super(par1); } - public boolean onItemUseFirst( - ItemStack stack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int side, - float hitX, - float hitY, - float hitZ) { + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, + float hitX, float hitY, float hitZ) { return false; } @@ -68,8 +53,8 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { int aMetaData = aStack.getItemDamage(); Werkstoff werkstoff = werkstoffHashMap.get((short) aMetaData); if (werkstoff == null) werkstoff = Werkstoff.default_null_Werkstoff; - return ((BW_MetaGenerated_Blocks) block) - .blockTypeLocalizedName.replace("%material", werkstoff.getLocalizedName()); + return ((BW_MetaGenerated_Blocks) block).blockTypeLocalizedName + .replace("%material", werkstoff.getLocalizedName()); } } return GT_LanguageManager.getTranslation(getUnlocalizedName(aStack) + ".name"); @@ -103,18 +88,8 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { } } - public boolean placeBlockAt( - ItemStack aStack, - EntityPlayer aPlayer, - World aWorld, - int aX, - int aY, - int aZ, - int side, - float hitX, - float hitY, - float hitZ, - int aMeta) { + public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, + float hitX, float hitY, float hitZ, int aMeta) { short tDamage = (short) this.getDamage(aStack); if (tDamage > 0) { if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java index 6893bb3ae5..aca8dfe63f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -1,33 +1,21 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; -import gregtech.api.enums.OrePrefixes; import java.util.List; import java.util.Optional; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; @@ -38,11 +26,16 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.OrePrefixes; + public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks implements com.gtnewhorizon.structurelib.structure.ICustomBlockSetting { - public BW_MetaGeneratedBlocks_Casing( - Material p_i45386_1_, Class tileEntity, String blockName, OrePrefixes prefixes) { + public BW_MetaGeneratedBlocks_Casing(Material p_i45386_1_, Class tileEntity, String blockName, + OrePrefixes prefixes) { super(p_i45386_1_, tileEntity, blockName, prefixes); } @@ -100,15 +93,15 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks @SuppressWarnings("unchecked") public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { Werkstoff.werkstoffHashSet.stream() - .filter(pMaterial -> pMaterial.getType().equals(Werkstoff.Types.BIOLOGICAL) + .filter( + pMaterial -> pMaterial.getType().equals(Werkstoff.Types.BIOLOGICAL) && pMaterial.hasGenerationFeature(WerkstoffLoader.blockCasing) - || pMaterial.doesOreDictedItemExists(OrePrefixes.plate) - && pMaterial.doesOreDictedItemExists(OrePrefixes.screw) - && pMaterial.doesOreDictedItemExists(OrePrefixes.plateDouble) - && pMaterial.doesOreDictedItemExists(OrePrefixes.gearGt) - && pMaterial.doesOreDictedItemExists(OrePrefixes.gearGtSmall)) - .map(pMaterial -> new ItemStack(aItem, 1, pMaterial.getmID())) - .forEach(aList::add); + || pMaterial.doesOreDictedItemExists(OrePrefixes.plate) + && pMaterial.doesOreDictedItemExists(OrePrefixes.screw) + && pMaterial.doesOreDictedItemExists(OrePrefixes.plateDouble) + && pMaterial.doesOreDictedItemExists(OrePrefixes.gearGt) + && pMaterial.doesOreDictedItemExists(OrePrefixes.gearGtSmall)) + .map(pMaterial -> new ItemStack(aItem, 1, pMaterial.getmID())).forEach(aList::add); } /** @@ -119,11 +112,8 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks try { Thread.sleep(1); // Fucking Minecraft TE settings. - } catch (InterruptedException ignored) { - } - Optional.ofNullable(world.getTileEntity(x, y, z)) - .filter(te -> te instanceof BW_MetaGenerated_Block_TE) - .map(te -> (BW_MetaGenerated_Block_TE) te) - .ifPresent(te -> te.mMetaData = (short) meta); + } catch (InterruptedException ignored) {} + Optional.ofNullable(world.getTileEntity(x, y, z)).filter(te -> te instanceof BW_MetaGenerated_Block_TE) + .map(te -> (BW_MetaGenerated_Block_TE) te).ifPresent(te -> te.mMetaData = (short) meta); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java index 4a1e088679..3c64631373 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java @@ -1,35 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; + import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; import gregtech.api.interfaces.ITexture; import gregtech.api.render.TextureFactory; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; public class BW_MetaGeneratedBlocks_CasingAdvanced_TE extends BW_MetaGenerated_Block_TE { @@ -45,16 +38,13 @@ public class BW_MetaGeneratedBlocks_CasingAdvanced_TE extends BW_MetaGenerated_B if ((aMaterial != null)) { TextureSet set = aMaterial.getTexSet(); ITexture aIconSet = TextureFactory.of( - PrefixTextureLinker.texMapBlocks - .get(WerkstoffLoader.blockCasingAdvanced) + PrefixTextureLinker.texMapBlocks.get(WerkstoffLoader.blockCasingAdvanced) .getOrDefault(set, TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]), aMaterial.getRGBA()); - return new ITexture[] {TextureFactory.of(Blocks.iron_block), aIconSet}; + return new ITexture[] { TextureFactory.of(Blocks.iron_block), aIconSet }; } } - return new ITexture[] { - TextureFactory.of(Blocks.iron_block), - TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) - }; + return new ITexture[] { TextureFactory.of(Blocks.iron_block), + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java index 9c06ed7f25..f52767969e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java @@ -1,35 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; + import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; import gregtech.api.interfaces.ITexture; import gregtech.api.render.TextureFactory; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; public class BW_MetaGeneratedBlocks_Casing_TE extends BW_MetaGenerated_Block_TE { @@ -45,16 +38,13 @@ public class BW_MetaGeneratedBlocks_Casing_TE extends BW_MetaGenerated_Block_TE if ((aMaterial != null)) { TextureSet set = aMaterial.getTexSet(); ITexture aIconSet = TextureFactory.of( - PrefixTextureLinker.texMapBlocks - .get(WerkstoffLoader.blockCasing) + PrefixTextureLinker.texMapBlocks.get(WerkstoffLoader.blockCasing) .getOrDefault(set, TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]), aMaterial.getRGBA()); - return new ITexture[] {TextureFactory.of(Blocks.iron_block), aIconSet}; + return new ITexture[] { TextureFactory.of(Blocks.iron_block), aIconSet }; } } - return new ITexture[] { - TextureFactory.of(Blocks.iron_block), - TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) - }; + return new ITexture[] { TextureFactory.of(Blocks.iron_block), + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java index 789a802d20..4f43533cff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java @@ -1,29 +1,23 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; import static gregtech.api.enums.GT_Values.RA; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import gregtech.api.enums.Dyes; import gregtech.api.enums.ItemList; import gregtech.api.enums.OrePrefixes; @@ -35,8 +29,6 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_ModHandler.RecipeBits; import gregtech.api.util.GT_OreDictUnificator; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class BW_MetaGeneratedFrames extends MetaPipeEntity { @@ -50,7 +42,7 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { GT_ModHandler.addCraftingRecipe( getStackForm(2), RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] {"SSS", "SwS", "SSS", 'S', mMaterial.get(OrePrefixes.stick)}); + new Object[] { "SSS", "SwS", "SSS", 'S', mMaterial.get(OrePrefixes.stick) }); RA.addAssemblerRecipe( GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.getVarName(), 4), ItemList.Circuit_Integrated.getWithDamage(0, 4), @@ -75,23 +67,16 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aConnections, - byte aColorIndex, - boolean aConnected, - boolean aRedstone) { - return new ITexture[] { - TextureFactory.of( - this.mMaterial.getTexSet().mTextures[OrePrefixes.frameGt.mTextureIndex], - Dyes.getModulation(aColorIndex, this.mMaterial.getRGBA())) - }; + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, + byte aColorIndex, boolean aConnected, boolean aRedstone) { + return new ITexture[] { TextureFactory.of( + this.mMaterial.getTexSet().mTextures[OrePrefixes.frameGt.mTextureIndex], + Dyes.getModulation(aColorIndex, this.mMaterial.getRGBA())) }; } @Override public String[] getDescription() { - return new String[] {"Just something you can put a Cover or CFoam on."}; + return new String[] { "Just something you can put a Cover or CFoam on." }; } @Override @@ -121,23 +106,23 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { @Override public final void saveNBTData(NBTTagCompound aNBT) { - /*Do nothing*/ + /* Do nothing */ } @Override public final void loadNBTData(NBTTagCompound aNBT) { - /*Do nothing*/ + /* Do nothing */ } @Override - public final boolean allowPutStack( - IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + public final boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, + ItemStack aStack) { return false; } @Override - public final boolean allowPullStack( - IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + public final boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, + ItemStack aStack) { return false; } @@ -146,6 +131,6 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { } public void disconnect(byte aSide) { - /* Do nothing*/ + /* Do nothing */ } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index a32db89a1c..150578965b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -1,32 +1,24 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; + import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; import gregtech.api.render.TextureFactory; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; public class BW_MetaGeneratedOreTE extends BW_MetaGenerated_Block_TE { @@ -34,14 +26,12 @@ public class BW_MetaGeneratedOreTE extends BW_MetaGenerated_Block_TE { public ITexture[] getTexture(Block aBlock, byte aSide) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if ((aMaterial != null)) { - ITexture aIconSet = TextureFactory.of( - aMaterial.getTexSet().mTextures[OrePrefixes.ore.mTextureIndex], aMaterial.getRGBA()); - return new ITexture[] {TextureFactory.of(Blocks.stone), aIconSet}; + ITexture aIconSet = TextureFactory + .of(aMaterial.getTexSet().mTextures[OrePrefixes.ore.mTextureIndex], aMaterial.getRGBA()); + return new ITexture[] { TextureFactory.of(Blocks.stone), aIconSet }; } - return new ITexture[] { - TextureFactory.of(Blocks.stone), - TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex]) - }; + return new ITexture[] { TextureFactory.of(Blocks.stone), + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex]) }; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java index fd73fde587..8ffd1ef475 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java @@ -1,27 +1,25 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; @@ -29,11 +27,6 @@ import gregtech.api.objects.XSTR; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; -import java.util.ArrayList; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { @@ -46,14 +39,20 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { ArrayList tSelector = new ArrayList<>(); ItemStack tStack = GT_OreDictUnificator.get( - OrePrefixes.gemExquisite, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); + OrePrefixes.gemExquisite, + aMaterial, + GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), + 1L); if (tStack != null) { for (int i = 0; i < 1; i++) { tSelector.add(tStack); } } tStack = GT_OreDictUnificator.get( - OrePrefixes.gemFlawless, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); + OrePrefixes.gemFlawless, + aMaterial, + GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), + 1L); if (tStack != null) { for (int i = 0; i < 2; i++) { tSelector.add(tStack); @@ -66,7 +65,10 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { } } tStack = GT_OreDictUnificator.get( - OrePrefixes.gemFlawed, aMaterial, GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L), 1L); + OrePrefixes.gemFlawed, + aMaterial, + GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L), + 1L); if (tStack != null) { for (int i = 0; i < 5; i++) { tSelector.add(tStack); @@ -102,8 +104,11 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { } } if (tRandom.nextInt(3 + aFortune) > 1) { - rList.add(GT_OreDictUnificator.get( - tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Stone, 1L)); + rList.add( + GT_OreDictUnificator.get( + tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, + Materials.Stone, + 1L)); } } return rList; @@ -113,14 +118,12 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { public ITexture[] getTexture(Block aBlock, byte aSide) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if ((aMaterial != null)) { - ITexture aIconSet = TextureFactory.of( - aMaterial.getTexSet().mTextures[OrePrefixes.oreSmall.mTextureIndex], aMaterial.getRGBA()); - return new ITexture[] {TextureFactory.of(Blocks.stone), aIconSet}; + ITexture aIconSet = TextureFactory + .of(aMaterial.getTexSet().mTextures[OrePrefixes.oreSmall.mTextureIndex], aMaterial.getRGBA()); + return new ITexture[] { TextureFactory.of(Blocks.stone), aIconSet }; } - return new ITexture[] { - TextureFactory.of(Blocks.stone), - TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.oreSmall.mTextureIndex]) - }; + return new ITexture[] { TextureFactory.of(Blocks.stone), TextureFactory + .of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.oreSmall.mTextureIndex]) }; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java index d3ba33be2f..65aa1bde00 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java @@ -1,32 +1,22 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; import static com.github.bartimaeusnek.bartworks.MainMod.BW_Network_instance; -import com.github.bartimaeusnek.bartworks.common.net.MetaBlockPacket; -import gregtech.api.interfaces.tileentity.ITexturedTileEntity; import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -34,6 +24,9 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.Packet; import net.minecraft.tileentity.TileEntity; +import com.github.bartimaeusnek.bartworks.common.net.MetaBlockPacket; +import gregtech.api.interfaces.tileentity.ITexturedTileEntity; + public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements ITexturedTileEntity { public short mMetaData; @@ -54,12 +47,11 @@ public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements IT @Override public Packet getDescriptionPacket() { - if (!this.worldObj.isRemote) - BW_Network_instance.sendPacketToAllPlayersInRange( - this.worldObj, - new MetaBlockPacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), - this.xCoord, - this.zCoord); + if (!this.worldObj.isRemote) BW_Network_instance.sendPacketToAllPlayersInRange( + this.worldObj, + new MetaBlockPacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), + this.xCoord, + this.zCoord); return null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java index 0defff39f6..ad850c2c5f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java @@ -1,37 +1,22 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; import static com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items.metaTab; -import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_LanguageManager; import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; @@ -39,6 +24,15 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; +import com.github.bartimaeusnek.bartworks.util.BW_Util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_LanguageManager; + public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { public static ThreadLocal mTemporaryTileEntity = new ThreadLocal<>(); @@ -49,8 +43,8 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { this(p_i45386_1_, tileEntity, blockName, null); } - public BW_MetaGenerated_Blocks( - Material p_i45386_1_, Class tileEntity, String blockName, OrePrefixes types) { + public BW_MetaGenerated_Blocks(Material p_i45386_1_, Class tileEntity, String blockName, + OrePrefixes types) { super(p_i45386_1_, tileEntity, blockName); this.setHardness(5.0F); this.setResistance(5.0F); @@ -125,8 +119,6 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) { return ((BW_MetaGenerated_Block_TE) tTileEntity).getDrops(aFortune); } - return mTemporaryTileEntity.get() == null - ? new ArrayList<>() - : mTemporaryTileEntity.get().getDrops(aFortune); + return mTemporaryTileEntity.get() == null ? new ArrayList<>() : mTemporaryTileEntity.get().getDrops(aFortune); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index b75edf88a0..30f1a6813f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; @@ -25,21 +16,8 @@ package com.github.bartimaeusnek.bartworks.system.material; import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap; import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashSet; -import com.github.bartimaeusnek.bartworks.API.IRadMaterial; -import com.github.bartimaeusnek.bartworks.API.SideReference; -import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Item; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; -import ic2.core.IC2Potion; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; @@ -55,6 +33,22 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import com.github.bartimaeusnek.bartworks.API.IRadMaterial; +import com.github.bartimaeusnek.bartworks.API.SideReference; +import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Item; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import ic2.core.IC2Potion; + public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRadMaterial { public static final CreativeTabs metaTab = new CreativeTabs("bartworksMetaMaterials") { @@ -91,8 +85,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } public boolean onEntityItemUpdate(EntityItem aItemEntity) { - if (this.orePrefixes == OrePrefixes.dustImpure - || this.orePrefixes == OrePrefixes.dustPure + if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure || this.orePrefixes == OrePrefixes.crushed) { int aDamage = aItemEntity.getEntityItem().getItemDamage(); if ((aDamage >= 0) && (!aItemEntity.worldObj.isRemote)) { @@ -105,15 +98,21 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((this.orePrefixes == OrePrefixes.dustImpure) || (this.orePrefixes == OrePrefixes.dustPure)) { if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { - aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack( - OrePrefixes.dust, aMaterial, aItemEntity.getEntityItem().stackSize)); + aItemEntity.setEntityItemStack( + WerkstoffLoader.getCorrespondingItemStack( + OrePrefixes.dust, + aMaterial, + aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } } else { if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { - aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack( - OrePrefixes.crushedPurified, aMaterial, aItemEntity.getEntityItem().stackSize)); + aItemEntity.setEntityItemStack( + WerkstoffLoader.getCorrespondingItemStack( + OrePrefixes.crushedPurified, + aMaterial, + aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } @@ -127,17 +126,16 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override @SuppressWarnings("unchecked") protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { - // String tooltip = GT_LanguageManager.getTranslation(this.getUnlocalizedName(aStack) + ".tooltip"); - // if (!tooltip.isEmpty()) - // aList.add(tooltip); + // String tooltip = GT_LanguageManager.getTranslation(this.getUnlocalizedName(aStack) + ".tooltip"); + // if (!tooltip.isEmpty()) + // aList.add(tooltip); if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure) { aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify")); } if (this.orePrefixes == OrePrefixes.crushed) aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify.2")); - if (aStack != null - && aStack.getItem() instanceof BW_MetaGenerated_Items + if (aStack != null && aStack.getItem() instanceof BW_MetaGenerated_Items && aStack.getItemDamage() == WerkstoffLoader.Tiberium.getmID()) aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.nqgen")); @@ -175,10 +173,8 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } protected IIconContainer getIconContainerBartWorks(int aMetaData) { - if (SideReference.Side.Client) - return PrefixTextureLinker.texMap - .get(this.orePrefixes) - .get(werkstoffHashMap.get((short) aMetaData).getTexSet()); + if (SideReference.Side.Client) return PrefixTextureLinker.texMap.get(this.orePrefixes) + .get(werkstoffHashMap.get((short) aMetaData).getTexSet()); return null; } @@ -259,21 +255,15 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public int getCapacity(ItemStack aStack) { - return this.orePrefixes == OrePrefixes.capsule - || this.orePrefixes == OrePrefixes.cell - || this.orePrefixes == OrePrefixes.cellPlasma - ? 1000 - : this.orePrefixes == WerkstoffLoader.cellMolten || this.orePrefixes == WerkstoffLoader.capsuleMolten - ? 144 - : 0; + return this.orePrefixes == OrePrefixes.capsule || this.orePrefixes == OrePrefixes.cell + || this.orePrefixes == OrePrefixes.cellPlasma ? 1000 + : this.orePrefixes == WerkstoffLoader.cellMolten + || this.orePrefixes == WerkstoffLoader.capsuleMolten ? 144 : 0; } @Override public ItemStack getContainerItem(ItemStack aStack) { - return this.orePrefixes == OrePrefixes.cell - || this.orePrefixes == OrePrefixes.cellPlasma - || this.orePrefixes == WerkstoffLoader.cellMolten - ? Materials.Empty.getCells(1) - : null; + return this.orePrefixes == OrePrefixes.cell || this.orePrefixes == OrePrefixes.cellPlasma + || this.orePrefixes == WerkstoffLoader.cellMolten ? Materials.Empty.getCells(1) : null; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 51107af501..36d7eb46fc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -1,33 +1,21 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; -import com.github.bartimaeusnek.bartworks.util.MathUtils; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_ModHandler; import java.util.Arrays; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; @@ -39,6 +27,12 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import com.github.bartimaeusnek.bartworks.util.MathUtils; + +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; + public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { public BW_MetaGenerated_Ores(Material p_i45386_1_, Class tileEntity, String blockName) { @@ -55,8 +49,8 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { } } - public static boolean setOreBlock( - World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, int[] aBlockMeta) { + public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, + int[] aBlockMeta) { if (!air) { aY = MathUtils.clamp(aY, 1, aWorld.getActualHeight()); } @@ -108,8 +102,7 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { @SuppressWarnings("unchecked") public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { for (Werkstoff tMaterial : Werkstoff.werkstoffHashSet) { - if ((tMaterial != null) - && tMaterial.hasItemType(OrePrefixes.ore) + if ((tMaterial != null) && tMaterial.hasItemType(OrePrefixes.ore) && ((tMaterial.getGenerationFeatures().blacklist & 0x8) == 0)) { aList.add(new ItemStack(aItem, 1, tMaterial.getmID())); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java index 98507565a5..54825526de 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java @@ -1,38 +1,32 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_ModHandler; import java.util.Arrays; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; + public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { + public BW_MetaGenerated_SmallOres(Material p_i45386_1_, Class tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization( @@ -53,8 +47,8 @@ public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { return "bw.blockores.02"; } - public static boolean setOreBlock( - World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, int[] aBlockMeta) { + public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, + int[] aBlockMeta) { if (!air) { aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java index d2ce3fe266..ce3f26a020 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java @@ -1,35 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; + import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; import gregtech.api.interfaces.ITexture; import gregtech.api.render.TextureFactory; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; public class BW_MetaGenerated_WerkstoffBlock_TE extends BW_MetaGenerated_Block_TE { @@ -40,16 +33,14 @@ public class BW_MetaGenerated_WerkstoffBlock_TE extends BW_MetaGenerated_Block_T if ((aMaterial != null)) { TextureSet set = aMaterial.getTexSet(); ITexture aIconSet = TextureFactory.of( - set.mTextures[ - PrefixTextureLinker.blockTexMap.getOrDefault(set, OrePrefixes.block.mTextureIndex)], + set.mTextures[PrefixTextureLinker.blockTexMap + .getOrDefault(set, OrePrefixes.block.mTextureIndex)], aMaterial.getRGBA()); - return new ITexture[] {TextureFactory.of(Blocks.iron_block), aIconSet}; + return new ITexture[] { TextureFactory.of(Blocks.iron_block), aIconSet }; } } - return new ITexture[] { - TextureFactory.of(Blocks.iron_block), - TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) - }; + return new ITexture[] { TextureFactory.of(Blocks.iron_block), + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) }; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java index 44f3a90f2b..9c7d251688 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java @@ -1,30 +1,20 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_LanguageManager; import java.util.List; + import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; @@ -34,10 +24,13 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_LanguageManager; + public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks { - public BW_MetaGenerated_WerkstoffBlocks( - Material p_i45386_1_, Class tileEntity, String blockName) { + public BW_MetaGenerated_WerkstoffBlocks(Material p_i45386_1_, Class tileEntity, + String blockName) { super(p_i45386_1_, tileEntity, blockName); this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization( "bw.blocktype." + OrePrefixes.block, @@ -67,7 +60,6 @@ public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks { public void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) { Werkstoff.werkstoffHashSet.stream() .filter(tMaterial -> tMaterial.hasItemType(OrePrefixes.gem) || tMaterial.hasItemType(OrePrefixes.ingot)) - .map(tMaterial -> new ItemStack(aItem, 1, tMaterial.getmID())) - .forEach(aList::add); + .map(tMaterial -> new ItemStack(aItem, 1, tMaterial.getmID())).forEach(aList::add); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java index 5c64a2075d..67bfa6c0af 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java @@ -1,38 +1,31 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; import static gregtech.api.enums.GT_Values.W; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + import gregtech.api.interfaces.IItemContainer; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; public enum BW_NonMeta_MaterialItems implements IItemContainer { + Depleted_Tiberium_1, Depleted_Tiberium_2, Depleted_Tiberium_4, @@ -41,6 +34,7 @@ public enum BW_NonMeta_MaterialItems implements IItemContainer { TiberiumCell_4, TheCoreCell, Depleted_TheCoreCell; + private ItemStack mStack; private boolean mHasNotBeenSet = true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java index 8f34416122..6bd186a050 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index caaa55b252..b333812740 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -1,33 +1,36 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; +import java.util.*; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -37,15 +40,6 @@ import gregtech.api.interfaces.IItemContainer; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.objects.ItemData; import gregtech.api.util.*; -import java.util.*; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; -import net.minecraftforge.fluids.FluidStack; public class BW_Meta_Items { @@ -66,17 +60,18 @@ public class BW_Meta_Items { BW_Meta_Items.NEWCIRCUITS.getStack(2), 300, 480); - GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.add(new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[] {BW_Meta_Items.NEWCIRCUITS.getStack(2)}, - new ItemStack[] {BW_Meta_Items.NEWCIRCUITS.getStack(3)}, - null, - new int[] {7500}, - new FluidStack[] {Materials.SolderingAlloy.getMolten(576)}, - null, - 300, - BW_Util.getMachineVoltageFromTier(4), - BW_Util.CLEANROOM)); + GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.add( + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { BW_Meta_Items.NEWCIRCUITS.getStack(2) }, + new ItemStack[] { BW_Meta_Items.NEWCIRCUITS.getStack(3) }, + null, + new int[] { 7500 }, + new FluidStack[] { Materials.SolderingAlloy.getMolten(576) }, + null, + 300, + BW_Util.getMachineVoltageFromTier(4), + BW_Util.CLEANROOM)); } @SuppressWarnings("deprecation") @@ -204,12 +199,14 @@ public class BW_Meta_Items { i, 0, 2, - Objects.requireNonNull(CircuitImprintLoader.circuitIIconRefs.get(i)) - .get(1) - .getIconIndex(), + Objects.requireNonNull(CircuitImprintLoader.circuitIIconRefs.get(i)).get(1).getIconIndex(), this.mIconList); BW_Util.set2DCoordTo1DArray( - i, 1, 2, aIconRegister.registerIcon(MainMod.MOD_ID + ":WrapOverlay"), this.mIconList); + i, + 1, + 2, + aIconRegister.registerIcon(MainMod.MOD_ID + ":WrapOverlay"), + this.mIconList); // aIconRegister.registerIcon("gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + // "/" + i)); } @@ -219,25 +216,26 @@ public class BW_Meta_Items { @Override @SuppressWarnings("unchecked") protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { - if (aStack.getItemDamage() == 0) - if (aStack.getTagCompound() != null - && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) - aList.add("An Imprint for: " - + GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName( - CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); - else aList.add("An Imprint for a Circuit"); - else if (aStack.getItemDamage() == 1) - if (aStack.getTagCompound() != null - && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) - aList.add("A Sliced " - + GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName( - CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); - else aList.add("A Sliced Circuit"); + if (aStack.getItemDamage() == 0) if (aStack.getTagCompound() != null + && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) + aList.add( + "An Imprint for: " + GT_LanguageManager.getTranslation( + GT_LanguageManager.getTranslateableItemStackName( + CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); + else aList.add("An Imprint for a Circuit"); + else if (aStack.getItemDamage() == 1) if (aStack.getTagCompound() != null + && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) + aList.add( + "A Sliced " + GT_LanguageManager.getTranslation( + GT_LanguageManager.getTranslateableItemStackName( + CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); + else aList.add("A Sliced Circuit"); super.addAdditionalToolTips(aList, aStack, aPlayer); } } public static class BW_GT_MetaGen_Item_Hook extends GT_MetaBase_Item { + public static final HashSet sInstances = new HashSet<>(); public final IIcon[] mIconList; public final BitSet mEnabledItems; @@ -251,6 +249,7 @@ public class BW_Meta_Items { super(aUnlocalized); this.setCreativeTab(new CreativeTabs("bw.MetaItems.0") { + @Override public Item getTabIconItem() { return ItemRegistry.TAB; @@ -271,7 +270,7 @@ public class BW_Meta_Items { return null; } - @SuppressWarnings({"unchecked", "rawtypes"}) + @SuppressWarnings({ "unchecked", "rawtypes" }) public final ItemStack addItem(int aID, String aEnglish, String aToolTip, Object... aRandomData) { if (aToolTip == null) { aToolTip = ""; @@ -369,8 +368,8 @@ public class BW_Meta_Items { } @Override - public IIcon getIcon( - ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, + int useRemaining) { return this.getIconFromDamage(stack.getItemDamage()); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java index 19bf5bb662..da02250010 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java @@ -1,30 +1,22 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; -import com.github.bartimaeusnek.bartworks.util.MurmurHash3; import java.nio.ByteBuffer; +import com.github.bartimaeusnek.bartworks.util.MurmurHash3; + public class CircuitData { private long aVoltage; @@ -50,11 +42,7 @@ public class CircuitData { @Override public int hashCode() { return MurmurHash3.murmurhash3_x86_32( - ByteBuffer.allocate(13) - .put(this.aTier) - .putInt(this.aSpecial) - .putLong(this.aVoltage) - .array(), + ByteBuffer.allocate(13).put(this.aTier).putInt(this.aSpecial).putLong(this.aVoltage).array(), 0, 13, 31); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 6cfe902668..91ac70820f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -1,27 +1,33 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.ShapedOreRecipe; + import com.github.bartimaeusnek.bartworks.ASM.BWCoreStaticReplacementMethodes; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -31,6 +37,7 @@ import com.github.bartimaeusnek.bartworks.util.Pair; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; + import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -39,19 +46,6 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.ShapedOreRecipe; public class CircuitImprintLoader { @@ -66,7 +60,7 @@ public class CircuitImprintLoader { private static final HashSet ORIGINAL_CAL_RECIPES = new HashSet<>(); private static final HashSet MODIFIED_CAL_RECIPES = new HashSet<>(); - @SuppressWarnings({"unused", "RedundantSuppression"}) + @SuppressWarnings({ "unused", "RedundantSuppression" }) public static void run() { HashSet toRem = new HashSet<>(); HashSet toAdd = new HashSet<>(); @@ -89,19 +83,19 @@ public class CircuitImprintLoader { private static void rebuildCircuitAssemblerMap(HashSet toRem, HashSet toAdd) { reAddOriginalRecipes(); - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.forEach( - e -> CircuitImprintLoader.handleCircuitRecipeRebuilding(e, toRem, toAdd)); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList + .forEach(e -> CircuitImprintLoader.handleCircuitRecipeRebuilding(e, toRem, toAdd)); } - private static void handleCircuitRecipeRebuilding( - GT_Recipe circuitRecipe, HashSet toRem, HashSet toAdd) { + private static void handleCircuitRecipeRebuilding(GT_Recipe circuitRecipe, HashSet toRem, + HashSet toAdd) { ItemStack[] outputs = circuitRecipe.mOutputs; boolean isOrePass = isCircuitOreDict(outputs[0]); String unlocalizedName = outputs[0].getUnlocalizedName(); if (isOrePass || unlocalizedName.contains("Circuit") || unlocalizedName.contains("circuit")) { - CircuitImprintLoader.recipeTagMap.put( - CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); + CircuitImprintLoader.recipeTagMap + .put(CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null ? FluidRegistry.getFluid("molten.indalloy140") @@ -116,9 +110,7 @@ public class CircuitImprintLoader { || circuitRecipe.mFluidInputs[0].isFluidEqual(new FluidStack(solderUEV, 0))) { GT_Recipe newRecipe = CircuitImprintLoader.reBuildRecipe(circuitRecipe); if (newRecipe != null) - BWRecipes.instance - .getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE) - .addRecipe(newRecipe); + BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(newRecipe); addCutoffRecipeToSets(toRem, toAdd, circuitRecipe); } else { if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) toRem.add(circuitRecipe); @@ -147,8 +139,8 @@ public class CircuitImprintLoader { MODIFIED_CAL_RECIPES.addAll(toAdd); } - private static void addCutoffRecipeToSets( - HashSet toRem, HashSet toAdd, GT_Recipe circuitRecipe) { + private static void addCutoffRecipeToSets(HashSet toRem, HashSet toAdd, + GT_Recipe circuitRecipe) { if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) { toRem.add(circuitRecipe); toAdd.add(CircuitImprintLoader.makeMoreExpensive(circuitRecipe)); @@ -192,7 +184,7 @@ public class CircuitImprintLoader { return new BWRecipes.DynamicGTRecipe( false, in, - new ItemStack[] {getOutputMultiplied(original)}, + new ItemStack[] { getOutputMultiplied(original) }, BW_Meta_Items.getNEWCIRCUITS() .getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]), 0, 0), null, @@ -209,18 +201,18 @@ public class CircuitImprintLoader { return out; } - private static void replaceCircuits( - BiMap inversed, GT_Recipe original, ItemStack[] in, int index) { + private static void replaceCircuits(BiMap inversed, GT_Recipe original, ItemStack[] in, + int index) { for (ItemList il : inversed.keySet()) { if (GT_Utility.areStacksEqual(il.get(1), replaceCircuitParts(original.mInputs[index]))) { - in[index] = - BW_Meta_Items.getNEWCIRCUITS().getStack(inversed.get(il), original.mInputs[index].stackSize); + in[index] = BW_Meta_Items.getNEWCIRCUITS() + .getStack(inversed.get(il), original.mInputs[index].stackSize); } } } - private static final List> circuitPartsToReplace = - Collections.unmodifiableList(Arrays.asList( + private static final List> circuitPartsToReplace = Collections.unmodifiableList( + Arrays.asList( new Pair<>(ItemList.Circuit_Parts_Resistor.get(1), ItemList.Circuit_Parts_ResistorSMD.get(1)), new Pair<>(ItemList.Circuit_Parts_Diode.get(1), ItemList.Circuit_Parts_DiodeSMD.get(1)), new Pair<>(ItemList.Circuit_Parts_Transistor.get(1), ItemList.Circuit_Parts_TransistorSMD.get(1)), @@ -252,24 +244,24 @@ public class CircuitImprintLoader { // fine wires } else if (BW_Util.checkStackAndPrefix(original.mInputs[index]) && GT_OreDictUnificator.getAssociation(original.mInputs[index]).mPrefix == OrePrefixes.wireFine) { - in[index] = GT_OreDictUnificator.get( - OrePrefixes.wireGt04, - GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, - original.mInputs[index].stackSize); - if (in[index] == null) { - in[index] = GT_OreDictUnificator.get( - OrePrefixes.wireFine, - GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, - original.mInputs[index].stackSize * 16); - } - // other components - } else { - in[index] = original.mInputs[index].copy(); - in[index].stackSize *= 16; - if (in[index].stackSize > in[index].getItem().getItemStackLimit() - || in[index].stackSize > in[index].getMaxStackSize()) - in[index].stackSize = in[index].getMaxStackSize(); - } + in[index] = GT_OreDictUnificator.get( + OrePrefixes.wireGt04, + GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, + original.mInputs[index].stackSize); + if (in[index] == null) { + in[index] = GT_OreDictUnificator.get( + OrePrefixes.wireFine, + GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, + original.mInputs[index].stackSize * 16); + } + // other components + } else { + in[index] = original.mInputs[index].copy(); + in[index].stackSize *= 16; + if (in[index].stackSize > in[index].getItem().getItemStackLimit() + || in[index].stackSize > in[index].getMaxStackSize()) + in[index].stackSize = in[index].getMaxStackSize(); + } } } @@ -315,14 +307,17 @@ public class CircuitImprintLoader { eut = Math.min( eut, - BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName( - (OreDictionary.getOreIDs(stack) != null && OreDictionary.getOreIDs(stack).length > 0) - ? OreDictionary.getOreIDs(stack)[0] - : -1)))); + BW_Util.getMachineVoltageFromTier( + BW_Util.getCircuitTierFromOreDictName( + OreDictionary.getOreName( + (OreDictionary.getOreIDs(stack) != null + && OreDictionary.getOreIDs(stack).length > 0) + ? OreDictionary.getOreIDs(stack)[0] + : -1)))); GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe( true, - new ItemStack[] {stack, ItemList.Shape_Slicer_Flat.get(0)}, - new ItemStack[] {BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag, 1, 1)}, + new ItemStack[] { stack, ItemList.Shape_Slicer_Flat.get(0) }, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag, 1, 1) }, null, null, null, @@ -336,23 +331,14 @@ public class CircuitImprintLoader { private static void makeAndAddCraftingRecipes(NBTTagCompound tag) { ItemStack circuit = BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag, 0, 1); - Object[] imprintRecipe = { - " X ", - "GPG", - " X ", - 'P', - BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag, 1, 1), - 'G', - WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite, 1), - 'X', - BW_Meta_Items.getNEWCIRCUITS().getStack(3) - }; + Object[] imprintRecipe = { " X ", "GPG", " X ", 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag, 1, 1), + 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite, 1), 'X', + BW_Meta_Items.getNEWCIRCUITS().getStack(3) }; IRecipe bwrecipe = new BWRecipes.BWNBTDependantCraftingRecipe(circuit, imprintRecipe); ShapedOreRecipe gtrecipe = BW_Util.createGTCraftingRecipe( circuit, - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.KEEPNBT + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED, imprintRecipe); @@ -375,10 +361,7 @@ public class CircuitImprintLoader { } private static void deleteCALRecipesAndTags() { - BWRecipes.instance - .getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE) - .mRecipeList - .clear(); + BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).mRecipeList.clear(); recipeTagMap.clear(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index 617609a850..f1e4c90679 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -1,43 +1,38 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; import static gregtech.api.enums.ItemList.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import net.minecraft.item.ItemStack; + import com.github.bartimaeusnek.bartworks.client.renderer.BW_GT_ItemRenderer; + import cpw.mods.fml.common.FMLCommonHandler; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import net.minecraft.item.ItemStack; public class CircuitPartLoader implements Runnable { + @Override public void run() { CircuitPartLoader.makeCircuitParts(); @@ -48,8 +43,7 @@ public class CircuitPartLoader implements Runnable { ItemList[] itemLists = values(); for (ItemList single : itemLists) { if (!single.hasBeenSet()) continue; - if (single.toString().contains("Wafer") - || single.toString().contains("Circuit_Silicon_Ingot") + if (single.toString().contains("Wafer") || single.toString().contains("Circuit_Silicon_Ingot") || single.toString().contains("Raw") || single.toString().contains("raw") || single.toString().contains("Glass_Tube") @@ -75,12 +69,12 @@ public class CircuitPartLoader implements Runnable { if (FMLCommonHandler.instance().getEffectiveSide().isClient()) single.getItem().addInformation(single.get(1).copy(), null, toolTip, true); String tt = (toolTip.size() > 0 ? toolTip.get(0) : ""); - // tt += "Internal Name = "+single; - String localised = - GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); + // tt += "Internal Name = "+single; + String localised = GT_LanguageManager + .getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); BW_Meta_Items.getNEWCIRCUITS().addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised + "s", tt); GT_Values.RA.addAssemblerRecipe( - new ItemStack[] {single.get(16).copy(), GT_Utility.getIntegratedCircuit(16)}, + new ItemStack[] { single.get(16).copy(), GT_Utility.getIntegratedCircuit(16) }, Materials.Plastic.getMolten(72), BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs), 600, @@ -91,74 +85,75 @@ public class CircuitPartLoader implements Runnable { } /** - * Contains all the circuit parts we want to generate wrapped version of. - * New entries MUST be placed at the END of this list, to prevent id shift. + * Contains all the circuit parts we want to generate wrapped version of. New entries MUST be placed at the END of + * this list, to prevent id shift. */ - private static final List CIRCUIT_PARTS = Collections.unmodifiableList(Arrays.asList( - Circuit_Board_Basic, - Circuit_Board_Advanced, - Circuit_Board_Elite, - Circuit_Parts_Crystal_Chip_Elite, - Circuit_Parts_Crystal_Chip_Master, - Circuit_Board_Coated, - Circuit_Board_Coated_Basic, - Circuit_Board_Phenolic, - Circuit_Board_Phenolic_Good, - Circuit_Board_Epoxy, - Circuit_Board_Epoxy_Advanced, - Circuit_Board_Fiberglass, - Circuit_Board_Fiberglass_Advanced, - Circuit_Board_Multifiberglass_Elite, - Circuit_Board_Multifiberglass, - Circuit_Board_Wetware, - Circuit_Board_Wetware_Extreme, - Circuit_Board_Plastic, - Circuit_Board_Plastic_Advanced, - Circuit_Board_Bio, - Circuit_Board_Bio_Ultra, - Circuit_Parts_ResistorSMD, - Circuit_Parts_InductorSMD, - Circuit_Parts_DiodeSMD, - Circuit_Parts_TransistorSMD, - Circuit_Parts_CapacitorSMD, - Circuit_Parts_ResistorASMD, - Circuit_Parts_DiodeASMD, - Circuit_Parts_TransistorASMD, - Circuit_Parts_CapacitorASMD, - Circuit_Chip_ILC, - Circuit_Chip_Ram, - Circuit_Chip_NAND, - Circuit_Chip_NOR, - Circuit_Chip_CPU, - Circuit_Chip_SoC, - Circuit_Chip_SoC2, - Circuit_Chip_PIC, - Circuit_Chip_Simple_SoC, - Circuit_Chip_HPIC, - Circuit_Chip_UHPIC, - Circuit_Chip_ULPIC, - Circuit_Chip_LPIC, - Circuit_Chip_NPIC, - Circuit_Chip_PPIC, - Circuit_Chip_QPIC, - Circuit_Chip_NanoCPU, - Circuit_Chip_QuantumCPU, - Circuit_Chip_CrystalCPU, - Circuit_Chip_CrystalSoC, - Circuit_Chip_CrystalSoC2, - Circuit_Chip_NeuroCPU, - Circuit_Chip_BioCPU, - Circuit_Chip_Stemcell, - Circuit_Chip_Biocell, - Circuit_Parts_ResistorXSMD, - Circuit_Parts_DiodeXSMD, - Circuit_Parts_TransistorXSMD, - Circuit_Parts_CapacitorXSMD, - Circuit_Parts_InductorASMD, - Circuit_Parts_InductorXSMD, - Circuit_Chip_Optical, - Circuit_Board_Optical, - Optically_Perfected_CPU, - Optical_Cpu_Containment_Housing, - Optically_Compatible_Memory)); + private static final List CIRCUIT_PARTS = Collections.unmodifiableList( + Arrays.asList( + Circuit_Board_Basic, + Circuit_Board_Advanced, + Circuit_Board_Elite, + Circuit_Parts_Crystal_Chip_Elite, + Circuit_Parts_Crystal_Chip_Master, + Circuit_Board_Coated, + Circuit_Board_Coated_Basic, + Circuit_Board_Phenolic, + Circuit_Board_Phenolic_Good, + Circuit_Board_Epoxy, + Circuit_Board_Epoxy_Advanced, + Circuit_Board_Fiberglass, + Circuit_Board_Fiberglass_Advanced, + Circuit_Board_Multifiberglass_Elite, + Circuit_Board_Multifiberglass, + Circuit_Board_Wetware, + Circuit_Board_Wetware_Extreme, + Circuit_Board_Plastic, + Circuit_Board_Plastic_Advanced, + Circuit_Board_Bio, + Circuit_Board_Bio_Ultra, + Circuit_Parts_ResistorSMD, + Circuit_Parts_InductorSMD, + Circuit_Parts_DiodeSMD, + Circuit_Parts_TransistorSMD, + Circuit_Parts_CapacitorSMD, + Circuit_Parts_ResistorASMD, + Circuit_Parts_DiodeASMD, + Circuit_Parts_TransistorASMD, + Circuit_Parts_CapacitorASMD, + Circuit_Chip_ILC, + Circuit_Chip_Ram, + Circuit_Chip_NAND, + Circuit_Chip_NOR, + Circuit_Chip_CPU, + Circuit_Chip_SoC, + Circuit_Chip_SoC2, + Circuit_Chip_PIC, + Circuit_Chip_Simple_SoC, + Circuit_Chip_HPIC, + Circuit_Chip_UHPIC, + Circuit_Chip_ULPIC, + Circuit_Chip_LPIC, + Circuit_Chip_NPIC, + Circuit_Chip_PPIC, + Circuit_Chip_QPIC, + Circuit_Chip_NanoCPU, + Circuit_Chip_QuantumCPU, + Circuit_Chip_CrystalCPU, + Circuit_Chip_CrystalSoC, + Circuit_Chip_CrystalSoC2, + Circuit_Chip_NeuroCPU, + Circuit_Chip_BioCPU, + Circuit_Chip_Stemcell, + Circuit_Chip_Biocell, + Circuit_Parts_ResistorXSMD, + Circuit_Parts_DiodeXSMD, + Circuit_Parts_TransistorXSMD, + Circuit_Parts_CapacitorXSMD, + Circuit_Parts_InductorASMD, + Circuit_Parts_InductorXSMD, + Circuit_Chip_Optical, + Circuit_Board_Optical, + Optically_Perfected_CPU, + Optical_Cpu_Containment_Housing, + Optically_Compatible_Memory)); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java index 69b43684ce..96bc459e91 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -1,35 +1,41 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; import static com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.GTMetaItemEnhancer.NoMetaValue; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Materials; @@ -38,18 +44,6 @@ import gregtech.api.enums.TextureSet; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.util.GT_OreDictUnificator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.oredict.OreDictionary; public class BWGTMetaItems extends BW_MetaGenerated_Items { @@ -64,17 +58,18 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { Materials material = Materials.values()[i]; if (((material.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((material.getFluid(1) == null && material.getGas(1) == null) - && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; + && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) + continue; // for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) - // if (material.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) - // continue materialloop; - if (OreDictionary.doesOreNameExist( - this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ", ""))) { + // if (material.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) + // continue materialloop; + if (OreDictionary + .doesOreNameExist(this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ", ""))) { hiddenThings.add(i); continue; } - GT_OreDictUnificator.registerOre( - this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ", ""), tStack); + GT_OreDictUnificator + .registerOre(this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ", ""), tStack); } if (noSubIDMaterials != null) { @@ -88,14 +83,14 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; // for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) - // if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) - // continue materialloop; + // if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) + // continue materialloop; if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ", ""))) { hiddenThings.add(i); continue; } - GT_OreDictUnificator.registerOre( - this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ", ""), tStack); + GT_OreDictUnificator + .registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ", ""), tStack); } } } @@ -163,28 +158,28 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { for (int i = 0; i < Materials.values().length; i++) { Materials w = Materials.values()[i]; - if ((w == null) - || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 - && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) continue; + if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 + && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) + continue; else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) - && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; + && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) + continue; else if (hiddenThings.contains(i)) continue; aList.add(new ItemStack(this, 1, i)); } - if (hasList) - for (int i = 0; i < NoMetaValue.size(); i++) { - Materials w = NoMetaValue.get(i); - if ((w == null) - || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 - && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) continue; - else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) - || ((w.getFluid(1) == null && w.getGas(1) == null) - && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) - continue; - else if (hiddenThings.contains(i)) continue; - aList.add(new ItemStack(this, 1, i + 1001)); - } + if (hasList) for (int i = 0; i < NoMetaValue.size(); i++) { + Materials w = NoMetaValue.get(i); + if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 + && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) + continue; + else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) + || ((w.getFluid(1) == null && w.getGas(1) == null) + && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) + continue; + else if (hiddenThings.contains(i)) continue; + aList.add(new ItemStack(this, 1, i + 1001)); + } } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java index 5f0730b1a3..cc3f6d6611 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -1,37 +1,21 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; import java.util.List; import java.util.stream.Collectors; + import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; @@ -39,7 +23,18 @@ import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; + public class GTMetaItemEnhancer { + static List NoMetaValue; private GTMetaItemEnhancer() {} @@ -51,11 +46,10 @@ public class GTMetaItemEnhancer { for (int i = 0, valuesLength = values.length; i < valuesLength; i++) { Materials m = values[i]; if (m == null || m.mStandardMoltenFluid == null) continue; - final FluidContainerRegistry.FluidContainerData emptyData = - new FluidContainerRegistry.FluidContainerData( - m.getMolten(144), - new ItemStack(moltenCell, 1, i), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L)); + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( + m.getMolten(144), + new ItemStack(moltenCell, 1, i), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L)); FluidContainerRegistry.registerFluidContainer(emptyData); GT_Utility.addFluidContainerData(emptyData); GT_Values.RA.addFluidCannerRecipe( @@ -73,8 +67,7 @@ public class GTMetaItemEnhancer { if (!LoaderReference.Forestry) { return; } - NoMetaValue = Materials.getMaterialsMap().values().stream() - .filter(m -> m.mMetaItemSubID == -1) + NoMetaValue = Materials.getMaterialsMap().values().stream().filter(m -> m.mMetaItemSubID == -1) .collect(Collectors.toList()); Item moltenCapsuls = new BWGTMetaItems(WerkstoffLoader.capsuleMolten, null); Item capsuls = new BWGTMetaItems(OrePrefixes.capsule, NoMetaValue); @@ -84,11 +77,10 @@ public class GTMetaItemEnhancer { for (int i = 0, valuesLength = values.length; i < valuesLength; i++) { Materials m = values[i]; if (m.mStandardMoltenFluid != null && GT_OreDictUnificator.get(WerkstoffLoader.cellMolten, m, 1) != null) { - final FluidContainerRegistry.FluidContainerData emptyData = - new FluidContainerRegistry.FluidContainerData( - m.getMolten(144), - new ItemStack(moltenCapsuls, 1, i), - GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( + m.getMolten(144), + new ItemStack(moltenCapsuls, 1, i), + GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); FluidContainerRegistry.registerFluidContainer(emptyData); GT_Utility.addFluidContainerData(emptyData); GT_Values.RA.addFluidCannerRecipe( @@ -97,30 +89,35 @@ public class GTMetaItemEnhancer { m.getMolten(144), GT_Values.NF); GT_Values.RA.addFluidCannerRecipe( - new ItemStack(moltenCapsuls, 1, i), GT_Values.NI, GT_Values.NF, m.getMolten(144)); + new ItemStack(moltenCapsuls, 1, i), + GT_Values.NI, + GT_Values.NF, + m.getMolten(144)); } if (m.getFluid(1) == null && m.getGas(1) == null) continue; if (OreDictionary.doesOreNameExist("capsule" + m.mName)) continue; addFluidData(m, GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), capsuls, 1000, i, true); - // addFluidData(m, new ItemStack(Items.glass_bottle), bottles, 250, i, false); + // addFluidData(m, new ItemStack(Items.glass_bottle), bottles, 250, i, false); } for (int i = 0, valuesLength = NoMetaValue.size(); i < valuesLength; i++) { Materials m = NoMetaValue.get(i); if (m.getFluid(1) == null && m.getGas(1) == null) continue; if (OreDictionary.doesOreNameExist("capsule" + m.mName)) continue; addFluidData(m, GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), capsuls, 1000, i + 1001, true); - // addFluidData(m, new ItemStack(Items.glass_bottle), bottles, 250, i + 1001, false); + // addFluidData(m, new ItemStack(Items.glass_bottle), bottles, 250, i + 1001, false); } } private static void addFluidData(Materials m, ItemStack container, Item filled, int amount, int it, boolean empty) { Fluid f = m.getFluid(1) != null ? m.getFluid(1).getFluid() : m.getGas(1).getFluid(); final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( - new FluidStack(f, amount), new ItemStack(filled, 1, it), container); + new FluidStack(f, amount), + new ItemStack(filled, 1, it), + container); FluidContainerRegistry.registerFluidContainer(emptyData); GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe( - container, new ItemStack(filled, 1, it), new FluidStack(f, amount), GT_Values.NF); + GT_Values.RA + .addFluidCannerRecipe(container, new ItemStack(filled, 1, it), new FluidStack(f, amount), GT_Values.NF); GT_Values.RA.addFluidCannerRecipe( new ItemStack(filled, 1, it), empty ? GT_Values.NI : container, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java index 91596427b6..534a18476b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; @@ -25,12 +16,28 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; import static com.github.bartimaeusnek.bartworks.MainMod.MOD_ID; import static gregtech.api.enums.OrePrefixes.*; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.*; +import java.util.function.Consumer; +import java.util.function.Predicate; + +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +import org.apache.commons.lang3.reflect.FieldUtils; +import org.apache.commons.lang3.reflect.MethodUtils; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AfterLuVTierEnhacement; import com.github.bartimaeusnek.bartworks.util.BW_Util; + import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -39,18 +46,6 @@ import gregtech.api.util.*; import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.common.items.GT_MetaGenerated_Tool_01; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.*; -import java.util.function.Consumer; -import java.util.function.Predicate; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import org.apache.commons.lang3.reflect.FieldUtils; -import org.apache.commons.lang3.reflect.MethodUtils; @SuppressWarnings("ALL") public class LuVTierEnhancer implements Runnable { @@ -59,14 +54,18 @@ public class LuVTierEnhancer implements Runnable { static { addToBlackListForOsmiridiumReplacement(ItemList.Casing_MiningOsmiridium.get(1)); - addToBlackListForOsmiridiumReplacement(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - 170, 1, Materials.Osmiridium, Materials.Osmiridium, null)); - addToBlackListForOsmiridiumReplacement(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - 172, 1, Materials.Osmiridium, Materials.Osmiridium, null)); - addToBlackListForOsmiridiumReplacement(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - 174, 1, Materials.Osmiridium, Materials.Osmiridium, null)); - addToBlackListForOsmiridiumReplacement(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - 176, 1, Materials.Osmiridium, Materials.Osmiridium, null)); + addToBlackListForOsmiridiumReplacement( + GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(170, 1, Materials.Osmiridium, Materials.Osmiridium, null)); + addToBlackListForOsmiridiumReplacement( + GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(172, 1, Materials.Osmiridium, Materials.Osmiridium, null)); + addToBlackListForOsmiridiumReplacement( + GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(174, 1, Materials.Osmiridium, Materials.Osmiridium, null)); + addToBlackListForOsmiridiumReplacement( + GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(176, 1, Materials.Osmiridium, Materials.Osmiridium, null)); } public void run() { @@ -74,19 +73,17 @@ public class LuVTierEnhancer implements Runnable { List bufferedRecipeList = null; try { - bufferedRecipeList = - (List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true) - .get(null); + bufferedRecipeList = (List) FieldUtils + .getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null); } catch (IllegalAccessException e) { e.printStackTrace(); } HashSet LuVMachines = new HashSet<>(); LuVMachines.add(ItemRegistry.cal); - OrePrefixes[] LuVMaterialsGenerated = {dust, ingot, plate, stick, stickLong, rotor, plateDouble, plateDense}; + OrePrefixes[] LuVMaterialsGenerated = { dust, ingot, plate, stick, stickLong, rotor, plateDouble, plateDense }; - Arrays.stream(ItemList.values()) - .filter(item -> item.toString().contains("LuV") && item.hasBeenSet()) + Arrays.stream(ItemList.values()).filter(item -> item.toString().contains("LuV") && item.hasBeenSet()) .forEach(item -> LuVMachines.add(item.get(1))); if (LoaderReference.dreamcraft) { @@ -95,11 +92,10 @@ public class LuVTierEnhancer implements Runnable { GT_ModHandler.addCraftingRecipe( ItemList.Casing_LuV.get(1), - GT_ModHandler.RecipeBits.BUFFERED - | GT_ModHandler.RecipeBits.REVERSIBLE + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, - new Object[] {"PPP", "PwP", "PPP", 'P', WerkstoffLoader.LuVTierMaterial.get(plate)}); + new Object[] { "PPP", "PwP", "PPP", 'P', WerkstoffLoader.LuVTierMaterial.get(plate) }); replaceAllRecipes(LuVMachines, LuVMaterialsGenerated, bufferedRecipeList); @@ -113,8 +109,8 @@ public class LuVTierEnhancer implements Runnable { blackListForOsmiridium.add(stack); } - private static void replaceAllRecipes( - Collection LuVMachines, OrePrefixes[] LuVMaterialsGenerated, List bufferedRecipeList) { + private static void replaceAllRecipes(Collection LuVMachines, OrePrefixes[] LuVMaterialsGenerated, + List bufferedRecipeList) { LuVTierEnhancer.replaceOsmiridiumInLuVRecipes(); for (GT_Recipe_AssemblyLine sAssemblylineRecipe : GT_Recipe_AssemblyLine.sAssemblylineRecipes) { @@ -143,8 +139,7 @@ public class LuVTierEnhancer implements Runnable { Class customItemListClass = Class.forName("com.dreammaster.gthandler.CustomItemList"); Method hasnotBeenSet = MethodUtils.getAccessibleMethod(customItemListClass, "hasBeenSet"); Method get = MethodUtils.getAccessibleMethod(customItemListClass, "get", long.class, Object[].class); - for (Enum customItemList : (Enum[]) - FieldUtils.getField(customItemListClass, "$VALUES", true).get(null)) { + for (Enum customItemList : (Enum[]) FieldUtils.getField(customItemListClass, "$VALUES", true).get(null)) { if (customItemList.toString().contains("LuV") && (boolean) hasnotBeenSet.invoke(customItemList)) LuVMachines.add((ItemStack) get.invoke(customItemList, 1, new Object[0])); } @@ -153,8 +148,8 @@ public class LuVTierEnhancer implements Runnable { } } - private static void rewriteCraftingRecipes( - List bufferedRecipeList, OrePrefixes[] LuVMaterialsGenerated, Predicate recipeFilter) { + private static void rewriteCraftingRecipes(List bufferedRecipeList, OrePrefixes[] LuVMaterialsGenerated, + Predicate recipeFilter) { for (OrePrefixes prefixes : LuVMaterialsGenerated) { Consumer recipeAction = obj -> LuVTierEnhancer.doStacksContainAndReplace( @@ -164,9 +159,7 @@ public class LuVTierEnhancer implements Runnable { true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - CraftingManager.getInstance().getRecipeList().stream() - .filter(recipeFilter) - .forEach(recipeAction); + CraftingManager.getInstance().getRecipeList().stream().filter(recipeFilter).forEach(recipeAction); bufferedRecipeList.stream().filter(recipeFilter).forEach(recipeAction); } } @@ -230,8 +223,8 @@ public class LuVTierEnhancer implements Runnable { } } - private static void rewriteAsslineRecipes( - ItemStack stack, OrePrefixes[] LuVMaterialsGenerated, GT_Recipe.GT_Recipe_AssemblyLine recipe) { + private static void rewriteAsslineRecipes(ItemStack stack, OrePrefixes[] LuVMaterialsGenerated, + GT_Recipe.GT_Recipe_AssemblyLine recipe) { for (OrePrefixes prefixes : LuVMaterialsGenerated) { if (LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, stack, false)) { LuVTierEnhancer.doStacksContainAndReplace( @@ -242,12 +235,12 @@ public class LuVTierEnhancer implements Runnable { WerkstoffLoader.LuVTierMaterial.get(prefixes)); LuVTierEnhancer.doStacksContainAndReplace( recipe, - new Object[] {recipe.mOutput}, + new Object[] { recipe.mOutput }, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); } - if (LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[] {recipe.mOutput}, stack, false)) { + if (LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[] { recipe.mOutput }, stack, false)) { LuVTierEnhancer.doStacksContainAndReplace( recipe, recipe.mInputs, @@ -256,7 +249,7 @@ public class LuVTierEnhancer implements Runnable { WerkstoffLoader.LuVTierMaterial.get(prefixes)); LuVTierEnhancer.doStacksContainAndReplace( recipe, - new Object[] {recipe.mOutput}, + new Object[] { recipe.mOutput }, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); @@ -270,7 +263,7 @@ public class LuVTierEnhancer implements Runnable { true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); } - if (LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[] {recipe.mOutput}, stack, false)) { + if (LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[] { recipe.mOutput }, stack, false)) { LuVTierEnhancer.doStacksContainAndReplace( recipe, recipe.mFluidInputs, @@ -281,21 +274,25 @@ public class LuVTierEnhancer implements Runnable { } private static void replaceOsmiridiumInLuVRecipes() { - Consumer replace = gt_recipe -> gt_recipe.mInputs = - replaceArrayWith(gt_recipe.mInputs, Materials.Osmiridium, WerkstoffLoader.Ruridit, gt_recipe); + Consumer replace = gt_recipe -> gt_recipe.mInputs = replaceArrayWith( + gt_recipe.mInputs, + Materials.Osmiridium, + WerkstoffLoader.Ruridit, + gt_recipe); GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.stream() - .filter(recipe_assemblyLine -> recipe_assemblyLine.mEUt <= 6000) - .forEach(recipe_assemblyLine -> recipe_assemblyLine.mInputs = replaceArrayWith( - recipe_assemblyLine.mInputs, - Materials.Osmiridium, - WerkstoffLoader.Ruridit, - recipe_assemblyLine)); + .filter(recipe_assemblyLine -> recipe_assemblyLine.mEUt <= 6000).forEach( + recipe_assemblyLine -> recipe_assemblyLine.mInputs = replaceArrayWith( + recipe_assemblyLine.mInputs, + Materials.Osmiridium, + WerkstoffLoader.Ruridit, + recipe_assemblyLine)); GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList.stream() - .filter(gt_recipe -> gt_recipe.mEUt < BW_Util.getTierVoltage(6) - && !BW_Util.checkStackAndPrefix(gt_recipe.mOutputs[0]) - && !isOutputBlackListed(gt_recipe.mOutputs[0])) + .filter( + gt_recipe -> gt_recipe.mEUt < BW_Util.getTierVoltage(6) + && !BW_Util.checkStackAndPrefix(gt_recipe.mOutputs[0]) + && !isOutputBlackListed(gt_recipe.mOutputs[0])) .forEach(replace); GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.stream() @@ -308,8 +305,8 @@ public class LuVTierEnhancer implements Runnable { return false; } - private static ItemStack[] replaceArrayWith( - ItemStack[] stackArray, Materials source, Werkstoff target, Object recipe) { + private static ItemStack[] replaceArrayWith(ItemStack[] stackArray, Materials source, Werkstoff target, + Object recipe) { boolean replaced = false; for (int i = 0; i < stackArray.length; i++) { ItemStack stack = stackArray[i]; @@ -334,17 +331,16 @@ public class LuVTierEnhancer implements Runnable { return stack; } - private static boolean doStacksContainAndReplace( - Object recipe, FluidStack[] stacks, FluidStack stack, boolean replace, Fluid... replacement) { + private static boolean doStacksContainAndReplace(Object recipe, FluidStack[] stacks, FluidStack stack, + boolean replace, Fluid... replacement) { boolean replaced = false; for (int i = 0; i < stacks.length; i++) { - if (GT_Utility.areFluidsEqual(stack, stacks[i])) - if (!replace) return true; - else { - int amount = stacks[i].amount; - stacks[i] = new FluidStack(replacement[0], amount); - replaced = true; - } + if (GT_Utility.areFluidsEqual(stack, stacks[i])) if (!replace) return true; + else { + int amount = stacks[i].amount; + stacks[i] = new FluidStack(replacement[0], amount); + replaced = true; + } } if (replace && replaced) { if (recipe instanceof GT_Recipe) { @@ -356,8 +352,8 @@ public class LuVTierEnhancer implements Runnable { return replaced; } - private static boolean doStacksContainAndReplace( - Object recipe, Object[] stacks, ItemStack stack, boolean replace, ItemStack... replacement) { + private static boolean doStacksContainAndReplace(Object recipe, Object[] stacks, ItemStack stack, boolean replace, + ItemStack... replacement) { boolean replaced = false; for (int i = 0; i < stacks.length; i++) { if (!GT_Utility.isStackValid(stacks[i])) { @@ -372,13 +368,12 @@ public class LuVTierEnhancer implements Runnable { } } else continue; - } else if (GT_Utility.areStacksEqual(stack, (ItemStack) stacks[i], true)) - if (!replace) return true; - else { - int amount = ((ItemStack) stacks[i]).stackSize; - stacks[i] = BW_Util.setStackSize(replacement[0], amount); - replaced = true; - } + } else if (GT_Utility.areStacksEqual(stack, (ItemStack) stacks[i], true)) if (!replace) return true; + else { + int amount = ((ItemStack) stacks[i]).stackSize; + stacks[i] = BW_Util.setStackSize(replacement[0], amount); + replaced = true; + } } if (replace && replaced) { if (recipe instanceof GT_Recipe) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 92c6dc696c..1f09532556 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; @@ -25,6 +16,18 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; import static gregtech.api.enums.OrePrefixes.*; +import java.lang.reflect.Field; +import java.util.*; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.*; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; + +import org.apache.commons.lang3.reflect.FieldUtils; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; @@ -32,6 +35,7 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.CachedReflectionUtils; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; + import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -47,28 +51,14 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Block_Ores_Abstract; -import java.lang.reflect.Field; -import java.util.*; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.*; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; -import org.apache.commons.lang3.reflect.FieldUtils; public class PlatinumSludgeOverHaul { - private static final Materials[] BLACKLIST = { - Materials.HSSS, - Materials.EnderiumBase, - Materials.Osmiridium, - Materials.get("Uraniumtriplatinid"), - Materials.get("Tetranaquadahdiindiumhexaplatiumosminid"), - Materials.get("Longasssuperconductornameforuvwire"), - }; - private static final OrePrefixes[] OPBLACKLIST = { - crushedCentrifuged, crushed, crushedPurified, dustPure, dustImpure, dustRefined, dust, dustTiny, dustSmall - }; + + private static final Materials[] BLACKLIST = { Materials.HSSS, Materials.EnderiumBase, Materials.Osmiridium, + Materials.get("Uraniumtriplatinid"), Materials.get("Tetranaquadahdiindiumhexaplatiumosminid"), + Materials.get("Longasssuperconductornameforuvwire"), }; + private static final OrePrefixes[] OPBLACKLIST = { crushedCentrifuged, crushed, crushedPurified, dustPure, + dustImpure, dustRefined, dust, dustTiny, dustSmall }; private PlatinumSludgeOverHaul() {} @@ -194,57 +184,55 @@ public class PlatinumSludgeOverHaul { 15); // base sollution - for (Werkstoff w : Werkstoff.werkstoffHashSet) - if (w.containsStuff(Materials.Sulfur) - && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { - GT_Values.RA.addChemicalRecipe( - w.get(crushedPurified), - GT_Utility.getIntegratedCircuit(1), - AquaRegia.getFluidOrGas(150), - PTConcentrate.getFluidOrGas(150), - null, - 250); - GT_Values.RA.addChemicalRecipe( - w.get(crushedPurified, 9), - GT_Utility.getIntegratedCircuit(9), - AquaRegia.getFluidOrGas(1350), - PTConcentrate.getFluidOrGas(1350), - null, - 2250); - GT_Values.RA.addChemicalRecipe( - w.get(crushedPurified, 9), - PTMetallicPowder.get(dust, 9), - AquaRegia.getFluidOrGas(10350), - PTConcentrate.getFluidOrGas(10350), - PTResidue.get(dust), - 2250); - } - for (Materials m : Materials.values()) - if (PlatinumSludgeOverHaul.materialsContains(m, Materials.Sulfur) - && (PlatinumSludgeOverHaul.materialsContains(m, Materials.Copper) - || PlatinumSludgeOverHaul.materialsContains(m, Materials.Nickel))) { - GT_Values.RA.addChemicalRecipe( - GT_OreDictUnificator.get(crushedPurified, m, 1), - GT_Utility.getIntegratedCircuit(1), - AquaRegia.getFluidOrGas(150), - PTConcentrate.getFluidOrGas(150), - null, - 250); - GT_Values.RA.addChemicalRecipe( - GT_OreDictUnificator.get(crushedPurified, m, 9), - GT_Utility.getIntegratedCircuit(9), - AquaRegia.getFluidOrGas(1350), - PTConcentrate.getFluidOrGas(1350), - null, - 2250); - GT_Values.RA.addChemicalRecipe( - GT_OreDictUnificator.get(crushedPurified, m, 9), - PTMetallicPowder.get(dust, 9), - AquaRegia.getFluidOrGas(10350), - PTConcentrate.getFluidOrGas(10350), - PTResidue.get(dust), - 2250); - } + for (Werkstoff w : Werkstoff.werkstoffHashSet) if (w.containsStuff(Materials.Sulfur) + && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { + GT_Values.RA.addChemicalRecipe( + w.get(crushedPurified), + GT_Utility.getIntegratedCircuit(1), + AquaRegia.getFluidOrGas(150), + PTConcentrate.getFluidOrGas(150), + null, + 250); + GT_Values.RA.addChemicalRecipe( + w.get(crushedPurified, 9), + GT_Utility.getIntegratedCircuit(9), + AquaRegia.getFluidOrGas(1350), + PTConcentrate.getFluidOrGas(1350), + null, + 2250); + GT_Values.RA.addChemicalRecipe( + w.get(crushedPurified, 9), + PTMetallicPowder.get(dust, 9), + AquaRegia.getFluidOrGas(10350), + PTConcentrate.getFluidOrGas(10350), + PTResidue.get(dust), + 2250); + } + for (Materials m : Materials.values()) if (PlatinumSludgeOverHaul.materialsContains(m, Materials.Sulfur) + && (PlatinumSludgeOverHaul.materialsContains(m, Materials.Copper) + || PlatinumSludgeOverHaul.materialsContains(m, Materials.Nickel))) { + GT_Values.RA.addChemicalRecipe( + GT_OreDictUnificator.get(crushedPurified, m, 1), + GT_Utility.getIntegratedCircuit(1), + AquaRegia.getFluidOrGas(150), + PTConcentrate.getFluidOrGas(150), + null, + 250); + GT_Values.RA.addChemicalRecipe( + GT_OreDictUnificator.get(crushedPurified, m, 9), + GT_Utility.getIntegratedCircuit(9), + AquaRegia.getFluidOrGas(1350), + PTConcentrate.getFluidOrGas(1350), + null, + 2250); + GT_Values.RA.addChemicalRecipe( + GT_OreDictUnificator.get(crushedPurified, m, 9), + PTMetallicPowder.get(dust, 9), + AquaRegia.getFluidOrGas(10350), + PTConcentrate.getFluidOrGas(10350), + PTResidue.get(dust), + 2250); + } // Pt GT_Values.RA.addBlastRecipe( PTMetallicPowder.get(dust, 3), @@ -286,43 +274,27 @@ public class PlatinumSludgeOverHaul { 1200, 30); GT_Values.RA.addMultiblockChemicalRecipe( - new ItemStack[] {GT_Utility.getIntegratedCircuit(1)}, - new FluidStack[] {PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(400)}, - new FluidStack[] { - PDAmmonia.getFluidOrGas(400), - Materials.NitrogenDioxide.getGas(1000), - Materials.DilutedSulfuricAcid.getFluid(1000) - }, - new ItemStack[] {PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny, 4)}, + new ItemStack[] { GT_Utility.getIntegratedCircuit(1) }, + new FluidStack[] { PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(400) }, + new FluidStack[] { PDAmmonia.getFluidOrGas(400), Materials.NitrogenDioxide.getGas(1000), + Materials.DilutedSulfuricAcid.getFluid(1000) }, + new ItemStack[] { PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny, 4) }, 1200, 30); GT_Values.RA.addMultiblockChemicalRecipe( - new ItemStack[] {GT_Utility.getIntegratedCircuit(2)}, - new FluidStack[] {PTConcentrate.getFluidOrGas(18000), AmmoniumChloride.getFluidOrGas(3600)}, - new FluidStack[] { - PDAmmonia.getFluidOrGas(3600), - Materials.NitrogenDioxide.getGas(9000), - Materials.DilutedSulfuricAcid.getFluid(9000) - }, - new ItemStack[] {PTSaltCrude.get(dust, 16), PTRawPowder.get(dust, 4)}, + new ItemStack[] { GT_Utility.getIntegratedCircuit(2) }, + new FluidStack[] { PTConcentrate.getFluidOrGas(18000), AmmoniumChloride.getFluidOrGas(3600) }, + new FluidStack[] { PDAmmonia.getFluidOrGas(3600), Materials.NitrogenDioxide.getGas(9000), + Materials.DilutedSulfuricAcid.getFluid(9000) }, + new ItemStack[] { PTSaltCrude.get(dust, 16), PTRawPowder.get(dust, 4) }, 1400, 240); GT_Values.RA.addSifterRecipe( PTSaltCrude.get(dust), - new ItemStack[] { - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - }, - new int[] { - 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, - }, + new ItemStack[] { PTSaltRefined.get(dust), PTSaltRefined.get(dust), PTSaltRefined.get(dust), + PTSaltRefined.get(dust), PTSaltRefined.get(dust), PTSaltRefined.get(dust), + PTSaltRefined.get(dust), PTSaltRefined.get(dust), PTSaltRefined.get(dust), }, + new int[] { 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, }, 600, 30); GT_Values.RA.addBlastRecipe( @@ -369,23 +341,18 @@ public class PlatinumSludgeOverHaul { PDRawPowder.get(dust, 2), 2250); GT_Values.RA.addChemicalRecipe( - GT_Utility.getIntegratedCircuit(2), null, PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dust), 250); + GT_Utility.getIntegratedCircuit(2), + null, + PDAmmonia.getFluidOrGas(1000), + null, + PDSalt.get(dust), + 250); GT_Values.RA.addSifterRecipe( PDSalt.get(dust), - new ItemStack[] { - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - }, - new int[] { - 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, - }, + new ItemStack[] { PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), }, + new int[] { 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, }, 600, 30); GT_Values.RA.addChemicalRecipeForBasicMachineOnly( @@ -398,12 +365,11 @@ public class PlatinumSludgeOverHaul { 250, 30); GT_Values.RA.addMultiblockChemicalRecipe( - new ItemStack[] {PDRawPowder.get(dust, 4)}, - new FluidStack[] {FormicAcid.getFluidOrGas(4000)}, - new FluidStack[] { - Materials.Ammonia.getGas(4000), Materials.Ethylene.getGas(1000), Materials.Water.getFluid(1000) - }, - new ItemStack[] {Materials.Palladium.getDust(2)}, + new ItemStack[] { PDRawPowder.get(dust, 4) }, + new FluidStack[] { FormicAcid.getFluidOrGas(4000) }, + new FluidStack[] { Materials.Ammonia.getGas(4000), Materials.Ethylene.getGas(1000), + Materials.Water.getFluid(1000) }, + new ItemStack[] { Materials.Palladium.getDust(2) }, 250, 30); // Na2SO4 + 2H = 2Na + H2SO4 @@ -463,7 +429,7 @@ public class PlatinumSludgeOverHaul { 480); GT_Values.RA.addDistillationTowerRecipe( HotRutheniumTetroxideSollution.getFluidOrGas(9000), - new FluidStack[] {Materials.Water.getFluid(1800), RutheniumTetroxide.getFluidOrGas(7200)}, + new FluidStack[] { Materials.Water.getFluid(1800), RutheniumTetroxide.getFluidOrGas(7200) }, Materials.Salt.getDust(6), 1500, 480); @@ -489,7 +455,7 @@ public class PlatinumSludgeOverHaul { 775); GT_Values.RA.addDistillationTowerRecipe( AcidicOsmiumSolution.getFluidOrGas(1000), - new FluidStack[] {OsmiumSolution.getFluidOrGas(100), Materials.Water.getFluid(900)}, + new FluidStack[] { OsmiumSolution.getFluidOrGas(100), Materials.Water.getFluid(900) }, null, 150, BW_Util.getMachineVoltageFromTier(5)); @@ -550,10 +516,10 @@ public class PlatinumSludgeOverHaul { 300, 30); GT_Values.RA.addMultiblockChemicalRecipe( - new ItemStack[] {GT_Utility.getIntegratedCircuit(3)}, - new FluidStack[] {Materials.Water.getFluid(36000), RHSulfate.getFluidOrGas(39600)}, - new FluidStack[] {Materials.Potassium.getMolten(7200), RHSulfateSolution.getFluidOrGas(39600)}, - new ItemStack[] {LeachResidue.get(dust, 4)}, + new ItemStack[] { GT_Utility.getIntegratedCircuit(3) }, + new FluidStack[] { Materials.Water.getFluid(36000), RHSulfate.getFluidOrGas(39600) }, + new FluidStack[] { Materials.Potassium.getMolten(7200), RHSulfateSolution.getFluidOrGas(39600) }, + new ItemStack[] { LeachResidue.get(dust, 4) }, 1200, 30); @@ -604,20 +570,10 @@ public class PlatinumSludgeOverHaul { 60); GT_Values.RA.addSifterRecipe( RHNitrate.get(dust), - new ItemStack[] { - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - }, - new int[] { - 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, - }, + new ItemStack[] { RhFilterCake.get(dust), RhFilterCake.get(dust), RhFilterCake.get(dust), + RhFilterCake.get(dust), RhFilterCake.get(dust), RhFilterCake.get(dust), RhFilterCake.get(dust), + RhFilterCake.get(dust), RhFilterCake.get(dust), }, + new int[] { 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, }, 600, 30); GT_Values.RA.addMixerRecipe( @@ -654,7 +610,7 @@ public class PlatinumSludgeOverHaul { return false; } - @SuppressWarnings({"unchecked", "rawtypes"}) + @SuppressWarnings({ "unchecked", "rawtypes" }) public static void replacePureElements() { // furnace for (Object entry : FurnaceRecipes.smelting().getSmeltingList().entrySet()) { @@ -666,72 +622,79 @@ public class PlatinumSludgeOverHaul { || !association.mMaterial.mMaterial.equals(Materials.Platinum)) if (GT_Utility.isStackValid(realEntry.getValue()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())) { - ItemData ass = GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()); - if (ass.mMaterial.mMaterial.equals(Materials.Platinum)) - if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) - realEntry.setValue(PTMetallicPowder.get( - ass.mPrefix == nugget ? dustTiny : dust, - ((ItemStack) realEntry.getValue()).stackSize * 2)); - else if (ass.mMaterial.mMaterial.equals(Materials.Palladium)) - if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) - realEntry.setValue(PDMetallicPowder.get( - ass.mPrefix == nugget ? dustTiny : dust, - ((ItemStack) realEntry.getValue()).stackSize * 2)); - } + ItemData ass = GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()); + if (ass.mMaterial.mMaterial.equals(Materials.Platinum)) + if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) + realEntry.setValue( + PTMetallicPowder.get( + ass.mPrefix == nugget ? dustTiny : dust, + ((ItemStack) realEntry.getValue()).stackSize * 2)); + else if (ass.mMaterial.mMaterial.equals(Materials.Palladium)) + if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) + realEntry.setValue( + PDMetallicPowder.get( + ass.mPrefix == nugget ? dustTiny : dust, + ((ItemStack) realEntry.getValue()).stackSize * 2)); + } } } // vanilla crafting CraftingManager.getInstance().getRecipeList().forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); // gt crafting try { - ((List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true) - .get(null)) + ((List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null)) .forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); } catch (IllegalAccessException e) { e.printStackTrace(); } // gt machines - maploop: - for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - if (map == GT_Recipe.GT_Recipe_Map.sFusionRecipes - || map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes - || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes) continue; + maploop: for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + if (map == GT_Recipe.GT_Recipe_Map.sFusionRecipes || map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes + || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes) + continue; HashSet toDel = new HashSet<>(); - recipeloop: - for (GT_Recipe recipe : map.mRecipeList) { + recipeloop: for (GT_Recipe recipe : map.mRecipeList) { if (recipe.mFakeRecipe) continue maploop; for (int i = 0; i < recipe.mFluidOutputs.length; i++) { if (map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes)) continue maploop; else if (map.equals(GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sChemicalRecipes)) { - if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) { - recipe.mFluidOutputs[i] = AcidicIridiumSolution.getFluidOrGas(1000); - recipe.reloadOwner(); - } else if (GT_Utility.areFluidsEqual( - Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) { - recipe.mFluidOutputs[i] = PTConcentrate.getFluidOrGas(1000); - recipe.reloadOwner(); - } else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) { - recipe.mFluidOutputs[i] = AcidicOsmiumSolution.getFluidOrGas(1000); - recipe.reloadOwner(); - } - } else { - if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - } + if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility + .areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) { + recipe.mFluidOutputs[i] = AcidicIridiumSolution.getFluidOrGas(1000); + recipe.reloadOwner(); + } else + if (GT_Utility + .areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) { + recipe.mFluidOutputs[i] = PTConcentrate.getFluidOrGas(1000); + recipe.reloadOwner(); + } else + if (GT_Utility.areFluidsEqual( + Materials.Osmium.getMolten(1), + recipe.mFluidOutputs[i])) { + recipe.mFluidOutputs[i] = AcidicOsmiumSolution.getFluidOrGas(1000); + recipe.reloadOwner(); + } + } else { + if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility + .areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility + .areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility + .areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + } } for (int i = 0; i < recipe.mOutputs.length; i++) { if (!GT_Utility.isStackValid(recipe.mOutputs[i])) continue; @@ -759,135 +722,112 @@ public class PlatinumSludgeOverHaul { } if (!BW_Util.checkStackAndPrefix(recipe.mOutputs[i])) continue; // Pt - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mMaterial - .mMaterial + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial .equals(Materials.Platinum)) { for (int j = 0; j < recipe.mInputs.length; j++) { if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dust) - || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dustImpure) - || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dustPure)) { + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dust), amount * 2); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dustSmall)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dustSmall), amount * 2); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dustTiny)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dustTiny), amount * 2); recipe.reloadOwner(); } - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mMaterial - .mMaterial + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial .equals(Materials.Palladium)) { - for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; - } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dust) - || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dustImpure) - || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dustPure)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dust), amount * 4); - recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dustSmall)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dustSmall), amount * 4); - recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dustTiny)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dustTiny), amount * 4); - recipe.reloadOwner(); - } - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mMaterial - .mMaterial - .equals(Materials.Osmium)) { - for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; - } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dust) - || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dustImpure) - || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dustPure)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dust), amount); - recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dustSmall)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dustSmall), amount); - recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dustTiny)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dustTiny), amount); - recipe.reloadOwner(); - } - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mMaterial - .mMaterial - .equals(Materials.Iridium)) { - for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; - } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dust) - || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dustImpure) - || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dustPure)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dust), amount); - recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dustSmall)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dustSmall), amount); - recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) - .mPrefix - .equals(dustTiny)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dustTiny), amount); - recipe.reloadOwner(); - } - } + for (int j = 0; j < recipe.mInputs.length; j++) { + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; + } + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix + .equals(dustImpure) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix + .equals(dustPure)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dust), amount * 4); + recipe.reloadOwner(); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix + .equals(dustSmall)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = BW_Util + .setStackSize(PDMetallicPowder.get(dustSmall), amount * 4); + recipe.reloadOwner(); + } else + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix + .equals(dustTiny)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = BW_Util + .setStackSize(PDMetallicPowder.get(dustTiny), amount * 4); + recipe.reloadOwner(); + } + } else + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial + .equals(Materials.Osmium)) { + for (int j = 0; j < recipe.mInputs.length; j++) { + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + } + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix + .equals(dustImpure) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix + .equals(dustPure)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dust), amount); + recipe.reloadOwner(); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix + .equals(dustSmall)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = BW_Util + .setStackSize(IrOsLeachResidue.get(dustSmall), amount); + recipe.reloadOwner(); + } else + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix + .equals(dustTiny)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = BW_Util + .setStackSize(IrOsLeachResidue.get(dustTiny), amount); + recipe.reloadOwner(); + } + } else + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial + .equals(Materials.Iridium)) { + for (int j = 0; j < recipe.mInputs.length; j++) { + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) + continue recipeloop; + } + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix + .equals(dustImpure) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix + .equals(dustPure)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dust), amount); + recipe.reloadOwner(); + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix + .equals(dustSmall)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = BW_Util + .setStackSize(IrLeachResidue.get(dustSmall), amount); + recipe.reloadOwner(); + } else + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix + .equals(dustTiny)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = BW_Util + .setStackSize(IrLeachResidue.get(dustTiny), amount); + recipe.reloadOwner(); + } + } } } map.mRecipeList.removeAll(toDel); @@ -936,10 +876,8 @@ public class PlatinumSludgeOverHaul { inputItemName = "recipeItems"; } else if (LoaderReference.miscutils) { try { - if (Class.forName("gtPlusPlus.api.objects.minecraft.ShapedRecipe") - .isAssignableFrom(obj.getClass())) - obj = CachedReflectionUtils.getField(obj.getClass(), "mRecipe") - .get(obj); + if (Class.forName("gtPlusPlus.api.objects.minecraft.ShapedRecipe").isAssignableFrom(obj.getClass())) + obj = CachedReflectionUtils.getField(obj.getClass(), "mRecipe").get(obj); } catch (ClassNotFoundException | IllegalAccessException e) { e.printStackTrace(); } @@ -995,7 +933,7 @@ public class PlatinumSludgeOverHaul { } } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) private static boolean checkRecipe(Object input, Materials mat) { if (input instanceof List || input instanceof Object[]) { Set lists = new HashSet(), stacks = new HashSet(); @@ -1026,10 +964,7 @@ public class PlatinumSludgeOverHaul { for (Object stack : stacks) { if (stack instanceof ItemStack) { allSame = BW_Util.checkStackAndPrefix((ItemStack) stack) - && GT_OreDictUnificator.getAssociation((ItemStack) stack) - .mMaterial - .mMaterial - .equals(mat); + && GT_OreDictUnificator.getAssociation((ItemStack) stack).mMaterial.mMaterial.equals(mat); } else { allSame = false; break; @@ -1052,20 +987,21 @@ public class PlatinumSludgeOverHaul { if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals("dreamcraft") && !stack.getUnlocalizedName().contains("dust") - && !stack.getUnlocalizedName().contains("Dust")) return true; + && !stack.getUnlocalizedName().contains("Dust")) + return true; if (Block.getBlockFromItem(stack.getItem()) instanceof GT_Generic_Block - && !(Block.getBlockFromItem(stack.getItem()) instanceof GT_Block_Ores_Abstract)) return true; + && !(Block.getBlockFromItem(stack.getItem()) instanceof GT_Block_Ores_Abstract)) + return true; - if (Arrays.stream(ItemList.values()) - .filter(ItemList::hasBeenSet) + if (Arrays.stream(ItemList.values()).filter(ItemList::hasBeenSet) .anyMatch(e -> !BW_Util.checkStackAndPrefix(stack) && GT_Utility.areStacksEqual(e.get(1), stack, true))) return true; if (stack.getItem() instanceof GT_Generic_Item) { if (!BW_Util.checkStackAndPrefix(stack)) return false; return (!Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST) - .contains(GT_OreDictUnificator.getAssociation(stack).mPrefix)) + .contains(GT_OreDictUnificator.getAssociation(stack).mPrefix)) || Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST) .contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); } @@ -1073,12 +1009,13 @@ public class PlatinumSludgeOverHaul { if (LoaderReference.miscutils) { try { if (Class.forName("gtPlusPlus.core.item.base.BaseItemComponent") - .isAssignableFrom(stack.getItem().getClass()) + .isAssignableFrom(stack.getItem().getClass()) && !(stack.getUnlocalizedName().contains("dust") - || stack.getUnlocalizedName().contains("Dust"))) return true; + || stack.getUnlocalizedName().contains("Dust"))) + return true; if (Class.forName("gtPlusPlus.core.block.base.BlockBaseModular") - .isAssignableFrom( - Block.getBlockFromItem(stack.getItem()).getClass())) return true; + .isAssignableFrom(Block.getBlockFromItem(stack.getItem()).getClass())) + return true; } catch (ClassNotFoundException e) { e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 9de2ff0549..779183e439 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; @@ -25,6 +16,13 @@ package com.github.bartimaeusnek.bartworks.system.material; import static net.minecraft.util.EnumChatFormatting.DARK_PURPLE; import static net.minecraft.util.EnumChatFormatting.GREEN; +import java.lang.reflect.InvocationTargetException; +import java.nio.ByteBuffer; +import java.util.*; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.StaticRecipeChangeLoaders; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; @@ -32,6 +30,7 @@ import com.github.bartimaeusnek.bartworks.util.*; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.github.bartimaeusnek.crossmod.tgregworks.MaterialsInjector; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; + import cpw.mods.fml.common.Loader; import gregtech.api.GregTech_API; import gregtech.api.enums.*; @@ -39,11 +38,6 @@ import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; -import java.lang.reflect.InvocationTargetException; -import java.nio.ByteBuffer; -import java.util.*; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; @SuppressWarnings("ALL") public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @@ -53,19 +47,20 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static final LinkedHashMap werkstoffNameHashMap = new LinkedHashMap<>(); public static final Map modNameOverrides = new HashMap() { + { put("GalaxySpace", DARK_PURPLE + "GalaxySpace"); } }; - private static final List BWModNames = - Arrays.asList(MainMod.NAME, BartWorksCrossmod.NAME, MaterialsInjector.NAME); + private static final List BWModNames = Arrays + .asList(MainMod.NAME, BartWorksCrossmod.NAME, MaterialsInjector.NAME); private static final HashSet idHashSet = new HashSet<>(); private static final Werkstoff.Stats DEFAULT_NULL_STATS = new Werkstoff.Stats(); - private static final Werkstoff.GenerationFeatures DEFAULT_NULL_GENERATION_FEATURES = - new Werkstoff.GenerationFeatures().disable(); + private static final Werkstoff.GenerationFeatures DEFAULT_NULL_GENERATION_FEATURES = new Werkstoff.GenerationFeatures() + .disable(); public static Werkstoff default_null_Werkstoff; private final HashSet ADDITIONAL_OREDICT = new HashSet<>(); @@ -106,10 +101,11 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { /** * GT Materials Bridge Constructor - * @param materials a GT Materials + * + * @param materials a GT Materials * @param generationFeatures the new Types you want to add - * @param type - self explainatory - * @param mID > 31_766 && <= 32_767 + * @param type - self explainatory + * @param mID > 31_766 && <= 32_767 */ public Werkstoff(Materials materials, Werkstoff.GenerationFeatures generationFeatures, Types type, int mID) { this( @@ -143,14 +139,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } } - public Werkstoff( - short[] rgba, - String defaultName, - Werkstoff.Types type, - int meltingpoint, - Werkstoff.GenerationFeatures generationFeatures, - int mID, - TextureSet texSet, + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint, + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { this( rgba, @@ -163,13 +153,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { contents); } - public Werkstoff( - short[] rgba, - String defaultName, - Werkstoff.Types type, - Werkstoff.GenerationFeatures generationFeatures, - int mID, - TextureSet texSet, + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { this( rgba, @@ -182,16 +167,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { contents); } - public Werkstoff( - short[] rgba, - String defaultName, - Werkstoff.Types type, - int meltingpoint, - Werkstoff.GenerationFeatures generationFeatures, - int mID, - TextureSet texSet, - List oreByProduct, - Pair... contents) { + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint, + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, + List oreByProduct, Pair... contents) { this( rgba, defaultName, @@ -204,15 +182,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { contents); } - public Werkstoff( - short[] rgba, - String defaultName, - Werkstoff.Types type, - Werkstoff.GenerationFeatures generationFeatures, - int mID, - TextureSet texSet, - List oreByProduct, - Pair... contents) { + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, + List oreByProduct, Pair... contents) { this( rgba, defaultName, @@ -225,16 +197,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { contents); } - public Werkstoff( - short[] rgba, - String toolTip, - String defaultName, - Werkstoff.Types type, - Werkstoff.GenerationFeatures generationFeatures, - int mID, - TextureSet texSet, - List oreByProduct, - Pair... contents) { + public Werkstoff(short[] rgba, String toolTip, String defaultName, Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, + List oreByProduct, Pair... contents) { this( rgba, toolTip, @@ -248,58 +213,30 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { contents); } - public Werkstoff( - short[] rgba, - String defaultName, - Werkstoff.Stats stats, - Werkstoff.Types type, - Werkstoff.GenerationFeatures generationFeatures, - int mID, - TextureSet texSet, - List oreByProduct, - Pair... contents) { + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, + List oreByProduct, Pair... contents) { this(rgba, defaultName, "", stats, type, generationFeatures, mID, texSet, contents); this.mOreByProducts.clear(); this.mOreByProducts.addAll(oreByProduct); } - public Werkstoff( - short[] rgba, - String defaultName, - Werkstoff.Stats stats, - Werkstoff.Types type, - Werkstoff.GenerationFeatures generationFeatures, - int mID, - TextureSet texSet, + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { this(rgba, defaultName, "", stats, type, generationFeatures, mID, texSet, contents); } - public Werkstoff( - short[] rgba, - String defaultName, - String toolTip, - Werkstoff.Stats stats, - Werkstoff.Types type, - Werkstoff.GenerationFeatures generationFeatures, - int mID, - TextureSet texSet, - List oreByProduct, - Pair... contents) { + public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, + List oreByProduct, Pair... contents) { this(rgba, defaultName, toolTip, stats, type, generationFeatures, mID, texSet, contents); this.mOreByProducts.clear(); this.mOreByProducts.addAll(oreByProduct); } - public Werkstoff( - short[] rgba, - String defaultName, - String toolTip, - Werkstoff.Stats stats, - Werkstoff.Types type, - Werkstoff.GenerationFeatures generationFeatures, - int mID, - TextureSet texSet, + public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { if (Werkstoff.idHashSet.contains((short) mID)) @@ -310,9 +247,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.mID = (short) mID; this.defaultName = defaultName; // Ensure that localization key are written to the lang file - GregTech_API.sAfterGTPreload.add(() -> { - this.getLocalizedName(); - }); + GregTech_API.sAfterGTPreload.add(() -> { this.getLocalizedName(); }); this.stats = stats; this.type = type; this.generationFeatures = generationFeatures; @@ -324,38 +259,35 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (contents.length > 1) { if (p.getKey() instanceof Materials) { if (((Materials) p.getKey()).mMaterialList.size() > 1 && p.getValue() > 1) - this.toolTip += "(" + getFormula((Materials) p.getKey()) + ")" + this.toolTip += "(" + getFormula((Materials) p.getKey()) + + ")" + (BW_Util.subscriptNumber(p.getValue())); - else - this.toolTip += getFormula((Materials) p.getKey()) - + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + else this.toolTip += getFormula((Materials) p.getKey()) + + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } if (p.getKey() instanceof Werkstoff) { if (((Werkstoff) p.getKey()).CONTENTS.size() > 1 && p.getValue() > 1) - this.toolTip += "(" + getFormula((Werkstoff) p.getKey()) + ")" + this.toolTip += "(" + getFormula((Werkstoff) p.getKey()) + + ")" + (BW_Util.subscriptNumber(p.getValue())); - else - this.toolTip += getFormula((Werkstoff) p.getKey()) - + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + else this.toolTip += getFormula((Werkstoff) p.getKey()) + + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } } else { if (p.getKey() instanceof Materials) { this.toolTip += getFormula((Materials) p.getKey()) + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); - } else if (p.getKey() instanceof Werkstoff) - this.toolTip += getFormula((Werkstoff) p.getKey()) - + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + } else if (p.getKey() instanceof Werkstoff) this.toolTip += getFormula((Werkstoff) p.getKey()) + + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } } } else this.toolTip = toolTip; - // if (this.toolTip.length() > 25) - // this.toolTip = "The formula is to long..."; + // if (this.toolTip.length() > 25) + // this.toolTip = "The formula is to long..."; // Ensure that localization key are written to the lang file - GregTech_API.sAfterGTPreload.add(() -> { - this.getLocalizedToolTip(); - }); + GregTech_API.sAfterGTPreload.add(() -> { this.getLocalizedToolTip(); }); if (this.stats.protons == 0) { long tmpprotons = 0; @@ -447,8 +379,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (p.getKey() instanceof Materials) tc_aspectStacks.addAll(((Materials) p.getKey()).mAspects); if (p.getKey() instanceof Werkstoff) set.addAll(Arrays.asList(((Werkstoff) p.getKey()).getTCAspects())); } - tc_aspectStacks.forEach(tc_aspectStack -> - set.add(new Pair<>(tc_aspectStack.mAspect.mAspect, (int) tc_aspectStack.mAmount))); + tc_aspectStacks.forEach( + tc_aspectStack -> set + .add(new Pair<>(tc_aspectStack.mAspect.mAspect, (int) tc_aspectStack.mAmount))); this.stats.mTC_Aspects = set.toArray(new Pair[0]); } Pair[] ret = this.stats.mTC_Aspects.clone(); @@ -463,13 +396,11 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Arrays.stream(getTCAspects()).forEach(objectIntegerPair -> { try { new TC_Aspects.TC_AspectStack( - TC_Aspects.valueOf(((String) ThaumcraftHandler.AspectAdder.getName.invoke( - objectIntegerPair.getKey())) + TC_Aspects.valueOf( + ((String) ThaumcraftHandler.AspectAdder.getName.invoke(objectIntegerPair.getKey())) .toUpperCase(Locale.US)), - objectIntegerPair.getValue()) - .addToAspectList(ret); - } catch (IllegalAccessException | InvocationTargetException ignored) { - } + objectIntegerPair.getValue()).addToAspectList(ret); + } catch (IllegalAccessException | InvocationTargetException ignored) {} }); return ret; } @@ -538,7 +469,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public String getLocalizedName() { return GT_LanguageManager.addStringLocalization( - String.format("bw.werkstoff.%05d.name", this.mID), defaultName, !GregTech_API.sPostloadFinished); + String.format("bw.werkstoff.%05d.name", this.mID), + defaultName, + !GregTech_API.sPostloadFinished); } public String getVarName() { @@ -551,7 +484,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public String getLocalizedToolTip() { return GT_LanguageManager.addStringLocalization( - String.format("bw.werkstoff.%05d.tooltip", this.mID), toolTip, !GregTech_API.sPostloadFinished); + String.format("bw.werkstoff.%05d.tooltip", this.mID), + toolTip, + !GregTech_API.sPostloadFinished); } public Werkstoff.Stats getStats() { @@ -575,21 +510,19 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public void setRgb(short[] rgb) { - this.rgb = new byte[] {(byte) (rgb[0] - 128), (byte) (rgb[1] - 128), (byte) (rgb[2] - 128)}; + this.rgb = new byte[] { (byte) (rgb[0] - 128), (byte) (rgb[1] - 128), (byte) (rgb[2] - 128) }; } @Override public short[] getRGBA() { - return new short[] {(short) (this.rgb[0] + 128), (short) (this.rgb[1] + 128), (short) (this.rgb[2] + 128), 0}; + return new short[] { (short) (this.rgb[0] + 128), (short) (this.rgb[1] + 128), (short) (this.rgb[2] + 128), 0 }; } @Override public boolean contains(SubTag subTag) { - if (!subTag.equals(WerkstoffLoader.NOBLE_GAS) - && !subTag.equals(WerkstoffLoader.ANAEROBE_GAS) + if (!subTag.equals(WerkstoffLoader.NOBLE_GAS) && !subTag.equals(WerkstoffLoader.ANAEROBE_GAS) && !subTag.equals(WerkstoffLoader.NO_BLAST)) - for (Pair p : this.CONTENTS) - if (p.getKey().contains(subTag)) return true; + for (Pair p : this.CONTENTS) if (p.getKey().contains(subTag)) return true; return this.SUBTAGS.contains(subTag); } @@ -625,23 +558,20 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public byte getToolQuality() { - return this.stats.getQualityOverride() > 0 - ? this.stats.getQualityOverride() - : (byte) ((15f - * (((float) this.getStats().getProtons() / 188f) - + (float) this.getStats().getMeltingPoint() / 10801f)) - / (float) this.getContents().getKey()); + return this.stats + .getQualityOverride() > 0 + ? this.stats.getQualityOverride() + : (byte) ((15f * (((float) this.getStats().getProtons() / 188f) + + (float) this.getStats().getMeltingPoint() / 10801f)) + / (float) this.getContents().getKey()); } public float getToolSpeed() { - return this.stats.getSpeedOverride() > 0f - ? this.stats.getSpeedOverride() + return this.stats.getSpeedOverride() > 0f ? this.stats.getSpeedOverride() : Math.max( 1f, - 2f - * ((float) -this.getStats().getMass() - + 0.1f * (float) this.getStats().getMeltingPoint() - + (float) this.getStats().getProtons()) + 2f * ((float) -this.getStats().getMass() + 0.1f * (float) this.getStats().getMeltingPoint() + + (float) this.getStats().getProtons()) * 0.1f / (float) this.getContents().getKey() * 0.1f @@ -649,12 +579,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public int getDurability() { - return this.stats.getDurOverride() > 0 - ? this.stats.getDurOverride() + return this.stats.getDurOverride() > 0 ? this.stats.getDurOverride() : (int) (this.stats.durMod - * ((0.01f - * (float) this.getStats().getMeltingPoint() - * (float) this.getStats().getMass()) + * ((0.01f * (float) this.getStats().getMeltingPoint() * (float) this.getStats().getMass()) / (float) this.getContents().getKey())); } @@ -668,7 +595,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } /** - * DOES NOT CHECK BLACKLIST! + * DOES NOT CHECK BLACKLIST! */ public boolean hasGenerationFeature(OrePrefixes prefixes) { int unpacked = Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes); @@ -698,6 +625,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public enum Types { + MATERIAL, COMPOUND, MIXTURE, @@ -720,20 +648,14 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public static class GenerationFeatures { + public static final GenerationFeatures DISABLED = new GenerationFeatures().disable(); long toGenerate = 0b0001001; // logic gate shit /* - dust 1 - metal 10 (ingot, nugget) - gem 100 - ore 1000 - cell 10000 - plasma 100000 - molten 1000000 - crafting metal 10000000 (sticks, plates) - meta crafting metal 100000000 (gears, screws, bolts, springs) - multiple ingotWorth stuff 1000000000 (double, triple, quadruple, ingot/plates) + * dust 1 metal 10 (ingot, nugget) gem 100 ore 1000 cell 10000 plasma 100000 molten 1000000 crafting metal + * 10000000 (sticks, plates) meta crafting metal 100000000 (gears, screws, bolts, springs) multiple ingotWorth + * stuff 1000000000 (double, triple, quadruple, ingot/plates) */ private boolean isExtension; private static final NonNullWrappedHashMap prefixLogic = new NonNullWrappedHashMap<>(0); @@ -825,19 +747,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public boolean enforceUnification; /* - * Auto add Chemical Recipes 1 - * Auto add mixer Recipes 10 - * Auto add Sifter Recipe 100 - * Auto add MetalWorking(sticks, plates) Recipe 1000 - * Auto add MetalWorking(crafting components) Recipe 10000 + * Auto add Chemical Recipes 1 Auto add mixer Recipes 10 Auto add Sifter Recipe 100 Auto add + * MetalWorking(sticks, plates) Recipe 1000 Auto add MetalWorking(crafting components) Recipe 10000 */ public byte extraRecipes; /* - * Here so that new recipes don't fuck with existing functionality - * Auto add Crafting Metal Solidifier recipes 1 - * Auto add Meta Crafting Metal Solidifier recipes 10 - * Auto add Multiple Ingot Metal Solidifier recipes 100 (Unused) + * Here so that new recipes don't fuck with existing functionality Auto add Crafting Metal Solidifier recipes 1 + * Auto add Meta Crafting Metal Solidifier recipes 10 Auto add Multiple Ingot Metal Solidifier recipes 100 + * (Unused) */ public byte extraRecipes2; @@ -1065,9 +983,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } /** - * The generated EBF recipes using this gas will have their duration multiplied by this number. - * If set to a negative value, the default proton count-based logic is used. - * For GT Materials gases, add the overrides to {@link StaticRecipeChangeLoaders#addEBFGasRecipes()} + * The generated EBF recipes using this gas will have their duration multiplied by this number. If set to a + * negative value, the default proton count-based logic is used. For GT Materials gases, add the overrides to + * {@link StaticRecipeChangeLoaders#addEBFGasRecipes()} */ public Werkstoff.Stats setEbfGasRecipeTimeMultiplier(double timeMultiplier) { this.ebfGasRecipeTimeMultiplier = timeMultiplier; @@ -1079,8 +997,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } /** - * The generated EBF recipes using this gas will have the amount of gas consumed multiplied by this number. - * For GT Materials gases, add the overrides to {@link StaticRecipeChangeLoaders#addEBFGasRecipes()} + * The generated EBF recipes using this gas will have the amount of gas consumed multiplied by this number. For + * GT Materials gases, add the overrides to {@link StaticRecipeChangeLoaders#addEBFGasRecipes()} */ public Werkstoff.Stats setEbfGasRecipeConsumedAmountMultiplier(double amountMultiplier) { this.ebfGasRecipeConsumedAmountMultiplier = amountMultiplier; @@ -1170,24 +1088,18 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (this.electrons != that.electrons) return false; if (Math.abs(this.ebfGasRecipeTimeMultiplier - that.ebfGasRecipeTimeMultiplier) > 1.0e-6D) return false; if (Math.abs(this.ebfGasRecipeConsumedAmountMultiplier - that.ebfGasRecipeConsumedAmountMultiplier) - > 1.0e-6D) return false; + > 1.0e-6D) + return false; return this.quality == that.quality; } @Override public int hashCode() { return MurmurHash3.murmurhash3_x86_32( - ByteBuffer.allocate(49) - .put(this.quality) - .putInt(this.boilingPoint) - .putInt(this.meltingPoint) - .putLong(this.protons) - .putLong(this.neutrons) - .putLong(this.electrons) - .putLong(this.mass) + ByteBuffer.allocate(49).put(this.quality).putInt(this.boilingPoint).putInt(this.meltingPoint) + .putLong(this.protons).putLong(this.neutrons).putLong(this.electrons).putLong(this.mass) .putDouble(this.ebfGasRecipeTimeMultiplier) - .putDouble(this.ebfGasRecipeConsumedAmountMultiplier) - .array(), + .putDouble(this.ebfGasRecipeConsumedAmountMultiplier).array(), 0, 49, 31); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 22265423e8..fd5dc54a01 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material; @@ -26,6 +17,18 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Util.subscriptNumbers; import static com.github.bartimaeusnek.bartworks.util.BW_Util.superscriptNumbers; import static gregtech.api.enums.OrePrefixes.*; +import java.lang.reflect.Field; +import java.util.*; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.oredict.OreDictionary; + +import org.apache.logging.log4j.Level; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.API.WerkstoffAdderRegistry; @@ -47,6 +50,7 @@ import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import com.github.bartimaeusnek.crossmod.cls.CLSCompat; import com.google.common.collect.HashBiMap; + import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.ProgressManager; import cpw.mods.fml.common.registry.GameRegistry; @@ -59,18 +63,10 @@ import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputOreDict; import ic2.api.recipe.RecipeOutput; import ic2.api.recipe.Recipes; -import java.lang.reflect.Field; -import java.util.*; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.oredict.OreDictionary; -import org.apache.logging.log4j.Level; -@SuppressWarnings({"unchecked", "deprecation"}) +@SuppressWarnings({ "unchecked", "deprecation" }) public class WerkstoffLoader { + private WerkstoffLoader() {} public static final SubTag NOBLE_GAS = SubTag.getNewSubTag("NobleGas"); @@ -131,7 +127,7 @@ public class WerkstoffLoader { 3628800L, 64, 31); - // GT_LanguageManager.addStringLocalization(".name", this.getDefaultLocalization(w)); + // GT_LanguageManager.addStringLocalization(".name", this.getDefaultLocalization(w)); } else { WerkstoffLoader.cellMolten.mMaterialGenerationBits = 0b1000000; } @@ -142,8 +138,7 @@ public class WerkstoffLoader { WerkstoffLoader.smallGearShape = Enum.valueOf(ItemList.class, "Shape_Extruder_Small_Gear"); WerkstoffLoader.ringMold = Enum.valueOf(ItemList.class, "Shape_Mold_Ring"); WerkstoffLoader.boltMold = Enum.valueOf(ItemList.class, "Shape_Mold_Bolt"); - } catch (NullPointerException | IllegalArgumentException ignored) { - } + } catch (NullPointerException | IllegalArgumentException ignored) {} // add tiberium Element t = EnumUtils.createNewElement("Tr", 123L, 203L, 0L, -1L, null, "Tiberium", false); @@ -216,16 +211,16 @@ public class WerkstoffLoader { } // TODO: - // FREE ID RANGE: 12_000-28_998 - // bartimaeusnek reserved 0-10_000 - // GlodBlock reserved range 10_001-10_999 - // Elisis reserved range 11_000-11_499 - // glowredman reserved range 11_500-11_999 - // bot reserved range 29_899-29_999 - // Tec & basdxz reserved range 30_000-31_000 + // FREE ID RANGE: 12_000-28_998 + // bartimaeusnek reserved 0-10_000 + // GlodBlock reserved range 10_001-10_999 + // Elisis reserved range 11_000-11_499 + // glowredman reserved range 11_500-11_999 + // bot reserved range 29_899-29_999 + // Tec & basdxz reserved range 30_000-31_000 // GT Material range reserved on 31_767-32_767 public static final Werkstoff Bismutite = new Werkstoff( - new short[] {255, 233, 0, 0}, + new short[] { 255, 233, 0, 0 }, "Bismutite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), @@ -236,7 +231,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Oxygen, 2), new Pair<>(Materials.CarbonDioxide, 2)); public static final Werkstoff Bismuthinit = new Werkstoff( - new short[] {192, 192, 192, 0}, + new short[] { 192, 192, 192, 0 }, "Bismuthinite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -246,26 +241,18 @@ public class WerkstoffLoader { new Pair<>(Materials.Bismuth, 2), new Pair<>(Materials.Sulfur, 3)); public static final Werkstoff Zirconium = new Werkstoff( - new short[] {175, 175, 175, 0}, + new short[] { 175, 175, 175, 0 }, "Zirconium", "Zr", - new Werkstoff.Stats() - .setProtons(40) - .setBlastFurnace(true) - .setMeltingPoint(2130) - .setMeltingVoltage(480), + new Werkstoff.Stats().setProtons(40).setBlastFurnace(true).setMeltingPoint(2130).setMeltingVoltage(480), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures() - .disable() - .onlyDust() - .addMetalItems() - .enforceUnification(), + new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().enforceUnification(), 3, TextureSet.SET_METALLIC - // No Byproducts - ); + // No Byproducts + ); public static final Werkstoff CubicZirconia = new Werkstoff( - new short[] {255, 255, 255, 0}, + new short[] { 255, 255, 255, 0 }, "Cubic Zirconia", Werkstoff.Types.COMPOUND, 3273, @@ -276,7 +263,7 @@ public class WerkstoffLoader { new Pair<>(WerkstoffLoader.Zirconium, 1), new Pair<>(Materials.Oxygen, 2)); public static final Werkstoff FluorBuergerit = new Werkstoff( - new short[] {0x20, 0x20, 0x20, 0}, + new short[] { 0x20, 0x20, 0x20, 0 }, "Fluor-Buergerite", subscriptNumbers("NaFe3Al6(Si6O18)(BO3)3O3F"), new Werkstoff.Stats().setElektrolysis(false), @@ -293,18 +280,17 @@ public class WerkstoffLoader { new Pair<>(Materials.Oxygen, 30), new Pair<>(Materials.Fluorine, 1)); public static final Werkstoff YttriumOxide = new Werkstoff( - new short[] {255, 255, 255, 0}, + new short[] { 255, 255, 255, 0 }, "Yttrium Oxide", Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures() - .onlyDust() - .enforceUnification(), // No autoadd here to gate this material by hand + new Werkstoff.GenerationFeatures().onlyDust().enforceUnification(), // No autoadd here to gate this material + // by hand 6, TextureSet.SET_DULL, new Pair<>(Materials.Yttrium, 2), new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff ChromoAluminoPovondrait = new Werkstoff( - new short[] {0, 0x79, 0x6A, 0}, + new short[] { 0, 0x79, 0x6A, 0 }, "Chromo-Alumino-Povondraite", subscriptNumbers("NaCr3(Al4Mg2)(Si6O18)(BO3)3(OH)3O"), Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND).setElektrolysis(false), @@ -321,7 +307,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Oxygen, 31), new Pair<>(Materials.Hydrogen, 3)); public static final Werkstoff VanadioOxyDravit = new Werkstoff( - new short[] {0x60, 0xA0, 0xA0, 0}, + new short[] { 0x60, 0xA0, 0xA0, 0 }, "Vanadio-Oxy-Dravite", subscriptNumbers("NaV3(Al4Mg2)(Si6O18)(BO3)3(OH)3O"), Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND).setElektrolysis(false), @@ -338,7 +324,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Oxygen, 31), new Pair<>(Materials.Hydrogen, 3)); public static final Werkstoff Olenit = new Werkstoff( - new short[] {210, 210, 210, 0}, + new short[] { 210, 210, 210, 0 }, "Olenite", subscriptNumbers("NaAl3Al6(Si6O18)(BO3)3O3OH"), Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND).setElektrolysis(false), @@ -354,7 +340,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Oxygen, 31), new Pair<>(Materials.Hydrogen, 1)); public static final Werkstoff Arsenopyrite = new Werkstoff( - new short[] {0xB0, 0xB0, 0xB0, 0}, + new short[] { 0xB0, 0xB0, 0xB0, 0 }, "Arsenopyrite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -365,7 +351,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Arsenic, 1), new Pair<>(Materials.Sulfur, 1)); public static final Werkstoff Ferberite = new Werkstoff( - new short[] {0xB0, 0xB0, 0xB0, 0}, + new short[] { 0xB0, 0xB0, 0xB0, 0 }, "Ferberite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -376,7 +362,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Tungsten, 1), new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff Loellingit = new Werkstoff( - new short[] {0xD0, 0xD0, 0xD0, 0}, + new short[] { 0xD0, 0xD0, 0xD0, 0 }, "Loellingite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -386,7 +372,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Iron, 1), new Pair<>(Materials.Arsenic, 2)); public static final Werkstoff Roquesit = new Werkstoff( - new short[] {0xA0, 0xA0, 0xA0, 0}, + new short[] { 0xA0, 0xA0, 0xA0, 0 }, "Roquesite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -397,7 +383,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Indium, 1), new Pair<>(Materials.Sulfur, 2)); public static final Werkstoff Bornite = new Werkstoff( - new short[] {0x97, 0x66, 0x2B, 0}, + new short[] { 0x97, 0x66, 0x2B, 0 }, "Bornite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -419,7 +405,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Bismuth, 1), new Pair<>(Materials.Sulfur, 4)); public static final Werkstoff Djurleit = new Werkstoff( - new short[] {0x60, 0x60, 0x60, 0}, + new short[] { 0x60, 0x60, 0x60, 0 }, "Djurleite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -429,7 +415,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Copper, 31), new Pair<>(Materials.Sulfur, 16)); public static final Werkstoff Huebnerit = new Werkstoff( - new short[] {0x80, 0x60, 0x60, 0}, + new short[] { 0x80, 0x60, 0x60, 0 }, "Huebnerite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -440,7 +426,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Tungsten, 1), new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff Thorianit = new Werkstoff( - new short[] {0x30, 0x30, 0x30, 0}, + new short[] { 0x30, 0x30, 0x30, 0 }, "Thorianite", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -451,7 +437,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Thorium, 1), new Pair<>(Materials.Oxygen, 2)); public static final Werkstoff RedZircon = new Werkstoff( - new short[] {195, 19, 19, 0}, + new short[] { 195, 19, 19, 0 }, "Red Zircon", new Werkstoff.Stats().setElektrolysis(false).setMeltingPoint(2130), Werkstoff.Types.COMPOUND, @@ -497,7 +483,7 @@ public class WerkstoffLoader { // More NonGT Stuff public static final Werkstoff Fayalit = new Werkstoff( - new short[] {50, 50, 50, 0}, + new short[] { 50, 50, 50, 0 }, "Fayalite", new Werkstoff.Stats().setElektrolysis(false), Werkstoff.Types.COMPOUND, @@ -509,7 +495,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff Forsterit = new Werkstoff( - new short[] {255, 255, 255, 0}, + new short[] { 255, 255, 255, 0 }, "Forsterite", new Werkstoff.Stats().setElektrolysis(false), Werkstoff.Types.COMPOUND, @@ -521,7 +507,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff Hedenbergit = new Werkstoff( - new short[] {100, 150, 100, 0}, + new short[] { 100, 150, 100, 0 }, "Hedenbergite", new Werkstoff.Stats().setElektrolysis(false), Werkstoff.Types.COMPOUND, @@ -534,7 +520,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Silicon, 2), new Pair<>(Materials.Oxygen, 6)); public static final Werkstoff DescloiziteZNVO4 = new Werkstoff( - new short[] {0xBF, 0x18, 0x0F, 0}, + new short[] { 0xBF, 0x18, 0x0F, 0 }, "Red Descloizite", // Pb(Zn,Cu)[OH|VO4 new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -547,7 +533,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Vanadium, 1), new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff DescloiziteCUVO4 = new Werkstoff( - new short[] {0xf9, 0x6d, 0x18, 0}, + new short[] { 0xf9, 0x6d, 0x18, 0 }, "Orange Descloizite", // Pb(Zn,Cu)[OH|VO4 new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -560,7 +546,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Vanadium, 1), new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff FuchsitAL = new Werkstoff( - new short[] {0x4D, 0x7F, 0x64, 0}, + new short[] { 0x4D, 0x7F, 0x64, 0 }, "Green Fuchsite", subscriptNumbers("KAl3Si3O10(OH)2"), new Werkstoff.Stats().setElektrolysis(false), @@ -576,7 +562,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Hydrogen, 2)); public static final Werkstoff FuchsitCR = new Werkstoff( - new short[] {128, 0, 0, 0}, + new short[] { 128, 0, 0, 0 }, "Red Fuchsite", subscriptNumbers("KCr3Si3O10(OH)2"), new Werkstoff.Stats().setElektrolysis(false), @@ -592,26 +578,19 @@ public class WerkstoffLoader { new Pair<>(Materials.Hydrogen, 2)); public static final Werkstoff Thorium232 = new Werkstoff( - new short[] {0, 64, 0, 0}, + new short[] { 0, 64, 0, 0 }, "Thorium 232", superscriptNumbers("Th232"), - new Werkstoff.Stats() - .setRadioactive(true) - .setBlastFurnace(true) - .setMass(232) + new Werkstoff.Stats().setRadioactive(true).setBlastFurnace(true).setMass(232) .setProtons(Element.Th.mProtons), Werkstoff.Types.ISOTOPE, - new Werkstoff.GenerationFeatures() - .disable() - .onlyDust() - .addMetalItems() - .enforceUnification(), + new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().enforceUnification(), 30, TextureSet.SET_METALLIC - // No Byproducts - ); + // No Byproducts + ); public static final Werkstoff BismuthTellurite = new Werkstoff( - new short[] {32, 72, 32, 0}, + new short[] { 32, 72, 32, 0 }, "Bismuth Tellurite", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -622,7 +601,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Bismuth, 2), new Pair<>(Materials.Tellurium, 3)); public static final Werkstoff Tellurium = new Werkstoff( - new short[] {0xff, 0xff, 0xff, 0}, + new short[] { 0xff, 0xff, 0xff, 0 }, "Tellurium", new Werkstoff.Stats(), Werkstoff.Types.ELEMENT, @@ -632,7 +611,7 @@ public class WerkstoffLoader { // No Byproducts new Pair<>(Materials.Tellurium, 1)); public static final Werkstoff BismuthHydroBorat = new Werkstoff( - new short[] {72, 144, 72, 0}, + new short[] { 72, 144, 72, 0 }, "Dibismuthhydroborat", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -644,7 +623,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Boron, 1), new Pair<>(Materials.Hydrogen, 1)); public static final Werkstoff ArInGaPhoBiBoTe = new Werkstoff( - new short[] {36, 36, 36, 0}, + new short[] { 36, 36, 36, 0 }, "Circuit Compound MK3", new Werkstoff.Stats().setCentrifuge(true), Werkstoff.Types.COMPOUND, @@ -657,7 +636,7 @@ public class WerkstoffLoader { new Pair<>(WerkstoffLoader.BismuthTellurite, 2)); public static final Werkstoff Prasiolite = new Werkstoff( - new short[] {0xD0, 0xDD, 0x95, 0}, + new short[] { 0xD0, 0xDD, 0x95, 0 }, "Prasiolite", new Werkstoff.Stats().setElektrolysis(false).setMeltingPoint(1923), Werkstoff.Types.COMPOUND, @@ -670,7 +649,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Iron, 1)); public static final Werkstoff MagnetoResonaticDust = new Werkstoff( - new short[] {0xDD, 0x77, 0xDD, 0}, + new short[] { 0xDD, 0x77, 0xDD, 0 }, "Magneto Resonatic", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -683,7 +662,7 @@ public class WerkstoffLoader { new Pair<>(WerkstoffLoader.CubicZirconia, 1), new Pair<>(Materials.SteelMagnetic, 1)); public static final Werkstoff Xenon = new Werkstoff( - new short[] {0x14, 0x39, 0x7F, 0}, + new short[] { 0x14, 0x39, 0x7F, 0 }, "Xenon", "Xe", new Werkstoff.Stats().setProtons(54).setMass(131).setGas(true), @@ -691,11 +670,11 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), 37, TextureSet.SET_FLUID - // No Byproducts - // No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff Oganesson = new Werkstoff( - new short[] {0x14, 0x39, 0x7F, 0}, + new short[] { 0x14, 0x39, 0x7F, 0 }, "Oganesson", "Og", new Werkstoff.Stats().setProtons(118).setMass(294).setGas(true), @@ -703,88 +682,62 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().addCells(), 38, TextureSet.SET_FLUID - // No Byproducts - // No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff Californium = new Werkstoff( - new short[] {0xAA, 0xAA, 0xAA, 0}, + new short[] { 0xAA, 0xAA, 0xAA, 0 }, "Californium", "Cf", - new Werkstoff.Stats() - .setProtons(98) - .setMass(251) - .setBlastFurnace(true) - .setMeltingPoint(900), + new Werkstoff.Stats().setProtons(98).setMass(251).setBlastFurnace(true).setMeltingPoint(900), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures() - .disable() - .onlyDust() - .addMetalItems() - .addMolten() - .enforceUnification(), + new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten().enforceUnification(), 39, TextureSet.SET_METALLIC - // No Byproducts - // No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff Calcium = new Werkstoff( Materials.Calcium.mRGBa, "Calcium", "Ca", - new Werkstoff.Stats() - .setProtons(Element.Ca.mProtons) - .setMass(Element.Ca.getMass()) - .setBlastFurnace(true) - .setMeltingPoint(1115) - .setBoilingPoint(1757), + new Werkstoff.Stats().setProtons(Element.Ca.mProtons).setMass(Element.Ca.getMass()).setBlastFurnace(true) + .setMeltingPoint(1115).setBoilingPoint(1757), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures() - .disable() - .onlyDust() - .addMetalItems() - .addMolten(), + new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten(), 40, Materials.Calcium.mIconSet, // No Byproducts new Pair<>(Materials.Calcium, 1)); public static final Werkstoff Neon = new Werkstoff( - new short[] {0xff, 0x07, 0x3a}, + new short[] { 0xff, 0x07, 0x3a }, "Neon", "Ne", - new Werkstoff.Stats() - .setProtons(Element.Ne.mProtons) - .setMass(Element.Ne.getMass()) - .setGas(true), + new Werkstoff.Stats().setProtons(Element.Ne.mProtons).setMass(Element.Ne.getMass()).setGas(true), Werkstoff.Types.ELEMENT, new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), 41, TextureSet.SET_FLUID - // No Byproducts - // No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff Krypton = new Werkstoff( - new short[] {0xb1, 0xff, 0x32}, + new short[] { 0xb1, 0xff, 0x32 }, "Krypton", "Kr", - new Werkstoff.Stats() - .setProtons(Element.Kr.mProtons) - .setMass(Element.Kr.getMass()) - .setGas(true), + new Werkstoff.Stats().setProtons(Element.Kr.mProtons).setMass(Element.Kr.getMass()).setGas(true), Werkstoff.Types.ELEMENT, new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), 42, TextureSet.SET_FLUID - // No Byproducts - // No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff BArTiMaEuSNeK = new Werkstoff( - new short[] {0x00, 0xff, 0x00}, + new short[] { 0x00, 0xff, 0x00 }, "BArTiMaEuSNeK", "Are you serious?", - new Werkstoff.Stats() - .setMeltingPoint(9001) - .setCentrifuge(true) - .setBlastFurnace(true) + new Werkstoff.Stats().setMeltingPoint(9001).setCentrifuge(true).setBlastFurnace(true) .setMeltingVoltage(1920), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems().addMetalItems().addMolten(), @@ -808,9 +761,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().addCells(), 44, TextureSet.SET_FLUID - // No Byproducts - // No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff PTSaltCrude = new Werkstoff( Materials.Platinum.getRGBA(), "Platinum Salt", @@ -820,9 +773,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 45, TextureSet.SET_DULL - // No Byproducts - // No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff PTSaltRefined = new Werkstoff( Materials.Platinum.getRGBA(), "Refined Platinum Salt", @@ -832,9 +785,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 46, TextureSet.SET_METALLIC - // No Byproducts - // No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff PTMetallicPowder = new Werkstoff( Materials.Platinum.getRGBA(), "Platinum Metallic Powder", @@ -848,7 +801,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Platinum, 1), new Pair<>(Materials.Stone, 2)); public static final Werkstoff AquaRegia = new Werkstoff( - new short[] {0xff, 0xb1, 0x32}, + new short[] { 0xff, 0xb1, 0x32 }, "Aqua Regia", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -859,7 +812,7 @@ public class WerkstoffLoader { new Pair<>(Materials.DilutedSulfuricAcid, 1), new Pair<>(Materials.NitricAcid, 1)); public static final Werkstoff PTResidue = new Werkstoff( - new short[] {0x64, 0x63, 0x2E}, + new short[] { 0x64, 0x63, 0x2E }, "Platinum Residue", "??IrOsRhRu??", new Werkstoff.Stats(), @@ -867,10 +820,10 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 49, TextureSet.SET_ROUGH - // No Byproducts - ); + // No Byproducts + ); public static final Werkstoff AmmoniumChloride = new Werkstoff( - new short[] {0xff, 0xff, 0xff}, + new short[] { 0xff, 0xff, 0xff }, "Ammonium Chloride", subscriptNumbers("NH4Cl"), new Werkstoff.Stats(), @@ -890,8 +843,8 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 51, TextureSet.SET_METALLIC - // No Byproducts - ); + // No Byproducts + ); public static final Werkstoff PDAmmonia = new Werkstoff( Materials.Palladium.getRGBA(), "Palladium Enriched Ammonia", @@ -924,9 +877,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 54, TextureSet.SET_METALLIC - // No Byproducts - // No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff PDSalt = new Werkstoff( Materials.Palladium.getRGBA(), "Palladium Salt", @@ -935,11 +888,11 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 55, TextureSet.SET_METALLIC - // No Byproducts - // No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff Sodiumformate = new Werkstoff( - new short[] {0xff, 0xaa, 0xaa}, + new short[] { 0xff, 0xaa, 0xaa }, "Sodium Formate", "HCOONa", new Werkstoff.Stats(), @@ -951,7 +904,7 @@ public class WerkstoffLoader { new Pair<>(Materials.SodiumHydroxide, 1), new Pair<>(Materials.CarbonMonoxide, 1)); public static final Werkstoff Sodiumsulfate = new Werkstoff( - new short[] {0xff, 0xff, 0xff}, + new short[] { 0xff, 0xff, 0xff }, "Sodium Sulfate", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -963,7 +916,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Sulfur, 1), new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff FormicAcid = new Werkstoff( - new short[] {0xff, 0xaa, 0x77}, + new short[] { 0xff, 0xaa, 0x77 }, "Formic Acid", subscriptNumbers("CH2O2"), new Werkstoff.Stats().setElektrolysis(false), @@ -976,7 +929,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Hydrogen, 2), new Pair<>(Materials.Oxygen, 2)); public static final Werkstoff PotassiumDisulfate = new Werkstoff( - new short[] {0xfb, 0xbb, 0x66}, + new short[] { 0xfb, 0xbb, 0x66 }, "Potassium Disulfate", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -988,7 +941,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Sulfur, 2), new Pair<>(Materials.Oxygen, 7)); public static final Werkstoff LeachResidue = new Werkstoff( - new short[] {0x64, 0x46, 0x29}, + new short[] { 0x64, 0x46, 0x29 }, "Leach Residue", "??IrOsRu??", new Werkstoff.Stats(), @@ -996,30 +949,30 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures(), 60, TextureSet.SET_ROUGH - // No Byproducts - ); + // No Byproducts + ); public static final Werkstoff RHSulfate = new Werkstoff( - new short[] {0xee, 0xaa, 0x55}, + new short[] { 0xee, 0xaa, 0x55 }, "Rhodium Sulfate", new Werkstoff.Stats().setGas(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().addCells(), 61, TextureSet.SET_FLUID - // No Byproducts - ); + // No Byproducts + ); public static final Werkstoff RHSulfateSolution = new Werkstoff( - new short[] {0xff, 0xbb, 0x66}, + new short[] { 0xff, 0xbb, 0x66 }, "Rhodium Sulfate Solution", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().addCells(), 62, TextureSet.SET_FLUID - // No Byproducts - ); + // No Byproducts + ); public static final Werkstoff CalciumChloride = new Werkstoff( - new short[] {0xff, 0xff, 0xff}, + new short[] { 0xff, 0xff, 0xff }, "Calcium Chloride", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -1028,29 +981,22 @@ public class WerkstoffLoader { TextureSet.SET_DULL, new Pair<>(Materials.Calcium, 1), new Pair<>(Materials.Chlorine, 2) - // No Byproducts - ); + // No Byproducts + ); public static final Werkstoff Ruthenium = new Werkstoff( - new short[] {0x64, 0x64, 0x64}, + new short[] { 0x64, 0x64, 0x64 }, "Ruthenium", "Ru", - new Werkstoff.Stats() - .setBlastFurnace(true) - .setMeltingPoint(2607) - .setMass(Element.Ru.getMass()) + new Werkstoff.Stats().setBlastFurnace(true).setMeltingPoint(2607).setMass(Element.Ru.getMass()) .setProtons(Element.Ru.mProtons), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures() - .onlyDust() - .addMolten() - .addMetalItems() - .enforceUnification(), + new Werkstoff.GenerationFeatures().onlyDust().addMolten().addMetalItems().enforceUnification(), 64, TextureSet.SET_METALLIC - // No Byproducts - ); + // No Byproducts + ); public static final Werkstoff SodiumRuthenate = new Werkstoff( - new short[] {0x3a, 0x40, 0xcb}, + new short[] { 0x3a, 0x40, 0xcb }, "Sodium Ruthenate", new Werkstoff.Stats(), Werkstoff.Types.COMPOUND, @@ -1060,10 +1006,10 @@ public class WerkstoffLoader { new Pair<>(Materials.Sodium, 2), new Pair<>(Ruthenium, 1), new Pair<>(Materials.Oxygen, 3) - // No Byproducts - ); + // No Byproducts + ); public static final Werkstoff RutheniumTetroxide = new Werkstoff( - new short[] {0xc7, 0xc7, 0xc7}, + new short[] { 0xc7, 0xc7, 0xc7 }, "Ruthenium Tetroxide", new Werkstoff.Stats().setMeltingPoint(313), Werkstoff.Types.COMPOUND, @@ -1072,10 +1018,10 @@ public class WerkstoffLoader { TextureSet.SET_DULL, new Pair<>(WerkstoffLoader.Ruthenium, 1), new Pair<>(Materials.Oxygen, 4) - // No Byproducts - ); + // No Byproducts + ); public static final Werkstoff HotRutheniumTetroxideSollution = new Werkstoff( - new short[] {0xc7, 0xc7, 0xc7}, + new short[] { 0xc7, 0xc7, 0xc7 }, "Hot Ruthenium Tetroxide Solution", "???", new Werkstoff.Stats().setGas(true).setMeltingPoint(700), @@ -1088,10 +1034,10 @@ public class WerkstoffLoader { new Pair<>(Materials.Chlorine, 2), new Pair<>(Materials.Sodium, 2), new Pair<>(Materials.Water, 2) - // No Byproducts - ); + // No Byproducts + ); public static final Werkstoff RutheniumTetroxideSollution = new Werkstoff( - new short[] {0xc7, 0xc7, 0xc7}, + new short[] { 0xc7, 0xc7, 0xc7 }, "Ruthenium Tetroxide Solution", "???", new Werkstoff.Stats().setMeltingPoint(313), @@ -1104,10 +1050,10 @@ public class WerkstoffLoader { new Pair<>(Materials.Chlorine, 2), new Pair<>(Materials.Sodium, 2), new Pair<>(Materials.Water, 2) - // No Byproducts - ); + // No Byproducts + ); public static final Werkstoff IrOsLeachResidue = new Werkstoff( - new short[] {0x64, 0x46, 0x29}, + new short[] { 0x64, 0x46, 0x29 }, "Rarest Metal Residue", "??OsIr??", new Werkstoff.Stats(), @@ -1119,7 +1065,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Osmiridium, 1), new Pair<>(Materials.Stone, 2)); public static final Werkstoff IrLeachResidue = new Werkstoff( - new short[] {0x84, 0x66, 0x49}, + new short[] { 0x84, 0x66, 0x49 }, "Iridium Metal Residue", "??Ir??", new Werkstoff.Stats(), @@ -1129,10 +1075,10 @@ public class WerkstoffLoader { TextureSet.SET_ROUGH, new Pair<>(Materials.Iridium, 1), new Pair<>(Materials.Stone, 2) - // No Byproducts - ); + // No Byproducts + ); public static final Werkstoff PGSDResidue = new Werkstoff( - new short[] {0x84, 0x66, 0x49}, + new short[] { 0x84, 0x66, 0x49 }, "Sludge Dust Residue", new Werkstoff.Stats().setCentrifuge(true), Werkstoff.Types.MIXTURE, @@ -1142,7 +1088,7 @@ public class WerkstoffLoader { new Pair<>(Materials.SiliconDioxide, 3), new Pair<>(Materials.Gold, 2)); public static final Werkstoff AcidicOsmiumSolution = new Werkstoff( - new short[] {0x84, 0x66, 0x49}, + new short[] { 0x84, 0x66, 0x49 }, "Acidic Osmium Solution", "???", new Werkstoff.Stats(), @@ -1153,7 +1099,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Osmium, 1), new Pair<>(Materials.HydrochloricAcid, 1)); public static final Werkstoff IridiumDioxide = new Werkstoff( - new short[] {0x84, 0x66, 0x49}, + new short[] { 0x84, 0x66, 0x49 }, "Iridium Dioxide", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -1163,7 +1109,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Iridium, 1), new Pair<>(Materials.Oxygen, 2)); public static final Werkstoff OsmiumSolution = new Werkstoff( - new short[] {0x84, 0x66, 0x49}, + new short[] { 0x84, 0x66, 0x49 }, "Osmium Solution", "???", new Werkstoff.Stats(), @@ -1174,7 +1120,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Osmium, 1), new Pair<>(Materials.Hydrogen, 1)); public static final Werkstoff AcidicIridiumSolution = new Werkstoff( - new short[] {0x84, 0x66, 0x49}, + new short[] { 0x84, 0x66, 0x49 }, "Acidic Iridium Solution", "???", new Werkstoff.Stats(), @@ -1185,7 +1131,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Iridium, 1), new Pair<>(Materials.Hydrogen, 1)); public static final Werkstoff IridiumChloride = new Werkstoff( - new short[] {0x84, 0x66, 0x49}, + new short[] { 0x84, 0x66, 0x49 }, "Iridium Chloride", subscriptNumbers("IrCl3"), new Werkstoff.Stats(), @@ -1196,7 +1142,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Iridium, 1), new Pair<>(Materials.Chlorine, 3)); public static final Werkstoff PGSDResidue2 = new Werkstoff( - new short[] {0x84, 0x66, 0x49}, + new short[] { 0x84, 0x66, 0x49 }, "Metallic Sludge Dust Residue", new Werkstoff.Stats().setCentrifuge(true), Werkstoff.Types.MIXTURE, @@ -1206,25 +1152,17 @@ public class WerkstoffLoader { new Pair<>(Materials.Nickel, 1), new Pair<>(Materials.Copper, 1)); public static final Werkstoff Rhodium = new Werkstoff( - new short[] {0xF4, 0xF4, 0xF4}, + new short[] { 0xF4, 0xF4, 0xF4 }, "Rhodium", "Rh", - new Werkstoff.Stats() - .setProtons(Element.Rh.mProtons) - .setMass(Element.Rh.getMass()) - .setBlastFurnace(true) + new Werkstoff.Stats().setProtons(Element.Rh.mProtons).setMass(Element.Rh.getMass()).setBlastFurnace(true) .setMeltingPoint(2237), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures() - .disable() - .onlyDust() - .addMetalItems() - .addMolten() - .enforceUnification(), + new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten().enforceUnification(), 78, TextureSet.SET_METALLIC); public static final Werkstoff CrudeRhMetall = new Werkstoff( - new short[] {0x66, 0x66, 0x66}, + new short[] { 0x66, 0x66, 0x66 }, "Crude Rhodium Metal", "??Rh??", new Werkstoff.Stats(), @@ -1235,7 +1173,7 @@ public class WerkstoffLoader { new Pair<>(Rhodium, 1), new Pair<>(Materials.Stone, 1)); public static final Werkstoff RHSalt = new Werkstoff( - new short[] {0x84, 0x84, 0x84}, + new short[] { 0x84, 0x84, 0x84 }, "Rhodium Salt", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -1243,7 +1181,7 @@ public class WerkstoffLoader { 80, TextureSet.SET_GEM_VERTICAL); public static final Werkstoff RHSaltSolution = new Werkstoff( - new short[] {0x66, 0x77, 0x88}, + new short[] { 0x66, 0x77, 0x88 }, "Rhodium Salt Solution", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -1251,7 +1189,7 @@ public class WerkstoffLoader { 81, TextureSet.SET_FLUID); public static final Werkstoff SodiumNitrate = new Werkstoff( - new short[] {0x84, 0x66, 0x84}, + new short[] { 0x84, 0x66, 0x84 }, "Sodium Nitrate", subscriptNumbers("NaNO3"), new Werkstoff.Stats(), @@ -1263,7 +1201,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Nitrogen, 1), new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff RHNitrate = new Werkstoff( - new short[] {0x77, 0x66, 0x49}, + new short[] { 0x77, 0x66, 0x49 }, "Rhodium Nitrate", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -1271,7 +1209,7 @@ public class WerkstoffLoader { 83, TextureSet.SET_QUARTZ); public static final Werkstoff ZincSulfate = new Werkstoff( - new short[] {0x84, 0x66, 0x49}, + new short[] { 0x84, 0x66, 0x49 }, "Zinc Sulfate", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.MIXTURE, @@ -1282,7 +1220,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Sulfur, 1), new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff RhFilterCake = new Werkstoff( - new short[] {0x77, 0x66, 0x49}, + new short[] { 0x77, 0x66, 0x49 }, "Rhodium Filter Cake", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -1290,7 +1228,7 @@ public class WerkstoffLoader { 85, TextureSet.SET_QUARTZ); public static final Werkstoff RHFilterCakeSolution = new Werkstoff( - new short[] {0x66, 0x77, 0x88}, + new short[] { 0x66, 0x77, 0x88 }, "Rhodium Filter Cake Solution", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -1298,7 +1236,7 @@ public class WerkstoffLoader { 86, TextureSet.SET_FLUID); public static final Werkstoff ReRh = new Werkstoff( - new short[] {0x77, 0x66, 0x49}, + new short[] { 0x77, 0x66, 0x49 }, "Reprecipitated Rhodium", subscriptNumbers("Rh2NH4"), new Werkstoff.Stats(), @@ -1309,67 +1247,41 @@ public class WerkstoffLoader { public static final Werkstoff LuVTierMaterial = new Werkstoff( Materials.Chrome.getRGBA(), "Rhodium-Plated Palladium", - new Werkstoff.Stats() - .setCentrifuge(true) - .setBlastFurnace(true) - .setMeltingPoint(4500) + new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500) .setMeltingVoltage(480), Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures() - .disable() - .onlyDust() - .addMolten() - .addMetalItems() - .addMixerRecipes((short) 1) - .addSimpleMetalWorkingItems() - .addCraftingMetalWorkingItems() + new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems() + .addMixerRecipes((short) 1).addSimpleMetalWorkingItems().addCraftingMetalWorkingItems() .addMultipleIngotMetalWorkingItems(), 88, TextureSet.SET_METALLIC, new Pair<>(Materials.Palladium, 3), new Pair<>(WerkstoffLoader.Rhodium, 1)); public static final Werkstoff Tiberium = new Werkstoff( - new short[] {0x22, 0xEE, 0x22}, + new short[] { 0x22, 0xEE, 0x22 }, "Tiberium", "Tr", - new Werkstoff.Stats() - .setProtons(123) - .setMass(326) - .setBlastFurnace(true) - .setMeltingPoint(1800) - .setRadioactive(true) - .setToxic(true), + new Werkstoff.Stats().setProtons(123).setMass(326).setBlastFurnace(true).setMeltingPoint(1800) + .setRadioactive(true).setToxic(true), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures() - .addGems() - .addCraftingMetalWorkingItems() - .addSimpleMetalWorkingItems(), + new Werkstoff.GenerationFeatures().addGems().addCraftingMetalWorkingItems().addSimpleMetalWorkingItems(), 89, TextureSet.SET_DIAMOND); public static final Werkstoff Ruridit = new Werkstoff( - new short[] {0xA4, 0xA4, 0xA4}, + new short[] { 0xA4, 0xA4, 0xA4 }, "Ruridit", - new Werkstoff.Stats() - .setCentrifuge(true) - .setBlastFurnace(true) - .setMeltingPoint(4500) + new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500) .setMeltingVoltage(480), Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures() - .disable() - .onlyDust() - .addMolten() - .addMetalItems() - .addMixerRecipes((short) 1) - .addSimpleMetalWorkingItems() - .addCraftingMetalWorkingItems() + new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems() + .addMixerRecipes((short) 1).addSimpleMetalWorkingItems().addCraftingMetalWorkingItems() .addMultipleIngotMetalWorkingItems(), 90, TextureSet.SET_METALLIC, new Pair<>(WerkstoffLoader.Ruthenium, 2), new Pair<>(Materials.Iridium, 1)); public static final Werkstoff Fluorspar = new Werkstoff( - new short[] {185, 69, 251}, + new short[] { 185, 69, 251 }, "Fluorspar", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -1379,23 +1291,13 @@ public class WerkstoffLoader { new Pair<>(Materials.Calcium, 1), new Pair<>(Materials.Fluorine, 2)); public static final Werkstoff HDCS = new Werkstoff( - new short[] {0x33, 0x44, 0x33}, + new short[] { 0x33, 0x44, 0x33 }, "High Durability Compound Steel", - new Werkstoff.Stats() - .setCentrifuge(true) - .setBlastFurnace(true) - .setMeltingPoint(9000) + new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(9000) .setMeltingVoltage(7680), Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures() - .disable() - .onlyDust() - .addMolten() - .addMetalItems() - .addMixerRecipes() - .addSimpleMetalWorkingItems() - .addCraftingMetalWorkingItems() - .addMultipleIngotMetalWorkingItems(), + new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes() + .addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), 92, TextureSet.SET_SHINY, new Pair<>(Materials.TungstenSteel, 12), @@ -1405,7 +1307,7 @@ public class WerkstoffLoader { new Pair<>(WerkstoffLoader.MagnetoResonaticDust, 2), new Pair<>(Materials.Plutonium, 1)); public static final Werkstoff Atheneite = new Werkstoff( - new short[] {175, 175, 175}, + new short[] { 175, 175, 175 }, "Atheneite", subscriptNumbers("(Pd,Hg)3As"), new Werkstoff.Stats().setElektrolysis(true), @@ -1417,7 +1319,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Mercury, 3), new Pair<>(Materials.Arsenic, 1)); public static final Werkstoff Temagamite = new Werkstoff( - new short[] {245, 245, 245}, + new short[] { 245, 245, 245 }, "Temagamite", subscriptNumbers("Pd3HgTe"), new Werkstoff.Stats().setElektrolysis(true), @@ -1429,7 +1331,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Mercury, 1), new Pair<>(Materials.Tellurium, 1)); public static final Werkstoff Terlinguaite = new Werkstoff( - new short[] {245, 245, 245}, + new short[] { 245, 245, 245 }, "Terlinguaite", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -1440,25 +1342,14 @@ public class WerkstoffLoader { new Pair<>(Materials.Chlorine, 1), new Pair<>(Materials.Oxygen, 1)); public static final Werkstoff AdemicSteel = new Werkstoff( - new short[] {0xcc, 0xcc, 0xcc}, + new short[] { 0xcc, 0xcc, 0xcc }, "Ademic Steel", "The break in the line", - new Werkstoff.Stats() - .setCentrifuge(true) - .setBlastFurnace(true) - .setDurOverride(6144) - .setMeltingPoint(1800) - .setSpeedOverride(12) - .setQualityOverride((byte) 4) - .setMeltingVoltage(1920), + new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setDurOverride(6144).setMeltingPoint(1800) + .setSpeedOverride(12).setQualityOverride((byte) 4).setMeltingVoltage(1920), Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures() - .onlyDust() - .addMetalItems() - .addCraftingMetalWorkingItems() - .addMolten() - .addSimpleMetalWorkingItems() - .addMultipleIngotMetalWorkingItems(), + new Werkstoff.GenerationFeatures().onlyDust().addMetalItems().addCraftingMetalWorkingItems().addMolten() + .addSimpleMetalWorkingItems().addMultipleIngotMetalWorkingItems(), 96, TextureSet.SET_METALLIC, new Pair<>(Materials.Steel, 2), @@ -1466,7 +1357,7 @@ public class WerkstoffLoader { new Pair<>(Materials.DamascusSteel, 1), new Pair<>(Materials.Carbon, 4)); public static final Werkstoff RawAdemicSteel = new Werkstoff( - new short[] {0xed, 0xed, 0xed}, + new short[] { 0xed, 0xed, 0xed }, "Raw Ademic Steel", new Werkstoff.Stats().setCentrifuge(true), Werkstoff.Types.MIXTURE, @@ -1477,7 +1368,7 @@ public class WerkstoffLoader { new Pair<>(Materials.VanadiumSteel, 1), new Pair<>(Materials.DamascusSteel, 1)); public static final Werkstoff HexafluorosilicicAcid = new Werkstoff( - new short[] {0x2c, 0x70, 0xb5}, + new short[] { 0x2c, 0x70, 0xb5 }, "Hexafluorosilicic Acid", subscriptNumbers("H2SiF6"), new Werkstoff.Stats().setElektrolysis(true), @@ -1489,7 +1380,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Fluorine, 6)); public static final Werkstoff Potassiumfluorosilicate = new Werkstoff( - new short[] {0x2e, 0x97, 0xb2}, + new short[] { 0x2e, 0x97, 0xb2 }, "Potassiumfluorosilicate", subscriptNumbers("K2SiF6"), new Werkstoff.Stats().setElektrolysis(true), @@ -1501,7 +1392,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Silicon, 1), new Pair<>(Materials.Fluorine, 6)); public static final Werkstoff Alumina = new Werkstoff( - new short[] {0xa0, 0xad, 0xb1}, + new short[] { 0xa0, 0xad, 0xb1 }, "Alumina", subscriptNumbers("Al2O3"), new Werkstoff.Stats(), @@ -1510,7 +1401,7 @@ public class WerkstoffLoader { 100, TextureSet.SET_DULL); public static final Werkstoff PotassiumCarbonate = new Werkstoff( - new short[] {0x7b, 0x96, 0x4f}, + new short[] { 0x7b, 0x96, 0x4f }, "Potassium Carbonate", subscriptNumbers("K2CO3"), new Werkstoff.Stats().setElektrolysis(true), @@ -1522,7 +1413,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Carbon, 1), new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff RawFluorophlogopite = new Werkstoff( - new short[] {0x36, 0x51, 0x0b}, + new short[] { 0x36, 0x51, 0x0b }, "Raw Fluorophlogopite", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -1530,7 +1421,7 @@ public class WerkstoffLoader { 102, TextureSet.SET_DULL); public static final Werkstoff HotFluorophlogopite = new Werkstoff( - new short[] {0xbf, 0xd3, 0x55}, + new short[] { 0xbf, 0xd3, 0x55 }, "Unformed Fluorophlogopite", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -1538,7 +1429,7 @@ public class WerkstoffLoader { 103, TextureSet.SET_FLUID); public static final Werkstoff Fluorophlogopite = new Werkstoff( - new short[] {0xbf, 0xd3, 0x55}, + new short[] { 0xbf, 0xd3, 0x55 }, "Fluorophlogopite", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -1592,13 +1483,16 @@ public class WerkstoffLoader { public static ItemStack getCorrespondingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { ItemStack stack = getCorrespondingItemStackUnsafe(orePrefixes, werkstoff, amount); if (stack != null) return stack; - else - MainMod.LOGGER.catching( - Level.ERROR, - new Exception("NO SUCH ITEM! " + orePrefixes + werkstoff.getVarName() - + " If you encounter this as a user, make sure to contact the authors of the pack/the mods you're playing! " - + "If you are a Developer, you forgot to enable " + orePrefixes - + " OrePrefix for Werkstoff " + werkstoff.getDefaultName())); + else MainMod.LOGGER.catching( + Level.ERROR, + new Exception( + "NO SUCH ITEM! " + orePrefixes + + werkstoff.getVarName() + + " If you encounter this as a user, make sure to contact the authors of the pack/the mods you're playing! " + + "If you are a Developer, you forgot to enable " + + orePrefixes + + " OrePrefix for Werkstoff " + + werkstoff.getDefaultName())); return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); } @@ -1610,43 +1504,38 @@ public class WerkstoffLoader { addItemsForGeneration(); runAdditionalOreDict(); long timepost = System.nanoTime(); - MainMod.LOGGER.info("Making Meta Items for BW Materials took " + (timepost - timepre) + "ns/" - + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); + MainMod.LOGGER.info( + "Making Meta Items for BW Materials took " + (timepost - timepre) + + "ns/" + + ((timepost - timepre) / 1000000) + + "ms/" + + ((timepost - timepre) / 1000000000) + + "s!"); } public static void run() { if (!registered) { MainMod.LOGGER.info("Loading Processing Recipes for BW Materials"); long timepre = System.nanoTime(); - ProgressManager.ProgressBar progressBar = - ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashSet.size() + 1); + ProgressManager.ProgressBar progressBar = ProgressManager + .push("Register BW Materials", Werkstoff.werkstoffHashSet.size() + 1); DebugLog.log("Loading Recipes" + (System.nanoTime() - timepre)); Integer[] clsArr = new Integer[0]; int size = 0; if (LoaderReference.betterloadingscreen) clsArr = CLSCompat.initCls(); - IWerkstoffRunnable[] werkstoffRunnables = new IWerkstoffRunnable[] { - new ToolLoader(), - new DustLoader(), - new GemLoader(), - new SimpleMetalLoader(), - new CasingLoader(), - new AspectLoader(), - new OreLoader(), - new CrushedLoader(), - new CraftingMaterialLoader(), - new CellLoader(), - new MoltenCellLoader(), - new MultipleMetalLoader(), - new MetalLoader(), - new BlockLoader() - }; + IWerkstoffRunnable[] werkstoffRunnables = new IWerkstoffRunnable[] { new ToolLoader(), new DustLoader(), + new GemLoader(), new SimpleMetalLoader(), new CasingLoader(), new AspectLoader(), new OreLoader(), + new CrushedLoader(), new CraftingMaterialLoader(), new CellLoader(), new MoltenCellLoader(), + new MultipleMetalLoader(), new MetalLoader(), new BlockLoader() }; long timepreone = 0; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { timepreone = System.nanoTime(); - DebugLog.log("Werkstoff is null or id < 0 ? " + (werkstoff == null || werkstoff.getmID() < 0) + " " - + (System.nanoTime() - timepreone)); + DebugLog.log( + "Werkstoff is null or id < 0 ? " + (werkstoff == null || werkstoff.getmID() < 0) + + " " + + (System.nanoTime() - timepreone)); if (werkstoff == null || werkstoff.getmID() < 0) { progressBar.step(""); continue; @@ -1671,8 +1560,13 @@ public class WerkstoffLoader { AdditionalRecipes.run(); ProgressManager.pop(progressBar); long timepost = System.nanoTime(); - MainMod.LOGGER.info("Loading Processing Recipes for BW Materials took " + (timepost - timepre) + "ns/" - + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); + MainMod.LOGGER.info( + "Loading Processing Recipes for BW Materials took " + (timepost - timepre) + + "ns/" + + ((timepost - timepre) / 1000000) + + "ms/" + + ((timepost - timepre) / 1000000000) + + "s!"); registered = true; } } @@ -1718,8 +1612,7 @@ public class WerkstoffLoader { Materials.Calcium.mToolQuality = WerkstoffLoader.Calcium.getToolQuality(); for (Werkstoff W : Werkstoff.werkstoffHashSet) { - for (Pair pair : - W.getContents().getValue().toArray(new Pair[0])) { + for (Pair pair : W.getContents().getValue().toArray(new Pair[0])) { if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Neodymium) { W.add(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM); @@ -1749,9 +1642,7 @@ public class WerkstoffLoader { Fluid fluid = GT_FluidFactory.builder(werkstoff.getDefaultName()) .withLocalizedName(werkstoff.getDefaultName()) .withStateAndTemperature(werkstoff.getStats().getFluidState(), 300) - .withColorRGBA(werkstoff.getRGBA()) - .withTextureName("autogenerated") - .buildAndRegister() + .withColorRGBA(werkstoff.getRGBA()).withTextureName("autogenerated").buildAndRegister() .asFluid(); WerkstoffLoader.fluids.put(werkstoff, fluid); } else { @@ -1765,29 +1656,26 @@ public class WerkstoffLoader { .withLocalizedName("Molten " + werkstoff.getDefaultName()) .withStateAndTemperature( FluidState.MOLTEN, - werkstoff.getStats().getMeltingPoint() > 0 - ? werkstoff.getStats().getMeltingPoint() + werkstoff.getStats().getMeltingPoint() > 0 ? werkstoff.getStats().getMeltingPoint() : 300) - .withColorRGBA(werkstoff.getRGBA()) - .withTextureName("molten.autogenerated") - .buildAndRegister() - .asFluid(); + .withColorRGBA(werkstoff.getRGBA()).withTextureName("molten.autogenerated") + .buildAndRegister().asFluid(); WerkstoffLoader.molten.put(werkstoff, fluid); } else { WerkstoffLoader.molten.put(werkstoff, FluidRegistry.getFluid(werkstoff.getDefaultName())); } } - for (OrePrefixes p : values()) - if (Materials.get(werkstoff.getDefaultName()) != null - && Materials.get(werkstoff.getDefaultName()).mMetaItemSubID != -1 - && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 - && OreDictHandler.getItemStack(werkstoff.getDefaultName(), p, 1) != null) { - DebugLog.log("Found: " + (p + werkstoff.getVarName()) - + " in GT material system, disable and reroute my Items to that, also add a Tooltip."); - werkstoff.getGenerationFeatures().setBlacklist(p); - } - WerkstoffLoader.toGenerateGlobal = - (WerkstoffLoader.toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); + for (OrePrefixes p : values()) if (Materials.get(werkstoff.getDefaultName()) != null + && Materials.get(werkstoff.getDefaultName()).mMetaItemSubID != -1 + && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 + && OreDictHandler.getItemStack(werkstoff.getDefaultName(), p, 1) != null) { + DebugLog.log( + "Found: " + (p + werkstoff.getVarName()) + + " in GT material system, disable and reroute my Items to that, also add a Tooltip."); + werkstoff.getGenerationFeatures().setBlacklist(p); + } + WerkstoffLoader.toGenerateGlobal = (WerkstoffLoader.toGenerateGlobal + | werkstoff.getGenerationFeatures().toGenerate); } DebugLog.log("GlobalGeneration: " + WerkstoffLoader.toGenerateGlobal); if ((WerkstoffLoader.toGenerateGlobal & 0b1) != 0) { @@ -1825,8 +1713,8 @@ public class WerkstoffLoader { WerkstoffLoader.items.put(cellPlasma, new BW_MetaGenerated_Items(cellPlasma)); } if ((WerkstoffLoader.toGenerateGlobal & 0b1000000) != 0) { - WerkstoffLoader.items.put( - WerkstoffLoader.cellMolten, new BW_MetaGenerated_Items(WerkstoffLoader.cellMolten)); + WerkstoffLoader.items + .put(WerkstoffLoader.cellMolten, new BW_MetaGenerated_Items(WerkstoffLoader.cellMolten)); if (LoaderReference.Forestry) WerkstoffLoader.items.put(capsuleMolten, new BW_MetaGenerated_Items(capsuleMolten)); } @@ -1876,15 +1764,23 @@ public class WerkstoffLoader { GameRegistry.registerTileEntity(BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblockTE"); GameRegistry.registerTileEntity(BW_MetaGeneratedBlocks_Casing_TE.class, "bw.werkstoffblockcasingTE"); GameRegistry.registerTileEntity( - BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, "bw.werkstoffblockscasingadvancedTE"); + BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, + "bw.werkstoffblockscasingadvancedTE"); WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); - WerkstoffLoader.BWSmallOres = - new BW_MetaGenerated_SmallOres(Material.rock, BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmall"); + WerkstoffLoader.BWSmallOres = new BW_MetaGenerated_SmallOres( + Material.rock, + BW_MetaGeneratedSmallOreTE.class, + "bw.blockoresSmall"); WerkstoffLoader.BWBlocks = new BW_MetaGenerated_WerkstoffBlocks( - Material.iron, BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblocks"); + Material.iron, + BW_MetaGenerated_WerkstoffBlock_TE.class, + "bw.werkstoffblocks"); WerkstoffLoader.BWBlockCasings = new BW_MetaGeneratedBlocks_Casing( - Material.iron, BW_MetaGeneratedBlocks_Casing_TE.class, "bw.werkstoffblockscasing", blockCasing); + Material.iron, + BW_MetaGeneratedBlocks_Casing_TE.class, + "bw.werkstoffblockscasing", + blockCasing); WerkstoffLoader.BWBlockCasingsAdvanced = new BW_MetaGeneratedBlocks_Casing( Material.iron, BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, @@ -1894,23 +1790,22 @@ public class WerkstoffLoader { GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.01"); GameRegistry.registerBlock(WerkstoffLoader.BWSmallOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.02"); GameRegistry.registerBlock(WerkstoffLoader.BWBlocks, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblocks.01"); - if (!ConfigHandler.disableBoltedBlocksCasing) - GameRegistry.registerBlock( - WerkstoffLoader.BWBlockCasings, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasing.01"); - if (!ConfigHandler.disableReboltedBlocksCasing) - GameRegistry.registerBlock( - WerkstoffLoader.BWBlockCasingsAdvanced, - BW_MetaGeneratedBlock_Item.class, - "bw.werkstoffblockscasingadvanced.01"); + if (!ConfigHandler.disableBoltedBlocksCasing) GameRegistry.registerBlock( + WerkstoffLoader.BWBlockCasings, + BW_MetaGeneratedBlock_Item.class, + "bw.werkstoffblockscasing.01"); + if (!ConfigHandler.disableReboltedBlocksCasing) GameRegistry.registerBlock( + WerkstoffLoader.BWBlockCasingsAdvanced, + BW_MetaGeneratedBlock_Item.class, + "bw.werkstoffblockscasingadvanced.01"); GTMetaItemEnhancer.addAdditionalOreDictToForestry(); GTMetaItemEnhancer.init(); } private static void runGTItemDataRegistrator() { - IWerkstoffRunnable[] registrations = - new IWerkstoffRunnable[] {new BridgeMaterialsLoader(), new AssociationLoader(), new CasingRegistrator() - }; + IWerkstoffRunnable[] registrations = new IWerkstoffRunnable[] { new BridgeMaterialsLoader(), + new AssociationLoader(), new CasingRegistrator() }; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { for (IWerkstoffRunnable registration : registrations) { registration.run(werkstoff); @@ -1921,21 +1816,27 @@ public class WerkstoffLoader { } public static void addVanillaCasingsToGTOreDictUnificator() { - GT_OreDictUnificator.addAssociation( - blockCasing, Materials.Aluminium, ItemList.Casing_FrostProof.get(1L), false); + GT_OreDictUnificator + .addAssociation(blockCasing, Materials.Aluminium, ItemList.Casing_FrostProof.get(1L), false); GT_OreDictUnificator.addAssociation(blockCasing, Materials.Nickel, ItemList.Casing_HeatProof.get(1L), false); GT_OreDictUnificator.addAssociation(blockCasing, Materials.Lead, ItemList.Casing_RadiationProof.get(1L), false); GT_OreDictUnificator.addAssociation(blockCasing, Materials.Steel, ItemList.Casing_SolidSteel.get(1L), false); GT_OreDictUnificator.addAssociation( - blockCasing, Materials.TungstenSteel, ItemList.Casing_RobustTungstenSteel.get(1L), false); + blockCasing, + Materials.TungstenSteel, + ItemList.Casing_RobustTungstenSteel.get(1L), + false); GT_OreDictUnificator.addAssociation( - blockCasing, Materials.Polytetrafluoroethylene, ItemList.Casing_Chemically_Inert.get(1L), false); + blockCasing, + Materials.Polytetrafluoroethylene, + ItemList.Casing_Chemically_Inert.get(1L), + false); } /** * very hacky way to make my ores/blocks/smallores detectable by gt assosication in world, well at least the prefix. - * used for the miners mostly - * removing this hacky material from the materials map instantly. we only need the item data. + * used for the miners mostly removing this hacky material from the materials map instantly. we only need the item + * data. */ private static void addFakeItemDataToInWorldBlocksAndCleanUpFakeData() { @@ -1969,8 +1870,7 @@ public class WerkstoffLoader { public static void removeIC2Recipes() { try { Set> remset = new HashSet<>(); - for (Map.Entry curr : - Recipes.macerator.getRecipes().entrySet()) { + for (Map.Entry curr : Recipes.macerator.getRecipes().entrySet()) { if (curr.getKey() instanceof RecipeInputOreDict) { if (((RecipeInputOreDict) curr.getKey()).input.equalsIgnoreCase("oreNULL")) { remset.add(curr); @@ -1992,29 +1892,23 @@ public class WerkstoffLoader { GT_OreDictUnificator.registerOre(ore + werkstoff.getVarName(), werkstoff.get(ore)); GT_OreDictUnificator.registerOre(oreSmall + werkstoff.getVarName(), werkstoff.get(oreSmall)); werkstoff.getADDITIONAL_OREDICT().forEach(e -> OreDictionary.registerOre(ore + e, werkstoff.get(ore))); - werkstoff - .getADDITIONAL_OREDICT() + werkstoff.getADDITIONAL_OREDICT() .forEach(e -> OreDictionary.registerOre(oreSmall + e, werkstoff.get(oreSmall))); } - if (werkstoff.hasItemType(gem)) - OreDictionary.registerOre( - "craftingLens" - + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()) - .mName - .replace(" ", ""), - werkstoff.get(lens)); + if (werkstoff.hasItemType(gem)) OreDictionary.registerOre( + "craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), + werkstoff.get(lens)); if (werkstoff.hasItemType(gem) || werkstoff.hasItemType(ingot)) { GT_OreDictUnificator.registerOre(block + werkstoff.getVarName(), werkstoff.get(block)); - werkstoff - .getADDITIONAL_OREDICT() + werkstoff.getADDITIONAL_OREDICT() .forEach(e -> OreDictionary.registerOre(block + e, werkstoff.get(block))); } - werkstoff.getADDITIONAL_OREDICT().forEach(s -> ENABLED_ORE_PREFIXES.stream() - .filter(o -> Objects.nonNull(werkstoff.get(o))) - .forEach(od -> OreDictionary.registerOre(od + s, werkstoff.get(od)))); + werkstoff.getADDITIONAL_OREDICT().forEach( + s -> ENABLED_ORE_PREFIXES.stream().filter(o -> Objects.nonNull(werkstoff.get(o))) + .forEach(od -> OreDictionary.registerOre(od + s, werkstoff.get(od)))); } GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index cb2786bc54..5ac2fb4b58 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; @@ -25,6 +16,17 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import static com.github.bartimaeusnek.bartworks.util.BW_Util.CLEANROOM; import static gregtech.api.enums.OrePrefixes.*; +import java.lang.reflect.Field; +import java.util.Map; +import java.util.Objects; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import org.apache.commons.lang3.reflect.FieldUtils; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; @@ -37,6 +39,7 @@ import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.LuVTier import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.*; + import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; @@ -44,49 +47,35 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; -import java.lang.reflect.Field; -import java.util.Map; -import java.util.Objects; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import org.apache.commons.lang3.reflect.FieldUtils; public class AdditionalRecipes { - private static BWRecipes.BW_Recipe_Map_LiquidFuel sAcidGenFuels = - ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)); - private static BWRecipes.BacteriaVatRecipeMap sBacteriaVat = - ((BWRecipes.BacteriaVatRecipeMap) BWRecipes.instance.getMappingsFor((byte) 1)); + private static BWRecipes.BW_Recipe_Map_LiquidFuel sAcidGenFuels = ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance + .getMappingsFor((byte) 2)); + private static BWRecipes.BacteriaVatRecipeMap sBacteriaVat = ((BWRecipes.BacteriaVatRecipeMap) BWRecipes.instance + .getMappingsFor((byte) 1)); private static GT_Recipe.GT_Recipe_Map sBiolab = BWRecipes.instance.getMappingsFor((byte) 0); private static void runBWRecipes() { if (ConfigHandler.BioLab) { - FluidStack[] dnaFluid = { - LoaderReference.gendustry - ? FluidRegistry.getFluidStack("liquiddna", 1000) - : Materials.Biomass.getFluid(1000L) - }; + FluidStack[] dnaFluid = { LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) + : Materials.Biomass.getFluid(1000L) }; for (ItemStack stack : BioItemList.getAllPetriDishes()) { - BioData DNA = - BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); + BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); if (DNA != null) { ItemStack Detergent = BioItemList.getOther(1); ItemStack DNAFlask = BioItemList.getDNASampleFlask(null); ItemStack EthanolCell = Materials.Ethanol.getCells(1); sBiolab.addFakeRecipe( false, - new ItemStack[] {stack, DNAFlask, Detergent, EthanolCell}, - new ItemStack[] { - BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(DNA)), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L) - }, + new ItemStack[] { stack, DNAFlask, Detergent, EthanolCell }, + new ItemStack[] { BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(DNA)), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L) }, BioItemList.mBioLabParts[0], - new int[] {DNA.getChance(), 10000}, - new FluidStack[] {FluidRegistry.getFluidStack("ic2distilledwater", 1000)}, + new int[] { DNA.getChance(), 10000 }, + new FluidStack[] { FluidRegistry.getFluidStack("ic2distilledwater", 1000) }, null, 500, BW_Util.getMachineVoltageFromTier(3 + DNA.getTier()), @@ -104,15 +93,11 @@ public class AdditionalRecipes { sBiolab.addFakeRecipe( false, - new ItemStack[] { - stack, - FluidLoader.BioLabFluidCells[0], - FluidLoader.BioLabFluidCells[3], - ItemList.Tool_DataOrb.get(1L) - }, - new ItemStack[] {Outp, ItemList.Cell_Empty.get(2L)}, + new ItemStack[] { stack, FluidLoader.BioLabFluidCells[0], FluidLoader.BioLabFluidCells[3], + ItemList.Tool_DataOrb.get(1L) }, + new ItemStack[] { Outp, ItemList.Cell_Empty.get(2L) }, BioItemList.mBioLabParts[1], - new int[] {DNA.getChance(), 10000}, + new int[] { DNA.getChance(), 10000 }, dnaFluid, null, 500, @@ -134,12 +119,11 @@ public class AdditionalRecipes { sBiolab.addFakeRecipe( false, - new ItemStack[] { - FluidLoader.BioLabFluidCells[1], BioItemList.getPlasmidCell(null), inp, inp2 - }, - new ItemStack[] {stack, ItemList.Cell_Empty.get(1L)}, + new ItemStack[] { FluidLoader.BioLabFluidCells[1], BioItemList.getPlasmidCell(null), inp, + inp2 }, + new ItemStack[] { stack, ItemList.Cell_Empty.get(1L) }, BioItemList.mBioLabParts[2], - new int[] {DNA.getChance(), 10000}, + new int[] { DNA.getChance(), 10000 }, dnaFluid, null, 500, @@ -149,22 +133,18 @@ public class AdditionalRecipes { } for (ItemStack stack : BioItemList.getAllPetriDishes()) { - BioData DNA = - BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); - BioData Plasmid = - BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("Plasmid")); + BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); + BioData Plasmid = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("Plasmid")); if (!Objects.equals(DNA.getName(), Plasmid.getName())) { sBiolab.addFakeRecipe( true, - new ItemStack[] { - BioItemList.getPetriDish(BioCulture.getBioCulture(DNA.getName())), - BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(Plasmid)), - FluidLoader.BioLabFluidCells[2], - }, - new ItemStack[] {stack, ItemList.Cell_Empty.get(1L)}, + new ItemStack[] { BioItemList.getPetriDish(BioCulture.getBioCulture(DNA.getName())), + BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(Plasmid)), + FluidLoader.BioLabFluidCells[2], }, + new ItemStack[] { stack, ItemList.Cell_Empty.get(1L) }, BioItemList.mBioLabParts[3], - new int[] {Plasmid.getChance(), 10000}, - new FluidStack[] {FluidRegistry.getFluidStack("ic2distilledwater", 1000)}, + new int[] { Plasmid.getChance(), 10000 }, + new FluidStack[] { FluidRegistry.getFluidStack("ic2distilledwater", 1000) }, null, 500, BW_Util.getMachineVoltageFromTier(6), @@ -178,26 +158,20 @@ public class AdditionalRecipes { // Clonal Cellular Synthesis- [Liquid DNA] + Medium Petri Dish + Plasma Membrane + Stem Cells + Genome Data sBiolab.addFakeRecipe( false, + new ItemStack[] { BioItemList.getPetriDish(null), BioItemList.getOther(4), + ItemList.Circuit_Chip_Stemcell.get(2L), Outp }, new ItemStack[] { - BioItemList.getPetriDish(null), - BioItemList.getOther(4), - ItemList.Circuit_Chip_Stemcell.get(2L), - Outp - }, - new ItemStack[] { - BioItemList.getPetriDish(null).setStackDisplayName("The Culture made from DNA"), - }, + BioItemList.getPetriDish(null).setStackDisplayName("The Culture made from DNA"), }, BioItemList.mBioLabParts[4], - new int[] {7500, 10000}, - new FluidStack[] {new FluidStack(dnaFluid[0].getFluid(), 8000)}, + new int[] { 7500, 10000 }, + new FluidStack[] { new FluidStack(dnaFluid[0].getFluid(), 8000) }, null, 500, BW_Util.getMachineVoltageFromTier(6), BW_Util.STANDART); - FluidStack[] easyFluids = { - Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000) - }; + FluidStack[] easyFluids = { Materials.Water.getFluid(1000L), + FluidRegistry.getFluidStack("ic2distilledwater", 1000) }; for (FluidStack fluidStack : easyFluids) { for (BioCulture bioCulture : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (bioCulture.isBreedable() && bioCulture.getTier() == 0) { @@ -207,37 +181,36 @@ public class AdditionalRecipes { // int aEUt, int aSpecialValue new BWRecipes.BacteriaVatRecipe( true, - new ItemStack[] { - GT_Utility.getIntegratedCircuit(1), new ItemStack(Items.sugar, 64) - }, + new ItemStack[] { GT_Utility.getIntegratedCircuit(1), + new ItemStack(Items.sugar, 64) }, null, BioItemList.getPetriDish(bioCulture), null, - new FluidStack[] {fluidStack}, - new FluidStack[] {new FluidStack(bioCulture.getFluid(), 10)}, + new FluidStack[] { fluidStack }, + new FluidStack[] { new FluidStack(bioCulture.getFluid(), 10) }, 1000, BW_Util.getMachineVoltageFromTier(3), BW_Util.STANDART), true); // aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, // aDuration, aEUt, aSpecialValue - sBiolab.addRecipe(new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[] { - BioItemList.getPetriDish(null), - fluidStack.equals(Materials.Water.getFluid(1000L)) - ? Materials.Water.getCells(1) - : GT_Utility.getContainersFromFluid(GT_ModHandler.getDistilledWater(1000)) - .get(0) - }, - new ItemStack[] {BioItemList.getPetriDish(bioCulture), Materials.Empty.getCells(1)}, - null, - new int[] {bioCulture.getChance(), 10000}, - new FluidStack[] {new FluidStack(bioCulture.getFluid(), 1000)}, - null, - 500, - BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART)); + sBiolab.addRecipe( + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { BioItemList.getPetriDish(null), + fluidStack.equals(Materials.Water.getFluid(1000L)) + ? Materials.Water.getCells(1) + : GT_Utility.getContainersFromFluid( + GT_ModHandler.getDistilledWater(1000)).get(0) }, + new ItemStack[] { BioItemList.getPetriDish(bioCulture), + Materials.Empty.getCells(1) }, + null, + new int[] { bioCulture.getChance(), 10000 }, + new FluidStack[] { new FluidStack(bioCulture.getFluid(), 1000) }, + null, + 500, + BW_Util.getMachineVoltageFromTier(3), + BW_Util.STANDART)); } } } @@ -260,7 +233,10 @@ public class AdditionalRecipes { public static void run() { runBWRecipes(); GT_Values.RA.addImplosionRecipe( - WerkstoffLoader.RawAdemicSteel.get(dust), 4, WerkstoffLoader.AdemicSteel.get(dust), null); + WerkstoffLoader.RawAdemicSteel.get(dust), + 4, + WerkstoffLoader.AdemicSteel.get(dust), + null); ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)) .addLiquidFuel(WerkstoffLoader.FormicAcid.getBridgeMaterial(), 40); // Thorium/Yttrium Glas @@ -277,15 +253,10 @@ public class AdditionalRecipes { // Thorianit recipes GT_Values.RA.addSifterRecipe( WerkstoffLoader.Thorianit.get(crushedPurified), - new ItemStack[] { - WerkstoffLoader.Thorianit.get(dust), - WerkstoffLoader.Thorianit.get(dust), - WerkstoffLoader.Thorianit.get(dust), - Materials.Thorium.getDust(1), - Materials.Thorium.getDust(1), - WerkstoffLoader.Thorium232.get(dust), - }, - new int[] {7000, 1300, 700, 600, 300, 100}, + new ItemStack[] { WerkstoffLoader.Thorianit.get(dust), WerkstoffLoader.Thorianit.get(dust), + WerkstoffLoader.Thorianit.get(dust), Materials.Thorium.getDust(1), Materials.Thorium.getDust(1), + WerkstoffLoader.Thorium232.get(dust), }, + new int[] { 7000, 1300, 700, 600, 300, 100 }, 400, BW_Util.getMachineVoltageFromTier(5)); // 3ThO2 + 4Al = 3Th + 2Al2O3 @@ -346,13 +317,12 @@ public class AdditionalRecipes { // Zr + 2O =Y22O3= ZrO2 GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe( false, - new ItemStack[] {WerkstoffLoader.Zirconium.get(dust, 10), WerkstoffLoader.YttriumOxide.get(dust)}, - new ItemStack[] { - WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.CubicZirconia.get(gemFlawed, 40) - }, + new ItemStack[] { WerkstoffLoader.Zirconium.get(dust, 10), WerkstoffLoader.YttriumOxide.get(dust) }, + new ItemStack[] { WerkstoffLoader.YttriumOxide.get(dust), + WerkstoffLoader.CubicZirconia.get(gemFlawed, 40) }, null, null, - new FluidStack[] {Materials.Oxygen.getGas(20000)}, + new FluidStack[] { Materials.Oxygen.getGas(20000) }, null, 57600, BW_Util.getMachineVoltageFromTier(3), @@ -384,18 +354,11 @@ public class AdditionalRecipes { 600000000); GT_Values.RA.addDistillationTowerRecipe( Materials.LiquidAir.getFluid(100000000), - new FluidStack[] { - Materials.Nitrogen.getGas(78084000), - Materials.Oxygen.getGas(20946000), - Materials.Argon.getGas(934000), - Materials.CarbonDioxide.getGas(40700), - WerkstoffLoader.Neon.getFluidOrGas(1818), - Materials.Helium.getGas(524), - Materials.Methane.getGas(180), - WerkstoffLoader.Krypton.getFluidOrGas(114), - Materials.Hydrogen.getGas(55), - WerkstoffLoader.Xenon.getFluidOrGas(9) - }, + new FluidStack[] { Materials.Nitrogen.getGas(78084000), Materials.Oxygen.getGas(20946000), + Materials.Argon.getGas(934000), Materials.CarbonDioxide.getGas(40700), + WerkstoffLoader.Neon.getFluidOrGas(1818), Materials.Helium.getGas(524), + Materials.Methane.getGas(180), WerkstoffLoader.Krypton.getFluidOrGas(114), + Materials.Hydrogen.getGas(55), WerkstoffLoader.Xenon.getFluidOrGas(9) }, null, 7500, BW_Util.getMachineVoltageFromTier(4)); @@ -428,71 +391,66 @@ public class AdditionalRecipes { Materials.Potassium.getDustTiny(1), Materials.Sodium.getDustTiny(4), Materials.Phosphor.getDustTiny(1), - new int[] {10000, 10000, 1000, 10000, 1000, 1000}, + new int[] { 10000, 10000, 1000, 10000, 1000, 1000 }, 50, 120); - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[] { - BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gem), - ItemList.NandChip.get(1), - ItemList.Circuit_Parts_DiodeSMD.get(4), - ItemList.Circuit_Parts_CapacitorSMD.get(4), - ItemList.Circuit_Parts_TransistorSMD.get(4) - }, - new ItemStack[] {BW_Meta_Items.getNEWCIRCUITS().getStack(4)}, - null, - null, - new FluidStack[] {Materials.SolderingAlloy.getMolten(36)}, - null, - 750, - BW_Util.getMachineVoltageFromTier(1), - CLEANROOM)); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), + WerkstoffLoader.MagnetoResonaticDust.get(gem), ItemList.NandChip.get(1), + ItemList.Circuit_Parts_DiodeSMD.get(4), ItemList.Circuit_Parts_CapacitorSMD.get(4), + ItemList.Circuit_Parts_TransistorSMD.get(4) }, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(4) }, + null, + null, + new FluidStack[] { Materials.SolderingAlloy.getMolten(36) }, + null, + 750, + BW_Util.getMachineVoltageFromTier(1), + CLEANROOM)); for (int i = 1; i <= 6; i++) { - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[] { - BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gem), - BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), - ItemList.Circuit_Parts_DiodeSMD.get((i + 1) * 4), - ItemList.Circuit_Parts_CapacitorSMD.get((i + 1) * 4), - ItemList.Circuit_Parts_TransistorSMD.get((i + 1) * 4) - }, - new ItemStack[] {BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4)}, - null, - null, - new FluidStack[] {Materials.SolderingAlloy.getMolten((i + 1) * 36)}, - null, - (i + 1) * 750, - BW_Util.getMachineVoltageFromTier((i + 1)), - CLEANROOM)); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), + WerkstoffLoader.MagnetoResonaticDust.get(gem), + BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), + ItemList.Circuit_Parts_DiodeSMD.get((i + 1) * 4), + ItemList.Circuit_Parts_CapacitorSMD.get((i + 1) * 4), + ItemList.Circuit_Parts_TransistorSMD.get((i + 1) * 4) }, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4) }, + null, + null, + new FluidStack[] { Materials.SolderingAlloy.getMolten((i + 1) * 36) }, + null, + (i + 1) * 750, + BW_Util.getMachineVoltageFromTier((i + 1)), + CLEANROOM)); } for (int i = 7; i <= 10; i++) { - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[] { - BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (1)), - BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), - ItemList.Circuit_Parts_DiodeSMD.get((i + 6) * 4), - ItemList.Circuit_Parts_CapacitorSMD.get((i + 6) * 4), - ItemList.Circuit_Parts_TransistorSMD.get((i + 6) * 4) - }, - new ItemStack[] {BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4)}, - null, - null, - new FluidStack[] {Materials.SolderingAlloy.getMolten((i + 1) * 144)}, - null, - (i + 1) * 1500, - BW_Util.getMachineVoltageFromTier(i + 1), - CLEANROOM)); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), + WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (1)), + BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), + ItemList.Circuit_Parts_DiodeSMD.get((i + 6) * 4), + ItemList.Circuit_Parts_CapacitorSMD.get((i + 6) * 4), + ItemList.Circuit_Parts_TransistorSMD.get((i + 6) * 4) }, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4) }, + null, + null, + new FluidStack[] { Materials.SolderingAlloy.getMolten((i + 1) * 144) }, + null, + (i + 1) * 1500, + BW_Util.getMachineVoltageFromTier(i + 1), + CLEANROOM)); } GT_Recipe.GT_Recipe_Map.sSmallNaquadahReactorFuels.addRecipe( true, - new ItemStack[] {WerkstoffLoader.Tiberium.get(bolt)}, + new ItemStack[] { WerkstoffLoader.Tiberium.get(bolt) }, new ItemStack[] {}, null, null, @@ -502,7 +460,7 @@ public class AdditionalRecipes { 12500); GT_Recipe.GT_Recipe_Map.sLargeNaquadahReactorFuels.addRecipe( true, - new ItemStack[] {WerkstoffLoader.Tiberium.get(stick)}, + new ItemStack[] { WerkstoffLoader.Tiberium.get(stick) }, new ItemStack[] {}, null, null, @@ -513,15 +471,15 @@ public class AdditionalRecipes { try { Class map = GT_Recipe.GT_Recipe_Map.class; - GT_Recipe.GT_Recipe_Map sHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) - FieldUtils.getField(map, "sHugeNaquadahReactorFuels").get(null); - GT_Recipe.GT_Recipe_Map sExtremeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) - FieldUtils.getField(map, "sExtremeNaquadahReactorFuels").get(null); - GT_Recipe.GT_Recipe_Map sUltraHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) - FieldUtils.getField(map, "sUltraHugeNaquadahReactorFuels").get(null); + GT_Recipe.GT_Recipe_Map sHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils + .getField(map, "sHugeNaquadahReactorFuels").get(null); + GT_Recipe.GT_Recipe_Map sExtremeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils + .getField(map, "sExtremeNaquadahReactorFuels").get(null); + GT_Recipe.GT_Recipe_Map sUltraHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils + .getField(map, "sUltraHugeNaquadahReactorFuels").get(null); sHugeNaquadahReactorFuels.addRecipe( true, - new ItemStack[] {WerkstoffLoader.Tiberium.get(stickLong)}, + new ItemStack[] { WerkstoffLoader.Tiberium.get(stickLong) }, new ItemStack[] {}, null, null, @@ -531,7 +489,7 @@ public class AdditionalRecipes { 125000); sExtremeNaquadahReactorFuels.addRecipe( true, - new ItemStack[] {WerkstoffLoader.Tiberium.get(stick)}, + new ItemStack[] { WerkstoffLoader.Tiberium.get(stick) }, new ItemStack[] {}, null, null, @@ -541,7 +499,7 @@ public class AdditionalRecipes { 31250); sUltraHugeNaquadahReactorFuels.addRecipe( true, - new ItemStack[] {WerkstoffLoader.Tiberium.get(stickLong)}, + new ItemStack[] { WerkstoffLoader.Tiberium.get(stickLong) }, new ItemStack[] {}, null, null, @@ -549,8 +507,7 @@ public class AdditionalRecipes { 0, 0, 125000); - } catch (NullPointerException | IllegalAccessException ignored) { - } + } catch (NullPointerException | IllegalAccessException ignored) {} LoadItemContainers.run(); @@ -581,14 +538,11 @@ public class AdditionalRecipes { 400); GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - ItemList.NaquadahCell_1.get(32L), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), - WerkstoffLoader.Tiberium.get(dust, 64), - WerkstoffLoader.Tiberium.get(dust, 64) - }, + new ItemStack[] { ItemList.NaquadahCell_1.get(32L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), + WerkstoffLoader.Tiberium.get(dust, 64), WerkstoffLoader.Tiberium.get(dust, 64) }, null, BW_NonMeta_MaterialItems.TheCoreCell.get(1L), 100, @@ -606,8 +560,7 @@ public class AdditionalRecipes { boolean aElementSet = false; for (Element e : Element.values()) { if (e.toString().equals("Uuo")) { - werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null - ? werkstoff.getBridgeMaterial() + werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : new Materials( -1, werkstoff.getTexSet(), @@ -642,8 +595,8 @@ public class AdditionalRecipes { false, new BWRecipes.DynamicGTRecipe( false, - new ItemStack[] {werkstoff.get(cell)}, - new ItemStack[] {scannerOutput}, + new ItemStack[] { werkstoff.get(cell) }, + new ItemStack[] { scannerOutput }, ItemList.Tool_DataOrb.get(1L), null, null, @@ -655,11 +608,11 @@ public class AdditionalRecipes { false, new BWRecipes.DynamicGTRecipe( false, - new ItemStack[] {Materials.Empty.getCells(1)}, - new ItemStack[] {werkstoff.get(cell)}, + new ItemStack[] { Materials.Empty.getCells(1) }, + new ItemStack[] { werkstoff.get(cell) }, scannerOutput, null, - new FluidStack[] {Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, + new FluidStack[] { Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass()) }, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java index f14acac2bc..84b78c9b2b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; @@ -27,6 +18,7 @@ import static gregtech.api.enums.OrePrefixes.dustSmall; import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -49,7 +41,7 @@ public class AfterLuVTierEnhacement { WerkstoffLoader.Zirconium.get(dust, 2), GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 8L), GT_OreDictUnificator.get(dust, Materials.Platinum, 1L), - new int[] {10_000, 5_000, 5_000, 2_500, 10_000, 10_000}, + new int[] { 10_000, 5_000, 5_000, 2_500, 10_000, 10_000 }, 250, 2000); @@ -64,7 +56,7 @@ public class AfterLuVTierEnhacement { WerkstoffLoader.Zirconium.get(dust, 4), GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 18L), GT_OreDictUnificator.get(dust, Materials.Platinum, 2L), - new int[] {10_000, 5_000, 5_000, 2_500, 10_000, 10_000}, + new int[] { 10_000, 5_000, 5_000, 2_500, 10_000, 10_000 }, 500, 2000); @@ -79,7 +71,7 @@ public class AfterLuVTierEnhacement { WerkstoffLoader.Zirconium.get(dust, 8), GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 38L), GT_OreDictUnificator.get(dust, Materials.Platinum, 4L), - new int[] {10_000, 5_000, 5_000, 2_500, 10_000, 10_000}, + new int[] { 10_000, 5_000, 5_000, 2_500, 10_000, 10_000 }, 1000, 2000); @@ -94,7 +86,7 @@ public class AfterLuVTierEnhacement { GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 48L), - new int[] {10_000, 5_000, 5_000, 10_000, 10_000, 10_000}, + new int[] { 10_000, 5_000, 5_000, 10_000, 10_000, 10_000 }, 2000, 8000); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java index 54bd8d3942..b297217ae5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java @@ -1,34 +1,26 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.StreamUtils; -import gregtech.api.util.GT_Recipe; import java.util.HashSet; import java.util.Objects; import java.util.Set; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.StreamUtils; +import gregtech.api.util.GT_Recipe; + public class DownTierLoader { public static void run() { @@ -37,8 +29,7 @@ public class DownTierLoader { .forEach(map -> { Set newRecipes = new HashSet<>(); Set toRem = new HashSet<>(); - map.mRecipeList.stream() - .filter(recipe -> Objects.nonNull(recipe) && recipe.mEUt > 128) + map.mRecipeList.stream().filter(recipe -> Objects.nonNull(recipe) && recipe.mEUt > 128) .forEach(recipe -> { toRem.add(recipe); newRecipes.add(BW_Util.copyAndSetTierToNewRecipe(recipe, (byte) 2)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java index a613708f29..2b26680738 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java @@ -1,81 +1,77 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; + import gregtech.api.items.GT_RadioactiveCellIC_Item; import gregtech.common.items.GT_DepletetCell_Item; public class LoadItemContainers { public static void run() { - BW_NonMeta_MaterialItems.Depleted_Tiberium_1.set( - new GT_DepletetCell_Item("TiberiumcellDep", "Fuel Rod (Depleted Tiberium)", 1)); - BW_NonMeta_MaterialItems.Depleted_Tiberium_2.set( - new GT_DepletetCell_Item("Double_TiberiumcellDep", "Dual Fuel Rod (Depleted Tiberium)", 1)); - BW_NonMeta_MaterialItems.Depleted_Tiberium_4.set( - new GT_DepletetCell_Item("Quad_TiberiumcellDep", "Quad Fuel Rod (Depleted Tiberium)", 1)); - BW_NonMeta_MaterialItems.TiberiumCell_1.set(new GT_RadioactiveCellIC_Item( - "Tiberiumcell", - "Fuel Rod (Tiberium)", - 1, - 50000, - 2F, - 1, - 0.5F, - BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), - false)); - BW_NonMeta_MaterialItems.TiberiumCell_2.set(new GT_RadioactiveCellIC_Item( - "Double_Tiberiumcell", - "Dual Fuel Rod (Tiberium)", - 2, - 50000, - 2F, - 1, - 0.5F, - BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), - false)); - BW_NonMeta_MaterialItems.TiberiumCell_4.set(new GT_RadioactiveCellIC_Item( - "Quad_Tiberiumcell", - "Quad Fuel Rod (Tiberium)", - 4, - 50000, - 2F, - 1, - 0.5F, - BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), - false)); - BW_NonMeta_MaterialItems.Depleted_TheCoreCell.set( - new GT_DepletetCell_Item("Core_Reactor_CellDep", "Depleted \"The Core\" Cell", 32)); - BW_NonMeta_MaterialItems.TheCoreCell.set(new GT_RadioactiveCellIC_Item( - "Core_Reactor_Cell", - "\"The Core\" Cell", - 32, - 100000, - 8F, - 32, - 1F, - BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), - false)); + BW_NonMeta_MaterialItems.Depleted_Tiberium_1 + .set(new GT_DepletetCell_Item("TiberiumcellDep", "Fuel Rod (Depleted Tiberium)", 1)); + BW_NonMeta_MaterialItems.Depleted_Tiberium_2 + .set(new GT_DepletetCell_Item("Double_TiberiumcellDep", "Dual Fuel Rod (Depleted Tiberium)", 1)); + BW_NonMeta_MaterialItems.Depleted_Tiberium_4 + .set(new GT_DepletetCell_Item("Quad_TiberiumcellDep", "Quad Fuel Rod (Depleted Tiberium)", 1)); + BW_NonMeta_MaterialItems.TiberiumCell_1.set( + new GT_RadioactiveCellIC_Item( + "Tiberiumcell", + "Fuel Rod (Tiberium)", + 1, + 50000, + 2F, + 1, + 0.5F, + BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), + false)); + BW_NonMeta_MaterialItems.TiberiumCell_2.set( + new GT_RadioactiveCellIC_Item( + "Double_Tiberiumcell", + "Dual Fuel Rod (Tiberium)", + 2, + 50000, + 2F, + 1, + 0.5F, + BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), + false)); + BW_NonMeta_MaterialItems.TiberiumCell_4.set( + new GT_RadioactiveCellIC_Item( + "Quad_Tiberiumcell", + "Quad Fuel Rod (Tiberium)", + 4, + 50000, + 2F, + 1, + 0.5F, + BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), + false)); + BW_NonMeta_MaterialItems.Depleted_TheCoreCell + .set(new GT_DepletetCell_Item("Core_Reactor_CellDep", "Depleted \"The Core\" Cell", 32)); + BW_NonMeta_MaterialItems.TheCoreCell.set( + new GT_RadioactiveCellIC_Item( + "Core_Reactor_Cell", + "\"The Core\" Cell", + 32, + 100000, + 8F, + 32, + 1F, + BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), + false)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/IWerkstoffRunnable.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/IWerkstoffRunnable.java index 6e68abc432..d409084406 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/IWerkstoffRunnable.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/IWerkstoffRunnable.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders; @@ -25,5 +16,6 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; public interface IWerkstoffRunnable { + void run(Werkstoff werkstoff); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java index 7b1d649b50..264ace8f96 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java @@ -1,27 +1,20 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import java.util.Objects; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -29,9 +22,9 @@ import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWer import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; + import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TC_Aspects; -import java.util.Objects; public class AspectLoader implements IWerkstoffRunnable { @@ -41,20 +34,22 @@ public class AspectLoader implements IWerkstoffRunnable { for (OrePrefixes enabledOrePrefixes : WerkstoffLoader.ENABLED_ORE_PREFIXES) { if (werkstoff.hasItemType(enabledOrePrefixes)) { if (enabledOrePrefixes.mMaterialAmount >= 3628800L || enabledOrePrefixes == OrePrefixes.ore) { - DebugLog.log("OrePrefix: " + enabledOrePrefixes.name() + " mMaterialAmount: " - + enabledOrePrefixes.mMaterialAmount / 3628800L); + DebugLog.log( + "OrePrefix: " + enabledOrePrefixes.name() + + " mMaterialAmount: " + + enabledOrePrefixes.mMaterialAmount / 3628800L); if (Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes))) ThaumcraftHandler.AspectAdder.addAspectViaBW( werkstoff.get(enabledOrePrefixes), werkstoff.getTCAspects( - enabledOrePrefixes == OrePrefixes.ore - ? 1 + enabledOrePrefixes == OrePrefixes.ore ? 1 : (int) (enabledOrePrefixes.mMaterialAmount / 3628800L))); } else if (enabledOrePrefixes.mMaterialAmount >= 0L) { if (Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes))) - //noinspection unchecked + // noinspection unchecked ThaumcraftHandler.AspectAdder.addAspectViaBW( - werkstoff.get(enabledOrePrefixes), new Pair<>(TC_Aspects.PERDITIO.mAspect, 1)); + werkstoff.get(enabledOrePrefixes), + new Pair<>(TC_Aspects.PERDITIO.mAspect, 1)); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java index 9d3cbc4b96..f5f105a00e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java @@ -1,42 +1,40 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; import static gregtech.api.enums.OrePrefixes.*; +import net.minecraft.item.ItemStack; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import gregtech.api.enums.GT_Values; -import net.minecraft.item.ItemStack; public class BlockLoader implements IWerkstoffRunnable { + @Override public void run(Werkstoff werkstoff) { if (!werkstoff.hasItemType(block)) return; if (werkstoff.hasItemType(ingot)) { GT_Values.RA.addArcFurnaceRecipe( - werkstoff.get(block), new ItemStack[] {werkstoff.get(ingot, 9)}, null, 16, 90, false); + werkstoff.get(block), + new ItemStack[] { werkstoff.get(ingot, 9) }, + null, + 16, + 90, + false); } if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(block), null, werkstoff.getMolten(1296), 0, 288, 8); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java index d774ff166d..58acea03ae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; @@ -26,57 +17,53 @@ import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasingAdvanced; import static gregtech.api.enums.OrePrefixes.*; +import net.minecraft.item.ItemStack; + import com.github.bartimaeusnek.bartworks.system.material.BW_GT_MaterialReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; -import net.minecraft.item.ItemStack; public class CasingLoader implements IWerkstoffRunnable { + @Override public void run(Werkstoff werkstoff) { - if (werkstoff == BW_GT_MaterialReference.Wood /*|| werkstoff == BW_GT_MaterialReference.WoodSealed*/) { + if (werkstoff == BW_GT_MaterialReference.Wood /* || werkstoff == BW_GT_MaterialReference.WoodSealed */) { addCasingRecipes(werkstoff, plank); } else { - if (!(werkstoff.hasGenerationFeature(blockCasing) - && werkstoff.doesOreDictedItemExists(plate) + if (!(werkstoff.hasGenerationFeature(blockCasing) && werkstoff.doesOreDictedItemExists(plate) && werkstoff.doesOreDictedItemExists(screw) && werkstoff.doesOreDictedItemExists(gearGtSmall) && werkstoff.doesOreDictedItemExists(gearGt) - && werkstoff.doesOreDictedItemExists(plateDouble))) return; + && werkstoff.doesOreDictedItemExists(plateDouble))) + return; addCasingRecipes(werkstoff, plateDouble); } } private static void addCasingRecipes(Werkstoff werkstoff, OrePrefixes reboltedCasingsOuterStuff) { - GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasing), new Object[] { - "PSP", "PGP", "PSP", 'P', werkstoff.get(plate), 'S', werkstoff.get(screw), 'G', werkstoff.get(gearGtSmall) - }); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(blockCasing), + new Object[] { "PSP", "PGP", "PSP", 'P', werkstoff.get(plate), 'S', werkstoff.get(screw), 'G', + werkstoff.get(gearGtSmall) }); GT_Values.RA.addAssemblerRecipe( - new ItemStack[] {werkstoff.get(plate, 6), werkstoff.get(screw, 2), werkstoff.get(gearGtSmall)}, + new ItemStack[] { werkstoff.get(plate, 6), werkstoff.get(screw, 2), werkstoff.get(gearGtSmall) }, GT_Values.NF, werkstoff.get(blockCasing), 200, 30); - GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasingAdvanced), new Object[] { - "PSP", - "PGP", - "PSP", - 'P', - werkstoff.get(reboltedCasingsOuterStuff), - 'S', - werkstoff.get(screw), - 'G', - werkstoff.get(gearGt) - }); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(blockCasingAdvanced), + new Object[] { "PSP", "PGP", "PSP", 'P', werkstoff.get(reboltedCasingsOuterStuff), 'S', + werkstoff.get(screw), 'G', werkstoff.get(gearGt) }); GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - werkstoff.get(reboltedCasingsOuterStuff, 6), werkstoff.get(screw, 2), werkstoff.get(gearGt) - }, + new ItemStack[] { werkstoff.get(reboltedCasingsOuterStuff, 6), werkstoff.get(screw, 2), + werkstoff.get(gearGt) }, GT_Values.NF, werkstoff.get(blockCasingAdvanced), 200, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java index 32e72c96e6..ce3207484b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java @@ -1,35 +1,36 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; import static gregtech.api.enums.OrePrefixes.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Objects; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.Pair; + import gregtech.api.enums.*; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_ModHandler; @@ -37,15 +38,9 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Objects; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; public class CellLoader implements IWerkstoffRunnable { + @Override @SuppressWarnings("unchecked") public void run(Werkstoff werkstoff) { @@ -57,12 +52,11 @@ public class CellLoader implements IWerkstoffRunnable { List stOutputs = new ArrayList<>(); HashMap> tracker = new HashMap<>(); int cells = 0; - for (Pair container : - werkstoff.getContents().getValue().toArray(new Pair[0])) { + for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { if (container.getKey() instanceof Materials) { if ((((Materials) container.getKey()).hasCorrespondingGas() - || ((Materials) container.getKey()).hasCorrespondingFluid() - || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) + || ((Materials) container.getKey()).hasCorrespondingFluid() + || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) && ((Materials) container.getKey()).getDust(0) == null) { FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000L * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { @@ -74,8 +68,8 @@ public class CellLoader implements IWerkstoffRunnable { stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Materials) container.getKey()) - .getCells( + stOutputs.add( + ((Materials) container.getKey()).getCells( tracker.get(container.getKey()).getKey() + container.getValue())); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } @@ -87,8 +81,9 @@ public class CellLoader implements IWerkstoffRunnable { stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Materials) container.getKey()) - .getDust(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.add( + ((Materials) container.getKey()) + .getDust(tracker.get(container.getKey()).getKey() + container.getValue())); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } } @@ -105,8 +100,8 @@ public class CellLoader implements IWerkstoffRunnable { stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Werkstoff) container.getKey()) - .get( + stOutputs.add( + ((Werkstoff) container.getKey()).get( cell, tracker.get(container.getKey()).getKey() + container.getValue())); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); @@ -119,8 +114,10 @@ public class CellLoader implements IWerkstoffRunnable { stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Werkstoff) container.getKey()) - .get(dust, (tracker.get(container.getKey()).getKey() + container.getValue()))); + stOutputs.add( + ((Werkstoff) container.getKey()).get( + dust, + (tracker.get(container.getKey()).getKey() + container.getValue()))); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } } @@ -132,45 +129,50 @@ public class CellLoader implements IWerkstoffRunnable { int cellEmpty = cells - 1; stOutputs.add(Materials.Empty.getCells(-cellEmpty)); - if (werkstoff.getStats().isElektrolysis()) - GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe( - true, - new ItemStack[] {input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null}, - stOutputs.toArray(new ItemStack[0]), - null, - null, - new FluidStack[] {null}, - new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, - (int) Math.max( - 1L, - Math.abs(werkstoff.getStats().getProtons() - * werkstoff.getContents().getValue().size())), - Math.min(4, werkstoff.getContents().getValue().size()) * 30, - 0)); - if (werkstoff.getStats().isCentrifuge()) - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe( - true, - new ItemStack[] {input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null}, - stOutputs.toArray(new ItemStack[0]), - null, - null, - new FluidStack[] {null}, - new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, - (int) Math.max( - 1L, - Math.abs(werkstoff.getStats().getMass() - * werkstoff.getContents().getValue().size())), - Math.min(4, werkstoff.getContents().getValue().size()) * 5, - 0)); + if (werkstoff.getStats().isElektrolysis()) GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add( + new BWRecipes.DynamicGTRecipe( + true, + new ItemStack[] { input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null }, + stOutputs.toArray(new ItemStack[0]), + null, + null, + new FluidStack[] { null }, + new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, + (int) Math.max( + 1L, + Math.abs( + werkstoff.getStats().getProtons() + * werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 30, + 0)); + if (werkstoff.getStats().isCentrifuge()) GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add( + new BWRecipes.DynamicGTRecipe( + true, + new ItemStack[] { input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null }, + stOutputs.toArray(new ItemStack[0]), + null, + null, + new FluidStack[] { null }, + new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, + (int) Math.max( + 1L, + Math.abs( + werkstoff.getStats().getMass() + * werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 5, + 0)); } // Tank "Recipe" - GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData( - new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), - werkstoff.get(cell), - Materials.Empty.getCells(1))); + GT_Utility.addFluidContainerData( + new FluidContainerRegistry.FluidContainerData( + new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), + werkstoff.get(cell), + Materials.Empty.getCells(1))); FluidContainerRegistry.registerFluidContainer( - werkstoff.getFluidOrGas(1).getFluid(), werkstoff.get(cell), Materials.Empty.getCells(1)); + werkstoff.getFluidOrGas(1).getFluid(), + werkstoff.get(cell), + Materials.Empty.getCells(1)); GT_Values.RA.addFluidCannerRecipe( Materials.Empty.getCells(1), werkstoff.get(cell), @@ -218,8 +220,7 @@ public class CellLoader implements IWerkstoffRunnable { boolean ElementSet = false; for (Element e : Element.values()) { if (e.toString().equals(werkstoff.getToolTip())) { - werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null - ? werkstoff.getBridgeMaterial() + werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : new Materials( -1, werkstoff.getTexSet(), @@ -239,14 +240,14 @@ public class CellLoader implements IWerkstoffRunnable { if (!ElementSet) return; GT_OreDictUnificator.addAssociation(cell, werkstoffBridgeMaterial, werkstoff.get(cell), false); - // try { - // Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); - // f.setAccessible(true); - // Map MATERIALS_MAP = (Map) f.get(null); - // MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); - // } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { - // e.printStackTrace(); - // } + // try { + // Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); + // f.setAccessible(true); + // Map MATERIALS_MAP = (Map) f.get(null); + // MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); + // } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { + // e.printStackTrace(); + // } ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); @@ -254,8 +255,8 @@ public class CellLoader implements IWerkstoffRunnable { false, new BWRecipes.DynamicGTRecipe( false, - new ItemStack[] {werkstoff.get(cell)}, - new ItemStack[] {scannerOutput}, + new ItemStack[] { werkstoff.get(cell) }, + new ItemStack[] { scannerOutput }, ItemList.Tool_DataOrb.get(1L), null, null, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java index 9abca71e18..ccf8b21ffd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java @@ -1,42 +1,36 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; import static gregtech.api.enums.OrePrefixes.*; +import net.minecraft.item.ItemStack; + import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Proxy; -import net.minecraft.item.ItemStack; public class CraftingMaterialLoader implements IWerkstoffRunnable { + @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(screw)) { @@ -56,7 +50,11 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 4); GT_Values.RA.addPulveriserRecipe( - werkstoff.get(bolt), new ItemStack[] {werkstoff.get(dustTiny, 1)}, null, 2, 8); + werkstoff.get(bolt), + new ItemStack[] { werkstoff.get(dustTiny, 1) }, + null, + 2, + 8); // screw GT_Values.RA.addLatheRecipe( @@ -66,9 +64,15 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { (int) Math.max(werkstoff.getStats().getMass() / 8L, 1L), 4); GT_ModHandler.addCraftingRecipe( - werkstoff.get(screw), GT_Proxy.tBits, new Object[] {"fX", "X ", 'X', werkstoff.get(bolt)}); + werkstoff.get(screw), + GT_Proxy.tBits, + new Object[] { "fX", "X ", 'X', werkstoff.get(bolt) }); GT_Values.RA.addPulveriserRecipe( - werkstoff.get(screw), new ItemStack[] {werkstoff.get(dustTiny, 1)}, null, 2, 8); + werkstoff.get(screw), + new ItemStack[] { werkstoff.get(dustTiny, 1) }, + null, + 2, + 8); if (werkstoff.hasItemType(gem)) return; @@ -80,12 +84,15 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 6 * tVoltageMultiplier); GT_ModHandler.addCraftingRecipe( - werkstoff.get(ring), GT_Proxy.tBits, new Object[] {"h ", "fX", 'X', werkstoff.get(stick)}); + werkstoff.get(ring), + GT_Proxy.tBits, + new Object[] { "h ", "fX", 'X', werkstoff.get(stick) }); // Gear - GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGt), GT_Proxy.tBits, new Object[] { - "SPS", "PwP", "SPS", 'P', werkstoff.get(plate), 'S', werkstoff.get(stick) - }); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(gearGt), + GT_Proxy.tBits, + new Object[] { "SPS", "PwP", "SPS", 'P', werkstoff.get(plate), 'S', werkstoff.get(stick) }); GT_Values.RA.addExtruderRecipe( werkstoff.get(ingot, 4), ItemList.Shape_Extruder_Gear.get(0L), @@ -114,26 +121,27 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { 8 * tVoltageMultiplier); // smallGear - if (WerkstoffLoader.smallGearShape != null) - GT_Values.RA.addExtruderRecipe( - werkstoff.get(ingot), - WerkstoffLoader.smallGearShape.get(0L), - werkstoff.get(gearGtSmall), - (int) werkstoff.getStats().getMass(), - 8 * tVoltageMultiplier); - if (ConfigHandler.hardmode) - GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[] { - " S ", "hPx", " S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate) - }); - else - GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[] { - "P ", " h ", 'P', werkstoff.get(plate) - }); + if (WerkstoffLoader.smallGearShape != null) GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot), + WerkstoffLoader.smallGearShape.get(0L), + werkstoff.get(gearGtSmall), + (int) werkstoff.getStats().getMass(), + 8 * tVoltageMultiplier); + if (ConfigHandler.hardmode) GT_ModHandler.addCraftingRecipe( + werkstoff.get(gearGtSmall), + GT_Proxy.tBits, + new Object[] { " S ", "hPx", " S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate) }); + else GT_ModHandler.addCraftingRecipe( + werkstoff.get(gearGtSmall), + GT_Proxy.tBits, + new Object[] { "P ", " h ", 'P', werkstoff.get(plate) }); // Rotor - GT_ModHandler.addCraftingRecipe(werkstoff.get(rotor), GT_Proxy.tBits, new Object[] { - "PhP", "SRf", "PdP", 'P', werkstoff.get(plate), 'R', werkstoff.get(ring), 'S', werkstoff.get(screw) - }); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(rotor), + GT_Proxy.tBits, + new Object[] { "PhP", "SRf", "PdP", 'P', werkstoff.get(plate), 'R', werkstoff.get(ring), 'S', + werkstoff.get(screw) }); GT_Values.RA.addAssemblerRecipe( werkstoff.get(plate, 4), werkstoff.get(ring), @@ -156,56 +164,50 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { 240, 24); - if (WerkstoffLoader.rotorShape != null) - GT_Values.RA.addExtruderRecipe( - werkstoff.get(ingot, 5), WerkstoffLoader.rotorShape.get(0L), werkstoff.get(rotor), 200, 60); + if (WerkstoffLoader.rotorShape != null) GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot, 5), + WerkstoffLoader.rotorShape.get(0L), + werkstoff.get(rotor), + 200, + 60); // molten -> metal if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { - /* !! No more hardcoded gear, etc. recipe gen, now must go through GenerationFeatures() !! - - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Gear.get(0L), werkstoff.getMolten(576), werkstoff.get(gearGt), 128, 8); - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Gear_Small.get(0L), - werkstoff.getMolten(144), - werkstoff.get(gearGtSmall), - 16, - 8); - if (WerkstoffLoader.ringMold != null) - GT_Values.RA.addFluidSolidifierRecipe( - WerkstoffLoader.ringMold.get(0L), - werkstoff.getMolten(36), - werkstoff.get(ring), - 100, - 4 * tVoltageMultiplier); - if (WerkstoffLoader.boltMold != null) - GT_Values.RA.addFluidSolidifierRecipe( - WerkstoffLoader.boltMold.get(0L), - werkstoff.getMolten(18), - werkstoff.get(bolt), - 50, - 2 * tVoltageMultiplier); - - if (WerkstoffLoader.rotorMold != null) - GT_Values.RA.addFluidSolidifierRecipe( - WerkstoffLoader.rotorMold.get(0L), werkstoff.getMolten(612), werkstoff.get(rotor), 100, 60); - */ + /* + * !! No more hardcoded gear, etc. recipe gen, now must go through GenerationFeatures() !! + * GT_Values.RA.addFluidSolidifierRecipe( ItemList.Shape_Mold_Gear.get(0L), werkstoff.getMolten(576), + * werkstoff.get(gearGt), 128, 8); GT_Values.RA.addFluidSolidifierRecipe( + * ItemList.Shape_Mold_Gear_Small.get(0L), werkstoff.getMolten(144), werkstoff.get(gearGtSmall), 16, 8); + * if (WerkstoffLoader.ringMold != null) GT_Values.RA.addFluidSolidifierRecipe( + * WerkstoffLoader.ringMold.get(0L), werkstoff.getMolten(36), werkstoff.get(ring), 100, 4 * + * tVoltageMultiplier); if (WerkstoffLoader.boltMold != null) GT_Values.RA.addFluidSolidifierRecipe( + * WerkstoffLoader.boltMold.get(0L), werkstoff.getMolten(18), werkstoff.get(bolt), 50, 2 * + * tVoltageMultiplier); if (WerkstoffLoader.rotorMold != null) GT_Values.RA.addFluidSolidifierRecipe( + * WerkstoffLoader.rotorMold.get(0L), werkstoff.getMolten(612), werkstoff.get(rotor), 100, 60); + */ } + GT_Values.RA + .addPulveriserRecipe(werkstoff.get(gearGt), new ItemStack[] { werkstoff.get(dust, 4) }, null, 2, 8); GT_Values.RA.addPulveriserRecipe( - werkstoff.get(gearGt), new ItemStack[] {werkstoff.get(dust, 4)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe( - werkstoff.get(gearGtSmall), new ItemStack[] {werkstoff.get(dust, 1)}, null, 2, 8); + werkstoff.get(gearGtSmall), + new ItemStack[] { werkstoff.get(dust, 1) }, + null, + 2, + 8); GT_Values.RA.addPulveriserRecipe( werkstoff.get(rotor), - new ItemStack[] {werkstoff.get(dust, 4), werkstoff.get(dustSmall)}, + new ItemStack[] { werkstoff.get(dust, 4), werkstoff.get(dustSmall) }, null, 2, 8); GT_Values.RA.addPulveriserRecipe( - werkstoff.get(ring), new ItemStack[] {werkstoff.get(dustSmall, 1)}, null, 2, 8); + werkstoff.get(ring), + new ItemStack[] { werkstoff.get(dustSmall, 1) }, + null, + 2, + 8); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java index 3967a56e6e..7fa823d520 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; @@ -26,6 +17,7 @@ import static gregtech.api.enums.OrePrefixes.*; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; + import gregtech.GT_Mod; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -34,6 +26,7 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; public class CrushedLoader implements IWerkstoffRunnable { + @Override public void run(Werkstoff werkstoff) { if (!werkstoff.hasItemType(ore) || !werkstoff.hasItemType(dust)) return; @@ -54,25 +47,32 @@ public class CrushedLoader implements IWerkstoffRunnable { } GT_ModHandler.addCraftingRecipe( - werkstoff.get(dustImpure), new Object[] {"h ", "W ", 'W', werkstoff.get(crushed)}); + werkstoff.get(dustImpure), + new Object[] { "h ", "W ", 'W', werkstoff.get(crushed) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(dustPure), new Object[] {"h ", "W ", 'W', werkstoff.get(crushedPurified)}); + werkstoff.get(dustPure), + new Object[] { "h ", "W ", 'W', werkstoff.get(crushedPurified) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(dust), new Object[] {"h ", "W ", 'W', werkstoff.get(crushedCentrifuged)}); + werkstoff.get(dust), + new Object[] { "h ", "W ", 'W', werkstoff.get(crushedCentrifuged) }); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), 10, 16); GT_ModHandler.addPulverisationRecipe( - werkstoff.get(crushed), werkstoff.get(dustImpure), werkstoff.getOreByProduct(0, dust), 10, false); + werkstoff.get(crushed), + werkstoff.get(dustImpure), + werkstoff.getOreByProduct(0, dust), + 10, + false); GT_ModHandler.addOreWasherRecipe( werkstoff.get(crushed), - new int[] {10000, 1111, 10000}, + new int[] { 10000, 1111, 10000 }, 1000, werkstoff.get(crushedPurified), werkstoff.getOreByProduct(0, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); GT_ModHandler.addThermalCentrifugeRecipe( werkstoff.get(crushed), - new int[] {10000, 1111, 10000}, + new int[] { 10000, 1111, 10000 }, (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dust), @@ -80,17 +80,25 @@ public class CrushedLoader implements IWerkstoffRunnable { GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), 10, 16); GT_ModHandler.addPulverisationRecipe( - werkstoff.get(crushedPurified), werkstoff.get(dustPure), werkstoff.getOreByProduct(1, dust), 10, false); + werkstoff.get(crushedPurified), + werkstoff.get(dustPure), + werkstoff.getOreByProduct(1, dust), + 10, + false); GT_ModHandler.addThermalCentrifugeRecipe( werkstoff.get(crushedPurified), - new int[] {10000, 1111}, + new int[] { 10000, 1111 }, (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dust)); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(dust), 10, 16); GT_ModHandler.addPulverisationRecipe( - werkstoff.get(crushedCentrifuged), werkstoff.get(dust), werkstoff.getOreByProduct(2, dust), 10, false); + werkstoff.get(crushedCentrifuged), + werkstoff.get(dust), + werkstoff.getOreByProduct(2, dust), + 10, + false); GT_Values.RA.addCentrifugeRecipe( werkstoff.get(dustImpure), @@ -103,7 +111,7 @@ public class CrushedLoader implements IWerkstoffRunnable { null, null, null, - new int[] {10000, 1111}, + new int[] { 10000, 1111 }, (int) Math.max(1L, werkstoff.getStats().getMass() * 8L), 5); GT_Values.RA.addCentrifugeRecipe( @@ -117,15 +125,25 @@ public class CrushedLoader implements IWerkstoffRunnable { null, null, null, - new int[] {10000, 1111}, + new int[] { 10000, 1111 }, (int) Math.max(1L, werkstoff.getStats().getMass() * 8L), 5); if (werkstoff.contains(SubTag.CRYSTALLISABLE)) { GT_Values.RA.addAutoclaveRecipe( - werkstoff.get(dustPure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); + werkstoff.get(dustPure), + Materials.Water.getFluid(200L), + werkstoff.get(gem), + 9000, + 2000, + 24); GT_Values.RA.addAutoclaveRecipe( - werkstoff.get(dustImpure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); + werkstoff.get(dustImpure), + Materials.Water.getFluid(200L), + werkstoff.get(gem), + 9000, + 2000, + 24); GT_Values.RA.addAutoclaveRecipe( werkstoff.get(dustPure), gregtech.api.util.GT_ModHandler.getDistilledWater(200L), @@ -141,42 +159,39 @@ public class CrushedLoader implements IWerkstoffRunnable { 1500, 24); } - if (werkstoff.contains(SubTag.WASHING_MERCURY)) - GT_Values.RA.addChemicalBathRecipe( - werkstoff.get(crushed), - Materials.Mercury.getFluid(1000L), - werkstoff.get(crushedPurified), - werkstoff.getOreByProduct(1, dust), - GT_OreDictUnificator.get(dust, Materials.Stone, 1L), - new int[] {10000, 7000, 4000}, - 800, - 8); - if (werkstoff.contains(SubTag.WASHING_SODIUMPERSULFATE)) - GT_Values.RA.addChemicalBathRecipe( - werkstoff.get(crushed), - Materials.SodiumPersulfate.getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L), - werkstoff.get(crushedPurified), - werkstoff.getOreByProduct(1, dust), - GT_OreDictUnificator.get(dust, Materials.Stone, 1L), - new int[] {10000, 7000, 4000}, - 800, - 8); - if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_GOLD)) - GT_Values.RA.addElectromagneticSeparatorRecipe( - werkstoff.get(dustPure), - werkstoff.get(dust), - GT_OreDictUnificator.get(dustSmall, Materials.Gold, 1L), - GT_OreDictUnificator.get(nugget, Materials.Gold, 1L), - new int[] {10000, 4000, 2000}, - 400, - 24); + if (werkstoff.contains(SubTag.WASHING_MERCURY)) GT_Values.RA.addChemicalBathRecipe( + werkstoff.get(crushed), + Materials.Mercury.getFluid(1000L), + werkstoff.get(crushedPurified), + werkstoff.getOreByProduct(1, dust), + GT_OreDictUnificator.get(dust, Materials.Stone, 1L), + new int[] { 10000, 7000, 4000 }, + 800, + 8); + if (werkstoff.contains(SubTag.WASHING_SODIUMPERSULFATE)) GT_Values.RA.addChemicalBathRecipe( + werkstoff.get(crushed), + Materials.SodiumPersulfate.getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L), + werkstoff.get(crushedPurified), + werkstoff.getOreByProduct(1, dust), + GT_OreDictUnificator.get(dust, Materials.Stone, 1L), + new int[] { 10000, 7000, 4000 }, + 800, + 8); + if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_GOLD)) GT_Values.RA.addElectromagneticSeparatorRecipe( + werkstoff.get(dustPure), + werkstoff.get(dust), + GT_OreDictUnificator.get(dustSmall, Materials.Gold, 1L), + GT_OreDictUnificator.get(nugget, Materials.Gold, 1L), + new int[] { 10000, 4000, 2000 }, + 400, + 24); else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_IRON)) GT_Values.RA.addElectromagneticSeparatorRecipe( werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Iron, 1L), GT_OreDictUnificator.get(nugget, Materials.Iron, 1L), - new int[] {10000, 4000, 2000}, + new int[] { 10000, 4000, 2000 }, 400, 24); else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM)) @@ -185,7 +200,7 @@ public class CrushedLoader implements IWerkstoffRunnable { werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Neodymium, 1L), GT_OreDictUnificator.get(nugget, Materials.Neodymium, 1L), - new int[] {10000, 4000, 2000}, + new int[] { 10000, 4000, 2000 }, 400, 24); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java index 3abe76739a..cba5049dbe 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java @@ -1,34 +1,33 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; import static gregtech.api.enums.OrePrefixes.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.Pair; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -37,11 +36,6 @@ import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class DustLoader implements IWerkstoffRunnable { @@ -54,16 +48,15 @@ public class DustLoader implements IWerkstoffRunnable { HashMap> tracker = new HashMap<>(); int cells = 0; - if (werkstoff.getGenerationFeatures().hasMixerRecipes() - || werkstoff.getStats().isElektrolysis() + if (werkstoff.getGenerationFeatures().hasMixerRecipes() || werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { - for (Pair container : - werkstoff.getContents().getValue().toArray(new Pair[0])) { + for (Pair container : werkstoff.getContents().getValue() + .toArray(new Pair[0])) { if (container.getKey() instanceof Materials) { if ((((Materials) container.getKey()).getGas(0) != null - || ((Materials) container.getKey()).getFluid(0) != null - || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) + || ((Materials) container.getKey()).getFluid(0) != null + || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) && ((Materials) container.getKey()).getDust(0) == null) { FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000L * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { @@ -74,14 +67,13 @@ public class DustLoader implements IWerkstoffRunnable { if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); tracker.put( - container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + container.getKey(), + new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Materials) container.getKey()) - .getCells(tracker.get(container.getKey()) - .getKey() - + container.getValue())); - stOutputs.remove( - tracker.get(container.getKey()).getValue() + 1); + stOutputs.add( + ((Materials) container.getKey()).getCells( + tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } cells += container.getValue(); } @@ -90,8 +82,8 @@ public class DustLoader implements IWerkstoffRunnable { if (((Materials) container.getKey()).getCells(container.getValue()) != null && (((Materials) container.getKey()).getMolten(0) != null || ((Materials) container.getKey()).getSolid(0) != null)) { - FluidStack tmpFl = - ((Materials) container.getKey()).getMolten(1000L * container.getValue()); + FluidStack tmpFl = ((Materials) container.getKey()) + .getMolten(1000L * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = ((Materials) container.getKey()).getSolid(1000L * container.getValue()); } @@ -104,13 +96,11 @@ public class DustLoader implements IWerkstoffRunnable { container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Materials) container.getKey()) - .getCells(tracker.get(container.getKey()) - .getKey() - + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()) - .getValue() - + 1); + stOutputs.add( + ((Materials) container.getKey()).getCells( + tracker.get(container.getKey()).getKey() + + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } cells += container.getValue(); } @@ -120,16 +110,17 @@ public class DustLoader implements IWerkstoffRunnable { stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Materials) container.getKey()) - .getDust(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.add( + ((Materials) container.getKey()).getDust( + tracker.get(container.getKey()).getKey() + container.getValue())); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } } } else if (container.getKey() instanceof Werkstoff) { if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) { - FluidStack tmpFl = - ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); + FluidStack tmpFl = ((Werkstoff) container.getKey()) + .getFluidOrGas(1000 * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); } @@ -138,16 +129,14 @@ public class DustLoader implements IWerkstoffRunnable { if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); tracker.put( - container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + container.getKey(), + new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Werkstoff) container.getKey()) - .get( + stOutputs.add( + ((Werkstoff) container.getKey()).get( cell, - tracker.get(container.getKey()) - .getKey() - + container.getValue())); - stOutputs.remove( - tracker.get(container.getKey()).getValue() + 1); + tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } cells += container.getValue(); } @@ -157,8 +146,8 @@ public class DustLoader implements IWerkstoffRunnable { stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Werkstoff) container.getKey()) - .get( + stOutputs.add( + ((Werkstoff) container.getKey()).get( dust, (tracker.get(container.getKey()).getKey() + container.getValue()))); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); @@ -171,80 +160,87 @@ public class DustLoader implements IWerkstoffRunnable { if (werkstoff.getStats().isElektrolysis()) { GT_Recipe tRecipe = new BWRecipes.DynamicGTRecipe( true, - new ItemStack[] {input, cells > 0 ? Materials.Empty.getCells(cells) : null}, + new ItemStack[] { input, cells > 0 ? Materials.Empty.getCells(cells) : null }, stOutputs.toArray(new ItemStack[0]), null, null, - new FluidStack[] {null}, - new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, + new FluidStack[] { null }, + new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, (int) Math.max( 1L, - Math.abs(werkstoff.getStats().getProtons() - / werkstoff.getContents().getValue().size())), + Math.abs( + werkstoff.getStats().getProtons() + / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(tRecipe); GT_Recipe.GT_Recipe_Map.sMultiblockElectrolyzerRecipes.add(tRecipe); } if (werkstoff.getStats().isCentrifuge()) { - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe( - true, - new ItemStack[] {input, cells > 0 ? Materials.Empty.getCells(cells) : null}, - stOutputs.toArray(new ItemStack[0]), - null, - null, - new FluidStack[] {null}, - new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, - (int) Math.max( - 1L, - Math.abs(werkstoff.getStats().getMass() - / werkstoff.getContents().getValue().size())), - Math.min(4, werkstoff.getContents().getValue().size()) * 5, - 0)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add( + new BWRecipes.DynamicGTRecipe( + true, + new ItemStack[] { input, cells > 0 ? Materials.Empty.getCells(cells) : null }, + stOutputs.toArray(new ItemStack[0]), + null, + null, + new FluidStack[] { null }, + new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, + (int) Math.max( + 1L, + Math.abs( + werkstoff.getStats().getMass() + / werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 5, + 0)); GT_Recipe tRecipe = new GT_Recipe( false, stOutputs.toArray(new ItemStack[0]), - new ItemStack[] {input}, + new ItemStack[] { input }, null, null, - new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, + new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, null, (int) Math.max( 1L, - Math.abs(werkstoff.getStats().getProtons() - / werkstoff.getContents().getValue().size())), + Math.abs( + werkstoff.getStats().getProtons() + / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); GT_Recipe.GT_Recipe_Map.sMultiblockCentrifugeRecipes.add(tRecipe); } if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe( - true, - stOutputs.toArray(new ItemStack[0]), - new ItemStack[] {input}, - null, - null, - new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, - null, - (int) Math.max( - 1L, - Math.abs(werkstoff.getStats().getProtons() - / werkstoff.getContents().getValue().size())), - Math.min(4, werkstoff.getContents().getValue().size()) * 30, - 0)); + GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add( + new BWRecipes.DynamicGTRecipe( + true, + stOutputs.toArray(new ItemStack[0]), + new ItemStack[] { input }, + null, + null, + new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, + null, + (int) Math.max( + 1L, + Math.abs( + werkstoff.getStats().getProtons() + / werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 30, + 0)); GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe( true, stOutputs.toArray(new ItemStack[0]), - new ItemStack[] {input}, + new ItemStack[] { input }, null, null, - new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, + new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, null, (int) Math.max( 1L, - Math.abs(werkstoff.getStats().getProtons() - / werkstoff.getContents().getValue().size())), + Math.abs( + werkstoff.getStats().getProtons() + / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); } @@ -253,32 +249,35 @@ public class DustLoader implements IWerkstoffRunnable { short circuitID = werkstoff.getMixCircuit(); ItemStack circuit = circuitID == -1 ? null : GT_Utility.getIntegratedCircuit(circuitID); if (circuit != null) stOutputs.add(circuit); - GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe( - true, - stOutputs.toArray(new ItemStack[0]), - new ItemStack[] {input}, - null, - null, - new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, - null, - (int) Math.max( - 1L, - Math.abs(werkstoff.getStats().getMass() - / werkstoff.getContents().getValue().size())), - Math.min(4, werkstoff.getContents().getValue().size()) * 5, - 0)); + GT_Recipe.GT_Recipe_Map.sMixerRecipes.add( + new BWRecipes.DynamicGTRecipe( + true, + stOutputs.toArray(new ItemStack[0]), + new ItemStack[] { input }, + null, + null, + new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, + null, + (int) Math.max( + 1L, + Math.abs( + werkstoff.getStats().getMass() + / werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 5, + 0)); GT_Recipe tRecipe = new GT_Recipe( false, stOutputs.toArray(new ItemStack[0]), - new ItemStack[] {input}, + new ItemStack[] { input }, null, null, - new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, + new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, null, (int) Math.max( 1L, - Math.abs(werkstoff.getStats().getProtons() - / werkstoff.getContents().getValue().size())), + Math.abs( + werkstoff.getStats().getProtons() + / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); GT_Recipe.GT_Recipe_Map.sMultiblockMixerRecipes.add(tRecipe); @@ -286,92 +285,108 @@ public class DustLoader implements IWerkstoffRunnable { } GT_ModHandler.addCraftingRecipe( - werkstoff.get(dust), new Object[] {"TTT", "TTT", "TTT", 'T', werkstoff.get(dustTiny)}); + werkstoff.get(dust), + new Object[] { "TTT", "TTT", "TTT", 'T', werkstoff.get(dustTiny) }); GT_ModHandler.addCraftingRecipe( werkstoff.get(dust), - new Object[] {"TT ", "TT ", 'T', WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff)}); + new Object[] { "TT ", "TT ", 'T', + WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff) }); GT_ModHandler.addCraftingRecipe( WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff, 4), - new Object[] {" T ", 'T', werkstoff.get(dust)}); + new Object[] { " T ", 'T', werkstoff.get(dust) }); GT_ModHandler.addCraftingRecipe( WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff, 9), - new Object[] {"T ", 'T', werkstoff.get(dust)}); + new Object[] { "T ", 'T', werkstoff.get(dust) }); GT_Values.RA.addBoxingRecipe( - werkstoff.get(dustTiny, 9), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); + werkstoff.get(dustTiny, 9), + ItemList.Schematic_Dust.get(0L), + werkstoff.get(dust), + 100, + 4); GT_Values.RA.addBoxingRecipe( - werkstoff.get(dustSmall, 4), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); + werkstoff.get(dustSmall, 4), + ItemList.Schematic_Dust.get(0L), + werkstoff.get(dust), + 100, + 4); GT_Values.RA.addBoxingRecipe( - werkstoff.get(dustTiny, 9), ItemList.Schematic_3by3.get(0L), werkstoff.get(dust), 100, 4); + werkstoff.get(dustTiny, 9), + ItemList.Schematic_3by3.get(0L), + werkstoff.get(dust), + 100, + 4); GT_Values.RA.addBoxingRecipe( - werkstoff.get(dustSmall, 4), ItemList.Schematic_2by2.get(0L), werkstoff.get(dust), 100, 4); + werkstoff.get(dustSmall, 4), + ItemList.Schematic_2by2.get(0L), + werkstoff.get(dust), + 100, + 4); if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) { GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustTiny), werkstoff.get(nugget)); - } else if (werkstoff.hasItemType(ingot) - && werkstoff.getStats().isBlastFurnace() + } else if (werkstoff.hasItemType(ingot) && werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().getMeltingPoint() != 0) { - if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)) { - GT_Values.RA.addBlastRecipe( - werkstoff.get(dust), - GT_Utility.getIntegratedCircuit(11), - Materials.Nitrogen.getGas(1000), - null, - werkstoff.getStats().getMeltingPoint() < 1750 - ? werkstoff.get(ingot) - : werkstoff.get(ingotHot), - null, - (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) - * werkstoff.getStats().getMeltingPoint(), - werkstoff.getStats().getMeltingVoltage(), - werkstoff.getStats().getMeltingPoint()); - } else if (werkstoff.contains(WerkstoffLoader.NOBLE_GAS_SMELTING)) { - GT_Values.RA.addBlastRecipe( - werkstoff.get(dust), - GT_Utility.getIntegratedCircuit(11), - Materials.Argon.getGas(1000), - null, - werkstoff.getStats().getMeltingPoint() < 1750 - ? werkstoff.get(ingot) - : werkstoff.get(ingotHot), - null, - (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) - * werkstoff.getStats().getMeltingPoint(), - werkstoff.getStats().getMeltingVoltage(), - werkstoff.getStats().getMeltingPoint()); - } else { - GT_Values.RA.addBlastRecipe( - werkstoff.get(dust), - GT_Utility.getIntegratedCircuit(1), - null, - null, - werkstoff.getStats().getMeltingPoint() < 1750 - ? werkstoff.get(ingot) - : werkstoff.get(ingotHot), - null, - (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) - * werkstoff.getStats().getMeltingPoint(), - werkstoff.getStats().getMeltingVoltage(), - werkstoff.getStats().getMeltingPoint()); - if (werkstoff.getStats().getMeltingPoint() <= 1000) { - GT_Values.RA.addPrimitiveBlastRecipe( - werkstoff.get(dust), - null, - 9, - werkstoff.get(ingot), - null, - (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) - * werkstoff.getStats().getMeltingPoint()); - // GT_ModHandler.addRCBlastFurnaceRecipe(werkstoff.get(ingot), werkstoff.get(dust), - // werkstoff.getStats().getMeltingPoint()); + if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)) { + GT_Values.RA.addBlastRecipe( + werkstoff.get(dust), + GT_Utility.getIntegratedCircuit(11), + Materials.Nitrogen.getGas(1000), + null, + werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) + : werkstoff.get(ingotHot), + null, + (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) + * werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().getMeltingVoltage(), + werkstoff.getStats().getMeltingPoint()); + } else if (werkstoff.contains(WerkstoffLoader.NOBLE_GAS_SMELTING)) { + GT_Values.RA.addBlastRecipe( + werkstoff.get(dust), + GT_Utility.getIntegratedCircuit(11), + Materials.Argon.getGas(1000), + null, + werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) + : werkstoff.get(ingotHot), + null, + (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) + * werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().getMeltingVoltage(), + werkstoff.getStats().getMeltingPoint()); + } else { + GT_Values.RA.addBlastRecipe( + werkstoff.get(dust), + GT_Utility.getIntegratedCircuit(1), + null, + null, + werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) + : werkstoff.get(ingotHot), + null, + (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) + * werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().getMeltingVoltage(), + werkstoff.getStats().getMeltingPoint()); + if (werkstoff.getStats().getMeltingPoint() <= 1000) { + GT_Values.RA.addPrimitiveBlastRecipe( + werkstoff.get(dust), + null, + 9, + werkstoff.get(ingot), + null, + (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) + * werkstoff.getStats().getMeltingPoint()); + // GT_ModHandler.addRCBlastFurnaceRecipe(werkstoff.get(ingot), werkstoff.get(dust), + // werkstoff.getStats().getMeltingPoint()); + } + } } - } - } if (werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().getMeltingPoint() > 1750) { - GT_Values.RA.addVacuumFreezerRecipe(werkstoff.get(ingotHot), werkstoff.get(ingot), (int) - Math.max(werkstoff.getStats().getMass() * 3L, 1L)); + GT_Values.RA.addVacuumFreezerRecipe( + werkstoff.get(ingotHot), + werkstoff.get(ingot), + (int) Math.max(werkstoff.getStats().getMass() * 3L, 1L)); } if (werkstoff.hasItemType(ingot)) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java index d8ee81065b..d8a8269888 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java @@ -1,33 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; import static gregtech.api.enums.OrePrefixes.*; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -35,8 +30,6 @@ import gregtech.api.enums.Textures; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; public class GemLoader implements IWerkstoffRunnable { @@ -50,15 +43,9 @@ public class GemLoader implements IWerkstoffRunnable { GT_Values.RA.addForgeHammerRecipe(werkstoff.get(block), werkstoff.get(gem, 9), 100, 24); GT_Values.RA.addSifterRecipe( werkstoff.get(crushedPurified), - new ItemStack[] { - werkstoff.get(gemExquisite), - werkstoff.get(gemFlawless), - werkstoff.get(gem), - werkstoff.get(gemFlawed), - werkstoff.get(gemChipped), - werkstoff.get(dust) - }, - new int[] {200, 1000, 2500, 2000, 4000, 5000}, + new ItemStack[] { werkstoff.get(gemExquisite), werkstoff.get(gemFlawless), werkstoff.get(gem), + werkstoff.get(gemFlawed), werkstoff.get(gemChipped), werkstoff.get(dust) }, + new int[] { 200, 1000, 2500, 2000, 4000, 5000 }, 800, 16); } @@ -70,13 +57,21 @@ public class GemLoader implements IWerkstoffRunnable { GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemChipped), werkstoff.get(dustSmall)); GT_ModHandler.addCraftingRecipe( - werkstoff.get(gemFlawless, 2), 0, new Object[] {"h ", "W ", 'W', werkstoff.get(gemExquisite)}); + werkstoff.get(gemFlawless, 2), + 0, + new Object[] { "h ", "W ", 'W', werkstoff.get(gemExquisite) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(gem, 2), 0, new Object[] {"h ", "W ", 'W', werkstoff.get(gemFlawless)}); + werkstoff.get(gem, 2), + 0, + new Object[] { "h ", "W ", 'W', werkstoff.get(gemFlawless) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(gemFlawed, 2), 0, new Object[] {"h ", "W ", 'W', werkstoff.get(gem)}); + werkstoff.get(gemFlawed, 2), + 0, + new Object[] { "h ", "W ", 'W', werkstoff.get(gem) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(gemChipped, 2), 0, new Object[] {"h ", "W ", 'W', werkstoff.get(gemFlawed)}); + werkstoff.get(gemChipped, 2), + 0, + new Object[] { "h ", "W ", 'W', werkstoff.get(gemFlawed) }); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemExquisite), werkstoff.get(gemFlawless, 2), 64, 16); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawless), werkstoff.get(gem, 2), 64, 16); @@ -114,12 +109,12 @@ public class GemLoader implements IWerkstoffRunnable { } if (werkstoff.hasItemType(plate)) { - GT_Values.RA.addLatheRecipe( - werkstoff.get(plate), werkstoff.get(lens), werkstoff.get(dustSmall), 1200, 120); + GT_Values.RA + .addLatheRecipe(werkstoff.get(plate), werkstoff.get(lens), werkstoff.get(dustSmall), 1200, 120); } - GT_Values.RA.addLatheRecipe( - werkstoff.get(gemExquisite), werkstoff.get(lens), werkstoff.get(dust, 2), 2400, 30); + GT_Values.RA + .addLatheRecipe(werkstoff.get(gemExquisite), werkstoff.get(lens), werkstoff.get(dust, 2), 2400, 30); GregTech_API.registerCover( werkstoff.get(lens), TextureFactory.of( @@ -128,16 +123,20 @@ public class GemLoader implements IWerkstoffRunnable { new gregtech.common.covers.GT_Cover_Lens(BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(lens), werkstoff.get(dustSmall, 3)); - for (ItemStack is : OreDictionary.getOres("craftingLens" - + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) { + for (ItemStack is : OreDictionary.getOres( + "craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) { is.stackSize = 0; - GT_Values.RA.addLaserEngraverRecipe( - werkstoff.get(gemChipped, 3), is, werkstoff.get(gemFlawed, 1), 600, 30); + GT_Values.RA + .addLaserEngraverRecipe(werkstoff.get(gemChipped, 3), is, werkstoff.get(gemFlawed, 1), 600, 30); GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemFlawed, 3), is, werkstoff.get(gem, 1), 600, 120); + GT_Values.RA + .addLaserEngraverRecipe(werkstoff.get(gem, 3), is, werkstoff.get(gemFlawless, 1), 1200, 480); GT_Values.RA.addLaserEngraverRecipe( - werkstoff.get(gem, 3), is, werkstoff.get(gemFlawless, 1), 1200, 480); - GT_Values.RA.addLaserEngraverRecipe( - werkstoff.get(gemFlawless, 3), is, werkstoff.get(gemExquisite, 1), 2400, 2000); + werkstoff.get(gemFlawless, 3), + is, + werkstoff.get(gemExquisite, 1), + 2400, + 2000); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java index 874d82859d..47716b0404 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; @@ -27,11 +18,13 @@ import static gregtech.api.enums.OrePrefixes.ingot; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.util.GT_ModHandler; public class MetalLoader implements IWerkstoffRunnable { + @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(ingot)) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java index a54f15fcd3..7d9b3daa98 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; @@ -25,20 +16,24 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.rec import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.capsuleMolten; import static gregtech.api.enums.OrePrefixes.*; +import java.util.Objects; + +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; -import java.util.Objects; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; public class MoltenCellLoader implements IWerkstoffRunnable { + @Override public void run(Werkstoff werkstoff) { if (!werkstoff.hasItemType(WerkstoffLoader.cellMolten)) return; @@ -217,7 +212,9 @@ public class MoltenCellLoader implements IWerkstoffRunnable { werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); FluidContainerRegistry.registerFluidContainer( - werkstoff.getMolten(144), werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); + werkstoff.getMolten(144), + werkstoff.get(WerkstoffLoader.cellMolten), + Materials.Empty.getCells(1)); GT_Utility.addFluidContainerData(data); GT_Values.RA.addFluidCannerRecipe( Materials.Empty.getCells(1), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java index 135ee00218..72cce06013 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java @@ -1,60 +1,59 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; import static gregtech.api.enums.OrePrefixes.*; +import net.minecraft.item.ItemStack; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import com.github.bartimaeusnek.bartworks.util.BWRecipes; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; public class MultipleMetalLoader implements IWerkstoffRunnable { + @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(plateDense)) { - GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe( - true, - new ItemStack[] {werkstoff.get(ingot, 2), GT_Utility.getIntegratedCircuit(2)}, - new ItemStack[] {werkstoff.get(plateDouble)}, - null, - null, - null, - null, - (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), - 60, - 0)); + GT_Recipe.GT_Recipe_Map.sBenderRecipes.add( + new BWRecipes.DynamicGTRecipe( + true, + new ItemStack[] { werkstoff.get(ingot, 2), GT_Utility.getIntegratedCircuit(2) }, + new ItemStack[] { werkstoff.get(plateDouble) }, + null, + null, + null, + null, + (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), + 60, + 0)); GregTech_API.registerCover( werkstoff.get(plateDouble), TextureFactory.of(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false), null); GT_Values.RA.addPulveriserRecipe( - werkstoff.get(plateDouble), new ItemStack[] {werkstoff.get(dust, 2)}, null, 2, 8); + werkstoff.get(plateDouble), + new ItemStack[] { werkstoff.get(dust, 2) }, + null, + 2, + 8); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java index a17efb4e6e..ab436d896b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; @@ -27,19 +18,19 @@ import static gregtech.api.enums.OrePrefixes.*; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.SubTag; import gregtech.api.util.GT_ModHandler; public class OreLoader implements IWerkstoffRunnable { + @Override public void run(Werkstoff werkstoff) { - if (werkstoff.hasItemType(ore) - && werkstoff.hasItemType(ingot) - && !werkstoff.getStats().isBlastFurnace()) - GT_ModHandler.addSmeltingRecipe( - WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), werkstoff.get(ingot)); + if (werkstoff.hasItemType(ore) && werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) + GT_ModHandler + .addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), werkstoff.get(ingot)); if (werkstoff.hasItemType(ore)) { GT_Values.RA.addForgeHammerRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java index a2418deed6..19bc6ecfb7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java @@ -1,34 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; import static gregtech.api.enums.OrePrefixes.*; +import net.minecraft.item.ItemStack; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import com.github.bartimaeusnek.bartworks.util.BWRecipes; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -39,9 +33,9 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Proxy; -import net.minecraft.item.ItemStack; public class SimpleMetalLoader implements IWerkstoffRunnable { + @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(plate)) { @@ -53,10 +47,13 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); GT_ModHandler.addCraftingRecipe( - werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[] {"s", "X", 'X', werkstoff.get(stickLong) - }); + werkstoff.get(stick, 2), + GT_Proxy.tBits, + new Object[] { "s", "X", 'X', werkstoff.get(stickLong) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(stick), GT_Proxy.tBits, new Object[] {"f ", " X", 'X', werkstoff.get(gem)}); + werkstoff.get(stick), + GT_Proxy.tBits, + new Object[] { "f ", " X", 'X', werkstoff.get(gem) }); GT_Values.RA.addForgeHammerRecipe( werkstoff.get(stick, 2), werkstoff.get(stickLong), @@ -66,38 +63,47 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { TextureSet texSet = werkstoff.getTexSet(); ITexture texture = SideReference.Side.Client ? TextureFactory.of( - texSet.mTextures[ - PrefixTextureLinker.blockTexMap.getOrDefault(texSet, block.mTextureIndex)], + texSet.mTextures[PrefixTextureLinker.blockTexMap + .getOrDefault(texSet, block.mTextureIndex)], werkstoff.getRGBA(), false) : TextureFactory.of(texSet.mTextures[block.mTextureIndex], werkstoff.getRGBA(), false); GregTech_API.registerCover(werkstoff.get(plate), texture, null); - GT_Values.RA.addPulveriserRecipe( - werkstoff.get(plate), new ItemStack[] {werkstoff.get(dust)}, null, 2, 8); + GT_Values.RA + .addPulveriserRecipe(werkstoff.get(plate), new ItemStack[] { werkstoff.get(dust) }, null, 2, 8); return; } GT_ModHandler.addCraftingRecipe( - werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[] {"s", "X", 'X', werkstoff.get(stickLong)}); + werkstoff.get(stick, 2), + GT_Proxy.tBits, + new Object[] { "s", "X", 'X', werkstoff.get(stickLong) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(stick), GT_Proxy.tBits, new Object[] {"f ", " X", 'X', werkstoff.get(ingot)}); + werkstoff.get(stick), + GT_Proxy.tBits, + new Object[] { "f ", " X", 'X', werkstoff.get(ingot) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(plate), GT_Proxy.tBits, new Object[] {"h", "X", "X", 'X', werkstoff.get(ingot)}); + werkstoff.get(plate), + GT_Proxy.tBits, + new Object[] { "h", "X", "X", 'X', werkstoff.get(ingot) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(foil, 2), GT_Proxy.tBits, new Object[] {"hX", 'X', werkstoff.get(plate)}); + werkstoff.get(foil, 2), + GT_Proxy.tBits, + new Object[] { "hX", 'X', werkstoff.get(plate) }); - GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe( - true, - new ItemStack[] {werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(1)}, - new ItemStack[] {werkstoff.get(plate)}, - null, - null, - null, - null, - (int) Math.max(werkstoff.getStats().getMass(), 1L), - 24, - 0)); + GT_Recipe.GT_Recipe_Map.sBenderRecipes.add( + new BWRecipes.DynamicGTRecipe( + true, + new ItemStack[] { werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(1) }, + new ItemStack[] { werkstoff.get(plate) }, + null, + null, + null, + null, + (int) Math.max(werkstoff.getStats().getMass(), 1L), + 24, + 0)); GT_Values.RA.addForgeHammerRecipe( werkstoff.get(ingot, 3), werkstoff.get(plate, 2), @@ -148,12 +154,16 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(ingot), new ItemStack[] {werkstoff.get(dust)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[] {werkstoff.get(dust)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe( - werkstoff.get(stickLong), new ItemStack[] {werkstoff.get(dust)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(ingot), new ItemStack[] { werkstoff.get(dust) }, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[] { werkstoff.get(dust) }, null, 2, 8); + GT_Values.RA + .addPulveriserRecipe(werkstoff.get(stickLong), new ItemStack[] { werkstoff.get(dust) }, null, 2, 8); GT_Values.RA.addPulveriserRecipe( - werkstoff.get(stick), new ItemStack[] {werkstoff.get(dustSmall, 2)}, null, 2, 8); + werkstoff.get(stick), + new ItemStack[] { werkstoff.get(dustSmall, 2) }, + null, + 2, + 8); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java index 9744bdf89c..6456c9789b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; @@ -25,8 +16,12 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.rec import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.gtnhGT; import static gregtech.api.enums.OrePrefixes.*; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; + import gregtech.api.enums.Dyes; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -35,8 +30,6 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.common.GT_Proxy; import gregtech.common.items.GT_MetaGenerated_Tool_01; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; public class ToolLoader implements IWerkstoffRunnable { @@ -50,28 +43,20 @@ public class ToolLoader implements IWerkstoffRunnable { if (werkstoff.getBridgeMaterial().mDurability == 0) return; if (werkstoff.hasItemType(gem)) { - if (!werkstoff.getGenerationFeatures().isExtension()) - GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.HARDHAMMER, - 1, - werkstoff.getBridgeMaterial(), - werkstoff.getBridgeMaterial().mHandleMaterial, - null), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "XX ", - "XXS", - "XX ", - 'X', - gem.get(werkstoff.getBridgeMaterial()), - 'S', - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) - }); + if (!werkstoff.getGenerationFeatures().isExtension()) GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.HARDHAMMER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "XX ", "XXS", "XX ", 'X', gem.get(werkstoff.getBridgeMaterial()), 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); GT_ModHandler.addCraftingRecipe( GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, - new Object[] {"GGf", 'G', gem.get(werkstoff.getBridgeMaterial())}); + new Object[] { "GGf", 'G', gem.get(werkstoff.getBridgeMaterial()) }); } if (!werkstoff.hasItemType(plate)) return; @@ -86,31 +71,15 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - " fS", - " Sh", - "W ", - 'S', - stick.get(werkstoff.getBridgeMaterial()), - 'W', - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) - }); + new Object[] { " fS", " Sh", "W ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); GT_ModHandler.addCraftingRecipe( GT_OreDictUnificator.get(toolHeadWrench, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, - new Object[] { - "hXW", - "XRX", - "WXd", - 'X', - plate.get(werkstoff.getBridgeMaterial()), - 'S', - plate.get(werkstoff.getBridgeMaterial().mHandleMaterial), - 'R', - ring.get(werkstoff.getBridgeMaterial().mHandleMaterial), - 'W', - screw.get(werkstoff.getBridgeMaterial().mHandleMaterial) - }); + new Object[] { "hXW", "XRX", "WXd", 'X', plate.get(werkstoff.getBridgeMaterial()), 'S', + plate.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'R', + ring.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'W', + screw.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); GT_ModHandler.addShapelessCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.HARDHAMMER, @@ -119,10 +88,8 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - toolHeadHammer.get(werkstoff.getBridgeMaterial()), - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) - }); + new Object[] { toolHeadHammer.get(werkstoff.getBridgeMaterial()), + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.FILE, @@ -130,18 +97,10 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), - GT_ModHandler.RecipeBits.MIRRORED - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "P", - "P", - "S", - 'P', - plate.get(werkstoff.getBridgeMaterial()), - 'S', - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) - }); + new Object[] { "P", "P", "S", 'P', plate.get(werkstoff.getBridgeMaterial()), 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); GT_ModHandler.addShapelessCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.SAW, @@ -149,73 +108,46 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), - new Object[] { - toolHeadSaw.get(werkstoff.getBridgeMaterial()), - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) - }); + new Object[] { toolHeadSaw.get(werkstoff.getBridgeMaterial()), + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, - new long[] {100000L, 32L, 1L, -1L}), + new long[] { 100000L, 32L, 1L, -1L }), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "LBf", - "Sd ", - "P ", - 'B', - bolt.get(werkstoff.getBridgeMaterial()), - 'P', - plate.get(Materials.AnyRubber), - 'S', - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), - 'L', - ItemList.Battery_RE_LV_Lithium.get(1L) - }); + new Object[] { "LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', + plate.get(Materials.AnyRubber), 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', + ItemList.Battery_RE_LV_Lithium.get(1L) }); if (gtnhGT) { GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SOLDERING_IRON_MV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[] { - 400000L, 128L, 2L, -1L - }), + SOLDERING_IRON_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Rubber, + new long[] { 400000L, 128L, 2L, -1L }), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "LBf", - "Sd ", - "P ", - 'B', - bolt.get(werkstoff.getBridgeMaterial()), - 'P', - plate.get(Materials.AnyRubber), - 'S', - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), - 'L', - ItemList.Battery_RE_MV_Lithium.get(1L) - }); + new Object[] { "LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', + plate.get(Materials.AnyRubber), 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', + ItemList.Battery_RE_MV_Lithium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( SOLDERING_IRON_HV, 1, werkstoff.getBridgeMaterial(), Materials.StyreneButadieneRubber, - new long[] {1600000L, 512L, 3L, -1L}), + new long[] { 1600000L, 512L, 3L, -1L }), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "LBf", - "Sd ", - "P ", - 'B', - bolt.get(werkstoff.getBridgeMaterial()), - 'P', - plate.get(Materials.StyreneButadieneRubber), - 'S', - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), - 'L', - ItemList.Battery_RE_HV_Lithium.get(1L) - }); + new Object[] { "LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', + plate.get(Materials.StyreneButadieneRubber), 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', + ItemList.Battery_RE_HV_Lithium.get(1L) }); } if (!werkstoff.hasItemType(gem)) { @@ -227,15 +159,8 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "XX ", - "XXS", - "XX ", - 'X', - ingot.get(werkstoff.getBridgeMaterial()), - 'S', - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) - }); + new Object[] { "XX ", "XXS", "XX ", 'X', ingot.get(werkstoff.getBridgeMaterial()), 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); } } @@ -247,15 +172,8 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "xRR", - " SR", - "S f", - 'S', - stick.get(werkstoff.getBridgeMaterial()), - 'R', - plate.get(Materials.AnyRubber) - }); + new Object[] { "xRR", " SR", "S f", 'S', stick.get(werkstoff.getBridgeMaterial()), 'R', + plate.get(Materials.AnyRubber) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.WRENCH, @@ -264,7 +182,7 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] {"IhI", "III", " I ", 'I', ingot.get(werkstoff.getBridgeMaterial())}); + new Object[] { "IhI", "III", " I ", 'I', ingot.get(werkstoff.getBridgeMaterial()) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.CROWBAR, @@ -273,7 +191,7 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] {"hDS", "DSD", "SDf", 'S', stick.get(werkstoff.getBridgeMaterial()), 'D', Dyes.dyeBlue}); + new Object[] { "hDS", "DSD", "SDf", 'S', stick.get(werkstoff.getBridgeMaterial()), 'D', Dyes.dyeBlue }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( @@ -283,17 +201,8 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PfP", - "hPd", - "STS", - 'S', - stick.get(werkstoff.getBridgeMaterial()), - 'P', - plate.get(werkstoff.getBridgeMaterial()), - 'T', - screw.get(werkstoff.getBridgeMaterial()) - }); + new Object[] { "PfP", "hPd", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', + plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial()) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.SCOOP, @@ -302,15 +211,8 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "SWS", - "SSS", - "xSh", - 'S', - stick.get(werkstoff.getBridgeMaterial()), - 'W', - new ItemStack(Blocks.wool, 1, 32767) - }); + new Object[] { "SWS", "SSS", "xSh", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', + new ItemStack(Blocks.wool, 1, 32767) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.BRANCHCUTTER, @@ -319,17 +221,8 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PfP", - "PdP", - "STS", - 'S', - stick.get(werkstoff.getBridgeMaterial()), - 'P', - plate.get(werkstoff.getBridgeMaterial()), - 'T', - screw.get(werkstoff.getBridgeMaterial()) - }); + new Object[] { "PfP", "PdP", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', + plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial()) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.KNIFE, @@ -338,14 +231,8 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "fPh", - " S ", - 'S', - stick.get(werkstoff.getBridgeMaterial()), - 'P', - plate.get(werkstoff.getBridgeMaterial()) - }); + new Object[] { "fPh", " S ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', + plate.get(werkstoff.getBridgeMaterial()) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, @@ -354,15 +241,8 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PPf", - "PP ", - "Sh ", - 'S', - stick.get(werkstoff.getBridgeMaterial()), - 'P', - plate.get(werkstoff.getBridgeMaterial()) - }); + new Object[] { "PPf", "PP ", "Sh ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', + plate.get(werkstoff.getBridgeMaterial()) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( @@ -370,243 +250,117 @@ public class ToolLoader implements IWerkstoffRunnable { 1, werkstoff.getBridgeMaterial(), Materials.Steel, - new long[] {100000L, 32L, 1L, -1L}), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + new long[] { 100000L, 32L, 1L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "SXd", - "GMG", - "PBP", - 'X', - toolHeadWrench.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_LV.get(1L), - 'S', - screw.get(Materials.Steel), - 'P', - plate.get(Materials.Steel), - 'G', - gearGtSmall.get(Materials.Steel), - 'B', - ItemList.Battery_RE_LV_Lithium.get(1L) - }); + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', + plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', + ItemList.Battery_RE_LV_Lithium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, - new long[] {75000L, 32L, 1L, -1L}), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + new long[] { 75000L, 32L, 1L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "SXd", - "GMG", - "PBP", - 'X', - toolHeadWrench.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_LV.get(1L), - 'S', - screw.get(Materials.Steel), - 'P', - plate.get(Materials.Steel), - 'G', - gearGtSmall.get(Materials.Steel), - 'B', - ItemList.Battery_RE_LV_Cadmium.get(1L) - }); + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', + plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', + ItemList.Battery_RE_LV_Cadmium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, - new long[] {50000L, 32L, 1L, -1L}), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + new long[] { 50000L, 32L, 1L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "SXd", - "GMG", - "PBP", - 'X', - toolHeadWrench.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_LV.get(1L), - 'S', - screw.get(Materials.Steel), - 'P', - plate.get(Materials.Steel), - 'G', - gearGtSmall.get(Materials.Steel), - 'B', - ItemList.Battery_RE_LV_Sodium.get(1L) - }); + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', + plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', + ItemList.Battery_RE_LV_Sodium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, - new long[] {400000L, 128L, 2L, -1L}), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + new long[] { 400000L, 128L, 2L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "SXd", - "GMG", - "PBP", - 'X', - toolHeadWrench.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_MV.get(1L), - 'S', - screw.get(Materials.Aluminium), - 'P', - plate.get(Materials.Aluminium), - 'G', - gearGtSmall.get(Materials.Aluminium), - 'B', - ItemList.Battery_RE_MV_Lithium.get(1L) - }); + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', + plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', + ItemList.Battery_RE_MV_Lithium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, - new long[] {300000L, 128L, 2L, -1L}), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + new long[] { 300000L, 128L, 2L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "SXd", - "GMG", - "PBP", - 'X', - toolHeadWrench.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_MV.get(1L), - 'S', - screw.get(Materials.Aluminium), - 'P', - plate.get(Materials.Aluminium), - 'G', - gearGtSmall.get(Materials.Aluminium), - 'B', - ItemList.Battery_RE_MV_Cadmium.get(1L) - }); + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', + plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', + ItemList.Battery_RE_MV_Cadmium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, - new long[] {200000L, 128L, 2L, -1L}), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + new long[] { 200000L, 128L, 2L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "SXd", - "GMG", - "PBP", - 'X', - toolHeadWrench.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_MV.get(1L), - 'S', - screw.get(Materials.Aluminium), - 'P', - plate.get(Materials.Aluminium), - 'G', - gearGtSmall.get(Materials.Aluminium), - 'B', - ItemList.Battery_RE_MV_Sodium.get(1L) - }); + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', + plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', + ItemList.Battery_RE_MV_Sodium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, - new long[] {1600000L, 512L, 3L, -1L}), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + new long[] { 1600000L, 512L, 3L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "SXd", - "GMG", - "PBP", - 'X', - toolHeadWrench.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_HV.get(1L), - 'S', - screw.get(Materials.StainlessSteel), - 'P', - plate.get(Materials.StainlessSteel), - 'G', - gearGtSmall.get(Materials.StainlessSteel), - 'B', - ItemList.Battery_RE_HV_Lithium.get(1L) - }); + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', + plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', + ItemList.Battery_RE_HV_Lithium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, - new long[] {1200000L, 512L, 3L, -1L}), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + new long[] { 1200000L, 512L, 3L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "SXd", - "GMG", - "PBP", - 'X', - toolHeadWrench.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_HV.get(1L), - 'S', - screw.get(Materials.StainlessSteel), - 'P', - plate.get(Materials.StainlessSteel), - 'G', - gearGtSmall.get(Materials.StainlessSteel), - 'B', - ItemList.Battery_RE_HV_Cadmium.get(1L) - }); + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', + plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', + ItemList.Battery_RE_HV_Cadmium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, - new long[] {800000L, 512L, 3L, -1L}), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + new long[] { 800000L, 512L, 3L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "SXd", - "GMG", - "PBP", - 'X', - toolHeadWrench.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_HV.get(1L), - 'S', - screw.get(Materials.StainlessSteel), - 'P', - plate.get(Materials.StainlessSteel), - 'G', - gearGtSmall.get(Materials.StainlessSteel), - 'B', - ItemList.Battery_RE_HV_Sodium.get(1L) - }); + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', + plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', + ItemList.Battery_RE_HV_Sodium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( @@ -614,107 +368,51 @@ public class ToolLoader implements IWerkstoffRunnable { 1, werkstoff.getBridgeMaterial(), Materials.Steel, - new long[] {100000L, 32L, 1L, -1L}), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + new long[] { 100000L, 32L, 1L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PdX", - "MGS", - "GBP", - 'X', - stickLong.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_LV.get(1L), - 'S', - screw.get(Materials.Steel), - 'P', - plate.get(Materials.Steel), - 'G', - gearGtSmall.get(Materials.Steel), - 'B', - ItemList.Battery_RE_LV_Lithium.get(1L) - }); + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', + plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', + ItemList.Battery_RE_LV_Lithium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, - new long[] {75000L, 32L, 1L, -1L}), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + new long[] { 75000L, 32L, 1L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PdX", - "MGS", - "GBP", - 'X', - stickLong.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_LV.get(1L), - 'S', - screw.get(Materials.Steel), - 'P', - plate.get(Materials.Steel), - 'G', - gearGtSmall.get(Materials.Steel), - 'B', - ItemList.Battery_RE_LV_Cadmium.get(1L) - }); + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', + plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', + ItemList.Battery_RE_LV_Cadmium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, - new long[] {50000L, 32L, 1L, -1L}), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + new long[] { 50000L, 32L, 1L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PdX", - "MGS", - "GBP", - 'X', - stickLong.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_LV.get(1L), - 'S', - screw.get(Materials.Steel), - 'P', - plate.get(Materials.Steel), - 'G', - gearGtSmall.get(Materials.Steel), - 'B', - ItemList.Battery_RE_LV_Sodium.get(1L) - }); + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', + plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', + ItemList.Battery_RE_LV_Sodium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_OreDictUnificator.get(toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, - new Object[] { - "II ", - "IIh", - "II ", - 'P', - plate.get(werkstoff.getBridgeMaterial()), - 'I', - ingot.get(werkstoff.getBridgeMaterial()) - }); + new Object[] { "II ", "IIh", "II ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', + ingot.get(werkstoff.getBridgeMaterial()) }); if (werkstoff.hasItemType(plateDouble) && werkstoff.hasItemType(cellMolten)) { GT_ModHandler.addCraftingRecipe( GT_OreDictUnificator.get(turbineBlade, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, - new Object[] { - "fPd", - "SPS", - " P ", - 'P', - plateDouble.get(werkstoff.getBridgeMaterial()), - 'S', - screw.get(werkstoff.getBridgeMaterial()) - }); + new Object[] { "fPd", "SPS", " P ", 'P', plateDouble.get(werkstoff.getBridgeMaterial()), 'S', + screw.get(werkstoff.getBridgeMaterial()) }); GT_Values.RA.addExtruderRecipe( werkstoff.get(ingot, 6), ItemList.Shape_Extruder_Turbine_Blade.get(0), @@ -783,167 +481,89 @@ public class ToolLoader implements IWerkstoffRunnable { GT_ModHandler.addCraftingRecipe( GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, - new Object[] { - "PP ", - "fh ", - 'P', - plate.get(werkstoff.getBridgeMaterial()), - 'I', - ingot.get(werkstoff.getBridgeMaterial()) - }); + new Object[] { "PP ", "fh ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', + ingot.get(werkstoff.getBridgeMaterial()) }); } if (gtnhGT) { GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[] { - 400000L, 128L, 2L, -1L - }), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + SCREWDRIVER_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] { 400000L, 128L, 2L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PdX", - "MGS", - "GBP", - 'X', - stickLong.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_MV.get(1L), - 'S', - screw.get(Materials.Aluminium), - 'P', - plate.get(Materials.Aluminium), - 'G', - gearGtSmall.get(Materials.Titanium), - 'B', - ItemList.Battery_RE_MV_Lithium.get(1L) - }); + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', + plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', + ItemList.Battery_RE_MV_Lithium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[] { - 300000L, 128L, 2L, -1L - }), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + SCREWDRIVER_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] { 300000L, 128L, 2L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PdX", - "MGS", - "GBP", - 'X', - stickLong.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_MV.get(1L), - 'S', - screw.get(Materials.Aluminium), - 'P', - plate.get(Materials.Aluminium), - 'G', - gearGtSmall.get(Materials.Titanium), - 'B', - ItemList.Battery_RE_MV_Cadmium.get(1L) - }); + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', + plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', + ItemList.Battery_RE_MV_Cadmium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[] { - 200000L, 128L, 2L, -1L - }), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + SCREWDRIVER_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] { 200000L, 128L, 2L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PdX", - "MGS", - "GBP", - 'X', - stickLong.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_MV.get(1L), - 'S', - screw.get(Materials.Aluminium), - 'P', - plate.get(Materials.Aluminium), - 'G', - gearGtSmall.get(Materials.Titanium), - 'B', - ItemList.Battery_RE_MV_Sodium.get(1L) - }); + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', + plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', + ItemList.Battery_RE_MV_Sodium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[] { - 1600000L, 512L, 3L, -1L - }), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + SCREWDRIVER_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] { 1600000L, 512L, 3L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PdX", - "MGS", - "GBP", - 'X', - stickLong.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_HV.get(1L), - 'S', - screw.get(Materials.StainlessSteel), - 'P', - plate.get(Materials.StainlessSteel), - 'G', - gearGtSmall.get(Materials.StainlessSteel), - 'B', - ItemList.Battery_RE_HV_Lithium.get(1L) - }); + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', + plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', + ItemList.Battery_RE_HV_Lithium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[] { - 1200000L, 512L, 3L, -1L - }), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + SCREWDRIVER_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] { 1200000L, 512L, 3L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PdX", - "MGS", - "GBP", - 'X', - stickLong.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_HV.get(1L), - 'S', - screw.get(Materials.StainlessSteel), - 'P', - plate.get(Materials.StainlessSteel), - 'G', - gearGtSmall.get(Materials.StainlessSteel), - 'B', - ItemList.Battery_RE_HV_Cadmium.get(1L) - }); + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', + plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', + ItemList.Battery_RE_HV_Cadmium.get(1L) }); GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[] { - 800000L, 512L, 3L, -1L - }), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + SCREWDRIVER_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] { 800000L, 512L, 3L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PdX", - "MGS", - "GBP", - 'X', - stickLong.get(werkstoff.getBridgeMaterial()), - 'M', - ItemList.Electric_Motor_HV.get(1L), - 'S', - screw.get(Materials.StainlessSteel), - 'P', - plate.get(Materials.StainlessSteel), - 'G', - gearGtSmall.get(Materials.StainlessSteel), - 'B', - ItemList.Battery_RE_HV_Sodium.get(1L) - }); + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', + plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', + ItemList.Battery_RE_HV_Sodium.get(1L) }); } // GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(16,1, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/AssociationLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/AssociationLoader.java index 3852602d72..c6eacb8ad2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/AssociationLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/AssociationLoader.java @@ -1,36 +1,30 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration; +import net.minecraft.item.ItemStack; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; + import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; -import net.minecraft.item.ItemStack; public class AssociationLoader implements IWerkstoffRunnable { + @Override public void run(Werkstoff werkstoff) { for (OrePrefixes prefixes : OrePrefixes.values()) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java index 292e796e70..98ac3fb90e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java @@ -1,42 +1,36 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration; import static gregtech.api.enums.OrePrefixes.*; +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import com.github.bartimaeusnek.bartworks.util.BWRecipes; + import gregtech.api.enchants.Enchantment_Radioactivity; import gregtech.api.enums.*; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.common.items.behaviors.Behaviour_DataOrb; -import java.util.ArrayList; -import net.minecraft.item.ItemStack; public class BridgeMaterialsLoader implements IWerkstoffRunnable { @@ -47,10 +41,8 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { // aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int // aDensityMultiplier, int aDensityDivider, Dyes aColor, String aConfigSection, boolean aCustomOre, String // aCustomID - Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null - ? werkstoff.getBridgeMaterial() - : Materials.get(werkstoff.getVarName()) != Materials._NULL - ? Materials.get(werkstoff.getVarName()) + Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() + : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : new Materials( -1, werkstoff.getTexSet(), @@ -113,26 +105,26 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { e.mLinkedMaterials = new ArrayList<>(); e.mLinkedMaterials.add(werkstoffBridgeMaterial); if (werkstoff.hasItemType(dust)) { - GT_OreDictUnificator.addAssociation( - dust, werkstoffBridgeMaterial, werkstoff.get(dust), false); - GT_OreDictUnificator.set( - dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true); + GT_OreDictUnificator + .addAssociation(dust, werkstoffBridgeMaterial, werkstoff.get(dust), false); + GT_OreDictUnificator + .set(dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true); } ElementSet = true; break; } } if (!ElementSet) continue; - // try { - // Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); - // f.setAccessible(true); - // Map MATERIALS_MAP = (Map MATERIALS_MAP = (Map) f.get(null); - // MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); - // } catch (NoSuchFieldException | IllegalAccessException | + // MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); + // } catch (NoSuchFieldException | IllegalAccessException | // ClassCastException e) { - // e.printStackTrace(); - // } + // e.printStackTrace(); + // } if (werkstoff.hasItemType(dust)) { ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); @@ -141,8 +133,8 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { false, new BWRecipes.DynamicGTRecipe( false, - new ItemStack[] {werkstoff.get(prefixes)}, - new ItemStack[] {scannerOutput}, + new ItemStack[] { werkstoff.get(prefixes) }, + new ItemStack[] { scannerOutput }, ItemList.Tool_DataOrb.get(1L), null, null, @@ -167,8 +159,7 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { } if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { - werkstoffBridgeMaterial.mStandardMoltenFluid = - werkstoff.getMolten(1).getFluid(); + werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid(); } werkstoffBridgeMaterial.mName = werkstoff.getVarName(); werkstoffBridgeMaterial.mDefaultLocalName = werkstoff.getDefaultName(); @@ -180,12 +171,9 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { werkstoffBridgeMaterial.mDefaultLocalName); if (LoaderReference.Thaumcraft) werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects(); werkstoffBridgeMaterial.mMaterialInto = werkstoffBridgeMaterial; - werkstoffBridgeMaterial.mHandleMaterial = werkstoff.contains(SubTag.BURNING) - ? Materials.Blaze - : werkstoff.contains(SubTag.MAGICAL) - ? Materials.Thaumium - : werkstoffBridgeMaterial.mDurability > 5120 - ? Materials.TungstenSteel + werkstoffBridgeMaterial.mHandleMaterial = werkstoff.contains(SubTag.BURNING) ? Materials.Blaze + : werkstoff.contains(SubTag.MAGICAL) ? Materials.Thaumium + : werkstoffBridgeMaterial.mDurability > 5120 ? Materials.TungstenSteel : werkstoffBridgeMaterial.mDurability > 1280 ? Materials.Steel : Materials.Wood; if (werkstoff.getStats().isRadioactive()) { werkstoffBridgeMaterial.setEnchantmentForArmors( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java index 8caecb277c..08f77e6760 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration; @@ -25,13 +16,15 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.reg import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasing; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasingAdvanced; +import net.minecraft.item.ItemStack; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import gregtech.api.util.GT_OreDictUnificator; -import net.minecraft.item.ItemStack; public class CasingRegistrator implements IWerkstoffRunnable { + @Override public void run(Werkstoff werkstoff) { GT_OreDictUnificator.addAssociation( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java index 288213d821..1e83c8157f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java @@ -1,33 +1,26 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.object; -import com.github.bartimaeusnek.bartworks.util.Pair; import java.io.*; + import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import com.github.bartimaeusnek.bartworks.util.Pair; + public class AbstractedStack implements Serializable { final Pair idDamage; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java index 9229b08847..b005ff26e6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java @@ -1,33 +1,26 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.oredict; -import com.github.bartimaeusnek.bartworks.util.Pair; -import gregtech.api.util.GT_OreDictUnificator; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; + import net.minecraft.item.ItemStack; +import com.github.bartimaeusnek.bartworks.util.Pair; +import gregtech.api.util.GT_OreDictUnificator; + public class OreDictAdder { private static final ConcurrentHashMap toAddMap = new ConcurrentHashMap<>(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java index 4e8efeeabd..6bb0da9300 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java @@ -1,41 +1,35 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.oredict; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.Pair; -import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_OreDictUnificator; import java.util.HashMap; import java.util.HashSet; import java.util.Set; + import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.util.Pair; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; + +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; + public class OreDictHandler { private static final HashMap> cache = new HashMap<>(); @@ -56,16 +50,17 @@ public class OreDictHandler { for (String s : used) { if (!OreDictionary.getOres(s).isEmpty()) { ItemStack tmpstack = OreDictionary.getOres(s).get(0).copy(); - Pair p = - new Pair<>(Item.getIdFromItem(tmpstack.getItem()), (short) tmpstack.getItemDamage()); + Pair p = new Pair<>( + Item.getIdFromItem(tmpstack.getItem()), + (short) tmpstack.getItemDamage()); OreDictHandler.cache.put(s, p); for (ItemStack tmp : OreDictionary.getOres(s)) { - Pair p2 = - new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); + Pair p2 = new Pair<>( + Item.getIdFromItem(tmp.getItem()), + (short) tmp.getItemDamage()); GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); if (UI == null) UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); - if (!UI.modId.equals(MainMod.MOD_ID) - && !UI.modId.equals(BartWorksCrossmod.MOD_ID) + if (!UI.modId.equals(MainMod.MOD_ID) && !UI.modId.equals(BartWorksCrossmod.MOD_ID) && !UI.modId.equals("BWCore")) { OreDictHandler.cacheNonBW.add(p2); } @@ -78,12 +73,9 @@ public class OreDictHandler { if (OreDictHandler.cache.get(prefixes + elementName.replaceAll(" ", "")) != null) { Pair p = OreDictHandler.cache.get(prefixes + elementName.replaceAll(" ", "")); return new ItemStack(Item.getItemById(p.getKey()), amount, p.getValue()); - } else if (!OreDictionary.getOres(prefixes + elementName.replaceAll(" ", "")) - .isEmpty()) { - ItemStack tmp = GT_OreDictUnificator.get(OreDictionary.getOres(prefixes + elementName.replaceAll(" ", "")) - .get(0) - .copy()) - .copy(); + } else if (!OreDictionary.getOres(prefixes + elementName.replaceAll(" ", "")).isEmpty()) { + ItemStack tmp = GT_OreDictUnificator + .get(OreDictionary.getOres(prefixes + elementName.replaceAll(" ", "")).get(0).copy()).copy(); OreDictHandler.cache.put( prefixes + elementName.replaceAll(" ", ""), new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage())); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java index b57e5c8914..71a41f466b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java @@ -1,41 +1,23 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.oregen; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.system.material.*; -import com.github.bartimaeusnek.bartworks.util.MurmurHash3; -import com.github.bartimaeusnek.bartworks.util.Pair; -import com.google.common.collect.ArrayListMultimap; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.interfaces.ISubTagContainer; -import gregtech.api.world.GT_Worldgen; -import gregtech.common.blocks.GT_TileEntity_Ores; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -44,10 +26,23 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.system.material.*; +import com.github.bartimaeusnek.bartworks.util.MurmurHash3; +import com.github.bartimaeusnek.bartworks.util.Pair; +import com.google.common.collect.ArrayListMultimap; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.world.GT_Worldgen; +import gregtech.common.blocks.GT_TileEntity_Ores; + /** * Original GT File Stripped and adjusted to work with this mod */ public abstract class BW_OreLayer extends GT_Worldgen { + public static final List sList = new ArrayList<>(); public static final ArrayListMultimap NEIMAP = ArrayListMultimap.create(); private static final boolean logOregenRoss128 = false; @@ -61,18 +56,8 @@ public abstract class BW_OreLayer extends GT_Worldgen { public abstract String getDimName(); - public BW_OreLayer( - String aName, - boolean aDefault, - int aMinY, - int aMaxY, - int aWeight, - int aDensity, - int aSize, - ISubTagContainer top, - ISubTagContainer bottom, - ISubTagContainer between, - ISubTagContainer sprinkled) { + public BW_OreLayer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, + ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { super(aName, BW_OreLayer.sList, aDefault); this.mMinY = (short) aMinY; this.mMaxY = (short) aMaxY; @@ -87,17 +72,13 @@ public abstract class BW_OreLayer extends GT_Worldgen { if (between instanceof Werkstoff) this.bwOres = (byte) (this.bwOres | 0b0010); if (sprinkled instanceof Werkstoff) this.bwOres = (byte) (this.bwOres | 0b0001); - short aPrimary = top instanceof Materials - ? (short) ((Materials) top).mMetaItemSubID + short aPrimary = top instanceof Materials ? (short) ((Materials) top).mMetaItemSubID : top instanceof Werkstoff ? ((Werkstoff) top).getmID() : 0; - short aSecondary = bottom instanceof Materials - ? (short) ((Materials) bottom).mMetaItemSubID + short aSecondary = bottom instanceof Materials ? (short) ((Materials) bottom).mMetaItemSubID : bottom instanceof Werkstoff ? ((Werkstoff) bottom).getmID() : 0; - short aBetween = between instanceof Materials - ? (short) ((Materials) between).mMetaItemSubID + short aBetween = between instanceof Materials ? (short) ((Materials) between).mMetaItemSubID : between instanceof Werkstoff ? ((Werkstoff) between).getmID() : 0; - short aSporadic = sprinkled instanceof Materials - ? (short) ((Materials) sprinkled).mMetaItemSubID + short aSporadic = sprinkled instanceof Materials ? (short) ((Materials) sprinkled).mMetaItemSubID : sprinkled instanceof Werkstoff ? ((Werkstoff) sprinkled).getmID() : 0; this.mPrimaryMeta = aPrimary; this.mSecondaryMeta = aSecondary; @@ -112,20 +93,16 @@ public abstract class BW_OreLayer extends GT_Worldgen { public List getStacks() { ArrayList ret = new ArrayList<>(); ret.add( - (this.bwOres & 0b1000) != 0 - ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mPrimaryMeta) + (this.bwOres & 0b1000) != 0 ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mPrimaryMeta) : new ItemStack(GregTech_API.sBlockOres1, 1, this.mPrimaryMeta)); ret.add( - (this.bwOres & 0b0100) != 0 - ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mSecondaryMeta) + (this.bwOres & 0b0100) != 0 ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mSecondaryMeta) : new ItemStack(GregTech_API.sBlockOres1, 1, this.mSecondaryMeta)); ret.add( - (this.bwOres & 0b0010) != 0 - ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mBetweenMeta) + (this.bwOres & 0b0010) != 0 ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mBetweenMeta) : new ItemStack(GregTech_API.sBlockOres1, 1, this.mBetweenMeta)); ret.add( - (this.bwOres & 0b0001) != 0 - ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mSporadicMeta) + (this.bwOres & 0b0001) != 0 ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mSporadicMeta) : new ItemStack(GregTech_API.sBlockOres1, 1, this.mSporadicMeta)); return ret; } @@ -140,15 +117,8 @@ public abstract class BW_OreLayer extends GT_Worldgen { } @Override - public boolean executeWorldgen( - World aWorld, - Random aRandom, - String aBiome, - int aDimensionType, - int aChunkX, - int aChunkZ, - IChunkProvider aChunkGenerator, - IChunkProvider aChunkProvider) { + public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, + int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { { int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); int cX = aChunkX - aRandom.nextInt(this.mSize); @@ -171,8 +141,8 @@ public abstract class BW_OreLayer extends GT_Worldgen { } if (this.mBetweenMeta > 0 && shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { - wasPlaced = this.setOreBlock( - aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); + wasPlaced = this + .setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); } if (this.mPrimaryMeta > 0) { @@ -184,8 +154,8 @@ public abstract class BW_OreLayer extends GT_Worldgen { } if (this.mSporadicMeta > 0 && (shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ))) { - wasPlaced = this.setOreBlock( - aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); + wasPlaced = this + .setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); } } } @@ -200,11 +170,11 @@ public abstract class BW_OreLayer extends GT_Worldgen { private boolean shouldPlace(Random aRandom, int cX, int eX, int tX, int cZ, int eZ, int tZ) { if (aRandom.nextInt( - Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) - == 0) return true; + Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0) + return true; if (aRandom.nextInt( - Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) - == 0) return true; + Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) + return true; return false; } @@ -285,18 +255,9 @@ public abstract class BW_OreLayer extends GT_Worldgen { @Override public int hashCode() { return MurmurHash3.murmurhash3_x86_32( - ByteBuffer.allocate(37) - .put(bwOres) - .putInt(mMinY) - .putInt(mWeight) - .putInt(mDensity) - .putInt(mSize) - .putInt(mMaxY) - .putInt(mPrimaryMeta) - .putInt(mSecondaryMeta) - .putInt(mBetweenMeta) - .putInt(mSporadicMeta) - .array(), + ByteBuffer.allocate(37).put(bwOres).putInt(mMinY).putInt(mWeight).putInt(mDensity).putInt(mSize) + .putInt(mMaxY).putInt(mPrimaryMeta).putInt(mSecondaryMeta).putInt(mBetweenMeta) + .putInt(mSporadicMeta).array(), 0, 37, 31); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java index 47f2a85ae7..ac4f909e5c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java @@ -1,37 +1,30 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.oregen; -import cpw.mods.fml.common.IWorldGenerator; -import gregtech.api.objects.XSTR; -import gregtech.api.util.GT_Log; import java.util.HashSet; import java.util.Random; + import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; +import cpw.mods.fml.common.IWorldGenerator; +import gregtech.api.objects.XSTR; +import gregtech.api.util.GT_Log; + /** * Original GT File Stripped and adjusted to work with this mod */ @@ -42,19 +35,19 @@ public class BW_WordGenerator implements IWorldGenerator { // GameRegistry.registerWorldGenerator(this, 1073741823); } - public synchronized void generate( - Random aRandom, - int aX, - int aZ, - World aWorld, - IChunkProvider aChunkGenerator, + public synchronized void generate(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { new BW_WordGenerator.WorldGenContainer( - aX * 16, aZ * 16, aWorld.provider.dimensionId, aWorld, aChunkGenerator, aChunkProvider) - .run(); + aX * 16, + aZ * 16, + aWorld.provider.dimensionId, + aWorld, + aChunkGenerator, + aChunkProvider).run(); } public static class WorldGenContainer implements Runnable { + public static HashSet mGenerated = new HashSet<>(2000); public final int mDimensionType; public final World mWorld; @@ -63,12 +56,7 @@ public class BW_WordGenerator implements IWorldGenerator { public int mX; public int mZ; - public WorldGenContainer( - int aX, - int aZ, - int aDimensionType, - World aWorld, - IChunkProvider aChunkGenerator, + public WorldGenContainer(int aX, int aZ, int aDimensionType, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { this.mX = aX; this.mZ = aZ; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index d7135a8d5d..c8b6459add 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.oregen; @@ -26,14 +17,15 @@ import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; import static gregtech.api.enums.Materials.*; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import gregtech.api.interfaces.ISubTagContainer; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidRegistry; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import gregtech.api.interfaces.ISubTagContainer; + public class BW_WorldGenRoss128b extends BW_OreLayer { public Block getDefaultBlockToReplace() { @@ -42,7 +34,7 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { @Override public int[] getDefaultDamageToReplace() { - return new int[] {0}; + return new int[] { 0 }; } @Override @@ -50,27 +42,38 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { return StatCollector.translateToLocal("planet.Ross128b"); } - public BW_WorldGenRoss128b( - String aName, - boolean aDefault, - int aMinY, - int aMaxY, - int aWeight, - int aDensity, - int aSize, - ISubTagContainer top, - ISubTagContainer bottom, - ISubTagContainer between, + public BW_WorldGenRoss128b(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, + int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { super(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, top, bottom, between, sprinkled); } public static void initOres() { new BW_WorldGenRoss128b( - "ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, Thorianit, Uraninite, Lepidolite, Spodumene); + "ore.mix.ross128.Thorianit", + true, + 30, + 60, + 17, + 1, + 16, + Thorianit, + Uraninite, + Lepidolite, + Spodumene); new BW_WorldGenRoss128b("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Graphite, Diamond, Coal, Graphite); new BW_WorldGenRoss128b( - "ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, Bismuthinit, Stibnite, Bismuth, Bismutite); + "ore.mix.ross128.bismuth", + true, + 5, + 80, + 30, + 1, + 16, + Bismuthinit, + Stibnite, + Bismuth, + Bismutite); new BW_WorldGenRoss128b( "ore.mix.ross128.TurmalinAlkali", true, @@ -84,11 +87,41 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { ChromoAluminoPovondrait, VanadioOxyDravit); new BW_WorldGenRoss128b( - "ore.mix.ross128.Roquesit", true, 30, 50, 3, 1, 12, Arsenopyrite, Ferberite, Loellingit, Roquesit); + "ore.mix.ross128.Roquesit", + true, + 30, + 50, + 3, + 1, + 12, + Arsenopyrite, + Ferberite, + Loellingit, + Roquesit); new BW_WorldGenRoss128b( - "ore.mix.ross128.Tungstate", true, 5, 40, 10, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite); + "ore.mix.ross128.Tungstate", + true, + 5, + 40, + 10, + 4, + 14, + Ferberite, + Huebnerit, + Loellingit, + Scheelite); new BW_WorldGenRoss128b( - "ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, Djurleit, Bornite, Wittichenit, Tetrahedrite); + "ore.mix.ross128.CopperSulfits", + true, + 40, + 70, + 80, + 3, + 24, + Djurleit, + Bornite, + Wittichenit, + Tetrahedrite); new BW_WorldGenRoss128b( "ore.mix.ross128.Forsterit", true, @@ -114,14 +147,31 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { DescloiziteCUVO4, DescloiziteZNVO4); new BW_WorldGenRoss128b( - "ore.mix.ross128.RedZircon", true, 10, 80, 40, 3, 24, Fayalit, FuchsitAL, RedZircon, FuchsitCR); + "ore.mix.ross128.RedZircon", + true, + 10, + 80, + 40, + 3, + 24, + Fayalit, + FuchsitAL, + RedZircon, + FuchsitCR); } public static void initundergroundFluids() { String ross128b = StatCollector.translateToLocal("planet.Ross128b"); uo_dimensionList.SetConfigValues(ross128b, ross128b, "veryheavyoil", "liquid_extra_heavy_oil", 0, 625, 40, 5); uo_dimensionList.SetConfigValues( - ross128b, ross128b, "lava", FluidRegistry.getFluidName(FluidRegistry.LAVA), 0, 820, 5, 5); + ross128b, + ross128b, + "lava", + FluidRegistry.getFluidName(FluidRegistry.LAVA), + 0, + 820, + 5, + 5); uo_dimensionList.SetConfigValues(ross128b, ross128b, "gas_natural_gas", "gas_natural_gas", 0, 625, 65, 5); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java index 074e1fc6b5..0566541d44 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.oregen; @@ -26,25 +17,17 @@ import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; import static gregtech.api.enums.Materials.*; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import gregtech.api.interfaces.ISubTagContainer; import net.minecraft.block.Block; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import gregtech.api.interfaces.ISubTagContainer; + public class BW_WorldGenRoss128ba extends BW_OreLayer { - public BW_WorldGenRoss128ba( - String aName, - boolean aDefault, - int aMinY, - int aMaxY, - int aWeight, - int aDensity, - int aSize, - ISubTagContainer top, - ISubTagContainer bottom, - ISubTagContainer between, + public BW_WorldGenRoss128ba(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, + int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { super(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, top, bottom, between, sprinkled); } @@ -82,7 +65,17 @@ public class BW_WorldGenRoss128ba extends BW_OreLayer { NaquadahEnriched, NaquadahEnriched); new BW_WorldGenRoss128ba( - "ore.mix.ross128ba.Tungstate", true, 5, 40, 60, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite); + "ore.mix.ross128ba.Tungstate", + true, + 5, + 40, + 60, + 4, + 14, + Ferberite, + Huebnerit, + Loellingit, + Scheelite); new BW_WorldGenRoss128ba( "ore.mix.ross128ba.bart", true, @@ -108,7 +101,17 @@ public class BW_WorldGenRoss128ba extends BW_OreLayer { ChromoAluminoPovondrait, VanadioOxyDravit); new BW_WorldGenRoss128ba( - "ore.mix.ross128ba.Amethyst", true, 5, 80, 35, 2, 8, Amethyst, Olivine, Prasiolite, Hedenbergit); + "ore.mix.ross128ba.Amethyst", + true, + 5, + 80, + 35, + 2, + 8, + Amethyst, + Olivine, + Prasiolite, + Hedenbergit); new BW_WorldGenRoss128ba( "ore.mix.ross128ba.CopperSulfits", true, @@ -122,9 +125,29 @@ public class BW_WorldGenRoss128ba extends BW_OreLayer { Wittichenit, Tetrahedrite); new BW_WorldGenRoss128ba( - "ore.mix.ross128ba.RedZircon", true, 10, 80, 40, 3, 24, Fayalit, FuchsitAL, RedZircon, FuchsitCR); + "ore.mix.ross128ba.RedZircon", + true, + 10, + 80, + 40, + 3, + 24, + Fayalit, + FuchsitAL, + RedZircon, + FuchsitCR); new BW_WorldGenRoss128ba( - "ore.mix.ross128ba.Fluorspar", true, 10, 80, 35, 4, 8, Galena, Sphalerite, Fluorspar, Barite); + "ore.mix.ross128ba.Fluorspar", + true, + 10, + 80, + 35, + 4, + 8, + Galena, + Sphalerite, + Fluorspar, + Barite); } public static void init_undergroundFluids() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java index 3d55084ade..6f21bfd317 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java @@ -1,32 +1,25 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.worldgen; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import gregtech.api.GregTech_API; import java.util.Random; + import net.minecraft.block.Block; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import gregtech.api.GregTech_API; + public class GT_WorldgenUtil { private GT_WorldgenUtil() {} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java index 7c0fd41935..2e042fe7e2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.system.worldgen; @@ -25,17 +16,9 @@ package com.github.bartimaeusnek.bartworks.system.worldgen; import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.maxTierRoss; import static net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST; -import com.github.bartimaeusnek.bartworks.util.Pair; -import gregtech.api.GregTech_API; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.BaseMetaPipeEntity; -import gregtech.api.metatileentity.BaseMetaTileEntity; -import gregtech.api.metatileentity.MetaPipeEntity; -import gregtech.api.objects.XSTR; -import gregtech.api.threads.GT_Runnable_MachineBlockUpdate; -import gregtech.api.util.GT_Utility; import java.security.SecureRandom; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; @@ -45,7 +28,18 @@ import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.ChestGenHooks; -@SuppressWarnings({"ALL"}) +import com.github.bartimaeusnek.bartworks.util.Pair; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import gregtech.api.metatileentity.MetaPipeEntity; +import gregtech.api.objects.XSTR; +import gregtech.api.threads.GT_Runnable_MachineBlockUpdate; +import gregtech.api.util.GT_Utility; + +@SuppressWarnings({ "ALL" }) public abstract class MapGenRuins extends WorldGenerator { protected Pair[][] ToBuildWith = new Pair[4][0]; @@ -85,8 +79,8 @@ public abstract class MapGenRuins extends WorldGenerator { int[] statBlocks = new int[4]; - protected void setRandomBlockWAirChance( - World worldObj, int x, int y, int z, Random rand, int airchance, Pair... blocks) { + protected void setRandomBlockWAirChance(World worldObj, int x, int y, int z, Random rand, int airchance, + Pair... blocks) { if (rand.nextInt(100) > airchance) this.setRandomBlock(worldObj, x, y, z, rand, blocks); else this.setBlock(worldObj, x, y, z, Blocks.air, 0); } @@ -147,8 +141,7 @@ public abstract class MapGenRuins extends WorldGenerator { protected void setGTMachine(World worldObj, int x, int y, int z, int meta, String ownerName, byte facing) { try { GT_Runnable_MachineBlockUpdate.setDisabled(); - } catch (Throwable ignored) { - } + } catch (Throwable ignored) {} setGTMachineBlock(worldObj, x, y, z, meta); BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z); BTE.setOwnerName(ownerName); @@ -157,20 +150,11 @@ public abstract class MapGenRuins extends WorldGenerator { checkTile(BTE, worldObj, x, y, z, meta, ownerName, facing, 0); try { GT_Runnable_MachineBlockUpdate.setEnabled(); - } catch (Throwable ignored) { - } + } catch (Throwable ignored) {} } - private void checkTile( - BaseMetaTileEntity BTE, - World worldObj, - int x, - int y, - int z, - int meta, - String ownerName, - byte facing, - int depth) { + private void checkTile(BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, + byte facing, int depth) { if (depth < 25) { if (BTE.getMetaTileID() != meta || worldObj.getTileEntity(x, y, z) != BTE || BTE.isInvalid()) { redoTile(BTE, worldObj, x, y, z, meta, ownerName, facing); @@ -182,8 +166,8 @@ public abstract class MapGenRuins extends WorldGenerator { } } - private void redoTile( - BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, byte facing) { + private void redoTile(BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, + byte facing) { reSetGTTileEntity(BTE, worldObj, x, y, z, meta); BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z); BTE.setOwnerName(ownerName); @@ -193,8 +177,7 @@ public abstract class MapGenRuins extends WorldGenerator { protected void setGTCable(World worldObj, int x, int y, int z, int meta) { try { GT_Runnable_MachineBlockUpdate.setDisabled(); - } catch (Throwable ignored) { - } + } catch (Throwable ignored) {} BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) setGTMachineBlock(worldObj, x, y, z, meta); MetaPipeEntity MPE = (MetaPipeEntity) BTE.getMetaTileEntity(); BTE.mConnections |= (byte) (1 << (byte) 4); @@ -206,8 +189,7 @@ public abstract class MapGenRuins extends WorldGenerator { MPE.mConnections = BTE.mConnections; try { GT_Runnable_MachineBlockUpdate.setEnabled(); - } catch (Throwable ignored) { - } + } catch (Throwable ignored) {} } public static class RuinsBase extends MapGenRuins { @@ -230,11 +212,11 @@ public abstract class MapGenRuins extends WorldGenerator { } } - this.setFloorBlocks(new int[] {0, 0, 0}, Blocks.brick_block, Blocks.double_stone_slab, Blocks.stonebrick); - this.setWallBlocks(new int[] {0, 1, 2, 1, 1}, Blocks.stonebrick); - this.setRoofBlocks(new int[] {9}, Blocks.log); - this.setMiscBlocks(new int[] {1}, Blocks.log); - this.statBlocks = new int[] {rand.nextInt(this.ToBuildWith[0].length)}; + this.setFloorBlocks(new int[] { 0, 0, 0 }, Blocks.brick_block, Blocks.double_stone_slab, Blocks.stonebrick); + this.setWallBlocks(new int[] { 0, 1, 2, 1, 1 }, Blocks.stonebrick); + this.setRoofBlocks(new int[] { 9 }, Blocks.log); + this.setMiscBlocks(new int[] { 1 }, Blocks.log); + this.statBlocks = new int[] { rand.nextInt(this.ToBuildWith[0].length) }; int colored = rand.nextInt(15); int tier = secureRandom.nextInt(maxTierRoss); boolean useColor = rand.nextBoolean(); @@ -253,39 +235,54 @@ public abstract class MapGenRuins extends WorldGenerator { } else if (dy > 0 && dy < 4) { if (Math.abs(dx) == 5 && Math.abs(dz) == 5) { this.setRandomBlockWAirChance( - worldObj, x + dx, y + dy, z + dz, rand, 5, this.ToBuildWith[3][0]); + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 5, + this.ToBuildWith[3][0]); } else if ((dx == 0) && dz == -5 && (dy == 1 || dy == 2)) { if (dy == 1) this.setBlock(worldObj, x + dx, y + 1, z + -5, Blocks.iron_door, 1); if (dy == 2) this.setBlock(worldObj, x + dx, y + 2, z + dz, Blocks.iron_door, 8); } else if (Math.abs(dx) == 5 && Math.abs(dz) < 5 || Math.abs(dz) == 5 && Math.abs(dx) < 5) { this.setRandomBlockWAirChance( - worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 25, + this.ToBuildWith[1]); if (dy == 2) { - if (rand.nextInt(100) < 12) - if (useColor) - this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + 2, - z + dz, - rand, - 25, - new Pair<>(Blocks.stained_glass_pane, colored)); - else - this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + dy, - z + dz, - rand, - 25, - new Pair<>(Blocks.glass_pane, 0)); + if (rand.nextInt(100) < 12) if (useColor) this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + 2, + z + dz, + rand, + 25, + new Pair<>(Blocks.stained_glass_pane, colored)); + else this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 25, + new Pair<>(Blocks.glass_pane, 0)); } } if (dy == 3 && Math.abs(dx) == 6) { this.setRandomBlockWAirChance( - worldObj, x + dx, y + 3, z + dz, rand, 25, this.ToBuildWith[2]); + worldObj, + x + dx, + y + 3, + z + dz, + rand, + 25, + this.ToBuildWith[2]); } if (dy == 1) { @@ -338,43 +335,87 @@ public abstract class MapGenRuins extends WorldGenerator { } } } else if (dy == 4) { - if (Math.abs(dx) == 5) - this.setRandomBlockWAirChance( - worldObj, x + dx, y + 4, z + dz, rand, 25, this.ToBuildWith[2]); - else if (Math.abs(dz) == 5 && Math.abs(dx) < 5) - this.setRandomBlockWAirChance( - worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + if (Math.abs(dx) == 5) this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + 4, + z + dz, + rand, + 25, + this.ToBuildWith[2]); + else if (Math.abs(dz) == 5 && Math.abs(dx) < 5) this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 25, + this.ToBuildWith[1]); } else if (dy == 5) { - if (Math.abs(dx) == 4) - this.setRandomBlockWAirChance( - worldObj, x + dx, y + 5, z + dz, rand, 25, this.ToBuildWith[2]); - else if (Math.abs(dz) == 5 && Math.abs(dx) < 4) - this.setRandomBlockWAirChance( - worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + if (Math.abs(dx) == 4) this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + 5, + z + dz, + rand, + 25, + this.ToBuildWith[2]); + else if (Math.abs(dz) == 5 && Math.abs(dx) < 4) this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 25, + this.ToBuildWith[1]); } else if (dy == 6) { - if (Math.abs(dx) == 3) - this.setRandomBlockWAirChance( - worldObj, x + dx, y + 6, z + dz, rand, 25, this.ToBuildWith[2]); - else if (Math.abs(dz) == 5 && Math.abs(dx) < 3) - this.setRandomBlockWAirChance( - worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + if (Math.abs(dx) == 3) this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + 6, + z + dz, + rand, + 25, + this.ToBuildWith[2]); + else if (Math.abs(dz) == 5 && Math.abs(dx) < 3) this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 25, + this.ToBuildWith[1]); } else if (dy == 7) { - if (Math.abs(dx) == 2) - this.setRandomBlockWAirChance( - worldObj, x + dx, y + 7, z + dz, rand, 25, this.ToBuildWith[2]); - else if (Math.abs(dz) == 5 && Math.abs(dx) < 2) - this.setRandomBlockWAirChance( - worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + if (Math.abs(dx) == 2) this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + 7, + z + dz, + rand, + 25, + this.ToBuildWith[2]); + else if (Math.abs(dz) == 5 && Math.abs(dx) < 2) this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 25, + this.ToBuildWith[1]); } else if (dy == 8) { - if (Math.abs(dx) == 1 || Math.abs(dx) == 0) - this.setRandomBlockWAirChance( - worldObj, x + dx, y + 8, z + dz, rand, 25, this.ToBuildWith[2]); + if (Math.abs(dx) == 1 || Math.abs(dx) == 0) this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + 8, + z + dz, + rand, + 25, + this.ToBuildWith[2]); } } } } - tosetloop: - while (set < toSet) { + tosetloop: while (set < toSet) { int dy = 1; int dz = 3; for (int dx = 2; dx > -5; dx--) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 6c597ced06..ecf31705be 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; @@ -25,6 +16,20 @@ package com.github.bartimaeusnek.bartworks.util; import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; import static com.github.bartimaeusnek.bartworks.util.BW_Util.specialToByte; +import java.util.*; +import java.util.function.Supplier; + +import javax.annotation.Nonnegative; + +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; + +import org.jetbrains.annotations.Nullable; + import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; @@ -33,6 +38,7 @@ import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.api.math.Pos2d; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -46,16 +52,6 @@ import gregtech.api.util.GT_Utility; import gregtech.nei.NEIRecipeInfo; import ic2.core.Ic2Items; import ic2.core.item.ItemFluidCell; -import java.util.*; -import java.util.function.Supplier; -import javax.annotation.Nonnegative; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidStack; -import org.jetbrains.annotations.Nullable; public class BWRecipes { @@ -82,7 +78,8 @@ public class BWRecipes { "", true, false // special handler - ) { + ) { + @Nullable @Override public IDrawable getOverlayForSlot(boolean isFluid, boolean isOutput, int index, boolean isSpecial) { @@ -108,71 +105,65 @@ public class BWRecipes { } return super.getOverlayForSlot(isFluid, isOutput, index, false); } - }.setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE) - .setLogo(BW_UITextures.PICTURE_BW_LOGO_47X21) - .setLogoPos(125, 3) - .setLogoSize(47, 21); + }.setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE).setLogo(BW_UITextures.PICTURE_BW_LOGO_47X21) + .setLogoPos(125, 3).setLogoSize(47, 21); private final GT_Recipe.GT_Recipe_Map sBacteriaVat = new BacteriaVatRecipeMap( - new HashSet<>(50), - "bw.recipe.BacteriaVat", - StatCollector.translateToLocal("tile.biovat.name"), - null, - "gregtech:textures/gui/basicmachines/Default", - 6, - 2, - 0, - 1, - 1, - " Sievert: ", - 1, - " Sv", - true, - false // special handler - ) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE) + new HashSet<>(50), + "bw.recipe.BacteriaVat", + StatCollector.translateToLocal("tile.biovat.name"), + null, + "gregtech:textures/gui/basicmachines/Default", + 6, + 2, + 0, + 1, + 1, + " Sievert: ", + 1, + " Sv", + true, + false // special handler + ).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE) .setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> { int[] tSpecialA = GT_TileEntity_BioVat.specialValueUnpack(recipeInfo.recipe.mSpecialValue); return Arrays.asList( StatCollector.translateToLocal("nei.biovat.0.name") + " " + tSpecialA[0], - (tSpecialA[2] == 1 - ? StatCollector.translateToLocal("nei.biovat.1.name") - : StatCollector.translateToLocal("nei.biovat.2.name")) + (tSpecialA[2] == 1 ? StatCollector.translateToLocal("nei.biovat.1.name") + : StatCollector.translateToLocal("nei.biovat.2.name")) + applyPrefixAndSuffix.apply(tSpecialA[3])); }); private final GT_Recipe.GT_Recipe_Map sAcidGenFuels = new BW_Recipe_Map_LiquidFuel( - new HashSet<>(10), - "bw.fuels.acidgens", - StatCollector.translateToLocal("tile.acidgenerator.name"), - null, - "gregtech:textures/gui/basicmachines/Default", - 1, - 1, - 1, - 1, - 1, - "EU generated: ", - 1000, - "", - false, - true) - .useModularUI(true); + new HashSet<>(10), + "bw.fuels.acidgens", + StatCollector.translateToLocal("tile.acidgenerator.name"), + null, + "gregtech:textures/gui/basicmachines/Default", + 1, + 1, + 1, + 1, + 1, + "EU generated: ", + 1000, + "", + false, + true).useModularUI(true); private final GT_Recipe.GT_Recipe_Map sCircuitAssemblyLineMap = new SpecialObjectSensitiveMap( - new HashSet<>(60), - "bw.recipe.cal", - "Circuit Assembly Line", - null, - "gregtech:textures/gui/basicmachines/Default", - 6, - 1, - 1, - 1, - 1, - "", - 1, - "", - true, - true) - .setProgressBar(GT_UITextures.PROGRESSBAR_CIRCUIT_ASSEMBLER); + new HashSet<>(60), + "bw.recipe.cal", + "Circuit Assembly Line", + null, + "gregtech:textures/gui/basicmachines/Default", + 6, + 1, + 1, + 1, + 1, + "", + 1, + "", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_CIRCUIT_ASSEMBLER); private final GT_Recipe.GT_Recipe_Map sRadHatch = new GT_Recipe.GT_Recipe_Map( new HashSet<>(150), "bw.recipe.radhatch", @@ -189,13 +180,13 @@ public class BWRecipes { "", false, true) { + @Override - public void addProgressBarUI( - ModularWindow.Builder builder, Supplier progressSupplier, Pos2d windowOffset) { - builder.widget(new DrawableWidget() - .setDrawable(BW_UITextures.PICTURE_RADIATION) - .setPos(new Pos2d(74, 20).add(windowOffset)) - .setSize(29, 27)); + public void addProgressBarUI(ModularWindow.Builder builder, Supplier progressSupplier, + Pos2d windowOffset) { + builder.widget( + new DrawableWidget().setDrawable(BW_UITextures.PICTURE_RADIATION) + .setPos(new Pos2d(74, 20).add(windowOffset)).setSize(29, 27)); } @Override @@ -203,11 +194,8 @@ public class BWRecipes { @Override protected void drawNEIDurationInfo(NEIRecipeInfo recipeInfo) {} - }.setSlotOverlay(false, false, BW_UITextures.OVERLAY_SLOT_ROD) - .setLogo(BW_UITextures.PICTURE_BW_LOGO_47X21) - .setLogoPos(118, 55) - .setLogoSize(47, 21) - .setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> { + }.setSlotOverlay(false, false, BW_UITextures.OVERLAY_SLOT_ROD).setLogo(BW_UITextures.PICTURE_BW_LOGO_47X21) + .setLogoPos(118, 55).setLogoSize(47, 21).setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> { int radioLevel = recipeInfo.recipe.mEUt; int amount = recipeInfo.recipe.mDuration; long time = recipeInfo.recipe.mSpecialValue; @@ -247,12 +235,13 @@ public class BWRecipes { } public boolean addRadHatch(ItemStack item, int radioLevel, int amount, short[] rgba) { - return sRadHatch.addRecipe(new DynamicGTRecipe( + return sRadHatch.addRecipe( + new DynamicGTRecipe( false, - new ItemStack[] {item}, + new ItemStack[] { item }, null, null, - new int[] {rgba[0], rgba[1], rgba[2]}, + new int[] { rgba[0], rgba[1], rgba[2] }, null, null, amount, @@ -262,12 +251,13 @@ public class BWRecipes { } public boolean addRadHatch(ItemStack item, int radioLevel, int amount, int time, short[] rgba) { - return sRadHatch.addRecipe(new DynamicGTRecipe( + return sRadHatch.addRecipe( + new DynamicGTRecipe( false, - new ItemStack[] {item}, + new ItemStack[] { item }, null, null, - new int[] {rgba[0], rgba[1], rgba[2]}, + new int[] { rgba[0], rgba[1], rgba[2] }, null, null, amount, @@ -276,20 +266,13 @@ public class BWRecipes { != null; } - public boolean addBioLabRecipe( - ItemStack[] aInputs, - ItemStack aOutput, - ItemStack aSpecialItems, - int[] aChances, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, - int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe( + public boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, ItemStack aSpecialItems, int[] aChances, + FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return sBiolab.addRecipe( + new DynamicGTRecipe( true, aInputs, - new ItemStack[] {aOutput}, + new ItemStack[] { aOutput }, aSpecialItems, aChances, aFluidInputs, @@ -300,44 +283,34 @@ public class BWRecipes { != null; } - public boolean addBioLabRecipeIncubation( - ItemStack aInput, - BioCulture aOutput, - int[] aChances, - FluidStack[] aFluidInputs, - int aDuration, - int aEUt, - int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe( + public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, + FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { + return sBiolab.addRecipe( + new DynamicGTRecipe( true, - new ItemStack[] {BioItemList.getPetriDish(null), aInput}, - new ItemStack[] {BioItemList.getPetriDish(aOutput)}, + new ItemStack[] { BioItemList.getPetriDish(null), aInput }, + new ItemStack[] { BioItemList.getPetriDish(aOutput) }, null, aChances, aFluidInputs, - new FluidStack[] {GT_Values.NF}, + new FluidStack[] { GT_Values.NF }, aDuration, aEUt, aSpecialValue)) != null; } - public boolean addBioLabRecipeIncubation( - ItemStack aInput, - BioCulture aOutput, - int[] aChances, - FluidStack aFluidInputs, - int aDuration, - int aEUt, - int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe( + public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, + FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { + return sBiolab.addRecipe( + new DynamicGTRecipe( true, - new ItemStack[] {BioItemList.getPetriDish(null), aInput}, - new ItemStack[] {BioItemList.getPetriDish(aOutput)}, + new ItemStack[] { BioItemList.getPetriDish(null), aInput }, + new ItemStack[] { BioItemList.getPetriDish(aOutput) }, null, aChances, - new FluidStack[] {aFluidInputs}, - new FluidStack[] {GT_Values.NF}, + new FluidStack[] { aFluidInputs }, + new FluidStack[] { GT_Values.NF }, aDuration, aEUt, aSpecialValue)) @@ -345,19 +318,13 @@ public class BWRecipes { } @Deprecated - public boolean addBioLabRecipeDNAExtraction( - ItemStack[] aInputs, - ItemStack aOutput, - int[] aChances, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, - int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe( + public boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, + FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return sBiolab.addRecipe( + new DynamicGTRecipe( true, aInputs, - new ItemStack[] {aOutput}, + new ItemStack[] { aOutput }, BioItemList.mBioLabParts[0], aChances, aFluidInputs, @@ -369,19 +336,13 @@ public class BWRecipes { } @Deprecated - public boolean addBioLabRecipePCRThermoclycling( - ItemStack[] aInputs, - ItemStack aOutput, - int[] aChances, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, - int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe( + public boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, + FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return sBiolab.addRecipe( + new DynamicGTRecipe( true, aInputs, - new ItemStack[] {aOutput}, + new ItemStack[] { aOutput }, BioItemList.mBioLabParts[1], aChances, aFluidInputs, @@ -393,19 +354,13 @@ public class BWRecipes { } @Deprecated - public boolean addBioLabRecipePlasmidSynthesis( - ItemStack[] aInputs, - ItemStack aOutput, - int[] aChances, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, - int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe( + public boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, + FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return sBiolab.addRecipe( + new DynamicGTRecipe( true, aInputs, - new ItemStack[] {aOutput}, + new ItemStack[] { aOutput }, BioItemList.mBioLabParts[2], aChances, aFluidInputs, @@ -417,19 +372,13 @@ public class BWRecipes { } @Deprecated - public boolean addBioLabRecipeTransformation( - ItemStack[] aInputs, - ItemStack aOutput, - int[] aChances, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, - int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe( + public boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, + FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return sBiolab.addRecipe( + new DynamicGTRecipe( true, aInputs, - new ItemStack[] {aOutput}, + new ItemStack[] { aOutput }, BioItemList.mBioLabParts[3], aChances, aFluidInputs, @@ -441,19 +390,13 @@ public class BWRecipes { } @Deprecated - public boolean addBioLabRecipeClonalCellularSynthesis( - ItemStack[] aInputs, - ItemStack aOutput, - int[] aChances, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, - int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe( + public boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, + FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return sBiolab.addRecipe( + new DynamicGTRecipe( true, aInputs, - new ItemStack[] {aOutput}, + new ItemStack[] { aOutput }, BioItemList.mBioLabParts[4], aChances, aFluidInputs, @@ -465,21 +408,15 @@ public class BWRecipes { } @Deprecated - public boolean addBacterialVatRecipe( - ItemStack[] aInputs, - ItemStack[] aOutputs, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, - Materials material, - @Nonnegative byte glasTier) { + public boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative byte glasTier) { int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) aSievert += calculateSv(material); aSievert = aSievert << 6; aSievert = aSievert | glasTier; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + return sBacteriaVat.addRecipe( + new BacteriaVatRecipe( false, aInputs, aOutputs, @@ -493,17 +430,9 @@ public class BWRecipes { != null; } - public boolean addBacterialVatRecipe( - ItemStack[] aInputs, - BioCulture aCulture, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - @Nonnegative int aDuration, - @Nonnegative int aEUt, - @Nonnegative int aSv, - @Nonnegative int glasTier, - int aSpecialValue, - boolean exactSv) { + public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, @Nonnegative int aSv, + @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { byte gTier = (byte) glasTier; int aSievert = 0; if (aSv >= 83 || aSv == 61 || aSv == 43) aSievert += aSv; @@ -513,7 +442,8 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + return sBacteriaVat.addRecipe( + new BacteriaVatRecipe( false, aInputs, null, @@ -528,17 +458,9 @@ public class BWRecipes { } @Deprecated - public boolean addBacterialVatRecipe( - ItemStack[] aInputs, - BioCulture aCulture, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, - Materials material, - @Nonnegative int glasTier, - int aSpecialValue, - boolean exactSv) { + public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative int glasTier, + int aSpecialValue, boolean exactSv) { byte gTier = (byte) glasTier; int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) @@ -549,7 +471,8 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + return sBacteriaVat.addRecipe( + new BacteriaVatRecipe( false, aInputs, null, @@ -564,22 +487,16 @@ public class BWRecipes { } @Deprecated - public boolean addBacterialVatRecipe( - ItemStack[] aInputs, - ItemStack[] aOutputs, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, - Materials material, - boolean exactSv) { + public boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, boolean exactSv) { int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) aSievert += calculateSv(material); aSievert = aSievert << 1; aSievert = aSievert | (exactSv ? 1 : 0); aSievert = aSievert << 6; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + return sBacteriaVat.addRecipe( + new BacteriaVatRecipe( false, aInputs, aOutputs, @@ -594,15 +511,8 @@ public class BWRecipes { } @Deprecated - public boolean addBacterialVatRecipe( - ItemStack[] aInputs, - BioCulture culture, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, - Materials material, - int aSpecialValue, + public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture culture, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, int aSpecialValue, boolean exactSv) { int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) @@ -612,7 +522,8 @@ public class BWRecipes { aSievert = aSievert << 2; aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + return sBacteriaVat.addRecipe( + new BacteriaVatRecipe( false, aInputs, null, @@ -629,17 +540,12 @@ public class BWRecipes { /** * Adds a Vat recipe without Rad requirements but with Glas requirements */ - public boolean addBacterialVatRecipe( - ItemStack[] aInputs, - BioCulture culture, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, - byte glasTier) { + public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture culture, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, int aDuration, int aEUt, byte glasTier) { int aSievert = 0; aSievert = aSievert | glasTier; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + return sBacteriaVat.addRecipe( + new BacteriaVatRecipe( false, aInputs, null, @@ -656,14 +562,10 @@ public class BWRecipes { /** * Adds a Vat recipe without Rad or Glas requirements */ - public boolean addBacterialVatRecipe( - ItemStack[] aInputs, - FluidStack[] aFluidInputs, - BioCulture culture, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt) { - return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + public boolean addBacterialVatRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, BioCulture culture, + FluidStack[] aFluidOutputs, int aDuration, int aEUt) { + return sBacteriaVat.addRecipe( + new BacteriaVatRecipe( false, aInputs, null, @@ -677,17 +579,9 @@ public class BWRecipes { != null; } - public boolean addTrimmedBacterialVatRecipe( - ItemStack[] aInputs, - BioCulture aCulture, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, - Materials material, - @Nonnegative int glasTier, - int aSpecialValue, - boolean exactSv) { + public boolean addTrimmedBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative int glasTier, + int aSpecialValue, boolean exactSv) { byte gTier = (byte) glasTier; int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) @@ -698,7 +592,8 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + return sBacteriaVat.addRecipe( + new BacteriaVatRecipe( true, aInputs, null, @@ -714,18 +609,9 @@ public class BWRecipes { public static class DynamicGTRecipe extends GT_Recipe { - public DynamicGTRecipe( - boolean aOptimize, - ItemStack[] aInputs, - ItemStack[] aOutputs, - Object aSpecialItems, - int[] aChances, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, - int aSpecialValue, - GT_Recipe originalRecipe) { + public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, + int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue, GT_Recipe originalRecipe) { super( aOptimize, aInputs, @@ -744,16 +630,8 @@ public class BWRecipes { } } - public DynamicGTRecipe( - boolean aOptimize, - ItemStack[] aInputs, - ItemStack[] aOutputs, - Object aSpecialItems, - int[] aChances, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, + public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, + int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { this( aOptimize, @@ -772,21 +650,10 @@ public class BWRecipes { public static class BW_Recipe_Map_LiquidFuel extends GT_Recipe.GT_Recipe_Map_Fuel { - public BW_Recipe_Map_LiquidFuel( - Collection aRecipeList, - String aUnlocalizedName, - String aLocalName, - String aNEIName, - String aNEIGUIPath, - int aUsualInputCount, - int aUsualOutputCount, - int aMinimalInputItems, - int aMinimalInputFluids, - int aAmperage, - String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, - String aNEISpecialValuePost, - boolean aShowVoltageAmperageInNEI, + public BW_Recipe_Map_LiquidFuel(Collection aRecipeList, String aUnlocalizedName, String aLocalName, + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, + int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( aRecipeList, @@ -812,7 +679,9 @@ public class BWRecipes { public GT_Recipe addMoltenFuel(Materials M, int burn) { return super.addFuel( - GT_OreDictUnificator.get(OrePrefixes.cellMolten, M, 1), Materials.Empty.getCells(1), burn); + GT_OreDictUnificator.get(OrePrefixes.cellMolten, M, 1), + Materials.Empty.getCells(1), + burn); } public GT_Recipe addLiquidFuel(FluidStack fluidStack, int burn) { @@ -822,16 +691,8 @@ public class BWRecipes { public static class BacteriaVatRecipe extends GT_Recipe { - public BacteriaVatRecipe( - boolean aOptimize, - ItemStack[] aInputs, - ItemStack[] aOutputs, - ItemStack aSpecialItems, - int[] aChances, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, + public BacteriaVatRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, ItemStack aSpecialItems, + int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { super( aOptimize, @@ -849,21 +710,10 @@ public class BWRecipes { public static class BacteriaVatRecipeMap extends BWRecipes.SpecialObjectSensitiveMap { - public BacteriaVatRecipeMap( - Collection aRecipeList, - String aUnlocalizedName, - String aLocalName, - String aNEIName, - String aNEIGUIPath, - int aUsualInputCount, - int aUsualOutputCount, - int aMinimalInputItems, - int aMinimalInputFluids, - int aAmperage, - String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, - String aNEISpecialValuePost, - boolean aShowVoltageAmperageInNEI, + public BacteriaVatRecipeMap(Collection aRecipeList, String aUnlocalizedName, String aLocalName, + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, + int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( aRecipeList, @@ -883,23 +733,21 @@ public class BWRecipes { aNEIAllowed); } - protected GT_Recipe addRecipe( - GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) { + protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, + boolean aHidden) { aRecipe.mHidden = aHidden; aRecipe.mFakeRecipe = aFakeRecipe; - GT_Recipe isthere = - this.findRecipe(null, false, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs); + GT_Recipe isthere = this + .findRecipe(null, false, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs); if (aRecipe.mFluidInputs.length < this.mMinimalInputFluids && aRecipe.mInputs.length < this.mMinimalInputItems) { return null; } else { - return aCheckForCollisions - && isthere != null - && BW_Util.areStacksEqualOrNull( - (ItemStack) isthere.mSpecialItems, (ItemStack) aRecipe.mSpecialItems) - ? null - : this.add(aRecipe); + return aCheckForCollisions && isthere != null + && BW_Util.areStacksEqualOrNull( + (ItemStack) isthere.mSpecialItems, + (ItemStack) aRecipe.mSpecialItems) ? null : this.add(aRecipe); } } @@ -910,9 +758,9 @@ public class BWRecipes { public GT_Recipe addRecipe(GT_Recipe aRecipe) { - if (aRecipe.mInputs.length > 0 - && GT_Utility.areStacksEqual( - aRecipe.mInputs[aRecipe.mInputs.length - 1], GT_Utility.getIntegratedCircuit(32767))) + if (aRecipe.mInputs.length > 0 && GT_Utility.areStacksEqual( + aRecipe.mInputs[aRecipe.mInputs.length - 1], + GT_Utility.getIntegratedCircuit(32767))) return aRecipe; else { ItemStack[] nu1 = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1); @@ -937,21 +785,10 @@ public class BWRecipes { public static class SpecialObjectSensitiveMap extends GT_Recipe.GT_Recipe_Map { - public SpecialObjectSensitiveMap( - Collection aRecipeList, - String aUnlocalizedName, - String aLocalName, - String aNEIName, - String aNEIGUIPath, - int aUsualInputCount, - int aUsualOutputCount, - int aMinimalInputItems, - int aMinimalInputFluids, - int aAmperage, - String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, - String aNEISpecialValuePost, - boolean aShowVoltageAmperageInNEI, + public SpecialObjectSensitiveMap(Collection aRecipeList, String aUnlocalizedName, String aLocalName, + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, + int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( aRecipeList, @@ -974,24 +811,22 @@ public class BWRecipes { /** * finds a Recipe matching the aFluid, aSpecial and ItemStack Inputs. * - * @param aTileEntity an Object representing the current coordinates of the executing Block/Entity/Whatever. This may be null, especially during Startup. - * @param aRecipe in case this is != null it will try to use this Recipe first when looking things up. + * @param aTileEntity an Object representing the current coordinates of the executing + * Block/Entity/Whatever. This may be null, especially during Startup. + * @param aRecipe in case this is != null it will try to use this Recipe first when looking things + * up. * @param aNotUnificated if this is T the Recipe searcher will unificate the ItemStack Inputs - * @param aDontCheckStackSizes if set to false will only return recipes that can be executed at least once with the provided input + * @param aDontCheckStackSizes if set to false will only return recipes that can be executed at least once with + * the provided input * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage * @param aFluids the Fluid Inputs - * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with this, but some custom ones do. Like this one. + * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with + * this, but some custom ones do. Like this one. * @param aInputs the Item Inputs * @return the Recipe it has found or null for no matching Recipe */ - public GT_Recipe findRecipe( - IHasWorldObjectAndCoords aTileEntity, - GT_Recipe aRecipe, - boolean aNotUnificated, - boolean aDontCheckStackSizes, - long aVoltage, - FluidStack[] aFluids, - ItemStack aSpecialSlot, + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, + boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { // No Recipes? Well, nothing to be found then. if (mRecipeList.isEmpty()) return null; @@ -1019,49 +854,34 @@ public class BWRecipes { if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object) aInputs); // Check the Recipe which has been used last time in order to not have to search for it again, if possible. - if (aRecipe != null) - if (!aRecipe.mFakeRecipe - && aRecipe.mCanBeBuffered - && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) - && BW_Util.areStacksEqualOrNull((ItemStack) aRecipe.mSpecialItems, aSpecialSlot)) - return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; + if (aRecipe != null) if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered + && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) + && BW_Util.areStacksEqualOrNull((ItemStack) aRecipe.mSpecialItems, aSpecialSlot)) + return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. - if (mUsualInputCount > 0 && aInputs != null) - for (ItemStack tStack : aInputs) - if (tStack != null) { - Collection tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack)); - if (tRecipes != null) - for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) - && BW_Util.areStacksEqualOrNull( - (ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) - return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; - tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(GT_Values.W, tStack))); - if (tRecipes != null) - for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) - && BW_Util.areStacksEqualOrNull( - (ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) - return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; - } + if (mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs) if (tStack != null) { + Collection tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack)); + if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) + && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) + return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; + tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(GT_Values.W, tStack))); + if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) + && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) + return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; + } // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that // Map too. - if (mMinimalInputItems == 0 && aFluids != null) - for (FluidStack aFluid : aFluids) - if (aFluid != null) { - Collection tRecipes = mRecipeFluidMap.get(aFluid.getFluid()); - if (tRecipes != null) - for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) - && BW_Util.areStacksEqualOrNull( - (ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) - return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; - } + if (mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids) if (aFluid != null) { + Collection tRecipes = mRecipeFluidMap.get(aFluid.getFluid()); + if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) + && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) + return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; + } // And nothing has been found. return null; @@ -1074,7 +894,7 @@ public class BWRecipes { Map charToStackMap = new HashMap<>(9, 1); String[] shape; - @SuppressWarnings({"SuspiciousSystemArraycopy"}) + @SuppressWarnings({ "SuspiciousSystemArraycopy" }) public BWNBTDependantCraftingRecipe(ItemStack result, Object... recipe) { this.result = result; this.shape = new String[3]; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java index 94a6f5c558..580f6f7793 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java @@ -1,33 +1,26 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2019 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; +import java.util.Arrays; + import gregtech.api.enums.Dyes; import gregtech.api.enums.GT_Values; -import java.util.Arrays; @SuppressWarnings("unused") public class BW_ColorUtil { + private BW_ColorUtil() {} public static byte getDarknessFromColor(short[] rgba, int index) { @@ -65,54 +58,51 @@ public class BW_ColorUtil { case 3: if (rgba[3] - 50 > rgba[0]) return Dyes.dyeMagenta; else if (rgba[0] > 200 && rgba[2] > 140) return Dyes.dyePink; - else if (rgba[0] > rgba[1] + rgba[1] / 10 - && rgba[0] > rgba[2] + rgba[2] / 10 + else if (rgba[0] > rgba[1] + rgba[1] / 10 && rgba[0] > rgba[2] + rgba[2] / 10 && rgba[1] >> 4 == rgba[2] >> 4 && rgba[1] + 50 > rgba[0]) { - return Dyes.dyeBrown; - } else return Dyes.dyeRed; + return Dyes.dyeBrown; + } else + return Dyes.dyeRed; case 4: return Dyes._NULL; } } - if (isYellowScale(tmp)) - switch (getDarknessFromColor(rgba, 0)) { - case 0: - case 1: - return Dyes.dyeBrown; - case 2: - case 3: { - if (rgba[0] >> 5 > rgba[1] >> 5) return Dyes.dyeOrange; - else return Dyes.dyeYellow; - } - case 4: - return Dyes._NULL; + if (isYellowScale(tmp)) switch (getDarknessFromColor(rgba, 0)) { + case 0: + case 1: + return Dyes.dyeBrown; + case 2: + case 3: { + if (rgba[0] >> 5 > rgba[1] >> 5) return Dyes.dyeOrange; + else return Dyes.dyeYellow; } + case 4: + return Dyes._NULL; + } return Dyes.dyePink; } else if (isGrenScale(tmp)) { if (isCyanScale(tmp)) { - if (rgba[2] + 40 < rgba[1]) - switch (getDarknessFromColor(rgba, 0)) { - case 0: - case 1: - return Dyes.dyeGreen; - case 2: - case 3: - return Dyes.dyeLime; - } - return Dyes.dyeCyan; - } - if (isYellowScale(tmp)) - switch (getDarknessFromColor(rgba, 0)) { + if (rgba[2] + 40 < rgba[1]) switch (getDarknessFromColor(rgba, 0)) { case 0: case 1: - return Dyes.dyeBrown; + return Dyes.dyeGreen; case 2: - case 3: { - if (rgba[0] >> 5 > rgba[1] >> 5) return Dyes.dyeOrange; - else return Dyes.dyeYellow; - } + case 3: + return Dyes.dyeLime; + } + return Dyes.dyeCyan; + } + if (isYellowScale(tmp)) switch (getDarknessFromColor(rgba, 0)) { + case 0: + case 1: + return Dyes.dyeBrown; + case 2: + case 3: { + if (rgba[0] >> 5 > rgba[1] >> 5) return Dyes.dyeOrange; + else return Dyes.dyeYellow; } + } switch (getDarknessFromColor(rgba, 0)) { case 0: case 1: @@ -213,7 +203,7 @@ public class BW_ColorUtil { } public static short[] splitColorToRBGArray(int rgb) { - return new short[] {(short) ((rgb >> 16) & 0xFF), (short) ((rgb >> 8) & 0xFF), (short) (rgb & 0xFF)}; + return new short[] { (short) ((rgb >> 16) & 0xFF), (short) ((rgb >> 8) & 0xFF), (short) (rgb & 0xFF) }; } public static int getColorFromRGBArray(short[] color) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java index 42b8ae5e13..c08c5d4077 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; @@ -26,25 +17,28 @@ import static net.minecraft.util.EnumChatFormatting.*; import java.util.function.Function; import java.util.function.Supplier; + import net.minecraft.util.StatCollector; public class BW_Tooltip_Reference { + public static final String BW_NO_RESET = ChatColorHelper.DARKGREEN + "BartWorks"; public static final String TT_NO_RESET = BLUE + "Tec" + DARK_BLUE + "Tech"; public static final String BW = BW_NO_RESET + GRAY; public static final String TT = TT_NO_RESET + GRAY; - public static final Supplier ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = - () -> StatCollector.translateToLocal("tooltip.bw.1.name") + " " + BW; - public static final Supplier ADDED_BY_BARTWORKS = - () -> StatCollector.translateToLocal("tooltip.bw.0.name") + " " + BW; - public static final Function ADDED_VIA_BARTWORKS = - owner -> String.format(StatCollector.translateToLocal("tooltip.bw.via.name"), owner); + public static final Supplier ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = () -> StatCollector.translateToLocal( + "tooltip.bw.1.name") + " " + BW; + public static final Supplier ADDED_BY_BARTWORKS = () -> StatCollector.translateToLocal("tooltip.bw.0.name") + + " " + + BW; + public static final Function ADDED_VIA_BARTWORKS = owner -> String + .format(StatCollector.translateToLocal("tooltip.bw.via.name"), owner); public static final String MULTIBLOCK_ADDED_BY_BARTWORKS = BW; - public static final Function MULTIBLOCK_ADDED_VIA_BARTWORKS = - owner -> String.format(StatCollector.translateToLocal("tooltip.bw.mb_via.name"), owner); - public static final String MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = - MULTIBLOCK_ADDED_VIA_BARTWORKS.apply(GREEN + "bartimaeusnek"); + public static final Function MULTIBLOCK_ADDED_VIA_BARTWORKS = owner -> String + .format(StatCollector.translateToLocal("tooltip.bw.mb_via.name"), owner); + public static final String MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = MULTIBLOCK_ADDED_VIA_BARTWORKS + .apply(GREEN + "bartimaeusnek"); public static final String ADV_STR_CHECK = "Uses an advanced " + TT + " structure check, due to " + BW; public static final String TT_BLUEPRINT = "To see the structure, use a " + TT + " Blueprint on the Controller!"; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index de6037095f..eb0489edec 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -1,54 +1,30 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; import static gregtech.api.enums.GT_Values.*; -import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; -import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.gtnewhorizon.structurelib.StructureLibAPI; -import com.gtnewhorizon.structurelib.structure.AutoPlaceEnvironment; -import com.gtnewhorizon.structurelib.structure.IStructureElement; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OreDictNames; -import gregtech.api.enums.ToolDictNames; -import gregtech.api.interfaces.IItemContainer; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.ItemData; -import gregtech.api.util.*; import java.lang.reflect.Array; import java.lang.reflect.Field; import java.util.*; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Collectors; + import javax.annotation.Nonnegative; import javax.annotation.Nonnull; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.enchantment.Enchantment; @@ -64,9 +40,29 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; + import org.apache.commons.lang3.reflect.FieldUtils; -@SuppressWarnings({"unused", "RedundantSuppression"}) +import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.gtnewhorizon.structurelib.StructureLibAPI; +import com.gtnewhorizon.structurelib.structure.AutoPlaceEnvironment; +import com.gtnewhorizon.structurelib.structure.IStructureElement; + +import gregtech.api.enums.Materials; +import gregtech.api.enums.OreDictNames; +import gregtech.api.enums.ToolDictNames; +import gregtech.api.interfaces.IItemContainer; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.ItemData; +import gregtech.api.util.*; + +@SuppressWarnings({ "unused", "RedundantSuppression" }) public class BW_Util { public static final int STANDART = 0; @@ -279,24 +275,22 @@ public class BW_Util { return special; } - public static boolean addBlockToMachine( - int x, int y, int z, int offsetsize, IGregTechTileEntity aBaseMetaTileEntity, Block block) { + public static boolean addBlockToMachine(int x, int y, int z, int offsetsize, + IGregTechTileEntity aBaseMetaTileEntity, Block block) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offsetsize; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offsetsize; - return block == Blocks.air - ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) + return block == Blocks.air ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block); } - public static boolean addBlockToMachine( - int x, int y, int z, int offsetsize, IGregTechTileEntity aBaseMetaTileEntity, Block block, int damage) { + public static boolean addBlockToMachine(int x, int y, int z, int offsetsize, + IGregTechTileEntity aBaseMetaTileEntity, Block block, int damage) { byte dmg = (byte) damage; int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offsetsize; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offsetsize; - return block == Blocks.air - ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) + return block == Blocks.air ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == dmg; } @@ -305,14 +299,10 @@ public class BW_Util { for (BioVatLogicAdder.MaterialSvPair pair : BioVatLogicAdder.RadioHatch.getMaSv()) { if (pair.getMaterials().equals(materials)) return pair.getSievert(); } - return (int) - (materials.getProtons() == 43L - ? (materials.equals(Materials.NaquadahEnriched) - ? 140 - : materials.equals(Materials.Naquadria) - ? 150 - : materials.equals(Materials.Naquadah) ? 130 : 43) - : materials.getProtons()); + return (int) (materials.getProtons() == 43L + ? (materials.equals(Materials.NaquadahEnriched) ? 140 + : materials.equals(Materials.Naquadria) ? 150 : materials.equals(Materials.Naquadah) ? 130 : 43) + : materials.getProtons()); } public static ItemStack setStackSize(ItemStack stack, int size) { @@ -321,15 +311,14 @@ public class BW_Util { } public static boolean checkStackAndPrefix(ItemStack itemStack) { - return itemStack != null - && GT_OreDictUnificator.getAssociation(itemStack) != null + return itemStack != null && GT_OreDictUnificator.getAssociation(itemStack) != null && GT_OreDictUnificator.getAssociation(itemStack).mPrefix != null && GT_OreDictUnificator.getAssociation(itemStack).mMaterial != null && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial != null; } - public static Map getInputsFromOutput( - Collection gt_recipes, ItemStack... inputs) { + public static Map getInputsFromOutput(Collection gt_recipes, + ItemStack... inputs) { return gt_recipes.stream() .filter(ar -> Arrays.stream(inputs).anyMatch(st -> GT_Utility.areStacksEqual(st, ar.mOutputs[0]))) .collect(Collectors.toMap(k -> k.mOutputs[0], k -> k.mInputs)); @@ -377,7 +366,7 @@ public class BW_Util { return hash; } - @SuppressWarnings({"unchecked"}) + @SuppressWarnings({ "unchecked" }) public static T[] copyAndRemoveNulls(T[] input, Class clazz) { List ret = Arrays.stream(input).filter(Objects::nonNull).collect(Collectors.toList()); @@ -472,38 +461,27 @@ public class BW_Util { } /** - * Taken from the GTNH fork, made originally by Tec - * Calcualtes overclocked ness using long integers + * Taken from the GTNH fork, made originally by Tec Calcualtes overclocked ness using long integers * * @param aEUt - recipe EUt * @param aDuration - recipe Duration * @param mAmperage - should be 1 ? */ - public static void calculateOverclockedNessMulti( - @Nonnegative int aEUt, - @Nonnegative int aDuration, - @Nonnegative int mAmperage, - @Nonnegative long maxInputVoltage, + public static void calculateOverclockedNessMulti(@Nonnegative int aEUt, @Nonnegative int aDuration, + @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, @Nonnull GT_MetaTileEntity_MultiBlockBase base) { calculateOverclockednessMultiInternal(aEUt, aDuration, mAmperage, maxInputVoltage, base, false); } - public static void calculatePerfectOverclockedNessMulti( - @Nonnegative int aEUt, - @Nonnegative int aDuration, - @Nonnegative int mAmperage, - @Nonnegative long maxInputVoltage, + public static void calculatePerfectOverclockedNessMulti(@Nonnegative int aEUt, @Nonnegative int aDuration, + @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, @Nonnull GT_MetaTileEntity_MultiBlockBase base) { calculateOverclockednessMultiInternal(aEUt, aDuration, mAmperage, maxInputVoltage, base, true); } - private static void calculateOverclockednessMultiInternal( - @Nonnegative int aEUt, - @Nonnegative int aDuration, - @Nonnegative int mAmperage, - @Nonnegative long maxInputVoltage, - @Nonnull GT_MetaTileEntity_MultiBlockBase base, - @Nonnull boolean perfectOC) { + private static void calculateOverclockednessMultiInternal(@Nonnegative int aEUt, @Nonnegative int aDuration, + @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, + @Nonnull GT_MetaTileEntity_MultiBlockBase base, @Nonnull boolean perfectOC) { byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); if (mTier == 0) { // Long time calculation @@ -528,9 +506,8 @@ public class BW_Util { tempEUt <<= 2; // this actually controls overclocking // xEUt *= 4;//this is effect of everclocking base.mMaxProgresstime >>= perfectOC ? 2 : 1; // this is effect of overclocking - xEUt = base.mMaxProgresstime <= 0 - ? xEUt >> 1 - : xEUt << 2; // U know, if the time is less than 1 tick make the machine use less power + xEUt = base.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2; // U know, if the time is less than 1 tick + // make the machine use less power } while (xEUt > maxInputVoltage && xEUt >= aEUt) { @@ -598,18 +575,8 @@ public class BW_Util { } } - public static boolean check_layer( - IGregTechTileEntity aBaseMetaTileEntity, - int radius, - int yLevel, - int height, - Block block, - int dmg, - int offset, - boolean insideCheck, - Block inside, - int dmginside, - int aBaseCasingIndex) { + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, + Block block, int dmg, int offset, boolean insideCheck, Block inside, int dmginside, int aBaseCasingIndex) { return BW_Util.check_layer( aBaseMetaTileEntity, radius, @@ -625,29 +592,14 @@ public class BW_Util { aBaseCasingIndex); } - public static boolean check_layer( - IGregTechTileEntity aBaseMetaTileEntity, - int radius, - int yLevel, - int height, - Block block, - int dmg, - int offset, - int aBaseCasingIndex) { - return BW_Util.check_layer( - aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, aBaseCasingIndex); + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, + Block block, int dmg, int offset, int aBaseCasingIndex) { + return BW_Util + .check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, aBaseCasingIndex); } - public static boolean check_layer( - IGregTechTileEntity aBaseMetaTileEntity, - int radius, - int yLevel, - int height, - Block block, - int dmg, - int offset, - boolean controllerLayer, - int aBaseCasingIndex) { + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, + Block block, int dmg, int offset, boolean controllerLayer, int aBaseCasingIndex) { return BW_Util.check_layer( aBaseMetaTileEntity, radius, @@ -661,17 +613,8 @@ public class BW_Util { aBaseCasingIndex); } - public static boolean check_layer( - IGregTechTileEntity aBaseMetaTileEntity, - int radius, - int yLevel, - int height, - Block block, - int dmg, - int offset, - boolean controllerLayer, - boolean freeCorners, - int aBaseCasingIndex) { + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, + Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, int aBaseCasingIndex) { return BW_Util.check_layer( aBaseMetaTileEntity, radius, @@ -689,18 +632,8 @@ public class BW_Util { aBaseCasingIndex); } - public static boolean check_layer( - IGregTechTileEntity aBaseMetaTileEntity, - int radius, - int yLevel, - int height, - Block block, - int dmg, - int offset, - boolean controllerLayer, - boolean insideCheck, - Block inside, - int dmginside, + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, + Block block, int dmg, int offset, boolean controllerLayer, boolean insideCheck, Block inside, int dmginside, int aBaseCasingIndex) { return BW_Util.check_layer( aBaseMetaTileEntity, @@ -734,21 +667,9 @@ public class BW_Util { * @param aBaseCasingIndex the Index for the hatches texture * @return if the layer check was completed */ - public static boolean check_layer( - IGregTechTileEntity aBaseMetaTileEntity, - int radius, - int yLevel, - int height, - Block block, - int dmg, - int offset, - boolean controllerLayer, - boolean freeCorners, - boolean insideCheck, - Block inside, - int dmginside, - boolean allowHatches, - int aBaseCasingIndex) { + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, + Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck, + Block inside, int dmginside, boolean allowHatches, int aBaseCasingIndex) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offset; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offset; for (int x = -radius; x <= radius; x++) { @@ -758,88 +679,91 @@ public class BW_Util { if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) continue; boolean b = Math.abs(x) < radius && Math.abs(z) != radius; if (insideCheck && b) { - if (!(inside.equals(Blocks.air) - ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) - : aBaseMetaTileEntity - .getBlockOffset(xDir + x, y, zDir + z) - .equals(inside)) + if (!(inside.equals(Blocks.air) ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) + : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside)) && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside || dmginside > (-1))) { if (!(allowHatches && (((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) - .addDynamoToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset( - xDir + x, y, zDir + z), - aBaseCasingIndex) - || ((GT_MetaTileEntity_MultiBlockBase) - aBaseMetaTileEntity.getMetaTileEntity()) - .addEnergyInputToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset( - xDir + x, y, zDir + z), - aBaseCasingIndex) - || ((GT_MetaTileEntity_MultiBlockBase) - aBaseMetaTileEntity.getMetaTileEntity()) - .addMaintenanceToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset( - xDir + x, y, zDir + z), - aBaseCasingIndex) - || ((GT_MetaTileEntity_MultiBlockBase) - aBaseMetaTileEntity.getMetaTileEntity()) - .addMufflerToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset( - xDir + x, y, zDir + z), - aBaseCasingIndex) - || ((GT_MetaTileEntity_MultiBlockBase) - aBaseMetaTileEntity.getMetaTileEntity()) - .addInputToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset( - xDir + x, y, zDir + z), - aBaseCasingIndex) - || ((GT_MetaTileEntity_MultiBlockBase) - aBaseMetaTileEntity.getMetaTileEntity()) - .addOutputToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset( - xDir + x, y, zDir + z), - aBaseCasingIndex)))) { + .addDynamoToMachineList( + aBaseMetaTileEntity + .getIGregTechTileEntityOffset(xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity + .getMetaTileEntity()) + .addEnergyInputToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, + y, + zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity + .getMetaTileEntity()) + .addMaintenanceToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, + y, + zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity + .getMetaTileEntity()) + .addMufflerToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, + y, + zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity + .getMetaTileEntity()) + .addInputToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, + y, + zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity + .getMetaTileEntity()) + .addOutputToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, + y, + zDir + z), + aBaseCasingIndex)))) { return false; } } } - if (!b - && !aBaseMetaTileEntity - .getBlockOffset(xDir + x, y, zDir + z) - .equals(block) + if (!b && !aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmg || dmg > (-1))) { if (!(allowHatches && (((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) - .addDynamoToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset( - xDir + x, y, zDir + z), - aBaseCasingIndex) + .addDynamoToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), + aBaseCasingIndex) || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) .addEnergyInputToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset( - xDir + x, y, zDir + z), + aBaseMetaTileEntity + .getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) .addMaintenanceToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset( - xDir + x, y, zDir + z), + aBaseMetaTileEntity + .getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) .addMufflerToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset( - xDir + x, y, zDir + z), + aBaseMetaTileEntity + .getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) .addInputToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset( - xDir + x, y, zDir + z), + aBaseMetaTileEntity + .getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) .addOutputToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset( - xDir + x, y, zDir + z), + aBaseMetaTileEntity + .getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex)))) { return false; } @@ -850,15 +774,8 @@ public class BW_Util { return true; } - public static List getMetasFromLayer( - IGregTechTileEntity aBaseMetaTileEntity, - int radius, - int yLevel, - int height, - int offset, - boolean controllerLayer, - boolean freeCorners, - boolean insideCheck) { + public static List getMetasFromLayer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, + int height, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck) { ArrayList ret = new ArrayList<>(); int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offset; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offset; @@ -951,8 +868,7 @@ public class BW_Util { if (block.equals(Blocks.glass)) return 3; - for (BioVatLogicAdder.BlockMetaPair B : - BioVatLogicAdder.BioVatGlass.getGlassMap().keySet()) + for (BioVatLogicAdder.BlockMetaPair B : BioVatLogicAdder.BioVatGlass.getGlassMap().keySet()) if (B.getBlock().equals(block) && B.getaByte().equals(meta)) return BioVatLogicAdder.BioVatGlass.getGlassMap().get(B); @@ -961,17 +877,18 @@ public class BW_Util { return 0; } - public static IStructureElement ofGlassTiered( - byte mintier, byte maxtier, byte notset, BiConsumer setter, Function getter, int aDots) { + public static IStructureElement ofGlassTiered(byte mintier, byte maxtier, byte notset, + BiConsumer setter, Function getter, int aDots) { return new IStructureElement() { - private final IStructureElement placementDelegate = - BorosilicateGlass.ofBoroGlass(notset, mintier, maxtier, setter, getter); + + private final IStructureElement placementDelegate = BorosilicateGlass + .ofBoroGlass(notset, mintier, maxtier, setter, getter); @Override public boolean check(T te, World world, int x, int y, int z) { if (world.isAirBlock(x, y, z)) return false; - byte glasstier = - BW_Util.calculateGlassTier(world.getBlock(x, y, z), (byte) world.getBlockMetadata(x, y, z)); + byte glasstier = BW_Util + .calculateGlassTier(world.getBlock(x, y, z), (byte) world.getBlockMetadata(x, y, z)); if (glasstier == 0) return false; // is not a glass ? if (glasstier == notset) return false; if (glasstier < mintier) return false; @@ -992,8 +909,8 @@ public class BW_Util { } @Override - public PlaceResult survivalPlaceBlock( - T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { + public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, + AutoPlaceEnvironment env) { return placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, env); } }; @@ -1001,14 +918,15 @@ public class BW_Util { public static IStructureElement ofGlassTieredMixed(byte mintier, byte maxtier, int aDots) { return new IStructureElement() { - private final IStructureElement placementDelegate = - BorosilicateGlass.ofBoroGlass((byte) 0, mintier, maxtier, (v1, v2) -> {}, (v1) -> (byte) 0); + + private final IStructureElement placementDelegate = BorosilicateGlass + .ofBoroGlass((byte) 0, mintier, maxtier, (v1, v2) -> {}, (v1) -> (byte) 0); @Override public boolean check(T te, World world, int x, int y, int z) { if (world.isAirBlock(x, y, z)) return false; - byte glasstier = - BW_Util.calculateGlassTier(world.getBlock(x, y, z), (byte) world.getBlockMetadata(x, y, z)); + byte glasstier = BW_Util + .calculateGlassTier(world.getBlock(x, y, z), (byte) world.getBlockMetadata(x, y, z)); if (glasstier == 0) return false; // is not a glass ? return glasstier >= mintier && glasstier <= maxtier; } @@ -1025,8 +943,8 @@ public class BW_Util { } @Override - public PlaceResult survivalPlaceBlock( - T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { + public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, + AutoPlaceEnvironment env) { return placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, env); } }; @@ -1067,25 +985,13 @@ public class BW_Util { aRecipe); } - @SuppressWarnings({"rawtypes", "unchecked"}) - public static ShapedOreRecipe createGTCraftingRecipe( - ItemStack aResult, - Enchantment[] aEnchantmentsAdded, - int[] aEnchantmentLevelsAdded, - boolean aMirrored, - boolean aBuffered, - boolean aKeepNBT, - boolean aDismantleable, - boolean aRemovable, - boolean aReversible, - boolean aRemoveAllOthersWithSameOutput, - boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, - boolean aRemoveAllOtherShapedsWithSameOutput, - boolean aRemoveAllOtherNativeRecipes, - boolean aCheckForCollisions, - boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, - boolean aOnlyAddIfResultIsNotNull, - Object[] aRecipe) { + @SuppressWarnings({ "rawtypes", "unchecked" }) + public static ShapedOreRecipe createGTCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, + int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT, + boolean aDismantleable, boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput, + boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, boolean aRemoveAllOtherShapedsWithSameOutput, + boolean aRemoveAllOtherNativeRecipes, boolean aCheckForCollisions, + boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, boolean aOnlyAddIfResultIsNotNull, Object[] aRecipe) { aResult = GT_OreDictUnificator.get(true, aResult); if (aOnlyAddIfResultIsNotNull && aResult == null) return null; if (aResult != null && Items.feather.getDamage(aResult) == W) Items.feather.setDamage(aResult, 0); @@ -1096,11 +1002,11 @@ public class BW_Util { for (byte i = 0; i < aRecipe.length; i++) { if (aRecipe[i] instanceof IItemContainer) aRecipe[i] = ((IItemContainer) aRecipe[i]).get(1); else if (aRecipe[i] instanceof Enum) aRecipe[i] = ((Enum) aRecipe[i]).name(); - else if (!(aRecipe[i] == null - || aRecipe[i] instanceof ItemStack + else if (!(aRecipe[i] == null || aRecipe[i] instanceof ItemStack || aRecipe[i] instanceof ItemData || aRecipe[i] instanceof String - || aRecipe[i] instanceof Character)) aRecipe[i] = aRecipe[i].toString(); + || aRecipe[i] instanceof Character)) + aRecipe[i] = aRecipe[i].toString(); } try { @@ -1194,8 +1100,9 @@ public class BW_Util { for (; idx < aRecipe.length; idx += 2) { if (aRecipe[idx] == null || aRecipe[idx + 1] == null) { if (D1) { - GT_Log.err.println("WARNING: Missing Item for shaped Recipe: " - + (aResult == null ? "null" : aResult.getDisplayName())); + GT_Log.err.println( + "WARNING: Missing Item for shaped Recipe: " + + (aResult == null ? "null" : aResult.getDisplayName())); for (Object tContent : aRecipe) GT_Log.err.println(tContent); } return null; @@ -1273,25 +1180,21 @@ public class BW_Util { if (aResult == null || aResult.stackSize <= 0) return null; - if (aRemoveAllOthersWithSameOutput - || aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT + if (aRemoveAllOthersWithSameOutput || aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT || aRemoveAllOtherShapedsWithSameOutput || aRemoveAllOtherNativeRecipes) tThereWasARecipe = GT_ModHandler.removeRecipeByOutput( - aResult, - !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, - aRemoveAllOtherShapedsWithSameOutput, - aRemoveAllOtherNativeRecipes) - || tThereWasARecipe; + aResult, + !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, + aRemoveAllOtherShapedsWithSameOutput, + aRemoveAllOtherNativeRecipes) || tThereWasARecipe; if (aOnlyAddIfThereIsAnyRecipeOutputtingThis && !tThereWasARecipe) { - ArrayList tList = - (ArrayList) CraftingManager.getInstance().getRecipeList(); + ArrayList tList = (ArrayList) CraftingManager.getInstance().getRecipeList(); int tList_sS = tList.size(); for (int i = 0; i < tList_sS && !tThereWasARecipe; i++) { IRecipe tRecipe = tList.get(i); - if (GT_ModHandler.sSpecialRecipeClasses.contains( - tRecipe.getClass().getName())) continue; + if (GT_ModHandler.sSpecialRecipeClasses.contains(tRecipe.getClass().getName())) continue; if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tRecipe.getRecipeOutput()), aResult, true)) { tList.remove(i--); tList_sS = tList.size(); @@ -1306,14 +1209,13 @@ public class BW_Util { GT_Utility.updateItemStack(aResult); return new GT_Shaped_Recipe( - GT_Utility.copy(aResult), - aDismantleable, - aRemovable, - aKeepNBT, - aEnchantmentsAdded, - aEnchantmentLevelsAdded, - aRecipe) - .setMirrored(aMirrored); + GT_Utility.copy(aResult), + aDismantleable, + aRemovable, + aKeepNBT, + aEnchantmentsAdded, + aEnchantmentLevelsAdded, + aRecipe).setMirrored(aMirrored); } public static void shortSleep(long nanos) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index 16a4d38e30..5ea53e62dd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -1,43 +1,39 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; -import gregtech.api.interfaces.IColorModulationContainer; -import gregtech.api.util.GT_LanguageManager; import java.awt.*; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Objects; + import net.minecraft.item.EnumRarity; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; +import gregtech.api.interfaces.IColorModulationContainer; +import gregtech.api.util.GT_LanguageManager; + public class BioCulture extends BioData implements IColorModulationContainer { public static final ArrayList BIO_CULTURE_ARRAY_LIST = new ArrayList<>(); - public static final BioCulture NULLCULTURE = BioCulture.createAndRegisterBioCulture( - Color.BLUE, "", BioPlasmid.NULLPLASMID, BioDNA.NULLDNA, false); // fallback NULL culture, also Blue =) + public static final BioCulture NULLCULTURE = BioCulture + .createAndRegisterBioCulture(Color.BLUE, "", BioPlasmid.NULLPLASMID, BioDNA.NULLDNA, false); // fallback + // NULL + // culture, + // also Blue =) public String getLocalisedName() { return GT_LanguageManager.getTranslation(this.getName()); @@ -53,8 +49,8 @@ public class BioCulture extends BioData implements IColorModulationContainer { boolean bBreedable; Fluid mFluid; - protected BioCulture( - Color color, String name, int ID, BioPlasmid plasmid, BioDNA dDNA, EnumRarity rarity, boolean bBreedable) { + protected BioCulture(Color color, String name, int ID, BioPlasmid plasmid, BioDNA dDNA, EnumRarity rarity, + boolean bBreedable) { super(name, ID, rarity); this.color = color; this.plasmid = plasmid; @@ -69,17 +65,23 @@ public class BioCulture extends BioData implements IColorModulationContainer { this.dDNA = dDNA; } - public static BioCulture createAndRegisterBioCulture( - Color color, String name, BioPlasmid plasmid, BioDNA dna, EnumRarity rarity, boolean breedable) { + public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, + EnumRarity rarity, boolean breedable) { BioCulture ret = new BioCulture(color, name, BIO_CULTURE_ARRAY_LIST.size(), plasmid, dna, rarity, breedable); BIO_CULTURE_ARRAY_LIST.add(ret); return ret; } - public static BioCulture createAndRegisterBioCulture( - Color color, String name, BioPlasmid plasmid, BioDNA dna, boolean breedable) { - BioCulture ret = - new BioCulture(color, name, BIO_CULTURE_ARRAY_LIST.size(), plasmid, dna, dna.getRarity(), breedable); + public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, + boolean breedable) { + BioCulture ret = new BioCulture( + color, + name, + BIO_CULTURE_ARRAY_LIST.size(), + plasmid, + dna, + dna.getRarity(), + breedable); BIO_CULTURE_ARRAY_LIST.add(ret); return ret; } @@ -91,7 +93,7 @@ public class BioCulture extends BioData implements IColorModulationContainer { // ret.setInteger("ID", bioCulture.ID); ret.setIntArray( "Color", - new int[] {bioCulture.color.getRed(), bioCulture.color.getGreen(), bioCulture.color.getBlue()}); + new int[] { bioCulture.color.getRed(), bioCulture.color.getGreen(), bioCulture.color.getBlue() }); ret.setTag("Plasmid", BioData.getNBTTagFromBioData(BioData.convertBioPlasmidToBioData(bioCulture.plasmid))); ret.setTag("DNA", BioData.getNBTTagFromBioData(BioData.convertBioDNAToBioData(bioCulture.dDNA))); ret.setBoolean("Breedable", bioCulture.bBreedable); @@ -104,17 +106,16 @@ public class BioCulture extends BioData implements IColorModulationContainer { if (tag == null || tag.getIntArray("Color").length == 0) return null; BioCulture ret = getBioCulture(tag.getString("Name")); - if (ret == null) - ret = createAndRegisterBioCulture( - new Color(tag.getIntArray("Color")[0], tag.getIntArray("Color")[1], tag.getIntArray("Color")[2]), - tag.getString("Name"), - BioPlasmid.convertDataToPlasmid(getBioDataFromNBTTag(tag.getCompoundTag("Plasmid"))), - BioDNA.convertDataToDNA(getBioDataFromNBTTag(tag.getCompoundTag("DNA"))), - BW_Util.getRarityFromByte(tag.getByte("Rarety")), - tag.getBoolean("Breedable")); + if (ret == null) ret = createAndRegisterBioCulture( + new Color(tag.getIntArray("Color")[0], tag.getIntArray("Color")[1], tag.getIntArray("Color")[2]), + tag.getString("Name"), + BioPlasmid.convertDataToPlasmid(getBioDataFromNBTTag(tag.getCompoundTag("Plasmid"))), + BioDNA.convertDataToDNA(getBioDataFromNBTTag(tag.getCompoundTag("DNA"))), + BW_Util.getRarityFromByte(tag.getByte("Rarety")), + tag.getBoolean("Breedable")); if (ret.bBreedable) ret.setFluid(FluidRegistry.getFluid(tag.getString("Fluid"))); if (ret.getFluidNotSet()) // should never happen, but better safe than sorry - ret.setbBreedable(false); + ret.setbBreedable(false); return ret; } @@ -152,8 +153,8 @@ public class BioCulture extends BioData implements IColorModulationContainer { } public int getColorRGB() { - return BW_ColorUtil.getColorFromRGBArray( - new int[] {this.color.getRed(), this.color.getGreen(), this.color.getBlue()}); + return BW_ColorUtil + .getColorFromRGBArray(new int[] { this.color.getRed(), this.color.getGreen(), this.color.getBlue() }); } public Color getColor() { @@ -164,12 +165,12 @@ public class BioCulture extends BioData implements IColorModulationContainer { this.color = color; } - // public static BioCulture createAndRegisterBioCulture(Color color, String name, long ID, BioPlasmid plasmid, + // public static BioCulture createAndRegisterBioCulture(Color color, String name, long ID, BioPlasmid plasmid, // BioDNA dDNA,EnumRarity rarity){ - // BioCulture ret =new BioCulture(color,name,ID,plasmid,dDNA,rarity); - // BIO_CULTURE_ARRAY_LIST.add(ret); - // return ret; - // } + // BioCulture ret =new BioCulture(color,name,ID,plasmid,dDNA,rarity); + // BIO_CULTURE_ARRAY_LIST.add(ret); + // return ret; + // } public BioPlasmid getPlasmid() { return this.plasmid; @@ -212,8 +213,7 @@ public class BioCulture extends BioData implements IColorModulationContainer { if (o == null || this.getClass() != o.getClass()) return false; if (!super.equals(o)) return false; BioCulture culture = (BioCulture) o; - return this.isBreedable() == culture.isBreedable() - && Objects.equals(this.getColor(), culture.getColor()) + return this.isBreedable() == culture.isBreedable() && Objects.equals(this.getColor(), culture.getColor()) && Objects.equals(this.getPlasmid(), culture.getPlasmid()) && Objects.equals(this.getdDNA(), culture.getdDNA()) && Objects.equals(this.mFluid, culture.mFluid); @@ -223,13 +223,9 @@ public class BioCulture extends BioData implements IColorModulationContainer { public int hashCode() { return MurmurHash3.murmurhash3_x86_32( ByteBuffer.allocate(17) - .putInt(MurmurHash3.murmurhash3_x86_32( - this.getName(), 0, this.getName().length(), 31)) - .putInt(this.getColorRGB()) - .putInt(this.getPlasmid().ID) - .putInt(this.getdDNA().ID) - .put((byte) (isBreedable() ? 1 : 0)) - .array(), + .putInt(MurmurHash3.murmurhash3_x86_32(this.getName(), 0, this.getName().length(), 31)) + .putInt(this.getColorRGB()).putInt(this.getPlasmid().ID).putInt(this.getdDNA().ID) + .put((byte) (isBreedable() ? 1 : 0)).array(), 0, 17, 31); @@ -237,11 +233,7 @@ public class BioCulture extends BioData implements IColorModulationContainer { @Override public short[] getRGBA() { - return new short[] { - (short) getColor().getRed(), - (short) getColor().getGreen(), - (short) getColor().getBlue(), - (short) getColor().getAlpha() - }; + return new short[] { (short) getColor().getRed(), (short) getColor().getGreen(), (short) getColor().getBlue(), + (short) getColor().getAlpha() }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java index 91606cf6ff..c1c6431daf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2019 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java index 98b1f0ecea..854bc4afba 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2019 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; @@ -25,10 +16,12 @@ package com.github.bartimaeusnek.bartworks.util; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Objects; + import net.minecraft.item.EnumRarity; import net.minecraft.nbt.NBTTagCompound; public class BioData { + public static final ArrayList BIO_DATA_ARRAY_LIST = new ArrayList<>(); protected String name; @@ -107,8 +100,7 @@ public class BioData { if (o == null || this.getClass() != o.getClass()) return false; BioData bioData = (BioData) o; return this.getID() == bioData.getID() - || (this.getChance() == bioData.getChance() - && this.getTier() == bioData.getTier() + || (this.getChance() == bioData.getChance() && this.getTier() == bioData.getTier() && Objects.equals(this.getName(), bioData.getName()) && this.getRarity() == bioData.getRarity()); } @@ -117,12 +109,9 @@ public class BioData { public int hashCode() { return MurmurHash3.murmurhash3_x86_32( ByteBuffer.allocate(13) - .putInt(MurmurHash3.murmurhash3_x86_32( - this.getName(), 0, this.getName().length(), 31)) - .put(BW_Util.getByteFromRarity(this.getRarity())) - .putInt(this.getChance()) - .putInt(this.getTier()) - .array(), + .putInt(MurmurHash3.murmurhash3_x86_32(this.getName(), 0, this.getName().length(), 31)) + .put(BW_Util.getByteFromRarity(this.getRarity())).putInt(this.getChance()) + .putInt(this.getTier()).array(), 0, 13, 31); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java index 8cdf435da6..47f94bb389 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2019 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java index c1885b1272..93220205b7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java @@ -3,9 +3,11 @@ package com.github.bartimaeusnek.bartworks.util; import java.lang.reflect.Field; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; + import org.apache.commons.lang3.reflect.FieldUtils; public class CachedReflectionUtils { + private static final ClassValue> fields = new ConcurrentMapClassValue(); private static final ClassValue> declaredFields = new ConcurrentMapClassValue(); @@ -18,6 +20,7 @@ public class CachedReflectionUtils { } private static class ConcurrentMapClassValue extends ClassValue> { + @Override protected Map computeValue(Class type) { return new ConcurrentHashMap<>(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java index 5c6993d2eb..f1d6eeedb3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2019 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java index 988c9b1610..48aaf70b6b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java @@ -1,34 +1,27 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2019 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import java.util.HashSet; + import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; + public class ConnectedBlocksChecker { public final HashSet hashset = new HashSet<>(2048); @@ -157,17 +150,23 @@ public class ConnectedBlocksChecker { } } else { if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) - && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) return true; + && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) + return true; if (n == w.getBlockMetadata(C.x, C.y - 1, C.z) - && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) return true; + && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) + return true; if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) - && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) return true; + && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) + return true; if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) - && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) return true; + && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) + return true; if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) - && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) return true; + && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) + return true; if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) - && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) return true; + && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) + return true; } } return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java index e794b21a0c..eb5dd0b17d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java @@ -1,38 +1,31 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2019 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import java.util.HashSet; import java.util.LinkedList; import java.util.Queue; + import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; + /** - * This implementation is for some reason slower than the Recursive Check.... - * For ~3400 blocks this takes 8ms, the Recursive Check 5ms. + * This implementation is for some reason slower than the Recursive Check.... For ~3400 blocks this takes 8ms, the + * Recursive Check 5ms. */ public class ConnectedBlocksCheckerIteration { @@ -122,17 +115,23 @@ public class ConnectedBlocksCheckerIteration { } } else { if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) - && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) return true; + && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) + return true; if (n == w.getBlockMetadata(C.x, C.y - 1, C.z) - && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) return true; + && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) + return true; if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) - && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) return true; + && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) + return true; if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) - && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) return true; + && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) + return true; if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) - && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) return true; + && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) + return true; if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) - && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) return true; + && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) + return true; } } return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java index 403f4bbf3e..b1ece2651f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2019 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java index f4198466f0..f96ffc8997 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java @@ -1,95 +1,52 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; +import net.minecraftforge.common.util.EnumHelper; + import gregtech.api.enums.Element; import gregtech.api.enums.OrePrefixes; -import net.minecraftforge.common.util.EnumHelper; public class EnumUtils { + private EnumUtils() {} - public static OrePrefixes addNewOrePrefix( - String enumName, - String aRegularLocalName, - String aLocalizedMaterialPre, - String aLocalizedMaterialPost, - boolean aIsUnificatable, - boolean aIsMaterialBased, - boolean aIsSelfReferencing, - boolean aIsContainer, - boolean aDontUnificateActively, - boolean aIsUsedForBlocks, - boolean aAllowNormalRecycling, - boolean aGenerateDefaultItem, - boolean aIsEnchantable, - boolean aIsUsedForOreProcessing, - int aMaterialGenerationBits, - long aMaterialAmount, - int aDefaultStackSize, + public static OrePrefixes addNewOrePrefix(String enumName, String aRegularLocalName, String aLocalizedMaterialPre, + String aLocalizedMaterialPost, boolean aIsUnificatable, boolean aIsMaterialBased, + boolean aIsSelfReferencing, boolean aIsContainer, boolean aDontUnificateActively, boolean aIsUsedForBlocks, + boolean aAllowNormalRecycling, boolean aGenerateDefaultItem, boolean aIsEnchantable, + boolean aIsUsedForOreProcessing, int aMaterialGenerationBits, long aMaterialAmount, int aDefaultStackSize, int aTextureindex) { return EnumHelper.addEnum( OrePrefixes.class, enumName, - new Class[] { - String.class, String.class, String.class, - boolean.class, boolean.class, boolean.class, - boolean.class, boolean.class, boolean.class, - boolean.class, boolean.class, boolean.class, - boolean.class, int.class, long.class, - int.class, int.class - }, - new Object[] { - aRegularLocalName, aLocalizedMaterialPre, aLocalizedMaterialPost, - aIsUnificatable, aIsMaterialBased, aIsSelfReferencing, - aIsContainer, aDontUnificateActively, aIsUsedForBlocks, - aAllowNormalRecycling, aGenerateDefaultItem, aIsEnchantable, - aIsUsedForOreProcessing, aMaterialGenerationBits, aMaterialAmount, - aDefaultStackSize, aTextureindex - }); + new Class[] { String.class, String.class, String.class, boolean.class, boolean.class, boolean.class, + boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, + boolean.class, int.class, long.class, int.class, int.class }, + new Object[] { aRegularLocalName, aLocalizedMaterialPre, aLocalizedMaterialPost, aIsUnificatable, + aIsMaterialBased, aIsSelfReferencing, aIsContainer, aDontUnificateActively, aIsUsedForBlocks, + aAllowNormalRecycling, aGenerateDefaultItem, aIsEnchantable, aIsUsedForOreProcessing, + aMaterialGenerationBits, aMaterialAmount, aDefaultStackSize, aTextureindex }); } - public static Element createNewElement( - String enumName, - long aProtons, - long aNeutrons, - long aAdditionalMass, - long aHalfLifeSeconds, - String aDecayTo, - String aName, - boolean aIsIsotope) { + public static Element createNewElement(String enumName, long aProtons, long aNeutrons, long aAdditionalMass, + long aHalfLifeSeconds, String aDecayTo, String aName, boolean aIsIsotope) { return EnumHelper.addEnum( Element.class, enumName, - new Class[] { - long.class, long.class, long.class, - long.class, String.class, String.class, - boolean.class - }, - new Object[] { - aProtons, aNeutrons, aAdditionalMass, - aHalfLifeSeconds, aDecayTo, aName, - aIsIsotope - }); + new Class[] { long.class, long.class, long.class, long.class, String.class, String.class, + boolean.class }, + new Object[] { aProtons, aNeutrons, aAdditionalMass, aHalfLifeSeconds, aDecayTo, aName, aIsIsotope }); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java index 7a3fa2c3ee..b3cbc9351f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java index 7b7a0d75f8..d5c8be8a28 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java index dec3a8eb42..30b7ff76a0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java @@ -1,22 +1,13 @@ /* - * The MurmurHash3 algorithm was created by Austin Appleby and placed in the public domain. - * This java port was authored by Yonik Seeley and also placed into the public domain. - * The author hereby disclaims copyright to this source code. - *

- * This produces exactly the same hash values as the final C++ - * version of MurmurHash3 and is thus suitable for producing the same hash values across - * platforms. - *

- * The 32 bit x86 version of this hash should be the fastest variant for relatively short keys like ids. - * murmurhash3_x64_128 is a good choice for longer strings or if you need more than 32 bits of hash. - *

- * Note - The x86 and x64 versions do _not_ produce the same results, as the - * algorithms are optimized for their respective platforms. - *

- * See http://github.com/yonik/java_util for future updates to this file. - * - * - * Special Thanks to Austin Appleby and Yonik Seeley for placing this in the public domain and therefore allowing me to use it! + * The MurmurHash3 algorithm was created by Austin Appleby and placed in the public domain. This java port was authored + * by Yonik Seeley and also placed into the public domain. The author hereby disclaims copyright to this source code. + *

This produces exactly the same hash values as the final C++ version of MurmurHash3 and is thus suitable for + * producing the same hash values across platforms.

The 32 bit x86 version of this hash should be the fastest + * variant for relatively short keys like ids. murmurhash3_x64_128 is a good choice for longer strings or if you need + * more than 32 bits of hash.

Note - The x86 and x64 versions do _not_ produce the same results, as the algorithms + * are optimized for their respective platforms.

See http://github.com/yonik/java_util for future updates to this + * file. Special Thanks to Austin Appleby and Yonik Seeley for placing this in the public domain and therefore allowing + * me to use it! */ package com.github.bartimaeusnek.bartworks.util; @@ -67,8 +58,9 @@ public final class MurmurHash3 { for (int i = offset; i < roundedEnd; i += 4) { // little endian load order - int k1 = - (data[i] & 0xff) | ((data[i + 1] & 0xff) << 8) | ((data[i + 2] & 0xff) << 16) | (data[i + 3] << 24); + int k1 = (data[i] & 0xff) | ((data[i + 1] & 0xff) << 8) + | ((data[i + 2] & 0xff) << 16) + | (data[i + 3] << 24); k1 *= c1; k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); k1 *= c2; @@ -110,9 +102,8 @@ public final class MurmurHash3 { } /** - * Returns the MurmurHash3_x86_32 hash of the UTF-8 bytes of the String without actually encoding - * the string to a temporary buffer. This is more than 2x faster than hashing the result - * of String.getBytes(). + * Returns the MurmurHash3_x86_32 hash of the UTF-8 bytes of the String without actually encoding the string to a + * temporary buffer. This is more than 2x faster than hashing the result of String.getBytes(). */ public static int murmurhash3_x86_32(CharSequence data, int offset, int len, int seed) { @@ -136,26 +127,14 @@ public final class MurmurHash3 { bits = 8; /*** - * // optimized ascii implementation (currently slower!!! code size?) - * if (shift == 24) { - * k1 = k1 | (code << 24); + * // optimized ascii implementation (currently slower!!! code size?) if (shift == 24) { k1 = k1 | (code + * << 24); * - * k1 *= c1; - * k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); - * k1 *= c2; + * k1 *= c1; k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); k1 *= c2; * - * h1 ^= k1; - * h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); - * h1 = h1*5+0xe6546b64; + * h1 ^= k1; h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); h1 = h1*5+0xe6546b64; * - * shift = 0; - * nBytes += 4; - * k1 = 0; - * } else { - * k1 |= code << shift; - * shift += 8; - * } - * continue; + * shift = 0; nBytes += 4; k1 = 0; } else { k1 |= code << shift; shift += 8; } continue; ***/ } else if (code < 0x800) { k2 = (0xC0 | (code >> 6)) | ((0x80 | (code & 0x3F)) << 8); @@ -169,8 +148,7 @@ public final class MurmurHash3 { // int utf32 = pos < end ? (int) data.charAt(pos++) : 0; int utf32 = (int) data.charAt(pos++); utf32 = ((code - 0xD7C0) << 10) + (utf32 & 0x3FF); - k2 = (0xff & (0xF0 | (utf32 >> 18))) - | ((0x80 | ((utf32 >> 12) & 0x3F))) << 8 + k2 = (0xff & (0xF0 | (utf32 >> 18))) | ((0x80 | ((utf32 >> 12) & 0x3F))) << 8 | ((0x80 | ((utf32 >> 6) & 0x3F))) << 16 | (0x80 | (utf32 & 0x3F)) << 24; bits = 32; @@ -178,8 +156,8 @@ public final class MurmurHash3 { k1 |= k2 << shift; - // int used_bits = 32 - shift; // how many bits of k2 were used in k1. - // int unused_bits = bits - used_bits; // (bits-(32-shift)) == bits+shift-32 == bits-newshift + // int used_bits = 32 - shift; // how many bits of k2 were used in k1. + // int unused_bits = bits - used_bits; // (bits-(32-shift)) == bits+shift-32 == bits-newshift shift += bits; if (shift >= 32) { @@ -325,6 +303,7 @@ public final class MurmurHash3 { * 128 bits of state */ public static final class LongPair { + public long val1; public long val2; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java index e5f9c42bf7..3595203ced 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java @@ -1,33 +1,26 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2019 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util.NoiseUtil; +import java.util.Random; + import com.github.bartimaeusnek.bartworks.API.INoiseGen; import com.github.bartimaeusnek.bartworks.util.MathUtils; import gregtech.api.objects.XSTR; -import java.util.Random; public class BartsNoise implements INoiseGen { + public void setUsePhase(boolean usePhase) { this.usePhase = usePhase; } @@ -44,6 +37,7 @@ public class BartsNoise implements INoiseGen { Random random; public enum NoiseColor { + Red(-1), Pink(-0.5), White(0), @@ -94,56 +88,56 @@ public class BartsNoise implements INoiseGen { public BartsNoise copy(long seed) { return new BartsNoise(this.octaves, this.frequency, this.amplitude, seed); } - // public static void main(String[] args) throws IOException { + // public static void main(String[] args) throws IOException { // - // BartsNoise noiseGen1 = new BartsNoise(2,0.005F,1D,System.nanoTime()); - //// BartsNoise noiseGen2 = new BartsNoise(1,0.002F,-1D,System.nanoTime()); - //// BartsNoise noiseGen3 = new BartsNoise(1,0.002F,-1D,System.nanoTime()); + // BartsNoise noiseGen1 = new BartsNoise(2,0.005F,1D,System.nanoTime()); + //// BartsNoise noiseGen2 = new BartsNoise(1,0.002F,-1D,System.nanoTime()); + //// BartsNoise noiseGen3 = new BartsNoise(1,0.002F,-1D,System.nanoTime()); // - // noiseGen1.setUsePhase(false); - //// noiseGen2.setUsePhase(false); - //// noiseGen3.setUsePhase(false); + // noiseGen1.setUsePhase(false); + //// noiseGen2.setUsePhase(false); + //// noiseGen3.setUsePhase(false); // // - // BufferedImage image = new BufferedImage(640, 640, BufferedImage.TYPE_INT_RGB); + // BufferedImage image = new BufferedImage(640, 640, BufferedImage.TYPE_INT_RGB); // - // for (int chunkX = 0; chunkX < 40; chunkX++) { - // for (int chunkZ = 0; chunkZ < 40; chunkZ++) { - // for (int x = 0; x < 16; ++x) { - // for (int z = 0; z < 16; ++z) { - // double d = noiseGen1.getNoise(x + chunkX * 16, z + chunkZ * 16) * 2D; - //// double d2 = noiseGen2.getNoise(x + chunkX * 16, z + chunkZ * 16) * 2D; - //// double d3 = (noiseGen3.getNoise(x + chunkX * 16, z + chunkZ * 16) - 0.5D); - //// d3 *= 2; - // double yDev; - //// if (d3 < 0.0D) { - //// yDev = d; - //// } else if (d3 > 1.0D) { - //// yDev = d2; - //// } else { - // yDev = d*4; - //// } - // yDev=wrap(yDev,1); - // image.setRGB(x + chunkX * 16,z + chunkZ * 16,new + // for (int chunkX = 0; chunkX < 40; chunkX++) { + // for (int chunkZ = 0; chunkZ < 40; chunkZ++) { + // for (int x = 0; x < 16; ++x) { + // for (int z = 0; z < 16; ++z) { + // double d = noiseGen1.getNoise(x + chunkX * 16, z + chunkZ * 16) * 2D; + //// double d2 = noiseGen2.getNoise(x + chunkX * 16, z + chunkZ * 16) * 2D; + //// double d3 = (noiseGen3.getNoise(x + chunkX * 16, z + chunkZ * 16) - 0.5D); + //// d3 *= 2; + // double yDev; + //// if (d3 < 0.0D) { + //// yDev = d; + //// } else if (d3 > 1.0D) { + //// yDev = d2; + //// } else { + // yDev = d*4; + //// } + // yDev=wrap(yDev,1); + // image.setRGB(x + chunkX * 16,z + chunkZ * 16,new // Color((float)(1f*yDev),(float)(1f*yDev),(float)(1f*yDev)).getRGB()); - // } - // } - // } - // } - // File file = new File("myimage.png"); - // ImageIO.write(image, "png", file); - //// BartsNoise redNoise = NoiseColor.Blue.getColoredNoise(); - //// redNoise.setOctaves(1); - //// redNoise.setFrequency(0.05F); - //// for (int i = 40; i < 50; i++) { - //// String line = ""; - //// for (int j = 0; j < 10; j++) { - //// double num = (redNoise.getNoise(i,j)-0.5D); - //// line += num+","; - //// } - //// System.out.println(line); - //// } - // } + // } + // } + // } + // } + // File file = new File("myimage.png"); + // ImageIO.write(image, "png", file); + //// BartsNoise redNoise = NoiseColor.Blue.getColoredNoise(); + //// redNoise.setOctaves(1); + //// redNoise.setFrequency(0.05F); + //// for (int i = 40; i < 50; i++) { + //// String line = ""; + //// for (int j = 0; j < 10; j++) { + //// double num = (redNoise.getNoise(i,j)-0.5D); + //// line += num+","; + //// } + //// System.out.println(line); + //// } + // } public double getCosNoise(double x, double y) { double pr = x * this.frequency; @@ -161,21 +155,19 @@ public class BartsNoise implements INoiseGen { } double getNonOctavedNoise(double x, double y) { - double phase = SimplexNoise.noise( - Math.pow(x * this.frequency, this.amplitude), Math.pow(y * this.frequency, this.amplitude)); + double phase = SimplexNoise + .noise(Math.pow(x * this.frequency, this.amplitude), Math.pow(y * this.frequency, this.amplitude)); return MathUtils.wrap(phase, 1); } public double getNeighbouringNoise(int x, int y) { - return (this.getNoiseSingle(x - 1, y - 1) - + this.getNoiseSingle(x, y - 1) - + this.getNoiseSingle(x - 1, y) - + this.getNoiseSingle(x + 1, y) - + this.getNoiseSingle(x, y + 1) - + this.getNoiseSingle(x + 1, y + 1) - + this.getNoiseSingle(x - 1, y + 1) - + this.getNoiseSingle(x + 1, y - 1)) - / 8; + return (this.getNoiseSingle(x - 1, y - 1) + this.getNoiseSingle(x, y - 1) + + this.getNoiseSingle(x - 1, y) + + this.getNoiseSingle(x + 1, y) + + this.getNoiseSingle(x, y + 1) + + this.getNoiseSingle(x + 1, y + 1) + + this.getNoiseSingle(x - 1, y + 1) + + this.getNoiseSingle(x + 1, y - 1)) / 8; } public double getNoiseSingle(int x, int y) { @@ -198,12 +190,12 @@ public class BartsNoise implements INoiseGen { @Override public double[][] getNoiseForRegion(int xStart, int zStart, int xEnd, int zEnd) { - // double[][] results = new double[Math.abs(xEnd)-Math.abs(xStart)][Math.abs(zEnd)-Math.abs(zStart)]; - // for (int i = xStart; i < xEnd; i++) { - // for (int j = zStart; j < zEnd; j++) { - // results - // } - // } + // double[][] results = new double[Math.abs(xEnd)-Math.abs(xStart)][Math.abs(zEnd)-Math.abs(zStart)]; + // for (int i = xStart; i < xEnd; i++) { + // for (int j = zStart; j < zEnd; j++) { + // results + // } + // } return new double[0][0]; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java index 427cf5919e..3d0edb9bc0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java @@ -1,78 +1,42 @@ package com.github.bartimaeusnek.bartworks.util.NoiseUtil; /* - * A speed-improved simplex noise algorithm for 2D, 3D and 4D in Java. - * - * Based on example code by Stefan Gustavson (stegu@itn.liu.se). - * Optimisations by Peter Eastman (peastman@drizzle.stanford.edu). - * Better rank ordering method by Stefan Gustavson in 2012. - * - * This could be speeded up even further, but it's useful as it is. - * - * Version 2012-03-09 - * - * This code was placed in the public domain by its original author, - * Stefan Gustavson. You may use it as you see fit, but + * A speed-improved simplex noise algorithm for 2D, 3D and 4D in Java. Based on example code by Stefan Gustavson + * (stegu@itn.liu.se). Optimisations by Peter Eastman (peastman@drizzle.stanford.edu). Better rank ordering method by + * Stefan Gustavson in 2012. This could be speeded up even further, but it's useful as it is. Version 2012-03-09 This + * code was placed in the public domain by its original author, Stefan Gustavson. You may use it as you see fit, but * attribution is appreciated. - * */ import com.github.bartimaeusnek.bartworks.util.MathUtils; public class SimplexNoise { // Simplex noise in 2D, 3D and 4D - private static Grad[] grad3 = { - new Grad(1, 1, 0), new Grad(-1, 1, 0), new Grad(1, -1, 0), new Grad(-1, -1, 0), - new Grad(1, 0, 1), new Grad(-1, 0, 1), new Grad(1, 0, -1), new Grad(-1, 0, -1), - new Grad(0, 1, 1), new Grad(0, -1, 1), new Grad(0, 1, -1), new Grad(0, -1, -1) - }; - private static Grad[] grad4 = { - new Grad(0, 1, 1, 1), - new Grad(0, 1, 1, -1), - new Grad(0, 1, -1, 1), - new Grad(0, 1, -1, -1), - new Grad(0, -1, 1, 1), - new Grad(0, -1, 1, -1), - new Grad(0, -1, -1, 1), - new Grad(0, -1, -1, -1), - new Grad(1, 0, 1, 1), - new Grad(1, 0, 1, -1), - new Grad(1, 0, -1, 1), - new Grad(1, 0, -1, -1), - new Grad(-1, 0, 1, 1), - new Grad(-1, 0, 1, -1), - new Grad(-1, 0, -1, 1), - new Grad(-1, 0, -1, -1), - new Grad(1, 1, 0, 1), - new Grad(1, 1, 0, -1), - new Grad(1, -1, 0, 1), - new Grad(1, -1, 0, -1), - new Grad(-1, 1, 0, 1), - new Grad(-1, 1, 0, -1), - new Grad(-1, -1, 0, 1), - new Grad(-1, -1, 0, -1), - new Grad(1, 1, 1, 0), - new Grad(1, 1, -1, 0), - new Grad(1, -1, 1, 0), - new Grad(1, -1, -1, 0), - new Grad(-1, 1, 1, 0), - new Grad(-1, 1, -1, 0), - new Grad(-1, -1, 1, 0), - new Grad(-1, -1, -1, 0) - }; + private static Grad[] grad3 = { new Grad(1, 1, 0), new Grad(-1, 1, 0), new Grad(1, -1, 0), new Grad(-1, -1, 0), + new Grad(1, 0, 1), new Grad(-1, 0, 1), new Grad(1, 0, -1), new Grad(-1, 0, -1), new Grad(0, 1, 1), + new Grad(0, -1, 1), new Grad(0, 1, -1), new Grad(0, -1, -1) }; - private static short[] p = { - 151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, 103, 30, 69, 142, 8, 99, 37, - 240, 21, 10, 23, 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117, 35, 11, 32, 57, 177, - 33, 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, 134, 139, 48, 27, 166, 77, 146, - 158, 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, 55, 46, 245, 40, 244, 102, 143, 54, 65, 25, - 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, 18, 169, 200, 196, 135, 130, 116, 188, 159, 86, 164, 100, - 109, 198, 173, 186, 3, 64, 52, 217, 226, 250, 124, 123, 5, 202, 38, 147, 118, 126, 255, 82, 85, 212, 207, 206, - 59, 227, 47, 16, 58, 17, 182, 189, 28, 42, 223, 183, 170, 213, 119, 248, 152, 2, 44, 154, 163, 70, 221, 153, - 101, 155, 167, 43, 172, 9, 129, 22, 39, 253, 19, 98, 108, 110, 79, 113, 224, 232, 178, 185, 112, 104, 218, 246, - 97, 228, 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241, 81, 51, 145, 235, 249, 14, 239, 107, 49, 192, - 214, 31, 181, 199, 106, 157, 184, 84, 204, 176, 115, 121, 50, 45, 127, 4, 150, 254, 138, 236, 205, 93, 222, 114, - 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, 61, 156, 180 - }; + private static Grad[] grad4 = { new Grad(0, 1, 1, 1), new Grad(0, 1, 1, -1), new Grad(0, 1, -1, 1), + new Grad(0, 1, -1, -1), new Grad(0, -1, 1, 1), new Grad(0, -1, 1, -1), new Grad(0, -1, -1, 1), + new Grad(0, -1, -1, -1), new Grad(1, 0, 1, 1), new Grad(1, 0, 1, -1), new Grad(1, 0, -1, 1), + new Grad(1, 0, -1, -1), new Grad(-1, 0, 1, 1), new Grad(-1, 0, 1, -1), new Grad(-1, 0, -1, 1), + new Grad(-1, 0, -1, -1), new Grad(1, 1, 0, 1), new Grad(1, 1, 0, -1), new Grad(1, -1, 0, 1), + new Grad(1, -1, 0, -1), new Grad(-1, 1, 0, 1), new Grad(-1, 1, 0, -1), new Grad(-1, -1, 0, 1), + new Grad(-1, -1, 0, -1), new Grad(1, 1, 1, 0), new Grad(1, 1, -1, 0), new Grad(1, -1, 1, 0), + new Grad(1, -1, -1, 0), new Grad(-1, 1, 1, 0), new Grad(-1, 1, -1, 0), new Grad(-1, -1, 1, 0), + new Grad(-1, -1, -1, 0) }; + + private static short[] p = { 151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, 103, + 30, 69, 142, 8, 99, 37, 240, 21, 10, 23, 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, + 117, 35, 11, 32, 57, 177, 33, 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, 134, + 139, 48, 27, 166, 77, 146, 158, 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, 55, 46, 245, + 40, 244, 102, 143, 54, 65, 25, 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, 18, 169, 200, 196, 135, + 130, 116, 188, 159, 86, 164, 100, 109, 198, 173, 186, 3, 64, 52, 217, 226, 250, 124, 123, 5, 202, 38, 147, + 118, 126, 255, 82, 85, 212, 207, 206, 59, 227, 47, 16, 58, 17, 182, 189, 28, 42, 223, 183, 170, 213, 119, + 248, 152, 2, 44, 154, 163, 70, 221, 153, 101, 155, 167, 43, 172, 9, 129, 22, 39, 253, 19, 98, 108, 110, 79, + 113, 224, 232, 178, 185, 112, 104, 218, 246, 97, 228, 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, + 241, 81, 51, 145, 235, 249, 14, 239, 107, 49, 192, 214, 31, 181, 199, 106, 157, 184, 84, 204, 176, 115, 121, + 50, 45, 127, 4, 150, 254, 138, 236, 205, 93, 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, 61, + 156, 180 }; // To remove the need for index wrapping, double the permutation table length private static short[] perm = new short[512]; private static short[] permMod12 = new short[512]; @@ -132,9 +96,9 @@ public class SimplexNoise { // Simplex noise in 2D, 3D and 4D i1 = 0; j1 = 1; } // upper triangle, YX order: (0,0)->(0,1)->(1,1) - // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and - // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where - // c = (3-sqrt(3))/6 + // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and + // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where + // c = (3-sqrt(3))/6 double x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords double y1 = y0 - j1 + G2; double x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords @@ -417,6 +381,7 @@ public class SimplexNoise { // Simplex noise in 2D, 3D and 4D // Inner class to speed upp gradient computations // (array access is a lot slower than member access) private static class Grad { + double x, y, z, w; Grad(double x, double y, double z) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java index 2ccc22d1dd..7d33e56286 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; @@ -57,7 +48,7 @@ public class NonNullWrappedHashMap extends HashMap { @Override public V getOrDefault(Object key, V defaultValue) { - return Objects.requireNonNull( - Optional.ofNullable(super.getOrDefault(key, defaultValue)).orElse(this.defaultValue)); + return Objects + .requireNonNull(Optional.ofNullable(super.getOrDefault(key, defaultValue)).orElse(this.defaultValue)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java index cb677be388..1a96a3fd7b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java index 0ebb5a4c37..8f34837f9a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2019 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; @@ -28,6 +19,7 @@ import java.util.Map; @SuppressWarnings("unchecked") public class Pair implements Map.Entry { + Object[] pair = new Object[2]; public Pair(Object[] pair) { @@ -53,10 +45,7 @@ public class Pair implements Map.Entry { @Override public int hashCode() { return MurmurHash3.murmurhash3_x86_32( - ByteBuffer.allocate(8) - .putInt(pair[0].hashCode()) - .putInt(pair[1].hashCode()) - .array(), + ByteBuffer.allocate(8).putInt(pair[0].hashCode()).putInt(pair[1].hashCode()).array(), 0, 8, 31); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java index daa9994053..9f3df5d175 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java @@ -1,14 +1,16 @@ package com.github.bartimaeusnek.bartworks.util; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; + import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; + /** * Handle the parallel more efficient. * @@ -17,18 +19,17 @@ import net.minecraftforge.fluids.FluidStack; public class RecipeFinderForParallel { /** - * This method is used for mega multis which have extremely high parallel. - * Never use it for non parallel machines, it will have worse performance. - * It will auto consume the inputs. + * This method is used for mega multis which have extremely high parallel. Never use it for non parallel machines, + * it will have worse performance. It will auto consume the inputs. * - * @param aRecipe The target recipe that you want calculate the parallel - * @param aFluidInputs The input fluid from machine - * @param aItemStacks The input item from machine - * @param aMaxParallel The max parallel that it can reach - * @return The parallel that it can reach + * @param aRecipe The target recipe that you want calculate the parallel + * @param aFluidInputs The input fluid from machine + * @param aItemStacks The input item from machine + * @param aMaxParallel The max parallel that it can reach + * @return The parallel that it can reach */ - public static int handleParallelRecipe( - GT_Recipe aRecipe, FluidStack[] aFluidInputs, ItemStack[] aItemStacks, int aMaxParallel) { + public static int handleParallelRecipe(GT_Recipe aRecipe, FluidStack[] aFluidInputs, ItemStack[] aItemStacks, + int aMaxParallel) { if (aFluidInputs == null) aFluidInputs = new FluidStack[0]; if (aItemStacks == null) aItemStacks = new ItemStack[0]; HashMap tCompressedFluidInput = compressFluid(aFluidInputs); @@ -38,12 +39,12 @@ public class RecipeFinderForParallel { int tCurrentPara = aMaxParallel; for (int tFluid : tCompressedFluidRecipe.keySet()) { if (tCompressedFluidInput.containsKey(tFluid) && tCompressedFluidRecipe.get(tFluid) != 0) { - tCurrentPara = - Math.min(tCurrentPara, tCompressedFluidInput.get(tFluid) / tCompressedFluidRecipe.get(tFluid)); + tCurrentPara = Math + .min(tCurrentPara, tCompressedFluidInput.get(tFluid) / tCompressedFluidRecipe.get(tFluid)); } } for (int tItem : tCompressedItemRecipe.keySet()) { - /*Wildcard Stuff*/ + /* Wildcard Stuff */ if (tItem >> 16 == Short.MAX_VALUE) { int tCountWildcard = 0; for (int tInputItem : tCompressedItemInput.keySet()) { @@ -53,7 +54,7 @@ public class RecipeFinderForParallel { } tCurrentPara = Math.min(tCurrentPara, tCountWildcard / tCompressedItemRecipe.get(tItem)); } else if (tCompressedItemRecipe.get(tItem) != 0) { - /*OreDict Stuff*/ + /* OreDict Stuff */ int tCountOre = 0; ItemStack tRealRecipe = GT_Utility.intToStack(tItem); for (int tInputItem : tCompressedItemInput.keySet()) { @@ -81,16 +82,16 @@ public class RecipeFinderForParallel { tFluid.amount -= tCompressedFluidRecipe.get(tFluid.getFluidID()); tCompressedFluidRecipe.remove(tFluid.getFluidID()); } else { - tCompressedFluidRecipe.put( - tFluid.getFluidID(), tCompressedFluidRecipe.get(tFluid.getFluidID()) - tFluid.amount); + tCompressedFluidRecipe + .put(tFluid.getFluidID(), tCompressedFluidRecipe.get(tFluid.getFluidID()) - tFluid.amount); tFluid.amount = 0; } } } - /*OreDict Stuff*/ - /*Wildcard Stuff*/ - for (Iterator i = tCompressedItemRecipe.keySet().iterator(); i.hasNext(); ) { + /* OreDict Stuff */ + /* Wildcard Stuff */ + for (Iterator i = tCompressedItemRecipe.keySet().iterator(); i.hasNext();) { int tItem = i.next(); if (tItem >> 16 == Short.MAX_VALUE) { for (ItemStack tInputItem : aItemStacks) { @@ -130,9 +131,9 @@ public class RecipeFinderForParallel { /** * Get the proper packed output stacks * - * @param aRecipe The target recipe - * @param aPall The parallel it has - * @return A pair of the output fluid and item stack, the first value is fluid, the second is item. + * @param aRecipe The target recipe + * @param aPall The parallel it has + * @return A pair of the output fluid and item stack, the first value is fluid, the second is item. */ public static Pair, ArrayList> getMultiOutput(GT_Recipe aRecipe, int aPall) { ArrayList tFluidList = new ArrayList<>(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java index b1d1bac0d1..c56eac94dd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java @@ -1,32 +1,25 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util; -import gregtech.api.util.GT_Recipe; import java.util.Optional; import java.util.function.Predicate; +import gregtech.api.util.GT_Recipe; + public class StreamUtils { + private StreamUtils() {} public static Predicate filterVisualMaps() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java index 22e2a4e719..5afd78e1b6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java @@ -1,28 +1,20 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2019 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util.accessprioritylist; import java.util.*; + import org.apache.commons.lang3.NotImplementedException; @SuppressWarnings("ALL") @@ -266,10 +258,10 @@ public class AccessPriorityList implements List, Deque, Set { @Override public boolean remove(Object o) { - // Object p; - // for (Iterator it = this.iterator(); it.hasNext(); o.equals(p)){ - // p = it.next(); - // } + // Object p; + // for (Iterator it = this.iterator(); it.hasNext(); o.equals(p)){ + // p = it.next(); + // } throw new NotImplementedException(""); } @@ -325,8 +317,7 @@ public class AccessPriorityList implements List, Deque, Set { if (current == Long.MAX_VALUE || (current > 0 && prio > 0 && prio + current < 0)) node.setPriority(Long.MAX_VALUE); else node.setPriority(current + prio); - while (node.getBefore() != null - && node.getPriority() >= node.getBefore().getPriority()) { + while (node.getBefore() != null && node.getPriority() >= node.getBefore().getPriority()) { moveNodeUp(node); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java index 4e423b0654..dc826caa6d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java @@ -1,42 +1,35 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2019 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util.accessprioritylist; import java.util.Iterator; import java.util.ListIterator; + import org.apache.commons.lang3.NotImplementedException; public class AccessPriorityListIterators { public static class AccessPriorityListListIterator implements ListIterator { + final AccessPriorityListNode head; final AccessPriorityListNode tail; AccessPriorityListNode current; int counter = 0; boolean reverse; - public AccessPriorityListListIterator( - AccessPriorityListNode head, AccessPriorityListNode tail, boolean reverse) { + public AccessPriorityListListIterator(AccessPriorityListNode head, AccessPriorityListNode tail, + boolean reverse) { this.head = head; this.tail = tail; current = reverse ? tail : head; @@ -103,6 +96,7 @@ public class AccessPriorityListIterators { } public static class AccessPriorityListIterator implements Iterator { + final AccessPriorityListNode head; AccessPriorityListNode current; @@ -124,6 +118,7 @@ public class AccessPriorityListIterators { } public static class AccessPriorityListReverseIterator implements Iterator { + final AccessPriorityListNode tail; AccessPriorityListNode current; @@ -145,6 +140,7 @@ public class AccessPriorityListIterators { } public static class AccessPriorityListNodeIterator implements Iterator> { + final AccessPriorityListNode head; AccessPriorityListNode current; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java index 1abeeb6e45..94bf309ef9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2019 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2019 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util.accessprioritylist; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java index 5fd9dac817..d331b95e16 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util.flowerset; @@ -109,6 +100,7 @@ public class FlowerSet implements Set { public void clear() {} static class FlowerNode { + private final FlowerSet map; final V value; final FlowerNode[] links; @@ -142,6 +134,7 @@ public class FlowerSet implements Set { } static class Functions { + public static Function HashBasedFunction() { return function -> function.hashCode() % function.map.petals; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java index a52491c353..c54138f1ae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java @@ -1,28 +1,18 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.bartworks.util.log; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; import java.io.File; import java.io.IOException; import java.text.SimpleDateFormat; @@ -33,7 +23,10 @@ import java.util.logging.Formatter; import java.util.logging.LogRecord; import java.util.logging.Logger; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + public class DebugLog { + private static boolean init; static FileHandler fh; private static Logger utilLog; @@ -47,14 +40,14 @@ public class DebugLog { DebugLog.utilLog.setUseParentHandlers(false); DebugLog.utilLog.addHandler(DebugLog.fh); Formatter formatter = new Formatter() { + @Override public String format(LogRecord record) { SimpleDateFormat logTime = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); Calendar cal = new GregorianCalendar(); cal.setTimeInMillis(record.getMillis()); - return "Level: " + record.getLevel() - + " at " + logTime.format(cal.getTime()) - + " " + record.getMessage() + "\n"; + return "Level: " + record + .getLevel() + " at " + logTime.format(cal.getTime()) + " " + record.getMessage() + "\n"; } }; DebugLog.fh.setFormatter(formatter); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java index 0e846834ca..69f9b8fb64 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ @API(owner = "bartworks", apiVersion = API_REFERENCE.VERSION, provides = "bartworks util") package com.github.bartimaeusnek.bartworks.util; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index a37db6b509..315d8a4592 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -1,50 +1,44 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod; +import java.io.StringReader; + +import net.minecraft.util.StringTranslate; + +import org.apache.commons.io.input.ReaderInputStream; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.tectech.TecTechResearchLoader; import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; + import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; -import java.io.StringReader; -import net.minecraft.util.StringTranslate; -import org.apache.commons.io.input.ReaderInputStream; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; @Mod( modid = BartWorksCrossmod.MOD_ID, name = BartWorksCrossmod.NAME, version = BartWorksCrossmod.VERSION, - dependencies = "required-after:IC2; " - + "required-after:gregtech; " + dependencies = "required-after:IC2; " + "required-after:gregtech; " + "required-after:bartworks;" + "after:GalacticraftMars; " + "after:GalacticraftCore; " @@ -53,6 +47,7 @@ import org.apache.logging.log4j.Logger; + "after:EMT; " + "after:tectech; ") public class BartWorksCrossmod { + public static final String NAME = "BartWorks Mod Additions"; public static final String VERSION = MainMod.VERSION; public static final String MOD_ID = "bartworkscrossmod"; @@ -63,8 +58,8 @@ public class BartWorksCrossmod { @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { - // if (LoaderReference.appliedenergistics2) - // new ItemSingleItemStorageCell("singleItemStorageCell"); + // if (LoaderReference.appliedenergistics2) + // new ItemSingleItemStorageCell("singleItemStorageCell"); if (LoaderReference.GalacticraftCore) GalacticraftProxy.preInit(preinit); if (LoaderReference.Thaumcraft) new CustomAspects(); } @@ -81,29 +76,28 @@ public class BartWorksCrossmod { if (LoaderReference.tectech) TecTechResearchLoader.runResearches(); } - // @Mod.EventHandler - // public void onFMLMissingMappingsEvent(FMLMissingMappingsEvent event){ - // for (FMLMissingMappingsEvent.MissingMapping mapping : event.getAll()){ - // if (mapping.name.equalsIgnoreCase()) - // } - // } + // @Mod.EventHandler + // public void onFMLMissingMappingsEvent(FMLMissingMappingsEvent event){ + // for (FMLMissingMappingsEvent.MissingMapping mapping : event.getAll()){ + // if (mapping.name.equalsIgnoreCase()) + // } + // } - // @Mod.EventHandler - // public void onServerStarted(FMLServerStartedEvent event) { - // if (LoaderReference.EMT){ - // try { - // TCRecipeHandler.init(); - // } catch (IllegalAccessException | InvocationTargetException e) { - // e.printStackTrace(); - // } - // } - // } + // @Mod.EventHandler + // public void onServerStarted(FMLServerStartedEvent event) { + // if (LoaderReference.EMT){ + // try { + // TCRecipeHandler.init(); + // } catch (IllegalAccessException | InvocationTargetException e) { + // e.printStackTrace(); + // } + // } + // } @Mod.EventHandler public void onFMLServerStart(FMLServerStartingEvent event) { - if (LoaderReference.miscutils) - for (Object s : RadioHatchCompat.TranslateSet) { - StringTranslate.inject(new ReaderInputStream(new StringReader((String) s))); - } + if (LoaderReference.miscutils) for (Object s : RadioHatchCompat.TranslateSet) { + StringTranslate.inject(new ReaderInputStream(new StringReader((String) s))); + } } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java index 14ebcb50cc..e40834da12 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java @@ -1,44 +1,38 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.GTpp.loader; -import com.github.bartimaeusnek.bartworks.API.IRadMaterial; -import com.github.bartimaeusnek.bartworks.util.log.DebugLog; -import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.ModContainer; -import cpw.mods.fml.common.registry.GameData; -import cpw.mods.fml.common.registry.GameRegistry; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.util.*; + import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.RegistryNamespaced; import net.minecraftforge.oredict.OreDictionary; -@SuppressWarnings({"unchecked", "rawtypes", "unused"}) +import com.github.bartimaeusnek.bartworks.API.IRadMaterial; +import com.github.bartimaeusnek.bartworks.util.log.DebugLog; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.registry.GameData; +import cpw.mods.fml.common.registry.GameRegistry; + +@SuppressWarnings({ "unchecked", "rawtypes", "unused" }) public class RadioHatchCompat { private static Class intf; @@ -114,8 +108,8 @@ public class RadioHatchCompat { map.setAccessible(true); Map UniqueIdentifierMap = (Map) map.get(GameData.getItemRegistry()); - Map ownerItems = - (Map) cOwners.get(null); + Map ownerItems = (Map) cOwners + .get(null); ModContainer gtpp = null; ModContainer bartworks = null; @@ -125,26 +119,24 @@ public class RadioHatchCompat { else if (container.getModId().equalsIgnoreCase("miscutils")) gtpp = container; } - for (Object mats : (Set) - RadioHatchCompat.materialClass.getField("mMaterialMap").get(null)) { + for (Object mats : (Set) RadioHatchCompat.materialClass.getField("mMaterialMap").get(null)) { if (RadioHatchCompat.isRadioactive.getBoolean(mats)) { - if (OreDictionary.getOres("stick" + RadioHatchCompat.unlocalizedName.get(mats)) - .isEmpty()) { + if (OreDictionary.getOres("stick" + RadioHatchCompat.unlocalizedName.get(mats)).isEmpty()) { Item it = c1.newInstance(mats); UniqueIdentifierMap.replace(it, "miscutils:" + it.getUnlocalizedName()); GameRegistry.UniqueIdentifier ui = GameRegistry.findUniqueIdentifierFor(it); ownerItems.replace(ui, bartworks, gtpp); - String tanslate = - it.getUnlocalizedName() + ".name=" + RadioHatchCompat.localizedName.get(mats) + " Rod"; + String tanslate = it.getUnlocalizedName() + ".name=" + + RadioHatchCompat.localizedName.get(mats) + + " Rod"; RadioHatchCompat.TranslateSet.add(tanslate); DebugLog.log(tanslate); DebugLog.log("Generate: " + RadioHatchCompat.rod + RadioHatchCompat.unlocalizedName.get(mats)); } - if (OreDictionary.getOres("stickLong" + RadioHatchCompat.unlocalizedName.get(mats)) - .isEmpty()) { + if (OreDictionary.getOres("stickLong" + RadioHatchCompat.unlocalizedName.get(mats)).isEmpty()) { Item it2 = c2.newInstance(mats); UniqueIdentifierMap.replace(it2, "miscutils:" + it2.getUnlocalizedName()); GameRegistry.UniqueIdentifier ui2 = GameRegistry.findUniqueIdentifierFor(it2); @@ -155,12 +147,8 @@ public class RadioHatchCompat { } } } - } catch (NoSuchFieldException - | IllegalAccessException - | NoSuchMethodException - | InvocationTargetException - | InstantiationException - | ClassNotFoundException e) { + } catch (NoSuchFieldException | IllegalAccessException | NoSuchMethodException | InvocationTargetException + | InstantiationException | ClassNotFoundException e) { e.printStackTrace(); } } @@ -169,10 +157,7 @@ public class RadioHatchCompat { try { if (RadioHatchCompat.intf.isAssignableFrom(lStack.getItem().getClass())) { if (!RadioHatchCompat.isRadioactive.getBoolean(RadioHatchCompat.f.get(lStack.getItem()))) return null; - int amount = RadioHatchCompat.componentType - .get(lStack.getItem()) - .equals(RadioHatchCompat.rod) - ? 1 + int amount = RadioHatchCompat.componentType.get(lStack.getItem()).equals(RadioHatchCompat.rod) ? 1 : RadioHatchCompat.componentType.get(lStack.getItem()).equals(RadioHatchCompat.longRod) ? 2 : 0; if (amount == 0) return null; return new RadioHatchCompat.GTPPRadAdapter(amount, RadioHatchCompat.f.get(lStack.getItem())); @@ -205,8 +190,7 @@ public class RadioHatchCompat { } private static boolean isElement(Object GTPPMaterial) throws IllegalAccessException { - return RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial) - .isEmpty(); + return RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial).isEmpty(); } private static List getElemets(Object GTPPMaterial) throws IllegalAccessException { @@ -229,12 +213,10 @@ public class RadioHatchCompat { int ret = 0; try { List pureElements = RadioHatchCompat.GTPPRadAdapter.getElemets(m); - for (Object materialObj : pureElements) - if (RadioHatchCompat.isRadioactive.getBoolean(materialObj)) - ret += ((int) RadioHatchCompat.radlevel.getByte(m) - + RadioHatchCompat.GTPPRadAdapter.clampToZero( - RadioHatchCompat.protons.getLong(materialObj))); - else ret += RadioHatchCompat.radlevel.getByte(m); + for (Object materialObj : pureElements) if (RadioHatchCompat.isRadioactive.getBoolean(materialObj)) + ret += ((int) RadioHatchCompat.radlevel.getByte(m) + RadioHatchCompat.GTPPRadAdapter + .clampToZero(RadioHatchCompat.protons.getLong(materialObj))); + else ret += RadioHatchCompat.radlevel.getByte(m); } catch (IllegalAccessException e) { e.printStackTrace(); } @@ -243,8 +225,8 @@ public class RadioHatchCompat { @Override public int getRadiationLevel(ItemStack aStack) { - return RadioHatchCompat.GTPPRadAdapter.BUFFER.computeIfAbsent( - this.m, radlvl -> RadioHatchCompat.GTPPRadAdapter.calulateRad(this.m)); + return RadioHatchCompat.GTPPRadAdapter.BUFFER + .computeIfAbsent(this.m, radlvl -> RadioHatchCompat.GTPPRadAdapter.calulateRad(this.m)); } private static long clampToZero(long number) { @@ -258,7 +240,7 @@ public class RadioHatchCompat { @Override public short[] getColorForGUI(ItemStack aStack) { - short[] rgba = {0, 0, 0, 0}; + short[] rgba = { 0, 0, 0, 0 }; try { rgba = (short[]) RadioHatchCompat.RGBA.get(this.m); } catch (IllegalAccessException e) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java b/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java index a9ac64b5fb..a55ca3cb31 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java @@ -23,104 +23,104 @@ // // public class ItemSingleItemStorageCell extends SimpleSubItemClass implements IStorageCell { // -// public ItemSingleItemStorageCell(String tex) { -// super(tex); -// Item thizz = this; -// GameRegistry.registerItem(this, BartWorksCrossmod.MOD_ID+this.iconString); -// } -// -// @Override -// @SideOnly(Side.CLIENT) -// public void addInformation(ItemStack stack, EntityPlayer p_77624_2_, List lines, boolean p_77624_4_) { -// IMEInventoryHandler inventory = AEApi.instance().registries().cell().getCellInventory(stack, +// public ItemSingleItemStorageCell(String tex) { +// super(tex); +// Item thizz = this; +// GameRegistry.registerItem(this, BartWorksCrossmod.MOD_ID+this.iconString); +// } +// +// @Override +// @SideOnly(Side.CLIENT) +// public void addInformation(ItemStack stack, EntityPlayer p_77624_2_, List lines, boolean p_77624_4_) { +// IMEInventoryHandler inventory = AEApi.instance().registries().cell().getCellInventory(stack, // (ISaveProvider)null, StorageChannel.ITEMS); -// if (inventory instanceof ICellInventoryHandler) { -// ICellInventoryHandler handler = (ICellInventoryHandler)inventory; -// ICellInventory cellInventory = handler.getCellInv(); -// if (cellInventory != null) { -// lines.add(cellInventory.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + +// if (inventory instanceof ICellInventoryHandler) { +// ICellInventoryHandler handler = (ICellInventoryHandler)inventory; +// ICellInventory cellInventory = handler.getCellInv(); +// if (cellInventory != null) { +// lines.add(cellInventory.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + // cellInventory.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal()); -// lines.add(cellInventory.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' + +// lines.add(cellInventory.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' + // cellInventory.getTotalItemTypes() + ' ' + GuiText.Types.getLocal()); -// if (handler.isPreformatted()) { -// String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : +// if (handler.isPreformatted()) { +// String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : // GuiText.Excluded).getLocal(); -// if (handler.isFuzzy()) { -// lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Fuzzy.getLocal()); -// } else { -// lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Precise.getLocal()); -// } -// } -// } -// } -// } -// -// @Override -// public int getBytes(ItemStack itemStack) { -// return getTotalTypes(itemStack)*getBytesPerType(itemStack); -// } -// -// @Override -// public int BytePerType(ItemStack itemStack) { -// return 1; -// } -// -// @Override -// public int getBytesPerType(ItemStack itemStack) { -// return 1; -// } -// -// @Override -// public int getTotalTypes(ItemStack itemStack) { -// return 4096; -// } -// -// @Override -// public boolean isBlackListed(ItemStack itemStack, IAEItemStack iaeItemStack) { -// return iaeItemStack == null || iaeItemStack.getItem().getItemStackLimit() != 1; -// } -// -// @Override -// public boolean storableInStorageCell() { -// return true; -// } -// -// @Override -// public boolean isStorageCell(ItemStack itemStack) { -// return true; -// } -// -// @Override -// public double getIdleDrain() { -// return 4D; -// } -// -// @Override -// public boolean isEditable(ItemStack itemStack) { -// return true; -// } -// -// @Override -// public IInventory getUpgradesInventory(ItemStack itemStack) { -// return new CellUpgrades(itemStack, 2); -// } -// -// @Override -// public IInventory getConfigInventory(ItemStack itemStack) { -// return new CellUpgrades(itemStack,2); -// } -// @Override -// public FuzzyMode getFuzzyMode(ItemStack is) { -// String fz = Platform.openNbtData(is).getString("FuzzyMode"); -// -// try { -// return FuzzyMode.valueOf(fz); -// } catch (Throwable var4) { -// return FuzzyMode.IGNORE_ALL; -// } -// } -// @Override -// public void setFuzzyMode(ItemStack is, FuzzyMode fzMode) { -// Platform.openNbtData(is).setString("FuzzyMode", fzMode.name()); -// } +// if (handler.isFuzzy()) { +// lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Fuzzy.getLocal()); +// } else { +// lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Precise.getLocal()); +// } +// } +// } +// } +// } +// +// @Override +// public int getBytes(ItemStack itemStack) { +// return getTotalTypes(itemStack)*getBytesPerType(itemStack); +// } +// +// @Override +// public int BytePerType(ItemStack itemStack) { +// return 1; +// } +// +// @Override +// public int getBytesPerType(ItemStack itemStack) { +// return 1; +// } +// +// @Override +// public int getTotalTypes(ItemStack itemStack) { +// return 4096; +// } +// +// @Override +// public boolean isBlackListed(ItemStack itemStack, IAEItemStack iaeItemStack) { +// return iaeItemStack == null || iaeItemStack.getItem().getItemStackLimit() != 1; +// } +// +// @Override +// public boolean storableInStorageCell() { +// return true; +// } +// +// @Override +// public boolean isStorageCell(ItemStack itemStack) { +// return true; +// } +// +// @Override +// public double getIdleDrain() { +// return 4D; +// } +// +// @Override +// public boolean isEditable(ItemStack itemStack) { +// return true; +// } +// +// @Override +// public IInventory getUpgradesInventory(ItemStack itemStack) { +// return new CellUpgrades(itemStack, 2); +// } +// +// @Override +// public IInventory getConfigInventory(ItemStack itemStack) { +// return new CellUpgrades(itemStack,2); +// } +// @Override +// public FuzzyMode getFuzzyMode(ItemStack is) { +// String fz = Platform.openNbtData(is).getString("FuzzyMode"); +// +// try { +// return FuzzyMode.valueOf(fz); +// } catch (Throwable var4) { +// return FuzzyMode.IGNORE_ALL; +// } +// } +// @Override +// public void setFuzzyMode(ItemStack is, FuzzyMode fzMode) { +// Platform.openNbtData(is).setString("FuzzyMode", fzMode.name()); +// } // } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java index 134b541021..3d1a265b80 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java @@ -1,35 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.cls; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Optional; -@SuppressWarnings({"rawtypes", "unchecked"}) +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; + +@SuppressWarnings({ "rawtypes", "unchecked" }) public class CLSCompat { + private CLSCompat() {} private static final long MINIMAL_UPDATE_INTERVAL = 1000 / 30; // target 30 fps @@ -77,7 +70,7 @@ public class CLSCompat { if (Werkstoff.werkstoffHashSet.size() >= 100) sizeStep = Werkstoff.werkstoffHashSet.size() / 100 - 1; else sizeStep = sizeStep2 = Werkstoff.werkstoffHashSet.size(); - return new Integer[] {sizeStep, sizeStep2, sizeStep}; + return new Integer[] { sizeStep, sizeStep2, sizeStep }; } public static int invokeStepSize(Werkstoff werkstoff, Integer[] steps, int size) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java index fa3cf70882..124b41cd2f 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java @@ -1,33 +1,37 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.emt.recipe; import static com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler.AspectAdder; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import com.google.common.collect.ArrayListMultimap; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; @@ -35,19 +39,10 @@ import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; @SuppressWarnings("ALL") public class TCRecipeHandler { + public static final GT_Recipe.GT_Recipe_Map alchemicalConstructHandler = new TCRecipeHandler.TCRecipeMap( new HashSet<>(15000), "bwcm.recipe.alchemicalConstruct", @@ -140,18 +135,18 @@ public class TCRecipeHandler { } for (ItemStack o : itemToAspectsMap.keySet()) { if (o.getItemDamage() == Short.MAX_VALUE) itemToCircuitConfigMap.put(o, 24); - else - for (int j = 1; j <= itemToAspectsMap.get(o).size(); j++) { - itemToCircuitConfigMap.put(o, j % 24); - } + else for (int j = 1; j <= itemToAspectsMap.get(o).size(); j++) { + itemToCircuitConfigMap.put(o, j % 24); + } for (int j = 0; j < itemToAspectsMap.get(o).size(); j++) { - ret.add(addRecipes( - itemToResearchMap.get(o).get(j), - itemToOutputMap.get(o).get(j), - itemToAspectsMap.get(o).get(j), - o, - itemToCircuitConfigMap.get(o).get(j))); + ret.add( + addRecipes( + itemToResearchMap.get(o).get(j), + itemToOutputMap.get(o).get(j), + itemToAspectsMap.get(o).get(j), + o, + itemToCircuitConfigMap.get(o).get(j))); } } @@ -170,8 +165,8 @@ public class TCRecipeHandler { fake.setStackDisplayName(key); GT_Recipe recipe = new BWRecipes.DynamicGTRecipe( false, - new ItemStack[] {cat, GT_Utility.getIntegratedCircuit(config)}, - new ItemStack[] {out}, + new ItemStack[] { cat, GT_Utility.getIntegratedCircuit(config) }, + new ItemStack[] { out }, fake, null, null, @@ -183,21 +178,11 @@ public class TCRecipeHandler { } static class TCRecipeMap extends GT_Recipe.GT_Recipe_Map { - public TCRecipeMap( - Collection aRecipeList, - String aUnlocalizedName, - String aLocalName, - String aNEIName, - String aNEIGUIPath, - int aUsualInputCount, - int aUsualOutputCount, - int aMinimalInputItems, - int aMinimalInputFluids, - int aAmperage, - String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, - String aNEISpecialValuePost, - boolean aShowVoltageAmperageInNEI, + + public TCRecipeMap(Collection aRecipeList, String aUnlocalizedName, String aLocalName, + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, + int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( aRecipeList, @@ -218,14 +203,8 @@ public class TCRecipeHandler { } @Override - public GT_Recipe findRecipe( - IHasWorldObjectAndCoords aTileEntity, - GT_Recipe aRecipe, - boolean aNotUnificated, - boolean aDontCheckStackSizes, - long aVoltage, - FluidStack[] aFluids, - ItemStack aSpecialSlot, + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, + boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { // No Recipes? Well, nothing to be found then. if (mRecipeList.isEmpty()) return null; @@ -246,86 +225,75 @@ public class TCRecipeHandler { // Unification happens here in case the Input isn't already unificated. if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs); - // // Check the Recipe which has been used last time in order to not have to search for it again, + // // Check the Recipe which has been used last time in order to not have to search for it again, // if possible. - // if (aRecipe != null) - // if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, + // if (aRecipe != null) + // if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, // aDontCheckStackSizes, aFluids, aInputs)) { - // NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); - // NBTTagCompound givenNBT = ((ItemStack)aRecipe.mSpecialItems).getTagCompound(); - // Object aAspectListToCheck = null; - // Object aGivenAspectList = null; - // try { - // aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); - // aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); - // AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck,toCheckNBT); - // AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList,givenNBT); - // if + // NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); + // NBTTagCompound givenNBT = ((ItemStack)aRecipe.mSpecialItems).getTagCompound(); + // Object aAspectListToCheck = null; + // Object aGivenAspectList = null; + // try { + // aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); + // aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); + // AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck,toCheckNBT); + // AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList,givenNBT); + // if // (!TCRecipeHandler.TCRecipeMap.containsAspects(aAspectListToCheck,aGivenAspectList)) - // return null; - // } catch (InstantiationException | IllegalAccessException | InvocationTargetException + // return null; + // } catch (InstantiationException | IllegalAccessException | InvocationTargetException // e) { - // e.printStackTrace(); - // return null; - // } - // return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; - // } + // e.printStackTrace(); + // return null; + // } + // return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; + // } // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. - if (this.mUsualInputCount > 0 && aInputs != null) - for (ItemStack tStack : aInputs) - if (tStack != null) { - Collection tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack)); - if (tRecipes != null) - for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { - NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); - NBTTagCompound givenNBT = ((ItemStack) aRecipe.mSpecialItems).getTagCompound(); - Object aAspectListToCheck = null; - Object aGivenAspectList = null; - try { - aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); - aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); - AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck, toCheckNBT); - AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList, givenNBT); - if (!TCRecipeHandler.TCRecipeMap.containsAspects( - aAspectListToCheck, aGivenAspectList)) continue; - } catch (InstantiationException - | IllegalAccessException - | InvocationTargetException e) { - e.printStackTrace(); - return null; - } - return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; - } - tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(GT_Values.W, tStack))); - if (tRecipes != null) - for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) - && BW_Util.areStacksEqualOrNull( - (ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) { - NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); - NBTTagCompound givenNBT = ((ItemStack) aRecipe.mSpecialItems).getTagCompound(); - Object aAspectListToCheck = null; - Object aGivenAspectList = null; - try { - aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); - aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); - AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck, toCheckNBT); - AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList, givenNBT); - if (!TCRecipeHandler.TCRecipeMap.containsAspects( - aAspectListToCheck, aGivenAspectList)) continue; - } catch (InstantiationException - | IllegalAccessException - | InvocationTargetException e) { - e.printStackTrace(); - return null; - } - return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; - } - } + if (this.mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs) if (tStack != null) { + Collection tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack)); + if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { + NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); + NBTTagCompound givenNBT = ((ItemStack) aRecipe.mSpecialItems).getTagCompound(); + Object aAspectListToCheck = null; + Object aGivenAspectList = null; + try { + aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); + aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); + AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck, toCheckNBT); + AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList, givenNBT); + if (!TCRecipeHandler.TCRecipeMap.containsAspects(aAspectListToCheck, aGivenAspectList)) + continue; + } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { + e.printStackTrace(); + return null; + } + return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; + } + tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(GT_Values.W, tStack))); + if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) + && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) { + NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); + NBTTagCompound givenNBT = ((ItemStack) aRecipe.mSpecialItems).getTagCompound(); + Object aAspectListToCheck = null; + Object aGivenAspectList = null; + try { + aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); + aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); + AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck, toCheckNBT); + AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList, givenNBT); + if (!TCRecipeHandler.TCRecipeMap.containsAspects(aAspectListToCheck, aGivenAspectList)) + continue; + } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { + e.printStackTrace(); + return null; + } + return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; + } + } // And nothing has been found. return null; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java index ce5efcd1a4..4f01c81db1 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java @@ -1,32 +1,35 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.emt.tileentities.multi; import static gregtech.api.enums.GT_Values.V; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.crossmod.emt.recipe.TCRecipeHandler; import com.github.bartimaeusnek.crossmod.emt.util.EMTHandler; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -34,15 +37,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; @SuppressWarnings("ALL") public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlockBase { @@ -95,8 +89,8 @@ public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlo Object aspectList = EMTHandler.aAspectField.get(o); ThaumcraftHandler.AspectAdder.add.invoke(allAspects, aspectList); } - NBTTagCompound toWrite = (NBTTagCompound) - ThaumcraftHandler.AspectAdder.writeAspectListToNBT.invoke(allAspects, new NBTTagCompound()); + NBTTagCompound toWrite = (NBTTagCompound) ThaumcraftHandler.AspectAdder.writeAspectListToNBT + .invoke(allAspects, new NBTTagCompound()); stack.setTagCompound(toWrite); } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) { e.printStackTrace(); @@ -107,8 +101,8 @@ public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlo long tVoltage = this.getMaxInputVoltage(); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(tVoltage), V.length - 1)); - GT_Recipe tRecipe = TCRecipeHandler.alchemicalConstructHandler.findRecipe( - this.getBaseMetaTileEntity(), null, false, false, V[tTier], null, stack, tInputs); + GT_Recipe tRecipe = TCRecipeHandler.alchemicalConstructHandler + .findRecipe(this.getBaseMetaTileEntity(), null, false, false, V[tTier], null, stack, tInputs); ItemStack helper = (ItemStack) tRecipe.mSpecialItems; NBTTagCompound tagCompound = helper.getTagCompound(); String research = tagCompound.getCompoundTag("display").getString("Name"); @@ -183,8 +177,8 @@ public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlo } @Override - public ITexture[] getTexture( - IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, + boolean b4) { return new ITexture[0]; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java index b369480116..afc42577fe 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java @@ -1,39 +1,32 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.emt.util; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import java.lang.reflect.Field; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; + @SuppressWarnings("unchecked") public class EMTHandler { + public static Class aEssentiaInputHatch; public static Field aAspectField; static { try { - aEssentiaInputHatch = (Class) - Class.forName("emt.gthandler.common.implementations.EssentiaHatch"); + aEssentiaInputHatch = (Class) Class + .forName("emt.gthandler.common.implementations.EssentiaHatch"); aAspectField = aEssentiaInputHatch.getDeclaredField("current"); aAspectField.setAccessible(true); } catch (ClassNotFoundException | NoSuchFieldException e) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index f8e5827b0c..dfcdeddea5 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.galacticgreg; @@ -26,18 +17,32 @@ import static bloodasp.galacticgreg.registry.GalacticGregRegistry.getModContaine import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; import static gregtech.api.enums.GT_Values.VN; +import java.util.*; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.gen.ChunkProviderServer; +import net.minecraftforge.fluids.FluidStack; + import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_Layer_Space; import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_SmallPieces_Space; import bloodasp.galacticgreg.GalacticGreg; import bloodasp.galacticgreg.api.ModDimensionDef; import bloodasp.galacticgreg.bartworks.BW_Worldgen_Ore_Layer_Space; import bloodasp.galacticgreg.bartworks.BW_Worldgen_Ore_SmallOre_Space; + import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer; import com.github.bartimaeusnek.bartworks.util.Pair; import com.google.common.collect.ArrayListMultimap; + import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -49,28 +54,15 @@ import gregtech.api.util.GT_Utility; import gregtech.common.GT_Worldgen_GT_Ore_Layer; import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; -import java.util.*; -import java.util.function.Consumer; -import java.util.function.Predicate; -import java.util.stream.Collectors; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraft.world.gen.ChunkProviderServer; -import net.minecraftforge.fluids.FluidStack; @SuppressWarnings("ALL") public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_DrillerBase { - private static ArrayListMultimap, Float>> extraDropsDimMap = - ArrayListMultimap.create(); - private static FluidStack[] NOBLE_GASSES = new FluidStack[] { - WerkstoffLoader.Neon.getFluidOrGas(1), - WerkstoffLoader.Krypton.getFluidOrGas(1), - WerkstoffLoader.Xenon.getFluidOrGas(1), - WerkstoffLoader.Oganesson.getFluidOrGas(1) - }; + private static ArrayListMultimap, Float>> extraDropsDimMap = ArrayListMultimap + .create(); + private static FluidStack[] NOBLE_GASSES = new FluidStack[] { WerkstoffLoader.Neon.getFluidOrGas(1), + WerkstoffLoader.Krypton.getFluidOrGas(1), WerkstoffLoader.Xenon.getFluidOrGas(1), + WerkstoffLoader.Oganesson.getFluidOrGas(1) }; private HashMap, Float> dropmap = null; private float totalWeight; @@ -81,18 +73,18 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private boolean mBlacklist = false; /** - * Public method giving other mods the ability to add manually a material with an ore version into the external dromap for a specified dim id + * Public method giving other mods the ability to add manually a material with an ore version into the external + * dromap for a specified dim id + * * @param DimensionID the dim id targetted - * @param Material the material with an ore version - * @param weight the non normalised version of the given weight + * @param Material the material with an ore version + * @param weight the non normalised version of the given weight */ public static void addMatierialToDimensionList(int DimensionID, ISubTagContainer Material, float weight) { - if (Material instanceof Materials) - getExtraDropsDimMap() - .put(DimensionID, new Pair<>(new Pair<>(((Materials) Material).mMetaItemSubID, false), weight)); - else if (Material instanceof Werkstoff) - getExtraDropsDimMap() - .put(DimensionID, new Pair<>(new Pair<>((int) ((Werkstoff) Material).getmID(), true), weight)); + if (Material instanceof Materials) getExtraDropsDimMap() + .put(DimensionID, new Pair<>(new Pair<>(((Materials) Material).mMetaItemSubID, false), weight)); + else if (Material instanceof Werkstoff) getExtraDropsDimMap() + .put(DimensionID, new Pair<>(new Pair<>((int) ((Werkstoff) Material).getmID(), true), weight)); } // adding tellurium to OW to ensure a way to get it, as it's used in Magneto Resonatic Dust and Circuit Compound MK3 @@ -152,8 +144,8 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } @Override - protected boolean workingAtBottom( - ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, + int yHead, int oldYHead) { // if the dropmap has never been initialised or if the dropmap is empty if (dropmap == null || totalWeight == 0) calculateDropMap(); @@ -172,33 +164,30 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri String casings = getCasingBlockItem().get(0).getDisplayName(); final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Miner") - .addInfo("Controller Block for the Void Miner " + GT_Values.VN[this.getMinTier()]) + tt.addMachineType("Miner").addInfo("Controller Block for the Void Miner " + GT_Values.VN[this.getMinTier()]) .addInfo("Consumes " + GT_Values.V[this.getMinTier()] + "EU/t") .addInfo( "Can be supplied with 2L/s of Neon(x4), Krypton(x8), Xenon(x16) or Oganesson(x64) for higher outputs.") - .addInfo("Will output " + (2 * TIER_MULTIPLIER) - + " Ores per Second depending on the Dimension it is build in") + .addInfo( + "Will output " + (2 * TIER_MULTIPLIER) + + " Ores per Second depending on the Dimension it is build in") .addInfo("Put the Ore into the input bus to set the Whitelist/Blacklist") .addInfo("Use a screwdriver to toggle Whitelist/Blacklist") - .addInfo("Blacklist or non Whitelist Ore will be VOIDED") - .addSeparator() - .beginStructureBlock(3, 7, 3, false) - .addController("Front bottom") + .addInfo("Blacklist or non Whitelist Ore will be VOIDED").addSeparator() + .beginStructureBlock(3, 7, 3, false).addController("Front bottom") .addOtherStructurePart(casings, "form the 3x1x3 Base") .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") - .addEnergyHatch(VN[getMinTier()] + "+, Any base casing") - .addMaintenanceHatch("Any base casing") + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing").addMaintenanceHatch("Any base casing") .addInputBus("Mining Pipes or Ores, optional, any base casing") - .addInputHatch("Optional noble gas, any base casing") - .addOutputBus("Any base casing") + .addInputHatch("Optional noble gas, any base casing").addOutputBus("Any base casing") .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); return tt; } /** * getter for the external drop map + * * @return the extraDriosDimMap */ public static ArrayListMultimap, Float>> getExtraDropsDimMap() { @@ -207,6 +196,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Makes a predicate for the GT normal ore veins worldgen + * * @return the predicate */ private Predicate makeOreLayerPredicate() { @@ -220,9 +210,9 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri return gt_worldgen -> gt_worldgen.mEnd || gt_worldgen.mEndAsteroid; case 7: /* - explicitely giving different dim numbers so it default to false in the config, keeping compat - with the current worldgen config - */ + * explicitely giving different dim numbers so it default to false in the config, keeping compat with + * the current worldgen config + */ return gt_worldgen -> gt_worldgen.isGenerationAllowed(world, 0, 7); default: @@ -232,6 +222,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Makes a predicate for the GT normal small ore worldgen + * * @return the predicate */ private Predicate makeSmallOresPredicate() { @@ -245,9 +236,9 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri return gt_worldgen -> gt_worldgen.mEnd; case 7: /* - explicitely giving different dim numbers so it default to false in the config, keeping compat - with the current worldgen config - */ + * explicitely giving different dim numbers so it default to false in the config, keeping compat with + * the current worldgen config + */ return gt_worldgen -> gt_worldgen.isGenerationAllowed(world, 0, 7); default: throw new IllegalStateException(); @@ -256,25 +247,31 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Method used to add an ore to the droplist - * @param key a Pair of where the int is the meta of the ore, and the bool is true for BW ores, false for GT ores + * + * @param key a Pair of where the int is the meta of the ore, and the bool is true for BW ores, false + * for GT ores * @param value the non normalised weight */ private void addDrop(Pair key, float value) { final ItemStack ore = getOreItemStack(key); - if (ConfigHandler.voidMinerBlacklist.contains(String.format( - "%s:%d", GameRegistry.findUniqueIdentifierFor(ore.getItem()).toString(), ore.getItemDamage()))) return; + if (ConfigHandler.voidMinerBlacklist.contains( + String.format( + "%s:%d", + GameRegistry.findUniqueIdentifierFor(ore.getItem()).toString(), + ore.getItemDamage()))) + return; if (!dropmap.containsKey(key)) dropmap.put(key, value); else dropmap.put(key, dropmap.get(key) + value); } /** * Method to add the ores of a vanilla GT worldgen + * * @param oreLayerPredicate the predicate made by makeOreLayerPredicate */ private void getDropsVanillaVeins(Predicate oreLayerPredicate) { GT_Worldgen_GT_Ore_Layer.sList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled && oreLayerPredicate.test(gt_worldgen)) - .forEach(element -> { + .filter(gt_worldgen -> gt_worldgen.mEnabled && oreLayerPredicate.test(gt_worldgen)).forEach(element -> { addDrop(new Pair<>((int) element.mPrimaryMeta, false), (float) element.mWeight); addDrop(new Pair<>((int) element.mSecondaryMeta, false), (float) element.mWeight); addDrop(new Pair<>((int) element.mSporadicMeta, false), (element.mWeight / 8f)); @@ -284,6 +281,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Method to add the small ores of a vanilla GT worldgen + * * @param smallOresPredicate the predicate made by makeSmallOresPredicate */ private void getDropsVanillaSmallOres(Predicate smallOresPredicate) { @@ -294,20 +292,23 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * add to the dropmap the ores from the gagreg space worldgen corresponding to the target dim + * * @param finalDef ModDimensionDef corresponding to the target dim */ private void getDropsOreVeinsSpace(ModDimensionDef finalDef) { Set space = GalacticGreg.oreVeinWorldgenList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled - && gt_worldgen instanceof GT_Worldgen_GT_Ore_Layer_Space - && ((GT_Worldgen_GT_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) + .filter( + gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof GT_Worldgen_GT_Ore_Layer_Space + && ((GT_Worldgen_GT_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) .collect(Collectors.toSet()); space.forEach(element -> { - addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mPrimaryMeta, false), (float) - ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); - addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSecondaryMeta, false), (float) - ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); + addDrop( + new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mPrimaryMeta, false), + (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); + addDrop( + new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSecondaryMeta, false), + (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); addDrop( new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSporadicMeta, false), (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); @@ -319,22 +320,24 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * add to the dropmap the small ores from the gagreg space worldgen corresponding to the target dim + * * @param finalDef ModDimensionDef corresponding to the target dim */ private void getDropsSmallOreSpace(ModDimensionDef finalDef) { - Set space = GalacticGreg.smallOreWorldgenList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled - && gt_worldgen instanceof GT_Worldgen_GT_Ore_SmallPieces_Space + Set space = GalacticGreg.smallOreWorldgenList.stream().filter( + gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof GT_Worldgen_GT_Ore_SmallPieces_Space && ((GT_Worldgen_GT_Ore_SmallPieces_Space) gt_worldgen).isEnabledForDim(finalDef)) .collect(Collectors.toSet()); - space.forEach(element -> - addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mMeta, false), (float) - ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mAmount)); + space.forEach( + element -> addDrop( + new Pair<>((int) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mMeta, false), + (float) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mAmount)); } /** * method used to pick the next key in the dropmap that will be used to generate the ore. + * * @return the chosen key */ private Pair getOreDamage() { @@ -350,6 +353,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Method used to check the current gat and its corresponding multiplier + * * @return the noble gas in the hatch. returns null if there is no noble gas found. */ private FluidStack getNobleGasInputAndSetMultiplier() { @@ -367,6 +371,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * method used to decrement the quantity of gas in the hatch + * * @param gasToConsume the fluid stack in the hatch * @return if yes or no it was able to decrement the quantity of the fluidstack */ @@ -391,20 +396,21 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Handles the addition of Ross dims' ores into the drop map + * * @param aID dim id of Ross128b or Ross128ba */ private void getDropMapRoss(int aID) { Consumer addToList = makeAddToList(); BW_OreLayer.sList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled - && gt_worldgen instanceof BW_OreLayer - && gt_worldgen.isGenerationAllowed(null, aID, 0)) - .collect(Collectors.toSet()) - .forEach(addToList); + .filter( + gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_OreLayer + && gt_worldgen.isGenerationAllowed(null, aID, 0)) + .collect(Collectors.toSet()).forEach(addToList); } /** * Method used to generate a consumer used specifically to add BW ores into the dropmap + * * @return the consumer */ private Consumer makeAddToList() { @@ -419,63 +425,61 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Method used to build the ModDimensionDef object corresponding to the dimension the VM is in. + * * @return the ModDimensionDef object. */ private ModDimensionDef makeModDimDef() { - return getModContainers().stream() - .flatMap(modContainer -> modContainer.getDimensionList().stream()) - .filter(modDimensionDef -> modDimensionDef - .getChunkProviderName() - .equals(((ChunkProviderServer) - this.getBaseMetaTileEntity().getWorld().getChunkProvider()) - .currentChunkProvider - .getClass() - .getName())) - .findFirst() - .orElse(null); + return getModContainers().stream().flatMap(modContainer -> modContainer.getDimensionList().stream()) + .filter( + modDimensionDef -> modDimensionDef.getChunkProviderName().equals( + ((ChunkProviderServer) this.getBaseMetaTileEntity().getWorld() + .getChunkProvider()).currentChunkProvider.getClass().getName())) + .findFirst().orElse(null); } /** * Handles the addition of small ores for bartwork dims - * @param finalDef the ModDimensionDef object corresponding to the dim + * + * @param finalDef the ModDimensionDef object corresponding to the dim * @param addToList a consumer used to add the ores from the vein with proper weight */ private void addOresVeinsBartworks(ModDimensionDef finalDef, Consumer addToList) { try { Set space = GalacticGreg.oreVeinWorldgenList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled - && gt_worldgen instanceof BW_Worldgen_Ore_Layer_Space - && ((BW_Worldgen_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) + .filter( + gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_Worldgen_Ore_Layer_Space + && ((BW_Worldgen_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) .collect(Collectors.toSet()); space.forEach(addToList); - } catch (NullPointerException ignored) { - } + } catch (NullPointerException ignored) {} } /** * Handles the addition of small ores for bartwork dims + * * @param finalDef the ModDimensionDef object corresponding to the dim */ private void addSmallOresBartworks(ModDimensionDef finalDef) { try { Set space = GalacticGreg.smallOreWorldgenList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled - && gt_worldgen instanceof BW_Worldgen_Ore_SmallOre_Space - && ((BW_Worldgen_Ore_SmallOre_Space) gt_worldgen).isEnabledForDim(finalDef)) + .filter( + gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_Worldgen_Ore_SmallOre_Space + && ((BW_Worldgen_Ore_SmallOre_Space) gt_worldgen).isEnabledForDim(finalDef)) .collect(Collectors.toSet()); - space.forEach(element -> addDrop( - new Pair<>( - ((BW_Worldgen_Ore_SmallOre_Space) element).mPrimaryMeta, - ((BW_Worldgen_Ore_SmallOre_Space) element).bwOres != 0), - (float) ((BW_Worldgen_Ore_SmallOre_Space) element).mDensity)); - } catch (NullPointerException ignored) { - } + space.forEach( + element -> addDrop( + new Pair<>( + ((BW_Worldgen_Ore_SmallOre_Space) element).mPrimaryMeta, + ((BW_Worldgen_Ore_SmallOre_Space) element).bwOres != 0), + (float) ((BW_Worldgen_Ore_SmallOre_Space) element).mDensity)); + } catch (NullPointerException ignored) {} } /** * Handles the ores added manually with addMatierialToDimensionList + * * @param id the specified dim id */ private void handleExtraDrops(int id) { @@ -493,6 +497,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Computes the ores of the dim for the specifed dim id + * * @param id the dim number */ private void handleModDimDef(int id) { @@ -521,7 +526,8 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } /** - * Computes first the ores related to the dim the VM is in, then the ores added manually, then it computes the totalweight for normalisation + * Computes first the ores related to the dim the VM is in, then the ores added manually, then it computes the + * totalweight for normalisation */ private void calculateDropMap() { dropmap = new HashMap<>(); @@ -536,8 +542,8 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private void handleOutputs() { Pair stats = getOreDamage(); - final List inputOres = - this.getStoredInputs().stream().filter(GT_Utility::isOre).collect(Collectors.toList()); + final List inputOres = this.getStoredInputs().stream().filter(GT_Utility::isOre) + .collect(Collectors.toList()); final ItemStack output = getOreItemStack(stats); if (inputOres.size() == 0 || (mBlacklist && inputOres.stream().allMatch(is -> !GT_Utility.areStacksEqual(is, output))) @@ -548,12 +554,16 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Builds the ore item stack from the key specified in the dropmap + * * @param stats the key of the dropmap - * @return an ItemStack corresponding to the target ore, with a stacksize corresponding to the mutiplier induced by the gas used + * @return an ItemStack corresponding to the target ore, with a stacksize corresponding to the mutiplier induced by + * the gas used */ private ItemStack getOreItemStack(Pair stats) { return new ItemStack( - stats.getValue() ? WerkstoffLoader.BWOres : GregTech_API.sBlockOres1, multiplier, stats.getKey()); + stats.getValue() ? WerkstoffLoader.BWOres : GregTech_API.sBlockOres1, + multiplier, + stats.getKey()); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java index 6898b81ded..5f15bd6c09 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.galacticgreg; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java index d458ea07af..5d61796164 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java @@ -1,42 +1,37 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.galacticraft; +import java.io.File; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.config.Configuration; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128ba; import com.github.bartimaeusnek.crossmod.galacticraft.atmosphere.BWAtmosphereManager; import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; + import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import gregtech.api.objects.GT_UO_DimensionList; -import java.io.File; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; public class GalacticraftProxy { + public static GT_UO_DimensionList uo_dimensionList = new GT_UO_DimensionList(); static Configuration gtConf; @@ -65,8 +60,8 @@ public class GalacticraftProxy { private static void clientpreInit(FMLPreInitializationEvent e) {} private static void commonpreInit(FMLPreInitializationEvent e) { - GalacticraftProxy.gtConf = - new Configuration(new File(new File(e.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg")); + GalacticraftProxy.gtConf = new Configuration( + new File(new File(e.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg")); GalacticraftProxy.uo_dimensionList.getConfig(GalacticraftProxy.gtConf, "undergroundfluid"); BW_WorldGenRoss128b.initundergroundFluids(); BW_WorldGenRoss128ba.init_undergroundFluids(); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java index a0381dd0e9..d777bfa250 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java @@ -1,34 +1,27 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.galacticraft; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import micdoodle8.mods.galacticraft.core.entities.EntityLander; import micdoodle8.mods.galacticraft.core.entities.EntityLanderBase; import micdoodle8.mods.galacticraft.planets.asteroids.entities.EntityEntryPod; import micdoodle8.mods.galacticraft.planets.mars.entities.EntityLandingBalloons; + import net.minecraft.entity.player.EntityPlayerMP; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; + public class PlanetsHelperClass { public static EntityLanderBase getLanderType(EntityPlayerMP player) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java index ff53bfcfa8..0a030d8b7f 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java @@ -1,39 +1,33 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.galacticraft; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import java.util.Random; + import micdoodle8.mods.galacticraft.api.vector.Vector3; import micdoodle8.mods.galacticraft.api.world.ITeleportType; import micdoodle8.mods.galacticraft.core.entities.EntityLander; import micdoodle8.mods.galacticraft.core.entities.EntityLanderBase; import micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats; + import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.world.World; import net.minecraft.world.WorldServer; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; + public class UniversalTeleportType implements ITeleportType { @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java index 79f4db3734..efc3323195 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java @@ -1,61 +1,55 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.galacticraft.atmosphere; +import java.util.*; + +import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; +import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; +import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.google.common.collect.ArrayListMultimap; + import cpw.mods.fml.common.eventhandler.SubscribeEvent; import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; -import java.util.*; -import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; -import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; -import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; -@SuppressWarnings({"unused", "RedundantSuppression"}) +@SuppressWarnings({ "unused", "RedundantSuppression" }) public final class BWAtmosphereManager { private static final Map COEFFICIENT_MAP = new HashMap<>(); private BWAtmosphereManager() { - BWAtmosphereManager.COEFFICIENT_MAP.put(1, new Integer[] {100}); - BWAtmosphereManager.COEFFICIENT_MAP.put(2, new Integer[] {70, 30}); - BWAtmosphereManager.COEFFICIENT_MAP.put(3, new Integer[] {60, 25, 15}); - BWAtmosphereManager.COEFFICIENT_MAP.put(4, new Integer[] {50, 25, 15, 10}); - BWAtmosphereManager.COEFFICIENT_MAP.put(5, new Integer[] {45, 25, 15, 10, 5}); - BWAtmosphereManager.COEFFICIENT_MAP.put(6, new Integer[] {45, 20, 15, 10, 5, 5}); - BWAtmosphereManager.COEFFICIENT_MAP.put(7, new Integer[] {40, 20, 15, 10, 5, 5, 5}); - BWAtmosphereManager.COEFFICIENT_MAP.put(8, new Integer[] {35, 20, 15, 10, 5, 5, 5, 5}); - BWAtmosphereManager.COEFFICIENT_MAP.put(9, new Integer[] {35, 15, 15, 10, 5, 5, 5, 5, 5}); + BWAtmosphereManager.COEFFICIENT_MAP.put(1, new Integer[] { 100 }); + BWAtmosphereManager.COEFFICIENT_MAP.put(2, new Integer[] { 70, 30 }); + BWAtmosphereManager.COEFFICIENT_MAP.put(3, new Integer[] { 60, 25, 15 }); + BWAtmosphereManager.COEFFICIENT_MAP.put(4, new Integer[] { 50, 25, 15, 10 }); + BWAtmosphereManager.COEFFICIENT_MAP.put(5, new Integer[] { 45, 25, 15, 10, 5 }); + BWAtmosphereManager.COEFFICIENT_MAP.put(6, new Integer[] { 45, 20, 15, 10, 5, 5 }); + BWAtmosphereManager.COEFFICIENT_MAP.put(7, new Integer[] { 40, 20, 15, 10, 5, 5, 5 }); + BWAtmosphereManager.COEFFICIENT_MAP.put(8, new Integer[] { 35, 20, 15, 10, 5, 5, 5, 5 }); + BWAtmosphereManager.COEFFICIENT_MAP.put(9, new Integer[] { 35, 15, 15, 10, 5, 5, 5, 5, 5 }); } public static final BWAtmosphereManager INSTANCE = new BWAtmosphereManager(); - private static final ArrayListMultimap> gasConcentration = - ArrayListMultimap.create(); + private static final ArrayListMultimap> gasConcentration = ArrayListMultimap + .create(); public static List> getGasFromWorldID(int worldID) { return BWAtmosphereManager.gasConcentration.get(worldID); @@ -101,8 +95,7 @@ public final class BWAtmosphereManager { if (mat == Werkstoff.default_null_Werkstoff) { return false; } - BWAtmosphereManager.addGasToWorld( - worldID, mat, BWAtmosphereManager.COEFFICIENT_MAP.get(aMaxNumber)[aNumber]); + BWAtmosphereManager.addGasToWorld(worldID, mat, BWAtmosphereManager.COEFFICIENT_MAP.get(aMaxNumber)[aNumber]); return true; } @@ -110,10 +103,12 @@ public final class BWAtmosphereManager { public void gcAutoRegister(GalaxyRegistry.PlanetRegisterEvent event) { CelestialBody planet = GalaxyRegistry.getRegisteredPlanets().get(event.planetName); for (int i = 0; i < planet.atmosphere.size(); i++) { - if (!BWAtmosphereManager.addGCGasToWorld( - planet.getDimensionID(), planet.atmosphere.get(i), i, planet.atmosphere.size())) - BartWorksCrossmod.LOGGER.warn("Unidentified Fluid (" + planet.atmosphere.get(i) - + ") in the Atmosphere of: " + planet.getLocalizedName()); + if (!BWAtmosphereManager + .addGCGasToWorld(planet.getDimensionID(), planet.atmosphere.get(i), i, planet.atmosphere.size())) + BartWorksCrossmod.LOGGER.warn( + "Unidentified Fluid (" + planet.atmosphere.get(i) + + ") in the Atmosphere of: " + + planet.getLocalizedName()); } } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java index 04d4e41cb8..af9d9647af 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java @@ -1,33 +1,25 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.galacticraft.blocks; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; -import com.github.bartimaeusnek.crossmod.galacticraft.creativetabs.SpaceTab; import net.minecraft.block.material.Material; import net.minecraft.entity.EnumCreatureType; import net.minecraft.world.IBlockAccess; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; +import com.github.bartimaeusnek.crossmod.galacticraft.creativetabs.SpaceTab; + public class UniversalSpaceBlocks extends BW_Blocks { public UniversalSpaceBlocks(String name, String[] texture) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java index b44120bf34..5d9b9c3cc1 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java @@ -1,31 +1,23 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.galacticraft.creativetabs; -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; + public class SpaceTab extends CreativeTabs { private static final SpaceTab instance = new SpaceTab("SpaceTab"); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java index 5f1d2a98e6..33f4f6f9ae 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.galacticraft.planets; @@ -27,6 +18,7 @@ import micdoodle8.mods.galacticraft.api.world.IExitHeight; import micdoodle8.mods.galacticraft.api.world.ISolarLevel; public abstract class AbstractWorldProviderSpace extends WorldProviderSpace implements IExitHeight, ISolarLevel { + @Override public boolean canRainOrSnow() { return false; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index 2d5928bb37..89330e3d45 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b; @@ -25,13 +16,8 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b; import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE; import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.system.oregen.BW_WordGenerator; -import com.github.bartimaeusnek.bartworks.system.worldgen.MapGenRuins; -import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; -import gregtech.api.objects.XSTR; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.BlockFalling; import net.minecraft.entity.EnumCreatureType; @@ -49,7 +35,15 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.PopulateChunkEvent; import net.minecraftforge.event.terraingen.TerrainGen; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.system.oregen.BW_WordGenerator; +import com.github.bartimaeusnek.bartworks.system.worldgen.MapGenRuins; +import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; +import gregtech.api.objects.XSTR; + public class ChunkProviderRoss128b extends ChunkProviderGenerate { + XSTR rand = new XSTR(); private BiomeGenBase[] biomesForGeneration; public static final BW_WordGenerator BWOreGen = new BW_WordGenerator(); @@ -74,8 +68,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { Block[] ablock = new Block[65536]; byte[] abyte = new byte[65536]; this.func_147424_a(p_73154_1_, p_73154_2_, ablock); - this.biomesForGeneration = this.worldObj - .getWorldChunkManager() + this.biomesForGeneration = this.worldObj.getWorldChunkManager() .loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); for (int i = 0; i < this.biomesForGeneration.length; i++) { BiomeGenBase biomeGenBase = this.biomesForGeneration[i]; @@ -120,14 +113,13 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { this.rand.setSeed((long) p_73153_2_ * i1 + (long) p_73153_3_ * j1 ^ this.worldObj.getSeed()); } - MinecraftForge.EVENT_BUS.post( - new PopulateChunkEvent.Pre(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); + MinecraftForge.EVENT_BUS + .post(new PopulateChunkEvent.Pre(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); int x1; int y1; int z1; - if (biomegenbase != BiomeGenBase.desert - && biomegenbase != BiomeGenBase.desertHills + if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, LAKE)) { x1 = k + this.rand.nextInt(16) + 8; y1 = this.rand.nextInt(256); @@ -136,8 +128,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { if (rni == 0) (new WorldGenLakes(Blocks.ice)).generate(this.worldObj, this.rand, x1, y1, z1); else if (rni == 4) (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, x1, y1, z1); } - if (biomegenbase != BiomeGenBase.ocean - && biomegenbase != BiomeGenBase.deepOcean + if (biomegenbase != BiomeGenBase.ocean && biomegenbase != BiomeGenBase.deepOcean && biomegenbase != BiomeGenBase.river && biomegenbase != BiomeGenBase.frozenOcean && biomegenbase != BiomeGenBase.frozenRiver @@ -169,8 +160,8 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { } BWOreGen.generate(this.rand, p_73153_2_, p_73153_3_, this.worldObj, this, this); - MinecraftForge.EVENT_BUS.post( - new PopulateChunkEvent.Post(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); + MinecraftForge.EVENT_BUS + .post(new PopulateChunkEvent.Post(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); BlockFalling.fallInstantly = false; } @@ -179,8 +170,8 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { public void recreateStructures(int p_82695_1_, int p_82695_2_) {} @Override - public void replaceBlocksForBiome( - int p_147422_1_, int p_147422_2_, Block[] blocks, byte[] metas, BiomeGenBase[] p_147422_5_) { + public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] blocks, byte[] metas, + BiomeGenBase[] p_147422_5_) { super.replaceBlocksForBiome(p_147422_1_, p_147422_2_, blocks, metas, p_147422_5_); for (int i = 0; i < blocks.length; i++) { if (blocks[i] == Blocks.grass) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java index e8962ed14a..26ad8d9d7a 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java @@ -1,32 +1,25 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b; -import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import net.minecraft.util.ResourceLocation; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; + public class SkyProviderRoss128b { + // ASM enables this texture - public static final ResourceLocation sunTex = - new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/World/SunRoss128.png"); + public static final ResourceLocation sunTex = new ResourceLocation( + BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/World/SunRoss128.png"); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java index 5a6c5b6dca..b67dbe6503 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java @@ -1,38 +1,32 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.AbstractWorldProviderSpace; -import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; import micdoodle8.mods.galacticraft.api.vector.Vector3; + import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; import net.minecraft.world.biome.WorldChunkManager; import net.minecraft.world.chunk.IChunkProvider; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.AbstractWorldProviderSpace; +import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class WorldProviderRoss128b extends AbstractWorldProviderSpace { @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java index ec7ecb17c1..96108217e9 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java @@ -1,37 +1,27 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba; -import com.github.bartimaeusnek.bartworks.util.NoiseUtil.BartsNoise; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.ChunkProviderRoss128b; -import gregtech.api.objects.XSTR; import java.util.Arrays; import java.util.Random; + import micdoodle8.mods.galacticraft.api.prefab.world.gen.MapGenBaseMeta; import micdoodle8.mods.galacticraft.core.blocks.GCBlocks; import micdoodle8.mods.galacticraft.core.world.gen.BiomeGenBaseMoon; import micdoodle8.mods.galacticraft.core.world.gen.ChunkProviderMoon; import micdoodle8.mods.galacticraft.core.world.gen.MapGenCavesMoon; + import net.minecraft.block.Block; import net.minecraft.block.BlockFalling; import net.minecraft.init.Blocks; @@ -40,6 +30,10 @@ import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; +import com.github.bartimaeusnek.bartworks.util.NoiseUtil.BartsNoise; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.ChunkProviderRoss128b; +import gregtech.api.objects.XSTR; + public class ChunkProviderRoss128ba extends ChunkProviderMoon { private final XSTR rand = new XSTR(); @@ -49,7 +43,7 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { public ChunkProviderRoss128ba(World world, long seed, boolean mapFeaturesEnabled) { super(world, seed, mapFeaturesEnabled); - this.biomesForGeneration = new BiomeGenBase[] {BiomeGenBaseMoon.moonFlat}; + this.biomesForGeneration = new BiomeGenBase[] { BiomeGenBaseMoon.moonFlat }; this.caveGenerator = new MapGenCavesMoon(); this.worldObj = world; } @@ -60,8 +54,7 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { byte[] meta = new byte[65536]; Arrays.fill(ids, Blocks.air); this.generateTerrain(cx, cz, ids, meta); - this.biomesForGeneration = this.worldObj - .getWorldChunkManager() + this.biomesForGeneration = this.worldObj.getWorldChunkManager() .loadBlockGeneratorData(this.biomesForGeneration, cx * 16, cz * 16, 16, 16); this.createCraters(cx, cz, ids, meta); this.replaceBlocksForBiome(cx, cz, ids, meta, this.biomesForGeneration); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java index c51fe51611..7dfa0ab446 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java @@ -1,37 +1,31 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba; -import com.github.bartimaeusnek.bartworks.util.MathUtils; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.AbstractWorldProviderSpace; -import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; import micdoodle8.mods.galacticraft.api.vector.Vector3; import micdoodle8.mods.galacticraft.core.world.gen.WorldChunkManagerMoon; + import net.minecraft.world.biome.WorldChunkManager; import net.minecraft.world.chunk.IChunkProvider; +import com.github.bartimaeusnek.bartworks.util.MathUtils; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.AbstractWorldProviderSpace; +import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; + public class WorldProviderRoss128ba extends AbstractWorldProviderSpace { + @Override public Vector3 getFogColor() { return new Vector3(0, 0, 0); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index 6bc6aafc09..1ce3a61058 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -1,41 +1,35 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.galacticraft.solarsystems; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; -import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.WorldProviderRoss128b; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba.WorldProviderRoss128ba; import java.util.Arrays; + import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; import micdoodle8.mods.galacticraft.api.galaxies.*; import micdoodle8.mods.galacticraft.api.vector.Vector3; import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; import micdoodle8.mods.galacticraft.core.GalacticraftCore; + import net.minecraft.util.ResourceLocation; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.WorldProviderRoss128b; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba.WorldProviderRoss128ba; + public class Ross128SolarSystem { public static SolarSystem Ross128System; @@ -47,10 +41,9 @@ public class Ross128SolarSystem { public static void init() { - Ross128SolarSystem.Ross128System = - new SolarSystem("Ross128System", "milkyWay").setMapPosition(new Vector3(-1.0D, 1.3D, 0.0D)); - Ross128SolarSystem.Ross128 = (Star) new Star("Ross128") - .setParentSolarSystem(Ross128SolarSystem.Ross128System) + Ross128SolarSystem.Ross128System = new SolarSystem("Ross128System", "milkyWay") + .setMapPosition(new Vector3(-1.0D, 1.3D, 0.0D)); + Ross128SolarSystem.Ross128 = (Star) new Star("Ross128").setParentSolarSystem(Ross128SolarSystem.Ross128System) .setTierRequired(-1); Ross128SolarSystem.Ross128.setUnreachable(); Ross128SolarSystem.Ross128.setBodyIcon( @@ -64,8 +57,8 @@ public class Ross128SolarSystem { new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128b.png")); Ross128SolarSystem.Ross128b.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(0.75F, 1.75F)); Ross128SolarSystem.Ross128b.setRelativeOrbitTime(0.65F); - Ross128SolarSystem.Ross128b.atmosphere.addAll( - Arrays.asList(IAtmosphericGas.OXYGEN, IAtmosphericGas.NITROGEN, IAtmosphericGas.ARGON)); + Ross128SolarSystem.Ross128b.atmosphere + .addAll(Arrays.asList(IAtmosphericGas.OXYGEN, IAtmosphericGas.NITROGEN, IAtmosphericGas.ARGON)); Ross128SolarSystem.Ross128b.setDimensionInfo(ConfigHandler.ross128BID, WorldProviderRoss128b.class); Ross128SolarSystem.Ross128b.setTierRequired(ConfigHandler.ross128btier); @@ -75,8 +68,8 @@ public class Ross128SolarSystem { Ross128SolarSystem.Ross128ba.setBodyIcon( new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128ba.class); - Ross128SolarSystem.Ross128ba.setTierRequired( - LoaderReference.GalaxySpace ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3); + Ross128SolarSystem.Ross128ba + .setTierRequired(LoaderReference.GalaxySpace ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3); GalaxyRegistry.registerSolarSystem(Ross128SolarSystem.Ross128System); GalaxyRegistry.registerPlanet(Ross128SolarSystem.Ross128b); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java index e2271aaeff..b5d7e7cb5d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java @@ -1,38 +1,32 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.galaxySpace.tileEntity; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; import micdoodle8.mods.galacticraft.core.GalacticraftCore; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; + public class DysonSwarmSunReplacement extends MetaTileEntity { + private static boolean wasBuild; private static long dysonObjs; private static long swarmControllers; @@ -47,16 +41,12 @@ public class DysonSwarmSunReplacement extends MetaTileEntity { public void toggle() { if (!wasBuild) { - GalacticraftCore.solarSystemSol - .getMainStar() - .setBodyIcon(new ResourceLocation( - GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/moon.png")); + GalacticraftCore.solarSystemSol.getMainStar().setBodyIcon( + new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/moon.png")); wasBuild = !wasBuild; } else { - GalacticraftCore.solarSystemSol - .getMainStar() - .setBodyIcon(new ResourceLocation( - GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/sun.png")); + GalacticraftCore.solarSystemSol.getMainStar().setBodyIcon( + new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/sun.png")); wasBuild = !wasBuild; } } @@ -94,8 +84,8 @@ public class DysonSwarmSunReplacement extends MetaTileEntity { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - aBaseMetaTileEntity.increaseStoredEnergyUnits( - (DysonSwarmSunReplacement.dysonObjs * 10000) / swarmControllers, true); + aBaseMetaTileEntity + .increaseStoredEnergyUnits((DysonSwarmSunReplacement.dysonObjs * 10000) / swarmControllers, true); } public boolean isEnetOutput() { @@ -118,8 +108,8 @@ public class DysonSwarmSunReplacement extends MetaTileEntity { } @Override - public ITexture[] getTexture( - IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, + boolean b4) { return new ITexture[0]; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java index 77dc5c2c22..1bdcc942ba 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.galaxySpace.tileEntity; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java index ea4e349ca8..0502f26f9c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java @@ -1,30 +1,22 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.openComputers; +import net.minecraft.nbt.NBTTagCompound; + import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; -import net.minecraft.nbt.NBTTagCompound; public class GT_NBT_DataBase { @@ -96,8 +88,8 @@ public class GT_NBT_DataBase { this.id = id; } - public static GT_NBT_DataBase makeNewWithoutRegister( - String mDataName, String mDataTitle, NBTTagCompound tagCompound) { + public static GT_NBT_DataBase makeNewWithoutRegister(String mDataName, String mDataTitle, + NBTTagCompound tagCompound) { return new GT_NBT_DataBase(tagCompound, mDataName, mDataTitle, Long.MIN_VALUE); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java index 80c52c56a3..30c2b3b1d7 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java @@ -1,49 +1,44 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.openComputers; -import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; -import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; -import com.github.bartimaeusnek.bartworks.API.SideReference; -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; -import cpw.mods.fml.common.Optional; -import gregtech.api.enums.ItemList; -import gregtech.api.util.GT_Utility; -import gregtech.common.items.behaviors.Behaviour_DataOrb; import java.util.HashSet; import java.util.Map; import java.util.Set; + import li.cil.oc.api.machine.Arguments; import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; import li.cil.oc.api.network.SimpleComponent; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; +import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; +import com.github.bartimaeusnek.bartworks.API.SideReference; +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; + +import cpw.mods.fml.common.Optional; +import gregtech.api.enums.ItemList; +import gregtech.api.util.GT_Utility; +import gregtech.common.items.behaviors.Behaviour_DataOrb; + @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers") public class TileEntity_GTDataServer extends TileEntity implements ISidedInventory, ITileAddsInformation, ITileHasDifferentTextureSides, SimpleComponent { @@ -63,8 +58,7 @@ public class TileEntity_GTDataServer extends TileEntity public Object[] listData(Context context, Arguments args) { Set ret = new HashSet<>(); for (Map.Entry entry : OrbDataBase.entrySet()) { - ret.add((entry.getValue().getId() + Long.MAX_VALUE) + ". " - + entry.getValue().getmDataTitle()); + ret.add((entry.getValue().getId() + Long.MAX_VALUE) + ". " + entry.getValue().getmDataTitle()); } return ret.toArray(new String[0]); } @@ -72,7 +66,7 @@ public class TileEntity_GTDataServer extends TileEntity @Optional.Method(modid = "OpenComputers") @Callback public Object[] imprintOrb(Context context, Arguments args) { - return new Object[] {false}; + return new Object[] { false }; } private boolean isServerSide() { @@ -107,10 +101,9 @@ public class TileEntity_GTDataServer extends TileEntity short mapID = GT_Utility.ItemNBT.getMapID(this.mItems[0]); byte data = (byte) (bookTitle.isEmpty() ? punchcardData.isEmpty() ? mapID != -1 ? 3 : -1 : 2 : 1); - String title = - data == 1 ? bookTitle : data == 2 ? punchcardData : data == 3 ? "" + mapID : "Custom Data"; - String name = data == 1 - ? "eBook" + String title = data == 1 ? bookTitle + : data == 2 ? punchcardData : data == 3 ? "" + mapID : "Custom Data"; + String name = data == 1 ? "eBook" : data == 2 ? "Punch Card Data" : data == 3 ? "Map Data" : "Custom Data"; if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) { this.OrbDataBase.put( diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java index 7caac936d5..360ccff458 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java @@ -1,38 +1,31 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.tectech; +import java.util.ArrayList; +import java.util.Iterator; + import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; + import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import java.util.ArrayList; -import java.util.Iterator; -@SuppressWarnings({"unused", "RedundantSuppression"}) +@SuppressWarnings({ "unused", "RedundantSuppression" }) public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { ArrayList mTTEnergyHatches = new ArrayList<>(); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java index 593fcf33b8..f5e07545b1 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java @@ -1,38 +1,32 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.tectech; +import java.util.List; + +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; + import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel; + import gregtech.api.enums.GT_Values; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Utility; -import java.util.List; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; public interface TecTechEnabledMulti { @@ -57,7 +51,7 @@ public interface TecTechEnabledMulti { maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); } } - return new long[] {storedEnergy, maxEnergy}; + return new long[] { storedEnergy, maxEnergy }; } default String[] getInfoDataArray(GT_MetaTileEntity_MultiBlockBase multiBlockBase) { @@ -81,29 +75,55 @@ public interface TecTechEnabledMulti { } return new String[] { - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(multiBlockBase.mProgresstime / 20) + EnumChatFormatting.RESET + " s / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(multiBlockBase.mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", - StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED - + GT_Utility.formatNumbers(-multiBlockBase.mEUt) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(multiBlockBase.getMaxInputVoltage()) + EnumChatFormatting.RESET - + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") - + ": " + EnumChatFormatting.YELLOW - + GT_Values.VN[GT_Utility.getTier(multiBlockBase.getMaxInputVoltage())] + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED - + (multiBlockBase.getIdealStatus() - multiBlockBase.getRepairStatus()) + EnumChatFormatting.RESET - + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") - + ": " + EnumChatFormatting.YELLOW - + (float) multiBlockBase.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN - + mPollutionReduction + EnumChatFormatting.RESET + " %", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() - }; + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(multiBlockBase.mProgresstime / 20) + + EnumChatFormatting.RESET + + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(multiBlockBase.mMaxProgresstime / 20) + + EnumChatFormatting.RESET + + " s", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(-multiBlockBase.mEUt) + + EnumChatFormatting.RESET + + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(multiBlockBase.getMaxInputVoltage()) + + EnumChatFormatting.RESET + + " EU/t(*2A) " + + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + + EnumChatFormatting.YELLOW + + GT_Values.VN[GT_Utility.getTier(multiBlockBase.getMaxInputVoltage())] + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + + (multiBlockBase.getIdealStatus() - multiBlockBase.getRepairStatus()) + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + + EnumChatFormatting.YELLOW + + (float) multiBlockBase.mEfficiency / 100.0F + + EnumChatFormatting.RESET + + " %", + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + + EnumChatFormatting.GREEN + + mPollutionReduction + + EnumChatFormatting.RESET + + " %", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java index 83d1604d11..67c0ea56f3 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java @@ -1,39 +1,32 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.tectech; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.technus.tectech.recipe.TT_recipeAdder; + import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; public class TecTechResearchLoader { @@ -51,17 +44,13 @@ public class TecTechResearchLoader { 256, BW_Util.getMachineVoltageFromTier(7), 24, - new Object[] { - ItemRegistry.voidminer[0].copy(), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), - Materials.BlackPlutonium.getPlates(3), - ItemList.Electric_Motor_ZPM.get(9L), - ItemList.Sensor_ZPM.get(9L), - ItemList.Field_Generator_ZPM.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) - }, - new FluidStack[] {new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Krypton.getFluidOrGas(20000) - }, + new Object[] { ItemRegistry.voidminer[0].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), + Materials.BlackPlutonium.getPlates(3), ItemList.Electric_Motor_ZPM.get(9L), + ItemList.Sensor_ZPM.get(9L), ItemList.Field_Generator_ZPM.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) }, + new FluidStack[] { new FluidStack(solderIndalloy, 1440), + WerkstoffLoader.Krypton.getFluidOrGas(20000) }, ItemRegistry.voidminer[1].copy(), 216000, BW_Util.getMachineVoltageFromTier(7)); @@ -72,18 +61,13 @@ public class TecTechResearchLoader { 512, BW_Util.getMachineVoltageFromTier(8), 64, - new Object[] { - ItemRegistry.voidminer[1].copy(), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), - Materials.Neutronium.getPlates(3), - ItemList.Electric_Motor_UV.get(9L), - ItemList.Sensor_UV.get(9L), - ItemList.Field_Generator_UV.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) - }, - new FluidStack[] { - new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Oganesson.getFluidOrGas(20000) - }, + new Object[] { ItemRegistry.voidminer[1].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), + Materials.Neutronium.getPlates(3), ItemList.Electric_Motor_UV.get(9L), + ItemList.Sensor_UV.get(9L), ItemList.Field_Generator_UV.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) }, + new FluidStack[] { new FluidStack(solderIndalloy, 1440), + WerkstoffLoader.Oganesson.getFluidOrGas(20000) }, ItemRegistry.voidminer[2].copy(), 432000, BW_Util.getMachineVoltageFromTier(8)); @@ -95,50 +79,44 @@ public class TecTechResearchLoader { 48, BW_Util.getMachineVoltageFromTier(8), 8, - new Object[] { - ItemList.Machine_Multi_ImplosionCompressor.get(1L), - Materials.Neutronium.getBlocks(5), - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64), - ItemList.Electric_Piston_UV.get(64), - }, - new FluidStack[] { - new FluidStack(solderIndalloy, 1440), - Materials.Osmium.getMolten(1440), - Materials.Neutronium.getMolten(1440) - }, + new Object[] { ItemList.Machine_Multi_ImplosionCompressor.get(1L), Materials.Neutronium.getBlocks(5), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64), + ItemList.Electric_Piston_UV.get(64), }, + new FluidStack[] { new FluidStack(solderIndalloy, 1440), Materials.Osmium.getMolten(1440), + Materials.Neutronium.getMolten(1440) }, ItemRegistry.eic.copy(), 240000, BW_Util.getMachineVoltageFromTier(8)); - // BartWorksCrossmod.LOGGER.info("Nerfing Assembly Lines >= LuV Recipes to run with TecTech!"); - // HashSet toRem = new HashSet<>(); - // for (GT_Recipe.GT_Recipe_AssemblyLine recipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){ - // if (recipe.mEUt >= BW_Util.getTierVoltage(6) && !GT_Utility.areStacksEqual(recipe.mResearchItem, + // BartWorksCrossmod.LOGGER.info("Nerfing Assembly Lines >= LuV Recipes to run with TecTech!"); + // HashSet toRem = new HashSet<>(); + // for (GT_Recipe.GT_Recipe_AssemblyLine recipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){ + // if (recipe.mEUt >= BW_Util.getTierVoltage(6) && !GT_Utility.areStacksEqual(recipe.mResearchItem, // CustomItemList.UnusedStuff.get(1L))){ - // String modId = GameRegistry.findUniqueIdentifierFor(recipe.mOutput.getItem()).modId; - // if (!modId.equalsIgnoreCase("tectech")) - // if (!modId.equalsIgnoreCase("gregtech") || modId.equalsIgnoreCase("gregtech") && + // String modId = GameRegistry.findUniqueIdentifierFor(recipe.mOutput.getItem()).modId; + // if (!modId.equalsIgnoreCase("tectech")) + // if (!modId.equalsIgnoreCase("gregtech") || modId.equalsIgnoreCase("gregtech") && // (recipe.mOutput.getItemDamage() < 15000 || recipe.mOutput.getItemDamage() > 16999)) - // toRem.add(recipe); - // } - // } - // HashSet toRemVisualScanner = new HashSet<>(); - // HashSet toRemVisualAssLine = new HashSet<>(); - // GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.removeAll(toRem); + // toRem.add(recipe); + // } + // } + // HashSet toRemVisualScanner = new HashSet<>(); + // HashSet toRemVisualAssLine = new HashSet<>(); + // GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.removeAll(toRem); // - // for (GT_Recipe.GT_Recipe_AssemblyLine recipe : toRem){ - // GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.stream().filter(re -> + // for (GT_Recipe.GT_Recipe_AssemblyLine recipe : toRem){ + // GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.stream().filter(re -> // GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisualAssLine::add); - // GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.stream().filter(re -> + // GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.stream().filter(re -> // GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisualScanner::add); - // TT_recipeAdder.addResearchableAssemblylineRecipe(recipe.mResearchItem, recipe.mResearchTime, + // TT_recipeAdder.addResearchableAssemblylineRecipe(recipe.mResearchItem, recipe.mResearchTime, // recipe.mResearchTime/1000, recipe.mEUt, GT_Utility.getTier(recipe.mEUt)-2, recipe.mInputs, // recipe.mFluidInputs, recipe.mOutput, recipe.mDuration, recipe.mEUt); - // } + // } // - // GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.removeAll(toRemVisualScanner); - // GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.removeAll(toRemVisualAssLine); + // GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.removeAll(toRemVisualScanner); + // GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.removeAll(toRemVisualAssLine); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java index f8d0db5ea6..e61bc68cee 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.tectech.helper; @@ -25,6 +16,7 @@ package com.github.bartimaeusnek.crossmod.tectech.helper; import gregtech.api.enums.HeatingCoilLevel; public interface IHasCoils { + void setCoilHeat(HeatingCoilLevel coilMeta); HeatingCoilLevel getCoilHeat(); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java index af3059ea7c..57c58f5d3a 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java @@ -1,23 +1,14 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.tectech.helper; @@ -25,6 +16,7 @@ package com.github.bartimaeusnek.crossmod.tectech.helper; import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel; + import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; @@ -33,13 +25,13 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB public class TecTechUtils { @Deprecated - public static boolean addEnergyInputToMachineList( - TecTechEnabledMulti baseTE, IGregTechTileEntity te, int aBaseCasingIndex) { + public static boolean addEnergyInputToMachineList(TecTechEnabledMulti baseTE, IGregTechTileEntity te, + int aBaseCasingIndex) { return addEnergyInputToMachineList(baseTE, te, aBaseCasingIndex, -1) != -1; } - public static int addEnergyInputToMachineList( - TecTechEnabledMulti baseTE, IGregTechTileEntity te, int aBaseCasingIndex, int aTier) { + public static int addEnergyInputToMachineList(TecTechEnabledMulti baseTE, IGregTechTileEntity te, + int aBaseCasingIndex, int aTier) { if (te == null || !(te.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch)) return -1; else { GT_MetaTileEntity_Hatch mte = (GT_MetaTileEntity_Hatch) te.getMetaTileEntity(); @@ -47,8 +39,7 @@ public class TecTechUtils { if (mte.mTier != aTier && aTier != -1) return -1; if (mte instanceof GT_MetaTileEntity_Hatch_EnergyTunnel) - if (baseTE.getVanillaEnergyHatches().isEmpty() - && baseTE.getTecTechEnergyMultis().isEmpty()) + if (baseTE.getVanillaEnergyHatches().isEmpty() && baseTE.getTecTechEnergyMultis().isEmpty()) baseTE.getTecTechEnergyTunnels().add((GT_MetaTileEntity_Hatch_EnergyTunnel) mte); else return -1; else if (baseTE.getTecTechEnergyTunnels().isEmpty()) { @@ -104,10 +95,8 @@ public class TecTechUtils { for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : multi.getTecTechEnergyMultis()) hasDrained &= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); - return hasDrained - && (multi.getVanillaEnergyHatches().size() > 0 - || multi.getTecTechEnergyTunnels().size() > 0 - || multi.getTecTechEnergyMultis().size() > 0); + return hasDrained && (multi.getVanillaEnergyHatches().size() > 0 || multi.getTecTechEnergyTunnels().size() > 0 + || multi.getTecTechEnergyMultis().size() > 0); } public static long getnominalVoltageTT(TecTechEnabledMulti base) { @@ -179,6 +168,6 @@ public class TecTechUtils { } public static long getEUPerTickFromLaser(GT_MetaTileEntity_Hatch_EnergyTunnel tHatch) { - return tHatch.Amperes * tHatch.maxEUInput() /* - (tHatch.Amperes / 20)*/; + return tHatch.Amperes * tHatch.maxEUInput() /* - (tHatch.Amperes / 20) */; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java index 77677ed79b..5bd2f68fe9 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java @@ -1,29 +1,21 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; import com.github.technus.tectech.mechanics.pipe.IConnectsToEnergyTunnel; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Energy; + import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; @@ -69,8 +61,8 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel byte opposite = GT_Utility.getOppositeSide(front); for (short dist = 1; dist < 250; ++dist) { - IGregTechTileEntity tGTTileEntity = - aBaseMetaTileEntity.getIGregTechTileEntityAtSideAndDistance(front, dist); + IGregTechTileEntity tGTTileEntity = aBaseMetaTileEntity + .getIGregTechTileEntityAtSideAndDistance(front, dist); if (tGTTileEntity == null || tGTTileEntity.getColorization() != color) { return; } @@ -80,8 +72,7 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel return; } - if (aMetaTileEntity instanceof LowPowerLaser - && ((LowPowerLaser) aMetaTileEntity).isReceiver() + if (aMetaTileEntity instanceof LowPowerLaser && ((LowPowerLaser) aMetaTileEntity).isReceiver() && opposite == tGTTileEntity.getFrontFacing()) { if (this.maxEUOutput() > ((LowPowerLaser) aMetaTileEntity).maxEUInput() || this.getAMPERES() > ((LowPowerLaser) aMetaTileEntity).getAMPERES()) { @@ -95,14 +86,11 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel this.getAMPERES() * 20L * this.maxEUOutput(), Math.min( ((LowPowerLaser) aMetaTileEntity).maxEUStore() - - aMetaTileEntity - .getBaseMetaTileEntity() - .getStoredEU(), + - aMetaTileEntity.getBaseMetaTileEntity().getStoredEU(), aBaseMetaTileEntity.getStoredEU())); this.setEUVar(aBaseMetaTileEntity.getStoredEU() - diff); ((LowPowerLaser) aMetaTileEntity) - .setEUVar( - aMetaTileEntity.getBaseMetaTileEntity().getStoredEU() + diff); + .setEUVar(aMetaTileEntity.getBaseMetaTileEntity().getStoredEU() + diff); } return; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java index f6db55e4d3..d2a68b72aa 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java @@ -1,80 +1,54 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; -import gregtech.api.enums.GT_Values; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import java.util.Optional; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; + public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_TieredMachineBlock implements LowPowerLaser { protected long AMPERES; - public TT_Abstract_LowPowerLaserThingy( - int aID, - String aName, - String aNameRegional, - int aTier, - long aAmperes, - int aInvSlotCount, - String aDescription, - ITexture... aTextures) { + public TT_Abstract_LowPowerLaserThingy(int aID, String aName, String aNameRegional, int aTier, long aAmperes, + int aInvSlotCount, String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); this.AMPERES = aAmperes; } - public TT_Abstract_LowPowerLaserThingy( - int aID, - String aName, - String aNameRegional, - int aTier, - long aAmperes, - int aInvSlotCount, - String[] aDescription, - ITexture... aTextures) { + public TT_Abstract_LowPowerLaserThingy(int aID, String aName, String aNameRegional, int aTier, long aAmperes, + int aInvSlotCount, String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); this.AMPERES = aAmperes; } - public TT_Abstract_LowPowerLaserThingy( - String aName, int aTier, long aAmperes, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + public TT_Abstract_LowPowerLaserThingy(String aName, int aTier, long aAmperes, int aInvSlotCount, + String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); this.AMPERES = aAmperes; } - public TT_Abstract_LowPowerLaserThingy( - String aName, - int aTier, - long aAmperes, - int aInvSlotCount, - String[] aDescription, - ITexture[][][] aTextures) { + public TT_Abstract_LowPowerLaserThingy(String aName, int aTier, long aAmperes, int aInvSlotCount, + String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); this.AMPERES = aAmperes; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java index 996a106b4b..382fa74a3a 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java @@ -1,29 +1,21 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -32,13 +24,13 @@ import gregtech.api.util.GT_Utility; public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLaserThingy { - public TT_MetaTileEntity_LowPowerLaserBox( - int aID, String aName, String aNameRegional, int aTier, long aAmperes, ITexture... aTextures) { + public TT_MetaTileEntity_LowPowerLaserBox(int aID, String aName, String aNameRegional, int aTier, long aAmperes, + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aAmperes, 0, new String[0], aTextures); } - public TT_MetaTileEntity_LowPowerLaserBox( - String aName, int aTier, long aAmperes, String[] aDescription, ITexture[][][] aTextures) { + public TT_MetaTileEntity_LowPowerLaserBox(String aName, int aTier, long aAmperes, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aAmperes, 0, aDescription, aTextures); } @@ -95,7 +87,11 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new TT_MetaTileEntity_LowPowerLaserBox( - this.mName, this.mTier, this.AMPERES, this.mDescriptionArray, this.mTextures); + this.mName, + this.mTier, + this.AMPERES, + this.mDescriptionArray, + this.mTextures); } @Override @@ -124,77 +120,48 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase ITexture[][][] rTextures = new ITexture[12][17][]; for (byte i = -1; i < 16; ++i) { - rTextures[0][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] - }; - rTextures[1][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] - }; - rTextures[2][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] - }; - rTextures[3][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] - }; - rTextures[4][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] - }; - rTextures[5][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] - }; - rTextures[6][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - }; - rTextures[7][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - }; - rTextures[8][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - }; - rTextures[9][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] - }; - rTextures[10][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] - }; - rTextures[11][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] - }; + rTextures[0][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; + rTextures[1][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; + rTextures[2][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; + rTextures[3][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] }; + rTextures[4][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] }; + rTextures[5][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] }; + rTextures[6][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; + rTextures[7][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; + rTextures[8][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; + rTextures[9][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] }; + rTextures[10][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] }; + rTextures[11][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] }; } return rTextures; } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { return this.mTextures[Math.min(2, aSide) + (aSide == aFacing ? 3 : 0) + (aActive ? 0 : 6)][aColorIndex + 1]; } @Override public String[] getDescription() { - return new String[] { - "Like a Tranformer... but for LAZORZ", - "Transfer rate: " + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) - + ChatColorHelper.WHITE + " EU/t", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() - }; + return new String[] { "Like a Tranformer... but for LAZORZ", + "Transfer rate: " + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.getTotalPower()) + + ChatColorHelper.WHITE + + " EU/t", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java index 0aa5cbee2d..1b7b4441ef 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java @@ -1,35 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; + import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoTunnel; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GT_Utility; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; @SuppressWarnings("deprecation") public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hatch_DynamoTunnel @@ -39,15 +32,19 @@ public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hat super(aID, aName, aNameRegional, aTier, aAmp); } - public TT_MetaTileEntity_LowPowerLaserDynamo( - String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { + public TT_MetaTileEntity_LowPowerLaserDynamo(String aName, int aTier, int aAmp, String aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aAmp, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new TT_MetaTileEntity_LowPowerLaserDynamo( - this.mName, this.mTier, this.Amperes, this.mDescription, this.mTextures); + this.mName, + this.mTier, + this.Amperes, + this.mDescription, + this.mTextures); } @Override @@ -72,13 +69,13 @@ public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hat @Override public String[] getDescription() { - return new String[] { - this.mDescription, - StatCollector.translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": " - + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) - + EnumChatFormatting.RESET + " EU/t", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() - }; + return new String[] { this.mDescription, + StatCollector.translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(this.getTotalPower()) + + EnumChatFormatting.RESET + + " EU/t", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java index 3cacc5e843..025e80a9c6 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java @@ -1,35 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; + import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GT_Utility; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; @SuppressWarnings("deprecation") public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatch_EnergyTunnel @@ -39,26 +32,30 @@ public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatc super(aID, aName, aNameRegional, aTier, aAmp); } - public TT_MetaTileEntity_LowPowerLaserHatch( - String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { + public TT_MetaTileEntity_LowPowerLaserHatch(String aName, int aTier, int aAmp, String aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aAmp, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] { - this.mDescription, - StatCollector.translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " - + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) - + EnumChatFormatting.RESET + " EU/t", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() - }; + return new String[] { this.mDescription, + StatCollector.translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(this.getTotalPower()) + + EnumChatFormatting.RESET + + " EU/t", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new TT_MetaTileEntity_LowPowerLaserHatch( - this.mName, this.mTier, this.Amperes, this.mDescription, this.mTextures); + this.mName, + this.mTier, + this.Amperes, + this.mDescription, + this.mTextures); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java index 4be79bfd10..087215f36a 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java @@ -1,29 +1,28 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; +import java.util.ArrayList; +import java.util.HashSet; + +import net.minecraft.block.Block; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; + import gregtech.api.enums.Materials; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -35,11 +34,6 @@ import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Client; import ic2.core.Ic2Items; -import java.util.ArrayList; -import java.util.HashSet; -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Cable implements LowPowerLaser { @@ -47,15 +41,8 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca super(aID, aName, aNameRegional, 0.25f, Materials.BorosilicateGlass, 0, 0, 0, false, false); } - public TT_MetaTileEntity_Pipe_Energy_LowPower( - String aName, - float aThickNess, - Materials aMaterial, - long aCableLossPerMeter, - long aAmperage, - long aVoltage, - boolean aInsulated, - boolean aCanShock) { + public TT_MetaTileEntity_Pipe_Energy_LowPower(String aName, float aThickNess, Materials aMaterial, + long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) { super(aName, aThickNess, aMaterial, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock); } @@ -80,33 +67,36 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aConnections, - byte aColorIndex, - boolean aConnected, - boolean aRedstone) { - return new ITexture[] { - TextureFactory.of( - Block.getBlockFromItem(Ic2Items.glassFiberCableBlock.getItem()), - Ic2Items.glassFiberCableBlock.getItemDamage(), - ForgeDirection.getOrientation(aSide)) - }; + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, + byte aColorIndex, boolean aConnected, boolean aRedstone) { + return new ITexture[] { TextureFactory.of( + Block.getBlockFromItem(Ic2Items.glassFiberCableBlock.getItem()), + Ic2Items.glassFiberCableBlock.getItemDamage(), + ForgeDirection.getOrientation(aSide)) }; } @Override public String[] getDescription() { - return new String[] { - "Primitive Laser Cable intended for Low Power Applications", - "Does not auto-connect", - "Does not turn or bend", - ChatColorHelper.WHITE + "Must be " + ChatColorHelper.YELLOW + "c" + ChatColorHelper.RED + "o" - + ChatColorHelper.BLUE + "l" + ChatColorHelper.DARKPURPLE + "o" + ChatColorHelper.GOLD + "r" - + ChatColorHelper.DARKRED + "e" + ChatColorHelper.DARKGREEN + "d" + ChatColorHelper.WHITE - + " in order to work", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() - }; + return new String[] { "Primitive Laser Cable intended for Low Power Applications", "Does not auto-connect", + "Does not turn or bend", + ChatColorHelper.WHITE + "Must be " + + ChatColorHelper.YELLOW + + "c" + + ChatColorHelper.RED + + "o" + + ChatColorHelper.BLUE + + "l" + + ChatColorHelper.DARKPURPLE + + "o" + + ChatColorHelper.GOLD + + "r" + + ChatColorHelper.DARKRED + + "e" + + ChatColorHelper.DARKGREEN + + "d" + + ChatColorHelper.WHITE + + " in order to work", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } @Override @@ -152,8 +142,8 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca @Override @Deprecated @SuppressWarnings("deprecation") - public long transferElectricity( - byte aSide, long aVoltage, long aAmperage, ArrayList aAlreadyPassedTileEntityList) { + public long transferElectricity(byte aSide, long aVoltage, long aAmperage, + ArrayList aAlreadyPassedTileEntityList) { return 0L; } @@ -163,14 +153,14 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca } @Override - public boolean letsIn( - GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, + ICoverable aTileEntity) { return true; } @Override - public boolean letsOut( - GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, + ICoverable aTileEntity) { return true; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java index e64bcab13f..d9cf64f221 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java @@ -1,31 +1,34 @@ package com.github.bartimaeusnek.crossmod.tgregworks; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; + import net.minecraftforge.common.config.Property; + import tconstruct.library.TConstructRegistry; import vexatos.tgregworks.TGregworks; import vexatos.tgregworks.integration.TGregRegistry; import vexatos.tgregworks.item.ItemTGregPart; import vexatos.tgregworks.reference.Config; +import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; + @Mod( modid = MaterialsInjector.MOD_ID, name = MaterialsInjector.NAME, version = MaterialsInjector.VERSION, - dependencies = "required-after:IC2; " - + "required-after:gregtech; " + dependencies = "required-after:IC2; " + "required-after:gregtech; " + "required-after:bartworks;" + "before:TGregworks;" + "before:miscutils; ") @@ -57,10 +60,7 @@ public class MaterialsInjector { try { getFields(); getMethodes(); - } catch (IllegalArgumentException - | IllegalAccessException - | NoSuchFieldException - | NoSuchMethodException + } catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | NoSuchMethodException | SecurityException e) { MainMod.LOGGER.catching(e); FMLCommonHandler.instance().exitJava(1, true); @@ -81,8 +81,8 @@ public class MaterialsInjector { getGlobalMultiplierMethod = TGregRegistry.class.getDeclaredMethod("getGlobalMultiplier", String.class); getGlobalMultiplierMethod.setAccessible(true); - getGlobalMultiplierMethodTwoArguments = - TGregRegistry.class.getDeclaredMethod("getGlobalMultiplier", String.class, double.class); + getGlobalMultiplierMethodTwoArguments = TGregRegistry.class + .getDeclaredMethod("getGlobalMultiplier", String.class, double.class); getGlobalMultiplierMethodTwoArguments.setAccessible(true); getMultiplierMethod = TGregRegistry.class.getDeclaredMethod("getMultiplier", Materials.class, String.class); @@ -102,9 +102,7 @@ public class MaterialsInjector { MainMod.LOGGER.info("Registering TGregworks - BartWorks tool parts."); Werkstoff.werkstoffHashSet.stream() .filter(x -> x.hasItemType(OrePrefixes.gem) || x.hasItemType(OrePrefixes.plate)) - .map(Werkstoff::getBridgeMaterial) - .filter(x -> x.mMetaItemSubID == -1) - .filter(x -> x.mDurability != 0) + .map(Werkstoff::getBridgeMaterial).filter(x -> x.mMetaItemSubID == -1).filter(x -> x.mDurability != 0) .forEach(m -> { setConfigProps(m); registerParts(m); @@ -136,8 +134,8 @@ public class MaterialsInjector { private static void setConfigProps(Materials m) { if (TGregworks.config.get(Config.Category.Enable, m.mName, true).getBoolean(true)) { TGregworks.registry.toolMaterials.add(m); - Property configProp = - TGregworks.config.get(Config.onMaterial(Config.MaterialID), m.mName, 0, null, 0, 100000); + Property configProp = TGregworks.config + .get(Config.onMaterial(Config.MaterialID), m.mName, 0, null, 0, 100000); configProps.put(m, configProp); configIDs.add(configProp.getInt()); } @@ -150,21 +148,18 @@ public class MaterialsInjector { m.mName, m.mLocalizedName, m.mToolQuality, - (int) (m.mDurability - * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.Durability) + (int) (m.mDurability * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.Durability) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.Durability)), // Durability - (int) (m.mToolSpeed - * 100F + (int) (m.mToolSpeed * 100F * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.MiningSpeed) - * (float) - getMultiplierMethod.invoke(TGregworks.registry, m, Config.MiningSpeed)), // Mining speed - (int) (m.mToolQuality - * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.Attack) + * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.MiningSpeed)), // Mining + // speed + (int) (m.mToolQuality * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.Attack) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.Attack)), // Attack (m.mToolQuality - 0.5F) * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.HandleModifier) - * (float) getMultiplierMethod.invoke( - TGregworks.registry, m, Config.HandleModifier), // Handle Modifier + * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.HandleModifier), // Handle + // Modifier (int) getReinforcedLevelMethod.invoke(TGregworks.registry, m), (float) getStoneboundLevelMethod.invoke(TGregworks.registry, m), "", @@ -175,8 +170,7 @@ public class MaterialsInjector { throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { TConstructRegistry.addBowMaterial( matID, - (int) ((float) m.mToolQuality - * 10F + (int) ((float) m.mToolQuality * 10F * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.BowDrawSpeed) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.BowDrawSpeed)), (((float) m.mToolQuality) - 0.5F) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java index 07adc7e752..28d5ba07cc 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java @@ -1,55 +1,46 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.thaumcraft; public class CustomAspects { - // static Constructor aspectConstructor; - // static Object TRADE; - // static Object UNIVERSE; - // static Object SCIENCE; - // static Object[] tmpArray = new Object[3]; - // static{ - // try { - // aspectConstructor = ThaumcraftHandler.AspectAdder.mAspectClass.getConstructor(String.class,int.class, + // static Constructor aspectConstructor; + // static Object TRADE; + // static Object UNIVERSE; + // static Object SCIENCE; + // static Object[] tmpArray = new Object[3]; + // static{ + // try { + // aspectConstructor = ThaumcraftHandler.AspectAdder.mAspectClass.getConstructor(String.class,int.class, // Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,1).getClass(), ResourceLocation.class,int.class); - // tmpArray[0] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); - // tmpArray[1] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); - // tmpArray[2] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); - // Array.set(tmpArray[0],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("EXCHANGE").get(null)); - // Array.set(tmpArray[0],1,ThaumcraftHandler.AspectAdder.mAspectClass.getField("GREED").get(null)); - // TRADE = aspectConstructor.newInstance("Artis",0x00FF00, tmpArray[0],new + // tmpArray[0] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); + // tmpArray[1] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); + // tmpArray[2] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); + // Array.set(tmpArray[0],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("EXCHANGE").get(null)); + // Array.set(tmpArray[0],1,ThaumcraftHandler.AspectAdder.mAspectClass.getField("GREED").get(null)); + // TRADE = aspectConstructor.newInstance("Artis",0x00FF00, tmpArray[0],new // ResourceLocation(MainMod.MOD_ID+":Aspects/Artis.png"),1); - // Array.set(tmpArray[1],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("MAGIC").get(null)); - // Array.set(tmpArray[1],1,ThaumcraftHandler.AspectAdder.mAspectClass.getField("ELDRITCH").get(null)); - // UNIVERSE = aspectConstructor.newInstance("Universum",0x0000FF, tmpArray[1],new + // Array.set(tmpArray[1],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("MAGIC").get(null)); + // Array.set(tmpArray[1],1,ThaumcraftHandler.AspectAdder.mAspectClass.getField("ELDRITCH").get(null)); + // UNIVERSE = aspectConstructor.newInstance("Universum",0x0000FF, tmpArray[1],new // ResourceLocation(MainMod.MOD_ID+":Aspects/Universum.png"),1); - // Array.set(tmpArray[2],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("MAN").get(null)); - // Array.set(tmpArray[2],1,UNIVERSE); - // SCIENCE = aspectConstructor.newInstance("Scientia",0x00FFFF, tmpArray[2],new + // Array.set(tmpArray[2],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("MAN").get(null)); + // Array.set(tmpArray[2],1,UNIVERSE); + // SCIENCE = aspectConstructor.newInstance("Scientia",0x00FFFF, tmpArray[2],new // ResourceLocation(MainMod.MOD_ID+":Aspects/Scientia.png"),1); - // } catch (NoSuchMethodException | NoSuchFieldException | IllegalAccessException | InstantiationException | + // } catch (NoSuchMethodException | NoSuchFieldException | IllegalAccessException | InstantiationException | // InvocationTargetException e) { - // e.printStackTrace(); - // } - // } + // e.printStackTrace(); + // } + // } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java index 3c0c8abf3e..fee3cfaa41 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java @@ -1,32 +1,24 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.thaumcraft.tile; +import net.minecraft.item.ItemStack; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import net.minecraft.item.ItemStack; public class GT_Multi_IndustrialCrucible extends GT_MetaTileEntity_MultiBlockBase { @@ -84,8 +76,8 @@ public class GT_Multi_IndustrialCrucible extends GT_MetaTileEntity_MultiBlockBas } @Override - public ITexture[] getTexture( - IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, + boolean b4) { return new ITexture[0]; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java index 813aa16d74..fcc45f069f 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java @@ -1,28 +1,22 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.thaumcraft.tile; +import net.minecraft.item.ItemStack; + import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaBase_Item; @@ -30,9 +24,9 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicBatter import gregtech.api.util.GT_ModHandler; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; -import net.minecraft.item.ItemStack; public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { + public GT_WandBuffer(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) { super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount); } @@ -114,6 +108,6 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { tStored = 9223372036854775807L; } - return new long[] {tStored, tScale}; + return new long[] { tStored, tScale }; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index 1cca3a9f8d..531111b221 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -1,40 +1,34 @@ /* - * Copyright (c) 2018-2020 bartimaeusnek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ package com.github.bartimaeusnek.crossmod.thaumcraft.util; -import com.github.bartimaeusnek.bartworks.API.API_ConfigValues; -import com.github.bartimaeusnek.bartworks.util.Pair; -import com.github.bartimaeusnek.bartworks.util.log.DebugLog; -import gregtech.api.enums.TC_Aspects; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; + import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.biome.BiomeGenBase; -@SuppressWarnings({"rawtypes", "unchecked", "unused"}) +import com.github.bartimaeusnek.bartworks.API.API_ConfigValues; +import com.github.bartimaeusnek.bartworks.util.Pair; +import com.github.bartimaeusnek.bartworks.util.log.DebugLog; +import gregtech.api.enums.TC_Aspects; + +@SuppressWarnings({ "rawtypes", "unchecked", "unused" }) public class ThaumcraftHandler { + private ThaumcraftHandler() {} private static Integer taintBiomeID; @@ -51,9 +45,7 @@ public class ThaumcraftHandler { public static boolean isWand(ItemStack aStack) { try { - return aStack != null - && ThaumcraftHandler.mWandInterface.isAssignableFrom( - aStack.getItem().getClass()); + return aStack != null && ThaumcraftHandler.mWandInterface.isAssignableFrom(aStack.getItem().getClass()); } catch (Throwable var3) { return false; } @@ -62,10 +54,9 @@ public class ThaumcraftHandler { public static boolean isMagicalForestBiome(int biomeID) { if (ThaumcraftHandler.magicalForestBiomeID == null) { try { - BiomeGenBase biome = - (BiomeGenBase) Class.forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator") - .getField("biomeMagicalForest") - .get(null); + BiomeGenBase biome = (BiomeGenBase) Class + .forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator").getField("biomeMagicalForest") + .get(null); return biomeID == (ThaumcraftHandler.magicalForestBiomeID = biome.biomeID); } catch (ClassCastException | ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); @@ -78,10 +69,9 @@ public class ThaumcraftHandler { public static boolean isTaintBiome(int biomeID) { if (ThaumcraftHandler.taintBiomeID == null) { try { - BiomeGenBase TaintBiome = - (BiomeGenBase) Class.forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator") - .getField("biomeTaint") - .get(null); + BiomeGenBase TaintBiome = (BiomeGenBase) Class + .forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator").getField("biomeTaint") + .get(null); return biomeID == (ThaumcraftHandler.taintBiomeID = TaintBiome.biomeID); } catch (ClassCastException | ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); @@ -92,6 +82,7 @@ public class ThaumcraftHandler { } public static class AspectAdder { + public static Class mAspectListClass; public static Class mAspectClass; public static Method registerObjectTag; @@ -109,27 +100,29 @@ public class ThaumcraftHandler { try { ThaumcraftHandler.AspectAdder.mAspectListClass = Class.forName("thaumcraft.api.aspects.AspectList"); ThaumcraftHandler.AspectAdder.mAspectClass = Class.forName("thaumcraft.api.aspects.Aspect"); - ThaumcraftHandler.AspectAdder.addToList = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod( - "add", ThaumcraftHandler.AspectAdder.mAspectClass, int.class); + ThaumcraftHandler.AspectAdder.addToList = ThaumcraftHandler.AspectAdder.mAspectListClass + .getMethod("add", ThaumcraftHandler.AspectAdder.mAspectClass, int.class); ThaumcraftHandler.AspectAdder.registerObjectTag = Class.forName("thaumcraft.api.ThaumcraftApi") .getMethod( - "registerObjectTag", ItemStack.class, ThaumcraftHandler.AspectAdder.mAspectListClass); + "registerObjectTag", + ItemStack.class, + ThaumcraftHandler.AspectAdder.mAspectListClass); ThaumcraftHandler.AspectAdder.getName = ThaumcraftHandler.AspectAdder.mAspectClass.getMethod("getName"); - ThaumcraftHandler.AspectAdder.writeAspectListToNBT = - ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("writeToNBT", NBTTagCompound.class); - ThaumcraftHandler.AspectAdder.add = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod( - "add", ThaumcraftHandler.AspectAdder.mAspectListClass); - ThaumcraftHandler.AspectAdder.getAmount = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod( - "getAmount", ThaumcraftHandler.AspectAdder.mAspectClass); - ThaumcraftHandler.AspectAdder.getAspects = - ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("getAspects"); - ThaumcraftHandler.AspectAdder.readAspectListFromNBT = - ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("readFromNBT", NBTTagCompound.class); - ThaumcraftHandler.AspectAdder.isResearchComplete = Class.forName( - "thaumcraft.common.lib.research.ResearchManager") + ThaumcraftHandler.AspectAdder.writeAspectListToNBT = ThaumcraftHandler.AspectAdder.mAspectListClass + .getMethod("writeToNBT", NBTTagCompound.class); + ThaumcraftHandler.AspectAdder.add = ThaumcraftHandler.AspectAdder.mAspectListClass + .getMethod("add", ThaumcraftHandler.AspectAdder.mAspectListClass); + ThaumcraftHandler.AspectAdder.getAmount = ThaumcraftHandler.AspectAdder.mAspectListClass + .getMethod("getAmount", ThaumcraftHandler.AspectAdder.mAspectClass); + ThaumcraftHandler.AspectAdder.getAspects = ThaumcraftHandler.AspectAdder.mAspectListClass + .getMethod("getAspects"); + ThaumcraftHandler.AspectAdder.readAspectListFromNBT = ThaumcraftHandler.AspectAdder.mAspectListClass + .getMethod("readFromNBT", NBTTagCompound.class); + ThaumcraftHandler.AspectAdder.isResearchComplete = Class + .forName("thaumcraft.common.lib.research.ResearchManager") .getMethod("isResearchComplete", String.class, String.class); - ThaumcraftHandler.AspectAdder.linkedAspektList = - ThaumcraftHandler.AspectAdder.mAspectListClass.getField("aspects"); + ThaumcraftHandler.AspectAdder.linkedAspektList = ThaumcraftHandler.AspectAdder.mAspectListClass + .getField("aspects"); } catch (ClassNotFoundException | NoSuchMethodException | NoSuchFieldException e) { e.printStackTrace(); } @@ -140,10 +133,14 @@ public class ThaumcraftHandler { try { Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); for (Pair a : aspectPair) { - if (API_ConfigValues.debugLog) - DebugLog.log("Stack:" + stack.getDisplayName() + " Damage:" + stack.getItemDamage() - + " aspectPair: " + ThaumcraftHandler.AspectAdder.getName.invoke(a.getKey()) + " / " - + a.getValue()); + if (API_ConfigValues.debugLog) DebugLog.log( + "Stack:" + stack.getDisplayName() + + " Damage:" + + stack.getItemDamage() + + " aspectPair: " + + ThaumcraftHandler.AspectAdder.getName.invoke(a.getKey()) + + " / " + + a.getValue()); ThaumcraftHandler.AspectAdder.addToList.invoke(aspectList, a.getKey(), a.getValue()); } ThaumcraftHandler.AspectAdder.registerObjectTag.invoke(null, stack, aspectList); @@ -155,9 +152,8 @@ public class ThaumcraftHandler { public static void addAspectViaGT(ItemStack stack, TC_Aspects.TC_AspectStack... tc_aspectStacks) { try { Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); - for (TC_Aspects.TC_AspectStack tc_aspects : tc_aspectStacks) - ThaumcraftHandler.AspectAdder.addToList.invoke( - aspectList, tc_aspects.mAspect.mAspect, (int) tc_aspects.mAmount); + for (TC_Aspects.TC_AspectStack tc_aspects : tc_aspectStacks) ThaumcraftHandler.AspectAdder.addToList + .invoke(aspectList, tc_aspects.mAspect.mAspect, (int) tc_aspects.mAmount); ThaumcraftHandler.AspectAdder.registerObjectTag.invoke(null, stack, aspectList); } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) { e.printStackTrace(); -- cgit From eb7180091fae28e9560f23e879c673ea0a09f3d6 Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Mon, 30 Jan 2023 10:37:16 -0800 Subject: [ci skip] Add git-blame-ignore-revs for spotlessApply Former-commit-id: 87bea1af4b983269812c986d79b1e169ee5300b2 --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000000..c5e29c40f7 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# Ignore spotlessApply reformat +dff9a4e6c3e688dd66dd44ce546d1d1e01f5c77a -- cgit From 2abc6e1846a1fe932e358e5ee5cabba5036ed862 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Mon, 30 Jan 2023 22:48:36 +0100 Subject: bump dep Former-commit-id: 2b8aec85516c5e4249315efcdf799ca9828182bd --- dependencies.gradle | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index a4f0718b63..1c6dd743f9 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -3,22 +3,22 @@ dependencies { compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.254:dev") compile("com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev") - compile("com.github.GTNewHorizons:TecTech:5.0.67:dev") - compile("com.github.GTNewHorizons:NotEnoughItems:2.3.20-GTNH:dev") - compile("com.github.GTNewHorizons:TinkersConstruct:1.9.11-GTNH:dev") + compile("com.github.GTNewHorizons:TecTech:5.0.85:dev") + compile("com.github.GTNewHorizons:NotEnoughItems:2.3.24-GTNH:dev") + compile("com.github.GTNewHorizons:TinkersConstruct:1.9.16-GTNH:dev") compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.7:dev") compile("com.github.GTNewHorizons:CodeChickenCore:1.1.7:dev") - compile("com.github.GTNewHorizons:Galacticraft:3.0.63-GTNH:dev") - compile("com.github.GTNewHorizons:ModularUI:1.0.38:dev") + compile("com.github.GTNewHorizons:Galacticraft:3.0.64-GTNH:dev") + compile("com.github.GTNewHorizons:ModularUI:1.0.52:dev") compile("com.github.GTNewHorizons:GalacticGregGT5:1.0.8:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") - compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-134-GTNH:dev") { + compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-152-GTNH:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:AppleCore:3.2.4:dev") { + compileOnly("com.github.GTNewHorizons:AppleCore:3.2.8:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:TinkersGregworks:master-SNAPSHOT:dev") { @@ -27,15 +27,15 @@ dependencies { compileOnly("com.github.GTNewHorizons:ForestryMC:4.5.6:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:Railcraft:9.13.14:api") { + compileOnly("com.github.GTNewHorizons:Railcraft:9.13.16:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.49:api") { + compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.54:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:OpenComputers:1.8.0.2-GTNH:api") { + compileOnly("com.github.GTNewHorizons:OpenComputers:1.8.0.9-GTNH:api") { transitive = false } compileOnly("com.github.GTNewHorizons:BuildCraft:7.1.28:dev") { -- cgit From 9d9862a3f65d041c055c06526c5284d0659178a7 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Mon, 30 Jan 2023 23:19:48 +0100 Subject: ba Former-commit-id: ad9949aea5d029c07d5fd9d34c61b22ed481a18c --- build.gradle | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index 0197e406bb..fe8a2e7be2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1675084541 +//version: 1675110695 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -66,7 +66,7 @@ plugins { id 'com.diffplug.spotless' version '6.7.2' apply false id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.0.18' + id 'com.gtnewhorizons.retrofuturagradle' version '1.1.2' } boolean settingsupdated = verifySettingsGradle() settingsupdated = verifyGitAttributes() || settingsupdated @@ -337,7 +337,7 @@ if (identifiedVersion == versionOverride) { out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7') } -group = modGroup +group = "com.github.GTNewHorizons" if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) { archivesBaseName = customArchiveBaseName } else { @@ -714,16 +714,6 @@ if (usesShadowedDependencies.toBoolean()) { ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar ext.publishableObfJar = tasks.reobfJar -tasks.named('extractForgeUserdev', Copy).configure { efu -> - doLast { - // Fix CoFH-repackaged CCL not finding mappings - project.copy { - from(mcpTasks.userdevDir("conf")) - into(new File(project.buildDir, "unpacked/conf")) - } - } -} - tasks.register('apiJar', Jar) { from(sourceSets.main.allSource) { include modGroupPath + "/" + apiPackagePath + '/**' @@ -828,7 +818,7 @@ publishing { artifact apiJar } - groupId = System.getenv("ARTIFACT_GROUP_ID") ?: "com.github.GTNewHorizons" + groupId = System.getenv("ARTIFACT_GROUP_ID") ?: project.group artifactId = System.getenv("ARTIFACT_ID") ?: project.name // Using the identified version, not project.version as it has the prepended 1.7.10 version = System.getenv("RELEASE_VERSION") ?: identifiedVersion -- cgit From 064a3f949c4d887313cb17488e060e08f7444b76 Mon Sep 17 00:00:00 2001 From: Tyrantnh <124327404+Tyrantnh@users.noreply.github.com> Date: Sun, 5 Feb 2023 15:08:46 -0500 Subject: Add wrap for wetware SoC (#280) * Update CircuitPartLoader.java * Update GT5U dependency Former-commit-id: 39fa96e3f5fa005b88a20e3c6730d676ae8fc8d6 --- dependencies.gradle | 2 +- .../bartworks/system/material/CircuitGeneration/CircuitPartLoader.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 1c6dd743f9..fc48ad2d76 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.254:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.267:dev") compile("com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev") compile("com.github.GTNewHorizons:TecTech:5.0.85:dev") compile("com.github.GTNewHorizons:NotEnoughItems:2.3.24-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index f1e4c90679..e02528b6c3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -155,5 +155,6 @@ public class CircuitPartLoader implements Runnable { Circuit_Board_Optical, Optically_Perfected_CPU, Optical_Cpu_Containment_Housing, - Optically_Compatible_Memory)); + Optically_Compatible_Memory, + Circuit_Parts_Crystal_Chip_Wetware)); } -- cgit From bb803825f03fabfa801c5540a2151d16f479389e Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Wed, 8 Feb 2023 08:37:05 +0000 Subject: Adds asmds, xsmds, indalloy, and living solder to Magneto Resonatic Circuits consistent with the other circuits (#281) * start using indalloy, living solder, ASMD, XSMD * SA * import fluid Former-commit-id: abda0f16f4d0070a542485710924561eba716d2b --- .../processingLoaders/AdditionalRecipes.java | 81 ++++++++++++++++++++-- 1 file changed, 75 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 5ac2fb4b58..43ce539dab 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -22,6 +22,7 @@ import java.util.Objects; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; @@ -395,6 +396,16 @@ public class AdditionalRecipes { 50, 120); + // Magneto Resonatic Circuits + + Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null + ? FluidRegistry.getFluid("molten.indalloy140") + : FluidRegistry.getFluid("molten.solderingalloy"); + + Fluid solderUEV = FluidRegistry.getFluid("molten.mutatedlivingsolder") != null + ? FluidRegistry.getFluid("molten.mutatedlivingsolder") + : FluidRegistry.getFluid("molten.solderingalloy"); + // ULV GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( new BWRecipes.DynamicGTRecipe( false, @@ -410,7 +421,8 @@ public class AdditionalRecipes { 750, BW_Util.getMachineVoltageFromTier(1), CLEANROOM)); - for (int i = 1; i <= 6; i++) { + // LV-EV + for (int i = 1; i <= 4; i++) { GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( new BWRecipes.DynamicGTRecipe( false, @@ -429,20 +441,77 @@ public class AdditionalRecipes { BW_Util.getMachineVoltageFromTier((i + 1)), CLEANROOM)); } - for (int i = 7; i <= 10; i++) { + // IV-LuV + for (int i = 5; i <= 6; i++) { + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), + WerkstoffLoader.MagnetoResonaticDust.get(gem), + BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), + ItemList.Circuit_Parts_DiodeASMD.get((i + 1) * 4), + ItemList.Circuit_Parts_CapacitorASMD.get((i + 1) * 4), + ItemList.Circuit_Parts_TransistorASMD.get((i + 1) * 4) }, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4) }, + null, + null, + new FluidStack[] { new FluidStack(solderIndalloy, (i + 1) * 36) }, + null, + (i + 1) * 750, + BW_Util.getMachineVoltageFromTier((i + 1)), + CLEANROOM)); + } + // ZPM + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), + WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (1)), + BW_Meta_Items.getNEWCIRCUITS().getStack(7 + 3), + ItemList.Circuit_Parts_DiodeASMD.get((7 + 6) * 4), + ItemList.Circuit_Parts_CapacitorASMD.get((7 + 6) * 4), + ItemList.Circuit_Parts_TransistorASMD.get((7 + 6) * 4) }, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(7 + 4) }, + null, + null, + new FluidStack[] { new FluidStack(solderIndalloy, (7 + 1) * 36) }, + null, + (7 + 1) * 1500, + BW_Util.getMachineVoltageFromTier(7 + 1), + CLEANROOM)); + // UV + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), + WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (1)), + BW_Meta_Items.getNEWCIRCUITS().getStack(8 + 3), + ItemList.Circuit_Parts_DiodeASMD.get((8 + 6) * 4), + ItemList.Circuit_Parts_CapacitorASMD.get((8 + 6) * 4), + ItemList.Circuit_Parts_TransistorASMD.get((8 + 6) * 4) }, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(8 + 4) }, + null, + null, + new FluidStack[] { new FluidStack(solderUEV, (8 + 1) * 36) }, + null, + (8 + 1) * 1500, + BW_Util.getMachineVoltageFromTier(8 + 1), + CLEANROOM)); + // UHV-UEV + for (int i = 9; i <= 10; i++) { GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( new BWRecipes.DynamicGTRecipe( false, new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (1)), BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), - ItemList.Circuit_Parts_DiodeSMD.get((i + 6) * 4), - ItemList.Circuit_Parts_CapacitorSMD.get((i + 6) * 4), - ItemList.Circuit_Parts_TransistorSMD.get((i + 6) * 4) }, + ItemList.Circuit_Parts_DiodeXSMD.get((i + 6) * 4), + ItemList.Circuit_Parts_CapacitorXSMD.get((i + 6) * 4), + ItemList.Circuit_Parts_TransistorXSMD.get((i + 6) * 4) }, new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4) }, null, null, - new FluidStack[] { Materials.SolderingAlloy.getMolten((i + 1) * 144) }, + new FluidStack[] { new FluidStack(solderUEV, (i + 1) * 36) }, null, (i + 1) * 1500, BW_Util.getMachineVoltageFromTier(i + 1), -- cgit From 552e013e72c00e78e35e7f5cfb909076517a2e50 Mon Sep 17 00:00:00 2001 From: RaitGamerGR <70205464+RaitGamerGR@users.noreply.github.com> Date: Wed, 8 Feb 2023 11:37:43 +0300 Subject: Ammonium Chloride (#279) Added advanced recipe for Ammonium Chloride for large chemical reactor Former-commit-id: 0134ae210cc2d9e4adae33c001222b0703109ca4 --- .../system/material/GT_Enhancement/PlatinumSludgeOverHaul.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 1f09532556..6658474734 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -182,7 +182,13 @@ public class PlatinumSludgeOverHaul { Materials.Empty.getCells(1), null, 15); - + GT_Values.RA.addMultiblockChemicalRecipe( + new ItemStack[] { GT_Utility.getIntegratedCircuit(9) }, + new FluidStack[] { Materials.Ammonia.getGas(64000), Materials.HydrochloricAcid.getFluid(64000) }, + new FluidStack[] { AmmoniumChloride.getFluidOrGas(64000) }, + null, + 60, + 480); // base sollution for (Werkstoff w : Werkstoff.werkstoffHashSet) if (w.containsStuff(Materials.Sulfur) && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { -- cgit From 258efe3ad0a0340b1cf6a2e8657c65a1d9c73f3d Mon Sep 17 00:00:00 2001 From: Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com> Date: Tue, 14 Feb 2023 15:21:59 +0000 Subject: Add recipes for MHDCSM parts (#282) * New EIC file with magneto recipes * Save state * Redo the logic to work better. * Spotless * spotlessApply (#283) Co-authored-by: GitHub GTNH Actions <> * Add multiplier to reduce cost of MHDCSM parts. * Spotless * Add some fodder --------- Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Former-commit-id: a84d71976069c3bc1c9f8d3c62cc6c65f840ef19 --- .../ElectricImplosionCompressorRecipes.java | 146 +++++++++++++++++++++ .../common/loaders/StaticRecipeChangeLoaders.java | 73 +---------- 2 files changed, 151 insertions(+), 68 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java new file mode 100644 index 0000000000..fefd6fce54 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java @@ -0,0 +1,146 @@ +package com.github.bartimaeusnek.bartworks.common.loaders; + +import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; +import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.util.GT_ModHandler.getModItem; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import cpw.mods.fml.common.Loader; +import gregtech.api.enums.*; +import gregtech.api.util.GT_OreDictUnificator; + +public class ElectricImplosionCompressorRecipes implements Runnable { + + private static void addElectricImplosionRecipe(final ItemStack[] inputItems, final FluidStack[] inputFluids, + final ItemStack[] outputItems, final FluidStack[] outputFluids, final int durationInTicks, + final int EUPerTick) { + eicMap.addRecipe( + false, + inputItems, + outputItems, + null, + inputFluids, + outputFluids, + durationInTicks, + EUPerTick, + 1); + } + + private static final ItemStack[] circuits = new ItemStack[] { ItemList.Circuit_ExoticProcessor.get(1), + ItemList.Circuit_OpticalAssembly.get(1), ItemList.Circuit_Biowaresupercomputer.get(1), + ItemList.Circuit_Wetwaremainframe.get(1) }; + + @Override + public void run() { + // Custom electric implosion compressor recipes. Cannot be overclocked. + + if (Loader.isModLoaded("eternalsingularity")) { + + addElectricImplosionRecipe( + // IN. + new ItemStack[] { GT_Values.NI }, + new FluidStack[] { Materials.SpaceTime.getMolten(72L) }, + // OUT. + new ItemStack[] { getModItem("eternalsingularity", "eternal_singularity", 1L) }, + new FluidStack[] { GT_Values.NF }, + // Recipe stats. + 100 * 20, + (int) TierEU.RECIPE_UMV); + } + + addElectricImplosionRecipe( + // IN. + new ItemStack[] { getModItem("GoodGenerator", "highDensityPlutoniumNugget", 5L) }, + new FluidStack[] { Materials.Infinity.getMolten(9L) }, + // OUT. + new ItemStack[] { getModItem("GoodGenerator", "highDensityPlutonium", 1L) }, + new FluidStack[] { GT_Values.NF }, + // Recipe stats. + 1, + (int) TierEU.RECIPE_UEV); + + addElectricImplosionRecipe( + // IN. + new ItemStack[] { getModItem("GoodGenerator", "highDensityUraniumNugget", 5L) }, + new FluidStack[] { Materials.Infinity.getMolten(9L) }, + // OUT. + new ItemStack[] { getModItem("GoodGenerator", "highDensityUranium", 1L) }, + new FluidStack[] { GT_Values.NF }, + // Recipe stats. + 1, + (int) TierEU.RECIPE_UEV); + + addElectricImplosionRecipe( + // IN. + new ItemStack[] { getModItem("GoodGenerator", "highDensityThoriumNugget", 5L) }, + new FluidStack[] { Materials.Infinity.getMolten(9L) }, + // OUT. + new ItemStack[] { getModItem("GoodGenerator", "highDensityThorium", 1L) }, + new FluidStack[] { GT_Values.NF }, + // Recipe stats. + 1, + (int) TierEU.RECIPE_UEV); + + // Magneto material recipe for base fluid. + addElectricImplosionRecipe( + // IN. + new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.nanite, Materials.WhiteDwarfMatter, 1L), + GT_OreDictUnificator.get(OrePrefixes.nanite, Materials.Universium, 1L), + GT_OreDictUnificator.get(OrePrefixes.nanite, Materials.BlackDwarfMatter, 1L) }, + new FluidStack[] { Materials.RawStarMatter.getFluid(16 * 144L) }, + // OUT. + new ItemStack[] { GT_Values.NI }, + new FluidStack[] { Materials.MagnetohydrodynamicallyConstrainedStarMatter.getMolten(4 * 144L) }, + // Recipe stats. + 20 * 4, + (int) TierEU.RECIPE_UXV); + + addMagnetohydrodynamicallyConstrainedStarMatterPartRecipes(); + } + + private void addMagnetohydrodynamicallyConstrainedStarMatterPartRecipes() { + + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.frameGt, 1, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.nugget, 9, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.ingot, 1, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.plate, 1, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.plateDense, 1, 3); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.stick, 2, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.round, 8, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.bolt, 8, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.screw, 8, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.ring, 4, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.foil, 8, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.itemCasing, 2, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.gearGtSmall, 1, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.rotor, 1, 2); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.stickLong, 1, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.springSmall, 2, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.spring, 1, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.gearGt, 1, 2); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.wireFine, 8, 1); + } + + private void addWhiteDwarfMagnetoEICRecipe(final OrePrefixes part, final int multiplier, + final int circuitMultiplier) { + + final int partFraction = (int) (144 * part.mMaterialAmount / M); + + for (ItemStack circuit : circuits) { + addElectricImplosionRecipe( + new ItemStack[] { circuit.splitStack(circuitMultiplier), + getModItem("supersolarpanel", "solarsplitter", 1, 0), + getModItem("OpenComputers", "hologram2", circuitMultiplier, 0), + GT_OreDictUnificator.get(part, Materials.Universium, multiplier), }, + new FluidStack[] { Materials.MagnetohydrodynamicallyConstrainedStarMatter + .getMolten((long) partFraction * multiplier) }, + new ItemStack[] { GT_OreDictUnificator + .get(part, Materials.MagnetohydrodynamicallyConstrainedStarMatter, multiplier) }, + new FluidStack[] { GT_Values.NF }, + (int) (multiplier * (20 * partFraction / 144.0)), + (int) TierEU.RECIPE_UXV); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 8ffe956261..fe73bc18f6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -42,7 +42,6 @@ import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.google.common.collect.ArrayListMultimap; import com.gtnewhorizons.modularui.common.widget.ProgressBar; -import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; import gnu.trove.map.hash.TObjectDoubleHashMap; import gregtech.api.enums.*; @@ -317,7 +316,7 @@ public class StaticRecipeChangeLoaders { /** * Constructs a list of recipes to change by scanning all EBF recipes for uses of noble gases. - * + * * @param GasTags list of gas tags to look out for in EBF recipes * @return A multimap from the gas tag (noble and/or anaerobic) to all the recipes containing a gas with that tag */ @@ -343,7 +342,7 @@ public class StaticRecipeChangeLoaders { /** * Scans EBF recipes for no-gas variants of the recipes present in base. Adds these recipes to the base multimap. - * + * * @param base The recipe multimap to scan and modify * @return Set of item outputs (recipe.mOutputs[0]) of the no-gas recipes */ @@ -602,7 +601,7 @@ public class StaticRecipeChangeLoaders { "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", - 2, + 6, 2, 0, 0, @@ -625,73 +624,11 @@ public class StaticRecipeChangeLoaders { 1, BW_Util.getMachineVoltageFromTier(10), 0)); - } - - // Custom electric implosion compressor recipe. Cannot be overclocked. - if (Loader.isModLoaded("eternalsingularity")) { - - // 72L SpaceTime -> 1 Eternal singularity. - eicMap.addRecipe( - false, - new ItemStack[] { GT_Values.NI }, - new ItemStack[] { GT_ModHandler.getModItem("eternalsingularity", "eternal_singularity", 1L) }, - null, - new FluidStack[] { Materials.SpaceTime.getMolten(72L) }, - new FluidStack[] { GT_Values.NF }, - 100 * 20, - 128_000_000, - 1); // aSpecialVaue has no meaning here. - } - if (Loader.isModLoaded("universalsingularities")) { - - // Raw Exposed Optical Chip - eicMap.addRecipe( - false, - new ItemStack[] { ItemList.Circuit_Silicon_Wafer7.get(1L), - GT_ModHandler - .getModItem("universalsingularities", "universal.general.singularity", 1L, 20) }, - new ItemStack[] { ItemList.Circuit_Chip_Optical.get(16L) }, - null, - new FluidStack[] { GT_Values.NF }, - new FluidStack[] { GT_Values.NF }, - 5 * 20, - 125_829_120, - 1); + // Custom EIC recipes. + new ElectricImplosionCompressorRecipes().run(); } - eicMap.addRecipe( - false, - new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityPlutoniumNugget", 5L) }, - new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityPlutonium", 1L) }, - null, - new FluidStack[] { Materials.Infinity.getMolten(9L) }, - new FluidStack[] { GT_Values.NF }, - 1, - 7_864_320, - 1); - - eicMap.addRecipe( - false, - new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityUraniumNugget", 5L) }, - new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityUranium", 1L) }, - null, - new FluidStack[] { Materials.Infinity.getMolten(9L) }, - new FluidStack[] { GT_Values.NF }, - 1, - 7_864_320, - 1); - - eicMap.addRecipe( - false, - new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityThoriumNugget", 5L) }, - new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityThorium", 1L) }, - null, - new FluidStack[] { Materials.Infinity.getMolten(9L) }, - new FluidStack[] { GT_Values.NF }, - 1, - 7_864_320, - 1); } private static boolean checkForExplosives(ItemStack input) { -- cgit From 11c0eef9045dafefc4f2e7bd93aa1a15e72e191d Mon Sep 17 00:00:00 2001 From: miozune Date: Thu, 16 Feb 2023 15:10:52 +0900 Subject: Update buildscript and dependencies (#284) Former-commit-id: 765cecdbb58034913eebdbddb1370f583eb71539 --- build.gradle | 185 ++++++++++++++++++++++++++++++++++++++++++++++++++-- dependencies.gradle | 21 ++---- 2 files changed, 184 insertions(+), 22 deletions(-) diff --git a/build.gradle b/build.gradle index fe8a2e7be2..b808930520 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1675110695 +//version: 1676031737 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -9,11 +9,15 @@ import com.diffplug.blowdryer.Blowdryer import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import com.gtnewhorizons.retrofuturagradle.ObfuscationAttribute import com.gtnewhorizons.retrofuturagradle.mcp.ReobfuscatedJar +import com.gtnewhorizons.retrofuturagradle.minecraft.RunMinecraftTask import com.matthewprenger.cursegradle.CurseArtifact import com.matthewprenger.cursegradle.CurseRelation import com.modrinth.minotaur.dependencies.ModDependency import com.modrinth.minotaur.dependencies.VersionDependency +import cpw.mods.fml.relauncher.Side +import org.gradle.api.tasks.options.Option; import org.gradle.internal.logging.text.StyledTextOutput.Style import org.gradle.internal.logging.text.StyledTextOutputFactory import org.jetbrains.gradle.ext.* @@ -23,6 +27,7 @@ import java.nio.file.Paths import java.util.concurrent.TimeUnit import java.util.zip.ZipEntry import java.util.zip.ZipOutputStream +import javax.inject.Inject buildscript { repositories { @@ -66,7 +71,7 @@ plugins { id 'com.diffplug.spotless' version '6.7.2' apply false id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.1.2' + id 'com.gtnewhorizons.retrofuturagradle' version '1.1.6' } boolean settingsupdated = verifySettingsGradle() settingsupdated = verifyGitAttributes() || settingsupdated @@ -186,11 +191,21 @@ configurations { } if (enableModernJavaSyntax.toBoolean()) { + repositories { + mavenCentral { + mavenContent { + includeGroup("me.eigenraven.java8unsupported") + } + } + } + dependencies { annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:1.0.0' compileOnly('com.github.bsideup.jabel:jabel-javac-plugin:1.0.0') { transitive = false // We only care about the 1 annotation class } + // Allow using jdk.unsupported classes like sun.misc.Unsafe in the compiled code, working around JDK-8206937. + patchedMinecraft('me.eigenraven.java8unsupported:java-8-unsupported-shim:1.0.0') } tasks.withType(JavaCompile).configureEach { @@ -401,6 +416,16 @@ configurations.configureEach { } } } + def obfuscationAttr = it.attributes.getAttribute(ObfuscationAttribute.OBFUSCATION_ATTRIBUTE) + if (obfuscationAttr != null && obfuscationAttr.name == ObfuscationAttribute.SRG) { + resolutionStrategy.eachDependency { DependencyResolveDetails details -> + // Remap CoFH core cursemaven dev jar to the obfuscated version for runObfClient/Server + if (details.requested.group == 'curse.maven' && details.requested.name.endsWith('-69162') && details.requested.version == '2388751') { + details.useVersion '2388750' + details.because 'Pick obfuscated jar' + } + } + } } // Ensure tests have access to minecraft classes @@ -520,20 +545,20 @@ dependencies { annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3') annotationProcessor('com.google.guava:guava:24.1.1-jre') annotationProcessor('com.google.code.gson:gson:2.8.6') - annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.10:processor') + annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.12:processor') if (usesMixinDebug.toBoolean()) { runtimeOnlyNonPublishable('org.jetbrains:intellij-fernflower:1.2.1.16') } } if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { - implementation('com.gtnewhorizon:gtnhmixins:2.1.10') + implementation('com.gtnewhorizon:gtnhmixins:2.1.12') } } pluginManager.withPlugin('org.jetbrains.kotlin.kapt') { if (usesMixins.toBoolean()) { dependencies { - kapt('com.gtnewhorizon:gtnhmixins:2.1.10:processor') + kapt('com.gtnewhorizon:gtnhmixins:2.1.12:processor') } } } @@ -633,9 +658,142 @@ tasks.named("processResources", ProcessResources).configure { if (usesMixins.toBoolean()) { from refMap + dependsOn("compileJava", "compileScala") + } +} + +ext.java17Toolchain = (JavaToolchainSpec spec) -> { + spec.languageVersion.set(JavaLanguageVersion.of(17)) + spec.vendor.set(JvmVendorSpec.matching("jetbrains")) +} + +ext.java17DependenciesCfg = configurations.create("java17Dependencies") +ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies") + +dependencies { + def lwjgl3ifyVersion = '1.1.21' + def asmVersion = '9.4' + if (modId != 'lwjgl3ify') { + java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") + } + if (modId != 'hodgepodge') { + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.31') + } + + java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false} + java17PatchDependencies("org.ow2.asm:asm:${asmVersion}") + java17PatchDependencies("org.ow2.asm:asm-commons:${asmVersion}") + java17PatchDependencies("org.ow2.asm:asm-tree:${asmVersion}") + java17PatchDependencies("org.ow2.asm:asm-analysis:${asmVersion}") + java17PatchDependencies("org.ow2.asm:asm-util:${asmVersion}") + java17PatchDependencies('org.ow2.asm:asm-deprecated:7.1') + java17PatchDependencies("org.apache.commons:commons-lang3:3.12.0") + java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") +} + +ext.java17JvmArgs = [ + // Java 9+ support + "--illegal-access=warn", + "-Dfile.encoding=UTF-8", + "-Djava.security.manager=allow", + "--add-opens", "java.base/jdk.internal.loader=ALL-UNNAMED", + "--add-opens", "java.base/java.net=ALL-UNNAMED", + "--add-opens", "java.base/java.nio=ALL-UNNAMED", + "--add-opens", "java.base/java.io=ALL-UNNAMED", + "--add-opens", "java.base/java.lang=ALL-UNNAMED", + "--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED", + "--add-opens", "java.base/java.text=ALL-UNNAMED", + "--add-opens", "java.base/java.util=ALL-UNNAMED", + "--add-opens", "java.base/jdk.internal.reflect=ALL-UNNAMED", + "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", + "--add-opens", "java.desktop/sun.awt.image=ALL-UNNAMED", + "--add-modules", "jdk.dynalink", + "--add-opens", "jdk.dynalink/jdk.dynalink.beans=ALL-UNNAMED", + "--add-modules", "java.sql.rowset", + "--add-opens", "java.sql.rowset/javax.sql.rowset.serial=ALL-UNNAMED" +] + +ext.hotswapJvmArgs = [ + // DCEVM advanced hot reload + "-XX:+AllowEnhancedClassRedefinition", + "-XX:HotswapAgent=fatjar" +] + +ext.setupHotswapAgentTask = tasks.register("setupHotswapAgent") { + group = "GTNH Buildscript" + description = "Installs a recent version of HotSwapAgent into the Java 17 JetBrains runtime directory" + def hsaUrl = 'https://github.com/HotswapProjects/HotswapAgent/releases/download/1.4.2-SNAPSHOT/hotswap-agent-1.4.2-SNAPSHOT.jar' + def targetFolderProvider = javaToolchains.launcherFor(java17Toolchain).map {it.metadata.installationPath.dir("lib/hotswap")} + def targetFilename = "hotswap-agent.jar" + onlyIf { + !targetFolderProvider.get().file(targetFilename).asFile.exists() + } + doLast { + def targetFolder = targetFolderProvider.get() + targetFolder.asFile.mkdirs() + download.run { + src hsaUrl + dest targetFolder.file(targetFilename).asFile + overwrite false + tempAndMove true + } + } +} + +public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask { + // IntelliJ doesn't seem to allow commandline arguments so we also support an env variable + private boolean enableHotswap = Boolean.valueOf(System.getenv("HOTSWAP")); + + @Input + public boolean getEnableHotswap() { return enableHotswap } + @Option(option = "hotswap", description = "Enables HotSwapAgent for enhanced class reloading under a debugger") + public boolean setEnableHotswap(boolean enable) { enableHotswap = enable } + + @Inject + public RunHotswappableMinecraftTask(Side side, String superTask) { + super(side) + + this.lwjglVersion = 3 + this.javaLauncher = project.javaToolchains.launcherFor(project.java17Toolchain) + this.extraJvmArgs.addAll(project.java17JvmArgs) + this.extraJvmArgs.addAll(project.provider(() -> enableHotswap ? project.hotswapJvmArgs : [])) + + this.classpath(project.java17PatchDependenciesCfg) + if (side == Side.CLIENT) { + this.classpath(project.minecraftTasks.lwjgl3Configuration) + } + // Use a raw provider instead of map to not create a dependency on the task + this.classpath(project.provider(() -> project.tasks.named(superTask, RunMinecraftTask).get().classpath)) + this.classpath.filter { file -> + !file.path.contains("2.9.4-nightly-20150209") // Remove lwjgl2 + } + this.classpath(project.java17DependenciesCfg) + + if (!(project.usesMixins.toBoolean() || project.forceEnableMixins.toBoolean())) { + this.extraArgs.addAll("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker") + } } } +def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Side.CLIENT, "runClient") +runClient17Task.configure { + setup(project) + group = "Modded Minecraft" + description = "Runs the modded client using Java 17, lwjgl3ify and Hodgepodge" + dependsOn(setupHotswapAgentTask, mcpTasks.launcherSources.classesTaskName, minecraftTasks.taskDownloadVanillaAssets, mcpTasks.taskPackagePatchedMc, 'jar') + mainClass = "GradleStart" +} + +def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Side.SERVER, "runServer") +runServer17Task.configure { + setup(project) + group = "Modded Minecraft" + description = "Runs the modded server using Java 17, lwjgl3ify and Hodgepodge" + dependsOn(setupHotswapAgentTask, mcpTasks.launcherSources.classesTaskName, minecraftTasks.taskDownloadVanillaAssets, mcpTasks.taskPackagePatchedMc, 'jar') + mainClass = "GradleStartServer" + extraArgs.add("nogui") +} + def getManifestAttributes() { def manifestAttributes = [:] if (!containsMixinsAndOrCoreModOnly.toBoolean() && (usesMixins.toBoolean() || coreModClass)) { @@ -705,7 +863,7 @@ if (usesShadowedDependencies.toBoolean()) { javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements) { skip() } - for (runTask in ["runClient", "runServer"]) { + for (runTask in ["runClient", "runServer", "runClient17", "runServer17"]) { tasks.named(runTask).configure { dependsOn("shadowJar") } @@ -743,6 +901,7 @@ idea { module { downloadJavadoc = true downloadSources = true + inheritOutputDirs = true } project { settings { @@ -753,6 +912,20 @@ idea { "2. Run Server"(Gradle) { taskNames = ["runServer"] } + "1a. Run Client (Java 17)"(Gradle) { + taskNames = ["runClient17"] + } + "2a. Run Server (Java 17)"(Gradle) { + taskNames = ["runServer17"] + } + "1b. Run Client (Java 17, Hotswap)"(Gradle) { + taskNames = ["runClient17"] + envs = ["HOTSWAP": "true"] + } + "2b. Run Server (Java 17, Hotswap)"(Gradle) { + taskNames = ["runServer17"] + envs = ["HOTSWAP": "true"] + } "3. Run Obfuscated Client"(Gradle) { taskNames = ["runObfClient"] } diff --git a/dependencies.gradle b/dependencies.gradle index fc48ad2d76..6172aaef14 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,23 +1,14 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.267:dev") - compile("com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev") - compile("com.github.GTNewHorizons:TecTech:5.0.85:dev") - compile("com.github.GTNewHorizons:NotEnoughItems:2.3.24-GTNH:dev") - compile("com.github.GTNewHorizons:TinkersConstruct:1.9.16-GTNH:dev") - compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.7:dev") - compile("com.github.GTNewHorizons:CodeChickenCore:1.1.7:dev") - compile("com.github.GTNewHorizons:Galacticraft:3.0.64-GTNH:dev") - compile("com.github.GTNewHorizons:ModularUI:1.0.52:dev") - compile("com.github.GTNewHorizons:GalacticGregGT5:1.0.8:dev") { + api("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.278:dev") + api("com.github.GTNewHorizons:TecTech:5.0.85:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.23-GTNH:dev") + api("com.github.GTNewHorizons:Galacticraft:3.0.64-GTNH:dev") + api("com.github.GTNewHorizons:GalacticGregGT5:1.0.8:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } - compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") - compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-152-GTNH:dev") { - transitive = false - } compileOnly("com.github.GTNewHorizons:AppleCore:3.2.8:dev") { transitive = false } @@ -44,6 +35,4 @@ dependencies { compileOnly("com.github.GTNewHorizons:ProjectRed:4.7.9-GTNH:dev") { transitive = false } - runtimeOnly("com.github.GTNewHorizons:Yamcl:0.5.84:dev") - runtimeOnly("com.github.GTNewHorizons:ironchest:6.0.71:dev") //needed for Galacticraft } -- cgit From 94f577bd2e678b675d2b96df75bc4cd70c6fe114 Mon Sep 17 00:00:00 2001 From: miozune Date: Fri, 17 Feb 2023 13:50:12 +0900 Subject: Don't modify EOH recipes (#285) Former-commit-id: 4f239276d3bcd239225523656c9994593f7e288a --- .../system/material/GT_Enhancement/PlatinumSludgeOverHaul.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 6658474734..fadea47d5d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -656,7 +656,8 @@ public class PlatinumSludgeOverHaul { // gt machines maploop: for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { if (map == GT_Recipe.GT_Recipe_Map.sFusionRecipes || map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes - || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes) + || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes + || map.mUnlocalizedName.equals("gt.recipe.eyeofharmony")) continue; HashSet toDel = new HashSet<>(); recipeloop: for (GT_Recipe recipe : map.mRecipeList) { -- cgit From cb157674a662dceb6562e5153422cc0d9194fa9b Mon Sep 17 00:00:00 2001 From: Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com> Date: Fri, 17 Feb 2023 13:28:13 +0000 Subject: Restore recipe for optical chips (#286) * Restore recipe for optical chips * Spotless * Clean up --------- Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Former-commit-id: ed28bc5e63eaac23dfad656e83e487ae2eb9c414 --- .../common/loaders/ElectricImplosionCompressorRecipes.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java index fefd6fce54..58aa909e5e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java @@ -48,6 +48,20 @@ public class ElectricImplosionCompressorRecipes implements Runnable { // Recipe stats. 100 * 20, (int) TierEU.RECIPE_UMV); + + // Raw Exposed Optical Chip + addElectricImplosionRecipe( + // IN. + new ItemStack[] { ItemList.Circuit_Silicon_Wafer7.get(1L), + // Fluxed Electrum Singularity. + getModItem("universalsingularities", "universal.general.singularity", 1L, 20) }, + new FluidStack[] { GT_Values.NF }, + // OUT. + new ItemStack[] { ItemList.Circuit_Chip_Optical.get(16L) }, + new FluidStack[] { GT_Values.NF }, + (int) TierEU.RECIPE_UMV, + 5 * 20); + } addElectricImplosionRecipe( -- cgit From 48227d119a45382c7ef347833fa9274f04dea874 Mon Sep 17 00:00:00 2001 From: Maxim Date: Fri, 17 Feb 2023 15:44:12 +0100 Subject: Don't save constant tier to NBT (#288) Former-commit-id: ad14f30307c61d077cb98ae006928cb5f054627d --- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 44 +++++++++++----------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index dfcdeddea5..e95eaa92df 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -68,14 +68,14 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private float totalWeight; private int multiplier = 1; - protected byte TIER_MULTIPLIER; + protected final byte TIER_MULTIPLIER; private boolean mBlacklist = false; /** * Public method giving other mods the ability to add manually a material with an ore version into the external * dromap for a specified dim id - * + * * @param DimensionID the dim id targetted * @param Material the material with an ore version * @param weight the non normalised version of the given weight @@ -101,14 +101,12 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setByte("TIER_MULTIPLIER", TIER_MULTIPLIER); aNBT.setBoolean("mBlacklist", mBlacklist); } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - TIER_MULTIPLIER = aNBT.getByte("TIER_MULTIPLIER"); mBlacklist = aNBT.getBoolean("mBlacklist"); } @@ -187,7 +185,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * getter for the external drop map - * + * * @return the extraDriosDimMap */ public static ArrayListMultimap, Float>> getExtraDropsDimMap() { @@ -196,7 +194,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Makes a predicate for the GT normal ore veins worldgen - * + * * @return the predicate */ private Predicate makeOreLayerPredicate() { @@ -222,7 +220,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Makes a predicate for the GT normal small ore worldgen - * + * * @return the predicate */ private Predicate makeSmallOresPredicate() { @@ -247,7 +245,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Method used to add an ore to the droplist - * + * * @param key a Pair of where the int is the meta of the ore, and the bool is true for BW ores, false * for GT ores * @param value the non normalised weight @@ -266,7 +264,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Method to add the ores of a vanilla GT worldgen - * + * * @param oreLayerPredicate the predicate made by makeOreLayerPredicate */ private void getDropsVanillaVeins(Predicate oreLayerPredicate) { @@ -281,7 +279,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Method to add the small ores of a vanilla GT worldgen - * + * * @param smallOresPredicate the predicate made by makeSmallOresPredicate */ private void getDropsVanillaSmallOres(Predicate smallOresPredicate) { @@ -292,7 +290,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * add to the dropmap the ores from the gagreg space worldgen corresponding to the target dim - * + * * @param finalDef ModDimensionDef corresponding to the target dim */ private void getDropsOreVeinsSpace(ModDimensionDef finalDef) { @@ -320,7 +318,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * add to the dropmap the small ores from the gagreg space worldgen corresponding to the target dim - * + * * @param finalDef ModDimensionDef corresponding to the target dim */ private void getDropsSmallOreSpace(ModDimensionDef finalDef) { @@ -337,7 +335,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * method used to pick the next key in the dropmap that will be used to generate the ore. - * + * * @return the chosen key */ private Pair getOreDamage() { @@ -353,7 +351,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Method used to check the current gat and its corresponding multiplier - * + * * @return the noble gas in the hatch. returns null if there is no noble gas found. */ private FluidStack getNobleGasInputAndSetMultiplier() { @@ -371,7 +369,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * method used to decrement the quantity of gas in the hatch - * + * * @param gasToConsume the fluid stack in the hatch * @return if yes or no it was able to decrement the quantity of the fluidstack */ @@ -396,7 +394,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Handles the addition of Ross dims' ores into the drop map - * + * * @param aID dim id of Ross128b or Ross128ba */ private void getDropMapRoss(int aID) { @@ -410,7 +408,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Method used to generate a consumer used specifically to add BW ores into the dropmap - * + * * @return the consumer */ private Consumer makeAddToList() { @@ -425,7 +423,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Method used to build the ModDimensionDef object corresponding to the dimension the VM is in. - * + * * @return the ModDimensionDef object. */ private ModDimensionDef makeModDimDef() { @@ -439,7 +437,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Handles the addition of small ores for bartwork dims - * + * * @param finalDef the ModDimensionDef object corresponding to the dim * @param addToList a consumer used to add the ores from the vein with proper weight */ @@ -457,7 +455,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Handles the addition of small ores for bartwork dims - * + * * @param finalDef the ModDimensionDef object corresponding to the dim */ private void addSmallOresBartworks(ModDimensionDef finalDef) { @@ -479,7 +477,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Handles the ores added manually with addMatierialToDimensionList - * + * * @param id the specified dim id */ private void handleExtraDrops(int id) { @@ -497,7 +495,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Computes the ores of the dim for the specifed dim id - * + * * @param id the dim number */ private void handleModDimDef(int id) { @@ -554,7 +552,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Builds the ore item stack from the key specified in the dropmap - * + * * @param stats the key of the dropmap * @return an ItemStack corresponding to the target ore, with a stacksize corresponding to the mutiplier induced by * the gas used -- cgit From 4fa9549f46eb883cff9a96346be38d73bca7c5f4 Mon Sep 17 00:00:00 2001 From: GDCloud <93287602+GDCloudstrike@users.noreply.github.com> Date: Fri, 17 Feb 2023 18:56:05 +0100 Subject: swap time and voltage (#289) Former-commit-id: 23b227f6b046247060524cd5ddc7a3e7e052df32 --- .../bartworks/common/loaders/ElectricImplosionCompressorRecipes.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java index 58aa909e5e..6a9b063dd0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java @@ -59,8 +59,8 @@ public class ElectricImplosionCompressorRecipes implements Runnable { // OUT. new ItemStack[] { ItemList.Circuit_Chip_Optical.get(16L) }, new FluidStack[] { GT_Values.NF }, - (int) TierEU.RECIPE_UMV, - 5 * 20); + 5 * 20, + (int) TierEU.RECIPE_UMV); } -- cgit From df8abec198820c0b03d615629dea0133e4ef6f20 Mon Sep 17 00:00:00 2001 From: miozune Date: Mon, 20 Feb 2023 01:59:03 +0900 Subject: Fix weirdness with custom renderers (#290) Former-commit-id: 1fbd438fc1e30dceb7de5ac321fb76d20171e628 --- build.gradle | 4 +- dependencies.gradle | 2 +- .../system/material/BW_MetaGenerated_Items.java | 2 +- .../material/GT_Enhancement/BWGTMetaItems.java | 54 ++++++++++++++-------- 4 files changed, 38 insertions(+), 24 deletions(-) diff --git a/build.gradle b/build.gradle index b808930520..6997e9d25f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1676031737 +//version: 1676679815 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -677,7 +677,7 @@ dependencies { java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") } if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.31') + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.35') } java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false} diff --git a/dependencies.gradle b/dependencies.gradle index 6172aaef14..b20cb2ae49 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.278:dev") + api("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.287:dev") api("com.github.GTNewHorizons:TecTech:5.0.85:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.23-GTNH:dev") api("com.github.GTNewHorizons:Galacticraft:3.0.64-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 30f1a6813f..99d4afb1e1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -216,7 +216,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } @Override - public final IIcon getIconFromDamage(int aMetaData) { + public IIcon getIconFromDamage(int aMetaData) { if (aMetaData < 0) return null; Werkstoff tMaterial = werkstoffHashMap.get((short) aMetaData); if (tMaterial == null) return null; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java index 96bc459e91..c2c3730874 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -26,6 +26,7 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; @@ -44,6 +45,7 @@ import gregtech.api.enums.TextureSet; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.util.GT_OreDictUnificator; +import gregtech.common.render.items.GT_GeneratedMaterial_Renderer; public class BWGTMetaItems extends BW_MetaGenerated_Items { @@ -98,10 +100,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { private Materials getMaterial(ItemStack is) { if (is == null || is.getItem() != this) return null; final int meta = is.getItemDamage(); - Materials material; - if (meta > 1000 && hasList) material = NoMetaValue.get(meta - 1001); - else material = Materials.values()[meta]; - return material; + return getMaterialFromMeta(meta); } @Override @@ -127,11 +126,12 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { @Override public IIconContainer getIconContainer(int aMetaData) { if (this.orePrefixes.mTextureIndex == -1) return getIconContainerBartWorks(aMetaData); - if (aMetaData > 1000 && hasList) - return NoMetaValue.get(aMetaData - 1001).mIconSet.mTextures[this.orePrefixes.mTextureIndex]; - if (aMetaData < 0 || aMetaData > Materials.values().length || Materials.values()[(short) aMetaData] == null) + Materials material = getMaterialFromMeta(aMetaData); + if (material != null) { + return material.mIconSet.mTextures[this.orePrefixes.mTextureIndex]; + } else { return null; - return Materials.values()[(short) aMetaData].mIconSet.mTextures[this.orePrefixes.mTextureIndex]; + } } @Override @@ -142,14 +142,32 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { if (iconLink == null) return null; - Materials material; - - if (aMetaData > 1000 && hasList) material = NoMetaValue.get(aMetaData - 1001); - else material = Materials.values()[aMetaData]; + Materials material = getMaterialFromMeta(aMetaData); if (material == null || material.mIconSet == null) return null; - return iconLink.get(material.mIconSet); + return iconLink.getOrDefault(material.mIconSet, iconLink.get(TextureSet.SET_DULL)); + } + + @Override + public IIcon getIconFromDamage(int aMetaData) { + return getIcon(aMetaData, 0); + } + + @Override + public GT_GeneratedMaterial_Renderer getMaterialRenderer(int aMetaData) { + return getMaterialFromMeta(aMetaData).renderer; + } + + public Materials getMaterialFromMeta(int aMetaData) { + if (aMetaData > 1000 && hasList) { + return NoMetaValue.get(aMetaData - 1001); + } else { + if (aMetaData < 0 || aMetaData >= Materials.values().length) { + return null; + } + return Materials.values()[aMetaData]; + } } @Override @@ -184,15 +202,12 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { @Override public short[] getColorForGUI(ItemStack aStack) { - if (aStack.getItemDamage() > 1000 && hasList) return NoMetaValue.get(aStack.getItemDamage() - 1001).mRGBa; - return Materials.values()[aStack.getItemDamage()].mRGBa; + return getMaterial(aStack).mRGBa; } @Override public String getNameForGUI(ItemStack aStack) { - if (aStack.getItemDamage() > 1000 && hasList) - return NoMetaValue.get(aStack.getItemDamage() - 1001).mDefaultLocalName; - return Materials.values()[aStack.getItemDamage()].mDefaultLocalName; + return getMaterial(aStack).mDefaultLocalName; } @Override @@ -200,8 +215,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { @Override public short[] getRGBa(ItemStack aStack) { - if (aStack.getItemDamage() > 1000 && hasList) return NoMetaValue.get(aStack.getItemDamage() - 1001).mRGBa; - return Materials.values()[aStack.getItemDamage()].mRGBa; + return getMaterial(aStack).mRGBa; } public boolean onEntityItemUpdate(EntityItem aItemEntity) { -- cgit From a185ab1351ff7b35f0624f2a32e78da5283e178a Mon Sep 17 00:00:00 2001 From: LewisSaber <39595617+LewisSaber@users.noreply.github.com> Date: Sat, 25 Feb 2023 23:43:26 +0200 Subject: Fix Cubic zirconia recipe (#292) Former-commit-id: d7b75cf7b55efeff87a77106b580ddef72327457 --- .../system/material/processingLoaders/AdditionalRecipes.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 43ce539dab..14aa8fbc2d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -318,9 +318,8 @@ public class AdditionalRecipes { // Zr + 2O =Y22O3= ZrO2 GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe( false, - new ItemStack[] { WerkstoffLoader.Zirconium.get(dust, 10), WerkstoffLoader.YttriumOxide.get(dust) }, - new ItemStack[] { WerkstoffLoader.YttriumOxide.get(dust), - WerkstoffLoader.CubicZirconia.get(gemFlawed, 40) }, + new ItemStack[] { WerkstoffLoader.Zirconium.get(dust, 10), WerkstoffLoader.YttriumOxide.get(dust, 0) }, + new ItemStack[] { WerkstoffLoader.CubicZirconia.get(gemFlawed, 40) }, null, null, new FluidStack[] { Materials.Oxygen.getGas(20000) }, -- cgit From 2a5f9fbd9b8a994a081d358681924eee4cb6934c Mon Sep 17 00:00:00 2001 From: Maxim Date: Sun, 26 Feb 2023 18:26:39 +0100 Subject: Implemented enhanced multiblock GUI (#291) * Implemented enhanced multiblock GUI * Added override to show that a CAL has been imprinted * Update dependencies.gradle * Fix Cubic zirconia recipe (#292) (#293) Co-authored-by: LewisSaber <39595617+LewisSaber@users.noreply.github.com> --------- Co-authored-by: Martin Robertz Co-authored-by: LewisSaber <39595617+LewisSaber@users.noreply.github.com> Former-commit-id: 286ef64ddde387ee10114caf0cf52cdab1ecf22c --- dependencies.gradle | 2 +- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 18 ++++++++++ .../mega/GT_TileEntity_MegaBlastFurnace.java | 40 +++++++++++++--------- .../mega/GT_TileEntity_MegaChemicalReactor.java | 24 +++++++------ .../mega/GT_TileEntity_MegaDistillTower.java | 28 +++++++-------- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 29 +++++++--------- 6 files changed, 82 insertions(+), 59 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index b20cb2ae49..7ecfbd7d29 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.287:dev") + api("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.297-pre:dev") api("com.github.GTNewHorizons:TecTech:5.0.85:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.23-GTNH:dev") api("com.github.GTNewHorizons:Galacticraft:3.0.64-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 01cf3bd854..6f2e501995 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -39,6 +39,9 @@ import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructa import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; @@ -63,6 +66,8 @@ public class GT_TileEntity_CircuitAssemblyLine extends private static final String STRUCTURE_PIECE_FIRST = "first"; private static final String STRUCTURE_PIECE_NEXT = "next"; + private String imprintedItemName; + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition .builder() .addShape( @@ -167,6 +172,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override public void loadNBTData(NBTTagCompound aNBT) { this.type = aNBT.getCompoundTag("Type"); + imprintedItemName = GT_LanguageManager.getTranslateableItemStackName(ItemStack.loadItemStackFromNBT(this.type)); super.loadNBTData(aNBT); } @@ -198,6 +204,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends } ItemStack stack = ItemStack.loadItemStackFromNBT(this.type); + imprintedItemName = GT_LanguageManager.getTranslateableItemStackName(stack); if (stack == null) return false; @@ -394,4 +401,15 @@ public class GT_TileEntity_CircuitAssemblyLine extends } return -1; } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + super.addUIWidgets(builder, buildContext); + builder.widget(new FakeSyncWidget.StringSyncer(() -> imprintedItemName, val -> imprintedItemName = val)); + } + + @Override + protected boolean isRecipeLockingEnabled() { + return imprintedItemName != null && !imprintedItemName.equals(""); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index bb00ef8063..084af4fae7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -200,13 +200,15 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock super.loadNBTData(aNBT); this.circuitMode = aNBT.getByte("circuitMode"); this.glasTier = aNBT.getByte("glasTier"); - this.isBussesSeparate = aNBT.getBoolean("isBussesSeparate"); - this.mUseMultiparallelMode = aNBT.getBoolean("mUseMultiparallelMode"); + if (!aNBT.hasKey(INPUT_SEPARATION_NBT_KEY)) { + inputSeparation = aNBT.getBoolean("isBussesSeparate"); + } + if (!aNBT.hasKey(BATCH_MODE_NBT_KEY)) { + batchMode = aNBT.getBoolean("mUseMultiparallelMode"); + } } private byte circuitMode = 0; - private boolean isBussesSeparate = false; - private boolean mUseMultiparallelMode = false; @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { @@ -227,18 +229,18 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { - mUseMultiparallelMode = !mUseMultiparallelMode; - if (mUseMultiparallelMode) { + batchMode = !batchMode; + if (batchMode) { GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); } else { GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); } return true; } else { - isBussesSeparate = !isBussesSeparate; + inputSeparation = !inputSeparation; GT_Utility.sendChatToPlayer( aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate); + StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); return true; } } @@ -264,8 +266,6 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock super.saveNBTData(aNBT); aNBT.setByte("glasTier", glasTier); aNBT.setByte("circuitMode", circuitMode); - aNBT.setBoolean("isBussesSeparate", isBussesSeparate); - aNBT.setBoolean("mUseMultiparallelMode", mUseMultiparallelMode); } @Override @@ -310,7 +310,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); GT_Recipe tRecipe = null; - if (isBussesSeparate) { + if (inputSeparation) { for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) { ArrayList tInputList = new ArrayList<>(); tBus.mRecipeMap = getRecipeMap(); @@ -366,15 +366,13 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock long precutRecipeVoltage = (long) (tRecipe.mEUt * Math.pow(0.95, tHeatCapacityDivTiers)); long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / precutRecipeVoltage); - if (mUseMultiparallelMode && tMaxPara == ConfigHandler.megaMachinesMax) { + if (batchMode && tMaxPara == ConfigHandler.megaMachinesMax) { tMaxPara *= 128; } float tBatchMultiplier = 1.0f; if (this.mHeatingCapacity >= tRecipe.mSpecialValue) { int tCurrentPara = handleParallelRecipe(tRecipe, tFluids, tInputs, (int) tMaxPara); - tBatchMultiplier = mUseMultiparallelMode - ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) - : 1.0f; + tBatchMultiplier = batchMode ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) : 1.0f; this.updateSlots(); if (tCurrentPara <= 0) return false; processed = Math.min(tCurrentPara, ConfigHandler.megaMachinesMax); @@ -401,7 +399,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock if (this.lEUt > 0) this.lEUt = (-this.lEUt); - if (mUseMultiparallelMode) { + if (batchMode) { this.mMaxProgresstime = (int) Math.ceil(this.mMaxProgresstime * tBatchMultiplier); } @@ -524,4 +522,14 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sBlastRecipes; } + + @Override + protected boolean isInputSeparationButtonEnabled() { + return true; + } + + @Override + protected boolean isBatchModeButtonEnabled() { + return true; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index b8dda555e6..5f25c28018 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -117,26 +117,25 @@ public class GT_TileEntity_MegaChemicalReactor return false; } // TO IMPLEMENT - private boolean mUseMultiparallelMode = false; - @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setBoolean("mUseMultiparallelMode", mUseMultiparallelMode); } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - this.mUseMultiparallelMode = aNBT.getBoolean("mUseMultiparallelMode"); + if (!aNBT.hasKey(BATCH_MODE_NBT_KEY)) { + batchMode = aNBT.getBoolean("mUseMultiparallelMode"); + } } @Override public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { - mUseMultiparallelMode = !mUseMultiparallelMode; - if (mUseMultiparallelMode) { + batchMode = !batchMode; + if (batchMode) { GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); } else { GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); @@ -167,14 +166,12 @@ public class GT_TileEntity_MegaChemicalReactor if (tRecipe != null) { found_Recipe = true; long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); - if (mUseMultiparallelMode && tMaxPara == ConfigHandler.megaMachinesMax) { + if (batchMode && tMaxPara == ConfigHandler.megaMachinesMax) { tMaxPara *= 128; } int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); - tBatchMultiplier = mUseMultiparallelMode - ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) - : 1.0f; + tBatchMultiplier = batchMode ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) : 1.0f; this.updateSlots(); if (tCurrentPara <= 0) { @@ -202,7 +199,7 @@ public class GT_TileEntity_MegaChemicalReactor return false; } - if (mUseMultiparallelMode) { + if (batchMode) { this.mMaxProgresstime = (int) Math.ceil(this.mMaxProgresstime * tBatchMultiplier); } @@ -306,4 +303,9 @@ public class GT_TileEntity_MegaChemicalReactor if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; return false; } + + @Override + protected boolean isBatchModeButtonEnabled() { + return true; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 2cc880e4b0..a45fd705c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -368,26 +368,20 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock true); } - private boolean mUseMultiparallelMode = false; - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setBoolean("mUseMultiparallelMode", mUseMultiparallelMode); - } - @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - this.mUseMultiparallelMode = aNBT.getBoolean("mUseMultiparallelMode"); + if (!aNBT.hasKey(BATCH_MODE_NBT_KEY)) { + batchMode = aNBT.getBoolean("mUseMultiparallelMode"); + } } @Override public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { - mUseMultiparallelMode = !mUseMultiparallelMode; - if (mUseMultiparallelMode) { + batchMode = !batchMode; + if (batchMode) { GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); } else { GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); @@ -438,12 +432,11 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock if (tRecipe != null) { found_Recipe = true; long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); - if (mUseMultiparallelMode && tMaxPara == ConfigHandler.megaMachinesMax) { + if (batchMode && tMaxPara == ConfigHandler.megaMachinesMax) { tMaxPara *= 128; } int tCurrentPara = handleParallelRecipe(tRecipe, new FluidStack[] { tFluid }, null, (int) tMaxPara); - tBatchMultiplier = mUseMultiparallelMode - ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) + tBatchMultiplier = batchMode ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) : 1.0f; this.updateSlots(); processed = Math.min(tCurrentPara, ConfigHandler.megaMachinesMax); @@ -468,7 +461,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock this.lEUt = (-this.lEUt); } - if (mUseMultiparallelMode) { + if (batchMode) { this.mMaxProgresstime = (int) Math.ceil(this.mMaxProgresstime * tBatchMultiplier); } @@ -490,4 +483,9 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock dumpFluid(mOutputHatchesByLayer.get(i), tStack, false); } } + + @Override + protected boolean isBatchModeButtonEnabled() { + return true; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 9ea2d56114..e691ea8f95 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -189,26 +189,20 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc return GT_Recipe.GT_Recipe_Map.sVacuumRecipes; } - private boolean mUseMultiparallelMode = false; - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setBoolean("mUseMultiparallelMode", mUseMultiparallelMode); - } - @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - this.mUseMultiparallelMode = aNBT.getBoolean("mUseMultiparallelMode"); + if (!aNBT.hasKey(BATCH_MODE_NBT_KEY)) { + batchMode = aNBT.getBoolean("mUseMultiparallelMode"); + } } @Override public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { - mUseMultiparallelMode = !mUseMultiparallelMode; - if (mUseMultiparallelMode) { + batchMode = !batchMode; + if (batchMode) { GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); } else { GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); @@ -240,14 +234,12 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc found_Recipe = true; long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); - if (mUseMultiparallelMode && tMaxPara == ConfigHandler.megaMachinesMax) { + if (batchMode && tMaxPara == ConfigHandler.megaMachinesMax) { tMaxPara *= 128; } int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); - tBatchMultiplier = mUseMultiparallelMode - ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) - : 1.0f; + tBatchMultiplier = batchMode ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) : 1.0f; this.updateSlots(); if (tCurrentPara <= 0) return false; @@ -273,7 +265,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc this.lEUt = (-this.lEUt); } - if (mUseMultiparallelMode) { + if (batchMode) { this.mMaxProgresstime = (int) Math.ceil(this.mMaxProgresstime * tBatchMultiplier); } @@ -326,4 +318,9 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc } return rTexture; } + + @Override + protected boolean isBatchModeButtonEnabled() { + return true; + } } -- cgit From 4e6398bb504fe51530265984e628bffb30f03290 Mon Sep 17 00:00:00 2001 From: Maxim Date: Mon, 27 Feb 2023 21:28:41 +0100 Subject: Override GUI size (#294) Former-commit-id: 31b52537bfd2d85d274295d8b4d7dcaa57786d36 --- .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index 28527a171a..6bb34f8cdc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -57,6 +57,7 @@ import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.api.drawable.ItemDrawable; import com.gtnewhorizons.modularui.api.drawable.Text; import com.gtnewhorizons.modularui.api.math.Color; +import com.gtnewhorizons.modularui.api.math.Pos2d; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.api.widget.Widget; @@ -543,6 +544,21 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse else return new IDrawable[] { GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CHECKMARK }; }; + @Override + public int getGUIHeight() { + return 166; + } + + @Override + public int getGUIWidth() { + return 176; + } + + @Override + public void bindPlayerInventoryUI(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.bindPlayerInventory(buildContext.getPlayer(), new Pos2d(7, 83), this.getGUITextureSet().getItemSlot()); + } + @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( -- cgit From e73d866f070863892b232ade1a2fb6de9bc97602 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Mon, 27 Feb 2023 22:09:18 +0100 Subject: Fix GUI scrolling in EIG (#295) Former-commit-id: b416a306e0729924c301520ba02cd6b2c35270f1 --- dependencies.gradle | 1 + .../multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java | 10 +++------- .../common/tileentities/multis/GT_TileEntity_HTGR.java | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 7ecfbd7d29..fd2c68d043 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -8,6 +8,7 @@ dependencies { api("com.github.GTNewHorizons:GalacticGregGT5:1.0.8:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } + api("com.github.GTNewHorizons:ModularUI:1.0.66:dev") compileOnly("com.github.GTNewHorizons:AppleCore:3.2.8:dev") { transitive = false diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index 6bb34f8cdc..408342006e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -632,12 +632,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse return Collections.emptyList(); }).setSize(18, 18)); } - cropsContainer.widget(row.setPos(0, i * 18).setEnabled(widget -> { - int y = widget.getPos().y; - int cy = cropsContainer.getVerticalScrollOffset(); - int ch = cropsContainer.getVisibleHeight(); - return y >= cy - ch && y <= cy + ch; - })); + cropsContainer.widget( + row.setPos(0, i * 18).setEnabled(widget -> widget.getPos().y < cropsContainer.getVisibleHeight())); } cropsContainer.attachSyncer( new FakeSyncWidget.ListSyncer<>( @@ -1033,7 +1029,6 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse World world = tileEntity.getBaseMetaTileEntity().getWorld(); this.input = input.copy(); this.isValid = false; - this.noHumidity = noHumidity; if (IC2) { GreenHouseSlotIC2(tileEntity, world, input, noHumidity); return; @@ -1093,6 +1088,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse ItemStack input, boolean noHumidity) { if (!ItemList.IC2_Crop_Seeds.isStackEqual(input, true, true)) return; this.isIC2Crop = true; + this.noHumidity = noHumidity; recalculate(tileEntity, world); if (this.isValid) input.stackSize--; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 656d9a38d2..a29eebb947 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -461,7 +461,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } @Override - @SuppressWarnings("unchecked") + @SuppressWarnings({ "unchecked", "rawtypes" }) public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { if (tooltip.containsKey(getDamage(p_77624_1_))) aList.add(tooltip.get(getDamage(p_77624_1_))); aList.add("Material for High Temperature Gas-cooled Reactor"); -- cgit From 49071ce740759111be55a8410c931b0c21759ee5 Mon Sep 17 00:00:00 2001 From: GDCloud <93287602+GDCloudstrike@users.noreply.github.com> Date: Mon, 6 Mar 2023 22:09:15 +0100 Subject: Fix amounts (#297) Former-commit-id: 0f20293d8d8d0de5515453d5e248a67d8bc13e29 --- .../bartworks/common/loaders/ElectricImplosionCompressorRecipes.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java index 6a9b063dd0..e4849333a3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java @@ -103,10 +103,10 @@ public class ElectricImplosionCompressorRecipes implements Runnable { new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.nanite, Materials.WhiteDwarfMatter, 1L), GT_OreDictUnificator.get(OrePrefixes.nanite, Materials.Universium, 1L), GT_OreDictUnificator.get(OrePrefixes.nanite, Materials.BlackDwarfMatter, 1L) }, - new FluidStack[] { Materials.RawStarMatter.getFluid(16 * 144L) }, + new FluidStack[] { Materials.RawStarMatter.getFluid(64 * 144L) }, // OUT. new ItemStack[] { GT_Values.NI }, - new FluidStack[] { Materials.MagnetohydrodynamicallyConstrainedStarMatter.getMolten(4 * 144L) }, + new FluidStack[] { Materials.MagnetohydrodynamicallyConstrainedStarMatter.getMolten(16 * 144L) }, // Recipe stats. 20 * 4, (int) TierEU.RECIPE_UXV); -- cgit From 9b7bf94d93745f3b524e8e4f7391939a4c51aeb3 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Thu, 9 Mar 2023 18:07:30 +0800 Subject: remove enumhelper towards OrePrefixes and force gtnh gt (#298) * remove EnumHelper usage towards OrePrefixes also removed gtnh gt detection. it has long been mandatory since bart's quit. * might as well just remove this field * fix up dependencies Former-commit-id: 2b0e68b0065868aec7fb7a2fb88ae79eb2493e0e --- dependencies.gradle | 2 +- .../bartworks/API/BioVatLogicAdder.java | 14 +- .../client/textures/PrefixTextureLinker.java | 3 +- .../bartworks/common/loaders/ItemRegistry.java | 2 +- .../common/loaders/RadioHatchMaterialLoader.java | 16 +- .../bartworks/common/loaders/RecipeLoader.java | 11 +- .../common/loaders/StaticRecipeChangeLoaders.java | 5 +- .../material/BW_MetaGeneratedBlocks_Casing.java | 6 +- .../BW_MetaGeneratedBlocks_CasingAdvanced_TE.java | 2 +- .../material/BW_MetaGeneratedBlocks_Casing_TE.java | 2 +- .../system/material/BW_MetaGenerated_Items.java | 10 +- .../material/GT_Enhancement/BWGTMetaItems.java | 9 +- .../GT_Enhancement/GTMetaItemEnhancer.java | 29 +-- .../bartworks/system/material/Werkstoff.java | 10 +- .../bartworks/system/material/WerkstoffLoader.java | 149 +++------------ .../werkstoff_loaders/recipe/BlockLoader.java | 3 +- .../werkstoff_loaders/recipe/CasingLoader.java | 2 - .../recipe/CraftingMaterialLoader.java | 2 +- .../werkstoff_loaders/recipe/MoltenCellLoader.java | 11 +- .../werkstoff_loaders/recipe/ToolLoader.java | 209 ++++++++++----------- .../registration/BridgeMaterialsLoader.java | 3 +- .../registration/CasingRegistrator.java | 9 +- 22 files changed, 179 insertions(+), 330 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index fd2c68d043..0ecee75159 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.297-pre:dev") + api("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.314:dev") api("com.github.GTNewHorizons:TecTech:5.0.85:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.23-GTNH:dev") api("com.github.GTNewHorizons:Galacticraft:3.0.64-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java index 56601399e4..9202be7d18 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -132,14 +132,12 @@ public final class BioVatLogicAdder { 96, 10); - if (WerkstoffLoader.gtnhGT) { - giveItemStackRadioHatchAbilites(ItemList.MNqCell_1.get(1), Materials.Naquadria, 3); - giveItemStackRadioHatchAbilites(ItemList.MNqCell_2.get(1), Materials.Naquadria, 6); - giveItemStackRadioHatchAbilites(ItemList.MNqCell_4.get(1), Materials.Naquadria, 12); - giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_1.get(1), Materials.Naquadria, 3, 10); - giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_2.get(1), Materials.Naquadria, 6, 10); - giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_4.get(1), Materials.Naquadria, 12, 10); - } + giveItemStackRadioHatchAbilites(ItemList.MNqCell_1.get(1), Materials.Naquadria, 3); + giveItemStackRadioHatchAbilites(ItemList.MNqCell_2.get(1), Materials.Naquadria, 6); + giveItemStackRadioHatchAbilites(ItemList.MNqCell_4.get(1), Materials.Naquadria, 12); + giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_1.get(1), Materials.Naquadria, 3, 10); + giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_2.get(1), Materials.Naquadria, 6, 10); + giveItemStackRadioHatchAbilites(ItemList.Depleted_MNq_4.get(1), Materials.Naquadria, 12, 10); } private static final HashSet MaSv = new HashSet<>(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java index 84d37b0e9c..2e025b27e4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java @@ -19,7 +19,6 @@ import java.util.Map; import java.util.stream.Stream; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -37,7 +36,7 @@ public class PrefixTextureLinker implements Runnable { private static void fillBlockTexMap() { blockTexMap.put(TextureSet.SET_QUARTZ, TextureSet.INDEX_block4); - Stream.of(WerkstoffLoader.blockCasing, WerkstoffLoader.blockCasingAdvanced).forEach(prefixes -> { + Stream.of(OrePrefixes.blockCasing, OrePrefixes.blockCasingAdvanced).forEach(prefixes -> { HashMap curr = new HashMap<>(); Arrays.stream(TextureSet.class.getFields()).filter(field -> field.getName().contains("SET")) .forEach(SET -> { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index a66ad633d5..cb4bd63e1d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -366,7 +366,7 @@ public class ItemRegistry { "MegaOilCracker", "Mega Oil Cracker").getStackForm(1L); - if (LoaderReference.galacticgreg && WerkstoffLoader.gtnhGT) { + if (LoaderReference.galacticgreg) { ItemRegistry.voidminer[2] = new GT_TileEntity_VoidMiners.VMUV( ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 11, "VoidMiner3", diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java index ee839f56c4..5e92aa94eb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java @@ -207,14 +207,12 @@ public class RadioHatchMaterialLoader { 96, Materials.Naquadah.mRGBa); - if (WerkstoffLoader.gtnhGT) { - BWRecipes.instance.addRadHatch(ItemList.MNqCell_1.get(1), 150, 3, Materials.Naquadria.mRGBa); - BWRecipes.instance.addRadHatch(ItemList.MNqCell_2.get(1), 150, 6, Materials.Naquadria.mRGBa); - BWRecipes.instance.addRadHatch(ItemList.MNqCell_4.get(1), 150, 12, Materials.Naquadria.mRGBa); - - BWRecipes.instance.addRadHatch(ItemList.Depleted_MNq_1.get(1), 150 / 10, 3, Materials.Naquadria.mRGBa); - BWRecipes.instance.addRadHatch(ItemList.Depleted_MNq_2.get(1), 150 / 10, 6, Materials.Naquadria.mRGBa); - BWRecipes.instance.addRadHatch(ItemList.Depleted_MNq_4.get(1), 150 / 10, 12, Materials.Naquadria.mRGBa); - } + BWRecipes.instance.addRadHatch(ItemList.MNqCell_1.get(1), 150, 3, Materials.Naquadria.mRGBa); + BWRecipes.instance.addRadHatch(ItemList.MNqCell_2.get(1), 150, 6, Materials.Naquadria.mRGBa); + BWRecipes.instance.addRadHatch(ItemList.MNqCell_4.get(1), 150, 12, Materials.Naquadria.mRGBa); + + BWRecipes.instance.addRadHatch(ItemList.Depleted_MNq_1.get(1), 150 / 10, 3, Materials.Naquadria.mRGBa); + BWRecipes.instance.addRadHatch(ItemList.Depleted_MNq_2.get(1), 150 / 10, 6, Materials.Naquadria.mRGBa); + BWRecipes.instance.addRadHatch(ItemList.Depleted_MNq_4.get(1), 150 / 10, 12, Materials.Naquadria.mRGBa); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index bfcf0eadc3..7c9dc72202 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -854,17 +854,12 @@ public class RecipeLoader { ItemList[] sensors = { ItemList.Sensor_EV, ItemList.Sensor_IV, ItemList.Sensor_LuV, ItemList.Sensor_ZPM }; - OrePrefixes[] prefixes = { WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt04 : OrePrefixes.wireGt04, - WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt08 : OrePrefixes.wireGt08, - WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt12 : OrePrefixes.wireGt12, - WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt16 : OrePrefixes.cableGt12 }; + OrePrefixes[] prefixes = { OrePrefixes.cableGt04, OrePrefixes.cableGt08, OrePrefixes.cableGt12, + OrePrefixes.cableGt16 }; GT_Values.RA.addAssemblerRecipe( new ItemStack[] { ItemList.Circuit_Parts_GlassFiber.get(32), - GT_OreDictUnificator.get( - WerkstoffLoader.gtnhGT ? OrePrefixes.foil : OrePrefixes.plateDouble, - Materials.Electrum, - WerkstoffLoader.gtnhGT ? 8 : 1), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Electrum, 8), WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2) }, Materials.Polytetrafluoroethylene.getMolten(72), new ItemStack( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index fe73bc18f6..756d99351a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -32,7 +32,6 @@ import org.apache.commons.lang3.StringUtils; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; @@ -215,11 +214,11 @@ public class StaticRecipeChangeLoaders { @SuppressWarnings("ALL") private static void runMoltenUnificationEnfocement(Werkstoff werkstoff) { - if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { + if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.hasItemType(OrePrefixes.cellMolten)) { try { FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData( new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), - werkstoff.get(WerkstoffLoader.cellMolten), + werkstoff.get(OrePrefixes.cellMolten), Materials.Empty.getCells(1)); Field f = GT_Utility.class.getDeclaredField("sFilledContainerToData"); f.setAccessible(true); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java index aca8dfe63f..ca8b06151d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -83,8 +83,8 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks @Override public String getUnlocalizedName() { - if (_prefixes == WerkstoffLoader.blockCasing) return "bw.werkstoffblockscasing.01"; - else if (_prefixes == WerkstoffLoader.blockCasingAdvanced) return "bw.werkstoffblockscasingadvanced.01"; + if (_prefixes == OrePrefixes.blockCasing) return "bw.werkstoffblockscasing.01"; + else if (_prefixes == OrePrefixes.blockCasingAdvanced) return "bw.werkstoffblockscasingadvanced.01"; return ""; } @@ -95,7 +95,7 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks Werkstoff.werkstoffHashSet.stream() .filter( pMaterial -> pMaterial.getType().equals(Werkstoff.Types.BIOLOGICAL) - && pMaterial.hasGenerationFeature(WerkstoffLoader.blockCasing) + && pMaterial.hasGenerationFeature(OrePrefixes.blockCasing) || pMaterial.doesOreDictedItemExists(OrePrefixes.plate) && pMaterial.doesOreDictedItemExists(OrePrefixes.screw) && pMaterial.doesOreDictedItemExists(OrePrefixes.plateDouble) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java index 3c64631373..ac9c71fb25 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java @@ -38,7 +38,7 @@ public class BW_MetaGeneratedBlocks_CasingAdvanced_TE extends BW_MetaGenerated_B if ((aMaterial != null)) { TextureSet set = aMaterial.getTexSet(); ITexture aIconSet = TextureFactory.of( - PrefixTextureLinker.texMapBlocks.get(WerkstoffLoader.blockCasingAdvanced) + PrefixTextureLinker.texMapBlocks.get(OrePrefixes.blockCasingAdvanced) .getOrDefault(set, TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]), aMaterial.getRGBA()); return new ITexture[] { TextureFactory.of(Blocks.iron_block), aIconSet }; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java index f52767969e..d3fdd2f731 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java @@ -38,7 +38,7 @@ public class BW_MetaGeneratedBlocks_Casing_TE extends BW_MetaGenerated_Block_TE if ((aMaterial != null)) { TextureSet set = aMaterial.getTexSet(); ITexture aIconSet = TextureFactory.of( - PrefixTextureLinker.texMapBlocks.get(WerkstoffLoader.blockCasing) + PrefixTextureLinker.texMapBlocks.get(OrePrefixes.blockCasing) .getOrDefault(set, TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]), aMaterial.getRGBA()); return new ITexture[] { TextureFactory.of(Blocks.iron_block), aIconSet }; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 99d4afb1e1..bbbdb36349 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -256,14 +256,16 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public int getCapacity(ItemStack aStack) { return this.orePrefixes == OrePrefixes.capsule || this.orePrefixes == OrePrefixes.cell - || this.orePrefixes == OrePrefixes.cellPlasma ? 1000 - : this.orePrefixes == WerkstoffLoader.cellMolten - || this.orePrefixes == WerkstoffLoader.capsuleMolten ? 144 : 0; + || this.orePrefixes == OrePrefixes.cellPlasma + ? 1000 + : this.orePrefixes == OrePrefixes.cellMolten || this.orePrefixes == OrePrefixes.capsuleMolten + ? 144 + : 0; } @Override public ItemStack getContainerItem(ItemStack aStack) { return this.orePrefixes == OrePrefixes.cell || this.orePrefixes == OrePrefixes.cellPlasma - || this.orePrefixes == WerkstoffLoader.cellMolten ? Materials.Empty.getCells(1) : null; + || this.orePrefixes == OrePrefixes.cellMolten ? Materials.Empty.getCells(1) : null; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java index c2c3730874..24882d995c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -34,7 +34,6 @@ import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; @@ -58,7 +57,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { for (int i = 0; i < Materials.values().length; i++) { ItemStack tStack = new ItemStack(this, 1, i); Materials material = Materials.values()[i]; - if (((material.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) + if (((material.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten) || ((material.getFluid(1) == null && material.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; @@ -80,7 +79,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { for (int i = 0; i < noSubIDMaterials.size(); i++) { ItemStack tStack = new ItemStack(this, 1, i + 1001); Materials w = noSubIDMaterials.get(i); - if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) + if (((w.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; @@ -179,7 +178,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) continue; - else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) + else if (((w.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; @@ -191,7 +190,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) continue; - else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) + else if (((w.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java index cc3f6d6611..3fa75568d8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -24,7 +24,6 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import com.github.bartimaeusnek.bartworks.API.LoaderReference; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -40,43 +39,19 @@ public class GTMetaItemEnhancer { private GTMetaItemEnhancer() {} public static void init() { - if (!WerkstoffLoader.gtnhGT) { - Item moltenCell = new BWGTMetaItems(WerkstoffLoader.cellMolten, null); - Materials[] values = Materials.values(); - for (int i = 0, valuesLength = values.length; i < valuesLength; i++) { - Materials m = values[i]; - if (m == null || m.mStandardMoltenFluid == null) continue; - final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( - m.getMolten(144), - new ItemStack(moltenCell, 1, i), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L)); - FluidContainerRegistry.registerFluidContainer(emptyData); - GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe( - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), - new ItemStack(moltenCell, 1, i), - m.getMolten(144), - GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe( - new ItemStack(moltenCell, 1, i), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), - GT_Values.NF, - m.getMolten(144)); - } - } if (!LoaderReference.Forestry) { return; } NoMetaValue = Materials.getMaterialsMap().values().stream().filter(m -> m.mMetaItemSubID == -1) .collect(Collectors.toList()); - Item moltenCapsuls = new BWGTMetaItems(WerkstoffLoader.capsuleMolten, null); + Item moltenCapsuls = new BWGTMetaItems(OrePrefixes.capsuleMolten, null); Item capsuls = new BWGTMetaItems(OrePrefixes.capsule, NoMetaValue); // Item bottles = new BWGTMetaItems(OrePrefixes.bottle, NoMetaValue); Materials[] values = Materials.values(); for (int i = 0, valuesLength = values.length; i < valuesLength; i++) { Materials m = values[i]; - if (m.mStandardMoltenFluid != null && GT_OreDictUnificator.get(WerkstoffLoader.cellMolten, m, 1) != null) { + if (m.mStandardMoltenFluid != null && GT_OreDictUnificator.get(OrePrefixes.cellMolten, m, 1) != null) { final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( m.getMolten(144), new ItemStack(moltenCapsuls, 1, i), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 779183e439..b04068521b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -101,7 +101,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { /** * GT Materials Bridge Constructor - * + * * @param materials a GT Materials * @param generationFeatures the new Types you want to add * @param type - self explainatory @@ -692,8 +692,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.capsule, 0b10000); // Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.bottle,0b10000); - Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.capsuleMolten, 0b1000000); - Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.cellMolten, 0b1000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.capsuleMolten, 0b1000000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.cellMolten, 0b1000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.plate, 0b10000000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.foil, 0b10000000); @@ -724,8 +724,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuadruple, 0x200); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.ingotQuintuple, 0x200); - Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.blockCasing, 0x380); - Werkstoff.GenerationFeatures.prefixLogic.put(WerkstoffLoader.blockCasingAdvanced, 0x380); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.blockCasing, 0x380); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.blockCasingAdvanced, 0x380); } public void setExtension() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index fd5dc54a01..643dc62c49 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -58,7 +58,6 @@ import gregtech.api.enums.*; import gregtech.api.fluid.GT_FluidFactory; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_OreDictUnificator; -import gregtech.common.items.GT_MetaGenerated_Tool_01; import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputOreDict; import ic2.api.recipe.RecipeOutput; @@ -74,63 +73,16 @@ public class WerkstoffLoader { public static final SubTag ANAEROBE_SMELTING = SubTag.getNewSubTag("AnaerobeSmelting"); public static final SubTag NOBLE_GAS_SMELTING = SubTag.getNewSubTag("NobleGasSmelting"); public static final SubTag NO_BLAST = SubTag.getNewSubTag("NoBlast"); - public static OrePrefixes cellMolten; - public static OrePrefixes capsuleMolten; - public static OrePrefixes blockCasing; - public static OrePrefixes blockCasingAdvanced; public static ItemList rotorMold; public static ItemList rotorShape; public static ItemList smallGearShape; public static ItemList ringMold; public static ItemList boltMold; - public static boolean gtnhGT = false; public static void setUp() { - // GTNH detection hack - try { - Field f = GT_MetaGenerated_Tool_01.class.getField("SOLDERING_IRON_MV"); - gtnhGT = true; - } catch (Exception ignored) { - gtnhGT = false; - } - // GTNH detection hack #2 - // GTNH hack for molten cells - for (OrePrefixes prefix : values()) { - if (prefix.toString().equals("cellMolten")) { - WerkstoffLoader.cellMolten = prefix; - gtnhGT = true; - break; - } - } - - if (!gtnhGT) { - WerkstoffLoader.HDCS.getGenerationFeatures().extraRecipes ^= 10; - } - if (WerkstoffLoader.cellMolten == null) { - WerkstoffLoader.cellMolten = EnumUtils.addNewOrePrefix( - "cellMolten", - "Cells of Molten stuff", - "Molten ", - " Cell", - true, - true, - true, - true, - false, - false, - false, - true, - false, - false, - 0b1000000, - 3628800L, - 64, - 31); - // GT_LanguageManager.addStringLocalization(".name", this.getDefaultLocalization(w)); - } else { - WerkstoffLoader.cellMolten.mMaterialGenerationBits = 0b1000000; - } + OrePrefixes.cellMolten.mMaterialGenerationBits = 0b1000000; + OrePrefixes.capsuleMolten.mMaterialGenerationBits = 0b1000000; try { WerkstoffLoader.rotorMold = Enum.valueOf(ItemList.class, "Shape_Mold_Rotor"); @@ -142,68 +94,6 @@ public class WerkstoffLoader { // add tiberium Element t = EnumUtils.createNewElement("Tr", 123L, 203L, 0L, -1L, null, "Tiberium", false); - blockCasing = EnumUtils.addNewOrePrefix( - "blockCasing", - "A Casing block for a Multiblock-Machine", - "Bolted ", - " Casing", - true, - true, - true, - true, - false, - true, - false, - true, - false, - false, - 0, - 32659200L, - 64, - -1); - blockCasingAdvanced = EnumUtils.addNewOrePrefix( - "blockCasingAdvanced", - "An Advanced Casing block for a Multiblock-Machine", - "Rebolted ", - " Casing", - true, - true, - true, - true, - false, - true, - false, - true, - false, - false, - 0, - 32659200L, - 64, - -1); - // add molten & regular capsuls - if (LoaderReference.Forestry) { - capsuleMolten = EnumUtils.addNewOrePrefix( - "capsuleMolten", - "Capsule of Molten stuff", - "Molten ", - " Capsule", - true, - true, - true, - true, - false, - false, - false, - true, - false, - false, - 0b1000000, - 3628800L, - 64, - -1); - capsule.mMaterialGenerationBits = 0b100000; - capsule.mDefaultStackSize = 64; - } bottle.mDefaultStackSize = 1; Werkstoff.GenerationFeatures.initPrefixLogic(); @@ -1472,9 +1362,9 @@ public class WerkstoffLoader { if (orePrefixes == ore) return new ItemStack(WerkstoffLoader.BWOres, amount, werkstoff.getmID()); else if (orePrefixes == oreSmall) return new ItemStack(WerkstoffLoader.BWSmallOres, amount, werkstoff.getmID()); else if (orePrefixes == block) return new ItemStack(WerkstoffLoader.BWBlocks, amount, werkstoff.getmID()); - else if (orePrefixes == WerkstoffLoader.blockCasing) + else if (orePrefixes == OrePrefixes.blockCasing) return new ItemStack(WerkstoffLoader.BWBlockCasings, amount, werkstoff.getmID()); - else if (orePrefixes == WerkstoffLoader.blockCasingAdvanced) + else if (orePrefixes == OrePrefixes.blockCasingAdvanced) return new ItemStack(WerkstoffLoader.BWBlockCasingsAdvanced, amount, werkstoff.getmID()); else if (WerkstoffLoader.items.get(orePrefixes) == null) return null; return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); @@ -1649,7 +1539,7 @@ public class WerkstoffLoader { WerkstoffLoader.fluids.put(werkstoff, FluidRegistry.getFluid(werkstoff.getDefaultName())); } } - if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { + if (werkstoff.hasItemType(OrePrefixes.cellMolten)) { if (!FluidRegistry.isFluidRegistered("molten." + werkstoff.getDefaultName())) { DebugLog.log("Adding new Molten: " + werkstoff.getDefaultName()); Fluid fluid = GT_FluidFactory.builder("molten." + werkstoff.getDefaultName()) @@ -1713,10 +1603,9 @@ public class WerkstoffLoader { WerkstoffLoader.items.put(cellPlasma, new BW_MetaGenerated_Items(cellPlasma)); } if ((WerkstoffLoader.toGenerateGlobal & 0b1000000) != 0) { - WerkstoffLoader.items - .put(WerkstoffLoader.cellMolten, new BW_MetaGenerated_Items(WerkstoffLoader.cellMolten)); - if (LoaderReference.Forestry) - WerkstoffLoader.items.put(capsuleMolten, new BW_MetaGenerated_Items(capsuleMolten)); + WerkstoffLoader.items.put(OrePrefixes.cellMolten, new BW_MetaGenerated_Items(OrePrefixes.cellMolten)); + if (LoaderReference.Forestry) WerkstoffLoader.items + .put(OrePrefixes.capsuleMolten, new BW_MetaGenerated_Items(OrePrefixes.capsuleMolten)); } if ((WerkstoffLoader.toGenerateGlobal & 0b10000000) != 0) { WerkstoffLoader.items.put(plate, new BW_MetaGenerated_Items(plate)); @@ -1780,12 +1669,12 @@ public class WerkstoffLoader { Material.iron, BW_MetaGeneratedBlocks_Casing_TE.class, "bw.werkstoffblockscasing", - blockCasing); + OrePrefixes.blockCasing); WerkstoffLoader.BWBlockCasingsAdvanced = new BW_MetaGeneratedBlocks_Casing( Material.iron, BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, "bw.werkstoffblockscasingadvanced", - blockCasingAdvanced); + OrePrefixes.blockCasingAdvanced); GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.01"); GameRegistry.registerBlock(WerkstoffLoader.BWSmallOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.02"); @@ -1816,18 +1705,24 @@ public class WerkstoffLoader { } public static void addVanillaCasingsToGTOreDictUnificator() { + GT_OreDictUnificator.addAssociation( + OrePrefixes.blockCasing, + Materials.Aluminium, + ItemList.Casing_FrostProof.get(1L), + false); + GT_OreDictUnificator + .addAssociation(OrePrefixes.blockCasing, Materials.Nickel, ItemList.Casing_HeatProof.get(1L), false); + GT_OreDictUnificator + .addAssociation(OrePrefixes.blockCasing, Materials.Lead, ItemList.Casing_RadiationProof.get(1L), false); GT_OreDictUnificator - .addAssociation(blockCasing, Materials.Aluminium, ItemList.Casing_FrostProof.get(1L), false); - GT_OreDictUnificator.addAssociation(blockCasing, Materials.Nickel, ItemList.Casing_HeatProof.get(1L), false); - GT_OreDictUnificator.addAssociation(blockCasing, Materials.Lead, ItemList.Casing_RadiationProof.get(1L), false); - GT_OreDictUnificator.addAssociation(blockCasing, Materials.Steel, ItemList.Casing_SolidSteel.get(1L), false); + .addAssociation(OrePrefixes.blockCasing, Materials.Steel, ItemList.Casing_SolidSteel.get(1L), false); GT_OreDictUnificator.addAssociation( - blockCasing, + OrePrefixes.blockCasing, Materials.TungstenSteel, ItemList.Casing_RobustTungstenSteel.get(1L), false); GT_OreDictUnificator.addAssociation( - blockCasing, + OrePrefixes.blockCasing, Materials.Polytetrafluoroethylene, ItemList.Casing_Chemically_Inert.get(1L), false); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java index f5f105a00e..8a06acfc56 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java @@ -18,7 +18,6 @@ import static gregtech.api.enums.OrePrefixes.*; import net.minecraft.item.ItemStack; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import gregtech.api.enums.GT_Values; @@ -36,7 +35,7 @@ public class BlockLoader implements IWerkstoffRunnable { 90, false); } - if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { + if (werkstoff.hasItemType(cellMolten)) { GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(block), null, werkstoff.getMolten(1296), 0, 288, 8); } if (werkstoff.hasItemType(plate)) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java index 58acea03ae..e8063c1f6d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java @@ -13,8 +13,6 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasing; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasingAdvanced; import static gregtech.api.enums.OrePrefixes.*; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java index ccf8b21ffd..539131810b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java @@ -172,7 +172,7 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { 60); // molten -> metal - if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { + if (werkstoff.hasItemType(cellMolten)) { /* * !! No more hardcoded gear, etc. recipe gen, now must go through GenerationFeatures() !! diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java index 7d9b3daa98..9b861c700d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -13,7 +13,6 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.capsuleMolten; import static gregtech.api.enums.OrePrefixes.*; import java.util.Objects; @@ -36,7 +35,7 @@ public class MoltenCellLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - if (!werkstoff.hasItemType(WerkstoffLoader.cellMolten)) return; + if (!werkstoff.hasItemType(cellMolten)) return; if (!werkstoff.hasItemType(ingot)) { if (!werkstoff.hasItemType(dust)) return; @@ -209,20 +208,20 @@ public class MoltenCellLoader implements IWerkstoffRunnable { // Tank "Recipe" final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData( new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), - werkstoff.get(WerkstoffLoader.cellMolten), + werkstoff.get(cellMolten), Materials.Empty.getCells(1)); FluidContainerRegistry.registerFluidContainer( werkstoff.getMolten(144), - werkstoff.get(WerkstoffLoader.cellMolten), + werkstoff.get(cellMolten), Materials.Empty.getCells(1)); GT_Utility.addFluidContainerData(data); GT_Values.RA.addFluidCannerRecipe( Materials.Empty.getCells(1), - werkstoff.get(WerkstoffLoader.cellMolten), + werkstoff.get(cellMolten), new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), GT_Values.NF); GT_Values.RA.addFluidCannerRecipe( - werkstoff.get(WerkstoffLoader.cellMolten), + werkstoff.get(cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java index 6456c9789b..3c4ace4814 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java @@ -13,7 +13,6 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.gtnhGT; import static gregtech.api.enums.OrePrefixes.*; import net.minecraft.init.Blocks; @@ -123,32 +122,30 @@ public class ToolLoader implements IWerkstoffRunnable { stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_LV_Lithium.get(1L) }); - if (gtnhGT) { - GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SOLDERING_IRON_MV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Rubber, - new long[] { 400000L, 128L, 2L, -1L }), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', - plate.get(Materials.AnyRubber), 'S', - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', - ItemList.Battery_RE_MV_Lithium.get(1L) }); - GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SOLDERING_IRON_HV, - 1, - werkstoff.getBridgeMaterial(), - Materials.StyreneButadieneRubber, - new long[] { 1600000L, 512L, 3L, -1L }), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', - plate.get(Materials.StyreneButadieneRubber), 'S', - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', - ItemList.Battery_RE_HV_Lithium.get(1L) }); - } + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SOLDERING_IRON_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Rubber, + new long[] { 400000L, 128L, 2L, -1L }), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', + plate.get(Materials.AnyRubber), 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', + ItemList.Battery_RE_MV_Lithium.get(1L) }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SOLDERING_IRON_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StyreneButadieneRubber, + new long[] { 1600000L, 512L, 3L, -1L }), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', + plate.get(Materials.StyreneButadieneRubber), 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', + ItemList.Battery_RE_HV_Lithium.get(1L) }); if (!werkstoff.hasItemType(gem)) { GT_ModHandler.addCraftingRecipe( @@ -485,86 +482,84 @@ public class ToolLoader implements IWerkstoffRunnable { ingot.get(werkstoff.getBridgeMaterial()) }); } - if (gtnhGT) { - GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_MV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Aluminium, - new long[] { 400000L, 128L, 2L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', - plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', - ItemList.Battery_RE_MV_Lithium.get(1L) }); - GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_MV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Aluminium, - new long[] { 300000L, 128L, 2L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', - plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', - ItemList.Battery_RE_MV_Cadmium.get(1L) }); - GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_MV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Aluminium, - new long[] { 200000L, 128L, 2L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', - plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', - ItemList.Battery_RE_MV_Sodium.get(1L) }); - GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_HV, - 1, - werkstoff.getBridgeMaterial(), - Materials.StainlessSteel, - new long[] { 1600000L, 512L, 3L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', - plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', - ItemList.Battery_RE_HV_Lithium.get(1L) }); - GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_HV, - 1, - werkstoff.getBridgeMaterial(), - Materials.StainlessSteel, - new long[] { 1200000L, 512L, 3L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', - plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', - ItemList.Battery_RE_HV_Cadmium.get(1L) }); - GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_HV, - 1, - werkstoff.getBridgeMaterial(), - Materials.StainlessSteel, - new long[] { 800000L, 512L, 3L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', - plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', - ItemList.Battery_RE_HV_Sodium.get(1L) }); - } + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] { 400000L, 128L, 2L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', + plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', + ItemList.Battery_RE_MV_Lithium.get(1L) }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] { 300000L, 128L, 2L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', + plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', + ItemList.Battery_RE_MV_Cadmium.get(1L) }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] { 200000L, 128L, 2L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', + plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', + ItemList.Battery_RE_MV_Sodium.get(1L) }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] { 1600000L, 512L, 3L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', + plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', + ItemList.Battery_RE_HV_Lithium.get(1L) }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] { 1200000L, 512L, 3L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', + plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', + ItemList.Battery_RE_HV_Cadmium.get(1L) }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] { 800000L, 512L, 3L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', + plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', + ItemList.Battery_RE_HV_Sodium.get(1L) }); // GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(16,1, // werkstoff.getBridgeMaterial(),werkstoff.getBridgeMaterial(),null), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java index 98ac3fb90e..474ee3d936 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java @@ -21,7 +21,6 @@ import net.minecraft.item.ItemStack; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import com.github.bartimaeusnek.bartworks.util.BWRecipes; @@ -158,7 +157,7 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { werkstoffBridgeMaterial.mGas = werkstoff.getFluidOrGas(1).getFluid(); } - if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { + if (werkstoff.hasItemType(cellMolten)) { werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid(); } werkstoffBridgeMaterial.mName = werkstoff.getVarName(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java index 08f77e6760..c91b9cb053 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java @@ -13,14 +13,13 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasing; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasingAdvanced; - import net.minecraft.item.ItemStack; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; + +import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; public class CasingRegistrator implements IWerkstoffRunnable { @@ -28,12 +27,12 @@ public class CasingRegistrator implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { GT_OreDictUnificator.addAssociation( - blockCasing, + OrePrefixes.blockCasing, werkstoff.getBridgeMaterial(), new ItemStack(WerkstoffLoader.BWBlockCasings, 1, werkstoff.getmID()), false); GT_OreDictUnificator.addAssociation( - blockCasingAdvanced, + OrePrefixes.blockCasingAdvanced, werkstoff.getBridgeMaterial(), new ItemStack(WerkstoffLoader.BWBlockCasingsAdvanced, 1, werkstoff.getmID()), false); -- cgit From 98608e7fd679fec5da1db8c915d0dd79027dbe99 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 11 Mar 2023 22:47:04 +0100 Subject: update gradle bs+sa Former-commit-id: 823eff3ee1cf44c968b808d7a14cdcd655073f0a --- build.gradle | 151 +++++++++++++++++++++++++------ gradle/wrapper/gradle-wrapper.jar | Bin 61608 -> 61574 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 4 +- 4 files changed, 128 insertions(+), 29 deletions(-) diff --git a/build.gradle b/build.gradle index 6997e9d25f..927ed20fdb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1676679815 +//version: 1678003329 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -20,6 +20,7 @@ import cpw.mods.fml.relauncher.Side import org.gradle.api.tasks.options.Option; import org.gradle.internal.logging.text.StyledTextOutput.Style import org.gradle.internal.logging.text.StyledTextOutputFactory +import org.gradle.internal.xml.XmlTransformer import org.jetbrains.gradle.ext.* import java.nio.file.Files @@ -31,7 +32,6 @@ import javax.inject.Inject buildscript { repositories { - mavenLocal() mavenCentral() maven { @@ -52,6 +52,8 @@ buildscript { name 'Scala CI dependencies' url 'https://repo1.maven.org/maven2/' } + + mavenLocal() } } plugins { @@ -71,7 +73,7 @@ plugins { id 'com.diffplug.spotless' version '6.7.2' apply false id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.1.6' + id 'com.gtnewhorizons.retrofuturagradle' version '1.2.3' } boolean settingsupdated = verifySettingsGradle() settingsupdated = verifyGitAttributes() || settingsupdated @@ -127,6 +129,9 @@ propertyDefaultIfUnset("gradleTokenGroupName", "") propertyDefaultIfUnset("enableModernJavaSyntax", false) // On by default for new projects only propertyDefaultIfUnset("enableGenericInjection", false) // On by default for new projects only +// this is meant to be set using the user wide property file. by default we do nothing. +propertyDefaultIfUnset("ideaOverrideBuildType", "") // Can be nothing, "gradle" or "idea" + project.extensions.add(Blowdryer, "Blowdryer", Blowdryer) // Make blowdryer available in "apply from:" scripts if (!disableSpotless) { apply plugin: 'com.diffplug.spotless' @@ -148,7 +153,7 @@ java { } else { languageVersion.set(projectJavaVersion) } - vendor.set(JvmVendorSpec.ADOPTIUM) + vendor.set(JvmVendorSpec.AZUL) } if (!noPublishedSources) { withSourcesJar() @@ -217,7 +222,7 @@ if (enableModernJavaSyntax.toBoolean()) { javaCompiler.set(javaToolchains.compilerFor { languageVersion.set(JavaLanguageVersion.of(17)) - vendor.set(JvmVendorSpec.ADOPTIUM) + vendor.set(JvmVendorSpec.AZUL) }) } } @@ -249,12 +254,14 @@ if (apiPackage) { } if (accessTransformersFile) { - String targetFile = "src/main/resources/META-INF/" + accessTransformersFile - if (!getFile(targetFile).exists()) { - throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) + for (atFile in accessTransformersFile.split(",")) { + String targetFile = "src/main/resources/META-INF/" + atFile.trim() + if (!getFile(targetFile).exists()) { + throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) + } + tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(targetFile) + tasks.srgifyBinpatchedJar.accessTransformerFiles.from(targetFile) } - tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(targetFile) - tasks.srgifyBinpatchedJar.accessTransformerFiles.from(targetFile) } else { boolean atsFound = false for (File at : sourceSets.getByName("main").resources.files) { @@ -382,6 +389,10 @@ minecraft { injectMissingGenerics.set(true) } + username = developmentEnvironmentUserName.toString() + + lwjgl3Version = "3.3.2-SNAPSHOT" + // Enable assertions in the current mod extraRunJvmArguments.add("-ea:${modGroup}") @@ -455,8 +466,9 @@ repositories.configureEach { repo -> apply from: 'repositories.gradle' configurations { + runtimeClasspath.extendsFrom(runtimeOnlyNonPublishable) + testRuntimeClasspath.extendsFrom(runtimeOnlyNonPublishable) for (config in [compileClasspath, runtimeClasspath, testCompileClasspath, testRuntimeClasspath]) { - config.extendsFrom(runtimeOnlyNonPublishable) if (usesShadowedDependencies.toBoolean()) { config.extendsFrom(shadowImplementation) // TODO: remove Compile after all uses are refactored to Implementation @@ -509,6 +521,13 @@ repositories { } } } + maven { + name 'sonatype' + url 'https://oss.sonatype.org/content/repositories/snapshots/' + content { + includeGroup "org.lwjgl" + } + } if (includeWellKnownRepositories.toBoolean()) { maven { name "CurseMaven" @@ -545,20 +564,20 @@ dependencies { annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3') annotationProcessor('com.google.guava:guava:24.1.1-jre') annotationProcessor('com.google.code.gson:gson:2.8.6') - annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.12:processor') + annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.13:processor') if (usesMixinDebug.toBoolean()) { runtimeOnlyNonPublishable('org.jetbrains:intellij-fernflower:1.2.1.16') } } if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { - implementation('com.gtnewhorizon:gtnhmixins:2.1.12') + implementation('com.gtnewhorizon:gtnhmixins:2.1.13') } } pluginManager.withPlugin('org.jetbrains.kotlin.kapt') { if (usesMixins.toBoolean()) { dependencies { - kapt('com.gtnewhorizon:gtnhmixins:2.1.12:processor') + kapt('com.gtnewhorizon:gtnhmixins:2.1.13:processor') } } } @@ -667,17 +686,22 @@ ext.java17Toolchain = (JavaToolchainSpec spec) -> { spec.vendor.set(JvmVendorSpec.matching("jetbrains")) } -ext.java17DependenciesCfg = configurations.create("java17Dependencies") -ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies") +ext.java17DependenciesCfg = configurations.create("java17Dependencies") { + extendsFrom(configurations.getByName("runtimeClasspath")) // Ensure consistent transitive dependency resolution + canBeConsumed = false +} +ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies") { + canBeConsumed = false +} dependencies { - def lwjgl3ifyVersion = '1.1.21' + def lwjgl3ifyVersion = '1.1.35' def asmVersion = '9.4' if (modId != 'lwjgl3ify') { java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") } if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.35') + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.40') } java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false} @@ -688,14 +712,14 @@ dependencies { java17PatchDependencies("org.ow2.asm:asm-util:${asmVersion}") java17PatchDependencies('org.ow2.asm:asm-deprecated:7.1') java17PatchDependencies("org.apache.commons:commons-lang3:3.12.0") - java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") + java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false} } ext.java17JvmArgs = [ // Java 9+ support "--illegal-access=warn", - "-Dfile.encoding=UTF-8", "-Djava.security.manager=allow", + "-Dfile.encoding=UTF-8", "--add-opens", "java.base/jdk.internal.loader=ALL-UNNAMED", "--add-opens", "java.base/java.net=ALL-UNNAMED", "--add-opens", "java.base/java.nio=ALL-UNNAMED", @@ -706,6 +730,7 @@ ext.java17JvmArgs = [ "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/jdk.internal.reflect=ALL-UNNAMED", "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", + "--add-opens", "jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED,java.naming", "--add-opens", "java.desktop/sun.awt.image=ALL-UNNAMED", "--add-modules", "jdk.dynalink", "--add-opens", "jdk.dynalink/jdk.dynalink.beans=ALL-UNNAMED", @@ -750,8 +775,8 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask { public boolean setEnableHotswap(boolean enable) { enableHotswap = enable } @Inject - public RunHotswappableMinecraftTask(Side side, String superTask) { - super(side) + public RunHotswappableMinecraftTask(Side side, String superTask, org.gradle.api.invocation.Gradle gradle) { + super(side, gradle) this.lwjglVersion = 3 this.javaLauncher = project.javaToolchains.launcherFor(project.java17Toolchain) @@ -782,6 +807,8 @@ runClient17Task.configure { description = "Runs the modded client using Java 17, lwjgl3ify and Hodgepodge" dependsOn(setupHotswapAgentTask, mcpTasks.launcherSources.classesTaskName, minecraftTasks.taskDownloadVanillaAssets, mcpTasks.taskPackagePatchedMc, 'jar') mainClass = "GradleStart" + username = minecraft.username + userUUID = minecraft.userUUID } def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Side.SERVER, "runServer") @@ -828,7 +855,7 @@ if (usesShadowedDependencies.toBoolean()) { tasks.register('relocateShadowJar', ConfigureShadowRelocation) { target = tasks.shadowJar prefix = modGroup + ".shadow" - enabled = minimizeShadowedDependencies.toBoolean() + enabled = relocateShadowedDependencies.toBoolean() } tasks.named("shadowJar", ShadowJar).configure { manifest { @@ -844,7 +871,7 @@ if (usesShadowedDependencies.toBoolean()) { project.configurations.shadeCompile ] archiveClassifier.set('dev') - if (minimizeShadowedDependencies.toBoolean()) { + if (relocateShadowedDependencies.toBoolean()) { dependsOn(relocateShadowJar) } } @@ -905,6 +932,19 @@ idea { } project { settings { + if (ideaOverrideBuildType != "") { + delegateActions { + if ("gradle".equalsIgnoreCase(ideaOverrideBuildType)) { + delegateBuildRunToGradle = true + testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.GRADLE + } else if ("idea".equalsIgnoreCase(ideaOverrideBuildType)) { + delegateBuildRunToGradle = false + testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.PLATFORM + } else { + throw GradleScriptException('Accepted value for ideaOverrideBuildType is one of gradle or idea.') + } + } + } runConfigurations { "1. Run Client"(Gradle) { taskNames = ["runClient"] @@ -943,7 +983,7 @@ idea { } "Run Client (IJ Native)"(Application) { mainClass = "GradleStart" - moduleName = project.name + ".main" + moduleName = project.name + ".ideVirtualMain" afterEvaluate { workingDirectory = tasks.runClient.workingDir.absolutePath programParameters = tasks.runClient.calculateArgs(project).collect { '"' + it + '"' }.join(' ') @@ -954,7 +994,7 @@ idea { } "Run Server (IJ Native)"(Application) { mainClass = "GradleStartServer" - moduleName = project.name + ".main" + moduleName = project.name + ".ideVirtualMain" afterEvaluate { workingDirectory = tasks.runServer.workingDir.absolutePath programParameters = tasks.runServer.calculateArgs(project).collect { '"' + it + '"' }.join(' ') @@ -971,6 +1011,51 @@ idea { ] } } + withIDEADir { File ideaDir -> + if (!ideaDir.path.contains(".idea")) { + // If an .ipr file exists, the project root directory is passed here instead of the .idea subdirectory + ideaDir = new File(ideaDir, ".idea") + } + if (ideaDir.isDirectory()) { + def miscFile = new File(ideaDir, "misc.xml") + if (miscFile.isFile()) { + boolean dirty = false + def miscTransformer = new XmlTransformer() + miscTransformer.addAction { root -> + Node rootNode = root.asNode() + def rootManager = rootNode + .component.find { it.@name == 'ProjectRootManager' } + if (!rootManager) { + rootManager = rootNode.appendNode('component', ['name': 'ProjectRootManager', 'version': '2']) + dirty = true + } + def output = rootManager.output + if (!output) { + output = rootManager.appendNode('output') + dirty = true + } + if (!output.@url) { + // Only modify the output url if it doesn't yet have one, or if the existing one is blank somehow. + // This is a sensible default for most setups + output.@url = 'file://$PROJECT_DIR$/build/ideaBuild' + dirty = true + } + } + def result = miscTransformer.transform(miscFile.text) + if (dirty) { + miscFile.write(result) + } + } else { + miscFile.text = """ + + + + + +""" + } + } + } } } } @@ -1118,10 +1203,21 @@ def addCurseForgeRelation(String type, String name) { } // Updating + +def buildscriptGradleVersion = "8.0.1" + +tasks.named('wrapper', Wrapper).configure { + gradleVersion = buildscriptGradleVersion +} + tasks.register('updateBuildScript') { group = 'GTNH Buildscript' description = 'Updates the build script to the latest version' + if (gradle.gradleVersion != buildscriptGradleVersion && !Boolean.getBoolean('DISABLE_BUILDSCRIPT_GRADLE_UPDATE')) { + dependsOn('wrapper') + } + doLast { if (performBuildScriptUpdate()) return @@ -1134,6 +1230,9 @@ if (!project.getGradle().startParameter.isOffline() && !Boolean.getBoolean('DISA performBuildScriptUpdate() } else { out.style(Style.SuccessHeader).println("Build script update available! Run 'gradle updateBuildScript'") + if (gradle.gradleVersion != buildscriptGradleVersion) { + out.style(Style.SuccessHeader).println("updateBuildScript can update gradle from ${gradle.gradleVersion} to ${buildscriptGradleVersion}\n") + } } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index ccebba7710..943f0cbfa7 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f398c33c4b..fc10b601f7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 79a61d421c..65dcd68d65 100755 --- a/gradlew +++ b/gradlew @@ -144,7 +144,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +152,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac -- cgit From 18cc7ed88011694783962c73b13c6cacab7589b8 Mon Sep 17 00:00:00 2001 From: boubou19 Date: Sun, 12 Mar 2023 13:19:45 +0100 Subject: Remove silliness with the muffler hatches on the MBF (#299) * reduce muffler hatches to 1 * remove hatch tier check Former-commit-id: 055382697923e9caff7ab52588fc1cb000768368 --- .../multis/mega/GT_TileEntity_MegaBlastFurnace.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 084af4fae7..38e88b6c72 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -114,12 +114,12 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock raw[0] = new String[15]; String topCasing = "ttttttttttttttt"; - String mufflerLine = "tmmmmmmmmmmmmmt"; + String middleTopCasing = "tttttttmttttttt"; raw[0][0] = topCasing; - for (int i = 1; i < 14; i++) { - raw[0][i] = mufflerLine; + for (int i = 1; i < 15; i++) { + raw[0][i] = topCasing; } - raw[0][14] = topCasing; + raw[0][7] = middleTopCasing; raw[1] = new String[15]; String allGlass = "ggggggggggggggg"; @@ -268,15 +268,6 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock aNBT.setByte("circuitMode", circuitMode); } - @Override - public boolean addMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (super.addMufflerToMachineList(aTileEntity, aBaseCasingIndex)) { - if (mufflerTier == -1) mufflerTier = this.mMufflerHatches.get(this.mMufflerHatches.size() - 1).mTier; - return mufflerTier == this.mMufflerHatches.get(this.mMufflerHatches.size() - 1).mTier; - } - return false; - } - @Override public int getPollutionPerTick(ItemStack aStack) { return this.polPtick; -- cgit From 45bb8439a94cd281323c30b00c0c80391bc7bebd Mon Sep 17 00:00:00 2001 From: boubou19 Date: Sun, 12 Mar 2023 13:58:08 +0100 Subject: follow up to https://github.com/GTNewHorizons/bartworks/pull/299 (#300) * reduce muffler hatches to 1 * remove hatch tier check * edit tooltip to reflect the muffler change Former-commit-id: ebf515a30f67a76a8986dc811721a6cd552322ee --- .../common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 38e88b6c72..aec315d67c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -185,7 +185,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock .addOtherStructurePart("1007x Borosilicate Glass", "Outer 15x18x15") .addStructureInfo("The glass tier limits the Energy Input tier") .addEnergyHatch("Any bottom layer casing").addMaintenanceHatch("Any bottom layer casing") - .addMufflerHatch("Top middle 13x13").addInputBus("Any bottom layer casing") + .addMufflerHatch("Top middle").addInputBus("Any bottom layer casing") .addInputHatch("Any bottom layer casing").addOutputBus("Any bottom layer casing") .addOutputHatch("Gasses, Any top layer casing") .addStructureInfo("Recovery amount scales with Muffler Hatch tier") -- cgit From b2ea15eddecd9720488bcf12a94a33558d9f3f2c Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Fri, 17 Mar 2023 19:31:20 +0100 Subject: Remove Extreme Industrial Greenhouse from BW (moved to KubaTech) (#301) * Remove EIG from BW (moved) * Delete patch Former-commit-id: 240a1567f08092ca3336a5580a0170a6c75bd35d --- .../client/renderer/BW_CropVisualizer.java | 77 -- .../bartworks/common/loaders/ItemRegistry.java | 8 +- .../bartworks/common/loaders/RecipeLoader.java | 7 - .../bartworks/common/net/BW_Network.java | 3 +- .../bartworks/common/net/EIGPacket.java | 59 - .../GT_TileEntity_ExtremeIndustrialGreenhouse.java | 1372 -------------------- 6 files changed, 4 insertions(+), 1522 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/net/EIGPacket.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java deleted file mode 100644 index 1bef2a4a2e..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.github.bartimaeusnek.bartworks.client.renderer; - -import java.lang.reflect.Field; - -import net.minecraft.client.particle.EntityFX; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.launchwrapper.Launch; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class BW_CropVisualizer extends EntityFX { - - int[] meta = new int[8]; - static Field tessellatorHasBrightnessField = null; - - public BW_CropVisualizer(World world, int x, int y, int z, int age) { - super(world, (double) x, ((double) y - 0.0625d), (double) z); - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; - this.particleMaxAge = age; - for (int i = 0; i < 8; i++) this.meta[i] = this.rand.nextInt(8); - } - - @Override - public void onUpdate() { - if (this.particleAge++ >= this.particleMaxAge) this.setDead(); - } - - @Override - public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, - float p_70539_5_, float p_70539_6_, float p_70539_7_) { - Tessellator tessellator = Tessellator.instance; - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glDepthMask(false); - try { - if (tessellatorHasBrightnessField == null) { - tessellatorHasBrightnessField = Tessellator.class.getDeclaredField( - (boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment") ? "hasBrightness" - : "field_78414_p"); - tessellatorHasBrightnessField.setAccessible(true); - } - tessellatorHasBrightnessField.set(tessellator, false); - } catch (NoSuchFieldException | IllegalAccessException e) { - throw new RuntimeException(e); - } - tessellator.setColorRGBA(255, 255, 255, 255); - double f12 = this.posY - interpPosY; - int i = 0; - for (int x = -1; x <= 1; x++) for (int z = -1; z <= 1; z++) { - if (x == 0 && z == 0) continue; - double f11 = (this.posX + (double) x) - interpPosX; - double f13 = (this.posZ + (double) z) - interpPosZ; - RenderBlocks.getInstance().renderBlockCropsImpl(Blocks.wheat, meta[i++], f11, f12, f13); - } - - 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/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index cb4bd63e1d..c88438b9c0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -208,7 +208,6 @@ public class ItemRegistry { public static ItemStack[] voidminer = new ItemStack[3]; public static ItemStack THTR; public static ItemStack HTGR; - public static ItemStack EIG; public static ItemStack eic; public static ItemStack cal; public static ItemStack compressedHatch; @@ -270,10 +269,9 @@ public class ItemRegistry { "HTGR", "High Temperature Gas-cooled Reactor").getStackForm(1L); GT_TileEntity_HTGR.HTGRMaterials.registeraTHR_Materials(); - ItemRegistry.EIG = new GT_TileEntity_ExtremeIndustrialGreenhouse( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 49, - "EIG", - "Extreme Industrial Greenhouse").getStackForm(1L); + + // ID ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 49 IS TAKEN !!! (12792) + GT_OreDictUnificator.add( OrePrefixes.block, Materials.BorosilicateGlass, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 7c9dc72202..d3c334d5dd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -776,13 +776,6 @@ public class RecipeLoader { new Object[] { "BZB", "BRB", "BZB", 'B', new ItemStack(GregTech_API.sBlockCasings8, 1, 5), 'R', GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), 'Z', "circuitSuperconductor" }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.EIG, - RecipeLoader.BITSD, - new Object[] { "AZA", "BRB", "AZA", 'B', new ItemStack(GregTech_API.sBlockCasings4, 1, 1), 'R', - GT_ModHandler.getModItem("EnderIO", "blockFarmStation", 1), 'A', - new ItemStack(GregTech_API.sBlockMachines, 1, 11104), 'Z', "circuitUltimate" }); - if (LoaderReference.galacticgreg) { GT_Values.RA.addAssemblylineRecipe( ItemList.OreDrill4.get(1L), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index a1d7d23c46..14dcd3006c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -54,8 +54,7 @@ public class BW_Network extends MessageToMessageCodec public BW_Network() { this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", this, new BW_Network.HandlerShared()); this.mSubChannels = new GT_Packet[] { new RendererPacket(), new CircuitProgrammerPacket(), - new MetaBlockPacket(), new OreDictCachePacket(), new ServerJoinedPackage(), new EICPacket(), - new EIGPacket() }; + new MetaBlockPacket(), new OreDictCachePacket(), new ServerJoinedPackage(), new EICPacket() }; } protected void encode(ChannelHandlerContext aContext, GT_Packet aPacket, List aOutput) throws Exception { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EIGPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EIGPacket.java deleted file mode 100644 index f21960d65f..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EIGPacket.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.github.bartimaeusnek.bartworks.common.net; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IBlockAccess; - -import com.github.bartimaeusnek.bartworks.API.SideReference; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ExtremeIndustrialGreenhouse; -import com.github.bartimaeusnek.bartworks.util.Coords; -import com.google.common.io.ByteArrayDataInput; - -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.net.GT_Packet_New; -import io.netty.buffer.ByteBuf; - -public class EIGPacket extends GT_Packet_New { - - private Coords coords; - private int mMaxSlots; - - public EIGPacket() { - super(true); - } - - public EIGPacket(Coords coords, int mMaxSlots) { - super(false); - this.coords = coords; - this.mMaxSlots = mMaxSlots; - } - - @Override - public byte getPacketID() { - return 6; - } - - @Override - public void encode(ByteBuf aOut) { - aOut.writeInt(coords.x); - aOut.writeInt(coords.y); - aOut.writeInt(coords.z); - aOut.writeInt(mMaxSlots); - } - - @Override - public GT_Packet_New decode(ByteArrayDataInput aData) { - return new EIGPacket(new Coords(aData.readInt(), aData.readInt(), aData.readInt()), aData.readInt()); - } - - @Override - public void process(IBlockAccess aWorld) { - if (SideReference.Side.Client) { - TileEntity te = aWorld.getTileEntity(coords.x, coords.y, coords.z); - if (!(te instanceof IGregTechTileEntity)) return; - IMetaTileEntity mte = ((IGregTechTileEntity) te).getMetaTileEntity(); - if (!(mte instanceof GT_TileEntity_ExtremeIndustrialGreenhouse)) return; - ((GT_TileEntity_ExtremeIndustrialGreenhouse) mte).mMaxSlots = this.mMaxSlots; - } - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java deleted file mode 100644 index 408342006e..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ /dev/null @@ -1,1372 +0,0 @@ -/* - * Copyright (C) 2022 kuba6000 This program is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. You should have received a copy of the GNU General Public License along with - * this program. If not, see . - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities.multis; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_VIA_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_Values.AuthorKuba; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - -import java.io.IOException; -import java.util.*; -import java.util.function.Function; -import java.util.stream.Collectors; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockFlower; -import net.minecraft.block.BlockStem; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.*; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import net.minecraftforge.common.IPlantable; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.client.renderer.BW_CropVisualizer; -import com.github.bartimaeusnek.bartworks.common.net.EIGPacket; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; -import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -import com.github.bartimaeusnek.bartworks.util.Coords; -import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; -import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import com.gtnewhorizons.modularui.api.ModularUITextures; -import com.gtnewhorizons.modularui.api.drawable.IDrawable; -import com.gtnewhorizons.modularui.api.drawable.ItemDrawable; -import com.gtnewhorizons.modularui.api.drawable.Text; -import com.gtnewhorizons.modularui.api.math.Color; -import com.gtnewhorizons.modularui.api.math.Pos2d; -import com.gtnewhorizons.modularui.api.screen.ModularWindow; -import com.gtnewhorizons.modularui.api.screen.UIBuildContext; -import com.gtnewhorizons.modularui.api.widget.Widget; -import com.gtnewhorizons.modularui.common.widget.*; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.Textures; -import gregtech.api.gui.modularui.GT_UITextures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.*; -import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_Utility; -import gregtech.common.GT_DummyWorld; -import gregtech.common.blocks.GT_Block_Ores_Abstract; -import gregtech.common.blocks.GT_Item_Ores; -import gregtech.common.blocks.GT_TileEntity_Ores; -import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_OutputBus_ME; -import ic2.api.crops.CropCard; -import ic2.api.crops.Crops; -import ic2.core.Ic2Items; -import ic2.core.crop.TileEntityCrop; - -public class GT_TileEntity_ExtremeIndustrialGreenhouse - extends GT_MetaTileEntity_EnhancedMultiBlockBase { - - private static final boolean debug = false; - private static final int EIG_MATH_VERSION = 0; - private static final int CONFIGURATION_WINDOW_ID = 999; - - private int oldVersion = 0; - private int mCasing = 0; - public int mMaxSlots = 0; - private int setupphase = 1; - private boolean isIC2Mode = false; - private byte glasTier = 0; - private int waterusage = 0; - private int weedexusage = 0; - private boolean isNoHumidity = false; - private static final int CASING_INDEX = 49; - private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final Item forestryfertilizer = GameRegistry.findItem("Forestry", "fertilizerCompound"); - private static final Fluid weedex = Materials.WeedEX9000.mFluid; - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { { "ccccc", "ccccc", "ccccc", "ccccc", "ccccc" }, - { "ccccc", "clllc", "clllc", "clllc", "ccccc" }, - { "ggggg", "g---g", "g---g", "g---g", "ggggg" }, - { "ggggg", "g---g", "g---g", "g---g", "ggggg" }, - { "ccccc", "cdddc", "cdwdc", "cdddc", "ccccc" }, - { "cc~cc", "cCCCc", "cCCCc", "cCCCc", "ccccc" }, })) - .addElement( - 'c', - ofChain( - onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)), - ofHatchAdder( - GT_TileEntity_ExtremeIndustrialGreenhouse::addEnergyInputToMachineList, - CASING_INDEX, - 1), - ofHatchAdder( - GT_TileEntity_ExtremeIndustrialGreenhouse::addMaintenanceToMachineList, - CASING_INDEX, - 1), - ofHatchAdder( - GT_TileEntity_ExtremeIndustrialGreenhouse::addInputToMachineList, - CASING_INDEX, - 1), - ofHatchAdder( - GT_TileEntity_ExtremeIndustrialGreenhouse::addOutputToMachineList, - CASING_INDEX, - 1))) - .addElement('C', onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1))) - .addElement( - 'l', - LoaderReference.ProjRedIllumination - ? ofBlock(Block.getBlockFromName("ProjRed|Illumination:projectred.illumination.lamp"), 10) - : ofBlock(Blocks.redstone_lamp, 0)) - .addElement( - 'g', - debug ? ofBlock(Blocks.glass, 0) - : BorosilicateGlass.ofBoroGlass( - (byte) 0, - (byte) 1, - Byte.MAX_VALUE, - (te, t) -> te.glasTier = t, - te -> te.glasTier)) - .addElement( - 'd', - ofBlock( - LoaderReference.RandomThings ? Block.getBlockFromName("RandomThings:fertilizedDirt_tilled") - : Blocks.farmland, - 0)) - .addElement('w', ofBlock(Blocks.water, 0)).build(); - - public GT_TileEntity_ExtremeIndustrialGreenhouse(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public GT_TileEntity_ExtremeIndustrialGreenhouse(String aName) { - super(aName); - } - - @Override - public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (aPlayer.isSneaking()) { - if (this.mMaxProgresstime > 0) { - GT_Utility.sendChatToPlayer(aPlayer, "You can't change IC2 mode if the machine is working!"); - return; - } - if (!mStorage.isEmpty()) { - GT_Utility.sendChatToPlayer(aPlayer, "You can't change IC2 mode if there are seeds inside!"); - return; - } - this.isIC2Mode = !this.isIC2Mode; - GT_Utility.sendChatToPlayer(aPlayer, "IC2 mode is now " + (this.isIC2Mode ? "enabled" : "disabled.")); - } else { - if (this.mMaxProgresstime > 0) { - GT_Utility.sendChatToPlayer(aPlayer, "You can't enable/disable setup if the machine is working!"); - return; - } - this.setupphase++; - if (this.setupphase == 3) this.setupphase = 0; - GT_Utility.sendChatToPlayer( - aPlayer, - "EIG is now running in " + (this.setupphase == 1 ? "setup mode (input)." - : (this.setupphase == 2 ? "setup mode (output)." : "normal operation."))); - } - } - - @Override - public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { - isNoHumidity = !isNoHumidity; - GT_Utility.sendChatToPlayer(aPlayer, "Give incoming crops no humidity " + isNoHumidity); - return true; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_TileEntity_ExtremeIndustrialGreenhouse(this.mName); - } - - @Override - public IStructureDefinition getStructureDefinition() { - return STRUCTURE_DEFINITION; - } - - @Override - protected IAlignmentLimits getInitialAlignmentLimits() { - return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && f.isNotFlipped(); - } - - private static String tierString(int tier) { - return GT_Values.TIER_COLORS[tier] + GT_Values.VN[tier] + ChatColorHelper.RESET + ChatColorHelper.GRAY; - } - - @Override - protected GT_Multiblock_Tooltip_Builder createTooltip() { - GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Crop Farm").addInfo("Controller block for the Extreme Industrial Greenhouse") - .addInfo(AuthorKuba).addInfo("Grow your crops like a chad !") - .addInfo("Use screwdriver to enable/change/disable setup mode") - .addInfo("Use screwdriver while sneaking to enable/disable IC2 mode") - .addInfo("Use wire cutters to give incoming IC2 crops 0 humidity") - .addInfo("Uses 1000L of water per crop per operation") - .addInfo("If there are >= 1000 crops -> Uses 1L of Weed-EX 9000 per crop per second") - .addInfo("Otherwise, around 1% of crops will die each operation") - .addInfo("You can insert fertilizer each operation to get more drops (max +400%)") - .addInfo("-------------------- SETUP MODE --------------------").addInfo("Does not take power") - .addInfo("There are two modes: input / output") - .addInfo("Input mode: machine will take seeds from input bus and plant them") - .addInfo("[IC2] You need to also input block that is required under the crop") - .addInfo("Output mode: machine will take planted seeds and output them") - .addInfo("-------------------- NORMAL CROPS --------------------") - .addInfo("Minimal tier: " + tierString(4)).addInfo("Starting with 1 slot") - .addInfo("Every slot gives 64 crops") - .addInfo("Every tier past " + tierString(4) + ", slots are multiplied by 2") - .addInfo("Base process time: 5 sec") - .addInfo("Process time is divided by number of tiers past " + tierString(3) + " (Minimum 1 sec)") - .addInfo("All crops are grown at the end of the operation") - .addInfo("Will automatically craft seeds if they are not dropped") - .addInfo("1 Fertilizer per 1 crop +200%") - .addInfo("-------------------- IC2 CROPS --------------------") - .addInfo("Minimal tier: " + tierString(6)).addInfo("Need " + tierString(6) + " glass tier") - .addInfo("Starting with 4 slots").addInfo("Every slot gives 1 crop") - .addInfo("Every tier past " + tierString(6) + ", slots are multiplied by 4") - .addInfo("Process time: 5 sec").addInfo("All crops are accelerated by x32 times") - .addInfo("1 Fertilizer per 1 crop +10%").addInfo(BW_Tooltip_Reference.TT_BLUEPRINT).addSeparator() - .beginStructureBlock(5, 6, 5, false).addController("Front bottom center") - .addCasingInfo("Clean Stainless Steel Casings", 70) - .addOtherStructurePart("Borosilicate Glass", "Hollow two middle layers") - .addStructureInfo("The glass tier limits the Energy Input tier") - .addStructureInfo("The dirt is from RandomThings, must be tilled") - .addStructureInfo("Purple lamps are from ProjectRedIllumination. They can be powered and/or inverted") - .addMaintenanceHatch("Any casing (Except inner bottom ones)", 1) - .addInputBus("Any casing (Except inner bottom ones)", 1) - .addOutputBus("Any casing (Except inner bottom ones)", 1) - .addInputHatch("Any casing (Except inner bottom ones)", 1) - .addEnergyHatch("Any casing (Except inner bottom ones)", 1) - .toolTipFinisher(MULTIBLOCK_ADDED_VIA_BARTWORKS.apply(ChatColorHelper.GOLD + "kuba6000")); - return tt; - } - - @Override - public String[] getStructureDescription(ItemStack stackSize) { - List info = new ArrayList<>(Arrays.asList(super.getStructureDescription(stackSize))); - info.add("The dirt is from RandomThings, must be tilled"); - info.add("Purple lamps are from ProjectRedIllumination. They can be powered and/or inverted"); - return info.toArray(new String[] {}); - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setInteger("EIG_MATH_VERSION", EIG_MATH_VERSION); - aNBT.setByte("glasTier", glasTier); - aNBT.setInteger("setupphase", setupphase); - aNBT.setBoolean("isIC2Mode", isIC2Mode); - aNBT.setBoolean("isNoHumidity", isNoHumidity); - aNBT.setInteger("mStorageSize", mStorage.size()); - for (int i = 0; i < mStorage.size(); i++) aNBT.setTag("mStorage." + i, mStorage.get(i).toNBTTagCompound()); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - oldVersion = aNBT.hasKey("EIG_MATH_VERSION") ? aNBT.getInteger("EIG_MATH_VERSION") : -1; - glasTier = aNBT.getByte("glasTier"); - setupphase = aNBT.getInteger("setupphase"); - isIC2Mode = aNBT.getBoolean("isIC2Mode"); - isNoHumidity = aNBT.getBoolean("isNoHumidity"); - for (int i = 0; i < aNBT.getInteger("mStorageSize"); i++) - mStorage.add(new GreenHouseSlot(aNBT.getCompoundTag("mStorage." + i))); - } - - @SideOnly(Side.CLIENT) - public void spawnVisualCrops(World world, int x, int y, int z, int age) { - BW_CropVisualizer crop = new BW_CropVisualizer(world, x, y, z, age); - Minecraft.getMinecraft().effectRenderer.addEffect(crop); - } - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - super.onPostTick(aBaseMetaTileEntity, aTick); - if (aBaseMetaTileEntity.isClientSide()) { - if (aBaseMetaTileEntity.isActive() && aTick % 40 == 0) { - int[] abc = new int[] { 0, -2, 2 }; - int[] xyz = new int[] { 0, 0, 0 }; - this.getExtendedFacing().getWorldOffset(abc, xyz); - xyz[0] += aBaseMetaTileEntity.getXCoord(); - xyz[1] += aBaseMetaTileEntity.getYCoord(); - xyz[2] += aBaseMetaTileEntity.getZCoord(); - spawnVisualCrops(aBaseMetaTileEntity.getWorld(), xyz[0], xyz[1], xyz[2], 40); - } - } - if (aBaseMetaTileEntity.isServerSide()) { - MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( - aBaseMetaTileEntity.getWorld(), - new EIGPacket( - new Coords( - aBaseMetaTileEntity.getXCoord(), - aBaseMetaTileEntity.getYCoord(), - aBaseMetaTileEntity.getZCoord()), - mMaxSlots), - aBaseMetaTileEntity.getXCoord(), - aBaseMetaTileEntity.getZCoord()); - } - } - - @Override - public void construct(ItemStack itemStack, boolean b) { - buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 2, 5, 0); - } - - @Override - public boolean isCorrectMachinePart(ItemStack itemStack) { - return true; - } - - private void updateMaxSlots() { - long v = this.getMaxInputVoltage(); - int tier = GT_Utility.getTier(v); - if (tier < (isIC2Mode ? 6 : 4)) mMaxSlots = 0; - else if (isIC2Mode) mMaxSlots = 4 << (2 * (tier - 6)); - else mMaxSlots = 1 << (tier - 4); - } - - @Override - public boolean checkRecipe(ItemStack itemStack) { - long v = this.getMaxInputVoltage(); - int tier = GT_Utility.getTier(v); - updateMaxSlots(); - - if (oldVersion != EIG_MATH_VERSION) { - for (GreenHouseSlot slot : mStorage) slot.recalculate(this, getBaseMetaTileEntity().getWorld()); - oldVersion = EIG_MATH_VERSION; - } - - if (setupphase > 0) { - if ((mStorage.size() >= mMaxSlots && setupphase == 1) || (mStorage.size() == 0 && setupphase == 2)) - return false; - - if (setupphase == 1) { - List inputs = getStoredInputs(); - for (ItemStack input : inputs) { - addCrop(input); - if (mStorage.size() >= mMaxSlots) break; - } - } else if (setupphase == 2) { - int emptySlots = 0; - boolean ignoreEmptiness = false; - for (GT_MetaTileEntity_Hatch_OutputBus i : mOutputBusses) { - if (i instanceof GT_MetaTileEntity_Hatch_OutputBus_ME) { - ignoreEmptiness = true; - break; - } - for (int j = 0; j < i.getSizeInventory(); j++) - if (i.isValidSlot(j)) if (i.getStackInSlot(j) == null) emptySlots++; - } - while (mStorage.size() > 0) { - if (!ignoreEmptiness && (emptySlots -= 2) < 0) break; - this.addOutput(this.mStorage.get(0).input.copy()); - if (this.mStorage.get(0).undercrop != null) this.addOutput(this.mStorage.get(0).undercrop.copy()); - this.mStorage.remove(0); - } - } - - this.updateSlots(); - this.mMaxProgresstime = 5; - this.mEUt = 0; - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - return true; - } - if (mStorage.size() > mMaxSlots) return false; - if (mStorage.isEmpty()) return false; - - waterusage = 0; - weedexusage = 0; - for (GreenHouseSlot s : mStorage) waterusage += s.input.stackSize; - if (waterusage >= 1000) weedexusage = waterusage; - waterusage *= 1000; - - List fluids = mInputHatches; - List fluidsToUse = new ArrayList<>(fluids.size()); - int watercheck = waterusage; - FluidStack waterStack = new FluidStack(FluidRegistry.WATER, 1); - for (GT_MetaTileEntity_Hatch_Input i : fluids) { - if (!isValidMetaTileEntity(i)) continue; - if (i instanceof GT_MetaTileEntity_Hatch_MultiInput) { - int amount = ((GT_MetaTileEntity_Hatch_MultiInput) i).getFluidAmount(waterStack); - if (amount == 0) continue; - watercheck -= amount; - } else { - FluidStack stack = i.getDrainableStack(); - if (stack == null) continue; - if (!stack.isFluidEqual(waterStack)) continue; - if (stack.amount <= 0) continue; - watercheck -= stack.amount; - } - fluidsToUse.add(i); - if (watercheck <= 0) break; - } - if (watercheck > 0 && !debug) return false; - watercheck = waterusage; - for (GT_MetaTileEntity_Hatch_Input i : fluidsToUse) { - int used = i.drain(watercheck, true).amount; - watercheck -= used; - } - - // weedex - if (weedexusage > 0 && !this.depleteInput(new FluidStack(weedex, isIC2Mode ? weedexusage * 5 : weedexusage))) { - IGregTechTileEntity baseMTE = this.getBaseMetaTileEntity(); - int tokill = baseMTE.getRandomNumber((int) ((double) weedexusage * 0.02d) + 1); - for (int i = 0; i < tokill;) { - GreenHouseSlot removed = mStorage.remove(baseMTE.getRandomNumber(mStorage.size())); - i -= removed.input.stackSize; - } - } - - // OVERCLOCK - // FERTILIZER IDEA: - // IC2 +10% per fertilizer per crop per operation - // NORMAL +200% per fertilizer per crop per operation - - int boost = 0; - int maxboost = 0; - for (GreenHouseSlot s : mStorage) maxboost += s.input.stackSize * (isIC2Mode ? 40 : 2); - - ArrayList inputs = getStoredInputs(); - for (ItemStack i : inputs) { - if ((i.getItem() == Items.dye && i.getItemDamage() == 15) - || (forestryfertilizer != null && (i.getItem() == forestryfertilizer)) - || (GT_Utility.areStacksEqual(i, Ic2Items.fertilizer))) { - int used = Math.min(i.stackSize, maxboost - boost); - i.stackSize -= used; - boost += used; - } - if (boost == maxboost) break; - } - - double multiplier = 1.d + (((double) boost / (double) maxboost) * 4d); - - if (isIC2Mode) { - if (glasTier < 6) return false; - this.mMaxProgresstime = 100; - List outputs = new ArrayList<>(); - for (int i = 0; i < Math.min(mMaxSlots, mStorage.size()); i++) - outputs.addAll(mStorage.get(i).getIC2Drops(((double) this.mMaxProgresstime * 32d) * multiplier)); - this.mOutputItems = outputs.toArray(new ItemStack[0]); - } else { - this.mMaxProgresstime = Math.max(20, 100 / (tier - 3)); // Min 1 s - List outputs = new ArrayList<>(); - for (int i = 0; i < Math.min(mMaxSlots, mStorage.size()); i++) { - for (ItemStack drop : mStorage.get(i).getDrops()) { - ItemStack s = drop.copy(); - s.stackSize = (int) ((double) s.stackSize * multiplier); - outputs.add(s); - } - } - this.mOutputItems = outputs.toArray(new ItemStack[0]); - } - this.mEUt = -(int) ((double) GT_Values.V[tier] * 0.99d); - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - this.updateSlots(); - return true; - } - - @Override - public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - mCasing = 0; - glasTier = 0; - if (debug) glasTier = 8; - - if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 5, 0)) return false; - - if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) - for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) - if (this.glasTier < hatchEnergy.mTier) return false; - - boolean valid = this.mMaintenanceHatches.size() == 1 && this.mEnergyHatches.size() >= 1 && this.mCasing >= 70; - - if (valid) updateMaxSlots(); - - return valid; - } - - @Override - public int getMaxEfficiency(ItemStack itemStack) { - return 10000; - } - - @Override - public int getDamageToComponent(ItemStack itemStack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack itemStack) { - return false; - } - - @Override - public boolean useModularUI() { - return true; - } - - private final Function isFixed = widget -> getIdealStatus() == getRepairStatus() && mMachine; - - private static final Function toggleButtonBackgroundGetter = val -> { - if (val == 0) return new IDrawable[] { GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CROSS }; - else return new IDrawable[] { GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CHECKMARK }; - }; - - @Override - public int getGUIHeight() { - return 166; - } - - @Override - public int getGUIWidth() { - return 176; - } - - @Override - public void bindPlayerInventoryUI(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.bindPlayerInventory(buildContext.getPlayer(), new Pos2d(7, 83), this.getGUITextureSet().getItemSlot()); - } - - @Override - public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(7, 4).setSize(143, 75) - .setEnabled(widget -> !isFixed.apply(widget))); - - buildContext.addSyncedWindow(CONFIGURATION_WINDOW_ID, this::createConfigurationWindow); - EntityPlayer player = buildContext.getPlayer(); - - // Slot is not needed - - builder.widget( - new DynamicPositionedColumn().setSynced(false).widget( - new CycleButtonWidget().setToggle(() -> getBaseMetaTileEntity().isAllowedToWork(), works -> { - if (works) getBaseMetaTileEntity().enableWorking(); - else getBaseMetaTileEntity().disableWorking(); - - if (!(player instanceof EntityPlayerMP)) return; - String tChat = GT_Utility.trans("090", "Machine Processing: ") - + (works ? GT_Utility.trans("088", "Enabled") - : GT_Utility.trans("087", "Disabled")); - if (hasAlternativeModeText()) tChat = getAlternativeModeText(); - GT_Utility.sendChatToPlayer(player, tChat); - }).addTooltip(0, new Text("Disabled").color(Color.RED.dark(3))) - .addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3))) - .setVariableBackgroundGetter(toggleButtonBackgroundGetter).setSize(18, 18) - .addTooltip("Working status")) - .widget( - new ButtonWidget() - .setOnClick( - (clickData, widget) -> { - if (!widget.isClient()) - widget.getContext().openSyncedWindow(CONFIGURATION_WINDOW_ID); - }) - .setBackground( - GT_UITextures.BUTTON_STANDARD, - GT_UITextures.OVERLAY_BUTTON_CYCLIC) - .addTooltip("Configuration").setSize(18, 18)) - .setPos(151, 4)); - - final List drawables = new ArrayList<>(mMaxSlots); - final int perRow = 7; - - Scrollable cropsContainer = new Scrollable().setVerticalScroll(); - - if (mMaxSlots > 0) for (int i = 0, imax = ((mMaxSlots - 1) / perRow); i <= imax; i++) { - DynamicPositionedRow row = new DynamicPositionedRow().setSynced(false); - for (int j = 0, jmax = (i == imax ? (mMaxSlots - 1) % perRow : (perRow - 1)); j <= jmax; j++) { - final int finalI = i * perRow; - final int finalJ = j; - final int ID = finalI + finalJ; - row.widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (!(player instanceof EntityPlayerMP)) return; - if (mStorage.size() <= ID) return; - if (this.mMaxProgresstime > 0) { - GT_Utility.sendChatToPlayer(player, "Can't eject while running !"); - return; - } - GreenHouseSlot removed = mStorage.remove(ID); - addOutput(removed.input); - GT_Utility.sendChatToPlayer(player, "Crop ejected !"); - }).setBackground( - () -> new IDrawable[] { getBaseMetaTileEntity().getGUITextureSet().getItemSlot(), - new ItemDrawable(drawables.size() > ID ? drawables.get(ID) : null) - .withFixedSize(16, 16, 1, 1) }) - .dynamicTooltip(() -> { - if (drawables.size() > ID) return Arrays.asList( - drawables.get(ID).getDisplayName(), - "Amount: " + drawables.get(ID).stackSize, - EnumChatFormatting.GRAY + "Left click to eject"); - return Collections.emptyList(); - }).setSize(18, 18)); - } - cropsContainer.widget( - row.setPos(0, i * 18).setEnabled(widget -> widget.getPos().y < cropsContainer.getVisibleHeight())); - } - cropsContainer.attachSyncer( - new FakeSyncWidget.ListSyncer<>( - () -> mStorage.stream().map(s -> s.input).collect(Collectors.toList()), - l -> { - drawables.clear(); - drawables.addAll(l); - }, - (buffer, i) -> { - try { - buffer.writeItemStackToBuffer(i); - } catch (IOException e) { - throw new RuntimeException(e); - } - }, - buffer -> { - try { - return buffer.readItemStackFromBuffer(); - } catch (IOException e) { - throw new RuntimeException(e); - } - }), - builder); - - builder.widget(cropsContainer.setPos(10, 16).setSize(128, 60)); - - final DynamicPositionedColumn screenElements = new DynamicPositionedColumn(); - drawTexts(screenElements, null); - builder.widget(screenElements); - } - - protected ModularWindow createConfigurationWindow(final EntityPlayer player) { - ModularWindow.Builder builder = ModularWindow.builder(200, 100); - builder.setBackground(ModularUITextures.VANILLA_BACKGROUND); - builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CYCLIC).setPos(5, 5).setSize(16, 16)) - .widget(new TextWidget("Configuration").setPos(25, 9)) - .widget(ButtonWidget.closeWindowButton(true).setPos(185, 3)) - .widget( - new Column().widget( - new CycleButtonWidget().setLength(3).setGetter(() -> setupphase).setSetter(val -> { - if (!(player instanceof EntityPlayerMP)) return; - if (this.mMaxProgresstime > 0) { - GT_Utility.sendChatToPlayer( - player, - "You can't enable/disable setup if the machine is working!"); - return; - } - this.setupphase = val; - GT_Utility.sendChatToPlayer( - player, - "EIG is now running in " + (this.setupphase == 1 ? "setup mode (input)." - : (this.setupphase == 2 ? "setup mode (output)." - : "normal operation."))); - }).addTooltip(0, new Text("Operating").color(Color.GREEN.dark(3))) - .addTooltip(1, new Text("Input").color(Color.YELLOW.dark(3))) - .addTooltip(2, new Text("Output").color(Color.YELLOW.dark(3))) - .setVariableBackgroundGetter( - i -> new IDrawable[] { ModularUITextures.VANILLA_BACKGROUND, - GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18), - i == 0 ? new Text("Operating").color(Color.GREEN.dark(3)) - .withFixedSize(70 - 18, 18, 15, 0) - : i == 1 ? new Text("Input").color(Color.YELLOW.dark(3)) - .withFixedSize(70 - 18, 18, 15, 0) - : new Text("Output").color(Color.YELLOW.dark(3)) - .withFixedSize(70 - 18, 18, 15, 0) }) - .setSize(70, 18).addTooltip("Setup mode")) - .widget( - new CycleButtonWidget().setLength(2).setGetter(() -> isIC2Mode ? 1 : 0) - .setSetter(val -> { - if (!(player instanceof EntityPlayerMP)) return; - if (this.mMaxProgresstime > 0) { - GT_Utility.sendChatToPlayer( - player, - "You can't change IC2 mode if the machine is working!"); - return; - } - if (!mStorage.isEmpty()) { - GT_Utility.sendChatToPlayer( - player, - "You can't change IC2 mode if there are seeds inside!"); - return; - } - this.isIC2Mode = val == 1; - GT_Utility.sendChatToPlayer( - player, - "IC2 mode is now " - + (this.isIC2Mode ? "enabled" : "disabled.")); - }).addTooltip(0, new Text("Disabled").color(Color.RED.dark(3))) - .addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3))) - .setVariableBackgroundGetter( - i -> new IDrawable[] { ModularUITextures.VANILLA_BACKGROUND, - GT_UITextures.OVERLAY_BUTTON_CYCLIC - .withFixedSize(18, 18), - i == 0 ? new Text("Disabled").color(Color.RED.dark(3)) - .withFixedSize(70 - 18, 18, 15, 0) - : new Text("Enabled").color(Color.GREEN.dark(3)) - .withFixedSize(70 - 18, 18, 15, 0) }) - .setSize(70, 18).addTooltip("IC2 mode")) - .widget( - new CycleButtonWidget().setLength(2).setGetter(() -> isNoHumidity ? 1 : 0) - .setSetter(val -> { - if (!(player instanceof EntityPlayerMP)) return; - isNoHumidity = val == 1; - GT_Utility.sendChatToPlayer( - player, - "Give incoming crops no humidity " + isNoHumidity); - }).addTooltip(0, new Text("Disabled").color(Color.RED.dark(3))) - .addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3))) - .setVariableBackgroundGetter( - i -> new IDrawable[] { ModularUITextures.VANILLA_BACKGROUND, - GT_UITextures.OVERLAY_BUTTON_CYCLIC - .withFixedSize(18, 18), - i == 0 ? new Text("Disabled").color(Color.RED.dark(3)) - .withFixedSize(70 - 18, 18, 15, 0) - : new Text("Enabled").color(Color.GREEN.dark(3)) - .withFixedSize(70 - 18, 18, 15, 0) }) - .setSize(70, 18).addTooltip("No Humidity mode")) - .setEnabled(widget -> !getBaseMetaTileEntity().isActive()).setPos(10, 30)) - .widget( - new Column().widget(new TextWidget("Setup mode").setSize(100, 18)) - .widget(new TextWidget("IC2 mode").setSize(100, 18)) - .widget(new TextWidget("No Humidity mode").setSize(100, 18)) - .setEnabled(widget -> !getBaseMetaTileEntity().isActive()).setPos(80, 30)) - .widget( - new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CROSS).setSize(18, 18) - .setPos(10, 30) - .addTooltip( - new Text("Can't change configuration when running !").color(Color.RED.dark(3))) - .setEnabled(widget -> getBaseMetaTileEntity().isActive())); - return builder.build(); - } - - @Override - protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inventorySlot) { - screenElements.setSynced(false).setSpace(0).setPos(10, 7); - - screenElements.widget( - new DynamicPositionedRow().setSynced(false) - .widget(new TextWidget("Status: ").setDefaultColor(COLOR_TEXT_GRAY.get())) - .widget(new DynamicTextWidget(() -> { - if (getBaseMetaTileEntity().isActive()) - return new Text("Working !").color(Color.GREEN.dark(3)); - else if (getBaseMetaTileEntity().isAllowedToWork()) - return new Text("Enabled").color(Color.GREEN.dark(3)); - else if (getBaseMetaTileEntity().wasShutdown()) - return new Text("Shutdown (CRITICAL)").color(Color.RED.dark(3)); - else return new Text("Disabled").color(Color.RED.dark(3)); - })).setEnabled(isFixed)); - - screenElements - .widget( - new TextWidget(GT_Utility.trans("132", "Pipe is loose.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mWrench)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> mWrench, val -> mWrench = val)); - screenElements - .widget( - new TextWidget(GT_Utility.trans("133", "Screws are loose.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mScrewdriver)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> mScrewdriver, val -> mScrewdriver = val)); - screenElements - .widget( - new TextWidget(GT_Utility.trans("134", "Something is stuck.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mSoftHammer)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> mSoftHammer, val -> mSoftHammer = val)); - screenElements - .widget( - new TextWidget(GT_Utility.trans("135", "Platings are dented.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mHardHammer)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> mHardHammer, val -> mHardHammer = val)); - screenElements - .widget( - new TextWidget(GT_Utility.trans("136", "Circuitry burned out.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mSolderingTool)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> mSolderingTool, val -> mSolderingTool = val)); - screenElements - .widget( - new TextWidget(GT_Utility.trans("137", "That doesn't belong there.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mCrowbar)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> mCrowbar, val -> mCrowbar = val)); - screenElements - .widget( - new TextWidget(GT_Utility.trans("138", "Incomplete Structure.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mMachine)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val)); - } - - @Override - public String[] getInfoData() { - List info = new ArrayList<>( - Arrays.asList( - "Running in mode: " + EnumChatFormatting.GREEN - + (setupphase == 0 ? (isIC2Mode ? "IC2 crops" : "Normal crops") - : ("Setup mode " + (setupphase == 1 ? "(input)" : "(output)"))) - + EnumChatFormatting.RESET, - "Uses " + waterusage + "L/operation of water", - "Uses " + weedexusage + "L/second of Weed-EX 9000", - "Max slots: " + EnumChatFormatting.GREEN + this.mMaxSlots + EnumChatFormatting.RESET, - "Used slots: " - + ((mStorage.size() > mMaxSlots) ? EnumChatFormatting.RED : EnumChatFormatting.GREEN) - + this.mStorage.size() - + EnumChatFormatting.RESET)); - HashMap storageList = new HashMap<>(); - for (GreenHouseSlot greenHouseSlot : mStorage) { - if (!greenHouseSlot.isValid) continue; - StringBuilder a = new StringBuilder( - EnumChatFormatting.GREEN + "x" - + greenHouseSlot.input.stackSize - + " " - + greenHouseSlot.input.getDisplayName()); - if (this.isIC2Mode) { - a.append(" | Humidity: ").append(greenHouseSlot.noHumidity ? 0 : 12); - } - a.append(EnumChatFormatting.RESET); - storageList.merge(a.toString(), 1, Integer::sum); - } - storageList.forEach((k, v) -> info.add("x" + v + " " + k)); - if (mStorage.size() > mMaxSlots) info.add( - EnumChatFormatting.DARK_RED + "There are too many crops inside to run !" + EnumChatFormatting.RESET); - info.addAll(Arrays.asList(super.getInfoData())); - return info.toArray(new String[0]); - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow() - .build() }; - return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow() - .build() }; - } - return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) }; - } - - public final List mStorage = new ArrayList<>(); - - public boolean addCrop(ItemStack input) { - if (!isIC2Mode) - for (GreenHouseSlot g : mStorage) if (g.input.stackSize < 64 && GT_Utility.areStacksEqual(g.input, input)) { - g.addAll(this.getBaseMetaTileEntity().getWorld(), input); - if (input.stackSize == 0) return true; - } - GreenHouseSlot h = new GreenHouseSlot(this, input, isIC2Mode, isNoHumidity); - if (h.isValid) { - mStorage.add(h); - return true; - } - return false; - } - - private static class GreenHouseSlot extends InventoryCrafting { - - final ItemStack input; - Block crop; - ArrayList customDrops = null; - ItemStack undercrop = null; - List drops; - boolean isValid; - boolean isIC2Crop; - boolean noHumidity; - int growthticks; - List> generations; - - Random rn; - IRecipe recipe; - ItemStack recipeInput; - - int optimalgrowth = 7; - - boolean needsreplanting = true; - - static final GreenHouseWorld fakeworld = new GreenHouseWorld(5, 5, 5); - - public NBTTagCompound toNBTTagCompound() { - NBTTagCompound aNBT = new NBTTagCompound(); - aNBT.setTag("input", input.writeToNBT(new NBTTagCompound())); - aNBT.setBoolean("isValid", isValid); - aNBT.setBoolean("isIC2Crop", isIC2Crop); - if (!isIC2Crop) { - aNBT.setInteger("crop", Block.getIdFromBlock(crop)); - if (customDrops != null && customDrops.size() > 0) { - aNBT.setInteger("customDropsCount", customDrops.size()); - for (int i = 0; i < customDrops.size(); i++) - aNBT.setTag("customDrop." + i, customDrops.get(i).writeToNBT(new NBTTagCompound())); - } - aNBT.setInteger("dropscount", drops.size()); - for (int i = 0; i < drops.size(); i++) - aNBT.setTag("drop." + i, drops.get(i).writeToNBT(new NBTTagCompound())); - aNBT.setInteger("optimalgrowth", optimalgrowth); - aNBT.setBoolean("needsreplanting", needsreplanting); - } else { - if (undercrop != null) aNBT.setTag("undercrop", undercrop.writeToNBT(new NBTTagCompound())); - aNBT.setInteger("generationscount", generations.size()); - for (int i = 0; i < generations.size(); i++) { - aNBT.setInteger("generation." + i + ".count", generations.get(i).size()); - for (int j = 0; j < generations.get(i).size(); j++) aNBT.setTag( - "generation." + i + "." + j, - generations.get(i).get(j).writeToNBT(new NBTTagCompound())); - } - aNBT.setInteger("growthticks", growthticks); - aNBT.setBoolean("noHumidity", noHumidity); - } - return aNBT; - } - - public GreenHouseSlot(NBTTagCompound aNBT) { - super(null, 3, 3); - isIC2Crop = aNBT.getBoolean("isIC2Crop"); - isValid = aNBT.getBoolean("isValid"); - input = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("input")); - if (!isIC2Crop) { - crop = Block.getBlockById(aNBT.getInteger("crop")); - if (aNBT.hasKey("customDropsCount")) { - int imax = aNBT.getInteger("customDropsCount"); - customDrops = new ArrayList<>(imax); - for (int i = 0; i < imax; i++) - customDrops.add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("customDrop." + i))); - } - drops = new ArrayList<>(); - for (int i = 0; i < aNBT.getInteger("dropscount"); i++) - drops.add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("drop." + i))); - optimalgrowth = aNBT.getInteger("optimalgrowth"); - if (optimalgrowth == 0) optimalgrowth = 7; - if (aNBT.hasKey("needsreplanting")) needsreplanting = aNBT.getBoolean("needsreplanting"); - } else { - if (aNBT.hasKey("undercrop")) - undercrop = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("undercrop")); - generations = new ArrayList<>(); - for (int i = 0; i < aNBT.getInteger("generationscount"); i++) { - generations.add(new ArrayList<>()); - for (int j = 0; j < aNBT.getInteger("generation." + i + ".count"); j++) generations.get(i) - .add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("generation." + i + "." + j))); - } - growthticks = aNBT.getInteger("growthticks"); - noHumidity = aNBT.getBoolean("noHumidity"); - rn = new Random(); - } - } - - public boolean addAll(World world, ItemStack input) { - if (!GT_Utility.areStacksEqual(this.input, input)) return false; - if (this.input.stackSize == 64) return false; - int toconsume = Math.min(64 - this.input.stackSize, input.stackSize); - int left = addDrops(world, toconsume); - input.stackSize -= toconsume - left; - this.input.stackSize += toconsume - left; - return left == 0; - } - - public boolean findCropRecipe(World world) { - if (recipe != null) return true; - out: for (ItemStack drop : drops) { - recipeInput = drop; - for (int j = 0; j < CraftingManager.getInstance().getRecipeList().size(); j++) { - recipe = (IRecipe) CraftingManager.getInstance().getRecipeList().get(j); - if (recipe.matches(this, world) - && GT_Utility.areStacksEqual(recipe.getCraftingResult(this), input)) { - break out; - } else recipe = null; - } - } - return recipe != null; - } - - @Override - public ItemStack getStackInSlot(int p_70301_1_) { - if (p_70301_1_ == 0) return recipeInput.copy(); - return null; - } - - @Override - public ItemStack getStackInSlotOnClosing(int par1) { - return null; - } - - @Override - public ItemStack decrStackSize(int par1, int par2) { - return null; - } - - @SuppressWarnings("EmptyMethod") - @Override - public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {} - - public GreenHouseSlot(GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, ItemStack input, boolean IC2, - boolean noHumidity) { - super(null, 3, 3); - World world = tileEntity.getBaseMetaTileEntity().getWorld(); - this.input = input.copy(); - this.isValid = false; - if (IC2) { - GreenHouseSlotIC2(tileEntity, world, input, noHumidity); - return; - } - Item i = input.getItem(); - Block b = null; - boolean detectedCustomHandler = false; - // Custom handlers - // FLOWERS // - Block bb = Block.getBlockFromItem(i); - if (bb == Blocks.air) bb = null; - if (bb instanceof BlockFlower) { - detectedCustomHandler = true; - needsreplanting = false; - customDrops = new ArrayList<>(Collections.singletonList(input.copy())); - customDrops.get(0).stackSize = 1; - } - if (!detectedCustomHandler) { - if (i instanceof IPlantable) { - if (i instanceof ItemSeeds) b = ((ItemSeeds) i).getPlant(world, 0, 0, 0); - else if (i instanceof ItemSeedFood) b = ((ItemSeedFood) i).getPlant(world, 0, 0, 0); - } else { - if (i == Items.reeds) b = Blocks.reeds; - else { - b = Block.getBlockFromItem(i); - if (b != Blocks.cactus) return; - } - needsreplanting = false; - } - if (!(b instanceof IPlantable)) return; - GameRegistry.UniqueIdentifier u = GameRegistry.findUniqueIdentifierFor(i); - if (u != null && Objects.equals(u.modId, "Natura")) optimalgrowth = 8; - - if (b instanceof BlockStem) { - fakeworld.block = null; - try { - b.updateTick(fakeworld, 5, 5, 5, fakeworld.rand); - } catch (Exception e) { - e.printStackTrace(System.err); - } - if (fakeworld.block == null) return; - b = fakeworld.block; - needsreplanting = false; - } - } - crop = b; - isIC2Crop = false; - int toUse = Math.min(64, input.stackSize); - if (addDrops(world, toUse) == 0 && !drops.isEmpty()) { - input.stackSize -= toUse; - this.input.stackSize = toUse; - this.isValid = true; - } - } - - public void GreenHouseSlotIC2(GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, World world, - ItemStack input, boolean noHumidity) { - if (!ItemList.IC2_Crop_Seeds.isStackEqual(input, true, true)) return; - this.isIC2Crop = true; - this.noHumidity = noHumidity; - recalculate(tileEntity, world); - if (this.isValid) input.stackSize--; - } - - private boolean setBlock(ItemStack a, int x, int y, int z, World world) { - Item item = a.getItem(); - Block b = Block.getBlockFromItem(item); - if (b == Blocks.air || !(item instanceof ItemBlock)) return false; - short tDamage = (short) item.getDamage(a); - if (item instanceof GT_Item_Ores && tDamage > 0) { - if (!world.setBlock( - x, - y, - z, - b, - GT_TileEntity_Ores.getHarvestData( - tDamage, - ((GT_Block_Ores_Abstract) b).getBaseBlockHarvestLevel(tDamage % 16000 / 1000)), - 0)) { - return false; - } - GT_TileEntity_Ores tTileEntity = (GT_TileEntity_Ores) world.getTileEntity(x, y, z); - tTileEntity.mMetaData = tDamage; - tTileEntity.mNatural = false; - } else world.setBlock(x, y, z, b, tDamage, 0); - return true; - } - - public void recalculate(GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, World world) { - if (isIC2Crop) { - CropCard cc = Crops.instance.getCropCard(input); - this.input.stackSize = 1; - NBTTagCompound nbt = input.getTagCompound(); - byte gr = nbt.getByte("growth"); - byte ga = nbt.getByte("gain"); - byte re = nbt.getByte("resistance"); - int[] abc = new int[] { 0, -2, 3 }; - int[] xyz = new int[] { 0, 0, 0 }; - tileEntity.getExtendedFacing().getWorldOffset(abc, xyz); - xyz[0] += tileEntity.getBaseMetaTileEntity().getXCoord(); - xyz[1] += tileEntity.getBaseMetaTileEntity().getYCoord(); - xyz[2] += tileEntity.getBaseMetaTileEntity().getZCoord(); - boolean cheating = false; - try { - if (world.getBlock(xyz[0], xyz[1] - 2, xyz[2]) != GregTech_API.sBlockCasings4 - || world.getBlockMetadata(xyz[0], xyz[1] - 2, xyz[2]) != 1) { - // no - cheating = true; - return; - } - - world.setBlock(xyz[0], xyz[1], xyz[2], Block.getBlockFromItem(Ic2Items.crop.getItem()), 0, 0); - TileEntity wte = world.getTileEntity(xyz[0], xyz[1], xyz[2]); - if (!(wte instanceof TileEntityCrop)) { - // should not be even possible - return; - } - TileEntityCrop te = (TileEntityCrop) wte; - te.ticker = 1; // don't even think about ticking once - te.setCrop(cc); - - te.setGrowth(gr); - te.setGain(ga); - te.setResistance(re); - - ItemStack tobeused = null; - - if (undercrop != null) setBlock(undercrop, xyz[0], xyz[1] - 2, xyz[2], world); - else { - te.setSize((byte) (cc.maxSize() - 1)); - if (!cc.canGrow(te)) { - // needs special block - - boolean cangrow = false; - ArrayList inputs = tileEntity.getStoredInputs(); - for (ItemStack a : inputs) { - if (a.stackSize <= 0) continue; - if (!setBlock(a, xyz[0], xyz[1] - 2, xyz[2], world)) continue; - if (!cc.canGrow(te)) continue; - cangrow = true; - undercrop = a.copy(); - undercrop.stackSize = 1; - tobeused = a; - break; - } - - if (!cangrow) return; - } - } - - te.setSize((byte) cc.maxSize()); - - if (!cc.canBeHarvested(te)) return; - - // GENERATE DROPS - generations = new ArrayList<>(); - out: for (int i = 0; i < 10; i++) // get 10 generations - { - ItemStack[] st = te.harvest_automated(false); - te.setSize((byte) cc.maxSize()); - if (st == null) continue; - if (st.length == 0) continue; - for (ItemStack s : st) if (s == null) continue out; - generations.add(new ArrayList<>(Arrays.asList(st))); - } - if (generations.isEmpty()) return; - rn = new Random(); - - // CHECK GROWTH SPEED - te.humidity = (byte) (noHumidity ? 0 : 12); // humidity with full water storage or 0 humidity - te.airQuality = 6; // air quality when sky is seen - te.nutrients = 8; // nutrients with full nutrient storage - - int dur = cc.growthDuration(te); - int rate = te.calcGrowthRate(); - if (rate == 0) return; // should not be possible with those stats - growthticks = (int) Math.ceil( - ((double) dur / (double) rate) * (double) cc.maxSize() * (double) TileEntityCrop.tickRate); - if (growthticks < 1) growthticks = 1; - - if (tobeused != null) tobeused.stackSize--; - - this.isValid = true; - } catch (Exception e) { - e.printStackTrace(System.err); - } finally { - if (!cheating) world.setBlock(xyz[0], xyz[1] - 2, xyz[2], GregTech_API.sBlockCasings4, 1, 0); - world.setBlockToAir(xyz[0], xyz[1], xyz[2]); - } - } else { - drops = new ArrayList<>(); - addDrops(world, input.stackSize); - } - } - - public List getDrops() { - return drops; - } - - final Map dropprogress = new HashMap<>(); - static final Map dropstacks = new HashMap<>(); - - public List getIC2Drops(double timeelapsed) { - int r = rn.nextInt(10); - if (generations.size() <= r) return new ArrayList<>(); - double growthPercent = (timeelapsed / (double) growthticks); - List generation = generations.get(r); - List copied = new ArrayList<>(); - for (ItemStack g : generation) copied.add(g.copy()); - for (ItemStack s : copied) { - double pro = ((double) s.stackSize * growthPercent); - s.stackSize = 1; - if (dropprogress.containsKey(s.toString())) - dropprogress.put(s.toString(), dropprogress.get(s.toString()) + pro); - else dropprogress.put(s.toString(), pro); - if (!dropstacks.containsKey(s.toString())) dropstacks.put(s.toString(), s.copy()); - } - copied.clear(); - for (Map.Entry entry : dropprogress.entrySet()) if (entry.getValue() >= 1d) { - copied.add(dropstacks.get(entry.getKey()).copy()); - copied.get(copied.size() - 1).stackSize = entry.getValue().intValue(); - entry.setValue(entry.getValue() - (double) entry.getValue().intValue()); - } - return copied; - } - - public int addDrops(World world, int count) { - if (drops == null) drops = new ArrayList<>(); - if (customDrops != null && customDrops.size() > 0) { - @SuppressWarnings("unchecked") - ArrayList d = (ArrayList) customDrops.clone(); - for (ItemStack x : drops) { - for (Iterator iterator = d.iterator(); iterator.hasNext();) { - ItemStack y = iterator.next(); - if (GT_Utility.areStacksEqual(x, y)) { - x.stackSize += y.stackSize * count; - iterator.remove(); - } - } - } - final int finalCount = count; - d.forEach(stack -> { - ItemStack i = stack.copy(); - i.stackSize *= finalCount; - drops.add(i); - }); - return 0; - } else { - if (crop == null) return count; - for (int i = 0; i < count; i++) { - List d = crop.getDrops(world, 0, 0, 0, optimalgrowth, 0); - for (ItemStack x : drops) for (ItemStack y : d) if (GT_Utility.areStacksEqual(x, y)) { - x.stackSize += y.stackSize; - y.stackSize = 0; - } - for (ItemStack x : d) if (x.stackSize > 0) drops.add(x.copy()); - } - } - if (!needsreplanting) return 0; - for (int i = 0; i < drops.size(); i++) { - if (GT_Utility.areStacksEqual(drops.get(i), input)) { - int took = Math.min(drops.get(i).stackSize, count); - drops.get(i).stackSize -= took; - count -= took; - if (drops.get(i).stackSize == 0) { - drops.remove(i); - i--; - } - if (count == 0) { - return 0; - } - } - } - if (!findCropRecipe(world)) return count; - int totake = count / recipe.getCraftingResult(this).stackSize + 1; - for (int i = 0; i < drops.size(); i++) { - if (GT_Utility.areStacksEqual(drops.get(i), recipeInput)) { - int took = Math.min(drops.get(i).stackSize, totake); - drops.get(i).stackSize -= took; - totake -= took; - if (drops.get(i).stackSize == 0) { - drops.remove(i); - i--; - } - if (totake == 0) { - return 0; - } - } - } - return count; - } - } - - private static class GreenHouseWorld extends GT_DummyWorld { - - public int x, y, z, meta = 0; - public Block block; - - GreenHouseWorld(int x, int y, int z) { - super(); - this.x = x; - this.y = y; - this.z = z; - this.rand = new GreenHouseRandom(); - } - - @Override - public int getBlockMetadata(int aX, int aY, int aZ) { - if (aX == x && aY == y && aZ == z) return 7; - return 0; - } - - @Override - public Block getBlock(int aX, int aY, int aZ) { - if (aY == y - 1) return Blocks.farmland; - return Blocks.air; - } - - @Override - public int getBlockLightValue(int p_72957_1_, int p_72957_2_, int p_72957_3_) { - return 10; - } - - @Override - public boolean setBlock(int aX, int aY, int aZ, Block aBlock, int aMeta, int aFlags) { - if (aBlock == Blocks.air) return false; - if (aX == x && aY == y && aZ == z) return false; - block = aBlock; - meta = aMeta; - return true; - } - } - - private static class GreenHouseRandom extends Random { - - @Override - public int nextInt(int bound) { - return 0; - } - } -} -- cgit From 7f3364069374379b912123d0ea1116e167542f95 Mon Sep 17 00:00:00 2001 From: Zereff06 Date: Sat, 18 Mar 2023 22:33:06 +0200 Subject: optimization bacterial vat (#302) * fix render packets (render fluid in bacterial vat) + sending every tick -> now every 10 sec + always when not completed -> if it was ever completed and now is not completed + bs + sa * * remove isEverBeenVisibleFluid * disable ticking for tileEntity which are needed to display fluids * Remove useless check Former-commit-id: 1094991190ee08a21236da8df047320094edae4c --- build.gradle | 8 +- .../classic/BWTileEntityDimIDBridge.java | 5 + .../tileentities/multis/GT_TileEntity_BioVat.java | 125 ++++++++++++++------- 3 files changed, 92 insertions(+), 46 deletions(-) diff --git a/build.gradle b/build.gradle index 927ed20fdb..7b1f6c4507 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1678003329 +//version: 1679040806 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -695,13 +695,13 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies" } dependencies { - def lwjgl3ifyVersion = '1.1.35' + def lwjgl3ifyVersion = '1.2.2' def asmVersion = '9.4' if (modId != 'lwjgl3ify') { java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") } if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.40') + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.1.0') } java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false} @@ -1204,7 +1204,7 @@ def addCurseForgeRelation(String type, String name) { // Updating -def buildscriptGradleVersion = "8.0.1" +def buildscriptGradleVersion = "8.0.2" tasks.named('wrapper', Wrapper).configure { gradleVersion = buildscriptGradleVersion diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java index 208bd24c29..bb0c0cf319 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java @@ -16,4 +16,9 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; import net.minecraft.tileentity.TileEntity; public class BWTileEntityDimIDBridge extends TileEntity { + + @Override + public boolean canUpdate() { + return false; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 3aeab597fe..c5f85fc6df 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -85,6 +85,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa private int mCasing = 0; private int mExpectedMultiplier = 0; private int mTimes = 0; + private boolean isVisibleFluid = false; public GT_TileEntity_BioVat(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -196,7 +197,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa /** * Calculates the expected output multiplier based on the output hatch - * + * * @param recipeFluidOutput the recipe fluid output * @param needEqual if the recipeFluidOutput should be equal to the fluid in the output hatch * @return the expected output multiplier @@ -388,8 +389,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } private void sendPackagesOrRenewRenderer(int x, int y, int z, BioCulture lCulture) { - int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; - int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; + int xDir = getXDir(); + int zDir = getZDir(); GT_TileEntity_BioVat.staticColorMap.remove( new Coords( @@ -460,8 +461,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } private void placeFluid() { - int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; - int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; + isVisibleFluid = true; + int xDir = getXDir(); + int zDir = getZDir(); this.height = this.reCalculateHeight(); if (this.mFluid != null && this.height > 1 && this.reCalculateFluidAmmount() > 0) for (int x = -1; x < 2; x++) { for (int y = 0; y < this.height; y++) { @@ -482,6 +484,33 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } } + private void removeFluid(int xDir, int zDir) { + isVisibleFluid = false; + + for (int x = -1; x < 2; x++) { + for (int y = 1; y < 3; y++) { + for (int z = -1; z < 2; z++) { + if (this.getBaseMetaTileEntity().getWorld() + .getBlock( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord()) + .equals(FluidLoader.bioFluidBlock)) + this.getBaseMetaTileEntity().getWorld().setBlockToAir( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord()); + GT_TileEntity_BioVat.staticColorMap.remove( + new Coords( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord()), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId); + } + } + } + } + private int reCalculateFluidAmmount() { return this.getStoredFluids().stream().mapToInt(fluidStack -> fluidStack.amount).sum(); } @@ -497,8 +526,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa if (this.mMachine) { ItemStack aStack = this.mInventory[1]; BioCulture lCulture = null; - int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; - int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; + int xDir = getXDir(); + int zDir = getZDir(); if (this.getBaseMetaTileEntity().getTimer() % 200 == 0) { this.check_Chunk(); @@ -580,49 +609,60 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa if (this.mFluid != null) aNBT.setString("mFluid", this.mFluid.getName()); aNBT.setInteger("mSievert", this.mSievert); aNBT.setInteger("mNeededSievert", this.mNeededSievert); + aNBT.setBoolean("isVisibleFluid", this.isVisibleFluid); super.saveNBTData(aNBT); } @Override public void onRemoval() { - int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; - int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; - for (int x = -1; x < 2; x++) { - for (int y = 1; y < 3; y++) { - for (int z = -1; z < 2; z++) { - if (this.getBaseMetaTileEntity().getWorld() - .getBlock( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord()) - .equals(FluidLoader.bioFluidBlock)) - this.getBaseMetaTileEntity().getWorld().setBlockToAir( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord()); - GT_TileEntity_BioVat.staticColorMap.remove( - new Coords( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord()), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId); - if (SideReference.Side.Server) MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( - this.getBaseMetaTileEntity().getWorld(), - new RendererPacket( - new Coords( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId), - this.mCulture == null ? BioCulture.NULLCULTURE.getColorRGB() - : this.mCulture.getColorRGB(), - true), - this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getZCoord()); + if (isVisibleFluid) { + int xDir = getXDir(); + int zDir = getZDir(); + removeFluid(xDir, zDir); + sendRenderPackets(xDir, zDir); + } else if (this.getBaseMetaTileEntity().getWorld().getWorldTime() % 20 == 7) { + sendRenderPackets(); + } + + super.onRemoval(); + } + + private int getXDir() { + return ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; + } + + private int getZDir() { + return ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; + } + + private void sendRenderPackets() { + int xDir = getXDir(); + int zDir = getZDir(); + sendRenderPackets(xDir, zDir); + } + + private void sendRenderPackets(int xDir, int zDir) { + if (SideReference.Side.Server) { + for (int x = -1; x < 2; x++) { + for (int y = 1; y < 3; y++) { + for (int z = -1; z < 2; z++) { + MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( + this.getBaseMetaTileEntity().getWorld(), + new RendererPacket( + new Coords( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId), + this.mCulture == null ? BioCulture.NULLCULTURE.getColorRGB() + : this.mCulture.getColorRGB(), + true), + this.getBaseMetaTileEntity().getXCoord(), + this.getBaseMetaTileEntity().getZCoord()); + } } } } - super.onRemoval(); } @Override @@ -633,6 +673,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa this.mSievert = aNBT.getInteger("mSievert"); this.mNeededSievert = aNBT.getInteger("mNeededSievert"); super.loadNBTData(aNBT); + this.isVisibleFluid = aNBT.getBoolean("isVisibleFluid"); } @Override -- cgit From ce1bdeae81288c7adf0b2b9ed09fef4c76203584 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Mon, 20 Mar 2023 20:26:40 +0000 Subject: remove osmiridium replacement (#303) Former-commit-id: 00bcc0bac21bd52d90c9a0e30fb1bc1728faf994 --- .../material/GT_Enhancement/LuVTierEnhancer.java | 28 ---------------------- 1 file changed, 28 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java index 534a18476b..2e0db87aba 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -111,7 +111,6 @@ public class LuVTierEnhancer implements Runnable { private static void replaceAllRecipes(Collection LuVMachines, OrePrefixes[] LuVMaterialsGenerated, List bufferedRecipeList) { - LuVTierEnhancer.replaceOsmiridiumInLuVRecipes(); for (GT_Recipe_AssemblyLine sAssemblylineRecipe : GT_Recipe_AssemblyLine.sAssemblylineRecipes) { for (ItemStack stack : LuVMachines) { @@ -273,33 +272,6 @@ public class LuVTierEnhancer implements Runnable { } } - private static void replaceOsmiridiumInLuVRecipes() { - Consumer replace = gt_recipe -> gt_recipe.mInputs = replaceArrayWith( - gt_recipe.mInputs, - Materials.Osmiridium, - WerkstoffLoader.Ruridit, - gt_recipe); - - GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.stream() - .filter(recipe_assemblyLine -> recipe_assemblyLine.mEUt <= 6000).forEach( - recipe_assemblyLine -> recipe_assemblyLine.mInputs = replaceArrayWith( - recipe_assemblyLine.mInputs, - Materials.Osmiridium, - WerkstoffLoader.Ruridit, - recipe_assemblyLine)); - - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList.stream() - .filter( - gt_recipe -> gt_recipe.mEUt < BW_Util.getTierVoltage(6) - && !BW_Util.checkStackAndPrefix(gt_recipe.mOutputs[0]) - && !isOutputBlackListed(gt_recipe.mOutputs[0])) - .forEach(replace); - - GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.stream() - .filter(gt_recipe -> gt_recipe.mEUt <= 6000 && !isOutputBlackListed(gt_recipe.mOutputs[0])) - .forEach(replace); - } - private static boolean isOutputBlackListed(ItemStack output) { if (blackListForOsmiridium.stream().anyMatch(s -> GT_Utility.areStacksEqual(s, output))) return true; return false; -- cgit From 603c64a414acdcd36d1f1c5771bfe724a830a6f3 Mon Sep 17 00:00:00 2001 From: GDCloud <93287602+GDCloudstrike@users.noreply.github.com> Date: Sat, 25 Mar 2023 16:57:11 +0100 Subject: Add Humongous input hatch (#304) * add hatches * recipes * Revert "recipes" This reverts commit 2cfaea1e6e352779c667d9311d7d96a831b614ac [formerly 24b9a89047f09531f51d2eb87e403d6c247e9750]. * Revert "add hatches" This reverts commit c6a23b975ce81ae2a4299d0beed0f24b9393534e [formerly 88b53666ed38948b5ee350349000575e3dae9af8]. * add humongous input hatch * number formatting * spotless * Update GT_MetaTileEntity_HumongousInputHatch.java * more number formatting --------- Co-authored-by: Martin Robertz Former-commit-id: e2d99f461606e21d202343a5bb85fcb6bceb377d --- .../bartworks/common/loaders/ItemRegistry.java | 5 +++ .../GT_MetaTileEntity_CompressedFluidHatch.java | 4 +- .../GT_MetaTileEntity_HumongousInputHatch.java | 52 ++++++++++++++++++++++ 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index c88438b9c0..fca9c5ed52 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -212,6 +212,7 @@ public class ItemRegistry { public static ItemStack cal; public static ItemStack compressedHatch; public static ItemStack giantOutputHatch; + public static ItemStack humongousInputHatch; public static ItemStack[][][] TecTechLaserAdditions = new ItemStack[3][4][4]; public static ItemStack TecTechPipeEnergyLowPower; @@ -351,6 +352,10 @@ public class ItemRegistry { ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, "GiantOutputHatch", "Giant Output Hatch").getStackForm(1L); + ItemRegistry.humongousInputHatch = new GT_MetaTileEntity_HumongousInputHatch( + ConfigHandler.IDOffset + GT_Values.VN.length * 9 + 55, + "HumongousInputHatch", + "Humongous Input Hatch").getStackForm(1L); ItemRegistry.megaMachines[2] = new GT_TileEntity_MegaDistillTower( ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, "MegaDistillationTower", diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java index b917fe90fc..b217d29445 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java @@ -27,7 +27,7 @@ public class GT_MetaTileEntity_CompressedFluidHatch extends GT_MetaTileEntity_Ha public GT_MetaTileEntity_CompressedFluidHatch(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 0); - this.mDescriptionArray[1] = "Capacity: 100000000L"; + this.mDescriptionArray[1] = "Capacity: 100,000,000L"; } public GT_MetaTileEntity_CompressedFluidHatch(String aName, int aTier, String[] aDescription, @@ -37,7 +37,7 @@ public class GT_MetaTileEntity_CompressedFluidHatch extends GT_MetaTileEntity_Ha @Override public int getCapacity() { - return 100000000; + return 100_000_000; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java new file mode 100644 index 0000000000..2951c12d05 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.common.gui.modularui.widget.FluidDisplaySlotWidget; + +public class GT_MetaTileEntity_HumongousInputHatch extends GT_MetaTileEntity_Hatch_Input { + + public GT_MetaTileEntity_HumongousInputHatch(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, 0); + this.mDescriptionArray[1] = "Capacity: 2,000,000,000L"; + } + + public GT_MetaTileEntity_HumongousInputHatch(String aName, int aTier, String[] aDescription, + ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public int getCapacity() { + return 2_000_000_000; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_HumongousInputHatch( + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); + } + + @Override + protected FluidDisplaySlotWidget createDrainableFluidSlot() { + return super.createDrainableFluidSlot(); + } +} -- cgit From 2d6ebc551518c6dfca61dadb3c01215f28491047 Mon Sep 17 00:00:00 2001 From: GDCloud <93287602+GDCloudstrike@users.noreply.github.com> Date: Tue, 4 Apr 2023 22:33:01 +0200 Subject: Add living bio chip wrap (#306) * bump dep * living bio chip wrap Former-commit-id: 9a23d6c23bb58d937a39e17a81624ba4960a599e --- dependencies.gradle | 2 +- .../bartworks/system/material/CircuitGeneration/CircuitPartLoader.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 0ecee75159..b89345c155 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.314:dev") + api("com.github.GTNewHorizons:GT5-Unofficial:5.09.42.33:dev") api("com.github.GTNewHorizons:TecTech:5.0.85:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.23-GTNH:dev") api("com.github.GTNewHorizons:Galacticraft:3.0.64-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index e02528b6c3..5e5b0b0f4c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -156,5 +156,6 @@ public class CircuitPartLoader implements Runnable { Optically_Perfected_CPU, Optical_Cpu_Containment_Housing, Optically_Compatible_Memory, - Circuit_Parts_Crystal_Chip_Wetware)); + Circuit_Parts_Crystal_Chip_Wetware, + Circuit_Parts_Chip_Bioware)); } -- cgit From dcfad6c6de834f55484a3accc6389eb34c7876c2 Mon Sep 17 00:00:00 2001 From: Maxim Date: Sat, 8 Apr 2023 22:50:41 +0200 Subject: Added imprinted circuit to CAL tooltip (#307) * Added imprinted circuit info to machine tooltip * Update dependencies.gradle --------- Co-authored-by: Martin Robertz Former-commit-id: b9bf6c9f938fb4d9b9f3b2d8deff899932740864 --- dependencies.gradle | 2 +- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 13 +++++++++++++ src/main/resources/assets/bartworks/lang/en_US.lang | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index b89345c155..6a8c26e2e6 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api("com.github.GTNewHorizons:GT5-Unofficial:5.09.42.33:dev") + api("com.github.GTNewHorizons:GT5-Unofficial:5.09.42.43:dev") api("com.github.GTNewHorizons:TecTech:5.0.85:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.23-GTNH:dev") api("com.github.GTNewHorizons:Galacticraft:3.0.64-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 6f2e501995..98d1189639 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -25,6 +25,7 @@ import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; +import java.util.List; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -402,6 +403,18 @@ public class GT_TileEntity_CircuitAssemblyLine extends return -1; } + @Override + public void addAdditionalTooltipInformation(ItemStack stack, List tooltip) { + if (stack.hasTagCompound() && stack.stackTagCompound.hasKey("Type")) { + tooltip.add( + StatCollector.translateToLocal("tooltip.cal.imprintedWith") + " " + + StatCollector.translateToLocal( + GT_LanguageManager.getTranslateableItemStackName( + ItemStack.loadItemStackFromNBT( + stack.stackTagCompound.getCompoundTag("Type"))))); + } + } + @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { super.addUIWidgets(builder, buildContext); diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 5574af759c..ce7ac08197 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -178,4 +178,6 @@ BW.NEI.display.radhatch.2=Time: %s s misc.BatchModeTextOn=Batch recipes misc.BatchModeTextOff=Don't batch recipes + +tooltip.cal.imprintedWith=Imprinted with: #Liquids -- cgit From 94b42387dbd1e45f27a8cf89108892c7c3f08822 Mon Sep 17 00:00:00 2001 From: boubou19 Date: Mon, 10 Apr 2023 15:43:14 +0200 Subject: Cleanup (#308) * switch to GT mod enum instead * move to GT5U Mods enum even more * yeet recipes loaded when used outside NH * buildscript update + GT5U version bump * fix build * spotless apply * optimize import * split recipes in different files * remove newStuff config option * load recipe files * break down BioRecipeLoader into several files Former-commit-id: 3ac362e197682f3db007d8b87f2341d777c6bdc0 --- build.gradle | 65 +- dependencies.gradle | 2 +- gradle/wrapper/gradle-wrapper.jar | Bin 61574 -> 61608 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 4 +- .../bartworks/API/BioObjectAdder.java | 4 +- .../bartworks/API/BioVatLogicAdder.java | 13 +- .../bartworks/API/BorosilicateGlass.java | 14 +- .../bartworks/API/LoaderReference.java | 86 -- .../bartimaeusnek/bartworks/API/package-info.java | 3 +- .../github/bartimaeusnek/bartworks/ASM/BWCore.java | 12 +- .../bartworks/ASM/BWCoreTransformer.java | 41 +- .../github/bartimaeusnek/bartworks/MainMod.java | 71 +- .../client/renderer/BW_GT_ItemRenderer.java | 9 - .../client/renderer/BW_Renderer_Block_Ores.java | 7 +- .../client/renderer/RendererGlasBlock.java | 2 - .../bartworks/common/configs/ConfigHandler.java | 14 - .../bartworks/common/items/LabParts.java | 4 +- .../common/loaders/ArtificialMicaLine.java | 17 +- .../bartworks/common/loaders/BeforeGTPreload.java | 6 +- .../bartworks/common/loaders/BioRecipeLoader.java | 274 +---- .../ElectricImplosionCompressorRecipes.java | 57 +- .../bartworks/common/loaders/FluidLoader.java | 7 +- .../bartworks/common/loaders/GTNHBlocks.java | 174 ++- .../bartworks/common/loaders/ItemRegistry.java | 396 +++---- .../common/loaders/RadioHatchMaterialLoader.java | 14 +- .../bartworks/common/loaders/RecipeLoader.java | 1120 +------------------- .../common/loaders/RegisterServerCommands.java | 7 +- .../common/loaders/StaticRecipeChangeLoaders.java | 26 +- .../common/loaders/recipes/Assembler.java | 224 ++++ .../common/loaders/recipes/AssemblyLine.java | 69 ++ .../common/loaders/recipes/Autoclave.java | 36 + .../common/loaders/recipes/Centrifuge.java | 177 ++++ .../common/loaders/recipes/ChemicalBath.java | 85 ++ .../common/loaders/recipes/ChemicalReactor.java | 24 + .../common/loaders/recipes/CraftingRecipes.java | 519 +++++++++ .../common/loaders/recipes/Electrolyzer.java | 170 +++ .../common/loaders/recipes/Extractor.java | 37 + .../common/loaders/recipes/FakeRecipes.java | 11 + .../common/loaders/recipes/FluidHeater.java | 22 + .../common/loaders/recipes/FluidSolidifier.java | 80 ++ .../common/loaders/recipes/FormingPress.java | 60 ++ .../common/loaders/recipes/LaserEngraver.java | 24 + .../bartworks/common/loaders/recipes/Mixer.java | 64 ++ .../common/loaders/recipes/Pulverizer.java | 82 ++ .../common/loaders/recipes/PyrolyseOven.java | 24 + .../bartworks/common/net/RendererPacket.java | 15 - .../BW_TileEntity_ExperimentalFloodGate.java | 6 +- .../classic/BW_TileEntity_HeatedWaterPump.java | 8 +- .../classic/BW_TileEntity_InfinityTank.java | 7 +- .../classic/BW_TileEntity_LESU_Redux.java | 488 --------- .../tileentities/multis/GT_TileEntity_BioVat.java | 18 +- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 11 +- .../GT_TileEntity_ElectricImplosionCompressor.java | 10 +- .../tileentities/multis/GT_TileEntity_HTGR.java | 103 +- .../multis/GT_TileEntity_ManualTrafo.java | 9 +- .../tileentities/multis/GT_TileEntity_THTR.java | 106 +- .../multis/GT_TileEntity_Windmill.java | 7 +- .../mega/GT_TileEntity_MegaBlastFurnace.java | 41 +- .../mega/GT_TileEntity_MegaChemicalReactor.java | 29 +- .../mega/GT_TileEntity_MegaDistillTower.java | 24 +- .../mega/GT_TileEntity_MegaMultiBlockBase.java | 37 +- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 29 +- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 27 +- .../tiered/GT_MetaTileEntity_BioLab.java | 13 +- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 1 - .../bartworks/neiHandler/IMCForNEI.java | 6 +- .../system/material/BW_GT_MaterialReference.java | 818 +------------- .../system/material/BW_MetaGenerated_Items.java | 3 - .../material/CircuitGeneration/BW_Meta_Items.java | 24 +- .../CircuitGeneration/CircuitPartLoader.java | 79 +- .../material/GT_Enhancement/BWGTMetaItems.java | 8 +- .../GT_Enhancement/GTMetaItemEnhancer.java | 18 +- .../material/GT_Enhancement/LuVTierEnhancer.java | 25 +- .../GT_Enhancement/PlatinumSludgeOverHaul.java | 81 +- .../bartworks/system/material/Werkstoff.java | 29 +- .../bartworks/system/material/WerkstoffLoader.java | 99 +- .../processingLoaders/AdditionalRecipes.java | 32 +- .../werkstoff_loaders/recipe/AspectLoader.java | 8 +- .../werkstoff_loaders/recipe/BlockLoader.java | 5 +- .../werkstoff_loaders/recipe/CasingLoader.java | 9 +- .../werkstoff_loaders/recipe/CellLoader.java | 29 +- .../recipe/CraftingMaterialLoader.java | 24 +- .../werkstoff_loaders/recipe/CrushedLoader.java | 12 +- .../werkstoff_loaders/recipe/DustLoader.java | 12 +- .../werkstoff_loaders/recipe/GemLoader.java | 14 +- .../werkstoff_loaders/recipe/MoltenCellLoader.java | 30 +- .../recipe/MultipleMetalLoader.java | 5 +- .../werkstoff_loaders/recipe/OreLoader.java | 6 +- .../recipe/SimpleMetalLoader.java | 10 +- .../werkstoff_loaders/recipe/ToolLoader.java | 21 +- .../registration/BridgeMaterialsLoader.java | 37 +- .../bartworks/system/object/AbstractedStack.java | 7 +- .../bartworks/system/oregen/BW_OreLayer.java | 6 +- .../system/oregen/BW_WorldGenRoss128b.java | 35 +- .../system/oregen/BW_WorldGenRoss128ba.java | 31 +- .../bartimaeusnek/bartworks/util/BWRecipes.java | 8 +- .../bartworks/util/BW_Tooltip_Reference.java | 5 +- .../bartimaeusnek/bartworks/util/BW_Util.java | 23 +- .../bartimaeusnek/bartworks/util/BioCulture.java | 7 - .../bartworks/util/NoiseUtil/BartsNoise.java | 50 - .../accessprioritylist/AccessPriorityList.java | 8 +- .../bartimaeusnek/bartworks/util/package-info.java | 4 +- .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 53 +- .../crossmod/GTpp/loader/RadioHatchCompat.java | 14 +- .../crossmod/ae2/ItemSingleItemStorageCell.java | 126 --- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 6 +- .../galacticraft/UniversalTeleportType.java | 6 +- .../atmosphere/BWAtmosphereManager.java | 6 +- .../planets/ross128b/ChunkProviderRoss128b.java | 4 +- .../solarsystems/Ross128SolarSystem.java | 12 +- .../tileEntity/DysonSwarmSunReplacement.java | 15 +- .../openComputers/TileEntity_GTDataServer.java | 9 +- .../crossmod/tectech/TecTechResearchLoader.java | 36 +- .../crossmod/tgregworks/MaterialsInjector.java | 5 +- .../crossmod/thaumcraft/CustomAspects.java | 46 - 116 files changed, 3251 insertions(+), 3863 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalReactor.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FakeRecipes.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/PyrolyseOven.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java diff --git a/build.gradle b/build.gradle index 7b1f6c4507..055dcee435 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1679040806 +//version: 1680120787 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -65,7 +65,7 @@ plugins { id 'org.jetbrains.kotlin.jvm' version '1.8.0' apply false id 'org.jetbrains.kotlin.kapt' version '1.8.0' apply false id 'com.google.devtools.ksp' version '1.8.0-1.0.9' apply false - id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version ,unused, available for addon.gradle + id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version, unused, available for addon.gradle id 'com.github.johnrengelman.shadow' version '7.1.2' apply false id 'com.palantir.git-version' version '0.13.0' apply false // 0.13.0 is the last jvm8 supporting version id 'de.undercouch.download' version '5.3.0' @@ -73,7 +73,7 @@ plugins { id 'com.diffplug.spotless' version '6.7.2' apply false id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.2.3' + id 'com.gtnewhorizons.retrofuturagradle' version '1.2.4' } boolean settingsupdated = verifySettingsGradle() settingsupdated = verifyGitAttributes() || settingsupdated @@ -160,6 +160,14 @@ java { } } +tasks.withType(JavaCompile).configureEach { + options.encoding = "UTF-8" +} + +tasks.withType(ScalaCompile).configureEach { + options.encoding = "UTF-8" +} + pluginManager.withPlugin('org.jetbrains.kotlin.jvm') { // If Kotlin is enabled in the project kotlin { @@ -397,8 +405,6 @@ minecraft { extraRunJvmArguments.add("-ea:${modGroup}") if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { - extraTweakClasses.add("org.spongepowered.asm.launch.MixinTweaker") - if (usesMixinDebug.toBoolean()) { extraRunJvmArguments.addAll([ "-Dmixin.debug.countInjections=true", @@ -513,14 +519,6 @@ repositories { url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" allowInsecureProtocol = true } - if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { - if (usesMixinDebug.toBoolean()) { - maven { - name = "Fabric Maven" - url = "https://maven.fabricmc.net/" - } - } - } maven { name 'sonatype' url 'https://oss.sonatype.org/content/repositories/snapshots/' @@ -559,29 +557,49 @@ repositories { } } +def mixinProviderGroup = "io.github.legacymoddingmc" +def mixinProviderModule = "unimixins" +def mixinProviderVersion = "0.1.6" +def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}" +def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev" + 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('com.gtnewhorizon:gtnhmixins:2.1.13:processor') + annotationProcessor(mixinProviderSpec) if (usesMixinDebug.toBoolean()) { runtimeOnlyNonPublishable('org.jetbrains:intellij-fernflower:1.2.1.16') } } - if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { - implementation('com.gtnewhorizon:gtnhmixins:2.1.13') + if (usesMixins.toBoolean()) { + implementation(mixinProviderSpec) + } else if (forceEnableMixins.toBoolean()) { + runtimeOnlyNonPublishable(mixinProviderSpec) } } pluginManager.withPlugin('org.jetbrains.kotlin.kapt') { if (usesMixins.toBoolean()) { dependencies { - kapt('com.gtnewhorizon:gtnhmixins:2.1.13:processor') + kapt(mixinProviderSpec) } } } +// Replace old mixin mods with unimixins +// https://docs.gradle.org/8.0.2/userguide/resolution_rules.html#sec:substitution_with_classifier +configurations.all { + resolutionStrategy.dependencySubstitution { + substitute module('com.gtnewhorizon:gtnhmixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") + substitute module('com.github.GTNewHorizons:Mixingasm') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") + substitute module('com.github.GTNewHorizons:SpongePoweredMixin') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") + substitute module('com.github.GTNewHorizons:SpongeMixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") + substitute module('io.github.legacymoddingmc:unimixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Our previous unimixins upload was missing the dev classifier") + } +} + apply from: 'dependencies.gradle' def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json' @@ -695,13 +713,13 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies" } dependencies { - def lwjgl3ifyVersion = '1.2.2' + def lwjgl3ifyVersion = '1.3.3' def asmVersion = '9.4' if (modId != 'lwjgl3ify') { java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") } if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.1.0') + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.4') } java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false} @@ -793,10 +811,6 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask { !file.path.contains("2.9.4-nightly-20150209") // Remove lwjgl2 } this.classpath(project.java17DependenciesCfg) - - if (!(project.usesMixins.toBoolean() || project.forceEnableMixins.toBoolean())) { - this.extraArgs.addAll("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker") - } } } @@ -1006,6 +1020,7 @@ idea { } compiler.javac { afterEvaluate { + javacAdditionalOptions = "-encoding utf8" moduleJavacAdditionalOptions = [ (project.name + ".main"): tasks.compileJava.options.compilerArgs.collect { '"' + it + '"' }.join(' ') ] @@ -1125,7 +1140,7 @@ if (modrinthProjectId.size() != 0 && System.getenv("MODRINTH_TOKEN") != null) { } } if (usesMixins.toBoolean()) { - addModrinthDep("required", "project", "gtnhmixins") + addModrinthDep("required", "project", "unimixins") } tasks.modrinth.dependsOn(build) tasks.publish.dependsOn(tasks.modrinth) @@ -1169,7 +1184,7 @@ if (curseForgeProjectId.size() != 0 && System.getenv("CURSEFORGE_TOKEN") != null } } if (usesMixins.toBoolean()) { - addCurseForgeRelation("requiredDependency", "gtnhmixins") + addCurseForgeRelation("requiredDependency", "unimixins") } tasks.curseforge.dependsOn(build) tasks.publish.dependsOn(tasks.curseforge) diff --git a/dependencies.gradle b/dependencies.gradle index 6a8c26e2e6..487bb6661a 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api("com.github.GTNewHorizons:GT5-Unofficial:5.09.42.43:dev") + api("com.github.GTNewHorizons:GT5-Unofficial:5.09.42.47:dev") api("com.github.GTNewHorizons:TecTech:5.0.85:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.23-GTNH:dev") api("com.github.GTNewHorizons:Galacticraft:3.0.64-GTNH:dev") diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cbfa7..ccebba7710 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fc10b601f7..bdc9a83b1e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 65dcd68d65..79a61d421c 100755 --- a/gradlew +++ b/gradlew @@ -144,7 +144,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +152,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java index a4a2c1b799..fb1e8c085f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -13,6 +13,8 @@ package com.github.bartimaeusnek.bartworks.API; +import static gregtech.api.enums.Mods.Gendustry; + import java.awt.*; import net.minecraft.item.EnumRarity; @@ -164,7 +166,7 @@ public final class BioObjectAdder { * postinit Phase) execute this. */ public static void regenerateBioFluids() { - FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 100) + FluidStack dnaFluid = Gendustry.isModLoaded() ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L); for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.getFluidNotSet()) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java index 9202be7d18..fdfb020919 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -14,6 +14,7 @@ package com.github.bartimaeusnek.bartworks.API; import static cpw.mods.fml.common.registry.GameRegistry.findBlock; +import static gregtech.api.enums.Mods.IndustrialCraft2; import java.util.HashMap; import java.util.HashSet; @@ -79,33 +80,33 @@ public final class BioVatLogicAdder { giveItemStackRadioHatchAbilites(ItemList.Depleted_Naquadah_4.get(1), Materials.Naquadah, 12, 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem("IC2", "reactorMOXSimpledepleted", 1), + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXSimpledepleted", 1), Materials.Plutonium, 3, 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem("IC2", "reactorMOXDualdepleted", 1), + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXDualdepleted", 1), Materials.Plutonium, 6, 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem("IC2", "reactorMOXQuaddepleted", 1), + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXQuaddepleted", 1), Materials.Plutonium, 12, 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem("IC2", "reactorUraniumSimpledepleted", 1), + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumSimpledepleted", 1), Materials.Uranium, 3, 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem("IC2", "reactorUraniumDualdepleted", 1), + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumDualdepleted", 1), Materials.Uranium, 6, 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem("IC2", "reactorUraniumQuaddepleted", 1), + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumQuaddepleted", 1), Materials.Uranium, 12, 10); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java index 0242fd3650..3076455c70 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java @@ -1,6 +1,10 @@ package com.github.bartimaeusnek.bartworks.API; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAdder; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAnyMeta; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlocksTiered; +import static gregtech.api.enums.Mods.BartWorks; import java.util.ArrayList; import java.util.List; @@ -44,12 +48,16 @@ public class BorosilicateGlass { } private static Block getGlassBlock() { - if (block == null) block = GameRegistry.findBlock("bartworks", "BW_GlasBlocks"); + if (block == null) { + block = GameRegistry.findBlock(BartWorks.ID, "BW_GlasBlocks"); + } return block; } private static Block getGlassBlock2() { - if (block2 == null) block2 = GameRegistry.findBlock("bartworks", "BW_GlasBlocks2"); + if (block2 == null) { + block2 = GameRegistry.findBlock(BartWorks.ID, "BW_GlasBlocks2"); + } return block2; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java deleted file mode 100644 index acc2da9ede..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.API; - -import cpw.mods.fml.common.Loader; - -/** - * DO NOT CALL THIS IN THE CORE MOD! IT WILL __NOT__ WORK AND FUCK EVERYTHING UP! - */ -public class LoaderReference { - - private LoaderReference() {} - - public static boolean Natura; - public static boolean RandomThings; - public static boolean TConstruct; - public static boolean chisel; - public static boolean Railcraft; - public static boolean Ztones; - public static boolean witchery; - public static boolean GalaxySpace; - public static boolean GalacticraftCore; - public static boolean GalacticraftMars; - public static boolean Thaumcraft; - public static boolean miscutils; - public static boolean tectech; - public static boolean ExtraUtilities; - public static boolean RWG; - public static boolean galacticgreg; - public static boolean gendustry; - public static boolean croploadcore; - public static boolean Forestry; - public static boolean berriespp; - public static boolean dreamcraft; - public static boolean BloodArsenal; - public static boolean Botany; - public static boolean EnderIO; - public static boolean HardcoreEnderExpension; - public static boolean betterloadingscreen; - public static boolean TGregworks; - public static boolean ProjRedIllumination; - public static boolean Botania; - - public static void init() { - Natura = Loader.isModLoaded("Natura"); - RandomThings = Loader.isModLoaded("RandomThings"); - TConstruct = Loader.isModLoaded("TConstruct"); - chisel = Loader.isModLoaded("chisel"); - Railcraft = Loader.isModLoaded("Railcraft"); - Ztones = Loader.isModLoaded("Ztones"); - witchery = Loader.isModLoaded("witchery"); - GalaxySpace = Loader.isModLoaded("GalaxySpace"); - GalacticraftCore = Loader.isModLoaded("GalacticraftCore"); - GalacticraftMars = Loader.isModLoaded("GalacticraftMars"); - Thaumcraft = Loader.isModLoaded("Thaumcraft"); - miscutils = Loader.isModLoaded("miscutils"); - tectech = Loader.isModLoaded("tectech"); - ExtraUtilities = Loader.isModLoaded("ExtraUtilities"); - RWG = Loader.isModLoaded("RWG"); - galacticgreg = Loader.isModLoaded("galacticgreg"); - gendustry = Loader.isModLoaded("gendustry"); - croploadcore = Loader.isModLoaded("croploadcore"); - Forestry = Loader.isModLoaded("Forestry"); - berriespp = Loader.isModLoaded("berriespp"); - dreamcraft = Loader.isModLoaded("dreamcraft"); - BloodArsenal = Loader.isModLoaded("BloodArsenal"); - Botany = Loader.isModLoaded("Botany"); - EnderIO = Loader.isModLoaded("EnderIO"); - HardcoreEnderExpension = Loader.isModLoaded("HardcoreEnderExpension"); - betterloadingscreen = Loader.isModLoaded("betterloadingscreen"); - TGregworks = Loader.isModLoaded("TGregworks"); - ProjRedIllumination = Loader.isModLoaded("ProjRed|Illumination"); - Botania = Loader.isModLoaded("Botania"); - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java index bf495440e5..4bef7a0cad 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java @@ -10,7 +10,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ -@API(owner = "bartworks", apiVersion = API_REFERENCE.VERSION, provides = "bartworks API") +@API(owner = Mods.Names.BART_WORKS, apiVersion = API_REFERENCE.VERSION, provides = "bartworks API") package com.github.bartimaeusnek.bartworks.API; import cpw.mods.fml.common.API; +import gregtech.api.enums.Mods; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java index a747c95f7f..60202e102e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java @@ -14,6 +14,10 @@ package com.github.bartimaeusnek.bartworks.ASM; import static com.github.bartimaeusnek.bartworks.ASM.BWCoreTransformer.shouldTransform; +import static gregtech.api.enums.Mods.ExtraUtilities; +import static gregtech.api.enums.Mods.GTPlusPlus; +import static gregtech.api.enums.Mods.RWG; +import static gregtech.api.enums.Mods.Thaumcraft; import java.util.ArrayList; import java.util.List; @@ -68,10 +72,10 @@ public class BWCore extends DummyModContainer { @Override public List getDependants() { List ret = new ArrayList<>(); - ret.add(new DefaultArtifactVersion("ExtraUtilities", true)); - ret.add(new DefaultArtifactVersion("Thaumcraft", true)); - ret.add(new DefaultArtifactVersion("miscutils", true)); - ret.add(new DefaultArtifactVersion("RWG", true)); + ret.add(new DefaultArtifactVersion(ExtraUtilities.ID, true)); + ret.add(new DefaultArtifactVersion(Thaumcraft.ID, true)); + ret.add(new DefaultArtifactVersion(GTPlusPlus.ID, true)); + ret.add(new DefaultArtifactVersion(RWG.ID, true)); ret.add(new DefaultArtifactVersion(MainMod.MOD_ID, true)); ret.add(new DefaultArtifactVersion(BartWorksCrossmod.MOD_ID, true)); return ret; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java index 58d65ddec5..1605192572 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java @@ -13,7 +13,26 @@ package com.github.bartimaeusnek.bartworks.ASM; -import static org.objectweb.asm.Opcodes.*; +import static org.objectweb.asm.Opcodes.ACC_PUBLIC; +import static org.objectweb.asm.Opcodes.ACONST_NULL; +import static org.objectweb.asm.Opcodes.ALOAD; +import static org.objectweb.asm.Opcodes.ARETURN; +import static org.objectweb.asm.Opcodes.GETFIELD; +import static org.objectweb.asm.Opcodes.GETSTATIC; +import static org.objectweb.asm.Opcodes.GOTO; +import static org.objectweb.asm.Opcodes.ICONST_0; +import static org.objectweb.asm.Opcodes.IFEQ; +import static org.objectweb.asm.Opcodes.IFNE; +import static org.objectweb.asm.Opcodes.IF_ICMPGE; +import static org.objectweb.asm.Opcodes.ILOAD; +import static org.objectweb.asm.Opcodes.INSTANCEOF; +import static org.objectweb.asm.Opcodes.INVOKESTATIC; +import static org.objectweb.asm.Opcodes.INVOKEVIRTUAL; +import static org.objectweb.asm.Opcodes.IREM; +import static org.objectweb.asm.Opcodes.IRETURN; +import static org.objectweb.asm.Opcodes.ISTORE; +import static org.objectweb.asm.Opcodes.POP; +import static org.objectweb.asm.Opcodes.SIPUSH; import java.util.Arrays; import java.util.List; @@ -22,7 +41,19 @@ import net.minecraft.launchwrapper.IClassTransformer; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.tree.*; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldInsnNode; +import org.objectweb.asm.tree.InsnList; +import org.objectweb.asm.tree.InsnNode; +import org.objectweb.asm.tree.IntInsnNode; +import org.objectweb.asm.tree.JumpInsnNode; +import org.objectweb.asm.tree.LabelNode; +import org.objectweb.asm.tree.LdcInsnNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; +import org.objectweb.asm.tree.TypeInsnNode; +import org.objectweb.asm.tree.VarInsnNode; public class BWCoreTransformer implements IClassTransformer { @@ -351,12 +382,6 @@ public class BWCoreTransformer implements IClassTransformer { } } - // case 6: { - // BWCore.BWCORE_LOG.info("Could find: " + - // BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - // ((IntInsnNode) methods.get(11).instructions.get(10)).operand = 10000; - // break scase; - // } default: { BWCore.BWCORE_LOG.info("Could not find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); return basicClass; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 2a873977a9..f157c6c0e7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -16,6 +16,8 @@ package com.github.bartimaeusnek.bartworks; import static com.github.bartimaeusnek.bartworks.common.loaders.BioRecipeLoader.runOnServerStarted; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.removeIC2Recipes; import static gregtech.api.enums.GT_Values.VN; +import static gregtech.api.enums.Mods.BartWorks; +import static gregtech.api.enums.Mods.GTPlusPlus; import java.io.IOException; import java.util.Map; @@ -27,14 +29,28 @@ import net.minecraftforge.common.MinecraftForge; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import com.github.bartimaeusnek.bartworks.API.*; +import com.github.bartimaeusnek.bartworks.API.API_ConfigValues; +import com.github.bartimaeusnek.bartworks.API.API_REFERENCE; +import com.github.bartimaeusnek.bartworks.API.BioObjectAdder; +import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.ClientEventHandler.TooltipEventHandler; import com.github.bartimaeusnek.bartworks.client.creativetabs.BioTab; import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.loaders.*; +import com.github.bartimaeusnek.bartworks.common.loaders.ArtificialMicaLine; +import com.github.bartimaeusnek.bartworks.common.loaders.BeforeGTPreload; +import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.common.loaders.LocalisationLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.RadioHatchMaterialLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.RecipeLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.RegisterServerCommands; +import com.github.bartimaeusnek.bartworks.common.loaders.StaticRecipeChangeLoaders; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; import com.github.bartimaeusnek.bartworks.neiHandler.IMCForNEI; import com.github.bartimaeusnek.bartworks.server.EventHandler.ServerEventHandler; @@ -49,10 +65,16 @@ import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.event.*; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLLoadCompleteEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartedEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; import gregtech.api.GregTech_API; +import gregtech.api.enums.Mods; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -74,12 +96,12 @@ public final class MainMod { public static final String NAME = "BartWorks"; public static final String VERSION = "GRADLETOKEN_VERSION"; - public static final String MOD_ID = "bartworks"; + public static final String MOD_ID = Mods.Names.BART_WORKS; public static final String APIVERSION = "11"; public static final Logger LOGGER = LogManager.getLogger(MainMod.NAME); public static final CreativeTabs GT2 = new GT2Tab("GT2C"); public static final CreativeTabs BIO_TAB = new BioTab("BioTab"); - public static final CreativeTabs BWT = new bartworksTab("bartworks"); + public static final CreativeTabs BWT = new bartworksTab(BartWorks.ID); public static final IGuiHandler GH = new GuiHandler(); @Mod.Instance(MainMod.MOD_ID) @@ -98,16 +120,10 @@ public final class MainMod { MainMod.LOGGER.error("Something has loaded an old API. Please contact the Mod authors to update!"); } - LoaderReference.init(); // Check for ALL the mods. - - if (LoaderReference.miscutils) { + if (GTPlusPlus.isModLoaded()) { MainMod.LOGGER.info("Found GT++, continuing"); } - if (LoaderReference.dreamcraft) ConfigHandler.hardmode = true; - - ConfigHandler.hardmode = ConfigHandler.ezmode != ConfigHandler.hardmode; - if (API_ConfigValues.debugLog) { try { DebugLog.initDebugLog(preinit); @@ -116,21 +132,18 @@ public final class MainMod { } } - if (ConfigHandler.newStuff) { - WerkstoffLoader.setUp(); - } - - if (ConfigHandler.hardmode) MainMod.LOGGER.info(". . . ACTIVATED HARDMODE."); + WerkstoffLoader.setUp(); if (ConfigHandler.BioLab) { BioCultureLoader.run(); } - if (ConfigHandler.newStuff) { - Werkstoff.init(); - GregTech_API.sAfterGTPostload.add(new CircuitPartLoader()); - if (SideReference.Side.Client) GregTech_API.sBeforeGTLoad.add(new PrefixTextureLinker()); + Werkstoff.init(); + GregTech_API.sAfterGTPostload.add(new CircuitPartLoader()); + if (SideReference.Side.Client) { + GregTech_API.sBeforeGTLoad.add(new PrefixTextureLinker()); } + } @Mod.EventHandler @@ -142,10 +155,12 @@ public final class MainMod { MinecraftForge.EVENT_BUS.register(serverEventHandler); } FMLCommonHandler.instance().bus().register(serverEventHandler); - if (ConfigHandler.BioLab) BioLabLoader.run(); - if (ConfigHandler.newStuff) { - WerkstoffLoader.runInit(); + if (ConfigHandler.BioLab) { + BioLabLoader.run(); } + + WerkstoffLoader.runInit(); + ItemRegistry.run(); RecipeLoader.run(); IMCForNEI.IMCSender(); @@ -165,10 +180,10 @@ public final class MainMod { } ArtificialMicaLine.runArtificialMicaRecipe(); BioObjectAdder.regenerateBioFluids(); - if (ConfigHandler.newStuff) { - WerkstoffLoader.run(); - LocalisationLoader.localiseAll(); - } + + WerkstoffLoader.run(); + LocalisationLoader.localiseAll(); + RadioHatchMaterialLoader.run(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java index b375a1c1b0..4a6561f9ef 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java @@ -112,15 +112,6 @@ public class BW_GT_ItemRenderer implements IItemRenderer { tIcon.getIconWidth(), tIcon.getIconHeight(), 0.0625F); - // else { - // for (int i = 0; i < 4; i++) { - // ItemRenderer.renderItemIn2D(Tessellator.instance, - // 0.0F+i*2F,0.0F+i*2F,10.0F+i*2F,10.0F+i*2F, tIcon.getIconWidth(), tIcon.getIconHeight(),0.0625F); - // } - // } - // ItemRenderer.renderItemIn2D(Tessellator.instance, tIcon.getMaxU(), - // tIcon.getMinV(), tIcon.getMinU(), tIcon.getMaxV(), tIcon.getIconWidth(), tIcon.getIconHeight(), - // 0.0625F); } IIcon tOverlay = (IIcon) BW_Util.get2DCoordFrom1DArray(aMetaData, 1, 2, aItem.mIconList); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index c298b6a321..9e25535970 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -13,7 +13,12 @@ package com.github.bartimaeusnek.bartworks.client.renderer; -import static gregtech.common.render.GT_Renderer_Block.*; +import static gregtech.common.render.GT_Renderer_Block.renderNegativeXFacing; +import static gregtech.common.render.GT_Renderer_Block.renderNegativeYFacing; +import static gregtech.common.render.GT_Renderer_Block.renderNegativeZFacing; +import static gregtech.common.render.GT_Renderer_Block.renderPositiveXFacing; +import static gregtech.common.render.GT_Renderer_Block.renderPositiveYFacing; +import static gregtech.common.render.GT_Renderer_Block.renderPositiveZFacing; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java index 244d7e5c7c..de1d90a3f4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java @@ -72,8 +72,6 @@ public class RendererGlasBlock implements ISimpleBlockRenderingHandler { @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - // renderer.setRenderBounds(0.001,0.001,0.001,0.999,0.999,0.999); - // renderer.setRenderBounds(0,0,0,1,1,1); if (block instanceof BW_GlasBlocks) { renderer.renderStandardBlock(ItemRegistry.bw_fake_glasses, x, y, z); renderer.renderStandardBlockWithColorMultiplier( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 8d5e071bd3..46e63a89ec 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -53,8 +53,6 @@ public class ConfigHandler { public static boolean DEHPDirectSteam; public static boolean teslastaff; public static boolean classicMode; - public static boolean hardmode; - public static boolean ezmode; public static boolean GTppLogDisabler; public static boolean tooltips = true; @@ -131,23 +129,11 @@ public class ConfigHandler { "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS") .getInt(12600); - ConfigHandler.ezmode = ConfigHandler.c - .get( - "System", - "Mode switch", - false, - "If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.") - .getBoolean(false); ConfigHandler.teslastaff = ConfigHandler.c.get( "System", "Enable Teslastaff", false, "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); - ConfigHandler.newStuff = !ConfigHandler.c.get( - "System", - "Disable non-original-GT-stuff", - false, - "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false); ConfigHandler.BioLab = !ConfigHandler.c.get( "System", "Disable BioLab", diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java index 3ae2981575..e8632c574c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -13,7 +13,9 @@ package com.github.bartimaeusnek.bartworks.common.items; -import static com.github.bartimaeusnek.bartworks.common.loaders.BioItemList.*; +import static com.github.bartimaeusnek.bartworks.common.loaders.BioItemList.getAllDNASampleFlasks; +import static com.github.bartimaeusnek.bartworks.common.loaders.BioItemList.getAllPetriDishes; +import static com.github.bartimaeusnek.bartworks.common.loaders.BioItemList.getAllPlasmidCells; import java.util.List; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java index 60f7b1f30e..afc306280f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java @@ -1,9 +1,10 @@ package com.github.bartimaeusnek.bartworks.common.loaders; +import static gregtech.api.enums.Mods.NewHorizonsCoreMod; + import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.BW_GT_MaterialReference; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -184,11 +185,13 @@ public class ArtificialMicaLine { 120, 0)); // Fluorophlogopite = 4Insulator Foil - if (LoaderReference.dreamcraft) GT_Values.RA.addBenderRecipe( - WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1), - GT_Utility.getIntegratedCircuit(1), - GT_ModHandler.getModItem("dreamcraft", "item.MicaInsulatorFoil", 4), - 10, - 600); + if (NewHorizonsCoreMod.isModLoaded()) { + GT_Values.RA.addBenderRecipe( + WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1), + GT_Utility.getIntegratedCircuit(1), + GT_ModHandler.getModItem(NewHorizonsCoreMod.ID, "item.MicaInsulatorFoil", 4), + 10, + 600); + } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java index 7f10a18de0..cb08db3ba8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java @@ -13,6 +13,8 @@ package com.github.bartimaeusnek.bartworks.common.loaders; +import static gregtech.api.enums.Mods.BartWorks; + import java.lang.reflect.Field; import net.minecraft.block.Block; @@ -52,7 +54,7 @@ public class BeforeGTPreload implements Runnable { ModContainer gregtech = Loader.instance().activeModContainer(); boolean switchback = false; LoadController modController = null; - if (!Loader.instance().activeModContainer().getModId().equals("bartworks")) { + if (!Loader.instance().activeModContainer().getModId().equals(BartWorks.ID)) { Field fieldModController = FieldUtils.getDeclaredField(Loader.class, "modController", true); try { modController = (LoadController) fieldModController.get(Loader.instance()); @@ -63,7 +65,7 @@ public class BeforeGTPreload implements Runnable { assert modController != null; for (ModContainer mod : modController.getActiveModList()) { - if (mod.getModId().equals("bartworks")) { + if (mod.getModId().equals(BartWorks.ID)) { bartworks = mod; } if (bartworks != null) break; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index d51b0f3c04..54e0d4633e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -13,247 +13,32 @@ package com.github.bartimaeusnek.bartworks.common.loaders; -import java.util.List; +import static gregtech.api.enums.Mods.CropsPlusPlus; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; -import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_BioLab; -import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; public class BioRecipeLoader { - @SuppressWarnings("deprecation") public static void run() { + registerWaterBasedBioLabIncubations(); + registerBacterialVatRecipes(); + } - // DNAExtractionModule - GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[0], - RecipeLoader.BITSD, - new Object[] { "TET", "CFC", "TST", 'T', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), 'E', - ItemList.Emitter_EV.get(1L), 'C', - GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), 'S', - ItemList.Sensor_EV.get(1L), 'F', ItemList.Field_Generator_EV.get(1L) }); - - // PCRThermoclyclingModule - GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[1], - RecipeLoader.BITSD, - new Object[] { "NEN", "CFC", "NSN", 'N', - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), 'E', - ItemList.Emitter_EV.get(1L), 'C', - GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), 'S', - ItemList.Sensor_EV.get(1L), 'F', ItemList.Field_Generator_EV.get(1L) }); - - // PlasmidSynthesisModule - GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[2], - RecipeLoader.BITSD, - new Object[] { "SFE", "CPC", "NFN", 'N', - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), 'C', - "circuit" + Materials.Data, 'F', ItemList.Field_Generator_EV.get(1L), 'E', - ItemList.Emitter_EV.get(1L), 'S', ItemList.Sensor_EV.get(1L), 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), }); - // TransformationModule - GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[3], - RecipeLoader.BITSD, - new Object[] { "SFE", "CPC", "NFN", 'N', - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), 'C', - "circuit" + Materials.Master, 'F', ItemList.Field_Generator_LuV.get(1L), 'E', - ItemList.Emitter_LuV.get(1L), 'S', ItemList.Sensor_LuV.get(1L), 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), }); - - // ClonalCellularSynthesisModule - GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[4], - RecipeLoader.BITSD, - new Object[] { "FEF", "CPC", "FSF", 'N', - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), 'C', - "circuit" + Materials.Master, 'F', ItemList.Field_Generator_LuV.get(1L), 'E', - ItemList.Emitter_LuV.get(1L), 'S', ItemList.Sensor_LuV.get(1L), 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), }); - - List oreCropVine = OreDictionary.getOres("cropVine", false); - if (LoaderReference.croploadcore && !oreCropVine.isEmpty()) for (ItemStack stack : oreCropVine) { - GT_Values.RA.addExtractorRecipe( - BW_Util.setStackSize(stack, 12), - BioItemList.getOther(1), - 500, - BW_Util.getMachineVoltageFromTier(3)); - } - else GT_Values.RA.addExtractorRecipe( - new ItemStack(Blocks.vine, 12), - BioItemList.getOther(1), - 500, - BW_Util.getMachineVoltageFromTier(3)); - - GT_Values.RA.addExtractorRecipe( - ItemList.Circuit_Chip_Stemcell.get(1L), - BioItemList.getOther(4), - 500, - BW_Util.getMachineVoltageFromTier(6)); - - FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) - : Materials.Biomass.getFluid(1000L); - GT_Values.RA.addMixerRecipe( - GT_Utility.getIntegratedCircuit(17), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Radon, 1L), - null, - null, - dnaFluid, - new FluidStack(FluidLoader.BioLabFluidMaterials[0], 2000), - Materials.Empty.getCells(1), - 500, - BW_Util.getMachineVoltageFromTier(3)); - - GT_Values.RA.addCentrifugeRecipe( - GT_Utility.getIntegratedCircuit(17), - null, - new FluidStack(BioCultureLoader.eColi.getFluid(), 1000), - new FluidStack(FluidLoader.BioLabFluidMaterials[1], 10), - BioItemList.getOther(4), - null, - null, - null, - null, - null, - new int[] { 1000 }, - 60 * 20, - BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addCentrifugeRecipe( - GT_Utility.getIntegratedCircuit(17), - null, - new FluidStack(FluidLoader.BioLabFluidMaterials[1], 1000), - new FluidStack(FluidLoader.BioLabFluidMaterials[3], 250), - null, - null, - null, - null, - null, - null, - null, - 60 * 20, - BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addCentrifugeRecipe( - GT_Utility.getIntegratedCircuit(17), - null, - new FluidStack(BioCultureLoader.CommonYeast.getFluid(), 1000), - new FluidStack(FluidLoader.BioLabFluidMaterials[2], 10), - null, - null, - null, - null, - null, - null, - null, - 60 * 20, - BW_Util.getMachineVoltageFromTier(3)); - - ItemStack[] Pistons = { ItemList.Electric_Piston_HV.get(1L), ItemList.Electric_Piston_EV.get(1L), - ItemList.Electric_Piston_IV.get(1L), ItemList.Electric_Piston_LuV.get(1L), - ItemList.Electric_Piston_ZPM.get(1L), ItemList.Electric_Piston_UV.get(1L) }; - ItemStack[] BioLab = new ItemStack[GT_Values.VN.length - 3]; - ItemStack[] RadioHatch = new ItemStack[GT_Values.VN.length - 3]; - Materials[] cables = { Materials.Gold, Materials.Aluminium, Materials.Tungsten, Materials.VanadiumGallium, - Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor }; - Materials[] hulls = { Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, Materials.Chrome, - Materials.Iridium, Materials.Osmium, Materials.Naquadah }; - Materials[] wireMat = { Materials.Kanthal, Materials.Nichrome, Materials.TungstenSteel, Materials.Naquadah, - Materials.NaquadahAlloy, Materials.Superconductor }; - Materials[] circuits = { Materials.Advanced, Materials.Data, Materials.Elite, Materials.Master, - Materials.Ultimate, Materials.Superconductor }; - for (int i = 3; i < GT_Values.VN.length - 1; i++) { - // 12625 - BioLab[(i - 3)] = new GT_MetaTileEntity_BioLab( - ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i, - "bw.biolab" + GT_Values.VN[i], - GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.biolab.name"), - i).getStackForm(1L); - RadioHatch[(i - 3)] = new GT_MetaTileEntity_RadioHatch( - ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i, - "bw.radiohatch" + GT_Values.VN[i], - GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.radiohatch.name"), - i).getStackForm(1L); - try { - ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); - GT_ModHandler.addCraftingRecipe( - BioLab[(i - 3)], - RecipeLoader.BITSD, - new Object[] { "PFP", "WCW", "OGO", 'F', - GT_OreDictUnificator.get(OrePrefixes.frameGt, hulls[(i - 3)], 1L), 'W', - GT_OreDictUnificator.get(OrePrefixes.wireGt01, wireMat[(i - 3)], 1L), 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G', - "circuit" + circuits[(i - 3)], 'C', machinehull }); - GT_ModHandler.addCraftingRecipe( - RadioHatch[(i - 3)], - RecipeLoader.BITSD, - new Object[] { "DPD", "DCD", "DKD", 'D', - GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), 'C', machinehull, - 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cables[(i - 3)], 1L), 'P', - Pistons[(i - 3)] }); - } catch (ArrayIndexOutOfBoundsException e) { - // e.printStackTrace(); - } - } - GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_BioVat( - ConfigHandler.IDOffset + GT_Values.VN.length * 7, - "bw.biovat", - StatCollector.translateToLocal("tile.biovat.name")).getStackForm(1L), - RecipeLoader.BITSD, - new Object[] { "GCG", "KHK", "GCG", 'G', new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 'C', - "circuit" + Materials.Data, 'K', - GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Silver, 1L), 'H', - ItemList.MACHINE_HULLS[3].get(1L) }); - - Materials[] sterilizers = { Materials.Ammonia, Materials.Chlorine, Materials.Ethanol, Materials.Methanol }; - for (Materials used : sterilizers) { - GT_Values.RA.addAutoclaveRecipe( - ItemList.Circuit_Parts_PetriDish.get(1L), - used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L), - BioItemList.getPetriDish(null), - 10000, - 100, - BW_Util.getMachineVoltageFromTier(1)); - - GT_Values.RA.addAutoclaveRecipe( - new ItemStack(Items.glass_bottle), - used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L), - BioItemList.getDNASampleFlask(null), - 10000, - 100, - BW_Util.getMachineVoltageFromTier(1)); - } - - GT_Values.RA.addLaserEngraverRecipe( - new ItemStack(Items.emerald), - GT_Utility.getIntegratedCircuit(17), - BioItemList.getPlasmidCell(null), - 100, - BW_Util.getMachineVoltageFromTier(1)); - + public static void registerWaterBasedBioLabIncubations() { FluidStack[] easyFluids = { Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000) }; for (FluidStack fluidStack : easyFluids) { @@ -329,15 +114,22 @@ public class BioRecipeLoader { 1500, BW_Util.getMachineVoltageFromTier(4), BW_Util.STANDART); + } + } - BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[] { new ItemStack(Items.sugar, 64) }, - new FluidStack[] { new FluidStack(fluidStack, 100) }, - BioCultureLoader.CommonYeast, - new FluidStack[] { (LoaderReference.berriespp ? FluidRegistry.getFluidStack("potion.ghp", 1) - : Materials.Ethanol.getFluid(1L)) }, - 350, - BW_Util.getMachineVoltageFromTier(4)); + public static void registerWaterBasedBacterialVatRecipes() { + FluidStack[] easyFluids = { Materials.Water.getFluid(1000L), + FluidRegistry.getFluidStack("ic2distilledwater", 1000) }; + for (FluidStack fluidStack : easyFluids) { + if (CropsPlusPlus.isModLoaded()) { + BWRecipes.instance.addBacterialVatRecipe( + new ItemStack[] { new ItemStack(Items.sugar, 64) }, + new FluidStack[] { new FluidStack(fluidStack, 100) }, + BioCultureLoader.CommonYeast, + new FluidStack[] { FluidRegistry.getFluidStack("potion.ghp", 1) }, + 350, + BW_Util.getMachineVoltageFromTier(4)); + } BWRecipes.instance.addBacterialVatRecipe( new ItemStack[] { ItemList.Crop_Drop_Grapes.get(16) }, @@ -364,6 +156,10 @@ public class BioRecipeLoader { 600, BW_Util.getMachineVoltageFromTier(1)); } + } + + public static void registerBacterialVatRecipes() { + registerWaterBasedBacterialVatRecipes(); BWRecipes.instance.addBacterialVatRecipe( null, @@ -380,28 +176,6 @@ public class BioRecipeLoader { new FluidStack[] { new FluidStack(FluidLoader.fulvicAcid, 1000) }, 2748, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addFluidHeaterRecipe( - GT_Utility.getIntegratedCircuit(10), - new FluidStack(FluidLoader.fulvicAcid, 1000), - new FluidStack(FluidLoader.heatedfulvicAcid, 1000), - 90, - BW_Util.getMachineVoltageFromTier(2)); - GT_Values.RA.addChemicalRecipe( - GT_Utility.getIntegratedCircuit(10), - null, - new FluidStack(FluidLoader.heatedfulvicAcid, 1000), - new FluidStack(FluidLoader.Kerogen, 1000), - null, - 75, - BW_Util.getMachineVoltageFromTier(2)); - GT_Values.RA.addPyrolyseRecipe( - Materials.Wood.getDust(10), - new FluidStack(FluidLoader.Kerogen, 1000), - 10, - null, - Materials.Oil.getFluid(1000), - 105, - BW_Util.getMachineVoltageFromTier(3)); } public static void runOnServerStarted() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java index e4849333a3..cc072482f4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java @@ -2,13 +2,21 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.enums.Mods.EternalSingularity; +import static gregtech.api.enums.Mods.GoodGenerator; +import static gregtech.api.enums.Mods.OpenComputers; +import static gregtech.api.enums.Mods.SuperSolarPanels; +import static gregtech.api.enums.Mods.UniversalSingularities; import static gregtech.api.util.GT_ModHandler.getModItem; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import cpw.mods.fml.common.Loader; -import gregtech.api.enums.*; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_OreDictUnificator; public class ElectricImplosionCompressorRecipes implements Runnable { @@ -36,40 +44,41 @@ public class ElectricImplosionCompressorRecipes implements Runnable { public void run() { // Custom electric implosion compressor recipes. Cannot be overclocked. - if (Loader.isModLoaded("eternalsingularity")) { + if (EternalSingularity.isModLoaded()) { addElectricImplosionRecipe( // IN. new ItemStack[] { GT_Values.NI }, new FluidStack[] { Materials.SpaceTime.getMolten(72L) }, // OUT. - new ItemStack[] { getModItem("eternalsingularity", "eternal_singularity", 1L) }, + new ItemStack[] { getModItem(EternalSingularity.ID, "eternal_singularity", 1L) }, new FluidStack[] { GT_Values.NF }, // Recipe stats. 100 * 20, (int) TierEU.RECIPE_UMV); - // Raw Exposed Optical Chip - addElectricImplosionRecipe( - // IN. - new ItemStack[] { ItemList.Circuit_Silicon_Wafer7.get(1L), - // Fluxed Electrum Singularity. - getModItem("universalsingularities", "universal.general.singularity", 1L, 20) }, - new FluidStack[] { GT_Values.NF }, - // OUT. - new ItemStack[] { ItemList.Circuit_Chip_Optical.get(16L) }, - new FluidStack[] { GT_Values.NF }, - 5 * 20, - (int) TierEU.RECIPE_UMV); + if (UniversalSingularities.isModLoaded()) + // Raw Exposed Optical Chip + addElectricImplosionRecipe( + // IN. + new ItemStack[] { ItemList.Circuit_Silicon_Wafer7.get(1L), + // Fluxed Electrum Singularity. + getModItem(UniversalSingularities.ID, "universal.general.singularity", 1L, 20) }, + new FluidStack[] { GT_Values.NF }, + // OUT. + new ItemStack[] { ItemList.Circuit_Chip_Optical.get(16L) }, + new FluidStack[] { GT_Values.NF }, + 5 * 20, + (int) TierEU.RECIPE_UMV); } addElectricImplosionRecipe( // IN. - new ItemStack[] { getModItem("GoodGenerator", "highDensityPlutoniumNugget", 5L) }, + new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityPlutoniumNugget", 5L) }, new FluidStack[] { Materials.Infinity.getMolten(9L) }, // OUT. - new ItemStack[] { getModItem("GoodGenerator", "highDensityPlutonium", 1L) }, + new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityPlutonium", 1L) }, new FluidStack[] { GT_Values.NF }, // Recipe stats. 1, @@ -77,10 +86,10 @@ public class ElectricImplosionCompressorRecipes implements Runnable { addElectricImplosionRecipe( // IN. - new ItemStack[] { getModItem("GoodGenerator", "highDensityUraniumNugget", 5L) }, + new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityUraniumNugget", 5L) }, new FluidStack[] { Materials.Infinity.getMolten(9L) }, // OUT. - new ItemStack[] { getModItem("GoodGenerator", "highDensityUranium", 1L) }, + new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityUranium", 1L) }, new FluidStack[] { GT_Values.NF }, // Recipe stats. 1, @@ -88,10 +97,10 @@ public class ElectricImplosionCompressorRecipes implements Runnable { addElectricImplosionRecipe( // IN. - new ItemStack[] { getModItem("GoodGenerator", "highDensityThoriumNugget", 5L) }, + new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityThoriumNugget", 5L) }, new FluidStack[] { Materials.Infinity.getMolten(9L) }, // OUT. - new ItemStack[] { getModItem("GoodGenerator", "highDensityThorium", 1L) }, + new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityThorium", 1L) }, new FluidStack[] { GT_Values.NF }, // Recipe stats. 1, @@ -145,8 +154,8 @@ public class ElectricImplosionCompressorRecipes implements Runnable { for (ItemStack circuit : circuits) { addElectricImplosionRecipe( new ItemStack[] { circuit.splitStack(circuitMultiplier), - getModItem("supersolarpanel", "solarsplitter", 1, 0), - getModItem("OpenComputers", "hologram2", circuitMultiplier, 0), + getModItem(SuperSolarPanels.ID, "solarsplitter", 1, 0), + getModItem(OpenComputers.ID, "hologram2", circuitMultiplier, 0), GT_OreDictUnificator.get(part, Materials.Universium, multiplier), }, new FluidStack[] { Materials.MagnetohydrodynamicallyConstrainedStarMatter .getMolten((long) partFraction * multiplier) }, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 9bf41ba172..19d52696ff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -13,6 +13,8 @@ package com.github.bartimaeusnek.bartworks.common.loaders; +import static gregtech.api.enums.Mods.Gendustry; + import java.awt.*; import java.util.Arrays; @@ -23,7 +25,6 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock; import com.github.bartimaeusnek.bartworks.client.renderer.RendererSwitchingColorFluid; @@ -79,9 +80,7 @@ public class FluidLoader { FluidLoader.BioLabFluidCells[i] = fluidCells[i].get(); } - // BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", - // BW_Util.splitColorToRBGArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB()))); - FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 100) + FluidStack dnaFluid = Gendustry.isModLoaded() ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L); for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.isBreedable()) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java index 13aaa69461..081f8432e1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java @@ -13,8 +13,25 @@ package com.github.bartimaeusnek.bartworks.common.loaders; +import static gregtech.api.enums.Mods.BloodArsenal; +import static gregtech.api.enums.Mods.Botania; +import static gregtech.api.enums.Mods.Botany; +import static gregtech.api.enums.Mods.Chisel; +import static gregtech.api.enums.Mods.EnderIO; +import static gregtech.api.enums.Mods.ExtraUtilities; +import static gregtech.api.enums.Mods.GalaxySpace; +import static gregtech.api.enums.Mods.HardcoreEnderExpansion; +import static gregtech.api.enums.Mods.IndustrialCraft2; +import static gregtech.api.enums.Mods.Minecraft; +import static gregtech.api.enums.Mods.Natura; +import static gregtech.api.enums.Mods.Railcraft; +import static gregtech.api.enums.Mods.RandomThings; +import static gregtech.api.enums.Mods.TecTech; +import static gregtech.api.enums.Mods.TinkerConstruct; +import static gregtech.api.enums.Mods.Witchery; +import static gregtech.api.enums.Mods.ZTones; + import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; /** * Autogenerated run file, script Created on Wed Jan 2 19:11:07 2019 by boubou_19 and bartimaeusnek Executed on @@ -24,60 +41,109 @@ import com.github.bartimaeusnek.bartworks.API.LoaderReference; public class GTNHBlocks { public static void run() { - BioVatLogicAdder.BioVatGlass.addCustomGlass("minecraft", "glass", 0, 3); - BioVatLogicAdder.BioVatGlass.addCustomGlass("IC2", "blockAlloyGlass", 0, 4); - - if (LoaderReference.BloodArsenal) - BioVatLogicAdder.BioVatGlass.addCustomGlass("BloodArsenal", "blood_stained_glass", 0, 3); - if (LoaderReference.Botania) { - BioVatLogicAdder.BioVatGlass.addCustomGlass("Botania", "manaGlass", 0, 4); - BioVatLogicAdder.BioVatGlass.addCustomGlass("Botania", "manaGlassPane", 0, 4); - BioVatLogicAdder.BioVatGlass.addCustomGlass("Botania", "elfGlass", 0, 5); - BioVatLogicAdder.BioVatGlass.addCustomGlass("Botania", "elfGlassPane", 0, 5); - } - if (LoaderReference.Botany) BioVatLogicAdder.BioVatGlass.addCustomGlass("Botany", "stained", 0, 3); - if (LoaderReference.EnderIO) for (int i = 0; i <= 5; ++i) - BioVatLogicAdder.BioVatGlass.addCustomGlass("EnderIO", "blockFusedQuartz", i, 3); - - if (LoaderReference.ExtraUtilities) { - BioVatLogicAdder.BioVatGlass.addCustomGlass("ExtraUtilities", "decorativeBlock1", 9, 3); - for (int i = 0; i <= 11; ++i) - BioVatLogicAdder.BioVatGlass.addCustomGlass("ExtraUtilities", "decorativeBlock2", i, 3); - for (int i = 0; i <= 5; ++i) - BioVatLogicAdder.BioVatGlass.addCustomGlass("ExtraUtilities", "etherealglass", i, 3); - } - if (LoaderReference.GalaxySpace) - BioVatLogicAdder.BioVatGlass.addCustomGlass("GalaxySpace", "futureglass", 0, 3); - if (LoaderReference.HardcoreEnderExpension) - BioVatLogicAdder.BioVatGlass.addCustomGlass("HardcoreEnderExpension", "laboratory_glass", 0, 3); - - if (LoaderReference.Natura) - for (int i = 0; i <= 1; ++i) BioVatLogicAdder.BioVatGlass.addCustomGlass("Natura", "NetherGlass", i, 3); - - if (LoaderReference.RandomThings) - BioVatLogicAdder.BioVatGlass.addCustomGlass("RandomThings", "spectreGlass", 0, 3); - if (LoaderReference.TConstruct) BioVatLogicAdder.BioVatGlass.addCustomGlass("TConstruct", "GlassBlock", 0, 3); - if (LoaderReference.tectech) BioVatLogicAdder.BioVatGlass.addCustomGlass("tectech", "tile.quantumGlass", 0, 8); - - if (LoaderReference.chisel) BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "glass2", 0, 3); - - for (int i = 0; i <= 15; ++i) { - BioVatLogicAdder.BioVatGlass.addCustomGlass("minecraft", "stained_glass", i, 3); - if (LoaderReference.GalaxySpace) - BioVatLogicAdder.BioVatGlass.addCustomGlass("GalaxySpace", "futureglasses", i, 3); - if (LoaderReference.Railcraft) BioVatLogicAdder.BioVatGlass.addCustomGlass("Railcraft", "glass", i, 3); - if (LoaderReference.TConstruct) - BioVatLogicAdder.BioVatGlass.addCustomGlass("TConstruct", "GlassBlock.StainedClear", i, 3); - if (LoaderReference.Ztones) BioVatLogicAdder.BioVatGlass.addCustomGlass("Ztones", "tile.glaxx", i, 3); - if (LoaderReference.chisel) { - BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "glass", i, 3); - BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_white", i, 3); - BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_yellow", i, 3); - BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_lightgray", i, 3); - BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_brown", i, 3); - BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_forestry", i, 3); + for (int i = 0; i < 16; i++) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(Minecraft.ID, "stained_glass", i, 3); + } + + BioVatLogicAdder.BioVatGlass.addCustomGlass(IndustrialCraft2.ID, "blockAlloyGlass", 0, 4); + + if (BloodArsenal.isModLoaded()) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(BloodArsenal.ID, "blood_stained_glass", 0, 3); + } + if (Botania.isModLoaded()) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(Botania.ID, "manaGlass", 0, 4); + BioVatLogicAdder.BioVatGlass.addCustomGlass(Botania.ID, "manaGlassPane", 0, 4); + BioVatLogicAdder.BioVatGlass.addCustomGlass(Botania.ID, "elfGlass", 0, 5); + BioVatLogicAdder.BioVatGlass.addCustomGlass(Botania.ID, "elfGlassPane", 0, 5); + } + if (Botany.isModLoaded()) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(Botany.ID, "stained", 0, 3); + } + + if (Chisel.isModLoaded()) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(Chisel.ID, "glass2", 0, 3); + + for (int i = 0; i < 16; i++) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(Chisel.ID, "glass", i, 3); + BioVatLogicAdder.BioVatGlass.addCustomGlass(Chisel.ID, "stained_glass_white", i, 3); + BioVatLogicAdder.BioVatGlass.addCustomGlass(Chisel.ID, "stained_glass_yellow", i, 3); + BioVatLogicAdder.BioVatGlass.addCustomGlass(Chisel.ID, "stained_glass_lightgray", i, 3); + BioVatLogicAdder.BioVatGlass.addCustomGlass(Chisel.ID, "stained_glass_brown", i, 3); + BioVatLogicAdder.BioVatGlass.addCustomGlass(Chisel.ID, "stained_glass_forestry", i, 3); + } + } + + if (EnderIO.isModLoaded()) { + for (int i = 0; i <= 5; ++i) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(EnderIO.ID, "blockFusedQuartz", i, 3); + } + } + + if (ExtraUtilities.isModLoaded()) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(ExtraUtilities.ID, "decorativeBlock1", 9, 3); + for (int i = 0; i < 12; ++i) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(ExtraUtilities.ID, "decorativeBlock2", i, 3); + } + + for (int i = 0; i < 6; ++i) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(ExtraUtilities.ID, "etherealglass", i, 3); + + } + } + + if (GalaxySpace.isModLoaded()) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(GalaxySpace.ID, "futureglass", 0, 3); + for (int i = 0; i < 16; i++) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(GalaxySpace.ID, "futureglasses", i, 3); + } + } + + if (HardcoreEnderExpansion.isModLoaded()) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(HardcoreEnderExpansion.ID, "laboratory_glass", 0, 3); + } + + if (IndustrialCraft2.isModLoaded()) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(Minecraft.ID, "glass", 0, 3); + } + + if (Natura.isModLoaded()) { + for (int i = 0; i <= 1; ++i) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(Natura.ID, "NetherGlass", i, 3); + } + } + + if (Railcraft.isModLoaded()) { + for (int i = 0; i < 16; i++) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(Railcraft.ID, "glass", i, 3); + } + } + + if (RandomThings.isModLoaded()) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(RandomThings.ID, "spectreGlass", 0, 3); + } + + if (TinkerConstruct.isModLoaded()) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(TinkerConstruct.ID, "GlassBlock", 0, 3); + + for (int i = 0; i < 16; i++) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(TinkerConstruct.ID, "GlassBlock.StainedClear", i, 3); + } + } + + if (TecTech.isModLoaded()) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(TecTech.ID, "tile.quantumGlass", 0, 8); + } + + if (Witchery.isModLoaded()) { + for (int i = 0; i < 16; i++) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(Witchery.ID, "shadedglass", i, 3); + } + } + + if (ZTones.isModLoaded()) { + for (int i = 0; i < 16; i++) { + BioVatLogicAdder.BioVatGlass.addCustomGlass(ZTones.ID, "tile.glaxx", i, 3); } - if (LoaderReference.witchery) BioVatLogicAdder.BioVatGlass.addCustomGlass("witchery", "shadedglass", i, 3); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index fca9c5ed52..2feeb4c038 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -15,7 +15,8 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import static com.github.bartimaeusnek.bartworks.MainMod.BWT; import static com.github.bartimaeusnek.bartworks.MainMod.GT2; -import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; +import static gregtech.api.enums.Mods.GalactiGreg; +import static gregtech.api.enums.Mods.TecTech; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -24,18 +25,42 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.blocks.*; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks2; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer_MachineBlock; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.items.*; +import com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; +import com.github.bartimaeusnek.bartworks.common.items.BW_SimpleWindMeter; +import com.github.bartimaeusnek.bartworks.common.items.BW_Stonage_Rotors; +import com.github.bartimaeusnek.bartworks.common.items.Circuit_Programmer; +import com.github.bartimaeusnek.bartworks.common.items.GT_Destructopack_Item; +import com.github.bartimaeusnek.bartworks.common.items.GT_Rockcutter_Item; +import com.github.bartimaeusnek.bartworks.common.items.GT_Teslastaff_Item; +import com.github.bartimaeusnek.bartworks.common.items.SimpleIconItem; +import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_ExperimentalFloodGate; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump; import com.github.bartimaeusnek.bartworks.common.tileentities.debug.CreativeScanner; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.*; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.*; -import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.*; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_CircuitAssemblyLine; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_DEHP; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaBlastFurnace; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaChemicalReactor; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaDistillTower; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaOilCracker; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_AcidGenerator; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_CompressedFluidHatch; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_Diode; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_EnergyDistributor; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_GiantOutputHatch; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_HumongousInputHatch; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.crossmod.galacticgreg.GT_TileEntity_VoidMiners; import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileEntity_LowPowerLaserBox; @@ -218,24 +243,22 @@ public class ItemRegistry { public static ItemStack TecTechPipeEnergyLowPower; public static void run() { - if (newStuff) { - GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses, "BW_FakeGlasBlock"); - GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses2, "BW_FakeGlasBlocks2"); - GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[2], BW_ItemBlocks.class, "BW_Machinery_Casings"); - GameRegistry.registerItem(ItemRegistry.LEATHER_ROTOR, "BW_LeatherRotor"); - GameRegistry.registerItem(ItemRegistry.WOOL_ROTOR, "BW_WoolRotor"); - GameRegistry.registerItem(ItemRegistry.PAPER_ROTOR, "BW_PaperRotor"); - GameRegistry.registerItem(ItemRegistry.COMBINED_ROTOR, "BW_CombinedRotor"); - GameRegistry.registerItem(ItemRegistry.CRAFTING_PARTS, "craftingParts"); - GameRegistry.registerTileEntity(BW_RotorBlock.class, "BWRotorBlockTE"); - GameRegistry.registerBlock(ItemRegistry.ROTORBLOCK, BW_ItemBlocks.class, "BWRotorBlock"); - GameRegistry.registerTileEntity(BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPumpTE"); - GameRegistry.registerBlock(ItemRegistry.PUMPBLOCK, BW_ItemBlocks.class, "BWHeatedWaterPumpBlock"); - GameRegistry.registerItem(ItemRegistry.PUMPPARTS, "BWPumpParts"); - GameRegistry.registerItem(ItemRegistry.WINDMETER, "BW_SimpleWindMeter"); - GameRegistry.registerTileEntity(BW_TileEntity_ExperimentalFloodGate.class, "BWExpReversePump"); - GameRegistry.registerBlock(ItemRegistry.EXPPUMP, BW_ItemBlocks.class, "BWExpReversePumpBlock"); - } + GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses, "BW_FakeGlasBlock"); + GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses2, "BW_FakeGlasBlocks2"); + GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[2], BW_ItemBlocks.class, "BW_Machinery_Casings"); + GameRegistry.registerItem(ItemRegistry.LEATHER_ROTOR, "BW_LeatherRotor"); + GameRegistry.registerItem(ItemRegistry.WOOL_ROTOR, "BW_WoolRotor"); + GameRegistry.registerItem(ItemRegistry.PAPER_ROTOR, "BW_PaperRotor"); + GameRegistry.registerItem(ItemRegistry.COMBINED_ROTOR, "BW_CombinedRotor"); + GameRegistry.registerItem(ItemRegistry.CRAFTING_PARTS, "craftingParts"); + GameRegistry.registerTileEntity(BW_RotorBlock.class, "BWRotorBlockTE"); + GameRegistry.registerBlock(ItemRegistry.ROTORBLOCK, BW_ItemBlocks.class, "BWRotorBlock"); + GameRegistry.registerTileEntity(BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPumpTE"); + GameRegistry.registerBlock(ItemRegistry.PUMPBLOCK, BW_ItemBlocks.class, "BWHeatedWaterPumpBlock"); + GameRegistry.registerItem(ItemRegistry.PUMPPARTS, "BWPumpParts"); + GameRegistry.registerItem(ItemRegistry.WINDMETER, "BW_SimpleWindMeter"); + GameRegistry.registerTileEntity(BW_TileEntity_ExperimentalFloodGate.class, "BWExpReversePump"); + GameRegistry.registerBlock(ItemRegistry.EXPPUMP, BW_ItemBlocks.class, "BWExpReversePumpBlock"); // GT2 stuff GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[0], BW_ItemBlocks.class, "BW_ItemBlocks"); @@ -247,177 +270,172 @@ public class ItemRegistry { GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_MV, ItemRegistry.ROCKCUTTER_MV.getUnlocalizedName()); GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_HV, ItemRegistry.ROCKCUTTER_HV.getUnlocalizedName()); GameRegistry.registerItem(ItemRegistry.TAB, "tabIconGT2"); - if (newStuff) { - if (ConfigHandler.creativeScannerID != 0) new CreativeScanner( - ConfigHandler.creativeScannerID, - "Creative Debug Scanner", - "Creative Debug Scanner", - 20); - ItemRegistry.eic = new GT_TileEntity_ElectricImplosionCompressor( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, - "ElectricImplosionCompressor", - "Electric Implosion Compressor").getStackForm(1L); - // EIC depend on neutronium block to pass on structure updates - int bitmask = GregTech_API.sMachineIDs.getOrDefault(GregTech_API.sBlockMetal5, 0) | (1 << 2); - GregTech_API.registerMachineBlock(GregTech_API.sBlockMetal5, bitmask); - ItemRegistry.THTR = new GT_TileEntity_THTR( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, - "THTR", - "Thorium High Temperature Reactor").getStackForm(1L); - GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials(); - ItemRegistry.HTGR = new GT_TileEntity_HTGR( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 48, - "HTGR", - "High Temperature Gas-cooled Reactor").getStackForm(1L); - GT_TileEntity_HTGR.HTGRMaterials.registeraTHR_Materials(); - // ID ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 49 IS TAKEN !!! (12792) + if (ConfigHandler.creativeScannerID != 0) new CreativeScanner( + ConfigHandler.creativeScannerID, + "Creative Debug Scanner", + "Creative Debug Scanner", + 20); + ItemRegistry.eic = new GT_TileEntity_ElectricImplosionCompressor( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, + "ElectricImplosionCompressor", + "Electric Implosion Compressor").getStackForm(1L); + // EIC depend on neutronium block to pass on structure updates + int bitmask = GregTech_API.sMachineIDs.getOrDefault(GregTech_API.sBlockMetal5, 0) | (1 << 2); + GregTech_API.registerMachineBlock(GregTech_API.sBlockMetal5, bitmask); + ItemRegistry.THTR = new GT_TileEntity_THTR( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, + "THTR", + "Thorium High Temperature Reactor").getStackForm(1L); + GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials(); + ItemRegistry.HTGR = new GT_TileEntity_HTGR( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 48, + "HTGR", + "High Temperature Gas-cooled Reactor").getStackForm(1L); + GT_TileEntity_HTGR.HTGRMaterials.registeraTHR_Materials(); - GT_OreDictUnificator.add( - OrePrefixes.block, - Materials.BorosilicateGlass, - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); - GT_OreDictUnificator.registerOre( - OrePrefixes.block, - Materials.NickelZincFerrite, - new ItemStack(ItemRegistry.BW_BLOCKS[2])); - for (int i = 0; i < GT_Values.VN.length - 1; i++) { - ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode( - ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, - "diode" + "2A" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.diode.name") + " 2A " + GT_Values.VN[i], - i).getStackForm(1L); - ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode( - ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, - "diode" + "4A" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.diode.name") + " 4A " + GT_Values.VN[i], - i).getStackForm(1L); - ItemRegistry.diode8A[i] = new GT_MetaTileEntity_Diode( - ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, - "diode" + "8A" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.diode.name") + " 8A " + GT_Values.VN[i], - i).getStackForm(1L); - ItemRegistry.diode12A[i] = new GT_MetaTileEntity_Diode( - ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, - "diode" + "12A" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.diode.name") + " 12A " + GT_Values.VN[i], - i).getStackForm(1L); - ItemRegistry.diode16A[i] = new GT_MetaTileEntity_Diode( - ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, - "diode" + "16A" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.diode.name") + " 16A " + GT_Values.VN[i], - i).getStackForm(1L); - ItemRegistry.energyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor( - ConfigHandler.IDOffset + 1 + i, - "energydistributor" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.energydistributor.name") + " " + GT_Values.VN[i], - i).getStackForm(1L); - } - for (int i = 0; i < 3; i++) { - ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, - "acidgenerator" + GT_Values.VN[i + 2], - StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[i + 2], - i + 2).getStackForm(1); - } + // ID ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 49 IS TAKEN !!! (12792) + + GT_OreDictUnificator + .add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); + GT_OreDictUnificator + .registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(ItemRegistry.BW_BLOCKS[2])); + for (int i = 0; i < GT_Values.VN.length - 1; i++) { + ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode( + ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, + "diode" + "2A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 2A " + GT_Values.VN[i], + i).getStackForm(1L); + ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode( + ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, + "diode" + "4A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 4A " + GT_Values.VN[i], + i).getStackForm(1L); + ItemRegistry.diode8A[i] = new GT_MetaTileEntity_Diode( + ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, + "diode" + "8A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 8A " + GT_Values.VN[i], + i).getStackForm(1L); + ItemRegistry.diode12A[i] = new GT_MetaTileEntity_Diode( + ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, + "diode" + "12A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 12A " + GT_Values.VN[i], + i).getStackForm(1L); + ItemRegistry.diode16A[i] = new GT_MetaTileEntity_Diode( + ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, + "diode" + "16A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 16A " + GT_Values.VN[i], + i).getStackForm(1L); + ItemRegistry.energyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor( + ConfigHandler.IDOffset + 1 + i, + "energydistributor" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.energydistributor.name") + " " + GT_Values.VN[i], + i).getStackForm(1L); + } + for (int i = 0; i < 3; i++) { + ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, + "acidgenerator" + GT_Values.VN[i + 2], + StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[i + 2], + i + 2).getStackForm(1); + } - ItemRegistry.acidGensLV = new GT_MetaTileEntity_AcidGenerator( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 65, - "acidgenerator" + GT_Values.VN[1], - StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[1], - +1).getStackForm(1L); + ItemRegistry.acidGensLV = new GT_MetaTileEntity_AcidGenerator( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 65, + "acidgenerator" + GT_Values.VN[1], + StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[1], + +1).getStackForm(1L); - ItemRegistry.dehp = new GT_TileEntity_DEHP( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, - 1, - "DEHP", - "Deep Earth Heating Pump").getStackForm(1L); - ItemRegistry.megaMachines[0] = new GT_TileEntity_MegaBlastFurnace( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, - "MegaBlastFurnace", - StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L); - ItemRegistry.megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, - "MegaVacuumFreezer", - StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L); - ItemRegistry.cal = new GT_TileEntity_CircuitAssemblyLine( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 7, - "CircuitAssemblyLine", - "Circuit Assembly Line").getStackForm(1L); - ItemRegistry.compressedHatch = new GT_MetaTileEntity_CompressedFluidHatch( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, - "CompressedFluidHatch", - "Liquid Air Fluid Hatch").getStackForm(1L); - ItemRegistry.giantOutputHatch = new GT_MetaTileEntity_GiantOutputHatch( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, - "GiantOutputHatch", - "Giant Output Hatch").getStackForm(1L); - ItemRegistry.humongousInputHatch = new GT_MetaTileEntity_HumongousInputHatch( - ConfigHandler.IDOffset + GT_Values.VN.length * 9 + 55, - "HumongousInputHatch", - "Humongous Input Hatch").getStackForm(1L); - ItemRegistry.megaMachines[2] = new GT_TileEntity_MegaDistillTower( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, - "MegaDistillationTower", - "Mega Distillation Tower").getStackForm(1L); - ItemRegistry.megaMachines[3] = new GT_TileEntity_MegaChemicalReactor( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 638, - "MegaChemicalReactor", - "Mega Chemical Reactor").getStackForm(1L); - ItemRegistry.megaMachines[4] = new GT_TileEntity_MegaOilCracker( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 639, - "MegaOilCracker", - "Mega Oil Cracker").getStackForm(1L); + ItemRegistry.dehp = new GT_TileEntity_DEHP( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, + 1, + "DEHP", + "Deep Earth Heating Pump").getStackForm(1L); + ItemRegistry.megaMachines[0] = new GT_TileEntity_MegaBlastFurnace( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, + "MegaBlastFurnace", + StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L); + ItemRegistry.megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, + "MegaVacuumFreezer", + StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L); + ItemRegistry.cal = new GT_TileEntity_CircuitAssemblyLine( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 7, + "CircuitAssemblyLine", + "Circuit Assembly Line").getStackForm(1L); + ItemRegistry.compressedHatch = new GT_MetaTileEntity_CompressedFluidHatch( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, + "CompressedFluidHatch", + "Liquid Air Fluid Hatch").getStackForm(1L); + ItemRegistry.giantOutputHatch = new GT_MetaTileEntity_GiantOutputHatch( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, + "GiantOutputHatch", + "Giant Output Hatch").getStackForm(1L); + ItemRegistry.humongousInputHatch = new GT_MetaTileEntity_HumongousInputHatch( + ConfigHandler.IDOffset + GT_Values.VN.length * 9 + 55, + "HumongousInputHatch", + "Humongous Input Hatch").getStackForm(1L); + ItemRegistry.megaMachines[2] = new GT_TileEntity_MegaDistillTower( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, + "MegaDistillationTower", + "Mega Distillation Tower").getStackForm(1L); + ItemRegistry.megaMachines[3] = new GT_TileEntity_MegaChemicalReactor( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 638, + "MegaChemicalReactor", + "Mega Chemical Reactor").getStackForm(1L); + ItemRegistry.megaMachines[4] = new GT_TileEntity_MegaOilCracker( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 639, + "MegaOilCracker", + "Mega Oil Cracker").getStackForm(1L); - if (LoaderReference.galacticgreg) { - ItemRegistry.voidminer[2] = new GT_TileEntity_VoidMiners.VMUV( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 11, - "VoidMiner3", - "Void Miner III").getStackForm(1L); - ItemRegistry.voidminer[1] = new GT_TileEntity_VoidMiners.VMZPM( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 12, - "VoidMiner2", - "Void Miner II").getStackForm(1L); - ItemRegistry.voidminer[0] = new GT_TileEntity_VoidMiners.VMLUV( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 13, - "VoidMiner1", - "Void Miner I").getStackForm(1L); - } - if (LoaderReference.tectech) { - TecTechPipeEnergyLowPower = new TT_MetaTileEntity_Pipe_Energy_LowPower( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 14, - "pipe.lowpowerlaser", - "Low Power Laser Pipe").getStackForm(1L); - int startID = ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15; - for (int amps = 32; amps <= 128; amps += 32) { - for (int tier = 4; tier < 8; tier++) { - TecTechLaserAdditions[0][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserBox( - startID++, - GT_Values.VN[tier] + "_LPLaser_Converter_" + amps, - GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Converter", - tier, - amps).getStackForm(1L); - } + if (GalactiGreg.isModLoaded()) { + ItemRegistry.voidminer[2] = new GT_TileEntity_VoidMiners.VMUV( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 11, + "VoidMiner3", + "Void Miner III").getStackForm(1L); + ItemRegistry.voidminer[1] = new GT_TileEntity_VoidMiners.VMZPM( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 12, + "VoidMiner2", + "Void Miner II").getStackForm(1L); + ItemRegistry.voidminer[0] = new GT_TileEntity_VoidMiners.VMLUV( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 13, + "VoidMiner1", + "Void Miner I").getStackForm(1L); + } + if (TecTech.isModLoaded()) { + TecTechPipeEnergyLowPower = new TT_MetaTileEntity_Pipe_Energy_LowPower( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 14, + "pipe.lowpowerlaser", + "Low Power Laser Pipe").getStackForm(1L); + int startID = ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15; + for (int amps = 32; amps <= 128; amps += 32) { + for (int tier = 4; tier < 8; tier++) { + TecTechLaserAdditions[0][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserBox( + startID++, + GT_Values.VN[tier] + "_LPLaser_Converter_" + amps, + GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Converter", + tier, + amps).getStackForm(1L); } - for (int amps = 32; amps <= 128; amps += 32) { - for (int tier = 4; tier < 8; tier++) { - TecTechLaserAdditions[1][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserHatch( - startID++, - GT_Values.VN[tier] + "_LPLaser_Hatch_" + amps, - GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Target Hatch", - tier, - amps).getStackForm(1L); - } + } + for (int amps = 32; amps <= 128; amps += 32) { + for (int tier = 4; tier < 8; tier++) { + TecTechLaserAdditions[1][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserHatch( + startID++, + GT_Values.VN[tier] + "_LPLaser_Hatch_" + amps, + GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Target Hatch", + tier, + amps).getStackForm(1L); } - for (int amps = 32; amps <= 128; amps += 32) { - for (int tier = 4; tier < 8; tier++) { - TecTechLaserAdditions[2][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserDynamo( - startID++, - GT_Values.VN[tier] + "_LPLaser_Dynamo_" + amps, - GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Source Hatch", - tier, - amps).getStackForm(1L); - } + } + for (int amps = 32; amps <= 128; amps += 32) { + for (int tier = 4; tier < 8; tier++) { + TecTechLaserAdditions[2][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserDynamo( + startID++, + GT_Values.VN[tier] + "_LPLaser_Dynamo_" + amps, + GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Source Hatch", + tier, + amps).getStackForm(1L); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java index 5e92aa94eb..41fc6c8a23 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java @@ -1,5 +1,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders; +import static gregtech.api.enums.Mods.IndustrialCraft2; + import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -154,33 +156,33 @@ public class RadioHatchMaterialLoader { .addRadHatch(ItemList.Depleted_Naquadah_4.get(1), 140 / 10, 12, Materials.NaquadahEnriched.mRGBa); BWRecipes.instance.addRadHatch( - GT_ModHandler.getModItem("IC2", "reactorMOXSimpledepleted", 1), + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXSimpledepleted", 1), (int) Materials.Plutonium.getProtons() / 10, 3, Materials.Plutonium.mRGBa); BWRecipes.instance.addRadHatch( - GT_ModHandler.getModItem("IC2", "reactorMOXDualdepleted", 1), + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXDualdepleted", 1), (int) Materials.Plutonium.getProtons() / 10, 6, Materials.Plutonium.mRGBa); BWRecipes.instance.addRadHatch( - GT_ModHandler.getModItem("IC2", "reactorMOXQuaddepleted", 1), + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXQuaddepleted", 1), (int) Materials.Plutonium.getProtons() / 10, 12, Materials.Plutonium.mRGBa); BWRecipes.instance.addRadHatch( - GT_ModHandler.getModItem("IC2", "reactorUraniumSimpledepleted", 1), + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumSimpledepleted", 1), (int) Materials.Uranium.getProtons() / 10, 3, Materials.Uranium.mRGBa); BWRecipes.instance.addRadHatch( - GT_ModHandler.getModItem("IC2", "reactorUraniumDualdepleted", 1), + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumDualdepleted", 1), (int) Materials.Uranium.getProtons() / 10, 6, Materials.Uranium.mRGBa); BWRecipes.instance.addRadHatch( - GT_ModHandler.getModItem("IC2", "reactorUraniumQuaddepleted", 1), + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumQuaddepleted", 1), (int) Materials.Uranium.getProtons() / 10, 12, Materials.Uranium.mRGBa); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index d3c334d5dd..09cea4ef2b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -13,1097 +13,47 @@ package com.github.bartimaeusnek.bartworks.common.loaders; -import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; - -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; - -import com.github.bartimaeusnek.bartworks.API.LoaderReference; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.*; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; -import com.github.bartimaeusnek.bartworks.util.BW_Util; - -import gregtech.api.GregTech_API; -import gregtech.api.enums.*; -import gregtech.api.interfaces.ISubTagContainer; +import com.github.bartimaeusnek.bartworks.common.loaders.recipes.Assembler; +import com.github.bartimaeusnek.bartworks.common.loaders.recipes.AssemblyLine; +import com.github.bartimaeusnek.bartworks.common.loaders.recipes.Autoclave; +import com.github.bartimaeusnek.bartworks.common.loaders.recipes.Centrifuge; +import com.github.bartimaeusnek.bartworks.common.loaders.recipes.ChemicalBath; +import com.github.bartimaeusnek.bartworks.common.loaders.recipes.ChemicalReactor; +import com.github.bartimaeusnek.bartworks.common.loaders.recipes.CraftingRecipes; +import com.github.bartimaeusnek.bartworks.common.loaders.recipes.Electrolyzer; +import com.github.bartimaeusnek.bartworks.common.loaders.recipes.Extractor; +import com.github.bartimaeusnek.bartworks.common.loaders.recipes.FakeRecipes; +import com.github.bartimaeusnek.bartworks.common.loaders.recipes.FluidHeater; +import com.github.bartimaeusnek.bartworks.common.loaders.recipes.FluidSolidifier; +import com.github.bartimaeusnek.bartworks.common.loaders.recipes.FormingPress; +import com.github.bartimaeusnek.bartworks.common.loaders.recipes.LaserEngraver; +import com.github.bartimaeusnek.bartworks.common.loaders.recipes.Mixer; +import com.github.bartimaeusnek.bartworks.common.loaders.recipes.Pulverizer; +import com.github.bartimaeusnek.bartworks.common.loaders.recipes.PyrolyseOven; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import ic2.core.Ic2Items; public class RecipeLoader { - protected static final long BITSD = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE + public static final long BITSD = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE; - @SuppressWarnings("deprecation") public static void run() { - - if (ConfigHandler.hardmode) { - /* - * GTNH "hardmode" Recipes - */ - - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(Blocks.lapis_block), - Materials.Iron.getMolten(1296L), - new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), - 100, - BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), Materials.Lapis.getPlates(9), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2L), - GT_Utility.getIntegratedCircuit(17) }, - FluidRegistry.getFluidStack("ic2coolant", 1000), - new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), - 100, - BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), Materials.Lapis.getBlocks(8), - GT_Utility.getIntegratedCircuit(17) }, - GT_Values.NF, - new ItemStack(ItemRegistry.BW_BLOCKS[1]), - 100, - BW_Util.getMachineVoltageFromTier(3)); - } else { - /* - * Vanilla Recipes - */ - - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { Materials.Lapis.getBlocks(8), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L), - GT_Utility.getIntegratedCircuit(17) }, - GT_Values.NF, - new ItemStack(ItemRegistry.BW_BLOCKS[1]), - 100, - BW_Util.getMachineVoltageFromTier(1)); - - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.BW_BLOCKS[1]), - RecipeLoader.BITSD, - new Object[] { "LLL", "LCL", "LLL", 'L', Materials.Lapis.getBlocks(1), 'C', "circuitBasic" }); - - GT_Values.RA.addCutterRecipe( - new ItemStack(ItemRegistry.BW_BLOCKS[1]), - new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), - GT_Values.NI, - 100, - BW_Util.getMachineVoltageFromTier(1)); - GT_Values.RA.addCompressorRecipe( - new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), - new ItemStack(ItemRegistry.BW_BLOCKS[1]), - 100, - BW_Util.getMachineVoltageFromTier(1)); - GT_Values.RA.addCompressorRecipe( - new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 0), - new ItemStack(ItemRegistry.BW_BLOCKS[1]), - 100, - BW_Util.getMachineVoltageFromTier(1)); - GT_ModHandler.addShapelessCraftingRecipe( - new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), - RecipeLoader.BITSD, - new Object[] { new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1) }); - GT_ModHandler.addShapelessCraftingRecipe( - new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), - RecipeLoader.BITSD, - new Object[] { new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0) }); - } - - /* - * Common Recipes - */ - - GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_LESU(ConfigHandler.IDOffset, "LESU", "L.E.S.U.").getStackForm(1L), - RecipeLoader.BITSD, - new Object[] { "CDC", "SBS", "CFC", 'C', ConfigHandler.hardmode ? "circuitAdvanced" : "circuitBasic", - 'D', ItemList.Cover_Screen.get(1L), 'S', - GT_OreDictUnificator.get( - OrePrefixes.cableGt12, - ConfigHandler.hardmode ? Materials.Platinum : Materials.AnnealedCopper, - 1L), - 'B', new ItemStack(ItemRegistry.BW_BLOCKS[1]), 'F', - ConfigHandler.hardmode ? ItemList.Field_Generator_HV.get(1L) - : ItemList.Field_Generator_LV.get(1L) }); - - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.DESTRUCTOPACK), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "CPC", "PLP", "CPC", 'C', "circuitAdvanced", 'P', - GT_OreDictUnificator.get( - ConfigHandler.hardmode ? OrePrefixes.plateDouble : OrePrefixes.plate, - Materials.Aluminium, - 1L), - 'L', new ItemStack(Items.lava_bucket) }); - - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.DESTRUCTOPACK), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "CPC", "PLP", "CPC", 'C', "circuitAdvanced", 'P', - GT_OreDictUnificator.get( - ConfigHandler.hardmode ? OrePrefixes.plateDouble : OrePrefixes.plate, - ConfigHandler.hardmode ? Materials.Steel : Materials.Iron, - 1L), - 'L', new ItemStack(Items.lava_bucket) }); - - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.ROCKCUTTER_MV), - RecipeLoader.BITSD, - new Object[] { "DS ", "DP ", "DCB", 'D', - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), 'S', - GT_OreDictUnificator.get(OrePrefixes.stick, Materials.TungstenSteel, 1L), 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 1L), 'C', "circuitGood", - 'B', ItemList.IC2_AdvBattery.get(1L) }); - - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.ROCKCUTTER_LV), - RecipeLoader.BITSD, - new Object[] { "DS ", "DP ", "DCB", 'D', - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), 'S', - GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Titanium, 1L), 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), 'C', "circuitBasic", 'B', - ItemList.IC2_ReBattery.get(1L) }); - - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.ROCKCUTTER_HV), - RecipeLoader.BITSD, - new Object[] { "DS ", "DP ", "DCB", 'D', - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), 'S', - GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Iridium, 1L), 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), 'C', "circuitAdvanced", 'B', - ItemList.IC2_EnergyCrystal.get(1L) }); - - if (ConfigHandler.teslastaff) GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.TESLASTAFF), - RecipeLoader.BITSD, - new Object[] { "BO ", "OP ", " P", 'O', - GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Superconductor, 1L), 'B', - ItemList.Energy_LapotronicOrb.get(1L), 'P', "plateAlloyIridium", }); - - Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null - ? FluidRegistry.getFluid("molten.indalloy140") - : FluidRegistry.getFluid("molten.solderingalloy"); - - if (newStuff) { - - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.PUMPPARTS, 1, 0), // tube - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { " fG", " G ", "G ", 'G', ItemList.Circuit_Parts_Glass_Tube.get(1L) }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), // motor - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "GLP", "LSd", "PfT", 'G', - GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.Steel, 1L), 'L', - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Steel, 1L), 'S', - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 1L), 'P', - new ItemStack(Blocks.piston), 'T', new ItemStack(ItemRegistry.PUMPPARTS, 1, 0) }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.PUMPBLOCK, 1, 0), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "IPI", "PMP", "ISI", 'I', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), 'P', - GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Wood, 1L), 'M', - new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), 'S', Ic2Items.ironFurnace }); - - if (!ConfigHandler.hardmode) GT_ModHandler.addCraftingRecipe( - ItemRegistry.dehp, - RecipeLoader.BITSD, - new Object[] { "GPG", "NCN", "GPG", 'G', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 1L), 'P', - ItemList.Pump_IV.get(1L), 'N', - GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 1L), 'C', - ItemList.MACHINE_HULLS[5], }); - else GT_Values.RA.addAssemblylineRecipe( - ItemList.Pump_IV.get(1L), - 72000, - new ItemStack[] { ItemList.Pump_IV.get(16), - GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 32L), - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), - ItemList.Field_Generator_LuV.get(8) }, - new FluidStack[] { new FluidStack(solderIndalloy, 32 * 144), - Materials.Polytetrafluoroethylene.getMolten(32 * 144) }, - ItemRegistry.dehp, - 5000, - BW_Util.getMachineVoltageFromTier(6)); - - GT_Values.RA.addAssemblerRecipe( - GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1000), - GT_Utility.getIntegratedCircuit(17), - Materials.SolderingAlloy.getMolten(9216), - ItemRegistry.megaMachines[0], - 72000, - BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe( - GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1002), - GT_Utility.getIntegratedCircuit(17), - Materials.SolderingAlloy.getMolten(9216), - ItemRegistry.megaMachines[1], - 72000, - BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe( - GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1126), - GT_Utility.getIntegratedCircuit(17), - Materials.SolderingAlloy.getMolten(9216), - ItemRegistry.megaMachines[2], - 72000, - BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe( - GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1169), - GT_Utility.getIntegratedCircuit(17), - Materials.SolderingAlloy.getMolten(9216), - ItemRegistry.megaMachines[3], - 72000, - BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe( - GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1160), - GT_Utility.getIntegratedCircuit(17), - Materials.SolderingAlloy.getMolten(9216), - ItemRegistry.megaMachines[4], - 72000, - BW_Util.getMachineVoltageFromTier(3)); - - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Materials.Titanium.getMolten(1152), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), - 800, - BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Materials.TungstenSteel.getMolten(1152), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), - 800, - BW_Util.getMachineVoltageFromTier(4)); - FluidStack LuVMaterialFluid = ConfigHandler.newStuff ? WerkstoffLoader.LuVTierMaterial.getMolten(1152) - : Materials.Chrome.getMolten(1152); - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - LuVMaterialFluid, - new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), - 800, - BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Materials.Iridium.getMolten(1152), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), - 800, - BW_Util.getMachineVoltageFromTier(6)); - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Materials.Osmium.getMolten(1152), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), - 800, - BW_Util.getMachineVoltageFromTier(7)); - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Materials.Neutronium.getMolten(1152), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), - 800, - BW_Util.getMachineVoltageFromTier(8)); - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Materials.CosmicNeutronium.getMolten(1152), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), - 800, - BW_Util.getMachineVoltageFromTier(9)); - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Materials.Infinity.getMolten(1152), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 15), - 800, - BW_Util.getMachineVoltageFromTier(10)); - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Materials.TranscendentMetal.getMolten(1152), - new ItemStack(ItemRegistry.bw_glasses[1], 1, 0), - 800, - BW_Util.getMachineVoltageFromTier(11)); - - for (int i = 0; i < Dyes.dyeBrown.getSizeOfFluidList(); ++i) { - GT_Values.RA.addChemicalBathRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Dyes.dyeRed.getFluidDye(i, 36), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 6), - null, - null, - null, - 64, - 2); - GT_Values.RA.addChemicalBathRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Dyes.dyeGreen.getFluidDye(i, 36), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 7), - null, - null, - null, - 64, - 2); - GT_Values.RA.addChemicalBathRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Dyes.dyePurple.getFluidDye(i, 36), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 8), - null, - null, - null, - 64, - 2); - GT_Values.RA.addChemicalBathRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Dyes.dyeYellow.getFluidDye(i, 36), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 9), - null, - null, - null, - 64, - 2); - GT_Values.RA.addChemicalBathRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Dyes.dyeLime.getFluidDye(i, 36), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 10), - null, - null, - null, - 64, - 2); - GT_Values.RA.addChemicalBathRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Dyes.dyeBrown.getFluidDye(i, 36), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 11), - null, - null, - null, - 64, - 2); - } - // and reverse recipes... cause im nice :P - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Titanium.getDust(8) }, - null, - 800, - BW_Util.getMachineVoltageFromTier(4)); - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.TungstenSteel.getDust(8) }, - null, - 800, - BW_Util.getMachineVoltageFromTier(5)); - ItemStack LuVMaterialDust = ConfigHandler.newStuff - ? WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.dust, 8) - : Materials.Chrome.getDust(8); - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), LuVMaterialDust }, - null, - 800, - BW_Util.getMachineVoltageFromTier(6)); - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Iridium.getDust(8) }, - null, - 800, - BW_Util.getMachineVoltageFromTier(7)); - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Osmium.getDust(8) }, - null, - 800, - BW_Util.getMachineVoltageFromTier(8)); - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Neutronium.getDust(8) }, - null, - 800, - BW_Util.getMachineVoltageFromTier(9)); - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.CosmicNeutronium.getDust(8) }, - null, - 800, - BW_Util.getMachineVoltageFromTier(10)); - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 15), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Infinity.getDust(8) }, - null, - 800, - BW_Util.getMachineVoltageFromTier(11)); - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[1], 1, 0), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.TranscendentMetal.getDust(8) }, - null, - 800, - BW_Util.getMachineVoltageFromTier(12)); - - for (int i = 6; i < 11; i++) { - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, i), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9) }, - null, - 400, - BW_Util.getMachineVoltageFromTier(1)); - GT_Values.RA.addChemicalBathRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, i), - Materials.Chlorine.getGas(50), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - null, - null, - null, - 64, - 2); - } - - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.WINDMETER), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "SWF", "Sf ", "Ss ", 'S', "stickWood", 'W', - new ItemStack(Blocks.wool, 1, Short.MAX_VALUE), 'F', new ItemStack(Items.string), }); - - Materials[] cables = { // Cable material used in the acid gen, diode and energy distributor below - Materials.Lead, // ULV - Materials.Tin, // LV - Materials.AnnealedCopper, // MV - Materials.Gold, // HV - Materials.Aluminium, // EV - Materials.Tungsten, // IV - Materials.VanadiumGallium, // LuV - Materials.Naquadah, // ZPM - Materials.NaquadahAlloy, // UV - Materials.SuperconductorUV // UHV - }; - - ISubTagContainer[] hulls = { // Plate material used in the acid gen, diode and energy distributor below - Materials.WroughtIron, // ULV - Materials.Steel, // LV - Materials.Aluminium, // MV - Materials.StainlessSteel, // HV - Materials.Titanium, // EV - Materials.TungstenSteel, // IV - WerkstoffLoader.LuVTierMaterial, // LuV - Materials.Iridium, // ZPM - Materials.Osmium, // UV - Materials.Naquadah // UHV - }; - - ItemStack[] bats = { ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_Hull_MV.get(1L), - ItemList.Battery_Hull_HV.get(1L) }; - ItemStack[] chreac = { ItemList.Machine_MV_ChemicalReactor.get(1L), - ItemList.Machine_HV_ChemicalReactor.get(1L), ItemList.Machine_EV_ChemicalReactor.get(1L) }; - - for (int i = 0; i < 3; i++) { - Materials cable = cables[i + 2]; - ItemStack machinehull = ItemList.MACHINE_HULLS[i + 2].get(1L); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.acidGens[i], - RecipeLoader.BITSD, - new Object[] { "HRH", "HCH", "HKH", 'H', bats[i], 'K', - GT_OreDictUnificator.get(OrePrefixes.cableGt01, cable, 1L), 'C', machinehull, 'R', - chreac[i] }); - } - - GT_ModHandler.addCraftingRecipe( - ItemRegistry.acidGensLV, - RecipeLoader.BITSD, - new Object[] { "HRH", "KCK", "HKH", 'H', ItemList.Battery_Hull_LV.get(1L), 'K', - GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 1L), 'C', - ItemList.Hull_LV.get(1L), 'R', ItemList.Machine_LV_ChemicalReactor.get(1L), }); - - for (int i = 0; i < 9; i++) { - try { - Materials cable = cables[i]; - ItemStack hull = hulls[i] instanceof Materials - ? GT_OreDictUnificator.get(OrePrefixes.plate, hulls[i], 1L) - : ((Werkstoff) hulls[i]).get(OrePrefixes.plate); - ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); - - GT_ModHandler.addCraftingRecipe( - ItemRegistry.energyDistributor[i], - RecipeLoader.BITSD, - new Object[] { "PWP", "WCW", "PWP", 'W', - GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), 'P', hull, 'C', - machinehull }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode12A[i], - RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', - ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), 'P', hull, 'C', - machinehull }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode12A[i], - RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', - ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), 'P', hull, 'C', - machinehull }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode8A[i], - RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', - ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), 'P', hull, 'C', - machinehull }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode8A[i], - RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', - ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), 'P', hull, 'C', - machinehull }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode4A[i], - RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', - ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), 'P', hull, 'C', - machinehull }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode4A[i], - RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', - ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), 'P', hull, 'C', - machinehull }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode2A[i], - RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', - ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), 'P', hull, 'C', - machinehull }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode2A[i], - RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', - ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), 'P', hull, 'C', - machinehull }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode16A[i], - RecipeLoader.BITSD, - new Object[] { "WHW", "DCD", "PDP", 'H', ItemList.Circuit_Parts_Coil.get(1L), 'D', - ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', - GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), 'P', hull, 'C', - machinehull }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode16A[i], - RecipeLoader.BITSD, - new Object[] { "WHW", "DCD", "PDP", 'H', ItemList.Circuit_Parts_Coil.get(1L), 'D', - ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', - GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), 'P', hull, 'C', - machinehull }); - - } catch (ArrayIndexOutOfBoundsException e) { - // e.printStackTrace(); - } - } - - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), - GT_Utility.getIntegratedCircuit(17) }, - Materials.Plastic.getMolten(1152L), - new ItemStack(ItemRegistry.BW_BLOCKS[2], 1, 1), - 20, - BW_Util.getMachineVoltageFromTier(3)); - - GT_ModHandler.addCraftingRecipe( - /* - * Loader.isModLoaded("tectech") ? new TT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + - * GT_Values.VN.length * 6 + 1, "bw.manualtrafo", - * StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L) : - */ new GT_TileEntity_ManualTrafo( - ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, - "bw.manualtrafo", - StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L), - RecipeLoader.BITSD, - new Object[] { "SCS", "CHC", "ZCZ", 'S', - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L), 'C', - new ItemStack(ItemRegistry.BW_BLOCKS[2]), 'H', ItemList.Hull_HV.get(1L), 'Z', - "circuitAdvanced" }); - - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), - Materials.Aluminium.getPlates(1), ItemList.Circuit_Board_Plastic.get(1L), - ItemList.Battery_RE_LV_Lithium.get(1L) }, - Materials.SolderingAlloy.getMolten(288L), - new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER), - 600, - BW_Util.getMachineVoltageFromTier(2)); - - GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_Windmill( - ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 2, - "bw.windmill", - StatCollector.translateToLocal("tile.bw.windmill.name")).getStackForm(1L), - RecipeLoader.BITSD, - new Object[] { "BHB", "WGW", "BWB", 'B', new ItemStack(Blocks.brick_block), 'W', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), 'H', - new ItemStack(Blocks.hopper), 'G', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), }); - - String[] stones = { "stone", "stoneSmooth" }; - String[] granites = { "blockGranite", "stoneGranite", "Granite", "granite" }; - for (String granite : granites) { - for (String stone : stones) { - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "SSS", "DfD", " h ", 'S', stone, 'D', - new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "hDf", "SSS", 'S', stone, 'D', - new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "SSS", "DfD", " h ", 'S', stone, 'D', granite, }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "hDf", "SSS", 'S', stone, 'D', granite, }); - } - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "STS", "h f", "SBS", 'S', granite, 'T', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), 'B', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), }); - } - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "STS", "h f", "SBS", 'S', - new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), 'T', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), 'B', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "WLs", "WLh", "WLf", 'L', new ItemStack(Items.leather), 'W', "logWood", }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "WLs", "WLh", "WLf", 'L', new ItemStack(Blocks.carpet), 'W', "logWood", }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "WLs", "WLh", "WLf", 'L', new ItemStack(Items.paper), 'W', "logWood", }); - - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "WEs", "WZh", "WDf", 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'Z', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'D', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); - - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "WEs", "WZh", "WDf", 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'E', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'D', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); - - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "WEs", "WZh", "WDf", 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'Z', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'E', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); - - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "WEs", "WZh", "WDf", 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'D', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'Z', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); - - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "WEs", "WZh", "WDf", 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'D', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'E', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); - - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.LEATHER_ROTOR), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'W', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.WOOL_ROTOR), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'W', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.PAPER_ROTOR), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.COMBINED_ROTOR), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), 'W', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.ROTORBLOCK), - RecipeLoader.BITSD, - new Object[] { "WRW", "RGR", "WRW", 'R', - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Iron, 1L), 'W', "plankWood", 'G', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); - GT_TileEntity_THTR.THTRMaterials.registerTHR_Recipes(); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.THTR, - RecipeLoader.BITSD, - new Object[] { "BZB", "BRB", "BZB", 'B', new ItemStack(GregTech_API.sBlockCasings3, 1, 12), 'R', - GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), 'Z', "circuitUltimate" }); - GT_TileEntity_HTGR.HTGRMaterials.registerTHR_Recipes(); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.HTGR, - RecipeLoader.BITSD, - new Object[] { "BZB", "BRB", "BZB", 'B', new ItemStack(GregTech_API.sBlockCasings8, 1, 5), 'R', - GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), 'Z', "circuitSuperconductor" }); - - if (LoaderReference.galacticgreg) { - GT_Values.RA.addAssemblylineRecipe( - ItemList.OreDrill4.get(1L), - BW_Util.getMachineVoltageFromTier(6), - new Object[] { ItemList.OreDrill4.get(1L), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Europium, 9L), - Materials.Europium.getPlates(3), ItemList.Electric_Motor_LuV.get(9L), - ItemList.Sensor_LuV.get(9L), ItemList.Field_Generator_LuV.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 36L) }, - new FluidStack[] { new FluidStack(solderIndalloy, 1440), - WerkstoffLoader.Neon.getFluidOrGas(20000), }, - ItemRegistry.voidminer[0].copy(), - 108000, - BW_Util.getMachineVoltageFromTier(6)); - } - - if (!LoaderReference.tectech) { - if (LoaderReference.galacticgreg) { - GT_Values.RA.addAssemblylineRecipe( - ItemRegistry.voidminer[0].copy(), - BW_Util.getMachineVoltageFromTier(7), - new Object[] { ItemRegistry.voidminer[0].copy(), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), - Materials.BlackPlutonium.getPlates(3), ItemList.Electric_Motor_ZPM.get(9L), - ItemList.Sensor_ZPM.get(9L), ItemList.Field_Generator_ZPM.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) }, - new FluidStack[] { new FluidStack(solderIndalloy, 1440), - WerkstoffLoader.Krypton.getFluidOrGas(20000) }, - ItemRegistry.voidminer[1].copy(), - 216000, - BW_Util.getMachineVoltageFromTier(7)); - - GT_Values.RA.addAssemblylineRecipe( - ItemRegistry.voidminer[1].copy(), - BW_Util.getMachineVoltageFromTier(8), - new Object[] { ItemRegistry.voidminer[1].copy(), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), - Materials.Neutronium.getPlates(3), ItemList.Electric_Motor_UV.get(9L), - ItemList.Sensor_UV.get(9L), ItemList.Field_Generator_UV.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) }, - new FluidStack[] { new FluidStack(solderIndalloy, 1440), - WerkstoffLoader.Oganesson.getFluidOrGas(20000) }, - ItemRegistry.voidminer[2].copy(), - 432000, - BW_Util.getMachineVoltageFromTier(8)); - } - GT_Values.RA.addAssemblylineRecipe( - ItemList.Machine_Multi_ImplosionCompressor.get(1L), - 24000, - new ItemStack[] { ItemList.Machine_Multi_ImplosionCompressor.get(1L), - Materials.Neutronium.getBlocks(5), - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64), - ItemList.Electric_Piston_UV.get(64), }, - new FluidStack[] { new FluidStack(solderIndalloy, 1440), Materials.Osmium.getMolten(1440), - Materials.Neutronium.getMolten(1440) }, - ItemRegistry.eic.copy(), - 240000, - BW_Util.getMachineVoltageFromTier(8)); - } else { - ItemStack[][] converters = ItemRegistry.TecTechLaserAdditions[0]; - ItemStack[][] input = ItemRegistry.TecTechLaserAdditions[1]; - ItemStack[][] dynamo = ItemRegistry.TecTechLaserAdditions[2]; - - ItemList[] emitters = { ItemList.Emitter_EV, ItemList.Emitter_IV, ItemList.Emitter_LuV, - ItemList.Emitter_ZPM }; - - ItemList[] sensors = { ItemList.Sensor_EV, ItemList.Sensor_IV, ItemList.Sensor_LuV, - ItemList.Sensor_ZPM }; - - OrePrefixes[] prefixes = { OrePrefixes.cableGt04, OrePrefixes.cableGt08, OrePrefixes.cableGt12, - OrePrefixes.cableGt16 }; - - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { ItemList.Circuit_Parts_GlassFiber.get(32), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Electrum, 8), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2) }, - Materials.Polytetrafluoroethylene.getMolten(72), - new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - 1, - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - 200, - BW_Util.getMachineVoltageFromTier(4)); - - for (int j = 0; j < 4; j++) { - for (int i = 0; i < 4; i++) { - ItemStack converter = converters[j][i]; - ItemStack eInput = input[j][i]; - ItemStack eDynamo = dynamo[j][i]; - - int solderingAmount = Math.max(144 * i, 72) * (j + 1); - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - ((j + 1) * 16), - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), - emitters[i].get(2 * (j + 1)), sensors[i].get(2 * (j + 1)), - ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1)), }, - Materials.SolderingAlloy.getMolten(solderingAmount), - converter, - 200 * (j + 1), - BW_Util.getMachineVoltageFromTier(4 + i)); - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - ((j + 1) * 16), - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), - sensors[i].get(2 * (j + 1)), ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1)), }, - Materials.SolderingAlloy.getMolten(solderingAmount), - eInput, - 200 * (j + 1), - BW_Util.getMachineVoltageFromTier(4 + i)); - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - ((j + 1) * 16), - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), - emitters[i].get(2 * (j + 1)), - ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1)), }, - Materials.SolderingAlloy.getMolten(solderingAmount), - eDynamo, - 200 * (j + 1), - BW_Util.getMachineVoltageFromTier(4 + i)); - } - } - } - - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add( - new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[] { ItemList.Hatch_Input_HV.get(64), Materials.LiquidAir.getCells(1), - GT_Utility.getIntegratedCircuit(17) }, - new ItemStack[] { ItemRegistry.compressedHatch.copy() }, - null, - null, - null, - null, - 300, - BW_Util.getMachineVoltageFromTier(3), - 0)); - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add( - new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[] { ItemList.Hatch_Output_HV.get(64), GT_Utility.getIntegratedCircuit(17) }, - new ItemStack[] { ItemRegistry.giantOutputHatch.copy() }, - null, - null, - null, - null, - 300, - BW_Util.getMachineVoltageFromTier(3), - 0)); - - GT_Values.RA.addAssemblylineRecipe( - ItemList.Machine_LuV_CircuitAssembler.get(1L), - 24000, - new ItemStack[] { ItemList.Machine_LuV_CircuitAssembler.get(1L), ItemList.Robot_Arm_LuV.get(4L), - ItemList.Electric_Motor_LuV.get(4L), ItemList.Field_Generator_LuV.get(1L), - ItemList.Emitter_LuV.get(1L), ItemList.Sensor_LuV.get(1L), Materials.Chrome.getPlates(8) }, - new FluidStack[] { new FluidStack(solderIndalloy, 1440) }, - ItemRegistry.cal.copy(), - 24000, - BW_Util.getMachineVoltageFromTier(6)); - } - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.Forsterit.get(OrePrefixes.dust, 7), - GT_Values.NI, - GT_Values.NF, - Materials.Oxygen.getGas(2000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnesium, 2L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - null, - 200, - 90); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.RedZircon.get(OrePrefixes.dust, 6), - GT_Values.NI, - GT_Values.NF, - Materials.Oxygen.getGas(2000L), - WerkstoffLoader.Zirconium.get(OrePrefixes.dust, 1), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - null, - 250, - 90); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.Fayalit.get(OrePrefixes.dust, 7), - GT_Values.NI, - GT_Values.NF, - Materials.Oxygen.getGas(2000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 2L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - null, - 320, - 90); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.Prasiolite.get(OrePrefixes.dust, 16), - GT_Values.NI, - GT_Values.NF, - GT_Values.NF, - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 5L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - null, - 580, - 90); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.Hedenbergit.get(OrePrefixes.dust, 10), - GT_Values.NI, - GT_Values.NF, - Materials.Oxygen.getGas(2000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Calcium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 2L), - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - null, - 300, - 90); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.FuchsitAL.get(OrePrefixes.dust, 21), - ItemList.Cell_Empty.get(2), - GT_Values.NF, - Materials.Oxygen.getGas(2000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 3L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2), - GT_Values.NI, - GT_Values.NI, - null, - 390, - 120); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.FuchsitCR.get(OrePrefixes.dust, 21), - ItemList.Cell_Empty.get(2), - GT_Values.NF, - Materials.Oxygen.getGas(2000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2), - GT_Values.NI, - GT_Values.NI, - null, - 460, - 120); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.VanadioOxyDravit.get(OrePrefixes.dust, 53), - ItemList.Cell_Empty.get(3), - GT_Values.NF, - Materials.Oxygen.getGas(19000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Vanadium, 3L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), - null, - 710, - 120); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.ChromoAluminoPovondrait.get(OrePrefixes.dust, 53), - ItemList.Cell_Empty.get(3), - GT_Values.NF, - Materials.Oxygen.getGas(19000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), - null, - 720, - 120); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.FluorBuergerit.get(OrePrefixes.dust, 50), - ItemList.Cell_Empty.get(3), - GT_Values.NF, - Materials.Oxygen.getGas(6000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 3L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 6L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fluorine, 3), - null, - 730, - 120); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.Olenit.get(OrePrefixes.dust, 51), - ItemList.Cell_Empty.get(1), - GT_Values.NF, - Materials.Oxygen.getGas(1000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 9L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 1), - GT_Values.NI, - null, - 790, - 120); + new Assembler().run(); + new AssemblyLine().run(); + new Autoclave().run(); + new Centrifuge().run(); + new ChemicalBath().run(); + new ChemicalReactor().run(); + new CraftingRecipes().run(); + new Electrolyzer().run(); + new Extractor().run(); + new FakeRecipes().run(); + new FluidHeater().run(); + new FluidSolidifier().run(); + new FormingPress().run(); + new LaserEngraver().run(); + new Mixer().run(); + new Pulverizer().run(); + new PyrolyseOven().run(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java index 3f150f46f5..7fba74496e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java @@ -13,7 +13,12 @@ package com.github.bartimaeusnek.bartworks.common.loaders; -import com.github.bartimaeusnek.bartworks.common.commands.*; +import com.github.bartimaeusnek.bartworks.common.commands.ChangeConfig; +import com.github.bartimaeusnek.bartworks.common.commands.ClearCraftingCache; +import com.github.bartimaeusnek.bartworks.common.commands.GetWorkingDirectory; +import com.github.bartimaeusnek.bartworks.common.commands.PrintRecipeListToFile; +import com.github.bartimaeusnek.bartworks.common.commands.RunGC; +import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; import cpw.mods.fml.common.event.FMLServerStartingEvent; public class RegisterServerCommands { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 756d99351a..d392dd452f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -14,11 +14,23 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.ANAEROBE_GAS; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.NOBLE_GAS; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Oganesson; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.fluids; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.molten; import static gregtech.api.enums.GT_Values.VN; +import static gregtech.api.enums.Mods.TinkerConstruct; import java.lang.reflect.Field; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; import net.minecraft.init.Blocks; @@ -43,7 +55,11 @@ import com.gtnewhorizons.modularui.common.widget.ProgressBar; import cpw.mods.fml.common.registry.GameRegistry; import gnu.trove.map.hash.TObjectDoubleHashMap; -import gregtech.api.enums.*; +import gregtech.api.enums.Element; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_ModHandler; @@ -58,8 +74,8 @@ public class StaticRecipeChangeLoaders { private static TObjectDoubleHashMap gtEbfGasRecipeConsumptionMultipliers = null; public static final List whitelistForEBFNoGasRecipeDontCheckItemData = Arrays - .asList(GT_ModHandler.getModItem("TConstruct", "materials", 1L, 12) // Raw Aluminum -> Aluminium Ingot - // (coremod) + .asList(GT_ModHandler.getModItem(TinkerConstruct.ID, "materials", 1L, 12) // Raw Aluminum -> Aluminium Ingot + // (coremod) ); private StaticRecipeChangeLoaders() {} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java new file mode 100644 index 0000000000..7d803f154b --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java @@ -0,0 +1,224 @@ +package com.github.bartimaeusnek.bartworks.common.loaders.recipes; + +import static gregtech.api.enums.Mods.GregTech; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; + +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.BW_Util; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; + +public class Assembler implements Runnable { + + @Override + public void run() { + Materials[] cables = { // Cable material used in the acid gen, diode and energy distributor below + Materials.Lead, // ULV + Materials.Tin, // LV + Materials.AnnealedCopper, // MV + Materials.Gold, // HV + Materials.Aluminium, // EV + Materials.Tungsten, // IV + Materials.VanadiumGallium, // LuV + Materials.Naquadah, // ZPM + Materials.NaquadahAlloy, // UV + Materials.SuperconductorUV // UHV + }; + + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), Materials.Lapis.getPlates(9), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2L), + GT_Utility.getIntegratedCircuit(17) }, + FluidRegistry.getFluidStack("ic2coolant", 1000), + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), + 100, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), Materials.Lapis.getBlocks(8), + GT_Utility.getIntegratedCircuit(17) }, + GT_Values.NF, + new ItemStack(ItemRegistry.BW_BLOCKS[1]), + 100, + BW_Util.getMachineVoltageFromTier(3)); + + GT_Values.RA.addAssemblerRecipe( + GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1000), + GT_Utility.getIntegratedCircuit(17), + Materials.SolderingAlloy.getMolten(9216), + ItemRegistry.megaMachines[0], + 72000, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe( + GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1002), + GT_Utility.getIntegratedCircuit(17), + Materials.SolderingAlloy.getMolten(9216), + ItemRegistry.megaMachines[1], + 72000, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe( + GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1126), + GT_Utility.getIntegratedCircuit(17), + Materials.SolderingAlloy.getMolten(9216), + ItemRegistry.megaMachines[2], + 72000, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe( + GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1169), + GT_Utility.getIntegratedCircuit(17), + Materials.SolderingAlloy.getMolten(9216), + ItemRegistry.megaMachines[3], + 72000, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe( + GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1160), + GT_Utility.getIntegratedCircuit(17), + Materials.SolderingAlloy.getMolten(9216), + ItemRegistry.megaMachines[4], + 72000, + BW_Util.getMachineVoltageFromTier(3)); + + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), + GT_Utility.getIntegratedCircuit(17) }, + Materials.Plastic.getMolten(1152L), + new ItemStack(ItemRegistry.BW_BLOCKS[2], 1, 1), + 20, + BW_Util.getMachineVoltageFromTier(3)); + + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), + Materials.Aluminium.getPlates(1), ItemList.Circuit_Board_Plastic.get(1L), + ItemList.Battery_RE_LV_Lithium.get(1L) }, + Materials.SolderingAlloy.getMolten(288L), + new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER), + 600, + BW_Util.getMachineVoltageFromTier(2)); + + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { ItemList.Circuit_Parts_GlassFiber.get(32), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Electrum, 8), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2) }, + Materials.Polytetrafluoroethylene.getMolten(72), + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + 1, + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + 200, + BW_Util.getMachineVoltageFromTier(4)); + + ItemStack[][] converters = ItemRegistry.TecTechLaserAdditions[0]; + ItemStack[][] input = ItemRegistry.TecTechLaserAdditions[1]; + ItemStack[][] dynamo = ItemRegistry.TecTechLaserAdditions[2]; + + ItemList[] emitters = { ItemList.Emitter_EV, ItemList.Emitter_IV, ItemList.Emitter_LuV, ItemList.Emitter_ZPM }; + + ItemList[] sensors = { ItemList.Sensor_EV, ItemList.Sensor_IV, ItemList.Sensor_LuV, ItemList.Sensor_ZPM }; + + OrePrefixes[] prefixes = { OrePrefixes.cableGt04, OrePrefixes.cableGt08, OrePrefixes.cableGt12, + OrePrefixes.cableGt16 }; + + for (int j = 0; j < 4; j++) { + for (int i = 0; i < 4; i++) { + ItemStack converter = converters[j][i]; + ItemStack eInput = input[j][i]; + ItemStack eDynamo = dynamo[j][i]; + + int solderingAmount = Math.max(144 * i, 72) * (j + 1); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + ((j + 1) * 16), + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), emitters[i].get(2 * (j + 1)), + sensors[i].get(2 * (j + 1)), ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1)), }, + Materials.SolderingAlloy.getMolten(solderingAmount), + converter, + 200 * (j + 1), + BW_Util.getMachineVoltageFromTier(4 + i)); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + ((j + 1) * 16), + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), sensors[i].get(2 * (j + 1)), + ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1)), }, + Materials.SolderingAlloy.getMolten(solderingAmount), + eInput, + 200 * (j + 1), + BW_Util.getMachineVoltageFromTier(4 + i)); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + ((j + 1) * 16), + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), emitters[i].get(2 * (j + 1)), + ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1)), }, + Materials.SolderingAlloy.getMolten(solderingAmount), + eDynamo, + 200 * (j + 1), + BW_Util.getMachineVoltageFromTier(4 + i)); + } + } + + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add( + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { ItemList.Hatch_Input_HV.get(64), Materials.LiquidAir.getCells(1), + GT_Utility.getIntegratedCircuit(17) }, + new ItemStack[] { ItemRegistry.compressedHatch.copy() }, + null, + null, + null, + null, + 300, + BW_Util.getMachineVoltageFromTier(3), + 0)); + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add( + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { ItemList.Hatch_Output_HV.get(64), GT_Utility.getIntegratedCircuit(17) }, + new ItemStack[] { ItemRegistry.giantOutputHatch.copy() }, + null, + null, + null, + null, + 300, + BW_Util.getMachineVoltageFromTier(3), + 0)); + + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 6), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1) }, + Materials.Concrete.getMolten(1296), + new ItemStack(GregTech_API.sBlockCasings3, 1, 12), + 40, + BW_Util.getMachineVoltageFromTier(5)); + + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { new ItemStack(GregTech_API.sBlockCasings3, 1, 12), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Europium, 6), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 24) }, + Materials.Lead.getMolten(864), + new ItemStack(GregTech_API.sBlockCasings8, 1, 5), + 200, + BW_Util.getMachineVoltageFromTier(6)); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java new file mode 100644 index 0000000000..2f96dabbe1 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java @@ -0,0 +1,69 @@ +package com.github.bartimaeusnek.bartworks.common.loaders.recipes; + +import static gregtech.api.enums.Mods.GalactiGreg; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Util; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; + +public class AssemblyLine implements Runnable { + + @Override + public void run() { + Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null + ? FluidRegistry.getFluid("molten.indalloy140") + : FluidRegistry.getFluid("molten.solderingalloy"); + + GT_Values.RA.addAssemblylineRecipe( + ItemList.Pump_IV.get(1L), + 72000, + new ItemStack[] { ItemList.Pump_IV.get(16), + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 32L), + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), + ItemList.Field_Generator_LuV.get(8) }, + new FluidStack[] { new FluidStack(solderIndalloy, 32 * 144), + Materials.Polytetrafluoroethylene.getMolten(32 * 144) }, + ItemRegistry.dehp, + 5000, + BW_Util.getMachineVoltageFromTier(6)); + + if (GalactiGreg.isModLoaded()) { + GT_Values.RA.addAssemblylineRecipe( + ItemList.OreDrill4.get(1L), + BW_Util.getMachineVoltageFromTier(6), + new Object[] { ItemList.OreDrill4.get(1L), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Europium, 9L), + Materials.Europium.getPlates(3), ItemList.Electric_Motor_LuV.get(9L), + ItemList.Sensor_LuV.get(9L), ItemList.Field_Generator_LuV.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 36L) }, + new FluidStack[] { new FluidStack(solderIndalloy, 1440), + WerkstoffLoader.Neon.getFluidOrGas(20000), }, + ItemRegistry.voidminer[0].copy(), + 108000, + BW_Util.getMachineVoltageFromTier(6)); + } + + GT_Values.RA.addAssemblylineRecipe( + ItemList.Machine_LuV_CircuitAssembler.get(1L), + 24000, + new ItemStack[] { ItemList.Machine_LuV_CircuitAssembler.get(1L), ItemList.Robot_Arm_LuV.get(4L), + ItemList.Electric_Motor_LuV.get(4L), ItemList.Field_Generator_LuV.get(1L), + ItemList.Emitter_LuV.get(1L), ItemList.Sensor_LuV.get(1L), Materials.Chrome.getPlates(8) }, + new FluidStack[] { new FluidStack(solderIndalloy, 1440) }, + ItemRegistry.cal.copy(), + 24000, + BW_Util.getMachineVoltageFromTier(6)); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java new file mode 100644 index 0000000000..3771a261ae --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java @@ -0,0 +1,36 @@ +package com.github.bartimaeusnek.bartworks.common.loaders.recipes; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import com.github.bartimaeusnek.bartworks.util.BW_Util; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; + +public class Autoclave implements Runnable { + + @Override + public void run() { + Materials[] sterilizers = { Materials.Ammonia, Materials.Chlorine, Materials.Ethanol, Materials.Methanol }; + for (Materials used : sterilizers) { + GT_Values.RA.addAutoclaveRecipe( + ItemList.Circuit_Parts_PetriDish.get(1L), + used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L), + BioItemList.getPetriDish(null), + 10000, + 100, + BW_Util.getMachineVoltageFromTier(1)); + + GT_Values.RA.addAutoclaveRecipe( + new ItemStack(Items.glass_bottle), + used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L), + BioItemList.getDNASampleFlask(null), + 10000, + 100, + BW_Util.getMachineVoltageFromTier(1)); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java new file mode 100644 index 0000000000..c80c708b5e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java @@ -0,0 +1,177 @@ +package com.github.bartimaeusnek.bartworks.common.loaders.recipes; + +import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.MATERIALS_PER_FUEL; +import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.sHTGR_Fuel; + +import java.util.Arrays; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Util; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; + +public class Centrifuge implements Runnable { + + @Override + public void run() { + + GT_Values.RA.addCentrifugeRecipe( + Materials.Thorium.getDust(1), + GT_Values.NI, + GT_Values.NF, + GT_Values.NF, + Materials.Thorium.getDust(1), + Materials.Thorium.getDust(1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), + GT_Values.NI, + new int[] { 800, 375, 22, 22, 5 }, + 10000, + BW_Util.getMachineVoltageFromTier(4)); + + ItemStack[] pellets = new ItemStack[6]; + Arrays.fill(pellets, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 4)); + + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( + false, + new ItemStack[] { new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3), + GT_Utility.getIntegratedCircuit(17) }, + pellets, + null, + null, + null, + null, + 48000, + 30, + 0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( + false, + new ItemStack[] { new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 5), + GT_Utility.getIntegratedCircuit(17) }, + new ItemStack[] { new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 6) }, + null, + null, + null, + null, + 48000, + 30, + 0); + GT_Values.RA.addCentrifugeRecipe( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 6), + GT_Values.NI, + GT_Values.NF, + GT_Values.NF, + Materials.Lead.getDust(1), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + new int[] { 300 }, + 1200, + 30); + int i = 0; + for (GT_TileEntity_HTGR.HTGRMaterials.Fuel_ fuel : sHTGR_Fuel) { + + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( + false, + new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), + GT_Utility.getIntegratedCircuit(17) }, + new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4) }, + null, + null, + null, + null, + 12000, + 30, + 0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( + false, + new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5), + GT_Utility.getIntegratedCircuit(17) }, + new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 6) }, + null, + null, + null, + null, + 3000, + 30, + 0); + + GT_Values.RA.addCentrifugeRecipe( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 6), + GT_Values.NI, + GT_Values.NF, + fuel.recycledFluid, + fuel.recycledItems[0], + fuel.recycledItems[1], + fuel.recycledItems[2], + fuel.recycledItems[3], + fuel.recycledItems[4], + fuel.recycledItems[5], + fuel.recycleChances, + 1200, + 30); + i += MATERIALS_PER_FUEL; + } + + GT_Values.RA.addCentrifugeRecipe( + GT_Utility.getIntegratedCircuit(17), + null, + new FluidStack(BioCultureLoader.eColi.getFluid(), 1000), + new FluidStack(FluidLoader.BioLabFluidMaterials[1], 10), + BioItemList.getOther(4), + null, + null, + null, + null, + null, + new int[] { 1000 }, + 60 * 20, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addCentrifugeRecipe( + GT_Utility.getIntegratedCircuit(17), + null, + new FluidStack(FluidLoader.BioLabFluidMaterials[1], 1000), + new FluidStack(FluidLoader.BioLabFluidMaterials[3], 250), + null, + null, + null, + null, + null, + null, + null, + 60 * 20, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addCentrifugeRecipe( + GT_Utility.getIntegratedCircuit(17), + null, + new FluidStack(BioCultureLoader.CommonYeast.getFluid(), 1000), + new FluidStack(FluidLoader.BioLabFluidMaterials[2], 10), + null, + null, + null, + null, + null, + null, + null, + 60 * 20, + BW_Util.getMachineVoltageFromTier(3)); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java new file mode 100644 index 0000000000..15cd43e321 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java @@ -0,0 +1,85 @@ +package com.github.bartimaeusnek.bartworks.common.loaders.recipes; + +import net.minecraft.item.ItemStack; + +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; + +public class ChemicalBath implements Runnable { + + @Override + public void run() { + + for (int i = 0; i < Dyes.dyeBrown.getSizeOfFluidList(); ++i) { + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyeRed.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 6), + null, + null, + null, + 64, + 2); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyeGreen.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 7), + null, + null, + null, + 64, + 2); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyePurple.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 8), + null, + null, + null, + 64, + 2); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyeYellow.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 9), + null, + null, + null, + 64, + 2); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyeLime.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 10), + null, + null, + null, + 64, + 2); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyeBrown.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 11), + null, + null, + null, + 64, + 2); + } + + for (int i = 6; i < 11; i++) { + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, i), + Materials.Chlorine.getGas(50), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + null, + null, + null, + 64, + 2); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalReactor.java new file mode 100644 index 0000000000..6361340fee --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalReactor.java @@ -0,0 +1,24 @@ +package com.github.bartimaeusnek.bartworks.common.loaders.recipes; + +import net.minecraftforge.fluids.FluidStack; + +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Util; + +import gregtech.api.enums.GT_Values; +import gregtech.api.util.GT_Utility; + +public class ChemicalReactor implements Runnable { + + @Override + public void run() { + GT_Values.RA.addChemicalRecipe( + GT_Utility.getIntegratedCircuit(10), + null, + new FluidStack(FluidLoader.heatedfulvicAcid, 1000), + new FluidStack(FluidLoader.Kerogen, 1000), + null, + 75, + BW_Util.getMachineVoltageFromTier(2)); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java new file mode 100644 index 0000000000..d56f77fa3c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java @@ -0,0 +1,519 @@ +package com.github.bartimaeusnek.bartworks.common.loaders.recipes; + +import static gregtech.api.enums.Mods.IndustrialCraft2; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraftforge.oredict.OreDictionary; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.common.loaders.RecipeLoader; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_LESU; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_Windmill; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_BioLab; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import ic2.core.Ic2Items; + +public class CraftingRecipes implements Runnable { + + @Override + public void run() { + + Materials[] cables = { // Cable material used in the acid gen, diode and energy distributor below + Materials.Lead, // ULV + Materials.Tin, // LV + Materials.AnnealedCopper, // MV + Materials.Gold, // HV + Materials.Aluminium, // EV + Materials.Tungsten, // IV + Materials.VanadiumGallium, // LuV + Materials.Naquadah, // ZPM + Materials.NaquadahAlloy, // UV + Materials.SuperconductorUV // UHV + }; + + ISubTagContainer[] hulls = { // Plate material used in the acid gen, diode and energy distributor below + Materials.WroughtIron, // ULV + Materials.Steel, // LV + Materials.Aluminium, // MV + Materials.StainlessSteel, // HV + Materials.Titanium, // EV + Materials.TungstenSteel, // IV + WerkstoffLoader.LuVTierMaterial, // LuV + Materials.Iridium, // ZPM + Materials.Osmium, // UV + Materials.Naquadah // UHV + }; + + ItemStack[] bats = { ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_Hull_MV.get(1L), + ItemList.Battery_Hull_HV.get(1L) }; + ItemStack[] chreac = { ItemList.Machine_MV_ChemicalReactor.get(1L), ItemList.Machine_HV_ChemicalReactor.get(1L), + ItemList.Machine_EV_ChemicalReactor.get(1L) }; + + GT_ModHandler.addCraftingRecipe( + new GT_TileEntity_LESU(ConfigHandler.IDOffset, "LESU", "L.E.S.U.").getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "CDC", "SBS", "CFC", 'C', "circuitAdvanced", 'D', ItemList.Cover_Screen.get(1L), 'S', + GT_OreDictUnificator.get(OrePrefixes.cableGt12, Materials.Platinum, 1L), 'B', + new ItemStack(ItemRegistry.BW_BLOCKS[1]), 'F', ItemList.Field_Generator_HV.get(1L) }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.DESTRUCTOPACK), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "CPC", "PLP", "CPC", 'C', "circuitAdvanced", 'P', + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Aluminium, 1L), 'L', + new ItemStack(Items.lava_bucket) }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.DESTRUCTOPACK), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "CPC", "PLP", "CPC", 'C', "circuitAdvanced", 'P', + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Steel, 1L), 'L', + new ItemStack(Items.lava_bucket) }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.ROCKCUTTER_MV), + RecipeLoader.BITSD, + new Object[] { "DS ", "DP ", "DCB", 'D', + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), 'S', + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.TungstenSteel, 1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 1L), 'C', "circuitGood", + 'B', ItemList.IC2_AdvBattery.get(1L) }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.ROCKCUTTER_LV), + RecipeLoader.BITSD, + new Object[] { "DS ", "DP ", "DCB", 'D', + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), 'S', + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Titanium, 1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), 'C', "circuitBasic", 'B', + ItemList.IC2_ReBattery.get(1L) }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.ROCKCUTTER_HV), + RecipeLoader.BITSD, + new Object[] { "DS ", "DP ", "DCB", 'D', + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), 'S', + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Iridium, 1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), 'C', "circuitAdvanced", 'B', + ItemList.IC2_EnergyCrystal.get(1L) }); + + if (ConfigHandler.teslastaff) { + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.TESLASTAFF), + RecipeLoader.BITSD, + new Object[] { "BO ", "OP ", " P", 'O', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUHV, 1L), 'B', + ItemList.Energy_LapotronicOrb.get(1L), 'P', "plateAlloyIridium", }); + } + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.PUMPPARTS, 1, 0), // tube + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { " fG", " G ", "G ", 'G', ItemList.Circuit_Parts_Glass_Tube.get(1L) }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), // motor + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "GLP", "LSd", "PfT", 'G', + GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.Steel, 1L), 'L', + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Steel, 1L), 'S', + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 1L), 'P', + new ItemStack(Blocks.piston), 'T', new ItemStack(ItemRegistry.PUMPPARTS, 1, 0) }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.PUMPBLOCK, 1, 0), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "IPI", "PMP", "ISI", 'I', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Wood, 1L), 'M', + new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), 'S', Ic2Items.ironFurnace }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.WINDMETER), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "SWF", "Sf ", "Ss ", 'S', "stickWood", 'W', + new ItemStack(Blocks.wool, 1, Short.MAX_VALUE), 'F', new ItemStack(Items.string), }); + + for (int i = 0; i < 3; i++) { + Materials cable = cables[i + 2]; + ItemStack machinehull = ItemList.MACHINE_HULLS[i + 2].get(1L); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.acidGens[i], + RecipeLoader.BITSD, + new Object[] { "HRH", "HCH", "HKH", 'H', bats[i], 'K', + GT_OreDictUnificator.get(OrePrefixes.cableGt01, cable, 1L), 'C', machinehull, 'R', + chreac[i] }); + } + + GT_ModHandler.addCraftingRecipe( + ItemRegistry.acidGensLV, + RecipeLoader.BITSD, + new Object[] { "HRH", "KCK", "HKH", 'H', ItemList.Battery_Hull_LV.get(1L), 'K', + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 1L), 'C', + ItemList.Hull_LV.get(1L), 'R', ItemList.Machine_LV_ChemicalReactor.get(1L), }); + + for (int i = 0; i < 9; i++) { + try { + Materials cable = cables[i]; + ItemStack hull = hulls[i] instanceof Materials + ? GT_OreDictUnificator.get(OrePrefixes.plate, hulls[i], 1L) + : ((Werkstoff) hulls[i]).get(OrePrefixes.plate); + ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); + + GT_ModHandler.addCraftingRecipe( + ItemRegistry.energyDistributor[i], + RecipeLoader.BITSD, + new Object[] { "PWP", "WCW", "PWP", 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode12A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode12A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode8A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode8A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode4A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode4A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode2A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode2A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode16A[i], + RecipeLoader.BITSD, + new Object[] { "WHW", "DCD", "PDP", 'H', ItemList.Circuit_Parts_Coil.get(1L), 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), 'P', hull, 'C', + machinehull }); + GT_ModHandler.addCraftingRecipe( + ItemRegistry.diode16A[i], + RecipeLoader.BITSD, + new Object[] { "WHW", "DCD", "PDP", 'H', ItemList.Circuit_Parts_Coil.get(1L), 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), 'P', hull, 'C', + machinehull }); + + } catch (ArrayIndexOutOfBoundsException ignored) { + + } + + } + + String[] stones = { "stone", "stoneSmooth" }; + String[] granites = { "blockGranite", "stoneGranite", "Granite", "granite" }; + for (String granite : granites) { + for (String stone : stones) { + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "SSS", "DfD", " h ", 'S', stone, 'D', + new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "hDf", "SSS", 'S', stone, 'D', + new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "SSS", "DfD", " h ", 'S', stone, 'D', granite, }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "hDf", "SSS", 'S', stone, 'D', granite, }); + } + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "STS", "h f", "SBS", 'S', granite, 'T', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), 'B', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), }); + } + + GT_ModHandler.addCraftingRecipe( + new GT_TileEntity_ManualTrafo( + ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, + "bw.manualtrafo", + StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "SCS", "CHC", "ZCZ", 'S', + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L), 'C', + new ItemStack(ItemRegistry.BW_BLOCKS[2]), 'H', ItemList.Hull_HV.get(1L), 'Z', + "circuitAdvanced" }); + + GT_ModHandler.addCraftingRecipe( + new GT_TileEntity_Windmill( + ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 2, + "bw.windmill", + StatCollector.translateToLocal("tile.bw.windmill.name")).getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "BHB", "WGW", "BWB", 'B', new ItemStack(Blocks.brick_block), 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), 'H', + new ItemStack(Blocks.hopper), 'G', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "STS", "h f", "SBS", 'S', + new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), 'T', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), 'B', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "WLs", "WLh", "WLf", 'L', new ItemStack(Items.leather), 'W', "logWood", }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "WLs", "WLh", "WLf", 'L', new ItemStack(Blocks.carpet), 'W', "logWood", }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "WLs", "WLh", "WLf", 'L', new ItemStack(Items.paper), 'W', "logWood", }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "WEs", "WZh", "WDf", 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "WEs", "WZh", "WDf", 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'E', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "WEs", "WZh", "WDf", 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'E', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "WEs", "WZh", "WDf", 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "WEs", "WZh", "WDf", 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'E', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); + + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.LEATHER_ROTOR), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.WOOL_ROTOR), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.PAPER_ROTOR), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.COMBINED_ROTOR), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.ROTORBLOCK), + RecipeLoader.BITSD, + new Object[] { "WRW", "RGR", "WRW", 'R', GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Iron, 1L), + 'W', "plankWood", 'G', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); + + GT_ModHandler.addCraftingRecipe( + ItemRegistry.THTR, + RecipeLoader.BITSD, + new Object[] { "BZB", "BRB", "BZB", 'B', new ItemStack(GregTech_API.sBlockCasings3, 1, 12), 'R', + GT_ModHandler.getModItem(IndustrialCraft2.ID, "blockGenerator", 1, 5), 'Z', + "circuitUltimate" }); + + GT_ModHandler.addCraftingRecipe( + ItemRegistry.HTGR, + RecipeLoader.BITSD, + new Object[] { "BZB", "BRB", "BZB", 'B', new ItemStack(GregTech_API.sBlockCasings8, 1, 5), 'R', + GT_ModHandler.getModItem(IndustrialCraft2.ID, "blockGenerator", 1, 5), 'Z', + "circuitSuperconductor" }); + + // DNAExtractionModule + GT_ModHandler.addCraftingRecipe( + BioItemList.mBioLabParts[0], + RecipeLoader.BITSD, + new Object[] { "TET", "CFC", "TST", 'T', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), 'E', + ItemList.Emitter_EV.get(1L), 'C', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), 'S', + ItemList.Sensor_EV.get(1L), 'F', ItemList.Field_Generator_EV.get(1L) }); + + // PCRThermoclyclingModule + GT_ModHandler.addCraftingRecipe( + BioItemList.mBioLabParts[1], + RecipeLoader.BITSD, + new Object[] { "NEN", "CFC", "NSN", 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), 'E', + ItemList.Emitter_EV.get(1L), 'C', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), 'S', + ItemList.Sensor_EV.get(1L), 'F', ItemList.Field_Generator_EV.get(1L) }); + + // PlasmidSynthesisModule + GT_ModHandler.addCraftingRecipe( + BioItemList.mBioLabParts[2], + RecipeLoader.BITSD, + new Object[] { "SFE", "CPC", "NFN", 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), 'C', + "circuit" + Materials.Data, 'F', ItemList.Field_Generator_EV.get(1L), 'E', + ItemList.Emitter_EV.get(1L), 'S', ItemList.Sensor_EV.get(1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), }); + // TransformationModule + GT_ModHandler.addCraftingRecipe( + BioItemList.mBioLabParts[3], + RecipeLoader.BITSD, + new Object[] { "SFE", "CPC", "NFN", 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), 'C', + "circuit" + Materials.Master, 'F', ItemList.Field_Generator_LuV.get(1L), 'E', + ItemList.Emitter_LuV.get(1L), 'S', ItemList.Sensor_LuV.get(1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), }); + + // ClonalCellularSynthesisModule + GT_ModHandler.addCraftingRecipe( + BioItemList.mBioLabParts[4], + RecipeLoader.BITSD, + new Object[] { "FEF", "CPC", "FSF", 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), 'C', + "circuit" + Materials.Master, 'F', ItemList.Field_Generator_LuV.get(1L), 'E', + ItemList.Emitter_LuV.get(1L), 'S', ItemList.Sensor_LuV.get(1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), }); + + GT_ModHandler.addCraftingRecipe( + new GT_TileEntity_BioVat( + ConfigHandler.IDOffset + GT_Values.VN.length * 7, + "bw.biovat", + StatCollector.translateToLocal("tile.biovat.name")).getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "GCG", "KHK", "GCG", 'G', new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 'C', + "circuit" + Materials.Data, 'K', + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Silver, 1L), 'H', + ItemList.MACHINE_HULLS[3].get(1L) }); + + ItemStack[] Pistons2 = { ItemList.Electric_Piston_HV.get(1L), ItemList.Electric_Piston_EV.get(1L), + ItemList.Electric_Piston_IV.get(1L), ItemList.Electric_Piston_LuV.get(1L), + ItemList.Electric_Piston_ZPM.get(1L), ItemList.Electric_Piston_UV.get(1L) }; + ItemStack[] BioLab2 = new ItemStack[GT_Values.VN.length - 3]; + ItemStack[] RadioHatch2 = new ItemStack[GT_Values.VN.length - 3]; + Materials[] cables2 = { Materials.Gold, Materials.Aluminium, Materials.Tungsten, Materials.VanadiumGallium, + Materials.Naquadah, Materials.NaquadahAlloy, Materials.SuperconductorUHV }; + Materials[] hulls2 = { Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, Materials.Chrome, + Materials.Iridium, Materials.Osmium, Materials.Naquadah }; + Materials[] wireMat2 = { Materials.Kanthal, Materials.Nichrome, Materials.TungstenSteel, Materials.Naquadah, + Materials.NaquadahAlloy, Materials.SuperconductorUHV }; + Materials[] circuits2 = { Materials.Advanced, Materials.Data, Materials.Elite, Materials.Master, + Materials.Ultimate, Materials.SuperconductorUHV }; + + for (int i = 3; i < GT_Values.VN.length - 1; i++) { + // 12625 + BioLab2[(i - 3)] = new GT_MetaTileEntity_BioLab( + ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i, + "bw.biolab" + GT_Values.VN[i], + GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.biolab.name"), + i).getStackForm(1L); + RadioHatch2[(i - 3)] = new GT_MetaTileEntity_RadioHatch( + ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i, + "bw.radiohatch" + GT_Values.VN[i], + GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.radiohatch.name"), + i).getStackForm(1L); + try { + ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); + GT_ModHandler.addCraftingRecipe( + BioLab2[(i - 3)], + RecipeLoader.BITSD, + new Object[] { "PFP", "WCW", "OGO", 'F', + GT_OreDictUnificator.get(OrePrefixes.frameGt, hulls2[(i - 3)], 1L), 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt01, wireMat2[(i - 3)], 1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G', + "circuit" + circuits2[(i - 3)], 'C', machinehull }); + GT_ModHandler.addCraftingRecipe( + RadioHatch2[(i - 3)], + RecipeLoader.BITSD, + new Object[] { "DPD", "DCD", "DKD", 'D', + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), 'C', machinehull, + 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cables2[(i - 3)], 1L), 'P', + Pistons2[(i - 3)] }); + } catch (ArrayIndexOutOfBoundsException ignored) { + + } + } + + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java new file mode 100644 index 0000000000..f9dbbaa53d --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java @@ -0,0 +1,170 @@ +package com.github.bartimaeusnek.bartworks.common.loaders.recipes; + +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; + +public class Electrolyzer implements Runnable { + + @Override + public void run() { + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.Forsterit.get(OrePrefixes.dust, 7), + GT_Values.NI, + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnesium, 2L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 200, + 90); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.RedZircon.get(OrePrefixes.dust, 6), + GT_Values.NI, + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + WerkstoffLoader.Zirconium.get(OrePrefixes.dust, 1), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 250, + 90); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.Fayalit.get(OrePrefixes.dust, 7), + GT_Values.NI, + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 2L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 320, + 90); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.Prasiolite.get(OrePrefixes.dust, 16), + GT_Values.NI, + GT_Values.NF, + GT_Values.NF, + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 5L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 580, + 90); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.Hedenbergit.get(OrePrefixes.dust, 10), + GT_Values.NI, + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Calcium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 2L), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 300, + 90); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.FuchsitAL.get(OrePrefixes.dust, 21), + ItemList.Cell_Empty.get(2), + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2), + GT_Values.NI, + GT_Values.NI, + null, + 390, + 120); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.FuchsitCR.get(OrePrefixes.dust, 21), + ItemList.Cell_Empty.get(2), + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2), + GT_Values.NI, + GT_Values.NI, + null, + 460, + 120); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.VanadioOxyDravit.get(OrePrefixes.dust, 53), + ItemList.Cell_Empty.get(3), + GT_Values.NF, + Materials.Oxygen.getGas(19000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Vanadium, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), + null, + 710, + 120); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.ChromoAluminoPovondrait.get(OrePrefixes.dust, 53), + ItemList.Cell_Empty.get(3), + GT_Values.NF, + Materials.Oxygen.getGas(19000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), + null, + 720, + 120); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.FluorBuergerit.get(OrePrefixes.dust, 50), + ItemList.Cell_Empty.get(3), + GT_Values.NF, + Materials.Oxygen.getGas(6000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fluorine, 3), + null, + 730, + 120); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.Olenit.get(OrePrefixes.dust, 51), + ItemList.Cell_Empty.get(1), + GT_Values.NF, + Materials.Oxygen.getGas(1000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 9L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 1), + GT_Values.NI, + null, + 790, + 120); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java new file mode 100644 index 0000000000..2505c369e2 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java @@ -0,0 +1,37 @@ +package com.github.bartimaeusnek.bartworks.common.loaders.recipes; + +import static gregtech.api.enums.Mods.CropLoadCore; + +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import com.github.bartimaeusnek.bartworks.util.BW_Util; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; + +public class Extractor implements Runnable { + + @Override + public void run() { + List oreCropVine = OreDictionary.getOres("cropVine", false); + if (CropLoadCore.isModLoaded() && !oreCropVine.isEmpty()) { + for (ItemStack stack : oreCropVine) { + GT_Values.RA.addExtractorRecipe( + BW_Util.setStackSize(stack, 12), + BioItemList.getOther(1), + 500, + BW_Util.getMachineVoltageFromTier(3)); + } + } + + GT_Values.RA.addExtractorRecipe( + ItemList.Circuit_Chip_Stemcell.get(1L), + BioItemList.getOther(4), + 500, + BW_Util.getMachineVoltageFromTier(6)); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FakeRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FakeRecipes.java new file mode 100644 index 0000000000..1df03d10f2 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FakeRecipes.java @@ -0,0 +1,11 @@ +package com.github.bartimaeusnek.bartworks.common.loaders.recipes; + +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR; + +public class FakeRecipes implements Runnable { + + @Override + public void run() { + GT_TileEntity_HTGR.HTGRMaterials.register_fake_THR_Recipes(); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java new file mode 100644 index 0000000000..6d23bdfb91 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java @@ -0,0 +1,22 @@ +package com.github.bartimaeusnek.bartworks.common.loaders.recipes; + +import net.minecraftforge.fluids.FluidStack; + +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Util; + +import gregtech.api.enums.GT_Values; +import gregtech.api.util.GT_Utility; + +public class FluidHeater implements Runnable { + + @Override + public void run() { + GT_Values.RA.addFluidHeaterRecipe( + GT_Utility.getIntegratedCircuit(10), + new FluidStack(FluidLoader.fulvicAcid, 1000), + new FluidStack(FluidLoader.heatedfulvicAcid, 1000), + 90, + BW_Util.getMachineVoltageFromTier(2)); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java new file mode 100644 index 0000000000..be00d552de --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java @@ -0,0 +1,80 @@ +package com.github.bartimaeusnek.bartworks.common.loaders.recipes; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Util; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; + +public class FluidSolidifier implements Runnable { + + @Override + public void run() { + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(Blocks.lapis_block), + Materials.Iron.getMolten(1296L), + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), + 100, + BW_Util.getMachineVoltageFromTier(3)); + + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.Titanium.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), + 800, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.TungstenSteel.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), + 800, + BW_Util.getMachineVoltageFromTier(4)); + + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + WerkstoffLoader.LuVTierMaterial.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), + 800, + BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.Iridium.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), + 800, + BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.Osmium.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), + 800, + BW_Util.getMachineVoltageFromTier(7)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.Neutronium.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), + 800, + BW_Util.getMachineVoltageFromTier(8)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.CosmicNeutronium.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), + 800, + BW_Util.getMachineVoltageFromTier(9)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.Infinity.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 15), + 800, + BW_Util.getMachineVoltageFromTier(10)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.TranscendentMetal.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[1], 1, 0), + 800, + BW_Util.getMachineVoltageFromTier(11)); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java new file mode 100644 index 0000000000..744b18a175 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java @@ -0,0 +1,60 @@ +package com.github.bartimaeusnek.bartworks.common.loaders.recipes; + +import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.MATERIALS_PER_FUEL; +import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.sHTGR_Fuel; + +import net.minecraft.item.ItemStack; + +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; + +public class FormingPress implements Runnable { + + @Override + public void run() { + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials), + Materials.Graphite.getDust(64), + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1), + 40, + 30); + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1), + Materials.Silicon.getDust(64), + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2), + 40, + 30); + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2), + Materials.Graphite.getDust(64), + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3), + 40, + 30); + + int i = 0; + for (GT_TileEntity_HTGR.HTGRMaterials.Fuel_ fuel : sHTGR_Fuel) { + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i), + Materials.Carbon.getDust(64), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), + 40, + 30); + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), + Materials.Silicon.getDust(64), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), + 40, + 30); + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), + Materials.Graphite.getDust(64), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), + 40, + 30); + i += MATERIALS_PER_FUEL; + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java new file mode 100644 index 0000000000..7b647d79af --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java @@ -0,0 +1,24 @@ +package com.github.bartimaeusnek.bartworks.common.loaders.recipes; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import com.github.bartimaeusnek.bartworks.util.BW_Util; + +import gregtech.api.enums.GT_Values; +import gregtech.api.util.GT_Utility; + +public class LaserEngraver implements Runnable { + + @Override + public void run() { + GT_Values.RA.addLaserEngraverRecipe( + new ItemStack(Items.emerald), + GT_Utility.getIntegratedCircuit(17), + BioItemList.getPlasmidCell(null), + 100, + BW_Util.getMachineVoltageFromTier(1)); + + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java new file mode 100644 index 0000000000..4cf4f691c1 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java @@ -0,0 +1,64 @@ +package com.github.bartimaeusnek.bartworks.common.loaders.recipes; + +import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.MATERIALS_PER_FUEL; +import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.sHTGR_Fuel; +import static gregtech.api.enums.Mods.Gendustry; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Util; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; + +public class Mixer implements Runnable { + + @Override + public void run() { + GT_Values.RA.addMixerRecipe( + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 10), + Materials.Uranium235.getDust(1), + GT_Utility.getIntegratedCircuit(2), + null, + null, + null, + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials), + 400, + 30); + + int i = 0; + for (GT_TileEntity_HTGR.HTGRMaterials.Fuel_ fuel : sHTGR_Fuel) { + GT_Values.RA.addMixerRecipe( + new ItemStack[] { fuel.mainItem, fuel.secondaryItem, GT_Utility.getIntegratedCircuit(1) }, + null, + new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i) }, + null, + 400, + 30); + i += MATERIALS_PER_FUEL; + } + + if (Gendustry.isModLoaded()) { + GT_Values.RA.addMixerRecipe( + GT_Utility.getIntegratedCircuit(17), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Radon, 1L), + null, + null, + FluidRegistry.getFluidStack("liquiddna", 1000), + new FluidStack(FluidLoader.BioLabFluidMaterials[0], 2000), + Materials.Empty.getCells(1), + 500, + BW_Util.getMachineVoltageFromTier(3)); + } + + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java new file mode 100644 index 0000000000..35c99413e4 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java @@ -0,0 +1,82 @@ +package com.github.bartimaeusnek.bartworks.common.loaders.recipes; + +import net.minecraft.item.ItemStack; + +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Util; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; + +public class Pulverizer implements Runnable { + + @Override + public void run() { + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Titanium.getDust(8) }, + null, + 800, + BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.TungstenSteel.getDust(8) }, + null, + 800, + BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), + WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.dust, 8) }, + null, + 800, + BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Iridium.getDust(8) }, + null, + 800, + BW_Util.getMachineVoltageFromTier(7)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Osmium.getDust(8) }, + null, + 800, + BW_Util.getMachineVoltageFromTier(8)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Neutronium.getDust(8) }, + null, + 800, + BW_Util.getMachineVoltageFromTier(9)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.CosmicNeutronium.getDust(8) }, + null, + 800, + BW_Util.getMachineVoltageFromTier(10)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 15), + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Infinity.getDust(8) }, + null, + 800, + BW_Util.getMachineVoltageFromTier(11)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[1], 1, 0), + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.TranscendentMetal.getDust(8) }, + null, + 800, + BW_Util.getMachineVoltageFromTier(12)); + + for (int i = 6; i < 11; i++) { + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, i), + new ItemStack[] { Materials.BorosilicateGlass.getDust(9) }, + null, + 400, + BW_Util.getMachineVoltageFromTier(1)); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/PyrolyseOven.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/PyrolyseOven.java new file mode 100644 index 0000000000..812b90bfb8 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/PyrolyseOven.java @@ -0,0 +1,24 @@ +package com.github.bartimaeusnek.bartworks.common.loaders.recipes; + +import net.minecraftforge.fluids.FluidStack; + +import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; +import com.github.bartimaeusnek.bartworks.util.BW_Util; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; + +public class PyrolyseOven implements Runnable { + + @Override + public void run() { + GT_Values.RA.addPyrolyseRecipe( + Materials.Wood.getDust(10), + new FluidStack(FluidLoader.Kerogen, 1000), + 10, + null, + Materials.Oil.getFluid(1000), + 105, + BW_Util.getMachineVoltageFromTier(3)); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java index 0cfb24d44c..af79cbc208 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -63,21 +63,6 @@ public class RendererPacket extends GT_Packet { .array(); } - // /** - // * only use in a debug enviroment, does not do anything on its own. - // * @param buffer - // */ - // public void decodetest (byte[] buffer){ - // this.coords=new - // Coords(ByteBuffer.wrap(buffer).getInt(0),ByteBuffer.wrap(buffer).getShort(4),ByteBuffer.wrap(buffer).getInt(6),ByteBuffer.wrap(buffer).getInt(10)); - // int[] rgb = {ByteBuffer.wrap(buffer).get(14)-Byte.MIN_VALUE, - // ByteBuffer.wrap(buffer).get(15)-Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(16)-Byte.MIN_VALUE}; - // this.integer= BW_Util.getColorFromRGBArray(rgb); - // this.removal=ByteBuffer.wrap(buffer).get(17); - // - // byte checksum = (byte) (coords.x%25+coords.y%25+coords.z%25+coords.wID%25+integer%25+removal); - // } - @Override public GT_Packet decode(ByteArrayDataInput dataInput) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java index e735a93dc9..a04d70f6aa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java @@ -13,7 +13,11 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; -import static net.minecraftforge.common.util.ForgeDirection.*; +import static net.minecraftforge.common.util.ForgeDirection.DOWN; +import static net.minecraftforge.common.util.ForgeDirection.EAST; +import static net.minecraftforge.common.util.ForgeDirection.NORTH; +import static net.minecraftforge.common.util.ForgeDirection.SOUTH; +import static net.minecraftforge.common.util.ForgeDirection.WEST; import java.util.Comparator; import java.util.PriorityQueue; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index 8641a78adf..c977453f68 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -25,7 +25,13 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.*; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidEvent; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; +import net.minecraftforge.fluids.IFluidTank; import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; import com.github.bartimaeusnek.bartworks.API.ITileDropsContent; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java index d3160d14a7..32f214a941 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java @@ -19,7 +19,12 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.*; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidEvent; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; +import net.minecraftforge.fluids.IFluidTank; import gregtech.api.util.GT_Utility; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java deleted file mode 100644 index b9b8ba24b3..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java +++ /dev/null @@ -1,488 +0,0 @@ -/// * -// * Copyright (c) 2019 bartimaeusnek -// * -// * Permission is hereby granted, free of charge, to any person obtaining a copy -// * of this software and associated documentation files (the "Software"), to deal -// * in the Software without restriction, including without limitation the rights -// * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// * copies of the Software, and to permit persons to whom the Software is -// * furnished to do so, subject to the following conditions: -// * -// * The above copyright notice and this permission notice shall be included in all -// * copies or substantial portions of the Software. -// * -// * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// * SOFTWARE. -// */ -// -// package com.github.bartimaeusnek.bartworks.common.tileentities.classic; -// -// import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; -// import com.github.bartimaeusnek.bartworks.API.ITileDropsContent; -// import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; -// import com.github.bartimaeusnek.bartworks.MainMod; -// import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -// import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -// import com.github.bartimaeusnek.bartworks.util.ConnectedBlocksChecker; -// import cpw.mods.fml.common.FMLCommonHandler; -// import cpw.mods.fml.relauncher.Side; -// import gregtech.api.interfaces.tileentity.IEnergyConnected; -// import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -// import gregtech.api.objects.XSTR; -// import net.minecraft.block.Block; -// import net.minecraft.client.renderer.texture.IIconRegister; -// import net.minecraft.entity.player.EntityPlayer; -// import net.minecraft.inventory.IInventory; -// import net.minecraft.item.ItemStack; -// import net.minecraft.tileentity.TileEntity; -// import net.minecraft.util.StatCollector; -// import net.minecraft.world.World; -// import net.minecraft.world.biome.BiomeGenBase; -// import net.minecraftforge.fluids.IFluidHandler; -// -// import java.nio.ByteBuffer; -// import java.util.ArrayList; -// -// -// public class BW_TileEntity_LESU_Redux extends TileEntity implements ITileHasDifferentTextureSides, -// ITileAddsInformation, ITileDropsContent, IEnergyConnected { -// -// public ConnectedBlocksChecker connectedcells; -// public ItemStack[] circuits = new ItemStack[5]; -// private long[] storage; -// private long input; -// private long output; -// ByteBuffer eu; -// -// @Override -// public String[] getInfoData() { -// ArrayList e = new ArrayList<>(); -// String[] dsc = StatCollector.translateToLocal("tooltip.tile.lesu.0.name").split(";"); -// for (int i = 0; i < dsc.length; i++) { -// e.add(dsc[i]); -// } -// e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + ConfigHandler.energyPerCell + "EU"); -// dsc = StatCollector.translateToLocal("tooltip.tile.lesu.2.name").split(";"); -// for (int i = 0; i < dsc.length; i++) { -// e.add(dsc[i]); -// } -// e.add(ChatColorHelper.RED + StatCollector.translateToLocal("tooltip.tile.lesu.3.name")); -// e.add(StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"); -// return e.toArray(new String[0]); -// } -// -// @Override -// public void registerBlockIcons(IIconRegister par1IconRegister) { -// par1IconRegister.registerIcon(MainMod.MOD_ID + ":LESU_CASING_" + i); -// } -// -// @Override -// public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { -// if (inputEnergyFrom(aSide)){ -// -// } -// return 0; -// } -// -// @Override -// public boolean inputEnergyFrom(byte b) { -// return true; -// } -// -// @Override -// public boolean outputsEnergyTo(byte b) { -// return false; -// } -// -// @Override -// public byte getColorization() { -// return 0; -// } -// -// @Override -// public byte setColorization(byte b) { -// return 0; -// } -// -// @Override -// public World getWorld() { -// return null; -// } -// -// @Override -// public int getXCoord() { -// return 0; -// } -// -// @Override -// public short getYCoord() { -// return 0; -// } -// -// @Override -// public int getZCoord() { -// return 0; -// } -// -// @Override -// public boolean isServerSide() { -// return !isClientSide(); -// } -// -// @Override -// public boolean isClientSide() { -// if (getWorld() != null) -// return getWorld().isRemote; -// return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; -// } -// -// @Override -// public int getRandomNumber(int i) { -// return new XSTR().nextInt(i); -// } -// -// @Override -// public TileEntity getTileEntity(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public TileEntity getTileEntityOffset(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public TileEntity getTileEntityAtSide(byte b) { -// return null; -// } -// -// @Override -// public TileEntity getTileEntityAtSideAndDistance(byte b, int i) { -// return null; -// } -// -// @Override -// public IInventory getIInventory(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public IInventory getIInventoryOffset(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public IInventory getIInventoryAtSide(byte b) { -// return null; -// } -// -// @Override -// public IInventory getIInventoryAtSideAndDistance(byte b, int i) { -// return null; -// } -// -// @Override -// public IFluidHandler getITankContainer(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public IFluidHandler getITankContainerOffset(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public IFluidHandler getITankContainerAtSide(byte b) { -// return null; -// } -// -// @Override -// public IFluidHandler getITankContainerAtSideAndDistance(byte b, int i) { -// return null; -// } -// -// @Override -// public IGregTechTileEntity getIGregTechTileEntity(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public IGregTechTileEntity getIGregTechTileEntityOffset(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public IGregTechTileEntity getIGregTechTileEntityAtSide(byte b) { -// return null; -// } -// -// @Override -// public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte b, int i) { -// return null; -// } -// -// @Override -// public Block getBlock(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public Block getBlockOffset(int i, int i1, int i2) { -// return null; -// } -// -// @Override -// public Block getBlockAtSide(byte b) { -// return null; -// } -// -// @Override -// public Block getBlockAtSideAndDistance(byte b, int i) { -// return null; -// } -// -// @Override -// public byte getMetaID(int i, int i1, int i2) { -// return 0; -// } -// -// @Override -// public byte getMetaIDOffset(int i, int i1, int i2) { -// return 0; -// } -// -// @Override -// public byte getMetaIDAtSide(byte b) { -// return 0; -// } -// -// @Override -// public byte getMetaIDAtSideAndDistance(byte b, int i) { -// return 0; -// } -// -// @Override -// public byte getLightLevel(int i, int i1, int i2) { -// return 0; -// } -// -// @Override -// public byte getLightLevelOffset(int i, int i1, int i2) { -// return 0; -// } -// -// @Override -// public byte getLightLevelAtSide(byte b) { -// return 0; -// } -// -// @Override -// public byte getLightLevelAtSideAndDistance(byte b, int i) { -// return 0; -// } -// -// @Override -// public boolean getOpacity(int i, int i1, int i2) { -// return false; -// } -// -// @Override -// public boolean getOpacityOffset(int i, int i1, int i2) { -// return false; -// } -// -// @Override -// public boolean getOpacityAtSide(byte b) { -// return false; -// } -// -// @Override -// public boolean getOpacityAtSideAndDistance(byte b, int i) { -// return false; -// } -// -// @Override -// public boolean getSky(int i, int i1, int i2) { -// return false; -// } -// -// @Override -// public boolean getSkyOffset(int i, int i1, int i2) { -// return false; -// } -// -// @Override -// public boolean getSkyAtSide(byte b) { -// return false; -// } -// -// @Override -// public boolean getSkyAtSideAndDistance(byte b, int i) { -// return false; -// } -// -// @Override -// public boolean getAir(int i, int i1, int i2) { -// return false; -// } -// -// @Override -// public boolean getAirOffset(int i, int i1, int i2) { -// return false; -// } -// -// @Override -// public boolean getAirAtSide(byte b) { -// return false; -// } -// -// @Override -// public boolean getAirAtSideAndDistance(byte b, int i) { -// return false; -// } -// -// @Override -// public BiomeGenBase getBiome() { -// return null; -// } -// -// @Override -// public BiomeGenBase getBiome(int i, int i1) { -// return null; -// } -// -// @Override -// public int getOffsetX(byte b, int i) { -// return 0; -// } -// -// @Override -// public short getOffsetY(byte b, int i) { -// return 0; -// } -// -// @Override -// public int getOffsetZ(byte b, int i) { -// return 0; -// } -// -// @Override -// public boolean isDead() { -// return false; -// } -// -// @Override -// public void sendBlockEvent(byte b, byte b1) { -// -// } -// -// @Override -// public long getTimer() { -// return 0; -// } -// -// @Override -// public void setLightValue(byte b) { -// -// } -// -// @Override -// public boolean isInvalidTileEntity() { -// return false; -// } -// -// @Override -// public boolean openGUI(EntityPlayer entityPlayer, int i) { -// return false; -// } -// -// @Override -// public boolean openGUI(EntityPlayer entityPlayer) { -// return false; -// } -// -// @Override -// public int[] getAccessibleSlotsFromSide(int p_94128_1_) { -// return new int[0]; -// } -// -// @Override -// public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) { -// return false; -// } -// -// @Override -// public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) { -// return false; -// } -// -// @Override -// public int getSizeInventory() { -// return 0; -// } -// -// @Override -// public ItemStack getStackInSlot(int p_70301_1_) { -// return null; -// } -// -// @Override -// public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { -// return null; -// } -// -// @Override -// public ItemStack getStackInSlotOnClosing(int p_70304_1_) { -// return null; -// } -// -// @Override -// public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { -// -// } -// -// @Override -// public String getInventoryName() { -// return null; -// } -// -// @Override -// public boolean hasCustomInventoryName() { -// return false; -// } -// -// @Override -// public int getInventoryStackLimit() { -// return 0; -// } -// -// @Override -// public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { -// return false; -// } -// -// @Override -// public void openInventory() { -// -// } -// -// @Override -// public void closeInventory() { -// -// } -// -// @Override -// public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { -// return false; -// } -// -// @Override -// public int[] getDropSlots() { -// return new int[0]; -// } -// } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index c5f85fc6df..ecba268096 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -15,9 +15,17 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTiered; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.isAir; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAnyMeta; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import java.util.ArrayList; @@ -47,7 +55,11 @@ import com.github.bartimaeusnek.bartworks.common.items.LabParts; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.net.RendererPacket; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; -import com.github.bartimaeusnek.bartworks.util.*; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.BioCulture; +import com.github.bartimaeusnek.bartworks.util.Coords; +import com.github.bartimaeusnek.bartworks.util.MathUtils; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 98d1189639..8f46893b89 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -17,9 +17,16 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADDED import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTieredMixed; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_HatchElement.Energy; +import static gregtech.api.enums.GT_HatchElement.InputBus; +import static gregtech.api.enums.GT_HatchElement.InputHatch; +import static gregtech.api.enums.GT_HatchElement.Maintenance; +import static gregtech.api.enums.GT_HatchElement.OutputBus; import static gregtech.api.enums.SoundResource.IC2_MACHINES_MAGNETIZER_LOOP; -import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_GLOW; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import java.util.ArrayList; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index c4e89b4105..b1f35e7329 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -15,9 +15,15 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.isAir; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import java.util.ArrayList; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index a29eebb947..baa7013d8c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -10,7 +10,10 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_VIA_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.GT_Values.AuthorKuba; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; @@ -47,7 +50,10 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMul import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; import gregtech.api.render.TextureFactory; -import gregtech.api.util.*; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase { @@ -130,7 +136,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase false, true).useModularUI(true); private static final int HELIUM_NEEDED = 730000; - private static final int powerUsage = BW_Util.getMachineVoltageFromTier(6); + public static final int powerUsage = BW_Util.getMachineVoltageFromTier(6); private static final int maxcapacity = 720000; private static final int mincapacity = maxcapacity / 10; private int HeliumSupply; @@ -480,7 +486,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } } - static class Fuel_ { + public static class Fuel_ { public String sName; public String sEnglish; @@ -516,15 +522,15 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } } - static final Base_[] sHTGR_Bases = new Base_[] { new Base_("HTGRFuelMixture", "HTGR fuel mixture"), + public static final Base_[] sHTGR_Bases = new Base_[] { new Base_("HTGRFuelMixture", "HTGR fuel mixture"), new Base_("BISOPebbleCompound", "BISO pebble compound"), new Base_("TRISOPebbleCompound", "TRISO pebble compound"), new Base_("TRISOBall", "TRISO ball"), new Base_("TRISOPebble", "TRISO pebble"), new Base_("BurnedOutTRISOBall", "Burned out TRISO Ball"), new Base_("BurnedOutTRISOPebble", "Burned out TRISO Pebble"), }; - static final int MATERIALS_PER_FUEL = sHTGR_Bases.length; + public static final int MATERIALS_PER_FUEL = sHTGR_Bases.length; static final int USABLE_FUEL_INDEX = 4; static final int BURNED_OUT_FUEL_INDEX = 5; - static final Fuel_[] sHTGR_Fuel = new Fuel_[] { + public static final Fuel_[] sHTGR_Fuel = new Fuel_[] { new Fuel_( "Thorium", "Thorium", @@ -557,7 +563,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase Materials.Plutonium.getDust(1) }, new int[] { 9900 / 4, 9900 / 4, 9900 / 4, 5000 / 4, 5000 / 4 }, "Multiplies coolant by 2"), }; - static final CustomHTGRSimpleSubItemClass aHTGR_Materials; + public static final CustomHTGRSimpleSubItemClass aHTGR_Materials; static final ArrayList aHTGR_Localizations = new ArrayList<>(); static { @@ -584,69 +590,11 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase GameRegistry.registerItem(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, "bw.HTGRMaterials"); } - public static void registerTHR_Recipes() { - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { new ItemStack(GregTech_API.sBlockCasings3, 1, 12), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Europium, 6), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 24) }, - Materials.Lead.getMolten(864), - new ItemStack(GregTech_API.sBlockCasings8, 1, 5), - 200, - BW_Util.getMachineVoltageFromTier(6)); + public static void register_fake_THR_Recipes() { + int i = 0; for (Fuel_ fuel : sHTGR_Fuel) { - GT_Values.RA.addMixerRecipe( - new ItemStack[] { fuel.mainItem, fuel.secondaryItem, GT_Utility.getIntegratedCircuit(1) }, - null, - new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i) }, - null, - 400, - 30); - GT_Values.RA.addFormingPressRecipe( - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i), - Materials.Carbon.getDust(64), - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), - 40, - 30); - GT_Values.RA.addFormingPressRecipe( - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), - Materials.Silicon.getDust(64), - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), - 40, - 30); - GT_Values.RA.addFormingPressRecipe( - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), - Materials.Graphite.getDust(64), - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), - 40, - 30); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( - false, - new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), - GT_Utility.getIntegratedCircuit(17) }, - new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4) }, - null, - null, - null, - null, - 12000, - 30, - 0); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( - false, - new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5), - GT_Utility.getIntegratedCircuit(17) }, - new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 6) }, - null, - null, - null, - null, - 3000, - 30, - 0); + fakeRecipeMap.addFakeRecipe( false, new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4) }, @@ -657,21 +605,8 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase 72000, powerUsage, 0); - GT_Values.RA.addCentrifugeRecipe( - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 6), - GT_Values.NI, - GT_Values.NF, - fuel.recycledFluid, - fuel.recycledItems[0], - fuel.recycledItems[1], - fuel.recycledItems[2], - fuel.recycledItems[3], - fuel.recycledItems[4], - fuel.recycledItems[5], - fuel.recycleChances, - 1200, - 30); - i += sHTGR_Bases.length; + + i += MATERIALS_PER_FUEL; } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index caa178b893..abf205bcb0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -15,9 +15,14 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 4616dfabf8..89218b7d36 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -14,11 +14,12 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -import java.util.Arrays; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -26,7 +27,6 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MathUtils; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; @@ -35,9 +35,7 @@ import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -46,8 +44,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMul import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase { @@ -388,7 +384,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase public static class THTRMaterials { - static final SimpleSubItemClass aTHTR_Materials = new SimpleSubItemClass( + public static final SimpleSubItemClass aTHTR_Materials = new SimpleSubItemClass( "BISOPelletCompound", // 0 "BISOPelletBall", // 1 "TRISOPelletCompound", // 2 @@ -403,97 +399,5 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase public static void registeraTHR_Materials() { GameRegistry.registerItem(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, "bw.THTRMaterials"); } - - public static void registerTHR_Recipes() { - GT_Values.RA.addCentrifugeRecipe( - Materials.Thorium.getDust(1), - GT_Values.NI, - GT_Values.NF, - GT_Values.NF, - Materials.Thorium.getDust(1), - Materials.Thorium.getDust(1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), - GT_Values.NI, - new int[] { 800, 375, 22, 22, 5 }, - 10000, - BW_Util.getMachineVoltageFromTier(4)); - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 6), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1) }, - Materials.Concrete.getMolten(1296), - new ItemStack(GregTech_API.sBlockCasings3, 1, 12), - 40, - BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addMixerRecipe( - WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 10), - Materials.Uranium235.getDust(1), - GT_Utility.getIntegratedCircuit(2), - null, - null, - null, - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials), - 400, - 30); - GT_Values.RA.addFormingPressRecipe( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials), - Materials.Graphite.getDust(64), - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1), - 40, - 30); - GT_Values.RA.addFormingPressRecipe( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1), - Materials.Silicon.getDust(64), - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2), - 40, - 30); - GT_Values.RA.addFormingPressRecipe( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2), - Materials.Graphite.getDust(64), - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3), - 40, - 30); - ItemStack[] pellets = new ItemStack[6]; - Arrays.fill(pellets, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 4)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( - false, - new ItemStack[] { new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3), - GT_Utility.getIntegratedCircuit(17) }, - pellets, - null, - null, - null, - null, - 48000, - 30, - 0); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( - false, - new ItemStack[] { new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 5), - GT_Utility.getIntegratedCircuit(17) }, - new ItemStack[] { new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 6) }, - null, - null, - null, - null, - 48000, - 30, - 0); - GT_Values.RA.addCentrifugeRecipe( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 6), - GT_Values.NI, - GT_Values.NF, - GT_Values.NF, - Materials.Lead.getDust(1), - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - new int[] { 300 }, - 1200, - 30); - } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 8c54264fb7..8988165dd9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -14,7 +14,12 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAnyMeta; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofTileAdder; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.GT_Values.V; import java.util.ArrayList; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index aec315d67c..c0fe57a7cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -18,13 +18,27 @@ import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.ge import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static com.gtnewhorizon.structurelib.structure.StructureUtility.withChannel; -import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_HatchElement.InputBus; +import static gregtech.api.enums.GT_HatchElement.InputHatch; +import static gregtech.api.enums.GT_HatchElement.Maintenance; +import static gregtech.api.enums.GT_HatchElement.Muffler; +import static gregtech.api.enums.GT_HatchElement.OutputBus; +import static gregtech.api.enums.GT_HatchElement.OutputHatch; import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.enums.Mods.TecTech; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofCoil; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; import net.minecraft.entity.player.EntityPlayer; @@ -35,7 +49,6 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; @@ -50,10 +63,16 @@ import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.Materials; +import gregtech.api.enums.Mods; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.*; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OverclockCalculator; @@ -62,7 +81,7 @@ import gregtech.api.util.GT_Utility; @Optional.Interface( iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", - modid = "tectech", + modid = Mods.Names.TECTECH, striprefs = true) public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { @@ -295,7 +314,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = null; FluidStack[] tFluids = this.getStoredFluids().toArray(new FluidStack[0]); - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) + long nominalV = TecTech.isModLoaded() ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); @@ -467,7 +486,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - if (LoaderReference.tectech) { + if (TecTech.isModLoaded()) { this.getTecTechEnergyMultis().clear(); this.getTecTechEnergyTunnels().clear(); } @@ -486,7 +505,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock if (mMaintenanceHatches.size() != 1) return false; - if (LoaderReference.tectech && this.glasTier < 8) + if (TecTech.isModLoaded() && this.glasTier < 8) if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) return false; @@ -494,7 +513,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) if (this.glasTier < hatchEnergy.mTier) return false; - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) + long nominalV = TecTech.isModLoaded() ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); this.mHeatingCapacity = (int) getCoilLevel().getHeat() + 100 * (BW_Util.getTier(nominalV) - 2); @@ -502,7 +521,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock } @SuppressWarnings("rawtypes") - @Optional.Method(modid = "tectech") + @Optional.Method(modid = Mods.Names.TECTECH) private boolean areThingsNotProperlyTiered(Collection collection) { if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index 5f25c28018..29b405cb4f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -16,10 +16,21 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_HatchElement.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.InputBus; +import static gregtech.api.enums.GT_HatchElement.InputHatch; +import static gregtech.api.enums.GT_HatchElement.Maintenance; +import static gregtech.api.enums.GT_HatchElement.OutputBus; +import static gregtech.api.enums.GT_HatchElement.OutputHatch; import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.enums.Mods.TecTech; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import java.util.ArrayList; @@ -33,7 +44,6 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; @@ -45,6 +55,7 @@ import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; +import gregtech.api.enums.Mods; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -58,7 +69,7 @@ import gregtech.api.util.GT_Utility; @Optional.Interface( iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", - modid = "tectech", + modid = Mods.Names.TECTECH, striprefs = true) public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { @@ -152,7 +163,7 @@ public class GT_TileEntity_MegaChemicalReactor ArrayList outputItems = new ArrayList<>(); ArrayList outputFluids = new ArrayList<>(); - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) + long nominalV = TecTech.isModLoaded() ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); @@ -232,7 +243,7 @@ public class GT_TileEntity_MegaChemicalReactor @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { glasTier = 0; - if (LoaderReference.tectech) { + if (TecTech.isModLoaded()) { this.getTecTechEnergyMultis().clear(); this.getTecTechEnergyTunnels().clear(); } @@ -241,7 +252,7 @@ public class GT_TileEntity_MegaChemicalReactor if (mMaintenanceHatches.size() != 1) return false; - if (LoaderReference.tectech && this.glasTier < 8) + if (TecTech.isModLoaded() && this.glasTier < 8) if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) return false; @@ -297,7 +308,7 @@ public class GT_TileEntity_MegaChemicalReactor } @SuppressWarnings("rawtypes") - @Optional.Method(modid = "tectech") + @Optional.Method(modid = Mods.Names.TECTECH) private boolean areThingsNotProperlyTiered(Collection collection) { if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index a45fd705c4..074fdb49d2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -16,10 +16,20 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_HatchElement.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.InputBus; +import static gregtech.api.enums.GT_HatchElement.InputHatch; +import static gregtech.api.enums.GT_HatchElement.Maintenance; +import static gregtech.api.enums.GT_HatchElement.OutputBus; +import static gregtech.api.enums.GT_HatchElement.OutputHatch; import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.enums.Mods.TecTech; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import java.util.ArrayList; @@ -33,7 +43,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; @@ -47,6 +56,7 @@ import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Mods; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.ITexture; @@ -61,7 +71,7 @@ import gregtech.api.util.GT_Utility; @Optional.Interface( iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", - modid = "tectech", + modid = Mods.Names.TECTECH, striprefs = true) public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { @@ -284,7 +294,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - if (LoaderReference.tectech) { + if (TecTech.isModLoaded()) { this.getTecTechEnergyMultis().clear(); this.getTecTechEnergyTunnels().clear(); } @@ -410,7 +420,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } } - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) + long nominalV = TecTech.isModLoaded() ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(0, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java index abe44efdc7..806aeaf4ca 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java @@ -2,6 +2,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import static gregtech.api.enums.GT_HatchElement.Energy; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Mods.TecTech; import java.util.ArrayList; import java.util.Collection; @@ -14,7 +15,6 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MegaUtils; @@ -28,16 +28,21 @@ import com.gtnewhorizon.structurelib.structure.AutoPlaceEnvironment; import com.gtnewhorizon.structurelib.structure.IStructureElement; import cpw.mods.fml.common.Optional; +import gregtech.api.enums.Mods; import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.*; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Utility; import gregtech.api.util.IGT_HatchAdder; @Optional.Interface( iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", - modid = "tectech", + modid = Mods.Names.TECTECH, striprefs = true) public abstract class GT_TileEntity_MegaMultiBlockBase> extends GT_MetaTileEntity_EnhancedMultiBlockBase implements TecTechEnabledMulti { @@ -75,7 +80,7 @@ public abstract class GT_TileEntity_MegaMultiBlockBase getVanillaEnergyHatches() { return this.mEnergyHatches; } @Override @SuppressWarnings({ "rawtypes", "unchecked" }) - @Optional.Method(modid = "tectech") + @Optional.Method(modid = Mods.Names.TECTECH) public List getTecTechEnergyTunnels() { return TTTunnels; } @Override @SuppressWarnings({ "rawtypes", "unchecked" }) - @Optional.Method(modid = "tectech") + @Optional.Method(modid = Mods.Names.TECTECH) public List getTecTechEnergyMultis() { return TTMultiAmp; } @Override public boolean drainEnergyInput(long aEU) { - if (LoaderReference.tectech) return TecTechUtils.drainEnergyMEBFTecTech(this, aEU); + if (TecTech.isModLoaded()) return TecTechUtils.drainEnergyMEBFTecTech(this, aEU); return MegaUtils.drainEnergyMegaVanilla(this, aEU); } @Override public long getMaxInputVoltage() { - if (LoaderReference.tectech) return TecTechUtils.getMaxInputVoltage(this); + if (TecTech.isModLoaded()) return TecTechUtils.getMaxInputVoltage(this); return super.getMaxInputVoltage(); } @@ -129,7 +134,7 @@ public abstract class GT_TileEntity_MegaMultiBlockBase> builder = ImmutableList .>builder().addAll(Energy.mteClasses()); - if (LoaderReference.tectech) builder.add(GT_MetaTileEntity_Hatch_EnergyMulti.class); + if (TecTech.isModLoaded()) builder.add(GT_MetaTileEntity_Hatch_EnergyMulti.class); mteClasses = builder.build(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index 88121e2d85..32831a1898 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -16,11 +16,20 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_HatchElement.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.InputHatch; +import static gregtech.api.enums.GT_HatchElement.Maintenance; +import static gregtech.api.enums.GT_HatchElement.OutputHatch; import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.*; +import static gregtech.api.enums.Mods.TecTech; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofCoil; import java.util.ArrayList; import java.util.Collection; @@ -31,7 +40,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; @@ -44,6 +52,7 @@ import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.enums.HeatingCoilLevel; +import gregtech.api.enums.Mods; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -59,7 +68,7 @@ import gregtech.api.util.GT_Utility; @Optional.Interface( iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", - modid = "tectech", + modid = Mods.Names.TECTECH, striprefs = true) public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { @@ -189,7 +198,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa ArrayList outputItems = new ArrayList<>(); ArrayList outputFluids = new ArrayList<>(); - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) + long nominalV = TecTech.isModLoaded() ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); @@ -280,7 +289,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa mOutputOnSide = -1; mMiddleInputHatches.clear(); - if (LoaderReference.tectech) { + if (TecTech.isModLoaded()) { this.getTecTechEnergyMultis().clear(); this.getTecTechEnergyTunnels().clear(); } @@ -289,7 +298,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa if (mMaintenanceHatches.size() != 1) return false; - if (LoaderReference.tectech && this.glasTier < 8) + if (TecTech.isModLoaded() && this.glasTier < 8) if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) return false; @@ -411,7 +420,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa } @SuppressWarnings("rawtypes") - @Optional.Method(modid = "tectech") + @Optional.Method(modid = Mods.Names.TECTECH) private boolean areThingsNotProperlyTiered(Collection collection) { if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index e691ea8f95..f201997851 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -16,10 +16,21 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_HatchElement.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.InputBus; +import static gregtech.api.enums.GT_HatchElement.InputHatch; +import static gregtech.api.enums.GT_HatchElement.Maintenance; +import static gregtech.api.enums.GT_HatchElement.OutputBus; +import static gregtech.api.enums.GT_HatchElement.OutputHatch; import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.enums.Mods.TecTech; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import java.util.ArrayList; @@ -31,7 +42,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; @@ -43,6 +53,7 @@ import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; +import gregtech.api.enums.Mods; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -54,7 +65,7 @@ import gregtech.api.util.GT_Utility; @Optional.Interface( iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", - modid = "tectech", + modid = Mods.Names.TECTECH, striprefs = true) public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { @@ -219,7 +230,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc ArrayList outputItems = new ArrayList<>(); ArrayList outputFluids = new ArrayList<>(); - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) + long nominalV = TecTech.isModLoaded() ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); @@ -283,14 +294,14 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - if (LoaderReference.tectech) { + if (TecTech.isModLoaded()) { this.getTecTechEnergyMultis().clear(); this.getTecTechEnergyTunnels().clear(); } this.mCasing = 0; if (!checkPiece(STRUCTURE_PIECE_MAIN, 7, 7, 0)) return false; return this.mMaintenanceHatches.size() == 1 - && (LoaderReference.tectech + && (TecTech.isModLoaded() ? (!this.getTecTechEnergyMultis().isEmpty() || !this.getTecTechEnergyTunnels().isEmpty() || !this.mEnergyHatches.isEmpty()) : !this.mEnergyHatches.isEmpty()) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index db5d0dbfb3..6b02faa800 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -13,19 +13,26 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; +import static gregtech.api.enums.Mods.Gendustry; + import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.items.LabModule; import com.github.bartimaeusnek.bartworks.common.items.LabParts; import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import com.github.bartimaeusnek.bartworks.util.*; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.BioCulture; +import com.github.bartimaeusnek.bartworks.util.BioDNA; +import com.github.bartimaeusnek.bartworks.util.BioData; +import com.github.bartimaeusnek.bartworks.util.BioPlasmid; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -151,7 +158,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { public int checkRecipe(boolean skipOC) { int rTier = 3; - FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) + FluidStack dnaFluid = Gendustry.isModLoaded() ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); if (this.getSpecialSlot() != null && this.getSpecialSlot().getItem() instanceof LabModule) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index 14ad95d48a..0540a1ebea 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -13,7 +13,6 @@ package com.github.bartimaeusnek.bartworks.neiHandler; -import java.awt.*; import java.util.Collections; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java index 80f283d080..c814222bc2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java @@ -1,5 +1,7 @@ package com.github.bartimaeusnek.bartworks.neiHandler; +import static gregtech.api.enums.Mods.NotEnoughItems; + import net.minecraft.nbt.NBTTagCompound; import com.github.bartimaeusnek.bartworks.MainMod; @@ -38,7 +40,7 @@ public class IMCForNEI { aNBT.setInteger("handlerWidth", 166); aNBT.setInteger("maxRecipesPerPage", 2); aNBT.setInteger("yShift", 6); - FMLInterModComms.sendMessage("NotEnoughItems", "registerHandlerInfo", aNBT); + FMLInterModComms.sendMessage(NotEnoughItems.ID, "registerHandlerInfo", aNBT); } private static void sendCatalyst(String aName, String aStack, int aPriority) { @@ -46,7 +48,7 @@ public class IMCForNEI { aNBT.setString("handlerID", aName); aNBT.setString("itemName", aStack); aNBT.setInteger("priority", aPriority); - FMLInterModComms.sendMessage("NotEnoughItems", "registerCatalystInfo", aNBT); + FMLInterModComms.sendMessage(NotEnoughItems.ID, "registerCatalystInfo", aNBT); } private static void sendCatalyst(String aName, String aStack) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java index 04be1f4129..8a4c4c7762 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java @@ -12,7 +12,11 @@ */ package com.github.bartimaeusnek.bartworks.system.material; -import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.Types.*; +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.Types.BIOLOGICAL; +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.Types.COMPOUND; +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.Types.ELEMENT; +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.Types.ISOTOPE; +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.Types.MIXTURE; import com.github.bartimaeusnek.bartworks.MainMod; import gregtech.api.enums.Materials; @@ -25,34 +29,25 @@ public class BW_GT_MaterialReference { public static Werkstoff Aluminium = new Werkstoff(Materials.Aluminium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 19); public static Werkstoff Americium = new Werkstoff(Materials.Americium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 103); public static Werkstoff Antimony = new Werkstoff(Materials.Antimony, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 58); - // public static Werkstoff Argon = new Werkstoff(Materials.Argon, ADD_CASINGS_ONLY, ELEMENT, 31_766+24); public static Werkstoff Arsenic = new Werkstoff(Materials.Arsenic, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 39); public static Werkstoff Barium = new Werkstoff(Materials.Barium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 63); public static Werkstoff Beryllium = new Werkstoff(Materials.Beryllium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 8); public static Werkstoff Bismuth = new Werkstoff(Materials.Bismuth, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 90); public static Werkstoff Boron = new Werkstoff(Materials.Boron, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 9); public static Werkstoff Caesium = new Werkstoff(Materials.Caesium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 62); - // public static Werkstoff Calcium = new Werkstoff(Materials.Calcium, ADD_CASINGS_ONLY, ELEMENT, 31_766+26); public static Werkstoff Carbon = new Werkstoff(Materials.Carbon, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 10); public static Werkstoff Cadmium = new Werkstoff(Materials.Cadmium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 55); public static Werkstoff Cerium = new Werkstoff(Materials.Cerium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 65); - // public static Werkstoff Chlorine = new Werkstoff(Materials.Chlorine, ADD_CASINGS_ONLY, ELEMENT, 31_766+23); public static Werkstoff Chrome = new Werkstoff(Materials.Chrome, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 30); public static Werkstoff Cobalt = new Werkstoff(Materials.Cobalt, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 33); public static Werkstoff Copper = new Werkstoff(Materials.Copper, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 35); - // public static Werkstoff Deuterium = new Werkstoff(Materials.Deuterium, ADD_CASINGS_ONLY, ELEMENT, 31_766+2); public static Werkstoff Dysprosium = new Werkstoff(Materials.Dysprosium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 73); - // public static Werkstoff Empty = new Werkstoff(Materials.Empty, ADD_CASINGS_ONLY, ELEMENT, 31_766+0); public static Werkstoff Erbium = new Werkstoff(Materials.Erbium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 75); public static Werkstoff Europium = new Werkstoff(Materials.Europium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 70); - // public static Werkstoff Fluorine = new Werkstoff(Materials.Fluorine, ADD_CASINGS_ONLY, ELEMENT, 31_766+14); public static Werkstoff Gadolinium = new Werkstoff(Materials.Gadolinium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 71); public static Werkstoff Gallium = new Werkstoff(Materials.Gallium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 37); public static Werkstoff Gold = new Werkstoff(Materials.Gold, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 86); public static Werkstoff Holmium = new Werkstoff(Materials.Holmium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 74); - // public static Werkstoff Hydrogen = new Werkstoff(Materials.Hydrogen, ADD_CASINGS_ONLY, ELEMENT, 31_766+1); - // public static Werkstoff Helium = new Werkstoff(Materials.Helium, ADD_CASINGS_ONLY, ELEMENT, 31_766+4); - // public static Werkstoff Helium_3 = new Werkstoff(Materials.Helium_3, ADD_CASINGS_ONLY, ELEMENT, 31_766+5); public static Werkstoff Indium = new Werkstoff(Materials.Indium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 56); public static Werkstoff Iridium = new Werkstoff(Materials.Iridium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 84); public static Werkstoff Iron = new Werkstoff(Materials.Iron, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 32); @@ -62,15 +57,12 @@ public class BW_GT_MaterialReference { public static Werkstoff Lutetium = new Werkstoff(Materials.Lutetium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 78); public static Werkstoff Magnesium = new Werkstoff(Materials.Magnesium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 18); public static Werkstoff Manganese = new Werkstoff(Materials.Manganese, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 31); - // public static Werkstoff Mercury = new Werkstoff(Materials.Mercury, ADD_CASINGS_ONLY, ELEMENT, 31_766+87); public static Werkstoff Molybdenum = new Werkstoff(Materials.Molybdenum, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 48); public static Werkstoff Neodymium = new Werkstoff(Materials.Neodymium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 67); public static Werkstoff Neutronium = new Werkstoff(Materials.Neutronium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 129); public static Werkstoff Nickel = new Werkstoff(Materials.Nickel, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 34); public static Werkstoff Niobium = new Werkstoff(Materials.Niobium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 47); - // public static Werkstoff Nitrogen = new Werkstoff(Materials.Nitrogen, ADD_CASINGS_ONLY, ELEMENT, 31_766+12); public static Werkstoff Osmium = new Werkstoff(Materials.Osmium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 83); - // public static Werkstoff Oxygen = new Werkstoff(Materials.Oxygen, ADD_CASINGS_ONLY, ELEMENT, 31_766+13); public static Werkstoff Palladium = new Werkstoff(Materials.Palladium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 52); public static Werkstoff Phosphorus = new Werkstoff(Materials.Phosphorus, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 21); public static Werkstoff Platinum = new Werkstoff(Materials.Platinum, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 85); @@ -87,7 +79,6 @@ public class BW_GT_MaterialReference { ELEMENT, 31_766 + 66); public static Werkstoff Promethium = new Werkstoff(Materials.Promethium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 68); - // public static Werkstoff Radon = new Werkstoff(Materials.Radon, ADD_CASINGS_ONLY, ELEMENT, 31_766+93); public static Werkstoff Rubidium = new Werkstoff(Materials.Rubidium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 43); public static Werkstoff Samarium = new Werkstoff(Materials.Samarium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 69); public static Werkstoff Scandium = new Werkstoff(Materials.Scandium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 27); @@ -97,7 +88,6 @@ public class BW_GT_MaterialReference { public static Werkstoff Strontium = new Werkstoff(Materials.Strontium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 44); public static Werkstoff Sulfur = new Werkstoff(Materials.Sulfur, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 22); public static Werkstoff Tantalum = new Werkstoff(Materials.Tantalum, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 80); - // public static Werkstoff Tellurium = new Werkstoff(Materials.Tellurium, ADD_CASINGS_ONLY, ELEMENT, 31_766+59); public static Werkstoff Terbium = new Werkstoff(Materials.Terbium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 72); public static Werkstoff Thorium = new Werkstoff(Materials.Thorium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 96); public static Werkstoff Thulium = new Werkstoff(Materials.Thulium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 76); @@ -181,11 +171,6 @@ public class BW_GT_MaterialReference { public static Werkstoff Bronze = new Werkstoff(Materials.Bronze, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 300); public static Werkstoff Wood = new Werkstoff(Materials.Wood, ADD_CASINGS_ONLY, BIOLOGICAL, 31_766 + 809); - // public static Werkstoff WoodSealed = new Werkstoff(Materials.WoodSealed, ADD_CASINGS_ONLY, - // BIOLOGICAL,31_766+889); - // public static Werkstoff Cheese = new Werkstoff(Materials.Cheese, new - // Werkstoff.GenerationFeatures().addCasings().addMetalItems().addMultipleIngotMetalWorkingItems().enforceUnification(), - // BIOLOGICAL,31_766+894); public static Werkstoff Steel = new Werkstoff(Materials.Steel, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 305); public static Werkstoff Polytetrafluoroethylene = new Werkstoff( @@ -204,797 +189,4 @@ public class BW_GT_MaterialReference { public static void init() { MainMod.LOGGER.info("Load Elements from GT"); } - - // TODO: GT++ only? - - // public static Werkstoff Flerovium = new Werkstoff(Materials.Flerovium, , - // ,31_766+984); - - // public static Werkstoff HeeEndium = new Werkstoff(Materials.HeeEndium, , - // ,31_766+770); - // public static Werkstoff PlatinumGroupSludge = new Werkstoff(Materials.PlatinumGroupSludge, - // , ,31_766+241); - // public static Werkstoff Draconium = new Werkstoff(Materials.Draconium, , - // ,31_766+975); - // public static Werkstoff DraconiumAwakened = new Werkstoff(Materials.DraconiumAwakened, , - // ,31_766+976); - // public static Werkstoff Adamantium = new Werkstoff(Materials.Adamantium, , - // ,31_766+319); - // public static Werkstoff Alduorite = new Werkstoff(Materials.Alduorite, , - // ,31_766+485); - // public static Werkstoff Amber = new Werkstoff(Materials.Amber, , ,31_766+514); - // public static Werkstoff Angmallen = new Werkstoff(Materials.Angmallen, , - // ,31_766+958); - - // public static Werkstoff Atlarus = new Werkstoff(Materials.Atlarus, , - // ,31_766+965); - // public static Werkstoff Blizz = new Werkstoff(Materials.Blizz, , ,31_766+851); - // public static Werkstoff Blueschist = new Werkstoff(Materials.Blueschist, , - // ,31_766+852); - // public static Werkstoff Bluestone = new Werkstoff(Materials.Bluestone, , - // ,31_766+813); - // public static Werkstoff Carmot = new Werkstoff(Materials.Carmot, , ,31_766+962); - // public static Werkstoff Celenegil = new Werkstoff(Materials.Celenegil, , - // ,31_766+964); - // public static Werkstoff CertusQuartz = new Werkstoff(Materials.CertusQuartz, , - // ,31_766+516); - // public static Werkstoff Ceruclase = new Werkstoff(Materials.Ceruclase, , - // ,31_766+952); - // public static Werkstoff CobaltHexahydrate = new Werkstoff(Materials.CobaltHexahydrate, , - // ,31_766+853); - // public static Werkstoff ConstructionFoam = new Werkstoff(Materials.ConstructionFoam, , - // ,31_766+854); - // public static Werkstoff Chert = new Werkstoff(Materials.Chert, , ,31_766+857); - // public static Werkstoff CrudeOil = new Werkstoff(Materials.CrudeOil, , - // ,31_766+858); - // public static Werkstoff Dacite = new Werkstoff(Materials.Dacite, , ,31_766+859); - // public static Werkstoff DarkIron = new Werkstoff(Materials.DarkIron, , - // ,31_766+342); - // public static Werkstoff Desh = new Werkstoff(Materials.Desh, , ,31_766+884); - // public static Werkstoff Dilithium = new Werkstoff(Materials.Dilithium, , - // ,31_766+515); - // public static Werkstoff Duranium = new Werkstoff(Materials.Duranium, , - // ,31_766+328); - // public static Werkstoff Eclogite = new Werkstoff(Materials.Eclogite, , - // ,31_766+860); - // public static Werkstoff ElectrumFlux = new Werkstoff(Materials.ElectrumFlux, , - // ,31_766+320); - // public static Werkstoff Emery = new Werkstoff(Materials.Emery, , ,31_766+861); - // public static Werkstoff EnderiumBase = new Werkstoff(Materials.EnderiumBase, , - // ,31_766+380); - // public static Werkstoff Epidote = new Werkstoff(Materials.Epidote, , - // ,31_766+862); - // public static Werkstoff Eximite = new Werkstoff(Materials.Eximite, , - // ,31_766+959); - // public static Werkstoff FierySteel = new Werkstoff(Materials.FierySteel, , - // ,31_766+346); - // public static Werkstoff Firestone = new Werkstoff(Materials.Firestone, , - // ,31_766+347); - // public static Werkstoff FoolsRuby = new Werkstoff(Materials.FoolsRuby, , - // ,31_766+512); - // public static Werkstoff Force = new Werkstoff(Materials.Force, , ,31_766+521); - // public static Werkstoff Forcicium = new Werkstoff(Materials.Forcicium, , - // ,31_766+518); - // public static Werkstoff Forcillium = new Werkstoff(Materials.Forcillium, , - // ,31_766+519); - // public static Werkstoff Gabbro = new Werkstoff(Materials.Gabbro, , ,31_766+863); - // public static Werkstoff Glowstone = new Werkstoff(Materials.Glowstone, , - // ,31_766+811); - // public static Werkstoff Gneiss = new Werkstoff(Materials.Gneiss, , ,31_766+864); - // public static Werkstoff Graphite = new Werkstoff(Materials.Graphite, , - // ,31_766+865); - // public static Werkstoff Graphene = new Werkstoff(Materials.Graphene, , - // ,31_766+819); - // public static Werkstoff Greenschist = new Werkstoff(Materials.Greenschist, , - // ,31_766+866); - // public static Werkstoff Greenstone = new Werkstoff(Materials.Greenstone, , - // ,31_766+867); - // public static Werkstoff Greywacke = new Werkstoff(Materials.Greywacke, , - // ,31_766+897); - // public static Werkstoff Haderoth = new Werkstoff(Materials.Haderoth, , - // ,31_766+963); - // public static Werkstoff Hepatizon = new Werkstoff(Materials.Hepatizon, , - // ,31_766+957); - // public static Werkstoff HSLA = new Werkstoff(Materials.HSLA, , ,31_766+322); - // public static Werkstoff Ignatius = new Werkstoff(Materials.Ignatius, , - // ,31_766+950); - // public static Werkstoff Infuscolium = new Werkstoff(Materials.Infuscolium, , - // ,31_766+490); - // public static Werkstoff InfusedGold = new Werkstoff(Materials.InfusedGold, , - // ,31_766+323); - // public static Werkstoff InfusedAir = new Werkstoff(Materials.InfusedAir, , - // ,31_766+540); - // public static Werkstoff InfusedFire = new Werkstoff(Materials.InfusedFire, , - // ,31_766+541); - // public static Werkstoff InfusedEarth = new Werkstoff(Materials.InfusedEarth, , - // ,31_766+542); - // public static Werkstoff InfusedWater = new Werkstoff(Materials.InfusedWater, , - // ,31_766+543); - // public static Werkstoff InfusedEntropy = new Werkstoff(Materials.InfusedEntropy, , - // ,31_766+544); - // public static Werkstoff InfusedOrder = new Werkstoff(Materials.InfusedOrder, , - // ,31_766+545); - // public static Werkstoff Inolashite = new Werkstoff(Materials.Inolashite, , - // ,31_766+954); - // public static Werkstoff Jade = new Werkstoff(Materials.Jade, , ,31_766+537); - // public static Werkstoff Jasper = new Werkstoff(Materials.Jasper, , ,31_766+511); - // public static Werkstoff Kalendrite = new Werkstoff(Materials.Kalendrite, , - // ,31_766+953); - // public static Werkstoff Komatiite = new Werkstoff(Materials.Komatiite, , - // ,31_766+869); - // public static Werkstoff Lava = new Werkstoff(Materials.Lava, , ,31_766+700); - // public static Werkstoff Lemurite = new Werkstoff(Materials.Lemurite, , - // ,31_766+486); - // public static Werkstoff MeteoricIron = new Werkstoff(Materials.MeteoricIron, , - // ,31_766+340); - // public static Werkstoff MeteoricSteel = new Werkstoff(Materials.MeteoricSteel, , - // ,31_766+341); - // public static Werkstoff Meutoite = new Werkstoff(Materials.Meutoite, , - // ,31_766+487); - // public static Werkstoff Migmatite = new Werkstoff(Materials.Migmatite, , - // ,31_766+872); - - // public static Werkstoff NetherBrick = new Werkstoff(Materials.NetherBrick, , - // ,31_766+814); - // public static Werkstoff NetherQuartz = new Werkstoff(Materials.NetherQuartz, , - // ,31_766+522); - // public static Werkstoff NetherStar = new Werkstoff(Materials.NetherStar, , - // ,31_766+506); - // public static Werkstoff Oilsands = new Werkstoff(Materials.Oilsands, , - // ,31_766+878); - // public static Werkstoff Orichalcum = new Werkstoff(Materials.Orichalcum, , - // ,31_766+966); - // public static Werkstoff Oureclase = new Werkstoff(Materials.Oureclase, , - // ,31_766+961); - // public static Werkstoff Prometheum = new Werkstoff(Materials.Prometheum, , - // ,31_766+960); - // public static Werkstoff Quartzite = new Werkstoff(Materials.Quartzite, , - // ,31_766+523); - // public static Werkstoff Rhyolite = new Werkstoff(Materials.Rhyolite, , - // ,31_766+875); - // public static Werkstoff Rubracium = new Werkstoff(Materials.Rubracium, , - // ,31_766+488); - // public static Werkstoff Sanguinite = new Werkstoff(Materials.Sanguinite, , - // ,31_766+955); - // public static Werkstoff Siltstone = new Werkstoff(Materials.Siltstone, , - // ,31_766+876); - // public static Werkstoff Tartarite = new Werkstoff(Materials.Tartarite, , - // ,31_766+956); - // public static Werkstoff UUAmplifier = new Werkstoff(Materials.UUAmplifier, , - // ,31_766+721); - // public static Werkstoff UUMatter = new Werkstoff(Materials.UUMatter, , - // ,31_766+703); - // public static Werkstoff Void = new Werkstoff(Materials.Void, , ,31_766+970); - // public static Werkstoff Vulcanite = new Werkstoff(Materials.Vulcanite, , - // ,31_766+489); - // public static Werkstoff Vyroxeres = new Werkstoff(Materials.Vyroxeres, , - // ,31_766+951); - // public static Werkstoff BioFuel = new Werkstoff(Materials.BioFuel, , - // ,31_766+705); - // public static Werkstoff Biomass = new Werkstoff(Materials.Biomass, , - // ,31_766+704); - // public static CharcoalByproducts = new MaterialBuilder - - // public static Werkstoff Chili = new Werkstoff(Materials.Chili, , ,31_766+895); - // public static Werkstoff Chocolate = new Werkstoff(Materials.Chocolate, , - // ,31_766+886); - // public static Werkstoff CoalFuel = new Werkstoff(Materials.CoalFuel, , - // ,31_766+710); - // public static Werkstoff Cocoa = new Werkstoff(Materials.Cocoa, , ,31_766+887); - // public static Werkstoff Coffee = new Werkstoff(Materials.Coffee, , ,31_766+888); - // public static Werkstoff Creosote = new Werkstoff(Materials.Creosote, , - // ,31_766+712); - // public static Werkstoff Ethanol = new Werkstoff(Materials.Ethanol, , - // ,31_766+706); - // public static FermentedBiomass = new MaterialBuilder - // public static Werkstoff Fuel = new Werkstoff(Materials.Fuel, , ,31_766+708); - // public static Werkstoff Glue = new Werkstoff(Materials.Glue, , ,31_766+726); - // public static Werkstoff Gunpowder = new Werkstoff(Materials.Gunpowder, , - // ,31_766+800); - // public static Werkstoff FryingOilHot = new Werkstoff(Materials.FryingOilHot, , - // ,31_766+727); - // public static Werkstoff Honey = new Werkstoff(Materials.Honey, , ,31_766+725); - // public static Werkstoff Lubricant = new Werkstoff(Materials.Lubricant, , - // ,31_766+724); - // public static Werkstoff McGuffium239 = new Werkstoff(Materials.McGuffium239, , - // ,31_766+999); - // public static Werkstoff MeatRaw = new Werkstoff(Materials.MeatRaw, , - // ,31_766+892); - // public static Werkstoff MeatCooked = new Werkstoff(Materials.MeatCooked, , - // ,31_766+893); - // public static Werkstoff Milk = new Werkstoff(Materials.Milk, , ,31_766+885); - // public static Werkstoff Oil = new Werkstoff(Materials.Oil, , ,31_766+707); - // public static Werkstoff Paper = new Werkstoff(Materials.Paper, , ,31_766+879); - // public static Werkstoff RareEarth = new Werkstoff(Materials.RareEarth, , - // ,31_766+891); - // public static Werkstoff Reinforced = new Werkstoff(Materials.Reinforced, , - // ,31_766+383); - // public static Werkstoff SeedOil = new Werkstoff(Materials.SeedOil, , - // ,31_766+713); - // public static Werkstoff SeedOilHemp = new Werkstoff(Materials.SeedOilHemp, , - // ,31_766+722); - // public static Werkstoff SeedOilLin = new Werkstoff(Materials.SeedOilLin, , - // ,31_766+723); - // public static Werkstoff Stone = new Werkstoff(Materials.Stone, , ,31_766+299); - // public static Werkstoff Unstable = new Werkstoff(Materials.Unstable, , - // ,31_766+396); - // public static Vinegar = new MaterialBuilder - // public static Werkstoff Wheat = new Werkstoff(Materials.Wheat, , ,31_766+881); - // public static WoodGas = new MaterialBuilder - // public static WoodTar = new MaterialBuilder - // public static WoodVinegar = new MaterialBuilder - - // public static Werkstoff Sunnarium = new Werkstoff(Materials.Sunnarium, , - // ,31_766+318); - // public static Werkstoff Endstone = new Werkstoff(Materials.Endstone, , - // ,31_766+808); - // public static Werkstoff Netherrack = new Werkstoff(Materials.Netherrack, , - // ,31_766+807); - // public static Werkstoff Methane = new Werkstoff(Materials.Methane, , - // ,31_766+715); - // public static Werkstoff CarbonDioxide = new Werkstoff(Materials.CarbonDioxide, , - // ,31_766+497); - // public static Werkstoff NobleGases = new Werkstoff(Materials.NobleGases, , - // ,31_766+496); - // public static Werkstoff LiquidAir = new Werkstoff(Materials.LiquidAir, , - // ,31_766+495); - // public static Werkstoff LiquidNitrogen = new Werkstoff(Materials.LiquidNitrogen, , - // ,31_766+494); - // public static Werkstoff LiquidOxygen = new Werkstoff(Materials.LiquidOxygen, , - // ,31_766+493); - // public static Werkstoff Almandine = new Werkstoff(Materials.Almandine, , - // ,31_766+820); - // public static Werkstoff Andradite = new Werkstoff(Materials.Andradite, , - // ,31_766+821); - - // public static Werkstoff Asbestos = new Werkstoff(Materials.Asbestos, , - // ,31_766+946); - // public static Werkstoff Ash = new Werkstoff(Materials.Ash, , ,31_766+815); - // public static Werkstoff BandedIron = new Werkstoff(Materials.BandedIron, , - // ,31_766+917); - // public static Werkstoff BatteryAlloy = new Werkstoff(Materials.BatteryAlloy, , - // ,31_766+315); - // public static Werkstoff BlueTopaz = new Werkstoff(Materials.BlueTopaz, , - // ,31_766+513); - // public static Werkstoff Bone = new Werkstoff(Materials.Bone, , ,31_766+806); - - // public static Werkstoff BrownLimonite = new Werkstoff(Materials.BrownLimonite, , - // ,31_766+930); - // public static Werkstoff Calcite = new Werkstoff(Materials.Calcite, , - // ,31_766+823); - // public static Werkstoff Cassiterite = new Werkstoff(Materials.Cassiterite, , - // ,31_766+824); - // public static Werkstoff CassiteriteSand = new Werkstoff(Materials.CassiteriteSand, , - // ,31_766+937); - // public static Werkstoff Chalcopyrite = new Werkstoff(Materials.Chalcopyrite, , - // ,31_766+855); - // public static Werkstoff Charcoal = new Werkstoff(Materials.Charcoal, , - // ,31_766+536); - // public static Werkstoff Chromite = new Werkstoff(Materials.Chromite, , - // ,31_766+825); - // public static Werkstoff ChromiumDioxide = new Werkstoff(Materials.ChromiumDioxide, , - // ,31_766+361); - // public static Werkstoff Cinnabar = new Werkstoff(Materials.Cinnabar, , - // ,31_766+826); - // public static Werkstoff Water = new Werkstoff(Materials.Water, , ,31_766+701); - // public static Werkstoff Clay = new Werkstoff(Materials.Clay, , ,31_766+805); - // public static Werkstoff Coal = new Werkstoff(Materials.Coal, , ,31_766+535); - // public static Werkstoff Cobaltite = new Werkstoff(Materials.Cobaltite, , - // ,31_766+827); - // public static Werkstoff Cooperite = new Werkstoff(Materials.Cooperite, , - // ,31_766+828); - // public static Werkstoff Cupronickel = new Werkstoff(Materials.Cupronickel, , - // ,31_766+310); - // public static Werkstoff DarkAsh = new Werkstoff(Materials.DarkAsh, , - // ,31_766+816); - // public static Werkstoff DeepIron = new Werkstoff(Materials.DeepIron, , - // ,31_766+829); - // public static Werkstoff Diamond = new Werkstoff(Materials.Diamond, , - // ,31_766+500); - // public static Werkstoff Electrum = new Werkstoff(Materials.Electrum, , - // ,31_766+303); - // public static Werkstoff Emerald = new Werkstoff(Materials.Emerald, , - // ,31_766+501); - // public static Werkstoff Galena = new Werkstoff(Materials.Galena, , ,31_766+830); - // public static Werkstoff Garnierite = new Werkstoff(Materials.Garnierite, , - // ,31_766+906); - // public static Werkstoff Glyceryl = new Werkstoff(Materials.Glyceryl, , - // ,31_766+714); - // public static Werkstoff GreenSapphire = new Werkstoff(Materials.GreenSapphire, , - // ,31_766+504); - // public static Werkstoff Grossular = new Werkstoff(Materials.Grossular, , - // ,31_766+831); - // public static Werkstoff HolyWater = new Werkstoff(Materials.HolyWater, , - // ,31_766+729); - // public static Werkstoff Ice = new Werkstoff(Materials.Ice, , ,31_766+702); - // public static Werkstoff Ilmenite = new Werkstoff(Materials.Ilmenite, , - // ,31_766+918); - // public static Werkstoff Rutile = new Werkstoff(Materials.Rutile, , ,31_766+375); - // public static Werkstoff Bauxite = new Werkstoff(Materials.Bauxite, , - // ,31_766+822); - // public static Werkstoff Titaniumtetrachloride = new Werkstoff(Materials.Titaniumtetrachloride, - // , ,31_766+376); - // public static Werkstoff Magnesiumchloride = new Werkstoff(Materials.Magnesiumchloride, , - // ,31_766+377); - // public static Werkstoff Invar = new Werkstoff(Materials.Invar, , ,31_766+302); - // public static Werkstoff Kanthal = new Werkstoff(Materials.Kanthal, , - // ,31_766+312); - // public static Werkstoff Lazurite = new Werkstoff(Materials.Lazurite, , - // ,31_766+524); - // public static Werkstoff Magnalium = new Werkstoff(Materials.Magnalium, , - // ,31_766+313); - // public static Werkstoff Magnesite = new Werkstoff(Materials.Magnesite, , - // ,31_766+908); - // public static Werkstoff Magnetite = new Werkstoff(Materials.Magnetite, , - // ,31_766+870); - // public static Werkstoff Molybdenite = new Werkstoff(Materials.Molybdenite, , - // ,31_766+942); - // public static Werkstoff Nichrome = new Werkstoff(Materials.Nichrome, , - // ,31_766+311); - // public static Werkstoff NiobiumNitride = new Werkstoff(Materials.NiobiumNitride, , - // ,31_766+359); - // public static Werkstoff NiobiumTitanium = new Werkstoff(Materials.NiobiumTitanium, , - // ,31_766+360); - // public static Werkstoff NitroCarbon = new Werkstoff(Materials.NitroCarbon, , - // ,31_766+716); - // public static Werkstoff NitrogenDioxide = new Werkstoff(Materials.NitrogenDioxide, , - // ,31_766+717); - // public static Werkstoff Obsidian = new Werkstoff(Materials.Obsidian, , - // ,31_766+804); - // public static Werkstoff Phosphate = new Werkstoff(Materials.Phosphate, , - // ,31_766+833); - // public static Werkstoff PigIron = new Werkstoff(Materials.PigIron, , - // ,31_766+307); - - // public static Polydimethylsiloxane = new MaterialBuilder - // public static Werkstoff Silicone = new Werkstoff(Materials.Silicone, , - // ,31_766+471); - // public static Werkstoff Polycaprolactam = new Werkstoff(Materials.Polycaprolactam, , - // ,31_766+472); - - // public static Werkstoff Powellite = new Werkstoff(Materials.Powellite, , - // ,31_766+883); - // public static Werkstoff Pumice = new Werkstoff(Materials.Pumice, , ,31_766+926); - // public static Werkstoff Pyrite = new Werkstoff(Materials.Pyrite, , ,31_766+834); - // public static Werkstoff Pyrolusite = new Werkstoff(Materials.Pyrolusite, , - // ,31_766+943); - // public static Werkstoff Pyrope = new Werkstoff(Materials.Pyrope, , ,31_766+835); - // public static Werkstoff RockSalt = new Werkstoff(Materials.RockSalt, , - // ,31_766+944); - // public static Werkstoff Rubber = new Werkstoff(Materials.Rubber, , ,31_766+880); - // public static Werkstoff RawRubber = new Werkstoff(Materials.RawRubber, , - // ,31_766+896); - // public static Werkstoff Ruby = new Werkstoff(Materials.Ruby, , ,31_766+502); - // public static Werkstoff Salt = new Werkstoff(Materials.Salt, , ,31_766+817); - // public static Werkstoff Saltpeter = new Werkstoff(Materials.Saltpeter, , - // ,31_766+836); - // public static Werkstoff Sapphire = new Werkstoff(Materials.Sapphire, , - // ,31_766+503); - // public static Werkstoff Scheelite = new Werkstoff(Materials.Scheelite, , - // ,31_766+910); - // public static Werkstoff SiliconDioxide = new Werkstoff(Materials.SiliconDioxide, , - // ,31_766+837); - // public static Werkstoff Snow = new Werkstoff(Materials.Snow, , ,31_766+728); - // public static Werkstoff Sodalite = new Werkstoff(Materials.Sodalite, , - // ,31_766+525); - // public static Werkstoff SodiumPersulfate = new Werkstoff(Materials.SodiumPersulfate, , - // ,31_766+718); - // public static Werkstoff SodiumSulfide = new Werkstoff(Materials.SodiumSulfide, , - // ,31_766+719); - // public static Werkstoff HydricSulfide = new Werkstoff(Materials.HydricSulfide, , - // ,31_766+460); - // public static Werkstoff OilHeavy = new Werkstoff(Materials.OilHeavy, , - // ,31_766+730); - // public static Werkstoff OilMedium = new Werkstoff(Materials.OilMedium, , - // ,31_766+731); - // public static Werkstoff OilLight = new Werkstoff(Materials.OilLight, , - // ,31_766+732); - // public static Werkstoff NatruralGas = new Werkstoff(Materials.NatruralGas, , - // ,31_766+733); - // public static Werkstoff SulfuricGas = new Werkstoff(Materials.SulfuricGas, , - // ,31_766+734); - // public static Werkstoff Gas = new Werkstoff(Materials.Gas, , ,31_766+735); - // public static Werkstoff SulfuricNaphtha = new Werkstoff(Materials.SulfuricNaphtha, , - // ,31_766+736); - // public static Werkstoff SulfuricLightFuel = new Werkstoff(Materials.SulfuricLightFuel, , - // ,31_766+737); - // public static Werkstoff SulfuricHeavyFuel = new Werkstoff(Materials.SulfuricHeavyFuel, , - // ,31_766+738); - // public static Werkstoff Naphtha = new Werkstoff(Materials.Naphtha, , - // ,31_766+739); - // public static Werkstoff LightFuel = new Werkstoff(Materials.LightFuel, , - // ,31_766+740); - // public static Werkstoff HeavyFuel = new Werkstoff(Materials.HeavyFuel, , - // ,31_766+741); - // public static Werkstoff LPG = new Werkstoff(Materials.LPG, , ,31_766+742); - // public static FluidNaquadahFuel = new MaterialBuilder - // public static EnrichedNaquadria = new MaterialBuilder - // public static ReinforceGlass = new MaterialBuilder - // public static BioMediumRaw = new MaterialBuilder - // public static BioMediumSterilized = new MaterialBuilder - // public static Chlorobenzene = new MaterialBuild - // public static DilutedHydrochloricAcid = new MaterialBuild - // public static Pyrochlore = new MaterialBuild - // public static GrowthMediumRaw = new MaterialBuild - // public static GrowthMediumSterilized = new MaterialBuild - // public static FerriteMixture = new MaterialBuild - // public static NickelZincFerrite = new MaterialBuild - // public static Massicot = new MaterialBuild - // public static ArsenicTrioxide = new MaterialBuild - // public static CobaltOxide = new MaterialBuild - // public static Zincite = new MaterialBuild - // public static AntimonyTrioxide = new MaterialBuild - // public static CupricOxide = new MaterialBuild - // public static Ferrosilite = new MaterialBuild - // public static Magnesia = new MaterialBuild - // public static Quicklime = new MaterialBuild - // public static Potash = new MaterialBuild - // public static SodaAsh = new MaterialBuild - // public static Brick = new MaterialBuild - // public static Fireclay = new MaterialBuild - // public static BioDiesel = new MaterialBuild - // public static NitrationMixture = new MaterialBuild - // public static Glycerol = new MaterialBuild - // public static SodiumBisulfate = new MaterialBuild - // public static PolyphenyleneSulfide = new MaterialBuild - // public static Dichlorobenzene = new MaterialBuild - // public static Polystyrene = new MaterialBuild - // public static Styrene = new MaterialBuild - // public static Isoprene = new MaterialBuild - // public static Tetranitromethane = new MaterialBuild - // public static Ethenone = new MaterialBuild - // public static Ethane = new MaterialBuild - // public static Propane = new MaterialBuild - // public static Butane = new MaterialBuild - // public static Butene = new MaterialBuild - // public static Butadiene = new MaterialBuild - // public static RawStyreneButadieneRubber = new MaterialBuild - // public static StyreneButadieneRubber = new MaterialBuild - // public static Toluene = new MaterialBuild - // public static Epichlorohydrin = new MaterialBuild - // public static PolyvinylChloride = new MaterialBuild - // public static VinylChloride = new MaterialBuild - // public static SulfurDioxide = new MaterialBuild - // public static SulfurTrioxide = new MaterialBuild - // public static NitricAcid = new MaterialBuild - // public static Dimethylhydrazine = new MaterialBuild - // public static Chloramine = new MaterialBuild - // public static Dimethylamine = new MaterialBuild - // public static DinitrogenTetroxide = new MaterialBuild - // public static NitricOxide = new MaterialBuild - // public static Ammonia = new MaterialBuild - // public static Dimethyldichlorosilane = new MaterialBuild - // public static Chloromethane = new MaterialBuild - // public static PhosphorousPentoxide = new MaterialBuild - // public static Tetrafluoroethylene = new MaterialBuild - // public static HydrofluoricAcid = new MaterialBuild - // public static Chloroform = new MaterialBuild - // public static BisphenolA = new MaterialBuild - // public static AceticAcid = new MaterialBuild - // public static CalciumAcetateSolution = new MaterialBuild - // public static Acetone = new MaterialBuild - // public static Methanol = new MaterialBuild - // public static CarbonMonoxide = new MaterialBuild - // public static MetalMixture = new MaterialBuild - // public static Ethylene = new MaterialBuild - // public static Propene = new MaterialBuild - // public static VinylAcetate = new MaterialBuild - // public static PolyvinylAcetate = new MaterialBuild - // public static MethylAcetate = new MaterialBuild - // public static AllylChloride = new MaterialBuild - // public static HydrochloricAcid = new MaterialBuild - // public static HypochlorousAcid = new MaterialBuild - // public static SodiumHydroxide = new MaterialBuild - // public static Benzene = new MaterialBuild - // public static Phenol = new MaterialBuild - // public static Cumene = new MaterialBuild - // public static PhosphoricAcid = new MaterialBuild - // public static SaltWater = new MaterialBuild - // public static IronIIIChloride = new MaterialBuild - // public static LifeEssence = new MaterialBuild - // public static Werkstoff SolderingAlloy = new Werkstoff(Materials.SolderingAlloy, , - // ,31_766+314); - // public static Werkstoff GalliumArsenide = new Werkstoff(Materials.GalliumArsenide, , - // ,31_766+980); - // public static Werkstoff IndiumGalliumPhosphide = new Werkstoff(Materials.IndiumGalliumPhosphide, - // , ,31_766+981); - // public static Werkstoff Spessartine = new Werkstoff(Materials.Spessartine, , - // ,31_766+838); - // public static Werkstoff Sphalerite = new Werkstoff(Materials.Sphalerite, , - // ,31_766+839); - - // public static Werkstoff Stibnite = new Werkstoff(Materials.Stibnite, , - // ,31_766+945); - // public static Werkstoff SulfuricAcid = new Werkstoff(Materials.SulfuricAcid, , - // ,31_766+720); - // public static Werkstoff Tanzanite = new Werkstoff(Materials.Tanzanite, , - // ,31_766+508); - // public static Werkstoff Tetrahedrite = new Werkstoff(Materials.Tetrahedrite, , - // ,31_766+840); - // public static Werkstoff TinAlloy = new Werkstoff(Materials.TinAlloy, , - // ,31_766+363); - // public static Werkstoff Topaz = new Werkstoff(Materials.Topaz, , ,31_766+507); - // public static Werkstoff Tungstate = new Werkstoff(Materials.Tungstate, , - // ,31_766+841); - - // public static Werkstoff Uraninite = new Werkstoff(Materials.Uraninite, , - // ,31_766+922); - // public static Werkstoff Uvarovite = new Werkstoff(Materials.Uvarovite, , - // ,31_766+842); - // public static Werkstoff VanadiumGallium = new Werkstoff(Materials.VanadiumGallium, , - // ,31_766+357); - - // public static Werkstoff Wulfenite = new Werkstoff(Materials.Wulfenite, , - // ,31_766+882); - // public static Werkstoff YellowLimonite = new Werkstoff(Materials.YellowLimonite, , - // ,31_766+931); - // public static Werkstoff YttriumBariumCuprate = new Werkstoff(Materials.YttriumBariumCuprate, - // , ,31_766+358); - - // public static Werkstoff LiveRoot = new Werkstoff(Materials.LiveRoot, , - // ,31_766+832); - // public static Werkstoff IronWood = new Werkstoff(Materials.IronWood, , - // ,31_766+338); - // public static Werkstoff Glass = new Werkstoff(Materials.Glass, , ,31_766+890); - // public static Werkstoff BorosilicateGlass = new Werkstoff(Materials.BorosilicateGlass, - // Werkstoff.GenerationFeatures.DISABLED, Werkstoff.Types.COMPOUND, 31_766+611); - // public static Werkstoff Perlite = new Werkstoff(Materials.Perlite, , - // ,31_766+925); - // public static Werkstoff Borax = new Werkstoff(Materials.Borax, , ,31_766+941); - // public static Werkstoff Lignite = new Werkstoff(Materials.Lignite, , - // ,31_766+538); - // public static Werkstoff Olivine = new Werkstoff(Materials.Olivine, , - // ,31_766+505); - // public static Werkstoff Opal = new Werkstoff(Materials.Opal, , ,31_766+510); - // public static Werkstoff Amethyst = new Werkstoff(Materials.Amethyst, , - // ,31_766+509); - // public static Werkstoff Redstone = new Werkstoff(Materials.Redstone, , - // ,31_766+810); - // public static Werkstoff Lapis = new Werkstoff(Materials.Lapis, , ,31_766+526); - // public static Werkstoff Blaze = new Werkstoff(Materials.Blaze, , ,31_766+801); - // public static Werkstoff EnderPearl = new Werkstoff(Materials.EnderPearl, , - // ,31_766+532); - // public static Werkstoff EnderEye = new Werkstoff(Materials.EnderEye, , - // ,31_766+533); - // public static Werkstoff Flint = new Werkstoff(Materials.Flint, , ,31_766+802); - // public static Werkstoff Diatomite = new Werkstoff(Materials.Diatomite, , - // ,31_766+948); - // public static Werkstoff VolcanicAsh = new Werkstoff(Materials.VolcanicAsh, , - // ,31_766+940); - // public static Werkstoff Niter = new Werkstoff(Materials.Niter, , ,31_766+531); - // public static Werkstoff Pyrotheum = new Werkstoff(Materials.Pyrotheum, , - // ,31_766+843); - // public static Werkstoff Cryotheum = new Werkstoff(Materials.Cryotheum, , - // ,31_766+898); - // public static Werkstoff HydratedCoal = new Werkstoff(Materials.HydratedCoal, , - // ,31_766+818); - // public static Werkstoff Apatite = new Werkstoff(Materials.Apatite, , - // ,31_766+530); - // public static Werkstoff Alumite = new Werkstoff(Materials.Alumite, , - // ,31_766+400); - // public static Werkstoff Manyullyn = new Werkstoff(Materials.Manyullyn, , - // ,31_766+386); - // public static Werkstoff Steeleaf = new Werkstoff(Materials.Steeleaf, , - // ,31_766+339); - // public static Werkstoff Knightmetal = new Werkstoff(Materials.Knightmetal, , - // ,31_766+362); - - // public static Werkstoff NitroFuel = new Werkstoff(Materials.NitroFuel, , - // ,31_766+709); - // public static Werkstoff RedAlloy = new Werkstoff(Materials.RedAlloy, , - // ,31_766+308); - // public static Werkstoff CobaltBrass = new Werkstoff(Materials.CobaltBrass, , - // ,31_766+343); - // public static Werkstoff TricalciumPhosphate = new Werkstoff(Materials.TricalciumPhosphate, - // , ,31_766+534); - // public static Werkstoff Basalt = new Werkstoff(Materials.Basalt, , ,31_766+844); - // public static Werkstoff GarnetRed = new Werkstoff(Materials.GarnetRed, , - // ,31_766+527); - // public static Werkstoff GarnetYellow = new Werkstoff(Materials.GarnetYellow, , - // ,31_766+528); - // public static Werkstoff Marble = new Werkstoff(Materials.Marble, , ,31_766+845); - // public static Werkstoff Sugar = new Werkstoff(Materials.Sugar, , ,31_766+803); - // public static Werkstoff Thaumium = new Werkstoff(Materials.Thaumium, , - // ,31_766+330); - // public static Werkstoff Vinteum = new Werkstoff(Materials.Vinteum, , - // ,31_766+529); - // public static Werkstoff Redrock = new Werkstoff(Materials.Redrock, , - // ,31_766+846); - // public static Werkstoff PotassiumFeldspar = new Werkstoff(Materials.PotassiumFeldspar, , - // ,31_766+847); - // public static Werkstoff Biotite = new Werkstoff(Materials.Biotite, , - // ,31_766+848); - // public static Werkstoff GraniteBlack = new Werkstoff(Materials.GraniteBlack, , - // ,31_766+849); - // public static Werkstoff GraniteRed = new Werkstoff(Materials.GraniteRed, , - // ,31_766+850); - // public static Werkstoff Chrysotile = new Werkstoff(Materials.Chrysotile, , - // ,31_766+912); - // public static Werkstoff Realgar = new Werkstoff(Materials.Realgar, , - // ,31_766+913); - // public static Werkstoff VanadiumMagnetite = new Werkstoff(Materials.VanadiumMagnetite, , - // ,31_766+923); - // public static Werkstoff BasalticMineralSand = new Werkstoff(Materials.BasalticMineralSand, - // , ,31_766+935); - // public static Werkstoff GraniticMineralSand = new Werkstoff(Materials.GraniticMineralSand, - // , ,31_766+936); - // public static Werkstoff GarnetSand = new Werkstoff(Materials.GarnetSand, , - // ,31_766+938); - // public static Werkstoff QuartzSand = new Werkstoff(Materials.QuartzSand, , - // ,31_766+939); - // public static Werkstoff Bastnasite = new Werkstoff(Materials.Bastnasite, , - // ,31_766+905); - // public static Werkstoff Pentlandite = new Werkstoff(Materials.Pentlandite, , - // ,31_766+909); - // public static Werkstoff Spodumene = new Werkstoff(Materials.Spodumene, , - // ,31_766+920); - // public static Werkstoff Pollucite = new Werkstoff(Materials.Pollucite, , - // ,31_766+919); - // public static Werkstoff Tantalite = new Werkstoff(Materials.Tantalite, , - // ,31_766+921); - // public static Werkstoff Lepidolite = new Werkstoff(Materials.Lepidolite, , - // ,31_766+907); - // public static Werkstoff Glauconite = new Werkstoff(Materials.Glauconite, , - // ,31_766+933); - // public static Werkstoff GlauconiteSand = new Werkstoff(Materials.GlauconiteSand, , - // ,31_766+949); - // public static Werkstoff Vermiculite = new Werkstoff(Materials.Vermiculite, , - // ,31_766+932); - // public static Werkstoff Bentonite = new Werkstoff(Materials.Bentonite, , - // ,31_766+927); - // public static Werkstoff FullersEarth = new Werkstoff(Materials.FullersEarth, , - // ,31_766+928); - // public static Werkstoff Pitchblende = new Werkstoff(Materials.Pitchblende, , - // ,31_766+873); - // public static Werkstoff Monazite = new Werkstoff(Materials.Monazite, , - // ,31_766+520); - // public static Werkstoff Malachite = new Werkstoff(Materials.Malachite, , - // ,31_766+871); - // public static Werkstoff Mirabilite = new Werkstoff(Materials.Mirabilite, , - // ,31_766+900); - // public static Werkstoff Mica = new Werkstoff(Materials.Mica, , ,31_766+901); - // public static Werkstoff Trona = new Werkstoff(Materials.Trona, , ,31_766+903); - // public static Werkstoff Barite = new Werkstoff(Materials.Barite, , ,31_766+904); - // public static Werkstoff Gypsum = new Werkstoff(Materials.Gypsum, , ,31_766+934); - // public static Werkstoff Alunite = new Werkstoff(Materials.Alunite, , - // ,31_766+911); - // public static Werkstoff Dolomite = new Werkstoff(Materials.Dolomite, , - // ,31_766+914); - // public static Werkstoff Wollastonite = new Werkstoff(Materials.Wollastonite, , - // ,31_766+915); - // public static Werkstoff Zeolite = new Werkstoff(Materials.Zeolite, , - // ,31_766+916); - // public static Werkstoff Kyanite = new Werkstoff(Materials.Kyanite, , - // ,31_766+924); - // public static Werkstoff Kaolinite = new Werkstoff(Materials.Kaolinite, , - // ,31_766+929); - // public static Werkstoff Talc = new Werkstoff(Materials.Talc, , ,31_766+902); - // public static Werkstoff Soapstone = new Werkstoff(Materials.Soapstone, , - // ,31_766+877); - // public static Werkstoff Concrete = new Werkstoff(Materials.Concrete, , - // ,31_766+947); - // public static Werkstoff IronMagnetic = new Werkstoff(Materials.IronMagnetic, , - // ,31_766+354); - // public static Werkstoff SteelMagnetic = new Werkstoff(Materials.SteelMagnetic, , - // ,31_766+355); - // public static Werkstoff NeodymiumMagnetic = new Werkstoff(Materials.NeodymiumMagnetic, , - // ,31_766+356); - // public static Werkstoff SamariumMagnetic = new Werkstoff(Materials.SamariumMagnetic, , - // ,31_766+399); - - // public static DilutedSulfuricAcid = new MaterialBuilder(31_766+640) - // public static Werkstoff EpoxidFiberReinforced = new Werkstoff(Materials.EpoxidFiberReinforced, - // , ,31_766+610); - // public static PotassiumNitrade = new MaterialBuilder(59 - // public static ChromiumTrioxide = new MaterialBuilder(31_766+591) - // public static Nitrochlorobenzene = new MaterialBuilder(31_766+592) - // public static Dimethylbenzene = new MaterialBuilder(31_766+593) - // public static Potassiumdichromate = new MaterialBuilder(594 - // public static PhthalicAcid = new MaterialBuilder(31_766+595) - // public static Dichlorobenzidine = new MaterialBuilder(31_766+596) - // public static Diaminobenzidin = new MaterialBuilder(31_766+597) - // public static Diphenylisophthalate = new MaterialBuilder(59 - // public static Werkstoff Polybenzimidazole = new Werkstoff(Materials.Polybenzimidazole, , - // , 31_766+599); - // public static NitrousOxide = new MaterialBuilder(31_766+993) - // public static AntiKnock = new MaterialBuilder(31_766+994) - // public static Octane = new MaterialBuilder(31_766+995) - // public static GasolineRaw = new MaterialBuilder(31_766+996) - // public static GasolineRegular = new MaterialBuilder(31_766+997) - // public static GasolinePremium = new MaterialBuilder(31_766+998) - // public static Werkstoff Electrotine = new Werkstoff(Materials.Electrotine, , - // ,31_766+812); - // public static Galgadorian = new Werkstoff(Materials.Galgadorian, , ,31_766+384); - // public static Werkstoff EnhancedGalgadorian = new Werkstoff(Materials.EnhancedGalgadorian, - // , ,31_766+385); - // public static Werkstoff BloodInfusedIron = new Werkstoff(Materials.BloodInfusedIron, , - // ,31_766+977); - // public static Werkstoff Shadow = new Werkstoff(Materials.Shadow, , ,31_766+368); - // public static Werkstoff Ledox = new Werkstoff(Materials.Ledox, , ,31_766+390); - // public static Werkstoff Quantium = new Werkstoff(Materials.Quantium, , - // ,31_766+391); - // public static Werkstoff Mytryl = new Werkstoff(Materials.Mytryl, , ,31_766+387); - // public static Werkstoff BlackPlutonium = new Werkstoff(Materials.BlackPlutonium, , - // ,31_766+388); - // public static Werkstoff CallistoIce = new Werkstoff(Materials.CallistoIce, , - // ,31_766+389); - // public static Werkstoff Duralumin = new Werkstoff(Materials.Duralumin, , - // ,31_766+392); - // public static Werkstoff Oriharukon = new Werkstoff(Materials.Oriharukon, , - // ,31_766+393); - // public static Werkstoff MysteriousCrystal = new Werkstoff(Materials.MysteriousCrystal, , - // ,31_766+398); - // public static Werkstoff RedstoneAlloy = new Werkstoff(Materials.RedstoneAlloy, , - // ,31_766+381); - // public static Werkstoff Soularium = new Werkstoff(Materials.Soularium, , - // ,31_766+379); - // public static Werkstoff ConductiveIron = new Werkstoff(Materials.ConductiveIron, , - // ,31_766+369); - // public static Werkstoff ElectricalSteel = new Werkstoff(Materials.ElectricalSteel, , - // ,31_766+365); - // public static Werkstoff EnergeticAlloy = new Werkstoff(Materials.EnergeticAlloy, , - // ,31_766+366); - // public static Werkstoff VibrantAlloy = new Werkstoff(Materials.VibrantAlloy, , - // ,31_766+367); - // public static Werkstoff PulsatingIron = new Werkstoff(Materials.PulsatingIron, , - // ,31_766+378); - // public static Werkstoff DarkSteel = new Werkstoff(Materials.DarkSteel, , - // ,31_766+364); - // public static Werkstoff EndSteel = new Werkstoff(Materials.EndSteel, , - // ,31_766+401); - // public static Werkstoff CrudeSteel = new Werkstoff(Materials.CrudeSteel, , - // ,31_766+402); - // public static Werkstoff CrystallineAlloy = new Werkstoff(Materials.CrystallineAlloy, , - // ,31_766+403); - // public static Werkstoff MelodicAlloy = new Werkstoff(Materials.MelodicAlloy, , - // ,31_766+404); - // public static Werkstoff StellarAlloy = new Werkstoff(Materials.StellarAlloy, , - // ,31_766+405); - // public static Werkstoff CrystallinePinkSlime = new Werkstoff(Materials.CrystallinePinkSlime, - // , ,31_766+406); - // public static Werkstoff EnergeticSilver = new Werkstoff(Materials.EnergeticSilver, , - // ,31_766+407); - // public static Werkstoff VividAlloy = new Werkstoff(Materials.VividAlloy, , - // ,31_766+408); - // public static Werkstoff Enderium = new Werkstoff(Materials.Enderium, , - // ,31_766+321); - // public static Werkstoff Mithril = new Werkstoff(Materials.Mithril, , - // ,31_766+331); - // public static Werkstoff BlueAlloy = new Werkstoff(Materials.BlueAlloy, , - // ,31_766+309); - // public static Werkstoff ShadowIron = new Werkstoff(Materials.ShadowIron, , - // ,31_766+336); - // public static Werkstoff ShadowSteel = new Werkstoff(Materials.ShadowSteel, , - // ,31_766+337); - // public static Werkstoff AstralSilver = new Werkstoff(Materials.AstralSilver, , - // ,31_766+333); - // public static Werkstoff InfinityCatalyst = new Werkstoff(Materials.InfinityCatalyst, , - // , 31_766 + 394); - // public static Werkstoff Infinity = new Werkstoff(Materials.Infinity, , , 31_766 + - // 397); - // public static Werkstoff Bedrockium = new Werkstoff(Materials.Bedrockium, , , - // 31_766 + 395); - // public static Werkstoff Trinium = new Werkstoff(Materials.Trinium, , , 31_766 + - // 868); - // public static Werkstoff Ichorium = new Werkstoff(Materials.Ichorium, , , 31_766 + - // 978); - // public static Werkstoff CosmicNeutronium = new Werkstoff(Materials.CosmicNeutronium, , - // , 31_766 + 982); - // public static Werkstoff Pentacadmiummagnesiumhexaoxid = new Werkstoff(Materials.Pentacadmiummagnesiumhexaoxid, - // , , 31_766 + 987); - // public static Werkstoff Titaniumonabariumdecacoppereikosaoxid = new - // Werkstoff(Materials.Titaniumonabariumdecacoppereikosaoxid, , , 31_766 + 988); - // public static Werkstoff Uraniumtriplatinid = new Werkstoff(Materials.Uraniumtriplatinid, , - // , 31_766 + 989); - // public static Werkstoff Vanadiumtriindinid = new Werkstoff(Materials.Vanadiumtriindinid, , - // , 31_766 + 990); - // public static Werkstoff Tetraindiumditindibariumtitaniumheptacoppertetrakaidekaoxid = new - // Werkstoff(Materials.Tetraindiumditindibariumtitaniumheptacoppertetrakaidekaoxid, , , - // 31_766 + 991); - // public static Werkstoff Tetranaquadahdiindiumhexaplatiumosminid = new - // Werkstoff(Materials.Tetranaquadahdiindiumhexaplatiumosminid, , , 31_766 + 992); - // public static Werkstoff Longasssuperconductornameforuvwire = new - // Werkstoff(Materials.Longasssuperconductornameforuvwire, , , 31_766 + 986); - // public static Werkstoff Longasssuperconductornameforuhvwire = new - // Werkstoff(Materials.Longasssuperconductornameforuhvwire, , , 31_766 + 985); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index bbbdb36349..fde9c8e9ee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -126,9 +126,6 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override @SuppressWarnings("unchecked") protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { - // String tooltip = GT_LanguageManager.getTranslation(this.getUnlocalizedName(aStack) + ".tooltip"); - // if (!tooltip.isEmpty()) - // aList.add(tooltip); if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure) { aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify")); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index b333812740..cc321e0fc0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -13,7 +13,11 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; -import java.util.*; +import java.util.ArrayList; +import java.util.BitSet; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -34,12 +38,20 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; -import gregtech.api.enums.*; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; +import gregtech.api.enums.TC_Aspects; import gregtech.api.interfaces.IItemBehaviour; import gregtech.api.interfaces.IItemContainer; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.objects.ItemData; -import gregtech.api.util.*; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; public class BW_Meta_Items { @@ -114,8 +126,8 @@ public class BW_Meta_Items { tooltip = Materials.Ultimate.getToolTip(); break; case 8: - additionalOreDictData = Materials.Superconductor.toString(); - tooltip = Materials.Superconductor.getToolTip(); + additionalOreDictData = Materials.SuperconductorUHV.toString(); + tooltip = Materials.SuperconductorUHV.getToolTip(); break; case 9: additionalOreDictData = "Infinite"; @@ -207,8 +219,6 @@ public class BW_Meta_Items { 2, aIconRegister.registerIcon(MainMod.MOD_ID + ":WrapOverlay"), this.mIconList); - // aIconRegister.registerIcon("gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + - // "/" + i)); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index 5e5b0b0f4c..d7cf480668 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -13,7 +13,84 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; -import static gregtech.api.enums.ItemList.*; +import static gregtech.api.enums.ItemList.Circuit_Board_Advanced; +import static gregtech.api.enums.ItemList.Circuit_Board_Basic; +import static gregtech.api.enums.ItemList.Circuit_Board_Bio; +import static gregtech.api.enums.ItemList.Circuit_Board_Bio_Ultra; +import static gregtech.api.enums.ItemList.Circuit_Board_Coated; +import static gregtech.api.enums.ItemList.Circuit_Board_Coated_Basic; +import static gregtech.api.enums.ItemList.Circuit_Board_Elite; +import static gregtech.api.enums.ItemList.Circuit_Board_Epoxy; +import static gregtech.api.enums.ItemList.Circuit_Board_Epoxy_Advanced; +import static gregtech.api.enums.ItemList.Circuit_Board_Fiberglass; +import static gregtech.api.enums.ItemList.Circuit_Board_Fiberglass_Advanced; +import static gregtech.api.enums.ItemList.Circuit_Board_Multifiberglass; +import static gregtech.api.enums.ItemList.Circuit_Board_Multifiberglass_Elite; +import static gregtech.api.enums.ItemList.Circuit_Board_Optical; +import static gregtech.api.enums.ItemList.Circuit_Board_Phenolic; +import static gregtech.api.enums.ItemList.Circuit_Board_Phenolic_Good; +import static gregtech.api.enums.ItemList.Circuit_Board_Plastic; +import static gregtech.api.enums.ItemList.Circuit_Board_Plastic_Advanced; +import static gregtech.api.enums.ItemList.Circuit_Board_Wetware; +import static gregtech.api.enums.ItemList.Circuit_Board_Wetware_Extreme; +import static gregtech.api.enums.ItemList.Circuit_Chip_BioCPU; +import static gregtech.api.enums.ItemList.Circuit_Chip_Biocell; +import static gregtech.api.enums.ItemList.Circuit_Chip_CPU; +import static gregtech.api.enums.ItemList.Circuit_Chip_CrystalCPU; +import static gregtech.api.enums.ItemList.Circuit_Chip_CrystalSoC; +import static gregtech.api.enums.ItemList.Circuit_Chip_CrystalSoC2; +import static gregtech.api.enums.ItemList.Circuit_Chip_HPIC; +import static gregtech.api.enums.ItemList.Circuit_Chip_ILC; +import static gregtech.api.enums.ItemList.Circuit_Chip_LPIC; +import static gregtech.api.enums.ItemList.Circuit_Chip_NAND; +import static gregtech.api.enums.ItemList.Circuit_Chip_NOR; +import static gregtech.api.enums.ItemList.Circuit_Chip_NPIC; +import static gregtech.api.enums.ItemList.Circuit_Chip_NanoCPU; +import static gregtech.api.enums.ItemList.Circuit_Chip_NeuroCPU; +import static gregtech.api.enums.ItemList.Circuit_Chip_Optical; +import static gregtech.api.enums.ItemList.Circuit_Chip_PIC; +import static gregtech.api.enums.ItemList.Circuit_Chip_PPIC; +import static gregtech.api.enums.ItemList.Circuit_Chip_QPIC; +import static gregtech.api.enums.ItemList.Circuit_Chip_QuantumCPU; +import static gregtech.api.enums.ItemList.Circuit_Chip_Ram; +import static gregtech.api.enums.ItemList.Circuit_Chip_Simple_SoC; +import static gregtech.api.enums.ItemList.Circuit_Chip_SoC; +import static gregtech.api.enums.ItemList.Circuit_Chip_SoC2; +import static gregtech.api.enums.ItemList.Circuit_Chip_Stemcell; +import static gregtech.api.enums.ItemList.Circuit_Chip_UHPIC; +import static gregtech.api.enums.ItemList.Circuit_Chip_ULPIC; +import static gregtech.api.enums.ItemList.Circuit_Integrated; +import static gregtech.api.enums.ItemList.Circuit_Integrated_Good; +import static gregtech.api.enums.ItemList.Circuit_Parts_Advanced; +import static gregtech.api.enums.ItemList.Circuit_Parts_CapacitorASMD; +import static gregtech.api.enums.ItemList.Circuit_Parts_CapacitorSMD; +import static gregtech.api.enums.ItemList.Circuit_Parts_CapacitorXSMD; +import static gregtech.api.enums.ItemList.Circuit_Parts_Chip_Bioware; +import static gregtech.api.enums.ItemList.Circuit_Parts_Crystal_Chip_Elite; +import static gregtech.api.enums.ItemList.Circuit_Parts_Crystal_Chip_Master; +import static gregtech.api.enums.ItemList.Circuit_Parts_Crystal_Chip_Wetware; +import static gregtech.api.enums.ItemList.Circuit_Parts_DiodeASMD; +import static gregtech.api.enums.ItemList.Circuit_Parts_DiodeSMD; +import static gregtech.api.enums.ItemList.Circuit_Parts_DiodeXSMD; +import static gregtech.api.enums.ItemList.Circuit_Parts_GlassFiber; +import static gregtech.api.enums.ItemList.Circuit_Parts_InductorASMD; +import static gregtech.api.enums.ItemList.Circuit_Parts_InductorSMD; +import static gregtech.api.enums.ItemList.Circuit_Parts_InductorXSMD; +import static gregtech.api.enums.ItemList.Circuit_Parts_PetriDish; +import static gregtech.api.enums.ItemList.Circuit_Parts_ResistorASMD; +import static gregtech.api.enums.ItemList.Circuit_Parts_ResistorSMD; +import static gregtech.api.enums.ItemList.Circuit_Parts_ResistorXSMD; +import static gregtech.api.enums.ItemList.Circuit_Parts_TransistorASMD; +import static gregtech.api.enums.ItemList.Circuit_Parts_TransistorSMD; +import static gregtech.api.enums.ItemList.Circuit_Parts_TransistorXSMD; +import static gregtech.api.enums.ItemList.Circuit_Parts_Vacuum_Tube; +import static gregtech.api.enums.ItemList.Circuit_Parts_Wiring_Advanced; +import static gregtech.api.enums.ItemList.Circuit_Parts_Wiring_Basic; +import static gregtech.api.enums.ItemList.Circuit_Parts_Wiring_Elite; +import static gregtech.api.enums.ItemList.Optical_Cpu_Containment_Housing; +import static gregtech.api.enums.ItemList.Optically_Compatible_Memory; +import static gregtech.api.enums.ItemList.Optically_Perfected_CPU; +import static gregtech.api.enums.ItemList.values; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java index 24882d995c..0de9abaa4f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -61,9 +61,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { || ((material.getFluid(1) == null && material.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; - // for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) - // if (material.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) - // continue materialloop; + if (OreDictionary .doesOreNameExist(this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ", ""))) { hiddenThings.add(i); @@ -83,9 +81,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; - // for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) - // if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) - // continue materialloop; + if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ", ""))) { hiddenThings.add(i); continue; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java index 3fa75568d8..32c88c9e56 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -13,6 +13,8 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; +import static gregtech.api.enums.Mods.Forestry; + import java.util.List; import java.util.stream.Collectors; @@ -23,8 +25,6 @@ import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; - import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -39,7 +39,7 @@ public class GTMetaItemEnhancer { private GTMetaItemEnhancer() {} public static void init() { - if (!LoaderReference.Forestry) { + if (!Forestry.isModLoaded()) { return; } NoMetaValue = Materials.getMaterialsMap().values().stream().filter(m -> m.mMetaItemSubID == -1) @@ -55,11 +55,11 @@ public class GTMetaItemEnhancer { final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( m.getMolten(144), new ItemStack(moltenCapsuls, 1, i), - GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1)); FluidContainerRegistry.registerFluidContainer(emptyData); GT_Utility.addFluidContainerData(emptyData); GT_Values.RA.addFluidCannerRecipe( - GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1), + GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1), new ItemStack(moltenCapsuls, 1, i), m.getMolten(144), GT_Values.NF); @@ -71,14 +71,14 @@ public class GTMetaItemEnhancer { } if (m.getFluid(1) == null && m.getGas(1) == null) continue; if (OreDictionary.doesOreNameExist("capsule" + m.mName)) continue; - addFluidData(m, GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), capsuls, 1000, i, true); + addFluidData(m, GT_ModHandler.getModItem(Forestry.ID, "waxCapsule", 1), capsuls, 1000, i, true); // addFluidData(m, new ItemStack(Items.glass_bottle), bottles, 250, i, false); } for (int i = 0, valuesLength = NoMetaValue.size(); i < valuesLength; i++) { Materials m = NoMetaValue.get(i); if (m.getFluid(1) == null && m.getGas(1) == null) continue; if (OreDictionary.doesOreNameExist("capsule" + m.mName)) continue; - addFluidData(m, GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), capsuls, 1000, i + 1001, true); + addFluidData(m, GT_ModHandler.getModItem(Forestry.ID, "waxCapsule", 1), capsuls, 1000, i + 1001, true); // addFluidData(m, new ItemStack(Items.glass_bottle), bottles, 250, i + 1001, false); } } @@ -101,7 +101,7 @@ public class GTMetaItemEnhancer { } public static void addAdditionalOreDictToForestry() { - if (!LoaderReference.Forestry) return; + if (!Forestry.isModLoaded()) return; OreDictionary.registerOre("capsuleWater", getForestryItem("waxCapsuleWater")); OreDictionary.registerOre("capsuleIce", getForestryItem("waxCapsuleIce")); OreDictionary.registerOre("capsuleHoney", getForestryItem("waxCapsuleHoney")); @@ -117,6 +117,6 @@ public class GTMetaItemEnhancer { } private static ItemStack getForestryItem(String itemName) { - return GT_ModHandler.getModItem("Forestry", itemName, 1); + return GT_ModHandler.getModItem(Forestry.ID, itemName, 1); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java index 2e0db87aba..8f1010017c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -14,11 +14,23 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; import static com.github.bartimaeusnek.bartworks.MainMod.MOD_ID; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.Mods.NewHorizonsCoreMod; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.ingot; +import static gregtech.api.enums.OrePrefixes.plate; +import static gregtech.api.enums.OrePrefixes.plateDense; +import static gregtech.api.enums.OrePrefixes.plateDouble; +import static gregtech.api.enums.OrePrefixes.rotor; +import static gregtech.api.enums.OrePrefixes.stick; +import static gregtech.api.enums.OrePrefixes.stickLong; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; import java.util.function.Consumer; import java.util.function.Predicate; @@ -31,7 +43,6 @@ import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.reflect.FieldUtils; import org.apache.commons.lang3.reflect.MethodUtils; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -42,9 +53,13 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.objects.ItemData; -import gregtech.api.util.*; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Shaped_Recipe; +import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; @SuppressWarnings("ALL") @@ -86,7 +101,7 @@ public class LuVTierEnhancer implements Runnable { Arrays.stream(ItemList.values()).filter(item -> item.toString().contains("LuV") && item.hasBeenSet()) .forEach(item -> LuVMachines.add(item.get(1))); - if (LoaderReference.dreamcraft) { + if (NewHorizonsCoreMod.isModLoaded()) { addDreamcraftItemListItems(LuVMachines); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index fadea47d5d..77bc39ba69 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -13,22 +13,87 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; -import static gregtech.api.enums.OrePrefixes.*; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.AcidicIridiumSolution; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.AcidicOsmiumSolution; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.AmmoniumChloride; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.AquaRegia; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.CalciumChloride; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.CrudeRhMetall; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.FormicAcid; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.HotRutheniumTetroxideSollution; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.IrLeachResidue; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.IrOsLeachResidue; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.IridiumChloride; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.IridiumDioxide; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.LeachResidue; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.OsmiumSolution; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.PDAmmonia; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.PDMetallicPowder; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.PDRawPowder; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.PDSalt; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.PGSDResidue; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.PGSDResidue2; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.PTConcentrate; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.PTMetallicPowder; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.PTRawPowder; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.PTResidue; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.PTSaltCrude; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.PTSaltRefined; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.PotassiumDisulfate; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.RHFilterCakeSolution; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.RHNitrate; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.RHSalt; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.RHSaltSolution; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.RHSulfate; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.RHSulfateSolution; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.ReRh; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.RhFilterCake; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Rhodium; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Ruthenium; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.RutheniumTetroxide; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.RutheniumTetroxideSollution; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.SodiumNitrate; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.SodiumRuthenate; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Sodiumformate; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Sodiumsulfate; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.ZincSulfate; +import static gregtech.api.enums.Mods.GTPlusPlus; +import static gregtech.api.enums.Mods.NewHorizonsCoreMod; +import static gregtech.api.enums.OrePrefixes.cell; +import static gregtech.api.enums.OrePrefixes.crateGtDust; +import static gregtech.api.enums.OrePrefixes.crushed; +import static gregtech.api.enums.OrePrefixes.crushedCentrifuged; +import static gregtech.api.enums.OrePrefixes.crushedPurified; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.dustImpure; +import static gregtech.api.enums.OrePrefixes.dustPure; +import static gregtech.api.enums.OrePrefixes.dustRefined; +import static gregtech.api.enums.OrePrefixes.dustSmall; +import static gregtech.api.enums.OrePrefixes.dustTiny; +import static gregtech.api.enums.OrePrefixes.ingot; +import static gregtech.api.enums.OrePrefixes.nugget; import java.lang.reflect.Field; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.*; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.ShapedRecipes; +import net.minecraft.item.crafting.ShapelessRecipes; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; import org.apache.commons.lang3.reflect.FieldUtils; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -881,7 +946,7 @@ public class PlatinumSludgeOverHaul { if (obj instanceof ShapedRecipes || (obj instanceof ShapelessRecipes)) { inputName = "recipeOutput"; inputItemName = "recipeItems"; - } else if (LoaderReference.miscutils) { + } else if (GTPlusPlus.isModLoaded()) { try { if (Class.forName("gtPlusPlus.api.objects.minecraft.ShapedRecipe").isAssignableFrom(obj.getClass())) obj = CachedReflectionUtils.getField(obj.getClass(), "mRecipe").get(obj); @@ -992,7 +1057,7 @@ public class PlatinumSludgeOverHaul { if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(BartWorksCrossmod.MOD_ID)) return true; - if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals("dreamcraft") + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(NewHorizonsCoreMod.ID) && !stack.getUnlocalizedName().contains("dust") && !stack.getUnlocalizedName().contains("Dust")) return true; @@ -1013,7 +1078,7 @@ public class PlatinumSludgeOverHaul { .contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); } - if (LoaderReference.miscutils) { + if (GTPlusPlus.isModLoaded()) { try { if (Class.forName("gtPlusPlus.core.item.base.BaseItemComponent") .isAssignableFrom(stack.getItem().getClass()) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index b04068521b..a71bfe8b92 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -13,12 +13,24 @@ package com.github.bartimaeusnek.bartworks.system.material; +import static gregtech.api.enums.Mods.GalaxySpace; import static net.minecraft.util.EnumChatFormatting.DARK_PURPLE; import static net.minecraft.util.EnumChatFormatting.GREEN; import java.lang.reflect.InvocationTargetException; import java.nio.ByteBuffer; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -26,14 +38,23 @@ import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.StaticRecipeChangeLoaders; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; -import com.github.bartimaeusnek.bartworks.util.*; +import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.MurmurHash3; +import com.github.bartimaeusnek.bartworks.util.NonNullWrappedHashMap; +import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.github.bartimaeusnek.crossmod.tgregworks.MaterialsInjector; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import cpw.mods.fml.common.Loader; import gregtech.api.GregTech_API; -import gregtech.api.enums.*; +import gregtech.api.enums.FluidState; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; +import gregtech.api.enums.TC_Aspects; +import gregtech.api.enums.TextureSet; import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_LanguageManager; @@ -49,7 +70,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static final Map modNameOverrides = new HashMap() { { - put("GalaxySpace", DARK_PURPLE + "GalaxySpace"); + put(GalaxySpace.ID, DARK_PURPLE + "GalaxySpace"); } }; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 643dc62c49..cd9bb7f200 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -15,10 +15,68 @@ package com.github.bartimaeusnek.bartworks.system.material; import static com.github.bartimaeusnek.bartworks.util.BW_Util.subscriptNumbers; import static com.github.bartimaeusnek.bartworks.util.BW_Util.superscriptNumbers; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.Mods.BetterLoadingScreen; +import static gregtech.api.enums.Mods.Forestry; +import static gregtech.api.enums.OrePrefixes.block; +import static gregtech.api.enums.OrePrefixes.bolt; +import static gregtech.api.enums.OrePrefixes.bottle; +import static gregtech.api.enums.OrePrefixes.capsule; +import static gregtech.api.enums.OrePrefixes.cell; +import static gregtech.api.enums.OrePrefixes.cellPlasma; +import static gregtech.api.enums.OrePrefixes.crushed; +import static gregtech.api.enums.OrePrefixes.crushedCentrifuged; +import static gregtech.api.enums.OrePrefixes.crushedPurified; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.dustImpure; +import static gregtech.api.enums.OrePrefixes.dustPure; +import static gregtech.api.enums.OrePrefixes.dustSmall; +import static gregtech.api.enums.OrePrefixes.dustTiny; +import static gregtech.api.enums.OrePrefixes.foil; +import static gregtech.api.enums.OrePrefixes.gearGt; +import static gregtech.api.enums.OrePrefixes.gearGtSmall; +import static gregtech.api.enums.OrePrefixes.gem; +import static gregtech.api.enums.OrePrefixes.gemChipped; +import static gregtech.api.enums.OrePrefixes.gemExquisite; +import static gregtech.api.enums.OrePrefixes.gemFlawed; +import static gregtech.api.enums.OrePrefixes.gemFlawless; +import static gregtech.api.enums.OrePrefixes.ingot; +import static gregtech.api.enums.OrePrefixes.ingotDouble; +import static gregtech.api.enums.OrePrefixes.ingotHot; +import static gregtech.api.enums.OrePrefixes.ingotQuadruple; +import static gregtech.api.enums.OrePrefixes.ingotQuintuple; +import static gregtech.api.enums.OrePrefixes.ingotTriple; +import static gregtech.api.enums.OrePrefixes.lens; +import static gregtech.api.enums.OrePrefixes.nugget; +import static gregtech.api.enums.OrePrefixes.ore; +import static gregtech.api.enums.OrePrefixes.oreSmall; +import static gregtech.api.enums.OrePrefixes.plate; +import static gregtech.api.enums.OrePrefixes.plateDense; +import static gregtech.api.enums.OrePrefixes.plateDouble; +import static gregtech.api.enums.OrePrefixes.plateQuadruple; +import static gregtech.api.enums.OrePrefixes.plateQuintuple; +import static gregtech.api.enums.OrePrefixes.plateTriple; +import static gregtech.api.enums.OrePrefixes.ring; +import static gregtech.api.enums.OrePrefixes.rotor; +import static gregtech.api.enums.OrePrefixes.screw; +import static gregtech.api.enums.OrePrefixes.spring; +import static gregtech.api.enums.OrePrefixes.springSmall; +import static gregtech.api.enums.OrePrefixes.stick; +import static gregtech.api.enums.OrePrefixes.stickLong; +import static gregtech.api.enums.OrePrefixes.toolHeadHammer; +import static gregtech.api.enums.OrePrefixes.toolHeadSaw; +import static gregtech.api.enums.OrePrefixes.toolHeadWrench; +import static gregtech.api.enums.OrePrefixes.turbineBlade; +import static gregtech.api.enums.OrePrefixes.values; +import static gregtech.api.enums.OrePrefixes.wireFine; import java.lang.reflect.Field; -import java.util.*; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -29,7 +87,6 @@ import net.minecraftforge.oredict.OreDictionary; import org.apache.logging.log4j.Level; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.API.WerkstoffAdderRegistry; import com.github.bartimaeusnek.bartworks.MainMod; @@ -39,7 +96,20 @@ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_C import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.GTMetaItemEnhancer; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; -import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.*; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.AspectLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.BlockLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.CasingLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.CellLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.CraftingMaterialLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.CrushedLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.DustLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.GemLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.MetalLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.MoltenCellLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.MultipleMetalLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.OreLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.SimpleMetalLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.ToolLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration.AssociationLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration.BridgeMaterialsLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration.CasingRegistrator; @@ -54,7 +124,13 @@ import com.google.common.collect.HashBiMap; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.ProgressManager; import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.enums.*; +import gregtech.api.enums.Element; +import gregtech.api.enums.FluidState; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; +import gregtech.api.enums.TextureSet; import gregtech.api.fluid.GT_FluidFactory; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_OreDictUnificator; @@ -1412,7 +1488,7 @@ public class WerkstoffLoader { DebugLog.log("Loading Recipes" + (System.nanoTime() - timepre)); Integer[] clsArr = new Integer[0]; int size = 0; - if (LoaderReference.betterloadingscreen) clsArr = CLSCompat.initCls(); + if (BetterLoadingScreen.isModLoaded()) clsArr = CLSCompat.initCls(); IWerkstoffRunnable[] werkstoffRunnables = new IWerkstoffRunnable[] { new ToolLoader(), new DustLoader(), new GemLoader(), new SimpleMetalLoader(), new CasingLoader(), new AspectLoader(), new OreLoader(), @@ -1430,7 +1506,7 @@ public class WerkstoffLoader { progressBar.step(""); continue; } - if (LoaderReference.betterloadingscreen) size = CLSCompat.invokeStepSize(werkstoff, clsArr, size); + if (BetterLoadingScreen.isModLoaded()) size = CLSCompat.invokeStepSize(werkstoff, clsArr, size); DebugLog.log("Werkstoff: " + werkstoff.getDefaultName() + " " + (System.nanoTime() - timepreone)); for (IWerkstoffRunnable runnable : werkstoffRunnables) { String loaderName = runnable.getClass().getSimpleName(); @@ -1444,7 +1520,9 @@ public class WerkstoffLoader { DebugLog.log("Loading New Circuits" + " " + (System.nanoTime() - timepreone)); BW_CircuitsLoader.initNewCircuits(); - if (LoaderReference.betterloadingscreen) CLSCompat.disableCls(); + if (BetterLoadingScreen.isModLoaded()) { + CLSCompat.disableCls(); + } progressBar.step("Load Additional Recipes"); AdditionalRecipes.run(); @@ -1596,15 +1674,14 @@ public class WerkstoffLoader { } if ((WerkstoffLoader.toGenerateGlobal & 0b10000) != 0) { WerkstoffLoader.items.put(cell, new BW_MetaGenerated_Items(cell)); - // WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle)); - if (LoaderReference.Forestry) WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); + if (Forestry.isModLoaded()) WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); } if ((WerkstoffLoader.toGenerateGlobal & 0b100000) != 0) { WerkstoffLoader.items.put(cellPlasma, new BW_MetaGenerated_Items(cellPlasma)); } if ((WerkstoffLoader.toGenerateGlobal & 0b1000000) != 0) { WerkstoffLoader.items.put(OrePrefixes.cellMolten, new BW_MetaGenerated_Items(OrePrefixes.cellMolten)); - if (LoaderReference.Forestry) WerkstoffLoader.items + if (Forestry.isModLoaded()) WerkstoffLoader.items .put(OrePrefixes.capsuleMolten, new BW_MetaGenerated_Items(OrePrefixes.capsuleMolten)); } if ((WerkstoffLoader.toGenerateGlobal & 0b10000000) != 0) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 14aa8fbc2d..1f2c9d9106 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -14,7 +14,19 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import static com.github.bartimaeusnek.bartworks.util.BW_Util.CLEANROOM; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.Mods.Gendustry; +import static gregtech.api.enums.OrePrefixes.bolt; +import static gregtech.api.enums.OrePrefixes.cell; +import static gregtech.api.enums.OrePrefixes.crushed; +import static gregtech.api.enums.OrePrefixes.crushedPurified; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.dustSmall; +import static gregtech.api.enums.OrePrefixes.gem; +import static gregtech.api.enums.OrePrefixes.gemChipped; +import static gregtech.api.enums.OrePrefixes.gemExquisite; +import static gregtech.api.enums.OrePrefixes.gemFlawed; +import static gregtech.api.enums.OrePrefixes.stick; +import static gregtech.api.enums.OrePrefixes.stickLong; import java.lang.reflect.Field; import java.util.Map; @@ -28,7 +40,6 @@ import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.reflect.FieldUtils; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; @@ -39,10 +50,19 @@ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_M import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.LuVTierEnhancer; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.*; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.BioCulture; +import com.github.bartimaeusnek.bartworks.util.BioDNA; +import com.github.bartimaeusnek.bartworks.util.BioData; +import com.github.bartimaeusnek.bartworks.util.BioPlasmid; import gregtech.api.GregTech_API; -import gregtech.api.enums.*; +import gregtech.api.enums.Element; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -60,7 +80,7 @@ public class AdditionalRecipes { private static void runBWRecipes() { if (ConfigHandler.BioLab) { - FluidStack[] dnaFluid = { LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) + FluidStack[] dnaFluid = { Gendustry.isModLoaded() ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L) }; for (ItemStack stack : BioItemList.getAllPetriDishes()) { @@ -378,8 +398,6 @@ public class AdditionalRecipes { BW_Util.getMachineVoltageFromTier(5)); // Milk - // GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), - // Materials.Milk.getFluid(12000), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500, 49152, 600000000); GT_Values.RA.addCentrifugeRecipe( GT_Utility.getIntegratedCircuit(1), GT_Values.NI, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java index 264ace8f96..f31945f154 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java @@ -13,9 +13,10 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.Mods.Thaumcraft; + import java.util.Objects; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; @@ -30,7 +31,10 @@ public class AspectLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - if (!LoaderReference.Thaumcraft) return; + if (!Thaumcraft.isModLoaded()) { + return; + } + for (OrePrefixes enabledOrePrefixes : WerkstoffLoader.ENABLED_ORE_PREFIXES) { if (werkstoff.hasItemType(enabledOrePrefixes)) { if (enabledOrePrefixes.mMaterialAmount >= 3628800L || enabledOrePrefixes == OrePrefixes.ore) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java index 8a06acfc56..d8b5d87c19 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java @@ -13,7 +13,10 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.OrePrefixes.block; +import static gregtech.api.enums.OrePrefixes.cellMolten; +import static gregtech.api.enums.OrePrefixes.ingot; +import static gregtech.api.enums.OrePrefixes.plate; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java index e8063c1f6d..be8a2f95ad 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java @@ -13,7 +13,14 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.OrePrefixes.blockCasing; +import static gregtech.api.enums.OrePrefixes.blockCasingAdvanced; +import static gregtech.api.enums.OrePrefixes.gearGt; +import static gregtech.api.enums.OrePrefixes.gearGtSmall; +import static gregtech.api.enums.OrePrefixes.plank; +import static gregtech.api.enums.OrePrefixes.plate; +import static gregtech.api.enums.OrePrefixes.plateDouble; +import static gregtech.api.enums.OrePrefixes.screw; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java index ce3207484b..b128d7dac6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java @@ -13,7 +13,10 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.Mods.Forestry; +import static gregtech.api.enums.OrePrefixes.capsule; +import static gregtech.api.enums.OrePrefixes.cell; +import static gregtech.api.enums.OrePrefixes.dust; import java.util.ArrayList; import java.util.HashMap; @@ -24,14 +27,17 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.Pair; -import gregtech.api.enums.*; +import gregtech.api.enums.Element; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.TextureSet; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -184,11 +190,11 @@ public class CellLoader implements IWerkstoffRunnable { GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)); - if (LoaderReference.Forestry) { + if (Forestry.isModLoaded()) { FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(capsule), - GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), + GT_ModHandler.getModItem(Forestry.ID, "waxCapsule", 1), true); GT_Utility.addFluidContainerData(emptyData); FluidContainerRegistry.registerFluidContainer(emptyData); @@ -240,14 +246,7 @@ public class CellLoader implements IWerkstoffRunnable { if (!ElementSet) return; GT_OreDictUnificator.addAssociation(cell, werkstoffBridgeMaterial, werkstoff.get(cell), false); - // try { - // Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); - // f.setAccessible(true); - // Map MATERIALS_MAP = (Map) f.get(null); - // MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); - // } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { - // e.printStackTrace(); - // } + ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); @@ -264,10 +263,6 @@ public class CellLoader implements IWerkstoffRunnable { (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); - // GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, - // new ItemStack[]{Materials.Empty.getCells(1)}, new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, - // new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) - // (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java index 539131810b..00a9915ca9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java @@ -13,11 +13,24 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.OrePrefixes.bolt; +import static gregtech.api.enums.OrePrefixes.cellMolten; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.dustSmall; +import static gregtech.api.enums.OrePrefixes.dustTiny; +import static gregtech.api.enums.OrePrefixes.gearGt; +import static gregtech.api.enums.OrePrefixes.gearGtSmall; +import static gregtech.api.enums.OrePrefixes.gem; +import static gregtech.api.enums.OrePrefixes.ingot; +import static gregtech.api.enums.OrePrefixes.plate; +import static gregtech.api.enums.OrePrefixes.ring; +import static gregtech.api.enums.OrePrefixes.rotor; +import static gregtech.api.enums.OrePrefixes.screw; +import static gregtech.api.enums.OrePrefixes.stick; +import static gregtech.api.enums.OrePrefixes.wireFine; import net.minecraft.item.ItemStack; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; @@ -127,14 +140,11 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { werkstoff.get(gearGtSmall), (int) werkstoff.getStats().getMass(), 8 * tVoltageMultiplier); - if (ConfigHandler.hardmode) GT_ModHandler.addCraftingRecipe( + + GT_ModHandler.addCraftingRecipe( werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[] { " S ", "hPx", " S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate) }); - else GT_ModHandler.addCraftingRecipe( - werkstoff.get(gearGtSmall), - GT_Proxy.tBits, - new Object[] { "P ", " h ", 'P', werkstoff.get(plate) }); // Rotor GT_ModHandler.addCraftingRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java index 7fa823d520..f3e2d1dba9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java @@ -13,7 +13,17 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.OrePrefixes.crushed; +import static gregtech.api.enums.OrePrefixes.crushedCentrifuged; +import static gregtech.api.enums.OrePrefixes.crushedPurified; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.dustImpure; +import static gregtech.api.enums.OrePrefixes.dustPure; +import static gregtech.api.enums.OrePrefixes.dustSmall; +import static gregtech.api.enums.OrePrefixes.gem; +import static gregtech.api.enums.OrePrefixes.ingot; +import static gregtech.api.enums.OrePrefixes.nugget; +import static gregtech.api.enums.OrePrefixes.ore; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java index cba5049dbe..dca73ad91b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java @@ -13,7 +13,15 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.OrePrefixes.block; +import static gregtech.api.enums.OrePrefixes.cell; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.dustSmall; +import static gregtech.api.enums.OrePrefixes.dustTiny; +import static gregtech.api.enums.OrePrefixes.gem; +import static gregtech.api.enums.OrePrefixes.ingot; +import static gregtech.api.enums.OrePrefixes.ingotHot; +import static gregtech.api.enums.OrePrefixes.nugget; import java.util.ArrayList; import java.util.HashMap; @@ -376,8 +384,6 @@ public class DustLoader implements IWerkstoffRunnable { null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint()); - // GT_ModHandler.addRCBlastFurnaceRecipe(werkstoff.get(ingot), werkstoff.get(dust), - // werkstoff.getStats().getMeltingPoint()); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java index d8a8269888..3788f50a31 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java @@ -13,7 +13,19 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.OrePrefixes.block; +import static gregtech.api.enums.OrePrefixes.crushedPurified; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.dustSmall; +import static gregtech.api.enums.OrePrefixes.dustTiny; +import static gregtech.api.enums.OrePrefixes.gem; +import static gregtech.api.enums.OrePrefixes.gemChipped; +import static gregtech.api.enums.OrePrefixes.gemExquisite; +import static gregtech.api.enums.OrePrefixes.gemFlawed; +import static gregtech.api.enums.OrePrefixes.gemFlawless; +import static gregtech.api.enums.OrePrefixes.lens; +import static gregtech.api.enums.OrePrefixes.ore; +import static gregtech.api.enums.OrePrefixes.plate; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java index 9b861c700d..0481c0872b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -13,14 +13,31 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.Mods.Forestry; +import static gregtech.api.enums.OrePrefixes.block; +import static gregtech.api.enums.OrePrefixes.bolt; +import static gregtech.api.enums.OrePrefixes.capsuleMolten; +import static gregtech.api.enums.OrePrefixes.cellMolten; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.dustSmall; +import static gregtech.api.enums.OrePrefixes.dustTiny; +import static gregtech.api.enums.OrePrefixes.gearGt; +import static gregtech.api.enums.OrePrefixes.gearGtSmall; +import static gregtech.api.enums.OrePrefixes.ingot; +import static gregtech.api.enums.OrePrefixes.nugget; +import static gregtech.api.enums.OrePrefixes.plate; +import static gregtech.api.enums.OrePrefixes.plateDouble; +import static gregtech.api.enums.OrePrefixes.ring; +import static gregtech.api.enums.OrePrefixes.rotor; +import static gregtech.api.enums.OrePrefixes.screw; +import static gregtech.api.enums.OrePrefixes.stick; +import static gregtech.api.enums.OrePrefixes.stickLong; import java.util.Objects; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; @@ -84,9 +101,6 @@ public class MoltenCellLoader implements IWerkstoffRunnable { werkstoff.get(ingot), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - // GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), - // werkstoff.get(block), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : - // 30); GT_Values.RA.addFluidSolidifierRecipe( ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), @@ -226,16 +240,16 @@ public class MoltenCellLoader implements IWerkstoffRunnable { GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); - if (!LoaderReference.Forestry) return; + if (!Forestry.isModLoaded()) return; final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(capsuleMolten), - GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1)); FluidContainerRegistry.registerFluidContainer( werkstoff.getMolten(144), werkstoff.get(capsuleMolten), - GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1)); GT_Utility.addFluidContainerData(emptyData); GT_Values.RA.addFluidCannerRecipe( werkstoff.get(capsuleMolten), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java index 72cce06013..aba41181a4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java @@ -13,7 +13,10 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.ingot; +import static gregtech.api.enums.OrePrefixes.plateDense; +import static gregtech.api.enums.OrePrefixes.plateDouble; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java index ab436d896b..f55169ece0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java @@ -13,7 +13,11 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.OrePrefixes.crushed; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.gem; +import static gregtech.api.enums.OrePrefixes.ingot; +import static gregtech.api.enums.OrePrefixes.ore; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java index 19bc6ecfb7..923ce10ad7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java @@ -13,7 +13,15 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.OrePrefixes.block; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.dustSmall; +import static gregtech.api.enums.OrePrefixes.foil; +import static gregtech.api.enums.OrePrefixes.gem; +import static gregtech.api.enums.OrePrefixes.ingot; +import static gregtech.api.enums.OrePrefixes.plate; +import static gregtech.api.enums.OrePrefixes.stick; +import static gregtech.api.enums.OrePrefixes.stickLong; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java index 3c4ace4814..a239efb657 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java @@ -13,7 +13,21 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.OrePrefixes.bolt; +import static gregtech.api.enums.OrePrefixes.cellMolten; +import static gregtech.api.enums.OrePrefixes.gearGtSmall; +import static gregtech.api.enums.OrePrefixes.gem; +import static gregtech.api.enums.OrePrefixes.ingot; +import static gregtech.api.enums.OrePrefixes.plate; +import static gregtech.api.enums.OrePrefixes.plateDouble; +import static gregtech.api.enums.OrePrefixes.ring; +import static gregtech.api.enums.OrePrefixes.screw; +import static gregtech.api.enums.OrePrefixes.stick; +import static gregtech.api.enums.OrePrefixes.stickLong; +import static gregtech.api.enums.OrePrefixes.toolHeadHammer; +import static gregtech.api.enums.OrePrefixes.toolHeadSaw; +import static gregtech.api.enums.OrePrefixes.toolHeadWrench; +import static gregtech.api.enums.OrePrefixes.turbineBlade; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -560,10 +574,5 @@ public class ToolLoader implements IWerkstoffRunnable { ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Sodium.get(1L) }); - - // GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(16,1, - // werkstoff.getBridgeMaterial(),werkstoff.getBridgeMaterial(),null), - // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", - // "III", " I ", 'I', werkstoff.get(ingot)}); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java index 474ee3d936..46f546319d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java @@ -13,19 +13,26 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration; -import static gregtech.api.enums.OrePrefixes.*; +import static gregtech.api.enums.Mods.Thaumcraft; +import static gregtech.api.enums.OrePrefixes.cell; +import static gregtech.api.enums.OrePrefixes.cellMolten; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.values; import java.util.ArrayList; import net.minecraft.item.ItemStack; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import gregtech.api.enchants.Enchantment_Radioactivity; -import gregtech.api.enums.*; +import gregtech.api.enums.Element; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -113,17 +120,10 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { break; } } - if (!ElementSet) continue; - // try { - // Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); - // f.setAccessible(true); - // Map MATERIALS_MAP = (Map) f.get(null); - // MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); - // } catch (NoSuchFieldException | IllegalAccessException | - // ClassCastException e) { - // e.printStackTrace(); - // } + if (!ElementSet) { + continue; + } + if (werkstoff.hasItemType(dust)) { ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); @@ -141,11 +141,6 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); - // GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new - // BWRecipes.DynamicGTRecipe(false, null, new ItemStack[]{werkstoff.get(prefixes)}, - // scannerOutput, null, new - // FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) - // (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); } } } @@ -168,7 +163,9 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { werkstoffBridgeMaterial.mLocalizedName = GT_LanguageManager.addStringLocalization( "Material." + werkstoffBridgeMaterial.mName.toLowerCase(), werkstoffBridgeMaterial.mDefaultLocalName); - if (LoaderReference.Thaumcraft) werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects(); + if (Thaumcraft.isModLoaded()) { + werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects(); + } werkstoffBridgeMaterial.mMaterialInto = werkstoffBridgeMaterial; werkstoffBridgeMaterial.mHandleMaterial = werkstoff.contains(SubTag.BURNING) ? Materials.Blaze : werkstoff.contains(SubTag.MAGICAL) ? Materials.Thaumium diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java index 1e83c8157f..86e5673ebf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java @@ -13,7 +13,12 @@ package com.github.bartimaeusnek.bartworks.system.object; -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java index 71a41f466b..1efa707f2d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java @@ -27,7 +27,11 @@ import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.system.material.*; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_SmallOres; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.MurmurHash3; import com.github.bartimaeusnek.bartworks.util.Pair; import com.google.common.collect.ArrayListMultimap; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index c8b6459add..13cfc9c166 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -13,9 +13,40 @@ package com.github.bartimaeusnek.bartworks.system.oregen; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Arsenopyrite; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Bismuthinit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Bismutite; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Bornite; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.ChromoAluminoPovondrait; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.DescloiziteCUVO4; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.DescloiziteZNVO4; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Djurleit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Fayalit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Ferberite; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.FluorBuergerit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Forsterit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.FuchsitAL; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.FuchsitCR; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Hedenbergit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Huebnerit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Loellingit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Olenit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.RedZircon; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Roquesit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Thorianit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.VanadioOxyDravit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Wittichenit; import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; -import static gregtech.api.enums.Materials.*; +import static gregtech.api.enums.Materials.Bismuth; +import static gregtech.api.enums.Materials.Coal; +import static gregtech.api.enums.Materials.Diamond; +import static gregtech.api.enums.Materials.Graphite; +import static gregtech.api.enums.Materials.Lepidolite; +import static gregtech.api.enums.Materials.Scheelite; +import static gregtech.api.enums.Materials.Spodumene; +import static gregtech.api.enums.Materials.Stibnite; +import static gregtech.api.enums.Materials.Tetrahedrite; +import static gregtech.api.enums.Materials.Uraninite; import net.minecraft.block.Block; import net.minecraft.init.Blocks; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java index 0566541d44..7636d0cd64 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java @@ -13,9 +13,36 @@ package com.github.bartimaeusnek.bartworks.system.oregen; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.BArTiMaEuSNeK; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Bornite; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.ChromoAluminoPovondrait; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Djurleit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Fayalit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Ferberite; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.FluorBuergerit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Fluorspar; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.FuchsitAL; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.FuchsitCR; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Hedenbergit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Huebnerit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Loellingit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Olenit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Prasiolite; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.RedZircon; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Tiberium; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.VanadioOxyDravit; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Wittichenit; import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; -import static gregtech.api.enums.Materials.*; +import static gregtech.api.enums.Materials.Amethyst; +import static gregtech.api.enums.Materials.Barite; +import static gregtech.api.enums.Materials.Galena; +import static gregtech.api.enums.Materials.Helium_3; +import static gregtech.api.enums.Materials.NaquadahEnriched; +import static gregtech.api.enums.Materials.Olivine; +import static gregtech.api.enums.Materials.SaltWater; +import static gregtech.api.enums.Materials.Scheelite; +import static gregtech.api.enums.Materials.Sphalerite; +import static gregtech.api.enums.Materials.Tetrahedrite; import net.minecraft.block.Block; import net.minecraft.util.StatCollector; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index ecf31705be..116fd7f1ef 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -16,7 +16,13 @@ package com.github.bartimaeusnek.bartworks.util; import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; import static com.github.bartimaeusnek.bartworks.util.BW_Util.specialToByte; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; import java.util.function.Supplier; import javax.annotation.Nonnegative; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java index c08c5d4077..75d8d4cc62 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java @@ -13,7 +13,10 @@ package com.github.bartimaeusnek.bartworks.util; -import static net.minecraft.util.EnumChatFormatting.*; +import static net.minecraft.util.EnumChatFormatting.BLUE; +import static net.minecraft.util.EnumChatFormatting.DARK_BLUE; +import static net.minecraft.util.EnumChatFormatting.GRAY; +import static net.minecraft.util.EnumChatFormatting.GREEN; import java.util.function.Function; import java.util.function.Supplier; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index eb0489edec..425098f702 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -13,11 +13,22 @@ package com.github.bartimaeusnek.bartworks.util; -import static gregtech.api.enums.GT_Values.*; +import static gregtech.api.enums.GT_Values.D1; +import static gregtech.api.enums.GT_Values.E; +import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GT_Values.VN; +import static gregtech.api.enums.GT_Values.W; import java.lang.reflect.Array; import java.lang.reflect.Field; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Collectors; @@ -60,7 +71,13 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.ItemData; -import gregtech.api.util.*; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Shaped_Recipe; +import gregtech.api.util.GT_Utility; @SuppressWarnings({ "unused", "RedundantSuppression" }) public class BW_Util { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index 5ea53e62dd..c260b6d681 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -165,13 +165,6 @@ public class BioCulture extends BioData implements IColorModulationContainer { this.color = color; } - // public static BioCulture createAndRegisterBioCulture(Color color, String name, long ID, BioPlasmid plasmid, - // BioDNA dDNA,EnumRarity rarity){ - // BioCulture ret =new BioCulture(color,name,ID,plasmid,dDNA,rarity); - // BIO_CULTURE_ARRAY_LIST.add(ret); - // return ret; - // } - public BioPlasmid getPlasmid() { return this.plasmid; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java index 3595203ced..d8d338f977 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java @@ -88,56 +88,6 @@ public class BartsNoise implements INoiseGen { public BartsNoise copy(long seed) { return new BartsNoise(this.octaves, this.frequency, this.amplitude, seed); } - // public static void main(String[] args) throws IOException { - // - // BartsNoise noiseGen1 = new BartsNoise(2,0.005F,1D,System.nanoTime()); - //// BartsNoise noiseGen2 = new BartsNoise(1,0.002F,-1D,System.nanoTime()); - //// BartsNoise noiseGen3 = new BartsNoise(1,0.002F,-1D,System.nanoTime()); - // - // noiseGen1.setUsePhase(false); - //// noiseGen2.setUsePhase(false); - //// noiseGen3.setUsePhase(false); - // - // - // BufferedImage image = new BufferedImage(640, 640, BufferedImage.TYPE_INT_RGB); - // - // for (int chunkX = 0; chunkX < 40; chunkX++) { - // for (int chunkZ = 0; chunkZ < 40; chunkZ++) { - // for (int x = 0; x < 16; ++x) { - // for (int z = 0; z < 16; ++z) { - // double d = noiseGen1.getNoise(x + chunkX * 16, z + chunkZ * 16) * 2D; - //// double d2 = noiseGen2.getNoise(x + chunkX * 16, z + chunkZ * 16) * 2D; - //// double d3 = (noiseGen3.getNoise(x + chunkX * 16, z + chunkZ * 16) - 0.5D); - //// d3 *= 2; - // double yDev; - //// if (d3 < 0.0D) { - //// yDev = d; - //// } else if (d3 > 1.0D) { - //// yDev = d2; - //// } else { - // yDev = d*4; - //// } - // yDev=wrap(yDev,1); - // image.setRGB(x + chunkX * 16,z + chunkZ * 16,new - // Color((float)(1f*yDev),(float)(1f*yDev),(float)(1f*yDev)).getRGB()); - // } - // } - // } - // } - // File file = new File("myimage.png"); - // ImageIO.write(image, "png", file); - //// BartsNoise redNoise = NoiseColor.Blue.getColoredNoise(); - //// redNoise.setOctaves(1); - //// redNoise.setFrequency(0.05F); - //// for (int i = 40; i < 50; i++) { - //// String line = ""; - //// for (int j = 0; j < 10; j++) { - //// double num = (redNoise.getNoise(i,j)-0.5D); - //// line += num+","; - //// } - //// System.out.println(line); - //// } - // } public double getCosNoise(double x, double y) { double pr = x * this.frequency; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java index 5afd78e1b6..25da35d027 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java @@ -13,7 +13,13 @@ package com.github.bartimaeusnek.bartworks.util.accessprioritylist; -import java.util.*; +import java.util.Collection; +import java.util.Deque; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.Set; +import java.util.Spliterator; import org.apache.commons.lang3.NotImplementedException; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java index 69f9b8fb64..8d9d539524 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java @@ -10,8 +10,10 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ -@API(owner = "bartworks", apiVersion = API_REFERENCE.VERSION, provides = "bartworks util") +@API(owner = Mods.Names.BART_WORKS, apiVersion = API_REFERENCE.VERSION, provides = "bartworks util") package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.API_REFERENCE; + import cpw.mods.fml.common.API; +import gregtech.api.enums.Mods; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 315d8a4592..d29299f13c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -13,6 +13,10 @@ package com.github.bartimaeusnek.crossmod; +import static gregtech.api.enums.Mods.GTPlusPlus; +import static gregtech.api.enums.Mods.GalacticraftCore; +import static gregtech.api.enums.Mods.TecTech; + import java.io.StringReader; import net.minecraft.util.StringTranslate; @@ -21,12 +25,10 @@ import org.apache.commons.io.input.ReaderInputStream; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.tectech.TecTechResearchLoader; -import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -58,46 +60,37 @@ public class BartWorksCrossmod { @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { - // if (LoaderReference.appliedenergistics2) - // new ItemSingleItemStorageCell("singleItemStorageCell"); - if (LoaderReference.GalacticraftCore) GalacticraftProxy.preInit(preinit); - if (LoaderReference.Thaumcraft) new CustomAspects(); + if (GalacticraftCore.isModLoaded()) { + GalacticraftProxy.preInit(preinit); + } } @Mod.EventHandler public void init(FMLInitializationEvent init) { - if (LoaderReference.GalacticraftCore) GalacticraftProxy.init(init); + if (GalacticraftCore.isModLoaded()) { + GalacticraftProxy.init(init); + } } @Mod.EventHandler public void postInit(FMLPostInitializationEvent init) { - if (LoaderReference.GalacticraftCore) GalacticraftProxy.postInit(init); - if (LoaderReference.miscutils) RadioHatchCompat.run(); - if (LoaderReference.tectech) TecTechResearchLoader.runResearches(); + if (GalacticraftCore.isModLoaded()) { + GalacticraftProxy.postInit(init); + } + if (GTPlusPlus.isModLoaded()) { + RadioHatchCompat.run(); + } + if (TecTech.isModLoaded()) { + TecTechResearchLoader.runResearches(); + } } - // @Mod.EventHandler - // public void onFMLMissingMappingsEvent(FMLMissingMappingsEvent event){ - // for (FMLMissingMappingsEvent.MissingMapping mapping : event.getAll()){ - // if (mapping.name.equalsIgnoreCase()) - // } - // } - - // @Mod.EventHandler - // public void onServerStarted(FMLServerStartedEvent event) { - // if (LoaderReference.EMT){ - // try { - // TCRecipeHandler.init(); - // } catch (IllegalAccessException | InvocationTargetException e) { - // e.printStackTrace(); - // } - // } - // } - @Mod.EventHandler public void onFMLServerStart(FMLServerStartingEvent event) { - if (LoaderReference.miscutils) for (Object s : RadioHatchCompat.TranslateSet) { - StringTranslate.inject(new ReaderInputStream(new StringReader((String) s))); + if (GTPlusPlus.isModLoaded()) { + for (Object s : RadioHatchCompat.TranslateSet) { + StringTranslate.inject(new ReaderInputStream(new StringReader((String) s))); + } } } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java index e40834da12..9ead533077 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java @@ -13,10 +13,20 @@ package com.github.bartimaeusnek.crossmod.GTpp.loader; +import static gregtech.api.enums.Mods.GTPlusPlus; + import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Queue; +import java.util.Set; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -116,7 +126,7 @@ public class RadioHatchCompat { for (ModContainer container : Loader.instance().getModList()) { if (gtpp != null && bartworks != null) break; else if (container.getModId().equalsIgnoreCase(BartWorksCrossmod.MOD_ID)) bartworks = container; - else if (container.getModId().equalsIgnoreCase("miscutils")) gtpp = container; + else if (container.getModId().equalsIgnoreCase(GTPlusPlus.ID)) gtpp = container; } for (Object mats : (Set) RadioHatchCompat.materialClass.getField("mMaterialMap").get(null)) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java b/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java deleted file mode 100644 index a55ca3cb31..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java +++ /dev/null @@ -1,126 +0,0 @@ -// package com.github.bartimaeusnek.crossmod.ae2; -// -// import appeng.api.AEApi; -// import appeng.api.config.FuzzyMode; -// import appeng.api.config.IncludeExclude; -// import appeng.api.implementations.items.IStorageCell; -// import appeng.api.storage.*; -// import appeng.api.storage.data.IAEItemStack; -// import appeng.core.localization.GuiText; -// import appeng.items.contents.CellUpgrades; -// import appeng.util.Platform; -// import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; -// import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; -// import cpw.mods.fml.common.registry.GameRegistry; -// import cpw.mods.fml.relauncher.Side; -// import cpw.mods.fml.relauncher.SideOnly; -// import net.minecraft.entity.player.EntityPlayer; -// import net.minecraft.inventory.IInventory; -// import net.minecraft.item.Item; -// import net.minecraft.item.ItemStack; -// -// import java.util.List; -// -// public class ItemSingleItemStorageCell extends SimpleSubItemClass implements IStorageCell { -// -// public ItemSingleItemStorageCell(String tex) { -// super(tex); -// Item thizz = this; -// GameRegistry.registerItem(this, BartWorksCrossmod.MOD_ID+this.iconString); -// } -// -// @Override -// @SideOnly(Side.CLIENT) -// public void addInformation(ItemStack stack, EntityPlayer p_77624_2_, List lines, boolean p_77624_4_) { -// IMEInventoryHandler inventory = AEApi.instance().registries().cell().getCellInventory(stack, -// (ISaveProvider)null, StorageChannel.ITEMS); -// if (inventory instanceof ICellInventoryHandler) { -// ICellInventoryHandler handler = (ICellInventoryHandler)inventory; -// ICellInventory cellInventory = handler.getCellInv(); -// if (cellInventory != null) { -// lines.add(cellInventory.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + -// cellInventory.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal()); -// lines.add(cellInventory.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' + -// cellInventory.getTotalItemTypes() + ' ' + GuiText.Types.getLocal()); -// if (handler.isPreformatted()) { -// String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : -// GuiText.Excluded).getLocal(); -// if (handler.isFuzzy()) { -// lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Fuzzy.getLocal()); -// } else { -// lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Precise.getLocal()); -// } -// } -// } -// } -// } -// -// @Override -// public int getBytes(ItemStack itemStack) { -// return getTotalTypes(itemStack)*getBytesPerType(itemStack); -// } -// -// @Override -// public int BytePerType(ItemStack itemStack) { -// return 1; -// } -// -// @Override -// public int getBytesPerType(ItemStack itemStack) { -// return 1; -// } -// -// @Override -// public int getTotalTypes(ItemStack itemStack) { -// return 4096; -// } -// -// @Override -// public boolean isBlackListed(ItemStack itemStack, IAEItemStack iaeItemStack) { -// return iaeItemStack == null || iaeItemStack.getItem().getItemStackLimit() != 1; -// } -// -// @Override -// public boolean storableInStorageCell() { -// return true; -// } -// -// @Override -// public boolean isStorageCell(ItemStack itemStack) { -// return true; -// } -// -// @Override -// public double getIdleDrain() { -// return 4D; -// } -// -// @Override -// public boolean isEditable(ItemStack itemStack) { -// return true; -// } -// -// @Override -// public IInventory getUpgradesInventory(ItemStack itemStack) { -// return new CellUpgrades(itemStack, 2); -// } -// -// @Override -// public IInventory getConfigInventory(ItemStack itemStack) { -// return new CellUpgrades(itemStack,2); -// } -// @Override -// public FuzzyMode getFuzzyMode(ItemStack is) { -// String fz = Platform.openNbtData(is).getString("FuzzyMode"); -// -// try { -// return FuzzyMode.valueOf(fz); -// } catch (Throwable var4) { -// return FuzzyMode.IGNORE_ALL; -// } -// } -// @Override -// public void setFuzzyMode(ItemStack is, FuzzyMode fzMode) { -// Platform.openNbtData(is).setString("FuzzyMode", fzMode.name()); -// } -// } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index e95eaa92df..7c92690bf3 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -17,7 +17,11 @@ import static bloodasp.galacticgreg.registry.GalacticGregRegistry.getModContaine import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; import static gregtech.api.enums.GT_Values.VN; -import java.util.*; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; import java.util.function.Consumer; import java.util.function.Predicate; import java.util.stream.Collectors; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java index 0a030d8b7f..440b6d4dfa 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java @@ -13,6 +13,8 @@ package com.github.bartimaeusnek.crossmod.galacticraft; +import static gregtech.api.enums.Mods.GalacticraftMars; + import java.util.Random; import micdoodle8.mods.galacticraft.api.vector.Vector3; @@ -26,8 +28,6 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.world.World; import net.minecraft.world.WorldServer; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; - public class UniversalTeleportType implements ITeleportType { @Override @@ -63,7 +63,7 @@ public class UniversalTeleportType implements ITeleportType { } EntityLanderBase elb; - if (LoaderReference.GalacticraftMars) elb = PlanetsHelperClass.getLanderType(player); + if (GalacticraftMars.isModLoaded()) elb = PlanetsHelperClass.getLanderType(player); else elb = new EntityLander(player); if (!newWorld.isRemote) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java index efc3323195..59fcce82e3 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java @@ -13,7 +13,11 @@ package com.github.bartimaeusnek.crossmod.galacticraft.atmosphere; -import java.util.*; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index 89330e3d45..6a72570e5c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -13,6 +13,7 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b; +import static gregtech.api.enums.Mods.Thaumcraft; import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE; import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE; @@ -35,7 +36,6 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.PopulateChunkEvent; import net.minecraftforge.event.terraingen.TerrainGen; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WordGenerator; import com.github.bartimaeusnek.bartworks.system.worldgen.MapGenRuins; @@ -77,7 +77,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { } else if (biomeGenBase.biomeID == BiomeGenBase.mushroomIslandShore.biomeID) { this.biomesForGeneration[i] = BiomeGenBase.stoneBeach; } - if (LoaderReference.Thaumcraft) { + if (Thaumcraft.isModLoaded()) { if (ThaumcraftHandler.isTaintBiome(biomeGenBase.biomeID)) this.biomesForGeneration[i] = BiomeGenBase.taiga; else if (ConfigHandler.disableMagicalForest diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index 1ce3a61058..83f0fff1a4 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -13,17 +13,23 @@ package com.github.bartimaeusnek.crossmod.galacticraft.solarsystems; +import static gregtech.api.enums.Mods.GalaxySpace; + import java.util.Arrays; import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; -import micdoodle8.mods.galacticraft.api.galaxies.*; +import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; +import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; +import micdoodle8.mods.galacticraft.api.galaxies.Moon; +import micdoodle8.mods.galacticraft.api.galaxies.Planet; +import micdoodle8.mods.galacticraft.api.galaxies.SolarSystem; +import micdoodle8.mods.galacticraft.api.galaxies.Star; import micdoodle8.mods.galacticraft.api.vector.Vector3; import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; import micdoodle8.mods.galacticraft.core.GalacticraftCore; import net.minecraft.util.ResourceLocation; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; @@ -69,7 +75,7 @@ public class Ross128SolarSystem { new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128ba.class); Ross128SolarSystem.Ross128ba - .setTierRequired(LoaderReference.GalaxySpace ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3); + .setTierRequired(GalaxySpace.isModLoaded() ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3); GalaxyRegistry.registerSolarSystem(Ross128SolarSystem.Ross128System); GalaxyRegistry.registerPlanet(Ross128SolarSystem.Ross128b); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java index b5d7e7cb5d..507496e8db 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java @@ -40,15 +40,12 @@ public class DysonSwarmSunReplacement extends MetaTileEntity { } public void toggle() { - if (!wasBuild) { - GalacticraftCore.solarSystemSol.getMainStar().setBodyIcon( - new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/moon.png")); - wasBuild = !wasBuild; - } else { - GalacticraftCore.solarSystemSol.getMainStar().setBodyIcon( - new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/sun.png")); - wasBuild = !wasBuild; - } + ResourceLocation resourceLocation = wasBuild + ? new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/sun.png") + : new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/moon.png"); + GalacticraftCore.solarSystemSol.getMainStar().setBodyIcon(resourceLocation); + wasBuild = !wasBuild; + } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java index 30c2b3b1d7..201d820e09 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java @@ -36,10 +36,11 @@ import com.google.common.collect.HashBiMap; import cpw.mods.fml.common.Optional; import gregtech.api.enums.ItemList; +import gregtech.api.enums.Mods; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; -@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers") +@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = Mods.Names.OPEN_COMPUTERS) public class TileEntity_GTDataServer extends TileEntity implements ISidedInventory, ITileAddsInformation, ITileHasDifferentTextureSides, SimpleComponent { @@ -48,12 +49,12 @@ public class TileEntity_GTDataServer extends TileEntity private ItemStack[] mItems = new ItemStack[2]; private byte TickTimer; - @Optional.Method(modid = "OpenComputers") + @Optional.Method(modid = Mods.Names.OPEN_COMPUTERS) public String getComponentName() { return "GT-Data Server"; } - @Optional.Method(modid = "OpenComputers") + @Optional.Method(modid = Mods.Names.OPEN_COMPUTERS) @Callback public Object[] listData(Context context, Arguments args) { Set ret = new HashSet<>(); @@ -63,7 +64,7 @@ public class TileEntity_GTDataServer extends TileEntity return ret.toArray(new String[0]); } - @Optional.Method(modid = "OpenComputers") + @Optional.Method(modid = Mods.Names.OPEN_COMPUTERS) @Callback public Object[] imprintOrb(Context context, Arguments args) { return new Object[] { false }; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java index 67c0ea56f3..16b40531c5 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java @@ -13,11 +13,12 @@ package com.github.bartimaeusnek.crossmod.tectech; +import static gregtech.api.enums.Mods.GalactiGreg; + import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -36,8 +37,7 @@ public class TecTechResearchLoader { ? FluidRegistry.getFluid("molten.indalloy140") : FluidRegistry.getFluid("molten.solderingalloy"); - if (LoaderReference.galacticgreg) { - + if (GalactiGreg.isModLoaded()) { TT_recipeAdder.addResearchableAssemblylineRecipe( ItemRegistry.voidminer[0].copy(), 1024000, @@ -82,7 +82,7 @@ public class TecTechResearchLoader { new Object[] { ItemList.Machine_Multi_ImplosionCompressor.get(1L), Materials.Neutronium.getBlocks(5), GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorUHV, 64), ItemList.Electric_Piston_UV.get(64), }, new FluidStack[] { new FluidStack(solderIndalloy, 1440), Materials.Osmium.getMolten(1440), Materials.Neutronium.getMolten(1440) }, @@ -90,33 +90,5 @@ public class TecTechResearchLoader { 240000, BW_Util.getMachineVoltageFromTier(8)); - // BartWorksCrossmod.LOGGER.info("Nerfing Assembly Lines >= LuV Recipes to run with TecTech!"); - // HashSet toRem = new HashSet<>(); - // for (GT_Recipe.GT_Recipe_AssemblyLine recipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){ - // if (recipe.mEUt >= BW_Util.getTierVoltage(6) && !GT_Utility.areStacksEqual(recipe.mResearchItem, - // CustomItemList.UnusedStuff.get(1L))){ - // String modId = GameRegistry.findUniqueIdentifierFor(recipe.mOutput.getItem()).modId; - // if (!modId.equalsIgnoreCase("tectech")) - // if (!modId.equalsIgnoreCase("gregtech") || modId.equalsIgnoreCase("gregtech") && - // (recipe.mOutput.getItemDamage() < 15000 || recipe.mOutput.getItemDamage() > 16999)) - // toRem.add(recipe); - // } - // } - // HashSet toRemVisualScanner = new HashSet<>(); - // HashSet toRemVisualAssLine = new HashSet<>(); - // GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.removeAll(toRem); - // - // for (GT_Recipe.GT_Recipe_AssemblyLine recipe : toRem){ - // GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.stream().filter(re -> - // GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisualAssLine::add); - // GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.stream().filter(re -> - // GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisualScanner::add); - // TT_recipeAdder.addResearchableAssemblylineRecipe(recipe.mResearchItem, recipe.mResearchTime, - // recipe.mResearchTime/1000, recipe.mEUt, GT_Utility.getTier(recipe.mEUt)-2, recipe.mInputs, - // recipe.mFluidInputs, recipe.mOutput, recipe.mDuration, recipe.mEUt); - // } - // - // GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.removeAll(toRemVisualScanner); - // GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.removeAll(toRemVisualAssLine); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java index d9cf64f221..44903e58e5 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java @@ -1,5 +1,7 @@ package com.github.bartimaeusnek.crossmod.tgregworks; +import static gregtech.api.enums.Mods.TinkersGregworks; + import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -14,7 +16,6 @@ import vexatos.tgregworks.integration.TGregRegistry; import vexatos.tgregworks.item.ItemTGregPart; import vexatos.tgregworks.reference.Config; -import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -50,7 +51,7 @@ public class MaterialsInjector { @Mod.EventHandler public void init(FMLInitializationEvent init) { - if (LoaderReference.TGregworks) { + if (TinkersGregworks.isModLoaded()) { MaterialsInjector.preinit(); MaterialsInjector.run(); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java deleted file mode 100644 index 28d5ba07cc..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.thaumcraft; - -public class CustomAspects { - // static Constructor aspectConstructor; - // static Object TRADE; - // static Object UNIVERSE; - // static Object SCIENCE; - // static Object[] tmpArray = new Object[3]; - // static{ - // try { - // aspectConstructor = ThaumcraftHandler.AspectAdder.mAspectClass.getConstructor(String.class,int.class, - // Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,1).getClass(), ResourceLocation.class,int.class); - // tmpArray[0] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); - // tmpArray[1] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); - // tmpArray[2] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); - // Array.set(tmpArray[0],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("EXCHANGE").get(null)); - // Array.set(tmpArray[0],1,ThaumcraftHandler.AspectAdder.mAspectClass.getField("GREED").get(null)); - // TRADE = aspectConstructor.newInstance("Artis",0x00FF00, tmpArray[0],new - // ResourceLocation(MainMod.MOD_ID+":Aspects/Artis.png"),1); - // Array.set(tmpArray[1],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("MAGIC").get(null)); - // Array.set(tmpArray[1],1,ThaumcraftHandler.AspectAdder.mAspectClass.getField("ELDRITCH").get(null)); - // UNIVERSE = aspectConstructor.newInstance("Universum",0x0000FF, tmpArray[1],new - // ResourceLocation(MainMod.MOD_ID+":Aspects/Universum.png"),1); - // Array.set(tmpArray[2],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("MAN").get(null)); - // Array.set(tmpArray[2],1,UNIVERSE); - // SCIENCE = aspectConstructor.newInstance("Scientia",0x00FFFF, tmpArray[2],new - // ResourceLocation(MainMod.MOD_ID+":Aspects/Scientia.png"),1); - // } catch (NoSuchMethodException | NoSuchFieldException | IllegalAccessException | InstantiationException | - // InvocationTargetException e) { - // e.printStackTrace(); - // } - // } -} -- cgit From d79d7d4975838698661589d8c52b4c3f258fb082 Mon Sep 17 00:00:00 2001 From: Dakota Jones <73182109+greesyB@users.noreply.github.com> Date: Mon, 10 Apr 2023 10:12:33 -0500 Subject: EIC improvements - Tiered parallel, survival construct support, batch mode (#310) * Update buildscript * Update GT5 dependency * Add tiering and parallel to EIC * EIC survival construct support and allow single energy hatch * Make EIC piston visualizer use neighbor textures * Add batch mode and exotic hatch support to EIC * Only replace air blocks on piston reset * Fix TT hatch support and update tooltip * Require minimum UHV energy hatch * Register machine blocks + spotless * Use bitmask for machine block registration * Add universium tier * Bump GT dep * Fix tiered block changes not passing structure check * Placeholder Avaritia dep * Update dependencies.gradle --------- Co-authored-by: Martin Robertz Former-commit-id: 064fd8ad19df639f807cdd270873a77c73ea89dc --- dependencies.gradle | 4 +- .../client/renderer/BW_EICPistonVisualizer.java | 25 +- .../bartworks/common/loaders/ItemRegistry.java | 12 + .../GT_TileEntity_ElectricImplosionCompressor.java | 283 +++++++++++++++------ 4 files changed, 237 insertions(+), 87 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 487bb6661a..f85ed87dfb 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api("com.github.GTNewHorizons:GT5-Unofficial:5.09.42.47:dev") + api("com.github.GTNewHorizons:GT5-Unofficial:5.09.42.48:dev") api("com.github.GTNewHorizons:TecTech:5.0.85:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.23-GTNH:dev") api("com.github.GTNewHorizons:Galacticraft:3.0.64-GTNH:dev") @@ -10,6 +10,8 @@ dependencies { } api("com.github.GTNewHorizons:ModularUI:1.0.66:dev") + api("com.github.GTNewHorizons:Avaritia:1.35:dev") + compileOnly("com.github.GTNewHorizons:AppleCore:3.2.8:dev") { transitive = false } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java index 37e55767bb..4b5923fd23 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java @@ -1,11 +1,13 @@ package com.github.bartimaeusnek.bartworks.client.renderer; +import net.minecraft.block.Block; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import org.apache.commons.lang3.tuple.Pair; import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; @@ -38,7 +40,20 @@ public class BW_EICPistonVisualizer extends EntityFX { RenderBlocks.getInstance().blockAccess = this.worldObj; RenderBlocks.getInstance().setRenderFromInside(false); - IIcon icon = GregTech_API.sBlockMetal5.getIcon(0, 2); + // Look at nearby block for correct tiered block to use + Pair tieredBlock; + if (this.worldObj != null) { + int nX = (int) posX; + int nY = (int) posY + 1; + int nZ = (int) posZ; + Block neighborBlock = this.worldObj.getBlock(nX, nY, nZ); + int neighborMeta = this.worldObj.getBlockMetadata(nX, nY, nZ); + tieredBlock = Pair.of(neighborBlock, neighborMeta); + } else { + tieredBlock = Pair.of(GregTech_API.sBlockMetal5, 2); + } + + IIcon icon = tieredBlock.getKey().getIcon(0, tieredBlock.getValue()); double x = this.posX + 1; double z = this.posZ; @@ -48,7 +63,7 @@ public class BW_EICPistonVisualizer extends EntityFX { double f13 = z - interpPosZ; tessellator.setTranslation(f11 - x, f12 - this.posY, f13 - z); RenderBlocks.getInstance() - .renderBlockUsingTexture(GregTech_API.sBlockMetal5, (int) x, (int) this.posY, (int) z, icon); + .renderBlockUsingTexture(tieredBlock.getKey(), (int) x, (int) this.posY, (int) z, icon); x = this.posX - 1; z = this.posZ; @@ -57,7 +72,7 @@ public class BW_EICPistonVisualizer extends EntityFX { f13 = z - interpPosZ; tessellator.setTranslation(f11 - x, f12 - this.posY, f13 - z); RenderBlocks.getInstance() - .renderBlockUsingTexture(GregTech_API.sBlockMetal5, (int) x, (int) this.posY, (int) z, icon); + .renderBlockUsingTexture(tieredBlock.getKey(), (int) x, (int) this.posY, (int) z, icon); x = this.posX; z = this.posZ + 1; @@ -66,7 +81,7 @@ public class BW_EICPistonVisualizer extends EntityFX { f13 = z - interpPosZ; tessellator.setTranslation(f11 - x, f12 - this.posY, f13 - z); RenderBlocks.getInstance() - .renderBlockUsingTexture(GregTech_API.sBlockMetal5, (int) x, (int) this.posY, (int) z, icon); + .renderBlockUsingTexture(tieredBlock.getKey(), (int) x, (int) this.posY, (int) z, icon); x = this.posX; z = this.posZ - 1; @@ -75,7 +90,7 @@ public class BW_EICPistonVisualizer extends EntityFX { f13 = z - interpPosZ; tessellator.setTranslation(f11 - x, f12 - this.posY, f13 - z); RenderBlocks.getInstance() - .renderBlockUsingTexture(GregTech_API.sBlockMetal5, (int) x, (int) this.posY, (int) z, icon); + .renderBlockUsingTexture(tieredBlock.getKey(), (int) x, (int) this.posY, (int) z, icon); tessellator.setTranslation(0d, 0d, 0d); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 2feeb4c038..0e55a538d1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -69,6 +69,7 @@ import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileE import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.TT_MetaTileEntity_Pipe_Energy_LowPower; import cpw.mods.fml.common.registry.GameRegistry; +import fox.spiteful.avaritia.blocks.LudicrousBlocks; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -280,8 +281,19 @@ public class ItemRegistry { ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, "ElectricImplosionCompressor", "Electric Implosion Compressor").getStackForm(1L); + // EIC depend on neutronium block to pass on structure updates int bitmask = GregTech_API.sMachineIDs.getOrDefault(GregTech_API.sBlockMetal5, 0) | (1 << 2); + GregTech_API.registerMachineBlock(GregTech_API.sBlockMetal5, bitmask); + + // Also spacetime, transcendent metal, and universium + bitmask = GregTech_API.sMachineIDs.getOrDefault(GregTech_API.sBlockMetal9, 0) | (1 << 3) | (1 << 4) | (1 << 8); + GregTech_API.registerMachineBlock(GregTech_API.sBlockMetal9, bitmask); + + // Also infinity + bitmask = GregTech_API.sMachineIDs.getOrDefault(LudicrousBlocks.resource_block, 0) | (1 << 1); + GregTech_API.registerMachineBlock(LudicrousBlocks.resource_block, bitmask); + GregTech_API.registerMachineBlock(GregTech_API.sBlockMetal5, bitmask); ItemRegistry.THTR = new GT_TileEntity_THTR( ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index b1f35e7329..8d1c5a1506 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -15,26 +15,28 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.isAir; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.tuple.Pair; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.renderer.BW_EICPistonVisualizer; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -42,35 +44,34 @@ import com.github.bartimaeusnek.bartworks.common.net.EICPacket; import com.github.bartimaeusnek.bartworks.util.Coords; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing; -import com.gtnewhorizon.structurelib.structure.AutoPlaceEnvironment; -import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.IStructureElement; -import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import com.gtnewhorizon.structurelib.structure.*; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import fox.spiteful.avaritia.blocks.LudicrousBlocks; import gregtech.api.GregTech_API; import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_ExtendedPowerMultiBlockBase; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.*; public class GT_TileEntity_ElectricImplosionCompressor - extends GT_MetaTileEntity_EnhancedMultiBlockBase { + extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase + implements ISurvivalConstructable { public static GT_Recipe.GT_Recipe_Map eicMap; private static final boolean pistonEnabled = !ConfigHandler.disablePistonInEIC; private Boolean piston = true; private static final SoundResource sound = SoundResource.RANDOM_EXPLODE; private final ArrayList chunkCoordinates = new ArrayList<>(5); + private int mBlockTier = 0; + private int mCasing; public GT_TileEntity_ElectricImplosionCompressor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -92,52 +93,62 @@ public class GT_TileEntity_ElectricImplosionCompressor { "t~t", "tft", "ttt" }, { "ttt", "tft", "ttt" }, { "CCC", "CeC", "CCC" }, })) .addElement('c', ofChain(ofBlock(GregTech_API.sBlockCasings2, 0), ofBlock(GregTech_API.sBlockCasings3, 4))) .addElement('t', ofBlock(BW_BLOCKS[2], 1)).addElement('f', ofBlock(BW_BLOCKS[2], 0)) - .addElement('n', ofBlock(GregTech_API.sBlockMetal5, 2)) + .addElement( + 'n', + StructureUtility.ofBlocksTiered( + tieredBlockConverter(), + getAllBlockTiers(), + 0, + GT_TileEntity_ElectricImplosionCompressor::setBlockTier, + GT_TileEntity_ElectricImplosionCompressor::getBlockTier)) .addElement( 'C', - ofChain( - ofHatchAdder( - GT_TileEntity_ElectricImplosionCompressor::addInputToMachineList, - CASING_INDEX, - 1), - ofHatchAdder( - GT_TileEntity_ElectricImplosionCompressor::addOutputToMachineList, - CASING_INDEX, - 1), - ofHatchAdder( - GT_TileEntity_ElectricImplosionCompressor::addMaintenanceToMachineList, - CASING_INDEX, - 1), - ofBlock(GregTech_API.sBlockCasings2, 0), - ofBlock(GregTech_API.sBlockCasings3, 4))) + buildHatchAdder(GT_TileEntity_ElectricImplosionCompressor.class) + .atLeast(InputBus, OutputBus, Maintenance, InputHatch, OutputHatch) + .casingIndex(CASING_INDEX).dot(1).buildAndChain( + onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings2, 0)), + onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings3, 4)))) .addElement( 'e', - ofHatchAdder( - GT_TileEntity_ElectricImplosionCompressor::addEnergyInputToMachineList, - CASING_INDEX, - 2)) + buildHatchAdder(GT_TileEntity_ElectricImplosionCompressor.class).atLeast(Energy.or(ExoticEnergy)) + .casingIndex(CASING_INDEX).dot(2).buildAndChain( + onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings2, 0)), + onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings3, 4)))) .addElement('N', new IStructureElement() { + // Much of this based on StructureUtility.ofBlocksTiered + private final List> tiers = getAllBlockTiers(); + @Override public boolean check(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z) { if (!te.piston && !world.isAirBlock(x, y, z)) return false; - if (te.piston && !(world.getBlock(x, y, z) == GregTech_API.sBlockMetal5 - && world.getBlockMetadata(x, y, z) == 2)) - return false; + if (te.piston) { + Block candidate = world.getBlock(x, y, z); + int candidateMeta = world.getBlockMetadata(x, y, z); + if (getTierOfBlock(candidate, candidateMeta) == -1) { + return false; + } + } return true; } + private Pair getTier(ItemStack trigger) { + return tiers.get(Math.min(Math.max(trigger.stackSize, 1), tiers.size()) - 1); + } + @Override public boolean spawnHint(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z, ItemStack itemStack) { - if (te.piston) StructureLibAPI.hintParticle(world, x, y, z, GregTech_API.sBlockMetal5, 2); + Pair tier = getTier(itemStack); + if (te.piston) StructureLibAPI.hintParticle(world, x, y, z, tier.getKey(), tier.getValue()); return true; } @Override public boolean placeBlock(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z, ItemStack itemStack) { - if (te.piston) world.setBlock(x, y, z, GregTech_API.sBlockMetal5, 2, 3); + Pair tier = getTier(itemStack); + if (te.piston) world.setBlock(x, y, z, tier.getKey(), tier.getValue(), 3); else world.setBlockToAir(x, y, z); return true; } @@ -155,6 +166,55 @@ public class GT_TileEntity_ElectricImplosionCompressor } }).build(); + public static List> getAllBlockTiers() { + return new ArrayList>() { + + { + add(Pair.of(GregTech_API.sBlockMetal5, 2)); + add(Pair.of(LudicrousBlocks.resource_block, 1)); + add(Pair.of(GregTech_API.sBlockMetal9, 4)); + add(Pair.of(GregTech_API.sBlockMetal9, 3)); + add(Pair.of(GregTech_API.sBlockMetal9, 8)); + } + + ; + }; + } + + public static ITierConverter tieredBlockConverter() { + return GT_TileEntity_ElectricImplosionCompressor::getTierOfBlock; + } + + private static int getTierOfBlock(Block block, int meta) { + if (block == null) { + return -1; + } + if (block == GregTech_API.sBlockMetal5 && meta == 2) { + return 1; // Neutronium + } else if (block == LudicrousBlocks.resource_block && meta == 1) { + return 2; // Infinity + } else if (block == GregTech_API.sBlockMetal9) { + switch (meta) { + case 4: // Transcendent Metal + return 3; + case 3: // SpaceTime + return 4; + case 8: // Universium + return 5; + } + } + + return -1; + } + + private void setBlockTier(int tier) { + mBlockTier = tier; + } + + private int getBlockTier() { + return mBlockTier; + } + @Override public IStructureDefinition getStructureDefinition() { return STRUCTURE_DEFINITION; @@ -170,45 +230,87 @@ public class GT_TileEntity_ElectricImplosionCompressor GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Implosion Compressor").addInfo("Explosions are fun") .addInfo("Controller block for the Electric Implosion Compressor") - .addInfo("Uses electricity instead of Explosives").addSeparator().beginStructureBlock(3, 9, 3, false) - .addController("Front 3rd layer center").addCasingInfo("Solid Steel Machine Casing", 8) + .addInfo("Uses electricity instead of Explosives").addInfo("Can parallel up to 4^(Tier - 1)") + .addInfo("Tier is determined by containment block") + .addInfo("Valid blocks: Neutronium, Infinity, Transcendent Metal, Spacetime, Universium") + .addInfo("Requires UHV or better energy hatch to work").addInfo("Supports " + TT + " energy hatches") + .addSeparator().beginStructureBlock(3, 9, 3, false).addController("Front 3rd layer center") + .addCasingInfo("Solid Steel Machine Casing", 8) .addStructureInfo("Casings can be replaced with Explosion Warning Signs") .addOtherStructurePart("Transformer-Winding Blocks", "Outer layer 2,3,7,8") .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Inner layer 2,3,7,8") - .addOtherStructurePart("Neutronium Blocks", "Layer 4,5,6").addMaintenanceHatch("Any bottom casing", 1) + .addOtherStructurePart("Containment Blocks", "Layer 4,5,6").addMaintenanceHatch("Any bottom casing", 1) .addInputBus("Any bottom casing", 1).addInputHatch("Any bottom casing", 1) - .addOutputBus("Any bottom casing", 1).addEnergyHatch("Bottom and top middle", 2) + .addOutputBus("Any bottom casing", 1).addEnergyHatch("Bottom middle and/or top middle", 2) .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @Override public boolean checkRecipe(ItemStack aStack) { - - if (this.mEnergyHatches.get(0).getEUVar() <= 0 || this.mEnergyHatches.get(1).getEUVar() <= 0) return false; - - ItemStack[] tItemInputs = getCompactedInputs(); - FluidStack[] tFluidInputs = getCompactedFluids(); + lEUt = 0; + mOutputItems = null; + mOutputFluids = null; + long tTotalEU = getMaxInputEu(); long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + // Disallow energy hatches below UHV + if (tTier < 9) { + return false; + } + + ItemStack[] tItemInputs = getStoredInputs().toArray(new ItemStack[0]); + FluidStack[] tFluidInputs = getStoredFluids().toArray(new FluidStack[0]); + if ((tItemInputs.length > 0) || (tFluidInputs.length > 0)) { GT_Recipe tRecipe = eicMap.findRecipe(getBaseMetaTileEntity(), false, V[tTier], tFluidInputs, tItemInputs); - if (tRecipe != null && tRecipe.isRecipeInputEqual(true, tFluidInputs, tItemInputs)) { - this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; - this.mEfficiencyIncrease = 10000; - calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); - // In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; - if (this.mEUt > 0) { - this.mEUt = -this.mEUt; - } - this.mOutputItems = tRecipe.mOutputs.clone(); - this.mOutputFluids = tRecipe.mFluidOutputs.clone(); - this.updateSlots(); - return true; + if (tRecipe == null) { + return false; + } + + int tCurrentMaxParallel = 1; + if (mBlockTier > 1) { + tCurrentMaxParallel = (int) Math.pow(4, Math.max(mBlockTier - 1, 0)); } + + GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(tItemInputs) + .setFluidInputs(tFluidInputs).setAvailableEUt(tTotalEU).setMaxParallel(tCurrentMaxParallel) + .enableConsumption().enableOutputCalculation(); + + if (batchMode) { + helper.enableBatchMode(128); + } + + helper.build(); + + if (helper.getCurrentParallel() == 0) { + return false; + } + + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt) + .setEUt(getAverageInputVoltage()).setAmperage(getMaxInputAmps()).setDuration(tRecipe.mDuration) + .setParallel((int) Math.floor(helper.getCurrentParallel() / helper.getDurationMultiplier())) + .calculate(); + + lEUt = -calculator.getConsumption(); + mMaxProgresstime = (int) Math.ceil(calculator.getDuration() * helper.getDurationMultiplier()); + + this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; + this.mEfficiencyIncrease = 10000; + + // In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && lEUt == Long.MAX_VALUE - 1) return false; + if (this.lEUt > 0) { + this.lEUt = -this.lEUt; + } + + this.mOutputItems = helper.getItemOutputs(); + this.mOutputFluids = helper.getFluidOutputs(); + + this.updateSlots(); + return true; } return false; } @@ -235,17 +337,6 @@ public class GT_TileEntity_ElectricImplosionCompressor updateChunkCoordinates(); } - @Override - public boolean drainEnergyInput(long aEU) { - if (aEU <= 0) return true; - GT_MetaTileEntity_Hatch_Energy h1 = this.mEnergyHatches.get(0), h2 = this.mEnergyHatches.get(1); - if (!isValidMetaTileEntity(h1) || !isValidMetaTileEntity(h2)) return false; - if (!h1.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU / 2, false) - || !h2.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU / 2, false)) - return false; - return true; - } - @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); @@ -287,9 +378,15 @@ public class GT_TileEntity_ElectricImplosionCompressor IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); if (!aBaseMetaTileEntity.isServerSide()) return; if (!this.piston) { - chunkCoordinates.forEach( - c -> aBaseMetaTileEntity.getWorld() - .setBlock(c.posX, c.posY, c.posZ, GregTech_API.sBlockMetal5, 2, 3)); + List> tiers = getAllBlockTiers(); + Pair tieredBlock = tiers.get(Math.min(mBlockTier, tiers.size()) - 1); + chunkCoordinates.forEach(c -> { + // Don't replace real blocks in case user has placed something (e.g. tier upgrade) + if (aBaseMetaTileEntity.getWorld().isAirBlock(c.posX, c.posY, c.posZ)) { + aBaseMetaTileEntity.getWorld() + .setBlock(c.posX, c.posY, c.posZ, tieredBlock.getKey(), tieredBlock.getValue(), 3); + } + }); this.piston = !this.piston; } } @@ -343,8 +440,10 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + this.mCasing = 0; + setBlockTier(0); boolean isOK = checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0); - isOK = isOK && this.mMaintenanceHatches.size() == 1 && this.mEnergyHatches.size() == 2; + isOK = isOK && this.mMaintenanceHatches.size() == 1 && getExoticAndNormalEnergyHatchList().size() >= 1; if (isOK) { activatePiston(); return true; @@ -398,4 +497,26 @@ public class GT_TileEntity_ElectricImplosionCompressor public void construct(ItemStack itemStack, boolean b) { buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 1, 6, 0); } + + @Override + public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { + if (mMachine) return -1; + return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 1, 6, 0, elementBudget, env, false, true); + } + + @Override + public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, + float aZ) { + if (aPlayer.isSneaking()) { + batchMode = !batchMode; + if (batchMode) { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); + } else { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); + } + return true; + } + + return false; + } } -- cgit From 4a0c3cbc6d1db2bb2e6e372909f694a311d93e71 Mon Sep 17 00:00:00 2001 From: Батьків Нестор-Євген Васильович Date: Mon, 10 Apr 2023 19:22:53 +0300 Subject: - Add waila support for imprinted (#309) - Add colors to tooltip and scanner Former-commit-id: d9d1b16dde30b694b3ca525430206597ce5dbd1d --- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 35 ++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 8f46893b89..12b2fcb8c5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -34,9 +34,16 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; +import mcp.mobius.waila.api.IWailaConfigHandler; +import mcp.mobius.waila.api.IWailaDataAccessor; + +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; +import net.minecraft.world.World; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; @@ -134,6 +141,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends } public String getTypeForDisplay() { + if (this.type.equals(new NBTTagCompound())) return ""; return GT_LanguageManager.getTranslation( GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); @@ -344,8 +352,9 @@ public class GT_TileEntity_CircuitAssemblyLine extends String[] oldInfo = super.getInfoData(); infoDataBuffer = new String[oldInfo.length + 1]; System.arraycopy(oldInfo, 0, infoDataBuffer, 0, oldInfo.length); - infoDataBuffer[oldInfo.length] = "Imprinted with: " + GT_LanguageManager.getTranslation( - GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); + infoDataBuffer[oldInfo.length] = StatCollector.translateToLocal("tooltip.cal.imprintedWith") + " " + + EnumChatFormatting.YELLOW + + getTypeForDisplay(); return infoDataBuffer; } @@ -415,6 +424,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends if (stack.hasTagCompound() && stack.stackTagCompound.hasKey("Type")) { tooltip.add( StatCollector.translateToLocal("tooltip.cal.imprintedWith") + " " + + EnumChatFormatting.YELLOW + StatCollector.translateToLocal( GT_LanguageManager.getTranslateableItemStackName( ItemStack.loadItemStackFromNBT( @@ -432,4 +442,25 @@ public class GT_TileEntity_CircuitAssemblyLine extends protected boolean isRecipeLockingEnabled() { return imprintedItemName != null && !imprintedItemName.equals(""); } + + @Override + public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, + IWailaConfigHandler config) { + super.getWailaBody(itemStack, currenttip, accessor, config); + NBTTagCompound tag = accessor.getNBTData(); + if (tag.hasKey("ImprintedWith")) currenttip.add( + StatCollector.translateToLocal("tooltip.cal.imprintedWith") + " " + + EnumChatFormatting.YELLOW + + tag.getString("ImprintedWith")); + + } + + @Override + public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, + int z) { + super.getWailaNBTData(player, tile, tag, world, x, y, z); + String imprintedWith = getTypeForDisplay(); + if (imprintedWith != "") tag.setString("ImprintedWith", imprintedWith); + + } } -- cgit From 50ab373d202c3f62331647f7b1cc06e3026e0ff6 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Mon, 10 Apr 2023 18:43:38 +0200 Subject: fix batch Mode Button Former-commit-id: 0708dfbbe40ca089706d7f175d88a9a2fe44f0bc --- .../multis/GT_TileEntity_ElectricImplosionCompressor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 8d1c5a1506..024b528f8f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -519,4 +519,8 @@ public class GT_TileEntity_ElectricImplosionCompressor return false; } + @Override + protected boolean isBatchModeButtonEnabled() { + return true; + } } -- cgit From 98ec2447d5251fd17f95d64c6e2a1e3c95e21de7 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Mon, 10 Apr 2023 18:45:32 +0200 Subject: sa Former-commit-id: 92254399f187042d79f9a80dafe3043f9765cbf6 --- .../tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 024b528f8f..7df84f1391 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -519,6 +519,7 @@ public class GT_TileEntity_ElectricImplosionCompressor return false; } + @Override protected boolean isBatchModeButtonEnabled() { return true; -- cgit From e19f72a95e243c64a851ca9cedc732d7ed253c67 Mon Sep 17 00:00:00 2001 From: Dakota Jones <73182109+greesyB@users.noreply.github.com> Date: Tue, 11 Apr 2023 17:03:43 -0500 Subject: EIC - Fix overclock and support void protection (#311) * Fix EIC overclock and only allow one tier of OC skip * Support void protection * Remove wildcard imports * Clean up tier logic * Reset max hatch tier Former-commit-id: f1a7052010084dc1df777ba457901d0cac8bde2e --- .../GT_TileEntity_ElectricImplosionCompressor.java | 53 ++++++++++++++++------ 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 7df84f1391..5b9a4c8b51 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -46,7 +46,13 @@ import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing; -import com.gtnewhorizon.structurelib.structure.*; +import com.gtnewhorizon.structurelib.structure.AutoPlaceEnvironment; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.IStructureElement; +import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; +import com.gtnewhorizon.structurelib.structure.ITierConverter; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureUtility; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -58,8 +64,13 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_ExtendedPowerMultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.render.TextureFactory; -import gregtech.api.util.*; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_OverclockCalculator; +import gregtech.api.util.GT_ParallelHelper; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase @@ -72,6 +83,7 @@ public class GT_TileEntity_ElectricImplosionCompressor private final ArrayList chunkCoordinates = new ArrayList<>(5); private int mBlockTier = 0; private int mCasing; + private int mMaxHatchTier = 0; public GT_TileEntity_ElectricImplosionCompressor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -233,9 +245,9 @@ public class GT_TileEntity_ElectricImplosionCompressor .addInfo("Uses electricity instead of Explosives").addInfo("Can parallel up to 4^(Tier - 1)") .addInfo("Tier is determined by containment block") .addInfo("Valid blocks: Neutronium, Infinity, Transcendent Metal, Spacetime, Universium") - .addInfo("Requires UHV or better energy hatch to work").addInfo("Supports " + TT + " energy hatches") - .addSeparator().beginStructureBlock(3, 9, 3, false).addController("Front 3rd layer center") - .addCasingInfo("Solid Steel Machine Casing", 8) + .addInfo("Minimum allowed energy hatch tier is one below recipe tier") + .addInfo("Supports " + TT + " energy hatches").addSeparator().beginStructureBlock(3, 9, 3, false) + .addController("Front 3rd layer center").addCasingInfo("Solid Steel Machine Casing", 8) .addStructureInfo("Casings can be replaced with Explosion Warning Signs") .addOtherStructurePart("Transformer-Winding Blocks", "Outer layer 2,3,7,8") .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Inner layer 2,3,7,8") @@ -253,13 +265,8 @@ public class GT_TileEntity_ElectricImplosionCompressor mOutputFluids = null; long tTotalEU = getMaxInputEu(); - long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - - // Disallow energy hatches below UHV - if (tTier < 9) { - return false; - } + // Only allow up to one tier skip + byte tTier = (byte) (mMaxHatchTier + 1); ItemStack[] tItemInputs = getStoredInputs().toArray(new ItemStack[0]); FluidStack[] tFluidInputs = getStoredFluids().toArray(new FluidStack[0]); @@ -283,14 +290,18 @@ public class GT_TileEntity_ElectricImplosionCompressor helper.enableBatchMode(128); } + if (!voidExcess) { + helper.enableVoidProtection(this); + } + helper.build(); if (helper.getCurrentParallel() == 0) { return false; } - GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt) - .setEUt(getAverageInputVoltage()).setAmperage(getMaxInputAmps()).setDuration(tRecipe.mDuration) + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt).setEUt(tTotalEU) + .setDuration(tRecipe.mDuration) .setParallel((int) Math.floor(helper.getCurrentParallel() / helper.getDurationMultiplier())) .calculate(); @@ -441,9 +452,16 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { this.mCasing = 0; + this.mMaxHatchTier = 0; setBlockTier(0); boolean isOK = checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0); - isOK = isOK && this.mMaintenanceHatches.size() == 1 && getExoticAndNormalEnergyHatchList().size() >= 1; + + List energyHatches = getExoticAndNormalEnergyHatchList(); + for (GT_MetaTileEntity_Hatch hatch : energyHatches) { + mMaxHatchTier = Math.max(mMaxHatchTier, hatch.mTier); + } + + isOK = isOK && this.mMaintenanceHatches.size() == 1 && energyHatches.size() >= 1; if (isOK) { activatePiston(); return true; @@ -524,4 +542,9 @@ public class GT_TileEntity_ElectricImplosionCompressor protected boolean isBatchModeButtonEnabled() { return true; } + + @Override + protected boolean isVoidExcessButtonEnabled() { + return true; + } } -- cgit From 842337f253d3635857c394b3df036293cd5c733e Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Sat, 15 Apr 2023 21:00:26 +0100 Subject: panes are not glass blocks (#312) Former-commit-id: 93aa2fc61391eda82261f61132234c4f017b77a9 --- .../com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java index 081f8432e1..329d73023f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java @@ -52,9 +52,7 @@ public class GTNHBlocks { } if (Botania.isModLoaded()) { BioVatLogicAdder.BioVatGlass.addCustomGlass(Botania.ID, "manaGlass", 0, 4); - BioVatLogicAdder.BioVatGlass.addCustomGlass(Botania.ID, "manaGlassPane", 0, 4); BioVatLogicAdder.BioVatGlass.addCustomGlass(Botania.ID, "elfGlass", 0, 5); - BioVatLogicAdder.BioVatGlass.addCustomGlass(Botania.ID, "elfGlassPane", 0, 5); } if (Botany.isModLoaded()) { BioVatLogicAdder.BioVatGlass.addCustomGlass(Botany.ID, "stained", 0, 3); -- cgit From 08106244313a3b6b2e6744ac5dbc6898861ff858 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Fri, 21 Apr 2023 19:09:59 +0200 Subject: Fix Materials (#313) * update dep update bs * update rc * re add jitpack fix material * fix materials * spotless * more fixes * spotless * update dep Former-commit-id: a3de933f31b9060032519ec922ac03af63d442d0 --- build.gradle | 96 ++++------------------ dependencies.gradle | 24 +++--- .../ElectricImplosionCompressorRecipes.java | 24 +++--- .../common/loaders/recipes/FluidSolidifier.java | 3 +- .../common/loaders/recipes/Pulverizer.java | 4 +- .../TT_MetaTileEntity_LowPowerLaserDynamo.java | 2 +- .../TT_MetaTileEntity_LowPowerLaserHatch.java | 2 +- 7 files changed, 45 insertions(+), 110 deletions(-) diff --git a/build.gradle b/build.gradle index 055dcee435..f82d369676 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1680120787 +//version: 1681680742 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -67,20 +67,21 @@ plugins { id 'com.google.devtools.ksp' version '1.8.0-1.0.9' apply false id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version, unused, available for addon.gradle id 'com.github.johnrengelman.shadow' version '7.1.2' apply false - id 'com.palantir.git-version' version '0.13.0' apply false // 0.13.0 is the last jvm8 supporting version + id 'com.palantir.git-version' version '3.0.0' apply false id 'de.undercouch.download' version '5.3.0' id 'com.github.gmazzo.buildconfig' version '3.1.0' apply false // Unused, available for addon.gradle id 'com.diffplug.spotless' version '6.7.2' apply false id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.2.4' + id 'com.gtnewhorizons.retrofuturagradle' version '1.2.5' } boolean settingsupdated = verifySettingsGradle() settingsupdated = verifyGitAttributes() || settingsupdated if (settingsupdated) throw new GradleException("Settings has been updated, please re-run task.") -if (project.file('.git/HEAD').isFile()) { +// In submodules, .git is a file pointing to the real git dir +if (project.file('.git/HEAD').isFile() || project.file('.git').isFile()) { apply plugin: 'com.palantir.git-version' } @@ -201,6 +202,14 @@ configurations { canBeConsumed = false canBeResolved = false } + + create("devOnlyNonPublishable") { + description = "Runtime and compiletime dependencies that are not published alongside the jar (compileOnly + runtimeOnlyNonPublishable)" + canBeConsumed = false + canBeResolved = false + } + compileOnly.extendsFrom(devOnlyNonPublishable) + runtimeOnlyNonPublishable.extendsFrom(devOnlyNonPublishable) } if (enableModernJavaSyntax.toBoolean()) { @@ -1388,7 +1397,7 @@ static int replaceParams(File file, Map params) { return 0 } -// Dependency Deobfuscation +// Dependency Deobfuscation (Deprecated, use the new RFG API documented in dependencies.gradle) def deobf(String sourceURL) { try { @@ -1430,11 +1439,7 @@ def deobfMaven(String repoURL, String mavenDep) { } def deobfCurse(String curseDep) { - try { - return deobfMaven("https://www.cursemaven.com/", "curse.maven:$curseDep") - } catch (Exception ignored) { - out.style(Style.Failure).println("Failed to get $curseDep from cursemaven.") - } + return dependencies.rfg.deobf("curse.maven:$curseDep") } // The method above is to be preferred. Use this method if the filename is not at the end of the URL. @@ -1442,34 +1447,7 @@ def deobf(String sourceURL, String rawFileName) { String bon2Version = "2.5.1" String fileName = URLDecoder.decode(rawFileName, "UTF-8") String cacheDir = "$project.gradle.gradleUserHomeDir/caches" - String bon2Dir = "$cacheDir/forge_gradle/deobf" - String bon2File = "$bon2Dir/BON2-${bon2Version}.jar" String obfFile = "$cacheDir/modules-2/files-2.1/${fileName}.jar" - String deobfFile = "$cacheDir/modules-2/files-2.1/${fileName}-deobf.jar" - - if (file(deobfFile).exists()) { - return files(deobfFile) - } - - String mappingsVer - String remoteMappings = project.hasProperty('remoteMappings') ? project.remoteMappings : 'https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/' - if (remoteMappings) { - String id = "${forgeVersion.split("\\.")[3]}-$minecraftVersion" - String mappingsZIP = "$cacheDir/forge_gradle/maven_downloader/de/oceanlabs/mcp/mcp_snapshot_nodoc/$id/mcp_snapshot_nodoc-${id}.zip" - - zipMappings(mappingsZIP, remoteMappings, bon2Dir) - - mappingsVer = "snapshot_$id" - } else { - mappingsVer = "${channel}_$mappingsVersion" - } - - download.run { - src "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/com/github/parker8283/BON2/$bon2Version-CUSTOM/BON2-$bon2Version-CUSTOM-all.jar" - dest bon2File - quiet true - overwrite false - } download.run { src sourceURL @@ -1477,50 +1455,8 @@ def deobf(String sourceURL, String rawFileName) { quiet true overwrite false } - - exec { - commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', minecraftVersion, '--mappingsVer', mappingsVer, '--notch' - workingDir bon2Dir - standardOutput = new FileOutputStream("${deobfFile}.log") - } - - return files(deobfFile) + return dependencies.rfg.deobf(files(obfFile)) } - -def zipMappings(String zipPath, String url, String bon2Dir) { - File zipFile = new File(zipPath) - if (zipFile.exists()) { - return - } - - String fieldsCache = "$bon2Dir/data/fields.csv" - String methodsCache = "$bon2Dir/data/methods.csv" - - download.run { - src "${url}fields.csv" - dest fieldsCache - quiet true - } - download.run { - src "${url}methods.csv" - dest methodsCache - quiet true - } - - zipFile.getParentFile().mkdirs() - ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile)) - - zos.putNextEntry(new ZipEntry("fields.csv")) - Files.copy(Paths.get(fieldsCache), zos) - zos.closeEntry() - - zos.putNextEntry(new ZipEntry("methods.csv")) - Files.copy(Paths.get(methodsCache), zos) - zos.closeEntry() - - zos.close() -} - // Helper methods def checkPropertyExists(String propertyName) { diff --git a/dependencies.gradle b/dependencies.gradle index f85ed87dfb..6882e5eafa 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,38 +1,38 @@ // Add your dependencies here dependencies { - api("com.github.GTNewHorizons:GT5-Unofficial:5.09.42.48:dev") - api("com.github.GTNewHorizons:TecTech:5.0.85:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.23-GTNH:dev") - api("com.github.GTNewHorizons:Galacticraft:3.0.64-GTNH:dev") + api("com.github.GTNewHorizons:GT5-Unofficial:5.09.42.67-pre:dev") + api("com.github.GTNewHorizons:TecTech:5.1.15-pre:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.26-GTNH:dev") + api("com.github.GTNewHorizons:Galacticraft:3.0.67-GTNH:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.8:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } - api("com.github.GTNewHorizons:ModularUI:1.0.66:dev") + api("com.github.GTNewHorizons:ModularUI:1.1.2:dev") - api("com.github.GTNewHorizons:Avaritia:1.35:dev") + api("com.github.GTNewHorizons:Avaritia:1.37:dev") - compileOnly("com.github.GTNewHorizons:AppleCore:3.2.8:dev") { + compileOnly("com.github.GTNewHorizons:AppleCore:3.2.10:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:TinkersGregworks:master-SNAPSHOT:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:ForestryMC:4.5.6:api") { + compileOnly("com.github.GTNewHorizons:ForestryMC:4.6.5:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:Railcraft:9.13.16:api") { + compileOnly("com.github.GTNewHorizons:Railcraft:9.14.1:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.54:api") { + compileOnly("com.github.GTNewHorizons:EnderIO:2.4.10:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:OpenComputers:1.8.0.9-GTNH:api") { + compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.1-GTNH:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:BuildCraft:7.1.28:dev") { + compileOnly("com.github.GTNewHorizons:BuildCraft:7.1.33:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:ProjectRed:4.7.9-GTNH:dev") { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java index cc072482f4..58b7556850 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java @@ -12,11 +12,7 @@ import static gregtech.api.util.GT_ModHandler.getModItem; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.TierEU; +import gregtech.api.enums.*; import gregtech.api.util.GT_OreDictUnificator; public class ElectricImplosionCompressorRecipes implements Runnable { @@ -49,7 +45,7 @@ public class ElectricImplosionCompressorRecipes implements Runnable { addElectricImplosionRecipe( // IN. new ItemStack[] { GT_Values.NI }, - new FluidStack[] { Materials.SpaceTime.getMolten(72L) }, + new FluidStack[] { MaterialsUEVplus.SpaceTime.getMolten(72L) }, // OUT. new ItemStack[] { getModItem(EternalSingularity.ID, "eternal_singularity", 1L) }, new FluidStack[] { GT_Values.NF }, @@ -109,13 +105,13 @@ public class ElectricImplosionCompressorRecipes implements Runnable { // Magneto material recipe for base fluid. addElectricImplosionRecipe( // IN. - new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.nanite, Materials.WhiteDwarfMatter, 1L), - GT_OreDictUnificator.get(OrePrefixes.nanite, Materials.Universium, 1L), - GT_OreDictUnificator.get(OrePrefixes.nanite, Materials.BlackDwarfMatter, 1L) }, - new FluidStack[] { Materials.RawStarMatter.getFluid(64 * 144L) }, + new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.nanite, MaterialsUEVplus.WhiteDwarfMatter, 1L), + GT_OreDictUnificator.get(OrePrefixes.nanite, MaterialsUEVplus.Universium, 1L), + GT_OreDictUnificator.get(OrePrefixes.nanite, MaterialsUEVplus.BlackDwarfMatter, 1L) }, + new FluidStack[] { MaterialsUEVplus.RawStarMatter.getFluid(64 * 144L) }, // OUT. new ItemStack[] { GT_Values.NI }, - new FluidStack[] { Materials.MagnetohydrodynamicallyConstrainedStarMatter.getMolten(16 * 144L) }, + new FluidStack[] { MaterialsUEVplus.MagnetohydrodynamicallyConstrainedStarMatter.getMolten(16 * 144L) }, // Recipe stats. 20 * 4, (int) TierEU.RECIPE_UXV); @@ -156,11 +152,11 @@ public class ElectricImplosionCompressorRecipes implements Runnable { new ItemStack[] { circuit.splitStack(circuitMultiplier), getModItem(SuperSolarPanels.ID, "solarsplitter", 1, 0), getModItem(OpenComputers.ID, "hologram2", circuitMultiplier, 0), - GT_OreDictUnificator.get(part, Materials.Universium, multiplier), }, - new FluidStack[] { Materials.MagnetohydrodynamicallyConstrainedStarMatter + GT_OreDictUnificator.get(part, MaterialsUEVplus.Universium, multiplier), }, + new FluidStack[] { MaterialsUEVplus.MagnetohydrodynamicallyConstrainedStarMatter .getMolten((long) partFraction * multiplier) }, new ItemStack[] { GT_OreDictUnificator - .get(part, Materials.MagnetohydrodynamicallyConstrainedStarMatter, multiplier) }, + .get(part, MaterialsUEVplus.MagnetohydrodynamicallyConstrainedStarMatter, multiplier) }, new FluidStack[] { GT_Values.NF }, (int) (multiplier * (20 * partFraction / 144.0)), (int) TierEU.RECIPE_UXV); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java index be00d552de..13c431fce8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java @@ -9,6 +9,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; +import gregtech.api.enums.MaterialsUEVplus; public class FluidSolidifier implements Runnable { @@ -72,7 +73,7 @@ public class FluidSolidifier implements Runnable { BW_Util.getMachineVoltageFromTier(10)); GT_Values.RA.addFluidSolidifierRecipe( new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Materials.TranscendentMetal.getMolten(1152), + MaterialsUEVplus.TranscendentMetal.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[1], 1, 0), 800, BW_Util.getMachineVoltageFromTier(11)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java index 35c99413e4..58c6746a23 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java @@ -8,6 +8,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; +import gregtech.api.enums.MaterialsUEVplus; import gregtech.api.enums.OrePrefixes; public class Pulverizer implements Runnable { @@ -65,7 +66,8 @@ public class Pulverizer implements Runnable { BW_Util.getMachineVoltageFromTier(11)); GT_Values.RA.addPulveriserRecipe( new ItemStack(ItemRegistry.bw_glasses[1], 1, 0), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.TranscendentMetal.getDust(8) }, + new ItemStack[] { Materials.BorosilicateGlass.getDust(9), + MaterialsUEVplus.TranscendentMetal.getDust(8) }, null, 800, BW_Util.getMachineVoltageFromTier(12)); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java index 1b7b4441ef..8452086fdb 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java @@ -34,7 +34,7 @@ public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hat public TT_MetaTileEntity_LowPowerLaserDynamo(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aAmp, aDescription, aTextures); + super(aName, aTier, aAmp, new String[] { aDescription }, aTextures); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java index 025e80a9c6..c9854e4cbd 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java @@ -34,7 +34,7 @@ public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatc public TT_MetaTileEntity_LowPowerLaserHatch(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aAmp, aDescription, aTextures); + super(aName, aTier, aAmp, new String[] { aDescription }, aTextures); } @Override -- cgit From 17ca58a724858e3127ad7dced8c5febfbe697621 Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Sat, 22 Apr 2023 13:12:43 -0700 Subject: Update BS & deps Former-commit-id: 216b716f53ec8d2f252ea12f2d78bc03d70096c4 --- build.gradle | 4 ++-- repositories.gradle | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index f82d369676..74899dc97b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1681680742 +//version: 1682104756 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -73,7 +73,7 @@ plugins { id 'com.diffplug.spotless' version '6.7.2' apply false id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.2.5' + id 'com.gtnewhorizons.retrofuturagradle' version '1.2.7' } boolean settingsupdated = verifySettingsGradle() settingsupdated = verifyGitAttributes() || settingsupdated diff --git a/repositories.gradle b/repositories.gradle index 596dbd0df1..df71a2210d 100644 --- a/repositories.gradle +++ b/repositories.gradle @@ -21,14 +21,6 @@ repositories { mavenPom() artifact() } - } - maven { - name = "ic2" - url = "http://maven2.ic2.player.to/" - metadataSources { - mavenPom() - artifact() - } } maven { url "https://cursemaven.com" @@ -36,4 +28,5 @@ repositories { maven { url = "https://jitpack.io" } + } -- cgit From ebc0805f81c190689979c801b9454b44123384c7 Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Sat, 22 Apr 2023 13:47:57 -0700 Subject: update more deps Former-commit-id: 4771f09f869fbd9d8f3248ca79fbda16df4d85a5 --- dependencies.gradle | 10 +++++----- repositories.gradle | 32 ++++++++------------------------ 2 files changed, 13 insertions(+), 29 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 6882e5eafa..8d953fe85c 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,23 +1,23 @@ // Add your dependencies here dependencies { - api("com.github.GTNewHorizons:GT5-Unofficial:5.09.42.67-pre:dev") + api("com.github.GTNewHorizons:GT5-Unofficial:5.09.42.71:dev") api("com.github.GTNewHorizons:TecTech:5.1.15-pre:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.26-GTNH:dev") - api("com.github.GTNewHorizons:Galacticraft:3.0.67-GTNH:dev") + api("com.github.GTNewHorizons:GalacticGregGT5:1.0.8:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } + + api("com.github.GTNewHorizons:Galacticraft:3.0.68-GTNH:dev") api("com.github.GTNewHorizons:ModularUI:1.1.2:dev") api("com.github.GTNewHorizons:Avaritia:1.37:dev") + compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.23:deobf") {transitive = false} compileOnly("com.github.GTNewHorizons:AppleCore:3.2.10:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:TinkersGregworks:master-SNAPSHOT:dev") { - transitive = false - } compileOnly("com.github.GTNewHorizons:ForestryMC:4.6.5:api") { transitive = false } diff --git a/repositories.gradle b/repositories.gradle index df71a2210d..40118b1677 100644 --- a/repositories.gradle +++ b/repositories.gradle @@ -1,32 +1,16 @@ // Add any additional repositories for your dependencies here repositories { - mavenLocal() - 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/" + ivy { + url 'https://files.vexatos.com/' + patternLayout { + artifact "[module]/[artifact]-[revision](-[classifier])(.[ext])" + } + content { + includeGroup("TGregworks") + } metadataSources { - mavenPom() artifact() } } - maven { - url "https://cursemaven.com" - } - maven { - url = "https://jitpack.io" - } - } -- cgit From f249d7a41c0a86d11f0de81b75fb7281ceccf3a7 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Sun, 23 Apr 2023 13:46:51 +0100 Subject: Add oredicts for diode and inductor for 2A-16A diode (#314) * oredicts for diode and inductor * remove last duplicate recipe Former-commit-id: 8945ec8a11c9bc1db2b3de0a5ea9a40d460e3cc4 --- .../common/loaders/recipes/CraftingRecipes.java | 51 +++------------------- 1 file changed, 6 insertions(+), 45 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java index d56f77fa3c..9549625c8a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java @@ -185,71 +185,32 @@ public class CraftingRecipes implements Runnable { GT_ModHandler.addCraftingRecipe( ItemRegistry.diode12A[i], RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', - ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), 'P', hull, 'C', - machinehull }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode12A[i], - RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', - ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', + new Object[] { "WDW", "DCD", "PDP", 'D', OrePrefixes.componentCircuit.get(Materials.Diode), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), 'P', hull, 'C', machinehull }); GT_ModHandler.addCraftingRecipe( ItemRegistry.diode8A[i], RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', - ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), 'P', hull, 'C', - machinehull }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode8A[i], - RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', - ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', + new Object[] { "WDW", "DCD", "PDP", 'D', OrePrefixes.componentCircuit.get(Materials.Diode), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), 'P', hull, 'C', machinehull }); GT_ModHandler.addCraftingRecipe( ItemRegistry.diode4A[i], RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', - ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', + new Object[] { "WDW", "DCD", "PDP", 'D', OrePrefixes.componentCircuit.get(Materials.Diode), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), 'P', hull, 'C', machinehull }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode4A[i], - RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', - ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), 'P', hull, 'C', - machinehull }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode2A[i], - RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', - ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), 'P', hull, 'C', - machinehull }); GT_ModHandler.addCraftingRecipe( ItemRegistry.diode2A[i], RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', - ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', + new Object[] { "WDW", "DCD", "PDP", 'D', OrePrefixes.componentCircuit.get(Materials.Diode), 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), 'P', hull, 'C', machinehull }); GT_ModHandler.addCraftingRecipe( ItemRegistry.diode16A[i], RecipeLoader.BITSD, - new Object[] { "WHW", "DCD", "PDP", 'H', ItemList.Circuit_Parts_Coil.get(1L), 'D', - ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), 'W', - GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), 'P', hull, 'C', - machinehull }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode16A[i], - RecipeLoader.BITSD, - new Object[] { "WHW", "DCD", "PDP", 'H', ItemList.Circuit_Parts_Coil.get(1L), 'D', - ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), 'W', + new Object[] { "WHW", "DCD", "PDP", 'H', OrePrefixes.componentCircuit.get(Materials.Inductor), + 'D', OrePrefixes.componentCircuit.get(Materials.Diode), 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), 'P', hull, 'C', machinehull }); -- cgit From 140ef3f1b46ec9c5af021fec4e7bf69310add82d Mon Sep 17 00:00:00 2001 From: Dariusz Komosiński Date: Sun, 30 Apr 2023 15:48:34 +0200 Subject: Allow scanners to display heat of MEBFs. (#315) Former-commit-id: 864c83c866b42cf7215be9f9a01b1ec37e8937c5 --- .../multis/mega/GT_TileEntity_MegaBlastFurnace.java | 10 ++++++++++ .../mega/GT_TileEntity_MegaMultiBlockBase.java | 20 +++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index c0fe57a7cb..476c7eb547 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -45,6 +45,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; @@ -310,6 +311,15 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock || addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); } + @Override + protected String[] getExtendedInfoData() { + return new String[] { StatCollector.translateToLocal("GT5U.EBF.heat") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mHeatingCapacity) + + EnumChatFormatting.RESET + + " K" }; + } + @Override public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = null; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java index 806aeaf4ca..eb396caae7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java @@ -5,6 +5,7 @@ import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Mods.TecTech; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.List; @@ -137,6 +138,10 @@ public abstract class GT_TileEntity_MegaMultiBlockBase Date: Mon, 1 May 2023 03:39:51 -0700 Subject: ForgeDirection (#316) Former-commit-id: 970805693f1ce3f615906ed3328c3a88d619dbbb --- build.gradle | 48 ++++---- dependencies.gradle | 4 +- gradle/wrapper/gradle-wrapper.properties | 2 +- .../bartworks/API/AcidGenFuelAdder.java | 1 + .../bartworks/API/BioRecipeAdder.java | 1 + .../github/bartimaeusnek/bartworks/GuiHandler.java | 1 + .../client/renderer/BW_Renderer_Block_Ores.java | 121 +++++++++++++++++++-- .../bartworks/common/loaders/BioItemList.java | 1 + .../bartworks/common/loaders/RecipeLoader.java | 1 + .../common/loaders/RegisterServerCommands.java | 1 + .../common/net/CircuitProgrammerPacket.java | 1 + .../bartworks/common/net/MetaBlockPacket.java | 1 + .../bartworks/common/net/OreDictCachePacket.java | 1 + .../bartworks/common/net/RendererPacket.java | 1 + .../bartworks/common/net/ServerJoinedPackage.java | 1 + .../tileentities/multis/GT_TileEntity_BioVat.java | 10 +- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 12 +- .../tileentities/multis/GT_TileEntity_DEHP.java | 5 +- .../GT_TileEntity_ElectricImplosionCompressor.java | 13 ++- .../tileentities/multis/GT_TileEntity_HTGR.java | 9 +- .../tileentities/multis/GT_TileEntity_LESU.java | 20 ++-- .../multis/GT_TileEntity_ManualTrafo.java | 7 +- .../tileentities/multis/GT_TileEntity_THTR.java | 9 +- .../multis/GT_TileEntity_Windmill.java | 12 +- .../mega/GT_TileEntity_MegaBlastFurnace.java | 13 ++- .../mega/GT_TileEntity_MegaChemicalReactor.java | 11 +- .../mega/GT_TileEntity_MegaDistillTower.java | 11 +- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 7 +- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 11 +- .../tiered/GT_MetaTileEntity_AcidGenerator.java | 5 +- .../tiered/GT_MetaTileEntity_Diode.java | 5 +- .../tiered/GT_MetaTileEntity_RadioHatch.java | 12 +- .../tiered/GT_MetaTileEntity_Transistor.java | 15 +-- .../bartworks/neiHandler/BW_NEI_BioLabHandler.java | 5 +- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 5 +- .../bartworks/neiHandler/BW_NEI_OreHandler.java | 9 +- .../bartworks/neiHandler/IMCForNEI.java | 1 + .../bartworks/neiHandler/NEI_BW_Config.java | 8 +- .../system/material/BW_GT_MaterialReference.java | 1 + .../BW_MetaGeneratedBlocks_CasingAdvanced_TE.java | 3 +- .../material/BW_MetaGeneratedBlocks_Casing_TE.java | 3 +- .../system/material/BW_MetaGeneratedFrames.java | 18 +-- .../system/material/BW_MetaGeneratedOreTE.java | 3 +- .../material/BW_MetaGeneratedSmallOreTE.java | 3 +- .../system/material/BW_MetaGenerated_Block_TE.java | 1 + .../BW_MetaGenerated_WerkstoffBlock_TE.java | 3 +- .../material/processingLoaders/DownTierLoader.java | 1 + .../werkstoff_loaders/recipe/BlockLoader.java | 1 + .../bartworks/system/oredict/OreDictAdder.java | 1 + .../system/oregen/BW_WorldGenRoss128b.java | 1 + .../system/oregen/BW_WorldGenRoss128ba.java | 1 + .../bartworks/system/worldgen/GT_WorldgenUtil.java | 1 + .../bartworks/system/worldgen/MapGenRuins.java | 33 ++++-- .../bartimaeusnek/bartworks/util/BW_Util.java | 17 ++- .../bartworks/util/NoiseUtil/BartsNoise.java | 1 + .../multi/GT_Industrial_Alchemic_Construct.java | 5 +- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 16 +-- .../crossmod/galacticraft/PlanetsHelperClass.java | 8 +- .../galacticraft/UniversalTeleportType.java | 10 +- .../atmosphere/BWAtmosphereManager.java | 7 +- .../planets/ross128b/ChunkProviderRoss128b.java | 1 + .../planets/ross128b/WorldProviderRoss128b.java | 5 +- .../planets/ross128ba/ChunkProviderRoss128ba.java | 12 +- .../planets/ross128ba/WorldProviderRoss128ba.java | 8 +- .../solarsystems/Ross128SolarSystem.java | 16 +-- .../tileEntity/DysonSwarmSunReplacement.java | 14 ++- .../openComputers/TileEntity_GTDataServer.java | 9 +- .../tectech/tileentites/tiered/LowPowerLaser.java | 9 +- .../tiered/TT_Abstract_LowPowerLaserThingy.java | 13 ++- .../tiered/TT_MetaTileEntity_LowPowerLaserBox.java | 13 ++- .../TT_MetaTileEntity_Pipe_Energy_LowPower.java | 26 ++--- .../crossmod/tgregworks/MaterialsInjector.java | 11 +- .../tile/GT_Multi_IndustrialCrucible.java | 5 +- .../thaumcraft/util/ThaumcraftHandler.java | 1 + 74 files changed, 416 insertions(+), 266 deletions(-) diff --git a/build.gradle b/build.gradle index 74899dc97b..17e7501a27 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1682104756 +//version: 1682616243 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -6,29 +6,25 @@ */ -import com.diffplug.blowdryer.Blowdryer -import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import com.gtnewhorizons.retrofuturagradle.ObfuscationAttribute import com.gtnewhorizons.retrofuturagradle.mcp.ReobfuscatedJar import com.gtnewhorizons.retrofuturagradle.minecraft.RunMinecraftTask +import com.gtnewhorizons.retrofuturagradle.util.Distribution import com.matthewprenger.cursegradle.CurseArtifact import com.matthewprenger.cursegradle.CurseRelation import com.modrinth.minotaur.dependencies.ModDependency import com.modrinth.minotaur.dependencies.VersionDependency -import cpw.mods.fml.relauncher.Side -import org.gradle.api.tasks.options.Option; import org.gradle.internal.logging.text.StyledTextOutput.Style import org.gradle.internal.logging.text.StyledTextOutputFactory import org.gradle.internal.xml.XmlTransformer -import org.jetbrains.gradle.ext.* +import org.jetbrains.gradle.ext.Application +import org.jetbrains.gradle.ext.Gradle +import javax.inject.Inject import java.nio.file.Files import java.nio.file.Paths import java.util.concurrent.TimeUnit -import java.util.zip.ZipEntry -import java.util.zip.ZipOutputStream -import javax.inject.Inject buildscript { repositories { @@ -66,14 +62,14 @@ plugins { id 'org.jetbrains.kotlin.kapt' version '1.8.0' apply false id 'com.google.devtools.ksp' version '1.8.0-1.0.9' apply false id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version, unused, available for addon.gradle - id 'com.github.johnrengelman.shadow' version '7.1.2' apply false + id 'com.github.johnrengelman.shadow' version '8.1.1' apply false id 'com.palantir.git-version' version '3.0.0' apply false - id 'de.undercouch.download' version '5.3.0' + id 'de.undercouch.download' version '5.4.0' id 'com.github.gmazzo.buildconfig' version '3.1.0' apply false // Unused, available for addon.gradle - id 'com.diffplug.spotless' version '6.7.2' apply false + id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.2.7' + id 'com.gtnewhorizons.retrofuturagradle' version '1.3.7' } boolean settingsupdated = verifySettingsGradle() settingsupdated = verifyGitAttributes() || settingsupdated @@ -133,7 +129,7 @@ propertyDefaultIfUnset("enableGenericInjection", false) // On by default for new // this is meant to be set using the user wide property file. by default we do nothing. propertyDefaultIfUnset("ideaOverrideBuildType", "") // Can be nothing, "gradle" or "idea" -project.extensions.add(Blowdryer, "Blowdryer", Blowdryer) // Make blowdryer available in "apply from:" scripts +project.extensions.add(com.diffplug.blowdryer.Blowdryer, "Blowdryer", com.diffplug.blowdryer.Blowdryer) // Make blowdryer available in "apply from:" scripts if (!disableSpotless) { apply plugin: 'com.diffplug.spotless' apply from: Blowdryer.file('spotless.gradle') @@ -408,7 +404,7 @@ minecraft { username = developmentEnvironmentUserName.toString() - lwjgl3Version = "3.3.2-SNAPSHOT" + lwjgl3Version = "3.3.2" // Enable assertions in the current mod extraRunJvmArguments.add("-ea:${modGroup}") @@ -722,13 +718,13 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies" } dependencies { - def lwjgl3ifyVersion = '1.3.3' + def lwjgl3ifyVersion = '1.3.5' def asmVersion = '9.4' if (modId != 'lwjgl3ify') { java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") } if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.4') + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.8') } java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false} @@ -802,7 +798,7 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask { public boolean setEnableHotswap(boolean enable) { enableHotswap = enable } @Inject - public RunHotswappableMinecraftTask(Side side, String superTask, org.gradle.api.invocation.Gradle gradle) { + public RunHotswappableMinecraftTask(Distribution side, String superTask, org.gradle.api.invocation.Gradle gradle) { super(side, gradle) this.lwjglVersion = 3 @@ -811,7 +807,7 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask { this.extraJvmArgs.addAll(project.provider(() -> enableHotswap ? project.hotswapJvmArgs : [])) this.classpath(project.java17PatchDependenciesCfg) - if (side == Side.CLIENT) { + if (side == Distribution.CLIENT) { this.classpath(project.minecraftTasks.lwjgl3Configuration) } // Use a raw provider instead of map to not create a dependency on the task @@ -823,7 +819,7 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask { } } -def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Side.CLIENT, "runClient") +def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Distribution.CLIENT, "runClient") runClient17Task.configure { setup(project) group = "Modded Minecraft" @@ -834,7 +830,7 @@ runClient17Task.configure { userUUID = minecraft.userUUID } -def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Side.SERVER, "runServer") +def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Distribution.DEDICATED_SERVER, "runServer") runServer17Task.configure { setup(project) group = "Modded Minecraft" @@ -875,11 +871,6 @@ tasks.named("jar", Jar).configure { } if (usesShadowedDependencies.toBoolean()) { - tasks.register('relocateShadowJar', ConfigureShadowRelocation) { - target = tasks.shadowJar - prefix = modGroup + ".shadow" - enabled = relocateShadowedDependencies.toBoolean() - } tasks.named("shadowJar", ShadowJar).configure { manifest { attributes(getManifestAttributes()) @@ -895,7 +886,8 @@ if (usesShadowedDependencies.toBoolean()) { ] archiveClassifier.set('dev') if (relocateShadowedDependencies.toBoolean()) { - dependsOn(relocateShadowJar) + relocationPrefix = modGroup + ".shadow" + enableRelocation = true } } configurations.runtimeElements.outgoing.artifacts.clear() @@ -1228,7 +1220,7 @@ def addCurseForgeRelation(String type, String name) { // Updating -def buildscriptGradleVersion = "8.0.2" +def buildscriptGradleVersion = "8.1.1" tasks.named('wrapper', Wrapper).configure { gradleVersion = buildscriptGradleVersion diff --git a/dependencies.gradle b/dependencies.gradle index 8d953fe85c..a2343c11a6 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,8 +1,8 @@ // Add your dependencies here dependencies { - api("com.github.GTNewHorizons:GT5-Unofficial:5.09.42.71:dev") - api("com.github.GTNewHorizons:TecTech:5.1.15-pre:dev") + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.02-pre:dev') + api("com.github.GTNewHorizons:TecTech:5.2.0-pre:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.26-GTNH:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.8:dev") { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bdc9a83b1e..37aef8d3f0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java index 59324c8002..1e254993d4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java @@ -16,6 +16,7 @@ package com.github.bartimaeusnek.bartworks.API; import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.util.BWRecipes; + import gregtech.api.enums.Materials; public final class AcidGenFuelAdder { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java index aadc5d53ae..b456f8d562 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java @@ -21,6 +21,7 @@ import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BioCulture; + import gregtech.api.enums.Materials; @SuppressWarnings("ALL") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java index d4a1e0015f..bb9a40934f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -17,6 +17,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import com.github.bartimaeusnek.bartworks.API.SideReference; + import cpw.mods.fml.common.network.IGuiHandler; public class GuiHandler implements IGuiHandler { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index 9e25535970..d45262ad16 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -24,6 +24,7 @@ import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; @@ -51,12 +52,60 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { aRenderer.setRenderBoundsFromBlock(aBlock); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 0), true); - renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 1), true); - renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 2), true); - renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 3), true); - renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 4), true); - renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 5), true); + renderNegativeYFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tTileEntity.getTexture(aBlock, ForgeDirection.DOWN), + true); + renderPositiveYFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tTileEntity.getTexture(aBlock, ForgeDirection.UP), + true); + renderNegativeZFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tTileEntity.getTexture(aBlock, ForgeDirection.NORTH), + true); + renderPositiveZFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tTileEntity.getTexture(aBlock, ForgeDirection.SOUTH), + true); + renderNegativeXFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tTileEntity.getTexture(aBlock, ForgeDirection.WEST), + true); + renderPositiveXFacing( + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tTileEntity.getTexture(aBlock, ForgeDirection.EAST), + true); aRenderer.setRenderBoundsFromBlock(aBlock); aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax); GL11.glTranslatef(0.5F, 0.5F, 0.5F); @@ -72,12 +121,60 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax); aRenderer.enableAO = Minecraft.isAmbientOcclusionEnabled() && GT_Mod.gregtechproxy.mRenderTileAmbientOcclusion; aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tTileEntity.getTexture(aBlock, (byte) 0), true); - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tTileEntity.getTexture(aBlock, (byte) 1), true); - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tTileEntity.getTexture(aBlock, (byte) 2), true); - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tTileEntity.getTexture(aBlock, (byte) 3), true); - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tTileEntity.getTexture(aBlock, (byte) 4), true); - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tTileEntity.getTexture(aBlock, (byte) 5), true); + renderNegativeYFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + tTileEntity.getTexture(aBlock, ForgeDirection.DOWN), + true); + renderPositiveYFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + tTileEntity.getTexture(aBlock, ForgeDirection.UP), + true); + renderNegativeZFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + tTileEntity.getTexture(aBlock, ForgeDirection.NORTH), + true); + renderPositiveZFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + tTileEntity.getTexture(aBlock, ForgeDirection.SOUTH), + true); + renderNegativeXFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + tTileEntity.getTexture(aBlock, ForgeDirection.WEST), + true); + renderPositiveXFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + tTileEntity.getTexture(aBlock, ForgeDirection.EAST), + true); return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java index dbc172487d..ed0489c9a3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java @@ -25,6 +25,7 @@ import com.github.bartimaeusnek.bartworks.util.BioCulture; import com.github.bartimaeusnek.bartworks.util.BioDNA; import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; + import cpw.mods.fml.common.registry.GameRegistry; public class BioItemList { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 09cea4ef2b..3adea59e54 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -30,6 +30,7 @@ import com.github.bartimaeusnek.bartworks.common.loaders.recipes.LaserEngraver; import com.github.bartimaeusnek.bartworks.common.loaders.recipes.Mixer; import com.github.bartimaeusnek.bartworks.common.loaders.recipes.Pulverizer; import com.github.bartimaeusnek.bartworks.common.loaders.recipes.PyrolyseOven; + import gregtech.api.util.GT_ModHandler; public class RecipeLoader { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java index 7fba74496e..615eed0c43 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java @@ -19,6 +19,7 @@ import com.github.bartimaeusnek.bartworks.common.commands.GetWorkingDirectory; import com.github.bartimaeusnek.bartworks.common.commands.PrintRecipeListToFile; import com.github.bartimaeusnek.bartworks.common.commands.RunGC; import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin; + import cpw.mods.fml.common.event.FMLServerStartingEvent; public class RegisterServerCommands { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java index 0e428285e4..a53cd1128a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java @@ -25,6 +25,7 @@ import net.minecraftforge.common.DimensionManager; import com.github.bartimaeusnek.bartworks.common.items.Circuit_Programmer; import com.google.common.io.ByteArrayDataInput; + import gregtech.api.net.GT_Packet; public class CircuitProgrammerPacket extends GT_Packet { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java index 3b454c73ad..38fdf5ee9f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java @@ -23,6 +23,7 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block_TE; import com.github.bartimaeusnek.bartworks.util.MurmurHash3; import com.google.common.io.ByteArrayDataInput; + import gregtech.api.net.GT_Packet; public class MetaBlockPacket extends GT_Packet { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java index 6d252b8ad4..5e03bf53d5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java @@ -21,6 +21,7 @@ import net.minecraft.world.IBlockAccess; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.Pair; import com.google.common.io.ByteArrayDataInput; + import gregtech.api.net.GT_Packet; public class OreDictCachePacket extends GT_Packet { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java index af79cbc208..c1dce75908 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -23,6 +23,7 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEnti import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.Coords; import com.google.common.io.ByteArrayDataInput; + import gregtech.api.net.GT_Packet; public class RendererPacket extends GT_Packet { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java index 1c48d28528..84c3ba8939 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java @@ -18,6 +18,7 @@ import net.minecraft.world.IBlockAccess; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.google.common.io.ByteArrayDataInput; + import gregtech.api.net.GT_Packet; public class ServerJoinedPackage extends GT_Packet { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index ecba268096..65cfae2ce4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -640,11 +640,11 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } private int getXDir() { - return ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; + return this.getBaseMetaTileEntity().getBackFacing().offsetX * 2; } private int getZDir() { - return ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; + return this.getBaseMetaTileEntity().getBackFacing().offsetZ * 2; } private void sendRenderPackets() { @@ -699,9 +699,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int aColorIndex, boolean aActive, boolean aRedstone) { + if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow() diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 12b2fcb8c5..4d11a29638 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -34,9 +34,6 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import mcp.mobius.waila.api.IWailaConfigHandler; -import mcp.mobius.waila.api.IWailaDataAccessor; - import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -44,6 +41,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; @@ -72,6 +70,8 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import mcp.mobius.waila.api.IWailaConfigHandler; +import mcp.mobius.waila.api.IWailaDataAccessor; public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable { @@ -359,9 +359,9 @@ public class GT_TileEntity_CircuitAssemblyLine extends } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int aColorIndex, boolean aActive, boolean aRedstone) { + if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE).extFacing().build(), TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW).extFacing().glow() diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index 90cbda832b..532a3af1ff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -22,6 +22,7 @@ import java.util.Arrays; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; @@ -182,12 +183,12 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { } @Override - public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (this.getBaseMetaTileEntity().getWorld().isRemote) return; ++this.mMode; if (this.mMode >= 4) this.mMode = 0; GT_Utility.sendChatToPlayer(aPlayer, "Mode: " + this.mMode); - super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); } protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 5b9a4c8b51..681dd0225a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -33,6 +33,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.tuple.Pair; @@ -496,9 +497,10 @@ public class GT_TileEntity_ElectricImplosionCompressor return new GT_TileEntity_ElectricImplosionCompressor(this.mName); } - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int aColorIndex, boolean aActive, boolean aRedstone) { + if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE).extFacing().build(), TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW).extFacing().glow() @@ -522,9 +524,8 @@ public class GT_TileEntity_ElectricImplosionCompressor return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 1, 6, 0, elementBudget, env, false, true); } - @Override - public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + public boolean onWireCutterRightClick(ForgeDirection side, byte aWrenchingSide, EntityPlayer aPlayer, float aX, + float aY, float aZ) { if (aPlayer.isSneaking()) { batchMode = !batchMode; if (batchMode) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index baa7013d8c..a53210a27e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -25,6 +25,7 @@ import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; @@ -425,9 +426,9 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, + ForgeDirection forgeDirection, int aColorIndex, boolean aActive, boolean aRedstone) { + if (side == forgeDirection) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) @@ -444,7 +445,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } @Override - public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (this.mMaxProgresstime > 0) { GT_Utility.sendChatToPlayer(aPlayer, "HTGR mode cannot be changed while the machine is running."); return; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 9e69a9cb88..04eb969a8c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -25,6 +25,7 @@ import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; @@ -212,9 +213,8 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } @Override - @SuppressWarnings("ALL") - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int aColorIndex, boolean aActive, boolean aRedstone) { ITexture[] ret = new ITexture[0]; @@ -225,10 +225,10 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { .of(GT_TileEntity_LESU.iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); } - if (aSide == aFacing && this.getBaseMetaTileEntity().getUniversalEnergyStored() <= 0) + if (side == facing && this.getBaseMetaTileEntity().getUniversalEnergyStored() <= 0) ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_EMPTY]; - else if (aSide == aFacing && !aActive) ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_IDLE]; - else if (aSide == aFacing && aActive) ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_CHARGING]; + else if (side == facing && !aActive) ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_IDLE]; + else if (side == facing && aActive) ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_CHARGING]; else ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_SIDE]; } @@ -305,13 +305,13 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } @Override - public boolean isInputFacing(byte aSide) { - return aSide != this.getBaseMetaTileEntity().getFrontFacing(); + public boolean isInputFacing(ForgeDirection side) { + return side != this.getBaseMetaTileEntity().getFrontFacing(); } @Override - public boolean isOutputFacing(byte aSide) { - return aSide == this.getBaseMetaTileEntity().getFrontFacing(); + public boolean isOutputFacing(ForgeDirection side) { + return side == this.getBaseMetaTileEntity().getFrontFacing(); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index abf205bcb0..49e175a136 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -30,6 +30,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -308,9 +309,9 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int aColorIndex, boolean aActive, boolean aRedstone) { + if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE).extFacing().build(), TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).extFacing() diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 89218b7d36..f38dcdb49f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -23,6 +23,7 @@ import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; @@ -352,9 +353,9 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int aColorIndex, boolean aActive, boolean aRedstone) { + if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) @@ -371,7 +372,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase } @Override - public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (this.mMaxProgresstime > 0) { GT_Utility.sendChatToPlayer(aPlayer, "THTR mode cannot be changed while the machine is running."); return; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 8988165dd9..3137d91e4e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -38,6 +38,7 @@ import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; @@ -215,7 +216,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock } @Override - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, + ItemStack aStack) { return true; } @@ -480,17 +482,17 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int aColorIndex, boolean aActive, boolean aRedstone) { ITexture[] ret = new ITexture[6]; if (this.isClientSide()) { - if (aFacing == aSide || aSide == 0) { + if (facing == side || side == ForgeDirection.DOWN) { GT_TileEntity_Windmill.iTextures[0] = TextureFactory.of(GT_TileEntity_Windmill.iIconContainers[0]); Arrays.fill(ret, GT_TileEntity_Windmill.iTextures[0]); - } else if (aSide == 1) { + } else if (side == ForgeDirection.UP) { GT_TileEntity_Windmill.iTextures[1] = TextureFactory.of(GT_TileEntity_Windmill.iIconContainers[1]); Arrays.fill(ret, GT_TileEntity_Windmill.iTextures[1]); } else { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 476c7eb547..67c7f3f272 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -47,6 +47,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; @@ -231,7 +232,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock private byte circuitMode = 0; @Override - public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { --circuitMode; if (circuitMode < 0) circuitMode = 24; @@ -246,8 +247,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock } @Override - public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { batchMode = !batchMode; if (batchMode) { @@ -266,9 +267,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int aColorIndex, boolean aActive, boolean aRedstone) { + if (side == facing) { if (aActive) return new ITexture[] { casingTexturePages[0][CASING_INDEX], TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE).extFacing().build(), TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).extFacing() diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index 29b405cb4f..bb410ec898 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -41,6 +41,7 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; @@ -108,9 +109,9 @@ public class GT_TileEntity_MegaChemicalReactor } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int aColorIndex, boolean aActive, boolean aRedstone) { + if (side == facing) { if (aActive) return new ITexture[] { casingTexturePages[1][48], TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE).extFacing().build(), TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW).extFacing() @@ -142,8 +143,8 @@ public class GT_TileEntity_MegaChemicalReactor } @Override - public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { batchMode = !batchMode; if (batchMode) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 074fdb49d2..d897a4bfa7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -41,6 +41,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -250,9 +251,9 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int aColorIndex, boolean aActive, boolean aRedstone) { + if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow() @@ -387,8 +388,8 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } @Override - public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { batchMode = !batchMode; if (batchMode) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index 32831a1898..213e5792c5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -37,6 +37,7 @@ import java.util.List; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; @@ -172,9 +173,9 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int aColorIndex, boolean aActive, boolean aRedstone) { + if (side == facing) { if (aActive) return new ITexture[] { casingTexturePages[0][CASING_INDEX], TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE).extFacing().build(), TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW).extFacing().glow() diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index f201997851..4937b284d7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -40,6 +40,7 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -209,8 +210,8 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc } @Override - public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { batchMode = !batchMode; if (batchMode) { @@ -309,10 +310,10 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int aColorIndex, boolean aActive, boolean aRedstone) { ITexture[] rTexture; - if (aSide == aFacing) { + if (side == facing) { if (aActive) { rTexture = new ITexture[] { casingTexturePages[0][17], TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE).extFacing().build(), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index 21cf8c4ed0..daccb55d6f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -14,6 +14,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; @@ -121,8 +122,8 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } - public boolean isOutputFacing(byte aSide) { - return aSide == this.getBaseMetaTileEntity().getFrontFacing(); + public boolean isOutputFacing(ForgeDirection side) { + return side == this.getBaseMetaTileEntity().getFrontFacing(); } public String[] getDescription() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index 68647d372c..630efddc8f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -16,6 +16,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; @@ -53,8 +54,8 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { } @Override - public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); if (this.getBaseMetaTileEntity().getWorld().isRemote) return; if (!aPlayer.isSneaking()) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 3a7e60d518..42772e483e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -22,6 +22,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; @@ -276,8 +277,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem return true; } - @Override - public boolean isFacingValid(byte aFacing) { + public boolean isFacingValid(ForgeDirection facing) { return true; } @@ -292,13 +292,15 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem } @Override - public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, + ItemStack aStack) { return false; } @Override - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return aSide == this.getBaseMetaTileEntity().getFrontFacing() + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, + ItemStack aStack) { + return side == this.getBaseMetaTileEntity().getFrontFacing() && BWRecipes.instance.getMappingsFor(BWRecipes.RADHATCH).containsInput(aStack); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java index 4e91a40272..dc41d12cf7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java @@ -92,7 +92,7 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { - byte side = (byte) ForgeDirection.EAST.flag; + final ForgeDirection side = ForgeDirection.EAST; if (aBaseMetaTileEntity.inputEnergyFrom(side)) { TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(side); if (!(tTileEntity instanceof IBasicEnergyContainer)) { @@ -100,8 +100,7 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin return; } IBasicEnergyContainer tileAtSide = (IBasicEnergyContainer) tTileEntity; - if (!tileAtSide.outputsEnergyTo((byte) ForgeDirection.WEST.flag) - || !tileAtSide.isUniversalEnergyStored(4L)) { + if (!tileAtSide.outputsEnergyTo(ForgeDirection.WEST) || !tileAtSide.isUniversalEnergyStored(4L)) { this.powered = false; return; } @@ -140,18 +139,20 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin public void loadNBTData(NBTTagCompound nbtTagCompound) {} @Override - public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, ForgeDirection side, + ItemStack itemStack) { return false; } @Override - public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, ForgeDirection side, + ItemStack itemStack) { return false; } @Override - public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, - boolean b4) { + public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, ForgeDirection side, ForgeDirection facing, + int colorIndex, boolean b3, boolean b4) { return new ITexture[0]; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java index 485b0244a2..3113991fd0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java @@ -15,12 +15,11 @@ package com.github.bartimaeusnek.bartworks.neiHandler; import net.minecraft.item.ItemStack; +import com.github.bartimaeusnek.bartworks.common.items.LabParts; + import codechicken.nei.recipe.GuiCraftingRecipe; import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; - -import com.github.bartimaeusnek.bartworks.common.items.LabParts; - import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Recipe; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index 0540a1ebea..e377a5d91b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -17,13 +17,12 @@ import java.util.Collections; import net.minecraft.item.ItemStack; +import com.github.bartimaeusnek.bartworks.common.items.LabParts; + import codechicken.nei.PositionedStack; import codechicken.nei.recipe.GuiCraftingRecipe; import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; - -import com.github.bartimaeusnek.bartworks.common.items.LabParts; - import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Recipe; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index 711f5e7732..ad99e50626 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -22,11 +22,6 @@ import java.util.Objects; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.GuiCraftingRecipe; -import codechicken.nei.recipe.TemplateRecipeHandler; - import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_SmallOres; @@ -36,6 +31,10 @@ import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128ba; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import codechicken.lib.gui.GuiDraw; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.GuiCraftingRecipe; +import codechicken.nei.recipe.TemplateRecipeHandler; import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.enums.OrePrefixes; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java index c814222bc2..e27669caee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java @@ -5,6 +5,7 @@ import static gregtech.api.enums.Mods.NotEnoughItems; import net.minecraft.nbt.NBTTagCompound; import com.github.bartimaeusnek.bartworks.MainMod; + import cpw.mods.fml.common.event.FMLInterModComms; public class IMCForNEI { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index 724e392994..56a4befdc5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -15,15 +15,15 @@ package com.github.bartimaeusnek.bartworks.neiHandler; import net.minecraft.item.ItemStack; -import codechicken.nei.PositionedStack; -import codechicken.nei.api.API; -import codechicken.nei.api.IConfigureNEI; - import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; + +import codechicken.nei.PositionedStack; +import codechicken.nei.api.API; +import codechicken.nei.api.IConfigureNEI; import gregtech.api.enums.OrePrefixes; public class NEI_BW_Config implements IConfigureNEI { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java index 8a4c4c7762..b29552062b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java @@ -19,6 +19,7 @@ import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.Types import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.Types.MIXTURE; import com.github.bartimaeusnek.bartworks.MainMod; + import gregtech.api.enums.Materials; public class BW_GT_MaterialReference { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java index ac9c71fb25..b53bd71e4b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java @@ -15,6 +15,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import net.minecraft.block.Block; import net.minecraft.init.Blocks; +import net.minecraftforge.common.util.ForgeDirection; import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; @@ -32,7 +33,7 @@ public class BW_MetaGeneratedBlocks_CasingAdvanced_TE extends BW_MetaGenerated_B } @Override - public ITexture[] getTexture(Block aBlock, byte aSide) { + public ITexture[] getTexture(Block aBlock, ForgeDirection side) { if (SideReference.Side.Client) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if ((aMaterial != null)) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java index d3fdd2f731..fda24e869b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java @@ -15,6 +15,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import net.minecraft.block.Block; import net.minecraft.init.Blocks; +import net.minecraftforge.common.util.ForgeDirection; import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; @@ -32,7 +33,7 @@ public class BW_MetaGeneratedBlocks_Casing_TE extends BW_MetaGenerated_Block_TE } @Override - public ITexture[] getTexture(Block aBlock, byte aSide) { + public ITexture[] getTexture(Block aBlock, ForgeDirection side) { if (SideReference.Side.Client) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if ((aMaterial != null)) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java index 4f43533cff..e80cb2464a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java @@ -17,6 +17,7 @@ import static gregtech.api.enums.GT_Values.RA; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; import gregtech.api.enums.Dyes; import gregtech.api.enums.ItemList; @@ -66,9 +67,8 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { return new BW_MetaGeneratedFrames(this.mName, this.mMaterial); } - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, - byte aColorIndex, boolean aConnected, boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, byte aConnections, + int aColorIndex, boolean aConnected, boolean aRedstone) { return new ITexture[] { TextureFactory.of( this.mMaterial.getTexSet().mTextures[OrePrefixes.frameGt.mTextureIndex], Dyes.getModulation(aColorIndex, this.mMaterial.getRGBA())) }; @@ -85,7 +85,7 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { } @Override - public final boolean isFacingValid(byte aFacing) { + public final boolean isFacingValid(ForgeDirection facing) { return false; } @@ -95,7 +95,7 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { } @Override - public final boolean renderInside(byte aSide) { + public final boolean renderInside(ForgeDirection side) { return true; } @@ -115,22 +115,22 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { } @Override - public final boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, + public final boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, ItemStack aStack) { return false; } @Override - public final boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, + public final boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, ItemStack aStack) { return false; } - public int connect(byte aSide) { + public int connect(ForgeDirection side) { return 0; } - public void disconnect(byte aSide) { + public void disconnect(ForgeDirection side) { /* Do nothing */ } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index 150578965b..7383b41b54 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -15,6 +15,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import net.minecraft.block.Block; import net.minecraft.init.Blocks; +import net.minecraftforge.common.util.ForgeDirection; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; @@ -23,7 +24,7 @@ import gregtech.api.render.TextureFactory; public class BW_MetaGeneratedOreTE extends BW_MetaGenerated_Block_TE { @Override - public ITexture[] getTexture(Block aBlock, byte aSide) { + public ITexture[] getTexture(Block aBlock, ForgeDirection side) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if ((aMaterial != null)) { ITexture aIconSet = TextureFactory diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java index 8ffd1ef475..ed3285eaa0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java @@ -19,6 +19,7 @@ import java.util.Random; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -115,7 +116,7 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { } @Override - public ITexture[] getTexture(Block aBlock, byte aSide) { + public ITexture[] getTexture(Block aBlock, ForgeDirection side) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if ((aMaterial != null)) { ITexture aIconSet = TextureFactory diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java index 65aa1bde00..7492512e75 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java @@ -25,6 +25,7 @@ import net.minecraft.network.Packet; import net.minecraft.tileentity.TileEntity; import com.github.bartimaeusnek.bartworks.common.net.MetaBlockPacket; + import gregtech.api.interfaces.tileentity.ITexturedTileEntity; public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements ITexturedTileEntity { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java index ce3f26a020..bfcfbc0e8b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java @@ -15,6 +15,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import net.minecraft.block.Block; import net.minecraft.init.Blocks; +import net.minecraftforge.common.util.ForgeDirection; import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; @@ -27,7 +28,7 @@ import gregtech.api.render.TextureFactory; public class BW_MetaGenerated_WerkstoffBlock_TE extends BW_MetaGenerated_Block_TE { @Override - public ITexture[] getTexture(Block aBlock, byte aSide) { + public ITexture[] getTexture(Block aBlock, ForgeDirection side) { if (SideReference.Side.Client) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if ((aMaterial != null)) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java index b297217ae5..7b5886bbde 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java @@ -19,6 +19,7 @@ import java.util.Set; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.StreamUtils; + import gregtech.api.util.GT_Recipe; public class DownTierLoader { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java index d8b5d87c19..4f52aab4ed 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java @@ -22,6 +22,7 @@ import net.minecraft.item.ItemStack; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; + import gregtech.api.enums.GT_Values; public class BlockLoader implements IWerkstoffRunnable { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java index b005ff26e6..85f56cb7a9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java @@ -19,6 +19,7 @@ import java.util.concurrent.ConcurrentHashMap; import net.minecraft.item.ItemStack; import com.github.bartimaeusnek.bartworks.util.Pair; + import gregtech.api.util.GT_OreDictUnificator; public class OreDictAdder { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index 13cfc9c166..27ece0dee7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -55,6 +55,7 @@ import net.minecraft.world.World; import net.minecraftforge.fluids.FluidRegistry; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; + import gregtech.api.interfaces.ISubTagContainer; public class BW_WorldGenRoss128b extends BW_OreLayer { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java index 7636d0cd64..59a0e1c3ae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java @@ -49,6 +49,7 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; + import gregtech.api.interfaces.ISubTagContainer; public class BW_WorldGenRoss128ba extends BW_OreLayer { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java index 6f21bfd317..7d599b441a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java @@ -18,6 +18,7 @@ import java.util.Random; import net.minecraft.block.Block; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; + import gregtech.api.GregTech_API; public class GT_WorldgenUtil { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java index 2e042fe7e2..fb806ccf18 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java @@ -27,6 +27,7 @@ import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.ChestGenHooks; +import net.minecraftforge.common.util.ForgeDirection; import com.github.bartimaeusnek.bartworks.util.Pair; @@ -37,7 +38,6 @@ import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.metatileentity.MetaPipeEntity; import gregtech.api.objects.XSTR; import gregtech.api.threads.GT_Runnable_MachineBlockUpdate; -import gregtech.api.util.GT_Utility; @SuppressWarnings({ "ALL" }) public abstract class MapGenRuins extends WorldGenerator { @@ -138,7 +138,8 @@ public abstract class MapGenRuins extends WorldGenerator { } else this.setBlock(worldObj, x, y, z, Blocks.air, 0); } - protected void setGTMachine(World worldObj, int x, int y, int z, int meta, String ownerName, byte facing) { + protected void setGTMachine(World worldObj, int x, int y, int z, int meta, String ownerName, + ForgeDirection facing) { try { GT_Runnable_MachineBlockUpdate.setDisabled(); } catch (Throwable ignored) {} @@ -154,7 +155,7 @@ public abstract class MapGenRuins extends WorldGenerator { } private void checkTile(BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, - byte facing, int depth) { + ForgeDirection facing, int depth) { if (depth < 25) { if (BTE.getMetaTileID() != meta || worldObj.getTileEntity(x, y, z) != BTE || BTE.isInvalid()) { redoTile(BTE, worldObj, x, y, z, meta, ownerName, facing); @@ -167,7 +168,7 @@ public abstract class MapGenRuins extends WorldGenerator { } private void redoTile(BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, - byte facing) { + ForgeDirection facing) { reSetGTTileEntity(BTE, worldObj, x, y, z, meta); BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z); BTE.setOwnerName(ownerName); @@ -181,7 +182,7 @@ public abstract class MapGenRuins extends WorldGenerator { BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) setGTMachineBlock(worldObj, x, y, z, meta); MetaPipeEntity MPE = (MetaPipeEntity) BTE.getMetaTileEntity(); BTE.mConnections |= (byte) (1 << (byte) 4); - BTE.mConnections |= (byte) (1 << GT_Utility.getOppositeSide(4)); + BTE.mConnections |= (byte) (1 << (ForgeDirection.getOrientation(4).getOpposite().ordinal())); BaseMetaTileEntity BPE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z - 1); if (BPE != null) { BTE.mConnections |= (byte) (1 << (byte) 2); @@ -310,11 +311,18 @@ public abstract class MapGenRuins extends WorldGenerator { z + dz, meta, owner, - tier > 0 ? (byte) 4 : (byte) 2); + tier > 0 ? ForgeDirection.WEST : ForgeDirection.UP); } else if (dx == 3 && dz == 4) { if (tier > 0) { short meta = GT_WorldgenUtil.getBuffer(secureRandom, tier); - this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, (byte) 4); + this.setGTMachine( + worldObj, + x + dx, + y + dy, + z + dz, + meta, + owner, + ForgeDirection.WEST); } else { this.setGTCablekWChance(worldObj, x + dx, y + dy, z + dz, rand, 33, cablemeta); } @@ -323,7 +331,14 @@ public abstract class MapGenRuins extends WorldGenerator { } else if (dx < 3 && dx > -5 && dz == 3 && set < toSet) { if (!lastset || treeinaRow > 2) { short meta = GT_WorldgenUtil.getMachine(secureRandom, tier); - this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, (byte) 2); + this.setGTMachine( + worldObj, + x + dx, + y + dy, + z + dz, + meta, + owner, + ForgeDirection.UP); set++; treeinaRow = 0; @@ -422,7 +437,7 @@ public abstract class MapGenRuins extends WorldGenerator { if (set < toSet) { if (!lastset || treeinaRow > 2 && worldObj.getTileEntity(x + dx, y + dy, z + dz) == null) { short meta = GT_WorldgenUtil.getMachine(secureRandom, tier); - this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, (byte) 2); + this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, ForgeDirection.UP); set++; treeinaRow = 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 425098f702..d4ed594de9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -47,7 +47,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; @@ -294,8 +293,8 @@ public class BW_Util { public static boolean addBlockToMachine(int x, int y, int z, int offsetsize, IGregTechTileEntity aBaseMetaTileEntity, Block block) { - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offsetsize; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offsetsize; + int xDir = aBaseMetaTileEntity.getBackFacing().offsetX * offsetsize; + int zDir = aBaseMetaTileEntity.getBackFacing().offsetZ * offsetsize; return block == Blocks.air ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block); @@ -304,8 +303,8 @@ public class BW_Util { public static boolean addBlockToMachine(int x, int y, int z, int offsetsize, IGregTechTileEntity aBaseMetaTileEntity, Block block, int damage) { byte dmg = (byte) damage; - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offsetsize; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offsetsize; + int xDir = aBaseMetaTileEntity.getBackFacing().offsetX * offsetsize; + int zDir = aBaseMetaTileEntity.getBackFacing().offsetZ * offsetsize; return block == Blocks.air ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) @@ -687,8 +686,8 @@ public class BW_Util { public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck, Block inside, int dmginside, boolean allowHatches, int aBaseCasingIndex) { - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offset; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offset; + int xDir = aBaseMetaTileEntity.getBackFacing().offsetX * offset; + int zDir = aBaseMetaTileEntity.getBackFacing().offsetZ * offset; for (int x = -radius; x <= radius; x++) { for (int y = yLevel; y < height; y++) { for (int z = -radius; z <= radius; z++) { @@ -794,8 +793,8 @@ public class BW_Util { public static List getMetasFromLayer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck) { ArrayList ret = new ArrayList<>(); - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offset; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offset; + int xDir = aBaseMetaTileEntity.getBackFacing().offsetX * offset; + int zDir = aBaseMetaTileEntity.getBackFacing().offsetZ * offset; for (int x = -radius; x <= radius; x++) { for (int y = yLevel; y < height; y++) { for (int z = -radius; z <= radius; z++) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java index d8d338f977..951cf69f70 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java @@ -17,6 +17,7 @@ import java.util.Random; import com.github.bartimaeusnek.bartworks.API.INoiseGen; import com.github.bartimaeusnek.bartworks.util.MathUtils; + import gregtech.api.objects.XSTR; public class BartsNoise implements INoiseGen { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java index 4f01c81db1..25fe6af637 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java @@ -24,6 +24,7 @@ import java.util.Map; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.crossmod.emt.recipe.TCRecipeHandler; @@ -177,8 +178,8 @@ public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlo } @Override - public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, - boolean b4) { + public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, ForgeDirection side, ForgeDirection facing, + int colorIndex, boolean b3, boolean b4) { return new ITexture[0]; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index 7c92690bf3..2574f1bd23 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -31,15 +31,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraft.world.gen.ChunkProviderServer; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_Layer_Space; -import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_SmallPieces_Space; -import bloodasp.galacticgreg.GalacticGreg; -import bloodasp.galacticgreg.api.ModDimensionDef; -import bloodasp.galacticgreg.bartworks.BW_Worldgen_Ore_Layer_Space; -import bloodasp.galacticgreg.bartworks.BW_Worldgen_Ore_SmallOre_Space; - import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -47,6 +41,12 @@ import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer; import com.github.bartimaeusnek.bartworks.util.Pair; import com.google.common.collect.ArrayListMultimap; +import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_Layer_Space; +import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_SmallPieces_Space; +import bloodasp.galacticgreg.GalacticGreg; +import bloodasp.galacticgreg.api.ModDimensionDef; +import bloodasp.galacticgreg.bartworks.BW_Worldgen_Ore_Layer_Space; +import bloodasp.galacticgreg.bartworks.BW_Worldgen_Ore_SmallOre_Space; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -569,7 +569,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } @Override - public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { mBlacklist = !mBlacklist; GT_Utility.sendChatToPlayer(aPlayer, "Mode: " + (mBlacklist ? "Blacklist" : "Whitelist")); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java index d777bfa250..c502437fc7 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java @@ -13,15 +13,15 @@ package com.github.bartimaeusnek.crossmod.galacticraft; +import net.minecraft.entity.player.EntityPlayerMP; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; + import micdoodle8.mods.galacticraft.core.entities.EntityLander; import micdoodle8.mods.galacticraft.core.entities.EntityLanderBase; import micdoodle8.mods.galacticraft.planets.asteroids.entities.EntityEntryPod; import micdoodle8.mods.galacticraft.planets.mars.entities.EntityLandingBalloons; -import net.minecraft.entity.player.EntityPlayerMP; - -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; - public class PlanetsHelperClass { public static EntityLanderBase getLanderType(EntityPlayerMP player) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java index 440b6d4dfa..4031e2491b 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java @@ -17,17 +17,17 @@ import static gregtech.api.enums.Mods.GalacticraftMars; import java.util.Random; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + import micdoodle8.mods.galacticraft.api.vector.Vector3; import micdoodle8.mods.galacticraft.api.world.ITeleportType; import micdoodle8.mods.galacticraft.core.entities.EntityLander; import micdoodle8.mods.galacticraft.core.entities.EntityLanderBase; import micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; - public class UniversalTeleportType implements ITeleportType { @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java index 59fcce82e3..e7693159de 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java @@ -19,10 +19,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; -import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; -import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; -import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; - import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.Pair; @@ -32,6 +28,9 @@ import com.google.common.collect.ArrayListMultimap; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; +import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; +import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; +import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; @SuppressWarnings({ "unused", "RedundantSuppression" }) public final class BWAtmosphereManager { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index 6a72570e5c..02acd6c031 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -40,6 +40,7 @@ import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WordGenerator; import com.github.bartimaeusnek.bartworks.system.worldgen.MapGenRuins; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; + import gregtech.api.objects.XSTR; public class ChunkProviderRoss128b extends ChunkProviderGenerate { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java index b67dbe6503..a0eaf06d46 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java @@ -13,9 +13,6 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b; -import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; -import micdoodle8.mods.galacticraft.api.vector.Vector3; - import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; import net.minecraft.world.biome.WorldChunkManager; @@ -26,6 +23,8 @@ import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarS import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; +import micdoodle8.mods.galacticraft.api.vector.Vector3; public class WorldProviderRoss128b extends AbstractWorldProviderSpace { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java index 96108217e9..51b19bf5c1 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java @@ -16,12 +16,6 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba; import java.util.Arrays; import java.util.Random; -import micdoodle8.mods.galacticraft.api.prefab.world.gen.MapGenBaseMeta; -import micdoodle8.mods.galacticraft.core.blocks.GCBlocks; -import micdoodle8.mods.galacticraft.core.world.gen.BiomeGenBaseMoon; -import micdoodle8.mods.galacticraft.core.world.gen.ChunkProviderMoon; -import micdoodle8.mods.galacticraft.core.world.gen.MapGenCavesMoon; - import net.minecraft.block.Block; import net.minecraft.block.BlockFalling; import net.minecraft.init.Blocks; @@ -32,7 +26,13 @@ import net.minecraft.world.chunk.IChunkProvider; import com.github.bartimaeusnek.bartworks.util.NoiseUtil.BartsNoise; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.ChunkProviderRoss128b; + import gregtech.api.objects.XSTR; +import micdoodle8.mods.galacticraft.api.prefab.world.gen.MapGenBaseMeta; +import micdoodle8.mods.galacticraft.core.blocks.GCBlocks; +import micdoodle8.mods.galacticraft.core.world.gen.BiomeGenBaseMoon; +import micdoodle8.mods.galacticraft.core.world.gen.ChunkProviderMoon; +import micdoodle8.mods.galacticraft.core.world.gen.MapGenCavesMoon; public class ChunkProviderRoss128ba extends ChunkProviderMoon { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java index 7dfa0ab446..38c014a467 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java @@ -13,10 +13,6 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba; -import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; -import micdoodle8.mods.galacticraft.api.vector.Vector3; -import micdoodle8.mods.galacticraft.core.world.gen.WorldChunkManagerMoon; - import net.minecraft.world.biome.WorldChunkManager; import net.minecraft.world.chunk.IChunkProvider; @@ -24,6 +20,10 @@ import com.github.bartimaeusnek.bartworks.util.MathUtils; import com.github.bartimaeusnek.crossmod.galacticraft.planets.AbstractWorldProviderSpace; import com.github.bartimaeusnek.crossmod.galacticraft.solarsystems.Ross128SolarSystem; +import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; +import micdoodle8.mods.galacticraft.api.vector.Vector3; +import micdoodle8.mods.galacticraft.core.world.gen.WorldChunkManagerMoon; + public class WorldProviderRoss128ba extends AbstractWorldProviderSpace { @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index 83f0fff1a4..e376fbd0f8 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -17,6 +17,14 @@ import static gregtech.api.enums.Mods.GalaxySpace; import java.util.Arrays; +import net.minecraft.util.ResourceLocation; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.WorldProviderRoss128b; +import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba.WorldProviderRoss128ba; + import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; @@ -28,14 +36,6 @@ import micdoodle8.mods.galacticraft.api.vector.Vector3; import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; import micdoodle8.mods.galacticraft.core.GalacticraftCore; -import net.minecraft.util.ResourceLocation; - -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; -import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.WorldProviderRoss128b; -import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba.WorldProviderRoss128ba; - public class Ross128SolarSystem { public static SolarSystem Ross128System; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java index 507496e8db..fa0dedaaa7 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java @@ -13,17 +13,17 @@ package com.github.bartimaeusnek.crossmod.galaxySpace.tileEntity; -import micdoodle8.mods.galacticraft.core.GalacticraftCore; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.util.ForgeDirection; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; +import micdoodle8.mods.galacticraft.core.GalacticraftCore; public class DysonSwarmSunReplacement extends MetaTileEntity { @@ -90,12 +90,14 @@ public class DysonSwarmSunReplacement extends MetaTileEntity { } @Override - public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, ForgeDirection side, + ItemStack itemStack) { return false; } @Override - public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, ForgeDirection side, + ItemStack itemStack) { return false; } @@ -105,8 +107,8 @@ public class DysonSwarmSunReplacement extends MetaTileEntity { } @Override - public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, - boolean b4) { + public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, ForgeDirection side, ForgeDirection facing, + int colorIndex, boolean b3, boolean b4) { return new ITexture[0]; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java index 201d820e09..997eb597e7 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java @@ -17,11 +17,6 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -import li.cil.oc.api.machine.Arguments; -import li.cil.oc.api.machine.Callback; -import li.cil.oc.api.machine.Context; -import li.cil.oc.api.network.SimpleComponent; - import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; @@ -39,6 +34,10 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Mods; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; +import li.cil.oc.api.machine.Arguments; +import li.cil.oc.api.machine.Callback; +import li.cil.oc.api.machine.Context; +import li.cil.oc.api.network.SimpleComponent; @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = Mods.Names.OPEN_COMPUTERS) public class TileEntity_GTDataServer extends TileEntity diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java index 5bd2f68fe9..0307cbf171 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java @@ -13,12 +13,13 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; +import net.minecraftforge.common.util.ForgeDirection; + import com.github.technus.tectech.mechanics.pipe.IConnectsToEnergyTunnel; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Energy; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_Utility; public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel { @@ -28,7 +29,7 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel boolean isTunnel(); - default boolean isConnectedCorrectly(byte side) { + default boolean isConnectedCorrectly(ForgeDirection side) { return false; } @@ -57,8 +58,8 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel default void moveAroundLowPower(IGregTechTileEntity aBaseMetaTileEntity) { byte color = this.getBaseMetaTileEntity().getColorization(); if (color >= 0) { - byte front = aBaseMetaTileEntity.getFrontFacing(); - byte opposite = GT_Utility.getOppositeSide(front); + ForgeDirection front = aBaseMetaTileEntity.getFrontFacing(); + ForgeDirection opposite = front.getOpposite(); for (short dist = 1; dist < 250; ++dist) { IGregTechTileEntity tGTTileEntity = aBaseMetaTileEntity diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java index d2a68b72aa..b65b72c525 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java @@ -18,6 +18,7 @@ import java.util.Optional; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.ITexture; @@ -59,22 +60,24 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_ } @Override - public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, ForgeDirection side, + ItemStack itemStack) { return false; } @Override - public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, ForgeDirection side, + ItemStack itemStack) { return false; } @Override - public boolean isInputFacing(byte aSide) { + public boolean isInputFacing(ForgeDirection side) { return true; } @Override - public boolean isOutputFacing(byte aSide) { + public boolean isOutputFacing(ForgeDirection side) { return true; } @@ -109,7 +112,7 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_ } @Override - public boolean isFacingValid(byte aFacing) { + public boolean isFacingValid(ForgeDirection facing) { return true; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java index 382fa74a3a..1fccb4dd28 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java @@ -13,6 +13,8 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; +import net.minecraftforge.common.util.ForgeDirection; + import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; @@ -80,8 +82,8 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase } @Override - public boolean canConnect(byte aSide) { - return aSide == this.getBaseMetaTileEntity().getFrontFacing(); + public boolean canConnect(ForgeDirection side) { + return side == this.getBaseMetaTileEntity().getFrontFacing(); } @Override @@ -150,9 +152,10 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - return this.mTextures[Math.min(2, aSide) + (aSide == aFacing ? 3 : 0) + (aActive ? 0 : 6)][aColorIndex + 1]; + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int aColorIndex, boolean aActive, boolean aRedstone) { + return this.mTextures[Math.min(2, side.ordinal()) + (side == facing ? 3 : 0) + (aActive ? 0 : 6)][aColorIndex + + 1]; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java index 087215f36a..053a7b04ad 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java @@ -31,7 +31,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_CoverBehavior; -import gregtech.api.util.GT_Utility; import gregtech.common.GT_Client; import ic2.core.Ic2Items; @@ -66,13 +65,12 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca } } - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, - byte aColorIndex, boolean aConnected, boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection siide, byte aConnections, + int aColorIndex, boolean aConnected, boolean aRedstone) { return new ITexture[] { TextureFactory.of( Block.getBlockFromItem(Ic2Items.glassFiberCableBlock.getItem()), Ic2Items.glassFiberCableBlock.getItemDamage(), - ForgeDirection.getOrientation(aSide)) }; + siide) }; } @Override @@ -114,8 +112,7 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca return true; } - @Override - public boolean canConnect(byte b) { + public boolean canConnect(ForgeDirection side) { return true; } @@ -125,8 +122,8 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca } @Override - public boolean isConnectedCorrectly(byte aSide) { - return this.isConnectedAtSide(aSide) && this.isConnectedAtSide(GT_Utility.getOppositeSide(aSide)); + public boolean isConnectedCorrectly(ForgeDirection side) { + return this.isConnectedAtSide(side) && this.isConnectedAtSide(side.getOpposite()); } @Override @@ -135,31 +132,32 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca } @Override - public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { + public long injectEnergyUnits(ForgeDirection side, long aVoltage, long aAmperage) { return 0L; } @Override @Deprecated @SuppressWarnings("deprecation") - public long transferElectricity(byte aSide, long aVoltage, long aAmperage, + public long transferElectricity(ForgeDirection side, long aVoltage, long aAmperage, ArrayList aAlreadyPassedTileEntityList) { return 0L; } @Override - public long transferElectricity(byte aSide, long aVoltage, long aAmperage, HashSet aAlreadyPassedSet) { + public long transferElectricity(ForgeDirection side, long aVoltage, long aAmperage, + HashSet aAlreadyPassedSet) { return 0L; } @Override - public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, + public boolean letsIn(GT_CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } @Override - public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, + public boolean letsOut(GT_CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java index 44903e58e5..45ba78c82c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java @@ -10,12 +10,6 @@ import java.util.HashMap; import net.minecraftforge.common.config.Property; -import tconstruct.library.TConstructRegistry; -import vexatos.tgregworks.TGregworks; -import vexatos.tgregworks.integration.TGregRegistry; -import vexatos.tgregworks.item.ItemTGregPart; -import vexatos.tgregworks.reference.Config; - import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -24,6 +18,11 @@ import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import tconstruct.library.TConstructRegistry; +import vexatos.tgregworks.TGregworks; +import vexatos.tgregworks.integration.TGregRegistry; +import vexatos.tgregworks.item.ItemTGregPart; +import vexatos.tgregworks.reference.Config; @Mod( modid = MaterialsInjector.MOD_ID, diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java index fee3cfaa41..126684a302 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java @@ -14,6 +14,7 @@ package com.github.bartimaeusnek.crossmod.thaumcraft.tile; import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -76,8 +77,8 @@ public class GT_Multi_IndustrialCrucible extends GT_MetaTileEntity_MultiBlockBas } @Override - public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, - boolean b4) { + public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, ForgeDirection side, ForgeDirection facing, + int colorIndex, boolean b3, boolean b4) { return new ITexture[0]; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index 531111b221..f4db85e1ef 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -24,6 +24,7 @@ import net.minecraft.world.biome.BiomeGenBase; import com.github.bartimaeusnek.bartworks.API.API_ConfigValues; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.bartworks.util.log.DebugLog; + import gregtech.api.enums.TC_Aspects; @SuppressWarnings({ "rawtypes", "unchecked", "unused" }) -- cgit From 4e32bdbe84b38a42fa5845187b637720cfd86d82 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Mon, 1 May 2023 12:47:55 +0200 Subject: update dep Former-commit-id: 2fe81d61b3da7fad053379c0794d7fdde572c028 --- dependencies.gradle | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index a2343c11a6..b46d505673 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,35 +1,35 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.02-pre:dev') - api("com.github.GTNewHorizons:TecTech:5.2.0-pre:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.26-GTNH:dev") + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.07:dev') + api("com.github.GTNewHorizons:TecTech:5.2.1:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.29-GTNH:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.8:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } api("com.github.GTNewHorizons:Galacticraft:3.0.68-GTNH:dev") - api("com.github.GTNewHorizons:ModularUI:1.1.2:dev") + api("com.github.GTNewHorizons:ModularUI:1.1.3:dev") - api("com.github.GTNewHorizons:Avaritia:1.37:dev") + api("com.github.GTNewHorizons:Avaritia:1.39:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.23:deobf") {transitive = false} compileOnly("com.github.GTNewHorizons:AppleCore:3.2.10:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:ForestryMC:4.6.5:api") { + compileOnly("com.github.GTNewHorizons:ForestryMC:4.6.7:api") { transitive = false } compileOnly("com.github.GTNewHorizons:Railcraft:9.14.1:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:EnderIO:2.4.10:api") { + compileOnly("com.github.GTNewHorizons:EnderIO:2.4.11:api") { transitive = false } - compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.1-GTNH:api") { + compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.4-GTNH:api") { transitive = false } compileOnly("com.github.GTNewHorizons:BuildCraft:7.1.33:dev") { -- cgit From 416fd7087745d0598a3ab22a00d02e48f831fc0a Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Mon, 1 May 2023 12:55:29 +0200 Subject: revert Former-commit-id: 99dd0fe80af10498b74ee86ab2c3f826de162212 --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index b46d505673..2a784f0014 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -10,7 +10,7 @@ dependencies { } api("com.github.GTNewHorizons:Galacticraft:3.0.68-GTNH:dev") - api("com.github.GTNewHorizons:ModularUI:1.1.3:dev") + api("com.github.GTNewHorizons:ModularUI:1.1.2:dev") api("com.github.GTNewHorizons:Avaritia:1.39:dev") -- cgit From 506c8bd707bf69662176c684e439e7963f6711a8 Mon Sep 17 00:00:00 2001 From: miozune Date: Fri, 5 May 2023 13:38:10 +0900 Subject: Fix NPE with Radio Hatch (#317) * Fix NPE with Radio Hatch * spotlessApply (#318) Co-authored-by: GitHub GTNH Actions <> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Former-commit-id: 568f57922469539b06da1444c8c35db4dea25748 --- .../tileentities/tiered/GT_MetaTileEntity_RadioHatch.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 42772e483e..f709ece0b6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -58,6 +58,7 @@ import gregtech.api.interfaces.modularui.IAddGregtechLogo; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.objects.ItemData; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -190,8 +191,13 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem this.colorForGUI = new short[] { 0x37, 0x37, 0x37 }; return; } else { - Materials mat = GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial; - this.colorForGUI = new short[] { mat.getRGBA()[0], mat.getRGBA()[1], mat.getRGBA()[2] }; + ItemData itemData = GT_OreDictUnificator.getAssociation(lStack); + if (itemData != null) { + Materials mat = itemData.mMaterial.mMaterial; + this.colorForGUI = new short[] { mat.getRGBA()[0], mat.getRGBA()[1], mat.getRGBA()[2] }; + } else { + this.colorForGUI = new short[] { 0x37, 0x37, 0x37 }; + } } if (this.lastFail && GT_Utility.areStacksEqual(this.lastUsedItem, lStack, true)) { -- cgit From 7e1778c716446a5f474349eb6d4002d7fff747f4 Mon Sep 17 00:00:00 2001 From: kstvr32 <109012629+kstvr32@users.noreply.github.com> Date: Fri, 5 May 2023 13:24:38 -0400 Subject: add channels to mega oil cracker (#319) Former-commit-id: e2d13c874dfc10e1f38501d2067dfb67bed044e8 --- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index 213e5792c5..d7a6af2b4c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -18,6 +18,7 @@ import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.ge import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.withChannel; import static gregtech.api.enums.GT_HatchElement.InputHatch; import static gregtech.api.enums.GT_HatchElement.Maintenance; import static gregtech.api.enums.GT_HatchElement.OutputHatch; @@ -105,7 +106,12 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa "ppmmmmmmmmmpp" }, })) .addElement( 'c', - ofCoil(GT_TileEntity_MegaOilCracker::setCoilLevel, GT_TileEntity_MegaOilCracker::getCoilLevel)) + withChannel( + "coil", + ofCoil( + GT_TileEntity_MegaOilCracker::setCoilLevel, + GT_TileEntity_MegaOilCracker::getCoilLevel))) + .addElement('p', ofBlock(GregTech_API.sBlockCasings4, 1)) .addElement( 'l', @@ -126,12 +132,14 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa .newAny(CASING_INDEX, 4)) .addElement( 'g', - BorosilicateGlass.ofBoroGlass( - (byte) 0, - (byte) 1, - Byte.MAX_VALUE, - (te, t) -> te.glasTier = t, - te -> te.glasTier)) + withChannel( + "glass", + BorosilicateGlass.ofBoroGlass( + (byte) 0, + (byte) 1, + Byte.MAX_VALUE, + (te, t) -> te.glasTier = t, + te -> te.glasTier))) .build(); private byte glasTier; private HeatingCoilLevel heatLevel; -- cgit From 0b3519693af183c11c79e275734f8f5d0d58bd1e Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Sat, 6 May 2023 15:56:30 +0100 Subject: Remove LuVtier enhancements (#320) * remove LuVtier enhancements * load order * add bridge subtag * dont change imc loading Former-commit-id: 11ff08612e7e386d08918820b20056335fd47be3 --- .../github/bartimaeusnek/bartworks/MainMod.java | 4 +- .../material/GT_Enhancement/LuVTierEnhancer.java | 374 --------------------- .../bartworks/system/material/WerkstoffLoader.java | 7 + .../material/processingLoaders/AddSomeRecipes.java | 91 +++++ .../processingLoaders/AdditionalRecipes.java | 3 +- .../processingLoaders/AfterLuVTierEnhacement.java | 93 ----- 6 files changed, 102 insertions(+), 470 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index f157c6c0e7..e5253d3dfb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -162,12 +162,14 @@ public final class MainMod { WerkstoffLoader.runInit(); ItemRegistry.run(); - RecipeLoader.run(); IMCForNEI.IMCSender(); } @Mod.EventHandler public void postInit(FMLPostInitializationEvent postinit) { + + RecipeLoader.run(); + NetworkRegistry.INSTANCE.registerGuiHandler(MainMod.instance, MainMod.GH); if (ConfigHandler.BioLab) { GTNHBlocks.run(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java deleted file mode 100644 index 8f1010017c..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; - -import static com.github.bartimaeusnek.bartworks.MainMod.MOD_ID; -import static gregtech.api.enums.Mods.NewHorizonsCoreMod; -import static gregtech.api.enums.OrePrefixes.dust; -import static gregtech.api.enums.OrePrefixes.ingot; -import static gregtech.api.enums.OrePrefixes.plate; -import static gregtech.api.enums.OrePrefixes.plateDense; -import static gregtech.api.enums.OrePrefixes.plateDouble; -import static gregtech.api.enums.OrePrefixes.rotor; -import static gregtech.api.enums.OrePrefixes.stick; -import static gregtech.api.enums.OrePrefixes.stickLong; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.function.Consumer; -import java.util.function.Predicate; - -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; - -import org.apache.commons.lang3.reflect.FieldUtils; -import org.apache.commons.lang3.reflect.MethodUtils; - -import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AfterLuVTierEnhacement; -import com.github.bartimaeusnek.bartworks.util.BW_Util; - -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.objects.ItemData; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.api.util.GT_Shaped_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.common.items.GT_MetaGenerated_Tool_01; - -@SuppressWarnings("ALL") -public class LuVTierEnhancer implements Runnable { - - private static List blackListForOsmiridium = new ArrayList<>(); - - static { - addToBlackListForOsmiridiumReplacement(ItemList.Casing_MiningOsmiridium.get(1)); - addToBlackListForOsmiridiumReplacement( - GT_MetaGenerated_Tool_01.INSTANCE - .getToolWithStats(170, 1, Materials.Osmiridium, Materials.Osmiridium, null)); - addToBlackListForOsmiridiumReplacement( - GT_MetaGenerated_Tool_01.INSTANCE - .getToolWithStats(172, 1, Materials.Osmiridium, Materials.Osmiridium, null)); - addToBlackListForOsmiridiumReplacement( - GT_MetaGenerated_Tool_01.INSTANCE - .getToolWithStats(174, 1, Materials.Osmiridium, Materials.Osmiridium, null)); - addToBlackListForOsmiridiumReplacement( - GT_MetaGenerated_Tool_01.INSTANCE - .getToolWithStats(176, 1, Materials.Osmiridium, Materials.Osmiridium, null)); - } - - public void run() { - - List bufferedRecipeList = null; - - try { - bufferedRecipeList = (List) FieldUtils - .getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - - HashSet LuVMachines = new HashSet<>(); - LuVMachines.add(ItemRegistry.cal); - OrePrefixes[] LuVMaterialsGenerated = { dust, ingot, plate, stick, stickLong, rotor, plateDouble, plateDense }; - - Arrays.stream(ItemList.values()).filter(item -> item.toString().contains("LuV") && item.hasBeenSet()) - .forEach(item -> LuVMachines.add(item.get(1))); - - if (NewHorizonsCoreMod.isModLoaded()) { - addDreamcraftItemListItems(LuVMachines); - } - - GT_ModHandler.addCraftingRecipe( - ItemList.Casing_LuV.get(1), - GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.REVERSIBLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE - | GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, - new Object[] { "PPP", "PwP", "PPP", 'P', WerkstoffLoader.LuVTierMaterial.get(plate) }); - - replaceAllRecipes(LuVMachines, LuVMaterialsGenerated, bufferedRecipeList); - - AfterLuVTierEnhacement.run(); - } - - /** - * @param stack Output item to disable Ruridit replacement in recipes - */ - public static void addToBlackListForOsmiridiumReplacement(ItemStack stack) { - blackListForOsmiridium.add(stack); - } - - private static void replaceAllRecipes(Collection LuVMachines, OrePrefixes[] LuVMaterialsGenerated, - List bufferedRecipeList) { - - for (GT_Recipe_AssemblyLine sAssemblylineRecipe : GT_Recipe_AssemblyLine.sAssemblylineRecipes) { - for (ItemStack stack : LuVMachines) { - rewriteAsslineRecipes(stack, LuVMaterialsGenerated, sAssemblylineRecipe); - } - } - - for (GT_Recipe_Map map : GT_Recipe_Map.sMappings) { - for (GT_Recipe recipe : map.mRecipeList) { - for (ItemStack stack : LuVMachines) { - rewriteMachineRecipes(stack, LuVMaterialsGenerated, recipe); - } - } - } - - for (ItemStack stack : LuVMachines) { - Predicate recipeFilter = obj -> obj instanceof GT_Shaped_Recipe - && GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true); - rewriteCraftingRecipes(bufferedRecipeList, LuVMaterialsGenerated, recipeFilter); - } - } - - private static void addDreamcraftItemListItems(Collection LuVMachines) { - try { - Class customItemListClass = Class.forName("com.dreammaster.gthandler.CustomItemList"); - Method hasnotBeenSet = MethodUtils.getAccessibleMethod(customItemListClass, "hasBeenSet"); - Method get = MethodUtils.getAccessibleMethod(customItemListClass, "get", long.class, Object[].class); - for (Enum customItemList : (Enum[]) FieldUtils.getField(customItemListClass, "$VALUES", true).get(null)) { - if (customItemList.toString().contains("LuV") && (boolean) hasnotBeenSet.invoke(customItemList)) - LuVMachines.add((ItemStack) get.invoke(customItemList, 1, new Object[0])); - } - } catch (IllegalAccessException | ClassNotFoundException | InvocationTargetException e) { - e.printStackTrace(); - } - } - - private static void rewriteCraftingRecipes(List bufferedRecipeList, OrePrefixes[] LuVMaterialsGenerated, - Predicate recipeFilter) { - for (OrePrefixes prefixes : LuVMaterialsGenerated) { - - Consumer recipeAction = obj -> LuVTierEnhancer.doStacksContainAndReplace( - null, - ((GT_Shaped_Recipe) obj).getInput(), - GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), - true, - WerkstoffLoader.LuVTierMaterial.get(prefixes)); - - CraftingManager.getInstance().getRecipeList().stream().filter(recipeFilter).forEach(recipeAction); - bufferedRecipeList.stream().filter(recipeFilter).forEach(recipeAction); - } - } - - private static void rewriteMachineRecipes(ItemStack stack, OrePrefixes[] LuVMaterialsGenerated, GT_Recipe recipe) { - if (LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, stack, false)) { - for (OrePrefixes prefixes : LuVMaterialsGenerated) { - LuVTierEnhancer.doStacksContainAndReplace( - recipe, - recipe.mInputs, - GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), - true, - WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksContainAndReplace( - recipe, - recipe.mOutputs, - GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), - true, - WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } - LuVTierEnhancer.doStacksContainAndReplace( - recipe, - recipe.mFluidInputs, - Materials.Chrome.getMolten(1), - true, - WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - LuVTierEnhancer.doStacksContainAndReplace( - recipe, - recipe.mFluidOutputs, - Materials.Chrome.getMolten(1), - true, - WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - } - if (LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mOutputs, stack, false)) { - for (OrePrefixes prefixes : LuVMaterialsGenerated) { - LuVTierEnhancer.doStacksContainAndReplace( - recipe, - recipe.mInputs, - GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), - true, - WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksContainAndReplace( - recipe, - recipe.mOutputs, - GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), - true, - WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } - LuVTierEnhancer.doStacksContainAndReplace( - recipe, - recipe.mFluidInputs, - Materials.Chrome.getMolten(1), - true, - WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - LuVTierEnhancer.doStacksContainAndReplace( - recipe, - recipe.mFluidOutputs, - Materials.Chrome.getMolten(1), - true, - WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - } - } - - private static void rewriteAsslineRecipes(ItemStack stack, OrePrefixes[] LuVMaterialsGenerated, - GT_Recipe.GT_Recipe_AssemblyLine recipe) { - for (OrePrefixes prefixes : LuVMaterialsGenerated) { - if (LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, stack, false)) { - LuVTierEnhancer.doStacksContainAndReplace( - recipe, - recipe.mInputs, - GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), - true, - WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksContainAndReplace( - recipe, - new Object[] { recipe.mOutput }, - GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), - true, - WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } - if (LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[] { recipe.mOutput }, stack, false)) { - LuVTierEnhancer.doStacksContainAndReplace( - recipe, - recipe.mInputs, - GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), - true, - WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksContainAndReplace( - recipe, - new Object[] { recipe.mOutput }, - GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), - true, - WerkstoffLoader.LuVTierMaterial.get(prefixes)); - } - } - if (LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, stack, false)) { - LuVTierEnhancer.doStacksContainAndReplace( - recipe, - recipe.mFluidInputs, - Materials.Chrome.getMolten(1), - true, - WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - } - if (LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[] { recipe.mOutput }, stack, false)) { - LuVTierEnhancer.doStacksContainAndReplace( - recipe, - recipe.mFluidInputs, - Materials.Chrome.getMolten(1), - true, - WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - } - } - - private static boolean isOutputBlackListed(ItemStack output) { - if (blackListForOsmiridium.stream().anyMatch(s -> GT_Utility.areStacksEqual(s, output))) return true; - return false; - } - - private static ItemStack[] replaceArrayWith(ItemStack[] stackArray, Materials source, Werkstoff target, - Object recipe) { - boolean replaced = false; - for (int i = 0; i < stackArray.length; i++) { - ItemStack stack = stackArray[i]; - if (!BW_Util.checkStackAndPrefix(stack)) continue; - stackArray[i] = replaceStackWith(stack, source, target, recipe); - } - return stackArray; - } - - private static ItemStack replaceStackWith(ItemStack stack, Materials source, Werkstoff target, Object recipe) { - ItemData ass = GT_OreDictUnificator.getAssociation(stack); - if (ass.mMaterial.mMaterial.equals(source)) { - if (target.hasItemType(ass.mPrefix)) { - stack = target.get(ass.mPrefix, stack.stackSize); - if (recipe instanceof GT_Recipe) { - ((GT_Recipe) recipe).setOwner(MOD_ID); - } else if (recipe instanceof GT_Recipe_AssemblyLine) { - // todo: update NEI fake recipe - } - } - } - return stack; - } - - private static boolean doStacksContainAndReplace(Object recipe, FluidStack[] stacks, FluidStack stack, - boolean replace, Fluid... replacement) { - boolean replaced = false; - for (int i = 0; i < stacks.length; i++) { - if (GT_Utility.areFluidsEqual(stack, stacks[i])) if (!replace) return true; - else { - int amount = stacks[i].amount; - stacks[i] = new FluidStack(replacement[0], amount); - replaced = true; - } - } - if (replace && replaced) { - if (recipe instanceof GT_Recipe) { - ((GT_Recipe) recipe).setOwner(MOD_ID); - } else if (recipe instanceof GT_Recipe_AssemblyLine) { - // todo: update NEI fake recipe - } - } - return replaced; - } - - private static boolean doStacksContainAndReplace(Object recipe, Object[] stacks, ItemStack stack, boolean replace, - ItemStack... replacement) { - boolean replaced = false; - for (int i = 0; i < stacks.length; i++) { - if (!GT_Utility.isStackValid(stacks[i])) { - if (stacks[i] instanceof ArrayList && ((ArrayList) stacks[i]).size() > 0) { - if (GT_Utility.areStacksEqual(stack, (ItemStack) ((ArrayList) stacks[i]).get(0), true)) - if (!replace) return true; - else { - int amount = ((ItemStack) ((ArrayList) stacks[i]).get(0)).stackSize; - stacks[i] = new ArrayList<>(); - ((ArrayList) stacks[i]).add(BW_Util.setStackSize(replacement[0], amount)); - replaced = true; - } - - } else continue; - } else if (GT_Utility.areStacksEqual(stack, (ItemStack) stacks[i], true)) if (!replace) return true; - else { - int amount = ((ItemStack) stacks[i]).stackSize; - stacks[i] = BW_Util.setStackSize(replacement[0], amount); - replaced = true; - } - } - if (replace && replaced) { - if (recipe instanceof GT_Recipe) { - ((GT_Recipe) recipe).setOwner(MOD_ID); - } else if (recipe instanceof GT_Recipe_AssemblyLine) { - // todo: update NEI fake recipe - } - } - return replaced; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index cd9bb7f200..6a6d849947 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1468,6 +1468,7 @@ public class WerkstoffLoader { WerkstoffAdderRegistry.run(); addSubTags(); addItemsForGeneration(); + addBridgeSubTags(); runAdditionalOreDict(); long timepost = System.nanoTime(); MainMod.LOGGER.info( @@ -1600,6 +1601,12 @@ public class WerkstoffLoader { } } + private static void addBridgeSubTags() { + // add specific GT materials subtags to various werkstoff bridgematerials + + SubTag.METAL.addTo(LuVTierMaterial.getBridgeMaterial()); + } + public static long toGenerateGlobal; private static void addItemsForGeneration() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java new file mode 100644 index 0000000000..a76364faa7 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; + +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.dustSmall; + +import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_OreDictUnificator; + +public class AddSomeRecipes implements Runnable { + + public void run() { + + GT_Values.RA.addCentrifugeRecipe( + BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), + null, + null, + WerkstoffLoader.Xenon.getFluidOrGas(1), + WerkstoffLoader.Zirconium.get(dust), + WerkstoffLoader.Zirconium.get(dust), + WerkstoffLoader.Tiberium.get(dustSmall, 2), + WerkstoffLoader.Zirconium.get(dust, 2), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 8L), + GT_OreDictUnificator.get(dust, Materials.Platinum, 1L), + new int[] { 10_000, 5_000, 5_000, 2_500, 10_000, 10_000 }, + 250, + 2000); + + GT_Values.RA.addCentrifugeRecipe( + BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), + null, + null, + WerkstoffLoader.Xenon.getFluidOrGas(2), + WerkstoffLoader.Zirconium.get(dust, 2), + WerkstoffLoader.Zirconium.get(dust, 2), + WerkstoffLoader.Tiberium.get(dust), + WerkstoffLoader.Zirconium.get(dust, 4), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 18L), + GT_OreDictUnificator.get(dust, Materials.Platinum, 2L), + new int[] { 10_000, 5_000, 5_000, 2_500, 10_000, 10_000 }, + 500, + 2000); + + GT_Values.RA.addCentrifugeRecipe( + BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), + null, + null, + WerkstoffLoader.Xenon.getFluidOrGas(4), + WerkstoffLoader.Zirconium.get(dust, 4), + WerkstoffLoader.Zirconium.get(dust, 4), + WerkstoffLoader.Tiberium.get(dust, 2), + WerkstoffLoader.Zirconium.get(dust, 8), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 38L), + GT_OreDictUnificator.get(dust, Materials.Platinum, 4L), + new int[] { 10_000, 5_000, 5_000, 2_500, 10_000, 10_000 }, + 1000, + 2000); + + GT_Values.RA.addCentrifugeRecipe( + BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), + null, + null, + null, + ItemList.Depleted_Naquadah_4.get(8), + WerkstoffLoader.Zirconium.get(dust, 64), + WerkstoffLoader.Zirconium.get(dust, 64), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 48L), + new int[] { 10_000, 5_000, 5_000, 10_000, 10_000, 10_000 }, + 2000, + 8000); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 1f2c9d9106..2ca6d8028b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -47,7 +47,6 @@ import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; -import com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.LuVTierEnhancer; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; @@ -634,7 +633,7 @@ public class AdditionalRecipes { 100, BW_Util.getMachineVoltageFromTier(6)); - GregTech_API.sAfterGTPostload.add(new LuVTierEnhancer()); + GregTech_API.sAfterGTPostload.add(new AddSomeRecipes()); AdditionalRecipes.oldGThelperMethod(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java deleted file mode 100644 index 84b78c9b2b..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; - -import static gregtech.api.enums.OrePrefixes.dust; -import static gregtech.api.enums.OrePrefixes.dustSmall; - -import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; - -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.util.GT_OreDictUnificator; - -public class AfterLuVTierEnhacement { - - private AfterLuVTierEnhacement() {} - - public static void run() { - - GT_Values.RA.addCentrifugeRecipe( - BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), - null, - null, - WerkstoffLoader.Xenon.getFluidOrGas(1), - WerkstoffLoader.Zirconium.get(dust), - WerkstoffLoader.Zirconium.get(dust), - WerkstoffLoader.Tiberium.get(dustSmall, 2), - WerkstoffLoader.Zirconium.get(dust, 2), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 8L), - GT_OreDictUnificator.get(dust, Materials.Platinum, 1L), - new int[] { 10_000, 5_000, 5_000, 2_500, 10_000, 10_000 }, - 250, - 2000); - - GT_Values.RA.addCentrifugeRecipe( - BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), - null, - null, - WerkstoffLoader.Xenon.getFluidOrGas(2), - WerkstoffLoader.Zirconium.get(dust, 2), - WerkstoffLoader.Zirconium.get(dust, 2), - WerkstoffLoader.Tiberium.get(dust), - WerkstoffLoader.Zirconium.get(dust, 4), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 18L), - GT_OreDictUnificator.get(dust, Materials.Platinum, 2L), - new int[] { 10_000, 5_000, 5_000, 2_500, 10_000, 10_000 }, - 500, - 2000); - - GT_Values.RA.addCentrifugeRecipe( - BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), - null, - null, - WerkstoffLoader.Xenon.getFluidOrGas(4), - WerkstoffLoader.Zirconium.get(dust, 4), - WerkstoffLoader.Zirconium.get(dust, 4), - WerkstoffLoader.Tiberium.get(dust, 2), - WerkstoffLoader.Zirconium.get(dust, 8), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 38L), - GT_OreDictUnificator.get(dust, Materials.Platinum, 4L), - new int[] { 10_000, 5_000, 5_000, 2_500, 10_000, 10_000 }, - 1000, - 2000); - - GT_Values.RA.addCentrifugeRecipe( - BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), - null, - null, - null, - ItemList.Depleted_Naquadah_4.get(8), - WerkstoffLoader.Zirconium.get(dust, 64), - WerkstoffLoader.Zirconium.get(dust, 64), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 48L), - new int[] { 10_000, 5_000, 5_000, 10_000, 10_000, 10_000 }, - 2000, - 8000); - } -} -- cgit From 397cc96c658c7673d75506a4b6697b2d67e2b136 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 6 May 2023 09:08:08 +0200 Subject: update dep (cherry picked from commit fe6783cd29524c0014a714b6b1b36b06fc11dde7) Former-commit-id: e5f327a44996d4f7ea78e5a1a10a05fd94c8cab0 --- dependencies.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 2a784f0014..f3860503c5 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,9 +1,9 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.07:dev') - api("com.github.GTNewHorizons:TecTech:5.2.1:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.29-GTNH:dev") + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.12:dev') + api("com.github.GTNewHorizons:TecTech:5.2.4:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.30-GTNH:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.8:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" @@ -25,7 +25,7 @@ dependencies { transitive = false } - compileOnly("com.github.GTNewHorizons:EnderIO:2.4.11:api") { + compileOnly("com.github.GTNewHorizons:EnderIO:2.4.13:api") { transitive = false } -- cgit From b709f5355c6b1680460d385d56f832fe993efcac Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 6 May 2023 09:08:41 +0200 Subject: update bs (cherry picked from commit bcd1bfb50446b744ab087c4e00dd423cf7d2dd7a) Former-commit-id: 0c8cacd35b1d1b0729f985e1410bb687f79c4089 --- build.gradle | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 17e7501a27..6243482331 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1682616243 +//version: 1683056771 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -71,6 +71,9 @@ plugins { id 'com.matthewprenger.cursegradle' version '1.4.0' apply false id 'com.gtnewhorizons.retrofuturagradle' version '1.3.7' } + +print("You might want to check out './gradlew :faq' if your build fails.") + boolean settingsupdated = verifySettingsGradle() settingsupdated = verifyGitAttributes() || settingsupdated if (settingsupdated) @@ -1252,6 +1255,19 @@ if (!project.getGradle().startParameter.isOffline() && !Boolean.getBoolean('DISA } } +// If you want to add more cases to this task, implement them as arguments if total amount to print gets too large +tasks.register('faq') { + group = 'GTNH Buildscript' + description = 'Prints frequently asked questions about building a project' + + doLast { + print("If your build fails to fetch dependencies, they might have been deleted and replaced by newer " + + "versions.\nCheck if the versions you try to fetch are still on the distributing sites.\n" + + "The links can be found in repositories.gradle and build.gradle:repositories, " + + "not build.gradle:buildscript.repositories - this one is for gradle plugin metadata.") + } +} + static URL availableBuildScriptUrl() { new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/build.gradle") } -- cgit From 08a022a07cbc3b70ebfde85eb67cf1f914543d90 Mon Sep 17 00:00:00 2001 From: miozune Date: Mon, 8 May 2023 18:27:35 +0900 Subject: Migrate to FluidSlotWidget (#321) * Migrate to FluidSlotWidget * Update dependencies Former-commit-id: d5838d0e19b18af0c8fc60a1c50773c4b0a10461 --- dependencies.gradle | 2 +- .../tiered/GT_MetaTileEntity_CompressedFluidHatch.java | 7 ++++--- .../tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java | 6 ------ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index f3860503c5..8b53649112 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.12:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.20:dev') api("com.github.GTNewHorizons:TecTech:5.2.4:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.30-GTNH:dev") diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java index b217d29445..b8331c93f9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java @@ -15,13 +15,14 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; import net.minecraftforge.fluids.FluidStack; +import com.gtnewhorizons.modularui.common.widget.FluidSlotWidget; + import gregtech.api.enums.Materials; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.util.GT_Utility; -import gregtech.common.gui.modularui.widget.FluidDisplaySlotWidget; public class GT_MetaTileEntity_CompressedFluidHatch extends GT_MetaTileEntity_Hatch_Input { @@ -55,7 +56,7 @@ public class GT_MetaTileEntity_CompressedFluidHatch extends GT_MetaTileEntity_Ha } @Override - protected FluidDisplaySlotWidget createDrainableFluidSlot() { - return super.createDrainableFluidSlot().setEmptyCanFillFilter(f -> f == Materials.LiquidAir.mFluid); + protected FluidSlotWidget createFluidSlot() { + return super.createFluidSlot().setFilter(f -> f == Materials.LiquidAir.mFluid); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java index 2951c12d05..a5281e1b6a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java @@ -17,7 +17,6 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.common.gui.modularui.widget.FluidDisplaySlotWidget; public class GT_MetaTileEntity_HumongousInputHatch extends GT_MetaTileEntity_Hatch_Input { @@ -44,9 +43,4 @@ public class GT_MetaTileEntity_HumongousInputHatch extends GT_MetaTileEntity_Hat this.mDescriptionArray, this.mTextures); } - - @Override - protected FluidDisplaySlotWidget createDrainableFluidSlot() { - return super.createDrainableFluidSlot(); - } } -- cgit From 760c9ececc223d2a31077b3d7aa3e5e53c1e7fae Mon Sep 17 00:00:00 2001 From: miozune Date: Tue, 9 May 2023 14:18:42 +0900 Subject: Update dependencies (#322) Former-commit-id: 665ecd88259d026ce15ba11b831ad91983dd5518 --- build.gradle | 10 +++++++--- dependencies.gradle | 37 +++++-------------------------------- 2 files changed, 12 insertions(+), 35 deletions(-) diff --git a/build.gradle b/build.gradle index 6243482331..78ed8d44f0 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1683056771 +//version: 1683563728 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -72,7 +72,7 @@ plugins { id 'com.gtnewhorizons.retrofuturagradle' version '1.3.7' } -print("You might want to check out './gradlew :faq' if your build fails.") +print("You might want to check out './gradlew :faq' if your build fails.\n") boolean settingsupdated = verifySettingsGradle() settingsupdated = verifyGitAttributes() || settingsupdated @@ -222,6 +222,8 @@ if (enableModernJavaSyntax.toBoolean()) { dependencies { annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:1.0.0' + // workaround for https://github.com/bsideup/jabel/issues/174 + annotationProcessor 'net.java.dev.jna:jna-platform:5.13.0' compileOnly('com.github.bsideup.jabel:jabel-javac-plugin:1.0.0') { transitive = false // We only care about the 1 annotation class } @@ -1264,7 +1266,9 @@ tasks.register('faq') { print("If your build fails to fetch dependencies, they might have been deleted and replaced by newer " + "versions.\nCheck if the versions you try to fetch are still on the distributing sites.\n" + "The links can be found in repositories.gradle and build.gradle:repositories, " + - "not build.gradle:buildscript.repositories - this one is for gradle plugin metadata.") + "not build.gradle:buildscript.repositories - this one is for gradle plugin metadata.\n\n" + + "If your build fails to recognize the syntax of new Java versions, enable Jabel in your " + + "gradle.properties. See how it's done in GTNH ExampleMod/gradle.properties.") } } diff --git a/dependencies.gradle b/dependencies.gradle index 8b53649112..4d43d56b9b 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,41 +1,14 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.20:dev') - api("com.github.GTNewHorizons:TecTech:5.2.4:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.30-GTNH:dev") - - api("com.github.GTNewHorizons:GalacticGregGT5:1.0.8:dev") { + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.21:dev') + api("com.github.GTNewHorizons:TecTech:5.2.5:dev") + api("com.github.GTNewHorizons:GalacticGregGT5:1.0.9:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } - - api("com.github.GTNewHorizons:Galacticraft:3.0.68-GTNH:dev") - api("com.github.GTNewHorizons:ModularUI:1.1.2:dev") - api("com.github.GTNewHorizons:Avaritia:1.39:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.31-GTNH:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.23:deobf") {transitive = false} - compileOnly("com.github.GTNewHorizons:AppleCore:3.2.10:dev") { - transitive = false - } - compileOnly("com.github.GTNewHorizons:ForestryMC:4.6.7:api") { - transitive = false - } - compileOnly("com.github.GTNewHorizons:Railcraft:9.14.1:api") { - transitive = false - } - - compileOnly("com.github.GTNewHorizons:EnderIO:2.4.13:api") { - transitive = false - } - - compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.4-GTNH:api") { - transitive = false - } - compileOnly("com.github.GTNewHorizons:BuildCraft:7.1.33:dev") { - transitive = false - } - compileOnly("com.github.GTNewHorizons:ProjectRed:4.7.9-GTNH:dev") { - transitive = false - } + compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.5-GTNH:api") {transitive = false} } -- cgit From 718eb7292cb6f9014478c998c99900ef8819b5f9 Mon Sep 17 00:00:00 2001 From: glowredman <35727266+glowredman@users.noreply.github.com> Date: Sat, 13 May 2023 19:03:01 +0200 Subject: Move Ross128 system closer to solar system (#323) Former-commit-id: e16261e4f7303795c62e5e89f7b7176c2cf149f0 --- .../crossmod/galacticraft/solarsystems/Ross128SolarSystem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index e376fbd0f8..47132697ae 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -48,7 +48,7 @@ public class Ross128SolarSystem { public static void init() { Ross128SolarSystem.Ross128System = new SolarSystem("Ross128System", "milkyWay") - .setMapPosition(new Vector3(-1.0D, 1.3D, 0.0D)); + .setMapPosition(new Vector3(-0.3D, 0.4D, 0.0D)); Ross128SolarSystem.Ross128 = (Star) new Star("Ross128").setParentSolarSystem(Ross128SolarSystem.Ross128System) .setTierRequired(-1); Ross128SolarSystem.Ross128.setUnreachable(); -- cgit From f3233d537f3cdf30819d726f8524540900e5bcfe Mon Sep 17 00:00:00 2001 From: GDCloud <93287602+GDCloudstrike@users.noreply.github.com> Date: Thu, 18 May 2023 01:34:17 +0200 Subject: Add eternity mhdcsm recipes (#324) * update dep * eternity in mhdcsm Former-commit-id: dbac8b874ad0c8569ee9c7958ce8feef8337fc64 --- dependencies.gradle | 2 +- .../common/loaders/ElectricImplosionCompressorRecipes.java | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 4d43d56b9b..7d4c4f84ac 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.21:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.39:dev') api("com.github.GTNewHorizons:TecTech:5.2.5:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.9:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java index 58b7556850..7687ccedb4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java @@ -116,6 +116,18 @@ public class ElectricImplosionCompressorRecipes implements Runnable { 20 * 4, (int) TierEU.RECIPE_UXV); + // MHDCSM V2 + addElectricImplosionRecipe( + // IN. + new ItemStack[] { MaterialsUEVplus.Eternity.getNanite(1), MaterialsUEVplus.Universium.getNanite(1) }, + new FluidStack[] { MaterialsUEVplus.RawStarMatter.getFluid(128 * 144L) }, + // OUT. + new ItemStack[] { GT_Values.NI }, + new FluidStack[] { MaterialsUEVplus.MagnetohydrodynamicallyConstrainedStarMatter.getMolten(32 * 144L) }, + // Recipe stats. + 20 * 4, + (int) TierEU.RECIPE_MAX); + addMagnetohydrodynamicallyConstrainedStarMatterPartRecipes(); } @@ -152,7 +164,7 @@ public class ElectricImplosionCompressorRecipes implements Runnable { new ItemStack[] { circuit.splitStack(circuitMultiplier), getModItem(SuperSolarPanels.ID, "solarsplitter", 1, 0), getModItem(OpenComputers.ID, "hologram2", circuitMultiplier, 0), - GT_OreDictUnificator.get(part, MaterialsUEVplus.Universium, multiplier), }, + GT_OreDictUnificator.get(part, MaterialsUEVplus.Eternity, multiplier), }, new FluidStack[] { MaterialsUEVplus.MagnetohydrodynamicallyConstrainedStarMatter .getMolten((long) partFraction * multiplier) }, new ItemStack[] { GT_OreDictUnificator -- cgit From aaf8bb156d51826dc603743fd65ffe82f24dfa46 Mon Sep 17 00:00:00 2001 From: Fiyorin ᵘʷᵘ <61357+Fiyorin@users.noreply.github.com> Date: Sun, 21 May 2023 12:42:59 +0200 Subject: Void Miner: Don't suggest muffler/data access hatch in BlockRenderer (#325) * Void Miner: Don't suggest muffler/data access hatch in BlockRenderer the structure still forms as before * sPoTlEsS --------- Co-authored-by: Fiyorin Former-commit-id: e628696f882ac1019defa9525c016bf1f5d87562 --- .../crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index 2574f1bd23..c6b4656953 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -15,6 +15,11 @@ package com.github.bartimaeusnek.crossmod.galacticgreg; import static bloodasp.galacticgreg.registry.GalacticGregRegistry.getModContainers; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; +import static gregtech.api.enums.GT_HatchElement.Energy; +import static gregtech.api.enums.GT_HatchElement.InputBus; +import static gregtech.api.enums.GT_HatchElement.InputHatch; +import static gregtech.api.enums.GT_HatchElement.Maintenance; +import static gregtech.api.enums.GT_HatchElement.OutputBus; import static gregtech.api.enums.GT_Values.VN; import java.util.HashMap; @@ -40,6 +45,7 @@ import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer; import com.github.bartimaeusnek.bartworks.util.Pair; import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.ImmutableList; import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_Layer_Space; import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_SmallPieces_Space; @@ -51,6 +57,7 @@ import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; +import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.XSTR; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; @@ -187,6 +194,11 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri return tt; } + @Override + protected List> getAllowedHatches() { + return ImmutableList.of(InputHatch, InputBus, OutputBus, Maintenance, Energy); + } + /** * getter for the external drop map * -- cgit From 0156f2e444817671358354d42247005162da3d30 Mon Sep 17 00:00:00 2001 From: 梅天佑 <52530814+MeiTianyou@users.noreply.github.com> Date: Mon, 22 May 2023 15:51:01 +0800 Subject: change tooltip to be clearer (#326) * change tooltip to be clearer * spotlessapply Former-commit-id: dc7895a0896d909b91beb0f57d4219b9133799db --- .../common/tileentities/multis/GT_TileEntity_THTR.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index f38dcdb49f..913f952b22 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -144,15 +144,15 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("High Temperature Reactor") .addInfo("Controller block for the Thorium High Temperature Reactor (THTR)") + .addInfo("Needs to be primed with " + GT_Utility.formatNumbers(HELIUM_NEEDED) + " of helium") .addInfo("Needs a constant supply of coolant while running") .addInfo("Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles)") .addInfo("Consumes up to 0.5% of total Fuel Pellets per Operation depending on efficiency") - .addInfo( - "Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer") + .addInfo("Efficiency decreases exponentially if the internal buffer is not completely filled") .addInfo("Reactor will take 4 800L/t of coolant multiplied by efficiency") - .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t").addInfo("One Operation takes 9 hour") - .addSeparator().beginStructureBlock(11, 12, 11, true).addController("Front bottom center") - .addCasingInfo("Radiation Proof Casings", 500) + .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t") + .addInfo("One Operation takes 9 hours").addSeparator().beginStructureBlock(11, 12, 11, true) + .addController("Front bottom center").addCasingInfo("Radiation Proof Casings", 500) .addStructureInfo("Corners and the 2 touching blocks are air (cylindric)") .addInputBus("Any top layer casing", 2).addInputHatch("Any top layer casing", 2) .addOutputBus("Any bottom layer casing", 1).addOutputHatch("Any bottom layer casing", 1) -- cgit From 237ae10e3b2b4136c547498824ae5c9ca4007143 Mon Sep 17 00:00:00 2001 From: Dakota Jones <73182109+greesyB@users.noreply.github.com> Date: Wed, 24 May 2023 06:02:24 -0500 Subject: Fix neutronium machine block registration (#327) Former-commit-id: bb37b3c0d2752e2897e5ce05cc990d4b7a5e8c6c --- .../com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 0e55a538d1..48e178bc73 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -294,7 +294,6 @@ public class ItemRegistry { bitmask = GregTech_API.sMachineIDs.getOrDefault(LudicrousBlocks.resource_block, 0) | (1 << 1); GregTech_API.registerMachineBlock(LudicrousBlocks.resource_block, bitmask); - GregTech_API.registerMachineBlock(GregTech_API.sBlockMetal5, bitmask); ItemRegistry.THTR = new GT_TileEntity_THTR( ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, "THTR", -- cgit From 79375ddf5b29e98c65a8ba0f85845e4291ea4a53 Mon Sep 17 00:00:00 2001 From: glowredman <35727266+glowredman@users.noreply.github.com> Date: Sat, 27 May 2023 07:44:41 +0200 Subject: Move Ross128 system out a bit again (#328) Former-commit-id: 47c47c320d0475bd284680b1fbd625c7df908ef2 --- .../crossmod/galacticraft/solarsystems/Ross128SolarSystem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index 47132697ae..a69222d2b9 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -48,7 +48,7 @@ public class Ross128SolarSystem { public static void init() { Ross128SolarSystem.Ross128System = new SolarSystem("Ross128System", "milkyWay") - .setMapPosition(new Vector3(-0.3D, 0.4D, 0.0D)); + .setMapPosition(new Vector3(-0.5D, 0.65D, 0.0D)); Ross128SolarSystem.Ross128 = (Star) new Star("Ross128").setParentSolarSystem(Ross128SolarSystem.Ross128System) .setTierRequired(-1); Ross128SolarSystem.Ross128.setUnreachable(); -- cgit From 2053017d456fca5ada43974d3aa72d7dc32472b4 Mon Sep 17 00:00:00 2001 From: miozune Date: Sun, 28 May 2023 15:46:56 +0900 Subject: Fix version replacement (#330) Former-commit-id: bea94a8da777b597948d2598e922403967738193 --- gradle.properties | 17 ++++++++++------- .../bartimaeusnek/bartworks/API/API_REFERENCE.java | 18 ------------------ .../com/github/bartimaeusnek/bartworks/MainMod.java | 8 +------- .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 4 ++-- .../crossmod/tgregworks/MaterialsInjector.java | 3 ++- 5 files changed, 15 insertions(+), 35 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java diff --git a/gradle.properties b/gradle.properties index 6fa91ac230..7b394d5ef5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,16 +21,19 @@ forgeVersion = 10.13.4.1614 # 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 = MainMod.java,API_REFERENCE.java +# Generate a class with String fields for the mod id, name, version and group name named with the fields below +generateGradleTokenClass = com.github.bartimaeusnek.bartworks.API.API_REFERENCE gradleTokenModId = gradleTokenModName = -gradleTokenVersion = GRADLETOKEN_VERSION +gradleTokenVersion = VERSION gradleTokenGroupName = +# [DEPRECATED] +# Multiple source files can be defined here by providing a comma-seperated list: Class1.java,Class2.java,Class3.java +# public static final String VERSION = "GRADLETOKEN_VERSION"; +# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's +# version in @Mod([...], version = VERSION, [...]) +# Leave these properties empty to skip individual token replacements +replaceGradleTokenInFile = # In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can # leave this property empty. diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java deleted file mode 100644 index fea78559ad..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ -package com.github.bartimaeusnek.bartworks.API; - -public final class API_REFERENCE { - - public static final String VERSION = "GRADLETOKEN_VERSION"; -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index e5253d3dfb..d656e9840f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -82,7 +82,7 @@ import gregtech.api.util.GT_Recipe; @Mod( modid = MainMod.MOD_ID, name = MainMod.NAME, - version = MainMod.VERSION, + version = API_REFERENCE.VERSION, dependencies = "required-after:IC2; " + "required-after:gregtech; " + "after:berriespp; " + "after:tectech; " @@ -95,7 +95,6 @@ import gregtech.api.util.GT_Recipe; public final class MainMod { public static final String NAME = "BartWorks"; - public static final String VERSION = "GRADLETOKEN_VERSION"; public static final String MOD_ID = Mods.Names.BART_WORKS; public static final String APIVERSION = "11"; public static final Logger LOGGER = LogManager.getLogger(MainMod.NAME); @@ -115,11 +114,6 @@ public final class MainMod { @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { - - if (!(API_REFERENCE.VERSION.equals(MainMod.APIVERSION))) { - MainMod.LOGGER.error("Something has loaded an old API. Please contact the Mod authors to update!"); - } - if (GTPlusPlus.isModLoaded()) { MainMod.LOGGER.info("Found GT++, continuing"); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index d29299f13c..7f3239a7eb 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -25,7 +25,7 @@ import org.apache.commons.io.input.ReaderInputStream; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.API.API_REFERENCE; import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat; import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy; import com.github.bartimaeusnek.crossmod.tectech.TecTechResearchLoader; @@ -51,7 +51,7 @@ import cpw.mods.fml.common.event.FMLServerStartingEvent; public class BartWorksCrossmod { public static final String NAME = "BartWorks Mod Additions"; - public static final String VERSION = MainMod.VERSION; + public static final String VERSION = API_REFERENCE.VERSION; public static final String MOD_ID = "bartworkscrossmod"; public static final Logger LOGGER = LogManager.getLogger(BartWorksCrossmod.NAME); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java index 45ba78c82c..e770166668 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java @@ -10,6 +10,7 @@ import java.util.HashMap; import net.minecraftforge.common.config.Property; +import com.github.bartimaeusnek.bartworks.API.API_REFERENCE; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -36,7 +37,7 @@ import vexatos.tgregworks.reference.Config; public class MaterialsInjector { public static final String NAME = "BartWorks Mod Additions - TGregworks Container"; - public static final String VERSION = MainMod.VERSION; + public static final String VERSION = API_REFERENCE.VERSION; public static final String MOD_ID = "bartworkscrossmodtgregworkscontainer"; private static HashMap configProps; -- cgit From 5e06efde99f3c744ac2528bc0efcd71727ea2c85 Mon Sep 17 00:00:00 2001 From: miozune Date: Sun, 28 May 2023 18:23:46 +0900 Subject: Update to new void protection API & implement it for some multi (#329) * Update to new void protection API & implement it for some multi * Update method names * Update GT * Fix THTR & HTGR not preventing consumption Former-commit-id: 7a116178ec31dffe23fb741a3d432856189bbefc --- build.gradle | 21 +++++++++++++++++---- dependencies.gradle | 8 ++++---- .../tileentities/multis/GT_TileEntity_BioVat.java | 6 ++++++ .../multis/GT_TileEntity_CircuitAssemblyLine.java | 8 +++++++- .../GT_TileEntity_ElectricImplosionCompressor.java | 10 +++------- .../tileentities/multis/GT_TileEntity_HTGR.java | 13 +++++++++++-- .../tileentities/multis/GT_TileEntity_THTR.java | 13 +++++++++++-- .../multis/mega/GT_TileEntity_MegaBlastFurnace.java | 4 ++-- .../mega/GT_TileEntity_MegaChemicalReactor.java | 2 +- .../multis/mega/GT_TileEntity_MegaDistillTower.java | 2 +- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 2 +- 11 files changed, 64 insertions(+), 25 deletions(-) diff --git a/build.gradle b/build.gradle index 78ed8d44f0..a8b7532dea 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1683563728 +//version: 1684218858 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -69,7 +69,7 @@ plugins { id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.3.7' + id 'com.gtnewhorizons.retrofuturagradle' version '1.3.14' } print("You might want to check out './gradlew :faq' if your build fails.\n") @@ -569,9 +569,10 @@ repositories { def mixinProviderGroup = "io.github.legacymoddingmc" def mixinProviderModule = "unimixins" -def mixinProviderVersion = "0.1.6" +def mixinProviderVersion = "0.1.7.1" def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}" def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev" +ext.mixinProviderSpec = mixinProviderSpec dependencies { if (usesMixins.toBoolean()) { @@ -729,7 +730,7 @@ dependencies { java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") } if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.8') + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.13') } java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false} @@ -822,6 +823,18 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask { } this.classpath(project.java17DependenciesCfg) } + + public void setup(Project project) { + super.setup(project) + if (project.usesMixins.toBoolean()) { + this.extraJvmArgs.addAll(project.provider(() -> { + def mixinCfg = project.configurations.detachedConfiguration(project.dependencies.create(project.mixinProviderSpec)) + mixinCfg.canBeConsumed = false + mixinCfg.transitive = false + enableHotswap ? ["-javaagent:" + mixinCfg.singleFile.absolutePath] : [] + })) + } + } } def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Distribution.CLIENT, "runClient") diff --git a/dependencies.gradle b/dependencies.gradle index 7d4c4f84ac..84878f865c 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,13 +1,13 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.39:dev') - api("com.github.GTNewHorizons:TecTech:5.2.5:dev") + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.57-pre:dev') + api("com.github.GTNewHorizons:TecTech:5.2.18:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.9:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } - api("com.github.GTNewHorizons:Avaritia:1.39:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.31-GTNH:dev") + api("com.github.GTNewHorizons:Avaritia:1.42:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.35-GTNH:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.23:deobf") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.5-GTNH:api") {transitive = false} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 65cfae2ce4..bb01ef8cce 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -312,6 +312,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; + if (!canOutputAll(gtRecipe)) return false; if (!gtRecipe.isRecipeInputEqual(true, tFluids, tInputs)) return false; final FluidStack recipeFluidOutput = gtRecipe.getFluidOutput(0); @@ -739,4 +740,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa + " %"; return infoData; } + + @Override + public boolean supportsVoidProtection() { + return true; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 4d11a29638..c64ae704ca 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -233,6 +233,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends } for (GT_Recipe recipe : this.GT_RECIPE_COLLECTION) { + if (!canOutputAll(recipe)) return false; if (recipe.isRecipeInputEqual( true, false, @@ -439,7 +440,12 @@ public class GT_TileEntity_CircuitAssemblyLine extends } @Override - protected boolean isRecipeLockingEnabled() { + public boolean supportsVoidProtection() { + return true; + } + + @Override + public boolean isRecipeLockingEnabled() { return imprintedItemName != null && !imprintedItemName.equals(""); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 681dd0225a..b09d512fff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -285,16 +285,12 @@ public class GT_TileEntity_ElectricImplosionCompressor GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(tItemInputs) .setFluidInputs(tFluidInputs).setAvailableEUt(tTotalEU).setMaxParallel(tCurrentMaxParallel) - .enableConsumption().enableOutputCalculation(); + .enableConsumption().enableOutputCalculation().setController(this); if (batchMode) { helper.enableBatchMode(128); } - if (!voidExcess) { - helper.enableVoidProtection(this); - } - helper.build(); if (helper.getCurrentParallel() == 0) { @@ -540,12 +536,12 @@ public class GT_TileEntity_ElectricImplosionCompressor } @Override - protected boolean isBatchModeButtonEnabled() { + public boolean supportsBatchMode() { return true; } @Override - protected boolean isVoidExcessButtonEnabled() { + public boolean supportsVoidProtection() { return true; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index a53210a27e..96e1465c9d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -290,14 +290,18 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase int toReduce = MathUtils.floorInt((double) this.fuelsupply * 0.025D * eff); - this.fuelsupply -= toReduce; + final int originalToReduce = toReduce; int burnedballs = toReduce / 64; if (burnedballs > 0) toReduce -= burnedballs * 64; int meta = (this.fueltype * HTGRMaterials.MATERIALS_PER_FUEL) + HTGRMaterials.BURNED_OUT_FUEL_INDEX; - this.mOutputItems = new ItemStack[] { new ItemStack(HTGRMaterials.aHTGR_Materials, burnedballs, meta), + ItemStack[] toOutput = new ItemStack[] { new ItemStack(HTGRMaterials.aHTGR_Materials, burnedballs, meta), new ItemStack(HTGRMaterials.aHTGR_Materials, toReduce, meta + 1) }; + if (!canOutputAll(toOutput)) return false; + + this.fuelsupply -= originalToReduce; + this.mOutputItems = toOutput; // this.updateSlots(); // not needed ? @@ -456,6 +460,11 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase "HTGR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); } + @Override + public boolean supportsVoidProtection() { + return true; + } + public static class HTGRMaterials { private static class CustomHTGRSimpleSubItemClass extends SimpleSubItemClass { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 913f952b22..ed4fbccd84 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -254,14 +254,18 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase int toReduce = MathUtils.floorInt((double) this.fuelsupply * 0.005D * eff); - this.fuelsupply -= toReduce; + final int originalToReduce = toReduce; int burnedballs = toReduce / 64; if (burnedballs > 0) toReduce -= burnedballs * 64; int meta = THTRMaterials.MATERIAL_USED_FUEL_INDEX; - this.mOutputItems = new ItemStack[] { new ItemStack(THTRMaterials.aTHTR_Materials, burnedballs, meta), + ItemStack[] toOutput = new ItemStack[] { new ItemStack(THTRMaterials.aTHTR_Materials, burnedballs, meta), new ItemStack(THTRMaterials.aTHTR_Materials, toReduce, meta + 1) }; + if (!canOutputAll(toOutput)) return false; + + this.fuelsupply -= originalToReduce; + this.mOutputItems = toOutput; // this.updateSlots(); not needed ? @@ -383,6 +387,11 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase "THTR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); } + @Override + public boolean supportsVoidProtection() { + return true; + } + public static class THTRMaterials { public static final SimpleSubItemClass aTHTR_Materials = new SimpleSubItemClass( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 67c7f3f272..3003a1141b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -545,12 +545,12 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock } @Override - protected boolean isInputSeparationButtonEnabled() { + public boolean supportsInputSeparation() { return true; } @Override - protected boolean isBatchModeButtonEnabled() { + public boolean supportsBatchMode() { return true; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index bb410ec898..ddd716d661 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -317,7 +317,7 @@ public class GT_TileEntity_MegaChemicalReactor } @Override - protected boolean isBatchModeButtonEnabled() { + public boolean supportsBatchMode() { return true; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index d897a4bfa7..c7f1bc2380 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -496,7 +496,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } @Override - protected boolean isBatchModeButtonEnabled() { + public boolean supportsBatchMode() { return true; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 4937b284d7..daf87fd707 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -332,7 +332,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc } @Override - protected boolean isBatchModeButtonEnabled() { + public boolean supportsBatchMode() { return true; } } -- cgit From 54b27b473fb1624091c8f898940ac151bc5db15a Mon Sep 17 00:00:00 2001 From: RIONDY 'POPlol333' Adam <76914762+POPlol333@users.noreply.github.com> Date: Mon, 29 May 2023 15:54:57 +0200 Subject: butcher eic recipe time (#331) * butcher eic recipe time * oh lol vm time Former-commit-id: 68ffdf00b9c101b9af30bc11d963a43bdfec847d --- .../common/loaders/recipes/AssemblyLine.java | 12 +++++------- .../crossmod/tectech/TecTechResearchLoader.java | 21 +++++++++++---------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java index 2f96dabbe1..11c93d05ac 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java @@ -1,6 +1,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; import static gregtech.api.enums.Mods.GalactiGreg; +import static gregtech.api.util.GT_RecipeBuilder.MINUTES; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; @@ -11,10 +12,7 @@ import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.*; import gregtech.api.util.GT_OreDictUnificator; public class AssemblyLine implements Runnable { @@ -42,7 +40,7 @@ public class AssemblyLine implements Runnable { if (GalactiGreg.isModLoaded()) { GT_Values.RA.addAssemblylineRecipe( ItemList.OreDrill4.get(1L), - BW_Util.getMachineVoltageFromTier(6), + (int) TierEU.LuV, new Object[] { ItemList.OreDrill4.get(1L), GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Europium, 9L), Materials.Europium.getPlates(3), ItemList.Electric_Motor_LuV.get(9L), @@ -51,8 +49,8 @@ public class AssemblyLine implements Runnable { new FluidStack[] { new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Neon.getFluidOrGas(20000), }, ItemRegistry.voidminer[0].copy(), - 108000, - BW_Util.getMachineVoltageFromTier(6)); + 5 * MINUTES, + (int) TierEU.LuV); } GT_Values.RA.addAssemblylineRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java index 16b40531c5..4d8298bb05 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java @@ -14,6 +14,7 @@ package com.github.bartimaeusnek.crossmod.tectech; import static gregtech.api.enums.Mods.GalactiGreg; +import static gregtech.api.util.GT_RecipeBuilder.MINUTES; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; @@ -21,12 +22,12 @@ import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.technus.tectech.recipe.TT_recipeAdder; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_OreDictUnificator; public class TecTechResearchLoader { @@ -42,7 +43,7 @@ public class TecTechResearchLoader { ItemRegistry.voidminer[0].copy(), 1024000, 256, - BW_Util.getMachineVoltageFromTier(7), + (int) TierEU.RECIPE_ZPM, 24, new Object[] { ItemRegistry.voidminer[0].copy(), GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), @@ -52,14 +53,14 @@ public class TecTechResearchLoader { new FluidStack[] { new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Krypton.getFluidOrGas(20000) }, ItemRegistry.voidminer[1].copy(), - 216000, - BW_Util.getMachineVoltageFromTier(7)); + 5 * MINUTES, + (int) TierEU.RECIPE_ZPM); TT_recipeAdder.addResearchableAssemblylineRecipe( ItemRegistry.voidminer[1].copy(), 8192000, 512, - BW_Util.getMachineVoltageFromTier(8), + (int) TierEU.RECIPE_UV, 64, new Object[] { ItemRegistry.voidminer[1].copy(), GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), @@ -69,15 +70,15 @@ public class TecTechResearchLoader { new FluidStack[] { new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Oganesson.getFluidOrGas(20000) }, ItemRegistry.voidminer[2].copy(), - 432000, - BW_Util.getMachineVoltageFromTier(8)); + 5 * MINUTES, + (int) TierEU.RECIPE_UV); } TT_recipeAdder.addResearchableAssemblylineRecipe( ItemList.Machine_Multi_ImplosionCompressor.get(1L), 64000, 48, - BW_Util.getMachineVoltageFromTier(8), + (int) TierEU.UV, 8, new Object[] { ItemList.Machine_Multi_ImplosionCompressor.get(1L), Materials.Neutronium.getBlocks(5), GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), @@ -87,8 +88,8 @@ public class TecTechResearchLoader { new FluidStack[] { new FluidStack(solderIndalloy, 1440), Materials.Osmium.getMolten(1440), Materials.Neutronium.getMolten(1440) }, ItemRegistry.eic.copy(), - 240000, - BW_Util.getMachineVoltageFromTier(8)); + 5 * MINUTES, + (int) TierEU.UV); } } -- cgit From 2acf10d64989dc9a148bdc47f228598ff4b47028 Mon Sep 17 00:00:00 2001 From: GDCloud <93287602+GDCloudstrike@users.noreply.github.com> Date: Sun, 4 Jun 2023 18:39:57 +0200 Subject: fix (#332) Former-commit-id: 871a3cc01abe46612e118604d211b68706bb8fd4 --- .../bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java | 4 ++-- .../github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java index 11c93d05ac..f3d8ccf406 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java @@ -40,7 +40,7 @@ public class AssemblyLine implements Runnable { if (GalactiGreg.isModLoaded()) { GT_Values.RA.addAssemblylineRecipe( ItemList.OreDrill4.get(1L), - (int) TierEU.LuV, + (int) TierEU.RECIPE_LuV, new Object[] { ItemList.OreDrill4.get(1L), GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Europium, 9L), Materials.Europium.getPlates(3), ItemList.Electric_Motor_LuV.get(9L), @@ -50,7 +50,7 @@ public class AssemblyLine implements Runnable { WerkstoffLoader.Neon.getFluidOrGas(20000), }, ItemRegistry.voidminer[0].copy(), 5 * MINUTES, - (int) TierEU.LuV); + (int) TierEU.RECIPE_LuV); } GT_Values.RA.addAssemblylineRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java index 4d8298bb05..2dd621b2b8 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java @@ -78,7 +78,7 @@ public class TecTechResearchLoader { ItemList.Machine_Multi_ImplosionCompressor.get(1L), 64000, 48, - (int) TierEU.UV, + (int) TierEU.RECIPE_UV, 8, new Object[] { ItemList.Machine_Multi_ImplosionCompressor.get(1L), Materials.Neutronium.getBlocks(5), GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), @@ -89,7 +89,7 @@ public class TecTechResearchLoader { Materials.Neutronium.getMolten(1440) }, ItemRegistry.eic.copy(), 5 * MINUTES, - (int) TierEU.UV); + (int) TierEU.RECIPE_UV); } } -- cgit From d0da64f4bd8ef61065e9795f58d0e149875ffc9c Mon Sep 17 00:00:00 2001 From: Runakai1 <48415331+Runakai1@users.noreply.github.com> Date: Thu, 8 Jun 2023 07:55:43 +0200 Subject: Update PlatinumSludgeOverHaul.java (#334) Former-commit-id: 9caaa5e532988d5be1281ef95bacf4c728075490 --- .../system/material/GT_Enhancement/PlatinumSludgeOverHaul.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 77bc39ba69..e384e61d3e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -120,7 +120,8 @@ import gregtech.common.blocks.GT_Block_Ores_Abstract; public class PlatinumSludgeOverHaul { private static final Materials[] BLACKLIST = { Materials.HSSS, Materials.EnderiumBase, Materials.Osmiridium, - Materials.get("Uraniumtriplatinid"), Materials.get("Tetranaquadahdiindiumhexaplatiumosminid"), + Materials.TPV, Materials.get("Uraniumtriplatinid"), + Materials.get("Tetranaquadahdiindiumhexaplatiumosminid"), Materials.get("Longasssuperconductornameforuvwire"), }; private static final OrePrefixes[] OPBLACKLIST = { crushedCentrifuged, crushed, crushedPurified, dustPure, dustImpure, dustRefined, dust, dustTiny, dustSmall }; @@ -722,7 +723,8 @@ public class PlatinumSludgeOverHaul { maploop: for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { if (map == GT_Recipe.GT_Recipe_Map.sFusionRecipes || map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes - || map.mUnlocalizedName.equals("gt.recipe.eyeofharmony")) + || map.mUnlocalizedName.equals("gt.recipe.eyeofharmony") + || map.mUnlocalizedName.equals("gtpp.recipe.quantumforcesmelter")) continue; HashSet toDel = new HashSet<>(); recipeloop: for (GT_Recipe recipe : map.mRecipeList) { -- cgit From 03d5284b6bfd866554f315a192e75cd7586b86f2 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Thu, 15 Jun 2023 18:40:54 +0100 Subject: Ebf Noble Gas Overhaul (#336) * try with og and arg * adjust all * work relative to starting gas Former-commit-id: d5747ce95acc53fda473deabfa69158aa9b34140 --- .../common/loaders/StaticRecipeChangeLoaders.java | 19 +++++++++++++++---- .../bartworks/system/material/WerkstoffLoader.java | 12 ++++++++---- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index d392dd452f..dc68b5e33a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -86,6 +86,11 @@ public class StaticRecipeChangeLoaders { gtEbfGasRecipeTimeMultipliers = new TObjectDoubleHashMap<>(10, 0.5F, -1.0D); // keep default value as -1 // Example to make Argon cut recipe times into a third of the original: // gtEbfGasRecipeTimeMultipliers.put(Materials.Argon, 1.0D / 3.0D); + + gtEbfGasRecipeTimeMultipliers.put(Materials.Nitrogen, 1.0D); + gtEbfGasRecipeTimeMultipliers.put(Materials.Helium, 0.9D); + gtEbfGasRecipeTimeMultipliers.put(Materials.Argon, 0.8D); + gtEbfGasRecipeTimeMultipliers.put(Materials.Radon, 0.7D); } if (gtEbfGasRecipeConsumptionMultipliers == null) { // For Werkstoff gases, use Werkstoff.Stats.setEbfGasRecipeConsumedAmountMultiplier @@ -94,6 +99,10 @@ public class StaticRecipeChangeLoaders { // Example to make Argon recipes use half the gas amount of the primary recipe (1000L->500L, 2000L->1000L // etc.): // gtEbfGasRecipeConsumptionMultipliers.put(Materials.Argon, 1.0D / 2.0D); + gtEbfGasRecipeConsumptionMultipliers.put(Materials.Nitrogen, 1.0D); + gtEbfGasRecipeConsumptionMultipliers.put(Materials.Helium, 1.0D); + gtEbfGasRecipeConsumptionMultipliers.put(Materials.Argon, 0.85D); + gtEbfGasRecipeConsumptionMultipliers.put(Materials.Radon, 0.7D); } ArrayListMultimap toChange = getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS); editRecipes(toChange, getNoGasItems(toChange)); @@ -399,22 +408,24 @@ public class StaticRecipeChangeLoaders { private static int transformEBFGasRecipeTime(GT_Recipe recipe, Materials originalGas, Materials newGas) { double newEbfMul = gtEbfGasRecipeTimeMultipliers.get(newGas); - if (newEbfMul < 0.0D) { + double originalEbfMul = gtEbfGasRecipeTimeMultipliers.get(originalGas); + if (newEbfMul < 0.0D || originalEbfMul < 0.0D) { return transformEBFGasRecipeTime(recipe.mDuration, originalGas.getProtons(), newGas.getProtons()); } else { - return Math.max(1, (int) ((double) recipe.mDuration * newEbfMul)); + return Math.max(1, (int) ((double) recipe.mDuration * newEbfMul / originalEbfMul)); } } private static int transformEBFGasRecipeTime(GT_Recipe recipe, Materials originalGas, Werkstoff newGas) { double newEbfMul = newGas.getStats().getEbfGasRecipeTimeMultiplier(); - if (newEbfMul < 0.0D) { + double originalEbfMul = gtEbfGasRecipeTimeMultipliers.get(originalGas); + if (newEbfMul < 0.0D || originalEbfMul < 0.0D) { return transformEBFGasRecipeTime( recipe.mDuration, originalGas.getProtons(), newGas.getStats().getProtons()); } else { - return Math.max(1, (int) ((double) recipe.mDuration * newEbfMul)); + return Math.max(1, (int) ((double) recipe.mDuration * newEbfMul / originalEbfMul)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 6a6d849947..23c0331b9a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -631,7 +631,8 @@ public class WerkstoffLoader { new short[] { 0x14, 0x39, 0x7F, 0 }, "Xenon", "Xe", - new Werkstoff.Stats().setProtons(54).setMass(131).setGas(true), + new Werkstoff.Stats().setProtons(54).setMass(131).setGas(true).setEbfGasRecipeTimeMultiplier(0.4d) + .setEbfGasRecipeConsumedAmountMultiplier(0.25d), Werkstoff.Types.ELEMENT, new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), 37, @@ -643,7 +644,8 @@ public class WerkstoffLoader { new short[] { 0x14, 0x39, 0x7F, 0 }, "Oganesson", "Og", - new Werkstoff.Stats().setProtons(118).setMass(294).setGas(true), + new Werkstoff.Stats().setProtons(118).setMass(294).setGas(true).setEbfGasRecipeTimeMultiplier(0.3d) + .setEbfGasRecipeConsumedAmountMultiplier(0.1d), Werkstoff.Types.ELEMENT, new Werkstoff.GenerationFeatures().disable().addCells(), 38, @@ -679,7 +681,8 @@ public class WerkstoffLoader { new short[] { 0xff, 0x07, 0x3a }, "Neon", "Ne", - new Werkstoff.Stats().setProtons(Element.Ne.mProtons).setMass(Element.Ne.getMass()).setGas(true), + new Werkstoff.Stats().setProtons(Element.Ne.mProtons).setMass(Element.Ne.getMass()).setGas(true) + .setEbfGasRecipeTimeMultiplier(0.6d).setEbfGasRecipeConsumedAmountMultiplier(0.55d), Werkstoff.Types.ELEMENT, new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), 41, @@ -691,7 +694,8 @@ public class WerkstoffLoader { new short[] { 0xb1, 0xff, 0x32 }, "Krypton", "Kr", - new Werkstoff.Stats().setProtons(Element.Kr.mProtons).setMass(Element.Kr.getMass()).setGas(true), + new Werkstoff.Stats().setProtons(Element.Kr.mProtons).setMass(Element.Kr.getMass()).setGas(true) + .setEbfGasRecipeTimeMultiplier(0.5d).setEbfGasRecipeConsumedAmountMultiplier(0.4d), Werkstoff.Types.ELEMENT, new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), 42, -- cgit From 84409a81339479cfc253b1ba829e28be1f7e0061 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Tue, 20 Jun 2023 12:25:55 +0100 Subject: use the right LuV material (#337) Former-commit-id: 045438d43c647d5620f1f9ffbb67eaac06259ee1 --- .../bartworks/common/loaders/recipes/AssemblyLine.java | 9 +++++++-- .../bartworks/common/loaders/recipes/CraftingRecipes.java | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java index f3d8ccf406..7331353108 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java @@ -12,7 +12,11 @@ import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import gregtech.api.enums.*; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_OreDictUnificator; public class AssemblyLine implements Runnable { @@ -58,7 +62,8 @@ public class AssemblyLine implements Runnable { 24000, new ItemStack[] { ItemList.Machine_LuV_CircuitAssembler.get(1L), ItemList.Robot_Arm_LuV.get(4L), ItemList.Electric_Motor_LuV.get(4L), ItemList.Field_Generator_LuV.get(1L), - ItemList.Emitter_LuV.get(1L), ItemList.Sensor_LuV.get(1L), Materials.Chrome.getPlates(8) }, + ItemList.Emitter_LuV.get(1L), ItemList.Sensor_LuV.get(1L), + WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.plate, 8) }, new FluidStack[] { new FluidStack(solderIndalloy, 1440) }, ItemRegistry.cal.copy(), 24000, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java index 9549625c8a..c36b0a6127 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java @@ -404,7 +404,7 @@ public class CraftingRecipes implements Runnable { GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), 'C', "circuit" + Materials.Master, 'F', ItemList.Field_Generator_LuV.get(1L), 'E', ItemList.Emitter_LuV.get(1L), 'S', ItemList.Sensor_LuV.get(1L), 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), }); + WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.plate, 1), }); // ClonalCellularSynthesisModule GT_ModHandler.addCraftingRecipe( @@ -414,7 +414,7 @@ public class CraftingRecipes implements Runnable { GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), 'C', "circuit" + Materials.Master, 'F', ItemList.Field_Generator_LuV.get(1L), 'E', ItemList.Emitter_LuV.get(1L), 'S', ItemList.Sensor_LuV.get(1L), 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), }); + WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.plate, 1), }); GT_ModHandler.addCraftingRecipe( new GT_TileEntity_BioVat( -- cgit From 027d009b82016759ded5dabe716a43426499137e Mon Sep 17 00:00:00 2001 From: miozune Date: Thu, 29 Jun 2023 13:16:28 +0900 Subject: Fix non-positive TiC tool stats (#339) Former-commit-id: a1e015a603e645aadf97a5dc4eccdd5fa384a1af --- dependencies.gradle | 2 +- .../crossmod/tgregworks/MaterialsInjector.java | 137 ++------------------- 2 files changed, 12 insertions(+), 127 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 84878f865c..b7d7388612 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -9,6 +9,6 @@ dependencies { api("com.github.GTNewHorizons:Avaritia:1.42:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.35-GTNH:dev") - compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.23:deobf") {transitive = false} + compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.24:deobf") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.5-GTNH:api") {transitive = false} } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java index e770166668..0a6b9d1cca 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java @@ -2,26 +2,17 @@ package com.github.bartimaeusnek.crossmod.tgregworks; import static gregtech.api.enums.Mods.TinkersGregworks; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; - import net.minecraftforge.common.config.Property; import com.github.bartimaeusnek.bartworks.API.API_REFERENCE; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -import tconstruct.library.TConstructRegistry; import vexatos.tgregworks.TGregworks; -import vexatos.tgregworks.integration.TGregRegistry; import vexatos.tgregworks.item.ItemTGregPart; import vexatos.tgregworks.reference.Config; @@ -33,72 +24,19 @@ import vexatos.tgregworks.reference.Config; + "required-after:bartworks;" + "before:TGregworks;" + "before:miscutils; ") -@SuppressWarnings("unchecked") public class MaterialsInjector { public static final String NAME = "BartWorks Mod Additions - TGregworks Container"; public static final String VERSION = API_REFERENCE.VERSION; public static final String MOD_ID = "bartworkscrossmodtgregworkscontainer"; - private static HashMap configProps; - private static ArrayList configIDs; - private static Method getGlobalMultiplierMethod; - private static Method getGlobalMultiplierMethodTwoArguments; - private static Method getMultiplierMethod; - private static Method getMaterialIDMethod; - private static Method getReinforcedLevelMethod; - private static Method getStoneboundLevelMethod; - @Mod.EventHandler public void init(FMLInitializationEvent init) { if (TinkersGregworks.isModLoaded()) { - MaterialsInjector.preinit(); MaterialsInjector.run(); } } - private static void preinit() { - try { - getFields(); - getMethodes(); - } catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | NoSuchMethodException - | SecurityException e) { - MainMod.LOGGER.catching(e); - FMLCommonHandler.instance().exitJava(1, true); - } - } - - private static void getFields() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException { - Field configPropsField = TGregRegistry.class.getDeclaredField("configProps"); - configPropsField.setAccessible(true); - configProps = (HashMap) configPropsField.get(TGregworks.registry); - - Field configIDsField = TGregRegistry.class.getDeclaredField("configIDs"); - configIDsField.setAccessible(true); - configIDs = (ArrayList) configIDsField.get(TGregworks.registry); - } - - private static void getMethodes() throws NoSuchMethodException, SecurityException { - getGlobalMultiplierMethod = TGregRegistry.class.getDeclaredMethod("getGlobalMultiplier", String.class); - getGlobalMultiplierMethod.setAccessible(true); - - getGlobalMultiplierMethodTwoArguments = TGregRegistry.class - .getDeclaredMethod("getGlobalMultiplier", String.class, double.class); - getGlobalMultiplierMethodTwoArguments.setAccessible(true); - - getMultiplierMethod = TGregRegistry.class.getDeclaredMethod("getMultiplier", Materials.class, String.class); - getMultiplierMethod.setAccessible(true); - - getMaterialIDMethod = TGregRegistry.class.getDeclaredMethod("getMaterialID", Materials.class); - getMaterialIDMethod.setAccessible(true); - - getReinforcedLevelMethod = TGregRegistry.class.getDeclaredMethod("getReinforcedLevel", Materials.class); - getReinforcedLevelMethod.setAccessible(true); - - getStoneboundLevelMethod = TGregRegistry.class.getDeclaredMethod("getStoneboundLevel", Materials.class); - getStoneboundLevelMethod.setAccessible(true); - } - public static void run() { MainMod.LOGGER.info("Registering TGregworks - BartWorks tool parts."); Werkstoff.werkstoffHashSet.stream() @@ -109,27 +47,22 @@ public class MaterialsInjector { registerParts(m); }); - configProps.clear(); - configIDs.clear(); + TGregworks.registry.configProps.clear(); + TGregworks.registry.configIDs.clear(); ItemTGregPart.toolMaterialNames = TGregworks.registry.toolMaterialNames; } private static void registerParts(Materials m) { - try { - TGregworks.registry.toolMaterialNames.add(m.mDefaultLocalName); - int matID = (int) getMaterialIDMethod.invoke(TGregworks.registry, m); + TGregworks.registry.toolMaterialNames.add(m.mDefaultLocalName); + int matID = TGregworks.registry.getMaterialID(m); - addToolMaterial(matID, m); - addBowMaterial(matID, m); - addArrowMaterial(matID, m); + TGregworks.registry.addToolMaterial(matID, m); + TGregworks.registry.addBowMaterial(matID, m); + TGregworks.registry.addArrowMaterial(matID, m); - TGregworks.registry.matIDs.put(m, matID); - TGregworks.registry.materialIDMap.put(matID, m); - } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { - MainMod.LOGGER.catching(e); - FMLCommonHandler.instance().exitJava(1, true); - } + TGregworks.registry.matIDs.put(m, matID); + TGregworks.registry.materialIDMap.put(matID, m); } private static void setConfigProps(Materials m) { @@ -137,56 +70,8 @@ public class MaterialsInjector { TGregworks.registry.toolMaterials.add(m); Property configProp = TGregworks.config .get(Config.onMaterial(Config.MaterialID), m.mName, 0, null, 0, 100000); - configProps.put(m, configProp); - configIDs.add(configProp.getInt()); + TGregworks.registry.configProps.put(m, configProp); + TGregworks.registry.configIDs.add(configProp.getInt()); } } - - private static void addToolMaterial(int matID, Materials m) - throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { - TConstructRegistry.addToolMaterial( - matID, - m.mName, - m.mLocalizedName, - m.mToolQuality, - (int) (m.mDurability * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.Durability) - * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.Durability)), // Durability - (int) (m.mToolSpeed * 100F - * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.MiningSpeed) - * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.MiningSpeed)), // Mining - // speed - (int) (m.mToolQuality * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.Attack) - * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.Attack)), // Attack - (m.mToolQuality - 0.5F) - * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.HandleModifier) - * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.HandleModifier), // Handle - // Modifier - (int) getReinforcedLevelMethod.invoke(TGregworks.registry, m), - (float) getStoneboundLevelMethod.invoke(TGregworks.registry, m), - "", - (m.getRGBA()[0] << 16) | (m.getRGBA()[1] << 8) | (m.getRGBA()[2])); - } - - private static void addBowMaterial(int matID, Materials m) - throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { - TConstructRegistry.addBowMaterial( - matID, - (int) ((float) m.mToolQuality * 10F - * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.BowDrawSpeed) - * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.BowDrawSpeed)), - (((float) m.mToolQuality) - 0.5F) - * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.BowFlightSpeed) - * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.BowFlightSpeed)); - } - - private static void addArrowMaterial(int matID, Materials m) - throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { - TConstructRegistry.addArrowMaterial( - matID, - (float) ((((double) m.getMass()) / 10F) - * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.ArrowMass) - * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.ArrowMass)), - (float) getGlobalMultiplierMethodTwoArguments.invoke(TGregworks.registry, Config.ArrowBreakChance, 0.9) - * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.ArrowBreakChance)); - } } -- cgit From 2cff3953cc8f84cc5094c1a914a625abaf1653e9 Mon Sep 17 00:00:00 2001 From: Daniel Mendes <70096037+Steelux8@users.noreply.github.com> Date: Tue, 4 Jul 2023 18:41:37 +0100 Subject: Buff output of Oganesson fusion recipe (#335) Former-commit-id: aec759a45fd5db6cad751181a24ff343df11efc3 --- .../system/material/processingLoaders/AdditionalRecipes.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 2ca6d8028b..0cc8733fff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -366,8 +366,8 @@ public class AdditionalRecipes { 480000000); GT_Values.RA.addFusionReactorRecipe( WerkstoffLoader.Californium.getMolten(32), - WerkstoffLoader.Calcium.getMolten(144), - WerkstoffLoader.Oganesson.getFluidOrGas(144), + WerkstoffLoader.Calcium.getMolten(720), + WerkstoffLoader.Oganesson.getFluidOrGas(720), 420, 49152, 600000000); -- cgit From fbfca2f60c6c83f77c9d80517b62db902fcc3c85 Mon Sep 17 00:00:00 2001 From: miozune Date: Mon, 10 Jul 2023 18:15:18 +0900 Subject: Migrate findRecipe method (#338) * Migrate findRecipe method * Update dependencies.gradle * Update deps * update deps --------- Co-authored-by: Martin Robertz Former-commit-id: d173b08a7017209b9ea4383680c34fda56035b5c --- build.gradle | 14 +- dependencies.gradle | 10 +- .../bartimaeusnek/bartworks/util/BWRecipes.java | 83 +----- .../crossmod/emt/recipe/TCRecipeHandler.java | 312 --------------------- .../multi/GT_Industrial_Alchemic_Construct.java | 185 ------------ .../crossmod/emt/util/EMTHandler.java | 36 --- 6 files changed, 14 insertions(+), 626 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java diff --git a/build.gradle b/build.gradle index a8b7532dea..3930990407 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1684218858 +//version: 1685785062 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -1276,12 +1276,14 @@ tasks.register('faq') { description = 'Prints frequently asked questions about building a project' doLast { - print("If your build fails to fetch dependencies, they might have been deleted and replaced by newer " + - "versions.\nCheck if the versions you try to fetch are still on the distributing sites.\n" + - "The links can be found in repositories.gradle and build.gradle:repositories, " + - "not build.gradle:buildscript.repositories - this one is for gradle plugin metadata.\n\n" + + print("If your build fails to fetch dependencies, run './gradlew updateDependencies'. " + + "Or you can manually check if the versions are still on the distributing sites - " + + "the links can be found in repositories.gradle and build.gradle:repositories, " + + "but not build.gradle:buildscript.repositories - those ones are for gradle plugin metadata.\n\n" + "If your build fails to recognize the syntax of new Java versions, enable Jabel in your " + - "gradle.properties. See how it's done in GTNH ExampleMod/gradle.properties.") + "gradle.properties. See how it's done in GTNH ExampleMod/gradle.properties. " + + "However, keep in mind that Jabel enables only syntax features, but not APIs that were introduced in " + + "Java 9 or later.") } } diff --git a/dependencies.gradle b/dependencies.gradle index b7d7388612..1b95793bc2 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,14 +1,14 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.57-pre:dev') - api("com.github.GTNewHorizons:TecTech:5.2.18:dev") + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.122:dev') + api("com.github.GTNewHorizons:TecTech:5.2.34:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.9:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } - api("com.github.GTNewHorizons:Avaritia:1.42:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.35-GTNH:dev") + api("com.github.GTNewHorizons:Avaritia:1.45:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.38-GTNH:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.24:deobf") {transitive = false} - compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.5-GTNH:api") {transitive = false} + compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.12-GTNH:api") {transitive = false} } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 116fd7f1ef..9fc49a3716 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -45,13 +45,10 @@ import com.gtnewhorizons.modularui.api.math.Pos2d; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; -import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.gui.modularui.GT_UITextures; -import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; -import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -812,85 +809,7 @@ public class BWRecipes { aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); - } - - /** - * finds a Recipe matching the aFluid, aSpecial and ItemStack Inputs. - * - * @param aTileEntity an Object representing the current coordinates of the executing - * Block/Entity/Whatever. This may be null, especially during Startup. - * @param aRecipe in case this is != null it will try to use this Recipe first when looking things - * up. - * @param aNotUnificated if this is T the Recipe searcher will unificate the ItemStack Inputs - * @param aDontCheckStackSizes if set to false will only return recipes that can be executed at least once with - * the provided input - * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage - * @param aFluids the Fluid Inputs - * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with - * this, but some custom ones do. Like this one. - * @param aInputs the Item Inputs - * @return the Recipe it has found or null for no matching Recipe - */ - public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, - ItemStack... aInputs) { - // No Recipes? Well, nothing to be found then. - if (mRecipeList.isEmpty()) return null; - - // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 - // Stack" or "at least 2 Stacks" before they start searching for Recipes. - // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in - // their Machines to select Sub Recipes. - if (GregTech_API.sPostloadFinished) { - if (mMinimalInputFluids > 0) { - if (aFluids == null) return null; - int tAmount = 0; - for (FluidStack aFluid : aFluids) if (aFluid != null) tAmount++; - if (tAmount < mMinimalInputFluids) return null; - } - if (mMinimalInputItems > 0) { - if (aInputs == null) return null; - int tAmount = 0; - for (ItemStack aInput : aInputs) if (aInput != null) tAmount++; - if (tAmount < mMinimalInputItems) return null; - } - } - - // Unification happens here in case the Input isn't already unificated. - if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object) aInputs); - - // Check the Recipe which has been used last time in order to not have to search for it again, if possible. - if (aRecipe != null) if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered - && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) - && BW_Util.areStacksEqualOrNull((ItemStack) aRecipe.mSpecialItems, aSpecialSlot)) - return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; - - // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. - if (mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs) if (tStack != null) { - Collection tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack)); - if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) - && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) - return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; - tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(GT_Values.W, tStack))); - if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) - && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) - return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; - } - - // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that - // Map too. - if (mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids) if (aFluid != null) { - Collection tRecipes = mRecipeFluidMap.get(aFluid.getFluid()); - if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) - && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) - return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; - } - - // And nothing has been found. - return null; + setSpecialSlotSensitive(true); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java deleted file mode 100644 index 124b41cd2f..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.emt.recipe; - -import static com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler.AspectAdder; - -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; - -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; - -import com.github.bartimaeusnek.bartworks.util.BWRecipes; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; -import com.google.common.collect.ArrayListMultimap; - -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; -import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; - -@SuppressWarnings("ALL") -public class TCRecipeHandler { - - public static final GT_Recipe.GT_Recipe_Map alchemicalConstructHandler = new TCRecipeHandler.TCRecipeMap( - new HashSet<>(15000), - "bwcm.recipe.alchemicalConstruct", - "Industrical Alchemical Construct", - null, - "gregtech:textures/gui/basicmachines/Default", - 2, - 1, - 2, - 0, - 1, - "", - 1, - "", - true, - true); - static Class aCrucibleRecipeClass; - static Class aThaumcraftAPI; - static Field craftingRecipes; - static Field aCrucibleRecipeField; - static Field aCrucibleRecipeCatalyst; - static Field aspects; - static Field key; - - static { - try { - aCrucibleRecipeClass = Class.forName("thaumcraft.api.crafting.CrucibleRecipe"); - aThaumcraftAPI = Class.forName("thaumcraft.api.ThaumcraftApi"); - } catch (ClassNotFoundException e) { - e.printStackTrace(); - } - try { - aspects = aCrucibleRecipeClass.getField("aspects"); - - key = aCrucibleRecipeClass.getField("key"); - - aCrucibleRecipeField = aCrucibleRecipeClass.getDeclaredField("recipeOutput"); - aCrucibleRecipeField.setAccessible(true); - - aCrucibleRecipeCatalyst = aCrucibleRecipeClass.getField("catalyst"); - - craftingRecipes = aThaumcraftAPI.getDeclaredField("craftingRecipes"); - craftingRecipes.setAccessible(true); - } catch (NoSuchFieldException e) { - e.printStackTrace(); - } - } - - public static void init() throws IllegalAccessException, InvocationTargetException { - ArrayList tcCraftingList = (ArrayList) craftingRecipes.get(null); - HashSet crucibleRecipes = new HashSet(); - for (Object o : tcCraftingList) { - if (TCRecipeHandler.aCrucibleRecipeClass.isInstance(o)) crucibleRecipes.add(o); - } - TCRecipeHandler.convertCrucibleRecipesToGTRecipes(crucibleRecipes); - } - - public static void convertCrucibleRecipesToGTRecipes(HashSet crucibleRecipes) - throws IllegalAccessException, InvocationTargetException { - HashSet ret = new HashSet<>(); - ArrayListMultimap itemToCircuitConfigMap = ArrayListMultimap.create(); - ArrayListMultimap itemToAspectsMap = ArrayListMultimap.create(); - ArrayListMultimap itemToOutputMap = ArrayListMultimap.create(); - ArrayListMultimap itemToResearchMap = ArrayListMultimap.create(); - - for (Object o : crucibleRecipes) { - - String key = (String) TCRecipeHandler.key.get(o); - ItemStack out = (ItemStack) TCRecipeHandler.aCrucibleRecipeField.get(o); - Object aspects = TCRecipeHandler.aspects.get(o); - Object cat = TCRecipeHandler.aCrucibleRecipeCatalyst.get(o); - - if (cat instanceof ItemStack) { - itemToAspectsMap.put((ItemStack) cat, aspects); - itemToOutputMap.put((ItemStack) cat, out); - itemToResearchMap.put((ItemStack) cat, key); - } else if (cat instanceof String) { - for (ItemStack stack : OreDictionary.getOres((String) cat)) { - itemToAspectsMap.put(stack, aspects); - itemToOutputMap.put(stack, out); - itemToResearchMap.put(stack, key); - } - } else if (cat instanceof ArrayList && ((ArrayList) cat).size() > 0) { - for (ItemStack stack : ((ArrayList) cat)) { - itemToAspectsMap.put(stack, aspects); - itemToOutputMap.put(stack, out); - itemToResearchMap.put(stack, key); - } - } - } - for (ItemStack o : itemToAspectsMap.keySet()) { - if (o.getItemDamage() == Short.MAX_VALUE) itemToCircuitConfigMap.put(o, 24); - else for (int j = 1; j <= itemToAspectsMap.get(o).size(); j++) { - itemToCircuitConfigMap.put(o, j % 24); - } - - for (int j = 0; j < itemToAspectsMap.get(o).size(); j++) { - ret.add( - addRecipes( - itemToResearchMap.get(o).get(j), - itemToOutputMap.get(o).get(j), - itemToAspectsMap.get(o).get(j), - o, - itemToCircuitConfigMap.get(o).get(j))); - } - } - - for (GT_Recipe recipe : ret) { - TCRecipeHandler.alchemicalConstructHandler.add(recipe); - } - } - - public static GT_Recipe addRecipes(String key, ItemStack out, Object aspects, ItemStack cat, int config) - throws InvocationTargetException, IllegalAccessException { - - NBTTagCompound toWrite = new NBTTagCompound(); - ThaumcraftHandler.AspectAdder.writeAspectListToNBT.invoke(aspects, toWrite); - ItemStack fake = new ItemStack(Items.feather); - fake.setTagCompound(toWrite); - fake.setStackDisplayName(key); - GT_Recipe recipe = new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[] { cat, GT_Utility.getIntegratedCircuit(config) }, - new ItemStack[] { out }, - fake, - null, - null, - null, - 60, - 480, - 0); - return recipe; - } - - static class TCRecipeMap extends GT_Recipe.GT_Recipe_Map { - - public TCRecipeMap(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { - super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); - } - - @Override - public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, - ItemStack... aInputs) { - // No Recipes? Well, nothing to be found then. - if (mRecipeList.isEmpty()) return null; - - // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 - // Stack" or "at least 2 Stacks" before they start searching for Recipes. - // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in - // their Machines to select Sub Recipes. - if (GregTech_API.sPostloadFinished) { - if (this.mMinimalInputItems > 0) { - if (aInputs == null) return null; - int tAmount = 0; - for (ItemStack aInput : aInputs) if (aInput != null) tAmount++; - if (tAmount < this.mMinimalInputItems) return null; - } - } - - // Unification happens here in case the Input isn't already unificated. - if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs); - - // // Check the Recipe which has been used last time in order to not have to search for it again, - // if possible. - // if (aRecipe != null) - // if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, - // aDontCheckStackSizes, aFluids, aInputs)) { - // NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); - // NBTTagCompound givenNBT = ((ItemStack)aRecipe.mSpecialItems).getTagCompound(); - // Object aAspectListToCheck = null; - // Object aGivenAspectList = null; - // try { - // aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); - // aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); - // AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck,toCheckNBT); - // AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList,givenNBT); - // if - // (!TCRecipeHandler.TCRecipeMap.containsAspects(aAspectListToCheck,aGivenAspectList)) - // return null; - // } catch (InstantiationException | IllegalAccessException | InvocationTargetException - // e) { - // e.printStackTrace(); - // return null; - // } - // return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; - // } - - // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. - if (this.mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs) if (tStack != null) { - Collection tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack)); - if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { - NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); - NBTTagCompound givenNBT = ((ItemStack) aRecipe.mSpecialItems).getTagCompound(); - Object aAspectListToCheck = null; - Object aGivenAspectList = null; - try { - aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); - aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); - AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck, toCheckNBT); - AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList, givenNBT); - if (!TCRecipeHandler.TCRecipeMap.containsAspects(aAspectListToCheck, aGivenAspectList)) - continue; - } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { - e.printStackTrace(); - return null; - } - return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; - } - tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(GT_Values.W, tStack))); - if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) - && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) { - NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); - NBTTagCompound givenNBT = ((ItemStack) aRecipe.mSpecialItems).getTagCompound(); - Object aAspectListToCheck = null; - Object aGivenAspectList = null; - try { - aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); - aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); - AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck, toCheckNBT); - AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList, givenNBT); - if (!TCRecipeHandler.TCRecipeMap.containsAspects(aAspectListToCheck, aGivenAspectList)) - continue; - } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { - e.printStackTrace(); - return null; - } - return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; - } - } - // And nothing has been found. - return null; - } - - private static boolean containsAspects(Object aAspectListToCheck, Object aGivenAspectList) - throws InvocationTargetException, IllegalAccessException { - Object[] aspects = (Object[]) ThaumcraftHandler.AspectAdder.getAspects.invoke(aGivenAspectList); - for (int i = 0; i < aspects.length; i++) { - if ((int) ThaumcraftHandler.AspectAdder.getAmount.invoke(aAspectListToCheck, aspects[i]) - < (int) ThaumcraftHandler.AspectAdder.getAmount.invoke(aGivenAspectList, aspects[i])) - return false; - } - return true; - } - } -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java deleted file mode 100644 index 25fe6af637..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.emt.tileentities.multi; - -import static gregtech.api.enums.GT_Values.V; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; - -import com.github.bartimaeusnek.crossmod.emt.recipe.TCRecipeHandler; -import com.github.bartimaeusnek.crossmod.emt.util.EMTHandler; -import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; - -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; - -@SuppressWarnings("ALL") -public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlockBase { - - private List mEssentiaHatches = new ArrayList<>(); - - public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity.getClass().isInstance(EMTHandler.aEssentiaInputHatch)) - return this.addEssetiaHatchToList(aTileEntity, aBaseCasingIndex); - return super.addInputToMachineList(aTileEntity, aBaseCasingIndex); - } - - private boolean addEssetiaHatchToList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aTileEntity.getClass().isInstance(EMTHandler.aEssentiaInputHatch)) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEssentiaHatches.add(aMetaTileEntity); - } else { - return false; - } - } - } - - public GT_Industrial_Alchemic_Construct(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - private GT_Industrial_Alchemic_Construct(String aName) { - super(aName); - } - - @Override - public boolean isCorrectMachinePart(ItemStack itemStack) { - return true; - } - - @Override - public boolean checkRecipe(ItemStack itemStack) { - ItemStack stack = new ItemStack(Items.feather); - String owner = this.getBaseMetaTileEntity().getOwnerName(); - Object allAspects = null; - try { - allAspects = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); - for (Object o : this.mEssentiaHatches) { - Object aspectList = EMTHandler.aAspectField.get(o); - ThaumcraftHandler.AspectAdder.add.invoke(allAspects, aspectList); - } - NBTTagCompound toWrite = (NBTTagCompound) ThaumcraftHandler.AspectAdder.writeAspectListToNBT - .invoke(allAspects, new NBTTagCompound()); - stack.setTagCompound(toWrite); - } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) { - e.printStackTrace(); - return false; - } - ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - ItemStack outputItems = null; - - long tVoltage = this.getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(tVoltage), V.length - 1)); - GT_Recipe tRecipe = TCRecipeHandler.alchemicalConstructHandler - .findRecipe(this.getBaseMetaTileEntity(), null, false, false, V[tTier], null, stack, tInputs); - ItemStack helper = (ItemStack) tRecipe.mSpecialItems; - NBTTagCompound tagCompound = helper.getTagCompound(); - String research = tagCompound.getCompoundTag("display").getString("Name"); - Object aspectList = null; - try { - aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); - ThaumcraftHandler.AspectAdder.readAspectListFromNBT.invoke(aspectList, tagCompound); - } catch (IllegalAccessException | InvocationTargetException | InstantiationException e) { - e.printStackTrace(); - return false; - } - boolean complete = false; - try { - complete = (boolean) ThaumcraftHandler.AspectAdder.isResearchComplete.invoke(null, owner, research); - } catch (IllegalAccessException | InvocationTargetException e) { - e.printStackTrace(); - } - if (!complete) return false; - if (!tRecipe.isRecipeInputEqual(true, new FluidStack[0], tInputs)) return false; - LinkedHashMap list = null; - LinkedHashMap needed = null; - try { - list = (LinkedHashMap) ThaumcraftHandler.AspectAdder.linkedAspektList.get(allAspects); - needed = (LinkedHashMap) ThaumcraftHandler.AspectAdder.linkedAspektList.get(aspectList); - } catch (IllegalAccessException e) { - e.printStackTrace(); - return false; - } - assert list != null; - assert needed != null; - for (Map.Entry toTake : needed.entrySet()) { - list.replace(toTake.getKey(), list.get(toTake.getKey()) - toTake.getValue()); - } - this.addOutput(tRecipe.mOutputs[0]); - this.updateSlots(); - return true; - } - - @Override - public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return false; - } - - @Override - public int getMaxEfficiency(ItemStack itemStack) { - return 0; - } - - @Override - public int getPollutionPerTick(ItemStack itemStack) { - return 0; - } - - @Override - public int getDamageToComponent(ItemStack itemStack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack itemStack) { - return false; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_Industrial_Alchemic_Construct(mName); - } - - @Override - public String[] getDescription() { - return new String[0]; - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean b3, boolean b4) { - return new ITexture[0]; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java deleted file mode 100644 index afc42577fe..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.emt.util; - -import java.lang.reflect.Field; - -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; - -@SuppressWarnings("unchecked") -public class EMTHandler { - - public static Class aEssentiaInputHatch; - public static Field aAspectField; - - static { - try { - aEssentiaInputHatch = (Class) Class - .forName("emt.gthandler.common.implementations.EssentiaHatch"); - aAspectField = aEssentiaInputHatch.getDeclaredField("current"); - aAspectField.setAccessible(true); - } catch (ClassNotFoundException | NoSuchFieldException e) { - e.printStackTrace(); - } - } -} -- cgit From d17d3b8ebcaf7eccd7b8f3036f5161bf190690d6 Mon Sep 17 00:00:00 2001 From: Maxim Date: Mon, 17 Jul 2023 10:06:27 +0200 Subject: Implement generic processing logic (#340) * Migrated MegaMultiBlockBase to ExtendedPowerBase * Migrated MOC * Migrated MCR * Migrated MCR * Migrated MVF * Migrated MEBF * Migrated MDT * Use Energy.or(ExoticEnergy) instead of TTEnabledEnergyHatchElement * Set GPL power to be totalEU voltage at 1 ampere * Fix coil tier of MEBF * Migrated CAL * Migrated EIC * Migrated vat * Fixed MDT void protection * Clean up code * Updated dep * Updated deps * Update dependencies.gradle * Update dependencies.gradle * Update dependencies.gradle * Fix EIC power * Update src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java Co-authored-by: miozune * Update src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java Co-authored-by: miozune * Addressed reviews --------- Co-authored-by: Martin Robertz Co-authored-by: miozune Former-commit-id: 32ebaeb20cd9b9d1338d990b647c5f05b366116c --- dependencies.gradle | 4 +- .../github/bartimaeusnek/bartworks/MainMod.java | 4 + .../tileentities/multis/GT_TileEntity_BioVat.java | 163 ++++-------- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 95 +++---- .../multis/GT_TileEntity_CrackingDistillTower.java | 102 -------- .../GT_TileEntity_ElectricImplosionCompressor.java | 106 ++------ .../mega/GT_TileEntity_MegaBlastFurnace.java | 251 ++++-------------- .../mega/GT_TileEntity_MegaChemicalReactor.java | 152 ++--------- .../mega/GT_TileEntity_MegaDistillTower.java | 138 ++-------- .../mega/GT_TileEntity_MegaMultiBlockBase.java | 291 ++------------------- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 153 +++-------- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 117 +-------- .../bartworks/util/ResultWrongSievert.java | 86 ++++++ .../crossmod/tectech/TecTechEnabledMulti.java | 129 --------- .../crossmod/tectech/helper/IHasCoils.java | 23 -- .../crossmod/tectech/helper/TecTechUtils.java | 173 ------------ .../resources/assets/bartworks/lang/en_US.lang | 4 + 17 files changed, 390 insertions(+), 1601 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/ResultWrongSievert.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java diff --git a/dependencies.gradle b/dependencies.gradle index 1b95793bc2..08fd6ca730 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.122:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.127:dev') api("com.github.GTNewHorizons:TecTech:5.2.34:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.9:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" @@ -9,6 +9,6 @@ dependencies { api("com.github.GTNewHorizons:Avaritia:1.45:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.38-GTNH:dev") - compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.24:deobf") {transitive = false} + compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.24-pre:dev") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.12-GTNH:api") {transitive = false} } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index d656e9840f..cf88fe51bb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -61,6 +61,7 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; +import com.github.bartimaeusnek.bartworks.util.ResultWrongSievert; import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import cpw.mods.fml.common.FMLCommonHandler; @@ -75,6 +76,7 @@ import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.Mods; +import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -180,6 +182,8 @@ public final class MainMod { WerkstoffLoader.run(); LocalisationLoader.localiseAll(); + CheckRecipeResultRegistry.register(new ResultWrongSievert(0, ResultWrongSievert.NeededSievertType.EXACTLY)); + RadioHatchMaterialLoader.run(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index bb01ef8cce..b8a9bdecaa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -21,7 +21,6 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAn import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW; @@ -31,7 +30,6 @@ import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; -import java.util.List; import javax.annotation.Nullable; @@ -48,6 +46,8 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import org.jetbrains.annotations.NotNull; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -60,6 +60,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.BioCulture; import com.github.bartimaeusnek.bartworks.util.Coords; import com.github.bartimaeusnek.bartworks.util.MathUtils; +import com.github.bartimaeusnek.bartworks.util.ResultWrongSievert; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; @@ -69,13 +70,15 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.logic.ProcessingLogic; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.recipe.check.CheckRecipeResult; +import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBase { @@ -86,7 +89,6 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa private final HashSet playerMPHashSet = new HashSet<>(); private final ArrayList mRadHatches = new ArrayList<>(); private int height = 1; - private GT_Recipe mLastRecipe; private Fluid mFluid = FluidRegistry.LAVA; private BioCulture mCulture; private ItemStack mStack; @@ -168,14 +170,6 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa return ret; } - public boolean isLiquidInput(byte aSide) { - return false; - } - - public boolean isLiquidOutput(byte aSide) { - return false; - } - private int getInputCapacity() { return this.mInputHatches.stream().mapToInt(GT_MetaTileEntity_Hatch_Input::getCapacity).sum(); } @@ -230,115 +224,60 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa return MathUtils.clamp(1, ret, ConfigHandler.bioVatMaxParallelBonus); } - private List getItemInputs() { - ArrayList tInputList = this.getStoredInputs(); - int tInputList_sS = tInputList.size(); - for (int i = 0; i < tInputList_sS - 1; i++) { - for (int j = i + 1; j < tInputList_sS; j++) { - if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { - if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { - tInputList.remove(j--); - tInputList_sS = tInputList.size(); - } else { - tInputList.remove(i--); - tInputList_sS = tInputList.size(); - break; + @Override + protected ProcessingLogic createProcessingLogic() { + return new ProcessingLogic() { + + @NotNull + @Override + protected CheckRecipeResult validateRecipe(@NotNull GT_Recipe recipe) { + if (!BW_Util.areStacksEqualOrNull((ItemStack) recipe.mSpecialItems, getControllerSlot())) + return CheckRecipeResultRegistry.NO_RECIPE; + int[] conditions = GT_TileEntity_BioVat.specialValueUnpack(recipe.mSpecialValue); + mNeededSievert = conditions[3]; + + if (mGlassTier < conditions[0]) { + return CheckRecipeResultRegistry.insufficientMachineTier(conditions[0]); + } + + if (conditions[2] == 0) { + if (mSievert < mNeededSievert) { + return ResultWrongSievert.insufficientSievert(mNeededSievert); + } + } else { + if (mSievert != conditions[3]) { + return ResultWrongSievert.wrongSievert(conditions[3]); } } + + return CheckRecipeResultRegistry.SUCCESSFUL; } - } - return tInputList; - } - - private List getFluidInputs() { - ArrayList tFluidList = this.getStoredFluids(); - int tFluidList_sS = tFluidList.size(); - for (int i = 0; i < tFluidList_sS - 1; i++) { - for (int j = i + 1; j < tFluidList_sS; j++) { - if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { - if (tFluidList.get(i).amount >= tFluidList.get(j).amount) { - tFluidList.remove(j--); - tFluidList_sS = tFluidList.size(); - } else { - tFluidList.remove(i--); - tFluidList_sS = tFluidList.size(); - break; + + @NotNull + @Override + public CheckRecipeResult process() { + CheckRecipeResult result = super.process(); + if (!result.wasSuccessful()) { + return result; + } + // We already made sure the recipe runs. Now the vat looks for as many "parallels" as it can do + mExpectedMultiplier = getExpectedMultiplier(lastRecipe.getFluidOutput(0), true); + mTimes = 1; + for (int i = 1; i < mExpectedMultiplier; i++) { + if (depleteInput(lastRecipe.mFluidInputs[0])) { + mTimes++; } } + this.outputFluids[0].amount *= mTimes; + return result; } - } - return tFluidList; + }; } @Override - public boolean checkRecipe(ItemStack itemStack) { - GT_Recipe.GT_Recipe_Map gtRecipeMap = this.getRecipeMap(); - - if (gtRecipeMap == null) return false; - - ItemStack[] tInputs = getItemInputs().toArray(new ItemStack[0]); - FluidStack[] tFluids = getFluidInputs().toArray(new FluidStack[0]); - - if (tFluids.length <= 0) return false; - - long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - long tEnergy = V[tTier]; - - GT_Recipe gtRecipe = gtRecipeMap.findRecipe( - this.getBaseMetaTileEntity(), - this.mLastRecipe, - false, - tEnergy, - tFluids, - itemStack, - tInputs); - - if (gtRecipe == null) return false; - - assert gtRecipe.mFluidInputs.length == 1; - assert gtRecipe.mFluidOutputs.length == 1; - - if (!BW_Util.areStacksEqualOrNull((ItemStack) gtRecipe.mSpecialItems, itemStack)) return false; - - int[] conditions = GT_TileEntity_BioVat.specialValueUnpack(gtRecipe.mSpecialValue); - - this.mNeededSievert = conditions[3]; - - if (conditions[2] == 0 ? (this.mSievert < this.mNeededSievert || this.mGlassTier < conditions[0]) - : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0])) - return false; - - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - - if (!canOutputAll(gtRecipe)) return false; - if (!gtRecipe.isRecipeInputEqual(true, tFluids, tInputs)) return false; - - final FluidStack recipeFluidOutput = gtRecipe.getFluidOutput(0); - final FluidStack recipeFluidInput = gtRecipe.mFluidInputs[0]; - - this.mExpectedMultiplier = this.getExpectedMultiplier(recipeFluidOutput, true); - - this.mTimes = 1; - for (int i = 1; i < this.mExpectedMultiplier; i++) { - if (this.depleteInput(recipeFluidInput)) { - this.mTimes++; - } - } - - this.mOutputFluids = new FluidStack[] { - new FluidStack(recipeFluidOutput, recipeFluidOutput.amount * this.mTimes) }; - - BW_Util.calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, tEnergy, this); - - if (this.mEUt > 0) this.mEUt = -this.mEUt; - this.mProgresstime = 0; - - if (gtRecipe.mCanBeBuffered) this.mLastRecipe = gtRecipe; - - this.updateSlots(); - return true; + protected void setupProcessingLogic(ProcessingLogic logic) { + super.setupProcessingLogic(logic); + logic.setSpecialSlotItem(getControllerSlot()); } public FluidStack getStoredFluidOutputs() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index c64ae704ca..e46199d654 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -30,8 +30,6 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; import java.util.List; import net.minecraft.entity.player.EntityPlayerMP; @@ -43,11 +41,12 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import org.jetbrains.annotations.NotNull; + import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; @@ -57,14 +56,18 @@ import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import gregtech.api.GregTech_API; +import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.logic.ProcessingLogic; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.recipe.check.CheckRecipeResult; +import gregtech.api.recipe.check.SimpleCheckRecipeResult; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; @@ -82,6 +85,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends private static final String STRUCTURE_PIECE_NEXT = "next"; private String imprintedItemName; + private ItemStack imprintedStack; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition .builder() @@ -148,7 +152,6 @@ public class GT_TileEntity_CircuitAssemblyLine extends } private NBTTagCompound type = new NBTTagCompound(); - private GT_Recipe bufferedRecipe; public GT_TileEntity_CircuitAssemblyLine(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -204,64 +207,38 @@ public class GT_TileEntity_CircuitAssemblyLine extends super.saveNBTData(aNBT); } - private final Collection GT_RECIPE_COLLECTION = new HashSet<>(); - @Override - public boolean checkRecipe(ItemStack itemStack) { - if (this.type.equals(new NBTTagCompound())) if (!this.imprintMachine(itemStack)) return false; - - if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual( - true, - false, - BW_Util.getFluidsFromInputHatches(this), - getStoredInputs().toArray(new ItemStack[0]))) { - setRecipeStats(); - return true; - } - - ItemStack stack = ItemStack.loadItemStackFromNBT(this.type); - imprintedItemName = GT_LanguageManager.getTranslateableItemStackName(stack); + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return BWRecipes.instance.getMappingsFor((byte) 3); + } - if (stack == null) return false; + @Override + protected ProcessingLogic createProcessingLogic() { + return new ProcessingLogic().enablePerfectOverclock(); + } - if (this.GT_RECIPE_COLLECTION.isEmpty()) { - for (GT_Recipe recipe : BWRecipes.instance.getMappingsFor((byte) 3).mRecipeList) { - if (GT_Utility.areStacksEqual(recipe.mOutputs[0], stack, true)) { - this.GT_RECIPE_COLLECTION.add(recipe); - } - } + @NotNull + @Override + public CheckRecipeResult checkProcessing() { + if (this.type.equals(new NBTTagCompound()) && !this.imprintMachine(getControllerSlot())) + return SimpleCheckRecipeResult.ofFailure("no_imprint"); + if (imprintedItemName == null || imprintedStack == null) { + imprintedStack = new ItemStack(BW_Meta_Items.getNEWCIRCUITS(), 1, 0); + imprintedStack.setTagCompound(type); + imprintedItemName = GT_LanguageManager.getTranslateableItemStackName(imprintedStack); } + return super.checkProcessing(); + } - for (GT_Recipe recipe : this.GT_RECIPE_COLLECTION) { - if (!canOutputAll(recipe)) return false; - if (recipe.isRecipeInputEqual( - true, - false, - BW_Util.getFluidsFromInputHatches(this), - getStoredInputs().toArray(new ItemStack[0]))) - this.bufferedRecipe = recipe; - else continue; - - this.setRecipeStats(); - return true; - } - return false; + @Override + protected void setupProcessingLogic(ProcessingLogic logic) { + super.setupProcessingLogic(logic); + logic.setSpecialSlotItem(imprintedStack); } - private void setRecipeStats() { - calculatePerfectOverclockedNessMulti( - this.bufferedRecipe.mEUt, - this.bufferedRecipe.mDuration, - 1, - this.getMaxInputVoltage()); - if (this.mEUt > 0) this.mEUt = -this.mEUt; - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = this.bufferedRecipe.mOutputs; - this.mOutputFluids = this.bufferedRecipe.mFluidOutputs; - sendLoopStart((byte) 20); - this.updateSlots(); + @Override + protected SoundResource getProcessStartSound() { + return SoundResource.IC2_MACHINES_MAGNETIZER_LOOP; } @Override @@ -444,6 +421,11 @@ public class GT_TileEntity_CircuitAssemblyLine extends return true; } + @Override + public boolean supportsBatchMode() { + return true; + } + @Override public boolean isRecipeLockingEnabled() { return imprintedItemName != null && !imprintedItemName.equals(""); @@ -466,7 +448,6 @@ public class GT_TileEntity_CircuitAssemblyLine extends int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); String imprintedWith = getTypeForDisplay(); - if (imprintedWith != "") tag.setString("ImprintedWith", imprintedWith); - + if (!imprintedWith.isEmpty()) tag.setString("ImprintedWith", imprintedWith); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java deleted file mode 100644 index 2f14088a3d..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.tileentities.multis; - -import java.util.ArrayList; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - -import com.github.bartimaeusnek.bartworks.util.BWRecipes; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.MathUtils; - -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DistillationTower; - -public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_DistillationTower { - - public GT_TileEntity_CrackingDistillTower(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public GT_TileEntity_CrackingDistillTower(String aName) { - super(aName); - } - - @Override - public boolean checkRecipe(ItemStack itemStack) { - if (!GT_Utility.areStacksEqual(itemStack, GT_Utility.getIntegratedCircuit(0), true)) return false; - else { - FluidStack[] array = new FluidStack[0]; - ArrayList fluidInputs = new ArrayList<>(); - for (GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches) { - if (hatch != null) { - fluidInputs.add(hatch.getFluid()); - } - } - array = fluidInputs.toArray(array); - GT_Recipe.GT_Recipe_Map rMapCracking = GT_Recipe.GT_Recipe_Map.sCrakingRecipes; - GT_Recipe.GT_Recipe_Map rMapDistillTower = GT_Recipe.GT_Recipe_Map.sDistillationRecipes; - GT_Recipe recipeCracking = rMapCracking - .findRecipe(this.getBaseMetaTileEntity(), false, this.getMaxInputVoltage(), array, itemStack); - if (recipeCracking == null) return false; - GT_Recipe recipeDistill = rMapDistillTower.findRecipe( - this.getBaseMetaTileEntity(), - false, - this.getMaxInputVoltage(), - recipeCracking.mFluidOutputs); - if (recipeDistill == null) return false; - float ratio = (float) recipeCracking.mFluidOutputs[0].amount / (float) recipeDistill.mFluidInputs[0].amount; - FluidStack[] nuoutputs = new FluidStack[recipeDistill.mFluidOutputs.length]; - for (int i = 0; i < nuoutputs.length; i++) { - nuoutputs[i] = recipeDistill.mFluidOutputs[i]; - nuoutputs[i].amount = MathUtils.floorInt(recipeDistill.mFluidOutputs[i].amount * ratio); - } - BWRecipes.DynamicGTRecipe combined = new BWRecipes.DynamicGTRecipe( - true, - null, - recipeDistill.mOutputs, - null, - recipeDistill.mChances, - recipeCracking.mFluidInputs, - nuoutputs, - (MathUtils.floorInt(recipeDistill.mDuration * ratio)) + recipeCracking.mDuration, - Math.max((MathUtils.floorInt(recipeDistill.mEUt * ratio)), recipeCracking.mEUt), - 0); - if (combined.isRecipeInputEqual(true, array)) { - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - BW_Util.calculateOverclockedNessMulti( - combined.mEUt, - combined.mDuration, - 1, - this.getMaxInputVoltage(), - this); - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputFluids = combined.mFluidOutputs.clone(); - this.mOutputItems = combined.mOutputs.clone(); - this.updateSlots(); - return true; - } - } - return false; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index b09d512fff..2466ff6c53 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -18,7 +18,6 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTI import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; @@ -27,16 +26,14 @@ import java.util.List; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.tuple.Pair; +import org.jetbrains.annotations.NotNull; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.renderer.BW_EICPistonVisualizer; @@ -64,6 +61,7 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.logic.ProcessingLogic; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_ExtendedPowerMultiBlockBase; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.render.TextureFactory; @@ -138,9 +136,7 @@ public class GT_TileEntity_ElectricImplosionCompressor if (te.piston) { Block candidate = world.getBlock(x, y, z); int candidateMeta = world.getBlockMetadata(x, y, z); - if (getTierOfBlock(candidate, candidateMeta) == -1) { - return false; - } + return getTierOfBlock(candidate, candidateMeta) != -1; } return true; } @@ -190,7 +186,6 @@ public class GT_TileEntity_ElectricImplosionCompressor add(Pair.of(GregTech_API.sBlockMetal9, 8)); } - ; }; } @@ -260,67 +255,31 @@ public class GT_TileEntity_ElectricImplosionCompressor } @Override - public boolean checkRecipe(ItemStack aStack) { - lEUt = 0; - mOutputItems = null; - mOutputFluids = null; - long tTotalEU = getMaxInputEu(); - - // Only allow up to one tier skip - byte tTier = (byte) (mMaxHatchTier + 1); - - ItemStack[] tItemInputs = getStoredInputs().toArray(new ItemStack[0]); - FluidStack[] tFluidInputs = getStoredFluids().toArray(new FluidStack[0]); - - if ((tItemInputs.length > 0) || (tFluidInputs.length > 0)) { - GT_Recipe tRecipe = eicMap.findRecipe(getBaseMetaTileEntity(), false, V[tTier], tFluidInputs, tItemInputs); - if (tRecipe == null) { - return false; - } - - int tCurrentMaxParallel = 1; - if (mBlockTier > 1) { - tCurrentMaxParallel = (int) Math.pow(4, Math.max(mBlockTier - 1, 0)); - } - - GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(tItemInputs) - .setFluidInputs(tFluidInputs).setAvailableEUt(tTotalEU).setMaxParallel(tCurrentMaxParallel) - .enableConsumption().enableOutputCalculation().setController(this); - - if (batchMode) { - helper.enableBatchMode(128); - } - - helper.build(); - - if (helper.getCurrentParallel() == 0) { - return false; - } - - GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt).setEUt(tTotalEU) - .setDuration(tRecipe.mDuration) - .setParallel((int) Math.floor(helper.getCurrentParallel() / helper.getDurationMultiplier())) - .calculate(); - - lEUt = -calculator.getConsumption(); - mMaxProgresstime = (int) Math.ceil(calculator.getDuration() * helper.getDurationMultiplier()); - - this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; - this.mEfficiencyIncrease = 10000; + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return eicMap; + } - // In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && lEUt == Long.MAX_VALUE - 1) return false; - if (this.lEUt > 0) { - this.lEUt = -this.lEUt; + @Override + protected ProcessingLogic createProcessingLogic() { + return new ProcessingLogic() { + + @NotNull + @Override + protected GT_OverclockCalculator createOverclockCalculator(@NotNull GT_Recipe recipe, + @NotNull GT_ParallelHelper helper) { + // For overclocking we'll allow all power to be used + return super.createOverclockCalculator(recipe, helper).setEUt(getMaxInputEu()).setAmperage(1); } + }.setMaxParallelSupplier(() -> (int) Math.pow(4, Math.max(mBlockTier - 1, 0))); + } - this.mOutputItems = helper.getItemOutputs(); - this.mOutputFluids = helper.getFluidOutputs(); - - this.updateSlots(); - return true; - } - return false; + @Override + protected void setProcessingLogicPower(ProcessingLogic logic) { + long amperage = getMaxInputAmps(); + long voltage = getAverageInputVoltage(); + // We allow one OC, if there is enough amperage, no matter which type of hatch is used + logic.setAvailableVoltage(amperage >= 4 ? voltage * 4 : voltage); + logic.setAvailableAmperage(amperage >= 4 ? amperage / 4 : amperage); } private void updateChunkCoordinates() { @@ -520,21 +479,6 @@ public class GT_TileEntity_ElectricImplosionCompressor return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 1, 6, 0, elementBudget, env, false, true); } - public boolean onWireCutterRightClick(ForgeDirection side, byte aWrenchingSide, EntityPlayer aPlayer, float aX, - float aY, float aZ) { - if (aPlayer.isSneaking()) { - batchMode = !batchMode; - if (batchMode) { - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); - } else { - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); - } - return true; - } - - return false; - } - @Override public boolean supportsBatchMode() { return true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 3003a1141b..4ef6a5f7d1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -14,18 +14,9 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static com.gtnewhorizon.structurelib.structure.StructureUtility.withChannel; -import static gregtech.api.enums.GT_HatchElement.InputBus; -import static gregtech.api.enums.GT_HatchElement.InputHatch; -import static gregtech.api.enums.GT_HatchElement.Maintenance; -import static gregtech.api.enums.GT_HatchElement.Muffler; -import static gregtech.api.enums.GT_HatchElement.OutputBus; -import static gregtech.api.enums.GT_HatchElement.OutputHatch; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Mods.TecTech; +import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW; @@ -36,10 +27,8 @@ import static gregtech.api.util.GT_StructureUtility.ofCoil; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; + +import javax.annotation.Nonnull; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -53,38 +42,31 @@ import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.Pair; -import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.Materials; -import gregtech.api.enums.Mods; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.logic.ProcessingLogic; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.recipe.check.CheckRecipeResult; +import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OverclockCalculator; +import gregtech.api.util.GT_ParallelHelper; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -@Optional.Interface( - iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", - modid = Mods.Names.TECTECH, - striprefs = true) public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { @@ -115,18 +97,12 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock (byte) 0, (byte) 1, Byte.MAX_VALUE, - (te, t) -> te.glasTier = t, - te -> te.glasTier))) + (te, t) -> te.glassTier = t, + te -> te.glassTier))) .addElement( 'b', buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) - .atLeast( - InputHatch, - OutputHatch, - InputBus, - OutputBus, - Maintenance, - TTEnabledEnergyHatchElement.INSTANCE) + .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, Energy.or(ExoticEnergy)) .casingIndex(CASING_INDEX).dot(1).buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX)) .build(); @@ -173,9 +149,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock protected final FluidStack[] pollutionFluidStacks = { Materials.CarbonDioxide.getGas(1000), Materials.CarbonMonoxide.getGas(1000), Materials.SulfurDioxide.getGas(1000) }; private int mHeatingCapacity; - private byte glasTier; - private int polPtick = ConfigHandler.basePollutionMBFSecond / 20 * ConfigHandler.megaMachinesMax; - private int mufflerTier = -1; + private byte glassTier; + private final static int polPtick = ConfigHandler.basePollutionMBFSecond / 20 * ConfigHandler.megaMachinesMax; public GT_TileEntity_MegaBlastFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -201,7 +176,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock "For each perfect overclock the EBF will reduce recipe time 4 times (instead of 2) (100% efficiency)") .addInfo("Additionally gives +100K for every tier past MV") .addPollutionAmount(20 * getPollutionPerTick(null)).addSeparator().beginStructureBlock(15, 20, 15, true) - .addController("3rd layer center").addCasingInfo("Heat Proof Machine Casing", 0) + .addController("3rd layer center").addCasingInfoRange("Heat Proof Machine Casing", 0, 279, false) .addOtherStructurePart("864x Heating Coils", "Inner 13x18x13 (Hollow)") .addOtherStructurePart("1007x Borosilicate Glass", "Outer 15x18x15") .addStructureInfo("The glass tier limits the Energy Input tier") @@ -219,8 +194,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - this.circuitMode = aNBT.getByte("circuitMode"); - this.glasTier = aNBT.getByte("glasTier"); + this.glassTier = aNBT.getByte("glasTier"); if (!aNBT.hasKey(INPUT_SEPARATION_NBT_KEY)) { inputSeparation = aNBT.getBoolean("isBussesSeparate"); } @@ -229,23 +203,6 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock } } - private byte circuitMode = 0; - - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (aPlayer.isSneaking()) { - --circuitMode; - if (circuitMode < 0) circuitMode = 24; - } else { - ++circuitMode; - if (circuitMode > 24) circuitMode = 0; - } - - GT_Utility.sendChatToPlayer( - aPlayer, - circuitMode > 0 ? "MEBF will prioritise circuit: " + circuitMode : "Circuit prioritisation disabled."); - } - @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { @@ -285,13 +242,12 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setByte("glasTier", glasTier); - aNBT.setByte("circuitMode", circuitMode); + aNBT.setByte("glasTier", glassTier); } @Override public int getPollutionPerTick(ItemStack aStack) { - return this.polPtick; + return polPtick; } public boolean addOutputHatchToTopList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { @@ -305,13 +261,6 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock return false; } - protected boolean addBottomHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - return addMaintenanceToMachineList(aTileEntity, aBaseCasingIndex) - || addInputToMachineList(aTileEntity, aBaseCasingIndex) - || addOutputToMachineList(aTileEntity, aBaseCasingIndex) - || addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); - } - @Override protected String[] getExtendedInfoData() { return new String[] { StatCollector.translateToLocal("GT5U.EBF.heat") + ": " @@ -322,118 +271,24 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock } @Override - public boolean checkRecipe(ItemStack itemStack) { - ItemStack[] tInputs = null; - FluidStack[] tFluids = this.getStoredFluids().toArray(new FluidStack[0]); - long nominalV = TecTech.isModLoaded() ? TecTechUtils.getnominalVoltageTT(this) - : BW_Util.getnominalVoltage(this); - - byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); - GT_Recipe tRecipe = null; - - if (inputSeparation) { - for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) { - ArrayList tInputList = new ArrayList<>(); - tBus.mRecipeMap = getRecipeMap(); - - if (isValidMetaTileEntity(tBus)) { - for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) { - if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null) { - tInputList.add(tBus.getBaseMetaTileEntity().getStackInSlot(i)); - } - } - } - tInputs = Arrays - .copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, tInputList.size()); - tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe( - this.getBaseMetaTileEntity(), - false, - gregtech.api.enums.GT_Values.V[tTier], - tFluids, - tInputs); - if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(false, tFluids, tInputs))) { - break; - } - } - } else { - tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - if (circuitMode > 0 && Arrays.stream(tInputs) - .anyMatch(e -> GT_Utility.areStacksEqual(e, GT_Utility.getIntegratedCircuit(circuitMode), true))) { - List modInputs = Arrays.stream(tInputs).filter(Objects::nonNull) - .filter(e -> !e.getItem().equals(GT_Utility.getIntegratedCircuit(circuitMode).getItem())) - .collect(Collectors.toList()); - modInputs.add(GT_Utility.getIntegratedCircuit(circuitMode)); - tInputs = modInputs.toArray(new ItemStack[0]); + protected ProcessingLogic createProcessingLogic() { + return new ProcessingLogic() { + + @Nonnull + @Override + protected GT_OverclockCalculator createOverclockCalculator(@Nonnull GT_Recipe recipe, + @Nonnull GT_ParallelHelper helper) { + return new GT_OverclockCalculator().setRecipeEUt(recipe.mEUt).setDuration(recipe.mDuration) + .setEUt(availableVoltage).setRecipeHeat(recipe.mSpecialValue).setMultiHeat(mHeatingCapacity) + .enableHeatOC().enableHeatDiscount().calculate(); } - tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes - .findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); - if (tRecipe == null) { - if (circuitMode == 0) return false; - tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes - .findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); - } - } - - if (tRecipe == null) return false; - - ArrayList outputItems = new ArrayList<>(); - ArrayList outputFluids = new ArrayList<>(); - - boolean found_Recipe = false; - int processed = 0; - - int tHeatCapacityDivTiers = (this.mHeatingCapacity - tRecipe.mSpecialValue) / 900; - long precutRecipeVoltage = (long) (tRecipe.mEUt * Math.pow(0.95, tHeatCapacityDivTiers)); - - long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / precutRecipeVoltage); - if (batchMode && tMaxPara == ConfigHandler.megaMachinesMax) { - tMaxPara *= 128; - } - float tBatchMultiplier = 1.0f; - if (this.mHeatingCapacity >= tRecipe.mSpecialValue) { - int tCurrentPara = handleParallelRecipe(tRecipe, tFluids, tInputs, (int) tMaxPara); - tBatchMultiplier = batchMode ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) : 1.0f; - this.updateSlots(); - if (tCurrentPara <= 0) return false; - processed = Math.min(tCurrentPara, ConfigHandler.megaMachinesMax); - found_Recipe = true; - Pair, ArrayList> Outputs = getMultiOutput(tRecipe, tCurrentPara); - outputFluids = Outputs.getKey(); - outputItems = Outputs.getValue(); - } - if (found_Recipe) { - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - - GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt) - .setParallel(processed).setDuration(tRecipe.mDuration).setEUt(nominalV) - .setRecipeHeat(tRecipe.mSpecialValue).setMultiHeat(mHeatingCapacity).enableHeatOC() - .enableHeatDiscount().calculate(); - - this.mMaxProgresstime = calculator.getDuration(); - this.lEUt = calculator.getConsumption(); - - // In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) return false; - - if (this.lEUt > 0) this.lEUt = (-this.lEUt); - - if (batchMode) { - this.mMaxProgresstime = (int) Math.ceil(this.mMaxProgresstime * tBatchMultiplier); + @Override + protected @Nonnull CheckRecipeResult validateRecipe(@Nonnull GT_Recipe recipe) { + return recipe.mSpecialValue <= mHeatingCapacity ? CheckRecipeResultRegistry.SUCCESSFUL + : CheckRecipeResultRegistry.insufficientHeat(recipe.mSpecialValue); } - - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - - this.polPtick = ConfigHandler.basePollutionMBFSecond / 20 * processed; - this.mOutputItems = new ItemStack[outputItems.size()]; - this.mOutputItems = outputItems.toArray(this.mOutputItems); - this.mOutputFluids = new FluidStack[outputFluids.size()]; - this.mOutputFluids = outputFluids.toArray(this.mOutputFluids); - return true; - } - return false; + }.setMaxParallel(ConfigHandler.megaMachinesMax); } @Override @@ -455,7 +310,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { if (mMachine) return -1; int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); - glasTier = 0; + glassTier = 0; setCoilLevel(HeatingCoilLevel.None); return survivialBuildPiece("main", stackSize, 7, 17, 0, realBudget, source, actor, false, true); } @@ -497,14 +352,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - if (TecTech.isModLoaded()) { - this.getTecTechEnergyMultis().clear(); - this.getTecTechEnergyTunnels().clear(); - } - this.mHeatingCapacity = 0; - glasTier = 0; - mufflerTier = -1; + glassTier = 0; setCoilLevel(HeatingCoilLevel.None); @@ -516,29 +365,22 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock if (mMaintenanceHatches.size() != 1) return false; - if (TecTech.isModLoaded() && this.glasTier < 8) - if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) - || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) - return false; + if (glassTier < 8) { + for (GT_MetaTileEntity_Hatch hatch : mExoticEnergyHatches) { + if (hatch.getConnectionType() == GT_MetaTileEntity_Hatch.ConnectionType.LASER) { + return false; + } + if (glassTier < hatch.mTier) { + return false; + } + } + } - if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) - for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) - if (this.glasTier < hatchEnergy.mTier) return false; - long nominalV = TecTech.isModLoaded() ? TecTechUtils.getnominalVoltageTT(this) - : BW_Util.getnominalVoltage(this); - this.mHeatingCapacity = (int) getCoilLevel().getHeat() + 100 * (BW_Util.getTier(nominalV) - 2); + this.mHeatingCapacity = (int) getCoilLevel().getHeat() + 100 * (BW_Util.getTier(getMaxInputEu()) - 2); return true; } - @SuppressWarnings("rawtypes") - @Optional.Method(modid = Mods.Names.TECTECH) - private boolean areThingsNotProperlyTiered(Collection collection) { - if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) - if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; - return false; - } - @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sBlastRecipes; @@ -553,4 +395,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock public boolean supportsBatchMode() { return true; } + + @Override + public boolean supportsVoidProtection() { + return true; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index ddd716d661..52f5d55f23 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -14,18 +14,10 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.InputBus; -import static gregtech.api.enums.GT_HatchElement.InputHatch; -import static gregtech.api.enums.GT_HatchElement.Maintenance; -import static gregtech.api.enums.GT_HatchElement.OutputBus; -import static gregtech.api.enums.GT_HatchElement.OutputHatch; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Mods.TecTech; +import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW; @@ -33,49 +25,35 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICA import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import java.util.ArrayList; -import java.util.Collection; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.Pair; -import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; -import gregtech.api.enums.Mods; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.logic.ProcessingLogic; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_OverclockCalculator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -@Optional.Interface( - iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", - modid = Mods.Names.TECTECH, - striprefs = true) public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { - private byte glasTier; + private byte glassTier; public GT_TileEntity_MegaChemicalReactor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -126,12 +104,12 @@ public class GT_TileEntity_MegaChemicalReactor @Override public boolean supportsSingleRecipeLocking() { - return false; - } // TO IMPLEMENT + return true; + } @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes; } @Override @@ -158,74 +136,8 @@ public class GT_TileEntity_MegaChemicalReactor } @Override - public boolean checkRecipe(ItemStack itemStack) { - ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - FluidStack[] tInputFluids = this.getStoredFluids().toArray(new FluidStack[0]); - ArrayList outputItems = new ArrayList<>(); - ArrayList outputFluids = new ArrayList<>(); - - long nominalV = TecTech.isModLoaded() ? TecTechUtils.getnominalVoltageTT(this) - : BW_Util.getnominalVoltage(this); - - byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); - - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes - .findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); - boolean found_Recipe = false; - int processed = 0; - float tBatchMultiplier = 1.0f; - - if (tRecipe != null) { - found_Recipe = true; - long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); - if (batchMode && tMaxPara == ConfigHandler.megaMachinesMax) { - tMaxPara *= 128; - } - - int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); - tBatchMultiplier = batchMode ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) : 1.0f; - - this.updateSlots(); - if (tCurrentPara <= 0) { - return false; - } - processed = Math.min(tCurrentPara, ConfigHandler.megaMachinesMax); - Pair, ArrayList> Outputs = getMultiOutput(tRecipe, tCurrentPara); - outputFluids = Outputs.getKey(); - outputItems = Outputs.getValue(); - } - - if (found_Recipe) { - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - - GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt) - .setParallel(processed).setDuration(tRecipe.mDuration).setEUt(nominalV).enablePerfectOC() - .calculate(); - - this.mMaxProgresstime = calculator.getDuration(); - this.lEUt = calculator.getConsumption(); - - // In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) { - return false; - } - - if (batchMode) { - this.mMaxProgresstime = (int) Math.ceil(this.mMaxProgresstime * tBatchMultiplier); - } - - if (this.lEUt > 0) { - this.lEUt = (-this.lEUt); - } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = new ItemStack[outputItems.size()]; - this.mOutputItems = outputItems.toArray(this.mOutputItems); - this.mOutputFluids = new FluidStack[outputFluids.size()]; - this.mOutputFluids = outputFluids.toArray(this.mOutputFluids); - return true; - } - return false; + protected ProcessingLogic createProcessingLogic() { + return new ProcessingLogic().enablePerfectOverclock().setMaxParallel(ConfigHandler.megaMachinesMax); } @Override @@ -243,24 +155,22 @@ public class GT_TileEntity_MegaChemicalReactor @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - glasTier = 0; - if (TecTech.isModLoaded()) { - this.getTecTechEnergyMultis().clear(); - this.getTecTechEnergyTunnels().clear(); - } + glassTier = 0; if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 0)) return false; if (mMaintenanceHatches.size() != 1) return false; - if (TecTech.isModLoaded() && this.glasTier < 8) - if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) - || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) - return false; - - if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) - for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) - if (this.glasTier < hatchEnergy.mTier) return false; + if (glassTier < 8) { + for (GT_MetaTileEntity_Hatch hatch : mExoticEnergyHatches) { + if (hatch.getConnectionType() == GT_MetaTileEntity_Hatch.ConnectionType.LASER) { + return false; + } + if (glassTier < hatch.mTier) { + return false; + } + } + } return true; } @@ -289,9 +199,8 @@ public class GT_TileEntity_MegaChemicalReactor .addElement('r', Maintenance.newAny(CASING_INDEX, 2)) .addElement( 'e', - ofChain( - TTEnabledEnergyHatchElement.INSTANCE.newAny(CASING_INDEX, 3), - ofBlock(GregTech_API.sBlockCasings8, 0))) + buildHatchAdder(GT_TileEntity_MegaChemicalReactor.class).atLeast(Energy.or(ExoticEnergy)) + .casingIndex(CASING_INDEX).dot(3).buildAndChain(GregTech_API.sBlockCasings8, 0)) .addElement('c', ofChain(ofBlock(GregTech_API.sBlockCasings4, 7), ofBlock(GregTech_API.sBlockCasings5, 13))) .addElement( 'g', @@ -299,8 +208,8 @@ public class GT_TileEntity_MegaChemicalReactor (byte) 0, (byte) 1, Byte.MAX_VALUE, - (te, t) -> te.glasTier = t, - te -> te.glasTier)) + (te, t) -> te.glassTier = t, + te -> te.glassTier)) .build(); @Override @@ -308,16 +217,13 @@ public class GT_TileEntity_MegaChemicalReactor return STRUCTURE_DEFINITION; } - @SuppressWarnings("rawtypes") - @Optional.Method(modid = Mods.Names.TECTECH) - private boolean areThingsNotProperlyTiered(Collection collection) { - if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) - if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; - return false; + @Override + public boolean supportsBatchMode() { + return true; } @Override - public boolean supportsBatchMode() { + public boolean supportsVoidProtection() { return true; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index c7f1bc2380..913d706c50 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -14,18 +14,10 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.InputBus; -import static gregtech.api.enums.GT_HatchElement.InputHatch; -import static gregtech.api.enums.GT_HatchElement.Maintenance; -import static gregtech.api.enums.GT_HatchElement.OutputBus; -import static gregtech.api.enums.GT_HatchElement.OutputHatch; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Mods.TecTech; +import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW; @@ -45,35 +37,26 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.Pair; -import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElementCheckOnly; import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Mods; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.fluid.IFluidStore; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.logic.ProcessingLogic; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_OverclockCalculator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -@Optional.Interface( - iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", - modid = Mods.Names.TECTECH, - striprefs = true) public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { @@ -151,22 +134,20 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock .addElement('=', StructureElementAirNoHint.getInstance()) .addElement( 'b', - buildHatchAdder(GT_TileEntity_MegaDistillTower.class) - .atLeast( - InputHatch, - OutputHatch, - InputBus, - OutputBus, - Maintenance, - TTEnabledEnergyHatchElement.INSTANCE) - .casingIndex(CASING_INDEX).dot(1).buildAndChain( + buildHatchAdder(GT_TileEntity_MegaDistillTower.class).atLeast( + InputHatch, + OutputHatch, + InputBus, + OutputBus, + Maintenance, + Energy.or(ExoticEnergy)).casingIndex(CASING_INDEX).dot(1).buildAndChain( onElementPass( GT_TileEntity_MegaDistillTower::onCasingFound, ofBlock(GregTech_API.sBlockCasings4, 1)))) .addElement( 'l', buildHatchAdder(GT_TileEntity_MegaDistillTower.class) - .atLeast(layeredOutputHatch, Maintenance, TTEnabledEnergyHatchElement.INSTANCE) + .atLeast(layeredOutputHatch, Maintenance, Energy.or(ExoticEnergy)) .casingIndex(CASING_INDEX).dot(1).buildAndChain( onElementPass( GT_TileEntity_MegaDistillTower::onCasingFound, @@ -295,10 +276,6 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - if (TecTech.isModLoaded()) { - this.getTecTechEnergyMultis().clear(); - this.getTecTechEnergyTunnels().clear(); - } // reset mOutputHatchesByLayer.forEach(List::clear); mHeight = 1; @@ -403,87 +380,8 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } @Override - public boolean checkRecipe(ItemStack aStack) { - - ItemStack[] tItems = getCompactedInputs(); - - ArrayList tFluidList = this.getStoredFluids(); - - for (int i = 0; i < tFluidList.size() - 1; ++i) { - for (int j = i + 1; j < tFluidList.size(); ++j) { - if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { - if (tFluidList.get(i).amount < tFluidList.get(j).amount) { - tFluidList.remove(i--); - break; - } - tFluidList.remove(j--); - } - } - } - - long nominalV = TecTech.isModLoaded() ? TecTechUtils.getnominalVoltageTT(this) - : BW_Util.getnominalVoltage(this); - byte tTier = (byte) Math.max(0, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); - - FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); - if (tFluids.length > 0) { - for (FluidStack tFluid : tFluids) { - ArrayList outputFluids = new ArrayList<>(); - ArrayList outputItems = new ArrayList<>(); - Pair, ArrayList> Outputs; - int processed = 0; - boolean found_Recipe = false; - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe( - this.getBaseMetaTileEntity(), - false, - GT_Values.V[tTier], - new FluidStack[] { tFluid }, - tItems); - float tBatchMultiplier = 1.0f; - if (tRecipe != null) { - found_Recipe = true; - long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); - if (batchMode && tMaxPara == ConfigHandler.megaMachinesMax) { - tMaxPara *= 128; - } - int tCurrentPara = handleParallelRecipe(tRecipe, new FluidStack[] { tFluid }, null, (int) tMaxPara); - tBatchMultiplier = batchMode ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) - : 1.0f; - this.updateSlots(); - processed = Math.min(tCurrentPara, ConfigHandler.megaMachinesMax); - Outputs = getMultiOutput(tRecipe, tCurrentPara); - outputFluids = Outputs.getKey(); - outputItems = Outputs.getValue(); - } - - if (!found_Recipe) continue; - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - - GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt) - .setParallel(processed).setDuration(tRecipe.mDuration).setEUt(nominalV).calculate(); - - this.mMaxProgresstime = calculator.getDuration(); - this.lEUt = calculator.getConsumption(); - - // In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) return false; - if (this.lEUt > 0) { - this.lEUt = (-this.lEUt); - } - - if (batchMode) { - this.mMaxProgresstime = (int) Math.ceil(this.mMaxProgresstime * tBatchMultiplier); - } - - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputFluids = outputFluids.toArray(new FluidStack[0]); - if (!outputItems.isEmpty()) this.mOutputItems = outputItems.toArray(new ItemStack[0]); - else this.mOutputItems = null; - return true; - } - } - return false; + protected ProcessingLogic createProcessingLogic() { + return new ProcessingLogic().setMaxParallel(ConfigHandler.megaMachinesMax); } @Override @@ -495,8 +393,18 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } } + @Override + public List getFluidOutputSlots(FluidStack[] toOutput) { + return this.getFluidOutputSlotsByLayer(toOutput, mOutputHatchesByLayer); + } + @Override public boolean supportsBatchMode() { return true; } + + @Override + public boolean supportsVoidProtection() { + return true; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java index eb396caae7..8850df1d3b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java @@ -1,13 +1,6 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; -import static gregtech.api.enums.GT_HatchElement.Energy; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Mods.TecTech; - -import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; -import java.util.List; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -18,35 +11,20 @@ import net.minecraft.world.World; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.MegaUtils; -import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; -import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; -import com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered.LowPowerLaser; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; -import com.google.common.collect.ImmutableList; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.structure.AutoPlaceEnvironment; import com.gtnewhorizon.structurelib.structure.IStructureElement; -import cpw.mods.fml.common.Optional; -import gregtech.api.enums.Mods; -import gregtech.api.interfaces.IHatchElement; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.logic.ProcessingLogic; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_ExtendedPowerMultiBlockBase; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Utility; -import gregtech.api.util.IGT_HatchAdder; -@Optional.Interface( - iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", - modid = Mods.Names.TECTECH, - striprefs = true) public abstract class GT_TileEntity_MegaMultiBlockBase> - extends GT_MetaTileEntity_EnhancedMultiBlockBase implements TecTechEnabledMulti { + extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase { protected GT_TileEntity_MegaMultiBlockBase(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -56,94 +34,32 @@ public abstract class GT_TileEntity_MegaMultiBlockBase TTTunnels = new ArrayList<>(); - public ArrayList TTMultiAmp = new ArrayList<>(); - @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - this.lEUt = aNBT.getLong("lEUt"); - } - - @Override - public void clearHatches() { - super.clearHatches(); - this.energyTier = -1; - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setLong("lEUt", lEUt); - } - - @SuppressWarnings("rawtypes") - @Optional.Method(modid = Mods.Names.TECTECH) - boolean areLazorsLowPowa() { - Collection collection = this.getTecTechEnergyTunnels(); - if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) - if (!(tecTechEnergyMulti instanceof LowPowerLaser)) return false; - return true; - } - - @Override - @Optional.Method(modid = Mods.Names.TECTECH) - public List getVanillaEnergyHatches() { - return this.mEnergyHatches; - } - - @Override - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Optional.Method(modid = Mods.Names.TECTECH) - public List getTecTechEnergyTunnels() { - return TTTunnels; - } - - @Override - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Optional.Method(modid = Mods.Names.TECTECH) - public List getTecTechEnergyMultis() { - return TTMultiAmp; - } - - @Override - public boolean drainEnergyInput(long aEU) { - if (TecTech.isModLoaded()) return TecTechUtils.drainEnergyMEBFTecTech(this, aEU); - return MegaUtils.drainEnergyMegaVanilla(this, aEU); - } - - @Override - public long getMaxInputVoltage() { - if (TecTech.isModLoaded()) return TecTechUtils.getMaxInputVoltage(this); - return super.getMaxInputVoltage(); + // Migration code + if (aNBT.hasKey("lEUt")) { + this.lEUt = aNBT.getLong("lEUt"); + } } - @Deprecated - @Override - protected void calculateOverclockedNessMulti(int aEUt, int aDuration, int mAmperage, long maxInputVoltage) { - calculateOverclockedNessMultiInternal((long) aEUt, aDuration, maxInputVoltage, false); + protected String[] getExtendedInfoData() { + return new String[0]; } - @Deprecated - @Override - protected void calculatePerfectOverclockedNessMulti(int aEUt, int aDuration, int mAmperage, long maxInputVoltage) { - calculateOverclockedNessMultiInternal((long) aEUt, aDuration, maxInputVoltage, true); + protected long[] getCurrentInfoData() { + long storedEnergy = 0, maxEnergy = 0; + for (GT_MetaTileEntity_Hatch hatch : getExoticAndNormalEnergyHatchList()) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { + storedEnergy += hatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += hatch.getBaseMetaTileEntity().getEUCapacity(); + } + } + return new long[] { storedEnergy, maxEnergy }; } @Override public String[] getInfoData() { - return TecTech.isModLoaded() ? this.getInfoDataArray(this) : super.getInfoData(); - } - - protected String[] getExtendedInfoData() { - return new String[0]; - } - - @Override - public String[] getInfoDataArray(GT_MetaTileEntity_MultiBlockBase multiBlockBase) { int mPollutionReduction = 0; for (GT_MetaTileEntity_Hatch_Muffler tHatch : this.mMufflerHatches) { @@ -163,8 +79,7 @@ public abstract class GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { @@ -123,9 +110,8 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa .newAny(CASING_INDEX, 3)) .addElement( 'm', - buildHatchAdder(GT_TileEntity_MegaOilCracker.class) - .atLeast(TTEnabledEnergyHatchElement.INSTANCE, Maintenance).casingIndex(CASING_INDEX).dot(1) - .buildAndChain(GregTech_API.sBlockCasings4, 1)) + buildHatchAdder(GT_TileEntity_MegaOilCracker.class).atLeast(Energy.or(ExoticEnergy), Maintenance) + .casingIndex(CASING_INDEX).dot(1).buildAndChain(GregTech_API.sBlockCasings4, 1)) .addElement( 'M', InputHatch.withAdder(GT_TileEntity_MegaOilCracker::addMiddleInputToMachineList) @@ -138,10 +124,10 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa (byte) 0, (byte) 1, Byte.MAX_VALUE, - (te, t) -> te.glasTier = t, - te -> te.glasTier))) + (te, t) -> te.glassTier = t, + te -> te.glassTier))) .build(); - private byte glasTier; + private byte glassTier; private HeatingCoilLevel heatLevel; protected final List mMiddleInputHatches = new ArrayList<>(); protected int mInputOnSide = -1; @@ -201,73 +187,17 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa } @Override - public boolean checkRecipe(ItemStack itemStack) { - ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - FluidStack[] tInputFluids = this.getStoredFluids().toArray(new FluidStack[0]); - ArrayList outputItems = new ArrayList<>(); - ArrayList outputFluids = new ArrayList<>(); - - long nominalV = TecTech.isModLoaded() ? TecTechUtils.getnominalVoltageTT(this) - : BW_Util.getnominalVoltage(this); - - byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); - - GT_Recipe tRecipe = getRecipeMap().findRecipe( - getBaseMetaTileEntity(), - false, - gregtech.api.enums.GT_Values.V[tTier], - tInputFluids, - mInventory[1]); - - boolean found_Recipe = false; - int processed = 0; - - if (tRecipe != null) { - found_Recipe = true; - long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); - int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); - this.updateSlots(); - if (tCurrentPara <= 0) { - return false; + protected ProcessingLogic createProcessingLogic() { + return new ProcessingLogic() { + + @Nonnull + @Override + protected GT_OverclockCalculator createOverclockCalculator(@Nonnull GT_Recipe recipe, + @Nonnull GT_ParallelHelper helper) { + return super.createOverclockCalculator(recipe, helper) + .setEUtDiscount(Math.max((0.1F * (heatLevel.getTier() + 1.0F)), 0.5F)); } - processed = tCurrentPara; - Pair, ArrayList> Outputs = getMultiOutput(tRecipe, tCurrentPara); - outputFluids = Outputs.getKey(); - outputItems = Outputs.getValue(); - } - - if (found_Recipe) { - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - - GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt) - .setParallel(processed).setDuration(tRecipe.mDuration).setEUt(nominalV).calculate(); - - this.mMaxProgresstime = calculator.getDuration(); - this.lEUt = calculator.getConsumption(); - - // In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) { - return false; - } - - if (this.getCoilLevel().getTier() < 5) { - this.lEUt *= 1 - (0.1D * (this.getCoilLevel().getTier() + 1)); - } else { - this.lEUt *= 0.5; - } - - if (this.lEUt > 0) { - this.lEUt = (-this.lEUt); - } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = new ItemStack[outputItems.size()]; - this.mOutputItems = outputItems.toArray(this.mOutputItems); - this.mOutputFluids = new FluidStack[outputFluids.size()]; - this.mOutputFluids = outputFluids.toArray(this.mOutputFluids); - return true; - } - return false; + }.setMaxParallel(ConfigHandler.megaMachinesMax); } public HeatingCoilLevel getCoilLevel() { @@ -293,28 +223,25 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - glasTier = 0; + glassTier = 0; mInputOnSide = -1; mOutputOnSide = -1; mMiddleInputHatches.clear(); - if (TecTech.isModLoaded()) { - this.getTecTechEnergyMultis().clear(); - this.getTecTechEnergyTunnels().clear(); - } - if (!checkPiece(STRUCTURE_PIECE_MAIN, 6, 6, 0)) return false; if (mMaintenanceHatches.size() != 1) return false; - if (TecTech.isModLoaded() && this.glasTier < 8) - if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) - || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) - return false; - - if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) - for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) - if (this.glasTier < hatchEnergy.mTier) return false; + if (glassTier < 8) { + for (GT_MetaTileEntity_Hatch hatch : mExoticEnergyHatches) { + if (hatch.getConnectionType() == GT_MetaTileEntity_Hatch.ConnectionType.LASER) { + return false; + } + if (glassTier < hatch.mTier) { + return false; + } + } + } return true; } @@ -428,11 +355,13 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa return STRUCTURE_DEFINITION; } - @SuppressWarnings("rawtypes") - @Optional.Method(modid = Mods.Names.TECTECH) - private boolean areThingsNotProperlyTiered(Collection collection) { - if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) - if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; - return false; + @Override + public boolean supportsBatchMode() { + return true; + } + + @Override + public boolean supportsVoidProtection() { + return true; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index daf87fd707..40d42f6598 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -14,18 +14,11 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.InputBus; -import static gregtech.api.enums.GT_HatchElement.InputHatch; -import static gregtech.api.enums.GT_HatchElement.Maintenance; -import static gregtech.api.enums.GT_HatchElement.OutputBus; -import static gregtech.api.enums.GT_HatchElement.OutputHatch; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Mods.TecTech; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_HatchElement.ExoticEnergy; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW; @@ -33,41 +26,29 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZE import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import java.util.ArrayList; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.Pair; -import com.github.bartimaeusnek.crossmod.tectech.helper.TecTechUtils; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; -import gregtech.api.enums.Mods; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.logic.ProcessingLogic; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_OverclockCalculator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -@Optional.Interface( - iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", - modid = Mods.Names.TECTECH, - striprefs = true) public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { @@ -157,13 +138,9 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc .addElement('=', StructureElementAirNoHint.getInstance()) .addElement( 'c', - buildHatchAdder(GT_TileEntity_MegaVacuumFreezer.class).atLeast( - TTEnabledEnergyHatchElement.INSTANCE, - InputHatch, - InputBus, - OutputHatch, - OutputBus, - Maintenance).casingIndex(CASING_INDEX).dot(1) + buildHatchAdder(GT_TileEntity_MegaVacuumFreezer.class) + .atLeast(Energy.or(ExoticEnergy), InputHatch, InputBus, OutputHatch, OutputBus, Maintenance) + .casingIndex(CASING_INDEX).dot(1) .buildAndChain(onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings2, 1)))) .build(); @@ -225,88 +202,17 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc } @Override - public boolean checkRecipe(ItemStack itemStack) { - ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - FluidStack[] tInputFluids = this.getStoredFluids().toArray(new FluidStack[0]); - ArrayList outputItems = new ArrayList<>(); - ArrayList outputFluids = new ArrayList<>(); - - long nominalV = TecTech.isModLoaded() ? TecTechUtils.getnominalVoltageTT(this) - : BW_Util.getnominalVoltage(this); - - byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); - - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes - .findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); - boolean found_Recipe = false; - int processed = 0; - float tBatchMultiplier = 1.0f; - - if (tRecipe != null) { - found_Recipe = true; - long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); - - if (batchMode && tMaxPara == ConfigHandler.megaMachinesMax) { - tMaxPara *= 128; - } - - int tCurrentPara = handleParallelRecipe(tRecipe, tInputFluids, tInputs, (int) tMaxPara); - tBatchMultiplier = batchMode ? (float) Math.max(tCurrentPara / ConfigHandler.megaMachinesMax, 1.0f) : 1.0f; - - this.updateSlots(); - if (tCurrentPara <= 0) return false; - processed = Math.min(tCurrentPara, ConfigHandler.megaMachinesMax); - Pair, ArrayList> Outputs = getMultiOutput(tRecipe, tCurrentPara); - outputFluids = Outputs.getKey(); - outputItems = Outputs.getValue(); - } - - if (found_Recipe) { - this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - - GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt) - .setParallel(processed).setDuration(tRecipe.mDuration).setEUt(nominalV).calculate(); - - this.mMaxProgresstime = calculator.getDuration(); - this.lEUt = calculator.getConsumption(); - - // In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) return false; - if (this.lEUt > 0) { - this.lEUt = (-this.lEUt); - } - - if (batchMode) { - this.mMaxProgresstime = (int) Math.ceil(this.mMaxProgresstime * tBatchMultiplier); - } - - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = new ItemStack[outputItems.size()]; - this.mOutputItems = outputItems.toArray(this.mOutputItems); - this.mOutputFluids = new FluidStack[outputFluids.size()]; - this.mOutputFluids = outputFluids.toArray(this.mOutputFluids); - return true; - } - return false; + protected ProcessingLogic createProcessingLogic() { + return new ProcessingLogic().setMaxParallel(ConfigHandler.megaMachinesMax); } // -------------- TEC TECH COMPAT ---------------- @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - if (TecTech.isModLoaded()) { - this.getTecTechEnergyMultis().clear(); - this.getTecTechEnergyTunnels().clear(); - } this.mCasing = 0; if (!checkPiece(STRUCTURE_PIECE_MAIN, 7, 7, 0)) return false; - return this.mMaintenanceHatches.size() == 1 - && (TecTech.isModLoaded() - ? (!this.getTecTechEnergyMultis().isEmpty() || !this.getTecTechEnergyTunnels().isEmpty() - || !this.mEnergyHatches.isEmpty()) - : !this.mEnergyHatches.isEmpty()) - && this.mCasing >= 900; + return this.mMaintenanceHatches.size() == 1 && this.mCasing >= 900; } @Override @@ -335,4 +241,9 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc public boolean supportsBatchMode() { return true; } + + @Override + public boolean supportsVoidProtection() { + return true; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ResultWrongSievert.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ResultWrongSievert.java new file mode 100644 index 0000000000..6acd417840 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ResultWrongSievert.java @@ -0,0 +1,86 @@ +package com.github.bartimaeusnek.bartworks.util; + +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.StatCollector; + +import gregtech.api.recipe.check.CheckRecipeResult; +import gregtech.api.util.GT_Utility; + +public class ResultWrongSievert implements CheckRecipeResult { + + public enum NeededSievertType { + EXACTLY, + MINIMUM + } + + private NeededSievertType type; + private int required; + + public ResultWrongSievert(int required, NeededSievertType type) { + this.required = required; + this.type = type; + } + + public String getID() { + return "wrong_sievert"; + } + + @Override + public boolean wasSuccessful() { + return false; + } + + @Override + public String getDisplayString() { + switch (type) { + case EXACTLY: + return StatCollector.translateToLocalFormatted( + "GT5U.gui.text.wrong_sievert_exactly", + GT_Utility.formatNumbers(required)); + case MINIMUM: + return StatCollector.translateToLocalFormatted( + "GT5U.gui.text.wrong_sievert_min", + GT_Utility.formatNumbers(required)); + } + return ""; + } + + @Override + public CheckRecipeResult newInstance() { + return new ResultWrongSievert(0, NeededSievertType.EXACTLY); + } + + @Override + public void encode(PacketBuffer buffer) { + buffer.writeVarIntToBuffer(required); + buffer.writeVarIntToBuffer(type.ordinal()); + } + + @Override + public void decode(PacketBuffer buffer) { + required = buffer.readVarIntFromBuffer(); + type = NeededSievertType.values()[buffer.readVarIntFromBuffer()]; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ResultWrongSievert that = (ResultWrongSievert) o; + return required == that.required; + } + + /** + * Cannot process recipe because the machine doesn't have the minimum amount of sievert + */ + public static CheckRecipeResult insufficientSievert(int required) { + return new ResultWrongSievert(required, NeededSievertType.MINIMUM); + } + + /** + * Cannot process recipe because the machine doesn't have the exact amount of sievert + */ + public static CheckRecipeResult wrongSievert(int required) { + return new ResultWrongSievert(required, NeededSievertType.EXACTLY); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java deleted file mode 100644 index f5e07545b1..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.tectech; - -import java.util.List; - -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel; - -import gregtech.api.enums.GT_Values; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.util.GT_Utility; - -public interface TecTechEnabledMulti { - - List getVanillaEnergyHatches(); - - List getTecTechEnergyTunnels(); - - List getTecTechEnergyMultis(); - - default long[] getCurrentInfoData() { - long storedEnergy = 0, maxEnergy = 0; - for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : this.getTecTechEnergyTunnels()) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); - } - } - - for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : this.getTecTechEnergyMultis()) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); - } - } - return new long[] { storedEnergy, maxEnergy }; - } - - default String[] getInfoDataArray(GT_MetaTileEntity_MultiBlockBase multiBlockBase) { - int mPollutionReduction = 0; - - for (GT_MetaTileEntity_Hatch_Muffler tHatch : multiBlockBase.mMufflerHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); - } - } - - long[] ttHatches = getCurrentInfoData(); - long storedEnergy = ttHatches[0]; - long maxEnergy = ttHatches[1]; - - for (GT_MetaTileEntity_Hatch_Energy tHatch : multiBlockBase.mEnergyHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); - } - } - - return new String[] { - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(multiBlockBase.mProgresstime / 20) - + EnumChatFormatting.RESET - + " s / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(multiBlockBase.mMaxProgresstime / 20) - + EnumChatFormatting.RESET - + " s", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(storedEnergy) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEnergy) - + EnumChatFormatting.RESET - + " EU", - StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(-multiBlockBase.mEUt) - + EnumChatFormatting.RESET - + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(multiBlockBase.getMaxInputVoltage()) - + EnumChatFormatting.RESET - + " EU/t(*2A) " - + StatCollector.translateToLocal("GT5U.machines.tier") - + ": " - + EnumChatFormatting.YELLOW - + GT_Values.VN[GT_Utility.getTier(multiBlockBase.getMaxInputVoltage())] - + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " - + EnumChatFormatting.RED - + (multiBlockBase.getIdealStatus() - multiBlockBase.getRepairStatus()) - + EnumChatFormatting.RESET - + " " - + StatCollector.translateToLocal("GT5U.multiblock.efficiency") - + ": " - + EnumChatFormatting.YELLOW - + (float) multiBlockBase.mEfficiency / 100.0F - + EnumChatFormatting.RESET - + " %", - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " - + EnumChatFormatting.GREEN - + mPollutionReduction - + EnumChatFormatting.RESET - + " %", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java deleted file mode 100644 index e61bc68cee..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.tectech.helper; - -import gregtech.api.enums.HeatingCoilLevel; - -public interface IHasCoils { - - void setCoilHeat(HeatingCoilLevel coilMeta); - - HeatingCoilLevel getCoilHeat(); -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java deleted file mode 100644 index 57c58f5d3a..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.tectech.helper; - -import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel; - -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; - -public class TecTechUtils { - - @Deprecated - public static boolean addEnergyInputToMachineList(TecTechEnabledMulti baseTE, IGregTechTileEntity te, - int aBaseCasingIndex) { - return addEnergyInputToMachineList(baseTE, te, aBaseCasingIndex, -1) != -1; - } - - public static int addEnergyInputToMachineList(TecTechEnabledMulti baseTE, IGregTechTileEntity te, - int aBaseCasingIndex, int aTier) { - if (te == null || !(te.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch)) return -1; - else { - GT_MetaTileEntity_Hatch mte = (GT_MetaTileEntity_Hatch) te.getMetaTileEntity(); - - if (mte.mTier != aTier && aTier != -1) return -1; - - if (mte instanceof GT_MetaTileEntity_Hatch_EnergyTunnel) - if (baseTE.getVanillaEnergyHatches().isEmpty() && baseTE.getTecTechEnergyMultis().isEmpty()) - baseTE.getTecTechEnergyTunnels().add((GT_MetaTileEntity_Hatch_EnergyTunnel) mte); - else return -1; - else if (baseTE.getTecTechEnergyTunnels().isEmpty()) { - if (mte instanceof GT_MetaTileEntity_Hatch_Energy) - baseTE.getVanillaEnergyHatches().add((GT_MetaTileEntity_Hatch_Energy) mte); - else if (mte instanceof GT_MetaTileEntity_Hatch_EnergyMulti) - baseTE.getTecTechEnergyMultis().add((GT_MetaTileEntity_Hatch_EnergyMulti) mte); - else return -1; - } else return -1; - - mte.updateTexture(aBaseCasingIndex); - return mte.mTier; - } - } - - public static boolean drainEnergyMEBFTecTech(TecTechEnabledMulti multi, long aEU) { - if (aEU <= 0) return true; - - long allTheEu = 0; - int hatches = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : multi.getVanillaEnergyHatches()) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - allTheEu += tHatch.getEUVar(); - hatches++; - } - - for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : multi.getTecTechEnergyTunnels()) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - allTheEu += tHatch.getEUVar(); - hatches++; - } - - for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : multi.getTecTechEnergyMultis()) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - allTheEu += tHatch.getEUVar(); - hatches++; - } - - if (allTheEu < aEU) return false; - - if (hatches == 0) return false; - - long euperhatch = aEU / hatches; - - boolean hasDrained = true; - - for (GT_MetaTileEntity_Hatch_Energy tHatch : multi.getVanillaEnergyHatches()) - hasDrained &= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); - - for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : multi.getTecTechEnergyTunnels()) - hasDrained &= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); - - for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : multi.getTecTechEnergyMultis()) - hasDrained &= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); - - return hasDrained && (multi.getVanillaEnergyHatches().size() > 0 || multi.getTecTechEnergyTunnels().size() > 0 - || multi.getTecTechEnergyMultis().size() > 0); - } - - public static long getnominalVoltageTT(TecTechEnabledMulti base) { - long rVoltage = 0L; - long rAmperage = 0L; - - for (GT_MetaTileEntity_Hatch_Energy tHatch : base.getVanillaEnergyHatches()) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rVoltage = Math.max(tHatch.getBaseMetaTileEntity().getInputVoltage(), rVoltage); - rAmperage += tHatch.getBaseMetaTileEntity().getInputAmperage(); - } - } - - for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : base.getTecTechEnergyMultis()) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rVoltage = Math.max(tHatch.getBaseMetaTileEntity().getInputVoltage(), rVoltage); - rAmperage += tHatch.Amperes; - } - } - - for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : base.getTecTechEnergyTunnels()) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rVoltage = Math.max(getEUPerTickFromLaser(tHatch), rVoltage); - rAmperage += 1; - } - } - - return rVoltage * rAmperage; - } - - public static long getMaxInputVoltage(TecTechEnabledMulti base) { - long rVoltage = 0L; - for (GT_MetaTileEntity_Hatch_Energy tHatch : base.getVanillaEnergyHatches()) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage(); - } - } - for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : base.getTecTechEnergyMultis()) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage(); - } - } - for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : base.getTecTechEnergyTunnels()) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rVoltage += tHatch.maxEUInput(); - } - } - return rVoltage; - } - - public static long getMaxInputAmperage(TecTechEnabledMulti base) { - long rAmperage = 0L; - for (GT_MetaTileEntity_Hatch_Energy tHatch : base.getVanillaEnergyHatches()) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rAmperage += tHatch.getBaseMetaTileEntity().getInputAmperage(); - } - } - for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : base.getTecTechEnergyMultis()) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rAmperage += tHatch.getBaseMetaTileEntity().getInputAmperage(); - } - } - for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : base.getTecTechEnergyTunnels()) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rAmperage += tHatch.Amperes; - } - } - return rAmperage; - } - - public static long getEUPerTickFromLaser(GT_MetaTileEntity_Hatch_EnergyTunnel tHatch) { - return tHatch.Amperes * tHatch.maxEUInput() /* - (tHatch.Amperes / 20) */; - } -} diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index ce7ac08197..fabd5dafcd 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -7,6 +7,10 @@ BW_ItemBlocks.0.name=Etched Lapis Cell BW_ItemBlocks.1.name=Plated Lapis Cell GT_LESU_CASING.0.name=LESU Casing +GT5U.gui.text.no_imprint=Missing imprint +GT5U.gui.text.wrong_sievert_exactly=§7Wrong sievert. Requires exactly: %s §7Sv +GT5U.gui.text.wrong_sievert_min=§7Wrong sievert. Requires at least: %s §7Sv + itemGroup.bartworks=BartWorks Inter Temporal BW_Machinery_Casings.0.name=Nickel-Zinc Ferrite Block BW_Machinery_Casings.1.name=Transformer-Winding Block -- cgit From 91db1d408c07dec497598dede6069b2cd364448a Mon Sep 17 00:00:00 2001 From: Lyfts <127234178+Lyfts@users.noreply.github.com> Date: Fri, 21 Jul 2023 17:55:29 +0200 Subject: Swap Void Miner and Ore Drill recipe frames (#341) Former-commit-id: 2b5c3cf134db3f6d9365d8d1bca566b9506bf384 --- .../bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java index 7331353108..a8a879a3fc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java @@ -46,7 +46,7 @@ public class AssemblyLine implements Runnable { ItemList.OreDrill4.get(1L), (int) TierEU.RECIPE_LuV, new Object[] { ItemList.OreDrill4.get(1L), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Europium, 9L), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 9L), Materials.Europium.getPlates(3), ItemList.Electric_Motor_LuV.get(9L), ItemList.Sensor_LuV.get(9L), ItemList.Field_Generator_LuV.get(9L), GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 36L) }, -- cgit From 54e1d39831a2c365f19119849d47b2e948a544cb Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Sat, 22 Jul 2023 13:18:42 +0100 Subject: plutonium fix (#342) Former-commit-id: a4838b2f30f9f51b16dc42c77b53f1c6cd5e9a18 --- .../bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java index b29552062b..97924d1447 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java @@ -67,7 +67,6 @@ public class BW_GT_MaterialReference { public static Werkstoff Palladium = new Werkstoff(Materials.Palladium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 52); public static Werkstoff Phosphorus = new Werkstoff(Materials.Phosphorus, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 21); public static Werkstoff Platinum = new Werkstoff(Materials.Platinum, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 85); - public static Werkstoff Plutonium = new Werkstoff(Materials.Plutonium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 100); public static Werkstoff Plutonium241 = new Werkstoff( Materials.Plutonium241, ADD_CASINGS_ONLY, -- cgit From 95af46c2732c91cb9afde4ccfd09145a60bef8d0 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 22 Jul 2023 16:58:58 +0200 Subject: Update dependencies.gradle (#343) Now it should work. Vexatos fixed it Former-commit-id: c6df69a9030d0cad50cd4d723936e432abcebc2e --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 08fd6ca730..32565b3831 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -9,6 +9,6 @@ dependencies { api("com.github.GTNewHorizons:Avaritia:1.45:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.38-GTNH:dev") - compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.24-pre:dev") {transitive = false} + compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.24:deobf") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.12-GTNH:api") {transitive = false} } -- cgit From ca956e71da6643144453c8ca1d66a426e02b738b Mon Sep 17 00:00:00 2001 From: BlueWeabo Date: Mon, 24 Jul 2023 15:03:26 +0300 Subject: Fix MEBF calculating twice and not using its parallel for eut use. MOC for wrong discount (#344) * fix * update deps and address review * Fix compile error --------- Co-authored-by: miozune Former-commit-id: f8c3a5e34ee854778ce7a80d3a11a636d45bc477 --- dependencies.gradle | 6 +++--- .../common/loaders/StaticRecipeChangeLoaders.java | 6 +++--- .../multis/mega/GT_TileEntity_MegaBlastFurnace.java | 5 ++--- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 17 ++--------------- 4 files changed, 10 insertions(+), 24 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 32565b3831..98a9383e1b 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,13 +1,13 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.127:dev') - api("com.github.GTNewHorizons:TecTech:5.2.34:dev") + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.142:dev') + api("com.github.GTNewHorizons:TecTech:5.2.35:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.9:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } api("com.github.GTNewHorizons:Avaritia:1.45:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.38-GTNH:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.39-GTNH:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.24:deobf") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.12-GTNH:api") {transitive = false} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index dc68b5e33a..81336594b1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -132,9 +132,9 @@ public class StaticRecipeChangeLoaders { FluidStack wrongNamedFluid) { for (int i = 0; i < recipe.mFluidInputs.length; i++) { if (GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], wrongNamedFluid)) { - Collection col = map.mRecipeFluidMap.get(wrongNamedFluid.getFluid()); - map.mRecipeFluidMap.remove(wrongNamedFluid.getFluid()); - map.mRecipeFluidMap.put(werkstoff.getFluidOrGas(1).getFluid(), col); + Collection col = map.mRecipeFluidMap.get(wrongNamedFluid.getFluid().getName()); + map.mRecipeFluidMap.remove(wrongNamedFluid.getFluid().getName()); + map.mRecipeFluidMap.put(werkstoff.getFluidOrGas(1).getFluid().getName(), col); recipe.mFluidInputs[i] = werkstoff.getFluidOrGas(recipe.mFluidInputs[i].amount); map.mRecipeFluidNameMap.add(werkstoff.getFluidOrGas(1).getFluid().getName()); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 4ef6a5f7d1..de96c23acd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -278,9 +278,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override protected GT_OverclockCalculator createOverclockCalculator(@Nonnull GT_Recipe recipe, @Nonnull GT_ParallelHelper helper) { - return new GT_OverclockCalculator().setRecipeEUt(recipe.mEUt).setDuration(recipe.mDuration) - .setEUt(availableVoltage).setRecipeHeat(recipe.mSpecialValue).setMultiHeat(mHeatingCapacity) - .enableHeatOC().enableHeatDiscount().calculate(); + return super.createOverclockCalculator(recipe, helper).setRecipeHeat(recipe.mSpecialValue) + .setMultiHeat(mHeatingCapacity).enableHeatOC().enableHeatDiscount(); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index ff07c65acb..db41407650 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -18,7 +18,6 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static com.gtnewhorizon.structurelib.structure.StructureUtility.withChannel; import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_HatchElement.ExoticEnergy; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW; @@ -30,8 +29,6 @@ import static gregtech.api.util.GT_StructureUtility.ofCoil; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; - import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; @@ -55,8 +52,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_OverclockCalculator; -import gregtech.api.util.GT_ParallelHelper; import gregtech.api.util.GT_Recipe; public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBase @@ -188,16 +183,8 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic() { - - @Nonnull - @Override - protected GT_OverclockCalculator createOverclockCalculator(@Nonnull GT_Recipe recipe, - @Nonnull GT_ParallelHelper helper) { - return super.createOverclockCalculator(recipe, helper) - .setEUtDiscount(Math.max((0.1F * (heatLevel.getTier() + 1.0F)), 0.5F)); - } - }.setMaxParallel(ConfigHandler.megaMachinesMax); + return new ProcessingLogic().setMaxParallel(ConfigHandler.megaMachinesMax) + .setEuModifier(1.0F - Math.min(0.1F * (heatLevel.getTier() + 1), 0.5F)); } public HeatingCoilLevel getCoilLevel() { -- cgit From 074b75f5b0c9230a309a05168826b0dc2f9eba2e Mon Sep 17 00:00:00 2001 From: BlueWeabo Date: Mon, 24 Jul 2023 15:05:20 +0300 Subject: Enable Batch mode on Bio Vat (#345) * enable batchMode * address review * Revert "address review" This reverts commit c8769f1d729f1b91165da757f66033e49c08ae3b [formerly 0d6d3c99967ed755b5f3ff9eade68aac35b63f01]. Former-commit-id: 18d10adb9b835c8dbd9fe13b27ca4e3ab064e689 --- .../bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index b8a9bdecaa..2203b89aa8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -684,4 +684,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa public boolean supportsVoidProtection() { return true; } + + @Override + public boolean supportsBatchMode() { + return true; + } } -- cgit From 88425ab3314ad012eaa312859e4aa59476460ead Mon Sep 17 00:00:00 2001 From: miozune Date: Tue, 25 Jul 2023 13:17:59 +0900 Subject: Remove AbstractedStack (#346) * Remove AbstractedStack * Remove outdated script Former-commit-id: 462a8b3e49915df48fd772bdc4ff13f097d39b4c --- .github/scripts/test_no_error_reports | 51 ------------- .../bartworks/system/object/AbstractedStack.java | 84 ---------------------- 2 files changed, 135 deletions(-) delete mode 100755 .github/scripts/test_no_error_reports delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java diff --git a/.github/scripts/test_no_error_reports b/.github/scripts/test_no_error_reports deleted file mode 100755 index 1fcc7396c6..0000000000 --- a/.github/scripts/test_no_error_reports +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash - -# bashsupport disable=BP5006 # Global environment variables -RUNDIR="run" \ - CRASH="crash-reports" \ - SERVERLOG="server.log" - -# enable nullglob to get 0 results when no match rather than the pattern -shopt -s nullglob - -# store matches in array -crash_reports=("$RUNDIR/$CRASH/crash"*.txt) - -# if array not empty there are crash_reports -if [ "${#crash_reports[@]}" -gt 0 ]; then - # get the latest crash_report from array - latest_crash_report="${crash_reports[-1]}" - { - printf 'Latest crash report detected %s:\n' "${latest_crash_report##*/}" - cat "$latest_crash_report" - } >&2 - exit 1 -fi - -if grep --quiet --fixed-strings 'Fatal errors were detected' "$SERVERLOG"; then - { - printf 'Fatal errors detected:\n' - cat server.log - } >&2 - exit 1 -fi - -if grep --quiet --fixed-strings 'The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED' \ - "$SERVERLOG"; then - { - printf 'Server force stopped:' - cat server.log - } >&2 - exit 1 -fi - -if ! grep --quiet --perl-regexp --only-matching '.+Done \(.+\)\! For help, type "help" or "\?"' "$SERVERLOG"; then - { - printf 'Server did not finish startup:' - cat server.log - } >&2 - exit 1 -fi - -printf 'No crash reports detected' -exit 0 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java deleted file mode 100644 index 86e5673ebf..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.system.object; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -import com.github.bartimaeusnek.bartworks.util.Pair; - -public class AbstractedStack implements Serializable { - - final Pair idDamage; - final NBTTagCompound mTag; - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof AbstractedStack)) return false; - - AbstractedStack that = (AbstractedStack) o; - - if (this.getIdDamage() != null ? !this.getIdDamage().equals(that.getIdDamage()) : that.getIdDamage() != null) - return false; - return this.getmTag() != null ? this.getmTag().equals(that.getmTag()) : that.getmTag() == null; - } - - @Override - public int hashCode() { - int result = this.getIdDamage() != null ? this.getIdDamage().hashCode() : 0; - result = 31 * result + (this.getmTag() != null ? this.getmTag().hashCode() : 0); - return result; - } - - public Pair getIdDamage() { - return this.idDamage; - } - - public NBTTagCompound getmTag() { - return this.mTag; - } - - public AbstractedStack(Pair idDamage, NBTTagCompound mTag) { - this.idDamage = idDamage; - this.mTag = mTag; - } - - public AbstractedStack(ItemStack itemStack) { - if (itemStack == null) throw new UnsupportedOperationException(); - this.idDamage = new Pair<>(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage()); - this.mTag = itemStack.getTagCompound(); - } - - public byte[] serialize() throws IOException { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - ObjectOutputStream os = new ObjectOutputStream(out); - os.writeObject(this); - return out.toByteArray(); - } - - public AbstractedStack deserialize(byte[] data) throws IOException, ClassNotFoundException, ClassCastException { - ByteArrayInputStream in = new ByteArrayInputStream(data); - ObjectInputStream is = new ObjectInputStream(in); - return (AbstractedStack) is.readObject(); - } -} -- cgit From 70e29e7495939a5372b0edf0469fec51a238e913 Mon Sep 17 00:00:00 2001 From: BlueWeabo Date: Tue, 25 Jul 2023 23:22:56 +0300 Subject: fix moc crashing when being placed (#347) Former-commit-id: 69a6b45042c4259adec4dbbf810190256c5abbe7 --- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index db41407650..e428debe4e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -29,6 +29,8 @@ import static gregtech.api.util.GT_StructureUtility.ofCoil; import java.util.ArrayList; import java.util.List; +import javax.annotation.Nonnull; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; @@ -50,6 +52,7 @@ import gregtech.api.logic.ProcessingLogic; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; @@ -183,8 +186,14 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setMaxParallel(ConfigHandler.megaMachinesMax) - .setEuModifier(1.0F - Math.min(0.1F * (heatLevel.getTier() + 1), 0.5F)); + return new ProcessingLogic() { + + @Nonnull + public CheckRecipeResult process() { + setEuModifier(1.0F - Math.min(0.1F * (heatLevel.getTier() + 1), 0.5F)); + return super.process(); + } + }.setMaxParallel(ConfigHandler.megaMachinesMax); } public HeatingCoilLevel getCoilLevel() { -- cgit From e356a1243457a80507528f2d3dd6e74009e4c0f3 Mon Sep 17 00:00:00 2001 From: BlueWeabo Date: Sat, 29 Jul 2023 03:18:47 +0300 Subject: Use new API from GT5u (#348) * use new API * update dep Former-commit-id: 6e506e9e407200a6db3b1fcea33b39562a96883e --- dependencies.gradle | 2 +- .../multis/GT_TileEntity_ElectricImplosionCompressor.java | 6 ++---- .../tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java | 8 +++----- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 98a9383e1b..a3af242a3f 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.142:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.158:dev') api("com.github.GTNewHorizons:TecTech:5.2.35:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.9:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 2466ff6c53..4f79104b2c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -67,7 +67,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OverclockCalculator; -import gregtech.api.util.GT_ParallelHelper; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -265,10 +264,9 @@ public class GT_TileEntity_ElectricImplosionCompressor @NotNull @Override - protected GT_OverclockCalculator createOverclockCalculator(@NotNull GT_Recipe recipe, - @NotNull GT_ParallelHelper helper) { + protected GT_OverclockCalculator createOverclockCalculator(@NotNull GT_Recipe recipe) { // For overclocking we'll allow all power to be used - return super.createOverclockCalculator(recipe, helper).setEUt(getMaxInputEu()).setAmperage(1); + return super.createOverclockCalculator(recipe).setEUt(getMaxInputEu()).setAmperage(1); } }.setMaxParallelSupplier(() -> (int) Math.pow(4, Math.max(mBlockTier - 1, 0))); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index de96c23acd..5178a3f759 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -63,7 +63,6 @@ import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OverclockCalculator; -import gregtech.api.util.GT_ParallelHelper; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -276,10 +275,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Nonnull @Override - protected GT_OverclockCalculator createOverclockCalculator(@Nonnull GT_Recipe recipe, - @Nonnull GT_ParallelHelper helper) { - return super.createOverclockCalculator(recipe, helper).setRecipeHeat(recipe.mSpecialValue) - .setMultiHeat(mHeatingCapacity).enableHeatOC().enableHeatDiscount(); + protected GT_OverclockCalculator createOverclockCalculator(@Nonnull GT_Recipe recipe) { + return super.createOverclockCalculator(recipe).setRecipeHeat(recipe.mSpecialValue) + .setMultiHeat(mHeatingCapacity).setHeatOC(true).setHeatDiscount(true); } @Override -- cgit From 35fc440e509f262ea816f01716f96ffb5ee07f9c Mon Sep 17 00:00:00 2001 From: BlueWeabo Date: Tue, 8 Aug 2023 21:24:57 +0300 Subject: disabled crafting me buffer on CAL (#351) Former-commit-id: 8f80db43ffc0e0caae5da1424fb7a4f24cdffab1 --- dependencies.gradle | 2 +- .../tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index a3af242a3f..4f3ab08a1f 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.158:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.168:dev') api("com.github.GTNewHorizons:TecTech:5.2.35:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.9:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index e46199d654..28cc85941f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -450,4 +450,9 @@ public class GT_TileEntity_CircuitAssemblyLine extends String imprintedWith = getTypeForDisplay(); if (!imprintedWith.isEmpty()) tag.setString("ImprintedWith", imprintedWith); } + + @Override + protected boolean supportsCraftingMEBuffer() { + return false; + } } -- cgit From 4865db661c159750fd0837bce77c824bfd034229 Mon Sep 17 00:00:00 2001 From: miozune Date: Fri, 11 Aug 2023 19:15:50 +0900 Subject: Don't lazily initialize EIC recipemap (#350) * Add one more commit to .git-blame-ignore-revs * updateBuildScript * Don't lazily initialize EIC recipemap Former-commit-id: 693b0374ef33b7600ab37b71024056d0941877d8 --- .git-blame-ignore-revs | 1 + build.gradle | 200 +++++++++++++++------ gradle/wrapper/gradle-wrapper.jar | Bin 61608 -> 62076 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 7 +- .../ElectricImplosionCompressorRecipes.java | 5 +- .../common/loaders/StaticRecipeChangeLoaders.java | 52 ++---- .../GT_TileEntity_ElectricImplosionCompressor.java | 4 +- .../bartimaeusnek/bartworks/util/BWRecipes.java | 18 ++ 9 files changed, 184 insertions(+), 105 deletions(-) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index c5e29c40f7..1ed528584f 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,3 @@ # Ignore spotlessApply reformat +f0f62d38a0c7834336afb73446ed67f7a850ae44 dff9a4e6c3e688dd66dd44ce546d1d1e01f5c77a diff --git a/build.gradle b/build.gradle index 3930990407..c5af340745 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1685785062 +//version: 1691351470 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -69,7 +69,7 @@ plugins { id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.3.14' + id 'com.gtnewhorizons.retrofuturagradle' version '1.3.24' } print("You might want to check out './gradlew :faq' if your build fails.\n") @@ -115,6 +115,8 @@ propertyDefaultIfUnset("usesMixinDebug", project.usesMixins) propertyDefaultIfUnset("forceEnableMixins", false) propertyDefaultIfUnset("channel", "stable") propertyDefaultIfUnset("mappingsVersion", "12") +propertyDefaultIfUnset("usesMavenPublishing", true) +propertyDefaultIfUnset("mavenPublishUrl", "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases") propertyDefaultIfUnset("modrinthProjectId", "") propertyDefaultIfUnset("modrinthRelations", "") propertyDefaultIfUnset("curseForgeProjectId", "") @@ -357,7 +359,27 @@ catch (Exception ignored) { String identifiedVersion String versionOverride = System.getenv("VERSION") ?: null try { - identifiedVersion = versionOverride == null ? gitVersion() : versionOverride + // Produce a version based on the tag, or for branches something like 0.2.2-configurable-maven-and-extras.38+43090270b6-dirty + if (versionOverride == null) { + def gitDetails = versionDetails() + def isDirty = gitVersion().endsWith(".dirty") // No public API for this, isCleanTag has a different meaning + String branchName = gitDetails.branchName ?: (System.getenv('GIT_BRANCH') ?: 'git') + if (branchName.startsWith('origin/')) { + branchName = branchName.minus('origin/') + } + branchName = branchName.replaceAll("[^a-zA-Z0-9-]+", "-") // sanitize branch names for semver + identifiedVersion = gitDetails.lastTag ?: '${gitDetails.gitHash}' + if (gitDetails.commitDistance > 0) { + identifiedVersion += "-${branchName}.${gitDetails.commitDistance}+${gitDetails.gitHash}" + if (isDirty) { + identifiedVersion += "-dirty" + } + } else if (isDirty) { + identifiedVersion += "-${branchName}+${gitDetails.gitHash}-dirty" + } + } else { + identifiedVersion = versionOverride + } } catch (Exception ignored) { out.style(Style.Failure).text( @@ -379,9 +401,13 @@ if (identifiedVersion == versionOverride) { group = "com.github.GTNewHorizons" if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) { - archivesBaseName = customArchiveBaseName + base { + archivesName = customArchiveBaseName + } } else { - archivesBaseName = modId + base { + archivesName = modId + } } @@ -465,10 +491,19 @@ sourceSets { } } -if (file('addon.gradle').exists()) { +if (file('addon.gradle.kts').exists()) { + apply from: 'addon.gradle.kts' +} else if (file('addon.gradle').exists()) { apply from: 'addon.gradle' } +// File for local tweaks not commited to Git +if (file('addon.local.gradle.kts').exists()) { + apply from: 'addon.local.gradle.kts' +} else if (file('addon.local.gradle').exists()) { + apply from: 'addon.local.gradle' +} + // Allow unsafe repos but warn repositories.configureEach { repo -> if (repo instanceof org.gradle.api.artifacts.repositories.UrlArtifactRepository) { @@ -479,7 +514,14 @@ repositories.configureEach { repo -> } } -apply from: 'repositories.gradle' +if (file('repositories.gradle.kts').exists()) { + apply from: 'repositories.gradle.kts' +} else if (file('repositories.gradle').exists()) { + apply from: 'repositories.gradle' +} else { + logger.error("Neither repositories.gradle.kts nor repositories.gradle was found, make sure you extracted the full ExampleMod template.") + throw new RuntimeException("Missing repositories.gradle[.kts]") +} configurations { runtimeClasspath.extendsFrom(runtimeOnlyNonPublishable) @@ -537,13 +579,28 @@ repositories { } } if (includeWellKnownRepositories.toBoolean()) { - maven { - name "CurseMaven" - url "https://cursemaven.com" - content { + exclusiveContent { + forRepository { + maven { + name "CurseMaven" + url "https://cursemaven.com" + } + } + filter { includeGroup "curse.maven" } } + exclusiveContent { + forRepository { + maven { + name = "Modrinth" + url = "https://api.modrinth.com/maven" + } + } + filter { + includeGroup "maven.modrinth" + } + } maven { name = "ic2" url = "https://maven.ic2.player.to/" @@ -574,6 +631,8 @@ def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule} def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev" ext.mixinProviderSpec = mixinProviderSpec +def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json' + dependencies { if (usesMixins.toBoolean()) { annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3') @@ -585,7 +644,7 @@ dependencies { } } if (usesMixins.toBoolean()) { - implementation(mixinProviderSpec) + implementation(modUtils.enableMixins(mixinProviderSpec, mixingConfigRefMap)) } else if (forceEnableMixins.toBoolean()) { runtimeOnlyNonPublishable(mixinProviderSpec) } @@ -611,12 +670,32 @@ configurations.all { } } -apply from: 'dependencies.gradle' +dependencies { + constraints { + def minGtnhLibVersion = "0.0.13" + implementation("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") { + because("fixes duplicate mod errors in java 17 configurations using old gtnhlib") + } + runtimeOnly("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") { + because("fixes duplicate mod errors in java 17 configurations using old gtnhlib") + } + devOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") { + because("fixes duplicate mod errors in java 17 configurations using old gtnhlib") + } + runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") { + because("fixes duplicate mod errors in java 17 configurations using old gtnhlib") + } + } +} -def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json' -def mixinTmpDir = buildDir.path + File.separator + 'tmp' + File.separator + 'mixins' -def refMap = "${mixinTmpDir}" + File.separator + mixingConfigRefMap -def mixinSrg = "${mixinTmpDir}" + File.separator + "mixins.srg" +if (file('dependencies.gradle.kts').exists()) { + apply from: 'dependencies.gradle.kts' +} else if (file('dependencies.gradle').exists()) { + apply from: 'dependencies.gradle' +} else { + logger.error("Neither dependencies.gradle.kts nor dependencies.gradle was found, make sure you extracted the full ExampleMod template.") + throw new RuntimeException("Missing dependencies.gradle[.kts]") +} tasks.register('generateAssets') { group = "GTNH Buildscript" @@ -648,46 +727,17 @@ tasks.register('generateAssets') { } if (usesMixins.toBoolean()) { - tasks.named("reobfJar", ReobfuscatedJar).configure { - extraSrgFiles.from(mixinSrg) - } - tasks.named("processResources").configure { dependsOn("generateAssets") } tasks.named("compileJava", JavaCompile).configure { - doFirst { - new File(mixinTmpDir).mkdirs() - } options.compilerArgs += [ - "-AreobfSrgFile=${tasks.reobfJar.srg.get().asFile}", - "-AoutSrgFile=${mixinSrg}", - "-AoutRefMapFile=${refMap}", // Elan: from what I understand they are just some linter configs so you get some warning on how to properly code "-XDenableSunApiLintControl", "-XDignore.symbol.file" ] } - - pluginManager.withPlugin('org.jetbrains.kotlin.kapt') { - kapt { - correctErrorTypes = true - javacOptions { - option("-AreobfSrgFile=${tasks.reobfJar.srg.get().asFile}") - option("-AoutSrgFile=$mixinSrg") - option("-AoutRefMapFile=$refMap") - } - } - tasks.configureEach { task -> - if (task.name == "kaptKotlin") { - task.doFirst { - new File(mixinTmpDir).mkdirs() - } - } - } - } - } tasks.named("processResources", ProcessResources).configure { @@ -705,7 +755,6 @@ tasks.named("processResources", ProcessResources).configure { } if (usesMixins.toBoolean()) { - from refMap dependsOn("compileJava", "compileScala") } } @@ -724,16 +773,16 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies" } dependencies { - def lwjgl3ifyVersion = '1.3.5' + def lwjgl3ifyVersion = '1.4.0' def asmVersion = '9.4' if (modId != 'lwjgl3ify') { java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") } if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.13') + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.26') } - java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false} + java17PatchDependencies('net.minecraft:launchwrapper:1.17.2') {transitive = false} java17PatchDependencies("org.ow2.asm:asm:${asmVersion}") java17PatchDependencies("org.ow2.asm:asm-commons:${asmVersion}") java17PatchDependencies("org.ow2.asm:asm-tree:${asmVersion}") @@ -979,6 +1028,9 @@ idea { } } runConfigurations { + "0. Build and Test"(Gradle) { + taskNames = ["build"] + } "1. Run Client"(Gradle) { taskNames = ["runClient"] } @@ -1098,6 +1150,14 @@ tasks.named("processIdeaSettings").configure { dependsOn("injectTags") } +tasks.named("ideVirtualMainClasses").configure { + // Make IntelliJ "Build project" build the mod jars + dependsOn("jar", "reobfJar") + if (!disableSpotless) { + dependsOn("spotlessCheck") + } +} + // workaround variable hiding in pom processing def projectConfigs = project.configurations @@ -1118,12 +1178,14 @@ publishing { } repositories { - maven { - url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases" - allowInsecureProtocol = true - credentials { - username = System.getenv("MAVEN_USER") ?: "NONE" - password = System.getenv("MAVEN_PASSWORD") ?: "NONE" + if (usesMavenPublishing.toBoolean()) { + maven { + url = mavenPublishUrl + allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven + credentials { + username = System.getenv("MAVEN_USER") ?: "NONE" + password = System.getenv("MAVEN_PASSWORD") ?: "NONE" + } } } } @@ -1238,7 +1300,7 @@ def addCurseForgeRelation(String type, String name) { // Updating -def buildscriptGradleVersion = "8.1.1" +def buildscriptGradleVersion = "8.2.1" tasks.named('wrapper', Wrapper).configure { gradleVersion = buildscriptGradleVersion @@ -1344,8 +1406,14 @@ boolean isNewBuildScriptVersionAvailable() { String currentBuildScript = getFile("build.gradle").getText() String currentBuildScriptHash = getVersionHash(currentBuildScript) - String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText() - String availableBuildScriptHash = getVersionHash(availableBuildScript) + String availableBuildScriptHash + try { + String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText() + availableBuildScriptHash = getVersionHash(availableBuildScript) + } catch (IOException e) { + logger.warn("Could not check for buildscript update availability: {}", e.message) + return false + } boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash return !isUpToDate @@ -1510,3 +1578,17 @@ def getSecondaryArtifacts() { if (apiPackage) secondaryArtifacts += [apiJar] return secondaryArtifacts } + +// For easier scripting of things that require variables defined earlier in the buildscript +if (file('addon.late.gradle.kts').exists()) { + apply from: 'addon.late.gradle.kts' +} else if (file('addon.late.gradle').exists()) { + apply from: 'addon.late.gradle' +} + +// File for local tweaks not commited to Git +if (file('addon.late.local.gradle.kts').exists()) { + apply from: 'addon.late.local.gradle.kts' +} else if (file('addon.late.local.gradle').exists()) { + apply from: 'addon.late.local.gradle' +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index ccebba7710..c1962a79e2 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37aef8d3f0..17a8ddce2d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 79a61d421c..aeb74cbb43 100755 --- a/gradlew +++ b/gradlew @@ -85,9 +85,6 @@ done APP_BASE_NAME=${0##*/} APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then done fi + +# 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"' + # Collect all arguments for the java command; # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java index 7687ccedb4..5ac8d72744 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java @@ -1,6 +1,5 @@ package com.github.bartimaeusnek.bartworks.common.loaders; -import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; import static gregtech.api.enums.GT_Values.M; import static gregtech.api.enums.Mods.EternalSingularity; import static gregtech.api.enums.Mods.GoodGenerator; @@ -12,6 +11,8 @@ import static gregtech.api.util.GT_ModHandler.getModItem; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; + import gregtech.api.enums.*; import gregtech.api.util.GT_OreDictUnificator; @@ -20,7 +21,7 @@ public class ElectricImplosionCompressorRecipes implements Runnable { private static void addElectricImplosionRecipe(final ItemStack[] inputItems, final FluidStack[] inputFluids, final ItemStack[] outputItems, final FluidStack[] outputFluids, final int durationInTicks, final int EUPerTick) { - eicMap.addRecipe( + BWRecipes.instance.eicMap.addRecipe( false, inputItems, outputItems, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 81336594b1..6f482aaa48 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -13,7 +13,6 @@ package com.github.bartimaeusnek.bartworks.common.loaders; -import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.ANAEROBE_GAS; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.NOBLE_GAS; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Oganesson; @@ -51,7 +50,6 @@ import com.github.bartimaeusnek.bartworks.util.StreamUtils; import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.google.common.collect.ArrayListMultimap; -import com.gtnewhorizons.modularui.common.widget.ProgressBar; import cpw.mods.fml.common.registry.GameRegistry; import gnu.trove.map.hash.TObjectDoubleHashMap; @@ -60,7 +58,6 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; -import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -618,43 +615,22 @@ public class StaticRecipeChangeLoaders { toAdd.forEach(GT_Recipe.GT_Recipe_Map.sBlastRecipes::add); } - @SuppressWarnings("ALL") public static void addElectricImplosionCompressorRecipes() { - if (eicMap == null) { - eicMap = new GT_Recipe.GT_Recipe_Map( - new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), - "gt.recipe.electricimplosioncompressor", - "Electric Implosion Compressor", - (String) null, - "gregtech:textures/gui/basicmachines/Default", - 6, - 2, - 0, - 0, - 1, - "", - 1, - "", - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_IMPLOSION) - .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT); - GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream().filter(e -> e.mInputs != null).forEach( - recipe -> eicMap.addRecipe( - true, - Arrays.stream(recipe.mInputs).filter(e -> !StaticRecipeChangeLoaders.checkForExplosives(e)) - .distinct().toArray(ItemStack[]::new), - recipe.mOutputs, - null, - null, - null, - 1, - BW_Util.getMachineVoltageFromTier(10), - 0)); - - // Custom EIC recipes. - new ElectricImplosionCompressorRecipes().run(); - } + GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream().filter(e -> e.mInputs != null).forEach( + recipe -> BWRecipes.instance.eicMap.addRecipe( + true, + Arrays.stream(recipe.mInputs).filter(e -> !StaticRecipeChangeLoaders.checkForExplosives(e)) + .distinct().toArray(ItemStack[]::new), + recipe.mOutputs, + null, + null, + null, + 1, + BW_Util.getMachineVoltageFromTier(10), + 0)); + // Custom EIC recipes. + new ElectricImplosionCompressorRecipes().run(); } private static boolean checkForExplosives(ItemStack input) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 4f79104b2c..cd76fc7470 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -39,6 +39,7 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.renderer.BW_EICPistonVisualizer; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.net.EICPacket; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.Coords; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; @@ -74,7 +75,6 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase implements ISurvivalConstructable { - public static GT_Recipe.GT_Recipe_Map eicMap; private static final boolean pistonEnabled = !ConfigHandler.disablePistonInEIC; private Boolean piston = true; private static final SoundResource sound = SoundResource.RANDOM_EXPLODE; @@ -255,7 +255,7 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return eicMap; + return BWRecipes.instance.eicMap; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 9fc49a3716..21bab359a5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -44,6 +44,7 @@ import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.api.math.Pos2d; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.ProgressBar; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -207,6 +208,23 @@ public class BWRecipes { StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", amount), StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.2", time * amount / 20.0)); }); + public final GT_Recipe.GT_Recipe_Map eicMap = new GT_Recipe.GT_Recipe_Map( + new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), + "gt.recipe.electricimplosioncompressor", + "Electric Implosion Compressor", + null, + "gregtech:textures/gui/basicmachines/Default", + 6, + 2, + 0, + 0, + 1, + "", + 1, + "", + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_IMPLOSION) + .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT); /** * @param machine 0 = biolab; 1 = BacterialVat; 2 = sAcidGenFuels; 3 = circuitAssemblyLine -- cgit From beb845b55a002e6d03fa495f7853c3800ed11337 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Fri, 11 Aug 2023 12:46:38 +0200 Subject: Update dependencies.gradle Former-commit-id: 15d56d60c411295e764d9f383eb7b340e3c74579 --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 4f3ab08a1f..a01daac671 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -9,6 +9,6 @@ dependencies { api("com.github.GTNewHorizons:Avaritia:1.45:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.39-GTNH:dev") - compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.24:deobf") {transitive = false} + compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.24-pre:dev") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.12-GTNH:api") {transitive = false} } -- cgit From 92c973e6e377a32b0b61f326c274a65cb50134ba Mon Sep 17 00:00:00 2001 From: Sampsa <69092953+S4mpsa@users.noreply.github.com> Date: Wed, 23 Aug 2023 12:16:47 +0300 Subject: Change Molten Infinity to Molten Neutronium in alternate High Density recipes (#353) Former-commit-id: 19def92e93b20e19f9bd9587b38d978abeb92666 --- .../common/loaders/ElectricImplosionCompressorRecipes.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java index 5ac8d72744..f9f3ea3c64 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java @@ -73,7 +73,7 @@ public class ElectricImplosionCompressorRecipes implements Runnable { addElectricImplosionRecipe( // IN. new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityPlutoniumNugget", 5L) }, - new FluidStack[] { Materials.Infinity.getMolten(9L) }, + new FluidStack[] { Materials.Neutronium.getMolten(72L) }, // OUT. new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityPlutonium", 1L) }, new FluidStack[] { GT_Values.NF }, @@ -84,7 +84,7 @@ public class ElectricImplosionCompressorRecipes implements Runnable { addElectricImplosionRecipe( // IN. new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityUraniumNugget", 5L) }, - new FluidStack[] { Materials.Infinity.getMolten(9L) }, + new FluidStack[] { Materials.Neutronium.getMolten(72L) }, // OUT. new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityUranium", 1L) }, new FluidStack[] { GT_Values.NF }, @@ -95,7 +95,7 @@ public class ElectricImplosionCompressorRecipes implements Runnable { addElectricImplosionRecipe( // IN. new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityThoriumNugget", 5L) }, - new FluidStack[] { Materials.Infinity.getMolten(9L) }, + new FluidStack[] { Materials.Neutronium.getMolten(72L) }, // OUT. new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityThorium", 1L) }, new FluidStack[] { GT_Values.NF }, -- cgit From 4e0113d3809d0dc942b0805f3bcc853bc26602f0 Mon Sep 17 00:00:00 2001 From: lordIcocain <62835225+lordIcocain@users.noreply.github.com> Date: Wed, 30 Aug 2023 22:46:57 +0300 Subject: fix quad input hatch for Mega Oil Cracker (#352) * fix quad input hatch * fix quad input hatch Improve code readable Former-commit-id: b30e4f950448c82e94dff0772d1e6d5e2a5f65f4 --- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 44 ++++++++++++++++------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index e428debe4e..01f351014e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -51,6 +51,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.logic.ProcessingLogic; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_MultiInput; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.render.TextureFactory; @@ -325,21 +326,40 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa @Override public ArrayList getStoredFluids() { - ArrayList rList = new ArrayList<>(); - for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) { - tHatch.mRecipeMap = getRecipeMap(); - if (isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) { - if (!GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tHatch.getFillableStack())) { - rList.add(tHatch.getFillableStack()); + final ArrayList rList = new ArrayList<>(); + for (final GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) { + if (isValidMetaTileEntity(tHatch)) { + tHatch.mRecipeMap = getRecipeMap(); + if (tHatch instanceof GT_MetaTileEntity_Hatch_MultiInput) { + for (final FluidStack tFluid : ((GT_MetaTileEntity_Hatch_MultiInput) tHatch).getStoredFluid()) { + if (tFluid != null && !GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tFluid)) { + rList.add(tFluid); + } + } + } else { + if (tHatch.getFillableStack() != null) { + if (!GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tHatch.getFillableStack())) + rList.add(tHatch.getFillableStack()); + } } } } - for (GT_MetaTileEntity_Hatch_Input tHatch : mMiddleInputHatches) { - tHatch.mRecipeMap = getRecipeMap(); - if (isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) { - FluidStack tStack = tHatch.getFillableStack(); - if (GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tStack)) { - rList.add(tStack); + for (final GT_MetaTileEntity_Hatch_Input tHatch : mMiddleInputHatches) { + if (isValidMetaTileEntity(tHatch)) { + tHatch.mRecipeMap = getRecipeMap(); + if (tHatch instanceof GT_MetaTileEntity_Hatch_MultiInput) { + for (final FluidStack tFluid : ((GT_MetaTileEntity_Hatch_MultiInput) tHatch).getStoredFluid()) { + if (tFluid != null && GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tFluid)) { + rList.add(tFluid); + } + } + } else { + if (tHatch.getFillableStack() != null) { + final FluidStack tStack = tHatch.getFillableStack(); + if (GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tStack)) { + rList.add(tStack); + } + } } } } -- cgit From 45be4976cf6bbfaf7748829ec8b298ca961fb19f Mon Sep 17 00:00:00 2001 From: Connor Colenso Date: Mon, 4 Sep 2023 02:35:40 +0100 Subject: Bump dep Former-commit-id: a780b1a2fd7f9af9a7162883206e303a1ce606c4 --- dependencies.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index a01daac671..6694a38a74 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,7 +2,7 @@ dependencies { api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.168:dev') - api("com.github.GTNewHorizons:TecTech:5.2.35:dev") + api("com.github.GTNewHorizons:TecTech:5.2.41:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.9:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } @@ -11,4 +11,5 @@ dependencies { compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.24-pre:dev") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.12-GTNH:api") {transitive = false} + } -- cgit From 56b498e1733d03a65965633cd03a447ca4a7fcbd Mon Sep 17 00:00:00 2001 From: boubou19 Date: Wed, 6 Sep 2023 21:14:27 +0200 Subject: migrate recipes to RA2 (#349) * deprecate getMachineVoltageFromTier * migrate assembler recipes * migrate mixer recipes * migrate implosion compressor recipes * migrate forming press recipes * forgot an assembling recipe * migrate blast furnace recipes * migrate universal chemical reactor recipes * migrate fluid extractor recipes * migrate bending machine recipes * migrate assembling line recipes * migrate autoclave recipes * migrate chemical bath recipes * get rid of BW_Util.getMachineVoltageFromTier(3) * get rid of BW_Util.getMachineVoltageFromTier(1) * get rid of BW_Util.getMachineVoltageFromTier(2) * get rid of BW_Util.getMachineVoltageFromTier(4) * get rid of BW_Util.getMachineVoltageFromTier(5) * get rid of BW_Util.getMachineVoltageFromTier(6) * get rid of BW_Util.getMachineVoltageFromTier(7) * get rid of BW_Util.getMachineVoltageFromTier(8) * get rid of BW_Util.getMachineVoltageFromTier(9) * get rid of BW_Util.getMachineVoltageFromTier(10) * get rid of BW_Util.getMachineVoltageFromTier(11) * get rid of BW_Util.getMachineVoltageFromTier(12) * migrate fluid solidifier recipes * migrate forge hammer recipes * migrate pulveriser recipes (1/3) * migrate electrolyser recipes * migrate electromagnetic separator recipes * migrate extruder recipes * migrate packager recipes * migrate primitive blast furnace recipes * migrate vacuum freezer recipes * migrate wiremill recipes * migrate cutting machine recipes * migrate lathe recipes * migrate laser engraver recipes * migrate fluid canner recipes * migrate pulverizer recipes (2/3) * migrate extractor recipes * migrate arc furnace recipes * migrate sifter recipes * migrate compressor recipes * fix duration * migrate fluid extractor recipes * migrate centrifuge recipes * migrate autoclave recipes * spotless apply * resolved build issues related to output chances of recycling "aHTGR_Materials" * resolved build issues related to output chances of recycling "Burned out TRISO pebble (Uranium)" * spotless * migrate fluid heater recipes * bump GT version * fix time and eu/t of centrifuge recipes * fix time and eu/t of centrifuge recipes * spotlessApply (#356) Co-authored-by: GitHub GTNH Actions <> * add a todo for chem rebalance issues in electrolyser recipes * fix typo --------- Co-authored-by: Kyium Co-authored-by: chochem <40274384+chochem@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Former-commit-id: cf3cb4bc6838158ed55daca3cf6a052ea02ac0a0 --- dependencies.gradle | 2 +- .../bartworks/API/BioObjectAdder.java | 31 +- .../common/loaders/ArtificialMicaLine.java | 254 +++---- .../bartworks/common/loaders/BioRecipeLoader.java | 29 +- .../bartworks/common/loaders/FluidLoader.java | 22 +- .../common/loaders/StaticRecipeChangeLoaders.java | 3 +- .../common/loaders/recipes/Assembler.java | 314 +++++---- .../common/loaders/recipes/AssemblyLine.java | 74 +- .../common/loaders/recipes/Autoclave.java | 31 +- .../common/loaders/recipes/Centrifuge.java | 212 ++---- .../common/loaders/recipes/ChemicalBath.java | 104 ++- .../common/loaders/recipes/ChemicalReactor.java | 20 +- .../common/loaders/recipes/Electrolyzer.java | 265 +++---- .../common/loaders/recipes/Extractor.java | 22 +- .../common/loaders/recipes/FluidHeater.java | 16 +- .../common/loaders/recipes/FluidSolidifier.java | 118 ++-- .../common/loaders/recipes/FormingPress.java | 79 ++- .../common/loaders/recipes/LaserEngraver.java | 17 +- .../bartworks/common/loaders/recipes/Mixer.java | 50 +- .../common/loaders/recipes/Pulverizer.java | 113 ++- .../common/loaders/recipes/PyrolyseOven.java | 4 +- .../tileentities/multis/GT_TileEntity_HTGR.java | 4 +- .../tileentities/multis/GT_TileEntity_THTR.java | 4 +- .../system/material/BW_MetaGeneratedFrames.java | 16 +- .../material/CircuitGeneration/BW_Meta_Items.java | 20 +- .../CircuitGeneration/CircuitPartLoader.java | 15 +- .../GT_Enhancement/GTMetaItemEnhancer.java | 35 +- .../GT_Enhancement/PlatinumSludgeOverHaul.java | 765 +++++++++------------ .../material/processingLoaders/AddSomeRecipes.java | 105 ++- .../processingLoaders/AdditionalRecipes.java | 116 ++-- .../werkstoff_loaders/recipe/BlockLoader.java | 34 +- .../werkstoff_loaders/recipe/CasingLoader.java | 28 +- .../werkstoff_loaders/recipe/CellLoader.java | 55 +- .../recipe/CraftingMaterialLoader.java | 211 +++--- .../werkstoff_loaders/recipe/CrushedLoader.java | 202 +++--- .../werkstoff_loaders/recipe/DustLoader.java | 156 +++-- .../werkstoff_loaders/recipe/GemLoader.java | 175 +++-- .../werkstoff_loaders/recipe/MetalLoader.java | 19 +- .../werkstoff_loaders/recipe/MoltenCellLoader.java | 294 ++++---- .../recipe/MultipleMetalLoader.java | 12 +- .../werkstoff_loaders/recipe/OreLoader.java | 12 +- .../recipe/SimpleMetalLoader.java | 126 ++-- .../werkstoff_loaders/recipe/ToolLoader.java | 137 ++-- .../bartimaeusnek/bartworks/util/BW_Util.java | 1 + 44 files changed, 2016 insertions(+), 2306 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 6694a38a74..dc3f22e527 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.168:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.02:dev') api("com.github.GTNewHorizons:TecTech:5.2.41:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.9:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java index fb1e8c085f..bd336c265f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -14,6 +14,8 @@ package com.github.bartimaeusnek.bartworks.API; import static gregtech.api.enums.Mods.Gendustry; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import java.awt.*; @@ -28,18 +30,13 @@ import com.github.bartimaeusnek.bartworks.util.BioPlasmid; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; +import gregtech.api.enums.TierEU; import gregtech.api.objects.GT_Fluid; import gregtech.api.util.GT_Utility; @SuppressWarnings("ALL") public final class BioObjectAdder { - // @Deprecated - // public static BioCulture createAndRegisterBioCulture(Color color, String name, long ID, BioPlasmid plasmid, - // BioDNA dna, EnumRarity rarity){ - // return BioCulture.createAndRegisterBioCulture(color,name,ID,plasmid,dna,rarity); - // } - /** * @param color the color of the Culture * @param name the name of the Culture @@ -176,22 +173,14 @@ public final class BioObjectAdder { "molten.autogenerated", new short[] { (short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen() })); - if (!FluidRegistry.registerFluid(B.getFluid())) + + if (!FluidRegistry.registerFluid(B.getFluid())) { new Exception("FAILED TO REGISTER FLUID FOR: " + B.getName()).printStackTrace(); - GT_Values.RA.addCentrifugeRecipe( - GT_Utility.getIntegratedCircuit(10), - GT_Values.NI, - new FluidStack(B.getFluid(), 1000), - dnaFluid, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - null, - 500, - 120); + } + + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)).noItemOutputs() + .fluidInputs(new FluidStack(B.getFluid(), 1000)).fluidOutputs(dnaFluid).duration(25 * SECONDS) + .eut(TierEU.RECIPE_MV).addTo(sCentrifugeRecipes); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java index afc306280f..0754d514b2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java @@ -1,6 +1,14 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import static gregtech.api.enums.Mods.NewHorizonsCoreMod; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBenderRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBlastRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMixerRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; +import static gregtech.api.util.GT_RecipeConstants.COIL_HEAT; +import static gregtech.api.util.GT_RecipeConstants.UniversalChemical; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -12,6 +20,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -20,157 +29,106 @@ public class ArtificialMicaLine { public static void runArtificialMicaRecipe() { // Mg + O = MgO - GT_Values.RA.addChemicalRecipe( - Materials.Magnesium.getDust(1), - null, - Materials.Oxygen.getGas(1000), - null, - Materials.Magnesia.getDust(2), - 40, - 8); + + GT_Values.RA.stdBuilder().itemInputs(Materials.Magnesium.getDust(1)).itemOutputs(Materials.Magnesia.getDust(2)) + .fluidInputs(Materials.Oxygen.getGas(1000)).noFluidOutputs().duration(2 * SECONDS).eut(8) + .addTo(UniversalChemical); // Si + 6HF = H2SiF6 + 4H - GT_Values.RA.addChemicalRecipe( - Materials.Silicon.getDust(1), - Materials.Empty.getCells(4), - Materials.HydrofluoricAcid.getFluid(6000), - WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000), - Materials.Hydrogen.getCells(4), - 400, - 120); + + GT_Values.RA.stdBuilder().itemInputs(Materials.Silicon.getDust(1), Materials.Empty.getCells(4)) + .itemOutputs(Materials.Hydrogen.getCells(4)).fluidInputs(Materials.HydrofluoricAcid.getFluid(6000)) + .fluidOutputs(WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000)).duration(20 * SECONDS) + .eut(TierEU.RECIPE_MV).addTo(UniversalChemical); // K + Cl = KCl - GT_Values.RA.addChemicalRecipe( - Materials.Potassium.getDust(1), - GT_Utility.getIntegratedCircuit(2), - Materials.Chlorine.getGas(1000), - null, - Materials.RockSalt.getDust(2), - 20, - 8); + + GT_Values.RA.stdBuilder().itemInputs(Materials.Potassium.getDust(1), GT_Utility.getIntegratedCircuit(2)) + .itemOutputs(Materials.RockSalt.getDust(2)).fluidInputs(Materials.Chlorine.getGas(1000)) + .noFluidOutputs().duration(20 * TICKS).eut(8).addTo(UniversalChemical); + // 2KCl + H2SiF6 = 2HCl + K2SiF6 - GT_Values.RA.addMixerRecipe( - Materials.RockSalt.getDust(4), - null, - null, - null, - WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000), - Materials.HydrochloricAcid.getGas(2000), - WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 9), - 20, - 8); + GT_Values.RA.stdBuilder().itemInputs(Materials.RockSalt.getDust(4)) + .itemOutputs(WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 9)) + .fluidInputs(WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000)) + .fluidOutputs(Materials.HydrochloricAcid.getGas(2000)).duration(1 * SECONDS).eut(8) + .addTo(sMixerRecipes); + // 2K + CO2 + O = K2CO3 - GT_Values.RA.addChemicalRecipe( - Materials.Potassium.getDust(2), - Materials.CarbonDioxide.getCells(1), - Materials.Oxygen.getGas(1000), - null, - WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), - Materials.Empty.getCells(1), - 40, - 8); + + GT_Values.RA.stdBuilder().itemInputs(Materials.Potassium.getDust(2), Materials.CarbonDioxide.getCells(1)) + .itemOutputs(WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), Materials.Empty.getCells(1)) + .fluidInputs(Materials.Oxygen.getGas(1000)).noFluidOutputs().duration(2 * SECONDS).eut(8) + .addTo(UniversalChemical); // K2O + CO2 = K2CO3 - GT_Values.RA.addChemicalRecipe( - Materials.Potash.getDust(3), - Materials.CarbonDioxide.getCells(1), - null, - null, - WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), - Materials.Empty.getCells(1), - 40, - 8); + + GT_Values.RA.stdBuilder().itemInputs(Materials.Potash.getDust(3), Materials.CarbonDioxide.getCells(1)) + .itemOutputs(WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), Materials.Empty.getCells(1)) + .noFluidInputs().noFluidOutputs().duration(2 * SECONDS).eut(8).addTo(UniversalChemical); + // 55Quartz Dust + 20K2SiF6 + 12Al2O3 + 4K2CO3 = 91Raw Fluorophlogopite Dust - GT_Values.RA.addMixerRecipe( - Materials.QuartzSand.getDust(55), - WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), - WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), - WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), - null, - GT_Utility.getIntegratedCircuit(4), - null, - null, - null, - null, - null, - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), - null, - null, - 400, - 120); + GT_Values.RA.stdBuilder() + .itemInputs( + Materials.QuartzSand.getDust(55), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), + WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), + GT_Utility.getIntegratedCircuit(4)) + .itemOutputs( + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27)) + .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sMixerRecipes); + // 55Quartzite/Nether Quartz Dust + 20K2SiF6 + 57Al2O3 + 4K2CO3 = 136Raw Fluorophlogopite Dust - GT_Values.RA.addMixerRecipe( - Materials.Quartzite.getDust(55), - WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), - WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), - WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), - null, - GT_Utility.getIntegratedCircuit(4), - null, - null, - null, - null, - null, - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8), - null, - 600, - 120); - GT_Values.RA.addMixerRecipe( - Materials.NetherQuartz.getDust(55), - WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), - WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), - WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), - null, - GT_Utility.getIntegratedCircuit(4), - null, - null, - null, - null, - null, - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8), - null, - 600, - 120); + GT_Values.RA.stdBuilder() + .itemInputs( + Materials.Quartzite.getDust(55), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), + WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), + GT_Utility.getIntegratedCircuit(4)) + .itemOutputs( + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8)) + .fluidInputs().fluidOutputs().duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sMixerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + Materials.NetherQuartz.getDust(55), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), + WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), + GT_Utility.getIntegratedCircuit(4)) + .itemOutputs( + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8)) + .noFluidInputs().noFluidOutputs().duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sMixerRecipes); + // 62Certus Quartz Dust + 10K2SiF6 + 12Al2O3 + 7K2CO3 = 91Raw Fluorophlogopite Dust - GT_Values.RA.addMixerRecipe( - Materials.CertusQuartz.getDust(62), - WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 10), - WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), - WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 7), - null, - GT_Utility.getIntegratedCircuit(4), - null, - null, - null, - null, - null, - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), - null, - null, - 600, - 120); + GT_Values.RA.stdBuilder() + .itemInputs( + Materials.CertusQuartz.getDust(62), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 10), + WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 7), + GT_Utility.getIntegratedCircuit(4)) + .itemOutputs( + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27)) + .noFluidInputs().noFluidOutputs().duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sMixerRecipes); + // MgO(s) = MgO(l) - GT_Values.RA.addFluidExtractionRecipe( - Materials.Magnesia.getDust(1), - null, - Materials.Magnesia.getMolten(144), - 0, - 20, - 120); + + GT_Values.RA.stdBuilder().itemInputs(Materials.Magnesia.getDust(1)).noItemOutputs().noFluidInputs() + .fluidOutputs(Materials.Magnesia.getMolten(144)).duration(20 * TICKS).eut(TierEU.RECIPE_MV) + .addTo(sFluidExtractionRecipes); + // 27Raw Fluorophlogopite Dust + 720MgO(l) = 4608Fluorophlogopite(l) - GT_Values.RA.addBlastRecipe( - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), - null, - BW_GT_MaterialReference.Magnesia.getMolten(720), - WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(4608), - Materials.Glass.getDust(1), - null, - 600, - 480, - 1700); + GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27)) + .itemOutputs(Materials.Glass.getDust(1)).fluidInputs(BW_GT_MaterialReference.Magnesia.getMolten(720)) + .fluidOutputs(WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(4608)).duration(30 * SECONDS) + .eut(TierEU.RECIPE_HV).metadata(COIL_HEAT, 1700).addTo(sBlastRecipes); + // 144Fluorophlogopite(l) = Fluorophlogopite GT_Recipe.GT_Recipe_Map.sVacuumRecipes.addRecipe( new GT_Recipe( @@ -186,12 +144,14 @@ public class ArtificialMicaLine { 0)); // Fluorophlogopite = 4Insulator Foil if (NewHorizonsCoreMod.isModLoaded()) { - GT_Values.RA.addBenderRecipe( - WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1), - GT_Utility.getIntegratedCircuit(1), - GT_ModHandler.getModItem(NewHorizonsCoreMod.ID, "item.MicaInsulatorFoil", 4), - 10, - 600); + + GT_Values.RA.stdBuilder() + .itemInputs( + WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1), + GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(GT_ModHandler.getModItem(NewHorizonsCoreMod.ID, "item.MicaInsulatorFoil", 4)) + .noFluidInputs().noFluidOutputs().duration(10 * TICKS).eut(600).addTo(sBenderRecipes); + } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index 54e0d4633e..c4589c3a3f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -27,6 +27,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -49,7 +50,7 @@ public class BioRecipeLoader { new int[] { 3300 }, new FluidStack[] { fluidStack }, 500, - BW_Util.getMachineVoltageFromTier(3), + (int) TierEU.RECIPE_HV, BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( @@ -58,7 +59,7 @@ public class BioRecipeLoader { new int[] { 4500 }, new FluidStack[] { fluidStack }, 500, - BW_Util.getMachineVoltageFromTier(3), + (int) TierEU.RECIPE_HV, BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( @@ -67,7 +68,7 @@ public class BioRecipeLoader { new int[] { 7500 }, new FluidStack[] { fluidStack }, 500, - BW_Util.getMachineVoltageFromTier(3), + (int) TierEU.RECIPE_HV, BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( @@ -76,7 +77,7 @@ public class BioRecipeLoader { new int[] { 2500 }, new FluidStack[] { fluidStack }, 500, - BW_Util.getMachineVoltageFromTier(3), + (int) TierEU.RECIPE_HV, BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( @@ -85,7 +86,7 @@ public class BioRecipeLoader { new int[] { 3300 }, new FluidStack[] { fluidStack }, 500, - BW_Util.getMachineVoltageFromTier(3), + (int) TierEU.RECIPE_HV, BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( @@ -94,7 +95,7 @@ public class BioRecipeLoader { new int[] { 2500 }, new FluidStack[] { fluidStack }, 500, - BW_Util.getMachineVoltageFromTier(3), + (int) TierEU.RECIPE_HV, BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( @@ -103,7 +104,7 @@ public class BioRecipeLoader { new int[] { 3300 }, new FluidStack[] { fluidStack }, 500, - BW_Util.getMachineVoltageFromTier(3), + (int) TierEU.RECIPE_HV, BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( @@ -112,7 +113,7 @@ public class BioRecipeLoader { new int[] { 100 }, new FluidStack[] { fluidStack }, 1500, - BW_Util.getMachineVoltageFromTier(4), + (int) TierEU.RECIPE_EV, BW_Util.STANDART); } } @@ -128,7 +129,7 @@ public class BioRecipeLoader { BioCultureLoader.CommonYeast, new FluidStack[] { FluidRegistry.getFluidStack("potion.ghp", 1) }, 350, - BW_Util.getMachineVoltageFromTier(4)); + (int) TierEU.RECIPE_EV); } BWRecipes.instance.addBacterialVatRecipe( @@ -137,7 +138,7 @@ public class BioRecipeLoader { BioCultureLoader.WhineYeast, new FluidStack[] { FluidRegistry.getFluidStack("potion.wine", 12) }, 200, - BW_Util.getMachineVoltageFromTier(2)); + (int) TierEU.RECIPE_MV); BWRecipes.instance.addBacterialVatRecipe( new ItemStack[] { new ItemStack(Items.sugar, 4), ItemList.IC2_Hops.get(16L), @@ -146,7 +147,7 @@ public class BioRecipeLoader { BioCultureLoader.BeerYeast, new FluidStack[] { FluidRegistry.getFluidStack("potion.beer", 5) }, 600, - BW_Util.getMachineVoltageFromTier(1)); + (int) TierEU.RECIPE_LV); BWRecipes.instance.addBacterialVatRecipe( new ItemStack[] { ItemList.IC2_Hops.get(32L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 16L) }, @@ -154,7 +155,7 @@ public class BioRecipeLoader { BioCultureLoader.BeerYeast, new FluidStack[] { FluidRegistry.getFluidStack("potion.darkbeer", 10) }, 600, - BW_Util.getMachineVoltageFromTier(1)); + (int) TierEU.RECIPE_LV); } } @@ -167,7 +168,7 @@ public class BioRecipeLoader { BioCultureLoader.WhineYeast, new FluidStack[] { FluidRegistry.getFluidStack("potion.wine", 12) }, 400, - BW_Util.getMachineVoltageFromTier(1)); + (int) TierEU.RECIPE_LV); BWRecipes.instance.addBacterialVatRecipe( null, @@ -175,7 +176,7 @@ public class BioRecipeLoader { BioCultureLoader.anaerobicOil, new FluidStack[] { new FluidStack(FluidLoader.fulvicAcid, 1000) }, 2748, - BW_Util.getMachineVoltageFromTier(3)); + (int) TierEU.RECIPE_HV); } public static void runOnServerStarted() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 19d52696ff..017dba8358 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -14,6 +14,8 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import static gregtech.api.enums.Mods.Gendustry; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import java.awt.*; import java.util.Arrays; @@ -36,6 +38,7 @@ import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; +import gregtech.api.enums.TierEU; import gregtech.api.objects.GT_Fluid; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; @@ -93,20 +96,11 @@ public class FluidLoader { FluidRegistry.registerFluid(B.getFluid()); GT_LanguageManager .addStringLocalization(B.getFluid().getUnlocalizedName(), B.getLocalisedName() + " Fluid"); - GT_Values.RA.addCentrifugeRecipe( - GT_Utility.getIntegratedCircuit(10), - GT_Values.NI, - new FluidStack(B.getFluid(), 1000), - dnaFluid, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - null, - 500, - 120); + + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)).noItemOutputs() + .fluidInputs(new FluidStack(B.getFluid(), 1000)).fluidOutputs(dnaFluid).duration(25 * SECONDS) + .eut(TierEU.RECIPE_MV).addTo(sCentrifugeRecipes); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 6f482aaa48..3b145cad5e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -58,6 +58,7 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; +import gregtech.api.enums.TierEU; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -626,7 +627,7 @@ public class StaticRecipeChangeLoaders { null, null, 1, - BW_Util.getMachineVoltageFromTier(10), + (int) TierEU.RECIPE_UEV, 0)); // Custom EIC recipes. diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java index 7d803f154b..ed29a3a7f0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java @@ -1,23 +1,25 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; import static gregtech.api.enums.Mods.GregTech; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; +import static gregtech.api.util.GT_RecipeBuilder.HOURS; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; public class Assembler implements Runnable { @@ -37,86 +39,89 @@ public class Assembler implements Runnable { Materials.SuperconductorUV // UHV }; - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), Materials.Lapis.getPlates(9), + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), + Materials.Lapis.getPlates(9), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2L), - GT_Utility.getIntegratedCircuit(17) }, - FluidRegistry.getFluidStack("ic2coolant", 1000), - new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), - 100, - BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), Materials.Lapis.getBlocks(8), - GT_Utility.getIntegratedCircuit(17) }, - GT_Values.NF, - new ItemStack(ItemRegistry.BW_BLOCKS[1]), - 100, - BW_Util.getMachineVoltageFromTier(3)); - - GT_Values.RA.addAssemblerRecipe( - GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1000), - GT_Utility.getIntegratedCircuit(17), - Materials.SolderingAlloy.getMolten(9216), - ItemRegistry.megaMachines[0], - 72000, - BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe( - GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1002), - GT_Utility.getIntegratedCircuit(17), - Materials.SolderingAlloy.getMolten(9216), - ItemRegistry.megaMachines[1], - 72000, - BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe( - GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1126), - GT_Utility.getIntegratedCircuit(17), - Materials.SolderingAlloy.getMolten(9216), - ItemRegistry.megaMachines[2], - 72000, - BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe( - GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1169), - GT_Utility.getIntegratedCircuit(17), - Materials.SolderingAlloy.getMolten(9216), - ItemRegistry.megaMachines[3], - 72000, - BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe( - GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1160), - GT_Utility.getIntegratedCircuit(17), - Materials.SolderingAlloy.getMolten(9216), - ItemRegistry.megaMachines[4], - 72000, - BW_Util.getMachineVoltageFromTier(3)); - - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), - GT_Utility.getIntegratedCircuit(17) }, - Materials.Plastic.getMolten(1152L), - new ItemStack(ItemRegistry.BW_BLOCKS[2], 1, 1), - 20, - BW_Util.getMachineVoltageFromTier(3)); - - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), - Materials.Aluminium.getPlates(1), ItemList.Circuit_Board_Plastic.get(1L), - ItemList.Battery_RE_LV_Lithium.get(1L) }, - Materials.SolderingAlloy.getMolten(288L), - new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER), - 600, - BW_Util.getMachineVoltageFromTier(2)); - - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { ItemList.Circuit_Parts_GlassFiber.get(32), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1)) + .fluidInputs(FluidRegistry.getFluidStack("ic2coolant", 1000)).noFluidOutputs().duration(5 * SECONDS) + .eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), + Materials.Lapis.getBlocks(8), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[1])).noFluidInputs().noFluidOutputs() + .duration(5 * SECONDS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1000), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(ItemRegistry.megaMachines[0]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) + .noFluidOutputs().duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1002), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(ItemRegistry.megaMachines[1]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) + .noFluidOutputs().duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1126), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(ItemRegistry.megaMachines[2]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) + .noFluidOutputs().duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1169), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(ItemRegistry.megaMachines[3]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) + .noFluidOutputs().duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1160), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(ItemRegistry.megaMachines[4]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) + .noFluidOutputs().duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[2], 1, 1)) + .fluidInputs(Materials.Plastic.getMolten(1152L)).noFluidOutputs().duration(1 * TICKS) + .eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), + Materials.Aluminium.getPlates(1), + ItemList.Circuit_Board_Plastic.get(1L), + ItemList.Battery_RE_LV_Lithium.get(1L)) + .itemOutputs(new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER)) + .fluidInputs(Materials.SolderingAlloy.getMolten(288L)).noFluidOutputs().duration(30 * SECONDS) + .eut(TierEU.RECIPE_MV).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + ItemList.Circuit_Parts_GlassFiber.get(32), GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Electrum, 8), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2) }, - Materials.Polytetrafluoroethylene.getMolten(72), - new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - 1, - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - 200, - BW_Util.getMachineVoltageFromTier(4)); + WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2)) + .itemOutputs( + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + 1, + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage())) + .fluidInputs(Materials.Polytetrafluoroethylene.getMolten(72)).noFluidOutputs().duration(10 * SECONDS) + .eut(TierEU.RECIPE_EV).addTo(sAssemblerRecipes); ItemStack[][] converters = ItemRegistry.TecTechLaserAdditions[0]; ItemStack[][] input = ItemRegistry.TecTechLaserAdditions[1]; @@ -134,91 +139,98 @@ public class Assembler implements Runnable { ItemStack converter = converters[j][i]; ItemStack eInput = input[j][i]; ItemStack eDynamo = dynamo[j][i]; + long recipeConsumption; + switch (i) { + case 0: + recipeConsumption = TierEU.RECIPE_EV; + break; + case 1: + recipeConsumption = TierEU.RECIPE_IV; + break; + case 2: + recipeConsumption = TierEU.RECIPE_LuV; + break; + case 3: + recipeConsumption = TierEU.RECIPE_ZPM; + break; + default: + recipeConsumption = TierEU.RECIPE_EV; + break; + } int solderingAmount = Math.max(144 * i, 72) * (j + 1); - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - ((j + 1) * 16), - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), emitters[i].get(2 * (j + 1)), - sensors[i].get(2 * (j + 1)), ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1)), }, - Materials.SolderingAlloy.getMolten(solderingAmount), - converter, - 200 * (j + 1), - BW_Util.getMachineVoltageFromTier(4 + i)); - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { + + GT_Values.RA.stdBuilder().itemInputs( + + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + ((j + 1) * 16), + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + emitters[i].get(2 * (j + 1)), + sensors[i].get(2 * (j + 1)), + ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1))).itemOutputs(converter) + .fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)).noFluidOutputs() + .duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( new ItemStack( ItemRegistry.TecTechPipeEnergyLowPower.getItem(), ((j + 1) * 16), ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), sensors[i].get(2 * (j + 1)), - ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1)), }, - Materials.SolderingAlloy.getMolten(solderingAmount), - eInput, - 200 * (j + 1), - BW_Util.getMachineVoltageFromTier(4 + i)); - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + sensors[i].get(2 * (j + 1)), + ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1))) + .itemOutputs(eInput).fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) + .noFluidOutputs().duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption) + .addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( new ItemStack( ItemRegistry.TecTechPipeEnergyLowPower.getItem(), ((j + 1) * 16), ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), emitters[i].get(2 * (j + 1)), - ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1)), }, - Materials.SolderingAlloy.getMolten(solderingAmount), - eDynamo, - 200 * (j + 1), - BW_Util.getMachineVoltageFromTier(4 + i)); + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + emitters[i].get(2 * (j + 1)), + ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1))) + .itemOutputs(eDynamo).fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) + .noFluidOutputs().duration((10 * (j + 1) * SECONDS)).eut(recipeConsumption) + .addTo(sAssemblerRecipes); } } - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add( - new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[] { ItemList.Hatch_Input_HV.get(64), Materials.LiquidAir.getCells(1), - GT_Utility.getIntegratedCircuit(17) }, - new ItemStack[] { ItemRegistry.compressedHatch.copy() }, - null, - null, - null, - null, - 300, - BW_Util.getMachineVoltageFromTier(3), - 0)); - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add( - new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[] { ItemList.Hatch_Output_HV.get(64), GT_Utility.getIntegratedCircuit(17) }, - new ItemStack[] { ItemRegistry.giantOutputHatch.copy() }, - null, - null, - null, - null, - 300, - BW_Util.getMachineVoltageFromTier(3), - 0)); - - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 6), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1) }, - Materials.Concrete.getMolten(1296), - new ItemStack(GregTech_API.sBlockCasings3, 1, 12), - 40, - BW_Util.getMachineVoltageFromTier(5)); - - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { new ItemStack(GregTech_API.sBlockCasings3, 1, 12), + GT_Values.RA.stdBuilder() + .itemInputs( + ItemList.Hatch_Input_HV.get(64), + Materials.LiquidAir.getCells(1), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(ItemRegistry.compressedHatch.copy()).noFluidInputs().noFluidOutputs() + .duration(15 * SECONDS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(ItemList.Hatch_Output_HV.get(64), GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(ItemRegistry.giantOutputHatch.copy()).noFluidInputs().noFluidOutputs() + .duration(15 * SECONDS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 6), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1)) + .itemOutputs(new ItemStack(GregTech_API.sBlockCasings3, 1, 12)) + .fluidInputs(Materials.Concrete.getMolten(1296)).noFluidOutputs().duration(2 * SECONDS) + .eut(TierEU.RECIPE_IV).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(GregTech_API.sBlockCasings3, 1, 12), GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Europium, 6), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 24) }, - Materials.Lead.getMolten(864), - new ItemStack(GregTech_API.sBlockCasings8, 1, 5), - 200, - BW_Util.getMachineVoltageFromTier(6)); + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 24)) + .itemOutputs(new ItemStack(GregTech_API.sBlockCasings8, 1, 5)) + .fluidInputs(Materials.Lead.getMolten(864)).noFluidOutputs().duration(10 * SECONDS) + .eut(TierEU.RECIPE_LuV).addTo(sAssemblerRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java index a8a879a3fc..860204d4a7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java @@ -1,16 +1,19 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; import static gregtech.api.enums.Mods.GalactiGreg; +import static gregtech.api.util.GT_RecipeBuilder.HOURS; import static gregtech.api.util.GT_RecipeBuilder.MINUTES; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeConstants.AssemblyLine; +import static gregtech.api.util.GT_RecipeConstants.RESEARCH_ITEM; +import static gregtech.api.util.GT_RecipeConstants.RESEARCH_TIME; -import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -26,47 +29,46 @@ public class AssemblyLine implements Runnable { Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null ? FluidRegistry.getFluid("molten.indalloy140") : FluidRegistry.getFluid("molten.solderingalloy"); - - GT_Values.RA.addAssemblylineRecipe( - ItemList.Pump_IV.get(1L), - 72000, - new ItemStack[] { ItemList.Pump_IV.get(16), + GT_Values.RA.stdBuilder().metadata(RESEARCH_ITEM, ItemList.Pump_IV.get(1L)).metadata(RESEARCH_TIME, 1 * HOURS) + .itemInputs( + ItemList.Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 32L), GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), - ItemList.Field_Generator_LuV.get(8) }, - new FluidStack[] { new FluidStack(solderIndalloy, 32 * 144), - Materials.Polytetrafluoroethylene.getMolten(32 * 144) }, - ItemRegistry.dehp, - 5000, - BW_Util.getMachineVoltageFromTier(6)); + ItemList.Field_Generator_LuV.get(8)) + .fluidInputs( + new FluidStack(solderIndalloy, 32 * 144), + Materials.Polytetrafluoroethylene.getMolten(32 * 144)) + .noFluidOutputs().itemOutputs(ItemRegistry.dehp).eut(TierEU.RECIPE_LuV) + .duration(4 * MINUTES + 10 * SECONDS).addTo(AssemblyLine); if (GalactiGreg.isModLoaded()) { - GT_Values.RA.addAssemblylineRecipe( - ItemList.OreDrill4.get(1L), - (int) TierEU.RECIPE_LuV, - new Object[] { ItemList.OreDrill4.get(1L), + GT_Values.RA.stdBuilder().metadata(RESEARCH_ITEM, ItemList.OreDrill4.get(1L)) + .metadata(RESEARCH_TIME, 25 * MINUTES + 36 * SECONDS) + .itemInputs( + ItemList.OreDrill4.get(1L), GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 9L), - Materials.Europium.getPlates(3), ItemList.Electric_Motor_LuV.get(9L), - ItemList.Sensor_LuV.get(9L), ItemList.Field_Generator_LuV.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 36L) }, - new FluidStack[] { new FluidStack(solderIndalloy, 1440), - WerkstoffLoader.Neon.getFluidOrGas(20000), }, - ItemRegistry.voidminer[0].copy(), - 5 * MINUTES, - (int) TierEU.RECIPE_LuV); + Materials.Europium.getPlates(3), + ItemList.Electric_Motor_LuV.get(9L), + ItemList.Sensor_LuV.get(9L), + ItemList.Field_Generator_LuV.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 36L)) + .fluidInputs(new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Neon.getFluidOrGas(20000)) + .noFluidOutputs().itemOutputs(ItemRegistry.voidminer[0].copy()).eut(TierEU.RECIPE_LuV) + .duration(5 * MINUTES).addTo(AssemblyLine); } - GT_Values.RA.addAssemblylineRecipe( - ItemList.Machine_LuV_CircuitAssembler.get(1L), - 24000, - new ItemStack[] { ItemList.Machine_LuV_CircuitAssembler.get(1L), ItemList.Robot_Arm_LuV.get(4L), - ItemList.Electric_Motor_LuV.get(4L), ItemList.Field_Generator_LuV.get(1L), - ItemList.Emitter_LuV.get(1L), ItemList.Sensor_LuV.get(1L), - WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.plate, 8) }, - new FluidStack[] { new FluidStack(solderIndalloy, 1440) }, - ItemRegistry.cal.copy(), - 24000, - BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.stdBuilder().metadata(RESEARCH_ITEM, ItemList.Machine_LuV_CircuitAssembler.get(1L)) + .metadata(RESEARCH_TIME, 20 * MINUTES) + .itemInputs( + ItemList.Machine_LuV_CircuitAssembler.get(1L), + ItemList.Robot_Arm_LuV.get(4L), + ItemList.Electric_Motor_LuV.get(4L), + ItemList.Field_Generator_LuV.get(1L), + ItemList.Emitter_LuV.get(1L), + ItemList.Sensor_LuV.get(1L), + WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.plate, 8)) + .fluidInputs(new FluidStack(solderIndalloy, 1440)).noFluidOutputs().itemOutputs(ItemRegistry.cal.copy()) + .eut(TierEU.RECIPE_LuV).duration(20 * MINUTES).addTo(AssemblyLine); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java index 3771a261ae..7d32af49a6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java @@ -1,14 +1,17 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; + import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; +import gregtech.api.enums.TierEU; public class Autoclave implements Runnable { @@ -16,21 +19,17 @@ public class Autoclave implements Runnable { public void run() { Materials[] sterilizers = { Materials.Ammonia, Materials.Chlorine, Materials.Ethanol, Materials.Methanol }; for (Materials used : sterilizers) { - GT_Values.RA.addAutoclaveRecipe( - ItemList.Circuit_Parts_PetriDish.get(1L), - used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L), - BioItemList.getPetriDish(null), - 10000, - 100, - BW_Util.getMachineVoltageFromTier(1)); - - GT_Values.RA.addAutoclaveRecipe( - new ItemStack(Items.glass_bottle), - used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L), - BioItemList.getDNASampleFlask(null), - 10000, - 100, - BW_Util.getMachineVoltageFromTier(1)); + + GT_Values.RA.stdBuilder().itemInputs(ItemList.Circuit_Parts_PetriDish.get(1L)) + .itemOutputs(BioItemList.getPetriDish(null)) + .fluidInputs(used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L)).noFluidOutputs() + .duration(5 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sAutoclaveRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(Items.glass_bottle)) + .itemOutputs(BioItemList.getDNASampleFlask(null)) + .fluidInputs(used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L)).noFluidOutputs() + .duration(5 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sAutoclaveRecipes); + } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java index c80c708b5e..776d6a1a2a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java @@ -2,6 +2,9 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.MATERIALS_PER_FUEL; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.sHTGR_Fuel; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; +import static gregtech.api.util.GT_RecipeBuilder.MINUTES; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import java.util.Arrays; @@ -14,164 +17,99 @@ import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_Recipe; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_Utility; public class Centrifuge implements Runnable { @Override public void run() { - - GT_Values.RA.addCentrifugeRecipe( - Materials.Thorium.getDust(1), - GT_Values.NI, - GT_Values.NF, - GT_Values.NF, - Materials.Thorium.getDust(1), - Materials.Thorium.getDust(1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), - GT_Values.NI, - new int[] { 800, 375, 22, 22, 5 }, - 10000, - BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.stdBuilder().itemInputs(Materials.Thorium.getDust(1)) + .itemOutputs( + Materials.Thorium.getDust(1), + Materials.Thorium.getDust(1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1)) + .outputChances(800, 375, 22, 22, 5).noFluidInputs().noFluidOutputs() + .duration(8 * MINUTES + 20 * SECONDS).eut(TierEU.RECIPE_EV).addTo(sCentrifugeRecipes); ItemStack[] pellets = new ItemStack[6]; Arrays.fill(pellets, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 4)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( - false, - new ItemStack[] { new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3), - GT_Utility.getIntegratedCircuit(17) }, - pellets, - null, - null, - null, - null, - 48000, - 30, - 0); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( - false, - new ItemStack[] { new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 5), - GT_Utility.getIntegratedCircuit(17) }, - new ItemStack[] { new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 6) }, - null, - null, - null, - null, - 48000, - 30, - 0); - GT_Values.RA.addCentrifugeRecipe( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 6), - GT_Values.NI, - GT_Values.NF, - GT_Values.NF, - Materials.Lead.getDust(1), - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - new int[] { 300 }, - 1200, - 30); + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(pellets).noFluidInputs().noFluidOutputs().duration(40 * MINUTES).eut(TierEU.RECIPE_LV) + .addTo(sCentrifugeRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 5), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 6)).noFluidInputs() + .noFluidOutputs().duration(40 * MINUTES).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 6)) + .itemOutputs(Materials.Lead.getDust(1)).outputChances(300).noFluidInputs().noFluidOutputs() + .duration(60 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); + int i = 0; for (GT_TileEntity_HTGR.HTGRMaterials.Fuel_ fuel : sHTGR_Fuel) { - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( - false, - new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), - GT_Utility.getIntegratedCircuit(17) }, - new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4) }, - null, - null, - null, - null, - 12000, - 30, - 0); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( - false, - new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5), - GT_Utility.getIntegratedCircuit(17) }, - new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 6) }, - null, - null, - null, - null, - 3000, - 30, - 0); - - GT_Values.RA.addCentrifugeRecipe( - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 6), - GT_Values.NI, - GT_Values.NF, - fuel.recycledFluid, - fuel.recycledItems[0], - fuel.recycledItems[1], - fuel.recycledItems[2], - fuel.recycledItems[3], - fuel.recycledItems[4], - fuel.recycledItems[5], - fuel.recycleChances, - 1200, - 30); + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4)) + .noFluidInputs().noFluidOutputs().duration(10 * MINUTES).eut(TierEU.RECIPE_LV) + .addTo(sCentrifugeRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 6)) + .noFluidInputs().noFluidOutputs().duration(2 * MINUTES + 30 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(sCentrifugeRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 6)) + .itemOutputs( + fuel.recycledItems[0], + fuel.recycledItems[1], + fuel.recycledItems[2], + fuel.recycledItems[3], + fuel.recycledItems[4]) + .outputChances(fuel.recycleChances).noFluidInputs().fluidOutputs(fuel.recycledFluid) + .duration(60 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); + i += MATERIALS_PER_FUEL; } - GT_Values.RA.addCentrifugeRecipe( - GT_Utility.getIntegratedCircuit(17), - null, - new FluidStack(BioCultureLoader.eColi.getFluid(), 1000), - new FluidStack(FluidLoader.BioLabFluidMaterials[1], 10), - BioItemList.getOther(4), - null, - null, - null, - null, - null, - new int[] { 1000 }, - 60 * 20, - BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addCentrifugeRecipe( - GT_Utility.getIntegratedCircuit(17), - null, - new FluidStack(FluidLoader.BioLabFluidMaterials[1], 1000), - new FluidStack(FluidLoader.BioLabFluidMaterials[3], 250), - null, - null, - null, - null, - null, - null, - null, - 60 * 20, - BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addCentrifugeRecipe( - GT_Utility.getIntegratedCircuit(17), - null, - new FluidStack(BioCultureLoader.CommonYeast.getFluid(), 1000), - new FluidStack(FluidLoader.BioLabFluidMaterials[2], 10), - null, - null, - null, - null, - null, - null, - null, - 60 * 20, - BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(17)).itemOutputs(BioItemList.getOther(4)) + .fluidInputs(new FluidStack(BioCultureLoader.eColi.getFluid(), 1000)) + .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[1], 10)).duration(60 * SECONDS) + .eut(TierEU.RECIPE_HV).addTo(sCentrifugeRecipes); + + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(17)).noItemOutputs() + .fluidInputs(new FluidStack(FluidLoader.BioLabFluidMaterials[1], 1000)) + .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[3], 250)).duration(60 * SECONDS) + .eut(TierEU.RECIPE_HV).addTo(sCentrifugeRecipes); + + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(17)).noItemOutputs() + .fluidInputs(new FluidStack(BioCultureLoader.CommonYeast.getFluid(), 1000)) + .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[2], 10)).duration(60 * SECONDS) + .eut(TierEU.RECIPE_HV).addTo(sCentrifugeRecipes); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java index 15cd43e321..b2e8e59868 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java @@ -1,5 +1,9 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; + import net.minecraft.item.ItemStack; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; @@ -14,72 +18,46 @@ public class ChemicalBath implements Runnable { public void run() { for (int i = 0; i < Dyes.dyeBrown.getSizeOfFluidList(); ++i) { - GT_Values.RA.addChemicalBathRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Dyes.dyeRed.getFluidDye(i, 36), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 6), - null, - null, - null, - 64, - 2); - GT_Values.RA.addChemicalBathRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Dyes.dyeGreen.getFluidDye(i, 36), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 7), - null, - null, - null, - 64, - 2); - GT_Values.RA.addChemicalBathRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Dyes.dyePurple.getFluidDye(i, 36), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 8), - null, - null, - null, - 64, - 2); - GT_Values.RA.addChemicalBathRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Dyes.dyeYellow.getFluidDye(i, 36), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 9), - null, - null, - null, - 64, - 2); - GT_Values.RA.addChemicalBathRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Dyes.dyeLime.getFluidDye(i, 36), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 10), - null, - null, - null, - 64, - 2); - GT_Values.RA.addChemicalBathRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Dyes.dyeBrown.getFluidDye(i, 36), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 11), - null, - null, - null, - 64, - 2); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 6)) + .fluidInputs(Dyes.dyeRed.getFluidDye(i, 36)).noFluidOutputs().duration(3 * SECONDS + 4 * TICKS) + .eut(2).addTo(sChemicalBathRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 7)) + .fluidInputs(Dyes.dyeGreen.getFluidDye(i, 36)).noFluidOutputs().duration(3 * SECONDS + 4 * TICKS) + .eut(2).addTo(sChemicalBathRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 8)) + .fluidInputs(Dyes.dyePurple.getFluidDye(i, 36)).noFluidOutputs().duration(3 * SECONDS + 4 * TICKS) + .eut(2).addTo(sChemicalBathRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 9)) + .fluidInputs(Dyes.dyeYellow.getFluidDye(i, 36)).noFluidOutputs().duration(3 * SECONDS + 4 * TICKS) + .eut(2).addTo(sChemicalBathRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 10)) + .fluidInputs(Dyes.dyeLime.getFluidDye(i, 36)).noFluidOutputs().duration(3 * SECONDS + 4 * TICKS) + .eut(2).addTo(sChemicalBathRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 11)) + .fluidInputs(Dyes.dyeBrown.getFluidDye(i, 36)).noFluidOutputs().duration(3 * SECONDS + 4 * TICKS) + .eut(2).addTo(sChemicalBathRecipes); + } for (int i = 6; i < 11; i++) { - GT_Values.RA.addChemicalBathRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, i), - Materials.Chlorine.getGas(50), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - null, - null, - null, - 64, - 2); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, i)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .fluidInputs(Materials.Chlorine.getGas(50)).noFluidOutputs().duration(3 * SECONDS + 4 * TICKS) + .eut(2).addTo(sChemicalBathRecipes); + } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalReactor.java index 6361340fee..01d6e05c5b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalReactor.java @@ -1,24 +1,26 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; +import static gregtech.api.util.GT_RecipeConstants.UniversalChemical; + import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_Utility; public class ChemicalReactor implements Runnable { @Override public void run() { - GT_Values.RA.addChemicalRecipe( - GT_Utility.getIntegratedCircuit(10), - null, - new FluidStack(FluidLoader.heatedfulvicAcid, 1000), - new FluidStack(FluidLoader.Kerogen, 1000), - null, - 75, - BW_Util.getMachineVoltageFromTier(2)); + + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)).noItemOutputs() + .fluidInputs(new FluidStack(FluidLoader.heatedfulvicAcid, 1000)) + .fluidOutputs(new FluidStack(FluidLoader.Kerogen, 1000)).duration(3 * SECONDS + 15 * TICKS) + .eut(TierEU.RECIPE_MV).addTo(UniversalChemical); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java index f9dbbaa53d..18e0138043 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java @@ -1,170 +1,127 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; + import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_OreDictUnificator; public class Electrolyzer implements Runnable { + // TODO: fix the chemical balance issues there are below @Override public void run() { - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.Forsterit.get(OrePrefixes.dust, 7), - GT_Values.NI, - GT_Values.NF, - Materials.Oxygen.getGas(2000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnesium, 2L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - null, - 200, - 90); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.RedZircon.get(OrePrefixes.dust, 6), - GT_Values.NI, - GT_Values.NF, - Materials.Oxygen.getGas(2000L), - WerkstoffLoader.Zirconium.get(OrePrefixes.dust, 1), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - null, - 250, - 90); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.Fayalit.get(OrePrefixes.dust, 7), - GT_Values.NI, - GT_Values.NF, - Materials.Oxygen.getGas(2000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 2L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - null, - 320, - 90); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.Prasiolite.get(OrePrefixes.dust, 16), - GT_Values.NI, - GT_Values.NF, - GT_Values.NF, - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 5L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - null, - 580, - 90); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.Hedenbergit.get(OrePrefixes.dust, 10), - GT_Values.NI, - GT_Values.NF, - Materials.Oxygen.getGas(2000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Calcium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 2L), - GT_Values.NI, - GT_Values.NI, - GT_Values.NI, - null, - 300, - 90); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.FuchsitAL.get(OrePrefixes.dust, 21), - ItemList.Cell_Empty.get(2), - GT_Values.NF, - Materials.Oxygen.getGas(2000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 3L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2), - GT_Values.NI, - GT_Values.NI, - null, - 390, - 120); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.FuchsitCR.get(OrePrefixes.dust, 21), - ItemList.Cell_Empty.get(2), - GT_Values.NF, - Materials.Oxygen.getGas(2000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2), - GT_Values.NI, - GT_Values.NI, - null, - 460, - 120); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.VanadioOxyDravit.get(OrePrefixes.dust, 53), - ItemList.Cell_Empty.get(3), - GT_Values.NF, - Materials.Oxygen.getGas(19000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Vanadium, 3L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), - null, - 710, - 120); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.ChromoAluminoPovondrait.get(OrePrefixes.dust, 53), - ItemList.Cell_Empty.get(3), - GT_Values.NF, - Materials.Oxygen.getGas(19000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), - null, - 720, - 120); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.FluorBuergerit.get(OrePrefixes.dust, 50), - ItemList.Cell_Empty.get(3), - GT_Values.NF, - Materials.Oxygen.getGas(6000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 3L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 6L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fluorine, 3), - null, - 730, - 120); - GT_Values.RA.addElectrolyzerRecipe( - WerkstoffLoader.Olenit.get(OrePrefixes.dust, 51), - ItemList.Cell_Empty.get(1), - GT_Values.NF, - Materials.Oxygen.getGas(1000L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 9L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 1), - GT_Values.NI, - null, - 790, - 120); + + GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.Forsterit.get(OrePrefixes.dust, 7)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnesium, 2L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L)) + .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(10 * SECONDS).eut(90) + .addTo(sElectrolyzerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.RedZircon.get(OrePrefixes.dust, 6)) + .itemOutputs( + WerkstoffLoader.Zirconium.get(OrePrefixes.dust, 1), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L)) + .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(12 * SECONDS + 10 * TICKS) + .eut(90).addTo(sElectrolyzerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.Fayalit.get(OrePrefixes.dust, 7)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 2L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L)) + .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(16 * SECONDS).eut(90) + .addTo(sElectrolyzerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.Prasiolite.get(OrePrefixes.dust, 16)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 5L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L)) + .noFluidInputs().noFluidOutputs().duration(29 * SECONDS).eut(90).addTo(sElectrolyzerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.Hedenbergit.get(OrePrefixes.dust, 10)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Calcium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 2L)) + .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(15 * SECONDS).eut(90) + .addTo(sElectrolyzerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(WerkstoffLoader.FuchsitAL.get(OrePrefixes.dust, 21), ItemList.Cell_Empty.get(2)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2)) + .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(19 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_MV).addTo(sElectrolyzerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(WerkstoffLoader.FuchsitCR.get(OrePrefixes.dust, 21), ItemList.Cell_Empty.get(2)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2)) + .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(23 * SECONDS) + .eut(TierEU.RECIPE_MV).addTo(sElectrolyzerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(WerkstoffLoader.VanadioOxyDravit.get(OrePrefixes.dust, 53), ItemList.Cell_Empty.get(3)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Vanadium, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3)) + .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(19000L)).duration(35 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_MV).addTo(sElectrolyzerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + WerkstoffLoader.ChromoAluminoPovondrait.get(OrePrefixes.dust, 53), + ItemList.Cell_Empty.get(3)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3)) + .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(19000L)).duration(36 * SECONDS) + .eut(TierEU.RECIPE_MV).addTo(sElectrolyzerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(WerkstoffLoader.FluorBuergerit.get(OrePrefixes.dust, 50), ItemList.Cell_Empty.get(3)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fluorine, 3)) + .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(6000L)).duration(36 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_MV).addTo(sElectrolyzerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(WerkstoffLoader.Olenit.get(OrePrefixes.dust, 51), ItemList.Cell_Empty.get(1)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 9L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 1)) + .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(1000L)).duration(39 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_MV).addTo(sElectrolyzerRecipes); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java index 2505c369e2..a87b71f8aa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java @@ -1,6 +1,8 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; import static gregtech.api.enums.Mods.CropLoadCore; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sExtractorRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import java.util.List; @@ -12,6 +14,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; +import gregtech.api.enums.TierEU; public class Extractor implements Runnable { @@ -20,18 +23,17 @@ public class Extractor implements Runnable { List oreCropVine = OreDictionary.getOres("cropVine", false); if (CropLoadCore.isModLoaded() && !oreCropVine.isEmpty()) { for (ItemStack stack : oreCropVine) { - GT_Values.RA.addExtractorRecipe( - BW_Util.setStackSize(stack, 12), - BioItemList.getOther(1), - 500, - BW_Util.getMachineVoltageFromTier(3)); + + GT_Values.RA.stdBuilder().itemInputs(BW_Util.setStackSize(stack, 12)) + .itemOutputs(BioItemList.getOther(1)).noFluidInputs().noFluidOutputs().duration(25 * SECONDS) + .eut((int) TierEU.RECIPE_HV).addTo(sExtractorRecipes); + } } - GT_Values.RA.addExtractorRecipe( - ItemList.Circuit_Chip_Stemcell.get(1L), - BioItemList.getOther(4), - 500, - BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.stdBuilder().itemInputs(ItemList.Circuit_Chip_Stemcell.get(1L)) + .itemOutputs(BioItemList.getOther(4)).noFluidInputs().noFluidOutputs().duration(25 * SECONDS) + .eut((int) TierEU.RECIPE_LuV).addTo(sExtractorRecipes); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java index 6d23bdfb91..d2125aac22 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java @@ -1,22 +1,24 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; + import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_Utility; public class FluidHeater implements Runnable { @Override public void run() { - GT_Values.RA.addFluidHeaterRecipe( - GT_Utility.getIntegratedCircuit(10), - new FluidStack(FluidLoader.fulvicAcid, 1000), - new FluidStack(FluidLoader.heatedfulvicAcid, 1000), - 90, - BW_Util.getMachineVoltageFromTier(2)); + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)).noItemOutputs() + .fluidInputs(new FluidStack(FluidLoader.fulvicAcid, 1000)) + .fluidOutputs(new FluidStack(FluidLoader.heatedfulvicAcid, 1000)).duration(4 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_MV).addTo(sFluidHeaterRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java index 13c431fce8..5c5271f2b7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java @@ -1,81 +1,73 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; + import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.MaterialsUEVplus; +import gregtech.api.enums.TierEU; public class FluidSolidifier implements Runnable { @Override public void run() { - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(Blocks.lapis_block), - Materials.Iron.getMolten(1296L), - new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), - 100, - BW_Util.getMachineVoltageFromTier(3)); - - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Materials.Titanium.getMolten(1152), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), - 800, - BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Materials.TungstenSteel.getMolten(1152), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), - 800, - BW_Util.getMachineVoltageFromTier(4)); - - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - WerkstoffLoader.LuVTierMaterial.getMolten(1152), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), - 800, - BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Materials.Iridium.getMolten(1152), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), - 800, - BW_Util.getMachineVoltageFromTier(6)); - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Materials.Osmium.getMolten(1152), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), - 800, - BW_Util.getMachineVoltageFromTier(7)); - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Materials.Neutronium.getMolten(1152), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), - 800, - BW_Util.getMachineVoltageFromTier(8)); - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Materials.CosmicNeutronium.getMolten(1152), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), - 800, - BW_Util.getMachineVoltageFromTier(9)); - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - Materials.Infinity.getMolten(1152), - new ItemStack(ItemRegistry.bw_glasses[0], 1, 15), - 800, - BW_Util.getMachineVoltageFromTier(10)); - GT_Values.RA.addFluidSolidifierRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), - MaterialsUEVplus.TranscendentMetal.getMolten(1152), - new ItemStack(ItemRegistry.bw_glasses[1], 1, 0), - 800, - BW_Util.getMachineVoltageFromTier(11)); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(Blocks.lapis_block)) + .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0)) + .fluidInputs(Materials.Iron.getMolten(1296L)).noFluidOutputs().duration(5 * SECONDS) + .eut(TierEU.RECIPE_HV).addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1)) + .fluidInputs(Materials.Titanium.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) + .eut(TierEU.RECIPE_HV).addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2)) + .fluidInputs(Materials.TungstenSteel.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) + .eut(TierEU.RECIPE_EV).addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3)) + .fluidInputs(WerkstoffLoader.LuVTierMaterial.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) + .eut(TierEU.RECIPE_IV).addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4)) + .fluidInputs(Materials.Iridium.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) + .eut(TierEU.RECIPE_LuV).addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5)) + .fluidInputs(Materials.Osmium.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) + .eut(TierEU.RECIPE_ZPM).addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 13)) + .fluidInputs(Materials.Neutronium.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) + .eut(TierEU.RECIPE_UV).addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 14)) + .fluidInputs(Materials.CosmicNeutronium.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) + .eut(TierEU.RECIPE_UHV).addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 15)) + .fluidInputs(Materials.Infinity.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) + .eut(TierEU.RECIPE_UEV).addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[1], 1, 0)) + .fluidInputs(MaterialsUEVplus.TranscendentMetal.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) + .eut(TierEU.RECIPE_UIV).addTo(sFluidSolidficationRecipes); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java index 744b18a175..4523503c87 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java @@ -2,6 +2,8 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.MATERIALS_PER_FUEL; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.sHTGR_Fuel; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sPressRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import net.minecraft.item.ItemStack; @@ -10,50 +12,55 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEnti import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; +import gregtech.api.enums.TierEU; public class FormingPress implements Runnable { @Override public void run() { - GT_Values.RA.addFormingPressRecipe( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials), - Materials.Graphite.getDust(64), - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1), - 40, - 30); - GT_Values.RA.addFormingPressRecipe( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1), - Materials.Silicon.getDust(64), - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2), - 40, - 30); - GT_Values.RA.addFormingPressRecipe( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2), - Materials.Graphite.getDust(64), - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3), - 40, - 30); + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials), + Materials.Graphite.getDust(64)) + .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1)).noFluidInputs() + .noFluidOutputs().duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1), + Materials.Silicon.getDust(64)) + .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2)).noFluidInputs() + .noFluidOutputs().duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2), + Materials.Graphite.getDust(64)) + .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3)).noFluidInputs() + .noFluidOutputs().duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); int i = 0; for (GT_TileEntity_HTGR.HTGRMaterials.Fuel_ fuel : sHTGR_Fuel) { - GT_Values.RA.addFormingPressRecipe( - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i), - Materials.Carbon.getDust(64), - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), - 40, - 30); - GT_Values.RA.addFormingPressRecipe( - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), - Materials.Silicon.getDust(64), - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), - 40, - 30); - GT_Values.RA.addFormingPressRecipe( - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), - Materials.Graphite.getDust(64), - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), - 40, - 30); + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i), + Materials.Carbon.getDust(64)) + .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1)) + .noFluidInputs().noFluidOutputs().duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), + Materials.Silicon.getDust(64)) + .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2)) + .noFluidInputs().noFluidOutputs().duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), + Materials.Graphite.getDust(64)) + .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3)) + .noFluidInputs().noFluidOutputs().duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); i += MATERIALS_PER_FUEL; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java index 7b647d79af..2d6f80ac9a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java @@ -1,24 +1,23 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; + import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; -import com.github.bartimaeusnek.bartworks.util.BW_Util; - import gregtech.api.enums.GT_Values; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_Utility; public class LaserEngraver implements Runnable { @Override public void run() { - GT_Values.RA.addLaserEngraverRecipe( - new ItemStack(Items.emerald), - GT_Utility.getIntegratedCircuit(17), - BioItemList.getPlasmidCell(null), - 100, - BW_Util.getMachineVoltageFromTier(1)); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(Items.emerald), GT_Utility.getIntegratedCircuit(17)) + .noItemOutputs().noFluidInputs().noFluidOutputs().duration(5 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(sLaserEngraverRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java index 4cf4f691c1..4810a396ae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java @@ -3,6 +3,8 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.MATERIALS_PER_FUEL; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.sHTGR_Fuel; import static gregtech.api.enums.Mods.Gendustry; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMixerRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; @@ -12,11 +14,11 @@ import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; @@ -24,40 +26,32 @@ public class Mixer implements Runnable { @Override public void run() { - GT_Values.RA.addMixerRecipe( - WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 10), - Materials.Uranium235.getDust(1), - GT_Utility.getIntegratedCircuit(2), - null, - null, - null, - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials), - 400, - 30); + GT_Values.RA.stdBuilder() + .itemInputs( + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 10), + Materials.Uranium235.getDust(1), + GT_Utility.getIntegratedCircuit(2)) + .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials)).noFluidInputs() + .noFluidOutputs().duration(20 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); int i = 0; for (GT_TileEntity_HTGR.HTGRMaterials.Fuel_ fuel : sHTGR_Fuel) { - GT_Values.RA.addMixerRecipe( - new ItemStack[] { fuel.mainItem, fuel.secondaryItem, GT_Utility.getIntegratedCircuit(1) }, - null, - new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i) }, - null, - 400, - 30); + GT_Values.RA.stdBuilder().itemInputs(fuel.mainItem, fuel.secondaryItem, GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i)).noFluidInputs() + .noFluidOutputs().duration(20 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + i += MATERIALS_PER_FUEL; } if (Gendustry.isModLoaded()) { - GT_Values.RA.addMixerRecipe( - GT_Utility.getIntegratedCircuit(17), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Radon, 1L), - null, - null, - FluidRegistry.getFluidStack("liquiddna", 1000), - new FluidStack(FluidLoader.BioLabFluidMaterials[0], 2000), - Materials.Empty.getCells(1), - 500, - BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.stdBuilder() + .itemInputs( + GT_Utility.getIntegratedCircuit(17), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Radon, 1L)) + .itemOutputs(Materials.Empty.getCells(1)) + .fluidInputs(FluidRegistry.getFluidStack("liquiddna", 1000)) + .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[0], 2000)).duration(25 * SECONDS) + .eut(TierEU.RECIPE_HV).addTo(sMixerRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java index 58c6746a23..dea39b0088 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java @@ -1,84 +1,71 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; + import net.minecraft.item.ItemStack; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.MaterialsUEVplus; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TierEU; public class Pulverizer implements Runnable { @Override public void run() { - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Titanium.getDust(8) }, - null, - 800, - BW_Util.getMachineVoltageFromTier(4)); - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.TungstenSteel.getDust(8) }, - null, - 800, - BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), - WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.dust, 8) }, - null, - 800, - BW_Util.getMachineVoltageFromTier(6)); - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Iridium.getDust(8) }, - null, - 800, - BW_Util.getMachineVoltageFromTier(7)); - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Osmium.getDust(8) }, - null, - 800, - BW_Util.getMachineVoltageFromTier(8)); - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Neutronium.getDust(8) }, - null, - 800, - BW_Util.getMachineVoltageFromTier(9)); - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.CosmicNeutronium.getDust(8) }, - null, - 800, - BW_Util.getMachineVoltageFromTier(10)); - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, 15), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), Materials.Infinity.getDust(8) }, - null, - 800, - BW_Util.getMachineVoltageFromTier(11)); - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[1], 1, 0), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9), - MaterialsUEVplus.TranscendentMetal.getDust(8) }, - null, - 800, - BW_Util.getMachineVoltageFromTier(12)); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Titanium.getDust(8)).noFluidInputs() + .noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_EV).addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.TungstenSteel.getDust(8)).noFluidInputs() + .noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_IV).addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3)) + .itemOutputs( + Materials.BorosilicateGlass.getDust(9), + WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.dust, 8)) + .noFluidInputs().noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_LuV) + .addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Iridium.getDust(8)).noFluidInputs() + .noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_ZPM).addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Osmium.getDust(8)).noFluidInputs() + .noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_UV).addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 13)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Neutronium.getDust(8)).noFluidInputs() + .noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_UHV).addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 14)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.CosmicNeutronium.getDust(8)) + .noFluidInputs().noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_UEV) + .addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 15)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Infinity.getDust(8)).noFluidInputs() + .noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_UIV).addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[1], 1, 0)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9), MaterialsUEVplus.TranscendentMetal.getDust(8)) + .noFluidInputs().noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_UMV) + .addTo(sMaceratorRecipes); for (int i = 6; i < 11; i++) { - GT_Values.RA.addPulveriserRecipe( - new ItemStack(ItemRegistry.bw_glasses[0], 1, i), - new ItemStack[] { Materials.BorosilicateGlass.getDust(9) }, - null, - 400, - BW_Util.getMachineVoltageFromTier(1)); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, i)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9)).noFluidInputs().noFluidOutputs() + .duration(20 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sMaceratorRecipes); + } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/PyrolyseOven.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/PyrolyseOven.java index 812b90bfb8..10a2786b8c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/PyrolyseOven.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/PyrolyseOven.java @@ -3,10 +3,10 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; +import gregtech.api.enums.TierEU; public class PyrolyseOven implements Runnable { @@ -19,6 +19,6 @@ public class PyrolyseOven implements Runnable { null, Materials.Oil.getFluid(1000), 105, - BW_Util.getMachineVoltageFromTier(3)); + (int) TierEU.RECIPE_HV); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 96e1465c9d..bc825fbdbf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -31,7 +31,6 @@ import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.MathUtils; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; @@ -44,6 +43,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.Textures; +import gregtech.api.enums.TierEU; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -137,7 +137,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase false, true).useModularUI(true); private static final int HELIUM_NEEDED = 730000; - public static final int powerUsage = BW_Util.getMachineVoltageFromTier(6); + public static final int powerUsage = (int) TierEU.RECIPE_LuV; private static final int maxcapacity = 720000; private static final int mincapacity = maxcapacity / 10; private int HeliumSupply; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index ed4fbccd84..0bec36aca3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -28,7 +28,6 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.MathUtils; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -38,6 +37,7 @@ import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; +import gregtech.api.enums.TierEU; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -112,7 +112,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase .build(); private static final int HELIUM_NEEDED = 730000; - private static final int powerUsage = BW_Util.getMachineVoltageFromTier(5) / 2; + private static final int powerUsage = (int) TierEU.RECIPE_IV / 2; private static final int maxcapacity = 675000; private static final int mincapacity = 100000; private int HeliumSupply; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java index e80cb2464a..4b5802d5e0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java @@ -14,6 +14,9 @@ package com.github.bartimaeusnek.bartworks.system.material; import static gregtech.api.enums.GT_Values.RA; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -44,12 +47,13 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { getStackForm(2), RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "SSS", "SwS", "SSS", 'S', mMaterial.get(OrePrefixes.stick) }); - RA.addAssemblerRecipe( - GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.getVarName(), 4), - ItemList.Circuit_Integrated.getWithDamage(0, 4), - getStackForm(1), - 64, - 8); + + RA.stdBuilder() + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.getVarName(), 4), + ItemList.Circuit_Integrated.getWithDamage(0, 4)) + .itemOutputs(getStackForm(1)).noFluidInputs().noFluidOutputs().duration(3 * SECONDS + 4 * TICKS).eut(8) + .addTo(sAssemblerRecipes); } private BW_MetaGeneratedFrames(String aName, Werkstoff aMaterial) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index cc321e0fc0..ac51f8add9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -13,6 +13,9 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sPressRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; + import java.util.ArrayList; import java.util.BitSet; import java.util.HashSet; @@ -43,6 +46,7 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; import gregtech.api.enums.TC_Aspects; +import gregtech.api.enums.TierEU; import gregtech.api.interfaces.IItemBehaviour; import gregtech.api.interfaces.IItemContainer; import gregtech.api.items.GT_MetaBase_Item; @@ -66,12 +70,14 @@ public class BW_Meta_Items { BW_Meta_Items.NEWCIRCUITS.addItem(1, "Sliced Circuit", "", SubTag.NO_UNIFICATION, SubTag.NO_RECYCLING); BW_Meta_Items.NEWCIRCUITS.addItem(2, "Raw Imprint supporting Board", "A Raw Board needed for Circuit Imprints"); BW_Meta_Items.NEWCIRCUITS.addItem(3, "Imprint supporting Board", "A Board needed for Circuit Imprints"); - GT_Values.RA.addFormingPressRecipe( - WerkstoffLoader.MagnetoResonaticDust.get(OrePrefixes.dust, 1), - WerkstoffLoader.ArInGaPhoBiBoTe.get(OrePrefixes.dust, 4), - BW_Meta_Items.NEWCIRCUITS.getStack(2), - 300, - 480); + + GT_Values.RA.stdBuilder() + .itemInputs( + WerkstoffLoader.MagnetoResonaticDust.get(OrePrefixes.dust, 1), + WerkstoffLoader.ArInGaPhoBiBoTe.get(OrePrefixes.dust, 4)) + .itemOutputs(BW_Meta_Items.NEWCIRCUITS.getStack(2)).noFluidInputs().noFluidOutputs() + .duration(15 * SECONDS).eut(TierEU.RECIPE_HV).addTo(sPressRecipes); + GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.add( new BWRecipes.DynamicGTRecipe( false, @@ -82,7 +88,7 @@ public class BW_Meta_Items { new FluidStack[] { Materials.SolderingAlloy.getMolten(576) }, null, 300, - BW_Util.getMachineVoltageFromTier(4), + (int) TierEU.RECIPE_EV, BW_Util.CLEANROOM)); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index d7cf480668..bfa773dc45 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -91,6 +91,8 @@ import static gregtech.api.enums.ItemList.Optical_Cpu_Containment_Housing; import static gregtech.api.enums.ItemList.Optically_Compatible_Memory; import static gregtech.api.enums.ItemList.Optically_Perfected_CPU; import static gregtech.api.enums.ItemList.values; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import java.util.ArrayList; import java.util.Arrays; @@ -105,6 +107,7 @@ import cpw.mods.fml.common.FMLCommonHandler; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; @@ -150,12 +153,12 @@ public class CircuitPartLoader implements Runnable { String localised = GT_LanguageManager .getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); BW_Meta_Items.getNEWCIRCUITS().addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised + "s", tt); - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { single.get(16).copy(), GT_Utility.getIntegratedCircuit(16) }, - Materials.Plastic.getMolten(72), - BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs), - 600, - 30); + + GT_Values.RA.stdBuilder().itemInputs(single.get(16).copy(), GT_Utility.getIntegratedCircuit(16)) + .itemOutputs(BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs)) + .fluidInputs(Materials.Plastic.getMolten(72)).noFluidOutputs().duration(30 * SECONDS) + .eut(TierEU.RECIPE_LV).addTo(sAssemblerRecipes); + CircuitImprintLoader.circuitIIconRefs.put(CircuitImprintLoader.reverseIDs, single); CircuitImprintLoader.reverseIDs--; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java index 32c88c9e56..e04b37a5f1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -14,6 +14,8 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; import static gregtech.api.enums.Mods.Forestry; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; import java.util.List; import java.util.stream.Collectors; @@ -58,16 +60,14 @@ public class GTMetaItemEnhancer { GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1)); FluidContainerRegistry.registerFluidContainer(emptyData); GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe( - GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1), - new ItemStack(moltenCapsuls, 1, i), - m.getMolten(144), - GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe( - new ItemStack(moltenCapsuls, 1, i), - GT_Values.NI, - GT_Values.NF, - m.getMolten(144)); + + GT_Values.RA.stdBuilder().itemInputs(GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1)) + .itemOutputs(new ItemStack(moltenCapsuls, 1, i)).fluidInputs(m.getMolten(144)).noFluidOutputs() + .duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(moltenCapsuls, 1, i)).noItemOutputs().noFluidInputs() + .fluidOutputs(m.getMolten(144)).duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); + } if (m.getFluid(1) == null && m.getGas(1) == null) continue; if (OreDictionary.doesOreNameExist("capsule" + m.mName)) continue; @@ -91,13 +91,14 @@ public class GTMetaItemEnhancer { container); FluidContainerRegistry.registerFluidContainer(emptyData); GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA - .addFluidCannerRecipe(container, new ItemStack(filled, 1, it), new FluidStack(f, amount), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe( - new ItemStack(filled, 1, it), - empty ? GT_Values.NI : container, - GT_Values.NF, - new FluidStack(f, amount)); + + GT_Values.RA.stdBuilder().itemInputs(container).itemOutputs(new ItemStack(filled, 1, it)) + .fluidInputs(new FluidStack(f, amount)).noFluidOutputs().duration(amount / 62).eut(2) + .addTo(sFluidCannerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(filled, 1, it)).noItemOutputs().noFluidInputs() + .fluidOutputs(new FluidStack(f, amount)).duration(amount / 62).eut(2).addTo(sFluidCannerRecipes); + } public static void addAdditionalOreDictToForestry() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index e384e61d3e..e4fa5bf8ac 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -72,6 +72,16 @@ import static gregtech.api.enums.OrePrefixes.dustSmall; import static gregtech.api.enums.OrePrefixes.dustTiny; import static gregtech.api.enums.OrePrefixes.ingot; import static gregtech.api.enums.OrePrefixes.nugget; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBlastRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMixerRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sSifterRecipes; +import static gregtech.api.util.GT_RecipeBuilder.MINUTES; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; +import static gregtech.api.util.GT_RecipeConstants.COIL_HEAT; +import static gregtech.api.util.GT_RecipeConstants.UniversalChemical; import java.lang.reflect.Field; import java.util.ArrayList; @@ -106,6 +116,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TierEU; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.items.GT_Generic_Block; import gregtech.api.items.GT_Generic_Item; @@ -131,123 +142,80 @@ public class PlatinumSludgeOverHaul { private static void runHelperrecipes() { // DilutedSulfuricAcid // 2H2SO4 + H2O = 3H2SO4(d) - GT_Values.RA.addMixerRecipe( - Materials.SulfuricAcid.getCells(2), - Materials.Water.getCells(1), - GT_Utility.getIntegratedCircuit(1), - null, - null, - null, - Materials.DilutedSulfuricAcid.getCells(3), - 30, - 30); - GT_Values.RA.addMixerRecipe( - Materials.Water.getCells(1), - GT_Utility.getIntegratedCircuit(1), - null, - null, - Materials.SulfuricAcid.getFluid(2000), - Materials.DilutedSulfuricAcid.getFluid(3000), - Materials.Empty.getCells(1), - 30, - 30); - GT_Values.RA.addMixerRecipe( - Materials.SulfuricAcid.getCells(2), - GT_Utility.getIntegratedCircuit(1), - null, - null, - Materials.Water.getFluid(1000), - Materials.DilutedSulfuricAcid.getFluid(3000), - Materials.Empty.getCells(2), - 30, - 30); + GT_Values.RA.stdBuilder() + .itemInputs( + Materials.SulfuricAcid.getCells(2), + Materials.Water.getCells(1), + GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(Materials.DilutedSulfuricAcid.getCells(3)).noFluidInputs().noFluidOutputs() + .duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(Materials.Empty.getCells(1)).fluidInputs(Materials.SulfuricAcid.getFluid(2000)) + .fluidOutputs(Materials.DilutedSulfuricAcid.getFluid(3000)).duration(1 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(Materials.SulfuricAcid.getCells(2), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(Materials.Empty.getCells(2)).fluidInputs(Materials.Water.getFluid(1000)) + .fluidOutputs(Materials.DilutedSulfuricAcid.getFluid(3000)).duration(1 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); // FormicAcid // CO + NaOH = CHO2Na - GT_Values.RA.addChemicalRecipe( - Materials.CarbonMonoxide.getCells(1), - Materials.SodiumHydroxide.getDust(3), - null, - null, - Sodiumformate.get(cell), - null, - 15); + GT_Values.RA.stdBuilder().itemInputs(Materials.CarbonMonoxide.getCells(1), Materials.SodiumHydroxide.getDust(3)) + .itemOutputs(Sodiumformate.get(cell)).noFluidInputs().noFluidOutputs().duration(15 * TICKS) + .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); // H2SO4 + 2CHO2Na = 2CH2O2 + Na2SO4 - GT_Values.RA.addChemicalRecipe( - Sodiumformate.get(cell, 2), - GT_Utility.getIntegratedCircuit(1), - Materials.SulfuricAcid.getFluid(1000), - null, - FormicAcid.get(cell, 2), - Sodiumsulfate.get(dust, 7), - 15); - GT_Values.RA.addChemicalRecipe( - Materials.SulfuricAcid.getCells(1), - GT_Utility.getIntegratedCircuit(1), - Sodiumformate.getFluidOrGas(2000), - FormicAcid.getFluidOrGas(2000), - Materials.Empty.getCells(1), - Sodiumsulfate.get(dust, 7), - 15); - // AquaRegia - GT_Values.RA.addMixerRecipe( - Materials.DilutedSulfuricAcid.getCells(1), - Materials.NitricAcid.getCells(1), - GT_Utility.getIntegratedCircuit(1), - null, - null, - null, - AquaRegia.get(cell, 2), - 30, - 30); - GT_Values.RA.addMixerRecipe( - Materials.DilutedSulfuricAcid.getCells(1), - Materials.NitricAcid.getCells(1), - GT_Utility.getIntegratedCircuit(2), - null, - null, - AquaRegia.getFluidOrGas(2000), - Materials.Empty.getCells(2), - 30, - 30); - GT_Values.RA.addMixerRecipe( - Materials.NitricAcid.getCells(1), - GT_Utility.getIntegratedCircuit(3), - null, - null, - Materials.DilutedSulfuricAcid.getFluid(1000), - AquaRegia.getFluidOrGas(2000), - Materials.Empty.getCells(1), - 30, - 30); - GT_Values.RA.addMixerRecipe( - Materials.DilutedSulfuricAcid.getCells(1), - GT_Utility.getIntegratedCircuit(4), - null, - null, - Materials.NitricAcid.getFluid(1000), - AquaRegia.getFluidOrGas(2000), - Materials.Empty.getCells(1), - 30, - 30); - // AmmoniumCloride + GT_Values.RA.stdBuilder().itemInputs(Sodiumformate.get(cell, 2), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(FormicAcid.get(cell, 2), Sodiumsulfate.get(dust, 7)) + .fluidInputs(Materials.SulfuricAcid.getFluid(1000)).noFluidOutputs().duration(15 * TICKS) + .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + + GT_Values.RA.stdBuilder().itemInputs(Materials.SulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(Materials.Empty.getCells(1), Sodiumsulfate.get(dust, 7)) + .fluidInputs(Sodiumformate.getFluidOrGas(2000)).fluidOutputs(FormicAcid.getFluidOrGas(2000)) + .duration(15 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + + // AquaRegia + GT_Values.RA.stdBuilder() + .itemInputs( + Materials.DilutedSulfuricAcid.getCells(1), + Materials.NitricAcid.getCells(1), + GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(AquaRegia.get(cell, 2)).noFluidInputs().noFluidOutputs().duration(1 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + Materials.DilutedSulfuricAcid.getCells(1), + Materials.NitricAcid.getCells(1), + GT_Utility.getIntegratedCircuit(2)) + .itemOutputs(Materials.Empty.getCells(2)).noFluidInputs().fluidOutputs(AquaRegia.getFluidOrGas(2000)) + .duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(3)) + .itemOutputs(Materials.Empty.getCells(1)).fluidInputs(Materials.DilutedSulfuricAcid.getFluid(1000)) + .fluidOutputs(AquaRegia.getFluidOrGas(2000)).duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) + .addTo(sMixerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(Materials.DilutedSulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(4)) + .itemOutputs(Materials.Empty.getCells(1)).fluidInputs(Materials.NitricAcid.getFluid(1000)) + .fluidOutputs(AquaRegia.getFluidOrGas(2000)).duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) + .addTo(sMixerRecipes); + + // AmmoniumChloride // NH3 + HCl = NH4Cl - GT_Values.RA.addChemicalRecipe( - Materials.Ammonia.getCells(1), - GT_Utility.getIntegratedCircuit(1), - Materials.HydrochloricAcid.getFluid(1000), - null, - AmmoniumChloride.get(cell, 1), - null, - 15); - GT_Values.RA.addChemicalRecipe( - Materials.HydrochloricAcid.getCells(1), - GT_Utility.getIntegratedCircuit(1), - Materials.Ammonia.getGas(1000), - AmmoniumChloride.getFluidOrGas(1000), - Materials.Empty.getCells(1), - null, - 15); + + GT_Values.RA.stdBuilder().itemInputs(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(AmmoniumChloride.get(cell, 1)).fluidInputs(Materials.HydrochloricAcid.getFluid(1000)) + .noFluidOutputs().duration(15 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + + GT_Values.RA.stdBuilder().itemInputs(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(Materials.Empty.getCells(1)).fluidInputs(Materials.Ammonia.getGas(1000)) + .fluidOutputs(AmmoniumChloride.getFluidOrGas(1000)).duration(15 * TICKS).eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + GT_Values.RA.addMultiblockChemicalRecipe( new ItemStack[] { GT_Utility.getIntegratedCircuit(9) }, new FluidStack[] { Materials.Ammonia.getGas(64000), Materials.HydrochloricAcid.getFluid(64000) }, @@ -255,96 +223,82 @@ public class PlatinumSludgeOverHaul { null, 60, 480); - // base sollution + // base solution for (Werkstoff w : Werkstoff.werkstoffHashSet) if (w.containsStuff(Materials.Sulfur) && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { - GT_Values.RA.addChemicalRecipe( - w.get(crushedPurified), - GT_Utility.getIntegratedCircuit(1), - AquaRegia.getFluidOrGas(150), - PTConcentrate.getFluidOrGas(150), - null, - 250); - GT_Values.RA.addChemicalRecipe( - w.get(crushedPurified, 9), - GT_Utility.getIntegratedCircuit(9), - AquaRegia.getFluidOrGas(1350), - PTConcentrate.getFluidOrGas(1350), - null, - 2250); - GT_Values.RA.addChemicalRecipe( - w.get(crushedPurified, 9), - PTMetallicPowder.get(dust, 9), - AquaRegia.getFluidOrGas(10350), - PTConcentrate.getFluidOrGas(10350), - PTResidue.get(dust), - 2250); + + GT_Values.RA.stdBuilder().itemInputs(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(1)) + .noItemOutputs().fluidInputs(AquaRegia.getFluidOrGas(150)) + .fluidOutputs(PTConcentrate.getFluidOrGas(150)).duration(12 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + + GT_Values.RA.stdBuilder().itemInputs(w.get(crushedPurified, 9), GT_Utility.getIntegratedCircuit(9)) + .noItemOutputs().fluidInputs(AquaRegia.getFluidOrGas(1350)) + .fluidOutputs(PTConcentrate.getFluidOrGas(1350)).duration(11 * SECONDS + 5 * TICKS) + .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + + GT_Values.RA.stdBuilder().itemInputs(w.get(crushedPurified, 9), PTMetallicPowder.get(dust, 9)) + .itemOutputs(PTResidue.get(dust)).fluidInputs(AquaRegia.getFluidOrGas(10350)) + .fluidOutputs(PTConcentrate.getFluidOrGas(10350)) + .duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + } for (Materials m : Materials.values()) if (PlatinumSludgeOverHaul.materialsContains(m, Materials.Sulfur) && (PlatinumSludgeOverHaul.materialsContains(m, Materials.Copper) || PlatinumSludgeOverHaul.materialsContains(m, Materials.Nickel))) { - GT_Values.RA.addChemicalRecipe( - GT_OreDictUnificator.get(crushedPurified, m, 1), - GT_Utility.getIntegratedCircuit(1), - AquaRegia.getFluidOrGas(150), - PTConcentrate.getFluidOrGas(150), - null, - 250); - GT_Values.RA.addChemicalRecipe( - GT_OreDictUnificator.get(crushedPurified, m, 9), - GT_Utility.getIntegratedCircuit(9), - AquaRegia.getFluidOrGas(1350), - PTConcentrate.getFluidOrGas(1350), - null, - 2250); - GT_Values.RA.addChemicalRecipe( - GT_OreDictUnificator.get(crushedPurified, m, 9), - PTMetallicPowder.get(dust, 9), - AquaRegia.getFluidOrGas(10350), - PTConcentrate.getFluidOrGas(10350), - PTResidue.get(dust), - 2250); + + GT_Values.RA.stdBuilder() + .itemInputs( + GT_OreDictUnificator.get(crushedPurified, m, 1), + GT_Utility.getIntegratedCircuit(1)) + .noItemOutputs().fluidInputs(AquaRegia.getFluidOrGas(150)) + .fluidOutputs(PTConcentrate.getFluidOrGas(150)).duration(12 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + + GT_Values.RA.stdBuilder() + .itemInputs( + GT_OreDictUnificator.get(crushedPurified, m, 9), + GT_Utility.getIntegratedCircuit(9)) + .noItemOutputs().fluidInputs(AquaRegia.getFluidOrGas(1350)) + .fluidOutputs(PTConcentrate.getFluidOrGas(1350)) + .duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder() + .itemInputs( + GT_OreDictUnificator.get(crushedPurified, m, 9), + PTMetallicPowder.get(dust, 9)) + .itemOutputs(PTResidue.get(dust)).fluidInputs(AquaRegia.getFluidOrGas(10350)) + .fluidOutputs(PTConcentrate.getFluidOrGas(10350)) + .duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + } // Pt - GT_Values.RA.addBlastRecipe( - PTMetallicPowder.get(dust, 3), - GT_Utility.getIntegratedCircuit(1), - null, - null, - Materials.Platinum.getNuggets(2), - null, - 600, - 120, - Materials.Platinum.mMeltingPoint); + GT_Values.RA.stdBuilder().itemInputs(PTMetallicPowder.get(dust, 3), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(Materials.Platinum.getNuggets(2)).noFluidInputs().noFluidOutputs().duration(30 * SECONDS) + .eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, Materials.Platinum.mMeltingPoint).addTo(sBlastRecipes); + + GT_Values.RA.stdBuilder().itemInputs(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(PTResidue.get(dustTiny)).fluidInputs(AquaRegia.getFluidOrGas(1000)) + .fluidOutputs(PTConcentrate.getFluidOrGas(1000)).duration(12 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + + GT_Values.RA.stdBuilder().itemInputs(PTMetallicPowder.get(dust, 9), GT_Utility.getIntegratedCircuit(9)) + .itemOutputs(PTResidue.get(dust)).fluidInputs(AquaRegia.getFluidOrGas(9000)) + .fluidOutputs(PTConcentrate.getFluidOrGas(9000)).duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + + GT_Values.RA.stdBuilder().itemInputs(PTConcentrate.get(cell, 2)) + .itemOutputs( + PTSaltCrude.get(dustTiny, 16), + PTRawPowder.get(dustTiny, 4), + Materials.NitrogenDioxide.getCells(1), + Materials.DilutedSulfuricAcid.getCells(1)) + .fluidInputs(AmmoniumChloride.getFluidOrGas(400)).fluidOutputs(PDAmmonia.getFluidOrGas(400)) + .duration(60 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); - GT_Values.RA.addChemicalRecipe( - PTMetallicPowder.get(dust), - GT_Utility.getIntegratedCircuit(1), - AquaRegia.getFluidOrGas(1000), - PTConcentrate.getFluidOrGas(1000), - PTResidue.get(dustTiny), - 250); - GT_Values.RA.addChemicalRecipe( - PTMetallicPowder.get(dust, 9), - GT_Utility.getIntegratedCircuit(9), - AquaRegia.getFluidOrGas(9000), - PTConcentrate.getFluidOrGas(9000), - PTResidue.get(dust), - 2250); - GT_Values.RA.addCentrifugeRecipe( - PTConcentrate.get(cell, 2), - null, - AmmoniumChloride.getFluidOrGas(400), - PDAmmonia.getFluidOrGas(400), - PTSaltCrude.get(dustTiny, 16), - PTRawPowder.get(dustTiny, 4), - Materials.NitrogenDioxide.getCells(1), - Materials.DilutedSulfuricAcid.getCells(1), - null, - null, - null, - 1200, - 30); GT_Values.RA.addMultiblockChemicalRecipe( new ItemStack[] { GT_Utility.getIntegratedCircuit(1) }, new FluidStack[] { PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(400) }, @@ -361,72 +315,64 @@ public class PlatinumSludgeOverHaul { new ItemStack[] { PTSaltCrude.get(dust, 16), PTRawPowder.get(dust, 4) }, 1400, 240); - GT_Values.RA.addSifterRecipe( - PTSaltCrude.get(dust), - new ItemStack[] { PTSaltRefined.get(dust), PTSaltRefined.get(dust), PTSaltRefined.get(dust), - PTSaltRefined.get(dust), PTSaltRefined.get(dust), PTSaltRefined.get(dust), - PTSaltRefined.get(dust), PTSaltRefined.get(dust), PTSaltRefined.get(dust), }, - new int[] { 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, }, - 600, - 30); - GT_Values.RA.addBlastRecipe( - PTSaltRefined.get(dust), - GT_Utility.getIntegratedCircuit(1), - null, - Materials.Chlorine.getGas(87), - PTMetallicPowder.get(dust), - null, - 200, - 120, - 900); + + GT_Values.RA.stdBuilder().itemInputs(PTSaltCrude.get(dust)) + .itemOutputs( + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust)) + .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500).noFluidInputs().noFluidOutputs() + .duration(30 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sSifterRecipes); + + GT_Values.RA.stdBuilder().itemInputs(PTSaltRefined.get(dust), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(PTMetallicPowder.get(dust)).noFluidInputs().fluidOutputs(Materials.Chlorine.getGas(87)) + .duration(10 * SECONDS).eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 900).addTo(sBlastRecipes); + // 2PtCl + Ca = 2Pt + CaCl2 - GT_Values.RA.addChemicalRecipe( - PTRawPowder.get(dust, 4), - Materials.Calcium.getDust(1), - null, - null, - Materials.Platinum.getDust(2), - CalciumChloride.get(dust, 3), - 30); + + GT_Values.RA.stdBuilder().itemInputs(PTRawPowder.get(dust, 4), Materials.Calcium.getDust(1)) + .itemOutputs(Materials.Platinum.getDust(2), CalciumChloride.get(dust, 3)).noFluidInputs() + .noFluidOutputs().duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); // Pd - GT_Values.RA.addChemicalRecipe( - PDMetallicPowder.get(dust), - GT_Utility.getIntegratedCircuit(1), - Materials.Ammonia.getGas(1000), - PDAmmonia.getFluidOrGas(1000), - null, - 250); - GT_Values.RA.addChemicalRecipe( - PDMetallicPowder.get(dust), - GT_Utility.getIntegratedCircuit(1), - PDAmmonia.getFluidOrGas(1000), - null, - PDSalt.get(dustTiny, 16), - PDRawPowder.get(dustTiny, 2), - 250); - GT_Values.RA.addChemicalRecipe( - PDMetallicPowder.get(dust, 9), - GT_Utility.getIntegratedCircuit(9), - PDAmmonia.getFluidOrGas(9000), - null, - PDSalt.get(dust, 16), - PDRawPowder.get(dust, 2), - 2250); - GT_Values.RA.addChemicalRecipe( - GT_Utility.getIntegratedCircuit(2), - null, - PDAmmonia.getFluidOrGas(1000), - null, - PDSalt.get(dust), - 250); - GT_Values.RA.addSifterRecipe( - PDSalt.get(dust), - new ItemStack[] { PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), }, - new int[] { 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, }, - 600, - 30); + + GT_Values.RA.stdBuilder().itemInputs(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1)) + .noItemOutputs().fluidInputs(Materials.Ammonia.getGas(1000)).fluidOutputs(PDAmmonia.getFluidOrGas(1000)) + .duration(12 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + + GT_Values.RA.stdBuilder().itemInputs(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(PDSalt.get(dustTiny, 16), PDRawPowder.get(dustTiny, 2)) + .fluidInputs(PDAmmonia.getFluidOrGas(1000)).noFluidOutputs().duration(12 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + + GT_Values.RA.stdBuilder().itemInputs(PDMetallicPowder.get(dust, 9), GT_Utility.getIntegratedCircuit(9)) + .itemOutputs(PDSalt.get(dust, 16), PDRawPowder.get(dust, 2)).fluidInputs(PDAmmonia.getFluidOrGas(9000)) + .noFluidOutputs().duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(2)).itemOutputs(PDSalt.get(dust)) + .fluidInputs(PDAmmonia.getFluidOrGas(1000)).noFluidOutputs().duration(12 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + + GT_Values.RA.stdBuilder().itemInputs(PDSalt.get(dust)) + .itemOutputs( + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust)) + .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500).noFluidInputs().noFluidOutputs() + .duration(30 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sSifterRecipes); + GT_Values.RA.addChemicalRecipeForBasicMachineOnly( PDRawPowder.get(dust, 4), Materials.Empty.getCells(1), @@ -445,53 +391,37 @@ public class PlatinumSludgeOverHaul { 250, 30); // Na2SO4 + 2H = 2Na + H2SO4 - GT_Values.RA.addChemicalRecipe( - Sodiumsulfate.get(dust, 7), - Materials.Hydrogen.getCells(2), - null, - Materials.SulfuricAcid.getFluid(1000), - Materials.Sodium.getDust(2), - Materials.Empty.getCells(2), - 30); + + GT_Values.RA.stdBuilder().itemInputs(Sodiumsulfate.get(dust, 7), Materials.Hydrogen.getCells(2)) + .itemOutputs(Materials.Sodium.getDust(2), Materials.Empty.getCells(2)).noFluidInputs() + .fluidOutputs(Materials.SulfuricAcid.getFluid(1000)).duration(1 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + // K2S2O7 // GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), // Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust,6), null, 30); // Rh/Os/Ir/Ru - GT_Values.RA.addBlastRecipe( - PTResidue.get(dust), - GT_Utility.getIntegratedCircuit(11), - PotassiumDisulfate.getMolten(360), - RHSulfate.getFluidOrGas(360), - LeachResidue.get(dust), - null, - 200, - 120, - 775); + GT_Values.RA.stdBuilder().itemInputs(PTResidue.get(dust), GT_Utility.getIntegratedCircuit(11)) + .itemOutputs(LeachResidue.get(dust)).fluidInputs(PotassiumDisulfate.getMolten(360)) + .fluidOutputs(RHSulfate.getFluidOrGas(360)).duration(10 * SECONDS).eut(TierEU.RECIPE_MV) + .metadata(COIL_HEAT, 775).addTo(sBlastRecipes); // Ru - GT_Values.RA.addBlastRecipe( - LeachResidue.get(dust, 10), - Materials.Saltpeter.getDust(10), - Materials.SaltWater.getFluid(1000), - GT_ModHandler.getSteam(1000), - SodiumRuthenate.get(dust, 3), - IrOsLeachResidue.get(dust, 6), - 200, - 120, - 775); - GT_Values.RA.addChemicalRecipe( - SodiumRuthenate.get(dust, 6), - Materials.Chlorine.getCells(3), - null, - RutheniumTetroxideSollution.getFluidOrGas(9000), - Materials.Empty.getCells(3), - 300); - GT_Values.RA.addFluidHeaterRecipe( - GT_Utility.getIntegratedCircuit(1), - RutheniumTetroxideSollution.getFluidOrGas(800), - HotRutheniumTetroxideSollution.getFluidOrGas(800), - 300, - 480); + GT_Values.RA.stdBuilder().itemInputs(LeachResidue.get(dust, 10), Materials.Saltpeter.getDust(10)) + .itemOutputs(SodiumRuthenate.get(dust, 3), IrOsLeachResidue.get(dust, 6)) + .fluidInputs(Materials.SaltWater.getFluid(1000)).fluidOutputs(GT_ModHandler.getSteam(1000)) + .duration(10 * SECONDS).eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 775).addTo(sBlastRecipes); + + GT_Values.RA.stdBuilder().itemInputs(SodiumRuthenate.get(dust, 6), Materials.Chlorine.getCells(3)) + .itemOutputs(Materials.Empty.getCells(3)).noFluidInputs() + .fluidOutputs(RutheniumTetroxideSollution.getFluidOrGas(9000)).duration(15 * SECONDS) + .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(1)).noItemOutputs() + .fluidInputs(RutheniumTetroxideSollution.getFluidOrGas(800)) + .fluidOutputs(HotRutheniumTetroxideSollution.getFluidOrGas(800)).duration(15 * SECONDS) + .eut(TierEU.RECIPE_HV).addTo(sFluidHeaterRecipes); + GT_Values.RA.addCrackingRecipe( 17, RutheniumTetroxideSollution.getFluidOrGas(1000), @@ -505,88 +435,56 @@ public class PlatinumSludgeOverHaul { Materials.Salt.getDust(6), 1500, 480); - GT_Values.RA.addChemicalRecipe( - RutheniumTetroxide.get(dust, 1), - Materials.HydrochloricAcid.getCells(6), - null, - Materials.Water.getFluid(2000), - Ruthenium.get(dust), - Materials.Chlorine.getCells(6), - 300); + + GT_Values.RA.stdBuilder().itemInputs(RutheniumTetroxide.get(dust, 1), Materials.HydrochloricAcid.getCells(6)) + .itemOutputs(Ruthenium.get(dust), Materials.Chlorine.getCells(6)).noFluidInputs() + .fluidOutputs(Materials.Water.getFluid(2000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); // Os - GT_Values.RA.addBlastRecipe( - IrOsLeachResidue.get(dust, 4), - GT_Utility.getIntegratedCircuit(11), - Materials.HydrochloricAcid.getFluid(1000), - AcidicOsmiumSolution.getFluidOrGas(2000), - IrLeachResidue.get(dust, 2), - null, - 200, - 120, - 775); + GT_Values.RA.stdBuilder().itemInputs(IrOsLeachResidue.get(dust, 4), GT_Utility.getIntegratedCircuit(11)) + .itemOutputs(IrLeachResidue.get(dust, 2)).fluidInputs(Materials.HydrochloricAcid.getFluid(1000)) + .fluidOutputs(AcidicOsmiumSolution.getFluidOrGas(2000)).duration(10 * SECONDS).eut(TierEU.RECIPE_MV) + .metadata(COIL_HEAT, 775).addTo(sBlastRecipes); + GT_Values.RA.addDistillationTowerRecipe( AcidicOsmiumSolution.getFluidOrGas(1000), new FluidStack[] { OsmiumSolution.getFluidOrGas(100), Materials.Water.getFluid(900) }, null, 150, - BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addChemicalRecipe( - OsmiumSolution.get(cell), - Materials.HydrochloricAcid.getCells(6), - null, - Materials.Water.getFluid(2000), - Materials.Osmium.getDust(1), - Materials.Chlorine.getCells(7), - 300); + (int) TierEU.RECIPE_IV); - // Ir - GT_Values.RA.addBlastRecipe( - IrLeachResidue.get(dust), - GT_Utility.getIntegratedCircuit(1), - null, - null, - PGSDResidue.get(dust), - IridiumDioxide.get(dust), - 200, - 120, - 775); - GT_Values.RA.addChemicalRecipe( - IridiumDioxide.get(dust), - Materials.HydrochloricAcid.getCells(1), - null, - AcidicIridiumSolution.getFluidOrGas(1000), - Materials.Empty.getCells(1), - null, - 300); - GT_Values.RA.addChemicalRecipe( - AcidicIridiumSolution.get(cell), - AmmoniumChloride.get(cell, 3), - null, - Materials.Ammonia.getGas(3000), - Materials.Empty.getCells(4), - IridiumChloride.get(dust), - 300); - GT_Values.RA.addChemicalRecipe( - IridiumChloride.get(dust), - Materials.Calcium.getDust(1), - null, - CalciumChloride.getFluidOrGas(3000), - PGSDResidue2.get(dust), - Materials.Iridium.getDust(1), - 300, - 1920); + GT_Values.RA.stdBuilder().itemInputs(OsmiumSolution.get(cell), Materials.HydrochloricAcid.getCells(6)) + .itemOutputs(Materials.Osmium.getDust(1), Materials.Chlorine.getCells(7)).noFluidInputs() + .fluidOutputs(Materials.Water.getFluid(2000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + // Ir + GT_Values.RA.stdBuilder().itemInputs(IrLeachResidue.get(dust), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(PGSDResidue.get(dust), IridiumDioxide.get(dust)).noFluidInputs().noFluidOutputs() + .duration(10 * SECONDS).eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 775).addTo(sBlastRecipes); + + GT_Values.RA.stdBuilder().itemInputs(IridiumDioxide.get(dust), Materials.HydrochloricAcid.getCells(1)) + .itemOutputs(Materials.Empty.getCells(1)).noFluidInputs() + .fluidOutputs(AcidicIridiumSolution.getFluidOrGas(1000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder().itemInputs(AcidicIridiumSolution.get(cell), AmmoniumChloride.get(cell, 3)) + .itemOutputs(Materials.Empty.getCells(4), IridiumChloride.get(dust)).noFluidInputs() + .fluidOutputs(Materials.Ammonia.getGas(3000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder().itemInputs(IridiumChloride.get(dust), Materials.Calcium.getDust(1)) + .itemOutputs(PGSDResidue2.get(dust), Materials.Iridium.getDust(1)).noFluidInputs() + .fluidOutputs(CalciumChloride.getFluidOrGas(3000)).duration(15 * SECONDS).eut(TierEU.RECIPE_EV) + .addTo(UniversalChemical); // Rh - GT_Values.RA.addChemicalRecipe( - RHSulfate.get(cell, 11), - GT_Utility.getIntegratedCircuit(1), - Materials.Water.getFluid(10000), - Materials.Potassium.getMolten(2000), - RHSulfateSolution.get(cell, 11), - LeachResidue.get(dustTiny, 10), - 300, - 30); + + GT_Values.RA.stdBuilder().itemInputs(RHSulfate.get(cell, 11), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(RHSulfateSolution.get(cell, 11), LeachResidue.get(dustTiny, 10)) + .fluidInputs(Materials.Water.getFluid(10000)).fluidOutputs(Materials.Potassium.getMolten(2000)) + .duration(15 * SECONDS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + GT_Values.RA.addMultiblockChemicalRecipe( new ItemStack[] { GT_Utility.getIntegratedCircuit(3) }, new FluidStack[] { Materials.Water.getFluid(36000), RHSulfate.getFluidOrGas(39600) }, @@ -595,85 +493,56 @@ public class PlatinumSludgeOverHaul { 1200, 30); - GT_Values.RA.addChemicalRecipe( - Materials.Zinc.getDust(1), - null, - RHSulfateSolution.getFluidOrGas(1000), - null, - ZincSulfate.get(dust, 6), - CrudeRhMetall.get(dust), - 300); - GT_Values.RA.addBlastRecipe( - CrudeRhMetall.get(dust), - Materials.Salt.getDust(1), - Materials.Chlorine.getGas(1000), - null, - RHSalt.get(dust, 3), - null, - 300, - 120, - 600); - GT_Values.RA.addMixerRecipe( - RHSalt.get(dust, 10), - null, - null, - null, - Materials.Water.getFluid(2000), - RHSaltSolution.getFluidOrGas(2000), - null, - 300, - 30); - GT_Values.RA.addChemicalRecipe( - SodiumNitrate.get(dust, 5), - GT_Utility.getIntegratedCircuit(1), - RHSaltSolution.getFluidOrGas(1000), - null, - RHNitrate.get(dust), - Materials.Salt.getDust(2), - 300); + GT_Values.RA.stdBuilder().itemInputs(Materials.Zinc.getDust(1)) + .itemOutputs(ZincSulfate.get(dust, 6), CrudeRhMetall.get(dust)) + .fluidInputs(RHSulfateSolution.getFluidOrGas(1000)).noFluidOutputs().duration(15 * SECONDS) + .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + + GT_Values.RA.stdBuilder().itemInputs(CrudeRhMetall.get(dust), Materials.Salt.getDust(1)) + .itemOutputs(RHSalt.get(dust, 3)).fluidInputs(Materials.Chlorine.getGas(1000)).noFluidOutputs() + .duration(15 * SECONDS).eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 600).addTo(sBlastRecipes); + + GT_Values.RA.stdBuilder().itemInputs(RHSalt.get(dust, 10)).noItemOutputs() + .fluidInputs(Materials.Water.getFluid(2000)).fluidOutputs(RHSaltSolution.getFluidOrGas(2000)) + .duration(15 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(SodiumNitrate.get(dust, 5), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(RHNitrate.get(dust), Materials.Salt.getDust(2)) + .fluidInputs(RHSaltSolution.getFluidOrGas(1000)).noFluidOutputs().duration(15 * SECONDS) + .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); // Na + HNO3 = NaNO3 + H - GT_Values.RA.addChemicalRecipe( - Materials.Sodium.getDust(1), - GT_Values.NI, - Materials.NitricAcid.getFluid(1000), - Materials.Hydrogen.getGas(1000), - SodiumNitrate.get(dust, 5), - 8, - 60); - GT_Values.RA.addSifterRecipe( - RHNitrate.get(dust), - new ItemStack[] { RhFilterCake.get(dust), RhFilterCake.get(dust), RhFilterCake.get(dust), - RhFilterCake.get(dust), RhFilterCake.get(dust), RhFilterCake.get(dust), RhFilterCake.get(dust), - RhFilterCake.get(dust), RhFilterCake.get(dust), }, - new int[] { 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, }, - 600, - 30); - GT_Values.RA.addMixerRecipe( - RhFilterCake.get(dust), - null, - null, - null, - Materials.Water.getFluid(1000), - RHFilterCakeSolution.getFluidOrGas(1000), - null, - 300, - 30); - GT_Values.RA.addChemicalRecipe( - GT_Utility.getIntegratedCircuit(2), - null, - RHFilterCakeSolution.getFluidOrGas(1000), - null, - ReRh.get(dust), - null, - 300); - GT_Values.RA.addChemicalRecipe( - ReRh.get(dust), - Materials.Empty.getCells(1), - Materials.HydrochloricAcid.getFluid(1000), - Materials.Chlorine.getGas(1000), - Rhodium.get(dust), - Materials.Ammonia.getCells(1), - 300); + + GT_Values.RA.stdBuilder().itemInputs(Materials.Sodium.getDust(1)).itemOutputs(SodiumNitrate.get(dust, 5)) + .fluidInputs(Materials.NitricAcid.getFluid(1000)).fluidOutputs(Materials.Hydrogen.getGas(1000)) + .duration(8 * TICKS).eut(60).addTo(UniversalChemical); + + GT_Values.RA.stdBuilder().itemInputs(RHNitrate.get(dust)) + .itemOutputs( + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust)) + .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500).noFluidInputs().noFluidOutputs() + .duration(30 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sSifterRecipes); + + GT_Values.RA.stdBuilder().itemInputs(RhFilterCake.get(dust)).noItemOutputs() + .fluidInputs(Materials.Water.getFluid(1000)).fluidOutputs(RHFilterCakeSolution.getFluidOrGas(1000)) + .duration(15 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(2)).itemOutputs(ReRh.get(dust)) + .fluidInputs(RHFilterCakeSolution.getFluidOrGas(1000)).noFluidOutputs().duration(15 * SECONDS) + .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + + GT_Values.RA.stdBuilder().itemInputs(ReRh.get(dust), Materials.Empty.getCells(1)) + .itemOutputs(Rhodium.get(dust), Materials.Ammonia.getCells(1)) + .fluidInputs(Materials.HydrochloricAcid.getFluid(1000)).fluidOutputs(Materials.Chlorine.getGas(1000)) + .duration(15 * SECONDS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + } private static boolean materialsContains(Materials one, ISubTagContainer other) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java index a76364faa7..bc35f0656b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java @@ -15,6 +15,10 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import static gregtech.api.enums.OrePrefixes.dust; import static gregtech.api.enums.OrePrefixes.dustSmall; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; +import static gregtech.api.util.GT_RecipeBuilder.MINUTES; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -22,70 +26,59 @@ import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_OreDictUnificator; public class AddSomeRecipes implements Runnable { public void run() { - GT_Values.RA.addCentrifugeRecipe( - BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), - null, - null, - WerkstoffLoader.Xenon.getFluidOrGas(1), - WerkstoffLoader.Zirconium.get(dust), - WerkstoffLoader.Zirconium.get(dust), - WerkstoffLoader.Tiberium.get(dustSmall, 2), - WerkstoffLoader.Zirconium.get(dust, 2), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 8L), - GT_OreDictUnificator.get(dust, Materials.Platinum, 1L), - new int[] { 10_000, 5_000, 5_000, 2_500, 10_000, 10_000 }, - 250, - 2000); + GT_Values.RA.stdBuilder().itemInputs(BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1)) + .itemOutputs( + WerkstoffLoader.Zirconium.get(dust), + WerkstoffLoader.Zirconium.get(dust), + WerkstoffLoader.Tiberium.get(dustSmall, 2), + WerkstoffLoader.Zirconium.get(dust, 2), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 8L), + GT_OreDictUnificator.get(dust, Materials.Platinum, 1L)) + .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00).noFluidInputs() + .fluidOutputs(WerkstoffLoader.Xenon.getFluidOrGas(1)).duration(12 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_EV).addTo(sCentrifugeRecipes); - GT_Values.RA.addCentrifugeRecipe( - BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), - null, - null, - WerkstoffLoader.Xenon.getFluidOrGas(2), - WerkstoffLoader.Zirconium.get(dust, 2), - WerkstoffLoader.Zirconium.get(dust, 2), - WerkstoffLoader.Tiberium.get(dust), - WerkstoffLoader.Zirconium.get(dust, 4), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 18L), - GT_OreDictUnificator.get(dust, Materials.Platinum, 2L), - new int[] { 10_000, 5_000, 5_000, 2_500, 10_000, 10_000 }, - 500, - 2000); + GT_Values.RA.stdBuilder().itemInputs(BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1)) + .itemOutputs( + WerkstoffLoader.Zirconium.get(dust, 2), + WerkstoffLoader.Zirconium.get(dust, 2), + WerkstoffLoader.Tiberium.get(dust), + WerkstoffLoader.Zirconium.get(dust, 4), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 18L), + GT_OreDictUnificator.get(dust, Materials.Platinum, 2L)) + .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00).noFluidInputs() + .fluidOutputs(WerkstoffLoader.Xenon.getFluidOrGas(2)).duration(12 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_EV).addTo(sCentrifugeRecipes); - GT_Values.RA.addCentrifugeRecipe( - BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), - null, - null, - WerkstoffLoader.Xenon.getFluidOrGas(4), - WerkstoffLoader.Zirconium.get(dust, 4), - WerkstoffLoader.Zirconium.get(dust, 4), - WerkstoffLoader.Tiberium.get(dust, 2), - WerkstoffLoader.Zirconium.get(dust, 8), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 38L), - GT_OreDictUnificator.get(dust, Materials.Platinum, 4L), - new int[] { 10_000, 5_000, 5_000, 2_500, 10_000, 10_000 }, - 1000, - 2000); + GT_Values.RA.stdBuilder().itemInputs(BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1)) + .itemOutputs( + WerkstoffLoader.Zirconium.get(dust, 4), + WerkstoffLoader.Zirconium.get(dust, 4), + WerkstoffLoader.Tiberium.get(dust, 2), + WerkstoffLoader.Zirconium.get(dust, 8), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 38L), + GT_OreDictUnificator.get(dust, Materials.Platinum, 4L)) + .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00).noFluidInputs() + .fluidOutputs(WerkstoffLoader.Xenon.getFluidOrGas(4)).duration(50 * SECONDS).eut(TierEU.RECIPE_EV) + .addTo(sCentrifugeRecipes); + + GT_Values.RA.stdBuilder().itemInputs(BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1)) + .itemOutputs( + ItemList.Depleted_Naquadah_4.get(8), + WerkstoffLoader.Zirconium.get(dust, 64), + WerkstoffLoader.Zirconium.get(dust, 64), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 48L)) + .outputChances(100_00, 50_00, 50_00, 100_00, 100_00, 100_00).noFluidInputs().noFluidOutputs() + .duration(1 * MINUTES + 40 * SECONDS).eut(TierEU.RECIPE_IV).addTo(sCentrifugeRecipes); - GT_Values.RA.addCentrifugeRecipe( - BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), - null, - null, - null, - ItemList.Depleted_Naquadah_4.get(8), - WerkstoffLoader.Zirconium.get(dust, 64), - WerkstoffLoader.Zirconium.get(dust, 64), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 48L), - new int[] { 10_000, 5_000, 5_000, 10_000, 10_000, 10_000 }, - 2000, - 8000); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 0cc8733fff..d2a2d06b38 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -27,6 +27,14 @@ import static gregtech.api.enums.OrePrefixes.gemExquisite; import static gregtech.api.enums.OrePrefixes.gemFlawed; import static gregtech.api.enums.OrePrefixes.stick; import static gregtech.api.enums.OrePrefixes.stickLong; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sSifterRecipes; +import static gregtech.api.util.GT_RecipeBuilder.MINUTES; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; +import static gregtech.api.util.GT_RecipeConstants.ADDITIVE_AMOUNT; import java.lang.reflect.Field; import java.util.Map; @@ -62,6 +70,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -167,7 +176,7 @@ public class AdditionalRecipes { new FluidStack[] { FluidRegistry.getFluidStack("ic2distilledwater", 1000) }, null, 500, - BW_Util.getMachineVoltageFromTier(6), + (int) TierEU.RECIPE_LuV, BW_Util.STANDART); } } @@ -187,7 +196,7 @@ public class AdditionalRecipes { new FluidStack[] { new FluidStack(dnaFluid[0].getFluid(), 8000) }, null, 500, - BW_Util.getMachineVoltageFromTier(6), + (int) TierEU.RECIPE_LuV, BW_Util.STANDART); FluidStack[] easyFluids = { Materials.Water.getFluid(1000L), @@ -209,7 +218,7 @@ public class AdditionalRecipes { new FluidStack[] { fluidStack }, new FluidStack[] { new FluidStack(bioCulture.getFluid(), 10) }, 1000, - BW_Util.getMachineVoltageFromTier(3), + (int) TierEU.RECIPE_HV, BW_Util.STANDART), true); // aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, @@ -229,7 +238,7 @@ public class AdditionalRecipes { new FluidStack[] { new FluidStack(bioCulture.getFluid(), 1000) }, null, 500, - BW_Util.getMachineVoltageFromTier(3), + (int) TierEU.RECIPE_HV, BW_Util.STANDART)); } } @@ -268,17 +277,20 @@ public class AdditionalRecipes { new ItemStack(ItemRegistry.bw_glasses[0], 1, 12), null, 800, - BW_Util.getMachineVoltageFromTier(5), + (int) TierEU.RECIPE_IV, 3663); - // Thorianit recipes - GT_Values.RA.addSifterRecipe( - WerkstoffLoader.Thorianit.get(crushedPurified), - new ItemStack[] { WerkstoffLoader.Thorianit.get(dust), WerkstoffLoader.Thorianit.get(dust), - WerkstoffLoader.Thorianit.get(dust), Materials.Thorium.getDust(1), Materials.Thorium.getDust(1), - WerkstoffLoader.Thorium232.get(dust), }, - new int[] { 7000, 1300, 700, 600, 300, 100 }, - 400, - BW_Util.getMachineVoltageFromTier(5)); + // Thorianite recipes + GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.Thorianit.get(crushedPurified)) + .itemOutputs( + WerkstoffLoader.Thorianit.get(dust), + WerkstoffLoader.Thorianit.get(dust), + WerkstoffLoader.Thorianit.get(dust), + Materials.Thorium.getDust(1), + Materials.Thorium.getDust(1), + WerkstoffLoader.Thorium232.get(dust)) + .outputChances(7000, 1300, 700, 600, 300, 100).noFluidInputs().noFluidOutputs().duration(20 * SECONDS) + .eut((int) TierEU.RECIPE_IV).addTo(sSifterRecipes); + // 3ThO2 + 4Al = 3Th + 2Al2O3 GT_Values.RA.addChemicalRecipe( WerkstoffLoader.Thorianit.get(dust, 9), @@ -315,15 +327,13 @@ public class AdditionalRecipes { WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), GT_Values.NI, 800, - BW_Util.getMachineVoltageFromTier(2), + (int) TierEU.RECIPE_MV, 500); - GT_Values.RA.addPrimitiveBlastRecipe( - GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), - Materials.Amethyst.getDust(10), - 6, - WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), - GT_Values.NI, - 800); + + GT_Values.RA.stdBuilder().itemInputs(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L)) + .itemOutputs(Materials.Amethyst.getDust(10)).noFluidInputs().noFluidOutputs().duration(40 * SECONDS) + .eut(0).metadata(ADDITIVE_AMOUNT, 6).addTo(sPrimitiveBlastRecipes); + // Cubic Circonia // 2Y + 3O = Y2O3 GT_Values.RA.addChemicalRecipe( @@ -333,7 +343,7 @@ public class AdditionalRecipes { GT_Values.NF, WerkstoffLoader.YttriumOxide.get(dust, 5), 4096, - BW_Util.getMachineVoltageFromTier(1)); + (int) TierEU.RECIPE_LV); // Zr + 2O =Y22O3= ZrO2 GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe( false, @@ -344,7 +354,7 @@ public class AdditionalRecipes { new FluidStack[] { Materials.Oxygen.getGas(20000) }, null, 57600, - BW_Util.getMachineVoltageFromTier(3), + (int) TierEU.RECIPE_HV, 2953); // Tellurium GT_Values.RA.addBlastRecipe( @@ -355,7 +365,7 @@ public class AdditionalRecipes { Materials.Lead.getIngots(10), Materials.Tellurium.getNuggets(20), 800, - BW_Util.getMachineVoltageFromTier(2), + (int) TierEU.RECIPE_MV, 722); GT_Values.RA.addFusionReactorRecipe( Materials.Plutonium.getMolten(48), @@ -380,37 +390,31 @@ public class AdditionalRecipes { Materials.Hydrogen.getGas(55), WerkstoffLoader.Xenon.getFluidOrGas(9) }, null, 7500, - BW_Util.getMachineVoltageFromTier(4)); - GT_Values.RA.addAutoclaveRecipe( - WerkstoffLoader.MagnetoResonaticDust.get(dust), - WerkstoffLoader.Neon.getFluidOrGas(1000), - WerkstoffLoader.MagnetoResonaticDust.get(gemChipped, 9), - 9000, - 4500, - BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addAutoclaveRecipe( - WerkstoffLoader.MagnetoResonaticDust.get(dust), - WerkstoffLoader.Krypton.getFluidOrGas(1000), - WerkstoffLoader.MagnetoResonaticDust.get(gem), - 10000, - 4500, - BW_Util.getMachineVoltageFromTier(5)); + (int) TierEU.RECIPE_EV); + + GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.MagnetoResonaticDust.get(dust)) + .itemOutputs(WerkstoffLoader.MagnetoResonaticDust.get(gemChipped, 9)).outputChances(90_00) + .fluidInputs(WerkstoffLoader.Neon.getFluidOrGas(1000)).noFluidOutputs() + .duration(3 * MINUTES + 45 * SECONDS).eut(TierEU.RECIPE_IV).addTo(sAutoclaveRecipes); + + GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.MagnetoResonaticDust.get(dust)) + .itemOutputs(WerkstoffLoader.MagnetoResonaticDust.get(gem)) + .fluidInputs(WerkstoffLoader.Krypton.getFluidOrGas(1000)).noFluidOutputs() + .duration(3 * MINUTES + 45 * SECONDS).eut(TierEU.RECIPE_IV).addTo(sAutoclaveRecipes); // Milk - GT_Values.RA.addCentrifugeRecipe( - GT_Utility.getIntegratedCircuit(1), - GT_Values.NI, - Materials.Milk.getFluid(10000), - Materials.Water.getFluid(8832), - Materials.Sugar.getDustSmall(21), - Materials.Calcium.getDustTiny(1), - Materials.Magnesium.getDustTiny(1), - Materials.Potassium.getDustTiny(1), - Materials.Sodium.getDustTiny(4), - Materials.Phosphor.getDustTiny(1), - new int[] { 10000, 10000, 1000, 10000, 1000, 1000 }, - 50, - 120); + + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(1)) + .itemOutputs( + Materials.Sugar.getDustSmall(21), + Materials.Calcium.getDustTiny(1), + Materials.Magnesium.getDustTiny(1), + Materials.Potassium.getDustTiny(1), + Materials.Sodium.getDustTiny(4), + Materials.Phosphor.getDustTiny(1)) + .outputChances(100_00, 100_00, 10_00, 100_00, 10_00, 10_00).fluidInputs(Materials.Milk.getFluid(10000)) + .fluidOutputs(Materials.Water.getFluid(8832)).duration(2 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_MV) + .addTo(sCentrifugeRecipes); // Magneto Resonatic Circuits @@ -435,7 +439,7 @@ public class AdditionalRecipes { new FluidStack[] { Materials.SolderingAlloy.getMolten(36) }, null, 750, - BW_Util.getMachineVoltageFromTier(1), + (int) TierEU.RECIPE_LV, CLEANROOM)); // LV-EV for (int i = 1; i <= 4; i++) { @@ -631,7 +635,7 @@ public class AdditionalRecipes { null, BW_NonMeta_MaterialItems.TheCoreCell.get(1L), 100, - BW_Util.getMachineVoltageFromTier(6)); + (int) TierEU.RECIPE_LuV); GregTech_API.sAfterGTPostload.add(new AddSomeRecipes()); AdditionalRecipes.oldGThelperMethod(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java index 4f52aab4ed..bf76e81d13 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java @@ -17,13 +17,17 @@ import static gregtech.api.enums.OrePrefixes.block; import static gregtech.api.enums.OrePrefixes.cellMolten; import static gregtech.api.enums.OrePrefixes.ingot; import static gregtech.api.enums.OrePrefixes.plate; - -import net.minecraft.item.ItemStack; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCutterRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; +import static gregtech.api.util.GT_RecipeConstants.UniversalArcFurnace; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.TierEU; public class BlockLoader implements IWerkstoffRunnable { @@ -31,24 +35,22 @@ public class BlockLoader implements IWerkstoffRunnable { public void run(Werkstoff werkstoff) { if (!werkstoff.hasItemType(block)) return; if (werkstoff.hasItemType(ingot)) { - GT_Values.RA.addArcFurnaceRecipe( - werkstoff.get(block), - new ItemStack[] { werkstoff.get(ingot, 9) }, - null, - 16, - 90, - false); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).itemOutputs(werkstoff.get(ingot, 9)) + .noFluidInputs().noFluidOutputs().duration(16 * TICKS).eut(90).addTo(UniversalArcFurnace); } if (werkstoff.hasItemType(cellMolten)) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(block), null, werkstoff.getMolten(1296), 0, 288, 8); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).noItemOutputs().noFluidInputs() + .fluidOutputs(werkstoff.getMolten(1296)).duration(14 * SECONDS + 8 * TICKS).eut(8) + .addTo(sFluidExtractionRecipes); + } if (werkstoff.hasItemType(plate)) { - GT_Values.RA.addCutterRecipe( - werkstoff.get(block), - werkstoff.get(plate, 9), - null, - (int) Math.max(werkstoff.getStats().getMass() * 10L, 1L), - 30); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).itemOutputs(werkstoff.get(plate, 9)) + .noFluidInputs().noFluidOutputs().duration((int) Math.max(werkstoff.getStats().getMass() * 10L, 1L)) + .eut(TierEU.RECIPE_LV).addTo(sCutterRecipes); + } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java index be8a2f95ad..021d827b69 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java @@ -21,8 +21,8 @@ import static gregtech.api.enums.OrePrefixes.plank; import static gregtech.api.enums.OrePrefixes.plate; import static gregtech.api.enums.OrePrefixes.plateDouble; import static gregtech.api.enums.OrePrefixes.screw; - -import net.minecraft.item.ItemStack; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import com.github.bartimaeusnek.bartworks.system.material.BW_GT_MaterialReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -30,6 +30,7 @@ import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWer import gregtech.api.enums.GT_Values; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_ModHandler; public class CasingLoader implements IWerkstoffRunnable { @@ -55,23 +56,20 @@ public class CasingLoader implements IWerkstoffRunnable { werkstoff.get(blockCasing), new Object[] { "PSP", "PGP", "PSP", 'P', werkstoff.get(plate), 'S', werkstoff.get(screw), 'G', werkstoff.get(gearGtSmall) }); - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { werkstoff.get(plate, 6), werkstoff.get(screw, 2), werkstoff.get(gearGtSmall) }, - GT_Values.NF, - werkstoff.get(blockCasing), - 200, - 30); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(plate, 6), werkstoff.get(screw, 2), werkstoff.get(gearGtSmall)) + .itemOutputs(werkstoff.get(blockCasing)).noFluidInputs().noFluidOutputs().duration(10 * SECONDS) + .eut(TierEU.RECIPE_LV).addTo(sAssemblerRecipes); GT_ModHandler.addCraftingRecipe( werkstoff.get(blockCasingAdvanced), new Object[] { "PSP", "PGP", "PSP", 'P', werkstoff.get(reboltedCasingsOuterStuff), 'S', werkstoff.get(screw), 'G', werkstoff.get(gearGt) }); - GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { werkstoff.get(reboltedCasingsOuterStuff, 6), werkstoff.get(screw, 2), - werkstoff.get(gearGt) }, - GT_Values.NF, - werkstoff.get(blockCasingAdvanced), - 200, - 30); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(reboltedCasingsOuterStuff, 6), werkstoff.get(screw, 2), werkstoff.get(gearGt)) + .itemOutputs(werkstoff.get(blockCasingAdvanced)).noFluidInputs().noFluidOutputs().duration(10 * SECONDS) + .eut(TierEU.RECIPE_LV).addTo(sAssemblerRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java index b128d7dac6..d6bdecb3e8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java @@ -17,6 +17,10 @@ import static gregtech.api.enums.Mods.Forestry; import static gregtech.api.enums.OrePrefixes.capsule; import static gregtech.api.enums.OrePrefixes.cell; import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; import java.util.ArrayList; import java.util.HashMap; @@ -179,16 +183,15 @@ public class CellLoader implements IWerkstoffRunnable { werkstoff.getFluidOrGas(1).getFluid(), werkstoff.get(cell), Materials.Empty.getCells(1)); - GT_Values.RA.addFluidCannerRecipe( - Materials.Empty.getCells(1), - werkstoff.get(cell), - new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), - GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe( - werkstoff.get(cell), - Materials.Empty.getCells(1), - GT_Values.NF, - new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)); + + GT_Values.RA.stdBuilder().itemInputs(Materials.Empty.getCells(1)).itemOutputs(werkstoff.get(cell)) + .fluidInputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)) + .noFluidOutputs().duration(16 * TICKS).eut(2).addTo(sFluidCannerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(cell)).itemOutputs(Materials.Empty.getCells(1)) + .noFluidInputs() + .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)) + .duration(16 * TICKS).eut(2).addTo(sFluidCannerRecipes); if (Forestry.isModLoaded()) { FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( @@ -198,27 +201,23 @@ public class CellLoader implements IWerkstoffRunnable { true); GT_Utility.addFluidContainerData(emptyData); FluidContainerRegistry.registerFluidContainer(emptyData); - GT_Values.RA.addFluidCannerRecipe( - werkstoff.get(capsule), - GT_Values.NI, - GT_Values.NF, - new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(capsule)).noItemOutputs().noFluidInputs() + .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)) + .duration(16 * TICKS).eut(2).addTo(sFluidCannerRecipes); } if (werkstoff.hasItemType(dust)) { - GT_Values.RA.addFluidExtractionRecipe( - werkstoff.get(dust), - null, - werkstoff.getFluidOrGas(1000), - 0, - (int) werkstoff.getStats().getMass(), - werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe( - GT_Utility.getIntegratedCircuit(1), - werkstoff.getFluidOrGas(1000), - werkstoff.get(dust), - (int) werkstoff.getStats().getMass(), - werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust)).noItemOutputs().noFluidInputs() + .fluidOutputs(werkstoff.getFluidOrGas(1000)).duration(werkstoff.getStats().getMass()) + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidExtractionRecipes); + + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(1)).itemOutputs(werkstoff.get(dust)) + .fluidInputs(werkstoff.getFluidOrGas(1000)).noFluidOutputs() + .duration((int) werkstoff.getStats().getMass()).eut(werkstoff.getStats().getMass() > 128 ? 64 : 30) + .addTo(sFluidSolidficationRecipes); + } if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java index 00a9915ca9..cf5bd7f03a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java @@ -28,8 +28,14 @@ import static gregtech.api.enums.OrePrefixes.rotor; import static gregtech.api.enums.OrePrefixes.screw; import static gregtech.api.enums.OrePrefixes.stick; import static gregtech.api.enums.OrePrefixes.wireFine; - -import net.minecraft.item.ItemStack; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCutterRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sExtruderRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sLatheRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sWiremillRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -50,52 +56,45 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { int tVoltageMultiplier = werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15; // bolt - GT_Values.RA.addExtruderRecipe( - werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(ingot), - ItemList.Shape_Extruder_Bolt.get(0L), - werkstoff.get(bolt, 8), - (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), - 8 * tVoltageMultiplier); - GT_Values.RA.addCutterRecipe( - werkstoff.get(stick), - werkstoff.get(bolt, 4), - null, - (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), - 4); - GT_Values.RA.addPulveriserRecipe( - werkstoff.get(bolt), - new ItemStack[] { werkstoff.get(dustTiny, 1) }, - null, - 2, - 8); + + GT_Values.RA.stdBuilder() + .itemInputs( + werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(ingot), + ItemList.Shape_Extruder_Bolt.get(0L)) + .itemOutputs(werkstoff.get(bolt, 8)).noFluidInputs().noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1)).eut(8 * tVoltageMultiplier) + .addTo(sExtruderRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick)).itemOutputs(werkstoff.get(bolt, 4)) + .noFluidInputs().noFluidOutputs().duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)) + .eut(4).addTo(sCutterRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(bolt)).itemOutputs(werkstoff.get(dustTiny, 1)) + .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); // screw - GT_Values.RA.addLatheRecipe( - werkstoff.get(bolt), - werkstoff.get(screw), - null, - (int) Math.max(werkstoff.getStats().getMass() / 8L, 1L), - 4); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(bolt)).itemOutputs(werkstoff.get(screw)).noFluidInputs() + .noFluidOutputs().duration((int) Math.max(werkstoff.getStats().getMass() / 8L, 1L)).eut(4) + .addTo(sLatheRecipes); + GT_ModHandler.addCraftingRecipe( werkstoff.get(screw), GT_Proxy.tBits, new Object[] { "fX", "X ", 'X', werkstoff.get(bolt) }); - GT_Values.RA.addPulveriserRecipe( - werkstoff.get(screw), - new ItemStack[] { werkstoff.get(dustTiny, 1) }, - null, - 2, - 8); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(screw)).itemOutputs(werkstoff.get(dustTiny, 1)) + .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); if (werkstoff.hasItemType(gem)) return; // ring - GT_Values.RA.addExtruderRecipe( - werkstoff.get(ingot), - ItemList.Shape_Extruder_Ring.get(0L), - werkstoff.get(ring, 4), - (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), - 6 * tVoltageMultiplier); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Ring.get(0L)) + .itemOutputs(werkstoff.get(ring, 4)).noFluidInputs().noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1)).eut(6 * tVoltageMultiplier) + .addTo(sExtruderRecipes); + GT_ModHandler.addCraftingRecipe( werkstoff.get(ring), GT_Proxy.tBits, @@ -106,40 +105,37 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { werkstoff.get(gearGt), GT_Proxy.tBits, new Object[] { "SPS", "PwP", "SPS", 'P', werkstoff.get(plate), 'S', werkstoff.get(stick) }); - GT_Values.RA.addExtruderRecipe( - werkstoff.get(ingot, 4), - ItemList.Shape_Extruder_Gear.get(0L), - werkstoff.get(gearGt), - (int) Math.max(werkstoff.getStats().getMass() * 5L, 1), - 8 * tVoltageMultiplier); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 4), ItemList.Shape_Extruder_Gear.get(0L)) + .itemOutputs(werkstoff.get(gearGt)).noFluidInputs().noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() * 5L, 1)).eut(8 * tVoltageMultiplier) + .addTo(sExtruderRecipes); // wireFine - GT_Values.RA.addExtruderRecipe( - werkstoff.get(ingot), - ItemList.Shape_Extruder_Wire.get(0L), - werkstoff.get(wireFine, 8), - (int) Math.max(werkstoff.getStats().getMass() * 1.5F, 1F), - 8 * tVoltageMultiplier); - GT_Values.RA.addWiremillRecipe( - werkstoff.get(ingot), - GT_Utility.getIntegratedCircuit(3), - werkstoff.get(wireFine, 8), - (int) Math.max(werkstoff.getStats().getMass(), 1), - 8 * tVoltageMultiplier); - GT_Values.RA.addWiremillRecipe( - werkstoff.get(stick), - GT_Utility.getIntegratedCircuit(3), - werkstoff.get(wireFine, 4), - (int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F), - 8 * tVoltageMultiplier); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Wire.get(0L)) + .itemOutputs(werkstoff.get(wireFine, 8)).noFluidInputs().noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() * 1.5F, 1F)).eut(8 * tVoltageMultiplier) + .addTo(sExtruderRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(3)) + .itemOutputs(werkstoff.get(wireFine, 8)).noFluidInputs().noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass(), 1)).eut(8 * tVoltageMultiplier) + .addTo(sWiremillRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick), GT_Utility.getIntegratedCircuit(3)) + .itemOutputs(werkstoff.get(wireFine, 4)).noFluidInputs().noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F)).eut(8 * tVoltageMultiplier) + .addTo(sWiremillRecipes); // smallGear - if (WerkstoffLoader.smallGearShape != null) GT_Values.RA.addExtruderRecipe( - werkstoff.get(ingot), - WerkstoffLoader.smallGearShape.get(0L), - werkstoff.get(gearGtSmall), - (int) werkstoff.getStats().getMass(), - 8 * tVoltageMultiplier); + if (WerkstoffLoader.smallGearShape != null) { + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), WerkstoffLoader.smallGearShape.get(0L)) + .itemOutputs(werkstoff.get(gearGtSmall)).noFluidInputs().noFluidOutputs() + .duration((int) werkstoff.getStats().getMass()).eut(8 * tVoltageMultiplier) + .addTo(sExtruderRecipes); + + } GT_ModHandler.addCraftingRecipe( werkstoff.get(gearGtSmall), @@ -152,34 +148,26 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { GT_Proxy.tBits, new Object[] { "PhP", "SRf", "PdP", 'P', werkstoff.get(plate), 'R', werkstoff.get(ring), 'S', werkstoff.get(screw) }); - GT_Values.RA.addAssemblerRecipe( - werkstoff.get(plate, 4), - werkstoff.get(ring), - Materials.Tin.getMolten(32), - werkstoff.get(rotor), - 240, - 24); - GT_Values.RA.addAssemblerRecipe( - werkstoff.get(plate, 4), - werkstoff.get(ring), - Materials.Lead.getMolten(48), - werkstoff.get(rotor), - 240, - 24); - GT_Values.RA.addAssemblerRecipe( - werkstoff.get(plate, 4), - werkstoff.get(ring), - Materials.SolderingAlloy.getMolten(16), - werkstoff.get(rotor), - 240, - 24); - if (WerkstoffLoader.rotorShape != null) GT_Values.RA.addExtruderRecipe( - werkstoff.get(ingot, 5), - WerkstoffLoader.rotorShape.get(0L), - werkstoff.get(rotor), - 200, - 60); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate, 4), werkstoff.get(ring)) + .itemOutputs(werkstoff.get(rotor)).fluidInputs(Materials.Tin.getMolten(32)).noFluidOutputs() + .duration(12 * SECONDS).eut(24).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate, 4), werkstoff.get(ring)) + .itemOutputs(werkstoff.get(rotor)).fluidInputs(Materials.Lead.getMolten(48)).noFluidOutputs() + .duration(12 * SECONDS).eut(24).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate, 4), werkstoff.get(ring)) + .itemOutputs(werkstoff.get(rotor)).fluidInputs(Materials.SolderingAlloy.getMolten(16)) + .noFluidOutputs().duration(12 * SECONDS).eut(24).addTo(sAssemblerRecipes); + + if (WerkstoffLoader.rotorShape != null) { + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 5), WerkstoffLoader.rotorShape.get(0L)) + .itemOutputs(werkstoff.get(rotor)).noFluidInputs().noFluidOutputs().duration(10 * SECONDS) + .eut(60).addTo(sExtruderRecipes); + + } // molten -> metal if (werkstoff.hasItemType(cellMolten)) { @@ -198,26 +186,19 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { */ } - GT_Values.RA - .addPulveriserRecipe(werkstoff.get(gearGt), new ItemStack[] { werkstoff.get(dust, 4) }, null, 2, 8); - GT_Values.RA.addPulveriserRecipe( - werkstoff.get(gearGtSmall), - new ItemStack[] { werkstoff.get(dust, 1) }, - null, - 2, - 8); - GT_Values.RA.addPulveriserRecipe( - werkstoff.get(rotor), - new ItemStack[] { werkstoff.get(dust, 4), werkstoff.get(dustSmall) }, - null, - 2, - 8); - GT_Values.RA.addPulveriserRecipe( - werkstoff.get(ring), - new ItemStack[] { werkstoff.get(dustSmall, 1) }, - null, - 2, - 8); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gearGt)).itemOutputs(werkstoff.get(dust, 4)) + .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gearGtSmall)).itemOutputs(werkstoff.get(dust, 1)) + .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(rotor)) + .itemOutputs(werkstoff.get(dust, 4), werkstoff.get(dustSmall)).noFluidInputs().noFluidOutputs() + .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ring)).itemOutputs(werkstoff.get(dustSmall, 1)) + .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java index f3e2d1dba9..b1926f570d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java @@ -24,6 +24,14 @@ import static gregtech.api.enums.OrePrefixes.gem; import static gregtech.api.enums.OrePrefixes.ingot; import static gregtech.api.enums.OrePrefixes.nugget; import static gregtech.api.enums.OrePrefixes.ore; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sElectroMagneticSeparatorRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sHammerRecipes; +import static gregtech.api.util.GT_RecipeBuilder.MINUTES; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; @@ -66,7 +74,9 @@ public class CrushedLoader implements IWerkstoffRunnable { werkstoff.get(dust), new Object[] { "h ", "W ", 'W', werkstoff.get(crushedCentrifuged) }); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), 10, 16); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushed)).itemOutputs(werkstoff.get(dustImpure)) + .noFluidInputs().noFluidOutputs().duration(10 * TICKS).eut(16).addTo(sHammerRecipes); + GT_ModHandler.addPulverisationRecipe( werkstoff.get(crushed), werkstoff.get(dustImpure), @@ -88,7 +98,9 @@ public class CrushedLoader implements IWerkstoffRunnable { werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), 10, 16); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushedPurified)).itemOutputs(werkstoff.get(dustPure)) + .noFluidInputs().noFluidOutputs().duration(10 * TICKS).eut(16).addTo(sHammerRecipes); + GT_ModHandler.addPulverisationRecipe( werkstoff.get(crushedPurified), werkstoff.get(dustPure), @@ -102,7 +114,9 @@ public class CrushedLoader implements IWerkstoffRunnable { werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dust)); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(dust), 10, 16); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushedCentrifuged)).itemOutputs(werkstoff.get(dust)) + .noFluidInputs().noFluidOutputs().duration(10 * TICKS).eut(16).addTo(sHammerRecipes); + GT_ModHandler.addPulverisationRecipe( werkstoff.get(crushedCentrifuged), werkstoff.get(dust), @@ -110,108 +124,90 @@ public class CrushedLoader implements IWerkstoffRunnable { 10, false); - GT_Values.RA.addCentrifugeRecipe( - werkstoff.get(dustImpure), - null, - null, - null, - werkstoff.get(dust), - werkstoff.getOreByProduct(0, dust), - null, - null, - null, - null, - new int[] { 10000, 1111 }, - (int) Math.max(1L, werkstoff.getStats().getMass() * 8L), - 5); - GT_Values.RA.addCentrifugeRecipe( - werkstoff.get(dustPure), - null, - null, - null, - werkstoff.get(dust), - werkstoff.getOreByProduct(1, dust), - null, - null, - null, - null, - new int[] { 10000, 1111 }, - (int) Math.max(1L, werkstoff.getStats().getMass() * 8L), - 5); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustImpure)) + .itemOutputs(werkstoff.get(dust), werkstoff.getOreByProduct(0, dust)).outputChances(100_00, 11_11) + .noFluidInputs().noFluidOutputs().duration(Math.max(1L, werkstoff.getStats().getMass() * 8L)).eut(5) + .addTo(sCentrifugeRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)) + .itemOutputs(werkstoff.get(dust), werkstoff.getOreByProduct(1, dust)).outputChances(100_00, 11_11) + .noFluidInputs().noFluidOutputs().duration(Math.max(1L, werkstoff.getStats().getMass() * 8L)).eut(5) + .addTo(sCentrifugeRecipes); if (werkstoff.contains(SubTag.CRYSTALLISABLE)) { - GT_Values.RA.addAutoclaveRecipe( - werkstoff.get(dustPure), - Materials.Water.getFluid(200L), - werkstoff.get(gem), - 9000, - 2000, - 24); - GT_Values.RA.addAutoclaveRecipe( - werkstoff.get(dustImpure), - Materials.Water.getFluid(200L), - werkstoff.get(gem), - 9000, - 2000, - 24); - GT_Values.RA.addAutoclaveRecipe( - werkstoff.get(dustPure), - gregtech.api.util.GT_ModHandler.getDistilledWater(200L), - werkstoff.get(gem), - 9500, - 1500, - 24); - GT_Values.RA.addAutoclaveRecipe( - werkstoff.get(dustImpure), - gregtech.api.util.GT_ModHandler.getDistilledWater(200L), - werkstoff.get(gem), - 9500, - 1500, - 24); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)).itemOutputs(werkstoff.get(gem)) + .outputChances(9000).fluidInputs(Materials.Water.getFluid(200L)).noFluidOutputs() + .duration(1 * MINUTES + 40 * SECONDS).eut(24).addTo(sAutoclaveRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustImpure)).itemOutputs(werkstoff.get(gem)) + .outputChances(9000).fluidInputs(Materials.Water.getFluid(200L)).noFluidOutputs() + .duration(1 * MINUTES + 40 * SECONDS).eut(24).addTo(sAutoclaveRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)).itemOutputs(werkstoff.get(gem)) + .outputChances(9500).fluidInputs(gregtech.api.util.GT_ModHandler.getDistilledWater(200L)) + .noFluidOutputs().duration(1 * MINUTES + 15 * SECONDS).eut(24).addTo(sAutoclaveRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustImpure)).itemOutputs(werkstoff.get(gem)) + .outputChances(9500).fluidInputs(gregtech.api.util.GT_ModHandler.getDistilledWater(200L)) + .noFluidOutputs().duration(1 * MINUTES + 15 * SECONDS).eut(24).addTo(sAutoclaveRecipes); + + } + if (werkstoff.contains(SubTag.WASHING_MERCURY)) { + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushed)) + .itemOutputs( + werkstoff.get(crushedPurified), + werkstoff.getOreByProduct(1, dust), + GT_OreDictUnificator.get(dust, Materials.Stone, 1L)) + .outputChances(10000, 7000, 4000).fluidInputs(Materials.Mercury.getFluid(1000L)).noFluidOutputs() + .duration(40 * SECONDS).eut(8).addTo(sChemicalBathRecipes); + + } + if (werkstoff.contains(SubTag.WASHING_SODIUMPERSULFATE)) { + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushed)) + .itemOutputs( + werkstoff.get(crushedPurified), + werkstoff.getOreByProduct(1, dust), + GT_OreDictUnificator.get(dust, Materials.Stone, 1L)) + .outputChances(10000, 7000, 4000) + .fluidInputs( + Materials.SodiumPersulfate + .getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L)) + .noFluidOutputs().duration(40 * SECONDS).eut(8).addTo(sChemicalBathRecipes); + + } + if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_GOLD)) { + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)) + .itemOutputs( + werkstoff.get(dust), + GT_OreDictUnificator.get(dustSmall, Materials.Gold, 1L), + GT_OreDictUnificator.get(nugget, Materials.Gold, 1L)) + .outputChances(10000, 4000, 2000).noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(24) + .addTo(sElectroMagneticSeparatorRecipes); + + } else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_IRON)) { + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)) + .itemOutputs( + werkstoff.get(dust), + GT_OreDictUnificator.get(dustSmall, Materials.Iron, 1L), + GT_OreDictUnificator.get(nugget, Materials.Iron, 1L)) + .outputChances(10000, 4000, 2000).noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(24) + .addTo(sElectroMagneticSeparatorRecipes); + + } else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM)) { + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)) + .itemOutputs( + werkstoff.get(dust), + GT_OreDictUnificator.get(dustSmall, Materials.Neodymium, 1L), + GT_OreDictUnificator.get(nugget, Materials.Neodymium, 1L)) + .outputChances(10000, 4000, 2000).noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(24) + .addTo(sElectroMagneticSeparatorRecipes); + } - if (werkstoff.contains(SubTag.WASHING_MERCURY)) GT_Values.RA.addChemicalBathRecipe( - werkstoff.get(crushed), - Materials.Mercury.getFluid(1000L), - werkstoff.get(crushedPurified), - werkstoff.getOreByProduct(1, dust), - GT_OreDictUnificator.get(dust, Materials.Stone, 1L), - new int[] { 10000, 7000, 4000 }, - 800, - 8); - if (werkstoff.contains(SubTag.WASHING_SODIUMPERSULFATE)) GT_Values.RA.addChemicalBathRecipe( - werkstoff.get(crushed), - Materials.SodiumPersulfate.getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L), - werkstoff.get(crushedPurified), - werkstoff.getOreByProduct(1, dust), - GT_OreDictUnificator.get(dust, Materials.Stone, 1L), - new int[] { 10000, 7000, 4000 }, - 800, - 8); - if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_GOLD)) GT_Values.RA.addElectromagneticSeparatorRecipe( - werkstoff.get(dustPure), - werkstoff.get(dust), - GT_OreDictUnificator.get(dustSmall, Materials.Gold, 1L), - GT_OreDictUnificator.get(nugget, Materials.Gold, 1L), - new int[] { 10000, 4000, 2000 }, - 400, - 24); - else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_IRON)) - GT_Values.RA.addElectromagneticSeparatorRecipe( - werkstoff.get(dustPure), - werkstoff.get(dust), - GT_OreDictUnificator.get(dustSmall, Materials.Iron, 1L), - GT_OreDictUnificator.get(nugget, Materials.Iron, 1L), - new int[] { 10000, 4000, 2000 }, - 400, - 24); - else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM)) - GT_Values.RA.addElectromagneticSeparatorRecipe( - werkstoff.get(dustPure), - werkstoff.get(dust), - GT_OreDictUnificator.get(dustSmall, Materials.Neodymium, 1L), - GT_OreDictUnificator.get(nugget, Materials.Neodymium, 1L), - new int[] { 10000, 4000, 2000 }, - 400, - 24); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java index dca73ad91b..3eb4e90285 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java @@ -22,6 +22,14 @@ import static gregtech.api.enums.OrePrefixes.gem; import static gregtech.api.enums.OrePrefixes.ingot; import static gregtech.api.enums.OrePrefixes.ingotHot; import static gregtech.api.enums.OrePrefixes.nugget; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBlastRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sVacuumRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeConstants.ADDITIVE_AMOUNT; +import static gregtech.api.util.GT_RecipeConstants.COIL_HEAT; import java.util.ArrayList; import java.util.HashMap; @@ -40,6 +48,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.TextureSet; +import gregtech.api.enums.TierEU; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; @@ -306,30 +315,21 @@ public class DustLoader implements IWerkstoffRunnable { WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff, 9), new Object[] { "T ", 'T', werkstoff.get(dust) }); - GT_Values.RA.addBoxingRecipe( - werkstoff.get(dustTiny, 9), - ItemList.Schematic_Dust.get(0L), - werkstoff.get(dust), - 100, - 4); - GT_Values.RA.addBoxingRecipe( - werkstoff.get(dustSmall, 4), - ItemList.Schematic_Dust.get(0L), - werkstoff.get(dust), - 100, - 4); - GT_Values.RA.addBoxingRecipe( - werkstoff.get(dustTiny, 9), - ItemList.Schematic_3by3.get(0L), - werkstoff.get(dust), - 100, - 4); - GT_Values.RA.addBoxingRecipe( - werkstoff.get(dustSmall, 4), - ItemList.Schematic_2by2.get(0L), - werkstoff.get(dust), - 100, - 4); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustTiny, 9), ItemList.Schematic_Dust.get(0L)) + .itemOutputs(werkstoff.get(dust)).noFluidInputs().noFluidOutputs().duration(5 * SECONDS).eut(4) + .addTo(sBoxinatorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustSmall, 4), ItemList.Schematic_Dust.get(0L)) + .itemOutputs(werkstoff.get(dust)).noFluidInputs().noFluidOutputs().duration(5 * SECONDS).eut(4) + .addTo(sBoxinatorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustTiny, 9), ItemList.Schematic_3by3.get(0L)) + .itemOutputs(werkstoff.get(dust)).noFluidInputs().noFluidOutputs().duration(5 * SECONDS).eut(4) + .addTo(sBoxinatorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustSmall, 4), ItemList.Schematic_2by2.get(0L)) + .itemOutputs(werkstoff.get(dust)).noFluidInputs().noFluidOutputs().duration(5 * SECONDS).eut(4) + .addTo(sBoxinatorRecipes); if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) { GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); @@ -337,70 +337,76 @@ public class DustLoader implements IWerkstoffRunnable { } else if (werkstoff.hasItemType(ingot) && werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().getMeltingPoint() != 0) { if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)) { - GT_Values.RA.addBlastRecipe( - werkstoff.get(dust), - GT_Utility.getIntegratedCircuit(11), - Materials.Nitrogen.getGas(1000), - null, - werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) - : werkstoff.get(ingotHot), - null, - (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) - * werkstoff.getStats().getMeltingPoint(), - werkstoff.getStats().getMeltingVoltage(), - werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11)) + .itemOutputs( + werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) + : werkstoff.get(ingotHot)) + .fluidInputs(Materials.Nitrogen.getGas(1000)).noFluidOutputs() + .duration( + Math.max(werkstoff.getStats().getMass() / 40L, 1L) + * werkstoff.getStats().getMeltingPoint()) + .eut(werkstoff.getStats().getMeltingVoltage()) + .metadata(COIL_HEAT, werkstoff.getStats().getMeltingPoint()).addTo(sBlastRecipes); + } else if (werkstoff.contains(WerkstoffLoader.NOBLE_GAS_SMELTING)) { - GT_Values.RA.addBlastRecipe( - werkstoff.get(dust), - GT_Utility.getIntegratedCircuit(11), - Materials.Argon.getGas(1000), - null, - werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) - : werkstoff.get(ingotHot), - null, - (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) - * werkstoff.getStats().getMeltingPoint(), - werkstoff.getStats().getMeltingVoltage(), - werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11)) + .itemOutputs( + werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) + : werkstoff.get(ingotHot)) + .fluidInputs(Materials.Argon.getGas(1000)).noFluidOutputs() + .duration( + Math.max(werkstoff.getStats().getMass() / 40L, 1L) + * werkstoff.getStats().getMeltingPoint()) + .eut(werkstoff.getStats().getMeltingVoltage()) + .metadata(COIL_HEAT, werkstoff.getStats().getMeltingPoint()).addTo(sBlastRecipes); + } else { - GT_Values.RA.addBlastRecipe( - werkstoff.get(dust), - GT_Utility.getIntegratedCircuit(1), - null, - null, - werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) - : werkstoff.get(ingotHot), - null, - (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) - * werkstoff.getStats().getMeltingPoint(), - werkstoff.getStats().getMeltingVoltage(), - werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs( + werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) + : werkstoff.get(ingotHot)) + .noFluidInputs().noFluidOutputs() + .duration( + Math.max(werkstoff.getStats().getMass() / 40L, 1L) + * werkstoff.getStats().getMeltingPoint()) + .eut(werkstoff.getStats().getMeltingVoltage()) + .metadata(COIL_HEAT, werkstoff.getStats().getMeltingPoint()).addTo(sBlastRecipes); + if (werkstoff.getStats().getMeltingPoint() <= 1000) { - GT_Values.RA.addPrimitiveBlastRecipe( - werkstoff.get(dust), - null, - 9, - werkstoff.get(ingot), - null, - (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) - * werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust)) + .itemOutputs(werkstoff.get(ingot)).noFluidInputs().noFluidOutputs() + .duration( + (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) + * werkstoff.getStats().getMeltingPoint()) + .eut(0).metadata(ADDITIVE_AMOUNT, 9).addTo(sPrimitiveBlastRecipes); } } } if (werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().getMeltingPoint() > 1750) { - GT_Values.RA.addVacuumFreezerRecipe( - werkstoff.get(ingotHot), - werkstoff.get(ingot), - (int) Math.max(werkstoff.getStats().getMass() * 3L, 1L)); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingotHot)).itemOutputs(werkstoff.get(ingot)) + .noFluidInputs().noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() * 3L, 1L)).eut(TierEU.RECIPE_MV) + .addTo(sVacuumRecipes); } if (werkstoff.hasItemType(ingot)) { - GT_ModHandler.addPulverisationRecipe(werkstoff.get(ingot), werkstoff.get(dust)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(nugget), werkstoff.get(dustTiny)); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)).itemOutputs(werkstoff.get(dust)) + .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(nugget)).itemOutputs(werkstoff.get(dustTiny)) + .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + } if (werkstoff.hasItemType(ingot) || werkstoff.hasItemType(gem)) { - GT_ModHandler.addPulverisationRecipe(werkstoff.get(block), werkstoff.get(dust, 9)); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).itemOutputs(werkstoff.get(dust, 9)) + .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java index 3788f50a31..1f9122c538 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java @@ -26,6 +26,17 @@ import static gregtech.api.enums.OrePrefixes.gemFlawless; import static gregtech.api.enums.OrePrefixes.lens; import static gregtech.api.enums.OrePrefixes.ore; import static gregtech.api.enums.OrePrefixes.plate; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCompressorRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sHammerRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sImplosionRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sLatheRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sSifterRecipes; +import static gregtech.api.util.GT_RecipeBuilder.MINUTES; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; +import static gregtech.api.util.GT_RecipeConstants.ADDITIVE_AMOUNT; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; @@ -39,6 +50,7 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; +import gregtech.api.enums.TierEU; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -51,22 +63,39 @@ public class GemLoader implements IWerkstoffRunnable { if (werkstoff.getGenerationFeatures().hasSifterRecipes() || (werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust))) { - GT_ModHandler.addCompressionRecipe(werkstoff.get(gem, 9), werkstoff.get(block)); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(block), werkstoff.get(gem, 9), 100, 24); - GT_Values.RA.addSifterRecipe( - werkstoff.get(crushedPurified), - new ItemStack[] { werkstoff.get(gemExquisite), werkstoff.get(gemFlawless), werkstoff.get(gem), - werkstoff.get(gemFlawed), werkstoff.get(gemChipped), werkstoff.get(dust) }, - new int[] { 200, 1000, 2500, 2000, 4000, 5000 }, - 800, - 16); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem, 9)).itemOutputs(werkstoff.get(block)) + .noFluidInputs().noFluidOutputs().duration(15 * SECONDS).eut(2).addTo(sCompressorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).itemOutputs(werkstoff.get(gem, 9)) + .noFluidInputs().noFluidOutputs().duration(5 * SECONDS).eut(24).addTo(sHammerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushedPurified)) + .itemOutputs( + werkstoff.get(gemExquisite), + werkstoff.get(gemFlawless), + werkstoff.get(gem), + werkstoff.get(gemFlawed), + werkstoff.get(gemChipped), + werkstoff.get(dust)) + .outputChances(200, 1000, 2500, 2000, 4000, 5000).noFluidInputs().noFluidOutputs() + .duration(40 * SECONDS).eut(16).addTo(sSifterRecipes); + } - GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemExquisite), werkstoff.get(dust, 4)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawless), werkstoff.get(dust, 2)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(gem), werkstoff.get(dust)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawed), werkstoff.get(dustSmall, 2)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemChipped), werkstoff.get(dustSmall)); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemExquisite)).itemOutputs(werkstoff.get(dust, 4)) + .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawless)).itemOutputs(werkstoff.get(dust, 2)) + .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem)).itemOutputs(werkstoff.get(dust)).noFluidInputs() + .noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawed)).itemOutputs(werkstoff.get(dustSmall, 2)) + .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemChipped)).itemOutputs(werkstoff.get(dustSmall)) + .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); GT_ModHandler.addCraftingRecipe( werkstoff.get(gemFlawless, 2), @@ -85,70 +114,94 @@ public class GemLoader implements IWerkstoffRunnable { 0, new Object[] { "h ", "W ", 'W', werkstoff.get(gemFlawed) }); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemExquisite), werkstoff.get(gemFlawless, 2), 64, 16); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawless), werkstoff.get(gem, 2), 64, 16); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gem), werkstoff.get(gemFlawed, 2), 64, 16); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawed), werkstoff.get(gemChipped, 2), 64, 16); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemChipped), werkstoff.get(dustTiny), 64, 16); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemExquisite)).itemOutputs(werkstoff.get(gemFlawless, 2)) + .noFluidInputs().noFluidOutputs().duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawless)).itemOutputs(werkstoff.get(gem, 2)) + .noFluidInputs().noFluidOutputs().duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem)).itemOutputs(werkstoff.get(gemFlawed, 2)) + .noFluidInputs().noFluidOutputs().duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawed)).itemOutputs(werkstoff.get(gemChipped, 2)) + .noFluidInputs().noFluidOutputs().duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemChipped)).itemOutputs(werkstoff.get(dustTiny)) + .noFluidInputs().noFluidOutputs().duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); if (!werkstoff.contains(WerkstoffLoader.NO_BLAST)) { - GT_Values.RA.addImplosionRecipe( - werkstoff.get(gemFlawless, 3), - 8, - werkstoff.get(gemExquisite), - GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe( - werkstoff.get(gem, 3), - 8, - werkstoff.get(gemFlawless), - GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe( - werkstoff.get(gemFlawed, 3), - 8, - werkstoff.get(gem), - GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe( - werkstoff.get(gemChipped, 3), - 8, - werkstoff.get(gemFlawed), - GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - - GT_Values.RA.addImplosionRecipe( - werkstoff.get(dust, 4), - 24, - werkstoff.get(gem, 3), - GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawless, 3)) + .itemOutputs( + werkstoff.get(gemExquisite), + GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) + .noFluidInputs().noFluidOutputs().duration(20 * TICKS).eut(TierEU.RECIPE_LV) + .metadata(ADDITIVE_AMOUNT, 8).addTo(sImplosionRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem, 3)) + .itemOutputs( + werkstoff.get(gemFlawless), + GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) + .noFluidInputs().noFluidOutputs().duration(20 * TICKS).eut(TierEU.RECIPE_LV) + .metadata(ADDITIVE_AMOUNT, 8).addTo(sImplosionRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawed, 3)) + .itemOutputs(werkstoff.get(gem), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) + .noFluidInputs().noFluidOutputs().duration(20 * TICKS).eut(TierEU.RECIPE_LV) + .metadata(ADDITIVE_AMOUNT, 8).addTo(sImplosionRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemChipped, 3)) + .itemOutputs(werkstoff.get(gemFlawed), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) + .noFluidInputs().noFluidOutputs().duration(20 * TICKS).eut(TierEU.RECIPE_LV) + .metadata(ADDITIVE_AMOUNT, 8).addTo(sImplosionRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust, 4)) + .itemOutputs(werkstoff.get(gem, 3), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)) + .noFluidInputs().noFluidOutputs().duration(20 * TICKS).eut(TierEU.RECIPE_LV) + .metadata(ADDITIVE_AMOUNT, 24).addTo(sImplosionRecipes); } if (werkstoff.hasItemType(plate)) { - GT_Values.RA - .addLatheRecipe(werkstoff.get(plate), werkstoff.get(lens), werkstoff.get(dustSmall), 1200, 120); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)) + .itemOutputs(werkstoff.get(lens), werkstoff.get(dustSmall)).noFluidInputs().noFluidOutputs() + .duration(60 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sLatheRecipes); + } - GT_Values.RA - .addLatheRecipe(werkstoff.get(gemExquisite), werkstoff.get(lens), werkstoff.get(dust, 2), 2400, 30); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemExquisite)) + .itemOutputs(werkstoff.get(lens), werkstoff.get(dust, 2)).noFluidInputs().noFluidOutputs() + .duration(2 * MINUTES).eut(TierEU.RECIPE_LV).addTo(sLatheRecipes); + GregTech_API.registerCover( werkstoff.get(lens), TextureFactory.of( Textures.BlockIcons.MACHINE_CASINGS[2][0], TextureFactory.of(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false)), new gregtech.common.covers.GT_Cover_Lens(BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex)); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(lens), werkstoff.get(dustSmall, 3)); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(lens)).itemOutputs(werkstoff.get(dustSmall, 3)) + .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); for (ItemStack is : OreDictionary.getOres( "craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) { is.stackSize = 0; - GT_Values.RA - .addLaserEngraverRecipe(werkstoff.get(gemChipped, 3), is, werkstoff.get(gemFlawed, 1), 600, 30); - GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemFlawed, 3), is, werkstoff.get(gem, 1), 600, 120); - GT_Values.RA - .addLaserEngraverRecipe(werkstoff.get(gem, 3), is, werkstoff.get(gemFlawless, 1), 1200, 480); - GT_Values.RA.addLaserEngraverRecipe( - werkstoff.get(gemFlawless, 3), - is, - werkstoff.get(gemExquisite, 1), - 2400, - 2000); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemChipped, 3), is) + .itemOutputs(werkstoff.get(gemFlawed, 1)).noFluidInputs().noFluidOutputs() + .duration(30 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sLaserEngraverRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawed, 3), is).itemOutputs(werkstoff.get(gem, 1)) + .noFluidInputs().noFluidOutputs().duration(30 * SECONDS).eut(TierEU.RECIPE_MV) + .addTo(sLaserEngraverRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem, 3), is) + .itemOutputs(werkstoff.get(gemFlawless, 1)).noFluidInputs().noFluidOutputs() + .duration(60 * SECONDS).eut(TierEU.RECIPE_HV).addTo(sLaserEngraverRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawless, 3), is) + .itemOutputs(werkstoff.get(gemExquisite, 1)).noFluidInputs().noFluidOutputs() + .duration(2 * MINUTES).eut(2000).addTo(sLaserEngraverRecipes); + } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java index 47716b0404..0c0a16aa90 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java @@ -15,26 +15,29 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.rec import static gregtech.api.enums.OrePrefixes.block; import static gregtech.api.enums.OrePrefixes.ingot; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCompressorRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sExtruderRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; -import gregtech.api.util.GT_ModHandler; public class MetalLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(ingot)) { - GT_ModHandler.addCompressionRecipe(werkstoff.get(ingot, 9), werkstoff.get(block)); - GT_Values.RA.addExtruderRecipe( - werkstoff.get(ingot, 9), - ItemList.Shape_Extruder_Block.get(0), - werkstoff.get(block), - (int) werkstoff.getStats().getMass(), - 8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 9)).itemOutputs(werkstoff.get(block)) + .noFluidInputs().noFluidOutputs().duration(15 * SECONDS).eut(2).addTo(sCompressorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 9), ItemList.Shape_Extruder_Block.get(0)) + .itemOutputs(werkstoff.get(block)).noFluidInputs().noFluidOutputs() + .duration((int) werkstoff.getStats().getMass()) + .eut(8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15).addTo(sExtruderRecipes); + GT_Values.RA.addAlloySmelterRecipe( werkstoff.get(ingot, 9), ItemList.Shape_Mold_Block.get(0L), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java index 0481c0872b..29e7cadc12 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -32,6 +32,11 @@ import static gregtech.api.enums.OrePrefixes.rotor; import static gregtech.api.enums.OrePrefixes.screw; import static gregtech.api.enums.OrePrefixes.stick; import static gregtech.api.enums.OrePrefixes.stickLong; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; import java.util.Objects; @@ -52,170 +57,136 @@ public class MoltenCellLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - if (!werkstoff.hasItemType(cellMolten)) return; + if (!werkstoff.hasItemType(cellMolten)) { + return; + } if (!werkstoff.hasItemType(ingot)) { - if (!werkstoff.hasItemType(dust)) return; - GT_Values.RA.addFluidExtractionRecipe( - werkstoff.get(dust), - null, - werkstoff.getMolten(144), - 0, - (int) werkstoff.getStats().getMass(), - werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe( - werkstoff.get(dustSmall), - null, - werkstoff.getMolten(36), - 0, - (int) ((double) werkstoff.getStats().getMass() / 4D), - werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe( - werkstoff.get(dustTiny), - null, - werkstoff.getMolten(16), - 0, - (int) ((double) werkstoff.getStats().getMass() / 9D), - werkstoff.getStats().getMass() > 128 ? 64 : 30); + if (!werkstoff.hasItemType(dust)) { + return; + } + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust)).noItemOutputs().noFluidInputs() + .fluidOutputs(werkstoff.getMolten(144)).duration(15 * SECONDS).eut(2) + .addTo(sFluidExtractionRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustSmall)).noItemOutputs().noFluidInputs() + .fluidOutputs(werkstoff.getMolten(36)).duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustTiny)).noItemOutputs().noFluidInputs() + .fluidOutputs(werkstoff.getMolten(16)).duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); + } else { - GT_Values.RA.addFluidExtractionRecipe( - werkstoff.get(ingot), - null, - werkstoff.getMolten(144), - 0, - (int) werkstoff.getStats().getMass(), - werkstoff.getStats().getMass() > 128 ? 64 : 30); - - GT_Values.RA.addFluidExtractionRecipe( - werkstoff.get(nugget), - null, - werkstoff.getMolten(16), - 0, - (int) ((double) werkstoff.getStats().getMass() / 9D), - werkstoff.getStats().getMass() > 128 ? 64 : 30); - - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Ingot.get(0), - werkstoff.getMolten(144), - werkstoff.get(ingot), - (int) werkstoff.getStats().getMass(), - werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Nugget.get(0), - werkstoff.getMolten(16), - werkstoff.get(nugget), - (int) ((double) werkstoff.getStats().getMass() / 9D), - werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Block.get(0), - werkstoff.getMolten(1296), - werkstoff.get(block), - (int) werkstoff.getStats().getMass() * 9, - werkstoff.getStats().getMass() > 128 ? 64 : 30); - - if (!werkstoff.hasItemType(plate)) return; - - GT_Values.RA.addFluidExtractionRecipe( - werkstoff.get(stickLong), - null, - werkstoff.getMolten(144), - 0, - (int) werkstoff.getStats().getMass(), - werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe( - werkstoff.get(plate), - null, - werkstoff.getMolten(144), - 0, - (int) werkstoff.getStats().getMass(), - werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe( - werkstoff.get(stick), - null, - werkstoff.getMolten(72), - 0, - (int) ((double) werkstoff.getStats().getMass() / 2D), - werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)).noItemOutputs().noFluidInputs() + .fluidOutputs(werkstoff.getMolten(144)).duration(15 * SECONDS).eut(2) + .addTo(sFluidExtractionRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(nugget)).noItemOutputs().noFluidInputs() + .fluidOutputs(werkstoff.getMolten(16)).duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); + + GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Ingot.get(0)).itemOutputs(werkstoff.get(ingot)) + .fluidInputs(werkstoff.getMolten(144)).noFluidOutputs() + .duration((int) werkstoff.getStats().getMass()).eut(werkstoff.getStats().getMass() > 128 ? 64 : 30) + .addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Nugget.get(0)).itemOutputs(werkstoff.get(nugget)) + .fluidInputs(werkstoff.getMolten(16)).noFluidOutputs() + .duration((int) ((double) werkstoff.getStats().getMass() / 9D)) + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Block.get(0)).itemOutputs(werkstoff.get(block)) + .fluidInputs(werkstoff.getMolten(1296)).noFluidOutputs() + .duration((int) werkstoff.getStats().getMass() * 9) + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + + if (!werkstoff.hasItemType(plate)) { + return; + } + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stickLong)).noItemOutputs().noFluidInputs() + .fluidOutputs(werkstoff.getMolten(144)).duration(15 * SECONDS).eut(2) + .addTo(sFluidExtractionRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)).noItemOutputs().noFluidInputs() + .fluidOutputs(werkstoff.getMolten(144)).duration(15 * SECONDS).eut(2) + .addTo(sFluidExtractionRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick)).noItemOutputs().noFluidInputs() + .fluidOutputs(werkstoff.getMolten(72)).duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); + } if (werkstoff.getGenerationFeatures().hasMetalCraftingSolidifierRecipes()) { - if (!werkstoff.hasItemType(plate)) return; - - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Rod_Long.get(0), - werkstoff.getMolten(144), - werkstoff.get(stickLong), - (int) Math.max(werkstoff.getStats().getMass(), 1L), - werkstoff.getStats().getMass() > 128 ? 64 : 30); - - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Rod.get(0), - werkstoff.getMolten(72), - werkstoff.get(stick), - (int) Math.max(werkstoff.getStats().getMass() / 2, 1L), - werkstoff.getStats().getMass() > 128 ? 64 : 30); - - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Plate.get(0), - werkstoff.getMolten(144), - werkstoff.get(plate), - (int) Math.max(werkstoff.getStats().getMass(), 1L), - werkstoff.getStats().getMass() > 128 ? 64 : 30); + if (!werkstoff.hasItemType(plate)) { + return; + } + + GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Rod_Long.get(0)) + .itemOutputs(werkstoff.get(stickLong)).fluidInputs(werkstoff.getMolten(144)).noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Rod.get(0)).itemOutputs(werkstoff.get(stick)) + .fluidInputs(werkstoff.getMolten(72)).noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() / 2, 1L)) + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Plate.get(0)).itemOutputs(werkstoff.get(plate)) + .fluidInputs(werkstoff.getMolten(144)).noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + } if (werkstoff.getGenerationFeatures().hasMetaSolidifierRecipes()) { - if (!werkstoff.hasItemType(screw)) return; - - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Screw.get(0), - werkstoff.getMolten(18), - werkstoff.get(screw), - (int) Math.max(werkstoff.getStats().getMass() / 8, 1L), - werkstoff.getStats().getMass() > 128 ? 64 : 30); - - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Gear.get(0), - werkstoff.getMolten(576), - werkstoff.get(gearGt), - (int) Math.max(werkstoff.getStats().getMass() / 4, 1L), - werkstoff.getStats().getMass() > 128 ? 64 : 30); - - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Gear_Small.get(0), - werkstoff.getMolten(144), - werkstoff.get(gearGtSmall), - (int) Math.max(werkstoff.getStats().getMass(), 1L), - werkstoff.getStats().getMass() > 128 ? 64 : 30); - - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Bolt.get(0), - werkstoff.getMolten(18), - werkstoff.get(bolt), - (int) Math.max(werkstoff.getStats().getMass() / 8, 1L), - werkstoff.getStats().getMass() > 128 ? 64 : 30); - - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Ring.get(0), - werkstoff.getMolten(36), - werkstoff.get(ring), - (int) Math.max(werkstoff.getStats().getMass() / 4, 1L), - werkstoff.getStats().getMass() > 128 ? 64 : 30); + if (!werkstoff.hasItemType(screw)) { + return; + } + + GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Screw.get(0)).itemOutputs(werkstoff.get(screw)) + .fluidInputs(werkstoff.getMolten(18)).noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() / 8, 1L)) + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Gear.get(0)).itemOutputs(werkstoff.get(gearGt)) + .fluidInputs(werkstoff.getMolten(576)).noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() / 4, 1L)) + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Gear_Small.get(0)) + .itemOutputs(werkstoff.get(gearGtSmall)).fluidInputs(werkstoff.getMolten(144)).noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Bolt.get(0)).itemOutputs(werkstoff.get(bolt)) + .fluidInputs(werkstoff.getMolten(18)).noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() / 8, 1L)) + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Ring.get(0)).itemOutputs(werkstoff.get(ring)) + .fluidInputs(werkstoff.getMolten(36)).noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() / 4, 1L)) + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); // No Spring Molds - if (WerkstoffLoader.rotorMold == null) return; - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Rotor.get(0), - werkstoff.getMolten(612), - werkstoff.get(rotor), - (int) Math.max(werkstoff.getStats().getMass() * 4.25, 1L), - werkstoff.getStats().getMass() > 128 ? 64 : 30); + if (WerkstoffLoader.rotorMold == null) { + return; + } + + GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Rotor.get(0)).itemOutputs(werkstoff.get(rotor)) + .fluidInputs(werkstoff.getMolten(612)).noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() * 4.25, 1L)) + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + } if (werkstoff.getGenerationFeatures().hasMultipleMetalSolidifierRecipes()) { - if (!werkstoff.hasItemType(plateDouble)) return; + if (!werkstoff.hasItemType(plateDouble)) { + return; + } // No multiple plate molds } @@ -229,16 +200,15 @@ public class MoltenCellLoader implements IWerkstoffRunnable { werkstoff.get(cellMolten), Materials.Empty.getCells(1)); GT_Utility.addFluidContainerData(data); - GT_Values.RA.addFluidCannerRecipe( - Materials.Empty.getCells(1), - werkstoff.get(cellMolten), - new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), - GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe( - werkstoff.get(cellMolten), - Materials.Empty.getCells(1), - GT_Values.NF, - new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); + + GT_Values.RA.stdBuilder().itemInputs(Materials.Empty.getCells(1)).itemOutputs(werkstoff.get(cellMolten)) + .fluidInputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)) + .noFluidOutputs().duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(cellMolten)).itemOutputs(Materials.Empty.getCells(1)) + .noFluidInputs() + .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)) + .duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); if (!Forestry.isModLoaded()) return; @@ -251,10 +221,10 @@ public class MoltenCellLoader implements IWerkstoffRunnable { werkstoff.get(capsuleMolten), GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1)); GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe( - werkstoff.get(capsuleMolten), - GT_Values.NI, - GT_Values.NF, - new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(capsuleMolten)).noItemOutputs().noFluidInputs() + .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)) + .duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java index aba41181a4..36b6e1e7d7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java @@ -17,6 +17,8 @@ import static gregtech.api.enums.OrePrefixes.dust; import static gregtech.api.enums.OrePrefixes.ingot; import static gregtech.api.enums.OrePrefixes.plateDense; import static gregtech.api.enums.OrePrefixes.plateDouble; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; import net.minecraft.item.ItemStack; @@ -51,12 +53,10 @@ public class MultipleMetalLoader implements IWerkstoffRunnable { werkstoff.get(plateDouble), TextureFactory.of(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false), null); - GT_Values.RA.addPulveriserRecipe( - werkstoff.get(plateDouble), - new ItemStack[] { werkstoff.get(dust, 2) }, - null, - 2, - 8); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plateDouble)).itemOutputs(werkstoff.get(dust, 2)) + .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java index f55169ece0..725d4b6319 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java @@ -18,6 +18,8 @@ import static gregtech.api.enums.OrePrefixes.dust; import static gregtech.api.enums.OrePrefixes.gem; import static gregtech.api.enums.OrePrefixes.ingot; import static gregtech.api.enums.OrePrefixes.ore; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sHammerRecipes; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -37,11 +39,11 @@ public class OreLoader implements IWerkstoffRunnable { .addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), werkstoff.get(ingot)); if (werkstoff.hasItemType(ore)) { - GT_Values.RA.addForgeHammerRecipe( - werkstoff.get(ore), - werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(crushed), - 16, - 10); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ore)) + .itemOutputs(werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(crushed)) + .noFluidInputs().noFluidOutputs().duration(16 * TICKS).eut(10).addTo(sHammerRecipes); + GT_ModHandler.addPulverisationRecipe( werkstoff.get(ore), werkstoff.get(crushed, 2), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java index 923ce10ad7..f2a6fd9983 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java @@ -22,6 +22,12 @@ import static gregtech.api.enums.OrePrefixes.ingot; import static gregtech.api.enums.OrePrefixes.plate; import static gregtech.api.enums.OrePrefixes.stick; import static gregtech.api.enums.OrePrefixes.stickLong; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBenderRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sExtruderRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sHammerRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sLatheRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; import net.minecraft.item.ItemStack; @@ -38,7 +44,6 @@ import gregtech.api.enums.TextureSet; import gregtech.api.interfaces.ITexture; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Proxy; @@ -48,12 +53,11 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(plate)) { if (werkstoff.hasItemType(gem)) { - GT_Values.RA.addLatheRecipe( - werkstoff.get(gem), - werkstoff.get(stick), - werkstoff.get(dustSmall, 2), - (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), - 16); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem)) + .itemOutputs(werkstoff.get(stick), werkstoff.get(dustSmall, 2)).noFluidInputs().noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() * 5L, 1L)).eut(16).addTo(sLatheRecipes); + GT_ModHandler.addCraftingRecipe( werkstoff.get(stick, 2), GT_Proxy.tBits, @@ -62,11 +66,10 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { werkstoff.get(stick), GT_Proxy.tBits, new Object[] { "f ", " X", 'X', werkstoff.get(gem) }); - GT_Values.RA.addForgeHammerRecipe( - werkstoff.get(stick, 2), - werkstoff.get(stickLong), - (int) Math.max(werkstoff.getStats().getMass(), 1L), - 16); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick, 2)).itemOutputs(werkstoff.get(stickLong)) + .noFluidInputs().noFluidOutputs().duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) + .eut(16).addTo(sHammerRecipes); TextureSet texSet = werkstoff.getTexSet(); ITexture texture = SideReference.Side.Client @@ -78,8 +81,9 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { : TextureFactory.of(texSet.mTextures[block.mTextureIndex], werkstoff.getRGBA(), false); GregTech_API.registerCover(werkstoff.get(plate), texture, null); - GT_Values.RA - .addPulveriserRecipe(werkstoff.get(plate), new ItemStack[] { werkstoff.get(dust) }, null, 2, 8); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)).itemOutputs(werkstoff.get(dust)) + .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + return; } @@ -100,7 +104,7 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { GT_Proxy.tBits, new Object[] { "hX", 'X', werkstoff.get(plate) }); - GT_Recipe.GT_Recipe_Map.sBenderRecipes.add( + sBenderRecipes.add( new BWRecipes.DynamicGTRecipe( true, new ItemStack[] { werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(1) }, @@ -112,66 +116,52 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { (int) Math.max(werkstoff.getStats().getMass(), 1L), 24, 0)); - GT_Values.RA.addForgeHammerRecipe( - werkstoff.get(ingot, 3), - werkstoff.get(plate, 2), - (int) Math.max(werkstoff.getStats().getMass(), 1L), - 16); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 3)).itemOutputs(werkstoff.get(plate, 2)) + .noFluidInputs().noFluidOutputs().duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) + .eut(16).addTo(sHammerRecipes); + GregTech_API.registerCover( werkstoff.get(plate), TextureFactory.of(werkstoff.getTexSet().mTextures[71], werkstoff.getRGBA(), false), null); - GT_Values.RA.addLatheRecipe( - werkstoff.get(ingot), - werkstoff.get(stick), - werkstoff.get(dustSmall, 2), - (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), - 16); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)) + .itemOutputs(werkstoff.get(stick), werkstoff.get(dustSmall, 2)).noFluidInputs().noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() * 5L, 1L)).eut(16).addTo(sLatheRecipes); - GT_Values.RA.addBenderRecipe( - werkstoff.get(plate), - GT_Utility.getIntegratedCircuit(1), - werkstoff.get(foil, 4), - (int) Math.max(werkstoff.getStats().getMass() * 1L, 1L), - 24); - - GT_Values.RA.addBenderRecipe( - werkstoff.get(ingot), - GT_Utility.getIntegratedCircuit(10), - werkstoff.get(foil, 4), - (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), - 24); - - GT_Values.RA.addForgeHammerRecipe( - werkstoff.get(stick, 2), - werkstoff.get(stickLong), - (int) Math.max(werkstoff.getStats().getMass(), 1L), - 16); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(werkstoff.get(foil, 4)).noFluidInputs().noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() * 1L, 1L)).eut(24).addTo(sBenderRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(10)) + .itemOutputs(werkstoff.get(foil, 4)).noFluidInputs().noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)).eut(24).addTo(sBenderRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick, 2)).itemOutputs(werkstoff.get(stickLong)) + .noFluidInputs().noFluidOutputs().duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) + .eut(16).addTo(sHammerRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Plate.get(0)) + .itemOutputs(werkstoff.get(plate)).noFluidInputs().noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)).eut(45).addTo(sExtruderRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Rod.get(0)) + .itemOutputs(werkstoff.get(stick, 2)).noFluidInputs().noFluidOutputs() + .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)).eut(45).addTo(sExtruderRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)).itemOutputs(werkstoff.get(dust)).noFluidInputs() + .noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)).itemOutputs(werkstoff.get(dust)).noFluidInputs() + .noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stickLong)).itemOutputs(werkstoff.get(dust)) + .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick)).itemOutputs(werkstoff.get(dustSmall, 2)) + .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); - GT_Values.RA.addExtruderRecipe( - werkstoff.get(ingot), - ItemList.Shape_Extruder_Plate.get(0), - werkstoff.get(plate), - (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), - 45); - GT_Values.RA.addExtruderRecipe( - werkstoff.get(ingot), - ItemList.Shape_Extruder_Rod.get(0), - werkstoff.get(stick, 2), - (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), - 45); - - GT_Values.RA.addPulveriserRecipe(werkstoff.get(ingot), new ItemStack[] { werkstoff.get(dust) }, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[] { werkstoff.get(dust) }, null, 2, 8); - GT_Values.RA - .addPulveriserRecipe(werkstoff.get(stickLong), new ItemStack[] { werkstoff.get(dust) }, null, 2, 8); - GT_Values.RA.addPulveriserRecipe( - werkstoff.get(stick), - new ItemStack[] { werkstoff.get(dustSmall, 2) }, - null, - 2, - 8); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java index a239efb657..e92c7ee63b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java @@ -28,6 +28,12 @@ import static gregtech.api.enums.OrePrefixes.toolHeadHammer; import static gregtech.api.enums.OrePrefixes.toolHeadSaw; import static gregtech.api.enums.OrePrefixes.toolHeadWrench; import static gregtech.api.enums.OrePrefixes.turbineBlade; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sExtruderRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sPressRecipes; +import static gregtech.api.util.GT_RecipeBuilder.MINUTES; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -39,6 +45,7 @@ import gregtech.api.enums.Dyes; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.common.GT_Proxy; @@ -424,68 +431,74 @@ public class ToolLoader implements IWerkstoffRunnable { GT_Proxy.tBits, new Object[] { "fPd", "SPS", " P ", 'P', plateDouble.get(werkstoff.getBridgeMaterial()), 'S', screw.get(werkstoff.getBridgeMaterial()) }); - GT_Values.RA.addExtruderRecipe( - werkstoff.get(ingot, 6), - ItemList.Shape_Extruder_Turbine_Blade.get(0), - werkstoff.get(turbineBlade, 1), - (int) werkstoff.getStats().getMass() / 2 * 20, - 120); - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Turbine_Blade.get(0), - werkstoff.getMolten(864), - werkstoff.get(turbineBlade, 1), - (int) werkstoff.getStats().getMass() * 20, - 120); - GT_Values.RA.addFormingPressRecipe( - werkstoff.get(plateDouble, 3), - werkstoff.get(screw, 2), - werkstoff.get(turbineBlade, 1), - (int) werkstoff.getStats().getMass() / 4 * 20, - 30); - GT_Values.RA.addAssemblerRecipe( - werkstoff.get(turbineBlade, 4), - GT_OreDictUnificator.get(stickLong, Materials.Magnalium, 1), - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.TURBINE_SMALL, - 1, - werkstoff.getBridgeMaterial(), - Materials.Magnalium, - null), - 160, - 100); - GT_Values.RA.addAssemblerRecipe( - werkstoff.get(turbineBlade, 8), - GT_OreDictUnificator.get(stickLong, Materials.Titanium, 1), - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.TURBINE, - 1, - werkstoff.getBridgeMaterial(), - Materials.Titanium, - null), - 320, - 400); - GT_Values.RA.addAssemblerRecipe( - werkstoff.get(turbineBlade, 12), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 1), - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.TURBINE_LARGE, - 1, - werkstoff.getBridgeMaterial(), - Materials.TungstenSteel, - null), - 640, - 1600); - GT_Values.RA.addAssemblerRecipe( - werkstoff.get(turbineBlade, 16), - GT_OreDictUnificator.get(stickLong, Materials.Americium, 1), - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.TURBINE_HUGE, - 1, - werkstoff.getBridgeMaterial(), - Materials.Americium, - null), - 1280, - 6400); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 6), ItemList.Shape_Extruder_Turbine_Blade.get(0)) + .itemOutputs(werkstoff.get(turbineBlade, 1)).noFluidInputs().noFluidOutputs() + .duration((int) werkstoff.getStats().getMass() / 2 * 20).eut(TierEU.RECIPE_MV) + .addTo(sExtruderRecipes); + + GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Turbine_Blade.get(0)) + .itemOutputs(werkstoff.get(turbineBlade, 1)).fluidInputs(werkstoff.getMolten(864)).noFluidOutputs() + .duration((int) werkstoff.getStats().getMass() * 20).eut(TierEU.RECIPE_MV) + .addTo(sFluidSolidficationRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plateDouble, 3), werkstoff.get(screw, 2)) + .itemOutputs(werkstoff.get(turbineBlade, 1)).noFluidInputs().noFluidOutputs() + .duration((werkstoff.getStats().getMass() / 4) * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(sPressRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + werkstoff.get(turbineBlade, 4), + GT_OreDictUnificator.get(stickLong, Materials.Magnalium, 1)) + .itemOutputs( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE_SMALL, + 1, + werkstoff.getBridgeMaterial(), + Materials.Magnalium, + null)) + .noFluidInputs().noFluidOutputs().duration(8 * SECONDS).eut(100).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + werkstoff.get(turbineBlade, 8), + GT_OreDictUnificator.get(stickLong, Materials.Titanium, 1)) + .itemOutputs( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE, + 1, + werkstoff.getBridgeMaterial(), + Materials.Titanium, + null)) + .noFluidInputs().noFluidOutputs().duration(16 * SECONDS).eut(400).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + werkstoff.get(turbineBlade, 12), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 1)) + .itemOutputs( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE_LARGE, + 1, + werkstoff.getBridgeMaterial(), + Materials.TungstenSteel, + null)) + .noFluidInputs().noFluidOutputs().duration(32 * SECONDS).eut(1600).addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + werkstoff.get(turbineBlade, 16), + GT_OreDictUnificator.get(stickLong, Materials.Americium, 1)) + .itemOutputs( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE_HUGE, + 1, + werkstoff.getBridgeMaterial(), + Materials.Americium, + null)) + .noFluidInputs().noFluidOutputs().duration(1 * MINUTES + 4 * SECONDS).eut(6400) + .addTo(sAssemblerRecipes); } if (!werkstoff.hasItemType(gem)) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index d4ed594de9..1db1293f2f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -395,6 +395,7 @@ public class BW_Util { return retArr; } + @Deprecated public static int getMachineVoltageFromTier(int tier) { return (int) (30 * Math.pow(4, (tier - 1))); } -- cgit From 200c08016c1ec8e152501f09e9869675e3cadece Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Sat, 9 Sep 2023 16:43:46 +0100 Subject: 2 small recipe fixes (#357) Former-commit-id: 2976d9ecd9f23516d46d54780f1ba609a1ea2e0f --- .../bartworks/common/loaders/ArtificialMicaLine.java | 2 +- .../bartworks/common/loaders/recipes/Centrifuge.java | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java index 0754d514b2..97133ccec5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java @@ -49,7 +49,7 @@ public class ArtificialMicaLine { GT_Values.RA.stdBuilder().itemInputs(Materials.RockSalt.getDust(4)) .itemOutputs(WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 9)) .fluidInputs(WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000)) - .fluidOutputs(Materials.HydrochloricAcid.getGas(2000)).duration(1 * SECONDS).eut(8) + .fluidOutputs(Materials.HydrochloricAcid.getFluid(2000)).duration(1 * SECONDS).eut(8) .addTo(sMixerRecipes); // 2K + CO2 + O = K2CO3 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java index 776d6a1a2a..a20a3e4d82 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java @@ -22,6 +22,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TierEU; +import gregtech.api.util.GT_RecipeBuilder; import gregtech.api.util.GT_Utility; public class Centrifuge implements Runnable { @@ -82,7 +83,7 @@ public class Centrifuge implements Runnable { .noFluidInputs().noFluidOutputs().duration(2 * MINUTES + 30 * SECONDS).eut(TierEU.RECIPE_LV) .addTo(sCentrifugeRecipes); - GT_Values.RA.stdBuilder() + GT_RecipeBuilder recipeBuilder = GT_Values.RA.stdBuilder() .itemInputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 6)) .itemOutputs( fuel.recycledItems[0], @@ -90,8 +91,13 @@ public class Centrifuge implements Runnable { fuel.recycledItems[2], fuel.recycledItems[3], fuel.recycledItems[4]) - .outputChances(fuel.recycleChances).noFluidInputs().fluidOutputs(fuel.recycledFluid) - .duration(60 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); + .outputChances(fuel.recycleChances).noFluidInputs(); + if (fuel.recycledFluid == null) { + recipeBuilder.noFluidOutputs(); + } else { + recipeBuilder.fluidOutputs(fuel.recycledFluid); + } + recipeBuilder.duration(1 * MINUTES).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); i += MATERIALS_PER_FUEL; } -- cgit From df4c1e1cbee0c1dd201e86e0a0fd4f9c300ed731 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 9 Sep 2023 21:59:33 +0200 Subject: update bs+deps Former-commit-id: 71b781e3c3c7a407221c4e35cac70bc9fc114eb2 --- build.gradle | 5 +---- dependencies.gradle | 12 ++++++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index c5af340745..b894d64772 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1691351470 +//version: 1692122114 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -562,9 +562,6 @@ repositories { maven { name 'Overmind forge repo mirror' url 'https://gregtech.overminddl1.com/' - mavenContent { - excludeGroup("net.minecraftforge") // missing the `universal` artefact - } } maven { name = "GTNH Maven" diff --git a/dependencies.gradle b/dependencies.gradle index dc3f22e527..e540750a95 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,15 +1,15 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.02:dev') - api("com.github.GTNewHorizons:TecTech:5.2.41:dev") - api("com.github.GTNewHorizons:GalacticGregGT5:1.0.9:dev") { + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.08:dev') + api("com.github.GTNewHorizons:TecTech:5.3.1:dev") + api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } - api("com.github.GTNewHorizons:Avaritia:1.45:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.9.39-GTNH:dev") + api("com.github.GTNewHorizons:Avaritia:1.46:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.10.1-GTNH:dev") compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.24-pre:dev") {transitive = false} - compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.12-GTNH:api") {transitive = false} + compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.15-GTNH:api") {transitive = false} } -- cgit From c530b6cdcb45f23dbb1e9cde332033921b79b618 Mon Sep 17 00:00:00 2001 From: miozune Date: Wed, 13 Sep 2023 17:40:13 +0900 Subject: Add info on Bacterial Vat NEI fluid output (#358) * Add info on Bacterial Vat NEI fluid output * Update en_US.lang --------- Co-authored-by: Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com> Former-commit-id: 3d8a85d5730786c86e5310df6fce786b5d6f9c4f --- dependencies.gradle | 2 +- .../bartimaeusnek/bartworks/util/BWRecipes.java | 29 ++++++++++++++++++++++ .../resources/assets/bartworks/lang/en_US.lang | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index e540750a95..d4963b05df 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.08:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.09:dev') api("com.github.GTNewHorizons:TecTech:5.3.1:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 21bab359a5..643d1de694 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -21,6 +21,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.function.Supplier; @@ -30,6 +31,7 @@ import javax.annotation.Nonnegative; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; @@ -41,6 +43,7 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; import com.gtnewhorizons.modularui.api.drawable.IDrawable; +import com.gtnewhorizons.modularui.api.math.Alignment; import com.gtnewhorizons.modularui.api.math.Pos2d; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; @@ -53,6 +56,7 @@ import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gregtech.nei.GT_NEI_DefaultHandler; import gregtech.nei.NEIRecipeInfo; import ic2.core.Ic2Items; import ic2.core.item.ItemFluidCell; @@ -802,6 +806,31 @@ public class BWRecipes { } return this.addRecipe(aRecipe, false, false, false); } + + @Override + protected List handleNEIItemOutputTooltip(List currentTip, + GT_NEI_DefaultHandler.FixedPositionedStack pStack) { + if (pStack.isFluid()) { + currentTip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("nei.biovat.tooltip")); + return currentTip; + } + return super.handleNEIItemOutputTooltip(currentTip, pStack); + } + + @Override + protected void drawNEIOverlayForOutput(GT_NEI_DefaultHandler.FixedPositionedStack stack) { + if (stack.isFluid()) { + drawNEIOverlayText( + "+", + stack, + colorOverride.getTextColorOrDefault("nei_overlay_yellow", 0xFDD835), + 0.5f, + true, + Alignment.TopRight); + return; + } + super.drawNEIOverlayForOutput(stack); + } } public static class SpecialObjectSensitiveMap extends GT_Recipe.GT_Recipe_Map { diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index fabd5dafcd..73be48c15c 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -143,6 +143,7 @@ tooltip.tile.acidgen.1.name=Creates Power from Chemical Energy Potentials. nei.biovat.0.name=Needs Glass Tier: nei.biovat.1.name=Need exactly nei.biovat.2.name=Need minimum +nei.biovat.tooltip=Outputs up to 1,001x amount, depending on the amount of fluid stored in the Output Hatch tile.diode.name=Cable Diode tile.energydistributor.name=Energy Distributor -- cgit From 375c022cab46d8c6c06c12e1e49a783ecf587479 Mon Sep 17 00:00:00 2001 From: miozune Date: Thu, 14 Sep 2023 23:40:38 +0900 Subject: Also add info on Vat NEI fluid input (#359) Former-commit-id: 34873ab638692badb99b88962d2dbd70f0bed411 --- .../bartimaeusnek/bartworks/util/BWRecipes.java | 21 ++++++++++++++++++++- src/main/resources/assets/bartworks/lang/en_US.lang | 3 ++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 643d1de694..a2ed19b776 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -807,18 +807,37 @@ public class BWRecipes { return this.addRecipe(aRecipe, false, false, false); } + @Override + protected List handleNEIItemInputTooltip(List currentTip, + GT_NEI_DefaultHandler.FixedPositionedStack pStack) { + if (pStack.isFluid()) { + currentTip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("nei.biovat.input.tooltip")); + return currentTip; + } + return super.handleNEIItemInputTooltip(currentTip, pStack); + } + @Override protected List handleNEIItemOutputTooltip(List currentTip, GT_NEI_DefaultHandler.FixedPositionedStack pStack) { if (pStack.isFluid()) { - currentTip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("nei.biovat.tooltip")); + currentTip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("nei.biovat.output.tooltip")); return currentTip; } return super.handleNEIItemOutputTooltip(currentTip, pStack); } + @Override + protected void drawNEIOverlayForInput(GT_NEI_DefaultHandler.FixedPositionedStack stack) { + drawFluidOverlay(stack); + } + @Override protected void drawNEIOverlayForOutput(GT_NEI_DefaultHandler.FixedPositionedStack stack) { + drawFluidOverlay(stack); + } + + private void drawFluidOverlay(GT_NEI_DefaultHandler.FixedPositionedStack stack) { if (stack.isFluid()) { drawNEIOverlayText( "+", diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 73be48c15c..29db940153 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -143,7 +143,8 @@ tooltip.tile.acidgen.1.name=Creates Power from Chemical Energy Potentials. nei.biovat.0.name=Needs Glass Tier: nei.biovat.1.name=Need exactly nei.biovat.2.name=Need minimum -nei.biovat.tooltip=Outputs up to 1,001x amount, depending on the amount of fluid stored in the Output Hatch +nei.biovat.input.tooltip=Consumed up to 1,001x amount, depending on output rate +nei.biovat.output.tooltip=Outputs up to 1,001x amount, depending on the amount of fluid stored in the Output Hatch tile.diode.name=Cable Diode tile.energydistributor.name=Energy Distributor -- cgit From 6a9d904eb4f37467b0c7238870b07bdf3317ad65 Mon Sep 17 00:00:00 2001 From: miozune Date: Sat, 23 Sep 2023 01:44:28 +0900 Subject: Cleanup basic machines & some deprecations (#360) Former-commit-id: cea4eaa2e409783af151c5f9c2cea6749ca68aef --- build.gradle | 32 ++++++++++++++++------ dependencies.gradle | 2 +- .../common/tileentities/debug/CreativeScanner.java | 13 ++------- .../tiered/GT_MetaTileEntity_BioLab.java | 15 ++++------ .../tiered/GT_MetaTileEntity_Diode.java | 8 ++++-- .../TT_MetaTileEntity_LowPowerLaserDynamo.java | 14 ++++++---- .../TT_MetaTileEntity_LowPowerLaserHatch.java | 14 ++++++---- 7 files changed, 53 insertions(+), 45 deletions(-) diff --git a/build.gradle b/build.gradle index b894d64772..ac9652d0a3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1692122114 +//version: 1695323114 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -600,15 +600,10 @@ repositories { } maven { name = "ic2" - url = "https://maven.ic2.player.to/" - metadataSources { - mavenPom() - artifact() + url = getURL("https://maven.ic2.player.to/", "https://maven2.ic2.player.to/") + content { + includeGroup "net.industrial-craft" } - } - maven { - name = "ic2-mirror" - url = "https://maven2.ic2.player.to/" metadataSources { mavenPom() artifact() @@ -1576,6 +1571,25 @@ def getSecondaryArtifacts() { return secondaryArtifacts } +def getURL(String main, String fallback) { + return pingURL(main, 10000) ? main : fallback +} + +// credit: https://stackoverflow.com/a/3584332 +def pingURL(String url, int timeout) { + url = url.replaceFirst("^https", "http") // Otherwise an exception may be thrown on invalid SSL certificates. + try { + HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection() + connection.setConnectTimeout(timeout) + connection.setReadTimeout(timeout) + connection.setRequestMethod("HEAD") + int responseCode = connection.getResponseCode() + return 200 <= responseCode && responseCode <= 399 + } catch (IOException ignored) { + return false + } +} + // For easier scripting of things that require variables defined earlier in the buildscript if (file('addon.late.gradle.kts').exists()) { apply from: 'addon.late.gradle.kts' diff --git a/dependencies.gradle b/dependencies.gradle index d4963b05df..0a4a966fd4 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.09:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.19:dev') api("com.github.GTNewHorizons:TecTech:5.3.1:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java index 95938fc39d..2dcc69377e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java @@ -24,20 +24,13 @@ public class CreativeScanner extends GT_MetaTileEntity_Scanner { super(aID, aName, aNameRegional, aTier); } - public CreativeScanner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, - String aNEIName) { - super(aName, aTier, aDescription, aTextures, aGUIName, aNEIName); + public CreativeScanner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new CreativeScanner( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures, - this.mGUIName, - this.mNEIName); + return new CreativeScanner(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index 6b02faa800..6830042f80 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -51,7 +51,6 @@ import gregtech.common.items.behaviors.Behaviour_DataOrb; public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { - private static final String MGUINAME = "BW.GUI.BioLab.png"; private static final int DNA_EXTRACTION_MODULE = 0; private static final int PCR_THERMOCYCLE_MODULE = 1; private static final int PLASMID_SYNTHESIS_MODULE = 2; @@ -69,8 +68,6 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { (String) null, 6, 2, - GT_MetaTileEntity_BioLab.MGUINAME, - null, TextureFactory.of( TextureFactory.of( new Textures.BlockIcons.CustomIcon( @@ -127,21 +124,19 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { .glow().build())); } - public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String aDescription, - ITexture[][][] aTextures, String aNEIName) { - super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2, GT_MetaTileEntity_BioLab.MGUINAME, aNEIName); + public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String[] aDescription, + ITexture[][][] aTextures) { + super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2); } @Override - @SuppressWarnings("deprecation") public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new GT_MetaTileEntity_BioLab( this.mName, this.mTier, this.mAmperage, - this.mDescription, - this.mTextures, - this.mNEIName); + this.mDescriptionArray, + this.mTextures); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index 630efddc8f..2f4811270f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -18,6 +18,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.ArrayUtils; + import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; @@ -117,9 +119,9 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { else return 0L; } - @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[] { this.mDescription, + return ArrayUtils.addAll( + this.mDescriptionArray, StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), @@ -129,6 +131,6 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.maxAmperesOut()), - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java index 8452086fdb..570d4592c4 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java @@ -16,6 +16,8 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; +import org.apache.commons.lang3.ArrayUtils; + import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoTunnel; @@ -24,7 +26,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GT_Utility; -@SuppressWarnings("deprecation") public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hatch_DynamoTunnel implements LowPowerLaser { @@ -32,9 +33,9 @@ public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hat super(aID, aName, aNameRegional, aTier, aAmp); } - public TT_MetaTileEntity_LowPowerLaserDynamo(String aName, int aTier, int aAmp, String aDescription, + public TT_MetaTileEntity_LowPowerLaserDynamo(String aName, int aTier, int aAmp, String[] aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aAmp, new String[] { aDescription }, aTextures); + super(aName, aTier, aAmp, aDescription, aTextures); } @Override @@ -43,7 +44,7 @@ public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hat this.mName, this.mTier, this.Amperes, - this.mDescription, + this.mDescriptionArray, this.mTextures); } @@ -69,13 +70,14 @@ public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hat @Override public String[] getDescription() { - return new String[] { this.mDescription, + return ArrayUtils.addAll( + this.mDescriptionArray, StatCollector.translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": " + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + EnumChatFormatting.RESET + " EU/t", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java index c9854e4cbd..6a0425bfbc 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java @@ -16,6 +16,8 @@ package com.github.bartimaeusnek.crossmod.tectech.tileentites.tiered; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; +import org.apache.commons.lang3.ArrayUtils; + import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel; @@ -24,7 +26,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GT_Utility; -@SuppressWarnings("deprecation") public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatch_EnergyTunnel implements LowPowerLaser { @@ -32,20 +33,21 @@ public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatc super(aID, aName, aNameRegional, aTier, aAmp); } - public TT_MetaTileEntity_LowPowerLaserHatch(String aName, int aTier, int aAmp, String aDescription, + public TT_MetaTileEntity_LowPowerLaserHatch(String aName, int aTier, int aAmp, String[] aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aAmp, new String[] { aDescription }, aTextures); + super(aName, aTier, aAmp, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] { this.mDescription, + return ArrayUtils.addAll( + this.mDescriptionArray, StatCollector.translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + EnumChatFormatting.RESET + " EU/t", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); } @Override @@ -54,7 +56,7 @@ public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatc this.mName, this.mTier, this.Amperes, - this.mDescription, + this.mDescriptionArray, this.mTextures); } -- cgit From 6dc92bfe1dad0eb4928ec9ffdf5bb98cb746605e Mon Sep 17 00:00:00 2001 From: miozune Date: Sat, 23 Sep 2023 02:03:14 +0900 Subject: Cleanup noXXXYYY methods (#361) Former-commit-id: e5a4c18be25612616e4b6d9112802fb964ef3dbf --- .../bartworks/API/BioObjectAdder.java | 2 +- .../common/loaders/ArtificialMicaLine.java | 20 ++-- .../bartworks/common/loaders/FluidLoader.java | 2 +- .../common/loaders/recipes/Assembler.java | 50 ++++----- .../common/loaders/recipes/AssemblyLine.java | 10 +- .../common/loaders/recipes/Autoclave.java | 8 +- .../common/loaders/recipes/Centrifuge.java | 31 +++--- .../common/loaders/recipes/ChemicalBath.java | 28 ++--- .../common/loaders/recipes/ChemicalReactor.java | 2 +- .../common/loaders/recipes/Electrolyzer.java | 36 +++--- .../common/loaders/recipes/Extractor.java | 8 +- .../common/loaders/recipes/FluidHeater.java | 2 +- .../common/loaders/recipes/FluidSolidifier.java | 36 +++--- .../common/loaders/recipes/FormingPress.java | 18 +-- .../common/loaders/recipes/LaserEngraver.java | 3 +- .../bartworks/common/loaders/recipes/Mixer.java | 8 +- .../common/loaders/recipes/Pulverizer.java | 37 +++---- .../system/material/BW_MetaGeneratedFrames.java | 3 +- .../material/CircuitGeneration/BW_Meta_Items.java | 4 +- .../CircuitGeneration/CircuitPartLoader.java | 4 +- .../GT_Enhancement/GTMetaItemEnhancer.java | 13 +-- .../GT_Enhancement/PlatinumSludgeOverHaul.java | 123 ++++++++++----------- .../material/processingLoaders/AddSomeRecipes.java | 10 +- .../processingLoaders/AdditionalRecipes.java | 16 +-- .../werkstoff_loaders/recipe/BlockLoader.java | 11 +- .../werkstoff_loaders/recipe/CasingLoader.java | 8 +- .../werkstoff_loaders/recipe/CellLoader.java | 16 ++- .../recipe/CraftingMaterialLoader.java | 58 +++++----- .../werkstoff_loaders/recipe/CrushedLoader.java | 30 +++-- .../werkstoff_loaders/recipe/DustLoader.java | 26 ++--- .../werkstoff_loaders/recipe/GemLoader.java | 75 +++++++------ .../werkstoff_loaders/recipe/MetalLoader.java | 5 +- .../werkstoff_loaders/recipe/MoltenCellLoader.java | 71 ++++++------ .../recipe/MultipleMetalLoader.java | 2 +- .../werkstoff_loaders/recipe/OreLoader.java | 2 +- .../recipe/SimpleMetalLoader.java | 37 +++---- .../werkstoff_loaders/recipe/ToolLoader.java | 18 ++- 37 files changed, 390 insertions(+), 443 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java index bd336c265f..f13035b5c9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -178,7 +178,7 @@ public final class BioObjectAdder { new Exception("FAILED TO REGISTER FLUID FOR: " + B.getName()).printStackTrace(); } - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)).noItemOutputs() + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)) .fluidInputs(new FluidStack(B.getFluid(), 1000)).fluidOutputs(dnaFluid).duration(25 * SECONDS) .eut(TierEU.RECIPE_MV).addTo(sCentrifugeRecipes); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java index 97133ccec5..ea533e4b4b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java @@ -31,8 +31,7 @@ public class ArtificialMicaLine { // Mg + O = MgO GT_Values.RA.stdBuilder().itemInputs(Materials.Magnesium.getDust(1)).itemOutputs(Materials.Magnesia.getDust(2)) - .fluidInputs(Materials.Oxygen.getGas(1000)).noFluidOutputs().duration(2 * SECONDS).eut(8) - .addTo(UniversalChemical); + .fluidInputs(Materials.Oxygen.getGas(1000)).duration(2 * SECONDS).eut(8).addTo(UniversalChemical); // Si + 6HF = H2SiF6 + 4H GT_Values.RA.stdBuilder().itemInputs(Materials.Silicon.getDust(1), Materials.Empty.getCells(4)) @@ -43,7 +42,7 @@ public class ArtificialMicaLine { GT_Values.RA.stdBuilder().itemInputs(Materials.Potassium.getDust(1), GT_Utility.getIntegratedCircuit(2)) .itemOutputs(Materials.RockSalt.getDust(2)).fluidInputs(Materials.Chlorine.getGas(1000)) - .noFluidOutputs().duration(20 * TICKS).eut(8).addTo(UniversalChemical); + .duration(20 * TICKS).eut(8).addTo(UniversalChemical); // 2KCl + H2SiF6 = 2HCl + K2SiF6 GT_Values.RA.stdBuilder().itemInputs(Materials.RockSalt.getDust(4)) @@ -56,13 +55,12 @@ public class ArtificialMicaLine { GT_Values.RA.stdBuilder().itemInputs(Materials.Potassium.getDust(2), Materials.CarbonDioxide.getCells(1)) .itemOutputs(WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), Materials.Empty.getCells(1)) - .fluidInputs(Materials.Oxygen.getGas(1000)).noFluidOutputs().duration(2 * SECONDS).eut(8) - .addTo(UniversalChemical); + .fluidInputs(Materials.Oxygen.getGas(1000)).duration(2 * SECONDS).eut(8).addTo(UniversalChemical); // K2O + CO2 = K2CO3 GT_Values.RA.stdBuilder().itemInputs(Materials.Potash.getDust(3), Materials.CarbonDioxide.getCells(1)) .itemOutputs(WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), Materials.Empty.getCells(1)) - .noFluidInputs().noFluidOutputs().duration(2 * SECONDS).eut(8).addTo(UniversalChemical); + .duration(2 * SECONDS).eut(8).addTo(UniversalChemical); // 55Quartz Dust + 20K2SiF6 + 12Al2O3 + 4K2CO3 = 91Raw Fluorophlogopite Dust GT_Values.RA.stdBuilder() @@ -75,7 +73,7 @@ public class ArtificialMicaLine { .itemOutputs( WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27)) - .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sMixerRecipes); + .duration(20 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sMixerRecipes); // 55Quartzite/Nether Quartz Dust + 20K2SiF6 + 57Al2O3 + 4K2CO3 = 136Raw Fluorophlogopite Dust GT_Values.RA.stdBuilder() @@ -102,7 +100,7 @@ public class ArtificialMicaLine { WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8)) - .noFluidInputs().noFluidOutputs().duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sMixerRecipes); + .duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sMixerRecipes); // 62Certus Quartz Dust + 10K2SiF6 + 12Al2O3 + 7K2CO3 = 91Raw Fluorophlogopite Dust GT_Values.RA.stdBuilder() @@ -115,11 +113,11 @@ public class ArtificialMicaLine { .itemOutputs( WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27)) - .noFluidInputs().noFluidOutputs().duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sMixerRecipes); + .duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sMixerRecipes); // MgO(s) = MgO(l) - GT_Values.RA.stdBuilder().itemInputs(Materials.Magnesia.getDust(1)).noItemOutputs().noFluidInputs() + GT_Values.RA.stdBuilder().itemInputs(Materials.Magnesia.getDust(1)) .fluidOutputs(Materials.Magnesia.getMolten(144)).duration(20 * TICKS).eut(TierEU.RECIPE_MV) .addTo(sFluidExtractionRecipes); @@ -150,7 +148,7 @@ public class ArtificialMicaLine { WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(GT_ModHandler.getModItem(NewHorizonsCoreMod.ID, "item.MicaInsulatorFoil", 4)) - .noFluidInputs().noFluidOutputs().duration(10 * TICKS).eut(600).addTo(sBenderRecipes); + .duration(10 * TICKS).eut(600).addTo(sBenderRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 017dba8358..418a299f5c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -97,7 +97,7 @@ public class FluidLoader { GT_LanguageManager .addStringLocalization(B.getFluid().getUnlocalizedName(), B.getLocalisedName() + " Fluid"); - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)).noItemOutputs() + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)) .fluidInputs(new FluidStack(B.getFluid(), 1000)).fluidOutputs(dnaFluid).duration(25 * SECONDS) .eut(TierEU.RECIPE_MV).addTo(sCentrifugeRecipes); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java index ed29a3a7f0..833c3c647a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java @@ -46,7 +46,7 @@ public class Assembler implements Runnable { GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2L), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1)) - .fluidInputs(FluidRegistry.getFluidStack("ic2coolant", 1000)).noFluidOutputs().duration(5 * SECONDS) + .fluidInputs(FluidRegistry.getFluidStack("ic2coolant", 1000)).duration(5 * SECONDS) .eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder() @@ -54,51 +54,51 @@ public class Assembler implements Runnable { new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), Materials.Lapis.getBlocks(8), GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[1])).noFluidInputs().noFluidOutputs() - .duration(5 * SECONDS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[1])).duration(5 * SECONDS).eut(TierEU.RECIPE_HV) + .addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1000), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(ItemRegistry.megaMachines[0]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) - .noFluidOutputs().duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1002), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(ItemRegistry.megaMachines[1]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) - .noFluidOutputs().duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1126), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(ItemRegistry.megaMachines[2]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) - .noFluidOutputs().duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1169), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(ItemRegistry.megaMachines[3]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) - .noFluidOutputs().duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1160), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(ItemRegistry.megaMachines[4]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) - .noFluidOutputs().duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[2], 1, 1)) - .fluidInputs(Materials.Plastic.getMolten(1152L)).noFluidOutputs().duration(1 * TICKS) - .eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + .fluidInputs(Materials.Plastic.getMolten(1152L)).duration(1 * TICKS).eut(TierEU.RECIPE_HV) + .addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -107,8 +107,8 @@ public class Assembler implements Runnable { ItemList.Circuit_Board_Plastic.get(1L), ItemList.Battery_RE_LV_Lithium.get(1L)) .itemOutputs(new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER)) - .fluidInputs(Materials.SolderingAlloy.getMolten(288L)).noFluidOutputs().duration(30 * SECONDS) - .eut(TierEU.RECIPE_MV).addTo(sAssemblerRecipes); + .fluidInputs(Materials.SolderingAlloy.getMolten(288L)).duration(30 * SECONDS).eut(TierEU.RECIPE_MV) + .addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -120,7 +120,7 @@ public class Assembler implements Runnable { ItemRegistry.TecTechPipeEnergyLowPower.getItem(), 1, ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage())) - .fluidInputs(Materials.Polytetrafluoroethylene.getMolten(72)).noFluidOutputs().duration(10 * SECONDS) + .fluidInputs(Materials.Polytetrafluoroethylene.getMolten(72)).duration(10 * SECONDS) .eut(TierEU.RECIPE_EV).addTo(sAssemblerRecipes); ItemStack[][] converters = ItemRegistry.TecTechLaserAdditions[0]; @@ -171,7 +171,7 @@ public class Assembler implements Runnable { emitters[i].get(2 * (j + 1)), sensors[i].get(2 * (j + 1)), ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1))).itemOutputs(converter) - .fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)).noFluidOutputs() + .fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) .duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption).addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder() @@ -185,8 +185,7 @@ public class Assembler implements Runnable { sensors[i].get(2 * (j + 1)), ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1))) .itemOutputs(eInput).fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) - .noFluidOutputs().duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption) - .addTo(sAssemblerRecipes); + .duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption).addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -199,8 +198,7 @@ public class Assembler implements Runnable { emitters[i].get(2 * (j + 1)), ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1))) .itemOutputs(eDynamo).fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) - .noFluidOutputs().duration((10 * (j + 1) * SECONDS)).eut(recipeConsumption) - .addTo(sAssemblerRecipes); + .duration((10 * (j + 1) * SECONDS)).eut(recipeConsumption).addTo(sAssemblerRecipes); } } @@ -209,20 +207,20 @@ public class Assembler implements Runnable { ItemList.Hatch_Input_HV.get(64), Materials.LiquidAir.getCells(1), GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(ItemRegistry.compressedHatch.copy()).noFluidInputs().noFluidOutputs() - .duration(15 * SECONDS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + .itemOutputs(ItemRegistry.compressedHatch.copy()).duration(15 * SECONDS).eut(TierEU.RECIPE_HV) + .addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Hatch_Output_HV.get(64), GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(ItemRegistry.giantOutputHatch.copy()).noFluidInputs().noFluidOutputs() - .duration(15 * SECONDS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + .itemOutputs(ItemRegistry.giantOutputHatch.copy()).duration(15 * SECONDS).eut(TierEU.RECIPE_HV) + .addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 6), GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1)) .itemOutputs(new ItemStack(GregTech_API.sBlockCasings3, 1, 12)) - .fluidInputs(Materials.Concrete.getMolten(1296)).noFluidOutputs().duration(2 * SECONDS) - .eut(TierEU.RECIPE_IV).addTo(sAssemblerRecipes); + .fluidInputs(Materials.Concrete.getMolten(1296)).duration(2 * SECONDS).eut(TierEU.RECIPE_IV) + .addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -230,7 +228,7 @@ public class Assembler implements Runnable { GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Europium, 6), GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 24)) .itemOutputs(new ItemStack(GregTech_API.sBlockCasings8, 1, 5)) - .fluidInputs(Materials.Lead.getMolten(864)).noFluidOutputs().duration(10 * SECONDS) - .eut(TierEU.RECIPE_LuV).addTo(sAssemblerRecipes); + .fluidInputs(Materials.Lead.getMolten(864)).duration(10 * SECONDS).eut(TierEU.RECIPE_LuV) + .addTo(sAssemblerRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java index 860204d4a7..61d531de0b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java @@ -39,8 +39,8 @@ public class AssemblyLine implements Runnable { .fluidInputs( new FluidStack(solderIndalloy, 32 * 144), Materials.Polytetrafluoroethylene.getMolten(32 * 144)) - .noFluidOutputs().itemOutputs(ItemRegistry.dehp).eut(TierEU.RECIPE_LuV) - .duration(4 * MINUTES + 10 * SECONDS).addTo(AssemblyLine); + .itemOutputs(ItemRegistry.dehp).eut(TierEU.RECIPE_LuV).duration(4 * MINUTES + 10 * SECONDS) + .addTo(AssemblyLine); if (GalactiGreg.isModLoaded()) { GT_Values.RA.stdBuilder().metadata(RESEARCH_ITEM, ItemList.OreDrill4.get(1L)) @@ -54,8 +54,8 @@ public class AssemblyLine implements Runnable { ItemList.Field_Generator_LuV.get(9L), GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 36L)) .fluidInputs(new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Neon.getFluidOrGas(20000)) - .noFluidOutputs().itemOutputs(ItemRegistry.voidminer[0].copy()).eut(TierEU.RECIPE_LuV) - .duration(5 * MINUTES).addTo(AssemblyLine); + .itemOutputs(ItemRegistry.voidminer[0].copy()).eut(TierEU.RECIPE_LuV).duration(5 * MINUTES) + .addTo(AssemblyLine); } GT_Values.RA.stdBuilder().metadata(RESEARCH_ITEM, ItemList.Machine_LuV_CircuitAssembler.get(1L)) @@ -68,7 +68,7 @@ public class AssemblyLine implements Runnable { ItemList.Emitter_LuV.get(1L), ItemList.Sensor_LuV.get(1L), WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.plate, 8)) - .fluidInputs(new FluidStack(solderIndalloy, 1440)).noFluidOutputs().itemOutputs(ItemRegistry.cal.copy()) + .fluidInputs(new FluidStack(solderIndalloy, 1440)).itemOutputs(ItemRegistry.cal.copy()) .eut(TierEU.RECIPE_LuV).duration(20 * MINUTES).addTo(AssemblyLine); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java index 7d32af49a6..b8f6c51b6c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java @@ -22,13 +22,13 @@ public class Autoclave implements Runnable { GT_Values.RA.stdBuilder().itemInputs(ItemList.Circuit_Parts_PetriDish.get(1L)) .itemOutputs(BioItemList.getPetriDish(null)) - .fluidInputs(used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L)).noFluidOutputs() - .duration(5 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sAutoclaveRecipes); + .fluidInputs(used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L)).duration(5 * SECONDS) + .eut(TierEU.RECIPE_LV).addTo(sAutoclaveRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(Items.glass_bottle)) .itemOutputs(BioItemList.getDNASampleFlask(null)) - .fluidInputs(used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L)).noFluidOutputs() - .duration(5 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sAutoclaveRecipes); + .fluidInputs(used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L)).duration(5 * SECONDS) + .eut(TierEU.RECIPE_LV).addTo(sAutoclaveRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java index a20a3e4d82..adb84fd8a0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java @@ -36,8 +36,8 @@ public class Centrifuge implements Runnable { WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1)) - .outputChances(800, 375, 22, 22, 5).noFluidInputs().noFluidOutputs() - .duration(8 * MINUTES + 20 * SECONDS).eut(TierEU.RECIPE_EV).addTo(sCentrifugeRecipes); + .outputChances(800, 375, 22, 22, 5).duration(8 * MINUTES + 20 * SECONDS).eut(TierEU.RECIPE_EV) + .addTo(sCentrifugeRecipes); ItemStack[] pellets = new ItemStack[6]; Arrays.fill(pellets, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 4)); @@ -46,19 +46,18 @@ public class Centrifuge implements Runnable { .itemInputs( new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3), GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(pellets).noFluidInputs().noFluidOutputs().duration(40 * MINUTES).eut(TierEU.RECIPE_LV) - .addTo(sCentrifugeRecipes); + .itemOutputs(pellets).duration(40 * MINUTES).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); GT_Values.RA.stdBuilder() .itemInputs( new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 5), GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 6)).noFluidInputs() - .noFluidOutputs().duration(40 * MINUTES).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); + .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 6)) + .duration(40 * MINUTES).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 6)) - .itemOutputs(Materials.Lead.getDust(1)).outputChances(300).noFluidInputs().noFluidOutputs() - .duration(60 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); + .itemOutputs(Materials.Lead.getDust(1)).outputChances(300).duration(60 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(sCentrifugeRecipes); int i = 0; for (GT_TileEntity_HTGR.HTGRMaterials.Fuel_ fuel : sHTGR_Fuel) { @@ -72,16 +71,14 @@ public class Centrifuge implements Runnable { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4)) - .noFluidInputs().noFluidOutputs().duration(10 * MINUTES).eut(TierEU.RECIPE_LV) - .addTo(sCentrifugeRecipes); + .duration(10 * MINUTES).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); GT_Values.RA.stdBuilder() .itemInputs( new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 6)) - .noFluidInputs().noFluidOutputs().duration(2 * MINUTES + 30 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(sCentrifugeRecipes); + .duration(2 * MINUTES + 30 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); GT_RecipeBuilder recipeBuilder = GT_Values.RA.stdBuilder() .itemInputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 6)) @@ -91,10 +88,8 @@ public class Centrifuge implements Runnable { fuel.recycledItems[2], fuel.recycledItems[3], fuel.recycledItems[4]) - .outputChances(fuel.recycleChances).noFluidInputs(); - if (fuel.recycledFluid == null) { - recipeBuilder.noFluidOutputs(); - } else { + .outputChances(fuel.recycleChances); + if (fuel.recycledFluid != null) { recipeBuilder.fluidOutputs(fuel.recycledFluid); } recipeBuilder.duration(1 * MINUTES).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); @@ -107,12 +102,12 @@ public class Centrifuge implements Runnable { .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[1], 10)).duration(60 * SECONDS) .eut(TierEU.RECIPE_HV).addTo(sCentrifugeRecipes); - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(17)).noItemOutputs() + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(17)) .fluidInputs(new FluidStack(FluidLoader.BioLabFluidMaterials[1], 1000)) .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[3], 250)).duration(60 * SECONDS) .eut(TierEU.RECIPE_HV).addTo(sCentrifugeRecipes); - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(17)).noItemOutputs() + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(17)) .fluidInputs(new FluidStack(BioCultureLoader.CommonYeast.getFluid(), 1000)) .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[2], 10)).duration(60 * SECONDS) .eut(TierEU.RECIPE_HV).addTo(sCentrifugeRecipes); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java index b2e8e59868..47fc76767a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java @@ -21,33 +21,33 @@ public class ChemicalBath implements Runnable { GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 6)) - .fluidInputs(Dyes.dyeRed.getFluidDye(i, 36)).noFluidOutputs().duration(3 * SECONDS + 4 * TICKS) - .eut(2).addTo(sChemicalBathRecipes); + .fluidInputs(Dyes.dyeRed.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) + .addTo(sChemicalBathRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 7)) - .fluidInputs(Dyes.dyeGreen.getFluidDye(i, 36)).noFluidOutputs().duration(3 * SECONDS + 4 * TICKS) - .eut(2).addTo(sChemicalBathRecipes); + .fluidInputs(Dyes.dyeGreen.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) + .addTo(sChemicalBathRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 8)) - .fluidInputs(Dyes.dyePurple.getFluidDye(i, 36)).noFluidOutputs().duration(3 * SECONDS + 4 * TICKS) - .eut(2).addTo(sChemicalBathRecipes); + .fluidInputs(Dyes.dyePurple.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) + .addTo(sChemicalBathRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 9)) - .fluidInputs(Dyes.dyeYellow.getFluidDye(i, 36)).noFluidOutputs().duration(3 * SECONDS + 4 * TICKS) - .eut(2).addTo(sChemicalBathRecipes); + .fluidInputs(Dyes.dyeYellow.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) + .addTo(sChemicalBathRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 10)) - .fluidInputs(Dyes.dyeLime.getFluidDye(i, 36)).noFluidOutputs().duration(3 * SECONDS + 4 * TICKS) - .eut(2).addTo(sChemicalBathRecipes); + .fluidInputs(Dyes.dyeLime.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) + .addTo(sChemicalBathRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 11)) - .fluidInputs(Dyes.dyeBrown.getFluidDye(i, 36)).noFluidOutputs().duration(3 * SECONDS + 4 * TICKS) - .eut(2).addTo(sChemicalBathRecipes); + .fluidInputs(Dyes.dyeBrown.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) + .addTo(sChemicalBathRecipes); } @@ -55,8 +55,8 @@ public class ChemicalBath implements Runnable { GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, i)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) - .fluidInputs(Materials.Chlorine.getGas(50)).noFluidOutputs().duration(3 * SECONDS + 4 * TICKS) - .eut(2).addTo(sChemicalBathRecipes); + .fluidInputs(Materials.Chlorine.getGas(50)).duration(3 * SECONDS + 4 * TICKS).eut(2) + .addTo(sChemicalBathRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalReactor.java index 01d6e05c5b..e71a8b863f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalReactor.java @@ -17,7 +17,7 @@ public class ChemicalReactor implements Runnable { @Override public void run() { - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)).noItemOutputs() + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)) .fluidInputs(new FluidStack(FluidLoader.heatedfulvicAcid, 1000)) .fluidOutputs(new FluidStack(FluidLoader.Kerogen, 1000)).duration(3 * SECONDS + 15 * TICKS) .eut(TierEU.RECIPE_MV).addTo(UniversalChemical); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java index 18e0138043..b82e06a9e4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java @@ -23,35 +23,35 @@ public class Electrolyzer implements Runnable { .itemOutputs( GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnesium, 2L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L)) - .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(10 * SECONDS).eut(90) + .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(10 * SECONDS).eut(90) .addTo(sElectrolyzerRecipes); GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.RedZircon.get(OrePrefixes.dust, 6)) .itemOutputs( WerkstoffLoader.Zirconium.get(OrePrefixes.dust, 1), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L)) - .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(12 * SECONDS + 10 * TICKS) - .eut(90).addTo(sElectrolyzerRecipes); + .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(12 * SECONDS + 10 * TICKS).eut(90) + .addTo(sElectrolyzerRecipes); GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.Fayalit.get(OrePrefixes.dust, 7)) .itemOutputs( GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 2L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L)) - .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(16 * SECONDS).eut(90) + .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(16 * SECONDS).eut(90) .addTo(sElectrolyzerRecipes); GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.Prasiolite.get(OrePrefixes.dust, 16)) .itemOutputs( GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 5L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L)) - .noFluidInputs().noFluidOutputs().duration(29 * SECONDS).eut(90).addTo(sElectrolyzerRecipes); + .duration(29 * SECONDS).eut(90).addTo(sElectrolyzerRecipes); GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.Hedenbergit.get(OrePrefixes.dust, 10)) .itemOutputs( GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Calcium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 2L)) - .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(15 * SECONDS).eut(90) + .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(15 * SECONDS).eut(90) .addTo(sElectrolyzerRecipes); GT_Values.RA.stdBuilder() @@ -61,8 +61,8 @@ public class Electrolyzer implements Runnable { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2)) - .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(19 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_MV).addTo(sElectrolyzerRecipes); + .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(19 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_MV) + .addTo(sElectrolyzerRecipes); GT_Values.RA.stdBuilder() .itemInputs(WerkstoffLoader.FuchsitCR.get(OrePrefixes.dust, 21), ItemList.Cell_Empty.get(2)) @@ -71,8 +71,8 @@ public class Electrolyzer implements Runnable { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2)) - .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(23 * SECONDS) - .eut(TierEU.RECIPE_MV).addTo(sElectrolyzerRecipes); + .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(23 * SECONDS).eut(TierEU.RECIPE_MV) + .addTo(sElectrolyzerRecipes); GT_Values.RA.stdBuilder() .itemInputs(WerkstoffLoader.VanadioOxyDravit.get(OrePrefixes.dust, 53), ItemList.Cell_Empty.get(3)) @@ -83,8 +83,8 @@ public class Electrolyzer implements Runnable { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3)) - .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(19000L)).duration(35 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_MV).addTo(sElectrolyzerRecipes); + .fluidOutputs(Materials.Oxygen.getGas(19000L)).duration(35 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_MV) + .addTo(sElectrolyzerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -97,8 +97,8 @@ public class Electrolyzer implements Runnable { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3)) - .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(19000L)).duration(36 * SECONDS) - .eut(TierEU.RECIPE_MV).addTo(sElectrolyzerRecipes); + .fluidOutputs(Materials.Oxygen.getGas(19000L)).duration(36 * SECONDS).eut(TierEU.RECIPE_MV) + .addTo(sElectrolyzerRecipes); GT_Values.RA.stdBuilder() .itemInputs(WerkstoffLoader.FluorBuergerit.get(OrePrefixes.dust, 50), ItemList.Cell_Empty.get(3)) @@ -109,8 +109,8 @@ public class Electrolyzer implements Runnable { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fluorine, 3)) - .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(6000L)).duration(36 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_MV).addTo(sElectrolyzerRecipes); + .fluidOutputs(Materials.Oxygen.getGas(6000L)).duration(36 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_MV) + .addTo(sElectrolyzerRecipes); GT_Values.RA.stdBuilder() .itemInputs(WerkstoffLoader.Olenit.get(OrePrefixes.dust, 51), ItemList.Cell_Empty.get(1)) @@ -120,8 +120,8 @@ public class Electrolyzer implements Runnable { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 1)) - .noFluidInputs().fluidOutputs(Materials.Oxygen.getGas(1000L)).duration(39 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_MV).addTo(sElectrolyzerRecipes); + .fluidOutputs(Materials.Oxygen.getGas(1000L)).duration(39 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_MV) + .addTo(sElectrolyzerRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java index a87b71f8aa..c1b2a4ba25 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java @@ -25,15 +25,15 @@ public class Extractor implements Runnable { for (ItemStack stack : oreCropVine) { GT_Values.RA.stdBuilder().itemInputs(BW_Util.setStackSize(stack, 12)) - .itemOutputs(BioItemList.getOther(1)).noFluidInputs().noFluidOutputs().duration(25 * SECONDS) - .eut((int) TierEU.RECIPE_HV).addTo(sExtractorRecipes); + .itemOutputs(BioItemList.getOther(1)).duration(25 * SECONDS).eut((int) TierEU.RECIPE_HV) + .addTo(sExtractorRecipes); } } GT_Values.RA.stdBuilder().itemInputs(ItemList.Circuit_Chip_Stemcell.get(1L)) - .itemOutputs(BioItemList.getOther(4)).noFluidInputs().noFluidOutputs().duration(25 * SECONDS) - .eut((int) TierEU.RECIPE_LuV).addTo(sExtractorRecipes); + .itemOutputs(BioItemList.getOther(4)).duration(25 * SECONDS).eut((int) TierEU.RECIPE_LuV) + .addTo(sExtractorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java index d2125aac22..e1eaa07400 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java @@ -16,7 +16,7 @@ public class FluidHeater implements Runnable { @Override public void run() { - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)).noItemOutputs() + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)) .fluidInputs(new FluidStack(FluidLoader.fulvicAcid, 1000)) .fluidOutputs(new FluidStack(FluidLoader.heatedfulvicAcid, 1000)).duration(4 * SECONDS + 10 * TICKS) .eut(TierEU.RECIPE_MV).addTo(sFluidHeaterRecipes); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java index 5c5271f2b7..d9939ac3b2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java @@ -21,52 +21,52 @@ public class FluidSolidifier implements Runnable { GT_Values.RA.stdBuilder().itemInputs(new ItemStack(Blocks.lapis_block)) .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0)) - .fluidInputs(Materials.Iron.getMolten(1296L)).noFluidOutputs().duration(5 * SECONDS) - .eut(TierEU.RECIPE_HV).addTo(sFluidSolidficationRecipes); + .fluidInputs(Materials.Iron.getMolten(1296L)).duration(5 * SECONDS).eut(TierEU.RECIPE_HV) + .addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1)) - .fluidInputs(Materials.Titanium.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) - .eut(TierEU.RECIPE_HV).addTo(sFluidSolidficationRecipes); + .fluidInputs(Materials.Titanium.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_HV) + .addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2)) - .fluidInputs(Materials.TungstenSteel.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) - .eut(TierEU.RECIPE_EV).addTo(sFluidSolidficationRecipes); + .fluidInputs(Materials.TungstenSteel.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_EV) + .addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3)) - .fluidInputs(WerkstoffLoader.LuVTierMaterial.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) + .fluidInputs(WerkstoffLoader.LuVTierMaterial.getMolten(1152)).duration(40 * SECONDS) .eut(TierEU.RECIPE_IV).addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4)) - .fluidInputs(Materials.Iridium.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) - .eut(TierEU.RECIPE_LuV).addTo(sFluidSolidficationRecipes); + .fluidInputs(Materials.Iridium.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_LuV) + .addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5)) - .fluidInputs(Materials.Osmium.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) - .eut(TierEU.RECIPE_ZPM).addTo(sFluidSolidficationRecipes); + .fluidInputs(Materials.Osmium.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_ZPM) + .addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 13)) - .fluidInputs(Materials.Neutronium.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) - .eut(TierEU.RECIPE_UV).addTo(sFluidSolidficationRecipes); + .fluidInputs(Materials.Neutronium.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_UV) + .addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 14)) - .fluidInputs(Materials.CosmicNeutronium.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) - .eut(TierEU.RECIPE_UHV).addTo(sFluidSolidficationRecipes); + .fluidInputs(Materials.CosmicNeutronium.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_UHV) + .addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 15)) - .fluidInputs(Materials.Infinity.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) - .eut(TierEU.RECIPE_UEV).addTo(sFluidSolidficationRecipes); + .fluidInputs(Materials.Infinity.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_UEV) + .addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[1], 1, 0)) - .fluidInputs(MaterialsUEVplus.TranscendentMetal.getMolten(1152)).noFluidOutputs().duration(40 * SECONDS) + .fluidInputs(MaterialsUEVplus.TranscendentMetal.getMolten(1152)).duration(40 * SECONDS) .eut(TierEU.RECIPE_UIV).addTo(sFluidSolidficationRecipes); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java index 4523503c87..f24e71fb99 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java @@ -22,22 +22,22 @@ public class FormingPress implements Runnable { .itemInputs( new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials), Materials.Graphite.getDust(64)) - .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1)).noFluidInputs() - .noFluidOutputs().duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); + .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1)) + .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); GT_Values.RA.stdBuilder() .itemInputs( new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1), Materials.Silicon.getDust(64)) - .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2)).noFluidInputs() - .noFluidOutputs().duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); + .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2)) + .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); GT_Values.RA.stdBuilder() .itemInputs( new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2), Materials.Graphite.getDust(64)) - .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3)).noFluidInputs() - .noFluidOutputs().duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); + .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3)) + .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); int i = 0; for (GT_TileEntity_HTGR.HTGRMaterials.Fuel_ fuel : sHTGR_Fuel) { @@ -46,21 +46,21 @@ public class FormingPress implements Runnable { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i), Materials.Carbon.getDust(64)) .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1)) - .noFluidInputs().noFluidOutputs().duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); + .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); GT_Values.RA.stdBuilder() .itemInputs( new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), Materials.Silicon.getDust(64)) .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2)) - .noFluidInputs().noFluidOutputs().duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); + .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); GT_Values.RA.stdBuilder() .itemInputs( new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), Materials.Graphite.getDust(64)) .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3)) - .noFluidInputs().noFluidOutputs().duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); + .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); i += MATERIALS_PER_FUEL; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java index 2d6f80ac9a..3e01bfb7be 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java @@ -16,8 +16,7 @@ public class LaserEngraver implements Runnable { public void run() { GT_Values.RA.stdBuilder().itemInputs(new ItemStack(Items.emerald), GT_Utility.getIntegratedCircuit(17)) - .noItemOutputs().noFluidInputs().noFluidOutputs().duration(5 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(sLaserEngraverRecipes); + .duration(5 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sLaserEngraverRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java index 4810a396ae..e6ea24dc8b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java @@ -31,14 +31,14 @@ public class Mixer implements Runnable { WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 10), Materials.Uranium235.getDust(1), GT_Utility.getIntegratedCircuit(2)) - .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials)).noFluidInputs() - .noFluidOutputs().duration(20 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials)).duration(20 * SECONDS) + .eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); int i = 0; for (GT_TileEntity_HTGR.HTGRMaterials.Fuel_ fuel : sHTGR_Fuel) { GT_Values.RA.stdBuilder().itemInputs(fuel.mainItem, fuel.secondaryItem, GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i)).noFluidInputs() - .noFluidOutputs().duration(20 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i)) + .duration(20 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); i += MATERIALS_PER_FUEL; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java index dea39b0088..8dd55d5f24 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java @@ -20,51 +20,48 @@ public class Pulverizer implements Runnable { public void run() { GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1)) - .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Titanium.getDust(8)).noFluidInputs() - .noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_EV).addTo(sMaceratorRecipes); + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Titanium.getDust(8)) + .duration(40 * SECONDS).eut(TierEU.RECIPE_EV).addTo(sMaceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2)) - .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.TungstenSteel.getDust(8)).noFluidInputs() - .noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_IV).addTo(sMaceratorRecipes); + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.TungstenSteel.getDust(8)) + .duration(40 * SECONDS).eut(TierEU.RECIPE_IV).addTo(sMaceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3)) .itemOutputs( Materials.BorosilicateGlass.getDust(9), WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.dust, 8)) - .noFluidInputs().noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_LuV) - .addTo(sMaceratorRecipes); + .duration(40 * SECONDS).eut(TierEU.RECIPE_LuV).addTo(sMaceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4)) - .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Iridium.getDust(8)).noFluidInputs() - .noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_ZPM).addTo(sMaceratorRecipes); + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Iridium.getDust(8)) + .duration(40 * SECONDS).eut(TierEU.RECIPE_ZPM).addTo(sMaceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5)) - .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Osmium.getDust(8)).noFluidInputs() - .noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_UV).addTo(sMaceratorRecipes); + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Osmium.getDust(8)).duration(40 * SECONDS) + .eut(TierEU.RECIPE_UV).addTo(sMaceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 13)) - .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Neutronium.getDust(8)).noFluidInputs() - .noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_UHV).addTo(sMaceratorRecipes); + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Neutronium.getDust(8)) + .duration(40 * SECONDS).eut(TierEU.RECIPE_UHV).addTo(sMaceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 14)) .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.CosmicNeutronium.getDust(8)) - .noFluidInputs().noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_UEV) - .addTo(sMaceratorRecipes); + .duration(40 * SECONDS).eut(TierEU.RECIPE_UEV).addTo(sMaceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 15)) - .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Infinity.getDust(8)).noFluidInputs() - .noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_UIV).addTo(sMaceratorRecipes); + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Infinity.getDust(8)) + .duration(40 * SECONDS).eut(TierEU.RECIPE_UIV).addTo(sMaceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[1], 1, 0)) .itemOutputs(Materials.BorosilicateGlass.getDust(9), MaterialsUEVplus.TranscendentMetal.getDust(8)) - .noFluidInputs().noFluidOutputs().duration(40 * SECONDS).eut(TierEU.RECIPE_UMV) - .addTo(sMaceratorRecipes); + .duration(40 * SECONDS).eut(TierEU.RECIPE_UMV).addTo(sMaceratorRecipes); for (int i = 6; i < 11; i++) { GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, i)) - .itemOutputs(Materials.BorosilicateGlass.getDust(9)).noFluidInputs().noFluidOutputs() - .duration(20 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sMaceratorRecipes); + .itemOutputs(Materials.BorosilicateGlass.getDust(9)).duration(20 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(sMaceratorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java index 4b5802d5e0..cb876af9bc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java @@ -52,8 +52,7 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { .itemInputs( GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.getVarName(), 4), ItemList.Circuit_Integrated.getWithDamage(0, 4)) - .itemOutputs(getStackForm(1)).noFluidInputs().noFluidOutputs().duration(3 * SECONDS + 4 * TICKS).eut(8) - .addTo(sAssemblerRecipes); + .itemOutputs(getStackForm(1)).duration(3 * SECONDS + 4 * TICKS).eut(8).addTo(sAssemblerRecipes); } private BW_MetaGeneratedFrames(String aName, Werkstoff aMaterial) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index ac51f8add9..69c66b9474 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -75,8 +75,8 @@ public class BW_Meta_Items { .itemInputs( WerkstoffLoader.MagnetoResonaticDust.get(OrePrefixes.dust, 1), WerkstoffLoader.ArInGaPhoBiBoTe.get(OrePrefixes.dust, 4)) - .itemOutputs(BW_Meta_Items.NEWCIRCUITS.getStack(2)).noFluidInputs().noFluidOutputs() - .duration(15 * SECONDS).eut(TierEU.RECIPE_HV).addTo(sPressRecipes); + .itemOutputs(BW_Meta_Items.NEWCIRCUITS.getStack(2)).duration(15 * SECONDS).eut(TierEU.RECIPE_HV) + .addTo(sPressRecipes); GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.add( new BWRecipes.DynamicGTRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index bfa773dc45..7babb0d3c1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -156,8 +156,8 @@ public class CircuitPartLoader implements Runnable { GT_Values.RA.stdBuilder().itemInputs(single.get(16).copy(), GT_Utility.getIntegratedCircuit(16)) .itemOutputs(BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs)) - .fluidInputs(Materials.Plastic.getMolten(72)).noFluidOutputs().duration(30 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(sAssemblerRecipes); + .fluidInputs(Materials.Plastic.getMolten(72)).duration(30 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(sAssemblerRecipes); CircuitImprintLoader.circuitIIconRefs.put(CircuitImprintLoader.reverseIDs, single); CircuitImprintLoader.reverseIDs--; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java index e04b37a5f1..0cfc062fb9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -62,11 +62,11 @@ public class GTMetaItemEnhancer { GT_Utility.addFluidContainerData(emptyData); GT_Values.RA.stdBuilder().itemInputs(GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1)) - .itemOutputs(new ItemStack(moltenCapsuls, 1, i)).fluidInputs(m.getMolten(144)).noFluidOutputs() + .itemOutputs(new ItemStack(moltenCapsuls, 1, i)).fluidInputs(m.getMolten(144)) .duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(moltenCapsuls, 1, i)).noItemOutputs().noFluidInputs() - .fluidOutputs(m.getMolten(144)).duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(moltenCapsuls, 1, i)).fluidOutputs(m.getMolten(144)) + .duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); } if (m.getFluid(1) == null && m.getGas(1) == null) continue; @@ -93,11 +93,10 @@ public class GTMetaItemEnhancer { GT_Utility.addFluidContainerData(emptyData); GT_Values.RA.stdBuilder().itemInputs(container).itemOutputs(new ItemStack(filled, 1, it)) - .fluidInputs(new FluidStack(f, amount)).noFluidOutputs().duration(amount / 62).eut(2) - .addTo(sFluidCannerRecipes); + .fluidInputs(new FluidStack(f, amount)).duration(amount / 62).eut(2).addTo(sFluidCannerRecipes); - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(filled, 1, it)).noItemOutputs().noFluidInputs() - .fluidOutputs(new FluidStack(f, amount)).duration(amount / 62).eut(2).addTo(sFluidCannerRecipes); + GT_Values.RA.stdBuilder().itemInputs(new ItemStack(filled, 1, it)).fluidOutputs(new FluidStack(f, amount)) + .duration(amount / 62).eut(2).addTo(sFluidCannerRecipes); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index e4fa5bf8ac..8883e72e61 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -147,8 +147,8 @@ public class PlatinumSludgeOverHaul { Materials.SulfuricAcid.getCells(2), Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(Materials.DilutedSulfuricAcid.getCells(3)).noFluidInputs().noFluidOutputs() - .duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + .itemOutputs(Materials.DilutedSulfuricAcid.getCells(3)).duration(1 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); GT_Values.RA.stdBuilder().itemInputs(Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(Materials.Empty.getCells(1)).fluidInputs(Materials.SulfuricAcid.getFluid(2000)) @@ -162,14 +162,14 @@ public class PlatinumSludgeOverHaul { // FormicAcid // CO + NaOH = CHO2Na GT_Values.RA.stdBuilder().itemInputs(Materials.CarbonMonoxide.getCells(1), Materials.SodiumHydroxide.getDust(3)) - .itemOutputs(Sodiumformate.get(cell)).noFluidInputs().noFluidOutputs().duration(15 * TICKS) - .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + .itemOutputs(Sodiumformate.get(cell)).duration(15 * TICKS).eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); // H2SO4 + 2CHO2Na = 2CH2O2 + Na2SO4 GT_Values.RA.stdBuilder().itemInputs(Sodiumformate.get(cell, 2), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(FormicAcid.get(cell, 2), Sodiumsulfate.get(dust, 7)) - .fluidInputs(Materials.SulfuricAcid.getFluid(1000)).noFluidOutputs().duration(15 * TICKS) - .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + .fluidInputs(Materials.SulfuricAcid.getFluid(1000)).duration(15 * TICKS).eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); GT_Values.RA.stdBuilder().itemInputs(Materials.SulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(Materials.Empty.getCells(1), Sodiumsulfate.get(dust, 7)) @@ -182,15 +182,15 @@ public class PlatinumSludgeOverHaul { Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(AquaRegia.get(cell, 2)).noFluidInputs().noFluidOutputs().duration(1 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + .itemOutputs(AquaRegia.get(cell, 2)).duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) + .addTo(sMixerRecipes); GT_Values.RA.stdBuilder() .itemInputs( Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(2)) - .itemOutputs(Materials.Empty.getCells(2)).noFluidInputs().fluidOutputs(AquaRegia.getFluidOrGas(2000)) + .itemOutputs(Materials.Empty.getCells(2)).fluidOutputs(AquaRegia.getFluidOrGas(2000)) .duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); GT_Values.RA.stdBuilder().itemInputs(Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(3)) @@ -209,7 +209,7 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.stdBuilder().itemInputs(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(AmmoniumChloride.get(cell, 1)).fluidInputs(Materials.HydrochloricAcid.getFluid(1000)) - .noFluidOutputs().duration(15 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + .duration(15 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); GT_Values.RA.stdBuilder().itemInputs(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(Materials.Empty.getCells(1)).fluidInputs(Materials.Ammonia.getGas(1000)) @@ -228,14 +228,12 @@ public class PlatinumSludgeOverHaul { && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { GT_Values.RA.stdBuilder().itemInputs(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(1)) - .noItemOutputs().fluidInputs(AquaRegia.getFluidOrGas(150)) - .fluidOutputs(PTConcentrate.getFluidOrGas(150)).duration(12 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + .fluidInputs(AquaRegia.getFluidOrGas(150)).fluidOutputs(PTConcentrate.getFluidOrGas(150)) + .duration(12 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); GT_Values.RA.stdBuilder().itemInputs(w.get(crushedPurified, 9), GT_Utility.getIntegratedCircuit(9)) - .noItemOutputs().fluidInputs(AquaRegia.getFluidOrGas(1350)) - .fluidOutputs(PTConcentrate.getFluidOrGas(1350)).duration(11 * SECONDS + 5 * TICKS) - .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + .fluidInputs(AquaRegia.getFluidOrGas(1350)).fluidOutputs(PTConcentrate.getFluidOrGas(1350)) + .duration(11 * SECONDS + 5 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); GT_Values.RA.stdBuilder().itemInputs(w.get(crushedPurified, 9), PTMetallicPowder.get(dust, 9)) .itemOutputs(PTResidue.get(dust)).fluidInputs(AquaRegia.getFluidOrGas(10350)) @@ -252,7 +250,7 @@ public class PlatinumSludgeOverHaul { .itemInputs( GT_OreDictUnificator.get(crushedPurified, m, 1), GT_Utility.getIntegratedCircuit(1)) - .noItemOutputs().fluidInputs(AquaRegia.getFluidOrGas(150)) + .fluidInputs(AquaRegia.getFluidOrGas(150)) .fluidOutputs(PTConcentrate.getFluidOrGas(150)).duration(12 * SECONDS + 10 * TICKS) .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); @@ -260,7 +258,7 @@ public class PlatinumSludgeOverHaul { .itemInputs( GT_OreDictUnificator.get(crushedPurified, m, 9), GT_Utility.getIntegratedCircuit(9)) - .noItemOutputs().fluidInputs(AquaRegia.getFluidOrGas(1350)) + .fluidInputs(AquaRegia.getFluidOrGas(1350)) .fluidOutputs(PTConcentrate.getFluidOrGas(1350)) .duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) .addTo(UniversalChemical); @@ -277,8 +275,8 @@ public class PlatinumSludgeOverHaul { } // Pt GT_Values.RA.stdBuilder().itemInputs(PTMetallicPowder.get(dust, 3), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(Materials.Platinum.getNuggets(2)).noFluidInputs().noFluidOutputs().duration(30 * SECONDS) - .eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, Materials.Platinum.mMeltingPoint).addTo(sBlastRecipes); + .itemOutputs(Materials.Platinum.getNuggets(2)).duration(30 * SECONDS).eut(TierEU.RECIPE_MV) + .metadata(COIL_HEAT, Materials.Platinum.mMeltingPoint).addTo(sBlastRecipes); GT_Values.RA.stdBuilder().itemInputs(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(PTResidue.get(dustTiny)).fluidInputs(AquaRegia.getFluidOrGas(1000)) @@ -327,37 +325,36 @@ public class PlatinumSludgeOverHaul { PTSaltRefined.get(dust), PTSaltRefined.get(dust), PTSaltRefined.get(dust)) - .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500).noFluidInputs().noFluidOutputs() - .duration(30 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sSifterRecipes); + .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500).duration(30 * SECONDS) + .eut(TierEU.RECIPE_LV).addTo(sSifterRecipes); GT_Values.RA.stdBuilder().itemInputs(PTSaltRefined.get(dust), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(PTMetallicPowder.get(dust)).noFluidInputs().fluidOutputs(Materials.Chlorine.getGas(87)) + .itemOutputs(PTMetallicPowder.get(dust)).fluidOutputs(Materials.Chlorine.getGas(87)) .duration(10 * SECONDS).eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 900).addTo(sBlastRecipes); // 2PtCl + Ca = 2Pt + CaCl2 GT_Values.RA.stdBuilder().itemInputs(PTRawPowder.get(dust, 4), Materials.Calcium.getDust(1)) - .itemOutputs(Materials.Platinum.getDust(2), CalciumChloride.get(dust, 3)).noFluidInputs() - .noFluidOutputs().duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + .itemOutputs(Materials.Platinum.getDust(2), CalciumChloride.get(dust, 3)) + .duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); // Pd GT_Values.RA.stdBuilder().itemInputs(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1)) - .noItemOutputs().fluidInputs(Materials.Ammonia.getGas(1000)).fluidOutputs(PDAmmonia.getFluidOrGas(1000)) + .fluidInputs(Materials.Ammonia.getGas(1000)).fluidOutputs(PDAmmonia.getFluidOrGas(1000)) .duration(12 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); GT_Values.RA.stdBuilder().itemInputs(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(PDSalt.get(dustTiny, 16), PDRawPowder.get(dustTiny, 2)) - .fluidInputs(PDAmmonia.getFluidOrGas(1000)).noFluidOutputs().duration(12 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + .fluidInputs(PDAmmonia.getFluidOrGas(1000)).duration(12 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); GT_Values.RA.stdBuilder().itemInputs(PDMetallicPowder.get(dust, 9), GT_Utility.getIntegratedCircuit(9)) .itemOutputs(PDSalt.get(dust, 16), PDRawPowder.get(dust, 2)).fluidInputs(PDAmmonia.getFluidOrGas(9000)) - .noFluidOutputs().duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) - .addTo(UniversalChemical); + .duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(2)).itemOutputs(PDSalt.get(dust)) - .fluidInputs(PDAmmonia.getFluidOrGas(1000)).noFluidOutputs().duration(12 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + .fluidInputs(PDAmmonia.getFluidOrGas(1000)).duration(12 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); GT_Values.RA.stdBuilder().itemInputs(PDSalt.get(dust)) .itemOutputs( @@ -370,8 +367,8 @@ public class PlatinumSludgeOverHaul { PDMetallicPowder.get(dust), PDMetallicPowder.get(dust), PDMetallicPowder.get(dust)) - .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500).noFluidInputs().noFluidOutputs() - .duration(30 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sSifterRecipes); + .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500).duration(30 * SECONDS) + .eut(TierEU.RECIPE_LV).addTo(sSifterRecipes); GT_Values.RA.addChemicalRecipeForBasicMachineOnly( PDRawPowder.get(dust, 4), @@ -393,7 +390,7 @@ public class PlatinumSludgeOverHaul { // Na2SO4 + 2H = 2Na + H2SO4 GT_Values.RA.stdBuilder().itemInputs(Sodiumsulfate.get(dust, 7), Materials.Hydrogen.getCells(2)) - .itemOutputs(Materials.Sodium.getDust(2), Materials.Empty.getCells(2)).noFluidInputs() + .itemOutputs(Materials.Sodium.getDust(2), Materials.Empty.getCells(2)) .fluidOutputs(Materials.SulfuricAcid.getFluid(1000)).duration(1 * SECONDS + 10 * TICKS) .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); @@ -413,11 +410,10 @@ public class PlatinumSludgeOverHaul { .duration(10 * SECONDS).eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 775).addTo(sBlastRecipes); GT_Values.RA.stdBuilder().itemInputs(SodiumRuthenate.get(dust, 6), Materials.Chlorine.getCells(3)) - .itemOutputs(Materials.Empty.getCells(3)).noFluidInputs() - .fluidOutputs(RutheniumTetroxideSollution.getFluidOrGas(9000)).duration(15 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + .itemOutputs(Materials.Empty.getCells(3)).fluidOutputs(RutheniumTetroxideSollution.getFluidOrGas(9000)) + .duration(15 * SECONDS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(1)).noItemOutputs() + GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(1)) .fluidInputs(RutheniumTetroxideSollution.getFluidOrGas(800)) .fluidOutputs(HotRutheniumTetroxideSollution.getFluidOrGas(800)).duration(15 * SECONDS) .eut(TierEU.RECIPE_HV).addTo(sFluidHeaterRecipes); @@ -437,7 +433,7 @@ public class PlatinumSludgeOverHaul { 480); GT_Values.RA.stdBuilder().itemInputs(RutheniumTetroxide.get(dust, 1), Materials.HydrochloricAcid.getCells(6)) - .itemOutputs(Ruthenium.get(dust), Materials.Chlorine.getCells(6)).noFluidInputs() + .itemOutputs(Ruthenium.get(dust), Materials.Chlorine.getCells(6)) .fluidOutputs(Materials.Water.getFluid(2000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) .addTo(UniversalChemical); @@ -455,27 +451,26 @@ public class PlatinumSludgeOverHaul { (int) TierEU.RECIPE_IV); GT_Values.RA.stdBuilder().itemInputs(OsmiumSolution.get(cell), Materials.HydrochloricAcid.getCells(6)) - .itemOutputs(Materials.Osmium.getDust(1), Materials.Chlorine.getCells(7)).noFluidInputs() + .itemOutputs(Materials.Osmium.getDust(1), Materials.Chlorine.getCells(7)) .fluidOutputs(Materials.Water.getFluid(2000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) .addTo(UniversalChemical); // Ir GT_Values.RA.stdBuilder().itemInputs(IrLeachResidue.get(dust), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(PGSDResidue.get(dust), IridiumDioxide.get(dust)).noFluidInputs().noFluidOutputs() - .duration(10 * SECONDS).eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 775).addTo(sBlastRecipes); + .itemOutputs(PGSDResidue.get(dust), IridiumDioxide.get(dust)).duration(10 * SECONDS) + .eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 775).addTo(sBlastRecipes); GT_Values.RA.stdBuilder().itemInputs(IridiumDioxide.get(dust), Materials.HydrochloricAcid.getCells(1)) - .itemOutputs(Materials.Empty.getCells(1)).noFluidInputs() - .fluidOutputs(AcidicIridiumSolution.getFluidOrGas(1000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(UniversalChemical); + .itemOutputs(Materials.Empty.getCells(1)).fluidOutputs(AcidicIridiumSolution.getFluidOrGas(1000)) + .duration(15 * SECONDS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); GT_Values.RA.stdBuilder().itemInputs(AcidicIridiumSolution.get(cell), AmmoniumChloride.get(cell, 3)) - .itemOutputs(Materials.Empty.getCells(4), IridiumChloride.get(dust)).noFluidInputs() + .itemOutputs(Materials.Empty.getCells(4), IridiumChloride.get(dust)) .fluidOutputs(Materials.Ammonia.getGas(3000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) .addTo(UniversalChemical); GT_Values.RA.stdBuilder().itemInputs(IridiumChloride.get(dust), Materials.Calcium.getDust(1)) - .itemOutputs(PGSDResidue2.get(dust), Materials.Iridium.getDust(1)).noFluidInputs() + .itemOutputs(PGSDResidue2.get(dust), Materials.Iridium.getDust(1)) .fluidOutputs(CalciumChloride.getFluidOrGas(3000)).duration(15 * SECONDS).eut(TierEU.RECIPE_EV) .addTo(UniversalChemical); // Rh @@ -495,21 +490,21 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.stdBuilder().itemInputs(Materials.Zinc.getDust(1)) .itemOutputs(ZincSulfate.get(dust, 6), CrudeRhMetall.get(dust)) - .fluidInputs(RHSulfateSolution.getFluidOrGas(1000)).noFluidOutputs().duration(15 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + .fluidInputs(RHSulfateSolution.getFluidOrGas(1000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); GT_Values.RA.stdBuilder().itemInputs(CrudeRhMetall.get(dust), Materials.Salt.getDust(1)) - .itemOutputs(RHSalt.get(dust, 3)).fluidInputs(Materials.Chlorine.getGas(1000)).noFluidOutputs() - .duration(15 * SECONDS).eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 600).addTo(sBlastRecipes); + .itemOutputs(RHSalt.get(dust, 3)).fluidInputs(Materials.Chlorine.getGas(1000)).duration(15 * SECONDS) + .eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 600).addTo(sBlastRecipes); - GT_Values.RA.stdBuilder().itemInputs(RHSalt.get(dust, 10)).noItemOutputs() - .fluidInputs(Materials.Water.getFluid(2000)).fluidOutputs(RHSaltSolution.getFluidOrGas(2000)) - .duration(15 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + GT_Values.RA.stdBuilder().itemInputs(RHSalt.get(dust, 10)).fluidInputs(Materials.Water.getFluid(2000)) + .fluidOutputs(RHSaltSolution.getFluidOrGas(2000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(sMixerRecipes); GT_Values.RA.stdBuilder().itemInputs(SodiumNitrate.get(dust, 5), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(RHNitrate.get(dust), Materials.Salt.getDust(2)) - .fluidInputs(RHSaltSolution.getFluidOrGas(1000)).noFluidOutputs().duration(15 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + .fluidInputs(RHSaltSolution.getFluidOrGas(1000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); // Na + HNO3 = NaNO3 + H GT_Values.RA.stdBuilder().itemInputs(Materials.Sodium.getDust(1)).itemOutputs(SodiumNitrate.get(dust, 5)) @@ -527,16 +522,16 @@ public class PlatinumSludgeOverHaul { RhFilterCake.get(dust), RhFilterCake.get(dust), RhFilterCake.get(dust)) - .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500).noFluidInputs().noFluidOutputs() - .duration(30 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sSifterRecipes); + .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500).duration(30 * SECONDS) + .eut(TierEU.RECIPE_LV).addTo(sSifterRecipes); - GT_Values.RA.stdBuilder().itemInputs(RhFilterCake.get(dust)).noItemOutputs() - .fluidInputs(Materials.Water.getFluid(1000)).fluidOutputs(RHFilterCakeSolution.getFluidOrGas(1000)) - .duration(15 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + GT_Values.RA.stdBuilder().itemInputs(RhFilterCake.get(dust)).fluidInputs(Materials.Water.getFluid(1000)) + .fluidOutputs(RHFilterCakeSolution.getFluidOrGas(1000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(sMixerRecipes); GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(2)).itemOutputs(ReRh.get(dust)) - .fluidInputs(RHFilterCakeSolution.getFluidOrGas(1000)).noFluidOutputs().duration(15 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + .fluidInputs(RHFilterCakeSolution.getFluidOrGas(1000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); GT_Values.RA.stdBuilder().itemInputs(ReRh.get(dust), Materials.Empty.getCells(1)) .itemOutputs(Rhodium.get(dust), Materials.Ammonia.getCells(1)) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java index bc35f0656b..b11eb10d4d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java @@ -41,7 +41,7 @@ public class AddSomeRecipes implements Runnable { WerkstoffLoader.Zirconium.get(dust, 2), GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 8L), GT_OreDictUnificator.get(dust, Materials.Platinum, 1L)) - .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00).noFluidInputs() + .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00) .fluidOutputs(WerkstoffLoader.Xenon.getFluidOrGas(1)).duration(12 * SECONDS + 10 * TICKS) .eut(TierEU.RECIPE_EV).addTo(sCentrifugeRecipes); @@ -53,7 +53,7 @@ public class AddSomeRecipes implements Runnable { WerkstoffLoader.Zirconium.get(dust, 4), GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 18L), GT_OreDictUnificator.get(dust, Materials.Platinum, 2L)) - .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00).noFluidInputs() + .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00) .fluidOutputs(WerkstoffLoader.Xenon.getFluidOrGas(2)).duration(12 * SECONDS + 10 * TICKS) .eut(TierEU.RECIPE_EV).addTo(sCentrifugeRecipes); @@ -65,7 +65,7 @@ public class AddSomeRecipes implements Runnable { WerkstoffLoader.Zirconium.get(dust, 8), GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 38L), GT_OreDictUnificator.get(dust, Materials.Platinum, 4L)) - .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00).noFluidInputs() + .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00) .fluidOutputs(WerkstoffLoader.Xenon.getFluidOrGas(4)).duration(50 * SECONDS).eut(TierEU.RECIPE_EV) .addTo(sCentrifugeRecipes); @@ -77,8 +77,8 @@ public class AddSomeRecipes implements Runnable { GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 48L)) - .outputChances(100_00, 50_00, 50_00, 100_00, 100_00, 100_00).noFluidInputs().noFluidOutputs() - .duration(1 * MINUTES + 40 * SECONDS).eut(TierEU.RECIPE_IV).addTo(sCentrifugeRecipes); + .outputChances(100_00, 50_00, 50_00, 100_00, 100_00, 100_00).duration(1 * MINUTES + 40 * SECONDS) + .eut(TierEU.RECIPE_IV).addTo(sCentrifugeRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index d2a2d06b38..0d3fdc2f58 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -288,8 +288,8 @@ public class AdditionalRecipes { Materials.Thorium.getDust(1), Materials.Thorium.getDust(1), WerkstoffLoader.Thorium232.get(dust)) - .outputChances(7000, 1300, 700, 600, 300, 100).noFluidInputs().noFluidOutputs().duration(20 * SECONDS) - .eut((int) TierEU.RECIPE_IV).addTo(sSifterRecipes); + .outputChances(7000, 1300, 700, 600, 300, 100).duration(20 * SECONDS).eut((int) TierEU.RECIPE_IV) + .addTo(sSifterRecipes); // 3ThO2 + 4Al = 3Th + 2Al2O3 GT_Values.RA.addChemicalRecipe( @@ -331,8 +331,8 @@ public class AdditionalRecipes { 500); GT_Values.RA.stdBuilder().itemInputs(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L)) - .itemOutputs(Materials.Amethyst.getDust(10)).noFluidInputs().noFluidOutputs().duration(40 * SECONDS) - .eut(0).metadata(ADDITIVE_AMOUNT, 6).addTo(sPrimitiveBlastRecipes); + .itemOutputs(Materials.Amethyst.getDust(10)).duration(40 * SECONDS).eut(0).metadata(ADDITIVE_AMOUNT, 6) + .addTo(sPrimitiveBlastRecipes); // Cubic Circonia // 2Y + 3O = Y2O3 @@ -394,13 +394,13 @@ public class AdditionalRecipes { GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.MagnetoResonaticDust.get(dust)) .itemOutputs(WerkstoffLoader.MagnetoResonaticDust.get(gemChipped, 9)).outputChances(90_00) - .fluidInputs(WerkstoffLoader.Neon.getFluidOrGas(1000)).noFluidOutputs() - .duration(3 * MINUTES + 45 * SECONDS).eut(TierEU.RECIPE_IV).addTo(sAutoclaveRecipes); + .fluidInputs(WerkstoffLoader.Neon.getFluidOrGas(1000)).duration(3 * MINUTES + 45 * SECONDS) + .eut(TierEU.RECIPE_IV).addTo(sAutoclaveRecipes); GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.MagnetoResonaticDust.get(dust)) .itemOutputs(WerkstoffLoader.MagnetoResonaticDust.get(gem)) - .fluidInputs(WerkstoffLoader.Krypton.getFluidOrGas(1000)).noFluidOutputs() - .duration(3 * MINUTES + 45 * SECONDS).eut(TierEU.RECIPE_IV).addTo(sAutoclaveRecipes); + .fluidInputs(WerkstoffLoader.Krypton.getFluidOrGas(1000)).duration(3 * MINUTES + 45 * SECONDS) + .eut(TierEU.RECIPE_IV).addTo(sAutoclaveRecipes); // Milk diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java index bf76e81d13..7ba97bf837 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java @@ -36,20 +36,19 @@ public class BlockLoader implements IWerkstoffRunnable { if (!werkstoff.hasItemType(block)) return; if (werkstoff.hasItemType(ingot)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).itemOutputs(werkstoff.get(ingot, 9)) - .noFluidInputs().noFluidOutputs().duration(16 * TICKS).eut(90).addTo(UniversalArcFurnace); + .duration(16 * TICKS).eut(90).addTo(UniversalArcFurnace); } if (werkstoff.hasItemType(cellMolten)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).noItemOutputs().noFluidInputs() - .fluidOutputs(werkstoff.getMolten(1296)).duration(14 * SECONDS + 8 * TICKS).eut(8) - .addTo(sFluidExtractionRecipes); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).fluidOutputs(werkstoff.getMolten(1296)) + .duration(14 * SECONDS + 8 * TICKS).eut(8).addTo(sFluidExtractionRecipes); } if (werkstoff.hasItemType(plate)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).itemOutputs(werkstoff.get(plate, 9)) - .noFluidInputs().noFluidOutputs().duration((int) Math.max(werkstoff.getStats().getMass() * 10L, 1L)) - .eut(TierEU.RECIPE_LV).addTo(sCutterRecipes); + .duration((int) Math.max(werkstoff.getStats().getMass() * 10L, 1L)).eut(TierEU.RECIPE_LV) + .addTo(sCutterRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java index 021d827b69..cb8ce95b4d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java @@ -59,8 +59,8 @@ public class CasingLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder() .itemInputs(werkstoff.get(plate, 6), werkstoff.get(screw, 2), werkstoff.get(gearGtSmall)) - .itemOutputs(werkstoff.get(blockCasing)).noFluidInputs().noFluidOutputs().duration(10 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(sAssemblerRecipes); + .itemOutputs(werkstoff.get(blockCasing)).duration(10 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(sAssemblerRecipes); GT_ModHandler.addCraftingRecipe( werkstoff.get(blockCasingAdvanced), @@ -69,7 +69,7 @@ public class CasingLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder() .itemInputs(werkstoff.get(reboltedCasingsOuterStuff, 6), werkstoff.get(screw, 2), werkstoff.get(gearGt)) - .itemOutputs(werkstoff.get(blockCasingAdvanced)).noFluidInputs().noFluidOutputs().duration(10 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(sAssemblerRecipes); + .itemOutputs(werkstoff.get(blockCasingAdvanced)).duration(10 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(sAssemblerRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java index d6bdecb3e8..1d8f8678a2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java @@ -186,10 +186,9 @@ public class CellLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(Materials.Empty.getCells(1)).itemOutputs(werkstoff.get(cell)) .fluidInputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)) - .noFluidOutputs().duration(16 * TICKS).eut(2).addTo(sFluidCannerRecipes); + .duration(16 * TICKS).eut(2).addTo(sFluidCannerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(cell)).itemOutputs(Materials.Empty.getCells(1)) - .noFluidInputs() .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)) .duration(16 * TICKS).eut(2).addTo(sFluidCannerRecipes); @@ -202,21 +201,20 @@ public class CellLoader implements IWerkstoffRunnable { GT_Utility.addFluidContainerData(emptyData); FluidContainerRegistry.registerFluidContainer(emptyData); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(capsule)).noItemOutputs().noFluidInputs() + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(capsule)) .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)) .duration(16 * TICKS).eut(2).addTo(sFluidCannerRecipes); } if (werkstoff.hasItemType(dust)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust)).noItemOutputs().noFluidInputs() - .fluidOutputs(werkstoff.getFluidOrGas(1000)).duration(werkstoff.getStats().getMass()) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidExtractionRecipes); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust)).fluidOutputs(werkstoff.getFluidOrGas(1000)) + .duration(werkstoff.getStats().getMass()).eut(werkstoff.getStats().getMass() > 128 ? 64 : 30) + .addTo(sFluidExtractionRecipes); GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(1)).itemOutputs(werkstoff.get(dust)) - .fluidInputs(werkstoff.getFluidOrGas(1000)).noFluidOutputs() - .duration((int) werkstoff.getStats().getMass()).eut(werkstoff.getStats().getMass() > 128 ? 64 : 30) - .addTo(sFluidSolidficationRecipes); + .fluidInputs(werkstoff.getFluidOrGas(1000)).duration((int) werkstoff.getStats().getMass()) + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java index cf5bd7f03a..9878a51539 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java @@ -61,22 +61,20 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { .itemInputs( werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(ingot), ItemList.Shape_Extruder_Bolt.get(0L)) - .itemOutputs(werkstoff.get(bolt, 8)).noFluidInputs().noFluidOutputs() + .itemOutputs(werkstoff.get(bolt, 8)) .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1)).eut(8 * tVoltageMultiplier) .addTo(sExtruderRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick)).itemOutputs(werkstoff.get(bolt, 4)) - .noFluidInputs().noFluidOutputs().duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)) - .eut(4).addTo(sCutterRecipes); + .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)).eut(4).addTo(sCutterRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(bolt)).itemOutputs(werkstoff.get(dustTiny, 1)) - .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); // screw - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(bolt)).itemOutputs(werkstoff.get(screw)).noFluidInputs() - .noFluidOutputs().duration((int) Math.max(werkstoff.getStats().getMass() / 8L, 1L)).eut(4) - .addTo(sLatheRecipes); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(bolt)).itemOutputs(werkstoff.get(screw)) + .duration((int) Math.max(werkstoff.getStats().getMass() / 8L, 1L)).eut(4).addTo(sLatheRecipes); GT_ModHandler.addCraftingRecipe( werkstoff.get(screw), @@ -84,14 +82,14 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { new Object[] { "fX", "X ", 'X', werkstoff.get(bolt) }); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(screw)).itemOutputs(werkstoff.get(dustTiny, 1)) - .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); if (werkstoff.hasItemType(gem)) return; // ring GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Ring.get(0L)) - .itemOutputs(werkstoff.get(ring, 4)).noFluidInputs().noFluidOutputs() + .itemOutputs(werkstoff.get(ring, 4)) .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1)).eut(6 * tVoltageMultiplier) .addTo(sExtruderRecipes); @@ -107,23 +105,21 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { new Object[] { "SPS", "PwP", "SPS", 'P', werkstoff.get(plate), 'S', werkstoff.get(stick) }); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 4), ItemList.Shape_Extruder_Gear.get(0L)) - .itemOutputs(werkstoff.get(gearGt)).noFluidInputs().noFluidOutputs() - .duration((int) Math.max(werkstoff.getStats().getMass() * 5L, 1)).eut(8 * tVoltageMultiplier) - .addTo(sExtruderRecipes); + .itemOutputs(werkstoff.get(gearGt)).duration((int) Math.max(werkstoff.getStats().getMass() * 5L, 1)) + .eut(8 * tVoltageMultiplier).addTo(sExtruderRecipes); // wireFine GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Wire.get(0L)) - .itemOutputs(werkstoff.get(wireFine, 8)).noFluidInputs().noFluidOutputs() + .itemOutputs(werkstoff.get(wireFine, 8)) .duration((int) Math.max(werkstoff.getStats().getMass() * 1.5F, 1F)).eut(8 * tVoltageMultiplier) .addTo(sExtruderRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(3)) - .itemOutputs(werkstoff.get(wireFine, 8)).noFluidInputs().noFluidOutputs() - .duration((int) Math.max(werkstoff.getStats().getMass(), 1)).eut(8 * tVoltageMultiplier) - .addTo(sWiremillRecipes); + .itemOutputs(werkstoff.get(wireFine, 8)).duration((int) Math.max(werkstoff.getStats().getMass(), 1)) + .eut(8 * tVoltageMultiplier).addTo(sWiremillRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick), GT_Utility.getIntegratedCircuit(3)) - .itemOutputs(werkstoff.get(wireFine, 4)).noFluidInputs().noFluidOutputs() + .itemOutputs(werkstoff.get(wireFine, 4)) .duration((int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F)).eut(8 * tVoltageMultiplier) .addTo(sWiremillRecipes); @@ -131,9 +127,8 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { if (WerkstoffLoader.smallGearShape != null) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), WerkstoffLoader.smallGearShape.get(0L)) - .itemOutputs(werkstoff.get(gearGtSmall)).noFluidInputs().noFluidOutputs() - .duration((int) werkstoff.getStats().getMass()).eut(8 * tVoltageMultiplier) - .addTo(sExtruderRecipes); + .itemOutputs(werkstoff.get(gearGtSmall)).duration((int) werkstoff.getStats().getMass()) + .eut(8 * tVoltageMultiplier).addTo(sExtruderRecipes); } @@ -150,22 +145,21 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { werkstoff.get(screw) }); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate, 4), werkstoff.get(ring)) - .itemOutputs(werkstoff.get(rotor)).fluidInputs(Materials.Tin.getMolten(32)).noFluidOutputs() - .duration(12 * SECONDS).eut(24).addTo(sAssemblerRecipes); + .itemOutputs(werkstoff.get(rotor)).fluidInputs(Materials.Tin.getMolten(32)).duration(12 * SECONDS) + .eut(24).addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate, 4), werkstoff.get(ring)) - .itemOutputs(werkstoff.get(rotor)).fluidInputs(Materials.Lead.getMolten(48)).noFluidOutputs() - .duration(12 * SECONDS).eut(24).addTo(sAssemblerRecipes); + .itemOutputs(werkstoff.get(rotor)).fluidInputs(Materials.Lead.getMolten(48)).duration(12 * SECONDS) + .eut(24).addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate, 4), werkstoff.get(ring)) .itemOutputs(werkstoff.get(rotor)).fluidInputs(Materials.SolderingAlloy.getMolten(16)) - .noFluidOutputs().duration(12 * SECONDS).eut(24).addTo(sAssemblerRecipes); + .duration(12 * SECONDS).eut(24).addTo(sAssemblerRecipes); if (WerkstoffLoader.rotorShape != null) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 5), WerkstoffLoader.rotorShape.get(0L)) - .itemOutputs(werkstoff.get(rotor)).noFluidInputs().noFluidOutputs().duration(10 * SECONDS) - .eut(60).addTo(sExtruderRecipes); + .itemOutputs(werkstoff.get(rotor)).duration(10 * SECONDS).eut(60).addTo(sExtruderRecipes); } @@ -187,17 +181,17 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { } GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gearGt)).itemOutputs(werkstoff.get(dust, 4)) - .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gearGtSmall)).itemOutputs(werkstoff.get(dust, 1)) - .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(rotor)) - .itemOutputs(werkstoff.get(dust, 4), werkstoff.get(dustSmall)).noFluidInputs().noFluidOutputs() - .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .itemOutputs(werkstoff.get(dust, 4), werkstoff.get(dustSmall)).duration(2 * TICKS).eut(8) + .addTo(sMaceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ring)).itemOutputs(werkstoff.get(dustSmall, 1)) - .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java index b1926f570d..4909461018 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java @@ -75,7 +75,7 @@ public class CrushedLoader implements IWerkstoffRunnable { new Object[] { "h ", "W ", 'W', werkstoff.get(crushedCentrifuged) }); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushed)).itemOutputs(werkstoff.get(dustImpure)) - .noFluidInputs().noFluidOutputs().duration(10 * TICKS).eut(16).addTo(sHammerRecipes); + .duration(10 * TICKS).eut(16).addTo(sHammerRecipes); GT_ModHandler.addPulverisationRecipe( werkstoff.get(crushed), @@ -99,7 +99,7 @@ public class CrushedLoader implements IWerkstoffRunnable { GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushedPurified)).itemOutputs(werkstoff.get(dustPure)) - .noFluidInputs().noFluidOutputs().duration(10 * TICKS).eut(16).addTo(sHammerRecipes); + .duration(10 * TICKS).eut(16).addTo(sHammerRecipes); GT_ModHandler.addPulverisationRecipe( werkstoff.get(crushedPurified), @@ -115,7 +115,7 @@ public class CrushedLoader implements IWerkstoffRunnable { werkstoff.getOreByProduct(1, dust)); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushedCentrifuged)).itemOutputs(werkstoff.get(dust)) - .noFluidInputs().noFluidOutputs().duration(10 * TICKS).eut(16).addTo(sHammerRecipes); + .duration(10 * TICKS).eut(16).addTo(sHammerRecipes); GT_ModHandler.addPulverisationRecipe( werkstoff.get(crushedCentrifuged), @@ -126,31 +126,29 @@ public class CrushedLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustImpure)) .itemOutputs(werkstoff.get(dust), werkstoff.getOreByProduct(0, dust)).outputChances(100_00, 11_11) - .noFluidInputs().noFluidOutputs().duration(Math.max(1L, werkstoff.getStats().getMass() * 8L)).eut(5) - .addTo(sCentrifugeRecipes); + .duration(Math.max(1L, werkstoff.getStats().getMass() * 8L)).eut(5).addTo(sCentrifugeRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)) .itemOutputs(werkstoff.get(dust), werkstoff.getOreByProduct(1, dust)).outputChances(100_00, 11_11) - .noFluidInputs().noFluidOutputs().duration(Math.max(1L, werkstoff.getStats().getMass() * 8L)).eut(5) - .addTo(sCentrifugeRecipes); + .duration(Math.max(1L, werkstoff.getStats().getMass() * 8L)).eut(5).addTo(sCentrifugeRecipes); if (werkstoff.contains(SubTag.CRYSTALLISABLE)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)).itemOutputs(werkstoff.get(gem)) - .outputChances(9000).fluidInputs(Materials.Water.getFluid(200L)).noFluidOutputs() + .outputChances(9000).fluidInputs(Materials.Water.getFluid(200L)) .duration(1 * MINUTES + 40 * SECONDS).eut(24).addTo(sAutoclaveRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustImpure)).itemOutputs(werkstoff.get(gem)) - .outputChances(9000).fluidInputs(Materials.Water.getFluid(200L)).noFluidOutputs() + .outputChances(9000).fluidInputs(Materials.Water.getFluid(200L)) .duration(1 * MINUTES + 40 * SECONDS).eut(24).addTo(sAutoclaveRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)).itemOutputs(werkstoff.get(gem)) .outputChances(9500).fluidInputs(gregtech.api.util.GT_ModHandler.getDistilledWater(200L)) - .noFluidOutputs().duration(1 * MINUTES + 15 * SECONDS).eut(24).addTo(sAutoclaveRecipes); + .duration(1 * MINUTES + 15 * SECONDS).eut(24).addTo(sAutoclaveRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustImpure)).itemOutputs(werkstoff.get(gem)) .outputChances(9500).fluidInputs(gregtech.api.util.GT_ModHandler.getDistilledWater(200L)) - .noFluidOutputs().duration(1 * MINUTES + 15 * SECONDS).eut(24).addTo(sAutoclaveRecipes); + .duration(1 * MINUTES + 15 * SECONDS).eut(24).addTo(sAutoclaveRecipes); } if (werkstoff.contains(SubTag.WASHING_MERCURY)) { @@ -160,7 +158,7 @@ public class CrushedLoader implements IWerkstoffRunnable { werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)) - .outputChances(10000, 7000, 4000).fluidInputs(Materials.Mercury.getFluid(1000L)).noFluidOutputs() + .outputChances(10000, 7000, 4000).fluidInputs(Materials.Mercury.getFluid(1000L)) .duration(40 * SECONDS).eut(8).addTo(sChemicalBathRecipes); } @@ -175,7 +173,7 @@ public class CrushedLoader implements IWerkstoffRunnable { .fluidInputs( Materials.SodiumPersulfate .getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L)) - .noFluidOutputs().duration(40 * SECONDS).eut(8).addTo(sChemicalBathRecipes); + .duration(40 * SECONDS).eut(8).addTo(sChemicalBathRecipes); } if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_GOLD)) { @@ -185,7 +183,7 @@ public class CrushedLoader implements IWerkstoffRunnable { werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Gold, 1L), GT_OreDictUnificator.get(nugget, Materials.Gold, 1L)) - .outputChances(10000, 4000, 2000).noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(24) + .outputChances(10000, 4000, 2000).duration(20 * SECONDS).eut(24) .addTo(sElectroMagneticSeparatorRecipes); } else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_IRON)) { @@ -195,7 +193,7 @@ public class CrushedLoader implements IWerkstoffRunnable { werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Iron, 1L), GT_OreDictUnificator.get(nugget, Materials.Iron, 1L)) - .outputChances(10000, 4000, 2000).noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(24) + .outputChances(10000, 4000, 2000).duration(20 * SECONDS).eut(24) .addTo(sElectroMagneticSeparatorRecipes); } else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM)) { @@ -205,7 +203,7 @@ public class CrushedLoader implements IWerkstoffRunnable { werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Neodymium, 1L), GT_OreDictUnificator.get(nugget, Materials.Neodymium, 1L)) - .outputChances(10000, 4000, 2000).noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(24) + .outputChances(10000, 4000, 2000).duration(20 * SECONDS).eut(24) .addTo(sElectroMagneticSeparatorRecipes); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java index 3eb4e90285..48d37851e4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java @@ -316,20 +316,16 @@ public class DustLoader implements IWerkstoffRunnable { new Object[] { "T ", 'T', werkstoff.get(dust) }); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustTiny, 9), ItemList.Schematic_Dust.get(0L)) - .itemOutputs(werkstoff.get(dust)).noFluidInputs().noFluidOutputs().duration(5 * SECONDS).eut(4) - .addTo(sBoxinatorRecipes); + .itemOutputs(werkstoff.get(dust)).duration(5 * SECONDS).eut(4).addTo(sBoxinatorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustSmall, 4), ItemList.Schematic_Dust.get(0L)) - .itemOutputs(werkstoff.get(dust)).noFluidInputs().noFluidOutputs().duration(5 * SECONDS).eut(4) - .addTo(sBoxinatorRecipes); + .itemOutputs(werkstoff.get(dust)).duration(5 * SECONDS).eut(4).addTo(sBoxinatorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustTiny, 9), ItemList.Schematic_3by3.get(0L)) - .itemOutputs(werkstoff.get(dust)).noFluidInputs().noFluidOutputs().duration(5 * SECONDS).eut(4) - .addTo(sBoxinatorRecipes); + .itemOutputs(werkstoff.get(dust)).duration(5 * SECONDS).eut(4).addTo(sBoxinatorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustSmall, 4), ItemList.Schematic_2by2.get(0L)) - .itemOutputs(werkstoff.get(dust)).noFluidInputs().noFluidOutputs().duration(5 * SECONDS).eut(4) - .addTo(sBoxinatorRecipes); + .itemOutputs(werkstoff.get(dust)).duration(5 * SECONDS).eut(4).addTo(sBoxinatorRecipes); if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) { GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); @@ -342,7 +338,7 @@ public class DustLoader implements IWerkstoffRunnable { .itemOutputs( werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot)) - .fluidInputs(Materials.Nitrogen.getGas(1000)).noFluidOutputs() + .fluidInputs(Materials.Nitrogen.getGas(1000)) .duration( Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint()) @@ -355,7 +351,7 @@ public class DustLoader implements IWerkstoffRunnable { .itemOutputs( werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot)) - .fluidInputs(Materials.Argon.getGas(1000)).noFluidOutputs() + .fluidInputs(Materials.Argon.getGas(1000)) .duration( Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint()) @@ -368,7 +364,6 @@ public class DustLoader implements IWerkstoffRunnable { .itemOutputs( werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot)) - .noFluidInputs().noFluidOutputs() .duration( Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint()) @@ -377,7 +372,7 @@ public class DustLoader implements IWerkstoffRunnable { if (werkstoff.getStats().getMeltingPoint() <= 1000) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust)) - .itemOutputs(werkstoff.get(ingot)).noFluidInputs().noFluidOutputs() + .itemOutputs(werkstoff.get(ingot)) .duration( (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint()) @@ -388,7 +383,6 @@ public class DustLoader implements IWerkstoffRunnable { if (werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().getMeltingPoint() > 1750) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingotHot)).itemOutputs(werkstoff.get(ingot)) - .noFluidInputs().noFluidOutputs() .duration((int) Math.max(werkstoff.getStats().getMass() * 3L, 1L)).eut(TierEU.RECIPE_MV) .addTo(sVacuumRecipes); } @@ -396,16 +390,16 @@ public class DustLoader implements IWerkstoffRunnable { if (werkstoff.hasItemType(ingot)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)).itemOutputs(werkstoff.get(dust)) - .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(nugget)).itemOutputs(werkstoff.get(dustTiny)) - .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); } if (werkstoff.hasItemType(ingot) || werkstoff.hasItemType(gem)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).itemOutputs(werkstoff.get(dust, 9)) - .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java index 1f9122c538..912452d490 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java @@ -64,10 +64,10 @@ public class GemLoader implements IWerkstoffRunnable { || (werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust))) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem, 9)).itemOutputs(werkstoff.get(block)) - .noFluidInputs().noFluidOutputs().duration(15 * SECONDS).eut(2).addTo(sCompressorRecipes); + .duration(15 * SECONDS).eut(2).addTo(sCompressorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).itemOutputs(werkstoff.get(gem, 9)) - .noFluidInputs().noFluidOutputs().duration(5 * SECONDS).eut(24).addTo(sHammerRecipes); + .duration(5 * SECONDS).eut(24).addTo(sHammerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushedPurified)) .itemOutputs( @@ -77,25 +77,25 @@ public class GemLoader implements IWerkstoffRunnable { werkstoff.get(gemFlawed), werkstoff.get(gemChipped), werkstoff.get(dust)) - .outputChances(200, 1000, 2500, 2000, 4000, 5000).noFluidInputs().noFluidOutputs() - .duration(40 * SECONDS).eut(16).addTo(sSifterRecipes); + .outputChances(200, 1000, 2500, 2000, 4000, 5000).duration(40 * SECONDS).eut(16) + .addTo(sSifterRecipes); } GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemExquisite)).itemOutputs(werkstoff.get(dust, 4)) - .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawless)).itemOutputs(werkstoff.get(dust, 2)) - .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem)).itemOutputs(werkstoff.get(dust)).noFluidInputs() - .noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem)).itemOutputs(werkstoff.get(dust)) + .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawed)).itemOutputs(werkstoff.get(dustSmall, 2)) - .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemChipped)).itemOutputs(werkstoff.get(dustSmall)) - .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); GT_ModHandler.addCraftingRecipe( werkstoff.get(gemFlawless, 2), @@ -115,62 +115,62 @@ public class GemLoader implements IWerkstoffRunnable { new Object[] { "h ", "W ", 'W', werkstoff.get(gemFlawed) }); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemExquisite)).itemOutputs(werkstoff.get(gemFlawless, 2)) - .noFluidInputs().noFluidOutputs().duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); + .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawless)).itemOutputs(werkstoff.get(gem, 2)) - .noFluidInputs().noFluidOutputs().duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); + .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem)).itemOutputs(werkstoff.get(gemFlawed, 2)) - .noFluidInputs().noFluidOutputs().duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); + .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawed)).itemOutputs(werkstoff.get(gemChipped, 2)) - .noFluidInputs().noFluidOutputs().duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); + .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemChipped)).itemOutputs(werkstoff.get(dustTiny)) - .noFluidInputs().noFluidOutputs().duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); + .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); if (!werkstoff.contains(WerkstoffLoader.NO_BLAST)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawless, 3)) .itemOutputs( werkstoff.get(gemExquisite), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) - .noFluidInputs().noFluidOutputs().duration(20 * TICKS).eut(TierEU.RECIPE_LV) - .metadata(ADDITIVE_AMOUNT, 8).addTo(sImplosionRecipes); + .duration(20 * TICKS).eut(TierEU.RECIPE_LV).metadata(ADDITIVE_AMOUNT, 8) + .addTo(sImplosionRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem, 3)) .itemOutputs( werkstoff.get(gemFlawless), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) - .noFluidInputs().noFluidOutputs().duration(20 * TICKS).eut(TierEU.RECIPE_LV) - .metadata(ADDITIVE_AMOUNT, 8).addTo(sImplosionRecipes); + .duration(20 * TICKS).eut(TierEU.RECIPE_LV).metadata(ADDITIVE_AMOUNT, 8) + .addTo(sImplosionRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawed, 3)) .itemOutputs(werkstoff.get(gem), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) - .noFluidInputs().noFluidOutputs().duration(20 * TICKS).eut(TierEU.RECIPE_LV) - .metadata(ADDITIVE_AMOUNT, 8).addTo(sImplosionRecipes); + .duration(20 * TICKS).eut(TierEU.RECIPE_LV).metadata(ADDITIVE_AMOUNT, 8) + .addTo(sImplosionRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemChipped, 3)) .itemOutputs(werkstoff.get(gemFlawed), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) - .noFluidInputs().noFluidOutputs().duration(20 * TICKS).eut(TierEU.RECIPE_LV) - .metadata(ADDITIVE_AMOUNT, 8).addTo(sImplosionRecipes); + .duration(20 * TICKS).eut(TierEU.RECIPE_LV).metadata(ADDITIVE_AMOUNT, 8) + .addTo(sImplosionRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust, 4)) .itemOutputs(werkstoff.get(gem, 3), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)) - .noFluidInputs().noFluidOutputs().duration(20 * TICKS).eut(TierEU.RECIPE_LV) - .metadata(ADDITIVE_AMOUNT, 24).addTo(sImplosionRecipes); + .duration(20 * TICKS).eut(TierEU.RECIPE_LV).metadata(ADDITIVE_AMOUNT, 24) + .addTo(sImplosionRecipes); } if (werkstoff.hasItemType(plate)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)) - .itemOutputs(werkstoff.get(lens), werkstoff.get(dustSmall)).noFluidInputs().noFluidOutputs() - .duration(60 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sLatheRecipes); + .itemOutputs(werkstoff.get(lens), werkstoff.get(dustSmall)).duration(60 * SECONDS) + .eut(TierEU.RECIPE_MV).addTo(sLatheRecipes); } GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemExquisite)) - .itemOutputs(werkstoff.get(lens), werkstoff.get(dust, 2)).noFluidInputs().noFluidOutputs() - .duration(2 * MINUTES).eut(TierEU.RECIPE_LV).addTo(sLatheRecipes); + .itemOutputs(werkstoff.get(lens), werkstoff.get(dust, 2)).duration(2 * MINUTES) + .eut(TierEU.RECIPE_LV).addTo(sLatheRecipes); GregTech_API.registerCover( werkstoff.get(lens), @@ -180,27 +180,26 @@ public class GemLoader implements IWerkstoffRunnable { new gregtech.common.covers.GT_Cover_Lens(BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex)); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(lens)).itemOutputs(werkstoff.get(dustSmall, 3)) - .noFluidInputs().noFluidOutputs().duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); for (ItemStack is : OreDictionary.getOres( "craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) { is.stackSize = 0; GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemChipped, 3), is) - .itemOutputs(werkstoff.get(gemFlawed, 1)).noFluidInputs().noFluidOutputs() - .duration(30 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sLaserEngraverRecipes); + .itemOutputs(werkstoff.get(gemFlawed, 1)).duration(30 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(sLaserEngraverRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawed, 3), is).itemOutputs(werkstoff.get(gem, 1)) - .noFluidInputs().noFluidOutputs().duration(30 * SECONDS).eut(TierEU.RECIPE_MV) - .addTo(sLaserEngraverRecipes); + .duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sLaserEngraverRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem, 3), is) - .itemOutputs(werkstoff.get(gemFlawless, 1)).noFluidInputs().noFluidOutputs() - .duration(60 * SECONDS).eut(TierEU.RECIPE_HV).addTo(sLaserEngraverRecipes); + .itemOutputs(werkstoff.get(gemFlawless, 1)).duration(60 * SECONDS).eut(TierEU.RECIPE_HV) + .addTo(sLaserEngraverRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawless, 3), is) - .itemOutputs(werkstoff.get(gemExquisite, 1)).noFluidInputs().noFluidOutputs() - .duration(2 * MINUTES).eut(2000).addTo(sLaserEngraverRecipes); + .itemOutputs(werkstoff.get(gemExquisite, 1)).duration(2 * MINUTES).eut(2000) + .addTo(sLaserEngraverRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java index 0c0a16aa90..dd64c84241 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java @@ -31,11 +31,10 @@ public class MetalLoader implements IWerkstoffRunnable { public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(ingot)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 9)).itemOutputs(werkstoff.get(block)) - .noFluidInputs().noFluidOutputs().duration(15 * SECONDS).eut(2).addTo(sCompressorRecipes); + .duration(15 * SECONDS).eut(2).addTo(sCompressorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 9), ItemList.Shape_Extruder_Block.get(0)) - .itemOutputs(werkstoff.get(block)).noFluidInputs().noFluidOutputs() - .duration((int) werkstoff.getStats().getMass()) + .itemOutputs(werkstoff.get(block)).duration((int) werkstoff.getStats().getMass()) .eut(8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15).addTo(sExtruderRecipes); GT_Values.RA.addAlloySmelterRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java index 29e7cadc12..4fb6adc378 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -66,54 +66,47 @@ public class MoltenCellLoader implements IWerkstoffRunnable { return; } - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust)).noItemOutputs().noFluidInputs() - .fluidOutputs(werkstoff.getMolten(144)).duration(15 * SECONDS).eut(2) - .addTo(sFluidExtractionRecipes); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust)).fluidOutputs(werkstoff.getMolten(144)) + .duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustSmall)).noItemOutputs().noFluidInputs() - .fluidOutputs(werkstoff.getMolten(36)).duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustSmall)).fluidOutputs(werkstoff.getMolten(36)) + .duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustTiny)).noItemOutputs().noFluidInputs() - .fluidOutputs(werkstoff.getMolten(16)).duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustTiny)).fluidOutputs(werkstoff.getMolten(16)) + .duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); } else { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)).noItemOutputs().noFluidInputs() - .fluidOutputs(werkstoff.getMolten(144)).duration(15 * SECONDS).eut(2) - .addTo(sFluidExtractionRecipes); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)).fluidOutputs(werkstoff.getMolten(144)) + .duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(nugget)).noItemOutputs().noFluidInputs() - .fluidOutputs(werkstoff.getMolten(16)).duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(nugget)).fluidOutputs(werkstoff.getMolten(16)) + .duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Ingot.get(0)).itemOutputs(werkstoff.get(ingot)) - .fluidInputs(werkstoff.getMolten(144)).noFluidOutputs() - .duration((int) werkstoff.getStats().getMass()).eut(werkstoff.getStats().getMass() > 128 ? 64 : 30) - .addTo(sFluidSolidficationRecipes); + .fluidInputs(werkstoff.getMolten(144)).duration((int) werkstoff.getStats().getMass()) + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Nugget.get(0)).itemOutputs(werkstoff.get(nugget)) - .fluidInputs(werkstoff.getMolten(16)).noFluidOutputs() - .duration((int) ((double) werkstoff.getStats().getMass() / 9D)) + .fluidInputs(werkstoff.getMolten(16)).duration((int) ((double) werkstoff.getStats().getMass() / 9D)) .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Block.get(0)).itemOutputs(werkstoff.get(block)) - .fluidInputs(werkstoff.getMolten(1296)).noFluidOutputs() - .duration((int) werkstoff.getStats().getMass() * 9) + .fluidInputs(werkstoff.getMolten(1296)).duration((int) werkstoff.getStats().getMass() * 9) .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); if (!werkstoff.hasItemType(plate)) { return; } - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stickLong)).noItemOutputs().noFluidInputs() - .fluidOutputs(werkstoff.getMolten(144)).duration(15 * SECONDS).eut(2) - .addTo(sFluidExtractionRecipes); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stickLong)).fluidOutputs(werkstoff.getMolten(144)) + .duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)).noItemOutputs().noFluidInputs() - .fluidOutputs(werkstoff.getMolten(144)).duration(15 * SECONDS).eut(2) - .addTo(sFluidExtractionRecipes); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)).fluidOutputs(werkstoff.getMolten(144)) + .duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick)).noItemOutputs().noFluidInputs() - .fluidOutputs(werkstoff.getMolten(72)).duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick)).fluidOutputs(werkstoff.getMolten(72)) + .duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); } @@ -124,18 +117,17 @@ public class MoltenCellLoader implements IWerkstoffRunnable { } GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Rod_Long.get(0)) - .itemOutputs(werkstoff.get(stickLong)).fluidInputs(werkstoff.getMolten(144)).noFluidOutputs() + .itemOutputs(werkstoff.get(stickLong)).fluidInputs(werkstoff.getMolten(144)) .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Rod.get(0)).itemOutputs(werkstoff.get(stick)) - .fluidInputs(werkstoff.getMolten(72)).noFluidOutputs() + .fluidInputs(werkstoff.getMolten(72)) .duration((int) Math.max(werkstoff.getStats().getMass() / 2, 1L)) .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Plate.get(0)).itemOutputs(werkstoff.get(plate)) - .fluidInputs(werkstoff.getMolten(144)).noFluidOutputs() - .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) + .fluidInputs(werkstoff.getMolten(144)).duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); } @@ -146,27 +138,27 @@ public class MoltenCellLoader implements IWerkstoffRunnable { } GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Screw.get(0)).itemOutputs(werkstoff.get(screw)) - .fluidInputs(werkstoff.getMolten(18)).noFluidOutputs() + .fluidInputs(werkstoff.getMolten(18)) .duration((int) Math.max(werkstoff.getStats().getMass() / 8, 1L)) .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Gear.get(0)).itemOutputs(werkstoff.get(gearGt)) - .fluidInputs(werkstoff.getMolten(576)).noFluidOutputs() + .fluidInputs(werkstoff.getMolten(576)) .duration((int) Math.max(werkstoff.getStats().getMass() / 4, 1L)) .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Gear_Small.get(0)) - .itemOutputs(werkstoff.get(gearGtSmall)).fluidInputs(werkstoff.getMolten(144)).noFluidOutputs() + .itemOutputs(werkstoff.get(gearGtSmall)).fluidInputs(werkstoff.getMolten(144)) .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Bolt.get(0)).itemOutputs(werkstoff.get(bolt)) - .fluidInputs(werkstoff.getMolten(18)).noFluidOutputs() + .fluidInputs(werkstoff.getMolten(18)) .duration((int) Math.max(werkstoff.getStats().getMass() / 8, 1L)) .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Ring.get(0)).itemOutputs(werkstoff.get(ring)) - .fluidInputs(werkstoff.getMolten(36)).noFluidOutputs() + .fluidInputs(werkstoff.getMolten(36)) .duration((int) Math.max(werkstoff.getStats().getMass() / 4, 1L)) .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); @@ -177,7 +169,7 @@ public class MoltenCellLoader implements IWerkstoffRunnable { } GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Rotor.get(0)).itemOutputs(werkstoff.get(rotor)) - .fluidInputs(werkstoff.getMolten(612)).noFluidOutputs() + .fluidInputs(werkstoff.getMolten(612)) .duration((int) Math.max(werkstoff.getStats().getMass() * 4.25, 1L)) .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); @@ -203,10 +195,9 @@ public class MoltenCellLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(Materials.Empty.getCells(1)).itemOutputs(werkstoff.get(cellMolten)) .fluidInputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)) - .noFluidOutputs().duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); + .duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(cellMolten)).itemOutputs(Materials.Empty.getCells(1)) - .noFluidInputs() .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)) .duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); @@ -222,7 +213,7 @@ public class MoltenCellLoader implements IWerkstoffRunnable { GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1)); GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(capsuleMolten)).noItemOutputs().noFluidInputs() + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(capsuleMolten)) .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)) .duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java index 36b6e1e7d7..65d9c2be4d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java @@ -55,7 +55,7 @@ public class MultipleMetalLoader implements IWerkstoffRunnable { null); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plateDouble)).itemOutputs(werkstoff.get(dust, 2)) - .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java index 725d4b6319..839afe401d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java @@ -42,7 +42,7 @@ public class OreLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ore)) .itemOutputs(werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(crushed)) - .noFluidInputs().noFluidOutputs().duration(16 * TICKS).eut(10).addTo(sHammerRecipes); + .duration(16 * TICKS).eut(10).addTo(sHammerRecipes); GT_ModHandler.addPulverisationRecipe( werkstoff.get(ore), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java index f2a6fd9983..7f78d91f79 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java @@ -55,7 +55,7 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { if (werkstoff.hasItemType(gem)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem)) - .itemOutputs(werkstoff.get(stick), werkstoff.get(dustSmall, 2)).noFluidInputs().noFluidOutputs() + .itemOutputs(werkstoff.get(stick), werkstoff.get(dustSmall, 2)) .duration((int) Math.max(werkstoff.getStats().getMass() * 5L, 1L)).eut(16).addTo(sLatheRecipes); GT_ModHandler.addCraftingRecipe( @@ -68,8 +68,7 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { new Object[] { "f ", " X", 'X', werkstoff.get(gem) }); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick, 2)).itemOutputs(werkstoff.get(stickLong)) - .noFluidInputs().noFluidOutputs().duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) - .eut(16).addTo(sHammerRecipes); + .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)).eut(16).addTo(sHammerRecipes); TextureSet texSet = werkstoff.getTexSet(); ITexture texture = SideReference.Side.Client @@ -82,7 +81,7 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { GregTech_API.registerCover(werkstoff.get(plate), texture, null); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)).itemOutputs(werkstoff.get(dust)) - .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); return; } @@ -118,8 +117,7 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { 0)); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 3)).itemOutputs(werkstoff.get(plate, 2)) - .noFluidInputs().noFluidOutputs().duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) - .eut(16).addTo(sHammerRecipes); + .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)).eut(16).addTo(sHammerRecipes); GregTech_API.registerCover( werkstoff.get(plate), @@ -127,40 +125,39 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { null); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)) - .itemOutputs(werkstoff.get(stick), werkstoff.get(dustSmall, 2)).noFluidInputs().noFluidOutputs() + .itemOutputs(werkstoff.get(stick), werkstoff.get(dustSmall, 2)) .duration((int) Math.max(werkstoff.getStats().getMass() * 5L, 1L)).eut(16).addTo(sLatheRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(werkstoff.get(foil, 4)).noFluidInputs().noFluidOutputs() + .itemOutputs(werkstoff.get(foil, 4)) .duration((int) Math.max(werkstoff.getStats().getMass() * 1L, 1L)).eut(24).addTo(sBenderRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(10)) - .itemOutputs(werkstoff.get(foil, 4)).noFluidInputs().noFluidOutputs() + .itemOutputs(werkstoff.get(foil, 4)) .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)).eut(24).addTo(sBenderRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick, 2)).itemOutputs(werkstoff.get(stickLong)) - .noFluidInputs().noFluidOutputs().duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) - .eut(16).addTo(sHammerRecipes); + .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)).eut(16).addTo(sHammerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Plate.get(0)) - .itemOutputs(werkstoff.get(plate)).noFluidInputs().noFluidOutputs() - .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)).eut(45).addTo(sExtruderRecipes); + .itemOutputs(werkstoff.get(plate)).duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)) + .eut(45).addTo(sExtruderRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Rod.get(0)) - .itemOutputs(werkstoff.get(stick, 2)).noFluidInputs().noFluidOutputs() + .itemOutputs(werkstoff.get(stick, 2)) .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)).eut(45).addTo(sExtruderRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)).itemOutputs(werkstoff.get(dust)).noFluidInputs() - .noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)).itemOutputs(werkstoff.get(dust)) + .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)).itemOutputs(werkstoff.get(dust)).noFluidInputs() - .noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)).itemOutputs(werkstoff.get(dust)) + .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stickLong)).itemOutputs(werkstoff.get(dust)) - .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick)).itemOutputs(werkstoff.get(dustSmall, 2)) - .noFluidInputs().noFluidOutputs().duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java index e92c7ee63b..43b72c18ee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java @@ -433,17 +433,16 @@ public class ToolLoader implements IWerkstoffRunnable { screw.get(werkstoff.getBridgeMaterial()) }); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 6), ItemList.Shape_Extruder_Turbine_Blade.get(0)) - .itemOutputs(werkstoff.get(turbineBlade, 1)).noFluidInputs().noFluidOutputs() - .duration((int) werkstoff.getStats().getMass() / 2 * 20).eut(TierEU.RECIPE_MV) - .addTo(sExtruderRecipes); + .itemOutputs(werkstoff.get(turbineBlade, 1)).duration((int) werkstoff.getStats().getMass() / 2 * 20) + .eut(TierEU.RECIPE_MV).addTo(sExtruderRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Turbine_Blade.get(0)) - .itemOutputs(werkstoff.get(turbineBlade, 1)).fluidInputs(werkstoff.getMolten(864)).noFluidOutputs() + .itemOutputs(werkstoff.get(turbineBlade, 1)).fluidInputs(werkstoff.getMolten(864)) .duration((int) werkstoff.getStats().getMass() * 20).eut(TierEU.RECIPE_MV) .addTo(sFluidSolidficationRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plateDouble, 3), werkstoff.get(screw, 2)) - .itemOutputs(werkstoff.get(turbineBlade, 1)).noFluidInputs().noFluidOutputs() + .itemOutputs(werkstoff.get(turbineBlade, 1)) .duration((werkstoff.getStats().getMass() / 4) * SECONDS).eut(TierEU.RECIPE_LV) .addTo(sPressRecipes); @@ -458,7 +457,7 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), Materials.Magnalium, null)) - .noFluidInputs().noFluidOutputs().duration(8 * SECONDS).eut(100).addTo(sAssemblerRecipes); + .duration(8 * SECONDS).eut(100).addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -471,7 +470,7 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), Materials.Titanium, null)) - .noFluidInputs().noFluidOutputs().duration(16 * SECONDS).eut(400).addTo(sAssemblerRecipes); + .duration(16 * SECONDS).eut(400).addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -484,7 +483,7 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), Materials.TungstenSteel, null)) - .noFluidInputs().noFluidOutputs().duration(32 * SECONDS).eut(1600).addTo(sAssemblerRecipes); + .duration(32 * SECONDS).eut(1600).addTo(sAssemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -497,8 +496,7 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), Materials.Americium, null)) - .noFluidInputs().noFluidOutputs().duration(1 * MINUTES + 4 * SECONDS).eut(6400) - .addTo(sAssemblerRecipes); + .duration(1 * MINUTES + 4 * SECONDS).eut(6400).addTo(sAssemblerRecipes); } if (!werkstoff.hasItemType(gem)) { -- cgit From dc756ba0c56c754513ec5eecfb6aef51bc8e2ee6 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Fri, 22 Sep 2023 19:12:18 +0200 Subject: update deps Former-commit-id: 767c7c223fc2ed4bffbcecf8fc3f012ef9df4097 --- dependencies.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 0a4a966fd4..13d6112f9b 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,14 +2,14 @@ dependencies { api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.19:dev') - api("com.github.GTNewHorizons:TecTech:5.3.1:dev") + api("com.github.GTNewHorizons:TecTech:5.3.3:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } api("com.github.GTNewHorizons:Avaritia:1.46:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.10.1-GTNH:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.10.3-GTNH:dev") compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.24-pre:dev") {transitive = false} - compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.15-GTNH:api") {transitive = false} + compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.17-GTNH:api") {transitive = false} } -- cgit From 5b5a1a8234e419ade32a0bcd31898267a84508e9 Mon Sep 17 00:00:00 2001 From: glowredman <35727266+glowredman@users.noreply.github.com> Date: Sat, 23 Sep 2023 13:06:01 +0200 Subject: Cleanup (#354) * Fix most `@SuppressWarnings` * Update buildscript * Remove dead code * Add missing `@Override` annotations * Deobfuscate parameters * Collapse switch statements * Fix * Combine nested if statements in else block to else if * Reduce indentation when possible * Convert to switch when reasonable * Extract increment/decrement from statement * Pull up assignment * Simplify lambda expression and method reference syntax * Deduplicate code - Factorize operands - Replace (X && Y) || (!X && Z) by X ? Y : Z - Use '==' or '^' on booleans - Merge conditions of if/else if/else that have the same blocks - Pull down common code from if/else statement - Single 'if' statement rather than duplicate blocks that fall through - Remove redundant end of block with jump statement - Remove redundant if condition - Pull out a duplicate 'if' from an if/else * Use pattern matching for instanceof * Convert String concatenation to Text Block * Convert to switch expression where possible * Use diamond operator * Convert to enhanced 'for' loops * Always use 'this' qualifier * Convert fields into local variables if the use is only local * Use String.replace() instead of String.replaceAll() when possible * Avoid Object.equals() or String.equalsIgnoreCase() on null objects * Remove unnecessary casts * Push down negation * Remove redundant super() call in constructor * Remove overridden assignment * Remove redundant modifiers * Raise embedded if into parent if * Create array with curly brrackets when possible * Remove variable assignment before return * Remove unnecessary parentheses * spotlessApply (#355) Co-authored-by: GitHub GTNH Actions <> * Update dependencies.gradle * Update dependencies.gradle * Update dependencies.gradle * sa+deps * add back GG mod in dep file * Make requested changes --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Martin Robertz Former-commit-id: 11b283613ab93b60bf0e52aad99dbcaf9ace3a1f --- addon.gradle | 3 - dependencies.gradle | 1 - gradle.properties | 89 ++- .../bartworks/API/BioObjectAdder.java | 25 +- .../bartworks/API/BioObjectGetter.java | 1 - .../bartworks/API/BioRecipeAdder.java | 2 +- .../bartworks/API/BioVatLogicAdder.java | 1 - .../API/ITileHasDifferentTextureSides.java | 2 +- .../github/bartimaeusnek/bartworks/ASM/BWCore.java | 1 - .../ASM/BWCoreStaticReplacementMethodes.java | 52 +- .../bartworks/ASM/BWCoreTransformer.java | 18 +- .../github/bartimaeusnek/bartworks/GuiHandler.java | 2 +- .../github/bartimaeusnek/bartworks/MainMod.java | 25 +- .../client/ClientEventHandler/TooltipCache.java | 25 +- .../ClientEventHandler/TooltipEventHandler.java | 4 +- .../client/gui/BW_GUIContainer_RotorBlock.java | 8 +- .../client/renderer/BW_EICPistonVisualizer.java | 8 +- .../client/renderer/BW_GT_ItemRenderer.java | 30 +- .../renderer/RendererSwitchingColorFluid.java | 75 +-- .../bartworks/common/blocks/BW_Blocks.java | 3 +- .../bartworks/common/blocks/BW_GlasBlocks.java | 2 +- .../bartworks/common/blocks/BW_GlasBlocks2.java | 2 +- .../common/blocks/BW_TileEntityContainer.java | 42 +- .../blocks/BW_TileEntityContainer_Multiple.java | 24 +- .../bartworks/common/blocks/BioFluidBlock.java | 12 +- .../bartworks/common/commands/ChangeConfig.java | 24 +- .../common/commands/ClearCraftingCache.java | 6 +- .../common/commands/GetWorkingDirectory.java | 6 +- .../common/commands/PrintRecipeListToFile.java | 10 +- .../bartworks/common/commands/RunGC.java | 6 +- .../bartworks/common/commands/SummonRuin.java | 8 +- .../bartworks/common/configs/ConfigHandler.java | 4 +- .../bartworks/common/items/BW_ItemBlocks.java | 3 +- .../bartworks/common/items/BW_SimpleWindMeter.java | 7 +- .../bartworks/common/items/BW_Stonage_Rotors.java | 17 +- .../bartworks/common/items/Circuit_Programmer.java | 24 +- .../common/items/GT_Destructopack_Item.java | 6 +- .../bartworks/common/items/GT_Rockcutter_Item.java | 17 +- .../bartworks/common/items/GT_Teslastaff_Item.java | 13 +- .../bartworks/common/items/LabModule.java | 8 +- .../bartworks/common/items/LabParts.java | 23 +- .../bartworks/common/items/SimpleIconItem.java | 1 + .../bartworks/common/items/SimpleSubItemClass.java | 18 +- .../ElectricImplosionCompressorRecipes.java | 42 +- .../bartworks/common/loaders/FluidLoader.java | 99 ++-- .../bartworks/common/loaders/ItemRegistry.java | 15 +- .../common/loaders/RadioHatchMaterialLoader.java | 5 +- .../common/loaders/StaticRecipeChangeLoaders.java | 229 ++------ .../common/loaders/recipes/Assembler.java | 18 +- .../common/loaders/recipes/CraftingRecipes.java | 18 +- .../bartworks/common/net/BW_Network.java | 52 +- .../common/net/CircuitProgrammerPacket.java | 26 +- .../bartworks/common/net/EICPacket.java | 13 +- .../bartworks/common/net/MetaBlockPacket.java | 29 +- .../bartworks/common/net/OreDictCachePacket.java | 17 +- .../bartworks/common/net/RendererPacket.java | 41 +- .../bartworks/common/net/ServerJoinedPackage.java | 11 +- .../common/tileentities/classic/BW_RotorBlock.java | 1 + .../BW_TileEntity_ExperimentalFloodGate.java | 27 +- .../classic/BW_TileEntity_HeatedWaterPump.java | 84 ++- .../classic/BW_TileEntity_InfinityTank.java | 6 +- .../tileentities/multis/GT_TileEntity_BioVat.java | 119 ++--- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 90 ++-- .../tileentities/multis/GT_TileEntity_DEHP.java | 97 ++-- .../GT_TileEntity_ElectricImplosionCompressor.java | 117 ++-- .../tileentities/multis/GT_TileEntity_HTGR.java | 71 +-- .../tileentities/multis/GT_TileEntity_LESU.java | 96 ++-- .../multis/GT_TileEntity_ManualTrafo.java | 43 +- .../tileentities/multis/GT_TileEntity_THTR.java | 32 +- .../multis/GT_TileEntity_Windmill.java | 156 +++--- .../mega/GT_TileEntity_MegaBlastFurnace.java | 80 +-- .../mega/GT_TileEntity_MegaChemicalReactor.java | 25 +- .../mega/GT_TileEntity_MegaDistillTower.java | 100 ++-- .../mega/GT_TileEntity_MegaMultiBlockBase.java | 20 +- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 76 +-- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 17 +- .../tiered/GT_MetaTileEntity_AcidGenerator.java | 12 + .../tiered/GT_MetaTileEntity_BioLab.java | 155 +++--- .../tiered/GT_MetaTileEntity_Diode.java | 7 +- .../GT_MetaTileEntity_EnergyDistributor.java | 8 +- .../tiered/GT_MetaTileEntity_RadioHatch.java | 117 ++-- .../tiered/GT_MetaTileEntity_Transistor.java | 13 +- .../bartworks/neiHandler/BW_NEI_BioLabHandler.java | 10 +- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 10 +- .../bartworks/neiHandler/BW_NEI_OreHandler.java | 33 +- .../server/EventHandler/ServerEventHandler.java | 25 +- .../material/BW_MetaGeneratedBlock_Item.java | 24 +- .../material/BW_MetaGeneratedBlocks_Casing.java | 9 +- .../BW_MetaGeneratedBlocks_CasingAdvanced_TE.java | 2 +- .../material/BW_MetaGeneratedBlocks_Casing_TE.java | 2 +- .../system/material/BW_MetaGeneratedFrames.java | 12 +- .../system/material/BW_MetaGeneratedOreTE.java | 2 +- .../material/BW_MetaGeneratedSmallOreTE.java | 5 +- .../system/material/BW_MetaGenerated_Block_TE.java | 5 +- .../system/material/BW_MetaGenerated_Blocks.java | 27 +- .../system/material/BW_MetaGenerated_Items.java | 23 +- .../system/material/BW_MetaGenerated_Ores.java | 56 +- .../material/BW_MetaGenerated_SmallOres.java | 32 +- .../BW_MetaGenerated_WerkstoffBlock_TE.java | 2 +- .../material/BW_MetaGenerated_WerkstoffBlocks.java | 5 +- .../system/material/BW_NonMeta_MaterialItems.java | 86 +-- .../material/CircuitGeneration/BW_Meta_Items.java | 25 +- .../material/CircuitGeneration/CircuitData.java | 6 +- .../CircuitGeneration/CircuitImprintLoader.java | 20 +- .../CircuitGeneration/CircuitPartLoader.java | 2 +- .../material/GT_Enhancement/BWGTMetaItems.java | 94 ++-- .../GT_Enhancement/GTMetaItemEnhancer.java | 8 +- .../GT_Enhancement/PlatinumSludgeOverHaul.java | 220 ++++---- .../bartworks/system/material/Werkstoff.java | 149 +++--- .../bartworks/system/material/WerkstoffLoader.java | 40 +- .../processingLoaders/AdditionalRecipes.java | 20 +- .../werkstoff_loaders/recipe/AspectLoader.java | 12 +- .../werkstoff_loaders/recipe/CasingLoader.java | 10 +- .../werkstoff_loaders/recipe/CellLoader.java | 4 +- .../werkstoff_loaders/recipe/CrushedLoader.java | 2 +- .../werkstoff_loaders/recipe/DustLoader.java | 128 ++--- .../werkstoff_loaders/recipe/GemLoader.java | 14 +- .../werkstoff_loaders/recipe/MoltenCellLoader.java | 8 +- .../registration/BridgeMaterialsLoader.java | 131 +++-- .../bartworks/system/oredict/OreDictHandler.java | 15 +- .../bartworks/system/oregen/BW_OreLayer.java | 89 ++- .../bartworks/system/oregen/BW_WordGenerator.java | 8 +- .../system/oregen/BW_WorldGenRoss128b.java | 1 + .../bartworks/system/worldgen/MapGenRuins.java | 267 +++++---- .../bartimaeusnek/bartworks/util/BWRecipes.java | 100 ++-- .../bartimaeusnek/bartworks/util/BW_ColorUtil.java | 17 +- .../bartimaeusnek/bartworks/util/BW_Util.java | 595 +++++---------------- .../bartimaeusnek/bartworks/util/BioCulture.java | 13 +- .../bartimaeusnek/bartworks/util/BioDNA.java | 2 +- .../bartimaeusnek/bartworks/util/BioData.java | 6 +- .../bartimaeusnek/bartworks/util/BioPlasmid.java | 2 +- .../bartworks/util/ConnectedBlocksChecker.java | 103 ++-- .../util/ConnectedBlocksCheckerIteration.java | 121 ++--- .../bartimaeusnek/bartworks/util/Coords.java | 27 +- .../bartimaeusnek/bartworks/util/MathUtils.java | 18 +- .../bartimaeusnek/bartworks/util/MurmurHash3.java | 65 ++- .../bartworks/util/NoiseUtil/SimplexNoise.java | 79 ++- .../bartworks/util/NonNullWrappedHashMap.java | 3 +- .../bartworks/util/NonNullWrappedHashSet.java | 9 +- .../github/bartimaeusnek/bartworks/util/Pair.java | 10 +- .../bartworks/util/RecipeFinderForParallel.java | 5 +- .../bartworks/util/ResultWrongSievert.java | 31 +- .../accessprioritylist/AccessPriorityList.java | 116 ++-- .../AccessPriorityListIterators.java | 44 +- .../accessprioritylist/AccessPriorityListNode.java | 14 +- .../bartworks/util/flowerset/FlowerSet.java | 34 +- .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 18 +- .../crossmod/GTpp/loader/RadioHatchCompat.java | 42 +- .../bartimaeusnek/crossmod/cls/CLSCompat.java | 2 +- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 247 ++++----- .../crossmod/galacticraft/PlanetsHelperClass.java | 18 +- .../galacticraft/UniversalTeleportType.java | 2 +- .../atmosphere/BWAtmosphereManager.java | 3 +- .../planets/ross128b/ChunkProviderRoss128b.java | 14 +- .../planets/ross128b/WorldProviderRoss128b.java | 1 + .../planets/ross128ba/ChunkProviderRoss128ba.java | 13 +- .../solarsystems/Ross128SolarSystem.java | 2 +- .../tileEntity/DysonSwarmSunReplacement.java | 114 ---- .../galaxySpace/tileEntity/GalaxySpaceProxy.java | 47 -- .../openComputers/TileEntity_GTDataServer.java | 88 ++- .../tectech/TT_TileEntity_ManualTrafo.java | 60 +-- .../crossmod/tectech/TecTechResearchLoader.java | 1 - .../tectech/tileentites/tiered/LowPowerLaser.java | 30 +- .../tiered/TT_Abstract_LowPowerLaserThingy.java | 8 +- .../tiered/TT_MetaTileEntity_LowPowerLaserBox.java | 16 +- .../TT_MetaTileEntity_LowPowerLaserDynamo.java | 12 +- .../TT_MetaTileEntity_Pipe_Energy_LowPower.java | 1 - .../crossmod/tgregworks/MaterialsInjector.java | 10 +- .../crossmod/thaumcraft/tile/GT_WandBuffer.java | 3 + .../thaumcraft/util/ThaumcraftHandler.java | 19 +- 170 files changed, 3030 insertions(+), 3640 deletions(-) delete mode 100644 addon.gradle delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java diff --git a/addon.gradle b/addon.gradle deleted file mode 100644 index cc0f5d57e5..0000000000 --- a/addon.gradle +++ /dev/null @@ -1,3 +0,0 @@ -compileJava { - options.encoding = "UTF-8" -} diff --git a/dependencies.gradle b/dependencies.gradle index 13d6112f9b..4038924ff4 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -11,5 +11,4 @@ dependencies { compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.24-pre:dev") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.17-GTNH:api") {transitive = false} - } diff --git a/gradle.properties b/gradle.properties index 7b394d5ef5..dbd43421de 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,12 +15,27 @@ autoUpdateBuildScript = false minecraftVersion = 1.7.10 forgeVersion = 10.13.4.1614 +# Specify a MCP channel and mappings version for dependency deobfuscation and the deobfParams task. +channel = stable +mappingsVersion = 12 + +# Define other MCP mappings for dependency deobfuscation +remoteMappings = https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/ + # Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you # restart Minecraft in development. Choose this dependent on your mod: # Do you need consistent player progressing (for example Thaumcraft)? -> Select a name # Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty developmentEnvironmentUserName = Developer +# Enables using modern java syntax (up to version 17) via Jabel, while still targeting JVM 8. +# See https://github.com/bsideup/jabel for details on how this works. +enableModernJavaSyntax = true + +# Enables injecting missing generics into the decompiled source code for a better coding experience +# Turns most publicly visible List, Map, etc. into proper List, Map types +enableGenericInjection = true + # Generate a class with String fields for the mod id, name, version and group name named with the fields below generateGradleTokenClass = com.github.bartimaeusnek.bartworks.API.API_REFERENCE gradleTokenModId = @@ -40,12 +55,15 @@ replaceGradleTokenInFile = # 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 +# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/ +# There can be multiple files in a comma-separated list. +# Example value: mymodid_at.cfg,nei_at.cfg accessTransformersFile = # Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! usesMixins = false +# Adds some debug arguments like verbose output and export +usesMixinDebug = false # Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise. mixinPlugin = # Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! @@ -61,6 +79,71 @@ containsMixinsAndOrCoreModOnly = false # Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins. forceEnableMixins = true -# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your +# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your # responsibility check the licence and request permission for distribution, if required. usesShadowedDependencies = false +# If disabled, won't remove unused classes from shaded dependencies. Some libraries use reflection to access +# their own classes, making the minimization unreliable. +minimizeShadowedDependencies = true +# If disabled, won't rename the shadowed classes. +relocateShadowedDependencies = true + +# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories +includeWellKnownRepositories = true + +# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven. +# Authenticate with the MAVEN_USERNAME and MAVEN_PASSWORD environment variables. +# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle. +usesMavenPublishing = true +# mavenPublishUrl = http://jenkins.usrv.eu:8081/nexus/content/repositories/releases + +# Publishing to modrinth requires you to set the MODRINTH_TOKEN environment variable to your current modrinth API token. + +# The project's ID on Modrinth. Can be either the slug or the ID. +# Leave this empty if you don't want to publish on Modrinth. +modrinthProjectId = + +# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth. +# Syntax: scope1-type1:name1;scope2-type2:name2;... +# Where scope can be one of [required, optional, incompatible, embedded], +# type can be one of [project, version], +# and the name is the Modrinth project or version slug/id of the other mod. +# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech +# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true +modrinthRelations = + + +# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens. + +# The project's numeric ID on CurseForge. You can find this in the About Project box. +# Leave this empty if you don't want to publish on CurseForge. +curseForgeProjectId = + +# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge. +# Syntax: type1:name1;type2:name2;... +# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible], +# and the name is the CurseForge project slug of the other mod. +# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft +# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true +curseForgeRelations = + + +# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older +# projects. New projects should not use this parameter. +# customArchiveBaseName = + +# Optional parameter to prevent the source code from being published +# noPublishedSources = + +# Uncomment this to disable spotless checks +# This should only be uncommented to keep it easier to sync with upstream/other forks. +# That is, if there is no other active fork/upstream, NEVER change this. +# disableSpotless = true + +# Override the IDEA build type. Valid value is "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle" +# (force use delegated build). +# This is meant to be set in $HOME/.gradle/gradle.properties. +# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be always native build. +# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want! +# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you. +# ideaOverrideBuildType = idea diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java index f13035b5c9..fc09d943bc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -17,7 +17,7 @@ import static gregtech.api.enums.Mods.Gendustry; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; -import java.awt.*; +import java.awt.Color; import net.minecraft.item.EnumRarity; import net.minecraftforge.fluids.FluidRegistry; @@ -28,13 +28,13 @@ import com.github.bartimaeusnek.bartworks.util.BioDNA; import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; +import gregtech.api.enums.FluidState; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.TierEU; -import gregtech.api.objects.GT_Fluid; +import gregtech.api.fluid.GT_FluidFactory; import gregtech.api.util.GT_Utility; -@SuppressWarnings("ALL") public final class BioObjectAdder { /** @@ -50,7 +50,7 @@ public final class BioObjectAdder { EnumRarity rarity, boolean breedable) { if (BioCulture.BIO_CULTURE_ARRAY_LIST.size() > 1) return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, rarity, breedable); - else new Exception( + new Exception( "Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!") .printStackTrace(); return null; @@ -70,7 +70,7 @@ public final class BioObjectAdder { boolean breedable) { if (BioCulture.BIO_CULTURE_ARRAY_LIST.size() > 1) return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, breedable); - else new Exception( + new Exception( "Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!") .printStackTrace(); return null; @@ -168,15 +168,12 @@ public final class BioObjectAdder { for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.getFluidNotSet()) { B.setFluid( - new GT_Fluid( - B.getName().replaceAll(" ", "").toLowerCase() + "fluid", - "molten.autogenerated", - new short[] { (short) B.getColor().getRed(), (short) B.getColor().getBlue(), - (short) B.getColor().getGreen() })); - - if (!FluidRegistry.registerFluid(B.getFluid())) { - new Exception("FAILED TO REGISTER FLUID FOR: " + B.getName()).printStackTrace(); - } + GT_FluidFactory.builder(B.getName().replace(" ", "").toLowerCase() + "fluid") + .withTextureName("molten.autogenerated") + .withColorRGBA( + new short[] { (short) B.getColor().getRed(), (short) B.getColor().getBlue(), + (short) B.getColor().getGreen() }) + .withStateAndTemperature(FluidState.LIQUID, 300).buildAndRegister().asFluid()); GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)) .fluidInputs(new FluidStack(B.getFluid(), 1000)).fluidOutputs(dnaFluid).duration(25 * SECONDS) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java index 35c12e1cae..ba1308c427 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java @@ -24,7 +24,6 @@ import com.github.bartimaeusnek.bartworks.util.BioDNA; import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; -@SuppressWarnings("ALL") public final class BioObjectGetter { public static BioCulture getBioCulture(String aName) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java index b456f8d562..527b62bae3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java @@ -24,7 +24,6 @@ import com.github.bartimaeusnek.bartworks.util.BioCulture; import gregtech.api.enums.Materials; -@SuppressWarnings("ALL") public final class BioRecipeAdder { public static final int STANDART = 0; @@ -108,6 +107,7 @@ public final class BioRecipeAdder { * @param exactSv if the recipe needs EXACTLY the Sv or can use less... * @return */ + @Deprecated public static boolean addBacterialVatRecipe(ItemStack[] aInputs, @Nonnull BioCulture aCulture, @Nonnull FluidStack[] aFluidInputs, @Nonnull FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, Materials material, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java index fdfb020919..4084f485ab 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -34,7 +34,6 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.util.GT_ModHandler; -@SuppressWarnings("ALL") public final class BioVatLogicAdder { public static class RadioHatch { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java index 4100b17760..698c28fbf7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java @@ -31,7 +31,7 @@ public interface ITileHasDifferentTextureSides { @SideOnly(Side.CLIENT) default IIcon getTextureForSide(int side, int meta) { - return getTextureForSide(ForgeDirection.values()[side], meta); + return this.getTextureForSide(ForgeDirection.values()[side], meta); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java index 60202e102e..05877f42e0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java @@ -38,7 +38,6 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.versioning.ArtifactVersion; import cpw.mods.fml.common.versioning.DefaultArtifactVersion; -@SuppressWarnings("ALL") public class BWCore extends DummyModContainer { public static final String BWCORE_NAME = "BartWorks ASM Core"; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java index 86480db53c..8d3fe4876c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java @@ -39,7 +39,6 @@ public class BWCoreStaticReplacementMethodes { RECENTLYUSEDRECIPES = ThreadLocal.withInitial(AccessPriorityList::new); } - @SuppressWarnings("ALL") public static ItemStack findCachedMatchingRecipe(InventoryCrafting inventoryCrafting, World world) { int i = 0; ItemStack itemstack = null; @@ -72,45 +71,40 @@ public class BWCoreStaticReplacementMethodes { return new ItemStack(itemstack.getItem(), 1, i1); - } else { - - IRecipe iPossibleRecipe = null; - AccessPriorityList cache = RECENTLYUSEDRECIPES.get(); - Iterator> it = cache.nodeIterator(); - - while (it.hasNext()) { - AccessPriorityListNode recipeNode = it.next(); - iPossibleRecipe = recipeNode.getELEMENT(); + } + IRecipe iPossibleRecipe = null; + AccessPriorityList cache = RECENTLYUSEDRECIPES.get(); + Iterator> it = cache.nodeIterator(); - if (!iPossibleRecipe.matches(inventoryCrafting, world)) continue; + while (it.hasNext()) { + AccessPriorityListNode recipeNode = it.next(); + iPossibleRecipe = recipeNode.getELEMENT(); - cache.addPrioToNode(recipeNode); - return iPossibleRecipe.getCraftingResult(inventoryCrafting); - } + if (!iPossibleRecipe.matches(inventoryCrafting, world)) continue; - ItemStack stack = null; + cache.addPrioToNode(recipeNode); + return iPossibleRecipe.getCraftingResult(inventoryCrafting); + } - HashSet recipeSet = new NonNullWrappedHashSet<>(); - List recipeList = CraftingManager.getInstance().getRecipeList(); + HashSet recipeSet = new NonNullWrappedHashSet<>(); + List recipeList = CraftingManager.getInstance().getRecipeList(); - for (int k = 0; k < recipeList.size(); k++) { - IRecipe r = (IRecipe) recipeList.get(k); - if (r.matches(inventoryCrafting, world)) recipeSet.add(r); - } + for (IRecipe r : recipeList) { + if (r.matches(inventoryCrafting, world)) recipeSet.add(r); + } - Object[] arr = recipeSet.toArray(); + Object[] arr = recipeSet.toArray(); - if (arr.length == 0) return null; + if (arr.length == 0) return null; - IRecipe recipe = (IRecipe) arr[0]; - stack = recipe.getCraftingResult(inventoryCrafting); + IRecipe recipe = (IRecipe) arr[0]; + ItemStack stack = recipe.getCraftingResult(inventoryCrafting); - if (arr.length != 1) return stack; + if (arr.length != 1) return stack; - if (stack != null) cache.addLast(recipe); + if (stack != null) cache.addLast(recipe); - return stack; - } + return stack; } private BWCoreStaticReplacementMethodes() {} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java index 1605192572..794fd2881f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java @@ -85,7 +85,7 @@ public class BWCoreTransformer implements IClassTransformer { nu.add(instruction); if (instruction.getOpcode() == INVOKEVIRTUAL) { MethodInsnNode invokevirtual = (MethodInsnNode) instruction; - if (invokevirtual.name.equals("addVis")) { + if ("addVis".equals(invokevirtual.name)) { AbstractInsnNode beginning = method.instructions.get(j - 7); LabelNode label = new LabelNode(); nu.insertBefore(beginning, new VarInsnNode(ALOAD, 0)); @@ -133,7 +133,6 @@ public class BWCoreTransformer implements IClassTransformer { String name_deObfs = "canDoRainSnowIce"; String dsc_deObfs = "(Lnet/minecraft/world/chunk/Chunk;)Z"; - String dsc_Obfs = "(Lapx;)Z"; for (int i = 0; i < methods.size(); i++) { if (methods.get(i).name.equalsIgnoreCase(name_deObfs)) { BWCore.BWCORE_LOG.info("Found " + name_deObfs + "! Removing!"); @@ -142,12 +141,7 @@ public class BWCoreTransformer implements IClassTransformer { } } BWCore.BWCORE_LOG.info("Creating new " + name_deObfs + "!"); - MethodNode nu = new MethodNode( - ACC_PUBLIC, - name_deObfs, - /* obfs ? dsc_Obfs : */ dsc_deObfs, - null, - new String[0]); + MethodNode nu = new MethodNode(ACC_PUBLIC, name_deObfs, dsc_deObfs, null, new String[0]); InsnList insnList = new InsnList(); insnList.add(new InsnNode(ICONST_0)); insnList.add(new InsnNode(IRETURN)); @@ -168,7 +162,7 @@ public class BWCoreTransformer implements IClassTransformer { for (int i = 0; i < methods.size(); i++) { if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_deObfs, dsc_Obfs)) { - BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); + BWCore.BWCORE_LOG.info("Found " + name_deObfs + "! Patching!"); MethodNode toPatch = methods.get(i); InsnList insnList = new InsnList(); insnList.add(new InsnNode(ACONST_NULL)); @@ -192,7 +186,7 @@ public class BWCoreTransformer implements IClassTransformer { for (MethodNode toPatch : methods) { if (ASMUtils.isCorrectMethod(toPatch, name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(toPatch, dsc_universal)) { - BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); + BWCore.BWCORE_LOG.info("Found " + name_deObfs + "! Patching!"); InsnList nu = new InsnList(); LabelNode[] LabelNodes = { new LabelNode(), new LabelNode() }; @@ -311,7 +305,7 @@ public class BWCoreTransformer implements IClassTransformer { for (int i = 0; i < methods.size(); i++) { if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal, dsc_universal)) { - BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); + BWCore.BWCORE_LOG.info("Found " + name_deObfs + "! Patching!"); methods.set(i, BWCoreTransformer.transformThaumcraftWandPedestal(methods.get(i))); break scase; } @@ -325,7 +319,7 @@ public class BWCoreTransformer implements IClassTransformer { String name_deObfs = "getNewNoise"; for (MethodNode toPatch : methods) { if (ASMUtils.isCorrectMethod(toPatch, name_deObfs)) { - BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); + BWCore.BWCORE_LOG.info("Found " + name_deObfs + "! Patching!"); LabelNode[] LabelNodes = { new LabelNode(), new LabelNode() }; InsnList nu = new InsnList(); // if (x < -28675) x %= -28675; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java index bb9a40934f..c104d09f3a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -29,7 +29,7 @@ public class GuiHandler implements IGuiHandler { @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - if (SideReference.Side.Client) {} else return getServerGuiElement(ID, player, world, x, y, z); + if (!SideReference.Side.Client) return this.getServerGuiElement(ID, player, world, x, y, z); return null; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index cf88fe51bb..e4a73d1996 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -80,20 +80,17 @@ import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; -@SuppressWarnings("ALL") -@Mod( - modid = MainMod.MOD_ID, - name = MainMod.NAME, - version = API_REFERENCE.VERSION, - dependencies = "required-after:IC2; " + "required-after:gregtech; " - + "after:berriespp; " - + "after:tectech; " - + "after:GalacticraftMars; " - + "after:GalacticraftCore; " - + "after:Forestry; " - + "after:ProjRed|Illumination; " - + "after:RandomThings; " - + "before:miscutils; ") +@Mod(modid = MainMod.MOD_ID, name = MainMod.NAME, version = API_REFERENCE.VERSION, dependencies = """ + required-after:IC2;\ + required-after:gregtech;\ + after:berriespp;\ + after:tectech;\ + after:GalacticraftMars;\ + after:GalacticraftCore;\ + after:Forestry;\ + after:ProjRed|Illumination;\ + after:RandomThings;\ + before:miscutils;""") public final class MainMod { public static final String NAME = "BartWorks"; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java index 4c59aa38ef..a23020e787 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java @@ -29,19 +29,16 @@ class TooltipCache { static boolean put(ItemStack itemStack, List tooltip) { Pair p = new Pair<>(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage()); - if (TooltipCache.cache.containsKey(p)) return false; - - if (!tooltip.isEmpty()) { - StringBuilder sb = new StringBuilder(); - for (String s : tooltip) { - sb.append(s); - sb.append(System.lineSeparator()); - } - char[] rettype = sb.toString().toCharArray(); - return TooltipCache.cache.put(p, rettype) == rettype; - } else { + if (TooltipCache.cache.containsKey(p) || tooltip.isEmpty()) { return false; } + StringBuilder sb = new StringBuilder(); + for (String s : tooltip) { + sb.append(s); + sb.append(System.lineSeparator()); + } + char[] rettype = sb.toString().toCharArray(); + return TooltipCache.cache.put(p, rettype) == rettype; } static List getTooltip(ItemStack itemStack) { @@ -52,10 +49,4 @@ class TooltipCache { } return Arrays.asList(new String(toTest).split(System.lineSeparator())); } - - private static void checkSize() { - if (TooltipCache.cache.size() > Short.MAX_VALUE * 2) { - TooltipCache.cache.clear(); - } - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java index 1c004ec151..2b7e686814 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java @@ -67,8 +67,8 @@ public class TooltipEventHandler { UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); if (UI != null) { for (ModContainer modContainer : Loader.instance().getModList()) { - if (UI.modId.equals(MainMod.MOD_ID) || UI.modId.equals(BartWorksCrossmod.MOD_ID) - || UI.modId.equals("BWCore")) + if (MainMod.MOD_ID.equals(UI.modId) || BartWorksCrossmod.MOD_ID.equals(UI.modId) + || "BWCore".equals(UI.modId)) break; if (UI.modId.equals(modContainer.getModId())) { tooAdd.add( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java index ccacef6c3f..188c0c9e69 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java @@ -38,7 +38,8 @@ public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator { this.name = StatCollector.translateToLocal("tile.BWRotorBlock.0.name"); } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { + @Override + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { this.fontRendererObj .drawString(this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 6, 2157374); if (this.container.base.checkrotor()) { @@ -58,8 +59,8 @@ public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator { this.fontRendererObj.drawString(this.container.base.getRotorhealth() + " %", 46, 52, 2157374); if (this.container.base.guiisoverload()) { GuiTooltipHelper.drawAreaTooltip( - p_146979_1_ - this.guiLeft, - p_146979_2_ - this.guiTop, + mouseX - this.guiLeft, + mouseY - this.guiTop, StatCollector.translateToLocal("ic2.WindKineticGenerator.error.overload"), 44, 27, @@ -76,6 +77,7 @@ public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator { } } + @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { GL11.glColor3f(0.5f, 0.25f, 0.07f); this.mc.getTextureManager() diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java index 4b5923fd23..bb48e4067e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java @@ -18,7 +18,7 @@ import gregtech.api.GregTech_API; public class BW_EICPistonVisualizer extends EntityFX { public BW_EICPistonVisualizer(World world, int x, int y, int z, int age) { - super(world, (double) x, ((double) y), (double) z); + super(world, x, y, z); this.prevPosX = this.posX; this.prevPosY = this.posY; this.prevPosZ = this.posZ; @@ -43,9 +43,9 @@ public class BW_EICPistonVisualizer extends EntityFX { // Look at nearby block for correct tiered block to use Pair tieredBlock; if (this.worldObj != null) { - int nX = (int) posX; - int nY = (int) posY + 1; - int nZ = (int) posZ; + int nX = (int) this.posX; + int nY = (int) this.posY + 1; + int nZ = (int) this.posZ; Block neighborBlock = this.worldObj.getBlock(nX, nY, nZ); int neighborMeta = this.worldObj.getBlockMetadata(nX, nY, nZ); tieredBlock = Pair.of(neighborBlock, neighborMeta); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java index 4a6561f9ef..363de0eda7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java @@ -50,9 +50,8 @@ public class BW_GT_ItemRenderer implements IItemRenderer { || aType == IItemRenderer.ItemRenderType.INVENTORY || aType == IItemRenderer.ItemRenderType.EQUIPPED || aType == IItemRenderer.ItemRenderType.ENTITY; - } else { - return false; } + return false; } @Override @@ -60,9 +59,8 @@ public class BW_GT_ItemRenderer implements IItemRenderer { IItemRenderer.ItemRendererHelper aHelper) { if (GT_Utility.isStackInvalid(aStack)) { return false; - } else { - return aType == IItemRenderer.ItemRenderType.ENTITY; } + return aType == IItemRenderer.ItemRenderType.ENTITY; } @Override @@ -85,7 +83,7 @@ public class BW_GT_ItemRenderer implements IItemRenderer { Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); GL11.glBlendFunc(770, 771); - if (type.equals(IItemRenderer.ItemRenderType.INVENTORY)) { + if (IItemRenderer.ItemRenderType.INVENTORY.equals(type)) { if (aMetaData < CircuitImprintLoader.reverseIDs) GT_RenderUtil.renderItemIcon(tIcon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); else { @@ -102,24 +100,22 @@ public class BW_GT_ItemRenderer implements IItemRenderer { -1.0F); } } - } else { - if (aMetaData < CircuitImprintLoader.reverseIDs) ItemRenderer.renderItemIn2D( - Tessellator.instance, - tIcon.getMaxU(), - tIcon.getMinV(), - tIcon.getMinU(), - tIcon.getMaxV(), - tIcon.getIconWidth(), - tIcon.getIconHeight(), - 0.0625F); - } + } else if (aMetaData < CircuitImprintLoader.reverseIDs) ItemRenderer.renderItemIn2D( + Tessellator.instance, + tIcon.getMaxU(), + tIcon.getMinV(), + tIcon.getMinU(), + tIcon.getMaxV(), + tIcon.getIconWidth(), + tIcon.getIconHeight(), + 0.0625F); IIcon tOverlay = (IIcon) BW_Util.get2DCoordFrom1DArray(aMetaData, 1, 2, aItem.mIconList); GL11.glColor3f(1.0F, 1.0F, 1.0F); if (tOverlay != null) { Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); GL11.glBlendFunc(770, 771); - if (type.equals(IItemRenderer.ItemRenderType.INVENTORY)) { + if (IItemRenderer.ItemRenderType.INVENTORY.equals(type)) { GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { ItemRenderer.renderItemIn2D( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java index 894d15cf4c..6e1bffcd08 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java @@ -76,9 +76,9 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler return RendererSwitchingColorFluid.THREE_QUARTERS_FILLED; } } - return (!world.getBlock(x, y, z).getMaterial().isSolid() && world.getBlock(x, y + 1, z) == block) + return !world.getBlock(x, y, z).getMaterial().isSolid() && world.getBlock(x, y + 1, z) == block ? RendererSwitchingColorFluid.LIGHT_Y_POS - : (block.getQuantaPercentage(world, x, y, z) * RendererSwitchingColorFluid.THREE_QUARTERS_FILLED); + : block.getQuantaPercentage(world, x, y, z) * RendererSwitchingColorFluid.THREE_QUARTERS_FILLED; } public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {} @@ -86,7 +86,7 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler @SideOnly(Side.CLIENT) public boolean renderWorldBlock(IBlockAccess iBlockAccess, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - if ((!(block instanceof BioFluidBlock))) return false; + if (!(block instanceof BioFluidBlock)) return false; Tessellator tessellator = Tessellator.instance; Coords blockat = new Coords(x, y, z, iBlockAccess.getTileEntity(x, y, z).getWorldObj().provider.dimensionId); Integer rgb = GT_TileEntity_BioVat.staticColorMap.get(blockat); @@ -94,15 +94,15 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler int r, g, b; if (rgb != null) { - r = (rgb >> 16) & 0xFF; - g = (rgb >> 8) & 0xFF; + r = rgb >> 16 & 0xFF; + g = rgb >> 8 & 0xFF; b = rgb & 0xFF; } else { r = 0; g = 0; b = 255; } - float red = ((float) r) / 255f, green = ((float) g) / 255f, blue = ((float) b) / 255f; + float red = r / 255f, green = g / 255f, blue = b / 255f; BlockFluidBase blockFluidBase = (BlockFluidBase) block; boolean renderTop = iBlockAccess.getBlock(x, y + 1, z) != blockFluidBase; @@ -237,35 +237,40 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler if (renderer.renderAllFaces || renderSides[side]) { rendered = true; double dHeight1, dHeight2, dXcoord1, dXcoord2, dZcoord1, dZcoord2; - if (side == 0) { - dHeight1 = heightNW; - dHeight2 = heightNE; - dXcoord1 = x; - dXcoord2 = x + 1; - dZcoord1 = z + RendererSwitchingColorFluid.RENDER_OFFSET; - dZcoord2 = z + RendererSwitchingColorFluid.RENDER_OFFSET; - } else if (side == 1) { - dHeight1 = heightSE; - dHeight2 = heightSW; - dXcoord1 = x + 1; - dXcoord2 = x; - dZcoord1 = z + 1 - RendererSwitchingColorFluid.RENDER_OFFSET; - dZcoord2 = z + 1 - RendererSwitchingColorFluid.RENDER_OFFSET; - } else if (side == 2) { - dHeight1 = heightSW; - dHeight2 = heightNW; - dXcoord1 = x + RendererSwitchingColorFluid.RENDER_OFFSET; - dXcoord2 = x + RendererSwitchingColorFluid.RENDER_OFFSET; - dZcoord1 = z + 1; - dZcoord2 = z; - } else { - dHeight1 = heightNE; - dHeight2 = heightSE; - dXcoord1 = x + 1 - RendererSwitchingColorFluid.RENDER_OFFSET; - dXcoord2 = x + 1 - RendererSwitchingColorFluid.RENDER_OFFSET; - dZcoord1 = z; - dZcoord2 = z + 1; - } + dZcoord2 = switch (side) { + case 0 -> { + dHeight1 = heightNW; + dHeight2 = heightNE; + dXcoord1 = x; + dXcoord2 = x + 1; + dZcoord1 = z + RendererSwitchingColorFluid.RENDER_OFFSET; + yield z + RendererSwitchingColorFluid.RENDER_OFFSET; + } + case 1 -> { + dHeight1 = heightSE; + dHeight2 = heightSW; + dXcoord1 = x + 1; + dXcoord2 = x; + dZcoord1 = z + 1 - RendererSwitchingColorFluid.RENDER_OFFSET; + yield z + 1 - RendererSwitchingColorFluid.RENDER_OFFSET; + } + case 2 -> { + dHeight1 = heightSW; + dHeight2 = heightNW; + dXcoord1 = x + RendererSwitchingColorFluid.RENDER_OFFSET; + dXcoord2 = x + RendererSwitchingColorFluid.RENDER_OFFSET; + dZcoord1 = z + 1; + yield z; + } + default -> { + dHeight1 = heightNE; + dHeight2 = heightSE; + dXcoord1 = x + 1 - RendererSwitchingColorFluid.RENDER_OFFSET; + dXcoord2 = x + 1 - RendererSwitchingColorFluid.RENDER_OFFSET; + dZcoord1 = z; + yield z + 1; + } + }; float u1Flow = iconFlow.getInterpolatedU(0.0); float u2Flow = iconFlow.getInterpolatedU(8.0); float v1Flow = iconFlow.getInterpolatedV((1.0 - dHeight1) * 16.0 * 0.5); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java index 3dccd88475..1a00d16d85 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java @@ -78,8 +78,7 @@ public class BW_Blocks extends Block { @Override @SideOnly(Side.CLIENT) - @SuppressWarnings("unchecked") - public void getSubBlocks(Item item, CreativeTabs tab, List list) { + public void getSubBlocks(Item item, CreativeTabs tab, List list) { for (int i = 0; i < this.textureNames.length; i++) { list.add(new ItemStack(item, 1, i)); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java index 8bd57edaf9..a2f5e520b9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java @@ -173,7 +173,7 @@ public class BW_GlasBlocks extends BW_Blocks { @Override public int getRenderType() { if (!this.fake && SideReference.Side.Client) return RendererGlasBlock.RID; - else return 0; + return 0; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java index 16688fbc33..337db90324 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java @@ -165,7 +165,7 @@ public class BW_GlasBlocks2 extends BW_Blocks { @Override public int getRenderType() { if (!this.fake && SideReference.Side.Client) return RendererGlasBlock.RID; - else return 0; + return 0; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index 2cfc787a1d..07db82fcb2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -60,8 +60,8 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI } @Override - public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int p_149727_6_, - float p_149727_7_, float p_149727_8_, float p_149727_9_) { + public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int side, float subX, + float subY, float subZ) { if (worldObj.isRemote) { return false; } @@ -84,7 +84,8 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI if (!player.isSneaking()) { if (tile instanceof IHasGui) { return worldObj.isRemote || IC2.platform.launchGui(player, (IHasGui) tile); - } else if (tile instanceof ITileWithModularUI) { + } + if (tile instanceof ITileWithModularUI) { if (!worldObj.isRemote) { UIInfos.TILE_MODULAR_UI.open(player, worldObj, x, y, z); } @@ -94,10 +95,10 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI return false; } + @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) { TileEntity tile = world.getTileEntity(x, y, z); - if (tile instanceof IWrenchable && itemStack != null) { - IWrenchable tile2 = (IWrenchable) tile; + if (tile instanceof IWrenchable tile2 && itemStack != null) { int meta = itemStack.getItemDamage(); world.setBlockMetadataWithNotify(x, y, z, meta, 2); if (entity != null) { @@ -136,14 +137,14 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { - if (ITileHasDifferentTextureSides.class.isAssignableFrom(this.tileEntity)) { - try { - return ((ITileHasDifferentTextureSides) this.tileEntity.newInstance()).getTextureForSide(side, meta); - } catch (InstantiationException | IllegalAccessException e) { - e.printStackTrace(); - return super.getIcon(side, meta); - } - } else return super.getIcon(side, meta); + if (!ITileHasDifferentTextureSides.class.isAssignableFrom(this.tileEntity)) return super.getIcon(side, meta); + try { + return ((ITileHasDifferentTextureSides) this.tileEntity.getConstructor().newInstance()) + .getTextureForSide(side, meta); + } catch (Exception e) { + e.printStackTrace(); + return super.getIcon(side, meta); + } } @Override @@ -151,18 +152,19 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI public void registerBlockIcons(IIconRegister par1IconRegister) { if (ITileHasDifferentTextureSides.class.isAssignableFrom(this.tileEntity)) { try { - ((ITileHasDifferentTextureSides) this.tileEntity.newInstance()).registerBlockIcons(par1IconRegister); - } catch (InstantiationException | IllegalAccessException e) { + ((ITileHasDifferentTextureSides) this.tileEntity.getConstructor().newInstance()) + .registerBlockIcons(par1IconRegister); + } catch (Exception e) { e.printStackTrace(); } } else super.registerBlockIcons(par1IconRegister); } @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + public TileEntity createNewTileEntity(World worldIn, int meta) { try { - return this.tileEntity.newInstance(); - } catch (InstantiationException | IllegalAccessException e) { + return this.tileEntity.getConstructor().newInstance(); + } catch (Exception e) { e.printStackTrace(); } return null; @@ -187,8 +189,8 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI public String[] getInfoData() { if (ITileAddsInformation.class.isAssignableFrom(this.tileEntity)) { try { - return ((ITileAddsInformation) this.tileEntity.newInstance()).getInfoData(); - } catch (InstantiationException | IllegalAccessException e) { + return ((ITileAddsInformation) this.tileEntity.getConstructor().newInstance()).getInfoData(); + } catch (Exception e) { e.printStackTrace(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java index 22b14db261..a7b39dcee3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java @@ -64,8 +64,8 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { } @Override - public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int p_149727_6_, - float p_149727_7_, float p_149727_8_, float p_149727_9_) { + public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int side, float subX, + float subY, float subZ) { if (worldObj.isRemote) { return true; } @@ -73,20 +73,19 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { TileEntity tile = worldObj.getTileEntity(x, y, z); if (tile instanceof IHasGui) { return worldObj.isRemote || IC2.platform.launchGui(player, (IHasGui) tile); - } else if (tile instanceof ITileWithModularUI) { - if (!worldObj.isRemote) { - UIInfos.TILE_MODULAR_UI.open(player, worldObj, x, y, z); - } + } + if (tile instanceof ITileWithModularUI && !worldObj.isRemote) { + UIInfos.TILE_MODULAR_UI.open(player, worldObj, x, y, z); } } return false; } + @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) { TileEntity tile = world.getTileEntity(x, y, z); - if (tile instanceof IWrenchable && itemStack != null) { - IWrenchable tile2 = (IWrenchable) tile; + if (tile instanceof IWrenchable tile2 && itemStack != null) { int meta = itemStack.getItemDamage(); world.setBlockMetadataWithNotify(x, y, z, meta, 2); if (entity != null) { @@ -116,8 +115,7 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { @Override @SideOnly(Side.CLIENT) - @SuppressWarnings("unchecked") - public void getSubBlocks(Item item, CreativeTabs tab, List list) { + public void getSubBlocks(Item item, CreativeTabs tab, List list) { for (int i = 0; i < this.textureNames.length; i++) { list.add(new ItemStack(item, 1, i)); } @@ -154,10 +152,10 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { } @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + public TileEntity createNewTileEntity(World worldIn, int meta) { try { - return this.tileEntityArray[p_149915_2_].newInstance(); - } catch (InstantiationException | IllegalAccessException e) { + return this.tileEntityArray[meta].getConstructor().newInstance(); + } catch (Exception e) { e.printStackTrace(); } return null; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java index fa984b8ee9..a5ad7625f9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java @@ -38,9 +38,10 @@ public class BioFluidBlock extends BlockFluidBase implements ITileEntityProvider this.textureName = "gregtech:fluids/fluid.molten.autogenerated"; } + @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister p_149651_1_) { - FluidLoader.autogenIIcon = this.blockIcon = p_149651_1_.registerIcon(this.getTextureName()); + public void registerBlockIcons(IIconRegister reg) { + FluidLoader.autogenIIcon = this.blockIcon = reg.registerIcon(this.getTextureName()); } @Override @@ -58,6 +59,7 @@ public class BioFluidBlock extends BlockFluidBase implements ITileEntityProvider return 0; } + @Override public int getRenderType() { return FluidLoader.renderID; } @@ -74,18 +76,18 @@ public class BioFluidBlock extends BlockFluidBase implements ITileEntityProvider @Override @SideOnly(Side.CLIENT) - public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) { + public IIcon getIcon(IBlockAccess worldIn, int x, int y, int z, int side) { return FluidLoader.autogenIIcon; } @Override @SideOnly(Side.CLIENT) - public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + public IIcon getIcon(int side, int meta) { return FluidLoader.autogenIIcon; } @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + public TileEntity createNewTileEntity(World worldIn, int meta) { return new BWTileEntityDimIDBridge(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java index c294bcbabc..0434a5d974 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java @@ -29,44 +29,42 @@ public class ChangeConfig extends CommandBase { } @Override - public String getCommandUsage(ICommandSender p_71518_1_) { + public String getCommandUsage(ICommandSender sender) { return "bwcfg "; } @Override @SuppressWarnings("rawtypes") - public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + public void processCommand(ICommandSender sender, String[] args) { try { - Field f = ConfigHandler.class.getField(p_71515_2_[0]); + Field f = ConfigHandler.class.getField(args[0]); Class c = f.getType(); if (c.equals(int.class)) { int l; try { - l = Integer.parseInt(p_71515_2_[1]); + l = Integer.parseInt(args[1]); } catch (NumberFormatException e) { - p_71515_1_.addChatMessage(new ChatComponentText("you need to enter a number!")); + sender.addChatMessage(new ChatComponentText("you need to enter a number!")); return; } f.setInt(null, l); } else if (c.equals(long.class)) { long l; try { - l = Long.parseLong(p_71515_2_[1]); + l = Long.parseLong(args[1]); } catch (NumberFormatException e) { - p_71515_1_.addChatMessage(new ChatComponentText("you need to enter a number!")); + sender.addChatMessage(new ChatComponentText("you need to enter a number!")); return; } f.setLong(null, l); } else if (c.equals(boolean.class)) { - if (p_71515_2_[1].equalsIgnoreCase("true") || p_71515_2_[1].equalsIgnoreCase("1")) - f.setBoolean(null, true); - else if (p_71515_2_[1].equalsIgnoreCase("false") || p_71515_2_[1].equalsIgnoreCase("0")) - f.setBoolean(null, false); + if ("true".equalsIgnoreCase(args[1]) || "1".equalsIgnoreCase(args[1])) f.setBoolean(null, true); + else if ("false".equalsIgnoreCase(args[1]) || "0".equalsIgnoreCase(args[1])) f.setBoolean(null, false); else { - p_71515_1_.addChatMessage(new ChatComponentText("booleans need to be set to true or false")); + sender.addChatMessage(new ChatComponentText("booleans need to be set to true or false")); } } - p_71515_1_.addChatMessage(new ChatComponentText("Set " + p_71515_2_[0] + " to " + p_71515_2_[1])); + sender.addChatMessage(new ChatComponentText("Set " + args[0] + " to " + args[1])); } catch (Exception e) { e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java index 138542bd4b..7afe07beb0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ClearCraftingCache.java @@ -27,13 +27,13 @@ public class ClearCraftingCache extends CommandBase { } @Override - public String getCommandUsage(ICommandSender p_71518_1_) { + public String getCommandUsage(ICommandSender sender) { return "bwclr"; } @Override - public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + public void processCommand(ICommandSender sender, String[] args) { BWCoreStaticReplacementMethodes.clearRecentlyUsedRecipes(); - p_71515_1_.addChatMessage(new ChatComponentText("Recipe Cache cleared ")); + sender.addChatMessage(new ChatComponentText("Recipe Cache cleared ")); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java index e3dd2d13c5..341044c498 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java @@ -26,12 +26,12 @@ public class GetWorkingDirectory extends CommandBase { } @Override - public String getCommandUsage(ICommandSender p_71518_1_) { + public String getCommandUsage(ICommandSender sender) { return "bwgwd"; } @Override - public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { - p_71515_1_.addChatMessage(new ChatComponentText(Minecraft.getMinecraft().mcDataDir.getAbsolutePath())); + public void processCommand(ICommandSender sender, String[] args) { + sender.addChatMessage(new ChatComponentText(Minecraft.getMinecraft().mcDataDir.getAbsolutePath())); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java index 1646b8e750..28d840ac55 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java @@ -21,7 +21,6 @@ import java.io.IOException; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; public class PrintRecipeListToFile extends CommandBase { @@ -31,20 +30,19 @@ public class PrintRecipeListToFile extends CommandBase { } @Override - public String getCommandUsage(ICommandSender p_71518_1_) { + public String getCommandUsage(ICommandSender sender) { return "prltf "; } @Override - @SuppressWarnings("unchecked") - public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { - File file = new File(p_71515_2_[0]); + public void processCommand(ICommandSender sender, String[] args) { + File file = new File(args[0]); try { BufferedWriter fw = new BufferedWriter(new FileWriter(file)); CraftingManager.getInstance().getRecipeList().forEach(e -> { try { - fw.write(e.toString() + " = " + ((IRecipe) e).getRecipeOutput().getDisplayName() + "\n"); + fw.write(e.toString() + " = " + e.getRecipeOutput().getDisplayName() + "\n"); } catch (IOException ex) { ex.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java index 35cdae5bbc..4bbb719501 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java @@ -25,13 +25,13 @@ public class RunGC extends CommandBase { } @Override - public String getCommandUsage(ICommandSender p_71518_1_) { + public String getCommandUsage(ICommandSender sender) { return "bwgc"; } @Override - public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + public void processCommand(ICommandSender sender, String[] args) { Runtime.getRuntime().gc(); - p_71515_1_.addChatMessage(new ChatComponentText("Ran GC!")); + sender.addChatMessage(new ChatComponentText("Ran GC!")); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java index ece4708722..2def53c24e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java @@ -26,19 +26,19 @@ public class SummonRuin extends CommandBase { } @Override - public String getCommandUsage(ICommandSender p_71518_1_) { + public String getCommandUsage(ICommandSender sender) { return "SummonRuin "; } @Override - public void processCommand(ICommandSender iCommandSender, String[] p_71515_2_) { + public void processCommand(ICommandSender iCommandSender, String[] args) { try { new MapGenRuins.RuinsBase().generate( iCommandSender.getEntityWorld(), iCommandSender.getEntityWorld().rand, - Integer.parseInt(p_71515_2_[0]), + Integer.parseInt(args[0]), 256, - Integer.parseInt(p_71515_2_[1])); + Integer.parseInt(args[1])); } catch (Exception e) { e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 46e63a89ec..e710f15df7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -98,7 +98,7 @@ public class ConfigHandler { 615, 625, 635, 645, 655, 665, 675 }, }; private static int[][][] defaultMetasForTiers = { METAFORTIERS_ENERGY, METAFORTIERS_BUFFER, METAFORTIERS_CABLE, METAFORTIERS_MACHINE }; - private static final String[] VOLTAGE_NAMES = new String[] { "High Pressure Steam", "Low Voltage", "Medium Voltage", + private static final String[] VOLTAGE_NAMES = { "High Pressure Steam", "Low Voltage", "Medium Voltage", "High Voltage", "Extreme Voltage", "Insane Voltage", "Ludicrous Voltage", "ZPM Voltage", "Ultimate Voltage", "Ultimate High Voltage", "Ultimate Extreme Voltage", "Ultimate Insane Voltage", "Ultimate Mega Voltage", "Ultimate Extended Mega Voltage", "Overpowered Voltage", "Maximum Voltage" }; @@ -147,7 +147,7 @@ public class ConfigHandler { "This switch sets the lowest unnerfed Circuit Recipe Tier. -1 to disable it completely.", -1, VOLTAGE_NAMES.length).getInt(5); - ConfigHandler.cutoffTier = (ConfigHandler.cutoffTier == -1 ? VOLTAGE_NAMES.length : ConfigHandler.cutoffTier); + ConfigHandler.cutoffTier = ConfigHandler.cutoffTier == -1 ? VOLTAGE_NAMES.length : ConfigHandler.cutoffTier; ConfigHandler.disableExtraGassesForEBF = ConfigHandler.c .get( "System", diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index 33876e557c..b3791b51d6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -61,8 +61,7 @@ public class BW_ItemBlocks extends ItemBlock { @Override @SideOnly(Side.CLIENT) - @SuppressWarnings("unchecked") - public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { byte tier = BorosilicateGlass.getTier(this.field_150939_a, aStack.getItemDamage()); if (tier >= 0) { aList.add( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java index 8a3ec95073..62f8b0e666 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java @@ -42,13 +42,12 @@ public class BW_SimpleWindMeter extends Item { @Override @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister p_94581_1_) { - this.itemIcon = p_94581_1_.registerIcon(MainMod.MOD_ID + ":BW_SimpleWindMeter"); + public void registerIcons(IIconRegister register) { + this.itemIcon = register.registerIcon(MainMod.MOD_ID + ":BW_SimpleWindMeter"); } @Override - @SuppressWarnings("unchecked") - public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean p_77624_4_) { + public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean p_77624_4_) { super.addInformation(itemStack, entityPlayer, list, p_77624_4_); list.add(StatCollector.translateToLocal("tooltip.windmeter.0.name")); list.add( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index ce55f220b4..fd875785a7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -66,13 +66,14 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { this.itemTex = itemTex; } + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon(MainMod.MOD_ID + ":" + this.itemTex); } - @SuppressWarnings("unchecked") - public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { + @Override + public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { info.add( StatCollector .translateToLocalFormatted("ic2.itemrotor.wind.info", this.DiaMinMax[1], this.DiaMinMax[2])); @@ -85,14 +86,14 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { info.add(StatCollector.translateToLocal("tooltip.rotor.0.name") + " " + this.DiaMinMax[0]); info.add( StatCollector.translateToLocal("tooltip.rotor.1.name") + " " - + ((this.getMaxDamageEx() - this.getDamageOfStack(itemStack)) / 100) + + (this.getMaxDamageEx() - this.getDamageOfStack(itemStack)) / 100 + "/" - + (this.getMaxDamageEx() / 100)); + + this.getMaxDamageEx() / 100); info.add(StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + this.eff); info.add(StatCollector.translateToLocal("tooltip.rotor.3.name") + " " + this.speed); info.add(StatCollector.translateToLocal("tooltip.rotor.4.name") + " " + this.mRotor); if (type != null) { - info.add(StatCollector.translateToLocal(("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type)))); + info.add(StatCollector.translateToLocal("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type))); } info.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @@ -128,11 +129,11 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { } public int getSpeed() { - return speed; + return this.speed; } public float getmRotor() { - return mRotor; + return this.mRotor; } public void setDamageForStack(ItemStack stack, int advDmg) { @@ -160,6 +161,6 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { } public void damageItemStack(ItemStack stack, int Dmg) { - setDamageForStack(stack, getDamageOfStack(stack) + Dmg); + this.setDamageForStack(stack, this.getDamageOfStack(stack) + Dmg); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index ebe2c0fa43..7eaea5c3a7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -73,8 +73,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem } @Override - @SuppressWarnings("unchecked") - public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); if (aStack != null && aStack.getTagCompound() != null) aList.add( StatCollector.translateToLocal("tooltip.cp.0.name") + " " @@ -94,8 +93,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem @Override @SideOnly(Side.CLIENT) - @SuppressWarnings("unchecked") - public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); if (this.getChargedItem(itemStack) == this) { ItemStack charged = new ItemStack(this, 1); @@ -163,10 +161,10 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem @Override public void putStack(ItemStack stack) { - if (isLVCircuit(stack)) { - stack = createRealCircuit(0); + if (Circuit_Programmer.this.isLVCircuit(stack)) { + stack = Circuit_Programmer.this.createRealCircuit(0); } - ((IItemHandlerModifiable) this.getItemHandler()).setStackInSlot(getSlotIndex(), stack); + ((IItemHandlerModifiable) this.getItemHandler()).setStackInSlot(this.getSlotIndex(), stack); this.onSlotChanged(); } }); @@ -174,7 +172,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem ItemStack initialStack = null; NBTTagCompound tag = heldStack.getTagCompound(); if (tag != null && tag.getBoolean(NBT_KEY_HAS_CHIP)) { - initialStack = createRealCircuit(tag.getByte(NBT_KEY_CHIP_CONFIG)); + initialStack = this.createRealCircuit(tag.getByte(NBT_KEY_CHIP_CONFIG)); } circuitSlotWidget.getMcSlot().putStack(initialStack); @@ -193,17 +191,17 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem tag2.setBoolean(NBT_KEY_HAS_CHIP, false); } heldItem.setTagCompound(tag2); - }).setFilter(stack -> isProgrammedCircuit(stack) || isLVCircuit(stack)) + }).setFilter(stack -> this.isProgrammedCircuit(stack) || this.isLVCircuit(stack)) .setBackground(ModularUITextures.ITEM_SLOT, GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT).setPos(122, 60)); for (int i = 0; i < 24; i++) { final int index = i; builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> { if (circuitSlotWidget.getMcSlot().getHasStack() - && isProgrammedCircuit(circuitSlotWidget.getMcSlot().getStack())) { - circuitSlotWidget.getMcSlot().putStack(createRealCircuit(index + 1)); + && this.isProgrammedCircuit(circuitSlotWidget.getMcSlot().getStack())) { + circuitSlotWidget.getMcSlot().putStack(this.createRealCircuit(index + 1)); } - }).setPos(32 + (i % 12) * 18, 21 + (i / 12) * 18).setSize(18, 18)); + }).setPos(32 + i % 12 * 18, 21 + i / 12 * 18).setSize(18, 18)); } return builder.build(); @@ -219,7 +217,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem private boolean isLVCircuit(ItemStack stack) { return BW_Util.checkStackAndPrefix(stack) - && GT_OreDictUnificator.getAssociation(stack).mPrefix.equals(OrePrefixes.circuit) + && OrePrefixes.circuit.equals(GT_OreDictUnificator.getAssociation(stack).mPrefix) && GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial.equals(Materials.Basic); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java index 7d3327761c..81b80f2ed7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -49,8 +49,7 @@ public class GT_Destructopack_Item extends GT_Generic_Item implements IItemWithM } @Override - @SuppressWarnings("unchecked") - public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @@ -61,6 +60,7 @@ public class GT_Destructopack_Item extends GT_Generic_Item implements IItemWithM return aStack; } + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aIconRegister) { this.mIcon = aIconRegister.registerIcon("bartworks:gt.GT2Destructopack"); @@ -76,7 +76,7 @@ public class GT_Destructopack_Item extends GT_Generic_Item implements IItemWithM @Override public void putStack(ItemStack stack) { - onSlotChanged(); + this.onSlotChanged(); } }).setBackground(ModularUITextures.ITEM_SLOT, BW_UITextures.OVERLAY_SLOT_CROSS).setPos(79, 16)).widget( new DrawableWidget().setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT).setSize(17, 17) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index 5207a345c1..d099fa6131 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -59,7 +59,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { public GT_Rockcutter_Item(int aTier) { super(2 * aTier, Item.ToolMaterial.EMERALD, GT_Rockcutter_Item.mineableBlocks); this.mTier = aTier; - this.multi = (int) Math.pow(10, (this.mTier - 1)); + this.multi = (int) Math.pow(10, this.mTier - 1); GT_Rockcutter_Item.mineableBlocks = new HashSet<>(); this.maxStackSize = 1; this.mCharge = 10000 * this.multi; @@ -71,13 +71,14 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { this.setUnlocalizedName("GT_Rockcutter_Item_" + GT_Values.VN[this.mTier]); } - @SuppressWarnings("unchecked") - public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { aList.add(StatCollector.translateToLocal("tooltip.bw.tier.name") + " " + GT_Values.VN[this.mTier]); aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } - public void onUpdate(ItemStack aStack, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { + @Override + public void onUpdate(ItemStack aStack, World worldIn, Entity entityIn, int p_77663_4_, boolean p_77663_5_) { if (!ElectricItem.manager.canUse(aStack, 500 * this.multi)) { if (aStack.isItemEnchanted()) { aStack.getTagCompound().removeTag("ench"); @@ -87,12 +88,14 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { } } + @Override public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { ElectricItem.manager.use(aStack, 0, aPlayer); return false; } + @Override public boolean onBlockDestroyed(ItemStack var1, World var2, Block var3, int var4, int var5, int var6, EntityLivingBase var7) { ElectricItem.manager.use(var1, 0, var7); @@ -115,9 +118,9 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { || mineableBlocks.contains(par1Block); } + @Override @SideOnly(Side.CLIENT) - @SuppressWarnings("unchecked") - public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); if (this.getChargedItem(itemStack) == this) { ItemStack charged = new ItemStack(this, 1); @@ -159,11 +162,13 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { return this.mTransfer; } + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.icon = iconRegister.registerIcon("bartworks:GT_Rockcutter"); } + @Override @SideOnly(Side.CLIENT) public IIcon getIconFromDamage(int par1) { return this.icon; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java index 0c05642998..bc07762505 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -61,15 +61,14 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { } @Override - @SuppressWarnings("unchecked") - public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { aList.add(StatCollector.translateToLocal("tooltip.teslastaff.0.name")); aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } + @Override public boolean hitEntity(ItemStack aStack, EntityLivingBase aTarget, EntityLivingBase aPlayer) { - if (aTarget instanceof EntityLiving && ElectricItem.manager.canUse(aStack, 9000000)) { - EntityLiving tTarget = (EntityLiving) aTarget; + if (aTarget instanceof EntityLiving tTarget && ElectricItem.manager.canUse(aStack, 9000000)) { ElectricItem.manager.use(aStack, 9000000, aPlayer); for (int i = 1; i < 5; ++i) { if (tTarget.getEquipmentInSlot(i) != null @@ -81,9 +80,9 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { return true; } + @Override @SideOnly(Side.CLIENT) - @SuppressWarnings("unchecked") - public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); if (this.getChargedItem(itemStack) == this) { ItemStack charged = new ItemStack(this, 1); @@ -130,11 +129,13 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { return this.mTransfer; } + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.icon = iconRegister.registerIcon("bartworks:GT_Teslastaff"); } + @Override @SideOnly(Side.CLIENT) public IIcon getIconFromDamage(int par1) { return this.icon; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java index cc7977b5cc..a4712dc36a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java @@ -28,13 +28,13 @@ public class LabModule extends SimpleSubItemClass { this.setCreativeTab(MainMod.BIO_TAB); } - public String getUnlocalizedName(ItemStack p_77667_1_) { - return "labModule." + super.getUnlocalizedName(p_77667_1_); + @Override + public String getUnlocalizedName(ItemStack stack) { + return "labModule." + super.getUnlocalizedName(stack); } @Override - @SuppressWarnings("unchecked") - public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { aList.add(StatCollector.translateToLocal("tooltip.labmodule.0.name")); super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java index e8632c574c..b18029411f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -46,15 +46,11 @@ public class LabParts extends SimpleSubItemClass { if (itemStack == null || itemStack.getTagCompound() == null) return EnumRarity.common; - switch (itemStack.getItemDamage()) { - case 0: - return BW_Util.getRarityFromByte(itemStack.getTagCompound().getCompoundTag("DNA").getByte("Rarity")); - case 1: - case 2: - return BW_Util.getRarityFromByte(itemStack.getTagCompound().getByte("Rarity")); - default: - return EnumRarity.common; - } + return switch (itemStack.getItemDamage()) { + case 0 -> BW_Util.getRarityFromByte(itemStack.getTagCompound().getCompoundTag("DNA").getByte("Rarity")); + case 1, 2 -> BW_Util.getRarityFromByte(itemStack.getTagCompound().getByte("Rarity")); + default -> EnumRarity.common; + }; } @Override @@ -70,8 +66,7 @@ public class LabParts extends SimpleSubItemClass { } @Override - @SuppressWarnings("unchecked") - public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean b) { + public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean b) { if (itemStack == null) return; if (itemStack.getTagCompound() == null) { @@ -129,17 +124,17 @@ public class LabParts extends SimpleSubItemClass { } @Override - @SuppressWarnings("unchecked") - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { list.addAll(getAllPetriDishes()); list.addAll(getAllDNASampleFlasks()); list.addAll(getAllPlasmidCells()); super.getSubItems(item, creativeTabs, list); } + @Override public String getUnlocalizedName(ItemStack itemStack) { if (itemStack.getItemDamage() == 0 && itemStack.getTagCompound() != null) - return "filled.item." + this.tex[itemStack.getItemDamage()].replaceAll("/", "."); + return "filled.item." + this.tex[itemStack.getItemDamage()].replace('/', '.'); return super.getUnlocalizedName(itemStack); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java index bd192efbe5..e31e23d47c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java @@ -27,6 +27,7 @@ public class SimpleIconItem extends Item { this.tex = tex; } + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon("bartworks:" + this.tex); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java index 346f9e84c7..8d5b239a75 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -41,6 +41,7 @@ public class SimpleSubItemClass extends Item { this.setCreativeTab(MainMod.BWT); } + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.itemIcon = new IIcon[this.tex.length]; @@ -50,29 +51,28 @@ public class SimpleSubItemClass extends Item { } @Override - @SuppressWarnings("unchecked") - public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @Override - @SuppressWarnings("unchecked") - public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { for (int i = 0; i < this.tex.length; i++) { p_150895_3_.add(new ItemStack(p_150895_1_, 1, i)); } } + @Override @SideOnly(Side.CLIENT) public IIcon getIconFromDamage(int p_77617_1_) { if (p_77617_1_ < this.tex.length) return this.itemIcon[p_77617_1_]; - else return this.itemIcon[0]; + return this.itemIcon[0]; } - public String getUnlocalizedName(ItemStack p_77667_1_) { - if (p_77667_1_.getItemDamage() < this.tex.length) - return "item." + this.tex[p_77667_1_.getItemDamage()].replaceAll("/", "."); - else return "WrongDamageItemDestroyIt"; + @Override + public String getUnlocalizedName(ItemStack stack) { + if (stack.getItemDamage() < this.tex.length) return "item." + this.tex[stack.getItemDamage()].replace('/', '.'); + return "WrongDamageItemDestroyIt"; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java index f9f3ea3c64..e3804b8a50 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java @@ -33,7 +33,7 @@ public class ElectricImplosionCompressorRecipes implements Runnable { 1); } - private static final ItemStack[] circuits = new ItemStack[] { ItemList.Circuit_ExoticProcessor.get(1), + private static final ItemStack[] circuits = { ItemList.Circuit_ExoticProcessor.get(1), ItemList.Circuit_OpticalAssembly.get(1), ItemList.Circuit_Biowaresupercomputer.get(1), ItemList.Circuit_Wetwaremainframe.get(1) }; @@ -129,30 +129,30 @@ public class ElectricImplosionCompressorRecipes implements Runnable { 20 * 4, (int) TierEU.RECIPE_MAX); - addMagnetohydrodynamicallyConstrainedStarMatterPartRecipes(); + this.addMagnetohydrodynamicallyConstrainedStarMatterPartRecipes(); } private void addMagnetohydrodynamicallyConstrainedStarMatterPartRecipes() { - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.frameGt, 1, 1); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.nugget, 9, 1); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.ingot, 1, 1); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.plate, 1, 1); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.plateDense, 1, 3); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.stick, 2, 1); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.round, 8, 1); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.bolt, 8, 1); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.screw, 8, 1); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.ring, 4, 1); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.foil, 8, 1); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.itemCasing, 2, 1); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.gearGtSmall, 1, 1); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.rotor, 1, 2); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.stickLong, 1, 1); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.springSmall, 2, 1); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.spring, 1, 1); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.gearGt, 1, 2); - addWhiteDwarfMagnetoEICRecipe(OrePrefixes.wireFine, 8, 1); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.frameGt, 1, 1); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.nugget, 9, 1); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.ingot, 1, 1); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.plate, 1, 1); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.plateDense, 1, 3); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.stick, 2, 1); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.round, 8, 1); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.bolt, 8, 1); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.screw, 8, 1); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.ring, 4, 1); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.foil, 8, 1); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.itemCasing, 2, 1); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.gearGtSmall, 1, 1); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.rotor, 1, 2); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.stickLong, 1, 1); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.springSmall, 2, 1); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.spring, 1, 1); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.gearGt, 1, 2); + this.addWhiteDwarfMagnetoEICRecipe(OrePrefixes.wireFine, 8, 1); } private void addWhiteDwarfMagnetoEICRecipe(final OrePrefixes part, final int multiplier, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 418a299f5c..6f4b237473 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -14,11 +14,11 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import static gregtech.api.enums.Mods.Gendustry; +import static gregtech.api.enums.Mods.GregTech; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; -import java.awt.*; -import java.util.Arrays; +import java.awt.Color; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; @@ -36,11 +36,12 @@ import com.github.bartimaeusnek.bartworks.util.BioCulture; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.enums.FluidState; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.TierEU; -import gregtech.api.objects.GT_Fluid; -import gregtech.api.util.GT_LanguageManager; +import gregtech.api.fluid.GT_FluidFactory; import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Item_98; @@ -57,30 +58,27 @@ public class FluidLoader { public static Fluid fulvicAcid, heatedfulvicAcid, Kerogen; public static void run() { - FluidLoader.renderID = RenderingRegistry.getNextAvailableRenderId(); - short[] rgb = new short[3]; - Arrays.fill(rgb, (short) 255); - FluidLoader.ff = new GT_Fluid("BWfakeFluid", "molten.autogenerated", rgb); - FluidLoader.fulvicAcid = FluidLoader.createAndRegisterFluid("Fulvic Acid", new Color(20, 20, 20)); - FluidLoader.heatedfulvicAcid = FluidLoader - .createAndRegisterFluid("Heated Fulvic Acid", new Color(40, 20, 20), 720); - FluidLoader.Kerogen = FluidLoader.createAndRegisterFluid("Kerogen", new Color(85, 85, 85)); - FluidLoader.BioLabFluidMaterials = new Fluid[] { - new GT_Fluid("FluorecentdDNA", "molten.autogenerated", new short[] { 125, 50, 170, 0 }), - new GT_Fluid("EnzymesSollution", "molten.autogenerated", new short[] { 240, 200, 125, 0 }), - new GT_Fluid("Penicillin", "molten.autogenerated", new short[] { 255, 255, 255, 0 }), - new GT_Fluid("Polymerase", "molten.autogenerated", new short[] { 110, 180, 110, 0 }), }; - - FluidLoader.BioLabFluidCells = new ItemStack[FluidLoader.BioLabFluidMaterials.length]; - for (int i = 0; i < FluidLoader.BioLabFluidMaterials.length; i++) { - FluidRegistry.registerFluid(FluidLoader.BioLabFluidMaterials[i]); - } - - GT_MetaGenerated_Item_98.FluidCell[] fluidCells = new GT_MetaGenerated_Item_98.FluidCell[] { - GT_MetaGenerated_Item_98.FluidCell.FLUORESCENT_DNA, GT_MetaGenerated_Item_98.FluidCell.ENZYME_SOLUTION, - GT_MetaGenerated_Item_98.FluidCell.PENICILLIN, GT_MetaGenerated_Item_98.FluidCell.POLYMERASE, }; + renderID = RenderingRegistry.getNextAvailableRenderId(); + ff = new Fluid("BWfakeFluid"); + GregTech_API.sGTBlockIconload.add( + () -> ff.setIcons( + GregTech_API.sBlockIcons + .registerIcon(GregTech.getResourcePath("fluids", "fluid.molten.autogenerated")))); + fulvicAcid = createAndRegisterFluid("Fulvic Acid", new Color(20, 20, 20)); + heatedfulvicAcid = createAndRegisterFluid("Heated Fulvic Acid", new Color(40, 20, 20), 720); + Kerogen = createAndRegisterFluid("Kerogen", new Color(85, 85, 85)); + BioLabFluidMaterials = new Fluid[] { createAndRegisterFluid("FluorecentdDNA", new Color(125, 50, 170)), + createAndRegisterFluid("EnzymesSollution", new Color(240, 200, 125)), + createAndRegisterFluid("Penicillin", new Color(255, 255, 255)), + createAndRegisterFluid("Polymerase", new Color(110, 180, 110)) }; + + BioLabFluidCells = new ItemStack[BioLabFluidMaterials.length]; + + GT_MetaGenerated_Item_98.FluidCell[] fluidCells = { GT_MetaGenerated_Item_98.FluidCell.FLUORESCENT_DNA, + GT_MetaGenerated_Item_98.FluidCell.ENZYME_SOLUTION, GT_MetaGenerated_Item_98.FluidCell.PENICILLIN, + GT_MetaGenerated_Item_98.FluidCell.POLYMERASE, }; for (int i = 0; i < fluidCells.length; i++) { - FluidLoader.BioLabFluidCells[i] = fluidCells[i].get(); + BioLabFluidCells[i] = fluidCells[i].get(); } FluidStack dnaFluid = Gendustry.isModLoaded() ? FluidRegistry.getFluidStack("liquiddna", 100) @@ -88,24 +86,22 @@ public class FluidLoader { for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.isBreedable()) { B.setFluid( - new GT_Fluid( - B.getName().replaceAll(" ", "").toLowerCase() + "fluid", - "molten.autogenerated", - new short[] { (short) B.getColor().getRed(), (short) B.getColor().getBlue(), - (short) B.getColor().getGreen() })); - FluidRegistry.registerFluid(B.getFluid()); - GT_LanguageManager - .addStringLocalization(B.getFluid().getUnlocalizedName(), B.getLocalisedName() + " Fluid"); + GT_FluidFactory.builder(B.getName().replace(" ", "").toLowerCase() + "fluid") + .withTextureName("molten.autogenerated") + .withColorRGBA( + new short[] { (short) B.getColor().getRed(), (short) B.getColor().getBlue(), + (short) B.getColor().getGreen() }) + .withLocalizedName(B.getLocalisedName() + " Fluid") + .withStateAndTemperature(FluidState.LIQUID, 300).buildAndRegister().asFluid()); GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)) .fluidInputs(new FluidStack(B.getFluid(), 1000)).fluidOutputs(dnaFluid).duration(25 * SECONDS) .eut(TierEU.RECIPE_MV).addTo(sCentrifugeRecipes); - } } - FluidLoader.bioFluidBlock = new BioFluidBlock(); - GameRegistry.registerBlock(FluidLoader.bioFluidBlock, "coloredFluidBlock"); + bioFluidBlock = new BioFluidBlock(); + GameRegistry.registerBlock(bioFluidBlock, "coloredFluidBlock"); GameRegistry.registerTileEntity(BWTileEntityDimIDBridge.class, "bwTEDimIDBridge"); if (SideReference.Side.Client) { RenderingRegistry.registerBlockHandler(RendererSwitchingColorFluid.instance); @@ -114,25 +110,18 @@ public class FluidLoader { } public static Fluid createAndRegisterFluid(String Name, Color color) { - Fluid f = new GT_Fluid( - Name, - "molten.autogenerated", - new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(), - (short) color.getAlpha() }); - GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), Name); - FluidRegistry.registerFluid(f); - return f; + return GT_FluidFactory.builder(Name).withTextureName("molten.autogenerated") + .withColorRGBA( + new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(), + (short) color.getAlpha() }) + .withStateAndTemperature(FluidState.LIQUID, 300).buildAndRegister().asFluid(); } public static Fluid createAndRegisterFluid(String Name, Color color, int temperature) { - Fluid f = new GT_Fluid( - Name, - "molten.autogenerated", - new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(), - (short) color.getAlpha() }); - GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), Name); - f.setTemperature(temperature); - FluidRegistry.registerFluid(f); - return f; + return GT_FluidFactory.builder(Name).withTextureName("molten.autogenerated") + .withColorRGBA( + new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(), + (short) color.getAlpha() }) + .withStateAndTemperature(FluidState.LIQUID, temperature).buildAndRegister().asFluid(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 48e178bc73..50f5fa6b76 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -283,15 +283,15 @@ public class ItemRegistry { "Electric Implosion Compressor").getStackForm(1L); // EIC depend on neutronium block to pass on structure updates - int bitmask = GregTech_API.sMachineIDs.getOrDefault(GregTech_API.sBlockMetal5, 0) | (1 << 2); + int bitmask = GregTech_API.sMachineIDs.getOrDefault(GregTech_API.sBlockMetal5, 0) | 1 << 2; GregTech_API.registerMachineBlock(GregTech_API.sBlockMetal5, bitmask); // Also spacetime, transcendent metal, and universium - bitmask = GregTech_API.sMachineIDs.getOrDefault(GregTech_API.sBlockMetal9, 0) | (1 << 3) | (1 << 4) | (1 << 8); + bitmask = GregTech_API.sMachineIDs.getOrDefault(GregTech_API.sBlockMetal9, 0) | 1 << 3 | 1 << 4 | 1 << 8; GregTech_API.registerMachineBlock(GregTech_API.sBlockMetal9, bitmask); // Also infinity - bitmask = GregTech_API.sMachineIDs.getOrDefault(LudicrousBlocks.resource_block, 0) | (1 << 1); + bitmask = GregTech_API.sMachineIDs.getOrDefault(LudicrousBlocks.resource_block, 0) | 1 << 1; GregTech_API.registerMachineBlock(LudicrousBlocks.resource_block, bitmask); ItemRegistry.THTR = new GT_TileEntity_THTR( @@ -422,31 +422,34 @@ public class ItemRegistry { for (int amps = 32; amps <= 128; amps += 32) { for (int tier = 4; tier < 8; tier++) { TecTechLaserAdditions[0][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserBox( - startID++, + startID, GT_Values.VN[tier] + "_LPLaser_Converter_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Converter", tier, amps).getStackForm(1L); + startID++; } } for (int amps = 32; amps <= 128; amps += 32) { for (int tier = 4; tier < 8; tier++) { TecTechLaserAdditions[1][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserHatch( - startID++, + startID, GT_Values.VN[tier] + "_LPLaser_Hatch_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Target Hatch", tier, amps).getStackForm(1L); + startID++; } } for (int amps = 32; amps <= 128; amps += 32) { for (int tier = 4; tier < 8; tier++) { TecTechLaserAdditions[2][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserDynamo( - startID++, + startID, GT_Values.VN[tier] + "_LPLaser_Dynamo_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Source Hatch", tier, amps).getStackForm(1L); + startID++; } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java index 41fc6c8a23..9a3ade059e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java @@ -42,9 +42,8 @@ public class RadioHatchMaterialLoader { } } - Materials[] spacialMaterial = new Materials[] { Materials.Naquadah, Materials.NaquadahEnriched, - Materials.Naquadria }; - int[] spacialValue = new int[] { 130, 140, 150 }; + Materials[] spacialMaterial = { Materials.Naquadah, Materials.NaquadahEnriched, Materials.Naquadria }; + int[] spacialValue = { 130, 140, 150 }; for (int i = 0; i < spacialMaterial.length; i++) { if (GT_OreDictUnificator.get(OrePrefixes.stick, spacialMaterial[i], 1) != null) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 3b145cad5e..0cba765189 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -30,7 +30,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.stream.Collectors; +import java.util.Set; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -45,7 +45,6 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; -import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.bartworks.util.StreamUtils; import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; @@ -109,7 +108,7 @@ public class StaticRecipeChangeLoaders { public static void fixEnergyRequirements() { GT_Recipe.GT_Recipe_Map.sMappings.stream().filter(StreamUtils::filterVisualMaps) .forEach(gt_recipe_map -> gt_recipe_map.mRecipeList.parallelStream().forEach(gt_recipe -> { - for (int i = 0; i < (VN.length - 1); i++) { + for (int i = 0; i < VN.length - 1; i++) { if (gt_recipe.mEUt > BW_Util.getMachineVoltageFromTier(i) && gt_recipe.mEUt <= BW_Util.getTierVoltage(i)) { gt_recipe.mEUt = BW_Util.getMachineVoltageFromTier(i); @@ -217,15 +216,14 @@ public class StaticRecipeChangeLoaders { recipe.mOutputs[i] = GT_Utility .copyAmount(recipe.mOutputs[i].stackSize, replacement); } - if (recipe.mSpecialItems instanceof ItemStack) { - ItemStack specialItemStack = (ItemStack) recipe.mSpecialItems; + if (recipe.mSpecialItems instanceof ItemStack specialItemStack) { if (!GT_Utility.areStacksEqual(specialItemStack, toReplace)) continue; if (removal) { iterator.remove(); continue nextRecipe; } recipe.mSpecialItems = GT_Utility - .copyAmount((specialItemStack).stackSize, replacement); + .copyAmount(specialItemStack.stackSize, replacement); } } } @@ -235,7 +233,6 @@ public class StaticRecipeChangeLoaders { } } - @SuppressWarnings("ALL") private static void runMoltenUnificationEnfocement(Werkstoff werkstoff) { if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.hasItemType(OrePrefixes.cellMolten)) { try { @@ -245,52 +242,52 @@ public class StaticRecipeChangeLoaders { Materials.Empty.getCells(1)); Field f = GT_Utility.class.getDeclaredField("sFilledContainerToData"); f.setAccessible(true); + @SuppressWarnings("unchecked") Map sFilledContainerToData = (Map) f .get(null); - HashSet torem = new HashSet<>(); + Set> toremFilledContainerToData = new HashSet<>(); ItemStack toReplace = null; for (Map.Entry entry : sFilledContainerToData .entrySet()) { final String MODID = GameRegistry.findUniqueIdentifierFor(data.filledContainer.getItem()).modId; - if (MODID.equals(MainMod.MOD_ID) || MODID.equals(BartWorksCrossmod.MOD_ID)) continue; + if (MainMod.MOD_ID.equals(MODID) || BartWorksCrossmod.MOD_ID.equals(MODID)) continue; if (entry.getValue().fluid.equals(data.fluid) && !entry.getValue().filledContainer.equals(data.filledContainer)) { toReplace = entry.getValue().filledContainer; - torem.add(entry); + toremFilledContainerToData.add(entry); } } - sFilledContainerToData.entrySet().removeAll(torem); - torem.clear(); + sFilledContainerToData.entrySet().removeAll(toremFilledContainerToData); + Set toremRecipeList = new HashSet<>(); if (toReplace != null) { for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - torem.clear(); + toremRecipeList.clear(); for (GT_Recipe recipe : map.mRecipeList) { - for (int i = 0; i < recipe.mInputs.length; i++) { - if (GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) { - torem.add(recipe); + for (ItemStack mInput : recipe.mInputs) { + if (GT_Utility.areStacksEqual(mInput, toReplace)) { + toremRecipeList.add(recipe); // recipe.mInputs[i] = data.filledContainer; } } - for (int i = 0; i < recipe.mOutputs.length; i++) { - if (GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) { - torem.add(recipe); + for (ItemStack mOutput : recipe.mOutputs) { + if (GT_Utility.areStacksEqual(mOutput, toReplace)) { + toremRecipeList.add(recipe); // recipe.mOutputs[i] = data.filledContainer; if (map == GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes - && GT_Utility.areStacksEqual(recipe.mOutputs[i], data.filledContainer) + && GT_Utility.areStacksEqual(mOutput, data.filledContainer) && !recipe.mFluidInputs[0].equals(data.fluid)) { - torem.add(recipe); + toremRecipeList.add(recipe); // recipe.mOutputs[i] = data.filledContainer; } } } - if (recipe.mSpecialItems instanceof ItemStack) { - if (GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) { - torem.add(recipe); - // recipe.mSpecialItems = data.filledContainer; - } + if (recipe.mSpecialItems instanceof ItemStack + && GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) { + toremRecipeList.add(recipe); + // recipe.mSpecialItems = data.filledContainer; } } - map.mRecipeList.removeAll(torem); + map.mRecipeList.removeAll(toremRecipeList); } } GT_Utility.addFluidContainerData(data); @@ -301,12 +298,11 @@ public class StaticRecipeChangeLoaders { } private static void runUnficationDeleter(Werkstoff werkstoff) { - if (werkstoff.getType() == Werkstoff.Types.ELEMENT) { - if (werkstoff.getBridgeMaterial() != null && Element.get(werkstoff.getToolTip()) != Element._NULL) { - werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip()); - Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>(); - Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial()); - } + if (werkstoff.getType() == Werkstoff.Types.ELEMENT && werkstoff.getBridgeMaterial() != null + && Element.get(werkstoff.getToolTip()) != Element._NULL) { + werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip()); + Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>(); + Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial()); } for (OrePrefixes prefixes : OrePrefixes.values()) if (werkstoff.hasItemType(prefixes)) { @@ -319,12 +315,11 @@ public class StaticRecipeChangeLoaders { } private static void runMaterialLinker(Werkstoff werkstoff) { - if (werkstoff.getType() == Werkstoff.Types.ELEMENT) { - if (werkstoff.getBridgeMaterial() != null && Element.get(werkstoff.getToolTip()) != Element._NULL) { - werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip()); - Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>(); - Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial()); - } + if (werkstoff.getType() == Werkstoff.Types.ELEMENT && werkstoff.getBridgeMaterial() != null + && Element.get(werkstoff.getToolTip()) != Element._NULL) { + werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip()); + Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>(); + Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial()); } for (OrePrefixes prefixes : OrePrefixes.values()) @@ -379,14 +374,13 @@ public class StaticRecipeChangeLoaders { if ((recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) && (whitelistForEBFNoGasRecipeDontCheckItemData.stream() .anyMatch(s -> GT_Utility.areStacksEqual(s, tmpInput)) - || (BW_Util.checkStackAndPrefix(recipe.mInputs[i]) + || BW_Util.checkStackAndPrefix(recipe.mInputs[i]) && BW_Util.checkStackAndPrefix(baseRe.mInputs[i]) && GT_OreDictUnificator .getAssociation(recipe.mInputs[i]).mMaterial.mMaterial.equals( GT_OreDictUnificator.getAssociation( baseRe.mInputs[i]).mMaterial.mMaterial) - && GT_Utility - .areStacksEqual(recipe.mOutputs[0], baseRe.mOutputs[0])))) { + && GT_Utility.areStacksEqual(recipe.mOutputs[0], baseRe.mOutputs[0]))) { toAdd.add(recipe.mOutputs[0]); repToAdd.put(tag, recipe); continue recipeLoop; @@ -399,9 +393,8 @@ public class StaticRecipeChangeLoaders { } private static int transformEBFGasRecipeTime(int originalDuration, long originalGasProtons, long newGasProtons) { - double protonTerm = (double) originalGasProtons * (newGasProtons >= originalGasProtons ? 1.0D : 2.75D) - - (double) newGasProtons; - return Math.max(1, (int) ((double) originalDuration / 200D * Math.max(200D + protonTerm, 1D))); + double protonTerm = originalGasProtons * (newGasProtons >= originalGasProtons ? 1.0D : 2.75D) - newGasProtons; + return Math.max(1, (int) (originalDuration / 200D * Math.max(200D + protonTerm, 1D))); } private static int transformEBFGasRecipeTime(GT_Recipe recipe, Materials originalGas, Materials newGas) { @@ -409,9 +402,8 @@ public class StaticRecipeChangeLoaders { double originalEbfMul = gtEbfGasRecipeTimeMultipliers.get(originalGas); if (newEbfMul < 0.0D || originalEbfMul < 0.0D) { return transformEBFGasRecipeTime(recipe.mDuration, originalGas.getProtons(), newGas.getProtons()); - } else { - return Math.max(1, (int) ((double) recipe.mDuration * newEbfMul / originalEbfMul)); } + return Math.max(1, (int) (recipe.mDuration * newEbfMul / originalEbfMul)); } private static int transformEBFGasRecipeTime(GT_Recipe recipe, Materials originalGas, Werkstoff newGas) { @@ -422,9 +414,8 @@ public class StaticRecipeChangeLoaders { recipe.mDuration, originalGas.getProtons(), newGas.getStats().getProtons()); - } else { - return Math.max(1, (int) ((double) recipe.mDuration * newEbfMul / originalEbfMul)); } + return Math.max(1, (int) (recipe.mDuration * newEbfMul / originalEbfMul)); } private static int transformEBFNoGasRecipeTime(GT_Recipe recipe, Materials originalGas) { @@ -439,8 +430,7 @@ public class StaticRecipeChangeLoaders { int gasAmount = Math.max( 1, (int) Math.round( - (double) recipe.mFluidInputs[0].amount - * gtEbfGasRecipeConsumptionMultipliers.get(newGas))); + recipe.mFluidInputs[0].amount * gtEbfGasRecipeConsumptionMultipliers.get(newGas))); if (recipe.mFluidInputs != null && recipe.mFluidInputs.length == 1 && recipe.mFluidInputs[0].isFluidEqual(newGas.getGas(0))) { // preserve original recipe owner @@ -484,7 +474,7 @@ public class StaticRecipeChangeLoaders { int gasAmount = Math.max( 1, (int) Math.round( - (double) recipe.mFluidInputs[0].amount + recipe.mFluidInputs[0].amount * newGas.getStats().getEbfGasRecipeConsumedAmountMultiplier())); if (recipe.mFluidInputs != null && recipe.mFluidInputs.length == 1 && recipe.mFluidInputs[0] @@ -535,10 +525,12 @@ public class StaticRecipeChangeLoaders { && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(14), stack) && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(19), stack)) { if (BW_Util.checkStackAndPrefix(stack)) - circuitConfiguration = (byte) (GT_OreDictUnificator.getAssociation(stack).mPrefix - .equals(OrePrefixes.dustSmall) ? 4 - : GT_OreDictUnificator.getAssociation(stack).mPrefix - .equals(OrePrefixes.dustTiny) ? 9 : 1); + circuitConfiguration = (byte) (OrePrefixes.dustSmall + .equals(GT_OreDictUnificator.getAssociation(stack).mPrefix) + ? 4 + : OrePrefixes.dustTiny.equals( + GT_OreDictUnificator.getAssociation(stack).mPrefix) ? 9 + : 1); inputs.add(stack); } inputs.add(GT_Utility.getIntegratedCircuit(circuitConfiguration)); @@ -635,130 +627,9 @@ public class StaticRecipeChangeLoaders { } private static boolean checkForExplosives(ItemStack input) { - return (GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt)) + return GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L)) - || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); - } - - private static int getBlastLogic(GT_Recipe recipe) { - int ret = 0; - - for (ItemStack stack : recipe.mInputs) { - if (stack != null) { - ret += Math.max(stack.stackSize, 1); - } - } - - while (ret > 14) { - ret /= 10; - } - - if (recipe.mFluidInputs.length != 0) ret += 10; - - return ret; - } - - private static int getLogicFuntion(GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe, - Pair counts) { - if (gt_recipe_map == GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) - return getChemicalLogic(recipe, counts); - else if (gt_recipe_map == GT_Recipe.GT_Recipe_Map.sBlastRecipes) return getBlastLogic(recipe); - throw new NoSuchMethodError("Could not find a Supported Method for " + gt_recipe_map.mUnlocalizedName); - } - - private static int getChemicalLogic(GT_Recipe recipe, Pair counts) { - Pair toSet; - - if (counts.getKey() == 0 || counts.getValue() == 0) - toSet = new Pair<>(Math.max(recipe.mFluidOutputs.length, recipe.mOutputs.length), 0); - else if (counts.getValue() > 2) toSet = new Pair<>(counts.getKey() + counts.getValue(), 1); - else toSet = counts; - - return toSet.getValue() * 10 + toSet.getKey(); - } - - private static void transformCircuitRecipes(GT_Recipe.GT_Recipe_Map gtRecipeMap, - Map> mapGtRecipeCounts) { - mapGtRecipeCounts.forEach( - (recipe, counts) -> StaticRecipeChangeLoaders.rewriteForCorrectCircuit(gtRecipeMap, recipe, counts)); - - gtRecipeMap.mRecipeList.clear(); - gtRecipeMap.mRecipeList.addAll(mapGtRecipeCounts.keySet()); - - fixRecipeClashes(gtRecipeMap); - } - - private static void fixRecipeClashes(GT_Recipe.GT_Recipe_Map gtRecipeMap) { - boolean hasClashes; - do { - hasClashes = false; - gtRecipeMap.reInit(); - for (GT_Recipe re : gtRecipeMap.mRecipeList) { - if (gtRecipeMap.findRecipe(null, false, Long.MAX_VALUE, re.mFluidInputs, re.mInputs) != re) { - hasClashes = true; - fixRecipeCircuitClashes(re); - } - } - } while (hasClashes); - } - - private static void fixRecipeCircuitClashes(GT_Recipe recipe) { - for (int i = 0; i < recipe.mInputs.length; i++) { - if (GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(Short.MAX_VALUE), recipe.mInputs[i])) { - int nudmg = recipe.mInputs[i].getItemDamage() + 1 > 24 ? 1 : recipe.mInputs[i].getItemDamage() + 1; - recipe.mInputs[i].setItemDamage(nudmg); - } - } - } - - private static Map>> getRecipesByCircuitID( - GT_Recipe.GT_Recipe_Map[] ref) { - return Arrays.stream(ref).collect( - Collectors.toMap( - k -> k, - k -> getArrayListMultiMapFromRecipeList(gatherNoCircuitRecipes(new HashSet<>(k.mRecipeList))))); - } - - private static GT_Recipe rewriteForCorrectCircuit(GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe, - Pair counts) { - ItemStack[] old = BW_Util.copyAndRemoveNulls(recipe.mInputs, ItemStack.class); - ItemStack[] nu = Arrays.copyOf(old, old.length + 1); - - nu[old.length] = GT_Utility.getIntegratedCircuit( // Max 24, Min 1 - Math.min(Math.max(getLogicFuntion(gt_recipe_map, recipe, counts), 1), 24)); - recipe.mInputs = nu; - - return recipe; - } - - @SuppressWarnings("unchecked") - private static Collection gatherNoCircuitRecipes(Collection mRecipeList) { - Collection newColl; - try { - newColl = (Collection) mRecipeList.getClass().newInstance(); - } catch (InstantiationException | IllegalAccessException e) { - newColl = new HashSet<>(); - } - - recipeloop: for (GT_Recipe r : mRecipeList) { - for (int i = 0; i < r.mInputs.length; i++) - if (GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(Short.MAX_VALUE), r.mInputs[i])) { - continue recipeloop; - } - newColl.add(r); - } - - return newColl; - } - - private static Map> getArrayListMultiMapFromRecipeList( - Collection mRecipeList) { - return mRecipeList.stream().collect( - Collectors.toMap( - recipe -> recipe, - recipe -> new Pair<>( - (int) Arrays.stream(recipe.mInputs).filter(Objects::nonNull).count(), - (int) Arrays.stream(recipe.mFluidInputs).filter(Objects::nonNull).count()))); + || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java index 833c3c647a..4b676367cf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java @@ -173,7 +173,6 @@ public class Assembler implements Runnable { ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1))).itemOutputs(converter) .fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) .duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption).addTo(sAssemblerRecipes); - GT_Values.RA.stdBuilder() .itemInputs( new ItemStack( @@ -182,6 +181,21 @@ public class Assembler implements Runnable { ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + emitters[i].get(2 * (j + 1)), + sensors[i].get(2 * (j + 1)), + ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1))) + .itemOutputs(converter).fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) + .noFluidOutputs().duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption) + .addTo(sAssemblerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs( + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + (j + 1) * 16, + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), sensors[i].get(2 * (j + 1)), ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1))) .itemOutputs(eInput).fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) @@ -191,7 +205,7 @@ public class Assembler implements Runnable { .itemInputs( new ItemStack( ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - ((j + 1) * 16), + (j + 1) * 16, ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java index c36b0a6127..3ee15f52da 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java @@ -443,12 +443,12 @@ public class CraftingRecipes implements Runnable { for (int i = 3; i < GT_Values.VN.length - 1; i++) { // 12625 - BioLab2[(i - 3)] = new GT_MetaTileEntity_BioLab( + BioLab2[i - 3] = new GT_MetaTileEntity_BioLab( ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i, "bw.biolab" + GT_Values.VN[i], GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.biolab.name"), i).getStackForm(1L); - RadioHatch2[(i - 3)] = new GT_MetaTileEntity_RadioHatch( + RadioHatch2[i - 3] = new GT_MetaTileEntity_RadioHatch( ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i, "bw.radiohatch" + GT_Values.VN[i], GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.radiohatch.name"), @@ -456,21 +456,21 @@ public class CraftingRecipes implements Runnable { try { ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); GT_ModHandler.addCraftingRecipe( - BioLab2[(i - 3)], + BioLab2[i - 3], RecipeLoader.BITSD, new Object[] { "PFP", "WCW", "OGO", 'F', - GT_OreDictUnificator.get(OrePrefixes.frameGt, hulls2[(i - 3)], 1L), 'W', - GT_OreDictUnificator.get(OrePrefixes.wireGt01, wireMat2[(i - 3)], 1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.frameGt, hulls2[i - 3], 1L), 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt01, wireMat2[i - 3], 1L), 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G', - "circuit" + circuits2[(i - 3)], 'C', machinehull }); + "circuit" + circuits2[i - 3], 'C', machinehull }); GT_ModHandler.addCraftingRecipe( - RadioHatch2[(i - 3)], + RadioHatch2[i - 3], RecipeLoader.BITSD, new Object[] { "DPD", "DCD", "DKD", 'D', GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), 'C', machinehull, - 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cables2[(i - 3)], 1L), 'P', - Pistons2[(i - 3)] }); + 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cables2[i - 3], 1L), 'P', + Pistons2[i - 3] }); } catch (ArrayIndexOutOfBoundsException ignored) { } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index 14dcd3006c..e5ae3c8994 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -34,6 +34,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.server.FMLServerHandler; import gregtech.api.enums.GT_Values; import gregtech.api.net.GT_Packet; +import gregtech.api.net.GT_Packet_New; import gregtech.api.net.IGT_NetworkHandler; import io.netty.buffer.Unpooled; import io.netty.channel.ChannelHandler; @@ -44,73 +45,77 @@ import io.netty.handler.codec.MessageToMessageCodec; /* * Original GT File slightly Modified */ -@SuppressWarnings("ALL") +@SuppressWarnings("deprecation") @ChannelHandler.Sharable -public class BW_Network extends MessageToMessageCodec implements IGT_NetworkHandler { +public class BW_Network extends MessageToMessageCodec implements IGT_NetworkHandler { private final EnumMap mChannel; - private final GT_Packet[] mSubChannels; + private final GT_Packet_New[] mSubChannels; public BW_Network() { this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", this, new BW_Network.HandlerShared()); - this.mSubChannels = new GT_Packet[] { new RendererPacket(), new CircuitProgrammerPacket(), + this.mSubChannels = new GT_Packet_New[] { new RendererPacket(), new CircuitProgrammerPacket(), new MetaBlockPacket(), new OreDictCachePacket(), new ServerJoinedPackage(), new EICPacket() }; } - protected void encode(ChannelHandlerContext aContext, GT_Packet aPacket, List aOutput) throws Exception { + @Override + protected void encode(ChannelHandlerContext aContext, GT_Packet_New aPacket, List aOutput) + throws Exception { aOutput.add( new FMLProxyPacket( Unpooled.buffer().writeByte(aPacket.getPacketID()).writeBytes(aPacket.encode()).copy(), - (String) aContext.channel().attr(NetworkRegistry.FML_CHANNEL).get())); + aContext.channel().attr(NetworkRegistry.FML_CHANNEL).get())); } + @Override protected void decode(ChannelHandlerContext aContext, FMLProxyPacket aPacket, List aOutput) throws Exception { ByteArrayDataInput aData = ByteStreams.newDataInput(aPacket.payload().array()); aOutput.add(this.mSubChannels[aData.readByte()].decode(aData)); } + @Override public void sendToPlayer(@Nonnull GT_Packet aPacket, @Nonnull EntityPlayerMP aPlayer) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET) + this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) .set(FMLOutboundHandler.OutboundTarget.PLAYER); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) - .set(aPlayer); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket); + this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPlayer); + this.mChannel.get(Side.SERVER).writeAndFlush(aPacket); } public void sendToAllPlayersinWorld(@Nonnull GT_Packet aPacket, World world) { for (String name : FMLServerHandler.instance().getServer().getAllUsernames()) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET) + this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) .set(FMLOutboundHandler.OutboundTarget.PLAYER); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) + this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) .set(world.getPlayerEntityByName(name)); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket); + this.mChannel.get(Side.SERVER).writeAndFlush(aPacket); } } + @Override public void sendToAllAround(@Nonnull GT_Packet aPacket, NetworkRegistry.TargetPoint aPosition) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET) + this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) .set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) - .set(aPosition); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket); + this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPosition); + this.mChannel.get(Side.SERVER).writeAndFlush(aPacket); } + @Override public void sendToServer(@Nonnull GT_Packet aPacket) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.CLIENT)).attr(FMLOutboundHandler.FML_MESSAGETARGET) + this.mChannel.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET) .set(FMLOutboundHandler.OutboundTarget.TOSERVER); - ((FMLEmbeddedChannel) this.mChannel.get(Side.CLIENT)).writeAndFlush(aPacket); + this.mChannel.get(Side.CLIENT).writeAndFlush(aPacket); } + @Override public void sendPacketToAllPlayersInRange(World aWorld, @Nonnull GT_Packet aPacket, int aX, int aZ) { if (!aWorld.isRemote) { for (Object tObject : aWorld.playerEntities) { - if (!(tObject instanceof EntityPlayerMP)) { + if (!(tObject instanceof EntityPlayerMP tPlayer)) { break; } - EntityPlayerMP tPlayer = (EntityPlayerMP) tObject; Chunk tChunk = aWorld.getChunkFromBlockCoords(aX, aZ); if (tPlayer.getServerForPlayer().getPlayerManager() .isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { @@ -121,11 +126,12 @@ public class BW_Network extends MessageToMessageCodec } @Sharable - static final class HandlerShared extends SimpleChannelInboundHandler { + static final class HandlerShared extends SimpleChannelInboundHandler { HandlerShared() {} - protected void channelRead0(ChannelHandlerContext ctx, GT_Packet aPacket) throws Exception { + @Override + protected void channelRead0(ChannelHandlerContext ctx, GT_Packet_New aPacket) throws Exception { EntityPlayer aPlayer = GT_Values.GT.getThePlayer(); aPacket.process(aPlayer == null ? null : GT_Values.GT.getThePlayer().worldObj); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java index a53cd1128a..0ab6e42e91 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java @@ -13,8 +13,6 @@ package com.github.bartimaeusnek.bartworks.common.net; -import java.nio.ByteBuffer; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -26,9 +24,10 @@ import net.minecraftforge.common.DimensionManager; import com.github.bartimaeusnek.bartworks.common.items.Circuit_Programmer; import com.google.common.io.ByteArrayDataInput; -import gregtech.api.net.GT_Packet; +import gregtech.api.net.GT_Packet_New; +import io.netty.buffer.ByteBuf; -public class CircuitProgrammerPacket extends GT_Packet { +public class CircuitProgrammerPacket extends GT_Packet_New { private int dimID, playerID; private byte chipCfg; @@ -52,20 +51,17 @@ public class CircuitProgrammerPacket extends GT_Packet { } @Override - public byte[] encode() { - return ByteBuffer.allocate(9).putInt(0, this.dimID).putInt(4, this.playerID) - .put(8, (this.hasChip ? this.chipCfg : -1)).array(); + public void encode(ByteBuf aOut) { + aOut.writeInt(this.dimID).writeInt(this.playerID).writeByte(this.hasChip ? this.chipCfg : -1); } @Override - public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { - byte[] ret = new byte[9]; - byteArrayDataInput.readFully(ret); + public GT_Packet_New decode(ByteArrayDataInput byteArrayDataInput) { return new CircuitProgrammerPacket( - ByteBuffer.wrap(ret).getInt(0), - ByteBuffer.wrap(ret).getInt(4), - ByteBuffer.wrap(ret).get(8) > -1, - ByteBuffer.wrap(ret).get(8)); + byteArrayDataInput.readInt(), + byteArrayDataInput.readInt(), + byteArrayDataInput.readByte() > -1, + byteArrayDataInput.readByte()); } @Override @@ -73,7 +69,7 @@ public class CircuitProgrammerPacket extends GT_Packet { World w = DimensionManager.getWorld(this.dimID); if (w != null && w.getEntityByID(this.playerID) instanceof EntityPlayer) { ItemStack stack = ((EntityPlayer) w.getEntityByID(this.playerID)).getHeldItem(); - if ((stack != null) && (stack.stackSize > 0)) { + if (stack != null && stack.stackSize > 0) { Item item = stack.getItem(); if (item instanceof Circuit_Programmer) { NBTTagCompound nbt = stack.getTagCompound(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EICPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EICPacket.java index 95a79e9344..621cc3fe4f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EICPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/EICPacket.java @@ -35,10 +35,10 @@ public class EICPacket extends GT_Packet_New { @Override public void encode(ByteBuf aOut) { - aOut.writeInt(coords.x); - aOut.writeInt(coords.y); - aOut.writeInt(coords.z); - aOut.writeBoolean(bool); + aOut.writeInt(this.coords.x); + aOut.writeInt(this.coords.y); + aOut.writeInt(this.coords.z); + aOut.writeBoolean(this.bool); } @Override @@ -49,11 +49,12 @@ public class EICPacket extends GT_Packet_New { @Override public void process(IBlockAccess aWorld) { if (SideReference.Side.Client) { - TileEntity te = aWorld.getTileEntity(coords.x, coords.y, coords.z); + TileEntity te = aWorld.getTileEntity(this.coords.x, this.coords.y, this.coords.z); if (!(te instanceof IGregTechTileEntity)) return; IMetaTileEntity mte = ((IGregTechTileEntity) te).getMetaTileEntity(); if (!(mte instanceof GT_TileEntity_ElectricImplosionCompressor)) return; - if (bool && !((IGregTechTileEntity) te).hasMufflerUpgrade()) ((IGregTechTileEntity) te).addMufflerUpgrade(); + if (this.bool && !((IGregTechTileEntity) te).hasMufflerUpgrade()) + ((IGregTechTileEntity) te).addMufflerUpgrade(); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java index 38fdf5ee9f..631021a299 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java @@ -24,9 +24,10 @@ import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block import com.github.bartimaeusnek.bartworks.util.MurmurHash3; import com.google.common.io.ByteArrayDataInput; -import gregtech.api.net.GT_Packet; +import gregtech.api.net.GT_Packet_New; +import io.netty.buffer.ByteBuf; -public class MetaBlockPacket extends GT_Packet { +public class MetaBlockPacket extends GT_Packet_New { int x; short y; @@ -51,27 +52,23 @@ public class MetaBlockPacket extends GT_Packet { } @Override - public byte[] encode() { + public void encode(ByteBuf aOut) { int hash = MurmurHash3.murmurhash3_x86_32( ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), 0, 12, 31); - return ByteBuffer.allocate(16).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).putInt(hash) - .array(); + aOut.writeInt(this.x).writeInt(this.z).writeShort(this.y).writeShort(this.meta).writeInt(hash); } @Override - public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { - byte[] tmp = new byte[16]; - byteArrayDataInput.readFully(tmp); - ByteBuffer buff = ByteBuffer.wrap(tmp); - this.x = buff.getInt(); - this.z = buff.getInt(); - this.y = buff.getShort(); - this.meta = buff.getShort(); + public GT_Packet_New decode(ByteArrayDataInput byteArrayDataInput) { + this.x = byteArrayDataInput.readInt(); + this.z = byteArrayDataInput.readInt(); + this.y = byteArrayDataInput.readShort(); + this.meta = byteArrayDataInput.readShort(); MetaBlockPacket todecode = new MetaBlockPacket(this.x, this.y, this.z, this.meta); - if (buff.getInt() != MurmurHash3.murmurhash3_x86_32( + if (byteArrayDataInput.readInt() != MurmurHash3.murmurhash3_x86_32( ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), 0, 12, @@ -86,10 +83,10 @@ public class MetaBlockPacket extends GT_Packet { public void process(IBlockAccess iBlockAccess) { if (iBlockAccess != null) { TileEntity tTileEntity = iBlockAccess.getTileEntity(this.x, this.y, this.z); - if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) { + if (tTileEntity instanceof BW_MetaGenerated_Block_TE) { ((BW_MetaGenerated_Block_TE) tTileEntity).mMetaData = this.meta; } - if (((iBlockAccess instanceof World)) && (((World) iBlockAccess).isRemote)) { + if (iBlockAccess instanceof World && ((World) iBlockAccess).isRemote) { ((World) iBlockAccess).markBlockForUpdate(this.x, this.y, this.z); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java index 5e03bf53d5..3ae70af18b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java @@ -13,7 +13,6 @@ package com.github.bartimaeusnek.bartworks.common.net; -import java.nio.ByteBuffer; import java.util.HashSet; import net.minecraft.world.IBlockAccess; @@ -22,9 +21,10 @@ import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.Pair; import com.google.common.io.ByteArrayDataInput; -import gregtech.api.net.GT_Packet; +import gregtech.api.net.GT_Packet_New; +import io.netty.buffer.ByteBuf; -public class OreDictCachePacket extends GT_Packet { +public class OreDictCachePacket extends GT_Packet_New { private HashSet> hashSet = new HashSet<>(); @@ -43,15 +43,16 @@ public class OreDictCachePacket extends GT_Packet { } @Override - public byte[] encode() { + public void encode(ByteBuf aOut) { int size = this.hashSet.size(); - ByteBuffer buff = ByteBuffer.allocate(4 + size * 4 + size * 2).putInt(size); - for (Pair p : this.hashSet) buff.putInt(p.getKey()).putShort(p.getValue()); - return buff.array(); + aOut.writeInt(size); + for (Pair p : this.hashSet) { + aOut.writeInt(p.getKey()).writeShort(p.getValue()); + } } @Override - public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { + public GT_Packet_New decode(ByteArrayDataInput byteArrayDataInput) { int size = byteArrayDataInput.readInt(); for (int i = 0; i < size; i++) { this.hashSet.add(new Pair<>(byteArrayDataInput.readInt(), byteArrayDataInput.readShort())); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java index c1dce75908..952a3eeeb3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -13,8 +13,6 @@ package com.github.bartimaeusnek.bartworks.common.net; -import java.nio.ByteBuffer; - import net.minecraft.world.IBlockAccess; import com.github.bartimaeusnek.bartworks.API.SideReference; @@ -24,9 +22,10 @@ import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.Coords; import com.google.common.io.ByteArrayDataInput; -import gregtech.api.net.GT_Packet; +import gregtech.api.net.GT_Packet_New; +import io.netty.buffer.ByteBuf; -public class RendererPacket extends GT_Packet { +public class RendererPacket extends GT_Packet_New { private Coords coords; private int integer; @@ -49,36 +48,26 @@ public class RendererPacket extends GT_Packet { } @Override - public byte[] encode() { + public void encode(ByteBuf aOut) { - byte r = (byte) (((this.integer >> 16) & 0xFF) + Byte.MIN_VALUE); - byte g = (byte) (((this.integer >> 8) & 0xFF) + Byte.MIN_VALUE); - byte b = (byte) (((this.integer) & 0xFF) + Byte.MIN_VALUE); + byte r = (byte) ((this.integer >> 16 & 0xFF) + Byte.MIN_VALUE); + byte g = (byte) ((this.integer >> 8 & 0xFF) + Byte.MIN_VALUE); + byte b = (byte) ((this.integer & 0xFF) + Byte.MIN_VALUE); byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25 + this.coords.z % 25 + this.coords.wID % 25 + this.integer % 25 + this.removal); - return ByteBuffer.allocate(19).putInt(0, this.coords.x).putShort(4, this.coords.y).putInt(6, this.coords.z) - .putInt(10, this.coords.wID).put(14, r).put(15, g).put(16, b).put(17, this.removal).put(18, checksum) - .array(); + aOut.writeInt(this.coords.x).writeShort(this.coords.y).writeInt(this.coords.z).writeInt(this.coords.wID) + .writeByte(r).writeByte(g).writeByte(b).writeByte(this.removal).writeByte(checksum); } @Override - public GT_Packet decode(ByteArrayDataInput dataInput) { - - byte[] buffer = new byte[19]; - dataInput.readFully(buffer); - - this.coords = new Coords( - ByteBuffer.wrap(buffer).getInt(0), - ByteBuffer.wrap(buffer).getShort(4), - ByteBuffer.wrap(buffer).getInt(6), - ByteBuffer.wrap(buffer).getInt(10)); - int[] rgb = { ByteBuffer.wrap(buffer).get(14) - Byte.MIN_VALUE, - ByteBuffer.wrap(buffer).get(15) - Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(16) - Byte.MIN_VALUE }; - this.integer = BW_ColorUtil.getColorFromRGBArray(rgb); - this.removal = ByteBuffer.wrap(buffer).get(17); + public GT_Packet_New decode(ByteArrayDataInput dataInput) { + this.coords = new Coords(dataInput.readInt(), dataInput.readShort(), dataInput.readInt(), dataInput.readInt()); + this.integer = BW_ColorUtil.getColorFromRGBArray( + new int[] { dataInput.readUnsignedByte(), dataInput.readUnsignedByte(), dataInput.readUnsignedByte() }); + this.removal = dataInput.readByte(); byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25 + this.coords.z % 25 @@ -86,7 +75,7 @@ public class RendererPacket extends GT_Packet { + this.integer % 25 + this.removal); - if (checksum != ByteBuffer.wrap(buffer).get(18)) { + if (checksum != dataInput.readByte()) { MainMod.LOGGER.error("BW Packet was corrupted or modified!"); return null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java index 84c3ba8939..3a6734d568 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java @@ -19,9 +19,10 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.google.common.io.ByteArrayDataInput; -import gregtech.api.net.GT_Packet; +import gregtech.api.net.GT_Packet_New; +import io.netty.buffer.ByteBuf; -public class ServerJoinedPackage extends GT_Packet { +public class ServerJoinedPackage extends GT_Packet_New { private byte config; @@ -41,12 +42,12 @@ public class ServerJoinedPackage extends GT_Packet { } @Override - public byte[] encode() { - return new byte[] { this.config }; + public void encode(ByteBuf aOut) { + aOut.writeByte(this.config); } @Override - public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { + public GT_Packet_New decode(ByteArrayDataInput byteArrayDataInput) { this.config = byteArrayDataInput.readByte(); return this; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java index a437dc8285..5db8989d0c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java @@ -29,6 +29,7 @@ public class BW_RotorBlock extends TileEntityWindKineticGenerator { return super.getKuOutput(); } + @Override public int getKuOutput() { return 0; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java index a04d70f6aa..9d6c03be7d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java @@ -33,7 +33,7 @@ import com.github.bartimaeusnek.bartworks.util.Coords; public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implements ITileAddsInformation { - private static final ForgeDirection[] allowed_directions = new ForgeDirection[] { DOWN, WEST, EAST, SOUTH, NORTH }; + private static final ForgeDirection[] allowed_directions = { DOWN, WEST, EAST, SOUTH, NORTH }; private PriorityQueue breadthFirstQueue = new PriorityQueue<>(Comparator.comparingInt(x -> x.y)); private boolean wasInited = false; @@ -47,26 +47,26 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem } public void initEntity() { - if (wasInited) return; - breadthFirstQueue.add(new Coords(this.xCoord, this.yCoord, this.zCoord)); - wasInited = true; + if (this.wasInited) return; + this.breadthFirstQueue.add(new Coords(this.xCoord, this.yCoord, this.zCoord)); + this.wasInited = true; } @Override public void updateEntity() { - initEntity(); - Coords current = breadthFirstQueue.poll(); + this.initEntity(); + Coords current = this.breadthFirstQueue.poll(); if (current == null) return; - setFluidBlock(current); + this.setFluidBlock(current); for (ForgeDirection allowed_direction : allowed_directions) { - addBlockToQueue(current, allowed_direction); + this.addBlockToQueue(current, allowed_direction); } } @Override public void writeToNBT(NBTTagCompound tag) { super.writeToNBT(tag); - tag.setBoolean("init", wasInited); + tag.setBoolean("init", this.wasInited); int[] x = new int[this.breadthFirstQueue.size()]; int[] y = new int[this.breadthFirstQueue.size()]; @@ -97,15 +97,16 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem } private void setFluidBlock(Coords current) { - if (!checkForAir(current)) return; - if (this.tank.drain(1000, false) == null || this.tank.drain(1000, false).amount != 1000) return; + if (!this.checkForAir(current) || this.tank.drain(1000, false) == null + || this.tank.drain(1000, false).amount != 1000) + return; FluidStack stack = this.tank.drain(1000, true); - worldObj.setBlock(current.x, current.y, current.z, stack.getFluid().getBlock(), 0, 2); + this.worldObj.setBlock(current.x, current.y, current.z, stack.getFluid().getBlock(), 0, 2); } private void addBlockToQueue(Coords current, ForgeDirection allowed_direction) { Coords side = current.getCoordsFromSide(allowed_direction); - if (checkForAir(side)) breadthFirstQueue.add(side); + if (this.checkForAir(side)) this.breadthFirstQueue.add(side); } private boolean checkForAir(Coords coords) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index c977453f68..98932b8d72 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -64,30 +64,30 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr public ItemStack fakestack = new ItemStack(Blocks.water); @Override - public void writeToNBT(NBTTagCompound p_145841_1_) { + public void writeToNBT(NBTTagCompound compound) { NBTTagCompound subItemStack = new NBTTagCompound(); if (this.fuelstack != null) { this.fuelstack.writeToNBT(subItemStack); } - p_145841_1_.setTag("ItemStack", subItemStack); + compound.setTag("ItemStack", subItemStack); NBTTagCompound subFluidStack = new NBTTagCompound(); this.outputstack.writeToNBT(subFluidStack); - p_145841_1_.setTag("FluidStack", subFluidStack); - p_145841_1_.setInteger("fuel", this.fuel); - p_145841_1_.setInteger("maxfuel", this.maxfuel); - p_145841_1_.setByte("tick", this.tick); - super.writeToNBT(p_145841_1_); + compound.setTag("FluidStack", subFluidStack); + compound.setInteger("fuel", this.fuel); + compound.setInteger("maxfuel", this.maxfuel); + compound.setByte("tick", this.tick); + super.writeToNBT(compound); } @Override - public void readFromNBT(NBTTagCompound p_145839_1_) { - this.tick = p_145839_1_.getByte("tick"); - this.fuel = p_145839_1_.getInteger("fuel"); - this.maxfuel = p_145839_1_.getInteger("maxfuel"); - this.outputstack = FluidStack.loadFluidStackFromNBT(p_145839_1_.getCompoundTag("FluidStack")); - if (!p_145839_1_.getCompoundTag("ItemStack").equals(new NBTTagCompound())) - this.fuelstack = ItemStack.loadItemStackFromNBT(p_145839_1_.getCompoundTag("ItemStack")); - super.readFromNBT(p_145839_1_); + public void readFromNBT(NBTTagCompound compound) { + this.tick = compound.getByte("tick"); + this.fuel = compound.getInteger("fuel"); + this.maxfuel = compound.getInteger("maxfuel"); + this.outputstack = FluidStack.loadFluidStackFromNBT(compound.getCompoundTag("FluidStack")); + if (!compound.getCompoundTag("ItemStack").equals(new NBTTagCompound())) + this.fuelstack = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("ItemStack")); + super.readFromNBT(compound); } private boolean checkPreUpdate() { @@ -111,7 +111,7 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr ++this.tick; --this.fuel; if (this.tick % 20 == 0) { - if (this.outputstack.amount <= (8000 - ConfigHandler.mbWaterperSec)) + if (this.outputstack.amount <= 8000 - ConfigHandler.mbWaterperSec) this.outputstack.amount += ConfigHandler.mbWaterperSec; this.tick = 0; } @@ -122,14 +122,14 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr public void updateEntity() { if (this.worldObj.isRemote) return; - pushWaterToAdjacentTiles(); - fakestack.setStackDisplayName(outputstack.amount + "L Water"); - if (checkPreUpdate()) return; + this.pushWaterToAdjacentTiles(); + this.fakestack.setStackDisplayName(this.outputstack.amount + "L Water"); + if (this.checkPreUpdate()) return; - fixUnderlflow(); - handleRefuel(); - handleWaterGeneration(); - causePollution(); + this.fixUnderlflow(); + this.handleRefuel(); + this.handleWaterGeneration(); + this.causePollution(); } private void pushWaterToAdjacentTiles() { @@ -141,20 +141,17 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr this.yCoord + direction.offsetY, this.zCoord + direction.offsetZ)) .ifPresent(te -> { - if (te instanceof IFluidHandler) { - IFluidHandler tank = (IFluidHandler) te; + if (te instanceof IFluidHandler tank) { if (tank.canFill(direction.getOpposite(), this.outputstack.getFluid())) { - int drainage; - if ((drainage = tank.fill(direction.getOpposite(), this.outputstack, false)) - > 0) { + int drainage = tank.fill(direction.getOpposite(), this.outputstack, false); + if (drainage > 0) { tank.fill(direction.getOpposite(), this.outputstack, true); this.drain(drainage, true); } } - } else if (te instanceof IFluidTank) { - IFluidTank tank = (IFluidTank) te; - int drainage; - if ((drainage = tank.fill(this.outputstack, false)) > 0) { + } else if (te instanceof IFluidTank tank) { + int drainage = tank.fill(this.outputstack, false); + if (drainage > 0) { tank.fill(this.outputstack, true); this.drain(drainage, true); } @@ -192,9 +189,9 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr } @Override - public ItemStack getStackInSlot(int p_70301_1_) { - if (p_70301_1_ == 0) return this.fuelstack; - else return this.fakestack; + public ItemStack getStackInSlot(int slotIn) { + if (slotIn == 0) return this.fuelstack; + return this.fakestack; } @Override @@ -207,14 +204,14 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr } @Override - public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + public ItemStack getStackInSlotOnClosing(int index) { return null; } @Override - public void setInventorySlotContents(int slot, ItemStack p_70299_2_) { - if (slot == BW_TileEntity_HeatedWaterPump.FUELSLOT) this.fuelstack = p_70299_2_; - else this.fakestack = p_70299_2_; + public void setInventorySlotContents(int slot, ItemStack stack) { + if (slot == BW_TileEntity_HeatedWaterPump.FUELSLOT) this.fuelstack = stack; + else this.fakestack = stack; } @Override @@ -233,7 +230,7 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr } @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + public boolean isUseableByPlayer(EntityPlayer player) { return true; } @@ -244,9 +241,8 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr public void closeInventory() {} @Override - public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - return TileEntityFurnace.getItemBurnTime(p_94041_2_) > 0 - && p_94041_1_ == BW_TileEntity_HeatedWaterPump.FUELSLOT; + public boolean isItemValidForSlot(int index, ItemStack stack) { + return TileEntityFurnace.getItemBurnTime(stack) > 0 && index == BW_TileEntity_HeatedWaterPump.FUELSLOT; } @Override @@ -362,7 +358,7 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr new SlotWidget(invWrapper, 0).setFilter(stack -> TileEntityFurnace.getItemBurnTime(stack) > 0) .setPos(55, 52)) .widget(SlotWidget.phantom(invWrapper, 1).disableInteraction().setPos(85, 32)).widget( - new ProgressBar().setProgress(() -> (float) fuel / maxfuel) + new ProgressBar().setProgress(() -> (float) this.fuel / this.maxfuel) .setTexture(BW_UITextures.PROGRESSBAR_FUEL, 14).setDirection(ProgressBar.Direction.UP) .setPos(56, 36).setSize(14, 14)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java index 32f214a941..d91b790596 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java @@ -85,8 +85,8 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank } @Override - public void writeToNBT(NBTTagCompound p_145841_1_) { - super.writeToNBT(p_145841_1_); + public void writeToNBT(NBTTagCompound compound) { + super.writeToNBT(compound); NBTTagList lInternalTank = new NBTTagList(); @@ -99,7 +99,7 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank lInternalTank.appendTag(entry); } } - p_145841_1_.setTag("InternalTank", lInternalTank); + compound.setTag("InternalTank", lInternalTank); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 2203b89aa8..3433464b49 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -151,7 +151,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa tt.addMachineType("Bacterial Vat").addInfo("Controller block for the Bacterial Vat") .addInfo("For maximum efficiency boost keep the Output Hatch always half filled!").addSeparator() .beginStructureBlock(5, 4, 5, false).addController("Front bottom center") - .addCasingInfo("Clean Stainless Steel Casings", 19) + .addCasingInfoMin("Clean Stainless Steel Casings", 19, false) .addOtherStructurePart("Glass", "Hollow two middle layers", 2) .addStructureInfo("The glass can be any glass, i.e. Tinkers Construct Clear Glass") .addStructureInfo("Some Recipes need more advanced Glass Types").addMaintenanceHatch("Any casing", 1) @@ -218,9 +218,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } private int calcMod(double x) { - double y = (((double) this.getOutputCapacity()) / 2D), z = ConfigHandler.bioVatMaxParallelBonus; + double y = this.getOutputCapacity() / 2D, z = ConfigHandler.bioVatMaxParallelBonus; - int ret = MathUtils.ceilInt(((-1D / y * Math.pow((x - y), 2D) + y) / y * z)); + int ret = MathUtils.ceilInt((-1D / y * Math.pow(x - y, 2D) + y) / y * z); return MathUtils.clamp(1, ret, ConfigHandler.bioVatMaxParallelBonus); } @@ -231,23 +231,23 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa @NotNull @Override protected CheckRecipeResult validateRecipe(@NotNull GT_Recipe recipe) { - if (!BW_Util.areStacksEqualOrNull((ItemStack) recipe.mSpecialItems, getControllerSlot())) + if (!BW_Util.areStacksEqualOrNull( + (ItemStack) recipe.mSpecialItems, + GT_TileEntity_BioVat.this.getControllerSlot())) return CheckRecipeResultRegistry.NO_RECIPE; int[] conditions = GT_TileEntity_BioVat.specialValueUnpack(recipe.mSpecialValue); - mNeededSievert = conditions[3]; + GT_TileEntity_BioVat.this.mNeededSievert = conditions[3]; - if (mGlassTier < conditions[0]) { + if (GT_TileEntity_BioVat.this.mGlassTier < conditions[0]) { return CheckRecipeResultRegistry.insufficientMachineTier(conditions[0]); } if (conditions[2] == 0) { - if (mSievert < mNeededSievert) { - return ResultWrongSievert.insufficientSievert(mNeededSievert); - } - } else { - if (mSievert != conditions[3]) { - return ResultWrongSievert.wrongSievert(conditions[3]); + if (GT_TileEntity_BioVat.this.mSievert < GT_TileEntity_BioVat.this.mNeededSievert) { + return ResultWrongSievert.insufficientSievert(GT_TileEntity_BioVat.this.mNeededSievert); } + } else if (GT_TileEntity_BioVat.this.mSievert != conditions[3]) { + return ResultWrongSievert.wrongSievert(conditions[3]); } return CheckRecipeResultRegistry.SUCCESSFUL; @@ -261,14 +261,15 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa return result; } // We already made sure the recipe runs. Now the vat looks for as many "parallels" as it can do - mExpectedMultiplier = getExpectedMultiplier(lastRecipe.getFluidOutput(0), true); - mTimes = 1; - for (int i = 1; i < mExpectedMultiplier; i++) { - if (depleteInput(lastRecipe.mFluidInputs[0])) { - mTimes++; + GT_TileEntity_BioVat.this.mExpectedMultiplier = GT_TileEntity_BioVat.this + .getExpectedMultiplier(this.lastRecipe.getFluidOutput(0), true); + GT_TileEntity_BioVat.this.mTimes = 1; + for (int i = 1; i < GT_TileEntity_BioVat.this.mExpectedMultiplier; i++) { + if (GT_TileEntity_BioVat.this.depleteInput(this.lastRecipe.mFluidInputs[0])) { + GT_TileEntity_BioVat.this.mTimes++; } } - this.outputFluids[0].amount *= mTimes; + this.outputFluids[0].amount *= GT_TileEntity_BioVat.this.mTimes; return result; } }; @@ -277,7 +278,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa @Override protected void setupProcessingLogic(ProcessingLogic logic) { super.setupProcessingLogic(logic); - logic.setSpecialSlotItem(getControllerSlot()); + logic.setSpecialSlotItem(this.getControllerSlot()); } public FluidStack getStoredFluidOutputs() { @@ -289,16 +290,13 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity, int CasingIndex) { if (aTileEntity == null) { return false; + } + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null || !(aMetaTileEntity instanceof GT_MetaTileEntity_RadioHatch)) { + return false; } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_RadioHatch) { - ((GT_MetaTileEntity_RadioHatch) aMetaTileEntity).updateTexture(CasingIndex); - return this.mRadHatches.add((GT_MetaTileEntity_RadioHatch) aMetaTileEntity); - } else { - return false; - } + ((GT_MetaTileEntity_RadioHatch) aMetaTileEntity).updateTexture(CasingIndex); + return this.mRadHatches.add((GT_MetaTileEntity_RadioHatch) aMetaTileEntity); } } @@ -308,7 +306,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa this.mGlassTier = 0; this.mCasing = 0; - if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 3, 0)) return false; + if (!this.checkPiece(STRUCTURE_PIECE_MAIN, 2, 3, 0)) return false; return this.mCasing >= 19 && this.mRadHatches.size() <= 1 && this.mOutputHatches.size() == 1 @@ -341,8 +339,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } private void sendPackagesOrRenewRenderer(int x, int y, int z, BioCulture lCulture) { - int xDir = getXDir(); - int zDir = getZDir(); + int xDir = this.getXDir(); + int zDir = this.getZDir(); GT_TileEntity_BioVat.staticColorMap.remove( new Coords( @@ -392,10 +390,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa if (!aWorld.isRemote) { for (Object tObject : aWorld.playerEntities) { - if (!(tObject instanceof EntityPlayerMP)) { + if (!(tObject instanceof EntityPlayerMP tPlayer)) { break; } - EntityPlayerMP tPlayer = (EntityPlayerMP) tObject; Chunk tChunk = aWorld.getChunkFromBlockCoords( this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord()); @@ -413,9 +410,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } private void placeFluid() { - isVisibleFluid = true; - int xDir = getXDir(); - int zDir = getZDir(); + this.isVisibleFluid = true; + int xDir = this.getXDir(); + int zDir = this.getZDir(); this.height = this.reCalculateHeight(); if (this.mFluid != null && this.height > 1 && this.reCalculateFluidAmmount() > 0) for (int x = -1; x < 2; x++) { for (int y = 0; y < this.height; y++) { @@ -437,7 +434,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } private void removeFluid(int xDir, int zDir) { - isVisibleFluid = false; + this.isVisibleFluid = false; for (int x = -1; x < 2; x++) { for (int y = 1; y < 3; y++) { @@ -468,9 +465,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } private int reCalculateHeight() { - return (this.reCalculateFluidAmmount() > ((this.getCapacity() / 4) - 1) - ? (this.reCalculateFluidAmmount() >= this.getCapacity() / 2 ? 3 : 2) - : 1); + return this.reCalculateFluidAmmount() > this.getCapacity() / 4 - 1 + ? this.reCalculateFluidAmmount() >= this.getCapacity() / 2 ? 3 : 2 + : 1; } public void doAllVisualThings() { @@ -478,8 +475,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa if (this.mMachine) { ItemStack aStack = this.mInventory[1]; BioCulture lCulture = null; - int xDir = getXDir(); - int zDir = getZDir(); + int xDir = this.getXDir(); + int zDir = this.getZDir(); if (this.getBaseMetaTileEntity().getTimer() % 200 == 0) { this.check_Chunk(); @@ -496,8 +493,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa this.height = this.reCalculateHeight(); if (this.mFluid != null && this.height > 1 && this.reCalculateFluidAmmount() > 0) { - if ((!(BW_Util.areStacksEqualOrNull(aStack, this.mStack))) || (this.needsVisualUpdate - && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1)) { + if (!BW_Util.areStacksEqualOrNull(aStack, this.mStack) || this.needsVisualUpdate + && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1) { for (int x = -1; x < 2; x++) { for (int y = 1; y < this.height; y++) { for (int z = -1; z < 2; z++) { @@ -541,11 +538,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa if (this.getBaseMetaTileEntity().isActive() && this.mNeededSievert > this.mSievert) this.mOutputFluids = null; } - if (aBaseMetaTileEntity.isServerSide()) { - if (this.mMaxProgresstime <= 0) { - this.mTimes = 0; - this.mMaxProgresstime = 0; - } + if (aBaseMetaTileEntity.isServerSide() && this.mMaxProgresstime <= 0) { + this.mTimes = 0; + this.mMaxProgresstime = 0; } } @@ -567,13 +562,13 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa @Override public void onRemoval() { - if (isVisibleFluid) { - int xDir = getXDir(); - int zDir = getZDir(); - removeFluid(xDir, zDir); - sendRenderPackets(xDir, zDir); + if (this.isVisibleFluid) { + int xDir = this.getXDir(); + int zDir = this.getZDir(); + this.removeFluid(xDir, zDir); + this.sendRenderPackets(xDir, zDir); } else if (this.getBaseMetaTileEntity().getWorld().getWorldTime() % 20 == 7) { - sendRenderPackets(); + this.sendRenderPackets(); } super.onRemoval(); @@ -588,9 +583,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } private void sendRenderPackets() { - int xDir = getXDir(); - int zDir = getZDir(); - sendRenderPackets(xDir, zDir); + int xDir = this.getXDir(); + int zDir = this.getZDir(); + this.sendRenderPackets(xDir, zDir); } private void sendRenderPackets(int xDir, int zDir) { @@ -656,7 +651,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa @Override public void construct(ItemStack itemStack, boolean b) { - buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 2, 3, 0); + this.buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 2, 3, 0); } @Override @@ -668,13 +663,15 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa // here we must check the machine is well-formed as otherwise getExpectedMultiplier might error out! infoData[infoData.length - 2] = StatCollector.translateToLocal("BW.infoData.BioVat.expectedProduction") + ": " + EnumChatFormatting.GREEN - + (mMachine ? (mMaxProgresstime <= 0 ? getExpectedMultiplier(null, false) : mExpectedMultiplier) * 100 + + (this.mMachine + ? (this.mMaxProgresstime <= 0 ? this.getExpectedMultiplier(null, false) + : this.mExpectedMultiplier) * 100 : -1) + EnumChatFormatting.RESET + " %"; infoData[infoData.length - 1] = StatCollector.translateToLocal("BW.infoData.BioVat.production") + ": " + EnumChatFormatting.GREEN - + (mMaxProgresstime <= 0 ? 0 : mTimes) * 100 + + (this.mMaxProgresstime <= 0 ? 0 : this.mTimes) * 100 + EnumChatFormatting.RESET + " %"; return infoData; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 28cc85941f..e3543a5332 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -117,6 +117,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends return STRUCTURE_DEFINITION; } + @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Circuit Assembler").addInfo("Controller block for the Circuit Assembly Line") @@ -191,7 +192,8 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override public void loadNBTData(NBTTagCompound aNBT) { this.type = aNBT.getCompoundTag("Type"); - imprintedItemName = GT_LanguageManager.getTranslateableItemStackName(ItemStack.loadItemStackFromNBT(this.type)); + this.imprintedItemName = GT_LanguageManager + .getTranslateableItemStackName(ItemStack.loadItemStackFromNBT(this.type)); super.loadNBTData(aNBT); } @@ -220,12 +222,12 @@ public class GT_TileEntity_CircuitAssemblyLine extends @NotNull @Override public CheckRecipeResult checkProcessing() { - if (this.type.equals(new NBTTagCompound()) && !this.imprintMachine(getControllerSlot())) + if (this.type.equals(new NBTTagCompound()) && !this.imprintMachine(this.getControllerSlot())) return SimpleCheckRecipeResult.ofFailure("no_imprint"); - if (imprintedItemName == null || imprintedStack == null) { - imprintedStack = new ItemStack(BW_Meta_Items.getNEWCIRCUITS(), 1, 0); - imprintedStack.setTagCompound(type); - imprintedItemName = GT_LanguageManager.getTranslateableItemStackName(imprintedStack); + if (this.imprintedItemName == null || this.imprintedStack == null) { + this.imprintedStack = new ItemStack(BW_Meta_Items.getNEWCIRCUITS(), 1, 0); + this.imprintedStack.setTagCompound(this.type); + this.imprintedItemName = GT_LanguageManager.getTranslateableItemStackName(this.imprintedStack); } return super.checkProcessing(); } @@ -233,7 +235,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override protected void setupProcessingLogic(ProcessingLogic logic) { super.setupProcessingLogic(logic); - logic.setSpecialSlotItem(imprintedStack); + logic.setSpecialSlotItem(this.imprintedStack); } @Override @@ -244,8 +246,8 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override public ArrayList getStoredInputs() { ArrayList rList = new ArrayList<>(); - for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) { - tHatch.mRecipeMap = getRecipeMap(); + for (GT_MetaTileEntity_Hatch_InputBus tHatch : this.mInputBusses) { + tHatch.mRecipeMap = this.getRecipeMap(); if (isValidMetaTileEntity(tHatch)) { for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) { if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null) { @@ -262,19 +264,18 @@ public class GT_TileEntity_CircuitAssemblyLine extends public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { return false; + } + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap(); + return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = this.getRecipeMap(); + return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap(); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = this.getRecipeMap(); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); - } else { - return false; - } + return false; } } @@ -282,17 +283,14 @@ public class GT_TileEntity_CircuitAssemblyLine extends public boolean addInputHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { return false; + } + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null || !(aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input)) { + return false; } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap(); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); - } else { - return false; - } + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap(); + return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); } } @@ -325,15 +323,15 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override public String[] getInfoData() { - if (infoDataBuffer != null) return infoDataBuffer; + if (this.infoDataBuffer != null) return this.infoDataBuffer; String[] oldInfo = super.getInfoData(); - infoDataBuffer = new String[oldInfo.length + 1]; - System.arraycopy(oldInfo, 0, infoDataBuffer, 0, oldInfo.length); - infoDataBuffer[oldInfo.length] = StatCollector.translateToLocal("tooltip.cal.imprintedWith") + " " + this.infoDataBuffer = new String[oldInfo.length + 1]; + System.arraycopy(oldInfo, 0, this.infoDataBuffer, 0, oldInfo.length); + this.infoDataBuffer[oldInfo.length] = StatCollector.translateToLocal("tooltip.cal.imprintedWith") + " " + EnumChatFormatting.YELLOW - + getTypeForDisplay(); - return infoDataBuffer; + + this.getTypeForDisplay(); + return this.infoDataBuffer; } @Override @@ -351,12 +349,12 @@ public class GT_TileEntity_CircuitAssemblyLine extends return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) }; } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { if (!this.checkPiece(STRUCTURE_PIECE_FIRST, 0, 0, 0)) { return false; - } else { - return this.checkMachine(true) || this.checkMachine(false); } + return this.checkMachine(true) || this.checkMachine(false); } private boolean checkMachine(boolean leftToRight) { @@ -384,14 +382,15 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { - if (mMachine) return -1; + if (this.mMachine) return -1; int built; - built = survivialBuildPiece(STRUCTURE_PIECE_FIRST, stackSize, 0, 0, 0, elementBudget, env, false, true); + built = this.survivialBuildPiece(STRUCTURE_PIECE_FIRST, stackSize, 0, 0, 0, elementBudget, env, false, true); if (built >= 0) return built; int tLength = Math.min(stackSize.stackSize + 1, 7); for (int i = 1; i < tLength; ++i) { - built = survivialBuildPiece(STRUCTURE_PIECE_NEXT, stackSize, -i, 0, 0, elementBudget, env, false, true); + built = this + .survivialBuildPiece(STRUCTURE_PIECE_NEXT, stackSize, -i, 0, 0, elementBudget, env, false, true); if (built >= 0) return built; } return -1; @@ -413,7 +412,8 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { super.addUIWidgets(builder, buildContext); - builder.widget(new FakeSyncWidget.StringSyncer(() -> imprintedItemName, val -> imprintedItemName = val)); + builder.widget( + new FakeSyncWidget.StringSyncer(() -> this.imprintedItemName, val -> this.imprintedItemName = val)); } @Override @@ -428,7 +428,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override public boolean isRecipeLockingEnabled() { - return imprintedItemName != null && !imprintedItemName.equals(""); + return this.imprintedItemName != null && !"".equals(this.imprintedItemName); } @Override @@ -447,7 +447,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); - String imprintedWith = getTypeForDisplay(); + String imprintedWith = this.getTypeForDisplay(); if (!imprintedWith.isEmpty()) tag.setString("ImprintedWith", imprintedWith); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index 532a3af1ff..c125d4150e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -94,7 +94,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - String casings = getCasingBlockItem().get(0).getDisplayName(); + String casings = this.getCasingBlockItem().get(0).getDisplayName(); tt.addMachineType("Geothermal Heat Pump").addInfo("Consumes " + GT_Values.V[this.mTier + 2] + "EU/t") .addInfo("Has 4 Modes, use the Screwdriver to change them:"); if (ConfigHandler.DEHPDirectSteam) { @@ -110,14 +110,16 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { } else { tt.addInfo("0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract") .addInfo("Explodes when it runs out of Coolant").addInfo( - "Heats up " + (long) (this.mTier * 24 * ((double) GT_TileEntity_DEHP.nulearHeatMod)) * 20 + "Heats up " + (long) (this.mTier * 24 * (double) GT_TileEntity_DEHP.nulearHeatMod) * 20 + "L/s Coolant(minus 10% per Maintenance Problem)"); } tt.addSeparator().beginStructureBlock(3, 7, 3, false).addController("Front bottom") .addOtherStructurePart(casings, "form the 3x1x3 Base") .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") - .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") - .addEnergyHatch(VN[getMinTier()] + "+, Any base casing").addMaintenanceHatch("Any base casing") + .addOtherStructurePart( + this.getFrameMaterial().mName + " Frame Boxes", + "Each pillar's side and 1x3x1 on top") + .addEnergyHatch(VN[this.getMinTier()] + "+, Any base casing").addMaintenanceHatch("Any base casing") .addInputBus("Mining Pipes, optional, any base casing").addInputHatch("Any base casing") .addOutputHatch("Any base casing").toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); return tt; @@ -191,6 +193,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); } + @Override protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { if (this.mMode == 3) { @@ -202,53 +205,51 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { return true; } - if (tryLowerPipeState(false) != 0) { - if (this.waitForPipes()) { - return false; - } else { - if (this.mMode == 0) this.mMode = 1; - if (ConfigHandler.DEHPDirectSteam) { - if (this.mMode == 1) { - long steamProduced = (this.mTier * 600 * 2L * this.mEfficiency / 10000L); - long waterConsume = ((steamProduced + 160) / 160); - - if (this.getWaterFromHatches(false) - waterConsume > 0) { - this.consumeFluid(FluidRegistry.WATER, waterConsume); - this.addOutput(GT_ModHandler.getSteam(steamProduced)); - } else { - this.explodeMultiblock(); - return false; - } - } else if (this.mMode == 2) { - long steamProduced = (this.mTier * 300 * 2L * this.mEfficiency / 10000L); - long waterConsume = ((steamProduced + 160) / 160); - - if (this.getWaterFromHatches(true) - waterConsume > 0) { - this.consumeFluid(GT_ModHandler.getDistilledWater(1).getFluid(), waterConsume); - this.addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", (int) steamProduced)); - } else { - this.explodeMultiblock(); - return false; - } - } + if (this.tryLowerPipeState(false) == 0) { + return true; + } + if (this.waitForPipes()) { + return false; + } + if (this.mMode == 0) { + this.mMode = 1; + } + if (ConfigHandler.DEHPDirectSteam) { + if (this.mMode == 1) { + long steamProduced = this.mTier * 600 * 2L * this.mEfficiency / 10000L; + long waterConsume = (steamProduced + 160) / 160; + + if (this.getWaterFromHatches(false) - waterConsume > 0) { + this.consumeFluid(FluidRegistry.WATER, waterConsume); + this.addOutput(GT_ModHandler.getSteam(steamProduced)); } else { - if (this.mMode == 1 || this.mMode == 2) { - long coolantConverted = (long) (this.mTier * 24 - * ((double) GT_TileEntity_DEHP.nulearHeatMod) - * this.mEfficiency - / 10000L); - if (this.getFluidFromHatches(FluidRegistry.getFluid("ic2coolant")) - coolantConverted > 0) { - this.consumeFluid(FluidRegistry.getFluid("ic2coolant"), coolantConverted); - this.addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", (int) coolantConverted)); - } else { - this.explodeMultiblock(); - return false; - } - } + this.explodeMultiblock(); + return false; + } + } else if (this.mMode == 2) { + long steamProduced = this.mTier * 300 * 2L * this.mEfficiency / 10000L; + long waterConsume = (steamProduced + 160) / 160; + + if (this.getWaterFromHatches(true) - waterConsume > 0) { + this.consumeFluid(GT_ModHandler.getDistilledWater(1).getFluid(), waterConsume); + this.addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", (int) steamProduced)); + } else { + this.explodeMultiblock(); + return false; } } - } else { - return true; + } else if (this.mMode == 1 || this.mMode == 2) { + long coolantConverted = (long) (this.mTier * 24 + * (double) GT_TileEntity_DEHP.nulearHeatMod + * this.mEfficiency + / 10000L); + if (this.getFluidFromHatches(FluidRegistry.getFluid("ic2coolant")) - coolantConverted > 0) { + this.consumeFluid(FluidRegistry.getFluid("ic2coolant"), coolantConverted); + this.addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", (int) coolantConverted)); + } else { + this.explodeMultiblock(); + return false; + } } return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index cd76fc7470..51683d2376 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -81,7 +81,6 @@ public class GT_TileEntity_ElectricImplosionCompressor private final ArrayList chunkCoordinates = new ArrayList<>(5); private int mBlockTier = 0; private int mCasing; - private int mMaxHatchTier = 0; public GT_TileEntity_ElectricImplosionCompressor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -141,13 +140,13 @@ public class GT_TileEntity_ElectricImplosionCompressor } private Pair getTier(ItemStack trigger) { - return tiers.get(Math.min(Math.max(trigger.stackSize, 1), tiers.size()) - 1); + return this.tiers.get(Math.min(Math.max(trigger.stackSize, 1), this.tiers.size()) - 1); } @Override public boolean spawnHint(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z, ItemStack itemStack) { - Pair tier = getTier(itemStack); + Pair tier = this.getTier(itemStack); if (te.piston) StructureLibAPI.hintParticle(world, x, y, z, tier.getKey(), tier.getValue()); return true; } @@ -155,7 +154,7 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override public boolean placeBlock(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z, ItemStack itemStack) { - Pair tier = getTier(itemStack); + Pair tier = this.getTier(itemStack); if (te.piston) world.setBlock(x, y, z, tier.getKey(), tier.getValue(), 3); else world.setBlockToAir(x, y, z); return true; @@ -175,14 +174,16 @@ public class GT_TileEntity_ElectricImplosionCompressor }).build(); public static List> getAllBlockTiers() { - return new ArrayList>() { + return new ArrayList<>() { + + private static final long serialVersionUID = 8171991663102417651L; { - add(Pair.of(GregTech_API.sBlockMetal5, 2)); - add(Pair.of(LudicrousBlocks.resource_block, 1)); - add(Pair.of(GregTech_API.sBlockMetal9, 4)); - add(Pair.of(GregTech_API.sBlockMetal9, 3)); - add(Pair.of(GregTech_API.sBlockMetal9, 8)); + this.add(Pair.of(GregTech_API.sBlockMetal5, 2)); + this.add(Pair.of(LudicrousBlocks.resource_block, 1)); + this.add(Pair.of(GregTech_API.sBlockMetal9, 4)); + this.add(Pair.of(GregTech_API.sBlockMetal9, 3)); + this.add(Pair.of(GregTech_API.sBlockMetal9, 8)); } }; @@ -198,28 +199,27 @@ public class GT_TileEntity_ElectricImplosionCompressor } if (block == GregTech_API.sBlockMetal5 && meta == 2) { return 1; // Neutronium - } else if (block == LudicrousBlocks.resource_block && meta == 1) { + } + if (block == LudicrousBlocks.resource_block && meta == 1) { return 2; // Infinity - } else if (block == GregTech_API.sBlockMetal9) { - switch (meta) { - case 4: // Transcendent Metal - return 3; - case 3: // SpaceTime - return 4; - case 8: // Universium - return 5; - } } - + if (block == GregTech_API.sBlockMetal9) { + return switch (meta) { + case 4 -> 3; // Transcendent Metal + case 3 -> 4; // SpaceTime + case 8 -> 5; // Universium + default -> -1; + }; + } return -1; } private void setBlockTier(int tier) { - mBlockTier = tier; + this.mBlockTier = tier; } private int getBlockTier() { - return mBlockTier; + return this.mBlockTier; } @Override @@ -242,7 +242,7 @@ public class GT_TileEntity_ElectricImplosionCompressor .addInfo("Valid blocks: Neutronium, Infinity, Transcendent Metal, Spacetime, Universium") .addInfo("Minimum allowed energy hatch tier is one below recipe tier") .addInfo("Supports " + TT + " energy hatches").addSeparator().beginStructureBlock(3, 9, 3, false) - .addController("Front 3rd layer center").addCasingInfo("Solid Steel Machine Casing", 8) + .addController("Front 3rd layer center").addCasingInfoMin("Solid Steel Machine Casing", 8, false) .addStructureInfo("Casings can be replaced with Explosion Warning Signs") .addOtherStructurePart("Transformer-Winding Blocks", "Outer layer 2,3,7,8") .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Inner layer 2,3,7,8") @@ -266,32 +266,33 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override protected GT_OverclockCalculator createOverclockCalculator(@NotNull GT_Recipe recipe) { // For overclocking we'll allow all power to be used - return super.createOverclockCalculator(recipe).setEUt(getMaxInputEu()).setAmperage(1); + return super.createOverclockCalculator(recipe) + .setEUt(GT_TileEntity_ElectricImplosionCompressor.this.getMaxInputEu()).setAmperage(1); } - }.setMaxParallelSupplier(() -> (int) Math.pow(4, Math.max(mBlockTier - 1, 0))); + }.setMaxParallelSupplier(() -> (int) Math.pow(4, Math.max(this.mBlockTier - 1, 0))); } @Override protected void setProcessingLogicPower(ProcessingLogic logic) { - long amperage = getMaxInputAmps(); - long voltage = getAverageInputVoltage(); + long amperage = this.getMaxInputAmps(); + long voltage = this.getAverageInputVoltage(); // We allow one OC, if there is enough amperage, no matter which type of hatch is used logic.setAvailableVoltage(amperage >= 4 ? voltage * 4 : voltage); logic.setAvailableAmperage(amperage >= 4 ? amperage / 4 : amperage); } private void updateChunkCoordinates() { - chunkCoordinates.clear(); + this.chunkCoordinates.clear(); for (int x = -1; x <= 1; x++) for (int z = -1; z <= 1; z++) { - if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) { - int[] abc = new int[] { x, -2, z + 1 }; - int[] xyz = new int[] { 0, 0, 0 }; + if (Math.abs(x) != 1 || Math.abs(z) != 1) { + int[] abc = { x, -2, z + 1 }; + int[] xyz = { 0, 0, 0 }; this.getExtendedFacing().getWorldOffset(abc, xyz); xyz[0] += this.getBaseMetaTileEntity().getXCoord(); xyz[1] += this.getBaseMetaTileEntity().getYCoord(); xyz[2] += this.getBaseMetaTileEntity().getZCoord(); - chunkCoordinates.add(new ChunkCoordinates(xyz[0], xyz[1], xyz[2])); + this.chunkCoordinates.add(new ChunkCoordinates(xyz[0], xyz[1], xyz[2])); } } } @@ -299,7 +300,7 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { super.onFirstTick(aBaseMetaTileEntity); - updateChunkCoordinates(); + this.updateChunkCoordinates(); } @Override @@ -307,7 +308,7 @@ public class GT_TileEntity_ElectricImplosionCompressor super.onPostTick(aBaseMetaTileEntity, aTick); if (pistonEnabled && aBaseMetaTileEntity.isActive() && aTick % 20 == 0) { - if (aBaseMetaTileEntity.isClientSide()) animatePiston(aBaseMetaTileEntity); + if (aBaseMetaTileEntity.isClientSide()) this.animatePiston(aBaseMetaTileEntity); else if (aBaseMetaTileEntity.hasMufflerUpgrade()) MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( aBaseMetaTileEntity.getWorld(), new EICPacket( @@ -325,7 +326,7 @@ public class GT_TileEntity_ElectricImplosionCompressor public void setExtendedFacing(ExtendedFacing newExtendedFacing) { super.setExtendedFacing(newExtendedFacing); // Will call stopMachine - updateChunkCoordinates(); + this.updateChunkCoordinates(); } @Override @@ -333,6 +334,7 @@ public class GT_TileEntity_ElectricImplosionCompressor return true; } + @Override public void stopMachine() { this.resetPiston(); super.stopMachine(); @@ -344,8 +346,8 @@ public class GT_TileEntity_ElectricImplosionCompressor if (!aBaseMetaTileEntity.isServerSide()) return; if (!this.piston) { List> tiers = getAllBlockTiers(); - Pair tieredBlock = tiers.get(Math.min(mBlockTier, tiers.size()) - 1); - chunkCoordinates.forEach(c -> { + Pair tieredBlock = tiers.get(Math.min(this.mBlockTier, tiers.size()) - 1); + this.chunkCoordinates.forEach(c -> { // Don't replace real blocks in case user has placed something (e.g. tier upgrade) if (aBaseMetaTileEntity.getWorld().isAirBlock(c.posX, c.posY, c.posZ)) { aBaseMetaTileEntity.getWorld() @@ -361,7 +363,7 @@ public class GT_TileEntity_ElectricImplosionCompressor IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); if (!aBaseMetaTileEntity.isServerSide()) return; if (this.piston) { - chunkCoordinates.forEach(c -> aBaseMetaTileEntity.getWorld().setBlockToAir(c.posX, c.posY, c.posZ)); + this.chunkCoordinates.forEach(c -> aBaseMetaTileEntity.getWorld().setBlockToAir(c.posX, c.posY, c.posZ)); this.piston = !this.piston; } } @@ -369,19 +371,19 @@ public class GT_TileEntity_ElectricImplosionCompressor private void animatePiston(IGregTechTileEntity aBaseMetaTileEntity) { if (!aBaseMetaTileEntity.getWorld().isRemote) return; - if (!getBaseMetaTileEntity().hasMufflerUpgrade()) GT_Utility.doSoundAtClient( + if (!this.getBaseMetaTileEntity().hasMufflerUpgrade()) GT_Utility.doSoundAtClient( sound, 10, 1f, 1f, - chunkCoordinates.get(0).posX, - chunkCoordinates.get(0).posY, - chunkCoordinates.get(0).posZ); - spawnVisualPistonBlocks( + this.chunkCoordinates.get(0).posX, + this.chunkCoordinates.get(0).posY, + this.chunkCoordinates.get(0).posZ); + this.spawnVisualPistonBlocks( aBaseMetaTileEntity.getWorld(), - chunkCoordinates.get(2).posX, - chunkCoordinates.get(2).posY, - chunkCoordinates.get(2).posZ, + this.chunkCoordinates.get(2).posX, + this.chunkCoordinates.get(2).posY, + this.chunkCoordinates.get(2).posZ, 10); } @@ -406,23 +408,22 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { this.mCasing = 0; - this.mMaxHatchTier = 0; - setBlockTier(0); - boolean isOK = checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0); + int mMaxHatchTier = 0; + this.setBlockTier(0); + boolean isOK = this.checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0); - List energyHatches = getExoticAndNormalEnergyHatchList(); + List energyHatches = this.getExoticAndNormalEnergyHatchList(); for (GT_MetaTileEntity_Hatch hatch : energyHatches) { mMaxHatchTier = Math.max(mMaxHatchTier, hatch.mTier); } isOK = isOK && this.mMaintenanceHatches.size() == 1 && energyHatches.size() >= 1; if (isOK) { - activatePiston(); + this.activatePiston(); return true; - } else { - resetPiston(); - return false; } + this.resetPiston(); + return false; } @Override @@ -468,13 +469,13 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override public void construct(ItemStack itemStack, boolean b) { - buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 1, 6, 0); + this.buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 1, 6, 0); } @Override public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { - if (mMachine) return -1; - return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 1, 6, 0, elementBudget, env, false, true); + if (this.mMachine) return -1; + return this.survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 1, 6, 0, elementBudget, env, false, true); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index bc825fbdbf..8e6bcc85d9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -181,7 +181,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase "Reactor will take 4 000L/s of coolant multiplied by efficiency and by fuel coolant value (check tooltips)") .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t").addInfo("One Operation takes 1 hour") .addSeparator().beginStructureBlock(11, 12, 11, true).addController("Front bottom center") - .addCasingInfo("Europium Reinforced Radiation Proof Casings", 500) + .addCasingInfoMin("Europium Reinforced Radiation Proof Casings", 500, false) .addStructureInfo("Corners and the 2 touching blocks are air (cylindric)") .addInputBus("Any top layer casing", 2).addInputHatch("Any top layer casing", 2) .addOutputBus("Any bottom layer casing", 1).addOutputHatch("Any bottom layer casing", 1) @@ -197,19 +197,19 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - buildPiece("main", stackSize, hintsOnly, 5, 11, 0); + this.buildPiece("main", stackSize, hintsOnly, 5, 11, 0); } @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { this.mCasing = 0; - return (checkPiece("main", 5, 11, 0) && this.mCasing >= 500 + return this.checkPiece("main", 5, 11, 0) && this.mCasing >= 500 && this.mMaintenanceHatches.size() == 1 && this.mInputHatches.size() > 0 && this.mOutputHatches.size() > 0 && this.mInputBusses.size() > 0 && this.mOutputBusses.size() > 0 - && this.mEnergyHatches.size() > 0); + && this.mEnergyHatches.size() > 0; } @Override @@ -248,13 +248,12 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } } if (this.fuelsupply < maxcapacity) { - startRecipeProcessing(); + this.startRecipeProcessing(); for (ItemStack itemStack : this.getStoredInputs()) { int type = -1; - if (itemStack == null) continue; - if (itemStack.getItem() != HTGRMaterials.aHTGR_Materials) continue; + if (itemStack == null || itemStack.getItem() != HTGRMaterials.aHTGR_Materials) continue; int damage = HTGRMaterials.aHTGR_Materials.getDamage(itemStack); - if (!((damage + 1) % HTGRMaterials.MATERIALS_PER_FUEL == HTGRMaterials.USABLE_FUEL_INDEX + 1)) + if ((damage + 1) % HTGRMaterials.MATERIALS_PER_FUEL != HTGRMaterials.USABLE_FUEL_INDEX + 1) continue; // is fuel type = damage / HTGRMaterials.MATERIALS_PER_FUEL; if (this.fueltype == -1) this.fueltype = type; @@ -264,7 +263,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase itemStack.stackSize -= toget; updateneeded = true; } - endRecipeProcessing(); + this.endRecipeProcessing(); } if (updateneeded) this.updateSlots(); } @@ -281,36 +280,36 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } return false; } - if (!(this.HeliumSupply >= GT_TileEntity_HTGR.HELIUM_NEEDED && this.fuelsupply >= mincapacity)) return false; + if (this.HeliumSupply < GT_TileEntity_HTGR.HELIUM_NEEDED || this.fuelsupply < mincapacity) return false; double eff = Math.min(Math.pow((double) this.fuelsupply / (double) mincapacity, 2D), 100D) / 100D - - ((double) (getIdealStatus() - getRepairStatus()) / 10D); + - (this.getIdealStatus() - this.getRepairStatus()) / 10D; if (eff <= 0) return false; - int toReduce = MathUtils.floorInt((double) this.fuelsupply * 0.025D * eff); + int toReduce = MathUtils.floorInt(this.fuelsupply * 0.025D * eff); final int originalToReduce = toReduce; int burnedballs = toReduce / 64; if (burnedballs > 0) toReduce -= burnedballs * 64; - int meta = (this.fueltype * HTGRMaterials.MATERIALS_PER_FUEL) + HTGRMaterials.BURNED_OUT_FUEL_INDEX; + int meta = this.fueltype * HTGRMaterials.MATERIALS_PER_FUEL + HTGRMaterials.BURNED_OUT_FUEL_INDEX; - ItemStack[] toOutput = new ItemStack[] { new ItemStack(HTGRMaterials.aHTGR_Materials, burnedballs, meta), + ItemStack[] toOutput = { new ItemStack(HTGRMaterials.aHTGR_Materials, burnedballs, meta), new ItemStack(HTGRMaterials.aHTGR_Materials, toReduce, meta + 1) }; - if (!canOutputAll(toOutput)) return false; + if (!this.canOutputAll(toOutput)) return false; this.fuelsupply -= originalToReduce; this.mOutputItems = toOutput; // this.updateSlots(); // not needed ? - this.coolanttaking = (int) (4000D * (((this.fueltype * 0.5D) + 1)) * eff); + this.coolanttaking = (int) (4000D * (this.fueltype * 0.5D + 1) * eff); this.mEfficiency = (int) (eff * 10000D); this.mEfficiencyIncrease = 0; this.mEUt = -powerUsage; - this.mMaxProgresstime = (int) (72000 * (1d - (eff / 2d))); + this.mMaxProgresstime = (int) (72000 * (1d - eff / 2d)); return true; } @@ -318,11 +317,11 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public boolean onRunningTick(ItemStack aStack) { - runningtick++; + this.runningtick++; if (this.empty) { - if (emptyticksnodiff > 20 && emptyticksnodiff % 20 != 0) { - emptyticksnodiff++; + if (this.emptyticksnodiff > 20 && this.emptyticksnodiff % 20 != 0) { + this.emptyticksnodiff++; return true; } if (this.HeliumSupply > 0) { @@ -333,7 +332,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase ItemStack iStack = new ItemStack( HTGRMaterials.aHTGR_Materials, this.fuelsupply, - (HTGRMaterials.MATERIALS_PER_FUEL * this.fueltype) + HTGRMaterials.USABLE_FUEL_INDEX); + HTGRMaterials.MATERIALS_PER_FUEL * this.fueltype + HTGRMaterials.USABLE_FUEL_INDEX); boolean storedAll = false; for (GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) { if (!isValidMetaTileEntity(tHatch)) continue; @@ -343,10 +342,10 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } } if (!storedAll) { - if (this.fuelsupply == iStack.stackSize) emptyticksnodiff++; + if (this.fuelsupply == iStack.stackSize) this.emptyticksnodiff++; else { this.fuelsupply = iStack.stackSize; - emptyticksnodiff = 0; + this.emptyticksnodiff = 0; } } else { this.fuelsupply = 0; @@ -357,13 +356,13 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase return true; } // USE DA POWAH - if (!drainEnergyInput(-mEUt)) { - criticalStopMachine(); + if (!this.drainEnergyInput(-this.mEUt)) { + this.criticalStopMachine(); return false; } - if (runningtick % 20 == 0) { - int takecoolant = coolanttaking; + if (this.runningtick % 20 == 0) { + int takecoolant = this.coolanttaking; int drainedamount = 0; for (GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) { @@ -378,7 +377,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } } - if (drainedamount > 0) addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount)); + if (drainedamount > 0) this.addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount)); this.updateSlots(); @@ -420,12 +419,12 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "s", "Fuel type:", - (this.fueltype == -1 ? "NONE" : ("TRISO (" + HTGRMaterials.sHTGR_Fuel[this.fueltype].sEnglish) + ")"), + this.fueltype == -1 ? "NONE" : "TRISO (" + HTGRMaterials.sHTGR_Fuel[this.fueltype].sEnglish + ")", "Fuel amount:", GT_Utility.formatNumbers(this.fuelsupply) + " pcs.", "Helium-Level:", GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + GT_Utility.formatNumbers(GT_TileEntity_HTGR.HELIUM_NEEDED) + "L", - "Coolant:", GT_Utility.formatNumbers(coolanttaking) + "L/s", "Problems:", + "Coolant:", GT_Utility.formatNumbers(this.coolanttaking) + "L/s", "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; } @@ -479,7 +478,8 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override @SuppressWarnings({ "unchecked", "rawtypes" }) public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { - if (tooltip.containsKey(getDamage(p_77624_1_))) aList.add(tooltip.get(getDamage(p_77624_1_))); + if (this.tooltip.containsKey(this.getDamage(p_77624_1_))) + aList.add(this.tooltip.get(this.getDamage(p_77624_1_))); aList.add("Material for High Temperature Gas-cooled Reactor"); super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); } @@ -532,7 +532,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } } - public static final Base_[] sHTGR_Bases = new Base_[] { new Base_("HTGRFuelMixture", "HTGR fuel mixture"), + public static final Base_[] sHTGR_Bases = { new Base_("HTGRFuelMixture", "HTGR fuel mixture"), new Base_("BISOPebbleCompound", "BISO pebble compound"), new Base_("TRISOPebbleCompound", "TRISO pebble compound"), new Base_("TRISOBall", "TRISO ball"), new Base_("TRISOPebble", "TRISO pebble"), new Base_("BurnedOutTRISOBall", "Burned out TRISO Ball"), @@ -540,7 +540,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase public static final int MATERIALS_PER_FUEL = sHTGR_Bases.length; static final int USABLE_FUEL_INDEX = 4; static final int BURNED_OUT_FUEL_INDEX = 5; - public static final Fuel_[] sHTGR_Fuel = new Fuel_[] { + public static final Fuel_[] sHTGR_Fuel = { new Fuel_( "Thorium", "Thorium", @@ -586,7 +586,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase new LangEntry_( "item." + sHTGR_Materials[i] + ".name", base.sEnglish + " (" + fuel.sEnglish + ")")); - if (((i + 1) % MATERIALS_PER_FUEL == (USABLE_FUEL_INDEX + 1)) && fuel.tooltip != null + if ((i + 1) % MATERIALS_PER_FUEL == USABLE_FUEL_INDEX + 1 && fuel.tooltip != null && !fuel.tooltip.isEmpty()) tooltip.put(i, fuel.tooltip); i++; @@ -603,7 +603,8 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase public static void register_fake_THR_Recipes() { int i = 0; - for (Fuel_ fuel : sHTGR_Fuel) { + for (@SuppressWarnings("unused") + Fuel_ fuel : sHTGR_Fuel) { fakeRecipeMap.addFakeRecipe( false, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 04eb969a8c..113a9023a7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -70,7 +70,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { private static final ITexture[][] iTextures = new ITexture[4][1]; public ConnectedBlocksChecker connectedcells; public final ItemStack[] circuits = new ItemStack[5]; - private final ItemStackHandler circuitsInventoryHandler = new ItemStackHandler(circuits) { + private final ItemStackHandler circuitsInventoryHandler = new ItemStackHandler(this.circuits) { @Override public int getSlotLimit(int slot) { @@ -100,7 +100,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public long maxEUStore() { - return (this.mStorage >= Long.MAX_VALUE - 1 || this.mStorage < 0) ? Long.MAX_VALUE - 1 : this.mStorage; + return this.mStorage >= Long.MAX_VALUE - 1 || this.mStorage < 0 ? Long.MAX_VALUE - 1 : this.mStorage; } @Override @@ -179,6 +179,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { return e.toArray(new String[0]); } + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { @@ -216,7 +217,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, int aColorIndex, boolean aActive, boolean aRedstone) { - ITexture[] ret = new ITexture[0]; + ITexture[] ret = {}; if (this.isClientSide()) { @@ -251,15 +252,15 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } @Override - public ItemStack getStackInSlot(int p_70301_1_) { - if (p_70301_1_ > 1) return this.circuits[(p_70301_1_ - 2)]; - return this.mInventory[p_70301_1_]; + public ItemStack getStackInSlot(int slotIn) { + if (slotIn > 1) return this.circuits[slotIn - 2]; + return this.mInventory[slotIn]; } @Override - public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { - if (p_70299_1_ < 2) this.mInventory[p_70299_1_] = p_70299_2_; - else this.circuits[(p_70299_1_ - 2)] = p_70299_2_; + public void setInventorySlotContents(int index, ItemStack stack) { + if (index < 2) this.mInventory[index] = stack; + else this.circuits[index - 2] = stack; } @Override @@ -278,20 +279,17 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + public boolean isUseableByPlayer(EntityPlayer player) { return true; } @Override - public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + public boolean isItemValidForSlot(int index, ItemStack stack) { - switch (p_94041_1_) { - case 0: - case 1: - return true; - default: - return p_94041_2_ != null && p_94041_2_.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); - } + return switch (index) { + case 0, 1 -> true; + default -> stack != null && stack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); + }; } @Override @@ -386,8 +384,8 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } this.mEfficiency = this.getMaxEfficiency(null); - this.mStorage = (ConfigHandler.energyPerCell * this.connectedcells.hashset.size() >= Long.MAX_VALUE - 1 - || ConfigHandler.energyPerCell * this.connectedcells.hashset.size() < 0) ? Long.MAX_VALUE - 1 + this.mStorage = ConfigHandler.energyPerCell * this.connectedcells.hashset.size() >= Long.MAX_VALUE - 1 + || ConfigHandler.energyPerCell * this.connectedcells.hashset.size() < 0 ? Long.MAX_VALUE - 1 : ConfigHandler.energyPerCell * this.connectedcells.hashset.size(); this.mMaxProgresstime = 1; this.mProgresstime = 0; @@ -407,7 +405,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { if (finishedTime - startingTime > 5000000) MainMod.LOGGER.warn( "LESU LookUp took longer than 5ms!(" + (finishedTime - startingTime) + "ns / " - + ((finishedTime - startingTime) / 1000000) + + (finishedTime - startingTime) / 1000000 + "ms) Owner:" + this.getBaseMetaTileEntity().getOwnerName() + " Check at x:" @@ -456,29 +454,30 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(7, 4).setSize(118, 67)) - .widget(new SlotWidget(new BaseSlot(inventoryHandler, 1) { + .widget(new SlotWidget(new BaseSlot(this.inventoryHandler, 1) { @Override public int getSlotStackLimit() { return 1; } - }).setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN).setPos(127, 13)) - .widget(new SlotWidget(new BaseSlot(inventoryHandler, 0) { + }).setBackground(this.getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN).setPos(127, 13)) + .widget(new SlotWidget(new BaseSlot(this.inventoryHandler, 0) { @Override public int getSlotStackLimit() { return 1; } - }).setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CHARGER).setPos(127, 49)); + }).setBackground(this.getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CHARGER) + .setPos(127, 49)); for (int i = 0; i < 4; i++) { builder.widget( - new SlotWidget(circuitsInventoryHandler, i) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT) - .setPos(151, 4 + i * 18)); + new SlotWidget(this.circuitsInventoryHandler, i).setBackground( + this.getGUITextureSet().getItemSlot(), + GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT).setPos(151, 4 + i * 18)); } final DynamicPositionedColumn screenElements = new DynamicPositionedColumn(); - drawTexts(screenElements); + this.drawTexts(screenElements); builder.widget(screenElements); builder.widget( @@ -486,8 +485,8 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { .widget( new ProgressBar() .setProgress( - () -> (float) getBaseMetaTileEntity().getStoredEU() - / getBaseMetaTileEntity().getEUCapacity()) + () -> (float) this.getBaseMetaTileEntity().getStoredEU() + / this.getBaseMetaTileEntity().getEUCapacity()) .setDirection(ProgressBar.Direction.RIGHT) .setTexture(BW_UITextures.PROGRESSBAR_STORED_EU_116, 116).setPos(8, 73) .setSize(116, 5)); @@ -498,40 +497,39 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { screenElements .widget( - TextWidget - .dynamicString( - () -> "EU: " + GT_Utility.formatNumbers(getBaseMetaTileEntity().getStoredEU())) - .setDefaultColor(COLOR_TEXT_WHITE.get())) + TextWidget.dynamicString( + () -> "EU: " + GT_Utility.formatNumbers(this.getBaseMetaTileEntity().getStoredEU())) + .setDefaultColor(this.COLOR_TEXT_WHITE.get())) .widget( TextWidget.dynamicString( - () -> "MAX: " + (getBaseMetaTileEntity().isActive() - ? GT_Utility.formatNumbers(getBaseMetaTileEntity().getOutputVoltage()) + () -> "MAX: " + (this.getBaseMetaTileEntity().isActive() + ? GT_Utility.formatNumbers(this.getBaseMetaTileEntity().getOutputVoltage()) + String.valueOf(ConfigHandler.energyPerCell).substring(1) : Integer.toString(0))) - .setDefaultColor(COLOR_TEXT_WHITE.get())) + .setDefaultColor(this.COLOR_TEXT_WHITE.get())) .widget( TextWidget .dynamicString( - () -> "MAX EU/t IN: " - + GT_Utility.formatNumbers(getBaseMetaTileEntity().getInputVoltage())) - .setDefaultColor(COLOR_TEXT_WHITE.get())) + () -> "MAX EU/t IN: " + GT_Utility + .formatNumbers(this.getBaseMetaTileEntity().getInputVoltage())) + .setDefaultColor(this.COLOR_TEXT_WHITE.get())) .widget( TextWidget .dynamicString( - () -> "EU/t OUT: " - + GT_Utility.formatNumbers(getBaseMetaTileEntity().getOutputVoltage())) - .setDefaultColor(COLOR_TEXT_WHITE.get())) + () -> "EU/t OUT: " + GT_Utility + .formatNumbers(this.getBaseMetaTileEntity().getOutputVoltage())) + .setDefaultColor(this.COLOR_TEXT_WHITE.get())) .widget( TextWidget .dynamicString( - () -> "AMP/t IN/OUT: " - + GT_Utility.formatNumbers(getBaseMetaTileEntity().getInputAmperage())) - .setDefaultColor(COLOR_TEXT_WHITE.get())) + () -> "AMP/t IN/OUT: " + GT_Utility + .formatNumbers(this.getBaseMetaTileEntity().getInputAmperage())) + .setDefaultColor(this.COLOR_TEXT_WHITE.get())) .widget( new TextWidget(Text.localised("tooltip.LESU.0.name")).setDefaultColor(Color.YELLOW.getRGB()) - .setEnabled(widget -> maxEUStore() >= Long.MAX_VALUE - 1)) + .setEnabled(widget -> this.maxEUStore() >= Long.MAX_VALUE - 1)) .widget( new TextWidget(Text.localised("tooltip.LESU.1.name")).setDefaultColor(Color.RED.getRGB()) - .setEnabled(widget -> !getBaseMetaTileEntity().isActive())); + .setEnabled(widget -> !this.getBaseMetaTileEntity().isActive())); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index 49e175a136..6c8f5e8b76 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -98,8 +98,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl public boolean check(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z) { if (world.isAirBlock(x, y, z)) return true; TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null) return true; - if (!(tileEntity instanceof IGregTechTileEntity)) return true; + if (tileEntity == null || !(tileEntity instanceof IGregTechTileEntity)) return true; IMetaTileEntity mte = ((IGregTechTileEntity) tileEntity).getMetaTileEntity(); if (mte instanceof GT_MetaTileEntity_Hatch_Dynamo || mte instanceof GT_MetaTileEntity_Hatch_Energy) { @@ -108,7 +107,8 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl == intier + (te.upstep ? te.mTiers : -te.mTiers)) { te.addToMachineList((IGregTechTileEntity) tileEntity, CASING_INDEX); return true; - } else return false; + } + return false; } return true; } @@ -135,7 +135,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl .addInfo("Mode 3: Circuit 2 in controller: Tapped-Upstep (currently disabled)") .addInfo("Mode 4: Circuit 2 in controller: Tapped-Downstep (currently disabled)").addSeparator() .beginVariableStructureBlock(3, 3, 3, 10, 3, 3, false).addController("Front bottom center") - .addCasingInfo("MV Machine Casing", 0) + .addCasingInfoMin("MV Machine Casing", 0, false) .addOtherStructurePart("Transformer-Winding Blocks", "1 Layer for each tier transformed") .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Middle of Transformer-Winding Blocks") .addMaintenanceHatch("Any bottom layer casing", 1).addEnergyHatch("Any bottom layer casing", 1) @@ -177,10 +177,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl } return this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput( - this.getInputTier() * 2 - * this.mEnergyHatches.size() - * (long) this.mEfficiency - / this.getMaxEfficiency(null)); + this.getInputTier() * 2 * this.mEnergyHatches.size() * this.mEfficiency / this.getMaxEfficiency(null)); } public boolean onRunningTickTabbedMode() { @@ -188,11 +185,11 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl for (GT_MetaTileEntity_Hatch_Dynamo E : this.mDynamoHatches) { for (GT_MetaTileEntity_Hatch_Energy I : this.mEnergyHatches) { - long vtt = I.getEUVar() >= (V[E.mTier] / 2) && E.getEUVar() < E.maxEUStore() ? I.getEUVar() : 0; + long vtt = I.getEUVar() >= V[E.mTier] / 2 && E.getEUVar() < E.maxEUStore() ? I.getEUVar() : 0; if (vtt == 0) continue; - long vtp = E.getEUVar() + (vtt); + long vtp = E.getEUVar() + vtt; long avt = Math.min(vtp, E.maxEUStore()); E.setEUVar(avt); I.setEUVar(I.getEUVar() - vtt); @@ -202,16 +199,18 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl return ret; } + @Override public long getInputTier() { if (this.mEnergyHatches.size() > 0) return GT_Utility.getTier(this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); - else return 0L; + return 0L; } + @Override public long getOutputTier() { if (this.mDynamoHatches.size() > 0) return GT_Utility.getTier(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); - else return 0L; + return 0L; } @Override @@ -240,9 +239,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl this.upstep = this.mode % 2 == 0; boolean tapmode = this.mode > 1; - if (!checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0)) return false; - - if (this.mEnergyHatches.size() == 0) return false; + if (!this.checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0) || this.mEnergyHatches.size() == 0) return false; byte intier = this.mEnergyHatches.get(0).mTier; for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) if (in.mTier != intier) return false; @@ -251,13 +248,13 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl for (mHeight = 1; mHeight <= 8; mHeight++) { if (tapmode) { this.mTiers = mHeight; - if (!checkPiece(STRUCTURE_PIECE_TAP_LAYER, 2, mHeight, 1)) break; - } else if (!checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0)) break; + if (!this.checkPiece(STRUCTURE_PIECE_TAP_LAYER, 2, mHeight, 1)) break; + } else if (!this.checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0)) break; } - if (!checkPiece(STRUCTURE_PIECE_TOP, 1, mHeight, 0)) return false; + if (!this.checkPiece(STRUCTURE_PIECE_TOP, 1, mHeight, 0)) return false; this.mTiers = mHeight - 1; - if (this.mDynamoHatches.size() == 0 || mMaintenanceHatches.size() != 1 || this.mTiers == 0) return false; + if (this.mDynamoHatches.size() == 0 || this.mMaintenanceHatches.size() != 1 || this.mTiers == 0) return false; byte outtier = this.mDynamoHatches.get(0).mTier; for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { @@ -331,11 +328,11 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl else this.mode = (byte) Math.min(3, this.mInventory[1].getItemDamage()); int mHeight = Math.min(itemStack.stackSize, 8); boolean tapmode = this.mode > 1; - buildPiece(STRUCTURE_PIECE_BASE, itemStack, b, 1, 0, 0); + this.buildPiece(STRUCTURE_PIECE_BASE, itemStack, b, 1, 0, 0); for (int i = 0; i < mHeight; i++) { - if (tapmode) buildPiece(STRUCTURE_PIECE_TAP_LAYER, itemStack, b, 2, i + 1, 1); - else buildPiece(STRUCTURE_PIECE_LAYER, itemStack, b, 1, i + 1, 0); + if (tapmode) this.buildPiece(STRUCTURE_PIECE_TAP_LAYER, itemStack, b, 2, i + 1, 1); + else this.buildPiece(STRUCTURE_PIECE_LAYER, itemStack, b, 1, i + 1, 0); } - buildPiece(STRUCTURE_PIECE_TOP, itemStack, b, 1, mHeight + 1, 0); + this.buildPiece(STRUCTURE_PIECE_TOP, itemStack, b, 1, mHeight + 1, 0); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 0bec36aca3..89f27cf41e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -152,7 +152,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase .addInfo("Reactor will take 4 800L/t of coolant multiplied by efficiency") .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t") .addInfo("One Operation takes 9 hours").addSeparator().beginStructureBlock(11, 12, 11, true) - .addController("Front bottom center").addCasingInfo("Radiation Proof Casings", 500) + .addController("Front bottom center").addCasingInfoMin("Radiation Proof Casings", 500, false) .addStructureInfo("Corners and the 2 touching blocks are air (cylindric)") .addInputBus("Any top layer casing", 2).addInputHatch("Any top layer casing", 2) .addOutputBus("Any bottom layer casing", 1).addOutputHatch("Any bottom layer casing", 1) @@ -168,19 +168,19 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 5, 11, 0); + this.buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 5, 11, 0); } @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { this.mCasing = 0; - return (checkPiece(STRUCTURE_PIECE_MAIN, 5, 11, 0) && this.mCasing >= 500 + return this.checkPiece(STRUCTURE_PIECE_MAIN, 5, 11, 0) && this.mCasing >= 500 && this.mMaintenanceHatches.size() == 1 && this.mInputHatches.size() > 0 && this.mOutputHatches.size() > 0 && this.mInputBusses.size() > 0 && this.mOutputBusses.size() > 0 - && this.mEnergyHatches.size() > 0); + && this.mEnergyHatches.size() > 0; } @Override @@ -217,7 +217,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase } } if (this.fuelsupply < maxcapacity) { - startRecipeProcessing(); + this.startRecipeProcessing(); for (ItemStack itemStack : this.getStoredInputs()) { if (GT_Utility.areStacksEqual( itemStack, @@ -228,7 +228,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase this.fuelsupply += toget; } } - endRecipeProcessing(); + this.endRecipeProcessing(); this.updateSlots(); } } @@ -245,14 +245,14 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase } return false; } - if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.fuelsupply >= mincapacity)) return false; + if (this.HeliumSupply < GT_TileEntity_THTR.HELIUM_NEEDED || this.fuelsupply < mincapacity) return false; - double eff = Math.min( - Math.pow((double) (this.fuelsupply - mincapacity) / ((maxcapacity - mincapacity) / 10D), 2D) + 1, - 100D) / 100D - ((double) (getIdealStatus() - getRepairStatus()) / 10D); + double eff = Math + .min(Math.pow((this.fuelsupply - mincapacity) / ((maxcapacity - mincapacity) / 10D), 2D) + 1, 100D) + / 100D - (this.getIdealStatus() - this.getRepairStatus()) / 10D; if (eff <= 0D) return false; - int toReduce = MathUtils.floorInt((double) this.fuelsupply * 0.005D * eff); + int toReduce = MathUtils.floorInt(this.fuelsupply * 0.005D * eff); final int originalToReduce = toReduce; int burnedballs = toReduce / 64; @@ -260,9 +260,9 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase int meta = THTRMaterials.MATERIAL_USED_FUEL_INDEX; - ItemStack[] toOutput = new ItemStack[] { new ItemStack(THTRMaterials.aTHTR_Materials, burnedballs, meta), + ItemStack[] toOutput = { new ItemStack(THTRMaterials.aTHTR_Materials, burnedballs, meta), new ItemStack(THTRMaterials.aTHTR_Materials, toReduce, meta + 1) }; - if (!canOutputAll(toOutput)) return false; + if (!this.canOutputAll(toOutput)) return false; this.fuelsupply -= originalToReduce; this.mOutputItems = toOutput; @@ -291,7 +291,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase if (!super.onRunningTick(aStack)) return false; - int takecoolant = coolanttaking; + int takecoolant = this.coolanttaking; int drainedamount = 0; for (GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) { @@ -306,7 +306,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase } } - if (drainedamount > 0) addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount)); + if (drainedamount > 0) this.addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount)); this.updateSlots(); @@ -352,7 +352,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + GT_Utility.formatNumbers(GT_TileEntity_THTR.HELIUM_NEEDED) + "L", - "Coolant/t:", GT_Utility.formatNumbers(this.mProgresstime == 0 ? 0 : coolanttaking) + "L/t", + "Coolant/t:", GT_Utility.formatNumbers(this.mProgresstime == 0 ? 0 : this.coolanttaking) + "L/t", "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 3137d91e4e..26d7ed3d01 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -32,6 +32,7 @@ import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityDispenser; @@ -74,7 +75,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.modularui.IGetTitleColor; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; -import gregtech.api.objects.XSTR; +import gregtech.api.objects.ItemData; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OreDictUnificator; @@ -89,7 +90,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock private static final IIconContainer[] iIconContainers = new IIconContainer[2]; private static final ITexture[] iTextures = new ITexture[3]; - private static final XSTR localRandomInstance = new XSTR(); private BW_RotorBlock rotorBlock; private int mDoor = 0; private int mHardenedClay = 0; @@ -137,13 +137,13 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public boolean check(GT_TileEntity_Windmill gt_tileEntity_windmill, World world, int x, int y, int z) { - return delegate.check(gt_tileEntity_windmill, world, x, y, z); + return this.delegate.check(gt_tileEntity_windmill, world, x, y, z); } @Override public boolean spawnHint(GT_TileEntity_Windmill gt_tileEntity_windmill, World world, int x, int y, int z, ItemStack trigger) { - return delegate.spawnHint(gt_tileEntity_windmill, world, x, y, z, trigger); + return this.delegate.spawnHint(gt_tileEntity_windmill, world, x, y, z, trigger); } }))) .addElement('b', ofBlock(Blocks.brick_block, 0)) @@ -195,7 +195,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock .addInfo("The structure is too complex!") .addInfo("Follow the StructureLib hologram projector to build the main structure.").addSeparator() .beginStructureBlock(7, 12, 7, false).addController("Front bottom center") - .addCasingInfo("Hardened Clay block", 40).addOtherStructurePart("Dispenser", "Any Hardened Clay block") + .addCasingInfoMin("Hardened Clay block", 40, false) + .addOtherStructurePart("Dispenser", "Any Hardened Clay block") .addOtherStructurePart("0-1 Wooden door", "Any Hardened Clay block") .addStructureHint("Primitive Kinetic Shaftbox", 1).toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; @@ -211,7 +212,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public boolean onRunningTick(ItemStack aStack) { if (this.mMaxProgresstime > 0) this.mProgresstime += this.rotorBlock.getGrindPower(); - if (!rotorBlock.rotorSlot.isEmpty()) this.setRotorDamage(rotorBlock, this.rotorBlock.getGrindPower()); + if (!this.rotorBlock.rotorSlot.isEmpty()) this.setRotorDamage(this.rotorBlock, this.rotorBlock.getGrindPower()); return this.rotorBlock.getGrindPower() > 0; } @@ -228,47 +229,51 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock private float[] multiplierRecipe(ItemStack itemStack) { // will return max and min value of the multiplier, the average of these is used to calculate the multiplier. - if (itemStack.getItem().equals(Items.wheat)) return new float[] { 1.13f, 1.5f }; - else if (itemStack.getItem().equals(Items.bone) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glowstone) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.pumpkin)) + final Item item = itemStack.getItem(); + if (item == Items.wheat) { + return new float[] { 1.13f, 1.5f }; + } + final Block block = Block.getBlockFromItem(item); + if (item == Items.bone || block == Blocks.glowstone || block == Blocks.pumpkin) { return new float[] { 0.8f, 1f }; - else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.gravel) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.cobblestone) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stone) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.sandstone) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.clay) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.hardened_clay) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stained_hardened_clay) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.wool) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.netherrack) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log) - || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.log2)) + } + if (block == Blocks.gravel || block == Blocks.cobblestone + || block == Blocks.stone + || block == Blocks.sandstone + || block == Blocks.clay + || block == Blocks.hardened_clay + || block == Blocks.stained_hardened_clay + || block == Blocks.wool + || block == Blocks.netherrack + || block == Blocks.log + || block == Blocks.log2) { return new float[] { 1f, 1.5f }; - else if (GT_OreDictUnificator.getAssociation(itemStack) == null - || GT_OreDictUnificator.getAssociation(itemStack).mPrefix == null - || GT_OreDictUnificator.getAssociation(itemStack).mMaterial == null - || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial == null - || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.getDust(1) == null) + } + final ItemData association = GT_OreDictUnificator.getAssociation(itemStack); + final OrePrefixes prefix = association == null ? null : association.mPrefix; + if (prefix == null || association.mMaterial == null + || association.mMaterial.mMaterial == null + || association.mMaterial.mMaterial.getDust(1) == null) { return new float[] { 1f, 1f }; - else if (OrePrefixes.ore.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.oreNetherrack.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.oreEndstone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.oreBlackgranite.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.oreRedgranite.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.oreMarble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.oreBasalt.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) + } + if (OrePrefixes.ore == prefix || OrePrefixes.oreNetherrack == prefix + || OrePrefixes.oreEndstone == prefix + || OrePrefixes.oreBlackgranite == prefix + || OrePrefixes.oreRedgranite == prefix + || OrePrefixes.oreMarble == prefix + || OrePrefixes.oreBasalt == prefix) { return new float[] { 0.5f, 1f }; - else if (OrePrefixes.stone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneChiseled.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneCobble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneCracked.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneMossy.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneMossyBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.stoneSmooth.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - || OrePrefixes.cobblestone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) + } + if (OrePrefixes.stone == prefix || OrePrefixes.stoneBricks == prefix + || OrePrefixes.stoneChiseled == prefix + || OrePrefixes.stoneCobble == prefix + || OrePrefixes.stoneCracked == prefix + || OrePrefixes.stoneMossy == prefix + || OrePrefixes.stoneMossyBricks == prefix + || OrePrefixes.stoneSmooth == prefix + || OrePrefixes.cobblestone == prefix) { return new float[] { 1f, 1.5f }; + } return new float[] { 1f, 1f }; } @@ -294,13 +299,13 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock } this.updateSlots(); this.mOutputItems[0] = tRecipe.getOutput(0); - float[] mRecipe = multiplierRecipe(itemStack); + float[] mRecipe = this.multiplierRecipe(itemStack); float multiper = Math.min( mRecipe[1], Math.max( mRecipe[0], - 2f * ((float) Math.sqrt((float) 1 / (this.rotorBlock.getWindStrength() + 1))) - * OutputMultiplier(rotorBlock) + 2f * (float) Math.sqrt((float) 1 / (this.rotorBlock.getWindStrength() + 1)) + * this.OutputMultiplier(this.rotorBlock) * (mRecipe[0] + mRecipe[1]))); int amount = (int) Math.floor(multiper * (this.mOutputItems[0].stackSize * this.mMulti)); @@ -315,16 +320,16 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock ItemStack tmp = this.mOutputItems[0].copy(); tmp.stackSize = amount; splitStacks.add(tmp); - mOutputItems = splitStacks.toArray(new ItemStack[splitStacks.size()]); + this.mOutputItems = splitStacks.toArray(new ItemStack[splitStacks.size()]); } - this.mMaxProgresstime = (tRecipe.mDuration * 2 * 100 * this.mMulti) / getSpeed(rotorBlock); + this.mMaxProgresstime = tRecipe.mDuration * 2 * 100 * this.mMulti / this.getSpeed(this.rotorBlock); this.mMulti = 16; return true; } @Override public void stopMachine() { - getBaseMetaTileEntity().disableWorking(); + this.getBaseMetaTileEntity().disableWorking(); } public boolean addDispenserToOutputSet(TileEntity aTileEntity) { @@ -343,7 +348,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock return false; } - @SuppressWarnings("ALL") @Override public boolean addOutput(ItemStack aStack) { if (GT_Utility.isStackInvalid(aStack)) return false; @@ -363,11 +367,10 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock if (GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack)) { aStack = null; return true; - } else { - tHatch.setInventorySlotContents(i, null); - aStack = null; - return false; } + tHatch.setInventorySlotContents(i, null); + aStack = null; + return false; } } } @@ -381,9 +384,10 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock this.mDoor = 0; this.mHardenedClay = 0; - if (!checkPiece(STRUCTURE_PIECE_MAIN, 3, 11, 0)) return false; - - if (this.tileEntityDispensers.isEmpty() || this.mDoor > 2 || this.mHardenedClay < 40) return false; + if (!this.checkPiece(STRUCTURE_PIECE_MAIN, 3, 11, 0) || this.tileEntityDispensers.isEmpty() + || this.mDoor > 2 + || this.mHardenedClay < 40) + return false; this.mWrench = true; this.mScrewdriver = true; @@ -512,13 +516,13 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public void construct(ItemStack itemStack, boolean b) { - buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 3, 11, 0); + this.buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 3, 11, 0); } @Override public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { - if (mMachine) return -1; - return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 3, 11, 0, elementBudget, env, false, true); + if (this.mMachine) return -1; + return this.survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 3, 11, 0, elementBudget, env, false, true); } public float OutputMultiplier(BW_RotorBlock rotorBlock) { @@ -563,13 +567,14 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public int getTitleColor() { - return COLOR_TITLE_WHITE.get(); + return this.COLOR_TITLE_WHITE.get(); } @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new SlotWidget(inventoryHandler, 1).setBackground(getGUITextureSet().getItemSlot()).setPos(59, 35)) + new SlotWidget(this.inventoryHandler, 1).setBackground(this.getGUITextureSet().getItemSlot()) + .setPos(59, 35)) .widget(new DrawableWidget() { private static final int DIVIDER = 125; @@ -577,24 +582,27 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public void onScreenUpdate() { super.onScreenUpdate(); - if (mMaxProgresstime > 0) { + if (GT_TileEntity_Windmill.this.mMaxProgresstime > 0) { if (System.currentTimeMillis() / DIVIDER % 40 == 30) - setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[3]); + this.setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[3]); else if (System.currentTimeMillis() / DIVIDER % 40 == 20) - setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[2]); + this.setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[2]); else if (System.currentTimeMillis() / DIVIDER % 40 == 10) - setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[1]); + this.setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[1]); else if (System.currentTimeMillis() / DIVIDER % 40 == 0) - setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[0]); + this.setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[0]); } else { - setDrawable(BW_UITextures.PICTURE_WINDMILL_EMPTY); + this.setDrawable(BW_UITextures.PICTURE_WINDMILL_EMPTY); } } }.setDrawable(BW_UITextures.PICTURE_WINDMILL_EMPTY).setPos(85, 27).setSize(32, 32)) - .widget(new FakeSyncWidget.IntegerSyncer(() -> mMaxProgresstime, val -> mMaxProgresstime = val)) + .widget( + new FakeSyncWidget.IntegerSyncer( + () -> this.mMaxProgresstime, + val -> this.mMaxProgresstime = val)) .widget( new ItemDrawable( - () -> mMachine && !getBaseMetaTileEntity().isActive() + () -> this.mMachine && !this.getBaseMetaTileEntity().isActive() ? GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.SOFTMALLET, 1, @@ -604,12 +612,12 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock : null).asWidget().setPos(66, 66)) .widget( new FakeSyncWidget.BooleanSyncer( - () -> getBaseMetaTileEntity().isActive(), - val -> getBaseMetaTileEntity().setActive(val))) + () -> this.getBaseMetaTileEntity().isActive(), + val -> this.getBaseMetaTileEntity().setActive(val))) .widget( new TextWidget(GT_Utility.trans("138", "Incomplete Structure.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setMaxWidth(150) - .setEnabled(widget -> !mMachine).setPos(92, 22)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val)); + .setDefaultColor(this.COLOR_TEXT_WHITE.get()).setMaxWidth(150) + .setEnabled(widget -> !this.mMachine).setPos(92, 22)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> this.mMachine, val -> this.mMachine = val)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 5178a3f759..bf80c80a11 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -174,8 +174,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock .addInfo( "For each perfect overclock the EBF will reduce recipe time 4 times (instead of 2) (100% efficiency)") .addInfo("Additionally gives +100K for every tier past MV") - .addPollutionAmount(20 * getPollutionPerTick(null)).addSeparator().beginStructureBlock(15, 20, 15, true) - .addController("3rd layer center").addCasingInfoRange("Heat Proof Machine Casing", 0, 279, false) + .addPollutionAmount(20 * this.getPollutionPerTick(null)).addSeparator() + .beginStructureBlock(15, 20, 15, true).addController("3rd layer center") + .addCasingInfoRange("Heat Proof Machine Casing", 0, 279, false) .addOtherStructurePart("864x Heating Coils", "Inner 13x18x13 (Hollow)") .addOtherStructurePart("1007x Borosilicate Glass", "Outer 15x18x15") .addStructureInfo("The glass tier limits the Energy Input tier") @@ -195,31 +196,30 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock super.loadNBTData(aNBT); this.glassTier = aNBT.getByte("glasTier"); if (!aNBT.hasKey(INPUT_SEPARATION_NBT_KEY)) { - inputSeparation = aNBT.getBoolean("isBussesSeparate"); + this.inputSeparation = aNBT.getBoolean("isBussesSeparate"); } if (!aNBT.hasKey(BATCH_MODE_NBT_KEY)) { - batchMode = aNBT.getBoolean("mUseMultiparallelMode"); + this.batchMode = aNBT.getBoolean("mUseMultiparallelMode"); } } @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (aPlayer.isSneaking()) { - batchMode = !batchMode; - if (batchMode) { - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); - } else { - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); - } - return true; - } else { - inputSeparation = !inputSeparation; + if (!aPlayer.isSneaking()) { + this.inputSeparation = !this.inputSeparation; GT_Utility.sendChatToPlayer( aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); + StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + this.inputSeparation); return true; } + this.batchMode = !this.batchMode; + if (this.batchMode) { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); + } else { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); + } + return true; } @Override @@ -241,7 +241,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setByte("glasTier", glassTier); + aNBT.setByte("glasTier", this.glassTier); } @Override @@ -255,7 +255,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock if (aMetaTileEntity == null) return false; if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return mPollutionOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return this.mPollutionOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); } return false; } @@ -264,7 +264,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock protected String[] getExtendedInfoData() { return new String[] { StatCollector.translateToLocal("GT5U.EBF.heat") + ": " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mHeatingCapacity) + + GT_Utility.formatNumbers(this.mHeatingCapacity) + EnumChatFormatting.RESET + " K" }; } @@ -277,12 +277,14 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override protected GT_OverclockCalculator createOverclockCalculator(@Nonnull GT_Recipe recipe) { return super.createOverclockCalculator(recipe).setRecipeHeat(recipe.mSpecialValue) - .setMultiHeat(mHeatingCapacity).setHeatOC(true).setHeatDiscount(true); + .setMultiHeat(GT_TileEntity_MegaBlastFurnace.this.mHeatingCapacity).setHeatOC(true) + .setHeatDiscount(true); } @Override protected @Nonnull CheckRecipeResult validateRecipe(@Nonnull GT_Recipe recipe) { - return recipe.mSpecialValue <= mHeatingCapacity ? CheckRecipeResultRegistry.SUCCESSFUL + return recipe.mSpecialValue <= GT_TileEntity_MegaBlastFurnace.this.mHeatingCapacity + ? CheckRecipeResultRegistry.SUCCESSFUL : CheckRecipeResultRegistry.insufficientHeat(recipe.mSpecialValue); } }.setMaxParallel(ConfigHandler.megaMachinesMax); @@ -300,24 +302,24 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - buildPiece("main", stackSize, hintsOnly, 7, 17, 0); + this.buildPiece("main", stackSize, hintsOnly, 7, 17, 0); } @Override public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { - if (mMachine) return -1; + if (this.mMachine) return -1; int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); - glassTier = 0; - setCoilLevel(HeatingCoilLevel.None); - return survivialBuildPiece("main", stackSize, 7, 17, 0, realBudget, source, actor, false, true); + this.glassTier = 0; + this.setCoilLevel(HeatingCoilLevel.None); + return this.survivialBuildPiece("main", stackSize, 7, 17, 0, realBudget, source, actor, false, true); } public void setCoilLevel(HeatingCoilLevel aCoilLevel) { - mCoilLevel = aCoilLevel; + this.mCoilLevel = aCoilLevel; } public HeatingCoilLevel getCoilLevel() { - return mCoilLevel; + return this.mCoilLevel; } @Override @@ -325,7 +327,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock if (aLiquid == null) return false; FluidStack tLiquid = aLiquid.copy(); boolean isOutputPollution = false; - for (FluidStack pollutionFluidStack : pollutionFluidStacks) { + for (FluidStack pollutionFluidStack : this.pollutionFluidStacks) { if (!tLiquid.isFluidEqual(pollutionFluidStack)) continue; isOutputPollution = true; @@ -335,7 +337,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock if (isOutputPollution) { tOutputHatches = this.mPollutionOutputHatches; int pollutionReduction = 0; - for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { + for (GT_MetaTileEntity_Hatch_Muffler tHatch : this.mMufflerHatches) { if (!isValidMetaTileEntity(tHatch)) continue; pollutionReduction = 100 - tHatch.calculatePollutionReduction(100); break; @@ -350,30 +352,28 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { this.mHeatingCapacity = 0; - glassTier = 0; + this.glassTier = 0; - setCoilLevel(HeatingCoilLevel.None); + this.setCoilLevel(HeatingCoilLevel.None); this.mPollutionOutputHatches.clear(); - if (!checkPiece("main", 7, 17, 0)) return false; - - if (getCoilLevel() == HeatingCoilLevel.None) return false; - - if (mMaintenanceHatches.size() != 1) return false; + if (!this.checkPiece("main", 7, 17, 0) || this.getCoilLevel() == HeatingCoilLevel.None + || this.mMaintenanceHatches.size() != 1) + return false; - if (glassTier < 8) { - for (GT_MetaTileEntity_Hatch hatch : mExoticEnergyHatches) { + if (this.glassTier < 8) { + for (GT_MetaTileEntity_Hatch hatch : this.mExoticEnergyHatches) { if (hatch.getConnectionType() == GT_MetaTileEntity_Hatch.ConnectionType.LASER) { return false; } - if (glassTier < hatch.mTier) { + if (this.glassTier < hatch.mTier) { return false; } } } - this.mHeatingCapacity = (int) getCoilLevel().getHeat() + 100 * (BW_Util.getTier(getMaxInputEu()) - 2); + this.mHeatingCapacity = (int) this.getCoilLevel().getHeat() + 100 * (BW_Util.getTier(this.getMaxInputEu()) - 2); return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index 52f5d55f23..68c8a7804b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -116,7 +116,7 @@ public class GT_TileEntity_MegaChemicalReactor public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); if (!aNBT.hasKey(BATCH_MODE_NBT_KEY)) { - batchMode = aNBT.getBoolean("mUseMultiparallelMode"); + this.batchMode = aNBT.getBoolean("mUseMultiparallelMode"); } } @@ -124,8 +124,8 @@ public class GT_TileEntity_MegaChemicalReactor public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { - batchMode = !batchMode; - if (batchMode) { + this.batchMode = !this.batchMode; + if (this.batchMode) { GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); } else { GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); @@ -142,31 +142,30 @@ public class GT_TileEntity_MegaChemicalReactor @Override public void construct(ItemStack aStack, boolean aHintsOnly) { - buildPiece(STRUCTURE_PIECE_MAIN, aStack, aHintsOnly, 2, 2, 0); + this.buildPiece(STRUCTURE_PIECE_MAIN, aStack, aHintsOnly, 2, 2, 0); } @Override public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { - if (mMachine) return -1; + if (this.mMachine) return -1; int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); - return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 2, 2, 0, realBudget, source, actor, false, true); + return this + .survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 2, 2, 0, realBudget, source, actor, false, true); } // -------------- TEC TECH COMPAT ---------------- @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - glassTier = 0; + this.glassTier = 0; - if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 0)) return false; + if (!this.checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 0) || this.mMaintenanceHatches.size() != 1) return false; - if (mMaintenanceHatches.size() != 1) return false; - - if (glassTier < 8) { - for (GT_MetaTileEntity_Hatch hatch : mExoticEnergyHatches) { + if (this.glassTier < 8) { + for (GT_MetaTileEntity_Hatch hatch : this.mExoticEnergyHatches) { if (hatch.getConnectionType() == GT_MetaTileEntity_Hatch.ConnectionType.LASER) { return false; } - if (glassTier < hatch.mTier) { + if (this.glassTier < hatch.mTier) { return false; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 913d706c50..343a06cece 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -168,21 +168,18 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock t.mTopState = 1; // hatch adder TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity instanceof IGregTechTileEntity) { - IGregTechTileEntity entity = (IGregTechTileEntity) tileEntity; - if (t.addLayerOutputHatch(entity, CASING_INDEX)) { - t.onTopLayerFound(false); - return true; - } + if (tileEntity instanceof IGregTechTileEntity entity + && t.addLayerOutputHatch(entity, CASING_INDEX)) { + t.onTopLayerFound(false); + return true; } // block adder if (world.getBlock(x, y, z) == GregTech_API.sBlockCasings4 && world.getBlockMetadata(x, y, z) == 1) { t.onTopLayerFound(true); return true; - } else { - return false; } + return false; }).build(); } @@ -208,27 +205,27 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } protected void onCasingFound() { - mCasing++; + this.mCasing++; } protected int getCurrentLayerOutputHatchCount() { - return mOutputHatchesByLayer.size() < mHeight || mHeight <= 0 ? 0 - : mOutputHatchesByLayer.get(mHeight - 1).size(); + return this.mOutputHatchesByLayer.size() < this.mHeight || this.mHeight <= 0 ? 0 + : this.mOutputHatchesByLayer.get(this.mHeight - 1).size(); } protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null || aTileEntity.isDead() || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) return false; - while (mOutputHatchesByLayer.size() < mHeight) mOutputHatchesByLayer.add(new ArrayList<>()); + while (this.mOutputHatchesByLayer.size() < this.mHeight) this.mOutputHatchesByLayer.add(new ArrayList<>()); GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity(); tHatch.updateTexture(aBaseCasingIndex); - return mOutputHatchesByLayer.get(mHeight - 1).add(tHatch); + return this.mOutputHatchesByLayer.get(this.mHeight - 1).add(tHatch); } protected void onTopLayerFound(boolean aIsCasing) { - mTopLayerFound = true; - if (aIsCasing) onCasingFound(); + this.mTopLayerFound = true; + if (aIsCasing) this.onCasingFound(); } @Override @@ -277,63 +274,58 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { // reset - mOutputHatchesByLayer.forEach(List::clear); - mHeight = 1; - mTopLayerFound = false; - mTopState = -1; + this.mOutputHatchesByLayer.forEach(List::clear); + this.mHeight = 1; + this.mTopLayerFound = false; + this.mTopState = -1; // check base - if (!checkPiece(STRUCTURE_PIECE_BASE, 7, 0, 0)) return false; + if (!this.checkPiece(STRUCTURE_PIECE_BASE, 7, 0, 0)) return false; // check each layer - while (mHeight < 12 && checkPiece(STRUCTURE_PIECE_LAYER, 7, mHeight * 5, 0) && !mTopLayerFound) { - if (mOutputHatchesByLayer.size() < mHeight || mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) + while (this.mHeight < 12 && this.checkPiece(STRUCTURE_PIECE_LAYER, 7, this.mHeight * 5, 0) + && !this.mTopLayerFound) { + if (this.mOutputHatchesByLayer.size() < this.mHeight + || this.mOutputHatchesByLayer.get(this.mHeight - 1).isEmpty()) // layer without output hatch return false; - mTopState = -1; + this.mTopState = -1; // not top - mHeight++; + this.mHeight++; } // validate final invariants... - return mCasing >= 75 * mHeight + 10 && mHeight >= 2 && mTopLayerFound && mMaintenanceHatches.size() == 1; + return this.mCasing >= 75 * this.mHeight + 10 && this.mHeight >= 2 + && this.mTopLayerFound + && this.mMaintenanceHatches.size() == 1; } @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 7, 0, 0); + this.buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 7, 0, 0); int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height for (int i = 1; i < tTotalHeight - 1; i++) { - buildPiece(STRUCTURE_PIECE_LAYER, stackSize, hintsOnly, 7, 5 * i, 0); + this.buildPiece(STRUCTURE_PIECE_LAYER, stackSize, hintsOnly, 7, 5 * i, 0); } - buildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, hintsOnly, 7, 5 * (tTotalHeight - 1), 0); + this.buildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, hintsOnly, 7, 5 * (tTotalHeight - 1), 0); } @Override public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { - if (mMachine) return -1; + if (this.mMachine) return -1; int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); - mHeight = 0; - int built = survivialBuildPiece( - STRUCTURE_PIECE_BASE, - stackSize, - 7, - 0, - 0, - realBudget, - source, - actor, - false, - true); + this.mHeight = 0; + int built = this + .survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 7, 0, 0, realBudget, source, actor, false, true); if (built >= 0) return built; int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height for (int i = 1; i < tTotalHeight - 1; i++) { - mHeight = i; - built = survivialBuildPiece( + this.mHeight = i; + built = this.survivialBuildPiece( STRUCTURE_PIECE_LAYER, stackSize, 7, - 5 * mHeight, + 5 * this.mHeight, 0, realBudget, source, @@ -342,12 +334,12 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock true); if (built >= 0) return built; } - mHeight = tTotalHeight - 1; - return survivialBuildPiece( + this.mHeight = tTotalHeight - 1; + return this.survivialBuildPiece( STRUCTURE_PIECE_TOP_HINT, stackSize, 7, - 5 * mHeight, + 5 * this.mHeight, 0, realBudget, source, @@ -360,7 +352,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); if (!aNBT.hasKey(BATCH_MODE_NBT_KEY)) { - batchMode = aNBT.getBoolean("mUseMultiparallelMode"); + this.batchMode = aNBT.getBoolean("mUseMultiparallelMode"); } } @@ -368,8 +360,8 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { - batchMode = !batchMode; - if (batchMode) { + this.batchMode = !this.batchMode; + if (this.batchMode) { GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); } else { GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); @@ -386,16 +378,16 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock @Override protected void addFluidOutputs(FluidStack[] mOutputFluids2) { - for (int i = 0; i < mOutputFluids2.length && i < mOutputHatchesByLayer.size(); i++) { + for (int i = 0; i < mOutputFluids2.length && i < this.mOutputHatchesByLayer.size(); i++) { FluidStack tStack = mOutputFluids2[i].copy(); - if (!dumpFluid(mOutputHatchesByLayer.get(i), tStack, true)) - dumpFluid(mOutputHatchesByLayer.get(i), tStack, false); + if (!dumpFluid(this.mOutputHatchesByLayer.get(i), tStack, true)) + dumpFluid(this.mOutputHatchesByLayer.get(i), tStack, false); } } @Override public List getFluidOutputSlots(FluidStack[] toOutput) { - return this.getFluidOutputSlotsByLayer(toOutput, mOutputHatchesByLayer); + return this.getFluidOutputSlotsByLayer(toOutput, this.mOutputHatchesByLayer); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java index 8850df1d3b..e666047839 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java @@ -49,7 +49,7 @@ public abstract class GT_TileEntity_MegaMultiBlockBase= 200 ? elementBudget : Math.min(200, elementBudget * 5); - return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 6, 6, 0, realBudget, source, actor, false, true); + return this + .survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 6, 6, 0, realBudget, source, actor, false, true); } // -------------- TEC TECH COMPAT ---------------- @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - glassTier = 0; - mInputOnSide = -1; - mOutputOnSide = -1; - mMiddleInputHatches.clear(); + this.glassTier = 0; + this.mInputOnSide = -1; + this.mOutputOnSide = -1; + this.mMiddleInputHatches.clear(); - if (!checkPiece(STRUCTURE_PIECE_MAIN, 6, 6, 0)) return false; + if (!this.checkPiece(STRUCTURE_PIECE_MAIN, 6, 6, 0) || this.mMaintenanceHatches.size() != 1) return false; - if (mMaintenanceHatches.size() != 1) return false; - - if (glassTier < 8) { - for (GT_MetaTileEntity_Hatch hatch : mExoticEnergyHatches) { + if (this.glassTier < 8) { + for (GT_MetaTileEntity_Hatch hatch : this.mExoticEnergyHatches) { if (hatch.getConnectionType() == GT_MetaTileEntity_Hatch.ConnectionType.LASER) { return false; } - if (glassTier < hatch.mTier) { + if (this.glassTier < hatch.mTier) { return false; } } @@ -252,25 +253,25 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa return false; } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - if (mInputOnSide == 1) { + if (this.mInputOnSide == 1) { return false; } - mInputOnSide = 0; - mOutputOnSide = 1; + this.mInputOnSide = 0; + this.mOutputOnSide = 1; GT_MetaTileEntity_Hatch_Input tHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity; tHatch.updateTexture(aBaseCasingIndex); - tHatch.mRecipeMap = getRecipeMap(); - return mInputHatches.add(tHatch); + tHatch.mRecipeMap = this.getRecipeMap(); + return this.mInputHatches.add(tHatch); } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - if (mOutputOnSide == 1) { + if (this.mOutputOnSide == 1) { return false; } - mInputOnSide = 1; - mOutputOnSide = 0; + this.mInputOnSide = 1; + this.mOutputOnSide = 0; GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aMetaTileEntity; tHatch.updateTexture(aBaseCasingIndex); - return mOutputHatches.add(tHatch); + return this.mOutputHatches.add(tHatch); } return false; } @@ -284,25 +285,25 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa return false; } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - if (mInputOnSide == 0) { + if (this.mInputOnSide == 0) { return false; } - mInputOnSide = 1; - mOutputOnSide = 0; + this.mInputOnSide = 1; + this.mOutputOnSide = 0; GT_MetaTileEntity_Hatch_Input tHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity; tHatch.updateTexture(aBaseCasingIndex); - tHatch.mRecipeMap = getRecipeMap(); - return mInputHatches.add(tHatch); + tHatch.mRecipeMap = this.getRecipeMap(); + return this.mInputHatches.add(tHatch); } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - if (mOutputOnSide == 0) { + if (this.mOutputOnSide == 0) { return false; } - mInputOnSide = 0; - mOutputOnSide = 1; + this.mInputOnSide = 0; + this.mOutputOnSide = 1; GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aMetaTileEntity; tHatch.updateTexture(aBaseCasingIndex); - return mOutputHatches.add(tHatch); + return this.mOutputHatches.add(tHatch); } return false; } @@ -315,11 +316,10 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa if (aMetaTileEntity == null) { return false; } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - GT_MetaTileEntity_Hatch_Input tHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input tHatch) { tHatch.updateTexture(aBaseCasingIndex); - tHatch.mRecipeMap = getRecipeMap(); - return mMiddleInputHatches.add(tHatch); + tHatch.mRecipeMap = this.getRecipeMap(); + return this.mMiddleInputHatches.add(tHatch); } return false; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 40d42f6598..1243bae84d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -149,7 +149,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Vacuum Freezer").addInfo("Controller Block for the Mega Vacuum Freezer") .addInfo("Cools hot ingots and cells").addSeparator().beginStructureBlock(15, 15, 15, true) - .addController("Front center").addCasingInfo("Frost Proof Machine Casing", 900) + .addController("Front center").addCasingInfoMin("Frost Proof Machine Casing", 900, false) .addEnergyHatch("Any casing", 1).addMaintenanceHatch("Any casing", 1).addInputHatch("Any casing", 1) .addOutputHatch("Any casing", 1).addInputBus("Any casing", 1).addOutputBus("Any casing", 1) .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); @@ -163,14 +163,15 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc @Override public void construct(ItemStack aStack, boolean aHintsOnly) { - buildPiece(STRUCTURE_PIECE_MAIN, aStack, aHintsOnly, 7, 7, 0); + this.buildPiece(STRUCTURE_PIECE_MAIN, aStack, aHintsOnly, 7, 7, 0); } @Override public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { - if (mMachine) return -1; + if (this.mMachine) return -1; int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); - return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 7, 7, 0, realBudget, source, actor, false, true); + return this + .survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 7, 7, 0, realBudget, source, actor, false, true); } @Override @@ -182,7 +183,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); if (!aNBT.hasKey(BATCH_MODE_NBT_KEY)) { - batchMode = aNBT.getBoolean("mUseMultiparallelMode"); + this.batchMode = aNBT.getBoolean("mUseMultiparallelMode"); } } @@ -190,8 +191,8 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { - batchMode = !batchMode; - if (batchMode) { + this.batchMode = !this.batchMode; + if (this.batchMode) { GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); } else { GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); @@ -211,7 +212,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { this.mCasing = 0; - if (!checkPiece(STRUCTURE_PIECE_MAIN, 7, 7, 0)) return false; + if (!this.checkPiece(STRUCTURE_PIECE_MAIN, 7, 7, 0)) return false; return this.mMaintenanceHatches.size() == 1 && this.mCasing >= 900; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index daccb55d6f..3686f59246 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -60,22 +60,26 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene return new GT_MetaTileEntity_AcidGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } + @Override public ITexture[] getFront(byte aColor) { return new ITexture[] { super.getFront(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; } + @Override public ITexture[] getBack(byte aColor) { return new ITexture[] { super.getBack(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } + @Override public ITexture[] getBottom(byte aColor) { return new ITexture[] { super.getBottom(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } + @Override public ITexture[] getTop(byte aColor) { return new ITexture[] { super.getTop(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), @@ -86,27 +90,32 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene .glow().build() }; } + @Override public ITexture[] getSides(byte aColor) { return new ITexture[] { super.getSides(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } + @Override public ITexture[] getFrontActive(byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; } + @Override public ITexture[] getBackActive(byte aColor) { return new ITexture[] { super.getBackActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } + @Override public ITexture[] getBottomActive(byte aColor) { return new ITexture[] { super.getBottomActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } + @Override public ITexture[] getTopActive(byte aColor) { return new ITexture[] { super.getTopActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), @@ -117,15 +126,18 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene .glow().build() }; } + @Override public ITexture[] getSidesActive(byte aColor) { return new ITexture[] { super.getSidesActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } + @Override public boolean isOutputFacing(ForgeDirection side) { return side == this.getBaseMetaTileEntity().getFrontFacing(); } + @Override public String[] getDescription() { return new String[] { StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index 6830042f80..4e01fca2a0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -160,29 +160,30 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { int damage = this.getSpecialSlot().getItemDamage(); switch (damage) { case DNA_EXTRACTION_MODULE: - if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) - && this.mInventory[getInputSlot()].getItem() instanceof LabParts - && this.mInventory[getInputSlot()].getItemDamage() == 0 - && this.mInventory[getInputSlot()].getTagCompound() != null + if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()]) + && this.mInventory[this.getInputSlot()].getItem() instanceof LabParts + && this.mInventory[this.getInputSlot()].getItemDamage() == 0 + && this.mInventory[this.getInputSlot()].getTagCompound() != null && // checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) - && this.mInventory[getInputSlot() + 1].getItem() instanceof LabParts - && this.mInventory[getInputSlot() + 1].getItemDamage() == 1 - && this.mInventory[getInputSlot() + 1].getTagCompound() == null - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) - && this.mInventory[getInputSlot() + 2].getItem() instanceof LabParts - && this.mInventory[getInputSlot() + 2].getItemDamage() == 3 - && GT_Utility - .areStacksEqual(this.mInventory[getInputSlot() + 3], Materials.Ethanol.getCells(1)) + GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1]) + && this.mInventory[this.getInputSlot() + 1].getItem() instanceof LabParts + && this.mInventory[this.getInputSlot() + 1].getItemDamage() == 1 + && this.mInventory[this.getInputSlot() + 1].getTagCompound() == null + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2]) + && this.mInventory[this.getInputSlot() + 2].getItem() instanceof LabParts + && this.mInventory[this.getInputSlot() + 2].getItemDamage() == 3 + && GT_Utility.areStacksEqual( + this.mInventory[this.getInputSlot() + 3], + Materials.Ethanol.getCells(1)) && this.mFluid != null && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000) { - NBTTagCompound DNABioDataTag = this.mInventory[getInputSlot()].getTagCompound() + NBTTagCompound DNABioDataTag = this.mInventory[this.getInputSlot()].getTagCompound() .getCompoundTag("DNA"); if (DNABioDataTag == null) return super.checkRecipe(skipOC); BioData cultureDNABioData = BioData.getBioDataFromName( - this.mInventory[getInputSlot()].getTagCompound().getCompoundTag("DNA") + this.mInventory[this.getInputSlot()].getTagCompound().getCompoundTag("DNA") .getString("Name")); if (cultureDNABioData == null) return super.checkRecipe(skipOC); @@ -190,8 +191,8 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 0; i < 4; i++) { - if (this.mInventory[getInputSlot() + i] != null) - this.mInventory[getInputSlot() + i].stackSize--; + if (this.mInventory[this.getInputSlot() + i] != null) + this.mInventory[this.getInputSlot() + i].stackSize--; } this.mFluid.amount -= 1000; @@ -209,26 +210,27 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } break; case PCR_THERMOCYCLE_MODULE: { - if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) - && this.mInventory[getInputSlot()].getItem() instanceof LabParts - && this.mInventory[getInputSlot()].getItemDamage() == 1 - && this.mInventory[getInputSlot()].getTagCompound() != null + if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()]) + && this.mInventory[this.getInputSlot()].getItem() instanceof LabParts + && this.mInventory[this.getInputSlot()].getItemDamage() == 1 + && this.mInventory[this.getInputSlot()].getTagCompound() != null && // checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) - && GT_Utility - .areStacksEqual(this.mInventory[getInputSlot() + 3], ItemList.Tool_DataOrb.get(1L)) - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) + GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 3]) && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 1], + this.mInventory[this.getInputSlot() + 3], + ItemList.Tool_DataOrb.get(1L)) + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1]) + && GT_Utility.areStacksEqual( + this.mInventory[this.getInputSlot() + 1], FluidLoader.BioLabFluidCells[0]) - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2]) && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 2], + this.mInventory[this.getInputSlot() + 2], FluidLoader.BioLabFluidCells[3]) && this.mFluid != null && this.mFluid.isFluidEqual(dnaFluid) && this.mFluid.amount >= 1000) { - NBTTagCompound DNABioDataTag = this.mInventory[getInputSlot()].getTagCompound(); + NBTTagCompound DNABioDataTag = this.mInventory[this.getInputSlot()].getTagCompound(); if (DNABioDataTag == null) return super.checkRecipe(skipOC); BioData cultureDNABioData = BioData.getBioDataFromName(DNABioDataTag.getString("Name")); if (cultureDNABioData == null) return super.checkRecipe(skipOC); @@ -237,8 +239,8 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 0; i < 4; i++) { - if (this.mInventory[getInputSlot() + i] != null) - this.mInventory[getInputSlot() + i].stackSize--; + if (this.mInventory[this.getInputSlot() + i] != null) + this.mInventory[this.getInputSlot() + i].stackSize--; } this.mFluid.amount -= 1000; @@ -264,34 +266,38 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { ItemStack inp2 = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); - if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) - && GT_Utility - .areStacksEqual(FluidLoader.BioLabFluidCells[1], this.mInventory[getInputSlot()]) - && // checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) + if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()]) && GT_Utility + .areStacksEqual(FluidLoader.BioLabFluidCells[1], this.mInventory[this.getInputSlot()]) && // checks + // if + // it + // is + // a + // Culture + GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1]) && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 1], + this.mInventory[this.getInputSlot() + 1], BioItemList.getPlasmidCell(null)) - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2]) && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 2], + this.mInventory[this.getInputSlot() + 2], ItemList.Tool_DataOrb.get(1L), true) - && Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 2]).equals("DNA Sample") - && (!(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2]).isEmpty())) - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) - && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], inp2) + && "DNA Sample" + .equals(Behaviour_DataOrb.getDataTitle(this.mInventory[this.getInputSlot() + 2])) + && !Behaviour_DataOrb.getDataName(this.mInventory[this.getInputSlot() + 2]).isEmpty() + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 3]) + && GT_Utility.areStacksEqual(this.mInventory[this.getInputSlot() + 3], inp2) && this.mFluid != null && this.mFluid.isFluidEqual(dnaFluid) - && (this.mFluid.amount >= 1000)) { - BioData cultureDNABioData = BioData - .getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2])); + && this.mFluid.amount >= 1000) { + BioData cultureDNABioData = BioData.getBioDataFromName( + Behaviour_DataOrb.getDataName(this.mInventory[this.getInputSlot() + 2])); if (cultureDNABioData == null) return super.checkRecipe(skipOC); if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 0; i < 2; i++) { - if (this.mInventory[getInputSlot() + i] != null) - this.mInventory[getInputSlot() + i].stackSize--; + if (this.mInventory[this.getInputSlot() + i] != null) + this.mInventory[this.getInputSlot() + i].stackSize--; } this.mFluid.amount -= 1000; if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { @@ -307,32 +313,32 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } break; case TRANSFORMATION_MODULE: { - if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && GT_Utility - .areStacksEqual(this.mInventory[getInputSlot()], BioItemList.getPetriDish(null), true) - && this.mInventory[getInputSlot()].getTagCompound() != null - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) + if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()]) && GT_Utility + .areStacksEqual(this.mInventory[this.getInputSlot()], BioItemList.getPetriDish(null), true) + && this.mInventory[this.getInputSlot()].getTagCompound() != null + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1]) && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 1], + this.mInventory[this.getInputSlot() + 1], BioItemList.getPlasmidCell(null), true) - && this.mInventory[getInputSlot() + 1].getTagCompound() != null - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + && this.mInventory[this.getInputSlot() + 1].getTagCompound() != null + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2]) && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 2], + this.mInventory[this.getInputSlot() + 2], FluidLoader.BioLabFluidCells[2]) && this.mFluid != null && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000) { BioData cultureDNABioData = BioData - .getBioDataFromNBTTag(this.mInventory[getInputSlot() + 1].getTagCompound()); + .getBioDataFromNBTTag(this.mInventory[this.getInputSlot() + 1].getTagCompound()); BioCulture bioCulture = BioCulture - .getBioCultureFromNBTTag(this.mInventory[getInputSlot()].getTagCompound()); + .getBioCultureFromNBTTag(this.mInventory[this.getInputSlot()].getTagCompound()); if (cultureDNABioData == null || bioCulture == null) return super.checkRecipe(skipOC); if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 0; i < 3; i++) { - if (this.mInventory[getInputSlot() + i] != null) - this.mInventory[getInputSlot() + i].stackSize--; + if (this.mInventory[this.getInputSlot() + i] != null) + this.mInventory[this.getInputSlot() + i].stackSize--; } this.mFluid.amount -= 1000; bioCulture = bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); @@ -351,32 +357,33 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { ItemStack Outp = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); - if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) + if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()]) && GT_Utility + .areStacksEqual(this.mInventory[this.getInputSlot()], BioItemList.getPetriDish(null)) + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1]) && GT_Utility - .areStacksEqual(this.mInventory[getInputSlot()], BioItemList.getPetriDish(null)) - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) - && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 1], BioItemList.getOther(4)) - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + .areStacksEqual(this.mInventory[this.getInputSlot() + 1], BioItemList.getOther(4)) + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2]) && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 2], + this.mInventory[this.getInputSlot() + 2], ItemList.Circuit_Chip_Stemcell.get(2L)) - && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 3]) && GT_Utility.areStacksEqual( - this.mInventory[getInputSlot() + 3], + this.mInventory[this.getInputSlot() + 3], ItemList.Tool_DataOrb.get(1L), true) - && Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 3]).equals("DNA Sample") + && "DNA Sample" + .equals(Behaviour_DataOrb.getDataTitle(this.mInventory[this.getInputSlot() + 3])) && this.mFluid.isFluidEqual(dnaFluid) - && (this.mFluid.amount >= 8000)) { + && this.mFluid.amount >= 8000) { - BioData cultureDNABioData = BioData - .getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 3])); + BioData cultureDNABioData = BioData.getBioDataFromName( + Behaviour_DataOrb.getDataName(this.mInventory[this.getInputSlot() + 3])); if (cultureDNABioData == null) return super.checkRecipe(skipOC); if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 0; i < 3; i++) { - if (this.mInventory[getInputSlot() + i] != null) - this.mInventory[getInputSlot() + i].stackSize--; + if (this.mInventory[this.getInputSlot() + i] != null) + this.mInventory[this.getInputSlot() + i].stackSize--; } this.mFluid.amount -= 8000; if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index 2f4811270f..0597999155 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -63,12 +63,11 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { if (!aPlayer.isSneaking()) { --this.aAmps; if (this.aAmps < 0) this.aAmps = this.maxAmps; - GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + this.aAmps); } else { ++this.aAmps; if (this.aAmps > this.maxAmps) this.aAmps = 0; - GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + this.aAmps); } + GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + this.aAmps); } @Override @@ -104,7 +103,7 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { if (meta > ConfigHandler.IDOffset + GT_Values.VN.length && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 2) return 2L; - else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 2 + if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 2 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 3) return 4L; else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 3 @@ -119,6 +118,8 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { else return 0L; } + @Override + @SuppressWarnings("deprecation") public String[] getDescription() { return ArrayUtils.addAll( this.mDescriptionArray, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java index f2345fce09..167a3a4758 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java @@ -40,31 +40,37 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans super(aName, aTier, aDescription, aTextures); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_EnergyDistributor(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } + @Override public long maxEUInput() { return GT_Values.V[this.mTier]; } + @Override public long maxEUOutput() { return GT_Values.V[this.mTier]; } + @Override public long maxAmperesOut() { return 320; } + @Override public long maxAmperesIn() { return 320; } @Override public long maxEUStore() { - return 512L + (GT_Values.V[this.mTier] * 320L); + return 512L + GT_Values.V[this.mTier] * 320L; } + @Override public String[] getDescription() { return new String[] { StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index f709ece0b6..33589f45f6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -90,7 +90,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name") + " " + (aTier - 2) + " " - + ((aTier - 2) >= 2 ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") + + (aTier - 2 >= 2 ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") : StatCollector.translateToLocal("tooltip.bw.kg.0.name")), StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"), BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }); @@ -108,12 +108,12 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem } public int getSievert() { - return this.sievert - MathUtils.ceilInt((float) this.sievert / 100f * (float) this.coverage); + return this.sievert - MathUtils.ceilInt(this.sievert / 100f * this.coverage); } public short[] getColorForGUI() { if (this.colorForGUI != null) return this.colorForGUI; - return colorForGUI = new short[] { 0xFA, 0xFA, 0xFF }; + return this.colorForGUI = new short[] { 0xFA, 0xFA, 0xFF }; } public byte getMass() { @@ -159,29 +159,26 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { - BaseMetaTileEntity myMetaTileEntity = ((BaseMetaTileEntity) this.getBaseMetaTileEntity()); + BaseMetaTileEntity myMetaTileEntity = (BaseMetaTileEntity) this.getBaseMetaTileEntity(); if (myMetaTileEntity.isServerSide()) { if (this.mass > 0) { ++this.timer; } - if (this.mass > 0) { - if (this.decayTime == 0 || (this.decayTime > 0 && this.timer % this.decayTime == 0)) { - this.mass--; - if (this.mass == 0) { - this.material = StatCollector.translateToLocal("tooltip.bw.empty.name"); - this.sievert = 0; - } - this.timer = 1; + if (this.mass > 0 && (this.decayTime == 0 || this.decayTime > 0 && this.timer % this.decayTime == 0)) { + this.mass--; + if (this.mass == 0) { + this.material = StatCollector.translateToLocal("tooltip.bw.empty.name"); + this.sievert = 0; } + this.timer = 1; } - if (myMetaTileEntity.mTickTimer > (myMetaTileEntity.mLastSoundTick + ticksBetweenSounds)) { - if (this.sievert > 0) { - sendLoopStart((byte) 1); - myMetaTileEntity.mLastSoundTick = myMetaTileEntity.mTickTimer; - } + if (myMetaTileEntity.mTickTimer > myMetaTileEntity.mLastSoundTick + ticksBetweenSounds + && this.sievert > 0) { + this.sendLoopStart((byte) 1); + myMetaTileEntity.mLastSoundTick = myMetaTileEntity.mTickTimer; } if (this.mass == 0) { @@ -190,14 +187,13 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem if (lStack == null) { this.colorForGUI = new short[] { 0x37, 0x37, 0x37 }; return; + } + ItemData itemData = GT_OreDictUnificator.getAssociation(lStack); + if (itemData != null) { + Materials mat = itemData.mMaterial.mMaterial; + this.colorForGUI = new short[] { mat.getRGBA()[0], mat.getRGBA()[1], mat.getRGBA()[2] }; } else { - ItemData itemData = GT_OreDictUnificator.getAssociation(lStack); - if (itemData != null) { - Materials mat = itemData.mMaterial.mMaterial; - this.colorForGUI = new short[] { mat.getRGBA()[0], mat.getRGBA()[1], mat.getRGBA()[2] }; - } else { - this.colorForGUI = new short[] { 0x37, 0x37, 0x37 }; - } + this.colorForGUI = new short[] { 0x37, 0x37, 0x37 }; } if (this.lastFail && GT_Utility.areStacksEqual(this.lastUsedItem, lStack, true)) { @@ -211,7 +207,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem this.sievert = this.lastRecipe.mEUt; this.material = this.lastUsedItem.getDisplayName(); lStack.stackSize--; - updateSlots(); + this.updateSlots(); } else { this.lastRecipe = null; } @@ -223,7 +219,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem false, Integer.MAX_VALUE - 7, null, - mInventory[0]); + this.mInventory[0]); if (this.lastRecipe == null) { this.lastFail = true; this.lastUsedItem = this.mInventory[0] == null ? null : this.mInventory[0].copy(); @@ -240,7 +236,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem this.sievert = this.lastRecipe.mEUt; this.material = lStack.getDisplayName(); lStack.stackSize--; - updateSlots(); + this.updateSlots(); } } } @@ -271,7 +267,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem + "/" + (this.decayTime - this.timer % this.decayTime) / 20 / 60 / 60 + StatCollector.translateToLocal("tooltip.tile.radhatch.9.name") }; - else return new String[] { + return new String[] { StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + StatCollector.translateToLocal("tooltip.bw.empty.name"), StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + "0", @@ -283,6 +279,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem return true; } + @Override public boolean isFacingValid(ForgeDirection facing) { return true; } @@ -349,12 +346,12 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { buildContext.addSyncedWindow(RADIATION_SHUTTER_WINDOW_ID, this::createShutterWindow); - getBaseMetaTileEntity().add1by1Slot(builder); + this.getBaseMetaTileEntity().add1by1Slot(builder); builder.widget( new DrawableWidget().setBackground(BW_UITextures.PICTURE_SIEVERT_CONTAINER).setPos(61, 9) .setSize(56, 24)) .widget( - new ProgressBar().setProgress(() -> getSievert() / 148f).setDirection(Direction.RIGHT) + new ProgressBar().setProgress(() -> this.getSievert() / 148f).setDirection(Direction.RIGHT) .setTexture(BW_UITextures.PROGRESSBAR_SIEVERT, 24).setPos(65, 13).setSize(48, 16)) .widget( new DrawableWidget().setBackground(BW_UITextures.PICTURE_DECAY_TIME_INSIDE).setPos(124, 18) @@ -363,9 +360,19 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem @Override public void draw(float partialTicks) { - if (decayTime > 0) { - int height = MathUtils.ceilInt(48 * ((decayTime - timer % decayTime) / (float) decayTime)); - new Rectangle().setColor(Color.argb(colorForGUI[0], colorForGUI[1], colorForGUI[2], 255)) + if (GT_MetaTileEntity_RadioHatch.this.decayTime > 0) { + int height = MathUtils.ceilInt( + 48 * ((GT_MetaTileEntity_RadioHatch.this.decayTime + - GT_MetaTileEntity_RadioHatch.this.timer + % GT_MetaTileEntity_RadioHatch.this.decayTime) + / (float) GT_MetaTileEntity_RadioHatch.this.decayTime)); + new Rectangle() + .setColor( + Color.argb( + GT_MetaTileEntity_RadioHatch.this.colorForGUI[0], + GT_MetaTileEntity_RadioHatch.this.colorForGUI[1], + GT_MetaTileEntity_RadioHatch.this.colorForGUI[2], + 255)) .draw(new Pos2d(0, 48 - height), new Size(16, height), partialTicks); } } @@ -373,32 +380,31 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem () -> Collections.singletonList( StatCollector.translateToLocalFormatted( "tooltip.tile.radhatch.10.name", - timer <= 1 ? 0 : (decayTime - timer) / 20, - timer <= 1 ? 0 : decayTime / 20))) + this.timer <= 1 ? 0 : (this.decayTime - this.timer) / 20, + this.timer <= 1 ? 0 : this.decayTime / 20))) .setPos(124, 18).setSize(16, 48) .attachSyncer( - new FakeSyncWidget.LongSyncer(() -> decayTime, val -> decayTime = val), + new FakeSyncWidget.LongSyncer(() -> this.decayTime, val -> this.decayTime = val), builder, (widget, val) -> widget.notifyTooltipChange()) .attachSyncer( - new FakeSyncWidget.LongSyncer(() -> timer, val -> timer = val), + new FakeSyncWidget.LongSyncer(() -> this.timer, val -> this.timer = val), builder, (widget, val) -> widget.notifyTooltipChange())) - .widget(new FakeSyncWidget.ShortSyncer(() -> colorForGUI[0], val -> colorForGUI[0] = val)) - .widget(new FakeSyncWidget.ShortSyncer(() -> colorForGUI[1], val -> colorForGUI[1] = val)) - .widget(new FakeSyncWidget.ShortSyncer(() -> colorForGUI[2], val -> colorForGUI[2] = val)) + .widget(new FakeSyncWidget.ShortSyncer(() -> this.colorForGUI[0], val -> this.colorForGUI[0] = val)) + .widget(new FakeSyncWidget.ShortSyncer(() -> this.colorForGUI[1], val -> this.colorForGUI[1] = val)) + .widget(new FakeSyncWidget.ShortSyncer(() -> this.colorForGUI[2], val -> this.colorForGUI[2] = val)) .widget( new DrawableWidget().setBackground(BW_UITextures.PICTURE_DECAY_TIME_CONTAINER).setPos(120, 14) .setSize(24, 56)) .widget( TextWidget.dynamicString( - () -> StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", mass)) + () -> StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", this.mass)) .setTextAlignment(Alignment.Center).setPos(65, 62)) .widget( - TextWidget - .dynamicString( - () -> StatCollector - .translateToLocalFormatted("BW.NEI.display.radhatch.0", getSievert())) + TextWidget.dynamicString( + () -> StatCollector + .translateToLocalFormatted("BW.NEI.display.radhatch.0", this.getSievert())) .setTextAlignment(Alignment.Center).setPos(60, 72)) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { if (!widget.isClient()) { @@ -416,25 +422,26 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem private ModularWindow createShutterWindow(EntityPlayer player) { ModularWindow.Builder builder = ModularWindow.builder(176, 107); builder.setBackground(ModularUITextures.VANILLA_BACKGROUND); - builder.setGuiTint(getGUIColorization()); + builder.setGuiTint(this.getGUIColorization()); - builder.widget(new TextWidget("Radiation Shutter Control").setDefaultColor(COLOR_TITLE.get()).setPos(10, 9)) + builder.widget( + new TextWidget("Radiation Shutter Control").setDefaultColor(this.COLOR_TITLE.get()).setPos(10, 9)) .widget( new DrawableWidget().setDrawable(BW_UITextures.PICTURE_RADIATION_SHUTTER_FRAME).setPos(14, 27) .setSize(55, 54)) .widget( - new DrawableWidget() - .setDrawable( - () -> coverage < 100 ? BW_UITextures.PICTURE_RADIATION_SHUTTER_INSIDE : null) + new DrawableWidget().setDrawable( + () -> this.coverage < 100 ? BW_UITextures.PICTURE_RADIATION_SHUTTER_INSIDE : null) .setPos(16, 29).setSize(51, 50).attachSyncer( new FakeSyncWidget.ByteSyncer(this::getCoverage, this::setCoverage), builder, - (widget, val) -> widget.setPos(16, 29 + coverage / 2) - .setSize(51, 50 - coverage / 2))) + (widget, val) -> widget.setPos(16, 29 + this.coverage / 2) + .setSize(51, 50 - this.coverage / 2))) .widget( - new TextFieldWidget().setSetterInt(val -> coverage = val.byteValue()) - .setGetterInt(() -> (int) coverage).setNumbers(0, 100).setTextColor(Color.WHITE.dark(1)) - .setOnScrollNumbers(1, 5, 50).setTextAlignment(Alignment.CenterLeft) + new TextFieldWidget().setSetterInt(val -> this.coverage = val.byteValue()) + .setGetterInt(() -> (int) this.coverage).setNumbers(0, 100) + .setTextColor(Color.WHITE.dark(1)).setOnScrollNumbers(1, 5, 50) + .setTextAlignment(Alignment.CenterLeft) .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD.withOffset(-1, -1, 2, 2)) .setPos(86, 27).setSize(30, 12)) .widget(ButtonWidget.closeWindowButton(true).setPos(176 - 15, 3)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java index dc41d12cf7..51a73c1533 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java @@ -90,21 +90,18 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin @Override public void saveNBTData(NBTTagCompound nbtTagCompound) {} + @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { final ForgeDirection side = ForgeDirection.EAST; if (aBaseMetaTileEntity.inputEnergyFrom(side)) { TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(side); - if (!(tTileEntity instanceof IBasicEnergyContainer)) { - this.powered = false; - return; - } - IBasicEnergyContainer tileAtSide = (IBasicEnergyContainer) tTileEntity; - if (!tileAtSide.outputsEnergyTo(ForgeDirection.WEST) || !tileAtSide.isUniversalEnergyStored(4L)) { + if (!(tTileEntity instanceof IBasicEnergyContainer tileAtSide)) { this.powered = false; return; } - if (!tileAtSide.decreaseStoredEnergyUnits(4, false)) { + if (!tileAtSide.outputsEnergyTo(ForgeDirection.WEST) || !tileAtSide.isUniversalEnergyStored(4L) + || !tileAtSide.decreaseStoredEnergyUnits(4, false)) { this.powered = false; return; } @@ -117,6 +114,7 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin } } + @Override public long maxEUInput() { return GT_Values.V[this.mTier]; } @@ -131,6 +129,7 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin return this.powered ? 1L : 0; } + @Override public long maxEUOutput() { return this.powered ? GT_Values.V[this.mTier] : 0; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java index 3113991fd0..bcac09fde6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java @@ -40,16 +40,18 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { } } + @Override public TemplateRecipeHandler newInstance() { return new BW_NEI_BioLabHandler(this.mRecipeMap); } + @Override public void loadCraftingRecipes(ItemStack aResult) { if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { - for (CachedDefaultRecipe recipe : getCache()) - if (NEI_BW_Config.checkRecipe(aResult, recipe.mOutputs)) arecipes.add(recipe); + for (CachedDefaultRecipe recipe : this.getCache()) + if (NEI_BW_Config.checkRecipe(aResult, recipe.mOutputs)) this.arecipes.add(recipe); } else { super.loadCraftingRecipes(aResult); } @@ -60,8 +62,8 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { - for (CachedDefaultRecipe recipe : getCache()) - if (NEI_BW_Config.checkRecipe(aResult, recipe.mInputs)) arecipes.add(recipe); + for (CachedDefaultRecipe recipe : this.getCache()) + if (NEI_BW_Config.checkRecipe(aResult, recipe.mInputs)) this.arecipes.add(recipe); } else { super.loadUsageRecipes(aResult); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index e377a5d91b..a7b170961d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -49,13 +49,13 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { } private void loadLabPartRecipes(ItemStack aResult) { - for (CachedDefaultRecipe recipe : getCache()) { + for (CachedDefaultRecipe recipe : this.getCache()) { // dirty way of finding the special slot item // see constructor of CachedDefaultRecipe on why relx==120 and rely==52 means special slot for (PositionedStack stack : recipe.mInputs) { - if (stack.relx == 120 && stack.rely == 52) { - if (NEI_BW_Config.checkRecipe(aResult, Collections.singletonList(stack))) arecipes.add(recipe); - } + if (stack.relx == 120 && stack.rely == 52 + && NEI_BW_Config.checkRecipe(aResult, Collections.singletonList(stack))) + this.arecipes.add(recipe); } } } @@ -65,7 +65,7 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { - loadLabPartRecipes(aResult); + this.loadLabPartRecipes(aResult); } else { super.loadUsageRecipes(aResult); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index ad99e50626..703074d07d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -69,7 +69,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void loadCraftingRecipes(String outputId, Object... results) { - if (outputId.equalsIgnoreCase("quickanddirtyneihandler")) { + if ("quickanddirtyneihandler".equalsIgnoreCase(outputId)) { HashSet result = new HashSet<>(); Werkstoff.werkstoffHashSet.stream().filter(w -> w.hasGenerationFeature(OrePrefixes.ore)) .forEach(w -> result.add(w.get(OrePrefixes.ore))); @@ -83,7 +83,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { this.arecipes.clear(); this.arecipes.addAll(hashSet); } - if (outputId.equals("item")) { + if ("item".equals(outputId)) { this.loadCraftingRecipes((ItemStack) results[0]); HashSet hashSet = new HashSet<>(this.arecipes); this.arecipes.clear(); @@ -93,7 +93,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void drawExtras(int recipe) { - if ((recipe < this.arecipes.size()) && (this.arecipes.get(recipe) instanceof CachedOreRecipe)) { + if (recipe < this.arecipes.size() && this.arecipes.get(recipe) instanceof CachedOreRecipe) { CachedOreRecipe cachedOreRecipe = (CachedOreRecipe) this.arecipes.get(recipe); if (cachedOreRecipe == null || cachedOreRecipe.getOtherStacks() == null @@ -131,11 +131,9 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(2).item.getDisplayName(), 0, 100, 0, false); GuiDraw.drawString(ChatColorHelper.BOLD + "Sporadic:", 0, 110, 0, false); GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(3).item.getDisplayName(), 0, 120, 0, false); - } else { - if (cachedOreRecipe.worldGen != null) { - GuiDraw.drawString(ChatColorHelper.BOLD + "Amount per Chunk:", 0, 70, 0, false); - GuiDraw.drawString(cachedOreRecipe.worldGen.mDensity + "", 0, 80, 0, false); - } + } else if (cachedOreRecipe.worldGen != null) { + GuiDraw.drawString(ChatColorHelper.BOLD + "Amount per Chunk:", 0, 70, 0, false); + GuiDraw.drawString(cachedOreRecipe.worldGen.mDensity + "", 0, 80, 0, false); } } super.drawExtras(recipe); @@ -145,11 +143,9 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public void loadCraftingRecipes(ItemStack result) { Block ore = Block.getBlockFromItem(result.getItem()); if (ore instanceof BW_MetaGenerated_Ores) { - BW_OreLayer.NEIMAP.get((short) result.getItemDamage()).stream() - .filter( - l -> !(ore instanceof BW_MetaGenerated_SmallOres) - || !(l.getClass().equals(BW_WorldGenRoss128b.class) - || l.getClass().equals(BW_WorldGenRoss128ba.class))) + BW_OreLayer.NEIMAP.get((short) result.getItemDamage()).stream().filter( + l -> !(ore instanceof BW_MetaGenerated_SmallOres) || !l.getClass().equals(BW_WorldGenRoss128b.class) + && !l.getClass().equals(BW_WorldGenRoss128ba.class)) .forEach( l -> this.arecipes .add(new CachedOreRecipe(l, result, ore instanceof BW_MetaGenerated_SmallOres))); @@ -187,9 +183,9 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public List getOtherStacks() { List ret = new ArrayList<>(); int x = 0; - for (int i = 0; i < (small ? 1 : 4); i++) { + for (int i = 0; i < (this.small ? 1 : 4); i++) { x += 20; - ret.add(new PositionedStack(worldGen.getStacks().get(i), x, 12)); + ret.add(new PositionedStack(this.worldGen.getStacks().get(i), x, 12)); } return ret; } @@ -197,14 +193,13 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public boolean equals(Object o) { if (this == o) return true; - if (!(o instanceof CachedOreRecipe)) return false; - CachedOreRecipe that = (CachedOreRecipe) o; - return Objects.equals(worldGen, that.worldGen); + if (!(o instanceof CachedOreRecipe that)) return false; + return Objects.equals(this.worldGen, that.worldGen); } @Override public int hashCode() { - return worldGen.hashCode(); + return this.worldGen.hashCode(); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java index 7231995517..7445946828 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java @@ -45,9 +45,9 @@ public class ServerEventHandler { // FMLCommonHandler.instance().bus() @SubscribeEvent(priority = EventPriority.HIGHEST) public void onPlayerTickEventServer(TickEvent.PlayerTickEvent event) { - if (event == null || !(event.player instanceof EntityPlayerMP)) return; - - if (event.player.worldObj.getTotalWorldTime() % 20 != 0) return; + if (event == null || !(event.player instanceof EntityPlayerMP) + || event.player.worldObj.getTotalWorldTime() % 20 != 0) + return; boolean replace = false; ItemStack toReplace = null; @@ -70,17 +70,16 @@ public class ServerEventHandler { } toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize); break loop; - } else { - for (String s : e.getADDITIONAL_OREDICT()) { - if (oreDictName.contains(s)) { - String prefix = oreDictName.replace(s, ""); - OrePrefixes prefixes = OrePrefixes.getPrefix(prefix); - if (prefixes == null) { - continue; - } - toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize); - break loop; + } + for (String s : e.getADDITIONAL_OREDICT()) { + if (oreDictName.contains(s)) { + String prefix = oreDictName.replace(s, ""); + OrePrefixes prefixes = OrePrefixes.getPrefix(prefix); + if (prefixes == null) { + continue; } + toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize); + break loop; } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java index 651bf98047..24402ac369 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java @@ -37,38 +37,37 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { super(par1); } + @Override public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { return false; } + @Override public String getUnlocalizedName(ItemStack aStack) { return this.field_150939_a.getUnlocalizedName() + "." + this.getDamage(aStack); } + @Override public String getItemStackDisplayName(ItemStack aStack) { Block block = Block.getBlockFromItem(aStack.getItem()); - if (block != null) { - if (block instanceof BW_MetaGenerated_Blocks) { - int aMetaData = aStack.getItemDamage(); - Werkstoff werkstoff = werkstoffHashMap.get((short) aMetaData); - if (werkstoff == null) werkstoff = Werkstoff.default_null_Werkstoff; - return ((BW_MetaGenerated_Blocks) block).blockTypeLocalizedName - .replace("%material", werkstoff.getLocalizedName()); - } + if (block instanceof BW_MetaGenerated_Blocks metaBlock) { + int aMetaData = aStack.getItemDamage(); + Werkstoff werkstoff = werkstoffHashMap.get((short) aMetaData); + if (werkstoff == null) werkstoff = Werkstoff.default_null_Werkstoff; + return metaBlock.blockTypeLocalizedName.replace("%material", werkstoff.getLocalizedName()); } - return GT_LanguageManager.getTranslation(getUnlocalizedName(aStack) + ".name"); + return GT_LanguageManager.getTranslation(this.getUnlocalizedName(aStack) + ".name"); } @Override @SideOnly(Side.CLIENT) - @SuppressWarnings("unchecked") - public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { if (!GT_Utility.isStackValid(aStack) || aPlayer == null || aStack.getItemDamage() <= 0) { return; } if (aList == null) { - aList = new ArrayList(); + aList = new ArrayList<>(); } Werkstoff werkstoff = Werkstoff.werkstoffHashMap.get((short) aStack.getItemDamage()); if (werkstoff != null) { @@ -88,6 +87,7 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { } } + @Override public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { short tDamage = (short) this.getDamage(aStack); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java index ca8b06151d..fef152ec40 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -83,18 +83,17 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks @Override public String getUnlocalizedName() { - if (_prefixes == OrePrefixes.blockCasing) return "bw.werkstoffblockscasing.01"; - else if (_prefixes == OrePrefixes.blockCasingAdvanced) return "bw.werkstoffblockscasingadvanced.01"; + if (this._prefixes == OrePrefixes.blockCasing) return "bw.werkstoffblockscasing.01"; + if (this._prefixes == OrePrefixes.blockCasingAdvanced) return "bw.werkstoffblockscasingadvanced.01"; return ""; } @Override @SideOnly(Side.CLIENT) - @SuppressWarnings("unchecked") - public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { + public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { Werkstoff.werkstoffHashSet.stream() .filter( - pMaterial -> pMaterial.getType().equals(Werkstoff.Types.BIOLOGICAL) + pMaterial -> Werkstoff.Types.BIOLOGICAL.equals(pMaterial.getType()) && pMaterial.hasGenerationFeature(OrePrefixes.blockCasing) || pMaterial.doesOreDictedItemExists(OrePrefixes.plate) && pMaterial.doesOreDictedItemExists(OrePrefixes.screw) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java index b53bd71e4b..9f1b197b8d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java @@ -36,7 +36,7 @@ public class BW_MetaGeneratedBlocks_CasingAdvanced_TE extends BW_MetaGenerated_B public ITexture[] getTexture(Block aBlock, ForgeDirection side) { if (SideReference.Side.Client) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); - if ((aMaterial != null)) { + if (aMaterial != null) { TextureSet set = aMaterial.getTexSet(); ITexture aIconSet = TextureFactory.of( PrefixTextureLinker.texMapBlocks.get(OrePrefixes.blockCasingAdvanced) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java index fda24e869b..f23fc3a912 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java @@ -36,7 +36,7 @@ public class BW_MetaGeneratedBlocks_Casing_TE extends BW_MetaGenerated_Block_TE public ITexture[] getTexture(Block aBlock, ForgeDirection side) { if (SideReference.Side.Client) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); - if ((aMaterial != null)) { + if (aMaterial != null) { TextureSet set = aMaterial.getTexSet(); ITexture aIconSet = TextureFactory.of( PrefixTextureLinker.texMapBlocks.get(OrePrefixes.blockCasing) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java index cb876af9bc..ee322c5634 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java @@ -40,13 +40,13 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { public BW_MetaGeneratedFrames(int aID, String aName, String aNameRegional, Werkstoff aMaterial) { super(aID, aName, aNameRegional, 0); - mMaterial = aMaterial; + this.mMaterial = aMaterial; - GT_OreDictUnificator.registerOre(OrePrefixes.frameGt, aMaterial, getStackForm(1)); + GT_OreDictUnificator.registerOre(OrePrefixes.frameGt, aMaterial, this.getStackForm(1)); GT_ModHandler.addCraftingRecipe( - getStackForm(2), + this.getStackForm(2), RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "SSS", "SwS", "SSS", 'S', mMaterial.get(OrePrefixes.stick) }); + new Object[] { "SSS", "SwS", "SSS", 'S', this.mMaterial.get(OrePrefixes.stick) }); RA.stdBuilder() .itemInputs( @@ -57,7 +57,7 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { private BW_MetaGeneratedFrames(String aName, Werkstoff aMaterial) { super(aName, 0); - mMaterial = aMaterial; + this.mMaterial = aMaterial; } @Override @@ -129,10 +129,12 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { return false; } + @Override public int connect(ForgeDirection side) { return 0; } + @Override public void disconnect(ForgeDirection side) { /* Do nothing */ } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index 7383b41b54..f4bf46dbe0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -26,7 +26,7 @@ public class BW_MetaGeneratedOreTE extends BW_MetaGenerated_Block_TE { @Override public ITexture[] getTexture(Block aBlock, ForgeDirection side) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); - if ((aMaterial != null)) { + if (aMaterial != null) { ITexture aIconSet = TextureFactory .of(aMaterial.getTexSet().mTextures[OrePrefixes.ore.mTextureIndex], aMaterial.getRGBA()); return new ITexture[] { TextureFactory.of(Blocks.stone), aIconSet }; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java index ed3285eaa0..de4dbb1cbc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java @@ -31,6 +31,7 @@ import gregtech.api.util.GT_Utility; public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { + @Override public ArrayList getDrops(int aFortune) { ArrayList rList = new ArrayList<>(); Materials aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData).getBridgeMaterial(); @@ -100,7 +101,7 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { if (tSelector.size() > 0) { int i = 0; - for (int j = Math.max(1, (aFortune > 0 ? tRandom.nextInt(1 + aFortune) : 0)); i < j; ++i) { + for (int j = Math.max(1, aFortune > 0 ? tRandom.nextInt(1 + aFortune) : 0); i < j; ++i) { rList.add(GT_Utility.copyAmount(1L, tSelector.get(tRandom.nextInt(tSelector.size())))); } } @@ -118,7 +119,7 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { @Override public ITexture[] getTexture(Block aBlock, ForgeDirection side) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); - if ((aMaterial != null)) { + if (aMaterial != null) { ITexture aIconSet = TextureFactory .of(aMaterial.getTexSet().mTextures[OrePrefixes.oreSmall.mTextureIndex], aMaterial.getRGBA()); return new ITexture[] { TextureFactory.of(Blocks.stone), aIconSet }; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java index 7492512e75..5aba6c84a1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java @@ -32,15 +32,18 @@ public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements IT public short mMetaData; + @Override public boolean canUpdate() { return false; } + @Override public void readFromNBT(NBTTagCompound aNBT) { super.readFromNBT(aNBT); this.mMetaData = aNBT.getShort("m"); } + @Override public void writeToNBT(NBTTagCompound aNBT) { aNBT.setShort("m", this.mMetaData); super.writeToNBT(aNBT); @@ -64,7 +67,7 @@ public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements IT rList.add(new ItemStack(Blocks.cobblestone, 1, 0)); return rList; } - rList.add(new ItemStack(GetProperBlock(), 1, this.mMetaData)); + rList.add(new ItemStack(this.GetProperBlock(), 1, this.mMetaData)); return rList; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java index ad850c2c5f..c9dd83db6c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java @@ -50,11 +50,11 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { this.setResistance(5.0F); this.setBlockTextureName("stone"); this.setCreativeTab(metaTab); - _prefixes = types; - if (_prefixes != null) { + this._prefixes = types; + if (this._prefixes != null) { this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization( - "bw.blocktype." + _prefixes, - _prefixes.mLocalizedMaterialPre + "%material" + _prefixes.mLocalizedMaterialPost); + "bw.blocktype." + this._prefixes, + this._prefixes.mLocalizedMaterialPre + "%material" + this._prefixes.mLocalizedMaterialPost); } Werkstoff.werkstoffHashSet.forEach(this::doRegistrationStuff); } @@ -69,7 +69,7 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { @SideOnly(Side.CLIENT) public final BW_MetaGenerated_Block_TE getProperTileEntityForRendering() { - return (BW_MetaGenerated_Block_TE) createNewTileEntity(null, 0); + return (BW_MetaGenerated_Block_TE) this.createNewTileEntity(null, 0); } protected abstract void doRegistrationStuff(Werkstoff w); @@ -79,19 +79,22 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { return "pickaxe"; } + @Override protected boolean canSilkHarvest() { return false; } + @Override public int getRenderType() { if (BW_Renderer_Block_Ores.INSTANCE == null) return super.getRenderType(); return BW_Renderer_Block_Ores.INSTANCE.mRenderID; } + @Override public int getDamageValue(World aWorld, int aX, int aY, int aZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (((tTileEntity instanceof BW_MetaGenerated_Block_TE))) { - return ((BW_MetaGenerated_Block_TE) tTileEntity).mMetaData; + if (tTileEntity instanceof BW_MetaGenerated_Block_TE metaTE) { + return metaTE.mMetaData; } return 0; } @@ -106,18 +109,20 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { return true; } + @Override public void breakBlock(World world, int x, int y, int z, Block block, int meta) { TileEntity tTileEntity = world.getTileEntity(x, y, z); - if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) { - mTemporaryTileEntity.set((BW_MetaGenerated_Block_TE) tTileEntity); + if (tTileEntity instanceof BW_MetaGenerated_Block_TE metaTE) { + mTemporaryTileEntity.set(metaTE); } super.breakBlock(world, x, y, z, block, meta); } + @Override public ArrayList getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) { - return ((BW_MetaGenerated_Block_TE) tTileEntity).getDrops(aFortune); + if (tTileEntity instanceof BW_MetaGenerated_Block_TE metaTE) { + return metaTE.getDrops(aFortune); } return mTemporaryTileEntity.get() == null ? new ArrayList<>() : mTemporaryTileEntity.get().getDrops(aFortune); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index fde9c8e9ee..7f9a3196dd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -84,20 +84,21 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } } + @Override public boolean onEntityItemUpdate(EntityItem aItemEntity) { if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure || this.orePrefixes == OrePrefixes.crushed) { int aDamage = aItemEntity.getEntityItem().getItemDamage(); - if ((aDamage >= 0) && (!aItemEntity.worldObj.isRemote)) { + if (aDamage >= 0 && !aItemEntity.worldObj.isRemote) { Werkstoff aMaterial = werkstoffHashMap.get((short) aDamage); - if ((aMaterial != null) && (aMaterial != Werkstoff.default_null_Werkstoff)) { + if (aMaterial != null && aMaterial != Werkstoff.default_null_Werkstoff) { int tX = MathHelper.floor_double(aItemEntity.posX); int tY = MathHelper.floor_double(aItemEntity.posY); int tZ = MathHelper.floor_double(aItemEntity.posZ); Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); - if ((this.orePrefixes == OrePrefixes.dustImpure) || (this.orePrefixes == OrePrefixes.dustPure)) { - if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { + if (tBlock == Blocks.cauldron && tMetaData > 0) { + if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure) { aItemEntity.setEntityItemStack( WerkstoffLoader.getCorrespondingItemStack( OrePrefixes.dust, @@ -105,9 +106,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; - } - } else { - if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { + } else { aItemEntity.setEntityItemStack( WerkstoffLoader.getCorrespondingItemStack( OrePrefixes.crushedPurified, @@ -124,8 +123,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } @Override - @SuppressWarnings("unchecked") - protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { + protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure) { aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify")); } @@ -159,13 +157,13 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa int aMetaData = aStack.getItemDamage(); Werkstoff werkstoff = werkstoffHashMap.get((short) aMetaData); if (werkstoff == null) werkstoff = Werkstoff.default_null_Werkstoff; - return itemTypeLocalizedName.replace("%material", werkstoff.getLocalizedName()); + return this.itemTypeLocalizedName.replace("%material", werkstoff.getLocalizedName()); } @Override public IIconContainer getIconContainer(int aMetaData) { if (werkstoffHashMap.get((short) aMetaData) == null) return null; - if (this.orePrefixes.mTextureIndex == -1) return getIconContainerBartWorks(aMetaData); + if (this.orePrefixes.mTextureIndex == -1) return this.getIconContainerBartWorks(aMetaData); return werkstoffHashMap.get((short) aMetaData).getTexSet().mTextures[this.orePrefixes.mTextureIndex]; } @@ -177,8 +175,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override @SideOnly(Side.CLIENT) - @SuppressWarnings("unchecked") - public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { + public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { for (Werkstoff werkstoff : werkstoffHashSet) { if (werkstoff != null && werkstoff.hasItemType(this.orePrefixes)) { ItemStack tStack = new ItemStack(this, 1, werkstoff.getmID()); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 36d7eb46fc..08251573b3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -42,9 +42,10 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { OrePrefixes.ore.mLocalizedMaterialPre + "%material" + OrePrefixes.ore.mLocalizedMaterialPost); } + @Override protected void doRegistrationStuff(Werkstoff w) { if (w != null) { - if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) return; + if (!w.hasItemType(OrePrefixes.ore) || (w.getGenerationFeatures().blacklist & 0b1000) != 0) return; GT_ModHandler.addValuableOre(this, w.getmID(), 1); } } @@ -57,26 +58,22 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { Block tBlock = aWorld.getBlock(aX, aY, aZ); Block tOreBlock = WerkstoffLoader.BWOres; - if (aMetaData < 0 || tBlock == Blocks.air && !air) { + if (aMetaData < 0 || tBlock == Blocks.air && !air + || Block.getIdFromBlock(tBlock) != Block.getIdFromBlock(block)) { return false; - } else { - - if (Block.getIdFromBlock(tBlock) != Block.getIdFromBlock(block)) { - return false; - } - final int aaY = aY; - if (Arrays.stream(aBlockMeta).noneMatch(e -> e == aWorld.getBlockMetadata(aX, aaY, aZ))) { - return false; - } - - aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0); - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (tTileEntity instanceof BW_MetaGeneratedOreTE) { - ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = (short) aMetaData; - } + } + final int aaY = aY; + if (Arrays.stream(aBlockMeta).noneMatch(e -> e == aWorld.getBlockMetadata(aX, aaY, aZ))) { + return false; + } - return true; + aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0); + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof BW_MetaGeneratedOreTE metaTE) { + metaTE.mMetaData = (short) aMetaData; } + + return true; } @Override @@ -85,10 +82,11 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { } @Override - public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) { + public IIcon getIcon(IBlockAccess worldIn, int x, int y, int z, int side) { return Blocks.stone.getIcon(0, 0); } + @Override public int getHarvestLevel(int metadata) { return 3; } @@ -99,26 +97,12 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { } @Override - @SuppressWarnings("unchecked") - public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { + public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { for (Werkstoff tMaterial : Werkstoff.werkstoffHashSet) { - if ((tMaterial != null) && tMaterial.hasItemType(OrePrefixes.ore) - && ((tMaterial.getGenerationFeatures().blacklist & 0x8) == 0)) { + if (tMaterial != null && tMaterial.hasItemType(OrePrefixes.ore) + && (tMaterial.getGenerationFeatures().blacklist & 0x8) == 0) { aList.add(new ItemStack(aItem, 1, tMaterial.getmID())); } } } - - @SuppressWarnings("unused") - private boolean checkForAir(IBlockAccess aWorld, int aX, int aY, int aZ) { - for (int x = -1; x <= 1; x++) { - for (int y = -1; y <= 1; y++) { - for (int z = -1; z <= 1; z++) { - if (x == 0 && y == 0 && z == 0) continue; - if (aWorld.getBlock(aX + x, aY + y, aZ + z).isAir(aWorld, aX + x, aY + y, aZ + z)) return true; - } - } - } - return false; - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java index 54825526de..fc6b757361 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java @@ -37,7 +37,7 @@ public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { @Override protected void doRegistrationStuff(Werkstoff w) { if (w != null) { - if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) return; + if (!w.hasItemType(OrePrefixes.ore) || (w.getGenerationFeatures().blacklist & 0b1000) != 0) return; GT_ModHandler.addValuableOre(this, w.getmID(), 1); } } @@ -55,25 +55,21 @@ public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { Block tBlock = aWorld.getBlock(aX, aY, aZ); Block tOreBlock = WerkstoffLoader.BWSmallOres; - if (aMetaData < 0 || tBlock == Blocks.air && !air) { + if (aMetaData < 0 || tBlock == Blocks.air && !air + || Block.getIdFromBlock(tBlock) != Block.getIdFromBlock(block)) { return false; - } else { - - if (Block.getIdFromBlock(tBlock) != Block.getIdFromBlock(block)) { - return false; - } - final int aaY = aY; - if (Arrays.stream(aBlockMeta).noneMatch(e -> e == aWorld.getBlockMetadata(aX, aaY, aZ))) { - return false; - } - - aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0); - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (tTileEntity instanceof BW_MetaGeneratedOreTE) { - ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = (short) aMetaData; - } + } + final int aaY = aY; + if (Arrays.stream(aBlockMeta).noneMatch(e -> e == aWorld.getBlockMetadata(aX, aaY, aZ))) { + return false; + } - return true; + aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0); + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof BW_MetaGeneratedOreTE metaTE) { + metaTE.mMetaData = (short) aMetaData; } + + return true; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java index bfcfbc0e8b..f82b90863a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java @@ -31,7 +31,7 @@ public class BW_MetaGenerated_WerkstoffBlock_TE extends BW_MetaGenerated_Block_T public ITexture[] getTexture(Block aBlock, ForgeDirection side) { if (SideReference.Side.Client) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); - if ((aMaterial != null)) { + if (aMaterial != null) { TextureSet set = aMaterial.getTexSet(); ITexture aIconSet = TextureFactory.of( set.mTextures[PrefixTextureLinker.blockTexMap diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java index 9c7d251688..8e149391cd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java @@ -51,13 +51,12 @@ public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks { } @Override - public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) { + public IIcon getIcon(IBlockAccess worldIn, int x, int y, int z, int side) { return Blocks.iron_block.getIcon(0, 0); } @Override - @SuppressWarnings("unchecked") - public void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) { + public void getSubBlocks(Item aItem, CreativeTabs tab, List aList) { Werkstoff.werkstoffHashSet.stream() .filter(tMaterial -> tMaterial.hasItemType(OrePrefixes.gem) || tMaterial.hasItemType(OrePrefixes.ingot)) .map(tMaterial -> new ItemStack(aItem, 1, tMaterial.getmID())).forEach(aList::add); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java index 67bfa6c0af..3315bfea4c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java @@ -40,86 +40,88 @@ public enum BW_NonMeta_MaterialItems implements IItemContainer { @Override public IItemContainer set(Item aItem) { - mHasNotBeenSet = false; + this.mHasNotBeenSet = false; if (aItem == null) return this; ItemStack aStack = new ItemStack(aItem, 1, 0); - mStack = GT_Utility.copyAmount(1, aStack); + this.mStack = GT_Utility.copyAmount(1, aStack); return this; } @Override public IItemContainer set(ItemStack aStack) { - mHasNotBeenSet = false; - mStack = GT_Utility.copyAmount(1, aStack); + this.mHasNotBeenSet = false; + this.mStack = GT_Utility.copyAmount(1, aStack); return this; } @Override public Item getItem() { - if (mHasNotBeenSet) - throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); - if (GT_Utility.isStackInvalid(mStack)) return null; - return mStack.getItem(); + if (this.mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(this.mStack)) return null; + return this.mStack.getItem(); } @Override public Block getBlock() { - if (mHasNotBeenSet) - throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); - return GT_Utility.getBlockFromItem(getItem()); + if (this.mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); + return GT_Utility.getBlockFromItem(this.getItem()); } @Override public final boolean hasBeenSet() { - return !mHasNotBeenSet; + return !this.mHasNotBeenSet; } @Override public boolean isStackEqual(Object aStack) { - return isStackEqual(aStack, false, false); + return this.isStackEqual(aStack, false, false); } @Override public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT) { if (GT_Utility.isStackInvalid(aStack)) return false; - return GT_Utility.areUnificationsEqual((ItemStack) aStack, aWildcard ? getWildcard(1) : get(1), aIgnoreNBT); + return GT_Utility + .areUnificationsEqual((ItemStack) aStack, aWildcard ? this.getWildcard(1) : this.get(1), aIgnoreNBT); } @Override public ItemStack get(long aAmount, Object... aReplacements) { - if (mHasNotBeenSet) - throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); - if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); - return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(mStack)); + if (this.mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(this.mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(this.mStack)); } @Override public ItemStack getWildcard(long aAmount, Object... aReplacements) { - if (mHasNotBeenSet) - throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); - if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); - return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(mStack)); + if (this.mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(this.mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(this.mStack)); } @Override public ItemStack getUndamaged(long aAmount, Object... aReplacements) { - if (mHasNotBeenSet) - throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); - if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); - return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(mStack)); + if (this.mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(this.mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(this.mStack)); } @Override public ItemStack getAlmostBroken(long aAmount, Object... aReplacements) { - if (mHasNotBeenSet) - throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); - if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); - return GT_Utility.copyAmountAndMetaData(aAmount, mStack.getMaxDamage() - 1, GT_OreDictUnificator.get(mStack)); + if (this.mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(this.mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility + .copyAmountAndMetaData(aAmount, this.mStack.getMaxDamage() - 1, GT_OreDictUnificator.get(this.mStack)); } @Override public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements) { - ItemStack rStack = get(1, aReplacements); + ItemStack rStack = this.get(1, aReplacements); if (GT_Utility.isStackInvalid(rStack)) return null; rStack.setStackDisplayName(aDisplayName); return GT_Utility.copyAmount(aAmount, rStack); @@ -127,7 +129,7 @@ public enum BW_NonMeta_MaterialItems implements IItemContainer { @Override public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements) { - ItemStack rStack = get(1, aReplacements); + ItemStack rStack = this.get(1, aReplacements); if (GT_Utility.isStackInvalid(rStack)) return null; GT_ModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false); return GT_Utility.copyAmount(aAmount, rStack); @@ -135,25 +137,25 @@ public enum BW_NonMeta_MaterialItems implements IItemContainer { @Override public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements) { - if (mHasNotBeenSet) - throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); - if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); - return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(mStack)); + if (this.mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(this.mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(this.mStack)); } @Override public IItemContainer registerOre(Object... aOreNames) { - if (mHasNotBeenSet) - throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); - for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, get(1)); + if (this.mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); + for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, this.get(1)); return this; } @Override public IItemContainer registerWildcardAsOre(Object... aOreNames) { - if (mHasNotBeenSet) - throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); - for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, getWildcard(1)); + if (this.mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); + for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, this.getWildcard(1)); return this; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index 69c66b9474..11200e95c9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -92,7 +92,6 @@ public class BW_Meta_Items { BW_Util.CLEANROOM)); } - @SuppressWarnings("deprecation") public void addNewCircuit(int aTier, int aID, String aName) { String additionalOreDictData = ""; @@ -147,7 +146,7 @@ public class BW_Meta_Items { ItemStack tStack = BW_Meta_Items.NEWCIRCUITS.addCircuit(aID, aName, tooltip, aTier); - GT_OreDictUnificator.registerOre((aOreDictPrefix + additionalOreDictData).replaceAll(" ", ""), tStack); + GT_OreDictUnificator.registerOre((aOreDictPrefix + additionalOreDictData).replace(" ", ""), tStack); } public static class BW_GT_MetaGenCircuits extends BW_Meta_Items.BW_GT_MetaGen_Item_Hook { @@ -159,7 +158,7 @@ public class BW_Meta_Items { public final ItemStack addCircuit(int aID, String aEnglish, String aToolTip, int tier) { CircuitImprintLoader.bwCircuitTagMap.put( new CircuitData( - BW_Util.getMachineVoltageFromTier(Math.min(1, (tier - 2))), + BW_Util.getMachineVoltageFromTier(Math.min(1, tier - 2)), tier > 2 ? BW_Util.CLEANROOM : 0, (byte) tier), new ItemStack(BW_Meta_Items.NEWCIRCUITS, 1, aID)); @@ -185,8 +184,7 @@ public class BW_Meta_Items { } @Override - @SuppressWarnings("unchecked") - public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { + public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { if (aCreativeTab == this.getCreativeTab()) for (NBTTagCompound tag : CircuitImprintLoader.recipeTagMap.keySet()) { ItemStack stack = new ItemStack(BW_Meta_Items.NEWCIRCUITS, 1, 0); @@ -196,6 +194,7 @@ public class BW_Meta_Items { super.getSubItems(var1, aCreativeTab, aList); } + @Override @SideOnly(Side.CLIENT) public final void registerIcons(IIconRegister aIconRegister) { @@ -230,8 +229,7 @@ public class BW_Meta_Items { } @Override - @SuppressWarnings("unchecked") - protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { + protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { if (aStack.getItemDamage() == 0) if (aStack.getTagCompound() != null && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) aList.add( @@ -303,10 +301,8 @@ public class BW_Meta_Items { Object tRandomData; for (var9 = 0; var9 < var8; ++var9) { tRandomData = var7[var9]; - if (tRandomData instanceof SubTag) { - if (tRandomData == SubTag.NO_UNIFICATION) { - GT_OreDictUnificator.addToBlacklist(rStack); - } + if (tRandomData instanceof SubTag && tRandomData == SubTag.NO_UNIFICATION) { + GT_OreDictUnificator.addToBlacklist(rStack); } } @@ -351,9 +347,9 @@ public class BW_Meta_Items { return rStack; } + @Override @SideOnly(Side.CLIENT) - @SuppressWarnings("unchecked") - public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { + public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { int j = this.mEnabledItems.length(); for (int i = 0; i < j; ++i) { @@ -366,8 +362,7 @@ public class BW_Meta_Items { } @Override - @SuppressWarnings("unchecked") - protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { + protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { super.addAdditionalToolTips(aList, aStack, aPlayer); aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java index da02250010..49fba31ec8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java @@ -32,10 +32,8 @@ public class CircuitData { @Override public boolean equals(Object o) { if (this == o) return true; - if (!(o instanceof CircuitData)) return false; - CircuitData that = (CircuitData) o; - if (this.getaVoltage() != that.getaVoltage()) return false; - if (this.getaSpecial() != that.getaSpecial()) return false; + if (!(o instanceof CircuitData that)) return false; + if (this.getaVoltage() != that.getaVoltage() || this.getaSpecial() != that.getaSpecial()) return false; return this.getaTier() == that.getaTier(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 91ac70820f..9d8675406f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -60,7 +60,6 @@ public class CircuitImprintLoader { private static final HashSet ORIGINAL_CAL_RECIPES = new HashSet<>(); private static final HashSet MODIFIED_CAL_RECIPES = new HashSet<>(); - @SuppressWarnings({ "unused", "RedundantSuppression" }) public static void run() { HashSet toRem = new HashSet<>(); HashSet toAdd = new HashSet<>(); @@ -112,24 +111,13 @@ public class CircuitImprintLoader { if (newRecipe != null) BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(newRecipe); addCutoffRecipeToSets(toRem, toAdd, circuitRecipe); - } else { - if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) toRem.add(circuitRecipe); - } + } else if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) toRem.add(circuitRecipe); } } - @Deprecated - private static String getTypeFromOreDict(ItemStack[] outputs) { - int[] oreIDS = OreDictionary.getOreIDs(outputs[0]); - - if (oreIDS.length < 1) return ""; - - return OreDictionary.getOreName(oreIDS[0]); - } - private static boolean isCircuitOreDict(ItemStack item) { return BW_Util.isTieredCircuit(item) - || BW_Util.getOreNames(item).stream().anyMatch(s -> s.equals("circuitPrimitiveArray")); + || BW_Util.getOreNames(item).stream().anyMatch(s -> "circuitPrimitiveArray".equals(s)); } private static void exchangeRecipesInList(HashSet toRem, HashSet toAdd) { @@ -310,8 +298,8 @@ public class CircuitImprintLoader { BW_Util.getMachineVoltageFromTier( BW_Util.getCircuitTierFromOreDictName( OreDictionary.getOreName( - (OreDictionary.getOreIDs(stack) != null - && OreDictionary.getOreIDs(stack).length > 0) + OreDictionary.getOreIDs(stack) != null + && OreDictionary.getOreIDs(stack).length > 0 ? OreDictionary.getOreIDs(stack)[0] : -1)))); GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index 7babb0d3c1..5da0462d82 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -148,7 +148,7 @@ public class CircuitPartLoader implements Runnable { ArrayList toolTip = new ArrayList<>(); if (FMLCommonHandler.instance().getEffectiveSide().isClient()) single.getItem().addInformation(single.get(1).copy(), null, toolTip, true); - String tt = (toolTip.size() > 0 ? toolTip.get(0) : ""); + String tt = toolTip.size() > 0 ? toolTip.get(0) : ""; // tt += "Internal Name = "+single; String localised = GT_LanguageManager .getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java index 0de9abaa4f..08b3968251 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -57,37 +57,36 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { for (int i = 0; i < Materials.values().length; i++) { ItemStack tStack = new ItemStack(this, 1, i); Materials material = Materials.values()[i]; - if (((material.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten) - || ((material.getFluid(1) == null && material.getGas(1) == null) - && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) + if (material.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten + || material.getFluid(1) == null && material.getGas(1) == null + && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)) continue; - if (OreDictionary - .doesOreNameExist(this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ", ""))) { - hiddenThings.add(i); + if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + material.mDefaultLocalName.replace(" ", ""))) { + this.hiddenThings.add(i); continue; } GT_OreDictUnificator - .registerOre(this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ", ""), tStack); + .registerOre(this.orePrefixes.name() + material.mDefaultLocalName.replace(" ", ""), tStack); } if (noSubIDMaterials != null) { - hasList = true; + this.hasList = true; // materialloop: for (int i = 0; i < noSubIDMaterials.size(); i++) { ItemStack tStack = new ItemStack(this, 1, i + 1001); Materials w = noSubIDMaterials.get(i); - if (((w.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten) - || ((w.getFluid(1) == null && w.getGas(1) == null) - && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) + if (w.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten + || w.getFluid(1) == null && w.getGas(1) == null + && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)) continue; - if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ", ""))) { - hiddenThings.add(i); + if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + w.mDefaultLocalName.replace(" ", ""))) { + this.hiddenThings.add(i); continue; } GT_OreDictUnificator - .registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ", ""), tStack); + .registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replace(" ", ""), tStack); } } } @@ -95,20 +94,19 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { private Materials getMaterial(ItemStack is) { if (is == null || is.getItem() != this) return null; final int meta = is.getItemDamage(); - return getMaterialFromMeta(meta); + return this.getMaterialFromMeta(meta); } @Override public String getItemStackDisplayName(ItemStack aStack) { - Materials material = getMaterial(aStack); + Materials material = this.getMaterial(aStack); if (material == null) material = Materials._NULL; - return material.getLocalizedNameForItem(itemTypeLocalizedName); + return material.getLocalizedNameForItem(this.itemTypeLocalizedName); } - @SuppressWarnings("unchecked") @Override - protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { - Materials material = getMaterial(aStack); + protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { + Materials material = this.getMaterial(aStack); if (material != null) { String tooltip = material.getToolTip(); if (tooltip != null && !tooltip.isEmpty()) { @@ -120,13 +118,12 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { @Override public IIconContainer getIconContainer(int aMetaData) { - if (this.orePrefixes.mTextureIndex == -1) return getIconContainerBartWorks(aMetaData); - Materials material = getMaterialFromMeta(aMetaData); + if (this.orePrefixes.mTextureIndex == -1) return this.getIconContainerBartWorks(aMetaData); + Materials material = this.getMaterialFromMeta(aMetaData); if (material != null) { return material.mIconSet.mTextures[this.orePrefixes.mTextureIndex]; - } else { - return null; } + return null; } @Override @@ -137,7 +134,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { if (iconLink == null) return null; - Materials material = getMaterialFromMeta(aMetaData); + Materials material = this.getMaterialFromMeta(aMetaData); if (material == null || material.mIconSet == null) return null; @@ -146,63 +143,61 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { @Override public IIcon getIconFromDamage(int aMetaData) { - return getIcon(aMetaData, 0); + return this.getIcon(aMetaData, 0); } @Override public GT_GeneratedMaterial_Renderer getMaterialRenderer(int aMetaData) { - return getMaterialFromMeta(aMetaData).renderer; + return this.getMaterialFromMeta(aMetaData).renderer; } public Materials getMaterialFromMeta(int aMetaData) { - if (aMetaData > 1000 && hasList) { + if (aMetaData > 1000 && this.hasList) { return NoMetaValue.get(aMetaData - 1001); - } else { - if (aMetaData < 0 || aMetaData >= Materials.values().length) { - return null; - } - return Materials.values()[aMetaData]; } + if (aMetaData < 0 || aMetaData >= Materials.values().length) { + return null; + } + return Materials.values()[aMetaData]; } @Override @SideOnly(Side.CLIENT) - @SuppressWarnings("unchecked") - public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { + public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { for (int i = 0; i < Materials.values().length; i++) { Materials w = Materials.values()[i]; - if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 + if (w == null || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) continue; - else if (((w.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten) - || ((w.getFluid(1) == null && w.getGas(1) == null) - && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) + if (w.getMolten(1) == null && this.orePrefixes == OrePrefixes.capsuleMolten + || w.getFluid(1) == null && w.getGas(1) == null + && (this.orePrefixes == OrePrefixes.capsule || this.orePrefixes == OrePrefixes.bottle)) continue; - else if (hiddenThings.contains(i)) continue; + else if (this.hiddenThings.contains(i)) continue; aList.add(new ItemStack(this, 1, i)); } - if (hasList) for (int i = 0; i < NoMetaValue.size(); i++) { + if (this.hasList) for (int i = 0; i < NoMetaValue.size(); i++) { Materials w = NoMetaValue.get(i); - if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 + if (w == null || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) continue; - else if (((w.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten) - || ((w.getFluid(1) == null && w.getGas(1) == null) - && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) + if (w.getMolten(1) == null && this.orePrefixes == OrePrefixes.capsuleMolten + || w.getFluid(1) == null && w.getGas(1) == null + && (this.orePrefixes == OrePrefixes.capsule || this.orePrefixes == OrePrefixes.bottle)) continue; - else if (hiddenThings.contains(i)) continue; + else if (this.hiddenThings.contains(i)) continue; aList.add(new ItemStack(this, 1, i + 1001)); } } @Override public short[] getColorForGUI(ItemStack aStack) { - return getMaterial(aStack).mRGBa; + return this.getMaterial(aStack).mRGBa; } @Override public String getNameForGUI(ItemStack aStack) { - return getMaterial(aStack).mDefaultLocalName; + return this.getMaterial(aStack).mDefaultLocalName; } @Override @@ -210,9 +205,10 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { @Override public short[] getRGBa(ItemStack aStack) { - return getMaterial(aStack).mRGBa; + return this.getMaterial(aStack).mRGBa; } + @Override public boolean onEntityItemUpdate(EntityItem aItemEntity) { return false; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java index 0cfc062fb9..c4838905e1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -69,15 +69,15 @@ public class GTMetaItemEnhancer { .duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); } - if (m.getFluid(1) == null && m.getGas(1) == null) continue; - if (OreDictionary.doesOreNameExist("capsule" + m.mName)) continue; + if (m.getFluid(1) == null && m.getGas(1) == null || OreDictionary.doesOreNameExist("capsule" + m.mName)) + continue; addFluidData(m, GT_ModHandler.getModItem(Forestry.ID, "waxCapsule", 1), capsuls, 1000, i, true); // addFluidData(m, new ItemStack(Items.glass_bottle), bottles, 250, i, false); } for (int i = 0, valuesLength = NoMetaValue.size(); i < valuesLength; i++) { Materials m = NoMetaValue.get(i); - if (m.getFluid(1) == null && m.getGas(1) == null) continue; - if (OreDictionary.doesOreNameExist("capsule" + m.mName)) continue; + if (m.getFluid(1) == null && m.getGas(1) == null || OreDictionary.doesOreNameExist("capsule" + m.mName)) + continue; addFluidData(m, GT_ModHandler.getModItem(Forestry.ID, "waxCapsule", 1), capsuls, 1000, i + 1001, true); // addFluidData(m, new ItemStack(Items.glass_bottle), bottles, 250, i + 1001, false); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 8883e72e61..f0da014b02 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -554,7 +554,7 @@ public class PlatinumSludgeOverHaul { if (GT_Utility.isStackValid(realEntry.getKey()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getKey())) { ItemData association = GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()); - if ((!association.mPrefix.equals(dust) && !association.mPrefix.equals(dustTiny)) + if (!dust.equals(association.mPrefix) && !dustTiny.equals(association.mPrefix) || !association.mMaterial.mMaterial.equals(Materials.Platinum)) if (GT_Utility.isStackValid(realEntry.getValue()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())) { @@ -587,8 +587,8 @@ public class PlatinumSludgeOverHaul { maploop: for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { if (map == GT_Recipe.GT_Recipe_Map.sFusionRecipes || map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes - || map.mUnlocalizedName.equals("gt.recipe.eyeofharmony") - || map.mUnlocalizedName.equals("gtpp.recipe.quantumforcesmelter")) + || "gt.recipe.eyeofharmony".equals(map.mUnlocalizedName) + || "gtpp.recipe.quantumforcesmelter".equals(map.mUnlocalizedName)) continue; HashSet toDel = new HashSet<>(); recipeloop: for (GT_Recipe recipe : map.mRecipeList) { @@ -596,112 +596,97 @@ public class PlatinumSludgeOverHaul { for (int i = 0; i < recipe.mFluidOutputs.length; i++) { if (map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes)) continue maploop; - else if (map.equals(GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) + if (map.equals(GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sChemicalRecipes)) { - if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility - .areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) { - recipe.mFluidOutputs[i] = AcidicIridiumSolution.getFluidOrGas(1000); - recipe.reloadOwner(); - } else - if (GT_Utility - .areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) { - recipe.mFluidOutputs[i] = PTConcentrate.getFluidOrGas(1000); - recipe.reloadOwner(); - } else - if (GT_Utility.areFluidsEqual( - Materials.Osmium.getMolten(1), - recipe.mFluidOutputs[i])) { - recipe.mFluidOutputs[i] = AcidicOsmiumSolution.getFluidOrGas(1000); - recipe.reloadOwner(); - } - } else { - if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility - .areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility - .areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - else if (GT_Utility - .areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) - toDel.add(recipe); - } + if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i]) + || GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) { + recipe.mFluidOutputs[i] = AcidicIridiumSolution.getFluidOrGas(1000); + recipe.reloadOwner(); + } else + if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) { + recipe.mFluidOutputs[i] = PTConcentrate.getFluidOrGas(1000); + recipe.reloadOwner(); + } else + if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) { + recipe.mFluidOutputs[i] = AcidicOsmiumSolution.getFluidOrGas(1000); + recipe.reloadOwner(); + } + } else if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i]) + || GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i]) + || GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i]) + || GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); + else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) + toDel.add(recipe); } for (int i = 0; i < recipe.mOutputs.length; i++) { if (!GT_Utility.isStackValid(recipe.mOutputs[i])) continue; - if (BW_Util.areStacksEqualOrNull(Ruthenium.get(dust), recipe.mOutputs[i]) + if ((BW_Util.areStacksEqualOrNull(Ruthenium.get(dust), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustImpure), recipe.mOutputs[i]) - || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustPure), recipe.mOutputs[i])) { - if (!BW_Util.areStacksEqualOrNull(Ruthenium.get(ingot), recipe.mInputs[0])) { - for (int j = 0; j < recipe.mInputs.length; j++) - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; - int amount = recipe.mOutputs[i].stackSize * 2; - recipe.mOutputs[i] = LeachResidue.get(dust, amount); - recipe.reloadOwner(); - } + || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustPure), recipe.mOutputs[i])) + && !BW_Util.areStacksEqualOrNull(Ruthenium.get(ingot), recipe.mInputs[0])) { + for (ItemStack mInput : recipe.mInputs) + if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop; + int amount = recipe.mOutputs[i].stackSize * 2; + recipe.mOutputs[i] = LeachResidue.get(dust, amount); + recipe.reloadOwner(); } - if (BW_Util.areStacksEqualOrNull(Rhodium.get(dust), recipe.mOutputs[i]) + if ((BW_Util.areStacksEqualOrNull(Rhodium.get(dust), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Rhodium.get(dustImpure), recipe.mOutputs[i]) - || BW_Util.areStacksEqualOrNull(Rhodium.get(dustPure), recipe.mOutputs[i])) { - if (!BW_Util.areStacksEqualOrNull(Rhodium.get(ingot), recipe.mInputs[0])) { - for (int j = 0; j < recipe.mInputs.length; j++) - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; - int amount = recipe.mOutputs[i].stackSize * 2; - recipe.mOutputs[i] = CrudeRhMetall.get(dust, amount); - recipe.reloadOwner(); - } + || BW_Util.areStacksEqualOrNull(Rhodium.get(dustPure), recipe.mOutputs[i])) + && !BW_Util.areStacksEqualOrNull(Rhodium.get(ingot), recipe.mInputs[0])) { + for (ItemStack mInput : recipe.mInputs) + if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop; + int amount = recipe.mOutputs[i].stackSize * 2; + recipe.mOutputs[i] = CrudeRhMetall.get(dust, amount); + recipe.reloadOwner(); } if (!BW_Util.checkStackAndPrefix(recipe.mOutputs[i])) continue; // Pt if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial .equals(Materials.Platinum)) { - for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; + for (ItemStack mInput : recipe.mInputs) { + if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop; } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) - || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) - || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + if (dust.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) + || dustImpure.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) + || dustPure.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dust), amount * 2); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + } else if (dustSmall.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dustSmall), amount * 2); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + } else if (dustTiny.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dustTiny), amount * 2); recipe.reloadOwner(); } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial .equals(Materials.Palladium)) { - for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; + for (ItemStack mInput : recipe.mInputs) { + if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop; } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) - || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix - .equals(dustImpure) - || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix - .equals(dustPure)) { + if (dust.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) + || dustImpure + .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) + || dustPure.equals( + GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dust), amount * 4); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix - .equals(dustSmall)) { + } else if (dustSmall + .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util .setStackSize(PDMetallicPowder.get(dustSmall), amount * 4); recipe.reloadOwner(); } else - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix - .equals(dustTiny)) { + if (dustTiny + .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util .setStackSize(PDMetallicPowder.get(dustTiny), amount * 4); @@ -710,27 +695,26 @@ public class PlatinumSludgeOverHaul { } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial .equals(Materials.Osmium)) { - for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + for (ItemStack mInput : recipe.mInputs) { + if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop; } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) - || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix - .equals(dustImpure) - || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix - .equals(dustPure)) { + if (dust.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) + || dustImpure.equals( + GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) + || dustPure.equals( + GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dust), amount); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix - .equals(dustSmall)) { + } else if (dustSmall + .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util .setStackSize(IrOsLeachResidue.get(dustSmall), amount); recipe.reloadOwner(); } else - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix - .equals(dustTiny)) { + if (dustTiny.equals( + GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util .setStackSize(IrOsLeachResidue.get(dustTiny), amount); @@ -739,27 +723,27 @@ public class PlatinumSludgeOverHaul { } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial .equals(Materials.Iridium)) { - for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + for (ItemStack mInput : recipe.mInputs) { + if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop; } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) - || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix - .equals(dustImpure) - || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix - .equals(dustPure)) { + if (dust.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) + || dustImpure.equals( + GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) + || dustPure.equals( + GT_OreDictUnificator + .getAssociation(recipe.mOutputs[i]).mPrefix)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dust), amount); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix - .equals(dustSmall)) { + } else if (dustSmall.equals( + GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util .setStackSize(IrLeachResidue.get(dustSmall), amount); recipe.reloadOwner(); } else - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix - .equals(dustTiny)) { + if (dustTiny.equals( + GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util .setStackSize(IrLeachResidue.get(dustTiny), amount); @@ -808,8 +792,8 @@ public class PlatinumSludgeOverHaul { private static void setnewMaterialInRecipe(Object obj) { String inputName = "output"; String inputItemName = "input"; - if (!(obj instanceof ShapedOreRecipe || obj instanceof ShapelessOreRecipe)) { - if (obj instanceof ShapedRecipes || (obj instanceof ShapelessRecipes)) { + if (!(obj instanceof ShapedOreRecipe) && !(obj instanceof ShapelessOreRecipe)) { + if (obj instanceof ShapedRecipes || obj instanceof ShapelessRecipes) { inputName = "recipeOutput"; inputItemName = "recipeItems"; } else if (GTPlusPlus.isModLoaded()) { @@ -892,21 +876,19 @@ public class PlatinumSludgeOverHaul { } for (Object stack : stacks) { - if (stack instanceof ItemStack) { - if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(crateGtDust, mat, 1), (ItemStack) stack)) - return true; - } + if (stack instanceof ItemStack + && GT_Utility.areStacksEqual(GT_OreDictUnificator.get(crateGtDust, mat, 1), (ItemStack) stack)) + return true; } boolean allSame = false; for (Object stack : stacks) { - if (stack instanceof ItemStack) { - allSame = BW_Util.checkStackAndPrefix((ItemStack) stack) - && GT_OreDictUnificator.getAssociation((ItemStack) stack).mMaterial.mMaterial.equals(mat); - } else { + if (!(stack instanceof ItemStack)) { allSame = false; break; } + allSame = BW_Util.checkStackAndPrefix((ItemStack) stack) + && GT_OreDictUnificator.getAssociation((ItemStack) stack).mMaterial.mMaterial.equals(mat); if (!allSame) break; } return allSame; @@ -915,13 +897,10 @@ public class PlatinumSludgeOverHaul { } private static boolean isInBlackList(ItemStack stack) { - if (stack == null) return true; - - if (stack.getItem() instanceof BW_MetaGenerated_Items) return true; - - if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(MainMod.MOD_ID)) return true; - - if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(BartWorksCrossmod.MOD_ID)) return true; + if (stack == null || stack.getItem() instanceof BW_MetaGenerated_Items + || MainMod.MOD_ID.equals(GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId) + || BartWorksCrossmod.MOD_ID.equals(GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId)) + return true; if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(NewHorizonsCoreMod.ID) && !stack.getUnlocalizedName().contains("dust") @@ -938,8 +917,8 @@ public class PlatinumSludgeOverHaul { if (stack.getItem() instanceof GT_Generic_Item) { if (!BW_Util.checkStackAndPrefix(stack)) return false; - return (!Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST) - .contains(GT_OreDictUnificator.getAssociation(stack).mPrefix)) + return !Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST) + .contains(GT_OreDictUnificator.getAssociation(stack).mPrefix) || Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST) .contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); } @@ -947,9 +926,8 @@ public class PlatinumSludgeOverHaul { if (GTPlusPlus.isModLoaded()) { try { if (Class.forName("gtPlusPlus.core.item.base.BaseItemComponent") - .isAssignableFrom(stack.getItem().getClass()) - && !(stack.getUnlocalizedName().contains("dust") - || stack.getUnlocalizedName().contains("Dust"))) + .isAssignableFrom(stack.getItem().getClass()) && !stack.getUnlocalizedName().contains("dust") + && !stack.getUnlocalizedName().contains("Dust")) return true; if (Class.forName("gtPlusPlus.core.block.base.BlockBaseModular") .isAssignableFrom(Block.getBlockFromItem(stack.getItem()).getClass())) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index a71bfe8b92..5d6e82a929 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -60,17 +60,18 @@ import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; -@SuppressWarnings("ALL") public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static final LinkedHashSet werkstoffHashSet = new LinkedHashSet<>(); public static final LinkedHashMap werkstoffHashMap = new LinkedHashMap<>(); public static final LinkedHashMap werkstoffNameHashMap = new LinkedHashMap<>(); - public static final Map modNameOverrides = new HashMap() { + public static final Map modNameOverrides = new HashMap<>() { + + private static final long serialVersionUID = 6399917619058898648L; { - put(GalaxySpace.ID, DARK_PURPLE + "GalaxySpace"); + this.put(GalaxySpace.ID, DARK_PURPLE + "GalaxySpace"); } }; @@ -139,7 +140,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { materials.mIconSet, (List) materials.mOreByProducts, new Pair<>(materials, 1)); - if (!(mID > 31_766 && mID <= 32_767)) throw new IllegalArgumentException(); + if (mID <= 31_766 || mID > 32_767) throw new IllegalArgumentException(); this.stats.mass = materials.getMass(); this.stats.protons = materials.getProtons(); this.stats.meltingPoint = materials.mMeltingPoint; @@ -160,6 +161,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } } + @SafeVarargs public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { @@ -174,6 +176,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { contents); } + @SafeVarargs public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { @@ -188,6 +191,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { contents); } + @SafeVarargs public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { @@ -203,6 +207,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { contents); } + @SafeVarargs public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { @@ -218,6 +223,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { contents); } + @SafeVarargs public Werkstoff(short[] rgba, String toolTip, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { @@ -234,6 +240,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { contents); } + @SafeVarargs public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { @@ -242,12 +249,14 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.mOreByProducts.addAll(oreByProduct); } + @SafeVarargs public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { this(rgba, defaultName, "", stats, type, generationFeatures, mID, texSet, contents); } + @SafeVarargs public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List oreByProduct, Pair... contents) { @@ -256,6 +265,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.mOreByProducts.addAll(oreByProduct); } + @SafeVarargs public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair... contents) { @@ -282,7 +292,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (((Materials) p.getKey()).mMaterialList.size() > 1 && p.getValue() > 1) this.toolTip += "(" + getFormula((Materials) p.getKey()) + ")" - + (BW_Util.subscriptNumber(p.getValue())); + + BW_Util.subscriptNumber(p.getValue()); else this.toolTip += getFormula((Materials) p.getKey()) + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } @@ -290,17 +300,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (((Werkstoff) p.getKey()).CONTENTS.size() > 1 && p.getValue() > 1) this.toolTip += "(" + getFormula((Werkstoff) p.getKey()) + ")" - + (BW_Util.subscriptNumber(p.getValue())); + + BW_Util.subscriptNumber(p.getValue()); else this.toolTip += getFormula((Werkstoff) p.getKey()) + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } - } else { - if (p.getKey() instanceof Materials) { - this.toolTip += getFormula((Materials) p.getKey()) - + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); - } else if (p.getKey() instanceof Werkstoff) this.toolTip += getFormula((Werkstoff) p.getKey()) + } else if (p.getKey() instanceof Materials) { + this.toolTip += getFormula((Materials) p.getKey()) + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); - } + } else if (p.getKey() instanceof Werkstoff) this.toolTip += getFormula((Werkstoff) p.getKey()) + + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } } else this.toolTip = toolTip; @@ -368,7 +376,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.werkstoffHashMap.put(this.mID, this); Werkstoff.werkstoffNameHashMap.put(this.defaultName, this); - this.owner = getMaterialOwner(); + this.owner = this.getMaterialOwner(); } private static String getFormula(Materials material) { @@ -380,23 +388,24 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff addAdditionalOreDict(String s) { - ADDITIONAL_OREDICT.add(s); + this.ADDITIONAL_OREDICT.add(s); return this; } public HashSet getADDITIONAL_OREDICT() { - return ADDITIONAL_OREDICT; + return this.ADDITIONAL_OREDICT; } public void setTCAspects(Pair... pAspectsArr) { this.stats.mTC_Aspects = pAspectsArr; } + @SuppressWarnings("unchecked") public Pair[] getTCAspects(int ratio) { if (this.stats.mTC_Aspects == null) { HashSet tc_aspectStacks = new HashSet<>(); HashSet> set = new HashSet<>(); - for (Pair p : this.getContents().getValue()) { + for (Pair p : this.getContents().getValue()) { if (p.getKey() instanceof Materials) tc_aspectStacks.addAll(((Materials) p.getKey()).mAspects); if (p.getKey() instanceof Werkstoff) set.addAll(Arrays.asList(((Werkstoff) p.getKey()).getTCAspects())); } @@ -414,7 +423,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public List getGTWrappedTCAspects() { final List ret = new ArrayList<>(); - Arrays.stream(getTCAspects()).forEach(objectIntegerPair -> { + Arrays.stream(this.getTCAspects()).forEach(objectIntegerPair -> { try { new TC_Aspects.TC_AspectStack( TC_Aspects.valueOf( @@ -448,7 +457,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { case MIXTURE: case BIOLOGICAL: { for (int i = 0; i < this.CONTENTS.toArray().length; i++) { - ret += ((Pair) this.CONTENTS.toArray()[i]).getValue(); + ret += (int) this.CONTENTS.toArray(new Pair[0])[i].getValue(); } break; } @@ -491,12 +500,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public String getLocalizedName() { return GT_LanguageManager.addStringLocalization( String.format("bw.werkstoff.%05d.name", this.mID), - defaultName, + this.defaultName, !GregTech_API.sPostloadFinished); } public String getVarName() { - return this.defaultName.replaceAll(" ", ""); + return this.defaultName.replace(" ", ""); } public String getToolTip() { @@ -506,7 +515,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public String getLocalizedToolTip() { return GT_LanguageManager.addStringLocalization( String.format("bw.werkstoff.%05d.tooltip", this.mID), - toolTip, + this.toolTip, !GregTech_API.sPostloadFinished); } @@ -579,31 +588,28 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public byte getToolQuality() { - return this.stats - .getQualityOverride() > 0 - ? this.stats.getQualityOverride() - : (byte) ((15f * (((float) this.getStats().getProtons() / 188f) - + (float) this.getStats().getMeltingPoint() / 10801f)) - / (float) this.getContents().getKey()); + return this.stats.getQualityOverride() > 0 ? this.stats.getQualityOverride() + : (byte) (15f * (this.getStats().getProtons() / 188f + this.getStats().getMeltingPoint() / 10801f) + / (float) this.getContents().getKey()); } public float getToolSpeed() { return this.stats.getSpeedOverride() > 0f ? this.stats.getSpeedOverride() : Math.max( 1f, - 2f * ((float) -this.getStats().getMass() + 0.1f * (float) this.getStats().getMeltingPoint() - + (float) this.getStats().getProtons()) + 2f * (-this.getStats().getMass() + 0.1f * this.getStats().getMeltingPoint() + + this.getStats().getProtons()) * 0.1f / (float) this.getContents().getKey() * 0.1f - * (float) this.getToolQuality()); + * this.getToolQuality()); } public int getDurability() { return this.stats.getDurOverride() > 0 ? this.stats.getDurOverride() - : (int) (this.stats.durMod - * ((0.01f * (float) this.getStats().getMeltingPoint() * (float) this.getStats().getMass()) - / (float) this.getContents().getKey())); + : (int) (this.stats.durMod * (0.01f * this.getStats().getMeltingPoint() + * this.getStats().getMass() + / (float) this.getContents().getKey())); } /** @@ -631,7 +637,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public String getOwner() { - return owner; + return this.owner; } private String getMaterialOwner() { @@ -656,15 +662,11 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { UNDEFINED; public static Werkstoff.Stats getDefaultStatForType(Werkstoff.Types T) { - switch (T) { - case COMPOUND: - case BIOLOGICAL: - return new Werkstoff.Stats().setElektrolysis(true); - case MIXTURE: - return new Werkstoff.Stats().setCentrifuge(true); - default: - return new Werkstoff.Stats(); - } + return switch (T) { + case COMPOUND, BIOLOGICAL -> new Werkstoff.Stats().setElektrolysis(true); + case MIXTURE -> new Werkstoff.Stats().setCentrifuge(true); + default -> new Werkstoff.Stats(); + }; } } @@ -750,7 +752,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public void setExtension() { - isExtension = !isExtension; + this.isExtension = !this.isExtension; } public static int getPrefixDataRaw(OrePrefixes prefixes) { @@ -759,7 +761,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public boolean isExtension() { - return isExtension; + return this.isExtension; } // public byte toGenerateSecondary = 0b0000000; @@ -809,19 +811,19 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @Deprecated public Werkstoff.GenerationFeatures removeGems() { - if (this.hasGems()) this.toGenerate = (long) (this.toGenerate ^ 0b100); + if (this.hasGems()) this.toGenerate = this.toGenerate ^ 0b100; return this; } @Deprecated public Werkstoff.GenerationFeatures removeDusts() { - if (this.hasDusts()) this.toGenerate = (long) (this.toGenerate ^ 0b1); + if (this.hasDusts()) this.toGenerate = this.toGenerate ^ 0b1; return this; } @Deprecated public Werkstoff.GenerationFeatures removeOres() { - if (this.hasOres()) this.toGenerate = (long) (this.toGenerate ^ 0b1000); + if (this.hasOres()) this.toGenerate = this.toGenerate ^ 0b1000; return this; } @@ -886,7 +888,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.GenerationFeatures onlyDust() { - this.toGenerate = (long) (0b1); + this.toGenerate = 0b1; return this; } @@ -894,17 +896,17 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { * Automatically adds Simple Metal Working Items */ public Werkstoff.GenerationFeatures addMetalItems() { - this.toGenerate = (long) (this.addSimpleMetalWorkingItems().toGenerate | 0b10); + this.toGenerate = this.addSimpleMetalWorkingItems().toGenerate | 0b10; return this; } public Werkstoff.GenerationFeatures disable() { - this.toGenerate = (long) (0); + this.toGenerate = 0; return this; } public Werkstoff.GenerationFeatures addCells() { - this.toGenerate = (long) (this.toGenerate | 0b10000); + this.toGenerate = this.toGenerate | 0b10000; return this; } @@ -919,7 +921,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.GenerationFeatures addMolten() { - this.toGenerate = (long) (this.toGenerate | 0b1000000); + this.toGenerate = this.toGenerate | 0b1000000; return this; } @@ -927,17 +929,17 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { * Automatically adds Simple Metal Working Items */ public Werkstoff.GenerationFeatures addGems() { - this.toGenerate = (long) (this.addSimpleMetalWorkingItems().toGenerate | 0x4); + this.toGenerate = this.addSimpleMetalWorkingItems().toGenerate | 0x4; return this; } public Werkstoff.GenerationFeatures addSimpleMetalWorkingItems() { - this.toGenerate = (long) (this.toGenerate | 0b10000000); + this.toGenerate = this.toGenerate | 0b10000000; return this; } public Werkstoff.GenerationFeatures addCasings() { - this.toGenerate = (long) (this.toGenerate | 0x382); + this.toGenerate = this.toGenerate | 0x382; return this; } @@ -947,22 +949,22 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.GenerationFeatures addCraftingMetalWorkingItems() { - this.toGenerate = (long) (this.toGenerate | 0x100); + this.toGenerate = this.toGenerate | 0x100; return this; } public Werkstoff.GenerationFeatures addMultipleIngotMetalWorkingItems() { - this.toGenerate = (long) (this.toGenerate | 0x200); + this.toGenerate = this.toGenerate | 0x200; return this; } public Werkstoff.GenerationFeatures addPrefix(OrePrefixes prefixes) { - this.toGenerate = (long) (this.toGenerate | this.getPrefixDataRaw(prefixes)); + this.toGenerate = this.toGenerate | getPrefixDataRaw(prefixes); return this; } public Werkstoff.GenerationFeatures removePrefix(OrePrefixes prefixes) { - this.toGenerate = (long) (this.toGenerate ^ this.getPrefixDataRaw(prefixes)); + this.toGenerate = this.toGenerate ^ getPrefixDataRaw(prefixes); return this; } } @@ -1027,7 +1029,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public int getDurOverride() { - return durOverride; + return this.durOverride; } public Werkstoff.Stats setDurOverride(int durOverride) { @@ -1036,7 +1038,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public float getSpeedOverride() { - return speedOverride; + return this.speedOverride; } public Werkstoff.Stats setSpeedOverride(float speedOverride) { @@ -1045,7 +1047,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public byte getQualityOverride() { - return qualityOverride; + return this.qualityOverride; } public Werkstoff.Stats setQualityOverride(byte qualityOverride) { @@ -1068,7 +1070,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { float durMod = 1f; public float getDurMod() { - return durMod; + return this.durMod; } public void setDurMod(float durMod) { @@ -1097,14 +1099,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @Override public boolean equals(Object o) { if (this == o) return true; - if (!(o instanceof Werkstoff.Stats)) return false; + if (!(o instanceof Werkstoff.Stats that)) return false; - Werkstoff.Stats that = (Werkstoff.Stats) o; - - if (this.boilingPoint != that.boilingPoint) return false; - if (this.meltingPoint != that.meltingPoint) return false; - if (this.mass != that.mass) return false; - if (this.protons != that.protons) return false; + if (this.boilingPoint != that.boilingPoint || this.meltingPoint != that.meltingPoint + || this.mass != that.mass + || this.protons != that.protons) + return false; if (this.neutrons != that.neutrons) return false; if (this.electrons != that.electrons) return false; if (Math.abs(this.ebfGasRecipeTimeMultiplier - that.ebfGasRecipeTimeMultiplier) > 1.0e-6D) return false; @@ -1159,7 +1159,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { byte enchantmentlvl = 3; public byte getEnchantmentlvl() { - return enchantmentlvl; + return this.enchantmentlvl; } public Werkstoff.Stats setEnchantmentlvl(byte enchantmentlvl) { @@ -1193,7 +1193,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public int getMeltingVoltage() { - return meltingVoltage; + return this.meltingVoltage; } public boolean isElektrolysis() { @@ -1223,9 +1223,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public FluidState getFluidState() { if ((this.quality & 0x40) != 0) { return FluidState.GAS; - } else { - return FluidState.LIQUID; } + return FluidState.LIQUID; } public Werkstoff.Stats setGas(boolean gas) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 23c0331b9a..b9855ab1a3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -139,7 +139,7 @@ import ic2.api.recipe.RecipeInputOreDict; import ic2.api.recipe.RecipeOutput; import ic2.api.recipe.Recipes; -@SuppressWarnings({ "unchecked", "deprecation" }) +@SuppressWarnings("deprecation") public class WerkstoffLoader { private WerkstoffLoader() {} @@ -169,7 +169,7 @@ public class WerkstoffLoader { } catch (NullPointerException | IllegalArgumentException ignored) {} // add tiberium - Element t = EnumUtils.createNewElement("Tr", 123L, 203L, 0L, -1L, null, "Tiberium", false); + EnumUtils.createNewElement("Tr", 123L, 203L, 0L, -1L, null, "Tiberium", false); bottle.mDefaultStackSize = 1; Werkstoff.GenerationFeatures.initPrefixLogic(); @@ -1440,7 +1440,7 @@ public class WerkstoffLoader { if (ret != null) return ret; } if (orePrefixes == ore) return new ItemStack(WerkstoffLoader.BWOres, amount, werkstoff.getmID()); - else if (orePrefixes == oreSmall) return new ItemStack(WerkstoffLoader.BWSmallOres, amount, werkstoff.getmID()); + if (orePrefixes == oreSmall) return new ItemStack(WerkstoffLoader.BWSmallOres, amount, werkstoff.getmID()); else if (orePrefixes == block) return new ItemStack(WerkstoffLoader.BWBlocks, amount, werkstoff.getmID()); else if (orePrefixes == OrePrefixes.blockCasing) return new ItemStack(WerkstoffLoader.BWBlockCasings, amount, werkstoff.getmID()); @@ -1453,7 +1453,7 @@ public class WerkstoffLoader { public static ItemStack getCorrespondingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { ItemStack stack = getCorrespondingItemStackUnsafe(orePrefixes, werkstoff, amount); if (stack != null) return stack; - else MainMod.LOGGER.catching( + MainMod.LOGGER.catching( Level.ERROR, new Exception( "NO SUCH ITEM! " + orePrefixes @@ -1478,9 +1478,9 @@ public class WerkstoffLoader { MainMod.LOGGER.info( "Making Meta Items for BW Materials took " + (timepost - timepre) + "ns/" - + ((timepost - timepre) / 1000000) + + (timepost - timepre) / 1000000 + "ms/" - + ((timepost - timepre) / 1000000000) + + (timepost - timepre) / 1000000000 + "s!"); } @@ -1491,12 +1491,12 @@ public class WerkstoffLoader { ProgressManager.ProgressBar progressBar = ProgressManager .push("Register BW Materials", Werkstoff.werkstoffHashSet.size() + 1); DebugLog.log("Loading Recipes" + (System.nanoTime() - timepre)); - Integer[] clsArr = new Integer[0]; + Integer[] clsArr = {}; int size = 0; if (BetterLoadingScreen.isModLoaded()) clsArr = CLSCompat.initCls(); - IWerkstoffRunnable[] werkstoffRunnables = new IWerkstoffRunnable[] { new ToolLoader(), new DustLoader(), - new GemLoader(), new SimpleMetalLoader(), new CasingLoader(), new AspectLoader(), new OreLoader(), + IWerkstoffRunnable[] werkstoffRunnables = { new ToolLoader(), new DustLoader(), new GemLoader(), + new SimpleMetalLoader(), new CasingLoader(), new AspectLoader(), new OreLoader(), new CrushedLoader(), new CraftingMaterialLoader(), new CellLoader(), new MoltenCellLoader(), new MultipleMetalLoader(), new MetalLoader(), new BlockLoader() }; @@ -1536,14 +1536,15 @@ public class WerkstoffLoader { MainMod.LOGGER.info( "Loading Processing Recipes for BW Materials took " + (timepost - timepre) + "ns/" - + ((timepost - timepre) / 1000000) + + (timepost - timepre) / 1000000 + "ms/" - + ((timepost - timepre) / 1000000000) + + (timepost - timepre) / 1000000000 + "s!"); registered = true; } } + @SuppressWarnings("unchecked") private static void addSubTags() { WerkstoffLoader.CubicZirconia.getStats().setDurOverride(Materials.Diamond.mDurability); WerkstoffLoader.HDCS.getStats().setSpeedOverride(Materials.HSSS.mToolSpeed); @@ -1590,7 +1591,8 @@ public class WerkstoffLoader { if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Neodymium) { W.add(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM); break; - } else if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Iron) { + } + if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Iron) { W.add(SubTag.ELECTROMAGNETIC_SEPERATION_IRON); break; } else if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Gold) { @@ -1649,12 +1651,13 @@ public class WerkstoffLoader { && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(), p, 1) != null) { DebugLog.log( - "Found: " + (p + werkstoff.getVarName()) + "Found: " + p + + werkstoff.getVarName() + " in GT material system, disable and reroute my Items to that, also add a Tooltip."); werkstoff.getGenerationFeatures().setBlacklist(p); } - WerkstoffLoader.toGenerateGlobal = (WerkstoffLoader.toGenerateGlobal - | werkstoff.getGenerationFeatures().toGenerate); + WerkstoffLoader.toGenerateGlobal = WerkstoffLoader.toGenerateGlobal + | werkstoff.getGenerationFeatures().toGenerate; } DebugLog.log("GlobalGeneration: " + WerkstoffLoader.toGenerateGlobal); if ((WerkstoffLoader.toGenerateGlobal & 0b1) != 0) { @@ -1781,8 +1784,8 @@ public class WerkstoffLoader { } private static void runGTItemDataRegistrator() { - IWerkstoffRunnable[] registrations = new IWerkstoffRunnable[] { new BridgeMaterialsLoader(), - new AssociationLoader(), new CasingRegistrator() }; + IWerkstoffRunnable[] registrations = { new BridgeMaterialsLoader(), new AssociationLoader(), + new CasingRegistrator() }; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { for (IWerkstoffRunnable registration : registrations) { registration.run(werkstoff); @@ -1821,6 +1824,7 @@ public class WerkstoffLoader { * used for the miners mostly removing this hacky material from the materials map instantly. we only need the item * data. */ + @SuppressWarnings("unchecked") private static void addFakeItemDataToInWorldBlocksAndCleanUpFakeData() { Map MATERIALS_MAP = null; @@ -1855,7 +1859,7 @@ public class WerkstoffLoader { Set> remset = new HashSet<>(); for (Map.Entry curr : Recipes.macerator.getRecipes().entrySet()) { if (curr.getKey() instanceof RecipeInputOreDict) { - if (((RecipeInputOreDict) curr.getKey()).input.equalsIgnoreCase("oreNULL")) { + if ("oreNULL".equalsIgnoreCase(((RecipeInputOreDict) curr.getKey()).input)) { remset.add(curr); } for (ItemStack stack : curr.getValue().items) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 0d3fdc2f58..b7387653b2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -79,10 +79,10 @@ import gregtech.common.items.behaviors.Behaviour_DataOrb; public class AdditionalRecipes { - private static BWRecipes.BW_Recipe_Map_LiquidFuel sAcidGenFuels = ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance - .getMappingsFor((byte) 2)); - private static BWRecipes.BacteriaVatRecipeMap sBacteriaVat = ((BWRecipes.BacteriaVatRecipeMap) BWRecipes.instance - .getMappingsFor((byte) 1)); + private static BWRecipes.BW_Recipe_Map_LiquidFuel sAcidGenFuels = (BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance + .getMappingsFor((byte) 2); + private static BWRecipes.BacteriaVatRecipeMap sBacteriaVat = (BWRecipes.BacteriaVatRecipeMap) BWRecipes.instance + .getMappingsFor((byte) 1); private static GT_Recipe.GT_Recipe_Map sBiolab = BWRecipes.instance.getMappingsFor((byte) 0); private static void runBWRecipes() { @@ -458,7 +458,7 @@ public class AdditionalRecipes { new FluidStack[] { Materials.SolderingAlloy.getMolten((i + 1) * 36) }, null, (i + 1) * 750, - BW_Util.getMachineVoltageFromTier((i + 1)), + BW_Util.getMachineVoltageFromTier(i + 1), CLEANROOM)); } // IV-LuV @@ -478,7 +478,7 @@ public class AdditionalRecipes { new FluidStack[] { new FluidStack(solderIndalloy, (i + 1) * 36) }, null, (i + 1) * 750, - BW_Util.getMachineVoltageFromTier((i + 1)), + BW_Util.getMachineVoltageFromTier(i + 1), CLEANROOM)); } // ZPM @@ -486,7 +486,7 @@ public class AdditionalRecipes { new BWRecipes.DynamicGTRecipe( false, new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (1)), + WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, 1), BW_Meta_Items.getNEWCIRCUITS().getStack(7 + 3), ItemList.Circuit_Parts_DiodeASMD.get((7 + 6) * 4), ItemList.Circuit_Parts_CapacitorASMD.get((7 + 6) * 4), @@ -504,7 +504,7 @@ public class AdditionalRecipes { new BWRecipes.DynamicGTRecipe( false, new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (1)), + WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, 1), BW_Meta_Items.getNEWCIRCUITS().getStack(8 + 3), ItemList.Circuit_Parts_DiodeASMD.get((8 + 6) * 4), ItemList.Circuit_Parts_CapacitorASMD.get((8 + 6) * 4), @@ -523,7 +523,7 @@ public class AdditionalRecipes { new BWRecipes.DynamicGTRecipe( false, new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (1)), + WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, 1), BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), ItemList.Circuit_Parts_DiodeXSMD.get((i + 6) * 4), ItemList.Circuit_Parts_CapacitorXSMD.get((i + 6) * 4), @@ -648,7 +648,7 @@ public class AdditionalRecipes { Materials werkstoffBridgeMaterial = null; boolean aElementSet = false; for (Element e : Element.values()) { - if (e.toString().equals("Uuo")) { + if ("Uuo".equals(e.toString())) { werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : new Materials( -1, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java index f31945f154..03b9315c11 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java @@ -48,13 +48,11 @@ public class AspectLoader implements IWerkstoffRunnable { werkstoff.getTCAspects( enabledOrePrefixes == OrePrefixes.ore ? 1 : (int) (enabledOrePrefixes.mMaterialAmount / 3628800L))); - } else if (enabledOrePrefixes.mMaterialAmount >= 0L) { - if (Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes))) - // noinspection unchecked - ThaumcraftHandler.AspectAdder.addAspectViaBW( - werkstoff.get(enabledOrePrefixes), - new Pair<>(TC_Aspects.PERDITIO.mAspect, 1)); - } + } else if (enabledOrePrefixes.mMaterialAmount >= 0L + && Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes))) + ThaumcraftHandler.AspectAdder.addAspectViaBW( + werkstoff.get(enabledOrePrefixes), + new Pair<>(TC_Aspects.PERDITIO.mAspect, 1)); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java index cb8ce95b4d..7942554934 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java @@ -40,11 +40,11 @@ public class CasingLoader implements IWerkstoffRunnable { if (werkstoff == BW_GT_MaterialReference.Wood /* || werkstoff == BW_GT_MaterialReference.WoodSealed */) { addCasingRecipes(werkstoff, plank); } else { - if (!(werkstoff.hasGenerationFeature(blockCasing) && werkstoff.doesOreDictedItemExists(plate) - && werkstoff.doesOreDictedItemExists(screw) - && werkstoff.doesOreDictedItemExists(gearGtSmall) - && werkstoff.doesOreDictedItemExists(gearGt) - && werkstoff.doesOreDictedItemExists(plateDouble))) + if (!werkstoff.hasGenerationFeature(blockCasing) || !werkstoff.doesOreDictedItemExists(plate) + || !werkstoff.doesOreDictedItemExists(screw) + || !werkstoff.doesOreDictedItemExists(gearGtSmall) + || !werkstoff.doesOreDictedItemExists(gearGt) + || !werkstoff.doesOreDictedItemExists(plateDouble)) return; addCasingRecipes(werkstoff, plateDouble); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java index 1d8f8678a2..3382697708 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java @@ -127,7 +127,7 @@ public class CellLoader implements IWerkstoffRunnable { stOutputs.add( ((Werkstoff) container.getKey()).get( dust, - (tracker.get(container.getKey()).getKey() + container.getValue()))); + tracker.get(container.getKey()).getKey() + container.getValue())); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } } @@ -218,7 +218,7 @@ public class CellLoader implements IWerkstoffRunnable { } - if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { + if (Werkstoff.Types.ELEMENT.equals(werkstoff.getType())) { Materials werkstoffBridgeMaterial = null; boolean ElementSet = false; for (Element e : Element.values()) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java index 4909461018..23a1576eb4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java @@ -50,7 +50,7 @@ public class CrushedLoader implements IWerkstoffRunnable { if (!werkstoff.hasItemType(ore) || !werkstoff.hasItemType(dust)) return; if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) { - if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { + if (Werkstoff.Types.ELEMENT.equals(werkstoff.getType())) { GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushed), werkstoff.get(nugget, 10)); GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedPurified), werkstoff.get(nugget, 10)); GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(nugget, 10)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java index 48d37851e4..74a2d78414 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java @@ -70,104 +70,80 @@ public class DustLoader implements IWerkstoffRunnable { || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { for (Pair container : werkstoff.getContents().getValue() .toArray(new Pair[0])) { - if (container.getKey() instanceof Materials) { - if ((((Materials) container.getKey()).getGas(0) != null - || ((Materials) container.getKey()).getFluid(0) != null - || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) - && ((Materials) container.getKey()).getDust(0) == null) { - FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000L * container.getValue()); + final ISubTagContainer key = container.getKey(); + final int value = container.getValue(); + if (key instanceof Materials materialKey) { + if ((materialKey.getGas(0) != null || materialKey.getFluid(0) != null + || materialKey.mIconSet == TextureSet.SET_FLUID) && materialKey.getDust(0) == null) { + FluidStack tmpFl = materialKey.getGas(1000L * value); if (tmpFl == null || tmpFl.getFluid() == null) { - tmpFl = ((Materials) container.getKey()).getFluid(1000L * container.getValue()); + tmpFl = materialKey.getFluid(1000L * value); } flOutputs.add(tmpFl); if (flOutputs.size() > 1) { - if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); - tracker.put( - container.getKey(), - new Pair<>(container.getValue(), stOutputs.size() - 1)); + if (!tracker.containsKey(key)) { + stOutputs.add(materialKey.getCells(value)); + tracker.put(key, new Pair<>(value, stOutputs.size() - 1)); } else { - stOutputs.add( - ((Materials) container.getKey()).getCells( - tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + stOutputs.add(materialKey.getCells(tracker.get(key).getKey() + value)); + stOutputs.remove(tracker.get(key).getValue() + 1); } - cells += container.getValue(); + cells += value; } } else { - if (((Materials) container.getKey()).getDust(container.getValue()) == null) { - if (((Materials) container.getKey()).getCells(container.getValue()) != null - && (((Materials) container.getKey()).getMolten(0) != null - || ((Materials) container.getKey()).getSolid(0) != null)) { - FluidStack tmpFl = ((Materials) container.getKey()) - .getMolten(1000L * container.getValue()); - if (tmpFl == null || tmpFl.getFluid() == null) { - tmpFl = ((Materials) container.getKey()).getSolid(1000L * container.getValue()); - } - flOutputs.add(tmpFl); - if (flOutputs.size() > 1) { - if (!tracker.containsKey(container.getKey())) { - stOutputs.add( - ((Materials) container.getKey()).getCells(container.getValue())); - tracker.put( - container.getKey(), - new Pair<>(container.getValue(), stOutputs.size() - 1)); - } else { - stOutputs.add( - ((Materials) container.getKey()).getCells( - tracker.get(container.getKey()).getKey() - + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); - } - cells += container.getValue(); + if (materialKey.getDust(value) == null) { + if (materialKey.getCells(value) == null + || materialKey.getMolten(0) == null && materialKey.getSolid(0) == null) + continue; + FluidStack tmpFl = materialKey.getMolten(1000L * value); + if (tmpFl == null || tmpFl.getFluid() == null) { + tmpFl = materialKey.getSolid(1000L * value); + } + flOutputs.add(tmpFl); + if (flOutputs.size() > 1) { + if (!tracker.containsKey(key)) { + stOutputs.add(materialKey.getCells(value)); + tracker.put(key, new Pair<>(value, stOutputs.size() - 1)); + } else { + stOutputs.add(materialKey.getCells(tracker.get(key).getKey() + value)); + stOutputs.remove(tracker.get(key).getValue() + 1); } - } else continue; + cells += value; + } } - if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + if (!tracker.containsKey(key)) { + stOutputs.add(materialKey.getDust(value)); + tracker.put(key, new Pair<>(value, stOutputs.size() - 1)); } else { - stOutputs.add( - ((Materials) container.getKey()).getDust( - tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + stOutputs.add(materialKey.getDust(tracker.get(key).getKey() + value)); + stOutputs.remove(tracker.get(key).getValue() + 1); } } - } else if (container.getKey() instanceof Werkstoff) { - if (((Werkstoff) container.getKey()).getStats().isGas() - || ((Werkstoff) container.getKey()).hasItemType(cell)) { - FluidStack tmpFl = ((Werkstoff) container.getKey()) - .getFluidOrGas(1000 * container.getValue()); + } else if (key instanceof Werkstoff werkstoffKey) { + if (werkstoffKey.getStats().isGas() || werkstoffKey.hasItemType(cell)) { + FluidStack tmpFl = werkstoffKey.getFluidOrGas(1000 * value); if (tmpFl == null || tmpFl.getFluid() == null) { - tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); + tmpFl = werkstoffKey.getFluidOrGas(1000 * value); } flOutputs.add(tmpFl); if (flOutputs.size() > 1) { - if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); - tracker.put( - container.getKey(), - new Pair<>(container.getValue(), stOutputs.size() - 1)); + if (!tracker.containsKey(key)) { + stOutputs.add(werkstoffKey.get(cell, value)); + tracker.put(key, new Pair<>(value, stOutputs.size() - 1)); } else { - stOutputs.add( - ((Werkstoff) container.getKey()).get( - cell, - tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + stOutputs.add(werkstoffKey.get(cell, tracker.get(key).getKey() + value)); + stOutputs.remove(tracker.get(key).getValue() + 1); } - cells += container.getValue(); + cells += value; } } else { - if (!((Werkstoff) container.getKey()).hasItemType(dust)) continue; - if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + if (!werkstoffKey.hasItemType(dust)) continue; + if (!tracker.containsKey(key)) { + stOutputs.add(werkstoffKey.get(dust, value)); + tracker.put(key, new Pair<>(value, stOutputs.size() - 1)); } else { - stOutputs.add( - ((Werkstoff) container.getKey()).get( - dust, - (tracker.get(container.getKey()).getKey() + container.getValue()))); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + stOutputs.add(werkstoffKey.get(dust, tracker.get(key).getKey() + value)); + stOutputs.remove(tracker.get(key).getValue() + 1); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java index 912452d490..d57ee89da8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java @@ -51,6 +51,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.enums.TierEU; +import gregtech.api.interfaces.ITexture; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -61,7 +62,7 @@ public class GemLoader implements IWerkstoffRunnable { public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(gem)) { if (werkstoff.getGenerationFeatures().hasSifterRecipes() - || (werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust))) { + || werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem, 9)).itemOutputs(werkstoff.get(block)) .duration(15 * SECONDS).eut(2).addTo(sCompressorRecipes); @@ -172,12 +173,15 @@ public class GemLoader implements IWerkstoffRunnable { .itemOutputs(werkstoff.get(lens), werkstoff.get(dust, 2)).duration(2 * MINUTES) .eut(TierEU.RECIPE_LV).addTo(sLatheRecipes); + final ITexture texture = TextureFactory.of( + Textures.BlockIcons.MACHINE_CASINGS[2][0], + TextureFactory.of(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false)); GregTech_API.registerCover( werkstoff.get(lens), - TextureFactory.of( - Textures.BlockIcons.MACHINE_CASINGS[2][0], - TextureFactory.of(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false)), - new gregtech.common.covers.GT_Cover_Lens(BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex)); + texture, + new gregtech.common.covers.GT_Cover_Lens( + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex, + texture)); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(lens)).itemOutputs(werkstoff.get(dustSmall, 3)) .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java index 4fb6adc378..8e1aa3bd59 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -107,7 +107,6 @@ public class MoltenCellLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick)).fluidOutputs(werkstoff.getMolten(72)) .duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); - } if (werkstoff.getGenerationFeatures().hasMetalCraftingSolidifierRecipes()) { @@ -175,11 +174,10 @@ public class MoltenCellLoader implements IWerkstoffRunnable { } - if (werkstoff.getGenerationFeatures().hasMultipleMetalSolidifierRecipes()) { - if (!werkstoff.hasItemType(plateDouble)) { - return; - } + if (werkstoff.getGenerationFeatures().hasMultipleMetalSolidifierRecipes() + && !werkstoff.hasItemType(plateDouble)) { // No multiple plate molds + return; } // Tank "Recipe" diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java index 46f546319d..79d74219a3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java @@ -73,75 +73,74 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { 1, null); for (OrePrefixes prefixes : values()) { - if (!(prefixes == cell && werkstoff.getType().equals(Werkstoff.Types.ELEMENT))) { - if (prefixes == dust && werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { - if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { - boolean ElementSet = false; - for (Element e : Element.values()) { - if (e.toString().equals(werkstoff.getToolTip())) { - if (e.mLinkedMaterials.size() > 0) break; - werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null - ? werkstoff.getBridgeMaterial() - : Materials.get(werkstoff.getVarName()) != Materials._NULL - ? Materials.get(werkstoff.getVarName()) - : new Materials( - -1, - werkstoff.getTexSet(), - werkstoff.getToolSpeed(), - werkstoff.getDurability(), - werkstoff.getToolQuality(), - 0, - werkstoff.getRGBA()[0], - werkstoff.getRGBA()[1], - werkstoff.getRGBA()[2], - werkstoff.getRGBA()[3], - werkstoff.getVarName(), - werkstoff.getDefaultName(), - 0, - 0, - werkstoff.getStats().getMeltingPoint(), - werkstoff.getStats().getMeltingPoint(), - werkstoff.getStats().isBlastFurnace(), - false, - 0, - 1, - 1, - null); - werkstoffBridgeMaterial.mElement = e; - e.mLinkedMaterials = new ArrayList<>(); - e.mLinkedMaterials.add(werkstoffBridgeMaterial); - if (werkstoff.hasItemType(dust)) { - GT_OreDictUnificator - .addAssociation(dust, werkstoffBridgeMaterial, werkstoff.get(dust), false); - GT_OreDictUnificator - .set(dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true); - } - ElementSet = true; - break; + if (prefixes != cell || !Werkstoff.Types.ELEMENT.equals(werkstoff.getType())) { + if (prefixes == dust && Werkstoff.Types.ELEMENT.equals(werkstoff.getType()) + && Werkstoff.Types.ELEMENT.equals(werkstoff.getType())) { + boolean ElementSet = false; + for (Element e : Element.values()) { + if (e.toString().equals(werkstoff.getToolTip())) { + if (e.mLinkedMaterials.size() > 0) break; + werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null + ? werkstoff.getBridgeMaterial() + : Materials.get(werkstoff.getVarName()) != Materials._NULL + ? Materials.get(werkstoff.getVarName()) + : new Materials( + -1, + werkstoff.getTexSet(), + werkstoff.getToolSpeed(), + werkstoff.getDurability(), + werkstoff.getToolQuality(), + 0, + werkstoff.getRGBA()[0], + werkstoff.getRGBA()[1], + werkstoff.getRGBA()[2], + werkstoff.getRGBA()[3], + werkstoff.getVarName(), + werkstoff.getDefaultName(), + 0, + 0, + werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().isBlastFurnace(), + false, + 0, + 1, + 1, + null); + werkstoffBridgeMaterial.mElement = e; + e.mLinkedMaterials = new ArrayList<>(); + e.mLinkedMaterials.add(werkstoffBridgeMaterial); + if (werkstoff.hasItemType(dust)) { + GT_OreDictUnificator + .addAssociation(dust, werkstoffBridgeMaterial, werkstoff.get(dust), false); + GT_OreDictUnificator + .set(dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true); } + ElementSet = true; + break; } - if (!ElementSet) { - continue; - } + } + if (!ElementSet) { + continue; + } - if (werkstoff.hasItemType(dust)) { - ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); - Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[] { werkstoff.get(prefixes) }, - new ItemStack[] { scannerOutput }, - ItemList.Tool_DataOrb.get(1L), - null, - null, - null, - (int) (werkstoffBridgeMaterial.getMass() * 8192L), - 30, - 0)); - } + if (werkstoff.hasItemType(dust)) { + ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); + Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( + false, + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { werkstoff.get(prefixes) }, + new ItemStack[] { scannerOutput }, + ItemList.Tool_DataOrb.get(1L), + null, + null, + null, + (int) (werkstoffBridgeMaterial.getMass() * 8192L), + 30, + 0)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java index 6bb0da9300..bd3b30a95a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java @@ -60,8 +60,8 @@ public class OreDictHandler { (short) tmp.getItemDamage()); GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); if (UI == null) UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); - if (!UI.modId.equals(MainMod.MOD_ID) && !UI.modId.equals(BartWorksCrossmod.MOD_ID) - && !UI.modId.equals("BWCore")) { + if (!MainMod.MOD_ID.equals(UI.modId) && !BartWorksCrossmod.MOD_ID.equals(UI.modId) + && !"BWCore".equals(UI.modId)) { OreDictHandler.cacheNonBW.add(p2); } } @@ -70,14 +70,15 @@ public class OreDictHandler { } public static ItemStack getItemStack(String elementName, OrePrefixes prefixes, int amount) { - if (OreDictHandler.cache.get(prefixes + elementName.replaceAll(" ", "")) != null) { - Pair p = OreDictHandler.cache.get(prefixes + elementName.replaceAll(" ", "")); + if (OreDictHandler.cache.get(prefixes + elementName.replace(" ", "")) != null) { + Pair p = OreDictHandler.cache.get(prefixes + elementName.replace(" ", "")); return new ItemStack(Item.getItemById(p.getKey()), amount, p.getValue()); - } else if (!OreDictionary.getOres(prefixes + elementName.replaceAll(" ", "")).isEmpty()) { + } + if (!OreDictionary.getOres(prefixes + elementName.replace(" ", "")).isEmpty()) { ItemStack tmp = GT_OreDictUnificator - .get(OreDictionary.getOres(prefixes + elementName.replaceAll(" ", "")).get(0).copy()).copy(); + .get(OreDictionary.getOres(prefixes + elementName.replace(" ", "")).get(0).copy()).copy(); OreDictHandler.cache.put( - prefixes + elementName.replaceAll(" ", ""), + prefixes + elementName.replace(" ", ""), new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage())); tmp.stackSize = amount; return tmp; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java index 1efa707f2d..0590b522ca 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java @@ -138,26 +138,26 @@ public abstract class BW_OreLayer extends GT_Worldgen { int i; if (this.mSecondaryMeta > 0) { for (i = tMinY - 1; i < tMinY + 2; ++i) { - if (shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { + if (this.shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { wasPlaced = this.setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false); } } } - if (this.mBetweenMeta > 0 && shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { + if (this.mBetweenMeta > 0 && this.shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { wasPlaced = this .setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); } if (this.mPrimaryMeta > 0) { for (i = tMinY + 3; i < tMinY + 6; ++i) { - if (shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { + if (this.shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { wasPlaced = this.setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false); } } } - if (this.mSporadicMeta > 0 && (shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ))) { + if (this.mSporadicMeta > 0 && this.shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { wasPlaced = this .setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); } @@ -174,10 +174,10 @@ public abstract class BW_OreLayer extends GT_Worldgen { private boolean shouldPlace(Random aRandom, int cX, int eX, int tX, int cZ, int eZ, int tZ) { if (aRandom.nextInt( - Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0) - return true; - if (aRandom.nextInt( - Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) + Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 + || aRandom.nextInt( + Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) + == 0) return true; return false; } @@ -187,10 +187,10 @@ public abstract class BW_OreLayer extends GT_Worldgen { TileEntity te = aWorld.getTileEntity(aX, aY, aZ); if (te instanceof BW_MetaGeneratedOreTE || te instanceof GT_TileEntity_Ores) return true; - if ((aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0) - || (aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0) - || (aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0) - || (aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0)) { + if (aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0 + || aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0 + || aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0 + || aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0) { return isSmallOre ? BW_MetaGenerated_SmallOres.setOreBlock( aWorld, @@ -216,52 +216,49 @@ public abstract class BW_OreLayer extends GT_Worldgen { } public boolean setGTOreBlockSpace(World aWorld, int aX, int aY, int aZ, int aMetaData, Block block) { - if (!GT_TileEntity_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, false)) { - aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); - Block tBlock = aWorld.getBlock(aX, aY, aZ); - Block tOreBlock = GregTech_API.sBlockOres1; - if (aMetaData < 0 || tBlock == Blocks.air) { + if (GT_TileEntity_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, false)) return true; + aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); + Block tBlock = aWorld.getBlock(aX, aY, aZ); + Block tOreBlock = GregTech_API.sBlockOres1; + if (aMetaData < 0 || tBlock == Blocks.air) { + return false; + } else { + if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, block)) { return false; - } else { - if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, block)) { - return false; - } - aMetaData += 5000; - aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0); - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (tTileEntity instanceof GT_TileEntity_Ores) { - ((GT_TileEntity_Ores) tTileEntity).mMetaData = (short) aMetaData; - } - return true; } - } else return true; + aMetaData += 5000; + aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0); + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof GT_TileEntity_Ores ore) { + ore.mMetaData = (short) aMetaData; + } + return true; + } } @Override public boolean equals(Object o) { if (this == o) return true; - if (!(o instanceof BW_OreLayer)) return false; - - BW_OreLayer that = (BW_OreLayer) o; - - if (bwOres != that.bwOres) return false; - if (mMinY != that.mMinY) return false; - if (mWeight != that.mWeight) return false; - if (mDensity != that.mDensity) return false; - if (mSize != that.mSize) return false; - if (mMaxY != that.mMaxY) return false; - if (mPrimaryMeta != that.mPrimaryMeta) return false; - if (mSecondaryMeta != that.mSecondaryMeta) return false; - if (mBetweenMeta != that.mBetweenMeta) return false; - return mSporadicMeta == that.mSporadicMeta; + if (!(o instanceof BW_OreLayer that)) return false; + + if (this.bwOres != that.bwOres || this.mMinY != that.mMinY + || this.mWeight != that.mWeight + || this.mDensity != that.mDensity) + return false; + if (this.mSize != that.mSize) return false; + if (this.mMaxY != that.mMaxY) return false; + if (this.mPrimaryMeta != that.mPrimaryMeta) return false; + if (this.mSecondaryMeta != that.mSecondaryMeta) return false; + if (this.mBetweenMeta != that.mBetweenMeta) return false; + return this.mSporadicMeta == that.mSporadicMeta; } @Override public int hashCode() { return MurmurHash3.murmurhash3_x86_32( - ByteBuffer.allocate(37).put(bwOres).putInt(mMinY).putInt(mWeight).putInt(mDensity).putInt(mSize) - .putInt(mMaxY).putInt(mPrimaryMeta).putInt(mSecondaryMeta).putInt(mBetweenMeta) - .putInt(mSporadicMeta).array(), + ByteBuffer.allocate(37).put(this.bwOres).putInt(this.mMinY).putInt(this.mWeight).putInt(this.mDensity) + .putInt(this.mSize).putInt(this.mMaxY).putInt(this.mPrimaryMeta).putInt(this.mSecondaryMeta) + .putInt(this.mBetweenMeta).putInt(this.mSporadicMeta).array(), 0, 37, 31); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java index ac4f909e5c..983a3b653c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java @@ -81,7 +81,7 @@ public class BW_WordGenerator implements IWorldGenerator { XSTR fmlRandom = new XSTR(worldSeed); long xSeed = fmlRandom.nextLong() >> 2 + 1L; long zSeed = fmlRandom.nextLong() >> 2 + 1L; - long chunkSeed = (xSeed * xChunk + zSeed * zChunk) ^ worldSeed; + long chunkSeed = xSeed * xChunk + zSeed * zChunk ^ worldSeed; fmlRandom.setSeed(chunkSeed); return new XSTR(fmlRandom.nextInt()); } @@ -96,10 +96,10 @@ public class BW_WordGenerator implements IWorldGenerator { if (!BW_WordGenerator.WorldGenContainer.mGenerated.contains(centerChunk) && this.surroundingChunksLoaded(xCenter, zCenter)) { BW_WordGenerator.WorldGenContainer.mGenerated.add(centerChunk); - if ((BW_OreLayer.sWeight > 0) && (BW_OreLayer.sList.size() > 0)) { + if (BW_OreLayer.sWeight > 0 && BW_OreLayer.sList.size() > 0) { boolean temp = true; int tRandomWeight; - for (int i = 0; (i < 256) && (temp); i++) { + for (int i = 0; i < 256 && temp; i++) { tRandomWeight = random.nextInt(BW_OreLayer.sWeight); for (BW_OreLayer tWorldGen : BW_OreLayer.sList) { if (!tWorldGen.isGenerationAllowed(this.mWorld, this.mDimensionType, this.mDimensionType)) @@ -120,7 +120,7 @@ public class BW_WordGenerator implements IWorldGenerator { this.mChunkGenerator, this.mChunkProvider); ++attempts; - } while ((!placed) && attempts < 25); + } while (!placed && attempts < 25); temp = false; break; } catch (Throwable e) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index 27ece0dee7..f043be21b1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -60,6 +60,7 @@ import gregtech.api.interfaces.ISubTagContainer; public class BW_WorldGenRoss128b extends BW_OreLayer { + @Override public Block getDefaultBlockToReplace() { return Blocks.stone; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java index fb806ccf18..e94e7b6e71 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java @@ -39,9 +39,9 @@ import gregtech.api.metatileentity.MetaPipeEntity; import gregtech.api.objects.XSTR; import gregtech.api.threads.GT_Runnable_MachineBlockUpdate; -@SuppressWarnings({ "ALL" }) public abstract class MapGenRuins extends WorldGenerator { + @SuppressWarnings("unchecked") protected Pair[][] ToBuildWith = new Pair[4][0]; @Override @@ -49,6 +49,7 @@ public abstract class MapGenRuins extends WorldGenerator { return false; } + @SuppressWarnings("unchecked") protected void setFloorBlocks(int[] metas, Block... blocks) { this.ToBuildWith[0] = new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { @@ -56,6 +57,7 @@ public abstract class MapGenRuins extends WorldGenerator { } } + @SuppressWarnings("unchecked") protected void setWallBlocks(int[] metas, Block... blocks) { this.ToBuildWith[1] = new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { @@ -63,6 +65,7 @@ public abstract class MapGenRuins extends WorldGenerator { } } + @SuppressWarnings("unchecked") protected void setRoofBlocks(int[] metas, Block... blocks) { this.ToBuildWith[2] = new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { @@ -70,6 +73,7 @@ public abstract class MapGenRuins extends WorldGenerator { } } + @SuppressWarnings("unchecked") protected void setMiscBlocks(int[] metas, Block... blocks) { this.ToBuildWith[3] = new Pair[metas.length]; for (int i = 0; i < metas.length; i++) { @@ -123,7 +127,7 @@ public abstract class MapGenRuins extends WorldGenerator { protected TileEntity reSetGTTileEntity(IGregTechTileEntity bte, World worldObj, int x, int y, int z, int meta) { worldObj.removeTileEntity(x, y, z); this.setBlock(worldObj, x, y, z, Blocks.air, 0); - return setGTMachineBlock(worldObj, x, y, z, meta); + return this.setGTMachineBlock(worldObj, x, y, z, meta); } protected void setGTMachineBlockWChance(World worldObj, int x, int y, int z, Random rand, int airchance, int meta) { @@ -143,12 +147,12 @@ public abstract class MapGenRuins extends WorldGenerator { try { GT_Runnable_MachineBlockUpdate.setDisabled(); } catch (Throwable ignored) {} - setGTMachineBlock(worldObj, x, y, z, meta); + this.setGTMachineBlock(worldObj, x, y, z, meta); BaseMetaTileEntity BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z); BTE.setOwnerName(ownerName); BTE.setFrontFacing(facing); BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z); - checkTile(BTE, worldObj, x, y, z, meta, ownerName, facing, 0); + this.checkTile(BTE, worldObj, x, y, z, meta, ownerName, facing, 0); try { GT_Runnable_MachineBlockUpdate.setEnabled(); } catch (Throwable ignored) {} @@ -158,8 +162,9 @@ public abstract class MapGenRuins extends WorldGenerator { ForgeDirection facing, int depth) { if (depth < 25) { if (BTE.getMetaTileID() != meta || worldObj.getTileEntity(x, y, z) != BTE || BTE.isInvalid()) { - redoTile(BTE, worldObj, x, y, z, meta, ownerName, facing); - checkTile(BTE, worldObj, x, y, z, meta, ownerName, facing, depth++); + this.redoTile(BTE, worldObj, x, y, z, meta, ownerName, facing); + this.checkTile(BTE, worldObj, x, y, z, meta, ownerName, facing, depth); + depth++; } } else { worldObj.removeTileEntity(x, y, z); @@ -169,7 +174,7 @@ public abstract class MapGenRuins extends WorldGenerator { private void redoTile(BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, ForgeDirection facing) { - reSetGTTileEntity(BTE, worldObj, x, y, z, meta); + this.reSetGTTileEntity(BTE, worldObj, x, y, z, meta); BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z); BTE.setOwnerName(ownerName); BTE.setFrontFacing(facing); @@ -179,10 +184,10 @@ public abstract class MapGenRuins extends WorldGenerator { try { GT_Runnable_MachineBlockUpdate.setDisabled(); } catch (Throwable ignored) {} - BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) setGTMachineBlock(worldObj, x, y, z, meta); + BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) this.setGTMachineBlock(worldObj, x, y, z, meta); MetaPipeEntity MPE = (MetaPipeEntity) BTE.getMetaTileEntity(); BTE.mConnections |= (byte) (1 << (byte) 4); - BTE.mConnections |= (byte) (1 << (ForgeDirection.getOrientation(4).getOpposite().ordinal())); + BTE.mConnections |= (byte) (1 << ForgeDirection.getOrientation(4).getOpposite().ordinal()); BaseMetaTileEntity BPE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z - 1); if (BPE != null) { BTE.mConnections |= (byte) (1 << (byte) 2); @@ -243,9 +248,13 @@ public abstract class MapGenRuins extends WorldGenerator { rand, 5, this.ToBuildWith[3][0]); - } else if ((dx == 0) && dz == -5 && (dy == 1 || dy == 2)) { - if (dy == 1) this.setBlock(worldObj, x + dx, y + 1, z + -5, Blocks.iron_door, 1); - if (dy == 2) this.setBlock(worldObj, x + dx, y + 2, z + dz, Blocks.iron_door, 8); + } else if (dx == 0 && dz == -5 && (dy == 1 || dy == 2)) { + if (dy == 1) { + this.setBlock(worldObj, x + dx, y + 1, z + -5, Blocks.iron_door, 1); + } + if (dy == 2) { + this.setBlock(worldObj, x + dx, y + 2, z + dz, Blocks.iron_door, 8); + } } else if (Math.abs(dx) == 5 && Math.abs(dz) < 5 || Math.abs(dz) == 5 && Math.abs(dx) < 5) { this.setRandomBlockWAirChance( worldObj, @@ -255,16 +264,19 @@ public abstract class MapGenRuins extends WorldGenerator { rand, 25, this.ToBuildWith[1]); - if (dy == 2) { - if (rand.nextInt(100) < 12) if (useColor) this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + 2, - z + dz, - rand, - 25, - new Pair<>(Blocks.stained_glass_pane, colored)); - else this.setRandomBlockWAirChance( + if (dy == 2 && rand.nextInt(100) < 12) { + if (useColor) { + this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + 2, + z + dz, + rand, + 25, + new Pair<>(Blocks.stained_glass_pane, colored)); + } + } else { + this.setRandomBlockWAirChance( worldObj, x + dx, y + dy, @@ -349,83 +361,113 @@ public abstract class MapGenRuins extends WorldGenerator { } } } - } else if (dy == 4) { - if (Math.abs(dx) == 5) this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + 4, - z + dz, - rand, - 25, - this.ToBuildWith[2]); - else if (Math.abs(dz) == 5 && Math.abs(dx) < 5) this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + dy, - z + dz, - rand, - 25, - this.ToBuildWith[1]); - } else if (dy == 5) { - if (Math.abs(dx) == 4) this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + 5, - z + dz, - rand, - 25, - this.ToBuildWith[2]); - else if (Math.abs(dz) == 5 && Math.abs(dx) < 4) this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + dy, - z + dz, - rand, - 25, - this.ToBuildWith[1]); - } else if (dy == 6) { - if (Math.abs(dx) == 3) this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + 6, - z + dz, - rand, - 25, - this.ToBuildWith[2]); - else if (Math.abs(dz) == 5 && Math.abs(dx) < 3) this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + dy, - z + dz, - rand, - 25, - this.ToBuildWith[1]); - } else if (dy == 7) { - if (Math.abs(dx) == 2) this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + 7, - z + dz, - rand, - 25, - this.ToBuildWith[2]); - else if (Math.abs(dz) == 5 && Math.abs(dx) < 2) this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + dy, - z + dz, - rand, - 25, - this.ToBuildWith[1]); - } else if (dy == 8) { - if (Math.abs(dx) == 1 || Math.abs(dx) == 0) this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + 8, - z + dz, - rand, - 25, - this.ToBuildWith[2]); + } else switch (dy) { + case 4: + if (Math.abs(dx) == 5) { + this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + 4, + z + dz, + rand, + 25, + this.ToBuildWith[2]); + break; + } + if (Math.abs(dz) == 5 && Math.abs(dx) < 5) { + this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 25, + this.ToBuildWith[1]); + } + break; + case 5: + if (Math.abs(dx) == 4) { + this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + 5, + z + dz, + rand, + 25, + this.ToBuildWith[2]); + break; + } + if (Math.abs(dz) == 5 && Math.abs(dx) < 4) { + this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 25, + this.ToBuildWith[1]); + } + break; + case 6: + if (Math.abs(dx) == 3) { + this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + 6, + z + dz, + rand, + 25, + this.ToBuildWith[2]); + break; + } + if (Math.abs(dz) == 5 && Math.abs(dx) < 3) { + this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 25, + this.ToBuildWith[1]); + } + break; + case 7: + if (Math.abs(dx) == 2) { + this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + 7, + z + dz, + rand, + 25, + this.ToBuildWith[2]); + break; + } + if (Math.abs(dz) == 5 && Math.abs(dx) < 2) { + this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 25, + this.ToBuildWith[1]); + } + break; + case 8: + if (Math.abs(dx) == 1 || Math.abs(dx) == 0) { + this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + 8, + z + dz, + rand, + 25, + this.ToBuildWith[2]); + } + break; + default: + break; } } } @@ -434,19 +476,22 @@ public abstract class MapGenRuins extends WorldGenerator { int dy = 1; int dz = 3; for (int dx = 2; dx > -5; dx--) { - if (set < toSet) { - if (!lastset || treeinaRow > 2 && worldObj.getTileEntity(x + dx, y + dy, z + dz) == null) { - short meta = GT_WorldgenUtil.getMachine(secureRandom, tier); - this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, ForgeDirection.UP); - - set++; - treeinaRow = 0; - lastset = true; - } else { - lastset = rand.nextBoolean(); - if (lastset) treeinaRow++; + if (set >= toSet) { + break tosetloop; + } + if (!lastset || treeinaRow > 2 && worldObj.getTileEntity(x + dx, y + dy, z + dz) == null) { + short meta = GT_WorldgenUtil.getMachine(secureRandom, tier); + this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, ForgeDirection.UP); + + set++; + treeinaRow = 0; + lastset = true; + } else { + lastset = rand.nextBoolean(); + if (lastset) { + treeinaRow++; } - } else break tosetloop; + } } } return true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index a2ed19b776..a628c1ffb6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -234,20 +234,14 @@ public class BWRecipes { * @param machine 0 = biolab; 1 = BacterialVat; 2 = sAcidGenFuels; 3 = circuitAssemblyLine */ public GT_Recipe.GT_Recipe_Map getMappingsFor(byte machine) { - switch (machine) { - case 0: - return sBiolab; - case 1: - return sBacteriaVat; - case 2: - return sAcidGenFuels; - case 3: - return sCircuitAssemblyLineMap; - case 4: - return sRadHatch; - default: - return null; - } + return switch (machine) { + case 0 -> this.sBiolab; + case 1 -> this.sBacteriaVat; + case 2 -> this.sAcidGenFuels; + case 3 -> this.sCircuitAssemblyLineMap; + case 4 -> this.sRadHatch; + default -> null; + }; } public static long calcDecayTicks(int x) { @@ -255,12 +249,12 @@ public class BWRecipes { if (x == 43) ret = 5000; else if (x == 61) ret = 4500; else if (x <= 100) ret = MathUtils.ceilLong((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); - else ret = MathUtils.ceilLong(((8000D * Math.tanh(-x / 65D) + 8000D))); + else ret = MathUtils.ceilLong(8000D * Math.tanh(-x / 65D) + 8000D); return ret; } public boolean addRadHatch(ItemStack item, int radioLevel, int amount, short[] rgba) { - return sRadHatch.addRecipe( + return this.sRadHatch.addRecipe( new DynamicGTRecipe( false, new ItemStack[] { item }, @@ -276,7 +270,7 @@ public class BWRecipes { } public boolean addRadHatch(ItemStack item, int radioLevel, int amount, int time, short[] rgba) { - return sRadHatch.addRecipe( + return this.sRadHatch.addRecipe( new DynamicGTRecipe( false, new ItemStack[] { item }, @@ -293,7 +287,7 @@ public class BWRecipes { public boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe( + return this.sBiolab.addRecipe( new DynamicGTRecipe( true, aInputs, @@ -310,7 +304,7 @@ public class BWRecipes { public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe( + return this.sBiolab.addRecipe( new DynamicGTRecipe( true, new ItemStack[] { BioItemList.getPetriDish(null), aInput }, @@ -327,7 +321,7 @@ public class BWRecipes { public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe( + return this.sBiolab.addRecipe( new DynamicGTRecipe( true, new ItemStack[] { BioItemList.getPetriDish(null), aInput }, @@ -345,7 +339,7 @@ public class BWRecipes { @Deprecated public boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe( + return this.sBiolab.addRecipe( new DynamicGTRecipe( true, aInputs, @@ -363,7 +357,7 @@ public class BWRecipes { @Deprecated public boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe( + return this.sBiolab.addRecipe( new DynamicGTRecipe( true, aInputs, @@ -381,7 +375,7 @@ public class BWRecipes { @Deprecated public boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe( + return this.sBiolab.addRecipe( new DynamicGTRecipe( true, aInputs, @@ -399,7 +393,7 @@ public class BWRecipes { @Deprecated public boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe( + return this.sBiolab.addRecipe( new DynamicGTRecipe( true, aInputs, @@ -417,7 +411,7 @@ public class BWRecipes { @Deprecated public boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe( + return this.sBiolab.addRecipe( new DynamicGTRecipe( true, aInputs, @@ -440,7 +434,7 @@ public class BWRecipes { aSievert += calculateSv(material); aSievert = aSievert << 6; aSievert = aSievert | glasTier; - return sBacteriaVat.addRecipe( + return this.sBacteriaVat.addRecipe( new BacteriaVatRecipe( false, aInputs, @@ -458,7 +452,6 @@ public class BWRecipes { public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, @Nonnegative int aSv, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { - byte gTier = (byte) glasTier; int aSievert = 0; if (aSv >= 83 || aSv == 61 || aSv == 43) aSievert += aSv; aSievert = aSievert << 1; @@ -466,8 +459,8 @@ public class BWRecipes { aSievert = aSievert << 2; aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; - aSievert = aSievert | gTier; - return sBacteriaVat.addRecipe( + aSievert = aSievert | glasTier; + return this.sBacteriaVat.addRecipe( new BacteriaVatRecipe( false, aInputs, @@ -496,7 +489,7 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - return sBacteriaVat.addRecipe( + return this.sBacteriaVat.addRecipe( new BacteriaVatRecipe( false, aInputs, @@ -520,7 +513,7 @@ public class BWRecipes { aSievert = aSievert << 1; aSievert = aSievert | (exactSv ? 1 : 0); aSievert = aSievert << 6; - return sBacteriaVat.addRecipe( + return this.sBacteriaVat.addRecipe( new BacteriaVatRecipe( false, aInputs, @@ -547,7 +540,7 @@ public class BWRecipes { aSievert = aSievert << 2; aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; - return sBacteriaVat.addRecipe( + return this.sBacteriaVat.addRecipe( new BacteriaVatRecipe( false, aInputs, @@ -569,7 +562,7 @@ public class BWRecipes { FluidStack[] aFluidOutputs, int aDuration, int aEUt, byte glasTier) { int aSievert = 0; aSievert = aSievert | glasTier; - return sBacteriaVat.addRecipe( + return this.sBacteriaVat.addRecipe( new BacteriaVatRecipe( false, aInputs, @@ -589,7 +582,7 @@ public class BWRecipes { */ public boolean addBacterialVatRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, BioCulture culture, FluidStack[] aFluidOutputs, int aDuration, int aEUt) { - return sBacteriaVat.addRecipe( + return this.sBacteriaVat.addRecipe( new BacteriaVatRecipe( false, aInputs, @@ -617,7 +610,7 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - return sBacteriaVat.addRecipe( + return this.sBacteriaVat.addRecipe( new BacteriaVatRecipe( true, aInputs, @@ -758,6 +751,7 @@ public class BWRecipes { aNEIAllowed); } + @Override protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) { aRecipe.mHidden = aHidden; @@ -768,30 +762,29 @@ public class BWRecipes { if (aRecipe.mFluidInputs.length < this.mMinimalInputFluids && aRecipe.mInputs.length < this.mMinimalInputItems) { return null; - } else { - return aCheckForCollisions && isthere != null - && BW_Util.areStacksEqualOrNull( - (ItemStack) isthere.mSpecialItems, - (ItemStack) aRecipe.mSpecialItems) ? null : this.add(aRecipe); } + return aCheckForCollisions && isthere != null + && BW_Util + .areStacksEqualOrNull((ItemStack) isthere.mSpecialItems, (ItemStack) aRecipe.mSpecialItems) + ? null + : this.add(aRecipe); } public GT_Recipe addRecipe(GT_Recipe aRecipe, boolean VanillaGT) { - if (VanillaGT) return addRecipe(aRecipe, true, false, false); - else return addRecipe(aRecipe); + if (VanillaGT) return this.addRecipe(aRecipe, true, false, false); + return this.addRecipe(aRecipe); } + @Override public GT_Recipe addRecipe(GT_Recipe aRecipe) { if (aRecipe.mInputs.length > 0 && GT_Utility.areStacksEqual( aRecipe.mInputs[aRecipe.mInputs.length - 1], GT_Utility.getIntegratedCircuit(32767))) return aRecipe; - else { - ItemStack[] nu1 = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1); - nu1[nu1.length - 1] = GT_Utility.getIntegratedCircuit(9 + nu1.length); - aRecipe.mInputs = nu1; - } + ItemStack[] nu1 = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1); + nu1[nu1.length - 1] = GT_Utility.getIntegratedCircuit(9 + nu1.length); + aRecipe.mInputs = nu1; if (this.findRecipe(null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null) { ItemStack[] nu = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1); int i = 9 + nu.length; @@ -875,7 +868,7 @@ public class BWRecipes { aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); - setSpecialSlotSensitive(true); + this.setSpecialSlotSensitive(true); } } @@ -899,12 +892,10 @@ public class BWRecipes { @Override public boolean equals(Object o) { if (this == o) return true; - if (!(o instanceof BWRecipes.BWNBTDependantCraftingRecipe)) return false; - - BWRecipes.BWNBTDependantCraftingRecipe that = (BWRecipes.BWNBTDependantCraftingRecipe) o; + if (!(o instanceof BWRecipes.BWNBTDependantCraftingRecipe that)) return false; - if (!Objects.equals(this.result, that.result)) return false; - if (!Objects.equals(this.charToStackMap, that.charToStackMap)) return false; + if (!Objects.equals(this.result, that.result) || !Objects.equals(this.charToStackMap, that.charToStackMap)) + return false; // Probably incorrect - comparing Object[] arrays with Arrays.equals return Arrays.equals(this.shape, that.shape); } @@ -913,8 +904,7 @@ public class BWRecipes { public int hashCode() { int result1 = this.result != null ? this.result.hashCode() : 0; result1 = 31 * result1 + (this.charToStackMap != null ? this.charToStackMap.hashCode() : 0); - result1 = 31 * result1 + Arrays.hashCode(this.shape); - return result1; + return 31 * result1 + Arrays.hashCode(this.shape); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java index 580f6f7793..5989c1b6d9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java @@ -26,7 +26,7 @@ public class BW_ColorUtil { public static byte getDarknessFromColor(short[] rgba, int index) { int g = rgba[index]; if (g >= 0 && g < 64) return 0; - else if (g >= 64 && g < 160) return 1; + if (g >= 64 && g < 160) return 1; else if (g >= 160 && g < 223) return 2; else if (g >= 233 && g <= 255) return 3; return 4; @@ -81,7 +81,8 @@ public class BW_ColorUtil { return Dyes._NULL; } return Dyes.dyePink; - } else if (isGrenScale(tmp)) { + } + if (isGrenScale(tmp)) { if (isCyanScale(tmp)) { if (rgba[2] + 40 < rgba[1]) switch (getDarknessFromColor(rgba, 0)) { case 0: @@ -151,17 +152,17 @@ public class BW_ColorUtil { public static boolean isBlueScale(short[] rgba) { rgba = correctCorlorArray(rgba); - return (rgba[2] * 2) >= (rgba[1] + rgba[0]); + return rgba[2] * 2 >= rgba[1] + rgba[0]; } public static boolean isGrenScale(short[] rgba) { rgba = correctCorlorArray(rgba); - return (rgba[1] * 2) >= (rgba[0] + rgba[2]); + return rgba[1] * 2 >= rgba[0] + rgba[2]; } public static boolean isRedScale(short[] rgba) { rgba = correctCorlorArray(rgba); - return (rgba[0] * 2) >= (rgba[1] + rgba[2]); + return rgba[0] * 2 >= rgba[1] + rgba[2]; } public static boolean isGrayScale(short[] rgba, int magin) { @@ -203,15 +204,15 @@ public class BW_ColorUtil { } public static short[] splitColorToRBGArray(int rgb) { - return new short[] { (short) ((rgb >> 16) & 0xFF), (short) ((rgb >> 8) & 0xFF), (short) (rgb & 0xFF) }; + return new short[] { (short) (rgb >> 16 & 0xFF), (short) (rgb >> 8 & 0xFF), (short) (rgb & 0xFF) }; } public static int getColorFromRGBArray(short[] color) { - return ((color[0] & 0x0ff) << 16) | ((color[1] & 0x0ff) << 8) | (color[2] & 0x0ff); + return (color[0] & 0x0ff) << 16 | (color[1] & 0x0ff) << 8 | color[2] & 0x0ff; } public static int getColorFromRGBArray(int[] color) { - return ((color[0] & 0x0ff) << 16) | ((color[1] & 0x0ff) << 8) | (color[2] & 0x0ff); + return (color[0] & 0x0ff) << 16 | (color[1] & 0x0ff) << 8 | color[2] & 0x0ff; } public static String getColorForTier(int tier) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 1db1293f2f..69438bff91 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -78,7 +78,6 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Shaped_Recipe; import gregtech.api.util.GT_Utility; -@SuppressWarnings({ "unused", "RedundantSuppression" }) public class BW_Util { public static final int STANDART = 0; @@ -110,10 +109,10 @@ public class BW_Util { int newTime = recipe.mDuration; int newVoltage = recipe.mEUt; if (tier < oldTier) { - newTime <<= (oldTier - tier); + newTime <<= oldTier - tier; newVoltage >>= 2 * (oldTier - tier); } else { - newTime >>= (tier - oldTier); + newTime >>= tier - oldTier; newVoltage <<= 2 * (tier - oldTier); } recipe.mEUt = newVoltage; @@ -125,40 +124,19 @@ public class BW_Util { char[] chars = b.toCharArray(); char[] nu = new char[chars.length]; for (int i = 0; i < chars.length; i++) { - switch (chars[i]) { - case '0': - nu[i] = '₀'; - continue; - case '1': - nu[i] = '₁'; - continue; - case '2': - nu[i] = '₂'; - continue; - case '3': - nu[i] = '₃'; - continue; - case '4': - nu[i] = '₄'; - continue; - case '5': - nu[i] = '₅'; - continue; - case '6': - nu[i] = '₆'; - continue; - case '7': - nu[i] = '₇'; - continue; - case '8': - nu[i] = '₈'; - continue; - case '9': - nu[i] = '₉'; - continue; - default: - nu[i] = chars[i]; - } + nu[i] = switch (chars[i]) { + case '0' -> '\u2080'; + case '1' -> '\u2081'; + case '2' -> '\u2082'; + case '3' -> '\u2083'; + case '4' -> '\u2084'; + case '5' -> '\u2085'; + case '6' -> '\u2086'; + case '7' -> '\u2087'; + case '8' -> '\u2088'; + case '9' -> '\u2089'; + default -> chars[i]; + }; } return new String(nu); } @@ -167,37 +145,19 @@ public class BW_Util { char[] chars = Long.toString(b.longValue()).toCharArray(); char[] nu = new char[chars.length]; for (int i = 0; i < chars.length; i++) { - switch (chars[i]) { - case '0': - nu[i] = '₀'; - continue; - case '1': - nu[i] = '₁'; - continue; - case '2': - nu[i] = '₂'; - continue; - case '3': - nu[i] = '₃'; - continue; - case '4': - nu[i] = '₄'; - continue; - case '5': - nu[i] = '₅'; - continue; - case '6': - nu[i] = '₆'; - continue; - case '7': - nu[i] = '₇'; - continue; - case '8': - nu[i] = '₈'; - continue; - case '9': - nu[i] = '₉'; - } + nu[i] = switch (chars[i]) { + case '0' -> '\u2080'; + case '1' -> '\u2081'; + case '2' -> '\u2082'; + case '3' -> '\u2083'; + case '4' -> '\u2084'; + case '5' -> '\u2085'; + case '6' -> '\u2086'; + case '7' -> '\u2087'; + case '8' -> '\u2088'; + case '9' -> '\u2089'; + default -> chars[i]; + }; } return new String(nu); } @@ -206,40 +166,19 @@ public class BW_Util { char[] chars = b.toCharArray(); char[] nu = new char[chars.length]; for (int i = 0; i < chars.length; i++) { - switch (chars[i]) { - case '0': - nu[i] = '⁰'; - continue; - case '1': - nu[i] = '¹'; - continue; - case '2': - nu[i] = '²'; - continue; - case '3': - nu[i] = '³'; - continue; - case '4': - nu[i] = '⁴'; - continue; - case '5': - nu[i] = '⁵'; - continue; - case '6': - nu[i] = '⁶'; - continue; - case '7': - nu[i] = '⁷'; - continue; - case '8': - nu[i] = '⁸'; - continue; - case '9': - nu[i] = '⁹'; - continue; - default: - nu[i] = chars[i]; - } + nu[i] = switch (chars[i]) { + case '0' -> '\u2070'; + case '1' -> '\u2071'; + case '2' -> '\u00B2'; + case '3' -> '\u00B3'; + case '4' -> '\u2074'; + case '5' -> '\u2075'; + case '6' -> '\u2076'; + case '7' -> '\u2077'; + case '8' -> '\u2078'; + case '9' -> '\u2079'; + default -> chars[i]; + }; } return new String(nu); } @@ -248,46 +187,38 @@ public class BW_Util { char[] chars = Long.toString(b.longValue()).toCharArray(); char[] nu = new char[chars.length]; for (int i = 0; i < chars.length; i++) { - switch (chars[i]) { - case '0': - nu[i] = '⁰'; - continue; - case '1': - nu[i] = '¹'; - continue; - case '2': - nu[i] = '²'; - continue; - case '3': - nu[i] = '³'; - continue; - case '4': - nu[i] = '⁴'; - continue; - case '5': - nu[i] = '⁵'; - continue; - case '6': - nu[i] = '⁶'; - continue; - case '7': - nu[i] = '⁷'; - continue; - case '8': - nu[i] = '⁸'; - continue; - case '9': - nu[i] = '⁹'; - } + nu[i] = switch (chars[i]) { + case '0' -> '\u2070'; + case '1' -> '\u2071'; + case '2' -> '\u00B2'; + case '3' -> '\u00B3'; + case '4' -> '\u2074'; + case '5' -> '\u2075'; + case '6' -> '\u2076'; + case '7' -> '\u2077'; + case '8' -> '\u2078'; + case '9' -> '\u2079'; + default -> chars[i]; + }; } return new String(nu); } public static byte specialToByte(int aSpecialValue) { byte special = 0; - if (aSpecialValue == (LOWGRAVITY)) special = 1; - else if (aSpecialValue == (CLEANROOM)) special = 2; - else if (aSpecialValue == (LOWGRAVITY | CLEANROOM)) special = 3; + switch (aSpecialValue) { + case LOWGRAVITY: + special = 1; + break; + case CLEANROOM: + special = 2; + break; + case LOWGRAVITY | CLEANROOM: + special = 3; + break; + default: + break; + } return special; } @@ -316,8 +247,8 @@ public class BW_Util { if (pair.getMaterials().equals(materials)) return pair.getSievert(); } return (int) (materials.getProtons() == 43L - ? (materials.equals(Materials.NaquadahEnriched) ? 140 - : materials.equals(Materials.Naquadria) ? 150 : materials.equals(Materials.Naquadah) ? 130 : 43) + ? materials.equals(Materials.NaquadahEnriched) ? 140 + : materials.equals(Materials.Naquadria) ? 150 : materials.equals(Materials.Naquadah) ? 130 : 43 : materials.getProtons()); } @@ -397,7 +328,7 @@ public class BW_Util { @Deprecated public static int getMachineVoltageFromTier(int tier) { - return (int) (30 * Math.pow(4, (tier - 1))); + return (int) (30 * Math.pow(4, tier - 1)); } public static long getTierVoltage(int tier) { @@ -405,7 +336,7 @@ public class BW_Util { } public static long getTierVoltage(byte tier) { - return 8L << (2 * tier); + return 8L << 2 * tier; } public static byte getTier(long voltage) { @@ -420,7 +351,7 @@ public class BW_Util { public static String getTierName(byte tier) { if (VN.length - 1 <= tier) return "MAX+"; - else return VN[tier]; + return VN[tier]; } public static String getTierNameFromVoltage(long voltage) { @@ -428,7 +359,7 @@ public class BW_Util { } public static boolean areStacksEqualOrNull(ItemStack aStack1, ItemStack aStack2) { - return (aStack1 == null && aStack2 == null) || GT_Utility.areStacksEqual(aStack1, aStack2); + return aStack1 == null && aStack2 == null || GT_Utility.areStacksEqual(aStack1, aStack2); } public static boolean areStacksEqualOrEachNull(ItemStack aStack1, ItemStack aStack2) { @@ -436,9 +367,9 @@ public class BW_Util { } public static byte getByteFromRarity(EnumRarity rarity) { - if (rarity.equals(EnumRarity.uncommon)) return 1; - else if (rarity.equals(EnumRarity.epic)) return 2; - else if (rarity.equals(EnumRarity.rare)) return 3; + if (EnumRarity.uncommon.equals(rarity)) return 1; + if (EnumRarity.epic.equals(rarity)) return 2; + else if (EnumRarity.rare.equals(rarity)) return 3; return 0; } @@ -447,34 +378,16 @@ public class BW_Util { */ @Deprecated public static byte getTierFromGlasMeta(int meta) { - byte ret; - switch (meta) { - case 1: - ret = 4; - break; - case 2: - case 12: - ret = 5; - break; - case 3: - ret = 6; - break; - case 4: - ret = 7; - break; - case 5: - ret = 8; - break; - case 13: - ret = 9; - break; - case 14: - ret = 10; - break; - default: - ret = 3; - } - return ret; + return switch (meta) { + case 1 -> 4; + case 2, 12 -> 5; + case 3 -> 6; + case 4 -> 7; + case 5 -> 8; + case 13 -> 9; + case 14 -> 10; + default -> 3; + }; } /** @@ -502,7 +415,7 @@ public class BW_Util { byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); if (mTier == 0) { // Long time calculation - long xMaxProgresstime = ((long) aDuration) << 1; + long xMaxProgresstime = (long) aDuration << 1; if (xMaxProgresstime > Integer.MAX_VALUE - 1) { // make impossible if too long base.mEUt = Integer.MAX_VALUE - 1; @@ -580,215 +493,12 @@ public class BW_Util { } public static EnumRarity getRarityFromByte(byte b) { - switch (b) { - case 1: - return EnumRarity.uncommon; - case 2: - return EnumRarity.rare; - case 3: - return EnumRarity.epic; - default: - return EnumRarity.common; - } - } - - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, - Block block, int dmg, int offset, boolean insideCheck, Block inside, int dmginside, int aBaseCasingIndex) { - return BW_Util.check_layer( - aBaseMetaTileEntity, - radius, - yLevel, - height, - block, - dmg, - offset, - false, - insideCheck, - inside, - dmginside, - aBaseCasingIndex); - } - - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, - Block block, int dmg, int offset, int aBaseCasingIndex) { - return BW_Util - .check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, aBaseCasingIndex); - } - - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, - Block block, int dmg, int offset, boolean controllerLayer, int aBaseCasingIndex) { - return BW_Util.check_layer( - aBaseMetaTileEntity, - radius, - yLevel, - height, - block, - dmg, - offset, - controllerLayer, - false, - aBaseCasingIndex); - } - - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, - Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, int aBaseCasingIndex) { - return BW_Util.check_layer( - aBaseMetaTileEntity, - radius, - yLevel, - height, - block, - dmg, - offset, - controllerLayer, - freeCorners, - false, - block, - dmg, - true, - aBaseCasingIndex); - } - - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, - Block block, int dmg, int offset, boolean controllerLayer, boolean insideCheck, Block inside, int dmginside, - int aBaseCasingIndex) { - return BW_Util.check_layer( - aBaseMetaTileEntity, - radius, - yLevel, - height, - block, - dmg, - offset, - controllerLayer, - false, - insideCheck, - inside, - dmginside, - true, - aBaseCasingIndex); - } - - /** - * @param aBaseMetaTileEntity the Multiblock controller, usually a parameter - * @param radius the radius of the layer - * @param yLevel the starting y level of the Layer, referenced to the Multiblock - * @param height the height of the Layers, referenced to the Multiblock - * @param block the block for the walls - * @param offset the offset in most cases should be the same as the radius - * @param controllerLayer if the layer contains the controller - * @param freeCorners if the corners should be checked - * @param insideCheck if the inside should be empty/filled - * @param inside which block should be inside - * @param allowHatches if hatches are allowed in this Layer - * @param aBaseCasingIndex the Index for the hatches texture - * @return if the layer check was completed - */ - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, - Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck, - Block inside, int dmginside, boolean allowHatches, int aBaseCasingIndex) { - int xDir = aBaseMetaTileEntity.getBackFacing().offsetX * offset; - int zDir = aBaseMetaTileEntity.getBackFacing().offsetZ * offset; - for (int x = -radius; x <= radius; x++) { - for (int y = yLevel; y < height; y++) { - for (int z = -radius; z <= radius; z++) { - if (freeCorners && (((Math.abs(x) == radius && Math.abs(z) == radius)))) continue; - if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) continue; - boolean b = Math.abs(x) < radius && Math.abs(z) != radius; - if (insideCheck && b) { - if (!(inside.equals(Blocks.air) ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) - : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside)) - && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside - || dmginside > (-1))) { - if (!(allowHatches - && (((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) - .addDynamoToMachineList( - aBaseMetaTileEntity - .getIGregTechTileEntityOffset(xDir + x, y, zDir + z), - aBaseCasingIndex) - || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity - .getMetaTileEntity()) - .addEnergyInputToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset( - xDir + x, - y, - zDir + z), - aBaseCasingIndex) - || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity - .getMetaTileEntity()) - .addMaintenanceToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset( - xDir + x, - y, - zDir + z), - aBaseCasingIndex) - || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity - .getMetaTileEntity()) - .addMufflerToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset( - xDir + x, - y, - zDir + z), - aBaseCasingIndex) - || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity - .getMetaTileEntity()) - .addInputToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset( - xDir + x, - y, - zDir + z), - aBaseCasingIndex) - || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity - .getMetaTileEntity()) - .addOutputToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset( - xDir + x, - y, - zDir + z), - aBaseCasingIndex)))) { - return false; - } - } - } - if (!b && !aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) - && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmg || dmg > (-1))) { - if (!(allowHatches - && (((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) - .addDynamoToMachineList( - aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), - aBaseCasingIndex) - || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) - .addEnergyInputToMachineList( - aBaseMetaTileEntity - .getIGregTechTileEntityOffset(xDir + x, y, zDir + z), - aBaseCasingIndex) - || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) - .addMaintenanceToMachineList( - aBaseMetaTileEntity - .getIGregTechTileEntityOffset(xDir + x, y, zDir + z), - aBaseCasingIndex) - || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) - .addMufflerToMachineList( - aBaseMetaTileEntity - .getIGregTechTileEntityOffset(xDir + x, y, zDir + z), - aBaseCasingIndex) - || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) - .addInputToMachineList( - aBaseMetaTileEntity - .getIGregTechTileEntityOffset(xDir + x, y, zDir + z), - aBaseCasingIndex) - || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) - .addOutputToMachineList( - aBaseMetaTileEntity - .getIGregTechTileEntityOffset(xDir + x, y, zDir + z), - aBaseCasingIndex)))) { - return false; - } - } - } - } - } - return true; + return switch (b) { + case 1 -> EnumRarity.uncommon; + case 2 -> EnumRarity.rare; + case 3 -> EnumRarity.epic; + default -> EnumRarity.common; + }; } public static List getMetasFromLayer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, @@ -799,8 +509,8 @@ public class BW_Util { for (int x = -radius; x <= radius; x++) { for (int y = yLevel; y < height; y++) { for (int z = -radius; z <= radius; z++) { - if (freeCorners && (((Math.abs(x) == radius && Math.abs(z) == radius)))) continue; - if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) continue; + if (freeCorners && Math.abs(x) == radius && Math.abs(z) == radius) continue; + if (controllerLayer && xDir + x == 0 && zDir + z == 0) continue; final boolean inside = Math.abs(x) < radius && Math.abs(z) != radius; if (insideCheck && inside) ret.add(aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); if (!inside) { @@ -813,43 +523,24 @@ public class BW_Util { } public static byte getCircuitTierFromOreDictName(String name) { - switch (name) { - case "circuitPrimitive": - return 0; - case "circuitBasic": - return 1; - case "circuitGood": - return 2; - case "circuitAdvanced": - return 3; - case "circuitData": - return 4; - case "circuitElite": - return 5; - case "circuitMaster": - return 6; - case "circuitUltimate": - return 7; - case "circuitSuperconductor": - return 8; - case "circuitInfinite": - return 9; - case "circuitBio": - return 10; - case "circuitNano": - case "circuitOptical": - return 11; - case "circuitPiko": - case "circuitExotic": - return 12; - case "circuitQuantum": - case "circuitCosmic": - return 13; - case "circuitTranscendent": - return 14; - default: - return -1; - } + return switch (name) { + case "circuitPrimitive" -> 0; + case "circuitBasic" -> 1; + case "circuitGood" -> 2; + case "circuitAdvanced" -> 3; + case "circuitData" -> 4; + case "circuitElite" -> 5; + case "circuitMaster" -> 6; + case "circuitUltimate" -> 7; + case "circuitSuperconductor" -> 8; + case "circuitInfinite" -> 9; + case "circuitBio" -> 10; + case "circuitNano", "circuitOptical" -> 11; + case "circuitPiko", "circuitExotic" -> 12; + case "circuitQuantum", "circuitCosmic" -> 13; + case "circuitTranscendent" -> 14; + default -> -1; + }; } public static byte getCircuitTierFromItemStack(ItemStack stack) { @@ -874,14 +565,12 @@ public class BW_Util { return ret; } - private static Block bw_realglasRef; - public static byte calculateGlassTier(@Nonnull Block block, @Nonnegative byte meta) { byte boroTier = BorosilicateGlass.getTier(block, meta); if (boroTier != -1) return boroTier; - if (block.getUnlocalizedName().equals("blockAlloyGlass")) return 4; + if ("blockAlloyGlass".equals(block.getUnlocalizedName())) return 4; if (block.equals(Blocks.glass)) return 3; @@ -896,7 +585,7 @@ public class BW_Util { public static IStructureElement ofGlassTiered(byte mintier, byte maxtier, byte notset, BiConsumer setter, Function getter, int aDots) { - return new IStructureElement() { + return new IStructureElement<>() { private final IStructureElement placementDelegate = BorosilicateGlass .ofBoroGlass(notset, mintier, maxtier, setter, getter); @@ -906,10 +595,8 @@ public class BW_Util { if (world.isAirBlock(x, y, z)) return false; byte glasstier = BW_Util .calculateGlassTier(world.getBlock(x, y, z), (byte) world.getBlockMetadata(x, y, z)); - if (glasstier == 0) return false; // is not a glass ? - if (glasstier == notset) return false; - if (glasstier < mintier) return false; - if (glasstier > maxtier) return false; + // is not a glass ? + if (glasstier == 0 || glasstier == notset || glasstier < mintier || glasstier > maxtier) return false; if (getter.apply(te) == notset) setter.accept(te, glasstier); return getter.apply(te) == glasstier; } @@ -922,22 +609,22 @@ public class BW_Util { @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return placementDelegate.placeBlock(t, world, x, y, z, trigger); + return this.placementDelegate.placeBlock(t, world, x, y, z, trigger); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { - return placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, env); + return this.placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, env); } }; } public static IStructureElement ofGlassTieredMixed(byte mintier, byte maxtier, int aDots) { - return new IStructureElement() { + return new IStructureElement<>() { private final IStructureElement placementDelegate = BorosilicateGlass - .ofBoroGlass((byte) 0, mintier, maxtier, (v1, v2) -> {}, (v1) -> (byte) 0); + .ofBoroGlass((byte) 0, mintier, maxtier, (v1, v2) -> {}, v1 -> (byte) 0); @Override public boolean check(T te, World world, int x, int y, int z) { @@ -956,13 +643,13 @@ public class BW_Util { @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return placementDelegate.placeBlock(t, world, x, y, z, trigger); + return this.placementDelegate.placeBlock(t, world, x, y, z, trigger); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { - return placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, env); + return this.placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, env); } }; } @@ -1002,7 +689,6 @@ public class BW_Util { aRecipe); } - @SuppressWarnings({ "rawtypes", "unchecked" }) public static ShapedOreRecipe createGTCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput, @@ -1017,13 +703,20 @@ public class BW_Util { boolean tThereWasARecipe = false; for (byte i = 0; i < aRecipe.length; i++) { - if (aRecipe[i] instanceof IItemContainer) aRecipe[i] = ((IItemContainer) aRecipe[i]).get(1); - else if (aRecipe[i] instanceof Enum) aRecipe[i] = ((Enum) aRecipe[i]).name(); - else if (!(aRecipe[i] == null || aRecipe[i] instanceof ItemStack - || aRecipe[i] instanceof ItemData - || aRecipe[i] instanceof String - || aRecipe[i] instanceof Character)) + if (aRecipe[i] instanceof IItemContainer itemContainer) { + aRecipe[i] = itemContainer.get(1); + continue; + } + if (aRecipe[i] instanceof Enumenum_) { + aRecipe[i] = enum_.name(); + continue; + } + if (aRecipe[i] != null && !(aRecipe[i] instanceof ItemStack) + && !(aRecipe[i] instanceof ItemData) + && !(aRecipe[i] instanceof String) + && !(aRecipe[i] instanceof Character)) { aRecipe[i] = aRecipe[i].toString(); + } } try { @@ -1035,8 +728,9 @@ public class BW_Util { ArrayList tRecipeList = new ArrayList<>(Arrays.asList(aRecipe)); - while (aRecipe[idx] instanceof String) { - StringBuilder s = new StringBuilder((String) aRecipe[idx++]); + while (aRecipe[idx] instanceof String string) { + StringBuilder s = new StringBuilder(string); + idx++; shape.append(s); while (s.length() < 3) s.append(" "); if (s.length() > 3) throw new IllegalArgumentException(); @@ -1176,7 +870,10 @@ public class BW_Util { if (aReversible && aResult != null) { ItemData[] tData = new ItemData[9]; int x = -1; - for (char chr : shape.toString().toCharArray()) tData[++x] = tItemDataMap.get(chr); + for (char chr : shape.toString().toCharArray()) { + x++; + tData[x] = tItemDataMap.get(chr); + } if (GT_Utility.arrayContainsNonNull(tData)) GT_OreDictUnificator.addItemData(aResult, new ItemData(tData)); } @@ -1185,7 +882,8 @@ public class BW_Util { ItemStack[] tRecipe = new ItemStack[9]; int x = -1; for (char chr : shape.toString().toCharArray()) { - tRecipe[++x] = tItemStackMap.get(chr); + x++; + tRecipe[x] = tItemStackMap.get(chr); if (tRecipe[x] != null && Items.feather.getDamage(tRecipe[x]) == W) Items.feather.setDamage(tRecipe[x], 0); } @@ -1213,7 +911,8 @@ public class BW_Util { IRecipe tRecipe = tList.get(i); if (GT_ModHandler.sSpecialRecipeClasses.contains(tRecipe.getClass().getName())) continue; if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tRecipe.getRecipeOutput()), aResult, true)) { - tList.remove(i--); + tList.remove(i); + i--; tList_sS = tList.size(); tThereWasARecipe = true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index c260b6d681..3a9edb71f0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -170,7 +170,7 @@ public class BioCulture extends BioData implements IColorModulationContainer { } public BioCulture setPlasmid(BioPlasmid plasmid) { - return checkForExisting( + return this.checkForExisting( new BioCulture(this.color, this.name, this.ID, plasmid, this.dDNA, this.rarity, this.bBreedable)); } @@ -191,7 +191,7 @@ public class BioCulture extends BioData implements IColorModulationContainer { } public BioCulture setdDNA(BioDNA dDNA) { - return checkForExisting( + return this.checkForExisting( new BioCulture(this.color, this.name, this.ID, this.plasmid, dDNA, this.rarity, this.bBreedable)); } @@ -203,8 +203,7 @@ public class BioCulture extends BioData implements IColorModulationContainer { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || this.getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; + if (o == null || this.getClass() != o.getClass() || !super.equals(o)) return false; BioCulture culture = (BioCulture) o; return this.isBreedable() == culture.isBreedable() && Objects.equals(this.getColor(), culture.getColor()) && Objects.equals(this.getPlasmid(), culture.getPlasmid()) @@ -218,7 +217,7 @@ public class BioCulture extends BioData implements IColorModulationContainer { ByteBuffer.allocate(17) .putInt(MurmurHash3.murmurhash3_x86_32(this.getName(), 0, this.getName().length(), 31)) .putInt(this.getColorRGB()).putInt(this.getPlasmid().ID).putInt(this.getdDNA().ID) - .put((byte) (isBreedable() ? 1 : 0)).array(), + .put((byte) (this.isBreedable() ? 1 : 0)).array(), 0, 17, 31); @@ -226,7 +225,7 @@ public class BioCulture extends BioData implements IColorModulationContainer { @Override public short[] getRGBA() { - return new short[] { (short) getColor().getRed(), (short) getColor().getGreen(), (short) getColor().getBlue(), - (short) getColor().getAlpha() }; + return new short[] { (short) this.getColor().getRed(), (short) this.getColor().getGreen(), + (short) this.getColor().getBlue(), (short) this.getColor().getAlpha() }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java index c1c6431daf..22edd60170 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java @@ -46,6 +46,6 @@ public class BioDNA extends BioData { @Override public String toString() { - return "BioDNA{" + "name='" + name + '\'' + ", ID=" + ID + '}'; + return "BioDNA{" + "name='" + this.name + '\'' + ", ID=" + this.ID + '}'; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java index 854bc4afba..d88ffc3aa3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java @@ -100,9 +100,9 @@ public class BioData { if (o == null || this.getClass() != o.getClass()) return false; BioData bioData = (BioData) o; return this.getID() == bioData.getID() - || (this.getChance() == bioData.getChance() && this.getTier() == bioData.getTier() + || this.getChance() == bioData.getChance() && this.getTier() == bioData.getTier() && Objects.equals(this.getName(), bioData.getName()) - && this.getRarity() == bioData.getRarity()); + && this.getRarity() == bioData.getRarity(); } @Override @@ -127,7 +127,7 @@ public class BioData { @Override public String toString() { - return "BioData{" + "name='" + name + '\'' + ", ID=" + ID + '}'; + return "BioData{" + "name='" + this.name + '\'' + ", ID=" + this.ID + '}'; } public EnumRarity getRarity() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java index 47f94bb389..0d40d9deca 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java @@ -46,6 +46,6 @@ public class BioPlasmid extends BioData { @Override public String toString() { - return "BioPlasmid{" + "name='" + name + '\'' + ", ID=" + ID + '}'; + return "BioPlasmid{" + "name='" + this.name + '\'' + ", ID=" + this.ID + '}'; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java index 48aaf70b6b..d35489a151 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java @@ -16,7 +16,6 @@ package com.github.bartimaeusnek.bartworks.util; import java.util.HashSet; import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; @@ -51,36 +50,36 @@ public class ConnectedBlocksChecker { int wID = w.provider.dimensionId; - byte sides = check_sourroundings(w, x, y, z, b); + byte sides = this.check_sourroundings(w, x, y, z, b); - if (((sides | 0b111011) == 0b111111) && !hashset.contains(new Coords(x + 1, y, z, wID))) { + if ((sides | 0b111011) == 0b111111 && !this.hashset.contains(new Coords(x + 1, y, z, wID))) { ret++; - ret += get_connected(w, x + 1, y, z, b); + ret += this.get_connected(w, x + 1, y, z, b); } - if (((sides | 0b110111) == 0b111111) && !hashset.contains(new Coords(x - 1, y, z, wID))) { + if ((sides | 0b110111) == 0b111111 && !this.hashset.contains(new Coords(x - 1, y, z, wID))) { ret++; - ret += get_connected(w, x - 1, y, z, b); + ret += this.get_connected(w, x - 1, y, z, b); } - if (((sides | 0b101111) == 0b111111) && !hashset.contains(new Coords(x, y, z + 1, wID))) { + if ((sides | 0b101111) == 0b111111 && !this.hashset.contains(new Coords(x, y, z + 1, wID))) { ret++; - ret += get_connected(w, x, y, z + 1, b); + ret += this.get_connected(w, x, y, z + 1, b); } - if (((sides | 0b011111) == 0b111111) && !hashset.contains(new Coords(x, y, z - 1, wID))) { + if ((sides | 0b011111) == 0b111111 && !this.hashset.contains(new Coords(x, y, z - 1, wID))) { ret++; - ret += get_connected(w, x, y, z - 1, b); + ret += this.get_connected(w, x, y, z - 1, b); } - if (((sides | 0b111110) == 0b111111) && !hashset.contains(new Coords(x, y + 1, z, wID))) { + if ((sides | 0b111110) == 0b111111 && !this.hashset.contains(new Coords(x, y + 1, z, wID))) { ret++; - ret += get_connected(w, x, y + 1, z, b); + ret += this.get_connected(w, x, y + 1, z, b); } - if (((sides | 0b111101) == 0b111111) && !hashset.contains(new Coords(x, y - 1, z, wID))) { + if ((sides | 0b111101) == 0b111111 && !this.hashset.contains(new Coords(x, y - 1, z, wID))) { ret++; - ret += get_connected(w, x, y - 1, z, b); + ret += this.get_connected(w, x, y - 1, z, b); } return ret; @@ -91,9 +90,9 @@ public class ConnectedBlocksChecker { byte ret = 0; int wID = w.provider.dimensionId; - if (hashset.contains(new Coords(x, y, z, wID))) return ret; + if (this.hashset.contains(new Coords(x, y, z, wID))) return ret; - hashset.add(new Coords(x, y, z, wID)); + this.hashset.add(new Coords(x, y, z, wID)); if (w.getBlock(x + 1, y, z).equals(b)) ret = (byte) (ret | 0b000100); @@ -115,58 +114,60 @@ public class ConnectedBlocksChecker { int wID = w.provider.dimensionId; Coords Controller = new Coords(xyz[0], xyz[1], xyz[2], wID); - for (Coords C : hashset) { + for (Coords C : this.hashset) { if (GT) { - TileEntity t; - t = w.getTileEntity(C.x, C.y + 1, C.z); - if (t != null && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) { - if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; + if (!new Coords(C.x, C.y + 1, C.z, wID).equals(Controller) + && w.getTileEntity(C.x, C.y + 1, C.z) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { + return true; } - t = w.getTileEntity(C.x, C.y - 1, C.z); - if (t != null && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) { - if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; + if (!new Coords(C.x, C.y - 1, C.z, wID).equals(Controller) + && w.getTileEntity(C.x, C.y - 1, C.z) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { + return true; } - t = w.getTileEntity(C.x + 1, C.y, C.z); - if (t != null && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) { - if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; + if (!new Coords(C.x + 1, C.y, C.z, wID).equals(Controller) + && w.getTileEntity(C.x + 1, C.y, C.z) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { + return true; } - t = w.getTileEntity(C.x - 1, C.y, C.z); - if (t != null && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) { - if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; + if (!new Coords(C.x - 1, C.y, C.z, wID).equals(Controller) + && w.getTileEntity(C.x - 1, C.y, C.z) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { + return true; } - t = w.getTileEntity(C.x, C.y, C.z + 1); - if (t != null && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) { - if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; + if (!new Coords(C.x, C.y, C.z + 1, wID).equals(Controller) + && w.getTileEntity(C.x, C.y, C.z + 1) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { + return true; } - t = w.getTileEntity(C.x, C.y, C.z - 1); - if (t != null && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) { - if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; + if (!new Coords(C.x, C.y, C.z - 1, wID).equals(Controller) + && w.getTileEntity(C.x, C.y, C.z - 1) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { + return true; } } else { - if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) - && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x, C.y - 1, C.z) - && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) + if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller) + || n == w.getBlockMetadata(C.x, C.y - 1, C.z) + && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) { return true; + } if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) - && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) + && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) { return true; + } if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) - && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) + && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) { return true; + } if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) - && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) + && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) { return true; + } if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) - && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) + && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) { return true; + } } } return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java index eb5dd0b17d..7dee6f3f98 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java @@ -18,7 +18,6 @@ import java.util.LinkedList; import java.util.Queue; import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -34,45 +33,45 @@ public class ConnectedBlocksCheckerIteration { private final Queue kwoe = new LinkedList<>(); public long get_connected(World w, int x, int y, int z, Block b) { - kwoe.add(new Coords(x, y, z, w.provider.dimensionId)); - hashset.add(new Coords(x, y, z, w.provider.dimensionId)); - while (!kwoe.isEmpty()) { - Coords tocheck = kwoe.poll(); + this.kwoe.add(new Coords(x, y, z, w.provider.dimensionId)); + this.hashset.add(new Coords(x, y, z, w.provider.dimensionId)); + while (!this.kwoe.isEmpty()) { + Coords tocheck = this.kwoe.poll(); int wID = w.provider.dimensionId; - checked.add(tocheck); + this.checked.add(tocheck); Coords c; - if (!checked.contains(c = new Coords(tocheck.x + 1, tocheck.y, tocheck.z, wID)) + if (!this.checked.contains(c = new Coords(tocheck.x + 1, tocheck.y, tocheck.z, wID)) && w.getBlock(tocheck.x + 1, tocheck.y, tocheck.z).equals(b)) { - kwoe.add(c); - hashset.add(c); + this.kwoe.add(c); + this.hashset.add(c); } - if (!checked.contains(c = new Coords(tocheck.x - 1, tocheck.y, tocheck.z, wID)) + if (!this.checked.contains(c = new Coords(tocheck.x - 1, tocheck.y, tocheck.z, wID)) && w.getBlock(tocheck.x - 1, tocheck.y, tocheck.z).equals(b)) { - kwoe.add(c); - hashset.add(c); + this.kwoe.add(c); + this.hashset.add(c); } - if (!checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z + 1, wID)) + if (!this.checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z + 1, wID)) && w.getBlock(tocheck.x, tocheck.y, tocheck.z + 1).equals(b)) { - kwoe.add(c); - hashset.add(c); + this.kwoe.add(c); + this.hashset.add(c); } - if (!checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z - 1, wID)) + if (!this.checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z - 1, wID)) && w.getBlock(tocheck.x, tocheck.y, tocheck.z - 1).equals(b)) { - kwoe.add(c); - hashset.add(c); + this.kwoe.add(c); + this.hashset.add(c); } - if (!checked.contains(c = new Coords(tocheck.x, tocheck.y + 1, tocheck.z, wID)) + if (!this.checked.contains(c = new Coords(tocheck.x, tocheck.y + 1, tocheck.z, wID)) && w.getBlock(tocheck.x, tocheck.y + 1, tocheck.z).equals(b)) { - kwoe.add(c); - hashset.add(c); + this.kwoe.add(c); + this.hashset.add(c); } - if (!checked.contains(c = new Coords(tocheck.x, tocheck.y - 1, tocheck.z, wID)) + if (!this.checked.contains(c = new Coords(tocheck.x, tocheck.y - 1, tocheck.z, wID)) && w.getBlock(tocheck.x, tocheck.y - 1, tocheck.z).equals(b)) { - kwoe.add(c); - hashset.add(c); + this.kwoe.add(c); + this.hashset.add(c); } } - return hashset.size(); + return this.hashset.size(); } public boolean get_meta_of_sideblocks(World w, int n, int[] xyz, boolean GT) { @@ -80,58 +79,60 @@ public class ConnectedBlocksCheckerIteration { int wID = w.provider.dimensionId; Coords Controller = new Coords(xyz[0], xyz[1], xyz[2], wID); - for (Coords C : hashset) { + for (Coords C : this.hashset) { if (GT) { - TileEntity t; - t = w.getTileEntity(C.x, C.y + 1, C.z); - if (t != null && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) { - if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; + if (!new Coords(C.x, C.y + 1, C.z, wID).equals(Controller) + && w.getTileEntity(C.x, C.y + 1, C.z) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { + return true; } - t = w.getTileEntity(C.x, C.y - 1, C.z); - if (t != null && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) { - if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; + if (!new Coords(C.x, C.y - 1, C.z, wID).equals(Controller) + && w.getTileEntity(C.x, C.y - 1, C.z) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { + return true; } - t = w.getTileEntity(C.x + 1, C.y, C.z); - if (t != null && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) { - if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; + if (!new Coords(C.x + 1, C.y, C.z, wID).equals(Controller) + && w.getTileEntity(C.x + 1, C.y, C.z) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { + return true; } - t = w.getTileEntity(C.x - 1, C.y, C.z); - if (t != null && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) { - if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; + if (!new Coords(C.x - 1, C.y, C.z, wID).equals(Controller) + && w.getTileEntity(C.x - 1, C.y, C.z) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { + return true; } - t = w.getTileEntity(C.x, C.y, C.z + 1); - if (t != null && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) { - if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; + if (!new Coords(C.x, C.y, C.z + 1, wID).equals(Controller) + && w.getTileEntity(C.x, C.y, C.z + 1) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { + return true; } - t = w.getTileEntity(C.x, C.y, C.z - 1); - if (t != null && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) { - if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; + if (!new Coords(C.x, C.y, C.z - 1, wID).equals(Controller) + && w.getTileEntity(C.x, C.y, C.z - 1) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { + return true; } } else { - if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) - && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x, C.y - 1, C.z) - && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) + if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller) + || n == w.getBlockMetadata(C.x, C.y - 1, C.z) + && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) { return true; + } if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) - && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) + && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) { return true; + } if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) - && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) + && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) { return true; + } if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) - && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) + && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) { return true; + } if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) - && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) + && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) { return true; + } } } return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java index b1ece2651f..f8c33dd8e9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java @@ -33,22 +33,15 @@ public class Coords { } public Coords getCoordsFromSide(ForgeDirection direction) { - switch (direction) { - case UP: - return new Coords(this.x, this.y + 1, this.z, this.wID); - case DOWN: - return new Coords(this.x, this.y - 1, this.z, this.wID); - case WEST: - return new Coords(this.x - 1, this.y, this.z, this.wID); - case EAST: - return new Coords(this.x + 1, this.y, this.z, this.wID); - case NORTH: - return new Coords(this.x, this.y, this.z - 1, this.wID); - case SOUTH: - return new Coords(this.x, this.y, this.z + 1, this.wID); - default: - throw new UnsupportedOperationException("This is impossible."); - } + return switch (direction) { + case UP -> new Coords(this.x, this.y + 1, this.z, this.wID); + case DOWN -> new Coords(this.x, this.y - 1, this.z, this.wID); + case WEST -> new Coords(this.x - 1, this.y, this.z, this.wID); + case EAST -> new Coords(this.x + 1, this.y, this.z, this.wID); + case NORTH -> new Coords(this.x, this.y, this.z - 1, this.wID); + case SOUTH -> new Coords(this.x, this.y, this.z + 1, this.wID); + default -> throw new UnsupportedOperationException("This is impossible."); + }; } @Override @@ -81,6 +74,6 @@ public class Coords { @Override public String toString() { - return x + "," + y + "," + z + "," + wID; + return this.x + "," + this.y + "," + this.z + "," + this.wID; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java index b3cbc9351f..e8f4330ed3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java @@ -62,13 +62,13 @@ public class MathUtils { } public static byte clamp(byte amount, byte min, byte max) { - byte inner = (amount <= max) ? amount : max; - return (min >= inner) ? min : inner; + byte inner = amount <= max ? amount : max; + return min >= inner ? min : inner; } public static short clamp(short amount, short min, short max) { - short inner = (amount <= max) ? amount : max; - return (min >= inner) ? min : inner; + short inner = amount <= max ? amount : max; + return min >= inner ? min : inner; } public static int clamp(int amount, int min, int max) { @@ -88,23 +88,23 @@ public class MathUtils { } public static > T clamp(T val, T min, T max) { - return (val.compareTo(min) < 0) ? min : (val.compareTo(max) > 0) ? max : val; + return val.compareTo(min) < 0 ? min : val.compareTo(max) > 0 ? max : val; } public static int wrap(int input, int bound) { - return (((input % bound) + bound) % bound); + return (input % bound + bound) % bound; } public static long wrap(long input, long bound) { - return (((input % bound) + bound) % bound); + return (input % bound + bound) % bound; } public static double wrap(double input, double bound) { - return (((input % bound) + bound) % bound); + return (input % bound + bound) % bound; } public static float wrap(float input, float bound) { - return (((input % bound) + bound) % bound); + return (input % bound + bound) % bound; } public static float tanh(float x) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java index 30b7ff76a0..e230d43415 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java @@ -13,7 +13,7 @@ package com.github.bartimaeusnek.bartworks.util; public final class MurmurHash3 { - public static final int fmix32(int h) { + public static int fmix32(int h) { h ^= h >>> 16; h *= 0x85ebca6b; h ^= h >>> 13; @@ -22,7 +22,7 @@ public final class MurmurHash3 { return h; } - public static final long fmix64(long k) { + public static long fmix64(long k) { k ^= k >>> 33; k *= 0xff51afd7ed558ccdL; k ^= k >>> 33; @@ -34,15 +34,15 @@ public final class MurmurHash3 { /** * Gets a long from a byte buffer in little endian byte order. */ - public static final long getLongLittleEndian(byte[] buf, int offset) { - return ((long) buf[offset + 7] << 56) // no mask needed - | ((buf[offset + 6] & 0xffL) << 48) - | ((buf[offset + 5] & 0xffL) << 40) - | ((buf[offset + 4] & 0xffL) << 32) - | ((buf[offset + 3] & 0xffL) << 24) - | ((buf[offset + 2] & 0xffL) << 16) - | ((buf[offset + 1] & 0xffL) << 8) - | ((buf[offset] & 0xffL)); // no shift needed + public static long getLongLittleEndian(byte[] buf, int offset) { + return (long) buf[offset + 7] << 56 // no mask needed + | (buf[offset + 6] & 0xffL) << 48 + | (buf[offset + 5] & 0xffL) << 40 + | (buf[offset + 4] & 0xffL) << 32 + | (buf[offset + 3] & 0xffL) << 24 + | (buf[offset + 2] & 0xffL) << 16 + | (buf[offset + 1] & 0xffL) << 8 + | buf[offset] & 0xffL; // no shift needed } /** @@ -58,15 +58,13 @@ public final class MurmurHash3 { for (int i = offset; i < roundedEnd; i += 4) { // little endian load order - int k1 = (data[i] & 0xff) | ((data[i + 1] & 0xff) << 8) - | ((data[i + 2] & 0xff) << 16) - | (data[i + 3] << 24); + int k1 = data[i] & 0xff | (data[i + 1] & 0xff) << 8 | (data[i + 2] & 0xff) << 16 | data[i + 3] << 24; k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 = k1 << 15 | k1 >>> 17; // ROTL32(k1,15); k1 *= c2; h1 ^= k1; - h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); + h1 = h1 << 13 | h1 >>> 19; // ROTL32(h1,13); h1 = h1 * 5 + 0xe6546b64; } @@ -81,9 +79,9 @@ public final class MurmurHash3 { k1 |= (data[roundedEnd + 1] & 0xff) << 8; // fallthrough case 1: - k1 |= (data[roundedEnd] & 0xff); + k1 |= data[roundedEnd] & 0xff; k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 = k1 << 15 | k1 >>> 17; // ROTL32(k1,15); k1 *= c2; h1 ^= k1; } @@ -121,7 +119,8 @@ public final class MurmurHash3 { int nBytes = 0; // length in UTF8 bytes while (pos < end) { - int code = data.charAt(pos++); + int code = data.charAt(pos); + pos++; if (code < 0x80) { k2 = code; bits = 8; @@ -137,20 +136,20 @@ public final class MurmurHash3 { * shift = 0; nBytes += 4; k1 = 0; } else { k1 |= code << shift; shift += 8; } continue; ***/ } else if (code < 0x800) { - k2 = (0xC0 | (code >> 6)) | ((0x80 | (code & 0x3F)) << 8); + k2 = 0xC0 | code >> 6 | (0x80 | code & 0x3F) << 8; bits = 16; } else if (code < 0xD800 || code > 0xDFFF || pos >= end) { // we check for pos>=end to encode an unpaired surrogate as 3 bytes. - k2 = (0xE0 | (code >> 12)) | ((0x80 | ((code >> 6) & 0x3F)) << 8) | ((0x80 | (code & 0x3F)) << 16); + k2 = 0xE0 | code >> 12 | (0x80 | code >> 6 & 0x3F) << 8 | (0x80 | code & 0x3F) << 16; bits = 24; } else { // surrogate pair // int utf32 = pos < end ? (int) data.charAt(pos++) : 0; - int utf32 = (int) data.charAt(pos++); - utf32 = ((code - 0xD7C0) << 10) + (utf32 & 0x3FF); - k2 = (0xff & (0xF0 | (utf32 >> 18))) | ((0x80 | ((utf32 >> 12) & 0x3F))) << 8 - | ((0x80 | ((utf32 >> 6) & 0x3F))) << 16 - | (0x80 | (utf32 & 0x3F)) << 24; + int utf32 = data.charAt(pos++); + utf32 = (code - 0xD7C0 << 10) + (utf32 & 0x3FF); + k2 = 0xff & (0xF0 | utf32 >> 18) | (0x80 | utf32 >> 12 & 0x3F) << 8 + | (0x80 | utf32 >> 6 & 0x3F) << 16 + | (0x80 | utf32 & 0x3F) << 24; bits = 32; } @@ -164,17 +163,17 @@ public final class MurmurHash3 { // mix after we have a complete word k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 = k1 << 15 | k1 >>> 17; // ROTL32(k1,15); k1 *= c2; h1 ^= k1; - h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); + h1 = h1 << 13 | h1 >>> 19; // ROTL32(h1,13); h1 = h1 * 5 + 0xe6546b64; shift -= 32; // unfortunately, java won't let you shift 32 bits off, so we need to check for 0 if (shift != 0) { - k1 = k2 >>> (bits - shift); // bits used == bits - newshift + k1 = k2 >>> bits - shift; // bits used == bits - newshift } else { k1 = 0; } @@ -186,7 +185,7 @@ public final class MurmurHash3 { if (shift > 0) { nBytes += shift >> 3; k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 = k1 << 15 | k1 >>> 17; // ROTL32(k1,15); k1 *= c2; h1 ^= k1; } @@ -253,13 +252,13 @@ public final class MurmurHash3 { case 10: k2 |= (key[roundedEnd + 9] & 0xffL) << 8; case 9: - k2 |= (key[roundedEnd + 8] & 0xffL); + k2 |= key[roundedEnd + 8] & 0xffL; k2 *= c2; k2 = Long.rotateLeft(k2, 33); k2 *= c1; h2 ^= k2; case 8: - k1 = ((long) key[roundedEnd + 7]) << 56; + k1 = (long) key[roundedEnd + 7] << 56; case 7: k1 |= (key[roundedEnd + 6] & 0xffL) << 48; case 6: @@ -273,7 +272,7 @@ public final class MurmurHash3 { case 2: k1 |= (key[roundedEnd + 1] & 0xffL) << 8; case 1: - k1 |= (key[roundedEnd] & 0xffL); + k1 |= key[roundedEnd] & 0xffL; k1 *= c1; k1 = Long.rotateLeft(k1, 31); k1 *= c2; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java index 3d0edb9bc0..8e2e69c495 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java @@ -161,52 +161,49 @@ public class SimplexNoise { // Simplex noise in 2D, 3D and 4D j2 = 1; k2 = 0; } // X Y Z order - else if (x0 >= z0) { - i1 = 1; - j1 = 0; - k1 = 0; - i2 = 1; - j2 = 0; - k2 = 1; - } // X Z Y order else { - i1 = 0; - j1 = 0; - k1 = 1; + if (x0 >= z0) { + i1 = 1; + j1 = 0; + k1 = 0; + } // X Z Y order + else { + i1 = 0; + j1 = 0; + k1 = 1; + } i2 = 1; j2 = 0; k2 = 1; } // Z X Y order - } else { // x0 extends HashMap { + private static final long serialVersionUID = 46345163103910175L; private V defaultValue; public NonNullWrappedHashMap(int initialCapacity, float loadFactor, V defaultValue) { @@ -43,7 +44,7 @@ public class NonNullWrappedHashMap extends HashMap { @Override public V get(Object key) { - return getOrDefault(key, defaultValue); + return this.getOrDefault(key, this.defaultValue); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java index 1a96a3fd7b..5490c4bdaf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java @@ -18,12 +18,11 @@ import java.util.HashSet; public class NonNullWrappedHashSet extends HashSet { - public NonNullWrappedHashSet() { - super(); - } + private static final long serialVersionUID = 8377161849188229010L; + + public NonNullWrappedHashSet() {} public NonNullWrappedHashSet(Collection c) { - super(); this.addAll(c); } @@ -35,11 +34,13 @@ public class NonNullWrappedHashSet extends HashSet { super(initialCapacity); } + @Override public boolean add(E e) { if (e != null) return super.add(e); return false; } + @Override public boolean addAll(Collection c) { boolean wasChanged = false; for (E element : c) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java index 8f34837f9a..5f7104f958 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java @@ -45,7 +45,7 @@ public class Pair implements Map.Entry { @Override public int hashCode() { return MurmurHash3.murmurhash3_x86_32( - ByteBuffer.allocate(8).putInt(pair[0].hashCode()).putInt(pair[1].hashCode()).array(), + ByteBuffer.allocate(8).putInt(this.pair[0].hashCode()).putInt(this.pair[1].hashCode()).array(), 0, 8, 31); @@ -53,18 +53,18 @@ public class Pair implements Map.Entry { @Override public A getKey() { - return (A) pair[0]; + return (A) this.pair[0]; } @Override public B getValue() { - return (B) pair[1]; + return (B) this.pair[1]; } @Override public B setValue(Object value) { - pair[1] = value; - return (B) pair[1]; + this.pair[1] = value; + return (B) this.pair[1]; } public Pair copyWithNewValue(B value) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java index 9f3df5d175..dc6863b562 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java @@ -101,10 +101,9 @@ public class RecipeFinderForParallel { tInputItem.stackSize -= tCompressedItemRecipe.get(tItem); i.remove(); break; - } else { - tCompressedItemRecipe.put(tItem, tCompressedItemRecipe.get(tItem) - tInputItem.stackSize); - tInputItem.stackSize = 0; } + tCompressedItemRecipe.put(tItem, tCompressedItemRecipe.get(tItem) - tInputItem.stackSize); + tInputItem.stackSize = 0; } } } else { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ResultWrongSievert.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ResultWrongSievert.java index 6acd417840..7d3af3eb35 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ResultWrongSievert.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ResultWrongSievert.java @@ -32,17 +32,14 @@ public class ResultWrongSievert implements CheckRecipeResult { @Override public String getDisplayString() { - switch (type) { - case EXACTLY: - return StatCollector.translateToLocalFormatted( - "GT5U.gui.text.wrong_sievert_exactly", - GT_Utility.formatNumbers(required)); - case MINIMUM: - return StatCollector.translateToLocalFormatted( - "GT5U.gui.text.wrong_sievert_min", - GT_Utility.formatNumbers(required)); - } - return ""; + return switch (this.type) { + case EXACTLY -> StatCollector.translateToLocalFormatted( + "GT5U.gui.text.wrong_sievert_exactly", + GT_Utility.formatNumbers(this.required)); + case MINIMUM -> StatCollector.translateToLocalFormatted( + "GT5U.gui.text.wrong_sievert_min", + GT_Utility.formatNumbers(this.required)); + }; } @Override @@ -52,22 +49,22 @@ public class ResultWrongSievert implements CheckRecipeResult { @Override public void encode(PacketBuffer buffer) { - buffer.writeVarIntToBuffer(required); - buffer.writeVarIntToBuffer(type.ordinal()); + buffer.writeVarIntToBuffer(this.required); + buffer.writeVarIntToBuffer(this.type.ordinal()); } @Override public void decode(PacketBuffer buffer) { - required = buffer.readVarIntFromBuffer(); - type = NeededSievertType.values()[buffer.readVarIntFromBuffer()]; + this.required = buffer.readVarIntFromBuffer(); + this.type = NeededSievertType.values()[buffer.readVarIntFromBuffer()]; } @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (o == null || this.getClass() != o.getClass()) return false; ResultWrongSievert that = (ResultWrongSievert) o; - return required == that.required; + return this.required == that.required; } /** diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java index 25da35d027..6cbd1793ef 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java @@ -23,37 +23,36 @@ import java.util.Spliterator; import org.apache.commons.lang3.NotImplementedException; -@SuppressWarnings("ALL") public class AccessPriorityList implements List, Deque, Set { transient int size = 0; transient AccessPriorityListNode head; transient AccessPriorityListNode tail; - public static AccessPriorityList create() { - return new AccessPriorityList(); + public static AccessPriorityList create() { + return new AccessPriorityList<>(); } public AccessPriorityList() {} @Override public void addFirst(E t) { - final AccessPriorityListNode first = head; + final AccessPriorityListNode first = this.head; final AccessPriorityListNode newNode = new AccessPriorityListNode<>(null, t, first); - head = newNode; - if (first == null) tail = newNode; + this.head = newNode; + if (first == null) this.tail = newNode; else first.setBefore(newNode); - size++; + this.size++; } @Override public void addLast(E t) { - final AccessPriorityListNode last = tail; + final AccessPriorityListNode last = this.tail; final AccessPriorityListNode newNode = new AccessPriorityListNode<>(last, t, null); - tail = newNode; - if (last == null) head = newNode; + this.tail = newNode; + if (last == null) this.head = newNode; else last.setNext(newNode); - size++; + this.size++; } @Override @@ -68,10 +67,10 @@ public class AccessPriorityList implements List, Deque, Set { @Override public E removeFirst() { - E first = head.getELEMENT(); - AccessPriorityListNode node = head; - head = node.getNext(); - head.setBefore(null); + E first = this.head.getELEMENT(); + AccessPriorityListNode node = this.head; + this.head = node.getNext(); + this.head.setBefore(null); node.destroy(); node = null; this.size--; @@ -80,10 +79,10 @@ public class AccessPriorityList implements List, Deque, Set { @Override public E removeLast() { - E last = tail.getELEMENT(); - AccessPriorityListNode node = tail; - tail = node.getBefore(); - tail.setNext(null); + E last = this.tail.getELEMENT(); + AccessPriorityListNode node = this.tail; + this.tail = node.getBefore(); + this.tail.setNext(null); node.destroy(); node = null; this.size--; @@ -102,22 +101,22 @@ public class AccessPriorityList implements List, Deque, Set { @Override public E getFirst() { - return peekFirst(); + return this.peekFirst(); } @Override public E getLast() { - return peekLast(); + return this.peekLast(); } @Override public E peekFirst() { - return head != null ? head.getELEMENT() : null; + return this.head != null ? this.head.getELEMENT() : null; } @Override public E peekLast() { - return tail != null ? tail.getELEMENT() : null; + return this.tail != null ? this.tail.getELEMENT() : null; } @Override @@ -132,12 +131,12 @@ public class AccessPriorityList implements List, Deque, Set { @Override public int size() { - return size; + return this.size; } @Override public boolean isEmpty() { - return size == 0; + return this.size == 0; } @Override @@ -147,42 +146,42 @@ public class AccessPriorityList implements List, Deque, Set { @Override public Iterator iterator() { - return new AccessPriorityListIterators.AccessPriorityListIterator<>(head); + return new AccessPriorityListIterators.AccessPriorityListIterator<>(this.head); } public Iterator> nodeIterator() { - return new AccessPriorityListIterators.AccessPriorityListNodeIterator<>(head); + return new AccessPriorityListIterators.AccessPriorityListNodeIterator<>(this.head); } @Override public Iterator descendingIterator() { - return new AccessPriorityListIterators.AccessPriorityListReverseIterator<>(tail); + return new AccessPriorityListIterators.AccessPriorityListReverseIterator<>(this.tail); } @Override public Object[] toArray() { - Object[] ret = new Object[size]; + Object[] ret = new Object[this.size]; int index = 0; - for (Iterator it = iterator(); it.hasNext(); index++) ret[index] = it.next(); + for (Iterator it = this.iterator(); it.hasNext(); index++) ret[index] = it.next(); return ret; } @Override public T[] toArray(T[] a) { - T[] ret = (T[]) new Object[size]; + T[] ret = (T[]) new Object[this.size]; int index = 0; - for (Iterator it = (Iterator) iterator(); it.hasNext(); index++) ret[index] = it.next(); + for (Iterator it = (Iterator) this.iterator(); it.hasNext(); index++) ret[index] = it.next(); return ret; } @Override public boolean add(E e) { - addLast(e); + this.addLast(e); return true; } private void moveNodeUp(AccessPriorityListNode node) { - if (node == head || node.getBefore() == null) return; + if (node == this.head || node.getBefore() == null) return; final AccessPriorityListNode before = node.getBefore(); final AccessPriorityListNode beforeBefore = before.getBefore(); final AccessPriorityListNode next = node.getNext(); @@ -193,7 +192,7 @@ public class AccessPriorityList implements List, Deque, Set { // <0,1,2> <1,2,3> N<0,3,4> <3,4,5> if (beforeBefore != null) beforeBefore.setNext(node); - else head = node; + else this.head = node; // <0,1,3> <1,2,3> N<0,3,4> <3,4,5> before.setBefore(node); @@ -203,7 +202,7 @@ public class AccessPriorityList implements List, Deque, Set { // <0,1,3> <3,2,4> N<0,3,4> <3,4,5> if (next != null) next.setBefore(before); - else tail = before; + else this.tail = before; // <0,1,3> N<0,3,4> <3,2,4> <2,4,5> node.setNext(before); @@ -211,15 +210,14 @@ public class AccessPriorityList implements List, Deque, Set { } AccessPriorityListNode getNode(int index) { - if (index <= (size / 2)) { - AccessPriorityListNode x = head; + if (index <= this.size / 2) { + AccessPriorityListNode x = this.head; for (int i = 0; i < index; i++) x = x.getNext(); return x; - } else { - AccessPriorityListNode x = tail; - for (int i = size - 1; i > index; i--) x = x.getBefore(); - return x; } + AccessPriorityListNode x = this.tail; + for (int i = this.size - 1; i > index; i--) x = x.getBefore(); + return x; } @Override @@ -228,7 +226,7 @@ public class AccessPriorityList implements List, Deque, Set { } private boolean isValidIndex(int index) { - if (index >= 0 && index < size) return true; + if (index >= 0 && index < this.size) return true; throw new ArrayIndexOutOfBoundsException("NOT A VAILD INDEX!"); } @@ -239,7 +237,7 @@ public class AccessPriorityList implements List, Deque, Set { @Override public E poll() { - return removeFirst(); + return this.removeFirst(); } @Override @@ -249,17 +247,17 @@ public class AccessPriorityList implements List, Deque, Set { @Override public E peek() { - return getFirst(); + return this.getFirst(); } @Override public void push(E e) { - addFirst(e); + this.addFirst(e); } @Override public E pop() { - return removeFirst(); + return this.removeFirst(); } @Override @@ -300,8 +298,8 @@ public class AccessPriorityList implements List, Deque, Set { @Override public void clear() { - if (tail != null) { - AccessPriorityListNode node = tail; + if (this.tail != null) { + AccessPriorityListNode node = this.tail; while (node.getBefore() != null) { node.setNext(null); node.setPriority(0L); @@ -315,33 +313,33 @@ public class AccessPriorityList implements List, Deque, Set { } public void addPrioToNode(AccessPriorityListNode node) { - addPrioToNode(node, 1L); + this.addPrioToNode(node, 1L); } public void addPrioToNode(AccessPriorityListNode node, long prio) { long current = node.getPriority(); - if (current == Long.MAX_VALUE || (current > 0 && prio > 0 && prio + current < 0)) + if (current == Long.MAX_VALUE || current > 0 && prio > 0 && prio + current < 0) node.setPriority(Long.MAX_VALUE); else node.setPriority(current + prio); while (node.getBefore() != null && node.getPriority() >= node.getBefore().getPriority()) { - moveNodeUp(node); + this.moveNodeUp(node); } } public void addPrioToNode(int index, long prio) { - if (!isValidIndex(index)) return; - AccessPriorityListNode node = getNode(index); - addPrioToNode(node, prio); + if (!this.isValidIndex(index)) return; + AccessPriorityListNode node = this.getNode(index); + this.addPrioToNode(node, prio); } public void addPrioToNode(int index) { - addPrioToNode(index, 1L); + this.addPrioToNode(index, 1L); } @Override public E get(int index) { - if (!isValidIndex(index)) return null; - AccessPriorityListNode node = getNode(index); + if (!this.isValidIndex(index)) return null; + AccessPriorityListNode node = this.getNode(index); return node.getELEMENT(); } @@ -372,7 +370,7 @@ public class AccessPriorityList implements List, Deque, Set { @Override public ListIterator listIterator() { - return new AccessPriorityListIterators.AccessPriorityListListIterator<>(head, tail, false); + return new AccessPriorityListIterators.AccessPriorityListListIterator<>(this.head, this.tail, false); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java index dc826caa6d..bf3883e69f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java @@ -32,51 +32,51 @@ public class AccessPriorityListIterators { boolean reverse) { this.head = head; this.tail = tail; - current = reverse ? tail : head; + this.current = reverse ? tail : head; this.reverse = reverse; } public AccessPriorityListListIterator(AccessPriorityList list, int index) { this.head = list.head; this.tail = list.tail; - current = list.getNode(index); - counter = index; + this.current = list.getNode(index); + this.counter = index; } @Override public boolean hasNext() { - return reverse ? head != current : tail != current; + return this.reverse ? this.head != this.current : this.tail != this.current; } @Override public E next() { - counter++; - E ret = current.getELEMENT(); - current = current.getNext(); + this.counter++; + E ret = this.current.getELEMENT(); + this.current = this.current.getNext(); return ret; } @Override public boolean hasPrevious() { - return !reverse ? head != current : tail != current; + return !this.reverse ? this.head != this.current : this.tail != this.current; } @Override public E previous() { - counter--; - E ret = current.getELEMENT(); - current = current.getBefore(); + this.counter--; + E ret = this.current.getELEMENT(); + this.current = this.current.getBefore(); return ret; } @Override public int nextIndex() { - return counter + 1; + return this.counter + 1; } @Override public int previousIndex() { - return counter - 1; + return this.counter - 1; } @Override @@ -106,13 +106,13 @@ public class AccessPriorityListIterators { @Override public boolean hasNext() { - return current != null; + return this.current != null; } @Override public E next() { - E ret = current.getELEMENT(); - current = current.getNext(); + E ret = this.current.getELEMENT(); + this.current = this.current.getNext(); return ret; } } @@ -128,13 +128,13 @@ public class AccessPriorityListIterators { @Override public boolean hasNext() { - return current != null; + return this.current != null; } @Override public E next() { - E ret = current.getELEMENT(); - current = current.getBefore(); + E ret = this.current.getELEMENT(); + this.current = this.current.getBefore(); return ret; } } @@ -150,13 +150,13 @@ public class AccessPriorityListIterators { @Override public boolean hasNext() { - return current != null; + return this.current != null; } @Override public AccessPriorityListNode next() { - AccessPriorityListNode ret = current; - current = current.getNext(); + AccessPriorityListNode ret = this.current; + this.current = this.current.getNext(); return ret; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java index 94bf309ef9..72b266917f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java @@ -15,7 +15,7 @@ package com.github.bartimaeusnek.bartworks.util.accessprioritylist; public class AccessPriorityListNode { - public static final AccessPriorityListNode EMPTY_NODE = new AccessPriorityListNode(null); + public static final AccessPriorityListNode EMPTY_NODE = new AccessPriorityListNode<>(null); private final E ELEMENT; private long priority = Long.MIN_VALUE; @@ -23,12 +23,12 @@ public class AccessPriorityListNode { private AccessPriorityListNode before; public AccessPriorityListNode(E element) { - ELEMENT = element; + this.ELEMENT = element; } public AccessPriorityListNode(AccessPriorityListNode before, E element, AccessPriorityListNode next) { this.ELEMENT = element; - connect(next, before); + this.connect(next, before); } public void connect(AccessPriorityListNode next, AccessPriorityListNode before) { @@ -37,11 +37,11 @@ public class AccessPriorityListNode { } public E getELEMENT() { - return ELEMENT; + return this.ELEMENT; } public long getPriority() { - return priority; + return this.priority; } public void setPriority(long priority) { @@ -49,7 +49,7 @@ public class AccessPriorityListNode { } public AccessPriorityListNode getNext() { - return next; + return this.next; } public void setNext(AccessPriorityListNode next) { @@ -57,7 +57,7 @@ public class AccessPriorityListNode { } public AccessPriorityListNode getBefore() { - return before; + return this.before; } public void setBefore(AccessPriorityListNode before) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java index d331b95e16..d797e68d8a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java @@ -20,20 +20,20 @@ import java.util.function.Function; public class FlowerSet implements Set { - public FlowerSet(int petals, Function comparerison) { + public FlowerSet(int petals, Function, Integer> comparerison) { this.petals = petals; this.comparerison = comparerison; } final int petals; - final Function comparerison; + final Function, Integer> comparerison; - public static FlowerSet createBase64(Function comparerison) { - return new FlowerSet(64, comparerison); + public static FlowerSet createBase64(Function, Integer> comparerison) { + return new FlowerSet<>(64, comparerison); } - public static FlowerSet createHexflower(Function comparerison) { - return new FlowerSet(16, comparerison); + public static FlowerSet createHexflower(Function, Integer> comparerison) { + return new FlowerSet<>(16, comparerison); } @Override @@ -103,39 +103,43 @@ public class FlowerSet implements Set { private final FlowerSet map; final V value; - final FlowerNode[] links; + final FlowerNode[] links; + @SuppressWarnings("unchecked") public FlowerNode(V value, FlowerSet map) { this.value = value; this.map = map; - links = new FlowerNode[map.petals]; + this.links = new FlowerNode[map.petals]; } private static final int DEPTH = 20480; - public void TryToSetSingleNode(FlowerNode node, FlowerNode toset, int place, int depth) { + public void TryToSetSingleNode(FlowerNode node, FlowerNode toset, int place, int depth) { if (depth > DEPTH) throw new IllegalStateException("Recursive Call went too deep."); if (node.links[place] == null) node.links[place] = toset; - else TryToSetSingleNode(node.links[place], toset, place, depth++); + else { + this.TryToSetSingleNode(node.links[place], toset, place, depth); + depth++; + } } - public void TryToSetSingleNode(FlowerNode node, FlowerNode toset, int place) { + public void TryToSetSingleNode(FlowerNode node, FlowerNode toset, int place) { if (node.links[place] == null) node.links[place] = toset; - else TryToSetSingleNode(node.links[place], toset, place, 0); + else this.TryToSetSingleNode(node.links[place], toset, place, 0); } @SafeVarargs public final void SetUpLinks(FlowerNode... links) { for (FlowerNode node : links) { - int place = map.comparerison.apply(node); - TryToSetSingleNode(this, node, place); + int place = this.map.comparerison.apply(node); + this.TryToSetSingleNode(this, node, place); } } } static class Functions { - public static Function HashBasedFunction() { + public static Function, Integer> HashBasedFunction() { return function -> function.hashCode() % function.map.petals; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 7f3239a7eb..3aaea22017 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -40,14 +40,16 @@ import cpw.mods.fml.common.event.FMLServerStartingEvent; modid = BartWorksCrossmod.MOD_ID, name = BartWorksCrossmod.NAME, version = BartWorksCrossmod.VERSION, - dependencies = "required-after:IC2; " + "required-after:gregtech; " - + "required-after:bartworks;" - + "after:GalacticraftMars; " - + "after:GalacticraftCore; " - + "after:Micdoodlecore; " - + "after:miscutils; " - + "after:EMT; " - + "after:tectech; ") + dependencies = """ + required-after:IC2;\ + required-after:gregtech;\ + required-after:bartworks;\ + after:GalacticraftMars;\ + after:GalacticraftCore;\ + after:Micdoodlecore;\ + after:miscutils;\ + after:EMT;\ + after:tectech;""") public class BartWorksCrossmod { public static final String NAME = "BartWorks Mod Additions"; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java index 9ead533077..a5f4dfa079 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java @@ -42,13 +42,12 @@ import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.registry.GameData; import cpw.mods.fml.common.registry.GameRegistry; -@SuppressWarnings({ "unchecked", "rawtypes", "unused" }) public class RadioHatchCompat { - private static Class intf; - private static Class materialClass; - private static Class enu; - private static Class materialStackClass; + private static Class intf; + private static Class materialClass; + private static Class enu; + private static Class materialStackClass; private static Field isRadioactive; private static Field f; @@ -96,8 +95,8 @@ public class RadioHatchCompat { Object[] arr = RadioHatchCompat.enu.getEnumConstants(); for (Object o : arr) { if (RadioHatchCompat.rod != null && RadioHatchCompat.longRod != null) break; - else if (o.toString().equalsIgnoreCase("ROD")) RadioHatchCompat.rod = o; - else if (o.toString().equalsIgnoreCase("RODLONG")) RadioHatchCompat.longRod = o; + if ("ROD".equalsIgnoreCase(o.toString())) RadioHatchCompat.rod = o; + else if ("RODLONG".equalsIgnoreCase(o.toString())) RadioHatchCompat.longRod = o; } } catch (NoSuchFieldException | ClassNotFoundException e) { @@ -105,11 +104,14 @@ public class RadioHatchCompat { } } + @SuppressWarnings("unchecked") public static void run() { DebugLog.log("Starting Generation of missing GT++ rods/longrods"); try { - Class rodclass = Class.forName("gtPlusPlus.core.item.base.rods.BaseItemRod"); - Class longrodclass = Class.forName("gtPlusPlus.core.item.base.rods.BaseItemRodLong"); + Class rodclass = (Class) Class + .forName("gtPlusPlus.core.item.base.rods.BaseItemRod"); + Class longrodclass = (Class) Class + .forName("gtPlusPlus.core.item.base.rods.BaseItemRodLong"); Constructor c1 = rodclass.getConstructor(RadioHatchCompat.materialClass); Constructor c2 = longrodclass.getConstructor(RadioHatchCompat.materialClass); Field cOwners = GameData.class.getDeclaredField("customOwners"); @@ -125,11 +127,11 @@ public class RadioHatchCompat { for (ModContainer container : Loader.instance().getModList()) { if (gtpp != null && bartworks != null) break; - else if (container.getModId().equalsIgnoreCase(BartWorksCrossmod.MOD_ID)) bartworks = container; + if (BartWorksCrossmod.MOD_ID.equalsIgnoreCase(container.getModId())) bartworks = container; else if (container.getModId().equalsIgnoreCase(GTPlusPlus.ID)) gtpp = container; } - for (Object mats : (Set) RadioHatchCompat.materialClass.getField("mMaterialMap").get(null)) { + for (Object mats : (Set) RadioHatchCompat.materialClass.getField("mMaterialMap").get(null)) { if (RadioHatchCompat.isRadioactive.getBoolean(mats)) { if (OreDictionary.getOres("stick" + RadioHatchCompat.unlocalizedName.get(mats)).isEmpty()) { @@ -194,19 +196,19 @@ public class RadioHatchCompat { byte amount; final Object m; - private static ArrayList getMaterialInput(Object GTPPMaterial) throws IllegalAccessException { + private static ArrayList getMaterialInput(Object GTPPMaterial) throws IllegalAccessException { Object ret = RadioHatchCompat.vMaterialInput.get(GTPPMaterial); - return ret instanceof ArrayList ? (ArrayList) ret : new ArrayList(); + return ret instanceof ArrayList ? (ArrayList) ret : new ArrayList<>(); } private static boolean isElement(Object GTPPMaterial) throws IllegalAccessException { return RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial).isEmpty(); } - private static List getElemets(Object GTPPMaterial) throws IllegalAccessException { - ArrayList elements = new ArrayList(); - Queue toCheck = new LinkedList(); - ArrayList materialInputs = RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial); + private static List getElemets(Object GTPPMaterial) throws IllegalAccessException { + ArrayList elements = new ArrayList<>(); + Queue toCheck = new LinkedList<>(); + ArrayList materialInputs = RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial); if (materialInputs.isEmpty()) return Collections.singletonList(GTPPMaterial); for (Object materialStack : materialInputs) { if (!RadioHatchCompat.GTPPRadAdapter.isElement(RadioHatchCompat.stackMaterial.get(materialStack))) @@ -222,10 +224,10 @@ public class RadioHatchCompat { private static Integer calulateRad(Object m) { int ret = 0; try { - List pureElements = RadioHatchCompat.GTPPRadAdapter.getElemets(m); + List pureElements = RadioHatchCompat.GTPPRadAdapter.getElemets(m); for (Object materialObj : pureElements) if (RadioHatchCompat.isRadioactive.getBoolean(materialObj)) - ret += ((int) RadioHatchCompat.radlevel.getByte(m) + RadioHatchCompat.GTPPRadAdapter - .clampToZero(RadioHatchCompat.protons.getLong(materialObj))); + ret += RadioHatchCompat.radlevel.getByte(m) + RadioHatchCompat.GTPPRadAdapter + .clampToZero(RadioHatchCompat.protons.getLong(materialObj)); else ret += RadioHatchCompat.radlevel.getByte(m); } catch (IllegalAccessException e) { e.printStackTrace(); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java index 3d1a265b80..1b55aee240 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java @@ -79,7 +79,7 @@ public class CLSCompat { long time = System.currentTimeMillis(); if (time - lastUpdate >= MINIMAL_UPDATE_INTERVAL) { try { - displayProgress.invoke(null, werkstoff.getDefaultName(), ((float) size) / 10000); + displayProgress.invoke(null, werkstoff.getDefaultName(), (float) size / 10000); } catch (IllegalAccessException | InvocationTargetException e) { e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index c6b4656953..b56d33a5dd 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -26,7 +26,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.Set; import java.util.function.Consumer; import java.util.function.Predicate; import java.util.stream.Collectors; @@ -66,16 +65,15 @@ import gregtech.common.GT_Worldgen_GT_Ore_Layer; import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; -@SuppressWarnings("ALL") public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_DrillerBase { private static ArrayListMultimap, Float>> extraDropsDimMap = ArrayListMultimap .create(); - private static FluidStack[] NOBLE_GASSES = new FluidStack[] { WerkstoffLoader.Neon.getFluidOrGas(1), + private static FluidStack[] NOBLE_GASSES = { WerkstoffLoader.Neon.getFluidOrGas(1), WerkstoffLoader.Krypton.getFluidOrGas(1), WerkstoffLoader.Xenon.getFluidOrGas(1), WerkstoffLoader.Oganesson.getFluidOrGas(1) }; - private HashMap, Float> dropmap = null; + private Map, Float> dropmap = null; private float totalWeight; private int multiplier = 1; @@ -106,24 +104,24 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri public GT_TileEntity_VoidMiner_Base(int aID, String aName, String aNameRegional, int tier) { super(aID, aName, aNameRegional); - TIER_MULTIPLIER = (byte) Math.max(tier, 1); + this.TIER_MULTIPLIER = (byte) Math.max(tier, 1); } @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setBoolean("mBlacklist", mBlacklist); + aNBT.setBoolean("mBlacklist", this.mBlacklist); } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - mBlacklist = aNBT.getBoolean("mBlacklist"); + this.mBlacklist = aNBT.getBoolean("mBlacklist"); } public GT_TileEntity_VoidMiner_Base(String aName, int tier) { super(aName); - TIER_MULTIPLIER = (byte) tier; + this.TIER_MULTIPLIER = (byte) tier; } @Override @@ -156,21 +154,20 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { // if the dropmap has never been initialised or if the dropmap is empty - if (dropmap == null || totalWeight == 0) calculateDropMap(); + if (this.dropmap == null || this.totalWeight == 0) this.calculateDropMap(); - if (totalWeight != 0.f) { - handleFluidConsumption(); - handleOutputs(); + if (this.totalWeight != 0.f) { + this.handleFluidConsumption(); + this.handleOutputs(); return true; - } else { - stopMachine(); - return false; } + this.stopMachine(); + return false; } @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { - String casings = getCasingBlockItem().get(0).getDisplayName(); + String casings = this.getCasingBlockItem().get(0).getDisplayName(); final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Miner").addInfo("Controller Block for the Void Miner " + GT_Values.VN[this.getMinTier()]) @@ -178,7 +175,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri .addInfo( "Can be supplied with 2L/s of Neon(x4), Krypton(x8), Xenon(x16) or Oganesson(x64) for higher outputs.") .addInfo( - "Will output " + (2 * TIER_MULTIPLIER) + "Will output " + 2 * this.TIER_MULTIPLIER + " Ores per Second depending on the Dimension it is build in") .addInfo("Put the Ore into the input bus to set the Whitelist/Blacklist") .addInfo("Use a screwdriver to toggle Whitelist/Blacklist") @@ -186,8 +183,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri .beginStructureBlock(3, 7, 3, false).addController("Front bottom") .addOtherStructurePart(casings, "form the 3x1x3 Base") .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") - .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") - .addEnergyHatch(VN[getMinTier()] + "+, Any base casing").addMaintenanceHatch("Any base casing") + .addOtherStructurePart( + this.getFrameMaterial().mName + " Frame Boxes", + "Each pillar's side and 1x3x1 on top") + .addEnergyHatch(VN[this.getMinTier()] + "+, Any base casing").addMaintenanceHatch("Any base casing") .addInputBus("Mining Pipes or Ores, optional, any base casing") .addInputHatch("Optional noble gas, any base casing").addOutputBus("Any base casing") .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); @@ -215,23 +214,17 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private Predicate makeOreLayerPredicate() { World world = this.getBaseMetaTileEntity().getWorld(); - switch (world.provider.dimensionId) { - case -1: - return gt_worldgen -> gt_worldgen.mNether; - case 0: - return gt_worldgen -> gt_worldgen.mOverworld; - case 1: - return gt_worldgen -> gt_worldgen.mEnd || gt_worldgen.mEndAsteroid; - case 7: - /* - * explicitely giving different dim numbers so it default to false in the config, keeping compat with - * the current worldgen config - */ - - return gt_worldgen -> gt_worldgen.isGenerationAllowed(world, 0, 7); - default: - throw new IllegalStateException(); - } + return switch (world.provider.dimensionId) { + case -1 -> gt_worldgen -> gt_worldgen.mNether; + case 0 -> gt_worldgen -> gt_worldgen.mOverworld; + case 1 -> gt_worldgen -> gt_worldgen.mEnd || gt_worldgen.mEndAsteroid; + /* + * explicitely giving different dim numbers so it default to false in the config, keeping compat with the + * current worldgen config + */ + case 7 -> gt_worldgen -> gt_worldgen.isGenerationAllowed(world, 0, 7); + default -> throw new IllegalStateException(); + }; } /** @@ -241,22 +234,17 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private Predicate makeSmallOresPredicate() { World world = this.getBaseMetaTileEntity().getWorld(); - switch (world.provider.dimensionId) { - case -1: - return gt_worldgen -> gt_worldgen.mNether; - case 0: - return gt_worldgen -> gt_worldgen.mOverworld; - case 1: - return gt_worldgen -> gt_worldgen.mEnd; - case 7: - /* - * explicitely giving different dim numbers so it default to false in the config, keeping compat with - * the current worldgen config - */ - return gt_worldgen -> gt_worldgen.isGenerationAllowed(world, 0, 7); - default: - throw new IllegalStateException(); - } + return switch (world.provider.dimensionId) { + case -1 -> gt_worldgen -> gt_worldgen.mNether; + case 0 -> gt_worldgen -> gt_worldgen.mOverworld; + case 1 -> gt_worldgen -> gt_worldgen.mEnd; + /* + * explicitely giving different dim numbers so it default to false in the config, keeping compat with the + * current worldgen config + */ + case 7 -> gt_worldgen -> gt_worldgen.isGenerationAllowed(world, 0, 7); + default -> throw new IllegalStateException(); + }; } /** @@ -267,15 +255,15 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @param value the non normalised weight */ private void addDrop(Pair key, float value) { - final ItemStack ore = getOreItemStack(key); + final ItemStack ore = this.getOreItemStack(key); if (ConfigHandler.voidMinerBlacklist.contains( String.format( "%s:%d", GameRegistry.findUniqueIdentifierFor(ore.getItem()).toString(), ore.getItemDamage()))) return; - if (!dropmap.containsKey(key)) dropmap.put(key, value); - else dropmap.put(key, dropmap.get(key) + value); + if (!this.dropmap.containsKey(key)) this.dropmap.put(key, value); + else this.dropmap.put(key, this.dropmap.get(key) + value); } /** @@ -286,10 +274,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private void getDropsVanillaVeins(Predicate oreLayerPredicate) { GT_Worldgen_GT_Ore_Layer.sList.stream() .filter(gt_worldgen -> gt_worldgen.mEnabled && oreLayerPredicate.test(gt_worldgen)).forEach(element -> { - addDrop(new Pair<>((int) element.mPrimaryMeta, false), (float) element.mWeight); - addDrop(new Pair<>((int) element.mSecondaryMeta, false), (float) element.mWeight); - addDrop(new Pair<>((int) element.mSporadicMeta, false), (element.mWeight / 8f)); - addDrop(new Pair<>((int) element.mBetweenMeta, false), (element.mWeight / 8f)); + this.addDrop(new Pair<>((int) element.mPrimaryMeta, false), element.mWeight); + this.addDrop(new Pair<>((int) element.mSecondaryMeta, false), element.mWeight); + this.addDrop(new Pair<>((int) element.mSporadicMeta, false), element.mWeight / 8f); + this.addDrop(new Pair<>((int) element.mBetweenMeta, false), element.mWeight / 8f); }); } @@ -301,7 +289,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private void getDropsVanillaSmallOres(Predicate smallOresPredicate) { GT_Worldgen_GT_Ore_SmallPieces.sList.stream() .filter(gt_worldgen -> gt_worldgen.mEnabled && smallOresPredicate.test(gt_worldgen)) - .forEach(element -> addDrop(new Pair<>((int) element.mMeta, false), (float) element.mAmount)); + .forEach(element -> this.addDrop(new Pair<>((int) element.mMeta, false), element.mAmount)); } /** @@ -310,26 +298,17 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @param finalDef ModDimensionDef corresponding to the target dim */ private void getDropsOreVeinsSpace(ModDimensionDef finalDef) { - Set space = GalacticGreg.oreVeinWorldgenList.stream() + GalacticGreg.oreVeinWorldgenList.stream() .filter( - gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof GT_Worldgen_GT_Ore_Layer_Space - && ((GT_Worldgen_GT_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) - .collect(Collectors.toSet()); - - space.forEach(element -> { - addDrop( - new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mPrimaryMeta, false), - (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); - addDrop( - new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSecondaryMeta, false), - (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); - addDrop( - new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSporadicMeta, false), - (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); - addDrop( - new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mBetweenMeta, false), - (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); - }); + gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof GT_Worldgen_GT_Ore_Layer_Space oreLayerSpace + && oreLayerSpace.isEnabledForDim(finalDef)) + .map(gt_worldgen -> (GT_Worldgen_GT_Ore_Layer_Space) gt_worldgen).forEach(element -> { + this.addDrop(new Pair<>((int) element.mPrimaryMeta, false), element.mWeight); + this.addDrop(new Pair<>((int) element.mSecondaryMeta, false), element.mWeight); + this.addDrop(new Pair<>((int) element.mSporadicMeta, false), element.mWeight / 8f); + this.addDrop(new Pair<>((int) element.mBetweenMeta, false), element.mWeight / 8f); + }); } /** @@ -338,15 +317,13 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @param finalDef ModDimensionDef corresponding to the target dim */ private void getDropsSmallOreSpace(ModDimensionDef finalDef) { - Set space = GalacticGreg.smallOreWorldgenList.stream().filter( - gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof GT_Worldgen_GT_Ore_SmallPieces_Space - && ((GT_Worldgen_GT_Ore_SmallPieces_Space) gt_worldgen).isEnabledForDim(finalDef)) - .collect(Collectors.toSet()); - - space.forEach( - element -> addDrop( - new Pair<>((int) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mMeta, false), - (float) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mAmount)); + GalacticGreg.smallOreWorldgenList.stream() + .filter( + gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof GT_Worldgen_GT_Ore_SmallPieces_Space oreSmallPiecesSpace + && oreSmallPiecesSpace.isEnabledForDim(finalDef)) + .map(gt_worldgen -> (GT_Worldgen_GT_Ore_SmallPieces_Space) gt_worldgen) + .forEach(element -> this.addDrop(new Pair<>((int) element.mMeta, false), element.mAmount)); } /** @@ -357,8 +334,8 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private Pair getOreDamage() { float curentWeight = 0.f; while (true) { - float randomnumber = XSTR.XSTR_INSTANCE.nextFloat() * totalWeight; - for (Map.Entry, Float> entry : dropmap.entrySet()) { + float randomnumber = XSTR.XSTR_INSTANCE.nextFloat() * this.totalWeight; + for (Map.Entry, Float> entry : this.dropmap.entrySet()) { curentWeight += entry.getValue(); if (randomnumber < curentWeight) return entry.getKey(); } @@ -375,7 +352,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri for (int i = 0; i < NOBLE_GASSES.length; i++) { FluidStack ng = NOBLE_GASSES[i]; if (ng.isFluidEqual(s)) { - multiplier = TIER_MULTIPLIER * (2 << (i == NOBLE_GASSES.length - 1 ? (i + 2) : (i + 1))); + this.multiplier = this.TIER_MULTIPLIER * (2 << (i == NOBLE_GASSES.length - 1 ? i + 2 : i + 1)); return s; } } @@ -404,8 +381,8 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * handler for the fluid consumption */ private void handleFluidConsumption() { - FluidStack storedNobleGas = getNobleGasInputAndSetMultiplier(); - if (storedNobleGas == null || !consumeNobleGas(storedNobleGas)) multiplier = TIER_MULTIPLIER; + FluidStack storedNobleGas = this.getNobleGasInputAndSetMultiplier(); + if (storedNobleGas == null || !this.consumeNobleGas(storedNobleGas)) this.multiplier = this.TIER_MULTIPLIER; } /** @@ -414,12 +391,12 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @param aID dim id of Ross128b or Ross128ba */ private void getDropMapRoss(int aID) { - Consumer addToList = makeAddToList(); + Consumer addToList = this.makeAddToList(); BW_OreLayer.sList.stream() .filter( gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_OreLayer && gt_worldgen.isGenerationAllowed(null, aID, 0)) - .collect(Collectors.toSet()).forEach(addToList); + .forEach(addToList); } /** @@ -431,8 +408,8 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri return element -> { List> data = element.getStacksRawData(); for (int i = 0; i < data.size(); i++) { - if (i < data.size() - 2) addDrop(data.get(i), (float) element.mWeight); - else addDrop(data.get(i), (element.mWeight / 8f)); + if (i < data.size() - 2) this.addDrop(data.get(i), element.mWeight); + else this.addDrop(data.get(i), element.mWeight / 8f); } }; } @@ -459,13 +436,12 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private void addOresVeinsBartworks(ModDimensionDef finalDef, Consumer addToList) { try { - Set space = GalacticGreg.oreVeinWorldgenList.stream() + GalacticGreg.oreVeinWorldgenList.stream() .filter( - gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_Worldgen_Ore_Layer_Space - && ((BW_Worldgen_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) - .collect(Collectors.toSet()); - - space.forEach(addToList); + gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof BW_Worldgen_Ore_Layer_Space oreLayerSpace + && oreLayerSpace.isEnabledForDim(finalDef)) + .map(gt_worldgen -> (BW_Worldgen_Ore_Layer_Space) gt_worldgen).forEach(addToList); } catch (NullPointerException ignored) {} } @@ -476,18 +452,14 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private void addSmallOresBartworks(ModDimensionDef finalDef) { try { - Set space = GalacticGreg.smallOreWorldgenList.stream() + GalacticGreg.smallOreWorldgenList.stream() .filter( - gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_Worldgen_Ore_SmallOre_Space - && ((BW_Worldgen_Ore_SmallOre_Space) gt_worldgen).isEnabledForDim(finalDef)) - .collect(Collectors.toSet()); - - space.forEach( - element -> addDrop( - new Pair<>( - ((BW_Worldgen_Ore_SmallOre_Space) element).mPrimaryMeta, - ((BW_Worldgen_Ore_SmallOre_Space) element).bwOres != 0), - (float) ((BW_Worldgen_Ore_SmallOre_Space) element).mDensity)); + gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof BW_Worldgen_Ore_SmallOre_Space smallOreSpace + && smallOreSpace.isEnabledForDim(finalDef)) + .map(gt_worldgen -> (BW_Worldgen_Ore_SmallOre_Space) gt_worldgen).forEach( + element -> this + .addDrop(new Pair<>(element.mPrimaryMeta, element.bwOres != 0), element.mDensity)); } catch (NullPointerException ignored) {} } @@ -498,15 +470,15 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private void handleExtraDrops(int id) { Optional.ofNullable(getExtraDropsDimMap().get(id)) - .ifPresent(e -> e.forEach(f -> addDrop(f.getKey(), f.getValue()))); + .ifPresent(e -> e.forEach(f -> this.addDrop(f.getKey(), f.getValue()))); } /** * Computes the total weight for normalisation */ private void calculateTotalWeight() { - totalWeight = 0.0f; - dropmap.values().forEach(f -> totalWeight += f); + this.totalWeight = 0.0f; + this.dropmap.values().forEach(f -> this.totalWeight += f); } /** @@ -516,25 +488,25 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private void handleModDimDef(int id) { // vanilla dims or TF - if ((id <= 1 && id >= -1) || id == 7) { - getDropsVanillaVeins(makeOreLayerPredicate()); - getDropsVanillaSmallOres(makeSmallOresPredicate()); + if (id <= 1 && id >= -1 || id == 7) { + this.getDropsVanillaVeins(this.makeOreLayerPredicate()); + this.getDropsVanillaSmallOres(this.makeSmallOresPredicate()); // ross dims } else if (id == ConfigHandler.ross128BID || id == ConfigHandler.ross128BAID) { - getDropMapRoss(id); + this.getDropMapRoss(id); // other space dims } else { - Optional.ofNullable(makeModDimDef()).ifPresent(def -> { + Optional.ofNullable(this.makeModDimDef()).ifPresent(def -> { // normal space dim - getDropsOreVeinsSpace(def); - getDropsSmallOreSpace(def); + this.getDropsOreVeinsSpace(def); + this.getDropsSmallOreSpace(def); // BW space dim - Consumer addToList = makeAddToList(); - addOresVeinsBartworks(def, addToList); - addSmallOresBartworks(def); + Consumer addToList = this.makeAddToList(); + this.addOresVeinsBartworks(def, addToList); + this.addSmallOresBartworks(def); }); } } @@ -544,24 +516,23 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * totalweight for normalisation */ private void calculateDropMap() { - dropmap = new HashMap<>(); + this.dropmap = new HashMap<>(); int id = this.getBaseMetaTileEntity().getWorld().provider.dimensionId; - handleModDimDef(id); - handleExtraDrops(id); - calculateTotalWeight(); + this.handleModDimDef(id); + this.handleExtraDrops(id); + this.calculateTotalWeight(); } /** * Output logic of the VM */ private void handleOutputs() { - Pair stats = getOreDamage(); final List inputOres = this.getStoredInputs().stream().filter(GT_Utility::isOre) .collect(Collectors.toList()); - final ItemStack output = getOreItemStack(stats); + final ItemStack output = this.getOreItemStack(this.getOreDamage()); if (inputOres.size() == 0 - || (mBlacklist && inputOres.stream().allMatch(is -> !GT_Utility.areStacksEqual(is, output))) - || (!mBlacklist && inputOres.stream().anyMatch(is -> GT_Utility.areStacksEqual(is, output)))) + || this.mBlacklist && inputOres.stream().allMatch(is -> !GT_Utility.areStacksEqual(is, output)) + || !this.mBlacklist && inputOres.stream().anyMatch(is -> GT_Utility.areStacksEqual(is, output))) this.addOutput(output); this.updateSlots(); } @@ -576,13 +547,13 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private ItemStack getOreItemStack(Pair stats) { return new ItemStack( stats.getValue() ? WerkstoffLoader.BWOres : GregTech_API.sBlockOres1, - multiplier, + this.multiplier, stats.getKey()); } @Override public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - mBlacklist = !mBlacklist; - GT_Utility.sendChatToPlayer(aPlayer, "Mode: " + (mBlacklist ? "Blacklist" : "Whitelist")); + this.mBlacklist = !this.mBlacklist; + GT_Utility.sendChatToPlayer(aPlayer, "Mode: " + (this.mBlacklist ? "Blacklist" : "Whitelist")); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java index c502437fc7..c9cff6cd9e 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java @@ -25,18 +25,10 @@ import micdoodle8.mods.galacticraft.planets.mars.entities.EntityLandingBalloons; public class PlanetsHelperClass { public static EntityLanderBase getLanderType(EntityPlayerMP player) { - EntityLanderBase elb; - switch (ConfigHandler.landerType) { - case 1: - elb = new EntityLander(player); - break; - case 2: - elb = new EntityLandingBalloons(player); - break; - default: - elb = new EntityEntryPod(player); - break; - } - return elb; + return switch (ConfigHandler.landerType) { + case 1 -> new EntityLander(player); + case 2 -> new EntityLandingBalloons(player); + default -> new EntityEntryPod(player); + }; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java index 4031e2491b..b6fa575b5c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java @@ -57,7 +57,7 @@ public class UniversalTeleportType implements ITeleportType { @Override public void onSpaceDimensionChanged(World newWorld, EntityPlayerMP player, boolean ridingAutoRocket) { if (ridingAutoRocket) return; - if ((player != null) && (GCPlayerStats.get(player).teleportCooldown <= 0)) { + if (player != null && GCPlayerStats.get(player).teleportCooldown <= 0) { if (player.capabilities.isFlying) { player.capabilities.isFlying = false; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java index e7693159de..77877011cd 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java @@ -32,7 +32,6 @@ import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; -@SuppressWarnings({ "unused", "RedundantSuppression" }) public final class BWAtmosphereManager { private static final Map COEFFICIENT_MAP = new HashMap<>(); @@ -82,7 +81,7 @@ public final class BWAtmosphereManager { } private static boolean addGCGasToWorld(int worldID, IAtmosphericGas gas, int aNumber, int aMaxNumber) { - if (gas.equals(IAtmosphericGas.CO2)) { + if (IAtmosphericGas.CO2.equals(gas)) { BWAtmosphereManager.addGasToWorld( worldID, Materials.CarbonDioxide, diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index 02acd6c031..c84ef4528b 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -25,6 +25,7 @@ import net.minecraft.entity.EnumCreatureType; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.ChunkProviderGenerate; @@ -59,13 +60,14 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { } @Override - @SuppressWarnings("rawtypes") - public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) { + public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, + int p_73155_4_) { return null; } + @Override public Chunk provideChunk(int p_73154_1_, int p_73154_2_) { - this.rand.setSeed((long) p_73154_1_ * 341873128712L + (long) p_73154_2_ * 132897987541L); + this.rand.setSeed(p_73154_1_ * 341873128712L + p_73154_2_ * 132897987541L); Block[] ablock = new Block[65536]; byte[] abyte = new byte[65536]; this.func_147424_a(p_73154_1_, p_73154_2_, ablock); @@ -111,7 +113,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { if (p_73153_2_ % 4 == 0 || p_73153_3_ % 4 == 0) { long i1 = this.rand.nextLong() / 2L * 2L + 1L; long j1 = this.rand.nextLong() / 2L * 2L + 1L; - this.rand.setSeed((long) p_73153_2_ * i1 + (long) p_73153_3_ * j1 ^ this.worldObj.getSeed()); + this.rand.setSeed(p_73153_2_ * i1 + p_73153_3_ * j1 ^ this.worldObj.getSeed()); } MinecraftForge.EVENT_BUS @@ -126,8 +128,8 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { y1 = this.rand.nextInt(256); z1 = l + this.rand.nextInt(16) + 8; int rni = this.rand.nextInt(8); - if (rni == 0) (new WorldGenLakes(Blocks.ice)).generate(this.worldObj, this.rand, x1, y1, z1); - else if (rni == 4) (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, x1, y1, z1); + if (rni == 0) new WorldGenLakes(Blocks.ice).generate(this.worldObj, this.rand, x1, y1, z1); + else if (rni == 4) new WorldGenLakes(Blocks.water).generate(this.worldObj, this.rand, x1, y1, z1); } if (biomegenbase != BiomeGenBase.ocean && biomegenbase != BiomeGenBase.deepOcean && biomegenbase != BiomeGenBase.river diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java index a0eaf06d46..7a0c9a743c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java @@ -33,6 +33,7 @@ public class WorldProviderRoss128b extends AbstractWorldProviderSpace { return true; } + @Override @SideOnly(Side.CLIENT) public Vec3 getFogColor(float cy, float noidea) { float angle = MathHelper.cos(cy * (float) Math.PI * 2.0F) * 2.0F + 0.5F; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java index 51b19bf5c1..12668f59e1 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java @@ -48,8 +48,9 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { this.worldObj = world; } + @Override public Chunk provideChunk(int cx, int cz) { - this.rand.setSeed((long) cx * 341873128712L + (long) cz * 132897987541L); + this.rand.setSeed(cx * 341873128712L + cz * 132897987541L); Block[] ids = new Block[65536]; byte[] meta = new byte[65536]; Arrays.fill(ids, Blocks.air); @@ -64,6 +65,7 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { return Chunk; } + @Override public void decoratePlanet(World par1World, Random par2Random, int par3, int par4) {} @Override @@ -83,17 +85,18 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { final BartsNoise noiseGen2 = new BartsNoise(2, 0.01F, 1D, System.nanoTime()); final BartsNoise noiseGen3 = new BartsNoise(2, 0.002F, 1D, System.nanoTime()); + @Override public void generateTerrain(int chunkX, int chunkZ, Block[] idArray, byte[] metaArray) { for (int x = 0; x < 16; ++x) { for (int z = 0; z < 16; ++z) { - double d = noiseGen.getNoise(x + chunkX * 16, z + chunkZ * 16); - double d2 = noiseGen2.getNoise(x + chunkX * 16, z + chunkZ * 16); - double d3 = noiseGen3.getCosNoise(x + chunkX * 16, z + chunkZ * 16); + double d = this.noiseGen.getNoise(x + chunkX * 16, z + chunkZ * 16); + double d2 = this.noiseGen2.getNoise(x + chunkX * 16, z + chunkZ * 16); + double d3 = this.noiseGen3.getCosNoise(x + chunkX * 16, z + chunkZ * 16); double yDev = d * 4 + d2 * 2 + d3; for (int y = 0; y < 128; ++y) { - if ((double) y < 60.0D + yDev) { + if (y < 60.0D + yDev) { idArray[this.getIndex(x, y, z)] = this.lowerBlockID; int var10001 = this.getIndex(x, y, z); metaArray[var10001] = 4; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index a69222d2b9..171d149986 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -57,7 +57,7 @@ public class Ross128SolarSystem { Ross128SolarSystem.Ross128System.setMainStar(Ross128SolarSystem.Ross128); Ross128SolarSystem.Ross128b = new Planet("Ross128b").setParentSolarSystem(Ross128SolarSystem.Ross128System); - Ross128SolarSystem.Ross128b.setRingColorRGB((0x9F) / 255f, (0x8A) / 255f, (0x79) / 255f); + Ross128SolarSystem.Ross128b.setRingColorRGB(0x9F / 255f, 0x8A / 255f, 0x79 / 255f); Ross128SolarSystem.Ross128b.setPhaseShift(1.25F); Ross128SolarSystem.Ross128b.setBodyIcon( new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128b.png")); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java deleted file mode 100644 index fa0dedaaa7..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.galaxySpace.tileEntity; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.util.ForgeDirection; - -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import micdoodle8.mods.galacticraft.core.GalacticraftCore; - -public class DysonSwarmSunReplacement extends MetaTileEntity { - - private static boolean wasBuild; - private static long dysonObjs; - private static long swarmControllers; - - public DysonSwarmSunReplacement(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) { - super(aID, aBasicName, aRegionalName, aInvSlotCount); - } - - private DysonSwarmSunReplacement(String aName, int aInvSlotCount) { - super(aName, aInvSlotCount); - } - - public void toggle() { - ResourceLocation resourceLocation = wasBuild - ? new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/sun.png") - : new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/moon.png"); - GalacticraftCore.solarSystemSol.getMainStar().setBodyIcon(resourceLocation); - wasBuild = !wasBuild; - - } - - @Override - public byte getTileEntityBaseType() { - return 2; - } - - @Override - public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { - ++swarmControllers; - } - - @Override - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - toggle(); - return super.onRightclick(aBaseMetaTileEntity, aPlayer); - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new DysonSwarmSunReplacement(this.mName, this.mInventory.length); - } - - @Override - public void saveNBTData(NBTTagCompound nbtTagCompound) { - nbtTagCompound.setLong("dysonObjs", dysonObjs); - } - - @Override - public void loadNBTData(NBTTagCompound nbtTagCompound) { - dysonObjs = Math.max(dysonObjs, nbtTagCompound.getLong("dysonObjs")); - } - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - aBaseMetaTileEntity - .increaseStoredEnergyUnits((DysonSwarmSunReplacement.dysonObjs * 10000) / swarmControllers, true); - } - - public boolean isEnetOutput() { - return true; - } - - @Override - public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, ForgeDirection side, - ItemStack itemStack) { - return false; - } - - @Override - public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, ForgeDirection side, - ItemStack itemStack) { - return false; - } - - @Override - public String[] getDescription() { - return new String[0]; - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean b3, boolean b4) { - return new ITexture[0]; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java deleted file mode 100644 index 1bdcc942ba..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.galaxySpace.tileEntity; - -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; - -public class GalaxySpaceProxy { - - private GalaxySpaceProxy() {} - - public static void postInit(FMLPostInitializationEvent e) {} - - public static void preInit(FMLPreInitializationEvent e) {} - - private static void serverpreInit(FMLPreInitializationEvent e) {} - - private static void clientpreInit(FMLPreInitializationEvent e) {} - - private static void commonpreInit(FMLPreInitializationEvent e) {} - - public static void init(FMLInitializationEvent e) {} - - private static void serverInit(FMLInitializationEvent e) {} - - private static void clientInit(FMLInitializationEvent e) {} - - private static void commonInit(FMLInitializationEvent e) {} - - private static void serverPostInit(FMLPostInitializationEvent e) {} - - private static void clientPostInit(FMLPostInitializationEvent e) {} - - private static void commonPostInit(FMLPostInitializationEvent e) {} -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java index 997eb597e7..469c23b065 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java @@ -57,8 +57,8 @@ public class TileEntity_GTDataServer extends TileEntity @Callback public Object[] listData(Context context, Arguments args) { Set ret = new HashSet<>(); - for (Map.Entry entry : OrbDataBase.entrySet()) { - ret.add((entry.getValue().getId() + Long.MAX_VALUE) + ". " + entry.getValue().getmDataTitle()); + for (Map.Entry entry : this.OrbDataBase.entrySet()) { + ret.add(entry.getValue().getId() + Long.MAX_VALUE + ". " + entry.getValue().getmDataTitle()); } return ret.toArray(new String[0]); } @@ -78,41 +78,39 @@ public class TileEntity_GTDataServer extends TileEntity if (this.TickTimer++ % 20 != 0) return; if (this.isServerSide()) { - if (GT_Utility.areStacksEqual(this.mItems[0], ItemList.Tool_DataOrb.get(1))) { - if (this.mItems[0].hasTagCompound()) { - if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) { - this.OrbDataBase.put( - GT_NBT_DataBase.getMaxID(), - new GT_NBT_DataBase( - Behaviour_DataOrb.getDataName(this.mItems[0]), - Behaviour_DataOrb.getDataTitle(this.mItems[0]), - this.mItems[0].getTagCompound())); - } else { - long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()); - this.OrbDataBase.put(id, GT_NBT_DataBase.getGTTagFromId(id)); - } + if (GT_Utility.areStacksEqual(this.mItems[0], ItemList.Tool_DataOrb.get(1)) + && this.mItems[0].hasTagCompound()) { + if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) { + this.OrbDataBase.put( + GT_NBT_DataBase.getMaxID(), + new GT_NBT_DataBase( + Behaviour_DataOrb.getDataName(this.mItems[0]), + Behaviour_DataOrb.getDataTitle(this.mItems[0]), + this.mItems[0].getTagCompound())); + } else { + long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()); + this.OrbDataBase.put(id, GT_NBT_DataBase.getGTTagFromId(id)); } } - if (GT_Utility.areStacksEqual(this.mItems[0], ItemList.Tool_DataStick.get(1))) { - if (this.mItems[0].hasTagCompound()) { - - String bookTitle = GT_Utility.ItemNBT.getBookTitle(this.mItems[0]); - String punchcardData = GT_Utility.ItemNBT.getPunchCardData(this.mItems[0]); - short mapID = GT_Utility.ItemNBT.getMapID(this.mItems[0]); - byte data = (byte) (bookTitle.isEmpty() ? punchcardData.isEmpty() ? mapID != -1 ? 3 : -1 : 2 : 1); - - String title = data == 1 ? bookTitle - : data == 2 ? punchcardData : data == 3 ? "" + mapID : "Custom Data"; - String name = data == 1 ? "eBook" - : data == 2 ? "Punch Card Data" : data == 3 ? "Map Data" : "Custom Data"; - if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) { - this.OrbDataBase.put( - GT_NBT_DataBase.getMaxID(), - new GT_NBT_DataBase(name, title, this.mItems[0].getTagCompound())); - } else { - long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()); - this.OrbDataBase.put(id, GT_NBT_DataBase.getGTTagFromId(id)); - } + if (GT_Utility.areStacksEqual(this.mItems[0], ItemList.Tool_DataStick.get(1)) + && this.mItems[0].hasTagCompound()) { + + String bookTitle = GT_Utility.ItemNBT.getBookTitle(this.mItems[0]); + String punchcardData = GT_Utility.ItemNBT.getPunchCardData(this.mItems[0]); + short mapID = GT_Utility.ItemNBT.getMapID(this.mItems[0]); + byte data = (byte) (bookTitle.isEmpty() ? punchcardData.isEmpty() ? mapID != -1 ? 3 : -1 : 2 : 1); + + String title = data == 1 ? bookTitle + : data == 2 ? punchcardData : data == 3 ? "" + mapID : "Custom Data"; + String name = data == 1 ? "eBook" + : data == 2 ? "Punch Card Data" : data == 3 ? "Map Data" : "Custom Data"; + if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) { + this.OrbDataBase.put( + GT_NBT_DataBase.getMaxID(), + new GT_NBT_DataBase(name, title, this.mItems[0].getTagCompound())); + } else { + long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()); + this.OrbDataBase.put(id, GT_NBT_DataBase.getGTTagFromId(id)); } } } @@ -147,24 +145,24 @@ public class TileEntity_GTDataServer extends TileEntity } @Override - public ItemStack getStackInSlot(int p_70301_1_) { - return p_70301_1_ == 0 ? this.mItems[0] : this.mItems[1]; + public ItemStack getStackInSlot(int slotIn) { + return slotIn == 0 ? this.mItems[0] : this.mItems[1]; } @Override - public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + public ItemStack decrStackSize(int index, int count) { return null; } @Override - public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + public ItemStack getStackInSlotOnClosing(int index) { return null; } @Override - public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { - if (p_70299_1_ > 1 || p_70299_1_ < 0) return; - this.mItems[p_70299_1_] = p_70299_2_; + public void setInventorySlotContents(int index, ItemStack stack) { + if (index > 1 || index < 0) return; + this.mItems[index] = stack; } @Override @@ -183,7 +181,7 @@ public class TileEntity_GTDataServer extends TileEntity } @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + public boolean isUseableByPlayer(EntityPlayer player) { return true; } @@ -194,7 +192,7 @@ public class TileEntity_GTDataServer extends TileEntity public void closeInventory() {} @Override - public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - return p_94041_1_ == 0; + public boolean isItemValidForSlot(int index, ItemStack stack) { + return index == 0; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java index 360ccff458..35315b677c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java @@ -25,7 +25,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -@SuppressWarnings({ "unused", "RedundantSuppression" }) public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { ArrayList mTTEnergyHatches = new ArrayList<>(); @@ -39,29 +38,28 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { super(aName); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new TT_TileEntity_ManualTrafo(this.mName); } + @Override public boolean addEnergyOutput(long aEU) { if (aEU <= 0L) { return true; - } else { - return mTTDynamos.size() > 0 - || this.mDynamoHatches.size() > 0 && this.addEnergyOutputMultipleDynamos(aEU, true); } + return this.mTTDynamos.size() > 0 + || this.mDynamoHatches.size() > 0 && this.addEnergyOutputMultipleDynamos(aEU, true); } + @Override public boolean addEnergyOutputMultipleDynamos(long aEU, boolean aAllowMixedVoltageDynamos) { int injected = 0; long totalOutput = 0L; long aFirstVoltageFound = -1L; boolean aFoundMixedDynamos = false; - Iterator var10 = this.mDynamoHatches.iterator(); - long aVoltage; - while (var10.hasNext()) { - GT_MetaTileEntity_Hatch_Dynamo aDynamo = var10.next(); + for (GT_MetaTileEntity_Hatch_Dynamo aDynamo : this.mDynamoHatches) { if (aDynamo == null) { return false; } @@ -82,38 +80,38 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { if (totalOutput < aEU || aFoundMixedDynamos && !aAllowMixedVoltageDynamos) { this.explodeMultiblock(); return false; - } else { - Iterator var17 = this.mDynamoHatches.iterator(); + } + Iterator var17 = this.mDynamoHatches.iterator(); - while (true) { - GT_MetaTileEntity_Hatch_Dynamo aDynamo; - do { - if (!var17.hasNext()) { - return injected > 0; - } + while (true) { + GT_MetaTileEntity_Hatch_Dynamo aDynamo; + do { + if (!var17.hasNext()) { + return injected > 0; + } - aDynamo = var17.next(); - } while (!isValidMetaTileEntity(aDynamo)); + aDynamo = var17.next(); + } while (!isValidMetaTileEntity(aDynamo)); - long leftToInject = aEU - (long) injected; - aVoltage = aDynamo.maxEUOutput(); - int aAmpsToInject = (int) (leftToInject / aVoltage); - int aRemainder = (int) (leftToInject - (long) aAmpsToInject * aVoltage); - int ampsOnCurrentHatch = (int) Math.min(aDynamo.maxAmperesOut(), aAmpsToInject); + long leftToInject = aEU - injected; + aVoltage = aDynamo.maxEUOutput(); + int aAmpsToInject = (int) (leftToInject / aVoltage); + int aRemainder = (int) (leftToInject - aAmpsToInject * aVoltage); + int ampsOnCurrentHatch = (int) Math.min(aDynamo.maxAmperesOut(), aAmpsToInject); - for (int i = 0; i < ampsOnCurrentHatch; ++i) { - aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage, false); - } + for (int i = 0; i < ampsOnCurrentHatch; ++i) { + aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage, false); + } - injected = (int) ((long) injected + aVoltage * (long) ampsOnCurrentHatch); - if (aRemainder > 0 && (long) ampsOnCurrentHatch < aDynamo.maxAmperesOut()) { - aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aRemainder, false); - injected += aRemainder; - } + injected = (int) (injected + aVoltage * ampsOnCurrentHatch); + if (aRemainder > 0 && ampsOnCurrentHatch < aDynamo.maxAmperesOut()) { + aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aRemainder, false); + injected += aRemainder; } } } + @Override public boolean drainEnergyInput(long aEU) { if (aEU > 0L) { { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java index 2dd621b2b8..9166424a43 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java @@ -32,7 +32,6 @@ import gregtech.api.util.GT_OreDictUnificator; public class TecTechResearchLoader { - @SuppressWarnings("deprecation") public static void runResearches() { Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null ? FluidRegistry.getFluid("molten.indalloy140") diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java index 0307cbf171..ae19e8d635 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java @@ -52,7 +52,7 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel } default long getTotalPower() { - return this.getAMPERES() * Math.max(this.maxEUOutput(), this.maxEUInput()) - (this.getAMPERES() / 20); + return this.getAMPERES() * Math.max(this.maxEUOutput(), this.maxEUInput()) - this.getAMPERES() / 20; } default void moveAroundLowPower(IGregTechTileEntity aBaseMetaTileEntity) { @@ -73,42 +73,44 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel return; } - if (aMetaTileEntity instanceof LowPowerLaser && ((LowPowerLaser) aMetaTileEntity).isReceiver() + if (aMetaTileEntity instanceof LowPowerLaser lowPowerLaser && lowPowerLaser.isReceiver() && opposite == tGTTileEntity.getFrontFacing()) { - if (this.maxEUOutput() > ((LowPowerLaser) aMetaTileEntity).maxEUInput() - || this.getAMPERES() > ((LowPowerLaser) aMetaTileEntity).getAMPERES()) { + if (this.maxEUOutput() > lowPowerLaser.maxEUInput() + || this.getAMPERES() > lowPowerLaser.getAMPERES()) { aMetaTileEntity.doExplosion(this.maxEUOutput()); this.setEUVar(aBaseMetaTileEntity.getStoredEU() - this.maxEUOutput()); return; } - if (this.maxEUOutput() == ((LowPowerLaser) aMetaTileEntity).maxEUInput()) { + if (this.maxEUOutput() == lowPowerLaser.maxEUInput()) { long diff = Math.min( this.getAMPERES() * 20L * this.maxEUOutput(), Math.min( - ((LowPowerLaser) aMetaTileEntity).maxEUStore() + lowPowerLaser.maxEUStore() - aMetaTileEntity.getBaseMetaTileEntity().getStoredEU(), aBaseMetaTileEntity.getStoredEU())); this.setEUVar(aBaseMetaTileEntity.getStoredEU() - diff); - ((LowPowerLaser) aMetaTileEntity) - .setEUVar(aMetaTileEntity.getBaseMetaTileEntity().getStoredEU() + diff); + lowPowerLaser.setEUVar(aMetaTileEntity.getBaseMetaTileEntity().getStoredEU() + diff); } return; } - if ((!(aMetaTileEntity instanceof LowPowerLaser) || !((LowPowerLaser) aMetaTileEntity).isTunnel()) + if ((!(aMetaTileEntity instanceof LowPowerLaser lowPowerLaser) || !lowPowerLaser.isTunnel()) && !(aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy)) { return; } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy) { - if (((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).connectionCount < 2) { + if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy tePipeEnergy) { + if (tePipeEnergy.connectionCount < 2) { return; } + tePipeEnergy.markUsed(); + return; + } - ((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).markUsed(); - } else if (aMetaTileEntity instanceof LowPowerLaser && ((LowPowerLaser) aMetaTileEntity).isTunnel()) { - if (!((LowPowerLaser) aMetaTileEntity).isConnectedCorrectly(front)) return; + if (aMetaTileEntity instanceof LowPowerLaser lowPowerLaser && lowPowerLaser.isTunnel() + && !lowPowerLaser.isConnectedCorrectly(front)) { + return; } } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java index b65b72c525..e1f69d8c05 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java @@ -56,7 +56,7 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_ @Override public long getAMPERES() { - return AMPERES; + return this.AMPERES; } @Override @@ -93,12 +93,12 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_ @Override public void saveNBTData(NBTTagCompound nbtTagCompound) { - Optional.ofNullable(nbtTagCompound).ifPresent(tag -> tag.setLong("AMPERES", AMPERES)); + Optional.ofNullable(nbtTagCompound).ifPresent(tag -> tag.setLong("AMPERES", this.AMPERES)); } @Override public void loadNBTData(NBTTagCompound nbtTagCompound) { - Optional.ofNullable(nbtTagCompound).ifPresent(tag -> AMPERES = tag.getLong("AMPERES")); + Optional.ofNullable(nbtTagCompound).ifPresent(tag -> this.AMPERES = tag.getLong("AMPERES")); } @Override @@ -148,6 +148,6 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_ @Override public long maxEUStore() { - return 512L + GT_Values.V[this.mTier + 1] * 24L * AMPERES; + return 512L + GT_Values.V[this.mTier + 1] * 24L * this.AMPERES; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java index 1fccb4dd28..d2e1c3aa52 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java @@ -53,12 +53,12 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase @Override public long maxAmperesOut() { - return !this.getBaseMetaTileEntity().isAllowedToWork() ? AMPERES : 0; + return !this.getBaseMetaTileEntity().isAllowedToWork() ? this.AMPERES : 0; } @Override public long maxAmperesIn() { - return this.getBaseMetaTileEntity().isAllowedToWork() ? AMPERES + (AMPERES / 4) : 0; + return this.getBaseMetaTileEntity().isAllowedToWork() ? this.AMPERES + this.AMPERES / 4 : 0; } @Override @@ -68,7 +68,7 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase @Override public String getAlternativeModeText() { - return isReceiver() ? "Set to receiving mode" : "Set to sending mode"; + return this.isReceiver() ? "Set to receiving mode" : "Set to sending mode"; } @Override @@ -101,7 +101,7 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase if (aBaseMetaTileEntity.isServerSide()) { aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork()); - byte Tick = (byte) ((int) (aTick % 20L)); + byte Tick = (byte) (int) (aTick % 20L); if (16 == Tick) { if (aBaseMetaTileEntity.getStoredEU() > 0L) { this.setEUVar(aBaseMetaTileEntity.getStoredEU() - this.AMPERES); @@ -109,10 +109,10 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase this.setEUVar(0L); } } - if (this.getBaseMetaTileEntity().isAllowedToWork()) - if (aBaseMetaTileEntity.getStoredEU() > this.getMinimumStoredEU()) { - this.moveAroundLowPower(aBaseMetaTileEntity); - } + if (this.getBaseMetaTileEntity().isAllowedToWork() + && aBaseMetaTileEntity.getStoredEU() > this.getMinimumStoredEU()) { + this.moveAroundLowPower(aBaseMetaTileEntity); + } } } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java index 570d4592c4..d2c9d888af 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java @@ -83,13 +83,11 @@ public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hat @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { - byte Tick = (byte) ((int) (aTick % 20L)); - if (16 == Tick) { - if (aBaseMetaTileEntity.getStoredEU() > 0L) { - this.setEUVar(aBaseMetaTileEntity.getStoredEU() - (long) this.Amperes); - if (aBaseMetaTileEntity.getStoredEU() < 0L) { - this.setEUVar(0L); - } + byte Tick = (byte) (int) (aTick % 20L); + if (16 == Tick && aBaseMetaTileEntity.getStoredEU() > 0L) { + this.setEUVar(aBaseMetaTileEntity.getStoredEU() - this.Amperes); + if (aBaseMetaTileEntity.getStoredEU() < 0L) { + this.setEUVar(0L); } } if (aBaseMetaTileEntity.getStoredEU() > this.getMinimumStoredEU()) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java index 053a7b04ad..63978c55df 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java @@ -138,7 +138,6 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca @Override @Deprecated - @SuppressWarnings("deprecation") public long transferElectricity(ForgeDirection side, long aVoltage, long aAmperage, ArrayList aAlreadyPassedTileEntityList) { return 0L; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java index 0a6b9d1cca..04e65781d6 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java @@ -20,10 +20,12 @@ import vexatos.tgregworks.reference.Config; modid = MaterialsInjector.MOD_ID, name = MaterialsInjector.NAME, version = MaterialsInjector.VERSION, - dependencies = "required-after:IC2; " + "required-after:gregtech; " - + "required-after:bartworks;" - + "before:TGregworks;" - + "before:miscutils; ") + dependencies = """ + required-after:IC2;\ + required-after:gregtech;\ + required-after:bartworks;\ + before:TGregworks;\ + before:miscutils;""") public class MaterialsInjector { public static final String NAME = "BartWorks Mod Additions - TGregworks Container"; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java index fcc45f069f..5dfada8a82 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java @@ -39,6 +39,7 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { super(aName, aTier, aDescription, aTextures, aSlotCount); } + @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { this.mCharge = aBaseMetaTileEntity.getStoredEU() / 2L > aBaseMetaTileEntity.getEUCapacity() / 3L; @@ -63,10 +64,12 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { return ThaumcraftHandler.isWand(aStack); } + @Override public int getInventoryStackLimit() { return 1; } + @Override public long[] getStoredEnergy() { boolean scaleOverflow = false; boolean storedOverflow = false; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index f4db85e1ef..7aca6b05b7 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -14,7 +14,6 @@ package com.github.bartimaeusnek.crossmod.thaumcraft.util; import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import net.minecraft.item.ItemStack; @@ -27,14 +26,13 @@ import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import gregtech.api.enums.TC_Aspects; -@SuppressWarnings({ "rawtypes", "unchecked", "unused" }) public class ThaumcraftHandler { private ThaumcraftHandler() {} private static Integer taintBiomeID; private static Integer magicalForestBiomeID; - private static Class mWandInterface; + private static Class mWandInterface; static { try { @@ -84,8 +82,8 @@ public class ThaumcraftHandler { public static class AspectAdder { - public static Class mAspectListClass; - public static Class mAspectClass; + public static Class mAspectListClass; + public static Class mAspectClass; public static Method registerObjectTag; public static Method addToList; public static Method getName; @@ -129,11 +127,12 @@ public class ThaumcraftHandler { } } + @SafeVarargs public static void addAspectViaBW(ItemStack stack, Pair... aspectPair) { if (stack == null || stack.getItem() == null || stack.getUnlocalizedName() == null) return; try { - Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); - for (Pair a : aspectPair) { + Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.getConstructor().newInstance(); + for (Pair a : aspectPair) { if (API_ConfigValues.debugLog) DebugLog.log( "Stack:" + stack.getDisplayName() + " Damage:" @@ -145,18 +144,18 @@ public class ThaumcraftHandler { ThaumcraftHandler.AspectAdder.addToList.invoke(aspectList, a.getKey(), a.getValue()); } ThaumcraftHandler.AspectAdder.registerObjectTag.invoke(null, stack, aspectList); - } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) { + } catch (Exception e) { e.printStackTrace(); } } public static void addAspectViaGT(ItemStack stack, TC_Aspects.TC_AspectStack... tc_aspectStacks) { try { - Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); + Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.getConstructor().newInstance(); for (TC_Aspects.TC_AspectStack tc_aspects : tc_aspectStacks) ThaumcraftHandler.AspectAdder.addToList .invoke(aspectList, tc_aspects.mAspect.mAspect, (int) tc_aspects.mAmount); ThaumcraftHandler.AspectAdder.registerObjectTag.invoke(null, stack, aspectList); - } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) { + } catch (Exception e) { e.printStackTrace(); } } -- cgit From af3a8361c437e216742712b79a9ba11f135714ba Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Sat, 23 Sep 2023 13:46:35 +0100 Subject: fix plasmids (#362) Former-commit-id: 24ffa333701e695b2ec6f39e5bd93be81b806127 --- .../bartworks/common/loaders/recipes/LaserEngraver.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java index 3e01bfb7be..cc149e0bec 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java @@ -6,6 +6,8 @@ import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.TierEU; import gregtech.api.util.GT_Utility; @@ -16,7 +18,8 @@ public class LaserEngraver implements Runnable { public void run() { GT_Values.RA.stdBuilder().itemInputs(new ItemStack(Items.emerald), GT_Utility.getIntegratedCircuit(17)) - .duration(5 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sLaserEngraverRecipes); + .itemOutputs(BioItemList.getPlasmidCell(null)).duration(5 * SECONDS).eut(TierEU.RECIPE_LV) + .addTo(sLaserEngraverRecipes); } } -- cgit From b55e8996fadc05e0cc728974e6dac8ed0105ba30 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 23 Sep 2023 15:18:54 +0200 Subject: update bs+deps Former-commit-id: e491884044e30eec70f96218bbaccc4cf68d7739 --- build.gradle | 43 +++++++++++++++++++++++++++++++------------ dependencies.gradle | 2 +- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index ac9652d0a3..6a54d13b0c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1695323114 +//version: 1695474595 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -89,6 +89,23 @@ def out = services.get(StyledTextOutputFactory).create('an-output') def projectJavaVersion = JavaLanguageVersion.of(8) boolean disableSpotless = project.hasProperty("disableSpotless") ? project.disableSpotless.toBoolean() : false +boolean disableCheckstyle = project.hasProperty("disableCheckstyle") ? project.disableCheckstyle.toBoolean() : false + +final String CHECKSTYLE_CONFIG = """ + + + + + + + + + + + +""" checkPropertyExists("modName") checkPropertyExists("modId") @@ -140,6 +157,17 @@ if (!disableSpotless) { apply from: Blowdryer.file('spotless.gradle') } +if (!disableCheckstyle) { + apply plugin: 'checkstyle' + tasks.named("checkstylePatchedMc") { enabled = false } + tasks.named("checkstyleMcLauncher") { enabled = false } + tasks.named("checkstyleIdeVirtualMain") { enabled = false } + tasks.named("checkstyleInjectedTags") { enabled = false } + checkstyle { + config = resources.text.fromString(CHECKSTYLE_CONFIG) + } +} + String javaSourceDir = "src/main/java/" String scalaSourceDir = "src/main/scala/" String kotlinSourceDir = "src/main/kotlin/" @@ -765,23 +793,14 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies" } dependencies { - def lwjgl3ifyVersion = '1.4.0' - def asmVersion = '9.4' + def lwjgl3ifyVersion = '1.5.0' if (modId != 'lwjgl3ify') { java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") } if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.26') + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.5') } - java17PatchDependencies('net.minecraft:launchwrapper:1.17.2') {transitive = false} - java17PatchDependencies("org.ow2.asm:asm:${asmVersion}") - java17PatchDependencies("org.ow2.asm:asm-commons:${asmVersion}") - java17PatchDependencies("org.ow2.asm:asm-tree:${asmVersion}") - java17PatchDependencies("org.ow2.asm:asm-analysis:${asmVersion}") - java17PatchDependencies("org.ow2.asm:asm-util:${asmVersion}") - java17PatchDependencies('org.ow2.asm:asm-deprecated:7.1') - java17PatchDependencies("org.apache.commons:commons-lang3:3.12.0") java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false} } diff --git a/dependencies.gradle b/dependencies.gradle index 4038924ff4..ba2504f69c 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.19:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.23:dev') api("com.github.GTNewHorizons:TecTech:5.3.3:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" -- cgit From 617b15107cde79bcca298817defe9f04be3607b4 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 23 Sep 2023 16:41:02 +0200 Subject: update WCI Former-commit-id: 59399f480c8b40eae8a48521aacaefea63bd5748 --- .../bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java | 2 +- .../common/loaders/ElectricImplosionCompressorRecipes.java | 7 ++++++- .../bartworks/common/tileentities/multis/GT_TileEntity_LESU.java | 2 +- .../bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java | 2 +- .../java/com/github/bartimaeusnek/bartworks/util/BioCulture.java | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java index 61e62e640e..04526fec5a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java @@ -13,7 +13,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders; -import java.awt.*; +import java.awt.Color; import net.minecraft.item.EnumRarity; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java index e3804b8a50..c38e9cd7c0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java @@ -13,7 +13,12 @@ import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.util.BWRecipes; -import gregtech.api.enums.*; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.MaterialsUEVplus; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TierEU; import gregtech.api.util.GT_OreDictUnificator; public class ElectricImplosionCompressorRecipes implements Runnable { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 113a9023a7..e253db5d45 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -13,7 +13,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; -import java.awt.*; +import java.awt.Color; import java.util.ArrayList; import java.util.Collections; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index 703074d07d..a717e3915a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -13,7 +13,7 @@ package com.github.bartimaeusnek.bartworks.neiHandler; -import java.awt.*; +import java.awt.Rectangle; import java.util.ArrayList; import java.util.HashSet; import java.util.List; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index 3a9edb71f0..fecaffbecc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -13,7 +13,7 @@ package com.github.bartimaeusnek.bartworks.util; -import java.awt.*; +import java.awt.Color; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Objects; -- cgit From 48248e0dbf0e5b80b9ffdfe34d5c25f9079a991a Mon Sep 17 00:00:00 2001 From: miozune Date: Wed, 27 Sep 2023 00:48:56 +0900 Subject: [Hotfix] Fix packet crash with Vat renderer (#363) Former-commit-id: d833a5ad37f210f7ec720f6b5aaee05101aa0405 --- .../bartimaeusnek/bartworks/common/net/RendererPacket.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java index 952a3eeeb3..b1bb0a0dd8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -49,10 +49,9 @@ public class RendererPacket extends GT_Packet_New { @Override public void encode(ByteBuf aOut) { - - byte r = (byte) ((this.integer >> 16 & 0xFF) + Byte.MIN_VALUE); - byte g = (byte) ((this.integer >> 8 & 0xFF) + Byte.MIN_VALUE); - byte b = (byte) ((this.integer & 0xFF) + Byte.MIN_VALUE); + byte r = (byte) (this.integer >> 16 & 0xFF); + byte g = (byte) (this.integer >> 8 & 0xFF); + byte b = (byte) (this.integer & 0xFF); byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25 + this.coords.z % 25 + this.coords.wID % 25 @@ -65,8 +64,8 @@ public class RendererPacket extends GT_Packet_New { @Override public GT_Packet_New decode(ByteArrayDataInput dataInput) { this.coords = new Coords(dataInput.readInt(), dataInput.readShort(), dataInput.readInt(), dataInput.readInt()); - this.integer = BW_ColorUtil.getColorFromRGBArray( - new int[] { dataInput.readUnsignedByte(), dataInput.readUnsignedByte(), dataInput.readUnsignedByte() }); + this.integer = BW_ColorUtil + .getColorFromRGBArray(new int[] { dataInput.readByte(), dataInput.readByte(), dataInput.readByte() }); this.removal = dataInput.readByte(); byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25 -- cgit From ab65ab2afbf180c6c52c61145acc9e1803426d76 Mon Sep 17 00:00:00 2001 From: miozune Date: Sun, 8 Oct 2023 18:18:58 +0900 Subject: Cleanup isValidMetaTileEntity and some more (#364) * updateBuildScript & updateDependencies * Update .gitignore * Cleanup isValidMetaTileEntity * Remove unused and obsolete members Former-commit-id: 916b7ea9e708857b2efb50c3387fb7643dfa1796 --- .gitignore | 12 +- build.gradle | 4 +- dependencies.gradle | 6 +- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 13 +- .../tileentities/multis/GT_TileEntity_HTGR.java | 20 ++- .../tileentities/multis/GT_TileEntity_THTR.java | 17 +-- .../mega/GT_TileEntity_MegaBlastFurnace.java | 4 +- .../mega/GT_TileEntity_MegaMultiBlockBase.java | 23 ++- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 51 +++---- .../bartimaeusnek/bartworks/util/BW_Util.java | 163 --------------------- .../bartimaeusnek/bartworks/util/MegaUtils.java | 43 ------ .../tectech/TT_TileEntity_ManualTrafo.java | 146 ------------------ 12 files changed, 73 insertions(+), 429 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java diff --git a/.gitignore b/.gitignore index 5fcf044de6..5e80e0ae57 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .gradle .settings /.idea/ +/.vscode/ /run/ /build/ /eclipse/ @@ -25,6 +26,13 @@ whitelist.json *.iml *.ipr *.iws -src/main/resources/mixins.*.json +src/main/resources/mixins.*([!.]).json *.bat -.vscode/ \ No newline at end of file +*.DS_Store +!gradlew.bat +.factorypath +addon.local.gradle +addon.local.gradle.kts +addon.late.local.gradle +addon.late.local.gradle.kts +layout.json diff --git a/build.gradle b/build.gradle index 6a54d13b0c..621bc62fa6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1695474595 +//version: 1696265388 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -798,7 +798,7 @@ dependencies { java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") } if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.5') + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.7') } java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false} diff --git a/dependencies.gradle b/dependencies.gradle index ba2504f69c..cf2c918427 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,13 +1,13 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.23:dev') - api("com.github.GTNewHorizons:TecTech:5.3.3:dev") + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.31:dev') + api("com.github.GTNewHorizons:TecTech:5.3.5:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } api("com.github.GTNewHorizons:Avaritia:1.46:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.10.3-GTNH:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.10.5-GTNH:dev") compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.24-pre:dev") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.17-GTNH:api") {transitive = false} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index e3543a5332..6b9964e4d8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -28,6 +28,7 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_GLOW; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import static gregtech.api.util.GT_Utility.filterValidMTEs; import java.util.ArrayList; import java.util.List; @@ -246,14 +247,12 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override public ArrayList getStoredInputs() { ArrayList rList = new ArrayList<>(); - for (GT_MetaTileEntity_Hatch_InputBus tHatch : this.mInputBusses) { + for (GT_MetaTileEntity_Hatch_InputBus tHatch : filterValidMTEs(mInputBusses)) { tHatch.mRecipeMap = this.getRecipeMap(); - if (isValidMetaTileEntity(tHatch)) { - for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) { - if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null) { - rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i)); - break; - } + for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) { + if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null) { + rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i)); + break; } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 8e6bcc85d9..45b9b83fdd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -16,6 +16,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElement import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.GT_Values.AuthorKuba; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gregtech.api.util.GT_Utility.filterValidMTEs; import java.util.ArrayList; import java.util.HashMap; @@ -334,8 +335,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase this.fuelsupply, HTGRMaterials.MATERIALS_PER_FUEL * this.fueltype + HTGRMaterials.USABLE_FUEL_INDEX); boolean storedAll = false; - for (GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) { - if (!isValidMetaTileEntity(tHatch)) continue; + for (GT_MetaTileEntity_Hatch_OutputBus tHatch : filterValidMTEs(mOutputBusses)) { if (tHatch.storeAll(iStack)) { storedAll = true; break; @@ -365,15 +365,13 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase int takecoolant = this.coolanttaking; int drainedamount = 0; - for (GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) { - if (isValidMetaTileEntity(tHatch)) { - FluidStack tLiquid = tHatch.getFluid(); - if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant", 1))) { - FluidStack drained = tHatch.drain(takecoolant, true); - takecoolant -= drained.amount; - drainedamount += drained.amount; - if (takecoolant <= 0) break; - } + for (GT_MetaTileEntity_Hatch_Input tHatch : filterValidMTEs(mInputHatches)) { + FluidStack tLiquid = tHatch.getFluid(); + if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant", 1))) { + FluidStack drained = tHatch.drain(takecoolant, true); + takecoolant -= drained.amount; + drainedamount += drained.amount; + if (takecoolant <= 0) break; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 89f27cf41e..447f21281a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -19,6 +19,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gregtech.api.util.GT_Utility.filterValidMTEs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -294,15 +295,13 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase int takecoolant = this.coolanttaking; int drainedamount = 0; - for (GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) { - if (isValidMetaTileEntity(tHatch)) { - FluidStack tLiquid = tHatch.getFluid(); - if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant", 1))) { - FluidStack drained = tHatch.drain(takecoolant, true); - takecoolant -= drained.amount; - drainedamount += drained.amount; - if (takecoolant <= 0) break; - } + for (GT_MetaTileEntity_Hatch_Input tHatch : filterValidMTEs(mInputHatches)) { + FluidStack tLiquid = tHatch.getFluid(); + if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant", 1))) { + FluidStack drained = tHatch.drain(takecoolant, true); + takecoolant -= drained.amount; + drainedamount += drained.amount; + if (takecoolant <= 0) break; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index bf80c80a11..5b4f3a1ece 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -24,6 +24,7 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAS import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofCoil; +import static gregtech.api.util.GT_Utility.filterValidMTEs; import java.util.ArrayList; import java.util.Arrays; @@ -337,8 +338,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock if (isOutputPollution) { tOutputHatches = this.mPollutionOutputHatches; int pollutionReduction = 0; - for (GT_MetaTileEntity_Hatch_Muffler tHatch : this.mMufflerHatches) { - if (!isValidMetaTileEntity(tHatch)) continue; + for (GT_MetaTileEntity_Hatch_Muffler tHatch : filterValidMTEs(mMufflerHatches)) { pollutionReduction = 100 - tHatch.calculatePollutionReduction(100); break; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java index e666047839..700dbb8e36 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java @@ -1,5 +1,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import static gregtech.api.util.GT_Utility.filterValidMTEs; + import java.util.Arrays; import net.minecraft.init.Blocks; @@ -20,7 +22,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_ExtendedPow import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Utility; public abstract class GT_TileEntity_MegaMultiBlockBase> @@ -50,10 +51,8 @@ public abstract class GT_TileEntity_MegaMultiBlockBase getStoredFluids() { final ArrayList rList = new ArrayList<>(); - for (final GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) { - if (isValidMetaTileEntity(tHatch)) { - tHatch.mRecipeMap = getRecipeMap(); - if (tHatch instanceof GT_MetaTileEntity_Hatch_MultiInput) { - for (final FluidStack tFluid : ((GT_MetaTileEntity_Hatch_MultiInput) tHatch).getStoredFluid()) { - if (tFluid != null && !GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tFluid)) { - rList.add(tFluid); - } - } - } else { - if (tHatch.getFillableStack() != null) { - if (!GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tHatch.getFillableStack())) - rList.add(tHatch.getFillableStack()); + for (final GT_MetaTileEntity_Hatch_Input tHatch : filterValidMTEs(mInputHatches)) { + tHatch.mRecipeMap = getRecipeMap(); + if (tHatch instanceof GT_MetaTileEntity_Hatch_MultiInput) { + for (final FluidStack tFluid : ((GT_MetaTileEntity_Hatch_MultiInput) tHatch).getStoredFluid()) { + if (tFluid != null && !GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tFluid)) { + rList.add(tFluid); } } + } else { + if (tHatch.getFillableStack() != null) { + if (!GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tHatch.getFillableStack())) + rList.add(tHatch.getFillableStack()); + } } } - for (final GT_MetaTileEntity_Hatch_Input tHatch : mMiddleInputHatches) { - if (isValidMetaTileEntity(tHatch)) { - tHatch.mRecipeMap = getRecipeMap(); - if (tHatch instanceof GT_MetaTileEntity_Hatch_MultiInput) { - for (final FluidStack tFluid : ((GT_MetaTileEntity_Hatch_MultiInput) tHatch).getStoredFluid()) { - if (tFluid != null && GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tFluid)) { - rList.add(tFluid); - } + for (final GT_MetaTileEntity_Hatch_Input tHatch : filterValidMTEs(mMiddleInputHatches)) { + tHatch.mRecipeMap = getRecipeMap(); + if (tHatch instanceof GT_MetaTileEntity_Hatch_MultiInput) { + for (final FluidStack tFluid : ((GT_MetaTileEntity_Hatch_MultiInput) tHatch).getStoredFluid()) { + if (tFluid != null && GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tFluid)) { + rList.add(tFluid); } - } else { - if (tHatch.getFillableStack() != null) { - final FluidStack tStack = tHatch.getFillableStack(); - if (GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tStack)) { - rList.add(tStack); - } + } + } else { + if (tHatch.getFillableStack() != null) { + final FluidStack tStack = tHatch.getFillableStack(); + if (GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tStack)) { + rList.add(tStack); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 69438bff91..bd9ee551ce 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -16,7 +16,6 @@ package com.github.bartimaeusnek.bartworks.util; import static gregtech.api.enums.GT_Values.D1; import static gregtech.api.enums.GT_Values.E; import static gregtech.api.enums.GT_Values.M; -import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.GT_Values.VN; import static gregtech.api.enums.GT_Values.W; @@ -24,7 +23,6 @@ import java.lang.reflect.Array; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -64,11 +62,6 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OreDictNames; import gregtech.api.enums.ToolDictNames; import gregtech.api.interfaces.IItemContainer; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.ItemData; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Log; @@ -222,26 +215,6 @@ public class BW_Util { return special; } - public static boolean addBlockToMachine(int x, int y, int z, int offsetsize, - IGregTechTileEntity aBaseMetaTileEntity, Block block) { - int xDir = aBaseMetaTileEntity.getBackFacing().offsetX * offsetsize; - int zDir = aBaseMetaTileEntity.getBackFacing().offsetZ * offsetsize; - - return block == Blocks.air ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) - : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block); - } - - public static boolean addBlockToMachine(int x, int y, int z, int offsetsize, - IGregTechTileEntity aBaseMetaTileEntity, Block block, int damage) { - byte dmg = (byte) damage; - int xDir = aBaseMetaTileEntity.getBackFacing().offsetX * offsetsize; - int zDir = aBaseMetaTileEntity.getBackFacing().offsetZ * offsetsize; - - return block == Blocks.air ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) - : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) - && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == dmg; - } - public static int calculateSv(Materials materials) { for (BioVatLogicAdder.MaterialSvPair pair : BioVatLogicAdder.RadioHatch.getMaSv()) { if (pair.getMaterials().equals(materials)) return pair.getSievert(); @@ -264,19 +237,6 @@ public class BW_Util { && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial != null; } - public static Map getInputsFromOutput(Collection gt_recipes, - ItemStack... inputs) { - return gt_recipes.stream() - .filter(ar -> Arrays.stream(inputs).anyMatch(st -> GT_Utility.areStacksEqual(st, ar.mOutputs[0]))) - .collect(Collectors.toMap(k -> k.mOutputs[0], k -> k.mInputs)); - } - - public static Map getAsslineInputsFromOutputs(ItemStack... inputs) { - return GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.stream() - .filter(ar -> Arrays.stream(inputs).anyMatch(st -> GT_Utility.areStacksEqual(st, ar.mOutput))) - .collect(Collectors.toMap(k -> k.mOutput, k -> k.mInputs)); - } - public static int abstractHashGTRecipe(GT_Recipe recipe) { int hash = 31; hash += recipe.mDuration / 20 * 31; @@ -390,108 +350,6 @@ public class BW_Util { }; } - /** - * Taken from the GTNH fork, made originally by Tec Calcualtes overclocked ness using long integers - * - * @param aEUt - recipe EUt - * @param aDuration - recipe Duration - * @param mAmperage - should be 1 ? - */ - public static void calculateOverclockedNessMulti(@Nonnegative int aEUt, @Nonnegative int aDuration, - @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, - @Nonnull GT_MetaTileEntity_MultiBlockBase base) { - calculateOverclockednessMultiInternal(aEUt, aDuration, mAmperage, maxInputVoltage, base, false); - } - - public static void calculatePerfectOverclockedNessMulti(@Nonnegative int aEUt, @Nonnegative int aDuration, - @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, - @Nonnull GT_MetaTileEntity_MultiBlockBase base) { - calculateOverclockednessMultiInternal(aEUt, aDuration, mAmperage, maxInputVoltage, base, true); - } - - private static void calculateOverclockednessMultiInternal(@Nonnegative int aEUt, @Nonnegative int aDuration, - @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, - @Nonnull GT_MetaTileEntity_MultiBlockBase base, @Nonnull boolean perfectOC) { - byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); - if (mTier == 0) { - // Long time calculation - long xMaxProgresstime = (long) aDuration << 1; - if (xMaxProgresstime > Integer.MAX_VALUE - 1) { - // make impossible if too long - base.mEUt = Integer.MAX_VALUE - 1; - base.mMaxProgresstime = Integer.MAX_VALUE - 1; - } else { - base.mEUt = aEUt >> 2; - base.mMaxProgresstime = (int) xMaxProgresstime; - } - } else { - // Long EUt calculation - long xEUt = aEUt; - // Isnt too low EUt check? - long tempEUt = Math.max(xEUt, V[1]); - - base.mMaxProgresstime = aDuration; - - while (tempEUt <= V[mTier - 1] * mAmperage) { - tempEUt <<= 2; // this actually controls overclocking - // xEUt *= 4;//this is effect of everclocking - base.mMaxProgresstime >>= perfectOC ? 2 : 1; // this is effect of overclocking - xEUt = base.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2; // U know, if the time is less than 1 tick - // make the machine use less power - } - - while (xEUt > maxInputVoltage && xEUt >= aEUt) { - // downclock one notch until we are good again, we have overshot. - xEUt >>= 2; - base.mMaxProgresstime <<= perfectOC ? 2 : 1; - } - - if (xEUt < aEUt) { - xEUt <<= 2; - base.mMaxProgresstime >>= perfectOC ? 2 : 1; - } - - if (xEUt > Integer.MAX_VALUE - 1) { - base.mEUt = Integer.MAX_VALUE - 1; - base.mMaxProgresstime = Integer.MAX_VALUE - 1; - } else { - base.mEUt = (int) xEUt; - if (base.mEUt == 0) base.mEUt = 1; - if (base.mMaxProgresstime <= 0) base.mMaxProgresstime = 1; // set time to 1 tick - } - } - } - - public static long getnominalVoltage(GT_MetaTileEntity_MultiBlockBase base) { - long rVoltage = 0L; - long rAmperage = 0L; - - for (GT_MetaTileEntity_Hatch_Energy tHatch : base.mEnergyHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - rVoltage = Math.max(tHatch.getBaseMetaTileEntity().getInputVoltage(), rVoltage); - rAmperage += tHatch.getBaseMetaTileEntity().getInputAmperage(); - } - } - - return rVoltage * rAmperage; - } - - public static FluidStack[] getFluidsFromInputHatches(GT_MetaTileEntity_MultiBlockBase aBaseMetaTileEntity) { - ArrayList tmp = new ArrayList<>(); - for (GT_MetaTileEntity_Hatch_Input fip : aBaseMetaTileEntity.mInputHatches) { - tmp.add(fip.getFluid()); - } - return tmp.toArray(new FluidStack[0]); - } - - public static ItemStack[] getItemsFromInputBusses(GT_MetaTileEntity_MultiBlockBase aBaseMetaTileEntity) { - ArrayList tmp = new ArrayList<>(); - for (GT_MetaTileEntity_Hatch_InputBus fip : aBaseMetaTileEntity.mInputBusses) { - tmp.addAll(Arrays.asList(fip.mInventory)); - } - return tmp.toArray(new ItemStack[0]); - } - public static EnumRarity getRarityFromByte(byte b) { return switch (b) { case 1 -> EnumRarity.uncommon; @@ -501,27 +359,6 @@ public class BW_Util { }; } - public static List getMetasFromLayer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, - int height, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck) { - ArrayList ret = new ArrayList<>(); - int xDir = aBaseMetaTileEntity.getBackFacing().offsetX * offset; - int zDir = aBaseMetaTileEntity.getBackFacing().offsetZ * offset; - for (int x = -radius; x <= radius; x++) { - for (int y = yLevel; y < height; y++) { - for (int z = -radius; z <= radius; z++) { - if (freeCorners && Math.abs(x) == radius && Math.abs(z) == radius) continue; - if (controllerLayer && xDir + x == 0 && zDir + z == 0) continue; - final boolean inside = Math.abs(x) < radius && Math.abs(z) != radius; - if (insideCheck && inside) ret.add(aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); - if (!inside) { - ret.add(aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); - } - } - } - } - return ret; - } - public static byte getCircuitTierFromOreDictName(String name) { return switch (name) { case "circuitPrimitive" -> 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java deleted file mode 100644 index d5c8be8a28..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.util; - -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; - -public class MegaUtils { - - public static boolean drainEnergyMegaVanilla(GT_MetaTileEntity_MultiBlockBase multiBlockBase, long aEU) { - if (aEU <= 0) return true; - - long allTheEu = 0; - int hatches = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : multiBlockBase.mEnergyHatches) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - allTheEu += tHatch.getEUVar(); - hatches++; - } - - if (allTheEu < aEU) return false; - - long euperhatch = aEU / hatches; - - boolean hasDrained = false; - - for (GT_MetaTileEntity_Hatch_Energy tHatch : multiBlockBase.mEnergyHatches) - hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); - - return hasDrained && multiBlockBase.mEnergyHatches.size() > 0; - } -} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java deleted file mode 100644 index 35315b677c..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.crossmod.tectech; - -import java.util.ArrayList; -import java.util.Iterator; - -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; - -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; - -public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { - - ArrayList mTTEnergyHatches = new ArrayList<>(); - ArrayList mTTDynamos = new ArrayList<>(); - - public TT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public TT_TileEntity_ManualTrafo(String aName) { - super(aName); - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new TT_TileEntity_ManualTrafo(this.mName); - } - - @Override - public boolean addEnergyOutput(long aEU) { - if (aEU <= 0L) { - return true; - } - return this.mTTDynamos.size() > 0 - || this.mDynamoHatches.size() > 0 && this.addEnergyOutputMultipleDynamos(aEU, true); - } - - @Override - public boolean addEnergyOutputMultipleDynamos(long aEU, boolean aAllowMixedVoltageDynamos) { - int injected = 0; - long totalOutput = 0L; - long aFirstVoltageFound = -1L; - boolean aFoundMixedDynamos = false; - long aVoltage; - for (GT_MetaTileEntity_Hatch_Dynamo aDynamo : this.mDynamoHatches) { - if (aDynamo == null) { - return false; - } - - if (isValidMetaTileEntity(aDynamo)) { - aVoltage = aDynamo.maxEUOutput(); - long aTotal = aDynamo.maxAmperesOut() * aVoltage; - if (aFirstVoltageFound == -1L) { - aFirstVoltageFound = aVoltage; - } else if (aFirstVoltageFound != aVoltage) { - aFoundMixedDynamos = true; - } - - totalOutput += aTotal; - } - } - - if (totalOutput < aEU || aFoundMixedDynamos && !aAllowMixedVoltageDynamos) { - this.explodeMultiblock(); - return false; - } - Iterator var17 = this.mDynamoHatches.iterator(); - - while (true) { - GT_MetaTileEntity_Hatch_Dynamo aDynamo; - do { - if (!var17.hasNext()) { - return injected > 0; - } - - aDynamo = var17.next(); - } while (!isValidMetaTileEntity(aDynamo)); - - long leftToInject = aEU - injected; - aVoltage = aDynamo.maxEUOutput(); - int aAmpsToInject = (int) (leftToInject / aVoltage); - int aRemainder = (int) (leftToInject - aAmpsToInject * aVoltage); - int ampsOnCurrentHatch = (int) Math.min(aDynamo.maxAmperesOut(), aAmpsToInject); - - for (int i = 0; i < ampsOnCurrentHatch; ++i) { - aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage, false); - } - - injected = (int) (injected + aVoltage * ampsOnCurrentHatch); - if (aRemainder > 0 && ampsOnCurrentHatch < aDynamo.maxAmperesOut()) { - aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aRemainder, false); - injected += aRemainder; - } - } - } - - @Override - public boolean drainEnergyInput(long aEU) { - if (aEU > 0L) { - { - Iterator var3 = this.mTTEnergyHatches.iterator(); - - GT_MetaTileEntity_Hatch_EnergyMulti tHatch; - do { - if (!var3.hasNext()) { - return false; - } - - tHatch = var3.next(); - } while (!isValidMetaTileEntity(tHatch) - || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); - } - { - Iterator var3 = this.mEnergyHatches.iterator(); - - GT_MetaTileEntity_Hatch_Energy tHatch; - do { - if (!var3.hasNext()) { - return false; - } - - tHatch = var3.next(); - } while (!isValidMetaTileEntity(tHatch) - || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); - } - } - return true; - } -} -- cgit From 95ef7a35d28300919a965837812be59bf505718d Mon Sep 17 00:00:00 2001 From: Dream-MasterXXL Date: Mon, 9 Oct 2023 22:41:20 +0200 Subject: update deps Former-commit-id: 070d7a4cb41b739e50964ea53c5946e35d3cd37d --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index cf2c918427..e0afff20b3 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.31:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.35:dev') api("com.github.GTNewHorizons:TecTech:5.3.5:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" -- cgit From a06016a2ecc7ca5b803957f32b50fa83ea9d1745 Mon Sep 17 00:00:00 2001 From: GDCloud <93287602+GDCloudstrike@users.noreply.github.com> Date: Thu, 19 Oct 2023 23:23:02 +0200 Subject: make humongous hatch uxv tier (#365) Former-commit-id: b0cd31096218d4e5edba262e559d80ef6f165b54 --- .../tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java index a5281e1b6a..15bee4d1c8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java @@ -21,7 +21,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input public class GT_MetaTileEntity_HumongousInputHatch extends GT_MetaTileEntity_Hatch_Input { public GT_MetaTileEntity_HumongousInputHatch(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional, 0); + super(aID, aName, aNameRegional, 13); this.mDescriptionArray[1] = "Capacity: 2,000,000,000L"; } -- cgit From 6f46c2e48ea98428e039f2150eab19fcbaf88124 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Fri, 20 Oct 2023 09:09:26 +0200 Subject: update deps +bs Former-commit-id: f516075080b0c39e13b9cf296b378a2daf148af4 --- build.gradle | 6 +++--- dependencies.gradle | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 621bc62fa6..e59189c895 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1696265388 +//version: 1697697256 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -793,12 +793,12 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies" } dependencies { - def lwjgl3ifyVersion = '1.5.0' + def lwjgl3ifyVersion = '1.5.1' if (modId != 'lwjgl3ify') { java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") } if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.7') + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.17') } java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false} diff --git a/dependencies.gradle b/dependencies.gradle index e0afff20b3..bf7218ffef 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,13 +1,13 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.35:dev') - api("com.github.GTNewHorizons:TecTech:5.3.5:dev") + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.53:dev') + api("com.github.GTNewHorizons:TecTech:5.3.9:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } api("com.github.GTNewHorizons:Avaritia:1.46:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.10.5-GTNH:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.10.8-GTNH:dev") compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.24-pre:dev") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.17-GTNH:api") {transitive = false} -- cgit From 75af5c94f30d41a7a525e74db90598d0f0360ce1 Mon Sep 17 00:00:00 2001 From: Dariusz Komosiński Date: Mon, 13 Nov 2023 11:06:28 +0100 Subject: Fix MDT void protection (#367) * Update buildscript. * Implement custom MDT logic for dumping fluid to ME. * Code cleanup. Former-commit-id: 37d1e00c283ef1ae8b03150212c3ca425b0ef3b5 --- build.gradle | 7 +++--- .../mega/GT_TileEntity_MegaDistillTower.java | 25 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index e59189c895..f3a7fa2788 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1697697256 +//version: 1699290261 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -646,7 +646,7 @@ repositories { def mixinProviderGroup = "io.github.legacymoddingmc" def mixinProviderModule = "unimixins" -def mixinProviderVersion = "0.1.7.1" +def mixinProviderVersion = "0.1.13" def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}" def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev" ext.mixinProviderSpec = mixinProviderSpec @@ -1187,9 +1187,8 @@ publishing { version = System.getenv("RELEASE_VERSION") ?: identifiedVersion } } - repositories { - if (usesMavenPublishing.toBoolean()) { + if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) { maven { url = mavenPublishUrl allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 343a06cece..4644b33dc8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -56,6 +56,7 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_Output_ME; public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { @@ -376,6 +377,30 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock return new ProcessingLogic().setMaxParallel(ConfigHandler.megaMachinesMax); } + @Override + public boolean canDumpFluidToME() { + + // All fluids can be dumped to ME only if each layer contains a ME Output Hatch. + for (List tLayerOutputHatches : this.mOutputHatchesByLayer) { + + boolean foundMEHatch = false; + + for (IFluidStore tHatch : tLayerOutputHatches) { + if (tHatch instanceof GT_MetaTileEntity_Hatch_Output_ME) { + foundMEHatch = true; + break; + } + } + + // Exit if we didn't find a valid hatch on this layer. + if (!foundMEHatch) { + return false; + } + } + + return true; + } + @Override protected void addFluidOutputs(FluidStack[] mOutputFluids2) { for (int i = 0; i < mOutputFluids2.length && i < this.mOutputHatchesByLayer.size(); i++) { -- cgit From 4a2ee50b893e409a430abb0587bfd190204ecb26 Mon Sep 17 00:00:00 2001 From: ALongStringOfNumbers <31759736+ALongStringOfNumbers@users.noreply.github.com> Date: Mon, 13 Nov 2023 04:56:49 -0700 Subject: Relax the Mega Chemical Reactor Structure Requirements (#366) * Update Buildscript * Allow I/O on back of Mega Chemical Reactor * Simplify Logic --------- Co-authored-by: Martin Robertz Former-commit-id: a420b2bbd61c2c78a19c62ac69abccfa309015f5 --- .../tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index 68c8a7804b..273469366c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -198,7 +198,8 @@ public class GT_TileEntity_MegaChemicalReactor .addElement('r', Maintenance.newAny(CASING_INDEX, 2)) .addElement( 'e', - buildHatchAdder(GT_TileEntity_MegaChemicalReactor.class).atLeast(Energy.or(ExoticEnergy)) + buildHatchAdder(GT_TileEntity_MegaChemicalReactor.class) + .atLeast(Energy.or(ExoticEnergy), InputHatch, InputBus, OutputHatch, OutputBus) .casingIndex(CASING_INDEX).dot(3).buildAndChain(GregTech_API.sBlockCasings8, 0)) .addElement('c', ofChain(ofBlock(GregTech_API.sBlockCasings4, 7), ofBlock(GregTech_API.sBlockCasings5, 13))) .addElement( -- cgit From f422ba534a13e52ff5b02e14039e39c7c027d009 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Mon, 13 Nov 2023 13:32:04 +0100 Subject: update deps Former-commit-id: 6ed2ad8915f4e27bd24155b28dd974b260f7c37b --- dependencies.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index bf7218ffef..0c380b5d29 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,14 +1,14 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.53:dev') - api("com.github.GTNewHorizons:TecTech:5.3.9:dev") + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.79:dev') + api("com.github.GTNewHorizons:TecTech:5.3.13:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } api("com.github.GTNewHorizons:Avaritia:1.46:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.10.8-GTNH:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.10.11-GTNH:dev") compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.24-pre:dev") {transitive = false} - compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.17-GTNH:api") {transitive = false} + compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.19-GTNH:api") {transitive = false} } -- cgit From 1853416b9d65b5ed523f51ce23b51a0deb48fa22 Mon Sep 17 00:00:00 2001 From: lordIcocain <62835225+lordIcocain@users.noreply.github.com> Date: Mon, 13 Nov 2023 17:38:01 +0200 Subject: ABS fluid output free from bart recipe reaper (#368) * fix quad input hatch * fix quad input hatch Improve code readable * free ABS Former-commit-id: d2a73748f7c22ea3fac767caca88df7d99154eec --- .../bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index f0da014b02..907689ad5e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -596,6 +596,7 @@ public class PlatinumSludgeOverHaul { for (int i = 0; i < recipe.mFluidOutputs.length; i++) { if (map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes)) continue maploop; + if ("gtpp.recipe.alloyblastsmelter".equals(map.mUnlocalizedName)) continue maploop; if (map.equals(GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sChemicalRecipes)) { if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i]) -- cgit From 9bb670b22c2c15da6530c05a8be1b0d54b462e6b Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Mon, 13 Nov 2023 19:33:04 +0100 Subject: Fix EIC piston reset Former-commit-id: 270d20ceb76e64b7ec2d5234985245f1465a4acc --- .../multis/GT_TileEntity_ElectricImplosionCompressor.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 51683d2376..8aab42be9e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -123,7 +123,7 @@ public class GT_TileEntity_ElectricImplosionCompressor .casingIndex(CASING_INDEX).dot(2).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings2, 0)), onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings3, 4)))) - .addElement('N', new IStructureElement() { + .addElement('N', new IStructureElement<>() { // Much of this based on StructureUtility.ofBlocksTiered private final List> tiers = getAllBlockTiers(); @@ -336,17 +336,17 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override public void stopMachine() { - this.resetPiston(); + this.resetPiston(this.mBlockTier); super.stopMachine(); } - private void resetPiston() { + private void resetPiston(int tier) { if (!pistonEnabled) return; IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); if (!aBaseMetaTileEntity.isServerSide()) return; if (!this.piston) { List> tiers = getAllBlockTiers(); - Pair tieredBlock = tiers.get(Math.min(this.mBlockTier, tiers.size()) - 1); + Pair tieredBlock = tiers.get(Math.min(tier, tiers.size()) - 1); this.chunkCoordinates.forEach(c -> { // Don't replace real blocks in case user has placed something (e.g. tier upgrade) if (aBaseMetaTileEntity.getWorld().isAirBlock(c.posX, c.posY, c.posZ)) { @@ -407,6 +407,7 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { + int pistonTier = this.mBlockTier; this.mCasing = 0; int mMaxHatchTier = 0; this.setBlockTier(0); @@ -422,7 +423,7 @@ public class GT_TileEntity_ElectricImplosionCompressor this.activatePiston(); return true; } - this.resetPiston(); + this.resetPiston(pistonTier); return false; } -- cgit From 1f78596dfb35aad82176d814255bb973c7c4cf0d Mon Sep 17 00:00:00 2001 From: LewisSaber Date: Wed, 15 Nov 2023 14:33:04 +0200 Subject: Add Circuit Assembler Mode Former-commit-id: 650d8c7bcde2e3748279aa7201cf1f9e46866f1d --- .../bartworks/API/modularUI/BW_UITextures.java | 5 + .../multis/GT_TileEntity_CircuitAssemblyLine.java | 130 +++++++++++++++++---- .../bartworks/neiHandler/IMCForNEI.java | 1 + .../resources/assets/bartworks/lang/en_US.lang | 3 + .../textures/GUI/overlay_button/assembler_mode.png | Bin 0 -> 684 bytes .../textures/GUI/overlay_button/line_mode.png | Bin 0 -> 714 bytes 6 files changed, 115 insertions(+), 24 deletions(-) create mode 100644 src/main/resources/assets/bartworks/textures/GUI/overlay_button/assembler_mode.png create mode 100644 src/main/resources/assets/bartworks/textures/GUI/overlay_button/line_mode.png diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/modularUI/BW_UITextures.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/modularUI/BW_UITextures.java index 590486cf6e..8d8f5c1778 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/modularUI/BW_UITextures.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/modularUI/BW_UITextures.java @@ -52,4 +52,9 @@ public class BW_UITextures { .of(MOD_ID, "GUI/tab/title_dark_brown", 28, 28, 4); public static final AdaptableUITexture TAB_TITLE_ANGULAR_BROWN = AdaptableUITexture .of(MOD_ID, "GUI/tab/title_angular_brown", 28, 28, 4); + + public static final UITexture OVERLAY_BUTTON_ASSEMBLER_MODE = UITexture + .fullImage(MOD_ID, "GUI/overlay_button/assembler_mode"); + public static final UITexture OVERLAY_BUTTON_LINE_MODE = UITexture + .fullImage(MOD_ID, "GUI/overlay_button/line_mode"); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 6b9964e4d8..9b73d9974a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -27,12 +27,15 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_GLOW; +import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gregtech.api.util.GT_Utility.filterValidMTEs; import java.util.ArrayList; +import java.util.Collections; import java.util.List; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -44,6 +47,7 @@ import net.minecraftforge.common.util.ForgeDirection; import org.jetbrains.annotations.NotNull; +import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; @@ -54,11 +58,13 @@ import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.widget.CycleButtonWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import gregtech.api.GregTech_API; import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -85,6 +91,13 @@ public class GT_TileEntity_CircuitAssemblyLine extends private static final String STRUCTURE_PIECE_FIRST = "first"; private static final String STRUCTURE_PIECE_NEXT = "next"; + private static final int MINIMUM_CIRCUIT_ASSEMBLER_LENGTH = 5; + protected static final String IMPRINT_KEY = "Type"; + protected static final String LENGTH_KEY = "Length"; + protected static final String RUNNING_MODE_KEY = "RunningMode"; + + private int length; + private int mode; private String imprintedItemName; private ItemStack imprintedStack; @@ -121,12 +134,29 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Circuit Assembler").addInfo("Controller block for the Circuit Assembly Line") + tt.addMachineType("Circuit Assembler/Circuit Assembly Line") + .addInfo("Controller block for the Circuit Assembly Line").addInfo("Change Mode with Screwdriver") + .addInfo("Does not lose efficiency when overclocked") + .addInfo( + "---------" + EnumChatFormatting.WHITE + + StatCollector.translateToLocal("chat.cal.mode.0") + + EnumChatFormatting.GRAY + + "--------") .addInfo("Imprint this machine with a Circuit Imprint,") .addInfo("by putting the imprint in the controller") .addInfo("Every Circuit Assembly Line can only be imprinted ONCE") - .addInfo("Does not lose efficiency when overclocked").addInfo(BW_Tooltip_Reference.TT_BLUEPRINT) - .addSeparator().beginVariableStructureBlock(2, 7, 3, 3, 3, 3, false) + .addInfo( + "---------" + EnumChatFormatting.WHITE + + StatCollector.translateToLocal("chat.cal.mode.1") + + EnumChatFormatting.GRAY + + "--------") + .addInfo( + "Does Circuit Assembler recipes, Minimum Length: " + EnumChatFormatting.RED + + MINIMUM_CIRCUIT_ASSEMBLER_LENGTH + + EnumChatFormatting.GRAY) + .addInfo("This mode supports Crafting Input Buffer/Bus and allows bus separation").addInfo("") + .addInfo(BW_Tooltip_Reference.TT_BLUEPRINT).addSeparator() + .beginVariableStructureBlock(2, 7, 3, 3, 3, 3, false) .addStructureInfo("From Bottom to Top, Left to Right") .addStructureInfo( "Layer 1 - Solid Steel Machine Casing, Input bus (Last Output bus), Solid Steel Machine Casing") @@ -192,27 +222,43 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override public void loadNBTData(NBTTagCompound aNBT) { - this.type = aNBT.getCompoundTag("Type"); + this.type = aNBT.getCompoundTag(IMPRINT_KEY); this.imprintedItemName = GT_LanguageManager .getTranslateableItemStackName(ItemStack.loadItemStackFromNBT(this.type)); + mode = aNBT.getInteger(RUNNING_MODE_KEY); + length = aNBT.getInteger(LENGTH_KEY); super.loadNBTData(aNBT); } @Override public void setItemNBT(NBTTagCompound aNBT) { - if (!this.type.equals(new NBTTagCompound())) aNBT.setTag("Type", this.type); + if (!this.type.equals(new NBTTagCompound())) aNBT.setTag(IMPRINT_KEY, this.type); + aNBT.setInteger(RUNNING_MODE_KEY, mode); + aNBT.setInteger(LENGTH_KEY, length); super.saveNBTData(aNBT); } @Override public void saveNBTData(NBTTagCompound aNBT) { - if (!this.type.equals(new NBTTagCompound())) aNBT.setTag("Type", this.type); + if (!this.type.equals(new NBTTagCompound())) aNBT.setTag(IMPRINT_KEY, this.type); + aNBT.setInteger(RUNNING_MODE_KEY, mode); + aNBT.setInteger(LENGTH_KEY, length); super.saveNBTData(aNBT); } + @Override + public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (getBaseMetaTileEntity().isServerSide()) { + this.mode = (this.mode + 1) % 2; + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("chat.cal.mode." + this.mode)); + } + super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); + } + @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return BWRecipes.instance.getMappingsFor((byte) 3); + if (this.mode == 0) return BWRecipes.instance.getMappingsFor((byte) 3); + return GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes; } @Override @@ -223,13 +269,18 @@ public class GT_TileEntity_CircuitAssemblyLine extends @NotNull @Override public CheckRecipeResult checkProcessing() { - if (this.type.equals(new NBTTagCompound()) && !this.imprintMachine(this.getControllerSlot())) - return SimpleCheckRecipeResult.ofFailure("no_imprint"); - if (this.imprintedItemName == null || this.imprintedStack == null) { - this.imprintedStack = new ItemStack(BW_Meta_Items.getNEWCIRCUITS(), 1, 0); - this.imprintedStack.setTagCompound(this.type); - this.imprintedItemName = GT_LanguageManager.getTranslateableItemStackName(this.imprintedStack); + if (mode == 0) { + if (this.type.equals(new NBTTagCompound()) && !this.imprintMachine(this.getControllerSlot())) + return SimpleCheckRecipeResult.ofFailure("no_imprint"); + if (this.imprintedItemName == null || this.imprintedStack == null) { + this.imprintedStack = new ItemStack(BW_Meta_Items.getNEWCIRCUITS(), 1, 0); + this.imprintedStack.setTagCompound(this.type); + this.imprintedItemName = GT_LanguageManager.getTranslateableItemStackName(this.imprintedStack); + } + } else if (length < MINIMUM_CIRCUIT_ASSEMBLER_LENGTH) { + return SimpleCheckRecipeResult.ofFailure("not_enough_length"); } + return super.checkProcessing(); } @@ -246,17 +297,21 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override public ArrayList getStoredInputs() { - ArrayList rList = new ArrayList<>(); - for (GT_MetaTileEntity_Hatch_InputBus tHatch : filterValidMTEs(mInputBusses)) { - tHatch.mRecipeMap = this.getRecipeMap(); - for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) { - if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null) { - rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i)); - break; + if (mode == 0) { + ArrayList rList = new ArrayList<>(); + for (GT_MetaTileEntity_Hatch_InputBus tHatch : filterValidMTEs(mInputBusses)) { + tHatch.mRecipeMap = this.getRecipeMap(); + for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) { + if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null) { + rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i)); + break; + } } } + return rList; } - return rList; + + return super.getStoredInputs(); } @Override @@ -357,10 +412,12 @@ public class GT_TileEntity_CircuitAssemblyLine extends } private boolean checkMachine(boolean leftToRight) { + for (int i = 1; i < 7; ++i) { if (!this.checkPiece(STRUCTURE_PIECE_NEXT, leftToRight ? -i : i, 0, 0)) { return false; } + length = i; if (!this.mOutputBusses.isEmpty()) { return this.mEnergyHatches.size() == 1 && this.mMaintenanceHatches.size() == 1; @@ -397,7 +454,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override public void addAdditionalTooltipInformation(ItemStack stack, List tooltip) { - if (stack.hasTagCompound() && stack.stackTagCompound.hasKey("Type")) { + if (stack.hasTagCompound() && stack.stackTagCompound.hasKey(IMPRINT_KEY)) { tooltip.add( StatCollector.translateToLocal("tooltip.cal.imprintedWith") + " " + EnumChatFormatting.YELLOW @@ -413,6 +470,16 @@ public class GT_TileEntity_CircuitAssemblyLine extends super.addUIWidgets(builder, buildContext); builder.widget( new FakeSyncWidget.StringSyncer(() -> this.imprintedItemName, val -> this.imprintedItemName = val)); + builder.widget( + new CycleButtonWidget().setToggle(() -> mode == 1, val -> mode = val ? 1 : 0) + .setTextureGetter( + state -> state == 1 ? BW_UITextures.OVERLAY_BUTTON_ASSEMBLER_MODE + : BW_UITextures.OVERLAY_BUTTON_LINE_MODE) + .setBackground(GT_UITextures.BUTTON_STANDARD).setPos(80, 91).setSize(16, 16) + .dynamicTooltip( + () -> Collections + .singletonList(StatCollector.translateToLocal("chat.cal.mode." + mode))) + .setUpdateTooltipEveryTick(true).setTooltipShowUpDelay(TOOLTIP_DELAY)); } @Override @@ -425,6 +492,16 @@ public class GT_TileEntity_CircuitAssemblyLine extends return true; } + @Override + public boolean supportsInputSeparation() { + return mode == 0 ? false : true; + } + + @Override + public boolean isInputSeparationEnabled() { + return mode == 0 ? false : super.isInputSeparationEnabled(); + } + @Override public boolean isRecipeLockingEnabled() { return this.imprintedItemName != null && !"".equals(this.imprintedItemName); @@ -435,7 +512,10 @@ public class GT_TileEntity_CircuitAssemblyLine extends IWailaConfigHandler config) { super.getWailaBody(itemStack, currenttip, accessor, config); NBTTagCompound tag = accessor.getNBTData(); - if (tag.hasKey("ImprintedWith")) currenttip.add( + currenttip.add( + EnumChatFormatting.GREEN + + StatCollector.translateToLocal("chat.cal.mode." + tag.getInteger(RUNNING_MODE_KEY))); + if (tag.hasKey("ImprintedWith") && tag.getInteger(RUNNING_MODE_KEY) == 0) currenttip.add( StatCollector.translateToLocal("tooltip.cal.imprintedWith") + " " + EnumChatFormatting.YELLOW + tag.getString("ImprintedWith")); @@ -448,10 +528,12 @@ public class GT_TileEntity_CircuitAssemblyLine extends super.getWailaNBTData(player, tile, tag, world, x, y, z); String imprintedWith = this.getTypeForDisplay(); if (!imprintedWith.isEmpty()) tag.setString("ImprintedWith", imprintedWith); + tag.setInteger(RUNNING_MODE_KEY, mode); } @Override protected boolean supportsCraftingMEBuffer() { - return false; + return mode == 0 ? false : true; } + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java index e27669caee..b32a7c2b49 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java @@ -28,6 +28,7 @@ public class IMCForNEI { sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12722"); sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12723"); sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12724"); + sendCatalyst("gt.recipe.circuitassembler", "gregtech:gt.blockmachines:12735", -20); } private static void sendHandler(String name, String block) { diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index 29db940153..fdd5498770 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -8,6 +8,7 @@ BW_ItemBlocks.1.name=Plated Lapis Cell GT_LESU_CASING.0.name=LESU Casing GT5U.gui.text.no_imprint=Missing imprint +GT5U.gui.text.not_enough_length=Multiblock Too Short GT5U.gui.text.wrong_sievert_exactly=§7Wrong sievert. Requires exactly: %s §7Sv GT5U.gui.text.wrong_sievert_min=§7Wrong sievert. Requires at least: %s §7Sv @@ -186,4 +187,6 @@ misc.BatchModeTextOn=Batch recipes misc.BatchModeTextOff=Don't batch recipes tooltip.cal.imprintedWith=Imprinted with: +chat.cal.mode.0=Circuit Assembly Line Mode +chat.cal.mode.1=Circuit Assembler Mode #Liquids diff --git a/src/main/resources/assets/bartworks/textures/GUI/overlay_button/assembler_mode.png b/src/main/resources/assets/bartworks/textures/GUI/overlay_button/assembler_mode.png new file mode 100644 index 0000000000..a8d30a022e Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/overlay_button/assembler_mode.png differ diff --git a/src/main/resources/assets/bartworks/textures/GUI/overlay_button/line_mode.png b/src/main/resources/assets/bartworks/textures/GUI/overlay_button/line_mode.png new file mode 100644 index 0000000000..d7132dcfba Binary files /dev/null and b/src/main/resources/assets/bartworks/textures/GUI/overlay_button/line_mode.png differ -- cgit From 826570a7a1d6a38d3c50a8ca396be43339008659 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 25 Nov 2023 13:06:10 +0100 Subject: update bs+deps Former-commit-id: 6bfa9ead8c708178f958109e651998f2d53447c4 --- build.gradle | 4 ++-- dependencies.gradle | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index f3a7fa2788..4e31dc883b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1699290261 +//version: 1700844281 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -302,7 +302,7 @@ if (apiPackage) { } if (accessTransformersFile) { - for (atFile in accessTransformersFile.split(",")) { + for (atFile in accessTransformersFile.split(" ")) { String targetFile = "src/main/resources/META-INF/" + atFile.trim() if (!getFile(targetFile).exists()) { throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) diff --git a/dependencies.gradle b/dependencies.gradle index 0c380b5d29..7b71b56b4a 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,8 +1,8 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.79:dev') - api("com.github.GTNewHorizons:TecTech:5.3.13:dev") + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.88:dev') + api("com.github.GTNewHorizons:TecTech:5.3.14:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } -- cgit From 51121e424b991358383e4bf8611ca4eb7a2c3afc Mon Sep 17 00:00:00 2001 From: Батьків Нестор-Євген Васильович Date: Sat, 25 Nov 2023 17:15:27 +0200 Subject: I like ternary :fail: Former-commit-id: e9c98929be828ee9ca54b3f2721e5aa366a7befb --- .../tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 9b73d9974a..a1c3b91a5c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -494,12 +494,12 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override public boolean supportsInputSeparation() { - return mode == 0 ? false : true; + return mode != 0; } @Override public boolean isInputSeparationEnabled() { - return mode == 0 ? false : super.isInputSeparationEnabled(); + return mode == 1 && super.isInputSeparationEnabled(); } @Override @@ -533,7 +533,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override protected boolean supportsCraftingMEBuffer() { - return mode == 0 ? false : true; + return mode != 0; } } -- cgit From 2dc344bb04afb11462cdd1001658dea2e4e0371b Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Wed, 29 Nov 2023 11:11:57 +0100 Subject: update deps Former-commit-id: 3d3e2d8a42f801e4a2629654b5eb17e575b65fda --- dependencies.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 7b71b56b4a..a7ccd5f4a5 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,13 +1,13 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.88:dev') - api("com.github.GTNewHorizons:TecTech:5.3.14:dev") + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.91:dev') + api("com.github.GTNewHorizons:TecTech:5.3.15:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } api("com.github.GTNewHorizons:Avaritia:1.46:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.10.11-GTNH:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.10.12-GTNH:dev") compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.24-pre:dev") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.19-GTNH:api") {transitive = false} -- cgit From 51f1ab80f88847f2a41e4b912f541266a9cdf36d Mon Sep 17 00:00:00 2001 From: bombcar Date: Wed, 29 Nov 2023 23:32:41 -0600 Subject: remove unused ASM (#371) * remove unused ASM * accidentally removed too much * Remove RWG ASM * spotlessApply --------- Co-authored-by: Caedis Co-authored-by: GitHub GTNH Actions Former-commit-id: ea5a2a8199749234e1e144c9f326ddd1b23e30c8 --- README.md | 4 +- repositories.gradle | 12 -- .../bartworks/ASM/BWCoreTransformer.java | 211 ++------------------- .../bartworks/common/configs/ConfigHandler.java | 4 +- 4 files changed, 21 insertions(+), 210 deletions(-) diff --git a/README.md b/README.md index 4a8479f856..a18852bc19 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ Any issues with this code should be reported to the [GTNH GitHub](https://github ## License -GTNH modifications Copyright (c) 2021-2022 The GTNH Team +GTNH modifications Copyright (c) 2021-2024 The GTNH Team This code is licensed LGPL v3.0 or later. Feel free to use our changes, just give back any changes you make to the community as well! -Original code Copyright (c) bartimaeusnek 2018-2020 and was released under the MIT license. \ No newline at end of file +Original code Copyright (c) bartimaeusnek 2018-2020 and was released under the MIT license. diff --git a/repositories.gradle b/repositories.gradle index 40118b1677..c227b16ec2 100644 --- a/repositories.gradle +++ b/repositories.gradle @@ -1,16 +1,4 @@ // Add any additional repositories for your dependencies here repositories { - ivy { - url 'https://files.vexatos.com/' - patternLayout { - artifact "[module]/[artifact]-[revision](-[classifier])(.[ext])" - } - content { - includeGroup("TGregworks") - } - metadataSources { - artifact() - } - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java index 794fd2881f..095273676b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java @@ -18,21 +18,12 @@ import static org.objectweb.asm.Opcodes.ACONST_NULL; import static org.objectweb.asm.Opcodes.ALOAD; import static org.objectweb.asm.Opcodes.ARETURN; import static org.objectweb.asm.Opcodes.GETFIELD; -import static org.objectweb.asm.Opcodes.GETSTATIC; -import static org.objectweb.asm.Opcodes.GOTO; import static org.objectweb.asm.Opcodes.ICONST_0; -import static org.objectweb.asm.Opcodes.IFEQ; import static org.objectweb.asm.Opcodes.IFNE; -import static org.objectweb.asm.Opcodes.IF_ICMPGE; -import static org.objectweb.asm.Opcodes.ILOAD; -import static org.objectweb.asm.Opcodes.INSTANCEOF; import static org.objectweb.asm.Opcodes.INVOKESTATIC; import static org.objectweb.asm.Opcodes.INVOKEVIRTUAL; -import static org.objectweb.asm.Opcodes.IREM; import static org.objectweb.asm.Opcodes.IRETURN; -import static org.objectweb.asm.Opcodes.ISTORE; import static org.objectweb.asm.Opcodes.POP; -import static org.objectweb.asm.Opcodes.SIPUSH; import java.util.Arrays; import java.util.List; @@ -46,34 +37,25 @@ import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.FieldInsnNode; import org.objectweb.asm.tree.InsnList; import org.objectweb.asm.tree.InsnNode; -import org.objectweb.asm.tree.IntInsnNode; import org.objectweb.asm.tree.JumpInsnNode; import org.objectweb.asm.tree.LabelNode; -import org.objectweb.asm.tree.LdcInsnNode; import org.objectweb.asm.tree.MethodInsnNode; import org.objectweb.asm.tree.MethodNode; -import org.objectweb.asm.tree.TypeInsnNode; import org.objectweb.asm.tree.VarInsnNode; public class BWCoreTransformer implements IClassTransformer { - public static final String[] DESCRIPTIONFORCONFIG = { "REMOVING RAIN FROM LAST MILLENIUM (EXU)", - "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS", + public static final String[] DESCRIPTIONFORCONFIG = { "REMOVING RAIN FROM LAST MILLENNIUM (EXU)", + "REMOVING CREATURES FROM LAST MILLENNIUM (EXU)", "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", - "[UNUSED] PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API", "DUCTTAPING RWG WORLDEN FAILS", - "PATCHING CRAFTING MANAGER FOR CACHING RECIPES" - // "REMOVING 12% BONUS OUTPUTS FROM GT++ SIFTER" - }; - public static final String[] CLASSESBEEINGTRANSFORMED = { + "PATCHING CRAFTING MANAGER FOR CACHING RECIPES" }; + public static final String[] CLASSESBEINGTRANSFORMED = { "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", - "net.minecraft.client.renderer.RenderGlobal", "thaumcraft.common.tiles.TileWandPedestal", "gregtech.GT_Mod", - "rwg.world.ChunkGeneratorRealistic", "net.minecraft.item.crafting.CraftingManager" - // "gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialSifter" - }; + "thaumcraft.common.tiles.TileWandPedestal", "net.minecraft.item.crafting.CraftingManager" }; static boolean obfs; - public static boolean[] shouldTransform = new boolean[BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length]; + public static boolean[] shouldTransform = new boolean[BWCoreTransformer.CLASSESBEINGTRANSFORMED.length]; /** * Made by DarkShaddow44 @@ -121,7 +103,7 @@ public class BWCoreTransformer implements IClassTransformer { return basicClass; } - if (id < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length) { + if (id < BWCoreTransformer.CLASSESBEINGTRANSFORMED.length) { BWCore.BWCORE_LOG.info(BWCoreTransformer.DESCRIPTIONFORCONFIG[id]); ClassReader classReader = new ClassReader(basicClass); ClassNode classNode = new ClassNode(); @@ -129,7 +111,7 @@ public class BWCoreTransformer implements IClassTransformer { List methods = classNode.methods; scase: switch (id) { case 0: { - BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEINGTRANSFORMED[id]); String name_deObfs = "canDoRainSnowIce"; String dsc_deObfs = "(Lnet/minecraft/world/chunk/Chunk;)Z"; @@ -152,7 +134,7 @@ public class BWCoreTransformer implements IClassTransformer { break; } case 1: { - BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEINGTRANSFORMED[id]); String name_deObfs = "getPossibleCreatures"; String name_src = "func_73155_a"; String name_Obfs = "a"; @@ -176,127 +158,7 @@ public class BWCoreTransformer implements IClassTransformer { } } case 2: { - String name_deObfs = "renderSky"; - String name_src = "func_72714_a"; - String name_Obfs = "a"; - String dsc_universal = "(F)V"; - String field_deObfs = "locationSunPng"; - String field_src = "field_110928_i"; - BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - for (MethodNode toPatch : methods) { - if (ASMUtils.isCorrectMethod(toPatch, name_deObfs, name_Obfs, name_src) - && ASMUtils.isCorrectMethod(toPatch, dsc_universal)) { - BWCore.BWCORE_LOG.info("Found " + name_deObfs + "! Patching!"); - InsnList nu = new InsnList(); - LabelNode[] LabelNodes = { new LabelNode(), new LabelNode() }; - - String theWorld_src = "field_72769_h"; - String renderEngine_src = "field_72770_i"; - String provider_src = "field_73011_w"; - String bindTexture_src = "func_110577_a"; - String nameFieldToPatch; - - for (int j = 0; j < toPatch.instructions.size(); j++) { - if (toPatch.instructions.get(j) instanceof FieldInsnNode - && toPatch.instructions.get(j).getOpcode() == GETSTATIC - && !(nameFieldToPatch = ASMUtils.matchAny( - ((FieldInsnNode) toPatch.instructions.get(j)).name, - field_deObfs, - field_src)).isEmpty()) { - boolean useSrc = nameFieldToPatch.equals(field_src); - if (useSrc) BWCore.BWCORE_LOG.info( - "Found either Optifine or Fastcraft... this patch was annoying to make compatible to them..."); - - nu.add(new VarInsnNode(ALOAD, 0)); - nu.add( - new FieldInsnNode( - GETFIELD, - "net/minecraft/client/renderer/RenderGlobal", - useSrc ? theWorld_src : "theWorld", - "Lnet/minecraft/client/multiplayer/WorldClient;")); - nu.add( - new FieldInsnNode( - GETFIELD, - "net/minecraft/client/multiplayer/WorldClient", - useSrc ? provider_src : "provider", - "Lnet/minecraft/world/WorldProvider;")); - nu.add( - new TypeInsnNode( - INSTANCEOF, - "com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace")); - nu.add(new JumpInsnNode(IFEQ, LabelNodes[0])); - nu.add(new VarInsnNode(ALOAD, 0)); - nu.add( - new FieldInsnNode( - GETFIELD, - "net/minecraft/client/renderer/RenderGlobal", - useSrc ? renderEngine_src : "renderEngine", - "Lnet/minecraft/client/renderer/texture/TextureManager;")); - nu.add( - new FieldInsnNode( - GETSTATIC, - "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b", - "sunTex", - "Lnet/minecraft/util/ResourceLocation;")); - nu.add( - new MethodInsnNode( - INVOKEVIRTUAL, - "net/minecraft/client/renderer/texture/TextureManager", - useSrc ? bindTexture_src : "bindTexture", - "(Lnet/minecraft/util/ResourceLocation;)V", - false)); - nu.add(new JumpInsnNode(GOTO, LabelNodes[1])); - nu.add(LabelNodes[0]); - nu.add(new VarInsnNode(ALOAD, 0)); - nu.add( - new FieldInsnNode( - GETFIELD, - "net/minecraft/client/renderer/RenderGlobal", - useSrc ? renderEngine_src : "renderEngine", - "Lnet/minecraft/client/renderer/texture/TextureManager;")); - nu.add( - new FieldInsnNode( - GETSTATIC, - "net/minecraft/client/renderer/RenderGlobal", - useSrc ? field_src : "locationSunPng", - "Lnet/minecraft/util/ResourceLocation;")); - nu.add( - new MethodInsnNode( - INVOKEVIRTUAL, - "net/minecraft/client/renderer/texture/TextureManager", - useSrc ? bindTexture_src : "bindTexture", - "(Lnet/minecraft/util/ResourceLocation;)V", - false)); - nu.add(LabelNodes[1]); - j++; - - } else { - if (j < toPatch.instructions.size() - 2) { - if (toPatch.instructions.get(j + 2) instanceof FieldInsnNode - && toPatch.instructions.get(j + 2).getOpcode() == GETSTATIC - && !ASMUtils.matchAny( - ((FieldInsnNode) toPatch.instructions.get(j + 2)).name, - field_deObfs, - field_src).isEmpty()) - continue; - if (toPatch.instructions.get(j + 1) instanceof FieldInsnNode - && toPatch.instructions.get(j + 1).getOpcode() == GETSTATIC - && !ASMUtils.matchAny( - ((FieldInsnNode) toPatch.instructions.get(j + 1)).name, - field_deObfs, - field_src).isEmpty()) - continue; - } - nu.add(toPatch.instructions.get(j)); - } - } - toPatch.instructions = nu; - break scase; - } - } - } - case 3: { - BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEINGTRANSFORMED[id]); String name_deObfs = "updateEntity"; String name_src = "func_145845_h"; String name_Obfs = "h"; @@ -311,47 +173,8 @@ public class BWCoreTransformer implements IClassTransformer { } } } - case 4: { - break; - } - case 5: { - BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - String name_deObfs = "getNewNoise"; - for (MethodNode toPatch : methods) { - if (ASMUtils.isCorrectMethod(toPatch, name_deObfs)) { - BWCore.BWCORE_LOG.info("Found " + name_deObfs + "! Patching!"); - LabelNode[] LabelNodes = { new LabelNode(), new LabelNode() }; - InsnList nu = new InsnList(); - // if (x < -28675) x %= -28675; - nu.add(new VarInsnNode(ILOAD, 2)); - nu.add(new IntInsnNode(SIPUSH, -28675)); - nu.add(new JumpInsnNode(IF_ICMPGE, LabelNodes[0])); - nu.add(new VarInsnNode(ILOAD, 2)); - nu.add(new LdcInsnNode(-28675)); - nu.add(new InsnNode(IREM)); - nu.add(new VarInsnNode(ISTORE, 2)); - nu.add(LabelNodes[0]); - // if (y < -28675) y %= -28675; - nu.add(new VarInsnNode(ILOAD, 3)); - nu.add(new IntInsnNode(SIPUSH, -28675)); - nu.add(new JumpInsnNode(IF_ICMPGE, LabelNodes[1])); - nu.add(new VarInsnNode(ILOAD, 3)); - nu.add(new LdcInsnNode(-28675)); - nu.add(new InsnNode(IREM)); - nu.add(new VarInsnNode(ISTORE, 3)); - nu.add(LabelNodes[1]); - - for (int j = 1; j < toPatch.instructions.size(); j++) { - nu.add(toPatch.instructions.get(j)); - } - - toPatch.instructions = nu; - break scase; - } - } - } - case 6: { - BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + case 3: { + BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEINGTRANSFORMED[id]); String name_deObfs = "findMatchingRecipe"; String name_Obfs = "a"; String name_src = "func_82787_a"; @@ -377,7 +200,7 @@ public class BWCoreTransformer implements IClassTransformer { } default: { - BWCore.BWCORE_LOG.info("Could not find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + BWCore.BWCORE_LOG.info("Could not find: " + BWCoreTransformer.CLASSESBEINGTRANSFORMED[id]); return basicClass; } } @@ -387,7 +210,7 @@ public class BWCoreTransformer implements IClassTransformer { classNode.accept(classWriter); byte[] ret = classWriter.toByteArray(); if (Arrays.hashCode(basicClass) == Arrays.hashCode(ret)) - BWCore.BWCORE_LOG.warn("Could not patch: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + BWCore.BWCORE_LOG.warn("Could not patch: " + BWCoreTransformer.CLASSESBEINGTRANSFORMED[id]); return ret; } return basicClass; @@ -395,9 +218,9 @@ public class BWCoreTransformer implements IClassTransformer { @Override public byte[] transform(String name, String transformedName, byte[] basicClass) { - for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) { - if (name.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i]) - || transformedName.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i])) + for (int i = 0; i < BWCoreTransformer.CLASSESBEINGTRANSFORMED.length; i++) { + if (name.equalsIgnoreCase(BWCoreTransformer.CLASSESBEINGTRANSFORMED[i]) + || transformedName.equalsIgnoreCase(BWCoreTransformer.CLASSESBEINGTRANSFORMED[i])) return BWCoreTransformer.transform(i, basicClass); } return basicClass; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index e710f15df7..4644775cdb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -239,11 +239,11 @@ public class ConfigHandler { API_ConfigValues.debugLog = ConfigHandler.c .get("System", "Enable Debug Log", false, "Enables or Disables the debug log.").getBoolean(false); - for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) + for (int i = 0; i < BWCoreTransformer.CLASSESBEINGTRANSFORMED.length; i++) BWCoreTransformer.shouldTransform[i] = ConfigHandler.c.get( "ASM fixes", BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " - + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i], + + BWCoreTransformer.CLASSESBEINGTRANSFORMED[i], true).getBoolean(true); ConfigHandler.enabledPatches = new boolean[BWCoreTransformer.shouldTransform.length]; -- cgit From ff31f1ea9d0172fae012da6f76c0ef5c29611110 Mon Sep 17 00:00:00 2001 From: Pelotrio <45769595+Pelotrio@users.noreply.github.com> Date: Thu, 30 Nov 2023 18:01:16 +0100 Subject: Add wire cutter behavior for all missing multis (#373) Former-commit-id: 3acd0cf2b0b94383ebc8b3e3ca1dc5c7de8ffa3d --- .../tileentities/multis/GT_TileEntity_BioVat.java | 18 ++++++++++++++++++ .../multis/GT_TileEntity_CircuitAssemblyLine.java | 21 +++++++++++++++++++++ .../GT_TileEntity_ElectricImplosionCompressor.java | 17 +++++++++++++++++ .../multis/mega/GT_TileEntity_MegaOilCracker.java | 18 ++++++++++++++++++ 4 files changed, 74 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 3433464b49..62fa551434 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -33,6 +33,7 @@ import java.util.HashSet; import javax.annotation.Nullable; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -79,6 +80,7 @@ import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBase { @@ -686,4 +688,20 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa public boolean supportsBatchMode() { return true; } + + @Override + public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ) { + if (aPlayer.isSneaking()) { + batchMode = !batchMode; + if (batchMode) { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); + } else { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); + } + return true; + } + return false; + } + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index a1c3b91a5c..ea639a186c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -492,6 +492,27 @@ public class GT_TileEntity_CircuitAssemblyLine extends return true; } + @Override + public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ) { + if (!aPlayer.isSneaking()) { + if (mode == 0) return false; + inputSeparation = !inputSeparation; + GT_Utility.sendChatToPlayer( + aPlayer, + StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); + return true; + } else { + batchMode = !batchMode; + if (batchMode) { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); + } else { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); + } + return true; + } + } + @Override public boolean supportsInputSeparation() { return mode != 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 8aab42be9e..1441514d87 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -26,9 +26,11 @@ import java.util.List; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -484,6 +486,21 @@ public class GT_TileEntity_ElectricImplosionCompressor return true; } + @Override + public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ) { + if (aPlayer.isSneaking()) { + batchMode = !batchMode; + if (batchMode) { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); + } else { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); + } + return true; + } + return false; + } + @Override public boolean supportsVoidProtection() { return true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index 815b2a2496..1c82e6cbff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -32,8 +32,10 @@ import java.util.List; import javax.annotation.Nonnull; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -58,6 +60,7 @@ import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { @@ -373,6 +376,21 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa return true; } + @Override + public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ) { + if (aPlayer.isSneaking()) { + batchMode = !batchMode; + if (batchMode) { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); + } else { + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); + } + return true; + } + return false; + } + @Override public boolean supportsVoidProtection() { return true; -- cgit From 5d83fd16deacc98b7541f675da008705b7cd3bc9 Mon Sep 17 00:00:00 2001 From: bombcar Date: Thu, 30 Nov 2023 11:03:44 -0600 Subject: Remove messages for old ASM (#374) * remove messages for old ASM * leave as info Former-commit-id: e7d58468058bee3e082bf3acb26017cacca7bf8e --- src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java index 05877f42e0..54598f9478 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java @@ -58,14 +58,10 @@ public class BWCore extends DummyModContainer { public void preInit(FMLPreInitializationEvent event) { shouldTransform[0] = ConfigHandler.enabledPatches[0]; shouldTransform[1] = ConfigHandler.enabledPatches[1]; + shouldTransform[2] = ConfigHandler.enabledPatches[2]; shouldTransform[3] = ConfigHandler.enabledPatches[3]; - shouldTransform[4] = false; - shouldTransform[5] = ConfigHandler.enabledPatches[5]; - shouldTransform[6] = ConfigHandler.enabledPatches[6]; - // shouldTransform[6] = true; BWCore.BWCORE_LOG.info("Extra Utilities found and ASM Patch enabled? " + shouldTransform[0]); - BWCore.BWCORE_LOG.info("Thaumcraft found and ASM Patch enabled? " + shouldTransform[3]); - BWCore.BWCORE_LOG.info("RWG found and ASM Patch enabled? " + shouldTransform[5]); + BWCore.BWCORE_LOG.info("Thaumcraft found and ASM Patch enabled? " + shouldTransform[2]); } @Override -- cgit From 82b2fdb4d39f46fb1ab5aab25757b4720dec5f1d Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Sun, 3 Dec 2023 21:19:28 +0800 Subject: tweak cal structure code (#376) * tweak cal structure code * spotless Former-commit-id: ce2d329edb93b96dfaa624d3dff9e912cdb32a91 --- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 48 +++++++++++++++++----- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index ea639a186c..e7c9f3f7c7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -15,8 +15,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTieredMixed; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_HatchElement.Energy; import static gregtech.api.enums.GT_HatchElement.InputBus; import static gregtech.api.enums.GT_HatchElement.InputHatch; @@ -90,6 +89,8 @@ public class GT_TileEntity_CircuitAssemblyLine extends private static final String STRUCTURE_PIECE_FIRST = "first"; private static final String STRUCTURE_PIECE_NEXT = "next"; + private static final String STRUCTURE_PIECE_NEXT_HINT = "next_hint"; + private static final String STRUCTURE_PIECE_LAST = "last"; private static final int MINIMUM_CIRCUIT_ASSEMBLER_LENGTH = 5; protected static final String IMPRINT_KEY = "Type"; @@ -109,6 +110,12 @@ public class GT_TileEntity_CircuitAssemblyLine extends .addShape( STRUCTURE_PIECE_NEXT, transpose(new String[][] { { "G", "G", "G" }, { "g", "l", "g" }, { "b", "I", "b" }, })) + .addShape( + STRUCTURE_PIECE_NEXT_HINT, + transpose(new String[][] { { "G", "G", "G" }, { "g", "l", "g" }, { "b", "i", "b" }, })) + .addShape( + STRUCTURE_PIECE_LAST, + transpose(new String[][] { { "G", "G", "G" }, { "g", "l", "g" }, { "b", "o", "b" }, })) .addElement( 'G', buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class).atLeast(Energy).casingIndex(CASING_INDEX) @@ -118,13 +125,15 @@ public class GT_TileEntity_CircuitAssemblyLine extends .addElement( 'b', buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class).atLeast(InputHatch, Maintenance) - .casingIndex(CASING_INDEX).dot(2).buildAndChain(GregTech_API.sBlockCasings2, 0)) - .addElement('i', InputBus.newAny(CASING_INDEX, 3)) + .casingIndex(CASING_INDEX).dot(2).disallowOnly(ForgeDirection.EAST, ForgeDirection.WEST) + .buildAndChain(GregTech_API.sBlockCasings2, 0)) + .addElement('i', InputBus.newAny(CASING_INDEX, 3, ForgeDirection.DOWN)) .addElement( 'I', buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class).atLeast(InputHatch, InputBus, OutputBus) - .casingIndex(CASING_INDEX).dot(2).buildAndChain(GregTech_API.sBlockCasings2, 0)) - .build(); + .casingIndex(CASING_INDEX).dot(2).disallowOnly(ForgeDirection.EAST, ForgeDirection.WEST) + .buildAndChain(GregTech_API.sBlockCasings2, 0)) + .addElement('o', OutputBus.newAny(CASING_INDEX, 2, ForgeDirection.DOWN)).build(); @Override public IStructureDefinition getStructureDefinition() { @@ -440,16 +449,33 @@ public class GT_TileEntity_CircuitAssemblyLine extends public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { if (this.mMachine) return -1; int built; - built = this.survivialBuildPiece(STRUCTURE_PIECE_FIRST, stackSize, 0, 0, 0, elementBudget, env, false, true); + built = survivialBuildPiece(STRUCTURE_PIECE_FIRST, stackSize, 0, 0, 0, elementBudget, env, false, true); if (built >= 0) return built; int tLength = Math.min(stackSize.stackSize + 1, 7); - for (int i = 1; i < tLength; ++i) { - built = this - .survivialBuildPiece(STRUCTURE_PIECE_NEXT, stackSize, -i, 0, 0, elementBudget, env, false, true); + for (int i = 1; i < tLength - 1; ++i) { + built = survivialBuildPiece( + STRUCTURE_PIECE_NEXT_HINT, + stackSize, + -i, + 0, + 0, + elementBudget, + env, + false, + true); if (built >= 0) return built; } - return -1; + return survivialBuildPiece( + STRUCTURE_PIECE_LAST, + stackSize, + -(tLength - 1), + 0, + 0, + elementBudget, + env, + false, + true); } @Override -- cgit From c9c905d0547b9d6f8b7b2836f1b6dbaa8517b33d Mon Sep 17 00:00:00 2001 From: miozune Date: Mon, 4 Dec 2023 06:12:47 +0900 Subject: Migrate to new RecipeMap (#375) * Convert manual LCR recipe addition to RA2 * Remove outdated recipe addition for replicator * Remove DynamicGTRecipe constructor that is identical to super * Remove duplicated replicator recipe generation * Migrate BW recipemaps * Migrate recipe loaders * Remove enforceNobleGas No material succeeds in this method in the modpack * Apply recipe categories * Fix recipe removal code * Adjust recipe catalysts * update bs+deps+gradle * fix * fix * change back to gtnh tag --------- Co-authored-by: Martin Robertz Former-commit-id: 03486c93813e2b430ddf8eb1b33191068452db74 --- build.gradle | 23 +- dependencies.gradle | 6 +- gradle/wrapper/gradle-wrapper.jar | Bin 62076 -> 63375 bytes gradle/wrapper/gradle-wrapper.properties | 3 +- gradlew | 5 +- .../bartworks/API/AcidGenFuelAdder.java | 36 - .../bartworks/API/BioObjectAdder.java | 4 +- .../bartworks/API/BioRecipeAdder.java | 42 -- .../API/recipe/BWNBTDependantCraftingRecipe.java | 76 ++ .../bartworks/API/recipe/BacterialVatFrontend.java | 92 +++ .../bartworks/API/recipe/BartWorksRecipeMaps.java | 64 ++ .../bartworks/API/recipe/DynamicGTRecipe.java | 34 + .../bartworks/API/recipe/RadioHatchFrontend.java | 45 ++ .../github/bartimaeusnek/bartworks/MainMod.java | 6 +- .../common/loaders/ArtificialMicaLine.java | 27 +- .../bartworks/common/loaders/BioRecipeLoader.java | 4 +- .../ElectricImplosionCompressorRecipes.java | 4 +- .../bartworks/common/loaders/FluidLoader.java | 4 +- .../common/loaders/StaticRecipeChangeLoaders.java | 122 +--- .../common/loaders/recipes/Assembler.java | 39 +- .../common/loaders/recipes/Autoclave.java | 6 +- .../common/loaders/recipes/Centrifuge.java | 22 +- .../common/loaders/recipes/ChemicalBath.java | 16 +- .../common/loaders/recipes/Electrolyzer.java | 27 +- .../common/loaders/recipes/Extractor.java | 6 +- .../common/loaders/recipes/FluidHeater.java | 4 +- .../common/loaders/recipes/FluidSolidifier.java | 22 +- .../common/loaders/recipes/FormingPress.java | 14 +- .../common/loaders/recipes/LaserEngraver.java | 4 +- .../bartworks/common/loaders/recipes/Mixer.java | 8 +- .../common/loaders/recipes/Pulverizer.java | 22 +- .../tileentities/multis/GT_TileEntity_BioVat.java | 7 +- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 21 +- .../GT_TileEntity_ElectricImplosionCompressor.java | 7 +- .../tileentities/multis/GT_TileEntity_HTGR.java | 28 +- .../multis/GT_TileEntity_Windmill.java | 5 +- .../mega/GT_TileEntity_MegaBlastFurnace.java | 13 +- .../mega/GT_TileEntity_MegaChemicalReactor.java | 7 +- .../mega/GT_TileEntity_MegaDistillTower.java | 12 +- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 15 +- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 7 +- .../tiered/GT_MetaTileEntity_AcidGenerator.java | 8 +- .../tiered/GT_MetaTileEntity_BioLab.java | 8 +- .../tiered/GT_MetaTileEntity_RadioHatch.java | 22 +- .../bartworks/neiHandler/BW_NEI_BioLabHandler.java | 8 +- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 8 +- .../bartworks/neiHandler/IMCForNEI.java | 59 -- .../bartworks/neiHandler/NEI_BW_Config.java | 7 +- .../system/material/BW_MetaGeneratedFrames.java | 4 +- .../material/CircuitGeneration/BW_Meta_Items.java | 10 +- .../CircuitGeneration/CircuitImprintLoader.java | 29 +- .../CircuitGeneration/CircuitPartLoader.java | 4 +- .../GT_Enhancement/GTMetaItemEnhancer.java | 10 +- .../GT_Enhancement/PlatinumSludgeOverHaul.java | 79 ++- .../material/processingLoaders/AddSomeRecipes.java | 10 +- .../processingLoaders/AdditionalRecipes.java | 258 +++---- .../material/processingLoaders/DownTierLoader.java | 13 +- .../werkstoff_loaders/recipe/BlockLoader.java | 13 +- .../werkstoff_loaders/recipe/CasingLoader.java | 6 +- .../werkstoff_loaders/recipe/CellLoader.java | 31 +- .../recipe/CraftingMaterialLoader.java | 50 +- .../werkstoff_loaders/recipe/CrushedLoader.java | 38 +- .../werkstoff_loaders/recipe/DustLoader.java | 91 +-- .../werkstoff_loaders/recipe/GemLoader.java | 64 +- .../werkstoff_loaders/recipe/MetalLoader.java | 22 +- .../werkstoff_loaders/recipe/MoltenCellLoader.java | 61 +- .../recipe/MultipleMetalLoader.java | 10 +- .../werkstoff_loaders/recipe/OreLoader.java | 4 +- .../recipe/SimpleMetalLoader.java | 44 +- .../werkstoff_loaders/recipe/ToolLoader.java | 22 +- .../registration/BridgeMaterialsLoader.java | 28 +- .../bartimaeusnek/bartworks/util/BWRecipes.java | 767 +-------------------- .../bartimaeusnek/bartworks/util/StreamUtils.java | 11 +- .../resources/assets/bartworks/lang/de_DE.lang | 13 +- .../resources/assets/bartworks/lang/en_US.lang | 16 +- .../resources/assets/bartworks/lang/fr_FR.lang | 12 +- .../resources/assets/bartworks/lang/zh_CN.lang | 12 +- 77 files changed, 1041 insertions(+), 1720 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BWNBTDependantCraftingRecipe.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BacterialVatFrontend.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BartWorksRecipeMaps.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/DynamicGTRecipe.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/RadioHatchFrontend.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java diff --git a/build.gradle b/build.gradle index 4e31dc883b..8507c7dfbd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1700844281 +//version: 1701530445 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -28,27 +28,12 @@ import java.util.concurrent.TimeUnit buildscript { repositories { - mavenCentral() - - maven { - name 'forge' - url 'https://maven.minecraftforge.net' - } maven { // GTNH RetroFuturaGradle and ASM Fork name "GTNH Maven" url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" allowInsecureProtocol = true } - maven { - name 'sonatype' - url 'https://oss.sonatype.org/content/repositories/snapshots/' - } - maven { - name 'Scala CI dependencies' - url 'https://repo1.maven.org/maven2/' - } - mavenLocal() } } @@ -793,12 +778,12 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies" } dependencies { - def lwjgl3ifyVersion = '1.5.1' + def lwjgl3ifyVersion = '1.5.7' if (modId != 'lwjgl3ify') { java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") } if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.17') + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.35') } java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false} @@ -1310,7 +1295,7 @@ def addCurseForgeRelation(String type, String name) { // Updating -def buildscriptGradleVersion = "8.2.1" +def buildscriptGradleVersion = "8.5" tasks.named('wrapper', Wrapper).configure { gradleVersion = buildscriptGradleVersion diff --git a/dependencies.gradle b/dependencies.gradle index a7ccd5f4a5..ccee4a1063 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,14 +1,14 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.91:dev') - api("com.github.GTNewHorizons:TecTech:5.3.15:dev") + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.96:dev') + api("com.github.GTNewHorizons:TecTech:5.3.18:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } api("com.github.GTNewHorizons:Avaritia:1.46:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.10.12-GTNH:dev") - compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.24-pre:dev") {transitive = false} + compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.25-pre:dev") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.19-GTNH:api") {transitive = false} } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a79e2..033e24c4cd 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 17a8ddce2d..1af9e0930b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index aeb74cbb43..fcb6fca147 100755 --- a/gradlew +++ b/gradlew @@ -130,10 +130,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java deleted file mode 100644 index 1e254993d4..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.API; - -import net.minecraftforge.fluids.FluidStack; - -import com.github.bartimaeusnek.bartworks.util.BWRecipes; - -import gregtech.api.enums.Materials; - -public final class AcidGenFuelAdder { - - public static void addLiquidFuel(Materials M, int burn) { - ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(M, burn); - } - - public static void addLiquidFuel(FluidStack fluidStack, int burn) { - ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)) - .addLiquidFuel(fluidStack, burn); - } - - public static void addMoltenFuel(Materials M, int burn) { - ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addMoltenFuel(M, burn); - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java index fc09d943bc..4d28c5fb46 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -14,7 +14,7 @@ package com.github.bartimaeusnek.bartworks.API; import static gregtech.api.enums.Mods.Gendustry; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; +import static gregtech.api.recipe.RecipeMaps.centrifugeRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import java.awt.Color; @@ -177,7 +177,7 @@ public final class BioObjectAdder { GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)) .fluidInputs(new FluidStack(B.getFluid(), 1000)).fluidOutputs(dnaFluid).duration(25 * SECONDS) - .eut(TierEU.RECIPE_MV).addTo(sCentrifugeRecipes); + .eut(TierEU.RECIPE_MV).addTo(centrifugeRecipes); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java index 527b62bae3..b1e3fb25df 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java @@ -123,46 +123,4 @@ public final class BioRecipeAdder { aSpecialValue, exactSv); } - - // public static boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] - // aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSievert) { - // return BWRecipes.instance.addBacterialVatRecipe(aInputs, aOutputs, aFluidInputs, aFluidOutputs, aDuration, - // aEUt, aSievert); - // } - - // @Deprecated - // public static boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, - // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ - // return BWRecipes.instance.addBioLabRecipeDNAExtraction(aInputs, aOutput, aChances, aFluidInputs, - // aFluidOutputs, aDuration, aEUt, aSpecialValue); - // } - // - // @Deprecated - // public static boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, - // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ - // return BWRecipes.instance.addBioLabRecipePCRThermoclycling(aInputs, aOutput, aChances, aFluidInputs, - // aFluidOutputs, aDuration, aEUt, aSpecialValue); - // } - // - // @Deprecated - // public static boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, - // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ - // return BWRecipes.instance.addBioLabRecipePlasmidSynthesis(aInputs, aOutput, aChances, aFluidInputs, - // aFluidOutputs, aDuration, aEUt, aSpecialValue); - // } - // - // @Deprecated - // public static boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, - // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ - // return BWRecipes.instance.addBioLabRecipeTransformation(aInputs, aOutput, aChances, aFluidInputs, - // aFluidOutputs, aDuration, aEUt, aSpecialValue); - // } - // - // @Deprecated - // public static boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] - // aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ - // return BWRecipes.instance.addBioLabRecipeClonalCellularSynthesis(aInputs, aOutput, aChances, aFluidInputs, - // aFluidOutputs, aDuration, aEUt, aSpecialValue); - // } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BWNBTDependantCraftingRecipe.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BWNBTDependantCraftingRecipe.java new file mode 100644 index 0000000000..dfcf94115a --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BWNBTDependantCraftingRecipe.java @@ -0,0 +1,76 @@ +package com.github.bartimaeusnek.bartworks.API.recipe; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.world.World; + +import com.github.bartimaeusnek.bartworks.util.BW_Util; + +public class BWNBTDependantCraftingRecipe implements IRecipe { + + ItemStack result; + Map charToStackMap = new HashMap<>(9, 1); + String[] shape; + + @SuppressWarnings({ "SuspiciousSystemArraycopy" }) + public BWNBTDependantCraftingRecipe(ItemStack result, Object... recipe) { + this.result = result; + this.shape = new String[3]; + System.arraycopy(recipe, 0, this.shape, 0, 3); + this.charToStackMap.put(' ', null); + for (int i = 3; i < recipe.length; i += 2) { + this.charToStackMap.put((char) recipe[i], ((ItemStack) recipe[i + 1]).copy()); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof BWNBTDependantCraftingRecipe that)) return false; + + if (!Objects.equals(this.result, that.result) || !Objects.equals(this.charToStackMap, that.charToStackMap)) + return false; + // Probably incorrect - comparing Object[] arrays with Arrays.equals + return Arrays.equals(this.shape, that.shape); + } + + @Override + public int hashCode() { + int result1 = this.result != null ? this.result.hashCode() : 0; + result1 = 31 * result1 + (this.charToStackMap != null ? this.charToStackMap.hashCode() : 0); + return 31 * result1 + Arrays.hashCode(this.shape); + } + + @Override + public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) { + for (int x = 0; x < 3; x++) { + for (int y = 0; y < 3; y++) { + ItemStack toCheck = p_77569_1_.getStackInRowAndColumn(y, x); + ItemStack ref = this.charToStackMap.get(this.shape[x].toCharArray()[y]); + if (!BW_Util.areStacksEqualOrNull(toCheck, ref)) return false; + } + } + return true; + } + + @Override + public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) { + return this.result.copy(); + } + + @Override + public int getRecipeSize() { + return 10; + } + + @Override + public ItemStack getRecipeOutput() { + return this.result; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BacterialVatFrontend.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BacterialVatFrontend.java new file mode 100644 index 0000000000..6ed4113017 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BacterialVatFrontend.java @@ -0,0 +1,92 @@ +package com.github.bartimaeusnek.bartworks.API.recipe; + +import java.util.Arrays; +import java.util.List; + +import javax.annotation.ParametersAreNonnullByDefault; + +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; + +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; +import com.gtnewhorizons.modularui.api.math.Alignment; + +import gregtech.api.recipe.BasicUIPropertiesBuilder; +import gregtech.api.recipe.NEIRecipePropertiesBuilder; +import gregtech.api.recipe.RecipeMapFrontend; +import gregtech.api.util.MethodsReturnNonnullByDefault; +import gregtech.nei.GT_NEI_DefaultHandler; +import gregtech.nei.RecipeDisplayInfo; +import gregtech.nei.formatter.INEISpecialInfoFormatter; + +@ParametersAreNonnullByDefault +@MethodsReturnNonnullByDefault +public class BacterialVatFrontend extends RecipeMapFrontend { + + public BacterialVatFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder, + NEIRecipePropertiesBuilder neiPropertiesBuilder) { + super( + uiPropertiesBuilder, + neiPropertiesBuilder.neiSpecialInfoFormatter(new BacterialVatSpecialValueFormatter())); + } + + @Override + protected List handleNEIItemInputTooltip(List currentTip, + GT_NEI_DefaultHandler.FixedPositionedStack pStack) { + if (pStack.isFluid()) { + currentTip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("nei.biovat.input.tooltip")); + return currentTip; + } + return super.handleNEIItemInputTooltip(currentTip, pStack); + } + + @Override + protected List handleNEIItemOutputTooltip(List currentTip, + GT_NEI_DefaultHandler.FixedPositionedStack pStack) { + if (pStack.isFluid()) { + currentTip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("nei.biovat.output.tooltip")); + return currentTip; + } + return super.handleNEIItemOutputTooltip(currentTip, pStack); + } + + @Override + protected void drawNEIOverlayForInput(GT_NEI_DefaultHandler.FixedPositionedStack stack) { + drawFluidOverlay(stack); + } + + @Override + protected void drawNEIOverlayForOutput(GT_NEI_DefaultHandler.FixedPositionedStack stack) { + drawFluidOverlay(stack); + } + + private void drawFluidOverlay(GT_NEI_DefaultHandler.FixedPositionedStack stack) { + if (stack.isFluid()) { + drawNEIOverlayText( + "+", + stack, + colorOverride.getTextColorOrDefault("nei_overlay_yellow", 0xFDD835), + 0.5f, + true, + Alignment.TopRight); + return; + } + super.drawNEIOverlayForOutput(stack); + } + + private static class BacterialVatSpecialValueFormatter implements INEISpecialInfoFormatter { + + @Override + public List format(RecipeDisplayInfo recipeInfo) { + int[] tSpecialA = GT_TileEntity_BioVat.specialValueUnpack(recipeInfo.recipe.mSpecialValue); + String glassTier = StatCollector.translateToLocalFormatted("nei.biovat.0.name", tSpecialA[0]); + String sievert; + if (tSpecialA[2] == 1) { + sievert = StatCollector.translateToLocalFormatted("nei.biovat.1.name", tSpecialA[3]); + } else { + sievert = StatCollector.translateToLocalFormatted("nei.biovat.2.name", tSpecialA[3]); + } + return Arrays.asList(glassTier, sievert); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BartWorksRecipeMaps.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BartWorksRecipeMaps.java new file mode 100644 index 0000000000..97fa74bf85 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BartWorksRecipeMaps.java @@ -0,0 +1,64 @@ +package com.github.bartimaeusnek.bartworks.API.recipe; + +import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; + +import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.recipe.RecipeMap; +import gregtech.api.recipe.RecipeMapBackend; +import gregtech.api.recipe.RecipeMapBuilder; +import gregtech.api.recipe.maps.FuelBackend; +import gregtech.nei.formatter.FuelSpecialValueFormatter; + +public class BartWorksRecipeMaps { + + public static final RecipeMap bioLabRecipes = RecipeMapBuilder.of("bw.recipe.biolab") + .maxIO(6, 2, 1, 0).minInputs(1, 1).useSpecialSlot().slotOverlays((index, isFluid, isOutput, isSpecial) -> { + if (isSpecial) { + return BW_UITextures.OVERLAY_SLOT_MODULE; + } + if (isFluid) { + return GT_UITextures.OVERLAY_SLOT_VIAL_2; + } + if (!isOutput) { + switch (index) { + case 0: + return BW_UITextures.OVERLAY_SLOT_DISH; + case 1: + return BW_UITextures.OVERLAY_SLOT_DNA_FLASK; + case 2: + return GT_UITextures.OVERLAY_SLOT_CIRCUIT; + case 3: + return GT_UITextures.OVERLAY_SLOT_MOLECULAR_1; + case 4: + return GT_UITextures.OVERLAY_SLOT_MOLECULAR_2; + case 5: + return GT_UITextures.OVERLAY_SLOT_DATA_ORB; + } + } + return null; + }).progressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE).logo(BW_UITextures.PICTURE_BW_LOGO_47X21) + .logoSize(47, 21).logoPos(125, 3).disableRegisterNEI().build(); + public static final RecipeMap bacterialVatRecipes = RecipeMapBuilder.of("bw.recipe.BacteriaVat") + .maxIO(6, 2, 1, 1).minInputs(0, 1).useSpecialSlot().specialSlotSensitive() + .progressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE).frontend(BacterialVatFrontend::new) + .disableRegisterNEI().build(); + public static final RecipeMap acidGenFuels = RecipeMapBuilder.of("bw.fuels.acidgens", FuelBackend::new) + .maxIO(1, 1, 0, 0).neiSpecialInfoFormatter(FuelSpecialValueFormatter.INSTANCE).build(); + public static final RecipeMap circuitAssemblyLineRecipes = RecipeMapBuilder.of("bw.recipe.cal") + .maxIO(6, 1, 1, 0).minInputs(1, 1).useSpecialSlot().specialSlotSensitive() + .progressBar(GT_UITextures.PROGRESSBAR_CIRCUIT_ASSEMBLER).build(); + public static final RecipeMap radioHatchRecipes = RecipeMapBuilder.of("bw.recipe.radhatch") + .maxIO(1, 0, 0, 0).minInputs(1, 0) + .slotOverlays((index, isFluid, isOutput, isSpecial) -> BW_UITextures.OVERLAY_SLOT_ROD) + .logo(BW_UITextures.PICTURE_BW_LOGO_47X21).logoSize(47, 21).logoPos(118, 55).dontUseProgressBar() + .addSpecialTexture(74, 20, 29, 27, BW_UITextures.PICTURE_RADIATION).frontend(RadioHatchFrontend::new) + .build(); + public static final RecipeMap electricImplosionCompressorRecipes = RecipeMapBuilder + .of("gt.recipe.electricimplosioncompressor").maxIO(6, 2, 1, 1) + .slotOverlays( + (index, isFluid, isOutput, + isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_IMPLOSION : null) + .progressBar(GT_UITextures.PROGRESSBAR_COMPRESS).build(); + public static final RecipeMap htgrFakeRecipes = RecipeMapBuilder.of("bw.recipe.htgr") + .maxIO(1, 1, 0, 0).build(); +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/DynamicGTRecipe.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/DynamicGTRecipe.java new file mode 100644 index 0000000000..3087255e51 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/DynamicGTRecipe.java @@ -0,0 +1,34 @@ +package com.github.bartimaeusnek.bartworks.API.recipe; + +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import com.github.bartimaeusnek.bartworks.MainMod; + +import gregtech.api.util.GT_Recipe; + +public class DynamicGTRecipe extends GT_Recipe { + + public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, + int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue, GT_Recipe originalRecipe) { + super( + aOptimize, + aInputs, + aOutputs, + aSpecialItems, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue); + if (originalRecipe != null) { + this.owners = new ArrayList<>(originalRecipe.owners); + this.stackTraces = new ArrayList<>(originalRecipe.stackTraces); + this.setOwner(MainMod.MOD_ID); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/RadioHatchFrontend.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/RadioHatchFrontend.java new file mode 100644 index 0000000000..0309a676d9 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/RadioHatchFrontend.java @@ -0,0 +1,45 @@ +package com.github.bartimaeusnek.bartworks.API.recipe; + +import java.util.Arrays; +import java.util.List; + +import javax.annotation.ParametersAreNonnullByDefault; + +import net.minecraft.util.StatCollector; + +import gregtech.api.recipe.BasicUIPropertiesBuilder; +import gregtech.api.recipe.NEIRecipePropertiesBuilder; +import gregtech.api.recipe.RecipeMapFrontend; +import gregtech.api.util.MethodsReturnNonnullByDefault; +import gregtech.nei.RecipeDisplayInfo; +import gregtech.nei.formatter.INEISpecialInfoFormatter; + +@ParametersAreNonnullByDefault +@MethodsReturnNonnullByDefault +public class RadioHatchFrontend extends RecipeMapFrontend { + + public RadioHatchFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder, + NEIRecipePropertiesBuilder neiPropertiesBuilder) { + super(uiPropertiesBuilder, neiPropertiesBuilder.neiSpecialInfoFormatter(new RadioHatchSpecialInfoFormatter())); + } + + @Override + protected void drawEnergyInfo(RecipeDisplayInfo recipeInfo) {} + + @Override + protected void drawDurationInfo(RecipeDisplayInfo recipeInfo) {} + + private static class RadioHatchSpecialInfoFormatter implements INEISpecialInfoFormatter { + + @Override + public List format(RecipeDisplayInfo recipeInfo) { + int radioLevel = recipeInfo.recipe.mEUt; + int amount = recipeInfo.recipe.mDuration; + long time = recipeInfo.recipe.mSpecialValue; + return Arrays.asList( + StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.0", radioLevel), + StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", amount), + StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.2", time * amount / 20.0)); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index e4a73d1996..86f33d91ef 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -52,7 +52,6 @@ import com.github.bartimaeusnek.bartworks.common.loaders.RecipeLoader; import com.github.bartimaeusnek.bartworks.common.loaders.RegisterServerCommands; import com.github.bartimaeusnek.bartworks.common.loaders.StaticRecipeChangeLoaders; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; -import com.github.bartimaeusnek.bartworks.neiHandler.IMCForNEI; import com.github.bartimaeusnek.bartworks.server.EventHandler.ServerEventHandler; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader; @@ -76,9 +75,9 @@ import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.Mods; +import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; @Mod(modid = MainMod.MOD_ID, name = MainMod.NAME, version = API_REFERENCE.VERSION, dependencies = """ required-after:IC2;\ @@ -155,7 +154,6 @@ public final class MainMod { WerkstoffLoader.runInit(); ItemRegistry.run(); - IMCForNEI.IMCSender(); } @Mod.EventHandler @@ -224,6 +222,6 @@ public final class MainMod { // StaticRecipeChangeLoaders.synchroniseCircuitUseMulti(); // Accept recipe map changes into Buffers - GT_Recipe.GT_Recipe_Map.sMappings.forEach(GT_Recipe.GT_Recipe_Map::reInit); + RecipeMap.ALL_RECIPE_MAPS.values().forEach(map -> map.getBackend().reInit()); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java index ea533e4b4b..32b366440b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java @@ -1,10 +1,10 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import static gregtech.api.enums.Mods.NewHorizonsCoreMod; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBenderRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBlastRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMixerRecipes; +import static gregtech.api.recipe.RecipeMaps.benderRecipes; +import static gregtech.api.recipe.RecipeMaps.blastFurnaceRecipes; +import static gregtech.api.recipe.RecipeMaps.fluidExtractionRecipes; +import static gregtech.api.recipe.RecipeMaps.mixerRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeBuilder.TICKS; import static gregtech.api.util.GT_RecipeConstants.COIL_HEAT; @@ -21,6 +21,7 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TierEU; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -49,7 +50,7 @@ public class ArtificialMicaLine { .itemOutputs(WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 9)) .fluidInputs(WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000)) .fluidOutputs(Materials.HydrochloricAcid.getFluid(2000)).duration(1 * SECONDS).eut(8) - .addTo(sMixerRecipes); + .addTo(mixerRecipes); // 2K + CO2 + O = K2CO3 @@ -73,7 +74,7 @@ public class ArtificialMicaLine { .itemOutputs( WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27)) - .duration(20 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sMixerRecipes); + .duration(20 * SECONDS).eut(TierEU.RECIPE_MV).addTo(mixerRecipes); // 55Quartzite/Nether Quartz Dust + 20K2SiF6 + 57Al2O3 + 4K2CO3 = 136Raw Fluorophlogopite Dust GT_Values.RA.stdBuilder() @@ -87,7 +88,7 @@ public class ArtificialMicaLine { WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8)) - .fluidInputs().fluidOutputs().duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sMixerRecipes); + .fluidInputs().fluidOutputs().duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(mixerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -100,7 +101,7 @@ public class ArtificialMicaLine { WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8)) - .duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sMixerRecipes); + .duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(mixerRecipes); // 62Certus Quartz Dust + 10K2SiF6 + 12Al2O3 + 7K2CO3 = 91Raw Fluorophlogopite Dust GT_Values.RA.stdBuilder() @@ -113,22 +114,22 @@ public class ArtificialMicaLine { .itemOutputs( WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27)) - .duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sMixerRecipes); + .duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(mixerRecipes); // MgO(s) = MgO(l) GT_Values.RA.stdBuilder().itemInputs(Materials.Magnesia.getDust(1)) .fluidOutputs(Materials.Magnesia.getMolten(144)).duration(20 * TICKS).eut(TierEU.RECIPE_MV) - .addTo(sFluidExtractionRecipes); + .addTo(fluidExtractionRecipes); // 27Raw Fluorophlogopite Dust + 720MgO(l) = 4608Fluorophlogopite(l) GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27)) .itemOutputs(Materials.Glass.getDust(1)).fluidInputs(BW_GT_MaterialReference.Magnesia.getMolten(720)) .fluidOutputs(WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(4608)).duration(30 * SECONDS) - .eut(TierEU.RECIPE_HV).metadata(COIL_HEAT, 1700).addTo(sBlastRecipes); + .eut(TierEU.RECIPE_HV).metadata(COIL_HEAT, 1700).addTo(blastFurnaceRecipes); // 144Fluorophlogopite(l) = Fluorophlogopite - GT_Recipe.GT_Recipe_Map.sVacuumRecipes.addRecipe( + RecipeMaps.vacuumFreezerRecipes.addRecipe( new GT_Recipe( false, new ItemStack[] { ItemList.Shape_Mold_Plate.get(0) }, @@ -148,7 +149,7 @@ public class ArtificialMicaLine { WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(GT_ModHandler.getModItem(NewHorizonsCoreMod.ID, "item.MicaInsulatorFoil", 4)) - .duration(10 * TICKS).eut(600).addTo(sBenderRecipes); + .duration(10 * TICKS).eut(600).addTo(benderRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index c4589c3a3f..e4f2c73e32 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -28,8 +28,8 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TierEU; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; public class BioRecipeLoader { @@ -180,7 +180,7 @@ public class BioRecipeLoader { } public static void runOnServerStarted() { - GT_Recipe.GT_Recipe_Map.sFermentingRecipes.mRecipeList.forEach( + RecipeMaps.fermentingRecipes.getAllRecipes().forEach( recipe -> BWRecipes.instance.addBacterialVatRecipe( new ItemStack[] { null }, BioCultureLoader.generalPurposeFermentingBacteria, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java index c38e9cd7c0..500dfb6faf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java @@ -11,7 +11,7 @@ import static gregtech.api.util.GT_ModHandler.getModItem; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.API.recipe.BartWorksRecipeMaps; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -26,7 +26,7 @@ public class ElectricImplosionCompressorRecipes implements Runnable { private static void addElectricImplosionRecipe(final ItemStack[] inputItems, final FluidStack[] inputFluids, final ItemStack[] outputItems, final FluidStack[] outputFluids, final int durationInTicks, final int EUPerTick) { - BWRecipes.instance.eicMap.addRecipe( + BartWorksRecipeMaps.electricImplosionCompressorRecipes.addRecipe( false, inputItems, outputItems, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 6f4b237473..0c92005f6f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -15,7 +15,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import static gregtech.api.enums.Mods.Gendustry; import static gregtech.api.enums.Mods.GregTech; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; +import static gregtech.api.recipe.RecipeMaps.centrifugeRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import java.awt.Color; @@ -96,7 +96,7 @@ public class FluidLoader { GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)) .fluidInputs(new FluidStack(B.getFluid(), 1000)).fluidOutputs(dnaFluid).duration(25 * SECONDS) - .eut(TierEU.RECIPE_MV).addTo(sCentrifugeRecipes); + .eut(TierEU.RECIPE_MV).addTo(centrifugeRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 0cba765189..a44bcf57e8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -15,7 +15,6 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.ANAEROBE_GAS; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.NOBLE_GAS; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Oganesson; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.fluids; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.molten; import static gregtech.api.enums.GT_Values.VN; @@ -24,9 +23,7 @@ import static gregtech.api.enums.Mods.TinkerConstruct; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Objects; @@ -35,15 +32,15 @@ import java.util.Set; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import org.apache.commons.lang3.StringUtils; +import com.github.bartimaeusnek.bartworks.API.recipe.BartWorksRecipeMaps; +import com.github.bartimaeusnek.bartworks.API.recipe.DynamicGTRecipe; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.StreamUtils; import com.github.bartimaeusnek.bartworks.util.log.DebugLog; @@ -59,10 +56,11 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; import gregtech.api.enums.TierEU; import gregtech.api.objects.GT_ItemStack; +import gregtech.api.recipe.RecipeMap; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; public class StaticRecipeChangeLoaders { @@ -106,8 +104,8 @@ public class StaticRecipeChangeLoaders { } public static void fixEnergyRequirements() { - GT_Recipe.GT_Recipe_Map.sMappings.stream().filter(StreamUtils::filterVisualMaps) - .forEach(gt_recipe_map -> gt_recipe_map.mRecipeList.parallelStream().forEach(gt_recipe -> { + RecipeMap.ALL_RECIPE_MAPS.values().stream().filter(StreamUtils::filterVisualMaps) + .forEach(recipeMap -> recipeMap.getAllRecipes().parallelStream().forEach(gt_recipe -> { for (int i = 0; i < VN.length - 1; i++) { if (gt_recipe.mEUt > BW_Util.getMachineVoltageFromTier(i) && gt_recipe.mEUt <= BW_Util.getTierVoltage(i)) { @@ -117,66 +115,10 @@ public class StaticRecipeChangeLoaders { })); } - private static void replaceWrongFluidOutput(Werkstoff werkstoff, GT_Recipe recipe, FluidStack wrongNamedFluid) { - for (int i = 0; i < recipe.mFluidOutputs.length; i++) { - if (GT_Utility.areFluidsEqual(recipe.mFluidOutputs[i], wrongNamedFluid)) { - recipe.mFluidOutputs[i] = werkstoff.getFluidOrGas(recipe.mFluidOutputs[i].amount); - } - } - } - - private static void replaceWrongFluidInput(Werkstoff werkstoff, GT_Recipe.GT_Recipe_Map map, GT_Recipe recipe, - FluidStack wrongNamedFluid) { - for (int i = 0; i < recipe.mFluidInputs.length; i++) { - if (GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], wrongNamedFluid)) { - Collection col = map.mRecipeFluidMap.get(wrongNamedFluid.getFluid().getName()); - map.mRecipeFluidMap.remove(wrongNamedFluid.getFluid().getName()); - map.mRecipeFluidMap.put(werkstoff.getFluidOrGas(1).getFluid().getName(), col); - recipe.mFluidInputs[i] = werkstoff.getFluidOrGas(recipe.mFluidInputs[i].amount); - map.mRecipeFluidNameMap.add(werkstoff.getFluidOrGas(1).getFluid().getName()); - } - } - } - - private static void addConversionRecipe(Werkstoff werkstoff, FluidStack wrongNamedFluid) { - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add( - new BWRecipes.DynamicGTRecipe( - false, - null, - null, - null, - null, - new FluidStack[] { wrongNamedFluid }, - new FluidStack[] { werkstoff.getFluidOrGas(1) }, - 1, - 1, - 0)); - } - - private static FluidStack getWrongNameFluid(Werkstoff werkstoff) { - String name = werkstoff.getFluidOrGas(1).getFluid().getName(); - String wrongname = "molten." + name; - return FluidRegistry.getFluidStack(wrongname, 1); - } - - private static void enforceNobleGas(Werkstoff werkstoff) { - FluidStack wrongNamedFluid = getWrongNameFluid(werkstoff); - if (wrongNamedFluid != null) { - GT_Recipe.GT_Recipe_Map.sMappings.forEach(map -> map.mRecipeList.forEach(recipe -> { - replaceWrongFluidInput(werkstoff, map, recipe, wrongNamedFluid); - replaceWrongFluidOutput(werkstoff, recipe, wrongNamedFluid); - })); - addConversionRecipe(werkstoff, wrongNamedFluid); - } - } - public static void unificationRecipeEnforcer() { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { StaticRecipeChangeLoaders.runMaterialLinker(werkstoff); if (werkstoff.getGenerationFeatures().enforceUnification) { - - if (werkstoff.contains(NOBLE_GAS)) enforceNobleGas(werkstoff); - HashSet oreDictNames = new HashSet<>(werkstoff.getADDITIONAL_OREDICT()); oreDictNames.add(werkstoff.getVarName()); StaticRecipeChangeLoaders.runMoltenUnificationEnfocement(werkstoff); @@ -193,16 +135,15 @@ public class StaticRecipeChangeLoaders { || replacement == null || replacement.getItem() == null) continue; - for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - nextRecipe: for (Iterator iterator = map.mRecipeList.iterator(); iterator - .hasNext();) { - GT_Recipe recipe = iterator.next(); - boolean removal = map.equals(GT_Recipe_Map.sFluidExtractionRecipes) - || map.equals(GT_Recipe_Map.sFluidSolidficationRecipes); + for (RecipeMap map : RecipeMap.ALL_RECIPE_MAPS.values()) { + List toRemove = new ArrayList<>(); + nextRecipe: for (GT_Recipe recipe : map.getAllRecipes()) { + boolean removal = map.equals(RecipeMaps.fluidExtractionRecipes) + || map.equals(RecipeMaps.fluidSolidifierRecipes); for (int i = 0; i < recipe.mInputs.length; i++) { if (!GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) continue; if (removal) { - iterator.remove(); + toRemove.add(recipe); continue nextRecipe; } recipe.mInputs[i] = GT_Utility.copyAmount(recipe.mInputs[i].stackSize, replacement); @@ -210,7 +151,7 @@ public class StaticRecipeChangeLoaders { for (int i = 0; i < recipe.mOutputs.length; i++) { if (!GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) continue; if (removal) { - iterator.remove(); + toRemove.add(recipe); continue nextRecipe; } recipe.mOutputs[i] = GT_Utility @@ -219,13 +160,14 @@ public class StaticRecipeChangeLoaders { if (recipe.mSpecialItems instanceof ItemStack specialItemStack) { if (!GT_Utility.areStacksEqual(specialItemStack, toReplace)) continue; if (removal) { - iterator.remove(); + toRemove.add(recipe); continue nextRecipe; } recipe.mSpecialItems = GT_Utility .copyAmount(specialItemStack.stackSize, replacement); } } + map.getBackend().removeRecipes(toRemove); } } } @@ -260,9 +202,9 @@ public class StaticRecipeChangeLoaders { sFilledContainerToData.entrySet().removeAll(toremFilledContainerToData); Set toremRecipeList = new HashSet<>(); if (toReplace != null) { - for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { + for (RecipeMap map : RecipeMap.ALL_RECIPE_MAPS.values()) { toremRecipeList.clear(); - for (GT_Recipe recipe : map.mRecipeList) { + for (GT_Recipe recipe : map.getAllRecipes()) { for (ItemStack mInput : recipe.mInputs) { if (GT_Utility.areStacksEqual(mInput, toReplace)) { toremRecipeList.add(recipe); @@ -273,7 +215,7 @@ public class StaticRecipeChangeLoaders { if (GT_Utility.areStacksEqual(mOutput, toReplace)) { toremRecipeList.add(recipe); // recipe.mOutputs[i] = data.filledContainer; - if (map == GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes + if (map == RecipeMaps.fluidCannerRecipes && GT_Utility.areStacksEqual(mOutput, data.filledContainer) && !recipe.mFluidInputs[0].equals(data.fluid)) { toremRecipeList.add(recipe); @@ -287,7 +229,7 @@ public class StaticRecipeChangeLoaders { // recipe.mSpecialItems = data.filledContainer; } } - map.mRecipeList.removeAll(toremRecipeList); + map.getBackend().removeRecipes(toremRecipeList); } } GT_Utility.addFluidContainerData(data); @@ -339,7 +281,7 @@ public class StaticRecipeChangeLoaders { */ private static ArrayListMultimap getRecipesToChange(SubTag... GasTags) { ArrayListMultimap toAdd = ArrayListMultimap.create(); - for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList) { + for (GT_Recipe recipe : RecipeMaps.blastFurnaceRecipes.getAllRecipes()) { if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) { Materials mat = getMaterialFromInputFluid(recipe); if (mat != Materials._NULL) { @@ -366,7 +308,7 @@ public class StaticRecipeChangeLoaders { private static HashSet getNoGasItems(ArrayListMultimap base) { HashSet toAdd = new HashSet<>(); ArrayListMultimap repToAdd = ArrayListMultimap.create(); - for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList) { + for (GT_Recipe recipe : RecipeMaps.blastFurnaceRecipes.getAllRecipes()) { for (SubTag tag : base.keySet()) recipeLoop: for (GT_Recipe baseRe : base.get(tag)) { if (recipe.mInputs.length == baseRe.mInputs.length && recipe.mOutputs.length == baseRe.mOutputs.length) for (int i = 0; i < recipe.mInputs.length; i++) { @@ -435,7 +377,7 @@ public class StaticRecipeChangeLoaders { && recipe.mFluidInputs[0].isFluidEqual(newGas.getGas(0))) { // preserve original recipe owner toAdd.add( - new BWRecipes.DynamicGTRecipe( + new DynamicGTRecipe( false, recipe.mInputs, recipe.mOutputs, @@ -450,7 +392,7 @@ public class StaticRecipeChangeLoaders { } else { // new recipe toAdd.add( - new BWRecipes.DynamicGTRecipe( + new GT_Recipe( false, recipe.mInputs, recipe.mOutputs, @@ -481,7 +423,7 @@ public class StaticRecipeChangeLoaders { .isFluidEqual(new FluidStack(Objects.requireNonNull(fluids.get(newGas)), 0))) { // preserve original recipe owner toAdd.add( - new BWRecipes.DynamicGTRecipe( + new DynamicGTRecipe( false, recipe.mInputs, recipe.mOutputs, @@ -497,7 +439,7 @@ public class StaticRecipeChangeLoaders { } else { // new recipe toAdd.add( - new BWRecipes.DynamicGTRecipe( + new GT_Recipe( false, recipe.mInputs, recipe.mOutputs, @@ -535,7 +477,7 @@ public class StaticRecipeChangeLoaders { } inputs.add(GT_Utility.getIntegratedCircuit(circuitConfiguration)); toAdd.add( - new BWRecipes.DynamicGTRecipe( + new DynamicGTRecipe( false, inputs.toArray(new ItemStack[0]), recipe.mOutputs, @@ -584,10 +526,6 @@ public class StaticRecipeChangeLoaders { } private static void editRecipes(ArrayListMultimap base, HashSet noGas) { - if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeFluidNameMap - .contains(Objects.requireNonNull(fluids.get(Oganesson)).getName())) - return; - HashSet toAdd = new HashSet<>(); for (SubTag gasTag : base.keySet()) { @@ -601,16 +539,16 @@ public class StaticRecipeChangeLoaders { } } } - GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.removeAll(base.get(gasTag)); + RecipeMaps.blastFurnaceRecipes.getBackend().removeRecipes(base.get(gasTag)); } removeDuplicateGasRecipes(toAdd); - toAdd.forEach(GT_Recipe.GT_Recipe_Map.sBlastRecipes::add); + toAdd.forEach(RecipeMaps.blastFurnaceRecipes::add); } public static void addElectricImplosionCompressorRecipes() { - GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream().filter(e -> e.mInputs != null).forEach( - recipe -> BWRecipes.instance.eicMap.addRecipe( + RecipeMaps.implosionRecipes.getAllRecipes().stream().filter(e -> e.mInputs != null).forEach( + recipe -> BartWorksRecipeMaps.electricImplosionCompressorRecipes.addRecipe( true, Arrays.stream(recipe.mInputs).filter(e -> !StaticRecipeChangeLoaders.checkForExplosives(e)) .distinct().toArray(ItemStack[]::new), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java index 4b676367cf..7a738c722c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java @@ -1,7 +1,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; import static gregtech.api.enums.Mods.GregTech; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; +import static gregtech.api.recipe.RecipeMaps.assemblerRecipes; import static gregtech.api.util.GT_RecipeBuilder.HOURS; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeBuilder.TICKS; @@ -47,7 +47,7 @@ public class Assembler implements Runnable { GT_Utility.getIntegratedCircuit(17)) .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1)) .fluidInputs(FluidRegistry.getFluidStack("ic2coolant", 1000)).duration(5 * SECONDS) - .eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + .eut(TierEU.RECIPE_HV).addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -55,42 +55,42 @@ public class Assembler implements Runnable { Materials.Lapis.getBlocks(8), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[1])).duration(5 * SECONDS).eut(TierEU.RECIPE_HV) - .addTo(sAssemblerRecipes); + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1000), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(ItemRegistry.megaMachines[0]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) - .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1002), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(ItemRegistry.megaMachines[1]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) - .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1126), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(ItemRegistry.megaMachines[2]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) - .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1169), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(ItemRegistry.megaMachines[3]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) - .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1160), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(ItemRegistry.megaMachines[4]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) - .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(sAssemblerRecipes); + .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -98,7 +98,7 @@ public class Assembler implements Runnable { GT_Utility.getIntegratedCircuit(17)) .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[2], 1, 1)) .fluidInputs(Materials.Plastic.getMolten(1152L)).duration(1 * TICKS).eut(TierEU.RECIPE_HV) - .addTo(sAssemblerRecipes); + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -108,7 +108,7 @@ public class Assembler implements Runnable { ItemList.Battery_RE_LV_Lithium.get(1L)) .itemOutputs(new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER)) .fluidInputs(Materials.SolderingAlloy.getMolten(288L)).duration(30 * SECONDS).eut(TierEU.RECIPE_MV) - .addTo(sAssemblerRecipes); + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -121,7 +121,7 @@ public class Assembler implements Runnable { 1, ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage())) .fluidInputs(Materials.Polytetrafluoroethylene.getMolten(72)).duration(10 * SECONDS) - .eut(TierEU.RECIPE_EV).addTo(sAssemblerRecipes); + .eut(TierEU.RECIPE_EV).addTo(assemblerRecipes); ItemStack[][] converters = ItemRegistry.TecTechLaserAdditions[0]; ItemStack[][] input = ItemRegistry.TecTechLaserAdditions[1]; @@ -172,7 +172,7 @@ public class Assembler implements Runnable { sensors[i].get(2 * (j + 1)), ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1))).itemOutputs(converter) .fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) - .duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption).addTo(sAssemblerRecipes); + .duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption).addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( new ItemStack( @@ -185,8 +185,7 @@ public class Assembler implements Runnable { sensors[i].get(2 * (j + 1)), ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1))) .itemOutputs(converter).fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) - .noFluidOutputs().duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption) - .addTo(sAssemblerRecipes); + .duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption).addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -199,7 +198,7 @@ public class Assembler implements Runnable { sensors[i].get(2 * (j + 1)), ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1))) .itemOutputs(eInput).fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) - .duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption).addTo(sAssemblerRecipes); + .duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption).addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -212,7 +211,7 @@ public class Assembler implements Runnable { emitters[i].get(2 * (j + 1)), ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1))) .itemOutputs(eDynamo).fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) - .duration((10 * (j + 1) * SECONDS)).eut(recipeConsumption).addTo(sAssemblerRecipes); + .duration((10 * (j + 1) * SECONDS)).eut(recipeConsumption).addTo(assemblerRecipes); } } @@ -222,11 +221,11 @@ public class Assembler implements Runnable { Materials.LiquidAir.getCells(1), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(ItemRegistry.compressedHatch.copy()).duration(15 * SECONDS).eut(TierEU.RECIPE_HV) - .addTo(sAssemblerRecipes); + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Hatch_Output_HV.get(64), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(ItemRegistry.giantOutputHatch.copy()).duration(15 * SECONDS).eut(TierEU.RECIPE_HV) - .addTo(sAssemblerRecipes); + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -234,7 +233,7 @@ public class Assembler implements Runnable { GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1)) .itemOutputs(new ItemStack(GregTech_API.sBlockCasings3, 1, 12)) .fluidInputs(Materials.Concrete.getMolten(1296)).duration(2 * SECONDS).eut(TierEU.RECIPE_IV) - .addTo(sAssemblerRecipes); + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -243,6 +242,6 @@ public class Assembler implements Runnable { GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 24)) .itemOutputs(new ItemStack(GregTech_API.sBlockCasings8, 1, 5)) .fluidInputs(Materials.Lead.getMolten(864)).duration(10 * SECONDS).eut(TierEU.RECIPE_LuV) - .addTo(sAssemblerRecipes); + .addTo(assemblerRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java index b8f6c51b6c..95e52fb328 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java @@ -1,6 +1,6 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes; +import static gregtech.api.recipe.RecipeMaps.autoclaveRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import net.minecraft.init.Items; @@ -23,12 +23,12 @@ public class Autoclave implements Runnable { GT_Values.RA.stdBuilder().itemInputs(ItemList.Circuit_Parts_PetriDish.get(1L)) .itemOutputs(BioItemList.getPetriDish(null)) .fluidInputs(used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L)).duration(5 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(sAutoclaveRecipes); + .eut(TierEU.RECIPE_LV).addTo(autoclaveRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(Items.glass_bottle)) .itemOutputs(BioItemList.getDNASampleFlask(null)) .fluidInputs(used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L)).duration(5 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(sAutoclaveRecipes); + .eut(TierEU.RECIPE_LV).addTo(autoclaveRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java index adb84fd8a0..b8398761b4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java @@ -2,7 +2,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.MATERIALS_PER_FUEL; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.sHTGR_Fuel; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; +import static gregtech.api.recipe.RecipeMaps.centrifugeRecipes; import static gregtech.api.util.GT_RecipeBuilder.MINUTES; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; @@ -37,7 +37,7 @@ public class Centrifuge implements Runnable { WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1)) .outputChances(800, 375, 22, 22, 5).duration(8 * MINUTES + 20 * SECONDS).eut(TierEU.RECIPE_EV) - .addTo(sCentrifugeRecipes); + .addTo(centrifugeRecipes); ItemStack[] pellets = new ItemStack[6]; Arrays.fill(pellets, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 4)); @@ -46,18 +46,18 @@ public class Centrifuge implements Runnable { .itemInputs( new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3), GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(pellets).duration(40 * MINUTES).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); + .itemOutputs(pellets).duration(40 * MINUTES).eut(TierEU.RECIPE_LV).addTo(centrifugeRecipes); GT_Values.RA.stdBuilder() .itemInputs( new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 5), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 6)) - .duration(40 * MINUTES).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); + .duration(40 * MINUTES).eut(TierEU.RECIPE_LV).addTo(centrifugeRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 6)) .itemOutputs(Materials.Lead.getDust(1)).outputChances(300).duration(60 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(sCentrifugeRecipes); + .addTo(centrifugeRecipes); int i = 0; for (GT_TileEntity_HTGR.HTGRMaterials.Fuel_ fuel : sHTGR_Fuel) { @@ -71,14 +71,14 @@ public class Centrifuge implements Runnable { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4)) - .duration(10 * MINUTES).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); + .duration(10 * MINUTES).eut(TierEU.RECIPE_LV).addTo(centrifugeRecipes); GT_Values.RA.stdBuilder() .itemInputs( new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 6)) - .duration(2 * MINUTES + 30 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); + .duration(2 * MINUTES + 30 * SECONDS).eut(TierEU.RECIPE_LV).addTo(centrifugeRecipes); GT_RecipeBuilder recipeBuilder = GT_Values.RA.stdBuilder() .itemInputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 6)) @@ -92,7 +92,7 @@ public class Centrifuge implements Runnable { if (fuel.recycledFluid != null) { recipeBuilder.fluidOutputs(fuel.recycledFluid); } - recipeBuilder.duration(1 * MINUTES).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); + recipeBuilder.duration(1 * MINUTES).eut(TierEU.RECIPE_LV).addTo(centrifugeRecipes); i += MATERIALS_PER_FUEL; } @@ -100,17 +100,17 @@ public class Centrifuge implements Runnable { GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(17)).itemOutputs(BioItemList.getOther(4)) .fluidInputs(new FluidStack(BioCultureLoader.eColi.getFluid(), 1000)) .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[1], 10)).duration(60 * SECONDS) - .eut(TierEU.RECIPE_HV).addTo(sCentrifugeRecipes); + .eut(TierEU.RECIPE_HV).addTo(centrifugeRecipes); GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(17)) .fluidInputs(new FluidStack(FluidLoader.BioLabFluidMaterials[1], 1000)) .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[3], 250)).duration(60 * SECONDS) - .eut(TierEU.RECIPE_HV).addTo(sCentrifugeRecipes); + .eut(TierEU.RECIPE_HV).addTo(centrifugeRecipes); GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(17)) .fluidInputs(new FluidStack(BioCultureLoader.CommonYeast.getFluid(), 1000)) .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[2], 10)).duration(60 * SECONDS) - .eut(TierEU.RECIPE_HV).addTo(sCentrifugeRecipes); + .eut(TierEU.RECIPE_HV).addTo(centrifugeRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java index 47fc76767a..9ccc301898 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java @@ -1,6 +1,6 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes; +import static gregtech.api.recipe.RecipeMaps.chemicalBathRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeBuilder.TICKS; @@ -22,32 +22,32 @@ public class ChemicalBath implements Runnable { GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 6)) .fluidInputs(Dyes.dyeRed.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) - .addTo(sChemicalBathRecipes); + .addTo(chemicalBathRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 7)) .fluidInputs(Dyes.dyeGreen.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) - .addTo(sChemicalBathRecipes); + .addTo(chemicalBathRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 8)) .fluidInputs(Dyes.dyePurple.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) - .addTo(sChemicalBathRecipes); + .addTo(chemicalBathRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 9)) .fluidInputs(Dyes.dyeYellow.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) - .addTo(sChemicalBathRecipes); + .addTo(chemicalBathRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 10)) .fluidInputs(Dyes.dyeLime.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) - .addTo(sChemicalBathRecipes); + .addTo(chemicalBathRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 11)) .fluidInputs(Dyes.dyeBrown.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) - .addTo(sChemicalBathRecipes); + .addTo(chemicalBathRecipes); } @@ -56,7 +56,7 @@ public class ChemicalBath implements Runnable { GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, i)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .fluidInputs(Materials.Chlorine.getGas(50)).duration(3 * SECONDS + 4 * TICKS).eut(2) - .addTo(sChemicalBathRecipes); + .addTo(chemicalBathRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java index b82e06a9e4..c69af8159b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java @@ -1,6 +1,6 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes; +import static gregtech.api.recipe.RecipeMaps.electrolyzerRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeBuilder.TICKS; @@ -23,36 +23,33 @@ public class Electrolyzer implements Runnable { .itemOutputs( GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnesium, 2L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L)) - .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(10 * SECONDS).eut(90) - .addTo(sElectrolyzerRecipes); + .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(10 * SECONDS).eut(90).addTo(electrolyzerRecipes); GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.RedZircon.get(OrePrefixes.dust, 6)) .itemOutputs( WerkstoffLoader.Zirconium.get(OrePrefixes.dust, 1), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L)) .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(12 * SECONDS + 10 * TICKS).eut(90) - .addTo(sElectrolyzerRecipes); + .addTo(electrolyzerRecipes); GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.Fayalit.get(OrePrefixes.dust, 7)) .itemOutputs( GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 2L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L)) - .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(16 * SECONDS).eut(90) - .addTo(sElectrolyzerRecipes); + .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(16 * SECONDS).eut(90).addTo(electrolyzerRecipes); GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.Prasiolite.get(OrePrefixes.dust, 16)) .itemOutputs( GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 5L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L)) - .duration(29 * SECONDS).eut(90).addTo(sElectrolyzerRecipes); + .duration(29 * SECONDS).eut(90).addTo(electrolyzerRecipes); GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.Hedenbergit.get(OrePrefixes.dust, 10)) .itemOutputs( GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Calcium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 2L)) - .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(15 * SECONDS).eut(90) - .addTo(sElectrolyzerRecipes); + .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(15 * SECONDS).eut(90).addTo(electrolyzerRecipes); GT_Values.RA.stdBuilder() .itemInputs(WerkstoffLoader.FuchsitAL.get(OrePrefixes.dust, 21), ItemList.Cell_Empty.get(2)) @@ -62,7 +59,7 @@ public class Electrolyzer implements Runnable { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2)) .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(19 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_MV) - .addTo(sElectrolyzerRecipes); + .addTo(electrolyzerRecipes); GT_Values.RA.stdBuilder() .itemInputs(WerkstoffLoader.FuchsitCR.get(OrePrefixes.dust, 21), ItemList.Cell_Empty.get(2)) @@ -72,7 +69,7 @@ public class Electrolyzer implements Runnable { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2)) .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(23 * SECONDS).eut(TierEU.RECIPE_MV) - .addTo(sElectrolyzerRecipes); + .addTo(electrolyzerRecipes); GT_Values.RA.stdBuilder() .itemInputs(WerkstoffLoader.VanadioOxyDravit.get(OrePrefixes.dust, 53), ItemList.Cell_Empty.get(3)) @@ -84,7 +81,7 @@ public class Electrolyzer implements Runnable { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3)) .fluidOutputs(Materials.Oxygen.getGas(19000L)).duration(35 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_MV) - .addTo(sElectrolyzerRecipes); + .addTo(electrolyzerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -98,7 +95,7 @@ public class Electrolyzer implements Runnable { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3)) .fluidOutputs(Materials.Oxygen.getGas(19000L)).duration(36 * SECONDS).eut(TierEU.RECIPE_MV) - .addTo(sElectrolyzerRecipes); + .addTo(electrolyzerRecipes); GT_Values.RA.stdBuilder() .itemInputs(WerkstoffLoader.FluorBuergerit.get(OrePrefixes.dust, 50), ItemList.Cell_Empty.get(3)) @@ -110,7 +107,7 @@ public class Electrolyzer implements Runnable { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fluorine, 3)) .fluidOutputs(Materials.Oxygen.getGas(6000L)).duration(36 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_MV) - .addTo(sElectrolyzerRecipes); + .addTo(electrolyzerRecipes); GT_Values.RA.stdBuilder() .itemInputs(WerkstoffLoader.Olenit.get(OrePrefixes.dust, 51), ItemList.Cell_Empty.get(1)) @@ -121,7 +118,7 @@ public class Electrolyzer implements Runnable { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 1)) .fluidOutputs(Materials.Oxygen.getGas(1000L)).duration(39 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_MV) - .addTo(sElectrolyzerRecipes); + .addTo(electrolyzerRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java index c1b2a4ba25..befa1bf05d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java @@ -1,7 +1,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; import static gregtech.api.enums.Mods.CropLoadCore; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sExtractorRecipes; +import static gregtech.api.recipe.RecipeMaps.extractorRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import java.util.List; @@ -26,14 +26,14 @@ public class Extractor implements Runnable { GT_Values.RA.stdBuilder().itemInputs(BW_Util.setStackSize(stack, 12)) .itemOutputs(BioItemList.getOther(1)).duration(25 * SECONDS).eut((int) TierEU.RECIPE_HV) - .addTo(sExtractorRecipes); + .addTo(extractorRecipes); } } GT_Values.RA.stdBuilder().itemInputs(ItemList.Circuit_Chip_Stemcell.get(1L)) .itemOutputs(BioItemList.getOther(4)).duration(25 * SECONDS).eut((int) TierEU.RECIPE_LuV) - .addTo(sExtractorRecipes); + .addTo(extractorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java index e1eaa07400..9c1d594bad 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java @@ -1,6 +1,6 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes; +import static gregtech.api.recipe.RecipeMaps.fluidHeaterRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeBuilder.TICKS; @@ -19,6 +19,6 @@ public class FluidHeater implements Runnable { GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)) .fluidInputs(new FluidStack(FluidLoader.fulvicAcid, 1000)) .fluidOutputs(new FluidStack(FluidLoader.heatedfulvicAcid, 1000)).duration(4 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_MV).addTo(sFluidHeaterRecipes); + .eut(TierEU.RECIPE_MV).addTo(fluidHeaterRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java index d9939ac3b2..dfd92ee866 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java @@ -1,6 +1,6 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes; +import static gregtech.api.recipe.RecipeMaps.fluidSolidifierRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import net.minecraft.init.Blocks; @@ -22,52 +22,52 @@ public class FluidSolidifier implements Runnable { GT_Values.RA.stdBuilder().itemInputs(new ItemStack(Blocks.lapis_block)) .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0)) .fluidInputs(Materials.Iron.getMolten(1296L)).duration(5 * SECONDS).eut(TierEU.RECIPE_HV) - .addTo(sFluidSolidficationRecipes); + .addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1)) .fluidInputs(Materials.Titanium.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_HV) - .addTo(sFluidSolidficationRecipes); + .addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2)) .fluidInputs(Materials.TungstenSteel.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_EV) - .addTo(sFluidSolidficationRecipes); + .addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3)) .fluidInputs(WerkstoffLoader.LuVTierMaterial.getMolten(1152)).duration(40 * SECONDS) - .eut(TierEU.RECIPE_IV).addTo(sFluidSolidficationRecipes); + .eut(TierEU.RECIPE_IV).addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4)) .fluidInputs(Materials.Iridium.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_LuV) - .addTo(sFluidSolidficationRecipes); + .addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5)) .fluidInputs(Materials.Osmium.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_ZPM) - .addTo(sFluidSolidficationRecipes); + .addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 13)) .fluidInputs(Materials.Neutronium.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_UV) - .addTo(sFluidSolidficationRecipes); + .addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 14)) .fluidInputs(Materials.CosmicNeutronium.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_UHV) - .addTo(sFluidSolidficationRecipes); + .addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 15)) .fluidInputs(Materials.Infinity.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_UEV) - .addTo(sFluidSolidficationRecipes); + .addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[1], 1, 0)) .fluidInputs(MaterialsUEVplus.TranscendentMetal.getMolten(1152)).duration(40 * SECONDS) - .eut(TierEU.RECIPE_UIV).addTo(sFluidSolidficationRecipes); + .eut(TierEU.RECIPE_UIV).addTo(fluidSolidifierRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java index f24e71fb99..251200649d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java @@ -2,7 +2,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.MATERIALS_PER_FUEL; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.sHTGR_Fuel; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sPressRecipes; +import static gregtech.api.recipe.RecipeMaps.formingPressRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import net.minecraft.item.ItemStack; @@ -23,21 +23,21 @@ public class FormingPress implements Runnable { new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials), Materials.Graphite.getDust(64)) .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1)) - .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); + .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(formingPressRecipes); GT_Values.RA.stdBuilder() .itemInputs( new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1), Materials.Silicon.getDust(64)) .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2)) - .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); + .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(formingPressRecipes); GT_Values.RA.stdBuilder() .itemInputs( new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2), Materials.Graphite.getDust(64)) .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3)) - .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); + .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(formingPressRecipes); int i = 0; for (GT_TileEntity_HTGR.HTGRMaterials.Fuel_ fuel : sHTGR_Fuel) { @@ -46,21 +46,21 @@ public class FormingPress implements Runnable { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i), Materials.Carbon.getDust(64)) .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1)) - .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); + .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(formingPressRecipes); GT_Values.RA.stdBuilder() .itemInputs( new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), Materials.Silicon.getDust(64)) .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2)) - .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); + .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(formingPressRecipes); GT_Values.RA.stdBuilder() .itemInputs( new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), Materials.Graphite.getDust(64)) .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3)) - .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sPressRecipes); + .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(formingPressRecipes); i += MATERIALS_PER_FUEL; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java index cc149e0bec..c37fad13d4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java @@ -1,6 +1,6 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes; +import static gregtech.api.recipe.RecipeMaps.laserEngraverRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import net.minecraft.init.Items; @@ -19,7 +19,7 @@ public class LaserEngraver implements Runnable { GT_Values.RA.stdBuilder().itemInputs(new ItemStack(Items.emerald), GT_Utility.getIntegratedCircuit(17)) .itemOutputs(BioItemList.getPlasmidCell(null)).duration(5 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(sLaserEngraverRecipes); + .addTo(laserEngraverRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java index e6ea24dc8b..92ccdc005d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java @@ -3,7 +3,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.MATERIALS_PER_FUEL; import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR.HTGRMaterials.sHTGR_Fuel; import static gregtech.api.enums.Mods.Gendustry; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMixerRecipes; +import static gregtech.api.recipe.RecipeMaps.mixerRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import net.minecraft.item.ItemStack; @@ -32,13 +32,13 @@ public class Mixer implements Runnable { Materials.Uranium235.getDust(1), GT_Utility.getIntegratedCircuit(2)) .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials)).duration(20 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + .eut(TierEU.RECIPE_LV).addTo(mixerRecipes); int i = 0; for (GT_TileEntity_HTGR.HTGRMaterials.Fuel_ fuel : sHTGR_Fuel) { GT_Values.RA.stdBuilder().itemInputs(fuel.mainItem, fuel.secondaryItem, GT_Utility.getIntegratedCircuit(1)) .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i)) - .duration(20 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + .duration(20 * SECONDS).eut(TierEU.RECIPE_LV).addTo(mixerRecipes); i += MATERIALS_PER_FUEL; } @@ -51,7 +51,7 @@ public class Mixer implements Runnable { .itemOutputs(Materials.Empty.getCells(1)) .fluidInputs(FluidRegistry.getFluidStack("liquiddna", 1000)) .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[0], 2000)).duration(25 * SECONDS) - .eut(TierEU.RECIPE_HV).addTo(sMixerRecipes); + .eut(TierEU.RECIPE_HV).addTo(mixerRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java index 8dd55d5f24..1f505f96a9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java @@ -1,6 +1,6 @@ package com.github.bartimaeusnek.bartworks.common.loaders.recipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; +import static gregtech.api.recipe.RecipeMaps.maceratorRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import net.minecraft.item.ItemStack; @@ -21,47 +21,47 @@ public class Pulverizer implements Runnable { GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1)) .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Titanium.getDust(8)) - .duration(40 * SECONDS).eut(TierEU.RECIPE_EV).addTo(sMaceratorRecipes); + .duration(40 * SECONDS).eut(TierEU.RECIPE_EV).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2)) .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.TungstenSteel.getDust(8)) - .duration(40 * SECONDS).eut(TierEU.RECIPE_IV).addTo(sMaceratorRecipes); + .duration(40 * SECONDS).eut(TierEU.RECIPE_IV).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3)) .itemOutputs( Materials.BorosilicateGlass.getDust(9), WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.dust, 8)) - .duration(40 * SECONDS).eut(TierEU.RECIPE_LuV).addTo(sMaceratorRecipes); + .duration(40 * SECONDS).eut(TierEU.RECIPE_LuV).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4)) .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Iridium.getDust(8)) - .duration(40 * SECONDS).eut(TierEU.RECIPE_ZPM).addTo(sMaceratorRecipes); + .duration(40 * SECONDS).eut(TierEU.RECIPE_ZPM).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5)) .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Osmium.getDust(8)).duration(40 * SECONDS) - .eut(TierEU.RECIPE_UV).addTo(sMaceratorRecipes); + .eut(TierEU.RECIPE_UV).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 13)) .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Neutronium.getDust(8)) - .duration(40 * SECONDS).eut(TierEU.RECIPE_UHV).addTo(sMaceratorRecipes); + .duration(40 * SECONDS).eut(TierEU.RECIPE_UHV).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 14)) .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.CosmicNeutronium.getDust(8)) - .duration(40 * SECONDS).eut(TierEU.RECIPE_UEV).addTo(sMaceratorRecipes); + .duration(40 * SECONDS).eut(TierEU.RECIPE_UEV).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 15)) .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Infinity.getDust(8)) - .duration(40 * SECONDS).eut(TierEU.RECIPE_UIV).addTo(sMaceratorRecipes); + .duration(40 * SECONDS).eut(TierEU.RECIPE_UIV).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[1], 1, 0)) .itemOutputs(Materials.BorosilicateGlass.getDust(9), MaterialsUEVplus.TranscendentMetal.getDust(8)) - .duration(40 * SECONDS).eut(TierEU.RECIPE_UMV).addTo(sMaceratorRecipes); + .duration(40 * SECONDS).eut(TierEU.RECIPE_UMV).addTo(maceratorRecipes); for (int i = 6; i < 11; i++) { GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, i)) .itemOutputs(Materials.BorosilicateGlass.getDust(9)).duration(20 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(sMaceratorRecipes); + .addTo(maceratorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 62fa551434..fd1fb049cc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -50,13 +50,13 @@ import net.minecraftforge.fluids.FluidStack; import org.jetbrains.annotations.NotNull; import com.github.bartimaeusnek.bartworks.API.SideReference; +import com.github.bartimaeusnek.bartworks.API.recipe.BartWorksRecipeMaps; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.items.LabParts; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.net.RendererPacket; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.BioCulture; import com.github.bartimaeusnek.bartworks.util.Coords; @@ -75,6 +75,7 @@ import gregtech.api.logic.ProcessingLogic; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.render.TextureFactory; @@ -199,8 +200,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return BWRecipes.instance.getMappingsFor(BWRecipes.BACTERIALVATBYTE); + public RecipeMap getRecipeMap() { + return BartWorksRecipeMaps.bacterialVatRecipes; } /** diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index e7c9f3f7c7..016dc0f14c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -31,9 +31,13 @@ import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gregtech.api.util.GT_Utility.filterValidMTEs; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.List; +import javax.annotation.Nonnull; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; @@ -47,9 +51,9 @@ import net.minecraftforge.common.util.ForgeDirection; import org.jetbrains.annotations.NotNull; import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; +import com.github.bartimaeusnek.bartworks.API.recipe.BartWorksRecipeMaps; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -72,12 +76,13 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMul import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.recipe.RecipeMap; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.SimpleCheckRecipeResult; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; @@ -265,9 +270,15 @@ public class GT_TileEntity_CircuitAssemblyLine extends } @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - if (this.mode == 0) return BWRecipes.instance.getMappingsFor((byte) 3); - return GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes; + public RecipeMap getRecipeMap() { + if (this.mode == 0) return BartWorksRecipeMaps.circuitAssemblyLineRecipes; + return RecipeMaps.circuitAssemblerRecipes; + } + + @Nonnull + @Override + public Collection> getAvailableRecipeMaps() { + return Arrays.asList(BartWorksRecipeMaps.circuitAssemblyLineRecipes, RecipeMaps.circuitAssemblerRecipes); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 1441514d87..25b11ea75d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -37,11 +37,11 @@ import net.minecraftforge.common.util.ForgeDirection; import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.NotNull; +import com.github.bartimaeusnek.bartworks.API.recipe.BartWorksRecipeMaps; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.renderer.BW_EICPistonVisualizer; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.net.EICPacket; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.Coords; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; @@ -67,6 +67,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.logic.ProcessingLogic; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_ExtendedPowerMultiBlockBase; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.recipe.RecipeMap; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OverclockCalculator; @@ -256,8 +257,8 @@ public class GT_TileEntity_ElectricImplosionCompressor } @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return BWRecipes.instance.eicMap; + public RecipeMap getRecipeMap() { + return BartWorksRecipeMaps.electricImplosionCompressorRecipes; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 45b9b83fdd..714e774133 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -20,7 +20,6 @@ import static gregtech.api.util.GT_Utility.filterValidMTEs; import java.util.ArrayList; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import net.minecraft.entity.player.EntityPlayer; @@ -30,6 +29,7 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import com.github.bartimaeusnek.bartworks.API.recipe.BartWorksRecipeMaps; import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; @@ -51,10 +51,10 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.recipe.RecipeMap; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase { @@ -121,22 +121,6 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase // GregTech_API.sBlockCasings8, 5)) .build(); - public static final GT_Recipe.GT_Recipe_Map fakeRecipeMap = new GT_Recipe.GT_Recipe_Map( - new HashSet<>(), - "bw.recipe.htgr", - "High Temperature Gas-cooled Reactor", - null, - "gregtech:textures/gui/basicmachines/Default", - 1, - 1, - 1, - 0, - 1, - "", - 1, - "", - false, - true).useModularUI(true); private static final int HELIUM_NEEDED = 730000; public static final int powerUsage = (int) TierEU.RECIPE_LuV; private static final int maxcapacity = 720000; @@ -270,6 +254,12 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } } + @Override + public RecipeMap getRecipeMap() { + // Only for visual + return BartWorksRecipeMaps.htgrFakeRecipes; + } + @Override public boolean checkRecipe(ItemStack controllerStack) { @@ -604,7 +594,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase for (@SuppressWarnings("unused") Fuel_ fuel : sHTGR_Fuel) { - fakeRecipeMap.addFakeRecipe( + BartWorksRecipeMaps.htgrFakeRecipes.addFakeRecipe( false, new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4) }, new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5) }, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 26d7ed3d01..93ccdecd6c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -76,6 +76,7 @@ import gregtech.api.interfaces.modularui.IGetTitleColor; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; import gregtech.api.objects.ItemData; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OreDictUnificator; @@ -283,8 +284,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock if (this.mOutputItems == null) this.mOutputItems = new ItemStack[2]; - GT_Recipe.GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; - GT_Recipe tRecipe = tMap.findRecipe(this.getBaseMetaTileEntity(), false, false, V[1], null, itemStack); + GT_Recipe tRecipe = RecipeMaps.maceratorRecipes + .findRecipe(this.getBaseMetaTileEntity(), false, false, V[1], null, itemStack); if (tRecipe == null) { return false; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 5b4f3a1ece..edf56833ee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -59,6 +59,8 @@ import gregtech.api.logic.ProcessingLogic; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.recipe.RecipeMap; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.render.TextureFactory; @@ -278,7 +280,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override protected GT_OverclockCalculator createOverclockCalculator(@Nonnull GT_Recipe recipe) { return super.createOverclockCalculator(recipe).setRecipeHeat(recipe.mSpecialValue) - .setMultiHeat(GT_TileEntity_MegaBlastFurnace.this.mHeatingCapacity).setHeatOC(true) + .setMachineHeat(GT_TileEntity_MegaBlastFurnace.this.mHeatingCapacity).setHeatOC(true) .setHeatDiscount(true); } @@ -379,8 +381,13 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock } @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return GT_Recipe.GT_Recipe_Map.sBlastRecipes; + public RecipeMap getRecipeMap() { + return RecipeMaps.blastFurnaceRecipes; + } + + @Override + public int getRecipeCatalystPriority() { + return -2; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index 273469366c..2638f5de7c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -45,9 +45,10 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.logic.ProcessingLogic; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.recipe.RecipeMap; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; public class GT_TileEntity_MegaChemicalReactor @@ -108,8 +109,8 @@ public class GT_TileEntity_MegaChemicalReactor } @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes; + public RecipeMap getRecipeMap() { + return RecipeMaps.multiblockChemicalReactorRecipes; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 4644b33dc8..6ae286900d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -52,9 +52,10 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.logic.ProcessingLogic; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.recipe.RecipeMap; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_Output_ME; @@ -246,8 +247,13 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return GT_Recipe.GT_Recipe_Map.sDistillationRecipes; + public RecipeMap getRecipeMap() { + return RecipeMaps.distillationTowerRecipes; + } + + @Override + public int getRecipeCatalystPriority() { + return -1; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index 1c82e6cbff..70a3326729 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -56,10 +56,11 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_MultiInput; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.recipe.RecipeMap; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBase @@ -185,8 +186,8 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa } @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return GT_Recipe.GT_Recipe_Map.sCrackingRecipes; + public RecipeMap getRecipeMap() { + return RecipeMaps.crackingRecipes; } @Override @@ -335,13 +336,13 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa tHatch.mRecipeMap = getRecipeMap(); if (tHatch instanceof GT_MetaTileEntity_Hatch_MultiInput) { for (final FluidStack tFluid : ((GT_MetaTileEntity_Hatch_MultiInput) tHatch).getStoredFluid()) { - if (tFluid != null && !GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tFluid)) { + if (tFluid != null && !RecipeMaps.crackingRecipes.getBackend().isValidCatalystFluid(tFluid)) { rList.add(tFluid); } } } else { if (tHatch.getFillableStack() != null) { - if (!GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tHatch.getFillableStack())) + if (!RecipeMaps.crackingRecipes.getBackend().isValidCatalystFluid(tHatch.getFillableStack())) rList.add(tHatch.getFillableStack()); } } @@ -350,14 +351,14 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa tHatch.mRecipeMap = getRecipeMap(); if (tHatch instanceof GT_MetaTileEntity_Hatch_MultiInput) { for (final FluidStack tFluid : ((GT_MetaTileEntity_Hatch_MultiInput) tHatch).getStoredFluid()) { - if (tFluid != null && GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tFluid)) { + if (tFluid != null && RecipeMaps.crackingRecipes.getBackend().isValidCatalystFluid(tFluid)) { rList.add(tFluid); } } } else { if (tHatch.getFillableStack() != null) { final FluidStack tStack = tHatch.getFillableStack(); - if (GT_Recipe.GT_Recipe_Map.sCrackingRecipes.isValidCatalystFluid(tStack)) { + if (RecipeMaps.crackingRecipes.getBackend().isValidCatalystFluid(tStack)) { rList.add(tStack); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index 1243bae84d..fce136840d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -44,9 +44,10 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.logic.ProcessingLogic; +import gregtech.api.recipe.RecipeMap; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBlockBase @@ -175,8 +176,8 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc } @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return GT_Recipe.GT_Recipe_Map.sVacuumRecipes; + public RecipeMap getRecipeMap() { + return RecipeMaps.vacuumFreezerRecipes; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index 3686f59246..d9b7645d29 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -16,7 +16,7 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; +import com.github.bartimaeusnek.bartworks.API.recipe.BartWorksRecipeMaps; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; @@ -26,8 +26,8 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +import gregtech.api.recipe.RecipeMap; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Recipe; public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGenerator { @@ -46,8 +46,8 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene } @Override - public GT_Recipe.GT_Recipe_Map getRecipes() { - return BWRecipes.instance.getMappingsFor((byte) 2); + public RecipeMap getRecipeMap() { + return BartWorksRecipeMaps.acidGenFuels; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index 4e01fca2a0..30420d4328 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -21,12 +21,12 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import com.github.bartimaeusnek.bartworks.API.recipe.BartWorksRecipeMaps; import com.github.bartimaeusnek.bartworks.common.items.LabModule; import com.github.bartimaeusnek.bartworks.common.items.LabParts; import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.BioCulture; @@ -43,9 +43,9 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtech.api.objects.XSTR; +import gregtech.api.recipe.RecipeMap; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; @@ -140,8 +140,8 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } @Override - public GT_Recipe.GT_Recipe_Map getRecipeList() { - return BWRecipes.instance.getMappingsFor(BWRecipes.BIOLABBYTE); + public RecipeMap getRecipeMap() { + return BartWorksRecipeMaps.bioLabRecipes; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 33589f45f6..942c2823b0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -25,8 +25,8 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; +import com.github.bartimaeusnek.bartworks.API.recipe.BartWorksRecipeMaps; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.MathUtils; @@ -56,16 +56,19 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.modularui.IAddGregtechLogo; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.interfaces.tileentity.RecipeMapWorkable; import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.ItemData; +import gregtech.api.recipe.RecipeMap; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; -public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implements IAddGregtechLogo { +public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch + implements RecipeMapWorkable, IAddGregtechLogo { private final int cap; public int sievert; @@ -97,11 +100,6 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem this.cap = aTier - 2; } - public GT_MetaTileEntity_RadioHatch(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, 1, aDescription, aTextures); - this.cap = aTier - 2; - } - public GT_MetaTileEntity_RadioHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 1, aDescription, aTextures); this.cap = aTier - 2; @@ -214,7 +212,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem } if (this.lastRecipe == null || this.lastFail) { - this.lastRecipe = BWRecipes.instance.getMappingsFor(BWRecipes.RADHATCH).findRecipe( + this.lastRecipe = BartWorksRecipeMaps.radioHatchRecipes.findRecipe( this.getBaseMetaTileEntity(), false, Integer.MAX_VALUE - 7, @@ -304,7 +302,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, ItemStack aStack) { return side == this.getBaseMetaTileEntity().getFrontFacing() - && BWRecipes.instance.getMappingsFor(BWRecipes.RADHATCH).containsInput(aStack); + && BartWorksRecipeMaps.radioHatchRecipes.containsInput(aStack); } @Override @@ -340,6 +338,12 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch implem } } + @Override + public RecipeMap getRecipeMap() { + // Only for visual + return BartWorksRecipeMaps.radioHatchRecipes; + } + private static final int RADIATION_SHUTTER_WINDOW_ID = 999; @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java index bcac09fde6..c5fc4b1465 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java @@ -22,13 +22,13 @@ import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.enums.GT_Values; -import gregtech.api.util.GT_Recipe; +import gregtech.api.recipe.RecipeCategory; import gregtech.nei.GT_NEI_DefaultHandler; public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { - public BW_NEI_BioLabHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { - super(aRecipeMap); + public BW_NEI_BioLabHandler(RecipeCategory recipeCategory) { + super(recipeCategory); if (!NEI_BW_Config.sIsAdded) { FMLInterModComms.sendRuntimeMessage( GT_Values.GT, @@ -42,7 +42,7 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { @Override public TemplateRecipeHandler newInstance() { - return new BW_NEI_BioLabHandler(this.mRecipeMap); + return new BW_NEI_BioLabHandler(this.recipeCategory); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index a7b170961d..38f2a9c800 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -25,13 +25,13 @@ import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.enums.GT_Values; -import gregtech.api.util.GT_Recipe; +import gregtech.api.recipe.RecipeCategory; import gregtech.nei.GT_NEI_DefaultHandler; public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { - public BW_NEI_BioVatHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { - super(aRecipeMap); + public BW_NEI_BioVatHandler(RecipeCategory recipeCategory) { + super(recipeCategory); if (!NEI_BW_Config.sIsAdded) { FMLInterModComms.sendRuntimeMessage( GT_Values.GT, @@ -45,7 +45,7 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { @Override public TemplateRecipeHandler newInstance() { - return new BW_NEI_BioVatHandler(this.mRecipeMap); + return new BW_NEI_BioVatHandler(this.recipeCategory); } private void loadLabPartRecipes(ItemStack aResult) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java deleted file mode 100644 index b32a7c2b49..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/IMCForNEI.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.github.bartimaeusnek.bartworks.neiHandler; - -import static gregtech.api.enums.Mods.NotEnoughItems; - -import net.minecraft.nbt.NBTTagCompound; - -import com.github.bartimaeusnek.bartworks.MainMod; - -import cpw.mods.fml.common.event.FMLInterModComms; - -public class IMCForNEI { - - public static void IMCSender() { - sendCatalyst("gt.recipe.largechemicalreactor", "gregtech:gt.blockmachines:13366", -10); - sendCatalyst("gt.recipe.craker", "gregtech:gt.blockmachines:13367", -10); - sendHandler("bw.recipe.htgr", "gregtech:gt.blockmachines:12791"); - sendCatalyst("bw.recipe.htgr", "gregtech:gt.blockmachines:12791"); - sendHandler("bw.recipe.radhatch", "gregtech:gt.blockmachines:12713"); - sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12713"); - sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12714"); - sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12715"); - sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12716"); - sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12717"); - sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12718"); - sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12719"); - sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12720"); - sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12721"); - sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12722"); - sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12723"); - sendCatalyst("bw.recipe.radhatch", "gregtech:gt.blockmachines:12724"); - sendCatalyst("gt.recipe.circuitassembler", "gregtech:gt.blockmachines:12735", -20); - } - - private static void sendHandler(String name, String block) { - NBTTagCompound aNBT = new NBTTagCompound(); - aNBT.setString("handler", name); - aNBT.setString("modName", MainMod.NAME); - aNBT.setString("modId", MainMod.MOD_ID); - aNBT.setBoolean("modRequired", true); - aNBT.setString("itemName", block); - aNBT.setInteger("handlerHeight", 135); - aNBT.setInteger("handlerWidth", 166); - aNBT.setInteger("maxRecipesPerPage", 2); - aNBT.setInteger("yShift", 6); - FMLInterModComms.sendMessage(NotEnoughItems.ID, "registerHandlerInfo", aNBT); - } - - private static void sendCatalyst(String aName, String aStack, int aPriority) { - NBTTagCompound aNBT = new NBTTagCompound(); - aNBT.setString("handlerID", aName); - aNBT.setString("itemName", aStack); - aNBT.setInteger("priority", aPriority); - FMLInterModComms.sendMessage(NotEnoughItems.ID, "registerCatalystInfo", aNBT); - } - - private static void sendCatalyst(String aName, String aStack) { - sendCatalyst(aName, aStack, 0); - } -} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index 56a4befdc5..9b403a743b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -15,11 +15,11 @@ package com.github.bartimaeusnek.bartworks.neiHandler; import net.minecraft.item.ItemStack; +import com.github.bartimaeusnek.bartworks.API.recipe.BartWorksRecipeMaps; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; import codechicken.nei.PositionedStack; import codechicken.nei.api.API; @@ -66,10 +66,11 @@ public class NEI_BW_Config implements IConfigureNEI { stack.setItemDamage(Short.MAX_VALUE); API.hideItem(stack); } + NEI_BW_Config.sIsAdded = false; new BW_NEI_OreHandler(); - new BW_NEI_BioVatHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BACTERIALVATBYTE)); - new BW_NEI_BioLabHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BIOLABBYTE)); + new BW_NEI_BioVatHandler(BartWorksRecipeMaps.bacterialVatRecipes.getDefaultRecipeCategory()); + new BW_NEI_BioLabHandler(BartWorksRecipeMaps.bioLabRecipes.getDefaultRecipeCategory()); NEI_BW_Config.sIsAdded = true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java index ee322c5634..79cb2438dd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java @@ -14,7 +14,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import static gregtech.api.enums.GT_Values.RA; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; +import static gregtech.api.recipe.RecipeMaps.assemblerRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeBuilder.TICKS; @@ -52,7 +52,7 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { .itemInputs( GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.getVarName(), 4), ItemList.Circuit_Integrated.getWithDamage(0, 4)) - .itemOutputs(getStackForm(1)).duration(3 * SECONDS + 4 * TICKS).eut(8).addTo(sAssemblerRecipes); + .itemOutputs(getStackForm(1)).duration(3 * SECONDS + 4 * TICKS).eut(8).addTo(assemblerRecipes); } private BW_MetaGeneratedFrames(String aName, Werkstoff aMaterial) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index 11200e95c9..91d5a87dd5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -13,7 +13,7 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sPressRecipes; +import static gregtech.api.recipe.RecipeMaps.formingPressRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import java.util.ArrayList; @@ -34,7 +34,6 @@ import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -51,6 +50,7 @@ import gregtech.api.interfaces.IItemBehaviour; import gregtech.api.interfaces.IItemContainer; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.objects.ItemData; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GT_Config; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; @@ -76,10 +76,10 @@ public class BW_Meta_Items { WerkstoffLoader.MagnetoResonaticDust.get(OrePrefixes.dust, 1), WerkstoffLoader.ArInGaPhoBiBoTe.get(OrePrefixes.dust, 4)) .itemOutputs(BW_Meta_Items.NEWCIRCUITS.getStack(2)).duration(15 * SECONDS).eut(TierEU.RECIPE_HV) - .addTo(sPressRecipes); + .addTo(formingPressRecipes); - GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.add( - new BWRecipes.DynamicGTRecipe( + RecipeMaps.autoclaveRecipes.add( + new GT_Recipe( false, new ItemStack[] { BW_Meta_Items.NEWCIRCUITS.getStack(2) }, new ItemStack[] { BW_Meta_Items.NEWCIRCUITS.getStack(3) }, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index 9d8675406f..fd5cfeb38d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -28,10 +28,11 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; +import com.github.bartimaeusnek.bartworks.API.recipe.BWNBTDependantCraftingRecipe; +import com.github.bartimaeusnek.bartworks.API.recipe.BartWorksRecipeMaps; import com.github.bartimaeusnek.bartworks.ASM.BWCoreStaticReplacementMethodes; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Pair; import com.google.common.collect.ArrayListMultimap; @@ -42,6 +43,7 @@ import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -74,15 +76,15 @@ public class CircuitImprintLoader { } private static void reAddOriginalRecipes() { - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(MODIFIED_CAL_RECIPES); - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.addAll(ORIGINAL_CAL_RECIPES); + RecipeMaps.circuitAssemblerRecipes.getBackend().removeRecipes(MODIFIED_CAL_RECIPES); + ORIGINAL_CAL_RECIPES.forEach(RecipeMaps.circuitAssemblerRecipes::add); ORIGINAL_CAL_RECIPES.clear(); MODIFIED_CAL_RECIPES.clear(); } private static void rebuildCircuitAssemblerMap(HashSet toRem, HashSet toAdd) { reAddOriginalRecipes(); - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList + RecipeMaps.circuitAssemblerRecipes.getAllRecipes() .forEach(e -> CircuitImprintLoader.handleCircuitRecipeRebuilding(e, toRem, toAdd)); } @@ -108,8 +110,7 @@ public class CircuitImprintLoader { || circuitRecipe.mFluidInputs[0].isFluidEqual(new FluidStack(solderIndalloy, 0)) || circuitRecipe.mFluidInputs[0].isFluidEqual(new FluidStack(solderUEV, 0))) { GT_Recipe newRecipe = CircuitImprintLoader.reBuildRecipe(circuitRecipe); - if (newRecipe != null) - BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(newRecipe); + if (newRecipe != null) BartWorksRecipeMaps.circuitAssemblyLineRecipes.addRecipe(newRecipe); addCutoffRecipeToSets(toRem, toAdd, circuitRecipe); } else if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) toRem.add(circuitRecipe); } @@ -121,8 +122,8 @@ public class CircuitImprintLoader { } private static void exchangeRecipesInList(HashSet toRem, HashSet toAdd) { - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.addAll(toAdd); - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(toRem); + toAdd.forEach(RecipeMaps.circuitAssemblerRecipes::add); + RecipeMaps.circuitAssemblerRecipes.getBackend().removeRecipes(toRem); ORIGINAL_CAL_RECIPES.addAll(toRem); MODIFIED_CAL_RECIPES.addAll(toAdd); } @@ -169,7 +170,7 @@ public class CircuitImprintLoader { return null; } - return new BWRecipes.DynamicGTRecipe( + return new GT_Recipe( false, in, new ItemStack[] { getOutputMultiplied(original) }, @@ -273,7 +274,7 @@ public class CircuitImprintLoader { private static void removeOldRecipesFromRegistries() { recipeWorldCache.forEach(CraftingManager.getInstance().getRecipeList()::remove); BWCoreStaticReplacementMethodes.clearRecentlyUsedRecipes(); - gtrecipeWorldCache.forEach(GT_Recipe.GT_Recipe_Map.sSlicerRecipes.mRecipeList::remove); + RecipeMaps.slicerRecipes.getBackend().removeRecipes(gtrecipeWorldCache); recipeWorldCache.forEach(r -> { try { BW_Util.getGTBufferedRecipeList().remove(r); @@ -302,7 +303,7 @@ public class CircuitImprintLoader { && OreDictionary.getOreIDs(stack).length > 0 ? OreDictionary.getOreIDs(stack)[0] : -1)))); - GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe( + GT_Recipe slicingRecipe = new GT_Recipe( true, new ItemStack[] { stack, ItemList.Shape_Slicer_Flat.get(0) }, new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag, 1, 1) }, @@ -314,7 +315,7 @@ public class CircuitImprintLoader { eut, BW_Util.CLEANROOM); gtrecipeWorldCache.add(slicingRecipe); - GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); + RecipeMaps.slicerRecipes.add(slicingRecipe); } private static void makeAndAddCraftingRecipes(NBTTagCompound tag) { @@ -323,7 +324,7 @@ public class CircuitImprintLoader { 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite, 1), 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3) }; - IRecipe bwrecipe = new BWRecipes.BWNBTDependantCraftingRecipe(circuit, imprintRecipe); + IRecipe bwrecipe = new BWNBTDependantCraftingRecipe(circuit, imprintRecipe); ShapedOreRecipe gtrecipe = BW_Util.createGTCraftingRecipe( circuit, GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.KEEPNBT @@ -349,7 +350,7 @@ public class CircuitImprintLoader { } private static void deleteCALRecipesAndTags() { - BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).mRecipeList.clear(); + BartWorksRecipeMaps.circuitAssemblyLineRecipes.getBackend().clearRecipes(); recipeTagMap.clear(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index 5da0462d82..7e1abb7a7a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -91,7 +91,7 @@ import static gregtech.api.enums.ItemList.Optical_Cpu_Containment_Housing; import static gregtech.api.enums.ItemList.Optically_Compatible_Memory; import static gregtech.api.enums.ItemList.Optically_Perfected_CPU; import static gregtech.api.enums.ItemList.values; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; +import static gregtech.api.recipe.RecipeMaps.assemblerRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import java.util.ArrayList; @@ -157,7 +157,7 @@ public class CircuitPartLoader implements Runnable { GT_Values.RA.stdBuilder().itemInputs(single.get(16).copy(), GT_Utility.getIntegratedCircuit(16)) .itemOutputs(BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs)) .fluidInputs(Materials.Plastic.getMolten(72)).duration(30 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(sAssemblerRecipes); + .addTo(assemblerRecipes); CircuitImprintLoader.circuitIIconRefs.put(CircuitImprintLoader.reverseIDs, single); CircuitImprintLoader.reverseIDs--; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java index c4838905e1..43a5a3dac3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -14,7 +14,7 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; import static gregtech.api.enums.Mods.Forestry; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes; +import static gregtech.api.recipe.RecipeMaps.fluidCannerRecipes; import static gregtech.api.util.GT_RecipeBuilder.TICKS; import java.util.List; @@ -63,10 +63,10 @@ public class GTMetaItemEnhancer { GT_Values.RA.stdBuilder().itemInputs(GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1)) .itemOutputs(new ItemStack(moltenCapsuls, 1, i)).fluidInputs(m.getMolten(144)) - .duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); + .duration(2 * TICKS).eut(2).addTo(fluidCannerRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(moltenCapsuls, 1, i)).fluidOutputs(m.getMolten(144)) - .duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); + .duration(2 * TICKS).eut(2).addTo(fluidCannerRecipes); } if (m.getFluid(1) == null && m.getGas(1) == null || OreDictionary.doesOreNameExist("capsule" + m.mName)) @@ -93,10 +93,10 @@ public class GTMetaItemEnhancer { GT_Utility.addFluidContainerData(emptyData); GT_Values.RA.stdBuilder().itemInputs(container).itemOutputs(new ItemStack(filled, 1, it)) - .fluidInputs(new FluidStack(f, amount)).duration(amount / 62).eut(2).addTo(sFluidCannerRecipes); + .fluidInputs(new FluidStack(f, amount)).duration(amount / 62).eut(2).addTo(fluidCannerRecipes); GT_Values.RA.stdBuilder().itemInputs(new ItemStack(filled, 1, it)).fluidOutputs(new FluidStack(f, amount)) - .duration(amount / 62).eut(2).addTo(sFluidCannerRecipes); + .duration(amount / 62).eut(2).addTo(fluidCannerRecipes); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 907689ad5e..15b83fb6ff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -72,11 +72,11 @@ import static gregtech.api.enums.OrePrefixes.dustSmall; import static gregtech.api.enums.OrePrefixes.dustTiny; import static gregtech.api.enums.OrePrefixes.ingot; import static gregtech.api.enums.OrePrefixes.nugget; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBlastRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMixerRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sSifterRecipes; +import static gregtech.api.recipe.RecipeMaps.blastFurnaceRecipes; +import static gregtech.api.recipe.RecipeMaps.centrifugeRecipes; +import static gregtech.api.recipe.RecipeMaps.fluidHeaterRecipes; +import static gregtech.api.recipe.RecipeMaps.mixerRecipes; +import static gregtech.api.recipe.RecipeMaps.sifterRecipes; import static gregtech.api.util.GT_RecipeBuilder.MINUTES; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeBuilder.TICKS; @@ -122,6 +122,8 @@ import gregtech.api.items.GT_Generic_Block; import gregtech.api.items.GT_Generic_Item; import gregtech.api.objects.ItemData; import gregtech.api.objects.MaterialStack; +import gregtech.api.recipe.RecipeMap; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -148,17 +150,17 @@ public class PlatinumSludgeOverHaul { Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(Materials.DilutedSulfuricAcid.getCells(3)).duration(1 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + .eut(TierEU.RECIPE_LV).addTo(mixerRecipes); GT_Values.RA.stdBuilder().itemInputs(Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(Materials.Empty.getCells(1)).fluidInputs(Materials.SulfuricAcid.getFluid(2000)) .fluidOutputs(Materials.DilutedSulfuricAcid.getFluid(3000)).duration(1 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + .eut(TierEU.RECIPE_LV).addTo(mixerRecipes); GT_Values.RA.stdBuilder().itemInputs(Materials.SulfuricAcid.getCells(2), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(Materials.Empty.getCells(2)).fluidInputs(Materials.Water.getFluid(1000)) .fluidOutputs(Materials.DilutedSulfuricAcid.getFluid(3000)).duration(1 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + .eut(TierEU.RECIPE_LV).addTo(mixerRecipes); // FormicAcid // CO + NaOH = CHO2Na GT_Values.RA.stdBuilder().itemInputs(Materials.CarbonMonoxide.getCells(1), Materials.SodiumHydroxide.getDust(3)) @@ -183,7 +185,7 @@ public class PlatinumSludgeOverHaul { Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(AquaRegia.get(cell, 2)).duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) - .addTo(sMixerRecipes); + .addTo(mixerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -191,18 +193,18 @@ public class PlatinumSludgeOverHaul { Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(2)) .itemOutputs(Materials.Empty.getCells(2)).fluidOutputs(AquaRegia.getFluidOrGas(2000)) - .duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(sMixerRecipes); + .duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(mixerRecipes); GT_Values.RA.stdBuilder().itemInputs(Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(3)) .itemOutputs(Materials.Empty.getCells(1)).fluidInputs(Materials.DilutedSulfuricAcid.getFluid(1000)) .fluidOutputs(AquaRegia.getFluidOrGas(2000)).duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) - .addTo(sMixerRecipes); + .addTo(mixerRecipes); GT_Values.RA.stdBuilder() .itemInputs(Materials.DilutedSulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(4)) .itemOutputs(Materials.Empty.getCells(1)).fluidInputs(Materials.NitricAcid.getFluid(1000)) .fluidOutputs(AquaRegia.getFluidOrGas(2000)).duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) - .addTo(sMixerRecipes); + .addTo(mixerRecipes); // AmmoniumChloride // NH3 + HCl = NH4Cl @@ -276,7 +278,7 @@ public class PlatinumSludgeOverHaul { // Pt GT_Values.RA.stdBuilder().itemInputs(PTMetallicPowder.get(dust, 3), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(Materials.Platinum.getNuggets(2)).duration(30 * SECONDS).eut(TierEU.RECIPE_MV) - .metadata(COIL_HEAT, Materials.Platinum.mMeltingPoint).addTo(sBlastRecipes); + .metadata(COIL_HEAT, Materials.Platinum.mMeltingPoint).addTo(blastFurnaceRecipes); GT_Values.RA.stdBuilder().itemInputs(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(PTResidue.get(dustTiny)).fluidInputs(AquaRegia.getFluidOrGas(1000)) @@ -295,7 +297,7 @@ public class PlatinumSludgeOverHaul { Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1)) .fluidInputs(AmmoniumChloride.getFluidOrGas(400)).fluidOutputs(PDAmmonia.getFluidOrGas(400)) - .duration(60 * SECONDS).eut(TierEU.RECIPE_LV).addTo(sCentrifugeRecipes); + .duration(60 * SECONDS).eut(TierEU.RECIPE_LV).addTo(centrifugeRecipes); GT_Values.RA.addMultiblockChemicalRecipe( new ItemStack[] { GT_Utility.getIntegratedCircuit(1) }, @@ -326,11 +328,11 @@ public class PlatinumSludgeOverHaul { PTSaltRefined.get(dust), PTSaltRefined.get(dust)) .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500).duration(30 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(sSifterRecipes); + .eut(TierEU.RECIPE_LV).addTo(sifterRecipes); GT_Values.RA.stdBuilder().itemInputs(PTSaltRefined.get(dust), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(PTMetallicPowder.get(dust)).fluidOutputs(Materials.Chlorine.getGas(87)) - .duration(10 * SECONDS).eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 900).addTo(sBlastRecipes); + .duration(10 * SECONDS).eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 900).addTo(blastFurnaceRecipes); // 2PtCl + Ca = 2Pt + CaCl2 @@ -368,7 +370,7 @@ public class PlatinumSludgeOverHaul { PDMetallicPowder.get(dust), PDMetallicPowder.get(dust)) .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500).duration(30 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(sSifterRecipes); + .eut(TierEU.RECIPE_LV).addTo(sifterRecipes); GT_Values.RA.addChemicalRecipeForBasicMachineOnly( PDRawPowder.get(dust, 4), @@ -401,13 +403,13 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.stdBuilder().itemInputs(PTResidue.get(dust), GT_Utility.getIntegratedCircuit(11)) .itemOutputs(LeachResidue.get(dust)).fluidInputs(PotassiumDisulfate.getMolten(360)) .fluidOutputs(RHSulfate.getFluidOrGas(360)).duration(10 * SECONDS).eut(TierEU.RECIPE_MV) - .metadata(COIL_HEAT, 775).addTo(sBlastRecipes); + .metadata(COIL_HEAT, 775).addTo(blastFurnaceRecipes); // Ru GT_Values.RA.stdBuilder().itemInputs(LeachResidue.get(dust, 10), Materials.Saltpeter.getDust(10)) .itemOutputs(SodiumRuthenate.get(dust, 3), IrOsLeachResidue.get(dust, 6)) .fluidInputs(Materials.SaltWater.getFluid(1000)).fluidOutputs(GT_ModHandler.getSteam(1000)) - .duration(10 * SECONDS).eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 775).addTo(sBlastRecipes); + .duration(10 * SECONDS).eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 775).addTo(blastFurnaceRecipes); GT_Values.RA.stdBuilder().itemInputs(SodiumRuthenate.get(dust, 6), Materials.Chlorine.getCells(3)) .itemOutputs(Materials.Empty.getCells(3)).fluidOutputs(RutheniumTetroxideSollution.getFluidOrGas(9000)) @@ -416,7 +418,7 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(1)) .fluidInputs(RutheniumTetroxideSollution.getFluidOrGas(800)) .fluidOutputs(HotRutheniumTetroxideSollution.getFluidOrGas(800)).duration(15 * SECONDS) - .eut(TierEU.RECIPE_HV).addTo(sFluidHeaterRecipes); + .eut(TierEU.RECIPE_HV).addTo(fluidHeaterRecipes); GT_Values.RA.addCrackingRecipe( 17, @@ -441,7 +443,7 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.stdBuilder().itemInputs(IrOsLeachResidue.get(dust, 4), GT_Utility.getIntegratedCircuit(11)) .itemOutputs(IrLeachResidue.get(dust, 2)).fluidInputs(Materials.HydrochloricAcid.getFluid(1000)) .fluidOutputs(AcidicOsmiumSolution.getFluidOrGas(2000)).duration(10 * SECONDS).eut(TierEU.RECIPE_MV) - .metadata(COIL_HEAT, 775).addTo(sBlastRecipes); + .metadata(COIL_HEAT, 775).addTo(blastFurnaceRecipes); GT_Values.RA.addDistillationTowerRecipe( AcidicOsmiumSolution.getFluidOrGas(1000), @@ -458,7 +460,7 @@ public class PlatinumSludgeOverHaul { // Ir GT_Values.RA.stdBuilder().itemInputs(IrLeachResidue.get(dust), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(PGSDResidue.get(dust), IridiumDioxide.get(dust)).duration(10 * SECONDS) - .eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 775).addTo(sBlastRecipes); + .eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 775).addTo(blastFurnaceRecipes); GT_Values.RA.stdBuilder().itemInputs(IridiumDioxide.get(dust), Materials.HydrochloricAcid.getCells(1)) .itemOutputs(Materials.Empty.getCells(1)).fluidOutputs(AcidicIridiumSolution.getFluidOrGas(1000)) @@ -495,11 +497,11 @@ public class PlatinumSludgeOverHaul { GT_Values.RA.stdBuilder().itemInputs(CrudeRhMetall.get(dust), Materials.Salt.getDust(1)) .itemOutputs(RHSalt.get(dust, 3)).fluidInputs(Materials.Chlorine.getGas(1000)).duration(15 * SECONDS) - .eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 600).addTo(sBlastRecipes); + .eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 600).addTo(blastFurnaceRecipes); GT_Values.RA.stdBuilder().itemInputs(RHSalt.get(dust, 10)).fluidInputs(Materials.Water.getFluid(2000)) .fluidOutputs(RHSaltSolution.getFluidOrGas(2000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(sMixerRecipes); + .addTo(mixerRecipes); GT_Values.RA.stdBuilder().itemInputs(SodiumNitrate.get(dust, 5), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(RHNitrate.get(dust), Materials.Salt.getDust(2)) @@ -523,11 +525,11 @@ public class PlatinumSludgeOverHaul { RhFilterCake.get(dust), RhFilterCake.get(dust)) .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500).duration(30 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(sSifterRecipes); + .eut(TierEU.RECIPE_LV).addTo(sifterRecipes); GT_Values.RA.stdBuilder().itemInputs(RhFilterCake.get(dust)).fluidInputs(Materials.Water.getFluid(1000)) .fluidOutputs(RHFilterCakeSolution.getFluidOrGas(1000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(sMixerRecipes); + .addTo(mixerRecipes); GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(2)).itemOutputs(ReRh.get(dust)) .fluidInputs(RHFilterCakeSolution.getFluidOrGas(1000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) @@ -584,21 +586,22 @@ public class PlatinumSludgeOverHaul { e.printStackTrace(); } // gt machines - maploop: for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - if (map == GT_Recipe.GT_Recipe_Map.sFusionRecipes || map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes - || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes - || "gt.recipe.eyeofharmony".equals(map.mUnlocalizedName) - || "gtpp.recipe.quantumforcesmelter".equals(map.mUnlocalizedName)) + maploop: for (RecipeMap map : RecipeMap.ALL_RECIPE_MAPS.values()) { + if (map == RecipeMaps.fusionRecipes || map == RecipeMaps.unpackagerRecipes + || map == RecipeMaps.packagerRecipes + || map == RecipeMaps.replicatorRecipes + || "gt.recipe.eyeofharmony".equals(map.unlocalizedName) + || "gtpp.recipe.quantumforcesmelter".equals(map.unlocalizedName)) continue; HashSet toDel = new HashSet<>(); - recipeloop: for (GT_Recipe recipe : map.mRecipeList) { + recipeloop: for (GT_Recipe recipe : map.getAllRecipes()) { if (recipe.mFakeRecipe) continue maploop; for (int i = 0; i < recipe.mFluidOutputs.length; i++) { - if (map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes)) continue maploop; - if ("gtpp.recipe.alloyblastsmelter".equals(map.mUnlocalizedName)) continue maploop; - if (map.equals(GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) - || map.equals(GT_Recipe.GT_Recipe_Map.sChemicalRecipes)) { + if (map.equals(RecipeMaps.fluidExtractionRecipes)) continue maploop; + if ("gtpp.recipe.alloyblastsmelter".equals(map.unlocalizedName)) continue maploop; + if (map.equals(RecipeMaps.multiblockChemicalReactorRecipes) + || map.equals(RecipeMaps.chemicalReactorRecipes)) { if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i]) || GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) toDel.add(recipe); @@ -753,7 +756,7 @@ public class PlatinumSludgeOverHaul { } } } - map.mRecipeList.removeAll(toDel); + map.getBackend().removeRecipes(toDel); } // TODO: remove EnderIO recipes @@ -775,7 +778,7 @@ public class PlatinumSludgeOverHaul { Materials.Nikolite.getDust(8), 1800, 120); - for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList) { + for (GT_Recipe recipe : RecipeMaps.circuitAssemblerRecipes.getAllRecipes()) { if (recipe.mEUt > 512) continue; if (BW_Util.checkStackAndPrefix(recipe.mOutputs[0])) { for (int i = 0; i < recipe.mInputs.length; i++) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java index b11eb10d4d..5d1644ae2b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java @@ -15,7 +15,7 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import static gregtech.api.enums.OrePrefixes.dust; import static gregtech.api.enums.OrePrefixes.dustSmall; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; +import static gregtech.api.recipe.RecipeMaps.centrifugeRecipes; import static gregtech.api.util.GT_RecipeBuilder.MINUTES; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeBuilder.TICKS; @@ -43,7 +43,7 @@ public class AddSomeRecipes implements Runnable { GT_OreDictUnificator.get(dust, Materials.Platinum, 1L)) .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00) .fluidOutputs(WerkstoffLoader.Xenon.getFluidOrGas(1)).duration(12 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_EV).addTo(sCentrifugeRecipes); + .eut(TierEU.RECIPE_EV).addTo(centrifugeRecipes); GT_Values.RA.stdBuilder().itemInputs(BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1)) .itemOutputs( @@ -55,7 +55,7 @@ public class AddSomeRecipes implements Runnable { GT_OreDictUnificator.get(dust, Materials.Platinum, 2L)) .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00) .fluidOutputs(WerkstoffLoader.Xenon.getFluidOrGas(2)).duration(12 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_EV).addTo(sCentrifugeRecipes); + .eut(TierEU.RECIPE_EV).addTo(centrifugeRecipes); GT_Values.RA.stdBuilder().itemInputs(BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1)) .itemOutputs( @@ -67,7 +67,7 @@ public class AddSomeRecipes implements Runnable { GT_OreDictUnificator.get(dust, Materials.Platinum, 4L)) .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00) .fluidOutputs(WerkstoffLoader.Xenon.getFluidOrGas(4)).duration(50 * SECONDS).eut(TierEU.RECIPE_EV) - .addTo(sCentrifugeRecipes); + .addTo(centrifugeRecipes); GT_Values.RA.stdBuilder().itemInputs(BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1)) .itemOutputs( @@ -78,7 +78,7 @@ public class AddSomeRecipes implements Runnable { GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 48L)) .outputChances(100_00, 50_00, 50_00, 100_00, 100_00, 100_00).duration(1 * MINUTES + 40 * SECONDS) - .eut(TierEU.RECIPE_IV).addTo(sCentrifugeRecipes); + .eut(TierEU.RECIPE_IV).addTo(centrifugeRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index b7387653b2..d08ae368bf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -16,7 +16,6 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import static com.github.bartimaeusnek.bartworks.util.BW_Util.CLEANROOM; import static gregtech.api.enums.Mods.Gendustry; import static gregtech.api.enums.OrePrefixes.bolt; -import static gregtech.api.enums.OrePrefixes.cell; import static gregtech.api.enums.OrePrefixes.crushed; import static gregtech.api.enums.OrePrefixes.crushedPurified; import static gregtech.api.enums.OrePrefixes.dust; @@ -27,17 +26,17 @@ import static gregtech.api.enums.OrePrefixes.gemExquisite; import static gregtech.api.enums.OrePrefixes.gemFlawed; import static gregtech.api.enums.OrePrefixes.stick; import static gregtech.api.enums.OrePrefixes.stickLong; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sSifterRecipes; +import static gregtech.api.recipe.RecipeMaps.autoclaveRecipes; +import static gregtech.api.recipe.RecipeMaps.centrifugeRecipes; +import static gregtech.api.recipe.RecipeMaps.primitiveBlastRecipes; +import static gregtech.api.recipe.RecipeMaps.sifterRecipes; import static gregtech.api.util.GT_RecipeBuilder.MINUTES; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeBuilder.TICKS; import static gregtech.api.util.GT_RecipeConstants.ADDITIVE_AMOUNT; -import java.lang.reflect.Field; -import java.util.Map; +import java.util.Arrays; +import java.util.List; import java.util.Objects; import net.minecraft.init.Items; @@ -46,8 +45,10 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import org.apache.commons.lang3.reflect.FieldUtils; +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.commons.lang3.tuple.Pair; +import com.github.bartimaeusnek.bartworks.API.recipe.BartWorksRecipeMaps; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; @@ -55,9 +56,7 @@ import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.BioCulture; import com.github.bartimaeusnek.bartworks.util.BioDNA; @@ -65,26 +64,21 @@ import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; import gregtech.api.GregTech_API; -import gregtech.api.enums.Element; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TierEU; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_RecipeConstants; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; public class AdditionalRecipes { - private static BWRecipes.BW_Recipe_Map_LiquidFuel sAcidGenFuels = (BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance - .getMappingsFor((byte) 2); - private static BWRecipes.BacteriaVatRecipeMap sBacteriaVat = (BWRecipes.BacteriaVatRecipeMap) BWRecipes.instance - .getMappingsFor((byte) 1); - private static GT_Recipe.GT_Recipe_Map sBiolab = BWRecipes.instance.getMappingsFor((byte) 0); - private static void runBWRecipes() { if (ConfigHandler.BioLab) { @@ -97,7 +91,7 @@ public class AdditionalRecipes { ItemStack Detergent = BioItemList.getOther(1); ItemStack DNAFlask = BioItemList.getDNASampleFlask(null); ItemStack EthanolCell = Materials.Ethanol.getCells(1); - sBiolab.addFakeRecipe( + BartWorksRecipeMaps.bioLabRecipes.addFakeRecipe( false, new ItemStack[] { stack, DNAFlask, Detergent, EthanolCell }, new ItemStack[] { BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(DNA)), @@ -120,7 +114,7 @@ public class AdditionalRecipes { Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); Behaviour_DataOrb.setDataName(Outp, DNA.getName()); - sBiolab.addFakeRecipe( + BartWorksRecipeMaps.bioLabRecipes.addFakeRecipe( false, new ItemStack[] { stack, FluidLoader.BioLabFluidCells[0], FluidLoader.BioLabFluidCells[3], ItemList.Tool_DataOrb.get(1L) }, @@ -146,7 +140,7 @@ public class AdditionalRecipes { Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); - sBiolab.addFakeRecipe( + BartWorksRecipeMaps.bioLabRecipes.addFakeRecipe( false, new ItemStack[] { FluidLoader.BioLabFluidCells[1], BioItemList.getPlasmidCell(null), inp, inp2 }, @@ -165,7 +159,7 @@ public class AdditionalRecipes { BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); BioData Plasmid = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("Plasmid")); if (!Objects.equals(DNA.getName(), Plasmid.getName())) { - sBiolab.addFakeRecipe( + BartWorksRecipeMaps.bioLabRecipes.addFakeRecipe( true, new ItemStack[] { BioItemList.getPetriDish(BioCulture.getBioCulture(DNA.getName())), BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(Plasmid)), @@ -185,7 +179,7 @@ public class AdditionalRecipes { Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); Behaviour_DataOrb.setDataName(Outp, "Any DNA"); // Clonal Cellular Synthesis- [Liquid DNA] + Medium Petri Dish + Plasma Membrane + Stem Cells + Genome Data - sBiolab.addFakeRecipe( + BartWorksRecipeMaps.bioLabRecipes.addFakeRecipe( false, new ItemStack[] { BioItemList.getPetriDish(null), BioItemList.getOther(4), ItemList.Circuit_Chip_Stemcell.get(2L), Outp }, @@ -204,11 +198,11 @@ public class AdditionalRecipes { for (FluidStack fluidStack : easyFluids) { for (BioCulture bioCulture : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (bioCulture.isBreedable() && bioCulture.getTier() == 0) { - sBacteriaVat.addRecipe( + BartWorksRecipeMaps.bacterialVatRecipes.addRecipe( // boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, // int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, // int aEUt, int aSpecialValue - new BWRecipes.BacteriaVatRecipe( + new GT_Recipe( true, new ItemStack[] { GT_Utility.getIntegratedCircuit(1), new ItemStack(Items.sugar, 64) }, @@ -219,12 +213,11 @@ public class AdditionalRecipes { new FluidStack[] { new FluidStack(bioCulture.getFluid(), 10) }, 1000, (int) TierEU.RECIPE_HV, - BW_Util.STANDART), - true); + BW_Util.STANDART)); // aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, // aDuration, aEUt, aSpecialValue - sBiolab.addRecipe( - new BWRecipes.DynamicGTRecipe( + BartWorksRecipeMaps.bioLabRecipes.addRecipe( + new GT_Recipe( false, new ItemStack[] { BioItemList.getPetriDish(null), fluidStack.equals(Materials.Water.getFluid(1000L)) @@ -245,17 +238,25 @@ public class AdditionalRecipes { } } - sAcidGenFuels.addLiquidFuel(Materials.PhosphoricAcid, 36); - sAcidGenFuels.addLiquidFuel(Materials.DilutedHydrochloricAcid, 14); - sAcidGenFuels.addLiquidFuel(Materials.HypochlorousAcid, 30); - sAcidGenFuels.addLiquidFuel(Materials.HydrofluoricAcid, 40); - sAcidGenFuels.addLiquidFuel(Materials.HydrochloricAcid, 28); - sAcidGenFuels.addLiquidFuel(Materials.NitricAcid, 24); - sAcidGenFuels.addLiquidFuel(Materials.Mercury, 32); - sAcidGenFuels.addLiquidFuel(Materials.DilutedSulfuricAcid, 9); - sAcidGenFuels.addLiquidFuel(Materials.SulfuricAcid, 18); - sAcidGenFuels.addLiquidFuel(Materials.AceticAcid, 11); - sAcidGenFuels.addMoltenFuel(Materials.Redstone, 10); + List> liquidFuels = Arrays.asList( + ImmutablePair.of(Materials.PhosphoricAcid, 36), + ImmutablePair.of(Materials.DilutedHydrochloricAcid, 14), + ImmutablePair.of(Materials.HypochlorousAcid, 30), + ImmutablePair.of(Materials.HydrofluoricAcid, 40), + ImmutablePair.of(Materials.HydrochloricAcid, 28), + ImmutablePair.of(Materials.NitricAcid, 24), + ImmutablePair.of(Materials.Mercury, 32), + ImmutablePair.of(Materials.DilutedSulfuricAcid, 9), + ImmutablePair.of(Materials.SulfuricAcid, 18), + ImmutablePair.of(Materials.AceticAcid, 11), + ImmutablePair.of(WerkstoffLoader.FormicAcid.getBridgeMaterial(), 40)); + for (Pair fuel : liquidFuels) { + GT_Values.RA.stdBuilder().itemInputs(fuel.getLeft().getCells(1)).itemOutputs(Materials.Empty.getCells(1)) + .metadata(GT_RecipeConstants.FUEL_VALUE, fuel.getRight()).addTo(BartWorksRecipeMaps.acidGenFuels); + } + GT_Values.RA.stdBuilder().itemInputs(GT_OreDictUnificator.get(OrePrefixes.cellMolten, Materials.Redstone, 1)) + .itemOutputs(Materials.Empty.getCells(1)).metadata(GT_RecipeConstants.FUEL_VALUE, 10) + .addTo(BartWorksRecipeMaps.acidGenFuels); } @SuppressWarnings("deprecation") @@ -266,8 +267,6 @@ public class AdditionalRecipes { 4, WerkstoffLoader.AdemicSteel.get(dust), null); - ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)) - .addLiquidFuel(WerkstoffLoader.FormicAcid.getBridgeMaterial(), 40); // Thorium/Yttrium Glas GT_Values.RA.addBlastRecipe( WerkstoffLoader.YttriumOxide.get(dustSmall, 2), @@ -289,7 +288,7 @@ public class AdditionalRecipes { Materials.Thorium.getDust(1), WerkstoffLoader.Thorium232.get(dust)) .outputChances(7000, 1300, 700, 600, 300, 100).duration(20 * SECONDS).eut((int) TierEU.RECIPE_IV) - .addTo(sSifterRecipes); + .addTo(sifterRecipes); // 3ThO2 + 4Al = 3Th + 2Al2O3 GT_Values.RA.addChemicalRecipe( @@ -332,7 +331,7 @@ public class AdditionalRecipes { GT_Values.RA.stdBuilder().itemInputs(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L)) .itemOutputs(Materials.Amethyst.getDust(10)).duration(40 * SECONDS).eut(0).metadata(ADDITIVE_AMOUNT, 6) - .addTo(sPrimitiveBlastRecipes); + .addTo(primitiveBlastRecipes); // Cubic Circonia // 2Y + 3O = Y2O3 @@ -345,7 +344,7 @@ public class AdditionalRecipes { 4096, (int) TierEU.RECIPE_LV); // Zr + 2O =Y22O3= ZrO2 - GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe( + RecipeMaps.blastFurnaceRecipes.addRecipe( false, new ItemStack[] { WerkstoffLoader.Zirconium.get(dust, 10), WerkstoffLoader.YttriumOxide.get(dust, 0) }, new ItemStack[] { WerkstoffLoader.CubicZirconia.get(gemFlawed, 40) }, @@ -395,12 +394,12 @@ public class AdditionalRecipes { GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.MagnetoResonaticDust.get(dust)) .itemOutputs(WerkstoffLoader.MagnetoResonaticDust.get(gemChipped, 9)).outputChances(90_00) .fluidInputs(WerkstoffLoader.Neon.getFluidOrGas(1000)).duration(3 * MINUTES + 45 * SECONDS) - .eut(TierEU.RECIPE_IV).addTo(sAutoclaveRecipes); + .eut(TierEU.RECIPE_IV).addTo(autoclaveRecipes); GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.MagnetoResonaticDust.get(dust)) .itemOutputs(WerkstoffLoader.MagnetoResonaticDust.get(gem)) .fluidInputs(WerkstoffLoader.Krypton.getFluidOrGas(1000)).duration(3 * MINUTES + 45 * SECONDS) - .eut(TierEU.RECIPE_IV).addTo(sAutoclaveRecipes); + .eut(TierEU.RECIPE_IV).addTo(autoclaveRecipes); // Milk @@ -414,7 +413,7 @@ public class AdditionalRecipes { Materials.Phosphor.getDustTiny(1)) .outputChances(100_00, 100_00, 10_00, 100_00, 10_00, 10_00).fluidInputs(Materials.Milk.getFluid(10000)) .fluidOutputs(Materials.Water.getFluid(8832)).duration(2 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_MV) - .addTo(sCentrifugeRecipes); + .addTo(centrifugeRecipes); // Magneto Resonatic Circuits @@ -426,8 +425,8 @@ public class AdditionalRecipes { ? FluidRegistry.getFluid("molten.mutatedlivingsolder") : FluidRegistry.getFluid("molten.solderingalloy"); // ULV - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( - new BWRecipes.DynamicGTRecipe( + RecipeMaps.circuitAssemblerRecipes.add( + new GT_Recipe( false, new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), WerkstoffLoader.MagnetoResonaticDust.get(gem), ItemList.NandChip.get(1), @@ -443,8 +442,8 @@ public class AdditionalRecipes { CLEANROOM)); // LV-EV for (int i = 1; i <= 4; i++) { - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( - new BWRecipes.DynamicGTRecipe( + RecipeMaps.circuitAssemblerRecipes.add( + new GT_Recipe( false, new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), WerkstoffLoader.MagnetoResonaticDust.get(gem), @@ -463,8 +462,8 @@ public class AdditionalRecipes { } // IV-LuV for (int i = 5; i <= 6; i++) { - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( - new BWRecipes.DynamicGTRecipe( + RecipeMaps.circuitAssemblerRecipes.add( + new GT_Recipe( false, new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), WerkstoffLoader.MagnetoResonaticDust.get(gem), @@ -482,8 +481,8 @@ public class AdditionalRecipes { CLEANROOM)); } // ZPM - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( - new BWRecipes.DynamicGTRecipe( + RecipeMaps.circuitAssemblerRecipes.add( + new GT_Recipe( false, new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, 1), @@ -500,8 +499,8 @@ public class AdditionalRecipes { BW_Util.getMachineVoltageFromTier(7 + 1), CLEANROOM)); // UV - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( - new BWRecipes.DynamicGTRecipe( + RecipeMaps.circuitAssemblerRecipes.add( + new GT_Recipe( false, new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, 1), @@ -519,8 +518,8 @@ public class AdditionalRecipes { CLEANROOM)); // UHV-UEV for (int i = 9; i <= 10; i++) { - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( - new BWRecipes.DynamicGTRecipe( + RecipeMaps.circuitAssemblerRecipes.add( + new GT_Recipe( false, new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, 1), @@ -537,7 +536,7 @@ public class AdditionalRecipes { BW_Util.getMachineVoltageFromTier(i + 1), CLEANROOM)); } - GT_Recipe.GT_Recipe_Map.sSmallNaquadahReactorFuels.addRecipe( + RecipeMaps.smallNaquadahReactorFuels.addRecipe( true, new ItemStack[] { WerkstoffLoader.Tiberium.get(bolt) }, new ItemStack[] {}, @@ -547,7 +546,7 @@ public class AdditionalRecipes { 0, 0, 12500); - GT_Recipe.GT_Recipe_Map.sLargeNaquadahReactorFuels.addRecipe( + RecipeMaps.largeNaquadahReactorFuels.addRecipe( true, new ItemStack[] { WerkstoffLoader.Tiberium.get(stick) }, new ItemStack[] {}, @@ -558,45 +557,36 @@ public class AdditionalRecipes { 0, 62500); - try { - Class map = GT_Recipe.GT_Recipe_Map.class; - GT_Recipe.GT_Recipe_Map sHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils - .getField(map, "sHugeNaquadahReactorFuels").get(null); - GT_Recipe.GT_Recipe_Map sExtremeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils - .getField(map, "sExtremeNaquadahReactorFuels").get(null); - GT_Recipe.GT_Recipe_Map sUltraHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils - .getField(map, "sUltraHugeNaquadahReactorFuels").get(null); - sHugeNaquadahReactorFuels.addRecipe( - true, - new ItemStack[] { WerkstoffLoader.Tiberium.get(stickLong) }, - new ItemStack[] {}, - null, - null, - null, - 0, - 0, - 125000); - sExtremeNaquadahReactorFuels.addRecipe( - true, - new ItemStack[] { WerkstoffLoader.Tiberium.get(stick) }, - new ItemStack[] {}, - null, - null, - null, - 0, - 0, - 31250); - sUltraHugeNaquadahReactorFuels.addRecipe( - true, - new ItemStack[] { WerkstoffLoader.Tiberium.get(stickLong) }, - new ItemStack[] {}, - null, - null, - null, - 0, - 0, - 125000); - } catch (NullPointerException | IllegalAccessException ignored) {} + RecipeMaps.hugeNaquadahReactorFuels.addRecipe( + true, + new ItemStack[] { WerkstoffLoader.Tiberium.get(stickLong) }, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 125000); + RecipeMaps.extremeNaquadahReactorFuels.addRecipe( + true, + new ItemStack[] { WerkstoffLoader.Tiberium.get(stick) }, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 31250); + RecipeMaps.ultraHugeNaquadahReactorFuels.addRecipe( + true, + new ItemStack[] { WerkstoffLoader.Tiberium.get(stickLong) }, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 125000); LoadItemContainers.run(); @@ -638,73 +628,5 @@ public class AdditionalRecipes { (int) TierEU.RECIPE_LuV); GregTech_API.sAfterGTPostload.add(new AddSomeRecipes()); - AdditionalRecipes.oldGThelperMethod(); - } - - @SuppressWarnings("unchecked") - private static void oldGThelperMethod() { - // manual override for older GT - Werkstoff werkstoff = WerkstoffLoader.Oganesson; - Materials werkstoffBridgeMaterial = null; - boolean aElementSet = false; - for (Element e : Element.values()) { - if ("Uuo".equals(e.toString())) { - werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() - : new Materials( - -1, - werkstoff.getTexSet(), - 0, - 0, - 0, - false, - werkstoff.getDefaultName(), - werkstoff.getDefaultName()); - werkstoffBridgeMaterial.mElement = e; - e.mLinkedMaterials.add(werkstoffBridgeMaterial); - aElementSet = true; - werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); - break; - } - } - if (!aElementSet) return; - - GT_OreDictUnificator.addAssociation(cell, werkstoffBridgeMaterial, werkstoff.get(cell), false); - try { - Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); - f.setAccessible(true); - Map MATERIALS_MAP = (Map) f.get(null); - MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); - } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { - e.printStackTrace(); - } - ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); - Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[] { werkstoff.get(cell) }, - new ItemStack[] { scannerOutput }, - ItemList.Tool_DataOrb.get(1L), - null, - null, - null, - (int) (werkstoffBridgeMaterial.getMass() * 8192L), - 30, - 0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe( - false, - new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[] { Materials.Empty.getCells(1) }, - new ItemStack[] { werkstoff.get(cell) }, - scannerOutput, - null, - new FluidStack[] { Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass()) }, - null, - (int) (werkstoffBridgeMaterial.getMass() * 512L), - 30, - 0)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java index 7b5886bbde..2aa7394435 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java @@ -20,23 +20,24 @@ import java.util.Set; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.StreamUtils; +import gregtech.api.recipe.RecipeMap; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GT_Recipe; public class DownTierLoader { public static void run() { - GT_Recipe.GT_Recipe_Map.sMappings.stream() - .filter(map -> StreamUtils.filterVisualMaps(map) && map != GT_Recipe.GT_Recipe_Map.sFusionRecipes) - .forEach(map -> { + RecipeMap.ALL_RECIPE_MAPS.values().stream() + .filter(map -> StreamUtils.filterVisualMaps(map) && map != RecipeMaps.fusionRecipes).forEach(map -> { Set newRecipes = new HashSet<>(); Set toRem = new HashSet<>(); - map.mRecipeList.stream().filter(recipe -> Objects.nonNull(recipe) && recipe.mEUt > 128) + map.getAllRecipes().stream().filter(recipe -> Objects.nonNull(recipe) && recipe.mEUt > 128) .forEach(recipe -> { toRem.add(recipe); newRecipes.add(BW_Util.copyAndSetTierToNewRecipe(recipe, (byte) 2)); }); - map.mRecipeList.removeAll(toRem); - map.mRecipeList.addAll(newRecipes); + map.getBackend().removeRecipes(toRem); + newRecipes.forEach(map::add); }); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java index 7ba97bf837..b0402b1d1d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java @@ -17,8 +17,8 @@ import static gregtech.api.enums.OrePrefixes.block; import static gregtech.api.enums.OrePrefixes.cellMolten; import static gregtech.api.enums.OrePrefixes.ingot; import static gregtech.api.enums.OrePrefixes.plate; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCutterRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes; +import static gregtech.api.recipe.RecipeMaps.cutterRecipes; +import static gregtech.api.recipe.RecipeMaps.fluidExtractionRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeBuilder.TICKS; import static gregtech.api.util.GT_RecipeConstants.UniversalArcFurnace; @@ -28,6 +28,8 @@ import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWer import gregtech.api.enums.GT_Values; import gregtech.api.enums.TierEU; +import gregtech.api.recipe.RecipeCategories; +import gregtech.api.util.GT_RecipeConstants; public class BlockLoader implements IWerkstoffRunnable { @@ -36,19 +38,20 @@ public class BlockLoader implements IWerkstoffRunnable { if (!werkstoff.hasItemType(block)) return; if (werkstoff.hasItemType(ingot)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).itemOutputs(werkstoff.get(ingot, 9)) - .duration(16 * TICKS).eut(90).addTo(UniversalArcFurnace); + .duration(16 * TICKS).eut(90).metadata(GT_RecipeConstants.RECYCLE, true).addTo(UniversalArcFurnace); } if (werkstoff.hasItemType(cellMolten)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).fluidOutputs(werkstoff.getMolten(1296)) - .duration(14 * SECONDS + 8 * TICKS).eut(8).addTo(sFluidExtractionRecipes); + .recipeCategory(RecipeCategories.fluidExtractorRecycling).duration(14 * SECONDS + 8 * TICKS).eut(8) + .addTo(fluidExtractionRecipes); } if (werkstoff.hasItemType(plate)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).itemOutputs(werkstoff.get(plate, 9)) .duration((int) Math.max(werkstoff.getStats().getMass() * 10L, 1L)).eut(TierEU.RECIPE_LV) - .addTo(sCutterRecipes); + .addTo(cutterRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java index 7942554934..967a25665e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java @@ -21,7 +21,7 @@ import static gregtech.api.enums.OrePrefixes.plank; import static gregtech.api.enums.OrePrefixes.plate; import static gregtech.api.enums.OrePrefixes.plateDouble; import static gregtech.api.enums.OrePrefixes.screw; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; +import static gregtech.api.recipe.RecipeMaps.assemblerRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import com.github.bartimaeusnek.bartworks.system.material.BW_GT_MaterialReference; @@ -60,7 +60,7 @@ public class CasingLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder() .itemInputs(werkstoff.get(plate, 6), werkstoff.get(screw, 2), werkstoff.get(gearGtSmall)) .itemOutputs(werkstoff.get(blockCasing)).duration(10 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(sAssemblerRecipes); + .addTo(assemblerRecipes); GT_ModHandler.addCraftingRecipe( werkstoff.get(blockCasingAdvanced), @@ -70,6 +70,6 @@ public class CasingLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder() .itemInputs(werkstoff.get(reboltedCasingsOuterStuff, 6), werkstoff.get(screw, 2), werkstoff.get(gearGt)) .itemOutputs(werkstoff.get(blockCasingAdvanced)).duration(10 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(sAssemblerRecipes); + .addTo(assemblerRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java index 3382697708..379424d9d4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java @@ -17,9 +17,9 @@ import static gregtech.api.enums.Mods.Forestry; import static gregtech.api.enums.OrePrefixes.capsule; import static gregtech.api.enums.OrePrefixes.cell; import static gregtech.api.enums.OrePrefixes.dust; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes; +import static gregtech.api.recipe.RecipeMaps.fluidCannerRecipes; +import static gregtech.api.recipe.RecipeMaps.fluidExtractionRecipes; +import static gregtech.api.recipe.RecipeMaps.fluidSolidifierRecipes; import static gregtech.api.util.GT_RecipeBuilder.TICKS; import java.util.ArrayList; @@ -34,7 +34,6 @@ import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.Pair; import gregtech.api.enums.Element; @@ -43,6 +42,8 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.TextureSet; import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.recipe.RecipeCategories; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -139,8 +140,8 @@ public class CellLoader implements IWerkstoffRunnable { int cellEmpty = cells - 1; stOutputs.add(Materials.Empty.getCells(-cellEmpty)); - if (werkstoff.getStats().isElektrolysis()) GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add( - new BWRecipes.DynamicGTRecipe( + if (werkstoff.getStats().isElektrolysis()) RecipeMaps.electrolyzerRecipes.add( + new GT_Recipe( true, new ItemStack[] { input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null }, stOutputs.toArray(new ItemStack[0]), @@ -155,8 +156,8 @@ public class CellLoader implements IWerkstoffRunnable { * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); - if (werkstoff.getStats().isCentrifuge()) GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add( - new BWRecipes.DynamicGTRecipe( + if (werkstoff.getStats().isCentrifuge()) RecipeMaps.centrifugeRecipes.add( + new GT_Recipe( true, new ItemStack[] { input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null }, stOutputs.toArray(new ItemStack[0]), @@ -186,11 +187,11 @@ public class CellLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(Materials.Empty.getCells(1)).itemOutputs(werkstoff.get(cell)) .fluidInputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)) - .duration(16 * TICKS).eut(2).addTo(sFluidCannerRecipes); + .duration(16 * TICKS).eut(2).addTo(fluidCannerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(cell)).itemOutputs(Materials.Empty.getCells(1)) .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)) - .duration(16 * TICKS).eut(2).addTo(sFluidCannerRecipes); + .duration(16 * TICKS).eut(2).addTo(fluidCannerRecipes); if (Forestry.isModLoaded()) { FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( @@ -203,18 +204,18 @@ public class CellLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(capsule)) .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)) - .duration(16 * TICKS).eut(2).addTo(sFluidCannerRecipes); + .duration(16 * TICKS).eut(2).addTo(fluidCannerRecipes); } if (werkstoff.hasItemType(dust)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust)).fluidOutputs(werkstoff.getFluidOrGas(1000)) .duration(werkstoff.getStats().getMass()).eut(werkstoff.getStats().getMass() > 128 ? 64 : 30) - .addTo(sFluidExtractionRecipes); + .recipeCategory(RecipeCategories.fluidExtractorRecycling).addTo(fluidExtractionRecipes); GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(1)).itemOutputs(werkstoff.get(dust)) .fluidInputs(werkstoff.getFluidOrGas(1000)).duration((int) werkstoff.getStats().getMass()) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); } @@ -247,9 +248,9 @@ public class CellLoader implements IWerkstoffRunnable { ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( + RecipeMaps.scannerFakeRecipes.addFakeRecipe( false, - new BWRecipes.DynamicGTRecipe( + new GT_Recipe( false, new ItemStack[] { werkstoff.get(cell) }, new ItemStack[] { scannerOutput }, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java index 9878a51539..57986cdfe3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java @@ -28,12 +28,12 @@ import static gregtech.api.enums.OrePrefixes.rotor; import static gregtech.api.enums.OrePrefixes.screw; import static gregtech.api.enums.OrePrefixes.stick; import static gregtech.api.enums.OrePrefixes.wireFine; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCutterRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sExtruderRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sLatheRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sWiremillRecipes; +import static gregtech.api.recipe.RecipeMaps.assemblerRecipes; +import static gregtech.api.recipe.RecipeMaps.cutterRecipes; +import static gregtech.api.recipe.RecipeMaps.extruderRecipes; +import static gregtech.api.recipe.RecipeMaps.latheRecipes; +import static gregtech.api.recipe.RecipeMaps.maceratorRecipes; +import static gregtech.api.recipe.RecipeMaps.wiremillRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeBuilder.TICKS; @@ -63,18 +63,18 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { ItemList.Shape_Extruder_Bolt.get(0L)) .itemOutputs(werkstoff.get(bolt, 8)) .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1)).eut(8 * tVoltageMultiplier) - .addTo(sExtruderRecipes); + .addTo(extruderRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick)).itemOutputs(werkstoff.get(bolt, 4)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)).eut(4).addTo(sCutterRecipes); + .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)).eut(4).addTo(cutterRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(bolt)).itemOutputs(werkstoff.get(dustTiny, 1)) - .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); // screw GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(bolt)).itemOutputs(werkstoff.get(screw)) - .duration((int) Math.max(werkstoff.getStats().getMass() / 8L, 1L)).eut(4).addTo(sLatheRecipes); + .duration((int) Math.max(werkstoff.getStats().getMass() / 8L, 1L)).eut(4).addTo(latheRecipes); GT_ModHandler.addCraftingRecipe( werkstoff.get(screw), @@ -82,7 +82,7 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { new Object[] { "fX", "X ", 'X', werkstoff.get(bolt) }); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(screw)).itemOutputs(werkstoff.get(dustTiny, 1)) - .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); if (werkstoff.hasItemType(gem)) return; @@ -91,7 +91,7 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Ring.get(0L)) .itemOutputs(werkstoff.get(ring, 4)) .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1)).eut(6 * tVoltageMultiplier) - .addTo(sExtruderRecipes); + .addTo(extruderRecipes); GT_ModHandler.addCraftingRecipe( werkstoff.get(ring), @@ -106,29 +106,29 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 4), ItemList.Shape_Extruder_Gear.get(0L)) .itemOutputs(werkstoff.get(gearGt)).duration((int) Math.max(werkstoff.getStats().getMass() * 5L, 1)) - .eut(8 * tVoltageMultiplier).addTo(sExtruderRecipes); + .eut(8 * tVoltageMultiplier).addTo(extruderRecipes); // wireFine GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Wire.get(0L)) .itemOutputs(werkstoff.get(wireFine, 8)) .duration((int) Math.max(werkstoff.getStats().getMass() * 1.5F, 1F)).eut(8 * tVoltageMultiplier) - .addTo(sExtruderRecipes); + .addTo(extruderRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(3)) .itemOutputs(werkstoff.get(wireFine, 8)).duration((int) Math.max(werkstoff.getStats().getMass(), 1)) - .eut(8 * tVoltageMultiplier).addTo(sWiremillRecipes); + .eut(8 * tVoltageMultiplier).addTo(wiremillRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick), GT_Utility.getIntegratedCircuit(3)) .itemOutputs(werkstoff.get(wireFine, 4)) .duration((int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F)).eut(8 * tVoltageMultiplier) - .addTo(sWiremillRecipes); + .addTo(wiremillRecipes); // smallGear if (WerkstoffLoader.smallGearShape != null) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), WerkstoffLoader.smallGearShape.get(0L)) .itemOutputs(werkstoff.get(gearGtSmall)).duration((int) werkstoff.getStats().getMass()) - .eut(8 * tVoltageMultiplier).addTo(sExtruderRecipes); + .eut(8 * tVoltageMultiplier).addTo(extruderRecipes); } @@ -146,20 +146,20 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate, 4), werkstoff.get(ring)) .itemOutputs(werkstoff.get(rotor)).fluidInputs(Materials.Tin.getMolten(32)).duration(12 * SECONDS) - .eut(24).addTo(sAssemblerRecipes); + .eut(24).addTo(assemblerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate, 4), werkstoff.get(ring)) .itemOutputs(werkstoff.get(rotor)).fluidInputs(Materials.Lead.getMolten(48)).duration(12 * SECONDS) - .eut(24).addTo(sAssemblerRecipes); + .eut(24).addTo(assemblerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate, 4), werkstoff.get(ring)) .itemOutputs(werkstoff.get(rotor)).fluidInputs(Materials.SolderingAlloy.getMolten(16)) - .duration(12 * SECONDS).eut(24).addTo(sAssemblerRecipes); + .duration(12 * SECONDS).eut(24).addTo(assemblerRecipes); if (WerkstoffLoader.rotorShape != null) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 5), WerkstoffLoader.rotorShape.get(0L)) - .itemOutputs(werkstoff.get(rotor)).duration(10 * SECONDS).eut(60).addTo(sExtruderRecipes); + .itemOutputs(werkstoff.get(rotor)).duration(10 * SECONDS).eut(60).addTo(extruderRecipes); } @@ -181,17 +181,17 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { } GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gearGt)).itemOutputs(werkstoff.get(dust, 4)) - .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gearGtSmall)).itemOutputs(werkstoff.get(dust, 1)) - .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(rotor)) .itemOutputs(werkstoff.get(dust, 4), werkstoff.get(dustSmall)).duration(2 * TICKS).eut(8) - .addTo(sMaceratorRecipes); + .addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ring)).itemOutputs(werkstoff.get(dustSmall, 1)) - .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java index 23a1576eb4..90ef6d5813 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java @@ -24,11 +24,11 @@ import static gregtech.api.enums.OrePrefixes.gem; import static gregtech.api.enums.OrePrefixes.ingot; import static gregtech.api.enums.OrePrefixes.nugget; import static gregtech.api.enums.OrePrefixes.ore; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sElectroMagneticSeparatorRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sHammerRecipes; +import static gregtech.api.recipe.RecipeMaps.autoclaveRecipes; +import static gregtech.api.recipe.RecipeMaps.centrifugeRecipes; +import static gregtech.api.recipe.RecipeMaps.chemicalBathRecipes; +import static gregtech.api.recipe.RecipeMaps.electroMagneticSeparatorRecipes; +import static gregtech.api.recipe.RecipeMaps.hammerRecipes; import static gregtech.api.util.GT_RecipeBuilder.MINUTES; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeBuilder.TICKS; @@ -75,7 +75,7 @@ public class CrushedLoader implements IWerkstoffRunnable { new Object[] { "h ", "W ", 'W', werkstoff.get(crushedCentrifuged) }); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushed)).itemOutputs(werkstoff.get(dustImpure)) - .duration(10 * TICKS).eut(16).addTo(sHammerRecipes); + .duration(10 * TICKS).eut(16).addTo(hammerRecipes); GT_ModHandler.addPulverisationRecipe( werkstoff.get(crushed), @@ -99,7 +99,7 @@ public class CrushedLoader implements IWerkstoffRunnable { GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushedPurified)).itemOutputs(werkstoff.get(dustPure)) - .duration(10 * TICKS).eut(16).addTo(sHammerRecipes); + .duration(10 * TICKS).eut(16).addTo(hammerRecipes); GT_ModHandler.addPulverisationRecipe( werkstoff.get(crushedPurified), @@ -115,7 +115,7 @@ public class CrushedLoader implements IWerkstoffRunnable { werkstoff.getOreByProduct(1, dust)); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushedCentrifuged)).itemOutputs(werkstoff.get(dust)) - .duration(10 * TICKS).eut(16).addTo(sHammerRecipes); + .duration(10 * TICKS).eut(16).addTo(hammerRecipes); GT_ModHandler.addPulverisationRecipe( werkstoff.get(crushedCentrifuged), @@ -126,29 +126,29 @@ public class CrushedLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustImpure)) .itemOutputs(werkstoff.get(dust), werkstoff.getOreByProduct(0, dust)).outputChances(100_00, 11_11) - .duration(Math.max(1L, werkstoff.getStats().getMass() * 8L)).eut(5).addTo(sCentrifugeRecipes); + .duration(Math.max(1L, werkstoff.getStats().getMass() * 8L)).eut(5).addTo(centrifugeRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)) .itemOutputs(werkstoff.get(dust), werkstoff.getOreByProduct(1, dust)).outputChances(100_00, 11_11) - .duration(Math.max(1L, werkstoff.getStats().getMass() * 8L)).eut(5).addTo(sCentrifugeRecipes); + .duration(Math.max(1L, werkstoff.getStats().getMass() * 8L)).eut(5).addTo(centrifugeRecipes); if (werkstoff.contains(SubTag.CRYSTALLISABLE)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)).itemOutputs(werkstoff.get(gem)) .outputChances(9000).fluidInputs(Materials.Water.getFluid(200L)) - .duration(1 * MINUTES + 40 * SECONDS).eut(24).addTo(sAutoclaveRecipes); + .duration(1 * MINUTES + 40 * SECONDS).eut(24).addTo(autoclaveRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustImpure)).itemOutputs(werkstoff.get(gem)) .outputChances(9000).fluidInputs(Materials.Water.getFluid(200L)) - .duration(1 * MINUTES + 40 * SECONDS).eut(24).addTo(sAutoclaveRecipes); + .duration(1 * MINUTES + 40 * SECONDS).eut(24).addTo(autoclaveRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)).itemOutputs(werkstoff.get(gem)) .outputChances(9500).fluidInputs(gregtech.api.util.GT_ModHandler.getDistilledWater(200L)) - .duration(1 * MINUTES + 15 * SECONDS).eut(24).addTo(sAutoclaveRecipes); + .duration(1 * MINUTES + 15 * SECONDS).eut(24).addTo(autoclaveRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustImpure)).itemOutputs(werkstoff.get(gem)) .outputChances(9500).fluidInputs(gregtech.api.util.GT_ModHandler.getDistilledWater(200L)) - .duration(1 * MINUTES + 15 * SECONDS).eut(24).addTo(sAutoclaveRecipes); + .duration(1 * MINUTES + 15 * SECONDS).eut(24).addTo(autoclaveRecipes); } if (werkstoff.contains(SubTag.WASHING_MERCURY)) { @@ -159,7 +159,7 @@ public class CrushedLoader implements IWerkstoffRunnable { werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)) .outputChances(10000, 7000, 4000).fluidInputs(Materials.Mercury.getFluid(1000L)) - .duration(40 * SECONDS).eut(8).addTo(sChemicalBathRecipes); + .duration(40 * SECONDS).eut(8).addTo(chemicalBathRecipes); } if (werkstoff.contains(SubTag.WASHING_SODIUMPERSULFATE)) { @@ -173,7 +173,7 @@ public class CrushedLoader implements IWerkstoffRunnable { .fluidInputs( Materials.SodiumPersulfate .getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L)) - .duration(40 * SECONDS).eut(8).addTo(sChemicalBathRecipes); + .duration(40 * SECONDS).eut(8).addTo(chemicalBathRecipes); } if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_GOLD)) { @@ -184,7 +184,7 @@ public class CrushedLoader implements IWerkstoffRunnable { GT_OreDictUnificator.get(dustSmall, Materials.Gold, 1L), GT_OreDictUnificator.get(nugget, Materials.Gold, 1L)) .outputChances(10000, 4000, 2000).duration(20 * SECONDS).eut(24) - .addTo(sElectroMagneticSeparatorRecipes); + .addTo(electroMagneticSeparatorRecipes); } else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_IRON)) { @@ -194,7 +194,7 @@ public class CrushedLoader implements IWerkstoffRunnable { GT_OreDictUnificator.get(dustSmall, Materials.Iron, 1L), GT_OreDictUnificator.get(nugget, Materials.Iron, 1L)) .outputChances(10000, 4000, 2000).duration(20 * SECONDS).eut(24) - .addTo(sElectroMagneticSeparatorRecipes); + .addTo(electroMagneticSeparatorRecipes); } else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM)) { @@ -204,7 +204,7 @@ public class CrushedLoader implements IWerkstoffRunnable { GT_OreDictUnificator.get(dustSmall, Materials.Neodymium, 1L), GT_OreDictUnificator.get(nugget, Materials.Neodymium, 1L)) .outputChances(10000, 4000, 2000).duration(20 * SECONDS).eut(24) - .addTo(sElectroMagneticSeparatorRecipes); + .addTo(electroMagneticSeparatorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java index 74a2d78414..6c63c12f17 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java @@ -22,11 +22,11 @@ import static gregtech.api.enums.OrePrefixes.gem; import static gregtech.api.enums.OrePrefixes.ingot; import static gregtech.api.enums.OrePrefixes.ingotHot; import static gregtech.api.enums.OrePrefixes.nugget; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBlastRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sVacuumRecipes; +import static gregtech.api.recipe.RecipeMaps.blastFurnaceRecipes; +import static gregtech.api.recipe.RecipeMaps.maceratorRecipes; +import static gregtech.api.recipe.RecipeMaps.packagerRecipes; +import static gregtech.api.recipe.RecipeMaps.primitiveBlastRecipes; +import static gregtech.api.recipe.RecipeMaps.vacuumFreezerRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeConstants.ADDITIVE_AMOUNT; import static gregtech.api.util.GT_RecipeConstants.COIL_HEAT; @@ -41,7 +41,6 @@ import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.Pair; import gregtech.api.enums.GT_Values; @@ -50,8 +49,10 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.TextureSet; import gregtech.api.enums.TierEU; import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_RecipeConstants; import gregtech.api.util.GT_Utility; public class DustLoader implements IWerkstoffRunnable { @@ -151,7 +152,7 @@ public class DustLoader implements IWerkstoffRunnable { ItemStack input = werkstoff.get(dust); input.stackSize = werkstoff.getContents().getKey(); if (werkstoff.getStats().isElektrolysis()) { - GT_Recipe tRecipe = new BWRecipes.DynamicGTRecipe( + GT_Recipe tRecipe = new GT_Recipe( true, new ItemStack[] { input, cells > 0 ? Materials.Empty.getCells(cells) : null }, stOutputs.toArray(new ItemStack[0]), @@ -166,12 +167,12 @@ public class DustLoader implements IWerkstoffRunnable { / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); - GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(tRecipe); - GT_Recipe.GT_Recipe_Map.sMultiblockElectrolyzerRecipes.add(tRecipe); + RecipeMaps.electrolyzerRecipes.add(tRecipe); + RecipeMaps.electrolyzerNonCellRecipes.add(tRecipe); } if (werkstoff.getStats().isCentrifuge()) { - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add( - new BWRecipes.DynamicGTRecipe( + RecipeMaps.centrifugeRecipes.add( + new GT_Recipe( true, new ItemStack[] { input, cells > 0 ? Materials.Empty.getCells(cells) : null }, stOutputs.toArray(new ItemStack[0]), @@ -201,49 +202,28 @@ public class DustLoader implements IWerkstoffRunnable { / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); - GT_Recipe.GT_Recipe_Map.sMultiblockCentrifugeRecipes.add(tRecipe); + RecipeMaps.centrifugeNonCellRecipes.add(tRecipe); } if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add( - new BWRecipes.DynamicGTRecipe( - true, - stOutputs.toArray(new ItemStack[0]), - new ItemStack[] { input }, - null, - null, - new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, - null, + GT_Values.RA.stdBuilder().itemInputs(stOutputs.toArray(new ItemStack[0])).itemOutputs(input) + .fluidInputs(flOutputs.toArray(new FluidStack[0])) + .duration( (int) Math.max( 1L, Math.abs( werkstoff.getStats().getProtons() - / werkstoff.getContents().getValue().size())), - Math.min(4, werkstoff.getContents().getValue().size()) * 30, - 0)); - GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe( - true, - stOutputs.toArray(new ItemStack[0]), - new ItemStack[] { input }, - null, - null, - new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, - null, - (int) Math.max( - 1L, - Math.abs( - werkstoff.getStats().getProtons() - / werkstoff.getContents().getValue().size())), - Math.min(4, werkstoff.getContents().getValue().size()) * 30, - 0); + / werkstoff.getContents().getValue().size()))) + .eut(Math.min(4, werkstoff.getContents().getValue().size()) * 30) + .addTo(GT_RecipeConstants.UniversalChemical); } if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); short circuitID = werkstoff.getMixCircuit(); ItemStack circuit = circuitID == -1 ? null : GT_Utility.getIntegratedCircuit(circuitID); if (circuit != null) stOutputs.add(circuit); - GT_Recipe.GT_Recipe_Map.sMixerRecipes.add( - new BWRecipes.DynamicGTRecipe( + RecipeMaps.mixerRecipes.add( + new GT_Recipe( true, stOutputs.toArray(new ItemStack[0]), new ItemStack[] { input }, @@ -273,7 +253,7 @@ public class DustLoader implements IWerkstoffRunnable { / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); - GT_Recipe.GT_Recipe_Map.sMultiblockMixerRecipes.add(tRecipe); + RecipeMaps.mixerNonCellRecipes.add(tRecipe); } } @@ -292,16 +272,16 @@ public class DustLoader implements IWerkstoffRunnable { new Object[] { "T ", 'T', werkstoff.get(dust) }); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustTiny, 9), ItemList.Schematic_Dust.get(0L)) - .itemOutputs(werkstoff.get(dust)).duration(5 * SECONDS).eut(4).addTo(sBoxinatorRecipes); + .itemOutputs(werkstoff.get(dust)).duration(5 * SECONDS).eut(4).addTo(packagerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustSmall, 4), ItemList.Schematic_Dust.get(0L)) - .itemOutputs(werkstoff.get(dust)).duration(5 * SECONDS).eut(4).addTo(sBoxinatorRecipes); + .itemOutputs(werkstoff.get(dust)).duration(5 * SECONDS).eut(4).addTo(packagerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustTiny, 9), ItemList.Schematic_3by3.get(0L)) - .itemOutputs(werkstoff.get(dust)).duration(5 * SECONDS).eut(4).addTo(sBoxinatorRecipes); + .itemOutputs(werkstoff.get(dust)).duration(5 * SECONDS).eut(4).addTo(packagerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustSmall, 4), ItemList.Schematic_2by2.get(0L)) - .itemOutputs(werkstoff.get(dust)).duration(5 * SECONDS).eut(4).addTo(sBoxinatorRecipes); + .itemOutputs(werkstoff.get(dust)).duration(5 * SECONDS).eut(4).addTo(packagerRecipes); if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) { GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); @@ -319,7 +299,8 @@ public class DustLoader implements IWerkstoffRunnable { Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint()) .eut(werkstoff.getStats().getMeltingVoltage()) - .metadata(COIL_HEAT, werkstoff.getStats().getMeltingPoint()).addTo(sBlastRecipes); + .metadata(COIL_HEAT, werkstoff.getStats().getMeltingPoint()) + .addTo(blastFurnaceRecipes); } else if (werkstoff.contains(WerkstoffLoader.NOBLE_GAS_SMELTING)) { GT_Values.RA.stdBuilder() @@ -332,7 +313,8 @@ public class DustLoader implements IWerkstoffRunnable { Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint()) .eut(werkstoff.getStats().getMeltingVoltage()) - .metadata(COIL_HEAT, werkstoff.getStats().getMeltingPoint()).addTo(sBlastRecipes); + .metadata(COIL_HEAT, werkstoff.getStats().getMeltingPoint()) + .addTo(blastFurnaceRecipes); } else { GT_Values.RA.stdBuilder() @@ -344,7 +326,8 @@ public class DustLoader implements IWerkstoffRunnable { Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint()) .eut(werkstoff.getStats().getMeltingVoltage()) - .metadata(COIL_HEAT, werkstoff.getStats().getMeltingPoint()).addTo(sBlastRecipes); + .metadata(COIL_HEAT, werkstoff.getStats().getMeltingPoint()) + .addTo(blastFurnaceRecipes); if (werkstoff.getStats().getMeltingPoint() <= 1000) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust)) @@ -352,7 +335,7 @@ public class DustLoader implements IWerkstoffRunnable { .duration( (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint()) - .eut(0).metadata(ADDITIVE_AMOUNT, 9).addTo(sPrimitiveBlastRecipes); + .eut(0).metadata(ADDITIVE_AMOUNT, 9).addTo(primitiveBlastRecipes); } } } @@ -360,22 +343,22 @@ public class DustLoader implements IWerkstoffRunnable { if (werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().getMeltingPoint() > 1750) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingotHot)).itemOutputs(werkstoff.get(ingot)) .duration((int) Math.max(werkstoff.getStats().getMass() * 3L, 1L)).eut(TierEU.RECIPE_MV) - .addTo(sVacuumRecipes); + .addTo(vacuumFreezerRecipes); } if (werkstoff.hasItemType(ingot)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)).itemOutputs(werkstoff.get(dust)) - .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(nugget)).itemOutputs(werkstoff.get(dustTiny)) - .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); } if (werkstoff.hasItemType(ingot) || werkstoff.hasItemType(gem)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).itemOutputs(werkstoff.get(dust, 9)) - .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java index d57ee89da8..c58b1a0241 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java @@ -26,13 +26,13 @@ import static gregtech.api.enums.OrePrefixes.gemFlawless; import static gregtech.api.enums.OrePrefixes.lens; import static gregtech.api.enums.OrePrefixes.ore; import static gregtech.api.enums.OrePrefixes.plate; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCompressorRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sHammerRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sImplosionRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sLatheRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sSifterRecipes; +import static gregtech.api.recipe.RecipeMaps.compressorRecipes; +import static gregtech.api.recipe.RecipeMaps.hammerRecipes; +import static gregtech.api.recipe.RecipeMaps.implosionRecipes; +import static gregtech.api.recipe.RecipeMaps.laserEngraverRecipes; +import static gregtech.api.recipe.RecipeMaps.latheRecipes; +import static gregtech.api.recipe.RecipeMaps.maceratorRecipes; +import static gregtech.api.recipe.RecipeMaps.sifterRecipes; import static gregtech.api.util.GT_RecipeBuilder.MINUTES; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeBuilder.TICKS; @@ -65,10 +65,10 @@ public class GemLoader implements IWerkstoffRunnable { || werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem, 9)).itemOutputs(werkstoff.get(block)) - .duration(15 * SECONDS).eut(2).addTo(sCompressorRecipes); + .duration(15 * SECONDS).eut(2).addTo(compressorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).itemOutputs(werkstoff.get(gem, 9)) - .duration(5 * SECONDS).eut(24).addTo(sHammerRecipes); + .duration(5 * SECONDS).eut(24).addTo(hammerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushedPurified)) .itemOutputs( @@ -79,24 +79,24 @@ public class GemLoader implements IWerkstoffRunnable { werkstoff.get(gemChipped), werkstoff.get(dust)) .outputChances(200, 1000, 2500, 2000, 4000, 5000).duration(40 * SECONDS).eut(16) - .addTo(sSifterRecipes); + .addTo(sifterRecipes); } GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemExquisite)).itemOutputs(werkstoff.get(dust, 4)) - .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawless)).itemOutputs(werkstoff.get(dust, 2)) - .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem)).itemOutputs(werkstoff.get(dust)) - .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawed)).itemOutputs(werkstoff.get(dustSmall, 2)) - .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemChipped)).itemOutputs(werkstoff.get(dustSmall)) - .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); GT_ModHandler.addCraftingRecipe( werkstoff.get(gemFlawless, 2), @@ -116,19 +116,19 @@ public class GemLoader implements IWerkstoffRunnable { new Object[] { "h ", "W ", 'W', werkstoff.get(gemFlawed) }); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemExquisite)).itemOutputs(werkstoff.get(gemFlawless, 2)) - .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); + .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(hammerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawless)).itemOutputs(werkstoff.get(gem, 2)) - .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); + .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(hammerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem)).itemOutputs(werkstoff.get(gemFlawed, 2)) - .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); + .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(hammerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawed)).itemOutputs(werkstoff.get(gemChipped, 2)) - .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); + .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(hammerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemChipped)).itemOutputs(werkstoff.get(dustTiny)) - .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(sHammerRecipes); + .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(hammerRecipes); if (!werkstoff.contains(WerkstoffLoader.NO_BLAST)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawless, 3)) @@ -136,42 +136,42 @@ public class GemLoader implements IWerkstoffRunnable { werkstoff.get(gemExquisite), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) .duration(20 * TICKS).eut(TierEU.RECIPE_LV).metadata(ADDITIVE_AMOUNT, 8) - .addTo(sImplosionRecipes); + .addTo(implosionRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem, 3)) .itemOutputs( werkstoff.get(gemFlawless), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) .duration(20 * TICKS).eut(TierEU.RECIPE_LV).metadata(ADDITIVE_AMOUNT, 8) - .addTo(sImplosionRecipes); + .addTo(implosionRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawed, 3)) .itemOutputs(werkstoff.get(gem), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) .duration(20 * TICKS).eut(TierEU.RECIPE_LV).metadata(ADDITIVE_AMOUNT, 8) - .addTo(sImplosionRecipes); + .addTo(implosionRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemChipped, 3)) .itemOutputs(werkstoff.get(gemFlawed), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) .duration(20 * TICKS).eut(TierEU.RECIPE_LV).metadata(ADDITIVE_AMOUNT, 8) - .addTo(sImplosionRecipes); + .addTo(implosionRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust, 4)) .itemOutputs(werkstoff.get(gem, 3), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)) .duration(20 * TICKS).eut(TierEU.RECIPE_LV).metadata(ADDITIVE_AMOUNT, 24) - .addTo(sImplosionRecipes); + .addTo(implosionRecipes); } if (werkstoff.hasItemType(plate)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)) .itemOutputs(werkstoff.get(lens), werkstoff.get(dustSmall)).duration(60 * SECONDS) - .eut(TierEU.RECIPE_MV).addTo(sLatheRecipes); + .eut(TierEU.RECIPE_MV).addTo(latheRecipes); } GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemExquisite)) .itemOutputs(werkstoff.get(lens), werkstoff.get(dust, 2)).duration(2 * MINUTES) - .eut(TierEU.RECIPE_LV).addTo(sLatheRecipes); + .eut(TierEU.RECIPE_LV).addTo(latheRecipes); final ITexture texture = TextureFactory.of( Textures.BlockIcons.MACHINE_CASINGS[2][0], @@ -184,7 +184,7 @@ public class GemLoader implements IWerkstoffRunnable { texture)); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(lens)).itemOutputs(werkstoff.get(dustSmall, 3)) - .duration(20 * SECONDS).eut(2).addTo(sMaceratorRecipes); + .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); for (ItemStack is : OreDictionary.getOres( "craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) { @@ -192,18 +192,18 @@ public class GemLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemChipped, 3), is) .itemOutputs(werkstoff.get(gemFlawed, 1)).duration(30 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(sLaserEngraverRecipes); + .addTo(laserEngraverRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawed, 3), is).itemOutputs(werkstoff.get(gem, 1)) - .duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(sLaserEngraverRecipes); + .duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(laserEngraverRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem, 3), is) .itemOutputs(werkstoff.get(gemFlawless, 1)).duration(60 * SECONDS).eut(TierEU.RECIPE_HV) - .addTo(sLaserEngraverRecipes); + .addTo(laserEngraverRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawless, 3), is) .itemOutputs(werkstoff.get(gemExquisite, 1)).duration(2 * MINUTES).eut(2000) - .addTo(sLaserEngraverRecipes); + .addTo(laserEngraverRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java index dd64c84241..9447b0f43b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java @@ -15,8 +15,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.rec import static gregtech.api.enums.OrePrefixes.block; import static gregtech.api.enums.OrePrefixes.ingot; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCompressorRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sExtruderRecipes; +import static gregtech.api.recipe.RecipeMaps.compressorRecipes; +import static gregtech.api.recipe.RecipeMaps.extruderRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -24,6 +24,8 @@ import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWer import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; +import gregtech.api.recipe.RecipeCategories; +import gregtech.api.recipe.RecipeMaps; public class MetalLoader implements IWerkstoffRunnable { @@ -31,18 +33,16 @@ public class MetalLoader implements IWerkstoffRunnable { public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(ingot)) { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 9)).itemOutputs(werkstoff.get(block)) - .duration(15 * SECONDS).eut(2).addTo(sCompressorRecipes); + .duration(15 * SECONDS).eut(2).addTo(compressorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 9), ItemList.Shape_Extruder_Block.get(0)) .itemOutputs(werkstoff.get(block)).duration((int) werkstoff.getStats().getMass()) - .eut(8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15).addTo(sExtruderRecipes); - - GT_Values.RA.addAlloySmelterRecipe( - werkstoff.get(ingot, 9), - ItemList.Shape_Mold_Block.get(0L), - werkstoff.get(block), - (int) (werkstoff.getStats().getMass() / 2), - 4 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); + .eut(8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15).addTo(extruderRecipes); + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 9), ItemList.Shape_Mold_Block.get(0L)) + .itemOutputs(werkstoff.get(block)).duration((int) (werkstoff.getStats().getMass() / 2)) + .eut(4 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15) + .recipeCategory(RecipeCategories.alloySmelterMolding).addTo(RecipeMaps.alloySmelterRecipes); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java index 8e1aa3bd59..eca18f2888 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -32,9 +32,9 @@ import static gregtech.api.enums.OrePrefixes.rotor; import static gregtech.api.enums.OrePrefixes.screw; import static gregtech.api.enums.OrePrefixes.stick; import static gregtech.api.enums.OrePrefixes.stickLong; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes; +import static gregtech.api.recipe.RecipeMaps.fluidCannerRecipes; +import static gregtech.api.recipe.RecipeMaps.fluidExtractionRecipes; +import static gregtech.api.recipe.RecipeMaps.fluidSolidifierRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeBuilder.TICKS; @@ -50,6 +50,7 @@ import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWer import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; +import gregtech.api.recipe.RecipeCategories; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; @@ -67,46 +68,54 @@ public class MoltenCellLoader implements IWerkstoffRunnable { } GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust)).fluidOutputs(werkstoff.getMolten(144)) - .duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); + .duration(15 * SECONDS).eut(2).recipeCategory(RecipeCategories.fluidExtractorRecycling) + .addTo(fluidExtractionRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustSmall)).fluidOutputs(werkstoff.getMolten(36)) - .duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); + .duration(15 * SECONDS).eut(2).recipeCategory(RecipeCategories.fluidExtractorRecycling) + .addTo(fluidExtractionRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustTiny)).fluidOutputs(werkstoff.getMolten(16)) - .duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); + .duration(15 * SECONDS).eut(2).recipeCategory(RecipeCategories.fluidExtractorRecycling) + .addTo(fluidExtractionRecipes); } else { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)).fluidOutputs(werkstoff.getMolten(144)) - .duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); + .duration(15 * SECONDS).eut(2).recipeCategory(RecipeCategories.fluidExtractorRecycling) + .addTo(fluidExtractionRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(nugget)).fluidOutputs(werkstoff.getMolten(16)) - .duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); + .duration(15 * SECONDS).eut(2).recipeCategory(RecipeCategories.fluidExtractorRecycling) + .addTo(fluidExtractionRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Ingot.get(0)).itemOutputs(werkstoff.get(ingot)) .fluidInputs(werkstoff.getMolten(144)).duration((int) werkstoff.getStats().getMass()) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Nugget.get(0)).itemOutputs(werkstoff.get(nugget)) .fluidInputs(werkstoff.getMolten(16)).duration((int) ((double) werkstoff.getStats().getMass() / 9D)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Block.get(0)).itemOutputs(werkstoff.get(block)) .fluidInputs(werkstoff.getMolten(1296)).duration((int) werkstoff.getStats().getMass() * 9) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); if (!werkstoff.hasItemType(plate)) { return; } GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stickLong)).fluidOutputs(werkstoff.getMolten(144)) - .duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); + .duration(15 * SECONDS).eut(2).recipeCategory(RecipeCategories.fluidExtractorRecycling) + .addTo(fluidExtractionRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)).fluidOutputs(werkstoff.getMolten(144)) - .duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); + .duration(15 * SECONDS).eut(2).recipeCategory(RecipeCategories.fluidExtractorRecycling) + .addTo(fluidExtractionRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick)).fluidOutputs(werkstoff.getMolten(72)) - .duration(15 * SECONDS).eut(2).addTo(sFluidExtractionRecipes); + .duration(15 * SECONDS).eut(2).recipeCategory(RecipeCategories.fluidExtractorRecycling) + .addTo(fluidExtractionRecipes); } if (werkstoff.getGenerationFeatures().hasMetalCraftingSolidifierRecipes()) { @@ -118,16 +127,16 @@ public class MoltenCellLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Rod_Long.get(0)) .itemOutputs(werkstoff.get(stickLong)).fluidInputs(werkstoff.getMolten(144)) .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Rod.get(0)).itemOutputs(werkstoff.get(stick)) .fluidInputs(werkstoff.getMolten(72)) .duration((int) Math.max(werkstoff.getStats().getMass() / 2, 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Plate.get(0)).itemOutputs(werkstoff.get(plate)) .fluidInputs(werkstoff.getMolten(144)).duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); } @@ -139,27 +148,27 @@ public class MoltenCellLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Screw.get(0)).itemOutputs(werkstoff.get(screw)) .fluidInputs(werkstoff.getMolten(18)) .duration((int) Math.max(werkstoff.getStats().getMass() / 8, 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Gear.get(0)).itemOutputs(werkstoff.get(gearGt)) .fluidInputs(werkstoff.getMolten(576)) .duration((int) Math.max(werkstoff.getStats().getMass() / 4, 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Gear_Small.get(0)) .itemOutputs(werkstoff.get(gearGtSmall)).fluidInputs(werkstoff.getMolten(144)) .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Bolt.get(0)).itemOutputs(werkstoff.get(bolt)) .fluidInputs(werkstoff.getMolten(18)) .duration((int) Math.max(werkstoff.getStats().getMass() / 8, 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Ring.get(0)).itemOutputs(werkstoff.get(ring)) .fluidInputs(werkstoff.getMolten(36)) .duration((int) Math.max(werkstoff.getStats().getMass() / 4, 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); // No Spring Molds @@ -170,7 +179,7 @@ public class MoltenCellLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Rotor.get(0)).itemOutputs(werkstoff.get(rotor)) .fluidInputs(werkstoff.getMolten(612)) .duration((int) Math.max(werkstoff.getStats().getMass() * 4.25, 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(sFluidSolidficationRecipes); + .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); } @@ -193,11 +202,11 @@ public class MoltenCellLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(Materials.Empty.getCells(1)).itemOutputs(werkstoff.get(cellMolten)) .fluidInputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)) - .duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); + .duration(2 * TICKS).eut(2).addTo(fluidCannerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(cellMolten)).itemOutputs(Materials.Empty.getCells(1)) .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)) - .duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); + .duration(2 * TICKS).eut(2).addTo(fluidCannerRecipes); if (!Forestry.isModLoaded()) return; @@ -213,7 +222,7 @@ public class MoltenCellLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(capsuleMolten)) .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)) - .duration(2 * TICKS).eut(2).addTo(sFluidCannerRecipes); + .duration(2 * TICKS).eut(2).addTo(fluidCannerRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java index 65d9c2be4d..fa6252c545 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java @@ -17,17 +17,17 @@ import static gregtech.api.enums.OrePrefixes.dust; import static gregtech.api.enums.OrePrefixes.ingot; import static gregtech.api.enums.OrePrefixes.plateDense; import static gregtech.api.enums.OrePrefixes.plateDouble; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; +import static gregtech.api.recipe.RecipeMaps.maceratorRecipes; import static gregtech.api.util.GT_RecipeBuilder.TICKS; import net.minecraft.item.ItemStack; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -37,8 +37,8 @@ public class MultipleMetalLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(plateDense)) { - GT_Recipe.GT_Recipe_Map.sBenderRecipes.add( - new BWRecipes.DynamicGTRecipe( + RecipeMaps.benderRecipes.add( + new GT_Recipe( true, new ItemStack[] { werkstoff.get(ingot, 2), GT_Utility.getIntegratedCircuit(2) }, new ItemStack[] { werkstoff.get(plateDouble) }, @@ -55,7 +55,7 @@ public class MultipleMetalLoader implements IWerkstoffRunnable { null); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plateDouble)).itemOutputs(werkstoff.get(dust, 2)) - .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java index 839afe401d..581c475956 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java @@ -18,7 +18,7 @@ import static gregtech.api.enums.OrePrefixes.dust; import static gregtech.api.enums.OrePrefixes.gem; import static gregtech.api.enums.OrePrefixes.ingot; import static gregtech.api.enums.OrePrefixes.ore; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sHammerRecipes; +import static gregtech.api.recipe.RecipeMaps.hammerRecipes; import static gregtech.api.util.GT_RecipeBuilder.TICKS; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -42,7 +42,7 @@ public class OreLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ore)) .itemOutputs(werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(crushed)) - .duration(16 * TICKS).eut(10).addTo(sHammerRecipes); + .duration(16 * TICKS).eut(10).addTo(hammerRecipes); GT_ModHandler.addPulverisationRecipe( werkstoff.get(ore), diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java index 7f78d91f79..2978c5e3c0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java @@ -22,11 +22,11 @@ import static gregtech.api.enums.OrePrefixes.ingot; import static gregtech.api.enums.OrePrefixes.plate; import static gregtech.api.enums.OrePrefixes.stick; import static gregtech.api.enums.OrePrefixes.stickLong; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBenderRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sExtruderRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sHammerRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sLatheRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; +import static gregtech.api.recipe.RecipeMaps.benderRecipes; +import static gregtech.api.recipe.RecipeMaps.extruderRecipes; +import static gregtech.api.recipe.RecipeMaps.hammerRecipes; +import static gregtech.api.recipe.RecipeMaps.latheRecipes; +import static gregtech.api.recipe.RecipeMaps.maceratorRecipes; import static gregtech.api.util.GT_RecipeBuilder.TICKS; import net.minecraft.item.ItemStack; @@ -35,7 +35,6 @@ import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -44,6 +43,7 @@ import gregtech.api.enums.TextureSet; import gregtech.api.interfaces.ITexture; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Proxy; @@ -56,7 +56,7 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem)) .itemOutputs(werkstoff.get(stick), werkstoff.get(dustSmall, 2)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 5L, 1L)).eut(16).addTo(sLatheRecipes); + .duration((int) Math.max(werkstoff.getStats().getMass() * 5L, 1L)).eut(16).addTo(latheRecipes); GT_ModHandler.addCraftingRecipe( werkstoff.get(stick, 2), @@ -68,7 +68,7 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { new Object[] { "f ", " X", 'X', werkstoff.get(gem) }); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick, 2)).itemOutputs(werkstoff.get(stickLong)) - .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)).eut(16).addTo(sHammerRecipes); + .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)).eut(16).addTo(hammerRecipes); TextureSet texSet = werkstoff.getTexSet(); ITexture texture = SideReference.Side.Client @@ -81,7 +81,7 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { GregTech_API.registerCover(werkstoff.get(plate), texture, null); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)).itemOutputs(werkstoff.get(dust)) - .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); return; } @@ -103,8 +103,8 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { GT_Proxy.tBits, new Object[] { "hX", 'X', werkstoff.get(plate) }); - sBenderRecipes.add( - new BWRecipes.DynamicGTRecipe( + benderRecipes.add( + new GT_Recipe( true, new ItemStack[] { werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(1) }, new ItemStack[] { werkstoff.get(plate) }, @@ -117,7 +117,7 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { 0)); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 3)).itemOutputs(werkstoff.get(plate, 2)) - .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)).eut(16).addTo(sHammerRecipes); + .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)).eut(16).addTo(hammerRecipes); GregTech_API.registerCover( werkstoff.get(plate), @@ -126,38 +126,38 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)) .itemOutputs(werkstoff.get(stick), werkstoff.get(dustSmall, 2)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 5L, 1L)).eut(16).addTo(sLatheRecipes); + .duration((int) Math.max(werkstoff.getStats().getMass() * 5L, 1L)).eut(16).addTo(latheRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate), GT_Utility.getIntegratedCircuit(1)) .itemOutputs(werkstoff.get(foil, 4)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 1L, 1L)).eut(24).addTo(sBenderRecipes); + .duration((int) Math.max(werkstoff.getStats().getMass() * 1L, 1L)).eut(24).addTo(benderRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(10)) .itemOutputs(werkstoff.get(foil, 4)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)).eut(24).addTo(sBenderRecipes); + .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)).eut(24).addTo(benderRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick, 2)).itemOutputs(werkstoff.get(stickLong)) - .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)).eut(16).addTo(sHammerRecipes); + .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)).eut(16).addTo(hammerRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Plate.get(0)) .itemOutputs(werkstoff.get(plate)).duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)) - .eut(45).addTo(sExtruderRecipes); + .eut(45).addTo(extruderRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Rod.get(0)) .itemOutputs(werkstoff.get(stick, 2)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)).eut(45).addTo(sExtruderRecipes); + .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)).eut(45).addTo(extruderRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)).itemOutputs(werkstoff.get(dust)) - .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)).itemOutputs(werkstoff.get(dust)) - .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stickLong)).itemOutputs(werkstoff.get(dust)) - .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick)).itemOutputs(werkstoff.get(dustSmall, 2)) - .duration(2 * TICKS).eut(8).addTo(sMaceratorRecipes); + .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java index 43b72c18ee..aa1d3531ec 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java @@ -28,10 +28,10 @@ import static gregtech.api.enums.OrePrefixes.toolHeadHammer; import static gregtech.api.enums.OrePrefixes.toolHeadSaw; import static gregtech.api.enums.OrePrefixes.toolHeadWrench; import static gregtech.api.enums.OrePrefixes.turbineBlade; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sExtruderRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sPressRecipes; +import static gregtech.api.recipe.RecipeMaps.assemblerRecipes; +import static gregtech.api.recipe.RecipeMaps.extruderRecipes; +import static gregtech.api.recipe.RecipeMaps.fluidSolidifierRecipes; +import static gregtech.api.recipe.RecipeMaps.formingPressRecipes; import static gregtech.api.util.GT_RecipeBuilder.MINUTES; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; @@ -434,17 +434,17 @@ public class ToolLoader implements IWerkstoffRunnable { GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 6), ItemList.Shape_Extruder_Turbine_Blade.get(0)) .itemOutputs(werkstoff.get(turbineBlade, 1)).duration((int) werkstoff.getStats().getMass() / 2 * 20) - .eut(TierEU.RECIPE_MV).addTo(sExtruderRecipes); + .eut(TierEU.RECIPE_MV).addTo(extruderRecipes); GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Turbine_Blade.get(0)) .itemOutputs(werkstoff.get(turbineBlade, 1)).fluidInputs(werkstoff.getMolten(864)) .duration((int) werkstoff.getStats().getMass() * 20).eut(TierEU.RECIPE_MV) - .addTo(sFluidSolidficationRecipes); + .addTo(fluidSolidifierRecipes); GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plateDouble, 3), werkstoff.get(screw, 2)) .itemOutputs(werkstoff.get(turbineBlade, 1)) .duration((werkstoff.getStats().getMass() / 4) * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(sPressRecipes); + .addTo(formingPressRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -457,7 +457,7 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), Materials.Magnalium, null)) - .duration(8 * SECONDS).eut(100).addTo(sAssemblerRecipes); + .duration(8 * SECONDS).eut(100).addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -470,7 +470,7 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), Materials.Titanium, null)) - .duration(16 * SECONDS).eut(400).addTo(sAssemblerRecipes); + .duration(16 * SECONDS).eut(400).addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -483,7 +483,7 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), Materials.TungstenSteel, null)) - .duration(32 * SECONDS).eut(1600).addTo(sAssemblerRecipes); + .duration(32 * SECONDS).eut(1600).addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemInputs( @@ -496,7 +496,7 @@ public class ToolLoader implements IWerkstoffRunnable { werkstoff.getBridgeMaterial(), Materials.Americium, null)) - .duration(1 * MINUTES + 4 * SECONDS).eut(6400).addTo(sAssemblerRecipes); + .duration(1 * MINUTES + 4 * SECONDS).eut(6400).addTo(assemblerRecipes); } if (!werkstoff.hasItemType(gem)) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java index 79d74219a3..e7019d75e2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java @@ -21,22 +21,16 @@ import static gregtech.api.enums.OrePrefixes.values; import java.util.ArrayList; -import net.minecraft.item.ItemStack; - import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; -import com.github.bartimaeusnek.bartworks.util.BWRecipes; import gregtech.api.enchants.Enchantment_Radioactivity; import gregtech.api.enums.Element; -import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.common.items.behaviors.Behaviour_DataOrb; public class BridgeMaterialsLoader implements IWerkstoffRunnable { @@ -79,7 +73,7 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { boolean ElementSet = false; for (Element e : Element.values()) { if (e.toString().equals(werkstoff.getToolTip())) { - if (e.mLinkedMaterials.size() > 0) break; + if (!e.mLinkedMaterials.isEmpty()) break; werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL @@ -123,25 +117,6 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { if (!ElementSet) { continue; } - - if (werkstoff.hasItemType(dust)) { - ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); - Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[] { werkstoff.get(prefixes) }, - new ItemStack[] { scannerOutput }, - ItemList.Tool_DataOrb.get(1L), - null, - null, - null, - (int) (werkstoffBridgeMaterial.getMass() * 8192L), - 30, - 0)); - } } if (werkstoff.hasItemType(cell)) { @@ -179,7 +154,6 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { werkstoff.getStats().getEnchantmentlvl()); } werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); - // if (WerkstoffLoader.items.get(prefixes) != null) } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index a628c1ffb6..27b16768b9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -13,236 +13,27 @@ package com.github.bartimaeusnek.bartworks.util; +import static com.github.bartimaeusnek.bartworks.API.recipe.BartWorksRecipeMaps.bacterialVatRecipes; +import static com.github.bartimaeusnek.bartworks.API.recipe.BartWorksRecipeMaps.bioLabRecipes; +import static com.github.bartimaeusnek.bartworks.API.recipe.BartWorksRecipeMaps.radioHatchRecipes; import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; import static com.github.bartimaeusnek.bartworks.util.BW_Util.specialToByte; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Supplier; - import javax.annotation.Nonnegative; -import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; -import org.jetbrains.annotations.Nullable; - -import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; -import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; -import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; -import com.gtnewhorizons.modularui.api.drawable.IDrawable; -import com.gtnewhorizons.modularui.api.math.Alignment; -import com.gtnewhorizons.modularui.api.math.Pos2d; -import com.gtnewhorizons.modularui.api.screen.ModularWindow; -import com.gtnewhorizons.modularui.common.widget.DrawableWidget; -import com.gtnewhorizons.modularui.common.widget.ProgressBar; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.gui.modularui.GT_UITextures; -import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.nei.GT_NEI_DefaultHandler; -import gregtech.nei.NEIRecipeInfo; -import ic2.core.Ic2Items; -import ic2.core.item.ItemFluidCell; +@SuppressWarnings("UnusedReturnValue") public class BWRecipes { public static final BWRecipes instance = new BWRecipes(); - public static final byte BIOLABBYTE = 0; - public static final byte BACTERIALVATBYTE = 1; - public static final byte ACIDGENMAPBYTE = 2; - public static final byte CIRCUITASSEMBLYLINE = 3; - public static final byte RADHATCH = 4; - - private final GT_Recipe.GT_Recipe_Map sBiolab = new GT_Recipe.GT_Recipe_Map( - new HashSet<>(150), - "bw.recipe.biolab", - StatCollector.translateToLocal("tile.biolab.name"), - null, - "gregtech:textures/gui/basicmachines/BW.GUI.BioLab", - 6, - 2, - 1, - 1, - 1, - "", - 1, - "", - true, - false // special handler - ) { - - @Nullable - @Override - public IDrawable getOverlayForSlot(boolean isFluid, boolean isOutput, int index, boolean isSpecial) { - if (!isFluid && !isOutput && !isSpecial) { - switch (index) { - case 0: - return BW_UITextures.OVERLAY_SLOT_DISH; - case 1: - return BW_UITextures.OVERLAY_SLOT_DNA_FLASK; - case 2: - return GT_UITextures.OVERLAY_SLOT_CIRCUIT; - case 3: - return GT_UITextures.OVERLAY_SLOT_MOLECULAR_1; - case 4: - return GT_UITextures.OVERLAY_SLOT_MOLECULAR_2; - case 5: - return GT_UITextures.OVERLAY_SLOT_DATA_ORB; - } - } else if (isFluid && !isOutput) { - return GT_UITextures.OVERLAY_SLOT_VIAL_2; - } else if (isSpecial) { - return BW_UITextures.OVERLAY_SLOT_MODULE; - } - return super.getOverlayForSlot(isFluid, isOutput, index, false); - } - }.setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE).setLogo(BW_UITextures.PICTURE_BW_LOGO_47X21) - .setLogoPos(125, 3).setLogoSize(47, 21); - private final GT_Recipe.GT_Recipe_Map sBacteriaVat = new BacteriaVatRecipeMap( - new HashSet<>(50), - "bw.recipe.BacteriaVat", - StatCollector.translateToLocal("tile.biovat.name"), - null, - "gregtech:textures/gui/basicmachines/Default", - 6, - 2, - 0, - 1, - 1, - " Sievert: ", - 1, - " Sv", - true, - false // special handler - ).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE) - .setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> { - int[] tSpecialA = GT_TileEntity_BioVat.specialValueUnpack(recipeInfo.recipe.mSpecialValue); - return Arrays.asList( - StatCollector.translateToLocal("nei.biovat.0.name") + " " + tSpecialA[0], - (tSpecialA[2] == 1 ? StatCollector.translateToLocal("nei.biovat.1.name") - : StatCollector.translateToLocal("nei.biovat.2.name")) - + applyPrefixAndSuffix.apply(tSpecialA[3])); - }); - private final GT_Recipe.GT_Recipe_Map sAcidGenFuels = new BW_Recipe_Map_LiquidFuel( - new HashSet<>(10), - "bw.fuels.acidgens", - StatCollector.translateToLocal("tile.acidgenerator.name"), - null, - "gregtech:textures/gui/basicmachines/Default", - 1, - 1, - 1, - 1, - 1, - "EU generated: ", - 1000, - "", - false, - true).useModularUI(true); - private final GT_Recipe.GT_Recipe_Map sCircuitAssemblyLineMap = new SpecialObjectSensitiveMap( - new HashSet<>(60), - "bw.recipe.cal", - "Circuit Assembly Line", - null, - "gregtech:textures/gui/basicmachines/Default", - 6, - 1, - 1, - 1, - 1, - "", - 1, - "", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_CIRCUIT_ASSEMBLER); - private final GT_Recipe.GT_Recipe_Map sRadHatch = new GT_Recipe.GT_Recipe_Map( - new HashSet<>(150), - "bw.recipe.radhatch", - "Radio Hatch Material List", - null, - "gregtech:textures/gui/basicmachines/BW.GUI.Radioactive", - 1, - 0, - 1, - 0, - 1, - "", - 0, - "", - false, - true) { - - @Override - public void addProgressBarUI(ModularWindow.Builder builder, Supplier progressSupplier, - Pos2d windowOffset) { - builder.widget( - new DrawableWidget().setDrawable(BW_UITextures.PICTURE_RADIATION) - .setPos(new Pos2d(74, 20).add(windowOffset)).setSize(29, 27)); - } - - @Override - protected void drawNEIEnergyInfo(NEIRecipeInfo recipeInfo) {} - - @Override - protected void drawNEIDurationInfo(NEIRecipeInfo recipeInfo) {} - }.setSlotOverlay(false, false, BW_UITextures.OVERLAY_SLOT_ROD).setLogo(BW_UITextures.PICTURE_BW_LOGO_47X21) - .setLogoPos(118, 55).setLogoSize(47, 21).setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> { - int radioLevel = recipeInfo.recipe.mEUt; - int amount = recipeInfo.recipe.mDuration; - long time = recipeInfo.recipe.mSpecialValue; - return Arrays.asList( - StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.0", radioLevel), - StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", amount), - StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.2", time * amount / 20.0)); - }); - public final GT_Recipe.GT_Recipe_Map eicMap = new GT_Recipe.GT_Recipe_Map( - new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), - "gt.recipe.electricimplosioncompressor", - "Electric Implosion Compressor", - null, - "gregtech:textures/gui/basicmachines/Default", - 6, - 2, - 0, - 0, - 1, - "", - 1, - "", - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_IMPLOSION) - .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT); - - /** - * @param machine 0 = biolab; 1 = BacterialVat; 2 = sAcidGenFuels; 3 = circuitAssemblyLine - */ - public GT_Recipe.GT_Recipe_Map getMappingsFor(byte machine) { - return switch (machine) { - case 0 -> this.sBiolab; - case 1 -> this.sBacteriaVat; - case 2 -> this.sAcidGenFuels; - case 3 -> this.sCircuitAssemblyLineMap; - case 4 -> this.sRadHatch; - default -> null; - }; - } public static long calcDecayTicks(int x) { long ret; @@ -254,8 +45,8 @@ public class BWRecipes { } public boolean addRadHatch(ItemStack item, int radioLevel, int amount, short[] rgba) { - return this.sRadHatch.addRecipe( - new DynamicGTRecipe( + return radioHatchRecipes.addRecipe( + new GT_Recipe( false, new ItemStack[] { item }, null, @@ -269,26 +60,10 @@ public class BWRecipes { != null; } - public boolean addRadHatch(ItemStack item, int radioLevel, int amount, int time, short[] rgba) { - return this.sRadHatch.addRecipe( - new DynamicGTRecipe( - false, - new ItemStack[] { item }, - null, - null, - new int[] { rgba[0], rgba[1], rgba[2] }, - null, - null, - amount, - radioLevel, - time)) - != null; - } - public boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return this.sBiolab.addRecipe( - new DynamicGTRecipe( + return bioLabRecipes.addRecipe( + new GT_Recipe( true, aInputs, new ItemStack[] { aOutput }, @@ -304,8 +79,8 @@ public class BWRecipes { public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { - return this.sBiolab.addRecipe( - new DynamicGTRecipe( + return bioLabRecipes.addRecipe( + new GT_Recipe( true, new ItemStack[] { BioItemList.getPetriDish(null), aInput }, new ItemStack[] { BioItemList.getPetriDish(aOutput) }, @@ -321,8 +96,8 @@ public class BWRecipes { public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { - return this.sBiolab.addRecipe( - new DynamicGTRecipe( + return bioLabRecipes.addRecipe( + new GT_Recipe( true, new ItemStack[] { BioItemList.getPetriDish(null), aInput }, new ItemStack[] { BioItemList.getPetriDish(aOutput) }, @@ -336,119 +111,6 @@ public class BWRecipes { != null; } - @Deprecated - public boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, - FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return this.sBiolab.addRecipe( - new DynamicGTRecipe( - true, - aInputs, - new ItemStack[] { aOutput }, - BioItemList.mBioLabParts[0], - aChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue)) - != null; - } - - @Deprecated - public boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, - FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return this.sBiolab.addRecipe( - new DynamicGTRecipe( - true, - aInputs, - new ItemStack[] { aOutput }, - BioItemList.mBioLabParts[1], - aChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue)) - != null; - } - - @Deprecated - public boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, - FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return this.sBiolab.addRecipe( - new DynamicGTRecipe( - true, - aInputs, - new ItemStack[] { aOutput }, - BioItemList.mBioLabParts[2], - aChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue)) - != null; - } - - @Deprecated - public boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, - FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return this.sBiolab.addRecipe( - new DynamicGTRecipe( - true, - aInputs, - new ItemStack[] { aOutput }, - BioItemList.mBioLabParts[3], - aChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue)) - != null; - } - - @Deprecated - public boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, - FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return this.sBiolab.addRecipe( - new DynamicGTRecipe( - true, - aInputs, - new ItemStack[] { aOutput }, - BioItemList.mBioLabParts[4], - aChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue)) - != null; - } - - @Deprecated - public boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative byte glasTier) { - int aSievert = 0; - if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) - aSievert += calculateSv(material); - aSievert = aSievert << 6; - aSievert = aSievert | glasTier; - return this.sBacteriaVat.addRecipe( - new BacteriaVatRecipe( - false, - aInputs, - aOutputs, - null, - new int[] {}, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSievert)) - != null; - } - public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, @Nonnegative int aSv, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { @@ -460,8 +122,8 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | glasTier; - return this.sBacteriaVat.addRecipe( - new BacteriaVatRecipe( + return bacterialVatRecipes.addRecipe( + new GT_Recipe( false, aInputs, null, @@ -489,8 +151,8 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - return this.sBacteriaVat.addRecipe( - new BacteriaVatRecipe( + return bacterialVatRecipes.addRecipe( + new GT_Recipe( false, aInputs, null, @@ -504,57 +166,6 @@ public class BWRecipes { != null; } - @Deprecated - public boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, boolean exactSv) { - int aSievert = 0; - if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) - aSievert += calculateSv(material); - aSievert = aSievert << 1; - aSievert = aSievert | (exactSv ? 1 : 0); - aSievert = aSievert << 6; - return this.sBacteriaVat.addRecipe( - new BacteriaVatRecipe( - false, - aInputs, - aOutputs, - null, - new int[] {}, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSievert)) - != null; - } - - @Deprecated - public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture culture, FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, int aSpecialValue, - boolean exactSv) { - int aSievert = 0; - if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) - aSievert += calculateSv(material); - aSievert = aSievert << 1; - aSievert = aSievert | (exactSv ? 1 : 0); - aSievert = aSievert << 2; - aSievert = aSievert | specialToByte(aSpecialValue); - aSievert = aSievert << 4; - return this.sBacteriaVat.addRecipe( - new BacteriaVatRecipe( - false, - aInputs, - null, - BioItemList.getPetriDish(culture), - new int[] {}, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSievert)) - != null; - } - /** * Adds a Vat recipe without Rad requirements but with Glas requirements */ @@ -562,8 +173,8 @@ public class BWRecipes { FluidStack[] aFluidOutputs, int aDuration, int aEUt, byte glasTier) { int aSievert = 0; aSievert = aSievert | glasTier; - return this.sBacteriaVat.addRecipe( - new BacteriaVatRecipe( + return bacterialVatRecipes.addRecipe( + new GT_Recipe( false, aInputs, null, @@ -582,8 +193,8 @@ public class BWRecipes { */ public boolean addBacterialVatRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, BioCulture culture, FluidStack[] aFluidOutputs, int aDuration, int aEUt) { - return this.sBacteriaVat.addRecipe( - new BacteriaVatRecipe( + return bacterialVatRecipes.addRecipe( + new GT_Recipe( false, aInputs, null, @@ -596,342 +207,4 @@ public class BWRecipes { 0)) != null; } - - public boolean addTrimmedBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative int glasTier, - int aSpecialValue, boolean exactSv) { - byte gTier = (byte) glasTier; - int aSievert = 0; - if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) - aSievert += material.getProtons(); - aSievert = aSievert << 1; - aSievert = aSievert | (exactSv ? 1 : 0); - aSievert = aSievert << 2; - aSievert = aSievert | specialToByte(aSpecialValue); - aSievert = aSievert << 4; - aSievert = aSievert | gTier; - return this.sBacteriaVat.addRecipe( - new BacteriaVatRecipe( - true, - aInputs, - null, - BioItemList.getPetriDish(aCulture), - new int[] {}, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSievert)) - != null; - } - - public static class DynamicGTRecipe extends GT_Recipe { - - public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, - int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue, GT_Recipe originalRecipe) { - super( - aOptimize, - aInputs, - aOutputs, - aSpecialItems, - aChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue); - if (originalRecipe != null) { - this.owners = new ArrayList<>(originalRecipe.owners); - this.stackTraces = new ArrayList<>(originalRecipe.stackTraces); - this.setOwner(MainMod.MOD_ID); - } - } - - public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, - int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue) { - this( - aOptimize, - aInputs, - aOutputs, - aSpecialItems, - aChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue, - null); - } - } - - public static class BW_Recipe_Map_LiquidFuel extends GT_Recipe.GT_Recipe_Map_Fuel { - - public BW_Recipe_Map_LiquidFuel(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { - super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); - } - - public GT_Recipe addLiquidFuel(Materials M, int burn) { - return super.addFuel(M.getCells(1), Materials.Empty.getCells(1), burn); - } - - public GT_Recipe addMoltenFuel(Materials M, int burn) { - return super.addFuel( - GT_OreDictUnificator.get(OrePrefixes.cellMolten, M, 1), - Materials.Empty.getCells(1), - burn); - } - - public GT_Recipe addLiquidFuel(FluidStack fluidStack, int burn) { - return super.addFuel(ItemFluidCell.getUniversalFluidCell(fluidStack), Ic2Items.FluidCell.copy(), burn); - } - } - - public static class BacteriaVatRecipe extends GT_Recipe { - - public BacteriaVatRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, ItemStack aSpecialItems, - int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue) { - super( - aOptimize, - aInputs, - aOutputs, - aSpecialItems, - aChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue); - } - } - - public static class BacteriaVatRecipeMap extends BWRecipes.SpecialObjectSensitiveMap { - - public BacteriaVatRecipeMap(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { - super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); - } - - @Override - protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, - boolean aHidden) { - aRecipe.mHidden = aHidden; - aRecipe.mFakeRecipe = aFakeRecipe; - GT_Recipe isthere = this - .findRecipe(null, false, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs); - - if (aRecipe.mFluidInputs.length < this.mMinimalInputFluids - && aRecipe.mInputs.length < this.mMinimalInputItems) { - return null; - } - return aCheckForCollisions && isthere != null - && BW_Util - .areStacksEqualOrNull((ItemStack) isthere.mSpecialItems, (ItemStack) aRecipe.mSpecialItems) - ? null - : this.add(aRecipe); - } - - public GT_Recipe addRecipe(GT_Recipe aRecipe, boolean VanillaGT) { - if (VanillaGT) return this.addRecipe(aRecipe, true, false, false); - return this.addRecipe(aRecipe); - } - - @Override - public GT_Recipe addRecipe(GT_Recipe aRecipe) { - - if (aRecipe.mInputs.length > 0 && GT_Utility.areStacksEqual( - aRecipe.mInputs[aRecipe.mInputs.length - 1], - GT_Utility.getIntegratedCircuit(32767))) - return aRecipe; - ItemStack[] nu1 = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1); - nu1[nu1.length - 1] = GT_Utility.getIntegratedCircuit(9 + nu1.length); - aRecipe.mInputs = nu1; - if (this.findRecipe(null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null) { - ItemStack[] nu = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1); - int i = 9 + nu.length; - do { - nu[nu.length - 1] = GT_Utility.getIntegratedCircuit(i); - i++; - aRecipe.mInputs = nu; - if (i > 24) i = 1; - if (i == 9 + nu.length) return null; - } while (this.findRecipe(null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) - != null); - } - return this.addRecipe(aRecipe, false, false, false); - } - - @Override - protected List handleNEIItemInputTooltip(List currentTip, - GT_NEI_DefaultHandler.FixedPositionedStack pStack) { - if (pStack.isFluid()) { - currentTip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("nei.biovat.input.tooltip")); - return currentTip; - } - return super.handleNEIItemInputTooltip(currentTip, pStack); - } - - @Override - protected List handleNEIItemOutputTooltip(List currentTip, - GT_NEI_DefaultHandler.FixedPositionedStack pStack) { - if (pStack.isFluid()) { - currentTip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("nei.biovat.output.tooltip")); - return currentTip; - } - return super.handleNEIItemOutputTooltip(currentTip, pStack); - } - - @Override - protected void drawNEIOverlayForInput(GT_NEI_DefaultHandler.FixedPositionedStack stack) { - drawFluidOverlay(stack); - } - - @Override - protected void drawNEIOverlayForOutput(GT_NEI_DefaultHandler.FixedPositionedStack stack) { - drawFluidOverlay(stack); - } - - private void drawFluidOverlay(GT_NEI_DefaultHandler.FixedPositionedStack stack) { - if (stack.isFluid()) { - drawNEIOverlayText( - "+", - stack, - colorOverride.getTextColorOrDefault("nei_overlay_yellow", 0xFDD835), - 0.5f, - true, - Alignment.TopRight); - return; - } - super.drawNEIOverlayForOutput(stack); - } - } - - public static class SpecialObjectSensitiveMap extends GT_Recipe.GT_Recipe_Map { - - public SpecialObjectSensitiveMap(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { - super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); - this.setSpecialSlotSensitive(true); - } - } - - public static class BWNBTDependantCraftingRecipe implements IRecipe { - - ItemStack result; - Map charToStackMap = new HashMap<>(9, 1); - String[] shape; - - @SuppressWarnings({ "SuspiciousSystemArraycopy" }) - public BWNBTDependantCraftingRecipe(ItemStack result, Object... recipe) { - this.result = result; - this.shape = new String[3]; - System.arraycopy(recipe, 0, this.shape, 0, 3); - this.charToStackMap.put(' ', null); - for (int i = 3; i < recipe.length; i += 2) { - this.charToStackMap.put((char) recipe[i], ((ItemStack) recipe[i + 1]).copy()); - } - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof BWRecipes.BWNBTDependantCraftingRecipe that)) return false; - - if (!Objects.equals(this.result, that.result) || !Objects.equals(this.charToStackMap, that.charToStackMap)) - return false; - // Probably incorrect - comparing Object[] arrays with Arrays.equals - return Arrays.equals(this.shape, that.shape); - } - - @Override - public int hashCode() { - int result1 = this.result != null ? this.result.hashCode() : 0; - result1 = 31 * result1 + (this.charToStackMap != null ? this.charToStackMap.hashCode() : 0); - return 31 * result1 + Arrays.hashCode(this.shape); - } - - @Override - public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) { - for (int x = 0; x < 3; x++) { - for (int y = 0; y < 3; y++) { - ItemStack toCheck = p_77569_1_.getStackInRowAndColumn(y, x); - ItemStack ref = this.charToStackMap.get(this.shape[x].toCharArray()[y]); - if (!BW_Util.areStacksEqualOrNull(toCheck, ref)) return false; - } - } - return true; - } - - @Override - public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) { - return this.result.copy(); - } - - @Override - public int getRecipeSize() { - return 10; - } - - @Override - public ItemStack getRecipeOutput() { - return this.result; - } - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java index c56eac94dd..c8fa354dac 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java @@ -16,20 +16,21 @@ package com.github.bartimaeusnek.bartworks.util; import java.util.Optional; import java.util.function.Predicate; +import gregtech.api.recipe.RecipeMap; import gregtech.api.util.GT_Recipe; public class StreamUtils { private StreamUtils() {} - public static Predicate filterVisualMaps() { - return gt_recipe_map -> { - Optional op = gt_recipe_map.mRecipeList.stream().findAny(); + public static Predicate> filterVisualMaps() { + return recipeMap -> { + Optional op = recipeMap.getAllRecipes().stream().findAny(); return op.isPresent() && !op.get().mFakeRecipe; }; } - public static boolean filterVisualMaps(GT_Recipe.GT_Recipe_Map gt_recipe_map) { - return filterVisualMaps().test(gt_recipe_map); + public static boolean filterVisualMaps(RecipeMap recipeMap) { + return filterVisualMaps().test(recipeMap); } } diff --git a/src/main/resources/assets/bartworks/lang/de_DE.lang b/src/main/resources/assets/bartworks/lang/de_DE.lang index 5f47ffc626..23edaf6124 100644 --- a/src/main/resources/assets/bartworks/lang/de_DE.lang +++ b/src/main/resources/assets/bartworks/lang/de_DE.lang @@ -55,9 +55,16 @@ labModule.item.PCRThermoclyclingModule.name=PCR Thermozykler labModule.item.PlasmidSynthesisModule.name=Plasmid Synthese Modul labModule.item.TransformationModule.name=Transformations Modul moon.Ross128ba=Ross128ba -nei.biovat.0.name=Braucht Glass Tier: -nei.biovat.1.name=Braucht genau -nei.biovat.2.name=Braucht mindestens + +# RecipeMap +bw.recipe.biolab=Bio Labor +bw.recipe.BacteriaVat=Bacterien Tank +bw.fuels.acidgens=Säure Generator + +nei.biovat.0.name=Braucht Glass Tier: %s +nei.biovat.1.name=Braucht genau Sievert: %s Sv +nei.biovat.2.name=Braucht mindestens Sievert: %s Sv + planet.Ross128b=Ross128b solarsystem.Ross128System=Ross128-System star.Ross128=Ross128 diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index fdd5498770..7ec5d318d0 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -141,9 +141,19 @@ tooltip.tile.radhatch.9.name=h tooltip.tile.radhatch.10.name=Remaining: %s s / %s s tooltip.tile.acidgen.0.name=An Acid Generator tooltip.tile.acidgen.1.name=Creates Power from Chemical Energy Potentials. -nei.biovat.0.name=Needs Glass Tier: -nei.biovat.1.name=Need exactly -nei.biovat.2.name=Need minimum + +# RecipeMap +bw.recipe.biolab=Bio Lab +bw.recipe.BacteriaVat=Bacterial Vat +bw.fuels.acidgens=Acid Generator +bw.recipe.cal=Circuit Assembly Line +bw.recipe.radhatch=Radio Hatch Material List +gt.recipe.electricimplosioncompressor=Electric Implosion Compressor +bw.recipe.htgr=High Temperature Gas-cooled Reactor + +nei.biovat.0.name=Needs Glass Tier: %s +nei.biovat.1.name=Need exactly Sievert: %s Sv +nei.biovat.2.name=Need minimum Sievert: %s Sv nei.biovat.input.tooltip=Consumed up to 1,001x amount, depending on output rate nei.biovat.output.tooltip=Outputs up to 1,001x amount, depending on the amount of fluid stored in the Output Hatch diff --git a/src/main/resources/assets/bartworks/lang/fr_FR.lang b/src/main/resources/assets/bartworks/lang/fr_FR.lang index 6ccf3387b2..a9f4964759 100644 --- a/src/main/resources/assets/bartworks/lang/fr_FR.lang +++ b/src/main/resources/assets/bartworks/lang/fr_FR.lang @@ -127,9 +127,15 @@ tooltip.tile.radhatch.8.name=m tooltip.tile.radhatch.9.name=h tooltip.tile.acidgen.0.name=Un générateur à acide tooltip.tile.acidgen.1.name=Crée de l'énergie à partir de potentiels chimiques. -nei.biovat.0.name=A besoin du tier de verre: -nei.biovat.1.name=A besoin du montant exact -nei.biovat.2.name=A besoin d'un minimum + +# RecipeMap +bw.recipe.biolab=Bio Lab +bw.recipe.BacteriaVat=Bio Cuve +bw.fuels.acidgens=Générateur à Acide + +nei.biovat.0.name=A besoin du tier de verre: %s +nei.biovat.1.name=A besoin du montant exact Sievert: %s Sv +nei.biovat.2.name=A besoin d'un minimum Sievert: %s Sv tile.diode.name=Diode câble tile.energydistributor.name=Distributeur d'énergie diff --git a/src/main/resources/assets/bartworks/lang/zh_CN.lang b/src/main/resources/assets/bartworks/lang/zh_CN.lang index 6746def6a5..f3a9ca534d 100644 --- a/src/main/resources/assets/bartworks/lang/zh_CN.lang +++ b/src/main/resources/assets/bartworks/lang/zh_CN.lang @@ -127,9 +127,15 @@ tooltip.tile.radhatch.8.name=m tooltip.tile.radhatch.9.name=h tooltip.tile.acidgen.0.name=酸性发电机 tooltip.tile.acidgen.1.name=用化学势能产生电力. -nei.biovat.0.name=需要玻璃等级: -nei.biovat.1.name=精确剂量 -nei.biovat.2.name=最小剂量 + +# RecipeMap +bw.recipe.biolab=生物实验室 +bw.recipe.BacteriaVat=生物培养缸 +bw.fuels.acidgens=酸性发电机 + +nei.biovat.0.name=需要玻璃等级: %s +nei.biovat.1.name=精确剂量 Sievert: %s Sv +nei.biovat.2.name=最小剂量 Sievert: %s Sv tile.diode.name=线缆二极管 tile.energydistributor.name=能量分配器 -- cgit From 1c237fd5800f587ab0ad9f32c3de13f34b6a0db7 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Mon, 4 Dec 2023 09:15:29 +0100 Subject: Update dependencies.gradle Former-commit-id: 900f8c51f41160c1167f93e485919b6585bf347d --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index ccee4a1063..9b67f4e778 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.96:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.97:dev') api("com.github.GTNewHorizons:TecTech:5.3.18:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" -- cgit From 0e6a82b381a0e89644ef2635c9f5af2493663219 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Mon, 4 Dec 2023 12:30:04 +0100 Subject: update deps Former-commit-id: 45e7cba0d03e7e037a935d04799d11d13e238f2c --- dependencies.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index ccee4a1063..46893df7af 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,8 +1,8 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.96:dev') - api("com.github.GTNewHorizons:TecTech:5.3.18:dev") + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.98:dev') + api("com.github.GTNewHorizons:TecTech:5.3.20:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } -- cgit From bfeea075b5b72bea589d78115555e02095bfcbac Mon Sep 17 00:00:00 2001 From: miozune Date: Tue, 12 Dec 2023 16:59:20 +0900 Subject: Fix HTGR not allowing insertion of coolant (#378) * Fix HTGR not allowing insertion of coolant * Fix TGregworks dep Former-commit-id: f35566ca9617b55eb276d045f9cd0a1f8b110dc1 --- dependencies.gradle | 4 ++-- repositories.gradle | 12 ++++++++++++ .../common/tileentities/multis/GT_TileEntity_HTGR.java | 5 +++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 46893df7af..bb2fc75461 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.98:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.106:dev') api("com.github.GTNewHorizons:TecTech:5.3.20:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" @@ -9,6 +9,6 @@ dependencies { api("com.github.GTNewHorizons:Avaritia:1.46:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.10.12-GTNH:dev") - compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.25-pre:dev") {transitive = false} + compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.24:deobf") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.19-GTNH:api") {transitive = false} } diff --git a/repositories.gradle b/repositories.gradle index c227b16ec2..40118b1677 100644 --- a/repositories.gradle +++ b/repositories.gradle @@ -1,4 +1,16 @@ // Add any additional repositories for your dependencies here repositories { + ivy { + url 'https://files.vexatos.com/' + patternLayout { + artifact "[module]/[artifact]-[revision](-[classifier])(.[ext])" + } + content { + includeGroup("TGregworks") + } + metadataSources { + artifact() + } + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 714e774133..a676296b85 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -260,6 +260,11 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase return BartWorksRecipeMaps.htgrFakeRecipes; } + @Override + protected boolean filtersFluid() { + return false; + } + @Override public boolean checkRecipe(ItemStack controllerStack) { -- cgit From de109fe12b3658a147bb39184a58d61ca594bf82 Mon Sep 17 00:00:00 2001 From: Батьків Нестор-Євген Васильович Date: Sat, 16 Dec 2023 21:35:02 +0200 Subject: Fix length calculation for CAL (#379) * Fix length calculation for CAL Since multiblock stacrts checking with PIECE_FIRST and than continue with PIECE_NEXT its length is amount of PIECE_NEXT + 1(first piece) * spotlessApply (#380) Co-authored-by: GitHub GTNH Actions <> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Former-commit-id: 087d4d4eac6a9ad6e8599daa7a44f355f85cd8a6 --- .../common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 016dc0f14c..3a24907884 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -437,7 +437,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends if (!this.checkPiece(STRUCTURE_PIECE_NEXT, leftToRight ? -i : i, 0, 0)) { return false; } - length = i; + length = i + 1; if (!this.mOutputBusses.isEmpty()) { return this.mEnergyHatches.size() == 1 && this.mMaintenanceHatches.size() == 1; -- cgit From 06a18c4ebb60357a14b07ebff39880fb7ecd6ff7 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sun, 17 Dec 2023 00:08:00 +0100 Subject: update bs+deps Former-commit-id: bcbfd8cbaab90c034a6d46b2f71d9ba32789c0d4 --- build.gradle | 8 +++++--- dependencies.gradle | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 8507c7dfbd..50c3291c86 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1701530445 +//version: 1702141377 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -54,7 +54,7 @@ plugins { id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.3.24' + id 'com.gtnewhorizons.retrofuturagradle' version '1.3.26' } print("You might want to check out './gradlew :faq' if your build fails.\n") @@ -613,7 +613,7 @@ repositories { } maven { name = "ic2" - url = getURL("https://maven.ic2.player.to/", "https://maven2.ic2.player.to/") + url = getURL("https://maven2.ic2.player.to/", "https://maven.ic2.player.to/") content { includeGroup "net.industrial-craft" } @@ -672,6 +672,8 @@ configurations.all { substitute module('com.github.GTNewHorizons:SpongePoweredMixin') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") substitute module('com.github.GTNewHorizons:SpongeMixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") substitute module('io.github.legacymoddingmc:unimixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Our previous unimixins upload was missing the dev classifier") + + substitute module('org.scala-lang:scala-library:2.11.1') using module('org.scala-lang:scala-library:2.11.5') because('To allow mixing with Java 8 targets') } } diff --git a/dependencies.gradle b/dependencies.gradle index bb2fc75461..24c4283d2d 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,7 +2,7 @@ dependencies { api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.106:dev') - api("com.github.GTNewHorizons:TecTech:5.3.20:dev") + api("com.github.GTNewHorizons:TecTech:5.3.23:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } -- cgit From 0cc2676ab644e4f6600c31dfd047d8d7375f3b51 Mon Sep 17 00:00:00 2001 From: Abdiel Kavash <19243993+AbdielKavash@users.noreply.github.com> Date: Wed, 20 Dec 2023 08:47:21 -0600 Subject: Allow Mega Oil Cracker to use an input bus. (#382) Former-commit-id: 1f9366a499ee20814019e946b96468e620e02837 --- .../tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index 70a3326729..650e386202 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -114,8 +114,9 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa .newAny(CASING_INDEX, 3)) .addElement( 'm', - buildHatchAdder(GT_TileEntity_MegaOilCracker.class).atLeast(Energy.or(ExoticEnergy), Maintenance) - .casingIndex(CASING_INDEX).dot(1).buildAndChain(GregTech_API.sBlockCasings4, 1)) + buildHatchAdder(GT_TileEntity_MegaOilCracker.class) + .atLeast(Energy.or(ExoticEnergy), Maintenance, InputBus).casingIndex(CASING_INDEX).dot(1) + .buildAndChain(GregTech_API.sBlockCasings4, 1)) .addElement( 'M', InputHatch.withAdder(GT_TileEntity_MegaOilCracker::addMiddleInputToMachineList) @@ -155,12 +156,13 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa .addInfo("Hydro - Consumes 20% less Hydrogen and outputs 25% more cracked fluid") .addInfo("Steam - Outputs 50% more cracked fluid") .addInfo("(Values compared to cracking in the Chemical Reactor)") - .addInfo("Place the appropriate circuit in the controller").addSeparator() + .addInfo("Place the appropriate circuit in the controller or an input bus").addSeparator() .beginStructureBlock(13, 7, 9, true).addController("Front bottom") .addStructureInfo("The glass tier limits the Energy Input tier") .addInfo("Gets 10% EU/t reduction per coil tier, up to a maximum of 50%") .addEnergyHatch("Hint block", 1).addMaintenanceHatch("Hint block", 1).addInputHatch("Hint block", 2, 3) .addOutputHatch("Hint block", 2, 3).addInputHatch("Steam/Hydrogen ONLY, Hint block", 4) + .addInputBus("Optional, for programmed circuit automation. Hint block", 1) .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } -- cgit From f1b0e6c22d0d60fdc883619ad9c3c3a1aafd6fe1 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Wed, 20 Dec 2023 15:53:34 +0100 Subject: update deps Former-commit-id: e20c8047a9725a3777c8a3e28e3cdcf6fe731a34 --- dependencies.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 24c4283d2d..0470ad7947 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,14 +1,14 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.106:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.03:dev') api("com.github.GTNewHorizons:TecTech:5.3.23:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } api("com.github.GTNewHorizons:Avaritia:1.46:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.10.12-GTNH:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.0-GTNH:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.24:deobf") {transitive = false} - compileOnly("com.github.GTNewHorizons:OpenComputers:1.9.19-GTNH:api") {transitive = false} + compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.0-GTNH:api") {transitive = false} } -- cgit From e04e9665ede0a1888cd632030c2c1dbd73729f15 Mon Sep 17 00:00:00 2001 From: Батьків Нестор-Євген Васильович Date: Wed, 20 Dec 2023 19:13:59 +0200 Subject: Fix CAL Locking itself (#381) * Fix CAL Locking itself * Update GT_TileEntity_CircuitAssemblyLine.java Fix null * I did the funny Former-commit-id: bf835f2b3cd559b542fb54873b025be4adedfc43 --- .../tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 3a24907884..68d7f48e12 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -237,8 +237,8 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override public void loadNBTData(NBTTagCompound aNBT) { this.type = aNBT.getCompoundTag(IMPRINT_KEY); - this.imprintedItemName = GT_LanguageManager - .getTranslateableItemStackName(ItemStack.loadItemStackFromNBT(this.type)); + this.imprintedItemName = this.type == null ? "" + : GT_LanguageManager.getTranslateableItemStackName(ItemStack.loadItemStackFromNBT(this.type)); mode = aNBT.getInteger(RUNNING_MODE_KEY); length = aNBT.getInteger(LENGTH_KEY); super.loadNBTData(aNBT); @@ -562,7 +562,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override public boolean isRecipeLockingEnabled() { - return this.imprintedItemName != null && !"".equals(this.imprintedItemName); + return this.mode == 0 && this.imprintedItemName != null && !"".equals(this.imprintedItemName); } @Override -- cgit From 32f2ed1b220b42e11f9d581b3423fea6af694ac7 Mon Sep 17 00:00:00 2001 From: antropod Date: Wed, 27 Dec 2023 02:48:53 +0600 Subject: Fix low power laser converter exploding after being painted and placed back in the world (#383) Former-commit-id: dd1ca5912c0ca3242a95bb31596bb0d495b22783 --- .../tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java index e1f69d8c05..ce6c44e1f7 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java @@ -98,7 +98,9 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_ @Override public void loadNBTData(NBTTagCompound nbtTagCompound) { - Optional.ofNullable(nbtTagCompound).ifPresent(tag -> this.AMPERES = tag.getLong("AMPERES")); + if (nbtTagCompound != null && nbtTagCompound.hasKey("AMPERES")) { + this.AMPERES = nbtTagCompound.getLong("AMPERES"); + } } @Override -- cgit From 050d983a9239275d2a913b62ea96af8b3a0635a8 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Wed, 27 Dec 2023 16:09:51 +0100 Subject: fix muffler hatches (#384) Former-commit-id: 2367f1cdc054684cd78c84fa97b0a77ec0e697ea --- .../common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index edf56833ee..f916daa543 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -344,7 +344,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock pollutionReduction = 100 - tHatch.calculatePollutionReduction(100); break; } - tLiquid.amount = tLiquid.amount * (pollutionReduction + 5) / 100; + tLiquid.amount = tLiquid.amount * pollutionReduction / 100; } else { tOutputHatches = this.mOutputHatches; } -- cgit From 8799aaf5b6d674be1c802d6d64953d7abc0d830f Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Thu, 28 Dec 2023 15:33:20 +0100 Subject: update deps Former-commit-id: 944666f3a1e7616e2f4fd7cc090671d9014b3ee0 --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 0470ad7947..c2e2249e9a 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.03:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.13:dev') api("com.github.GTNewHorizons:TecTech:5.3.23:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" -- cgit From 8c7481597d1503e39e769636631b5a44e28112f1 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Fri, 29 Dec 2023 14:35:56 +0100 Subject: fix industry frame and plat block (#385) Former-commit-id: 7633e42f57b250d04876ac63a936dcc08fae5c31 --- .../GT_Enhancement/PlatinumSludgeOverHaul.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 15b83fb6ff..097e82f5e1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -58,6 +58,7 @@ import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.Sodiumsulfate; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.ZincSulfate; import static gregtech.api.enums.Mods.GTPlusPlus; +import static gregtech.api.enums.Mods.GalaxySpace; import static gregtech.api.enums.Mods.NewHorizonsCoreMod; import static gregtech.api.enums.OrePrefixes.cell; import static gregtech.api.enums.OrePrefixes.crateGtDust; @@ -940,9 +941,20 @@ public class PlatinumSludgeOverHaul { e.printStackTrace(); } } - - if (!BW_Util.checkStackAndPrefix(stack)) return false; - + if (GalaxySpace.isModLoaded()) { + if (stack.getItem() == GT_ModHandler.getModItem(GalaxySpace.ID, "metalsblock", 1L, 7).getItem()) { + return true; + } + } + if (NewHorizonsCoreMod.isModLoaded()) { + if (stack.getItem() + == GT_ModHandler.getModItem(NewHorizonsCoreMod.ID, "item.IndustryFrame", 1L).getItem()) { + return true; + } + } + if (!BW_Util.checkStackAndPrefix(stack)) { + return false; + } return Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST) .contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); } -- cgit From cb509f3947aefaf91d3fceb0c34fca4b05a16b92 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Fri, 29 Dec 2023 14:38:35 +0100 Subject: update gt Former-commit-id: d2eb16eca028d2150fc4a0fb39751e54e63b92d6 --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index c2e2249e9a..b8ff2c4a3b 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.13:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.14:dev') api("com.github.GTNewHorizons:TecTech:5.3.23:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" -- cgit From 1d625e53dc9308f2da96da51f0c9603c45acc00d Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Mon, 8 Jan 2024 21:23:49 +0000 Subject: [ci skip] upgraded build system Former-commit-id: c9b03db260ad736eb1c096d21cc62a2a1d813ea2 --- build.gradle | 33 ++++++++++++++------------------- gradle/wrapper/gradle-wrapper.jar | Bin 63375 -> 43462 bytes gradlew | 17 +++++++++-------- settings.gradle | 9 ++++----- 4 files changed, 27 insertions(+), 32 deletions(-) diff --git a/build.gradle b/build.gradle index 50c3291c86..952a3c59be 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1702141377 +//version: 1704650211 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -31,8 +31,7 @@ buildscript { maven { // GTNH RetroFuturaGradle and ASM Fork name "GTNH Maven" - url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" - allowInsecureProtocol = true + url "https://nexus.gtnewhorizons.com/repository/public/" } mavenLocal() } @@ -49,12 +48,12 @@ plugins { id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version, unused, available for addon.gradle id 'com.github.johnrengelman.shadow' version '8.1.1' apply false id 'com.palantir.git-version' version '3.0.0' apply false - id 'de.undercouch.download' version '5.4.0' + id 'de.undercouch.download' version '5.5.0' id 'com.github.gmazzo.buildconfig' version '3.1.0' apply false // Unused, available for addon.gradle id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.3.26' + id 'com.gtnewhorizons.retrofuturagradle' version '1.3.27' } print("You might want to check out './gradlew :faq' if your build fails.\n") @@ -118,7 +117,7 @@ propertyDefaultIfUnset("forceEnableMixins", false) propertyDefaultIfUnset("channel", "stable") propertyDefaultIfUnset("mappingsVersion", "12") propertyDefaultIfUnset("usesMavenPublishing", true) -propertyDefaultIfUnset("mavenPublishUrl", "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases") +propertyDefaultIfUnset("mavenPublishUrl", "https://nexus.gtnewhorizons.com/repository/releases/") propertyDefaultIfUnset("modrinthProjectId", "") propertyDefaultIfUnset("modrinthRelations", "") propertyDefaultIfUnset("curseForgeProjectId", "") @@ -573,13 +572,15 @@ afterEvaluate { repositories { maven { - name 'Overmind forge repo mirror' - url 'https://gregtech.overminddl1.com/' + name = "GTNH Maven" + url = "https://nexus.gtnewhorizons.com/repository/public/" + // Links for convenience: + // Simple HTML browsing: https://nexus.gtnewhorizons.com/service/rest/repository/browse/releases/ + // Rich web UI browsing: https://nexus.gtnewhorizons.com/#browse/browse:releases } maven { - name = "GTNH Maven" - url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" - allowInsecureProtocol = true + name 'Overmind forge repo mirror' + url 'https://gregtech.overminddl1.com/' } maven { name 'sonatype' @@ -960,8 +961,7 @@ if (usesShadowedDependencies.toBoolean()) { configurations.runtimeElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar)) configurations.apiElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar)) tasks.named("jar", Jar) { - enabled = false - finalizedBy(tasks.shadowJar) + archiveClassifier.set('dev-preshadow') } tasks.named("reobfJar", ReobfuscatedJar) { inputJar.set(tasks.named("shadowJar", ShadowJar).flatMap({it.archiveFile})) @@ -970,11 +970,6 @@ if (usesShadowedDependencies.toBoolean()) { javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements) { skip() } - for (runTask in ["runClient", "runServer", "runClient17", "runServer17"]) { - tasks.named(runTask).configure { - dependsOn("shadowJar") - } - } } ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar ext.publishableObfJar = tasks.reobfJar @@ -1178,7 +1173,7 @@ publishing { if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) { maven { url = mavenPublishUrl - allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven + allowInsecureProtocol = mavenPublishUrl.startsWith("http://") credentials { username = System.getenv("MAVEN_USER") ?: "NONE" password = System.getenv("MAVEN_PASSWORD") ?: "NONE" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 033e24c4cd..d64cd49177 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradlew b/gradlew index fcb6fca147..1aa94a4269 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +202,11 @@ fi # 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"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/settings.gradle b/settings.gradle index 01ea5f121a..8a66026e3d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,10 +4,9 @@ pluginManagement { maven { // RetroFuturaGradle name "GTNH Maven" - url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" - allowInsecureProtocol = true + url "https://nexus.gtnewhorizons.com/repository/public/" mavenContent { - includeGroup("com.gtnewhorizons.retrofuturagradle") + includeGroupByRegex("com\\.gtnewhorizons\\..+") } } gradlePluginPortal() @@ -17,8 +16,8 @@ pluginManagement { } plugins { - id 'com.diffplug.blowdryerSetup' version '1.6.0' - id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains + id 'com.diffplug.blowdryerSetup' version '1.7.1' + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' // Provides java toolchains } blowdryerSetup { -- cgit From ad53eda5d8d64887987b2e3d16633f19cff32229 Mon Sep 17 00:00:00 2001 From: bombcar Date: Wed, 10 Jan 2024 00:40:38 -0600 Subject: update dependencies to fix mutemaster inconsistencies (#386) Former-commit-id: fd9ea53955ec90e205d177148c13bb435ef3fdb8 --- build.gradle | 4 ++-- dependencies.gradle | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 952a3c59be..3eb19a269d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1704650211 +//version: 1704751096 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -786,7 +786,7 @@ dependencies { java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") } if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.35') + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.4.4') } java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false} diff --git a/dependencies.gradle b/dependencies.gradle index b8ff2c4a3b..e8ddbcb9dd 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,14 +1,14 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.14:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.25:dev') api("com.github.GTNewHorizons:TecTech:5.3.23:dev") - api("com.github.GTNewHorizons:GalacticGregGT5:1.0.10:dev") { + api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } - api("com.github.GTNewHorizons:Avaritia:1.46:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.0-GTNH:dev") + api("com.github.GTNewHorizons:Avaritia:1.48:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.5-GTNH:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.24:deobf") {transitive = false} - compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.0-GTNH:api") {transitive = false} + compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.6-GTNH:api") {transitive = false} } -- cgit From d0a886377b8c5482972383dfb7c8748576ec84f3 Mon Sep 17 00:00:00 2001 From: HoleFish <1594248739@qq.com> Date: Tue, 23 Jan 2024 15:10:48 +0800 Subject: Calculate multiplier in a new way Former-commit-id: 948c644cbf0f89d70b07dbca8444b26f0e839f94 --- .../tileentities/multis/GT_TileEntity_BioVat.java | 27 +++++++++------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index fd1fb049cc..9778d5b63d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -80,6 +80,7 @@ import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_ParallelHelper; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -258,26 +259,20 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa @NotNull @Override - public CheckRecipeResult process() { - CheckRecipeResult result = super.process(); - if (!result.wasSuccessful()) { - return result; - } - // We already made sure the recipe runs. Now the vat looks for as many "parallels" as it can do - GT_TileEntity_BioVat.this.mExpectedMultiplier = GT_TileEntity_BioVat.this - .getExpectedMultiplier(this.lastRecipe.getFluidOutput(0), true); - GT_TileEntity_BioVat.this.mTimes = 1; - for (int i = 1; i < GT_TileEntity_BioVat.this.mExpectedMultiplier; i++) { - if (GT_TileEntity_BioVat.this.depleteInput(this.lastRecipe.mFluidInputs[0])) { - GT_TileEntity_BioVat.this.mTimes++; - } - } - this.outputFluids[0].amount *= GT_TileEntity_BioVat.this.mTimes; - return result; + protected GT_ParallelHelper createParallelHelper(@NotNull GT_Recipe recipe) { + return super.createParallelHelper(recipeWithMultiplier(recipe)); } }; } + protected GT_Recipe recipeWithMultiplier(GT_Recipe recipe) { + GT_Recipe tRecipe = recipe.copy(); + int multiplier = getExpectedMultiplier(recipe.getFluidOutput(0), true); + tRecipe.mFluidInputs[0].amount *= multiplier; + tRecipe.mFluidOutputs[0].amount *= multiplier; + return tRecipe; + } + @Override protected void setupProcessingLogic(ProcessingLogic logic) { super.setupProcessingLogic(logic); -- cgit From d523a3059ed1e36766a24aadd008af6ee0e5ca85 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Tue, 23 Jan 2024 19:45:17 +0100 Subject: update bs+deps Former-commit-id: 1d80c0b2184d0dd7536867d37446b671438ba367 --- build.gradle | 27 +++++++++++++++++++++++---- dependencies.gradle | 8 ++++---- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 3eb19a269d..6274cb255e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1704751096 +//version: 1705357285 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -122,6 +122,7 @@ propertyDefaultIfUnset("modrinthProjectId", "") propertyDefaultIfUnset("modrinthRelations", "") propertyDefaultIfUnset("curseForgeProjectId", "") propertyDefaultIfUnset("curseForgeRelations", "") +propertyDefaultIfUnset("versionPattern", "") propertyDefaultIfUnset("minimizeShadowedDependencies", true) propertyDefaultIfUnset("relocateShadowedDependencies", true) // Deprecated properties (kept for backwards compat) @@ -370,6 +371,7 @@ catch (Exception ignored) { // Pulls version first from the VERSION env and then git tag String identifiedVersion String versionOverride = System.getenv("VERSION") ?: null +boolean checkVersion = false try { // Produce a version based on the tag, or for branches something like 0.2.2-configurable-maven-and-extras.38+43090270b6-dirty if (versionOverride == null) { @@ -388,6 +390,8 @@ try { } } else if (isDirty) { identifiedVersion += "-${branchName}+${gitDetails.gitHash}-dirty" + } else { + checkVersion = true } } else { identifiedVersion = versionOverride @@ -409,6 +413,8 @@ ext { if (identifiedVersion == versionOverride) { out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7') +} else if (checkVersion && versionPattern && !(identifiedVersion ==~ versionPattern)) { + throw new GradleException("Invalid version: '$identifiedVersion' does not match version pattern '$versionPattern'") } group = "com.github.GTNewHorizons" @@ -428,18 +434,31 @@ minecraft { for (f in replaceGradleTokenInFile.split(',')) { tagReplacementFiles.add f } + out.style(Style.Info).text('replaceGradleTokenInFile is deprecated! Consider using generateGradleTokenClass.').println() } if (gradleTokenModId) { - injectedTags.put gradleTokenModId, modId + if (replaceGradleTokenInFile) { + injectedTags.put gradleTokenModId, modId + } else { + out.style(Style.Failure).text('gradleTokenModId is deprecated! The field will no longer be generated.').println() + } } if (gradleTokenModName) { - injectedTags.put gradleTokenModName, modName + if (replaceGradleTokenInFile) { + injectedTags.put gradleTokenModName, modName + } else { + out.style(Style.Failure).text('gradleTokenModName is deprecated! The field will no longer be generated.').println() + } } if (gradleTokenVersion) { injectedTags.put gradleTokenVersion, modVersion } if (gradleTokenGroupName) { - injectedTags.put gradleTokenGroupName, modGroup + if (replaceGradleTokenInFile) { + injectedTags.put gradleTokenGroupName, modGroup + } else { + out.style(Style.Failure).text('gradleTokenGroupName is deprecated! The field will no longer be generated.').println() + } } if (enableGenericInjection.toBoolean()) { injectMissingGenerics.set(true) diff --git a/dependencies.gradle b/dependencies.gradle index e8ddbcb9dd..ab02a0615c 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,13 +1,13 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.25:dev') - api("com.github.GTNewHorizons:TecTech:5.3.23:dev") + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.45:dev') + api("com.github.GTNewHorizons:TecTech:5.3.28:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } - api("com.github.GTNewHorizons:Avaritia:1.48:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.5-GTNH:dev") + api("com.github.GTNewHorizons:Avaritia:1.49:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.9-GTNH:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.24:deobf") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.6-GTNH:api") {transitive = false} -- cgit From 1adb98ace59a99226e5f8310de45e302100ee9b9 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Fri, 2 Feb 2024 19:58:14 +0000 Subject: fix MBF tooltip (#388) Former-commit-id: b6b688c08aa01a3c00378e780997b9640ee0d227 --- .../tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index f916daa543..de5ef59f18 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -173,9 +173,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock tt.addMachineType("Blast Furnace").addInfo("Controller block for the Mega Blast Furnace") .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") .addInfo("Each 900K over the min. Heat required reduces power consumption by 5% (multiplicatively)") - .addInfo("Each 1800K over the min. Heat required grants one perfect overclock") + .addInfo("Each 1800K over the min. Heat allows for an overclock to be upgraded to a perfect overclock.") .addInfo( - "For each perfect overclock the EBF will reduce recipe time 4 times (instead of 2) (100% efficiency)") + "That means the EBF will reduce recipe time by a factor 4 instead of 2 (giving 100% efficiency).") .addInfo("Additionally gives +100K for every tier past MV") .addPollutionAmount(20 * this.getPollutionPerTick(null)).addSeparator() .beginStructureBlock(15, 20, 15, true).addController("3rd layer center") -- cgit From e46979b3690825571a8e4775e8234dd657682d2e Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 3 Feb 2024 16:48:54 +0100 Subject: update bs+deps Former-commit-id: 3130c5ad4d1f940e8525ce5a3a196aa2cd5df897 --- build.gradle | 4 ++-- dependencies.gradle | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 6274cb255e..a4236b539a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1705357285 +//version: 1706545953 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -651,7 +651,7 @@ repositories { def mixinProviderGroup = "io.github.legacymoddingmc" def mixinProviderModule = "unimixins" -def mixinProviderVersion = "0.1.13" +def mixinProviderVersion = "0.1.15" def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}" def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev" ext.mixinProviderSpec = mixinProviderSpec diff --git a/dependencies.gradle b/dependencies.gradle index ab02a0615c..840c1661f5 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,13 +1,13 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.45:dev') - api("com.github.GTNewHorizons:TecTech:5.3.28:dev") + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.58:dev') + api("com.github.GTNewHorizons:TecTech:5.3.30:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } api("com.github.GTNewHorizons:Avaritia:1.49:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.9-GTNH:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.11-GTNH:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.24:deobf") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.6-GTNH:api") {transitive = false} -- cgit From 8d089857fc49ad46bc84cb84e0306581e71337ae Mon Sep 17 00:00:00 2001 From: HoleFish <48403212+HoleFish@users.noreply.github.com> Date: Sat, 3 Feb 2024 23:56:53 +0800 Subject: Calculate multiplier in a new way (#387) Former-commit-id: af4c73cf6d2b35b97b6d9fe106ec16b6fa0083fd --- .../tileentities/multis/GT_TileEntity_BioVat.java | 27 +++++++++------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index fd1fb049cc..9778d5b63d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -80,6 +80,7 @@ import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_ParallelHelper; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -258,26 +259,20 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa @NotNull @Override - public CheckRecipeResult process() { - CheckRecipeResult result = super.process(); - if (!result.wasSuccessful()) { - return result; - } - // We already made sure the recipe runs. Now the vat looks for as many "parallels" as it can do - GT_TileEntity_BioVat.this.mExpectedMultiplier = GT_TileEntity_BioVat.this - .getExpectedMultiplier(this.lastRecipe.getFluidOutput(0), true); - GT_TileEntity_BioVat.this.mTimes = 1; - for (int i = 1; i < GT_TileEntity_BioVat.this.mExpectedMultiplier; i++) { - if (GT_TileEntity_BioVat.this.depleteInput(this.lastRecipe.mFluidInputs[0])) { - GT_TileEntity_BioVat.this.mTimes++; - } - } - this.outputFluids[0].amount *= GT_TileEntity_BioVat.this.mTimes; - return result; + protected GT_ParallelHelper createParallelHelper(@NotNull GT_Recipe recipe) { + return super.createParallelHelper(recipeWithMultiplier(recipe)); } }; } + protected GT_Recipe recipeWithMultiplier(GT_Recipe recipe) { + GT_Recipe tRecipe = recipe.copy(); + int multiplier = getExpectedMultiplier(recipe.getFluidOutput(0), true); + tRecipe.mFluidInputs[0].amount *= multiplier; + tRecipe.mFluidOutputs[0].amount *= multiplier; + return tRecipe; + } + @Override protected void setupProcessingLogic(ProcessingLogic logic) { super.setupProcessingLogic(logic); -- cgit From e20356931786eb060f626f774922fd52e0c890e5 Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Sun, 4 Feb 2024 19:56:42 +0000 Subject: [ci skip] upgraded build system Former-commit-id: 61bdd70febccf8d5803a904cc81a7feac521c8bc --- build.gradle | 1623 +----------------------------- gradle.properties | 128 ++- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew.bat | 20 +- settings.gradle | 10 +- 5 files changed, 101 insertions(+), 1682 deletions(-) diff --git a/build.gradle b/build.gradle index a4236b539a..e57a16f9f1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,1624 +1,5 @@ -//version: 1706545953 -/* - DO NOT CHANGE THIS FILE! - Also, you may replace this file at any time if there is an update available. - Please check https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/master/build.gradle for updates. - */ +//version: 1707058017 - -import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar -import com.gtnewhorizons.retrofuturagradle.ObfuscationAttribute -import com.gtnewhorizons.retrofuturagradle.mcp.ReobfuscatedJar -import com.gtnewhorizons.retrofuturagradle.minecraft.RunMinecraftTask -import com.gtnewhorizons.retrofuturagradle.util.Distribution -import com.matthewprenger.cursegradle.CurseArtifact -import com.matthewprenger.cursegradle.CurseRelation -import com.modrinth.minotaur.dependencies.ModDependency -import com.modrinth.minotaur.dependencies.VersionDependency -import org.gradle.internal.logging.text.StyledTextOutput.Style -import org.gradle.internal.logging.text.StyledTextOutputFactory -import org.gradle.internal.xml.XmlTransformer -import org.jetbrains.gradle.ext.Application -import org.jetbrains.gradle.ext.Gradle - -import javax.inject.Inject -import java.nio.file.Files -import java.nio.file.Paths -import java.util.concurrent.TimeUnit - -buildscript { - repositories { - maven { - // GTNH RetroFuturaGradle and ASM Fork - name "GTNH Maven" - url "https://nexus.gtnewhorizons.com/repository/public/" - } - mavenLocal() - } -} plugins { - id 'java-library' - id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7" - id 'eclipse' - id 'scala' - id 'maven-publish' - id 'org.jetbrains.kotlin.jvm' version '1.8.0' apply false - id 'org.jetbrains.kotlin.kapt' version '1.8.0' apply false - id 'com.google.devtools.ksp' version '1.8.0-1.0.9' apply false - id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version, unused, available for addon.gradle - id 'com.github.johnrengelman.shadow' version '8.1.1' apply false - id 'com.palantir.git-version' version '3.0.0' apply false - id 'de.undercouch.download' version '5.5.0' - id 'com.github.gmazzo.buildconfig' version '3.1.0' apply false // Unused, available for addon.gradle - id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version - id 'com.modrinth.minotaur' version '2.+' apply false - id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.3.27' -} - -print("You might want to check out './gradlew :faq' if your build fails.\n") - -boolean settingsupdated = verifySettingsGradle() -settingsupdated = verifyGitAttributes() || settingsupdated -if (settingsupdated) - throw new GradleException("Settings has been updated, please re-run task.") - -// In submodules, .git is a file pointing to the real git dir -if (project.file('.git/HEAD').isFile() || project.file('.git').isFile()) { - apply plugin: 'com.palantir.git-version' -} - -def out = services.get(StyledTextOutputFactory).create('an-output') - -def projectJavaVersion = JavaLanguageVersion.of(8) - -boolean disableSpotless = project.hasProperty("disableSpotless") ? project.disableSpotless.toBoolean() : false -boolean disableCheckstyle = project.hasProperty("disableCheckstyle") ? project.disableCheckstyle.toBoolean() : false - -final String CHECKSTYLE_CONFIG = """ - - - - - - - - - - - -""" - -checkPropertyExists("modName") -checkPropertyExists("modId") -checkPropertyExists("modGroup") -checkPropertyExists("autoUpdateBuildScript") -checkPropertyExists("minecraftVersion") -checkPropertyExists("forgeVersion") -checkPropertyExists("replaceGradleTokenInFile") -checkPropertyExists("gradleTokenVersion") -checkPropertyExists("apiPackage") -checkPropertyExists("accessTransformersFile") -checkPropertyExists("usesMixins") -checkPropertyExists("mixinPlugin") -checkPropertyExists("mixinsPackage") -checkPropertyExists("coreModClass") -checkPropertyExists("containsMixinsAndOrCoreModOnly") -checkPropertyExists("usesShadowedDependencies") -checkPropertyExists("developmentEnvironmentUserName") - -propertyDefaultIfUnset("generateGradleTokenClass", "") -propertyDefaultIfUnset("includeWellKnownRepositories", true) -propertyDefaultIfUnset("noPublishedSources", false) -propertyDefaultIfUnset("usesMixinDebug", project.usesMixins) -propertyDefaultIfUnset("forceEnableMixins", false) -propertyDefaultIfUnset("channel", "stable") -propertyDefaultIfUnset("mappingsVersion", "12") -propertyDefaultIfUnset("usesMavenPublishing", true) -propertyDefaultIfUnset("mavenPublishUrl", "https://nexus.gtnewhorizons.com/repository/releases/") -propertyDefaultIfUnset("modrinthProjectId", "") -propertyDefaultIfUnset("modrinthRelations", "") -propertyDefaultIfUnset("curseForgeProjectId", "") -propertyDefaultIfUnset("curseForgeRelations", "") -propertyDefaultIfUnset("versionPattern", "") -propertyDefaultIfUnset("minimizeShadowedDependencies", true) -propertyDefaultIfUnset("relocateShadowedDependencies", true) -// Deprecated properties (kept for backwards compat) -propertyDefaultIfUnset("gradleTokenModId", "") -propertyDefaultIfUnset("gradleTokenModName", "") -propertyDefaultIfUnset("gradleTokenGroupName", "") - -propertyDefaultIfUnset("enableModernJavaSyntax", false) // On by default for new projects only -propertyDefaultIfUnset("enableGenericInjection", false) // On by default for new projects only - -// this is meant to be set using the user wide property file. by default we do nothing. -propertyDefaultIfUnset("ideaOverrideBuildType", "") // Can be nothing, "gradle" or "idea" - -project.extensions.add(com.diffplug.blowdryer.Blowdryer, "Blowdryer", com.diffplug.blowdryer.Blowdryer) // Make blowdryer available in "apply from:" scripts -if (!disableSpotless) { - apply plugin: 'com.diffplug.spotless' - apply from: Blowdryer.file('spotless.gradle') -} - -if (!disableCheckstyle) { - apply plugin: 'checkstyle' - tasks.named("checkstylePatchedMc") { enabled = false } - tasks.named("checkstyleMcLauncher") { enabled = false } - tasks.named("checkstyleIdeVirtualMain") { enabled = false } - tasks.named("checkstyleInjectedTags") { enabled = false } - checkstyle { - config = resources.text.fromString(CHECKSTYLE_CONFIG) - } -} - -String javaSourceDir = "src/main/java/" -String scalaSourceDir = "src/main/scala/" -String kotlinSourceDir = "src/main/kotlin/" - -if (usesShadowedDependencies.toBoolean()) { - apply plugin: "com.github.johnrengelman.shadow" -} - -java { - toolchain { - if (enableModernJavaSyntax.toBoolean()) { - languageVersion.set(JavaLanguageVersion.of(17)) - } else { - languageVersion.set(projectJavaVersion) - } - vendor.set(JvmVendorSpec.AZUL) - } - if (!noPublishedSources) { - withSourcesJar() - } -} - -tasks.withType(JavaCompile).configureEach { - options.encoding = "UTF-8" -} - -tasks.withType(ScalaCompile).configureEach { - options.encoding = "UTF-8" -} - -pluginManager.withPlugin('org.jetbrains.kotlin.jvm') { - // If Kotlin is enabled in the project - kotlin { - jvmToolchain(8) - } - // Kotlin hacks our source sets, so we hack Kotlin's tasks - def disabledKotlinTaskList = [ - "kaptGenerateStubsMcLauncherKotlin", - "kaptGenerateStubsPatchedMcKotlin", - "kaptGenerateStubsInjectedTagsKotlin", - "compileMcLauncherKotlin", - "compilePatchedMcKotlin", - "compileInjectedTagsKotlin", - "kaptMcLauncherKotlin", - "kaptPatchedMcKotlin", - "kaptInjectedTagsKotlin", - "kspMcLauncherKotlin", - "kspPatchedMcKotlin", - "kspInjectedTagsKotlin", - ] - tasks.configureEach { task -> - if (task.name in disabledKotlinTaskList) { - task.enabled = false - } - } -} - -configurations { - create("runtimeOnlyNonPublishable") { - description = "Runtime only dependencies that are not published alongside the jar" - canBeConsumed = false - canBeResolved = false - } - - create("devOnlyNonPublishable") { - description = "Runtime and compiletime dependencies that are not published alongside the jar (compileOnly + runtimeOnlyNonPublishable)" - canBeConsumed = false - canBeResolved = false - } - compileOnly.extendsFrom(devOnlyNonPublishable) - runtimeOnlyNonPublishable.extendsFrom(devOnlyNonPublishable) -} - -if (enableModernJavaSyntax.toBoolean()) { - repositories { - mavenCentral { - mavenContent { - includeGroup("me.eigenraven.java8unsupported") - } - } - } - - dependencies { - annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:1.0.0' - // workaround for https://github.com/bsideup/jabel/issues/174 - annotationProcessor 'net.java.dev.jna:jna-platform:5.13.0' - compileOnly('com.github.bsideup.jabel:jabel-javac-plugin:1.0.0') { - transitive = false // We only care about the 1 annotation class - } - // Allow using jdk.unsupported classes like sun.misc.Unsafe in the compiled code, working around JDK-8206937. - patchedMinecraft('me.eigenraven.java8unsupported:java-8-unsupported-shim:1.0.0') - } - - tasks.withType(JavaCompile).configureEach { - if (it.name in ["compileMcLauncherJava", "compilePatchedMcJava"]) { - return - } - sourceCompatibility = 17 // for the IDE support - options.release.set(8) - - javaCompiler.set(javaToolchains.compilerFor { - languageVersion.set(JavaLanguageVersion.of(17)) - vendor.set(JvmVendorSpec.AZUL) - }) - } -} - -eclipse { - classpath { - downloadSources = true - downloadJavadoc = true - } -} - -final String modGroupPath = modGroup.toString().replace('.' as char, '/' as char) -final String apiPackagePath = apiPackage.toString().replace('.' as char, '/' as char) - -String targetPackageJava = javaSourceDir + modGroupPath -String targetPackageScala = scalaSourceDir + modGroupPath -String targetPackageKotlin = kotlinSourceDir + modGroupPath -if (!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { - throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) -} - -if (apiPackage) { - targetPackageJava = javaSourceDir + modGroupPath + "/" + apiPackagePath - targetPackageScala = scalaSourceDir + modGroupPath + "/" + apiPackagePath - targetPackageKotlin = kotlinSourceDir + modGroupPath + "/" + apiPackagePath - if (!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { - throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) - } -} - -if (accessTransformersFile) { - for (atFile in accessTransformersFile.split(" ")) { - String targetFile = "src/main/resources/META-INF/" + atFile.trim() - if (!getFile(targetFile).exists()) { - throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) - } - tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(targetFile) - tasks.srgifyBinpatchedJar.accessTransformerFiles.from(targetFile) - } -} else { - boolean atsFound = false - for (File at : sourceSets.getByName("main").resources.files) { - if (at.name.toLowerCase().endsWith("_at.cfg")) { - atsFound = true - tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(at) - tasks.srgifyBinpatchedJar.accessTransformerFiles.from(at) - } - } - for (File at : sourceSets.getByName("api").resources.files) { - if (at.name.toLowerCase().endsWith("_at.cfg")) { - atsFound = true - tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(at) - tasks.srgifyBinpatchedJar.accessTransformerFiles.from(at) - } - } - if (atsFound) { - logger.warn("Found and added access transformers in the resources folder, please configure gradle.properties to explicitly mention them by name") - } -} - -if (usesMixins.toBoolean()) { - if (mixinsPackage.isEmpty()) { - throw new GradleException("\"usesMixins\" requires \"mixinsPackage\" to be set!") - } - final String mixinPackagePath = mixinsPackage.toString().replaceAll("\\.", "/") - final String mixinPluginPath = mixinPlugin.toString().replaceAll("\\.", "/") - - targetPackageJava = javaSourceDir + modGroupPath + "/" + mixinPackagePath - targetPackageScala = scalaSourceDir + modGroupPath + "/" + mixinPackagePath - targetPackageKotlin = kotlinSourceDir + modGroupPath + "/" + mixinPackagePath - if (!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { - throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) - } - - if (!mixinPlugin.isEmpty()) { - String targetFileJava = javaSourceDir + modGroupPath + "/" + mixinPluginPath + ".java" - String targetFileScala = scalaSourceDir + modGroupPath + "/" + mixinPluginPath + ".scala" - String targetFileScalaJava = scalaSourceDir + modGroupPath + "/" + mixinPluginPath + ".java" - String targetFileKotlin = kotlinSourceDir + modGroupPath + "/" + mixinPluginPath + ".kt" - if (!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) { - throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin) - } - } -} - -if (coreModClass) { - final String coreModPath = coreModClass.toString().replaceAll("\\.", "/") - String targetFileJava = javaSourceDir + modGroupPath + "/" + coreModPath + ".java" - String targetFileScala = scalaSourceDir + modGroupPath + "/" + coreModPath + ".scala" - String targetFileScalaJava = scalaSourceDir + modGroupPath + "/" + coreModPath + ".java" - String targetFileKotlin = kotlinSourceDir + modGroupPath + "/" + coreModPath + ".kt" - if (!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) { - throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin) - } -} - -configurations.configureEach { - resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS) - - // Make sure GregTech build won't time out - System.setProperty("org.gradle.internal.http.connectionTimeout", 120000 as String) - System.setProperty("org.gradle.internal.http.socketTimeout", 120000 as String) -} - -// Fix Jenkins' Git: chmod a file should not be detected as a change and append a '.dirty' to the version -try { - 'git config core.fileMode false'.execute() -} -catch (Exception ignored) { - out.style(Style.Failure).println("git isn't installed at all") -} - -// Pulls version first from the VERSION env and then git tag -String identifiedVersion -String versionOverride = System.getenv("VERSION") ?: null -boolean checkVersion = false -try { - // Produce a version based on the tag, or for branches something like 0.2.2-configurable-maven-and-extras.38+43090270b6-dirty - if (versionOverride == null) { - def gitDetails = versionDetails() - def isDirty = gitVersion().endsWith(".dirty") // No public API for this, isCleanTag has a different meaning - String branchName = gitDetails.branchName ?: (System.getenv('GIT_BRANCH') ?: 'git') - if (branchName.startsWith('origin/')) { - branchName = branchName.minus('origin/') - } - branchName = branchName.replaceAll("[^a-zA-Z0-9-]+", "-") // sanitize branch names for semver - identifiedVersion = gitDetails.lastTag ?: '${gitDetails.gitHash}' - if (gitDetails.commitDistance > 0) { - identifiedVersion += "-${branchName}.${gitDetails.commitDistance}+${gitDetails.gitHash}" - if (isDirty) { - identifiedVersion += "-dirty" - } - } else if (isDirty) { - identifiedVersion += "-${branchName}+${gitDetails.gitHash}-dirty" - } else { - checkVersion = true - } - } else { - identifiedVersion = versionOverride - } -} -catch (Exception ignored) { - out.style(Style.Failure).text( - 'This mod must be version controlled by Git AND the repository must provide at least one tag,\n' + - 'or the VERSION override must be set! ').style(Style.SuccessHeader).text('(Do NOT download from GitHub using the ZIP option, instead\n' + - 'clone the repository, see ').style(Style.Info).text('https://gtnh.miraheze.org/wiki/Development').style(Style.SuccessHeader).println(' for details.)' - ) - versionOverride = 'NO-GIT-TAG-SET' - identifiedVersion = versionOverride -} -version = identifiedVersion -ext { - modVersion = identifiedVersion -} - -if (identifiedVersion == versionOverride) { - out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7') -} else if (checkVersion && versionPattern && !(identifiedVersion ==~ versionPattern)) { - throw new GradleException("Invalid version: '$identifiedVersion' does not match version pattern '$versionPattern'") -} - -group = "com.github.GTNewHorizons" -if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) { - base { - archivesName = customArchiveBaseName - } -} else { - base { - archivesName = modId - } -} - - -minecraft { - if (replaceGradleTokenInFile) { - for (f in replaceGradleTokenInFile.split(',')) { - tagReplacementFiles.add f - } - out.style(Style.Info).text('replaceGradleTokenInFile is deprecated! Consider using generateGradleTokenClass.').println() - } - if (gradleTokenModId) { - if (replaceGradleTokenInFile) { - injectedTags.put gradleTokenModId, modId - } else { - out.style(Style.Failure).text('gradleTokenModId is deprecated! The field will no longer be generated.').println() - } - } - if (gradleTokenModName) { - if (replaceGradleTokenInFile) { - injectedTags.put gradleTokenModName, modName - } else { - out.style(Style.Failure).text('gradleTokenModName is deprecated! The field will no longer be generated.').println() - } - } - if (gradleTokenVersion) { - injectedTags.put gradleTokenVersion, modVersion - } - if (gradleTokenGroupName) { - if (replaceGradleTokenInFile) { - injectedTags.put gradleTokenGroupName, modGroup - } else { - out.style(Style.Failure).text('gradleTokenGroupName is deprecated! The field will no longer be generated.').println() - } - } - if (enableGenericInjection.toBoolean()) { - injectMissingGenerics.set(true) - } - - username = developmentEnvironmentUserName.toString() - - lwjgl3Version = "3.3.2" - - // Enable assertions in the current mod - extraRunJvmArguments.add("-ea:${modGroup}") - - if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { - if (usesMixinDebug.toBoolean()) { - extraRunJvmArguments.addAll([ - "-Dmixin.debug.countInjections=true", - "-Dmixin.debug.verbose=true", - "-Dmixin.debug.export=true" - ]) - } - } - - // Blowdryer is present in some old mod builds, do not propagate it further as a dependency - // IC2 has no reobf jars in its Maven - groupsToExcludeFromAutoReobfMapping.addAll(["com.diffplug", "com.diffplug.durian", "net.industrial-craft"]) -} - -if (generateGradleTokenClass) { - tasks.injectTags.outputClassName.set(generateGradleTokenClass) -} - -// Custom reobf auto-mappings -configurations.configureEach { - dependencies.configureEach { dep -> - if (dep instanceof org.gradle.api.artifacts.ExternalModuleDependency) { - if (dep.group == "net.industrial-craft" && dep.name == "industrialcraft-2") { - // https://www.curseforge.com/minecraft/mc-mods/industrial-craft/files/2353971 - project.dependencies.reobfJarConfiguration("curse.maven:ic2-242638:2353971") - } - } - } - def obfuscationAttr = it.attributes.getAttribute(ObfuscationAttribute.OBFUSCATION_ATTRIBUTE) - if (obfuscationAttr != null && obfuscationAttr.name == ObfuscationAttribute.SRG) { - resolutionStrategy.eachDependency { DependencyResolveDetails details -> - // Remap CoFH core cursemaven dev jar to the obfuscated version for runObfClient/Server - if (details.requested.group == 'curse.maven' && details.requested.name.endsWith('-69162') && details.requested.version == '2388751') { - details.useVersion '2388750' - details.because 'Pick obfuscated jar' - } - } - } -} - -// Ensure tests have access to minecraft classes -sourceSets { - test { - java { - compileClasspath += sourceSets.patchedMc.output + sourceSets.mcLauncher.output - runtimeClasspath += sourceSets.patchedMc.output + sourceSets.mcLauncher.output - } - } -} - -if (file('addon.gradle.kts').exists()) { - apply from: 'addon.gradle.kts' -} else if (file('addon.gradle').exists()) { - apply from: 'addon.gradle' -} - -// File for local tweaks not commited to Git -if (file('addon.local.gradle.kts').exists()) { - apply from: 'addon.local.gradle.kts' -} else if (file('addon.local.gradle').exists()) { - apply from: 'addon.local.gradle' -} - -// Allow unsafe repos but warn -repositories.configureEach { repo -> - if (repo instanceof org.gradle.api.artifacts.repositories.UrlArtifactRepository) { - if (repo.getUrl() != null && repo.getUrl().getScheme() == "http" && !repo.allowInsecureProtocol) { - logger.warn("Deprecated: Allowing insecure connections for repo '${repo.name}' - add 'allowInsecureProtocol = true'") - repo.allowInsecureProtocol = true - } - } -} - -if (file('repositories.gradle.kts').exists()) { - apply from: 'repositories.gradle.kts' -} else if (file('repositories.gradle').exists()) { - apply from: 'repositories.gradle' -} else { - logger.error("Neither repositories.gradle.kts nor repositories.gradle was found, make sure you extracted the full ExampleMod template.") - throw new RuntimeException("Missing repositories.gradle[.kts]") -} - -configurations { - runtimeClasspath.extendsFrom(runtimeOnlyNonPublishable) - testRuntimeClasspath.extendsFrom(runtimeOnlyNonPublishable) - for (config in [compileClasspath, runtimeClasspath, testCompileClasspath, testRuntimeClasspath]) { - if (usesShadowedDependencies.toBoolean()) { - config.extendsFrom(shadowImplementation) - // TODO: remove Compile after all uses are refactored to Implementation - config.extendsFrom(shadeCompile) - config.extendsFrom(shadowCompile) - } - } - // A "bag-of-dependencies"-style configuration for backwards compatibility, gets put in "api" - create("compile") { - description = "Deprecated: use api or implementation instead, gets put in api" - canBeConsumed = false - canBeResolved = false - visible = false - } - create("testCompile") { - description = "Deprecated: use testImplementation instead" - canBeConsumed = false - canBeResolved = false - visible = false - } - api.extendsFrom(compile) - testImplementation.extendsFrom(testCompile) -} - -afterEvaluate { - if (!configurations.compile.allDependencies.empty || !configurations.testCompile.allDependencies.empty) { - logger.warn("This project uses deprecated `compile` dependencies, please migrate to using `api` and `implementation`") - logger.warn("For more details, see https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/master/dependencies.gradle") - } -} - -repositories { - maven { - name = "GTNH Maven" - url = "https://nexus.gtnewhorizons.com/repository/public/" - // Links for convenience: - // Simple HTML browsing: https://nexus.gtnewhorizons.com/service/rest/repository/browse/releases/ - // Rich web UI browsing: https://nexus.gtnewhorizons.com/#browse/browse:releases - } - maven { - name 'Overmind forge repo mirror' - url 'https://gregtech.overminddl1.com/' - } - maven { - name 'sonatype' - url 'https://oss.sonatype.org/content/repositories/snapshots/' - content { - includeGroup "org.lwjgl" - } - } - if (includeWellKnownRepositories.toBoolean()) { - exclusiveContent { - forRepository { - maven { - name "CurseMaven" - url "https://cursemaven.com" - } - } - filter { - includeGroup "curse.maven" - } - } - exclusiveContent { - forRepository { - maven { - name = "Modrinth" - url = "https://api.modrinth.com/maven" - } - } - filter { - includeGroup "maven.modrinth" - } - } - maven { - name = "ic2" - url = getURL("https://maven2.ic2.player.to/", "https://maven.ic2.player.to/") - content { - includeGroup "net.industrial-craft" - } - metadataSources { - mavenPom() - artifact() - } - } - maven { - name "MMD Maven" - url "https://maven.mcmoddev.com/" - } - } -} - -def mixinProviderGroup = "io.github.legacymoddingmc" -def mixinProviderModule = "unimixins" -def mixinProviderVersion = "0.1.15" -def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}" -def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev" -ext.mixinProviderSpec = mixinProviderSpec - -def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json' - -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(mixinProviderSpec) - if (usesMixinDebug.toBoolean()) { - runtimeOnlyNonPublishable('org.jetbrains:intellij-fernflower:1.2.1.16') - } - } - if (usesMixins.toBoolean()) { - implementation(modUtils.enableMixins(mixinProviderSpec, mixingConfigRefMap)) - } else if (forceEnableMixins.toBoolean()) { - runtimeOnlyNonPublishable(mixinProviderSpec) - } -} - -pluginManager.withPlugin('org.jetbrains.kotlin.kapt') { - if (usesMixins.toBoolean()) { - dependencies { - kapt(mixinProviderSpec) - } - } -} - -// Replace old mixin mods with unimixins -// https://docs.gradle.org/8.0.2/userguide/resolution_rules.html#sec:substitution_with_classifier -configurations.all { - resolutionStrategy.dependencySubstitution { - substitute module('com.gtnewhorizon:gtnhmixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") - substitute module('com.github.GTNewHorizons:Mixingasm') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") - substitute module('com.github.GTNewHorizons:SpongePoweredMixin') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") - substitute module('com.github.GTNewHorizons:SpongeMixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") - substitute module('io.github.legacymoddingmc:unimixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Our previous unimixins upload was missing the dev classifier") - - substitute module('org.scala-lang:scala-library:2.11.1') using module('org.scala-lang:scala-library:2.11.5') because('To allow mixing with Java 8 targets') - } -} - -dependencies { - constraints { - def minGtnhLibVersion = "0.0.13" - implementation("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") { - because("fixes duplicate mod errors in java 17 configurations using old gtnhlib") - } - runtimeOnly("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") { - because("fixes duplicate mod errors in java 17 configurations using old gtnhlib") - } - devOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") { - because("fixes duplicate mod errors in java 17 configurations using old gtnhlib") - } - runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") { - because("fixes duplicate mod errors in java 17 configurations using old gtnhlib") - } - } -} - -if (file('dependencies.gradle.kts').exists()) { - apply from: 'dependencies.gradle.kts' -} else if (file('dependencies.gradle').exists()) { - apply from: 'dependencies.gradle' -} else { - logger.error("Neither dependencies.gradle.kts nor dependencies.gradle was found, make sure you extracted the full ExampleMod template.") - throw new RuntimeException("Missing dependencies.gradle[.kts]") -} - -tasks.register('generateAssets') { - group = "GTNH Buildscript" - description = "Generates a mixin config file at /src/main/resources/mixins.modid.json if needed" - onlyIf { usesMixins.toBoolean() } - doLast { - def mixinConfigFile = getFile("/src/main/resources/mixins." + modId + ".json") - if (!mixinConfigFile.exists()) { - def mixinPluginLine = "" - if (!mixinPlugin.isEmpty()) { - // We might not have a mixin plugin if we're using early/late mixins - mixinPluginLine += """\n "plugin": "${modGroup}.${mixinPlugin}", """ - } - - mixinConfigFile.text = """{ - "required": true, - "minVersion": "0.8.5-GTNH", - "package": "${modGroup}.${mixinsPackage}",${mixinPluginLine} - "refmap": "${mixingConfigRefMap}", - "target": "@env(DEFAULT)", - "compatibilityLevel": "JAVA_8", - "mixins": [], - "client": [], - "server": [] -} -""" - } - } -} - -if (usesMixins.toBoolean()) { - tasks.named("processResources").configure { - dependsOn("generateAssets") - } - - tasks.named("compileJava", JavaCompile).configure { - options.compilerArgs += [ - // 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" - ] - } -} - -tasks.named("processResources", ProcessResources).configure { - // this will ensure that this task is redone when the versions change. - inputs.property "version", project.version - inputs.property "mcversion", project.minecraft.mcVersion - exclude("spotless.gradle") - - // replace stuff in mcmod.info, nothing else. replaces ${key} with value in text - filesMatching("mcmod.info") { - expand "minecraftVersion": project.minecraft.mcVersion, - "modVersion": modVersion, - "modId": modId, - "modName": modName - } - - if (usesMixins.toBoolean()) { - dependsOn("compileJava", "compileScala") - } -} - -ext.java17Toolchain = (JavaToolchainSpec spec) -> { - spec.languageVersion.set(JavaLanguageVersion.of(17)) - spec.vendor.set(JvmVendorSpec.matching("jetbrains")) -} - -ext.java17DependenciesCfg = configurations.create("java17Dependencies") { - extendsFrom(configurations.getByName("runtimeClasspath")) // Ensure consistent transitive dependency resolution - canBeConsumed = false -} -ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies") { - canBeConsumed = false -} - -dependencies { - def lwjgl3ifyVersion = '1.5.7' - if (modId != 'lwjgl3ify') { - java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") - } - if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.4.4') - } - - java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false} -} - -ext.java17JvmArgs = [ - // Java 9+ support - "--illegal-access=warn", - "-Djava.security.manager=allow", - "-Dfile.encoding=UTF-8", - "--add-opens", "java.base/jdk.internal.loader=ALL-UNNAMED", - "--add-opens", "java.base/java.net=ALL-UNNAMED", - "--add-opens", "java.base/java.nio=ALL-UNNAMED", - "--add-opens", "java.base/java.io=ALL-UNNAMED", - "--add-opens", "java.base/java.lang=ALL-UNNAMED", - "--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED", - "--add-opens", "java.base/java.text=ALL-UNNAMED", - "--add-opens", "java.base/java.util=ALL-UNNAMED", - "--add-opens", "java.base/jdk.internal.reflect=ALL-UNNAMED", - "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", - "--add-opens", "jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED,java.naming", - "--add-opens", "java.desktop/sun.awt.image=ALL-UNNAMED", - "--add-modules", "jdk.dynalink", - "--add-opens", "jdk.dynalink/jdk.dynalink.beans=ALL-UNNAMED", - "--add-modules", "java.sql.rowset", - "--add-opens", "java.sql.rowset/javax.sql.rowset.serial=ALL-UNNAMED" -] - -ext.hotswapJvmArgs = [ - // DCEVM advanced hot reload - "-XX:+AllowEnhancedClassRedefinition", - "-XX:HotswapAgent=fatjar" -] - -ext.setupHotswapAgentTask = tasks.register("setupHotswapAgent") { - group = "GTNH Buildscript" - description = "Installs a recent version of HotSwapAgent into the Java 17 JetBrains runtime directory" - def hsaUrl = 'https://github.com/HotswapProjects/HotswapAgent/releases/download/1.4.2-SNAPSHOT/hotswap-agent-1.4.2-SNAPSHOT.jar' - def targetFolderProvider = javaToolchains.launcherFor(java17Toolchain).map {it.metadata.installationPath.dir("lib/hotswap")} - def targetFilename = "hotswap-agent.jar" - onlyIf { - !targetFolderProvider.get().file(targetFilename).asFile.exists() - } - doLast { - def targetFolder = targetFolderProvider.get() - targetFolder.asFile.mkdirs() - download.run { - src hsaUrl - dest targetFolder.file(targetFilename).asFile - overwrite false - tempAndMove true - } - } -} - -public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask { - // IntelliJ doesn't seem to allow commandline arguments so we also support an env variable - private boolean enableHotswap = Boolean.valueOf(System.getenv("HOTSWAP")); - - @Input - public boolean getEnableHotswap() { return enableHotswap } - @Option(option = "hotswap", description = "Enables HotSwapAgent for enhanced class reloading under a debugger") - public boolean setEnableHotswap(boolean enable) { enableHotswap = enable } - - @Inject - public RunHotswappableMinecraftTask(Distribution side, String superTask, org.gradle.api.invocation.Gradle gradle) { - super(side, gradle) - - this.lwjglVersion = 3 - this.javaLauncher = project.javaToolchains.launcherFor(project.java17Toolchain) - this.extraJvmArgs.addAll(project.java17JvmArgs) - this.extraJvmArgs.addAll(project.provider(() -> enableHotswap ? project.hotswapJvmArgs : [])) - - this.classpath(project.java17PatchDependenciesCfg) - if (side == Distribution.CLIENT) { - this.classpath(project.minecraftTasks.lwjgl3Configuration) - } - // Use a raw provider instead of map to not create a dependency on the task - this.classpath(project.provider(() -> project.tasks.named(superTask, RunMinecraftTask).get().classpath)) - this.classpath.filter { file -> - !file.path.contains("2.9.4-nightly-20150209") // Remove lwjgl2 - } - this.classpath(project.java17DependenciesCfg) - } - - public void setup(Project project) { - super.setup(project) - if (project.usesMixins.toBoolean()) { - this.extraJvmArgs.addAll(project.provider(() -> { - def mixinCfg = project.configurations.detachedConfiguration(project.dependencies.create(project.mixinProviderSpec)) - mixinCfg.canBeConsumed = false - mixinCfg.transitive = false - enableHotswap ? ["-javaagent:" + mixinCfg.singleFile.absolutePath] : [] - })) - } - } -} - -def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Distribution.CLIENT, "runClient") -runClient17Task.configure { - setup(project) - group = "Modded Minecraft" - description = "Runs the modded client using Java 17, lwjgl3ify and Hodgepodge" - dependsOn(setupHotswapAgentTask, mcpTasks.launcherSources.classesTaskName, minecraftTasks.taskDownloadVanillaAssets, mcpTasks.taskPackagePatchedMc, 'jar') - mainClass = "GradleStart" - username = minecraft.username - userUUID = minecraft.userUUID -} - -def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Distribution.DEDICATED_SERVER, "runServer") -runServer17Task.configure { - setup(project) - group = "Modded Minecraft" - description = "Runs the modded server using Java 17, lwjgl3ify and Hodgepodge" - dependsOn(setupHotswapAgentTask, mcpTasks.launcherSources.classesTaskName, minecraftTasks.taskDownloadVanillaAssets, mcpTasks.taskPackagePatchedMc, 'jar') - mainClass = "GradleStartServer" - extraArgs.add("nogui") -} - -def getManifestAttributes() { - def manifestAttributes = [:] - if (!containsMixinsAndOrCoreModOnly.toBoolean() && (usesMixins.toBoolean() || coreModClass)) { - manifestAttributes += ["FMLCorePluginContainsFMLMod": true] - } - - if (accessTransformersFile) { - manifestAttributes += ["FMLAT": accessTransformersFile.toString()] - } - - if (coreModClass) { - manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass] - } - - if (usesMixins.toBoolean()) { - manifestAttributes += [ - "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", - "MixinConfigs" : "mixins." + modId + ".json", - "ForceLoadAsMod": !containsMixinsAndOrCoreModOnly.toBoolean() - ] - } - return manifestAttributes -} - -tasks.named("jar", Jar).configure { - manifest { - attributes(getManifestAttributes()) - } -} - -if (usesShadowedDependencies.toBoolean()) { - tasks.named("shadowJar", ShadowJar).configure { - manifest { - attributes(getManifestAttributes()) - } - - if (minimizeShadowedDependencies.toBoolean()) { - minimize() // This will only allow shading for actually used classes - } - configurations = [ - project.configurations.shadowImplementation, - project.configurations.shadowCompile, - project.configurations.shadeCompile - ] - archiveClassifier.set('dev') - if (relocateShadowedDependencies.toBoolean()) { - relocationPrefix = modGroup + ".shadow" - enableRelocation = true - } - } - configurations.runtimeElements.outgoing.artifacts.clear() - configurations.apiElements.outgoing.artifacts.clear() - configurations.runtimeElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar)) - configurations.apiElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar)) - tasks.named("jar", Jar) { - archiveClassifier.set('dev-preshadow') - } - tasks.named("reobfJar", ReobfuscatedJar) { - inputJar.set(tasks.named("shadowJar", ShadowJar).flatMap({it.archiveFile})) - } - AdhocComponentWithVariants javaComponent = (AdhocComponentWithVariants) project.components.findByName("java") - javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements) { - skip() - } -} -ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar -ext.publishableObfJar = tasks.reobfJar - -tasks.register('apiJar', Jar) { - from(sourceSets.main.allSource) { - include modGroupPath + "/" + apiPackagePath + '/**' - } - - from(sourceSets.main.output) { - include modGroupPath + "/" + apiPackagePath + '/**' - } - - from(sourceSets.main.resources.srcDirs) { - include("LICENSE") - } - - getArchiveClassifier().set('api') -} - -artifacts { - if (!noPublishedSources) { - archives tasks.named("sourcesJar") - } - if (apiPackage) { - archives tasks.named("apiJar") - } -} - -idea { - module { - downloadJavadoc = true - downloadSources = true - inheritOutputDirs = true - } - project { - settings { - if (ideaOverrideBuildType != "") { - delegateActions { - if ("gradle".equalsIgnoreCase(ideaOverrideBuildType)) { - delegateBuildRunToGradle = true - testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.GRADLE - } else if ("idea".equalsIgnoreCase(ideaOverrideBuildType)) { - delegateBuildRunToGradle = false - testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.PLATFORM - } else { - throw GradleScriptException('Accepted value for ideaOverrideBuildType is one of gradle or idea.') - } - } - } - runConfigurations { - "0. Build and Test"(Gradle) { - taskNames = ["build"] - } - "1. Run Client"(Gradle) { - taskNames = ["runClient"] - } - "2. Run Server"(Gradle) { - taskNames = ["runServer"] - } - "1a. Run Client (Java 17)"(Gradle) { - taskNames = ["runClient17"] - } - "2a. Run Server (Java 17)"(Gradle) { - taskNames = ["runServer17"] - } - "1b. Run Client (Java 17, Hotswap)"(Gradle) { - taskNames = ["runClient17"] - envs = ["HOTSWAP": "true"] - } - "2b. Run Server (Java 17, Hotswap)"(Gradle) { - taskNames = ["runServer17"] - envs = ["HOTSWAP": "true"] - } - "3. Run Obfuscated Client"(Gradle) { - taskNames = ["runObfClient"] - } - "4. Run Obfuscated Server"(Gradle) { - taskNames = ["runObfServer"] - } - if (!disableSpotless) { - "5. Apply spotless"(Gradle) { - taskNames = ["spotlessApply"] - } - } - def coreModArgs = "" - if (coreModClass) { - coreModArgs = ' "-Dfml.coreMods.load=' + modGroup + '.' + coreModClass + '"' - } - "Run Client (IJ Native)"(Application) { - mainClass = "GradleStart" - moduleName = project.name + ".ideVirtualMain" - afterEvaluate { - workingDirectory = tasks.runClient.workingDir.absolutePath - programParameters = tasks.runClient.calculateArgs(project).collect { '"' + it + '"' }.join(' ') - jvmArgs = tasks.runClient.calculateJvmArgs(project).collect { '"' + it + '"' }.join(' ') + - ' ' + tasks.runClient.systemProperties.collect { '"-D' + it.key + '=' + it.value.toString() + '"' }.join(' ') + - coreModArgs - } - } - "Run Server (IJ Native)"(Application) { - mainClass = "GradleStartServer" - moduleName = project.name + ".ideVirtualMain" - afterEvaluate { - workingDirectory = tasks.runServer.workingDir.absolutePath - programParameters = tasks.runServer.calculateArgs(project).collect { '"' + it + '"' }.join(' ') - jvmArgs = tasks.runServer.calculateJvmArgs(project).collect { '"' + it + '"' }.join(' ') + - ' ' + tasks.runServer.systemProperties.collect { '"-D' + it.key + '=' + it.value.toString() + '"' }.join(' ') + - coreModArgs - } - } - } - compiler.javac { - afterEvaluate { - javacAdditionalOptions = "-encoding utf8" - moduleJavacAdditionalOptions = [ - (project.name + ".main"): tasks.compileJava.options.compilerArgs.collect { '"' + it + '"' }.join(' ') - ] - } - } - withIDEADir { File ideaDir -> - if (!ideaDir.path.contains(".idea")) { - // If an .ipr file exists, the project root directory is passed here instead of the .idea subdirectory - ideaDir = new File(ideaDir, ".idea") - } - if (ideaDir.isDirectory()) { - def miscFile = new File(ideaDir, "misc.xml") - if (miscFile.isFile()) { - boolean dirty = false - def miscTransformer = new XmlTransformer() - miscTransformer.addAction { root -> - Node rootNode = root.asNode() - def rootManager = rootNode - .component.find { it.@name == 'ProjectRootManager' } - if (!rootManager) { - rootManager = rootNode.appendNode('component', ['name': 'ProjectRootManager', 'version': '2']) - dirty = true - } - def output = rootManager.output - if (!output) { - output = rootManager.appendNode('output') - dirty = true - } - if (!output.@url) { - // Only modify the output url if it doesn't yet have one, or if the existing one is blank somehow. - // This is a sensible default for most setups - output.@url = 'file://$PROJECT_DIR$/build/ideaBuild' - dirty = true - } - } - def result = miscTransformer.transform(miscFile.text) - if (dirty) { - miscFile.write(result) - } - } else { - miscFile.text = """ - - - - - -""" - } - } - } - } - } -} - -tasks.named("processIdeaSettings").configure { - dependsOn("injectTags") -} - -tasks.named("ideVirtualMainClasses").configure { - // Make IntelliJ "Build project" build the mod jars - dependsOn("jar", "reobfJar") - if (!disableSpotless) { - dependsOn("spotlessCheck") - } -} - -// workaround variable hiding in pom processing -def projectConfigs = project.configurations - -publishing { - publications { - create("maven", MavenPublication) { - from components.java - - if (apiPackage) { - artifact apiJar - } - - groupId = System.getenv("ARTIFACT_GROUP_ID") ?: project.group - artifactId = System.getenv("ARTIFACT_ID") ?: project.name - // Using the identified version, not project.version as it has the prepended 1.7.10 - version = System.getenv("RELEASE_VERSION") ?: identifiedVersion - } - } - repositories { - if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) { - maven { - url = mavenPublishUrl - allowInsecureProtocol = mavenPublishUrl.startsWith("http://") - credentials { - username = System.getenv("MAVEN_USER") ?: "NONE" - password = System.getenv("MAVEN_PASSWORD") ?: "NONE" - } - } - } - } -} - -if (modrinthProjectId.size() != 0 && System.getenv("MODRINTH_TOKEN") != null) { - apply plugin: 'com.modrinth.minotaur' - - File changelogFile = new File(System.getenv("CHANGELOG_FILE") ?: "CHANGELOG.md") - - modrinth { - token = System.getenv("MODRINTH_TOKEN") - projectId = modrinthProjectId - versionNumber = identifiedVersion - versionType = identifiedVersion.endsWith("-pre") ? "beta" : "release" - changelog = changelogFile.exists() ? changelogFile.getText("UTF-8") : "" - uploadFile = publishableObfJar - additionalFiles = getSecondaryArtifacts() - gameVersions = [minecraftVersion] - loaders = ["forge"] - debugMode = false - } - - if (modrinthRelations.size() != 0) { - String[] deps = modrinthRelations.split(";") - deps.each { dep -> - if (dep.size() == 0) { - return - } - String[] parts = dep.split(":") - String[] qual = parts[0].split("-") - addModrinthDep(qual[0], qual[1], parts[1]) - } - } - if (usesMixins.toBoolean()) { - addModrinthDep("required", "project", "unimixins") - } - tasks.modrinth.dependsOn(build) - tasks.publish.dependsOn(tasks.modrinth) -} - -if (curseForgeProjectId.size() != 0 && System.getenv("CURSEFORGE_TOKEN") != null) { - apply plugin: 'com.matthewprenger.cursegradle' - - File changelogFile = new File(System.getenv("CHANGELOG_FILE") ?: "CHANGELOG.md") - - curseforge { - apiKey = System.getenv("CURSEFORGE_TOKEN") - project { - id = curseForgeProjectId - if (changelogFile.exists()) { - changelogType = "markdown" - changelog = changelogFile - } - releaseType = identifiedVersion.endsWith("-pre") ? "beta" : "release" - addGameVersion minecraftVersion - addGameVersion "Forge" - mainArtifact publishableObfJar - for (artifact in getSecondaryArtifacts()) addArtifact artifact - } - - options { - javaIntegration = false - forgeGradleIntegration = false - debug = false - } - } - - if (curseForgeRelations.size() != 0) { - String[] deps = curseForgeRelations.split(";") - deps.each { dep -> - if (dep.size() == 0) { - return - } - String[] parts = dep.split(":") - addCurseForgeRelation(parts[0], parts[1]) - } - } - if (usesMixins.toBoolean()) { - addCurseForgeRelation("requiredDependency", "unimixins") - } - tasks.curseforge.dependsOn(build) - tasks.publish.dependsOn(tasks.curseforge) -} - -def addModrinthDep(String scope, String type, String name) { - com.modrinth.minotaur.dependencies.Dependency dep; - if (!(scope in ["required", "optional", "incompatible", "embedded"])) { - throw new Exception("Invalid modrinth dependency scope: " + scope) - } - switch (type) { - case "project": - dep = new ModDependency(name, scope) - break - case "version": - dep = new VersionDependency(name, scope) - break - default: - throw new Exception("Invalid modrinth dependency type: " + type) - } - project.modrinth.dependencies.add(dep) -} - -def addCurseForgeRelation(String type, String name) { - if (!(type in ["requiredDependency", "embeddedLibrary", "optionalDependency", "tool", "incompatible"])) { - throw new Exception("Invalid CurseForge relation type: " + type) - } - CurseArtifact artifact = project.curseforge.curseProjects[0].mainArtifact - CurseRelation rel = (artifact.curseRelations ?: (artifact.curseRelations = new CurseRelation())) - rel."$type"(name) -} - -// Updating - -def buildscriptGradleVersion = "8.5" - -tasks.named('wrapper', Wrapper).configure { - gradleVersion = buildscriptGradleVersion -} - -tasks.register('updateBuildScript') { - group = 'GTNH Buildscript' - description = 'Updates the build script to the latest version' - - if (gradle.gradleVersion != buildscriptGradleVersion && !Boolean.getBoolean('DISABLE_BUILDSCRIPT_GRADLE_UPDATE')) { - dependsOn('wrapper') - } - - doLast { - if (performBuildScriptUpdate()) return - - print("Build script already up-to-date!") - } -} - -if (!project.getGradle().startParameter.isOffline() && !Boolean.getBoolean('DISABLE_BUILDSCRIPT_UPDATE_CHECK') && isNewBuildScriptVersionAvailable()) { - if (autoUpdateBuildScript.toBoolean()) { - performBuildScriptUpdate() - } else { - out.style(Style.SuccessHeader).println("Build script update available! Run 'gradle updateBuildScript'") - if (gradle.gradleVersion != buildscriptGradleVersion) { - out.style(Style.SuccessHeader).println("updateBuildScript can update gradle from ${gradle.gradleVersion} to ${buildscriptGradleVersion}\n") - } - } -} - -// If you want to add more cases to this task, implement them as arguments if total amount to print gets too large -tasks.register('faq') { - group = 'GTNH Buildscript' - description = 'Prints frequently asked questions about building a project' - - doLast { - print("If your build fails to fetch dependencies, run './gradlew updateDependencies'. " + - "Or you can manually check if the versions are still on the distributing sites - " + - "the links can be found in repositories.gradle and build.gradle:repositories, " + - "but not build.gradle:buildscript.repositories - those ones are for gradle plugin metadata.\n\n" + - "If your build fails to recognize the syntax of new Java versions, enable Jabel in your " + - "gradle.properties. See how it's done in GTNH ExampleMod/gradle.properties. " + - "However, keep in mind that Jabel enables only syntax features, but not APIs that were introduced in " + - "Java 9 or later.") - } -} - -static URL availableBuildScriptUrl() { - new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/build.gradle") -} - -static URL exampleSettingsGradleUrl() { - new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/settings.gradle.example") -} - -static URL exampleGitAttributesUrl() { - new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/.gitattributes") -} - - -boolean verifyGitAttributes() { - def gitattributesFile = getFile(".gitattributes") - if (!gitattributesFile.exists()) { - println("Downloading default .gitattributes") - exampleGitAttributesUrl().withInputStream { i -> gitattributesFile.withOutputStream { it << i } } - exec { - workingDir '.' - commandLine 'git', 'add', '--renormalize', '.' - } - return true - } - return false -} - -boolean verifySettingsGradle() { - def settingsFile = getFile("settings.gradle") - if (!settingsFile.exists()) { - println("Downloading default settings.gradle") - exampleSettingsGradleUrl().withInputStream { i -> settingsFile.withOutputStream { it << i } } - return true - } - return false -} - -boolean performBuildScriptUpdate() { - if (isNewBuildScriptVersionAvailable()) { - def buildscriptFile = getFile("build.gradle") - availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } } - def out = services.get(StyledTextOutputFactory).create('buildscript-update-output') - out.style(Style.Success).print("Build script updated. Please REIMPORT the project or RESTART your IDE!") - boolean settingsupdated = verifySettingsGradle() - settingsupdated = verifyGitAttributes() || settingsupdated - if (settingsupdated) - throw new GradleException("Settings has been updated, please re-run task.") - return true - } - return false -} - -boolean isNewBuildScriptVersionAvailable() { - Map parameters = ["connectTimeout": 2000, "readTimeout": 2000] - - String currentBuildScript = getFile("build.gradle").getText() - String currentBuildScriptHash = getVersionHash(currentBuildScript) - String availableBuildScriptHash - try { - String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText() - availableBuildScriptHash = getVersionHash(availableBuildScript) - } catch (IOException e) { - logger.warn("Could not check for buildscript update availability: {}", e.message) - return false - } - - boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash - return !isUpToDate -} - -static String getVersionHash(String buildScriptContent) { - String versionLine = buildScriptContent.find("^//version: [a-z0-9]*") - if (versionLine != null) { - return versionLine.split(": ").last() - } - return "" -} - -// Parameter Deobfuscation - -tasks.register('deobfParams') { - group = 'GTNH Buildscript' - description = 'Rename all obfuscated parameter names inherited from Minecraft classes' - doLast { // TODO - - String mcpDir = "$project.gradle.gradleUserHomeDir/caches/minecraft/de/oceanlabs/mcp/mcp_$channel/$mappingsVersion" - String mcpZIP = "$mcpDir/mcp_$channel-$mappingsVersion-${minecraftVersion}.zip" - String paramsCSV = "$mcpDir/params.csv" - - download.run { - src "https://maven.minecraftforge.net/de/oceanlabs/mcp/mcp_$channel/$mappingsVersion-$minecraftVersion/mcp_$channel-$mappingsVersion-${minecraftVersion}.zip" - dest mcpZIP - overwrite false - } - - if (!file(paramsCSV).exists()) { - println("Extracting MCP archive ...") - copy { - from(zipTree(mcpZIP)) - into(mcpDir) - } - } - - println("Parsing params.csv ...") - Map params = new HashMap<>() - Files.lines(Paths.get(paramsCSV)).forEach { line -> - String[] cells = line.split(",") - if (cells.length > 2 && cells[0].matches("p_i?\\d+_\\d+_")) { - params.put(cells[0], cells[1]) - } - } - - out.style(Style.Success).println("Modified ${replaceParams(file("$projectDir/src/main/java"), params)} files!") - out.style(Style.Failure).println("Don't forget to verify that the code still works as before!\n It could be broken due to duplicate variables existing now\n or parameters taking priority over other variables.") - } -} - -static int replaceParams(File file, Map params) { - int fileCount = 0 - - if (file.isDirectory()) { - for (File f : file.listFiles()) { - fileCount += replaceParams(f, params) - } - return fileCount - } - println("Visiting ${file.getName()} ...") - try { - String content = new String(Files.readAllBytes(file.toPath())) - int hash = content.hashCode() - params.forEach { key, value -> - content = content.replaceAll(key, value) - } - if (hash != content.hashCode()) { - Files.write(file.toPath(), content.getBytes("UTF-8")) - return 1 - } - } catch (Exception e) { - e.printStackTrace() - } - return 0 -} - -// Dependency Deobfuscation (Deprecated, use the new RFG API documented in dependencies.gradle) - -def deobf(String sourceURL) { - try { - URL url = new URL(sourceURL) - String fileName = url.getFile() - - //get rid of directories: - int lastSlash = fileName.lastIndexOf("/") - if (lastSlash > 0) { - fileName = fileName.substring(lastSlash + 1) - } - //get rid of extension: - if (fileName.endsWith(".jar") || fileName.endsWith(".litemod")) { - fileName = fileName.substring(0, fileName.lastIndexOf(".")) - } - - String hostName = url.getHost() - if (hostName.startsWith("www.")) { - hostName = hostName.substring(4) - } - List parts = Arrays.asList(hostName.split("\\.")) - Collections.reverse(parts) - hostName = String.join(".", parts) - - return deobf(sourceURL, "$hostName/$fileName") - } catch (Exception ignored) { - return deobf(sourceURL, "deobf/${sourceURL.hashCode()}") - } -} - -def deobfMaven(String repoURL, String mavenDep) { - if (!repoURL.endsWith("/")) { - repoURL += "/" - } - String[] parts = mavenDep.split(":") - parts[0] = parts[0].replace('.', '/') - def jarURL = repoURL + parts[0] + "/" + parts[1] + "/" + parts[2] + "/" + parts[1] + "-" + parts[2] + ".jar" - return deobf(jarURL) -} - -def deobfCurse(String curseDep) { - return dependencies.rfg.deobf("curse.maven:$curseDep") -} - -// The method above is to be preferred. Use this method if the filename is not at the end of the URL. -def deobf(String sourceURL, String rawFileName) { - String bon2Version = "2.5.1" - String fileName = URLDecoder.decode(rawFileName, "UTF-8") - String cacheDir = "$project.gradle.gradleUserHomeDir/caches" - String obfFile = "$cacheDir/modules-2/files-2.1/${fileName}.jar" - - download.run { - src sourceURL - dest obfFile - quiet true - overwrite false - } - return dependencies.rfg.deobf(files(obfFile)) -} -// Helper methods - -def checkPropertyExists(String propertyName) { - if (!project.hasProperty(propertyName)) { - throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/gradle.properties") - } -} - -def propertyDefaultIfUnset(String propertyName, defaultValue) { - if (!project.hasProperty(propertyName) || project.property(propertyName) == "") { - project.ext.setProperty(propertyName, defaultValue) - } -} - -def getFile(String relativePath) { - return new File(projectDir, relativePath) -} - -def getSecondaryArtifacts() { - // Because noPublishedSources from the beginning of the script is somehow not visible here... - boolean noPublishedSources = project.hasProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false - def secondaryArtifacts = [publishableDevJar] - if (!noPublishedSources) secondaryArtifacts += [sourcesJar] - if (apiPackage) secondaryArtifacts += [apiJar] - return secondaryArtifacts -} - -def getURL(String main, String fallback) { - return pingURL(main, 10000) ? main : fallback -} - -// credit: https://stackoverflow.com/a/3584332 -def pingURL(String url, int timeout) { - url = url.replaceFirst("^https", "http") // Otherwise an exception may be thrown on invalid SSL certificates. - try { - HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection() - connection.setConnectTimeout(timeout) - connection.setReadTimeout(timeout) - connection.setRequestMethod("HEAD") - int responseCode = connection.getResponseCode() - return 200 <= responseCode && responseCode <= 399 - } catch (IOException ignored) { - return false - } -} - -// For easier scripting of things that require variables defined earlier in the buildscript -if (file('addon.late.gradle.kts').exists()) { - apply from: 'addon.late.gradle.kts' -} else if (file('addon.late.gradle').exists()) { - apply from: 'addon.late.gradle' -} - -// File for local tweaks not commited to Git -if (file('addon.late.local.gradle.kts').exists()) { - apply from: 'addon.late.local.gradle.kts' -} else if (file('addon.late.local.gradle').exists()) { - apply from: 'addon.late.local.gradle' + id 'com.gtnewhorizons.gtnhconvention' } diff --git a/gradle.properties b/gradle.properties index dbd43421de..b856d83dff 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,77 +1,101 @@ +# ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable. +# LOCAL to test local config updates. +gtnh.settings.blowdryerTag = 0.2.0 + +# Human-readable mod name, available for mcmod.info population. modName = BartWorks -# This is a case-sensitive string to identify your mod. Convention is to use lower case. +# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation. +# Conventionally lowercase. modId = bartworks +# Root package of the mod, used to find various classes in other properties, +# mcmod.info substitution, enabling assertions in run tasks, etc. modGroup = com.github.bartimaeusnek.bartworks -# 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/ +# Whether to use modGroup as the maven publishing group. +# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods. +useModGroupForPublishing = false -# Will update your build.gradle automatically whenever an update is available +# Updates your build.gradle and settings.gradle automatically whenever an update is available. autoUpdateBuildScript = false +# Version of Minecraft to target minecraftVersion = 1.7.10 + +# Version of Minecraft Forge to target forgeVersion = 10.13.4.1614 -# Specify a MCP channel and mappings version for dependency deobfuscation and the deobfParams task. +# Specify an MCP channel for dependency deobfuscation and the deobfParams task. channel = stable + +# Specify an MCP mappings version for dependency deobfuscation and the deobfParams task. mappingsVersion = 12 -# Define other MCP mappings for dependency deobfuscation +# Defines other MCP mappings for dependency deobfuscation. remoteMappings = https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/ -# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you -# restart Minecraft in development. Choose this dependent on your mod: -# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name -# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty +# Select a default username for testing your mod. You can always override this per-run by running +# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE. developmentEnvironmentUserName = Developer -# Enables using modern java syntax (up to version 17) via Jabel, while still targeting JVM 8. +# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8. # See https://github.com/bsideup/jabel for details on how this works. enableModernJavaSyntax = true -# Enables injecting missing generics into the decompiled source code for a better coding experience -# Turns most publicly visible List, Map, etc. into proper List, Map types +# Enables injecting missing generics into the decompiled source code for a better coding experience. +# Turns most publicly visible List, Map, etc. into proper List, Map types. enableGenericInjection = true -# Generate a class with String fields for the mod id, name, version and group name named with the fields below +# Generate a class with a String field for the mod version named as defined below. +# If generateGradleTokenClass is empty or not missing, no such class will be generated. +# If gradleTokenVersion is empty or missing, the field will not be present in the class. generateGradleTokenClass = com.github.bartimaeusnek.bartworks.API.API_REFERENCE + +# Name of the token containing the project's current version to generate/replace. +gradleTokenVersion = VERSION + +# [DEPRECATED] Mod ID replacement token. gradleTokenModId = + +# [DEPRECATED] Mod name replacement token. gradleTokenModName = -gradleTokenVersion = VERSION -gradleTokenGroupName = + # [DEPRECATED] -# Multiple source files can be defined here by providing a comma-seperated list: Class1.java,Class2.java,Class3.java +# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java # public static final String VERSION = "GRADLETOKEN_VERSION"; # The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's -# version in @Mod([...], version = VERSION, [...]) -# Leave these properties empty to skip individual token replacements +# version in @Mod([...], version = VERSION, [...]). +# Leave these properties empty to skip individual token replacements. replaceGradleTokenInFile = # In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can # leave this property empty. -# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api +# Example value: (apiPackage = api) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.api apiPackage = # Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/ -# There can be multiple files in a comma-separated list. -# Example value: mymodid_at.cfg,nei_at.cfg +# There can be multiple files in a space-separated list. +# Example value: mymodid_at.cfg nei_at.cfg accessTransformersFile = # Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! usesMixins = false -# Adds some debug arguments like verbose output and export + +# Adds some debug arguments like verbose output and class export. usesMixinDebug = false + # Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise. mixinPlugin = + # Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! mixinsPackage = + # Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! # This parameter is for legacy compatibility only -# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin +# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin coreModClass = ASM.BWCorePlugin + # 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 @@ -79,28 +103,32 @@ containsMixinsAndOrCoreModOnly = false # Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins. forceEnableMixins = true -# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your -# responsibility check the licence and request permission for distribution, if required. +# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your +# responsibility to check the license and request permission for distribution if required. usesShadowedDependencies = false -# If disabled, won't remove unused classes from shaded dependencies. Some libraries use reflection to access + +# If disabled, won't remove unused classes from shadowed dependencies. Some libraries use reflection to access # their own classes, making the minimization unreliable. minimizeShadowedDependencies = true + # If disabled, won't rename the shadowed classes. relocateShadowedDependencies = true -# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories +# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories. includeWellKnownRepositories = true # Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven. -# Authenticate with the MAVEN_USERNAME and MAVEN_PASSWORD environment variables. +# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables. # If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle. usesMavenPublishing = true -# mavenPublishUrl = http://jenkins.usrv.eu:8081/nexus/content/repositories/releases -# Publishing to modrinth requires you to set the MODRINTH_TOKEN environment variable to your current modrinth API token. +# Maven repository to publish the mod to. +# mavenPublishUrl = https://nexus.gtnewhorizons.com/repository/releases/ +# Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token. +# # The project's ID on Modrinth. Can be either the slug or the ID. -# Leave this empty if you don't want to publish on Modrinth. +# Leave this empty if you don't want to publish to Modrinth. modrinthProjectId = # The project's relations on Modrinth. You can use this to refer to other projects on Modrinth. @@ -112,9 +140,8 @@ modrinthProjectId = # Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true modrinthRelations = - # Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens. - +# # The project's numeric ID on CurseForge. You can find this in the About Project box. # Leave this empty if you don't want to publish on CurseForge. curseForgeProjectId = @@ -124,26 +151,41 @@ curseForgeProjectId = # Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible], # and the name is the CurseForge project slug of the other mod. # Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft -# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true +# Note: UniMixins is automatically set as a required dependency if usesMixins = true. curseForgeRelations = - -# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older +# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older # projects. New projects should not use this parameter. # customArchiveBaseName = -# Optional parameter to prevent the source code from being published -# noPublishedSources = +# Optional parameter to have the build automatically fail if an illegal version is used. +# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'. +# The check is ONLY performed if the version is a git tag. +# Note: the specified string must be escaped, so e.g. 1\\.1\\.\\d+ instead of 1\.1\.\d+ +# versionPattern = + +# Uncomment to prevent the source code from being published. +# noPublishedSources = true -# Uncomment this to disable spotless checks +# Uncomment this to disable Spotless checks. # This should only be uncommented to keep it easier to sync with upstream/other forks. # That is, if there is no other active fork/upstream, NEVER change this. # disableSpotless = true -# Override the IDEA build type. Valid value is "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle" +# Uncomment this to disable Checkstyle checks (currently wildcard import check). +# disableCheckstyle = true + +# Override the IDEA build type. Valid values are: "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle" # (force use delegated build). # This is meant to be set in $HOME/.gradle/gradle.properties. -# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be always native build. +# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be native build. # WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want! # Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you. # ideaOverrideBuildType = idea + +# Whether IDEA should run spotless checks when pressing the Build button. +# This is meant to be set in $HOME/.gradle/gradle.properties. +# ideaCheckSpotlessOnBuild = true + +# Non-GTNH properties +gradleTokenGroupName = diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e0930b..a80b22ce5c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew.bat b/gradlew.bat index 93e3f59f13..25da30dbde 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/settings.gradle b/settings.gradle index 8a66026e3d..e8946ada27 100644 --- a/settings.gradle +++ b/settings.gradle @@ -6,6 +6,7 @@ pluginManagement { name "GTNH Maven" url "https://nexus.gtnewhorizons.com/repository/public/" mavenContent { + includeGroup("com.gtnewhorizons") includeGroupByRegex("com\\.gtnewhorizons\\..+") } } @@ -16,12 +17,7 @@ pluginManagement { } plugins { - id 'com.diffplug.blowdryerSetup' version '1.7.1' - id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' // Provides java toolchains + id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.8' } -blowdryerSetup { - repoSubfolder 'gtnhShared' - github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0') - //devLocal '.' // Use this when testing config updates locally -} + -- cgit From 8ada1c34978d9ef2807ce8b994e2b536f6aec133 Mon Sep 17 00:00:00 2001 From: Sampsa <69092953+S4mpsa@users.noreply.github.com> Date: Sat, 10 Feb 2024 10:16:40 +0200 Subject: Add EIC recipes for a few Singularities & Infinity Catalyst (#389) * Add EIC recipes for Iron Singularity, Fluxed Electrum Singulatiry & Infinity Catalyst * Update dependancy? * Update dependencies.gradle * Update dependencies.gradle * Update dependencies.gradle using us tag so long the other one not working * Update dependencies.gradle --------- Co-authored-by: Martin Robertz Former-commit-id: 2bd4adf2020a326af5e137250b48ff943318b0d2 --- dependencies.gradle | 2 +- .../ElectricImplosionCompressorRecipes.java | 38 ++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 840c1661f5..17c9601fee 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -9,6 +9,6 @@ dependencies { api("com.github.GTNewHorizons:Avaritia:1.49:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.11-GTNH:dev") - compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.24:deobf") {transitive = false} + compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.27:dev") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.6-GTNH:api") {transitive = false} } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java index 500dfb6faf..d3da5e1373 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java @@ -1,6 +1,7 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.enums.Mods.Avaritia; import static gregtech.api.enums.Mods.EternalSingularity; import static gregtech.api.enums.Mods.GoodGenerator; import static gregtech.api.enums.Mods.OpenComputers; @@ -122,6 +123,43 @@ public class ElectricImplosionCompressorRecipes implements Runnable { 20 * 4, (int) TierEU.RECIPE_UXV); + // Infinity Catalyst + addElectricImplosionRecipe( + // IN. + new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.InfinityCatalyst, 64L), }, + new FluidStack[] { GT_Values.NF }, + // OUT. + new ItemStack[] { getModItem(Avaritia.ID, "Resource", 1L, 5) }, + new FluidStack[] { GT_Values.NF }, + // Recipe stats. + 1 * 1, + (int) TierEU.RECIPE_UIV); + + if (UniversalSingularities.isModLoaded()) { + // Fluxed Singularity + addElectricImplosionRecipe( + // IN. + new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.block, Materials.ElectrumFlux, 16L), }, + new FluidStack[] { GT_Values.NF }, + // OUT. + new ItemStack[] { getModItem(UniversalSingularities.ID, "universal.general.singularity", 1L, 20) }, + new FluidStack[] { GT_Values.NF }, + // Recipe stats. + 1 * 1, + (int) TierEU.RECIPE_UIV); + + // Iron Singularity + addElectricImplosionRecipe( + // IN. + new ItemStack[] { GT_Values.NI }, + new FluidStack[] { Materials.Iron.getMolten(7296 * 9 * 144L) }, + // OUT. + new ItemStack[] { getModItem(Avaritia.ID, "Singularity", 1L, 0) }, + new FluidStack[] { GT_Values.NF }, + // Recipe stats. + 1 * 1, + (int) TierEU.RECIPE_UIV); + } // MHDCSM V2 addElectricImplosionRecipe( // IN. -- cgit From cb2231150f712d919aaf5c931fdd4f6dc12e7e0a Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 10 Feb 2024 09:17:07 +0100 Subject: update Former-commit-id: 8dcdeaf0555fd64132079ebb9aae0c4f2166700a --- dependencies.gradle | 4 ++-- gradle.properties | 9 +++++---- settings.gradle | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 17c9601fee..1c59225a7b 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,8 +1,8 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.58:dev') - api("com.github.GTNewHorizons:TecTech:5.3.30:dev") + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.62:dev') + api("com.github.GTNewHorizons:TecTech:5.3.31:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } diff --git a/gradle.properties b/gradle.properties index b856d83dff..9a8fc78abc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -33,7 +33,7 @@ channel = stable mappingsVersion = 12 # Defines other MCP mappings for dependency deobfuscation. -remoteMappings = https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/ +remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/ # Select a default username for testing your mod. You can always override this per-run by running # `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE. @@ -61,6 +61,9 @@ gradleTokenModId = # [DEPRECATED] Mod name replacement token. gradleTokenModName = +# [DEPRECATED] Mod Group replacement token. +gradleTokenGroupName = + # [DEPRECATED] # Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java # public static final String VERSION = "GRADLETOKEN_VERSION"; @@ -123,7 +126,7 @@ includeWellKnownRepositories = true usesMavenPublishing = true # Maven repository to publish the mod to. -# mavenPublishUrl = https://nexus.gtnewhorizons.com/repository/releases/ +# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/ # Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token. # @@ -187,5 +190,3 @@ curseForgeRelations = # This is meant to be set in $HOME/.gradle/gradle.properties. # ideaCheckSpotlessOnBuild = true -# Non-GTNH properties -gradleTokenGroupName = diff --git a/settings.gradle b/settings.gradle index e8946ada27..b9c57a0275 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ pluginManagement { } plugins { - id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.8' + id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.12' } -- cgit From b4d892228cb91584fd0c8db6c9737e39cbe3a2d2 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 10 Feb 2024 10:00:24 +0100 Subject: set back TGregworks to original repo (#390) Former-commit-id: adc2079b633fcdb377c8d7317878a5626e514d4b --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 1c59225a7b..4f68aa8607 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -9,6 +9,6 @@ dependencies { api("com.github.GTNewHorizons:Avaritia:1.49:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.11-GTNH:dev") - compileOnly("com.github.GTNewHorizons:TinkersGregworks:GTNH-1.0.27:dev") {transitive = false} + compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.25:deobf") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.6-GTNH:api") {transitive = false} } -- cgit From 9c31befff492d33714bc43f5499f18f503ceba45 Mon Sep 17 00:00:00 2001 From: GDCloud <93287602+GDCloudstrike@users.noreply.github.com> Date: Sat, 10 Feb 2024 18:14:44 +0100 Subject: fix OC behaviour (#391) Former-commit-id: ada48df6ee07c5d1216b9a4f934fc351c818ae4a --- .../GT_TileEntity_ElectricImplosionCompressor.java | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 25b11ea75d..9a424b1cde 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -24,6 +24,8 @@ import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import java.util.ArrayList; import java.util.List; +import javax.annotation.Nonnull; + import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; @@ -68,6 +70,8 @@ import gregtech.api.logic.ProcessingLogic; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_ExtendedPowerMultiBlockBase; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.recipe.RecipeMap; +import gregtech.api.recipe.check.CheckRecipeResult; +import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OverclockCalculator; @@ -265,6 +269,17 @@ public class GT_TileEntity_ElectricImplosionCompressor protected ProcessingLogic createProcessingLogic() { return new ProcessingLogic() { + @NotNull + @Override + protected CheckRecipeResult validateRecipe(@Nonnull GT_Recipe recipe) { + long voltage = GT_TileEntity_ElectricImplosionCompressor.this.getAverageInputVoltage(); + // Only allow a minimum of T-1 energy hatch + if (recipe.mEUt > voltage * 4) { + return CheckRecipeResultRegistry.insufficientPower(recipe.mEUt); + } + return CheckRecipeResultRegistry.SUCCESSFUL; + } + @NotNull @Override protected GT_OverclockCalculator createOverclockCalculator(@NotNull GT_Recipe recipe) { @@ -275,15 +290,6 @@ public class GT_TileEntity_ElectricImplosionCompressor }.setMaxParallelSupplier(() -> (int) Math.pow(4, Math.max(this.mBlockTier - 1, 0))); } - @Override - protected void setProcessingLogicPower(ProcessingLogic logic) { - long amperage = this.getMaxInputAmps(); - long voltage = this.getAverageInputVoltage(); - // We allow one OC, if there is enough amperage, no matter which type of hatch is used - logic.setAvailableVoltage(amperage >= 4 ? voltage * 4 : voltage); - logic.setAvailableAmperage(amperage >= 4 ? amperage / 4 : amperage); - } - private void updateChunkCoordinates() { this.chunkCoordinates.clear(); -- cgit From 95b8afa765eef15b2e652f6081863b1e107a50e9 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Wed, 14 Feb 2024 01:53:15 +0100 Subject: update Former-commit-id: 56fb3b1a93921840c16f65c383d75eb449209071 --- dependencies.gradle | 2 +- settings.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 4f68aa8607..c72c9e30a2 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.62:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.64:dev') api("com.github.GTNewHorizons:TecTech:5.3.31:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" diff --git a/settings.gradle b/settings.gradle index b9c57a0275..16a5b4ca7d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ pluginManagement { } plugins { - id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.12' + id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.14' } -- cgit From 01161dd972c5dc83831342e8fcdffd2c78895915 Mon Sep 17 00:00:00 2001 From: Батьків Нестор-Євген Васильович Date: Tue, 20 Feb 2024 08:47:10 +0200 Subject: CAL CA mode recipe tier nerf (#392) * Do the thing * spotlessApply (#393) Co-authored-by: GitHub GTNH Actions <> * improve tooltip --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: chochem <40274384+chochem@users.noreply.github.com> Former-commit-id: 637fa78a4d2de7457c7f0ce41657dbb78a47eab0 --- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 68d7f48e12..199710cbeb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -79,10 +79,12 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.RecipeMaps; import gregtech.api.recipe.check.CheckRecipeResult; +import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.recipe.check.SimpleCheckRecipeResult; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; @@ -168,8 +170,9 @@ public class GT_TileEntity_CircuitAssemblyLine extends "Does Circuit Assembler recipes, Minimum Length: " + EnumChatFormatting.RED + MINIMUM_CIRCUIT_ASSEMBLER_LENGTH + EnumChatFormatting.GRAY) + .addInfo("Recipe tier in Circuit Assembler mode is at most Energy Hatch tier - 1.") .addInfo("This mode supports Crafting Input Buffer/Bus and allows bus separation").addInfo("") - .addInfo(BW_Tooltip_Reference.TT_BLUEPRINT).addSeparator() + .addSeparator().addInfo(BW_Tooltip_Reference.TT_BLUEPRINT) .beginVariableStructureBlock(2, 7, 3, 3, 3, 3, false) .addStructureInfo("From Bottom to Top, Left to Right") .addStructureInfo( @@ -283,7 +286,19 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().enablePerfectOverclock(); + return new ProcessingLogic() { + + @Override + @Nonnull + protected CheckRecipeResult validateRecipe(@Nonnull GT_Recipe recipe) { + // limit CA mode recipes to hatch tier - 1 + if (GT_TileEntity_CircuitAssemblyLine.this.mode == 1 + && recipe.mEUt > GT_TileEntity_CircuitAssemblyLine.this.getMaxInputVoltage() / 4) { + return CheckRecipeResultRegistry.NO_RECIPE; + } + return CheckRecipeResultRegistry.SUCCESSFUL; + } + }.enablePerfectOverclock(); } @NotNull -- cgit From 9c5dce41b06bc840ac46d250d806b3025acb44d2 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Tue, 20 Feb 2024 07:49:31 +0100 Subject: update Former-commit-id: 85c609be4ba51c0994024e034155c6a1558bdb17 --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index c72c9e30a2..2e56204b14 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.64:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.71:dev') api("com.github.GTNewHorizons:TecTech:5.3.31:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" -- cgit From cbaf6ffd6082ce33e1279f29473164f58c7921fd Mon Sep 17 00:00:00 2001 From: HoleFish <48403212+HoleFish@users.noreply.github.com> Date: Thu, 29 Feb 2024 02:54:54 +0800 Subject: Fix Bio Vat internal error & scanner info (#394) * fix * add comments Former-commit-id: dca4780ded78419d4c742b320f3efbd8efebc96c --- .../common/tileentities/multis/GT_TileEntity_BioVat.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 9778d5b63d..fa2f7e9590 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -260,14 +260,26 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa @NotNull @Override protected GT_ParallelHelper createParallelHelper(@NotNull GT_Recipe recipe) { - return super.createParallelHelper(recipeWithMultiplier(recipe)); + return super.createParallelHelper(recipeWithMultiplier(recipe, inputFluids)); } }; } - protected GT_Recipe recipeWithMultiplier(GT_Recipe recipe) { + protected GT_Recipe recipeWithMultiplier(GT_Recipe recipe, FluidStack[] fluidInputs) { GT_Recipe tRecipe = recipe.copy(); int multiplier = getExpectedMultiplier(recipe.getFluidOutput(0), true); + mExpectedMultiplier = multiplier; + // Calculate max multiplier limited by input fluids + long fluidAmount = 0; + for (FluidStack fluid : fluidInputs) { + if (recipe.mFluidInputs[0].isFluidEqual(fluid)) { + fluidAmount += fluid.amount; + } + } + multiplier = (int) Math.min(multiplier, fluidAmount / recipe.mFluidInputs[0].amount); + // In case multiplier is 0 + multiplier = Math.max(multiplier, 1); + mTimes = multiplier; tRecipe.mFluidInputs[0].amount *= multiplier; tRecipe.mFluidOutputs[0].amount *= multiplier; return tRecipe; -- cgit From d30f0821008305926e76f97715368c3042bc1c11 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Wed, 28 Feb 2024 19:55:25 +0100 Subject: update Former-commit-id: 083c770cc44b7919f00e95f6c5909bdc0b5adfe3 --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 2e56204b14..28f3d6b351 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.71:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.79:dev') api("com.github.GTNewHorizons:TecTech:5.3.31:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" -- cgit From b22e8f0900445bd515df50401bf9ed02740838e4 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Fri, 1 Mar 2024 07:37:22 +0100 Subject: update Former-commit-id: 6a8f8f6643a36e5ed5a01854f5a3a92c68731512 --- dependencies.gradle | 2 +- settings.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 28f3d6b351..12073b7fe4 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,7 +2,7 @@ dependencies { api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.79:dev') - api("com.github.GTNewHorizons:TecTech:5.3.31:dev") + api("com.github.GTNewHorizons:TecTech:5.3.32:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } diff --git a/settings.gradle b/settings.gradle index 16a5b4ca7d..37468c7ad1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ pluginManagement { } plugins { - id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.14' + id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.15' } -- cgit From 73c6cebf351d6ef5d7a299a5571365fc86bb5cd4 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Sun, 3 Mar 2024 18:15:56 +0800 Subject: fix mega DT (#396) * fix mega dt structure * fix copypaste error * fix copypaste error again Former-commit-id: 0aa8a95b61676ede1433ce359aecf00c2aec1e45 --- .../tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 6ae286900d..478b27cbf1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -290,12 +290,17 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock if (!this.checkPiece(STRUCTURE_PIECE_BASE, 7, 0, 0)) return false; // check each layer - while (this.mHeight < 12 && this.checkPiece(STRUCTURE_PIECE_LAYER, 7, this.mHeight * 5, 0) - && !this.mTopLayerFound) { + while (this.mHeight < 12) { + if (!checkPiece(STRUCTURE_PIECE_LAYER, 7, mHeight * 5, 0)) { + return false; + } if (this.mOutputHatchesByLayer.size() < this.mHeight || this.mOutputHatchesByLayer.get(this.mHeight - 1).isEmpty()) // layer without output hatch return false; + if (mTopLayerFound) { + break; + } this.mTopState = -1; // not top this.mHeight++; -- cgit From 72ae47ebf8cb3e8ac64e383aec6d7c1d6f5f348c Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sun, 3 Mar 2024 11:50:58 +0100 Subject: update Former-commit-id: cec96a35478122f0404d7f4077757ced0d8abc40 --- dependencies.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 12073b7fe4..8f5a9f0c98 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.79:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.86:dev') api("com.github.GTNewHorizons:TecTech:5.3.32:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" @@ -10,5 +10,5 @@ dependencies { implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.11-GTNH:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.25:deobf") {transitive = false} - compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.6-GTNH:api") {transitive = false} + compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.7-GTNH:api") {transitive = false} } -- cgit From 4ed426e1cb3c63b4d0fa5387da78cd7618b9ee50 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Fri, 8 Mar 2024 20:34:55 +0100 Subject: update --- dependencies.gradle | 2 +- settings.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 8f5a9f0c98..f191495385 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.86:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.92:dev') api("com.github.GTNewHorizons:TecTech:5.3.32:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" diff --git a/settings.gradle b/settings.gradle index 37468c7ad1..b11efb014f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ pluginManagement { } plugins { - id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.15' + id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.16' } -- cgit From 50dfbb44acdd28bc183dc58b9cd40d5ba5121685 Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Sat, 9 Mar 2024 09:24:14 -0800 Subject: Seems slightly more threadsafe (#1) --- dependencies.gradle | 4 + .../client/renderer/BW_Renderer_Block_Ores.java | 91 +++++++--------------- .../client/renderer/RendererGlasBlock.java | 42 +++++----- .../renderer/RendererSwitchingColorFluid.java | 8 +- .../bartworks/common/blocks/BW_GlasBlocks.java | 2 +- .../bartworks/common/blocks/BW_GlasBlocks2.java | 2 +- .../bartworks/common/loaders/FluidLoader.java | 4 +- .../system/material/BW_MetaGenerated_Blocks.java | 2 +- .../bartworks/system/material/WerkstoffLoader.java | 3 +- 9 files changed, 69 insertions(+), 89 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index f191495385..e2776fe9be 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,6 +1,10 @@ // Add your dependencies here dependencies { + runtimeOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.5.24-GTNH:dev') + runtimeOnlyNonPublishable('com.github.GTNewHorizons:waila:1.7.1:dev') + + compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha33:api') { transitive = false } api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.92:dev') api("com.github.GTNewHorizons:TecTech:5.3.32:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index d45262ad16..99733ef212 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -30,18 +30,26 @@ import org.lwjgl.opengl.GL11; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block_TE; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Blocks; +import com.gtnewhorizons.angelica.api.ThreadSafeISBRH; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; import gregtech.GT_Mod; +@ThreadSafeISBRH(perThread = true) public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { - public static BW_Renderer_Block_Ores INSTANCE = new BW_Renderer_Block_Ores(); - public final int mRenderID = RenderingRegistry.getNextAvailableRenderId(); + public static BW_Renderer_Block_Ores INSTANCE; + public static int renderID; public static final float blockMin = 0.0F; public static final float blockMax = 1.0F; + public static void register() { + renderID = RenderingRegistry.getNextAvailableRenderId(); + INSTANCE = new BW_Renderer_Block_Ores(); + RenderingRegistry.registerBlockHandler(INSTANCE); + } + @Override public void renderInventoryBlock(Block aBlock, int aMeta, int modelId, RenderBlocks aRenderer) { BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks) aBlock).getProperTileEntityForRendering(); @@ -112,71 +120,32 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { aRenderer.useInventoryTint = false; } + // spotless:off @Override - public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int modelId, - RenderBlocks aRenderer) { - BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks) aBlock).getProperTileEntityForRendering(); - tTileEntity.mMetaData = ((BW_MetaGenerated_Block_TE) aWorld.getTileEntity(aX, aY, aZ)).mMetaData; + public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int modelId, RenderBlocks aRenderer) { + BW_MetaGenerated_Blocks tBlock = (BW_MetaGenerated_Blocks) aBlock; + if(tBlock == null) return false; + + BW_MetaGenerated_Block_TE fakeTileEntity = tBlock.getProperTileEntityForRendering(); // meh + if(fakeTileEntity == null) return false; + + BW_MetaGenerated_Block_TE actualTileEntity = (BW_MetaGenerated_Block_TE) aWorld.getTileEntity(aX, aY, aZ); + if(actualTileEntity == null) return false; + + fakeTileEntity.mMetaData = actualTileEntity.mMetaData; aRenderer.useInventoryTint = false; aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax); aRenderer.enableAO = Minecraft.isAmbientOcclusionEnabled() && GT_Mod.gregtechproxy.mRenderTileAmbientOcclusion; aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - tTileEntity.getTexture(aBlock, ForgeDirection.DOWN), - true); - renderPositiveYFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - tTileEntity.getTexture(aBlock, ForgeDirection.UP), - true); - renderNegativeZFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - tTileEntity.getTexture(aBlock, ForgeDirection.NORTH), - true); - renderPositiveZFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - tTileEntity.getTexture(aBlock, ForgeDirection.SOUTH), - true); - renderNegativeXFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - tTileEntity.getTexture(aBlock, ForgeDirection.WEST), - true); - renderPositiveXFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - tTileEntity.getTexture(aBlock, ForgeDirection.EAST), - true); + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, fakeTileEntity.getTexture(aBlock, ForgeDirection.DOWN), true); + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, fakeTileEntity.getTexture(aBlock, ForgeDirection.UP), true); + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, fakeTileEntity.getTexture(aBlock, ForgeDirection.NORTH), true); + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, fakeTileEntity.getTexture(aBlock, ForgeDirection.SOUTH), true); + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, fakeTileEntity.getTexture(aBlock, ForgeDirection.WEST), true); + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, fakeTileEntity.getTexture(aBlock, ForgeDirection.EAST), true); return true; } + // spotless:on @Override public boolean shouldRender3DInInventory(int modelId) { @@ -185,6 +154,6 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { @Override public int getRenderId() { - return this.mRenderID; + return renderID; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java index de1d90a3f4..ce87e4a68a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java @@ -23,6 +23,7 @@ import org.lwjgl.opengl.GL11; import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks2; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.gtnewhorizons.angelica.api.ThreadSafeISBRH; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; @@ -30,10 +31,17 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) +@ThreadSafeISBRH(perThread = false) public class RendererGlasBlock implements ISimpleBlockRenderingHandler { - public static final int RID = RenderingRegistry.getNextAvailableRenderId(); - public static final RendererGlasBlock instance = new RendererGlasBlock(); + public static int renderID; + public static RendererGlasBlock INSTANCE; + + public static void register() { + renderID = RenderingRegistry.getNextAvailableRenderId(); + INSTANCE = new RendererGlasBlock(); + RenderingRegistry.registerBlockHandler(INSTANCE); + } @Override public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { @@ -69,33 +77,27 @@ public class RendererGlasBlock implements ISimpleBlockRenderingHandler { GL11.glTranslatef(0.5F, 0.5F, 0.5F); } + // spotless:off @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { + RenderBlocks renderer) { if (block instanceof BW_GlasBlocks) { renderer.renderStandardBlock(ItemRegistry.bw_fake_glasses, x, y, z); - renderer.renderStandardBlockWithColorMultiplier( - block, - x, - y, - z, - ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[0] / 255f, - ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[1] / 255f, - ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[2] / 255f); + renderer.renderStandardBlockWithColorMultiplier(block, x, y, z, + ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[0] / 255f, + ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[1] / 255f, + ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[2] / 255f); } if (block instanceof BW_GlasBlocks2) { renderer.renderStandardBlock(ItemRegistry.bw_fake_glasses2, x, y, z); - renderer.renderStandardBlockWithColorMultiplier( - block, - x, - y, - z, - ((BW_GlasBlocks2) block).getColor(world.getBlockMetadata(x, y, z))[0] / 255f, - ((BW_GlasBlocks2) block).getColor(world.getBlockMetadata(x, y, z))[1] / 255f, - ((BW_GlasBlocks2) block).getColor(world.getBlockMetadata(x, y, z))[2] / 255f); + renderer.renderStandardBlockWithColorMultiplier(block, x, y, z, + ((BW_GlasBlocks2) block).getColor(world.getBlockMetadata(x, y, z))[0] / 255f, + ((BW_GlasBlocks2) block).getColor(world.getBlockMetadata(x, y, z))[1] / 255f, + ((BW_GlasBlocks2) block).getColor(world.getBlockMetadata(x, y, z))[2] / 255f); } return true; } + // spotless:on @Override public boolean shouldRender3DInInventory(int modelId) { @@ -104,6 +106,6 @@ public class RendererGlasBlock implements ISimpleBlockRenderingHandler { @Override public int getRenderId() { - return RendererGlasBlock.RID; + return RendererGlasBlock.renderID; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java index 6e1bffcd08..6af2f2df7d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java @@ -28,12 +28,14 @@ import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; import com.github.bartimaeusnek.bartworks.util.Coords; +import com.gtnewhorizons.angelica.api.ThreadSafeISBRH; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) +@ThreadSafeISBRH(perThread = false) public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler { private static final float LIGHT_Y_NEG = 0.5f; @@ -43,7 +45,11 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler private static final float THREE_QUARTERS_FILLED = 0.875f; private static final double RENDER_OFFSET = 0.0010000000474974513; - public static RendererSwitchingColorFluid instance = new RendererSwitchingColorFluid(); + public static RendererSwitchingColorFluid instance; + + public static void register() { + instance = new RendererSwitchingColorFluid(); + } private float getFluidHeightAverage(float[] flow) { float total = 0.0f; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java index a2f5e520b9..5c596a0b5e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java @@ -172,7 +172,7 @@ public class BW_GlasBlocks extends BW_Blocks { @Override public int getRenderType() { - if (!this.fake && SideReference.Side.Client) return RendererGlasBlock.RID; + if (!this.fake && SideReference.Side.Client) return RendererGlasBlock.renderID; return 0; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java index 337db90324..24033787c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java @@ -164,7 +164,7 @@ public class BW_GlasBlocks2 extends BW_Blocks { @Override public int getRenderType() { - if (!this.fake && SideReference.Side.Client) return RendererGlasBlock.RID; + if (!this.fake && SideReference.Side.Client) return RendererGlasBlock.renderID; return 0; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 0c92005f6f..c843297771 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -104,8 +104,8 @@ public class FluidLoader { GameRegistry.registerBlock(bioFluidBlock, "coloredFluidBlock"); GameRegistry.registerTileEntity(BWTileEntityDimIDBridge.class, "bwTEDimIDBridge"); if (SideReference.Side.Client) { - RenderingRegistry.registerBlockHandler(RendererSwitchingColorFluid.instance); - RenderingRegistry.registerBlockHandler(RendererGlasBlock.instance); + RendererSwitchingColorFluid.register(); + RendererGlasBlock.register(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java index c9dd83db6c..84bcb5ffef 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java @@ -87,7 +87,7 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { @Override public int getRenderType() { if (BW_Renderer_Block_Ores.INSTANCE == null) return super.getRenderType(); - return BW_Renderer_Block_Ores.INSTANCE.mRenderID; + return BW_Renderer_Block_Ores.INSTANCE.renderID; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index b9855ab1a3..19e7437524 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -121,7 +121,6 @@ import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import com.github.bartimaeusnek.crossmod.cls.CLSCompat; import com.google.common.collect.HashBiMap; -import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.ProgressManager; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.Element; @@ -1737,7 +1736,7 @@ public class WerkstoffLoader { } static void gameRegistryHandler() { - if (SideReference.Side.Client) RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); + if (SideReference.Side.Client) BW_Renderer_Block_Ores.register(); GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); GameRegistry.registerTileEntity(BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmallTE"); -- cgit From fb9e6fc821224c58d7946ecd80de94c715d4f289 Mon Sep 17 00:00:00 2001 From: Abdiel Kavash <19243993+AbdielKavash@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:11:26 -0600 Subject: Numeric widget and localized number formatting. (#2) * bs + deps * Radio Hatch * LESU * spotless * deps --- dependencies.gradle | 4 +- .../tileentities/multis/GT_TileEntity_LESU.java | 56 ++++++++++++++-------- .../tiered/GT_MetaTileEntity_RadioHatch.java | 13 ++--- 3 files changed, 46 insertions(+), 27 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index e2776fe9be..63958793c0 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -4,8 +4,8 @@ dependencies { runtimeOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.5.24-GTNH:dev') runtimeOnlyNonPublishable('com.github.GTNewHorizons:waila:1.7.1:dev') - compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha33:api') { transitive = false } - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.92:dev') + compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha34:api') { transitive = false } + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.95:dev') api("com.github.GTNewHorizons:TecTech:5.3.32:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index e253db5d45..65a45051ab 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -34,6 +34,7 @@ import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import com.github.bartimaeusnek.bartworks.util.ConnectedBlocksChecker; +import com.gtnewhorizons.modularui.api.NumberFormatMUI; import com.gtnewhorizons.modularui.api.drawable.Text; import com.gtnewhorizons.modularui.api.forge.ItemStackHandler; import com.gtnewhorizons.modularui.api.screen.ModularWindow; @@ -41,6 +42,7 @@ import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.ProgressBar; import com.gtnewhorizons.modularui.common.widget.SlotWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; @@ -79,6 +81,8 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { }; private long mStorage; + protected static final NumberFormatMUI numberFormat = new NumberFormatMUI(); + public GT_TileEntity_LESU(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); this.mStorage = ConfigHandler.energyPerCell; @@ -492,39 +496,53 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { .setSize(116, 5)); } + private long clientEU; + private long clientMaxEU; + private long clientMaxIn; + private long clientMaxOut; + private long clientAmps; + private void drawTexts(DynamicPositionedColumn screenElements) { screenElements.setSpace(0).setPos(11, 8); screenElements .widget( - TextWidget.dynamicString( - () -> "EU: " + GT_Utility.formatNumbers(this.getBaseMetaTileEntity().getStoredEU())) + new TextWidget().setStringSupplier(() -> "EU: " + numberFormat.format(this.clientEU)) .setDefaultColor(this.COLOR_TEXT_WHITE.get())) .widget( - TextWidget.dynamicString( - () -> "MAX: " + (this.getBaseMetaTileEntity().isActive() - ? GT_Utility.formatNumbers(this.getBaseMetaTileEntity().getOutputVoltage()) - + String.valueOf(ConfigHandler.energyPerCell).substring(1) - : Integer.toString(0))) + new FakeSyncWidget.LongSyncer( + () -> this.getBaseMetaTileEntity().getStoredEU(), + val -> clientEU = val)) + .widget( + new TextWidget().setStringSupplier(() -> "MAX: " + numberFormat.format(clientMaxEU)) .setDefaultColor(this.COLOR_TEXT_WHITE.get())) .widget( - TextWidget - .dynamicString( - () -> "MAX EU/t IN: " + GT_Utility - .formatNumbers(this.getBaseMetaTileEntity().getInputVoltage())) + new FakeSyncWidget.LongSyncer( + () -> this.getBaseMetaTileEntity().isActive() + ? this.getBaseMetaTileEntity().getOutputVoltage() * ConfigHandler.energyPerCell + : 0, + val -> clientMaxEU = val)) + .widget( + new TextWidget().setStringSupplier(() -> "MAX EU/t IN: " + numberFormat.format(clientMaxIn)) .setDefaultColor(this.COLOR_TEXT_WHITE.get())) .widget( - TextWidget - .dynamicString( - () -> "EU/t OUT: " + GT_Utility - .formatNumbers(this.getBaseMetaTileEntity().getOutputVoltage())) + new FakeSyncWidget.LongSyncer( + () -> this.getBaseMetaTileEntity().getInputVoltage(), + val -> clientMaxIn = val)) + .widget( + new TextWidget().setStringSupplier(() -> "EU/t OUT: " + numberFormat.format(clientMaxOut)) .setDefaultColor(this.COLOR_TEXT_WHITE.get())) .widget( - TextWidget - .dynamicString( - () -> "AMP/t IN/OUT: " + GT_Utility - .formatNumbers(this.getBaseMetaTileEntity().getInputAmperage())) + new FakeSyncWidget.LongSyncer( + () -> this.getBaseMetaTileEntity().getOutputVoltage(), + val -> clientMaxOut = val)) + .widget( + new TextWidget().setStringSupplier(() -> "AMP/t IN/OUT: " + numberFormat.format(clientAmps)) .setDefaultColor(this.COLOR_TEXT_WHITE.get())) + .widget( + new FakeSyncWidget.LongSyncer( + () -> this.getBaseMetaTileEntity().getInputAmperage(), + val -> clientAmps = val)) .widget( new TextWidget(Text.localised("tooltip.LESU.0.name")).setDefaultColor(Color.YELLOW.getRGB()) .setEnabled(widget -> this.maxEUStore() >= Long.MAX_VALUE - 1)) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 942c2823b0..6eb6bf9e85 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -45,7 +45,7 @@ import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.ProgressBar; import com.gtnewhorizons.modularui.common.widget.ProgressBar.Direction; import com.gtnewhorizons.modularui.common.widget.TextWidget; -import com.gtnewhorizons.modularui.common.widget.textfield.TextFieldWidget; +import com.gtnewhorizons.modularui.common.widget.textfield.NumericWidget; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; @@ -402,14 +402,16 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch new DrawableWidget().setBackground(BW_UITextures.PICTURE_DECAY_TIME_CONTAINER).setPos(120, 14) .setSize(24, 56)) .widget( - TextWidget.dynamicString( + new TextWidget().setStringSupplier( () -> StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", this.mass)) .setTextAlignment(Alignment.Center).setPos(65, 62)) + .widget(new FakeSyncWidget.ByteSyncer(() -> this.mass, val -> this.mass = val)) .widget( - TextWidget.dynamicString( + new TextWidget().setStringSupplier( () -> StatCollector .translateToLocalFormatted("BW.NEI.display.radhatch.0", this.getSievert())) .setTextAlignment(Alignment.Center).setPos(60, 72)) + .widget(new FakeSyncWidget.IntegerSyncer(() -> this.sievert, val -> this.sievert = val)) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { if (!widget.isClient()) { widget.getContext().openSyncedWindow(RADIATION_SHUTTER_WINDOW_ID); @@ -442,9 +444,8 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch (widget, val) -> widget.setPos(16, 29 + this.coverage / 2) .setSize(51, 50 - this.coverage / 2))) .widget( - new TextFieldWidget().setSetterInt(val -> this.coverage = val.byteValue()) - .setGetterInt(() -> (int) this.coverage).setNumbers(0, 100) - .setTextColor(Color.WHITE.dark(1)).setOnScrollNumbers(1, 5, 50) + new NumericWidget().setSetter(val -> this.coverage = (byte) val).setGetter(() -> this.coverage) + .setBounds(0, 100).setScrollValues(1, 5, 50).setTextColor(Color.WHITE.dark(1)) .setTextAlignment(Alignment.CenterLeft) .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD.withOffset(-1, -1, 2, 2)) .setPos(86, 27).setSize(30, 12)) -- cgit From ea4699c56715180374cab6a6f4537fdddec18d70 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sun, 10 Mar 2024 21:24:41 +0100 Subject: update --- dependencies.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 63958793c0..649209166e 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -6,12 +6,12 @@ dependencies { compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha34:api') { transitive = false } api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.95:dev') - api("com.github.GTNewHorizons:TecTech:5.3.32:dev") + api("com.github.GTNewHorizons:TecTech:5.3.34:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } api("com.github.GTNewHorizons:Avaritia:1.49:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.11-GTNH:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.12-GTNH:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.25:deobf") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.7-GTNH:api") {transitive = false} -- cgit From 08157ac34612a0298e0d8acb68ebd0f2bcdbd32f Mon Sep 17 00:00:00 2001 From: Abdiel Kavash <19243993+AbdielKavash@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:15:00 -0600 Subject: Fix multiblock structure check bugs related to borosilicate glass. (#3) * uBS + uD * Borosilicate Glass check fix * Non-exotic Energy Hatch fix. * Replace for loops. --- dependencies.gradle | 14 +++++++------- gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle | 2 +- .../bartimaeusnek/bartworks/API/BorosilicateGlass.java | 4 ++-- .../multis/mega/GT_TileEntity_MegaBlastFurnace.java | 8 +++++++- .../multis/mega/GT_TileEntity_MegaChemicalReactor.java | 8 +++++++- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 8 +++++++- 8 files changed, 33 insertions(+), 15 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 649209166e..8f14b40a98 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,18 +1,18 @@ // Add your dependencies here dependencies { - runtimeOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.5.24-GTNH:dev') - runtimeOnlyNonPublishable('com.github.GTNewHorizons:waila:1.7.1:dev') + runtimeOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.5.25-GTNH:dev') + runtimeOnlyNonPublishable('com.github.GTNewHorizons:waila:1.7.2:dev') - compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha34:api') { transitive = false } - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.95:dev') - api("com.github.GTNewHorizons:TecTech:5.3.34:dev") + compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha36a:api') { transitive = false } + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.144:dev') + api("com.github.GTNewHorizons:TecTech:5.3.45:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } api("com.github.GTNewHorizons:Avaritia:1.49:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.12-GTNH:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.14-GTNH:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.25:deobf") {transitive = false} - compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.7-GTNH:api") {transitive = false} + compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.9-GTNH:api") {transitive = false} } diff --git a/gradle.properties b/gradle.properties index 9a8fc78abc..fcd5f9f406 100644 --- a/gradle.properties +++ b/gradle.properties @@ -117,7 +117,7 @@ minimizeShadowedDependencies = true # If disabled, won't rename the shadowed classes. relocateShadowedDependencies = true -# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories. +# Adds the GTNH maven, CurseMaven, Modrinth, and some more well-known 1.7.10 repositories. includeWellKnownRepositories = true # Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven. diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a80b22ce5c..b82aa23a4f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle b/settings.gradle index b11efb014f..378da58941 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ pluginManagement { } plugins { - id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.16' + id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.21' } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java index 3076455c70..764340af42 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java @@ -103,8 +103,8 @@ public class BorosilicateGlass { return representatives; } - private static byte checkWithinBound(byte val, byte lo, byte hi) { - return val > hi || val < lo ? -1 : val; + private static Byte checkWithinBound(byte val, byte lo, byte hi) { + return val > hi || val < lo ? null : val; } /** diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index de5ef59f18..fc490d6109 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -365,7 +365,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock return false; if (this.glassTier < 8) { - for (GT_MetaTileEntity_Hatch hatch : this.mExoticEnergyHatches) { + for (int i = 0; i < this.mExoticEnergyHatches.size(); ++i) { + GT_MetaTileEntity_Hatch hatch = this.mExoticEnergyHatches.get(i); if (hatch.getConnectionType() == GT_MetaTileEntity_Hatch.ConnectionType.LASER) { return false; } @@ -373,6 +374,11 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock return false; } } + for (int i = 0; i < this.mEnergyHatches.size(); ++i) { + if (this.glassTier < this.mEnergyHatches.get(i).mTier) { + return false; + } + } } this.mHeatingCapacity = (int) this.getCoilLevel().getHeat() + 100 * (BW_Util.getTier(this.getMaxInputEu()) - 2); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index 2638f5de7c..3764812689 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -162,7 +162,8 @@ public class GT_TileEntity_MegaChemicalReactor if (!this.checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 0) || this.mMaintenanceHatches.size() != 1) return false; if (this.glassTier < 8) { - for (GT_MetaTileEntity_Hatch hatch : this.mExoticEnergyHatches) { + for (int i = 0; i < this.mExoticEnergyHatches.size(); ++i) { + GT_MetaTileEntity_Hatch hatch = this.mExoticEnergyHatches.get(i); if (hatch.getConnectionType() == GT_MetaTileEntity_Hatch.ConnectionType.LASER) { return false; } @@ -170,6 +171,11 @@ public class GT_TileEntity_MegaChemicalReactor return false; } } + for (int i = 0; i < this.mEnergyHatches.size(); ++i) { + if (this.glassTier < this.mEnergyHatches.get(i).mTier) { + return false; + } + } } return true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index 650e386202..8b498694bd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -238,7 +238,8 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa if (!this.checkPiece(STRUCTURE_PIECE_MAIN, 6, 6, 0) || this.mMaintenanceHatches.size() != 1) return false; if (this.glassTier < 8) { - for (GT_MetaTileEntity_Hatch hatch : this.mExoticEnergyHatches) { + for (int i = 0; i < this.mExoticEnergyHatches.size(); ++i) { + GT_MetaTileEntity_Hatch hatch = this.mExoticEnergyHatches.get(i); if (hatch.getConnectionType() == GT_MetaTileEntity_Hatch.ConnectionType.LASER) { return false; } @@ -246,6 +247,11 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa return false; } } + for (int i = 0; i < this.mEnergyHatches.size(); ++i) { + if (this.glassTier < this.mEnergyHatches.get(i).mTier) { + return false; + } + } } return true; -- cgit From 7a1603b2e2d86b2262a99f10888e9ed1ac03053f Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Fri, 12 Apr 2024 22:20:57 +0200 Subject: update --- dependencies.gradle | 2 +- gradle/wrapper/gradle-wrapper.jar | Bin 43462 -> 43453 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 8f14b40a98..5ed7cba2b8 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -5,7 +5,7 @@ dependencies { runtimeOnlyNonPublishable('com.github.GTNewHorizons:waila:1.7.2:dev') compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha36a:api') { transitive = false } - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.144:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.148:dev') api("com.github.GTNewHorizons:TecTech:5.3.45:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d64cd49177..e6441136f3 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ -- cgit From f81ddc6b8b08387605db8ce1bbc6adc6e3ecc6bf Mon Sep 17 00:00:00 2001 From: HoleFish <48403212+HoleFish@users.noreply.github.com> Date: Tue, 16 Apr 2024 03:48:05 +0800 Subject: fix (#4) --- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 56 +++++++++++++++++++--- 1 file changed, 49 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index 8b498694bd..6e4a0276db 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -28,7 +28,9 @@ import static gregtech.api.util.GT_StructureUtility.ofCoil; import static gregtech.api.util.GT_Utility.filterValidMTEs; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import javax.annotation.Nonnull; @@ -37,6 +39,7 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; @@ -59,9 +62,12 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Outpu import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.RecipeMaps; import gregtech.api.recipe.check.CheckRecipeResult; +import gregtech.api.recipe.maps.OilCrackerBackend; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_Input_ME; +import gregtech.common.tileentities.machines.IRecipeProcessingAwareHatch; public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { @@ -188,7 +194,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa } @Override - public RecipeMap getRecipeMap() { + public RecipeMap getRecipeMap() { return RecipeMaps.crackingRecipes; } @@ -340,38 +346,54 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa @Override public ArrayList getStoredFluids() { final ArrayList rList = new ArrayList<>(); + Map inputsFromME = new HashMap<>(); for (final GT_MetaTileEntity_Hatch_Input tHatch : filterValidMTEs(mInputHatches)) { tHatch.mRecipeMap = getRecipeMap(); - if (tHatch instanceof GT_MetaTileEntity_Hatch_MultiInput) { + if (tHatch instanceof GT_MetaTileEntity_Hatch_Input_ME meHatch) { + for (FluidStack tFluid : meHatch.getStoredFluids()) { + if (tFluid != null && !getRecipeMap().getBackend().isValidCatalystFluid(tFluid)) { + inputsFromME.put(tFluid.getFluid(), tFluid); + } + } + } else if (tHatch instanceof GT_MetaTileEntity_Hatch_MultiInput) { for (final FluidStack tFluid : ((GT_MetaTileEntity_Hatch_MultiInput) tHatch).getStoredFluid()) { - if (tFluid != null && !RecipeMaps.crackingRecipes.getBackend().isValidCatalystFluid(tFluid)) { + if (tFluid != null && !getRecipeMap().getBackend().isValidCatalystFluid(tFluid)) { rList.add(tFluid); } } } else { if (tHatch.getFillableStack() != null) { - if (!RecipeMaps.crackingRecipes.getBackend().isValidCatalystFluid(tHatch.getFillableStack())) + if (!getRecipeMap().getBackend().isValidCatalystFluid(tHatch.getFillableStack())) rList.add(tHatch.getFillableStack()); } } } for (final GT_MetaTileEntity_Hatch_Input tHatch : filterValidMTEs(mMiddleInputHatches)) { tHatch.mRecipeMap = getRecipeMap(); - if (tHatch instanceof GT_MetaTileEntity_Hatch_MultiInput) { + if (tHatch instanceof GT_MetaTileEntity_Hatch_Input_ME meHatch) { + for (FluidStack tFluid : meHatch.getStoredFluids()) { + if (tFluid != null && getRecipeMap().getBackend().isValidCatalystFluid(tFluid)) { + inputsFromME.put(tFluid.getFluid(), tFluid); + } + } + } else if (tHatch instanceof GT_MetaTileEntity_Hatch_MultiInput) { for (final FluidStack tFluid : ((GT_MetaTileEntity_Hatch_MultiInput) tHatch).getStoredFluid()) { - if (tFluid != null && RecipeMaps.crackingRecipes.getBackend().isValidCatalystFluid(tFluid)) { + if (tFluid != null && getRecipeMap().getBackend().isValidCatalystFluid(tFluid)) { rList.add(tFluid); } } } else { if (tHatch.getFillableStack() != null) { final FluidStack tStack = tHatch.getFillableStack(); - if (RecipeMaps.crackingRecipes.getBackend().isValidCatalystFluid(tStack)) { + if (getRecipeMap().getBackend().isValidCatalystFluid(tStack)) { rList.add(tStack); } } } } + if (!inputsFromME.isEmpty()) { + rList.addAll(inputsFromME.values()); + } return rList; } @@ -404,4 +426,24 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa public boolean supportsVoidProtection() { return true; } + + @Override + protected void startRecipeProcessing() { + for (GT_MetaTileEntity_Hatch_Input hatch : filterValidMTEs(mMiddleInputHatches)) { + if (hatch instanceof IRecipeProcessingAwareHatch aware) { + aware.startRecipeProcessing(); + } + } + super.startRecipeProcessing(); + } + + @Override + protected void endRecipeProcessing() { + super.endRecipeProcessing(); + for (GT_MetaTileEntity_Hatch_Input hatch : filterValidMTEs(mMiddleInputHatches)) { + if (hatch instanceof IRecipeProcessingAwareHatch aware) { + setResultIfFailure(aware.endRecipeProcessing(this)); + } + } + } } -- cgit From f4643ad3aa52387f90f69107039d98d27804621d Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Tue, 16 Apr 2024 19:51:47 +0200 Subject: update --- dependencies.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 5ed7cba2b8..0b98063b38 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -5,13 +5,13 @@ dependencies { runtimeOnlyNonPublishable('com.github.GTNewHorizons:waila:1.7.2:dev') compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha36a:api') { transitive = false } - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.148:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.151:dev') api("com.github.GTNewHorizons:TecTech:5.3.45:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } api("com.github.GTNewHorizons:Avaritia:1.49:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.14-GTNH:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.15-GTNH:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.25:deobf") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.9-GTNH:api") {transitive = false} -- cgit From 2bca2aa40a09166f9a0f59eb4f569564ddfc6b72 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Wed, 17 Apr 2024 13:26:39 +0100 Subject: Fix plat exploits (#6) * fix plat exploits * fix --- .../system/material/GT_Enhancement/PlatinumSludgeOverHaul.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 097e82f5e1..b8fdac7497 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -940,6 +940,12 @@ public class PlatinumSludgeOverHaul { } catch (ClassNotFoundException e) { e.printStackTrace(); } + if (stack.getItem() == GT_ModHandler.getModItem(GTPlusPlus.ID, "itemDustHeLiCoPtEr", 1L).getItem()) { + return true; + } + if (stack.getItem() == GT_ModHandler.getModItem(GTPlusPlus.ID, "itemDustWhiteMetal", 1L).getItem()) { + return true; + } } if (GalaxySpace.isModLoaded()) { if (stack.getItem() == GT_ModHandler.getModItem(GalaxySpace.ID, "metalsblock", 1L, 7).getItem()) { -- cgit From a4f53b7beebc3c7e35019d555f1d4913e5602bcf Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Wed, 17 Apr 2024 18:08:16 +0200 Subject: update --- dependencies.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 0b98063b38..a6f5a16cc1 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,10 +2,10 @@ dependencies { runtimeOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.5.25-GTNH:dev') - runtimeOnlyNonPublishable('com.github.GTNewHorizons:waila:1.7.2:dev') + runtimeOnlyNonPublishable('com.github.GTNewHorizons:waila:1.7.3:dev') compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha36a:api') { transitive = false } - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.151:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.153:dev') api("com.github.GTNewHorizons:TecTech:5.3.45:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" @@ -14,5 +14,5 @@ dependencies { implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.15-GTNH:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.25:deobf") {transitive = false} - compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.9-GTNH:api") {transitive = false} + compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.10-GTNH:api") {transitive = false} } -- cgit From 33802b816d2f3a81ff924657717aad827179db33 Mon Sep 17 00:00:00 2001 From: Lyfts <127234178+Lyfts@users.noreply.github.com> Date: Sat, 4 May 2024 09:36:17 +0200 Subject: Add any block to void miner drops (#7) * make it possible to add any block to void miner drops * oops this needs to be opposite --- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 60 +++++++++++++--------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index b56d33a5dd..8f4c549e08 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -30,6 +30,7 @@ import java.util.function.Consumer; import java.util.function.Predicate; import java.util.stream.Collectors; +import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -67,13 +68,13 @@ import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_DrillerBase { - private static ArrayListMultimap, Float>> extraDropsDimMap = ArrayListMultimap + private static final ArrayListMultimap, Float>> extraDropsDimMap = ArrayListMultimap .create(); - private static FluidStack[] NOBLE_GASSES = { WerkstoffLoader.Neon.getFluidOrGas(1), + private static final FluidStack[] NOBLE_GASSES = { WerkstoffLoader.Neon.getFluidOrGas(1), WerkstoffLoader.Krypton.getFluidOrGas(1), WerkstoffLoader.Xenon.getFluidOrGas(1), WerkstoffLoader.Oganesson.getFluidOrGas(1) }; - private Map, Float> dropmap = null; + private Map, Float> dropmap = null; private float totalWeight; private int multiplier = 1; @@ -83,17 +84,22 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * Public method giving other mods the ability to add manually a material with an ore version into the external - * dromap for a specified dim id + * dropmap for a specified dim id * - * @param DimensionID the dim id targetted + * @param DimensionID the dim id targeted * @param Material the material with an ore version * @param weight the non normalised version of the given weight */ public static void addMatierialToDimensionList(int DimensionID, ISubTagContainer Material, float weight) { - if (Material instanceof Materials) getExtraDropsDimMap() - .put(DimensionID, new Pair<>(new Pair<>(((Materials) Material).mMetaItemSubID, false), weight)); - else if (Material instanceof Werkstoff) getExtraDropsDimMap() - .put(DimensionID, new Pair<>(new Pair<>((int) ((Werkstoff) Material).getmID(), true), weight)); + if (Material instanceof Materials gtMaterial) { + addBlockToDimensionList(DimensionID, GregTech_API.sBlockOres1, gtMaterial.mMetaItemSubID, weight); + } else if (Material instanceof Werkstoff werkstoff) { + addBlockToDimensionList(DimensionID, WerkstoffLoader.BWOres, werkstoff.getmID(), weight); + } + } + + public static void addBlockToDimensionList(int dimId, Block block, int meta, float weight) { + getExtraDropsDimMap().put(dimId, new Pair<>(new Pair<>(meta, block), weight)); } // adding tellurium to OW to ensure a way to get it, as it's used in Magneto Resonatic Dust and Circuit Compound MK3 @@ -201,9 +207,9 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri /** * getter for the external drop map * - * @return the extraDriosDimMap + * @return the extraDropsDimMap */ - public static ArrayListMultimap, Float>> getExtraDropsDimMap() { + public static ArrayListMultimap, Float>> getExtraDropsDimMap() { return extraDropsDimMap; } @@ -219,7 +225,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri case 0 -> gt_worldgen -> gt_worldgen.mOverworld; case 1 -> gt_worldgen -> gt_worldgen.mEnd || gt_worldgen.mEndAsteroid; /* - * explicitely giving different dim numbers so it default to false in the config, keeping compat with the + * explicitly giving different dim numbers so it default to false in the config, keeping compat with the * current worldgen config */ case 7 -> gt_worldgen -> gt_worldgen.isGenerationAllowed(world, 0, 7); @@ -239,7 +245,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri case 0 -> gt_worldgen -> gt_worldgen.mOverworld; case 1 -> gt_worldgen -> gt_worldgen.mEnd; /* - * explicitely giving different dim numbers so it default to false in the config, keeping compat with the + * explicitly giving different dim numbers so it default to false in the config, keeping compat with the * current worldgen config */ case 7 -> gt_worldgen -> gt_worldgen.isGenerationAllowed(world, 0, 7); @@ -255,6 +261,15 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @param value the non normalised weight */ private void addDrop(Pair key, float value) { + if (key.getValue()) { + addDrop(WerkstoffLoader.BWOres, key.getKey(), value); + } else { + addDrop(GregTech_API.sBlockOres1, key.getKey(), value); + } + } + + private void addDrop(Block block, int meta, float value) { + Pair key = new Pair<>(meta, block); final ItemStack ore = this.getOreItemStack(key); if (ConfigHandler.voidMinerBlacklist.contains( String.format( @@ -331,11 +346,11 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * * @return the chosen key */ - private Pair getOreDamage() { + private Pair getOreDamage() { float curentWeight = 0.f; while (true) { float randomnumber = XSTR.XSTR_INSTANCE.nextFloat() * this.totalWeight; - for (Map.Entry, Float> entry : this.dropmap.entrySet()) { + for (Map.Entry, Float> entry : this.dropmap.entrySet()) { curentWeight += entry.getValue(); if (randomnumber < curentWeight) return entry.getKey(); } @@ -469,8 +484,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @param id the specified dim id */ private void handleExtraDrops(int id) { - Optional.ofNullable(getExtraDropsDimMap().get(id)) - .ifPresent(e -> e.forEach(f -> this.addDrop(f.getKey(), f.getValue()))); + Optional.ofNullable(getExtraDropsDimMap().get(id)).ifPresent(e -> e.forEach(f -> { + Pair key = f.getKey(); + addDrop(key.getValue(), key.getKey(), f.getValue()); + })); } /** @@ -541,14 +558,11 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * Builds the ore item stack from the key specified in the dropmap * * @param stats the key of the dropmap - * @return an ItemStack corresponding to the target ore, with a stacksize corresponding to the mutiplier induced by + * @return an ItemStack corresponding to the target ore, with a stacksize corresponding to the multiplier induced by * the gas used */ - private ItemStack getOreItemStack(Pair stats) { - return new ItemStack( - stats.getValue() ? WerkstoffLoader.BWOres : GregTech_API.sBlockOres1, - this.multiplier, - stats.getKey()); + private ItemStack getOreItemStack(Pair stats) { + return new ItemStack(stats.getValue(), this.multiplier, stats.getKey()); } @Override -- cgit From 74bcc5f9ac43fa98a3a1c0e5174f68c2fe9b6cf6 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 4 May 2024 10:09:00 +0200 Subject: update --- dependencies.gradle | 10 +++++----- settings.gradle | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index a6f5a16cc1..d503780edf 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,12 +1,12 @@ // Add your dependencies here dependencies { - runtimeOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.5.25-GTNH:dev') + runtimeOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.5.27-GTNH:dev') runtimeOnlyNonPublishable('com.github.GTNewHorizons:waila:1.7.3:dev') - compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha36a:api') { transitive = false } - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.153:dev') - api("com.github.GTNewHorizons:TecTech:5.3.45:dev") + compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha42:api') { transitive = false } + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.02:dev') + api("com.github.GTNewHorizons:TecTech:5.4.0:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } @@ -14,5 +14,5 @@ dependencies { implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.15-GTNH:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.25:deobf") {transitive = false} - compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.10-GTNH:api") {transitive = false} + compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.11-GTNH:api") {transitive = false} } diff --git a/settings.gradle b/settings.gradle index 378da58941..94c2daf35c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ pluginManagement { } plugins { - id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.21' + id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.22' } -- cgit From 514473fb4867dccbaa3f1763a810dac548cd0e40 Mon Sep 17 00:00:00 2001 From: BlueHero233 <87818077+BlueHero233@users.noreply.github.com> Date: Tue, 14 May 2024 02:08:28 -0300 Subject: Differentiate between DNA Sample Flask and Plasmid Sample Flask (#8) --- .../assets/bartworks/textures/items/DNASampleFlask.png | Bin 253 -> 775 bytes .../assets/bartworks/textures/items/PlasmidCell.png | Bin 288 -> 777 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/main/resources/assets/bartworks/textures/items/DNASampleFlask.png b/src/main/resources/assets/bartworks/textures/items/DNASampleFlask.png index 69c6c649b9..7c10790535 100644 Binary files a/src/main/resources/assets/bartworks/textures/items/DNASampleFlask.png and b/src/main/resources/assets/bartworks/textures/items/DNASampleFlask.png differ diff --git a/src/main/resources/assets/bartworks/textures/items/PlasmidCell.png b/src/main/resources/assets/bartworks/textures/items/PlasmidCell.png index 680963b8ab..0e62fa2621 100644 Binary files a/src/main/resources/assets/bartworks/textures/items/PlasmidCell.png and b/src/main/resources/assets/bartworks/textures/items/PlasmidCell.png differ -- cgit From 1b9cd87d7d8491fe79dd5c5ecd707109932848de Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Tue, 14 May 2024 07:46:02 +0200 Subject: update --- dependencies.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index d503780edf..fde29e3647 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,17 +1,17 @@ // Add your dependencies here dependencies { - runtimeOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.5.27-GTNH:dev') + runtimeOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.6.0-GTNH:dev') runtimeOnlyNonPublishable('com.github.GTNewHorizons:waila:1.7.3:dev') - compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha42:api') { transitive = false } - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.02:dev') + compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha48:api') { transitive = false } + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.13:dev') api("com.github.GTNewHorizons:TecTech:5.4.0:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } api("com.github.GTNewHorizons:Avaritia:1.49:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.11.15-GTNH:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.12.0-GTNH:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.25:deobf") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.11-GTNH:api") {transitive = false} -- cgit From 008b321c9073a4224eb89ff1fd1e847dd5e6dff2 Mon Sep 17 00:00:00 2001 From: Abdiel Kavash <19243993+AbdielKavash@users.noreply.github.com> Date: Wed, 15 May 2024 23:56:45 -0600 Subject: Enable input bus separation for the MCR. (#9) * Enable input bus separation for the MCR. * Allow toggling by screwdriver. --- .../multis/mega/GT_TileEntity_MegaChemicalReactor.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index 3764812689..f7aaffef09 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -121,6 +121,14 @@ public class GT_TileEntity_MegaChemicalReactor } } + @Override + public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + inputSeparation = !inputSeparation; + GT_Utility.sendChatToPlayer( + aPlayer, + StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); + } + @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { @@ -233,4 +241,9 @@ public class GT_TileEntity_MegaChemicalReactor public boolean supportsVoidProtection() { return true; } + + @Override + public boolean supportsInputSeparation() { + return true; + } } -- cgit From dfe1bbfad76bcd4e68c8dee289ea9a0c404f9cf8 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 18 May 2024 00:18:44 +0200 Subject: update --- dependencies.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index fde29e3647..e2721907ae 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -4,8 +4,8 @@ dependencies { runtimeOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.6.0-GTNH:dev') runtimeOnlyNonPublishable('com.github.GTNewHorizons:waila:1.7.3:dev') - compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha48:api') { transitive = false } - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.13:dev') + compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha50:api') { transitive = false } + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.16:dev') api("com.github.GTNewHorizons:TecTech:5.4.0:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" -- cgit From 2c71abb6102985837575f830c9bfce088834583b Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 18 May 2024 00:30:42 +0200 Subject: backdate gt version --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index e2721907ae..7df5f0b173 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -4,8 +4,8 @@ dependencies { runtimeOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.6.0-GTNH:dev') runtimeOnlyNonPublishable('com.github.GTNewHorizons:waila:1.7.3:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.13:dev') compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha50:api') { transitive = false } - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.16:dev') api("com.github.GTNewHorizons:TecTech:5.4.0:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" -- cgit From c2f07a76c6b9d7421c2141e1b62aeb0086c5d81c Mon Sep 17 00:00:00 2001 From: HoleFish <48403212+HoleFish@users.noreply.github.com> Date: Sun, 19 May 2024 05:29:29 +0800 Subject: Void Miner logic rework (#11) * update * rework * spotless * = -> copy --- dependencies.gradle | 2 +- .../bartworks/API/VoidMinerDropAdder.java | 20 +- .../github/bartimaeusnek/bartworks/MainMod.java | 2 + .../system/oregen/BW_WorldGenRoss128b.java | 5 + .../system/oregen/BW_WorldGenRoss128ba.java | 5 + .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 375 +++------------------ .../crossmod/galacticgreg/VoidMinerUtility.java | 313 +++++++++++++++++ 7 files changed, 371 insertions(+), 351 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/VoidMinerUtility.java diff --git a/dependencies.gradle b/dependencies.gradle index 7df5f0b173..e2721907ae 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -4,8 +4,8 @@ dependencies { runtimeOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.6.0-GTNH:dev') runtimeOnlyNonPublishable('com.github.GTNewHorizons:waila:1.7.3:dev') - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.13:dev') compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha50:api') { transitive = false } + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.16:dev') api("com.github.GTNewHorizons:TecTech:5.4.0:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java index 7dd376c310..b83ce7d128 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java @@ -13,27 +13,13 @@ package com.github.bartimaeusnek.bartworks.API; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; +import com.github.bartimaeusnek.crossmod.galacticgreg.VoidMinerUtility; import gregtech.api.interfaces.ISubTagContainer; public class VoidMinerDropAdder { - private static Method getExtraDropsDimMap; - - static { - try { - getExtraDropsDimMap = Class - .forName("com.github.bartimaeusnek.crossmod.galacticgreg.GT_TileEntity_VoidMiner_Base") - .getMethod("addMatierialToDimensionList", int.class, ISubTagContainer.class, float.class); - } catch (NoSuchMethodException | ClassNotFoundException e) { - e.printStackTrace(); - } - } - - public static void addDropsToDim(int dimID, ISubTagContainer material, float chance) - throws InvocationTargetException, IllegalAccessException { - getExtraDropsDimMap.invoke(null, dimID, material, chance); + public static void addDropsToDim(int dimID, ISubTagContainer material, float chance) { + VoidMinerUtility.addMaterialToDimensionList(dimID, material, chance); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 86f33d91ef..fa04f66e28 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -62,6 +62,7 @@ import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.Down import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.ResultWrongSievert; import com.github.bartimaeusnek.bartworks.util.log.DebugLog; +import com.github.bartimaeusnek.crossmod.galacticgreg.VoidMinerUtility; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; @@ -200,6 +201,7 @@ public final class MainMod { runOnServerStarted(); StaticRecipeChangeLoaders.unificationRecipeEnforcer(); + VoidMinerUtility.generateDropMaps(); } private static boolean recipesAdded; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index f043be21b1..789d76ca55 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -212,4 +212,9 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { return aDimensionType == ConfigHandler.ross128BID; } + + @Override + public boolean isGenerationAllowed(String aDimName, int aDimensionType, int aAllowedDimensionType) { + return aDimensionType == ConfigHandler.ross128BID; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java index 59a0e1c3ae..ad4bff0aad 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java @@ -204,4 +204,9 @@ public class BW_WorldGenRoss128ba extends BW_OreLayer { public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { return aDimensionType == ConfigHandler.ross128BAID; } + + @Override + public boolean isGenerationAllowed(String aDimName, int aDimensionType, int aAllowedDimensionType) { + return aDimensionType == ConfigHandler.ross128BAID; + } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index 8f4c549e08..b8631f063d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -13,7 +13,6 @@ package com.github.bartimaeusnek.crossmod.galacticgreg; -import static bloodasp.galacticgreg.registry.GalacticGregRegistry.getModContainers; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; import static gregtech.api.enums.GT_HatchElement.Energy; import static gregtech.api.enums.GT_HatchElement.InputBus; @@ -22,59 +21,32 @@ import static gregtech.api.enums.GT_HatchElement.Maintenance; import static gregtech.api.enums.GT_HatchElement.OutputBus; import static gregtech.api.enums.GT_Values.VN; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.function.Consumer; -import java.util.function.Predicate; import java.util.stream.Collectors; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; import net.minecraft.world.gen.ChunkProviderServer; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; -import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; -import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer; -import com.github.bartimaeusnek.bartworks.util.Pair; -import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableList; -import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_Layer_Space; -import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_SmallPieces_Space; -import bloodasp.galacticgreg.GalacticGreg; -import bloodasp.galacticgreg.api.ModDimensionDef; -import bloodasp.galacticgreg.bartworks.BW_Worldgen_Ore_Layer_Space; -import bloodasp.galacticgreg.bartworks.BW_Worldgen_Ore_SmallOre_Space; -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Materials; import gregtech.api.interfaces.IHatchElement; -import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.XSTR; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; -import gregtech.common.GT_Worldgen_GT_Ore_Layer; -import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; +import gregtech.api.util.shutdown.ShutDownReasonRegistry; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_DrillerBase { - private static final ArrayListMultimap, Float>> extraDropsDimMap = ArrayListMultimap - .create(); - private static final FluidStack[] NOBLE_GASSES = { WerkstoffLoader.Neon.getFluidOrGas(1), - WerkstoffLoader.Krypton.getFluidOrGas(1), WerkstoffLoader.Xenon.getFluidOrGas(1), - WerkstoffLoader.Oganesson.getFluidOrGas(1) }; - - private Map, Float> dropmap = null; + private VoidMinerUtility.DropMap dropMap = null; private float totalWeight; private int multiplier = 1; @@ -83,29 +55,11 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private boolean mBlacklist = false; /** - * Public method giving other mods the ability to add manually a material with an ore version into the external - * dropmap for a specified dim id - * - * @param DimensionID the dim id targeted - * @param Material the material with an ore version - * @param weight the non normalised version of the given weight + * @Deprecated Use {@link VoidMinerUtility#addBlockToDimensionList} */ - public static void addMatierialToDimensionList(int DimensionID, ISubTagContainer Material, float weight) { - if (Material instanceof Materials gtMaterial) { - addBlockToDimensionList(DimensionID, GregTech_API.sBlockOres1, gtMaterial.mMetaItemSubID, weight); - } else if (Material instanceof Werkstoff werkstoff) { - addBlockToDimensionList(DimensionID, WerkstoffLoader.BWOres, werkstoff.getmID(), weight); - } - } - + @Deprecated public static void addBlockToDimensionList(int dimId, Block block, int meta, float weight) { - getExtraDropsDimMap().put(dimId, new Pair<>(new Pair<>(meta, block), weight)); - } - - // adding tellurium to OW to ensure a way to get it, as it's used in Magneto Resonatic Dust and Circuit Compound MK3 - // Dust - static { - addMatierialToDimensionList(0, Materials.Tellurium, 8.0f); + VoidMinerUtility.addBlockToDimensionList(dimId, block, meta, weight); } public GT_TileEntity_VoidMiner_Base(int aID, String aName, String aNameRegional, int tier) { @@ -159,16 +113,17 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri @Override protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { - // if the dropmap has never been initialised or if the dropmap is empty - if (this.dropmap == null || this.totalWeight == 0) this.calculateDropMap(); + // if the dropMap has never been initialised or if the dropMap is empty + if (this.dropMap == null || this.totalWeight == 0) this.calculateDropMap(); if (this.totalWeight != 0.f) { this.handleFluidConsumption(); this.handleOutputs(); return true; + } else { + this.stopMachine(ShutDownReasonRegistry.NONE); + return false; } - this.stopMachine(); - return false; } @Override @@ -205,154 +160,17 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } /** - * getter for the external drop map - * - * @return the extraDropsDimMap - */ - public static ArrayListMultimap, Float>> getExtraDropsDimMap() { - return extraDropsDimMap; - } - - /** - * Makes a predicate for the GT normal ore veins worldgen - * - * @return the predicate - */ - private Predicate makeOreLayerPredicate() { - World world = this.getBaseMetaTileEntity().getWorld(); - return switch (world.provider.dimensionId) { - case -1 -> gt_worldgen -> gt_worldgen.mNether; - case 0 -> gt_worldgen -> gt_worldgen.mOverworld; - case 1 -> gt_worldgen -> gt_worldgen.mEnd || gt_worldgen.mEndAsteroid; - /* - * explicitly giving different dim numbers so it default to false in the config, keeping compat with the - * current worldgen config - */ - case 7 -> gt_worldgen -> gt_worldgen.isGenerationAllowed(world, 0, 7); - default -> throw new IllegalStateException(); - }; - } - - /** - * Makes a predicate for the GT normal small ore worldgen - * - * @return the predicate - */ - private Predicate makeSmallOresPredicate() { - World world = this.getBaseMetaTileEntity().getWorld(); - return switch (world.provider.dimensionId) { - case -1 -> gt_worldgen -> gt_worldgen.mNether; - case 0 -> gt_worldgen -> gt_worldgen.mOverworld; - case 1 -> gt_worldgen -> gt_worldgen.mEnd; - /* - * explicitly giving different dim numbers so it default to false in the config, keeping compat with the - * current worldgen config - */ - case 7 -> gt_worldgen -> gt_worldgen.isGenerationAllowed(world, 0, 7); - default -> throw new IllegalStateException(); - }; - } - - /** - * Method used to add an ore to the droplist - * - * @param key a Pair of where the int is the meta of the ore, and the bool is true for BW ores, false - * for GT ores - * @param value the non normalised weight - */ - private void addDrop(Pair key, float value) { - if (key.getValue()) { - addDrop(WerkstoffLoader.BWOres, key.getKey(), value); - } else { - addDrop(GregTech_API.sBlockOres1, key.getKey(), value); - } - } - - private void addDrop(Block block, int meta, float value) { - Pair key = new Pair<>(meta, block); - final ItemStack ore = this.getOreItemStack(key); - if (ConfigHandler.voidMinerBlacklist.contains( - String.format( - "%s:%d", - GameRegistry.findUniqueIdentifierFor(ore.getItem()).toString(), - ore.getItemDamage()))) - return; - if (!this.dropmap.containsKey(key)) this.dropmap.put(key, value); - else this.dropmap.put(key, this.dropmap.get(key) + value); - } - - /** - * Method to add the ores of a vanilla GT worldgen - * - * @param oreLayerPredicate the predicate made by makeOreLayerPredicate - */ - private void getDropsVanillaVeins(Predicate oreLayerPredicate) { - GT_Worldgen_GT_Ore_Layer.sList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled && oreLayerPredicate.test(gt_worldgen)).forEach(element -> { - this.addDrop(new Pair<>((int) element.mPrimaryMeta, false), element.mWeight); - this.addDrop(new Pair<>((int) element.mSecondaryMeta, false), element.mWeight); - this.addDrop(new Pair<>((int) element.mSporadicMeta, false), element.mWeight / 8f); - this.addDrop(new Pair<>((int) element.mBetweenMeta, false), element.mWeight / 8f); - }); - } - - /** - * Method to add the small ores of a vanilla GT worldgen - * - * @param smallOresPredicate the predicate made by makeSmallOresPredicate - */ - private void getDropsVanillaSmallOres(Predicate smallOresPredicate) { - GT_Worldgen_GT_Ore_SmallPieces.sList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled && smallOresPredicate.test(gt_worldgen)) - .forEach(element -> this.addDrop(new Pair<>((int) element.mMeta, false), element.mAmount)); - } - - /** - * add to the dropmap the ores from the gagreg space worldgen corresponding to the target dim - * - * @param finalDef ModDimensionDef corresponding to the target dim - */ - private void getDropsOreVeinsSpace(ModDimensionDef finalDef) { - GalacticGreg.oreVeinWorldgenList.stream() - .filter( - gt_worldgen -> gt_worldgen.mEnabled - && gt_worldgen instanceof GT_Worldgen_GT_Ore_Layer_Space oreLayerSpace - && oreLayerSpace.isEnabledForDim(finalDef)) - .map(gt_worldgen -> (GT_Worldgen_GT_Ore_Layer_Space) gt_worldgen).forEach(element -> { - this.addDrop(new Pair<>((int) element.mPrimaryMeta, false), element.mWeight); - this.addDrop(new Pair<>((int) element.mSecondaryMeta, false), element.mWeight); - this.addDrop(new Pair<>((int) element.mSporadicMeta, false), element.mWeight / 8f); - this.addDrop(new Pair<>((int) element.mBetweenMeta, false), element.mWeight / 8f); - }); - } - - /** - * add to the dropmap the small ores from the gagreg space worldgen corresponding to the target dim - * - * @param finalDef ModDimensionDef corresponding to the target dim - */ - private void getDropsSmallOreSpace(ModDimensionDef finalDef) { - GalacticGreg.smallOreWorldgenList.stream() - .filter( - gt_worldgen -> gt_worldgen.mEnabled - && gt_worldgen instanceof GT_Worldgen_GT_Ore_SmallPieces_Space oreSmallPiecesSpace - && oreSmallPiecesSpace.isEnabledForDim(finalDef)) - .map(gt_worldgen -> (GT_Worldgen_GT_Ore_SmallPieces_Space) gt_worldgen) - .forEach(element -> this.addDrop(new Pair<>((int) element.mMeta, false), element.mAmount)); - } - - /** - * method used to pick the next key in the dropmap that will be used to generate the ore. + * method used to pick the next ore in the dropMap. * - * @return the chosen key + * @return the chosen ore */ - private Pair getOreDamage() { - float curentWeight = 0.f; + private ItemStack nextOre() { + float currentWeight = 0.f; while (true) { - float randomnumber = XSTR.XSTR_INSTANCE.nextFloat() * this.totalWeight; - for (Map.Entry, Float> entry : this.dropmap.entrySet()) { - curentWeight += entry.getValue(); - if (randomnumber < curentWeight) return entry.getKey(); + float randomNumber = XSTR.XSTR_INSTANCE.nextFloat() * this.totalWeight; + for (Map.Entry entry : this.dropMap.getInternalMap().entrySet()) { + currentWeight += entry.getValue(); + if (randomNumber < currentWeight) return entry.getKey().getItemStack(); } } } @@ -364,10 +182,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private FluidStack getNobleGasInputAndSetMultiplier() { for (FluidStack s : this.getStoredFluids()) { - for (int i = 0; i < NOBLE_GASSES.length; i++) { - FluidStack ng = NOBLE_GASSES[i]; + for (int i = 0; i < VoidMinerUtility.NOBLE_GASSES.length; i++) { + FluidStack ng = VoidMinerUtility.NOBLE_GASSES[i]; if (ng.isFluidEqual(s)) { - this.multiplier = this.TIER_MULTIPLIER * (2 << (i == NOBLE_GASSES.length - 1 ? i + 2 : i + 1)); + this.multiplier = this.TIER_MULTIPLIER * VoidMinerUtility.NOBEL_GASSES_MULTIPLIER[i]; return s; } } @@ -379,7 +197,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * method used to decrement the quantity of gas in the hatch * * @param gasToConsume the fluid stack in the hatch - * @return if yes or no it was able to decrement the quantity of the fluidstack + * @return if yes or no it was able to decrement the quantity of the fluidStack */ private boolean consumeNobleGas(FluidStack gasToConsume) { for (FluidStack s : this.getStoredFluids()) { @@ -401,143 +219,44 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } /** - * Handles the addition of Ross dims' ores into the drop map - * - * @param aID dim id of Ross128b or Ross128ba - */ - private void getDropMapRoss(int aID) { - Consumer addToList = this.makeAddToList(); - BW_OreLayer.sList.stream() - .filter( - gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_OreLayer - && gt_worldgen.isGenerationAllowed(null, aID, 0)) - .forEach(addToList); - } - - /** - * Method used to generate a consumer used specifically to add BW ores into the dropmap - * - * @return the consumer - */ - private Consumer makeAddToList() { - return element -> { - List> data = element.getStacksRawData(); - for (int i = 0; i < data.size(); i++) { - if (i < data.size() - 2) this.addDrop(data.get(i), element.mWeight); - else this.addDrop(data.get(i), element.mWeight / 8f); - } - }; - } - - /** - * Method used to build the ModDimensionDef object corresponding to the dimension the VM is in. - * - * @return the ModDimensionDef object. - */ - private ModDimensionDef makeModDimDef() { - return getModContainers().stream().flatMap(modContainer -> modContainer.getDimensionList().stream()) - .filter( - modDimensionDef -> modDimensionDef.getChunkProviderName().equals( - ((ChunkProviderServer) this.getBaseMetaTileEntity().getWorld() - .getChunkProvider()).currentChunkProvider.getClass().getName())) - .findFirst().orElse(null); - } - - /** - * Handles the addition of small ores for bartwork dims - * - * @param finalDef the ModDimensionDef object corresponding to the dim - * @param addToList a consumer used to add the ores from the vein with proper weight - */ - private void addOresVeinsBartworks(ModDimensionDef finalDef, Consumer addToList) { - try { - GalacticGreg.oreVeinWorldgenList.stream() - .filter( - gt_worldgen -> gt_worldgen.mEnabled - && gt_worldgen instanceof BW_Worldgen_Ore_Layer_Space oreLayerSpace - && oreLayerSpace.isEnabledForDim(finalDef)) - .map(gt_worldgen -> (BW_Worldgen_Ore_Layer_Space) gt_worldgen).forEach(addToList); - } catch (NullPointerException ignored) {} - } - - /** - * Handles the addition of small ores for bartwork dims - * - * @param finalDef the ModDimensionDef object corresponding to the dim - */ - private void addSmallOresBartworks(ModDimensionDef finalDef) { - try { - GalacticGreg.smallOreWorldgenList.stream() - .filter( - gt_worldgen -> gt_worldgen.mEnabled - && gt_worldgen instanceof BW_Worldgen_Ore_SmallOre_Space smallOreSpace - && smallOreSpace.isEnabledForDim(finalDef)) - .map(gt_worldgen -> (BW_Worldgen_Ore_SmallOre_Space) gt_worldgen).forEach( - element -> this - .addDrop(new Pair<>(element.mPrimaryMeta, element.bwOres != 0), element.mDensity)); - } catch (NullPointerException ignored) {} - } - - /** - * Handles the ores added manually with addMatierialToDimensionList + * Handles the ores added manually with {@link VoidMinerUtility#addMaterialToDimensionList} * * @param id the specified dim id */ private void handleExtraDrops(int id) { - Optional.ofNullable(getExtraDropsDimMap().get(id)).ifPresent(e -> e.forEach(f -> { - Pair key = f.getKey(); - addDrop(key.getValue(), key.getKey(), f.getValue()); - })); + Optional.ofNullable(VoidMinerUtility.extraDropsDimMap.get(id)).ifPresent( + extraDropMap -> extraDropMap.getInternalMap() + .forEach((ItemId, weight) -> this.dropMap.addDrop(ItemId.getItemStack(), weight))); } /** - * Computes the total weight for normalisation - */ - private void calculateTotalWeight() { - this.totalWeight = 0.0f; - this.dropmap.values().forEach(f -> this.totalWeight += f); - } - - /** - * Computes the ores of the dim for the specifed dim id + * Gets the DropMap of the dim for the specified dim id * * @param id the dim number */ private void handleModDimDef(int id) { - // vanilla dims or TF - if (id <= 1 && id >= -1 || id == 7) { - this.getDropsVanillaVeins(this.makeOreLayerPredicate()); - this.getDropsVanillaSmallOres(this.makeSmallOresPredicate()); - - // ross dims - } else if (id == ConfigHandler.ross128BID || id == ConfigHandler.ross128BAID) { - this.getDropMapRoss(id); - - // other space dims + if (VoidMinerUtility.dropMapsByDimId.containsKey(id)) { + this.dropMap = VoidMinerUtility.dropMapsByDimId.get(id).copy(); } else { - Optional.ofNullable(this.makeModDimDef()).ifPresent(def -> { - // normal space dim - this.getDropsOreVeinsSpace(def); - this.getDropsSmallOreSpace(def); - - // BW space dim - Consumer addToList = this.makeAddToList(); - this.addOresVeinsBartworks(def, addToList); - this.addSmallOresBartworks(def); - }); + String chunkProviderName = ((ChunkProviderServer) this.getBaseMetaTileEntity().getWorld() + .getChunkProvider()).currentChunkProvider.getClass().getName(); + + if (VoidMinerUtility.dropMapsByChunkProviderName.containsKey(chunkProviderName)) { + this.dropMap = VoidMinerUtility.dropMapsByChunkProviderName.get(chunkProviderName).copy(); + } } } /** * Computes first the ores related to the dim the VM is in, then the ores added manually, then it computes the - * totalweight for normalisation + * totalWeight for normalisation */ private void calculateDropMap() { - this.dropmap = new HashMap<>(); + this.dropMap = new VoidMinerUtility.DropMap(); int id = this.getBaseMetaTileEntity().getWorld().provider.dimensionId; this.handleModDimDef(id); this.handleExtraDrops(id); - this.calculateTotalWeight(); + this.totalWeight = dropMap.getTotalWeight(); } /** @@ -545,26 +264,16 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private void handleOutputs() { final List inputOres = this.getStoredInputs().stream().filter(GT_Utility::isOre) - .collect(Collectors.toList()); - final ItemStack output = this.getOreItemStack(this.getOreDamage()); + .collect(Collectors.toList());; + final ItemStack output = this.nextOre(); + output.stackSize = multiplier; if (inputOres.size() == 0 - || this.mBlacklist && inputOres.stream().allMatch(is -> !GT_Utility.areStacksEqual(is, output)) + || this.mBlacklist && inputOres.stream().noneMatch(is -> GT_Utility.areStacksEqual(is, output)) || !this.mBlacklist && inputOres.stream().anyMatch(is -> GT_Utility.areStacksEqual(is, output))) this.addOutput(output); this.updateSlots(); } - /** - * Builds the ore item stack from the key specified in the dropmap - * - * @param stats the key of the dropmap - * @return an ItemStack corresponding to the target ore, with a stacksize corresponding to the multiplier induced by - * the gas used - */ - private ItemStack getOreItemStack(Pair stats) { - return new ItemStack(stats.getValue(), this.multiplier, stats.getKey()); - } - @Override public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { this.mBlacklist = !this.mBlacklist; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/VoidMinerUtility.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/VoidMinerUtility.java new file mode 100644 index 0000000000..4aaf466f97 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/VoidMinerUtility.java @@ -0,0 +1,313 @@ +package com.github.bartimaeusnek.crossmod.galacticgreg; + +import static bloodasp.galacticgreg.registry.GalacticGregRegistry.getModContainers; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Predicate; + +import net.minecraft.block.Block; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer; + +import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_Layer_Space; +import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_SmallPieces_Space; +import bloodasp.galacticgreg.GalacticGreg; +import bloodasp.galacticgreg.api.ModContainer; +import bloodasp.galacticgreg.api.ModDimensionDef; +import bloodasp.galacticgreg.bartworks.BW_Worldgen_Ore_Layer_Space; +import bloodasp.galacticgreg.bartworks.BW_Worldgen_Ore_SmallOre_Space; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Worldgen_GT_Ore_Layer; +import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; + +public class VoidMinerUtility { + + public static final FluidStack[] NOBLE_GASSES = { WerkstoffLoader.Neon.getFluidOrGas(1), + WerkstoffLoader.Krypton.getFluidOrGas(1), WerkstoffLoader.Xenon.getFluidOrGas(1), + WerkstoffLoader.Oganesson.getFluidOrGas(1) }; + public static final int[] NOBEL_GASSES_MULTIPLIER = { 4, 8, 16, 64 }; + + public static class DropMap { + + private float totalWeight; + private final Map internalMap; + + public DropMap() { + internalMap = new HashMap<>(); + totalWeight = 0; + } + + /** + * Method used to add an ore to the DropMap + * + * @param weight the non normalised weight + * @param isBWOres true for BW ores, false for GT ores + */ + public void addDrop(int meta, float weight, boolean isBWOres) { + if (isBWOres) { + addDrop(WerkstoffLoader.BWOres, meta, weight); + } else { + addDrop(GregTech_API.sBlockOres1, meta, weight); + } + } + + /** + * Method used to add any item to the DropMap. Will be blocked if blacklisted. + * + * @param weight the non normalised weight + */ + public void addDrop(Block block, int meta, float weight) { + if (ConfigHandler.voidMinerBlacklist.contains( + String.format("%s:%d", GameRegistry.findUniqueIdentifierFor(block).toString(), meta))) + return; + Item item = Item.getItemFromBlock(block); + addDrop(item, meta, weight); + } + + /** + * Method used to add any item to the DropMap. Will be blocked if blacklisted. + * + * @param weight the non normalised weight + */ + public void addDrop(ItemStack itemStack, float weight) { + Item item = itemStack.getItem(); + int meta = Items.feather.getDamage(itemStack); + if (ConfigHandler.voidMinerBlacklist.contains( + String.format( + "%s:%d", + GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(item)).toString(), + meta))) + return; + addDrop(item, meta, weight); + } + + private void addDrop(Item item, int meta, float weight) { + GT_Utility.ItemId ore = GT_Utility.ItemId.createNoCopy(item, meta, null); + internalMap.merge(ore, weight, Float::sum); + totalWeight += weight; + } + + public float getTotalWeight() { + return totalWeight; + } + + public Map getInternalMap() { + return internalMap; + } + + public DropMap copy() { + DropMap result = new DropMap(); + result.internalMap.putAll(internalMap); + result.totalWeight = totalWeight; + return result; + } + } + + public static final Map dropMapsByDimId = new HashMap<>(); + public static final Map dropMapsByChunkProviderName = new HashMap<>(); + public static final Map extraDropsDimMap = new HashMap<>(); + + // Adds tellurium to OW to ensure a way to get it, as it's used in Magneto Resonatic + // Dust and Circuit Compound MK3 Dust + static { + addMaterialToDimensionList(0, Materials.Tellurium, 8.0f); + } + + /** + * Computes the ores of the dims + */ + public static void generateDropMaps() { + // vanilla dims or TF + dropMapsByDimId.put(-1, getDropMapVanilla(-1)); + dropMapsByDimId.put(0, getDropMapVanilla(0)); + dropMapsByDimId.put(1, getDropMapVanilla(1)); + dropMapsByDimId.put(7, getDropMapVanilla(7)); + + // ross dims + dropMapsByDimId.put(ConfigHandler.ross128BID, getDropMapRoss(ConfigHandler.ross128BID)); + dropMapsByDimId.put(ConfigHandler.ross128BAID, getDropMapRoss(ConfigHandler.ross128BAID)); + + // other space dims + for (ModContainer modContainer : getModContainers()) { + for (ModDimensionDef dimDef : modContainer.getDimensionList()) { + dropMapsByChunkProviderName.put(dimDef.getChunkProviderName(), getDropMapSpace(dimDef)); + } + } + } + + /** + * Method to generate a DropMap that contains ores of a vanilla GT worldgen + */ + private static DropMap getDropMapVanilla(int dimId) { + DropMap dropMap = new DropMap(); + + // Ore Veins + Predicate oreLayerPredicate = makeOreLayerPredicate(dimId); + GT_Worldgen_GT_Ore_Layer.sList.stream() + .filter(gt_worldgen -> gt_worldgen.mEnabled && oreLayerPredicate.test(gt_worldgen)).forEach(element -> { + dropMap.addDrop(element.mPrimaryMeta, element.mWeight, false); + dropMap.addDrop(element.mSecondaryMeta, element.mWeight, false); + dropMap.addDrop(element.mSporadicMeta, element.mWeight / 8f, false); + dropMap.addDrop(element.mBetweenMeta, element.mWeight / 8f, false); + }); + + // Small Ores + Predicate smallOresPredicate = makeSmallOresPredicate(dimId); + GT_Worldgen_GT_Ore_SmallPieces.sList.stream() + .filter(gt_worldgen -> gt_worldgen.mEnabled && smallOresPredicate.test(gt_worldgen)) + .forEach(element -> dropMap.addDrop(element.mMeta, element.mAmount, false)); + return dropMap; + } + + /** + * Makes a predicate for the GT normal ore veins worldgen + * + * @return the predicate + */ + private static Predicate makeOreLayerPredicate(int dimensionId) { + return switch (dimensionId) { + case -1 -> gt_worldgen -> gt_worldgen.mNether; + case 0 -> gt_worldgen -> gt_worldgen.mOverworld; + case 1 -> gt_worldgen -> gt_worldgen.mEnd || gt_worldgen.mEndAsteroid; + /* + * explicitly giving different dim numbers so that it default to false in the config, keeping compat with + * the current worldgen config + */ + case 7 -> gt_worldgen -> gt_worldgen.isGenerationAllowed("Twilight Forest", 0, 7); + default -> throw new IllegalStateException(); + }; + } + + /** + * Makes a predicate for the GT normal small ore worldgen + * + * @return the predicate + */ + private static Predicate makeSmallOresPredicate(int dimensionId) { + return switch (dimensionId) { + case -1 -> gt_worldgen -> gt_worldgen.mNether; + case 0 -> gt_worldgen -> gt_worldgen.mOverworld; + case 1 -> gt_worldgen -> gt_worldgen.mEnd; + /* + * explicitly giving different dim numbers so that it default to false in the config, keeping compat with + * the current worldgen config + */ + case 7 -> gt_worldgen -> gt_worldgen.isGenerationAllowed("Twilight Forest", 0, 7); + default -> throw new IllegalStateException(); + }; + } + + /** + * Create a DropMap that contains ores of Ross dims + * + * @param aID dim id of Ross128b or Ross128ba + */ + private static DropMap getDropMapRoss(int aID) { + DropMap dropMap = new DropMap(); + for (BW_OreLayer oreLayer : BW_OreLayer.sList) { + if (oreLayer.mEnabled && oreLayer.isGenerationAllowed("", aID, 0)) { + List data = oreLayer.getStacks(); + dropMap.addDrop(data.get(0), oreLayer.mWeight); + dropMap.addDrop(data.get(1), oreLayer.mWeight); + dropMap.addDrop(data.get(2), oreLayer.mWeight / 8f); + dropMap.addDrop(data.get(3), oreLayer.mWeight / 8f); + } + } + return dropMap; + } + + /** + * Create a DropMap contains the ores from the galacticGreg space worldgen corresponding to the target dim + * + * @param finalDef ModDimensionDef corresponding to the target dim + */ + private static DropMap getDropMapSpace(ModDimensionDef finalDef) { + DropMap dropMap = new DropMap(); + + // Normal Ore Veins + GalacticGreg.oreVeinWorldgenList.stream() + .filter( + gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof GT_Worldgen_GT_Ore_Layer_Space oreLayerSpace + && oreLayerSpace.isEnabledForDim(finalDef)) + .map(gt_worldgen -> (GT_Worldgen_GT_Ore_Layer_Space) gt_worldgen).forEach(element -> { + dropMap.addDrop(element.mPrimaryMeta, element.mWeight, false); + dropMap.addDrop(element.mSecondaryMeta, element.mWeight, false); + dropMap.addDrop(element.mSporadicMeta, element.mWeight / 8f, false); + dropMap.addDrop(element.mBetweenMeta, element.mWeight / 8f, false); + }); + + // Normal Small Ores + GalacticGreg.smallOreWorldgenList.stream() + .filter( + gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof GT_Worldgen_GT_Ore_SmallPieces_Space oreSmallPiecesSpace + && oreSmallPiecesSpace.isEnabledForDim(finalDef)) + .map(gt_worldgen -> (GT_Worldgen_GT_Ore_SmallPieces_Space) gt_worldgen) + .forEach(element -> dropMap.addDrop(element.mMeta, element.mAmount, false)); + + // BW Ore Veins + try { + GalacticGreg.oreVeinWorldgenList.stream() + .filter( + gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof BW_Worldgen_Ore_Layer_Space oreLayerSpace + && oreLayerSpace.isEnabledForDim(finalDef)) + .map(gt_worldgen -> (BW_Worldgen_Ore_Layer_Space) gt_worldgen).forEach(oreLayer -> { + List data = oreLayer.getStacks(); + dropMap.addDrop(data.get(0), oreLayer.mWeight); + dropMap.addDrop(data.get(1), oreLayer.mWeight); + dropMap.addDrop(data.get(2), oreLayer.mWeight / 8f); + dropMap.addDrop(data.get(3), oreLayer.mWeight / 8f); + }); + } catch (NullPointerException ignored) {} + + // BW Small Ores + try { + GalacticGreg.smallOreWorldgenList.stream() + .filter( + gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof BW_Worldgen_Ore_SmallOre_Space smallOreSpace + && smallOreSpace.isEnabledForDim(finalDef)) + .map(gt_worldgen -> (BW_Worldgen_Ore_SmallOre_Space) gt_worldgen) + .forEach(element -> dropMap.addDrop(element.mPrimaryMeta, element.mDensity, element.bwOres != 0)); + } catch (NullPointerException ignored) {} + return dropMap; + } + + public static void addBlockToDimensionList(int dimId, Block block, int meta, float weight) { + if (!extraDropsDimMap.containsKey(dimId)) { + extraDropsDimMap.put(dimId, new DropMap()); + } + extraDropsDimMap.get(dimId).addDrop(block, meta, weight); + } + + /** + * Public method giving other mods the ability to add manually a material with an ore version into the external + * dropMap for a specified dim id + * + * @param DimensionID the dim id targeted + * @param Material the material with an ore version + * @param weight the non normalised version of the given weight + */ + public static void addMaterialToDimensionList(int DimensionID, ISubTagContainer Material, float weight) { + if (Material instanceof Materials gtMaterial) { + addBlockToDimensionList(DimensionID, GregTech_API.sBlockOres1, gtMaterial.mMetaItemSubID, weight); + } else if (Material instanceof Werkstoff werkstoff) { + addBlockToDimensionList(DimensionID, WerkstoffLoader.BWOres, werkstoff.getmID(), weight); + } + } +} -- cgit From 2ab19c1ef4f966b58990bd68f9d77d0444d82034 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sun, 19 May 2024 11:57:53 +0200 Subject: update --- dependencies.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index e2721907ae..a4f45889e1 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -5,13 +5,13 @@ dependencies { runtimeOnlyNonPublishable('com.github.GTNewHorizons:waila:1.7.3:dev') compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha50:api') { transitive = false } - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.16:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.18:dev') api("com.github.GTNewHorizons:TecTech:5.4.0:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } api("com.github.GTNewHorizons:Avaritia:1.49:dev") - implementation("com.github.GTNewHorizons:TinkersConstruct:1.12.0-GTNH:dev") + implementation("com.github.GTNewHorizons:TinkersConstruct:1.12.1-GTNH:dev") compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.25:deobf") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.11-GTNH:api") {transitive = false} -- cgit From 987d88020f87adbc709385ce70edd645fce01b57 Mon Sep 17 00:00:00 2001 From: HoleFish <48403212+HoleFish@users.noreply.github.com> Date: Mon, 20 May 2024 18:09:57 +0800 Subject: no allocation (#12) --- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 19 ++++++++++++------- .../crossmod/galacticgreg/VoidMinerUtility.java | 10 ++-------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index b8631f063d..6e2f133ddd 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -23,7 +23,6 @@ import static gregtech.api.enums.GT_Values.VN; import java.util.List; import java.util.Map; -import java.util.Optional; import java.util.stream.Collectors; import net.minecraft.block.Block; @@ -47,6 +46,7 @@ import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_DrillerBase { private VoidMinerUtility.DropMap dropMap = null; + private VoidMinerUtility.DropMap extraDropMap = null; private float totalWeight; private int multiplier = 1; @@ -172,6 +172,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri currentWeight += entry.getValue(); if (randomNumber < currentWeight) return entry.getKey().getItemStack(); } + for (Map.Entry entry : this.extraDropMap.getInternalMap().entrySet()) { + currentWeight += entry.getValue(); + if (randomNumber < currentWeight) return entry.getKey().getItemStack(); + } } } @@ -224,9 +228,9 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @param id the specified dim id */ private void handleExtraDrops(int id) { - Optional.ofNullable(VoidMinerUtility.extraDropsDimMap.get(id)).ifPresent( - extraDropMap -> extraDropMap.getInternalMap() - .forEach((ItemId, weight) -> this.dropMap.addDrop(ItemId.getItemStack(), weight))); + if (VoidMinerUtility.extraDropsDimMap.containsKey(id)) { + extraDropMap = VoidMinerUtility.extraDropsDimMap.get(id); + } } /** @@ -236,13 +240,13 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private void handleModDimDef(int id) { if (VoidMinerUtility.dropMapsByDimId.containsKey(id)) { - this.dropMap = VoidMinerUtility.dropMapsByDimId.get(id).copy(); + this.dropMap = VoidMinerUtility.dropMapsByDimId.get(id); } else { String chunkProviderName = ((ChunkProviderServer) this.getBaseMetaTileEntity().getWorld() .getChunkProvider()).currentChunkProvider.getClass().getName(); if (VoidMinerUtility.dropMapsByChunkProviderName.containsKey(chunkProviderName)) { - this.dropMap = VoidMinerUtility.dropMapsByChunkProviderName.get(chunkProviderName).copy(); + this.dropMap = VoidMinerUtility.dropMapsByChunkProviderName.get(chunkProviderName); } } } @@ -253,10 +257,11 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private void calculateDropMap() { this.dropMap = new VoidMinerUtility.DropMap(); + this.extraDropMap = new VoidMinerUtility.DropMap(); int id = this.getBaseMetaTileEntity().getWorld().provider.dimensionId; this.handleModDimDef(id); this.handleExtraDrops(id); - this.totalWeight = dropMap.getTotalWeight(); + this.totalWeight = dropMap.getTotalWeight() + extraDropMap.getTotalWeight(); } /** diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/VoidMinerUtility.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/VoidMinerUtility.java index 4aaf466f97..7d4b205426 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/VoidMinerUtility.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/VoidMinerUtility.java @@ -107,13 +107,6 @@ public class VoidMinerUtility { public Map getInternalMap() { return internalMap; } - - public DropMap copy() { - DropMap result = new DropMap(); - result.internalMap.putAll(internalMap); - result.totalWeight = totalWeight; - return result; - } } public static final Map dropMapsByDimId = new HashMap<>(); @@ -130,10 +123,11 @@ public class VoidMinerUtility { * Computes the ores of the dims */ public static void generateDropMaps() { - // vanilla dims or TF + // vanilla dims dropMapsByDimId.put(-1, getDropMapVanilla(-1)); dropMapsByDimId.put(0, getDropMapVanilla(0)); dropMapsByDimId.put(1, getDropMapVanilla(1)); + // Twilight Forest dropMapsByDimId.put(7, getDropMapVanilla(7)); // ross dims -- cgit From 5df2d9debbb2785a54e4ef63c11ddc3593d3fba5 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Mon, 20 May 2024 12:10:34 +0200 Subject: update --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index a4f45889e1..3b46a7a621 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -6,7 +6,7 @@ dependencies { compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha50:api') { transitive = false } api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.18:dev') - api("com.github.GTNewHorizons:TecTech:5.4.0:dev") + api("com.github.GTNewHorizons:TecTech:5.4.2:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" } -- cgit From 5a0ef92140eea89f69c531033fd78dd3cbb48a00 Mon Sep 17 00:00:00 2001 From: NotAPenguin Date: Wed, 22 May 2024 19:09:28 +0200 Subject: fix bismuth telluride naming (#13) --- .../bartimaeusnek/bartworks/system/material/WerkstoffLoader.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 19e7437524..ebae7763c5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -556,7 +556,9 @@ public class WerkstoffLoader { ); public static final Werkstoff BismuthTellurite = new Werkstoff( new short[] { 32, 72, 32, 0 }, - "Bismuth Tellurite", + // Telluride is correct, tellurite is not. + // Only the display name gets renamed to avoid problems in other mods + "Bismuth Telluride", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), -- cgit From f69b4802390464c3b93d5a10a427fa5285375489 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Wed, 22 May 2024 22:05:09 +0200 Subject: Add rawOre processing to PlatinumOverhaul and add ore drops (#10) * Add rawOre to PlatinumOverhaul * Implement rawores * update deps for use right version * update * Moved drops code and implement isNatural check. * update * Removed duplicate entry It gets it from super. * update * update * update * Update the Random code * fixed * Implement Silk Touch * Update dependencies.gradle --------- Co-authored-by: Ethryan <3237986+Ethryan@users.noreply.github.com> --- dependencies.gradle | 5 +- .../system/material/BW_MetaGeneratedOreTE.java | 73 ++++++++++++++++++++++ .../system/material/BW_MetaGenerated_Block_TE.java | 4 +- .../system/material/BW_MetaGenerated_Ores.java | 25 ++++++++ .../GT_Enhancement/PlatinumSludgeOverHaul.java | 11 ++-- .../bartworks/system/material/Werkstoff.java | 1 + .../bartworks/system/material/WerkstoffLoader.java | 7 ++- .../werkstoff_loaders/recipe/RawOreLoader.java | 58 +++++++++++++++++ 8 files changed, 174 insertions(+), 10 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/RawOreLoader.java diff --git a/dependencies.gradle b/dependencies.gradle index 3b46a7a621..72b8fcc15b 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -5,7 +5,8 @@ dependencies { runtimeOnlyNonPublishable('com.github.GTNewHorizons:waila:1.7.3:dev') compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha50:api') { transitive = false } - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.18:dev') + + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.23:dev') api("com.github.GTNewHorizons:TecTech:5.4.2:dev") api("com.github.GTNewHorizons:GalacticGregGT5:1.1.0:dev") { exclude group:"com.github.GTNewHorizons", module:"bartworks" @@ -13,6 +14,6 @@ dependencies { api("com.github.GTNewHorizons:Avaritia:1.49:dev") implementation("com.github.GTNewHorizons:TinkersConstruct:1.12.1-GTNH:dev") - compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.25:deobf") {transitive = false} + compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.26:deobf") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.10.11-GTNH:api") {transitive = false} } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index f4bf46dbe0..c53ef3f523 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -13,16 +13,40 @@ package com.github.bartimaeusnek.bartworks.system.material; +import java.util.ArrayList; +import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; +import gregtech.GT_Mod; +import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_OreDictUnificator; public class BW_MetaGeneratedOreTE extends BW_MetaGenerated_Block_TE { + protected static boolean shouldFortune = false; + protected static boolean shouldSilkTouch = false; + public boolean mNatural = false; + + @Override + public void readFromNBT(NBTTagCompound aNBT) { + super.readFromNBT(aNBT); + this.mNatural = aNBT.getBoolean("n"); + } + + @Override + public void writeToNBT(NBTTagCompound aNBT) { + super.writeToNBT(aNBT); + aNBT.setBoolean("n", this.mNatural); + } + @Override public ITexture[] getTexture(Block aBlock, ForgeDirection side) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); @@ -39,4 +63,53 @@ public class BW_MetaGeneratedOreTE extends BW_MetaGenerated_Block_TE { protected Block GetProperBlock() { return WerkstoffLoader.BWOres; } + + @Override + public ArrayList getDrops(int aFortune) { + ArrayList rList = new ArrayList<>(); + if (this.mMetaData <= 0) { + rList.add(new ItemStack(Blocks.cobblestone, 1, 0)); + return rList; + } + Materials aOreMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData).getBridgeMaterial(); + if (shouldSilkTouch) { + rList.add(new ItemStack(this.GetProperBlock(), 1, this.mMetaData)); + } else { + switch (GT_Mod.gregtechproxy.oreDropSystem) { + case Item -> { + rList.add(GT_OreDictUnificator.get(OrePrefixes.rawOre, aOreMaterial, 1)); + } + case FortuneItem -> { + // if shouldFortune and isNatural then get fortune drops + // if not shouldFortune or not isNatural then get normal drops + // if not shouldFortune and isNatural then get normal drops + // if shouldFortune and not isNatural then get normal drops + if (shouldFortune && this.mNatural && aFortune > 0) { + int aMinAmount = 1; + // Max applicable fortune + if (aFortune > 3) aFortune = 3; + long amount = (long) new Random().nextInt(aFortune) + aMinAmount; + for (int i = 0; i < amount; i++) { + rList.add(GT_OreDictUnificator.get(OrePrefixes.rawOre, aOreMaterial, 1)); + } + } else { + rList.add(GT_OreDictUnificator.get(OrePrefixes.rawOre, aOreMaterial, 1)); + } + } + case UnifiedBlock -> { + // Unified ore + rList.add(new ItemStack(this.GetProperBlock(), 1, this.mMetaData)); + } + case PerDimBlock -> { + // Per Dimension ore + rList.add(new ItemStack(this.GetProperBlock(), 1, this.mMetaData)); + } + case Block -> { + // Regular ore + rList.add(new ItemStack(this.GetProperBlock(), 1, this.mMetaData)); + } + } + } + return rList; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java index 5aba6c84a1..e29de514a5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java @@ -45,8 +45,8 @@ public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements IT @Override public void writeToNBT(NBTTagCompound aNBT) { - aNBT.setShort("m", this.mMetaData); super.writeToNBT(aNBT); + aNBT.setShort("m", this.mMetaData); } @Override @@ -63,7 +63,7 @@ public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements IT public ArrayList getDrops(int aFortune) { ArrayList rList = new ArrayList<>(); - if (this.mMetaData < 0) { + if (this.mMetaData <= 0) { rList.add(new ItemStack(Blocks.cobblestone, 1, 0)); return rList; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 08251573b3..7f1e56607f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -19,6 +19,8 @@ import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -26,6 +28,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.common.util.FakePlayer; import com.github.bartimaeusnek.bartworks.util.MathUtils; @@ -71,6 +74,7 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity instanceof BW_MetaGeneratedOreTE metaTE) { metaTE.mMetaData = (short) aMetaData; + metaTE.mNatural = true; } return true; @@ -105,4 +109,25 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { } } } + + @Override + public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) { + if (EnchantmentHelper.getSilkTouchModifier(player)) { + BW_MetaGeneratedOreTE.shouldSilkTouch = true; + super.harvestBlock(worldIn, player, x, y, z, meta); + + if (BW_MetaGeneratedOreTE.shouldSilkTouch) { + BW_MetaGeneratedOreTE.shouldSilkTouch = false; + } + return; + } + + if (!(player instanceof FakePlayer)) { + BW_MetaGeneratedOreTE.shouldFortune = true; + } + super.harvestBlock(worldIn, player, x, y, z, meta); + if (BW_MetaGeneratedOreTE.shouldFortune) { + BW_MetaGeneratedOreTE.shouldFortune = false; + } + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index b8fdac7497..5db1bcdf56 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -73,6 +73,7 @@ import static gregtech.api.enums.OrePrefixes.dustSmall; import static gregtech.api.enums.OrePrefixes.dustTiny; import static gregtech.api.enums.OrePrefixes.ingot; import static gregtech.api.enums.OrePrefixes.nugget; +import static gregtech.api.enums.OrePrefixes.rawOre; import static gregtech.api.recipe.RecipeMaps.blastFurnaceRecipes; import static gregtech.api.recipe.RecipeMaps.centrifugeRecipes; import static gregtech.api.recipe.RecipeMaps.fluidHeaterRecipes; @@ -922,10 +923,12 @@ public class PlatinumSludgeOverHaul { if (stack.getItem() instanceof GT_Generic_Item) { if (!BW_Util.checkStackAndPrefix(stack)) return false; - return !Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST) - .contains(GT_OreDictUnificator.getAssociation(stack).mPrefix) - || Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST) - .contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); + if (GT_OreDictUnificator.getAssociation(stack).mPrefix != rawOre) { + return !Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST) + .contains(GT_OreDictUnificator.getAssociation(stack).mPrefix) + || Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST) + .contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); + } } if (GTPlusPlus.isModLoaded()) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 5d6e82a929..8b215e3d36 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -710,6 +710,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushed, 0b1000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedPurified, 0b1000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.crushedCentrifuged, 0b1000); + Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.rawOre, 0b1000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.cell, 0b10000); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.capsule, 0b10000); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index ebae7763c5..338b18eff1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -55,6 +55,7 @@ import static gregtech.api.enums.OrePrefixes.plateDouble; import static gregtech.api.enums.OrePrefixes.plateQuadruple; import static gregtech.api.enums.OrePrefixes.plateQuintuple; import static gregtech.api.enums.OrePrefixes.plateTriple; +import static gregtech.api.enums.OrePrefixes.rawOre; import static gregtech.api.enums.OrePrefixes.ring; import static gregtech.api.enums.OrePrefixes.rotor; import static gregtech.api.enums.OrePrefixes.screw; @@ -108,6 +109,7 @@ import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.reci import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.MoltenCellLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.MultipleMetalLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.OreLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.RawOreLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.SimpleMetalLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe.ToolLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration.AssociationLoader; @@ -1498,8 +1500,8 @@ public class WerkstoffLoader { IWerkstoffRunnable[] werkstoffRunnables = { new ToolLoader(), new DustLoader(), new GemLoader(), new SimpleMetalLoader(), new CasingLoader(), new AspectLoader(), new OreLoader(), - new CrushedLoader(), new CraftingMaterialLoader(), new CellLoader(), new MoltenCellLoader(), - new MultipleMetalLoader(), new MetalLoader(), new BlockLoader() }; + new RawOreLoader(), new CrushedLoader(), new CraftingMaterialLoader(), new CellLoader(), + new MoltenCellLoader(), new MultipleMetalLoader(), new MetalLoader(), new BlockLoader() }; long timepreone = 0; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { @@ -1686,6 +1688,7 @@ public class WerkstoffLoader { WerkstoffLoader.items.put(crushedCentrifuged, new BW_MetaGenerated_Items(crushedCentrifuged)); WerkstoffLoader.items.put(dustPure, new BW_MetaGenerated_Items(dustPure)); WerkstoffLoader.items.put(dustImpure, new BW_MetaGenerated_Items(dustImpure)); + WerkstoffLoader.items.put(rawOre, new BW_MetaGenerated_Items(rawOre)); } if ((WerkstoffLoader.toGenerateGlobal & 0b10000) != 0) { WerkstoffLoader.items.put(cell, new BW_MetaGenerated_Items(cell)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/RawOreLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/RawOreLoader.java new file mode 100644 index 0000000000..f48d070d2e --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/RawOreLoader.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; + +import static gregtech.api.enums.OrePrefixes.crushed; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.gem; +import static gregtech.api.enums.OrePrefixes.ingot; +import static gregtech.api.enums.OrePrefixes.rawOre; +import static gregtech.api.recipe.RecipeMaps.hammerRecipes; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; + +import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; +import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.SubTag; +import gregtech.api.util.GT_ModHandler; + +public class RawOreLoader implements IWerkstoffRunnable { + + @Override + public void run(Werkstoff werkstoff) { + if (werkstoff.hasItemType(rawOre) && werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) + GT_ModHandler.addSmeltingRecipe( + WerkstoffLoader.getCorrespondingItemStack(rawOre, werkstoff), + werkstoff.get(ingot)); + + if (werkstoff.hasItemType(rawOre)) { + + GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(rawOre)) + .itemOutputs(werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(crushed)) + .duration(16 * TICKS).eut(10).addTo(hammerRecipes); + + GT_ModHandler.addPulverisationRecipe( + werkstoff.get(rawOre), + werkstoff.get(crushed, 2), + werkstoff.contains(SubTag.CRYSTAL) ? werkstoff.get(gem) : werkstoff.getOreByProduct(0, dust), + werkstoff.getNoOfByProducts() > 0 ? 5 : 0, + Materials.Stone.getDust(1), + 50, + true); + } + } +} -- cgit From fc1c9e3577d908bc16e7ed35375991893f309002 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Wed, 22 May 2024 22:07:08 +0200 Subject: update --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 72b8fcc15b..1c63563399 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,7 +2,7 @@ dependencies { runtimeOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.6.0-GTNH:dev') - runtimeOnlyNonPublishable('com.github.GTNewHorizons:waila:1.7.3:dev') + runtimeOnlyNonPublishable('com.github.GTNewHorizons:waila:1.8.0:dev') compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha50:api') { transitive = false } -- cgit From 9c07ac0bffe24963f4fd6f44d148e3dcea5b2fd7 Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Fri, 24 May 2024 19:00:07 +0100 Subject: Apply updated GT5 spotless config --- gradle.properties | 2 +- .../bartworks/API/BioObjectAdder.java | 57 +- .../bartworks/API/BioRecipeAdder.java | 74 +- .../bartworks/API/BioVatLogicAdder.java | 102 +- .../bartworks/API/BorosilicateGlass.java | 37 +- .../bartimaeusnek/bartworks/API/SideReference.java | 16 +- .../bartimaeusnek/bartworks/API/WerkstoffAPI.java | 3 +- .../bartworks/API/modularUI/BW_UITextures.java | 33 +- .../bartworks/API/recipe/BacterialVatFrontend.java | 22 +- .../bartworks/API/recipe/BartWorksRecipeMaps.java | 111 +- .../bartworks/API/recipe/DynamicGTRecipe.java | 24 +- .../bartworks/API/recipe/RadioHatchFrontend.java | 8 +- .../bartimaeusnek/bartworks/ASM/BWCorePlugin.java | 3 +- .../ASM/BWCoreStaticReplacementMethodes.java | 12 +- .../bartworks/ASM/BWCoreTransformer.java | 55 +- .../github/bartimaeusnek/bartworks/MainMod.java | 40 +- .../client/ClientEventHandler/TooltipCache.java | 3 +- .../ClientEventHandler/TooltipEventHandler.java | 61 +- .../bartworks/client/creativetabs/BioTab.java | 3 +- .../client/gui/BW_GUIContainer_RotorBlock.java | 41 +- .../client/renderer/BW_EICPistonVisualizer.java | 16 +- .../client/renderer/BW_GT_ItemRenderer.java | 58 +- .../client/renderer/BW_Renderer_Block_Ores.java | 96 +- .../renderer/RendererSwitchingColorFluid.java | 78 +- .../client/textures/PrefixTextureLinker.java | 61 +- .../bartworks/common/blocks/BW_GlasBlocks.java | 4 +- .../bartworks/common/blocks/BW_GlasBlocks2.java | 14 +- .../common/blocks/BW_TileEntityContainer.java | 47 +- .../BW_TileEntityContainer_MachineBlock.java | 2 +- .../blocks/BW_TileEntityContainer_Multiple.java | 7 +- .../common/commands/PrintRecipeListToFile.java | 20 +- .../bartworks/common/commands/RunGC.java | 3 +- .../bartworks/common/commands/SummonRuin.java | 10 +- .../bartworks/common/configs/ConfigHandler.java | 288 +-- .../bartworks/common/items/BW_ItemBlocks.java | 10 +- .../bartworks/common/items/BW_SimpleWindMeter.java | 26 +- .../bartworks/common/items/BW_Stonage_Rotors.java | 13 +- .../bartworks/common/items/Circuit_Programmer.java | 57 +- .../common/items/GT_Destructopack_Item.java | 9 +- .../bartworks/common/items/GT_Rockcutter_Item.java | 31 +- .../bartworks/common/items/GT_Teslastaff_Item.java | 4 +- .../bartworks/common/items/LabParts.java | 46 +- .../common/loaders/ArtificialMicaLine.java | 213 +- .../bartworks/common/loaders/BeforeGTPreload.java | 31 +- .../bartworks/common/loaders/BioCultureLoader.java | 90 +- .../bartworks/common/loaders/BioItemList.java | 12 +- .../bartworks/common/loaders/BioRecipeLoader.java | 209 +- .../ElectricImplosionCompressorRecipes.java | 224 +- .../bartworks/common/loaders/FluidLoader.java | 79 +- .../bartworks/common/loaders/ItemRegistry.java | 438 ++-- .../common/loaders/LocalisationLoader.java | 38 +- .../common/loaders/RadioHatchMaterialLoader.java | 241 +- .../bartworks/common/loaders/RecipeLoader.java | 2 +- .../common/loaders/StaticRecipeChangeLoaders.java | 310 +-- .../common/loaders/recipes/Assembler.java | 323 +-- .../common/loaders/recipes/AssemblyLine.java | 89 +- .../common/loaders/recipes/Autoclave.java | 24 +- .../common/loaders/recipes/Centrifuge.java | 140 +- .../common/loaders/recipes/ChemicalBath.java | 87 +- .../common/loaders/recipes/ChemicalReactor.java | 11 +- .../common/loaders/recipes/CraftingRecipes.java | 590 +++-- .../common/loaders/recipes/Electrolyzer.java | 204 +- .../common/loaders/recipes/Extractor.java | 18 +- .../common/loaders/recipes/FluidHeater.java | 11 +- .../common/loaders/recipes/FluidSolidifier.java | 128 +- .../common/loaders/recipes/FormingPress.java | 70 +- .../common/loaders/recipes/LaserEngraver.java | 9 +- .../bartworks/common/loaders/recipes/Mixer.java | 39 +- .../common/loaders/recipes/Pulverizer.java | 110 +- .../common/loaders/recipes/PyrolyseOven.java | 14 +- .../bartworks/common/net/BW_Network.java | 75 +- .../common/net/CircuitProgrammerPacket.java | 16 +- .../bartworks/common/net/MetaBlockPacket.java | 32 +- .../bartworks/common/net/OreDictCachePacket.java | 9 +- .../bartworks/common/net/RendererPacket.java | 29 +- .../bartworks/common/net/ServerJoinedPackage.java | 2 +- .../BW_TileEntity_ExperimentalFloodGate.java | 12 +- .../classic/BW_TileEntity_HeatedWaterPump.java | 121 +- .../classic/BW_TileEntity_InfinityTank.java | 21 +- .../tileentities/multis/GT_TileEntity_BioVat.java | 467 ++-- .../multis/GT_TileEntity_CircuitAssemblyLine.java | 289 ++- .../tileentities/multis/GT_TileEntity_DEHP.java | 124 +- .../GT_TileEntity_ElectricImplosionCompressor.java | 279 ++- .../tileentities/multis/GT_TileEntity_HTGR.java | 323 ++- .../tileentities/multis/GT_TileEntity_LESU.java | 293 ++- .../multis/GT_TileEntity_ManualTrafo.java | 199 +- .../tileentities/multis/GT_TileEntity_THTR.java | 235 +- .../multis/GT_TileEntity_Windmill.java | 363 +-- .../mega/GT_TileEntity_MegaBlastFurnace.java | 173 +- .../mega/GT_TileEntity_MegaChemicalReactor.java | 140 +- .../mega/GT_TileEntity_MegaDistillTower.java | 317 +-- .../mega/GT_TileEntity_MegaMultiBlockBase.java | 133 +- .../multis/mega/GT_TileEntity_MegaOilCracker.java | 204 +- .../mega/GT_TileEntity_MegaVacuumFreezer.java | 187 +- .../tiered/GT_MetaTileEntity_AcidGenerator.java | 72 +- .../tiered/GT_MetaTileEntity_BioLab.java | 363 ++- .../GT_MetaTileEntity_CompressedFluidHatch.java | 10 +- .../tiered/GT_MetaTileEntity_Diode.java | 47 +- .../GT_MetaTileEntity_EnergyDistributor.java | 22 +- .../tiered/GT_MetaTileEntity_GiantOutputHatch.java | 2 +- .../GT_MetaTileEntity_HumongousInputHatch.java | 10 +- .../tiered/GT_MetaTileEntity_RadioHatch.java | 298 +-- .../tiered/GT_MetaTileEntity_Transistor.java | 36 +- .../bartworks/neiHandler/BW_NEI_BioLabHandler.java | 16 +- .../bartworks/neiHandler/BW_NEI_BioVatHandler.java | 15 +- .../bartworks/neiHandler/BW_NEI_OreHandler.java | 117 +- .../bartworks/neiHandler/NEI_BW_Config.java | 41 +- .../server/EventHandler/ServerEventHandler.java | 5 +- .../system/material/BW_GT_MaterialReference.java | 116 +- .../material/BW_MetaGeneratedBlock_Item.java | 4 +- .../material/BW_MetaGeneratedBlocks_Casing.java | 29 +- .../BW_MetaGeneratedBlocks_CasingAdvanced_TE.java | 8 +- .../material/BW_MetaGeneratedBlocks_Casing_TE.java | 8 +- .../system/material/BW_MetaGeneratedFrames.java | 27 +- .../system/material/BW_MetaGeneratedOreTE.java | 7 +- .../material/BW_MetaGeneratedSmallOreTE.java | 45 +- .../system/material/BW_MetaGenerated_Block_TE.java | 8 +- .../system/material/BW_MetaGenerated_Blocks.java | 10 +- .../system/material/BW_MetaGenerated_Items.java | 59 +- .../system/material/BW_MetaGenerated_Ores.java | 13 +- .../material/BW_MetaGenerated_SmallOres.java | 11 +- .../BW_MetaGenerated_WerkstoffBlock_TE.java | 7 +- .../material/BW_MetaGenerated_WerkstoffBlocks.java | 11 +- .../system/material/BW_NonMeta_MaterialItems.java | 4 +- .../material/CircuitGeneration/BW_Meta_Items.java | 96 +- .../material/CircuitGeneration/CircuitData.java | 12 +- .../CircuitGeneration/CircuitImprintLoader.java | 200 +- .../CircuitGeneration/CircuitPartLoader.java | 207 +- .../material/GT_Enhancement/BWGTMetaItems.java | 26 +- .../GT_Enhancement/GTMetaItemEnhancer.java | 63 +- .../GT_Enhancement/PlatinumSludgeOverHaul.java | 1124 +++++---- .../bartworks/system/material/Werkstoff.java | 308 +-- .../bartworks/system/material/WerkstoffLoader.java | 2501 +++++++++++--------- .../material/processingLoaders/AddSomeRecipes.java | 98 +- .../processingLoaders/AdditionalRecipes.java | 853 +++---- .../material/processingLoaders/DownTierLoader.java | 29 +- .../processingLoaders/LoadItemContainers.java | 88 +- .../werkstoff_loaders/recipe/AspectLoader.java | 21 +- .../werkstoff_loaders/recipe/BlockLoader.java | 32 +- .../werkstoff_loaders/recipe/CasingLoader.java | 37 +- .../werkstoff_loaders/recipe/CellLoader.java | 264 ++- .../recipe/CraftingMaterialLoader.java | 242 +- .../werkstoff_loaders/recipe/CrushedLoader.java | 289 ++- .../werkstoff_loaders/recipe/DustLoader.java | 493 ++-- .../werkstoff_loaders/recipe/GemLoader.java | 327 ++- .../werkstoff_loaders/recipe/MetalLoader.java | 36 +- .../werkstoff_loaders/recipe/MoltenCellLoader.java | 367 ++- .../recipe/MultipleMetalLoader.java | 39 +- .../werkstoff_loaders/recipe/OreLoader.java | 29 +- .../werkstoff_loaders/recipe/RawOreLoader.java | 32 +- .../recipe/SimpleMetalLoader.java | 256 +- .../werkstoff_loaders/recipe/ToolLoader.java | 909 +++---- .../registration/BridgeMaterialsLoader.java | 147 +- .../registration/CasingRegistrator.java | 16 +- .../bartworks/system/oredict/OreDictHandler.java | 31 +- .../bartworks/system/oregen/BW_OreLayer.java | 107 +- .../bartworks/system/oregen/BW_WordGenerator.java | 34 +- .../system/oregen/BW_WorldGenRoss128b.java | 213 +- .../system/oregen/BW_WorldGenRoss128ba.java | 220 +- .../bartworks/system/worldgen/MapGenRuins.java | 262 +- .../bartimaeusnek/bartworks/util/BWRecipes.java | 210 +- .../bartimaeusnek/bartworks/util/BW_ColorUtil.java | 9 +- .../bartworks/util/BW_Tooltip_Reference.java | 15 +- .../bartimaeusnek/bartworks/util/BW_Util.java | 152 +- .../bartimaeusnek/bartworks/util/BioCulture.java | 104 +- .../bartimaeusnek/bartworks/util/BioData.java | 28 +- .../bartworks/util/CachedReflectionUtils.java | 6 +- .../bartworks/util/ConnectedBlocksChecker.java | 72 +- .../util/ConnectedBlocksCheckerIteration.java | 54 +- .../bartimaeusnek/bartworks/util/EnumUtils.java | 38 +- .../bartimaeusnek/bartworks/util/MurmurHash3.java | 18 +- .../bartworks/util/NoiseUtil/BartsNoise.java | 14 +- .../bartworks/util/NoiseUtil/SimplexNoise.java | 41 +- .../bartworks/util/NonNullWrappedHashMap.java | 5 +- .../github/bartimaeusnek/bartworks/util/Pair.java | 11 +- .../bartworks/util/RecipeFinderForParallel.java | 9 +- .../bartworks/util/ResultWrongSievert.java | 9 +- .../bartimaeusnek/bartworks/util/StreamUtils.java | 4 +- .../accessprioritylist/AccessPriorityList.java | 6 +- .../AccessPriorityListIterators.java | 2 +- .../bartimaeusnek/bartworks/util/log/DebugLog.java | 10 +- .../bartimaeusnek/crossmod/BartWorksCrossmod.java | 26 +- .../crossmod/GTpp/loader/RadioHatchCompat.java | 50 +- .../bartimaeusnek/crossmod/cls/CLSCompat.java | 32 +- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 85 +- .../crossmod/galacticgreg/VoidMinerUtility.java | 107 +- .../crossmod/galacticraft/GalacticraftProxy.java | 2 +- .../atmosphere/BWAtmosphereManager.java | 31 +- .../planets/AbstractWorldProviderSpace.java | 3 +- .../planets/ross128b/ChunkProviderRoss128b.java | 22 +- .../planets/ross128b/SkyProviderRoss128b.java | 2 +- .../planets/ross128ba/ChunkProviderRoss128ba.java | 2 +- .../solarsystems/Ross128SolarSystem.java | 26 +- .../crossmod/openComputers/GT_NBT_DataBase.java | 8 +- .../openComputers/TileEntity_GTDataServer.java | 31 +- .../crossmod/tectech/TecTechResearchLoader.java | 93 +- .../tectech/tileentites/tiered/LowPowerLaser.java | 27 +- .../tiered/TT_Abstract_LowPowerLaserThingy.java | 17 +- .../tiered/TT_MetaTileEntity_LowPowerLaserBox.java | 77 +- .../TT_MetaTileEntity_LowPowerLaserDynamo.java | 28 +- .../TT_MetaTileEntity_LowPowerLaserHatch.java | 28 +- .../TT_MetaTileEntity_Pipe_Energy_LowPower.java | 72 +- .../crossmod/tgregworks/MaterialsInjector.java | 37 +- .../tile/GT_Multi_IndustrialCrucible.java | 2 +- .../crossmod/thaumcraft/tile/GT_WandBuffer.java | 6 +- .../thaumcraft/util/ThaumcraftHandler.java | 59 +- 206 files changed, 12490 insertions(+), 10033 deletions(-) diff --git a/gradle.properties b/gradle.properties index fcd5f9f406..0c29462f28 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ # ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable. # LOCAL to test local config updates. -gtnh.settings.blowdryerTag = 0.2.0 +gtnh.settings.blowdryerTag = 0.2.2 # Human-readable mod name, available for mcmod.info population. modName = BartWorks diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java index 4d28c5fb46..2eee530a70 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -47,12 +47,12 @@ public final class BioObjectAdder { * @return */ public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, - EnumRarity rarity, boolean breedable) { + EnumRarity rarity, boolean breedable) { if (BioCulture.BIO_CULTURE_ARRAY_LIST.size() > 1) return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, rarity, breedable); new Exception( - "Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!") - .printStackTrace(); + "Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -67,12 +67,12 @@ public final class BioObjectAdder { * @return */ public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, - boolean breedable) { + boolean breedable) { if (BioCulture.BIO_CULTURE_ARRAY_LIST.size() > 1) return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, breedable); new Exception( - "Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!") - .printStackTrace(); + "Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -89,7 +89,7 @@ public final class BioObjectAdder { if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) return BioData.createAndRegisterBioData(aName, rarity, chance, tier); new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!") - .printStackTrace(); + .printStackTrace(); return null; } @@ -103,7 +103,7 @@ public final class BioObjectAdder { public static BioDNA createAndRegisterBioDNA(String aName, EnumRarity rarity) { if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) return BioDNA.createAndRegisterBioDNA(aName, rarity); new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!") - .printStackTrace(); + .printStackTrace(); return null; } @@ -117,7 +117,7 @@ public final class BioObjectAdder { public static BioPlasmid createAndRegisterBioPlasmid(String aName, EnumRarity rarity) { if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) return BioPlasmid.createAndRegisterBioPlasmid(aName, rarity); new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!") - .printStackTrace(); + .printStackTrace(); return null; } @@ -131,7 +131,7 @@ public final class BioObjectAdder { public static BioDNA createAndRegisterBioDNA(String aName, EnumRarity rarity, int chance, int tier) { if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) return BioDNA.createAndRegisterBioDNA(aName, rarity, chance, tier); new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!") - .printStackTrace(); + .printStackTrace(); return null; } @@ -146,7 +146,7 @@ public final class BioObjectAdder { if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) return BioPlasmid.createAndRegisterBioPlasmid(aName, rarity, chance, tier); new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!") - .printStackTrace(); + .printStackTrace(); return null; } @@ -164,20 +164,33 @@ public final class BioObjectAdder { */ public static void regenerateBioFluids() { FluidStack dnaFluid = Gendustry.isModLoaded() ? FluidRegistry.getFluidStack("liquiddna", 100) - : Materials.Biomass.getFluid(100L); + : Materials.Biomass.getFluid(100L); for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.getFluidNotSet()) { B.setFluid( - GT_FluidFactory.builder(B.getName().replace(" ", "").toLowerCase() + "fluid") - .withTextureName("molten.autogenerated") - .withColorRGBA( - new short[] { (short) B.getColor().getRed(), (short) B.getColor().getBlue(), - (short) B.getColor().getGreen() }) - .withStateAndTemperature(FluidState.LIQUID, 300).buildAndRegister().asFluid()); - - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)) - .fluidInputs(new FluidStack(B.getFluid(), 1000)).fluidOutputs(dnaFluid).duration(25 * SECONDS) - .eut(TierEU.RECIPE_MV).addTo(centrifugeRecipes); + GT_FluidFactory.builder( + B.getName() + .replace(" ", "") + .toLowerCase() + "fluid") + .withTextureName("molten.autogenerated") + .withColorRGBA( + new short[] { (short) B.getColor() + .getRed(), + (short) B.getColor() + .getBlue(), + (short) B.getColor() + .getGreen() }) + .withStateAndTemperature(FluidState.LIQUID, 300) + .buildAndRegister() + .asFluid()); + + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.getIntegratedCircuit(10)) + .fluidInputs(new FluidStack(B.getFluid(), 1000)) + .fluidOutputs(dnaFluid) + .duration(25 * SECONDS) + .eut(TierEU.RECIPE_MV) + .addTo(centrifugeRecipes); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java index b1e3fb25df..6ab854c308 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java @@ -31,18 +31,18 @@ public final class BioRecipeAdder { public static final int CLEANROOM = -200; public static boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, ItemStack aSpecialItems, - int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue) { + int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue) { return BWRecipes.instance.addBioLabRecipe( - aInputs, - aOutput, - aSpecialItems, - aChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue); + aInputs, + aOutput, + aSpecialItems, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue); } /** @@ -58,9 +58,9 @@ public final class BioRecipeAdder { * @return if the recipe was added. */ public static boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, - FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { + FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { return BWRecipes.instance - .addBioLabRecipeIncubation(aInput, aOutput, aChances, aFluidInputs, aDuration, aEUt, aSpecialValue); + .addBioLabRecipeIncubation(aInput, aOutput, aChances, aFluidInputs, aDuration, aEUt, aSpecialValue); } /** @@ -78,19 +78,19 @@ public final class BioRecipeAdder { * @return */ public static boolean addBacterialVatRecipe(ItemStack[] aInputs, @Nonnull BioCulture aCulture, - @Nonnull FluidStack[] aFluidInputs, @Nonnull FluidStack[] aFluidOutputs, @Nonnegative int aDuration, - @Nonnegative int aEUt, int Sv, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { + @Nonnull FluidStack[] aFluidInputs, @Nonnull FluidStack[] aFluidOutputs, @Nonnegative int aDuration, + @Nonnegative int aEUt, int Sv, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { return BWRecipes.instance.addBacterialVatRecipe( - aInputs, - aCulture, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - Sv, - glasTier, - aSpecialValue, - exactSv); + aInputs, + aCulture, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + Sv, + glasTier, + aSpecialValue, + exactSv); } /** @@ -109,18 +109,18 @@ public final class BioRecipeAdder { */ @Deprecated public static boolean addBacterialVatRecipe(ItemStack[] aInputs, @Nonnull BioCulture aCulture, - @Nonnull FluidStack[] aFluidInputs, @Nonnull FluidStack[] aFluidOutputs, @Nonnegative int aDuration, - @Nonnegative int aEUt, Materials material, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { + @Nonnull FluidStack[] aFluidInputs, @Nonnull FluidStack[] aFluidOutputs, @Nonnegative int aDuration, + @Nonnegative int aEUt, Materials material, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { return BWRecipes.instance.addBacterialVatRecipe( - aInputs, - aCulture, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - material, - glasTier, - aSpecialValue, - exactSv); + aInputs, + aCulture, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + material, + glasTier, + aSpecialValue, + exactSv); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java index 4084f485ab..b53638a77a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -56,17 +56,17 @@ public final class BioVatLogicAdder { giveItemStackRadioHatchAbilites(ItemList.Uraniumcell_4.get(1), Materials.Uranium, 12); giveItemStackRadioHatchAbilites( - BW_NonMeta_MaterialItems.TiberiumCell_1.get(1), - WerkstoffLoader.Tiberium.getBridgeMaterial(), - 3); + BW_NonMeta_MaterialItems.TiberiumCell_1.get(1), + WerkstoffLoader.Tiberium.getBridgeMaterial(), + 3); giveItemStackRadioHatchAbilites( - BW_NonMeta_MaterialItems.TiberiumCell_2.get(1), - WerkstoffLoader.Tiberium.getBridgeMaterial(), - 6); + BW_NonMeta_MaterialItems.TiberiumCell_2.get(1), + WerkstoffLoader.Tiberium.getBridgeMaterial(), + 6); giveItemStackRadioHatchAbilites( - BW_NonMeta_MaterialItems.TiberiumCell_4.get(1), - WerkstoffLoader.Tiberium.getBridgeMaterial(), - 12); + BW_NonMeta_MaterialItems.TiberiumCell_4.get(1), + WerkstoffLoader.Tiberium.getBridgeMaterial(), + 12); giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TheCoreCell.get(1), Materials.Naquadah, 96); @@ -79,58 +79,58 @@ public final class BioVatLogicAdder { giveItemStackRadioHatchAbilites(ItemList.Depleted_Naquadah_4.get(1), Materials.Naquadah, 12, 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXSimpledepleted", 1), - Materials.Plutonium, - 3, - 10); + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXSimpledepleted", 1), + Materials.Plutonium, + 3, + 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXDualdepleted", 1), - Materials.Plutonium, - 6, - 10); + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXDualdepleted", 1), + Materials.Plutonium, + 6, + 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXQuaddepleted", 1), - Materials.Plutonium, - 12, - 10); + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXQuaddepleted", 1), + Materials.Plutonium, + 12, + 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumSimpledepleted", 1), - Materials.Uranium, - 3, - 10); + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumSimpledepleted", 1), + Materials.Uranium, + 3, + 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumDualdepleted", 1), - Materials.Uranium, - 6, - 10); + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumDualdepleted", 1), + Materials.Uranium, + 6, + 10); giveItemStackRadioHatchAbilites( - GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumQuaddepleted", 1), - Materials.Uranium, - 12, - 10); + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumQuaddepleted", 1), + Materials.Uranium, + 12, + 10); giveItemStackRadioHatchAbilites( - BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), - WerkstoffLoader.Tiberium.getBridgeMaterial(), - 3, - 10); + BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), + WerkstoffLoader.Tiberium.getBridgeMaterial(), + 3, + 10); giveItemStackRadioHatchAbilites( - BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), - WerkstoffLoader.Tiberium.getBridgeMaterial(), - 6, - 10); + BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), + WerkstoffLoader.Tiberium.getBridgeMaterial(), + 6, + 10); giveItemStackRadioHatchAbilites( - BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), - WerkstoffLoader.Tiberium.getBridgeMaterial(), - 12, - 10); + BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), + WerkstoffLoader.Tiberium.getBridgeMaterial(), + 12, + 10); giveItemStackRadioHatchAbilites( - BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), - Materials.Naquadah, - 96, - 10); + BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), + Materials.Naquadah, + 96, + 10); giveItemStackRadioHatchAbilites(ItemList.MNqCell_1.get(1), Materials.Naquadria, 3); giveItemStackRadioHatchAbilites(ItemList.MNqCell_2.get(1), Materials.Naquadria, 6); @@ -223,7 +223,7 @@ public final class BioVatLogicAdder { boolean ret = block != null; if (ret) BioVatGlass.glasses.put(new BlockMetaPair(block, (byte) meta), (byte) tier); else new IllegalArgumentException( - "Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!").printStackTrace(); + "Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!").printStackTrace(); block = null; return ret; } @@ -274,7 +274,7 @@ public final class BioVatLogicAdder { if (o == null || this.getClass() != o.getClass()) return false; BioVatLogicAdder.MaterialSvPair that = (BioVatLogicAdder.MaterialSvPair) o; return Objects.equals(this.getMaterials(), that.getMaterials()) - && Objects.equals(this.getSievert(), that.getSievert()); + && Objects.equals(this.getSievert(), that.getSievert()); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java index 764340af42..eb4c2a0405 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java @@ -62,7 +62,7 @@ public class BorosilicateGlass { } private static void doRegister(byte level, Block block, int meta, - SetMultimap> allLevels) { + SetMultimap> allLevels) { allLevels.put(level, Pair.of(block, meta)); allLevelsReverse.put(block, meta, level); } @@ -96,7 +96,10 @@ public class BorosilicateGlass { SetMultimap> allLevels = getAllLevels(); ArrayList> ret = new ArrayList<>(); for (Byte level : new PriorityQueue<>(allLevels.keySet())) { - ret.add(allLevels.get(level).iterator().next()); + ret.add( + allLevels.get(level) + .iterator() + .next()); } representatives = ret; } @@ -115,10 +118,10 @@ public class BorosilicateGlass { * Can only be called at INIT stage. */ public static void registerGlass(Block block, int meta, byte tier) { - if (Loader.instance().hasReachedState(LoaderState.POSTINITIALIZATION)) - throw new IllegalStateException("register too late!"); - if (!Loader.instance().hasReachedState(LoaderState.INITIALIZATION)) - throw new IllegalStateException("register too early!"); + if (Loader.instance() + .hasReachedState(LoaderState.POSTINITIALIZATION)) throw new IllegalStateException("register too late!"); + if (!Loader.instance() + .hasReachedState(LoaderState.INITIALIZATION)) throw new IllegalStateException("register too early!"); if (!isValidTier(tier)) throw new IllegalArgumentException("not a valid tier: " + tier); doRegister(tier, block, meta, getAllLevels()); } @@ -167,9 +170,9 @@ public class BorosilicateGlass { * @param initialValue the value set before structure check started */ public static IStructureElement ofBoroGlass(byte initialValue, BiConsumer setter, - Function getter) { + Function getter) { return lazy( - t -> ofBlocksTiered(BorosilicateGlass::getTier, getRepresentatives(), initialValue, setter, getter)); + t -> ofBlocksTiered(BorosilicateGlass::getTier, getRepresentatives(), initialValue, setter, getter)); } /** @@ -181,16 +184,18 @@ public class BorosilicateGlass { * @param maxTier maximal accepted tier. inclusive. */ public static IStructureElement ofBoroGlass(byte initialValue, byte minTier, byte maxTier, - BiConsumer setter, Function getter) { + BiConsumer setter, Function getter) { if (minTier > maxTier || minTier < 0) throw new IllegalArgumentException(); return lazy( - t -> ofBlocksTiered( - (block1, meta) -> checkWithinBound(getTier(block1, meta), minTier, maxTier), - getRepresentatives().stream().skip(Math.max(minTier - 3, 0)).limit(maxTier - minTier + 1) - .collect(Collectors.toList()), - initialValue, - setter, - getter)); + t -> ofBlocksTiered( + (block1, meta) -> checkWithinBound(getTier(block1, meta), minTier, maxTier), + getRepresentatives().stream() + .skip(Math.max(minTier - 3, 0)) + .limit(maxTier - minTier + 1) + .collect(Collectors.toList()), + initialValue, + setter, + getter)); } /** diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java index 041096d4f6..88ae5bf5c0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java @@ -19,13 +19,21 @@ public class SideReference { public static class EffectiveSide { - public static final boolean Server = FMLCommonHandler.instance().getEffectiveSide().isServer(); - public static final boolean Client = FMLCommonHandler.instance().getEffectiveSide().isClient(); + public static final boolean Server = FMLCommonHandler.instance() + .getEffectiveSide() + .isServer(); + public static final boolean Client = FMLCommonHandler.instance() + .getEffectiveSide() + .isClient(); } public static class Side { - public static final boolean Server = FMLCommonHandler.instance().getSide().isServer(); - public static final boolean Client = FMLCommonHandler.instance().getSide().isClient(); + public static final boolean Server = FMLCommonHandler.instance() + .getSide() + .isServer(); + public static final boolean Client = FMLCommonHandler.instance() + .getSide() + .isClient(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java index 17a33e768d..01c172382f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java @@ -29,6 +29,7 @@ public final class WerkstoffAPI { } public static Werkstoff getWerkstoff(String aName) throws NoSuchFieldException, IllegalAccessException { - return (Werkstoff) w.getField(aName).get(null); + return (Werkstoff) w.getField(aName) + .get(null); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/modularUI/BW_UITextures.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/modularUI/BW_UITextures.java index 8d8f5c1778..620e9d65af 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/modularUI/BW_UITextures.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/modularUI/BW_UITextures.java @@ -11,9 +11,9 @@ import com.gtnewhorizons.modularui.api.drawable.UITexture; public class BW_UITextures { public static final AdaptableUITexture BACKGROUND_BROWN = AdaptableUITexture - .of(MOD_ID, "GUI/background/brown", 176, 166, 3); + .of(MOD_ID, "GUI/background/brown", 176, 166, 3); public static final UITexture BACKGROUND_CIRCUIT_PROGRAMMER = UITexture - .fullImage(MOD_ID, "GUI/background/circuit_programmer"); + .fullImage(MOD_ID, "GUI/background/circuit_programmer"); public static final AdaptableUITexture SLOT_BROWN = AdaptableUITexture.of(MOD_ID, "GUI/slot/brown", 18, 18, 1); @@ -25,36 +25,37 @@ public class BW_UITextures { public static final UITexture PROGRESSBAR_SIEVERT = UITexture.fullImage(MOD_ID, "GUI/progressbar/sievert"); public static final UITexture PROGRESSBAR_STORED_EU_116 = UITexture - .fullImage(MOD_ID, "GUI/progressbar/stored_eu_116"); + .fullImage(MOD_ID, "GUI/progressbar/stored_eu_116"); public static final UITexture PROGRESSBAR_FUEL = UITexture.fullImage(MOD_ID, "GUI/progressbar/fuel"); public static final UITexture PICTURE_BW_LOGO_47X21 = UITexture.fullImage(MOD_ID, "GUI/picture/bw_logo_47x21"); public static final UITexture PICTURE_SIEVERT_CONTAINER = UITexture - .fullImage(MOD_ID, "GUI/picture/sievert_container"); + .fullImage(MOD_ID, "GUI/picture/sievert_container"); public static final UITexture PICTURE_DECAY_TIME_CONTAINER = UITexture - .fullImage(MOD_ID, "GUI/picture/decay_time_container"); + .fullImage(MOD_ID, "GUI/picture/decay_time_container"); public static final UITexture PICTURE_DECAY_TIME_INSIDE = UITexture - .fullImage(MOD_ID, "GUI/picture/decay_time_inside"); + .fullImage(MOD_ID, "GUI/picture/decay_time_inside"); public static final UITexture PICTURE_RADIATION = UITexture.fullImage(MOD_ID, "GUI/picture/radiation"); public static final UITexture PICTURE_WINDMILL_EMPTY = UITexture.fullImage(MOD_ID, "GUI/picture/windmill_empty"); - public static final UITexture[] PICTURE_WINDMILL_ROTATING = IntStream.range(0, 4).mapToObj( - i -> UITexture.partly(MOD_ID, "GUI/picture/windmill_rotating", 32, 128, 0, i * 32, 32, (i + 1) * 32)) - .collect(Collectors.toList()).toArray(new UITexture[0]); + public static final UITexture[] PICTURE_WINDMILL_ROTATING = IntStream.range(0, 4) + .mapToObj(i -> UITexture.partly(MOD_ID, "GUI/picture/windmill_rotating", 32, 128, 0, i * 32, 32, (i + 1) * 32)) + .collect(Collectors.toList()) + .toArray(new UITexture[0]); public static final UITexture PICTURE_STORED_EU_FRAME = UITexture.fullImage(MOD_ID, "GUI/picture/stored_eu_frame"); public static final UITexture PICTURE_RADIATION_SHUTTER_FRAME = UITexture - .fullImage(MOD_ID, "GUI/picture/radiation_shutter_frame"); + .fullImage(MOD_ID, "GUI/picture/radiation_shutter_frame"); public static final AdaptableUITexture PICTURE_RADIATION_SHUTTER_INSIDE = AdaptableUITexture - .of(MOD_ID, "GUI/picture/radiation_shutter_inside", 51, 48, 1); + .of(MOD_ID, "GUI/picture/radiation_shutter_inside", 51, 48, 1); public static final AdaptableUITexture TAB_TITLE_BROWN = AdaptableUITexture - .of(MOD_ID, "GUI/tab/title_brown", 28, 28, 4); + .of(MOD_ID, "GUI/tab/title_brown", 28, 28, 4); public static final AdaptableUITexture TAB_TITLE_DARK_BROWN = AdaptableUITexture - .of(MOD_ID, "GUI/tab/title_dark_brown", 28, 28, 4); + .of(MOD_ID, "GUI/tab/title_dark_brown", 28, 28, 4); public static final AdaptableUITexture TAB_TITLE_ANGULAR_BROWN = AdaptableUITexture - .of(MOD_ID, "GUI/tab/title_angular_brown", 28, 28, 4); + .of(MOD_ID, "GUI/tab/title_angular_brown", 28, 28, 4); public static final UITexture OVERLAY_BUTTON_ASSEMBLER_MODE = UITexture - .fullImage(MOD_ID, "GUI/overlay_button/assembler_mode"); + .fullImage(MOD_ID, "GUI/overlay_button/assembler_mode"); public static final UITexture OVERLAY_BUTTON_LINE_MODE = UITexture - .fullImage(MOD_ID, "GUI/overlay_button/line_mode"); + .fullImage(MOD_ID, "GUI/overlay_button/line_mode"); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BacterialVatFrontend.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BacterialVatFrontend.java index 6ed4113017..01cf2ecd32 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BacterialVatFrontend.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BacterialVatFrontend.java @@ -24,15 +24,15 @@ import gregtech.nei.formatter.INEISpecialInfoFormatter; public class BacterialVatFrontend extends RecipeMapFrontend { public BacterialVatFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder, - NEIRecipePropertiesBuilder neiPropertiesBuilder) { + NEIRecipePropertiesBuilder neiPropertiesBuilder) { super( - uiPropertiesBuilder, - neiPropertiesBuilder.neiSpecialInfoFormatter(new BacterialVatSpecialValueFormatter())); + uiPropertiesBuilder, + neiPropertiesBuilder.neiSpecialInfoFormatter(new BacterialVatSpecialValueFormatter())); } @Override protected List handleNEIItemInputTooltip(List currentTip, - GT_NEI_DefaultHandler.FixedPositionedStack pStack) { + GT_NEI_DefaultHandler.FixedPositionedStack pStack) { if (pStack.isFluid()) { currentTip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("nei.biovat.input.tooltip")); return currentTip; @@ -42,7 +42,7 @@ public class BacterialVatFrontend extends RecipeMapFrontend { @Override protected List handleNEIItemOutputTooltip(List currentTip, - GT_NEI_DefaultHandler.FixedPositionedStack pStack) { + GT_NEI_DefaultHandler.FixedPositionedStack pStack) { if (pStack.isFluid()) { currentTip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("nei.biovat.output.tooltip")); return currentTip; @@ -63,12 +63,12 @@ public class BacterialVatFrontend extends RecipeMapFrontend { private void drawFluidOverlay(GT_NEI_DefaultHandler.FixedPositionedStack stack) { if (stack.isFluid()) { drawNEIOverlayText( - "+", - stack, - colorOverride.getTextColorOrDefault("nei_overlay_yellow", 0xFDD835), - 0.5f, - true, - Alignment.TopRight); + "+", + stack, + colorOverride.getTextColorOrDefault("nei_overlay_yellow", 0xFDD835), + 0.5f, + true, + Alignment.TopRight); return; } super.drawNEIOverlayForOutput(stack); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BartWorksRecipeMaps.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BartWorksRecipeMaps.java index 97fa74bf85..281184893c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BartWorksRecipeMaps.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/BartWorksRecipeMaps.java @@ -12,53 +12,80 @@ import gregtech.nei.formatter.FuelSpecialValueFormatter; public class BartWorksRecipeMaps { public static final RecipeMap bioLabRecipes = RecipeMapBuilder.of("bw.recipe.biolab") - .maxIO(6, 2, 1, 0).minInputs(1, 1).useSpecialSlot().slotOverlays((index, isFluid, isOutput, isSpecial) -> { - if (isSpecial) { - return BW_UITextures.OVERLAY_SLOT_MODULE; + .maxIO(6, 2, 1, 0) + .minInputs(1, 1) + .useSpecialSlot() + .slotOverlays((index, isFluid, isOutput, isSpecial) -> { + if (isSpecial) { + return BW_UITextures.OVERLAY_SLOT_MODULE; + } + if (isFluid) { + return GT_UITextures.OVERLAY_SLOT_VIAL_2; + } + if (!isOutput) { + switch (index) { + case 0: + return BW_UITextures.OVERLAY_SLOT_DISH; + case 1: + return BW_UITextures.OVERLAY_SLOT_DNA_FLASK; + case 2: + return GT_UITextures.OVERLAY_SLOT_CIRCUIT; + case 3: + return GT_UITextures.OVERLAY_SLOT_MOLECULAR_1; + case 4: + return GT_UITextures.OVERLAY_SLOT_MOLECULAR_2; + case 5: + return GT_UITextures.OVERLAY_SLOT_DATA_ORB; } - if (isFluid) { - return GT_UITextures.OVERLAY_SLOT_VIAL_2; - } - if (!isOutput) { - switch (index) { - case 0: - return BW_UITextures.OVERLAY_SLOT_DISH; - case 1: - return BW_UITextures.OVERLAY_SLOT_DNA_FLASK; - case 2: - return GT_UITextures.OVERLAY_SLOT_CIRCUIT; - case 3: - return GT_UITextures.OVERLAY_SLOT_MOLECULAR_1; - case 4: - return GT_UITextures.OVERLAY_SLOT_MOLECULAR_2; - case 5: - return GT_UITextures.OVERLAY_SLOT_DATA_ORB; - } - } - return null; - }).progressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE).logo(BW_UITextures.PICTURE_BW_LOGO_47X21) - .logoSize(47, 21).logoPos(125, 3).disableRegisterNEI().build(); + } + return null; + }) + .progressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE) + .logo(BW_UITextures.PICTURE_BW_LOGO_47X21) + .logoSize(47, 21) + .logoPos(125, 3) + .disableRegisterNEI() + .build(); public static final RecipeMap bacterialVatRecipes = RecipeMapBuilder.of("bw.recipe.BacteriaVat") - .maxIO(6, 2, 1, 1).minInputs(0, 1).useSpecialSlot().specialSlotSensitive() - .progressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE).frontend(BacterialVatFrontend::new) - .disableRegisterNEI().build(); + .maxIO(6, 2, 1, 1) + .minInputs(0, 1) + .useSpecialSlot() + .specialSlotSensitive() + .progressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE) + .frontend(BacterialVatFrontend::new) + .disableRegisterNEI() + .build(); public static final RecipeMap acidGenFuels = RecipeMapBuilder.of("bw.fuels.acidgens", FuelBackend::new) - .maxIO(1, 1, 0, 0).neiSpecialInfoFormatter(FuelSpecialValueFormatter.INSTANCE).build(); + .maxIO(1, 1, 0, 0) + .neiSpecialInfoFormatter(FuelSpecialValueFormatter.INSTANCE) + .build(); public static final RecipeMap circuitAssemblyLineRecipes = RecipeMapBuilder.of("bw.recipe.cal") - .maxIO(6, 1, 1, 0).minInputs(1, 1).useSpecialSlot().specialSlotSensitive() - .progressBar(GT_UITextures.PROGRESSBAR_CIRCUIT_ASSEMBLER).build(); + .maxIO(6, 1, 1, 0) + .minInputs(1, 1) + .useSpecialSlot() + .specialSlotSensitive() + .progressBar(GT_UITextures.PROGRESSBAR_CIRCUIT_ASSEMBLER) + .build(); public static final RecipeMap radioHatchRecipes = RecipeMapBuilder.of("bw.recipe.radhatch") - .maxIO(1, 0, 0, 0).minInputs(1, 0) - .slotOverlays((index, isFluid, isOutput, isSpecial) -> BW_UITextures.OVERLAY_SLOT_ROD) - .logo(BW_UITextures.PICTURE_BW_LOGO_47X21).logoSize(47, 21).logoPos(118, 55).dontUseProgressBar() - .addSpecialTexture(74, 20, 29, 27, BW_UITextures.PICTURE_RADIATION).frontend(RadioHatchFrontend::new) - .build(); + .maxIO(1, 0, 0, 0) + .minInputs(1, 0) + .slotOverlays((index, isFluid, isOutput, isSpecial) -> BW_UITextures.OVERLAY_SLOT_ROD) + .logo(BW_UITextures.PICTURE_BW_LOGO_47X21) + .logoSize(47, 21) + .logoPos(118, 55) + .dontUseProgressBar() + .addSpecialTexture(74, 20, 29, 27, BW_UITextures.PICTURE_RADIATION) + .frontend(RadioHatchFrontend::new) + .build(); public static final RecipeMap electricImplosionCompressorRecipes = RecipeMapBuilder - .of("gt.recipe.electricimplosioncompressor").maxIO(6, 2, 1, 1) - .slotOverlays( - (index, isFluid, isOutput, - isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_IMPLOSION : null) - .progressBar(GT_UITextures.PROGRESSBAR_COMPRESS).build(); + .of("gt.recipe.electricimplosioncompressor") + .maxIO(6, 2, 1, 1) + .slotOverlays( + (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_IMPLOSION + : null) + .progressBar(GT_UITextures.PROGRESSBAR_COMPRESS) + .build(); public static final RecipeMap htgrFakeRecipes = RecipeMapBuilder.of("bw.recipe.htgr") - .maxIO(1, 1, 0, 0).build(); + .maxIO(1, 1, 0, 0) + .build(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/DynamicGTRecipe.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/DynamicGTRecipe.java index 3087255e51..d409d3ab26 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/DynamicGTRecipe.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/DynamicGTRecipe.java @@ -12,19 +12,19 @@ import gregtech.api.util.GT_Recipe; public class DynamicGTRecipe extends GT_Recipe { public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, - int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue, GT_Recipe originalRecipe) { + int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue, GT_Recipe originalRecipe) { super( - aOptimize, - aInputs, - aOutputs, - aSpecialItems, - aChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue); + aOptimize, + aInputs, + aOutputs, + aSpecialItems, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue); if (originalRecipe != null) { this.owners = new ArrayList<>(originalRecipe.owners); this.stackTraces = new ArrayList<>(originalRecipe.stackTraces); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/RadioHatchFrontend.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/RadioHatchFrontend.java index 0309a676d9..a6cf4b180e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/RadioHatchFrontend.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/recipe/RadioHatchFrontend.java @@ -19,7 +19,7 @@ import gregtech.nei.formatter.INEISpecialInfoFormatter; public class RadioHatchFrontend extends RecipeMapFrontend { public RadioHatchFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder, - NEIRecipePropertiesBuilder neiPropertiesBuilder) { + NEIRecipePropertiesBuilder neiPropertiesBuilder) { super(uiPropertiesBuilder, neiPropertiesBuilder.neiSpecialInfoFormatter(new RadioHatchSpecialInfoFormatter())); } @@ -37,9 +37,9 @@ public class RadioHatchFrontend extends RecipeMapFrontend { int amount = recipeInfo.recipe.mDuration; long time = recipeInfo.recipe.mSpecialValue; return Arrays.asList( - StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.0", radioLevel), - StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", amount), - StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.2", time * amount / 20.0)); + StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.0", radioLevel), + StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", amount), + StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.2", time * amount / 20.0)); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java index 7227780e37..f7fde1167d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java @@ -66,7 +66,8 @@ public class BWCorePlugin implements IFMLLoadingPlugin { } if (data.get("coremodList") != null) { for (Object o : (ArrayList) data.get("coremodList")) { - if (o.toString().contains("MicdoodlePlugin")) { + if (o.toString() + .contains("MicdoodlePlugin")) { BWCoreTransformer.shouldTransform[2] = ConfigHandler.enabledPatches[2]; break; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java index 8d3fe4876c..38a5a70d27 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java @@ -31,7 +31,7 @@ import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriority public class BWCoreStaticReplacementMethodes { private static ThreadLocal> RECENTLYUSEDRECIPES = ThreadLocal - .withInitial(AccessPriorityList::new); + .withInitial(AccessPriorityList::new); public static void clearRecentlyUsedRecipes() { // the easiest way to ensure the cache is flushed without causing synchronization overhead @@ -58,9 +58,10 @@ public class BWCoreStaticReplacementMethodes { } if (i == 2 && itemstack.getItem() == itemstack1.getItem() - && itemstack.stackSize == 1 - && itemstack1.stackSize == 1 - && itemstack.getItem().isRepairable()) { + && itemstack.stackSize == 1 + && itemstack1.stackSize == 1 + && itemstack.getItem() + .isRepairable()) { Item item = itemstack.getItem(); int j1 = item.getMaxDamage() - itemstack.getItemDamageForDisplay(); int k = item.getMaxDamage() - itemstack1.getItemDamageForDisplay(); @@ -87,7 +88,8 @@ public class BWCoreStaticReplacementMethodes { } HashSet recipeSet = new NonNullWrappedHashSet<>(); - List recipeList = CraftingManager.getInstance().getRecipeList(); + List recipeList = CraftingManager.getInstance() + .getRecipeList(); for (IRecipe r : recipeList) { if (r.matches(inventoryCrafting, world)) recipeSet.add(r); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java index 095273676b..02835e39c2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java @@ -46,13 +46,12 @@ import org.objectweb.asm.tree.VarInsnNode; public class BWCoreTransformer implements IClassTransformer { public static final String[] DESCRIPTIONFORCONFIG = { "REMOVING RAIN FROM LAST MILLENNIUM (EXU)", - "REMOVING CREATURES FROM LAST MILLENNIUM (EXU)", - "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", - "PATCHING CRAFTING MANAGER FOR CACHING RECIPES" }; + "REMOVING CREATURES FROM LAST MILLENNIUM (EXU)", "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", + "PATCHING CRAFTING MANAGER FOR CACHING RECIPES" }; public static final String[] CLASSESBEINGTRANSFORMED = { - "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", - "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", - "thaumcraft.common.tiles.TileWandPedestal", "net.minecraft.item.crafting.CraftingManager" }; + "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", + "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", "thaumcraft.common.tiles.TileWandPedestal", + "net.minecraft.item.crafting.CraftingManager" }; static boolean obfs; public static boolean[] shouldTransform = new boolean[BWCoreTransformer.CLASSESBEINGTRANSFORMED.length]; @@ -72,19 +71,19 @@ public class BWCoreTransformer implements IClassTransformer { LabelNode label = new LabelNode(); nu.insertBefore(beginning, new VarInsnNode(ALOAD, 0)); nu.insertBefore( - beginning, - new FieldInsnNode( - GETFIELD, - "thaumcraft/common/tiles/TileWandPedestal", - obfs ? "field_145850_b" : "worldObj", - "Lnet/minecraft/world/World;")); + beginning, + new FieldInsnNode( + GETFIELD, + "thaumcraft/common/tiles/TileWandPedestal", + obfs ? "field_145850_b" : "worldObj", + "Lnet/minecraft/world/World;")); nu.insertBefore( - beginning, - new FieldInsnNode( - GETFIELD, - "net/minecraft/world/World", - obfs ? "field_72995_K" : "isRemote", - "Z")); + beginning, + new FieldInsnNode( + GETFIELD, + "net/minecraft/world/World", + obfs ? "field_72995_K" : "isRemote", + "Z")); nu.insertBefore(beginning, new JumpInsnNode(IFNE, label)); nu.add(new InsnNode(POP)); nu.add(label); @@ -99,7 +98,7 @@ public class BWCoreTransformer implements IClassTransformer { public static byte[] transform(int id, byte[] basicClass) { if (!BWCoreTransformer.shouldTransform[id]) { BWCore.BWCORE_LOG - .info("Patch: " + BWCoreTransformer.DESCRIPTIONFORCONFIG[id] + " is disabled, will not patch!"); + .info("Patch: " + BWCoreTransformer.DESCRIPTIONFORCONFIG[id] + " is disabled, will not patch!"); return basicClass; } @@ -143,7 +142,7 @@ public class BWCoreTransformer implements IClassTransformer { for (int i = 0; i < methods.size(); i++) { if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) - && ASMUtils.isCorrectMethod(methods.get(i), dsc_deObfs, dsc_Obfs)) { + && ASMUtils.isCorrectMethod(methods.get(i), dsc_deObfs, dsc_Obfs)) { BWCore.BWCORE_LOG.info("Found " + name_deObfs + "! Patching!"); MethodNode toPatch = methods.get(i); InsnList insnList = new InsnList(); @@ -166,7 +165,7 @@ public class BWCoreTransformer implements IClassTransformer { for (int i = 0; i < methods.size(); i++) { if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) - && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal, dsc_universal)) { + && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal, dsc_universal)) { BWCore.BWCORE_LOG.info("Found " + name_deObfs + "! Patching!"); methods.set(i, BWCoreTransformer.transformThaumcraftWandPedestal(methods.get(i))); break scase; @@ -184,12 +183,12 @@ public class BWCoreTransformer implements IClassTransformer { toPatch.instructions.add(new VarInsnNode(ALOAD, 1)); toPatch.instructions.add(new VarInsnNode(ALOAD, 2)); toPatch.instructions.add( - new MethodInsnNode( - INVOKESTATIC, - "com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes", - "findCachedMatchingRecipe", - "(Lnet/minecraft/inventory/InventoryCrafting;Lnet/minecraft/world/World;)Lnet/minecraft/item/ItemStack;", - false)); + new MethodInsnNode( + INVOKESTATIC, + "com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes", + "findCachedMatchingRecipe", + "(Lnet/minecraft/inventory/InventoryCrafting;Lnet/minecraft/world/World;)Lnet/minecraft/item/ItemStack;", + false)); toPatch.instructions.add(new InsnNode(ARETURN)); toPatch.localVariables.clear(); toPatch.maxStack = 2; @@ -220,7 +219,7 @@ public class BWCoreTransformer implements IClassTransformer { public byte[] transform(String name, String transformedName, byte[] basicClass) { for (int i = 0; i < BWCoreTransformer.CLASSESBEINGTRANSFORMED.length; i++) { if (name.equalsIgnoreCase(BWCoreTransformer.CLASSESBEINGTRANSFORMED[i]) - || transformedName.equalsIgnoreCase(BWCoreTransformer.CLASSESBEINGTRANSFORMED[i])) + || transformedName.equalsIgnoreCase(BWCoreTransformer.CLASSESBEINGTRANSFORMED[i])) return BWCoreTransformer.transform(i, basicClass); } return basicClass; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index fa04f66e28..818b67d6fc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -81,16 +81,16 @@ import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.util.GT_OreDictUnificator; @Mod(modid = MainMod.MOD_ID, name = MainMod.NAME, version = API_REFERENCE.VERSION, dependencies = """ - required-after:IC2;\ - required-after:gregtech;\ - after:berriespp;\ - after:tectech;\ - after:GalacticraftMars;\ - after:GalacticraftCore;\ - after:Forestry;\ - after:ProjRed|Illumination;\ - after:RandomThings;\ - before:miscutils;""") + required-after:IC2;\ + required-after:gregtech;\ + after:berriespp;\ + after:tectech;\ + after:GalacticraftMars;\ + after:GalacticraftCore;\ + after:Forestry;\ + after:ProjRed|Illumination;\ + after:RandomThings;\ + before:miscutils;""") public final class MainMod { public static final String NAME = "BartWorks"; @@ -147,7 +147,9 @@ public final class MainMod { if (SideReference.Side.Server) { MinecraftForge.EVENT_BUS.register(serverEventHandler); } - FMLCommonHandler.instance().bus().register(serverEventHandler); + FMLCommonHandler.instance() + .bus() + .register(serverEventHandler); if (ConfigHandler.BioLab) { BioLabLoader.run(); } @@ -166,10 +168,15 @@ public final class MainMod { if (ConfigHandler.BioLab) { GTNHBlocks.run(); for (Map.Entry pair : BioVatLogicAdder.BioVatGlass.getGlassMap() - .entrySet()) { + .entrySet()) { GT_OreDictUnificator.registerOre( - "blockGlass" + VN[pair.getValue()], - new ItemStack(pair.getKey().getBlock(), 1, pair.getKey().getaByte())); + "blockGlass" + VN[pair.getValue()], + new ItemStack( + pair.getKey() + .getBlock(), + 1, + pair.getKey() + .getaByte())); } } ArtificialMicaLine.runArtificialMicaRecipe(); @@ -224,6 +231,9 @@ public final class MainMod { // StaticRecipeChangeLoaders.synchroniseCircuitUseMulti(); // Accept recipe map changes into Buffers - RecipeMap.ALL_RECIPE_MAPS.values().forEach(map -> map.getBackend().reInit()); + RecipeMap.ALL_RECIPE_MAPS.values() + .forEach( + map -> map.getBackend() + .reInit()); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java index a23020e787..969398df47 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java @@ -37,7 +37,8 @@ class TooltipCache { sb.append(s); sb.append(System.lineSeparator()); } - char[] rettype = sb.toString().toCharArray(); + char[] rettype = sb.toString() + .toCharArray(); return TooltipCache.cache.put(p, rettype) == rettype; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java index 2b7e686814..9f7fb64e4b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java @@ -53,38 +53,40 @@ public class TooltipEventHandler { if (event == null || event.itemStack == null || event.itemStack.getItem() == null) return; - if (TooltipCache.getTooltip(event.itemStack).isEmpty()) { + if (TooltipCache.getTooltip(event.itemStack) + .isEmpty()) { ItemStack tmp = event.itemStack.copy(); Pair abstractedStack = new Pair<>( - Item.getIdFromItem(tmp.getItem()), - (short) tmp.getItemDamage()); + Item.getIdFromItem(tmp.getItem()), + (short) tmp.getItemDamage()); List tooAdd = new ArrayList<>(); - if (ConfigHandler.sharedItemStackTooltip && OreDictHandler.getNonBWCache().contains(abstractedStack)) { + if (ConfigHandler.sharedItemStackTooltip && OreDictHandler.getNonBWCache() + .contains(abstractedStack)) { for (Pair pair : OreDictHandler.getNonBWCache()) { if (pair.equals(abstractedStack)) { GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); if (UI == null) UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); if (UI != null) { - for (ModContainer modContainer : Loader.instance().getModList()) { + for (ModContainer modContainer : Loader.instance() + .getModList()) { if (MainMod.MOD_ID.equals(UI.modId) || BartWorksCrossmod.MOD_ID.equals(UI.modId) - || "BWCore".equals(UI.modId)) - break; + || "BWCore".equals(UI.modId)) break; if (UI.modId.equals(modContainer.getModId())) { tooAdd.add( - "Shared ItemStack between " + ChatColorHelper.DARKGREEN - + "BartWorks" - + ChatColorHelper.GRAY - + " and " - + ChatColorHelper.RED - + modContainer.getName()); + "Shared ItemStack between " + ChatColorHelper.DARKGREEN + + "BartWorks" + + ChatColorHelper.GRAY + + " and " + + ChatColorHelper.RED + + modContainer.getName()); } } } else tooAdd.add( - "Shared ItemStack between " + ChatColorHelper.DARKGREEN - + "BartWorks" - + ChatColorHelper.GRAY - + " and another Mod, that doesn't use the ModContainer propperly!"); + "Shared ItemStack between " + ChatColorHelper.DARKGREEN + + "BartWorks" + + ChatColorHelper.GRAY + + " and another Mod, that doesn't use the ModContainer propperly!"); } } } @@ -96,23 +98,24 @@ public class TooltipEventHandler { return; } BioVatLogicAdder.BlockMetaPair PAIR = new BioVatLogicAdder.BlockMetaPair( - BLOCK, - (byte) event.itemStack.getItemDamage()); + BLOCK, + (byte) event.itemStack.getItemDamage()); HashMap GLASSMAP = BioVatLogicAdder.BioVatGlass.getGlassMap(); if (GLASSMAP.containsKey(PAIR)) { int tier = GLASSMAP.get(PAIR); tooAdd.add( + StatCollector.translateToLocal("tooltip.glas.0.name") + " " + + BW_ColorUtil.getColorForTier(tier) + + GT_Values.VN[tier] + + ChatColorHelper.RESET); + } else if (BLOCK.getMaterial() + .equals(Material.glass)) { + tooAdd.add( StatCollector.translateToLocal("tooltip.glas.0.name") + " " - + BW_ColorUtil.getColorForTier(tier) - + GT_Values.VN[tier] - + ChatColorHelper.RESET); - } else if (BLOCK.getMaterial().equals(Material.glass)) { - tooAdd.add( - StatCollector.translateToLocal("tooltip.glas.0.name") + " " - + BW_ColorUtil.getColorForTier(3) - + GT_Values.VN[3] - + ChatColorHelper.RESET); - } + + BW_ColorUtil.getColorForTier(3) + + GT_Values.VN[3] + + ChatColorHelper.RESET); + } } TooltipCache.put(event.itemStack, tooAdd); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java index efd085f320..8d3d457e06 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java @@ -26,6 +26,7 @@ public class BioTab extends CreativeTabs { @Override public Item getTabIconItem() { - return BioItemList.getPetriDish(null).getItem(); + return BioItemList.getPetriDish(null) + .getItem(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java index 188c0c9e69..e2bb68b290 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java @@ -41,39 +41,36 @@ public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator { @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { this.fontRendererObj - .drawString(this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 6, 2157374); + .drawString(this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 6, 2157374); if (this.container.base.checkrotor()) { if (!this.container.base.rotorspace()) { this.fontRendererObj.drawString( - StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotorspace"), - 27, - 52, - 2157374); + StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotorspace"), + 27, + 52, + 2157374); } else if (this.container.base.checkrotor() && !this.container.base.guiisminWindStrength()) { this.fontRendererObj.drawString( - StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.windweak1"), - 27, - 52, - 2157374); + StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.windweak1"), + 27, + 52, + 2157374); } else { this.fontRendererObj.drawString(this.container.base.getRotorhealth() + " %", 46, 52, 2157374); if (this.container.base.guiisoverload()) { GuiTooltipHelper.drawAreaTooltip( - mouseX - this.guiLeft, - mouseY - this.guiTop, - StatCollector.translateToLocal("ic2.WindKineticGenerator.error.overload"), - 44, - 27, - 79, - 52); + mouseX - this.guiLeft, + mouseY - this.guiTop, + StatCollector.translateToLocal("ic2.WindKineticGenerator.error.overload"), + 44, + 27, + 79, + 52); } } } else { - this.fontRendererObj.drawString( - StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotormiss"), - 27, - 52, - 2157374); + this.fontRendererObj + .drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotormiss"), 27, 52, 2157374); } } @@ -81,7 +78,7 @@ public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator { protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { GL11.glColor3f(0.5f, 0.25f, 0.07f); this.mc.getTextureManager() - .bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUIPrimitiveKUBox.png")); + .bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUIPrimitiveKUBox.png")); int j = (this.width - this.xSize) / 2; int k = (this.height - this.ySize) / 2; this.drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java index bb48e4067e..6bf5fd3fe1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_EICPistonVisualizer.java @@ -32,13 +32,14 @@ public class BW_EICPistonVisualizer extends EntityFX { @Override public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, - float p_70539_5_, float p_70539_6_, float p_70539_7_) { + float p_70539_5_, float p_70539_6_, float p_70539_7_) { Tessellator tessellator = Tessellator.instance; GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDepthMask(false); RenderBlocks.getInstance().blockAccess = this.worldObj; - RenderBlocks.getInstance().setRenderFromInside(false); + RenderBlocks.getInstance() + .setRenderFromInside(false); // Look at nearby block for correct tiered block to use Pair tieredBlock; @@ -53,7 +54,8 @@ public class BW_EICPistonVisualizer extends EntityFX { tieredBlock = Pair.of(GregTech_API.sBlockMetal5, 2); } - IIcon icon = tieredBlock.getKey().getIcon(0, tieredBlock.getValue()); + IIcon icon = tieredBlock.getKey() + .getIcon(0, tieredBlock.getValue()); double x = this.posX + 1; double z = this.posZ; @@ -63,7 +65,7 @@ public class BW_EICPistonVisualizer extends EntityFX { double f13 = z - interpPosZ; tessellator.setTranslation(f11 - x, f12 - this.posY, f13 - z); RenderBlocks.getInstance() - .renderBlockUsingTexture(tieredBlock.getKey(), (int) x, (int) this.posY, (int) z, icon); + .renderBlockUsingTexture(tieredBlock.getKey(), (int) x, (int) this.posY, (int) z, icon); x = this.posX - 1; z = this.posZ; @@ -72,7 +74,7 @@ public class BW_EICPistonVisualizer extends EntityFX { f13 = z - interpPosZ; tessellator.setTranslation(f11 - x, f12 - this.posY, f13 - z); RenderBlocks.getInstance() - .renderBlockUsingTexture(tieredBlock.getKey(), (int) x, (int) this.posY, (int) z, icon); + .renderBlockUsingTexture(tieredBlock.getKey(), (int) x, (int) this.posY, (int) z, icon); x = this.posX; z = this.posZ + 1; @@ -81,7 +83,7 @@ public class BW_EICPistonVisualizer extends EntityFX { f13 = z - interpPosZ; tessellator.setTranslation(f11 - x, f12 - this.posY, f13 - z); RenderBlocks.getInstance() - .renderBlockUsingTexture(tieredBlock.getKey(), (int) x, (int) this.posY, (int) z, icon); + .renderBlockUsingTexture(tieredBlock.getKey(), (int) x, (int) this.posY, (int) z, icon); x = this.posX; z = this.posZ - 1; @@ -90,7 +92,7 @@ public class BW_EICPistonVisualizer extends EntityFX { f13 = z - interpPosZ; tessellator.setTranslation(f11 - x, f12 - this.posY, f13 - z); RenderBlocks.getInstance() - .renderBlockUsingTexture(tieredBlock.getKey(), (int) x, (int) this.posY, (int) z, icon); + .renderBlockUsingTexture(tieredBlock.getKey(), (int) x, (int) this.posY, (int) z, icon); tessellator.setTranslation(0d, 0d, 0d); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java index 363de0eda7..4c27a2a3f9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java @@ -47,16 +47,16 @@ public class BW_GT_ItemRenderer implements IItemRenderer { public boolean handleRenderType(ItemStack aStack, IItemRenderer.ItemRenderType aType) { if (!GT_Utility.isStackInvalid(aStack) && aStack.getItemDamage() >= 0) { return aType == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON - || aType == IItemRenderer.ItemRenderType.INVENTORY - || aType == IItemRenderer.ItemRenderType.EQUIPPED - || aType == IItemRenderer.ItemRenderType.ENTITY; + || aType == IItemRenderer.ItemRenderType.INVENTORY + || aType == IItemRenderer.ItemRenderType.EQUIPPED + || aType == IItemRenderer.ItemRenderType.ENTITY; } return false; } @Override public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType aType, ItemStack aStack, - IItemRenderer.ItemRendererHelper aHelper) { + IItemRenderer.ItemRendererHelper aHelper) { if (GT_Utility.isStackInvalid(aStack)) { return false; } @@ -89,26 +89,26 @@ public class BW_GT_ItemRenderer implements IItemRenderer { else { for (int i = 0; i < 4; i++) { GT_RenderUtil.renderItemIcon( - tIcon, - 0.0D + i * 2D, - 0.0D + i * 2D, - 10.0D + i * 2D, - 10.0D + i * 2D, - 0.001D, - 0.0F, - 0.0F, - -1.0F); + tIcon, + 0.0D + i * 2D, + 0.0D + i * 2D, + 10.0D + i * 2D, + 10.0D + i * 2D, + 0.001D, + 0.0F, + 0.0F, + -1.0F); } } } else if (aMetaData < CircuitImprintLoader.reverseIDs) ItemRenderer.renderItemIn2D( - Tessellator.instance, - tIcon.getMaxU(), - tIcon.getMinV(), - tIcon.getMinU(), - tIcon.getMaxV(), - tIcon.getIconWidth(), - tIcon.getIconHeight(), - 0.0625F); + Tessellator.instance, + tIcon.getMaxU(), + tIcon.getMinV(), + tIcon.getMinU(), + tIcon.getMaxV(), + tIcon.getIconWidth(), + tIcon.getIconHeight(), + 0.0625F); IIcon tOverlay = (IIcon) BW_Util.get2DCoordFrom1DArray(aMetaData, 1, 2, aItem.mIconList); GL11.glColor3f(1.0F, 1.0F, 1.0F); @@ -119,14 +119,14 @@ public class BW_GT_ItemRenderer implements IItemRenderer { GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { ItemRenderer.renderItemIn2D( - Tessellator.instance, - tOverlay.getMaxU(), - tOverlay.getMinV(), - tOverlay.getMinU(), - tOverlay.getMaxV(), - tOverlay.getIconWidth(), - tOverlay.getIconHeight(), - 0.0625F); + Tessellator.instance, + tOverlay.getMaxU(), + tOverlay.getMinV(), + tOverlay.getMinU(), + tOverlay.getMaxV(), + tOverlay.getIconWidth(), + tOverlay.getIconHeight(), + 0.0625F); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index 99733ef212..7bb04e0c39 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -61,59 +61,59 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); renderNegativeYFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - tTileEntity.getTexture(aBlock, ForgeDirection.DOWN), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tTileEntity.getTexture(aBlock, ForgeDirection.DOWN), + true); renderPositiveYFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - tTileEntity.getTexture(aBlock, ForgeDirection.UP), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tTileEntity.getTexture(aBlock, ForgeDirection.UP), + true); renderNegativeZFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - tTileEntity.getTexture(aBlock, ForgeDirection.NORTH), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tTileEntity.getTexture(aBlock, ForgeDirection.NORTH), + true); renderPositiveZFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - tTileEntity.getTexture(aBlock, ForgeDirection.SOUTH), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tTileEntity.getTexture(aBlock, ForgeDirection.SOUTH), + true); renderNegativeXFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - tTileEntity.getTexture(aBlock, ForgeDirection.WEST), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tTileEntity.getTexture(aBlock, ForgeDirection.WEST), + true); renderPositiveXFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - tTileEntity.getTexture(aBlock, ForgeDirection.EAST), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + tTileEntity.getTexture(aBlock, ForgeDirection.EAST), + true); aRenderer.setRenderBoundsFromBlock(aBlock); aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax); GL11.glTranslatef(0.5F, 0.5F, 0.5F); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java index 6af2f2df7d..7a12074e02 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java @@ -57,7 +57,7 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler float end = 0.0f; for (float aFlow : flow) { if (aFlow >= RendererSwitchingColorFluid.THREE_QUARTERS_FILLED - && end != RendererSwitchingColorFluid.LIGHT_Y_POS) { + && end != RendererSwitchingColorFluid.LIGHT_Y_POS) { end = aFlow; } if (aFlow >= 0.0f) { @@ -75,15 +75,17 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler if (world.getBlock(x, y, z) == block) { Block vOrigin = world.getBlock(x, y + 1, z); - if (vOrigin.getMaterial().isLiquid() || vOrigin instanceof IFluidBlock) { + if (vOrigin.getMaterial() + .isLiquid() || vOrigin instanceof IFluidBlock) { return RendererSwitchingColorFluid.LIGHT_Y_POS; } if (world.getBlockMetadata(x, y, z) == block.getMaxRenderHeightMeta()) { return RendererSwitchingColorFluid.THREE_QUARTERS_FILLED; } } - return !world.getBlock(x, y, z).getMaterial().isSolid() && world.getBlock(x, y + 1, z) == block - ? RendererSwitchingColorFluid.LIGHT_Y_POS + return !world.getBlock(x, y, z) + .getMaterial() + .isSolid() && world.getBlock(x, y + 1, z) == block ? RendererSwitchingColorFluid.LIGHT_Y_POS : block.getQuantaPercentage(world, x, y, z) * RendererSwitchingColorFluid.THREE_QUARTERS_FILLED; } @@ -91,10 +93,15 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler @SideOnly(Side.CLIENT) public boolean renderWorldBlock(IBlockAccess iBlockAccess, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { + RenderBlocks renderer) { if (!(block instanceof BioFluidBlock)) return false; Tessellator tessellator = Tessellator.instance; - Coords blockat = new Coords(x, y, z, iBlockAccess.getTileEntity(x, y, z).getWorldObj().provider.dimensionId); + Coords blockat = new Coords( + x, + y, + z, + iBlockAccess.getTileEntity(x, y, z) + .getWorldObj().provider.dimensionId); Integer rgb = GT_TileEntity_BioVat.staticColorMap.get(blockat); int r, g, b; @@ -113,11 +120,11 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler BlockFluidBase blockFluidBase = (BlockFluidBase) block; boolean renderTop = iBlockAccess.getBlock(x, y + 1, z) != blockFluidBase; boolean renderBottom = block.shouldSideBeRendered(iBlockAccess, x, y - 1, z, 0) - && iBlockAccess.getBlock(x, y - 1, z) != blockFluidBase; + && iBlockAccess.getBlock(x, y - 1, z) != blockFluidBase; boolean[] renderSides = { block.shouldSideBeRendered(iBlockAccess, x, y, z - 1, 2), - block.shouldSideBeRendered(iBlockAccess, x, y, z + 1, 3), - block.shouldSideBeRendered(iBlockAccess, x - 1, y, z, 4), - block.shouldSideBeRendered(iBlockAccess, x + 1, y, z, 5) }; + block.shouldSideBeRendered(iBlockAccess, x, y, z + 1, 3), + block.shouldSideBeRendered(iBlockAccess, x - 1, y, z, 4), + block.shouldSideBeRendered(iBlockAccess, x + 1, y, z, 5) }; if (!renderTop && !renderBottom && !renderSides[0] && !renderSides[1] && !renderSides[2] && !renderSides[3]) { return false; } @@ -135,17 +142,17 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler float fluidHeightForRender7 = this.getFluidHeightForRender(iBlockAccess, x + 1, y, z, blockFluidBase); float fluidHeightForRender8 = this.getFluidHeightForRender(iBlockAccess, x + 1, y, z + 1, blockFluidBase); heightNW = this.getFluidHeightAverage( - new float[] { fluidHeightForRender1, fluidHeightForRender2, fluidHeightForRender4, - fluidHeightForRender }); + new float[] { fluidHeightForRender1, fluidHeightForRender2, fluidHeightForRender4, + fluidHeightForRender }); heightSW = this.getFluidHeightAverage( - new float[] { fluidHeightForRender2, fluidHeightForRender3, fluidHeightForRender5, - fluidHeightForRender }); + new float[] { fluidHeightForRender2, fluidHeightForRender3, fluidHeightForRender5, + fluidHeightForRender }); heightSE = this.getFluidHeightAverage( - new float[] { fluidHeightForRender5, fluidHeightForRender7, fluidHeightForRender8, - fluidHeightForRender }); + new float[] { fluidHeightForRender5, fluidHeightForRender7, fluidHeightForRender8, + fluidHeightForRender }); heightNE = this.getFluidHeightAverage( - new float[] { fluidHeightForRender4, fluidHeightForRender6, fluidHeightForRender7, - fluidHeightForRender }); + new float[] { fluidHeightForRender4, fluidHeightForRender6, fluidHeightForRender7, + fluidHeightForRender }); } else { heightNW = fluidHeightForRender; heightSW = fluidHeightForRender; @@ -164,7 +171,7 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler heightNE -= RendererSwitchingColorFluid.RENDER_OFFSET; double dInterpolatedU, dInterpolatedV, dInterpolatedU2, dInterpolatedV2, dInterpolatedU3, dInterpolatedV3, - dInterpolatedU4, dInterpolatedV4; + dInterpolatedU4, dInterpolatedV4; if (flowDir < -999.0f) { dInterpolatedU = iconStill.getInterpolatedU(0.0); @@ -189,9 +196,9 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler tessellator.setBrightness(block.getMixedBrightnessForBlock(iBlockAccess, x, y, z)); tessellator.setColorOpaque_F( - RendererSwitchingColorFluid.LIGHT_Y_POS * red, - RendererSwitchingColorFluid.LIGHT_Y_POS * green, - RendererSwitchingColorFluid.LIGHT_Y_POS * blue); + RendererSwitchingColorFluid.LIGHT_Y_POS * red, + RendererSwitchingColorFluid.LIGHT_Y_POS * green, + RendererSwitchingColorFluid.LIGHT_Y_POS * blue); tessellator.addVertexWithUV(x, y + heightNW, z, dInterpolatedU, dInterpolatedV); tessellator.addVertexWithUV(x, y + heightSW, z + 1, dInterpolatedU2, dInterpolatedV2); @@ -207,15 +214,15 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler rendered = true; tessellator.setBrightness(block.getMixedBrightnessForBlock(iBlockAccess, x, y - 1, z)); tessellator.setColorOpaque_F( - RendererSwitchingColorFluid.LIGHT_Y_NEG * red, - RendererSwitchingColorFluid.LIGHT_Y_NEG * green, - RendererSwitchingColorFluid.LIGHT_Y_NEG * blue); + RendererSwitchingColorFluid.LIGHT_Y_NEG * red, + RendererSwitchingColorFluid.LIGHT_Y_NEG * green, + RendererSwitchingColorFluid.LIGHT_Y_NEG * blue); renderer.renderFaceYNeg( - block, - x, - y + RendererSwitchingColorFluid.RENDER_OFFSET, - z, - this.getNullCheckedIiconOrFallbackTexture()); + block, + x, + y + RendererSwitchingColorFluid.RENDER_OFFSET, + z, + this.getNullCheckedIiconOrFallbackTexture()); } for (int side = 0; side < 4; ++side) { @@ -290,9 +297,9 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler sideLighting = RendererSwitchingColorFluid.LIGHT_XZ_POS; } tessellator.setColorOpaque_F( - RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * red, - RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * green, - RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * blue); + RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * red, + RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * green, + RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * blue); tessellator.addVertexWithUV(dXcoord1, y + dHeight1, dZcoord1, u1Flow, v1Flow); tessellator.addVertexWithUV(dXcoord2, y + dHeight2, dZcoord2, u2Flow, v2Flow); @@ -319,7 +326,8 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler private IIcon getNullCheckedIiconOrFallbackTexture() { return FluidLoader.autogenIIcon != null ? FluidLoader.autogenIIcon - : ((TextureMap) Minecraft.getMinecraft().getTextureManager() - .getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); + : ((TextureMap) Minecraft.getMinecraft() + .getTextureManager() + .getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java index 2e025b27e4..09df8f98f8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java @@ -36,43 +36,52 @@ public class PrefixTextureLinker implements Runnable { private static void fillBlockTexMap() { blockTexMap.put(TextureSet.SET_QUARTZ, TextureSet.INDEX_block4); - Stream.of(OrePrefixes.blockCasing, OrePrefixes.blockCasingAdvanced).forEach(prefixes -> { - HashMap curr = new HashMap<>(); - Arrays.stream(TextureSet.class.getFields()).filter(field -> field.getName().contains("SET")) + Stream.of(OrePrefixes.blockCasing, OrePrefixes.blockCasingAdvanced) + .forEach(prefixes -> { + HashMap curr = new HashMap<>(); + Arrays.stream(TextureSet.class.getFields()) + .filter( + field -> field.getName() + .contains("SET")) .forEach(SET -> { try { curr.put( - (TextureSet) SET.get(null), - new Textures.BlockIcons.CustomIcon( - "materialicons/" + SET.getName().substring(4) + "/" + prefixes)); + (TextureSet) SET.get(null), + new Textures.BlockIcons.CustomIcon( + "materialicons/" + SET.getName() + .substring(4) + "/" + prefixes)); } catch (IllegalAccessException e) { e.printStackTrace(); } }); - texMapBlocks.put(prefixes, curr); - }); + texMapBlocks.put(prefixes, curr); + }); } private static void fillItemTexMap() { Arrays.stream(OrePrefixes.values()) - .filter( - prefixes -> prefixes != OrePrefixes.rod && prefixes.mTextureIndex == -1 - && Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes) != 0) - .forEach(prefixes -> { - HashMap curr = new HashMap<>(); - Arrays.stream(TextureSet.class.getFields()).filter(field -> field.getName().contains("SET")) - .forEach(SET -> { - try { - curr.put( - (TextureSet) SET.get(null), - new Textures.ItemIcons.CustomIcon( - "materialicons/" + SET.getName().substring(4) + "/" + prefixes)); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - }); - texMap.put(prefixes, curr); - }); + .filter( + prefixes -> prefixes != OrePrefixes.rod && prefixes.mTextureIndex == -1 + && Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes) != 0) + .forEach(prefixes -> { + HashMap curr = new HashMap<>(); + Arrays.stream(TextureSet.class.getFields()) + .filter( + field -> field.getName() + .contains("SET")) + .forEach(SET -> { + try { + curr.put( + (TextureSet) SET.get(null), + new Textures.ItemIcons.CustomIcon( + "materialicons/" + SET.getName() + .substring(4) + "/" + prefixes)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + }); + texMap.put(prefixes, curr); + }); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java index 5c596a0b5e..c60f63129a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java @@ -41,7 +41,7 @@ public class BW_GlasBlocks extends BW_Blocks { } public BW_GlasBlocks(String name, String[] texture, short[][] color, CreativeTabs tabs, boolean connectedTex, - boolean fake) { + boolean fake) { super(name, texture, tabs, Material.glass); this.connectedTex = connectedTex; this.color = color; @@ -87,7 +87,7 @@ public class BW_GlasBlocks extends BW_Blocks { String[] splitname = this.textureNames[0].split(":"); for (int j = 0; j < 16; j++) { this.connectedTexture[j] = par1IconRegister - .registerIcon(splitname[0] + ":connectedTex/" + splitname[1] + '/' + splitname[1] + '_' + j); + .registerIcon(splitname[0] + ":connectedTex/" + splitname[1] + '/' + splitname[1] + '_' + j); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java index 24033787c4..4ef12dc30b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks2.java @@ -28,7 +28,7 @@ public class BW_GlasBlocks2 extends BW_Blocks { } public BW_GlasBlocks2(String name, String[] texture, short[][] color, CreativeTabs tabs, boolean connectedTex, - boolean fake) { + boolean fake) { super(name, texture, tabs, Material.glass); this.connectedTex = connectedTex; this.color = color; @@ -74,12 +74,12 @@ public class BW_GlasBlocks2 extends BW_Blocks { String[] splitname = this.textureNames[0].split(":"); for (int j = 0; j < 16; j++) { this.connectedTexture[j] = par1IconRegister.registerIcon( - splitname[0] + ":connectedTex/" - + "BoronSilicateGlassBlock" - + '/' - + "BoronSilicateGlassBlock" - + '_' - + j); + splitname[0] + ":connectedTex/" + + "BoronSilicateGlassBlock" + + '/' + + "BoronSilicateGlassBlock" + + '_' + + j); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index 07db82fcb2..fb8e163ad1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -61,25 +61,28 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI @Override public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int side, float subX, - float subY, float subZ) { + float subY, float subZ) { if (worldObj.isRemote) { return false; } TileEntity tile = worldObj.getTileEntity(x, y, z); if (tile instanceof BW_TileEntity_HeatedWaterPump) { - if (player.getHeldItem() != null - && (player.getHeldItem().getItem().equals(Items.bucket) - || player.getHeldItem().getItem() instanceof IFluidContainerItem) - && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false) != null) - if (player.getHeldItem().getItem().equals(Items.bucket) - && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false).amount == 1000) { - ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, true); - player.getHeldItem().stackSize--; - if (player.getHeldItem().stackSize <= 0) - player.inventory.setInventorySlotContents(player.inventory.currentItem, null); - player.inventory.addItemStackToInventory(new ItemStack(Items.water_bucket)); - return true; - } + if (player.getHeldItem() != null && (player.getHeldItem() + .getItem() + .equals(Items.bucket) + || player.getHeldItem() + .getItem() instanceof IFluidContainerItem) + && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false) != null) + if (player.getHeldItem() + .getItem() + .equals(Items.bucket) && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false).amount == 1000) { + ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, true); + player.getHeldItem().stackSize--; + if (player.getHeldItem().stackSize <= 0) + player.inventory.setInventorySlotContents(player.inventory.currentItem, null); + player.inventory.addItemStackToInventory(new ItemStack(Items.water_bucket)); + return true; + } } if (!player.isSneaking()) { if (tile instanceof IHasGui) { @@ -128,7 +131,7 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI int[] dropSlots = ((ITileDropsContent) t).getDropSlots(); for (int dropSlot : dropSlots) { if (((ITileDropsContent) t).getStackInSlot(dropSlot) != null) world.spawnEntityInWorld( - new EntityItem(world, x, y, z, ((BW_TileEntity_HeatedWaterPump) t).getStackInSlot(dropSlot))); + new EntityItem(world, x, y, z, ((BW_TileEntity_HeatedWaterPump) t).getStackInSlot(dropSlot))); } } super.breakBlock(world, x, y, z, block, meta); @@ -139,8 +142,8 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI public IIcon getIcon(int side, int meta) { if (!ITileHasDifferentTextureSides.class.isAssignableFrom(this.tileEntity)) return super.getIcon(side, meta); try { - return ((ITileHasDifferentTextureSides) this.tileEntity.getConstructor().newInstance()) - .getTextureForSide(side, meta); + return ((ITileHasDifferentTextureSides) this.tileEntity.getConstructor() + .newInstance()).getTextureForSide(side, meta); } catch (Exception e) { e.printStackTrace(); return super.getIcon(side, meta); @@ -152,8 +155,8 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI public void registerBlockIcons(IIconRegister par1IconRegister) { if (ITileHasDifferentTextureSides.class.isAssignableFrom(this.tileEntity)) { try { - ((ITileHasDifferentTextureSides) this.tileEntity.getConstructor().newInstance()) - .registerBlockIcons(par1IconRegister); + ((ITileHasDifferentTextureSides) this.tileEntity.getConstructor() + .newInstance()).registerBlockIcons(par1IconRegister); } catch (Exception e) { e.printStackTrace(); } @@ -163,7 +166,8 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI @Override public TileEntity createNewTileEntity(World worldIn, int meta) { try { - return this.tileEntity.getConstructor().newInstance(); + return this.tileEntity.getConstructor() + .newInstance(); } catch (Exception e) { e.printStackTrace(); } @@ -189,7 +193,8 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI public String[] getInfoData() { if (ITileAddsInformation.class.isAssignableFrom(this.tileEntity)) { try { - return ((ITileAddsInformation) this.tileEntity.getConstructor().newInstance()).getInfoData(); + return ((ITileAddsInformation) this.tileEntity.getConstructor() + .newInstance()).getInfoData(); } catch (Exception e) { e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java index 89d7dfae75..0d1d9fd20b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java @@ -23,7 +23,7 @@ import gregtech.api.GregTech_API; public class BW_TileEntityContainer_MachineBlock extends BW_TileEntityContainer { public BW_TileEntityContainer_MachineBlock(Material p_i45386_1_, Class tileEntity, - String blockName) { + String blockName) { super(p_i45386_1_, tileEntity, blockName); GregTech_API.registerMachineBlock(this, -1); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java index a7b39dcee3..852d8370ad 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java @@ -51,7 +51,7 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { protected IIcon[] texture; public BW_TileEntityContainer_Multiple(Material p_i45386_1_, Class[] tileEntity, - String blockName, String[] textureNames, CreativeTabs tabs) { + String blockName, String[] textureNames, CreativeTabs tabs) { super(p_i45386_1_); this.setHardness(15.0F); this.setResistance(30.0F); @@ -65,7 +65,7 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { @Override public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int side, float subX, - float subY, float subZ) { + float subY, float subZ) { if (worldObj.isRemote) { return true; } @@ -154,7 +154,8 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { @Override public TileEntity createNewTileEntity(World worldIn, int meta) { try { - return this.tileEntityArray[meta].getConstructor().newInstance(); + return this.tileEntityArray[meta].getConstructor() + .newInstance(); } catch (Exception e) { e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java index 28d840ac55..dcd7caee97 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java @@ -40,13 +40,19 @@ public class PrintRecipeListToFile extends CommandBase { try { BufferedWriter fw = new BufferedWriter(new FileWriter(file)); - CraftingManager.getInstance().getRecipeList().forEach(e -> { - try { - fw.write(e.toString() + " = " + e.getRecipeOutput().getDisplayName() + "\n"); - } catch (IOException ex) { - ex.printStackTrace(); - } - }); + CraftingManager.getInstance() + .getRecipeList() + .forEach(e -> { + try { + fw.write( + e.toString() + " = " + + e.getRecipeOutput() + .getDisplayName() + + "\n"); + } catch (IOException ex) { + ex.printStackTrace(); + } + }); fw.flush(); fw.close(); } catch (IOException e) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java index 4bbb719501..5b76d6a163 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/RunGC.java @@ -31,7 +31,8 @@ public class RunGC extends CommandBase { @Override public void processCommand(ICommandSender sender, String[] args) { - Runtime.getRuntime().gc(); + Runtime.getRuntime() + .gc(); sender.addChatMessage(new ChatComponentText("Ran GC!")); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java index 2def53c24e..5b37a98e7e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java @@ -34,11 +34,11 @@ public class SummonRuin extends CommandBase { public void processCommand(ICommandSender iCommandSender, String[] args) { try { new MapGenRuins.RuinsBase().generate( - iCommandSender.getEntityWorld(), - iCommandSender.getEntityWorld().rand, - Integer.parseInt(args[0]), - 256, - Integer.parseInt(args[1])); + iCommandSender.getEntityWorld(), + iCommandSender.getEntityWorld().rand, + Integer.parseInt(args[0]), + 256, + Integer.parseInt(args[1])); } catch (Exception e) { e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 4644775cdb..7c5a515b86 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -72,226 +72,248 @@ public class ConfigHandler { public static boolean disablePistonInEIC = false; private static final int[][] METAFORTIERS_ENERGY = { { 100, 101, 102, 105 }, { 1110, 1115, 1120, 1127 }, - { 1111, 12726, 1116, 1121, 1128 }, { 1112, 12727, 1117, 1122, 1129 }, { 12728, 1190, 1130, 12685 }, - { 1191, 1174, 695, 12686 }, }; + { 1111, 12726, 1116, 1121, 1128 }, { 1112, 12727, 1117, 1122, 1129 }, { 12728, 1190, 1130, 12685 }, + { 1191, 1174, 695, 12686 }, }; private static final int[][] METAFORTIERS_BUFFER = { { 5133, 5123 }, { 161, 171, 181, 191 }, { 162, 172, 182, 192 }, - { 163, 173, 183, 193 }, { 164, 174, 184, 194 }, { 165, 175, 185, 195 }, }; + { 163, 173, 183, 193 }, { 164, 174, 184, 194 }, { 165, 175, 185, 195 }, }; private static final int[][] METAFORTIERS_CABLE = { { 5133, 5123 }, { 1210, 1230, 1250, 1270, 1290 }, - { 1310, 1330, 1350, 1370, 1390 }, { 1410, 1430, 1450, 1470, 1490 }, { 1510, 1530, 1550, 1570, 1590 }, - { 1650, 1670, 1690 }, }; + { 1310, 1330, 1350, 1370, 1390 }, { 1410, 1430, 1450, 1470, 1490 }, { 1510, 1530, 1550, 1570, 1590 }, + { 1650, 1670, 1690 }, }; private static final int[][] METAFORTIERS_MACHINE = { - { 103, 104, 106, 107, 109, 110, 112, 113, 115, 116, 118, 119 }, - { 201, 211, 221, 231, 241, 251, 261, 271, 281, 291, 301, 311, 321, 331, 341, 351, 361, 371, 381, 391, 401, - 411, 421, 431, 441, 451, 461, 471, 481, 491, 501, 511, 521, 531, 541, 551, 561, 571, 581, 591, 601, - 611, 621, 631, 641, 651, 661, 671 }, - { 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 302, 312, 322, 332, 342, 352, 362, 372, 382, 392, 402, - 412, 422, 432, 442, 452, 462, 472, 482, 492, 502, 512, 522, 532, 542, 552, 562, 572, 582, 592, 602, - 612, 622, 632, 642, 652, 662, 672 }, - { 203, 213, 223, 233, 243, 253, 263, 273, 283, 293, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 403, - 413, 423, 433, 443, 453, 463, 473, 483, 493, 503, 513, 523, 533, 543, 553, 563, 573, 583, 593, 603, - 613, 623, 633, 643, 653, 663, 673 }, - { 204, 214, 224, 234, 244, 254, 264, 274, 284, 294, 304, 314, 324, 334, 344, 354, 364, 374, 384, 394, 404, - 414, 424, 434, 444, 454, 464, 474, 484, 494, 504, 514, 524, 534, 544, 554, 564, 574, 584, 594, 604, - 614, 624, 634, 644, 654, 664, 674 }, - { 205, 215, 225, 235, 245, 255, 265, 275, 285, 295, 305, 315, 325, 335, 345, 355, 365, 375, 385, 395, 405, - 415, 425, 435, 445, 455, 465, 475, 485, 495, 505, 515, 525, 535, 545, 555, 565, 575, 585, 595, 605, - 615, 625, 635, 645, 655, 665, 675 }, }; + { 103, 104, 106, 107, 109, 110, 112, 113, 115, 116, 118, 119 }, + { 201, 211, 221, 231, 241, 251, 261, 271, 281, 291, 301, 311, 321, 331, 341, 351, 361, 371, 381, 391, 401, 411, + 421, 431, 441, 451, 461, 471, 481, 491, 501, 511, 521, 531, 541, 551, 561, 571, 581, 591, 601, 611, 621, + 631, 641, 651, 661, 671 }, + { 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 302, 312, 322, 332, 342, 352, 362, 372, 382, 392, 402, 412, + 422, 432, 442, 452, 462, 472, 482, 492, 502, 512, 522, 532, 542, 552, 562, 572, 582, 592, 602, 612, 622, + 632, 642, 652, 662, 672 }, + { 203, 213, 223, 233, 243, 253, 263, 273, 283, 293, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 403, 413, + 423, 433, 443, 453, 463, 473, 483, 493, 503, 513, 523, 533, 543, 553, 563, 573, 583, 593, 603, 613, 623, + 633, 643, 653, 663, 673 }, + { 204, 214, 224, 234, 244, 254, 264, 274, 284, 294, 304, 314, 324, 334, 344, 354, 364, 374, 384, 394, 404, 414, + 424, 434, 444, 454, 464, 474, 484, 494, 504, 514, 524, 534, 544, 554, 564, 574, 584, 594, 604, 614, 624, + 634, 644, 654, 664, 674 }, + { 205, 215, 225, 235, 245, 255, 265, 275, 285, 295, 305, 315, 325, 335, 345, 355, 365, 375, 385, 395, 405, 415, + 425, 435, 445, 455, 465, 475, 485, 495, 505, 515, 525, 535, 545, 555, 565, 575, 585, 595, 605, 615, 625, + 635, 645, 655, 665, 675 }, }; private static int[][][] defaultMetasForTiers = { METAFORTIERS_ENERGY, METAFORTIERS_BUFFER, METAFORTIERS_CABLE, - METAFORTIERS_MACHINE }; + METAFORTIERS_MACHINE }; private static final String[] VOLTAGE_NAMES = { "High Pressure Steam", "Low Voltage", "Medium Voltage", - "High Voltage", "Extreme Voltage", "Insane Voltage", "Ludicrous Voltage", "ZPM Voltage", "Ultimate Voltage", - "Ultimate High Voltage", "Ultimate Extreme Voltage", "Ultimate Insane Voltage", "Ultimate Mega Voltage", - "Ultimate Extended Mega Voltage", "Overpowered Voltage", "Maximum Voltage" }; + "High Voltage", "Extreme Voltage", "Insane Voltage", "Ludicrous Voltage", "ZPM Voltage", "Ultimate Voltage", + "Ultimate High Voltage", "Ultimate Extreme Voltage", "Ultimate Insane Voltage", "Ultimate Mega Voltage", + "Ultimate Extended Mega Voltage", "Overpowered Voltage", "Maximum Voltage" }; private static final String[] names = { "Generators", "Buffers", "Cables", "Machines" }; public ConfigHandler(Configuration C) { ConfigHandler.c = C; - ConfigHandler.classicMode = ConfigHandler.c.get( + ConfigHandler.classicMode = ConfigHandler.c + .get( "System", "Enable Classic Mode", false, - "Enables the classic Mode (all recipes in normal machines are doable in MV").getBoolean(false); + "Enables the classic Mode (all recipes in normal machines are doable in MV") + .getBoolean(false); ConfigHandler.creativeScannerID = ConfigHandler.c - .get("System", "Creative Debug Scanner", 0, "ID for the Creative Debug Scanner Block").getInt(0); + .get("System", "Creative Debug Scanner", 0, "ID for the Creative Debug Scanner Block") + .getInt(0); ConfigHandler.tooltips = ConfigHandler.c - .get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips").getBoolean(true); - ConfigHandler.sharedItemStackTooltip = ConfigHandler.c.get( + .get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips") + .getBoolean(true); + ConfigHandler.sharedItemStackTooltip = ConfigHandler.c + .get( "System", "BartWorksSharedItemStackToolTips", true, - "If you wish to enable \"Shared Item Stack\" tooltips").getBoolean(true); + "If you wish to enable \"Shared Item Stack\" tooltips") + .getBoolean(true); - ConfigHandler.IDOffset = ConfigHandler.c.get( + ConfigHandler.IDOffset = ConfigHandler.c + .get( "System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU - + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS") - .getInt(12600); - ConfigHandler.teslastaff = ConfigHandler.c.get( + + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS") + .getInt(12600); + ConfigHandler.teslastaff = ConfigHandler.c + .get( "System", "Enable Teslastaff", false, - "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); + "Enables the Teslastaff, an Item used to destroy Electric Armors") + .getBoolean(false); ConfigHandler.BioLab = !ConfigHandler.c.get( - "System", - "Disable BioLab", - false, - "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!") - .getBoolean(false); - ConfigHandler.cutoffTier = ConfigHandler.c.get( + "System", + "Disable BioLab", + false, + "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!") + .getBoolean(false); + ConfigHandler.cutoffTier = ConfigHandler.c + .get( "System", "Tier to nerf circuits", 5, "This switch sets the lowest unnerfed Circuit Recipe Tier. -1 to disable it completely.", -1, - VOLTAGE_NAMES.length).getInt(5); + VOLTAGE_NAMES.length) + .getInt(5); ConfigHandler.cutoffTier = ConfigHandler.cutoffTier == -1 ? VOLTAGE_NAMES.length : ConfigHandler.cutoffTier; ConfigHandler.disableExtraGassesForEBF = ConfigHandler.c - .get( - "System", - "Disable Extra Gases for EBF", - false, - "This switch disables extra gas recipes for the EBF, i.e. Xenon instead of Nitrogen") - .getBoolean(false); - ConfigHandler.disableBoltedBlocksCasing = ConfigHandler.c - .get("System", "Disable Bolted Casings", false, "This switch disable the generation of bolted casings") - .getBoolean(false); - ConfigHandler.disableReboltedBlocksCasing = ConfigHandler.c.get( + .get( "System", - "Disable Rebolted Casings", + "Disable Extra Gases for EBF", false, - "This switch disable the generation of rebolted casings").getBoolean(false); + "This switch disables extra gas recipes for the EBF, i.e. Xenon instead of Nitrogen") + .getBoolean(false); + ConfigHandler.disableBoltedBlocksCasing = ConfigHandler.c + .get("System", "Disable Bolted Casings", false, "This switch disable the generation of bolted casings") + .getBoolean(false); + ConfigHandler.disableReboltedBlocksCasing = ConfigHandler.c + .get("System", "Disable Rebolted Casings", false, "This switch disable the generation of rebolted casings") + .getBoolean(false); ConfigHandler.mbWaterperSec = ConfigHandler.c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150) - .getInt(150); + .getInt(150); - ConfigHandler.energyPerCell = ConfigHandler.c.get( + ConfigHandler.energyPerCell = ConfigHandler.c + .get( "Multiblocks", "energyPerLESUCell", 1000000, "This will set Up the Energy per LESU Cell", 1000000, - Integer.MAX_VALUE).getInt(1000000); + Integer.MAX_VALUE) + .getInt(1000000); ConfigHandler.DEHPDirectSteam = ConfigHandler.c.get( - "Multiblocks", - "DEHP Direct Steam Mode", - false, - "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant") - .getBoolean(false); - ConfigHandler.megaMachinesMax = ConfigHandler.c.get( + "Multiblocks", + "DEHP Direct Steam Mode", + false, + "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant") + .getBoolean(false); + ConfigHandler.megaMachinesMax = ConfigHandler.c + .get( "Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, - "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256); + "This changes the Maximum Recipes per Operation to the specified Valure") + .getInt(256); ConfigHandler.bioVatMaxParallelBonus = ConfigHandler.c - .get( - "Multiblocks", - "BioVat Maximum Bonus on Recipes", - 1000, - "This are the maximum parallel Operations the BioVat can do, when the output is half full.") - .getInt(1000); + .get( + "Multiblocks", + "BioVat Maximum Bonus on Recipes", + 1000, + "This are the maximum parallel Operations the BioVat can do, when the output is half full.") + .getInt(1000); ConfigHandler.voidMinerBlacklist = Collections.unmodifiableSet( - new HashSet<>( - Arrays.asList( - ConfigHandler.c.get( - "Multiblocks", - "Void Miner Blacklist", - new String[0], - "This is a blacklist for the Void Miner, blacklisted ores will not enter the drop prize pool. Please fill in the Unique Identifier of Ore and connect Damage with a colon, For example: gregtech:gt.blockores:32") - .getStringList()))); - ConfigHandler.disablePistonInEIC = ConfigHandler.c - .get( + new HashSet<>( + Arrays.asList( + ConfigHandler.c.get( "Multiblocks", - "Disable Electric Implosion Compressor piston", - false, - "This switch completely disables piston animation in Electric Implosion Compressor multiblock") - .getBoolean(false); + "Void Miner Blacklist", + new String[0], + "This is a blacklist for the Void Miner, blacklisted ores will not enter the drop prize pool. Please fill in the Unique Identifier of Ore and connect Damage with a colon, For example: gregtech:gt.blockores:32") + .getStringList()))); + ConfigHandler.disablePistonInEIC = ConfigHandler.c + .get( + "Multiblocks", + "Disable Electric Implosion Compressor piston", + false, + "This switch completely disables piston animation in Electric Implosion Compressor multiblock") + .getBoolean(false); ConfigHandler.pollutionHeatedWaterPumpSecond = ConfigHandler.c - .get( - "Pollution", - "Pollution produced per second by the water pump", - ConfigHandler.pollutionHeatedWaterPumpSecond, - "How much should the Simple Stirling Water Pump produce pollution per second") - .getInt(ConfigHandler.pollutionHeatedWaterPumpSecond); - ConfigHandler.basePollutionMBFSecond = ConfigHandler.c.get( + .get( "Pollution", - "Pollution produced per tick by the MBF per ingot", - ConfigHandler.basePollutionMBFSecond, - "How much should the MBF produce pollution per tick per ingot. Then it'll be multiplied by the amount of ingots done in parallel") - .getInt(ConfigHandler.basePollutionMBFSecond); + "Pollution produced per second by the water pump", + ConfigHandler.pollutionHeatedWaterPumpSecond, + "How much should the Simple Stirling Water Pump produce pollution per second") + .getInt(ConfigHandler.pollutionHeatedWaterPumpSecond); + ConfigHandler.basePollutionMBFSecond = ConfigHandler.c.get( + "Pollution", + "Pollution produced per tick by the MBF per ingot", + ConfigHandler.basePollutionMBFSecond, + "How much should the MBF produce pollution per tick per ingot. Then it'll be multiplied by the amount of ingots done in parallel") + .getInt(ConfigHandler.basePollutionMBFSecond); if (ConfigHandler.IDOffset == 0) { ConfigHandler.IDOffset = 12600; - ConfigHandler.c.get( + ConfigHandler.c + .get( "System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU - + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS") - .set(12600); + + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS") + .set(12600); } ConfigHandler.GTppLogDisabler = ConfigHandler.c - .get("System", "Disable GT++ Logging", false, "Enables or Disables GT++ Logging.").getBoolean(false); + .get("System", "Disable GT++ Logging", false, "Enables or Disables GT++ Logging.") + .getBoolean(false); API_ConfigValues.debugLog = ConfigHandler.c - .get("System", "Enable Debug Log", false, "Enables or Disables the debug log.").getBoolean(false); + .get("System", "Enable Debug Log", false, "Enables or Disables the debug log.") + .getBoolean(false); for (int i = 0; i < BWCoreTransformer.CLASSESBEINGTRANSFORMED.length; i++) - BWCoreTransformer.shouldTransform[i] = ConfigHandler.c.get( + BWCoreTransformer.shouldTransform[i] = ConfigHandler.c + .get( "ASM fixes", BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " - + BWCoreTransformer.CLASSESBEINGTRANSFORMED[i], - true).getBoolean(true); + + BWCoreTransformer.CLASSESBEINGTRANSFORMED[i], + true) + .getBoolean(true); ConfigHandler.enabledPatches = new boolean[BWCoreTransformer.shouldTransform.length]; ConfigHandler.enabledPatches = Arrays - .copyOf(BWCoreTransformer.shouldTransform, BWCoreTransformer.shouldTransform.length); + .copyOf(BWCoreTransformer.shouldTransform, BWCoreTransformer.shouldTransform.length); ConfigHandler.ross128BID = ConfigHandler.c - .get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64); + .get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b") + .getInt(-64); ConfigHandler.ross128BAID = ConfigHandler.c - .get("CrossMod Interactions", "DimID - Ross128ba", -63, "The Dim ID for Ross128ba (Ross128b's Moon)") - .getInt(-63); + .get("CrossMod Interactions", "DimID - Ross128ba", -63, "The Dim ID for Ross128ba (Ross128b's Moon)") + .getInt(-63); ConfigHandler.ross128btier = ConfigHandler.c - .get("CrossMod Interactions", "Rocket Tier - Ross128b", 3, "The Rocket Tier for Ross128b").getInt(3); + .get("CrossMod Interactions", "Rocket Tier - Ross128b", 3, "The Rocket Tier for Ross128b") + .getInt(3); ConfigHandler.ross128batier = ConfigHandler.c - .get("CrossMod Interactions", "Rocket Tier - Ross128ba", 3, "The Rocket Tier for Ross128a").getInt(3); + .get("CrossMod Interactions", "Rocket Tier - Ross128ba", 3, "The Rocket Tier for Ross128a") + .getInt(3); ConfigHandler.ross128bRuinChance = ConfigHandler.c - .get("CrossMod Interactions", "Ruin Chance - Ross128b", 512, "Higher Values mean lesser Ruins.") - .getInt(512); + .get("CrossMod Interactions", "Ruin Chance - Ross128b", 512, "Higher Values mean lesser Ruins.") + .getInt(512); ConfigHandler.Ross128Enabled = ConfigHandler.c - .get( - "CrossMod Interactions", - "Galacticraft - Activate Ross128 System", - true, - "If the Ross128 System should be activated, DO NOT CHANGE AFTER WORLD GENERATION") - .getBoolean(true); - ConfigHandler.landerType = ConfigHandler.c.get( + .get( "CrossMod Interactions", - "LanderType", - 3, - "1 = Moon Lander, 2 = Landing Balloons, 3 = Asteroid Lander").getInt(3); + "Galacticraft - Activate Ross128 System", + true, + "If the Ross128 System should be activated, DO NOT CHANGE AFTER WORLD GENERATION") + .getBoolean(true); + ConfigHandler.landerType = ConfigHandler.c + .get("CrossMod Interactions", "LanderType", 3, "1 = Moon Lander, 2 = Landing Balloons, 3 = Asteroid Lander") + .getInt(3); ConfigHandler.disableMagicalForest = ConfigHandler.c - .get( - "CrossMod Interactions", - "Disable Magical Forest - Ross128b", - false, - "True disables the magical Forest Biome on Ross for more performance during World generation.") - .getBoolean(false); + .get( + "CrossMod Interactions", + "Disable Magical Forest - Ross128b", + false, + "True disables the magical Forest Biome on Ross for more performance during World generation.") + .getBoolean(false); ConfigHandler.maxTierRoss = (byte) ConfigHandler.c - .get("Ross Ruin Metas", "A_Ruin Machine Tiers", 6, "", 0, VOLTAGE_NAMES.length).getInt(6); + .get("Ross Ruin Metas", "A_Ruin Machine Tiers", 6, "", 0, VOLTAGE_NAMES.length) + .getInt(6); ConfigHandler.metasForTiers = new int[4][maxTierRoss][]; for (int i = 0; i < 4; i++) { if (maxTierRoss > ConfigHandler.defaultMetasForTiers[i].length) ConfigHandler.defaultMetasForTiers[i] = new int[maxTierRoss][0]; - for (int j = 0; j < maxTierRoss; j++) ConfigHandler.metasForTiers[i][j] = ConfigHandler.c.get( + for (int j = 0; j < maxTierRoss; j++) ConfigHandler.metasForTiers[i][j] = ConfigHandler.c + .get( "Ross Ruin Metas", j + "_Ruin " + names[i] + " Tier " + VOLTAGE_NAMES[j], - ConfigHandler.defaultMetasForTiers[i][j]).getIntList(); + ConfigHandler.defaultMetasForTiers[i][j]) + .getIntList(); } ConfigHandler.setUpComments(); @@ -305,8 +327,8 @@ public class ConfigHandler { ConfigHandler.c.addCustomCategoryComment("Multiblocks", "Multiblock Options can be set here."); ConfigHandler.c.addCustomCategoryComment("System", "Different System Settings can be set here."); ConfigHandler.c.addCustomCategoryComment( - "CrossMod Interactions", - "CrossMod Interaction Settings can be set here. For Underground Fluid settings change the Gregtech.cfg!"); + "CrossMod Interactions", + "CrossMod Interaction Settings can be set here. For Underground Fluid settings change the Gregtech.cfg!"); ConfigHandler.c.addCustomCategoryComment("Ross Ruin Metas", "Ruin Metas and Tiers can be set here."); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index b3791b51d6..f512e778bc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -38,9 +38,9 @@ import gregtech.api.util.GT_LanguageManager; public class BW_ItemBlocks extends ItemBlock { private final String mNoMobsToolTip = GT_LanguageManager - .addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + .addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); private final String mNoTileEntityToolTip = GT_LanguageManager - .addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + .addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); public BW_ItemBlocks(Block par1) { super(par1); @@ -65,9 +65,9 @@ public class BW_ItemBlocks extends ItemBlock { byte tier = BorosilicateGlass.getTier(this.field_150939_a, aStack.getItemDamage()); if (tier >= 0) { aList.add( - StatCollector.translateToLocal("tooltip.glas.0.name") + " " - + BW_ColorUtil.getColorForTier(tier) - + GT_Values.VN[tier]); + StatCollector.translateToLocal("tooltip.glas.0.name") + " " + + BW_ColorUtil.getColorForTier(tier) + + GT_Values.VN[tier]); } if (this.field_150939_a instanceof ITileAddsInformation) { aList.addAll(Arrays.asList(((ITileAddsInformation) this.field_150939_a).getInfoData())); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java index 62f8b0e666..0b589bf53a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java @@ -51,30 +51,28 @@ public class BW_SimpleWindMeter extends Item { super.addInformation(itemStack, entityPlayer, list, p_77624_4_); list.add(StatCollector.translateToLocal("tooltip.windmeter.0.name")); list.add( - StatCollector.translateToLocal("tooltip.windmeter.1.name") + " " - + (this.getMaxDamage() - this.getDamage(itemStack)) - + "/" - + this.getMaxDamage()); + StatCollector.translateToLocal("tooltip.windmeter.1.name") + " " + + (this.getMaxDamage() - this.getDamage(itemStack)) + + "/" + + this.getMaxDamage()); list.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) { if (entityPlayer.worldObj.isRemote || world == null - || WorldData.get(world) == null - || WorldData.get(world).windSim == null) - return itemStack; + || WorldData.get(world) == null + || WorldData.get(world).windSim == null) return itemStack; float windStrength = (float) WorldData.get(world).windSim.getWindAt(entityPlayer.posY); String windS = windStrength < 1f ? StatCollector.translateToLocal("tooltip.windmeter.2.name") - : windStrength < 10f ? StatCollector.translateToLocal("tooltip.windmeter.3.name") - : windStrength < 20f ? StatCollector.translateToLocal("tooltip.windmeter.4.name") - : windStrength < 30f ? StatCollector.translateToLocal("tooltip.windmeter.5.name") - : windStrength < 50f - ? StatCollector.translateToLocal("tooltip.windmeter.6.name") - : StatCollector.translateToLocal("tooltip.windmeter.7.name"); + : windStrength < 10f ? StatCollector.translateToLocal("tooltip.windmeter.3.name") + : windStrength < 20f ? StatCollector.translateToLocal("tooltip.windmeter.4.name") + : windStrength < 30f ? StatCollector.translateToLocal("tooltip.windmeter.5.name") + : windStrength < 50f ? StatCollector.translateToLocal("tooltip.windmeter.6.name") + : StatCollector.translateToLocal("tooltip.windmeter.7.name"); entityPlayer.addChatMessage( - new ChatComponentText(StatCollector.translateToLocal("tooltip.windmeter.8.name") + " " + windS + ".")); + new ChatComponentText(StatCollector.translateToLocal("tooltip.windmeter.8.name") + " " + windS + ".")); itemStack.damageItem(1, entityPlayer); return itemStack; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index fd875785a7..f58ae8d6e7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -50,7 +50,7 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { private int dura; public BW_Stonage_Rotors(int diameter, float eff, int speed, float mRotor, int min, int max, int durability, - IKineticRotor.GearboxType type, ResourceLocation tex, String Name, String itemTex) { + IKineticRotor.GearboxType type, ResourceLocation tex, String Name, String itemTex) { this.DiaMinMax[0] = diameter; this.DiaMinMax[1] = min; this.DiaMinMax[2] = max; @@ -75,8 +75,7 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { @Override public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { info.add( - StatCollector - .translateToLocalFormatted("ic2.itemrotor.wind.info", this.DiaMinMax[1], this.DiaMinMax[2])); + StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", this.DiaMinMax[1], this.DiaMinMax[2])); IKineticRotor.GearboxType type = null; if (Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator) { type = WATER; @@ -85,10 +84,10 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { } info.add(StatCollector.translateToLocal("tooltip.rotor.0.name") + " " + this.DiaMinMax[0]); info.add( - StatCollector.translateToLocal("tooltip.rotor.1.name") + " " - + (this.getMaxDamageEx() - this.getDamageOfStack(itemStack)) / 100 - + "/" - + this.getMaxDamageEx() / 100); + StatCollector.translateToLocal("tooltip.rotor.1.name") + " " + + (this.getMaxDamageEx() - this.getDamageOfStack(itemStack)) / 100 + + "/" + + this.getMaxDamageEx() / 100); info.add(StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + this.eff); info.add(StatCollector.translateToLocal("tooltip.rotor.3.name") + " " + this.speed); info.add(StatCollector.translateToLocal("tooltip.rotor.4.name") + " " + this.mRotor); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index 7eaea5c3a7..f0c746dd64 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -65,21 +65,21 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem this.setHasSubtypes(false); this.setCreativeTab(MainMod.BWT); GregTech_API.registerCircuitProgrammer( - s -> s.getItem() instanceof Circuit_Programmer && ElectricItem.manager.canUse(s, COST_PER_USE), - (s, p) -> { - ElectricItem.manager.use(s, COST_PER_USE, p); - return s; - }); + s -> s.getItem() instanceof Circuit_Programmer && ElectricItem.manager.canUse(s, COST_PER_USE), + (s, p) -> { + ElectricItem.manager.use(s, COST_PER_USE, p); + return s; + }); } @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); if (aStack != null && aStack.getTagCompound() != null) aList.add( - StatCollector.translateToLocal("tooltip.cp.0.name") + " " - + (aStack.getTagCompound().getBoolean("HasChip") - ? StatCollector.translateToLocal("tooltip.bw.yes.name") - : StatCollector.translateToLocal("tooltip.bw.no.name"))); + StatCollector.translateToLocal("tooltip.cp.0.name") + " " + + (aStack.getTagCompound() + .getBoolean("HasChip") ? StatCollector.translateToLocal("tooltip.bw.yes.name") + : StatCollector.translateToLocal("tooltip.bw.no.name"))); aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @@ -174,11 +174,15 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem if (tag != null && tag.getBoolean(NBT_KEY_HAS_CHIP)) { initialStack = this.createRealCircuit(tag.getByte(NBT_KEY_CHIP_CONFIG)); } - circuitSlotWidget.getMcSlot().putStack(initialStack); + circuitSlotWidget.getMcSlot() + .putStack(initialStack); builder.widget(circuitSlotWidget.setChangeListener(widget -> { - ItemStack stack = widget.getMcSlot().getStack(); - ItemStack heldItem = widget.getContext().getPlayer().getHeldItem(); + ItemStack stack = widget.getMcSlot() + .getStack(); + ItemStack heldItem = widget.getContext() + .getPlayer() + .getHeldItem(); NBTTagCompound tag2 = heldItem.getTagCompound(); if (tag2 == null) { tag2 = new NBTTagCompound(); @@ -191,17 +195,25 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem tag2.setBoolean(NBT_KEY_HAS_CHIP, false); } heldItem.setTagCompound(tag2); - }).setFilter(stack -> this.isProgrammedCircuit(stack) || this.isLVCircuit(stack)) - .setBackground(ModularUITextures.ITEM_SLOT, GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT).setPos(122, 60)); + }) + .setFilter(stack -> this.isProgrammedCircuit(stack) || this.isLVCircuit(stack)) + .setBackground(ModularUITextures.ITEM_SLOT, GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT) + .setPos(122, 60)); for (int i = 0; i < 24; i++) { final int index = i; builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (circuitSlotWidget.getMcSlot().getHasStack() - && this.isProgrammedCircuit(circuitSlotWidget.getMcSlot().getStack())) { - circuitSlotWidget.getMcSlot().putStack(this.createRealCircuit(index + 1)); + if (circuitSlotWidget.getMcSlot() + .getHasStack() + && this.isProgrammedCircuit( + circuitSlotWidget.getMcSlot() + .getStack())) { + circuitSlotWidget.getMcSlot() + .putStack(this.createRealCircuit(index + 1)); } - }).setPos(32 + i % 12 * 18, 21 + i / 12 * 18).setSize(18, 18)); + }) + .setPos(32 + i % 12 * 18, 21 + i / 12 * 18) + .setSize(18, 18)); } return builder.build(); @@ -212,12 +224,15 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem } private boolean isProgrammedCircuit(ItemStack stack) { - return stack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); + return stack.getItem() + .equals( + GT_Utility.getIntegratedCircuit(0) + .getItem()); } private boolean isLVCircuit(ItemStack stack) { return BW_Util.checkStackAndPrefix(stack) - && OrePrefixes.circuit.equals(GT_OreDictUnificator.getAssociation(stack).mPrefix) - && GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial.equals(Materials.Basic); + && OrePrefixes.circuit.equals(GT_OreDictUnificator.getAssociation(stack).mPrefix) + && GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial.equals(Materials.Basic); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java index 81b80f2ed7..37ecfc61d2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -78,9 +78,12 @@ public class GT_Destructopack_Item extends GT_Generic_Item implements IItemWithM public void putStack(ItemStack stack) { this.onSlotChanged(); } - }).setBackground(ModularUITextures.ITEM_SLOT, BW_UITextures.OVERLAY_SLOT_CROSS).setPos(79, 16)).widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT).setSize(17, 17) - .setPos(152, 63)); + }).setBackground(ModularUITextures.ITEM_SLOT, BW_UITextures.OVERLAY_SLOT_CROSS) + .setPos(79, 16)) + .widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT) + .setSize(17, 17) + .setPos(152, 63)); return builder.build(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index d099fa6131..3a132dde22 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -46,7 +46,7 @@ import ic2.api.item.IElectricItem; public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { private static Set mineableBlocks = Sets - .newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); + .newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); private final int mCharge; private final int mTransfer; public int mTier; @@ -81,7 +81,8 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { public void onUpdate(ItemStack aStack, World worldIn, Entity entityIn, int p_77663_4_, boolean p_77663_5_) { if (!ElectricItem.manager.canUse(aStack, 500 * this.multi)) { if (aStack.isItemEnchanted()) { - aStack.getTagCompound().removeTag("ench"); + aStack.getTagCompound() + .removeTag("ench"); } } else if (!aStack.isItemEnchanted()) { aStack.addEnchantment(Enchantment.silkTouch, 3); @@ -90,14 +91,14 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { @Override public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World p_77648_3_, int p_77648_4_, int p_77648_5_, - int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { ElectricItem.manager.use(aStack, 0, aPlayer); return false; } @Override public boolean onBlockDestroyed(ItemStack var1, World var2, Block var3, int var4, int var5, int var6, - EntityLivingBase var7) { + EntityLivingBase var7) { ElectricItem.manager.use(var1, 0, var7); if (ElectricItem.manager.canUse(var1, 500 * this.multi)) { ElectricItem.manager.use(var1, 500 * this.multi, var7); @@ -109,13 +110,21 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { @Override public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) { - return par1Block.getMaterial().equals(Material.glass) || par1Block.getMaterial().equals(Material.clay) - || par1Block.getMaterial().equals(Material.packedIce) - || par1Block.getMaterial().equals(Material.ice) - || par1Block.getMaterial().equals(Material.sand) - || par1Block.getMaterial().equals(Material.ground) - || par1Block.getMaterial().equals(Material.rock) - || mineableBlocks.contains(par1Block); + return par1Block.getMaterial() + .equals(Material.glass) + || par1Block.getMaterial() + .equals(Material.clay) + || par1Block.getMaterial() + .equals(Material.packedIce) + || par1Block.getMaterial() + .equals(Material.ice) + || par1Block.getMaterial() + .equals(Material.sand) + || par1Block.getMaterial() + .equals(Material.ground) + || par1Block.getMaterial() + .equals(Material.rock) + || mineableBlocks.contains(par1Block); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java index bc07762505..6728a791e4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -71,8 +71,8 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { if (aTarget instanceof EntityLiving tTarget && ElectricItem.manager.canUse(aStack, 9000000)) { ElectricItem.manager.use(aStack, 9000000, aPlayer); for (int i = 1; i < 5; ++i) { - if (tTarget.getEquipmentInSlot(i) != null - && tTarget.getEquipmentInSlot(i).getItem() instanceof IElectricItem) { + if (tTarget.getEquipmentInSlot(i) != null && tTarget.getEquipmentInSlot(i) + .getItem() instanceof IElectricItem) { tTarget.setCurrentItemOrArmor(i, null); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java index b18029411f..cb5a65c13b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -47,8 +47,13 @@ public class LabParts extends SimpleSubItemClass { if (itemStack == null || itemStack.getTagCompound() == null) return EnumRarity.common; return switch (itemStack.getItemDamage()) { - case 0 -> BW_Util.getRarityFromByte(itemStack.getTagCompound().getCompoundTag("DNA").getByte("Rarity")); - case 1, 2 -> BW_Util.getRarityFromByte(itemStack.getTagCompound().getByte("Rarity")); + case 0 -> BW_Util.getRarityFromByte( + itemStack.getTagCompound() + .getCompoundTag("DNA") + .getByte("Rarity")); + case 1, 2 -> BW_Util.getRarityFromByte( + itemStack.getTagCompound() + .getByte("Rarity")); default -> EnumRarity.common; }; } @@ -57,9 +62,12 @@ public class LabParts extends SimpleSubItemClass { @SideOnly(Side.CLIENT) public int getColorFromItemStack(ItemStack stack, int p_82790_2_) { if (stack.getItemDamage() == 0 && stack.getTagCompound() != null - && stack.getTagCompound().getIntArray("Color") != null - && stack.getTagCompound().getIntArray("Color").length > 0) { - int[] rgb = stack.getTagCompound().getIntArray("Color"); + && stack.getTagCompound() + .getIntArray("Color") != null + && stack.getTagCompound() + .getIntArray("Color").length > 0) { + int[] rgb = stack.getTagCompound() + .getIntArray("Color"); return BW_ColorUtil.getColorFromRGBArray(rgb); } return super.getColorFromItemStack(stack, p_82790_2_); @@ -93,29 +101,35 @@ public class LabParts extends SimpleSubItemClass { return; } - BioCulture culture = BioCulture.getBioCulture(itemStack.getTagCompound().getString("Name")); + BioCulture culture = BioCulture.getBioCulture( + itemStack.getTagCompound() + .getString("Name")); switch (itemStack.getItemDamage()) { case 0: list.add( - StatCollector.translateToLocal("tooltip.labparts.5.name") + " " - + itemStack.getTagCompound().getString("Name") - + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); - if (!itemStack.getTagCompound().getBoolean("Breedable")) { + StatCollector.translateToLocal("tooltip.labparts.5.name") + " " + + itemStack.getTagCompound() + .getString("Name") + + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); + if (!itemStack.getTagCompound() + .getBoolean("Breedable")) { list.add(StatCollector.translateToLocal("tooltip.labparts.6.name")); } break; case 1: list.add( - StatCollector.translateToLocal("tooltip.labparts.7.name") + " " - + itemStack.getTagCompound().getString("Name") - + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); + StatCollector.translateToLocal("tooltip.labparts.7.name") + " " + + itemStack.getTagCompound() + .getString("Name") + + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); break; case 2: list.add( - StatCollector.translateToLocal("tooltip.labparts.8.name") + " " - + itemStack.getTagCompound().getString("Name") - + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); + StatCollector.translateToLocal("tooltip.labparts.8.name") + " " + + itemStack.getTagCompound() + .getString("Name") + + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); break; default: break; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java index 32b366440b..6268342cce 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java @@ -31,125 +31,168 @@ public class ArtificialMicaLine { public static void runArtificialMicaRecipe() { // Mg + O = MgO - GT_Values.RA.stdBuilder().itemInputs(Materials.Magnesium.getDust(1)).itemOutputs(Materials.Magnesia.getDust(2)) - .fluidInputs(Materials.Oxygen.getGas(1000)).duration(2 * SECONDS).eut(8).addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(Materials.Magnesium.getDust(1)) + .itemOutputs(Materials.Magnesia.getDust(2)) + .fluidInputs(Materials.Oxygen.getGas(1000)) + .duration(2 * SECONDS) + .eut(8) + .addTo(UniversalChemical); // Si + 6HF = H2SiF6 + 4H - GT_Values.RA.stdBuilder().itemInputs(Materials.Silicon.getDust(1), Materials.Empty.getCells(4)) - .itemOutputs(Materials.Hydrogen.getCells(4)).fluidInputs(Materials.HydrofluoricAcid.getFluid(6000)) - .fluidOutputs(WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000)).duration(20 * SECONDS) - .eut(TierEU.RECIPE_MV).addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(Materials.Silicon.getDust(1), Materials.Empty.getCells(4)) + .itemOutputs(Materials.Hydrogen.getCells(4)) + .fluidInputs(Materials.HydrofluoricAcid.getFluid(6000)) + .fluidOutputs(WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000)) + .duration(20 * SECONDS) + .eut(TierEU.RECIPE_MV) + .addTo(UniversalChemical); // K + Cl = KCl - GT_Values.RA.stdBuilder().itemInputs(Materials.Potassium.getDust(1), GT_Utility.getIntegratedCircuit(2)) - .itemOutputs(Materials.RockSalt.getDust(2)).fluidInputs(Materials.Chlorine.getGas(1000)) - .duration(20 * TICKS).eut(8).addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(Materials.Potassium.getDust(1), GT_Utility.getIntegratedCircuit(2)) + .itemOutputs(Materials.RockSalt.getDust(2)) + .fluidInputs(Materials.Chlorine.getGas(1000)) + .duration(20 * TICKS) + .eut(8) + .addTo(UniversalChemical); // 2KCl + H2SiF6 = 2HCl + K2SiF6 - GT_Values.RA.stdBuilder().itemInputs(Materials.RockSalt.getDust(4)) - .itemOutputs(WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 9)) - .fluidInputs(WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000)) - .fluidOutputs(Materials.HydrochloricAcid.getFluid(2000)).duration(1 * SECONDS).eut(8) - .addTo(mixerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(Materials.RockSalt.getDust(4)) + .itemOutputs(WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 9)) + .fluidInputs(WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000)) + .fluidOutputs(Materials.HydrochloricAcid.getFluid(2000)) + .duration(1 * SECONDS) + .eut(8) + .addTo(mixerRecipes); // 2K + CO2 + O = K2CO3 - GT_Values.RA.stdBuilder().itemInputs(Materials.Potassium.getDust(2), Materials.CarbonDioxide.getCells(1)) - .itemOutputs(WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), Materials.Empty.getCells(1)) - .fluidInputs(Materials.Oxygen.getGas(1000)).duration(2 * SECONDS).eut(8).addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(Materials.Potassium.getDust(2), Materials.CarbonDioxide.getCells(1)) + .itemOutputs(WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), Materials.Empty.getCells(1)) + .fluidInputs(Materials.Oxygen.getGas(1000)) + .duration(2 * SECONDS) + .eut(8) + .addTo(UniversalChemical); // K2O + CO2 = K2CO3 - GT_Values.RA.stdBuilder().itemInputs(Materials.Potash.getDust(3), Materials.CarbonDioxide.getCells(1)) - .itemOutputs(WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), Materials.Empty.getCells(1)) - .duration(2 * SECONDS).eut(8).addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(Materials.Potash.getDust(3), Materials.CarbonDioxide.getCells(1)) + .itemOutputs(WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), Materials.Empty.getCells(1)) + .duration(2 * SECONDS) + .eut(8) + .addTo(UniversalChemical); // 55Quartz Dust + 20K2SiF6 + 12Al2O3 + 4K2CO3 = 91Raw Fluorophlogopite Dust GT_Values.RA.stdBuilder() - .itemInputs( - Materials.QuartzSand.getDust(55), - WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), - WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), - WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), - GT_Utility.getIntegratedCircuit(4)) - .itemOutputs( - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27)) - .duration(20 * SECONDS).eut(TierEU.RECIPE_MV).addTo(mixerRecipes); + .itemInputs( + Materials.QuartzSand.getDust(55), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), + WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), + GT_Utility.getIntegratedCircuit(4)) + .itemOutputs( + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27)) + .duration(20 * SECONDS) + .eut(TierEU.RECIPE_MV) + .addTo(mixerRecipes); // 55Quartzite/Nether Quartz Dust + 20K2SiF6 + 57Al2O3 + 4K2CO3 = 136Raw Fluorophlogopite Dust GT_Values.RA.stdBuilder() - .itemInputs( - Materials.Quartzite.getDust(55), - WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), - WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), - WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), - GT_Utility.getIntegratedCircuit(4)) - .itemOutputs( - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8)) - .fluidInputs().fluidOutputs().duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(mixerRecipes); + .itemInputs( + Materials.Quartzite.getDust(55), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), + WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), + GT_Utility.getIntegratedCircuit(4)) + .itemOutputs( + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8)) + .fluidInputs() + .fluidOutputs() + .duration(30 * SECONDS) + .eut(TierEU.RECIPE_MV) + .addTo(mixerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - Materials.NetherQuartz.getDust(55), - WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), - WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), - WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), - GT_Utility.getIntegratedCircuit(4)) - .itemOutputs( - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8)) - .duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(mixerRecipes); + .itemInputs( + Materials.NetherQuartz.getDust(55), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), + WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), + GT_Utility.getIntegratedCircuit(4)) + .itemOutputs( + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8)) + .duration(30 * SECONDS) + .eut(TierEU.RECIPE_MV) + .addTo(mixerRecipes); // 62Certus Quartz Dust + 10K2SiF6 + 12Al2O3 + 7K2CO3 = 91Raw Fluorophlogopite Dust GT_Values.RA.stdBuilder() - .itemInputs( - Materials.CertusQuartz.getDust(62), - WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 10), - WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), - WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 7), - GT_Utility.getIntegratedCircuit(4)) - .itemOutputs( - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), - WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27)) - .duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(mixerRecipes); + .itemInputs( + Materials.CertusQuartz.getDust(62), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 10), + WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 7), + GT_Utility.getIntegratedCircuit(4)) + .itemOutputs( + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27)) + .duration(30 * SECONDS) + .eut(TierEU.RECIPE_MV) + .addTo(mixerRecipes); // MgO(s) = MgO(l) - GT_Values.RA.stdBuilder().itemInputs(Materials.Magnesia.getDust(1)) - .fluidOutputs(Materials.Magnesia.getMolten(144)).duration(20 * TICKS).eut(TierEU.RECIPE_MV) - .addTo(fluidExtractionRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(Materials.Magnesia.getDust(1)) + .fluidOutputs(Materials.Magnesia.getMolten(144)) + .duration(20 * TICKS) + .eut(TierEU.RECIPE_MV) + .addTo(fluidExtractionRecipes); // 27Raw Fluorophlogopite Dust + 720MgO(l) = 4608Fluorophlogopite(l) - GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27)) - .itemOutputs(Materials.Glass.getDust(1)).fluidInputs(BW_GT_MaterialReference.Magnesia.getMolten(720)) - .fluidOutputs(WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(4608)).duration(30 * SECONDS) - .eut(TierEU.RECIPE_HV).metadata(COIL_HEAT, 1700).addTo(blastFurnaceRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27)) + .itemOutputs(Materials.Glass.getDust(1)) + .fluidInputs(BW_GT_MaterialReference.Magnesia.getMolten(720)) + .fluidOutputs(WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(4608)) + .duration(30 * SECONDS) + .eut(TierEU.RECIPE_HV) + .metadata(COIL_HEAT, 1700) + .addTo(blastFurnaceRecipes); // 144Fluorophlogopite(l) = Fluorophlogopite RecipeMaps.vacuumFreezerRecipes.addRecipe( - new GT_Recipe( - false, - new ItemStack[] { ItemList.Shape_Mold_Plate.get(0) }, - new ItemStack[] { WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1) }, - null, - null, - new FluidStack[] { WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(144) }, - null, - 10, - 120, - 0)); + new GT_Recipe( + false, + new ItemStack[] { ItemList.Shape_Mold_Plate.get(0) }, + new ItemStack[] { WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1) }, + null, + null, + new FluidStack[] { WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(144) }, + null, + 10, + 120, + 0)); // Fluorophlogopite = 4Insulator Foil if (NewHorizonsCoreMod.isModLoaded()) { GT_Values.RA.stdBuilder() - .itemInputs( - WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1), - GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(GT_ModHandler.getModItem(NewHorizonsCoreMod.ID, "item.MicaInsulatorFoil", 4)) - .duration(10 * TICKS).eut(600).addTo(benderRecipes); + .itemInputs( + WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1), + GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(GT_ModHandler.getModItem(NewHorizonsCoreMod.ID, "item.MicaInsulatorFoil", 4)) + .duration(10 * TICKS) + .eut(600) + .addTo(benderRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java index cb08db3ba8..88fab90aea 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java @@ -47,36 +47,44 @@ public class BeforeGTPreload implements Runnable { if (didrun) return; // fixing BorosilicateGlass... -_-' Materials.BorosilicateGlass - .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); + .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); Field activeContainer = FieldUtils.getDeclaredField(LoadController.class, "activeContainer", true); ModContainer bartworks = null; - ModContainer gregtech = Loader.instance().activeModContainer(); + ModContainer gregtech = Loader.instance() + .activeModContainer(); boolean switchback = false; LoadController modController = null; - if (!Loader.instance().activeModContainer().getModId().equals(BartWorks.ID)) { + if (!Loader.instance() + .activeModContainer() + .getModId() + .equals(BartWorks.ID)) { Field fieldModController = FieldUtils.getDeclaredField(Loader.class, "modController", true); try { modController = (LoadController) fieldModController.get(Loader.instance()); } catch (IllegalAccessException e) { e.printStackTrace(); - FMLCommonHandler.instance().exitJava(-1, true); + FMLCommonHandler.instance() + .exitJava(-1, true); } assert modController != null; for (ModContainer mod : modController.getActiveModList()) { - if (mod.getModId().equals(BartWorks.ID)) { + if (mod.getModId() + .equals(BartWorks.ID)) { bartworks = mod; } if (bartworks != null) break; } - if (bartworks == null || gregtech == null) FMLCommonHandler.instance().exitJava(-1, true); + if (bartworks == null || gregtech == null) FMLCommonHandler.instance() + .exitJava(-1, true); try { activeContainer.set(modController, bartworks); } catch (IllegalAccessException e) { e.printStackTrace(); - FMLCommonHandler.instance().exitJava(-1, true); + FMLCommonHandler.instance() + .exitJava(-1, true); } switchback = true; } @@ -84,7 +92,8 @@ public class BeforeGTPreload implements Runnable { Block[] bw_glasses; try { bw_glasses = (Block[]) Class.forName("com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry") - .getField("bw_glasses").get(null); + .getField("bw_glasses") + .get(null); GameRegistry.registerBlock(bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); GameRegistry.registerBlock(bw_glasses[1], BW_ItemBlocks.class, "BW_GlasBlocks2"); OreDictionary.registerOre("blockGlassHV", new ItemStack(Blocks.glass, 1, Short.MAX_VALUE)); @@ -102,14 +111,16 @@ public class BeforeGTPreload implements Runnable { OreDictionary.registerOre("blockGlassUMV", new ItemStack(bw_glasses[1], 1, 0)); } catch (IllegalAccessException | NoSuchFieldException | ClassNotFoundException e) { e.printStackTrace(); - FMLCommonHandler.instance().exitJava(-1, true); + FMLCommonHandler.instance() + .exitJava(-1, true); } if (switchback) { try { activeContainer.set(modController, gregtech); } catch (IllegalAccessException e) { e.printStackTrace(); - FMLCommonHandler.instance().exitJava(-1, true); + FMLCommonHandler.instance() + .exitJava(-1, true); } } BeforeGTPreload.didrun = true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java index 04526fec5a..5bf9ff8185 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java @@ -25,19 +25,19 @@ import com.github.bartimaeusnek.bartworks.util.BioPlasmid; public class BioCultureLoader { public static final BioData BIO_DATA_BETA_LACMATASE = BioData - .createAndRegisterBioData("beta-Lactamase", EnumRarity.uncommon, 10000, 0); + .createAndRegisterBioData("beta-Lactamase", EnumRarity.uncommon, 10000, 0); private static final BioData BIO_DATA_YEAST = BioData - .createAndRegisterBioData("Saccharomyces cerevisiae", EnumRarity.common); + .createAndRegisterBioData("Saccharomyces cerevisiae", EnumRarity.common); private static final BioDNA BIO_DNA_WHINE_YEAST = BioDNA - .createAndRegisterBioDNA("Saccharomyces cerevisiae var bayanus", EnumRarity.uncommon); + .createAndRegisterBioDNA("Saccharomyces cerevisiae var bayanus", EnumRarity.uncommon); private static final BioDNA BIO_DNA_BEER_YEAST = BioDNA - .createAndRegisterBioDNA("Saccharomyces cerevisiae var cerevisiae", EnumRarity.uncommon); + .createAndRegisterBioDNA("Saccharomyces cerevisiae var cerevisiae", EnumRarity.uncommon); private static final BioData eColiData = BioData - .createAndRegisterBioData("Escherichia koli", EnumRarity.uncommon, 10000, 0); + .createAndRegisterBioData("Escherichia koli", EnumRarity.uncommon, 10000, 0); private static final BioDNA BIO_DNA_ANAEROBIC_OIL = BioDNA - .createAndRegisterBioDNA("Pseudomonas Veronii", EnumRarity.uncommon); + .createAndRegisterBioDNA("Pseudomonas Veronii", EnumRarity.uncommon); private static final BioData BIO_DATA_ANAEROBIC_OIL = BioData - .createAndRegisterBioData("Pseudomonas Veronii", EnumRarity.uncommon, 5000, 1); + .createAndRegisterBioData("Pseudomonas Veronii", EnumRarity.uncommon, 5000, 1); public static BioCulture CommonYeast; public static BioCulture WhineYeast; public static BioCulture BeerYeast; @@ -48,50 +48,50 @@ public class BioCultureLoader { public static void run() { BioCultureLoader.CommonYeast = BioCulture.createAndRegisterBioCulture( - new Color(255, 248, 200), - "Saccharomyces cerevisiae", - BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), - BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_YEAST), - true); + new Color(255, 248, 200), + "Saccharomyces cerevisiae", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), + BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_YEAST), + true); BioCultureLoader.WhineYeast = BioCulture.createAndRegisterBioCulture( - new Color(255, 248, 200), - "Saccharomyces cerevisiae var bayanus", - BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_WHINE_YEAST), - BioCultureLoader.BIO_DNA_WHINE_YEAST, - EnumRarity.uncommon, - true); + new Color(255, 248, 200), + "Saccharomyces cerevisiae var bayanus", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_WHINE_YEAST), + BioCultureLoader.BIO_DNA_WHINE_YEAST, + EnumRarity.uncommon, + true); BioCultureLoader.BeerYeast = BioCulture.createAndRegisterBioCulture( - new Color(255, 248, 200), - "Saccharomyces cerevisiae var cerevisiae", - BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_BEER_YEAST), - BioCultureLoader.BIO_DNA_BEER_YEAST, - EnumRarity.uncommon, - true); + new Color(255, 248, 200), + "Saccharomyces cerevisiae var cerevisiae", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_BEER_YEAST), + BioCultureLoader.BIO_DNA_BEER_YEAST, + EnumRarity.uncommon, + true); BioCultureLoader.rottenFleshBacteria = BioCulture.createAndRegisterBioCulture( - new Color(110, 40, 25), - "Escherichia cadaver", - BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_BETA_LACMATASE), - BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_BETA_LACMATASE), - false); + new Color(110, 40, 25), + "Escherichia cadaver", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_BETA_LACMATASE), + BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_BETA_LACMATASE), + false); BioCultureLoader.eColi = BioCulture.createAndRegisterBioCulture( - new Color(149, 132, 75), - "Escherichia koli", - BioPlasmid.convertDataToPlasmid(BioCultureLoader.eColiData), - BioDNA.convertDataToDNA(BioCultureLoader.eColiData), - true); + new Color(149, 132, 75), + "Escherichia koli", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.eColiData), + BioDNA.convertDataToDNA(BioCultureLoader.eColiData), + true); BioCultureLoader.anaerobicOil = BioCulture.createAndRegisterBioCulture( - new Color(0, 0, 0), - "Pseudomonas Veronii", - BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_ANAEROBIC_OIL), - BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_ANAEROBIC_OIL), - true); + new Color(0, 0, 0), + "Pseudomonas Veronii", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_ANAEROBIC_OIL), + BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_ANAEROBIC_OIL), + true); BioCultureLoader.generalPurposeFermentingBacteria = BioCulture.createAndRegisterBioCulture( - new Color(127, 69, 26), - "Saccharomyces escherichia", - BioCultureLoader.CommonYeast.getPlasmid(), - BioCultureLoader.eColi.getdDNA(), - EnumRarity.epic, - true); + new Color(127, 69, 26), + "Saccharomyces escherichia", + BioCultureLoader.CommonYeast.getPlasmid(), + BioCultureLoader.eColi.getdDNA(), + EnumRarity.epic, + true); BioCultureLoader.CommonYeast.setLocalisedName("Common Yeast"); BioCultureLoader.WhineYeast.setLocalisedName("Whine Yeast"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java index ed0489c9a3..8b86d4cd93 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java @@ -33,14 +33,14 @@ public class BioItemList { private BioItemList() {} private static final Item mItemBioLabParts = new LabModule( - new String[] { "DNAExtractionModule", "PCRThermoclyclingModule", "PlasmidSynthesisModule", - "TransformationModule", "ClonalCellularSynthesisModule" }); + new String[] { "DNAExtractionModule", "PCRThermoclyclingModule", "PlasmidSynthesisModule", + "TransformationModule", "ClonalCellularSynthesisModule" }); public static final ItemStack[] mBioLabParts = { new ItemStack(BioItemList.mItemBioLabParts), - new ItemStack(BioItemList.mItemBioLabParts, 1, 1), new ItemStack(BioItemList.mItemBioLabParts, 1, 2), - new ItemStack(BioItemList.mItemBioLabParts, 1, 3), new ItemStack(BioItemList.mItemBioLabParts, 1, 4) }; + new ItemStack(BioItemList.mItemBioLabParts, 1, 1), new ItemStack(BioItemList.mItemBioLabParts, 1, 2), + new ItemStack(BioItemList.mItemBioLabParts, 1, 3), new ItemStack(BioItemList.mItemBioLabParts, 1, 4) }; private static final Item vanillaBioLabParts = new LabParts( - new String[] { "petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", - "IncubationModule", "PlasmaMembrane" }); + new String[] { "petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", "IncubationModule", + "PlasmaMembrane" }); public static void registerBioItems() { GameRegistry.registerItem(BioItemList.mItemBioLabParts, "BioLabModules"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index e4f2c73e32..abed08eb5e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -41,121 +41,121 @@ public class BioRecipeLoader { public static void registerWaterBasedBioLabIncubations() { FluidStack[] easyFluids = { Materials.Water.getFluid(1000L), - FluidRegistry.getFluidStack("ic2distilledwater", 1000) }; + FluidRegistry.getFluidStack("ic2distilledwater", 1000) }; for (FluidStack fluidStack : easyFluids) { BWRecipes.instance.addBioLabRecipeIncubation( - new ItemStack(Items.rotten_flesh), - BioCultureLoader.rottenFleshBacteria, - new int[] { 3300 }, - new FluidStack[] { fluidStack }, - 500, - (int) TierEU.RECIPE_HV, - BW_Util.STANDART); + new ItemStack(Items.rotten_flesh), + BioCultureLoader.rottenFleshBacteria, + new int[] { 3300 }, + new FluidStack[] { fluidStack }, + 500, + (int) TierEU.RECIPE_HV, + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( - new ItemStack(Items.fermented_spider_eye), - BioCultureLoader.eColi, - new int[] { 4500 }, - new FluidStack[] { fluidStack }, - 500, - (int) TierEU.RECIPE_HV, - BW_Util.STANDART); + new ItemStack(Items.fermented_spider_eye), + BioCultureLoader.eColi, + new int[] { 4500 }, + new FluidStack[] { fluidStack }, + 500, + (int) TierEU.RECIPE_HV, + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( - ItemList.Food_Dough.get(1L), - BioCultureLoader.CommonYeast, - new int[] { 7500 }, - new FluidStack[] { fluidStack }, - 500, - (int) TierEU.RECIPE_HV, - BW_Util.STANDART); + ItemList.Food_Dough.get(1L), + BioCultureLoader.CommonYeast, + new int[] { 7500 }, + new FluidStack[] { fluidStack }, + 500, + (int) TierEU.RECIPE_HV, + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( - ItemList.Food_Dough_Sugar.get(1L), - BioCultureLoader.WhineYeast, - new int[] { 2500 }, - new FluidStack[] { fluidStack }, - 500, - (int) TierEU.RECIPE_HV, - BW_Util.STANDART); + ItemList.Food_Dough_Sugar.get(1L), + BioCultureLoader.WhineYeast, + new int[] { 2500 }, + new FluidStack[] { fluidStack }, + 500, + (int) TierEU.RECIPE_HV, + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( - ItemList.Bottle_Wine.get(1L), - BioCultureLoader.WhineYeast, - new int[] { 3300 }, - new FluidStack[] { fluidStack }, - 500, - (int) TierEU.RECIPE_HV, - BW_Util.STANDART); + ItemList.Bottle_Wine.get(1L), + BioCultureLoader.WhineYeast, + new int[] { 3300 }, + new FluidStack[] { fluidStack }, + 500, + (int) TierEU.RECIPE_HV, + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( - ItemList.Bottle_Beer.get(1L), - BioCultureLoader.BeerYeast, - new int[] { 2500 }, - new FluidStack[] { fluidStack }, - 500, - (int) TierEU.RECIPE_HV, - BW_Util.STANDART); + ItemList.Bottle_Beer.get(1L), + BioCultureLoader.BeerYeast, + new int[] { 2500 }, + new FluidStack[] { fluidStack }, + 500, + (int) TierEU.RECIPE_HV, + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( - ItemList.Bottle_Dark_Beer.get(1L), - BioCultureLoader.BeerYeast, - new int[] { 3300 }, - new FluidStack[] { fluidStack }, - 500, - (int) TierEU.RECIPE_HV, - BW_Util.STANDART); + ItemList.Bottle_Dark_Beer.get(1L), + BioCultureLoader.BeerYeast, + new int[] { 3300 }, + new FluidStack[] { fluidStack }, + 500, + (int) TierEU.RECIPE_HV, + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( - new ItemStack(Blocks.dirt), - BioCultureLoader.anaerobicOil, - new int[] { 100 }, - new FluidStack[] { fluidStack }, - 1500, - (int) TierEU.RECIPE_EV, - BW_Util.STANDART); + new ItemStack(Blocks.dirt), + BioCultureLoader.anaerobicOil, + new int[] { 100 }, + new FluidStack[] { fluidStack }, + 1500, + (int) TierEU.RECIPE_EV, + BW_Util.STANDART); } } public static void registerWaterBasedBacterialVatRecipes() { FluidStack[] easyFluids = { Materials.Water.getFluid(1000L), - FluidRegistry.getFluidStack("ic2distilledwater", 1000) }; + FluidRegistry.getFluidStack("ic2distilledwater", 1000) }; for (FluidStack fluidStack : easyFluids) { if (CropsPlusPlus.isModLoaded()) { BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[] { new ItemStack(Items.sugar, 64) }, - new FluidStack[] { new FluidStack(fluidStack, 100) }, - BioCultureLoader.CommonYeast, - new FluidStack[] { FluidRegistry.getFluidStack("potion.ghp", 1) }, - 350, - (int) TierEU.RECIPE_EV); + new ItemStack[] { new ItemStack(Items.sugar, 64) }, + new FluidStack[] { new FluidStack(fluidStack, 100) }, + BioCultureLoader.CommonYeast, + new FluidStack[] { FluidRegistry.getFluidStack("potion.ghp", 1) }, + 350, + (int) TierEU.RECIPE_EV); } BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[] { ItemList.Crop_Drop_Grapes.get(16) }, - new FluidStack[] { new FluidStack(fluidStack, 100) }, - BioCultureLoader.WhineYeast, - new FluidStack[] { FluidRegistry.getFluidStack("potion.wine", 12) }, - 200, - (int) TierEU.RECIPE_MV); + new ItemStack[] { ItemList.Crop_Drop_Grapes.get(16) }, + new FluidStack[] { new FluidStack(fluidStack, 100) }, + BioCultureLoader.WhineYeast, + new FluidStack[] { FluidRegistry.getFluidStack("potion.wine", 12) }, + 200, + (int) TierEU.RECIPE_MV); BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[] { new ItemStack(Items.sugar, 4), ItemList.IC2_Hops.get(16L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 8L) }, - new FluidStack[] { new FluidStack(fluidStack, 100) }, - BioCultureLoader.BeerYeast, - new FluidStack[] { FluidRegistry.getFluidStack("potion.beer", 5) }, - 600, - (int) TierEU.RECIPE_LV); + new ItemStack[] { new ItemStack(Items.sugar, 4), ItemList.IC2_Hops.get(16L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 8L) }, + new FluidStack[] { new FluidStack(fluidStack, 100) }, + BioCultureLoader.BeerYeast, + new FluidStack[] { FluidRegistry.getFluidStack("potion.beer", 5) }, + 600, + (int) TierEU.RECIPE_LV); BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[] { ItemList.IC2_Hops.get(32L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 16L) }, - new FluidStack[] { new FluidStack(fluidStack, 100) }, - BioCultureLoader.BeerYeast, - new FluidStack[] { FluidRegistry.getFluidStack("potion.darkbeer", 10) }, - 600, - (int) TierEU.RECIPE_LV); + new ItemStack[] { ItemList.IC2_Hops.get(32L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 16L) }, + new FluidStack[] { new FluidStack(fluidStack, 100) }, + BioCultureLoader.BeerYeast, + new FluidStack[] { FluidRegistry.getFluidStack("potion.darkbeer", 10) }, + 600, + (int) TierEU.RECIPE_LV); } } @@ -163,31 +163,32 @@ public class BioRecipeLoader { registerWaterBasedBacterialVatRecipes(); BWRecipes.instance.addBacterialVatRecipe( - null, - new FluidStack[] { FluidRegistry.getFluidStack("potion.grapejuice", 100) }, - BioCultureLoader.WhineYeast, - new FluidStack[] { FluidRegistry.getFluidStack("potion.wine", 12) }, - 400, - (int) TierEU.RECIPE_LV); + null, + new FluidStack[] { FluidRegistry.getFluidStack("potion.grapejuice", 100) }, + BioCultureLoader.WhineYeast, + new FluidStack[] { FluidRegistry.getFluidStack("potion.wine", 12) }, + 400, + (int) TierEU.RECIPE_LV); BWRecipes.instance.addBacterialVatRecipe( - null, - new FluidStack[] { Materials.FermentedBiomass.getFluid(10000) }, - BioCultureLoader.anaerobicOil, - new FluidStack[] { new FluidStack(FluidLoader.fulvicAcid, 1000) }, - 2748, - (int) TierEU.RECIPE_HV); + null, + new FluidStack[] { Materials.FermentedBiomass.getFluid(10000) }, + BioCultureLoader.anaerobicOil, + new FluidStack[] { new FluidStack(FluidLoader.fulvicAcid, 1000) }, + 2748, + (int) TierEU.RECIPE_HV); } public static void runOnServerStarted() { - RecipeMaps.fermentingRecipes.getAllRecipes().forEach( + RecipeMaps.fermentingRecipes.getAllRecipes() + .forEach( recipe -> BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[] { null }, - BioCultureLoader.generalPurposeFermentingBacteria, - recipe.mFluidInputs, - recipe.mFluidOutputs, - recipe.mDuration, - recipe.mEUt, - GT_Utility.getTier(recipe.mEUt))); + new ItemStack[] { null }, + BioCultureLoader.generalPurposeFermentingBacteria, + recipe.mFluidInputs, + recipe.mFluidOutputs, + recipe.mDuration, + recipe.mEUt, + GT_Utility.getTier(recipe.mEUt))); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java index d3da5e1373..1a7e49aaa3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java @@ -25,23 +25,15 @@ import gregtech.api.util.GT_OreDictUnificator; public class ElectricImplosionCompressorRecipes implements Runnable { private static void addElectricImplosionRecipe(final ItemStack[] inputItems, final FluidStack[] inputFluids, - final ItemStack[] outputItems, final FluidStack[] outputFluids, final int durationInTicks, - final int EUPerTick) { - BartWorksRecipeMaps.electricImplosionCompressorRecipes.addRecipe( - false, - inputItems, - outputItems, - null, - inputFluids, - outputFluids, - durationInTicks, - EUPerTick, - 1); + final ItemStack[] outputItems, final FluidStack[] outputFluids, final int durationInTicks, + final int EUPerTick) { + BartWorksRecipeMaps.electricImplosionCompressorRecipes + .addRecipe(false, inputItems, outputItems, null, inputFluids, outputFluids, durationInTicks, EUPerTick, 1); } private static final ItemStack[] circuits = { ItemList.Circuit_ExoticProcessor.get(1), - ItemList.Circuit_OpticalAssembly.get(1), ItemList.Circuit_Biowaresupercomputer.get(1), - ItemList.Circuit_Wetwaremainframe.get(1) }; + ItemList.Circuit_OpticalAssembly.get(1), ItemList.Circuit_Biowaresupercomputer.get(1), + ItemList.Circuit_Wetwaremainframe.get(1) }; @Override public void run() { @@ -50,127 +42,127 @@ public class ElectricImplosionCompressorRecipes implements Runnable { if (EternalSingularity.isModLoaded()) { addElectricImplosionRecipe( - // IN. - new ItemStack[] { GT_Values.NI }, - new FluidStack[] { MaterialsUEVplus.SpaceTime.getMolten(72L) }, - // OUT. - new ItemStack[] { getModItem(EternalSingularity.ID, "eternal_singularity", 1L) }, - new FluidStack[] { GT_Values.NF }, - // Recipe stats. - 100 * 20, - (int) TierEU.RECIPE_UMV); + // IN. + new ItemStack[] { GT_Values.NI }, + new FluidStack[] { MaterialsUEVplus.SpaceTime.getMolten(72L) }, + // OUT. + new ItemStack[] { getModItem(EternalSingularity.ID, "eternal_singularity", 1L) }, + new FluidStack[] { GT_Values.NF }, + // Recipe stats. + 100 * 20, + (int) TierEU.RECIPE_UMV); if (UniversalSingularities.isModLoaded()) // Raw Exposed Optical Chip addElectricImplosionRecipe( - // IN. - new ItemStack[] { ItemList.Circuit_Silicon_Wafer7.get(1L), - // Fluxed Electrum Singularity. - getModItem(UniversalSingularities.ID, "universal.general.singularity", 1L, 20) }, - new FluidStack[] { GT_Values.NF }, - // OUT. - new ItemStack[] { ItemList.Circuit_Chip_Optical.get(16L) }, - new FluidStack[] { GT_Values.NF }, - 5 * 20, - (int) TierEU.RECIPE_UMV); + // IN. + new ItemStack[] { ItemList.Circuit_Silicon_Wafer7.get(1L), + // Fluxed Electrum Singularity. + getModItem(UniversalSingularities.ID, "universal.general.singularity", 1L, 20) }, + new FluidStack[] { GT_Values.NF }, + // OUT. + new ItemStack[] { ItemList.Circuit_Chip_Optical.get(16L) }, + new FluidStack[] { GT_Values.NF }, + 5 * 20, + (int) TierEU.RECIPE_UMV); } addElectricImplosionRecipe( - // IN. - new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityPlutoniumNugget", 5L) }, - new FluidStack[] { Materials.Neutronium.getMolten(72L) }, - // OUT. - new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityPlutonium", 1L) }, - new FluidStack[] { GT_Values.NF }, - // Recipe stats. - 1, - (int) TierEU.RECIPE_UEV); + // IN. + new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityPlutoniumNugget", 5L) }, + new FluidStack[] { Materials.Neutronium.getMolten(72L) }, + // OUT. + new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityPlutonium", 1L) }, + new FluidStack[] { GT_Values.NF }, + // Recipe stats. + 1, + (int) TierEU.RECIPE_UEV); addElectricImplosionRecipe( - // IN. - new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityUraniumNugget", 5L) }, - new FluidStack[] { Materials.Neutronium.getMolten(72L) }, - // OUT. - new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityUranium", 1L) }, - new FluidStack[] { GT_Values.NF }, - // Recipe stats. - 1, - (int) TierEU.RECIPE_UEV); + // IN. + new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityUraniumNugget", 5L) }, + new FluidStack[] { Materials.Neutronium.getMolten(72L) }, + // OUT. + new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityUranium", 1L) }, + new FluidStack[] { GT_Values.NF }, + // Recipe stats. + 1, + (int) TierEU.RECIPE_UEV); addElectricImplosionRecipe( - // IN. - new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityThoriumNugget", 5L) }, - new FluidStack[] { Materials.Neutronium.getMolten(72L) }, - // OUT. - new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityThorium", 1L) }, - new FluidStack[] { GT_Values.NF }, - // Recipe stats. - 1, - (int) TierEU.RECIPE_UEV); + // IN. + new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityThoriumNugget", 5L) }, + new FluidStack[] { Materials.Neutronium.getMolten(72L) }, + // OUT. + new ItemStack[] { getModItem(GoodGenerator.ID, "highDensityThorium", 1L) }, + new FluidStack[] { GT_Values.NF }, + // Recipe stats. + 1, + (int) TierEU.RECIPE_UEV); // Magneto material recipe for base fluid. addElectricImplosionRecipe( - // IN. - new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.nanite, MaterialsUEVplus.WhiteDwarfMatter, 1L), - GT_OreDictUnificator.get(OrePrefixes.nanite, MaterialsUEVplus.Universium, 1L), - GT_OreDictUnificator.get(OrePrefixes.nanite, MaterialsUEVplus.BlackDwarfMatter, 1L) }, - new FluidStack[] { MaterialsUEVplus.RawStarMatter.getFluid(64 * 144L) }, - // OUT. - new ItemStack[] { GT_Values.NI }, - new FluidStack[] { MaterialsUEVplus.MagnetohydrodynamicallyConstrainedStarMatter.getMolten(16 * 144L) }, - // Recipe stats. - 20 * 4, - (int) TierEU.RECIPE_UXV); + // IN. + new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.nanite, MaterialsUEVplus.WhiteDwarfMatter, 1L), + GT_OreDictUnificator.get(OrePrefixes.nanite, MaterialsUEVplus.Universium, 1L), + GT_OreDictUnificator.get(OrePrefixes.nanite, MaterialsUEVplus.BlackDwarfMatter, 1L) }, + new FluidStack[] { MaterialsUEVplus.RawStarMatter.getFluid(64 * 144L) }, + // OUT. + new ItemStack[] { GT_Values.NI }, + new FluidStack[] { MaterialsUEVplus.MagnetohydrodynamicallyConstrainedStarMatter.getMolten(16 * 144L) }, + // Recipe stats. + 20 * 4, + (int) TierEU.RECIPE_UXV); // Infinity Catalyst addElectricImplosionRecipe( + // IN. + new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.InfinityCatalyst, 64L), }, + new FluidStack[] { GT_Values.NF }, + // OUT. + new ItemStack[] { getModItem(Avaritia.ID, "Resource", 1L, 5) }, + new FluidStack[] { GT_Values.NF }, + // Recipe stats. + 1 * 1, + (int) TierEU.RECIPE_UIV); + + if (UniversalSingularities.isModLoaded()) { + // Fluxed Singularity + addElectricImplosionRecipe( // IN. - new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.InfinityCatalyst, 64L), }, + new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.block, Materials.ElectrumFlux, 16L), }, new FluidStack[] { GT_Values.NF }, // OUT. - new ItemStack[] { getModItem(Avaritia.ID, "Resource", 1L, 5) }, + new ItemStack[] { getModItem(UniversalSingularities.ID, "universal.general.singularity", 1L, 20) }, new FluidStack[] { GT_Values.NF }, // Recipe stats. 1 * 1, (int) TierEU.RECIPE_UIV); - if (UniversalSingularities.isModLoaded()) { - // Fluxed Singularity - addElectricImplosionRecipe( - // IN. - new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.block, Materials.ElectrumFlux, 16L), }, - new FluidStack[] { GT_Values.NF }, - // OUT. - new ItemStack[] { getModItem(UniversalSingularities.ID, "universal.general.singularity", 1L, 20) }, - new FluidStack[] { GT_Values.NF }, - // Recipe stats. - 1 * 1, - (int) TierEU.RECIPE_UIV); - // Iron Singularity addElectricImplosionRecipe( - // IN. - new ItemStack[] { GT_Values.NI }, - new FluidStack[] { Materials.Iron.getMolten(7296 * 9 * 144L) }, - // OUT. - new ItemStack[] { getModItem(Avaritia.ID, "Singularity", 1L, 0) }, - new FluidStack[] { GT_Values.NF }, - // Recipe stats. - 1 * 1, - (int) TierEU.RECIPE_UIV); - } - // MHDCSM V2 - addElectricImplosionRecipe( // IN. - new ItemStack[] { MaterialsUEVplus.Eternity.getNanite(1), MaterialsUEVplus.Universium.getNanite(1) }, - new FluidStack[] { MaterialsUEVplus.RawStarMatter.getFluid(128 * 144L) }, - // OUT. new ItemStack[] { GT_Values.NI }, - new FluidStack[] { MaterialsUEVplus.MagnetohydrodynamicallyConstrainedStarMatter.getMolten(32 * 144L) }, + new FluidStack[] { Materials.Iron.getMolten(7296 * 9 * 144L) }, + // OUT. + new ItemStack[] { getModItem(Avaritia.ID, "Singularity", 1L, 0) }, + new FluidStack[] { GT_Values.NF }, // Recipe stats. - 20 * 4, - (int) TierEU.RECIPE_MAX); + 1 * 1, + (int) TierEU.RECIPE_UIV); + } + // MHDCSM V2 + addElectricImplosionRecipe( + // IN. + new ItemStack[] { MaterialsUEVplus.Eternity.getNanite(1), MaterialsUEVplus.Universium.getNanite(1) }, + new FluidStack[] { MaterialsUEVplus.RawStarMatter.getFluid(128 * 144L) }, + // OUT. + new ItemStack[] { GT_Values.NI }, + new FluidStack[] { MaterialsUEVplus.MagnetohydrodynamicallyConstrainedStarMatter.getMolten(32 * 144L) }, + // Recipe stats. + 20 * 4, + (int) TierEU.RECIPE_MAX); this.addMagnetohydrodynamicallyConstrainedStarMatterPartRecipes(); } @@ -199,23 +191,23 @@ public class ElectricImplosionCompressorRecipes implements Runnable { } private void addWhiteDwarfMagnetoEICRecipe(final OrePrefixes part, final int multiplier, - final int circuitMultiplier) { + final int circuitMultiplier) { final int partFraction = (int) (144 * part.mMaterialAmount / M); for (ItemStack circuit : circuits) { addElectricImplosionRecipe( - new ItemStack[] { circuit.splitStack(circuitMultiplier), - getModItem(SuperSolarPanels.ID, "solarsplitter", 1, 0), - getModItem(OpenComputers.ID, "hologram2", circuitMultiplier, 0), - GT_OreDictUnificator.get(part, MaterialsUEVplus.Eternity, multiplier), }, - new FluidStack[] { MaterialsUEVplus.MagnetohydrodynamicallyConstrainedStarMatter - .getMolten((long) partFraction * multiplier) }, - new ItemStack[] { GT_OreDictUnificator - .get(part, MaterialsUEVplus.MagnetohydrodynamicallyConstrainedStarMatter, multiplier) }, - new FluidStack[] { GT_Values.NF }, - (int) (multiplier * (20 * partFraction / 144.0)), - (int) TierEU.RECIPE_UXV); + new ItemStack[] { circuit.splitStack(circuitMultiplier), + getModItem(SuperSolarPanels.ID, "solarsplitter", 1, 0), + getModItem(OpenComputers.ID, "hologram2", circuitMultiplier, 0), + GT_OreDictUnificator.get(part, MaterialsUEVplus.Eternity, multiplier), }, + new FluidStack[] { MaterialsUEVplus.MagnetohydrodynamicallyConstrainedStarMatter + .getMolten((long) partFraction * multiplier) }, + new ItemStack[] { GT_OreDictUnificator + .get(part, MaterialsUEVplus.MagnetohydrodynamicallyConstrainedStarMatter, multiplier) }, + new FluidStack[] { GT_Values.NF }, + (int) (multiplier * (20 * partFraction / 144.0)), + (int) TierEU.RECIPE_UXV); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index c843297771..809e52e6d1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -61,42 +61,55 @@ public class FluidLoader { renderID = RenderingRegistry.getNextAvailableRenderId(); ff = new Fluid("BWfakeFluid"); GregTech_API.sGTBlockIconload.add( - () -> ff.setIcons( - GregTech_API.sBlockIcons - .registerIcon(GregTech.getResourcePath("fluids", "fluid.molten.autogenerated")))); + () -> ff.setIcons( + GregTech_API.sBlockIcons + .registerIcon(GregTech.getResourcePath("fluids", "fluid.molten.autogenerated")))); fulvicAcid = createAndRegisterFluid("Fulvic Acid", new Color(20, 20, 20)); heatedfulvicAcid = createAndRegisterFluid("Heated Fulvic Acid", new Color(40, 20, 20), 720); Kerogen = createAndRegisterFluid("Kerogen", new Color(85, 85, 85)); BioLabFluidMaterials = new Fluid[] { createAndRegisterFluid("FluorecentdDNA", new Color(125, 50, 170)), - createAndRegisterFluid("EnzymesSollution", new Color(240, 200, 125)), - createAndRegisterFluid("Penicillin", new Color(255, 255, 255)), - createAndRegisterFluid("Polymerase", new Color(110, 180, 110)) }; + createAndRegisterFluid("EnzymesSollution", new Color(240, 200, 125)), + createAndRegisterFluid("Penicillin", new Color(255, 255, 255)), + createAndRegisterFluid("Polymerase", new Color(110, 180, 110)) }; BioLabFluidCells = new ItemStack[BioLabFluidMaterials.length]; GT_MetaGenerated_Item_98.FluidCell[] fluidCells = { GT_MetaGenerated_Item_98.FluidCell.FLUORESCENT_DNA, - GT_MetaGenerated_Item_98.FluidCell.ENZYME_SOLUTION, GT_MetaGenerated_Item_98.FluidCell.PENICILLIN, - GT_MetaGenerated_Item_98.FluidCell.POLYMERASE, }; + GT_MetaGenerated_Item_98.FluidCell.ENZYME_SOLUTION, GT_MetaGenerated_Item_98.FluidCell.PENICILLIN, + GT_MetaGenerated_Item_98.FluidCell.POLYMERASE, }; for (int i = 0; i < fluidCells.length; i++) { BioLabFluidCells[i] = fluidCells[i].get(); } FluidStack dnaFluid = Gendustry.isModLoaded() ? FluidRegistry.getFluidStack("liquiddna", 100) - : Materials.Biomass.getFluid(100L); + : Materials.Biomass.getFluid(100L); for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.isBreedable()) { B.setFluid( - GT_FluidFactory.builder(B.getName().replace(" ", "").toLowerCase() + "fluid") - .withTextureName("molten.autogenerated") - .withColorRGBA( - new short[] { (short) B.getColor().getRed(), (short) B.getColor().getBlue(), - (short) B.getColor().getGreen() }) - .withLocalizedName(B.getLocalisedName() + " Fluid") - .withStateAndTemperature(FluidState.LIQUID, 300).buildAndRegister().asFluid()); - - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)) - .fluidInputs(new FluidStack(B.getFluid(), 1000)).fluidOutputs(dnaFluid).duration(25 * SECONDS) - .eut(TierEU.RECIPE_MV).addTo(centrifugeRecipes); + GT_FluidFactory.builder( + B.getName() + .replace(" ", "") + .toLowerCase() + "fluid") + .withTextureName("molten.autogenerated") + .withColorRGBA( + new short[] { (short) B.getColor() + .getRed(), + (short) B.getColor() + .getBlue(), + (short) B.getColor() + .getGreen() }) + .withLocalizedName(B.getLocalisedName() + " Fluid") + .withStateAndTemperature(FluidState.LIQUID, 300) + .buildAndRegister() + .asFluid()); + + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.getIntegratedCircuit(10)) + .fluidInputs(new FluidStack(B.getFluid(), 1000)) + .fluidOutputs(dnaFluid) + .duration(25 * SECONDS) + .eut(TierEU.RECIPE_MV) + .addTo(centrifugeRecipes); } } @@ -110,18 +123,24 @@ public class FluidLoader { } public static Fluid createAndRegisterFluid(String Name, Color color) { - return GT_FluidFactory.builder(Name).withTextureName("molten.autogenerated") - .withColorRGBA( - new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(), - (short) color.getAlpha() }) - .withStateAndTemperature(FluidState.LIQUID, 300).buildAndRegister().asFluid(); + return GT_FluidFactory.builder(Name) + .withTextureName("molten.autogenerated") + .withColorRGBA( + new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(), + (short) color.getAlpha() }) + .withStateAndTemperature(FluidState.LIQUID, 300) + .buildAndRegister() + .asFluid(); } public static Fluid createAndRegisterFluid(String Name, Color color, int temperature) { - return GT_FluidFactory.builder(Name).withTextureName("molten.autogenerated") - .withColorRGBA( - new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(), - (short) color.getAlpha() }) - .withStateAndTemperature(FluidState.LIQUID, temperature).buildAndRegister().asFluid(); + return GT_FluidFactory.builder(Name) + .withTextureName("molten.autogenerated") + .withColorRGBA( + new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(), + (short) color.getAlpha() }) + .withStateAndTemperature(FluidState.LIQUID, temperature) + .buildAndRegister() + .asFluid(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 50f5fa6b76..499686e6e0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -86,140 +86,136 @@ public class ItemRegistry { public static final Item ROCKCUTTER_HV = new GT_Rockcutter_Item(3); public static final Item CIRCUIT_PROGRAMMER = new Circuit_Programmer(); public static final Block ROTORBLOCK = new BW_TileEntityContainer_MachineBlock( - Material.wood, - BW_RotorBlock.class, - "BWRotorBlock"); + Material.wood, + BW_RotorBlock.class, + "BWRotorBlock"); public static final Item LEATHER_ROTOR = new BW_Stonage_Rotors( - 7, - 0.15f, - 5, - 1.15f, - 1, - 50, - 10000000, - IKineticRotor.GearboxType.WIND, - new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorLeather.png"), - "BW_LeatherRotor", - "rotors/itemRotorLeather"); + 7, + 0.15f, + 5, + 1.15f, + 1, + 50, + 10000000, + IKineticRotor.GearboxType.WIND, + new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorLeather.png"), + "BW_LeatherRotor", + "rotors/itemRotorLeather"); public static final Item WOOL_ROTOR = new BW_Stonage_Rotors( - 7, - 0.18f, - 3, - 1.35f, - 1, - 50, - 9000000, - IKineticRotor.GearboxType.WIND, - new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorWool.png"), - "BW_WoolRotor", - "rotors/itemRotorWool"); + 7, + 0.18f, + 3, + 1.35f, + 1, + 50, + 9000000, + IKineticRotor.GearboxType.WIND, + new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorWool.png"), + "BW_WoolRotor", + "rotors/itemRotorWool"); public static final Item PAPER_ROTOR = new BW_Stonage_Rotors( - 7, - 0.2f, - 12, - 0.9f, - 1, - 50, - 800000, - IKineticRotor.GearboxType.WIND, - new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorPaper.png"), - "BW_PaperRotor", - "rotors/itemRotorPaper"); + 7, + 0.2f, + 12, + 0.9f, + 1, + 50, + 800000, + IKineticRotor.GearboxType.WIND, + new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorPaper.png"), + "BW_PaperRotor", + "rotors/itemRotorPaper"); public static final Item COMBINED_ROTOR = new BW_Stonage_Rotors( - 9, - 0.22f, - 7, - 1.05f, - 1, - 50, - 6000000, - IKineticRotor.GearboxType.WIND, - new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorCombined.png"), - "BW_CombinedRotor", - "rotors/itemRotorCombined"); + 9, + 0.22f, + 7, + 1.05f, + 1, + 50, + 6000000, + IKineticRotor.GearboxType.WIND, + new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorCombined.png"), + "BW_CombinedRotor", + "rotors/itemRotorCombined"); public static final Item CRAFTING_PARTS = new SimpleSubItemClass( - "grindstone_top", - "grindstone_bottom", - "completed_grindstone", - "rotors/leatherParts", - "rotors/woolParts", - "rotors/paperParts", - "rotors/combinedParts"); + "grindstone_top", + "grindstone_bottom", + "completed_grindstone", + "rotors/leatherParts", + "rotors/woolParts", + "rotors/paperParts", + "rotors/combinedParts"); public static final Item TAB = new SimpleIconItem("GT2Coin"); public static final Item WINDMETER = new BW_SimpleWindMeter(); public static final Block PUMPBLOCK = new BW_TileEntityContainer( - Material.anvil, - BW_TileEntity_HeatedWaterPump.class, - "BWHeatedWaterPump"); + Material.anvil, + BW_TileEntity_HeatedWaterPump.class, + "BWHeatedWaterPump"); public static final Item PUMPPARTS = new SimpleSubItemClass("BWrawtube", "BWmotor"); public static final Block EXPPUMP = new BW_TileEntityContainer( - Material.coral, - BW_TileEntity_ExperimentalFloodGate.class, - "ExpReversePump"); + Material.coral, + BW_TileEntity_ExperimentalFloodGate.class, + "ExpReversePump"); public static final Block bw_realglas = new BW_GlasBlocks( - "BW_GlasBlocks", - new String[] { MainMod.MOD_ID + ":BoronSilicateGlassBlock", - MainMod.MOD_ID + ":TitaniumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":TungstenSteelReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":LuVTierMaterialReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":IridiumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":OsmiumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock1", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock2", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock3", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock4", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock5", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock6", MainMod.MOD_ID + ":ThoriumYttriumGlass", - MainMod.MOD_ID + ":NeutroniumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":CosmicNeutroniumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":InfinityReinforcedBoronSilicateGlassBlock", }, - new short[][] { Materials.BorosilicateGlass.getRGBA(), Materials.Titanium.getRGBA(), - Materials.TungstenSteel.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), - Materials.Osmium.getRGBA(), new short[] { 0xff, 0, 0 }, new short[] { 0, 0xff, 0 }, - new short[] { 0x80, 0, 0xff }, new short[] { 0xff, 0xff, 0 }, new short[] { 0, 0xff, 0x80 }, - new short[] { 0x80, 0x33, 0 }, WerkstoffLoader.YttriumOxide.getRGBA(), - Materials.Neutronium.getRGBA(), Materials.CosmicNeutronium.getRGBA(), - new short[] { 0xda, 0xeb, 0xff }, }, - MainMod.BIO_TAB, - true, - false); + "BW_GlasBlocks", + new String[] { MainMod.MOD_ID + ":BoronSilicateGlassBlock", + MainMod.MOD_ID + ":TitaniumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":TungstenSteelReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":LuVTierMaterialReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":IridiumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":OsmiumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock1", MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock2", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock3", MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock4", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock5", MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock6", + MainMod.MOD_ID + ":ThoriumYttriumGlass", MainMod.MOD_ID + ":NeutroniumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":CosmicNeutroniumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":InfinityReinforcedBoronSilicateGlassBlock", }, + new short[][] { Materials.BorosilicateGlass.getRGBA(), Materials.Titanium.getRGBA(), + Materials.TungstenSteel.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), + Materials.Osmium.getRGBA(), new short[] { 0xff, 0, 0 }, new short[] { 0, 0xff, 0 }, + new short[] { 0x80, 0, 0xff }, new short[] { 0xff, 0xff, 0 }, new short[] { 0, 0xff, 0x80 }, + new short[] { 0x80, 0x33, 0 }, WerkstoffLoader.YttriumOxide.getRGBA(), Materials.Neutronium.getRGBA(), + Materials.CosmicNeutronium.getRGBA(), new short[] { 0xda, 0xeb, 0xff }, }, + MainMod.BIO_TAB, + true, + false); public static final Block bw_realglas2 = new BW_GlasBlocks2( - "BW_GlasBlocks2", - new String[] { MainMod.MOD_ID + ":TranscendentallyReinforcedBoronSilicateGlassBlock" }, - new short[][] { new short[] { 50, 50, 50 } }, - MainMod.BIO_TAB, - true, - false); + "BW_GlasBlocks2", + new String[] { MainMod.MOD_ID + ":TranscendentallyReinforcedBoronSilicateGlassBlock" }, + new short[][] { new short[] { 50, 50, 50 } }, + MainMod.BIO_TAB, + true, + false); public static final Block[] bw_glasses = { bw_realglas, bw_realglas2 }; public static final Block bw_fake_glasses = new BW_GlasBlocks( - "BW_GlasBlocks", - new String[] { MainMod.MOD_ID + ":BoronSilicateGlassBlockRandlos" }, - null, - null, - true, - true); + "BW_GlasBlocks", + new String[] { MainMod.MOD_ID + ":BoronSilicateGlassBlockRandlos" }, + null, + null, + true, + true); public static final Block bw_fake_glasses2 = new BW_GlasBlocks2( - "BW_GlasBlocks2", - new String[] { MainMod.MOD_ID + ":BoronSilicateGlassBlockRandlos" }, - null, - null, - true, - true); + "BW_GlasBlocks2", + new String[] { MainMod.MOD_ID + ":BoronSilicateGlassBlockRandlos" }, + null, + null, + true, + true); public static final Block[] BW_BLOCKS = { - new BW_Blocks( - "BW_ItemBlocks", - new String[] { MainMod.MOD_ID + ":EtchedLapisCell", MainMod.MOD_ID + ":PlatedLapisCell", }, - GT2), - new BW_Blocks("GT_LESU_CASING", new String[] { MainMod.MOD_ID + ":LESU_CELL", }, GT2), - new BW_Blocks( - "BW_Machinery_Casings", - new String[] { MainMod.MOD_ID + ":NickelFerriteBlocks", MainMod.MOD_ID + ":TransformerCoil", - // MainMod.MOD_ID+":DEHP_Casing", - // MainMod.MOD_ID+":DEHP_Casing_Base" - }, - BWT), }; + new BW_Blocks( + "BW_ItemBlocks", + new String[] { MainMod.MOD_ID + ":EtchedLapisCell", MainMod.MOD_ID + ":PlatedLapisCell", }, + GT2), + new BW_Blocks("GT_LESU_CASING", new String[] { MainMod.MOD_ID + ":LESU_CELL", }, GT2), + new BW_Blocks( + "BW_Machinery_Casings", + new String[] { MainMod.MOD_ID + ":NickelFerriteBlocks", MainMod.MOD_ID + ":TransformerCoil", + // MainMod.MOD_ID+":DEHP_Casing", + // MainMod.MOD_ID+":DEHP_Casing_Base" + }, + BWT), }; public static ItemStack[] diode2A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] diode4A = new ItemStack[GT_Values.VN.length]; @@ -273,14 +269,14 @@ public class ItemRegistry { GameRegistry.registerItem(ItemRegistry.TAB, "tabIconGT2"); if (ConfigHandler.creativeScannerID != 0) new CreativeScanner( - ConfigHandler.creativeScannerID, - "Creative Debug Scanner", - "Creative Debug Scanner", - 20); + ConfigHandler.creativeScannerID, + "Creative Debug Scanner", + "Creative Debug Scanner", + 20); ItemRegistry.eic = new GT_TileEntity_ElectricImplosionCompressor( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, - "ElectricImplosionCompressor", - "Electric Implosion Compressor").getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, + "ElectricImplosionCompressor", + "Electric Implosion Compressor").getStackForm(1L); // EIC depend on neutronium block to pass on structure updates int bitmask = GregTech_API.sMachineIDs.getOrDefault(GregTech_API.sBlockMetal5, 0) | 1 << 2; @@ -295,160 +291,160 @@ public class ItemRegistry { GregTech_API.registerMachineBlock(LudicrousBlocks.resource_block, bitmask); ItemRegistry.THTR = new GT_TileEntity_THTR( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, - "THTR", - "Thorium High Temperature Reactor").getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, + "THTR", + "Thorium High Temperature Reactor").getStackForm(1L); GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials(); ItemRegistry.HTGR = new GT_TileEntity_HTGR( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 48, - "HTGR", - "High Temperature Gas-cooled Reactor").getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 48, + "HTGR", + "High Temperature Gas-cooled Reactor").getStackForm(1L); GT_TileEntity_HTGR.HTGRMaterials.registeraTHR_Materials(); // ID ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 49 IS TAKEN !!! (12792) GT_OreDictUnificator - .add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); + .add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); GT_OreDictUnificator - .registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(ItemRegistry.BW_BLOCKS[2])); + .registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(ItemRegistry.BW_BLOCKS[2])); for (int i = 0; i < GT_Values.VN.length - 1; i++) { ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode( - ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, - "diode" + "2A" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.diode.name") + " 2A " + GT_Values.VN[i], - i).getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, + "diode" + "2A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 2A " + GT_Values.VN[i], + i).getStackForm(1L); ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode( - ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, - "diode" + "4A" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.diode.name") + " 4A " + GT_Values.VN[i], - i).getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, + "diode" + "4A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 4A " + GT_Values.VN[i], + i).getStackForm(1L); ItemRegistry.diode8A[i] = new GT_MetaTileEntity_Diode( - ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, - "diode" + "8A" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.diode.name") + " 8A " + GT_Values.VN[i], - i).getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, + "diode" + "8A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 8A " + GT_Values.VN[i], + i).getStackForm(1L); ItemRegistry.diode12A[i] = new GT_MetaTileEntity_Diode( - ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, - "diode" + "12A" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.diode.name") + " 12A " + GT_Values.VN[i], - i).getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, + "diode" + "12A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 12A " + GT_Values.VN[i], + i).getStackForm(1L); ItemRegistry.diode16A[i] = new GT_MetaTileEntity_Diode( - ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, - "diode" + "16A" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.diode.name") + " 16A " + GT_Values.VN[i], - i).getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, + "diode" + "16A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 16A " + GT_Values.VN[i], + i).getStackForm(1L); ItemRegistry.energyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor( - ConfigHandler.IDOffset + 1 + i, - "energydistributor" + GT_Values.VN[i], - StatCollector.translateToLocal("tile.energydistributor.name") + " " + GT_Values.VN[i], - i).getStackForm(1L); + ConfigHandler.IDOffset + 1 + i, + "energydistributor" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.energydistributor.name") + " " + GT_Values.VN[i], + i).getStackForm(1L); } for (int i = 0; i < 3; i++) { ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, - "acidgenerator" + GT_Values.VN[i + 2], - StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[i + 2], - i + 2).getStackForm(1); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, + "acidgenerator" + GT_Values.VN[i + 2], + StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[i + 2], + i + 2).getStackForm(1); } ItemRegistry.acidGensLV = new GT_MetaTileEntity_AcidGenerator( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 65, - "acidgenerator" + GT_Values.VN[1], - StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[1], - +1).getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 65, + "acidgenerator" + GT_Values.VN[1], + StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[1], + +1).getStackForm(1L); ItemRegistry.dehp = new GT_TileEntity_DEHP( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, - 1, - "DEHP", - "Deep Earth Heating Pump").getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, + 1, + "DEHP", + "Deep Earth Heating Pump").getStackForm(1L); ItemRegistry.megaMachines[0] = new GT_TileEntity_MegaBlastFurnace( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, - "MegaBlastFurnace", - StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, + "MegaBlastFurnace", + StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L); ItemRegistry.megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, - "MegaVacuumFreezer", - StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, + "MegaVacuumFreezer", + StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L); ItemRegistry.cal = new GT_TileEntity_CircuitAssemblyLine( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 7, - "CircuitAssemblyLine", - "Circuit Assembly Line").getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 7, + "CircuitAssemblyLine", + "Circuit Assembly Line").getStackForm(1L); ItemRegistry.compressedHatch = new GT_MetaTileEntity_CompressedFluidHatch( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, - "CompressedFluidHatch", - "Liquid Air Fluid Hatch").getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, + "CompressedFluidHatch", + "Liquid Air Fluid Hatch").getStackForm(1L); ItemRegistry.giantOutputHatch = new GT_MetaTileEntity_GiantOutputHatch( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, - "GiantOutputHatch", - "Giant Output Hatch").getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, + "GiantOutputHatch", + "Giant Output Hatch").getStackForm(1L); ItemRegistry.humongousInputHatch = new GT_MetaTileEntity_HumongousInputHatch( - ConfigHandler.IDOffset + GT_Values.VN.length * 9 + 55, - "HumongousInputHatch", - "Humongous Input Hatch").getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 9 + 55, + "HumongousInputHatch", + "Humongous Input Hatch").getStackForm(1L); ItemRegistry.megaMachines[2] = new GT_TileEntity_MegaDistillTower( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, - "MegaDistillationTower", - "Mega Distillation Tower").getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, + "MegaDistillationTower", + "Mega Distillation Tower").getStackForm(1L); ItemRegistry.megaMachines[3] = new GT_TileEntity_MegaChemicalReactor( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 638, - "MegaChemicalReactor", - "Mega Chemical Reactor").getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 638, + "MegaChemicalReactor", + "Mega Chemical Reactor").getStackForm(1L); ItemRegistry.megaMachines[4] = new GT_TileEntity_MegaOilCracker( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 639, - "MegaOilCracker", - "Mega Oil Cracker").getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 639, + "MegaOilCracker", + "Mega Oil Cracker").getStackForm(1L); if (GalactiGreg.isModLoaded()) { ItemRegistry.voidminer[2] = new GT_TileEntity_VoidMiners.VMUV( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 11, - "VoidMiner3", - "Void Miner III").getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 11, + "VoidMiner3", + "Void Miner III").getStackForm(1L); ItemRegistry.voidminer[1] = new GT_TileEntity_VoidMiners.VMZPM( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 12, - "VoidMiner2", - "Void Miner II").getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 12, + "VoidMiner2", + "Void Miner II").getStackForm(1L); ItemRegistry.voidminer[0] = new GT_TileEntity_VoidMiners.VMLUV( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 13, - "VoidMiner1", - "Void Miner I").getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 13, + "VoidMiner1", + "Void Miner I").getStackForm(1L); } if (TecTech.isModLoaded()) { TecTechPipeEnergyLowPower = new TT_MetaTileEntity_Pipe_Energy_LowPower( - ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 14, - "pipe.lowpowerlaser", - "Low Power Laser Pipe").getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 14, + "pipe.lowpowerlaser", + "Low Power Laser Pipe").getStackForm(1L); int startID = ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15; for (int amps = 32; amps <= 128; amps += 32) { for (int tier = 4; tier < 8; tier++) { TecTechLaserAdditions[0][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserBox( - startID, - GT_Values.VN[tier] + "_LPLaser_Converter_" + amps, - GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Converter", - tier, - amps).getStackForm(1L); + startID, + GT_Values.VN[tier] + "_LPLaser_Converter_" + amps, + GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Converter", + tier, + amps).getStackForm(1L); startID++; } } for (int amps = 32; amps <= 128; amps += 32) { for (int tier = 4; tier < 8; tier++) { TecTechLaserAdditions[1][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserHatch( - startID, - GT_Values.VN[tier] + "_LPLaser_Hatch_" + amps, - GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Target Hatch", - tier, - amps).getStackForm(1L); + startID, + GT_Values.VN[tier] + "_LPLaser_Hatch_" + amps, + GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Target Hatch", + tier, + amps).getStackForm(1L); startID++; } } for (int amps = 32; amps <= 128; amps += 32) { for (int tier = 4; tier < 8; tier++) { TecTechLaserAdditions[2][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserDynamo( - startID, - GT_Values.VN[tier] + "_LPLaser_Dynamo_" + amps, - GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Source Hatch", - tier, - amps).getStackForm(1L); + startID, + GT_Values.VN[tier] + "_LPLaser_Dynamo_" + amps, + GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Source Hatch", + tier, + amps).getStackForm(1L); startID++; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java index 4307dca78c..020f89e703 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java @@ -21,40 +21,38 @@ public class LocalisationLoader { private static void localiseTooltips() { GT_LanguageManager - .addStringLocalization("metaitem.01.tooltip.purify.2", "Throw into Cauldron to get clean crushed Ore"); + .addStringLocalization("metaitem.01.tooltip.purify.2", "Throw into Cauldron to get clean crushed Ore"); GT_LanguageManager - .addStringLocalization("metaitem.01.tooltip.nqgen", "Can be used as Enriched Naquadah Fuel Substitute"); + .addStringLocalization("metaitem.01.tooltip.nqgen", "Can be used as Enriched Naquadah Fuel Substitute"); } private static void localiseAchivements() { + GT_LanguageManager + .addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor", "Electric Implosions?"); GT_LanguageManager.addStringLocalization( - "achievement.gt.blockmachines.electricimplosioncompressor", - "Electric Implosions?"); - GT_LanguageManager.addStringLocalization( - "achievement.gt.blockmachines.electricimplosioncompressor.desc", - "Basically a giant Hammer that presses Stuff - No more TNT!"); + "achievement.gt.blockmachines.electricimplosioncompressor.desc", + "Basically a giant Hammer that presses Stuff - No more TNT!"); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp", "Heat from below!"); GT_LanguageManager - .addStringLocalization("achievement.gt.blockmachines.dehp.desc", "Get ALL the thermal energy!"); + .addStringLocalization("achievement.gt.blockmachines.dehp.desc", "Get ALL the thermal energy!"); GT_LanguageManager - .addStringLocalization("achievement.gt.blockmachines.circuitassemblyline", "Cheaper Circuits?"); + .addStringLocalization("achievement.gt.blockmachines.circuitassemblyline", "Cheaper Circuits?"); GT_LanguageManager.addStringLocalization( - "achievement.gt.blockmachines.circuitassemblyline.desc", - "Well, yes, but actually no..."); + "achievement.gt.blockmachines.circuitassemblyline.desc", + "Well, yes, but actually no..."); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer1", "Ores from deep below!"); + GT_LanguageManager + .addStringLocalization("achievement.gt.blockmachines.voidminer1.desc", "Is this some kind of Ex-Nihilo?"); GT_LanguageManager.addStringLocalization( - "achievement.gt.blockmachines.voidminer1.desc", - "Is this some kind of Ex-Nihilo?"); - GT_LanguageManager.addStringLocalization( - "achievement.gt.blockmachines.voidminer2", - "Ores from deep below 2! Electric Boogaloo!"); + "achievement.gt.blockmachines.voidminer2", + "Ores from deep below 2! Electric Boogaloo!"); GT_LanguageManager - .addStringLocalization("achievement.gt.blockmachines.voidminer2.desc", "Ex-Nihilo, but faster!"); + .addStringLocalization("achievement.gt.blockmachines.voidminer2.desc", "Ex-Nihilo, but faster!"); GT_LanguageManager.addStringLocalization( - "achievement.gt.blockmachines.voidminer3", - "Ores from deep below 3! Trinity Ex-Nihilo"); + "achievement.gt.blockmachines.voidminer3", + "Ores from deep below 3! Trinity Ex-Nihilo"); GT_LanguageManager - .addStringLocalization("achievement.gt.blockmachines.voidminer3.desc", "3x the trouble, 3x the fun!"); + .addStringLocalization("achievement.gt.blockmachines.voidminer3.desc", "3x the trouble, 3x the fun!"); } public static void localiseAll() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java index 9a3ade059e..d141fe8b65 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RadioHatchMaterialLoader.java @@ -18,8 +18,10 @@ public class RadioHatchMaterialLoader { public static void run() { for (Werkstoff material : Werkstoff.werkstoffHashSet) { - if (material != null && material.getStats().isRadioactive()) { - int level = (int) material.getStats().getProtons(); + if (material != null && material.getStats() + .isRadioactive()) { + int level = (int) material.getStats() + .getProtons(); short[] rgba = material.getRGBA(); if (material.hasItemType(OrePrefixes.stick)) BWRecipes.instance.addRadHatch(material.get(OrePrefixes.stick), level, 1, rgba); @@ -31,14 +33,14 @@ public class RadioHatchMaterialLoader { for (Materials material : Materials.getAll()) { if (material == null || material.mElement == null) continue; boolean validProton = material.getProtons() >= 83 && !material.equals(Materials.Tritanium) // No Tritanium - && !material.equals(Materials.Naquadah); // Naquadah needs spacial value + && !material.equals(Materials.Naquadah); // Naquadah needs spacial value if (validProton) { int level = (int) material.getProtons(); short[] rgba = material.getRGBA(); if (GT_OreDictUnificator.get(OrePrefixes.stick, material, 1) != null) BWRecipes.instance - .addRadHatch(GT_OreDictUnificator.get(OrePrefixes.stick, material, 1), level, 1, rgba); + .addRadHatch(GT_OreDictUnificator.get(OrePrefixes.stick, material, 1), level, 1, rgba); if (GT_OreDictUnificator.get(OrePrefixes.stickLong, material, 1) != null) BWRecipes.instance - .addRadHatch(GT_OreDictUnificator.get(OrePrefixes.stickLong, material, 1), level, 2, rgba); + .addRadHatch(GT_OreDictUnificator.get(OrePrefixes.stickLong, material, 1), level, 2, rgba); } } @@ -48,165 +50,168 @@ public class RadioHatchMaterialLoader { for (int i = 0; i < spacialMaterial.length; i++) { if (GT_OreDictUnificator.get(OrePrefixes.stick, spacialMaterial[i], 1) != null) BWRecipes.instance.addRadHatch( - GT_OreDictUnificator.get(OrePrefixes.stick, spacialMaterial[i], 1), - spacialValue[i], - 1, - spacialMaterial[i].mRGBa); + GT_OreDictUnificator.get(OrePrefixes.stick, spacialMaterial[i], 1), + spacialValue[i], + 1, + spacialMaterial[i].mRGBa); if (GT_OreDictUnificator.get(OrePrefixes.stickLong, spacialMaterial[i], 1) != null) BWRecipes.instance.addRadHatch( - GT_OreDictUnificator.get(OrePrefixes.stickLong, spacialMaterial[i], 1), - spacialValue[i], - 2, - spacialMaterial[i].mRGBa); + GT_OreDictUnificator.get(OrePrefixes.stickLong, spacialMaterial[i], 1), + spacialValue[i], + 2, + spacialMaterial[i].mRGBa); } BWRecipes.instance.addRadHatch( - ItemList.ThoriumCell_1.get(1), - (int) Materials.Thorium.getProtons(), - 3, - Materials.Thorium.mRGBa); + ItemList.ThoriumCell_1.get(1), + (int) Materials.Thorium.getProtons(), + 3, + Materials.Thorium.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.ThoriumCell_2.get(1), - (int) Materials.Thorium.getProtons(), - 6, - Materials.Thorium.mRGBa); + ItemList.ThoriumCell_2.get(1), + (int) Materials.Thorium.getProtons(), + 6, + Materials.Thorium.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.ThoriumCell_4.get(1), - (int) Materials.Thorium.getProtons(), - 12, - Materials.Thorium.mRGBa); + ItemList.ThoriumCell_4.get(1), + (int) Materials.Thorium.getProtons(), + 12, + Materials.Thorium.mRGBa); BWRecipes.instance.addRadHatch(ItemList.NaquadahCell_1.get(1), 140, 3, Materials.NaquadahEnriched.mRGBa); BWRecipes.instance.addRadHatch(ItemList.NaquadahCell_2.get(1), 140, 6, Materials.NaquadahEnriched.mRGBa); BWRecipes.instance.addRadHatch(ItemList.NaquadahCell_4.get(1), 140, 12, Materials.NaquadahEnriched.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.Moxcell_1.get(1), - (int) Materials.Plutonium.getProtons(), - 3, - Materials.Plutonium.mRGBa); + ItemList.Moxcell_1.get(1), + (int) Materials.Plutonium.getProtons(), + 3, + Materials.Plutonium.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.Moxcell_2.get(1), - (int) Materials.Plutonium.getProtons(), - 6, - Materials.Plutonium.mRGBa); + ItemList.Moxcell_2.get(1), + (int) Materials.Plutonium.getProtons(), + 6, + Materials.Plutonium.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.Moxcell_4.get(1), - (int) Materials.Plutonium.getProtons(), - 12, - Materials.Plutonium.mRGBa); + ItemList.Moxcell_4.get(1), + (int) Materials.Plutonium.getProtons(), + 12, + Materials.Plutonium.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.Uraniumcell_1.get(1), - (int) Materials.Uranium.getProtons(), - 3, - Materials.Uranium.mRGBa); + ItemList.Uraniumcell_1.get(1), + (int) Materials.Uranium.getProtons(), + 3, + Materials.Uranium.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.Uraniumcell_2.get(1), - (int) Materials.Uranium.getProtons(), - 6, - Materials.Uranium.mRGBa); + ItemList.Uraniumcell_2.get(1), + (int) Materials.Uranium.getProtons(), + 6, + Materials.Uranium.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.Uraniumcell_4.get(1), - (int) Materials.Uranium.getProtons(), - 12, - Materials.Uranium.mRGBa); + ItemList.Uraniumcell_4.get(1), + (int) Materials.Uranium.getProtons(), + 12, + Materials.Uranium.mRGBa); BWRecipes.instance.addRadHatch( - BW_NonMeta_MaterialItems.TiberiumCell_1.get(1), - (int) WerkstoffLoader.Tiberium.getBridgeMaterial().getProtons(), - 3, - WerkstoffLoader.Tiberium.getRGBA()); + BW_NonMeta_MaterialItems.TiberiumCell_1.get(1), + (int) WerkstoffLoader.Tiberium.getBridgeMaterial() + .getProtons(), + 3, + WerkstoffLoader.Tiberium.getRGBA()); BWRecipes.instance.addRadHatch( - BW_NonMeta_MaterialItems.TiberiumCell_2.get(1), - (int) WerkstoffLoader.Tiberium.getBridgeMaterial().getProtons(), - 6, - WerkstoffLoader.Tiberium.getRGBA()); + BW_NonMeta_MaterialItems.TiberiumCell_2.get(1), + (int) WerkstoffLoader.Tiberium.getBridgeMaterial() + .getProtons(), + 6, + WerkstoffLoader.Tiberium.getRGBA()); BWRecipes.instance.addRadHatch( - BW_NonMeta_MaterialItems.TiberiumCell_4.get(1), - (int) WerkstoffLoader.Tiberium.getBridgeMaterial().getProtons(), - 12, - WerkstoffLoader.Tiberium.getRGBA()); + BW_NonMeta_MaterialItems.TiberiumCell_4.get(1), + (int) WerkstoffLoader.Tiberium.getBridgeMaterial() + .getProtons(), + 12, + WerkstoffLoader.Tiberium.getRGBA()); BWRecipes.instance - .addRadHatch(BW_NonMeta_MaterialItems.TheCoreCell.get(1), 140, 96, Materials.NaquadahEnriched.mRGBa); + .addRadHatch(BW_NonMeta_MaterialItems.TheCoreCell.get(1), 140, 96, Materials.NaquadahEnriched.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.Depleted_Thorium_1.get(1), - (int) Materials.Thorium.getProtons() / 10, - 3, - Materials.Thorium.mRGBa); + ItemList.Depleted_Thorium_1.get(1), + (int) Materials.Thorium.getProtons() / 10, + 3, + Materials.Thorium.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.Depleted_Thorium_2.get(1), - (int) Materials.Thorium.getProtons() / 10, - 6, - Materials.Thorium.mRGBa); + ItemList.Depleted_Thorium_2.get(1), + (int) Materials.Thorium.getProtons() / 10, + 6, + Materials.Thorium.mRGBa); BWRecipes.instance.addRadHatch( - ItemList.Depleted_Thorium_4.get(1), - (int) Materials.Thorium.getProtons() / 10, - 12, - Materials.Thorium.mRGBa); + ItemList.Depleted_Thorium_4.get(1), + (int) Materials.Thorium.getProtons() / 10, + 12, + Materials.Thorium.mRGBa); BWRecipes.instance - .addRadHatch(ItemList.Depleted_Naquadah_1.get(1), 140 / 10, 3, Materials.NaquadahEnriched.mRGBa); + .addRadHatch(ItemList.Depleted_Naquadah_1.get(1), 140 / 10, 3, Materials.NaquadahEnriched.mRGBa); BWRecipes.instance - .addRadHatch(ItemList.Depleted_Naquadah_2.get(1), 140 / 10, 6, Materials.NaquadahEnriched.mRGBa); + .addRadHatch(ItemList.Depleted_Naquadah_2.get(1), 140 / 10, 6, Materials.NaquadahEnriched.mRGBa); BWRecipes.instance - .addRadHatch(ItemList.Depleted_Naquadah_4.get(1), 140 / 10, 12, Materials.NaquadahEnriched.mRGBa); + .addRadHatch(ItemList.Depleted_Naquadah_4.get(1), 140 / 10, 12, Materials.NaquadahEnriched.mRGBa); BWRecipes.instance.addRadHatch( - GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXSimpledepleted", 1), - (int) Materials.Plutonium.getProtons() / 10, - 3, - Materials.Plutonium.mRGBa); + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXSimpledepleted", 1), + (int) Materials.Plutonium.getProtons() / 10, + 3, + Materials.Plutonium.mRGBa); BWRecipes.instance.addRadHatch( - GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXDualdepleted", 1), - (int) Materials.Plutonium.getProtons() / 10, - 6, - Materials.Plutonium.mRGBa); + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXDualdepleted", 1), + (int) Materials.Plutonium.getProtons() / 10, + 6, + Materials.Plutonium.mRGBa); BWRecipes.instance.addRadHatch( - GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXQuaddepleted", 1), - (int) Materials.Plutonium.getProtons() / 10, - 12, - Materials.Plutonium.mRGBa); + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorMOXQuaddepleted", 1), + (int) Materials.Plutonium.getProtons() / 10, + 12, + Materials.Plutonium.mRGBa); BWRecipes.instance.addRadHatch( - GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumSimpledepleted", 1), - (int) Materials.Uranium.getProtons() / 10, - 3, - Materials.Uranium.mRGBa); + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumSimpledepleted", 1), + (int) Materials.Uranium.getProtons() / 10, + 3, + Materials.Uranium.mRGBa); BWRecipes.instance.addRadHatch( - GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumDualdepleted", 1), - (int) Materials.Uranium.getProtons() / 10, - 6, - Materials.Uranium.mRGBa); + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumDualdepleted", 1), + (int) Materials.Uranium.getProtons() / 10, + 6, + Materials.Uranium.mRGBa); BWRecipes.instance.addRadHatch( - GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumQuaddepleted", 1), - (int) Materials.Uranium.getProtons() / 10, - 12, - Materials.Uranium.mRGBa); + GT_ModHandler.getModItem(IndustrialCraft2.ID, "reactorUraniumQuaddepleted", 1), + (int) Materials.Uranium.getProtons() / 10, + 12, + Materials.Uranium.mRGBa); BWRecipes.instance.addRadHatch( - BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), - (int) WerkstoffLoader.Tiberium.getBridgeMaterial().getProtons() / 10, - 3, - WerkstoffLoader.Tiberium.getRGBA()); + BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), + (int) WerkstoffLoader.Tiberium.getBridgeMaterial() + .getProtons() / 10, + 3, + WerkstoffLoader.Tiberium.getRGBA()); BWRecipes.instance.addRadHatch( - BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), - (int) WerkstoffLoader.Tiberium.getBridgeMaterial().getProtons() / 10, - 6, - WerkstoffLoader.Tiberium.getRGBA()); + BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), + (int) WerkstoffLoader.Tiberium.getBridgeMaterial() + .getProtons() / 10, + 6, + WerkstoffLoader.Tiberium.getRGBA()); BWRecipes.instance.addRadHatch( - BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), - (int) WerkstoffLoader.Tiberium.getBridgeMaterial().getProtons() / 10, - 12, - WerkstoffLoader.Tiberium.getRGBA()); + BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), + (int) WerkstoffLoader.Tiberium.getBridgeMaterial() + .getProtons() / 10, + 12, + WerkstoffLoader.Tiberium.getRGBA()); - BWRecipes.instance.addRadHatch( - BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), - 130 / 10, - 96, - Materials.Naquadah.mRGBa); + BWRecipes.instance + .addRadHatch(BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), 130 / 10, 96, Materials.Naquadah.mRGBa); BWRecipes.instance.addRadHatch(ItemList.MNqCell_1.get(1), 150, 3, Materials.Naquadria.mRGBa); BWRecipes.instance.addRadHatch(ItemList.MNqCell_2.get(1), 150, 6, Materials.Naquadria.mRGBa); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 3adea59e54..c55561687b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -36,7 +36,7 @@ import gregtech.api.util.GT_ModHandler; public class RecipeLoader { public static final long BITSD = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE - | GT_ModHandler.RecipeBits.REVERSIBLE; + | GT_ModHandler.RecipeBits.REVERSIBLE; public static void run() { new Assembler().run(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index a44bcf57e8..6f50650484 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -69,9 +69,9 @@ public class StaticRecipeChangeLoaders { private static TObjectDoubleHashMap gtEbfGasRecipeConsumptionMultipliers = null; public static final List whitelistForEBFNoGasRecipeDontCheckItemData = Arrays - .asList(GT_ModHandler.getModItem(TinkerConstruct.ID, "materials", 1L, 12) // Raw Aluminum -> Aluminium Ingot - // (coremod) - ); + .asList(GT_ModHandler.getModItem(TinkerConstruct.ID, "materials", 1L, 12) // Raw Aluminum -> Aluminium Ingot + // (coremod) + ); private StaticRecipeChangeLoaders() {} @@ -104,15 +104,20 @@ public class StaticRecipeChangeLoaders { } public static void fixEnergyRequirements() { - RecipeMap.ALL_RECIPE_MAPS.values().stream().filter(StreamUtils::filterVisualMaps) - .forEach(recipeMap -> recipeMap.getAllRecipes().parallelStream().forEach(gt_recipe -> { - for (int i = 0; i < VN.length - 1; i++) { - if (gt_recipe.mEUt > BW_Util.getMachineVoltageFromTier(i) + RecipeMap.ALL_RECIPE_MAPS.values() + .stream() + .filter(StreamUtils::filterVisualMaps) + .forEach( + recipeMap -> recipeMap.getAllRecipes() + .parallelStream() + .forEach(gt_recipe -> { + for (int i = 0; i < VN.length - 1; i++) { + if (gt_recipe.mEUt > BW_Util.getMachineVoltageFromTier(i) && gt_recipe.mEUt <= BW_Util.getTierVoltage(i)) { - gt_recipe.mEUt = BW_Util.getMachineVoltageFromTier(i); + gt_recipe.mEUt = BW_Util.getMachineVoltageFromTier(i); + } } - } - })); + })); } public static void unificationRecipeEnforcer() { @@ -132,14 +137,13 @@ public class StaticRecipeChangeLoaders { for (ItemStack toReplace : ores) { ItemStack replacement = werkstoff.get(prefixes); if (toReplace == null || GT_Utility.areStacksEqual(toReplace, replacement) - || replacement == null - || replacement.getItem() == null) - continue; + || replacement == null + || replacement.getItem() == null) continue; for (RecipeMap map : RecipeMap.ALL_RECIPE_MAPS.values()) { List toRemove = new ArrayList<>(); nextRecipe: for (GT_Recipe recipe : map.getAllRecipes()) { boolean removal = map.equals(RecipeMaps.fluidExtractionRecipes) - || map.equals(RecipeMaps.fluidSolidifierRecipes); + || map.equals(RecipeMaps.fluidSolidifierRecipes); for (int i = 0; i < recipe.mInputs.length; i++) { if (!GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) continue; if (removal) { @@ -155,7 +159,7 @@ public class StaticRecipeChangeLoaders { continue nextRecipe; } recipe.mOutputs[i] = GT_Utility - .copyAmount(recipe.mOutputs[i].stackSize, replacement); + .copyAmount(recipe.mOutputs[i].stackSize, replacement); } if (recipe.mSpecialItems instanceof ItemStack specialItemStack) { if (!GT_Utility.areStacksEqual(specialItemStack, toReplace)) continue; @@ -164,10 +168,11 @@ public class StaticRecipeChangeLoaders { continue nextRecipe; } recipe.mSpecialItems = GT_Utility - .copyAmount(specialItemStack.stackSize, replacement); + .copyAmount(specialItemStack.stackSize, replacement); } } - map.getBackend().removeRecipes(toRemove); + map.getBackend() + .removeRecipes(toRemove); } } } @@ -179,27 +184,28 @@ public class StaticRecipeChangeLoaders { if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.hasItemType(OrePrefixes.cellMolten)) { try { FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData( - new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), - werkstoff.get(OrePrefixes.cellMolten), - Materials.Empty.getCells(1)); + new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), + werkstoff.get(OrePrefixes.cellMolten), + Materials.Empty.getCells(1)); Field f = GT_Utility.class.getDeclaredField("sFilledContainerToData"); f.setAccessible(true); @SuppressWarnings("unchecked") Map sFilledContainerToData = (Map) f - .get(null); + .get(null); Set> toremFilledContainerToData = new HashSet<>(); ItemStack toReplace = null; for (Map.Entry entry : sFilledContainerToData - .entrySet()) { + .entrySet()) { final String MODID = GameRegistry.findUniqueIdentifierFor(data.filledContainer.getItem()).modId; if (MainMod.MOD_ID.equals(MODID) || BartWorksCrossmod.MOD_ID.equals(MODID)) continue; if (entry.getValue().fluid.equals(data.fluid) - && !entry.getValue().filledContainer.equals(data.filledContainer)) { + && !entry.getValue().filledContainer.equals(data.filledContainer)) { toReplace = entry.getValue().filledContainer; toremFilledContainerToData.add(entry); } } - sFilledContainerToData.entrySet().removeAll(toremFilledContainerToData); + sFilledContainerToData.entrySet() + .removeAll(toremFilledContainerToData); Set toremRecipeList = new HashSet<>(); if (toReplace != null) { for (RecipeMap map : RecipeMap.ALL_RECIPE_MAPS.values()) { @@ -216,20 +222,21 @@ public class StaticRecipeChangeLoaders { toremRecipeList.add(recipe); // recipe.mOutputs[i] = data.filledContainer; if (map == RecipeMaps.fluidCannerRecipes - && GT_Utility.areStacksEqual(mOutput, data.filledContainer) - && !recipe.mFluidInputs[0].equals(data.fluid)) { + && GT_Utility.areStacksEqual(mOutput, data.filledContainer) + && !recipe.mFluidInputs[0].equals(data.fluid)) { toremRecipeList.add(recipe); // recipe.mOutputs[i] = data.filledContainer; } } } if (recipe.mSpecialItems instanceof ItemStack - && GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) { + && GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) { toremRecipeList.add(recipe); // recipe.mSpecialItems = data.filledContainer; } } - map.getBackend().removeRecipes(toremRecipeList); + map.getBackend() + .removeRecipes(toremRecipeList); } } GT_Utility.addFluidContainerData(data); @@ -241,7 +248,7 @@ public class StaticRecipeChangeLoaders { private static void runUnficationDeleter(Werkstoff werkstoff) { if (werkstoff.getType() == Werkstoff.Types.ELEMENT && werkstoff.getBridgeMaterial() != null - && Element.get(werkstoff.getToolTip()) != Element._NULL) { + && Element.get(werkstoff.getToolTip()) != Element._NULL) { werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip()); Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>(); Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial()); @@ -258,7 +265,7 @@ public class StaticRecipeChangeLoaders { private static void runMaterialLinker(Werkstoff werkstoff) { if (werkstoff.getType() == Werkstoff.Types.ELEMENT && werkstoff.getBridgeMaterial() != null - && Element.get(werkstoff.getToolTip()) != Element._NULL) { + && Element.get(werkstoff.getToolTip()) != Element._NULL) { werkstoff.getBridgeMaterial().mElement = Element.get(werkstoff.getToolTip()); Element.get(werkstoff.getToolTip()).mLinkedMaterials = new ArrayList<>(); Element.get(werkstoff.getToolTip()).mLinkedMaterials.add(werkstoff.getBridgeMaterial()); @@ -288,8 +295,8 @@ public class StaticRecipeChangeLoaders { for (SubTag tag : GasTags) { if (mat.contains(tag)) { DebugLog.log( - "Found EBF Recipe to change, Output:" - + BW_Util.translateGTItemStack(recipe.mOutputs[0])); + "Found EBF Recipe to change, Output:" + + BW_Util.translateGTItemStack(recipe.mOutputs[0])); toAdd.put(tag, recipe); } } @@ -314,15 +321,14 @@ public class StaticRecipeChangeLoaders { for (int i = 0; i < recipe.mInputs.length; i++) { ItemStack tmpInput = recipe.mInputs[i]; if ((recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) - && (whitelistForEBFNoGasRecipeDontCheckItemData.stream() - .anyMatch(s -> GT_Utility.areStacksEqual(s, tmpInput)) - || BW_Util.checkStackAndPrefix(recipe.mInputs[i]) - && BW_Util.checkStackAndPrefix(baseRe.mInputs[i]) - && GT_OreDictUnificator - .getAssociation(recipe.mInputs[i]).mMaterial.mMaterial.equals( - GT_OreDictUnificator.getAssociation( - baseRe.mInputs[i]).mMaterial.mMaterial) - && GT_Utility.areStacksEqual(recipe.mOutputs[0], baseRe.mOutputs[0]))) { + && (whitelistForEBFNoGasRecipeDontCheckItemData.stream() + .anyMatch(s -> GT_Utility.areStacksEqual(s, tmpInput)) + || BW_Util.checkStackAndPrefix(recipe.mInputs[i]) + && BW_Util.checkStackAndPrefix(baseRe.mInputs[i]) + && GT_OreDictUnificator.getAssociation(recipe.mInputs[i]).mMaterial.mMaterial + .equals( + GT_OreDictUnificator.getAssociation(baseRe.mInputs[i]).mMaterial.mMaterial) + && GT_Utility.areStacksEqual(recipe.mOutputs[0], baseRe.mOutputs[0]))) { toAdd.add(recipe.mOutputs[0]); repToAdd.put(tag, recipe); continue recipeLoop; @@ -349,13 +355,15 @@ public class StaticRecipeChangeLoaders { } private static int transformEBFGasRecipeTime(GT_Recipe recipe, Materials originalGas, Werkstoff newGas) { - double newEbfMul = newGas.getStats().getEbfGasRecipeTimeMultiplier(); + double newEbfMul = newGas.getStats() + .getEbfGasRecipeTimeMultiplier(); double originalEbfMul = gtEbfGasRecipeTimeMultipliers.get(originalGas); if (newEbfMul < 0.0D || originalEbfMul < 0.0D) { return transformEBFGasRecipeTime( - recipe.mDuration, - originalGas.getProtons(), - newGas.getStats().getProtons()); + recipe.mDuration, + originalGas.getProtons(), + newGas.getStats() + .getProtons()); } return Math.max(1, (int) (recipe.mDuration * newEbfMul / originalEbfMul)); } @@ -365,130 +373,126 @@ public class StaticRecipeChangeLoaders { } private static void editEBFMaterialRecipes(SubTag GasTag, GT_Recipe recipe, Materials originalGas, - HashSet toAdd) { + HashSet toAdd) { for (Materials newGas : Materials.values()) { if (newGas.contains(GasTag)) { int time = transformEBFGasRecipeTime(recipe, originalGas, newGas); int gasAmount = Math.max( - 1, - (int) Math.round( - recipe.mFluidInputs[0].amount * gtEbfGasRecipeConsumptionMultipliers.get(newGas))); + 1, + (int) Math.round(recipe.mFluidInputs[0].amount * gtEbfGasRecipeConsumptionMultipliers.get(newGas))); if (recipe.mFluidInputs != null && recipe.mFluidInputs.length == 1 - && recipe.mFluidInputs[0].isFluidEqual(newGas.getGas(0))) { + && recipe.mFluidInputs[0].isFluidEqual(newGas.getGas(0))) { // preserve original recipe owner toAdd.add( - new DynamicGTRecipe( - false, - recipe.mInputs, - recipe.mOutputs, - recipe.mSpecialItems, - recipe.mChances, - new FluidStack[] { newGas.getGas(gasAmount) }, - recipe.mFluidOutputs, - time, - recipe.mEUt, - recipe.mSpecialValue, - recipe)); + new DynamicGTRecipe( + false, + recipe.mInputs, + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + new FluidStack[] { newGas.getGas(gasAmount) }, + recipe.mFluidOutputs, + time, + recipe.mEUt, + recipe.mSpecialValue, + recipe)); } else { // new recipe toAdd.add( - new GT_Recipe( - false, - recipe.mInputs, - recipe.mOutputs, - recipe.mSpecialItems, - recipe.mChances, - new FluidStack[] { newGas.getGas(gasAmount) }, - recipe.mFluidOutputs, - time, - recipe.mEUt, - recipe.mSpecialValue)); + new GT_Recipe( + false, + recipe.mInputs, + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + new FluidStack[] { newGas.getGas(gasAmount) }, + recipe.mFluidOutputs, + time, + recipe.mEUt, + recipe.mSpecialValue)); } } } } private static void editEBFWerkstoffRecipes(SubTag GasTag, GT_Recipe recipe, Materials originalGas, - HashSet toAdd) { + HashSet toAdd) { for (Werkstoff newGas : Werkstoff.werkstoffHashMap.values()) { if (newGas.contains(GasTag)) { int time = transformEBFGasRecipeTime(recipe, originalGas, newGas); int gasAmount = Math.max( - 1, - (int) Math.round( - recipe.mFluidInputs[0].amount - * newGas.getStats().getEbfGasRecipeConsumedAmountMultiplier())); + 1, + (int) Math.round( + recipe.mFluidInputs[0].amount * newGas.getStats() + .getEbfGasRecipeConsumedAmountMultiplier())); if (recipe.mFluidInputs != null && recipe.mFluidInputs.length == 1 - && recipe.mFluidInputs[0] - .isFluidEqual(new FluidStack(Objects.requireNonNull(fluids.get(newGas)), 0))) { + && recipe.mFluidInputs[0] + .isFluidEqual(new FluidStack(Objects.requireNonNull(fluids.get(newGas)), 0))) { // preserve original recipe owner toAdd.add( - new DynamicGTRecipe( - false, - recipe.mInputs, - recipe.mOutputs, - recipe.mSpecialItems, - recipe.mChances, - new FluidStack[] { - new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount) }, - recipe.mFluidOutputs, - time, - recipe.mEUt, - recipe.mSpecialValue, - recipe)); + new DynamicGTRecipe( + false, + recipe.mInputs, + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + new FluidStack[] { new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount) }, + recipe.mFluidOutputs, + time, + recipe.mEUt, + recipe.mSpecialValue, + recipe)); } else { // new recipe toAdd.add( - new GT_Recipe( - false, - recipe.mInputs, - recipe.mOutputs, - recipe.mSpecialItems, - recipe.mChances, - new FluidStack[] { - new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount) }, - recipe.mFluidOutputs, - time, - recipe.mEUt, - recipe.mSpecialValue)); + new GT_Recipe( + false, + recipe.mInputs, + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + new FluidStack[] { new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount) }, + recipe.mFluidOutputs, + time, + recipe.mEUt, + recipe.mSpecialValue)); } } } } private static void editEBFNoGasRecipes(GT_Recipe recipe, Materials originalGas, HashSet toAdd, - HashSet noGas) { + HashSet noGas) { for (ItemStack is : noGas) { byte circuitConfiguration = 1; if (GT_Utility.areStacksEqual(is, recipe.mOutputs[0])) { ArrayList inputs = new ArrayList<>(recipe.mInputs.length); for (ItemStack stack : recipe.mInputs) if (!GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(11), stack) - && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(14), stack) - && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(19), stack)) { - if (BW_Util.checkStackAndPrefix(stack)) - circuitConfiguration = (byte) (OrePrefixes.dustSmall - .equals(GT_OreDictUnificator.getAssociation(stack).mPrefix) - ? 4 - : OrePrefixes.dustTiny.equals( - GT_OreDictUnificator.getAssociation(stack).mPrefix) ? 9 - : 1); - inputs.add(stack); - } + && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(14), stack) + && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(19), stack)) { + if (BW_Util.checkStackAndPrefix(stack)) circuitConfiguration = (byte) (OrePrefixes.dustSmall + .equals(GT_OreDictUnificator.getAssociation(stack).mPrefix) + ? 4 + : OrePrefixes.dustTiny.equals(GT_OreDictUnificator.getAssociation(stack).mPrefix) + ? 9 + : 1); + inputs.add(stack); + } inputs.add(GT_Utility.getIntegratedCircuit(circuitConfiguration)); toAdd.add( - new DynamicGTRecipe( - false, - inputs.toArray(new ItemStack[0]), - recipe.mOutputs, - recipe.mSpecialItems, - recipe.mChances, - null, - recipe.mFluidOutputs, - transformEBFNoGasRecipeTime(recipe, originalGas), - recipe.mEUt, - recipe.mSpecialValue, - recipe)); + new DynamicGTRecipe( + false, + inputs.toArray(new ItemStack[0]), + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + null, + recipe.mFluidOutputs, + transformEBFNoGasRecipeTime(recipe, originalGas), + recipe.mEUt, + recipe.mSpecialValue, + recipe)); break; } } @@ -499,11 +503,10 @@ public class StaticRecipeChangeLoaders { for (GT_Recipe recipe : toAdd) { for (GT_Recipe recipe2 : toAdd) { if (recipe.mEUt != recipe2.mEUt || recipe.mDuration != recipe2.mDuration - || recipe.mSpecialValue != recipe2.mSpecialValue - || recipe == recipe2 - || recipe.mInputs.length != recipe2.mInputs.length - || recipe.mFluidInputs.length != recipe2.mFluidInputs.length) - continue; + || recipe.mSpecialValue != recipe2.mSpecialValue + || recipe == recipe2 + || recipe.mInputs.length != recipe2.mInputs.length + || recipe.mFluidInputs.length != recipe2.mFluidInputs.length) continue; boolean isSame = true; for (int i = 0; i < recipe.mInputs.length; i++) { if (!GT_Utility.areStacksEqual(recipe.mInputs[i], recipe2.mInputs[i])) isSame = false; @@ -518,7 +521,8 @@ public class StaticRecipeChangeLoaders { } private static Materials getMaterialFromInputFluid(GT_Recipe recipe) { - String materialString = recipe.mFluidInputs[0].getFluid().getName(); + String materialString = recipe.mFluidInputs[0].getFluid() + .getName(); materialString = StringUtils.removeStart(materialString, "molten"); materialString = StringUtils.removeStart(materialString, "fluid"); materialString = StringUtils.capitalize(materialString); @@ -539,7 +543,8 @@ public class StaticRecipeChangeLoaders { } } } - RecipeMaps.blastFurnaceRecipes.getBackend().removeRecipes(base.get(gasTag)); + RecipeMaps.blastFurnaceRecipes.getBackend() + .removeRecipes(base.get(gasTag)); } removeDuplicateGasRecipes(toAdd); @@ -547,18 +552,23 @@ public class StaticRecipeChangeLoaders { } public static void addElectricImplosionCompressorRecipes() { - RecipeMaps.implosionRecipes.getAllRecipes().stream().filter(e -> e.mInputs != null).forEach( + RecipeMaps.implosionRecipes.getAllRecipes() + .stream() + .filter(e -> e.mInputs != null) + .forEach( recipe -> BartWorksRecipeMaps.electricImplosionCompressorRecipes.addRecipe( - true, - Arrays.stream(recipe.mInputs).filter(e -> !StaticRecipeChangeLoaders.checkForExplosives(e)) - .distinct().toArray(ItemStack[]::new), - recipe.mOutputs, - null, - null, - null, - 1, - (int) TierEU.RECIPE_UEV, - 0)); + true, + Arrays.stream(recipe.mInputs) + .filter(e -> !StaticRecipeChangeLoaders.checkForExplosives(e)) + .distinct() + .toArray(ItemStack[]::new), + recipe.mOutputs, + null, + null, + null, + 1, + (int) TierEU.RECIPE_UEV, + 0)); // Custom EIC recipes. new ElectricImplosionCompressorRecipes().run(); @@ -566,8 +576,8 @@ public class StaticRecipeChangeLoaders { private static boolean checkForExplosives(ItemStack input) { return GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt)) - || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) - || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L)) - || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L)); + || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) + || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L)) + || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java index 7a738c722c..8f152c00c7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Assembler.java @@ -27,101 +27,126 @@ public class Assembler implements Runnable { @Override public void run() { Materials[] cables = { // Cable material used in the acid gen, diode and energy distributor below - Materials.Lead, // ULV - Materials.Tin, // LV - Materials.AnnealedCopper, // MV - Materials.Gold, // HV - Materials.Aluminium, // EV - Materials.Tungsten, // IV - Materials.VanadiumGallium, // LuV - Materials.Naquadah, // ZPM - Materials.NaquadahAlloy, // UV - Materials.SuperconductorUV // UHV + Materials.Lead, // ULV + Materials.Tin, // LV + Materials.AnnealedCopper, // MV + Materials.Gold, // HV + Materials.Aluminium, // EV + Materials.Tungsten, // IV + Materials.VanadiumGallium, // LuV + Materials.Naquadah, // ZPM + Materials.NaquadahAlloy, // UV + Materials.SuperconductorUV // UHV }; GT_Values.RA.stdBuilder() - .itemInputs( - new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), - Materials.Lapis.getPlates(9), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2L), - GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1)) - .fluidInputs(FluidRegistry.getFluidStack("ic2coolant", 1000)).duration(5 * SECONDS) - .eut(TierEU.RECIPE_HV).addTo(assemblerRecipes); + .itemInputs( + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), + Materials.Lapis.getPlates(9), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2L), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1)) + .fluidInputs(FluidRegistry.getFluidStack("ic2coolant", 1000)) + .duration(5 * SECONDS) + .eut(TierEU.RECIPE_HV) + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), - Materials.Lapis.getBlocks(8), - GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[1])).duration(5 * SECONDS).eut(TierEU.RECIPE_HV) - .addTo(assemblerRecipes); + .itemInputs( + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), + Materials.Lapis.getBlocks(8), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[1])) + .duration(5 * SECONDS) + .eut(TierEU.RECIPE_HV) + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1000), - GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(ItemRegistry.megaMachines[0]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) - .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(assemblerRecipes); + .itemInputs( + GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1000), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(ItemRegistry.megaMachines[0]) + .fluidInputs(Materials.SolderingAlloy.getMolten(9216)) + .duration(1 * HOURS) + .eut(TierEU.RECIPE_HV) + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1002), - GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(ItemRegistry.megaMachines[1]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) - .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(assemblerRecipes); + .itemInputs( + GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1002), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(ItemRegistry.megaMachines[1]) + .fluidInputs(Materials.SolderingAlloy.getMolten(9216)) + .duration(1 * HOURS) + .eut(TierEU.RECIPE_HV) + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1126), - GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(ItemRegistry.megaMachines[2]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) - .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(assemblerRecipes); + .itemInputs( + GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1126), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(ItemRegistry.megaMachines[2]) + .fluidInputs(Materials.SolderingAlloy.getMolten(9216)) + .duration(1 * HOURS) + .eut(TierEU.RECIPE_HV) + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1169), - GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(ItemRegistry.megaMachines[3]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) - .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(assemblerRecipes); + .itemInputs( + GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1169), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(ItemRegistry.megaMachines[3]) + .fluidInputs(Materials.SolderingAlloy.getMolten(9216)) + .duration(1 * HOURS) + .eut(TierEU.RECIPE_HV) + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1160), - GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(ItemRegistry.megaMachines[4]).fluidInputs(Materials.SolderingAlloy.getMolten(9216)) - .duration(1 * HOURS).eut(TierEU.RECIPE_HV).addTo(assemblerRecipes); + .itemInputs( + GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 1160), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(ItemRegistry.megaMachines[4]) + .fluidInputs(Materials.SolderingAlloy.getMolten(9216)) + .duration(1 * HOURS) + .eut(TierEU.RECIPE_HV) + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), - GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[2], 1, 1)) - .fluidInputs(Materials.Plastic.getMolten(1152L)).duration(1 * TICKS).eut(TierEU.RECIPE_HV) - .addTo(assemblerRecipes); + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[2], 1, 1)) + .fluidInputs(Materials.Plastic.getMolten(1152L)) + .duration(1 * TICKS) + .eut(TierEU.RECIPE_HV) + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), - Materials.Aluminium.getPlates(1), - ItemList.Circuit_Board_Plastic.get(1L), - ItemList.Battery_RE_LV_Lithium.get(1L)) - .itemOutputs(new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER)) - .fluidInputs(Materials.SolderingAlloy.getMolten(288L)).duration(30 * SECONDS).eut(TierEU.RECIPE_MV) - .addTo(assemblerRecipes); + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), + Materials.Aluminium.getPlates(1), + ItemList.Circuit_Board_Plastic.get(1L), + ItemList.Battery_RE_LV_Lithium.get(1L)) + .itemOutputs(new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER)) + .fluidInputs(Materials.SolderingAlloy.getMolten(288L)) + .duration(30 * SECONDS) + .eut(TierEU.RECIPE_MV) + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - ItemList.Circuit_Parts_GlassFiber.get(32), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Electrum, 8), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2)) - .itemOutputs( - new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - 1, - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage())) - .fluidInputs(Materials.Polytetrafluoroethylene.getMolten(72)).duration(10 * SECONDS) - .eut(TierEU.RECIPE_EV).addTo(assemblerRecipes); + .itemInputs( + ItemList.Circuit_Parts_GlassFiber.get(32), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Electrum, 8), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2)) + .itemOutputs( + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + 1, + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage())) + .fluidInputs(Materials.Polytetrafluoroethylene.getMolten(72)) + .duration(10 * SECONDS) + .eut(TierEU.RECIPE_EV) + .addTo(assemblerRecipes); ItemStack[][] converters = ItemRegistry.TecTechLaserAdditions[0]; ItemStack[][] input = ItemRegistry.TecTechLaserAdditions[1]; @@ -132,7 +157,7 @@ public class Assembler implements Runnable { ItemList[] sensors = { ItemList.Sensor_EV, ItemList.Sensor_IV, ItemList.Sensor_LuV, ItemList.Sensor_ZPM }; OrePrefixes[] prefixes = { OrePrefixes.cableGt04, OrePrefixes.cableGt08, OrePrefixes.cableGt12, - OrePrefixes.cableGt16 }; + OrePrefixes.cableGt16 }; for (int j = 0; j < 4; j++) { for (int i = 0; i < 4; i++) { @@ -160,88 +185,110 @@ public class Assembler implements Runnable { int solderingAmount = Math.max(144 * i, 72) * (j + 1); - GT_Values.RA.stdBuilder().itemInputs( + GT_Values.RA.stdBuilder() + .itemInputs( new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - ((j + 1) * 16), - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + ((j + 1) * 16), + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), emitters[i].get(2 * (j + 1)), sensors[i].get(2 * (j + 1)), - ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1))).itemOutputs(converter) - .fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) - .duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption).addTo(assemblerRecipes); + ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1))) + .itemOutputs(converter) + .fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) + .duration((10 * (j + 1)) * SECONDS) + .eut(recipeConsumption) + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - ((j + 1) * 16), - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), - emitters[i].get(2 * (j + 1)), - sensors[i].get(2 * (j + 1)), - ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1))) - .itemOutputs(converter).fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) - .duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption).addTo(assemblerRecipes); + .itemInputs( + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + ((j + 1) * 16), + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + emitters[i].get(2 * (j + 1)), + sensors[i].get(2 * (j + 1)), + ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1))) + .itemOutputs(converter) + .fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) + .duration((10 * (j + 1)) * SECONDS) + .eut(recipeConsumption) + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - (j + 1) * 16, - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), - sensors[i].get(2 * (j + 1)), - ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1))) - .itemOutputs(eInput).fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) - .duration((10 * (j + 1)) * SECONDS).eut(recipeConsumption).addTo(assemblerRecipes); + .itemInputs( + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + (j + 1) * 16, + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + sensors[i].get(2 * (j + 1)), + ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1))) + .itemOutputs(eInput) + .fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) + .duration((10 * (j + 1)) * SECONDS) + .eut(recipeConsumption) + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - new ItemStack( - ItemRegistry.TecTechPipeEnergyLowPower.getItem(), - (j + 1) * 16, - ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), - emitters[i].get(2 * (j + 1)), - ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1))) - .itemOutputs(eDynamo).fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) - .duration((10 * (j + 1) * SECONDS)).eut(recipeConsumption).addTo(assemblerRecipes); + .itemInputs( + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + (j + 1) * 16, + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + emitters[i].get(2 * (j + 1)), + ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1))) + .itemOutputs(eDynamo) + .fluidInputs(Materials.SolderingAlloy.getMolten(solderingAmount)) + .duration((10 * (j + 1) * SECONDS)) + .eut(recipeConsumption) + .addTo(assemblerRecipes); } } GT_Values.RA.stdBuilder() - .itemInputs( - ItemList.Hatch_Input_HV.get(64), - Materials.LiquidAir.getCells(1), - GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(ItemRegistry.compressedHatch.copy()).duration(15 * SECONDS).eut(TierEU.RECIPE_HV) - .addTo(assemblerRecipes); + .itemInputs( + ItemList.Hatch_Input_HV.get(64), + Materials.LiquidAir.getCells(1), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(ItemRegistry.compressedHatch.copy()) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_HV) + .addTo(assemblerRecipes); - GT_Values.RA.stdBuilder().itemInputs(ItemList.Hatch_Output_HV.get(64), GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(ItemRegistry.giantOutputHatch.copy()).duration(15 * SECONDS).eut(TierEU.RECIPE_HV) - .addTo(assemblerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.Hatch_Output_HV.get(64), GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(ItemRegistry.giantOutputHatch.copy()) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_HV) + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 6), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1)) - .itemOutputs(new ItemStack(GregTech_API.sBlockCasings3, 1, 12)) - .fluidInputs(Materials.Concrete.getMolten(1296)).duration(2 * SECONDS).eut(TierEU.RECIPE_IV) - .addTo(assemblerRecipes); + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 6), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1)) + .itemOutputs(new ItemStack(GregTech_API.sBlockCasings3, 1, 12)) + .fluidInputs(Materials.Concrete.getMolten(1296)) + .duration(2 * SECONDS) + .eut(TierEU.RECIPE_IV) + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - new ItemStack(GregTech_API.sBlockCasings3, 1, 12), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Europium, 6), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 24)) - .itemOutputs(new ItemStack(GregTech_API.sBlockCasings8, 1, 5)) - .fluidInputs(Materials.Lead.getMolten(864)).duration(10 * SECONDS).eut(TierEU.RECIPE_LuV) - .addTo(assemblerRecipes); + .itemInputs( + new ItemStack(GregTech_API.sBlockCasings3, 1, 12), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Europium, 6), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 24)) + .itemOutputs(new ItemStack(GregTech_API.sBlockCasings8, 1, 5)) + .fluidInputs(Materials.Lead.getMolten(864)) + .duration(10 * SECONDS) + .eut(TierEU.RECIPE_LuV) + .addTo(assemblerRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java index 61d531de0b..538195362a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/AssemblyLine.java @@ -27,48 +27,59 @@ public class AssemblyLine implements Runnable { @Override public void run() { Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null - ? FluidRegistry.getFluid("molten.indalloy140") - : FluidRegistry.getFluid("molten.solderingalloy"); - GT_Values.RA.stdBuilder().metadata(RESEARCH_ITEM, ItemList.Pump_IV.get(1L)).metadata(RESEARCH_TIME, 1 * HOURS) - .itemInputs( - ItemList.Pump_IV.get(16), - GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 32L), - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), - ItemList.Field_Generator_LuV.get(8)) - .fluidInputs( - new FluidStack(solderIndalloy, 32 * 144), - Materials.Polytetrafluoroethylene.getMolten(32 * 144)) - .itemOutputs(ItemRegistry.dehp).eut(TierEU.RECIPE_LuV).duration(4 * MINUTES + 10 * SECONDS) - .addTo(AssemblyLine); + ? FluidRegistry.getFluid("molten.indalloy140") + : FluidRegistry.getFluid("molten.solderingalloy"); + GT_Values.RA.stdBuilder() + .metadata(RESEARCH_ITEM, ItemList.Pump_IV.get(1L)) + .metadata(RESEARCH_TIME, 1 * HOURS) + .itemInputs( + ItemList.Pump_IV.get(16), + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 32L), + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), + ItemList.Field_Generator_LuV.get(8)) + .fluidInputs( + new FluidStack(solderIndalloy, 32 * 144), + Materials.Polytetrafluoroethylene.getMolten(32 * 144)) + .itemOutputs(ItemRegistry.dehp) + .eut(TierEU.RECIPE_LuV) + .duration(4 * MINUTES + 10 * SECONDS) + .addTo(AssemblyLine); if (GalactiGreg.isModLoaded()) { - GT_Values.RA.stdBuilder().metadata(RESEARCH_ITEM, ItemList.OreDrill4.get(1L)) - .metadata(RESEARCH_TIME, 25 * MINUTES + 36 * SECONDS) - .itemInputs( - ItemList.OreDrill4.get(1L), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 9L), - Materials.Europium.getPlates(3), - ItemList.Electric_Motor_LuV.get(9L), - ItemList.Sensor_LuV.get(9L), - ItemList.Field_Generator_LuV.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 36L)) - .fluidInputs(new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Neon.getFluidOrGas(20000)) - .itemOutputs(ItemRegistry.voidminer[0].copy()).eut(TierEU.RECIPE_LuV).duration(5 * MINUTES) - .addTo(AssemblyLine); + GT_Values.RA.stdBuilder() + .metadata(RESEARCH_ITEM, ItemList.OreDrill4.get(1L)) + .metadata(RESEARCH_TIME, 25 * MINUTES + 36 * SECONDS) + .itemInputs( + ItemList.OreDrill4.get(1L), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 9L), + Materials.Europium.getPlates(3), + ItemList.Electric_Motor_LuV.get(9L), + ItemList.Sensor_LuV.get(9L), + ItemList.Field_Generator_LuV.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 36L)) + .fluidInputs(new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Neon.getFluidOrGas(20000)) + .itemOutputs(ItemRegistry.voidminer[0].copy()) + .eut(TierEU.RECIPE_LuV) + .duration(5 * MINUTES) + .addTo(AssemblyLine); } - GT_Values.RA.stdBuilder().metadata(RESEARCH_ITEM, ItemList.Machine_LuV_CircuitAssembler.get(1L)) - .metadata(RESEARCH_TIME, 20 * MINUTES) - .itemInputs( - ItemList.Machine_LuV_CircuitAssembler.get(1L), - ItemList.Robot_Arm_LuV.get(4L), - ItemList.Electric_Motor_LuV.get(4L), - ItemList.Field_Generator_LuV.get(1L), - ItemList.Emitter_LuV.get(1L), - ItemList.Sensor_LuV.get(1L), - WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.plate, 8)) - .fluidInputs(new FluidStack(solderIndalloy, 1440)).itemOutputs(ItemRegistry.cal.copy()) - .eut(TierEU.RECIPE_LuV).duration(20 * MINUTES).addTo(AssemblyLine); + GT_Values.RA.stdBuilder() + .metadata(RESEARCH_ITEM, ItemList.Machine_LuV_CircuitAssembler.get(1L)) + .metadata(RESEARCH_TIME, 20 * MINUTES) + .itemInputs( + ItemList.Machine_LuV_CircuitAssembler.get(1L), + ItemList.Robot_Arm_LuV.get(4L), + ItemList.Electric_Motor_LuV.get(4L), + ItemList.Field_Generator_LuV.get(1L), + ItemList.Emitter_LuV.get(1L), + ItemList.Sensor_LuV.get(1L), + WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.plate, 8)) + .fluidInputs(new FluidStack(solderIndalloy, 1440)) + .itemOutputs(ItemRegistry.cal.copy()) + .eut(TierEU.RECIPE_LuV) + .duration(20 * MINUTES) + .addTo(AssemblyLine); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java index 95e52fb328..1793877df3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Autoclave.java @@ -20,15 +20,21 @@ public class Autoclave implements Runnable { Materials[] sterilizers = { Materials.Ammonia, Materials.Chlorine, Materials.Ethanol, Materials.Methanol }; for (Materials used : sterilizers) { - GT_Values.RA.stdBuilder().itemInputs(ItemList.Circuit_Parts_PetriDish.get(1L)) - .itemOutputs(BioItemList.getPetriDish(null)) - .fluidInputs(used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L)).duration(5 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(autoclaveRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(Items.glass_bottle)) - .itemOutputs(BioItemList.getDNASampleFlask(null)) - .fluidInputs(used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L)).duration(5 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(autoclaveRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.Circuit_Parts_PetriDish.get(1L)) + .itemOutputs(BioItemList.getPetriDish(null)) + .fluidInputs(used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L)) + .duration(5 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(autoclaveRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(Items.glass_bottle)) + .itemOutputs(BioItemList.getDNASampleFlask(null)) + .fluidInputs(used.getGas(10L) != null ? used.getGas(8L) : used.getFluid(16L)) + .duration(5 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(autoclaveRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java index b8398761b4..e148376b01 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Centrifuge.java @@ -29,88 +29,116 @@ public class Centrifuge implements Runnable { @Override public void run() { - GT_Values.RA.stdBuilder().itemInputs(Materials.Thorium.getDust(1)) - .itemOutputs( - Materials.Thorium.getDust(1), - Materials.Thorium.getDust(1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1)) - .outputChances(800, 375, 22, 22, 5).duration(8 * MINUTES + 20 * SECONDS).eut(TierEU.RECIPE_EV) - .addTo(centrifugeRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(Materials.Thorium.getDust(1)) + .itemOutputs( + Materials.Thorium.getDust(1), + Materials.Thorium.getDust(1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1)) + .outputChances(800, 375, 22, 22, 5) + .duration(8 * MINUTES + 20 * SECONDS) + .eut(TierEU.RECIPE_EV) + .addTo(centrifugeRecipes); ItemStack[] pellets = new ItemStack[6]; Arrays.fill(pellets, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 4)); GT_Values.RA.stdBuilder() - .itemInputs( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3), - GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(pellets).duration(40 * MINUTES).eut(TierEU.RECIPE_LV).addTo(centrifugeRecipes); + .itemInputs( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(pellets) + .duration(40 * MINUTES) + .eut(TierEU.RECIPE_LV) + .addTo(centrifugeRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 5), - GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 6)) - .duration(40 * MINUTES).eut(TierEU.RECIPE_LV).addTo(centrifugeRecipes); + .itemInputs( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 5), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 6)) + .duration(40 * MINUTES) + .eut(TierEU.RECIPE_LV) + .addTo(centrifugeRecipes); - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 6)) - .itemOutputs(Materials.Lead.getDust(1)).outputChances(300).duration(60 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(centrifugeRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 6)) + .itemOutputs(Materials.Lead.getDust(1)) + .outputChances(300) + .duration(60 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(centrifugeRecipes); int i = 0; for (GT_TileEntity_HTGR.HTGRMaterials.Fuel_ fuel : sHTGR_Fuel) { GT_Values.RA.stdBuilder() - .itemInputs( - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), - GT_Utility.getIntegratedCircuit(17)) - .itemOutputs( - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4)) - .duration(10 * MINUTES).eut(TierEU.RECIPE_LV).addTo(centrifugeRecipes); + .itemInputs( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4)) + .duration(10 * MINUTES) + .eut(TierEU.RECIPE_LV) + .addTo(centrifugeRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5), - GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 6)) - .duration(2 * MINUTES + 30 * SECONDS).eut(TierEU.RECIPE_LV).addTo(centrifugeRecipes); + .itemInputs( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5), + GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 6)) + .duration(2 * MINUTES + 30 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(centrifugeRecipes); GT_RecipeBuilder recipeBuilder = GT_Values.RA.stdBuilder() - .itemInputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 6)) - .itemOutputs( - fuel.recycledItems[0], - fuel.recycledItems[1], - fuel.recycledItems[2], - fuel.recycledItems[3], - fuel.recycledItems[4]) - .outputChances(fuel.recycleChances); + .itemInputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 6)) + .itemOutputs( + fuel.recycledItems[0], + fuel.recycledItems[1], + fuel.recycledItems[2], + fuel.recycledItems[3], + fuel.recycledItems[4]) + .outputChances(fuel.recycleChances); if (fuel.recycledFluid != null) { recipeBuilder.fluidOutputs(fuel.recycledFluid); } - recipeBuilder.duration(1 * MINUTES).eut(TierEU.RECIPE_LV).addTo(centrifugeRecipes); + recipeBuilder.duration(1 * MINUTES) + .eut(TierEU.RECIPE_LV) + .addTo(centrifugeRecipes); i += MATERIALS_PER_FUEL; } - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(17)).itemOutputs(BioItemList.getOther(4)) - .fluidInputs(new FluidStack(BioCultureLoader.eColi.getFluid(), 1000)) - .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[1], 10)).duration(60 * SECONDS) - .eut(TierEU.RECIPE_HV).addTo(centrifugeRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(BioItemList.getOther(4)) + .fluidInputs(new FluidStack(BioCultureLoader.eColi.getFluid(), 1000)) + .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[1], 10)) + .duration(60 * SECONDS) + .eut(TierEU.RECIPE_HV) + .addTo(centrifugeRecipes); - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(17)) - .fluidInputs(new FluidStack(FluidLoader.BioLabFluidMaterials[1], 1000)) - .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[3], 250)).duration(60 * SECONDS) - .eut(TierEU.RECIPE_HV).addTo(centrifugeRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.getIntegratedCircuit(17)) + .fluidInputs(new FluidStack(FluidLoader.BioLabFluidMaterials[1], 1000)) + .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[3], 250)) + .duration(60 * SECONDS) + .eut(TierEU.RECIPE_HV) + .addTo(centrifugeRecipes); - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(17)) - .fluidInputs(new FluidStack(BioCultureLoader.CommonYeast.getFluid(), 1000)) - .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[2], 10)).duration(60 * SECONDS) - .eut(TierEU.RECIPE_HV).addTo(centrifugeRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.getIntegratedCircuit(17)) + .fluidInputs(new FluidStack(BioCultureLoader.CommonYeast.getFluid(), 1000)) + .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[2], 10)) + .duration(60 * SECONDS) + .eut(TierEU.RECIPE_HV) + .addTo(centrifugeRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java index 9ccc301898..f1d9ddd236 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalBath.java @@ -19,44 +19,65 @@ public class ChemicalBath implements Runnable { for (int i = 0; i < Dyes.dyeBrown.getSizeOfFluidList(); ++i) { - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) - .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 6)) - .fluidInputs(Dyes.dyeRed.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) - .addTo(chemicalBathRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) - .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 7)) - .fluidInputs(Dyes.dyeGreen.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) - .addTo(chemicalBathRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) - .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 8)) - .fluidInputs(Dyes.dyePurple.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) - .addTo(chemicalBathRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) - .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 9)) - .fluidInputs(Dyes.dyeYellow.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) - .addTo(chemicalBathRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) - .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 10)) - .fluidInputs(Dyes.dyeLime.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) - .addTo(chemicalBathRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) - .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 11)) - .fluidInputs(Dyes.dyeBrown.getFluidDye(i, 36)).duration(3 * SECONDS + 4 * TICKS).eut(2) - .addTo(chemicalBathRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 6)) + .fluidInputs(Dyes.dyeRed.getFluidDye(i, 36)) + .duration(3 * SECONDS + 4 * TICKS) + .eut(2) + .addTo(chemicalBathRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 7)) + .fluidInputs(Dyes.dyeGreen.getFluidDye(i, 36)) + .duration(3 * SECONDS + 4 * TICKS) + .eut(2) + .addTo(chemicalBathRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 8)) + .fluidInputs(Dyes.dyePurple.getFluidDye(i, 36)) + .duration(3 * SECONDS + 4 * TICKS) + .eut(2) + .addTo(chemicalBathRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 9)) + .fluidInputs(Dyes.dyeYellow.getFluidDye(i, 36)) + .duration(3 * SECONDS + 4 * TICKS) + .eut(2) + .addTo(chemicalBathRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 10)) + .fluidInputs(Dyes.dyeLime.getFluidDye(i, 36)) + .duration(3 * SECONDS + 4 * TICKS) + .eut(2) + .addTo(chemicalBathRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 11)) + .fluidInputs(Dyes.dyeBrown.getFluidDye(i, 36)) + .duration(3 * SECONDS + 4 * TICKS) + .eut(2) + .addTo(chemicalBathRecipes); } for (int i = 6; i < 11; i++) { - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, i)) - .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) - .fluidInputs(Materials.Chlorine.getGas(50)).duration(3 * SECONDS + 4 * TICKS).eut(2) - .addTo(chemicalBathRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, i)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .fluidInputs(Materials.Chlorine.getGas(50)) + .duration(3 * SECONDS + 4 * TICKS) + .eut(2) + .addTo(chemicalBathRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalReactor.java index e71a8b863f..87aaf91f71 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/ChemicalReactor.java @@ -17,10 +17,13 @@ public class ChemicalReactor implements Runnable { @Override public void run() { - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)) - .fluidInputs(new FluidStack(FluidLoader.heatedfulvicAcid, 1000)) - .fluidOutputs(new FluidStack(FluidLoader.Kerogen, 1000)).duration(3 * SECONDS + 15 * TICKS) - .eut(TierEU.RECIPE_MV).addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.getIntegratedCircuit(10)) + .fluidInputs(new FluidStack(FluidLoader.heatedfulvicAcid, 1000)) + .fluidOutputs(new FluidStack(FluidLoader.Kerogen, 1000)) + .duration(3 * SECONDS + 15 * TICKS) + .eut(TierEU.RECIPE_MV) + .addTo(UniversalChemical); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java index 3ee15f52da..17a5d5b025 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/CraftingRecipes.java @@ -37,182 +37,171 @@ public class CraftingRecipes implements Runnable { public void run() { Materials[] cables = { // Cable material used in the acid gen, diode and energy distributor below - Materials.Lead, // ULV - Materials.Tin, // LV - Materials.AnnealedCopper, // MV - Materials.Gold, // HV - Materials.Aluminium, // EV - Materials.Tungsten, // IV - Materials.VanadiumGallium, // LuV - Materials.Naquadah, // ZPM - Materials.NaquadahAlloy, // UV - Materials.SuperconductorUV // UHV + Materials.Lead, // ULV + Materials.Tin, // LV + Materials.AnnealedCopper, // MV + Materials.Gold, // HV + Materials.Aluminium, // EV + Materials.Tungsten, // IV + Materials.VanadiumGallium, // LuV + Materials.Naquadah, // ZPM + Materials.NaquadahAlloy, // UV + Materials.SuperconductorUV // UHV }; ISubTagContainer[] hulls = { // Plate material used in the acid gen, diode and energy distributor below - Materials.WroughtIron, // ULV - Materials.Steel, // LV - Materials.Aluminium, // MV - Materials.StainlessSteel, // HV - Materials.Titanium, // EV - Materials.TungstenSteel, // IV - WerkstoffLoader.LuVTierMaterial, // LuV - Materials.Iridium, // ZPM - Materials.Osmium, // UV - Materials.Naquadah // UHV + Materials.WroughtIron, // ULV + Materials.Steel, // LV + Materials.Aluminium, // MV + Materials.StainlessSteel, // HV + Materials.Titanium, // EV + Materials.TungstenSteel, // IV + WerkstoffLoader.LuVTierMaterial, // LuV + Materials.Iridium, // ZPM + Materials.Osmium, // UV + Materials.Naquadah // UHV }; ItemStack[] bats = { ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_Hull_MV.get(1L), - ItemList.Battery_Hull_HV.get(1L) }; + ItemList.Battery_Hull_HV.get(1L) }; ItemStack[] chreac = { ItemList.Machine_MV_ChemicalReactor.get(1L), ItemList.Machine_HV_ChemicalReactor.get(1L), - ItemList.Machine_EV_ChemicalReactor.get(1L) }; + ItemList.Machine_EV_ChemicalReactor.get(1L) }; GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_LESU(ConfigHandler.IDOffset, "LESU", "L.E.S.U.").getStackForm(1L), - RecipeLoader.BITSD, - new Object[] { "CDC", "SBS", "CFC", 'C', "circuitAdvanced", 'D', ItemList.Cover_Screen.get(1L), 'S', - GT_OreDictUnificator.get(OrePrefixes.cableGt12, Materials.Platinum, 1L), 'B', - new ItemStack(ItemRegistry.BW_BLOCKS[1]), 'F', ItemList.Field_Generator_HV.get(1L) }); + new GT_TileEntity_LESU(ConfigHandler.IDOffset, "LESU", "L.E.S.U.").getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "CDC", "SBS", "CFC", 'C', "circuitAdvanced", 'D', ItemList.Cover_Screen.get(1L), 'S', + GT_OreDictUnificator.get(OrePrefixes.cableGt12, Materials.Platinum, 1L), 'B', + new ItemStack(ItemRegistry.BW_BLOCKS[1]), 'F', ItemList.Field_Generator_HV.get(1L) }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.DESTRUCTOPACK), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "CPC", "PLP", "CPC", 'C', "circuitAdvanced", 'P', - GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Aluminium, 1L), 'L', - new ItemStack(Items.lava_bucket) }); + new ItemStack(ItemRegistry.DESTRUCTOPACK), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "CPC", "PLP", "CPC", 'C', "circuitAdvanced", 'P', + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Aluminium, 1L), 'L', + new ItemStack(Items.lava_bucket) }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.DESTRUCTOPACK), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "CPC", "PLP", "CPC", 'C', "circuitAdvanced", 'P', - GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Steel, 1L), 'L', - new ItemStack(Items.lava_bucket) }); + new ItemStack(ItemRegistry.DESTRUCTOPACK), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "CPC", "PLP", "CPC", 'C', "circuitAdvanced", 'P', + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Steel, 1L), 'L', + new ItemStack(Items.lava_bucket) }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.ROCKCUTTER_MV), - RecipeLoader.BITSD, - new Object[] { "DS ", "DP ", "DCB", 'D', - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), 'S', - GT_OreDictUnificator.get(OrePrefixes.stick, Materials.TungstenSteel, 1L), 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 1L), 'C', "circuitGood", - 'B', ItemList.IC2_AdvBattery.get(1L) }); + new ItemStack(ItemRegistry.ROCKCUTTER_MV), + RecipeLoader.BITSD, + new Object[] { "DS ", "DP ", "DCB", 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.stick, Materials.TungstenSteel, 1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 1L), 'C', "circuitGood", 'B', + ItemList.IC2_AdvBattery.get(1L) }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.ROCKCUTTER_LV), - RecipeLoader.BITSD, - new Object[] { "DS ", "DP ", "DCB", 'D', - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), 'S', - GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Titanium, 1L), 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), 'C', "circuitBasic", 'B', - ItemList.IC2_ReBattery.get(1L) }); + new ItemStack(ItemRegistry.ROCKCUTTER_LV), + RecipeLoader.BITSD, + new Object[] { "DS ", "DP ", "DCB", 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Titanium, 1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), 'C', "circuitBasic", 'B', + ItemList.IC2_ReBattery.get(1L) }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.ROCKCUTTER_HV), - RecipeLoader.BITSD, - new Object[] { "DS ", "DP ", "DCB", 'D', - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), 'S', - GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Iridium, 1L), 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), 'C', "circuitAdvanced", 'B', - ItemList.IC2_EnergyCrystal.get(1L) }); + new ItemStack(ItemRegistry.ROCKCUTTER_HV), + RecipeLoader.BITSD, + new Object[] { "DS ", "DP ", "DCB", 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), + 'S', GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Iridium, 1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), 'C', "circuitAdvanced", 'B', + ItemList.IC2_EnergyCrystal.get(1L) }); if (ConfigHandler.teslastaff) { GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.TESLASTAFF), - RecipeLoader.BITSD, - new Object[] { "BO ", "OP ", " P", 'O', - GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUHV, 1L), 'B', - ItemList.Energy_LapotronicOrb.get(1L), 'P', "plateAlloyIridium", }); + new ItemStack(ItemRegistry.TESLASTAFF), + RecipeLoader.BITSD, + new Object[] { "BO ", "OP ", " P", 'O', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUHV, 1L), 'B', + ItemList.Energy_LapotronicOrb.get(1L), 'P', "plateAlloyIridium", }); } GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.PUMPPARTS, 1, 0), // tube - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { " fG", " G ", "G ", 'G', ItemList.Circuit_Parts_Glass_Tube.get(1L) }); + new ItemStack(ItemRegistry.PUMPPARTS, 1, 0), // tube + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { " fG", " G ", "G ", 'G', ItemList.Circuit_Parts_Glass_Tube.get(1L) }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), // motor - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "GLP", "LSd", "PfT", 'G', - GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.Steel, 1L), 'L', - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Steel, 1L), 'S', - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 1L), 'P', - new ItemStack(Blocks.piston), 'T', new ItemStack(ItemRegistry.PUMPPARTS, 1, 0) }); + new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), // motor + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "GLP", "LSd", "PfT", 'G', + GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.Steel, 1L), 'L', + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Steel, 1L), 'S', + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 1L), 'P', new ItemStack(Blocks.piston), + 'T', new ItemStack(ItemRegistry.PUMPPARTS, 1, 0) }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.PUMPBLOCK, 1, 0), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "IPI", "PMP", "ISI", 'I', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), 'P', - GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Wood, 1L), 'M', - new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), 'S', Ic2Items.ironFurnace }); + new ItemStack(ItemRegistry.PUMPBLOCK, 1, 0), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "IPI", "PMP", "ISI", 'I', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), + 'P', GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Wood, 1L), 'M', + new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), 'S', Ic2Items.ironFurnace }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.WINDMETER), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "SWF", "Sf ", "Ss ", 'S', "stickWood", 'W', - new ItemStack(Blocks.wool, 1, Short.MAX_VALUE), 'F', new ItemStack(Items.string), }); + new ItemStack(ItemRegistry.WINDMETER), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "SWF", "Sf ", "Ss ", 'S', "stickWood", 'W', new ItemStack(Blocks.wool, 1, Short.MAX_VALUE), + 'F', new ItemStack(Items.string), }); for (int i = 0; i < 3; i++) { Materials cable = cables[i + 2]; ItemStack machinehull = ItemList.MACHINE_HULLS[i + 2].get(1L); GT_ModHandler.addCraftingRecipe( - ItemRegistry.acidGens[i], - RecipeLoader.BITSD, - new Object[] { "HRH", "HCH", "HKH", 'H', bats[i], 'K', - GT_OreDictUnificator.get(OrePrefixes.cableGt01, cable, 1L), 'C', machinehull, 'R', - chreac[i] }); + ItemRegistry.acidGens[i], + RecipeLoader.BITSD, + new Object[] { "HRH", "HCH", "HKH", 'H', bats[i], 'K', + GT_OreDictUnificator.get(OrePrefixes.cableGt01, cable, 1L), 'C', machinehull, 'R', chreac[i] }); } GT_ModHandler.addCraftingRecipe( - ItemRegistry.acidGensLV, - RecipeLoader.BITSD, - new Object[] { "HRH", "KCK", "HKH", 'H', ItemList.Battery_Hull_LV.get(1L), 'K', - GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 1L), 'C', - ItemList.Hull_LV.get(1L), 'R', ItemList.Machine_LV_ChemicalReactor.get(1L), }); + ItemRegistry.acidGensLV, + RecipeLoader.BITSD, + new Object[] { "HRH", "KCK", "HKH", 'H', ItemList.Battery_Hull_LV.get(1L), 'K', + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 1L), 'C', ItemList.Hull_LV.get(1L), 'R', + ItemList.Machine_LV_ChemicalReactor.get(1L), }); for (int i = 0; i < 9; i++) { try { Materials cable = cables[i]; ItemStack hull = hulls[i] instanceof Materials - ? GT_OreDictUnificator.get(OrePrefixes.plate, hulls[i], 1L) - : ((Werkstoff) hulls[i]).get(OrePrefixes.plate); + ? GT_OreDictUnificator.get(OrePrefixes.plate, hulls[i], 1L) + : ((Werkstoff) hulls[i]).get(OrePrefixes.plate); ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); GT_ModHandler.addCraftingRecipe( - ItemRegistry.energyDistributor[i], - RecipeLoader.BITSD, - new Object[] { "PWP", "WCW", "PWP", 'W', - GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), 'P', hull, 'C', - machinehull }); + ItemRegistry.energyDistributor[i], + RecipeLoader.BITSD, + new Object[] { "PWP", "WCW", "PWP", 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), + 'P', hull, 'C', machinehull }); GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode12A[i], - RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', OrePrefixes.componentCircuit.get(Materials.Diode), 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), 'P', hull, 'C', - machinehull }); + ItemRegistry.diode12A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', OrePrefixes.componentCircuit.get(Materials.Diode), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), 'P', hull, 'C', machinehull }); GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode8A[i], - RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', OrePrefixes.componentCircuit.get(Materials.Diode), 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), 'P', hull, 'C', - machinehull }); + ItemRegistry.diode8A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', OrePrefixes.componentCircuit.get(Materials.Diode), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), 'P', hull, 'C', machinehull }); GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode4A[i], - RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', OrePrefixes.componentCircuit.get(Materials.Diode), 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), 'P', hull, 'C', - machinehull }); + ItemRegistry.diode4A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', OrePrefixes.componentCircuit.get(Materials.Diode), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), 'P', hull, 'C', machinehull }); GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode2A[i], - RecipeLoader.BITSD, - new Object[] { "WDW", "DCD", "PDP", 'D', OrePrefixes.componentCircuit.get(Materials.Diode), 'W', - GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), 'P', hull, 'C', - machinehull }); + ItemRegistry.diode2A[i], + RecipeLoader.BITSD, + new Object[] { "WDW", "DCD", "PDP", 'D', OrePrefixes.componentCircuit.get(Materials.Diode), 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), 'P', hull, 'C', machinehull }); GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode16A[i], - RecipeLoader.BITSD, - new Object[] { "WHW", "DCD", "PDP", 'H', OrePrefixes.componentCircuit.get(Materials.Inductor), - 'D', OrePrefixes.componentCircuit.get(Materials.Diode), 'W', - GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), 'P', hull, 'C', - machinehull }); + ItemRegistry.diode16A[i], + RecipeLoader.BITSD, + new Object[] { "WHW", "DCD", "PDP", 'H', OrePrefixes.componentCircuit.get(Materials.Inductor), 'D', + OrePrefixes.componentCircuit.get(Materials.Diode), 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), 'P', hull, 'C', machinehull }); } catch (ArrayIndexOutOfBoundsException ignored) { @@ -225,252 +214,245 @@ public class CraftingRecipes implements Runnable { for (String granite : granites) { for (String stone : stones) { GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "SSS", "DfD", " h ", 'S', stone, 'D', - new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), }); + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "SSS", "DfD", " h ", 'S', stone, 'D', + new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "hDf", "SSS", 'S', stone, 'D', - new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), }); + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "hDf", "SSS", 'S', stone, 'D', + new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "SSS", "DfD", " h ", 'S', stone, 'D', granite, }); + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "SSS", "DfD", " h ", 'S', stone, 'D', granite, }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "hDf", "SSS", 'S', stone, 'D', granite, }); + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "hDf", "SSS", 'S', stone, 'D', granite, }); } GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "STS", "h f", "SBS", 'S', granite, 'T', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), 'B', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), }); + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "STS", "h f", "SBS", 'S', granite, 'T', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), + 'B', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), }); } GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_ManualTrafo( - ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, - "bw.manualtrafo", - StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L), - RecipeLoader.BITSD, - new Object[] { "SCS", "CHC", "ZCZ", 'S', - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L), 'C', - new ItemStack(ItemRegistry.BW_BLOCKS[2]), 'H', ItemList.Hull_HV.get(1L), 'Z', - "circuitAdvanced" }); + new GT_TileEntity_ManualTrafo( + ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, + "bw.manualtrafo", + StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "SCS", "CHC", "ZCZ", 'S', + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L), 'C', + new ItemStack(ItemRegistry.BW_BLOCKS[2]), 'H', ItemList.Hull_HV.get(1L), 'Z', "circuitAdvanced" }); GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_Windmill( - ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 2, - "bw.windmill", - StatCollector.translateToLocal("tile.bw.windmill.name")).getStackForm(1L), - RecipeLoader.BITSD, - new Object[] { "BHB", "WGW", "BWB", 'B', new ItemStack(Blocks.brick_block), 'W', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), 'H', - new ItemStack(Blocks.hopper), 'G', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), }); + new GT_TileEntity_Windmill( + ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 2, + "bw.windmill", + StatCollector.translateToLocal("tile.bw.windmill.name")).getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "BHB", "WGW", "BWB", 'B', new ItemStack(Blocks.brick_block), 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), 'H', new ItemStack(Blocks.hopper), + 'G', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "STS", "h f", "SBS", 'S', - new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), 'T', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), 'B', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), }); + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "STS", "h f", "SBS", 'S', + new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), 'T', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), 'B', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "WLs", "WLh", "WLf", 'L', new ItemStack(Items.leather), 'W', "logWood", }); + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "WLs", "WLh", "WLf", 'L', new ItemStack(Items.leather), 'W', "logWood", }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "WLs", "WLh", "WLf", 'L', new ItemStack(Blocks.carpet), 'W', "logWood", }); + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "WLs", "WLh", "WLf", 'L', new ItemStack(Blocks.carpet), 'W', "logWood", }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "WLs", "WLh", "WLf", 'L', new ItemStack(Items.paper), 'W', "logWood", }); + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "WLs", "WLh", "WLf", 'L', new ItemStack(Items.paper), 'W', "logWood", }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "WEs", "WZh", "WDf", 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'Z', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'D', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "WEs", "WZh", "WDf", 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', "logWood", }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "WEs", "WZh", "WDf", 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'E', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'D', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "WEs", "WZh", "WDf", 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'E', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', "logWood", }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "WEs", "WZh", "WDf", 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'Z', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'E', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "WEs", "WZh", "WDf", 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', "logWood", }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "WEs", "WZh", "WDf", 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'D', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'Z', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "WEs", "WZh", "WDf", 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', "logWood", }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "WEs", "WZh", "WDf", 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'D', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'E', - new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', "logWood", }); + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "WEs", "WZh", "WDf", 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', "logWood", }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.LEATHER_ROTOR), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'W', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); + new ItemStack(ItemRegistry.LEATHER_ROTOR), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.WOOL_ROTOR), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'W', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); + new ItemStack(ItemRegistry.WOOL_ROTOR), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.PAPER_ROTOR), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); + new ItemStack(ItemRegistry.PAPER_ROTOR), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.COMBINED_ROTOR), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), 'W', - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); + new ItemStack(ItemRegistry.COMBINED_ROTOR), + GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[] { "hPf", "PWP", "sPr", 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.ROTORBLOCK), - RecipeLoader.BITSD, - new Object[] { "WRW", "RGR", "WRW", 'R', GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Iron, 1L), - 'W', "plankWood", 'G', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); + new ItemStack(ItemRegistry.ROTORBLOCK), + RecipeLoader.BITSD, + new Object[] { "WRW", "RGR", "WRW", 'R', GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Iron, 1L), + 'W', "plankWood", 'G', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), }); GT_ModHandler.addCraftingRecipe( - ItemRegistry.THTR, - RecipeLoader.BITSD, - new Object[] { "BZB", "BRB", "BZB", 'B', new ItemStack(GregTech_API.sBlockCasings3, 1, 12), 'R', - GT_ModHandler.getModItem(IndustrialCraft2.ID, "blockGenerator", 1, 5), 'Z', - "circuitUltimate" }); + ItemRegistry.THTR, + RecipeLoader.BITSD, + new Object[] { "BZB", "BRB", "BZB", 'B', new ItemStack(GregTech_API.sBlockCasings3, 1, 12), 'R', + GT_ModHandler.getModItem(IndustrialCraft2.ID, "blockGenerator", 1, 5), 'Z', "circuitUltimate" }); GT_ModHandler.addCraftingRecipe( - ItemRegistry.HTGR, - RecipeLoader.BITSD, - new Object[] { "BZB", "BRB", "BZB", 'B', new ItemStack(GregTech_API.sBlockCasings8, 1, 5), 'R', - GT_ModHandler.getModItem(IndustrialCraft2.ID, "blockGenerator", 1, 5), 'Z', - "circuitSuperconductor" }); + ItemRegistry.HTGR, + RecipeLoader.BITSD, + new Object[] { "BZB", "BRB", "BZB", 'B', new ItemStack(GregTech_API.sBlockCasings8, 1, 5), 'R', + GT_ModHandler.getModItem(IndustrialCraft2.ID, "blockGenerator", 1, 5), 'Z', "circuitSuperconductor" }); // DNAExtractionModule GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[0], - RecipeLoader.BITSD, - new Object[] { "TET", "CFC", "TST", 'T', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), 'E', - ItemList.Emitter_EV.get(1L), 'C', - GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), 'S', - ItemList.Sensor_EV.get(1L), 'F', ItemList.Field_Generator_EV.get(1L) }); + BioItemList.mBioLabParts[0], + RecipeLoader.BITSD, + new Object[] { "TET", "CFC", "TST", 'T', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), 'E', ItemList.Emitter_EV.get(1L), + 'C', GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), 'S', + ItemList.Sensor_EV.get(1L), 'F', ItemList.Field_Generator_EV.get(1L) }); // PCRThermoclyclingModule GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[1], - RecipeLoader.BITSD, - new Object[] { "NEN", "CFC", "NSN", 'N', - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), 'E', - ItemList.Emitter_EV.get(1L), 'C', - GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), 'S', - ItemList.Sensor_EV.get(1L), 'F', ItemList.Field_Generator_EV.get(1L) }); + BioItemList.mBioLabParts[1], + RecipeLoader.BITSD, + new Object[] { "NEN", "CFC", "NSN", 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), 'E', + ItemList.Emitter_EV.get(1L), 'C', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), 'S', + ItemList.Sensor_EV.get(1L), 'F', ItemList.Field_Generator_EV.get(1L) }); // PlasmidSynthesisModule GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[2], - RecipeLoader.BITSD, - new Object[] { "SFE", "CPC", "NFN", 'N', - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), 'C', - "circuit" + Materials.Data, 'F', ItemList.Field_Generator_EV.get(1L), 'E', - ItemList.Emitter_EV.get(1L), 'S', ItemList.Sensor_EV.get(1L), 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), }); + BioItemList.mBioLabParts[2], + RecipeLoader.BITSD, + new Object[] { "SFE", "CPC", "NFN", 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), 'C', "circuit" + Materials.Data, + 'F', ItemList.Field_Generator_EV.get(1L), 'E', ItemList.Emitter_EV.get(1L), 'S', + ItemList.Sensor_EV.get(1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), }); // TransformationModule GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[3], - RecipeLoader.BITSD, - new Object[] { "SFE", "CPC", "NFN", 'N', - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), 'C', - "circuit" + Materials.Master, 'F', ItemList.Field_Generator_LuV.get(1L), 'E', - ItemList.Emitter_LuV.get(1L), 'S', ItemList.Sensor_LuV.get(1L), 'P', - WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.plate, 1), }); + BioItemList.mBioLabParts[3], + RecipeLoader.BITSD, + new Object[] { "SFE", "CPC", "NFN", 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), 'C', + "circuit" + Materials.Master, 'F', ItemList.Field_Generator_LuV.get(1L), 'E', + ItemList.Emitter_LuV.get(1L), 'S', ItemList.Sensor_LuV.get(1L), 'P', + WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.plate, 1), }); // ClonalCellularSynthesisModule GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[4], - RecipeLoader.BITSD, - new Object[] { "FEF", "CPC", "FSF", 'N', - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), 'C', - "circuit" + Materials.Master, 'F', ItemList.Field_Generator_LuV.get(1L), 'E', - ItemList.Emitter_LuV.get(1L), 'S', ItemList.Sensor_LuV.get(1L), 'P', - WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.plate, 1), }); + BioItemList.mBioLabParts[4], + RecipeLoader.BITSD, + new Object[] { "FEF", "CPC", "FSF", 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), 'C', + "circuit" + Materials.Master, 'F', ItemList.Field_Generator_LuV.get(1L), 'E', + ItemList.Emitter_LuV.get(1L), 'S', ItemList.Sensor_LuV.get(1L), 'P', + WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.plate, 1), }); GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_BioVat( - ConfigHandler.IDOffset + GT_Values.VN.length * 7, - "bw.biovat", - StatCollector.translateToLocal("tile.biovat.name")).getStackForm(1L), - RecipeLoader.BITSD, - new Object[] { "GCG", "KHK", "GCG", 'G', new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 'C', - "circuit" + Materials.Data, 'K', - GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Silver, 1L), 'H', - ItemList.MACHINE_HULLS[3].get(1L) }); + new GT_TileEntity_BioVat( + ConfigHandler.IDOffset + GT_Values.VN.length * 7, + "bw.biovat", + StatCollector.translateToLocal("tile.biovat.name")).getStackForm(1L), + RecipeLoader.BITSD, + new Object[] { "GCG", "KHK", "GCG", 'G', new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 'C', + "circuit" + Materials.Data, 'K', GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Silver, 1L), + 'H', ItemList.MACHINE_HULLS[3].get(1L) }); ItemStack[] Pistons2 = { ItemList.Electric_Piston_HV.get(1L), ItemList.Electric_Piston_EV.get(1L), - ItemList.Electric_Piston_IV.get(1L), ItemList.Electric_Piston_LuV.get(1L), - ItemList.Electric_Piston_ZPM.get(1L), ItemList.Electric_Piston_UV.get(1L) }; + ItemList.Electric_Piston_IV.get(1L), ItemList.Electric_Piston_LuV.get(1L), + ItemList.Electric_Piston_ZPM.get(1L), ItemList.Electric_Piston_UV.get(1L) }; ItemStack[] BioLab2 = new ItemStack[GT_Values.VN.length - 3]; ItemStack[] RadioHatch2 = new ItemStack[GT_Values.VN.length - 3]; Materials[] cables2 = { Materials.Gold, Materials.Aluminium, Materials.Tungsten, Materials.VanadiumGallium, - Materials.Naquadah, Materials.NaquadahAlloy, Materials.SuperconductorUHV }; + Materials.Naquadah, Materials.NaquadahAlloy, Materials.SuperconductorUHV }; Materials[] hulls2 = { Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, Materials.Chrome, - Materials.Iridium, Materials.Osmium, Materials.Naquadah }; + Materials.Iridium, Materials.Osmium, Materials.Naquadah }; Materials[] wireMat2 = { Materials.Kanthal, Materials.Nichrome, Materials.TungstenSteel, Materials.Naquadah, - Materials.NaquadahAlloy, Materials.SuperconductorUHV }; + Materials.NaquadahAlloy, Materials.SuperconductorUHV }; Materials[] circuits2 = { Materials.Advanced, Materials.Data, Materials.Elite, Materials.Master, - Materials.Ultimate, Materials.SuperconductorUHV }; + Materials.Ultimate, Materials.SuperconductorUHV }; for (int i = 3; i < GT_Values.VN.length - 1; i++) { // 12625 BioLab2[i - 3] = new GT_MetaTileEntity_BioLab( - ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i, - "bw.biolab" + GT_Values.VN[i], - GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.biolab.name"), - i).getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i, + "bw.biolab" + GT_Values.VN[i], + GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.biolab.name"), + i).getStackForm(1L); RadioHatch2[i - 3] = new GT_MetaTileEntity_RadioHatch( - ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i, - "bw.radiohatch" + GT_Values.VN[i], - GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.radiohatch.name"), - i).getStackForm(1L); + ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i, + "bw.radiohatch" + GT_Values.VN[i], + GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.radiohatch.name"), + i).getStackForm(1L); try { ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); GT_ModHandler.addCraftingRecipe( - BioLab2[i - 3], - RecipeLoader.BITSD, - new Object[] { "PFP", "WCW", "OGO", 'F', - GT_OreDictUnificator.get(OrePrefixes.frameGt, hulls2[i - 3], 1L), 'W', - GT_OreDictUnificator.get(OrePrefixes.wireGt01, wireMat2[i - 3], 1L), 'P', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O', - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G', - "circuit" + circuits2[i - 3], 'C', machinehull }); + BioLab2[i - 3], + RecipeLoader.BITSD, + new Object[] { "PFP", "WCW", "OGO", 'F', + GT_OreDictUnificator.get(OrePrefixes.frameGt, hulls2[i - 3], 1L), 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt01, wireMat2[i - 3], 1L), 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), 'O', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), 'G', + "circuit" + circuits2[i - 3], 'C', machinehull }); GT_ModHandler.addCraftingRecipe( - RadioHatch2[i - 3], - RecipeLoader.BITSD, - new Object[] { "DPD", "DCD", "DKD", 'D', - GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), 'C', machinehull, - 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cables2[i - 3], 1L), 'P', - Pistons2[i - 3] }); + RadioHatch2[i - 3], + RecipeLoader.BITSD, + new Object[] { "DPD", "DCD", "DKD", 'D', + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), 'C', machinehull, 'K', + GT_OreDictUnificator.get(OrePrefixes.cableGt08, cables2[i - 3], 1L), 'P', Pistons2[i - 3] }); } catch (ArrayIndexOutOfBoundsException ignored) { } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java index c69af8159b..9502d4eff3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Electrolyzer.java @@ -19,106 +19,134 @@ public class Electrolyzer implements Runnable { @Override public void run() { - GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.Forsterit.get(OrePrefixes.dust, 7)) - .itemOutputs( - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnesium, 2L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L)) - .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(10 * SECONDS).eut(90).addTo(electrolyzerRecipes); - - GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.RedZircon.get(OrePrefixes.dust, 6)) - .itemOutputs( - WerkstoffLoader.Zirconium.get(OrePrefixes.dust, 1), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L)) - .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(12 * SECONDS + 10 * TICKS).eut(90) - .addTo(electrolyzerRecipes); - - GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.Fayalit.get(OrePrefixes.dust, 7)) - .itemOutputs( - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 2L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L)) - .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(16 * SECONDS).eut(90).addTo(electrolyzerRecipes); - - GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.Prasiolite.get(OrePrefixes.dust, 16)) - .itemOutputs( - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 5L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L)) - .duration(29 * SECONDS).eut(90).addTo(electrolyzerRecipes); - - GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.Hedenbergit.get(OrePrefixes.dust, 10)) - .itemOutputs( - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Calcium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 2L)) - .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(15 * SECONDS).eut(90).addTo(electrolyzerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(WerkstoffLoader.Forsterit.get(OrePrefixes.dust, 7)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnesium, 2L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L)) + .fluidOutputs(Materials.Oxygen.getGas(2000L)) + .duration(10 * SECONDS) + .eut(90) + .addTo(electrolyzerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(WerkstoffLoader.RedZircon.get(OrePrefixes.dust, 6)) + .itemOutputs( + WerkstoffLoader.Zirconium.get(OrePrefixes.dust, 1), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L)) + .fluidOutputs(Materials.Oxygen.getGas(2000L)) + .duration(12 * SECONDS + 10 * TICKS) + .eut(90) + .addTo(electrolyzerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(WerkstoffLoader.Fayalit.get(OrePrefixes.dust, 7)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 2L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L)) + .fluidOutputs(Materials.Oxygen.getGas(2000L)) + .duration(16 * SECONDS) + .eut(90) + .addTo(electrolyzerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(WerkstoffLoader.Prasiolite.get(OrePrefixes.dust, 16)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 5L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L)) + .duration(29 * SECONDS) + .eut(90) + .addTo(electrolyzerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(WerkstoffLoader.Hedenbergit.get(OrePrefixes.dust, 10)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Calcium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 2L)) + .fluidOutputs(Materials.Oxygen.getGas(2000L)) + .duration(15 * SECONDS) + .eut(90) + .addTo(electrolyzerRecipes); GT_Values.RA.stdBuilder() - .itemInputs(WerkstoffLoader.FuchsitAL.get(OrePrefixes.dust, 21), ItemList.Cell_Empty.get(2)) - .itemOutputs( - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 3L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2)) - .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(19 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_MV) - .addTo(electrolyzerRecipes); + .itemInputs(WerkstoffLoader.FuchsitAL.get(OrePrefixes.dust, 21), ItemList.Cell_Empty.get(2)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2)) + .fluidOutputs(Materials.Oxygen.getGas(2000L)) + .duration(19 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_MV) + .addTo(electrolyzerRecipes); GT_Values.RA.stdBuilder() - .itemInputs(WerkstoffLoader.FuchsitCR.get(OrePrefixes.dust, 21), ItemList.Cell_Empty.get(2)) - .itemOutputs( - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2)) - .fluidOutputs(Materials.Oxygen.getGas(2000L)).duration(23 * SECONDS).eut(TierEU.RECIPE_MV) - .addTo(electrolyzerRecipes); + .itemInputs(WerkstoffLoader.FuchsitCR.get(OrePrefixes.dust, 21), ItemList.Cell_Empty.get(2)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2)) + .fluidOutputs(Materials.Oxygen.getGas(2000L)) + .duration(23 * SECONDS) + .eut(TierEU.RECIPE_MV) + .addTo(electrolyzerRecipes); GT_Values.RA.stdBuilder() - .itemInputs(WerkstoffLoader.VanadioOxyDravit.get(OrePrefixes.dust, 53), ItemList.Cell_Empty.get(3)) - .itemOutputs( - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Vanadium, 3L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3)) - .fluidOutputs(Materials.Oxygen.getGas(19000L)).duration(35 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_MV) - .addTo(electrolyzerRecipes); + .itemInputs(WerkstoffLoader.VanadioOxyDravit.get(OrePrefixes.dust, 53), ItemList.Cell_Empty.get(3)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Vanadium, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3)) + .fluidOutputs(Materials.Oxygen.getGas(19000L)) + .duration(35 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_MV) + .addTo(electrolyzerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - WerkstoffLoader.ChromoAluminoPovondrait.get(OrePrefixes.dust, 53), - ItemList.Cell_Empty.get(3)) - .itemOutputs( - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3)) - .fluidOutputs(Materials.Oxygen.getGas(19000L)).duration(36 * SECONDS).eut(TierEU.RECIPE_MV) - .addTo(electrolyzerRecipes); + .itemInputs(WerkstoffLoader.ChromoAluminoPovondrait.get(OrePrefixes.dust, 53), ItemList.Cell_Empty.get(3)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3)) + .fluidOutputs(Materials.Oxygen.getGas(19000L)) + .duration(36 * SECONDS) + .eut(TierEU.RECIPE_MV) + .addTo(electrolyzerRecipes); GT_Values.RA.stdBuilder() - .itemInputs(WerkstoffLoader.FluorBuergerit.get(OrePrefixes.dust, 50), ItemList.Cell_Empty.get(3)) - .itemOutputs( - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 3L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 6L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fluorine, 3)) - .fluidOutputs(Materials.Oxygen.getGas(6000L)).duration(36 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_MV) - .addTo(electrolyzerRecipes); + .itemInputs(WerkstoffLoader.FluorBuergerit.get(OrePrefixes.dust, 50), ItemList.Cell_Empty.get(3)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fluorine, 3)) + .fluidOutputs(Materials.Oxygen.getGas(6000L)) + .duration(36 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_MV) + .addTo(electrolyzerRecipes); GT_Values.RA.stdBuilder() - .itemInputs(WerkstoffLoader.Olenit.get(OrePrefixes.dust, 51), ItemList.Cell_Empty.get(1)) - .itemOutputs( - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 9L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6L), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 1)) - .fluidOutputs(Materials.Oxygen.getGas(1000L)).duration(39 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_MV) - .addTo(electrolyzerRecipes); + .itemInputs(WerkstoffLoader.Olenit.get(OrePrefixes.dust, 51), ItemList.Cell_Empty.get(1)) + .itemOutputs( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 9L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 1)) + .fluidOutputs(Materials.Oxygen.getGas(1000L)) + .duration(39 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_MV) + .addTo(electrolyzerRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java index befa1bf05d..9b304de837 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Extractor.java @@ -24,16 +24,22 @@ public class Extractor implements Runnable { if (CropLoadCore.isModLoaded() && !oreCropVine.isEmpty()) { for (ItemStack stack : oreCropVine) { - GT_Values.RA.stdBuilder().itemInputs(BW_Util.setStackSize(stack, 12)) - .itemOutputs(BioItemList.getOther(1)).duration(25 * SECONDS).eut((int) TierEU.RECIPE_HV) - .addTo(extractorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(BW_Util.setStackSize(stack, 12)) + .itemOutputs(BioItemList.getOther(1)) + .duration(25 * SECONDS) + .eut((int) TierEU.RECIPE_HV) + .addTo(extractorRecipes); } } - GT_Values.RA.stdBuilder().itemInputs(ItemList.Circuit_Chip_Stemcell.get(1L)) - .itemOutputs(BioItemList.getOther(4)).duration(25 * SECONDS).eut((int) TierEU.RECIPE_LuV) - .addTo(extractorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.Circuit_Chip_Stemcell.get(1L)) + .itemOutputs(BioItemList.getOther(4)) + .duration(25 * SECONDS) + .eut((int) TierEU.RECIPE_LuV) + .addTo(extractorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java index 9c1d594bad..3d27c55038 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidHeater.java @@ -16,9 +16,12 @@ public class FluidHeater implements Runnable { @Override public void run() { - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(10)) - .fluidInputs(new FluidStack(FluidLoader.fulvicAcid, 1000)) - .fluidOutputs(new FluidStack(FluidLoader.heatedfulvicAcid, 1000)).duration(4 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_MV).addTo(fluidHeaterRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.getIntegratedCircuit(10)) + .fluidInputs(new FluidStack(FluidLoader.fulvicAcid, 1000)) + .fluidOutputs(new FluidStack(FluidLoader.heatedfulvicAcid, 1000)) + .duration(4 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_MV) + .addTo(fluidHeaterRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java index dfd92ee866..4991370f44 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FluidSolidifier.java @@ -19,55 +19,85 @@ public class FluidSolidifier implements Runnable { @Override public void run() { - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(Blocks.lapis_block)) - .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0)) - .fluidInputs(Materials.Iron.getMolten(1296L)).duration(5 * SECONDS).eut(TierEU.RECIPE_HV) - .addTo(fluidSolidifierRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) - .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1)) - .fluidInputs(Materials.Titanium.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_HV) - .addTo(fluidSolidifierRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) - .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2)) - .fluidInputs(Materials.TungstenSteel.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_EV) - .addTo(fluidSolidifierRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) - .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3)) - .fluidInputs(WerkstoffLoader.LuVTierMaterial.getMolten(1152)).duration(40 * SECONDS) - .eut(TierEU.RECIPE_IV).addTo(fluidSolidifierRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) - .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4)) - .fluidInputs(Materials.Iridium.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_LuV) - .addTo(fluidSolidifierRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) - .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5)) - .fluidInputs(Materials.Osmium.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_ZPM) - .addTo(fluidSolidifierRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) - .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 13)) - .fluidInputs(Materials.Neutronium.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_UV) - .addTo(fluidSolidifierRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) - .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 14)) - .fluidInputs(Materials.CosmicNeutronium.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_UHV) - .addTo(fluidSolidifierRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) - .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 15)) - .fluidInputs(Materials.Infinity.getMolten(1152)).duration(40 * SECONDS).eut(TierEU.RECIPE_UEV) - .addTo(fluidSolidifierRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) - .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[1], 1, 0)) - .fluidInputs(MaterialsUEVplus.TranscendentMetal.getMolten(1152)).duration(40 * SECONDS) - .eut(TierEU.RECIPE_UIV).addTo(fluidSolidifierRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(Blocks.lapis_block)) + .itemOutputs(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0)) + .fluidInputs(Materials.Iron.getMolten(1296L)) + .duration(5 * SECONDS) + .eut(TierEU.RECIPE_HV) + .addTo(fluidSolidifierRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1)) + .fluidInputs(Materials.Titanium.getMolten(1152)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_HV) + .addTo(fluidSolidifierRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2)) + .fluidInputs(Materials.TungstenSteel.getMolten(1152)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_EV) + .addTo(fluidSolidifierRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3)) + .fluidInputs(WerkstoffLoader.LuVTierMaterial.getMolten(1152)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_IV) + .addTo(fluidSolidifierRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4)) + .fluidInputs(Materials.Iridium.getMolten(1152)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_LuV) + .addTo(fluidSolidifierRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5)) + .fluidInputs(Materials.Osmium.getMolten(1152)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_ZPM) + .addTo(fluidSolidifierRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 13)) + .fluidInputs(Materials.Neutronium.getMolten(1152)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_UV) + .addTo(fluidSolidifierRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 14)) + .fluidInputs(Materials.CosmicNeutronium.getMolten(1152)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_UHV) + .addTo(fluidSolidifierRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 15)) + .fluidInputs(Materials.Infinity.getMolten(1152)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_UEV) + .addTo(fluidSolidifierRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)) + .itemOutputs(new ItemStack(ItemRegistry.bw_glasses[1], 1, 0)) + .fluidInputs(MaterialsUEVplus.TranscendentMetal.getMolten(1152)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_UIV) + .addTo(fluidSolidifierRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java index 251200649d..bdeb24af9e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/FormingPress.java @@ -19,48 +19,58 @@ public class FormingPress implements Runnable { @Override public void run() { GT_Values.RA.stdBuilder() - .itemInputs( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials), - Materials.Graphite.getDust(64)) - .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1)) - .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(formingPressRecipes); + .itemInputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials), Materials.Graphite.getDust(64)) + .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1)) + .duration(2 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(formingPressRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1), - Materials.Silicon.getDust(64)) - .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2)) - .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(formingPressRecipes); + .itemInputs( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1), + Materials.Silicon.getDust(64)) + .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2)) + .duration(2 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(formingPressRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2), - Materials.Graphite.getDust(64)) - .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3)) - .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(formingPressRecipes); + .itemInputs( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2), + Materials.Graphite.getDust(64)) + .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3)) + .duration(2 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(formingPressRecipes); int i = 0; for (GT_TileEntity_HTGR.HTGRMaterials.Fuel_ fuel : sHTGR_Fuel) { GT_Values.RA.stdBuilder() - .itemInputs( - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i), - Materials.Carbon.getDust(64)) - .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1)) - .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(formingPressRecipes); + .itemInputs( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i), + Materials.Carbon.getDust(64)) + .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1)) + .duration(2 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(formingPressRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), - Materials.Silicon.getDust(64)) - .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2)) - .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(formingPressRecipes); + .itemInputs( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), + Materials.Silicon.getDust(64)) + .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2)) + .duration(2 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(formingPressRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), - Materials.Graphite.getDust(64)) - .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3)) - .duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(formingPressRecipes); + .itemInputs( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), + Materials.Graphite.getDust(64)) + .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3)) + .duration(2 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(formingPressRecipes); i += MATERIALS_PER_FUEL; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java index c37fad13d4..59c84d0f7c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/LaserEngraver.java @@ -17,9 +17,12 @@ public class LaserEngraver implements Runnable { @Override public void run() { - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(Items.emerald), GT_Utility.getIntegratedCircuit(17)) - .itemOutputs(BioItemList.getPlasmidCell(null)).duration(5 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(laserEngraverRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(Items.emerald), GT_Utility.getIntegratedCircuit(17)) + .itemOutputs(BioItemList.getPlasmidCell(null)) + .duration(5 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(laserEngraverRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java index 92ccdc005d..d69b4278ef 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Mixer.java @@ -27,31 +27,38 @@ public class Mixer implements Runnable { @Override public void run() { GT_Values.RA.stdBuilder() - .itemInputs( - WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 10), - Materials.Uranium235.getDust(1), - GT_Utility.getIntegratedCircuit(2)) - .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials)).duration(20 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(mixerRecipes); + .itemInputs( + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 10), + Materials.Uranium235.getDust(1), + GT_Utility.getIntegratedCircuit(2)) + .itemOutputs(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials)) + .duration(20 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(mixerRecipes); int i = 0; for (GT_TileEntity_HTGR.HTGRMaterials.Fuel_ fuel : sHTGR_Fuel) { - GT_Values.RA.stdBuilder().itemInputs(fuel.mainItem, fuel.secondaryItem, GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i)) - .duration(20 * SECONDS).eut(TierEU.RECIPE_LV).addTo(mixerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(fuel.mainItem, fuel.secondaryItem, GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i)) + .duration(20 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(mixerRecipes); i += MATERIALS_PER_FUEL; } if (Gendustry.isModLoaded()) { GT_Values.RA.stdBuilder() - .itemInputs( - GT_Utility.getIntegratedCircuit(17), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Radon, 1L)) - .itemOutputs(Materials.Empty.getCells(1)) - .fluidInputs(FluidRegistry.getFluidStack("liquiddna", 1000)) - .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[0], 2000)).duration(25 * SECONDS) - .eut(TierEU.RECIPE_HV).addTo(mixerRecipes); + .itemInputs( + GT_Utility.getIntegratedCircuit(17), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Radon, 1L)) + .itemOutputs(Materials.Empty.getCells(1)) + .fluidInputs(FluidRegistry.getFluidStack("liquiddna", 1000)) + .fluidOutputs(new FluidStack(FluidLoader.BioLabFluidMaterials[0], 2000)) + .duration(25 * SECONDS) + .eut(TierEU.RECIPE_HV) + .addTo(mixerRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java index 1f505f96a9..4dbcc45708 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/Pulverizer.java @@ -19,49 +19,79 @@ public class Pulverizer implements Runnable { @Override public void run() { - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1)) - .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Titanium.getDust(8)) - .duration(40 * SECONDS).eut(TierEU.RECIPE_EV).addTo(maceratorRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2)) - .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.TungstenSteel.getDust(8)) - .duration(40 * SECONDS).eut(TierEU.RECIPE_IV).addTo(maceratorRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3)) - .itemOutputs( - Materials.BorosilicateGlass.getDust(9), - WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.dust, 8)) - .duration(40 * SECONDS).eut(TierEU.RECIPE_LuV).addTo(maceratorRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4)) - .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Iridium.getDust(8)) - .duration(40 * SECONDS).eut(TierEU.RECIPE_ZPM).addTo(maceratorRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5)) - .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Osmium.getDust(8)).duration(40 * SECONDS) - .eut(TierEU.RECIPE_UV).addTo(maceratorRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 13)) - .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Neutronium.getDust(8)) - .duration(40 * SECONDS).eut(TierEU.RECIPE_UHV).addTo(maceratorRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 14)) - .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.CosmicNeutronium.getDust(8)) - .duration(40 * SECONDS).eut(TierEU.RECIPE_UEV).addTo(maceratorRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 15)) - .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Infinity.getDust(8)) - .duration(40 * SECONDS).eut(TierEU.RECIPE_UIV).addTo(maceratorRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[1], 1, 0)) - .itemOutputs(Materials.BorosilicateGlass.getDust(9), MaterialsUEVplus.TranscendentMetal.getDust(8)) - .duration(40 * SECONDS).eut(TierEU.RECIPE_UMV).addTo(maceratorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Titanium.getDust(8)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_EV) + .addTo(maceratorRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.TungstenSteel.getDust(8)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_IV) + .addTo(maceratorRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3)) + .itemOutputs( + Materials.BorosilicateGlass.getDust(9), + WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.dust, 8)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_LuV) + .addTo(maceratorRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Iridium.getDust(8)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_ZPM) + .addTo(maceratorRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Osmium.getDust(8)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_UV) + .addTo(maceratorRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 13)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Neutronium.getDust(8)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_UHV) + .addTo(maceratorRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 14)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.CosmicNeutronium.getDust(8)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_UEV) + .addTo(maceratorRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, 15)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9), Materials.Infinity.getDust(8)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_UIV) + .addTo(maceratorRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[1], 1, 0)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9), MaterialsUEVplus.TranscendentMetal.getDust(8)) + .duration(40 * SECONDS) + .eut(TierEU.RECIPE_UMV) + .addTo(maceratorRecipes); for (int i = 6; i < 11; i++) { - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, i)) - .itemOutputs(Materials.BorosilicateGlass.getDust(9)).duration(20 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(maceratorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(ItemRegistry.bw_glasses[0], 1, i)) + .itemOutputs(Materials.BorosilicateGlass.getDust(9)) + .duration(20 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(maceratorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/PyrolyseOven.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/PyrolyseOven.java index 10a2786b8c..c810c323d9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/PyrolyseOven.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/recipes/PyrolyseOven.java @@ -13,12 +13,12 @@ public class PyrolyseOven implements Runnable { @Override public void run() { GT_Values.RA.addPyrolyseRecipe( - Materials.Wood.getDust(10), - new FluidStack(FluidLoader.Kerogen, 1000), - 10, - null, - Materials.Oil.getFluid(1000), - 105, - (int) TierEU.RECIPE_HV); + Materials.Wood.getDust(10), + new FluidStack(FluidLoader.Kerogen, 1000), + 10, + null, + Materials.Oil.getFluid(1000), + 105, + (int) TierEU.RECIPE_HV); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index e5ae3c8994..b5e002ef29 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -55,56 +55,78 @@ public class BW_Network extends MessageToMessageCodec aOutput) - throws Exception { + throws Exception { aOutput.add( - new FMLProxyPacket( - Unpooled.buffer().writeByte(aPacket.getPacketID()).writeBytes(aPacket.encode()).copy(), - aContext.channel().attr(NetworkRegistry.FML_CHANNEL).get())); + new FMLProxyPacket( + Unpooled.buffer() + .writeByte(aPacket.getPacketID()) + .writeBytes(aPacket.encode()) + .copy(), + aContext.channel() + .attr(NetworkRegistry.FML_CHANNEL) + .get())); } @Override protected void decode(ChannelHandlerContext aContext, FMLProxyPacket aPacket, List aOutput) - throws Exception { - ByteArrayDataInput aData = ByteStreams.newDataInput(aPacket.payload().array()); + throws Exception { + ByteArrayDataInput aData = ByteStreams.newDataInput( + aPacket.payload() + .array()); aOutput.add(this.mSubChannels[aData.readByte()].decode(aData)); } @Override public void sendToPlayer(@Nonnull GT_Packet aPacket, @Nonnull EntityPlayerMP aPlayer) { - this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.PLAYER); - this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPlayer); - this.mChannel.get(Side.SERVER).writeAndFlush(aPacket); + this.mChannel.get(Side.SERVER) + .attr(FMLOutboundHandler.FML_MESSAGETARGET) + .set(FMLOutboundHandler.OutboundTarget.PLAYER); + this.mChannel.get(Side.SERVER) + .attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) + .set(aPlayer); + this.mChannel.get(Side.SERVER) + .writeAndFlush(aPacket); } public void sendToAllPlayersinWorld(@Nonnull GT_Packet aPacket, World world) { - for (String name : FMLServerHandler.instance().getServer().getAllUsernames()) { - this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.PLAYER); - this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) - .set(world.getPlayerEntityByName(name)); - this.mChannel.get(Side.SERVER).writeAndFlush(aPacket); + for (String name : FMLServerHandler.instance() + .getServer() + .getAllUsernames()) { + this.mChannel.get(Side.SERVER) + .attr(FMLOutboundHandler.FML_MESSAGETARGET) + .set(FMLOutboundHandler.OutboundTarget.PLAYER); + this.mChannel.get(Side.SERVER) + .attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) + .set(world.getPlayerEntityByName(name)); + this.mChannel.get(Side.SERVER) + .writeAndFlush(aPacket); } } @Override public void sendToAllAround(@Nonnull GT_Packet aPacket, NetworkRegistry.TargetPoint aPosition) { - this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); - this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPosition); - this.mChannel.get(Side.SERVER).writeAndFlush(aPacket); + this.mChannel.get(Side.SERVER) + .attr(FMLOutboundHandler.FML_MESSAGETARGET) + .set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); + this.mChannel.get(Side.SERVER) + .attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) + .set(aPosition); + this.mChannel.get(Side.SERVER) + .writeAndFlush(aPacket); } @Override public void sendToServer(@Nonnull GT_Packet aPacket) { - this.mChannel.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.TOSERVER); - this.mChannel.get(Side.CLIENT).writeAndFlush(aPacket); + this.mChannel.get(Side.CLIENT) + .attr(FMLOutboundHandler.FML_MESSAGETARGET) + .set(FMLOutboundHandler.OutboundTarget.TOSERVER); + this.mChannel.get(Side.CLIENT) + .writeAndFlush(aPacket); } @Override @@ -117,8 +139,9 @@ public class BW_Network extends MessageToMessageCodec -1, - byteArrayDataInput.readByte()); + byteArrayDataInput.readInt(), + byteArrayDataInput.readInt(), + byteArrayDataInput.readByte() > -1, + byteArrayDataInput.readByte()); } @Override @@ -77,8 +79,8 @@ public class CircuitProgrammerPacket extends GT_Packet_New { if (this.hasChip) nbt.setByte("ChipConfig", this.chipCfg); stack.setTagCompound(nbt); ((EntityPlayer) w.getEntityByID(this.playerID)).inventory.setInventorySlotContents( - ((EntityPlayer) w.getEntityByID(this.playerID)).inventory.currentItem, - stack); + ((EntityPlayer) w.getEntityByID(this.playerID)).inventory.currentItem, + stack); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java index 631021a299..6b555014ed 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java @@ -54,11 +54,20 @@ public class MetaBlockPacket extends GT_Packet_New { @Override public void encode(ByteBuf aOut) { int hash = MurmurHash3.murmurhash3_x86_32( - ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), - 0, - 12, - 31); - aOut.writeInt(this.x).writeInt(this.z).writeShort(this.y).writeShort(this.meta).writeInt(hash); + ByteBuffer.allocate(12) + .putInt(this.x) + .putInt(this.z) + .putShort(this.y) + .putShort(this.meta) + .array(), + 0, + 12, + 31); + aOut.writeInt(this.x) + .writeInt(this.z) + .writeShort(this.y) + .writeShort(this.meta) + .writeInt(hash); } @Override @@ -69,10 +78,15 @@ public class MetaBlockPacket extends GT_Packet_New { this.meta = byteArrayDataInput.readShort(); MetaBlockPacket todecode = new MetaBlockPacket(this.x, this.y, this.z, this.meta); if (byteArrayDataInput.readInt() != MurmurHash3.murmurhash3_x86_32( - ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), - 0, - 12, - 31)) { + ByteBuffer.allocate(12) + .putInt(this.x) + .putInt(this.z) + .putShort(this.y) + .putShort(this.meta) + .array(), + 0, + 12, + 31)) { MainMod.LOGGER.error("PACKET HASH DOES NOT MATCH!"); return null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java index 3ae70af18b..c488273d73 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java @@ -47,7 +47,8 @@ public class OreDictCachePacket extends GT_Packet_New { int size = this.hashSet.size(); aOut.writeInt(size); for (Pair p : this.hashSet) { - aOut.writeInt(p.getKey()).writeShort(p.getValue()); + aOut.writeInt(p.getKey()) + .writeShort(p.getValue()); } } @@ -62,7 +63,9 @@ public class OreDictCachePacket extends GT_Packet_New { @Override public void process(IBlockAccess iBlockAccess) { - OreDictHandler.getNonBWCache().clear(); - OreDictHandler.getNonBWCache().addAll(this.hashSet); + OreDictHandler.getNonBWCache() + .clear(); + OreDictHandler.getNonBWCache() + .addAll(this.hashSet); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java index b1bb0a0dd8..436413fa14 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -53,26 +53,33 @@ public class RendererPacket extends GT_Packet_New { byte g = (byte) (this.integer >> 8 & 0xFF); byte b = (byte) (this.integer & 0xFF); byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25 - + this.coords.z % 25 - + this.coords.wID % 25 - + this.integer % 25 - + this.removal); - aOut.writeInt(this.coords.x).writeShort(this.coords.y).writeInt(this.coords.z).writeInt(this.coords.wID) - .writeByte(r).writeByte(g).writeByte(b).writeByte(this.removal).writeByte(checksum); + + this.coords.z % 25 + + this.coords.wID % 25 + + this.integer % 25 + + this.removal); + aOut.writeInt(this.coords.x) + .writeShort(this.coords.y) + .writeInt(this.coords.z) + .writeInt(this.coords.wID) + .writeByte(r) + .writeByte(g) + .writeByte(b) + .writeByte(this.removal) + .writeByte(checksum); } @Override public GT_Packet_New decode(ByteArrayDataInput dataInput) { this.coords = new Coords(dataInput.readInt(), dataInput.readShort(), dataInput.readInt(), dataInput.readInt()); this.integer = BW_ColorUtil - .getColorFromRGBArray(new int[] { dataInput.readByte(), dataInput.readByte(), dataInput.readByte() }); + .getColorFromRGBArray(new int[] { dataInput.readByte(), dataInput.readByte(), dataInput.readByte() }); this.removal = dataInput.readByte(); byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25 - + this.coords.z % 25 - + this.coords.wID % 25 - + this.integer % 25 - + this.removal); + + this.coords.z % 25 + + this.coords.wID % 25 + + this.integer % 25 + + this.removal); if (checksum != dataInput.readByte()) { MainMod.LOGGER.error("BW Packet was corrupted or modified!"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java index 3a6734d568..091802683d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java @@ -33,7 +33,7 @@ public class ServerJoinedPackage extends GT_Packet_New { public ServerJoinedPackage(Object obj) { super(false); this.config = (byte) (ConfigHandler.classicMode && ConfigHandler.disableExtraGassesForEBF ? 3 - : ConfigHandler.classicMode ? 2 : ConfigHandler.disableExtraGassesForEBF ? 1 : 0); + : ConfigHandler.classicMode ? 2 : ConfigHandler.disableExtraGassesForEBF ? 1 : 0); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java index 9d6c03be7d..79bedfa1b8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java @@ -98,10 +98,16 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem private void setFluidBlock(Coords current) { if (!this.checkForAir(current) || this.tank.drain(1000, false) == null - || this.tank.drain(1000, false).amount != 1000) - return; + || this.tank.drain(1000, false).amount != 1000) return; FluidStack stack = this.tank.drain(1000, true); - this.worldObj.setBlock(current.x, current.y, current.z, stack.getFluid().getBlock(), 0, 2); + this.worldObj.setBlock( + current.x, + current.y, + current.z, + stack.getFluid() + .getBlock(), + 0, + 2); } private void addBlockToQueue(Coords current, ForgeDirection allowed_direction) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index 98932b8d72..faccfc4738 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -52,7 +52,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.GT_Pollution; public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDropsContent, IFluidHandler, IFluidTank, - ITileWithModularUI, ITileAddsInformation, ITileHasDifferentTextureSides { + ITileWithModularUI, ITileAddsInformation, ITileHasDifferentTextureSides { public static final int FUELSLOT = 0; public static final Fluid WATER = FluidRegistry.WATER; @@ -85,7 +85,8 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr this.fuel = compound.getInteger("fuel"); this.maxfuel = compound.getInteger("maxfuel"); this.outputstack = FluidStack.loadFluidStackFromNBT(compound.getCompoundTag("FluidStack")); - if (!compound.getCompoundTag("ItemStack").equals(new NBTTagCompound())) + if (!compound.getCompoundTag("ItemStack") + .equals(new NBTTagCompound())) this.fuelstack = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("ItemStack")); super.readFromNBT(compound); } @@ -134,38 +135,40 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr private void pushWaterToAdjacentTiles() { Arrays.stream(ForgeDirection.values(), 0, 6) // All but Unknown - .forEach( - direction -> Optional.ofNullable( - this.worldObj.getTileEntity( - this.xCoord + direction.offsetX, - this.yCoord + direction.offsetY, - this.zCoord + direction.offsetZ)) - .ifPresent(te -> { - if (te instanceof IFluidHandler tank) { - if (tank.canFill(direction.getOpposite(), this.outputstack.getFluid())) { - int drainage = tank.fill(direction.getOpposite(), this.outputstack, false); - if (drainage > 0) { - tank.fill(direction.getOpposite(), this.outputstack, true); - this.drain(drainage, true); - } - } - } else if (te instanceof IFluidTank tank) { - int drainage = tank.fill(this.outputstack, false); - if (drainage > 0) { - tank.fill(this.outputstack, true); - this.drain(drainage, true); - } - } - })); + .forEach( + direction -> Optional + .ofNullable( + this.worldObj.getTileEntity( + this.xCoord + direction.offsetX, + this.yCoord + direction.offsetY, + this.zCoord + direction.offsetZ)) + .ifPresent(te -> { + if (te instanceof IFluidHandler tank) { + if (tank.canFill(direction.getOpposite(), this.outputstack.getFluid())) { + int drainage = tank.fill(direction.getOpposite(), this.outputstack, false); + if (drainage > 0) { + tank.fill(direction.getOpposite(), this.outputstack, true); + this.drain(drainage, true); + } + } + } else if (te instanceof IFluidTank tank) { + int drainage = tank.fill(this.outputstack, false); + if (drainage > 0) { + tank.fill(this.outputstack, true); + this.drain(drainage, true); + } + } + })); } private void causePollution() { - Optional.ofNullable(this.worldObj).ifPresent(e -> { - if (e.getTotalWorldTime() % 20 == 0) { - Optional.ofNullable(e.getChunkFromBlockCoords(this.xCoord, this.zCoord)) + Optional.ofNullable(this.worldObj) + .ifPresent(e -> { + if (e.getTotalWorldTime() % 20 == 0) { + Optional.ofNullable(e.getChunkFromBlockCoords(this.xCoord, this.zCoord)) .ifPresent(c -> GT_Pollution.addPollution(c, ConfigHandler.pollutionHeatedWaterPumpSecond)); - } - }); + } + }); } @Override @@ -197,8 +200,7 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public ItemStack decrStackSize(int slot, int ammount) { if (slot != BW_TileEntity_HeatedWaterPump.FUELSLOT || this.fuelstack == null - || ammount > this.fuelstack.stackSize) - return null; + || ammount > this.fuelstack.stackSize) return null; return this.fuelstack.splitStack(ammount); } @@ -279,14 +281,14 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr if (doDrain) { this.outputstack.amount -= actualdrain; FluidEvent.fireEvent( - new FluidEvent.FluidDrainingEvent( - this.outputstack, - this.getWorldObj(), - this.xCoord, - this.yCoord, - this.zCoord, - this, - actualdrain)); + new FluidEvent.FluidDrainingEvent( + this.outputstack, + this.getWorldObj(), + this.xCoord, + this.yCoord, + this.zCoord, + this, + actualdrain)); } return ret; } @@ -299,8 +301,7 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { if (resource != null && resource.getFluid() == BW_TileEntity_HeatedWaterPump.WATER - && this.drain(resource.amount, false) != null) - return this.drain(resource.amount, doDrain); + && this.drain(resource.amount, false) != null) return this.drain(resource.amount, doDrain); return null; } @@ -327,23 +328,23 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public String[] getInfoData() { return new String[] { - StatCollector.translateToLocal("tooltip.tile.waterpump.0.name") + " " - + GT_Utility.formatNumbers(ConfigHandler.mbWaterperSec) - + String.format( - StatCollector.translateToLocal("tooltip.tile.waterpump.1.name"), - ConfigHandler.pollutionHeatedWaterPumpSecond), - StatCollector.translateToLocal("tooltip.tile.waterpump.2.name") }; + StatCollector.translateToLocal("tooltip.tile.waterpump.0.name") + " " + + GT_Utility.formatNumbers(ConfigHandler.mbWaterperSec) + + String.format( + StatCollector.translateToLocal("tooltip.tile.waterpump.1.name"), + ConfigHandler.pollutionHeatedWaterPumpSecond), + StatCollector.translateToLocal("tooltip.tile.waterpump.2.name") }; } @Override public void registerBlockIcons(IIconRegister par1IconRegister) { ITileHasDifferentTextureSides.texture[ForgeDirection.UP.ordinal()] = par1IconRegister - .registerIcon(MainMod.MOD_ID + ":heatedWaterPumpTop"); + .registerIcon(MainMod.MOD_ID + ":heatedWaterPumpTop"); ITileHasDifferentTextureSides.texture[ForgeDirection.DOWN.ordinal()] = par1IconRegister - .registerIcon(MainMod.MOD_ID + ":heatedWaterPumpDown"); + .registerIcon(MainMod.MOD_ID + ":heatedWaterPumpDown"); for (int i = 2; i < 7; i++) { ITileHasDifferentTextureSides.texture[i] = par1IconRegister - .registerIcon(MainMod.MOD_ID + ":heatedWaterPumpSide"); + .registerIcon(MainMod.MOD_ID + ":heatedWaterPumpSide"); } } @@ -355,12 +356,18 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr final IItemHandlerModifiable invWrapper = new InvWrapper(this); builder.widget( - new SlotWidget(invWrapper, 0).setFilter(stack -> TileEntityFurnace.getItemBurnTime(stack) > 0) - .setPos(55, 52)) - .widget(SlotWidget.phantom(invWrapper, 1).disableInteraction().setPos(85, 32)).widget( - new ProgressBar().setProgress(() -> (float) this.fuel / this.maxfuel) - .setTexture(BW_UITextures.PROGRESSBAR_FUEL, 14).setDirection(ProgressBar.Direction.UP) - .setPos(56, 36).setSize(14, 14)); + new SlotWidget(invWrapper, 0).setFilter(stack -> TileEntityFurnace.getItemBurnTime(stack) > 0) + .setPos(55, 52)) + .widget( + SlotWidget.phantom(invWrapper, 1) + .disableInteraction() + .setPos(85, 32)) + .widget( + new ProgressBar().setProgress(() -> (float) this.fuel / this.maxfuel) + .setTexture(BW_UITextures.PROGRESSBAR_FUEL, 14) + .setDirection(ProgressBar.Direction.UP) + .setPos(56, 36) + .setSize(14, 14)); return builder.build(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java index d91b790596..0dc888c663 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java @@ -93,7 +93,10 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank for (FluidStack internaltank : this.INTERNALTANKS) { if (internaltank != null) { NBTTagCompound entry = new NBTTagCompound(); - entry.setString("FluidName", internaltank.getFluid().getName()); + entry.setString( + "FluidName", + internaltank.getFluid() + .getName()); entry.setInteger("Ammount", internaltank.amount); entry.setTag("FluidTag", internaltank.tag); lInternalTank.appendTag(entry); @@ -146,14 +149,14 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank if (doDrain) { outputstack.amount -= actualdrain; FluidEvent.fireEvent( - new FluidEvent.FluidDrainingEvent( - outputstack, - this.getWorldObj(), - this.xCoord, - this.yCoord, - this.zCoord, - this, - actualdrain)); + new FluidEvent.FluidDrainingEvent( + outputstack, + this.getWorldObj(), + this.xCoord, + this.yCoord, + this.zCoord, + this, + actualdrain)); } return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index fa2f7e9590..a7d8ea9db8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -116,28 +116,27 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa private static final int CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { { "ccccc", "ccccc", "ccccc", "ccccc", "ccccc" }, - { "ggggg", "gaaag", "gaaag", "gaaag", "ggggg" }, - { "ggggg", "gaaag", "gaaag", "gaaag", "ggggg" }, - { "cc~cc", "ccccc", "ccccc", "ccccc", "ccccc" }, })) - .addElement( - 'c', - ofChain( - ofHatchAdder(GT_TileEntity_BioVat::addMaintenanceToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_BioVat::addOutputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_BioVat::addInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_BioVat::addRadiationInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_BioVat::addEnergyInputToMachineList, CASING_INDEX, 1), - onElementPass(e -> e.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)))) - .addElement('a', ofChain(isAir(), ofBlockAnyMeta(FluidLoader.bioFluidBlock))) - .addElement( - 'g', - ofGlassTiered((byte) 1, (byte) 127, (byte) 0, (te, v) -> te.mGlassTier = v, te -> te.mGlassTier, 1)) - .build(); + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { "ccccc", "ccccc", "ccccc", "ccccc", "ccccc" }, + { "ggggg", "gaaag", "gaaag", "gaaag", "ggggg" }, { "ggggg", "gaaag", "gaaag", "gaaag", "ggggg" }, + { "cc~cc", "ccccc", "ccccc", "ccccc", "ccccc" }, })) + .addElement( + 'c', + ofChain( + ofHatchAdder(GT_TileEntity_BioVat::addMaintenanceToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addOutputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addRadiationInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addEnergyInputToMachineList, CASING_INDEX, 1), + onElementPass(e -> e.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement('a', ofChain(isAir(), ofBlockAnyMeta(FluidLoader.bioFluidBlock))) + .addElement( + 'g', + ofGlassTiered((byte) 1, (byte) 127, (byte) 0, (te, v) -> te.mGlassTier = v, te -> te.mGlassTier, 1)) + .build(); @Override public IStructureDefinition getStructureDefinition() { @@ -152,16 +151,24 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Bacterial Vat").addInfo("Controller block for the Bacterial Vat") - .addInfo("For maximum efficiency boost keep the Output Hatch always half filled!").addSeparator() - .beginStructureBlock(5, 4, 5, false).addController("Front bottom center") - .addCasingInfoMin("Clean Stainless Steel Casings", 19, false) - .addOtherStructurePart("Glass", "Hollow two middle layers", 2) - .addStructureInfo("The glass can be any glass, i.e. Tinkers Construct Clear Glass") - .addStructureInfo("Some Recipes need more advanced Glass Types").addMaintenanceHatch("Any casing", 1) - .addOtherStructurePart("Radio Hatch", "Any casing", 1).addInputBus("Any casing", 1) - .addOutputBus("Any casing", 1).addInputHatch("Any casing", 1).addOutputHatch("Any casing", 1) - .addEnergyHatch("Any casing", 1).toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + tt.addMachineType("Bacterial Vat") + .addInfo("Controller block for the Bacterial Vat") + .addInfo("For maximum efficiency boost keep the Output Hatch always half filled!") + .addSeparator() + .beginStructureBlock(5, 4, 5, false) + .addController("Front bottom center") + .addCasingInfoMin("Clean Stainless Steel Casings", 19, false) + .addOtherStructurePart("Glass", "Hollow two middle layers", 2) + .addStructureInfo("The glass can be any glass, i.e. Tinkers Construct Clear Glass") + .addStructureInfo("Some Recipes need more advanced Glass Types") + .addMaintenanceHatch("Any casing", 1) + .addOtherStructurePart("Radio Hatch", "Any casing", 1) + .addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1) + .addInputHatch("Any casing", 1) + .addOutputHatch("Any casing", 1) + .addEnergyHatch("Any casing", 1) + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -175,11 +182,15 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } private int getInputCapacity() { - return this.mInputHatches.stream().mapToInt(GT_MetaTileEntity_Hatch_Input::getCapacity).sum(); + return this.mInputHatches.stream() + .mapToInt(GT_MetaTileEntity_Hatch_Input::getCapacity) + .sum(); } private int getOutputCapacity() { - return this.mOutputHatches.stream().mapToInt(GT_MetaTileEntity_Hatch_Output::getCapacity).sum(); + return this.mOutputHatches.stream() + .mapToInt(GT_MetaTileEntity_Hatch_Output::getCapacity) + .sum(); } @Override @@ -236,9 +247,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa @Override protected CheckRecipeResult validateRecipe(@NotNull GT_Recipe recipe) { if (!BW_Util.areStacksEqualOrNull( - (ItemStack) recipe.mSpecialItems, - GT_TileEntity_BioVat.this.getControllerSlot())) - return CheckRecipeResultRegistry.NO_RECIPE; + (ItemStack) recipe.mSpecialItems, + GT_TileEntity_BioVat.this.getControllerSlot())) return CheckRecipeResultRegistry.NO_RECIPE; int[] conditions = GT_TileEntity_BioVat.specialValueUnpack(recipe.mSpecialValue); GT_TileEntity_BioVat.this.mNeededSievert = conditions[3]; @@ -294,7 +304,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa public FluidStack getStoredFluidOutputs() { // Only one output Hatch assert this.mOutputHatches.size() == 1; - return this.mOutputHatches.get(0).getFluid(); + return this.mOutputHatches.get(0) + .getFluid(); } private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity, int CasingIndex) { @@ -319,10 +330,10 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa if (!this.checkPiece(STRUCTURE_PIECE_MAIN, 2, 3, 0)) return false; return this.mCasing >= 19 && this.mRadHatches.size() <= 1 - && this.mOutputHatches.size() == 1 - && this.mMaintenanceHatches.size() == 1 - && this.mInputHatches.size() > 0 - && this.mEnergyHatches.size() > 0; + && this.mOutputHatches.size() == 1 + && this.mMaintenanceHatches.size() == 1 + && this.mInputHatches.size() > 0 + && this.mEnergyHatches.size() > 0; } @Override @@ -353,50 +364,81 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa int zDir = this.getZDir(); GT_TileEntity_BioVat.staticColorMap.remove( - new Coords( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId)); + new Coords( + xDir + x + + this.getBaseMetaTileEntity() + .getXCoord(), + y + this.getBaseMetaTileEntity() + .getYCoord(), + zDir + z + + this.getBaseMetaTileEntity() + .getZCoord(), + this.getBaseMetaTileEntity() + .getWorld().provider.dimensionId)); GT_TileEntity_BioVat.staticColorMap.put( - new Coords( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId), - lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB()); + new Coords( + xDir + x + + this.getBaseMetaTileEntity() + .getXCoord(), + y + this.getBaseMetaTileEntity() + .getYCoord(), + zDir + z + + this.getBaseMetaTileEntity() + .getZCoord(), + this.getBaseMetaTileEntity() + .getWorld().provider.dimensionId), + lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB()); if (SideReference.Side.Server) { MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( - this.getBaseMetaTileEntity().getWorld(), - new RendererPacket( - new Coords( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId), - lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB(), - true), - this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getZCoord()); + this.getBaseMetaTileEntity() + .getWorld(), + new RendererPacket( + new Coords( + xDir + x + + this.getBaseMetaTileEntity() + .getXCoord(), + y + this.getBaseMetaTileEntity() + .getYCoord(), + zDir + z + + this.getBaseMetaTileEntity() + .getZCoord(), + this.getBaseMetaTileEntity() + .getWorld().provider.dimensionId), + lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB(), + true), + this.getBaseMetaTileEntity() + .getXCoord(), + this.getBaseMetaTileEntity() + .getZCoord()); MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( - this.getBaseMetaTileEntity().getWorld(), - new RendererPacket( - new Coords( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId), - lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB(), - false), - this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getZCoord()); + this.getBaseMetaTileEntity() + .getWorld(), + new RendererPacket( + new Coords( + xDir + x + + this.getBaseMetaTileEntity() + .getXCoord(), + y + this.getBaseMetaTileEntity() + .getYCoord(), + zDir + z + + this.getBaseMetaTileEntity() + .getZCoord(), + this.getBaseMetaTileEntity() + .getWorld().provider.dimensionId), + lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB(), + false), + this.getBaseMetaTileEntity() + .getXCoord(), + this.getBaseMetaTileEntity() + .getZCoord()); } this.needsVisualUpdate = true; } private void check_Chunk() { - World aWorld = this.getBaseMetaTileEntity().getWorld(); + World aWorld = this.getBaseMetaTileEntity() + .getWorld(); if (!aWorld.isRemote) { for (Object tObject : aWorld.playerEntities) { @@ -404,10 +446,13 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa break; } Chunk tChunk = aWorld.getChunkFromBlockCoords( - this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getZCoord()); - if (tPlayer.getServerForPlayer().getPlayerManager() - .isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { + this.getBaseMetaTileEntity() + .getXCoord(), + this.getBaseMetaTileEntity() + .getZCoord()); + if (tPlayer.getServerForPlayer() + .getPlayerManager() + .isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { if (!this.playerMPHashSet.contains(tPlayer)) { this.playerMPHashSet.add(tPlayer); this.sendAllRequiredRendererPackets(); @@ -427,16 +472,29 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa if (this.mFluid != null && this.height > 1 && this.reCalculateFluidAmmount() > 0) for (int x = -1; x < 2; x++) { for (int y = 0; y < this.height; y++) { for (int z = -1; z < 2; z++) { - if (this.getBaseMetaTileEntity().getWorld() - .getBlock( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord()) - .equals(Blocks.air)) - this.getBaseMetaTileEntity().getWorld().setBlock( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord(), + if (this.getBaseMetaTileEntity() + .getWorld() + .getBlock( + xDir + x + + this.getBaseMetaTileEntity() + .getXCoord(), + y + this.getBaseMetaTileEntity() + .getYCoord(), + zDir + z + + this.getBaseMetaTileEntity() + .getZCoord()) + .equals(Blocks.air)) + this.getBaseMetaTileEntity() + .getWorld() + .setBlock( + xDir + x + + this.getBaseMetaTileEntity() + .getXCoord(), + y + this.getBaseMetaTileEntity() + .getYCoord(), + zDir + z + + this.getBaseMetaTileEntity() + .getZCoord(), FluidLoader.bioFluidBlock); } } @@ -449,73 +507,107 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa for (int x = -1; x < 2; x++) { for (int y = 1; y < 3; y++) { for (int z = -1; z < 2; z++) { - if (this.getBaseMetaTileEntity().getWorld() - .getBlock( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord()) - .equals(FluidLoader.bioFluidBlock)) - this.getBaseMetaTileEntity().getWorld().setBlockToAir( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord()); + if (this.getBaseMetaTileEntity() + .getWorld() + .getBlock( + xDir + x + + this.getBaseMetaTileEntity() + .getXCoord(), + y + this.getBaseMetaTileEntity() + .getYCoord(), + zDir + z + + this.getBaseMetaTileEntity() + .getZCoord()) + .equals(FluidLoader.bioFluidBlock)) + this.getBaseMetaTileEntity() + .getWorld() + .setBlockToAir( + xDir + x + + this.getBaseMetaTileEntity() + .getXCoord(), + y + this.getBaseMetaTileEntity() + .getYCoord(), + zDir + z + + this.getBaseMetaTileEntity() + .getZCoord()); GT_TileEntity_BioVat.staticColorMap.remove( - new Coords( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord()), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId); + new Coords( + xDir + x + + this.getBaseMetaTileEntity() + .getXCoord(), + y + this.getBaseMetaTileEntity() + .getYCoord(), + zDir + z + + this.getBaseMetaTileEntity() + .getZCoord()), + this.getBaseMetaTileEntity() + .getWorld().provider.dimensionId); } } } } private int reCalculateFluidAmmount() { - return this.getStoredFluids().stream().mapToInt(fluidStack -> fluidStack.amount).sum(); + return this.getStoredFluids() + .stream() + .mapToInt(fluidStack -> fluidStack.amount) + .sum(); } private int reCalculateHeight() { return this.reCalculateFluidAmmount() > this.getCapacity() / 4 - 1 - ? this.reCalculateFluidAmmount() >= this.getCapacity() / 2 ? 3 : 2 - : 1; + ? this.reCalculateFluidAmmount() >= this.getCapacity() / 2 ? 3 : 2 + : 1; } public void doAllVisualThings() { - if (this.getBaseMetaTileEntity().isServerSide()) { + if (this.getBaseMetaTileEntity() + .isServerSide()) { if (this.mMachine) { ItemStack aStack = this.mInventory[1]; BioCulture lCulture = null; int xDir = this.getXDir(); int zDir = this.getZDir(); - if (this.getBaseMetaTileEntity().getTimer() % 200 == 0) { + if (this.getBaseMetaTileEntity() + .getTimer() % 200 == 0) { this.check_Chunk(); } - if (this.needsVisualUpdate - && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 0) { - for (int x = -1; x < 2; x++) for (int y = 1; y < 3; y++) - for (int z = -1; z < 2; z++) this.getBaseMetaTileEntity().getWorld().setBlockToAir( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord()); + if (this.needsVisualUpdate && this.getBaseMetaTileEntity() + .getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 0) { + for (int x = -1; x < 2; x++) + for (int y = 1; y < 3; y++) for (int z = -1; z < 2; z++) this.getBaseMetaTileEntity() + .getWorld() + .setBlockToAir( + xDir + x + + this.getBaseMetaTileEntity() + .getXCoord(), + y + this.getBaseMetaTileEntity() + .getYCoord(), + zDir + z + + this.getBaseMetaTileEntity() + .getZCoord()); } this.height = this.reCalculateHeight(); if (this.mFluid != null && this.height > 1 && this.reCalculateFluidAmmount() > 0) { - if (!BW_Util.areStacksEqualOrNull(aStack, this.mStack) || this.needsVisualUpdate - && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1) { + if (!BW_Util.areStacksEqualOrNull(aStack, this.mStack) + || this.needsVisualUpdate && this.getBaseMetaTileEntity() + .getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1) { for (int x = -1; x < 2; x++) { for (int y = 1; y < this.height; y++) { for (int z = -1; z < 2; z++) { if (aStack == null - || aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0) { + || aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0) { if (this.mCulture == null || aStack == null - || aStack.getTagCompound() == null - || this.mCulture.getID() != aStack.getTagCompound().getInteger("ID")) { + || aStack.getTagCompound() == null + || this.mCulture.getID() != aStack.getTagCompound() + .getInteger("ID")) { lCulture = aStack == null || aStack.getTagCompound() == null ? null - : BioCulture - .getBioCulture(aStack.getTagCompound().getString("Name")); + : BioCulture.getBioCulture( + aStack.getTagCompound() + .getString("Name")); this.sendPackagesOrRenewRenderer(x, y, z, lCulture); } } @@ -525,9 +617,10 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa this.mStack = aStack; this.mCulture = lCulture; } - if (this.needsVisualUpdate - && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1) { - if (this.getBaseMetaTileEntity().isClientSide()) new Throwable().printStackTrace(); + if (this.needsVisualUpdate && this.getBaseMetaTileEntity() + .getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1) { + if (this.getBaseMetaTileEntity() + .isClientSide()) new Throwable().printStackTrace(); this.placeFluid(); this.needsVisualUpdate = false; } @@ -543,10 +636,12 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa super.onPostTick(aBaseMetaTileEntity, aTick); if (this.height != this.reCalculateHeight()) this.needsVisualUpdate = true; this.doAllVisualThings(); - if (this.getBaseMetaTileEntity().isServerSide() && this.mRadHatches.size() == 1) { - this.mSievert = this.mRadHatches.get(0).getSievert(); - if (this.getBaseMetaTileEntity().isActive() && this.mNeededSievert > this.mSievert) - this.mOutputFluids = null; + if (this.getBaseMetaTileEntity() + .isServerSide() && this.mRadHatches.size() == 1) { + this.mSievert = this.mRadHatches.get(0) + .getSievert(); + if (this.getBaseMetaTileEntity() + .isActive() && this.mNeededSievert > this.mSievert) this.mOutputFluids = null; } if (aBaseMetaTileEntity.isServerSide() && this.mMaxProgresstime <= 0) { this.mTimes = 0; @@ -557,10 +652,11 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa @Override public void saveNBTData(NBTTagCompound aNBT) { aNBT.setInteger("mFluidHeight", this.height); - if (this.mCulture != null && !this.mCulture.getName().isEmpty()) - aNBT.setString("mCulture", this.mCulture.getName()); - else if ((this.mCulture == null || this.mCulture.getName().isEmpty()) - && !aNBT.getString("mCulture").isEmpty()) { + if (this.mCulture != null && !this.mCulture.getName() + .isEmpty()) aNBT.setString("mCulture", this.mCulture.getName()); + else if ((this.mCulture == null || this.mCulture.getName() + .isEmpty()) && !aNBT.getString("mCulture") + .isEmpty()) { aNBT.removeTag("mCulture"); } if (this.mFluid != null) aNBT.setString("mFluid", this.mFluid.getName()); @@ -577,19 +673,23 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa int zDir = this.getZDir(); this.removeFluid(xDir, zDir); this.sendRenderPackets(xDir, zDir); - } else if (this.getBaseMetaTileEntity().getWorld().getWorldTime() % 20 == 7) { - this.sendRenderPackets(); - } + } else if (this.getBaseMetaTileEntity() + .getWorld() + .getWorldTime() % 20 == 7) { + this.sendRenderPackets(); + } super.onRemoval(); } private int getXDir() { - return this.getBaseMetaTileEntity().getBackFacing().offsetX * 2; + return this.getBaseMetaTileEntity() + .getBackFacing().offsetX * 2; } private int getZDir() { - return this.getBaseMetaTileEntity().getBackFacing().offsetZ * 2; + return this.getBaseMetaTileEntity() + .getBackFacing().offsetZ * 2; } private void sendRenderPackets() { @@ -604,18 +704,27 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa for (int y = 1; y < 3; y++) { for (int z = -1; z < 2; z++) { MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( - this.getBaseMetaTileEntity().getWorld(), - new RendererPacket( - new Coords( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), - y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId), - this.mCulture == null ? BioCulture.NULLCULTURE.getColorRGB() - : this.mCulture.getColorRGB(), - true), - this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getZCoord()); + this.getBaseMetaTileEntity() + .getWorld(), + new RendererPacket( + new Coords( + xDir + x + + this.getBaseMetaTileEntity() + .getXCoord(), + y + this.getBaseMetaTileEntity() + .getYCoord(), + zDir + z + + this.getBaseMetaTileEntity() + .getZCoord(), + this.getBaseMetaTileEntity() + .getWorld().provider.dimensionId), + this.mCulture == null ? BioCulture.NULLCULTURE.getColorRGB() + : this.mCulture.getColorRGB(), + true), + this.getBaseMetaTileEntity() + .getXCoord(), + this.getBaseMetaTileEntity() + .getZCoord()); } } } @@ -626,7 +735,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa public void loadNBTData(NBTTagCompound aNBT) { this.height = aNBT.getInteger("mFluidHeight"); this.mCulture = BioCulture.getBioCulture(aNBT.getString("mCulture")); - if (!aNBT.getString("mFluid").isEmpty()) this.mFluid = FluidRegistry.getFluid(aNBT.getString("mFluid")); + if (!aNBT.getString("mFluid") + .isEmpty()) this.mFluid = FluidRegistry.getFluid(aNBT.getString("mFluid")); this.mSievert = aNBT.getInteger("mSievert"); this.mNeededSievert = aNBT.getInteger("mNeededSievert"); super.loadNBTData(aNBT); @@ -645,16 +755,27 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { + int aColorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow() - .build() }; - return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) }; } @@ -672,18 +793,18 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa // See https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/11923 // here we must check the machine is well-formed as otherwise getExpectedMultiplier might error out! infoData[infoData.length - 2] = StatCollector.translateToLocal("BW.infoData.BioVat.expectedProduction") + ": " - + EnumChatFormatting.GREEN - + (this.mMachine - ? (this.mMaxProgresstime <= 0 ? this.getExpectedMultiplier(null, false) - : this.mExpectedMultiplier) * 100 - : -1) - + EnumChatFormatting.RESET - + " %"; + + EnumChatFormatting.GREEN + + (this.mMachine + ? (this.mMaxProgresstime <= 0 ? this.getExpectedMultiplier(null, false) : this.mExpectedMultiplier) + * 100 + : -1) + + EnumChatFormatting.RESET + + " %"; infoData[infoData.length - 1] = StatCollector.translateToLocal("BW.infoData.BioVat.production") + ": " - + EnumChatFormatting.GREEN - + (this.mMaxProgresstime <= 0 ? 0 : this.mTimes) * 100 - + EnumChatFormatting.RESET - + " %"; + + EnumChatFormatting.GREEN + + (this.mMaxProgresstime <= 0 ? 0 : this.mTimes) * 100 + + EnumChatFormatting.RESET + + " %"; return infoData; } @@ -699,7 +820,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { batchMode = !batchMode; if (batchMode) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 199710cbeb..1f85ea0167 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -90,7 +90,7 @@ import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; public class GT_TileEntity_CircuitAssemblyLine extends - GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable { + GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable { private static final int CASING_INDEX = 16; @@ -110,37 +110,44 @@ public class GT_TileEntity_CircuitAssemblyLine extends private ItemStack imprintedStack; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() - .addShape( - STRUCTURE_PIECE_FIRST, - transpose(new String[][] { { "~", "G", "G" }, { "g", "l", "g" }, { "b", "i", "b" }, })) - .addShape( - STRUCTURE_PIECE_NEXT, - transpose(new String[][] { { "G", "G", "G" }, { "g", "l", "g" }, { "b", "I", "b" }, })) - .addShape( - STRUCTURE_PIECE_NEXT_HINT, - transpose(new String[][] { { "G", "G", "G" }, { "g", "l", "g" }, { "b", "i", "b" }, })) - .addShape( - STRUCTURE_PIECE_LAST, - transpose(new String[][] { { "G", "G", "G" }, { "g", "l", "g" }, { "b", "o", "b" }, })) - .addElement( - 'G', - buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class).atLeast(Energy).casingIndex(CASING_INDEX) - .dot(1).buildAndChain(GregTech_API.sBlockCasings3, 10)) - .addElement('g', ofGlassTieredMixed((byte) 4, (byte) 127, 5)) - .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 5)) // assembling line casings - .addElement( - 'b', - buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class).atLeast(InputHatch, Maintenance) - .casingIndex(CASING_INDEX).dot(2).disallowOnly(ForgeDirection.EAST, ForgeDirection.WEST) - .buildAndChain(GregTech_API.sBlockCasings2, 0)) - .addElement('i', InputBus.newAny(CASING_INDEX, 3, ForgeDirection.DOWN)) - .addElement( - 'I', - buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class).atLeast(InputHatch, InputBus, OutputBus) - .casingIndex(CASING_INDEX).dot(2).disallowOnly(ForgeDirection.EAST, ForgeDirection.WEST) - .buildAndChain(GregTech_API.sBlockCasings2, 0)) - .addElement('o', OutputBus.newAny(CASING_INDEX, 2, ForgeDirection.DOWN)).build(); + .builder() + .addShape( + STRUCTURE_PIECE_FIRST, + transpose(new String[][] { { "~", "G", "G" }, { "g", "l", "g" }, { "b", "i", "b" }, })) + .addShape( + STRUCTURE_PIECE_NEXT, + transpose(new String[][] { { "G", "G", "G" }, { "g", "l", "g" }, { "b", "I", "b" }, })) + .addShape( + STRUCTURE_PIECE_NEXT_HINT, + transpose(new String[][] { { "G", "G", "G" }, { "g", "l", "g" }, { "b", "i", "b" }, })) + .addShape( + STRUCTURE_PIECE_LAST, + transpose(new String[][] { { "G", "G", "G" }, { "g", "l", "g" }, { "b", "o", "b" }, })) + .addElement( + 'G', + buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class).atLeast(Energy) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings3, 10)) + .addElement('g', ofGlassTieredMixed((byte) 4, (byte) 127, 5)) + .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 5)) // assembling line casings + .addElement( + 'b', + buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class).atLeast(InputHatch, Maintenance) + .casingIndex(CASING_INDEX) + .dot(2) + .disallowOnly(ForgeDirection.EAST, ForgeDirection.WEST) + .buildAndChain(GregTech_API.sBlockCasings2, 0)) + .addElement('i', InputBus.newAny(CASING_INDEX, 3, ForgeDirection.DOWN)) + .addElement( + 'I', + buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class).atLeast(InputHatch, InputBus, OutputBus) + .casingIndex(CASING_INDEX) + .dot(2) + .disallowOnly(ForgeDirection.EAST, ForgeDirection.WEST) + .buildAndChain(GregTech_API.sBlockCasings2, 0)) + .addElement('o', OutputBus.newAny(CASING_INDEX, 2, ForgeDirection.DOWN)) + .build(); @Override public IStructureDefinition getStructureDefinition() { @@ -151,45 +158,49 @@ public class GT_TileEntity_CircuitAssemblyLine extends protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Circuit Assembler/Circuit Assembly Line") - .addInfo("Controller block for the Circuit Assembly Line").addInfo("Change Mode with Screwdriver") - .addInfo("Does not lose efficiency when overclocked") - .addInfo( - "---------" + EnumChatFormatting.WHITE - + StatCollector.translateToLocal("chat.cal.mode.0") - + EnumChatFormatting.GRAY - + "--------") - .addInfo("Imprint this machine with a Circuit Imprint,") - .addInfo("by putting the imprint in the controller") - .addInfo("Every Circuit Assembly Line can only be imprinted ONCE") - .addInfo( - "---------" + EnumChatFormatting.WHITE - + StatCollector.translateToLocal("chat.cal.mode.1") - + EnumChatFormatting.GRAY - + "--------") - .addInfo( - "Does Circuit Assembler recipes, Minimum Length: " + EnumChatFormatting.RED - + MINIMUM_CIRCUIT_ASSEMBLER_LENGTH - + EnumChatFormatting.GRAY) - .addInfo("Recipe tier in Circuit Assembler mode is at most Energy Hatch tier - 1.") - .addInfo("This mode supports Crafting Input Buffer/Bus and allows bus separation").addInfo("") - .addSeparator().addInfo(BW_Tooltip_Reference.TT_BLUEPRINT) - .beginVariableStructureBlock(2, 7, 3, 3, 3, 3, false) - .addStructureInfo("From Bottom to Top, Left to Right") - .addStructureInfo( - "Layer 1 - Solid Steel Machine Casing, Input bus (Last Output bus), Solid Steel Machine Casing") - .addStructureInfo("Layer 2 - EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass") - .addStructureInfo("Layer 3 - Grate Machine Casing") - .addStructureInfo("Up to 7 repeating slices, last is Output Bus") - .addController("Layer 3 first slice front") - .addOtherStructurePart( - "1x " + StatCollector.translateToLocal("GT5U.MBTT.EnergyHatch"), - "Any layer 3 casing", - 1) - .addInputHatch("Any layer 1 casing", 2).addInputBus("As specified on layer 1", 3, 4) - .addOutputBus("As specified in final slice on layer 1", 4) - .addOtherStructurePart("EV+ Tier Glass", "As specified on layer 2", 5) - .addMaintenanceHatch("Any layer 1 casing", 2) - .toolTipFinisher(ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); + .addInfo("Controller block for the Circuit Assembly Line") + .addInfo("Change Mode with Screwdriver") + .addInfo("Does not lose efficiency when overclocked") + .addInfo( + "---------" + EnumChatFormatting.WHITE + + StatCollector.translateToLocal("chat.cal.mode.0") + + EnumChatFormatting.GRAY + + "--------") + .addInfo("Imprint this machine with a Circuit Imprint,") + .addInfo("by putting the imprint in the controller") + .addInfo("Every Circuit Assembly Line can only be imprinted ONCE") + .addInfo( + "---------" + EnumChatFormatting.WHITE + + StatCollector.translateToLocal("chat.cal.mode.1") + + EnumChatFormatting.GRAY + + "--------") + .addInfo( + "Does Circuit Assembler recipes, Minimum Length: " + EnumChatFormatting.RED + + MINIMUM_CIRCUIT_ASSEMBLER_LENGTH + + EnumChatFormatting.GRAY) + .addInfo("Recipe tier in Circuit Assembler mode is at most Energy Hatch tier - 1.") + .addInfo("This mode supports Crafting Input Buffer/Bus and allows bus separation") + .addInfo("") + .addSeparator() + .addInfo(BW_Tooltip_Reference.TT_BLUEPRINT) + .beginVariableStructureBlock(2, 7, 3, 3, 3, 3, false) + .addStructureInfo("From Bottom to Top, Left to Right") + .addStructureInfo( + "Layer 1 - Solid Steel Machine Casing, Input bus (Last Output bus), Solid Steel Machine Casing") + .addStructureInfo("Layer 2 - EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass") + .addStructureInfo("Layer 3 - Grate Machine Casing") + .addStructureInfo("Up to 7 repeating slices, last is Output Bus") + .addController("Layer 3 first slice front") + .addOtherStructurePart( + "1x " + StatCollector.translateToLocal("GT5U.MBTT.EnergyHatch"), + "Any layer 3 casing", + 1) + .addInputHatch("Any layer 1 casing", 2) + .addInputBus("As specified on layer 1", 3, 4) + .addOutputBus("As specified in final slice on layer 1", 4) + .addOtherStructurePart("EV+ Tier Glass", "As specified on layer 2", 5) + .addMaintenanceHatch("Any layer 1 casing", 2) + .toolTipFinisher(ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); return tt; } @@ -197,7 +208,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends if (this.type.equals(new NBTTagCompound())) return ""; return GT_LanguageManager.getTranslation( - GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); + GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); } private NBTTagCompound type = new NBTTagCompound(); @@ -214,11 +225,12 @@ public class GT_TileEntity_CircuitAssemblyLine extends if (!this.type.equals(new NBTTagCompound())) return true; if (!GT_Utility.isStackValid(itemStack)) return false; if (itemStack.getItem() instanceof BW_Meta_Items.BW_GT_MetaGenCircuits && itemStack.getItemDamage() == 0 - && itemStack.getTagCompound() != null - && this.type.equals(new NBTTagCompound())) { + && itemStack.getTagCompound() != null + && this.type.equals(new NBTTagCompound())) { this.type = itemStack.getTagCompound(); this.mInventory[1] = null; - this.getBaseMetaTileEntity().issueBlockUpdate(); + this.getBaseMetaTileEntity() + .issueBlockUpdate(); return true; } return false; @@ -241,7 +253,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends public void loadNBTData(NBTTagCompound aNBT) { this.type = aNBT.getCompoundTag(IMPRINT_KEY); this.imprintedItemName = this.type == null ? "" - : GT_LanguageManager.getTranslateableItemStackName(ItemStack.loadItemStackFromNBT(this.type)); + : GT_LanguageManager.getTranslateableItemStackName(ItemStack.loadItemStackFromNBT(this.type)); mode = aNBT.getInteger(RUNNING_MODE_KEY); length = aNBT.getInteger(LENGTH_KEY); super.loadNBTData(aNBT); @@ -293,7 +305,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends protected CheckRecipeResult validateRecipe(@Nonnull GT_Recipe recipe) { // limit CA mode recipes to hatch tier - 1 if (GT_TileEntity_CircuitAssemblyLine.this.mode == 1 - && recipe.mEUt > GT_TileEntity_CircuitAssemblyLine.this.getMaxInputVoltage() / 4) { + && recipe.mEUt > GT_TileEntity_CircuitAssemblyLine.this.getMaxInputVoltage() / 4) { return CheckRecipeResultRegistry.NO_RECIPE; } return CheckRecipeResultRegistry.SUCCESSFUL; @@ -336,9 +348,13 @@ public class GT_TileEntity_CircuitAssemblyLine extends ArrayList rList = new ArrayList<>(); for (GT_MetaTileEntity_Hatch_InputBus tHatch : filterValidMTEs(mInputBusses)) { tHatch.mRecipeMap = this.getRecipeMap(); - for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) { - if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null) { - rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i)); + for (int i = 0; i < tHatch.getBaseMetaTileEntity() + .getSizeInventory(); i++) { + if (tHatch.getBaseMetaTileEntity() + .getStackInSlot(i) != null) { + rList.add( + tHatch.getBaseMetaTileEntity() + .getStackInSlot(i)); break; } } @@ -418,22 +434,34 @@ public class GT_TileEntity_CircuitAssemblyLine extends this.infoDataBuffer = new String[oldInfo.length + 1]; System.arraycopy(oldInfo, 0, this.infoDataBuffer, 0, oldInfo.length); this.infoDataBuffer[oldInfo.length] = StatCollector.translateToLocal("tooltip.cal.imprintedWith") + " " - + EnumChatFormatting.YELLOW - + this.getTypeForDisplay(); + + EnumChatFormatting.YELLOW + + this.getTypeForDisplay(); return this.infoDataBuffer; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { + int aColorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW).extFacing().glow() - .build() }; - return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW).extFacing().glow().build() }; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) }; } @@ -481,57 +509,58 @@ public class GT_TileEntity_CircuitAssemblyLine extends for (int i = 1; i < tLength - 1; ++i) { built = survivialBuildPiece( - STRUCTURE_PIECE_NEXT_HINT, - stackSize, - -i, - 0, - 0, - elementBudget, - env, - false, - true); - if (built >= 0) return built; - } - return survivialBuildPiece( - STRUCTURE_PIECE_LAST, + STRUCTURE_PIECE_NEXT_HINT, stackSize, - -(tLength - 1), + -i, 0, 0, elementBudget, env, false, true); + if (built >= 0) return built; + } + return survivialBuildPiece( + STRUCTURE_PIECE_LAST, + stackSize, + -(tLength - 1), + 0, + 0, + elementBudget, + env, + false, + true); } @Override public void addAdditionalTooltipInformation(ItemStack stack, List tooltip) { if (stack.hasTagCompound() && stack.stackTagCompound.hasKey(IMPRINT_KEY)) { tooltip.add( - StatCollector.translateToLocal("tooltip.cal.imprintedWith") + " " - + EnumChatFormatting.YELLOW - + StatCollector.translateToLocal( - GT_LanguageManager.getTranslateableItemStackName( - ItemStack.loadItemStackFromNBT( - stack.stackTagCompound.getCompoundTag("Type"))))); + StatCollector.translateToLocal("tooltip.cal.imprintedWith") + " " + + EnumChatFormatting.YELLOW + + StatCollector.translateToLocal( + GT_LanguageManager.getTranslateableItemStackName( + ItemStack.loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("Type"))))); } } @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { super.addUIWidgets(builder, buildContext); + builder + .widget(new FakeSyncWidget.StringSyncer(() -> this.imprintedItemName, val -> this.imprintedItemName = val)); builder.widget( - new FakeSyncWidget.StringSyncer(() -> this.imprintedItemName, val -> this.imprintedItemName = val)); - builder.widget( - new CycleButtonWidget().setToggle(() -> mode == 1, val -> mode = val ? 1 : 0) - .setTextureGetter( - state -> state == 1 ? BW_UITextures.OVERLAY_BUTTON_ASSEMBLER_MODE - : BW_UITextures.OVERLAY_BUTTON_LINE_MODE) - .setBackground(GT_UITextures.BUTTON_STANDARD).setPos(80, 91).setSize(16, 16) - .dynamicTooltip( - () -> Collections - .singletonList(StatCollector.translateToLocal("chat.cal.mode." + mode))) - .setUpdateTooltipEveryTick(true).setTooltipShowUpDelay(TOOLTIP_DELAY)); + new CycleButtonWidget().setToggle(() -> mode == 1, val -> mode = val ? 1 : 0) + .setTextureGetter( + state -> state == 1 ? BW_UITextures.OVERLAY_BUTTON_ASSEMBLER_MODE + : BW_UITextures.OVERLAY_BUTTON_LINE_MODE) + .setBackground(GT_UITextures.BUTTON_STANDARD) + .setPos(80, 91) + .setSize(16, 16) + .dynamicTooltip( + () -> Collections.singletonList(StatCollector.translateToLocal("chat.cal.mode." + mode))) + .setUpdateTooltipEveryTick(true) + .setTooltipShowUpDelay(TOOLTIP_DELAY)); } @Override @@ -546,13 +575,13 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ) { if (!aPlayer.isSneaking()) { if (mode == 0) return false; inputSeparation = !inputSeparation; GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); + aPlayer, + StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); return true; } else { batchMode = !batchMode; @@ -582,22 +611,22 @@ public class GT_TileEntity_CircuitAssemblyLine extends @Override public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { super.getWailaBody(itemStack, currenttip, accessor, config); NBTTagCompound tag = accessor.getNBTData(); currenttip.add( - EnumChatFormatting.GREEN - + StatCollector.translateToLocal("chat.cal.mode." + tag.getInteger(RUNNING_MODE_KEY))); + EnumChatFormatting.GREEN + + StatCollector.translateToLocal("chat.cal.mode." + tag.getInteger(RUNNING_MODE_KEY))); if (tag.hasKey("ImprintedWith") && tag.getInteger(RUNNING_MODE_KEY) == 0) currenttip.add( - StatCollector.translateToLocal("tooltip.cal.imprintedWith") + " " - + EnumChatFormatting.YELLOW - + tag.getString("ImprintedWith")); + StatCollector.translateToLocal("tooltip.cal.imprintedWith") + " " + + EnumChatFormatting.YELLOW + + tag.getString("ImprintedWith")); } @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); String imprintedWith = this.getTypeForDisplay(); if (!imprintedWith.isEmpty()) tag.setString("ImprintedWith", imprintedWith); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index c125d4150e..f394089fb0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -66,7 +66,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { f.setAccessible(true); GT_TileEntity_DEHP.nulearHeatMod = f.getFloat(f); } catch (SecurityException | IllegalArgumentException | ExceptionInInitializerError | NullPointerException - | IllegalAccessException | NoSuchFieldException e) { + | IllegalAccessException | NoSuchFieldException e) { e.printStackTrace(); } super.onConfigLoad(aConfig); @@ -94,34 +94,43 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - String casings = this.getCasingBlockItem().get(0).getDisplayName(); - tt.addMachineType("Geothermal Heat Pump").addInfo("Consumes " + GT_Values.V[this.mTier + 2] + "EU/t") - .addInfo("Has 4 Modes, use the Screwdriver to change them:"); + String casings = this.getCasingBlockItem() + .get(0) + .getDisplayName(); + tt.addMachineType("Geothermal Heat Pump") + .addInfo("Consumes " + GT_Values.V[this.mTier + 2] + "EU/t") + .addInfo("Has 4 Modes, use the Screwdriver to change them:"); if (ConfigHandler.DEHPDirectSteam) { tt.addInfo("0 Idle, 1 Steam, 2 Superheated Steam (requires Distilled Water), 3 Retract") - .addInfo("Explodes when it runs out of Water/Distilled Water") - .addInfo( - "Converts " + (long) (this.mTier * 1200 * 20) - + "L/s Water(minus 10% per Maintenance Problem) to Steam") - .addInfo( - "Converts " + (long) (this.mTier * 600 * 20) - + "L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"); + .addInfo("Explodes when it runs out of Water/Distilled Water") + .addInfo( + "Converts " + (long) (this.mTier * 1200 * 20) + + "L/s Water(minus 10% per Maintenance Problem) to Steam") + .addInfo( + "Converts " + (long) (this.mTier * 600 * 20) + + "L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"); } else { tt.addInfo("0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract") - .addInfo("Explodes when it runs out of Coolant").addInfo( - "Heats up " + (long) (this.mTier * 24 * (double) GT_TileEntity_DEHP.nulearHeatMod) * 20 - + "L/s Coolant(minus 10% per Maintenance Problem)"); + .addInfo("Explodes when it runs out of Coolant") + .addInfo( + "Heats up " + (long) (this.mTier * 24 * (double) GT_TileEntity_DEHP.nulearHeatMod) * 20 + + "L/s Coolant(minus 10% per Maintenance Problem)"); } - tt.addSeparator().beginStructureBlock(3, 7, 3, false).addController("Front bottom") - .addOtherStructurePart(casings, "form the 3x1x3 Base") - .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") - .addOtherStructurePart( - this.getFrameMaterial().mName + " Frame Boxes", - "Each pillar's side and 1x3x1 on top") - .addEnergyHatch(VN[this.getMinTier()] + "+, Any base casing").addMaintenanceHatch("Any base casing") - .addInputBus("Mining Pipes, optional, any base casing").addInputHatch("Any base casing") - .addOutputHatch("Any base casing").toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); + tt.addSeparator() + .beginStructureBlock(3, 7, 3, false) + .addController("Front bottom") + .addOtherStructurePart(casings, "form the 3x1x3 Base") + .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") + .addOtherStructurePart( + this.getFrameMaterial().mName + " Frame Boxes", + "Each pillar's side and 1x3x1 on top") + .addEnergyHatch(VN[this.getMinTier()] + "+, Any base casing") + .addMaintenanceHatch("Any base casing") + .addInputBus("Mining Pipes, optional, any base casing") + .addInputHatch("Any base casing") + .addOutputHatch("Any base casing") + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); return tt; } @@ -153,18 +162,26 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { private long getFluidFromHatches(Fluid f) { long ret = 0; for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { - if (ih.getFluid().getFluid().equals(f)) ret += ih.getFluidAmount(); + if (ih.getFluid() + .getFluid() + .equals(f)) ret += ih.getFluidAmount(); } return ret; } private long getWaterFromHatches(boolean onlyDistilled) { Fluid toConsume1 = FluidRegistry.WATER; - Fluid toConsume2 = GT_ModHandler.getDistilledWater(1L).getFluid(); + Fluid toConsume2 = GT_ModHandler.getDistilledWater(1L) + .getFluid(); if (onlyDistilled) toConsume1 = toConsume2; long ret = 0; for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { - if (ih.getFluid().getFluid().equals(toConsume1) || ih.getFluid().getFluid().equals(toConsume2)) + if (ih.getFluid() + .getFluid() + .equals(toConsume1) + || ih.getFluid() + .getFluid() + .equals(toConsume2)) ret += ih.getFluidAmount(); } return ret; @@ -172,11 +189,12 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, - int yHead, int oldYHead) { + int yHead, int oldYHead) { if (this.mMode != 3) { this.isPickingPipes = false; try { - Field workState = this.getClass().getField("workState"); + Field workState = this.getClass() + .getField("workState"); workState.setInt(this, 0); } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException ignored) {} return true; @@ -186,7 +204,8 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (this.getBaseMetaTileEntity().getWorld().isRemote) return; + if (this.getBaseMetaTileEntity() + .getWorld().isRemote) return; ++this.mMode; if (this.mMode >= 4) this.mMode = 0; GT_Utility.sendChatToPlayer(aPlayer, "Mode: " + this.mMode); @@ -195,11 +214,13 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, - int yHead, int oldYHead) { + int yHead, int oldYHead) { if (this.mMode == 3) { this.isPickingPipes = true; try { - Field workState = this.getClass().getSuperclass().getDeclaredField("workState"); + Field workState = this.getClass() + .getSuperclass() + .getDeclaredField("workState"); workState.setInt(this, 2); } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException ignored) {} return true; @@ -231,7 +252,10 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { long waterConsume = (steamProduced + 160) / 160; if (this.getWaterFromHatches(true) - waterConsume > 0) { - this.consumeFluid(GT_ModHandler.getDistilledWater(1).getFluid(), waterConsume); + this.consumeFluid( + GT_ModHandler.getDistilledWater(1) + .getFluid(), + waterConsume); this.addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", (int) steamProduced)); } else { this.explodeMultiblock(); @@ -240,9 +264,9 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { } } else if (this.mMode == 1 || this.mMode == 2) { long coolantConverted = (long) (this.mTier * 24 - * (double) GT_TileEntity_DEHP.nulearHeatMod - * this.mEfficiency - / 10000L); + * (double) GT_TileEntity_DEHP.nulearHeatMod + * this.mEfficiency + / 10000L); if (this.getFluidFromHatches(FluidRegistry.getFluid("ic2coolant")) - coolantConverted > 0) { this.consumeFluid(FluidRegistry.getFluid("ic2coolant"), coolantConverted); this.addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", (int) coolantConverted)); @@ -260,10 +284,17 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { Arrays.fill(tmp, (int) (ammount / Integer.MAX_VALUE)); for (int i = 0; i < tmp.length; i++) { for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { - if (fluid.equals(FluidRegistry.WATER) - ? ih.getFluid().getFluid().equals(fluid) - || ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) - : ih.getFluid().getFluid().equals(fluid)) + if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid() + .getFluid() + .equals(fluid) + || ih.getFluid() + .getFluid() + .equals( + GT_ModHandler.getDistilledWater(1) + .getFluid()) + : ih.getFluid() + .getFluid() + .equals(fluid)) tmp[i] -= ih.drain((int) ammount, true).amount; if (tmp[i] <= 0) break; } @@ -274,10 +305,17 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { long tmp = ammount; for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { - if (fluid.equals(FluidRegistry.WATER) - ? ih.getFluid().getFluid().equals(fluid) - || ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) - : ih.getFluid().getFluid().equals(fluid)) + if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid() + .getFluid() + .equals(fluid) + || ih.getFluid() + .getFluid() + .equals( + GT_ModHandler.getDistilledWater(1) + .getFluid()) + : ih.getFluid() + .getFluid() + .equals(fluid)) tmp -= ih.drain((int) ammount, true).amount; if (tmp <= 0) return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 9a424b1cde..cb2140d62b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -79,8 +79,8 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; public class GT_TileEntity_ElectricImplosionCompressor - extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase - implements ISurvivalConstructable { + extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase + implements ISurvivalConstructable { private static final boolean pistonEnabled = !ConfigHandler.disablePistonInEIC; private Boolean piston = true; @@ -100,85 +100,91 @@ public class GT_TileEntity_ElectricImplosionCompressor private static final int CASING_INDEX = 16; private static final String STRUCTURE_PIECE_MAIN = "main"; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { { "ccc", "cec", "ccc" }, { "ttt", "tft", "ttt" }, { "ttt", "tft", "ttt" }, - { "nnn", "nnn", "nnn" }, { "nNn", "NNN", "nNn" }, { "nnn", "nnn", "nnn" }, - { "t~t", "tft", "ttt" }, { "ttt", "tft", "ttt" }, { "CCC", "CeC", "CCC" }, })) - .addElement('c', ofChain(ofBlock(GregTech_API.sBlockCasings2, 0), ofBlock(GregTech_API.sBlockCasings3, 4))) - .addElement('t', ofBlock(BW_BLOCKS[2], 1)).addElement('f', ofBlock(BW_BLOCKS[2], 0)) - .addElement( - 'n', - StructureUtility.ofBlocksTiered( - tieredBlockConverter(), - getAllBlockTiers(), - 0, - GT_TileEntity_ElectricImplosionCompressor::setBlockTier, - GT_TileEntity_ElectricImplosionCompressor::getBlockTier)) - .addElement( - 'C', - buildHatchAdder(GT_TileEntity_ElectricImplosionCompressor.class) - .atLeast(InputBus, OutputBus, Maintenance, InputHatch, OutputHatch) - .casingIndex(CASING_INDEX).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings2, 0)), - onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings3, 4)))) - .addElement( - 'e', - buildHatchAdder(GT_TileEntity_ElectricImplosionCompressor.class).atLeast(Energy.or(ExoticEnergy)) - .casingIndex(CASING_INDEX).dot(2).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings2, 0)), - onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings3, 4)))) - .addElement('N', new IStructureElement<>() { - - // Much of this based on StructureUtility.ofBlocksTiered - private final List> tiers = getAllBlockTiers(); - - @Override - public boolean check(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z) { - if (!te.piston && !world.isAirBlock(x, y, z)) return false; - if (te.piston) { - Block candidate = world.getBlock(x, y, z); - int candidateMeta = world.getBlockMetadata(x, y, z); - return getTierOfBlock(candidate, candidateMeta) != -1; - } - return true; - } + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { "ccc", "cec", "ccc" }, { "ttt", "tft", "ttt" }, { "ttt", "tft", "ttt" }, + { "nnn", "nnn", "nnn" }, { "nNn", "NNN", "nNn" }, { "nnn", "nnn", "nnn" }, { "t~t", "tft", "ttt" }, + { "ttt", "tft", "ttt" }, { "CCC", "CeC", "CCC" }, })) + .addElement('c', ofChain(ofBlock(GregTech_API.sBlockCasings2, 0), ofBlock(GregTech_API.sBlockCasings3, 4))) + .addElement('t', ofBlock(BW_BLOCKS[2], 1)) + .addElement('f', ofBlock(BW_BLOCKS[2], 0)) + .addElement( + 'n', + StructureUtility.ofBlocksTiered( + tieredBlockConverter(), + getAllBlockTiers(), + 0, + GT_TileEntity_ElectricImplosionCompressor::setBlockTier, + GT_TileEntity_ElectricImplosionCompressor::getBlockTier)) + .addElement( + 'C', + buildHatchAdder(GT_TileEntity_ElectricImplosionCompressor.class) + .atLeast(InputBus, OutputBus, Maintenance, InputHatch, OutputHatch) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain( + onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings2, 0)), + onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings3, 4)))) + .addElement( + 'e', + buildHatchAdder(GT_TileEntity_ElectricImplosionCompressor.class).atLeast(Energy.or(ExoticEnergy)) + .casingIndex(CASING_INDEX) + .dot(2) + .buildAndChain( + onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings2, 0)), + onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings3, 4)))) + .addElement('N', new IStructureElement<>() { + + // Much of this based on StructureUtility.ofBlocksTiered + private final List> tiers = getAllBlockTiers(); - private Pair getTier(ItemStack trigger) { - return this.tiers.get(Math.min(Math.max(trigger.stackSize, 1), this.tiers.size()) - 1); + @Override + public boolean check(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z) { + if (!te.piston && !world.isAirBlock(x, y, z)) return false; + if (te.piston) { + Block candidate = world.getBlock(x, y, z); + int candidateMeta = world.getBlockMetadata(x, y, z); + return getTierOfBlock(candidate, candidateMeta) != -1; } + return true; + } - @Override - public boolean spawnHint(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z, - ItemStack itemStack) { - Pair tier = this.getTier(itemStack); - if (te.piston) StructureLibAPI.hintParticle(world, x, y, z, tier.getKey(), tier.getValue()); - return true; - } + private Pair getTier(ItemStack trigger) { + return this.tiers.get(Math.min(Math.max(trigger.stackSize, 1), this.tiers.size()) - 1); + } - @Override - public boolean placeBlock(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, - int z, ItemStack itemStack) { - Pair tier = this.getTier(itemStack); - if (te.piston) world.setBlock(x, y, z, tier.getKey(), tier.getValue(), 3); - else world.setBlockToAir(x, y, z); - return true; - } + @Override + public boolean spawnHint(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z, + ItemStack itemStack) { + Pair tier = this.getTier(itemStack); + if (te.piston) StructureLibAPI.hintParticle(world, x, y, z, tier.getKey(), tier.getValue()); + return true; + } - @Override - public BlocksToPlace getBlocksToPlace(GT_TileEntity_ElectricImplosionCompressor t, World world, int x, - int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { - return BlocksToPlace.createEmpty(); - } + @Override + public boolean placeBlock(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z, + ItemStack itemStack) { + Pair tier = this.getTier(itemStack); + if (te.piston) world.setBlock(x, y, z, tier.getKey(), tier.getValue(), 3); + else world.setBlockToAir(x, y, z); + return true; + } - @Override - public PlaceResult survivalPlaceBlock(GT_TileEntity_ElectricImplosionCompressor t, World world, int x, - int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { - return isAir().survivalPlaceBlock(t, world, x, y, z, trigger, env); - } - }).build(); + @Override + public BlocksToPlace getBlocksToPlace(GT_TileEntity_ElectricImplosionCompressor t, World world, int x, + int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { + return BlocksToPlace.createEmpty(); + } + + @Override + public PlaceResult survivalPlaceBlock(GT_TileEntity_ElectricImplosionCompressor t, World world, int x, + int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { + return isAir().survivalPlaceBlock(t, world, x, y, z, trigger, env); + } + }) + .build(); public static List> getAllBlockTiers() { return new ArrayList<>() { @@ -242,21 +248,29 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Implosion Compressor").addInfo("Explosions are fun") - .addInfo("Controller block for the Electric Implosion Compressor") - .addInfo("Uses electricity instead of Explosives").addInfo("Can parallel up to 4^(Tier - 1)") - .addInfo("Tier is determined by containment block") - .addInfo("Valid blocks: Neutronium, Infinity, Transcendent Metal, Spacetime, Universium") - .addInfo("Minimum allowed energy hatch tier is one below recipe tier") - .addInfo("Supports " + TT + " energy hatches").addSeparator().beginStructureBlock(3, 9, 3, false) - .addController("Front 3rd layer center").addCasingInfoMin("Solid Steel Machine Casing", 8, false) - .addStructureInfo("Casings can be replaced with Explosion Warning Signs") - .addOtherStructurePart("Transformer-Winding Blocks", "Outer layer 2,3,7,8") - .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Inner layer 2,3,7,8") - .addOtherStructurePart("Containment Blocks", "Layer 4,5,6").addMaintenanceHatch("Any bottom casing", 1) - .addInputBus("Any bottom casing", 1).addInputHatch("Any bottom casing", 1) - .addOutputBus("Any bottom casing", 1).addEnergyHatch("Bottom middle and/or top middle", 2) - .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + tt.addMachineType("Implosion Compressor") + .addInfo("Explosions are fun") + .addInfo("Controller block for the Electric Implosion Compressor") + .addInfo("Uses electricity instead of Explosives") + .addInfo("Can parallel up to 4^(Tier - 1)") + .addInfo("Tier is determined by containment block") + .addInfo("Valid blocks: Neutronium, Infinity, Transcendent Metal, Spacetime, Universium") + .addInfo("Minimum allowed energy hatch tier is one below recipe tier") + .addInfo("Supports " + TT + " energy hatches") + .addSeparator() + .beginStructureBlock(3, 9, 3, false) + .addController("Front 3rd layer center") + .addCasingInfoMin("Solid Steel Machine Casing", 8, false) + .addStructureInfo("Casings can be replaced with Explosion Warning Signs") + .addOtherStructurePart("Transformer-Winding Blocks", "Outer layer 2,3,7,8") + .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Inner layer 2,3,7,8") + .addOtherStructurePart("Containment Blocks", "Layer 4,5,6") + .addMaintenanceHatch("Any bottom casing", 1) + .addInputBus("Any bottom casing", 1) + .addInputHatch("Any bottom casing", 1) + .addOutputBus("Any bottom casing", 1) + .addEnergyHatch("Bottom middle and/or top middle", 2) + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -285,7 +299,8 @@ public class GT_TileEntity_ElectricImplosionCompressor protected GT_OverclockCalculator createOverclockCalculator(@NotNull GT_Recipe recipe) { // For overclocking we'll allow all power to be used return super.createOverclockCalculator(recipe) - .setEUt(GT_TileEntity_ElectricImplosionCompressor.this.getMaxInputEu()).setAmperage(1); + .setEUt(GT_TileEntity_ElectricImplosionCompressor.this.getMaxInputEu()) + .setAmperage(1); } }.setMaxParallelSupplier(() -> (int) Math.pow(4, Math.max(this.mBlockTier - 1, 0))); } @@ -297,10 +312,14 @@ public class GT_TileEntity_ElectricImplosionCompressor if (Math.abs(x) != 1 || Math.abs(z) != 1) { int[] abc = { x, -2, z + 1 }; int[] xyz = { 0, 0, 0 }; - this.getExtendedFacing().getWorldOffset(abc, xyz); - xyz[0] += this.getBaseMetaTileEntity().getXCoord(); - xyz[1] += this.getBaseMetaTileEntity().getYCoord(); - xyz[2] += this.getBaseMetaTileEntity().getZCoord(); + this.getExtendedFacing() + .getWorldOffset(abc, xyz); + xyz[0] += this.getBaseMetaTileEntity() + .getXCoord(); + xyz[1] += this.getBaseMetaTileEntity() + .getYCoord(); + xyz[2] += this.getBaseMetaTileEntity() + .getZCoord(); this.chunkCoordinates.add(new ChunkCoordinates(xyz[0], xyz[1], xyz[2])); } } @@ -319,15 +338,15 @@ public class GT_TileEntity_ElectricImplosionCompressor if (pistonEnabled && aBaseMetaTileEntity.isActive() && aTick % 20 == 0) { if (aBaseMetaTileEntity.isClientSide()) this.animatePiston(aBaseMetaTileEntity); else if (aBaseMetaTileEntity.hasMufflerUpgrade()) MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( - aBaseMetaTileEntity.getWorld(), - new EICPacket( - new Coords( - aBaseMetaTileEntity.getXCoord(), - aBaseMetaTileEntity.getYCoord(), - aBaseMetaTileEntity.getZCoord()), - true), - aBaseMetaTileEntity.getXCoord(), - aBaseMetaTileEntity.getZCoord()); + aBaseMetaTileEntity.getWorld(), + new EICPacket( + new Coords( + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord()), + true), + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getZCoord()); } } @@ -358,9 +377,10 @@ public class GT_TileEntity_ElectricImplosionCompressor Pair tieredBlock = tiers.get(Math.min(tier, tiers.size()) - 1); this.chunkCoordinates.forEach(c -> { // Don't replace real blocks in case user has placed something (e.g. tier upgrade) - if (aBaseMetaTileEntity.getWorld().isAirBlock(c.posX, c.posY, c.posZ)) { + if (aBaseMetaTileEntity.getWorld() + .isAirBlock(c.posX, c.posY, c.posZ)) { aBaseMetaTileEntity.getWorld() - .setBlock(c.posX, c.posY, c.posZ, tieredBlock.getKey(), tieredBlock.getValue(), 3); + .setBlock(c.posX, c.posY, c.posZ, tieredBlock.getKey(), tieredBlock.getValue(), 3); } }); this.piston = !this.piston; @@ -372,7 +392,9 @@ public class GT_TileEntity_ElectricImplosionCompressor IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); if (!aBaseMetaTileEntity.isServerSide()) return; if (this.piston) { - this.chunkCoordinates.forEach(c -> aBaseMetaTileEntity.getWorld().setBlockToAir(c.posX, c.posY, c.posZ)); + this.chunkCoordinates.forEach( + c -> aBaseMetaTileEntity.getWorld() + .setBlockToAir(c.posX, c.posY, c.posZ)); this.piston = !this.piston; } } @@ -380,7 +402,9 @@ public class GT_TileEntity_ElectricImplosionCompressor private void animatePiston(IGregTechTileEntity aBaseMetaTileEntity) { if (!aBaseMetaTileEntity.getWorld().isRemote) return; - if (!this.getBaseMetaTileEntity().hasMufflerUpgrade()) GT_Utility.doSoundAtClient( + if (!this.getBaseMetaTileEntity() + .hasMufflerUpgrade()) + GT_Utility.doSoundAtClient( sound, 10, 1f, @@ -389,11 +413,11 @@ public class GT_TileEntity_ElectricImplosionCompressor this.chunkCoordinates.get(0).posY, this.chunkCoordinates.get(0).posZ); this.spawnVisualPistonBlocks( - aBaseMetaTileEntity.getWorld(), - this.chunkCoordinates.get(2).posX, - this.chunkCoordinates.get(2).posY, - this.chunkCoordinates.get(2).posZ, - 10); + aBaseMetaTileEntity.getWorld(), + this.chunkCoordinates.get(2).posX, + this.chunkCoordinates.get(2).posY, + this.chunkCoordinates.get(2).posZ, + 10); } @SideOnly(Side.CLIENT) @@ -463,16 +487,27 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { + int aColorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW).extFacing().glow() - .build() }; - return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW).extFacing().glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) }; } @@ -495,7 +530,7 @@ public class GT_TileEntity_ElectricImplosionCompressor @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { batchMode = !batchMode; if (batchMode) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index a676296b85..a5ed5a69b7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -63,63 +63,51 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase private static final String STRUCTURE_PIECE_MAIN = "main"; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { - { " BBBBBBB ", " BBBBBBBBB ", "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", - "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", " BBBBBBBBB ", - " BBBBBBB " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " bbb~bbb ", " bbbbbbbbb ", "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", - "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", " bbbbbbbbb ", - " bbbbbbb " }, })) - .addElement('c', onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5))) - .addElement( - 'b', - ofChain( - ofHatchAdder(GT_TileEntity_HTGR::addOutputToMachineList, BASECASINGINDEX, 1), - ofHatchAdder(GT_TileEntity_HTGR::addMaintenanceToMachineList, BASECASINGINDEX, 1), - ofHatchAdder(GT_TileEntity_HTGR::addEnergyInputToMachineList, BASECASINGINDEX, 1), - onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5)))) - .addElement( - 'B', - ofChain( - ofHatchAdder(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2), - onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5)))) - // ofHatchAdderOptional(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2, - // GregTech_API.sBlockCasings8, 5)) - .build(); + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { + { " BBBBBBB ", " BBBBBBBBB ", "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", + "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", " BBBBBBBBB ", " BBBBBBB " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " bbb~bbb ", " bbbbbbbbb ", "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", + "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", " bbbbbbbbb ", " bbbbbbb " }, })) + .addElement('c', onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5))) + .addElement( + 'b', + ofChain( + ofHatchAdder(GT_TileEntity_HTGR::addOutputToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_HTGR::addMaintenanceToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_HTGR::addEnergyInputToMachineList, BASECASINGINDEX, 1), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5)))) + .addElement( + 'B', + ofChain( + ofHatchAdder(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5)))) + // ofHatchAdderOptional(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2, + // GregTech_API.sBlockCasings8, 5)) + .build(); private static final int HELIUM_NEEDED = 730000; public static final int powerUsage = (int) TierEU.RECIPE_LuV; @@ -154,24 +142,30 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Breeder Reactor") - .addInfo("Controller block for the High Temperature Gas-cooled Reactor (HTGR)").addInfo(AuthorKuba) - .addInfo("You can clear internal buffer by changing the mode with a screwdriver") - .addInfo("Needs a constant supply of coolant while running") - .addInfo("Needs at least 72k Fuel pebbles to start operation (can hold up to 720k pebbles)") - .addInfo("Consumes up to 2.5% of total Fuel Pellets per Operation depending on efficiency") - .addInfo( - "Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer") - .addInfo("and affects total recipe time (at 100% eff, -50% total recipe time") - .addInfo( - "Reactor will take 4 000L/s of coolant multiplied by efficiency and by fuel coolant value (check tooltips)") - .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t").addInfo("One Operation takes 1 hour") - .addSeparator().beginStructureBlock(11, 12, 11, true).addController("Front bottom center") - .addCasingInfoMin("Europium Reinforced Radiation Proof Casings", 500, false) - .addStructureInfo("Corners and the 2 touching blocks are air (cylindric)") - .addInputBus("Any top layer casing", 2).addInputHatch("Any top layer casing", 2) - .addOutputBus("Any bottom layer casing", 1).addOutputHatch("Any bottom layer casing", 1) - .addEnergyHatch("Any bottom layer casing", 1).addMaintenanceHatch("Any bottom layer casing", 1) - .toolTipFinisher(MULTIBLOCK_ADDED_VIA_BARTWORKS.apply(ChatColorHelper.GOLD + "kuba6000")); + .addInfo("Controller block for the High Temperature Gas-cooled Reactor (HTGR)") + .addInfo(AuthorKuba) + .addInfo("You can clear internal buffer by changing the mode with a screwdriver") + .addInfo("Needs a constant supply of coolant while running") + .addInfo("Needs at least 72k Fuel pebbles to start operation (can hold up to 720k pebbles)") + .addInfo("Consumes up to 2.5% of total Fuel Pellets per Operation depending on efficiency") + .addInfo("Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer") + .addInfo("and affects total recipe time (at 100% eff, -50% total recipe time") + .addInfo( + "Reactor will take 4 000L/s of coolant multiplied by efficiency and by fuel coolant value (check tooltips)") + .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t") + .addInfo("One Operation takes 1 hour") + .addSeparator() + .beginStructureBlock(11, 12, 11, true) + .addController("Front bottom center") + .addCasingInfoMin("Europium Reinforced Radiation Proof Casings", 500, false) + .addStructureInfo("Corners and the 2 touching blocks are air (cylindric)") + .addInputBus("Any top layer casing", 2) + .addInputHatch("Any top layer casing", 2) + .addOutputBus("Any bottom layer casing", 1) + .addOutputHatch("Any bottom layer casing", 1) + .addEnergyHatch("Any bottom layer casing", 1) + .addMaintenanceHatch("Any bottom layer casing", 1) + .toolTipFinisher(MULTIBLOCK_ADDED_VIA_BARTWORKS.apply(ChatColorHelper.GOLD + "kuba6000")); return tt; } @@ -189,12 +183,12 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { this.mCasing = 0; return this.checkPiece("main", 5, 11, 0) && this.mCasing >= 500 - && this.mMaintenanceHatches.size() == 1 - && this.mInputHatches.size() > 0 - && this.mOutputHatches.size() > 0 - && this.mInputBusses.size() > 0 - && this.mOutputBusses.size() > 0 - && this.mEnergyHatches.size() > 0; + && this.mMaintenanceHatches.size() == 1 + && this.mInputHatches.size() > 0 + && this.mOutputHatches.size() > 0 + && this.mInputBusses.size() > 0 + && this.mOutputBusses.size() > 0 + && this.mEnergyHatches.size() > 0; } @Override @@ -279,7 +273,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase if (this.HeliumSupply < GT_TileEntity_HTGR.HELIUM_NEEDED || this.fuelsupply < mincapacity) return false; double eff = Math.min(Math.pow((double) this.fuelsupply / (double) mincapacity, 2D), 100D) / 100D - - (this.getIdealStatus() - this.getRepairStatus()) / 10D; + - (this.getIdealStatus() - this.getRepairStatus()) / 10D; if (eff <= 0) return false; @@ -292,7 +286,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase int meta = this.fueltype * HTGRMaterials.MATERIALS_PER_FUEL + HTGRMaterials.BURNED_OUT_FUEL_INDEX; ItemStack[] toOutput = { new ItemStack(HTGRMaterials.aHTGR_Materials, burnedballs, meta), - new ItemStack(HTGRMaterials.aHTGR_Materials, toReduce, meta + 1) }; + new ItemStack(HTGRMaterials.aHTGR_Materials, toReduce, meta + 1) }; if (!this.canOutputAll(toOutput)) return false; this.fuelsupply -= originalToReduce; @@ -326,9 +320,9 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } if (this.fuelsupply > 0) { ItemStack iStack = new ItemStack( - HTGRMaterials.aHTGR_Materials, - this.fuelsupply, - HTGRMaterials.MATERIALS_PER_FUEL * this.fueltype + HTGRMaterials.USABLE_FUEL_INDEX); + HTGRMaterials.aHTGR_Materials, + this.fuelsupply, + HTGRMaterials.MATERIALS_PER_FUEL * this.fueltype + HTGRMaterials.USABLE_FUEL_INDEX); boolean storedAll = false; for (GT_MetaTileEntity_Hatch_OutputBus tHatch : filterValidMTEs(mOutputBusses)) { if (tHatch.storeAll(iStack)) { @@ -408,34 +402,43 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public String[] getInfoData() { return new String[] { "Mode:", this.empty ? "Emptying" : "Normal", "Progress:", - GT_Utility.formatNumbers(this.mProgresstime / 20) + "s / " - + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) - + "s", - "Fuel type:", - this.fueltype == -1 ? "NONE" : "TRISO (" + HTGRMaterials.sHTGR_Fuel[this.fueltype].sEnglish + ")", - "Fuel amount:", GT_Utility.formatNumbers(this.fuelsupply) + " pcs.", "Helium-Level:", - GT_Utility.formatNumbers(this.HeliumSupply) + "L / " - + GT_Utility.formatNumbers(GT_TileEntity_HTGR.HELIUM_NEEDED) - + "L", - "Coolant:", GT_Utility.formatNumbers(this.coolanttaking) + "L/s", "Problems:", - String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; + GT_Utility.formatNumbers(this.mProgresstime / 20) + "s / " + + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + + "s", + "Fuel type:", + this.fueltype == -1 ? "NONE" : "TRISO (" + HTGRMaterials.sHTGR_Fuel[this.fueltype].sEnglish + ")", + "Fuel amount:", GT_Utility.formatNumbers(this.fuelsupply) + " pcs.", "Helium-Level:", + GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + + GT_Utility.formatNumbers(GT_TileEntity_HTGR.HELIUM_NEEDED) + + "L", + "Coolant:", GT_Utility.formatNumbers(this.coolanttaking) + "L/s", "Problems:", + String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, - ForgeDirection forgeDirection, int aColorIndex, boolean aActive, boolean aRedstone) { + ForgeDirection forgeDirection, int aColorIndex, boolean aActive, boolean aRedstone) { if (side == forgeDirection) { - if (aActive) - return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) - .extFacing().build(), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW) - .extFacing().glow().build() }; + if (aActive) return new ITexture[] { + Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER).extFacing() - .build(), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).extFacing() - .glow().build() }; + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX) }; } @@ -448,8 +451,8 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } this.empty = !this.empty; GT_Utility.sendChatToPlayer( - aPlayer, - "HTGR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); + aPlayer, + "HTGR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); } @Override @@ -496,13 +499,13 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase public ItemStack mainItem; public ItemStack secondaryItem; public ItemStack[] recycledItems = { GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, - GT_Values.NI }; + GT_Values.NI }; public FluidStack recycledFluid; public int[] recycleChances; public String tooltip; public Fuel_(String sName, String sEnglish, ItemStack mainItem, ItemStack secondaryItem, - FluidStack recycledFluid, ItemStack[] recycledItems, int[] recycleChances, String tooltip) { + FluidStack recycledFluid, ItemStack[] recycledItems, int[] recycleChances, String tooltip) { this.sName = sName; this.sEnglish = sEnglish; this.mainItem = mainItem; @@ -526,46 +529,43 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase } public static final Base_[] sHTGR_Bases = { new Base_("HTGRFuelMixture", "HTGR fuel mixture"), - new Base_("BISOPebbleCompound", "BISO pebble compound"), - new Base_("TRISOPebbleCompound", "TRISO pebble compound"), new Base_("TRISOBall", "TRISO ball"), - new Base_("TRISOPebble", "TRISO pebble"), new Base_("BurnedOutTRISOBall", "Burned out TRISO Ball"), - new Base_("BurnedOutTRISOPebble", "Burned out TRISO Pebble"), }; + new Base_("BISOPebbleCompound", "BISO pebble compound"), + new Base_("TRISOPebbleCompound", "TRISO pebble compound"), new Base_("TRISOBall", "TRISO ball"), + new Base_("TRISOPebble", "TRISO pebble"), new Base_("BurnedOutTRISOBall", "Burned out TRISO Ball"), + new Base_("BurnedOutTRISOPebble", "Burned out TRISO Pebble"), }; public static final int MATERIALS_PER_FUEL = sHTGR_Bases.length; static final int USABLE_FUEL_INDEX = 4; static final int BURNED_OUT_FUEL_INDEX = 5; - public static final Fuel_[] sHTGR_Fuel = { - new Fuel_( - "Thorium", - "Thorium", - WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 64), - Materials.Uranium235.getDust(4), - GT_Values.NF, - new ItemStack[] { Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), - Materials.Carbon.getDust(1), Materials.Lutetium.getDust(1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1) }, - new int[] { 9900 / 4, 9900 / 4, 9900 / 4, 9900 / 4, 162 / 4 }, - "Multiplies coolant by 1"), - new Fuel_( - "Uranium", - "Uranium", - Materials.Uranium.getDust(64), - Materials.Uranium235.getDust(8), - FluidRegistry.getFluidStack("krypton", 4), - new ItemStack[] { Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), - Materials.Carbon.getDust(1), Materials.Lead.getDust(1), Materials.Uranium.getDust(1) }, - new int[] { 9900 / 4, 9900 / 4, 9900 / 4, 5000 / 4, 5000 / 4 }, - "Multiplies coolant by 1.5"), - new Fuel_( - "Plutonium", - "Plutonium", - Materials.Plutonium.getDust(64), - Materials.Plutonium241.getDust(4), - FluidRegistry.getFluidStack("xenon", 4), - new ItemStack[] { Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), - Materials.Carbon.getDust(1), Materials.Lead.getDust(1), - Materials.Plutonium.getDust(1) }, - new int[] { 9900 / 4, 9900 / 4, 9900 / 4, 5000 / 4, 5000 / 4 }, - "Multiplies coolant by 2"), }; + public static final Fuel_[] sHTGR_Fuel = { new Fuel_( + "Thorium", + "Thorium", + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 64), + Materials.Uranium235.getDust(4), + GT_Values.NF, + new ItemStack[] { Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), + Materials.Lutetium.getDust(1), WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1) }, + new int[] { 9900 / 4, 9900 / 4, 9900 / 4, 9900 / 4, 162 / 4 }, + "Multiplies coolant by 1"), + new Fuel_( + "Uranium", + "Uranium", + Materials.Uranium.getDust(64), + Materials.Uranium235.getDust(8), + FluidRegistry.getFluidStack("krypton", 4), + new ItemStack[] { Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), + Materials.Carbon.getDust(1), Materials.Lead.getDust(1), Materials.Uranium.getDust(1) }, + new int[] { 9900 / 4, 9900 / 4, 9900 / 4, 5000 / 4, 5000 / 4 }, + "Multiplies coolant by 1.5"), + new Fuel_( + "Plutonium", + "Plutonium", + Materials.Plutonium.getDust(64), + Materials.Plutonium241.getDust(4), + FluidRegistry.getFluidStack("xenon", 4), + new ItemStack[] { Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), + Materials.Carbon.getDust(1), Materials.Lead.getDust(1), Materials.Plutonium.getDust(1) }, + new int[] { 9900 / 4, 9900 / 4, 9900 / 4, 5000 / 4, 5000 / 4 }, + "Multiplies coolant by 2"), }; public static final CustomHTGRSimpleSubItemClass aHTGR_Materials; static final ArrayList aHTGR_Localizations = new ArrayList<>(); @@ -576,12 +576,9 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase for (Fuel_ fuel : sHTGR_Fuel) for (Base_ base : sHTGR_Bases) { sHTGR_Materials[i] = "HTGR" + base.sName + fuel.sName; aHTGR_Localizations.add( - new LangEntry_( - "item." + sHTGR_Materials[i] + ".name", - base.sEnglish + " (" + fuel.sEnglish + ")")); + new LangEntry_("item." + sHTGR_Materials[i] + ".name", base.sEnglish + " (" + fuel.sEnglish + ")")); if ((i + 1) % MATERIALS_PER_FUEL == USABLE_FUEL_INDEX + 1 && fuel.tooltip != null - && !fuel.tooltip.isEmpty()) - tooltip.put(i, fuel.tooltip); + && !fuel.tooltip.isEmpty()) tooltip.put(i, fuel.tooltip); i++; } aHTGR_Materials = new CustomHTGRSimpleSubItemClass(tooltip, sHTGR_Materials); @@ -600,15 +597,15 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase Fuel_ fuel : sHTGR_Fuel) { BartWorksRecipeMaps.htgrFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4) }, - new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5) }, - null, - null, - null, - 72000, - powerUsage, - 0); + false, + new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4) }, + new ItemStack[] { new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5) }, + null, + null, + null, + 72000, + powerUsage, + 0); i += MATERIALS_PER_FUEL; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 65a45051ab..5a2c3ba382 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -110,8 +110,10 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public long maxAmperesIn() { int ret = 0; - for (int i = 0; i < 5; ++i) if (this.circuits[i] != null - && this.circuits[i].getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) + for (int i = 0; i < 5; ++i) if (this.circuits[i] != null && this.circuits[i].getItem() + .equals( + GT_Utility.getIntegratedCircuit(0) + .getItem())) ret += this.circuits[i].getItemDamage(); return ret > 0 ? ret : 1; } @@ -170,13 +172,15 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public String[] getDescription() { ArrayList e = new ArrayList<>(); - String[] dsc = StatCollector.translateToLocal("tooltip.tile.lesu.0.name").split(";"); + String[] dsc = StatCollector.translateToLocal("tooltip.tile.lesu.0.name") + .split(";"); Collections.addAll(e, dsc); e.add( - StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " - + GT_Utility.formatNumbers(ConfigHandler.energyPerCell) - + "EU"); - dsc = StatCollector.translateToLocal("tooltip.tile.lesu.2.name").split(";"); + StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + + GT_Utility.formatNumbers(ConfigHandler.energyPerCell) + + "EU"); + dsc = StatCollector.translateToLocal("tooltip.tile.lesu.2.name") + .split(";"); Collections.addAll(e, dsc); e.add(ChatColorHelper.RED + StatCollector.translateToLocal("tooltip.tile.lesu.3.name")); e.add(BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); @@ -211,15 +215,17 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } public boolean isClientSide() { - if (this.getWorld() != null) - return this.getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT - : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; - return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; + if (this.getWorld() != null) return this.getWorld().isRemote ? FMLCommonHandler.instance() + .getSide() == Side.CLIENT + : FMLCommonHandler.instance() + .getEffectiveSide() == Side.CLIENT; + return FMLCommonHandler.instance() + .getEffectiveSide() == Side.CLIENT; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { + int aColorIndex, boolean aActive, boolean aRedstone) { ITexture[] ret = {}; @@ -227,11 +233,11 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { for (int i = 0; i < GT_TileEntity_LESU.iTextures.length; i++) { GT_TileEntity_LESU.iTextures[i][0] = TextureFactory - .of(GT_TileEntity_LESU.iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); + .of(GT_TileEntity_LESU.iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); } - if (side == facing && this.getBaseMetaTileEntity().getUniversalEnergyStored() <= 0) - ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_EMPTY]; + if (side == facing && this.getBaseMetaTileEntity() + .getUniversalEnergyStored() <= 0) ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_EMPTY]; else if (side == facing && !aActive) ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_IDLE]; else if (side == facing && aActive) ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_CHARGING]; else ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_SIDE]; @@ -292,7 +298,10 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { return switch (index) { case 0, 1 -> true; - default -> stack != null && stack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); + default -> stack != null && stack.getItem() + .equals( + GT_Utility.getIntegratedCircuit(0) + .getItem()); }; } @@ -308,12 +317,14 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean isInputFacing(ForgeDirection side) { - return side != this.getBaseMetaTileEntity().getFrontFacing(); + return side != this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override public boolean isOutputFacing(ForgeDirection side) { - return side == this.getBaseMetaTileEntity().getFrontFacing(); + return side == this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override @@ -367,20 +378,23 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { long startingTime = System.nanoTime(); this.connectedcells = new ConnectedBlocksChecker(); this.connectedcells.get_connected( - aBaseMetaTileEntity.getWorld(), - aBaseMetaTileEntity.getXCoord(), - aBaseMetaTileEntity.getYCoord(), - aBaseMetaTileEntity.getZCoord(), - ItemRegistry.BW_BLOCKS[1]); + aBaseMetaTileEntity.getWorld(), + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord(), + ItemRegistry.BW_BLOCKS[1]); if (this.connectedcells.get_meta_of_sideblocks( - aBaseMetaTileEntity.getWorld(), - this.getBaseMetaTileEntity().getMetaTileID(), - new int[] { aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), - aBaseMetaTileEntity.getZCoord() }, - true)) { - this.getBaseMetaTileEntity().disableWorking(); - this.getBaseMetaTileEntity().setActive(false); + aBaseMetaTileEntity.getWorld(), + this.getBaseMetaTileEntity() + .getMetaTileID(), + new int[] { aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord() }, + true)) { + this.getBaseMetaTileEntity() + .disableWorking(); + this.getBaseMetaTileEntity() + .setActive(false); this.mStorage = 0; this.mMaxProgresstime = 0; this.mProgresstime = 0; @@ -389,8 +403,8 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { this.mEfficiency = this.getMaxEfficiency(null); this.mStorage = ConfigHandler.energyPerCell * this.connectedcells.hashset.size() >= Long.MAX_VALUE - 1 - || ConfigHandler.energyPerCell * this.connectedcells.hashset.size() < 0 ? Long.MAX_VALUE - 1 - : ConfigHandler.energyPerCell * this.connectedcells.hashset.size(); + || ConfigHandler.energyPerCell * this.connectedcells.hashset.size() < 0 ? Long.MAX_VALUE - 1 + : ConfigHandler.energyPerCell * this.connectedcells.hashset.size(); this.mMaxProgresstime = 1; this.mProgresstime = 0; @@ -401,25 +415,32 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { this.mSolderingTool = true; this.mWrench = true; - this.getBaseMetaTileEntity().enableWorking(); - this.getBaseMetaTileEntity().setActive(true); + this.getBaseMetaTileEntity() + .enableWorking(); + this.getBaseMetaTileEntity() + .setActive(true); long finishedTime = System.nanoTime(); // System.out.println("LESU LookUp: "+((finishedTime - startingTime) / 1000000)+"ms"); if (finishedTime - startingTime > 5000000) MainMod.LOGGER.warn( - "LESU LookUp took longer than 5ms!(" + (finishedTime - startingTime) - + "ns / " - + (finishedTime - startingTime) / 1000000 - + "ms) Owner:" - + this.getBaseMetaTileEntity().getOwnerName() - + " Check at x:" - + this.getBaseMetaTileEntity().getXCoord() - + " y:" - + this.getBaseMetaTileEntity().getYCoord() - + " z:" - + this.getBaseMetaTileEntity().getZCoord() - + " DIM-ID: " - + this.getBaseMetaTileEntity().getWorld().provider.dimensionId); + "LESU LookUp took longer than 5ms!(" + (finishedTime - startingTime) + + "ns / " + + (finishedTime - startingTime) / 1000000 + + "ms) Owner:" + + this.getBaseMetaTileEntity() + .getOwnerName() + + " Check at x:" + + this.getBaseMetaTileEntity() + .getXCoord() + + " y:" + + this.getBaseMetaTileEntity() + .getYCoord() + + " z:" + + this.getBaseMetaTileEntity() + .getZCoord() + + " DIM-ID: " + + this.getBaseMetaTileEntity() + .getWorld().provider.dimensionId); return true; } @@ -444,40 +465,53 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } public World getWorld() { - return this.getBaseMetaTileEntity().getWorld(); + return this.getBaseMetaTileEntity() + .getWorld(); } @Override public void addGregTechLogo(ModularWindow.Builder builder) { builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY).setSize(17, 17) - .setPos(105, 51)); + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY) + .setSize(17, 17) + .setPos(105, 51)); } @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(7, 4).setSize(118, 67)) - .widget(new SlotWidget(new BaseSlot(this.inventoryHandler, 1) { - - @Override - public int getSlotStackLimit() { - return 1; - } - }).setBackground(this.getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN).setPos(127, 13)) - .widget(new SlotWidget(new BaseSlot(this.inventoryHandler, 0) { - - @Override - public int getSlotStackLimit() { - return 1; - } - }).setBackground(this.getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CHARGER) - .setPos(127, 49)); + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setPos(7, 4) + .setSize(118, 67)) + .widget(new SlotWidget(new BaseSlot(this.inventoryHandler, 1) { + + @Override + public int getSlotStackLimit() { + return 1; + } + }).setBackground( + this.getGUITextureSet() + .getItemSlot(), + GT_UITextures.OVERLAY_SLOT_IN) + .setPos(127, 13)) + .widget(new SlotWidget(new BaseSlot(this.inventoryHandler, 0) { + + @Override + public int getSlotStackLimit() { + return 1; + } + }).setBackground( + this.getGUITextureSet() + .getItemSlot(), + GT_UITextures.OVERLAY_SLOT_CHARGER) + .setPos(127, 49)); for (int i = 0; i < 4; i++) { builder.widget( - new SlotWidget(this.circuitsInventoryHandler, i).setBackground( - this.getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT).setPos(151, 4 + i * 18)); + new SlotWidget(this.circuitsInventoryHandler, i).setBackground( + this.getGUITextureSet() + .getItemSlot(), + GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT) + .setPos(151, 4 + i * 18)); } final DynamicPositionedColumn screenElements = new DynamicPositionedColumn(); @@ -485,15 +519,18 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { builder.widget(screenElements); builder.widget( - new DrawableWidget().setDrawable(BW_UITextures.PICTURE_STORED_EU_FRAME).setPos(7, 72).setSize(118, 7)) - .widget( - new ProgressBar() - .setProgress( - () -> (float) this.getBaseMetaTileEntity().getStoredEU() - / this.getBaseMetaTileEntity().getEUCapacity()) - .setDirection(ProgressBar.Direction.RIGHT) - .setTexture(BW_UITextures.PROGRESSBAR_STORED_EU_116, 116).setPos(8, 73) - .setSize(116, 5)); + new DrawableWidget().setDrawable(BW_UITextures.PICTURE_STORED_EU_FRAME) + .setPos(7, 72) + .setSize(118, 7)) + .widget( + new ProgressBar().setProgress( + () -> (float) this.getBaseMetaTileEntity() + .getStoredEU() / this.getBaseMetaTileEntity() + .getEUCapacity()) + .setDirection(ProgressBar.Direction.RIGHT) + .setTexture(BW_UITextures.PROGRESSBAR_STORED_EU_116, 116) + .setPos(8, 73) + .setSize(116, 5)); } private long clientEU; @@ -503,51 +540,59 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { private long clientAmps; private void drawTexts(DynamicPositionedColumn screenElements) { - screenElements.setSpace(0).setPos(11, 8); - - screenElements - .widget( - new TextWidget().setStringSupplier(() -> "EU: " + numberFormat.format(this.clientEU)) - .setDefaultColor(this.COLOR_TEXT_WHITE.get())) - .widget( - new FakeSyncWidget.LongSyncer( - () -> this.getBaseMetaTileEntity().getStoredEU(), - val -> clientEU = val)) - .widget( - new TextWidget().setStringSupplier(() -> "MAX: " + numberFormat.format(clientMaxEU)) - .setDefaultColor(this.COLOR_TEXT_WHITE.get())) - .widget( - new FakeSyncWidget.LongSyncer( - () -> this.getBaseMetaTileEntity().isActive() - ? this.getBaseMetaTileEntity().getOutputVoltage() * ConfigHandler.energyPerCell - : 0, - val -> clientMaxEU = val)) - .widget( - new TextWidget().setStringSupplier(() -> "MAX EU/t IN: " + numberFormat.format(clientMaxIn)) - .setDefaultColor(this.COLOR_TEXT_WHITE.get())) - .widget( - new FakeSyncWidget.LongSyncer( - () -> this.getBaseMetaTileEntity().getInputVoltage(), - val -> clientMaxIn = val)) - .widget( - new TextWidget().setStringSupplier(() -> "EU/t OUT: " + numberFormat.format(clientMaxOut)) - .setDefaultColor(this.COLOR_TEXT_WHITE.get())) - .widget( - new FakeSyncWidget.LongSyncer( - () -> this.getBaseMetaTileEntity().getOutputVoltage(), - val -> clientMaxOut = val)) - .widget( - new TextWidget().setStringSupplier(() -> "AMP/t IN/OUT: " + numberFormat.format(clientAmps)) - .setDefaultColor(this.COLOR_TEXT_WHITE.get())) - .widget( - new FakeSyncWidget.LongSyncer( - () -> this.getBaseMetaTileEntity().getInputAmperage(), - val -> clientAmps = val)) - .widget( - new TextWidget(Text.localised("tooltip.LESU.0.name")).setDefaultColor(Color.YELLOW.getRGB()) - .setEnabled(widget -> this.maxEUStore() >= Long.MAX_VALUE - 1)) - .widget( - new TextWidget(Text.localised("tooltip.LESU.1.name")).setDefaultColor(Color.RED.getRGB()) - .setEnabled(widget -> !this.getBaseMetaTileEntity().isActive())); + screenElements.setSpace(0) + .setPos(11, 8); + + screenElements.widget( + new TextWidget().setStringSupplier(() -> "EU: " + numberFormat.format(this.clientEU)) + .setDefaultColor(this.COLOR_TEXT_WHITE.get())) + .widget( + new FakeSyncWidget.LongSyncer( + () -> this.getBaseMetaTileEntity() + .getStoredEU(), + val -> clientEU = val)) + .widget( + new TextWidget().setStringSupplier(() -> "MAX: " + numberFormat.format(clientMaxEU)) + .setDefaultColor(this.COLOR_TEXT_WHITE.get())) + .widget( + new FakeSyncWidget.LongSyncer( + () -> this.getBaseMetaTileEntity() + .isActive() + ? this.getBaseMetaTileEntity() + .getOutputVoltage() * ConfigHandler.energyPerCell + : 0, + val -> clientMaxEU = val)) + .widget( + new TextWidget().setStringSupplier(() -> "MAX EU/t IN: " + numberFormat.format(clientMaxIn)) + .setDefaultColor(this.COLOR_TEXT_WHITE.get())) + .widget( + new FakeSyncWidget.LongSyncer( + () -> this.getBaseMetaTileEntity() + .getInputVoltage(), + val -> clientMaxIn = val)) + .widget( + new TextWidget().setStringSupplier(() -> "EU/t OUT: " + numberFormat.format(clientMaxOut)) + .setDefaultColor(this.COLOR_TEXT_WHITE.get())) + .widget( + new FakeSyncWidget.LongSyncer( + () -> this.getBaseMetaTileEntity() + .getOutputVoltage(), + val -> clientMaxOut = val)) + .widget( + new TextWidget().setStringSupplier(() -> "AMP/t IN/OUT: " + numberFormat.format(clientAmps)) + .setDefaultColor(this.COLOR_TEXT_WHITE.get())) + .widget( + new FakeSyncWidget.LongSyncer( + () -> this.getBaseMetaTileEntity() + .getInputAmperage(), + val -> clientAmps = val)) + .widget( + new TextWidget(Text.localised("tooltip.LESU.0.name")).setDefaultColor(Color.YELLOW.getRGB()) + .setEnabled(widget -> this.maxEUStore() >= Long.MAX_VALUE - 1)) + .widget( + new TextWidget(Text.localised("tooltip.LESU.1.name")).setDefaultColor(Color.RED.getRGB()) + .setEnabled( + widget -> !this.getBaseMetaTileEntity() + .isActive())); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index 6c8f5e8b76..b481429411 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -70,56 +70,57 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl private static final String STRUCTURE_PIECE_TOP = "top"; private static final String STRUCTURE_PIECE_TAP_LAYER = "taplayer"; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() - .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] { { "b~b", "bbb", "bbb" } })) - .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] { { "ttt", "tft", "ttt" } })) - .addShape(STRUCTURE_PIECE_TOP, transpose(new String[][] { { "ooo", "ooo", "ooo" } })) - .addShape( - STRUCTURE_PIECE_TAP_LAYER, - transpose(new String[][] { { " TTT ", "TtttT", "TtftT", "TtttT", " TTT " } })) - .addElement( - 'b', - ofChain( - ofHatchAdder(GT_TileEntity_ManualTrafo::addEnergyInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_ManualTrafo::addMaintenanceToMachineList, CASING_INDEX, 1), - ofBlock(GregTech_API.sBlockCasings1, 2))) - .addElement( - 'o', - ofHatchAdderOptional( - GT_TileEntity_ManualTrafo::addDynamoToMachineList, - CASING_INDEX, - 2, - GregTech_API.sBlockCasings1, - 2)) - .addElement('t', ofBlock(BW_BLOCKS[2], 1)).addElement('f', ofBlock(BW_BLOCKS[2], 0)) - .addElement('T', new IStructureElementNoPlacement() { - - @Override - public boolean check(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z) { - if (world.isAirBlock(x, y, z)) return true; - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null || !(tileEntity instanceof IGregTechTileEntity)) return true; - IMetaTileEntity mte = ((IGregTechTileEntity) tileEntity).getMetaTileEntity(); - if (mte instanceof GT_MetaTileEntity_Hatch_Dynamo - || mte instanceof GT_MetaTileEntity_Hatch_Energy) { - int intier = te.mEnergyHatches.get(0).mTier; - if (((GT_MetaTileEntity_TieredMachineBlock) mte).mTier - == intier + (te.upstep ? te.mTiers : -te.mTiers)) { - te.addToMachineList((IGregTechTileEntity) tileEntity, CASING_INDEX); - return true; - } - return false; + .builder() + .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] { { "b~b", "bbb", "bbb" } })) + .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] { { "ttt", "tft", "ttt" } })) + .addShape(STRUCTURE_PIECE_TOP, transpose(new String[][] { { "ooo", "ooo", "ooo" } })) + .addShape( + STRUCTURE_PIECE_TAP_LAYER, + transpose(new String[][] { { " TTT ", "TtttT", "TtftT", "TtttT", " TTT " } })) + .addElement( + 'b', + ofChain( + ofHatchAdder(GT_TileEntity_ManualTrafo::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_ManualTrafo::addMaintenanceToMachineList, CASING_INDEX, 1), + ofBlock(GregTech_API.sBlockCasings1, 2))) + .addElement( + 'o', + ofHatchAdderOptional( + GT_TileEntity_ManualTrafo::addDynamoToMachineList, + CASING_INDEX, + 2, + GregTech_API.sBlockCasings1, + 2)) + .addElement('t', ofBlock(BW_BLOCKS[2], 1)) + .addElement('f', ofBlock(BW_BLOCKS[2], 0)) + .addElement('T', new IStructureElementNoPlacement() { + + @Override + public boolean check(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z) { + if (world.isAirBlock(x, y, z)) return true; + TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity == null || !(tileEntity instanceof IGregTechTileEntity)) return true; + IMetaTileEntity mte = ((IGregTechTileEntity) tileEntity).getMetaTileEntity(); + if (mte instanceof GT_MetaTileEntity_Hatch_Dynamo || mte instanceof GT_MetaTileEntity_Hatch_Energy) { + int intier = te.mEnergyHatches.get(0).mTier; + if (((GT_MetaTileEntity_TieredMachineBlock) mte).mTier + == intier + (te.upstep ? te.mTiers : -te.mTiers)) { + te.addToMachineList((IGregTechTileEntity) tileEntity, CASING_INDEX); + return true; } - return true; + return false; } + return true; + } - @Override - public boolean spawnHint(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z, - ItemStack itemStack) { - StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 2 /* aDots: 3 */); - return true; - } - }).build(); + @Override + public boolean spawnHint(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z, + ItemStack itemStack) { + StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 2 /* aDots: 3 */); + return true; + } + }) + .build(); @Override public IStructureDefinition getStructureDefinition() { @@ -129,21 +130,27 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Transformer").addInfo("Controller block for the Manual Trafo") - .addInfo("Operates in 4 diffrent modes:").addInfo("Mode 1: Circuit 0 in controller: Direct-Upstep") - .addInfo("Mode 2: Circuit 1 in controller: Direct-Downstep") - .addInfo("Mode 3: Circuit 2 in controller: Tapped-Upstep (currently disabled)") - .addInfo("Mode 4: Circuit 2 in controller: Tapped-Downstep (currently disabled)").addSeparator() - .beginVariableStructureBlock(3, 3, 3, 10, 3, 3, false).addController("Front bottom center") - .addCasingInfoMin("MV Machine Casing", 0, false) - .addOtherStructurePart("Transformer-Winding Blocks", "1 Layer for each tier transformed") - .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Middle of Transformer-Winding Blocks") - .addMaintenanceHatch("Any bottom layer casing", 1).addEnergyHatch("Any bottom layer casing", 1) - .addDynamoHatch("Any top layer casing", 2).addStructureInfo("---------TAPPED MODE---------") - .addEnergyHatch("Touching Transformer-Winding Blocks", 3) - .addDynamoHatch("Touching Transformer-Winding Blocks", 3) - .addStructureInfo("Hatches touching Transformer-Winding Blocks must be tiered from bottom to top") - .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + tt.addMachineType("Transformer") + .addInfo("Controller block for the Manual Trafo") + .addInfo("Operates in 4 diffrent modes:") + .addInfo("Mode 1: Circuit 0 in controller: Direct-Upstep") + .addInfo("Mode 2: Circuit 1 in controller: Direct-Downstep") + .addInfo("Mode 3: Circuit 2 in controller: Tapped-Upstep (currently disabled)") + .addInfo("Mode 4: Circuit 2 in controller: Tapped-Downstep (currently disabled)") + .addSeparator() + .beginVariableStructureBlock(3, 3, 3, 10, 3, 3, false) + .addController("Front bottom center") + .addCasingInfoMin("MV Machine Casing", 0, false) + .addOtherStructurePart("Transformer-Winding Blocks", "1 Layer for each tier transformed") + .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Middle of Transformer-Winding Blocks") + .addMaintenanceHatch("Any bottom layer casing", 1) + .addEnergyHatch("Any bottom layer casing", 1) + .addDynamoHatch("Any top layer casing", 2) + .addStructureInfo("---------TAPPED MODE---------") + .addEnergyHatch("Touching Transformer-Winding Blocks", 3) + .addDynamoHatch("Touching Transformer-Winding Blocks", 3) + .addStructureInfo("Hatches touching Transformer-Winding Blocks must be tiered from bottom to top") + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -154,13 +161,15 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (!this.getBaseMetaTileEntity().isAllowedToWork()) this.stopMachine(); + if (!this.getBaseMetaTileEntity() + .isAllowedToWork()) this.stopMachine(); super.onPostTick(aBaseMetaTileEntity, aTick); } @Override public boolean onRunningTick(ItemStack aStack) { - if (!this.getBaseMetaTileEntity().isAllowedToWork()) { + if (!this.getBaseMetaTileEntity() + .isAllowedToWork()) { this.stopMachine(); return false; } @@ -168,16 +177,16 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl this.mProgresstime = 0; this.mMaxProgresstime = 1; - if (this.getBaseMetaTileEntity().getTimer() % 40 == 0) - if (this.mEfficiency < this.getMaxEfficiency(null)) this.mEfficiency += 100; - else this.mEfficiency = this.getMaxEfficiency(null); + if (this.getBaseMetaTileEntity() + .getTimer() % 40 == 0) if (this.mEfficiency < this.getMaxEfficiency(null)) this.mEfficiency += 100; + else this.mEfficiency = this.getMaxEfficiency(null); if (this.mode > 1) { return false; // this.onRunningTickTabbedMode(); Tapped mode is disable } return this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput( - this.getInputTier() * 2 * this.mEnergyHatches.size() * this.mEfficiency / this.getMaxEfficiency(null)); + this.getInputTier() * 2 * this.mEnergyHatches.size() * this.mEfficiency / this.getMaxEfficiency(null)); } public boolean onRunningTickTabbedMode() { @@ -201,39 +210,46 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl @Override public long getInputTier() { - if (this.mEnergyHatches.size() > 0) - return GT_Utility.getTier(this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); + if (this.mEnergyHatches.size() > 0) return GT_Utility.getTier( + this.mEnergyHatches.get(0) + .getBaseMetaTileEntity() + .getInputVoltage()); return 0L; } @Override public long getOutputTier() { - if (this.mDynamoHatches.size() > 0) - return GT_Utility.getTier(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); + if (this.mDynamoHatches.size() > 0) return GT_Utility.getTier( + this.mDynamoHatches.get(0) + .getBaseMetaTileEntity() + .getOutputVoltage()); return 0L; } @Override public boolean checkRecipe(ItemStack itemStack) { - if (!this.getBaseMetaTileEntity().isAllowedToWork()) { + if (!this.getBaseMetaTileEntity() + .isAllowedToWork()) { this.stopMachine(); return false; } - if (itemStack == null || !itemStack.getUnlocalizedName().startsWith("gt.integrated_circuit")) this.mode = 0; + if (itemStack == null || !itemStack.getUnlocalizedName() + .startsWith("gt.integrated_circuit")) this.mode = 0; else this.mode = (byte) Math.min(3, itemStack.getItemDamage()); this.upstep = this.mode % 2 == 0; this.mProgresstime = 0; this.mMaxProgresstime = 1; this.mEfficiency = Math.max(this.mEfficiency, 100); return this.upstep ? this.getOutputTier() - this.getInputTier() == this.mTiers - : this.getInputTier() - this.getOutputTier() == this.mTiers; + : this.getInputTier() - this.getOutputTier() == this.mTiers; } @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - if (itemStack == null || !itemStack.getUnlocalizedName().startsWith("gt.integrated_circuit")) this.mode = 0; + if (itemStack == null || !itemStack.getUnlocalizedName() + .startsWith("gt.integrated_circuit")) this.mode = 0; else this.mode = (byte) Math.min(3, itemStack.getItemDamage()); this.upstep = this.mode % 2 == 0; @@ -307,24 +323,35 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { + int aColorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).extFacing() - .glow().build() }; - return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW).extFacing().glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) }; } @Override public void construct(ItemStack itemStack, boolean b) { - if (this.mInventory[1] == null || !this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) - this.mode = 0; + if (this.mInventory[1] == null || !this.mInventory[1].getUnlocalizedName() + .startsWith("gt.integrated_circuit")) this.mode = 0; else this.mode = (byte) Math.min(3, this.mInventory[1].getItemDamage()); int mHeight = Math.min(itemStack.stackSize, 8); boolean tapmode = this.mode > 1; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 447f21281a..e7a2b090c9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -54,63 +54,51 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase private static final String STRUCTURE_PIECE_MAIN = "main"; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { - { " BBBBBBB ", " BBBBBBBBB ", "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", - "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", " BBBBBBBBB ", - " BBBBBBB " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", - "c---------c", "c---------c", "c---------c", "c---------c", " c-------c ", - " ccccccc " }, - { " bbb~bbb ", " bbbbbbbbb ", "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", - "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", " bbbbbbbbb ", - " bbbbbbb " }, })) - .addElement('c', onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12))) - .addElement( - 'b', - ofChain( - ofHatchAdder(GT_TileEntity_THTR::addOutputToMachineList, BASECASINGINDEX, 1), - ofHatchAdder(GT_TileEntity_THTR::addMaintenanceToMachineList, BASECASINGINDEX, 1), - ofHatchAdder(GT_TileEntity_THTR::addEnergyInputToMachineList, BASECASINGINDEX, 1), - onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12)))) - .addElement( - 'B', - ofChain( - ofHatchAdder(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2), - onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12)))) - // ofHatchAdderOptional(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2, - // GregTech_API.sBlockCasings3, 12)) - .build(); + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { + { " BBBBBBB ", " BBBBBBBBB ", "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", + "BBBBBBBBBBB", "BBBBBBBBBBB", "BBBBBBBBBBB", " BBBBBBBBB ", " BBBBBBB " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " ccccccc ", " c-------c ", "c---------c", "c---------c", "c---------c", "c---------c", + "c---------c", "c---------c", "c---------c", " c-------c ", " ccccccc " }, + { " bbb~bbb ", " bbbbbbbbb ", "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", + "bbbbbbbbbbb", "bbbbbbbbbbb", "bbbbbbbbbbb", " bbbbbbbbb ", " bbbbbbb " }, })) + .addElement('c', onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12))) + .addElement( + 'b', + ofChain( + ofHatchAdder(GT_TileEntity_THTR::addOutputToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_THTR::addMaintenanceToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_THTR::addEnergyInputToMachineList, BASECASINGINDEX, 1), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12)))) + .addElement( + 'B', + ofChain( + ofHatchAdder(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12)))) + // ofHatchAdderOptional(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2, + // GregTech_API.sBlockCasings3, 12)) + .build(); private static final int HELIUM_NEEDED = 730000; private static final int powerUsage = (int) TierEU.RECIPE_IV / 2; @@ -144,21 +132,27 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("High Temperature Reactor") - .addInfo("Controller block for the Thorium High Temperature Reactor (THTR)") - .addInfo("Needs to be primed with " + GT_Utility.formatNumbers(HELIUM_NEEDED) + " of helium") - .addInfo("Needs a constant supply of coolant while running") - .addInfo("Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles)") - .addInfo("Consumes up to 0.5% of total Fuel Pellets per Operation depending on efficiency") - .addInfo("Efficiency decreases exponentially if the internal buffer is not completely filled") - .addInfo("Reactor will take 4 800L/t of coolant multiplied by efficiency") - .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t") - .addInfo("One Operation takes 9 hours").addSeparator().beginStructureBlock(11, 12, 11, true) - .addController("Front bottom center").addCasingInfoMin("Radiation Proof Casings", 500, false) - .addStructureInfo("Corners and the 2 touching blocks are air (cylindric)") - .addInputBus("Any top layer casing", 2).addInputHatch("Any top layer casing", 2) - .addOutputBus("Any bottom layer casing", 1).addOutputHatch("Any bottom layer casing", 1) - .addEnergyHatch("Any bottom layer casing", 1).addMaintenanceHatch("Any bottom layer casing", 1) - .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + .addInfo("Controller block for the Thorium High Temperature Reactor (THTR)") + .addInfo("Needs to be primed with " + GT_Utility.formatNumbers(HELIUM_NEEDED) + " of helium") + .addInfo("Needs a constant supply of coolant while running") + .addInfo("Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles)") + .addInfo("Consumes up to 0.5% of total Fuel Pellets per Operation depending on efficiency") + .addInfo("Efficiency decreases exponentially if the internal buffer is not completely filled") + .addInfo("Reactor will take 4 800L/t of coolant multiplied by efficiency") + .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t") + .addInfo("One Operation takes 9 hours") + .addSeparator() + .beginStructureBlock(11, 12, 11, true) + .addController("Front bottom center") + .addCasingInfoMin("Radiation Proof Casings", 500, false) + .addStructureInfo("Corners and the 2 touching blocks are air (cylindric)") + .addInputBus("Any top layer casing", 2) + .addInputHatch("Any top layer casing", 2) + .addOutputBus("Any bottom layer casing", 1) + .addOutputHatch("Any bottom layer casing", 1) + .addEnergyHatch("Any bottom layer casing", 1) + .addMaintenanceHatch("Any bottom layer casing", 1) + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -176,12 +170,12 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { this.mCasing = 0; return this.checkPiece(STRUCTURE_PIECE_MAIN, 5, 11, 0) && this.mCasing >= 500 - && this.mMaintenanceHatches.size() == 1 - && this.mInputHatches.size() > 0 - && this.mOutputHatches.size() > 0 - && this.mInputBusses.size() > 0 - && this.mOutputBusses.size() > 0 - && this.mEnergyHatches.size() > 0; + && this.mMaintenanceHatches.size() == 1 + && this.mInputHatches.size() > 0 + && this.mOutputHatches.size() > 0 + && this.mInputBusses.size() > 0 + && this.mOutputBusses.size() > 0 + && this.mEnergyHatches.size() > 0; } @Override @@ -221,8 +215,8 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase this.startRecipeProcessing(); for (ItemStack itemStack : this.getStoredInputs()) { if (GT_Utility.areStacksEqual( - itemStack, - new ItemStack(THTRMaterials.aTHTR_Materials, 1, THTRMaterials.MATERIAL_FUEL_INDEX))) { + itemStack, + new ItemStack(THTRMaterials.aTHTR_Materials, 1, THTRMaterials.MATERIAL_FUEL_INDEX))) { int toget = Math.min(maxcapacity - this.fuelsupply, itemStack.stackSize); if (toget == 0) continue; itemStack.stackSize -= toget; @@ -249,8 +243,8 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase if (this.HeliumSupply < GT_TileEntity_THTR.HELIUM_NEEDED || this.fuelsupply < mincapacity) return false; double eff = Math - .min(Math.pow((this.fuelsupply - mincapacity) / ((maxcapacity - mincapacity) / 10D), 2D) + 1, 100D) - / 100D - (this.getIdealStatus() - this.getRepairStatus()) / 10D; + .min(Math.pow((this.fuelsupply - mincapacity) / ((maxcapacity - mincapacity) / 10D), 2D) + 1, 100D) / 100D + - (this.getIdealStatus() - this.getRepairStatus()) / 10D; if (eff <= 0D) return false; int toReduce = MathUtils.floorInt(this.fuelsupply * 0.005D * eff); @@ -262,7 +256,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase int meta = THTRMaterials.MATERIAL_USED_FUEL_INDEX; ItemStack[] toOutput = { new ItemStack(THTRMaterials.aTHTR_Materials, burnedballs, meta), - new ItemStack(THTRMaterials.aTHTR_Materials, toReduce, meta + 1) }; + new ItemStack(THTRMaterials.aTHTR_Materials, toReduce, meta + 1) }; if (!this.canOutputAll(toOutput)) return false; this.fuelsupply -= originalToReduce; @@ -283,7 +277,7 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase if (this.empty) { this.addOutput(Materials.Helium.getGas(this.HeliumSupply)); this.addOutput( - new ItemStack(THTRMaterials.aTHTR_Materials, this.fuelsupply, THTRMaterials.MATERIAL_FUEL_INDEX)); + new ItemStack(THTRMaterials.aTHTR_Materials, this.fuelsupply, THTRMaterials.MATERIAL_FUEL_INDEX)); this.HeliumSupply = 0; this.fuelsupply = 0; this.updateSlots(); @@ -340,36 +334,43 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public String[] getInfoData() { return new String[] { "Progress:", - GT_Utility.formatNumbers(this.mProgresstime / 20) + "secs /" - + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) - + "secs", - "TRISO-Pebbles:", - GT_Utility.formatNumbers(this.fuelsupply) + "pcs. / " - + GT_Utility.formatNumbers(this.fuelsupply) - + "psc.", - "Helium-Level:", - GT_Utility.formatNumbers(this.HeliumSupply) + "L / " - + GT_Utility.formatNumbers(GT_TileEntity_THTR.HELIUM_NEEDED) - + "L", - "Coolant/t:", GT_Utility.formatNumbers(this.mProgresstime == 0 ? 0 : this.coolanttaking) + "L/t", - "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; + GT_Utility.formatNumbers(this.mProgresstime / 20) + "secs /" + + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + + "secs", + "TRISO-Pebbles:", + GT_Utility.formatNumbers(this.fuelsupply) + "pcs. / " + GT_Utility.formatNumbers(this.fuelsupply) + "psc.", + "Helium-Level:", + GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + + GT_Utility.formatNumbers(GT_TileEntity_THTR.HELIUM_NEEDED) + + "L", + "Coolant/t:", GT_Utility.formatNumbers(this.mProgresstime == 0 ? 0 : this.coolanttaking) + "L/t", + "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { + int aColorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { - if (aActive) - return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) - .extFacing().build(), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW) - .extFacing().glow().build() }; + if (aActive) return new ITexture[] { + Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER).extFacing() - .build(), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).extFacing() - .glow().build() }; + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX) }; } @@ -382,8 +383,8 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase } this.empty = !this.empty; GT_Utility.sendChatToPlayer( - aPlayer, - "THTR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); + aPlayer, + "THTR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); } @Override @@ -394,13 +395,13 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase public static class THTRMaterials { public static final SimpleSubItemClass aTHTR_Materials = new SimpleSubItemClass( - "BISOPelletCompound", // 0 - "BISOPelletBall", // 1 - "TRISOPelletCompound", // 2 - "TRISOPelletBall", // 3 - "TRISOPellet", // 4 - "BurnedOutTRISOPelletBall", // 5 - "BurnedOutTRISOPellet" // 6 + "BISOPelletCompound", // 0 + "BISOPelletBall", // 1 + "TRISOPelletCompound", // 2 + "TRISOPelletBall", // 3 + "TRISOPellet", // 4 + "BurnedOutTRISOPelletBall", // 5 + "BurnedOutTRISOPellet" // 6 ); public static final int MATERIAL_FUEL_INDEX = 4; public static final int MATERIAL_USED_FUEL_INDEX = 5; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 93ccdecd6c..a1e1f1fd46 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -85,7 +85,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlockBase - implements ISurvivalConstructable, IGetTitleColor { + implements ISurvivalConstructable, IGetTitleColor { private static final IIcon[] iIcons = new IIcon[2]; private static final IIconContainer[] iIconContainers = new IIconContainer[2]; @@ -106,75 +106,72 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock private static final String STRUCTURE_PIECE_MAIN = "main"; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { - { " ", " ", " ", " p ", " ", " ", " " }, - { " ", " ", " ppp ", " p p ", " ppp ", " ", " " }, - { " ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " " }, - { " ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp " }, - { " ppspp ", "p p", "p p", "p p", "p p", "p p", " ppppp " }, - { " ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp " }, - { " ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " " }, - { " ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " " }, - { " ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " " }, - { " ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " " }, - { " ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " " }, - { " bb~bb ", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", " bbbbb " }, })) - .addElement('p', ofBlockAnyMeta(Blocks.planks)) - .addElement( - 'c', - ofChain( - onElementPass(t -> t.mHardenedClay++, ofBlock(Blocks.hardened_clay, 0)), - ofTileAdder(GT_TileEntity_Windmill::addDispenserToOutputSet, Blocks.hardened_clay, 0), - onElementPass(t -> t.mDoor++, new IStructureElementNoPlacement() { - - private final IStructureElement delegate = ofBlock( - Blocks.wooden_door, - 0); - - @Override - public boolean check(GT_TileEntity_Windmill gt_tileEntity_windmill, World world, int x, - int y, int z) { - return this.delegate.check(gt_tileEntity_windmill, world, x, y, z); - } - - @Override - public boolean spawnHint(GT_TileEntity_Windmill gt_tileEntity_windmill, World world, - int x, int y, int z, ItemStack trigger) { - return this.delegate.spawnHint(gt_tileEntity_windmill, world, x, y, z, trigger); - } - }))) - .addElement('b', ofBlock(Blocks.brick_block, 0)) - .addElement('s', new IStructureElement() { + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { " ", " ", " ", " p ", " ", " ", " " }, + { " ", " ", " ppp ", " p p ", " ppp ", " ", " " }, + { " ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " " }, + { " ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp " }, + { " ppspp ", "p p", "p p", "p p", "p p", "p p", " ppppp " }, + { " ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp " }, + { " ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " " }, + { " ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " " }, + { " ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " " }, + { " ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " " }, + { " ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " " }, + { " bb~bb ", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", " bbbbb " }, })) + .addElement('p', ofBlockAnyMeta(Blocks.planks)) + .addElement( + 'c', + ofChain( + onElementPass(t -> t.mHardenedClay++, ofBlock(Blocks.hardened_clay, 0)), + ofTileAdder(GT_TileEntity_Windmill::addDispenserToOutputSet, Blocks.hardened_clay, 0), + onElementPass(t -> t.mDoor++, new IStructureElementNoPlacement() { + + private final IStructureElement delegate = ofBlock(Blocks.wooden_door, 0); - @Override - public boolean check(GT_TileEntity_Windmill t, World world, int x, int y, int z) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - return t.setRotorBlock(tileEntity); - } - - @Override - public boolean spawnHint(GT_TileEntity_Windmill t, World world, int x, int y, int z, - ItemStack trigger) { - StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 0); - return true; - } + @Override + public boolean check(GT_TileEntity_Windmill gt_tileEntity_windmill, World world, int x, int y, + int z) { + return this.delegate.check(gt_tileEntity_windmill, world, x, y, z); + } - @Override - public boolean placeBlock(GT_TileEntity_Windmill gt_tileEntity_windmill, World world, int x, int y, + @Override + public boolean spawnHint(GT_TileEntity_Windmill gt_tileEntity_windmill, World world, int x, int y, int z, ItemStack trigger) { - return false; - } + return this.delegate.spawnHint(gt_tileEntity_windmill, world, x, y, z, trigger); + } + }))) + .addElement('b', ofBlock(Blocks.brick_block, 0)) + .addElement('s', new IStructureElement() { - @Override - public BlocksToPlace getBlocksToPlace(GT_TileEntity_Windmill gt_tileEntity_windmill, World world, int x, - int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { - return BlocksToPlace.create(new ItemStack(ItemRegistry.ROTORBLOCK)); - } - }).build(); + @Override + public boolean check(GT_TileEntity_Windmill t, World world, int x, int y, int z) { + TileEntity tileEntity = world.getTileEntity(x, y, z); + return t.setRotorBlock(tileEntity); + } + + @Override + public boolean spawnHint(GT_TileEntity_Windmill t, World world, int x, int y, int z, ItemStack trigger) { + StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 0); + return true; + } + + @Override + public boolean placeBlock(GT_TileEntity_Windmill gt_tileEntity_windmill, World world, int x, int y, int z, + ItemStack trigger) { + return false; + } + + @Override + public BlocksToPlace getBlocksToPlace(GT_TileEntity_Windmill gt_tileEntity_windmill, World world, int x, + int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { + return BlocksToPlace.create(new ItemStack(ItemRegistry.ROTORBLOCK)); + } + }) + .build(); @Override public IStructureDefinition getStructureDefinition() { @@ -189,17 +186,22 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Windmill").addInfo("Controller block for the Windmill") - .addInfo("A primitive Grinder powered by Kinetic energy") - .addInfo("Speed and output will be affected by wind speed, recipe and rotor") - .addInfo("Please use the Primitive Rotor").addInfo("Macerates 16 items at a time") - .addInfo("The structure is too complex!") - .addInfo("Follow the StructureLib hologram projector to build the main structure.").addSeparator() - .beginStructureBlock(7, 12, 7, false).addController("Front bottom center") - .addCasingInfoMin("Hardened Clay block", 40, false) - .addOtherStructurePart("Dispenser", "Any Hardened Clay block") - .addOtherStructurePart("0-1 Wooden door", "Any Hardened Clay block") - .addStructureHint("Primitive Kinetic Shaftbox", 1).toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + tt.addMachineType("Windmill") + .addInfo("Controller block for the Windmill") + .addInfo("A primitive Grinder powered by Kinetic energy") + .addInfo("Speed and output will be affected by wind speed, recipe and rotor") + .addInfo("Please use the Primitive Rotor") + .addInfo("Macerates 16 items at a time") + .addInfo("The structure is too complex!") + .addInfo("Follow the StructureLib hologram projector to build the main structure.") + .addSeparator() + .beginStructureBlock(7, 12, 7, false) + .addController("Front bottom center") + .addCasingInfoMin("Hardened Clay block", 40, false) + .addOtherStructurePart("Dispenser", "Any Hardened Clay block") + .addOtherStructurePart("0-1 Wooden door", "Any Hardened Clay block") + .addStructureHint("Primitive Kinetic Shaftbox", 1) + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -219,7 +221,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { + ItemStack aStack) { return true; } @@ -239,40 +241,40 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock return new float[] { 0.8f, 1f }; } if (block == Blocks.gravel || block == Blocks.cobblestone - || block == Blocks.stone - || block == Blocks.sandstone - || block == Blocks.clay - || block == Blocks.hardened_clay - || block == Blocks.stained_hardened_clay - || block == Blocks.wool - || block == Blocks.netherrack - || block == Blocks.log - || block == Blocks.log2) { + || block == Blocks.stone + || block == Blocks.sandstone + || block == Blocks.clay + || block == Blocks.hardened_clay + || block == Blocks.stained_hardened_clay + || block == Blocks.wool + || block == Blocks.netherrack + || block == Blocks.log + || block == Blocks.log2) { return new float[] { 1f, 1.5f }; } final ItemData association = GT_OreDictUnificator.getAssociation(itemStack); final OrePrefixes prefix = association == null ? null : association.mPrefix; if (prefix == null || association.mMaterial == null - || association.mMaterial.mMaterial == null - || association.mMaterial.mMaterial.getDust(1) == null) { + || association.mMaterial.mMaterial == null + || association.mMaterial.mMaterial.getDust(1) == null) { return new float[] { 1f, 1f }; } if (OrePrefixes.ore == prefix || OrePrefixes.oreNetherrack == prefix - || OrePrefixes.oreEndstone == prefix - || OrePrefixes.oreBlackgranite == prefix - || OrePrefixes.oreRedgranite == prefix - || OrePrefixes.oreMarble == prefix - || OrePrefixes.oreBasalt == prefix) { + || OrePrefixes.oreEndstone == prefix + || OrePrefixes.oreBlackgranite == prefix + || OrePrefixes.oreRedgranite == prefix + || OrePrefixes.oreMarble == prefix + || OrePrefixes.oreBasalt == prefix) { return new float[] { 0.5f, 1f }; } if (OrePrefixes.stone == prefix || OrePrefixes.stoneBricks == prefix - || OrePrefixes.stoneChiseled == prefix - || OrePrefixes.stoneCobble == prefix - || OrePrefixes.stoneCracked == prefix - || OrePrefixes.stoneMossy == prefix - || OrePrefixes.stoneMossyBricks == prefix - || OrePrefixes.stoneSmooth == prefix - || OrePrefixes.cobblestone == prefix) { + || OrePrefixes.stoneChiseled == prefix + || OrePrefixes.stoneCobble == prefix + || OrePrefixes.stoneCracked == prefix + || OrePrefixes.stoneMossy == prefix + || OrePrefixes.stoneMossyBricks == prefix + || OrePrefixes.stoneSmooth == prefix + || OrePrefixes.cobblestone == prefix) { return new float[] { 1f, 1.5f }; } return new float[] { 1f, 1f }; @@ -285,7 +287,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock if (this.mOutputItems == null) this.mOutputItems = new ItemStack[2]; GT_Recipe tRecipe = RecipeMaps.maceratorRecipes - .findRecipe(this.getBaseMetaTileEntity(), false, false, V[1], null, itemStack); + .findRecipe(this.getBaseMetaTileEntity(), false, false, V[1], null, itemStack); if (tRecipe == null) { return false; } @@ -302,12 +304,12 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock this.mOutputItems[0] = tRecipe.getOutput(0); float[] mRecipe = this.multiplierRecipe(itemStack); float multiper = Math.min( - mRecipe[1], - Math.max( - mRecipe[0], - 2f * (float) Math.sqrt((float) 1 / (this.rotorBlock.getWindStrength() + 1)) - * this.OutputMultiplier(this.rotorBlock) - * (mRecipe[0] + mRecipe[1]))); + mRecipe[1], + Math.max( + mRecipe[0], + 2f * (float) Math.sqrt((float) 1 / (this.rotorBlock.getWindStrength() + 1)) + * this.OutputMultiplier(this.rotorBlock) + * (mRecipe[0] + mRecipe[1]))); int amount = (int) Math.floor(multiper * (this.mOutputItems[0].stackSize * this.mMulti)); // Split ItemStack --by gtpp @@ -330,7 +332,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public void stopMachine() { - this.getBaseMetaTileEntity().disableWorking(); + this.getBaseMetaTileEntity() + .disableWorking(); } public boolean addDispenserToOutputSet(TileEntity aTileEntity) { @@ -356,9 +359,10 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock for (TileEntityDispenser tHatch : this.tileEntityDispensers) { for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) { if (tHatch.getStackInSlot(i) == null || GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack) - && aStack.stackSize + tHatch.getStackInSlot(i).stackSize <= 64) { + && aStack.stackSize + tHatch.getStackInSlot(i).stackSize <= 64) { if (GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack)) { - ItemStack merge = tHatch.getStackInSlot(i).copy(); + ItemStack merge = tHatch.getStackInSlot(i) + .copy(); merge.stackSize = aStack.stackSize + tHatch.getStackInSlot(i).stackSize; tHatch.setInventorySlotContents(i, merge); } else { @@ -386,9 +390,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock this.mHardenedClay = 0; if (!this.checkPiece(STRUCTURE_PIECE_MAIN, 3, 11, 0) || this.tileEntityDispensers.isEmpty() - || this.mDoor > 2 - || this.mHardenedClay < 40) - return false; + || this.mDoor > 2 + || this.mHardenedClay < 40) return false; this.mWrench = true; this.mScrewdriver = true; @@ -440,8 +443,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public String[] getInfoData() { return new String[] { "Progress:", - this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", - this.rotorBlock.getGrindPower() + "KU/t" }; + this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", + this.rotorBlock.getGrindPower() + "KU/t" }; } @SideOnly(Side.CLIENT) @@ -488,7 +491,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { + int aColorIndex, boolean aActive, boolean aRedstone) { ITexture[] ret = new ITexture[6]; @@ -509,10 +512,16 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock } public boolean isClientSide() { - if (this.getBaseMetaTileEntity().getWorld() != null) return this.getBaseMetaTileEntity().getWorld().isRemote - ? FMLCommonHandler.instance().getSide() == Side.CLIENT - : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; - return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; + if (this.getBaseMetaTileEntity() + .getWorld() != null) + return this.getBaseMetaTileEntity() + .getWorld().isRemote + ? FMLCommonHandler.instance() + .getSide() == Side.CLIENT + : FMLCommonHandler.instance() + .getEffectiveSide() == Side.CLIENT; + return FMLCommonHandler.instance() + .getEffectiveSide() == Side.CLIENT; } @Override @@ -528,7 +537,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock public float OutputMultiplier(BW_RotorBlock rotorBlock) { try { - return ((BW_Stonage_Rotors) rotorBlock.rotorSlot.get().getItem()).getmRotor(); + return ((BW_Stonage_Rotors) rotorBlock.rotorSlot.get() + .getItem()).getmRotor(); } catch (Exception e) { return 1f; } @@ -536,7 +546,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock public int getSpeed(BW_RotorBlock rotorBlock) { try { - return ((BW_Stonage_Rotors) rotorBlock.rotorSlot.get().getItem()).getSpeed(); + return ((BW_Stonage_Rotors) rotorBlock.rotorSlot.get() + .getItem()).getSpeed(); } catch (Exception e) { return 1; } @@ -544,8 +555,8 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock public void setRotorDamage(BW_RotorBlock rotorBlock, int damage) { try { - ((BW_Stonage_Rotors) rotorBlock.rotorSlot.get().getItem()) - .damageItemStack(rotorBlock.rotorSlot.get(), damage); + ((BW_Stonage_Rotors) rotorBlock.rotorSlot.get() + .getItem()).damageItemStack(rotorBlock.rotorSlot.get(), damage); } catch (Exception e) { rotorBlock.rotorSlot.damage(damage, false); } @@ -554,16 +565,19 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public GUITextureSet getGUITextureSet() { return new GUITextureSet().setMainBackground(BW_UITextures.BACKGROUND_BROWN) - .setItemSlot(BW_UITextures.SLOT_BROWN).setTitleTab( - BW_UITextures.TAB_TITLE_BROWN, - BW_UITextures.TAB_TITLE_DARK_BROWN, - BW_UITextures.TAB_TITLE_ANGULAR_BROWN); + .setItemSlot(BW_UITextures.SLOT_BROWN) + .setTitleTab( + BW_UITextures.TAB_TITLE_BROWN, + BW_UITextures.TAB_TITLE_DARK_BROWN, + BW_UITextures.TAB_TITLE_ANGULAR_BROWN); } @Override public void addGregTechLogo(ModularWindow.Builder builder) { builder.widget( - new DrawableWidget().setDrawable(BW_UITextures.PICTURE_BW_LOGO_47X21).setSize(47, 21).setPos(123, 59)); + new DrawableWidget().setDrawable(BW_UITextures.PICTURE_BW_LOGO_47X21) + .setSize(47, 21) + .setPos(123, 59)); } @Override @@ -574,51 +588,54 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new SlotWidget(this.inventoryHandler, 1).setBackground(this.getGUITextureSet().getItemSlot()) - .setPos(59, 35)) - .widget(new DrawableWidget() { + new SlotWidget(this.inventoryHandler, 1).setBackground( + this.getGUITextureSet() + .getItemSlot()) + .setPos(59, 35)) + .widget(new DrawableWidget() { - private static final int DIVIDER = 125; + private static final int DIVIDER = 125; - @Override - public void onScreenUpdate() { - super.onScreenUpdate(); - if (GT_TileEntity_Windmill.this.mMaxProgresstime > 0) { - if (System.currentTimeMillis() / DIVIDER % 40 == 30) - this.setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[3]); - else if (System.currentTimeMillis() / DIVIDER % 40 == 20) - this.setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[2]); - else if (System.currentTimeMillis() / DIVIDER % 40 == 10) - this.setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[1]); - else if (System.currentTimeMillis() / DIVIDER % 40 == 0) - this.setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[0]); - } else { - this.setDrawable(BW_UITextures.PICTURE_WINDMILL_EMPTY); - } + @Override + public void onScreenUpdate() { + super.onScreenUpdate(); + if (GT_TileEntity_Windmill.this.mMaxProgresstime > 0) { + if (System.currentTimeMillis() / DIVIDER % 40 == 30) + this.setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[3]); + else if (System.currentTimeMillis() / DIVIDER % 40 == 20) + this.setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[2]); + else if (System.currentTimeMillis() / DIVIDER % 40 == 10) + this.setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[1]); + else if (System.currentTimeMillis() / DIVIDER % 40 == 0) + this.setDrawable(BW_UITextures.PICTURE_WINDMILL_ROTATING[0]); + } else { + this.setDrawable(BW_UITextures.PICTURE_WINDMILL_EMPTY); } - }.setDrawable(BW_UITextures.PICTURE_WINDMILL_EMPTY).setPos(85, 27).setSize(32, 32)) - .widget( - new FakeSyncWidget.IntegerSyncer( - () -> this.mMaxProgresstime, - val -> this.mMaxProgresstime = val)) - .widget( - new ItemDrawable( - () -> this.mMachine && !this.getBaseMetaTileEntity().isActive() - ? GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SOFTMALLET, - 1, - null, - null, - null) - : null).asWidget().setPos(66, 66)) - .widget( - new FakeSyncWidget.BooleanSyncer( - () -> this.getBaseMetaTileEntity().isActive(), - val -> this.getBaseMetaTileEntity().setActive(val))) - .widget( - new TextWidget(GT_Utility.trans("138", "Incomplete Structure.")) - .setDefaultColor(this.COLOR_TEXT_WHITE.get()).setMaxWidth(150) - .setEnabled(widget -> !this.mMachine).setPos(92, 22)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> this.mMachine, val -> this.mMachine = val)); + } + }.setDrawable(BW_UITextures.PICTURE_WINDMILL_EMPTY) + .setPos(85, 27) + .setSize(32, 32)) + .widget(new FakeSyncWidget.IntegerSyncer(() -> this.mMaxProgresstime, val -> this.mMaxProgresstime = val)) + .widget( + new ItemDrawable( + () -> this.mMachine && !this.getBaseMetaTileEntity() + .isActive() + ? GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(GT_MetaGenerated_Tool_01.SOFTMALLET, 1, null, null, null) + : null).asWidget() + .setPos(66, 66)) + .widget( + new FakeSyncWidget.BooleanSyncer( + () -> this.getBaseMetaTileEntity() + .isActive(), + val -> this.getBaseMetaTileEntity() + .setActive(val))) + .widget( + new TextWidget(GT_Utility.trans("138", "Incomplete Structure.")) + .setDefaultColor(this.COLOR_TEXT_WHITE.get()) + .setMaxWidth(150) + .setEnabled(widget -> !this.mMachine) + .setPos(92, 22)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> this.mMachine, val -> this.mMachine = val)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index fc490d6109..c8ea85d182 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -70,43 +70,42 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlockBase - implements ISurvivalConstructable { + implements ISurvivalConstructable { private static final int CASING_INDEX = 11; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder().addShape("main", createShape()) - .addElement('=', StructureElementAirNoHint.getInstance()) - .addElement( - 't', - buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) - .atLeast( - OutputHatch.withAdder(GT_TileEntity_MegaBlastFurnace::addOutputHatchToTopList) - .withCount(t -> t.mPollutionOutputHatches.size())) - .casingIndex(CASING_INDEX).dot(1).buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX)) - .addElement('m', Muffler.newAny(CASING_INDEX, 2)) - .addElement( - 'C', - withChannel( - "coil", - ofCoil( - GT_TileEntity_MegaBlastFurnace::setCoilLevel, - GT_TileEntity_MegaBlastFurnace::getCoilLevel))) - .addElement( - 'g', - withChannel( - "glass", - BorosilicateGlass.ofBoroGlass( - (byte) 0, - (byte) 1, - Byte.MAX_VALUE, - (te, t) -> te.glassTier = t, - te -> te.glassTier))) - .addElement( - 'b', - buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) - .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, Energy.or(ExoticEnergy)) - .casingIndex(CASING_INDEX).dot(1).buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX)) - .build(); + .builder() + .addShape("main", createShape()) + .addElement('=', StructureElementAirNoHint.getInstance()) + .addElement( + 't', + buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) + .atLeast( + OutputHatch.withAdder(GT_TileEntity_MegaBlastFurnace::addOutputHatchToTopList) + .withCount(t -> t.mPollutionOutputHatches.size())) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX)) + .addElement('m', Muffler.newAny(CASING_INDEX, 2)) + .addElement( + 'C', + withChannel( + "coil", + ofCoil(GT_TileEntity_MegaBlastFurnace::setCoilLevel, GT_TileEntity_MegaBlastFurnace::getCoilLevel))) + .addElement( + 'g', + withChannel( + "glass", + BorosilicateGlass + .ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glassTier = t, te -> te.glassTier))) + .addElement( + 'b', + buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) + .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, Energy.or(ExoticEnergy)) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX)) + .build(); private static String[][] createShape() { String[][] raw = new String[20][]; @@ -149,7 +148,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock private HeatingCoilLevel mCoilLevel; protected final ArrayList mPollutionOutputHatches = new ArrayList<>(); protected final FluidStack[] pollutionFluidStacks = { Materials.CarbonDioxide.getGas(1000), - Materials.CarbonMonoxide.getGas(1000), Materials.SulfurDioxide.getGas(1000) }; + Materials.CarbonMonoxide.getGas(1000), Materials.SulfurDioxide.getGas(1000) }; private int mHeatingCapacity; private byte glassTier; private final static int polPtick = ConfigHandler.basePollutionMBFSecond / 20 * ConfigHandler.megaMachinesMax; @@ -170,27 +169,32 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Blast Furnace").addInfo("Controller block for the Mega Blast Furnace") - .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") - .addInfo("Each 900K over the min. Heat required reduces power consumption by 5% (multiplicatively)") - .addInfo("Each 1800K over the min. Heat allows for an overclock to be upgraded to a perfect overclock.") - .addInfo( - "That means the EBF will reduce recipe time by a factor 4 instead of 2 (giving 100% efficiency).") - .addInfo("Additionally gives +100K for every tier past MV") - .addPollutionAmount(20 * this.getPollutionPerTick(null)).addSeparator() - .beginStructureBlock(15, 20, 15, true).addController("3rd layer center") - .addCasingInfoRange("Heat Proof Machine Casing", 0, 279, false) - .addOtherStructurePart("864x Heating Coils", "Inner 13x18x13 (Hollow)") - .addOtherStructurePart("1007x Borosilicate Glass", "Outer 15x18x15") - .addStructureInfo("The glass tier limits the Energy Input tier") - .addEnergyHatch("Any bottom layer casing").addMaintenanceHatch("Any bottom layer casing") - .addMufflerHatch("Top middle").addInputBus("Any bottom layer casing") - .addInputHatch("Any bottom layer casing").addOutputBus("Any bottom layer casing") - .addOutputHatch("Gasses, Any top layer casing") - .addStructureInfo("Recovery amount scales with Muffler Hatch tier") - .addOutputHatch("Platline fluids, Any bottom layer casing") - .addStructureHint("This Mega Multiblock is too big to have its structure hologram displayed fully.") - .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); + tt.addMachineType("Blast Furnace") + .addInfo("Controller block for the Mega Blast Furnace") + .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") + .addInfo("Each 900K over the min. Heat required reduces power consumption by 5% (multiplicatively)") + .addInfo("Each 1800K over the min. Heat allows for an overclock to be upgraded to a perfect overclock.") + .addInfo("That means the EBF will reduce recipe time by a factor 4 instead of 2 (giving 100% efficiency).") + .addInfo("Additionally gives +100K for every tier past MV") + .addPollutionAmount(20 * this.getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(15, 20, 15, true) + .addController("3rd layer center") + .addCasingInfoRange("Heat Proof Machine Casing", 0, 279, false) + .addOtherStructurePart("864x Heating Coils", "Inner 13x18x13 (Hollow)") + .addOtherStructurePart("1007x Borosilicate Glass", "Outer 15x18x15") + .addStructureInfo("The glass tier limits the Energy Input tier") + .addEnergyHatch("Any bottom layer casing") + .addMaintenanceHatch("Any bottom layer casing") + .addMufflerHatch("Top middle") + .addInputBus("Any bottom layer casing") + .addInputHatch("Any bottom layer casing") + .addOutputBus("Any bottom layer casing") + .addOutputHatch("Gasses, Any top layer casing") + .addStructureInfo("Recovery amount scales with Muffler Hatch tier") + .addOutputHatch("Platline fluids, Any bottom layer casing") + .addStructureHint("This Mega Multiblock is too big to have its structure hologram displayed fully.") + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); return tt; } @@ -208,12 +212,12 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ) { if (!aPlayer.isSneaking()) { this.inputSeparation = !this.inputSeparation; GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + this.inputSeparation); + aPlayer, + StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + this.inputSeparation); return true; } this.batchMode = !this.batchMode; @@ -227,16 +231,26 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { + int aColorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { - if (aActive) return new ITexture[] { casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).extFacing() - .glow().build() }; - return new ITexture[] { casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW).extFacing().glow() - .build() }; + if (aActive) return new ITexture[] { casingTexturePages[0][CASING_INDEX], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; + return new ITexture[] { casingTexturePages[0][CASING_INDEX], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { casingTexturePages[0][CASING_INDEX] }; } @@ -266,10 +280,10 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override protected String[] getExtendedInfoData() { return new String[] { StatCollector.translateToLocal("GT5U.EBF.heat") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(this.mHeatingCapacity) - + EnumChatFormatting.RESET - + " K" }; + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(this.mHeatingCapacity) + + EnumChatFormatting.RESET + + " K" }; } @Override @@ -280,15 +294,16 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override protected GT_OverclockCalculator createOverclockCalculator(@Nonnull GT_Recipe recipe) { return super.createOverclockCalculator(recipe).setRecipeHeat(recipe.mSpecialValue) - .setMachineHeat(GT_TileEntity_MegaBlastFurnace.this.mHeatingCapacity).setHeatOC(true) - .setHeatDiscount(true); + .setMachineHeat(GT_TileEntity_MegaBlastFurnace.this.mHeatingCapacity) + .setHeatOC(true) + .setHeatDiscount(true); } @Override protected @Nonnull CheckRecipeResult validateRecipe(@Nonnull GT_Recipe recipe) { return recipe.mSpecialValue <= GT_TileEntity_MegaBlastFurnace.this.mHeatingCapacity - ? CheckRecipeResultRegistry.SUCCESSFUL - : CheckRecipeResultRegistry.insufficientHeat(recipe.mSpecialValue); + ? CheckRecipeResultRegistry.SUCCESSFUL + : CheckRecipeResultRegistry.insufficientHeat(recipe.mSpecialValue); } }.setMaxParallel(ConfigHandler.megaMachinesMax); } @@ -361,8 +376,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock this.mPollutionOutputHatches.clear(); if (!this.checkPiece("main", 7, 17, 0) || this.getCoilLevel() == HeatingCoilLevel.None - || this.mMaintenanceHatches.size() != 1) - return false; + || this.mMaintenanceHatches.size() != 1) return false; if (this.glassTier < 8) { for (int i = 0; i < this.mExoticEnergyHatches.size(); ++i) { @@ -381,7 +395,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock } } - this.mHeatingCapacity = (int) this.getCoilLevel().getHeat() + 100 * (BW_Util.getTier(this.getMaxInputEu()) - 2); + this.mHeatingCapacity = (int) this.getCoilLevel() + .getHeat() + 100 * (BW_Util.getTier(this.getMaxInputEu()) - 2); return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index f7aaffef09..4b11f8d500 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -52,7 +52,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; public class GT_TileEntity_MegaChemicalReactor - extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { + extends GT_TileEntity_MegaMultiBlockBase implements ISurvivalConstructable { private byte glassTier; @@ -67,18 +67,27 @@ public class GT_TileEntity_MegaChemicalReactor @Override public GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Chemical Reactor").addInfo("Controller block for the Chemical Reactor") - .addInfo("What molecule do you want to synthesize") - .addInfo("Or you want to replace something in this molecule").addInfo("The structure is too complex!") - .addInfo("Follow the Structure Lib hologram projector to build the main structure.").addSeparator() - .beginStructureBlock(5, 5, 9, false).addController("Front center") - .addStructureInfo("46x Chemically Inert Machine Casing (minimum)") - .addStructureInfo("7x Fusion Coil Block").addStructureInfo("28x PTFE Pipe Casing") - .addStructureInfo("64x Borosilicate Glass Block (any tier)") - .addStructureInfo("The glass tier limits the Energy Input tier").addEnergyHatch("Hint block ", 3) - .addMaintenanceHatch("Hint block ", 2).addInputHatch("Hint block ", 1).addInputBus("Hint block ", 1) - .addOutputBus("Hint block ", 1).addOutputHatch("Hint block ", 1) - .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + tt.addMachineType("Chemical Reactor") + .addInfo("Controller block for the Chemical Reactor") + .addInfo("What molecule do you want to synthesize") + .addInfo("Or you want to replace something in this molecule") + .addInfo("The structure is too complex!") + .addInfo("Follow the Structure Lib hologram projector to build the main structure.") + .addSeparator() + .beginStructureBlock(5, 5, 9, false) + .addController("Front center") + .addStructureInfo("46x Chemically Inert Machine Casing (minimum)") + .addStructureInfo("7x Fusion Coil Block") + .addStructureInfo("28x PTFE Pipe Casing") + .addStructureInfo("64x Borosilicate Glass Block (any tier)") + .addStructureInfo("The glass tier limits the Energy Input tier") + .addEnergyHatch("Hint block ", 3) + .addMaintenanceHatch("Hint block ", 2) + .addInputHatch("Hint block ", 1) + .addInputBus("Hint block ", 1) + .addOutputBus("Hint block ", 1) + .addOutputHatch("Hint block ", 1) + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -89,16 +98,26 @@ public class GT_TileEntity_MegaChemicalReactor @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { + int aColorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { - if (aActive) return new ITexture[] { casingTexturePages[1][48], - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW).extFacing() - .glow().build() }; - return new ITexture[] { casingTexturePages[1][48], - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW).extFacing().glow() - .build() }; + if (aActive) return new ITexture[] { casingTexturePages[1][48], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; + return new ITexture[] { casingTexturePages[1][48], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { casingTexturePages[1][48] }; } @@ -125,13 +144,13 @@ public class GT_TileEntity_MegaChemicalReactor public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { inputSeparation = !inputSeparation; GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); + aPlayer, + StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); } @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { this.batchMode = !this.batchMode; if (this.batchMode) { @@ -146,7 +165,8 @@ public class GT_TileEntity_MegaChemicalReactor @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().enablePerfectOverclock().setMaxParallel(ConfigHandler.megaMachinesMax); + return new ProcessingLogic().enablePerfectOverclock() + .setMaxParallel(ConfigHandler.megaMachinesMax); } @Override @@ -159,7 +179,7 @@ public class GT_TileEntity_MegaChemicalReactor if (this.mMachine) return -1; int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); return this - .survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 2, 2, 0, realBudget, source, actor, false, true); + .survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 2, 2, 0, realBudget, source, actor, false, true); } // -------------- TEC TECH COMPAT ---------------- @@ -192,40 +212,38 @@ public class GT_TileEntity_MegaChemicalReactor private static final int CASING_INDEX = 176; private static final String STRUCTURE_PIECE_MAIN = "main"; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { - { "ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "ttttt" }, - { "tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet" }, - { "tg~gt", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", "teret" }, - { "tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet" }, - { "ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", - "ttttt" }, })) - .addElement('p', ofBlock(GregTech_API.sBlockCasings8, 1)) - .addElement('t', ofBlock(GregTech_API.sBlockCasings8, 0)) - .addElement( - 'd', - buildHatchAdder(GT_TileEntity_MegaChemicalReactor.class) - .atLeast(InputBus, InputHatch, OutputBus, OutputHatch).casingIndex(CASING_INDEX).dot(1) - .buildAndChain(GregTech_API.sBlockCasings8, 0)) - .addElement('r', Maintenance.newAny(CASING_INDEX, 2)) - .addElement( - 'e', - buildHatchAdder(GT_TileEntity_MegaChemicalReactor.class) - .atLeast(Energy.or(ExoticEnergy), InputHatch, InputBus, OutputHatch, OutputBus) - .casingIndex(CASING_INDEX).dot(3).buildAndChain(GregTech_API.sBlockCasings8, 0)) - .addElement('c', ofChain(ofBlock(GregTech_API.sBlockCasings4, 7), ofBlock(GregTech_API.sBlockCasings5, 13))) - .addElement( - 'g', - BorosilicateGlass.ofBoroGlass( - (byte) 0, - (byte) 1, - Byte.MAX_VALUE, - (te, t) -> te.glassTier = t, - te -> te.glassTier)) - .build(); + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { "ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "ttttt" }, + { "tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet" }, + { "tg~gt", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", "teret" }, + { "tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet" }, + { "ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "ttttt" }, })) + .addElement('p', ofBlock(GregTech_API.sBlockCasings8, 1)) + .addElement('t', ofBlock(GregTech_API.sBlockCasings8, 0)) + .addElement( + 'd', + buildHatchAdder(GT_TileEntity_MegaChemicalReactor.class) + .atLeast(InputBus, InputHatch, OutputBus, OutputHatch) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings8, 0)) + .addElement('r', Maintenance.newAny(CASING_INDEX, 2)) + .addElement( + 'e', + buildHatchAdder(GT_TileEntity_MegaChemicalReactor.class) + .atLeast(Energy.or(ExoticEnergy), InputHatch, InputBus, OutputHatch, OutputBus) + .casingIndex(CASING_INDEX) + .dot(3) + .buildAndChain(GregTech_API.sBlockCasings8, 0)) + .addElement('c', ofChain(ofBlock(GregTech_API.sBlockCasings4, 7), ofBlock(GregTech_API.sBlockCasings5, 13))) + .addElement( + 'g', + BorosilicateGlass + .ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glassTier = t, te -> te.glassTier)) + .build(); @Override public IStructureDefinition getStructureDefinition() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 478b27cbf1..80bc644e9e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -60,7 +60,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_Output_ME; public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlockBase - implements ISurvivalConstructable { + implements ISurvivalConstructable { protected static final int CASING_INDEX = 49; protected static final String STRUCTURE_PIECE_BASE = "base"; @@ -70,119 +70,113 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock static { IHatchElement layeredOutputHatch = OutputHatch - .withCount(GT_TileEntity_MegaDistillTower::getCurrentLayerOutputHatchCount) - .withAdder(GT_TileEntity_MegaDistillTower::addLayerOutputHatch); - STRUCTURE_DEFINITION = StructureDefinition.builder().addShape( + .withCount(GT_TileEntity_MegaDistillTower::getCurrentLayerOutputHatchCount) + .withAdder(GT_TileEntity_MegaDistillTower::addLayerOutputHatch); + STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape( STRUCTURE_PIECE_BASE, transpose( - new String[][] { { "bbbbbbb~bbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", - "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", - "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", - "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb" }, })) - .addShape( - STRUCTURE_PIECE_LAYER, - transpose( - new String[][] { { "lllllllllllllll", "lcccccccccccccl", "lcccccccccccccl", - "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", - "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", - "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lllllllllllllll" }, - { "lllllllllllllll", "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "lllllllllllllll" }, - { "lllllllllllllll", "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "lllllllllllllll" }, - { "lllllllllllllll", "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "lllllllllllllll" }, - { "lllllllllllllll", "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "lllllllllllllll" }, })) - .addShape( - STRUCTURE_PIECE_TOP_HINT, - transpose( - new String[][] { { "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", - "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", - "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", - "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll" }, - { "lllllllllllllll", "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "lllllllllllllll" }, - { "lllllllllllllll", "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "lllllllllllllll" }, - { "lllllllllllllll", "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "lllllllllllllll" }, - { "lllllllllllllll", "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "l=============l", "l=============l", - "l=============l", "lllllllllllllll" }, })) - .addElement('=', StructureElementAirNoHint.getInstance()) - .addElement( - 'b', - buildHatchAdder(GT_TileEntity_MegaDistillTower.class).atLeast( - InputHatch, - OutputHatch, - InputBus, - OutputBus, - Maintenance, - Energy.or(ExoticEnergy)).casingIndex(CASING_INDEX).dot(1).buildAndChain( - onElementPass( - GT_TileEntity_MegaDistillTower::onCasingFound, - ofBlock(GregTech_API.sBlockCasings4, 1)))) - .addElement( - 'l', - buildHatchAdder(GT_TileEntity_MegaDistillTower.class) - .atLeast(layeredOutputHatch, Maintenance, Energy.or(ExoticEnergy)) - .casingIndex(CASING_INDEX).dot(1).buildAndChain( - onElementPass( - GT_TileEntity_MegaDistillTower::onCasingFound, - ofBlock(GregTech_API.sBlockCasings4, 1)))) - .addElement('c', (IStructureElementCheckOnly) (t, world, x, y, z) -> { - if (world.isAirBlock(x, y, z)) { - if (t.mTopState < 1) { - t.mTopState = 0; - return true; - } - // definitely top - cannot be air - return false; - } - // from here on we must be looking at a top layer, since it's not air - if (t.mTopState == 0) - // must be air but failed, so no - return false; - t.mTopState = 1; - // hatch adder - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity instanceof IGregTechTileEntity entity - && t.addLayerOutputHatch(entity, CASING_INDEX)) { - t.onTopLayerFound(false); - return true; - } - // block adder - if (world.getBlock(x, y, z) == GregTech_API.sBlockCasings4 - && world.getBlockMetadata(x, y, z) == 1) { - t.onTopLayerFound(true); + new String[][] { { "bbbbbbb~bbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb" }, })) + .addShape( + STRUCTURE_PIECE_LAYER, + transpose( + new String[][] { + { "lllllllllllllll", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", + "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", + "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", + "lcccccccccccccl", "lllllllllllllll" }, + { "lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "lllllllllllllll" }, + { "lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "lllllllllllllll" }, + { "lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "lllllllllllllll" }, + { "lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "lllllllllllllll" }, })) + .addShape( + STRUCTURE_PIECE_TOP_HINT, + transpose( + new String[][] { + { "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", + "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", + "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", + "lllllllllllllll", "lllllllllllllll" }, + { "lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "lllllllllllllll" }, + { "lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "lllllllllllllll" }, + { "lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "lllllllllllllll" }, + { "lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "l=============l", "l=============l", "l=============l", + "l=============l", "lllllllllllllll" }, })) + .addElement('=', StructureElementAirNoHint.getInstance()) + .addElement( + 'b', + buildHatchAdder(GT_TileEntity_MegaDistillTower.class) + .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, Energy.or(ExoticEnergy)) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain( + onElementPass( + GT_TileEntity_MegaDistillTower::onCasingFound, + ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement( + 'l', + buildHatchAdder(GT_TileEntity_MegaDistillTower.class) + .atLeast(layeredOutputHatch, Maintenance, Energy.or(ExoticEnergy)) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain( + onElementPass( + GT_TileEntity_MegaDistillTower::onCasingFound, + ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement('c', (IStructureElementCheckOnly) (t, world, x, y, z) -> { + if (world.isAirBlock(x, y, z)) { + if (t.mTopState < 1) { + t.mTopState = 0; return true; } + // definitely top - cannot be air + return false; + } + // from here on we must be looking at a top layer, since it's not air + if (t.mTopState == 0) + // must be air but failed, so no return false; - }).build(); + t.mTopState = 1; + // hatch adder + TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity instanceof IGregTechTileEntity entity && t.addLayerOutputHatch(entity, CASING_INDEX)) { + t.onTopLayerFound(false); + return true; + } + // block adder + if (world.getBlock(x, y, z) == GregTech_API.sBlockCasings4 && world.getBlockMetadata(x, y, z) == 1) { + t.onTopLayerFound(true); + return true; + } + return false; + }) + .build(); } protected final List> mOutputHatchesByLayer = new ArrayList<>(); @@ -212,17 +206,18 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock protected int getCurrentLayerOutputHatchCount() { return this.mOutputHatchesByLayer.size() < this.mHeight || this.mHeight <= 0 ? 0 - : this.mOutputHatchesByLayer.get(this.mHeight - 1).size(); + : this.mOutputHatchesByLayer.get(this.mHeight - 1) + .size(); } protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null || aTileEntity.isDead() - || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) - return false; + || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) return false; while (this.mOutputHatchesByLayer.size() < this.mHeight) this.mOutputHatchesByLayer.add(new ArrayList<>()); GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity(); tHatch.updateTexture(aBaseCasingIndex); - return this.mOutputHatchesByLayer.get(this.mHeight - 1).add(tHatch); + return this.mOutputHatchesByLayer.get(this.mHeight - 1) + .add(tHatch); } protected void onTopLayerFound(boolean aIsCasing) { @@ -232,16 +227,27 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { + int aColorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow() - .build() }; - return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) }; } @@ -259,17 +265,22 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Distillery").addInfo("Controller block for the Distillation Tower") - .addInfo("Fluids are only put out at the correct height") - .addInfo("The correct height equals the slot number in the NEI recipe").addSeparator() - .beginVariableStructureBlock(15, 15, 16, 56, 15, 15, true).addController("Front bottom") - .addOtherStructurePart("Clean Stainless Steel Machine Casing", "15 x h - 5 (minimum)") - .addEnergyHatch("Any casing").addMaintenanceHatch("Any casing").addInputHatch("Any bottom layer casing") - .addOutputBus("Any bottom layer casing") - .addOutputHatch("2-11x Output Hatches (One per Output Layer except bottom layer)") - .addStructureInfo("An \"Output Layer\" consists of 5 layers!") - .addStructureHint("The interior of this Mega Multiblock's hologram is empty, it should be all air.") - .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); + tt.addMachineType("Distillery") + .addInfo("Controller block for the Distillation Tower") + .addInfo("Fluids are only put out at the correct height") + .addInfo("The correct height equals the slot number in the NEI recipe") + .addSeparator() + .beginVariableStructureBlock(15, 15, 16, 56, 15, 15, true) + .addController("Front bottom") + .addOtherStructurePart("Clean Stainless Steel Machine Casing", "15 x h - 5 (minimum)") + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addInputHatch("Any bottom layer casing") + .addOutputBus("Any bottom layer casing") + .addOutputHatch("2-11x Output Hatches (One per Output Layer except bottom layer)") + .addStructureInfo("An \"Output Layer\" consists of 5 layers!") + .addStructureHint("The interior of this Mega Multiblock's hologram is empty, it should be all air.") + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); return tt; } @@ -294,8 +305,8 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock if (!checkPiece(STRUCTURE_PIECE_LAYER, 7, mHeight * 5, 0)) { return false; } - if (this.mOutputHatchesByLayer.size() < this.mHeight - || this.mOutputHatchesByLayer.get(this.mHeight - 1).isEmpty()) + if (this.mOutputHatchesByLayer.size() < this.mHeight || this.mOutputHatchesByLayer.get(this.mHeight - 1) + .isEmpty()) // layer without output hatch return false; if (mTopLayerFound) { @@ -308,8 +319,8 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock // validate final invariants... return this.mCasing >= 75 * this.mHeight + 10 && this.mHeight >= 2 - && this.mTopLayerFound - && this.mMaintenanceHatches.size() == 1; + && this.mTopLayerFound + && this.mMaintenanceHatches.size() == 1; } @Override @@ -328,27 +339,13 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); this.mHeight = 0; int built = this - .survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 7, 0, 0, realBudget, source, actor, false, true); + .survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 7, 0, 0, realBudget, source, actor, false, true); if (built >= 0) return built; int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height for (int i = 1; i < tTotalHeight - 1; i++) { this.mHeight = i; built = this.survivialBuildPiece( - STRUCTURE_PIECE_LAYER, - stackSize, - 7, - 5 * this.mHeight, - 0, - realBudget, - source, - actor, - false, - true); - if (built >= 0) return built; - } - this.mHeight = tTotalHeight - 1; - return this.survivialBuildPiece( - STRUCTURE_PIECE_TOP_HINT, + STRUCTURE_PIECE_LAYER, stackSize, 7, 5 * this.mHeight, @@ -358,6 +355,20 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock actor, false, true); + if (built >= 0) return built; + } + this.mHeight = tTotalHeight - 1; + return this.survivialBuildPiece( + STRUCTURE_PIECE_TOP_HINT, + stackSize, + 7, + 5 * this.mHeight, + 0, + realBudget, + source, + actor, + false, + true); } @Override @@ -370,7 +381,7 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { this.batchMode = !this.batchMode; if (this.batchMode) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java index 700dbb8e36..223ef65f77 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java @@ -25,7 +25,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffl import gregtech.api.util.GT_Utility; public abstract class GT_TileEntity_MegaMultiBlockBase> - extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase { + extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase { protected GT_TileEntity_MegaMultiBlockBase(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -51,8 +51,10 @@ public abstract class GT_TileEntity_MegaMultiBlockBase - implements ISurvivalConstructable { + implements ISurvivalConstructable { private static final int CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { - { " p p ", "ppgggggggggpp", " pgggggggggp ", " pgggpppgggp ", - " pgggpMpgggp ", " pgggpppgggp ", " pgggggggggp ", "ppgggggggggpp", - " p p " }, - { " p p ", "pgggggggggggp", " g c c c c g ", " g c c c c g ", - " g c c c c g ", " g c c c c g ", " g c c c c g ", "pgggggggggggp", - " p p " }, - { " p p ", "pgggggggggggp", " g c c c c g ", " p c c p ", - " p c c c c p ", " p c c p ", " g c c c c g ", "pgggggggggggp", - " p p " }, - { " p p ", "pgggggggggggp", " g c c c c g ", " p c c c c p ", - " l c c c c r ", " p c c c c p ", " g c c c c g ", "pgggggggggggp", - " p p " }, - { " p p ", "pgggggggggggp", " g c c c c g ", " p c c p ", - " p c c c c p ", " p c c p ", " g c c c c g ", "pgggggggggggp", - " p p " }, - { " p p ", "pgggggggggggp", " g c c c c g ", " g c c c c g ", - " g c c c c g ", " g c c c c g ", " g c c c c g ", "pgggggggggggp", - " p p " }, - { "ppmmmm~mmmmpp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", - "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", - "ppmmmmmmmmmpp" }, })) - .addElement( - 'c', - withChannel( - "coil", - ofCoil( - GT_TileEntity_MegaOilCracker::setCoilLevel, - GT_TileEntity_MegaOilCracker::getCoilLevel))) - - .addElement('p', ofBlock(GregTech_API.sBlockCasings4, 1)) - .addElement( - 'l', - InputHatch.withAdder(GT_TileEntity_MegaOilCracker::addLeftHatchToMachineList) - .newAny(CASING_INDEX, 2)) - .addElement( - 'r', - OutputHatch.withAdder(GT_TileEntity_MegaOilCracker::addRightHatchToMachineList) - .newAny(CASING_INDEX, 3)) - .addElement( - 'm', - buildHatchAdder(GT_TileEntity_MegaOilCracker.class) - .atLeast(Energy.or(ExoticEnergy), Maintenance, InputBus).casingIndex(CASING_INDEX).dot(1) - .buildAndChain(GregTech_API.sBlockCasings4, 1)) - .addElement( - 'M', - InputHatch.withAdder(GT_TileEntity_MegaOilCracker::addMiddleInputToMachineList) - .newAny(CASING_INDEX, 4)) - .addElement( - 'g', - withChannel( - "glass", - BorosilicateGlass.ofBoroGlass( - (byte) 0, - (byte) 1, - Byte.MAX_VALUE, - (te, t) -> te.glassTier = t, - te -> te.glassTier))) - .build(); + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { + { " p p ", "ppgggggggggpp", " pgggggggggp ", " pgggpppgggp ", " pgggpMpgggp ", + " pgggpppgggp ", " pgggggggggp ", "ppgggggggggpp", " p p " }, + { " p p ", "pgggggggggggp", " g c c c c g ", " g c c c c g ", " g c c c c g ", + " g c c c c g ", " g c c c c g ", "pgggggggggggp", " p p " }, + { " p p ", "pgggggggggggp", " g c c c c g ", " p c c p ", " p c c c c p ", + " p c c p ", " g c c c c g ", "pgggggggggggp", " p p " }, + { " p p ", "pgggggggggggp", " g c c c c g ", " p c c c c p ", " l c c c c r ", + " p c c c c p ", " g c c c c g ", "pgggggggggggp", " p p " }, + { " p p ", "pgggggggggggp", " g c c c c g ", " p c c p ", " p c c c c p ", + " p c c p ", " g c c c c g ", "pgggggggggggp", " p p " }, + { " p p ", "pgggggggggggp", " g c c c c g ", " g c c c c g ", " g c c c c g ", + " g c c c c g ", " g c c c c g ", "pgggggggggggp", " p p " }, + { "ppmmmm~mmmmpp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", + "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppmmmmmmmmmpp" }, })) + .addElement( + 'c', + withChannel( + "coil", + ofCoil(GT_TileEntity_MegaOilCracker::setCoilLevel, GT_TileEntity_MegaOilCracker::getCoilLevel))) + + .addElement('p', ofBlock(GregTech_API.sBlockCasings4, 1)) + .addElement( + 'l', + InputHatch.withAdder(GT_TileEntity_MegaOilCracker::addLeftHatchToMachineList) + .newAny(CASING_INDEX, 2)) + .addElement( + 'r', + OutputHatch.withAdder(GT_TileEntity_MegaOilCracker::addRightHatchToMachineList) + .newAny(CASING_INDEX, 3)) + .addElement( + 'm', + buildHatchAdder(GT_TileEntity_MegaOilCracker.class).atLeast(Energy.or(ExoticEnergy), Maintenance, InputBus) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings4, 1)) + .addElement( + 'M', + InputHatch.withAdder(GT_TileEntity_MegaOilCracker::addMiddleInputToMachineList) + .newAny(CASING_INDEX, 4)) + .addElement( + 'g', + withChannel( + "glass", + BorosilicateGlass + .ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glassTier = t, te -> te.glassTier))) + .build(); private byte glassTier; private HeatingCoilLevel heatLevel; protected final List mMiddleInputHatches = new ArrayList<>(); @@ -155,21 +143,27 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa @Override public GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Cracker").addInfo("Controller block for the Mega Oil Cracking") - .addInfo("Thermally cracks heavy hydrocarbons into lighter fractions") - .addInfo("More efficient than the Chemical Reactor") - .addInfo("Gives different benefits whether it hydro or steam-cracks:") - .addInfo("Hydro - Consumes 20% less Hydrogen and outputs 25% more cracked fluid") - .addInfo("Steam - Outputs 50% more cracked fluid") - .addInfo("(Values compared to cracking in the Chemical Reactor)") - .addInfo("Place the appropriate circuit in the controller or an input bus").addSeparator() - .beginStructureBlock(13, 7, 9, true).addController("Front bottom") - .addStructureInfo("The glass tier limits the Energy Input tier") - .addInfo("Gets 10% EU/t reduction per coil tier, up to a maximum of 50%") - .addEnergyHatch("Hint block", 1).addMaintenanceHatch("Hint block", 1).addInputHatch("Hint block", 2, 3) - .addOutputHatch("Hint block", 2, 3).addInputHatch("Steam/Hydrogen ONLY, Hint block", 4) - .addInputBus("Optional, for programmed circuit automation. Hint block", 1) - .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + tt.addMachineType("Cracker") + .addInfo("Controller block for the Mega Oil Cracking") + .addInfo("Thermally cracks heavy hydrocarbons into lighter fractions") + .addInfo("More efficient than the Chemical Reactor") + .addInfo("Gives different benefits whether it hydro or steam-cracks:") + .addInfo("Hydro - Consumes 20% less Hydrogen and outputs 25% more cracked fluid") + .addInfo("Steam - Outputs 50% more cracked fluid") + .addInfo("(Values compared to cracking in the Chemical Reactor)") + .addInfo("Place the appropriate circuit in the controller or an input bus") + .addSeparator() + .beginStructureBlock(13, 7, 9, true) + .addController("Front bottom") + .addStructureInfo("The glass tier limits the Energy Input tier") + .addInfo("Gets 10% EU/t reduction per coil tier, up to a maximum of 50%") + .addEnergyHatch("Hint block", 1) + .addMaintenanceHatch("Hint block", 1) + .addInputHatch("Hint block", 2, 3) + .addOutputHatch("Hint block", 2, 3) + .addInputHatch("Steam/Hydrogen ONLY, Hint block", 4) + .addInputBus("Optional, for programmed circuit automation. Hint block", 1) + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -180,15 +174,26 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { + int aColorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { - if (aActive) return new ITexture[] { casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW).extFacing().glow() - .build() }; - return new ITexture[] { casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW).extFacing().glow().build() }; + if (aActive) return new ITexture[] { casingTexturePages[0][CASING_INDEX], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; + return new ITexture[] { casingTexturePages[0][CASING_INDEX], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { casingTexturePages[0][CASING_INDEX] }; } @@ -206,7 +211,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa @Nonnull public CheckRecipeResult process() { this.setEuModifier( - 1.0F - Math.min(0.1F * (GT_TileEntity_MegaOilCracker.this.heatLevel.getTier() + 1), 0.5F)); + 1.0F - Math.min(0.1F * (GT_TileEntity_MegaOilCracker.this.heatLevel.getTier() + 1), 0.5F)); return super.process(); } }.setMaxParallel(ConfigHandler.megaMachinesMax); @@ -230,7 +235,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa if (this.mMachine) return -1; int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); return this - .survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 6, 6, 0, realBudget, source, actor, false, true); + .survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 6, 6, 0, realBudget, source, actor, false, true); } // -------------- TEC TECH COMPAT ---------------- @@ -351,20 +356,22 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa tHatch.mRecipeMap = getRecipeMap(); if (tHatch instanceof GT_MetaTileEntity_Hatch_Input_ME meHatch) { for (FluidStack tFluid : meHatch.getStoredFluids()) { - if (tFluid != null && !getRecipeMap().getBackend().isValidCatalystFluid(tFluid)) { + if (tFluid != null && !getRecipeMap().getBackend() + .isValidCatalystFluid(tFluid)) { inputsFromME.put(tFluid.getFluid(), tFluid); } } } else if (tHatch instanceof GT_MetaTileEntity_Hatch_MultiInput) { for (final FluidStack tFluid : ((GT_MetaTileEntity_Hatch_MultiInput) tHatch).getStoredFluid()) { - if (tFluid != null && !getRecipeMap().getBackend().isValidCatalystFluid(tFluid)) { + if (tFluid != null && !getRecipeMap().getBackend() + .isValidCatalystFluid(tFluid)) { rList.add(tFluid); } } } else { if (tHatch.getFillableStack() != null) { - if (!getRecipeMap().getBackend().isValidCatalystFluid(tHatch.getFillableStack())) - rList.add(tHatch.getFillableStack()); + if (!getRecipeMap().getBackend() + .isValidCatalystFluid(tHatch.getFillableStack())) rList.add(tHatch.getFillableStack()); } } } @@ -372,20 +379,23 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa tHatch.mRecipeMap = getRecipeMap(); if (tHatch instanceof GT_MetaTileEntity_Hatch_Input_ME meHatch) { for (FluidStack tFluid : meHatch.getStoredFluids()) { - if (tFluid != null && getRecipeMap().getBackend().isValidCatalystFluid(tFluid)) { + if (tFluid != null && getRecipeMap().getBackend() + .isValidCatalystFluid(tFluid)) { inputsFromME.put(tFluid.getFluid(), tFluid); } } } else if (tHatch instanceof GT_MetaTileEntity_Hatch_MultiInput) { for (final FluidStack tFluid : ((GT_MetaTileEntity_Hatch_MultiInput) tHatch).getStoredFluid()) { - if (tFluid != null && getRecipeMap().getBackend().isValidCatalystFluid(tFluid)) { + if (tFluid != null && getRecipeMap().getBackend() + .isValidCatalystFluid(tFluid)) { rList.add(tFluid); } } } else { if (tHatch.getFillableStack() != null) { final FluidStack tStack = tHatch.getFillableStack(); - if (getRecipeMap().getBackend().isValidCatalystFluid(tStack)) { + if (getRecipeMap().getBackend() + .isValidCatalystFluid(tStack)) { rList.add(tStack); } } @@ -409,7 +419,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { batchMode = !batchMode; if (batchMode) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index fce136840d..0a2464de5e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -51,7 +51,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBlockBase - implements ISurvivalConstructable { + implements ISurvivalConstructable { public GT_TileEntity_MegaVacuumFreezer(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -71,89 +71,84 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc private static final int CASING_INDEX = 17; private static final String STRUCTURE_PIECE_MAIN = "main"; private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { - { "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", - "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", - "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", - "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc" }, - { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "ccccccccccccccc" }, - { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "ccccccccccccccc" }, - { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "ccccccccccccccc" }, - { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "ccccccccccccccc" }, - { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "ccccccccccccccc" }, - { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "ccccccccccccccc" }, - { "ccccccc~ccccccc", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "ccccccccccccccc" }, - { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "ccccccccccccccc" }, - { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "ccccccccccccccc" }, - { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "ccccccccccccccc" }, - { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "ccccccccccccccc" }, - { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "ccccccccccccccc" }, - { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "c=============c", "c=============c", - "c=============c", "c=============c", "ccccccccccccccc" }, - { "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", - "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", - "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", - "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc" } })) - .addElement('=', StructureElementAirNoHint.getInstance()) - .addElement( - 'c', - buildHatchAdder(GT_TileEntity_MegaVacuumFreezer.class) - .atLeast(Energy.or(ExoticEnergy), InputHatch, InputBus, OutputHatch, OutputBus, Maintenance) - .casingIndex(CASING_INDEX).dot(1) - .buildAndChain(onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings2, 1)))) - .build(); + .builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { + { "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", + "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", + "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccc~ccccccc", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", + "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc" }, + { "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", + "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", + "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", + "ccccccccccccccc" } })) + .addElement('=', StructureElementAirNoHint.getInstance()) + .addElement( + 'c', + buildHatchAdder(GT_TileEntity_MegaVacuumFreezer.class) + .atLeast(Energy.or(ExoticEnergy), InputHatch, InputBus, OutputHatch, OutputBus, Maintenance) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings2, 1)))) + .build(); @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Vacuum Freezer").addInfo("Controller Block for the Mega Vacuum Freezer") - .addInfo("Cools hot ingots and cells").addSeparator().beginStructureBlock(15, 15, 15, true) - .addController("Front center").addCasingInfoMin("Frost Proof Machine Casing", 900, false) - .addEnergyHatch("Any casing", 1).addMaintenanceHatch("Any casing", 1).addInputHatch("Any casing", 1) - .addOutputHatch("Any casing", 1).addInputBus("Any casing", 1).addOutputBus("Any casing", 1) - .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + tt.addMachineType("Vacuum Freezer") + .addInfo("Controller Block for the Mega Vacuum Freezer") + .addInfo("Cools hot ingots and cells") + .addSeparator() + .beginStructureBlock(15, 15, 15, true) + .addController("Front center") + .addCasingInfoMin("Frost Proof Machine Casing", 900, false) + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addInputHatch("Any casing", 1) + .addOutputHatch("Any casing", 1) + .addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1) + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -172,7 +167,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc if (this.mMachine) return -1; int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); return this - .survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 7, 7, 0, realBudget, source, actor, false, true); + .survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 7, 7, 0, realBudget, source, actor, false, true); } @Override @@ -190,7 +185,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { this.batchMode = !this.batchMode; if (this.batchMode) { @@ -219,19 +214,29 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { + int aColorIndex, boolean aActive, boolean aRedstone) { ITexture[] rTexture; if (side == facing) { if (aActive) { - rTexture = new ITexture[] { casingTexturePages[0][17], - TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW).extFacing().glow() - .build() }; + rTexture = new ITexture[] { casingTexturePages[0][17], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; } else { - rTexture = new ITexture[] { casingTexturePages[0][17], - TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_GLOW).extFacing().glow() - .build() }; + rTexture = new ITexture[] { casingTexturePages[0][17], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_GLOW) + .extFacing() + .glow() + .build() }; } } else { rTexture = new ITexture[] { casingTexturePages[0][17] }; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index d9b7645d29..c50e6cbd12 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -32,7 +32,7 @@ import gregtech.api.render.TextureFactory; public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGenerator { public GT_MetaTileEntity_AcidGenerator(int aID, String aName, String aNameRegional, int aTier, - ITexture... aTextures) { + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, new String[] {}, aTextures); } @@ -63,93 +63,95 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene @Override public ITexture[] getFront(byte aColor) { return new ITexture[] { super.getFront(aColor)[0], - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBack(byte aColor) { return new ITexture[] { super.getBack(aColor)[0], - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } @Override public ITexture[] getBottom(byte aColor) { return new ITexture[] { super.getBottom(aColor)[0], - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } @Override public ITexture[] getTop(byte aColor) { return new ITexture[] { super.getTop(aColor)[0], - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), - TextureFactory.builder() - .addIcon( - new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")) - .glow().build() }; + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")) + .glow() + .build() }; } @Override public ITexture[] getSides(byte aColor) { return new ITexture[] { super.getSides(aColor)[0], - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } @Override public ITexture[] getFrontActive(byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBackActive(byte aColor) { return new ITexture[] { super.getBackActive(aColor)[0], - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } @Override public ITexture[] getBottomActive(byte aColor) { return new ITexture[] { super.getBottomActive(aColor)[0], - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } @Override public ITexture[] getTopActive(byte aColor) { return new ITexture[] { super.getTopActive(aColor)[0], - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), - TextureFactory - .of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), - TextureFactory.builder().addIcon( - new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")) - .glow().build() }; + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), + TextureFactory + .of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")) + .glow() + .build() }; } @Override public ITexture[] getSidesActive(byte aColor) { return new ITexture[] { super.getSidesActive(aColor)[0], - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) }; } @Override public boolean isOutputFacing(ForgeDirection side) { - return side == this.getBaseMetaTileEntity().getFrontFacing(); + return side == this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override public String[] getDescription() { return new String[] { StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), - StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " - + ChatColorHelper.YELLOW - + GT_Values.V[this.mTier], - StatCollector.translateToLocal("tooltip.rotor.2.name") + " " - + ChatColorHelper.YELLOW - + this.getEfficiency(), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " - + ChatColorHelper.YELLOW - + this.maxAmperesOut(), - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; + StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + + ChatColorHelper.YELLOW + + GT_Values.V[this.mTier], + StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + + ChatColorHelper.YELLOW + + this.getEfficiency(), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + + ChatColorHelper.YELLOW + + this.maxAmperesOut(), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index 30420d4328..d2ef329066 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -60,83 +60,81 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_BioLab(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 1, - (String) null, - 6, - 2, - TextureFactory.of( - TextureFactory.of( - new Textures.BlockIcons.CustomIcon( - "basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), - TextureFactory.builder() - .addIcon( - new Textures.BlockIcons.CustomIcon( - "basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE_GLOW")) - .glow().build()), - TextureFactory.of( - TextureFactory - .of(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), - TextureFactory.builder().addIcon( - new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_GLOW")) - .glow().build()), - TextureFactory.of( - TextureFactory - .of(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), - TextureFactory.builder().addIcon( - new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE_GLOW")) - .glow().build()), - TextureFactory.of( - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), - TextureFactory.builder().addIcon( - new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_GLOW")).glow() - .build()), - TextureFactory.of( - TextureFactory.of( - new Textures.BlockIcons.CustomIcon( - "basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), - TextureFactory.builder() - .addIcon( - new Textures.BlockIcons.CustomIcon( - "basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")) - .glow().build() /* this is topactive */), - TextureFactory.of( - TextureFactory - .of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), - TextureFactory.builder().addIcon( - new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")) - .glow().build() /* this is top */), - TextureFactory.of( - TextureFactory.of( - new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), - TextureFactory.builder() - .addIcon( - new Textures.BlockIcons.CustomIcon( - "basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE_GLOW")) - .glow().build()), - TextureFactory.of( - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM")), - TextureFactory.builder().addIcon( - new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_GLOW")) - .glow().build())); + aID, + aName, + aNameRegional, + aTier, + 1, + (String) null, + 6, + 2, + TextureFactory.of( + TextureFactory + .of(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), + TextureFactory.builder() + .addIcon( + new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory + .of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), + TextureFactory.builder() + .addIcon( + new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")) + .glow() + .build() /* this is topactive */), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")) + .glow() + .build() /* this is top */), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_GLOW")) + .glow() + .build())); } public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new GT_MetaTileEntity_BioLab( - this.mName, - this.mTier, - this.mAmperage, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mAmperage, + this.mDescriptionArray, + this.mTextures); } @Override @@ -154,37 +152,39 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { int rTier = 3; FluidStack dnaFluid = Gendustry.isModLoaded() ? FluidRegistry.getFluidStack("liquiddna", 1000) - : Materials.Biomass.getFluid(1000L); + : Materials.Biomass.getFluid(1000L); - if (this.getSpecialSlot() != null && this.getSpecialSlot().getItem() instanceof LabModule) { - int damage = this.getSpecialSlot().getItemDamage(); + if (this.getSpecialSlot() != null && this.getSpecialSlot() + .getItem() instanceof LabModule) { + int damage = this.getSpecialSlot() + .getItemDamage(); switch (damage) { case DNA_EXTRACTION_MODULE: if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()]) - && this.mInventory[this.getInputSlot()].getItem() instanceof LabParts - && this.mInventory[this.getInputSlot()].getItemDamage() == 0 - && this.mInventory[this.getInputSlot()].getTagCompound() != null - && // checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1]) - && this.mInventory[this.getInputSlot() + 1].getItem() instanceof LabParts - && this.mInventory[this.getInputSlot() + 1].getItemDamage() == 1 - && this.mInventory[this.getInputSlot() + 1].getTagCompound() == null - && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2]) - && this.mInventory[this.getInputSlot() + 2].getItem() instanceof LabParts - && this.mInventory[this.getInputSlot() + 2].getItemDamage() == 3 - && GT_Utility.areStacksEqual( - this.mInventory[this.getInputSlot() + 3], - Materials.Ethanol.getCells(1)) - && this.mFluid != null - && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) - && this.mFluid.amount >= 1000) { + && this.mInventory[this.getInputSlot()].getItem() instanceof LabParts + && this.mInventory[this.getInputSlot()].getItemDamage() == 0 + && this.mInventory[this.getInputSlot()].getTagCompound() != null + && // checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1]) + && this.mInventory[this.getInputSlot() + 1].getItem() instanceof LabParts + && this.mInventory[this.getInputSlot() + 1].getItemDamage() == 1 + && this.mInventory[this.getInputSlot() + 1].getTagCompound() == null + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2]) + && this.mInventory[this.getInputSlot() + 2].getItem() instanceof LabParts + && this.mInventory[this.getInputSlot() + 2].getItemDamage() == 3 + && GT_Utility + .areStacksEqual(this.mInventory[this.getInputSlot() + 3], Materials.Ethanol.getCells(1)) + && this.mFluid != null + && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) + && this.mFluid.amount >= 1000) { NBTTagCompound DNABioDataTag = this.mInventory[this.getInputSlot()].getTagCompound() - .getCompoundTag("DNA"); + .getCompoundTag("DNA"); if (DNABioDataTag == null) return super.checkRecipe(skipOC); BioData cultureDNABioData = BioData.getBioDataFromName( - this.mInventory[this.getInputSlot()].getTagCompound().getCompoundTag("DNA") - .getString("Name")); + this.mInventory[this.getInputSlot()].getTagCompound() + .getCompoundTag("DNA") + .getString("Name")); if (cultureDNABioData == null) return super.checkRecipe(skipOC); if (this.mTier < rTier + cultureDNABioData.getTier()) @@ -199,37 +199,34 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { this.mOutputItems[0] = BioItemList - .getDNASampleFlask(BioDNA.convertDataToDNA(cultureDNABioData)); + .getDNASampleFlask(BioDNA.convertDataToDNA(cultureDNABioData)); } this.mOutputItems[1] = GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L); this.calculateOverclockedNess( - BW_Util.getMachineVoltageFromTier(rTier + cultureDNABioData.getTier()), - 500); + BW_Util.getMachineVoltageFromTier(rTier + cultureDNABioData.getTier()), + 500); return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } break; case PCR_THERMOCYCLE_MODULE: { if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()]) - && this.mInventory[this.getInputSlot()].getItem() instanceof LabParts - && this.mInventory[this.getInputSlot()].getItemDamage() == 1 - && this.mInventory[this.getInputSlot()].getTagCompound() != null - && // checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 3]) - && GT_Utility.areStacksEqual( - this.mInventory[this.getInputSlot() + 3], - ItemList.Tool_DataOrb.get(1L)) - && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1]) - && GT_Utility.areStacksEqual( - this.mInventory[this.getInputSlot() + 1], - FluidLoader.BioLabFluidCells[0]) - && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2]) - && GT_Utility.areStacksEqual( - this.mInventory[this.getInputSlot() + 2], - FluidLoader.BioLabFluidCells[3]) - && this.mFluid != null - && this.mFluid.isFluidEqual(dnaFluid) - && this.mFluid.amount >= 1000) { + && this.mInventory[this.getInputSlot()].getItem() instanceof LabParts + && this.mInventory[this.getInputSlot()].getItemDamage() == 1 + && this.mInventory[this.getInputSlot()].getTagCompound() != null + && // checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 3]) + && GT_Utility + .areStacksEqual(this.mInventory[this.getInputSlot() + 3], ItemList.Tool_DataOrb.get(1L)) + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1]) + && GT_Utility + .areStacksEqual(this.mInventory[this.getInputSlot() + 1], FluidLoader.BioLabFluidCells[0]) + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2]) + && GT_Utility + .areStacksEqual(this.mInventory[this.getInputSlot() + 2], FluidLoader.BioLabFluidCells[3]) + && this.mFluid != null + && this.mFluid.isFluidEqual(dnaFluid) + && this.mFluid.amount >= 1000) { NBTTagCompound DNABioDataTag = this.mInventory[this.getInputSlot()].getTagCompound(); if (DNABioDataTag == null) return super.checkRecipe(skipOC); BioData cultureDNABioData = BioData.getBioDataFromName(DNABioDataTag.getString("Name")); @@ -255,8 +252,8 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mOutputItems[1] = ItemList.Cell_Empty.get(2L); this.calculateOverclockedNess( - BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), - 500); + BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), + 500); return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } @@ -266,32 +263,33 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { ItemStack inp2 = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); - if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()]) && GT_Utility - .areStacksEqual(FluidLoader.BioLabFluidCells[1], this.mInventory[this.getInputSlot()]) && // checks - // if - // it - // is - // a - // Culture - GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1]) - && GT_Utility.areStacksEqual( - this.mInventory[this.getInputSlot() + 1], - BioItemList.getPlasmidCell(null)) - && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2]) - && GT_Utility.areStacksEqual( - this.mInventory[this.getInputSlot() + 2], - ItemList.Tool_DataOrb.get(1L), - true) - && "DNA Sample" - .equals(Behaviour_DataOrb.getDataTitle(this.mInventory[this.getInputSlot() + 2])) - && !Behaviour_DataOrb.getDataName(this.mInventory[this.getInputSlot() + 2]).isEmpty() - && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 3]) - && GT_Utility.areStacksEqual(this.mInventory[this.getInputSlot() + 3], inp2) - && this.mFluid != null - && this.mFluid.isFluidEqual(dnaFluid) - && this.mFluid.amount >= 1000) { + if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()]) + && GT_Utility + .areStacksEqual(FluidLoader.BioLabFluidCells[1], this.mInventory[this.getInputSlot()]) + && // checks + // if + // it + // is + // a + // Culture + GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1]) + && GT_Utility + .areStacksEqual(this.mInventory[this.getInputSlot() + 1], BioItemList.getPlasmidCell(null)) + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2]) + && GT_Utility.areStacksEqual( + this.mInventory[this.getInputSlot() + 2], + ItemList.Tool_DataOrb.get(1L), + true) + && "DNA Sample".equals(Behaviour_DataOrb.getDataTitle(this.mInventory[this.getInputSlot() + 2])) + && !Behaviour_DataOrb.getDataName(this.mInventory[this.getInputSlot() + 2]) + .isEmpty() + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 3]) + && GT_Utility.areStacksEqual(this.mInventory[this.getInputSlot() + 3], inp2) + && this.mFluid != null + && this.mFluid.isFluidEqual(dnaFluid) + && this.mFluid.amount >= 1000) { BioData cultureDNABioData = BioData.getBioDataFromName( - Behaviour_DataOrb.getDataName(this.mInventory[this.getInputSlot() + 2])); + Behaviour_DataOrb.getDataName(this.mInventory[this.getInputSlot() + 2])); if (cultureDNABioData == null) return super.checkRecipe(skipOC); if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -302,37 +300,37 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mFluid.amount -= 1000; if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { this.mOutputItems[0] = BioItemList - .getPlasmidCell(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + .getPlasmidCell(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); } this.mOutputItems[1] = ItemList.Cell_Empty.get(1L); this.calculateOverclockedNess( - BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), - 500); + BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), + 500); return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } break; case TRANSFORMATION_MODULE: { - if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()]) && GT_Utility + if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()]) + && GT_Utility .areStacksEqual(this.mInventory[this.getInputSlot()], BioItemList.getPetriDish(null), true) - && this.mInventory[this.getInputSlot()].getTagCompound() != null - && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1]) - && GT_Utility.areStacksEqual( - this.mInventory[this.getInputSlot() + 1], - BioItemList.getPlasmidCell(null), - true) - && this.mInventory[this.getInputSlot() + 1].getTagCompound() != null - && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2]) - && GT_Utility.areStacksEqual( - this.mInventory[this.getInputSlot() + 2], - FluidLoader.BioLabFluidCells[2]) - && this.mFluid != null - && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) - && this.mFluid.amount >= 1000) { + && this.mInventory[this.getInputSlot()].getTagCompound() != null + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1]) + && GT_Utility.areStacksEqual( + this.mInventory[this.getInputSlot() + 1], + BioItemList.getPlasmidCell(null), + true) + && this.mInventory[this.getInputSlot() + 1].getTagCompound() != null + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2]) + && GT_Utility + .areStacksEqual(this.mInventory[this.getInputSlot() + 2], FluidLoader.BioLabFluidCells[2]) + && this.mFluid != null + && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) + && this.mFluid.amount >= 1000) { BioData cultureDNABioData = BioData - .getBioDataFromNBTTag(this.mInventory[this.getInputSlot() + 1].getTagCompound()); + .getBioDataFromNBTTag(this.mInventory[this.getInputSlot() + 1].getTagCompound()); BioCulture bioCulture = BioCulture - .getBioCultureFromNBTTag(this.mInventory[this.getInputSlot()].getTagCompound()); + .getBioCultureFromNBTTag(this.mInventory[this.getInputSlot()].getTagCompound()); if (cultureDNABioData == null || bioCulture == null) return super.checkRecipe(skipOC); if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -347,8 +345,8 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } this.mOutputItems[1] = ItemList.Cell_Empty.get(1L); this.calculateOverclockedNess( - BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), - 500); + BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), + 500); return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } @@ -357,27 +355,26 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { ItemStack Outp = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); - if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()]) && GT_Utility + if (GT_Utility.isStackValid(this.mInventory[this.getInputSlot()]) + && GT_Utility .areStacksEqual(this.mInventory[this.getInputSlot()], BioItemList.getPetriDish(null)) - && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1]) - && GT_Utility - .areStacksEqual(this.mInventory[this.getInputSlot() + 1], BioItemList.getOther(4)) - && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2]) - && GT_Utility.areStacksEqual( - this.mInventory[this.getInputSlot() + 2], - ItemList.Circuit_Chip_Stemcell.get(2L)) - && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 3]) - && GT_Utility.areStacksEqual( - this.mInventory[this.getInputSlot() + 3], - ItemList.Tool_DataOrb.get(1L), - true) - && "DNA Sample" - .equals(Behaviour_DataOrb.getDataTitle(this.mInventory[this.getInputSlot() + 3])) - && this.mFluid.isFluidEqual(dnaFluid) - && this.mFluid.amount >= 8000) { + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 1]) + && GT_Utility.areStacksEqual(this.mInventory[this.getInputSlot() + 1], BioItemList.getOther(4)) + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 2]) + && GT_Utility.areStacksEqual( + this.mInventory[this.getInputSlot() + 2], + ItemList.Circuit_Chip_Stemcell.get(2L)) + && GT_Utility.isStackValid(this.mInventory[this.getInputSlot() + 3]) + && GT_Utility.areStacksEqual( + this.mInventory[this.getInputSlot() + 3], + ItemList.Tool_DataOrb.get(1L), + true) + && "DNA Sample".equals(Behaviour_DataOrb.getDataTitle(this.mInventory[this.getInputSlot() + 3])) + && this.mFluid.isFluidEqual(dnaFluid) + && this.mFluid.amount >= 8000) { BioData cultureDNABioData = BioData.getBioDataFromName( - Behaviour_DataOrb.getDataName(this.mInventory[this.getInputSlot() + 3])); + Behaviour_DataOrb.getDataName(this.mInventory[this.getInputSlot() + 3])); if (cultureDNABioData == null) return super.checkRecipe(skipOC); if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -393,8 +390,8 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mOutputItems[0] = BioItemList.getPetriDish(out); } this.calculateOverclockedNess( - BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), - 500); + BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), + 500); return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } @@ -410,6 +407,6 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { @Override public String[] getDescription() { return new String[] { StatCollector.translateToLocal("tooltip.tile.biolab.0.name"), - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java index b8331c93f9..e0903ce93c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java @@ -32,7 +32,7 @@ public class GT_MetaTileEntity_CompressedFluidHatch extends GT_MetaTileEntity_Ha } public GT_MetaTileEntity_CompressedFluidHatch(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -49,10 +49,10 @@ public class GT_MetaTileEntity_CompressedFluidHatch extends GT_MetaTileEntity_Ha @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_CompressedFluidHatch( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index 0597999155..76a9c1646e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -49,8 +49,11 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { super.onFirstTick(aBaseMetaTileEntity); - if (this.maxAmps == 0 && !this.getBaseMetaTileEntity().getWorld().isRemote) { - this.maxAmps = this.getAmpsfromMeta(this.getBaseMetaTileEntity().getMetaTileID()); + if (this.maxAmps == 0 && !this.getBaseMetaTileEntity() + .getWorld().isRemote) { + this.maxAmps = this.getAmpsfromMeta( + this.getBaseMetaTileEntity() + .getMetaTileID()); this.aAmps = this.maxAmps; } } @@ -59,7 +62,8 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); - if (this.getBaseMetaTileEntity().getWorld().isRemote) return; + if (this.getBaseMetaTileEntity() + .getWorld().isRemote) return; if (!aPlayer.isSneaking()) { --this.aAmps; if (this.aAmps < 0) this.aAmps = this.maxAmps; @@ -101,20 +105,15 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { private long getAmpsfromMeta(int meta) { if (meta > ConfigHandler.IDOffset + GT_Values.VN.length - && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 2) - return 2L; + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 2) return 2L; if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 2 - && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 3) - return 4L; + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 3) return 4L; else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 3 - && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 4) - return 8L; + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 4) return 8L; else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 4 - && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 5) - return 12L; + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 5) return 12L; else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 5 - && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 6) - return 16L; + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 6) return 16L; else return 0L; } @@ -122,16 +121,16 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { @SuppressWarnings("deprecation") public String[] getDescription() { return ArrayUtils.addAll( - this.mDescriptionArray, - StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " - + ChatColorHelper.YELLOW - + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " - + ChatColorHelper.YELLOW - + GT_Utility.formatNumbers(this.maxAmperesIn()), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " - + ChatColorHelper.YELLOW - + GT_Utility.formatNumbers(this.maxAmperesOut()), - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); + this.mDescriptionArray, + StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.maxAmperesIn()), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.maxAmperesOut()), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java index 167a3a4758..4431015ca8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java @@ -36,7 +36,7 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans } public GT_MetaTileEntity_EnergyDistributor(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -73,15 +73,15 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans @Override public String[] getDescription() { return new String[] { StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " - + ChatColorHelper.YELLOW - + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " - + ChatColorHelper.YELLOW - + GT_Utility.formatNumbers(this.maxAmperesIn()), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " - + ChatColorHelper.YELLOW - + GT_Utility.formatNumbers(this.maxAmperesOut()), - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; + StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.maxAmperesIn()), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.maxAmperesOut()), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java index c004b0db4e..8d5a756cb5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java @@ -26,7 +26,7 @@ public class GT_MetaTileEntity_GiantOutputHatch extends GT_MetaTileEntity_Hatch_ } public GT_MetaTileEntity_GiantOutputHatch(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java index 15bee4d1c8..e9db8ac2d5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_HumongousInputHatch.java @@ -26,7 +26,7 @@ public class GT_MetaTileEntity_HumongousInputHatch extends GT_MetaTileEntity_Hat } public GT_MetaTileEntity_HumongousInputHatch(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -38,9 +38,9 @@ public class GT_MetaTileEntity_HumongousInputHatch extends GT_MetaTileEntity_Hat @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_HumongousInputHatch( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 6eb6bf9e85..6a66b5209f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -68,7 +68,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch - implements RecipeMapWorkable, IAddGregtechLogo { + implements RecipeMapWorkable, IAddGregtechLogo { private final int cap; public int sievert; @@ -84,19 +84,19 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch public GT_MetaTileEntity_RadioHatch(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 1, - new String[] { StatCollector.translateToLocal("tooltip.tile.radhatch.0.name"), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name") + " " - + (aTier - 2) - + " " - + (aTier - 2 >= 2 ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") - : StatCollector.translateToLocal("tooltip.bw.kg.0.name")), - StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"), - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }); + aID, + aName, + aNameRegional, + aTier, + 1, + new String[] { StatCollector.translateToLocal("tooltip.tile.radhatch.0.name"), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name") + " " + + (aTier - 2) + + " " + + (aTier - 2 >= 2 ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") + : StatCollector.translateToLocal("tooltip.bw.kg.0.name")), + StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }); this.cap = aTier - 2; } @@ -174,7 +174,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch } if (myMetaTileEntity.mTickTimer > myMetaTileEntity.mLastSoundTick + ticksBetweenSounds - && this.sievert > 0) { + && this.sievert > 0) { this.sendLoopStart((byte) 1); myMetaTileEntity.mLastSoundTick = myMetaTileEntity.mTickTimer; } @@ -213,11 +213,11 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch if (this.lastRecipe == null || this.lastFail) { this.lastRecipe = BartWorksRecipeMaps.radioHatchRecipes.findRecipe( - this.getBaseMetaTileEntity(), - false, - Integer.MAX_VALUE - 7, - null, - this.mInventory[0]); + this.getBaseMetaTileEntity(), + false, + Integer.MAX_VALUE - 7, + null, + this.mInventory[0]); if (this.lastRecipe == null) { this.lastFail = true; this.lastUsedItem = this.mInventory[0] == null ? null : this.mInventory[0].copy(); @@ -249,27 +249,27 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch @Override public String[] getInfoData() { if (this.sievert != 0) return new String[] { - StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " - + StatCollector.translateToLocal(this.material), - StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + this.sievert, - StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + this.mass, - StatCollector.translateToLocal("tooltip.tile.radhatch.5.name") + " " - + (this.decayTime - this.timer % (this.decayTime * 60)) - + StatCollector.translateToLocal("tooltip.tile.radhatch.6.name") - + "/" - + (this.decayTime - this.timer % this.decayTime) / 20 - + StatCollector.translateToLocal("tooltip.tile.radhatch.7.name") - + "/" - + (this.decayTime - this.timer % this.decayTime) / 20 / 60 - + StatCollector.translateToLocal("tooltip.tile.radhatch.8.name") - + "/" - + (this.decayTime - this.timer % this.decayTime) / 20 / 60 / 60 - + StatCollector.translateToLocal("tooltip.tile.radhatch.9.name") }; + StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + + StatCollector.translateToLocal(this.material), + StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + this.sievert, + StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + this.mass, + StatCollector.translateToLocal("tooltip.tile.radhatch.5.name") + " " + + (this.decayTime - this.timer % (this.decayTime * 60)) + + StatCollector.translateToLocal("tooltip.tile.radhatch.6.name") + + "/" + + (this.decayTime - this.timer % this.decayTime) / 20 + + StatCollector.translateToLocal("tooltip.tile.radhatch.7.name") + + "/" + + (this.decayTime - this.timer % this.decayTime) / 20 / 60 + + StatCollector.translateToLocal("tooltip.tile.radhatch.8.name") + + "/" + + (this.decayTime - this.timer % this.decayTime) / 20 / 60 / 60 + + StatCollector.translateToLocal("tooltip.tile.radhatch.9.name") }; return new String[] { - StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " - + StatCollector.translateToLocal("tooltip.bw.empty.name"), - StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + "0", - StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + "0" }; + StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + + StatCollector.translateToLocal("tooltip.bw.empty.name"), + StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + "0", + StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + "0" }; } @Override @@ -294,15 +294,15 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { + ItemStack aStack) { return false; } @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { - return side == this.getBaseMetaTileEntity().getFrontFacing() - && BartWorksRecipeMaps.radioHatchRecipes.containsInput(aStack); + ItemStack aStack) { + return side == this.getBaseMetaTileEntity() + .getFrontFacing() && BartWorksRecipeMaps.radioHatchRecipes.containsInput(aStack); } @Override @@ -350,79 +350,93 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { buildContext.addSyncedWindow(RADIATION_SHUTTER_WINDOW_ID, this::createShutterWindow); - this.getBaseMetaTileEntity().add1by1Slot(builder); + this.getBaseMetaTileEntity() + .add1by1Slot(builder); builder.widget( - new DrawableWidget().setBackground(BW_UITextures.PICTURE_SIEVERT_CONTAINER).setPos(61, 9) - .setSize(56, 24)) - .widget( - new ProgressBar().setProgress(() -> this.getSievert() / 148f).setDirection(Direction.RIGHT) - .setTexture(BW_UITextures.PROGRESSBAR_SIEVERT, 24).setPos(65, 13).setSize(48, 16)) - .widget( - new DrawableWidget().setBackground(BW_UITextures.PICTURE_DECAY_TIME_INSIDE).setPos(124, 18) - .setSize(16, 48)) - .widget(new DrawableWidget() { - - @Override - public void draw(float partialTicks) { - if (GT_MetaTileEntity_RadioHatch.this.decayTime > 0) { - int height = MathUtils.ceilInt( - 48 * ((GT_MetaTileEntity_RadioHatch.this.decayTime - - GT_MetaTileEntity_RadioHatch.this.timer - % GT_MetaTileEntity_RadioHatch.this.decayTime) - / (float) GT_MetaTileEntity_RadioHatch.this.decayTime)); - new Rectangle() - .setColor( - Color.argb( - GT_MetaTileEntity_RadioHatch.this.colorForGUI[0], - GT_MetaTileEntity_RadioHatch.this.colorForGUI[1], - GT_MetaTileEntity_RadioHatch.this.colorForGUI[2], - 255)) - .draw(new Pos2d(0, 48 - height), new Size(16, height), partialTicks); - } - } - }.dynamicTooltip( - () -> Collections.singletonList( - StatCollector.translateToLocalFormatted( - "tooltip.tile.radhatch.10.name", - this.timer <= 1 ? 0 : (this.decayTime - this.timer) / 20, - this.timer <= 1 ? 0 : this.decayTime / 20))) - .setPos(124, 18).setSize(16, 48) - .attachSyncer( - new FakeSyncWidget.LongSyncer(() -> this.decayTime, val -> this.decayTime = val), - builder, - (widget, val) -> widget.notifyTooltipChange()) - .attachSyncer( - new FakeSyncWidget.LongSyncer(() -> this.timer, val -> this.timer = val), - builder, - (widget, val) -> widget.notifyTooltipChange())) - .widget(new FakeSyncWidget.ShortSyncer(() -> this.colorForGUI[0], val -> this.colorForGUI[0] = val)) - .widget(new FakeSyncWidget.ShortSyncer(() -> this.colorForGUI[1], val -> this.colorForGUI[1] = val)) - .widget(new FakeSyncWidget.ShortSyncer(() -> this.colorForGUI[2], val -> this.colorForGUI[2] = val)) - .widget( - new DrawableWidget().setBackground(BW_UITextures.PICTURE_DECAY_TIME_CONTAINER).setPos(120, 14) - .setSize(24, 56)) - .widget( - new TextWidget().setStringSupplier( - () -> StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", this.mass)) - .setTextAlignment(Alignment.Center).setPos(65, 62)) - .widget(new FakeSyncWidget.ByteSyncer(() -> this.mass, val -> this.mass = val)) - .widget( - new TextWidget().setStringSupplier( - () -> StatCollector - .translateToLocalFormatted("BW.NEI.display.radhatch.0", this.getSievert())) - .setTextAlignment(Alignment.Center).setPos(60, 72)) - .widget(new FakeSyncWidget.IntegerSyncer(() -> this.sievert, val -> this.sievert = val)) - .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (!widget.isClient()) { - widget.getContext().openSyncedWindow(RADIATION_SHUTTER_WINDOW_ID); + new DrawableWidget().setBackground(BW_UITextures.PICTURE_SIEVERT_CONTAINER) + .setPos(61, 9) + .setSize(56, 24)) + .widget( + new ProgressBar().setProgress(() -> this.getSievert() / 148f) + .setDirection(Direction.RIGHT) + .setTexture(BW_UITextures.PROGRESSBAR_SIEVERT, 24) + .setPos(65, 13) + .setSize(48, 16)) + .widget( + new DrawableWidget().setBackground(BW_UITextures.PICTURE_DECAY_TIME_INSIDE) + .setPos(124, 18) + .setSize(16, 48)) + .widget(new DrawableWidget() { + + @Override + public void draw(float partialTicks) { + if (GT_MetaTileEntity_RadioHatch.this.decayTime > 0) { + int height = MathUtils.ceilInt( + 48 * ((GT_MetaTileEntity_RadioHatch.this.decayTime + - GT_MetaTileEntity_RadioHatch.this.timer % GT_MetaTileEntity_RadioHatch.this.decayTime) + / (float) GT_MetaTileEntity_RadioHatch.this.decayTime)); + new Rectangle() + .setColor( + Color.argb( + GT_MetaTileEntity_RadioHatch.this.colorForGUI[0], + GT_MetaTileEntity_RadioHatch.this.colorForGUI[1], + GT_MetaTileEntity_RadioHatch.this.colorForGUI[2], + 255)) + .draw(new Pos2d(0, 48 - height), new Size(16, height), partialTicks); } - }).addTooltip("Radiation Shutter").setBackground(GT_UITextures.BUTTON_STANDARD).setPos(153, 5) - .setSize(18, 18)) - .widget( - new ItemDrawable( - GT_MetaGenerated_Tool_01.INSTANCE - .getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, null, null, null)) - .asWidget().setPos(154, 6)); + } + }.dynamicTooltip( + () -> Collections.singletonList( + StatCollector.translateToLocalFormatted( + "tooltip.tile.radhatch.10.name", + this.timer <= 1 ? 0 : (this.decayTime - this.timer) / 20, + this.timer <= 1 ? 0 : this.decayTime / 20))) + .setPos(124, 18) + .setSize(16, 48) + .attachSyncer( + new FakeSyncWidget.LongSyncer(() -> this.decayTime, val -> this.decayTime = val), + builder, + (widget, val) -> widget.notifyTooltipChange()) + .attachSyncer( + new FakeSyncWidget.LongSyncer(() -> this.timer, val -> this.timer = val), + builder, + (widget, val) -> widget.notifyTooltipChange())) + .widget(new FakeSyncWidget.ShortSyncer(() -> this.colorForGUI[0], val -> this.colorForGUI[0] = val)) + .widget(new FakeSyncWidget.ShortSyncer(() -> this.colorForGUI[1], val -> this.colorForGUI[1] = val)) + .widget(new FakeSyncWidget.ShortSyncer(() -> this.colorForGUI[2], val -> this.colorForGUI[2] = val)) + .widget( + new DrawableWidget().setBackground(BW_UITextures.PICTURE_DECAY_TIME_CONTAINER) + .setPos(120, 14) + .setSize(24, 56)) + .widget( + new TextWidget() + .setStringSupplier( + () -> StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", this.mass)) + .setTextAlignment(Alignment.Center) + .setPos(65, 62)) + .widget(new FakeSyncWidget.ByteSyncer(() -> this.mass, val -> this.mass = val)) + .widget( + new TextWidget() + .setStringSupplier( + () -> StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.0", this.getSievert())) + .setTextAlignment(Alignment.Center) + .setPos(60, 72)) + .widget(new FakeSyncWidget.IntegerSyncer(() -> this.sievert, val -> this.sievert = val)) + .widget(new ButtonWidget().setOnClick((clickData, widget) -> { + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(RADIATION_SHUTTER_WINDOW_ID); + } + }) + .addTooltip("Radiation Shutter") + .setBackground(GT_UITextures.BUTTON_STANDARD) + .setPos(153, 5) + .setSize(18, 18)) + .widget( + new ItemDrawable( + GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, null, null, null)).asWidget() + .setPos(154, 6)); } private ModularWindow createShutterWindow(EntityPlayer player) { @@ -431,25 +445,35 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch builder.setGuiTint(this.getGUIColorization()); builder.widget( - new TextWidget("Radiation Shutter Control").setDefaultColor(this.COLOR_TITLE.get()).setPos(10, 9)) - .widget( - new DrawableWidget().setDrawable(BW_UITextures.PICTURE_RADIATION_SHUTTER_FRAME).setPos(14, 27) - .setSize(55, 54)) - .widget( - new DrawableWidget().setDrawable( - () -> this.coverage < 100 ? BW_UITextures.PICTURE_RADIATION_SHUTTER_INSIDE : null) - .setPos(16, 29).setSize(51, 50).attachSyncer( - new FakeSyncWidget.ByteSyncer(this::getCoverage, this::setCoverage), - builder, - (widget, val) -> widget.setPos(16, 29 + this.coverage / 2) - .setSize(51, 50 - this.coverage / 2))) - .widget( - new NumericWidget().setSetter(val -> this.coverage = (byte) val).setGetter(() -> this.coverage) - .setBounds(0, 100).setScrollValues(1, 5, 50).setTextColor(Color.WHITE.dark(1)) - .setTextAlignment(Alignment.CenterLeft) - .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD.withOffset(-1, -1, 2, 2)) - .setPos(86, 27).setSize(30, 12)) - .widget(ButtonWidget.closeWindowButton(true).setPos(176 - 15, 3)); + new TextWidget("Radiation Shutter Control").setDefaultColor(this.COLOR_TITLE.get()) + .setPos(10, 9)) + .widget( + new DrawableWidget().setDrawable(BW_UITextures.PICTURE_RADIATION_SHUTTER_FRAME) + .setPos(14, 27) + .setSize(55, 54)) + .widget( + new DrawableWidget() + .setDrawable(() -> this.coverage < 100 ? BW_UITextures.PICTURE_RADIATION_SHUTTER_INSIDE : null) + .setPos(16, 29) + .setSize(51, 50) + .attachSyncer( + new FakeSyncWidget.ByteSyncer(this::getCoverage, this::setCoverage), + builder, + (widget, val) -> widget.setPos(16, 29 + this.coverage / 2) + .setSize(51, 50 - this.coverage / 2))) + .widget( + new NumericWidget().setSetter(val -> this.coverage = (byte) val) + .setGetter(() -> this.coverage) + .setBounds(0, 100) + .setScrollValues(1, 5, 50) + .setTextColor(Color.WHITE.dark(1)) + .setTextAlignment(Alignment.CenterLeft) + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD.withOffset(-1, -1, 2, 2)) + .setPos(86, 27) + .setSize(30, 12)) + .widget( + ButtonWidget.closeWindowButton(true) + .setPos(176 - 15, 3)); return builder.build(); } @@ -457,13 +481,15 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch @Override public void addGregTechLogo(ModularWindow.Builder builder) { builder.widget( - new DrawableWidget().setDrawable(BW_UITextures.PICTURE_BW_LOGO_47X21).setSize(47, 21).setPos(10, 53)); + new DrawableWidget().setDrawable(BW_UITextures.PICTURE_BW_LOGO_47X21) + .setSize(47, 21) + .setPos(10, 53)); } @Override public GUITextureSet getGUITextureSet() { return new GUITextureSet().setMainBackground(GT_UITextures.BACKGROUND_SINGLEBLOCK_DEFAULT) - .setGregTechLogo(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT); + .setGregTechLogo(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java index 51a73c1533..46f20e441d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java @@ -31,12 +31,12 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin boolean powered; public GT_MetaTileEntity_Transistor(int aID, String aName, String aNameRegional, int aTier, String aDescription, - ITexture... aTextures) { + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 0, aDescription, aTextures); } public GT_MetaTileEntity_Transistor(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, - ITexture... aTextures) { + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 0, aDescription, aTextures); } @@ -54,29 +54,29 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin for (byte i = -1; i < 16; ++i) { rTextures[0][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; rTextures[1][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; rTextures[2][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; rTextures[3][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; rTextures[4][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; rTextures[5][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; rTextures[6][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] }; rTextures[7][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] }; rTextures[8][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] }; rTextures[9][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; rTextures[10][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; rTextures[11][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; } return rTextures; @@ -101,7 +101,7 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin return; } if (!tileAtSide.outputsEnergyTo(ForgeDirection.WEST) || !tileAtSide.isUniversalEnergyStored(4L) - || !tileAtSide.decreaseStoredEnergyUnits(4, false)) { + || !tileAtSide.decreaseStoredEnergyUnits(4, false)) { this.powered = false; return; } @@ -139,19 +139,19 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin @Override public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, ForgeDirection side, - ItemStack itemStack) { + ItemStack itemStack) { return false; } @Override public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, ForgeDirection side, - ItemStack itemStack) { + ItemStack itemStack) { return false; } @Override public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean b3, boolean b4) { + int colorIndex, boolean b3, boolean b4) { return new ITexture[0]; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java index c5fc4b1465..40233912e6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java @@ -31,10 +31,10 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { super(recipeCategory); if (!NEI_BW_Config.sIsAdded) { FMLInterModComms.sendRuntimeMessage( - GT_Values.GT, - "NEIPlugins", - "register-crafting-handler", - "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); + GT_Values.GT, + "NEIPlugins", + "register-crafting-handler", + "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); GuiUsageRecipe.usagehandlers.add(this); } @@ -48,8 +48,8 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { @Override public void loadCraftingRecipes(ItemStack aResult) { if (aResult != null && aResult.getItem() instanceof LabParts - && aResult.getItemDamage() < 3 - && aResult.getTagCompound() != null) { + && aResult.getItemDamage() < 3 + && aResult.getTagCompound() != null) { for (CachedDefaultRecipe recipe : this.getCache()) if (NEI_BW_Config.checkRecipe(aResult, recipe.mOutputs)) this.arecipes.add(recipe); } else { @@ -60,8 +60,8 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { @Override public void loadUsageRecipes(ItemStack aResult) { if (aResult != null && aResult.getItem() instanceof LabParts - && aResult.getItemDamage() < 3 - && aResult.getTagCompound() != null) { + && aResult.getItemDamage() < 3 + && aResult.getTagCompound() != null) { for (CachedDefaultRecipe recipe : this.getCache()) if (NEI_BW_Config.checkRecipe(aResult, recipe.mInputs)) this.arecipes.add(recipe); } else { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index 38f2a9c800..cddb16c6c8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -34,10 +34,10 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { super(recipeCategory); if (!NEI_BW_Config.sIsAdded) { FMLInterModComms.sendRuntimeMessage( - GT_Values.GT, - "NEIPlugins", - "register-crafting-handler", - "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); + GT_Values.GT, + "NEIPlugins", + "register-crafting-handler", + "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); GuiUsageRecipe.usagehandlers.add(this); } @@ -54,8 +54,7 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { // see constructor of CachedDefaultRecipe on why relx==120 and rely==52 means special slot for (PositionedStack stack : recipe.mInputs) { if (stack.relx == 120 && stack.rely == 52 - && NEI_BW_Config.checkRecipe(aResult, Collections.singletonList(stack))) - this.arecipes.add(recipe); + && NEI_BW_Config.checkRecipe(aResult, Collections.singletonList(stack))) this.arecipes.add(recipe); } } } @@ -63,8 +62,8 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { @Override public void loadUsageRecipes(ItemStack aResult) { if (aResult != null && aResult.getItem() instanceof LabParts - && aResult.getItemDamage() < 3 - && aResult.getTagCompound() != null) { + && aResult.getItemDamage() < 3 + && aResult.getTagCompound() != null) { this.loadLabPartRecipes(aResult); } else { super.loadUsageRecipes(aResult); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index a717e3915a..2b34250512 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -43,10 +43,10 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public BW_NEI_OreHandler() { if (!NEI_BW_Config.sIsAdded) { FMLInterModComms.sendRuntimeMessage( - MainMod.MOD_ID, - "NEIPlugins", - "register-crafting-handler", - MainMod.MOD_ID + "@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); + MainMod.MOD_ID, + "NEIPlugins", + "register-crafting-handler", + MainMod.MOD_ID + "@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); } } @@ -59,7 +59,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void loadTransferRects() { this.transferRects.add( - new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(0, 40, 40, 120), "quickanddirtyneihandler")); + new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(0, 40, 40, 120), "quickanddirtyneihandler")); } @Override @@ -71,12 +71,14 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public void loadCraftingRecipes(String outputId, Object... results) { if ("quickanddirtyneihandler".equalsIgnoreCase(outputId)) { HashSet result = new HashSet<>(); - Werkstoff.werkstoffHashSet.stream().filter(w -> w.hasGenerationFeature(OrePrefixes.ore)) - .forEach(w -> result.add(w.get(OrePrefixes.ore))); + Werkstoff.werkstoffHashSet.stream() + .filter(w -> w.hasGenerationFeature(OrePrefixes.ore)) + .forEach(w -> result.add(w.get(OrePrefixes.ore))); result.forEach(this::loadCraftingRecipes); result.clear(); - Werkstoff.werkstoffHashSet.stream().filter(w -> w.hasGenerationFeature(OrePrefixes.ore)) - .forEach(w -> result.add(w.get(OrePrefixes.oreSmall))); + Werkstoff.werkstoffHashSet.stream() + .filter(w -> w.hasGenerationFeature(OrePrefixes.ore)) + .forEach(w -> result.add(w.get(OrePrefixes.oreSmall))); result.forEach(this::loadCraftingRecipes); result.clear(); HashSet hashSet = new HashSet<>(this.arecipes); @@ -97,40 +99,75 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { CachedOreRecipe cachedOreRecipe = (CachedOreRecipe) this.arecipes.get(recipe); if (cachedOreRecipe == null || cachedOreRecipe.getOtherStacks() == null - || cachedOreRecipe.getOtherStacks().size() == 0) + || cachedOreRecipe.getOtherStacks() + .size() == 0) return; if (!cachedOreRecipe.small) { - if (cachedOreRecipe.getOtherStacks().get(0) == null - || cachedOreRecipe.getOtherStacks().get(0).item == null - || cachedOreRecipe.getOtherStacks().get(1) == null - || cachedOreRecipe.getOtherStacks().get(2) == null - || cachedOreRecipe.getOtherStacks().get(3) == null - || cachedOreRecipe.getOtherStacks().get(1).item == null - || cachedOreRecipe.getOtherStacks().get(2).item == null - || cachedOreRecipe.getOtherStacks().get(3).item == null) + if (cachedOreRecipe.getOtherStacks() + .get(0) == null + || cachedOreRecipe.getOtherStacks() + .get(0).item == null + || cachedOreRecipe.getOtherStacks() + .get(1) == null + || cachedOreRecipe.getOtherStacks() + .get(2) == null + || cachedOreRecipe.getOtherStacks() + .get(3) == null + || cachedOreRecipe.getOtherStacks() + .get(1).item == null + || cachedOreRecipe.getOtherStacks() + .get(2).item == null + || cachedOreRecipe.getOtherStacks() + .get(3).item == null) return; - } else if (cachedOreRecipe.getOtherStacks().get(0) == null - || cachedOreRecipe.getOtherStacks().get(0).item == null) + } else if (cachedOreRecipe.getOtherStacks() + .get(0) == null + || cachedOreRecipe.getOtherStacks() + .get(0).item == null) return; if (cachedOreRecipe.worldGen != null) GuiDraw.drawString( - ChatColorHelper.BOLD + "DIM: " + ChatColorHelper.RESET + cachedOreRecipe.worldGen.getDimName(), - 0, - 40, - 0, - false); + ChatColorHelper.BOLD + "DIM: " + ChatColorHelper.RESET + cachedOreRecipe.worldGen.getDimName(), + 0, + 40, + 0, + false); GuiDraw.drawString(ChatColorHelper.BOLD + "Primary:", 0, 50, 0, false); - GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(0).item.getDisplayName(), 0, 60, 0, false); + GuiDraw.drawString( + cachedOreRecipe.getOtherStacks() + .get(0).item.getDisplayName(), + 0, + 60, + 0, + false); if (!cachedOreRecipe.small) { GuiDraw.drawString(ChatColorHelper.BOLD + "Secondary:", 0, 70, 0, false); - GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(1).item.getDisplayName(), 0, 80, 0, false); + GuiDraw.drawString( + cachedOreRecipe.getOtherStacks() + .get(1).item.getDisplayName(), + 0, + 80, + 0, + false); GuiDraw.drawString(ChatColorHelper.BOLD + "InBetween:", 0, 90, 0, false); - GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(2).item.getDisplayName(), 0, 100, 0, false); + GuiDraw.drawString( + cachedOreRecipe.getOtherStacks() + .get(2).item.getDisplayName(), + 0, + 100, + 0, + false); GuiDraw.drawString(ChatColorHelper.BOLD + "Sporadic:", 0, 110, 0, false); - GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(3).item.getDisplayName(), 0, 120, 0, false); + GuiDraw.drawString( + cachedOreRecipe.getOtherStacks() + .get(3).item.getDisplayName(), + 0, + 120, + 0, + false); } else if (cachedOreRecipe.worldGen != null) { GuiDraw.drawString(ChatColorHelper.BOLD + "Amount per Chunk:", 0, 70, 0, false); GuiDraw.drawString(cachedOreRecipe.worldGen.mDensity + "", 0, 80, 0, false); @@ -143,12 +180,15 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public void loadCraftingRecipes(ItemStack result) { Block ore = Block.getBlockFromItem(result.getItem()); if (ore instanceof BW_MetaGenerated_Ores) { - BW_OreLayer.NEIMAP.get((short) result.getItemDamage()).stream().filter( - l -> !(ore instanceof BW_MetaGenerated_SmallOres) || !l.getClass().equals(BW_WorldGenRoss128b.class) - && !l.getClass().equals(BW_WorldGenRoss128ba.class)) - .forEach( - l -> this.arecipes - .add(new CachedOreRecipe(l, result, ore instanceof BW_MetaGenerated_SmallOres))); + BW_OreLayer.NEIMAP.get((short) result.getItemDamage()) + .stream() + .filter( + l -> !(ore instanceof BW_MetaGenerated_SmallOres) || !l.getClass() + .equals(BW_WorldGenRoss128b.class) + && !l.getClass() + .equals(BW_WorldGenRoss128ba.class)) + .forEach( + l -> this.arecipes.add(new CachedOreRecipe(l, result, ore instanceof BW_MetaGenerated_SmallOres))); } } @@ -185,7 +225,12 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { int x = 0; for (int i = 0; i < (this.small ? 1 : 4); i++) { x += 20; - ret.add(new PositionedStack(this.worldGen.getStacks().get(i), x, 12)); + ret.add( + new PositionedStack( + this.worldGen.getStacks() + .get(i), + x, + 12)); } return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index 9b403a743b..a6efebeb83 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -33,7 +33,8 @@ public class NEI_BW_Config implements IConfigureNEI { static boolean checkRecipe(ItemStack labPart, Iterable stacks) { for (PositionedStack stack : stacks) { for (ItemStack item : stack.items) { - if (labPart.getTagCompound().equals(item.getTagCompound())) { + if (labPart.getTagCompound() + .equals(item.getTagCompound())) { return true; } } @@ -48,20 +49,30 @@ public class NEI_BW_Config implements IConfigureNEI { API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses)); API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses2)); ItemStack[] prefixesToHide = { - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustTiny, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustSmall, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushed, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, WerkstoffLoader.Bismutite) - .copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedCentrifuged, WerkstoffLoader.Bismutite) - .copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.nugget, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemChipped, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawed, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawless, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemExquisite, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustImpure, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustPure, WerkstoffLoader.Bismutite).copy(), }; + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustTiny, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustSmall, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushed, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedCentrifuged, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.nugget, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemChipped, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawed, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawless, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemExquisite, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustImpure, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustPure, WerkstoffLoader.Bismutite) + .copy(), }; for (ItemStack stack : prefixesToHide) { stack.setItemDamage(Short.MAX_VALUE); API.hideItem(stack); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java index 7445946828..3ea2f28cb9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java @@ -38,7 +38,7 @@ public class ServerEventHandler { public void EntityJoinWorldEvent(EntityJoinWorldEvent event) { if (event == null || !(event.entity instanceof EntityPlayerMP) || !SideReference.Side.Server) return; MainMod.BW_Network_instance - .sendToPlayer(new OreDictCachePacket(OreDictHandler.getNonBWCache()), (EntityPlayerMP) event.entity); + .sendToPlayer(new OreDictCachePacket(OreDictHandler.getNonBWCache()), (EntityPlayerMP) event.entity); MainMod.BW_Network_instance.sendToPlayer(new ServerJoinedPackage(null), (EntityPlayerMP) event.entity); } @@ -46,8 +46,7 @@ public class ServerEventHandler { @SubscribeEvent(priority = EventPriority.HIGHEST) public void onPlayerTickEventServer(TickEvent.PlayerTickEvent event) { if (event == null || !(event.player instanceof EntityPlayerMP) - || event.player.worldObj.getTotalWorldTime() % 20 != 0) - return; + || event.player.worldObj.getTotalWorldTime() % 20 != 0) return; boolean replace = false; ItemStack toReplace = null; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java index 97924d1447..87ee19833d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java @@ -25,7 +25,7 @@ import gregtech.api.enums.Materials; public class BW_GT_MaterialReference { private static final Werkstoff.GenerationFeatures ADD_CASINGS_ONLY = new Werkstoff.GenerationFeatures().disable() - .addCasings(); + .addCasings(); public static Werkstoff Aluminium = new Werkstoff(Materials.Aluminium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 19); public static Werkstoff Americium = new Werkstoff(Materials.Americium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 103); @@ -68,16 +68,16 @@ public class BW_GT_MaterialReference { public static Werkstoff Phosphorus = new Werkstoff(Materials.Phosphorus, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 21); public static Werkstoff Platinum = new Werkstoff(Materials.Platinum, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 85); public static Werkstoff Plutonium241 = new Werkstoff( - Materials.Plutonium241, - ADD_CASINGS_ONLY, - ISOTOPE, - 31_766 + 101); + Materials.Plutonium241, + ADD_CASINGS_ONLY, + ISOTOPE, + 31_766 + 101); public static Werkstoff Potassium = new Werkstoff(Materials.Potassium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 25); public static Werkstoff Praseodymium = new Werkstoff( - Materials.Praseodymium, - ADD_CASINGS_ONLY, - ELEMENT, - 31_766 + 66); + Materials.Praseodymium, + ADD_CASINGS_ONLY, + ELEMENT, + 31_766 + 66); public static Werkstoff Promethium = new Werkstoff(Materials.Promethium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 68); public static Werkstoff Rubidium = new Werkstoff(Materials.Rubidium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 43); public static Werkstoff Samarium = new Werkstoff(Materials.Samarium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 69); @@ -105,68 +105,68 @@ public class BW_GT_MaterialReference { public static Werkstoff Ardite = new Werkstoff(Materials.Ardite, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 382); public static Werkstoff Naquadah = new Werkstoff(Materials.Naquadah, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 324); public static Werkstoff NaquadahAlloy = new Werkstoff( - Materials.NaquadahAlloy, - ADD_CASINGS_ONLY, - COMPOUND, - 31_766 + 325); + Materials.NaquadahAlloy, + ADD_CASINGS_ONLY, + COMPOUND, + 31_766 + 325); public static Werkstoff NaquadahEnriched = new Werkstoff( - Materials.NaquadahEnriched, - ADD_CASINGS_ONLY, - ISOTOPE, - 31_766 + 326); + Materials.NaquadahEnriched, + ADD_CASINGS_ONLY, + ISOTOPE, + 31_766 + 326); public static Werkstoff Naquadria = new Werkstoff(Materials.Naquadria, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 327); public static Werkstoff WroughtIron = new Werkstoff(Materials.WroughtIron, ADD_CASINGS_ONLY, ISOTOPE, 31_766 + 304); public static Werkstoff AnnealedCopper = new Werkstoff( - Materials.AnnealedCopper, - ADD_CASINGS_ONLY, - ISOTOPE, - 31_766 + 345); + Materials.AnnealedCopper, + ADD_CASINGS_ONLY, + ISOTOPE, + 31_766 + 345); public static Werkstoff Osmiridium = new Werkstoff(Materials.Osmiridium, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 317); public static Werkstoff SterlingSilver = new Werkstoff( - Materials.SterlingSilver, - ADD_CASINGS_ONLY, - MIXTURE, - 31_766 + 350); + Materials.SterlingSilver, + ADD_CASINGS_ONLY, + MIXTURE, + 31_766 + 350); public static Werkstoff RoseGold = new Werkstoff(Materials.RoseGold, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 351); public static Werkstoff BlackBronze = new Werkstoff(Materials.BlackBronze, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 352); public static Werkstoff BismuthBronze = new Werkstoff( - Materials.BismuthBronze, - ADD_CASINGS_ONLY, - MIXTURE, - 31_766 + 353); + Materials.BismuthBronze, + ADD_CASINGS_ONLY, + MIXTURE, + 31_766 + 353); public static Werkstoff BlackSteel = new Werkstoff(Materials.BlackSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 334); public static Werkstoff RedSteel = new Werkstoff(Materials.RedSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 348); public static Werkstoff BlueSteel = new Werkstoff(Materials.BlueSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 349); public static Werkstoff DamascusSteel = new Werkstoff( - Materials.DamascusSteel, - ADD_CASINGS_ONLY, - MIXTURE, - 31_766 + 335); + Materials.DamascusSteel, + ADD_CASINGS_ONLY, + MIXTURE, + 31_766 + 335); public static Werkstoff TungstenSteel = new Werkstoff( - Materials.TungstenSteel, - ADD_CASINGS_ONLY, - MIXTURE, - 31_766 + 316); + Materials.TungstenSteel, + ADD_CASINGS_ONLY, + MIXTURE, + 31_766 + 316); public static Werkstoff Ultimet = new Werkstoff(Materials.Ultimet, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 344); public static Werkstoff TungstenCarbide = new Werkstoff( - Materials.TungstenCarbide, - ADD_CASINGS_ONLY, - MIXTURE, - 31_766 + 370); + Materials.TungstenCarbide, + ADD_CASINGS_ONLY, + MIXTURE, + 31_766 + 370); public static Werkstoff VanadiumSteel = new Werkstoff( - Materials.VanadiumSteel, - ADD_CASINGS_ONLY, - MIXTURE, - 31_766 + 371); + Materials.VanadiumSteel, + ADD_CASINGS_ONLY, + MIXTURE, + 31_766 + 371); public static Werkstoff HSSG = new Werkstoff(Materials.HSSG, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 372); public static Werkstoff HSSE = new Werkstoff(Materials.HSSE, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 373); public static Werkstoff HSSS = new Werkstoff(Materials.HSSS, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 374); public static Werkstoff StainlessSteel = new Werkstoff( - Materials.StainlessSteel, - ADD_CASINGS_ONLY, - MIXTURE, - 31_766 + 306); + Materials.StainlessSteel, + ADD_CASINGS_ONLY, + MIXTURE, + 31_766 + 306); public static Werkstoff Brass = new Werkstoff(Materials.Brass, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 301); public static Werkstoff Bronze = new Werkstoff(Materials.Bronze, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 300); @@ -174,17 +174,19 @@ public class BW_GT_MaterialReference { public static Werkstoff Steel = new Werkstoff(Materials.Steel, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 305); public static Werkstoff Polytetrafluoroethylene = new Werkstoff( - Materials.Polytetrafluoroethylene, - ADD_CASINGS_ONLY, - COMPOUND, - 31_766 + 473); + Materials.Polytetrafluoroethylene, + ADD_CASINGS_ONLY, + COMPOUND, + 31_766 + 473); public static Werkstoff Plastic = new Werkstoff(Materials.Plastic, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 874); public static Werkstoff Epoxid = new Werkstoff(Materials.Epoxid, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 470); public static Werkstoff Magnesia = new Werkstoff( - Materials.Magnesia, - new Werkstoff.GenerationFeatures().disable().addMetalItems().addMolten(), - COMPOUND, - 31_766 + 471); + Materials.Magnesia, + new Werkstoff.GenerationFeatures().disable() + .addMetalItems() + .addMolten(), + COMPOUND, + 31_766 + 471); public static void init() { MainMod.LOGGER.info("Load Elements from GT"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java index 24402ac369..41f28d033a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java @@ -39,7 +39,7 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { @Override public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, - float hitX, float hitY, float hitZ) { + float hitX, float hitY, float hitZ) { return false; } @@ -89,7 +89,7 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { @Override public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, - float hitX, float hitY, float hitZ, int aMeta) { + float hitX, float hitY, float hitZ, int aMeta) { short tDamage = (short) this.getDamage(aStack); if (tDamage > 0) { if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java index fef152ec40..6fb1650c1f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -32,10 +32,10 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks - implements com.gtnewhorizon.structurelib.structure.ICustomBlockSetting { + implements com.gtnewhorizon.structurelib.structure.ICustomBlockSetting { public BW_MetaGeneratedBlocks_Casing(Material p_i45386_1_, Class tileEntity, String blockName, - OrePrefixes prefixes) { + OrePrefixes prefixes) { super(p_i45386_1_, tileEntity, blockName, prefixes); } @@ -92,15 +92,16 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks @SideOnly(Side.CLIENT) public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { Werkstoff.werkstoffHashSet.stream() - .filter( - pMaterial -> Werkstoff.Types.BIOLOGICAL.equals(pMaterial.getType()) - && pMaterial.hasGenerationFeature(OrePrefixes.blockCasing) - || pMaterial.doesOreDictedItemExists(OrePrefixes.plate) - && pMaterial.doesOreDictedItemExists(OrePrefixes.screw) - && pMaterial.doesOreDictedItemExists(OrePrefixes.plateDouble) - && pMaterial.doesOreDictedItemExists(OrePrefixes.gearGt) - && pMaterial.doesOreDictedItemExists(OrePrefixes.gearGtSmall)) - .map(pMaterial -> new ItemStack(aItem, 1, pMaterial.getmID())).forEach(aList::add); + .filter( + pMaterial -> Werkstoff.Types.BIOLOGICAL.equals(pMaterial.getType()) + && pMaterial.hasGenerationFeature(OrePrefixes.blockCasing) + || pMaterial.doesOreDictedItemExists(OrePrefixes.plate) + && pMaterial.doesOreDictedItemExists(OrePrefixes.screw) + && pMaterial.doesOreDictedItemExists(OrePrefixes.plateDouble) + && pMaterial.doesOreDictedItemExists(OrePrefixes.gearGt) + && pMaterial.doesOreDictedItemExists(OrePrefixes.gearGtSmall)) + .map(pMaterial -> new ItemStack(aItem, 1, pMaterial.getmID())) + .forEach(aList::add); } /** @@ -112,7 +113,9 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks Thread.sleep(1); // Fucking Minecraft TE settings. } catch (InterruptedException ignored) {} - Optional.ofNullable(world.getTileEntity(x, y, z)).filter(te -> te instanceof BW_MetaGenerated_Block_TE) - .map(te -> (BW_MetaGenerated_Block_TE) te).ifPresent(te -> te.mMetaData = (short) meta); + Optional.ofNullable(world.getTileEntity(x, y, z)) + .filter(te -> te instanceof BW_MetaGenerated_Block_TE) + .map(te -> (BW_MetaGenerated_Block_TE) te) + .ifPresent(te -> te.mMetaData = (short) meta); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java index 9f1b197b8d..02dd3c8f58 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java @@ -39,13 +39,13 @@ public class BW_MetaGeneratedBlocks_CasingAdvanced_TE extends BW_MetaGenerated_B if (aMaterial != null) { TextureSet set = aMaterial.getTexSet(); ITexture aIconSet = TextureFactory.of( - PrefixTextureLinker.texMapBlocks.get(OrePrefixes.blockCasingAdvanced) - .getOrDefault(set, TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]), - aMaterial.getRGBA()); + PrefixTextureLinker.texMapBlocks.get(OrePrefixes.blockCasingAdvanced) + .getOrDefault(set, TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]), + aMaterial.getRGBA()); return new ITexture[] { TextureFactory.of(Blocks.iron_block), aIconSet }; } } return new ITexture[] { TextureFactory.of(Blocks.iron_block), - TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) }; + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java index f23fc3a912..af61e1a68a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java @@ -39,13 +39,13 @@ public class BW_MetaGeneratedBlocks_Casing_TE extends BW_MetaGenerated_Block_TE if (aMaterial != null) { TextureSet set = aMaterial.getTexSet(); ITexture aIconSet = TextureFactory.of( - PrefixTextureLinker.texMapBlocks.get(OrePrefixes.blockCasing) - .getOrDefault(set, TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]), - aMaterial.getRGBA()); + PrefixTextureLinker.texMapBlocks.get(OrePrefixes.blockCasing) + .getOrDefault(set, TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]), + aMaterial.getRGBA()); return new ITexture[] { TextureFactory.of(Blocks.iron_block), aIconSet }; } } return new ITexture[] { TextureFactory.of(Blocks.iron_block), - TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) }; + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java index 79cb2438dd..ee5a0a1511 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java @@ -44,15 +44,18 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { GT_OreDictUnificator.registerOre(OrePrefixes.frameGt, aMaterial, this.getStackForm(1)); GT_ModHandler.addCraftingRecipe( - this.getStackForm(2), - RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "SSS", "SwS", "SSS", 'S', this.mMaterial.get(OrePrefixes.stick) }); + this.getStackForm(2), + RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "SSS", "SwS", "SSS", 'S', this.mMaterial.get(OrePrefixes.stick) }); RA.stdBuilder() - .itemInputs( - GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.getVarName(), 4), - ItemList.Circuit_Integrated.getWithDamage(0, 4)) - .itemOutputs(getStackForm(1)).duration(3 * SECONDS + 4 * TICKS).eut(8).addTo(assemblerRecipes); + .itemInputs( + GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.getVarName(), 4), + ItemList.Circuit_Integrated.getWithDamage(0, 4)) + .itemOutputs(getStackForm(1)) + .duration(3 * SECONDS + 4 * TICKS) + .eut(8) + .addTo(assemblerRecipes); } private BW_MetaGeneratedFrames(String aName, Werkstoff aMaterial) { @@ -71,10 +74,10 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, byte aConnections, - int aColorIndex, boolean aConnected, boolean aRedstone) { + int aColorIndex, boolean aConnected, boolean aRedstone) { return new ITexture[] { TextureFactory.of( - this.mMaterial.getTexSet().mTextures[OrePrefixes.frameGt.mTextureIndex], - Dyes.getModulation(aColorIndex, this.mMaterial.getRGBA())) }; + this.mMaterial.getTexSet().mTextures[OrePrefixes.frameGt.mTextureIndex], + Dyes.getModulation(aColorIndex, this.mMaterial.getRGBA())) }; } @Override @@ -119,13 +122,13 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { @Override public final boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { + ItemStack aStack) { return false; } @Override public final boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { + ItemStack aStack) { return false; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index c53ef3f523..9b393dff0f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -52,11 +52,11 @@ public class BW_MetaGeneratedOreTE extends BW_MetaGenerated_Block_TE { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if (aMaterial != null) { ITexture aIconSet = TextureFactory - .of(aMaterial.getTexSet().mTextures[OrePrefixes.ore.mTextureIndex], aMaterial.getRGBA()); + .of(aMaterial.getTexSet().mTextures[OrePrefixes.ore.mTextureIndex], aMaterial.getRGBA()); return new ITexture[] { TextureFactory.of(Blocks.stone), aIconSet }; } return new ITexture[] { TextureFactory.of(Blocks.stone), - TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex]) }; + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex]) }; } @Override @@ -71,7 +71,8 @@ public class BW_MetaGeneratedOreTE extends BW_MetaGenerated_Block_TE { rList.add(new ItemStack(Blocks.cobblestone, 1, 0)); return rList; } - Materials aOreMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData).getBridgeMaterial(); + Materials aOreMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData) + .getBridgeMaterial(); if (shouldSilkTouch) { rList.add(new ItemStack(this.GetProperBlock(), 1, this.mMetaData)); } else { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java index de4dbb1cbc..110b17321f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java @@ -34,27 +34,22 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { @Override public ArrayList getDrops(int aFortune) { ArrayList rList = new ArrayList<>(); - Materials aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData).getBridgeMaterial(); + Materials aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData) + .getBridgeMaterial(); if (aMaterial != null) { Random tRandom = new XSTR(this.xCoord ^ this.yCoord ^ this.zCoord); ArrayList tSelector = new ArrayList<>(); - ItemStack tStack = GT_OreDictUnificator.get( - OrePrefixes.gemExquisite, - aMaterial, - GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), - 1L); + ItemStack tStack = GT_OreDictUnificator + .get(OrePrefixes.gemExquisite, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); if (tStack != null) { for (int i = 0; i < 1; i++) { tSelector.add(tStack); } } - tStack = GT_OreDictUnificator.get( - OrePrefixes.gemFlawless, - aMaterial, - GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), - 1L); + tStack = GT_OreDictUnificator + .get(OrePrefixes.gemFlawless, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); if (tStack != null) { for (int i = 0; i < 2; i++) { tSelector.add(tStack); @@ -67,10 +62,10 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { } } tStack = GT_OreDictUnificator.get( - OrePrefixes.gemFlawed, - aMaterial, - GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L), - 1L); + OrePrefixes.gemFlawed, + aMaterial, + GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L), + 1L); if (tStack != null) { for (int i = 0; i < 5; i++) { tSelector.add(tStack); @@ -83,10 +78,10 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { } } tStack = GT_OreDictUnificator.get( - OrePrefixes.gemChipped, - aMaterial, - GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L), - 1L); + OrePrefixes.gemChipped, + aMaterial, + GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L), + 1L); if (tStack != null) { for (int i = 0; i < 5; i++) { tSelector.add(tStack); @@ -107,10 +102,8 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { } if (tRandom.nextInt(3 + aFortune) > 1) { rList.add( - GT_OreDictUnificator.get( - tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, - Materials.Stone, - 1L)); + GT_OreDictUnificator + .get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Stone, 1L)); } } return rList; @@ -121,11 +114,11 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if (aMaterial != null) { ITexture aIconSet = TextureFactory - .of(aMaterial.getTexSet().mTextures[OrePrefixes.oreSmall.mTextureIndex], aMaterial.getRGBA()); + .of(aMaterial.getTexSet().mTextures[OrePrefixes.oreSmall.mTextureIndex], aMaterial.getRGBA()); return new ITexture[] { TextureFactory.of(Blocks.stone), aIconSet }; } - return new ITexture[] { TextureFactory.of(Blocks.stone), TextureFactory - .of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.oreSmall.mTextureIndex]) }; + return new ITexture[] { TextureFactory.of(Blocks.stone), + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.oreSmall.mTextureIndex]) }; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java index e29de514a5..77d3c23fbc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java @@ -52,10 +52,10 @@ public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements IT @Override public Packet getDescriptionPacket() { if (!this.worldObj.isRemote) BW_Network_instance.sendPacketToAllPlayersInRange( - this.worldObj, - new MetaBlockPacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), - this.xCoord, - this.zCoord); + this.worldObj, + new MetaBlockPacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), + this.xCoord, + this.zCoord); return null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java index 84bcb5ffef..84a498070a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java @@ -44,7 +44,7 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { } public BW_MetaGenerated_Blocks(Material p_i45386_1_, Class tileEntity, String blockName, - OrePrefixes types) { + OrePrefixes types) { super(p_i45386_1_, tileEntity, blockName); this.setHardness(5.0F); this.setResistance(5.0F); @@ -53,8 +53,8 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { this._prefixes = types; if (this._prefixes != null) { this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization( - "bw.blocktype." + this._prefixes, - this._prefixes.mLocalizedMaterialPre + "%material" + this._prefixes.mLocalizedMaterialPost); + "bw.blocktype." + this._prefixes, + this._prefixes.mLocalizedMaterialPre + "%material" + this._prefixes.mLocalizedMaterialPost); } Werkstoff.werkstoffHashSet.forEach(this::doRegistrationStuff); } @@ -124,6 +124,8 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { if (tTileEntity instanceof BW_MetaGenerated_Block_TE metaTE) { return metaTE.getDrops(aFortune); } - return mTemporaryTileEntity.get() == null ? new ArrayList<>() : mTemporaryTileEntity.get().getDrops(aFortune); + return mTemporaryTileEntity.get() == null ? new ArrayList<>() + : mTemporaryTileEntity.get() + .getDrops(aFortune); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 7f9a3196dd..4c355284ae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -66,16 +66,16 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa super("bwMetaGeneratedGTEnhancement" + orePrefixes.name(), (short) 32766, (short) 0); this.orePrefixes = orePrefixes; this.itemTypeLocalizedName = GT_LanguageManager.addStringLocalization( - "bw.itemtype." + orePrefixes, - orePrefixes.mLocalizedMaterialPre + "%material" + orePrefixes.mLocalizedMaterialPost); + "bw.itemtype." + orePrefixes, + orePrefixes.mLocalizedMaterialPre + "%material" + orePrefixes.mLocalizedMaterialPost); } public BW_MetaGenerated_Items(OrePrefixes orePrefixes) { super("bwMetaGenerated" + orePrefixes.name(), (short) 32766, (short) 0); this.orePrefixes = orePrefixes; this.itemTypeLocalizedName = GT_LanguageManager.addStringLocalization( - "bw.itemtype." + orePrefixes, - orePrefixes.mLocalizedMaterialPre + "%material" + orePrefixes.mLocalizedMaterialPost); + "bw.itemtype." + orePrefixes, + orePrefixes.mLocalizedMaterialPre + "%material" + orePrefixes.mLocalizedMaterialPost); this.setCreativeTab(BW_MetaGenerated_Items.metaTab); for (Werkstoff w : werkstoffHashSet) { ItemStack tStack = new ItemStack(this, 1, w.getmID()); @@ -87,8 +87,9 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public boolean onEntityItemUpdate(EntityItem aItemEntity) { if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure - || this.orePrefixes == OrePrefixes.crushed) { - int aDamage = aItemEntity.getEntityItem().getItemDamage(); + || this.orePrefixes == OrePrefixes.crushed) { + int aDamage = aItemEntity.getEntityItem() + .getItemDamage(); if (aDamage >= 0 && !aItemEntity.worldObj.isRemote) { Werkstoff aMaterial = werkstoffHashMap.get((short) aDamage); if (aMaterial != null && aMaterial != Werkstoff.default_null_Werkstoff) { @@ -100,18 +101,18 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa if (tBlock == Blocks.cauldron && tMetaData > 0) { if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure) { aItemEntity.setEntityItemStack( - WerkstoffLoader.getCorrespondingItemStack( - OrePrefixes.dust, - aMaterial, - aItemEntity.getEntityItem().stackSize)); + WerkstoffLoader.getCorrespondingItemStack( + OrePrefixes.dust, + aMaterial, + aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } else { aItemEntity.setEntityItemStack( - WerkstoffLoader.getCorrespondingItemStack( - OrePrefixes.crushedPurified, - aMaterial, - aItemEntity.getEntityItem().stackSize)); + WerkstoffLoader.getCorrespondingItemStack( + OrePrefixes.crushedPurified, + aMaterial, + aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } @@ -131,7 +132,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify.2")); if (aStack != null && aStack.getItem() instanceof BW_MetaGenerated_Items - && aStack.getItemDamage() == WerkstoffLoader.Tiberium.getmID()) + && aStack.getItemDamage() == WerkstoffLoader.Tiberium.getmID()) aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.nqgen")); Werkstoff werkstoff = werkstoffHashMap.get((short) this.getDamage(aStack)); @@ -164,12 +165,15 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa public IIconContainer getIconContainer(int aMetaData) { if (werkstoffHashMap.get((short) aMetaData) == null) return null; if (this.orePrefixes.mTextureIndex == -1) return this.getIconContainerBartWorks(aMetaData); - return werkstoffHashMap.get((short) aMetaData).getTexSet().mTextures[this.orePrefixes.mTextureIndex]; + return werkstoffHashMap.get((short) aMetaData) + .getTexSet().mTextures[this.orePrefixes.mTextureIndex]; } protected IIconContainer getIconContainerBartWorks(int aMetaData) { if (SideReference.Side.Client) return PrefixTextureLinker.texMap.get(this.orePrefixes) - .get(werkstoffHashMap.get((short) aMetaData).getTexSet()); + .get( + werkstoffHashMap.get((short) aMetaData) + .getTexSet()); return null; } @@ -200,11 +204,13 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa Werkstoff w = werkstoffHashMap.get((short) aStack.getItemDamage()); if (w == null || w.getStats() == null) return; - if (w.getStats().isToxic() && !GT_Utility.isWearingFullBioHazmat(bPlayer)) { + if (w.getStats() + .isToxic() && !GT_Utility.isWearingFullBioHazmat(bPlayer)) { bPlayer.addPotionEffect(new PotionEffect(Potion.poison.getId(), 80, 4)); } - if (w.getStats().isRadioactive() && !GT_Utility.isWearingFullRadioHazmat(bPlayer)) { + if (w.getStats() + .isRadioactive() && !GT_Utility.isWearingFullRadioHazmat(bPlayer)) { bPlayer.addPotionEffect(new PotionEffect(IC2Potion.radiation.id, 80, 4)); } } @@ -227,7 +233,11 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public int getRadiationLevel(ItemStack aStack) { Werkstoff w = werkstoffHashMap.get((short) aStack.getItemDamage()); - return w.getStats().isRadioactive() ? (int) w.getStats().getProtons() : 0; + return w.getStats() + .isRadioactive() + ? (int) w.getStats() + .getProtons() + : 0; } @Override @@ -250,16 +260,13 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public int getCapacity(ItemStack aStack) { return this.orePrefixes == OrePrefixes.capsule || this.orePrefixes == OrePrefixes.cell - || this.orePrefixes == OrePrefixes.cellPlasma - ? 1000 - : this.orePrefixes == OrePrefixes.cellMolten || this.orePrefixes == OrePrefixes.capsuleMolten - ? 144 - : 0; + || this.orePrefixes == OrePrefixes.cellPlasma ? 1000 + : this.orePrefixes == OrePrefixes.cellMolten || this.orePrefixes == OrePrefixes.capsuleMolten ? 144 : 0; } @Override public ItemStack getContainerItem(ItemStack aStack) { return this.orePrefixes == OrePrefixes.cell || this.orePrefixes == OrePrefixes.cellPlasma - || this.orePrefixes == OrePrefixes.cellMolten ? Materials.Empty.getCells(1) : null; + || this.orePrefixes == OrePrefixes.cellMolten ? Materials.Empty.getCells(1) : null; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 7f1e56607f..2adb0d3d35 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -41,8 +41,8 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { public BW_MetaGenerated_Ores(Material p_i45386_1_, Class tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization( - "bw.blocktype." + OrePrefixes.ore, - OrePrefixes.ore.mLocalizedMaterialPre + "%material" + OrePrefixes.ore.mLocalizedMaterialPost); + "bw.blocktype." + OrePrefixes.ore, + OrePrefixes.ore.mLocalizedMaterialPre + "%material" + OrePrefixes.ore.mLocalizedMaterialPost); } @Override @@ -54,7 +54,7 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { } public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, - int[] aBlockMeta) { + int[] aBlockMeta) { if (!air) { aY = MathUtils.clamp(aY, 1, aWorld.getActualHeight()); } @@ -62,11 +62,12 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { Block tBlock = aWorld.getBlock(aX, aY, aZ); Block tOreBlock = WerkstoffLoader.BWOres; if (aMetaData < 0 || tBlock == Blocks.air && !air - || Block.getIdFromBlock(tBlock) != Block.getIdFromBlock(block)) { + || Block.getIdFromBlock(tBlock) != Block.getIdFromBlock(block)) { return false; } final int aaY = aY; - if (Arrays.stream(aBlockMeta).noneMatch(e -> e == aWorld.getBlockMetadata(aX, aaY, aZ))) { + if (Arrays.stream(aBlockMeta) + .noneMatch(e -> e == aWorld.getBlockMetadata(aX, aaY, aZ))) { return false; } @@ -104,7 +105,7 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { for (Werkstoff tMaterial : Werkstoff.werkstoffHashSet) { if (tMaterial != null && tMaterial.hasItemType(OrePrefixes.ore) - && (tMaterial.getGenerationFeatures().blacklist & 0x8) == 0) { + && (tMaterial.getGenerationFeatures().blacklist & 0x8) == 0) { aList.add(new ItemStack(aItem, 1, tMaterial.getmID())); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java index fc6b757361..0778645cb5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java @@ -30,8 +30,8 @@ public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { public BW_MetaGenerated_SmallOres(Material p_i45386_1_, Class tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization( - "bw.blocktype." + OrePrefixes.oreSmall, - OrePrefixes.oreSmall.mLocalizedMaterialPre + "%material" + OrePrefixes.oreSmall.mLocalizedMaterialPost); + "bw.blocktype." + OrePrefixes.oreSmall, + OrePrefixes.oreSmall.mLocalizedMaterialPre + "%material" + OrePrefixes.oreSmall.mLocalizedMaterialPost); } @Override @@ -48,7 +48,7 @@ public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { } public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, - int[] aBlockMeta) { + int[] aBlockMeta) { if (!air) { aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); } @@ -56,11 +56,12 @@ public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { Block tBlock = aWorld.getBlock(aX, aY, aZ); Block tOreBlock = WerkstoffLoader.BWSmallOres; if (aMetaData < 0 || tBlock == Blocks.air && !air - || Block.getIdFromBlock(tBlock) != Block.getIdFromBlock(block)) { + || Block.getIdFromBlock(tBlock) != Block.getIdFromBlock(block)) { return false; } final int aaY = aY; - if (Arrays.stream(aBlockMeta).noneMatch(e -> e == aWorld.getBlockMetadata(aX, aaY, aZ))) { + if (Arrays.stream(aBlockMeta) + .noneMatch(e -> e == aWorld.getBlockMetadata(aX, aaY, aZ))) { return false; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java index f82b90863a..4456a66535 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java @@ -34,14 +34,13 @@ public class BW_MetaGenerated_WerkstoffBlock_TE extends BW_MetaGenerated_Block_T if (aMaterial != null) { TextureSet set = aMaterial.getTexSet(); ITexture aIconSet = TextureFactory.of( - set.mTextures[PrefixTextureLinker.blockTexMap - .getOrDefault(set, OrePrefixes.block.mTextureIndex)], - aMaterial.getRGBA()); + set.mTextures[PrefixTextureLinker.blockTexMap.getOrDefault(set, OrePrefixes.block.mTextureIndex)], + aMaterial.getRGBA()); return new ITexture[] { TextureFactory.of(Blocks.iron_block), aIconSet }; } } return new ITexture[] { TextureFactory.of(Blocks.iron_block), - TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) }; + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) }; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java index 8e149391cd..648f9a0027 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java @@ -30,11 +30,11 @@ import gregtech.api.util.GT_LanguageManager; public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks { public BW_MetaGenerated_WerkstoffBlocks(Material p_i45386_1_, Class tileEntity, - String blockName) { + String blockName) { super(p_i45386_1_, tileEntity, blockName); this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization( - "bw.blocktype." + OrePrefixes.block, - OrePrefixes.block.mLocalizedMaterialPre + "%material" + OrePrefixes.block.mLocalizedMaterialPost); + "bw.blocktype." + OrePrefixes.block, + OrePrefixes.block.mLocalizedMaterialPre + "%material" + OrePrefixes.block.mLocalizedMaterialPost); } @Override @@ -58,7 +58,8 @@ public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks { @Override public void getSubBlocks(Item aItem, CreativeTabs tab, List aList) { Werkstoff.werkstoffHashSet.stream() - .filter(tMaterial -> tMaterial.hasItemType(OrePrefixes.gem) || tMaterial.hasItemType(OrePrefixes.ingot)) - .map(tMaterial -> new ItemStack(aItem, 1, tMaterial.getmID())).forEach(aList::add); + .filter(tMaterial -> tMaterial.hasItemType(OrePrefixes.gem) || tMaterial.hasItemType(OrePrefixes.ingot)) + .map(tMaterial -> new ItemStack(aItem, 1, tMaterial.getmID())) + .forEach(aList::add); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java index 3315bfea4c..db53437858 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java @@ -83,7 +83,7 @@ public enum BW_NonMeta_MaterialItems implements IItemContainer { public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT) { if (GT_Utility.isStackInvalid(aStack)) return false; return GT_Utility - .areUnificationsEqual((ItemStack) aStack, aWildcard ? this.getWildcard(1) : this.get(1), aIgnoreNBT); + .areUnificationsEqual((ItemStack) aStack, aWildcard ? this.getWildcard(1) : this.get(1), aIgnoreNBT); } @Override @@ -116,7 +116,7 @@ public enum BW_NonMeta_MaterialItems implements IItemContainer { throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!"); if (GT_Utility.isStackInvalid(this.mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); return GT_Utility - .copyAmountAndMetaData(aAmount, this.mStack.getMaxDamage() - 1, GT_OreDictUnificator.get(this.mStack)); + .copyAmountAndMetaData(aAmount, this.mStack.getMaxDamage() - 1, GT_OreDictUnificator.get(this.mStack)); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index 91d5a87dd5..99eb6e7d7e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -72,24 +72,26 @@ public class BW_Meta_Items { BW_Meta_Items.NEWCIRCUITS.addItem(3, "Imprint supporting Board", "A Board needed for Circuit Imprints"); GT_Values.RA.stdBuilder() - .itemInputs( - WerkstoffLoader.MagnetoResonaticDust.get(OrePrefixes.dust, 1), - WerkstoffLoader.ArInGaPhoBiBoTe.get(OrePrefixes.dust, 4)) - .itemOutputs(BW_Meta_Items.NEWCIRCUITS.getStack(2)).duration(15 * SECONDS).eut(TierEU.RECIPE_HV) - .addTo(formingPressRecipes); + .itemInputs( + WerkstoffLoader.MagnetoResonaticDust.get(OrePrefixes.dust, 1), + WerkstoffLoader.ArInGaPhoBiBoTe.get(OrePrefixes.dust, 4)) + .itemOutputs(BW_Meta_Items.NEWCIRCUITS.getStack(2)) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_HV) + .addTo(formingPressRecipes); RecipeMaps.autoclaveRecipes.add( - new GT_Recipe( - false, - new ItemStack[] { BW_Meta_Items.NEWCIRCUITS.getStack(2) }, - new ItemStack[] { BW_Meta_Items.NEWCIRCUITS.getStack(3) }, - null, - new int[] { 7500 }, - new FluidStack[] { Materials.SolderingAlloy.getMolten(576) }, - null, - 300, - (int) TierEU.RECIPE_EV, - BW_Util.CLEANROOM)); + new GT_Recipe( + false, + new ItemStack[] { BW_Meta_Items.NEWCIRCUITS.getStack(2) }, + new ItemStack[] { BW_Meta_Items.NEWCIRCUITS.getStack(3) }, + null, + new int[] { 7500 }, + new FluidStack[] { Materials.SolderingAlloy.getMolten(576) }, + null, + 300, + (int) TierEU.RECIPE_EV, + BW_Util.CLEANROOM)); } public void addNewCircuit(int aTier, int aID, String aName) { @@ -157,11 +159,11 @@ public class BW_Meta_Items { public final ItemStack addCircuit(int aID, String aEnglish, String aToolTip, int tier) { CircuitImprintLoader.bwCircuitTagMap.put( - new CircuitData( - BW_Util.getMachineVoltageFromTier(Math.min(1, tier - 2)), - tier > 2 ? BW_Util.CLEANROOM : 0, - (byte) tier), - new ItemStack(BW_Meta_Items.NEWCIRCUITS, 1, aID)); + new CircuitData( + BW_Util.getMachineVoltageFromTier(Math.min(1, tier - 2)), + tier > 2 ? BW_Util.CLEANROOM : 0, + (byte) tier), + new ItemStack(BW_Meta_Items.NEWCIRCUITS, 1, aID)); return this.addItem(aID, aEnglish, aToolTip, SubTag.NO_UNIFICATION); } @@ -201,29 +203,31 @@ public class BW_Meta_Items { for (short i = 0; i < CircuitImprintLoader.reverseIDs; ++i) { if (this.mEnabledItems.get(i)) { BW_Util.set2DCoordTo1DArray( - i, - 0, - 2, - aIconRegister.registerIcon( - "gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + "/" + i)), - this.mIconList); + i, + 0, + 2, + aIconRegister.registerIcon( + "gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + "/" + i)), + this.mIconList); } } for (short i = CircuitImprintLoader.reverseIDs; i < Short.MAX_VALUE; i++) { if (this.mEnabledItems.get(i)) { BW_Util.set2DCoordTo1DArray( - i, - 0, - 2, - Objects.requireNonNull(CircuitImprintLoader.circuitIIconRefs.get(i)).get(1).getIconIndex(), - this.mIconList); + i, + 0, + 2, + Objects.requireNonNull(CircuitImprintLoader.circuitIIconRefs.get(i)) + .get(1) + .getIconIndex(), + this.mIconList); BW_Util.set2DCoordTo1DArray( - i, - 1, - 2, - aIconRegister.registerIcon(MainMod.MOD_ID + ":WrapOverlay"), - this.mIconList); + i, + 1, + 2, + aIconRegister.registerIcon(MainMod.MOD_ID + ":WrapOverlay"), + this.mIconList); } } } @@ -231,18 +235,18 @@ public class BW_Meta_Items { @Override protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { if (aStack.getItemDamage() == 0) if (aStack.getTagCompound() != null - && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) + && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) aList.add( - "An Imprint for: " + GT_LanguageManager.getTranslation( - GT_LanguageManager.getTranslateableItemStackName( - CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); + "An Imprint for: " + GT_LanguageManager.getTranslation( + GT_LanguageManager.getTranslateableItemStackName( + CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); else aList.add("An Imprint for a Circuit"); else if (aStack.getItemDamage() == 1) if (aStack.getTagCompound() != null - && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) + && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) aList.add( - "A Sliced " + GT_LanguageManager.getTranslation( - GT_LanguageManager.getTranslateableItemStackName( - CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); + "A Sliced " + GT_LanguageManager.getTranslation( + GT_LanguageManager.getTranslateableItemStackName( + CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); else aList.add("A Sliced Circuit"); super.addAdditionalToolTips(aList, aStack, aPlayer); } @@ -380,7 +384,7 @@ public class BW_Meta_Items { @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, - int useRemaining) { + int useRemaining) { return this.getIconFromDamage(stack.getItemDamage()); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java index 49fba31ec8..874ae202f1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java @@ -40,10 +40,14 @@ public class CircuitData { @Override public int hashCode() { return MurmurHash3.murmurhash3_x86_32( - ByteBuffer.allocate(13).put(this.aTier).putInt(this.aSpecial).putLong(this.aVoltage).array(), - 0, - 13, - 31); + ByteBuffer.allocate(13) + .put(this.aTier) + .putInt(this.aSpecial) + .putLong(this.aVoltage) + .array(), + 0, + 13, + 31); } public long getaVoltage() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index fd5cfeb38d..5d3886b9e9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -76,7 +76,8 @@ public class CircuitImprintLoader { } private static void reAddOriginalRecipes() { - RecipeMaps.circuitAssemblerRecipes.getBackend().removeRecipes(MODIFIED_CAL_RECIPES); + RecipeMaps.circuitAssemblerRecipes.getBackend() + .removeRecipes(MODIFIED_CAL_RECIPES); ORIGINAL_CAL_RECIPES.forEach(RecipeMaps.circuitAssemblerRecipes::add); ORIGINAL_CAL_RECIPES.clear(); MODIFIED_CAL_RECIPES.clear(); @@ -85,30 +86,30 @@ public class CircuitImprintLoader { private static void rebuildCircuitAssemblerMap(HashSet toRem, HashSet toAdd) { reAddOriginalRecipes(); RecipeMaps.circuitAssemblerRecipes.getAllRecipes() - .forEach(e -> CircuitImprintLoader.handleCircuitRecipeRebuilding(e, toRem, toAdd)); + .forEach(e -> CircuitImprintLoader.handleCircuitRecipeRebuilding(e, toRem, toAdd)); } private static void handleCircuitRecipeRebuilding(GT_Recipe circuitRecipe, HashSet toRem, - HashSet toAdd) { + HashSet toAdd) { ItemStack[] outputs = circuitRecipe.mOutputs; boolean isOrePass = isCircuitOreDict(outputs[0]); String unlocalizedName = outputs[0].getUnlocalizedName(); if (isOrePass || unlocalizedName.contains("Circuit") || unlocalizedName.contains("circuit")) { CircuitImprintLoader.recipeTagMap - .put(CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); + .put(CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null - ? FluidRegistry.getFluid("molten.indalloy140") - : FluidRegistry.getFluid("molten.solderingalloy"); + ? FluidRegistry.getFluid("molten.indalloy140") + : FluidRegistry.getFluid("molten.solderingalloy"); Fluid solderUEV = FluidRegistry.getFluid("molten.mutatedlivingsolder") != null - ? FluidRegistry.getFluid("molten.mutatedlivingsolder") - : FluidRegistry.getFluid("molten.solderingalloy"); + ? FluidRegistry.getFluid("molten.mutatedlivingsolder") + : FluidRegistry.getFluid("molten.solderingalloy"); if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0)) - || circuitRecipe.mFluidInputs[0].isFluidEqual(new FluidStack(solderIndalloy, 0)) - || circuitRecipe.mFluidInputs[0].isFluidEqual(new FluidStack(solderUEV, 0))) { + || circuitRecipe.mFluidInputs[0].isFluidEqual(new FluidStack(solderIndalloy, 0)) + || circuitRecipe.mFluidInputs[0].isFluidEqual(new FluidStack(solderUEV, 0))) { GT_Recipe newRecipe = CircuitImprintLoader.reBuildRecipe(circuitRecipe); if (newRecipe != null) BartWorksRecipeMaps.circuitAssemblyLineRecipes.addRecipe(newRecipe); addCutoffRecipeToSets(toRem, toAdd, circuitRecipe); @@ -117,19 +118,21 @@ public class CircuitImprintLoader { } private static boolean isCircuitOreDict(ItemStack item) { - return BW_Util.isTieredCircuit(item) - || BW_Util.getOreNames(item).stream().anyMatch(s -> "circuitPrimitiveArray".equals(s)); + return BW_Util.isTieredCircuit(item) || BW_Util.getOreNames(item) + .stream() + .anyMatch(s -> "circuitPrimitiveArray".equals(s)); } private static void exchangeRecipesInList(HashSet toRem, HashSet toAdd) { toAdd.forEach(RecipeMaps.circuitAssemblerRecipes::add); - RecipeMaps.circuitAssemblerRecipes.getBackend().removeRecipes(toRem); + RecipeMaps.circuitAssemblerRecipes.getBackend() + .removeRecipes(toRem); ORIGINAL_CAL_RECIPES.addAll(toRem); MODIFIED_CAL_RECIPES.addAll(toAdd); } private static void addCutoffRecipeToSets(HashSet toRem, HashSet toAdd, - GT_Recipe circuitRecipe) { + GT_Recipe circuitRecipe) { if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) { toRem.add(circuitRecipe); toAdd.add(CircuitImprintLoader.makeMoreExpensive(circuitRecipe)); @@ -142,8 +145,8 @@ public class CircuitImprintLoader { for (ItemStack is : newRecipe.mInputs) { if (!BW_Util.isTieredCircuit(is)) { is.stackSize = Math.min(is.stackSize * 6, 64); - if (is.stackSize > is.getItem().getItemStackLimit() || is.stackSize > is.getMaxStackSize()) - is.stackSize = is.getMaxStackSize(); + if (is.stackSize > is.getItem() + .getItemStackLimit() || is.stackSize > is.getMaxStackSize()) is.stackSize = is.getMaxStackSize(); } } newRecipe.mFluidInputs[0].amount *= 4; @@ -171,42 +174,43 @@ public class CircuitImprintLoader { } return new GT_Recipe( - false, - in, - new ItemStack[] { getOutputMultiplied(original) }, - BW_Meta_Items.getNEWCIRCUITS() - .getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]), 0, 0), - null, - original.mFluidInputs, - null, - original.mDuration * 12, - original.mEUt, - 0); + false, + in, + new ItemStack[] { getOutputMultiplied(original) }, + BW_Meta_Items.getNEWCIRCUITS() + .getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]), 0, 0), + null, + original.mFluidInputs, + null, + original.mDuration * 12, + original.mEUt, + 0); } private static ItemStack getOutputMultiplied(GT_Recipe original) { - ItemStack out = original.copy().getOutput(0); + ItemStack out = original.copy() + .getOutput(0); out.stackSize *= 16; return out; } private static void replaceCircuits(BiMap inversed, GT_Recipe original, ItemStack[] in, - int index) { + int index) { for (ItemList il : inversed.keySet()) { if (GT_Utility.areStacksEqual(il.get(1), replaceCircuitParts(original.mInputs[index]))) { in[index] = BW_Meta_Items.getNEWCIRCUITS() - .getStack(inversed.get(il), original.mInputs[index].stackSize); + .getStack(inversed.get(il), original.mInputs[index].stackSize); } } } private static final List> circuitPartsToReplace = Collections.unmodifiableList( - Arrays.asList( - new Pair<>(ItemList.Circuit_Parts_Resistor.get(1), ItemList.Circuit_Parts_ResistorSMD.get(1)), - new Pair<>(ItemList.Circuit_Parts_Diode.get(1), ItemList.Circuit_Parts_DiodeSMD.get(1)), - new Pair<>(ItemList.Circuit_Parts_Transistor.get(1), ItemList.Circuit_Parts_TransistorSMD.get(1)), - new Pair<>(ItemList.Circuit_Parts_Capacitor.get(1), ItemList.Circuit_Parts_CapacitorSMD.get(1)), - new Pair<>(ItemList.Circuit_Parts_Coil.get(1), ItemList.Circuit_Parts_InductorSMD.get(1)))); + Arrays.asList( + new Pair<>(ItemList.Circuit_Parts_Resistor.get(1), ItemList.Circuit_Parts_ResistorSMD.get(1)), + new Pair<>(ItemList.Circuit_Parts_Diode.get(1), ItemList.Circuit_Parts_DiodeSMD.get(1)), + new Pair<>(ItemList.Circuit_Parts_Transistor.get(1), ItemList.Circuit_Parts_TransistorSMD.get(1)), + new Pair<>(ItemList.Circuit_Parts_Capacitor.get(1), ItemList.Circuit_Parts_CapacitorSMD.get(1)), + new Pair<>(ItemList.Circuit_Parts_Coil.get(1), ItemList.Circuit_Parts_InductorSMD.get(1)))); private static ItemStack replaceCircuitParts(ItemStack stack) { for (Pair pair : circuitPartsToReplace) { @@ -221,45 +225,46 @@ public class CircuitImprintLoader { @SuppressWarnings("deprecation") private static void replaceComponents(ItemStack[] in, GT_Recipe original, int index) - throws ArrayIndexOutOfBoundsException { + throws ArrayIndexOutOfBoundsException { if (original.mInputs[index] != null && in[index] == null) { // big wires if (BW_Util.checkStackAndPrefix(original.mInputs[index]) - && GT_OreDictUnificator.getAssociation(original.mInputs[index]).mPrefix == OrePrefixes.wireGt01) { + && GT_OreDictUnificator.getAssociation(original.mInputs[index]).mPrefix == OrePrefixes.wireGt01) { in[index] = GT_OreDictUnificator.get( - OrePrefixes.wireGt16, - GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, - original.mInputs[index].stackSize); + OrePrefixes.wireGt16, + GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, + original.mInputs[index].stackSize); // fine wires } else if (BW_Util.checkStackAndPrefix(original.mInputs[index]) - && GT_OreDictUnificator.getAssociation(original.mInputs[index]).mPrefix == OrePrefixes.wireFine) { + && GT_OreDictUnificator.getAssociation(original.mInputs[index]).mPrefix == OrePrefixes.wireFine) { + in[index] = GT_OreDictUnificator.get( + OrePrefixes.wireGt04, + GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, + original.mInputs[index].stackSize); + if (in[index] == null) { in[index] = GT_OreDictUnificator.get( - OrePrefixes.wireGt04, - GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, - original.mInputs[index].stackSize); - if (in[index] == null) { - in[index] = GT_OreDictUnificator.get( - OrePrefixes.wireFine, - GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, - original.mInputs[index].stackSize * 16); - } - // other components - } else { - in[index] = original.mInputs[index].copy(); - in[index].stackSize *= 16; - if (in[index].stackSize > in[index].getItem().getItemStackLimit() - || in[index].stackSize > in[index].getMaxStackSize()) - in[index].stackSize = in[index].getMaxStackSize(); + OrePrefixes.wireFine, + GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, + original.mInputs[index].stackSize * 16); } + // other components + } else { + in[index] = original.mInputs[index].copy(); + in[index].stackSize *= 16; + if (in[index].stackSize > in[index].getItem() + .getItemStackLimit() || in[index].stackSize > in[index].getMaxStackSize()) + in[index].stackSize = in[index].getMaxStackSize(); + } } } private static void makeCircuitImprintRecipes() { removeOldRecipesFromRegistries(); - CircuitImprintLoader.recipeTagMap.keySet().forEach(e -> { - makeAndAddSlicingRecipe(e); - makeAndAddCraftingRecipes(e); - }); + CircuitImprintLoader.recipeTagMap.keySet() + .forEach(e -> { + makeAndAddSlicingRecipe(e); + makeAndAddCraftingRecipes(e); + }); } private static boolean checkForBlacklistedComponents(ItemStack[] itemStacks) { @@ -272,12 +277,16 @@ public class CircuitImprintLoader { } private static void removeOldRecipesFromRegistries() { - recipeWorldCache.forEach(CraftingManager.getInstance().getRecipeList()::remove); + recipeWorldCache.forEach( + CraftingManager.getInstance() + .getRecipeList()::remove); BWCoreStaticReplacementMethodes.clearRecentlyUsedRecipes(); - RecipeMaps.slicerRecipes.getBackend().removeRecipes(gtrecipeWorldCache); + RecipeMaps.slicerRecipes.getBackend() + .removeRecipes(gtrecipeWorldCache); recipeWorldCache.forEach(r -> { try { - BW_Util.getGTBufferedRecipeList().remove(r); + BW_Util.getGTBufferedRecipeList() + .remove(r); } catch (Exception e) { e.printStackTrace(); } @@ -295,41 +304,43 @@ public class CircuitImprintLoader { } eut = Math.min( - eut, - BW_Util.getMachineVoltageFromTier( - BW_Util.getCircuitTierFromOreDictName( - OreDictionary.getOreName( - OreDictionary.getOreIDs(stack) != null - && OreDictionary.getOreIDs(stack).length > 0 - ? OreDictionary.getOreIDs(stack)[0] - : -1)))); + eut, + BW_Util.getMachineVoltageFromTier( + BW_Util.getCircuitTierFromOreDictName( + OreDictionary.getOreName( + OreDictionary.getOreIDs(stack) != null && OreDictionary.getOreIDs(stack).length > 0 + ? OreDictionary.getOreIDs(stack)[0] + : -1)))); GT_Recipe slicingRecipe = new GT_Recipe( - true, - new ItemStack[] { stack, ItemList.Shape_Slicer_Flat.get(0) }, - new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag, 1, 1) }, - null, - null, - null, - null, - 300, - eut, - BW_Util.CLEANROOM); + true, + new ItemStack[] { stack, ItemList.Shape_Slicer_Flat.get(0) }, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS() + .getStackWithNBT(tag, 1, 1) }, + null, + null, + null, + null, + 300, + eut, + BW_Util.CLEANROOM); gtrecipeWorldCache.add(slicingRecipe); RecipeMaps.slicerRecipes.add(slicingRecipe); } private static void makeAndAddCraftingRecipes(NBTTagCompound tag) { - ItemStack circuit = BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag, 0, 1); - Object[] imprintRecipe = { " X ", "GPG", " X ", 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag, 1, 1), - 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite, 1), 'X', - BW_Meta_Items.getNEWCIRCUITS().getStack(3) }; + ItemStack circuit = BW_Meta_Items.getNEWCIRCUITS() + .getStackWithNBT(tag, 0, 1); + Object[] imprintRecipe = { " X ", "GPG", " X ", 'P', BW_Meta_Items.getNEWCIRCUITS() + .getStackWithNBT(tag, 1, 1), 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite, 1), 'X', + BW_Meta_Items.getNEWCIRCUITS() + .getStack(3) }; IRecipe bwrecipe = new BWNBTDependantCraftingRecipe(circuit, imprintRecipe); ShapedOreRecipe gtrecipe = BW_Util.createGTCraftingRecipe( - circuit, - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.KEEPNBT - | GT_ModHandler.RecipeBits.BUFFERED, - imprintRecipe); + circuit, + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.KEEPNBT + | GT_ModHandler.RecipeBits.BUFFERED, + imprintRecipe); // Adds the actual recipe recipeWorldCache.add(bwrecipe); @@ -340,8 +351,8 @@ public class CircuitImprintLoader { } public static NBTTagCompound getTagFromStack(ItemStack stack) { - if (GT_Utility.isStackValid(stack)) - return BW_Util.setStackSize(stack.copy(), 1).writeToNBT(new NBTTagCompound()); + if (GT_Utility.isStackValid(stack)) return BW_Util.setStackSize(stack.copy(), 1) + .writeToNBT(new NBTTagCompound()); return new NBTTagCompound(); } @@ -350,7 +361,8 @@ public class CircuitImprintLoader { } private static void deleteCALRecipesAndTags() { - BartWorksRecipeMaps.circuitAssemblyLineRecipes.getBackend().clearRecipes(); + BartWorksRecipeMaps.circuitAssemblyLineRecipes.getBackend() + .clearRecipes(); recipeTagMap.clear(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index 7e1abb7a7a..6db9c63134 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -116,26 +116,34 @@ public class CircuitPartLoader implements Runnable { @Override public void run() { CircuitPartLoader.makeCircuitParts(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) new BW_GT_ItemRenderer(); + if (FMLCommonHandler.instance() + .getEffectiveSide() + .isClient()) new BW_GT_ItemRenderer(); } public static void makeCircuitParts() { ItemList[] itemLists = values(); for (ItemList single : itemLists) { if (!single.hasBeenSet()) continue; - if (single.toString().contains("Wafer") || single.toString().contains("Circuit_Silicon_Ingot") - || single.toString().contains("Raw") - || single.toString().contains("raw") - || single.toString().contains("Glass_Tube") - || single == Circuit_Parts_GlassFiber - || single == Circuit_Parts_Advanced - || single == Circuit_Parts_Wiring_Advanced - || single == Circuit_Parts_Wiring_Elite - || single == Circuit_Parts_Wiring_Basic - || single == Circuit_Integrated - || single == Circuit_Parts_PetriDish - || single == Circuit_Parts_Vacuum_Tube - || single == Circuit_Integrated_Good) { + if (single.toString() + .contains("Wafer") + || single.toString() + .contains("Circuit_Silicon_Ingot") + || single.toString() + .contains("Raw") + || single.toString() + .contains("raw") + || single.toString() + .contains("Glass_Tube") + || single == Circuit_Parts_GlassFiber + || single == Circuit_Parts_Advanced + || single == Circuit_Parts_Wiring_Advanced + || single == Circuit_Parts_Wiring_Elite + || single == Circuit_Parts_Wiring_Basic + || single == Circuit_Integrated + || single == Circuit_Parts_PetriDish + || single == Circuit_Parts_Vacuum_Tube + || single == Circuit_Integrated_Good) { CircuitImprintLoader.blacklistSet.add(single.get(1)); } @@ -146,18 +154,35 @@ public class CircuitPartLoader implements Runnable { ItemStack itemStack = single.get(1); if (!GT_Utility.isStackValid(itemStack)) continue; ArrayList toolTip = new ArrayList<>(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) - single.getItem().addInformation(single.get(1).copy(), null, toolTip, true); + if (FMLCommonHandler.instance() + .getEffectiveSide() + .isClient()) + single.getItem() + .addInformation( + single.get(1) + .copy(), + null, + toolTip, + true); String tt = toolTip.size() > 0 ? toolTip.get(0) : ""; // tt += "Internal Name = "+single; String localised = GT_LanguageManager - .getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); - BW_Meta_Items.getNEWCIRCUITS().addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised + "s", tt); + .getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); + BW_Meta_Items.getNEWCIRCUITS() + .addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised + "s", tt); - GT_Values.RA.stdBuilder().itemInputs(single.get(16).copy(), GT_Utility.getIntegratedCircuit(16)) - .itemOutputs(BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs)) - .fluidInputs(Materials.Plastic.getMolten(72)).duration(30 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(assemblerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs( + single.get(16) + .copy(), + GT_Utility.getIntegratedCircuit(16)) + .itemOutputs( + BW_Meta_Items.getNEWCIRCUITS() + .getStack(CircuitImprintLoader.reverseIDs)) + .fluidInputs(Materials.Plastic.getMolten(72)) + .duration(30 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(assemblerRecipes); CircuitImprintLoader.circuitIIconRefs.put(CircuitImprintLoader.reverseIDs, single); CircuitImprintLoader.reverseIDs--; @@ -169,73 +194,73 @@ public class CircuitPartLoader implements Runnable { * this list, to prevent id shift. */ private static final List CIRCUIT_PARTS = Collections.unmodifiableList( - Arrays.asList( - Circuit_Board_Basic, - Circuit_Board_Advanced, - Circuit_Board_Elite, - Circuit_Parts_Crystal_Chip_Elite, - Circuit_Parts_Crystal_Chip_Master, - Circuit_Board_Coated, - Circuit_Board_Coated_Basic, - Circuit_Board_Phenolic, - Circuit_Board_Phenolic_Good, - Circuit_Board_Epoxy, - Circuit_Board_Epoxy_Advanced, - Circuit_Board_Fiberglass, - Circuit_Board_Fiberglass_Advanced, - Circuit_Board_Multifiberglass_Elite, - Circuit_Board_Multifiberglass, - Circuit_Board_Wetware, - Circuit_Board_Wetware_Extreme, - Circuit_Board_Plastic, - Circuit_Board_Plastic_Advanced, - Circuit_Board_Bio, - Circuit_Board_Bio_Ultra, - Circuit_Parts_ResistorSMD, - Circuit_Parts_InductorSMD, - Circuit_Parts_DiodeSMD, - Circuit_Parts_TransistorSMD, - Circuit_Parts_CapacitorSMD, - Circuit_Parts_ResistorASMD, - Circuit_Parts_DiodeASMD, - Circuit_Parts_TransistorASMD, - Circuit_Parts_CapacitorASMD, - Circuit_Chip_ILC, - Circuit_Chip_Ram, - Circuit_Chip_NAND, - Circuit_Chip_NOR, - Circuit_Chip_CPU, - Circuit_Chip_SoC, - Circuit_Chip_SoC2, - Circuit_Chip_PIC, - Circuit_Chip_Simple_SoC, - Circuit_Chip_HPIC, - Circuit_Chip_UHPIC, - Circuit_Chip_ULPIC, - Circuit_Chip_LPIC, - Circuit_Chip_NPIC, - Circuit_Chip_PPIC, - Circuit_Chip_QPIC, - Circuit_Chip_NanoCPU, - Circuit_Chip_QuantumCPU, - Circuit_Chip_CrystalCPU, - Circuit_Chip_CrystalSoC, - Circuit_Chip_CrystalSoC2, - Circuit_Chip_NeuroCPU, - Circuit_Chip_BioCPU, - Circuit_Chip_Stemcell, - Circuit_Chip_Biocell, - Circuit_Parts_ResistorXSMD, - Circuit_Parts_DiodeXSMD, - Circuit_Parts_TransistorXSMD, - Circuit_Parts_CapacitorXSMD, - Circuit_Parts_InductorASMD, - Circuit_Parts_InductorXSMD, - Circuit_Chip_Optical, - Circuit_Board_Optical, - Optically_Perfected_CPU, - Optical_Cpu_Containment_Housing, - Optically_Compatible_Memory, - Circuit_Parts_Crystal_Chip_Wetware, - Circuit_Parts_Chip_Bioware)); + Arrays.asList( + Circuit_Board_Basic, + Circuit_Board_Advanced, + Circuit_Board_Elite, + Circuit_Parts_Crystal_Chip_Elite, + Circuit_Parts_Crystal_Chip_Master, + Circuit_Board_Coated, + Circuit_Board_Coated_Basic, + Circuit_Board_Phenolic, + Circuit_Board_Phenolic_Good, + Circuit_Board_Epoxy, + Circuit_Board_Epoxy_Advanced, + Circuit_Board_Fiberglass, + Circuit_Board_Fiberglass_Advanced, + Circuit_Board_Multifiberglass_Elite, + Circuit_Board_Multifiberglass, + Circuit_Board_Wetware, + Circuit_Board_Wetware_Extreme, + Circuit_Board_Plastic, + Circuit_Board_Plastic_Advanced, + Circuit_Board_Bio, + Circuit_Board_Bio_Ultra, + Circuit_Parts_ResistorSMD, + Circuit_Parts_InductorSMD, + Circuit_Parts_DiodeSMD, + Circuit_Parts_TransistorSMD, + Circuit_Parts_CapacitorSMD, + Circuit_Parts_ResistorASMD, + Circuit_Parts_DiodeASMD, + Circuit_Parts_TransistorASMD, + Circuit_Parts_CapacitorASMD, + Circuit_Chip_ILC, + Circuit_Chip_Ram, + Circuit_Chip_NAND, + Circuit_Chip_NOR, + Circuit_Chip_CPU, + Circuit_Chip_SoC, + Circuit_Chip_SoC2, + Circuit_Chip_PIC, + Circuit_Chip_Simple_SoC, + Circuit_Chip_HPIC, + Circuit_Chip_UHPIC, + Circuit_Chip_ULPIC, + Circuit_Chip_LPIC, + Circuit_Chip_NPIC, + Circuit_Chip_PPIC, + Circuit_Chip_QPIC, + Circuit_Chip_NanoCPU, + Circuit_Chip_QuantumCPU, + Circuit_Chip_CrystalCPU, + Circuit_Chip_CrystalSoC, + Circuit_Chip_CrystalSoC2, + Circuit_Chip_NeuroCPU, + Circuit_Chip_BioCPU, + Circuit_Chip_Stemcell, + Circuit_Chip_Biocell, + Circuit_Parts_ResistorXSMD, + Circuit_Parts_DiodeXSMD, + Circuit_Parts_TransistorXSMD, + Circuit_Parts_CapacitorXSMD, + Circuit_Parts_InductorASMD, + Circuit_Parts_InductorXSMD, + Circuit_Chip_Optical, + Circuit_Board_Optical, + Optically_Perfected_CPU, + Optical_Cpu_Containment_Housing, + Optically_Compatible_Memory, + Circuit_Parts_Crystal_Chip_Wetware, + Circuit_Parts_Chip_Bioware)); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java index 08b3968251..91dc709609 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -58,8 +58,8 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { ItemStack tStack = new ItemStack(this, 1, i); Materials material = Materials.values()[i]; if (material.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten - || material.getFluid(1) == null && material.getGas(1) == null - && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)) + || material.getFluid(1) == null && material.getGas(1) == null + && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)) continue; if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + material.mDefaultLocalName.replace(" ", ""))) { @@ -67,7 +67,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { continue; } GT_OreDictUnificator - .registerOre(this.orePrefixes.name() + material.mDefaultLocalName.replace(" ", ""), tStack); + .registerOre(this.orePrefixes.name() + material.mDefaultLocalName.replace(" ", ""), tStack); } if (noSubIDMaterials != null) { @@ -77,8 +77,8 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { ItemStack tStack = new ItemStack(this, 1, i + 1001); Materials w = noSubIDMaterials.get(i); if (w.getMolten(1) == null && orePrefixes == OrePrefixes.capsuleMolten - || w.getFluid(1) == null && w.getGas(1) == null - && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)) + || w.getFluid(1) == null && w.getGas(1) == null + && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)) continue; if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + w.mDefaultLocalName.replace(" ", ""))) { @@ -86,7 +86,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { continue; } GT_OreDictUnificator - .registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replace(" ", ""), tStack); + .registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replace(" ", ""), tStack); } } } @@ -167,11 +167,10 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { for (int i = 0; i < Materials.values().length; i++) { Materials w = Materials.values()[i]; if (w == null || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 - && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) - continue; + && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) continue; if (w.getMolten(1) == null && this.orePrefixes == OrePrefixes.capsuleMolten - || w.getFluid(1) == null && w.getGas(1) == null - && (this.orePrefixes == OrePrefixes.capsule || this.orePrefixes == OrePrefixes.bottle)) + || w.getFluid(1) == null && w.getGas(1) == null + && (this.orePrefixes == OrePrefixes.capsule || this.orePrefixes == OrePrefixes.bottle)) continue; else if (this.hiddenThings.contains(i)) continue; aList.add(new ItemStack(this, 1, i)); @@ -179,11 +178,10 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { if (this.hasList) for (int i = 0; i < NoMetaValue.size(); i++) { Materials w = NoMetaValue.get(i); if (w == null || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 - && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) - continue; + && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) continue; if (w.getMolten(1) == null && this.orePrefixes == OrePrefixes.capsuleMolten - || w.getFluid(1) == null && w.getGas(1) == null - && (this.orePrefixes == OrePrefixes.capsule || this.orePrefixes == OrePrefixes.bottle)) + || w.getFluid(1) == null && w.getGas(1) == null + && (this.orePrefixes == OrePrefixes.capsule || this.orePrefixes == OrePrefixes.bottle)) continue; else if (this.hiddenThings.contains(i)) continue; aList.add(new ItemStack(this, 1, i + 1001)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java index 43a5a3dac3..5b475dc069 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -44,8 +44,11 @@ public class GTMetaItemEnhancer { if (!Forestry.isModLoaded()) { return; } - NoMetaValue = Materials.getMaterialsMap().values().stream().filter(m -> m.mMetaItemSubID == -1) - .collect(Collectors.toList()); + NoMetaValue = Materials.getMaterialsMap() + .values() + .stream() + .filter(m -> m.mMetaItemSubID == -1) + .collect(Collectors.toList()); Item moltenCapsuls = new BWGTMetaItems(OrePrefixes.capsuleMolten, null); Item capsuls = new BWGTMetaItems(OrePrefixes.capsule, NoMetaValue); // Item bottles = new BWGTMetaItems(OrePrefixes.bottle, NoMetaValue); @@ -55,18 +58,26 @@ public class GTMetaItemEnhancer { Materials m = values[i]; if (m.mStandardMoltenFluid != null && GT_OreDictUnificator.get(OrePrefixes.cellMolten, m, 1) != null) { final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( - m.getMolten(144), - new ItemStack(moltenCapsuls, 1, i), - GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1)); + m.getMolten(144), + new ItemStack(moltenCapsuls, 1, i), + GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1)); FluidContainerRegistry.registerFluidContainer(emptyData); GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.stdBuilder().itemInputs(GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1)) - .itemOutputs(new ItemStack(moltenCapsuls, 1, i)).fluidInputs(m.getMolten(144)) - .duration(2 * TICKS).eut(2).addTo(fluidCannerRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(moltenCapsuls, 1, i)).fluidOutputs(m.getMolten(144)) - .duration(2 * TICKS).eut(2).addTo(fluidCannerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1)) + .itemOutputs(new ItemStack(moltenCapsuls, 1, i)) + .fluidInputs(m.getMolten(144)) + .duration(2 * TICKS) + .eut(2) + .addTo(fluidCannerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(moltenCapsuls, 1, i)) + .fluidOutputs(m.getMolten(144)) + .duration(2 * TICKS) + .eut(2) + .addTo(fluidCannerRecipes); } if (m.getFluid(1) == null && m.getGas(1) == null || OreDictionary.doesOreNameExist("capsule" + m.mName)) @@ -84,19 +95,31 @@ public class GTMetaItemEnhancer { } private static void addFluidData(Materials m, ItemStack container, Item filled, int amount, int it, boolean empty) { - Fluid f = m.getFluid(1) != null ? m.getFluid(1).getFluid() : m.getGas(1).getFluid(); + Fluid f = m.getFluid(1) != null ? m.getFluid(1) + .getFluid() + : m.getGas(1) + .getFluid(); final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( - new FluidStack(f, amount), - new ItemStack(filled, 1, it), - container); + new FluidStack(f, amount), + new ItemStack(filled, 1, it), + container); FluidContainerRegistry.registerFluidContainer(emptyData); GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.stdBuilder().itemInputs(container).itemOutputs(new ItemStack(filled, 1, it)) - .fluidInputs(new FluidStack(f, amount)).duration(amount / 62).eut(2).addTo(fluidCannerRecipes); - - GT_Values.RA.stdBuilder().itemInputs(new ItemStack(filled, 1, it)).fluidOutputs(new FluidStack(f, amount)) - .duration(amount / 62).eut(2).addTo(fluidCannerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(container) + .itemOutputs(new ItemStack(filled, 1, it)) + .fluidInputs(new FluidStack(f, amount)) + .duration(amount / 62) + .eut(2) + .addTo(fluidCannerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(filled, 1, it)) + .fluidOutputs(new FluidStack(f, amount)) + .duration(amount / 62) + .eut(2) + .addTo(fluidCannerRecipes); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index 5db1bcdf56..ba08d083c2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -135,11 +135,10 @@ import gregtech.common.blocks.GT_Block_Ores_Abstract; public class PlatinumSludgeOverHaul { private static final Materials[] BLACKLIST = { Materials.HSSS, Materials.EnderiumBase, Materials.Osmiridium, - Materials.TPV, Materials.get("Uraniumtriplatinid"), - Materials.get("Tetranaquadahdiindiumhexaplatiumosminid"), - Materials.get("Longasssuperconductornameforuvwire"), }; + Materials.TPV, Materials.get("Uraniumtriplatinid"), Materials.get("Tetranaquadahdiindiumhexaplatiumosminid"), + Materials.get("Longasssuperconductornameforuvwire"), }; private static final OrePrefixes[] OPBLACKLIST = { crushedCentrifuged, crushed, crushedPurified, dustPure, - dustImpure, dustRefined, dust, dustTiny, dustSmall }; + dustImpure, dustRefined, dust, dustTiny, dustSmall }; private PlatinumSludgeOverHaul() {} @@ -147,400 +146,579 @@ public class PlatinumSludgeOverHaul { // DilutedSulfuricAcid // 2H2SO4 + H2O = 3H2SO4(d) GT_Values.RA.stdBuilder() - .itemInputs( - Materials.SulfuricAcid.getCells(2), - Materials.Water.getCells(1), - GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(Materials.DilutedSulfuricAcid.getCells(3)).duration(1 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_LV).addTo(mixerRecipes); - - GT_Values.RA.stdBuilder().itemInputs(Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(Materials.Empty.getCells(1)).fluidInputs(Materials.SulfuricAcid.getFluid(2000)) - .fluidOutputs(Materials.DilutedSulfuricAcid.getFluid(3000)).duration(1 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_LV).addTo(mixerRecipes); - - GT_Values.RA.stdBuilder().itemInputs(Materials.SulfuricAcid.getCells(2), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(Materials.Empty.getCells(2)).fluidInputs(Materials.Water.getFluid(1000)) - .fluidOutputs(Materials.DilutedSulfuricAcid.getFluid(3000)).duration(1 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_LV).addTo(mixerRecipes); + .itemInputs( + Materials.SulfuricAcid.getCells(2), + Materials.Water.getCells(1), + GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(Materials.DilutedSulfuricAcid.getCells(3)) + .duration(1 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(mixerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(Materials.Empty.getCells(1)) + .fluidInputs(Materials.SulfuricAcid.getFluid(2000)) + .fluidOutputs(Materials.DilutedSulfuricAcid.getFluid(3000)) + .duration(1 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(mixerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(Materials.SulfuricAcid.getCells(2), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(Materials.Empty.getCells(2)) + .fluidInputs(Materials.Water.getFluid(1000)) + .fluidOutputs(Materials.DilutedSulfuricAcid.getFluid(3000)) + .duration(1 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(mixerRecipes); // FormicAcid // CO + NaOH = CHO2Na - GT_Values.RA.stdBuilder().itemInputs(Materials.CarbonMonoxide.getCells(1), Materials.SodiumHydroxide.getDust(3)) - .itemOutputs(Sodiumformate.get(cell)).duration(15 * TICKS).eut(TierEU.RECIPE_LV) - .addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(Materials.CarbonMonoxide.getCells(1), Materials.SodiumHydroxide.getDust(3)) + .itemOutputs(Sodiumformate.get(cell)) + .duration(15 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); // H2SO4 + 2CHO2Na = 2CH2O2 + Na2SO4 - GT_Values.RA.stdBuilder().itemInputs(Sodiumformate.get(cell, 2), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(FormicAcid.get(cell, 2), Sodiumsulfate.get(dust, 7)) - .fluidInputs(Materials.SulfuricAcid.getFluid(1000)).duration(15 * TICKS).eut(TierEU.RECIPE_LV) - .addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(Sodiumformate.get(cell, 2), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(FormicAcid.get(cell, 2), Sodiumsulfate.get(dust, 7)) + .fluidInputs(Materials.SulfuricAcid.getFluid(1000)) + .duration(15 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); - GT_Values.RA.stdBuilder().itemInputs(Materials.SulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(Materials.Empty.getCells(1), Sodiumsulfate.get(dust, 7)) - .fluidInputs(Sodiumformate.getFluidOrGas(2000)).fluidOutputs(FormicAcid.getFluidOrGas(2000)) - .duration(15 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(Materials.SulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(Materials.Empty.getCells(1), Sodiumsulfate.get(dust, 7)) + .fluidInputs(Sodiumformate.getFluidOrGas(2000)) + .fluidOutputs(FormicAcid.getFluidOrGas(2000)) + .duration(15 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); // AquaRegia GT_Values.RA.stdBuilder() - .itemInputs( - Materials.DilutedSulfuricAcid.getCells(1), - Materials.NitricAcid.getCells(1), - GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(AquaRegia.get(cell, 2)).duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) - .addTo(mixerRecipes); + .itemInputs( + Materials.DilutedSulfuricAcid.getCells(1), + Materials.NitricAcid.getCells(1), + GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(AquaRegia.get(cell, 2)) + .duration(1 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(mixerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - Materials.DilutedSulfuricAcid.getCells(1), - Materials.NitricAcid.getCells(1), - GT_Utility.getIntegratedCircuit(2)) - .itemOutputs(Materials.Empty.getCells(2)).fluidOutputs(AquaRegia.getFluidOrGas(2000)) - .duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(mixerRecipes); + .itemInputs( + Materials.DilutedSulfuricAcid.getCells(1), + Materials.NitricAcid.getCells(1), + GT_Utility.getIntegratedCircuit(2)) + .itemOutputs(Materials.Empty.getCells(2)) + .fluidOutputs(AquaRegia.getFluidOrGas(2000)) + .duration(1 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(mixerRecipes); - GT_Values.RA.stdBuilder().itemInputs(Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(3)) - .itemOutputs(Materials.Empty.getCells(1)).fluidInputs(Materials.DilutedSulfuricAcid.getFluid(1000)) - .fluidOutputs(AquaRegia.getFluidOrGas(2000)).duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) - .addTo(mixerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(3)) + .itemOutputs(Materials.Empty.getCells(1)) + .fluidInputs(Materials.DilutedSulfuricAcid.getFluid(1000)) + .fluidOutputs(AquaRegia.getFluidOrGas(2000)) + .duration(1 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(mixerRecipes); GT_Values.RA.stdBuilder() - .itemInputs(Materials.DilutedSulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(4)) - .itemOutputs(Materials.Empty.getCells(1)).fluidInputs(Materials.NitricAcid.getFluid(1000)) - .fluidOutputs(AquaRegia.getFluidOrGas(2000)).duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) - .addTo(mixerRecipes); + .itemInputs(Materials.DilutedSulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(4)) + .itemOutputs(Materials.Empty.getCells(1)) + .fluidInputs(Materials.NitricAcid.getFluid(1000)) + .fluidOutputs(AquaRegia.getFluidOrGas(2000)) + .duration(1 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(mixerRecipes); // AmmoniumChloride // NH3 + HCl = NH4Cl - GT_Values.RA.stdBuilder().itemInputs(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(AmmoniumChloride.get(cell, 1)).fluidInputs(Materials.HydrochloricAcid.getFluid(1000)) - .duration(15 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(AmmoniumChloride.get(cell, 1)) + .fluidInputs(Materials.HydrochloricAcid.getFluid(1000)) + .duration(15 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); - GT_Values.RA.stdBuilder().itemInputs(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(Materials.Empty.getCells(1)).fluidInputs(Materials.Ammonia.getGas(1000)) - .fluidOutputs(AmmoniumChloride.getFluidOrGas(1000)).duration(15 * TICKS).eut(TierEU.RECIPE_LV) - .addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(Materials.Empty.getCells(1)) + .fluidInputs(Materials.Ammonia.getGas(1000)) + .fluidOutputs(AmmoniumChloride.getFluidOrGas(1000)) + .duration(15 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); GT_Values.RA.addMultiblockChemicalRecipe( - new ItemStack[] { GT_Utility.getIntegratedCircuit(9) }, - new FluidStack[] { Materials.Ammonia.getGas(64000), Materials.HydrochloricAcid.getFluid(64000) }, - new FluidStack[] { AmmoniumChloride.getFluidOrGas(64000) }, - null, - 60, - 480); + new ItemStack[] { GT_Utility.getIntegratedCircuit(9) }, + new FluidStack[] { Materials.Ammonia.getGas(64000), Materials.HydrochloricAcid.getFluid(64000) }, + new FluidStack[] { AmmoniumChloride.getFluidOrGas(64000) }, + null, + 60, + 480); // base solution for (Werkstoff w : Werkstoff.werkstoffHashSet) if (w.containsStuff(Materials.Sulfur) - && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { + && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { + + GT_Values.RA.stdBuilder() + .itemInputs(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(1)) + .fluidInputs(AquaRegia.getFluidOrGas(150)) + .fluidOutputs(PTConcentrate.getFluidOrGas(150)) + .duration(12 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder() + .itemInputs(w.get(crushedPurified, 9), GT_Utility.getIntegratedCircuit(9)) + .fluidInputs(AquaRegia.getFluidOrGas(1350)) + .fluidOutputs(PTConcentrate.getFluidOrGas(1350)) + .duration(11 * SECONDS + 5 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder() + .itemInputs(w.get(crushedPurified, 9), PTMetallicPowder.get(dust, 9)) + .itemOutputs(PTResidue.get(dust)) + .fluidInputs(AquaRegia.getFluidOrGas(10350)) + .fluidOutputs(PTConcentrate.getFluidOrGas(10350)) + .duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); - GT_Values.RA.stdBuilder().itemInputs(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(1)) - .fluidInputs(AquaRegia.getFluidOrGas(150)).fluidOutputs(PTConcentrate.getFluidOrGas(150)) - .duration(12 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + } + for (Materials m : Materials.values()) if (PlatinumSludgeOverHaul.materialsContains(m, Materials.Sulfur) + && (PlatinumSludgeOverHaul.materialsContains(m, Materials.Copper) + || PlatinumSludgeOverHaul.materialsContains(m, Materials.Nickel))) { + + GT_Values.RA.stdBuilder() + .itemInputs(GT_OreDictUnificator.get(crushedPurified, m, 1), GT_Utility.getIntegratedCircuit(1)) + .fluidInputs(AquaRegia.getFluidOrGas(150)) + .fluidOutputs(PTConcentrate.getFluidOrGas(150)) + .duration(12 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder() + .itemInputs(GT_OreDictUnificator.get(crushedPurified, m, 9), GT_Utility.getIntegratedCircuit(9)) + .fluidInputs(AquaRegia.getFluidOrGas(1350)) + .fluidOutputs(PTConcentrate.getFluidOrGas(1350)) + .duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder() + .itemInputs(GT_OreDictUnificator.get(crushedPurified, m, 9), PTMetallicPowder.get(dust, 9)) + .itemOutputs(PTResidue.get(dust)) + .fluidInputs(AquaRegia.getFluidOrGas(10350)) + .fluidOutputs(PTConcentrate.getFluidOrGas(10350)) + .duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); - GT_Values.RA.stdBuilder().itemInputs(w.get(crushedPurified, 9), GT_Utility.getIntegratedCircuit(9)) - .fluidInputs(AquaRegia.getFluidOrGas(1350)).fluidOutputs(PTConcentrate.getFluidOrGas(1350)) - .duration(11 * SECONDS + 5 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + } + // Pt + GT_Values.RA.stdBuilder() + .itemInputs(PTMetallicPowder.get(dust, 3), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(Materials.Platinum.getNuggets(2)) + .duration(30 * SECONDS) + .eut(TierEU.RECIPE_MV) + .metadata(COIL_HEAT, Materials.Platinum.mMeltingPoint) + .addTo(blastFurnaceRecipes); - GT_Values.RA.stdBuilder().itemInputs(w.get(crushedPurified, 9), PTMetallicPowder.get(dust, 9)) - .itemOutputs(PTResidue.get(dust)).fluidInputs(AquaRegia.getFluidOrGas(10350)) - .fluidOutputs(PTConcentrate.getFluidOrGas(10350)) - .duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) - .addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(PTResidue.get(dustTiny)) + .fluidInputs(AquaRegia.getFluidOrGas(1000)) + .fluidOutputs(PTConcentrate.getFluidOrGas(1000)) + .duration(12 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); - } - for (Materials m : Materials.values()) if (PlatinumSludgeOverHaul.materialsContains(m, Materials.Sulfur) - && (PlatinumSludgeOverHaul.materialsContains(m, Materials.Copper) - || PlatinumSludgeOverHaul.materialsContains(m, Materials.Nickel))) { - - GT_Values.RA.stdBuilder() - .itemInputs( - GT_OreDictUnificator.get(crushedPurified, m, 1), - GT_Utility.getIntegratedCircuit(1)) - .fluidInputs(AquaRegia.getFluidOrGas(150)) - .fluidOutputs(PTConcentrate.getFluidOrGas(150)).duration(12 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); - - GT_Values.RA.stdBuilder() - .itemInputs( - GT_OreDictUnificator.get(crushedPurified, m, 9), - GT_Utility.getIntegratedCircuit(9)) - .fluidInputs(AquaRegia.getFluidOrGas(1350)) - .fluidOutputs(PTConcentrate.getFluidOrGas(1350)) - .duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) - .addTo(UniversalChemical); - - GT_Values.RA.stdBuilder() - .itemInputs( - GT_OreDictUnificator.get(crushedPurified, m, 9), - PTMetallicPowder.get(dust, 9)) - .itemOutputs(PTResidue.get(dust)).fluidInputs(AquaRegia.getFluidOrGas(10350)) - .fluidOutputs(PTConcentrate.getFluidOrGas(10350)) - .duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) - .addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(PTMetallicPowder.get(dust, 9), GT_Utility.getIntegratedCircuit(9)) + .itemOutputs(PTResidue.get(dust)) + .fluidInputs(AquaRegia.getFluidOrGas(9000)) + .fluidOutputs(PTConcentrate.getFluidOrGas(9000)) + .duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); - } - // Pt - GT_Values.RA.stdBuilder().itemInputs(PTMetallicPowder.get(dust, 3), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(Materials.Platinum.getNuggets(2)).duration(30 * SECONDS).eut(TierEU.RECIPE_MV) - .metadata(COIL_HEAT, Materials.Platinum.mMeltingPoint).addTo(blastFurnaceRecipes); - - GT_Values.RA.stdBuilder().itemInputs(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(PTResidue.get(dustTiny)).fluidInputs(AquaRegia.getFluidOrGas(1000)) - .fluidOutputs(PTConcentrate.getFluidOrGas(1000)).duration(12 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); - - GT_Values.RA.stdBuilder().itemInputs(PTMetallicPowder.get(dust, 9), GT_Utility.getIntegratedCircuit(9)) - .itemOutputs(PTResidue.get(dust)).fluidInputs(AquaRegia.getFluidOrGas(9000)) - .fluidOutputs(PTConcentrate.getFluidOrGas(9000)).duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); - - GT_Values.RA.stdBuilder().itemInputs(PTConcentrate.get(cell, 2)) - .itemOutputs( - PTSaltCrude.get(dustTiny, 16), - PTRawPowder.get(dustTiny, 4), - Materials.NitrogenDioxide.getCells(1), - Materials.DilutedSulfuricAcid.getCells(1)) - .fluidInputs(AmmoniumChloride.getFluidOrGas(400)).fluidOutputs(PDAmmonia.getFluidOrGas(400)) - .duration(60 * SECONDS).eut(TierEU.RECIPE_LV).addTo(centrifugeRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(PTConcentrate.get(cell, 2)) + .itemOutputs( + PTSaltCrude.get(dustTiny, 16), + PTRawPowder.get(dustTiny, 4), + Materials.NitrogenDioxide.getCells(1), + Materials.DilutedSulfuricAcid.getCells(1)) + .fluidInputs(AmmoniumChloride.getFluidOrGas(400)) + .fluidOutputs(PDAmmonia.getFluidOrGas(400)) + .duration(60 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(centrifugeRecipes); GT_Values.RA.addMultiblockChemicalRecipe( - new ItemStack[] { GT_Utility.getIntegratedCircuit(1) }, - new FluidStack[] { PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(400) }, - new FluidStack[] { PDAmmonia.getFluidOrGas(400), Materials.NitrogenDioxide.getGas(1000), - Materials.DilutedSulfuricAcid.getFluid(1000) }, - new ItemStack[] { PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny, 4) }, - 1200, - 30); + new ItemStack[] { GT_Utility.getIntegratedCircuit(1) }, + new FluidStack[] { PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(400) }, + new FluidStack[] { PDAmmonia.getFluidOrGas(400), Materials.NitrogenDioxide.getGas(1000), + Materials.DilutedSulfuricAcid.getFluid(1000) }, + new ItemStack[] { PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny, 4) }, + 1200, + 30); GT_Values.RA.addMultiblockChemicalRecipe( - new ItemStack[] { GT_Utility.getIntegratedCircuit(2) }, - new FluidStack[] { PTConcentrate.getFluidOrGas(18000), AmmoniumChloride.getFluidOrGas(3600) }, - new FluidStack[] { PDAmmonia.getFluidOrGas(3600), Materials.NitrogenDioxide.getGas(9000), - Materials.DilutedSulfuricAcid.getFluid(9000) }, - new ItemStack[] { PTSaltCrude.get(dust, 16), PTRawPowder.get(dust, 4) }, - 1400, - 240); - - GT_Values.RA.stdBuilder().itemInputs(PTSaltCrude.get(dust)) - .itemOutputs( - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust)) - .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500).duration(30 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(sifterRecipes); - - GT_Values.RA.stdBuilder().itemInputs(PTSaltRefined.get(dust), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(PTMetallicPowder.get(dust)).fluidOutputs(Materials.Chlorine.getGas(87)) - .duration(10 * SECONDS).eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 900).addTo(blastFurnaceRecipes); + new ItemStack[] { GT_Utility.getIntegratedCircuit(2) }, + new FluidStack[] { PTConcentrate.getFluidOrGas(18000), AmmoniumChloride.getFluidOrGas(3600) }, + new FluidStack[] { PDAmmonia.getFluidOrGas(3600), Materials.NitrogenDioxide.getGas(9000), + Materials.DilutedSulfuricAcid.getFluid(9000) }, + new ItemStack[] { PTSaltCrude.get(dust, 16), PTRawPowder.get(dust, 4) }, + 1400, + 240); + + GT_Values.RA.stdBuilder() + .itemInputs(PTSaltCrude.get(dust)) + .itemOutputs( + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust)) + .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500) + .duration(30 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(sifterRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(PTSaltRefined.get(dust), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(PTMetallicPowder.get(dust)) + .fluidOutputs(Materials.Chlorine.getGas(87)) + .duration(10 * SECONDS) + .eut(TierEU.RECIPE_MV) + .metadata(COIL_HEAT, 900) + .addTo(blastFurnaceRecipes); // 2PtCl + Ca = 2Pt + CaCl2 - GT_Values.RA.stdBuilder().itemInputs(PTRawPowder.get(dust, 4), Materials.Calcium.getDust(1)) - .itemOutputs(Materials.Platinum.getDust(2), CalciumChloride.get(dust, 3)) - .duration(1 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(PTRawPowder.get(dust, 4), Materials.Calcium.getDust(1)) + .itemOutputs(Materials.Platinum.getDust(2), CalciumChloride.get(dust, 3)) + .duration(1 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); // Pd - GT_Values.RA.stdBuilder().itemInputs(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1)) - .fluidInputs(Materials.Ammonia.getGas(1000)).fluidOutputs(PDAmmonia.getFluidOrGas(1000)) - .duration(12 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); - - GT_Values.RA.stdBuilder().itemInputs(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(PDSalt.get(dustTiny, 16), PDRawPowder.get(dustTiny, 2)) - .fluidInputs(PDAmmonia.getFluidOrGas(1000)).duration(12 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) - .addTo(UniversalChemical); - - GT_Values.RA.stdBuilder().itemInputs(PDMetallicPowder.get(dust, 9), GT_Utility.getIntegratedCircuit(9)) - .itemOutputs(PDSalt.get(dust, 16), PDRawPowder.get(dust, 2)).fluidInputs(PDAmmonia.getFluidOrGas(9000)) - .duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); - - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(2)).itemOutputs(PDSalt.get(dust)) - .fluidInputs(PDAmmonia.getFluidOrGas(1000)).duration(12 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_LV) - .addTo(UniversalChemical); - - GT_Values.RA.stdBuilder().itemInputs(PDSalt.get(dust)) - .itemOutputs( - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust)) - .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500).duration(30 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(sifterRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1)) + .fluidInputs(Materials.Ammonia.getGas(1000)) + .fluidOutputs(PDAmmonia.getFluidOrGas(1000)) + .duration(12 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder() + .itemInputs(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(PDSalt.get(dustTiny, 16), PDRawPowder.get(dustTiny, 2)) + .fluidInputs(PDAmmonia.getFluidOrGas(1000)) + .duration(12 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder() + .itemInputs(PDMetallicPowder.get(dust, 9), GT_Utility.getIntegratedCircuit(9)) + .itemOutputs(PDSalt.get(dust, 16), PDRawPowder.get(dust, 2)) + .fluidInputs(PDAmmonia.getFluidOrGas(9000)) + .duration(1 * MINUTES + 52 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.getIntegratedCircuit(2)) + .itemOutputs(PDSalt.get(dust)) + .fluidInputs(PDAmmonia.getFluidOrGas(1000)) + .duration(12 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder() + .itemInputs(PDSalt.get(dust)) + .itemOutputs( + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust)) + .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500) + .duration(30 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(sifterRecipes); GT_Values.RA.addChemicalRecipeForBasicMachineOnly( - PDRawPowder.get(dust, 4), - Materials.Empty.getCells(1), - FormicAcid.getFluidOrGas(4000), - Materials.Ammonia.getGas(4000), - Materials.Palladium.getDust(2), - Materials.Ethylene.getCells(1), - 250, - 30); + PDRawPowder.get(dust, 4), + Materials.Empty.getCells(1), + FormicAcid.getFluidOrGas(4000), + Materials.Ammonia.getGas(4000), + Materials.Palladium.getDust(2), + Materials.Ethylene.getCells(1), + 250, + 30); GT_Values.RA.addMultiblockChemicalRecipe( - new ItemStack[] { PDRawPowder.get(dust, 4) }, - new FluidStack[] { FormicAcid.getFluidOrGas(4000) }, - new FluidStack[] { Materials.Ammonia.getGas(4000), Materials.Ethylene.getGas(1000), - Materials.Water.getFluid(1000) }, - new ItemStack[] { Materials.Palladium.getDust(2) }, - 250, - 30); + new ItemStack[] { PDRawPowder.get(dust, 4) }, + new FluidStack[] { FormicAcid.getFluidOrGas(4000) }, + new FluidStack[] { Materials.Ammonia.getGas(4000), Materials.Ethylene.getGas(1000), + Materials.Water.getFluid(1000) }, + new ItemStack[] { Materials.Palladium.getDust(2) }, + 250, + 30); // Na2SO4 + 2H = 2Na + H2SO4 - GT_Values.RA.stdBuilder().itemInputs(Sodiumsulfate.get(dust, 7), Materials.Hydrogen.getCells(2)) - .itemOutputs(Materials.Sodium.getDust(2), Materials.Empty.getCells(2)) - .fluidOutputs(Materials.SulfuricAcid.getFluid(1000)).duration(1 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(Sodiumsulfate.get(dust, 7), Materials.Hydrogen.getCells(2)) + .itemOutputs(Materials.Sodium.getDust(2), Materials.Empty.getCells(2)) + .fluidOutputs(Materials.SulfuricAcid.getFluid(1000)) + .duration(1 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); // K2S2O7 // GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), // Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust,6), null, 30); // Rh/Os/Ir/Ru - GT_Values.RA.stdBuilder().itemInputs(PTResidue.get(dust), GT_Utility.getIntegratedCircuit(11)) - .itemOutputs(LeachResidue.get(dust)).fluidInputs(PotassiumDisulfate.getMolten(360)) - .fluidOutputs(RHSulfate.getFluidOrGas(360)).duration(10 * SECONDS).eut(TierEU.RECIPE_MV) - .metadata(COIL_HEAT, 775).addTo(blastFurnaceRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(PTResidue.get(dust), GT_Utility.getIntegratedCircuit(11)) + .itemOutputs(LeachResidue.get(dust)) + .fluidInputs(PotassiumDisulfate.getMolten(360)) + .fluidOutputs(RHSulfate.getFluidOrGas(360)) + .duration(10 * SECONDS) + .eut(TierEU.RECIPE_MV) + .metadata(COIL_HEAT, 775) + .addTo(blastFurnaceRecipes); // Ru - GT_Values.RA.stdBuilder().itemInputs(LeachResidue.get(dust, 10), Materials.Saltpeter.getDust(10)) - .itemOutputs(SodiumRuthenate.get(dust, 3), IrOsLeachResidue.get(dust, 6)) - .fluidInputs(Materials.SaltWater.getFluid(1000)).fluidOutputs(GT_ModHandler.getSteam(1000)) - .duration(10 * SECONDS).eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 775).addTo(blastFurnaceRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(LeachResidue.get(dust, 10), Materials.Saltpeter.getDust(10)) + .itemOutputs(SodiumRuthenate.get(dust, 3), IrOsLeachResidue.get(dust, 6)) + .fluidInputs(Materials.SaltWater.getFluid(1000)) + .fluidOutputs(GT_ModHandler.getSteam(1000)) + .duration(10 * SECONDS) + .eut(TierEU.RECIPE_MV) + .metadata(COIL_HEAT, 775) + .addTo(blastFurnaceRecipes); - GT_Values.RA.stdBuilder().itemInputs(SodiumRuthenate.get(dust, 6), Materials.Chlorine.getCells(3)) - .itemOutputs(Materials.Empty.getCells(3)).fluidOutputs(RutheniumTetroxideSollution.getFluidOrGas(9000)) - .duration(15 * SECONDS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(SodiumRuthenate.get(dust, 6), Materials.Chlorine.getCells(3)) + .itemOutputs(Materials.Empty.getCells(3)) + .fluidOutputs(RutheniumTetroxideSollution.getFluidOrGas(9000)) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(1)) - .fluidInputs(RutheniumTetroxideSollution.getFluidOrGas(800)) - .fluidOutputs(HotRutheniumTetroxideSollution.getFluidOrGas(800)).duration(15 * SECONDS) - .eut(TierEU.RECIPE_HV).addTo(fluidHeaterRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.getIntegratedCircuit(1)) + .fluidInputs(RutheniumTetroxideSollution.getFluidOrGas(800)) + .fluidOutputs(HotRutheniumTetroxideSollution.getFluidOrGas(800)) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_HV) + .addTo(fluidHeaterRecipes); GT_Values.RA.addCrackingRecipe( - 17, - RutheniumTetroxideSollution.getFluidOrGas(1000), - GT_ModHandler.getSteam(1000), - HotRutheniumTetroxideSollution.getFluidOrGas(2000), - 150, - 480); + 17, + RutheniumTetroxideSollution.getFluidOrGas(1000), + GT_ModHandler.getSteam(1000), + HotRutheniumTetroxideSollution.getFluidOrGas(2000), + 150, + 480); GT_Values.RA.addDistillationTowerRecipe( - HotRutheniumTetroxideSollution.getFluidOrGas(9000), - new FluidStack[] { Materials.Water.getFluid(1800), RutheniumTetroxide.getFluidOrGas(7200) }, - Materials.Salt.getDust(6), - 1500, - 480); + HotRutheniumTetroxideSollution.getFluidOrGas(9000), + new FluidStack[] { Materials.Water.getFluid(1800), RutheniumTetroxide.getFluidOrGas(7200) }, + Materials.Salt.getDust(6), + 1500, + 480); - GT_Values.RA.stdBuilder().itemInputs(RutheniumTetroxide.get(dust, 1), Materials.HydrochloricAcid.getCells(6)) - .itemOutputs(Ruthenium.get(dust), Materials.Chlorine.getCells(6)) - .fluidOutputs(Materials.Water.getFluid(2000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(RutheniumTetroxide.get(dust, 1), Materials.HydrochloricAcid.getCells(6)) + .itemOutputs(Ruthenium.get(dust), Materials.Chlorine.getCells(6)) + .fluidOutputs(Materials.Water.getFluid(2000)) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); // Os - GT_Values.RA.stdBuilder().itemInputs(IrOsLeachResidue.get(dust, 4), GT_Utility.getIntegratedCircuit(11)) - .itemOutputs(IrLeachResidue.get(dust, 2)).fluidInputs(Materials.HydrochloricAcid.getFluid(1000)) - .fluidOutputs(AcidicOsmiumSolution.getFluidOrGas(2000)).duration(10 * SECONDS).eut(TierEU.RECIPE_MV) - .metadata(COIL_HEAT, 775).addTo(blastFurnaceRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(IrOsLeachResidue.get(dust, 4), GT_Utility.getIntegratedCircuit(11)) + .itemOutputs(IrLeachResidue.get(dust, 2)) + .fluidInputs(Materials.HydrochloricAcid.getFluid(1000)) + .fluidOutputs(AcidicOsmiumSolution.getFluidOrGas(2000)) + .duration(10 * SECONDS) + .eut(TierEU.RECIPE_MV) + .metadata(COIL_HEAT, 775) + .addTo(blastFurnaceRecipes); GT_Values.RA.addDistillationTowerRecipe( - AcidicOsmiumSolution.getFluidOrGas(1000), - new FluidStack[] { OsmiumSolution.getFluidOrGas(100), Materials.Water.getFluid(900) }, - null, - 150, - (int) TierEU.RECIPE_IV); + AcidicOsmiumSolution.getFluidOrGas(1000), + new FluidStack[] { OsmiumSolution.getFluidOrGas(100), Materials.Water.getFluid(900) }, + null, + 150, + (int) TierEU.RECIPE_IV); - GT_Values.RA.stdBuilder().itemInputs(OsmiumSolution.get(cell), Materials.HydrochloricAcid.getCells(6)) - .itemOutputs(Materials.Osmium.getDust(1), Materials.Chlorine.getCells(7)) - .fluidOutputs(Materials.Water.getFluid(2000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(OsmiumSolution.get(cell), Materials.HydrochloricAcid.getCells(6)) + .itemOutputs(Materials.Osmium.getDust(1), Materials.Chlorine.getCells(7)) + .fluidOutputs(Materials.Water.getFluid(2000)) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); // Ir - GT_Values.RA.stdBuilder().itemInputs(IrLeachResidue.get(dust), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(PGSDResidue.get(dust), IridiumDioxide.get(dust)).duration(10 * SECONDS) - .eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 775).addTo(blastFurnaceRecipes); - - GT_Values.RA.stdBuilder().itemInputs(IridiumDioxide.get(dust), Materials.HydrochloricAcid.getCells(1)) - .itemOutputs(Materials.Empty.getCells(1)).fluidOutputs(AcidicIridiumSolution.getFluidOrGas(1000)) - .duration(15 * SECONDS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); - - GT_Values.RA.stdBuilder().itemInputs(AcidicIridiumSolution.get(cell), AmmoniumChloride.get(cell, 3)) - .itemOutputs(Materials.Empty.getCells(4), IridiumChloride.get(dust)) - .fluidOutputs(Materials.Ammonia.getGas(3000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(UniversalChemical); - - GT_Values.RA.stdBuilder().itemInputs(IridiumChloride.get(dust), Materials.Calcium.getDust(1)) - .itemOutputs(PGSDResidue2.get(dust), Materials.Iridium.getDust(1)) - .fluidOutputs(CalciumChloride.getFluidOrGas(3000)).duration(15 * SECONDS).eut(TierEU.RECIPE_EV) - .addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(IrLeachResidue.get(dust), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(PGSDResidue.get(dust), IridiumDioxide.get(dust)) + .duration(10 * SECONDS) + .eut(TierEU.RECIPE_MV) + .metadata(COIL_HEAT, 775) + .addTo(blastFurnaceRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(IridiumDioxide.get(dust), Materials.HydrochloricAcid.getCells(1)) + .itemOutputs(Materials.Empty.getCells(1)) + .fluidOutputs(AcidicIridiumSolution.getFluidOrGas(1000)) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder() + .itemInputs(AcidicIridiumSolution.get(cell), AmmoniumChloride.get(cell, 3)) + .itemOutputs(Materials.Empty.getCells(4), IridiumChloride.get(dust)) + .fluidOutputs(Materials.Ammonia.getGas(3000)) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder() + .itemInputs(IridiumChloride.get(dust), Materials.Calcium.getDust(1)) + .itemOutputs(PGSDResidue2.get(dust), Materials.Iridium.getDust(1)) + .fluidOutputs(CalciumChloride.getFluidOrGas(3000)) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_EV) + .addTo(UniversalChemical); // Rh - GT_Values.RA.stdBuilder().itemInputs(RHSulfate.get(cell, 11), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(RHSulfateSolution.get(cell, 11), LeachResidue.get(dustTiny, 10)) - .fluidInputs(Materials.Water.getFluid(10000)).fluidOutputs(Materials.Potassium.getMolten(2000)) - .duration(15 * SECONDS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(RHSulfate.get(cell, 11), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(RHSulfateSolution.get(cell, 11), LeachResidue.get(dustTiny, 10)) + .fluidInputs(Materials.Water.getFluid(10000)) + .fluidOutputs(Materials.Potassium.getMolten(2000)) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); GT_Values.RA.addMultiblockChemicalRecipe( - new ItemStack[] { GT_Utility.getIntegratedCircuit(3) }, - new FluidStack[] { Materials.Water.getFluid(36000), RHSulfate.getFluidOrGas(39600) }, - new FluidStack[] { Materials.Potassium.getMolten(7200), RHSulfateSolution.getFluidOrGas(39600) }, - new ItemStack[] { LeachResidue.get(dust, 4) }, - 1200, - 30); - - GT_Values.RA.stdBuilder().itemInputs(Materials.Zinc.getDust(1)) - .itemOutputs(ZincSulfate.get(dust, 6), CrudeRhMetall.get(dust)) - .fluidInputs(RHSulfateSolution.getFluidOrGas(1000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(UniversalChemical); - - GT_Values.RA.stdBuilder().itemInputs(CrudeRhMetall.get(dust), Materials.Salt.getDust(1)) - .itemOutputs(RHSalt.get(dust, 3)).fluidInputs(Materials.Chlorine.getGas(1000)).duration(15 * SECONDS) - .eut(TierEU.RECIPE_MV).metadata(COIL_HEAT, 600).addTo(blastFurnaceRecipes); - - GT_Values.RA.stdBuilder().itemInputs(RHSalt.get(dust, 10)).fluidInputs(Materials.Water.getFluid(2000)) - .fluidOutputs(RHSaltSolution.getFluidOrGas(2000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(mixerRecipes); - - GT_Values.RA.stdBuilder().itemInputs(SodiumNitrate.get(dust, 5), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(RHNitrate.get(dust), Materials.Salt.getDust(2)) - .fluidInputs(RHSaltSolution.getFluidOrGas(1000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(UniversalChemical); + new ItemStack[] { GT_Utility.getIntegratedCircuit(3) }, + new FluidStack[] { Materials.Water.getFluid(36000), RHSulfate.getFluidOrGas(39600) }, + new FluidStack[] { Materials.Potassium.getMolten(7200), RHSulfateSolution.getFluidOrGas(39600) }, + new ItemStack[] { LeachResidue.get(dust, 4) }, + 1200, + 30); + + GT_Values.RA.stdBuilder() + .itemInputs(Materials.Zinc.getDust(1)) + .itemOutputs(ZincSulfate.get(dust, 6), CrudeRhMetall.get(dust)) + .fluidInputs(RHSulfateSolution.getFluidOrGas(1000)) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder() + .itemInputs(CrudeRhMetall.get(dust), Materials.Salt.getDust(1)) + .itemOutputs(RHSalt.get(dust, 3)) + .fluidInputs(Materials.Chlorine.getGas(1000)) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_MV) + .metadata(COIL_HEAT, 600) + .addTo(blastFurnaceRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(RHSalt.get(dust, 10)) + .fluidInputs(Materials.Water.getFluid(2000)) + .fluidOutputs(RHSaltSolution.getFluidOrGas(2000)) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(mixerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(SodiumNitrate.get(dust, 5), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(RHNitrate.get(dust), Materials.Salt.getDust(2)) + .fluidInputs(RHSaltSolution.getFluidOrGas(1000)) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); // Na + HNO3 = NaNO3 + H - GT_Values.RA.stdBuilder().itemInputs(Materials.Sodium.getDust(1)).itemOutputs(SodiumNitrate.get(dust, 5)) - .fluidInputs(Materials.NitricAcid.getFluid(1000)).fluidOutputs(Materials.Hydrogen.getGas(1000)) - .duration(8 * TICKS).eut(60).addTo(UniversalChemical); - - GT_Values.RA.stdBuilder().itemInputs(RHNitrate.get(dust)) - .itemOutputs( - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust)) - .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500).duration(30 * SECONDS) - .eut(TierEU.RECIPE_LV).addTo(sifterRecipes); - - GT_Values.RA.stdBuilder().itemInputs(RhFilterCake.get(dust)).fluidInputs(Materials.Water.getFluid(1000)) - .fluidOutputs(RHFilterCakeSolution.getFluidOrGas(1000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(mixerRecipes); - - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(2)).itemOutputs(ReRh.get(dust)) - .fluidInputs(RHFilterCakeSolution.getFluidOrGas(1000)).duration(15 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(UniversalChemical); - - GT_Values.RA.stdBuilder().itemInputs(ReRh.get(dust), Materials.Empty.getCells(1)) - .itemOutputs(Rhodium.get(dust), Materials.Ammonia.getCells(1)) - .fluidInputs(Materials.HydrochloricAcid.getFluid(1000)).fluidOutputs(Materials.Chlorine.getGas(1000)) - .duration(15 * SECONDS).eut(TierEU.RECIPE_LV).addTo(UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(Materials.Sodium.getDust(1)) + .itemOutputs(SodiumNitrate.get(dust, 5)) + .fluidInputs(Materials.NitricAcid.getFluid(1000)) + .fluidOutputs(Materials.Hydrogen.getGas(1000)) + .duration(8 * TICKS) + .eut(60) + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder() + .itemInputs(RHNitrate.get(dust)) + .itemOutputs( + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust)) + .outputChances(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500) + .duration(30 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(sifterRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(RhFilterCake.get(dust)) + .fluidInputs(Materials.Water.getFluid(1000)) + .fluidOutputs(RHFilterCakeSolution.getFluidOrGas(1000)) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(mixerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.getIntegratedCircuit(2)) + .itemOutputs(ReRh.get(dust)) + .fluidInputs(RHFilterCakeSolution.getFluidOrGas(1000)) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); + + GT_Values.RA.stdBuilder() + .itemInputs(ReRh.get(dust), Materials.Empty.getCells(1)) + .itemOutputs(Rhodium.get(dust), Materials.Ammonia.getCells(1)) + .fluidInputs(Materials.HydrochloricAcid.getFluid(1000)) + .fluidOutputs(Materials.Chlorine.getGas(1000)) + .duration(15 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(UniversalChemical); } @@ -553,48 +731,51 @@ public class PlatinumSludgeOverHaul { @SuppressWarnings({ "unchecked", "rawtypes" }) public static void replacePureElements() { // furnace - for (Object entry : FurnaceRecipes.smelting().getSmeltingList().entrySet()) { + for (Object entry : FurnaceRecipes.smelting() + .getSmeltingList() + .entrySet()) { Map.Entry realEntry = (Map.Entry) entry; if (GT_Utility.isStackValid(realEntry.getKey()) - && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getKey())) { + && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getKey())) { ItemData association = GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()); if (!dust.equals(association.mPrefix) && !dustTiny.equals(association.mPrefix) - || !association.mMaterial.mMaterial.equals(Materials.Platinum)) + || !association.mMaterial.mMaterial.equals(Materials.Platinum)) if (GT_Utility.isStackValid(realEntry.getValue()) - && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())) { - ItemData ass = GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()); - if (ass.mMaterial.mMaterial.equals(Materials.Platinum)) - if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) - realEntry.setValue( - PTMetallicPowder.get( - ass.mPrefix == nugget ? dustTiny : dust, - ((ItemStack) realEntry.getValue()).stackSize * 2)); - else if (ass.mMaterial.mMaterial.equals(Materials.Palladium)) - if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) - realEntry.setValue( - PDMetallicPowder.get( - ass.mPrefix == nugget ? dustTiny : dust, - ((ItemStack) realEntry.getValue()).stackSize * 2)); - } + && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())) { + ItemData ass = GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()); + if (ass.mMaterial.mMaterial.equals(Materials.Platinum)) + if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) + realEntry.setValue( + PTMetallicPowder.get( + ass.mPrefix == nugget ? dustTiny : dust, + ((ItemStack) realEntry.getValue()).stackSize * 2)); + else if (ass.mMaterial.mMaterial.equals(Materials.Palladium)) + if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) + realEntry.setValue( + PDMetallicPowder.get( + ass.mPrefix == nugget ? dustTiny : dust, + ((ItemStack) realEntry.getValue()).stackSize * 2)); + } } } // vanilla crafting - CraftingManager.getInstance().getRecipeList().forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); + CraftingManager.getInstance() + .getRecipeList() + .forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); // gt crafting try { - ((List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null)) - .forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); + ((List) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true) + .get(null)).forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); } catch (IllegalAccessException e) { e.printStackTrace(); } // gt machines maploop: for (RecipeMap map : RecipeMap.ALL_RECIPE_MAPS.values()) { if (map == RecipeMaps.fusionRecipes || map == RecipeMaps.unpackagerRecipes - || map == RecipeMaps.packagerRecipes - || map == RecipeMaps.replicatorRecipes - || "gt.recipe.eyeofharmony".equals(map.unlocalizedName) - || "gtpp.recipe.quantumforcesmelter".equals(map.unlocalizedName)) - continue; + || map == RecipeMaps.packagerRecipes + || map == RecipeMaps.replicatorRecipes + || "gt.recipe.eyeofharmony".equals(map.unlocalizedName) + || "gtpp.recipe.quantumforcesmelter".equals(map.unlocalizedName)) continue; HashSet toDel = new HashSet<>(); recipeloop: for (GT_Recipe recipe : map.getAllRecipes()) { if (recipe.mFakeRecipe) continue maploop; @@ -603,9 +784,9 @@ public class PlatinumSludgeOverHaul { if (map.equals(RecipeMaps.fluidExtractionRecipes)) continue maploop; if ("gtpp.recipe.alloyblastsmelter".equals(map.unlocalizedName)) continue maploop; if (map.equals(RecipeMaps.multiblockChemicalReactorRecipes) - || map.equals(RecipeMaps.chemicalReactorRecipes)) { + || map.equals(RecipeMaps.chemicalReactorRecipes)) { if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i]) - || GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) + || GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) toDel.add(recipe); else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) { recipe.mFluidOutputs[i] = AcidicIridiumSolution.getFluidOrGas(1000); @@ -620,9 +801,9 @@ public class PlatinumSludgeOverHaul { recipe.reloadOwner(); } } else if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i]) - || GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i]) - || GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i]) - || GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) + || GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i]) + || GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i]) + || GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) toDel.add(recipe); else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) toDel.add(recipe); @@ -630,9 +811,9 @@ public class PlatinumSludgeOverHaul { for (int i = 0; i < recipe.mOutputs.length; i++) { if (!GT_Utility.isStackValid(recipe.mOutputs[i])) continue; if ((BW_Util.areStacksEqualOrNull(Ruthenium.get(dust), recipe.mOutputs[i]) - || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustImpure), recipe.mOutputs[i]) - || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustPure), recipe.mOutputs[i])) - && !BW_Util.areStacksEqualOrNull(Ruthenium.get(ingot), recipe.mInputs[0])) { + || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustImpure), recipe.mOutputs[i]) + || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustPure), recipe.mOutputs[i])) + && !BW_Util.areStacksEqualOrNull(Ruthenium.get(ingot), recipe.mInputs[0])) { for (ItemStack mInput : recipe.mInputs) if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop; int amount = recipe.mOutputs[i].stackSize * 2; @@ -640,9 +821,9 @@ public class PlatinumSludgeOverHaul { recipe.reloadOwner(); } if ((BW_Util.areStacksEqualOrNull(Rhodium.get(dust), recipe.mOutputs[i]) - || BW_Util.areStacksEqualOrNull(Rhodium.get(dustImpure), recipe.mOutputs[i]) - || BW_Util.areStacksEqualOrNull(Rhodium.get(dustPure), recipe.mOutputs[i])) - && !BW_Util.areStacksEqualOrNull(Rhodium.get(ingot), recipe.mInputs[0])) { + || BW_Util.areStacksEqualOrNull(Rhodium.get(dustImpure), recipe.mOutputs[i]) + || BW_Util.areStacksEqualOrNull(Rhodium.get(dustPure), recipe.mOutputs[i])) + && !BW_Util.areStacksEqualOrNull(Rhodium.get(ingot), recipe.mInputs[0])) { for (ItemStack mInput : recipe.mInputs) if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop; int amount = recipe.mOutputs[i].stackSize * 2; @@ -652,13 +833,13 @@ public class PlatinumSludgeOverHaul { if (!BW_Util.checkStackAndPrefix(recipe.mOutputs[i])) continue; // Pt if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial - .equals(Materials.Platinum)) { + .equals(Materials.Platinum)) { for (ItemStack mInput : recipe.mInputs) { if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop; } if (dust.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) - || dustImpure.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) - || dustPure.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { + || dustImpure.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) + || dustPure.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dust), amount * 2); recipe.reloadOwner(); @@ -672,93 +853,86 @@ public class PlatinumSludgeOverHaul { recipe.reloadOwner(); } } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial - .equals(Materials.Palladium)) { + .equals(Materials.Palladium)) { + for (ItemStack mInput : recipe.mInputs) { + if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop; + } + if (dust.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) + || dustImpure.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) + || dustPure.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dust), amount * 4); + recipe.reloadOwner(); + } else + if (dustSmall.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = BW_Util + .setStackSize(PDMetallicPowder.get(dustSmall), amount * 4); + recipe.reloadOwner(); + } else if (dustTiny + .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = BW_Util + .setStackSize(PDMetallicPowder.get(dustTiny), amount * 4); + recipe.reloadOwner(); + } + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial + .equals(Materials.Osmium)) { for (ItemStack mInput : recipe.mInputs) { if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop; } if (dust.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) - || dustImpure - .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) - || dustPure.equals( - GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { + || dustImpure + .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) + || dustPure + .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dust), amount * 4); + recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dust), amount); recipe.reloadOwner(); } else if (dustSmall + .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = BW_Util + .setStackSize(IrOsLeachResidue.get(dustSmall), amount); + recipe.reloadOwner(); + } else if (dustTiny .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util - .setStackSize(PDMetallicPowder.get(dustSmall), amount * 4); + .setStackSize(IrOsLeachResidue.get(dustTiny), amount); recipe.reloadOwner(); - } else - if (dustTiny - .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util - .setStackSize(PDMetallicPowder.get(dustTiny), amount * 4); - recipe.reloadOwner(); - } - } else - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial - .equals(Materials.Osmium)) { + } + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial + .equals(Materials.Iridium)) { for (ItemStack mInput : recipe.mInputs) { if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop; } if (dust.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) - || dustImpure.equals( - GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) - || dustPure.equals( - GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { + || dustImpure + .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) + || dustPure + .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dust), amount); + recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dust), amount); recipe.reloadOwner(); } else if (dustSmall + .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { + int amount = recipe.mOutputs[i].stackSize; + recipe.mOutputs[i] = BW_Util + .setStackSize(IrLeachResidue.get(dustSmall), amount); + recipe.reloadOwner(); + } else if (dustTiny .equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util - .setStackSize(IrOsLeachResidue.get(dustSmall), amount); + .setStackSize(IrLeachResidue.get(dustTiny), amount); recipe.reloadOwner(); - } else - if (dustTiny.equals( - GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util - .setStackSize(IrOsLeachResidue.get(dustTiny), amount); - recipe.reloadOwner(); - } - } else - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial - .equals(Materials.Iridium)) { - for (ItemStack mInput : recipe.mInputs) { - if (PlatinumSludgeOverHaul.isInBlackList(mInput)) continue recipeloop; - } - if (dust.equals(GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) - || dustImpure.equals( - GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix) - || dustPure.equals( - GT_OreDictUnificator - .getAssociation(recipe.mOutputs[i]).mPrefix)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dust), amount); - recipe.reloadOwner(); - } else if (dustSmall.equals( - GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util - .setStackSize(IrLeachResidue.get(dustSmall), amount); - recipe.reloadOwner(); - } else - if (dustTiny.equals( - GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix)) { - int amount = recipe.mOutputs[i].stackSize; - recipe.mOutputs[i] = BW_Util - .setStackSize(IrLeachResidue.get(dustTiny), amount); - recipe.reloadOwner(); - } - } + } + } } } - map.getBackend().removeRecipes(toDel); + map.getBackend() + .removeRecipes(toDel); } // TODO: remove EnderIO recipes @@ -771,15 +945,15 @@ public class PlatinumSludgeOverHaul { @SuppressWarnings("deprecation") private static void replaceHVCircuitMaterials() { GT_Values.RA.addMixerRecipe( - Materials.Redstone.getDust(1), - Materials.Electrum.getDust(1), - GT_Utility.getIntegratedCircuit(1), - null, - null, - null, - Materials.Nikolite.getDust(8), - 1800, - 120); + Materials.Redstone.getDust(1), + Materials.Electrum.getDust(1), + GT_Utility.getIntegratedCircuit(1), + null, + null, + null, + Materials.Nikolite.getDust(8), + 1800, + 120); for (GT_Recipe recipe : RecipeMaps.circuitAssemblerRecipes.getAllRecipes()) { if (recipe.mEUt > 512) continue; if (BW_Util.checkStackAndPrefix(recipe.mOutputs[0])) { @@ -804,8 +978,10 @@ public class PlatinumSludgeOverHaul { inputItemName = "recipeItems"; } else if (GTPlusPlus.isModLoaded()) { try { - if (Class.forName("gtPlusPlus.api.objects.minecraft.ShapedRecipe").isAssignableFrom(obj.getClass())) - obj = CachedReflectionUtils.getField(obj.getClass(), "mRecipe").get(obj); + if (Class.forName("gtPlusPlus.api.objects.minecraft.ShapedRecipe") + .isAssignableFrom(obj.getClass())) + obj = CachedReflectionUtils.getField(obj.getClass(), "mRecipe") + .get(obj); } catch (ClassNotFoundException | IllegalAccessException e) { e.printStackTrace(); } @@ -883,7 +1059,7 @@ public class PlatinumSludgeOverHaul { for (Object stack : stacks) { if (stack instanceof ItemStack - && GT_Utility.areStacksEqual(GT_OreDictUnificator.get(crateGtDust, mat, 1), (ItemStack) stack)) + && GT_Utility.areStacksEqual(GT_OreDictUnificator.get(crateGtDust, mat, 1), (ItemStack) stack)) return true; } @@ -894,7 +1070,7 @@ public class PlatinumSludgeOverHaul { break; } allSame = BW_Util.checkStackAndPrefix((ItemStack) stack) - && GT_OreDictUnificator.getAssociation((ItemStack) stack).mMaterial.mMaterial.equals(mat); + && GT_OreDictUnificator.getAssociation((ItemStack) stack).mMaterial.mMaterial.equals(mat); if (!allSame) break; } return allSame; @@ -904,60 +1080,72 @@ public class PlatinumSludgeOverHaul { private static boolean isInBlackList(ItemStack stack) { if (stack == null || stack.getItem() instanceof BW_MetaGenerated_Items - || MainMod.MOD_ID.equals(GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId) - || BartWorksCrossmod.MOD_ID.equals(GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId)) + || MainMod.MOD_ID.equals(GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId) + || BartWorksCrossmod.MOD_ID.equals(GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId)) return true; if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(NewHorizonsCoreMod.ID) - && !stack.getUnlocalizedName().contains("dust") - && !stack.getUnlocalizedName().contains("Dust")) + && !stack.getUnlocalizedName() + .contains("dust") + && !stack.getUnlocalizedName() + .contains("Dust")) return true; if (Block.getBlockFromItem(stack.getItem()) instanceof GT_Generic_Block - && !(Block.getBlockFromItem(stack.getItem()) instanceof GT_Block_Ores_Abstract)) - return true; + && !(Block.getBlockFromItem(stack.getItem()) instanceof GT_Block_Ores_Abstract)) return true; - if (Arrays.stream(ItemList.values()).filter(ItemList::hasBeenSet) - .anyMatch(e -> !BW_Util.checkStackAndPrefix(stack) && GT_Utility.areStacksEqual(e.get(1), stack, true))) + if (Arrays.stream(ItemList.values()) + .filter(ItemList::hasBeenSet) + .anyMatch(e -> !BW_Util.checkStackAndPrefix(stack) && GT_Utility.areStacksEqual(e.get(1), stack, true))) return true; if (stack.getItem() instanceof GT_Generic_Item) { if (!BW_Util.checkStackAndPrefix(stack)) return false; if (GT_OreDictUnificator.getAssociation(stack).mPrefix != rawOre) { return !Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST) - .contains(GT_OreDictUnificator.getAssociation(stack).mPrefix) - || Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST) - .contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); + .contains(GT_OreDictUnificator.getAssociation(stack).mPrefix) + || Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST) + .contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); } } if (GTPlusPlus.isModLoaded()) { try { if (Class.forName("gtPlusPlus.core.item.base.BaseItemComponent") - .isAssignableFrom(stack.getItem().getClass()) && !stack.getUnlocalizedName().contains("dust") - && !stack.getUnlocalizedName().contains("Dust")) + .isAssignableFrom( + stack.getItem() + .getClass()) + && !stack.getUnlocalizedName() + .contains("dust") + && !stack.getUnlocalizedName() + .contains("Dust")) return true; if (Class.forName("gtPlusPlus.core.block.base.BlockBaseModular") - .isAssignableFrom(Block.getBlockFromItem(stack.getItem()).getClass())) + .isAssignableFrom( + Block.getBlockFromItem(stack.getItem()) + .getClass())) return true; } catch (ClassNotFoundException e) { e.printStackTrace(); } - if (stack.getItem() == GT_ModHandler.getModItem(GTPlusPlus.ID, "itemDustHeLiCoPtEr", 1L).getItem()) { + if (stack.getItem() == GT_ModHandler.getModItem(GTPlusPlus.ID, "itemDustHeLiCoPtEr", 1L) + .getItem()) { return true; } - if (stack.getItem() == GT_ModHandler.getModItem(GTPlusPlus.ID, "itemDustWhiteMetal", 1L).getItem()) { + if (stack.getItem() == GT_ModHandler.getModItem(GTPlusPlus.ID, "itemDustWhiteMetal", 1L) + .getItem()) { return true; } } if (GalaxySpace.isModLoaded()) { - if (stack.getItem() == GT_ModHandler.getModItem(GalaxySpace.ID, "metalsblock", 1L, 7).getItem()) { + if (stack.getItem() == GT_ModHandler.getModItem(GalaxySpace.ID, "metalsblock", 1L, 7) + .getItem()) { return true; } } if (NewHorizonsCoreMod.isModLoaded()) { - if (stack.getItem() - == GT_ModHandler.getModItem(NewHorizonsCoreMod.ID, "item.IndustryFrame", 1L).getItem()) { + if (stack.getItem() == GT_ModHandler.getModItem(NewHorizonsCoreMod.ID, "item.IndustryFrame", 1L) + .getItem()) { return true; } } @@ -965,6 +1153,6 @@ public class PlatinumSludgeOverHaul { return false; } return Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST) - .contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); + .contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 8b215e3d36..af8651dc6b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -76,13 +76,13 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { }; private static final List BWModNames = Arrays - .asList(MainMod.NAME, BartWorksCrossmod.NAME, MaterialsInjector.NAME); + .asList(MainMod.NAME, BartWorksCrossmod.NAME, MaterialsInjector.NAME); private static final HashSet idHashSet = new HashSet<>(); private static final Werkstoff.Stats DEFAULT_NULL_STATS = new Werkstoff.Stats(); private static final Werkstoff.GenerationFeatures DEFAULT_NULL_GENERATION_FEATURES = new Werkstoff.GenerationFeatures() - .disable(); + .disable(); public static Werkstoff default_null_Werkstoff; private final HashSet ADDITIONAL_OREDICT = new HashSet<>(); @@ -111,14 +111,14 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static void init() { Werkstoff.default_null_Werkstoff = new Werkstoff( - new short[3], - "_NULL", - "Default null Werkstoff", - Werkstoff.DEFAULT_NULL_STATS, - Werkstoff.Types.UNDEFINED, - Werkstoff.DEFAULT_NULL_GENERATION_FEATURES, - -1, - TextureSet.SET_NONE); + new short[3], + "_NULL", + "Default null Werkstoff", + Werkstoff.DEFAULT_NULL_STATS, + Werkstoff.Types.UNDEFINED, + Werkstoff.DEFAULT_NULL_GENERATION_FEATURES, + -1, + TextureSet.SET_NONE); } /** @@ -131,15 +131,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { */ public Werkstoff(Materials materials, Werkstoff.GenerationFeatures generationFeatures, Types type, int mID) { this( - materials.mRGBa, - materials.mDefaultLocalName, - materials.getToolTip(), - type == null ? materials.mElement != null ? Types.ELEMENT : Types.UNDEFINED : type, - generationFeatures, - mID, - materials.mIconSet, - (List) materials.mOreByProducts, - new Pair<>(materials, 1)); + materials.mRGBa, + materials.mDefaultLocalName, + materials.getToolTip(), + type == null ? materials.mElement != null ? Types.ELEMENT : Types.UNDEFINED : type, + generationFeatures, + mID, + materials.mIconSet, + (List) materials.mOreByProducts, + new Pair<>(materials, 1)); if (mID <= 31_766 || mID > 32_767) throw new IllegalArgumentException(); this.stats.mass = materials.getMass(); this.stats.protons = materials.getProtons(); @@ -163,87 +163,89 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @SafeVarargs public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint, - Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, - Pair... contents) { + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, + Pair... contents) { this( - rgba, - defaultName, - Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), - type, - generationFeatures, - mID, - texSet, - contents); + rgba, + defaultName, + Werkstoff.Types.getDefaultStatForType(type) + .setMeltingPoint(meltingpoint), + type, + generationFeatures, + mID, + texSet, + contents); } @SafeVarargs public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, - Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, - Pair... contents) { + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, + Pair... contents) { this( - rgba, - defaultName, - Werkstoff.Types.getDefaultStatForType(type), - type, - generationFeatures, - mID, - texSet, - contents); + rgba, + defaultName, + Werkstoff.Types.getDefaultStatForType(type), + type, + generationFeatures, + mID, + texSet, + contents); } @SafeVarargs public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint, - Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, - List oreByProduct, Pair... contents) { + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, + List oreByProduct, Pair... contents) { this( - rgba, - defaultName, - Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), - type, - generationFeatures, - mID, - texSet, - oreByProduct, - contents); + rgba, + defaultName, + Werkstoff.Types.getDefaultStatForType(type) + .setMeltingPoint(meltingpoint), + type, + generationFeatures, + mID, + texSet, + oreByProduct, + contents); } @SafeVarargs public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, - Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, - List oreByProduct, Pair... contents) { + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, + List oreByProduct, Pair... contents) { this( - rgba, - defaultName, - Werkstoff.Types.getDefaultStatForType(type), - type, - generationFeatures, - mID, - texSet, - oreByProduct, - contents); + rgba, + defaultName, + Werkstoff.Types.getDefaultStatForType(type), + type, + generationFeatures, + mID, + texSet, + oreByProduct, + contents); } @SafeVarargs public Werkstoff(short[] rgba, String toolTip, String defaultName, Werkstoff.Types type, - Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, - List oreByProduct, Pair... contents) { + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, + List oreByProduct, Pair... contents) { this( - rgba, - toolTip, - defaultName, - Werkstoff.Types.getDefaultStatForType(type), - type, - generationFeatures, - mID, - texSet, - oreByProduct, - contents); + rgba, + toolTip, + defaultName, + Werkstoff.Types.getDefaultStatForType(type), + type, + generationFeatures, + mID, + texSet, + oreByProduct, + contents); } @SafeVarargs public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, - Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, - List oreByProduct, Pair... contents) { + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, + List oreByProduct, Pair... contents) { this(rgba, defaultName, "", stats, type, generationFeatures, mID, texSet, contents); this.mOreByProducts.clear(); this.mOreByProducts.addAll(oreByProduct); @@ -251,15 +253,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @SafeVarargs public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, - Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, - Pair... contents) { + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, + Pair... contents) { this(rgba, defaultName, "", stats, type, generationFeatures, mID, texSet, contents); } @SafeVarargs public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, - Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, - List oreByProduct, Pair... contents) { + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, + List oreByProduct, Pair... contents) { this(rgba, defaultName, toolTip, stats, type, generationFeatures, mID, texSet, contents); this.mOreByProducts.clear(); this.mOreByProducts.addAll(oreByProduct); @@ -267,8 +269,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @SafeVarargs public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, - Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, - Pair... contents) { + Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, + Pair... contents) { if (Werkstoff.idHashSet.contains((short) mID)) throw new UnsupportedOperationException("ID (" + mID + ") is already in use!"); @@ -291,24 +293,24 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (p.getKey() instanceof Materials) { if (((Materials) p.getKey()).mMaterialList.size() > 1 && p.getValue() > 1) this.toolTip += "(" + getFormula((Materials) p.getKey()) - + ")" - + BW_Util.subscriptNumber(p.getValue()); + + ")" + + BW_Util.subscriptNumber(p.getValue()); else this.toolTip += getFormula((Materials) p.getKey()) - + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } if (p.getKey() instanceof Werkstoff) { if (((Werkstoff) p.getKey()).CONTENTS.size() > 1 && p.getValue() > 1) this.toolTip += "(" + getFormula((Werkstoff) p.getKey()) - + ")" - + BW_Util.subscriptNumber(p.getValue()); + + ")" + + BW_Util.subscriptNumber(p.getValue()); else this.toolTip += getFormula((Werkstoff) p.getKey()) - + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } } else if (p.getKey() instanceof Materials) { this.toolTip += getFormula((Materials) p.getKey()) - + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); - } else if (p.getKey() instanceof Werkstoff) this.toolTip += getFormula((Werkstoff) p.getKey()) + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + } else if (p.getKey() instanceof Werkstoff) this.toolTip += getFormula((Werkstoff) p.getKey()) + + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } } else this.toolTip = toolTip; @@ -366,10 +368,13 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } Optional> firstContent; - if (this.CONTENTS.size() == 1 && (firstContent = this.CONTENTS.stream().findFirst()).isPresent()) { - ISubTagContainer firstContentSubTagContainer = firstContent.get().getKey(); - if (firstContent.get().getValue() == 1 && firstContentSubTagContainer instanceof Materials) - this.getGenerationFeatures().setExtension(); + if (this.CONTENTS.size() == 1 && (firstContent = this.CONTENTS.stream() + .findFirst()).isPresent()) { + ISubTagContainer firstContentSubTagContainer = firstContent.get() + .getKey(); + if (firstContent.get() + .getValue() == 1 && firstContentSubTagContainer instanceof Materials) this.getGenerationFeatures() + .setExtension(); } Werkstoff.werkstoffHashSet.add(this); @@ -405,13 +410,13 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (this.stats.mTC_Aspects == null) { HashSet tc_aspectStacks = new HashSet<>(); HashSet> set = new HashSet<>(); - for (Pair p : this.getContents().getValue()) { + for (Pair p : this.getContents() + .getValue()) { if (p.getKey() instanceof Materials) tc_aspectStacks.addAll(((Materials) p.getKey()).mAspects); if (p.getKey() instanceof Werkstoff) set.addAll(Arrays.asList(((Werkstoff) p.getKey()).getTCAspects())); } tc_aspectStacks.forEach( - tc_aspectStack -> set - .add(new Pair<>(tc_aspectStack.mAspect.mAspect, (int) tc_aspectStack.mAmount))); + tc_aspectStack -> set.add(new Pair<>(tc_aspectStack.mAspect.mAspect, (int) tc_aspectStack.mAmount))); this.stats.mTC_Aspects = set.toArray(new Pair[0]); } Pair[] ret = this.stats.mTC_Aspects.clone(); @@ -423,15 +428,16 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public List getGTWrappedTCAspects() { final List ret = new ArrayList<>(); - Arrays.stream(this.getTCAspects()).forEach(objectIntegerPair -> { - try { - new TC_Aspects.TC_AspectStack( + Arrays.stream(this.getTCAspects()) + .forEach(objectIntegerPair -> { + try { + new TC_Aspects.TC_AspectStack( TC_Aspects.valueOf( - ((String) ThaumcraftHandler.AspectAdder.getName.invoke(objectIntegerPair.getKey())) - .toUpperCase(Locale.US)), + ((String) ThaumcraftHandler.AspectAdder.getName.invoke(objectIntegerPair.getKey())) + .toUpperCase(Locale.US)), objectIntegerPair.getValue()).addToAspectList(ret); - } catch (IllegalAccessException | InvocationTargetException ignored) {} - }); + } catch (IllegalAccessException | InvocationTargetException ignored) {} + }); return ret; } @@ -445,7 +451,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public boolean containsStuff(ISubTagContainer stuff) { for (Pair pair : this.CONTENTS) { - if (pair.getKey().equals(stuff)) return true; + if (pair.getKey() + .equals(stuff)) return true; } return false; } @@ -499,9 +506,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public String getLocalizedName() { return GT_LanguageManager.addStringLocalization( - String.format("bw.werkstoff.%05d.name", this.mID), - this.defaultName, - !GregTech_API.sPostloadFinished); + String.format("bw.werkstoff.%05d.name", this.mID), + this.defaultName, + !GregTech_API.sPostloadFinished); } public String getVarName() { @@ -514,9 +521,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public String getLocalizedToolTip() { return GT_LanguageManager.addStringLocalization( - String.format("bw.werkstoff.%05d.tooltip", this.mID), - this.toolTip, - !GregTech_API.sPostloadFinished); + String.format("bw.werkstoff.%05d.tooltip", this.mID), + this.toolTip, + !GregTech_API.sPostloadFinished); } public Werkstoff.Stats getStats() { @@ -551,8 +558,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @Override public boolean contains(SubTag subTag) { if (!subTag.equals(WerkstoffLoader.NOBLE_GAS) && !subTag.equals(WerkstoffLoader.ANAEROBE_GAS) - && !subTag.equals(WerkstoffLoader.NO_BLAST)) - for (Pair p : this.CONTENTS) if (p.getKey().contains(subTag)) return true; + && !subTag.equals(WerkstoffLoader.NO_BLAST)) + for (Pair p : this.CONTENTS) if (p.getKey() + .contains(subTag)) return true; return this.SUBTAGS.contains(subTag); } @@ -589,27 +597,39 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public byte getToolQuality() { return this.stats.getQualityOverride() > 0 ? this.stats.getQualityOverride() - : (byte) (15f * (this.getStats().getProtons() / 188f + this.getStats().getMeltingPoint() / 10801f) - / (float) this.getContents().getKey()); + : (byte) (15f * (this.getStats() + .getProtons() / 188f + + this.getStats() + .getMeltingPoint() / 10801f) + / (float) this.getContents() + .getKey()); } public float getToolSpeed() { return this.stats.getSpeedOverride() > 0f ? this.stats.getSpeedOverride() - : Math.max( - 1f, - 2f * (-this.getStats().getMass() + 0.1f * this.getStats().getMeltingPoint() - + this.getStats().getProtons()) - * 0.1f - / (float) this.getContents().getKey() - * 0.1f - * this.getToolQuality()); + : Math.max( + 1f, + 2f * (-this.getStats() + .getMass() + 0.1f + * this.getStats() + .getMeltingPoint() + + this.getStats() + .getProtons()) + * 0.1f + / (float) this.getContents() + .getKey() + * 0.1f + * this.getToolQuality()); } public int getDurability() { return this.stats.getDurOverride() > 0 ? this.stats.getDurOverride() - : (int) (this.stats.durMod * (0.01f * this.getStats().getMeltingPoint() - * this.getStats().getMass() - / (float) this.getContents().getKey())); + : (int) (this.stats.durMod * (0.01f * this.getStats() + .getMeltingPoint() + * this.getStats() + .getMass() + / (float) this.getContents() + .getKey())); } /** @@ -618,7 +638,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public boolean hasItemType(OrePrefixes prefixes) { int unpacked = Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes); return (this.getGenerationFeatures().toGenerate & unpacked) != 0 - && (this.getGenerationFeatures().blacklist & unpacked) == 0; + && (this.getGenerationFeatures().blacklist & unpacked) == 0; } /** @@ -641,7 +661,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } private String getMaterialOwner() { - String modName = Loader.instance().activeModContainer().getName(); + String modName = Loader.instance() + .activeModContainer() + .getName(); if (modNameOverrides.get(modName) != null) { return modNameOverrides.get(modName); } @@ -686,7 +708,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public GenerationFeatures() {} public static void initPrefixLogic() { - Arrays.stream(OrePrefixes.values()).forEach(e -> prefixLogic.put(e, 0)); + Arrays.stream(OrePrefixes.values()) + .forEach(e -> prefixLogic.put(e, 0)); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dust, 0b1); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustTiny, 0b1); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustSmall, 0b1); @@ -1103,28 +1126,33 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (!(o instanceof Werkstoff.Stats that)) return false; if (this.boilingPoint != that.boilingPoint || this.meltingPoint != that.meltingPoint - || this.mass != that.mass - || this.protons != that.protons) - return false; + || this.mass != that.mass + || this.protons != that.protons) return false; if (this.neutrons != that.neutrons) return false; if (this.electrons != that.electrons) return false; if (Math.abs(this.ebfGasRecipeTimeMultiplier - that.ebfGasRecipeTimeMultiplier) > 1.0e-6D) return false; if (Math.abs(this.ebfGasRecipeConsumedAmountMultiplier - that.ebfGasRecipeConsumedAmountMultiplier) - > 1.0e-6D) - return false; + > 1.0e-6D) return false; return this.quality == that.quality; } @Override public int hashCode() { return MurmurHash3.murmurhash3_x86_32( - ByteBuffer.allocate(49).put(this.quality).putInt(this.boilingPoint).putInt(this.meltingPoint) - .putLong(this.protons).putLong(this.neutrons).putLong(this.electrons).putLong(this.mass) - .putDouble(this.ebfGasRecipeTimeMultiplier) - .putDouble(this.ebfGasRecipeConsumedAmountMultiplier).array(), - 0, - 49, - 31); + ByteBuffer.allocate(49) + .put(this.quality) + .putInt(this.boilingPoint) + .putInt(this.meltingPoint) + .putLong(this.protons) + .putLong(this.neutrons) + .putLong(this.electrons) + .putLong(this.mass) + .putDouble(this.ebfGasRecipeTimeMultiplier) + .putDouble(this.ebfGasRecipeConsumedAmountMultiplier) + .array(), + 0, + 49, + 31); } public Werkstoff.Stats setMass(long mass) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 338b18eff1..197ada7f22 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -187,1228 +187,1396 @@ public class WerkstoffLoader { // Tec & basdxz reserved range 30_000-31_000 // GT Material range reserved on 31_767-32_767 public static final Werkstoff Bismutite = new Werkstoff( - new short[] { 255, 233, 0, 0 }, - "Bismutite", - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().addGems(), - 1, - TextureSet.SET_FLINT, - Collections.singletonList(Materials.Bismuth), - new Pair<>(Materials.Bismuth, 2), - new Pair<>(Materials.Oxygen, 2), - new Pair<>(Materials.CarbonDioxide, 2)); + new short[] { 255, 233, 0, 0 }, + "Bismutite", + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 1, + TextureSet.SET_FLINT, + Collections.singletonList(Materials.Bismuth), + new Pair<>(Materials.Bismuth, 2), + new Pair<>(Materials.Oxygen, 2), + new Pair<>(Materials.CarbonDioxide, 2)); public static final Werkstoff Bismuthinit = new Werkstoff( - new short[] { 192, 192, 192, 0 }, - "Bismuthinite", - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), - 2, - TextureSet.SET_METALLIC, - Arrays.asList(Materials.Bismuth, Materials.Sulfur), - new Pair<>(Materials.Bismuth, 2), - new Pair<>(Materials.Sulfur, 3)); + new short[] { 192, 192, 192, 0 }, + "Bismuthinite", + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 2, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Bismuth, Materials.Sulfur), + new Pair<>(Materials.Bismuth, 2), + new Pair<>(Materials.Sulfur, 3)); public static final Werkstoff Zirconium = new Werkstoff( - new short[] { 175, 175, 175, 0 }, - "Zirconium", - "Zr", - new Werkstoff.Stats().setProtons(40).setBlastFurnace(true).setMeltingPoint(2130).setMeltingVoltage(480), - Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().enforceUnification(), - 3, - TextureSet.SET_METALLIC + new short[] { 175, 175, 175, 0 }, + "Zirconium", + "Zr", + new Werkstoff.Stats().setProtons(40) + .setBlastFurnace(true) + .setMeltingPoint(2130) + .setMeltingVoltage(480), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addMetalItems() + .enforceUnification(), + 3, + TextureSet.SET_METALLIC // No Byproducts ); public static final Werkstoff CubicZirconia = new Werkstoff( - new short[] { 255, 255, 255, 0 }, - "Cubic Zirconia", - Werkstoff.Types.COMPOUND, - 3273, - new Werkstoff.GenerationFeatures().onlyDust().addGems().enforceUnification(), - 4, - TextureSet.SET_DIAMOND, - Collections.singletonList(WerkstoffLoader.Zirconium), - new Pair<>(WerkstoffLoader.Zirconium, 1), - new Pair<>(Materials.Oxygen, 2)); + new short[] { 255, 255, 255, 0 }, + "Cubic Zirconia", + Werkstoff.Types.COMPOUND, + 3273, + new Werkstoff.GenerationFeatures().onlyDust() + .addGems() + .enforceUnification(), + 4, + TextureSet.SET_DIAMOND, + Collections.singletonList(WerkstoffLoader.Zirconium), + new Pair<>(WerkstoffLoader.Zirconium, 1), + new Pair<>(Materials.Oxygen, 2)); public static final Werkstoff FluorBuergerit = new Werkstoff( - new short[] { 0x20, 0x20, 0x20, 0 }, - "Fluor-Buergerite", - subscriptNumbers("NaFe3Al6(Si6O18)(BO3)3O3F"), - new Werkstoff.Stats().setElektrolysis(false), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().addGems(), - 5, - TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), - new Pair<>(Materials.Sodium, 1), - new Pair<>(Materials.Iron, 3), - new Pair<>(Materials.Aluminium, 6), - new Pair<>(Materials.Silicon, 6), - new Pair<>(Materials.Boron, 3), - new Pair<>(Materials.Oxygen, 30), - new Pair<>(Materials.Fluorine, 1)); + new short[] { 0x20, 0x20, 0x20, 0 }, + "Fluor-Buergerite", + subscriptNumbers("NaFe3Al6(Si6O18)(BO3)3O3F"), + new Werkstoff.Stats().setElektrolysis(false), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 5, + TextureSet.SET_RUBY, + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), + new Pair<>(Materials.Sodium, 1), + new Pair<>(Materials.Iron, 3), + new Pair<>(Materials.Aluminium, 6), + new Pair<>(Materials.Silicon, 6), + new Pair<>(Materials.Boron, 3), + new Pair<>(Materials.Oxygen, 30), + new Pair<>(Materials.Fluorine, 1)); public static final Werkstoff YttriumOxide = new Werkstoff( - new short[] { 255, 255, 255, 0 }, - "Yttrium Oxide", - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().onlyDust().enforceUnification(), // No autoadd here to gate this material - // by hand - 6, - TextureSet.SET_DULL, - new Pair<>(Materials.Yttrium, 2), - new Pair<>(Materials.Oxygen, 3)); + new short[] { 255, 255, 255, 0 }, + "Yttrium Oxide", + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().onlyDust() + .enforceUnification(), // No autoadd here to gate this material + // by hand + 6, + TextureSet.SET_DULL, + new Pair<>(Materials.Yttrium, 2), + new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff ChromoAluminoPovondrait = new Werkstoff( - new short[] { 0, 0x79, 0x6A, 0 }, - "Chromo-Alumino-Povondraite", - subscriptNumbers("NaCr3(Al4Mg2)(Si6O18)(BO3)3(OH)3O"), - Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND).setElektrolysis(false), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().addGems(), - 7, - TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), - new Pair<>(Materials.Sodium, 1), - new Pair<>(Materials.Chrome, 3), - new Pair<>(Materials.Magnalium, 6), - new Pair<>(Materials.Silicon, 6), - new Pair<>(Materials.Boron, 3), - new Pair<>(Materials.Oxygen, 31), - new Pair<>(Materials.Hydrogen, 3)); + new short[] { 0, 0x79, 0x6A, 0 }, + "Chromo-Alumino-Povondraite", + subscriptNumbers("NaCr3(Al4Mg2)(Si6O18)(BO3)3(OH)3O"), + Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND) + .setElektrolysis(false), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 7, + TextureSet.SET_RUBY, + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), + new Pair<>(Materials.Sodium, 1), + new Pair<>(Materials.Chrome, 3), + new Pair<>(Materials.Magnalium, 6), + new Pair<>(Materials.Silicon, 6), + new Pair<>(Materials.Boron, 3), + new Pair<>(Materials.Oxygen, 31), + new Pair<>(Materials.Hydrogen, 3)); public static final Werkstoff VanadioOxyDravit = new Werkstoff( - new short[] { 0x60, 0xA0, 0xA0, 0 }, - "Vanadio-Oxy-Dravite", - subscriptNumbers("NaV3(Al4Mg2)(Si6O18)(BO3)3(OH)3O"), - Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND).setElektrolysis(false), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().addGems(), - 8, - TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), - new Pair<>(Materials.Sodium, 1), - new Pair<>(Materials.Vanadium, 3), - new Pair<>(Materials.Magnalium, 6), - new Pair<>(Materials.Silicon, 6), - new Pair<>(Materials.Boron, 3), - new Pair<>(Materials.Oxygen, 31), - new Pair<>(Materials.Hydrogen, 3)); + new short[] { 0x60, 0xA0, 0xA0, 0 }, + "Vanadio-Oxy-Dravite", + subscriptNumbers("NaV3(Al4Mg2)(Si6O18)(BO3)3(OH)3O"), + Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND) + .setElektrolysis(false), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 8, + TextureSet.SET_RUBY, + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), + new Pair<>(Materials.Sodium, 1), + new Pair<>(Materials.Vanadium, 3), + new Pair<>(Materials.Magnalium, 6), + new Pair<>(Materials.Silicon, 6), + new Pair<>(Materials.Boron, 3), + new Pair<>(Materials.Oxygen, 31), + new Pair<>(Materials.Hydrogen, 3)); public static final Werkstoff Olenit = new Werkstoff( - new short[] { 210, 210, 210, 0 }, - "Olenite", - subscriptNumbers("NaAl3Al6(Si6O18)(BO3)3O3OH"), - Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND).setElektrolysis(false), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().addGems(), - 9, - TextureSet.SET_RUBY, - Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), - new Pair<>(Materials.Sodium, 1), - new Pair<>(Materials.Aluminium, 9), - new Pair<>(Materials.Silicon, 6), - new Pair<>(Materials.Boron, 3), - new Pair<>(Materials.Oxygen, 31), - new Pair<>(Materials.Hydrogen, 1)); + new short[] { 210, 210, 210, 0 }, + "Olenite", + subscriptNumbers("NaAl3Al6(Si6O18)(BO3)3O3OH"), + Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND) + .setElektrolysis(false), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 9, + TextureSet.SET_RUBY, + Arrays.asList(Materials.Sodium, Materials.Boron, Materials.SiliconDioxide), + new Pair<>(Materials.Sodium, 1), + new Pair<>(Materials.Aluminium, 9), + new Pair<>(Materials.Silicon, 6), + new Pair<>(Materials.Boron, 3), + new Pair<>(Materials.Oxygen, 31), + new Pair<>(Materials.Hydrogen, 1)); public static final Werkstoff Arsenopyrite = new Werkstoff( - new short[] { 0xB0, 0xB0, 0xB0, 0 }, - "Arsenopyrite", - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), - 10, - TextureSet.SET_METALLIC, - Arrays.asList(Materials.Sulfur, Materials.Arsenic, Materials.Iron), - new Pair<>(Materials.Iron, 1), - new Pair<>(Materials.Arsenic, 1), - new Pair<>(Materials.Sulfur, 1)); + new short[] { 0xB0, 0xB0, 0xB0, 0 }, + "Arsenopyrite", + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 10, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Sulfur, Materials.Arsenic, Materials.Iron), + new Pair<>(Materials.Iron, 1), + new Pair<>(Materials.Arsenic, 1), + new Pair<>(Materials.Sulfur, 1)); public static final Werkstoff Ferberite = new Werkstoff( - new short[] { 0xB0, 0xB0, 0xB0, 0 }, - "Ferberite", - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), - 11, - TextureSet.SET_METALLIC, - Arrays.asList(Materials.Iron, Materials.Tungsten), - new Pair<>(Materials.Iron, 1), - new Pair<>(Materials.Tungsten, 1), - new Pair<>(Materials.Oxygen, 3)); + new short[] { 0xB0, 0xB0, 0xB0, 0 }, + "Ferberite", + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 11, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Iron, Materials.Tungsten), + new Pair<>(Materials.Iron, 1), + new Pair<>(Materials.Tungsten, 1), + new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff Loellingit = new Werkstoff( - new short[] { 0xD0, 0xD0, 0xD0, 0 }, - "Loellingite", - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), - 12, - TextureSet.SET_METALLIC, - Arrays.asList(Materials.Iron, Materials.Arsenic), - new Pair<>(Materials.Iron, 1), - new Pair<>(Materials.Arsenic, 2)); + new short[] { 0xD0, 0xD0, 0xD0, 0 }, + "Loellingite", + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 12, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Iron, Materials.Arsenic), + new Pair<>(Materials.Iron, 1), + new Pair<>(Materials.Arsenic, 2)); public static final Werkstoff Roquesit = new Werkstoff( - new short[] { 0xA0, 0xA0, 0xA0, 0 }, - "Roquesite", - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), - 13, - TextureSet.SET_METALLIC, - Arrays.asList(Materials.Copper, Materials.Sulfur), - new Pair<>(Materials.Copper, 1), - new Pair<>(Materials.Indium, 1), - new Pair<>(Materials.Sulfur, 2)); + new short[] { 0xA0, 0xA0, 0xA0, 0 }, + "Roquesite", + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 13, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Copper, Materials.Sulfur), + new Pair<>(Materials.Copper, 1), + new Pair<>(Materials.Indium, 1), + new Pair<>(Materials.Sulfur, 2)); public static final Werkstoff Bornite = new Werkstoff( - new short[] { 0x97, 0x66, 0x2B, 0 }, - "Bornite", - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), - 14, - TextureSet.SET_METALLIC, - Arrays.asList(Materials.Copper, Materials.Iron, Materials.Sulfur), - new Pair<>(Materials.Copper, 5), - new Pair<>(Materials.Iron, 1), - new Pair<>(Materials.Sulfur, 4)); + new short[] { 0x97, 0x66, 0x2B, 0 }, + "Bornite", + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 14, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Copper, Materials.Iron, Materials.Sulfur), + new Pair<>(Materials.Copper, 5), + new Pair<>(Materials.Iron, 1), + new Pair<>(Materials.Sulfur, 4)); public static final Werkstoff Wittichenit = new Werkstoff( - Materials.Copper.mRGBa, - "Wittichenite", - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), - 15, - TextureSet.SET_METALLIC, - Arrays.asList(Materials.Copper, Materials.Bismuth, Materials.Sulfur), - new Pair<>(Materials.Copper, 5), - new Pair<>(Materials.Bismuth, 1), - new Pair<>(Materials.Sulfur, 4)); + Materials.Copper.mRGBa, + "Wittichenite", + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 15, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Copper, Materials.Bismuth, Materials.Sulfur), + new Pair<>(Materials.Copper, 5), + new Pair<>(Materials.Bismuth, 1), + new Pair<>(Materials.Sulfur, 4)); public static final Werkstoff Djurleit = new Werkstoff( - new short[] { 0x60, 0x60, 0x60, 0 }, - "Djurleite", - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), - 16, - TextureSet.SET_METALLIC, - Arrays.asList(Materials.Copper, Materials.Copper, Materials.Sulfur), - new Pair<>(Materials.Copper, 31), - new Pair<>(Materials.Sulfur, 16)); + new short[] { 0x60, 0x60, 0x60, 0 }, + "Djurleite", + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 16, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Copper, Materials.Copper, Materials.Sulfur), + new Pair<>(Materials.Copper, 31), + new Pair<>(Materials.Sulfur, 16)); public static final Werkstoff Huebnerit = new Werkstoff( - new short[] { 0x80, 0x60, 0x60, 0 }, - "Huebnerite", - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), - 17, - TextureSet.SET_METALLIC, - Arrays.asList(Materials.Manganese, Materials.Tungsten), - new Pair<>(Materials.Manganese, 1), - new Pair<>(Materials.Tungsten, 1), - new Pair<>(Materials.Oxygen, 3)); + new short[] { 0x80, 0x60, 0x60, 0 }, + "Huebnerite", + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 17, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Manganese, Materials.Tungsten), + new Pair<>(Materials.Manganese, 1), + new Pair<>(Materials.Tungsten, 1), + new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff Thorianit = new Werkstoff( - new short[] { 0x30, 0x30, 0x30, 0 }, - "Thorianite", - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), - 18, - TextureSet.SET_METALLIC, - Collections.singletonList(Materials.Thorium), - new Pair<>(Materials.Thorium, 1), - new Pair<>(Materials.Oxygen, 2)); + new short[] { 0x30, 0x30, 0x30, 0 }, + "Thorianite", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 18, + TextureSet.SET_METALLIC, + Collections.singletonList(Materials.Thorium), + new Pair<>(Materials.Thorium, 1), + new Pair<>(Materials.Oxygen, 2)); public static final Werkstoff RedZircon = new Werkstoff( - new short[] { 195, 19, 19, 0 }, - "Red Zircon", - new Werkstoff.Stats().setElektrolysis(false).setMeltingPoint(2130), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().addGems(), - 19, - TextureSet.SET_GEM_VERTICAL, - Arrays.asList(WerkstoffLoader.Zirconium, Materials.SiliconDioxide), - new Pair<>(WerkstoffLoader.Zirconium, 1), - new Pair<>(Materials.Silicon, 1), - new Pair<>(Materials.Oxygen, 4)); + new short[] { 195, 19, 19, 0 }, + "Red Zircon", + new Werkstoff.Stats().setElektrolysis(false) + .setMeltingPoint(2130), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 19, + TextureSet.SET_GEM_VERTICAL, + Arrays.asList(WerkstoffLoader.Zirconium, Materials.SiliconDioxide), + new Pair<>(WerkstoffLoader.Zirconium, 1), + new Pair<>(Materials.Silicon, 1), + new Pair<>(Materials.Oxygen, 4)); // GT Enhancements public static final Werkstoff Salt = new Werkstoff( - Materials.Salt.mRGBa, - "Salt", - new Werkstoff.Stats(), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().addGems().addSifterRecipes(), - 20, - TextureSet.SET_FLINT, - Arrays.asList(Materials.RockSalt, Materials.Borax), - new Pair<>(Materials.Salt, 1)); + Materials.Salt.mRGBa, + "Salt", + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .addGems() + .addSifterRecipes(), + 20, + TextureSet.SET_FLINT, + Arrays.asList(Materials.RockSalt, Materials.Borax), + new Pair<>(Materials.Salt, 1)); public static final Werkstoff Spodumen = new Werkstoff( - Materials.Spodumene.mRGBa, - "Spodumene", - new Werkstoff.Stats(), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().addGems().addSifterRecipes(), - 21, - TextureSet.SET_FLINT, - Collections.singletonList(Materials.Spodumene), - new Pair<>(Materials.Spodumene, 1)); + Materials.Spodumene.mRGBa, + "Spodumene", + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .addGems() + .addSifterRecipes(), + 21, + TextureSet.SET_FLINT, + Collections.singletonList(Materials.Spodumene), + new Pair<>(Materials.Spodumene, 1)); public static final Werkstoff RockSalt = new Werkstoff( - Materials.RockSalt.mRGBa, - "Rock Salt", - new Werkstoff.Stats(), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().addGems().addSifterRecipes(), - 22, - TextureSet.SET_FLINT, - Arrays.asList(Materials.RockSalt, Materials.Borax), - new Pair<>(Materials.RockSalt, 1)); + Materials.RockSalt.mRGBa, + "Rock Salt", + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .addGems() + .addSifterRecipes(), + 22, + TextureSet.SET_FLINT, + Arrays.asList(Materials.RockSalt, Materials.Borax), + new Pair<>(Materials.RockSalt, 1)); // More NonGT Stuff public static final Werkstoff Fayalit = new Werkstoff( - new short[] { 50, 50, 50, 0 }, - "Fayalite", - new Werkstoff.Stats().setElektrolysis(false), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().addGems(), - 23, - TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Iron, Materials.SiliconDioxide), - new Pair<>(Materials.Iron, 2), - new Pair<>(Materials.Silicon, 1), - new Pair<>(Materials.Oxygen, 4)); + new short[] { 50, 50, 50, 0 }, + "Fayalite", + new Werkstoff.Stats().setElektrolysis(false), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 23, + TextureSet.SET_QUARTZ, + Arrays.asList(Materials.Iron, Materials.SiliconDioxide), + new Pair<>(Materials.Iron, 2), + new Pair<>(Materials.Silicon, 1), + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff Forsterit = new Werkstoff( - new short[] { 255, 255, 255, 0 }, - "Forsterite", - new Werkstoff.Stats().setElektrolysis(false), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().addGems(), - 24, - TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Magnesium, Materials.SiliconDioxide), - new Pair<>(Materials.Magnesium, 2), - new Pair<>(Materials.Silicon, 1), - new Pair<>(Materials.Oxygen, 4)); + new short[] { 255, 255, 255, 0 }, + "Forsterite", + new Werkstoff.Stats().setElektrolysis(false), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 24, + TextureSet.SET_QUARTZ, + Arrays.asList(Materials.Magnesium, Materials.SiliconDioxide), + new Pair<>(Materials.Magnesium, 2), + new Pair<>(Materials.Silicon, 1), + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff Hedenbergit = new Werkstoff( - new short[] { 100, 150, 100, 0 }, - "Hedenbergite", - new Werkstoff.Stats().setElektrolysis(false), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().addGems(), - 25, - TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Iron, Materials.Calcium, Materials.SiliconDioxide), - new Pair<>(Materials.Calcium, 1), - new Pair<>(Materials.Iron, 1), - new Pair<>(Materials.Silicon, 2), - new Pair<>(Materials.Oxygen, 6)); + new short[] { 100, 150, 100, 0 }, + "Hedenbergite", + new Werkstoff.Stats().setElektrolysis(false), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 25, + TextureSet.SET_QUARTZ, + Arrays.asList(Materials.Iron, Materials.Calcium, Materials.SiliconDioxide), + new Pair<>(Materials.Calcium, 1), + new Pair<>(Materials.Iron, 1), + new Pair<>(Materials.Silicon, 2), + new Pair<>(Materials.Oxygen, 6)); public static final Werkstoff DescloiziteZNVO4 = new Werkstoff( - new short[] { 0xBF, 0x18, 0x0F, 0 }, - "Red Descloizite", // Pb(Zn,Cu)[OH|VO4 - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), - 26, - TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Lead, Materials.Copper, Materials.Vanadium), - new Pair<>(Materials.Lead, 1), - new Pair<>(Materials.Zinc, 1), - new Pair<>(Materials.Vanadium, 1), - new Pair<>(Materials.Oxygen, 4)); + new short[] { 0xBF, 0x18, 0x0F, 0 }, + "Red Descloizite", // Pb(Zn,Cu)[OH|VO4 + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 26, + TextureSet.SET_QUARTZ, + Arrays.asList(Materials.Lead, Materials.Copper, Materials.Vanadium), + new Pair<>(Materials.Lead, 1), + new Pair<>(Materials.Zinc, 1), + new Pair<>(Materials.Vanadium, 1), + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff DescloiziteCUVO4 = new Werkstoff( - new short[] { 0xf9, 0x6d, 0x18, 0 }, - "Orange Descloizite", // Pb(Zn,Cu)[OH|VO4 - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), - 27, - TextureSet.SET_QUARTZ, - Arrays.asList(Materials.Lead, Materials.Zinc, Materials.Vanadium), - new Pair<>(Materials.Lead, 1), - new Pair<>(Materials.Copper, 1), - new Pair<>(Materials.Vanadium, 1), - new Pair<>(Materials.Oxygen, 4)); + new short[] { 0xf9, 0x6d, 0x18, 0 }, + "Orange Descloizite", // Pb(Zn,Cu)[OH|VO4 + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 27, + TextureSet.SET_QUARTZ, + Arrays.asList(Materials.Lead, Materials.Zinc, Materials.Vanadium), + new Pair<>(Materials.Lead, 1), + new Pair<>(Materials.Copper, 1), + new Pair<>(Materials.Vanadium, 1), + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff FuchsitAL = new Werkstoff( - new short[] { 0x4D, 0x7F, 0x64, 0 }, - "Green Fuchsite", - subscriptNumbers("KAl3Si3O10(OH)2"), - new Werkstoff.Stats().setElektrolysis(false), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), - 28, - TextureSet.SET_METALLIC, - Arrays.asList(Materials.Potassium, Materials.Aluminiumoxide, Materials.SiliconDioxide), - new Pair<>(Materials.Potassium, 1), - new Pair<>(Materials.Aluminium, 3), - new Pair<>(Materials.Silicon, 3), - new Pair<>(Materials.Oxygen, 12), - new Pair<>(Materials.Hydrogen, 2)); + new short[] { 0x4D, 0x7F, 0x64, 0 }, + "Green Fuchsite", + subscriptNumbers("KAl3Si3O10(OH)2"), + new Werkstoff.Stats().setElektrolysis(false), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 28, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Potassium, Materials.Aluminiumoxide, Materials.SiliconDioxide), + new Pair<>(Materials.Potassium, 1), + new Pair<>(Materials.Aluminium, 3), + new Pair<>(Materials.Silicon, 3), + new Pair<>(Materials.Oxygen, 12), + new Pair<>(Materials.Hydrogen, 2)); public static final Werkstoff FuchsitCR = new Werkstoff( - new short[] { 128, 0, 0, 0 }, - "Red Fuchsite", - subscriptNumbers("KCr3Si3O10(OH)2"), - new Werkstoff.Stats().setElektrolysis(false), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), - 29, - TextureSet.SET_METALLIC, - Arrays.asList(Materials.Potassium, Materials.Chrome, Materials.SiliconDioxide), - new Pair<>(Materials.Potassium, 1), - new Pair<>(Materials.Chrome, 3), - new Pair<>(Materials.Silicon, 3), - new Pair<>(Materials.Oxygen, 12), - new Pair<>(Materials.Hydrogen, 2)); + new short[] { 128, 0, 0, 0 }, + "Red Fuchsite", + subscriptNumbers("KCr3Si3O10(OH)2"), + new Werkstoff.Stats().setElektrolysis(false), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 29, + TextureSet.SET_METALLIC, + Arrays.asList(Materials.Potassium, Materials.Chrome, Materials.SiliconDioxide), + new Pair<>(Materials.Potassium, 1), + new Pair<>(Materials.Chrome, 3), + new Pair<>(Materials.Silicon, 3), + new Pair<>(Materials.Oxygen, 12), + new Pair<>(Materials.Hydrogen, 2)); public static final Werkstoff Thorium232 = new Werkstoff( - new short[] { 0, 64, 0, 0 }, - "Thorium 232", - superscriptNumbers("Th232"), - new Werkstoff.Stats().setRadioactive(true).setBlastFurnace(true).setMass(232) - .setProtons(Element.Th.mProtons), - Werkstoff.Types.ISOTOPE, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().enforceUnification(), - 30, - TextureSet.SET_METALLIC + new short[] { 0, 64, 0, 0 }, + "Thorium 232", + superscriptNumbers("Th232"), + new Werkstoff.Stats().setRadioactive(true) + .setBlastFurnace(true) + .setMass(232) + .setProtons(Element.Th.mProtons), + Werkstoff.Types.ISOTOPE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addMetalItems() + .enforceUnification(), + 30, + TextureSet.SET_METALLIC // No Byproducts ); public static final Werkstoff BismuthTellurite = new Werkstoff( - new short[] { 32, 72, 32, 0 }, - // Telluride is correct, tellurite is not. - // Only the display name gets renamed to avoid problems in other mods - "Bismuth Telluride", - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), - 31, - TextureSet.SET_METALLIC, - // No Byproducts - new Pair<>(Materials.Bismuth, 2), - new Pair<>(Materials.Tellurium, 3)); + new short[] { 32, 72, 32, 0 }, + // Telluride is correct, tellurite is not. + // Only the display name gets renamed to avoid problems in other mods + "Bismuth Telluride", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addChemicalRecipes(), + 31, + TextureSet.SET_METALLIC, + // No Byproducts + new Pair<>(Materials.Bismuth, 2), + new Pair<>(Materials.Tellurium, 3)); public static final Werkstoff Tellurium = new Werkstoff( - new short[] { 0xff, 0xff, 0xff, 0 }, - "Tellurium", - new Werkstoff.Stats(), - Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().addMetalItems().removePrefix(ore), - 32, - TextureSet.SET_METALLIC, - // No Byproducts - new Pair<>(Materials.Tellurium, 1)); + new short[] { 0xff, 0xff, 0xff, 0 }, + "Tellurium", + new Werkstoff.Stats(), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().addMetalItems() + .removePrefix(ore), + 32, + TextureSet.SET_METALLIC, + // No Byproducts + new Pair<>(Materials.Tellurium, 1)); public static final Werkstoff BismuthHydroBorat = new Werkstoff( - new short[] { 72, 144, 72, 0 }, - "Dibismuthhydroborat", - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), - 33, - TextureSet.SET_METALLIC, - // No Byproducts - new Pair<>(Materials.Bismuth, 2), - new Pair<>(Materials.Boron, 1), - new Pair<>(Materials.Hydrogen, 1)); + new short[] { 72, 144, 72, 0 }, + "Dibismuthhydroborat", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addChemicalRecipes(), + 33, + TextureSet.SET_METALLIC, + // No Byproducts + new Pair<>(Materials.Bismuth, 2), + new Pair<>(Materials.Boron, 1), + new Pair<>(Materials.Hydrogen, 1)); public static final Werkstoff ArInGaPhoBiBoTe = new Werkstoff( - new short[] { 36, 36, 36, 0 }, - "Circuit Compound MK3", - new Werkstoff.Stats().setCentrifuge(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMixerRecipes(), - 34, - TextureSet.SET_METALLIC, - // No Byproducts - new Pair<>(Materials.IndiumGalliumPhosphide, 1), - new Pair<>(WerkstoffLoader.BismuthHydroBorat, 3), - new Pair<>(WerkstoffLoader.BismuthTellurite, 2)); + new short[] { 36, 36, 36, 0 }, + "Circuit Compound MK3", + new Werkstoff.Stats().setCentrifuge(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addMixerRecipes(), + 34, + TextureSet.SET_METALLIC, + // No Byproducts + new Pair<>(Materials.IndiumGalliumPhosphide, 1), + new Pair<>(WerkstoffLoader.BismuthHydroBorat, 3), + new Pair<>(WerkstoffLoader.BismuthTellurite, 2)); public static final Werkstoff Prasiolite = new Werkstoff( - new short[] { 0xD0, 0xDD, 0x95, 0 }, - "Prasiolite", - new Werkstoff.Stats().setElektrolysis(false).setMeltingPoint(1923), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().addGems(), - 35, - TextureSet.SET_QUARTZ, - // No Byproducts - new Pair<>(Materials.Silicon, 5), - new Pair<>(Materials.Oxygen, 10), - new Pair<>(Materials.Iron, 1)); + new short[] { 0xD0, 0xDD, 0x95, 0 }, + "Prasiolite", + new Werkstoff.Stats().setElektrolysis(false) + .setMeltingPoint(1923), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 35, + TextureSet.SET_QUARTZ, + // No Byproducts + new Pair<>(Materials.Silicon, 5), + new Pair<>(Materials.Oxygen, 10), + new Pair<>(Materials.Iron, 1)); public static final Werkstoff MagnetoResonaticDust = new Werkstoff( - new short[] { 0xDD, 0x77, 0xDD, 0 }, - "Magneto Resonatic", - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().onlyDust().addMixerRecipes().addGems(), - 36, - TextureSet.SET_MAGNETIC, - // No Byproducts - new Pair<>(WerkstoffLoader.Prasiolite, 3), - new Pair<>(WerkstoffLoader.BismuthTellurite, 4), - new Pair<>(WerkstoffLoader.CubicZirconia, 1), - new Pair<>(Materials.SteelMagnetic, 1)); + new short[] { 0xDD, 0x77, 0xDD, 0 }, + "Magneto Resonatic", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().onlyDust() + .addMixerRecipes() + .addGems(), + 36, + TextureSet.SET_MAGNETIC, + // No Byproducts + new Pair<>(WerkstoffLoader.Prasiolite, 3), + new Pair<>(WerkstoffLoader.BismuthTellurite, 4), + new Pair<>(WerkstoffLoader.CubicZirconia, 1), + new Pair<>(Materials.SteelMagnetic, 1)); public static final Werkstoff Xenon = new Werkstoff( - new short[] { 0x14, 0x39, 0x7F, 0 }, - "Xenon", - "Xe", - new Werkstoff.Stats().setProtons(54).setMass(131).setGas(true).setEbfGasRecipeTimeMultiplier(0.4d) - .setEbfGasRecipeConsumedAmountMultiplier(0.25d), - Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), - 37, - TextureSet.SET_FLUID + new short[] { 0x14, 0x39, 0x7F, 0 }, + "Xenon", + "Xe", + new Werkstoff.Stats().setProtons(54) + .setMass(131) + .setGas(true) + .setEbfGasRecipeTimeMultiplier(0.4d) + .setEbfGasRecipeConsumedAmountMultiplier(0.25d), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable() + .addCells() + .enforceUnification(), + 37, + TextureSet.SET_FLUID // No Byproducts // No Ingredients ); public static final Werkstoff Oganesson = new Werkstoff( - new short[] { 0x14, 0x39, 0x7F, 0 }, - "Oganesson", - "Og", - new Werkstoff.Stats().setProtons(118).setMass(294).setGas(true).setEbfGasRecipeTimeMultiplier(0.3d) - .setEbfGasRecipeConsumedAmountMultiplier(0.1d), - Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().disable().addCells(), - 38, - TextureSet.SET_FLUID + new short[] { 0x14, 0x39, 0x7F, 0 }, + "Oganesson", + "Og", + new Werkstoff.Stats().setProtons(118) + .setMass(294) + .setGas(true) + .setEbfGasRecipeTimeMultiplier(0.3d) + .setEbfGasRecipeConsumedAmountMultiplier(0.1d), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 38, + TextureSet.SET_FLUID // No Byproducts // No Ingredients ); public static final Werkstoff Californium = new Werkstoff( - new short[] { 0xAA, 0xAA, 0xAA, 0 }, - "Californium", - "Cf", - new Werkstoff.Stats().setProtons(98).setMass(251).setBlastFurnace(true).setMeltingPoint(900), - Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten().enforceUnification(), - 39, - TextureSet.SET_METALLIC + new short[] { 0xAA, 0xAA, 0xAA, 0 }, + "Californium", + "Cf", + new Werkstoff.Stats().setProtons(98) + .setMass(251) + .setBlastFurnace(true) + .setMeltingPoint(900), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addMetalItems() + .addMolten() + .enforceUnification(), + 39, + TextureSet.SET_METALLIC // No Byproducts // No Ingredients ); public static final Werkstoff Calcium = new Werkstoff( - Materials.Calcium.mRGBa, - "Calcium", - "Ca", - new Werkstoff.Stats().setProtons(Element.Ca.mProtons).setMass(Element.Ca.getMass()).setBlastFurnace(true) - .setMeltingPoint(1115).setBoilingPoint(1757), - Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten(), - 40, - Materials.Calcium.mIconSet, - // No Byproducts - new Pair<>(Materials.Calcium, 1)); + Materials.Calcium.mRGBa, + "Calcium", + "Ca", + new Werkstoff.Stats().setProtons(Element.Ca.mProtons) + .setMass(Element.Ca.getMass()) + .setBlastFurnace(true) + .setMeltingPoint(1115) + .setBoilingPoint(1757), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addMetalItems() + .addMolten(), + 40, + Materials.Calcium.mIconSet, + // No Byproducts + new Pair<>(Materials.Calcium, 1)); public static final Werkstoff Neon = new Werkstoff( - new short[] { 0xff, 0x07, 0x3a }, - "Neon", - "Ne", - new Werkstoff.Stats().setProtons(Element.Ne.mProtons).setMass(Element.Ne.getMass()).setGas(true) - .setEbfGasRecipeTimeMultiplier(0.6d).setEbfGasRecipeConsumedAmountMultiplier(0.55d), - Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), - 41, - TextureSet.SET_FLUID + new short[] { 0xff, 0x07, 0x3a }, + "Neon", + "Ne", + new Werkstoff.Stats().setProtons(Element.Ne.mProtons) + .setMass(Element.Ne.getMass()) + .setGas(true) + .setEbfGasRecipeTimeMultiplier(0.6d) + .setEbfGasRecipeConsumedAmountMultiplier(0.55d), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable() + .addCells() + .enforceUnification(), + 41, + TextureSet.SET_FLUID // No Byproducts // No Ingredients ); public static final Werkstoff Krypton = new Werkstoff( - new short[] { 0xb1, 0xff, 0x32 }, - "Krypton", - "Kr", - new Werkstoff.Stats().setProtons(Element.Kr.mProtons).setMass(Element.Kr.getMass()).setGas(true) - .setEbfGasRecipeTimeMultiplier(0.5d).setEbfGasRecipeConsumedAmountMultiplier(0.4d), - Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), - 42, - TextureSet.SET_FLUID + new short[] { 0xb1, 0xff, 0x32 }, + "Krypton", + "Kr", + new Werkstoff.Stats().setProtons(Element.Kr.mProtons) + .setMass(Element.Kr.getMass()) + .setGas(true) + .setEbfGasRecipeTimeMultiplier(0.5d) + .setEbfGasRecipeConsumedAmountMultiplier(0.4d), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable() + .addCells() + .enforceUnification(), + 42, + TextureSet.SET_FLUID // No Byproducts // No Ingredients ); public static final Werkstoff BArTiMaEuSNeK = new Werkstoff( - new short[] { 0x00, 0xff, 0x00 }, - "BArTiMaEuSNeK", - "Are you serious?", - new Werkstoff.Stats().setMeltingPoint(9001).setCentrifuge(true).setBlastFurnace(true) - .setMeltingVoltage(1920), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().addGems().addMetalItems().addMolten(), - 43, - TextureSet.SET_DIAMOND, - Arrays.asList(Materials.Boron, Materials.Titanium, Materials.Europium), - new Pair<>(Materials.Boron, 1), - new Pair<>(Materials.Argon, 1), - new Pair<>(Materials.Titanium, 1), - new Pair<>(Materials.Magic, 1), - new Pair<>(Materials.Europium, 1), - new Pair<>(Materials.Sulfur, 1), - new Pair<>(WerkstoffLoader.Neon, 1), - new Pair<>(Materials.Potassium, 1)); + new short[] { 0x00, 0xff, 0x00 }, + "BArTiMaEuSNeK", + "Are you serious?", + new Werkstoff.Stats().setMeltingPoint(9001) + .setCentrifuge(true) + .setBlastFurnace(true) + .setMeltingVoltage(1920), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems() + .addMetalItems() + .addMolten(), + 43, + TextureSet.SET_DIAMOND, + Arrays.asList(Materials.Boron, Materials.Titanium, Materials.Europium), + new Pair<>(Materials.Boron, 1), + new Pair<>(Materials.Argon, 1), + new Pair<>(Materials.Titanium, 1), + new Pair<>(Materials.Magic, 1), + new Pair<>(Materials.Europium, 1), + new Pair<>(Materials.Sulfur, 1), + new Pair<>(WerkstoffLoader.Neon, 1), + new Pair<>(Materials.Potassium, 1)); public static final Werkstoff PTConcentrate = new Werkstoff( - Materials.Platinum.getRGBA(), - "Platinum Concentrate", - "", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().addCells(), - 44, - TextureSet.SET_FLUID + Materials.Platinum.getRGBA(), + "Platinum Concentrate", + "", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 44, + TextureSet.SET_FLUID // No Byproducts // No Ingredients ); public static final Werkstoff PTSaltCrude = new Werkstoff( - Materials.Platinum.getRGBA(), - "Platinum Salt", - "", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 45, - TextureSet.SET_DULL + Materials.Platinum.getRGBA(), + "Platinum Salt", + "", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 45, + TextureSet.SET_DULL // No Byproducts // No Ingredients ); public static final Werkstoff PTSaltRefined = new Werkstoff( - Materials.Platinum.getRGBA(), - "Refined Platinum Salt", - "", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 46, - TextureSet.SET_METALLIC + Materials.Platinum.getRGBA(), + "Refined Platinum Salt", + "", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 46, + TextureSet.SET_METALLIC // No Byproducts // No Ingredients ); public static final Werkstoff PTMetallicPowder = new Werkstoff( - Materials.Platinum.getRGBA(), - "Platinum Metallic Powder", - "??PtPdIrOsRhRu??", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures(), - 47, - TextureSet.SET_METALLIC, - // No Byproducts - new Pair<>(Materials.Platinum, 1), - new Pair<>(Materials.Stone, 2)); + Materials.Platinum.getRGBA(), + "Platinum Metallic Powder", + "??PtPdIrOsRhRu??", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures(), + 47, + TextureSet.SET_METALLIC, + // No Byproducts + new Pair<>(Materials.Platinum, 1), + new Pair<>(Materials.Stone, 2)); public static final Werkstoff AquaRegia = new Werkstoff( - new short[] { 0xff, 0xb1, 0x32 }, - "Aqua Regia", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().addCells(), - 48, - TextureSet.SET_FLUID, - // No Byproducts - new Pair<>(Materials.DilutedSulfuricAcid, 1), - new Pair<>(Materials.NitricAcid, 1)); + new short[] { 0xff, 0xb1, 0x32 }, + "Aqua Regia", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 48, + TextureSet.SET_FLUID, + // No Byproducts + new Pair<>(Materials.DilutedSulfuricAcid, 1), + new Pair<>(Materials.NitricAcid, 1)); public static final Werkstoff PTResidue = new Werkstoff( - new short[] { 0x64, 0x63, 0x2E }, - "Platinum Residue", - "??IrOsRhRu??", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 49, - TextureSet.SET_ROUGH + new short[] { 0x64, 0x63, 0x2E }, + "Platinum Residue", + "??IrOsRhRu??", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 49, + TextureSet.SET_ROUGH // No Byproducts ); public static final Werkstoff AmmoniumChloride = new Werkstoff( - new short[] { 0xff, 0xff, 0xff }, - "Ammonium Chloride", - subscriptNumbers("NH4Cl"), - new Werkstoff.Stats(), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().addCells(), - 50, - TextureSet.SET_FLUID, - // No Byproducts - new Pair<>(Materials.Ammonium, 1), - new Pair<>(Materials.HydrochloricAcid, 1)); + new short[] { 0xff, 0xff, 0xff }, + "Ammonium Chloride", + subscriptNumbers("NH4Cl"), + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 50, + TextureSet.SET_FLUID, + // No Byproducts + new Pair<>(Materials.Ammonium, 1), + new Pair<>(Materials.HydrochloricAcid, 1)); public static final Werkstoff PTRawPowder = new Werkstoff( - Materials.Platinum.getRGBA(), - "Reprecipitated Platinum", - "PtCl", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 51, - TextureSet.SET_METALLIC + Materials.Platinum.getRGBA(), + "Reprecipitated Platinum", + "PtCl", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 51, + TextureSet.SET_METALLIC // No Byproducts ); public static final Werkstoff PDAmmonia = new Werkstoff( - Materials.Palladium.getRGBA(), - "Palladium Enriched Ammonia", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().addCells(), - 52, - TextureSet.SET_FLUID, - // No Byproducts - new Pair<>(Materials.Ammonium, 1), - new Pair<>(Materials.Palladium, 1)); + Materials.Palladium.getRGBA(), + "Palladium Enriched Ammonia", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 52, + TextureSet.SET_FLUID, + // No Byproducts + new Pair<>(Materials.Ammonium, 1), + new Pair<>(Materials.Palladium, 1)); public static final Werkstoff PDMetallicPowder = new Werkstoff( - Materials.Palladium.getRGBA(), - "Palladium Metallic Powder", - "??Pd??", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures(), - 53, - TextureSet.SET_METALLIC, - // No Byproducts - new Pair<>(Materials.Palladium, 1), - new Pair<>(Materials.Stone, 2)); + Materials.Palladium.getRGBA(), + "Palladium Metallic Powder", + "??Pd??", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures(), + 53, + TextureSet.SET_METALLIC, + // No Byproducts + new Pair<>(Materials.Palladium, 1), + new Pair<>(Materials.Stone, 2)); public static final Werkstoff PDRawPowder = new Werkstoff( - Materials.Palladium.getRGBA(), - "Reprecipitated Palladium", - subscriptNumbers("Pd2NH4"), - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 54, - TextureSet.SET_METALLIC + Materials.Palladium.getRGBA(), + "Reprecipitated Palladium", + subscriptNumbers("Pd2NH4"), + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 54, + TextureSet.SET_METALLIC // No Byproducts // No Ingredients ); public static final Werkstoff PDSalt = new Werkstoff( - Materials.Palladium.getRGBA(), - "Palladium Salt", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 55, - TextureSet.SET_METALLIC + Materials.Palladium.getRGBA(), + "Palladium Salt", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 55, + TextureSet.SET_METALLIC // No Byproducts // No Ingredients ); public static final Werkstoff Sodiumformate = new Werkstoff( - new short[] { 0xff, 0xaa, 0xaa }, - "Sodium Formate", - "HCOONa", - new Werkstoff.Stats(), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().addCells(), - 56, - TextureSet.SET_FLUID, - // No Byproducts - new Pair<>(Materials.SodiumHydroxide, 1), - new Pair<>(Materials.CarbonMonoxide, 1)); + new short[] { 0xff, 0xaa, 0xaa }, + "Sodium Formate", + "HCOONa", + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 56, + TextureSet.SET_FLUID, + // No Byproducts + new Pair<>(Materials.SodiumHydroxide, 1), + new Pair<>(Materials.CarbonMonoxide, 1)); public static final Werkstoff Sodiumsulfate = new Werkstoff( - new short[] { 0xff, 0xff, 0xff }, - "Sodium Sulfate", - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 57, - TextureSet.SET_FLUID, - // No Byproducts - new Pair<>(Materials.Sodium, 2), - new Pair<>(Materials.Sulfur, 1), - new Pair<>(Materials.Oxygen, 4)); + new short[] { 0xff, 0xff, 0xff }, + "Sodium Sulfate", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 57, + TextureSet.SET_FLUID, + // No Byproducts + new Pair<>(Materials.Sodium, 2), + new Pair<>(Materials.Sulfur, 1), + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff FormicAcid = new Werkstoff( - new short[] { 0xff, 0xaa, 0x77 }, - "Formic Acid", - subscriptNumbers("CH2O2"), - new Werkstoff.Stats().setElektrolysis(false), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().addCells(), - 58, - TextureSet.SET_FLUID, - // No Byproducts - new Pair<>(Materials.Carbon, 1), - new Pair<>(Materials.Hydrogen, 2), - new Pair<>(Materials.Oxygen, 2)); + new short[] { 0xff, 0xaa, 0x77 }, + "Formic Acid", + subscriptNumbers("CH2O2"), + new Werkstoff.Stats().setElektrolysis(false), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 58, + TextureSet.SET_FLUID, + // No Byproducts + new Pair<>(Materials.Carbon, 1), + new Pair<>(Materials.Hydrogen, 2), + new Pair<>(Materials.Oxygen, 2)); public static final Werkstoff PotassiumDisulfate = new Werkstoff( - new short[] { 0xfb, 0xbb, 0x66 }, - "Potassium Disulfate", - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addChemicalRecipes(), - 59, - TextureSet.SET_DULL, - // No Byproducts - new Pair<>(Materials.Potassium, 2), - new Pair<>(Materials.Sulfur, 2), - new Pair<>(Materials.Oxygen, 7)); + new short[] { 0xfb, 0xbb, 0x66 }, + "Potassium Disulfate", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addMolten() + .addChemicalRecipes(), + 59, + TextureSet.SET_DULL, + // No Byproducts + new Pair<>(Materials.Potassium, 2), + new Pair<>(Materials.Sulfur, 2), + new Pair<>(Materials.Oxygen, 7)); public static final Werkstoff LeachResidue = new Werkstoff( - new short[] { 0x64, 0x46, 0x29 }, - "Leach Residue", - "??IrOsRu??", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures(), - 60, - TextureSet.SET_ROUGH + new short[] { 0x64, 0x46, 0x29 }, + "Leach Residue", + "??IrOsRu??", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures(), + 60, + TextureSet.SET_ROUGH // No Byproducts ); public static final Werkstoff RHSulfate = new Werkstoff( - new short[] { 0xee, 0xaa, 0x55 }, - "Rhodium Sulfate", - new Werkstoff.Stats().setGas(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().addCells(), - 61, - TextureSet.SET_FLUID + new short[] { 0xee, 0xaa, 0x55 }, + "Rhodium Sulfate", + new Werkstoff.Stats().setGas(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 61, + TextureSet.SET_FLUID // No Byproducts ); public static final Werkstoff RHSulfateSolution = new Werkstoff( - new short[] { 0xff, 0xbb, 0x66 }, - "Rhodium Sulfate Solution", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().addCells(), - 62, - TextureSet.SET_FLUID + new short[] { 0xff, 0xbb, 0x66 }, + "Rhodium Sulfate Solution", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 62, + TextureSet.SET_FLUID // No Byproducts ); public static final Werkstoff CalciumChloride = new Werkstoff( - new short[] { 0xff, 0xff, 0xff }, - "Calcium Chloride", - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust().addCells(), - 63, - TextureSet.SET_DULL, - new Pair<>(Materials.Calcium, 1), - new Pair<>(Materials.Chlorine, 2) + new short[] { 0xff, 0xff, 0xff }, + "Calcium Chloride", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addCells(), + 63, + TextureSet.SET_DULL, + new Pair<>(Materials.Calcium, 1), + new Pair<>(Materials.Chlorine, 2) // No Byproducts ); public static final Werkstoff Ruthenium = new Werkstoff( - new short[] { 0x64, 0x64, 0x64 }, - "Ruthenium", - "Ru", - new Werkstoff.Stats().setBlastFurnace(true).setMeltingPoint(2607).setMass(Element.Ru.getMass()) - .setProtons(Element.Ru.mProtons), - Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().onlyDust().addMolten().addMetalItems().enforceUnification(), - 64, - TextureSet.SET_METALLIC + new short[] { 0x64, 0x64, 0x64 }, + "Ruthenium", + "Ru", + new Werkstoff.Stats().setBlastFurnace(true) + .setMeltingPoint(2607) + .setMass(Element.Ru.getMass()) + .setProtons(Element.Ru.mProtons), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().onlyDust() + .addMolten() + .addMetalItems() + .enforceUnification(), + 64, + TextureSet.SET_METALLIC // No Byproducts ); public static final Werkstoff SodiumRuthenate = new Werkstoff( - new short[] { 0x3a, 0x40, 0xcb }, - "Sodium Ruthenate", - new Werkstoff.Stats(), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 65, - TextureSet.SET_SHINY, - new Pair<>(Materials.Sodium, 2), - new Pair<>(Ruthenium, 1), - new Pair<>(Materials.Oxygen, 3) + new short[] { 0x3a, 0x40, 0xcb }, + "Sodium Ruthenate", + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 65, + TextureSet.SET_SHINY, + new Pair<>(Materials.Sodium, 2), + new Pair<>(Ruthenium, 1), + new Pair<>(Materials.Oxygen, 3) // No Byproducts ); public static final Werkstoff RutheniumTetroxide = new Werkstoff( - new short[] { 0xc7, 0xc7, 0xc7 }, - "Ruthenium Tetroxide", - new Werkstoff.Stats().setMeltingPoint(313), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust().addCells(), - 66, - TextureSet.SET_DULL, - new Pair<>(WerkstoffLoader.Ruthenium, 1), - new Pair<>(Materials.Oxygen, 4) + new short[] { 0xc7, 0xc7, 0xc7 }, + "Ruthenium Tetroxide", + new Werkstoff.Stats().setMeltingPoint(313), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addCells(), + 66, + TextureSet.SET_DULL, + new Pair<>(WerkstoffLoader.Ruthenium, 1), + new Pair<>(Materials.Oxygen, 4) // No Byproducts ); public static final Werkstoff HotRutheniumTetroxideSollution = new Werkstoff( - new short[] { 0xc7, 0xc7, 0xc7 }, - "Hot Ruthenium Tetroxide Solution", - "???", - new Werkstoff.Stats().setGas(true).setMeltingPoint(700), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().addCells(), - 67, - TextureSet.SET_FLUID, - new Pair<>(WerkstoffLoader.Ruthenium, 1), - new Pair<>(Materials.Oxygen, 4), - new Pair<>(Materials.Chlorine, 2), - new Pair<>(Materials.Sodium, 2), - new Pair<>(Materials.Water, 2) + new short[] { 0xc7, 0xc7, 0xc7 }, + "Hot Ruthenium Tetroxide Solution", + "???", + new Werkstoff.Stats().setGas(true) + .setMeltingPoint(700), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 67, + TextureSet.SET_FLUID, + new Pair<>(WerkstoffLoader.Ruthenium, 1), + new Pair<>(Materials.Oxygen, 4), + new Pair<>(Materials.Chlorine, 2), + new Pair<>(Materials.Sodium, 2), + new Pair<>(Materials.Water, 2) // No Byproducts ); public static final Werkstoff RutheniumTetroxideSollution = new Werkstoff( - new short[] { 0xc7, 0xc7, 0xc7 }, - "Ruthenium Tetroxide Solution", - "???", - new Werkstoff.Stats().setMeltingPoint(313), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().addCells(), - 68, - TextureSet.SET_FLUID, - new Pair<>(Ruthenium, 1), - new Pair<>(Materials.Oxygen, 4), - new Pair<>(Materials.Chlorine, 2), - new Pair<>(Materials.Sodium, 2), - new Pair<>(Materials.Water, 2) + new short[] { 0xc7, 0xc7, 0xc7 }, + "Ruthenium Tetroxide Solution", + "???", + new Werkstoff.Stats().setMeltingPoint(313), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 68, + TextureSet.SET_FLUID, + new Pair<>(Ruthenium, 1), + new Pair<>(Materials.Oxygen, 4), + new Pair<>(Materials.Chlorine, 2), + new Pair<>(Materials.Sodium, 2), + new Pair<>(Materials.Water, 2) // No Byproducts ); public static final Werkstoff IrOsLeachResidue = new Werkstoff( - new short[] { 0x64, 0x46, 0x29 }, - "Rarest Metal Residue", - "??OsIr??", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures(), - 69, - TextureSet.SET_ROUGH, - // No Byproducts - new Pair<>(Materials.Osmiridium, 1), - new Pair<>(Materials.Stone, 2)); + new short[] { 0x64, 0x46, 0x29 }, + "Rarest Metal Residue", + "??OsIr??", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures(), + 69, + TextureSet.SET_ROUGH, + // No Byproducts + new Pair<>(Materials.Osmiridium, 1), + new Pair<>(Materials.Stone, 2)); public static final Werkstoff IrLeachResidue = new Werkstoff( - new short[] { 0x84, 0x66, 0x49 }, - "Iridium Metal Residue", - "??Ir??", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures(), - 70, - TextureSet.SET_ROUGH, - new Pair<>(Materials.Iridium, 1), - new Pair<>(Materials.Stone, 2) + new short[] { 0x84, 0x66, 0x49 }, + "Iridium Metal Residue", + "??Ir??", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures(), + 70, + TextureSet.SET_ROUGH, + new Pair<>(Materials.Iridium, 1), + new Pair<>(Materials.Stone, 2) // No Byproducts ); public static final Werkstoff PGSDResidue = new Werkstoff( - new short[] { 0x84, 0x66, 0x49 }, - "Sludge Dust Residue", - new Werkstoff.Stats().setCentrifuge(true), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 71, - TextureSet.SET_DULL, - new Pair<>(Materials.SiliconDioxide, 3), - new Pair<>(Materials.Gold, 2)); + new short[] { 0x84, 0x66, 0x49 }, + "Sludge Dust Residue", + new Werkstoff.Stats().setCentrifuge(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 71, + TextureSet.SET_DULL, + new Pair<>(Materials.SiliconDioxide, 3), + new Pair<>(Materials.Gold, 2)); public static final Werkstoff AcidicOsmiumSolution = new Werkstoff( - new short[] { 0x84, 0x66, 0x49 }, - "Acidic Osmium Solution", - "???", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().addCells(), - 72, - TextureSet.SET_FLUID, - new Pair<>(Materials.Osmium, 1), - new Pair<>(Materials.HydrochloricAcid, 1)); + new short[] { 0x84, 0x66, 0x49 }, + "Acidic Osmium Solution", + "???", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 72, + TextureSet.SET_FLUID, + new Pair<>(Materials.Osmium, 1), + new Pair<>(Materials.HydrochloricAcid, 1)); public static final Werkstoff IridiumDioxide = new Werkstoff( - new short[] { 0x84, 0x66, 0x49 }, - "Iridium Dioxide", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 73, - TextureSet.SET_FLUID, - new Pair<>(Materials.Iridium, 1), - new Pair<>(Materials.Oxygen, 2)); + new short[] { 0x84, 0x66, 0x49 }, + "Iridium Dioxide", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 73, + TextureSet.SET_FLUID, + new Pair<>(Materials.Iridium, 1), + new Pair<>(Materials.Oxygen, 2)); public static final Werkstoff OsmiumSolution = new Werkstoff( - new short[] { 0x84, 0x66, 0x49 }, - "Osmium Solution", - "???", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().addCells(), - 74, - TextureSet.SET_FLUID, - new Pair<>(Materials.Osmium, 1), - new Pair<>(Materials.Hydrogen, 1)); + new short[] { 0x84, 0x66, 0x49 }, + "Osmium Solution", + "???", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 74, + TextureSet.SET_FLUID, + new Pair<>(Materials.Osmium, 1), + new Pair<>(Materials.Hydrogen, 1)); public static final Werkstoff AcidicIridiumSolution = new Werkstoff( - new short[] { 0x84, 0x66, 0x49 }, - "Acidic Iridium Solution", - "???", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().addCells(), - 75, - TextureSet.SET_FLUID, - new Pair<>(Materials.Iridium, 1), - new Pair<>(Materials.Hydrogen, 1)); + new short[] { 0x84, 0x66, 0x49 }, + "Acidic Iridium Solution", + "???", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 75, + TextureSet.SET_FLUID, + new Pair<>(Materials.Iridium, 1), + new Pair<>(Materials.Hydrogen, 1)); public static final Werkstoff IridiumChloride = new Werkstoff( - new short[] { 0x84, 0x66, 0x49 }, - "Iridium Chloride", - subscriptNumbers("IrCl3"), - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 76, - TextureSet.SET_LAPIS, - new Pair<>(Materials.Iridium, 1), - new Pair<>(Materials.Chlorine, 3)); + new short[] { 0x84, 0x66, 0x49 }, + "Iridium Chloride", + subscriptNumbers("IrCl3"), + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 76, + TextureSet.SET_LAPIS, + new Pair<>(Materials.Iridium, 1), + new Pair<>(Materials.Chlorine, 3)); public static final Werkstoff PGSDResidue2 = new Werkstoff( - new short[] { 0x84, 0x66, 0x49 }, - "Metallic Sludge Dust Residue", - new Werkstoff.Stats().setCentrifuge(true), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 77, - TextureSet.SET_DULL, - new Pair<>(Materials.Nickel, 1), - new Pair<>(Materials.Copper, 1)); + new short[] { 0x84, 0x66, 0x49 }, + "Metallic Sludge Dust Residue", + new Werkstoff.Stats().setCentrifuge(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 77, + TextureSet.SET_DULL, + new Pair<>(Materials.Nickel, 1), + new Pair<>(Materials.Copper, 1)); public static final Werkstoff Rhodium = new Werkstoff( - new short[] { 0xF4, 0xF4, 0xF4 }, - "Rhodium", - "Rh", - new Werkstoff.Stats().setProtons(Element.Rh.mProtons).setMass(Element.Rh.getMass()).setBlastFurnace(true) - .setMeltingPoint(2237), - Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten().enforceUnification(), - 78, - TextureSet.SET_METALLIC); + new short[] { 0xF4, 0xF4, 0xF4 }, + "Rhodium", + "Rh", + new Werkstoff.Stats().setProtons(Element.Rh.mProtons) + .setMass(Element.Rh.getMass()) + .setBlastFurnace(true) + .setMeltingPoint(2237), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addMetalItems() + .addMolten() + .enforceUnification(), + 78, + TextureSet.SET_METALLIC); public static final Werkstoff CrudeRhMetall = new Werkstoff( - new short[] { 0x66, 0x66, 0x66 }, - "Crude Rhodium Metal", - "??Rh??", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures(), - 79, - TextureSet.SET_DULL, - new Pair<>(Rhodium, 1), - new Pair<>(Materials.Stone, 1)); + new short[] { 0x66, 0x66, 0x66 }, + "Crude Rhodium Metal", + "??Rh??", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures(), + 79, + TextureSet.SET_DULL, + new Pair<>(Rhodium, 1), + new Pair<>(Materials.Stone, 1)); public static final Werkstoff RHSalt = new Werkstoff( - new short[] { 0x84, 0x84, 0x84 }, - "Rhodium Salt", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 80, - TextureSet.SET_GEM_VERTICAL); + new short[] { 0x84, 0x84, 0x84 }, + "Rhodium Salt", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 80, + TextureSet.SET_GEM_VERTICAL); public static final Werkstoff RHSaltSolution = new Werkstoff( - new short[] { 0x66, 0x77, 0x88 }, - "Rhodium Salt Solution", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().addCells(), - 81, - TextureSet.SET_FLUID); + new short[] { 0x66, 0x77, 0x88 }, + "Rhodium Salt Solution", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 81, + TextureSet.SET_FLUID); public static final Werkstoff SodiumNitrate = new Werkstoff( - new short[] { 0x84, 0x66, 0x84 }, - "Sodium Nitrate", - subscriptNumbers("NaNO3"), - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 82, - TextureSet.SET_ROUGH, - new Pair<>(Materials.Sodium, 1), - new Pair<>(Materials.Nitrogen, 1), - new Pair<>(Materials.Oxygen, 3)); + new short[] { 0x84, 0x66, 0x84 }, + "Sodium Nitrate", + subscriptNumbers("NaNO3"), + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 82, + TextureSet.SET_ROUGH, + new Pair<>(Materials.Sodium, 1), + new Pair<>(Materials.Nitrogen, 1), + new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff RHNitrate = new Werkstoff( - new short[] { 0x77, 0x66, 0x49 }, - "Rhodium Nitrate", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 83, - TextureSet.SET_QUARTZ); + new short[] { 0x77, 0x66, 0x49 }, + "Rhodium Nitrate", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 83, + TextureSet.SET_QUARTZ); public static final Werkstoff ZincSulfate = new Werkstoff( - new short[] { 0x84, 0x66, 0x49 }, - "Zinc Sulfate", - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 84, - TextureSet.SET_QUARTZ, - new Pair<>(Materials.Zinc, 1), - new Pair<>(Materials.Sulfur, 1), - new Pair<>(Materials.Oxygen, 4)); + new short[] { 0x84, 0x66, 0x49 }, + "Zinc Sulfate", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 84, + TextureSet.SET_QUARTZ, + new Pair<>(Materials.Zinc, 1), + new Pair<>(Materials.Sulfur, 1), + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff RhFilterCake = new Werkstoff( - new short[] { 0x77, 0x66, 0x49 }, - "Rhodium Filter Cake", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 85, - TextureSet.SET_QUARTZ); + new short[] { 0x77, 0x66, 0x49 }, + "Rhodium Filter Cake", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 85, + TextureSet.SET_QUARTZ); public static final Werkstoff RHFilterCakeSolution = new Werkstoff( - new short[] { 0x66, 0x77, 0x88 }, - "Rhodium Filter Cake Solution", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().addCells(), - 86, - TextureSet.SET_FLUID); + new short[] { 0x66, 0x77, 0x88 }, + "Rhodium Filter Cake Solution", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 86, + TextureSet.SET_FLUID); public static final Werkstoff ReRh = new Werkstoff( - new short[] { 0x77, 0x66, 0x49 }, - "Reprecipitated Rhodium", - subscriptNumbers("Rh2NH4"), - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 87, - TextureSet.SET_QUARTZ); + new short[] { 0x77, 0x66, 0x49 }, + "Reprecipitated Rhodium", + subscriptNumbers("Rh2NH4"), + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 87, + TextureSet.SET_QUARTZ); public static final Werkstoff LuVTierMaterial = new Werkstoff( - Materials.Chrome.getRGBA(), - "Rhodium-Plated Palladium", - new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500) - .setMeltingVoltage(480), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems() - .addMixerRecipes((short) 1).addSimpleMetalWorkingItems().addCraftingMetalWorkingItems() - .addMultipleIngotMetalWorkingItems(), - 88, - TextureSet.SET_METALLIC, - new Pair<>(Materials.Palladium, 3), - new Pair<>(WerkstoffLoader.Rhodium, 1)); + Materials.Chrome.getRGBA(), + "Rhodium-Plated Palladium", + new Werkstoff.Stats().setCentrifuge(true) + .setBlastFurnace(true) + .setMeltingPoint(4500) + .setMeltingVoltage(480), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addMolten() + .addMetalItems() + .addMixerRecipes((short) 1) + .addSimpleMetalWorkingItems() + .addCraftingMetalWorkingItems() + .addMultipleIngotMetalWorkingItems(), + 88, + TextureSet.SET_METALLIC, + new Pair<>(Materials.Palladium, 3), + new Pair<>(WerkstoffLoader.Rhodium, 1)); public static final Werkstoff Tiberium = new Werkstoff( - new short[] { 0x22, 0xEE, 0x22 }, - "Tiberium", - "Tr", - new Werkstoff.Stats().setProtons(123).setMass(326).setBlastFurnace(true).setMeltingPoint(1800) - .setRadioactive(true).setToxic(true), - Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().addGems().addCraftingMetalWorkingItems().addSimpleMetalWorkingItems(), - 89, - TextureSet.SET_DIAMOND); + new short[] { 0x22, 0xEE, 0x22 }, + "Tiberium", + "Tr", + new Werkstoff.Stats().setProtons(123) + .setMass(326) + .setBlastFurnace(true) + .setMeltingPoint(1800) + .setRadioactive(true) + .setToxic(true), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().addGems() + .addCraftingMetalWorkingItems() + .addSimpleMetalWorkingItems(), + 89, + TextureSet.SET_DIAMOND); public static final Werkstoff Ruridit = new Werkstoff( - new short[] { 0xA4, 0xA4, 0xA4 }, - "Ruridit", - new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500) - .setMeltingVoltage(480), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems() - .addMixerRecipes((short) 1).addSimpleMetalWorkingItems().addCraftingMetalWorkingItems() - .addMultipleIngotMetalWorkingItems(), - 90, - TextureSet.SET_METALLIC, - new Pair<>(WerkstoffLoader.Ruthenium, 2), - new Pair<>(Materials.Iridium, 1)); + new short[] { 0xA4, 0xA4, 0xA4 }, + "Ruridit", + new Werkstoff.Stats().setCentrifuge(true) + .setBlastFurnace(true) + .setMeltingPoint(4500) + .setMeltingVoltage(480), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addMolten() + .addMetalItems() + .addMixerRecipes((short) 1) + .addSimpleMetalWorkingItems() + .addCraftingMetalWorkingItems() + .addMultipleIngotMetalWorkingItems(), + 90, + TextureSet.SET_METALLIC, + new Pair<>(WerkstoffLoader.Ruthenium, 2), + new Pair<>(Materials.Iridium, 1)); public static final Werkstoff Fluorspar = new Werkstoff( - new short[] { 185, 69, 251 }, - "Fluorspar", - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().addGems(), - 91, - TextureSet.SET_GEM_VERTICAL, - new Pair<>(Materials.Calcium, 1), - new Pair<>(Materials.Fluorine, 2)); + new short[] { 185, 69, 251 }, + "Fluorspar", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().addGems(), + 91, + TextureSet.SET_GEM_VERTICAL, + new Pair<>(Materials.Calcium, 1), + new Pair<>(Materials.Fluorine, 2)); public static final Werkstoff HDCS = new Werkstoff( - new short[] { 0x33, 0x44, 0x33 }, - "High Durability Compound Steel", - new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(9000) - .setMeltingVoltage(7680), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes() - .addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), - 92, - TextureSet.SET_SHINY, - new Pair<>(Materials.TungstenSteel, 12), - new Pair<>(Materials.HSSE, 9), - new Pair<>(Materials.HSSG, 6), - new Pair<>(WerkstoffLoader.Ruridit, 3), - new Pair<>(WerkstoffLoader.MagnetoResonaticDust, 2), - new Pair<>(Materials.Plutonium, 1)); + new short[] { 0x33, 0x44, 0x33 }, + "High Durability Compound Steel", + new Werkstoff.Stats().setCentrifuge(true) + .setBlastFurnace(true) + .setMeltingPoint(9000) + .setMeltingVoltage(7680), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addMolten() + .addMetalItems() + .addMixerRecipes() + .addSimpleMetalWorkingItems() + .addCraftingMetalWorkingItems() + .addMultipleIngotMetalWorkingItems(), + 92, + TextureSet.SET_SHINY, + new Pair<>(Materials.TungstenSteel, 12), + new Pair<>(Materials.HSSE, 9), + new Pair<>(Materials.HSSG, 6), + new Pair<>(WerkstoffLoader.Ruridit, 3), + new Pair<>(WerkstoffLoader.MagnetoResonaticDust, 2), + new Pair<>(Materials.Plutonium, 1)); public static final Werkstoff Atheneite = new Werkstoff( - new short[] { 175, 175, 175 }, - "Atheneite", - subscriptNumbers("(Pd,Hg)3As"), - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), - 93, - TextureSet.SET_SHINY, - new Pair<>(WerkstoffLoader.PDMetallicPowder, 3), - new Pair<>(Materials.Mercury, 3), - new Pair<>(Materials.Arsenic, 1)); + new short[] { 175, 175, 175 }, + "Atheneite", + subscriptNumbers("(Pd,Hg)3As"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 93, + TextureSet.SET_SHINY, + new Pair<>(WerkstoffLoader.PDMetallicPowder, 3), + new Pair<>(Materials.Mercury, 3), + new Pair<>(Materials.Arsenic, 1)); public static final Werkstoff Temagamite = new Werkstoff( - new short[] { 245, 245, 245 }, - "Temagamite", - subscriptNumbers("Pd3HgTe"), - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), - 94, - TextureSet.SET_ROUGH, - new Pair<>(WerkstoffLoader.PDMetallicPowder, 3), - new Pair<>(Materials.Mercury, 1), - new Pair<>(Materials.Tellurium, 1)); + new short[] { 245, 245, 245 }, + "Temagamite", + subscriptNumbers("Pd3HgTe"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 94, + TextureSet.SET_ROUGH, + new Pair<>(WerkstoffLoader.PDMetallicPowder, 3), + new Pair<>(Materials.Mercury, 1), + new Pair<>(Materials.Tellurium, 1)); public static final Werkstoff Terlinguaite = new Werkstoff( - new short[] { 245, 245, 245 }, - "Terlinguaite", - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures(), - 95, - TextureSet.SET_GEM_HORIZONTAL, - new Pair<>(Materials.Mercury, 2), - new Pair<>(Materials.Chlorine, 1), - new Pair<>(Materials.Oxygen, 1)); + new short[] { 245, 245, 245 }, + "Terlinguaite", + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures(), + 95, + TextureSet.SET_GEM_HORIZONTAL, + new Pair<>(Materials.Mercury, 2), + new Pair<>(Materials.Chlorine, 1), + new Pair<>(Materials.Oxygen, 1)); public static final Werkstoff AdemicSteel = new Werkstoff( - new short[] { 0xcc, 0xcc, 0xcc }, - "Ademic Steel", - "The break in the line", - new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setDurOverride(6144).setMeltingPoint(1800) - .setSpeedOverride(12).setQualityOverride((byte) 4).setMeltingVoltage(1920), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().onlyDust().addMetalItems().addCraftingMetalWorkingItems().addMolten() - .addSimpleMetalWorkingItems().addMultipleIngotMetalWorkingItems(), - 96, - TextureSet.SET_METALLIC, - new Pair<>(Materials.Steel, 2), - new Pair<>(Materials.VanadiumSteel, 1), - new Pair<>(Materials.DamascusSteel, 1), - new Pair<>(Materials.Carbon, 4)); + new short[] { 0xcc, 0xcc, 0xcc }, + "Ademic Steel", + "The break in the line", + new Werkstoff.Stats().setCentrifuge(true) + .setBlastFurnace(true) + .setDurOverride(6144) + .setMeltingPoint(1800) + .setSpeedOverride(12) + .setQualityOverride((byte) 4) + .setMeltingVoltage(1920), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().onlyDust() + .addMetalItems() + .addCraftingMetalWorkingItems() + .addMolten() + .addSimpleMetalWorkingItems() + .addMultipleIngotMetalWorkingItems(), + 96, + TextureSet.SET_METALLIC, + new Pair<>(Materials.Steel, 2), + new Pair<>(Materials.VanadiumSteel, 1), + new Pair<>(Materials.DamascusSteel, 1), + new Pair<>(Materials.Carbon, 4)); public static final Werkstoff RawAdemicSteel = new Werkstoff( - new short[] { 0xed, 0xed, 0xed }, - "Raw Ademic Steel", - new Werkstoff.Stats().setCentrifuge(true), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().onlyDust().addMixerRecipes(), - 97, - TextureSet.SET_ROUGH, - new Pair<>(Materials.Steel, 2), - new Pair<>(Materials.VanadiumSteel, 1), - new Pair<>(Materials.DamascusSteel, 1)); + new short[] { 0xed, 0xed, 0xed }, + "Raw Ademic Steel", + new Werkstoff.Stats().setCentrifuge(true), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().onlyDust() + .addMixerRecipes(), + 97, + TextureSet.SET_ROUGH, + new Pair<>(Materials.Steel, 2), + new Pair<>(Materials.VanadiumSteel, 1), + new Pair<>(Materials.DamascusSteel, 1)); public static final Werkstoff HexafluorosilicicAcid = new Werkstoff( - new short[] { 0x2c, 0x70, 0xb5 }, - "Hexafluorosilicic Acid", - subscriptNumbers("H2SiF6"), - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().addCells(), - 98, - TextureSet.SET_FLUID, - new Pair<>(Materials.Hydrogen, 2), - new Pair<>(Materials.Silicon, 1), - new Pair<>(Materials.Fluorine, 6)); + new short[] { 0x2c, 0x70, 0xb5 }, + "Hexafluorosilicic Acid", + subscriptNumbers("H2SiF6"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 98, + TextureSet.SET_FLUID, + new Pair<>(Materials.Hydrogen, 2), + new Pair<>(Materials.Silicon, 1), + new Pair<>(Materials.Fluorine, 6)); public static final Werkstoff Potassiumfluorosilicate = new Werkstoff( - new short[] { 0x2e, 0x97, 0xb2 }, - "Potassiumfluorosilicate", - subscriptNumbers("K2SiF6"), - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 99, - TextureSet.SET_SHINY, - new Pair<>(Materials.Potassium, 2), - new Pair<>(Materials.Silicon, 1), - new Pair<>(Materials.Fluorine, 6)); + new short[] { 0x2e, 0x97, 0xb2 }, + "Potassiumfluorosilicate", + subscriptNumbers("K2SiF6"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 99, + TextureSet.SET_SHINY, + new Pair<>(Materials.Potassium, 2), + new Pair<>(Materials.Silicon, 1), + new Pair<>(Materials.Fluorine, 6)); public static final Werkstoff Alumina = new Werkstoff( - new short[] { 0xa0, 0xad, 0xb1 }, - "Alumina", - subscriptNumbers("Al2O3"), - new Werkstoff.Stats(), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 100, - TextureSet.SET_DULL); + new short[] { 0xa0, 0xad, 0xb1 }, + "Alumina", + subscriptNumbers("Al2O3"), + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 100, + TextureSet.SET_DULL); public static final Werkstoff PotassiumCarbonate = new Werkstoff( - new short[] { 0x7b, 0x96, 0x4f }, - "Potassium Carbonate", - subscriptNumbers("K2CO3"), - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 101, - TextureSet.SET_DULL, - new Pair<>(Materials.Potassium, 2), - new Pair<>(Materials.Carbon, 1), - new Pair<>(Materials.Oxygen, 3)); + new short[] { 0x7b, 0x96, 0x4f }, + "Potassium Carbonate", + subscriptNumbers("K2CO3"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 101, + TextureSet.SET_DULL, + new Pair<>(Materials.Potassium, 2), + new Pair<>(Materials.Carbon, 1), + new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff RawFluorophlogopite = new Werkstoff( - new short[] { 0x36, 0x51, 0x0b }, - "Raw Fluorophlogopite", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 102, - TextureSet.SET_DULL); + new short[] { 0x36, 0x51, 0x0b }, + "Raw Fluorophlogopite", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust(), + 102, + TextureSet.SET_DULL); public static final Werkstoff HotFluorophlogopite = new Werkstoff( - new short[] { 0xbf, 0xd3, 0x55 }, - "Unformed Fluorophlogopite", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().addCells(), - 103, - TextureSet.SET_FLUID); + new short[] { 0xbf, 0xd3, 0x55 }, + "Unformed Fluorophlogopite", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .addCells(), + 103, + TextureSet.SET_FLUID); public static final Werkstoff Fluorophlogopite = new Werkstoff( - new short[] { 0xbf, 0xd3, 0x55 }, - "Fluorophlogopite", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems(), - 104, - TextureSet.SET_SHINY); + new short[] { 0xbf, 0xd3, 0x55 }, + "Fluorophlogopite", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable() + .onlyDust() + .addMetalItems(), + 104, + TextureSet.SET_SHINY); public static HashMap items = new HashMap<>(); public static HashBiMap fluids = HashBiMap.create(); @@ -1457,15 +1625,15 @@ public class WerkstoffLoader { ItemStack stack = getCorrespondingItemStackUnsafe(orePrefixes, werkstoff, amount); if (stack != null) return stack; MainMod.LOGGER.catching( - Level.ERROR, - new Exception( - "NO SUCH ITEM! " + orePrefixes - + werkstoff.getVarName() - + " If you encounter this as a user, make sure to contact the authors of the pack/the mods you're playing! " - + "If you are a Developer, you forgot to enable " - + orePrefixes - + " OrePrefix for Werkstoff " - + werkstoff.getDefaultName())); + Level.ERROR, + new Exception( + "NO SUCH ITEM! " + orePrefixes + + werkstoff.getVarName() + + " If you encounter this as a user, make sure to contact the authors of the pack/the mods you're playing! " + + "If you are a Developer, you forgot to enable " + + orePrefixes + + " OrePrefix for Werkstoff " + + werkstoff.getDefaultName())); return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); } @@ -1479,12 +1647,12 @@ public class WerkstoffLoader { runAdditionalOreDict(); long timepost = System.nanoTime(); MainMod.LOGGER.info( - "Making Meta Items for BW Materials took " + (timepost - timepre) - + "ns/" - + (timepost - timepre) / 1000000 - + "ms/" - + (timepost - timepre) / 1000000000 - + "s!"); + "Making Meta Items for BW Materials took " + (timepost - timepre) + + "ns/" + + (timepost - timepre) / 1000000 + + "ms/" + + (timepost - timepre) / 1000000000 + + "s!"); } public static void run() { @@ -1492,24 +1660,24 @@ public class WerkstoffLoader { MainMod.LOGGER.info("Loading Processing Recipes for BW Materials"); long timepre = System.nanoTime(); ProgressManager.ProgressBar progressBar = ProgressManager - .push("Register BW Materials", Werkstoff.werkstoffHashSet.size() + 1); + .push("Register BW Materials", Werkstoff.werkstoffHashSet.size() + 1); DebugLog.log("Loading Recipes" + (System.nanoTime() - timepre)); Integer[] clsArr = {}; int size = 0; if (BetterLoadingScreen.isModLoaded()) clsArr = CLSCompat.initCls(); IWerkstoffRunnable[] werkstoffRunnables = { new ToolLoader(), new DustLoader(), new GemLoader(), - new SimpleMetalLoader(), new CasingLoader(), new AspectLoader(), new OreLoader(), - new RawOreLoader(), new CrushedLoader(), new CraftingMaterialLoader(), new CellLoader(), - new MoltenCellLoader(), new MultipleMetalLoader(), new MetalLoader(), new BlockLoader() }; + new SimpleMetalLoader(), new CasingLoader(), new AspectLoader(), new OreLoader(), new RawOreLoader(), + new CrushedLoader(), new CraftingMaterialLoader(), new CellLoader(), new MoltenCellLoader(), + new MultipleMetalLoader(), new MetalLoader(), new BlockLoader() }; long timepreone = 0; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { timepreone = System.nanoTime(); DebugLog.log( - "Werkstoff is null or id < 0 ? " + (werkstoff == null || werkstoff.getmID() < 0) - + " " - + (System.nanoTime() - timepreone)); + "Werkstoff is null or id < 0 ? " + (werkstoff == null || werkstoff.getmID() < 0) + + " " + + (System.nanoTime() - timepreone)); if (werkstoff == null || werkstoff.getmID() < 0) { progressBar.step(""); continue; @@ -1517,7 +1685,8 @@ public class WerkstoffLoader { if (BetterLoadingScreen.isModLoaded()) size = CLSCompat.invokeStepSize(werkstoff, clsArr, size); DebugLog.log("Werkstoff: " + werkstoff.getDefaultName() + " " + (System.nanoTime() - timepreone)); for (IWerkstoffRunnable runnable : werkstoffRunnables) { - String loaderName = runnable.getClass().getSimpleName(); + String loaderName = runnable.getClass() + .getSimpleName(); DebugLog.log(loaderName + " started " + (System.nanoTime() - timepreone)); runnable.run(werkstoff); DebugLog.log(loaderName + " done " + (System.nanoTime() - timepreone)); @@ -1537,21 +1706,24 @@ public class WerkstoffLoader { ProgressManager.pop(progressBar); long timepost = System.nanoTime(); MainMod.LOGGER.info( - "Loading Processing Recipes for BW Materials took " + (timepost - timepre) - + "ns/" - + (timepost - timepre) / 1000000 - + "ms/" - + (timepost - timepre) / 1000000000 - + "s!"); + "Loading Processing Recipes for BW Materials took " + (timepost - timepre) + + "ns/" + + (timepost - timepre) / 1000000 + + "ms/" + + (timepost - timepre) / 1000000000 + + "s!"); registered = true; } } @SuppressWarnings("unchecked") private static void addSubTags() { - WerkstoffLoader.CubicZirconia.getStats().setDurOverride(Materials.Diamond.mDurability); - WerkstoffLoader.HDCS.getStats().setSpeedOverride(Materials.HSSS.mToolSpeed); - WerkstoffLoader.HDCS.getStats().setDurMod(10f); + WerkstoffLoader.CubicZirconia.getStats() + .setDurOverride(Materials.Diamond.mDurability); + WerkstoffLoader.HDCS.getStats() + .setSpeedOverride(Materials.HSSS.mToolSpeed); + WerkstoffLoader.HDCS.getStats() + .setDurMod(10f); Materials.Helium.add(WerkstoffLoader.NOBLE_GAS); WerkstoffLoader.Neon.add(WerkstoffLoader.NOBLE_GAS); Materials.Argon.add(WerkstoffLoader.NOBLE_GAS); @@ -1589,7 +1761,9 @@ public class WerkstoffLoader { Materials.Calcium.mToolQuality = WerkstoffLoader.Calcium.getToolQuality(); for (Werkstoff W : Werkstoff.werkstoffHashSet) { - for (Pair pair : W.getContents().getValue().toArray(new Pair[0])) { + for (Pair pair : W.getContents() + .getValue() + .toArray(new Pair[0])) { if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Neodymium) { W.add(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM); @@ -1624,10 +1798,15 @@ public class WerkstoffLoader { if (!FluidRegistry.isFluidRegistered(werkstoff.getDefaultName())) { DebugLog.log("Adding new Fluid: " + werkstoff.getDefaultName()); Fluid fluid = GT_FluidFactory.builder(werkstoff.getDefaultName()) - .withLocalizedName(werkstoff.getDefaultName()) - .withStateAndTemperature(werkstoff.getStats().getFluidState(), 300) - .withColorRGBA(werkstoff.getRGBA()).withTextureName("autogenerated").buildAndRegister() - .asFluid(); + .withLocalizedName(werkstoff.getDefaultName()) + .withStateAndTemperature( + werkstoff.getStats() + .getFluidState(), + 300) + .withColorRGBA(werkstoff.getRGBA()) + .withTextureName("autogenerated") + .buildAndRegister() + .asFluid(); WerkstoffLoader.fluids.put(werkstoff, fluid); } else { WerkstoffLoader.fluids.put(werkstoff, FluidRegistry.getFluid(werkstoff.getDefaultName())); @@ -1637,30 +1816,34 @@ public class WerkstoffLoader { if (!FluidRegistry.isFluidRegistered("molten." + werkstoff.getDefaultName())) { DebugLog.log("Adding new Molten: " + werkstoff.getDefaultName()); Fluid fluid = GT_FluidFactory.builder("molten." + werkstoff.getDefaultName()) - .withLocalizedName("Molten " + werkstoff.getDefaultName()) - .withStateAndTemperature( - FluidState.MOLTEN, - werkstoff.getStats().getMeltingPoint() > 0 ? werkstoff.getStats().getMeltingPoint() - : 300) - .withColorRGBA(werkstoff.getRGBA()).withTextureName("molten.autogenerated") - .buildAndRegister().asFluid(); + .withLocalizedName("Molten " + werkstoff.getDefaultName()) + .withStateAndTemperature( + FluidState.MOLTEN, + werkstoff.getStats() + .getMeltingPoint() > 0 ? werkstoff.getStats() + .getMeltingPoint() : 300) + .withColorRGBA(werkstoff.getRGBA()) + .withTextureName("molten.autogenerated") + .buildAndRegister() + .asFluid(); WerkstoffLoader.molten.put(werkstoff, fluid); } else { WerkstoffLoader.molten.put(werkstoff, FluidRegistry.getFluid(werkstoff.getDefaultName())); } } for (OrePrefixes p : values()) if (Materials.get(werkstoff.getDefaultName()) != null - && Materials.get(werkstoff.getDefaultName()).mMetaItemSubID != -1 - && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 - && OreDictHandler.getItemStack(werkstoff.getDefaultName(), p, 1) != null) { - DebugLog.log( - "Found: " + p - + werkstoff.getVarName() - + " in GT material system, disable and reroute my Items to that, also add a Tooltip."); - werkstoff.getGenerationFeatures().setBlacklist(p); - } + && Materials.get(werkstoff.getDefaultName()).mMetaItemSubID != -1 + && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 + && OreDictHandler.getItemStack(werkstoff.getDefaultName(), p, 1) != null) { + DebugLog.log( + "Found: " + p + + werkstoff.getVarName() + + " in GT material system, disable and reroute my Items to that, also add a Tooltip."); + werkstoff.getGenerationFeatures() + .setBlacklist(p); + } WerkstoffLoader.toGenerateGlobal = WerkstoffLoader.toGenerateGlobal - | werkstoff.getGenerationFeatures().toGenerate; + | werkstoff.getGenerationFeatures().toGenerate; } DebugLog.log("GlobalGeneration: " + WerkstoffLoader.toGenerateGlobal); if ((WerkstoffLoader.toGenerateGlobal & 0b1) != 0) { @@ -1700,7 +1883,7 @@ public class WerkstoffLoader { if ((WerkstoffLoader.toGenerateGlobal & 0b1000000) != 0) { WerkstoffLoader.items.put(OrePrefixes.cellMolten, new BW_MetaGenerated_Items(OrePrefixes.cellMolten)); if (Forestry.isModLoaded()) WerkstoffLoader.items - .put(OrePrefixes.capsuleMolten, new BW_MetaGenerated_Items(OrePrefixes.capsuleMolten)); + .put(OrePrefixes.capsuleMolten, new BW_MetaGenerated_Items(OrePrefixes.capsuleMolten)); } if ((WerkstoffLoader.toGenerateGlobal & 0b10000000) != 0) { WerkstoffLoader.items.put(plate, new BW_MetaGenerated_Items(plate)); @@ -1747,41 +1930,40 @@ public class WerkstoffLoader { GameRegistry.registerTileEntity(BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmallTE"); GameRegistry.registerTileEntity(BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblockTE"); GameRegistry.registerTileEntity(BW_MetaGeneratedBlocks_Casing_TE.class, "bw.werkstoffblockcasingTE"); - GameRegistry.registerTileEntity( - BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, - "bw.werkstoffblockscasingadvancedTE"); + GameRegistry + .registerTileEntity(BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, "bw.werkstoffblockscasingadvancedTE"); WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); WerkstoffLoader.BWSmallOres = new BW_MetaGenerated_SmallOres( - Material.rock, - BW_MetaGeneratedSmallOreTE.class, - "bw.blockoresSmall"); + Material.rock, + BW_MetaGeneratedSmallOreTE.class, + "bw.blockoresSmall"); WerkstoffLoader.BWBlocks = new BW_MetaGenerated_WerkstoffBlocks( - Material.iron, - BW_MetaGenerated_WerkstoffBlock_TE.class, - "bw.werkstoffblocks"); + Material.iron, + BW_MetaGenerated_WerkstoffBlock_TE.class, + "bw.werkstoffblocks"); WerkstoffLoader.BWBlockCasings = new BW_MetaGeneratedBlocks_Casing( - Material.iron, - BW_MetaGeneratedBlocks_Casing_TE.class, - "bw.werkstoffblockscasing", - OrePrefixes.blockCasing); + Material.iron, + BW_MetaGeneratedBlocks_Casing_TE.class, + "bw.werkstoffblockscasing", + OrePrefixes.blockCasing); WerkstoffLoader.BWBlockCasingsAdvanced = new BW_MetaGeneratedBlocks_Casing( - Material.iron, - BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, - "bw.werkstoffblockscasingadvanced", - OrePrefixes.blockCasingAdvanced); + Material.iron, + BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, + "bw.werkstoffblockscasingadvanced", + OrePrefixes.blockCasingAdvanced); GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.01"); GameRegistry.registerBlock(WerkstoffLoader.BWSmallOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.02"); GameRegistry.registerBlock(WerkstoffLoader.BWBlocks, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblocks.01"); if (!ConfigHandler.disableBoltedBlocksCasing) GameRegistry.registerBlock( - WerkstoffLoader.BWBlockCasings, - BW_MetaGeneratedBlock_Item.class, - "bw.werkstoffblockscasing.01"); + WerkstoffLoader.BWBlockCasings, + BW_MetaGeneratedBlock_Item.class, + "bw.werkstoffblockscasing.01"); if (!ConfigHandler.disableReboltedBlocksCasing) GameRegistry.registerBlock( - WerkstoffLoader.BWBlockCasingsAdvanced, - BW_MetaGeneratedBlock_Item.class, - "bw.werkstoffblockscasingadvanced.01"); + WerkstoffLoader.BWBlockCasingsAdvanced, + BW_MetaGeneratedBlock_Item.class, + "bw.werkstoffblockscasingadvanced.01"); GTMetaItemEnhancer.addAdditionalOreDictToForestry(); GTMetaItemEnhancer.init(); @@ -1789,7 +1971,7 @@ public class WerkstoffLoader { private static void runGTItemDataRegistrator() { IWerkstoffRunnable[] registrations = { new BridgeMaterialsLoader(), new AssociationLoader(), - new CasingRegistrator() }; + new CasingRegistrator() }; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { for (IWerkstoffRunnable registration : registrations) { registration.run(werkstoff); @@ -1800,27 +1982,24 @@ public class WerkstoffLoader { } public static void addVanillaCasingsToGTOreDictUnificator() { - GT_OreDictUnificator.addAssociation( - OrePrefixes.blockCasing, - Materials.Aluminium, - ItemList.Casing_FrostProof.get(1L), - false); GT_OreDictUnificator - .addAssociation(OrePrefixes.blockCasing, Materials.Nickel, ItemList.Casing_HeatProof.get(1L), false); + .addAssociation(OrePrefixes.blockCasing, Materials.Aluminium, ItemList.Casing_FrostProof.get(1L), false); GT_OreDictUnificator - .addAssociation(OrePrefixes.blockCasing, Materials.Lead, ItemList.Casing_RadiationProof.get(1L), false); + .addAssociation(OrePrefixes.blockCasing, Materials.Nickel, ItemList.Casing_HeatProof.get(1L), false); GT_OreDictUnificator - .addAssociation(OrePrefixes.blockCasing, Materials.Steel, ItemList.Casing_SolidSteel.get(1L), false); + .addAssociation(OrePrefixes.blockCasing, Materials.Lead, ItemList.Casing_RadiationProof.get(1L), false); + GT_OreDictUnificator + .addAssociation(OrePrefixes.blockCasing, Materials.Steel, ItemList.Casing_SolidSteel.get(1L), false); GT_OreDictUnificator.addAssociation( - OrePrefixes.blockCasing, - Materials.TungstenSteel, - ItemList.Casing_RobustTungstenSteel.get(1L), - false); + OrePrefixes.blockCasing, + Materials.TungstenSteel, + ItemList.Casing_RobustTungstenSteel.get(1L), + false); GT_OreDictUnificator.addAssociation( - OrePrefixes.blockCasing, - Materials.Polytetrafluoroethylene, - ItemList.Casing_Chemically_Inert.get(1L), - false); + OrePrefixes.blockCasing, + Materials.Polytetrafluoroethylene, + ItemList.Casing_Chemically_Inert.get(1L), + false); } /** @@ -1861,7 +2040,8 @@ public class WerkstoffLoader { public static void removeIC2Recipes() { try { Set> remset = new HashSet<>(); - for (Map.Entry curr : Recipes.macerator.getRecipes().entrySet()) { + for (Map.Entry curr : Recipes.macerator.getRecipes() + .entrySet()) { if (curr.getKey() instanceof RecipeInputOreDict) { if ("oreNULL".equalsIgnoreCase(((RecipeInputOreDict) curr.getKey()).input)) { remset.add(curr); @@ -1871,7 +2051,9 @@ public class WerkstoffLoader { } } } - Recipes.macerator.getRecipes().entrySet().removeAll(remset); + Recipes.macerator.getRecipes() + .entrySet() + .removeAll(remset); } catch (Exception e) { e.printStackTrace(); } @@ -1882,24 +2064,27 @@ public class WerkstoffLoader { if (werkstoff.hasItemType(ore)) { GT_OreDictUnificator.registerOre(ore + werkstoff.getVarName(), werkstoff.get(ore)); GT_OreDictUnificator.registerOre(oreSmall + werkstoff.getVarName(), werkstoff.get(oreSmall)); - werkstoff.getADDITIONAL_OREDICT().forEach(e -> OreDictionary.registerOre(ore + e, werkstoff.get(ore))); werkstoff.getADDITIONAL_OREDICT() - .forEach(e -> OreDictionary.registerOre(oreSmall + e, werkstoff.get(oreSmall))); + .forEach(e -> OreDictionary.registerOre(ore + e, werkstoff.get(ore))); + werkstoff.getADDITIONAL_OREDICT() + .forEach(e -> OreDictionary.registerOre(oreSmall + e, werkstoff.get(oreSmall))); } if (werkstoff.hasItemType(gem)) OreDictionary.registerOre( - "craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), - werkstoff.get(lens)); + "craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), + werkstoff.get(lens)); if (werkstoff.hasItemType(gem) || werkstoff.hasItemType(ingot)) { GT_OreDictUnificator.registerOre(block + werkstoff.getVarName(), werkstoff.get(block)); werkstoff.getADDITIONAL_OREDICT() - .forEach(e -> OreDictionary.registerOre(block + e, werkstoff.get(block))); + .forEach(e -> OreDictionary.registerOre(block + e, werkstoff.get(block))); } - werkstoff.getADDITIONAL_OREDICT().forEach( - s -> ENABLED_ORE_PREFIXES.stream().filter(o -> Objects.nonNull(werkstoff.get(o))) - .forEach(od -> OreDictionary.registerOre(od + s, werkstoff.get(od)))); + werkstoff.getADDITIONAL_OREDICT() + .forEach( + s -> ENABLED_ORE_PREFIXES.stream() + .filter(o -> Objects.nonNull(werkstoff.get(o))) + .forEach(od -> OreDictionary.registerOre(od + s, werkstoff.get(od)))); } GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java index 5d1644ae2b..c31013eb78 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AddSomeRecipes.java @@ -33,52 +33,64 @@ public class AddSomeRecipes implements Runnable { public void run() { - GT_Values.RA.stdBuilder().itemInputs(BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1)) - .itemOutputs( - WerkstoffLoader.Zirconium.get(dust), - WerkstoffLoader.Zirconium.get(dust), - WerkstoffLoader.Tiberium.get(dustSmall, 2), - WerkstoffLoader.Zirconium.get(dust, 2), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 8L), - GT_OreDictUnificator.get(dust, Materials.Platinum, 1L)) - .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00) - .fluidOutputs(WerkstoffLoader.Xenon.getFluidOrGas(1)).duration(12 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_EV).addTo(centrifugeRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1)) + .itemOutputs( + WerkstoffLoader.Zirconium.get(dust), + WerkstoffLoader.Zirconium.get(dust), + WerkstoffLoader.Tiberium.get(dustSmall, 2), + WerkstoffLoader.Zirconium.get(dust, 2), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 8L), + GT_OreDictUnificator.get(dust, Materials.Platinum, 1L)) + .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00) + .fluidOutputs(WerkstoffLoader.Xenon.getFluidOrGas(1)) + .duration(12 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_EV) + .addTo(centrifugeRecipes); - GT_Values.RA.stdBuilder().itemInputs(BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1)) - .itemOutputs( - WerkstoffLoader.Zirconium.get(dust, 2), - WerkstoffLoader.Zirconium.get(dust, 2), - WerkstoffLoader.Tiberium.get(dust), - WerkstoffLoader.Zirconium.get(dust, 4), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 18L), - GT_OreDictUnificator.get(dust, Materials.Platinum, 2L)) - .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00) - .fluidOutputs(WerkstoffLoader.Xenon.getFluidOrGas(2)).duration(12 * SECONDS + 10 * TICKS) - .eut(TierEU.RECIPE_EV).addTo(centrifugeRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1)) + .itemOutputs( + WerkstoffLoader.Zirconium.get(dust, 2), + WerkstoffLoader.Zirconium.get(dust, 2), + WerkstoffLoader.Tiberium.get(dust), + WerkstoffLoader.Zirconium.get(dust, 4), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 18L), + GT_OreDictUnificator.get(dust, Materials.Platinum, 2L)) + .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00) + .fluidOutputs(WerkstoffLoader.Xenon.getFluidOrGas(2)) + .duration(12 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_EV) + .addTo(centrifugeRecipes); - GT_Values.RA.stdBuilder().itemInputs(BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1)) - .itemOutputs( - WerkstoffLoader.Zirconium.get(dust, 4), - WerkstoffLoader.Zirconium.get(dust, 4), - WerkstoffLoader.Tiberium.get(dust, 2), - WerkstoffLoader.Zirconium.get(dust, 8), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 38L), - GT_OreDictUnificator.get(dust, Materials.Platinum, 4L)) - .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00) - .fluidOutputs(WerkstoffLoader.Xenon.getFluidOrGas(4)).duration(50 * SECONDS).eut(TierEU.RECIPE_EV) - .addTo(centrifugeRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1)) + .itemOutputs( + WerkstoffLoader.Zirconium.get(dust, 4), + WerkstoffLoader.Zirconium.get(dust, 4), + WerkstoffLoader.Tiberium.get(dust, 2), + WerkstoffLoader.Zirconium.get(dust, 8), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 38L), + GT_OreDictUnificator.get(dust, Materials.Platinum, 4L)) + .outputChances(100_00, 50_00, 50_00, 25_00, 100_00, 100_00) + .fluidOutputs(WerkstoffLoader.Xenon.getFluidOrGas(4)) + .duration(50 * SECONDS) + .eut(TierEU.RECIPE_EV) + .addTo(centrifugeRecipes); - GT_Values.RA.stdBuilder().itemInputs(BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1)) - .itemOutputs( - ItemList.Depleted_Naquadah_4.get(8), - WerkstoffLoader.Zirconium.get(dust, 64), - WerkstoffLoader.Zirconium.get(dust, 64), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), - GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 48L)) - .outputChances(100_00, 50_00, 50_00, 100_00, 100_00, 100_00).duration(1 * MINUTES + 40 * SECONDS) - .eut(TierEU.RECIPE_IV).addTo(centrifugeRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1)) + .itemOutputs( + ItemList.Depleted_Naquadah_4.get(8), + WerkstoffLoader.Zirconium.get(dust, 64), + WerkstoffLoader.Zirconium.get(dust, 64), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 48L)) + .outputChances(100_00, 50_00, 50_00, 100_00, 100_00, 100_00) + .duration(1 * MINUTES + 40 * SECONDS) + .eut(TierEU.RECIPE_IV) + .addTo(centrifugeRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index d08ae368bf..3638536ca6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -83,26 +83,28 @@ public class AdditionalRecipes { if (ConfigHandler.BioLab) { FluidStack[] dnaFluid = { Gendustry.isModLoaded() ? FluidRegistry.getFluidStack("liquiddna", 1000) - : Materials.Biomass.getFluid(1000L) }; + : Materials.Biomass.getFluid(1000L) }; for (ItemStack stack : BioItemList.getAllPetriDishes()) { - BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); + BioData DNA = BioData.getBioDataFromNBTTag( + stack.getTagCompound() + .getCompoundTag("DNA")); if (DNA != null) { ItemStack Detergent = BioItemList.getOther(1); ItemStack DNAFlask = BioItemList.getDNASampleFlask(null); ItemStack EthanolCell = Materials.Ethanol.getCells(1); BartWorksRecipeMaps.bioLabRecipes.addFakeRecipe( - false, - new ItemStack[] { stack, DNAFlask, Detergent, EthanolCell }, - new ItemStack[] { BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(DNA)), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L) }, - BioItemList.mBioLabParts[0], - new int[] { DNA.getChance(), 10000 }, - new FluidStack[] { FluidRegistry.getFluidStack("ic2distilledwater", 1000) }, - null, - 500, - BW_Util.getMachineVoltageFromTier(3 + DNA.getTier()), - BW_Util.STANDART); + false, + new ItemStack[] { stack, DNAFlask, Detergent, EthanolCell }, + new ItemStack[] { BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(DNA)), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L) }, + BioItemList.mBioLabParts[0], + new int[] { DNA.getChance(), 10000 }, + new FluidStack[] { FluidRegistry.getFluidStack("ic2distilledwater", 1000) }, + null, + 500, + BW_Util.getMachineVoltageFromTier(3 + DNA.getTier()), + BW_Util.STANDART); } } @@ -115,17 +117,17 @@ public class AdditionalRecipes { Behaviour_DataOrb.setDataName(Outp, DNA.getName()); BartWorksRecipeMaps.bioLabRecipes.addFakeRecipe( - false, - new ItemStack[] { stack, FluidLoader.BioLabFluidCells[0], FluidLoader.BioLabFluidCells[3], - ItemList.Tool_DataOrb.get(1L) }, - new ItemStack[] { Outp, ItemList.Cell_Empty.get(2L) }, - BioItemList.mBioLabParts[1], - new int[] { DNA.getChance(), 10000 }, - dnaFluid, - null, - 500, - BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), - BW_Util.STANDART); + false, + new ItemStack[] { stack, FluidLoader.BioLabFluidCells[0], FluidLoader.BioLabFluidCells[3], + ItemList.Tool_DataOrb.get(1L) }, + new ItemStack[] { Outp, ItemList.Cell_Empty.get(2L) }, + BioItemList.mBioLabParts[1], + new int[] { DNA.getChance(), 10000 }, + dnaFluid, + null, + 500, + BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), + BW_Util.STANDART); } } @@ -141,37 +143,41 @@ public class AdditionalRecipes { Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); BartWorksRecipeMaps.bioLabRecipes.addFakeRecipe( - false, - new ItemStack[] { FluidLoader.BioLabFluidCells[1], BioItemList.getPlasmidCell(null), inp, - inp2 }, - new ItemStack[] { stack, ItemList.Cell_Empty.get(1L) }, - BioItemList.mBioLabParts[2], - new int[] { DNA.getChance(), 10000 }, - dnaFluid, - null, - 500, - BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), - BW_Util.STANDART); + false, + new ItemStack[] { FluidLoader.BioLabFluidCells[1], BioItemList.getPlasmidCell(null), inp, + inp2 }, + new ItemStack[] { stack, ItemList.Cell_Empty.get(1L) }, + BioItemList.mBioLabParts[2], + new int[] { DNA.getChance(), 10000 }, + dnaFluid, + null, + 500, + BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), + BW_Util.STANDART); } } for (ItemStack stack : BioItemList.getAllPetriDishes()) { - BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); - BioData Plasmid = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("Plasmid")); + BioData DNA = BioData.getBioDataFromNBTTag( + stack.getTagCompound() + .getCompoundTag("DNA")); + BioData Plasmid = BioData.getBioDataFromNBTTag( + stack.getTagCompound() + .getCompoundTag("Plasmid")); if (!Objects.equals(DNA.getName(), Plasmid.getName())) { BartWorksRecipeMaps.bioLabRecipes.addFakeRecipe( - true, - new ItemStack[] { BioItemList.getPetriDish(BioCulture.getBioCulture(DNA.getName())), - BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(Plasmid)), - FluidLoader.BioLabFluidCells[2], }, - new ItemStack[] { stack, ItemList.Cell_Empty.get(1L) }, - BioItemList.mBioLabParts[3], - new int[] { Plasmid.getChance(), 10000 }, - new FluidStack[] { FluidRegistry.getFluidStack("ic2distilledwater", 1000) }, - null, - 500, - (int) TierEU.RECIPE_LuV, - BW_Util.STANDART); + true, + new ItemStack[] { BioItemList.getPetriDish(BioCulture.getBioCulture(DNA.getName())), + BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(Plasmid)), + FluidLoader.BioLabFluidCells[2], }, + new ItemStack[] { stack, ItemList.Cell_Empty.get(1L) }, + BioItemList.mBioLabParts[3], + new int[] { Plasmid.getChance(), 10000 }, + new FluidStack[] { FluidRegistry.getFluidStack("ic2distilledwater", 1000) }, + null, + 500, + (int) TierEU.RECIPE_LuV, + BW_Util.STANDART); } } @@ -180,452 +186,485 @@ public class AdditionalRecipes { Behaviour_DataOrb.setDataName(Outp, "Any DNA"); // Clonal Cellular Synthesis- [Liquid DNA] + Medium Petri Dish + Plasma Membrane + Stem Cells + Genome Data BartWorksRecipeMaps.bioLabRecipes.addFakeRecipe( - false, - new ItemStack[] { BioItemList.getPetriDish(null), BioItemList.getOther(4), - ItemList.Circuit_Chip_Stemcell.get(2L), Outp }, - new ItemStack[] { - BioItemList.getPetriDish(null).setStackDisplayName("The Culture made from DNA"), }, - BioItemList.mBioLabParts[4], - new int[] { 7500, 10000 }, - new FluidStack[] { new FluidStack(dnaFluid[0].getFluid(), 8000) }, - null, - 500, - (int) TierEU.RECIPE_LuV, - BW_Util.STANDART); + false, + new ItemStack[] { BioItemList.getPetriDish(null), BioItemList.getOther(4), + ItemList.Circuit_Chip_Stemcell.get(2L), Outp }, + new ItemStack[] { BioItemList.getPetriDish(null) + .setStackDisplayName("The Culture made from DNA"), }, + BioItemList.mBioLabParts[4], + new int[] { 7500, 10000 }, + new FluidStack[] { new FluidStack(dnaFluid[0].getFluid(), 8000) }, + null, + 500, + (int) TierEU.RECIPE_LuV, + BW_Util.STANDART); FluidStack[] easyFluids = { Materials.Water.getFluid(1000L), - FluidRegistry.getFluidStack("ic2distilledwater", 1000) }; + FluidRegistry.getFluidStack("ic2distilledwater", 1000) }; for (FluidStack fluidStack : easyFluids) { for (BioCulture bioCulture : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (bioCulture.isBreedable() && bioCulture.getTier() == 0) { BartWorksRecipeMaps.bacterialVatRecipes.addRecipe( - // boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, - // int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, - // int aEUt, int aSpecialValue - new GT_Recipe( - true, - new ItemStack[] { GT_Utility.getIntegratedCircuit(1), - new ItemStack(Items.sugar, 64) }, - null, - BioItemList.getPetriDish(bioCulture), - null, - new FluidStack[] { fluidStack }, - new FluidStack[] { new FluidStack(bioCulture.getFluid(), 10) }, - 1000, - (int) TierEU.RECIPE_HV, - BW_Util.STANDART)); + // boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, + // int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, + // int aEUt, int aSpecialValue + new GT_Recipe( + true, + new ItemStack[] { GT_Utility.getIntegratedCircuit(1), new ItemStack(Items.sugar, 64) }, + null, + BioItemList.getPetriDish(bioCulture), + null, + new FluidStack[] { fluidStack }, + new FluidStack[] { new FluidStack(bioCulture.getFluid(), 10) }, + 1000, + (int) TierEU.RECIPE_HV, + BW_Util.STANDART)); // aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, // aDuration, aEUt, aSpecialValue BartWorksRecipeMaps.bioLabRecipes.addRecipe( - new GT_Recipe( - false, - new ItemStack[] { BioItemList.getPetriDish(null), - fluidStack.equals(Materials.Water.getFluid(1000L)) - ? Materials.Water.getCells(1) - : GT_Utility.getContainersFromFluid( - GT_ModHandler.getDistilledWater(1000)).get(0) }, - new ItemStack[] { BioItemList.getPetriDish(bioCulture), - Materials.Empty.getCells(1) }, - null, - new int[] { bioCulture.getChance(), 10000 }, - new FluidStack[] { new FluidStack(bioCulture.getFluid(), 1000) }, - null, - 500, - (int) TierEU.RECIPE_HV, - BW_Util.STANDART)); + new GT_Recipe( + false, + new ItemStack[] { BioItemList.getPetriDish(null), + fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Water.getCells(1) + : GT_Utility.getContainersFromFluid(GT_ModHandler.getDistilledWater(1000)) + .get(0) }, + new ItemStack[] { BioItemList.getPetriDish(bioCulture), Materials.Empty.getCells(1) }, + null, + new int[] { bioCulture.getChance(), 10000 }, + new FluidStack[] { new FluidStack(bioCulture.getFluid(), 1000) }, + null, + 500, + (int) TierEU.RECIPE_HV, + BW_Util.STANDART)); } } } } List> liquidFuels = Arrays.asList( - ImmutablePair.of(Materials.PhosphoricAcid, 36), - ImmutablePair.of(Materials.DilutedHydrochloricAcid, 14), - ImmutablePair.of(Materials.HypochlorousAcid, 30), - ImmutablePair.of(Materials.HydrofluoricAcid, 40), - ImmutablePair.of(Materials.HydrochloricAcid, 28), - ImmutablePair.of(Materials.NitricAcid, 24), - ImmutablePair.of(Materials.Mercury, 32), - ImmutablePair.of(Materials.DilutedSulfuricAcid, 9), - ImmutablePair.of(Materials.SulfuricAcid, 18), - ImmutablePair.of(Materials.AceticAcid, 11), - ImmutablePair.of(WerkstoffLoader.FormicAcid.getBridgeMaterial(), 40)); + ImmutablePair.of(Materials.PhosphoricAcid, 36), + ImmutablePair.of(Materials.DilutedHydrochloricAcid, 14), + ImmutablePair.of(Materials.HypochlorousAcid, 30), + ImmutablePair.of(Materials.HydrofluoricAcid, 40), + ImmutablePair.of(Materials.HydrochloricAcid, 28), + ImmutablePair.of(Materials.NitricAcid, 24), + ImmutablePair.of(Materials.Mercury, 32), + ImmutablePair.of(Materials.DilutedSulfuricAcid, 9), + ImmutablePair.of(Materials.SulfuricAcid, 18), + ImmutablePair.of(Materials.AceticAcid, 11), + ImmutablePair.of(WerkstoffLoader.FormicAcid.getBridgeMaterial(), 40)); for (Pair fuel : liquidFuels) { - GT_Values.RA.stdBuilder().itemInputs(fuel.getLeft().getCells(1)).itemOutputs(Materials.Empty.getCells(1)) - .metadata(GT_RecipeConstants.FUEL_VALUE, fuel.getRight()).addTo(BartWorksRecipeMaps.acidGenFuels); - } - GT_Values.RA.stdBuilder().itemInputs(GT_OreDictUnificator.get(OrePrefixes.cellMolten, Materials.Redstone, 1)) - .itemOutputs(Materials.Empty.getCells(1)).metadata(GT_RecipeConstants.FUEL_VALUE, 10) + GT_Values.RA.stdBuilder() + .itemInputs( + fuel.getLeft() + .getCells(1)) + .itemOutputs(Materials.Empty.getCells(1)) + .metadata(GT_RecipeConstants.FUEL_VALUE, fuel.getRight()) .addTo(BartWorksRecipeMaps.acidGenFuels); + } + GT_Values.RA.stdBuilder() + .itemInputs(GT_OreDictUnificator.get(OrePrefixes.cellMolten, Materials.Redstone, 1)) + .itemOutputs(Materials.Empty.getCells(1)) + .metadata(GT_RecipeConstants.FUEL_VALUE, 10) + .addTo(BartWorksRecipeMaps.acidGenFuels); } @SuppressWarnings("deprecation") public static void run() { runBWRecipes(); GT_Values.RA.addImplosionRecipe( - WerkstoffLoader.RawAdemicSteel.get(dust), - 4, - WerkstoffLoader.AdemicSteel.get(dust), - null); + WerkstoffLoader.RawAdemicSteel.get(dust), + 4, + WerkstoffLoader.AdemicSteel.get(dust), + null); // Thorium/Yttrium Glas GT_Values.RA.addBlastRecipe( - WerkstoffLoader.YttriumOxide.get(dustSmall, 2), - WerkstoffLoader.Thorianit.get(dustSmall, 2), - Materials.Glass.getMolten(144), - null, - new ItemStack(ItemRegistry.bw_glasses[0], 1, 12), - null, - 800, - (int) TierEU.RECIPE_IV, - 3663); + WerkstoffLoader.YttriumOxide.get(dustSmall, 2), + WerkstoffLoader.Thorianit.get(dustSmall, 2), + Materials.Glass.getMolten(144), + null, + new ItemStack(ItemRegistry.bw_glasses[0], 1, 12), + null, + 800, + (int) TierEU.RECIPE_IV, + 3663); // Thorianite recipes - GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.Thorianit.get(crushedPurified)) - .itemOutputs( - WerkstoffLoader.Thorianit.get(dust), - WerkstoffLoader.Thorianit.get(dust), - WerkstoffLoader.Thorianit.get(dust), - Materials.Thorium.getDust(1), - Materials.Thorium.getDust(1), - WerkstoffLoader.Thorium232.get(dust)) - .outputChances(7000, 1300, 700, 600, 300, 100).duration(20 * SECONDS).eut((int) TierEU.RECIPE_IV) - .addTo(sifterRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(WerkstoffLoader.Thorianit.get(crushedPurified)) + .itemOutputs( + WerkstoffLoader.Thorianit.get(dust), + WerkstoffLoader.Thorianit.get(dust), + WerkstoffLoader.Thorianit.get(dust), + Materials.Thorium.getDust(1), + Materials.Thorium.getDust(1), + WerkstoffLoader.Thorium232.get(dust)) + .outputChances(7000, 1300, 700, 600, 300, 100) + .duration(20 * SECONDS) + .eut((int) TierEU.RECIPE_IV) + .addTo(sifterRecipes); // 3ThO2 + 4Al = 3Th + 2Al2O3 GT_Values.RA.addChemicalRecipe( - WerkstoffLoader.Thorianit.get(dust, 9), - Materials.Aluminium.getDust(4), - null, - null, - Materials.Thorium.getDust(3), - Materials.Aluminiumoxide.getDust(10), - 1000); + WerkstoffLoader.Thorianit.get(dust, 9), + Materials.Aluminium.getDust(4), + null, + null, + Materials.Thorium.getDust(3), + Materials.Aluminiumoxide.getDust(10), + 1000); // ThO2 + 2Mg = Th + 2MgO GT_Values.RA.addChemicalRecipe( - WerkstoffLoader.Thorianit.get(dust, 3), - Materials.Magnesium.getDust(2), - null, - null, - Materials.Thorium.getDust(1), - Materials.Magnesia.getDust(4), - 1000); + WerkstoffLoader.Thorianit.get(dust, 3), + Materials.Magnesium.getDust(2), + null, + null, + Materials.Thorium.getDust(1), + Materials.Magnesia.getDust(4), + 1000); GT_Values.RA.addChemicalRecipe( - WerkstoffLoader.Thorianit.get(crushed), - ItemList.Crop_Drop_Thorium.get(9), - Materials.Water.getFluid(1000), - Materials.Thorium.getMolten(144), - WerkstoffLoader.Thorianit.get(crushedPurified, 4), - 96, - 24); + WerkstoffLoader.Thorianit.get(crushed), + ItemList.Crop_Drop_Thorium.get(9), + Materials.Water.getFluid(1000), + Materials.Thorium.getMolten(144), + WerkstoffLoader.Thorianit.get(crushedPurified, 4), + 96, + 24); // Prasiolite GT_Values.RA.addBlastRecipe( - GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), - Materials.Amethyst.getDust(10), - GT_Values.NF, - GT_Values.NF, - WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), - GT_Values.NI, - 800, - (int) TierEU.RECIPE_MV, - 500); - - GT_Values.RA.stdBuilder().itemInputs(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L)) - .itemOutputs(Materials.Amethyst.getDust(10)).duration(40 * SECONDS).eut(0).metadata(ADDITIVE_AMOUNT, 6) - .addTo(primitiveBlastRecipes); + GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), + Materials.Amethyst.getDust(10), + GT_Values.NF, + GT_Values.NF, + WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), + GT_Values.NI, + 800, + (int) TierEU.RECIPE_MV, + 500); + + GT_Values.RA.stdBuilder() + .itemInputs(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L)) + .itemOutputs(Materials.Amethyst.getDust(10)) + .duration(40 * SECONDS) + .eut(0) + .metadata(ADDITIVE_AMOUNT, 6) + .addTo(primitiveBlastRecipes); // Cubic Circonia // 2Y + 3O = Y2O3 GT_Values.RA.addChemicalRecipe( - Materials.Yttrium.getDust(2), - GT_Utility.getIntegratedCircuit(5), - Materials.Oxygen.getGas(3000), - GT_Values.NF, - WerkstoffLoader.YttriumOxide.get(dust, 5), - 4096, - (int) TierEU.RECIPE_LV); + Materials.Yttrium.getDust(2), + GT_Utility.getIntegratedCircuit(5), + Materials.Oxygen.getGas(3000), + GT_Values.NF, + WerkstoffLoader.YttriumOxide.get(dust, 5), + 4096, + (int) TierEU.RECIPE_LV); // Zr + 2O =Y22O3= ZrO2 RecipeMaps.blastFurnaceRecipes.addRecipe( - false, - new ItemStack[] { WerkstoffLoader.Zirconium.get(dust, 10), WerkstoffLoader.YttriumOxide.get(dust, 0) }, - new ItemStack[] { WerkstoffLoader.CubicZirconia.get(gemFlawed, 40) }, - null, - null, - new FluidStack[] { Materials.Oxygen.getGas(20000) }, - null, - 57600, - (int) TierEU.RECIPE_HV, - 2953); + false, + new ItemStack[] { WerkstoffLoader.Zirconium.get(dust, 10), WerkstoffLoader.YttriumOxide.get(dust, 0) }, + new ItemStack[] { WerkstoffLoader.CubicZirconia.get(gemFlawed, 40) }, + null, + null, + new FluidStack[] { Materials.Oxygen.getGas(20000) }, + null, + 57600, + (int) TierEU.RECIPE_HV, + 2953); // Tellurium GT_Values.RA.addBlastRecipe( - GT_OreDictUnificator.get(crushed, Materials.Lead, 10L), - GT_Utility.getIntegratedCircuit(17), - GT_Values.NF, - GT_Values.NF, - Materials.Lead.getIngots(10), - Materials.Tellurium.getNuggets(20), - 800, - (int) TierEU.RECIPE_MV, - 722); + GT_OreDictUnificator.get(crushed, Materials.Lead, 10L), + GT_Utility.getIntegratedCircuit(17), + GT_Values.NF, + GT_Values.NF, + Materials.Lead.getIngots(10), + Materials.Tellurium.getNuggets(20), + 800, + (int) TierEU.RECIPE_MV, + 722); GT_Values.RA.addFusionReactorRecipe( - Materials.Plutonium.getMolten(48), - Materials.Beryllium.getMolten(48), - WerkstoffLoader.Californium.getMolten(48), - 240, - 49152, - 480000000); + Materials.Plutonium.getMolten(48), + Materials.Beryllium.getMolten(48), + WerkstoffLoader.Californium.getMolten(48), + 240, + 49152, + 480000000); GT_Values.RA.addFusionReactorRecipe( - WerkstoffLoader.Californium.getMolten(32), - WerkstoffLoader.Calcium.getMolten(720), - WerkstoffLoader.Oganesson.getFluidOrGas(720), - 420, - 49152, - 600000000); + WerkstoffLoader.Californium.getMolten(32), + WerkstoffLoader.Calcium.getMolten(720), + WerkstoffLoader.Oganesson.getFluidOrGas(720), + 420, + 49152, + 600000000); GT_Values.RA.addDistillationTowerRecipe( - Materials.LiquidAir.getFluid(100000000), - new FluidStack[] { Materials.Nitrogen.getGas(78084000), Materials.Oxygen.getGas(20946000), - Materials.Argon.getGas(934000), Materials.CarbonDioxide.getGas(40700), - WerkstoffLoader.Neon.getFluidOrGas(1818), Materials.Helium.getGas(524), - Materials.Methane.getGas(180), WerkstoffLoader.Krypton.getFluidOrGas(114), - Materials.Hydrogen.getGas(55), WerkstoffLoader.Xenon.getFluidOrGas(9) }, - null, - 7500, - (int) TierEU.RECIPE_EV); - - GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.MagnetoResonaticDust.get(dust)) - .itemOutputs(WerkstoffLoader.MagnetoResonaticDust.get(gemChipped, 9)).outputChances(90_00) - .fluidInputs(WerkstoffLoader.Neon.getFluidOrGas(1000)).duration(3 * MINUTES + 45 * SECONDS) - .eut(TierEU.RECIPE_IV).addTo(autoclaveRecipes); - - GT_Values.RA.stdBuilder().itemInputs(WerkstoffLoader.MagnetoResonaticDust.get(dust)) - .itemOutputs(WerkstoffLoader.MagnetoResonaticDust.get(gem)) - .fluidInputs(WerkstoffLoader.Krypton.getFluidOrGas(1000)).duration(3 * MINUTES + 45 * SECONDS) - .eut(TierEU.RECIPE_IV).addTo(autoclaveRecipes); + Materials.LiquidAir.getFluid(100000000), + new FluidStack[] { Materials.Nitrogen.getGas(78084000), Materials.Oxygen.getGas(20946000), + Materials.Argon.getGas(934000), Materials.CarbonDioxide.getGas(40700), + WerkstoffLoader.Neon.getFluidOrGas(1818), Materials.Helium.getGas(524), Materials.Methane.getGas(180), + WerkstoffLoader.Krypton.getFluidOrGas(114), Materials.Hydrogen.getGas(55), + WerkstoffLoader.Xenon.getFluidOrGas(9) }, + null, + 7500, + (int) TierEU.RECIPE_EV); + + GT_Values.RA.stdBuilder() + .itemInputs(WerkstoffLoader.MagnetoResonaticDust.get(dust)) + .itemOutputs(WerkstoffLoader.MagnetoResonaticDust.get(gemChipped, 9)) + .outputChances(90_00) + .fluidInputs(WerkstoffLoader.Neon.getFluidOrGas(1000)) + .duration(3 * MINUTES + 45 * SECONDS) + .eut(TierEU.RECIPE_IV) + .addTo(autoclaveRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(WerkstoffLoader.MagnetoResonaticDust.get(dust)) + .itemOutputs(WerkstoffLoader.MagnetoResonaticDust.get(gem)) + .fluidInputs(WerkstoffLoader.Krypton.getFluidOrGas(1000)) + .duration(3 * MINUTES + 45 * SECONDS) + .eut(TierEU.RECIPE_IV) + .addTo(autoclaveRecipes); // Milk - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(1)) - .itemOutputs( - Materials.Sugar.getDustSmall(21), - Materials.Calcium.getDustTiny(1), - Materials.Magnesium.getDustTiny(1), - Materials.Potassium.getDustTiny(1), - Materials.Sodium.getDustTiny(4), - Materials.Phosphor.getDustTiny(1)) - .outputChances(100_00, 100_00, 10_00, 100_00, 10_00, 10_00).fluidInputs(Materials.Milk.getFluid(10000)) - .fluidOutputs(Materials.Water.getFluid(8832)).duration(2 * SECONDS + 10 * TICKS).eut(TierEU.RECIPE_MV) - .addTo(centrifugeRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.getIntegratedCircuit(1)) + .itemOutputs( + Materials.Sugar.getDustSmall(21), + Materials.Calcium.getDustTiny(1), + Materials.Magnesium.getDustTiny(1), + Materials.Potassium.getDustTiny(1), + Materials.Sodium.getDustTiny(4), + Materials.Phosphor.getDustTiny(1)) + .outputChances(100_00, 100_00, 10_00, 100_00, 10_00, 10_00) + .fluidInputs(Materials.Milk.getFluid(10000)) + .fluidOutputs(Materials.Water.getFluid(8832)) + .duration(2 * SECONDS + 10 * TICKS) + .eut(TierEU.RECIPE_MV) + .addTo(centrifugeRecipes); // Magneto Resonatic Circuits Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null - ? FluidRegistry.getFluid("molten.indalloy140") - : FluidRegistry.getFluid("molten.solderingalloy"); + ? FluidRegistry.getFluid("molten.indalloy140") + : FluidRegistry.getFluid("molten.solderingalloy"); Fluid solderUEV = FluidRegistry.getFluid("molten.mutatedlivingsolder") != null - ? FluidRegistry.getFluid("molten.mutatedlivingsolder") - : FluidRegistry.getFluid("molten.solderingalloy"); + ? FluidRegistry.getFluid("molten.mutatedlivingsolder") + : FluidRegistry.getFluid("molten.solderingalloy"); // ULV RecipeMaps.circuitAssemblerRecipes.add( - new GT_Recipe( - false, - new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gem), ItemList.NandChip.get(1), - ItemList.Circuit_Parts_DiodeSMD.get(4), ItemList.Circuit_Parts_CapacitorSMD.get(4), - ItemList.Circuit_Parts_TransistorSMD.get(4) }, - new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(4) }, - null, - null, - new FluidStack[] { Materials.SolderingAlloy.getMolten(36) }, - null, - 750, - (int) TierEU.RECIPE_LV, - CLEANROOM)); + new GT_Recipe( + false, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS() + .getStack(3), WerkstoffLoader.MagnetoResonaticDust.get(gem), ItemList.NandChip.get(1), + ItemList.Circuit_Parts_DiodeSMD.get(4), ItemList.Circuit_Parts_CapacitorSMD.get(4), + ItemList.Circuit_Parts_TransistorSMD.get(4) }, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS() + .getStack(4) }, + null, + null, + new FluidStack[] { Materials.SolderingAlloy.getMolten(36) }, + null, + 750, + (int) TierEU.RECIPE_LV, + CLEANROOM)); // LV-EV for (int i = 1; i <= 4; i++) { RecipeMaps.circuitAssemblerRecipes.add( - new GT_Recipe( - false, - new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gem), - BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), - ItemList.Circuit_Parts_DiodeSMD.get((i + 1) * 4), - ItemList.Circuit_Parts_CapacitorSMD.get((i + 1) * 4), - ItemList.Circuit_Parts_TransistorSMD.get((i + 1) * 4) }, - new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4) }, - null, - null, - new FluidStack[] { Materials.SolderingAlloy.getMolten((i + 1) * 36) }, - null, - (i + 1) * 750, - BW_Util.getMachineVoltageFromTier(i + 1), - CLEANROOM)); + new GT_Recipe( + false, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS() + .getStack(3), WerkstoffLoader.MagnetoResonaticDust.get(gem), + BW_Meta_Items.getNEWCIRCUITS() + .getStack(i + 3), + ItemList.Circuit_Parts_DiodeSMD.get((i + 1) * 4), + ItemList.Circuit_Parts_CapacitorSMD.get((i + 1) * 4), + ItemList.Circuit_Parts_TransistorSMD.get((i + 1) * 4) }, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS() + .getStack(i + 4) }, + null, + null, + new FluidStack[] { Materials.SolderingAlloy.getMolten((i + 1) * 36) }, + null, + (i + 1) * 750, + BW_Util.getMachineVoltageFromTier(i + 1), + CLEANROOM)); } // IV-LuV for (int i = 5; i <= 6; i++) { RecipeMaps.circuitAssemblerRecipes.add( - new GT_Recipe( - false, - new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gem), - BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), - ItemList.Circuit_Parts_DiodeASMD.get((i + 1) * 4), - ItemList.Circuit_Parts_CapacitorASMD.get((i + 1) * 4), - ItemList.Circuit_Parts_TransistorASMD.get((i + 1) * 4) }, - new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4) }, - null, - null, - new FluidStack[] { new FluidStack(solderIndalloy, (i + 1) * 36) }, - null, - (i + 1) * 750, - BW_Util.getMachineVoltageFromTier(i + 1), - CLEANROOM)); + new GT_Recipe( + false, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS() + .getStack(3), WerkstoffLoader.MagnetoResonaticDust.get(gem), + BW_Meta_Items.getNEWCIRCUITS() + .getStack(i + 3), + ItemList.Circuit_Parts_DiodeASMD.get((i + 1) * 4), + ItemList.Circuit_Parts_CapacitorASMD.get((i + 1) * 4), + ItemList.Circuit_Parts_TransistorASMD.get((i + 1) * 4) }, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS() + .getStack(i + 4) }, + null, + null, + new FluidStack[] { new FluidStack(solderIndalloy, (i + 1) * 36) }, + null, + (i + 1) * 750, + BW_Util.getMachineVoltageFromTier(i + 1), + CLEANROOM)); } // ZPM RecipeMaps.circuitAssemblerRecipes.add( - new GT_Recipe( - false, - new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, 1), - BW_Meta_Items.getNEWCIRCUITS().getStack(7 + 3), - ItemList.Circuit_Parts_DiodeASMD.get((7 + 6) * 4), - ItemList.Circuit_Parts_CapacitorASMD.get((7 + 6) * 4), - ItemList.Circuit_Parts_TransistorASMD.get((7 + 6) * 4) }, - new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(7 + 4) }, - null, - null, - new FluidStack[] { new FluidStack(solderIndalloy, (7 + 1) * 36) }, - null, - (7 + 1) * 1500, - BW_Util.getMachineVoltageFromTier(7 + 1), - CLEANROOM)); + new GT_Recipe( + false, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS() + .getStack(3), WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, 1), + BW_Meta_Items.getNEWCIRCUITS() + .getStack(7 + 3), + ItemList.Circuit_Parts_DiodeASMD.get((7 + 6) * 4), + ItemList.Circuit_Parts_CapacitorASMD.get((7 + 6) * 4), + ItemList.Circuit_Parts_TransistorASMD.get((7 + 6) * 4) }, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS() + .getStack(7 + 4) }, + null, + null, + new FluidStack[] { new FluidStack(solderIndalloy, (7 + 1) * 36) }, + null, + (7 + 1) * 1500, + BW_Util.getMachineVoltageFromTier(7 + 1), + CLEANROOM)); // UV RecipeMaps.circuitAssemblerRecipes.add( - new GT_Recipe( - false, - new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, 1), - BW_Meta_Items.getNEWCIRCUITS().getStack(8 + 3), - ItemList.Circuit_Parts_DiodeASMD.get((8 + 6) * 4), - ItemList.Circuit_Parts_CapacitorASMD.get((8 + 6) * 4), - ItemList.Circuit_Parts_TransistorASMD.get((8 + 6) * 4) }, - new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(8 + 4) }, - null, - null, - new FluidStack[] { new FluidStack(solderUEV, (8 + 1) * 36) }, - null, - (8 + 1) * 1500, - BW_Util.getMachineVoltageFromTier(8 + 1), - CLEANROOM)); + new GT_Recipe( + false, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS() + .getStack(3), WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, 1), + BW_Meta_Items.getNEWCIRCUITS() + .getStack(8 + 3), + ItemList.Circuit_Parts_DiodeASMD.get((8 + 6) * 4), + ItemList.Circuit_Parts_CapacitorASMD.get((8 + 6) * 4), + ItemList.Circuit_Parts_TransistorASMD.get((8 + 6) * 4) }, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS() + .getStack(8 + 4) }, + null, + null, + new FluidStack[] { new FluidStack(solderUEV, (8 + 1) * 36) }, + null, + (8 + 1) * 1500, + BW_Util.getMachineVoltageFromTier(8 + 1), + CLEANROOM)); // UHV-UEV for (int i = 9; i <= 10; i++) { RecipeMaps.circuitAssemblerRecipes.add( - new GT_Recipe( - false, - new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, 1), - BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), - ItemList.Circuit_Parts_DiodeXSMD.get((i + 6) * 4), - ItemList.Circuit_Parts_CapacitorXSMD.get((i + 6) * 4), - ItemList.Circuit_Parts_TransistorXSMD.get((i + 6) * 4) }, - new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4) }, - null, - null, - new FluidStack[] { new FluidStack(solderUEV, (i + 1) * 36) }, - null, - (i + 1) * 1500, - BW_Util.getMachineVoltageFromTier(i + 1), - CLEANROOM)); + new GT_Recipe( + false, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS() + .getStack(3), WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, 1), + BW_Meta_Items.getNEWCIRCUITS() + .getStack(i + 3), + ItemList.Circuit_Parts_DiodeXSMD.get((i + 6) * 4), + ItemList.Circuit_Parts_CapacitorXSMD.get((i + 6) * 4), + ItemList.Circuit_Parts_TransistorXSMD.get((i + 6) * 4) }, + new ItemStack[] { BW_Meta_Items.getNEWCIRCUITS() + .getStack(i + 4) }, + null, + null, + new FluidStack[] { new FluidStack(solderUEV, (i + 1) * 36) }, + null, + (i + 1) * 1500, + BW_Util.getMachineVoltageFromTier(i + 1), + CLEANROOM)); } RecipeMaps.smallNaquadahReactorFuels.addRecipe( - true, - new ItemStack[] { WerkstoffLoader.Tiberium.get(bolt) }, - new ItemStack[] {}, - null, - null, - null, - 0, - 0, - 12500); + true, + new ItemStack[] { WerkstoffLoader.Tiberium.get(bolt) }, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 12500); RecipeMaps.largeNaquadahReactorFuels.addRecipe( - true, - new ItemStack[] { WerkstoffLoader.Tiberium.get(stick) }, - new ItemStack[] {}, - null, - null, - null, - 0, - 0, - 62500); + true, + new ItemStack[] { WerkstoffLoader.Tiberium.get(stick) }, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 62500); RecipeMaps.hugeNaquadahReactorFuels.addRecipe( - true, - new ItemStack[] { WerkstoffLoader.Tiberium.get(stickLong) }, - new ItemStack[] {}, - null, - null, - null, - 0, - 0, - 125000); + true, + new ItemStack[] { WerkstoffLoader.Tiberium.get(stickLong) }, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 125000); RecipeMaps.extremeNaquadahReactorFuels.addRecipe( - true, - new ItemStack[] { WerkstoffLoader.Tiberium.get(stick) }, - new ItemStack[] {}, - null, - null, - null, - 0, - 0, - 31250); + true, + new ItemStack[] { WerkstoffLoader.Tiberium.get(stick) }, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 31250); RecipeMaps.ultraHugeNaquadahReactorFuels.addRecipe( - true, - new ItemStack[] { WerkstoffLoader.Tiberium.get(stickLong) }, - new ItemStack[] {}, - null, - null, - null, - 0, - 0, - 125000); + true, + new ItemStack[] { WerkstoffLoader.Tiberium.get(stickLong) }, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 125000); LoadItemContainers.run(); GT_Values.RA.addCannerRecipe( - ItemList.Large_Fluid_Cell_TungstenSteel.get(1L), - WerkstoffLoader.Tiberium.get(dust, 3), - BW_NonMeta_MaterialItems.TiberiumCell_1.get(1L), - null, - 30, - 16); + ItemList.Large_Fluid_Cell_TungstenSteel.get(1L), + WerkstoffLoader.Tiberium.get(dust, 3), + BW_NonMeta_MaterialItems.TiberiumCell_1.get(1L), + null, + 30, + 16); GT_Values.RA.addAssemblerRecipe( - BW_NonMeta_MaterialItems.TiberiumCell_1.get(2L), - GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), - BW_NonMeta_MaterialItems.TiberiumCell_2.get(1L), - 100, - 400); + BW_NonMeta_MaterialItems.TiberiumCell_1.get(2L), + GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), + BW_NonMeta_MaterialItems.TiberiumCell_2.get(1L), + 100, + 400); GT_Values.RA.addAssemblerRecipe( - BW_NonMeta_MaterialItems.TiberiumCell_1.get(4L), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 6L), - BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), - 150, - 400); + BW_NonMeta_MaterialItems.TiberiumCell_1.get(4L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 6L), + BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), + 150, + 400); GT_Values.RA.addAssemblerRecipe( - BW_NonMeta_MaterialItems.TiberiumCell_2.get(2L), - GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), - BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), - 100, - 400); + BW_NonMeta_MaterialItems.TiberiumCell_2.get(2L), + GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), + BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), + 100, + 400); GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { ItemList.NaquadahCell_1.get(32L), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), - WerkstoffLoader.Tiberium.get(dust, 64), WerkstoffLoader.Tiberium.get(dust, 64) }, - null, - BW_NonMeta_MaterialItems.TheCoreCell.get(1L), - 100, - (int) TierEU.RECIPE_LuV); + new ItemStack[] { ItemList.NaquadahCell_1.get(32L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), + WerkstoffLoader.Tiberium.get(dust, 64), WerkstoffLoader.Tiberium.get(dust, 64) }, + null, + BW_NonMeta_MaterialItems.TheCoreCell.get(1L), + 100, + (int) TierEU.RECIPE_LuV); GregTech_API.sAfterGTPostload.add(new AddSomeRecipes()); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java index 2aa7394435..f07faa79a8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java @@ -27,17 +27,22 @@ import gregtech.api.util.GT_Recipe; public class DownTierLoader { public static void run() { - RecipeMap.ALL_RECIPE_MAPS.values().stream() - .filter(map -> StreamUtils.filterVisualMaps(map) && map != RecipeMaps.fusionRecipes).forEach(map -> { - Set newRecipes = new HashSet<>(); - Set toRem = new HashSet<>(); - map.getAllRecipes().stream().filter(recipe -> Objects.nonNull(recipe) && recipe.mEUt > 128) - .forEach(recipe -> { - toRem.add(recipe); - newRecipes.add(BW_Util.copyAndSetTierToNewRecipe(recipe, (byte) 2)); - }); - map.getBackend().removeRecipes(toRem); - newRecipes.forEach(map::add); - }); + RecipeMap.ALL_RECIPE_MAPS.values() + .stream() + .filter(map -> StreamUtils.filterVisualMaps(map) && map != RecipeMaps.fusionRecipes) + .forEach(map -> { + Set newRecipes = new HashSet<>(); + Set toRem = new HashSet<>(); + map.getAllRecipes() + .stream() + .filter(recipe -> Objects.nonNull(recipe) && recipe.mEUt > 128) + .forEach(recipe -> { + toRem.add(recipe); + newRecipes.add(BW_Util.copyAndSetTierToNewRecipe(recipe, (byte) 2)); + }); + map.getBackend() + .removeRecipes(toRem); + newRecipes.forEach(map::add); + }); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java index 2b26680738..67de5d5f5b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java @@ -22,56 +22,56 @@ public class LoadItemContainers { public static void run() { BW_NonMeta_MaterialItems.Depleted_Tiberium_1 - .set(new GT_DepletetCell_Item("TiberiumcellDep", "Fuel Rod (Depleted Tiberium)", 1)); + .set(new GT_DepletetCell_Item("TiberiumcellDep", "Fuel Rod (Depleted Tiberium)", 1)); BW_NonMeta_MaterialItems.Depleted_Tiberium_2 - .set(new GT_DepletetCell_Item("Double_TiberiumcellDep", "Dual Fuel Rod (Depleted Tiberium)", 1)); + .set(new GT_DepletetCell_Item("Double_TiberiumcellDep", "Dual Fuel Rod (Depleted Tiberium)", 1)); BW_NonMeta_MaterialItems.Depleted_Tiberium_4 - .set(new GT_DepletetCell_Item("Quad_TiberiumcellDep", "Quad Fuel Rod (Depleted Tiberium)", 1)); + .set(new GT_DepletetCell_Item("Quad_TiberiumcellDep", "Quad Fuel Rod (Depleted Tiberium)", 1)); BW_NonMeta_MaterialItems.TiberiumCell_1.set( - new GT_RadioactiveCellIC_Item( - "Tiberiumcell", - "Fuel Rod (Tiberium)", - 1, - 50000, - 2F, - 1, - 0.5F, - BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), - false)); + new GT_RadioactiveCellIC_Item( + "Tiberiumcell", + "Fuel Rod (Tiberium)", + 1, + 50000, + 2F, + 1, + 0.5F, + BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), + false)); BW_NonMeta_MaterialItems.TiberiumCell_2.set( - new GT_RadioactiveCellIC_Item( - "Double_Tiberiumcell", - "Dual Fuel Rod (Tiberium)", - 2, - 50000, - 2F, - 1, - 0.5F, - BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), - false)); + new GT_RadioactiveCellIC_Item( + "Double_Tiberiumcell", + "Dual Fuel Rod (Tiberium)", + 2, + 50000, + 2F, + 1, + 0.5F, + BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), + false)); BW_NonMeta_MaterialItems.TiberiumCell_4.set( - new GT_RadioactiveCellIC_Item( - "Quad_Tiberiumcell", - "Quad Fuel Rod (Tiberium)", - 4, - 50000, - 2F, - 1, - 0.5F, - BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), - false)); + new GT_RadioactiveCellIC_Item( + "Quad_Tiberiumcell", + "Quad Fuel Rod (Tiberium)", + 4, + 50000, + 2F, + 1, + 0.5F, + BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), + false)); BW_NonMeta_MaterialItems.Depleted_TheCoreCell - .set(new GT_DepletetCell_Item("Core_Reactor_CellDep", "Depleted \"The Core\" Cell", 32)); + .set(new GT_DepletetCell_Item("Core_Reactor_CellDep", "Depleted \"The Core\" Cell", 32)); BW_NonMeta_MaterialItems.TheCoreCell.set( - new GT_RadioactiveCellIC_Item( - "Core_Reactor_Cell", - "\"The Core\" Cell", - 32, - 100000, - 8F, - 32, - 1F, - BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), - false)); + new GT_RadioactiveCellIC_Item( + "Core_Reactor_Cell", + "\"The Core\" Cell", + 32, + 100000, + 8F, + 32, + 1F, + BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), + false)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java index 03b9315c11..a61bc55d59 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java @@ -39,20 +39,19 @@ public class AspectLoader implements IWerkstoffRunnable { if (werkstoff.hasItemType(enabledOrePrefixes)) { if (enabledOrePrefixes.mMaterialAmount >= 3628800L || enabledOrePrefixes == OrePrefixes.ore) { DebugLog.log( - "OrePrefix: " + enabledOrePrefixes.name() - + " mMaterialAmount: " - + enabledOrePrefixes.mMaterialAmount / 3628800L); + "OrePrefix: " + enabledOrePrefixes.name() + + " mMaterialAmount: " + + enabledOrePrefixes.mMaterialAmount / 3628800L); if (Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes))) ThaumcraftHandler.AspectAdder.addAspectViaBW( - werkstoff.get(enabledOrePrefixes), - werkstoff.getTCAspects( - enabledOrePrefixes == OrePrefixes.ore ? 1 - : (int) (enabledOrePrefixes.mMaterialAmount / 3628800L))); - } else if (enabledOrePrefixes.mMaterialAmount >= 0L - && Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes))) - ThaumcraftHandler.AspectAdder.addAspectViaBW( werkstoff.get(enabledOrePrefixes), - new Pair<>(TC_Aspects.PERDITIO.mAspect, 1)); + werkstoff.getTCAspects( + enabledOrePrefixes == OrePrefixes.ore ? 1 + : (int) (enabledOrePrefixes.mMaterialAmount / 3628800L))); + } else if (enabledOrePrefixes.mMaterialAmount >= 0L + && Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes))) + ThaumcraftHandler.AspectAdder + .addAspectViaBW(werkstoff.get(enabledOrePrefixes), new Pair<>(TC_Aspects.PERDITIO.mAspect, 1)); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java index b0402b1d1d..1262ab2499 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java @@ -37,21 +37,37 @@ public class BlockLoader implements IWerkstoffRunnable { public void run(Werkstoff werkstoff) { if (!werkstoff.hasItemType(block)) return; if (werkstoff.hasItemType(ingot)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).itemOutputs(werkstoff.get(ingot, 9)) - .duration(16 * TICKS).eut(90).metadata(GT_RecipeConstants.RECYCLE, true).addTo(UniversalArcFurnace); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(block)) + .itemOutputs(werkstoff.get(ingot, 9)) + .duration(16 * TICKS) + .eut(90) + .metadata(GT_RecipeConstants.RECYCLE, true) + .addTo(UniversalArcFurnace); } if (werkstoff.hasItemType(cellMolten)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).fluidOutputs(werkstoff.getMolten(1296)) - .recipeCategory(RecipeCategories.fluidExtractorRecycling).duration(14 * SECONDS + 8 * TICKS).eut(8) - .addTo(fluidExtractionRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(block)) + .fluidOutputs(werkstoff.getMolten(1296)) + .recipeCategory(RecipeCategories.fluidExtractorRecycling) + .duration(14 * SECONDS + 8 * TICKS) + .eut(8) + .addTo(fluidExtractionRecipes); } if (werkstoff.hasItemType(plate)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).itemOutputs(werkstoff.get(plate, 9)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 10L, 1L)).eut(TierEU.RECIPE_LV) - .addTo(cutterRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(block)) + .itemOutputs(werkstoff.get(plate, 9)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() * 10L, + 1L)) + .eut(TierEU.RECIPE_LV) + .addTo(cutterRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java index 967a25665e..9ec4030943 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java @@ -41,11 +41,10 @@ public class CasingLoader implements IWerkstoffRunnable { addCasingRecipes(werkstoff, plank); } else { if (!werkstoff.hasGenerationFeature(blockCasing) || !werkstoff.doesOreDictedItemExists(plate) - || !werkstoff.doesOreDictedItemExists(screw) - || !werkstoff.doesOreDictedItemExists(gearGtSmall) - || !werkstoff.doesOreDictedItemExists(gearGt) - || !werkstoff.doesOreDictedItemExists(plateDouble)) - return; + || !werkstoff.doesOreDictedItemExists(screw) + || !werkstoff.doesOreDictedItemExists(gearGtSmall) + || !werkstoff.doesOreDictedItemExists(gearGt) + || !werkstoff.doesOreDictedItemExists(plateDouble)) return; addCasingRecipes(werkstoff, plateDouble); } @@ -53,23 +52,27 @@ public class CasingLoader implements IWerkstoffRunnable { private static void addCasingRecipes(Werkstoff werkstoff, OrePrefixes reboltedCasingsOuterStuff) { GT_ModHandler.addCraftingRecipe( - werkstoff.get(blockCasing), - new Object[] { "PSP", "PGP", "PSP", 'P', werkstoff.get(plate), 'S', werkstoff.get(screw), 'G', - werkstoff.get(gearGtSmall) }); + werkstoff.get(blockCasing), + new Object[] { "PSP", "PGP", "PSP", 'P', werkstoff.get(plate), 'S', werkstoff.get(screw), 'G', + werkstoff.get(gearGtSmall) }); GT_Values.RA.stdBuilder() - .itemInputs(werkstoff.get(plate, 6), werkstoff.get(screw, 2), werkstoff.get(gearGtSmall)) - .itemOutputs(werkstoff.get(blockCasing)).duration(10 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(assemblerRecipes); + .itemInputs(werkstoff.get(plate, 6), werkstoff.get(screw, 2), werkstoff.get(gearGtSmall)) + .itemOutputs(werkstoff.get(blockCasing)) + .duration(10 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(assemblerRecipes); GT_ModHandler.addCraftingRecipe( - werkstoff.get(blockCasingAdvanced), - new Object[] { "PSP", "PGP", "PSP", 'P', werkstoff.get(reboltedCasingsOuterStuff), 'S', - werkstoff.get(screw), 'G', werkstoff.get(gearGt) }); + werkstoff.get(blockCasingAdvanced), + new Object[] { "PSP", "PGP", "PSP", 'P', werkstoff.get(reboltedCasingsOuterStuff), 'S', + werkstoff.get(screw), 'G', werkstoff.get(gearGt) }); GT_Values.RA.stdBuilder() - .itemInputs(werkstoff.get(reboltedCasingsOuterStuff, 6), werkstoff.get(screw, 2), werkstoff.get(gearGt)) - .itemOutputs(werkstoff.get(blockCasingAdvanced)).duration(10 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(assemblerRecipes); + .itemInputs(werkstoff.get(reboltedCasingsOuterStuff, 6), werkstoff.get(screw, 2), werkstoff.get(gearGt)) + .itemOutputs(werkstoff.get(blockCasingAdvanced)) + .duration(10 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(assemblerRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java index 379424d9d4..2b86f46149 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java @@ -57,18 +57,23 @@ public class CellLoader implements IWerkstoffRunnable { public void run(Werkstoff werkstoff) { if (!werkstoff.hasItemType(cell)) return; - if ((werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge()) - && !werkstoff.hasItemType(dust)) { + if ((werkstoff.getStats() + .isElektrolysis() + || werkstoff.getStats() + .isCentrifuge()) + && !werkstoff.hasItemType(dust)) { List flOutputs = new ArrayList<>(); List stOutputs = new ArrayList<>(); HashMap> tracker = new HashMap<>(); int cells = 0; - for (Pair container : werkstoff.getContents().getValue().toArray(new Pair[0])) { + for (Pair container : werkstoff.getContents() + .getValue() + .toArray(new Pair[0])) { if (container.getKey() instanceof Materials) { if ((((Materials) container.getKey()).hasCorrespondingGas() - || ((Materials) container.getKey()).hasCorrespondingFluid() - || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) - && ((Materials) container.getKey()).getDust(0) == null) { + || ((Materials) container.getKey()).hasCorrespondingFluid() + || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) + && ((Materials) container.getKey()).getDust(0) == null) { FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000L * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = ((Materials) container.getKey()).getFluid(1000L * container.getValue()); @@ -80,9 +85,12 @@ public class CellLoader implements IWerkstoffRunnable { tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { stOutputs.add( - ((Materials) container.getKey()).getCells( - tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + ((Materials) container.getKey()).getCells( + tracker.get(container.getKey()) + .getKey() + container.getValue())); + stOutputs.remove( + tracker.get(container.getKey()) + .getValue() + 1); } cells += container.getValue(); } @@ -93,14 +101,17 @@ public class CellLoader implements IWerkstoffRunnable { tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { stOutputs.add( - ((Materials) container.getKey()) - .getDust(tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + ((Materials) container.getKey()).getDust( + tracker.get(container.getKey()) + .getKey() + container.getValue())); + stOutputs.remove( + tracker.get(container.getKey()) + .getValue() + 1); } } } else if (container.getKey() instanceof Werkstoff) { - if (((Werkstoff) container.getKey()).getStats().isGas() - || ((Werkstoff) container.getKey()).hasItemType(cell)) { + if (((Werkstoff) container.getKey()).getStats() + .isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) { FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); @@ -112,10 +123,13 @@ public class CellLoader implements IWerkstoffRunnable { tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { stOutputs.add( - ((Werkstoff) container.getKey()).get( - cell, - tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + ((Werkstoff) container.getKey()).get( + cell, + tracker.get(container.getKey()) + .getKey() + container.getValue())); + stOutputs.remove( + tracker.get(container.getKey()) + .getValue() + 1); } cells += container.getValue(); } @@ -126,10 +140,13 @@ public class CellLoader implements IWerkstoffRunnable { tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { stOutputs.add( - ((Werkstoff) container.getKey()).get( - dust, - tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + ((Werkstoff) container.getKey()).get( + dust, + tracker.get(container.getKey()) + .getKey() + container.getValue())); + stOutputs.remove( + tracker.get(container.getKey()) + .getValue() + 1); } } } @@ -140,82 +157,130 @@ public class CellLoader implements IWerkstoffRunnable { int cellEmpty = cells - 1; stOutputs.add(Materials.Empty.getCells(-cellEmpty)); - if (werkstoff.getStats().isElektrolysis()) RecipeMaps.electrolyzerRecipes.add( + if (werkstoff.getStats() + .isElektrolysis()) + RecipeMaps.electrolyzerRecipes.add( new GT_Recipe( - true, - new ItemStack[] { input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null }, - stOutputs.toArray(new ItemStack[0]), - null, - null, - new FluidStack[] { null }, - new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, - (int) Math.max( - 1L, - Math.abs( - werkstoff.getStats().getProtons() - * werkstoff.getContents().getValue().size())), - Math.min(4, werkstoff.getContents().getValue().size()) * 30, - 0)); - if (werkstoff.getStats().isCentrifuge()) RecipeMaps.centrifugeRecipes.add( + true, + new ItemStack[] { input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null }, + stOutputs.toArray(new ItemStack[0]), + null, + null, + new FluidStack[] { null }, + new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, + (int) Math.max( + 1L, + Math.abs( + werkstoff.getStats() + .getProtons() + * werkstoff.getContents() + .getValue() + .size())), + Math.min( + 4, + werkstoff.getContents() + .getValue() + .size()) + * 30, + 0)); + if (werkstoff.getStats() + .isCentrifuge()) + RecipeMaps.centrifugeRecipes.add( new GT_Recipe( - true, - new ItemStack[] { input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null }, - stOutputs.toArray(new ItemStack[0]), - null, - null, - new FluidStack[] { null }, - new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, - (int) Math.max( - 1L, - Math.abs( - werkstoff.getStats().getMass() - * werkstoff.getContents().getValue().size())), - Math.min(4, werkstoff.getContents().getValue().size()) * 5, - 0)); + true, + new ItemStack[] { input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : null }, + stOutputs.toArray(new ItemStack[0]), + null, + null, + new FluidStack[] { null }, + new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, + (int) Math.max( + 1L, + Math.abs( + werkstoff.getStats() + .getMass() + * werkstoff.getContents() + .getValue() + .size())), + Math.min( + 4, + werkstoff.getContents() + .getValue() + .size()) + * 5, + 0)); } // Tank "Recipe" GT_Utility.addFluidContainerData( - new FluidContainerRegistry.FluidContainerData( - new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), - werkstoff.get(cell), - Materials.Empty.getCells(1))); - FluidContainerRegistry.registerFluidContainer( - werkstoff.getFluidOrGas(1).getFluid(), + new FluidContainerRegistry.FluidContainerData( + new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(cell), - Materials.Empty.getCells(1)); + Materials.Empty.getCells(1))); + FluidContainerRegistry.registerFluidContainer( + werkstoff.getFluidOrGas(1) + .getFluid(), + werkstoff.get(cell), + Materials.Empty.getCells(1)); - GT_Values.RA.stdBuilder().itemInputs(Materials.Empty.getCells(1)).itemOutputs(werkstoff.get(cell)) - .fluidInputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)) - .duration(16 * TICKS).eut(2).addTo(fluidCannerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(Materials.Empty.getCells(1)) + .itemOutputs(werkstoff.get(cell)) + .fluidInputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)) + .duration(16 * TICKS) + .eut(2) + .addTo(fluidCannerRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(cell)).itemOutputs(Materials.Empty.getCells(1)) - .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)) - .duration(16 * TICKS).eut(2).addTo(fluidCannerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(cell)) + .itemOutputs(Materials.Empty.getCells(1)) + .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)) + .duration(16 * TICKS) + .eut(2) + .addTo(fluidCannerRecipes); if (Forestry.isModLoaded()) { FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( - new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), - werkstoff.get(capsule), - GT_ModHandler.getModItem(Forestry.ID, "waxCapsule", 1), - true); + new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), + werkstoff.get(capsule), + GT_ModHandler.getModItem(Forestry.ID, "waxCapsule", 1), + true); GT_Utility.addFluidContainerData(emptyData); FluidContainerRegistry.registerFluidContainer(emptyData); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(capsule)) - .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)) - .duration(16 * TICKS).eut(2).addTo(fluidCannerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(capsule)) + .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)) + .duration(16 * TICKS) + .eut(2) + .addTo(fluidCannerRecipes); } if (werkstoff.hasItemType(dust)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust)).fluidOutputs(werkstoff.getFluidOrGas(1000)) - .duration(werkstoff.getStats().getMass()).eut(werkstoff.getStats().getMass() > 128 ? 64 : 30) - .recipeCategory(RecipeCategories.fluidExtractorRecycling).addTo(fluidExtractionRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dust)) + .fluidOutputs(werkstoff.getFluidOrGas(1000)) + .duration( + werkstoff.getStats() + .getMass()) + .eut( + werkstoff.getStats() + .getMass() > 128 ? 64 : 30) + .recipeCategory(RecipeCategories.fluidExtractorRecycling) + .addTo(fluidExtractionRecipes); - GT_Values.RA.stdBuilder().itemInputs(GT_Utility.getIntegratedCircuit(1)).itemOutputs(werkstoff.get(dust)) - .fluidInputs(werkstoff.getFluidOrGas(1000)).duration((int) werkstoff.getStats().getMass()) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(werkstoff.get(dust)) + .fluidInputs(werkstoff.getFluidOrGas(1000)) + .duration( + (int) werkstoff.getStats() + .getMass()) + .eut( + werkstoff.getStats() + .getMass() > 128 ? 64 : 30) + .addTo(fluidSolidifierRecipes); } @@ -223,17 +288,18 @@ public class CellLoader implements IWerkstoffRunnable { Materials werkstoffBridgeMaterial = null; boolean ElementSet = false; for (Element e : Element.values()) { - if (e.toString().equals(werkstoff.getToolTip())) { + if (e.toString() + .equals(werkstoff.getToolTip())) { werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() - : new Materials( - -1, - werkstoff.getTexSet(), - 0, - 0, - 0, - false, - werkstoff.getDefaultName(), - werkstoff.getDefaultName()); + : new Materials( + -1, + werkstoff.getTexSet(), + 0, + 0, + 0, + false, + werkstoff.getDefaultName(), + werkstoff.getDefaultName()); werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials.add(werkstoffBridgeMaterial); ElementSet = true; @@ -249,18 +315,18 @@ public class CellLoader implements IWerkstoffRunnable { Behaviour_DataOrb.setDataTitle(scannerOutput, "Elemental-Scan"); Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); RecipeMaps.scannerFakeRecipes.addFakeRecipe( + false, + new GT_Recipe( false, - new GT_Recipe( - false, - new ItemStack[] { werkstoff.get(cell) }, - new ItemStack[] { scannerOutput }, - ItemList.Tool_DataOrb.get(1L), - null, - null, - null, - (int) (werkstoffBridgeMaterial.getMass() * 8192L), - 30, - 0)); + new ItemStack[] { werkstoff.get(cell) }, + new ItemStack[] { scannerOutput }, + ItemList.Tool_DataOrb.get(1L), + null, + null, + null, + (int) (werkstoffBridgeMaterial.getMass() * 8192L), + 30, + 0)); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java index 57986cdfe3..91fe34e89f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java @@ -53,113 +53,196 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(screw)) { - int tVoltageMultiplier = werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15; + int tVoltageMultiplier = werkstoff.getStats() + .getMeltingPoint() >= 2800 ? 60 : 15; // bolt GT_Values.RA.stdBuilder() - .itemInputs( - werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(ingot), - ItemList.Shape_Extruder_Bolt.get(0L)) - .itemOutputs(werkstoff.get(bolt, 8)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1)).eut(8 * tVoltageMultiplier) - .addTo(extruderRecipes); + .itemInputs( + werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(ingot), + ItemList.Shape_Extruder_Bolt.get(0L)) + .itemOutputs(werkstoff.get(bolt, 8)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() * 2L, + 1)) + .eut(8 * tVoltageMultiplier) + .addTo(extruderRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick)).itemOutputs(werkstoff.get(bolt, 4)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)).eut(4).addTo(cutterRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(stick)) + .itemOutputs(werkstoff.get(bolt, 4)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() * 2L, + 1L)) + .eut(4) + .addTo(cutterRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(bolt)).itemOutputs(werkstoff.get(dustTiny, 1)) - .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(bolt)) + .itemOutputs(werkstoff.get(dustTiny, 1)) + .duration(2 * TICKS) + .eut(8) + .addTo(maceratorRecipes); // screw - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(bolt)).itemOutputs(werkstoff.get(screw)) - .duration((int) Math.max(werkstoff.getStats().getMass() / 8L, 1L)).eut(4).addTo(latheRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(bolt)) + .itemOutputs(werkstoff.get(screw)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() / 8L, + 1L)) + .eut(4) + .addTo(latheRecipes); GT_ModHandler.addCraftingRecipe( - werkstoff.get(screw), - GT_Proxy.tBits, - new Object[] { "fX", "X ", 'X', werkstoff.get(bolt) }); + werkstoff.get(screw), + GT_Proxy.tBits, + new Object[] { "fX", "X ", 'X', werkstoff.get(bolt) }); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(screw)).itemOutputs(werkstoff.get(dustTiny, 1)) - .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(screw)) + .itemOutputs(werkstoff.get(dustTiny, 1)) + .duration(2 * TICKS) + .eut(8) + .addTo(maceratorRecipes); if (werkstoff.hasItemType(gem)) return; // ring - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Ring.get(0L)) - .itemOutputs(werkstoff.get(ring, 4)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1)).eut(6 * tVoltageMultiplier) - .addTo(extruderRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Ring.get(0L)) + .itemOutputs(werkstoff.get(ring, 4)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() * 2L, + 1)) + .eut(6 * tVoltageMultiplier) + .addTo(extruderRecipes); GT_ModHandler.addCraftingRecipe( - werkstoff.get(ring), - GT_Proxy.tBits, - new Object[] { "h ", "fX", 'X', werkstoff.get(stick) }); + werkstoff.get(ring), + GT_Proxy.tBits, + new Object[] { "h ", "fX", 'X', werkstoff.get(stick) }); // Gear GT_ModHandler.addCraftingRecipe( - werkstoff.get(gearGt), - GT_Proxy.tBits, - new Object[] { "SPS", "PwP", "SPS", 'P', werkstoff.get(plate), 'S', werkstoff.get(stick) }); + werkstoff.get(gearGt), + GT_Proxy.tBits, + new Object[] { "SPS", "PwP", "SPS", 'P', werkstoff.get(plate), 'S', werkstoff.get(stick) }); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 4), ItemList.Shape_Extruder_Gear.get(0L)) - .itemOutputs(werkstoff.get(gearGt)).duration((int) Math.max(werkstoff.getStats().getMass() * 5L, 1)) - .eut(8 * tVoltageMultiplier).addTo(extruderRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot, 4), ItemList.Shape_Extruder_Gear.get(0L)) + .itemOutputs(werkstoff.get(gearGt)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() * 5L, + 1)) + .eut(8 * tVoltageMultiplier) + .addTo(extruderRecipes); // wireFine - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Wire.get(0L)) - .itemOutputs(werkstoff.get(wireFine, 8)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 1.5F, 1F)).eut(8 * tVoltageMultiplier) - .addTo(extruderRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Wire.get(0L)) + .itemOutputs(werkstoff.get(wireFine, 8)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() * 1.5F, + 1F)) + .eut(8 * tVoltageMultiplier) + .addTo(extruderRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(3)) - .itemOutputs(werkstoff.get(wireFine, 8)).duration((int) Math.max(werkstoff.getStats().getMass(), 1)) - .eut(8 * tVoltageMultiplier).addTo(wiremillRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(3)) + .itemOutputs(werkstoff.get(wireFine, 8)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass(), + 1)) + .eut(8 * tVoltageMultiplier) + .addTo(wiremillRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick), GT_Utility.getIntegratedCircuit(3)) - .itemOutputs(werkstoff.get(wireFine, 4)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F)).eut(8 * tVoltageMultiplier) - .addTo(wiremillRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(stick), GT_Utility.getIntegratedCircuit(3)) + .itemOutputs(werkstoff.get(wireFine, 4)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() * 0.5F, + 1F)) + .eut(8 * tVoltageMultiplier) + .addTo(wiremillRecipes); // smallGear if (WerkstoffLoader.smallGearShape != null) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), WerkstoffLoader.smallGearShape.get(0L)) - .itemOutputs(werkstoff.get(gearGtSmall)).duration((int) werkstoff.getStats().getMass()) - .eut(8 * tVoltageMultiplier).addTo(extruderRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot), WerkstoffLoader.smallGearShape.get(0L)) + .itemOutputs(werkstoff.get(gearGtSmall)) + .duration( + (int) werkstoff.getStats() + .getMass()) + .eut(8 * tVoltageMultiplier) + .addTo(extruderRecipes); } GT_ModHandler.addCraftingRecipe( - werkstoff.get(gearGtSmall), - GT_Proxy.tBits, - new Object[] { " S ", "hPx", " S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate) }); + werkstoff.get(gearGtSmall), + GT_Proxy.tBits, + new Object[] { " S ", "hPx", " S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate) }); // Rotor GT_ModHandler.addCraftingRecipe( - werkstoff.get(rotor), - GT_Proxy.tBits, - new Object[] { "PhP", "SRf", "PdP", 'P', werkstoff.get(plate), 'R', werkstoff.get(ring), 'S', - werkstoff.get(screw) }); + werkstoff.get(rotor), + GT_Proxy.tBits, + new Object[] { "PhP", "SRf", "PdP", 'P', werkstoff.get(plate), 'R', werkstoff.get(ring), 'S', + werkstoff.get(screw) }); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate, 4), werkstoff.get(ring)) - .itemOutputs(werkstoff.get(rotor)).fluidInputs(Materials.Tin.getMolten(32)).duration(12 * SECONDS) - .eut(24).addTo(assemblerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(plate, 4), werkstoff.get(ring)) + .itemOutputs(werkstoff.get(rotor)) + .fluidInputs(Materials.Tin.getMolten(32)) + .duration(12 * SECONDS) + .eut(24) + .addTo(assemblerRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate, 4), werkstoff.get(ring)) - .itemOutputs(werkstoff.get(rotor)).fluidInputs(Materials.Lead.getMolten(48)).duration(12 * SECONDS) - .eut(24).addTo(assemblerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(plate, 4), werkstoff.get(ring)) + .itemOutputs(werkstoff.get(rotor)) + .fluidInputs(Materials.Lead.getMolten(48)) + .duration(12 * SECONDS) + .eut(24) + .addTo(assemblerRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate, 4), werkstoff.get(ring)) - .itemOutputs(werkstoff.get(rotor)).fluidInputs(Materials.SolderingAlloy.getMolten(16)) - .duration(12 * SECONDS).eut(24).addTo(assemblerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(plate, 4), werkstoff.get(ring)) + .itemOutputs(werkstoff.get(rotor)) + .fluidInputs(Materials.SolderingAlloy.getMolten(16)) + .duration(12 * SECONDS) + .eut(24) + .addTo(assemblerRecipes); if (WerkstoffLoader.rotorShape != null) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 5), WerkstoffLoader.rotorShape.get(0L)) - .itemOutputs(werkstoff.get(rotor)).duration(10 * SECONDS).eut(60).addTo(extruderRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot, 5), WerkstoffLoader.rotorShape.get(0L)) + .itemOutputs(werkstoff.get(rotor)) + .duration(10 * SECONDS) + .eut(60) + .addTo(extruderRecipes); } @@ -180,18 +263,33 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { */ } - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gearGt)).itemOutputs(werkstoff.get(dust, 4)) - .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gearGt)) + .itemOutputs(werkstoff.get(dust, 4)) + .duration(2 * TICKS) + .eut(8) + .addTo(maceratorRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gearGtSmall)).itemOutputs(werkstoff.get(dust, 1)) - .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gearGtSmall)) + .itemOutputs(werkstoff.get(dust, 1)) + .duration(2 * TICKS) + .eut(8) + .addTo(maceratorRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(rotor)) - .itemOutputs(werkstoff.get(dust, 4), werkstoff.get(dustSmall)).duration(2 * TICKS).eut(8) - .addTo(maceratorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(rotor)) + .itemOutputs(werkstoff.get(dust, 4), werkstoff.get(dustSmall)) + .duration(2 * TICKS) + .eut(8) + .addTo(maceratorRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ring)).itemOutputs(werkstoff.get(dustSmall, 1)) - .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ring)) + .itemOutputs(werkstoff.get(dustSmall, 1)) + .duration(2 * TICKS) + .eut(8) + .addTo(maceratorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java index 90ef6d5813..b33d0ddd20 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java @@ -49,7 +49,8 @@ public class CrushedLoader implements IWerkstoffRunnable { public void run(Werkstoff werkstoff) { if (!werkstoff.hasItemType(ore) || !werkstoff.hasItemType(dust)) return; - if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) { + if (werkstoff.hasItemType(ingot) && !werkstoff.getStats() + .isBlastFurnace()) { if (Werkstoff.Types.ELEMENT.equals(werkstoff.getType())) { GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushed), werkstoff.get(nugget, 10)); GT_ModHandler.addSmeltingRecipe(werkstoff.get(crushedPurified), werkstoff.get(nugget, 10)); @@ -64,147 +65,217 @@ public class CrushedLoader implements IWerkstoffRunnable { GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); } + GT_ModHandler + .addCraftingRecipe(werkstoff.get(dustImpure), new Object[] { "h ", "W ", 'W', werkstoff.get(crushed) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(dustImpure), - new Object[] { "h ", "W ", 'W', werkstoff.get(crushed) }); + werkstoff.get(dustPure), + new Object[] { "h ", "W ", 'W', werkstoff.get(crushedPurified) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(dustPure), - new Object[] { "h ", "W ", 'W', werkstoff.get(crushedPurified) }); - GT_ModHandler.addCraftingRecipe( - werkstoff.get(dust), - new Object[] { "h ", "W ", 'W', werkstoff.get(crushedCentrifuged) }); + werkstoff.get(dust), + new Object[] { "h ", "W ", 'W', werkstoff.get(crushedCentrifuged) }); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushed)).itemOutputs(werkstoff.get(dustImpure)) - .duration(10 * TICKS).eut(16).addTo(hammerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(crushed)) + .itemOutputs(werkstoff.get(dustImpure)) + .duration(10 * TICKS) + .eut(16) + .addTo(hammerRecipes); GT_ModHandler.addPulverisationRecipe( - werkstoff.get(crushed), - werkstoff.get(dustImpure), - werkstoff.getOreByProduct(0, dust), - 10, - false); + werkstoff.get(crushed), + werkstoff.get(dustImpure), + werkstoff.getOreByProduct(0, dust), + 10, + false); GT_ModHandler.addOreWasherRecipe( - werkstoff.get(crushed), - new int[] { 10000, 1111, 10000 }, - 1000, - werkstoff.get(crushedPurified), - werkstoff.getOreByProduct(0, dust), - GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); + werkstoff.get(crushed), + new int[] { 10000, 1111, 10000 }, + 1000, + werkstoff.get(crushedPurified), + werkstoff.getOreByProduct(0, dust), + GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); GT_ModHandler.addThermalCentrifugeRecipe( - werkstoff.get(crushed), - new int[] { 10000, 1111, 10000 }, - (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), - werkstoff.get(crushedCentrifuged), - werkstoff.getOreByProduct(1, dust), - GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushedPurified)).itemOutputs(werkstoff.get(dustPure)) - .duration(10 * TICKS).eut(16).addTo(hammerRecipes); + werkstoff.get(crushed), + new int[] { 10000, 1111, 10000 }, + (int) Math.min( + 5000L, + Math.abs( + werkstoff.getStats() + .getProtons() * 20L)), + werkstoff.get(crushedCentrifuged), + werkstoff.getOreByProduct(1, dust), + GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(crushedPurified)) + .itemOutputs(werkstoff.get(dustPure)) + .duration(10 * TICKS) + .eut(16) + .addTo(hammerRecipes); GT_ModHandler.addPulverisationRecipe( - werkstoff.get(crushedPurified), - werkstoff.get(dustPure), - werkstoff.getOreByProduct(1, dust), - 10, - false); + werkstoff.get(crushedPurified), + werkstoff.get(dustPure), + werkstoff.getOreByProduct(1, dust), + 10, + false); GT_ModHandler.addThermalCentrifugeRecipe( - werkstoff.get(crushedPurified), - new int[] { 10000, 1111 }, - (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), - werkstoff.get(crushedCentrifuged), - werkstoff.getOreByProduct(1, dust)); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushedCentrifuged)).itemOutputs(werkstoff.get(dust)) - .duration(10 * TICKS).eut(16).addTo(hammerRecipes); + werkstoff.get(crushedPurified), + new int[] { 10000, 1111 }, + (int) Math.min( + 5000L, + Math.abs( + werkstoff.getStats() + .getProtons() * 20L)), + werkstoff.get(crushedCentrifuged), + werkstoff.getOreByProduct(1, dust)); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(crushedCentrifuged)) + .itemOutputs(werkstoff.get(dust)) + .duration(10 * TICKS) + .eut(16) + .addTo(hammerRecipes); GT_ModHandler.addPulverisationRecipe( - werkstoff.get(crushedCentrifuged), - werkstoff.get(dust), - werkstoff.getOreByProduct(2, dust), - 10, - false); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustImpure)) - .itemOutputs(werkstoff.get(dust), werkstoff.getOreByProduct(0, dust)).outputChances(100_00, 11_11) - .duration(Math.max(1L, werkstoff.getStats().getMass() * 8L)).eut(5).addTo(centrifugeRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)) - .itemOutputs(werkstoff.get(dust), werkstoff.getOreByProduct(1, dust)).outputChances(100_00, 11_11) - .duration(Math.max(1L, werkstoff.getStats().getMass() * 8L)).eut(5).addTo(centrifugeRecipes); + werkstoff.get(crushedCentrifuged), + werkstoff.get(dust), + werkstoff.getOreByProduct(2, dust), + 10, + false); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dustImpure)) + .itemOutputs(werkstoff.get(dust), werkstoff.getOreByProduct(0, dust)) + .outputChances(100_00, 11_11) + .duration( + Math.max( + 1L, + werkstoff.getStats() + .getMass() * 8L)) + .eut(5) + .addTo(centrifugeRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dustPure)) + .itemOutputs(werkstoff.get(dust), werkstoff.getOreByProduct(1, dust)) + .outputChances(100_00, 11_11) + .duration( + Math.max( + 1L, + werkstoff.getStats() + .getMass() * 8L)) + .eut(5) + .addTo(centrifugeRecipes); if (werkstoff.contains(SubTag.CRYSTALLISABLE)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)).itemOutputs(werkstoff.get(gem)) - .outputChances(9000).fluidInputs(Materials.Water.getFluid(200L)) - .duration(1 * MINUTES + 40 * SECONDS).eut(24).addTo(autoclaveRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustImpure)).itemOutputs(werkstoff.get(gem)) - .outputChances(9000).fluidInputs(Materials.Water.getFluid(200L)) - .duration(1 * MINUTES + 40 * SECONDS).eut(24).addTo(autoclaveRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)).itemOutputs(werkstoff.get(gem)) - .outputChances(9500).fluidInputs(gregtech.api.util.GT_ModHandler.getDistilledWater(200L)) - .duration(1 * MINUTES + 15 * SECONDS).eut(24).addTo(autoclaveRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustImpure)).itemOutputs(werkstoff.get(gem)) - .outputChances(9500).fluidInputs(gregtech.api.util.GT_ModHandler.getDistilledWater(200L)) - .duration(1 * MINUTES + 15 * SECONDS).eut(24).addTo(autoclaveRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dustPure)) + .itemOutputs(werkstoff.get(gem)) + .outputChances(9000) + .fluidInputs(Materials.Water.getFluid(200L)) + .duration(1 * MINUTES + 40 * SECONDS) + .eut(24) + .addTo(autoclaveRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dustImpure)) + .itemOutputs(werkstoff.get(gem)) + .outputChances(9000) + .fluidInputs(Materials.Water.getFluid(200L)) + .duration(1 * MINUTES + 40 * SECONDS) + .eut(24) + .addTo(autoclaveRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dustPure)) + .itemOutputs(werkstoff.get(gem)) + .outputChances(9500) + .fluidInputs(gregtech.api.util.GT_ModHandler.getDistilledWater(200L)) + .duration(1 * MINUTES + 15 * SECONDS) + .eut(24) + .addTo(autoclaveRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dustImpure)) + .itemOutputs(werkstoff.get(gem)) + .outputChances(9500) + .fluidInputs(gregtech.api.util.GT_ModHandler.getDistilledWater(200L)) + .duration(1 * MINUTES + 15 * SECONDS) + .eut(24) + .addTo(autoclaveRecipes); } if (werkstoff.contains(SubTag.WASHING_MERCURY)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushed)) - .itemOutputs( - werkstoff.get(crushedPurified), - werkstoff.getOreByProduct(1, dust), - GT_OreDictUnificator.get(dust, Materials.Stone, 1L)) - .outputChances(10000, 7000, 4000).fluidInputs(Materials.Mercury.getFluid(1000L)) - .duration(40 * SECONDS).eut(8).addTo(chemicalBathRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(crushed)) + .itemOutputs( + werkstoff.get(crushedPurified), + werkstoff.getOreByProduct(1, dust), + GT_OreDictUnificator.get(dust, Materials.Stone, 1L)) + .outputChances(10000, 7000, 4000) + .fluidInputs(Materials.Mercury.getFluid(1000L)) + .duration(40 * SECONDS) + .eut(8) + .addTo(chemicalBathRecipes); } if (werkstoff.contains(SubTag.WASHING_SODIUMPERSULFATE)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushed)) - .itemOutputs( - werkstoff.get(crushedPurified), - werkstoff.getOreByProduct(1, dust), - GT_OreDictUnificator.get(dust, Materials.Stone, 1L)) - .outputChances(10000, 7000, 4000) - .fluidInputs( - Materials.SodiumPersulfate - .getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L)) - .duration(40 * SECONDS).eut(8).addTo(chemicalBathRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(crushed)) + .itemOutputs( + werkstoff.get(crushedPurified), + werkstoff.getOreByProduct(1, dust), + GT_OreDictUnificator.get(dust, Materials.Stone, 1L)) + .outputChances(10000, 7000, 4000) + .fluidInputs( + Materials.SodiumPersulfate.getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L)) + .duration(40 * SECONDS) + .eut(8) + .addTo(chemicalBathRecipes); } if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_GOLD)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)) - .itemOutputs( - werkstoff.get(dust), - GT_OreDictUnificator.get(dustSmall, Materials.Gold, 1L), - GT_OreDictUnificator.get(nugget, Materials.Gold, 1L)) - .outputChances(10000, 4000, 2000).duration(20 * SECONDS).eut(24) - .addTo(electroMagneticSeparatorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dustPure)) + .itemOutputs( + werkstoff.get(dust), + GT_OreDictUnificator.get(dustSmall, Materials.Gold, 1L), + GT_OreDictUnificator.get(nugget, Materials.Gold, 1L)) + .outputChances(10000, 4000, 2000) + .duration(20 * SECONDS) + .eut(24) + .addTo(electroMagneticSeparatorRecipes); } else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_IRON)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)) - .itemOutputs( - werkstoff.get(dust), - GT_OreDictUnificator.get(dustSmall, Materials.Iron, 1L), - GT_OreDictUnificator.get(nugget, Materials.Iron, 1L)) - .outputChances(10000, 4000, 2000).duration(20 * SECONDS).eut(24) - .addTo(electroMagneticSeparatorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dustPure)) + .itemOutputs( + werkstoff.get(dust), + GT_OreDictUnificator.get(dustSmall, Materials.Iron, 1L), + GT_OreDictUnificator.get(nugget, Materials.Iron, 1L)) + .outputChances(10000, 4000, 2000) + .duration(20 * SECONDS) + .eut(24) + .addTo(electroMagneticSeparatorRecipes); } else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustPure)) - .itemOutputs( - werkstoff.get(dust), - GT_OreDictUnificator.get(dustSmall, Materials.Neodymium, 1L), - GT_OreDictUnificator.get(nugget, Materials.Neodymium, 1L)) - .outputChances(10000, 4000, 2000).duration(20 * SECONDS).eut(24) - .addTo(electroMagneticSeparatorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dustPure)) + .itemOutputs( + werkstoff.get(dust), + GT_OreDictUnificator.get(dustSmall, Materials.Neodymium, 1L), + GT_OreDictUnificator.get(nugget, Materials.Neodymium, 1L)) + .outputChances(10000, 4000, 2000) + .duration(20 * SECONDS) + .eut(24) + .addTo(electroMagneticSeparatorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java index 6c63c12f17..088c4bb55b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java @@ -66,16 +66,22 @@ public class DustLoader implements IWerkstoffRunnable { HashMap> tracker = new HashMap<>(); int cells = 0; - if (werkstoff.getGenerationFeatures().hasMixerRecipes() || werkstoff.getStats().isElektrolysis() - || werkstoff.getStats().isCentrifuge() - || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { - for (Pair container : werkstoff.getContents().getValue() - .toArray(new Pair[0])) { + if (werkstoff.getGenerationFeatures() + .hasMixerRecipes() + || werkstoff.getStats() + .isElektrolysis() + || werkstoff.getStats() + .isCentrifuge() + || werkstoff.getGenerationFeatures() + .hasChemicalRecipes()) { + for (Pair container : werkstoff.getContents() + .getValue() + .toArray(new Pair[0])) { final ISubTagContainer key = container.getKey(); final int value = container.getValue(); if (key instanceof Materials materialKey) { if ((materialKey.getGas(0) != null || materialKey.getFluid(0) != null - || materialKey.mIconSet == TextureSet.SET_FLUID) && materialKey.getDust(0) == null) { + || materialKey.mIconSet == TextureSet.SET_FLUID) && materialKey.getDust(0) == null) { FluidStack tmpFl = materialKey.getGas(1000L * value); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = materialKey.getFluid(1000L * value); @@ -86,16 +92,20 @@ public class DustLoader implements IWerkstoffRunnable { stOutputs.add(materialKey.getCells(value)); tracker.put(key, new Pair<>(value, stOutputs.size() - 1)); } else { - stOutputs.add(materialKey.getCells(tracker.get(key).getKey() + value)); - stOutputs.remove(tracker.get(key).getValue() + 1); + stOutputs.add( + materialKey.getCells( + tracker.get(key) + .getKey() + value)); + stOutputs.remove( + tracker.get(key) + .getValue() + 1); } cells += value; } } else { if (materialKey.getDust(value) == null) { if (materialKey.getCells(value) == null - || materialKey.getMolten(0) == null && materialKey.getSolid(0) == null) - continue; + || materialKey.getMolten(0) == null && materialKey.getSolid(0) == null) continue; FluidStack tmpFl = materialKey.getMolten(1000L * value); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = materialKey.getSolid(1000L * value); @@ -106,8 +116,13 @@ public class DustLoader implements IWerkstoffRunnable { stOutputs.add(materialKey.getCells(value)); tracker.put(key, new Pair<>(value, stOutputs.size() - 1)); } else { - stOutputs.add(materialKey.getCells(tracker.get(key).getKey() + value)); - stOutputs.remove(tracker.get(key).getValue() + 1); + stOutputs.add( + materialKey.getCells( + tracker.get(key) + .getKey() + value)); + stOutputs.remove( + tracker.get(key) + .getValue() + 1); } cells += value; } @@ -116,12 +131,18 @@ public class DustLoader implements IWerkstoffRunnable { stOutputs.add(materialKey.getDust(value)); tracker.put(key, new Pair<>(value, stOutputs.size() - 1)); } else { - stOutputs.add(materialKey.getDust(tracker.get(key).getKey() + value)); - stOutputs.remove(tracker.get(key).getValue() + 1); + stOutputs.add( + materialKey.getDust( + tracker.get(key) + .getKey() + value)); + stOutputs.remove( + tracker.get(key) + .getValue() + 1); } } } else if (key instanceof Werkstoff werkstoffKey) { - if (werkstoffKey.getStats().isGas() || werkstoffKey.hasItemType(cell)) { + if (werkstoffKey.getStats() + .isGas() || werkstoffKey.hasItemType(cell)) { FluidStack tmpFl = werkstoffKey.getFluidOrGas(1000 * value); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = werkstoffKey.getFluidOrGas(1000 * value); @@ -132,8 +153,14 @@ public class DustLoader implements IWerkstoffRunnable { stOutputs.add(werkstoffKey.get(cell, value)); tracker.put(key, new Pair<>(value, stOutputs.size() - 1)); } else { - stOutputs.add(werkstoffKey.get(cell, tracker.get(key).getKey() + value)); - stOutputs.remove(tracker.get(key).getValue() + 1); + stOutputs.add( + werkstoffKey.get( + cell, + tracker.get(key) + .getKey() + value)); + stOutputs.remove( + tracker.get(key) + .getValue() + 1); } cells += value; } @@ -143,103 +170,134 @@ public class DustLoader implements IWerkstoffRunnable { stOutputs.add(werkstoffKey.get(dust, value)); tracker.put(key, new Pair<>(value, stOutputs.size() - 1)); } else { - stOutputs.add(werkstoffKey.get(dust, tracker.get(key).getKey() + value)); - stOutputs.remove(tracker.get(key).getValue() + 1); + stOutputs.add( + werkstoffKey.get( + dust, + tracker.get(key) + .getKey() + value)); + stOutputs.remove( + tracker.get(key) + .getValue() + 1); } } } } ItemStack input = werkstoff.get(dust); - input.stackSize = werkstoff.getContents().getKey(); - if (werkstoff.getStats().isElektrolysis()) { + input.stackSize = werkstoff.getContents() + .getKey(); + if (werkstoff.getStats() + .isElektrolysis()) { GT_Recipe tRecipe = new GT_Recipe( - true, - new ItemStack[] { input, cells > 0 ? Materials.Empty.getCells(cells) : null }, - stOutputs.toArray(new ItemStack[0]), - null, - null, - new FluidStack[] { null }, - new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, - (int) Math.max( - 1L, - Math.abs( - werkstoff.getStats().getProtons() - / werkstoff.getContents().getValue().size())), - Math.min(4, werkstoff.getContents().getValue().size()) * 30, - 0); + true, + new ItemStack[] { input, cells > 0 ? Materials.Empty.getCells(cells) : null }, + stOutputs.toArray(new ItemStack[0]), + null, + null, + new FluidStack[] { null }, + new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, + (int) Math.max( + 1L, + Math.abs( + werkstoff.getStats() + .getProtons() + / werkstoff.getContents() + .getValue() + .size())), + Math.min( + 4, + werkstoff.getContents() + .getValue() + .size()) + * 30, + 0); RecipeMaps.electrolyzerRecipes.add(tRecipe); RecipeMaps.electrolyzerNonCellRecipes.add(tRecipe); } - if (werkstoff.getStats().isCentrifuge()) { + if (werkstoff.getStats() + .isCentrifuge()) { RecipeMaps.centrifugeRecipes.add( - new GT_Recipe( - true, - new ItemStack[] { input, cells > 0 ? Materials.Empty.getCells(cells) : null }, - stOutputs.toArray(new ItemStack[0]), - null, - null, - new FluidStack[] { null }, - new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, - (int) Math.max( - 1L, - Math.abs( - werkstoff.getStats().getMass() - / werkstoff.getContents().getValue().size())), - Math.min(4, werkstoff.getContents().getValue().size()) * 5, - 0)); - GT_Recipe tRecipe = new GT_Recipe( - false, + new GT_Recipe( + true, + new ItemStack[] { input, cells > 0 ? Materials.Empty.getCells(cells) : null }, stOutputs.toArray(new ItemStack[0]), - new ItemStack[] { input }, null, null, + new FluidStack[] { null }, new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, - null, (int) Math.max( - 1L, - Math.abs( - werkstoff.getStats().getProtons() - / werkstoff.getContents().getValue().size())), - Math.min(4, werkstoff.getContents().getValue().size()) * 30, - 0); + 1L, + Math.abs( + werkstoff.getStats() + .getMass() + / werkstoff.getContents() + .getValue() + .size())), + Math.min( + 4, + werkstoff.getContents() + .getValue() + .size()) + * 5, + 0)); + GT_Recipe tRecipe = new GT_Recipe( + false, + stOutputs.toArray(new ItemStack[0]), + new ItemStack[] { input }, + null, + null, + new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, + null, + (int) Math.max( + 1L, + Math.abs( + werkstoff.getStats() + .getProtons() + / werkstoff.getContents() + .getValue() + .size())), + Math.min( + 4, + werkstoff.getContents() + .getValue() + .size()) + * 30, + 0); RecipeMaps.centrifugeNonCellRecipes.add(tRecipe); } - if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { + if (werkstoff.getGenerationFeatures() + .hasChemicalRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); - GT_Values.RA.stdBuilder().itemInputs(stOutputs.toArray(new ItemStack[0])).itemOutputs(input) - .fluidInputs(flOutputs.toArray(new FluidStack[0])) - .duration( - (int) Math.max( - 1L, - Math.abs( - werkstoff.getStats().getProtons() - / werkstoff.getContents().getValue().size()))) - .eut(Math.min(4, werkstoff.getContents().getValue().size()) * 30) - .addTo(GT_RecipeConstants.UniversalChemical); + GT_Values.RA.stdBuilder() + .itemInputs(stOutputs.toArray(new ItemStack[0])) + .itemOutputs(input) + .fluidInputs(flOutputs.toArray(new FluidStack[0])) + .duration( + (int) Math.max( + 1L, + Math.abs( + werkstoff.getStats() + .getProtons() + / werkstoff.getContents() + .getValue() + .size()))) + .eut( + Math.min( + 4, + werkstoff.getContents() + .getValue() + .size()) + * 30) + .addTo(GT_RecipeConstants.UniversalChemical); } - if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { + if (werkstoff.getGenerationFeatures() + .hasMixerRecipes()) { if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); short circuitID = werkstoff.getMixCircuit(); ItemStack circuit = circuitID == -1 ? null : GT_Utility.getIntegratedCircuit(circuitID); if (circuit != null) stOutputs.add(circuit); RecipeMaps.mixerRecipes.add( - new GT_Recipe( - true, - stOutputs.toArray(new ItemStack[0]), - new ItemStack[] { input }, - null, - null, - new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, - null, - (int) Math.max( - 1L, - Math.abs( - werkstoff.getStats().getMass() - / werkstoff.getContents().getValue().size())), - Math.min(4, werkstoff.getContents().getValue().size()) * 5, - 0)); - GT_Recipe tRecipe = new GT_Recipe( - false, + new GT_Recipe( + true, stOutputs.toArray(new ItemStack[0]), new ItemStack[] { input }, null, @@ -247,118 +305,223 @@ public class DustLoader implements IWerkstoffRunnable { new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, null, (int) Math.max( - 1L, - Math.abs( - werkstoff.getStats().getProtons() - / werkstoff.getContents().getValue().size())), - Math.min(4, werkstoff.getContents().getValue().size()) * 30, - 0); + 1L, + Math.abs( + werkstoff.getStats() + .getMass() + / werkstoff.getContents() + .getValue() + .size())), + Math.min( + 4, + werkstoff.getContents() + .getValue() + .size()) + * 5, + 0)); + GT_Recipe tRecipe = new GT_Recipe( + false, + stOutputs.toArray(new ItemStack[0]), + new ItemStack[] { input }, + null, + null, + new FluidStack[] { flOutputs.size() > 0 ? flOutputs.get(0) : null }, + null, + (int) Math.max( + 1L, + Math.abs( + werkstoff.getStats() + .getProtons() + / werkstoff.getContents() + .getValue() + .size())), + Math.min( + 4, + werkstoff.getContents() + .getValue() + .size()) + * 30, + 0); RecipeMaps.mixerNonCellRecipes.add(tRecipe); } } GT_ModHandler.addCraftingRecipe( - werkstoff.get(dust), - new Object[] { "TTT", "TTT", "TTT", 'T', werkstoff.get(dustTiny) }); + werkstoff.get(dust), + new Object[] { "TTT", "TTT", "TTT", 'T', werkstoff.get(dustTiny) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(dust), - new Object[] { "TT ", "TT ", 'T', - WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff) }); + werkstoff.get(dust), + new Object[] { "TT ", "TT ", 'T', WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff) }); GT_ModHandler.addCraftingRecipe( - WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff, 4), - new Object[] { " T ", 'T', werkstoff.get(dust) }); + WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff, 4), + new Object[] { " T ", 'T', werkstoff.get(dust) }); GT_ModHandler.addCraftingRecipe( - WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff, 9), - new Object[] { "T ", 'T', werkstoff.get(dust) }); + WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff, 9), + new Object[] { "T ", 'T', werkstoff.get(dust) }); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustTiny, 9), ItemList.Schematic_Dust.get(0L)) - .itemOutputs(werkstoff.get(dust)).duration(5 * SECONDS).eut(4).addTo(packagerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dustTiny, 9), ItemList.Schematic_Dust.get(0L)) + .itemOutputs(werkstoff.get(dust)) + .duration(5 * SECONDS) + .eut(4) + .addTo(packagerRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustSmall, 4), ItemList.Schematic_Dust.get(0L)) - .itemOutputs(werkstoff.get(dust)).duration(5 * SECONDS).eut(4).addTo(packagerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dustSmall, 4), ItemList.Schematic_Dust.get(0L)) + .itemOutputs(werkstoff.get(dust)) + .duration(5 * SECONDS) + .eut(4) + .addTo(packagerRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustTiny, 9), ItemList.Schematic_3by3.get(0L)) - .itemOutputs(werkstoff.get(dust)).duration(5 * SECONDS).eut(4).addTo(packagerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dustTiny, 9), ItemList.Schematic_3by3.get(0L)) + .itemOutputs(werkstoff.get(dust)) + .duration(5 * SECONDS) + .eut(4) + .addTo(packagerRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustSmall, 4), ItemList.Schematic_2by2.get(0L)) - .itemOutputs(werkstoff.get(dust)).duration(5 * SECONDS).eut(4).addTo(packagerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dustSmall, 4), ItemList.Schematic_2by2.get(0L)) + .itemOutputs(werkstoff.get(dust)) + .duration(5 * SECONDS) + .eut(4) + .addTo(packagerRecipes); - if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) { + if (werkstoff.hasItemType(ingot) && !werkstoff.getStats() + .isBlastFurnace()) { GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustTiny), werkstoff.get(nugget)); - } else if (werkstoff.hasItemType(ingot) && werkstoff.getStats().isBlastFurnace() - && werkstoff.getStats().getMeltingPoint() != 0) { + } else if (werkstoff.hasItemType(ingot) && werkstoff.getStats() + .isBlastFurnace() + && werkstoff.getStats() + .getMeltingPoint() != 0) { if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)) { GT_Values.RA.stdBuilder() - .itemInputs(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11)) - .itemOutputs( - werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) - : werkstoff.get(ingotHot)) - .fluidInputs(Materials.Nitrogen.getGas(1000)) - .duration( - Math.max(werkstoff.getStats().getMass() / 40L, 1L) - * werkstoff.getStats().getMeltingPoint()) - .eut(werkstoff.getStats().getMeltingVoltage()) - .metadata(COIL_HEAT, werkstoff.getStats().getMeltingPoint()) - .addTo(blastFurnaceRecipes); + .itemInputs(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11)) + .itemOutputs( + werkstoff.getStats() + .getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot)) + .fluidInputs(Materials.Nitrogen.getGas(1000)) + .duration( + Math.max( + werkstoff.getStats() + .getMass() / 40L, + 1L) + * werkstoff.getStats() + .getMeltingPoint()) + .eut( + werkstoff.getStats() + .getMeltingVoltage()) + .metadata( + COIL_HEAT, + werkstoff.getStats() + .getMeltingPoint()) + .addTo(blastFurnaceRecipes); } else if (werkstoff.contains(WerkstoffLoader.NOBLE_GAS_SMELTING)) { GT_Values.RA.stdBuilder() - .itemInputs(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11)) - .itemOutputs( - werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) - : werkstoff.get(ingotHot)) - .fluidInputs(Materials.Argon.getGas(1000)) - .duration( - Math.max(werkstoff.getStats().getMass() / 40L, 1L) - * werkstoff.getStats().getMeltingPoint()) - .eut(werkstoff.getStats().getMeltingVoltage()) - .metadata(COIL_HEAT, werkstoff.getStats().getMeltingPoint()) - .addTo(blastFurnaceRecipes); + .itemInputs(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11)) + .itemOutputs( + werkstoff.getStats() + .getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot)) + .fluidInputs(Materials.Argon.getGas(1000)) + .duration( + Math.max( + werkstoff.getStats() + .getMass() / 40L, + 1L) + * werkstoff.getStats() + .getMeltingPoint()) + .eut( + werkstoff.getStats() + .getMeltingVoltage()) + .metadata( + COIL_HEAT, + werkstoff.getStats() + .getMeltingPoint()) + .addTo(blastFurnaceRecipes); } else { GT_Values.RA.stdBuilder() - .itemInputs(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs( - werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) - : werkstoff.get(ingotHot)) - .duration( - Math.max(werkstoff.getStats().getMass() / 40L, 1L) - * werkstoff.getStats().getMeltingPoint()) - .eut(werkstoff.getStats().getMeltingVoltage()) - .metadata(COIL_HEAT, werkstoff.getStats().getMeltingPoint()) - .addTo(blastFurnaceRecipes); + .itemInputs(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs( + werkstoff.getStats() + .getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot)) + .duration( + Math.max( + werkstoff.getStats() + .getMass() / 40L, + 1L) + * werkstoff.getStats() + .getMeltingPoint()) + .eut( + werkstoff.getStats() + .getMeltingVoltage()) + .metadata( + COIL_HEAT, + werkstoff.getStats() + .getMeltingPoint()) + .addTo(blastFurnaceRecipes); - if (werkstoff.getStats().getMeltingPoint() <= 1000) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust)) - .itemOutputs(werkstoff.get(ingot)) - .duration( - (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) - * werkstoff.getStats().getMeltingPoint()) - .eut(0).metadata(ADDITIVE_AMOUNT, 9).addTo(primitiveBlastRecipes); + if (werkstoff.getStats() + .getMeltingPoint() <= 1000) { + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dust)) + .itemOutputs(werkstoff.get(ingot)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() / 40L, + 1L) * werkstoff.getStats() + .getMeltingPoint()) + .eut(0) + .metadata(ADDITIVE_AMOUNT, 9) + .addTo(primitiveBlastRecipes); } } } - if (werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().getMeltingPoint() > 1750) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingotHot)).itemOutputs(werkstoff.get(ingot)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 3L, 1L)).eut(TierEU.RECIPE_MV) - .addTo(vacuumFreezerRecipes); + if (werkstoff.getStats() + .isBlastFurnace() + && werkstoff.getStats() + .getMeltingPoint() > 1750) { + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingotHot)) + .itemOutputs(werkstoff.get(ingot)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() * 3L, + 1L)) + .eut(TierEU.RECIPE_MV) + .addTo(vacuumFreezerRecipes); } if (werkstoff.hasItemType(ingot)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)).itemOutputs(werkstoff.get(dust)) - .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot)) + .itemOutputs(werkstoff.get(dust)) + .duration(20 * SECONDS) + .eut(2) + .addTo(maceratorRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(nugget)).itemOutputs(werkstoff.get(dustTiny)) - .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(nugget)) + .itemOutputs(werkstoff.get(dustTiny)) + .duration(20 * SECONDS) + .eut(2) + .addTo(maceratorRecipes); } if (werkstoff.hasItemType(ingot) || werkstoff.hasItemType(gem)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).itemOutputs(werkstoff.get(dust, 9)) - .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(block)) + .itemOutputs(werkstoff.get(dust, 9)) + .duration(20 * SECONDS) + .eut(2) + .addTo(maceratorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java index c58b1a0241..187456a3b4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java @@ -61,149 +61,234 @@ public class GemLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(gem)) { - if (werkstoff.getGenerationFeatures().hasSifterRecipes() - || werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust)) { - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem, 9)).itemOutputs(werkstoff.get(block)) - .duration(15 * SECONDS).eut(2).addTo(compressorRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(block)).itemOutputs(werkstoff.get(gem, 9)) - .duration(5 * SECONDS).eut(24).addTo(hammerRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(crushedPurified)) - .itemOutputs( - werkstoff.get(gemExquisite), - werkstoff.get(gemFlawless), - werkstoff.get(gem), - werkstoff.get(gemFlawed), - werkstoff.get(gemChipped), - werkstoff.get(dust)) - .outputChances(200, 1000, 2500, 2000, 4000, 5000).duration(40 * SECONDS).eut(16) - .addTo(sifterRecipes); + if (werkstoff.getGenerationFeatures() + .hasSifterRecipes() || werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust)) { + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gem, 9)) + .itemOutputs(werkstoff.get(block)) + .duration(15 * SECONDS) + .eut(2) + .addTo(compressorRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(block)) + .itemOutputs(werkstoff.get(gem, 9)) + .duration(5 * SECONDS) + .eut(24) + .addTo(hammerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(crushedPurified)) + .itemOutputs( + werkstoff.get(gemExquisite), + werkstoff.get(gemFlawless), + werkstoff.get(gem), + werkstoff.get(gemFlawed), + werkstoff.get(gemChipped), + werkstoff.get(dust)) + .outputChances(200, 1000, 2500, 2000, 4000, 5000) + .duration(40 * SECONDS) + .eut(16) + .addTo(sifterRecipes); } - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemExquisite)).itemOutputs(werkstoff.get(dust, 4)) - .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawless)).itemOutputs(werkstoff.get(dust, 2)) - .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem)).itemOutputs(werkstoff.get(dust)) - .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawed)).itemOutputs(werkstoff.get(dustSmall, 2)) - .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemChipped)).itemOutputs(werkstoff.get(dustSmall)) - .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gemExquisite)) + .itemOutputs(werkstoff.get(dust, 4)) + .duration(20 * SECONDS) + .eut(2) + .addTo(maceratorRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gemFlawless)) + .itemOutputs(werkstoff.get(dust, 2)) + .duration(20 * SECONDS) + .eut(2) + .addTo(maceratorRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gem)) + .itemOutputs(werkstoff.get(dust)) + .duration(20 * SECONDS) + .eut(2) + .addTo(maceratorRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gemFlawed)) + .itemOutputs(werkstoff.get(dustSmall, 2)) + .duration(20 * SECONDS) + .eut(2) + .addTo(maceratorRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gemChipped)) + .itemOutputs(werkstoff.get(dustSmall)) + .duration(20 * SECONDS) + .eut(2) + .addTo(maceratorRecipes); GT_ModHandler.addCraftingRecipe( - werkstoff.get(gemFlawless, 2), - 0, - new Object[] { "h ", "W ", 'W', werkstoff.get(gemExquisite) }); + werkstoff.get(gemFlawless, 2), + 0, + new Object[] { "h ", "W ", 'W', werkstoff.get(gemExquisite) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(gem, 2), - 0, - new Object[] { "h ", "W ", 'W', werkstoff.get(gemFlawless) }); + werkstoff.get(gem, 2), + 0, + new Object[] { "h ", "W ", 'W', werkstoff.get(gemFlawless) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(gemFlawed, 2), - 0, - new Object[] { "h ", "W ", 'W', werkstoff.get(gem) }); + werkstoff.get(gemFlawed, 2), + 0, + new Object[] { "h ", "W ", 'W', werkstoff.get(gem) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(gemChipped, 2), - 0, - new Object[] { "h ", "W ", 'W', werkstoff.get(gemFlawed) }); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemExquisite)).itemOutputs(werkstoff.get(gemFlawless, 2)) - .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(hammerRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawless)).itemOutputs(werkstoff.get(gem, 2)) - .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(hammerRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem)).itemOutputs(werkstoff.get(gemFlawed, 2)) - .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(hammerRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawed)).itemOutputs(werkstoff.get(gemChipped, 2)) - .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(hammerRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemChipped)).itemOutputs(werkstoff.get(dustTiny)) - .duration(3 * SECONDS + 4 * TICKS).eut(16).addTo(hammerRecipes); + werkstoff.get(gemChipped, 2), + 0, + new Object[] { "h ", "W ", 'W', werkstoff.get(gemFlawed) }); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gemExquisite)) + .itemOutputs(werkstoff.get(gemFlawless, 2)) + .duration(3 * SECONDS + 4 * TICKS) + .eut(16) + .addTo(hammerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gemFlawless)) + .itemOutputs(werkstoff.get(gem, 2)) + .duration(3 * SECONDS + 4 * TICKS) + .eut(16) + .addTo(hammerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gem)) + .itemOutputs(werkstoff.get(gemFlawed, 2)) + .duration(3 * SECONDS + 4 * TICKS) + .eut(16) + .addTo(hammerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gemFlawed)) + .itemOutputs(werkstoff.get(gemChipped, 2)) + .duration(3 * SECONDS + 4 * TICKS) + .eut(16) + .addTo(hammerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gemChipped)) + .itemOutputs(werkstoff.get(dustTiny)) + .duration(3 * SECONDS + 4 * TICKS) + .eut(16) + .addTo(hammerRecipes); if (!werkstoff.contains(WerkstoffLoader.NO_BLAST)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawless, 3)) - .itemOutputs( - werkstoff.get(gemExquisite), - GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) - .duration(20 * TICKS).eut(TierEU.RECIPE_LV).metadata(ADDITIVE_AMOUNT, 8) - .addTo(implosionRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem, 3)) - .itemOutputs( - werkstoff.get(gemFlawless), - GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) - .duration(20 * TICKS).eut(TierEU.RECIPE_LV).metadata(ADDITIVE_AMOUNT, 8) - .addTo(implosionRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawed, 3)) - .itemOutputs(werkstoff.get(gem), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) - .duration(20 * TICKS).eut(TierEU.RECIPE_LV).metadata(ADDITIVE_AMOUNT, 8) - .addTo(implosionRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemChipped, 3)) - .itemOutputs(werkstoff.get(gemFlawed), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) - .duration(20 * TICKS).eut(TierEU.RECIPE_LV).metadata(ADDITIVE_AMOUNT, 8) - .addTo(implosionRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust, 4)) - .itemOutputs(werkstoff.get(gem, 3), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)) - .duration(20 * TICKS).eut(TierEU.RECIPE_LV).metadata(ADDITIVE_AMOUNT, 24) - .addTo(implosionRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gemFlawless, 3)) + .itemOutputs(werkstoff.get(gemExquisite), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) + .duration(20 * TICKS) + .eut(TierEU.RECIPE_LV) + .metadata(ADDITIVE_AMOUNT, 8) + .addTo(implosionRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gem, 3)) + .itemOutputs(werkstoff.get(gemFlawless), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) + .duration(20 * TICKS) + .eut(TierEU.RECIPE_LV) + .metadata(ADDITIVE_AMOUNT, 8) + .addTo(implosionRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gemFlawed, 3)) + .itemOutputs(werkstoff.get(gem), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) + .duration(20 * TICKS) + .eut(TierEU.RECIPE_LV) + .metadata(ADDITIVE_AMOUNT, 8) + .addTo(implosionRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gemChipped, 3)) + .itemOutputs(werkstoff.get(gemFlawed), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)) + .duration(20 * TICKS) + .eut(TierEU.RECIPE_LV) + .metadata(ADDITIVE_AMOUNT, 8) + .addTo(implosionRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dust, 4)) + .itemOutputs(werkstoff.get(gem, 3), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)) + .duration(20 * TICKS) + .eut(TierEU.RECIPE_LV) + .metadata(ADDITIVE_AMOUNT, 24) + .addTo(implosionRecipes); } if (werkstoff.hasItemType(plate)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)) - .itemOutputs(werkstoff.get(lens), werkstoff.get(dustSmall)).duration(60 * SECONDS) - .eut(TierEU.RECIPE_MV).addTo(latheRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(plate)) + .itemOutputs(werkstoff.get(lens), werkstoff.get(dustSmall)) + .duration(60 * SECONDS) + .eut(TierEU.RECIPE_MV) + .addTo(latheRecipes); } - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemExquisite)) - .itemOutputs(werkstoff.get(lens), werkstoff.get(dust, 2)).duration(2 * MINUTES) - .eut(TierEU.RECIPE_LV).addTo(latheRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gemExquisite)) + .itemOutputs(werkstoff.get(lens), werkstoff.get(dust, 2)) + .duration(2 * MINUTES) + .eut(TierEU.RECIPE_LV) + .addTo(latheRecipes); final ITexture texture = TextureFactory.of( - Textures.BlockIcons.MACHINE_CASINGS[2][0], - TextureFactory.of(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false)); + Textures.BlockIcons.MACHINE_CASINGS[2][0], + TextureFactory.of(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false)); GregTech_API.registerCover( - werkstoff.get(lens), - texture, - new gregtech.common.covers.GT_Cover_Lens( - BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex, - texture)); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(lens)).itemOutputs(werkstoff.get(dustSmall, 3)) - .duration(20 * SECONDS).eut(2).addTo(maceratorRecipes); - - for (ItemStack is : OreDictionary.getOres( - "craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) { + werkstoff.get(lens), + texture, + new gregtech.common.covers.GT_Cover_Lens( + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex, + texture)); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(lens)) + .itemOutputs(werkstoff.get(dustSmall, 3)) + .duration(20 * SECONDS) + .eut(2) + .addTo(maceratorRecipes); + + for (ItemStack is : OreDictionary + .getOres("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) { is.stackSize = 0; - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemChipped, 3), is) - .itemOutputs(werkstoff.get(gemFlawed, 1)).duration(30 * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(laserEngraverRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawed, 3), is).itemOutputs(werkstoff.get(gem, 1)) - .duration(30 * SECONDS).eut(TierEU.RECIPE_MV).addTo(laserEngraverRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem, 3), is) - .itemOutputs(werkstoff.get(gemFlawless, 1)).duration(60 * SECONDS).eut(TierEU.RECIPE_HV) - .addTo(laserEngraverRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gemFlawless, 3), is) - .itemOutputs(werkstoff.get(gemExquisite, 1)).duration(2 * MINUTES).eut(2000) - .addTo(laserEngraverRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gemChipped, 3), is) + .itemOutputs(werkstoff.get(gemFlawed, 1)) + .duration(30 * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(laserEngraverRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gemFlawed, 3), is) + .itemOutputs(werkstoff.get(gem, 1)) + .duration(30 * SECONDS) + .eut(TierEU.RECIPE_MV) + .addTo(laserEngraverRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gem, 3), is) + .itemOutputs(werkstoff.get(gemFlawless, 1)) + .duration(60 * SECONDS) + .eut(TierEU.RECIPE_HV) + .addTo(laserEngraverRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gemFlawless, 3), is) + .itemOutputs(werkstoff.get(gemExquisite, 1)) + .duration(2 * MINUTES) + .eut(2000) + .addTo(laserEngraverRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java index 9447b0f43b..d969ff056f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java @@ -32,17 +32,35 @@ public class MetalLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(ingot)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 9)).itemOutputs(werkstoff.get(block)) - .duration(15 * SECONDS).eut(2).addTo(compressorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot, 9)) + .itemOutputs(werkstoff.get(block)) + .duration(15 * SECONDS) + .eut(2) + .addTo(compressorRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 9), ItemList.Shape_Extruder_Block.get(0)) - .itemOutputs(werkstoff.get(block)).duration((int) werkstoff.getStats().getMass()) - .eut(8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15).addTo(extruderRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot, 9), ItemList.Shape_Extruder_Block.get(0)) + .itemOutputs(werkstoff.get(block)) + .duration( + (int) werkstoff.getStats() + .getMass()) + .eut( + 8 * werkstoff.getStats() + .getMeltingPoint() >= 2800 ? 60 : 15) + .addTo(extruderRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 9), ItemList.Shape_Mold_Block.get(0L)) - .itemOutputs(werkstoff.get(block)).duration((int) (werkstoff.getStats().getMass() / 2)) - .eut(4 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15) - .recipeCategory(RecipeCategories.alloySmelterMolding).addTo(RecipeMaps.alloySmelterRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot, 9), ItemList.Shape_Mold_Block.get(0L)) + .itemOutputs(werkstoff.get(block)) + .duration( + (int) (werkstoff.getStats() + .getMass() / 2)) + .eut( + 4 * werkstoff.getStats() + .getMeltingPoint() >= 2800 ? 60 : 15) + .recipeCategory(RecipeCategories.alloySmelterMolding) + .addTo(RecipeMaps.alloySmelterRecipes); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java index eca18f2888..86cc6aa732 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -67,108 +67,239 @@ public class MoltenCellLoader implements IWerkstoffRunnable { return; } - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dust)).fluidOutputs(werkstoff.getMolten(144)) - .duration(15 * SECONDS).eut(2).recipeCategory(RecipeCategories.fluidExtractorRecycling) - .addTo(fluidExtractionRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustSmall)).fluidOutputs(werkstoff.getMolten(36)) - .duration(15 * SECONDS).eut(2).recipeCategory(RecipeCategories.fluidExtractorRecycling) - .addTo(fluidExtractionRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(dustTiny)).fluidOutputs(werkstoff.getMolten(16)) - .duration(15 * SECONDS).eut(2).recipeCategory(RecipeCategories.fluidExtractorRecycling) - .addTo(fluidExtractionRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dust)) + .fluidOutputs(werkstoff.getMolten(144)) + .duration(15 * SECONDS) + .eut(2) + .recipeCategory(RecipeCategories.fluidExtractorRecycling) + .addTo(fluidExtractionRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dustSmall)) + .fluidOutputs(werkstoff.getMolten(36)) + .duration(15 * SECONDS) + .eut(2) + .recipeCategory(RecipeCategories.fluidExtractorRecycling) + .addTo(fluidExtractionRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(dustTiny)) + .fluidOutputs(werkstoff.getMolten(16)) + .duration(15 * SECONDS) + .eut(2) + .recipeCategory(RecipeCategories.fluidExtractorRecycling) + .addTo(fluidExtractionRecipes); } else { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)).fluidOutputs(werkstoff.getMolten(144)) - .duration(15 * SECONDS).eut(2).recipeCategory(RecipeCategories.fluidExtractorRecycling) - .addTo(fluidExtractionRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(nugget)).fluidOutputs(werkstoff.getMolten(16)) - .duration(15 * SECONDS).eut(2).recipeCategory(RecipeCategories.fluidExtractorRecycling) - .addTo(fluidExtractionRecipes); - - GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Ingot.get(0)).itemOutputs(werkstoff.get(ingot)) - .fluidInputs(werkstoff.getMolten(144)).duration((int) werkstoff.getStats().getMass()) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); - - GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Nugget.get(0)).itemOutputs(werkstoff.get(nugget)) - .fluidInputs(werkstoff.getMolten(16)).duration((int) ((double) werkstoff.getStats().getMass() / 9D)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); - - GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Block.get(0)).itemOutputs(werkstoff.get(block)) - .fluidInputs(werkstoff.getMolten(1296)).duration((int) werkstoff.getStats().getMass() * 9) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot)) + .fluidOutputs(werkstoff.getMolten(144)) + .duration(15 * SECONDS) + .eut(2) + .recipeCategory(RecipeCategories.fluidExtractorRecycling) + .addTo(fluidExtractionRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(nugget)) + .fluidOutputs(werkstoff.getMolten(16)) + .duration(15 * SECONDS) + .eut(2) + .recipeCategory(RecipeCategories.fluidExtractorRecycling) + .addTo(fluidExtractionRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.Shape_Mold_Ingot.get(0)) + .itemOutputs(werkstoff.get(ingot)) + .fluidInputs(werkstoff.getMolten(144)) + .duration( + (int) werkstoff.getStats() + .getMass()) + .eut( + werkstoff.getStats() + .getMass() > 128 ? 64 : 30) + .addTo(fluidSolidifierRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.Shape_Mold_Nugget.get(0)) + .itemOutputs(werkstoff.get(nugget)) + .fluidInputs(werkstoff.getMolten(16)) + .duration( + (int) ((double) werkstoff.getStats() + .getMass() / 9D)) + .eut( + werkstoff.getStats() + .getMass() > 128 ? 64 : 30) + .addTo(fluidSolidifierRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.Shape_Mold_Block.get(0)) + .itemOutputs(werkstoff.get(block)) + .fluidInputs(werkstoff.getMolten(1296)) + .duration( + (int) werkstoff.getStats() + .getMass() * 9) + .eut( + werkstoff.getStats() + .getMass() > 128 ? 64 : 30) + .addTo(fluidSolidifierRecipes); if (!werkstoff.hasItemType(plate)) { return; } - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stickLong)).fluidOutputs(werkstoff.getMolten(144)) - .duration(15 * SECONDS).eut(2).recipeCategory(RecipeCategories.fluidExtractorRecycling) - .addTo(fluidExtractionRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)).fluidOutputs(werkstoff.getMolten(144)) - .duration(15 * SECONDS).eut(2).recipeCategory(RecipeCategories.fluidExtractorRecycling) - .addTo(fluidExtractionRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick)).fluidOutputs(werkstoff.getMolten(72)) - .duration(15 * SECONDS).eut(2).recipeCategory(RecipeCategories.fluidExtractorRecycling) - .addTo(fluidExtractionRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(stickLong)) + .fluidOutputs(werkstoff.getMolten(144)) + .duration(15 * SECONDS) + .eut(2) + .recipeCategory(RecipeCategories.fluidExtractorRecycling) + .addTo(fluidExtractionRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(plate)) + .fluidOutputs(werkstoff.getMolten(144)) + .duration(15 * SECONDS) + .eut(2) + .recipeCategory(RecipeCategories.fluidExtractorRecycling) + .addTo(fluidExtractionRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(stick)) + .fluidOutputs(werkstoff.getMolten(72)) + .duration(15 * SECONDS) + .eut(2) + .recipeCategory(RecipeCategories.fluidExtractorRecycling) + .addTo(fluidExtractionRecipes); } - if (werkstoff.getGenerationFeatures().hasMetalCraftingSolidifierRecipes()) { + if (werkstoff.getGenerationFeatures() + .hasMetalCraftingSolidifierRecipes()) { if (!werkstoff.hasItemType(plate)) { return; } - GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Rod_Long.get(0)) - .itemOutputs(werkstoff.get(stickLong)).fluidInputs(werkstoff.getMolten(144)) - .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); - - GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Rod.get(0)).itemOutputs(werkstoff.get(stick)) - .fluidInputs(werkstoff.getMolten(72)) - .duration((int) Math.max(werkstoff.getStats().getMass() / 2, 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); - - GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Plate.get(0)).itemOutputs(werkstoff.get(plate)) - .fluidInputs(werkstoff.getMolten(144)).duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.Shape_Mold_Rod_Long.get(0)) + .itemOutputs(werkstoff.get(stickLong)) + .fluidInputs(werkstoff.getMolten(144)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass(), + 1L)) + .eut( + werkstoff.getStats() + .getMass() > 128 ? 64 : 30) + .addTo(fluidSolidifierRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.Shape_Mold_Rod.get(0)) + .itemOutputs(werkstoff.get(stick)) + .fluidInputs(werkstoff.getMolten(72)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() / 2, + 1L)) + .eut( + werkstoff.getStats() + .getMass() > 128 ? 64 : 30) + .addTo(fluidSolidifierRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.Shape_Mold_Plate.get(0)) + .itemOutputs(werkstoff.get(plate)) + .fluidInputs(werkstoff.getMolten(144)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass(), + 1L)) + .eut( + werkstoff.getStats() + .getMass() > 128 ? 64 : 30) + .addTo(fluidSolidifierRecipes); } - if (werkstoff.getGenerationFeatures().hasMetaSolidifierRecipes()) { + if (werkstoff.getGenerationFeatures() + .hasMetaSolidifierRecipes()) { if (!werkstoff.hasItemType(screw)) { return; } - GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Screw.get(0)).itemOutputs(werkstoff.get(screw)) - .fluidInputs(werkstoff.getMolten(18)) - .duration((int) Math.max(werkstoff.getStats().getMass() / 8, 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); - - GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Gear.get(0)).itemOutputs(werkstoff.get(gearGt)) - .fluidInputs(werkstoff.getMolten(576)) - .duration((int) Math.max(werkstoff.getStats().getMass() / 4, 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); - - GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Gear_Small.get(0)) - .itemOutputs(werkstoff.get(gearGtSmall)).fluidInputs(werkstoff.getMolten(144)) - .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); - - GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Bolt.get(0)).itemOutputs(werkstoff.get(bolt)) - .fluidInputs(werkstoff.getMolten(18)) - .duration((int) Math.max(werkstoff.getStats().getMass() / 8, 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); - - GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Ring.get(0)).itemOutputs(werkstoff.get(ring)) - .fluidInputs(werkstoff.getMolten(36)) - .duration((int) Math.max(werkstoff.getStats().getMass() / 4, 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.Shape_Mold_Screw.get(0)) + .itemOutputs(werkstoff.get(screw)) + .fluidInputs(werkstoff.getMolten(18)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() / 8, + 1L)) + .eut( + werkstoff.getStats() + .getMass() > 128 ? 64 : 30) + .addTo(fluidSolidifierRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.Shape_Mold_Gear.get(0)) + .itemOutputs(werkstoff.get(gearGt)) + .fluidInputs(werkstoff.getMolten(576)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() / 4, + 1L)) + .eut( + werkstoff.getStats() + .getMass() > 128 ? 64 : 30) + .addTo(fluidSolidifierRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.Shape_Mold_Gear_Small.get(0)) + .itemOutputs(werkstoff.get(gearGtSmall)) + .fluidInputs(werkstoff.getMolten(144)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass(), + 1L)) + .eut( + werkstoff.getStats() + .getMass() > 128 ? 64 : 30) + .addTo(fluidSolidifierRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.Shape_Mold_Bolt.get(0)) + .itemOutputs(werkstoff.get(bolt)) + .fluidInputs(werkstoff.getMolten(18)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() / 8, + 1L)) + .eut( + werkstoff.getStats() + .getMass() > 128 ? 64 : 30) + .addTo(fluidSolidifierRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.Shape_Mold_Ring.get(0)) + .itemOutputs(werkstoff.get(ring)) + .fluidInputs(werkstoff.getMolten(36)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() / 4, + 1L)) + .eut( + werkstoff.getStats() + .getMass() > 128 ? 64 : 30) + .addTo(fluidSolidifierRecipes); // No Spring Molds @@ -176,53 +307,71 @@ public class MoltenCellLoader implements IWerkstoffRunnable { return; } - GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Rotor.get(0)).itemOutputs(werkstoff.get(rotor)) - .fluidInputs(werkstoff.getMolten(612)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 4.25, 1L)) - .eut(werkstoff.getStats().getMass() > 128 ? 64 : 30).addTo(fluidSolidifierRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.Shape_Mold_Rotor.get(0)) + .itemOutputs(werkstoff.get(rotor)) + .fluidInputs(werkstoff.getMolten(612)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() * 4.25, + 1L)) + .eut( + werkstoff.getStats() + .getMass() > 128 ? 64 : 30) + .addTo(fluidSolidifierRecipes); } - if (werkstoff.getGenerationFeatures().hasMultipleMetalSolidifierRecipes() - && !werkstoff.hasItemType(plateDouble)) { + if (werkstoff.getGenerationFeatures() + .hasMultipleMetalSolidifierRecipes() && !werkstoff.hasItemType(plateDouble)) { // No multiple plate molds return; } // Tank "Recipe" final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData( - new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), - werkstoff.get(cellMolten), - Materials.Empty.getCells(1)); - FluidContainerRegistry.registerFluidContainer( - werkstoff.getMolten(144), - werkstoff.get(cellMolten), - Materials.Empty.getCells(1)); + new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), + werkstoff.get(cellMolten), + Materials.Empty.getCells(1)); + FluidContainerRegistry + .registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(cellMolten), Materials.Empty.getCells(1)); GT_Utility.addFluidContainerData(data); - GT_Values.RA.stdBuilder().itemInputs(Materials.Empty.getCells(1)).itemOutputs(werkstoff.get(cellMolten)) - .fluidInputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)) - .duration(2 * TICKS).eut(2).addTo(fluidCannerRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(cellMolten)).itemOutputs(Materials.Empty.getCells(1)) - .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)) - .duration(2 * TICKS).eut(2).addTo(fluidCannerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(Materials.Empty.getCells(1)) + .itemOutputs(werkstoff.get(cellMolten)) + .fluidInputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)) + .duration(2 * TICKS) + .eut(2) + .addTo(fluidCannerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(cellMolten)) + .itemOutputs(Materials.Empty.getCells(1)) + .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)) + .duration(2 * TICKS) + .eut(2) + .addTo(fluidCannerRecipes); if (!Forestry.isModLoaded()) return; final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( - new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), - werkstoff.get(capsuleMolten), - GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1)); + new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), + werkstoff.get(capsuleMolten), + GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1)); FluidContainerRegistry.registerFluidContainer( - werkstoff.getMolten(144), - werkstoff.get(capsuleMolten), - GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1)); + werkstoff.getMolten(144), + werkstoff.get(capsuleMolten), + GT_ModHandler.getModItem(Forestry.ID, "refractoryEmpty", 1)); GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(capsuleMolten)) - .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)) - .duration(2 * TICKS).eut(2).addTo(fluidCannerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(capsuleMolten)) + .fluidOutputs(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)) + .duration(2 * TICKS) + .eut(2) + .addTo(fluidCannerRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java index fa6252c545..5975b7b898 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java @@ -38,24 +38,31 @@ public class MultipleMetalLoader implements IWerkstoffRunnable { public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(plateDense)) { RecipeMaps.benderRecipes.add( - new GT_Recipe( - true, - new ItemStack[] { werkstoff.get(ingot, 2), GT_Utility.getIntegratedCircuit(2) }, - new ItemStack[] { werkstoff.get(plateDouble) }, - null, - null, - null, - null, - (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), - 60, - 0)); + new GT_Recipe( + true, + new ItemStack[] { werkstoff.get(ingot, 2), GT_Utility.getIntegratedCircuit(2) }, + new ItemStack[] { werkstoff.get(plateDouble) }, + null, + null, + null, + null, + (int) Math.max( + werkstoff.getStats() + .getMass() * 2, + 1L), + 60, + 0)); GregTech_API.registerCover( - werkstoff.get(plateDouble), - TextureFactory.of(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false), - null); + werkstoff.get(plateDouble), + TextureFactory.of(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false), + null); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plateDouble)).itemOutputs(werkstoff.get(dust, 2)) - .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(plateDouble)) + .itemOutputs(werkstoff.get(dust, 2)) + .duration(2 * TICKS) + .eut(8) + .addTo(maceratorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java index 581c475956..8c9d3837c9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java @@ -34,24 +34,29 @@ public class OreLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - if (werkstoff.hasItemType(ore) && werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) + if (werkstoff.hasItemType(ore) && werkstoff.hasItemType(ingot) + && !werkstoff.getStats() + .isBlastFurnace()) GT_ModHandler - .addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), werkstoff.get(ingot)); + .addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), werkstoff.get(ingot)); if (werkstoff.hasItemType(ore)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ore)) - .itemOutputs(werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(crushed)) - .duration(16 * TICKS).eut(10).addTo(hammerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ore)) + .itemOutputs(werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(crushed)) + .duration(16 * TICKS) + .eut(10) + .addTo(hammerRecipes); GT_ModHandler.addPulverisationRecipe( - werkstoff.get(ore), - werkstoff.get(crushed, 2), - werkstoff.contains(SubTag.CRYSTAL) ? werkstoff.get(gem) : werkstoff.getOreByProduct(0, dust), - werkstoff.getNoOfByProducts() > 0 ? 10 : 0, - Materials.Stone.getDust(1), - 50, - true); + werkstoff.get(ore), + werkstoff.get(crushed, 2), + werkstoff.contains(SubTag.CRYSTAL) ? werkstoff.get(gem) : werkstoff.getOreByProduct(0, dust), + werkstoff.getNoOfByProducts() > 0 ? 10 : 0, + Materials.Stone.getDust(1), + 50, + true); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/RawOreLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/RawOreLoader.java index f48d070d2e..2fbb086022 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/RawOreLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/RawOreLoader.java @@ -34,25 +34,29 @@ public class RawOreLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - if (werkstoff.hasItemType(rawOre) && werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) - GT_ModHandler.addSmeltingRecipe( - WerkstoffLoader.getCorrespondingItemStack(rawOre, werkstoff), - werkstoff.get(ingot)); + if (werkstoff.hasItemType(rawOre) && werkstoff.hasItemType(ingot) + && !werkstoff.getStats() + .isBlastFurnace()) + GT_ModHandler + .addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(rawOre, werkstoff), werkstoff.get(ingot)); if (werkstoff.hasItemType(rawOre)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(rawOre)) - .itemOutputs(werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(crushed)) - .duration(16 * TICKS).eut(10).addTo(hammerRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(rawOre)) + .itemOutputs(werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(crushed)) + .duration(16 * TICKS) + .eut(10) + .addTo(hammerRecipes); GT_ModHandler.addPulverisationRecipe( - werkstoff.get(rawOre), - werkstoff.get(crushed, 2), - werkstoff.contains(SubTag.CRYSTAL) ? werkstoff.get(gem) : werkstoff.getOreByProduct(0, dust), - werkstoff.getNoOfByProducts() > 0 ? 5 : 0, - Materials.Stone.getDust(1), - 50, - true); + werkstoff.get(rawOre), + werkstoff.get(crushed, 2), + werkstoff.contains(SubTag.CRYSTAL) ? werkstoff.get(gem) : werkstoff.getOreByProduct(0, dust), + werkstoff.getNoOfByProducts() > 0 ? 5 : 0, + Materials.Stone.getDust(1), + 50, + true); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java index 2978c5e3c0..88bfac24ee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java @@ -54,110 +54,196 @@ public class SimpleMetalLoader implements IWerkstoffRunnable { if (werkstoff.hasItemType(plate)) { if (werkstoff.hasItemType(gem)) { - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(gem)) - .itemOutputs(werkstoff.get(stick), werkstoff.get(dustSmall, 2)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 5L, 1L)).eut(16).addTo(latheRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(gem)) + .itemOutputs(werkstoff.get(stick), werkstoff.get(dustSmall, 2)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() * 5L, + 1L)) + .eut(16) + .addTo(latheRecipes); GT_ModHandler.addCraftingRecipe( - werkstoff.get(stick, 2), - GT_Proxy.tBits, - new Object[] { "s", "X", 'X', werkstoff.get(stickLong) }); + werkstoff.get(stick, 2), + GT_Proxy.tBits, + new Object[] { "s", "X", 'X', werkstoff.get(stickLong) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(stick), - GT_Proxy.tBits, - new Object[] { "f ", " X", 'X', werkstoff.get(gem) }); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick, 2)).itemOutputs(werkstoff.get(stickLong)) - .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)).eut(16).addTo(hammerRecipes); + werkstoff.get(stick), + GT_Proxy.tBits, + new Object[] { "f ", " X", 'X', werkstoff.get(gem) }); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(stick, 2)) + .itemOutputs(werkstoff.get(stickLong)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass(), + 1L)) + .eut(16) + .addTo(hammerRecipes); TextureSet texSet = werkstoff.getTexSet(); - ITexture texture = SideReference.Side.Client - ? TextureFactory.of( - texSet.mTextures[PrefixTextureLinker.blockTexMap - .getOrDefault(texSet, block.mTextureIndex)], - werkstoff.getRGBA(), - false) - : TextureFactory.of(texSet.mTextures[block.mTextureIndex], werkstoff.getRGBA(), false); + ITexture texture = SideReference.Side.Client ? TextureFactory.of( + texSet.mTextures[PrefixTextureLinker.blockTexMap.getOrDefault(texSet, block.mTextureIndex)], + werkstoff.getRGBA(), + false) : TextureFactory.of(texSet.mTextures[block.mTextureIndex], werkstoff.getRGBA(), false); GregTech_API.registerCover(werkstoff.get(plate), texture, null); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)).itemOutputs(werkstoff.get(dust)) - .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(plate)) + .itemOutputs(werkstoff.get(dust)) + .duration(2 * TICKS) + .eut(8) + .addTo(maceratorRecipes); return; } GT_ModHandler.addCraftingRecipe( - werkstoff.get(stick, 2), - GT_Proxy.tBits, - new Object[] { "s", "X", 'X', werkstoff.get(stickLong) }); + werkstoff.get(stick, 2), + GT_Proxy.tBits, + new Object[] { "s", "X", 'X', werkstoff.get(stickLong) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(stick), - GT_Proxy.tBits, - new Object[] { "f ", " X", 'X', werkstoff.get(ingot) }); + werkstoff.get(stick), + GT_Proxy.tBits, + new Object[] { "f ", " X", 'X', werkstoff.get(ingot) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(plate), - GT_Proxy.tBits, - new Object[] { "h", "X", "X", 'X', werkstoff.get(ingot) }); + werkstoff.get(plate), + GT_Proxy.tBits, + new Object[] { "h", "X", "X", 'X', werkstoff.get(ingot) }); GT_ModHandler.addCraftingRecipe( - werkstoff.get(foil, 2), - GT_Proxy.tBits, - new Object[] { "hX", 'X', werkstoff.get(plate) }); + werkstoff.get(foil, 2), + GT_Proxy.tBits, + new Object[] { "hX", 'X', werkstoff.get(plate) }); benderRecipes.add( - new GT_Recipe( - true, - new ItemStack[] { werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(1) }, - new ItemStack[] { werkstoff.get(plate) }, - null, - null, - null, - null, - (int) Math.max(werkstoff.getStats().getMass(), 1L), - 24, - 0)); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 3)).itemOutputs(werkstoff.get(plate, 2)) - .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)).eut(16).addTo(hammerRecipes); + new GT_Recipe( + true, + new ItemStack[] { werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(1) }, + new ItemStack[] { werkstoff.get(plate) }, + null, + null, + null, + null, + (int) Math.max( + werkstoff.getStats() + .getMass(), + 1L), + 24, + 0)); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot, 3)) + .itemOutputs(werkstoff.get(plate, 2)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass(), + 1L)) + .eut(16) + .addTo(hammerRecipes); GregTech_API.registerCover( - werkstoff.get(plate), - TextureFactory.of(werkstoff.getTexSet().mTextures[71], werkstoff.getRGBA(), false), - null); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)) - .itemOutputs(werkstoff.get(stick), werkstoff.get(dustSmall, 2)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 5L, 1L)).eut(16).addTo(latheRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate), GT_Utility.getIntegratedCircuit(1)) - .itemOutputs(werkstoff.get(foil, 4)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 1L, 1L)).eut(24).addTo(benderRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(10)) - .itemOutputs(werkstoff.get(foil, 4)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)).eut(24).addTo(benderRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick, 2)).itemOutputs(werkstoff.get(stickLong)) - .duration((int) Math.max(werkstoff.getStats().getMass(), 1L)).eut(16).addTo(hammerRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Plate.get(0)) - .itemOutputs(werkstoff.get(plate)).duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)) - .eut(45).addTo(extruderRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Rod.get(0)) - .itemOutputs(werkstoff.get(stick, 2)) - .duration((int) Math.max(werkstoff.getStats().getMass() * 2L, 1L)).eut(45).addTo(extruderRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot)).itemOutputs(werkstoff.get(dust)) - .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plate)).itemOutputs(werkstoff.get(dust)) - .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stickLong)).itemOutputs(werkstoff.get(dust)) - .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); - - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(stick)).itemOutputs(werkstoff.get(dustSmall, 2)) - .duration(2 * TICKS).eut(8).addTo(maceratorRecipes); + werkstoff.get(plate), + TextureFactory.of(werkstoff.getTexSet().mTextures[71], werkstoff.getRGBA(), false), + null); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot)) + .itemOutputs(werkstoff.get(stick), werkstoff.get(dustSmall, 2)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() * 5L, + 1L)) + .eut(16) + .addTo(latheRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(plate), GT_Utility.getIntegratedCircuit(1)) + .itemOutputs(werkstoff.get(foil, 4)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() * 1L, + 1L)) + .eut(24) + .addTo(benderRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(10)) + .itemOutputs(werkstoff.get(foil, 4)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() * 2L, + 1L)) + .eut(24) + .addTo(benderRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(stick, 2)) + .itemOutputs(werkstoff.get(stickLong)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass(), + 1L)) + .eut(16) + .addTo(hammerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Plate.get(0)) + .itemOutputs(werkstoff.get(plate)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() * 2L, + 1L)) + .eut(45) + .addTo(extruderRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot), ItemList.Shape_Extruder_Rod.get(0)) + .itemOutputs(werkstoff.get(stick, 2)) + .duration( + (int) Math.max( + werkstoff.getStats() + .getMass() * 2L, + 1L)) + .eut(45) + .addTo(extruderRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot)) + .itemOutputs(werkstoff.get(dust)) + .duration(2 * TICKS) + .eut(8) + .addTo(maceratorRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(plate)) + .itemOutputs(werkstoff.get(dust)) + .duration(2 * TICKS) + .eut(8) + .addTo(maceratorRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(stickLong)) + .itemOutputs(werkstoff.get(dust)) + .duration(2 * TICKS) + .eut(8) + .addTo(maceratorRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(stick)) + .itemOutputs(werkstoff.get(dustSmall, 2)) + .duration(2 * TICKS) + .eut(8) + .addTo(maceratorRecipes); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java index aa1d3531ec..499477a846 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java @@ -63,527 +63,540 @@ public class ToolLoader implements IWerkstoffRunnable { if (werkstoff.getBridgeMaterial().mDurability == 0) return; if (werkstoff.hasItemType(gem)) { - if (!werkstoff.getGenerationFeatures().isExtension()) GT_ModHandler.addCraftingRecipe( + if (!werkstoff.getGenerationFeatures() + .isExtension()) + GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.HARDHAMMER, - 1, - werkstoff.getBridgeMaterial(), - werkstoff.getBridgeMaterial().mHandleMaterial, - null), + GT_MetaGenerated_Tool_01.HARDHAMMER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "XX ", "XXS", "XX ", 'X', gem.get(werkstoff.getBridgeMaterial()), 'S', - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), - GT_Proxy.tBits, - new Object[] { "GGf", 'G', gem.get(werkstoff.getBridgeMaterial()) }); + GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), + GT_Proxy.tBits, + new Object[] { "GGf", 'G', gem.get(werkstoff.getBridgeMaterial()) }); } if (!werkstoff.hasItemType(plate)) return; // Disable recipe gen with handle Material for GT Materials - if (!werkstoff.getGenerationFeatures().isExtension()) { + if (!werkstoff.getGenerationFeatures() + .isExtension()) { GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SCREWDRIVER, - 1, - werkstoff.getBridgeMaterial(), - werkstoff.getBridgeMaterial().mHandleMaterial, - null), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { " fS", " Sh", "W ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SCREWDRIVER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { " fS", " Sh", "W ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(toolHeadWrench, werkstoff.getBridgeMaterial(), 1L), - GT_Proxy.tBits, - new Object[] { "hXW", "XRX", "WXd", 'X', plate.get(werkstoff.getBridgeMaterial()), 'S', - plate.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'R', - ring.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'W', - screw.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); + GT_OreDictUnificator.get(toolHeadWrench, werkstoff.getBridgeMaterial(), 1L), + GT_Proxy.tBits, + new Object[] { "hXW", "XRX", "WXd", 'X', plate.get(werkstoff.getBridgeMaterial()), 'S', + plate.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'R', + ring.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'W', + screw.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); GT_ModHandler.addShapelessCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.HARDHAMMER, - 1, - werkstoff.getBridgeMaterial(), - werkstoff.getBridgeMaterial().mHandleMaterial, - null), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { toolHeadHammer.get(werkstoff.getBridgeMaterial()), - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.HARDHAMMER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { toolHeadHammer.get(werkstoff.getBridgeMaterial()), + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.FILE, - 1, - werkstoff.getBridgeMaterial(), - werkstoff.getBridgeMaterial().mHandleMaterial, - null), - GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "P", "P", "S", 'P', plate.get(werkstoff.getBridgeMaterial()), 'S', - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.FILE, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "P", "P", "S", 'P', plate.get(werkstoff.getBridgeMaterial()), 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); GT_ModHandler.addShapelessCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SAW, - 1, - werkstoff.getBridgeMaterial(), - werkstoff.getBridgeMaterial().mHandleMaterial, - null), - new Object[] { toolHeadSaw.get(werkstoff.getBridgeMaterial()), - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SAW, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + new Object[] { toolHeadSaw.get(werkstoff.getBridgeMaterial()), + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Rubber, - new long[] { 100000L, 32L, 1L, -1L }), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', - plate.get(Materials.AnyRubber), 'S', - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', - ItemList.Battery_RE_LV_Lithium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Rubber, + new long[] { 100000L, 32L, 1L, -1L }), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', + plate.get(Materials.AnyRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', + ItemList.Battery_RE_LV_Lithium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SOLDERING_IRON_MV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Rubber, - new long[] { 400000L, 128L, 2L, -1L }), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', - plate.get(Materials.AnyRubber), 'S', - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', - ItemList.Battery_RE_MV_Lithium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SOLDERING_IRON_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Rubber, + new long[] { 400000L, 128L, 2L, -1L }), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', + plate.get(Materials.AnyRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', + ItemList.Battery_RE_MV_Lithium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SOLDERING_IRON_HV, - 1, - werkstoff.getBridgeMaterial(), - Materials.StyreneButadieneRubber, - new long[] { 1600000L, 512L, 3L, -1L }), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', - plate.get(Materials.StyreneButadieneRubber), 'S', - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', - ItemList.Battery_RE_HV_Lithium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SOLDERING_IRON_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StyreneButadieneRubber, + new long[] { 1600000L, 512L, 3L, -1L }), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', + plate.get(Materials.StyreneButadieneRubber), 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', + ItemList.Battery_RE_HV_Lithium.get(1L) }); if (!werkstoff.hasItemType(gem)) { GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.HARDHAMMER, - 1, - werkstoff.getBridgeMaterial(), - werkstoff.getBridgeMaterial().mHandleMaterial, - null), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "XX ", "XXS", "XX ", 'X', ingot.get(werkstoff.getBridgeMaterial()), 'S', - stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.HARDHAMMER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "XX ", "XXS", "XX ", 'X', ingot.get(werkstoff.getBridgeMaterial()), 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) }); } } GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.PLUNGER, - 1, - werkstoff.getBridgeMaterial(), - werkstoff.getBridgeMaterial(), - null), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "xRR", " SR", "S f", 'S', stick.get(werkstoff.getBridgeMaterial()), 'R', - plate.get(Materials.AnyRubber) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.PLUNGER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "xRR", " SR", "S f", 'S', stick.get(werkstoff.getBridgeMaterial()), 'R', + plate.get(Materials.AnyRubber) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.WRENCH, - 1, - werkstoff.getBridgeMaterial(), - werkstoff.getBridgeMaterial(), - null), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "IhI", "III", " I ", 'I', ingot.get(werkstoff.getBridgeMaterial()) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "IhI", "III", " I ", 'I', ingot.get(werkstoff.getBridgeMaterial()) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.CROWBAR, - 1, - werkstoff.getBridgeMaterial(), - werkstoff.getBridgeMaterial(), - null), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "hDS", "DSD", "SDf", 'S', stick.get(werkstoff.getBridgeMaterial()), 'D', Dyes.dyeBlue }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.CROWBAR, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "hDS", "DSD", "SDf", 'S', stick.get(werkstoff.getBridgeMaterial()), 'D', Dyes.dyeBlue }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.WIRECUTTER, - 1, - werkstoff.getBridgeMaterial(), - werkstoff.getBridgeMaterial(), - null), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PfP", "hPd", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', - plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial()) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WIRECUTTER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PfP", "hPd", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', + plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial()) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SCOOP, - 1, - werkstoff.getBridgeMaterial(), - werkstoff.getBridgeMaterial(), - null), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "SWS", "SSS", "xSh", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', - new ItemStack(Blocks.wool, 1, 32767) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SCOOP, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "SWS", "SSS", "xSh", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', + new ItemStack(Blocks.wool, 1, 32767) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.BRANCHCUTTER, - 1, - werkstoff.getBridgeMaterial(), - werkstoff.getBridgeMaterial(), - null), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PfP", "PdP", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', - plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial()) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.BRANCHCUTTER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PfP", "PdP", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', + plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial()) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.KNIFE, - 1, - werkstoff.getBridgeMaterial(), - werkstoff.getBridgeMaterial(), - null), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "fPh", " S ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', - plate.get(werkstoff.getBridgeMaterial()) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.KNIFE, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "fPh", " S ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', + plate.get(werkstoff.getBridgeMaterial()) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, - 1, - werkstoff.getBridgeMaterial(), - werkstoff.getBridgeMaterial(), - null), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PPf", "PP ", "Sh ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', - plate.get(werkstoff.getBridgeMaterial()) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PPf", "PP ", "Sh ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', + plate.get(werkstoff.getBridgeMaterial()) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.WRENCH_LV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Steel, - new long[] { 100000L, 32L, 1L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', - plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', - ItemList.Battery_RE_LV_Lithium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] { 100000L, 32L, 1L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), + 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.WRENCH_LV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Steel, - new long[] { 75000L, 32L, 1L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', - plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', - ItemList.Battery_RE_LV_Cadmium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] { 75000L, 32L, 1L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), + 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.WRENCH_LV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Steel, - new long[] { 50000L, 32L, 1L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', - plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', - ItemList.Battery_RE_LV_Sodium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] { 50000L, 32L, 1L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), + 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.WRENCH_MV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Aluminium, - new long[] { 400000L, 128L, 2L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', - plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', - ItemList.Battery_RE_MV_Lithium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] { 400000L, 128L, 2L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', + plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', + ItemList.Battery_RE_MV_Lithium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.WRENCH_MV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Aluminium, - new long[] { 300000L, 128L, 2L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', - plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', - ItemList.Battery_RE_MV_Cadmium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] { 300000L, 128L, 2L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', + plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', + ItemList.Battery_RE_MV_Cadmium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.WRENCH_MV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Aluminium, - new long[] { 200000L, 128L, 2L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', - plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', - ItemList.Battery_RE_MV_Sodium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] { 200000L, 128L, 2L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', + plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', + ItemList.Battery_RE_MV_Sodium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.WRENCH_HV, - 1, - werkstoff.getBridgeMaterial(), - Materials.StainlessSteel, - new long[] { 1600000L, 512L, 3L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', - plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', - ItemList.Battery_RE_HV_Lithium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] { 1600000L, 512L, 3L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', + plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', + ItemList.Battery_RE_HV_Lithium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.WRENCH_HV, - 1, - werkstoff.getBridgeMaterial(), - Materials.StainlessSteel, - new long[] { 1200000L, 512L, 3L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', - plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', - ItemList.Battery_RE_HV_Cadmium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] { 1200000L, 512L, 3L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', + plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', + ItemList.Battery_RE_HV_Cadmium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.WRENCH_HV, - 1, - werkstoff.getBridgeMaterial(), - Materials.StainlessSteel, - new long[] { 800000L, 512L, 3L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', - plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', - ItemList.Battery_RE_HV_Sodium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] { 800000L, 512L, 3L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', + plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', + ItemList.Battery_RE_HV_Sodium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Steel, - new long[] { 100000L, 32L, 1L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', - plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', - ItemList.Battery_RE_LV_Lithium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] { 100000L, 32L, 1L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), + 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Steel, - new long[] { 75000L, 32L, 1L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', - plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', - ItemList.Battery_RE_LV_Cadmium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] { 75000L, 32L, 1L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), + 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Steel, - new long[] { 50000L, 32L, 1L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', - plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', - ItemList.Battery_RE_LV_Sodium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] { 50000L, 32L, 1L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), + 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), - GT_Proxy.tBits, - new Object[] { "II ", "IIh", "II ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', - ingot.get(werkstoff.getBridgeMaterial()) }); + GT_OreDictUnificator.get(toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), + GT_Proxy.tBits, + new Object[] { "II ", "IIh", "II ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', + ingot.get(werkstoff.getBridgeMaterial()) }); if (werkstoff.hasItemType(plateDouble) && werkstoff.hasItemType(cellMolten)) { GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(turbineBlade, werkstoff.getBridgeMaterial(), 1L), - GT_Proxy.tBits, - new Object[] { "fPd", "SPS", " P ", 'P', plateDouble.get(werkstoff.getBridgeMaterial()), 'S', - screw.get(werkstoff.getBridgeMaterial()) }); + GT_OreDictUnificator.get(turbineBlade, werkstoff.getBridgeMaterial(), 1L), + GT_Proxy.tBits, + new Object[] { "fPd", "SPS", " P ", 'P', plateDouble.get(werkstoff.getBridgeMaterial()), 'S', + screw.get(werkstoff.getBridgeMaterial()) }); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(ingot, 6), ItemList.Shape_Extruder_Turbine_Blade.get(0)) - .itemOutputs(werkstoff.get(turbineBlade, 1)).duration((int) werkstoff.getStats().getMass() / 2 * 20) - .eut(TierEU.RECIPE_MV).addTo(extruderRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(ingot, 6), ItemList.Shape_Extruder_Turbine_Blade.get(0)) + .itemOutputs(werkstoff.get(turbineBlade, 1)) + .duration( + (int) werkstoff.getStats() + .getMass() / 2 * 20) + .eut(TierEU.RECIPE_MV) + .addTo(extruderRecipes); - GT_Values.RA.stdBuilder().itemInputs(ItemList.Shape_Mold_Turbine_Blade.get(0)) - .itemOutputs(werkstoff.get(turbineBlade, 1)).fluidInputs(werkstoff.getMolten(864)) - .duration((int) werkstoff.getStats().getMass() * 20).eut(TierEU.RECIPE_MV) - .addTo(fluidSolidifierRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.Shape_Mold_Turbine_Blade.get(0)) + .itemOutputs(werkstoff.get(turbineBlade, 1)) + .fluidInputs(werkstoff.getMolten(864)) + .duration( + (int) werkstoff.getStats() + .getMass() * 20) + .eut(TierEU.RECIPE_MV) + .addTo(fluidSolidifierRecipes); - GT_Values.RA.stdBuilder().itemInputs(werkstoff.get(plateDouble, 3), werkstoff.get(screw, 2)) - .itemOutputs(werkstoff.get(turbineBlade, 1)) - .duration((werkstoff.getStats().getMass() / 4) * SECONDS).eut(TierEU.RECIPE_LV) - .addTo(formingPressRecipes); + GT_Values.RA.stdBuilder() + .itemInputs(werkstoff.get(plateDouble, 3), werkstoff.get(screw, 2)) + .itemOutputs(werkstoff.get(turbineBlade, 1)) + .duration( + (werkstoff.getStats() + .getMass() / 4) * SECONDS) + .eut(TierEU.RECIPE_LV) + .addTo(formingPressRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - werkstoff.get(turbineBlade, 4), - GT_OreDictUnificator.get(stickLong, Materials.Magnalium, 1)) - .itemOutputs( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.TURBINE_SMALL, - 1, - werkstoff.getBridgeMaterial(), - Materials.Magnalium, - null)) - .duration(8 * SECONDS).eut(100).addTo(assemblerRecipes); + .itemInputs(werkstoff.get(turbineBlade, 4), GT_OreDictUnificator.get(stickLong, Materials.Magnalium, 1)) + .itemOutputs( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE_SMALL, + 1, + werkstoff.getBridgeMaterial(), + Materials.Magnalium, + null)) + .duration(8 * SECONDS) + .eut(100) + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - werkstoff.get(turbineBlade, 8), - GT_OreDictUnificator.get(stickLong, Materials.Titanium, 1)) - .itemOutputs( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.TURBINE, - 1, - werkstoff.getBridgeMaterial(), - Materials.Titanium, - null)) - .duration(16 * SECONDS).eut(400).addTo(assemblerRecipes); + .itemInputs(werkstoff.get(turbineBlade, 8), GT_OreDictUnificator.get(stickLong, Materials.Titanium, 1)) + .itemOutputs( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE, + 1, + werkstoff.getBridgeMaterial(), + Materials.Titanium, + null)) + .duration(16 * SECONDS) + .eut(400) + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - werkstoff.get(turbineBlade, 12), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 1)) - .itemOutputs( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.TURBINE_LARGE, - 1, - werkstoff.getBridgeMaterial(), - Materials.TungstenSteel, - null)) - .duration(32 * SECONDS).eut(1600).addTo(assemblerRecipes); + .itemInputs( + werkstoff.get(turbineBlade, 12), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 1)) + .itemOutputs( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE_LARGE, + 1, + werkstoff.getBridgeMaterial(), + Materials.TungstenSteel, + null)) + .duration(32 * SECONDS) + .eut(1600) + .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() - .itemInputs( - werkstoff.get(turbineBlade, 16), - GT_OreDictUnificator.get(stickLong, Materials.Americium, 1)) - .itemOutputs( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.TURBINE_HUGE, - 1, - werkstoff.getBridgeMaterial(), - Materials.Americium, - null)) - .duration(1 * MINUTES + 4 * SECONDS).eut(6400).addTo(assemblerRecipes); + .itemInputs( + werkstoff.get(turbineBlade, 16), + GT_OreDictUnificator.get(stickLong, Materials.Americium, 1)) + .itemOutputs( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE_HUGE, + 1, + werkstoff.getBridgeMaterial(), + Materials.Americium, + null)) + .duration(1 * MINUTES + 4 * SECONDS) + .eut(6400) + .addTo(assemblerRecipes); } if (!werkstoff.hasItemType(gem)) { GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), - GT_Proxy.tBits, - new Object[] { "PP ", "fh ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', - ingot.get(werkstoff.getBridgeMaterial()) }); + GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), + GT_Proxy.tBits, + new Object[] { "PP ", "fh ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', + ingot.get(werkstoff.getBridgeMaterial()) }); } GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_MV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Aluminium, - new long[] { 400000L, 128L, 2L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', - plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', - ItemList.Battery_RE_MV_Lithium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] { 400000L, 128L, 2L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', + plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', + ItemList.Battery_RE_MV_Lithium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_MV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Aluminium, - new long[] { 300000L, 128L, 2L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', - plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', - ItemList.Battery_RE_MV_Cadmium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] { 300000L, 128L, 2L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', + plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', + ItemList.Battery_RE_MV_Cadmium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_MV, - 1, - werkstoff.getBridgeMaterial(), - Materials.Aluminium, - new long[] { 200000L, 128L, 2L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', - plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', - ItemList.Battery_RE_MV_Sodium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] { 200000L, 128L, 2L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', + plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', + ItemList.Battery_RE_MV_Sodium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_HV, - 1, - werkstoff.getBridgeMaterial(), - Materials.StainlessSteel, - new long[] { 1600000L, 512L, 3L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', - plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', - ItemList.Battery_RE_HV_Lithium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] { 1600000L, 512L, 3L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', + plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', + ItemList.Battery_RE_HV_Lithium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_HV, - 1, - werkstoff.getBridgeMaterial(), - Materials.StainlessSteel, - new long[] { 1200000L, 512L, 3L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', - plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', - ItemList.Battery_RE_HV_Cadmium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] { 1200000L, 512L, 3L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', + plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', + ItemList.Battery_RE_HV_Cadmium.get(1L) }); GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - SCREWDRIVER_HV, - 1, - werkstoff.getBridgeMaterial(), - Materials.StainlessSteel, - new long[] { 800000L, 512L, 3L, -1L }), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', - ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', - plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', - ItemList.Battery_RE_HV_Sodium.get(1L) }); + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] { 800000L, 512L, 3L, -1L }), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', + ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', + plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', + ItemList.Battery_RE_HV_Sodium.get(1L) }); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java index e7019d75e2..5dafebb48e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java @@ -42,73 +42,80 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { // aDensityMultiplier, int aDensityDivider, Dyes aColor, String aConfigSection, boolean aCustomOre, String // aCustomID Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() - : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) - : new Materials( - -1, - werkstoff.getTexSet(), - werkstoff.getToolSpeed(), - werkstoff.getDurability(), - werkstoff.getToolQuality(), - 0, - werkstoff.getRGBA()[0], - werkstoff.getRGBA()[1], - werkstoff.getRGBA()[2], - werkstoff.getRGBA()[3], - werkstoff.getVarName(), - werkstoff.getDefaultName(), - 0, - 0, - werkstoff.getStats().getMeltingPoint(), - werkstoff.getStats().getMeltingPoint(), - werkstoff.getStats().isBlastFurnace(), - false, - 0, - 1, - 1, - null); + : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) + : new Materials( + -1, + werkstoff.getTexSet(), + werkstoff.getToolSpeed(), + werkstoff.getDurability(), + werkstoff.getToolQuality(), + 0, + werkstoff.getRGBA()[0], + werkstoff.getRGBA()[1], + werkstoff.getRGBA()[2], + werkstoff.getRGBA()[3], + werkstoff.getVarName(), + werkstoff.getDefaultName(), + 0, + 0, + werkstoff.getStats() + .getMeltingPoint(), + werkstoff.getStats() + .getMeltingPoint(), + werkstoff.getStats() + .isBlastFurnace(), + false, + 0, + 1, + 1, + null); for (OrePrefixes prefixes : values()) { if (prefixes != cell || !Werkstoff.Types.ELEMENT.equals(werkstoff.getType())) { if (prefixes == dust && Werkstoff.Types.ELEMENT.equals(werkstoff.getType()) - && Werkstoff.Types.ELEMENT.equals(werkstoff.getType())) { + && Werkstoff.Types.ELEMENT.equals(werkstoff.getType())) { boolean ElementSet = false; for (Element e : Element.values()) { - if (e.toString().equals(werkstoff.getToolTip())) { + if (e.toString() + .equals(werkstoff.getToolTip())) { if (!e.mLinkedMaterials.isEmpty()) break; werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null - ? werkstoff.getBridgeMaterial() - : Materials.get(werkstoff.getVarName()) != Materials._NULL - ? Materials.get(werkstoff.getVarName()) - : new Materials( - -1, - werkstoff.getTexSet(), - werkstoff.getToolSpeed(), - werkstoff.getDurability(), - werkstoff.getToolQuality(), - 0, - werkstoff.getRGBA()[0], - werkstoff.getRGBA()[1], - werkstoff.getRGBA()[2], - werkstoff.getRGBA()[3], - werkstoff.getVarName(), - werkstoff.getDefaultName(), - 0, - 0, - werkstoff.getStats().getMeltingPoint(), - werkstoff.getStats().getMeltingPoint(), - werkstoff.getStats().isBlastFurnace(), - false, - 0, - 1, - 1, - null); + ? werkstoff.getBridgeMaterial() + : Materials.get(werkstoff.getVarName()) != Materials._NULL + ? Materials.get(werkstoff.getVarName()) + : new Materials( + -1, + werkstoff.getTexSet(), + werkstoff.getToolSpeed(), + werkstoff.getDurability(), + werkstoff.getToolQuality(), + 0, + werkstoff.getRGBA()[0], + werkstoff.getRGBA()[1], + werkstoff.getRGBA()[2], + werkstoff.getRGBA()[3], + werkstoff.getVarName(), + werkstoff.getDefaultName(), + 0, + 0, + werkstoff.getStats() + .getMeltingPoint(), + werkstoff.getStats() + .getMeltingPoint(), + werkstoff.getStats() + .isBlastFurnace(), + false, + 0, + 1, + 1, + null); werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials = new ArrayList<>(); e.mLinkedMaterials.add(werkstoffBridgeMaterial); if (werkstoff.hasItemType(dust)) { GT_OreDictUnificator - .addAssociation(dust, werkstoffBridgeMaterial, werkstoff.get(dust), false); + .addAssociation(dust, werkstoffBridgeMaterial, werkstoff.get(dust), false); GT_OreDictUnificator - .set(dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true); + .set(dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true); } ElementSet = true; break; @@ -122,12 +129,15 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { if (werkstoff.hasItemType(cell)) { werkstoffBridgeMaterial.setHasCorrespondingFluid(true); werkstoffBridgeMaterial.setHasCorrespondingGas(true); - werkstoffBridgeMaterial.mFluid = werkstoff.getFluidOrGas(1).getFluid(); - werkstoffBridgeMaterial.mGas = werkstoff.getFluidOrGas(1).getFluid(); + werkstoffBridgeMaterial.mFluid = werkstoff.getFluidOrGas(1) + .getFluid(); + werkstoffBridgeMaterial.mGas = werkstoff.getFluidOrGas(1) + .getFluid(); } if (werkstoff.hasItemType(cellMolten)) { - werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid(); + werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1) + .getFluid(); } werkstoffBridgeMaterial.mName = werkstoff.getVarName(); werkstoffBridgeMaterial.mDefaultLocalName = werkstoff.getDefaultName(); @@ -135,23 +145,26 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { if ("null".equals(werkstoffBridgeMaterial.mLocalizedName)) // only reload from lang file if not localized already werkstoffBridgeMaterial.mLocalizedName = GT_LanguageManager.addStringLocalization( - "Material." + werkstoffBridgeMaterial.mName.toLowerCase(), - werkstoffBridgeMaterial.mDefaultLocalName); + "Material." + werkstoffBridgeMaterial.mName.toLowerCase(), + werkstoffBridgeMaterial.mDefaultLocalName); if (Thaumcraft.isModLoaded()) { werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects(); } werkstoffBridgeMaterial.mMaterialInto = werkstoffBridgeMaterial; werkstoffBridgeMaterial.mHandleMaterial = werkstoff.contains(SubTag.BURNING) ? Materials.Blaze - : werkstoff.contains(SubTag.MAGICAL) ? Materials.Thaumium - : werkstoffBridgeMaterial.mDurability > 5120 ? Materials.TungstenSteel - : werkstoffBridgeMaterial.mDurability > 1280 ? Materials.Steel : Materials.Wood; - if (werkstoff.getStats().isRadioactive()) { + : werkstoff.contains(SubTag.MAGICAL) ? Materials.Thaumium + : werkstoffBridgeMaterial.mDurability > 5120 ? Materials.TungstenSteel + : werkstoffBridgeMaterial.mDurability > 1280 ? Materials.Steel : Materials.Wood; + if (werkstoff.getStats() + .isRadioactive()) { werkstoffBridgeMaterial.setEnchantmentForArmors( - Enchantment_Radioactivity.INSTANCE, - werkstoff.getStats().getEnchantmentlvl()); + Enchantment_Radioactivity.INSTANCE, + werkstoff.getStats() + .getEnchantmentlvl()); werkstoffBridgeMaterial.setEnchantmentForTools( - Enchantment_Radioactivity.INSTANCE, - werkstoff.getStats().getEnchantmentlvl()); + Enchantment_Radioactivity.INSTANCE, + werkstoff.getStats() + .getEnchantmentlvl()); } werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java index c91b9cb053..b2287b48b5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java @@ -27,14 +27,14 @@ public class CasingRegistrator implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { GT_OreDictUnificator.addAssociation( - OrePrefixes.blockCasing, - werkstoff.getBridgeMaterial(), - new ItemStack(WerkstoffLoader.BWBlockCasings, 1, werkstoff.getmID()), - false); + OrePrefixes.blockCasing, + werkstoff.getBridgeMaterial(), + new ItemStack(WerkstoffLoader.BWBlockCasings, 1, werkstoff.getmID()), + false); GT_OreDictUnificator.addAssociation( - OrePrefixes.blockCasingAdvanced, - werkstoff.getBridgeMaterial(), - new ItemStack(WerkstoffLoader.BWBlockCasingsAdvanced, 1, werkstoff.getmID()), - false); + OrePrefixes.blockCasingAdvanced, + werkstoff.getBridgeMaterial(), + new ItemStack(WerkstoffLoader.BWBlockCasingsAdvanced, 1, werkstoff.getmID()), + false); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java index bd3b30a95a..683b55b333 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java @@ -48,20 +48,23 @@ public class OreDictHandler { OreDictHandler.cache.clear(); OreDictHandler.cacheNonBW.clear(); for (String s : used) { - if (!OreDictionary.getOres(s).isEmpty()) { - ItemStack tmpstack = OreDictionary.getOres(s).get(0).copy(); + if (!OreDictionary.getOres(s) + .isEmpty()) { + ItemStack tmpstack = OreDictionary.getOres(s) + .get(0) + .copy(); Pair p = new Pair<>( - Item.getIdFromItem(tmpstack.getItem()), - (short) tmpstack.getItemDamage()); + Item.getIdFromItem(tmpstack.getItem()), + (short) tmpstack.getItemDamage()); OreDictHandler.cache.put(s, p); for (ItemStack tmp : OreDictionary.getOres(s)) { Pair p2 = new Pair<>( - Item.getIdFromItem(tmp.getItem()), - (short) tmp.getItemDamage()); + Item.getIdFromItem(tmp.getItem()), + (short) tmp.getItemDamage()); GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); if (UI == null) UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); if (!MainMod.MOD_ID.equals(UI.modId) && !BartWorksCrossmod.MOD_ID.equals(UI.modId) - && !"BWCore".equals(UI.modId)) { + && !"BWCore".equals(UI.modId)) { OreDictHandler.cacheNonBW.add(p2); } } @@ -74,12 +77,16 @@ public class OreDictHandler { Pair p = OreDictHandler.cache.get(prefixes + elementName.replace(" ", "")); return new ItemStack(Item.getItemById(p.getKey()), amount, p.getValue()); } - if (!OreDictionary.getOres(prefixes + elementName.replace(" ", "")).isEmpty()) { - ItemStack tmp = GT_OreDictUnificator - .get(OreDictionary.getOres(prefixes + elementName.replace(" ", "")).get(0).copy()).copy(); + if (!OreDictionary.getOres(prefixes + elementName.replace(" ", "")) + .isEmpty()) { + ItemStack tmp = GT_OreDictUnificator.get( + OreDictionary.getOres(prefixes + elementName.replace(" ", "")) + .get(0) + .copy()) + .copy(); OreDictHandler.cache.put( - prefixes + elementName.replace(" ", ""), - new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage())); + prefixes + elementName.replace(" ", ""), + new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage())); tmp.stackSize = amount; return tmp; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java index 0590b522ca..3305741f27 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java @@ -61,7 +61,7 @@ public abstract class BW_OreLayer extends GT_Worldgen { public abstract String getDimName(); public BW_OreLayer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, - ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { + ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { super(aName, BW_OreLayer.sList, aDefault); this.mMinY = (short) aMinY; this.mMaxY = (short) aMaxY; @@ -77,13 +77,13 @@ public abstract class BW_OreLayer extends GT_Worldgen { if (sprinkled instanceof Werkstoff) this.bwOres = (byte) (this.bwOres | 0b0001); short aPrimary = top instanceof Materials ? (short) ((Materials) top).mMetaItemSubID - : top instanceof Werkstoff ? ((Werkstoff) top).getmID() : 0; + : top instanceof Werkstoff ? ((Werkstoff) top).getmID() : 0; short aSecondary = bottom instanceof Materials ? (short) ((Materials) bottom).mMetaItemSubID - : bottom instanceof Werkstoff ? ((Werkstoff) bottom).getmID() : 0; + : bottom instanceof Werkstoff ? ((Werkstoff) bottom).getmID() : 0; short aBetween = between instanceof Materials ? (short) ((Materials) between).mMetaItemSubID - : between instanceof Werkstoff ? ((Werkstoff) between).getmID() : 0; + : between instanceof Werkstoff ? ((Werkstoff) between).getmID() : 0; short aSporadic = sprinkled instanceof Materials ? (short) ((Materials) sprinkled).mMetaItemSubID - : sprinkled instanceof Werkstoff ? ((Werkstoff) sprinkled).getmID() : 0; + : sprinkled instanceof Werkstoff ? ((Werkstoff) sprinkled).getmID() : 0; this.mPrimaryMeta = aPrimary; this.mSecondaryMeta = aSecondary; this.mBetweenMeta = aBetween; @@ -97,17 +97,17 @@ public abstract class BW_OreLayer extends GT_Worldgen { public List getStacks() { ArrayList ret = new ArrayList<>(); ret.add( - (this.bwOres & 0b1000) != 0 ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mPrimaryMeta) - : new ItemStack(GregTech_API.sBlockOres1, 1, this.mPrimaryMeta)); + (this.bwOres & 0b1000) != 0 ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mPrimaryMeta) + : new ItemStack(GregTech_API.sBlockOres1, 1, this.mPrimaryMeta)); ret.add( - (this.bwOres & 0b0100) != 0 ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mSecondaryMeta) - : new ItemStack(GregTech_API.sBlockOres1, 1, this.mSecondaryMeta)); + (this.bwOres & 0b0100) != 0 ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mSecondaryMeta) + : new ItemStack(GregTech_API.sBlockOres1, 1, this.mSecondaryMeta)); ret.add( - (this.bwOres & 0b0010) != 0 ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mBetweenMeta) - : new ItemStack(GregTech_API.sBlockOres1, 1, this.mBetweenMeta)); + (this.bwOres & 0b0010) != 0 ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mBetweenMeta) + : new ItemStack(GregTech_API.sBlockOres1, 1, this.mBetweenMeta)); ret.add( - (this.bwOres & 0b0001) != 0 ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mSporadicMeta) - : new ItemStack(GregTech_API.sBlockOres1, 1, this.mSporadicMeta)); + (this.bwOres & 0b0001) != 0 ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mSporadicMeta) + : new ItemStack(GregTech_API.sBlockOres1, 1, this.mSporadicMeta)); return ret; } @@ -122,7 +122,7 @@ public abstract class BW_OreLayer extends GT_Worldgen { @Override public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, - int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { { int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); int cX = aChunkX - aRandom.nextInt(this.mSize); @@ -146,7 +146,7 @@ public abstract class BW_OreLayer extends GT_Worldgen { if (this.mBetweenMeta > 0 && this.shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { wasPlaced = this - .setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); + .setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); } if (this.mPrimaryMeta > 0) { @@ -159,7 +159,7 @@ public abstract class BW_OreLayer extends GT_Worldgen { if (this.mSporadicMeta > 0 && this.shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { wasPlaced = this - .setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); + .setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); } } } @@ -174,10 +174,9 @@ public abstract class BW_OreLayer extends GT_Worldgen { private boolean shouldPlace(Random aRandom, int cX, int eX, int tX, int cZ, int eZ, int tZ) { if (aRandom.nextInt( - Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 - || aRandom.nextInt( - Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) - == 0) + Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 + || aRandom.nextInt( + Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) return true; return false; } @@ -188,28 +187,28 @@ public abstract class BW_OreLayer extends GT_Worldgen { if (te instanceof BW_MetaGeneratedOreTE || te instanceof GT_TileEntity_Ores) return true; if (aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0 - || aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0 - || aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0 - || aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0) { + || aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0 + || aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0 + || aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0) { return isSmallOre - ? BW_MetaGenerated_SmallOres.setOreBlock( - aWorld, - aX, - aY, - aZ, - aMetaData, - false, - this.getDefaultBlockToReplace(), - this.getDefaultDamageToReplace()) - : BW_MetaGenerated_Ores.setOreBlock( - aWorld, - aX, - aY, - aZ, - aMetaData, - false, - this.getDefaultBlockToReplace(), - this.getDefaultDamageToReplace()); + ? BW_MetaGenerated_SmallOres.setOreBlock( + aWorld, + aX, + aY, + aZ, + aMetaData, + false, + this.getDefaultBlockToReplace(), + this.getDefaultDamageToReplace()) + : BW_MetaGenerated_Ores.setOreBlock( + aWorld, + aX, + aY, + aZ, + aMetaData, + false, + this.getDefaultBlockToReplace(), + this.getDefaultDamageToReplace()); } return this.setGTOreBlockSpace(aWorld, aX, aY, aZ, aMetaData, this.getDefaultBlockToReplace()); @@ -242,9 +241,8 @@ public abstract class BW_OreLayer extends GT_Worldgen { if (!(o instanceof BW_OreLayer that)) return false; if (this.bwOres != that.bwOres || this.mMinY != that.mMinY - || this.mWeight != that.mWeight - || this.mDensity != that.mDensity) - return false; + || this.mWeight != that.mWeight + || this.mDensity != that.mDensity) return false; if (this.mSize != that.mSize) return false; if (this.mMaxY != that.mMaxY) return false; if (this.mPrimaryMeta != that.mPrimaryMeta) return false; @@ -256,11 +254,20 @@ public abstract class BW_OreLayer extends GT_Worldgen { @Override public int hashCode() { return MurmurHash3.murmurhash3_x86_32( - ByteBuffer.allocate(37).put(this.bwOres).putInt(this.mMinY).putInt(this.mWeight).putInt(this.mDensity) - .putInt(this.mSize).putInt(this.mMaxY).putInt(this.mPrimaryMeta).putInt(this.mSecondaryMeta) - .putInt(this.mBetweenMeta).putInt(this.mSporadicMeta).array(), - 0, - 37, - 31); + ByteBuffer.allocate(37) + .put(this.bwOres) + .putInt(this.mMinY) + .putInt(this.mWeight) + .putInt(this.mDensity) + .putInt(this.mSize) + .putInt(this.mMaxY) + .putInt(this.mPrimaryMeta) + .putInt(this.mSecondaryMeta) + .putInt(this.mBetweenMeta) + .putInt(this.mSporadicMeta) + .array(), + 0, + 37, + 31); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java index 983a3b653c..40c2302fb0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java @@ -36,14 +36,14 @@ public class BW_WordGenerator implements IWorldGenerator { } public synchronized void generate(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, - IChunkProvider aChunkProvider) { + IChunkProvider aChunkProvider) { new BW_WordGenerator.WorldGenContainer( - aX * 16, - aZ * 16, - aWorld.provider.dimensionId, - aWorld, - aChunkGenerator, - aChunkProvider).run(); + aX * 16, + aZ * 16, + aWorld.provider.dimensionId, + aWorld, + aChunkGenerator, + aChunkProvider).run(); } public static class WorldGenContainer implements Runnable { @@ -57,7 +57,7 @@ public class BW_WordGenerator implements IWorldGenerator { public int mZ; public WorldGenContainer(int aX, int aZ, int aDimensionType, World aWorld, IChunkProvider aChunkGenerator, - IChunkProvider aChunkProvider) { + IChunkProvider aChunkProvider) { this.mX = aX; this.mZ = aZ; this.mDimensionType = aDimensionType; @@ -94,7 +94,7 @@ public class BW_WordGenerator implements IWorldGenerator { zCenter <<= 4; ChunkCoordIntPair centerChunk = new ChunkCoordIntPair(xCenter, zCenter); if (!BW_WordGenerator.WorldGenContainer.mGenerated.contains(centerChunk) - && this.surroundingChunksLoaded(xCenter, zCenter)) { + && this.surroundingChunksLoaded(xCenter, zCenter)) { BW_WordGenerator.WorldGenContainer.mGenerated.add(centerChunk); if (BW_OreLayer.sWeight > 0 && BW_OreLayer.sList.size() > 0) { boolean temp = true; @@ -111,14 +111,14 @@ public class BW_WordGenerator implements IWorldGenerator { int attempts = 0; do { placed = tWorldGen.executeWorldgen( - this.mWorld, - random, - "", - this.mDimensionType, - xCenter, - zCenter, - this.mChunkGenerator, - this.mChunkProvider); + this.mWorld, + random, + "", + this.mDimensionType, + xCenter, + zCenter, + this.mChunkGenerator, + this.mChunkProvider); ++attempts; } while (!placed && attempts < 25); temp = false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index 789d76ca55..6e0f0543e4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -76,135 +76,128 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { } public BW_WorldGenRoss128b(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, - int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, - ISubTagContainer sprinkled) { + int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, + ISubTagContainer sprinkled) { super(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, top, bottom, between, sprinkled); } public static void initOres() { new BW_WorldGenRoss128b( - "ore.mix.ross128.Thorianit", - true, - 30, - 60, - 17, - 1, - 16, - Thorianit, - Uraninite, - Lepidolite, - Spodumene); + "ore.mix.ross128.Thorianit", + true, + 30, + 60, + 17, + 1, + 16, + Thorianit, + Uraninite, + Lepidolite, + Spodumene); new BW_WorldGenRoss128b("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Graphite, Diamond, Coal, Graphite); new BW_WorldGenRoss128b( - "ore.mix.ross128.bismuth", - true, - 5, - 80, - 30, - 1, - 16, - Bismuthinit, - Stibnite, - Bismuth, - Bismutite); + "ore.mix.ross128.bismuth", + true, + 5, + 80, + 30, + 1, + 16, + Bismuthinit, + Stibnite, + Bismuth, + Bismutite); new BW_WorldGenRoss128b( - "ore.mix.ross128.TurmalinAlkali", - true, - 5, - 80, - 15, - 4, - 48, - Olenit, - FluorBuergerit, - ChromoAluminoPovondrait, - VanadioOxyDravit); + "ore.mix.ross128.TurmalinAlkali", + true, + 5, + 80, + 15, + 4, + 48, + Olenit, + FluorBuergerit, + ChromoAluminoPovondrait, + VanadioOxyDravit); new BW_WorldGenRoss128b( - "ore.mix.ross128.Roquesit", - true, - 30, - 50, - 3, - 1, - 12, - Arsenopyrite, - Ferberite, - Loellingit, - Roquesit); + "ore.mix.ross128.Roquesit", + true, + 30, + 50, + 3, + 1, + 12, + Arsenopyrite, + Ferberite, + Loellingit, + Roquesit); new BW_WorldGenRoss128b( - "ore.mix.ross128.Tungstate", - true, - 5, - 40, - 10, - 4, - 14, - Ferberite, - Huebnerit, - Loellingit, - Scheelite); + "ore.mix.ross128.Tungstate", + true, + 5, + 40, + 10, + 4, + 14, + Ferberite, + Huebnerit, + Loellingit, + Scheelite); new BW_WorldGenRoss128b( - "ore.mix.ross128.CopperSulfits", - true, - 40, - 70, - 80, - 3, - 24, - Djurleit, - Bornite, - Wittichenit, - Tetrahedrite); + "ore.mix.ross128.CopperSulfits", + true, + 40, + 70, + 80, + 3, + 24, + Djurleit, + Bornite, + Wittichenit, + Tetrahedrite); new BW_WorldGenRoss128b( - "ore.mix.ross128.Forsterit", - true, - 20, - 90, - 50, - 2, - 32, - Forsterit, - Fayalit, - DescloiziteCUVO4, - DescloiziteZNVO4); + "ore.mix.ross128.Forsterit", + true, + 20, + 90, + 50, + 2, + 32, + Forsterit, + Fayalit, + DescloiziteCUVO4, + DescloiziteZNVO4); new BW_WorldGenRoss128b( - "ore.mix.ross128.Hedenbergit", - true, - 20, - 90, - 50, - 2, - 32, - Hedenbergit, - Fayalit, - DescloiziteCUVO4, - DescloiziteZNVO4); + "ore.mix.ross128.Hedenbergit", + true, + 20, + 90, + 50, + 2, + 32, + Hedenbergit, + Fayalit, + DescloiziteCUVO4, + DescloiziteZNVO4); new BW_WorldGenRoss128b( - "ore.mix.ross128.RedZircon", - true, - 10, - 80, - 40, - 3, - 24, - Fayalit, - FuchsitAL, - RedZircon, - FuchsitCR); + "ore.mix.ross128.RedZircon", + true, + 10, + 80, + 40, + 3, + 24, + Fayalit, + FuchsitAL, + RedZircon, + FuchsitCR); } public static void initundergroundFluids() { String ross128b = StatCollector.translateToLocal("planet.Ross128b"); uo_dimensionList.SetConfigValues(ross128b, ross128b, "veryheavyoil", "liquid_extra_heavy_oil", 0, 625, 40, 5); - uo_dimensionList.SetConfigValues( - ross128b, - ross128b, - "lava", - FluidRegistry.getFluidName(FluidRegistry.LAVA), - 0, - 820, - 5, - 5); + uo_dimensionList + .SetConfigValues(ross128b, ross128b, "lava", FluidRegistry.getFluidName(FluidRegistry.LAVA), 0, 820, 5, 5); uo_dimensionList.SetConfigValues(ross128b, ross128b, "gas_natural_gas", "gas_natural_gas", 0, 625, 65, 5); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java index ad4bff0aad..7454b0dd93 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java @@ -55,8 +55,8 @@ import gregtech.api.interfaces.ISubTagContainer; public class BW_WorldGenRoss128ba extends BW_OreLayer { public BW_WorldGenRoss128ba(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, - int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, - ISubTagContainer sprinkled) { + int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, + ISubTagContainer sprinkled) { super(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, top, bottom, between, sprinkled); } @@ -81,123 +81,131 @@ public class BW_WorldGenRoss128ba extends BW_OreLayer { public static void init_Ores() { new BW_WorldGenRoss128ba( - "ore.mix.ross128ba.tib", - true, - 30, - 60, - 6, - 1, - 16, - Tiberium, - Tiberium, - NaquadahEnriched, - NaquadahEnriched); + "ore.mix.ross128ba.tib", + true, + 30, + 60, + 6, + 1, + 16, + Tiberium, + Tiberium, + NaquadahEnriched, + NaquadahEnriched); new BW_WorldGenRoss128ba( - "ore.mix.ross128ba.Tungstate", - true, - 5, - 40, - 60, - 4, - 14, - Ferberite, - Huebnerit, - Loellingit, - Scheelite); + "ore.mix.ross128ba.Tungstate", + true, + 5, + 40, + 60, + 4, + 14, + Ferberite, + Huebnerit, + Loellingit, + Scheelite); new BW_WorldGenRoss128ba( - "ore.mix.ross128ba.bart", - true, - 30, - 60, - 1, - 1, - 1, - BArTiMaEuSNeK, - BArTiMaEuSNeK, - BArTiMaEuSNeK, - BArTiMaEuSNeK); + "ore.mix.ross128ba.bart", + true, + 30, + 60, + 1, + 1, + 1, + BArTiMaEuSNeK, + BArTiMaEuSNeK, + BArTiMaEuSNeK, + BArTiMaEuSNeK); new BW_WorldGenRoss128ba( - "ore.mix.ross128ba.TurmalinAlkali", - true, - 5, - 80, - 60, - 4, - 48, - Olenit, - FluorBuergerit, - ChromoAluminoPovondrait, - VanadioOxyDravit); + "ore.mix.ross128ba.TurmalinAlkali", + true, + 5, + 80, + 60, + 4, + 48, + Olenit, + FluorBuergerit, + ChromoAluminoPovondrait, + VanadioOxyDravit); new BW_WorldGenRoss128ba( - "ore.mix.ross128ba.Amethyst", - true, - 5, - 80, - 35, - 2, - 8, - Amethyst, - Olivine, - Prasiolite, - Hedenbergit); + "ore.mix.ross128ba.Amethyst", + true, + 5, + 80, + 35, + 2, + 8, + Amethyst, + Olivine, + Prasiolite, + Hedenbergit); new BW_WorldGenRoss128ba( - "ore.mix.ross128ba.CopperSulfits", - true, - 40, - 70, - 80, - 3, - 24, - Djurleit, - Bornite, - Wittichenit, - Tetrahedrite); + "ore.mix.ross128ba.CopperSulfits", + true, + 40, + 70, + 80, + 3, + 24, + Djurleit, + Bornite, + Wittichenit, + Tetrahedrite); new BW_WorldGenRoss128ba( - "ore.mix.ross128ba.RedZircon", - true, - 10, - 80, - 40, - 3, - 24, - Fayalit, - FuchsitAL, - RedZircon, - FuchsitCR); + "ore.mix.ross128ba.RedZircon", + true, + 10, + 80, + 40, + 3, + 24, + Fayalit, + FuchsitAL, + RedZircon, + FuchsitCR); new BW_WorldGenRoss128ba( - "ore.mix.ross128ba.Fluorspar", - true, - 10, - 80, - 35, - 4, - 8, - Galena, - Sphalerite, - Fluorspar, - Barite); + "ore.mix.ross128ba.Fluorspar", + true, + 10, + 80, + 35, + 4, + 8, + Galena, + Sphalerite, + Fluorspar, + Barite); } public static void init_undergroundFluids() { String ross128b = StatCollector.translateToLocal("moon.Ross128ba"); uo_dimensionList.SetConfigValues( - ross128b, - ross128b, - SaltWater.getFluid(1).getFluid().getName(), - SaltWater.getFluid(1).getFluid().getName(), - 0, - 1250, - 40, - 5); + ross128b, + ross128b, + SaltWater.getFluid(1) + .getFluid() + .getName(), + SaltWater.getFluid(1) + .getFluid() + .getName(), + 0, + 1250, + 40, + 5); uo_dimensionList.SetConfigValues( - ross128b, - ross128b, - Helium_3.getGas(1).getFluid().getName(), - Helium_3.getGas(1).getFluid().getName(), - 0, - 1250, - 60, - 5); + ross128b, + ross128b, + Helium_3.getGas(1) + .getFluid() + .getName(), + Helium_3.getGas(1) + .getFluid() + .getName(), + 0, + 1250, + 60, + 5); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java index e94e7b6e71..ef6b88cc5a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java @@ -84,7 +84,7 @@ public abstract class MapGenRuins extends WorldGenerator { int[] statBlocks = new int[4]; protected void setRandomBlockWAirChance(World worldObj, int x, int y, int z, Random rand, int airchance, - Pair... blocks) { + Pair... blocks) { if (rand.nextInt(100) > airchance) this.setRandomBlock(worldObj, x, y, z, rand, blocks); else this.setBlock(worldObj, x, y, z, Blocks.air, 0); } @@ -113,12 +113,12 @@ public abstract class MapGenRuins extends WorldGenerator { if (isEnabled) throw new IllegalStateException("Machine Block Runnable needs to be disabled while creating world!"); this.setBlockAndNotifyAdequately( - worldObj, - x, - y, - z, - GT_WorldgenUtil.GT_TILES, - GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); + worldObj, + x, + y, + z, + GT_WorldgenUtil.GT_TILES, + GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); TileEntity tile = worldObj.getTileEntity(x, y, z); ((IGregTechTileEntity) tile).setInitialValuesAsNBT(null, (short) meta); return tile; @@ -143,7 +143,7 @@ public abstract class MapGenRuins extends WorldGenerator { } protected void setGTMachine(World worldObj, int x, int y, int z, int meta, String ownerName, - ForgeDirection facing) { + ForgeDirection facing) { try { GT_Runnable_MachineBlockUpdate.setDisabled(); } catch (Throwable ignored) {} @@ -159,7 +159,7 @@ public abstract class MapGenRuins extends WorldGenerator { } private void checkTile(BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, - ForgeDirection facing, int depth) { + ForgeDirection facing, int depth) { if (depth < 25) { if (BTE.getMetaTileID() != meta || worldObj.getTileEntity(x, y, z) != BTE || BTE.isInvalid()) { this.redoTile(BTE, worldObj, x, y, z, meta, ownerName, facing); @@ -173,7 +173,7 @@ public abstract class MapGenRuins extends WorldGenerator { } private void redoTile(BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, - ForgeDirection facing) { + ForgeDirection facing) { this.reSetGTTileEntity(BTE, worldObj, x, y, z, meta); BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z); BTE.setOwnerName(ownerName); @@ -187,7 +187,9 @@ public abstract class MapGenRuins extends WorldGenerator { BaseMetaPipeEntity BTE = (BaseMetaPipeEntity) this.setGTMachineBlock(worldObj, x, y, z, meta); MetaPipeEntity MPE = (MetaPipeEntity) BTE.getMetaTileEntity(); BTE.mConnections |= (byte) (1 << (byte) 4); - BTE.mConnections |= (byte) (1 << ForgeDirection.getOrientation(4).getOpposite().ordinal()); + BTE.mConnections |= (byte) (1 << ForgeDirection.getOrientation(4) + .getOpposite() + .ordinal()); BaseMetaTileEntity BPE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z - 1); if (BPE != null) { BTE.mConnections |= (byte) (1 << (byte) 2); @@ -241,13 +243,13 @@ public abstract class MapGenRuins extends WorldGenerator { } else if (dy > 0 && dy < 4) { if (Math.abs(dx) == 5 && Math.abs(dz) == 5) { this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + dy, - z + dz, - rand, - 5, - this.ToBuildWith[3][0]); + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 5, + this.ToBuildWith[3][0]); } else if (dx == 0 && dz == -5 && (dy == 1 || dy == 2)) { if (dy == 1) { this.setBlock(worldObj, x + dx, y + 1, z + -5, Blocks.iron_door, 1); @@ -257,45 +259,45 @@ public abstract class MapGenRuins extends WorldGenerator { } } else if (Math.abs(dx) == 5 && Math.abs(dz) < 5 || Math.abs(dz) == 5 && Math.abs(dx) < 5) { this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + dy, - z + dz, - rand, - 25, - this.ToBuildWith[1]); + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 25, + this.ToBuildWith[1]); if (dy == 2 && rand.nextInt(100) < 12) { if (useColor) { this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + 2, - z + dz, - rand, - 25, - new Pair<>(Blocks.stained_glass_pane, colored)); - } - } else { - this.setRandomBlockWAirChance( worldObj, x + dx, - y + dy, + y + 2, z + dz, rand, 25, - new Pair<>(Blocks.glass_pane, 0)); - } - } - - if (dy == 3 && Math.abs(dx) == 6) { - this.setRandomBlockWAirChance( + new Pair<>(Blocks.stained_glass_pane, colored)); + } + } else { + this.setRandomBlockWAirChance( worldObj, x + dx, - y + 3, + y + dy, z + dz, rand, 25, - this.ToBuildWith[2]); + new Pair<>(Blocks.glass_pane, 0)); + } + } + + if (dy == 3 && Math.abs(dx) == 6) { + this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + 3, + z + dz, + rand, + 25, + this.ToBuildWith[2]); } if (dy == 1) { @@ -307,34 +309,34 @@ public abstract class MapGenRuins extends WorldGenerator { IInventory chest = (IInventory) worldObj.getTileEntity(x + dx, y + dy, z + dz); if (chest != null) { WeightedRandomChestContent.generateChestContents( - secureRandom, - ChestGenHooks.getItems(PYRAMID_JUNGLE_CHEST, rand), - chest, - ChestGenHooks.getCount(PYRAMID_JUNGLE_CHEST, rand)); + secureRandom, + ChestGenHooks.getItems(PYRAMID_JUNGLE_CHEST, rand), + chest, + ChestGenHooks.getCount(PYRAMID_JUNGLE_CHEST, rand)); } } if (dx == 4 && dz == 4) { short meta = GT_WorldgenUtil.getGenerator(secureRandom, tier); this.setGTMachine( + worldObj, + x + dx, + y + dy, + z + dz, + meta, + owner, + tier > 0 ? ForgeDirection.WEST : ForgeDirection.UP); + } else if (dx == 3 && dz == 4) { + if (tier > 0) { + short meta = GT_WorldgenUtil.getBuffer(secureRandom, tier); + this.setGTMachine( worldObj, x + dx, y + dy, z + dz, meta, owner, - tier > 0 ? ForgeDirection.WEST : ForgeDirection.UP); - } else if (dx == 3 && dz == 4) { - if (tier > 0) { - short meta = GT_WorldgenUtil.getBuffer(secureRandom, tier); - this.setGTMachine( - worldObj, - x + dx, - y + dy, - z + dz, - meta, - owner, - ForgeDirection.WEST); + ForgeDirection.WEST); } else { this.setGTCablekWChance(worldObj, x + dx, y + dy, z + dz, rand, 33, cablemeta); } @@ -344,13 +346,13 @@ public abstract class MapGenRuins extends WorldGenerator { if (!lastset || treeinaRow > 2) { short meta = GT_WorldgenUtil.getMachine(secureRandom, tier); this.setGTMachine( - worldObj, - x + dx, - y + dy, - z + dz, - meta, - owner, - ForgeDirection.UP); + worldObj, + x + dx, + y + dy, + z + dz, + meta, + owner, + ForgeDirection.UP); set++; treeinaRow = 0; @@ -365,105 +367,105 @@ public abstract class MapGenRuins extends WorldGenerator { case 4: if (Math.abs(dx) == 5) { this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + 4, - z + dz, - rand, - 25, - this.ToBuildWith[2]); + worldObj, + x + dx, + y + 4, + z + dz, + rand, + 25, + this.ToBuildWith[2]); break; } if (Math.abs(dz) == 5 && Math.abs(dx) < 5) { this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + dy, - z + dz, - rand, - 25, - this.ToBuildWith[1]); + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 25, + this.ToBuildWith[1]); } break; case 5: if (Math.abs(dx) == 4) { this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + 5, - z + dz, - rand, - 25, - this.ToBuildWith[2]); + worldObj, + x + dx, + y + 5, + z + dz, + rand, + 25, + this.ToBuildWith[2]); break; } if (Math.abs(dz) == 5 && Math.abs(dx) < 4) { this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + dy, - z + dz, - rand, - 25, - this.ToBuildWith[1]); + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 25, + this.ToBuildWith[1]); } break; case 6: if (Math.abs(dx) == 3) { this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + 6, - z + dz, - rand, - 25, - this.ToBuildWith[2]); + worldObj, + x + dx, + y + 6, + z + dz, + rand, + 25, + this.ToBuildWith[2]); break; } if (Math.abs(dz) == 5 && Math.abs(dx) < 3) { this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + dy, - z + dz, - rand, - 25, - this.ToBuildWith[1]); + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 25, + this.ToBuildWith[1]); } break; case 7: if (Math.abs(dx) == 2) { this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + 7, - z + dz, - rand, - 25, - this.ToBuildWith[2]); + worldObj, + x + dx, + y + 7, + z + dz, + rand, + 25, + this.ToBuildWith[2]); break; } if (Math.abs(dz) == 5 && Math.abs(dx) < 2) { this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + dy, - z + dz, - rand, - 25, - this.ToBuildWith[1]); + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 25, + this.ToBuildWith[1]); } break; case 8: if (Math.abs(dx) == 1 || Math.abs(dx) == 0) { this.setRandomBlockWAirChance( - worldObj, - x + dx, - y + 8, - z + dz, - rand, - 25, - this.ToBuildWith[2]); + worldObj, + x + dx, + y + 8, + z + dz, + rand, + 25, + this.ToBuildWith[2]); } break; default: diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 27b16768b9..aec0972a67 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -46,74 +46,74 @@ public class BWRecipes { public boolean addRadHatch(ItemStack item, int radioLevel, int amount, short[] rgba) { return radioHatchRecipes.addRecipe( - new GT_Recipe( - false, - new ItemStack[] { item }, - null, - null, - new int[] { rgba[0], rgba[1], rgba[2] }, - null, - null, - amount, - radioLevel, - (int) calcDecayTicks(radioLevel))) - != null; + new GT_Recipe( + false, + new ItemStack[] { item }, + null, + null, + new int[] { rgba[0], rgba[1], rgba[2] }, + null, + null, + amount, + radioLevel, + (int) calcDecayTicks(radioLevel))) + != null; } public boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, ItemStack aSpecialItems, int[] aChances, - FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { return bioLabRecipes.addRecipe( - new GT_Recipe( - true, - aInputs, - new ItemStack[] { aOutput }, - aSpecialItems, - aChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue)) - != null; + new GT_Recipe( + true, + aInputs, + new ItemStack[] { aOutput }, + aSpecialItems, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)) + != null; } public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, - FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { + FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { return bioLabRecipes.addRecipe( - new GT_Recipe( - true, - new ItemStack[] { BioItemList.getPetriDish(null), aInput }, - new ItemStack[] { BioItemList.getPetriDish(aOutput) }, - null, - aChances, - aFluidInputs, - new FluidStack[] { GT_Values.NF }, - aDuration, - aEUt, - aSpecialValue)) - != null; + new GT_Recipe( + true, + new ItemStack[] { BioItemList.getPetriDish(null), aInput }, + new ItemStack[] { BioItemList.getPetriDish(aOutput) }, + null, + aChances, + aFluidInputs, + new FluidStack[] { GT_Values.NF }, + aDuration, + aEUt, + aSpecialValue)) + != null; } public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, - FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { + FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { return bioLabRecipes.addRecipe( - new GT_Recipe( - true, - new ItemStack[] { BioItemList.getPetriDish(null), aInput }, - new ItemStack[] { BioItemList.getPetriDish(aOutput) }, - null, - aChances, - new FluidStack[] { aFluidInputs }, - new FluidStack[] { GT_Values.NF }, - aDuration, - aEUt, - aSpecialValue)) - != null; + new GT_Recipe( + true, + new ItemStack[] { BioItemList.getPetriDish(null), aInput }, + new ItemStack[] { BioItemList.getPetriDish(aOutput) }, + null, + aChances, + new FluidStack[] { aFluidInputs }, + new FluidStack[] { GT_Values.NF }, + aDuration, + aEUt, + aSpecialValue)) + != null; } public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, @Nonnegative int aSv, - @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { + FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, @Nonnegative int aSv, + @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { int aSievert = 0; if (aSv >= 83 || aSv == 61 || aSv == 43) aSievert += aSv; aSievert = aSievert << 1; @@ -123,24 +123,24 @@ public class BWRecipes { aSievert = aSievert << 4; aSievert = aSievert | glasTier; return bacterialVatRecipes.addRecipe( - new GT_Recipe( - false, - aInputs, - null, - BioItemList.getPetriDish(aCulture), - new int[] {}, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSievert)) - != null; + new GT_Recipe( + false, + aInputs, + null, + BioItemList.getPetriDish(aCulture), + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSievert)) + != null; } @Deprecated public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative int glasTier, - int aSpecialValue, boolean exactSv) { + FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative int glasTier, + int aSpecialValue, boolean exactSv) { byte gTier = (byte) glasTier; int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) @@ -152,59 +152,59 @@ public class BWRecipes { aSievert = aSievert << 4; aSievert = aSievert | gTier; return bacterialVatRecipes.addRecipe( - new GT_Recipe( - false, - aInputs, - null, - BioItemList.getPetriDish(aCulture), - new int[] {}, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSievert)) - != null; + new GT_Recipe( + false, + aInputs, + null, + BioItemList.getPetriDish(aCulture), + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSievert)) + != null; } /** * Adds a Vat recipe without Rad requirements but with Glas requirements */ public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture culture, FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, int aDuration, int aEUt, byte glasTier) { + FluidStack[] aFluidOutputs, int aDuration, int aEUt, byte glasTier) { int aSievert = 0; aSievert = aSievert | glasTier; return bacterialVatRecipes.addRecipe( - new GT_Recipe( - false, - aInputs, - null, - BioItemList.getPetriDish(culture), - new int[] {}, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSievert)) - != null; + new GT_Recipe( + false, + aInputs, + null, + BioItemList.getPetriDish(culture), + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSievert)) + != null; } /** * Adds a Vat recipe without Rad or Glas requirements */ public boolean addBacterialVatRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, BioCulture culture, - FluidStack[] aFluidOutputs, int aDuration, int aEUt) { + FluidStack[] aFluidOutputs, int aDuration, int aEUt) { return bacterialVatRecipes.addRecipe( - new GT_Recipe( - false, - aInputs, - null, - BioItemList.getPetriDish(culture), - new int[] {}, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - 0)) - != null; + new GT_Recipe( + false, + aInputs, + null, + BioItemList.getPetriDish(culture), + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + 0)) + != null; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java index 5989c1b6d9..2e384c8e0c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java @@ -59,11 +59,10 @@ public class BW_ColorUtil { if (rgba[3] - 50 > rgba[0]) return Dyes.dyeMagenta; else if (rgba[0] > 200 && rgba[2] > 140) return Dyes.dyePink; else if (rgba[0] > rgba[1] + rgba[1] / 10 && rgba[0] > rgba[2] + rgba[2] / 10 - && rgba[1] >> 4 == rgba[2] >> 4 - && rgba[1] + 50 > rgba[0]) { - return Dyes.dyeBrown; - } else - return Dyes.dyeRed; + && rgba[1] >> 4 == rgba[2] >> 4 + && rgba[1] + 50 > rgba[0]) { + return Dyes.dyeBrown; + } else return Dyes.dyeRed; case 4: return Dyes._NULL; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java index 75d8d4cc62..b68f3fb437 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java @@ -31,23 +31,24 @@ public class BW_Tooltip_Reference { public static final String TT = TT_NO_RESET + GRAY; public static final Supplier ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = () -> StatCollector.translateToLocal( - "tooltip.bw.1.name") + " " + BW; + "tooltip.bw.1.name") + " " + BW; public static final Supplier ADDED_BY_BARTWORKS = () -> StatCollector.translateToLocal("tooltip.bw.0.name") - + " " - + BW; + + " " + + BW; public static final Function ADDED_VIA_BARTWORKS = owner -> String - .format(StatCollector.translateToLocal("tooltip.bw.via.name"), owner); + .format(StatCollector.translateToLocal("tooltip.bw.via.name"), owner); public static final String MULTIBLOCK_ADDED_BY_BARTWORKS = BW; public static final Function MULTIBLOCK_ADDED_VIA_BARTWORKS = owner -> String - .format(StatCollector.translateToLocal("tooltip.bw.mb_via.name"), owner); + .format(StatCollector.translateToLocal("tooltip.bw.mb_via.name"), owner); public static final String MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = MULTIBLOCK_ADDED_VIA_BARTWORKS - .apply(GREEN + "bartimaeusnek"); + .apply(GREEN + "bartimaeusnek"); public static final String ADV_STR_CHECK = "Uses an advanced " + TT + " structure check, due to " + BW; public static final String TT_BLUEPRINT = "To see the structure, use a " + TT + " Blueprint on the Controller!"; public static String[] getTranslatedBrandedTooltip(String key) { - String[] dsc = StatCollector.translateToLocal(key).split(";"); + String[] dsc = StatCollector.translateToLocal(key) + .split(";"); String[] fdsc = new String[dsc.length + 1]; System.arraycopy(dsc, 0, fdsc, 0, dsc.length); fdsc[dsc.length] = ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index bd9ee551ce..38982f35b3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -135,7 +135,8 @@ public class BW_Util { } public static String subscriptNumber(Number b) { - char[] chars = Long.toString(b.longValue()).toCharArray(); + char[] chars = Long.toString(b.longValue()) + .toCharArray(); char[] nu = new char[chars.length]; for (int i = 0; i < chars.length; i++) { nu[i] = switch (chars[i]) { @@ -177,7 +178,8 @@ public class BW_Util { } public static String superscriptNumber(Number b) { - char[] chars = Long.toString(b.longValue()).toCharArray(); + char[] chars = Long.toString(b.longValue()) + .toCharArray(); char[] nu = new char[chars.length]; for (int i = 0; i < chars.length; i++) { nu[i] = switch (chars[i]) { @@ -217,12 +219,13 @@ public class BW_Util { public static int calculateSv(Materials materials) { for (BioVatLogicAdder.MaterialSvPair pair : BioVatLogicAdder.RadioHatch.getMaSv()) { - if (pair.getMaterials().equals(materials)) return pair.getSievert(); + if (pair.getMaterials() + .equals(materials)) return pair.getSievert(); } return (int) (materials.getProtons() == 43L - ? materials.equals(Materials.NaquadahEnriched) ? 140 - : materials.equals(Materials.Naquadria) ? 150 : materials.equals(Materials.Naquadah) ? 130 : 43 - : materials.getProtons()); + ? materials.equals(Materials.NaquadahEnriched) ? 140 + : materials.equals(Materials.Naquadria) ? 150 : materials.equals(Materials.Naquadah) ? 130 : 43 + : materials.getProtons()); } public static ItemStack setStackSize(ItemStack stack, int size) { @@ -232,9 +235,9 @@ public class BW_Util { public static boolean checkStackAndPrefix(ItemStack itemStack) { return itemStack != null && GT_OreDictUnificator.getAssociation(itemStack) != null - && GT_OreDictUnificator.getAssociation(itemStack).mPrefix != null - && GT_OreDictUnificator.getAssociation(itemStack).mMaterial != null - && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial != null; + && GT_OreDictUnificator.getAssociation(itemStack).mPrefix != null + && GT_OreDictUnificator.getAssociation(itemStack).mMaterial != null + && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial != null; } public static int abstractHashGTRecipe(GT_Recipe recipe) { @@ -275,7 +278,9 @@ public class BW_Util { @SuppressWarnings({ "unchecked" }) public static T[] copyAndRemoveNulls(T[] input, Class clazz) { - List ret = Arrays.stream(input).filter(Objects::nonNull).collect(Collectors.toList()); + List ret = Arrays.stream(input) + .filter(Objects::nonNull) + .collect(Collectors.toList()); if (ret.size() <= 0) return (T[]) Array.newInstance(clazz, 0); @@ -411,27 +416,33 @@ public class BW_Util { if (block.equals(Blocks.glass)) return 3; - for (BioVatLogicAdder.BlockMetaPair B : BioVatLogicAdder.BioVatGlass.getGlassMap().keySet()) - if (B.getBlock().equals(block) && B.getaByte().equals(meta)) - return BioVatLogicAdder.BioVatGlass.getGlassMap().get(B); + for (BioVatLogicAdder.BlockMetaPair B : BioVatLogicAdder.BioVatGlass.getGlassMap() + .keySet()) + if (B.getBlock() + .equals(block) + && B.getaByte() + .equals(meta)) + return BioVatLogicAdder.BioVatGlass.getGlassMap() + .get(B); - if (block.getMaterial().equals(Material.glass)) return 3; + if (block.getMaterial() + .equals(Material.glass)) return 3; return 0; } public static IStructureElement ofGlassTiered(byte mintier, byte maxtier, byte notset, - BiConsumer setter, Function getter, int aDots) { + BiConsumer setter, Function getter, int aDots) { return new IStructureElement<>() { private final IStructureElement placementDelegate = BorosilicateGlass - .ofBoroGlass(notset, mintier, maxtier, setter, getter); + .ofBoroGlass(notset, mintier, maxtier, setter, getter); @Override public boolean check(T te, World world, int x, int y, int z) { if (world.isAirBlock(x, y, z)) return false; byte glasstier = BW_Util - .calculateGlassTier(world.getBlock(x, y, z), (byte) world.getBlockMetadata(x, y, z)); + .calculateGlassTier(world.getBlock(x, y, z), (byte) world.getBlockMetadata(x, y, z)); // is not a glass ? if (glasstier == 0 || glasstier == notset || glasstier < mintier || glasstier > maxtier) return false; if (getter.apply(te) == notset) setter.accept(te, glasstier); @@ -451,7 +462,7 @@ public class BW_Util { @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { return this.placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, env); } }; @@ -461,13 +472,13 @@ public class BW_Util { return new IStructureElement<>() { private final IStructureElement placementDelegate = BorosilicateGlass - .ofBoroGlass((byte) 0, mintier, maxtier, (v1, v2) -> {}, v1 -> (byte) 0); + .ofBoroGlass((byte) 0, mintier, maxtier, (v1, v2) -> {}, v1 -> (byte) 0); @Override public boolean check(T te, World world, int x, int y, int z) { if (world.isAirBlock(x, y, z)) return false; byte glasstier = BW_Util - .calculateGlassTier(world.getBlock(x, y, z), (byte) world.getBlockMetadata(x, y, z)); + .calculateGlassTier(world.getBlock(x, y, z), (byte) world.getBlockMetadata(x, y, z)); if (glasstier == 0) return false; // is not a glass ? return glasstier >= mintier && glasstier <= maxtier; } @@ -485,7 +496,7 @@ public class BW_Util { @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { return this.placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, env); } }; @@ -495,7 +506,7 @@ public class BW_Util { @SuppressWarnings("unchecked") public static List getGTBufferedRecipeList() - throws SecurityException, IllegalArgumentException, IllegalAccessException { + throws SecurityException, IllegalArgumentException, IllegalAccessException { if (sBufferedRecipeList == null) { sBufferedRecipeList = FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true); } @@ -507,31 +518,31 @@ public class BW_Util { public static ShapedOreRecipe createGTCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) { return createGTCraftingRecipe( - aResult, - new Enchantment[0], - new int[0], - (aBitMask & GT_ModHandler.RecipeBits.MIRRORED) != 0L, - (aBitMask & GT_ModHandler.RecipeBits.BUFFERED) != 0L, - (aBitMask & GT_ModHandler.RecipeBits.KEEPNBT) != 0L, - (aBitMask & GT_ModHandler.RecipeBits.DISMANTLEABLE) != 0L, - (aBitMask & GT_ModHandler.RecipeBits.NOT_REMOVABLE) == 0L, - (aBitMask & GT_ModHandler.RecipeBits.REVERSIBLE) != 0L, - (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES) != 0L, - (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES_IF_SAME_NBT) != 0L, - (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_SHAPED_RECIPES) != 0L, - (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_NATIVE_RECIPES) != 0L, - (aBitMask & GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS) == 0L, - (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_THERE_IS_ANOTHER_RECIPE_FOR_IT) != 0L, - (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL) != 0L, - aRecipe); + aResult, + new Enchantment[0], + new int[0], + (aBitMask & GT_ModHandler.RecipeBits.MIRRORED) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.BUFFERED) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.KEEPNBT) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DISMANTLEABLE) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.NOT_REMOVABLE) == 0L, + (aBitMask & GT_ModHandler.RecipeBits.REVERSIBLE) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES_IF_SAME_NBT) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_SHAPED_RECIPES) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_NATIVE_RECIPES) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS) == 0L, + (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_THERE_IS_ANOTHER_RECIPE_FOR_IT) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL) != 0L, + aRecipe); } public static ShapedOreRecipe createGTCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, - int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT, - boolean aDismantleable, boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput, - boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, boolean aRemoveAllOtherShapedsWithSameOutput, - boolean aRemoveAllOtherNativeRecipes, boolean aCheckForCollisions, - boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, boolean aOnlyAddIfResultIsNotNull, Object[] aRecipe) { + int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, + boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput, + boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, boolean aRemoveAllOtherShapedsWithSameOutput, + boolean aRemoveAllOtherNativeRecipes, boolean aCheckForCollisions, + boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, boolean aOnlyAddIfResultIsNotNull, Object[] aRecipe) { aResult = GT_OreDictUnificator.get(true, aResult); if (aOnlyAddIfResultIsNotNull && aResult == null) return null; if (aResult != null && Items.feather.getDamage(aResult) == W) Items.feather.setDamage(aResult, 0); @@ -549,9 +560,9 @@ public class BW_Util { continue; } if (aRecipe[i] != null && !(aRecipe[i] instanceof ItemStack) - && !(aRecipe[i] instanceof ItemData) - && !(aRecipe[i] instanceof String) - && !(aRecipe[i] instanceof Character)) { + && !(aRecipe[i] instanceof ItemData) + && !(aRecipe[i] instanceof String) + && !(aRecipe[i] instanceof Character)) { aRecipe[i] = aRecipe[i].toString(); } } @@ -572,7 +583,8 @@ public class BW_Util { while (s.length() < 3) s.append(" "); if (s.length() > 3) throw new IllegalArgumentException(); - for (char c : s.toString().toCharArray()) { + for (char c : s.toString() + .toCharArray()) { switch (c) { case 'b': tRecipeList.add(c); @@ -649,8 +661,8 @@ public class BW_Util { if (aRecipe[idx] == null || aRecipe[idx + 1] == null) { if (D1) { GT_Log.err.println( - "WARNING: Missing Item for shaped Recipe: " - + (aResult == null ? "null" : aResult.getDisplayName())); + "WARNING: Missing Item for shaped Recipe: " + + (aResult == null ? "null" : aResult.getDisplayName())); for (Object tContent : aRecipe) GT_Log.err.println(tContent); } return null; @@ -707,7 +719,8 @@ public class BW_Util { if (aReversible && aResult != null) { ItemData[] tData = new ItemData[9]; int x = -1; - for (char chr : shape.toString().toCharArray()) { + for (char chr : shape.toString() + .toCharArray()) { x++; tData[x] = tItemDataMap.get(chr); } @@ -718,7 +731,8 @@ public class BW_Util { if (aCheckForCollisions && tRemoveRecipe) { ItemStack[] tRecipe = new ItemStack[9]; int x = -1; - for (char chr : shape.toString().toCharArray()) { + for (char chr : shape.toString() + .toCharArray()) { x++; tRecipe[x] = tItemStackMap.get(chr); if (tRecipe[x] != null && Items.feather.getDamage(tRecipe[x]) == W) @@ -733,20 +747,24 @@ public class BW_Util { if (aResult == null || aResult.stackSize <= 0) return null; if (aRemoveAllOthersWithSameOutput || aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT - || aRemoveAllOtherShapedsWithSameOutput - || aRemoveAllOtherNativeRecipes) + || aRemoveAllOtherShapedsWithSameOutput + || aRemoveAllOtherNativeRecipes) tThereWasARecipe = GT_ModHandler.removeRecipeByOutput( - aResult, - !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, - aRemoveAllOtherShapedsWithSameOutput, - aRemoveAllOtherNativeRecipes) || tThereWasARecipe; + aResult, + !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, + aRemoveAllOtherShapedsWithSameOutput, + aRemoveAllOtherNativeRecipes) || tThereWasARecipe; if (aOnlyAddIfThereIsAnyRecipeOutputtingThis && !tThereWasARecipe) { - ArrayList tList = (ArrayList) CraftingManager.getInstance().getRecipeList(); + ArrayList tList = (ArrayList) CraftingManager.getInstance() + .getRecipeList(); int tList_sS = tList.size(); for (int i = 0; i < tList_sS && !tThereWasARecipe; i++) { IRecipe tRecipe = tList.get(i); - if (GT_ModHandler.sSpecialRecipeClasses.contains(tRecipe.getClass().getName())) continue; + if (GT_ModHandler.sSpecialRecipeClasses.contains( + tRecipe.getClass() + .getName())) + continue; if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tRecipe.getRecipeOutput()), aResult, true)) { tList.remove(i); i--; @@ -762,13 +780,13 @@ public class BW_Util { GT_Utility.updateItemStack(aResult); return new GT_Shaped_Recipe( - GT_Utility.copy(aResult), - aDismantleable, - aRemovable, - aKeepNBT, - aEnchantmentsAdded, - aEnchantmentLevelsAdded, - aRecipe).setMirrored(aMirrored); + GT_Utility.copy(aResult), + aDismantleable, + aRemovable, + aKeepNBT, + aEnchantmentsAdded, + aEnchantmentLevelsAdded, + aRecipe).setMirrored(aMirrored); } public static void shortSleep(long nanos) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index fecaffbecc..c4ff2f721c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -30,10 +30,10 @@ public class BioCulture extends BioData implements IColorModulationContainer { public static final ArrayList BIO_CULTURE_ARRAY_LIST = new ArrayList<>(); public static final BioCulture NULLCULTURE = BioCulture - .createAndRegisterBioCulture(Color.BLUE, "", BioPlasmid.NULLPLASMID, BioDNA.NULLDNA, false); // fallback - // NULL - // culture, - // also Blue =) + .createAndRegisterBioCulture(Color.BLUE, "", BioPlasmid.NULLPLASMID, BioDNA.NULLDNA, false); // fallback + // NULL + // culture, + // also Blue =) public String getLocalisedName() { return GT_LanguageManager.getTranslation(this.getName()); @@ -50,7 +50,7 @@ public class BioCulture extends BioData implements IColorModulationContainer { Fluid mFluid; protected BioCulture(Color color, String name, int ID, BioPlasmid plasmid, BioDNA dDNA, EnumRarity rarity, - boolean bBreedable) { + boolean bBreedable) { super(name, ID, rarity); this.color = color; this.plasmid = plasmid; @@ -66,22 +66,22 @@ public class BioCulture extends BioData implements IColorModulationContainer { } public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, - EnumRarity rarity, boolean breedable) { + EnumRarity rarity, boolean breedable) { BioCulture ret = new BioCulture(color, name, BIO_CULTURE_ARRAY_LIST.size(), plasmid, dna, rarity, breedable); BIO_CULTURE_ARRAY_LIST.add(ret); return ret; } public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, - boolean breedable) { + boolean breedable) { BioCulture ret = new BioCulture( - color, - name, - BIO_CULTURE_ARRAY_LIST.size(), - plasmid, - dna, - dna.getRarity(), - breedable); + color, + name, + BIO_CULTURE_ARRAY_LIST.size(), + plasmid, + dna, + dna.getRarity(), + breedable); BIO_CULTURE_ARRAY_LIST.add(ret); return ret; } @@ -92,13 +92,16 @@ public class BioCulture extends BioData implements IColorModulationContainer { ret.setString("Name", bioCulture.name); // ret.setInteger("ID", bioCulture.ID); ret.setIntArray( - "Color", - new int[] { bioCulture.color.getRed(), bioCulture.color.getGreen(), bioCulture.color.getBlue() }); + "Color", + new int[] { bioCulture.color.getRed(), bioCulture.color.getGreen(), bioCulture.color.getBlue() }); ret.setTag("Plasmid", BioData.getNBTTagFromBioData(BioData.convertBioPlasmidToBioData(bioCulture.plasmid))); ret.setTag("DNA", BioData.getNBTTagFromBioData(BioData.convertBioDNAToBioData(bioCulture.dDNA))); ret.setBoolean("Breedable", bioCulture.bBreedable); ret.setByte("Rarety", BW_Util.getByteFromRarity(bioCulture.rarity)); - if (bioCulture.bBreedable) ret.setString("Fluid", bioCulture.getFluid().getName()); + if (bioCulture.bBreedable) ret.setString( + "Fluid", + bioCulture.getFluid() + .getName()); return ret; } @@ -107,12 +110,12 @@ public class BioCulture extends BioData implements IColorModulationContainer { BioCulture ret = getBioCulture(tag.getString("Name")); if (ret == null) ret = createAndRegisterBioCulture( - new Color(tag.getIntArray("Color")[0], tag.getIntArray("Color")[1], tag.getIntArray("Color")[2]), - tag.getString("Name"), - BioPlasmid.convertDataToPlasmid(getBioDataFromNBTTag(tag.getCompoundTag("Plasmid"))), - BioDNA.convertDataToDNA(getBioDataFromNBTTag(tag.getCompoundTag("DNA"))), - BW_Util.getRarityFromByte(tag.getByte("Rarety")), - tag.getBoolean("Breedable")); + new Color(tag.getIntArray("Color")[0], tag.getIntArray("Color")[1], tag.getIntArray("Color")[2]), + tag.getString("Name"), + BioPlasmid.convertDataToPlasmid(getBioDataFromNBTTag(tag.getCompoundTag("Plasmid"))), + BioDNA.convertDataToDNA(getBioDataFromNBTTag(tag.getCompoundTag("DNA"))), + BW_Util.getRarityFromByte(tag.getByte("Rarety")), + tag.getBoolean("Breedable")); if (ret.bBreedable) ret.setFluid(FluidRegistry.getFluid(tag.getString("Fluid"))); if (ret.getFluidNotSet()) // should never happen, but better safe than sorry ret.setbBreedable(false); @@ -126,7 +129,8 @@ public class BioCulture extends BioData implements IColorModulationContainer { } public static BioCulture getBioCulture(BioDNA DNA) { - for (BioCulture b : BIO_CULTURE_ARRAY_LIST) if (b.getdDNA().equals(DNA)) return b; + for (BioCulture b : BIO_CULTURE_ARRAY_LIST) if (b.getdDNA() + .equals(DNA)) return b; return null; } @@ -154,7 +158,7 @@ public class BioCulture extends BioData implements IColorModulationContainer { public int getColorRGB() { return BW_ColorUtil - .getColorFromRGBArray(new int[] { this.color.getRed(), this.color.getGreen(), this.color.getBlue() }); + .getColorFromRGBArray(new int[] { this.color.getRed(), this.color.getGreen(), this.color.getBlue() }); } public Color getColor() { @@ -171,13 +175,16 @@ public class BioCulture extends BioData implements IColorModulationContainer { public BioCulture setPlasmid(BioPlasmid plasmid) { return this.checkForExisting( - new BioCulture(this.color, this.name, this.ID, plasmid, this.dDNA, this.rarity, this.bBreedable)); + new BioCulture(this.color, this.name, this.ID, plasmid, this.dDNA, this.rarity, this.bBreedable)); } private BioCulture checkForExisting(BioCulture culture) { if (culture == null) return null; - for (BioCulture bc : BioCulture.BIO_CULTURE_ARRAY_LIST) - if (culture.getdDNA().equals(bc.getdDNA()) && culture.getPlasmid().equals(bc.getPlasmid())) return bc; + for (BioCulture bc : BioCulture.BIO_CULTURE_ARRAY_LIST) if (culture.getdDNA() + .equals(bc.getdDNA()) + && culture.getPlasmid() + .equals(bc.getPlasmid())) + return bc; return culture; } @@ -192,7 +199,7 @@ public class BioCulture extends BioData implements IColorModulationContainer { public BioCulture setdDNA(BioDNA dDNA) { return this.checkForExisting( - new BioCulture(this.color, this.name, this.ID, this.plasmid, dDNA, this.rarity, this.bBreedable)); + new BioCulture(this.color, this.name, this.ID, this.plasmid, dDNA, this.rarity, this.bBreedable)); } public BioCulture setdDNAUnsafe(BioDNA dDNA) { @@ -206,26 +213,41 @@ public class BioCulture extends BioData implements IColorModulationContainer { if (o == null || this.getClass() != o.getClass() || !super.equals(o)) return false; BioCulture culture = (BioCulture) o; return this.isBreedable() == culture.isBreedable() && Objects.equals(this.getColor(), culture.getColor()) - && Objects.equals(this.getPlasmid(), culture.getPlasmid()) - && Objects.equals(this.getdDNA(), culture.getdDNA()) - && Objects.equals(this.mFluid, culture.mFluid); + && Objects.equals(this.getPlasmid(), culture.getPlasmid()) + && Objects.equals(this.getdDNA(), culture.getdDNA()) + && Objects.equals(this.mFluid, culture.mFluid); } @Override public int hashCode() { return MurmurHash3.murmurhash3_x86_32( - ByteBuffer.allocate(17) - .putInt(MurmurHash3.murmurhash3_x86_32(this.getName(), 0, this.getName().length(), 31)) - .putInt(this.getColorRGB()).putInt(this.getPlasmid().ID).putInt(this.getdDNA().ID) - .put((byte) (this.isBreedable() ? 1 : 0)).array(), - 0, - 17, - 31); + ByteBuffer.allocate(17) + .putInt( + MurmurHash3.murmurhash3_x86_32( + this.getName(), + 0, + this.getName() + .length(), + 31)) + .putInt(this.getColorRGB()) + .putInt(this.getPlasmid().ID) + .putInt(this.getdDNA().ID) + .put((byte) (this.isBreedable() ? 1 : 0)) + .array(), + 0, + 17, + 31); } @Override public short[] getRGBA() { - return new short[] { (short) this.getColor().getRed(), (short) this.getColor().getGreen(), - (short) this.getColor().getBlue(), (short) this.getColor().getAlpha() }; + return new short[] { (short) this.getColor() + .getRed(), + (short) this.getColor() + .getGreen(), + (short) this.getColor() + .getBlue(), + (short) this.getColor() + .getAlpha() }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java index d88ffc3aa3..7a4c87f7d2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java @@ -100,21 +100,29 @@ public class BioData { if (o == null || this.getClass() != o.getClass()) return false; BioData bioData = (BioData) o; return this.getID() == bioData.getID() - || this.getChance() == bioData.getChance() && this.getTier() == bioData.getTier() - && Objects.equals(this.getName(), bioData.getName()) - && this.getRarity() == bioData.getRarity(); + || this.getChance() == bioData.getChance() && this.getTier() == bioData.getTier() + && Objects.equals(this.getName(), bioData.getName()) + && this.getRarity() == bioData.getRarity(); } @Override public int hashCode() { return MurmurHash3.murmurhash3_x86_32( - ByteBuffer.allocate(13) - .putInt(MurmurHash3.murmurhash3_x86_32(this.getName(), 0, this.getName().length(), 31)) - .put(BW_Util.getByteFromRarity(this.getRarity())).putInt(this.getChance()) - .putInt(this.getTier()).array(), - 0, - 13, - 31); + ByteBuffer.allocate(13) + .putInt( + MurmurHash3.murmurhash3_x86_32( + this.getName(), + 0, + this.getName() + .length(), + 31)) + .put(BW_Util.getByteFromRarity(this.getRarity())) + .putInt(this.getChance()) + .putInt(this.getTier()) + .array(), + 0, + 13, + 31); } public int getTier() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java index 93220205b7..063a310db8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java @@ -12,11 +12,13 @@ public class CachedReflectionUtils { private static final ClassValue> declaredFields = new ConcurrentMapClassValue(); public static Field getField(final Class cls, final String fieldName) { - return fields.get(cls).computeIfAbsent(fieldName, f -> FieldUtils.getField(cls, f, true)); + return fields.get(cls) + .computeIfAbsent(fieldName, f -> FieldUtils.getField(cls, f, true)); } public static Field getDeclaredField(final Class cls, final String fieldName) { - return declaredFields.get(cls).computeIfAbsent(fieldName, f -> FieldUtils.getDeclaredField(cls, f, true)); + return declaredFields.get(cls) + .computeIfAbsent(fieldName, f -> FieldUtils.getDeclaredField(cls, f, true)); } private static class ConcurrentMapClassValue extends ClassValue> { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java index d35489a151..9feb344fa0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java @@ -30,17 +30,23 @@ public class ConnectedBlocksChecker { World w = DimensionManager.getWorld(C.wID); int x = C.x, y = C.y, z = C.z; - if (w.getBlock(x + 1, y, z).equals(b)) ret = (byte) (ret | 0b000100); + if (w.getBlock(x + 1, y, z) + .equals(b)) ret = (byte) (ret | 0b000100); - if (w.getBlock(x - 1, y, z).equals(b)) ret = (byte) (ret | 0b001000); + if (w.getBlock(x - 1, y, z) + .equals(b)) ret = (byte) (ret | 0b001000); - if (w.getBlock(x, y, z + 1).equals(b)) ret = (byte) (ret | 0b010000); + if (w.getBlock(x, y, z + 1) + .equals(b)) ret = (byte) (ret | 0b010000); - if (w.getBlock(x, y, z - 1).equals(b)) ret = (byte) (ret | 0b100000); + if (w.getBlock(x, y, z - 1) + .equals(b)) ret = (byte) (ret | 0b100000); - if (w.getBlock(x, y + 1, z).equals(b)) ret = (byte) (ret | 0b000001); + if (w.getBlock(x, y + 1, z) + .equals(b)) ret = (byte) (ret | 0b000001); - if (w.getBlock(x, y - 1, z).equals(b)) ret = (byte) (ret | 0b000010); + if (w.getBlock(x, y - 1, z) + .equals(b)) ret = (byte) (ret | 0b000010); return ret; } @@ -94,17 +100,23 @@ public class ConnectedBlocksChecker { this.hashset.add(new Coords(x, y, z, wID)); - if (w.getBlock(x + 1, y, z).equals(b)) ret = (byte) (ret | 0b000100); + if (w.getBlock(x + 1, y, z) + .equals(b)) ret = (byte) (ret | 0b000100); - if (w.getBlock(x - 1, y, z).equals(b)) ret = (byte) (ret | 0b001000); + if (w.getBlock(x - 1, y, z) + .equals(b)) ret = (byte) (ret | 0b001000); - if (w.getBlock(x, y, z + 1).equals(b)) ret = (byte) (ret | 0b010000); + if (w.getBlock(x, y, z + 1) + .equals(b)) ret = (byte) (ret | 0b010000); - if (w.getBlock(x, y, z - 1).equals(b)) ret = (byte) (ret | 0b100000); + if (w.getBlock(x, y, z - 1) + .equals(b)) ret = (byte) (ret | 0b100000); - if (w.getBlock(x, y + 1, z).equals(b)) ret = (byte) (ret | 0b000001); + if (w.getBlock(x, y + 1, z) + .equals(b)) ret = (byte) (ret | 0b000001); - if (w.getBlock(x, y - 1, z).equals(b)) ret = (byte) (ret | 0b000010); + if (w.getBlock(x, y - 1, z) + .equals(b)) ret = (byte) (ret | 0b000010); return ret; } @@ -117,55 +129,55 @@ public class ConnectedBlocksChecker { for (Coords C : this.hashset) { if (GT) { if (!new Coords(C.x, C.y + 1, C.z, wID).equals(Controller) - && w.getTileEntity(C.x, C.y + 1, C.z) instanceof IGregTechTileEntity gtTE - && gtTE.getMetaTileID() == n) { + && w.getTileEntity(C.x, C.y + 1, C.z) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { return true; } if (!new Coords(C.x, C.y - 1, C.z, wID).equals(Controller) - && w.getTileEntity(C.x, C.y - 1, C.z) instanceof IGregTechTileEntity gtTE - && gtTE.getMetaTileID() == n) { + && w.getTileEntity(C.x, C.y - 1, C.z) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { return true; } if (!new Coords(C.x + 1, C.y, C.z, wID).equals(Controller) - && w.getTileEntity(C.x + 1, C.y, C.z) instanceof IGregTechTileEntity gtTE - && gtTE.getMetaTileID() == n) { + && w.getTileEntity(C.x + 1, C.y, C.z) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { return true; } if (!new Coords(C.x - 1, C.y, C.z, wID).equals(Controller) - && w.getTileEntity(C.x - 1, C.y, C.z) instanceof IGregTechTileEntity gtTE - && gtTE.getMetaTileID() == n) { + && w.getTileEntity(C.x - 1, C.y, C.z) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { return true; } if (!new Coords(C.x, C.y, C.z + 1, wID).equals(Controller) - && w.getTileEntity(C.x, C.y, C.z + 1) instanceof IGregTechTileEntity gtTE - && gtTE.getMetaTileID() == n) { + && w.getTileEntity(C.x, C.y, C.z + 1) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { return true; } if (!new Coords(C.x, C.y, C.z - 1, wID).equals(Controller) - && w.getTileEntity(C.x, C.y, C.z - 1) instanceof IGregTechTileEntity gtTE - && gtTE.getMetaTileID() == n) { + && w.getTileEntity(C.x, C.y, C.z - 1) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { return true; } } else { if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller) - || n == w.getBlockMetadata(C.x, C.y - 1, C.z) - && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) { + || n == w.getBlockMetadata(C.x, C.y - 1, C.z) + && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) { return true; } if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) - && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) { + && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) { return true; } if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) - && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) { + && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) { return true; } if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) - && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) { + && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) { return true; } if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) - && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) { + && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) { return true; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java index 7dee6f3f98..cfd2c70d1d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java @@ -41,32 +41,38 @@ public class ConnectedBlocksCheckerIteration { this.checked.add(tocheck); Coords c; if (!this.checked.contains(c = new Coords(tocheck.x + 1, tocheck.y, tocheck.z, wID)) - && w.getBlock(tocheck.x + 1, tocheck.y, tocheck.z).equals(b)) { + && w.getBlock(tocheck.x + 1, tocheck.y, tocheck.z) + .equals(b)) { this.kwoe.add(c); this.hashset.add(c); } if (!this.checked.contains(c = new Coords(tocheck.x - 1, tocheck.y, tocheck.z, wID)) - && w.getBlock(tocheck.x - 1, tocheck.y, tocheck.z).equals(b)) { + && w.getBlock(tocheck.x - 1, tocheck.y, tocheck.z) + .equals(b)) { this.kwoe.add(c); this.hashset.add(c); } if (!this.checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z + 1, wID)) - && w.getBlock(tocheck.x, tocheck.y, tocheck.z + 1).equals(b)) { + && w.getBlock(tocheck.x, tocheck.y, tocheck.z + 1) + .equals(b)) { this.kwoe.add(c); this.hashset.add(c); } if (!this.checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z - 1, wID)) - && w.getBlock(tocheck.x, tocheck.y, tocheck.z - 1).equals(b)) { + && w.getBlock(tocheck.x, tocheck.y, tocheck.z - 1) + .equals(b)) { this.kwoe.add(c); this.hashset.add(c); } if (!this.checked.contains(c = new Coords(tocheck.x, tocheck.y + 1, tocheck.z, wID)) - && w.getBlock(tocheck.x, tocheck.y + 1, tocheck.z).equals(b)) { + && w.getBlock(tocheck.x, tocheck.y + 1, tocheck.z) + .equals(b)) { this.kwoe.add(c); this.hashset.add(c); } if (!this.checked.contains(c = new Coords(tocheck.x, tocheck.y - 1, tocheck.z, wID)) - && w.getBlock(tocheck.x, tocheck.y - 1, tocheck.z).equals(b)) { + && w.getBlock(tocheck.x, tocheck.y - 1, tocheck.z) + .equals(b)) { this.kwoe.add(c); this.hashset.add(c); } @@ -82,55 +88,55 @@ public class ConnectedBlocksCheckerIteration { for (Coords C : this.hashset) { if (GT) { if (!new Coords(C.x, C.y + 1, C.z, wID).equals(Controller) - && w.getTileEntity(C.x, C.y + 1, C.z) instanceof IGregTechTileEntity gtTE - && gtTE.getMetaTileID() == n) { + && w.getTileEntity(C.x, C.y + 1, C.z) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { return true; } if (!new Coords(C.x, C.y - 1, C.z, wID).equals(Controller) - && w.getTileEntity(C.x, C.y - 1, C.z) instanceof IGregTechTileEntity gtTE - && gtTE.getMetaTileID() == n) { + && w.getTileEntity(C.x, C.y - 1, C.z) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { return true; } if (!new Coords(C.x + 1, C.y, C.z, wID).equals(Controller) - && w.getTileEntity(C.x + 1, C.y, C.z) instanceof IGregTechTileEntity gtTE - && gtTE.getMetaTileID() == n) { + && w.getTileEntity(C.x + 1, C.y, C.z) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { return true; } if (!new Coords(C.x - 1, C.y, C.z, wID).equals(Controller) - && w.getTileEntity(C.x - 1, C.y, C.z) instanceof IGregTechTileEntity gtTE - && gtTE.getMetaTileID() == n) { + && w.getTileEntity(C.x - 1, C.y, C.z) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { return true; } if (!new Coords(C.x, C.y, C.z + 1, wID).equals(Controller) - && w.getTileEntity(C.x, C.y, C.z + 1) instanceof IGregTechTileEntity gtTE - && gtTE.getMetaTileID() == n) { + && w.getTileEntity(C.x, C.y, C.z + 1) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { return true; } if (!new Coords(C.x, C.y, C.z - 1, wID).equals(Controller) - && w.getTileEntity(C.x, C.y, C.z - 1) instanceof IGregTechTileEntity gtTE - && gtTE.getMetaTileID() == n) { + && w.getTileEntity(C.x, C.y, C.z - 1) instanceof IGregTechTileEntity gtTE + && gtTE.getMetaTileID() == n) { return true; } } else { if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller) - || n == w.getBlockMetadata(C.x, C.y - 1, C.z) - && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) { + || n == w.getBlockMetadata(C.x, C.y - 1, C.z) + && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) { return true; } if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) - && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) { + && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) { return true; } if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) - && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) { + && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) { return true; } if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) - && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) { + && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) { return true; } if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) - && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) { + && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) { return true; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java index f96ffc8997..678f8facba 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java @@ -23,30 +23,28 @@ public class EnumUtils { private EnumUtils() {} public static OrePrefixes addNewOrePrefix(String enumName, String aRegularLocalName, String aLocalizedMaterialPre, - String aLocalizedMaterialPost, boolean aIsUnificatable, boolean aIsMaterialBased, - boolean aIsSelfReferencing, boolean aIsContainer, boolean aDontUnificateActively, boolean aIsUsedForBlocks, - boolean aAllowNormalRecycling, boolean aGenerateDefaultItem, boolean aIsEnchantable, - boolean aIsUsedForOreProcessing, int aMaterialGenerationBits, long aMaterialAmount, int aDefaultStackSize, - int aTextureindex) { + String aLocalizedMaterialPost, boolean aIsUnificatable, boolean aIsMaterialBased, boolean aIsSelfReferencing, + boolean aIsContainer, boolean aDontUnificateActively, boolean aIsUsedForBlocks, boolean aAllowNormalRecycling, + boolean aGenerateDefaultItem, boolean aIsEnchantable, boolean aIsUsedForOreProcessing, + int aMaterialGenerationBits, long aMaterialAmount, int aDefaultStackSize, int aTextureindex) { return EnumHelper.addEnum( - OrePrefixes.class, - enumName, - new Class[] { String.class, String.class, String.class, boolean.class, boolean.class, boolean.class, - boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, - boolean.class, int.class, long.class, int.class, int.class }, - new Object[] { aRegularLocalName, aLocalizedMaterialPre, aLocalizedMaterialPost, aIsUnificatable, - aIsMaterialBased, aIsSelfReferencing, aIsContainer, aDontUnificateActively, aIsUsedForBlocks, - aAllowNormalRecycling, aGenerateDefaultItem, aIsEnchantable, aIsUsedForOreProcessing, - aMaterialGenerationBits, aMaterialAmount, aDefaultStackSize, aTextureindex }); + OrePrefixes.class, + enumName, + new Class[] { String.class, String.class, String.class, boolean.class, boolean.class, boolean.class, + boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, + int.class, long.class, int.class, int.class }, + new Object[] { aRegularLocalName, aLocalizedMaterialPre, aLocalizedMaterialPost, aIsUnificatable, + aIsMaterialBased, aIsSelfReferencing, aIsContainer, aDontUnificateActively, aIsUsedForBlocks, + aAllowNormalRecycling, aGenerateDefaultItem, aIsEnchantable, aIsUsedForOreProcessing, + aMaterialGenerationBits, aMaterialAmount, aDefaultStackSize, aTextureindex }); } public static Element createNewElement(String enumName, long aProtons, long aNeutrons, long aAdditionalMass, - long aHalfLifeSeconds, String aDecayTo, String aName, boolean aIsIsotope) { + long aHalfLifeSeconds, String aDecayTo, String aName, boolean aIsIsotope) { return EnumHelper.addEnum( - Element.class, - enumName, - new Class[] { long.class, long.class, long.class, long.class, String.class, String.class, - boolean.class }, - new Object[] { aProtons, aNeutrons, aAdditionalMass, aHalfLifeSeconds, aDecayTo, aName, aIsIsotope }); + Element.class, + enumName, + new Class[] { long.class, long.class, long.class, long.class, String.class, String.class, boolean.class }, + new Object[] { aProtons, aNeutrons, aAdditionalMass, aHalfLifeSeconds, aDecayTo, aName, aIsIsotope }); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java index e230d43415..501b473d98 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java @@ -36,13 +36,13 @@ public final class MurmurHash3 { */ public static long getLongLittleEndian(byte[] buf, int offset) { return (long) buf[offset + 7] << 56 // no mask needed - | (buf[offset + 6] & 0xffL) << 48 - | (buf[offset + 5] & 0xffL) << 40 - | (buf[offset + 4] & 0xffL) << 32 - | (buf[offset + 3] & 0xffL) << 24 - | (buf[offset + 2] & 0xffL) << 16 - | (buf[offset + 1] & 0xffL) << 8 - | buf[offset] & 0xffL; // no shift needed + | (buf[offset + 6] & 0xffL) << 48 + | (buf[offset + 5] & 0xffL) << 40 + | (buf[offset + 4] & 0xffL) << 32 + | (buf[offset + 3] & 0xffL) << 24 + | (buf[offset + 2] & 0xffL) << 16 + | (buf[offset + 1] & 0xffL) << 8 + | buf[offset] & 0xffL; // no shift needed } /** @@ -148,8 +148,8 @@ public final class MurmurHash3 { int utf32 = data.charAt(pos++); utf32 = (code - 0xD7C0 << 10) + (utf32 & 0x3FF); k2 = 0xff & (0xF0 | utf32 >> 18) | (0x80 | utf32 >> 12 & 0x3F) << 8 - | (0x80 | utf32 >> 6 & 0x3F) << 16 - | (0x80 | utf32 & 0x3F) << 24; + | (0x80 | utf32 >> 6 & 0x3F) << 16 + | (0x80 | utf32 & 0x3F) << 24; bits = 32; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java index 951cf69f70..753940f655 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java @@ -107,18 +107,18 @@ public class BartsNoise implements INoiseGen { double getNonOctavedNoise(double x, double y) { double phase = SimplexNoise - .noise(Math.pow(x * this.frequency, this.amplitude), Math.pow(y * this.frequency, this.amplitude)); + .noise(Math.pow(x * this.frequency, this.amplitude), Math.pow(y * this.frequency, this.amplitude)); return MathUtils.wrap(phase, 1); } public double getNeighbouringNoise(int x, int y) { return (this.getNoiseSingle(x - 1, y - 1) + this.getNoiseSingle(x, y - 1) - + this.getNoiseSingle(x - 1, y) - + this.getNoiseSingle(x + 1, y) - + this.getNoiseSingle(x, y + 1) - + this.getNoiseSingle(x + 1, y + 1) - + this.getNoiseSingle(x - 1, y + 1) - + this.getNoiseSingle(x + 1, y - 1)) / 8; + + this.getNoiseSingle(x - 1, y) + + this.getNoiseSingle(x + 1, y) + + this.getNoiseSingle(x, y + 1) + + this.getNoiseSingle(x + 1, y + 1) + + this.getNoiseSingle(x - 1, y + 1) + + this.getNoiseSingle(x + 1, y - 1)) / 8; } public double getNoiseSingle(int x, int y) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java index 8e2e69c495..ca318e17b9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java @@ -12,31 +12,30 @@ import com.github.bartimaeusnek.bartworks.util.MathUtils; public class SimplexNoise { // Simplex noise in 2D, 3D and 4D private static Grad[] grad3 = { new Grad(1, 1, 0), new Grad(-1, 1, 0), new Grad(1, -1, 0), new Grad(-1, -1, 0), - new Grad(1, 0, 1), new Grad(-1, 0, 1), new Grad(1, 0, -1), new Grad(-1, 0, -1), new Grad(0, 1, 1), - new Grad(0, -1, 1), new Grad(0, 1, -1), new Grad(0, -1, -1) }; + new Grad(1, 0, 1), new Grad(-1, 0, 1), new Grad(1, 0, -1), new Grad(-1, 0, -1), new Grad(0, 1, 1), + new Grad(0, -1, 1), new Grad(0, 1, -1), new Grad(0, -1, -1) }; private static Grad[] grad4 = { new Grad(0, 1, 1, 1), new Grad(0, 1, 1, -1), new Grad(0, 1, -1, 1), - new Grad(0, 1, -1, -1), new Grad(0, -1, 1, 1), new Grad(0, -1, 1, -1), new Grad(0, -1, -1, 1), - new Grad(0, -1, -1, -1), new Grad(1, 0, 1, 1), new Grad(1, 0, 1, -1), new Grad(1, 0, -1, 1), - new Grad(1, 0, -1, -1), new Grad(-1, 0, 1, 1), new Grad(-1, 0, 1, -1), new Grad(-1, 0, -1, 1), - new Grad(-1, 0, -1, -1), new Grad(1, 1, 0, 1), new Grad(1, 1, 0, -1), new Grad(1, -1, 0, 1), - new Grad(1, -1, 0, -1), new Grad(-1, 1, 0, 1), new Grad(-1, 1, 0, -1), new Grad(-1, -1, 0, 1), - new Grad(-1, -1, 0, -1), new Grad(1, 1, 1, 0), new Grad(1, 1, -1, 0), new Grad(1, -1, 1, 0), - new Grad(1, -1, -1, 0), new Grad(-1, 1, 1, 0), new Grad(-1, 1, -1, 0), new Grad(-1, -1, 1, 0), - new Grad(-1, -1, -1, 0) }; + new Grad(0, 1, -1, -1), new Grad(0, -1, 1, 1), new Grad(0, -1, 1, -1), new Grad(0, -1, -1, 1), + new Grad(0, -1, -1, -1), new Grad(1, 0, 1, 1), new Grad(1, 0, 1, -1), new Grad(1, 0, -1, 1), + new Grad(1, 0, -1, -1), new Grad(-1, 0, 1, 1), new Grad(-1, 0, 1, -1), new Grad(-1, 0, -1, 1), + new Grad(-1, 0, -1, -1), new Grad(1, 1, 0, 1), new Grad(1, 1, 0, -1), new Grad(1, -1, 0, 1), + new Grad(1, -1, 0, -1), new Grad(-1, 1, 0, 1), new Grad(-1, 1, 0, -1), new Grad(-1, -1, 0, 1), + new Grad(-1, -1, 0, -1), new Grad(1, 1, 1, 0), new Grad(1, 1, -1, 0), new Grad(1, -1, 1, 0), + new Grad(1, -1, -1, 0), new Grad(-1, 1, 1, 0), new Grad(-1, 1, -1, 0), new Grad(-1, -1, 1, 0), + new Grad(-1, -1, -1, 0) }; private static short[] p = { 151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, 103, - 30, 69, 142, 8, 99, 37, 240, 21, 10, 23, 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, - 117, 35, 11, 32, 57, 177, 33, 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, 134, - 139, 48, 27, 166, 77, 146, 158, 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, 55, 46, 245, - 40, 244, 102, 143, 54, 65, 25, 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, 18, 169, 200, 196, 135, - 130, 116, 188, 159, 86, 164, 100, 109, 198, 173, 186, 3, 64, 52, 217, 226, 250, 124, 123, 5, 202, 38, 147, - 118, 126, 255, 82, 85, 212, 207, 206, 59, 227, 47, 16, 58, 17, 182, 189, 28, 42, 223, 183, 170, 213, 119, - 248, 152, 2, 44, 154, 163, 70, 221, 153, 101, 155, 167, 43, 172, 9, 129, 22, 39, 253, 19, 98, 108, 110, 79, - 113, 224, 232, 178, 185, 112, 104, 218, 246, 97, 228, 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, - 241, 81, 51, 145, 235, 249, 14, 239, 107, 49, 192, 214, 31, 181, 199, 106, 157, 184, 84, 204, 176, 115, 121, - 50, 45, 127, 4, 150, 254, 138, 236, 205, 93, 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, 61, - 156, 180 }; + 30, 69, 142, 8, 99, 37, 240, 21, 10, 23, 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117, + 35, 11, 32, 57, 177, 33, 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, 134, 139, 48, + 27, 166, 77, 146, 158, 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, 55, 46, 245, 40, 244, 102, + 143, 54, 65, 25, 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, 18, 169, 200, 196, 135, 130, 116, 188, + 159, 86, 164, 100, 109, 198, 173, 186, 3, 64, 52, 217, 226, 250, 124, 123, 5, 202, 38, 147, 118, 126, 255, 82, + 85, 212, 207, 206, 59, 227, 47, 16, 58, 17, 182, 189, 28, 42, 223, 183, 170, 213, 119, 248, 152, 2, 44, 154, + 163, 70, 221, 153, 101, 155, 167, 43, 172, 9, 129, 22, 39, 253, 19, 98, 108, 110, 79, 113, 224, 232, 178, 185, + 112, 104, 218, 246, 97, 228, 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241, 81, 51, 145, 235, 249, + 14, 239, 107, 49, 192, 214, 31, 181, 199, 106, 157, 184, 84, 204, 176, 115, 121, 50, 45, 127, 4, 150, 254, 138, + 236, 205, 93, 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, 61, 156, 180 }; // To remove the need for index wrapping, double the permutation table length private static short[] perm = new short[512]; private static short[] permMod12 = new short[512]; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java index a51ca06a9b..33173d19f2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java @@ -49,7 +49,8 @@ public class NonNullWrappedHashMap extends HashMap { @Override public V getOrDefault(Object key, V defaultValue) { - return Objects - .requireNonNull(Optional.ofNullable(super.getOrDefault(key, defaultValue)).orElse(this.defaultValue)); + return Objects.requireNonNull( + Optional.ofNullable(super.getOrDefault(key, defaultValue)) + .orElse(this.defaultValue)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java index 5f7104f958..cd9bc1746e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java @@ -45,10 +45,13 @@ public class Pair implements Map.Entry { @Override public int hashCode() { return MurmurHash3.murmurhash3_x86_32( - ByteBuffer.allocate(8).putInt(this.pair[0].hashCode()).putInt(this.pair[1].hashCode()).array(), - 0, - 8, - 31); + ByteBuffer.allocate(8) + .putInt(this.pair[0].hashCode()) + .putInt(this.pair[1].hashCode()) + .array(), + 0, + 8, + 31); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java index dc6863b562..d0850b20c5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java @@ -29,7 +29,7 @@ public class RecipeFinderForParallel { * @return The parallel that it can reach */ public static int handleParallelRecipe(GT_Recipe aRecipe, FluidStack[] aFluidInputs, ItemStack[] aItemStacks, - int aMaxParallel) { + int aMaxParallel) { if (aFluidInputs == null) aFluidInputs = new FluidStack[0]; if (aItemStacks == null) aItemStacks = new ItemStack[0]; HashMap tCompressedFluidInput = compressFluid(aFluidInputs); @@ -40,7 +40,7 @@ public class RecipeFinderForParallel { for (int tFluid : tCompressedFluidRecipe.keySet()) { if (tCompressedFluidInput.containsKey(tFluid) && tCompressedFluidRecipe.get(tFluid) != 0) { tCurrentPara = Math - .min(tCurrentPara, tCompressedFluidInput.get(tFluid) / tCompressedFluidRecipe.get(tFluid)); + .min(tCurrentPara, tCompressedFluidInput.get(tFluid) / tCompressedFluidRecipe.get(tFluid)); } } for (int tItem : tCompressedItemRecipe.keySet()) { @@ -83,7 +83,7 @@ public class RecipeFinderForParallel { tCompressedFluidRecipe.remove(tFluid.getFluidID()); } else { tCompressedFluidRecipe - .put(tFluid.getFluidID(), tCompressedFluidRecipe.get(tFluid.getFluidID()) - tFluid.amount); + .put(tFluid.getFluidID(), tCompressedFluidRecipe.get(tFluid.getFluidID()) - tFluid.amount); tFluid.amount = 0; } } @@ -91,7 +91,8 @@ public class RecipeFinderForParallel { /* OreDict Stuff */ /* Wildcard Stuff */ - for (Iterator i = tCompressedItemRecipe.keySet().iterator(); i.hasNext();) { + for (Iterator i = tCompressedItemRecipe.keySet() + .iterator(); i.hasNext();) { int tItem = i.next(); if (tItem >> 16 == Short.MAX_VALUE) { for (ItemStack tInputItem : aItemStacks) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ResultWrongSievert.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ResultWrongSievert.java index 7d3af3eb35..b6216f3c42 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ResultWrongSievert.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ResultWrongSievert.java @@ -34,11 +34,10 @@ public class ResultWrongSievert implements CheckRecipeResult { public String getDisplayString() { return switch (this.type) { case EXACTLY -> StatCollector.translateToLocalFormatted( - "GT5U.gui.text.wrong_sievert_exactly", - GT_Utility.formatNumbers(this.required)); - case MINIMUM -> StatCollector.translateToLocalFormatted( - "GT5U.gui.text.wrong_sievert_min", - GT_Utility.formatNumbers(this.required)); + "GT5U.gui.text.wrong_sievert_exactly", + GT_Utility.formatNumbers(this.required)); + case MINIMUM -> StatCollector + .translateToLocalFormatted("GT5U.gui.text.wrong_sievert_min", GT_Utility.formatNumbers(this.required)); }; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java index c8fa354dac..4c1c82b9bf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java @@ -25,7 +25,9 @@ public class StreamUtils { public static Predicate> filterVisualMaps() { return recipeMap -> { - Optional op = recipeMap.getAllRecipes().stream().findAny(); + Optional op = recipeMap.getAllRecipes() + .stream() + .findAny(); return op.isPresent() && !op.get().mFakeRecipe; }; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java index 6cbd1793ef..241f20c1f9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java @@ -304,7 +304,8 @@ public class AccessPriorityList implements List, Deque, Set { node.setNext(null); node.setPriority(0L); node = node.getBefore(); - node.getNext().setBefore(null); + node.getNext() + .setBefore(null); } this.size = 0; this.head = null; @@ -321,7 +322,8 @@ public class AccessPriorityList implements List, Deque, Set { if (current == Long.MAX_VALUE || current > 0 && prio > 0 && prio + current < 0) node.setPriority(Long.MAX_VALUE); else node.setPriority(current + prio); - while (node.getBefore() != null && node.getPriority() >= node.getBefore().getPriority()) { + while (node.getBefore() != null && node.getPriority() >= node.getBefore() + .getPriority()) { this.moveNodeUp(node); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java index bf3883e69f..f24105db17 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java @@ -29,7 +29,7 @@ public class AccessPriorityListIterators { boolean reverse; public AccessPriorityListListIterator(AccessPriorityListNode head, AccessPriorityListNode tail, - boolean reverse) { + boolean reverse) { this.head = head; this.tail = tail; this.current = reverse ? tail : head; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java index c54138f1ae..6ead05ce96 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java @@ -34,8 +34,12 @@ public class DebugLog { public static void initDebugLog(FMLPreInitializationEvent event) throws IOException { if (DebugLog.init) return; DebugLog.fh = new FileHandler( - new File(new File(event.getModConfigurationDirectory().getParentFile(), "logs"), "BWLog.log") - .toString()); + new File( + new File( + event.getModConfigurationDirectory() + .getParentFile(), + "logs"), + "BWLog.log").toString()); DebugLog.utilLog = Logger.getLogger("DebugLog"); DebugLog.utilLog.setUseParentHandlers(false); DebugLog.utilLog.addHandler(DebugLog.fh); @@ -47,7 +51,7 @@ public class DebugLog { Calendar cal = new GregorianCalendar(); cal.setTimeInMillis(record.getMillis()); return "Level: " + record - .getLevel() + " at " + logTime.format(cal.getTime()) + " " + record.getMessage() + "\n"; + .getLevel() + " at " + logTime.format(cal.getTime()) + " " + record.getMessage() + "\n"; } }; DebugLog.fh.setFormatter(formatter); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 3aaea22017..b1264fb9af 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -37,19 +37,19 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; @Mod( - modid = BartWorksCrossmod.MOD_ID, - name = BartWorksCrossmod.NAME, - version = BartWorksCrossmod.VERSION, - dependencies = """ - required-after:IC2;\ - required-after:gregtech;\ - required-after:bartworks;\ - after:GalacticraftMars;\ - after:GalacticraftCore;\ - after:Micdoodlecore;\ - after:miscutils;\ - after:EMT;\ - after:tectech;""") + modid = BartWorksCrossmod.MOD_ID, + name = BartWorksCrossmod.NAME, + version = BartWorksCrossmod.VERSION, + dependencies = """ + required-after:IC2;\ + required-after:gregtech;\ + required-after:bartworks;\ + after:GalacticraftMars;\ + after:GalacticraftCore;\ + after:Micdoodlecore;\ + after:miscutils;\ + after:EMT;\ + after:tectech;""") public class BartWorksCrossmod { public static final String NAME = "BartWorks Mod Additions"; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java index a5f4dfa079..b8fcdb9135 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java @@ -109,9 +109,9 @@ public class RadioHatchCompat { DebugLog.log("Starting Generation of missing GT++ rods/longrods"); try { Class rodclass = (Class) Class - .forName("gtPlusPlus.core.item.base.rods.BaseItemRod"); + .forName("gtPlusPlus.core.item.base.rods.BaseItemRod"); Class longrodclass = (Class) Class - .forName("gtPlusPlus.core.item.base.rods.BaseItemRodLong"); + .forName("gtPlusPlus.core.item.base.rods.BaseItemRodLong"); Constructor c1 = rodclass.getConstructor(RadioHatchCompat.materialClass); Constructor c2 = longrodclass.getConstructor(RadioHatchCompat.materialClass); Field cOwners = GameData.class.getDeclaredField("customOwners"); @@ -121,56 +121,65 @@ public class RadioHatchCompat { Map UniqueIdentifierMap = (Map) map.get(GameData.getItemRegistry()); Map ownerItems = (Map) cOwners - .get(null); + .get(null); ModContainer gtpp = null; ModContainer bartworks = null; - for (ModContainer container : Loader.instance().getModList()) { + for (ModContainer container : Loader.instance() + .getModList()) { if (gtpp != null && bartworks != null) break; if (BartWorksCrossmod.MOD_ID.equalsIgnoreCase(container.getModId())) bartworks = container; - else if (container.getModId().equalsIgnoreCase(GTPlusPlus.ID)) gtpp = container; + else if (container.getModId() + .equalsIgnoreCase(GTPlusPlus.ID)) gtpp = container; } - for (Object mats : (Set) RadioHatchCompat.materialClass.getField("mMaterialMap").get(null)) { + for (Object mats : (Set) RadioHatchCompat.materialClass.getField("mMaterialMap") + .get(null)) { if (RadioHatchCompat.isRadioactive.getBoolean(mats)) { - if (OreDictionary.getOres("stick" + RadioHatchCompat.unlocalizedName.get(mats)).isEmpty()) { + if (OreDictionary.getOres("stick" + RadioHatchCompat.unlocalizedName.get(mats)) + .isEmpty()) { Item it = c1.newInstance(mats); UniqueIdentifierMap.replace(it, "miscutils:" + it.getUnlocalizedName()); GameRegistry.UniqueIdentifier ui = GameRegistry.findUniqueIdentifierFor(it); ownerItems.replace(ui, bartworks, gtpp); String tanslate = it.getUnlocalizedName() + ".name=" - + RadioHatchCompat.localizedName.get(mats) - + " Rod"; + + RadioHatchCompat.localizedName.get(mats) + + " Rod"; RadioHatchCompat.TranslateSet.add(tanslate); DebugLog.log(tanslate); DebugLog.log("Generate: " + RadioHatchCompat.rod + RadioHatchCompat.unlocalizedName.get(mats)); } - if (OreDictionary.getOres("stickLong" + RadioHatchCompat.unlocalizedName.get(mats)).isEmpty()) { + if (OreDictionary.getOres("stickLong" + RadioHatchCompat.unlocalizedName.get(mats)) + .isEmpty()) { Item it2 = c2.newInstance(mats); UniqueIdentifierMap.replace(it2, "miscutils:" + it2.getUnlocalizedName()); GameRegistry.UniqueIdentifier ui2 = GameRegistry.findUniqueIdentifierFor(it2); ownerItems.replace(ui2, bartworks, gtpp); - DebugLog.log( - "Generate: " + RadioHatchCompat.longRod + RadioHatchCompat.unlocalizedName.get(mats)); + DebugLog + .log("Generate: " + RadioHatchCompat.longRod + RadioHatchCompat.unlocalizedName.get(mats)); } } } } catch (NoSuchFieldException | IllegalAccessException | NoSuchMethodException | InvocationTargetException - | InstantiationException | ClassNotFoundException e) { + | InstantiationException | ClassNotFoundException e) { e.printStackTrace(); } } public static IRadMaterial GTppRadChecker(ItemStack lStack) { try { - if (RadioHatchCompat.intf.isAssignableFrom(lStack.getItem().getClass())) { + if (RadioHatchCompat.intf.isAssignableFrom( + lStack.getItem() + .getClass())) { if (!RadioHatchCompat.isRadioactive.getBoolean(RadioHatchCompat.f.get(lStack.getItem()))) return null; - int amount = RadioHatchCompat.componentType.get(lStack.getItem()).equals(RadioHatchCompat.rod) ? 1 - : RadioHatchCompat.componentType.get(lStack.getItem()).equals(RadioHatchCompat.longRod) ? 2 : 0; + int amount = RadioHatchCompat.componentType.get(lStack.getItem()) + .equals(RadioHatchCompat.rod) ? 1 + : RadioHatchCompat.componentType.get(lStack.getItem()) + .equals(RadioHatchCompat.longRod) ? 2 : 0; if (amount == 0) return null; return new RadioHatchCompat.GTPPRadAdapter(amount, RadioHatchCompat.f.get(lStack.getItem())); } @@ -202,7 +211,8 @@ public class RadioHatchCompat { } private static boolean isElement(Object GTPPMaterial) throws IllegalAccessException { - return RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial).isEmpty(); + return RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial) + .isEmpty(); } private static List getElemets(Object GTPPMaterial) throws IllegalAccessException { @@ -226,8 +236,8 @@ public class RadioHatchCompat { try { List pureElements = RadioHatchCompat.GTPPRadAdapter.getElemets(m); for (Object materialObj : pureElements) if (RadioHatchCompat.isRadioactive.getBoolean(materialObj)) - ret += RadioHatchCompat.radlevel.getByte(m) + RadioHatchCompat.GTPPRadAdapter - .clampToZero(RadioHatchCompat.protons.getLong(materialObj)); + ret += RadioHatchCompat.radlevel.getByte(m) + + RadioHatchCompat.GTPPRadAdapter.clampToZero(RadioHatchCompat.protons.getLong(materialObj)); else ret += RadioHatchCompat.radlevel.getByte(m); } catch (IllegalAccessException e) { e.printStackTrace(); @@ -238,7 +248,7 @@ public class RadioHatchCompat { @Override public int getRadiationLevel(ItemStack aStack) { return RadioHatchCompat.GTPPRadAdapter.BUFFER - .computeIfAbsent(this.m, radlvl -> RadioHatchCompat.GTPPRadAdapter.calulateRad(this.m)); + .computeIfAbsent(this.m, radlvl -> RadioHatchCompat.GTPPRadAdapter.calulateRad(this.m)); } private static long clampToZero(long number) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java index 1b55aee240..adb3d42754 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java @@ -40,21 +40,23 @@ public class CLSCompat { e.printStackTrace(); } - Optional.ofNullable(alexiilMinecraftDisplayer).ifPresent(e -> { - try { - isRegisteringBartWorks = e.getField("isRegisteringBartWorks"); - } catch (NoSuchFieldException ex) { - ex.printStackTrace(); - } - }); - - Optional.ofNullable(alexiilProgressDisplayer).ifPresent(e -> { - try { - displayProgress = e.getMethod("displayProgress", String.class, float.class); - } catch (NoSuchMethodException ex) { - ex.printStackTrace(); - } - }); + Optional.ofNullable(alexiilMinecraftDisplayer) + .ifPresent(e -> { + try { + isRegisteringBartWorks = e.getField("isRegisteringBartWorks"); + } catch (NoSuchFieldException ex) { + ex.printStackTrace(); + } + }); + + Optional.ofNullable(alexiilProgressDisplayer) + .ifPresent(e -> { + try { + displayProgress = e.getMethod("displayProgress", String.class, float.class); + } catch (NoSuchMethodException ex) { + ex.printStackTrace(); + } + }); } public static Integer[] initCls() { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index 6e2f133ddd..da9bd49397 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -112,7 +112,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri @Override protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, - int yHead, int oldYHead) { + int yHead, int oldYHead) { // if the dropMap has never been initialised or if the dropMap is empty if (this.dropMap == null || this.totalWeight == 0) this.calculateDropMap(); @@ -128,29 +128,36 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { - String casings = this.getCasingBlockItem().get(0).getDisplayName(); + String casings = this.getCasingBlockItem() + .get(0) + .getDisplayName(); final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Miner").addInfo("Controller Block for the Void Miner " + GT_Values.VN[this.getMinTier()]) - .addInfo("Consumes " + GT_Values.V[this.getMinTier()] + "EU/t") - .addInfo( - "Can be supplied with 2L/s of Neon(x4), Krypton(x8), Xenon(x16) or Oganesson(x64) for higher outputs.") - .addInfo( - "Will output " + 2 * this.TIER_MULTIPLIER - + " Ores per Second depending on the Dimension it is build in") - .addInfo("Put the Ore into the input bus to set the Whitelist/Blacklist") - .addInfo("Use a screwdriver to toggle Whitelist/Blacklist") - .addInfo("Blacklist or non Whitelist Ore will be VOIDED").addSeparator() - .beginStructureBlock(3, 7, 3, false).addController("Front bottom") - .addOtherStructurePart(casings, "form the 3x1x3 Base") - .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") - .addOtherStructurePart( - this.getFrameMaterial().mName + " Frame Boxes", - "Each pillar's side and 1x3x1 on top") - .addEnergyHatch(VN[this.getMinTier()] + "+, Any base casing").addMaintenanceHatch("Any base casing") - .addInputBus("Mining Pipes or Ores, optional, any base casing") - .addInputHatch("Optional noble gas, any base casing").addOutputBus("Any base casing") - .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); + tt.addMachineType("Miner") + .addInfo("Controller Block for the Void Miner " + GT_Values.VN[this.getMinTier()]) + .addInfo("Consumes " + GT_Values.V[this.getMinTier()] + "EU/t") + .addInfo( + "Can be supplied with 2L/s of Neon(x4), Krypton(x8), Xenon(x16) or Oganesson(x64) for higher outputs.") + .addInfo( + "Will output " + 2 * this.TIER_MULTIPLIER + + " Ores per Second depending on the Dimension it is build in") + .addInfo("Put the Ore into the input bus to set the Whitelist/Blacklist") + .addInfo("Use a screwdriver to toggle Whitelist/Blacklist") + .addInfo("Blacklist or non Whitelist Ore will be VOIDED") + .addSeparator() + .beginStructureBlock(3, 7, 3, false) + .addController("Front bottom") + .addOtherStructurePart(casings, "form the 3x1x3 Base") + .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") + .addOtherStructurePart( + this.getFrameMaterial().mName + " Frame Boxes", + "Each pillar's side and 1x3x1 on top") + .addEnergyHatch(VN[this.getMinTier()] + "+, Any base casing") + .addMaintenanceHatch("Any base casing") + .addInputBus("Mining Pipes or Ores, optional, any base casing") + .addInputHatch("Optional noble gas, any base casing") + .addOutputBus("Any base casing") + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); return tt; } @@ -168,13 +175,17 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri float currentWeight = 0.f; while (true) { float randomNumber = XSTR.XSTR_INSTANCE.nextFloat() * this.totalWeight; - for (Map.Entry entry : this.dropMap.getInternalMap().entrySet()) { + for (Map.Entry entry : this.dropMap.getInternalMap() + .entrySet()) { currentWeight += entry.getValue(); - if (randomNumber < currentWeight) return entry.getKey().getItemStack(); + if (randomNumber < currentWeight) return entry.getKey() + .getItemStack(); } - for (Map.Entry entry : this.extraDropMap.getInternalMap().entrySet()) { + for (Map.Entry entry : this.extraDropMap.getInternalMap() + .entrySet()) { currentWeight += entry.getValue(); - if (randomNumber < currentWeight) return entry.getKey().getItemStack(); + if (randomNumber < currentWeight) return entry.getKey() + .getItemStack(); } } } @@ -242,8 +253,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri if (VoidMinerUtility.dropMapsByDimId.containsKey(id)) { this.dropMap = VoidMinerUtility.dropMapsByDimId.get(id); } else { - String chunkProviderName = ((ChunkProviderServer) this.getBaseMetaTileEntity().getWorld() - .getChunkProvider()).currentChunkProvider.getClass().getName(); + String chunkProviderName = ((ChunkProviderServer) this.getBaseMetaTileEntity() + .getWorld() + .getChunkProvider()).currentChunkProvider.getClass() + .getName(); if (VoidMinerUtility.dropMapsByChunkProviderName.containsKey(chunkProviderName)) { this.dropMap = VoidMinerUtility.dropMapsByChunkProviderName.get(chunkProviderName); @@ -258,7 +271,8 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private void calculateDropMap() { this.dropMap = new VoidMinerUtility.DropMap(); this.extraDropMap = new VoidMinerUtility.DropMap(); - int id = this.getBaseMetaTileEntity().getWorld().provider.dimensionId; + int id = this.getBaseMetaTileEntity() + .getWorld().provider.dimensionId; this.handleModDimDef(id); this.handleExtraDrops(id); this.totalWeight = dropMap.getTotalWeight() + extraDropMap.getTotalWeight(); @@ -268,13 +282,16 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * Output logic of the VM */ private void handleOutputs() { - final List inputOres = this.getStoredInputs().stream().filter(GT_Utility::isOre) - .collect(Collectors.toList());; + final List inputOres = this.getStoredInputs() + .stream() + .filter(GT_Utility::isOre) + .collect(Collectors.toList());; final ItemStack output = this.nextOre(); output.stackSize = multiplier; - if (inputOres.size() == 0 - || this.mBlacklist && inputOres.stream().noneMatch(is -> GT_Utility.areStacksEqual(is, output)) - || !this.mBlacklist && inputOres.stream().anyMatch(is -> GT_Utility.areStacksEqual(is, output))) + if (inputOres.size() == 0 || this.mBlacklist && inputOres.stream() + .noneMatch(is -> GT_Utility.areStacksEqual(is, output)) + || !this.mBlacklist && inputOres.stream() + .anyMatch(is -> GT_Utility.areStacksEqual(is, output))) this.addOutput(output); this.updateSlots(); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/VoidMinerUtility.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/VoidMinerUtility.java index 7d4b205426..5254da24f1 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/VoidMinerUtility.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/VoidMinerUtility.java @@ -36,8 +36,8 @@ import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; public class VoidMinerUtility { public static final FluidStack[] NOBLE_GASSES = { WerkstoffLoader.Neon.getFluidOrGas(1), - WerkstoffLoader.Krypton.getFluidOrGas(1), WerkstoffLoader.Xenon.getFluidOrGas(1), - WerkstoffLoader.Oganesson.getFluidOrGas(1) }; + WerkstoffLoader.Krypton.getFluidOrGas(1), WerkstoffLoader.Xenon.getFluidOrGas(1), + WerkstoffLoader.Oganesson.getFluidOrGas(1) }; public static final int[] NOBEL_GASSES_MULTIPLIER = { 4, 8, 16, 64 }; public static class DropMap { @@ -71,7 +71,11 @@ public class VoidMinerUtility { */ public void addDrop(Block block, int meta, float weight) { if (ConfigHandler.voidMinerBlacklist.contains( - String.format("%s:%d", GameRegistry.findUniqueIdentifierFor(block).toString(), meta))) + String.format( + "%s:%d", + GameRegistry.findUniqueIdentifierFor(block) + .toString(), + meta))) return; Item item = Item.getItemFromBlock(block); addDrop(item, meta, weight); @@ -86,10 +90,11 @@ public class VoidMinerUtility { Item item = itemStack.getItem(); int meta = Items.feather.getDamage(itemStack); if (ConfigHandler.voidMinerBlacklist.contains( - String.format( - "%s:%d", - GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(item)).toString(), - meta))) + String.format( + "%s:%d", + GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(item)) + .toString(), + meta))) return; addDrop(item, meta, weight); } @@ -151,18 +156,19 @@ public class VoidMinerUtility { // Ore Veins Predicate oreLayerPredicate = makeOreLayerPredicate(dimId); GT_Worldgen_GT_Ore_Layer.sList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled && oreLayerPredicate.test(gt_worldgen)).forEach(element -> { - dropMap.addDrop(element.mPrimaryMeta, element.mWeight, false); - dropMap.addDrop(element.mSecondaryMeta, element.mWeight, false); - dropMap.addDrop(element.mSporadicMeta, element.mWeight / 8f, false); - dropMap.addDrop(element.mBetweenMeta, element.mWeight / 8f, false); - }); + .filter(gt_worldgen -> gt_worldgen.mEnabled && oreLayerPredicate.test(gt_worldgen)) + .forEach(element -> { + dropMap.addDrop(element.mPrimaryMeta, element.mWeight, false); + dropMap.addDrop(element.mSecondaryMeta, element.mWeight, false); + dropMap.addDrop(element.mSporadicMeta, element.mWeight / 8f, false); + dropMap.addDrop(element.mBetweenMeta, element.mWeight / 8f, false); + }); // Small Ores Predicate smallOresPredicate = makeSmallOresPredicate(dimId); GT_Worldgen_GT_Ore_SmallPieces.sList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled && smallOresPredicate.test(gt_worldgen)) - .forEach(element -> dropMap.addDrop(element.mMeta, element.mAmount, false)); + .filter(gt_worldgen -> gt_worldgen.mEnabled && smallOresPredicate.test(gt_worldgen)) + .forEach(element -> dropMap.addDrop(element.mMeta, element.mAmount, false)); return dropMap; } @@ -233,51 +239,53 @@ public class VoidMinerUtility { // Normal Ore Veins GalacticGreg.oreVeinWorldgenList.stream() - .filter( - gt_worldgen -> gt_worldgen.mEnabled - && gt_worldgen instanceof GT_Worldgen_GT_Ore_Layer_Space oreLayerSpace - && oreLayerSpace.isEnabledForDim(finalDef)) - .map(gt_worldgen -> (GT_Worldgen_GT_Ore_Layer_Space) gt_worldgen).forEach(element -> { - dropMap.addDrop(element.mPrimaryMeta, element.mWeight, false); - dropMap.addDrop(element.mSecondaryMeta, element.mWeight, false); - dropMap.addDrop(element.mSporadicMeta, element.mWeight / 8f, false); - dropMap.addDrop(element.mBetweenMeta, element.mWeight / 8f, false); - }); + .filter( + gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof GT_Worldgen_GT_Ore_Layer_Space oreLayerSpace + && oreLayerSpace.isEnabledForDim(finalDef)) + .map(gt_worldgen -> (GT_Worldgen_GT_Ore_Layer_Space) gt_worldgen) + .forEach(element -> { + dropMap.addDrop(element.mPrimaryMeta, element.mWeight, false); + dropMap.addDrop(element.mSecondaryMeta, element.mWeight, false); + dropMap.addDrop(element.mSporadicMeta, element.mWeight / 8f, false); + dropMap.addDrop(element.mBetweenMeta, element.mWeight / 8f, false); + }); // Normal Small Ores GalacticGreg.smallOreWorldgenList.stream() - .filter( - gt_worldgen -> gt_worldgen.mEnabled - && gt_worldgen instanceof GT_Worldgen_GT_Ore_SmallPieces_Space oreSmallPiecesSpace - && oreSmallPiecesSpace.isEnabledForDim(finalDef)) - .map(gt_worldgen -> (GT_Worldgen_GT_Ore_SmallPieces_Space) gt_worldgen) - .forEach(element -> dropMap.addDrop(element.mMeta, element.mAmount, false)); + .filter( + gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof GT_Worldgen_GT_Ore_SmallPieces_Space oreSmallPiecesSpace + && oreSmallPiecesSpace.isEnabledForDim(finalDef)) + .map(gt_worldgen -> (GT_Worldgen_GT_Ore_SmallPieces_Space) gt_worldgen) + .forEach(element -> dropMap.addDrop(element.mMeta, element.mAmount, false)); // BW Ore Veins try { GalacticGreg.oreVeinWorldgenList.stream() - .filter( - gt_worldgen -> gt_worldgen.mEnabled - && gt_worldgen instanceof BW_Worldgen_Ore_Layer_Space oreLayerSpace - && oreLayerSpace.isEnabledForDim(finalDef)) - .map(gt_worldgen -> (BW_Worldgen_Ore_Layer_Space) gt_worldgen).forEach(oreLayer -> { - List data = oreLayer.getStacks(); - dropMap.addDrop(data.get(0), oreLayer.mWeight); - dropMap.addDrop(data.get(1), oreLayer.mWeight); - dropMap.addDrop(data.get(2), oreLayer.mWeight / 8f); - dropMap.addDrop(data.get(3), oreLayer.mWeight / 8f); - }); + .filter( + gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof BW_Worldgen_Ore_Layer_Space oreLayerSpace + && oreLayerSpace.isEnabledForDim(finalDef)) + .map(gt_worldgen -> (BW_Worldgen_Ore_Layer_Space) gt_worldgen) + .forEach(oreLayer -> { + List data = oreLayer.getStacks(); + dropMap.addDrop(data.get(0), oreLayer.mWeight); + dropMap.addDrop(data.get(1), oreLayer.mWeight); + dropMap.addDrop(data.get(2), oreLayer.mWeight / 8f); + dropMap.addDrop(data.get(3), oreLayer.mWeight / 8f); + }); } catch (NullPointerException ignored) {} // BW Small Ores try { GalacticGreg.smallOreWorldgenList.stream() - .filter( - gt_worldgen -> gt_worldgen.mEnabled - && gt_worldgen instanceof BW_Worldgen_Ore_SmallOre_Space smallOreSpace - && smallOreSpace.isEnabledForDim(finalDef)) - .map(gt_worldgen -> (BW_Worldgen_Ore_SmallOre_Space) gt_worldgen) - .forEach(element -> dropMap.addDrop(element.mPrimaryMeta, element.mDensity, element.bwOres != 0)); + .filter( + gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof BW_Worldgen_Ore_SmallOre_Space smallOreSpace + && smallOreSpace.isEnabledForDim(finalDef)) + .map(gt_worldgen -> (BW_Worldgen_Ore_SmallOre_Space) gt_worldgen) + .forEach(element -> dropMap.addDrop(element.mPrimaryMeta, element.mDensity, element.bwOres != 0)); } catch (NullPointerException ignored) {} return dropMap; } @@ -286,7 +294,8 @@ public class VoidMinerUtility { if (!extraDropsDimMap.containsKey(dimId)) { extraDropsDimMap.put(dimId, new DropMap()); } - extraDropsDimMap.get(dimId).addDrop(block, meta, weight); + extraDropsDimMap.get(dimId) + .addDrop(block, meta, weight); } /** diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java index 5d61796164..972254e2d9 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java @@ -61,7 +61,7 @@ public class GalacticraftProxy { private static void commonpreInit(FMLPreInitializationEvent e) { GalacticraftProxy.gtConf = new Configuration( - new File(new File(e.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg")); + new File(new File(e.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg")); GalacticraftProxy.uo_dimensionList.getConfig(GalacticraftProxy.gtConf, "undergroundfluid"); BW_WorldGenRoss128b.initundergroundFluids(); BW_WorldGenRoss128ba.init_undergroundFluids(); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java index 77877011cd..fa6d2db382 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java @@ -51,7 +51,7 @@ public final class BWAtmosphereManager { public static final BWAtmosphereManager INSTANCE = new BWAtmosphereManager(); private static final ArrayListMultimap> gasConcentration = ArrayListMultimap - .create(); + .create(); public static List> getGasFromWorldID(int worldID) { return BWAtmosphereManager.gasConcentration.get(worldID); @@ -59,8 +59,10 @@ public final class BWAtmosphereManager { public static void removeGasFromWorld(int worldID, ISubTagContainer gas) { for (Pair pair : BWAtmosphereManager.gasConcentration.get(worldID)) { - if (pair.getKey().equals(gas)) { - BWAtmosphereManager.gasConcentration.get(worldID).remove(pair); + if (pair.getKey() + .equals(gas)) { + BWAtmosphereManager.gasConcentration.get(worldID) + .remove(pair); return; } } @@ -77,19 +79,21 @@ public final class BWAtmosphereManager { @SafeVarargs public static void addGasToWorld(int worldID, Pair... toPut) { - Arrays.stream(toPut).forEach(toadd -> BWAtmosphereManager.gasConcentration.put(worldID, toadd)); + Arrays.stream(toPut) + .forEach(toadd -> BWAtmosphereManager.gasConcentration.put(worldID, toadd)); } private static boolean addGCGasToWorld(int worldID, IAtmosphericGas gas, int aNumber, int aMaxNumber) { if (IAtmosphericGas.CO2.equals(gas)) { BWAtmosphereManager.addGasToWorld( - worldID, - Materials.CarbonDioxide, - BWAtmosphereManager.COEFFICIENT_MAP.get(aMaxNumber)[aNumber]); + worldID, + Materials.CarbonDioxide, + BWAtmosphereManager.COEFFICIENT_MAP.get(aMaxNumber)[aNumber]); return true; } String name = gas.toString(); - name = name.charAt(0) + name.substring(1).toLowerCase(Locale.US); + name = name.charAt(0) + name.substring(1) + .toLowerCase(Locale.US); ISubTagContainer mat = Materials.get(name); if (mat == Materials._NULL) { mat = WerkstoffLoader.getWerkstoff(name); @@ -103,14 +107,15 @@ public final class BWAtmosphereManager { @SubscribeEvent public void gcAutoRegister(GalaxyRegistry.PlanetRegisterEvent event) { - CelestialBody planet = GalaxyRegistry.getRegisteredPlanets().get(event.planetName); + CelestialBody planet = GalaxyRegistry.getRegisteredPlanets() + .get(event.planetName); for (int i = 0; i < planet.atmosphere.size(); i++) { if (!BWAtmosphereManager - .addGCGasToWorld(planet.getDimensionID(), planet.atmosphere.get(i), i, planet.atmosphere.size())) + .addGCGasToWorld(planet.getDimensionID(), planet.atmosphere.get(i), i, planet.atmosphere.size())) BartWorksCrossmod.LOGGER.warn( - "Unidentified Fluid (" + planet.atmosphere.get(i) - + ") in the Atmosphere of: " - + planet.getLocalizedName()); + "Unidentified Fluid (" + planet.atmosphere.get(i) + + ") in the Atmosphere of: " + + planet.getLocalizedName()); } } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java index 33f4f6f9ae..61c52865cf 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java @@ -26,7 +26,8 @@ public abstract class AbstractWorldProviderSpace extends WorldProviderSpace impl @Override public String getDimensionName() { - return this.getCelestialBody().getLocalizedName(); + return this.getCelestialBody() + .getLocalizedName(); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index c84ef4528b..b477154d39 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -61,7 +61,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { @Override public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, - int p_73155_4_) { + int p_73155_4_) { return null; } @@ -72,7 +72,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { byte[] abyte = new byte[65536]; this.func_147424_a(p_73154_1_, p_73154_2_, ablock); this.biomesForGeneration = this.worldObj.getWorldChunkManager() - .loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); + .loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); for (int i = 0; i < this.biomesForGeneration.length; i++) { BiomeGenBase biomeGenBase = this.biomesForGeneration[i]; if (biomeGenBase.biomeID == BiomeGenBase.mushroomIsland.biomeID) { @@ -84,7 +84,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { if (ThaumcraftHandler.isTaintBiome(biomeGenBase.biomeID)) this.biomesForGeneration[i] = BiomeGenBase.taiga; else if (ConfigHandler.disableMagicalForest - && ThaumcraftHandler.isMagicalForestBiome(biomeGenBase.biomeID)) + && ThaumcraftHandler.isMagicalForestBiome(biomeGenBase.biomeID)) this.biomesForGeneration[i] = BiomeGenBase.birchForest; } } @@ -117,13 +117,13 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { } MinecraftForge.EVENT_BUS - .post(new PopulateChunkEvent.Pre(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); + .post(new PopulateChunkEvent.Pre(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); int x1; int y1; int z1; if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills - && TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, LAKE)) { + && TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, LAKE)) { x1 = k + this.rand.nextInt(16) + 8; y1 = this.rand.nextInt(256); z1 = l + this.rand.nextInt(16) + 8; @@ -132,10 +132,10 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { else if (rni == 4) new WorldGenLakes(Blocks.water).generate(this.worldObj, this.rand, x1, y1, z1); } if (biomegenbase != BiomeGenBase.ocean && biomegenbase != BiomeGenBase.deepOcean - && biomegenbase != BiomeGenBase.river - && biomegenbase != BiomeGenBase.frozenOcean - && biomegenbase != BiomeGenBase.frozenRiver - && this.rand.nextInt(ConfigHandler.ross128bRuinChance) == 0) { + && biomegenbase != BiomeGenBase.river + && biomegenbase != BiomeGenBase.frozenOcean + && biomegenbase != BiomeGenBase.frozenRiver + && this.rand.nextInt(ConfigHandler.ross128bRuinChance) == 0) { x1 = k + this.rand.nextInt(16) + 3; y1 = this.rand.nextInt(256); z1 = l + this.rand.nextInt(16) + 3; @@ -164,7 +164,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { BWOreGen.generate(this.rand, p_73153_2_, p_73153_3_, this.worldObj, this, this); MinecraftForge.EVENT_BUS - .post(new PopulateChunkEvent.Post(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); + .post(new PopulateChunkEvent.Post(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); BlockFalling.fallInstantly = false; } @@ -174,7 +174,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { @Override public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] blocks, byte[] metas, - BiomeGenBase[] p_147422_5_) { + BiomeGenBase[] p_147422_5_) { super.replaceBlocksForBiome(p_147422_1_, p_147422_2_, blocks, metas, p_147422_5_); for (int i = 0; i < blocks.length; i++) { if (blocks[i] == Blocks.grass) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java index 26ad8d9d7a..d5368b3f0d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java @@ -21,5 +21,5 @@ public class SkyProviderRoss128b { // ASM enables this texture public static final ResourceLocation sunTex = new ResourceLocation( - BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/World/SunRoss128.png"); + BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/World/SunRoss128.png"); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java index 12668f59e1..18a8eadd2c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java @@ -56,7 +56,7 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { Arrays.fill(ids, Blocks.air); this.generateTerrain(cx, cz, ids, meta); this.biomesForGeneration = this.worldObj.getWorldChunkManager() - .loadBlockGeneratorData(this.biomesForGeneration, cx * 16, cz * 16, 16, 16); + .loadBlockGeneratorData(this.biomesForGeneration, cx * 16, cz * 16, 16, 16); this.createCraters(cx, cz, ids, meta); this.replaceBlocksForBiome(cx, cz, ids, meta, this.biomesForGeneration); this.caveGenerator.generate(this, this.worldObj, cx, cz, ids, meta); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index 171d149986..f7bdec79eb 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -48,44 +48,44 @@ public class Ross128SolarSystem { public static void init() { Ross128SolarSystem.Ross128System = new SolarSystem("Ross128System", "milkyWay") - .setMapPosition(new Vector3(-0.5D, 0.65D, 0.0D)); + .setMapPosition(new Vector3(-0.5D, 0.65D, 0.0D)); Ross128SolarSystem.Ross128 = (Star) new Star("Ross128").setParentSolarSystem(Ross128SolarSystem.Ross128System) - .setTierRequired(-1); + .setTierRequired(-1); Ross128SolarSystem.Ross128.setUnreachable(); - Ross128SolarSystem.Ross128.setBodyIcon( - new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128.png")); + Ross128SolarSystem.Ross128 + .setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128.png")); Ross128SolarSystem.Ross128System.setMainStar(Ross128SolarSystem.Ross128); Ross128SolarSystem.Ross128b = new Planet("Ross128b").setParentSolarSystem(Ross128SolarSystem.Ross128System); Ross128SolarSystem.Ross128b.setRingColorRGB(0x9F / 255f, 0x8A / 255f, 0x79 / 255f); Ross128SolarSystem.Ross128b.setPhaseShift(1.25F); Ross128SolarSystem.Ross128b.setBodyIcon( - new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128b.png")); + new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128b.png")); Ross128SolarSystem.Ross128b.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(0.75F, 1.75F)); Ross128SolarSystem.Ross128b.setRelativeOrbitTime(0.65F); Ross128SolarSystem.Ross128b.atmosphere - .addAll(Arrays.asList(IAtmosphericGas.OXYGEN, IAtmosphericGas.NITROGEN, IAtmosphericGas.ARGON)); + .addAll(Arrays.asList(IAtmosphericGas.OXYGEN, IAtmosphericGas.NITROGEN, IAtmosphericGas.ARGON)); Ross128SolarSystem.Ross128b.setDimensionInfo(ConfigHandler.ross128BID, WorldProviderRoss128b.class); Ross128SolarSystem.Ross128b.setTierRequired(ConfigHandler.ross128btier); Ross128SolarSystem.Ross128ba = new Moon("Ross128ba").setParentPlanet(Ross128SolarSystem.Ross128b); Ross128SolarSystem.Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)) - .setRelativeOrbitTime(1 / 0.01F); + .setRelativeOrbitTime(1 / 0.01F); Ross128SolarSystem.Ross128ba.setBodyIcon( - new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); + new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128ba.class); Ross128SolarSystem.Ross128ba - .setTierRequired(GalaxySpace.isModLoaded() ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3); + .setTierRequired(GalaxySpace.isModLoaded() ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3); GalaxyRegistry.registerSolarSystem(Ross128SolarSystem.Ross128System); GalaxyRegistry.registerPlanet(Ross128SolarSystem.Ross128b); GalaxyRegistry.registerMoon(Ross128SolarSystem.Ross128ba); GalacticraftRegistry.registerRocketGui( - WorldProviderRoss128b.class, - new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/overworldRocketGui.png")); + WorldProviderRoss128b.class, + new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/overworldRocketGui.png")); GalacticraftRegistry.registerRocketGui( - WorldProviderRoss128ba.class, - new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/moonRocketGui.png")); + WorldProviderRoss128ba.class, + new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/moonRocketGui.png")); GalacticraftRegistry.registerTeleportType(WorldProviderRoss128b.class, new UniversalTeleportType()); GalacticraftRegistry.registerTeleportType(WorldProviderRoss128ba.class, new UniversalTeleportType()); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java index 0502f26f9c..cc9b1dcc2d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java @@ -42,7 +42,8 @@ public class GT_NBT_DataBase { } static GT_NBT_DataBase getGTTagFromId(Long id) { - return GT_NBT_DataBase.GTNBTBIMAP.inverse().get(id); + return GT_NBT_DataBase.GTNBTBIMAP.inverse() + .get(id); } static Long getIdFromGTTag(GT_NBT_DataBase tagCompound) { @@ -50,7 +51,8 @@ public class GT_NBT_DataBase { } static NBTTagCompound getTagFromId(Long id) { - return GT_NBT_DataBase.tagIdBiMap.inverse().get(id); + return GT_NBT_DataBase.tagIdBiMap.inverse() + .get(id); } static Long getIdFromTag(NBTTagCompound tagCompound) { @@ -89,7 +91,7 @@ public class GT_NBT_DataBase { } public static GT_NBT_DataBase makeNewWithoutRegister(String mDataName, String mDataTitle, - NBTTagCompound tagCompound) { + NBTTagCompound tagCompound) { return new GT_NBT_DataBase(tagCompound, mDataName, mDataTitle, Long.MIN_VALUE); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java index 469c23b065..fdfe3d7ee9 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java @@ -41,7 +41,7 @@ import li.cil.oc.api.network.SimpleComponent; @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = Mods.Names.OPEN_COMPUTERS) public class TileEntity_GTDataServer extends TileEntity - implements ISidedInventory, ITileAddsInformation, ITileHasDifferentTextureSides, SimpleComponent { + implements ISidedInventory, ITileAddsInformation, ITileHasDifferentTextureSides, SimpleComponent { private final BiMap OrbDataBase = HashBiMap.create(); @@ -58,7 +58,12 @@ public class TileEntity_GTDataServer extends TileEntity public Object[] listData(Context context, Arguments args) { Set ret = new HashSet<>(); for (Map.Entry entry : this.OrbDataBase.entrySet()) { - ret.add(entry.getValue().getId() + Long.MAX_VALUE + ". " + entry.getValue().getmDataTitle()); + ret.add( + entry.getValue() + .getId() + Long.MAX_VALUE + + ". " + + entry.getValue() + .getmDataTitle()); } return ret.toArray(new String[0]); } @@ -79,21 +84,21 @@ public class TileEntity_GTDataServer extends TileEntity if (this.isServerSide()) { if (GT_Utility.areStacksEqual(this.mItems[0], ItemList.Tool_DataOrb.get(1)) - && this.mItems[0].hasTagCompound()) { + && this.mItems[0].hasTagCompound()) { if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) { this.OrbDataBase.put( - GT_NBT_DataBase.getMaxID(), - new GT_NBT_DataBase( - Behaviour_DataOrb.getDataName(this.mItems[0]), - Behaviour_DataOrb.getDataTitle(this.mItems[0]), - this.mItems[0].getTagCompound())); + GT_NBT_DataBase.getMaxID(), + new GT_NBT_DataBase( + Behaviour_DataOrb.getDataName(this.mItems[0]), + Behaviour_DataOrb.getDataTitle(this.mItems[0]), + this.mItems[0].getTagCompound())); } else { long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()); this.OrbDataBase.put(id, GT_NBT_DataBase.getGTTagFromId(id)); } } if (GT_Utility.areStacksEqual(this.mItems[0], ItemList.Tool_DataStick.get(1)) - && this.mItems[0].hasTagCompound()) { + && this.mItems[0].hasTagCompound()) { String bookTitle = GT_Utility.ItemNBT.getBookTitle(this.mItems[0]); String punchcardData = GT_Utility.ItemNBT.getPunchCardData(this.mItems[0]); @@ -101,13 +106,13 @@ public class TileEntity_GTDataServer extends TileEntity byte data = (byte) (bookTitle.isEmpty() ? punchcardData.isEmpty() ? mapID != -1 ? 3 : -1 : 2 : 1); String title = data == 1 ? bookTitle - : data == 2 ? punchcardData : data == 3 ? "" + mapID : "Custom Data"; + : data == 2 ? punchcardData : data == 3 ? "" + mapID : "Custom Data"; String name = data == 1 ? "eBook" - : data == 2 ? "Punch Card Data" : data == 3 ? "Map Data" : "Custom Data"; + : data == 2 ? "Punch Card Data" : data == 3 ? "Map Data" : "Custom Data"; if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) { this.OrbDataBase.put( - GT_NBT_DataBase.getMaxID(), - new GT_NBT_DataBase(name, title, this.mItems[0].getTagCompound())); + GT_NBT_DataBase.getMaxID(), + new GT_NBT_DataBase(name, title, this.mItems[0].getTagCompound())); } else { long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()); this.OrbDataBase.put(id, GT_NBT_DataBase.getGTTagFromId(id)); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java index 9166424a43..a760c5e256 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java @@ -34,61 +34,60 @@ public class TecTechResearchLoader { public static void runResearches() { Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null - ? FluidRegistry.getFluid("molten.indalloy140") - : FluidRegistry.getFluid("molten.solderingalloy"); + ? FluidRegistry.getFluid("molten.indalloy140") + : FluidRegistry.getFluid("molten.solderingalloy"); if (GalactiGreg.isModLoaded()) { TT_recipeAdder.addResearchableAssemblylineRecipe( - ItemRegistry.voidminer[0].copy(), - 1024000, - 256, - (int) TierEU.RECIPE_ZPM, - 24, - new Object[] { ItemRegistry.voidminer[0].copy(), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), - Materials.BlackPlutonium.getPlates(3), ItemList.Electric_Motor_ZPM.get(9L), - ItemList.Sensor_ZPM.get(9L), ItemList.Field_Generator_ZPM.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) }, - new FluidStack[] { new FluidStack(solderIndalloy, 1440), - WerkstoffLoader.Krypton.getFluidOrGas(20000) }, - ItemRegistry.voidminer[1].copy(), - 5 * MINUTES, - (int) TierEU.RECIPE_ZPM); + ItemRegistry.voidminer[0].copy(), + 1024000, + 256, + (int) TierEU.RECIPE_ZPM, + 24, + new Object[] { ItemRegistry.voidminer[0].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), + Materials.BlackPlutonium.getPlates(3), ItemList.Electric_Motor_ZPM.get(9L), + ItemList.Sensor_ZPM.get(9L), ItemList.Field_Generator_ZPM.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) }, + new FluidStack[] { new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Krypton.getFluidOrGas(20000) }, + ItemRegistry.voidminer[1].copy(), + 5 * MINUTES, + (int) TierEU.RECIPE_ZPM); TT_recipeAdder.addResearchableAssemblylineRecipe( - ItemRegistry.voidminer[1].copy(), - 8192000, - 512, - (int) TierEU.RECIPE_UV, - 64, - new Object[] { ItemRegistry.voidminer[1].copy(), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), - Materials.Neutronium.getPlates(3), ItemList.Electric_Motor_UV.get(9L), - ItemList.Sensor_UV.get(9L), ItemList.Field_Generator_UV.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) }, - new FluidStack[] { new FluidStack(solderIndalloy, 1440), - WerkstoffLoader.Oganesson.getFluidOrGas(20000) }, - ItemRegistry.voidminer[2].copy(), - 5 * MINUTES, - (int) TierEU.RECIPE_UV); - } - - TT_recipeAdder.addResearchableAssemblylineRecipe( - ItemList.Machine_Multi_ImplosionCompressor.get(1L), - 64000, - 48, + ItemRegistry.voidminer[1].copy(), + 8192000, + 512, (int) TierEU.RECIPE_UV, - 8, - new Object[] { ItemList.Machine_Multi_ImplosionCompressor.get(1L), Materials.Neutronium.getBlocks(5), - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorUHV, 64), - ItemList.Electric_Piston_UV.get(64), }, - new FluidStack[] { new FluidStack(solderIndalloy, 1440), Materials.Osmium.getMolten(1440), - Materials.Neutronium.getMolten(1440) }, - ItemRegistry.eic.copy(), + 64, + new Object[] { ItemRegistry.voidminer[1].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), + Materials.Neutronium.getPlates(3), ItemList.Electric_Motor_UV.get(9L), ItemList.Sensor_UV.get(9L), + ItemList.Field_Generator_UV.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) }, + new FluidStack[] { new FluidStack(solderIndalloy, 1440), + WerkstoffLoader.Oganesson.getFluidOrGas(20000) }, + ItemRegistry.voidminer[2].copy(), 5 * MINUTES, (int) TierEU.RECIPE_UV); + } + + TT_recipeAdder.addResearchableAssemblylineRecipe( + ItemList.Machine_Multi_ImplosionCompressor.get(1L), + 64000, + 48, + (int) TierEU.RECIPE_UV, + 8, + new Object[] { ItemList.Machine_Multi_ImplosionCompressor.get(1L), Materials.Neutronium.getBlocks(5), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorUHV, 64), + ItemList.Electric_Piston_UV.get(64), }, + new FluidStack[] { new FluidStack(solderIndalloy, 1440), Materials.Osmium.getMolten(1440), + Materials.Neutronium.getMolten(1440) }, + ItemRegistry.eic.copy(), + 5 * MINUTES, + (int) TierEU.RECIPE_UV); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java index ae19e8d635..e3a2065ed5 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java @@ -56,14 +56,15 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel } default void moveAroundLowPower(IGregTechTileEntity aBaseMetaTileEntity) { - byte color = this.getBaseMetaTileEntity().getColorization(); + byte color = this.getBaseMetaTileEntity() + .getColorization(); if (color >= 0) { ForgeDirection front = aBaseMetaTileEntity.getFrontFacing(); ForgeDirection opposite = front.getOpposite(); for (short dist = 1; dist < 250; ++dist) { IGregTechTileEntity tGTTileEntity = aBaseMetaTileEntity - .getIGregTechTileEntityAtSideAndDistance(front, dist); + .getIGregTechTileEntityAtSideAndDistance(front, dist); if (tGTTileEntity == null || tGTTileEntity.getColorization() != color) { return; } @@ -74,9 +75,9 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel } if (aMetaTileEntity instanceof LowPowerLaser lowPowerLaser && lowPowerLaser.isReceiver() - && opposite == tGTTileEntity.getFrontFacing()) { + && opposite == tGTTileEntity.getFrontFacing()) { if (this.maxEUOutput() > lowPowerLaser.maxEUInput() - || this.getAMPERES() > lowPowerLaser.getAMPERES()) { + || this.getAMPERES() > lowPowerLaser.getAMPERES()) { aMetaTileEntity.doExplosion(this.maxEUOutput()); this.setEUVar(aBaseMetaTileEntity.getStoredEU() - this.maxEUOutput()); return; @@ -84,19 +85,21 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel if (this.maxEUOutput() == lowPowerLaser.maxEUInput()) { long diff = Math.min( - this.getAMPERES() * 20L * this.maxEUOutput(), - Math.min( - lowPowerLaser.maxEUStore() - - aMetaTileEntity.getBaseMetaTileEntity().getStoredEU(), - aBaseMetaTileEntity.getStoredEU())); + this.getAMPERES() * 20L * this.maxEUOutput(), + Math.min( + lowPowerLaser.maxEUStore() - aMetaTileEntity.getBaseMetaTileEntity() + .getStoredEU(), + aBaseMetaTileEntity.getStoredEU())); this.setEUVar(aBaseMetaTileEntity.getStoredEU() - diff); - lowPowerLaser.setEUVar(aMetaTileEntity.getBaseMetaTileEntity().getStoredEU() + diff); + lowPowerLaser.setEUVar( + aMetaTileEntity.getBaseMetaTileEntity() + .getStoredEU() + diff); } return; } if ((!(aMetaTileEntity instanceof LowPowerLaser lowPowerLaser) || !lowPowerLaser.isTunnel()) - && !(aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy)) { + && !(aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy)) { return; } @@ -109,7 +112,7 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel } if (aMetaTileEntity instanceof LowPowerLaser lowPowerLaser && lowPowerLaser.isTunnel() - && !lowPowerLaser.isConnectedCorrectly(front)) { + && !lowPowerLaser.isConnectedCorrectly(front)) { return; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java index ce6c44e1f7..c1d751739f 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java @@ -26,30 +26,30 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_TieredMachineBlock - implements LowPowerLaser { + implements LowPowerLaser { protected long AMPERES; public TT_Abstract_LowPowerLaserThingy(int aID, String aName, String aNameRegional, int aTier, long aAmperes, - int aInvSlotCount, String aDescription, ITexture... aTextures) { + int aInvSlotCount, String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); this.AMPERES = aAmperes; } public TT_Abstract_LowPowerLaserThingy(int aID, String aName, String aNameRegional, int aTier, long aAmperes, - int aInvSlotCount, String[] aDescription, ITexture... aTextures) { + int aInvSlotCount, String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); this.AMPERES = aAmperes; } public TT_Abstract_LowPowerLaserThingy(String aName, int aTier, long aAmperes, int aInvSlotCount, - String aDescription, ITexture[][][] aTextures) { + String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); this.AMPERES = aAmperes; } public TT_Abstract_LowPowerLaserThingy(String aName, int aTier, long aAmperes, int aInvSlotCount, - String[] aDescription, ITexture[][][] aTextures) { + String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); this.AMPERES = aAmperes; } @@ -61,13 +61,13 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_ @Override public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, ForgeDirection side, - ItemStack itemStack) { + ItemStack itemStack) { return false; } @Override public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, ForgeDirection side, - ItemStack itemStack) { + ItemStack itemStack) { return false; } @@ -93,7 +93,8 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_ @Override public void saveNBTData(NBTTagCompound nbtTagCompound) { - Optional.ofNullable(nbtTagCompound).ifPresent(tag -> tag.setLong("AMPERES", this.AMPERES)); + Optional.ofNullable(nbtTagCompound) + .ifPresent(tag -> tag.setLong("AMPERES", this.AMPERES)); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java index d2e1c3aa52..b79ddb4a44 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java @@ -27,23 +27,25 @@ import gregtech.api.util.GT_Utility; public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLaserThingy { public TT_MetaTileEntity_LowPowerLaserBox(int aID, String aName, String aNameRegional, int aTier, long aAmperes, - ITexture... aTextures) { + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aAmperes, 0, new String[0], aTextures); } public TT_MetaTileEntity_LowPowerLaserBox(String aName, int aTier, long aAmperes, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aAmperes, 0, aDescription, aTextures); } @Override public boolean isSender() { - return this.getBaseMetaTileEntity().isAllowedToWork(); + return this.getBaseMetaTileEntity() + .isAllowedToWork(); } @Override public boolean isReceiver() { - return !this.getBaseMetaTileEntity().isAllowedToWork(); + return !this.getBaseMetaTileEntity() + .isAllowedToWork(); } @Override @@ -53,12 +55,14 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase @Override public long maxAmperesOut() { - return !this.getBaseMetaTileEntity().isAllowedToWork() ? this.AMPERES : 0; + return !this.getBaseMetaTileEntity() + .isAllowedToWork() ? this.AMPERES : 0; } @Override public long maxAmperesIn() { - return this.getBaseMetaTileEntity().isAllowedToWork() ? this.AMPERES + this.AMPERES / 4 : 0; + return this.getBaseMetaTileEntity() + .isAllowedToWork() ? this.AMPERES + this.AMPERES / 4 : 0; } @Override @@ -73,27 +77,30 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase @Override public boolean isEnetInput() { - return this.getBaseMetaTileEntity().isAllowedToWork(); + return this.getBaseMetaTileEntity() + .isAllowedToWork(); } @Override public boolean isEnetOutput() { - return !this.getBaseMetaTileEntity().isAllowedToWork(); + return !this.getBaseMetaTileEntity() + .isAllowedToWork(); } @Override public boolean canConnect(ForgeDirection side) { - return side == this.getBaseMetaTileEntity().getFrontFacing(); + return side == this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new TT_MetaTileEntity_LowPowerLaserBox( - this.mName, - this.mTier, - this.AMPERES, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.AMPERES, + this.mDescriptionArray, + this.mTextures); } @Override @@ -109,8 +116,8 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase this.setEUVar(0L); } } - if (this.getBaseMetaTileEntity().isAllowedToWork() - && aBaseMetaTileEntity.getStoredEU() > this.getMinimumStoredEU()) { + if (this.getBaseMetaTileEntity() + .isAllowedToWork() && aBaseMetaTileEntity.getStoredEU() > this.getMinimumStoredEU()) { this.moveAroundLowPower(aBaseMetaTileEntity); } } @@ -123,29 +130,29 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase for (byte i = -1; i < 16; ++i) { rTextures[0][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; rTextures[1][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; rTextures[2][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] }; rTextures[3][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] }; + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] }; rTextures[4][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] }; + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] }; rTextures[5][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] }; + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] }; rTextures[6][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; rTextures[7][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; rTextures[8][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; rTextures[9][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] }; + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] }; rTextures[10][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] }; + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] }; rTextures[11][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] }; + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] }; } return rTextures; @@ -153,18 +160,18 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { + int aColorIndex, boolean aActive, boolean aRedstone) { return this.mTextures[Math.min(2, side.ordinal()) + (side == facing ? 3 : 0) + (aActive ? 0 : 6)][aColorIndex - + 1]; + + 1]; } @Override public String[] getDescription() { return new String[] { "Like a Tranformer... but for LAZORZ", - "Transfer rate: " + ChatColorHelper.YELLOW - + GT_Utility.formatNumbers(this.getTotalPower()) - + ChatColorHelper.WHITE - + " EU/t", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; + "Transfer rate: " + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.getTotalPower()) + + ChatColorHelper.WHITE + + " EU/t", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java index d2c9d888af..5a9cd8048b 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java @@ -27,25 +27,25 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GT_Utility; public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hatch_DynamoTunnel - implements LowPowerLaser { + implements LowPowerLaser { public TT_MetaTileEntity_LowPowerLaserDynamo(int aID, String aName, String aNameRegional, int aTier, int aAmp) { super(aID, aName, aNameRegional, aTier, aAmp); } public TT_MetaTileEntity_LowPowerLaserDynamo(String aName, int aTier, int aAmp, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aAmp, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new TT_MetaTileEntity_LowPowerLaserDynamo( - this.mName, - this.mTier, - this.Amperes, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.Amperes, + this.mDescriptionArray, + this.mTextures); } @Override @@ -71,13 +71,13 @@ public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hat @Override public String[] getDescription() { return ArrayUtils.addAll( - this.mDescriptionArray, - StatCollector.translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(this.getTotalPower()) - + EnumChatFormatting.RESET - + " EU/t", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); + this.mDescriptionArray, + StatCollector.translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(this.getTotalPower()) + + EnumChatFormatting.RESET + + " EU/t", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java index 6a0425bfbc..6b6b6c3558 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java @@ -27,37 +27,37 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GT_Utility; public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatch_EnergyTunnel - implements LowPowerLaser { + implements LowPowerLaser { public TT_MetaTileEntity_LowPowerLaserHatch(int aID, String aName, String aNameRegional, int aTier, int aAmp) { super(aID, aName, aNameRegional, aTier, aAmp); } public TT_MetaTileEntity_LowPowerLaserHatch(String aName, int aTier, int aAmp, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aAmp, aDescription, aTextures); } @Override public String[] getDescription() { return ArrayUtils.addAll( - this.mDescriptionArray, - StatCollector.translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(this.getTotalPower()) - + EnumChatFormatting.RESET - + " EU/t", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); + this.mDescriptionArray, + StatCollector.translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(this.getTotalPower()) + + EnumChatFormatting.RESET + + " EU/t", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new TT_MetaTileEntity_LowPowerLaserHatch( - this.mName, - this.mTier, - this.Amperes, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.Amperes, + this.mDescriptionArray, + this.mTextures); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java index 63978c55df..38ad31688d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java @@ -41,21 +41,21 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca } public TT_MetaTileEntity_Pipe_Energy_LowPower(String aName, float aThickNess, Materials aMaterial, - long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) { + long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) { super(aName, aThickNess, aMaterial, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new TT_MetaTileEntity_Pipe_Energy_LowPower( - this.mName, - this.mThickNess, - this.mMaterial, - this.mCableLossPerMeter, - this.mAmperage, - this.mVoltage, - this.mInsulated, - this.mCanShock); + this.mName, + this.mThickNess, + this.mMaterial, + this.mCableLossPerMeter, + this.mAmperage, + this.mVoltage, + this.mInsulated, + this.mCanShock); } @Override @@ -66,35 +66,35 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection siide, byte aConnections, - int aColorIndex, boolean aConnected, boolean aRedstone) { + int aColorIndex, boolean aConnected, boolean aRedstone) { return new ITexture[] { TextureFactory.of( - Block.getBlockFromItem(Ic2Items.glassFiberCableBlock.getItem()), - Ic2Items.glassFiberCableBlock.getItemDamage(), - siide) }; + Block.getBlockFromItem(Ic2Items.glassFiberCableBlock.getItem()), + Ic2Items.glassFiberCableBlock.getItemDamage(), + siide) }; } @Override public String[] getDescription() { return new String[] { "Primitive Laser Cable intended for Low Power Applications", "Does not auto-connect", - "Does not turn or bend", - ChatColorHelper.WHITE + "Must be " - + ChatColorHelper.YELLOW - + "c" - + ChatColorHelper.RED - + "o" - + ChatColorHelper.BLUE - + "l" - + ChatColorHelper.DARKPURPLE - + "o" - + ChatColorHelper.GOLD - + "r" - + ChatColorHelper.DARKRED - + "e" - + ChatColorHelper.DARKGREEN - + "d" - + ChatColorHelper.WHITE - + " in order to work", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; + "Does not turn or bend", + ChatColorHelper.WHITE + "Must be " + + ChatColorHelper.YELLOW + + "c" + + ChatColorHelper.RED + + "o" + + ChatColorHelper.BLUE + + "l" + + ChatColorHelper.DARKPURPLE + + "o" + + ChatColorHelper.GOLD + + "r" + + ChatColorHelper.DARKRED + + "e" + + ChatColorHelper.DARKGREEN + + "d" + + ChatColorHelper.WHITE + + " in order to work", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } @Override @@ -139,25 +139,25 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca @Override @Deprecated public long transferElectricity(ForgeDirection side, long aVoltage, long aAmperage, - ArrayList aAlreadyPassedTileEntityList) { + ArrayList aAlreadyPassedTileEntityList) { return 0L; } @Override public long transferElectricity(ForgeDirection side, long aVoltage, long aAmperage, - HashSet aAlreadyPassedSet) { + HashSet aAlreadyPassedSet) { return 0L; } @Override public boolean letsIn(GT_CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return true; } @Override public boolean letsOut(GT_CoverBehavior coverBehavior, ForgeDirection side, int aCoverID, int aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return true; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java index 04e65781d6..2959bc2fb2 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java @@ -17,15 +17,15 @@ import vexatos.tgregworks.item.ItemTGregPart; import vexatos.tgregworks.reference.Config; @Mod( - modid = MaterialsInjector.MOD_ID, - name = MaterialsInjector.NAME, - version = MaterialsInjector.VERSION, - dependencies = """ - required-after:IC2;\ - required-after:gregtech;\ - required-after:bartworks;\ - before:TGregworks;\ - before:miscutils;""") + modid = MaterialsInjector.MOD_ID, + name = MaterialsInjector.NAME, + version = MaterialsInjector.VERSION, + dependencies = """ + required-after:IC2;\ + required-after:gregtech;\ + required-after:bartworks;\ + before:TGregworks;\ + before:miscutils;""") public class MaterialsInjector { public static final String NAME = "BartWorks Mod Additions - TGregworks Container"; @@ -42,12 +42,14 @@ public class MaterialsInjector { public static void run() { MainMod.LOGGER.info("Registering TGregworks - BartWorks tool parts."); Werkstoff.werkstoffHashSet.stream() - .filter(x -> x.hasItemType(OrePrefixes.gem) || x.hasItemType(OrePrefixes.plate)) - .map(Werkstoff::getBridgeMaterial).filter(x -> x.mMetaItemSubID == -1).filter(x -> x.mDurability != 0) - .forEach(m -> { - setConfigProps(m); - registerParts(m); - }); + .filter(x -> x.hasItemType(OrePrefixes.gem) || x.hasItemType(OrePrefixes.plate)) + .map(Werkstoff::getBridgeMaterial) + .filter(x -> x.mMetaItemSubID == -1) + .filter(x -> x.mDurability != 0) + .forEach(m -> { + setConfigProps(m); + registerParts(m); + }); TGregworks.registry.configProps.clear(); TGregworks.registry.configIDs.clear(); @@ -68,10 +70,11 @@ public class MaterialsInjector { } private static void setConfigProps(Materials m) { - if (TGregworks.config.get(Config.Category.Enable, m.mName, true).getBoolean(true)) { + if (TGregworks.config.get(Config.Category.Enable, m.mName, true) + .getBoolean(true)) { TGregworks.registry.toolMaterials.add(m); Property configProp = TGregworks.config - .get(Config.onMaterial(Config.MaterialID), m.mName, 0, null, 0, 100000); + .get(Config.onMaterial(Config.MaterialID), m.mName, 0, null, 0, 100000); TGregworks.registry.configProps.put(m, configProp); TGregworks.registry.configIDs.add(configProp.getInt()); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java index 126684a302..c52e440383 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java @@ -78,7 +78,7 @@ public class GT_Multi_IndustrialCrucible extends GT_MetaTileEntity_MultiBlockBas @Override public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean b3, boolean b4) { + int colorIndex, boolean b3, boolean b4) { return new ITexture[0]; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java index 5dfada8a82..79e606d536 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java @@ -73,8 +73,10 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { public long[] getStoredEnergy() { boolean scaleOverflow = false; boolean storedOverflow = false; - long tScale = this.getBaseMetaTileEntity().getEUCapacity(); - long tStored = this.getBaseMetaTileEntity().getStoredEU(); + long tScale = this.getBaseMetaTileEntity() + .getEUCapacity(); + long tStored = this.getBaseMetaTileEntity() + .getStoredEU(); long tStep; if (this.mInventory != null) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index 7aca6b05b7..9492a6c077 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -44,7 +44,9 @@ public class ThaumcraftHandler { public static boolean isWand(ItemStack aStack) { try { - return aStack != null && ThaumcraftHandler.mWandInterface.isAssignableFrom(aStack.getItem().getClass()); + return aStack != null && ThaumcraftHandler.mWandInterface.isAssignableFrom( + aStack.getItem() + .getClass()); } catch (Throwable var3) { return false; } @@ -54,8 +56,9 @@ public class ThaumcraftHandler { if (ThaumcraftHandler.magicalForestBiomeID == null) { try { BiomeGenBase biome = (BiomeGenBase) Class - .forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator").getField("biomeMagicalForest") - .get(null); + .forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator") + .getField("biomeMagicalForest") + .get(null); return biomeID == (ThaumcraftHandler.magicalForestBiomeID = biome.biomeID); } catch (ClassCastException | ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); @@ -69,8 +72,9 @@ public class ThaumcraftHandler { if (ThaumcraftHandler.taintBiomeID == null) { try { BiomeGenBase TaintBiome = (BiomeGenBase) Class - .forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator").getField("biomeTaint") - .get(null); + .forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator") + .getField("biomeTaint") + .get(null); return biomeID == (ThaumcraftHandler.taintBiomeID = TaintBiome.biomeID); } catch (ClassCastException | ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); @@ -100,28 +104,25 @@ public class ThaumcraftHandler { ThaumcraftHandler.AspectAdder.mAspectListClass = Class.forName("thaumcraft.api.aspects.AspectList"); ThaumcraftHandler.AspectAdder.mAspectClass = Class.forName("thaumcraft.api.aspects.Aspect"); ThaumcraftHandler.AspectAdder.addToList = ThaumcraftHandler.AspectAdder.mAspectListClass - .getMethod("add", ThaumcraftHandler.AspectAdder.mAspectClass, int.class); + .getMethod("add", ThaumcraftHandler.AspectAdder.mAspectClass, int.class); ThaumcraftHandler.AspectAdder.registerObjectTag = Class.forName("thaumcraft.api.ThaumcraftApi") - .getMethod( - "registerObjectTag", - ItemStack.class, - ThaumcraftHandler.AspectAdder.mAspectListClass); + .getMethod("registerObjectTag", ItemStack.class, ThaumcraftHandler.AspectAdder.mAspectListClass); ThaumcraftHandler.AspectAdder.getName = ThaumcraftHandler.AspectAdder.mAspectClass.getMethod("getName"); ThaumcraftHandler.AspectAdder.writeAspectListToNBT = ThaumcraftHandler.AspectAdder.mAspectListClass - .getMethod("writeToNBT", NBTTagCompound.class); + .getMethod("writeToNBT", NBTTagCompound.class); ThaumcraftHandler.AspectAdder.add = ThaumcraftHandler.AspectAdder.mAspectListClass - .getMethod("add", ThaumcraftHandler.AspectAdder.mAspectListClass); + .getMethod("add", ThaumcraftHandler.AspectAdder.mAspectListClass); ThaumcraftHandler.AspectAdder.getAmount = ThaumcraftHandler.AspectAdder.mAspectListClass - .getMethod("getAmount", ThaumcraftHandler.AspectAdder.mAspectClass); + .getMethod("getAmount", ThaumcraftHandler.AspectAdder.mAspectClass); ThaumcraftHandler.AspectAdder.getAspects = ThaumcraftHandler.AspectAdder.mAspectListClass - .getMethod("getAspects"); + .getMethod("getAspects"); ThaumcraftHandler.AspectAdder.readAspectListFromNBT = ThaumcraftHandler.AspectAdder.mAspectListClass - .getMethod("readFromNBT", NBTTagCompound.class); + .getMethod("readFromNBT", NBTTagCompound.class); ThaumcraftHandler.AspectAdder.isResearchComplete = Class - .forName("thaumcraft.common.lib.research.ResearchManager") - .getMethod("isResearchComplete", String.class, String.class); + .forName("thaumcraft.common.lib.research.ResearchManager") + .getMethod("isResearchComplete", String.class, String.class); ThaumcraftHandler.AspectAdder.linkedAspektList = ThaumcraftHandler.AspectAdder.mAspectListClass - .getField("aspects"); + .getField("aspects"); } catch (ClassNotFoundException | NoSuchMethodException | NoSuchFieldException e) { e.printStackTrace(); } @@ -131,16 +132,17 @@ public class ThaumcraftHandler { public static void addAspectViaBW(ItemStack stack, Pair... aspectPair) { if (stack == null || stack.getItem() == null || stack.getUnlocalizedName() == null) return; try { - Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.getConstructor().newInstance(); + Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.getConstructor() + .newInstance(); for (Pair a : aspectPair) { if (API_ConfigValues.debugLog) DebugLog.log( - "Stack:" + stack.getDisplayName() - + " Damage:" - + stack.getItemDamage() - + " aspectPair: " - + ThaumcraftHandler.AspectAdder.getName.invoke(a.getKey()) - + " / " - + a.getValue()); + "Stack:" + stack.getDisplayName() + + " Damage:" + + stack.getItemDamage() + + " aspectPair: " + + ThaumcraftHandler.AspectAdder.getName.invoke(a.getKey()) + + " / " + + a.getValue()); ThaumcraftHandler.AspectAdder.addToList.invoke(aspectList, a.getKey(), a.getValue()); } ThaumcraftHandler.AspectAdder.registerObjectTag.invoke(null, stack, aspectList); @@ -151,9 +153,10 @@ public class ThaumcraftHandler { public static void addAspectViaGT(ItemStack stack, TC_Aspects.TC_AspectStack... tc_aspectStacks) { try { - Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.getConstructor().newInstance(); + Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.getConstructor() + .newInstance(); for (TC_Aspects.TC_AspectStack tc_aspects : tc_aspectStacks) ThaumcraftHandler.AspectAdder.addToList - .invoke(aspectList, tc_aspects.mAspect.mAspect, (int) tc_aspects.mAmount); + .invoke(aspectList, tc_aspects.mAspect.mAspect, (int) tc_aspects.mAmount); ThaumcraftHandler.AspectAdder.registerObjectTag.invoke(null, stack, aspectList); } catch (Exception e) { e.printStackTrace(); -- cgit From a3bc5e1404d24b1af784d165988baba682f660a5 Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Fri, 24 May 2024 19:00:23 +0100 Subject: Add to ignore-revs --- .git-blame-ignore-revs | 1 + 1 file changed, 1 insertion(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 1ed528584f..b4d44c6096 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,3 +1,4 @@ # Ignore spotlessApply reformat f0f62d38a0c7834336afb73446ed67f7a850ae44 dff9a4e6c3e688dd66dd44ce546d1d1e01f5c77a +9c07ac0bffe24963f4fd6f44d148e3dcea5b2fd7 -- cgit